prep for demo

This commit is contained in:
Orion Reed 2024-07-09 01:55:51 +01:00
parent 772a42c947
commit b37c09bae9
8 changed files with 49 additions and 7 deletions

33
.github/workflows/deploy.yml vendored Normal file
View File

@ -0,0 +1,33 @@
name: Deploy to GitHub Pages
on:
push:
branches:
- main
- pages-demo
permissions:
contents: write
jobs:
build-and-deploy:
concurrency: ci-${{ github.ref }}
runs-on: ubuntu-latest
steps:
- name: Checkout 🛎️
uses: actions/checkout@v3
- name: Enable Corepack 📦
run: |
corepack enable
corepack prepare yarn@4.0.2 --activate
- name: Build 🔧
run: |
yarn install
yarn build
- name: Deploy 🚀
uses: JamesIves/github-pages-deploy-action@v4
with:
folder: dist

View File

@ -10,7 +10,7 @@ export default function YjsExample() {
MainMenu: CustomMainMenu,
}}
onMount={onMount}
persistenceKey='funcArrows'
persistenceKey='scoped-propagators'
/>
</div>
)

View File

@ -1,4 +1,4 @@
import { SpatialIndex } from "@/SpatialIndex"
import { SpatialIndex } from "@/propagators/SpatialIndex"
import { Editor, TLShape, TLShapeId, VecLike, polygonsIntersect } from "tldraw"
export class Geo {

View File

@ -1,11 +1,20 @@
import { DeltaTime } from "@/DeltaTime"
import { Geo } from "@/Geo"
import { Edge, getArrowsFromShape, getEdge } from "@/tlgraph"
import { isShapeOfType, updateProps } from "@/utils"
import { DeltaTime } from "@/propagators/DeltaTime"
import { Geo } from "@/propagators/Geo"
import { Edge, getArrowsFromShape, getEdge } from "@/propagators/tlgraph"
import { isShapeOfType, updateProps } from "@/propagators/utils"
import { Editor, TLArrowShape, TLBinding, TLGroupShape, TLShape, TLShapeId } from "tldraw"
type Prefix = 'click' | 'tick' | 'geo' | ''
export function registerDefaultPropagators(editor: Editor) {
registerPropagators(editor, [
ChangePropagator,
ClickPropagator,
TickPropagator,
SpatialPropagator,
])
}
function isPropagatorOfType(arrow: TLShape, prefix: Prefix) {
if (!isShapeOfType<TLArrowShape>(arrow, 'arrow')) return false
const regex = new RegExp(`^\\s*${prefix}\\s*\\{`)

View File

@ -1,4 +1,4 @@
import { isShapeOfType } from "@/utils";
import { isShapeOfType } from "@/propagators/utils";
import { Editor, TLArrowBinding, TLArrowShape, TLShape, TLShapeId } from "tldraw";
export interface Edge {