@dxos/plugin-tldraw 0.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +105 -0
- package/PLUGIN.mdl +412 -0
- package/README.md +3 -0
- package/dist/assets/embed-icons/codepen.png +0 -0
- package/dist/assets/embed-icons/codesandbox.png +0 -0
- package/dist/assets/embed-icons/desmos.png +0 -0
- package/dist/assets/embed-icons/excalidraw.png +0 -0
- package/dist/assets/embed-icons/felt.png +0 -0
- package/dist/assets/embed-icons/figma.png +0 -0
- package/dist/assets/embed-icons/github_gist.png +0 -0
- package/dist/assets/embed-icons/google_calendar.png +0 -0
- package/dist/assets/embed-icons/google_maps.png +0 -0
- package/dist/assets/embed-icons/google_slides.png +0 -0
- package/dist/assets/embed-icons/observable.png +0 -0
- package/dist/assets/embed-icons/replit.png +0 -0
- package/dist/assets/embed-icons/scratch.png +0 -0
- package/dist/assets/embed-icons/spotify.png +0 -0
- package/dist/assets/embed-icons/tldraw.png +0 -0
- package/dist/assets/embed-icons/val_town.png +0 -0
- package/dist/assets/embed-icons/vimeo.png +0 -0
- package/dist/assets/embed-icons/youtube.png +0 -0
- package/dist/assets/fonts/IBMPlexMono-Medium.woff2 +0 -0
- package/dist/assets/fonts/IBMPlexSans-Medium.woff2 +0 -0
- package/dist/assets/fonts/IBMPlexSerif-Medium.woff2 +0 -0
- package/dist/assets/fonts/Montserrat-Regular.woff2 +0 -0
- package/dist/assets/fonts/Shantell_Sans-Tldrawish.woff2 +0 -0
- package/dist/assets/icons/icon/0_merged.svg +1 -0
- package/dist/assets/icons/icon/align-bottom.svg +1 -0
- package/dist/assets/icons/icon/align-center-horizontal.svg +1 -0
- package/dist/assets/icons/icon/align-center-vertical.svg +1 -0
- package/dist/assets/icons/icon/align-left.svg +1 -0
- package/dist/assets/icons/icon/align-right.svg +1 -0
- package/dist/assets/icons/icon/align-top.svg +1 -0
- package/dist/assets/icons/icon/arrow-left.svg +1 -0
- package/dist/assets/icons/icon/arrowhead-arrow.svg +1 -0
- package/dist/assets/icons/icon/arrowhead-bar.svg +1 -0
- package/dist/assets/icons/icon/arrowhead-diamond.svg +1 -0
- package/dist/assets/icons/icon/arrowhead-dot.svg +1 -0
- package/dist/assets/icons/icon/arrowhead-none.svg +1 -0
- package/dist/assets/icons/icon/arrowhead-square.svg +1 -0
- package/dist/assets/icons/icon/arrowhead-triangle-inverted.svg +1 -0
- package/dist/assets/icons/icon/arrowhead-triangle.svg +1 -0
- package/dist/assets/icons/icon/blob.svg +1 -0
- package/dist/assets/icons/icon/bring-forward.svg +1 -0
- package/dist/assets/icons/icon/bring-to-front.svg +1 -0
- package/dist/assets/icons/icon/broken.svg +1 -0
- package/dist/assets/icons/icon/chat-teardrop-text.svg +1 -0
- package/dist/assets/icons/icon/check-circle.svg +1 -0
- package/dist/assets/icons/icon/check.svg +1 -0
- package/dist/assets/icons/icon/chevron-down.svg +1 -0
- package/dist/assets/icons/icon/chevron-left.svg +1 -0
- package/dist/assets/icons/icon/chevron-right.svg +1 -0
- package/dist/assets/icons/icon/chevron-up.svg +1 -0
- package/dist/assets/icons/icon/chevrons-ne.svg +1 -0
- package/dist/assets/icons/icon/chevrons-sw.svg +1 -0
- package/dist/assets/icons/icon/clipboard-copied.svg +1 -0
- package/dist/assets/icons/icon/clipboard-copy.svg +1 -0
- package/dist/assets/icons/icon/color.svg +1 -0
- package/dist/assets/icons/icon/cross-2.svg +1 -0
- package/dist/assets/icons/icon/cross-circle.svg +1 -0
- package/dist/assets/icons/icon/dash-dashed.svg +1 -0
- package/dist/assets/icons/icon/dash-dotted.svg +1 -0
- package/dist/assets/icons/icon/dash-draw.svg +1 -0
- package/dist/assets/icons/icon/dash-solid.svg +1 -0
- package/dist/assets/icons/icon/disconnected.svg +1 -0
- package/dist/assets/icons/icon/discord.svg +1 -0
- package/dist/assets/icons/icon/distribute-horizontal.svg +1 -0
- package/dist/assets/icons/icon/distribute-vertical.svg +1 -0
- package/dist/assets/icons/icon/dot.svg +1 -0
- package/dist/assets/icons/icon/dots-horizontal.svg +1 -0
- package/dist/assets/icons/icon/dots-vertical.svg +1 -0
- package/dist/assets/icons/icon/drag-handle-dots.svg +1 -0
- package/dist/assets/icons/icon/duplicate.svg +1 -0
- package/dist/assets/icons/icon/edit.svg +1 -0
- package/dist/assets/icons/icon/external-link.svg +1 -0
- package/dist/assets/icons/icon/fill-fill.svg +1 -0
- package/dist/assets/icons/icon/fill-none.svg +1 -0
- package/dist/assets/icons/icon/fill-pattern.svg +1 -0
- package/dist/assets/icons/icon/fill-semi.svg +1 -0
- package/dist/assets/icons/icon/fill-solid.svg +1 -0
- package/dist/assets/icons/icon/follow.svg +1 -0
- package/dist/assets/icons/icon/following.svg +1 -0
- package/dist/assets/icons/icon/font-draw.svg +8 -0
- package/dist/assets/icons/icon/font-mono.svg +1 -0
- package/dist/assets/icons/icon/font-sans.svg +1 -0
- package/dist/assets/icons/icon/font-serif.svg +1 -0
- package/dist/assets/icons/icon/geo-arrow-down.svg +1 -0
- package/dist/assets/icons/icon/geo-arrow-left.svg +1 -0
- package/dist/assets/icons/icon/geo-arrow-right.svg +1 -0
- package/dist/assets/icons/icon/geo-arrow-up.svg +1 -0
- package/dist/assets/icons/icon/geo-check-box.svg +1 -0
- package/dist/assets/icons/icon/geo-cloud.svg +1 -0
- package/dist/assets/icons/icon/geo-diamond.svg +1 -0
- package/dist/assets/icons/icon/geo-ellipse.svg +1 -0
- package/dist/assets/icons/icon/geo-heart.svg +1 -0
- package/dist/assets/icons/icon/geo-hexagon.svg +1 -0
- package/dist/assets/icons/icon/geo-octagon.svg +1 -0
- package/dist/assets/icons/icon/geo-oval.svg +1 -0
- package/dist/assets/icons/icon/geo-pentagon.svg +1 -0
- package/dist/assets/icons/icon/geo-rectangle.svg +1 -0
- package/dist/assets/icons/icon/geo-rhombus-2.svg +1 -0
- package/dist/assets/icons/icon/geo-rhombus.svg +1 -0
- package/dist/assets/icons/icon/geo-star.svg +1 -0
- package/dist/assets/icons/icon/geo-trapezoid.svg +1 -0
- package/dist/assets/icons/icon/geo-triangle.svg +1 -0
- package/dist/assets/icons/icon/geo-x-box.svg +1 -0
- package/dist/assets/icons/icon/github.svg +1 -0
- package/dist/assets/icons/icon/group.svg +1 -0
- package/dist/assets/icons/icon/horizontal-align-end.svg +1 -0
- package/dist/assets/icons/icon/horizontal-align-middle.svg +1 -0
- package/dist/assets/icons/icon/horizontal-align-start.svg +1 -0
- package/dist/assets/icons/icon/icon-names.json +143 -0
- package/dist/assets/icons/icon/info-circle.svg +1 -0
- package/dist/assets/icons/icon/leading.svg +1 -0
- package/dist/assets/icons/icon/link.svg +1 -0
- package/dist/assets/icons/icon/lock.svg +1 -0
- package/dist/assets/icons/icon/menu.svg +1 -0
- package/dist/assets/icons/icon/minus.svg +1 -0
- package/dist/assets/icons/icon/mixed.svg +1 -0
- package/dist/assets/icons/icon/pack.svg +1 -0
- package/dist/assets/icons/icon/plus.svg +1 -0
- package/dist/assets/icons/icon/question-mark-circle.svg +1 -0
- package/dist/assets/icons/icon/question-mark.svg +1 -0
- package/dist/assets/icons/icon/redo.svg +1 -0
- package/dist/assets/icons/icon/reset-zoom.svg +1 -0
- package/dist/assets/icons/icon/rotate-ccw.svg +1 -0
- package/dist/assets/icons/icon/rotate-cw.svg +1 -0
- package/dist/assets/icons/icon/send-backward.svg +1 -0
- package/dist/assets/icons/icon/send-to-back.svg +1 -0
- package/dist/assets/icons/icon/share-1.svg +1 -0
- package/dist/assets/icons/icon/size-extra-large.svg +1 -0
- package/dist/assets/icons/icon/size-large.svg +1 -0
- package/dist/assets/icons/icon/size-medium.svg +1 -0
- package/dist/assets/icons/icon/size-small.svg +1 -0
- package/dist/assets/icons/icon/spline-cubic.svg +1 -0
- package/dist/assets/icons/icon/spline-line.svg +1 -0
- package/dist/assets/icons/icon/stack-horizontal.svg +1 -0
- package/dist/assets/icons/icon/stack-vertical.svg +1 -0
- package/dist/assets/icons/icon/status-offline.svg +1 -0
- package/dist/assets/icons/icon/stretch-horizontal.svg +1 -0
- package/dist/assets/icons/icon/stretch-vertical.svg +1 -0
- package/dist/assets/icons/icon/text-align-center.svg +1 -0
- package/dist/assets/icons/icon/text-align-left.svg +1 -0
- package/dist/assets/icons/icon/text-align-right.svg +1 -0
- package/dist/assets/icons/icon/toggle-off.svg +1 -0
- package/dist/assets/icons/icon/toggle-on.svg +1 -0
- package/dist/assets/icons/icon/tool-arrow.svg +1 -0
- package/dist/assets/icons/icon/tool-eraser.svg +1 -0
- package/dist/assets/icons/icon/tool-frame.svg +1 -0
- package/dist/assets/icons/icon/tool-hand.svg +1 -0
- package/dist/assets/icons/icon/tool-highlight.svg +1 -0
- package/dist/assets/icons/icon/tool-laser.svg +1 -0
- package/dist/assets/icons/icon/tool-line.svg +1 -0
- package/dist/assets/icons/icon/tool-media.svg +1 -0
- package/dist/assets/icons/icon/tool-note.svg +1 -0
- package/dist/assets/icons/icon/tool-pencil.svg +1 -0
- package/dist/assets/icons/icon/tool-pointer.svg +1 -0
- package/dist/assets/icons/icon/tool-screenshot.svg +1 -0
- package/dist/assets/icons/icon/tool-text.svg +1 -0
- package/dist/assets/icons/icon/trash.svg +1 -0
- package/dist/assets/icons/icon/twitter.svg +1 -0
- package/dist/assets/icons/icon/undo.svg +1 -0
- package/dist/assets/icons/icon/ungroup.svg +1 -0
- package/dist/assets/icons/icon/unlock.svg +1 -0
- package/dist/assets/icons/icon/vertical-align-end.svg +1 -0
- package/dist/assets/icons/icon/vertical-align-middle.svg +1 -0
- package/dist/assets/icons/icon/vertical-align-start.svg +1 -0
- package/dist/assets/icons/icon/warning-triangle.svg +1 -0
- package/dist/assets/icons/icon/zoom-in.svg +1 -0
- package/dist/assets/icons/icon/zoom-out.svg +1 -0
- package/dist/assets/translations/ar.json +295 -0
- package/dist/assets/translations/ca.json +295 -0
- package/dist/assets/translations/cs.json +352 -0
- package/dist/assets/translations/da.json +160 -0
- package/dist/assets/translations/de.json +310 -0
- package/dist/assets/translations/en.json +1 -0
- package/dist/assets/translations/es.json +299 -0
- package/dist/assets/translations/fa.json +384 -0
- package/dist/assets/translations/fi.json +312 -0
- package/dist/assets/translations/fr.json +372 -0
- package/dist/assets/translations/gl.json +349 -0
- package/dist/assets/translations/he.json +86 -0
- package/dist/assets/translations/hi-in.json +290 -0
- package/dist/assets/translations/hr.json +358 -0
- package/dist/assets/translations/hu.json +365 -0
- package/dist/assets/translations/id.json +373 -0
- package/dist/assets/translations/it.json +330 -0
- package/dist/assets/translations/ja.json +351 -0
- package/dist/assets/translations/ko-kr.json +396 -0
- package/dist/assets/translations/ku.json +93 -0
- package/dist/assets/translations/languages.json +150 -0
- package/dist/assets/translations/main.json +396 -0
- package/dist/assets/translations/my.json +112 -0
- package/dist/assets/translations/ne.json +295 -0
- package/dist/assets/translations/no.json +62 -0
- package/dist/assets/translations/pl.json +113 -0
- package/dist/assets/translations/pt-br.json +333 -0
- package/dist/assets/translations/pt-pt.json +86 -0
- package/dist/assets/translations/ro.json +371 -0
- package/dist/assets/translations/ru.json +375 -0
- package/dist/assets/translations/sl.json +373 -0
- package/dist/assets/translations/sv.json +96 -0
- package/dist/assets/translations/te.json +112 -0
- package/dist/assets/translations/th.json +295 -0
- package/dist/assets/translations/tr.json +355 -0
- package/dist/assets/translations/uk.json +375 -0
- package/dist/assets/translations/vi.json +295 -0
- package/dist/assets/translations/zh-cn.json +386 -0
- package/dist/assets/translations/zh-tw.json +340 -0
- package/dist/lib/TldrawPlugin.mjs +22 -0
- package/dist/lib/TldrawPlugin.mjs.map +1 -0
- package/dist/lib/assets/plugin-tldraw-BDrn_mrV.css +24 -0
- package/dist/lib/capabilities.mjs +8 -0
- package/dist/lib/capabilities.mjs.map +1 -0
- package/dist/lib/chunk-TldrawArticle.mjs +60 -0
- package/dist/lib/chunk-TldrawArticle.mjs.map +1 -0
- package/dist/lib/chunk-TldrawCard.mjs +35 -0
- package/dist/lib/chunk-TldrawCard.mjs.map +1 -0
- package/dist/lib/chunk-meta.mjs +40 -0
- package/dist/lib/chunk-meta.mjs.map +1 -0
- package/dist/lib/chunk-settings.mjs +23 -0
- package/dist/lib/chunk-settings.mjs.map +1 -0
- package/dist/lib/chunk-sketch-variant.mjs +23 -0
- package/dist/lib/chunk-sketch-variant.mjs.map +1 -0
- package/dist/lib/chunk-types.mjs +73 -0
- package/dist/lib/chunk-types.mjs.map +1 -0
- package/dist/lib/components.mjs +443 -0
- package/dist/lib/components.mjs.map +1 -0
- package/dist/lib/containers.mjs +8 -0
- package/dist/lib/containers.mjs.map +1 -0
- package/dist/lib/hooks.mjs +116 -0
- package/dist/lib/hooks.mjs.map +1 -0
- package/dist/lib/index.mjs +4 -0
- package/dist/lib/meta.mjs +2 -0
- package/dist/lib/model.mjs +905 -0
- package/dist/lib/model.mjs.map +1 -0
- package/dist/lib/plugin.mjs +8 -0
- package/dist/lib/plugin.mjs.map +1 -0
- package/dist/lib/testing.mjs +246 -0
- package/dist/lib/testing.mjs.map +1 -0
- package/dist/lib/translations.mjs +10 -0
- package/dist/lib/translations.mjs.map +1 -0
- package/dist/lib/types.mjs +2 -0
- package/dist/types/dx.config.d.ts +28 -0
- package/dist/types/dx.config.d.ts.map +1 -0
- package/dist/types/src/TldrawPlugin.d.ts +4 -0
- package/dist/types/src/TldrawPlugin.d.ts.map +1 -0
- package/dist/types/src/capabilities/index.d.ts +4 -0
- package/dist/types/src/capabilities/index.d.ts.map +1 -0
- package/dist/types/src/capabilities/settings.d.ts +5 -0
- package/dist/types/src/capabilities/settings.d.ts.map +1 -0
- package/dist/types/src/capabilities/sketch-variant.d.ts +5 -0
- package/dist/types/src/capabilities/sketch-variant.d.ts.map +1 -0
- package/dist/types/src/components/Canvas/Canvas.d.ts +17 -0
- package/dist/types/src/components/Canvas/Canvas.d.ts.map +1 -0
- package/dist/types/src/components/Canvas/Canvas.stories.d.ts +15 -0
- package/dist/types/src/components/Canvas/Canvas.stories.d.ts.map +1 -0
- package/dist/types/src/components/Canvas/index.d.ts +4 -0
- package/dist/types/src/components/Canvas/index.d.ts.map +1 -0
- package/dist/types/src/components/actions.d.ts +6 -0
- package/dist/types/src/components/actions.d.ts.map +1 -0
- package/dist/types/src/components/custom/CustomGrid.d.ts +12 -0
- package/dist/types/src/components/custom/CustomGrid.d.ts.map +1 -0
- package/dist/types/src/components/custom/CustomMenu.d.ts +4 -0
- package/dist/types/src/components/custom/CustomMenu.d.ts.map +1 -0
- package/dist/types/src/components/custom/CustomStylePanel.d.ts +4 -0
- package/dist/types/src/components/custom/CustomStylePanel.d.ts.map +1 -0
- package/dist/types/src/components/custom/CustomToolbar.d.ts +10 -0
- package/dist/types/src/components/custom/CustomToolbar.d.ts.map +1 -0
- package/dist/types/src/components/custom/DottedGrid.d.ts +4 -0
- package/dist/types/src/components/custom/DottedGrid.d.ts.map +1 -0
- package/dist/types/src/components/custom/MeshGrid.d.ts +4 -0
- package/dist/types/src/components/custom/MeshGrid.d.ts.map +1 -0
- package/dist/types/src/components/custom/index.d.ts +6 -0
- package/dist/types/src/components/custom/index.d.ts.map +1 -0
- package/dist/types/src/components/index.d.ts +2 -0
- package/dist/types/src/components/index.d.ts.map +1 -0
- package/dist/types/src/containers/TldrawArticle/TldrawArticle.d.ts +8 -0
- package/dist/types/src/containers/TldrawArticle/TldrawArticle.d.ts.map +1 -0
- package/dist/types/src/containers/TldrawArticle/index.d.ts +2 -0
- package/dist/types/src/containers/TldrawArticle/index.d.ts.map +1 -0
- package/dist/types/src/containers/TldrawCard/TldrawCard.d.ts +9 -0
- package/dist/types/src/containers/TldrawCard/TldrawCard.d.ts.map +1 -0
- package/dist/types/src/containers/TldrawCard/TldrawCard.stories.d.ts +15 -0
- package/dist/types/src/containers/TldrawCard/TldrawCard.stories.d.ts.map +1 -0
- package/dist/types/src/containers/TldrawCard/index.d.ts +2 -0
- package/dist/types/src/containers/TldrawCard/index.d.ts.map +1 -0
- package/dist/types/src/containers/index.d.ts +4 -0
- package/dist/types/src/containers/index.d.ts.map +1 -0
- package/dist/types/src/hooks/adapter.d.ts +15 -0
- package/dist/types/src/hooks/adapter.d.ts.map +1 -0
- package/dist/types/src/hooks/adapter.test.d.ts +2 -0
- package/dist/types/src/hooks/adapter.test.d.ts.map +1 -0
- package/dist/types/src/hooks/index.d.ts +3 -0
- package/dist/types/src/hooks/index.d.ts.map +1 -0
- package/dist/types/src/hooks/useStoreAdapter.d.ts +11 -0
- package/dist/types/src/hooks/useStoreAdapter.d.ts.map +1 -0
- package/dist/types/src/index.d.ts +4 -0
- package/dist/types/src/index.d.ts.map +1 -0
- package/dist/types/src/meta.d.ts +33 -0
- package/dist/types/src/meta.d.ts.map +1 -0
- package/dist/types/src/migrations/index.d.ts +3 -0
- package/dist/types/src/migrations/index.d.ts.map +1 -0
- package/dist/types/src/migrations/migrate.d.ts +9 -0
- package/dist/types/src/migrations/migrate.d.ts.map +1 -0
- package/dist/types/src/migrations/schema.d.ts +7 -0
- package/dist/types/src/migrations/schema.d.ts.map +1 -0
- package/dist/types/src/model/TldrawBuilder.d.ts +110 -0
- package/dist/types/src/model/TldrawBuilder.d.ts.map +1 -0
- package/dist/types/src/model/TldrawBuilder.test.d.ts +2 -0
- package/dist/types/src/model/TldrawBuilder.test.d.ts.map +1 -0
- package/dist/types/src/model/apply.d.ts +5 -0
- package/dist/types/src/model/apply.d.ts.map +1 -0
- package/dist/types/src/model/builder.d.ts +3 -0
- package/dist/types/src/model/builder.d.ts.map +1 -0
- package/dist/types/src/model/index.d.ts +6 -0
- package/dist/types/src/model/index.d.ts.map +1 -0
- package/dist/types/src/model/read.d.ts +8 -0
- package/dist/types/src/model/read.d.ts.map +1 -0
- package/dist/types/src/model/render.d.ts +27 -0
- package/dist/types/src/model/render.d.ts.map +1 -0
- package/dist/types/src/model/scene.test.d.ts +2 -0
- package/dist/types/src/model/scene.test.d.ts.map +1 -0
- package/dist/types/src/plugin.d.ts +3 -0
- package/dist/types/src/plugin.d.ts.map +1 -0
- package/dist/types/src/testing/data.d.ts +242 -0
- package/dist/types/src/testing/data.d.ts.map +1 -0
- package/dist/types/src/testing/index.d.ts +2 -0
- package/dist/types/src/testing/index.d.ts.map +1 -0
- package/dist/types/src/testing/schema.d.ts +7 -0
- package/dist/types/src/testing/schema.d.ts.map +1 -0
- package/dist/types/src/translations.d.ts +9 -0
- package/dist/types/src/translations.d.ts.map +1 -0
- package/dist/types/src/types/Settings.d.ts +10 -0
- package/dist/types/src/types/Settings.d.ts.map +1 -0
- package/dist/types/src/types/Tldraw.d.ts +25 -0
- package/dist/types/src/types/Tldraw.d.ts.map +1 -0
- package/dist/types/src/types/TldrawCapabilities.d.ts +4 -0
- package/dist/types/src/types/TldrawCapabilities.d.ts.map +1 -0
- package/dist/types/src/types/index.d.ts +4 -0
- package/dist/types/src/types/index.d.ts.map +1 -0
- package/dist/types/src/types/types.d.ts +6 -0
- package/dist/types/src/types/types.d.ts.map +1 -0
- package/dist/types/src/variant.test.d.ts +2 -0
- package/dist/types/src/variant.test.d.ts.map +1 -0
- package/dist/types/tsconfig.tsbuildinfo +1 -0
- package/dx.config.ts +35 -0
- package/package.json +157 -0
- package/src/TldrawPlugin.tsx +31 -0
- package/src/capabilities/index.ts +8 -0
- package/src/capabilities/settings.ts +31 -0
- package/src/capabilities/sketch-variant.ts +29 -0
- package/src/components/Canvas/Canvas.stories.tsx +101 -0
- package/src/components/Canvas/Canvas.tsx +284 -0
- package/src/components/Canvas/index.ts +9 -0
- package/src/components/Canvas/theme.css +23 -0
- package/src/components/actions.ts +42 -0
- package/src/components/custom/CustomGrid.tsx +61 -0
- package/src/components/custom/CustomMenu.tsx +31 -0
- package/src/components/custom/CustomStylePanel.tsx +38 -0
- package/src/components/custom/CustomToolbar.tsx +88 -0
- package/src/components/custom/DottedGrid.tsx +53 -0
- package/src/components/custom/MeshGrid.tsx +47 -0
- package/src/components/custom/index.ts +9 -0
- package/src/components/index.ts +5 -0
- package/src/containers/TldrawArticle/TldrawArticle.tsx +78 -0
- package/src/containers/TldrawArticle/index.ts +5 -0
- package/src/containers/TldrawCard/TldrawCard.stories.tsx +53 -0
- package/src/containers/TldrawCard/TldrawCard.tsx +32 -0
- package/src/containers/TldrawCard/index.ts +5 -0
- package/src/containers/index.ts +8 -0
- package/src/hooks/adapter.test.ts +20 -0
- package/src/hooks/adapter.ts +83 -0
- package/src/hooks/index.ts +6 -0
- package/src/hooks/useStoreAdapter.ts +55 -0
- package/src/index.ts +7 -0
- package/src/meta.ts +9 -0
- package/src/migrations/index.ts +6 -0
- package/src/migrations/migrate.ts +49 -0
- package/src/migrations/schema.ts +98 -0
- package/src/model/TldrawBuilder.test.ts +72 -0
- package/src/model/TldrawBuilder.ts +443 -0
- package/src/model/apply.ts +132 -0
- package/src/model/builder.ts +31 -0
- package/src/model/index.ts +9 -0
- package/src/model/read.ts +203 -0
- package/src/model/render.ts +191 -0
- package/src/model/scene.test.ts +222 -0
- package/src/plugin.ts +9 -0
- package/src/testing/data.ts +238 -0
- package/src/testing/index.ts +5 -0
- package/src/testing/schema.ts +98 -0
- package/src/translations.ts +18 -0
- package/src/types/Settings.ts +32 -0
- package/src/types/Tldraw.ts +38 -0
- package/src/types/TldrawCapabilities.ts +17 -0
- package/src/types/index.ts +8 -0
- package/src/types/types.ts +11 -0
- package/src/typings.d.ts +8 -0
- package/src/variant.test.ts +142 -0
- package/src/vite-env.d.ts +10 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"model.mjs","names":[],"sources":["../../src/model/read.ts","../../src/model/TldrawBuilder.ts","../../src/model/render.ts","../../src/model/apply.ts","../../src/model/builder.ts","../../src/model/index.ts"],"sourcesContent":["//\n// Copyright 2026 DXOS.org\n//\n\n//\n// Derives the neutral scene from tldraw records. Geometry is read from the live records —\n// not from a stored copy — so the agent's mental model stays coherent after users drag or\n// resize shapes in the UI. An object's `origin` is the top-left of its bounding box.\n//\n\nimport { type ReadResult, type ReadWorldObject, type Scene } from '@dxos/plugin-illustrator/model';\n\nimport { type ExternalBox } from './render';\nimport { type CanvasContent } from './TldrawBuilder';\n\ntype ShapeRecord = Record<string, any>;\n\n/** Read the derived scene from canvas content. */\nexport const readScene = (content: CanvasContent): ReadResult => {\n const groups = new Map<string, ShapeRecord[]>();\n let unmanaged = 0;\n for (const record of Object.values(content ?? {})) {\n if (record?.typeName !== 'shape') {\n continue;\n }\n const objectId = record.meta?.object;\n if (typeof objectId !== 'string' || typeof record.meta?.element !== 'string') {\n unmanaged++;\n continue;\n }\n groups.set(objectId, [...(groups.get(objectId) ?? []), record]);\n }\n\n const objects = [...groups.entries()].map(([objectId, records]) => readObject(objectId, records, content));\n return { scene: { objects }, unmanaged };\n};\n\n/** Canvas-px bounding boxes of all managed elements, keyed by `objectId/elementId`. */\nexport const elementBoxes = (content: CanvasContent): Record<string, ExternalBox> => {\n const boxes: Record<string, ExternalBox> = {};\n for (const record of Object.values(content ?? {})) {\n if (record?.typeName === 'shape' && record.meta?.object && record.meta?.element) {\n boxes[`${record.meta.object}/${record.meta.element}`] = bounds(record);\n }\n }\n return boxes;\n};\n\nconst readObject = (objectId: string, records: ShapeRecord[], content: CanvasContent): ReadWorldObject => {\n const scale = records.find((record) => typeof record.meta?.scale === 'number')?.meta.scale ?? 1;\n const origin = {\n x: Math.min(...records.map((record) => bounds(record).x)),\n y: Math.min(...records.map((record) => bounds(record).y)),\n };\n const local = (abs: { x: number; y: number }): Scene.Point => ({\n x: round((abs.x - origin.x) / scale),\n y: round((abs.y - origin.y) / scale),\n });\n const length = (px: number) => round(px / scale);\n\n const elements = records\n .map((record) => readElement(record, { local, length, objectId, content }))\n .filter((element): element is Scene.Element => element !== undefined);\n\n return { id: objectId, origin, scale, elements };\n};\n\ntype ReadContext = {\n local: (abs: { x: number; y: number }) => Scene.Point;\n length: (px: number) => number;\n objectId: string;\n content: CanvasContent;\n};\n\nconst readElement = (record: ShapeRecord, ctx: ReadContext): Scene.Element | undefined => {\n const id = record.meta.element;\n const kind = record.meta.kind;\n switch (record.type) {\n case 'geo': {\n const boxKind = kind === 'rect' || kind === 'diamond' || kind === 'triangle' ? kind : 'ellipse';\n return {\n kind: boxKind,\n id,\n ...ctx.local({ x: record.x, y: record.y }),\n w: ctx.length(record.props.w),\n h: ctx.length(record.props.h),\n ...(record.rotation ? { rotation: round((record.rotation * 180) / Math.PI) } : {}),\n ...(record.props.text ? { text: record.props.text } : {}),\n ...readStyle(record),\n };\n }\n case 'text': {\n return {\n kind: 'text',\n id,\n ...ctx.local({ x: record.x, y: record.y }),\n ...(record.props.autoSize ? {} : { w: ctx.length(record.props.w) }),\n text: record.props.text ?? '',\n ...readStyle(record),\n };\n }\n case 'line': {\n const points = linePoints(record).map((point) => ctx.local({ x: record.x + point.x, y: record.y + point.y }));\n if (kind === 'curve') {\n return { kind: 'curve', id, points, ...readStyle(record) };\n }\n const closed =\n points.length > 2 && points[0].x === points[points.length - 1].x && points[0].y === points[points.length - 1].y;\n return {\n kind: 'line',\n id,\n points: closed ? points.slice(0, -1) : points,\n ...(closed ? { closed: true } : {}),\n ...readStyle(record),\n };\n }\n case 'arrow': {\n const { from, to } = arrowRefs(record, ctx);\n return {\n kind: 'arrow',\n id,\n ...(from\n ? { from }\n : { start: ctx.local({ x: record.x + record.props.start.x, y: record.y + record.props.start.y }) }),\n ...(to ? { to } : { end: ctx.local({ x: record.x + record.props.end.x, y: record.y + record.props.end.y }) }),\n ...(record.props.text ? { text: record.props.text } : {}),\n ...readStyle(record),\n };\n }\n default:\n return undefined;\n }\n};\n\n/** Resolve arrow terminal bindings back to element refs (same-object refs are shortened). */\nconst arrowRefs = (record: ShapeRecord, ctx: ReadContext): { from?: string; to?: string } => {\n const refs: { from?: string; to?: string } = {};\n for (const binding of Object.values(ctx.content ?? {})) {\n if (binding?.typeName !== 'binding' || binding.fromId !== record.id) {\n continue;\n }\n const target = ctx.content[binding.toId];\n if (!target?.meta?.object || !target?.meta?.element) {\n continue;\n }\n const ref =\n target.meta.object === ctx.objectId ? target.meta.element : `${target.meta.object}/${target.meta.element}`;\n if (binding.props?.terminal === 'start') {\n refs.from = ref;\n } else {\n refs.to = ref;\n }\n }\n return refs;\n};\n\n/** Report only non-default styles to keep the read output compact. */\nconst readStyle = (record: ShapeRecord): Partial<Pick<Scene.Box, 'color' | 'fill' | 'stroke' | 'weight'>> => {\n const { color, fill, dash, size } = record.props;\n return {\n ...(color && color !== 'black' ? { color } : {}),\n ...(fill && fill !== 'none' ? { fill: fill === 'pattern' ? ('pattern' as const) : ('solid' as const) } : {}),\n ...(dash && dash !== 'draw' ? { stroke: dash as Scene.Stroke } : {}),\n ...(size && size !== 'm' ? { weight: size as Scene.Weight } : {}),\n };\n};\n\nconst linePoints = (record: ShapeRecord): { x: number; y: number }[] =>\n Object.values(record.props.points ?? {})\n // Indexes are `a<n>` fractional keys; numeric compare so `a10` sorts after `a2`.\n .sort((a: any, b: any) => Number(String(a.index).slice(1)) - Number(String(b.index).slice(1)))\n .map((point: any) => ({ x: point.x, y: point.y }));\n\n/** Bounding box of a shape record in canvas px. */\nconst bounds = (record: ShapeRecord): ExternalBox => {\n switch (record.type) {\n case 'geo':\n return { x: record.x, y: record.y, w: record.props.w, h: record.props.h };\n case 'text':\n return { x: record.x, y: record.y, w: record.props.w ?? 0, h: 0 };\n case 'line': {\n const points = linePoints(record);\n const xs = points.map((point) => record.x + point.x);\n const ys = points.map((point) => record.y + point.y);\n return boxFrom(xs, ys);\n }\n case 'arrow': {\n const xs = [record.x + record.props.start.x, record.x + record.props.end.x];\n const ys = [record.y + record.props.start.y, record.y + record.props.end.y];\n return boxFrom(xs, ys);\n }\n default:\n return { x: record.x ?? 0, y: record.y ?? 0, w: record.props?.w ?? 0, h: record.props?.h ?? 0 };\n }\n};\n\nconst boxFrom = (xs: number[], ys: number[]): ExternalBox => {\n const x = Math.min(...xs);\n const y = Math.min(...ys);\n return { x, y, w: Math.max(...xs) - x, h: Math.max(...ys) - y };\n};\n\nconst round = (value: number) => Math.round(value * 100) / 100;\n","//\n// Copyright 2024 DXOS.org\n//\n\n//\n// A minimal, chainable builder for tldraw (`tldraw.com/2`) canvas records.\n// Produces the record map stored in `Sketch.Canvas.content`. Used directly to seed\n// stories/tests (`build()`), and by the scene renderer (`render.ts`) to compile the\n// neutral scene DSL into records merged into an existing canvas (`records()`).\n//\n\nimport { invariant } from '@dxos/invariant';\n\nexport type Color =\n | 'black'\n | 'grey'\n | 'light-violet'\n | 'violet'\n | 'blue'\n | 'light-blue'\n | 'yellow'\n | 'orange'\n | 'green'\n | 'light-green'\n | 'light-red'\n | 'red'\n | 'white';\n\nexport type Fill = 'none' | 'semi' | 'solid' | 'pattern' | 'fill';\nexport type Dash = 'draw' | 'solid' | 'dashed' | 'dotted';\nexport type Size = 's' | 'm' | 'l' | 'xl';\nexport type Font = 'draw' | 'sans' | 'serif' | 'mono';\nexport type Align = 'start' | 'middle' | 'end';\nexport type Geo =\n | 'rectangle'\n | 'ellipse'\n | 'triangle'\n | 'diamond'\n | 'pentagon'\n | 'hexagon'\n | 'octagon'\n | 'star'\n | 'rhombus'\n | 'oval'\n | 'cloud'\n | 'heart';\n\n/** Common style props shared by all shapes. */\nexport type StyleProps = {\n color?: Color;\n fill?: Fill;\n dash?: Dash;\n size?: Size;\n font?: Font;\n text?: string;\n align?: Align;\n};\n\n/** Geometric shape (rectangle, ellipse, etc.). */\nexport type ShapeProps = StyleProps & {\n /** Friendly handle used to link shapes (e.g. as an arrow target). */\n id?: string;\n x?: number;\n y?: number;\n w?: number;\n h?: number;\n rotation?: number;\n};\n\n/** Free-standing text label. */\nexport type TextProps = Omit<ShapeProps, 'h' | 'fill' | 'dash'>;\n\n/** Connector (arrow/line) between two shapes (or between explicit points). */\nexport type ConnectorProps = Omit<StyleProps, 'align'> & {\n id?: string;\n /** Handle of the source shape. */\n from?: string;\n /** Handle of the target shape. */\n to?: string;\n /** Explicit start point (used when `from` is omitted). */\n start?: Point;\n /** Explicit end point (used when `to` is omitted). */\n end?: Point;\n};\n\n/** Open or closed path through explicit points. */\nexport type PathProps = Omit<StyleProps, 'align'> & {\n id?: string;\n points: readonly Point[];\n /** Smooth (cubic spline) instead of straight segments. */\n smooth?: boolean;\n /** Close the path back to the first point. */\n closed?: boolean;\n};\n\nexport type Point = { x: number; y: number };\n\nexport type CanvasContent = Record<string, any>;\n\nexport const PAGE_ID = 'page:page';\nexport const DOCUMENT_ID = 'document:document';\n\nexport type BuilderOptions = {\n /** Fractional-index counter seed; pass a value past existing content when merging. */\n indexStart?: number;\n /** Per-shape meta, keyed by handle; merged into each generated record's `meta`. */\n metaFor?: (handle: string) => Record<string, any>;\n};\n\nconst DEFAULTS: {\n color: Color;\n fill: Fill;\n dash: Dash;\n size: Size;\n font: Font;\n align: Align;\n w: number;\n h: number;\n} = {\n color: 'black',\n fill: 'none',\n dash: 'draw',\n size: 'm',\n font: 'draw',\n align: 'middle',\n w: 160,\n h: 120,\n};\n\ntype Box = { id: string; x: number; y: number; w: number; h: number };\n\n/**\n * Chainable builder for sketch (tldraw) canvas content.\n *\n * @example\n * ```ts\n * const content = new TldrawBuilder()\n * .rectangle({ id: 'a', x: 0, y: 0, text: 'DXOS', color: 'blue' })\n * .ellipse({ id: 'b', x: 320, y: 0, text: 'ECHO', color: 'green' })\n * .arrow({ from: 'a', to: 'b' })\n * .build();\n * ```\n */\nexport class TldrawBuilder {\n readonly #records: CanvasContent = {};\n readonly #boxes = new Map<string, Box>();\n readonly #metaFor?: (handle: string) => Record<string, any>;\n #shapeCount = 0;\n #bindingCount = 0;\n #indexCount: number;\n\n constructor(options: BuilderOptions = {}) {\n this.#indexCount = options.indexStart ?? 0;\n this.#metaFor = options.metaFor;\n }\n\n /**\n * Register a shape that already exists on the canvas (its bounding box in canvas px)\n * so connectors added by this builder can bind to it.\n */\n external(handle: string, box: { x: number; y: number; w: number; h: number }, shapeId?: string): this {\n invariant(!this.#boxes.has(handle), `duplicate shape id: ${handle}`);\n this.#boxes.set(handle, { id: shapeId ?? `shape:${handle}`, ...box });\n return this;\n }\n\n /** Add a rectangle. */\n rectangle(props: ShapeProps = {}): this {\n return this.geo('rectangle', props);\n }\n\n /** Add an ellipse. */\n ellipse(props: ShapeProps = {}): this {\n return this.geo('ellipse', props);\n }\n\n /** Add a circle (an ellipse with equal width and height). */\n circle(props: ShapeProps = {}): this {\n const size = props.w ?? props.h ?? DEFAULTS.w;\n return this.geo('ellipse', { ...props, w: size, h: size });\n }\n\n /** Add an arbitrary geometric shape. */\n geo(geo: Geo, props: ShapeProps = {}): this {\n const { id, x = 0, y = 0, w = DEFAULTS.w, h = DEFAULTS.h, rotation = 0 } = props;\n const shapeId = this.#registerShape({ id, x, y, w, h });\n this.#records[shapeId] = {\n id: shapeId,\n typeName: 'shape',\n type: 'geo',\n x,\n y,\n rotation,\n index: this.#nextIndex(),\n parentId: PAGE_ID,\n isLocked: false,\n opacity: 1,\n meta: this.#meta(id),\n props: {\n geo,\n w,\n h,\n color: props.color ?? DEFAULTS.color,\n labelColor: DEFAULTS.color,\n fill: props.fill ?? DEFAULTS.fill,\n dash: props.dash ?? DEFAULTS.dash,\n size: props.size ?? DEFAULTS.size,\n font: props.font ?? DEFAULTS.font,\n align: props.align ?? DEFAULTS.align,\n verticalAlign: 'middle',\n url: '',\n growY: 0,\n text: props.text ?? '',\n scale: 1,\n },\n };\n\n return this;\n }\n\n /** Add a free-standing text label. */\n text(props: TextProps = {}): this {\n const { id, x = 0, y = 0, w = DEFAULTS.w, rotation = 0 } = props;\n const shapeId = this.#registerShape({ id, x, y, w, h: 0 });\n this.#records[shapeId] = {\n id: shapeId,\n typeName: 'shape',\n type: 'text',\n x,\n y,\n rotation,\n index: this.#nextIndex(),\n parentId: PAGE_ID,\n isLocked: false,\n opacity: 1,\n meta: this.#meta(id),\n props: {\n color: props.color ?? DEFAULTS.color,\n size: props.size ?? DEFAULTS.size,\n font: props.font ?? DEFAULTS.font,\n textAlign: props.align ?? DEFAULTS.align,\n w,\n text: props.text ?? '',\n scale: 1,\n autoSize: true,\n },\n };\n\n return this;\n }\n\n /** Add an arrow, optionally bound to source/target shapes so it tracks them. */\n arrow(props: ConnectorProps = {}): this {\n return this.#connector('arrow', props);\n }\n\n /** Add a line between two shapes (or explicit points). */\n line(props: ConnectorProps = {}): this {\n return this.#connector('line', props);\n }\n\n /** Add a path (open or closed, straight or smooth) through explicit points. */\n path(props: PathProps): this {\n const { id, smooth, closed } = props;\n const source = closed && props.points.length > 1 ? [...props.points, props.points[0]] : [...props.points];\n invariant(source.length >= 2, 'path requires at least two points');\n const origin = source[0];\n const xs = source.map((point) => point.x);\n const ys = source.map((point) => point.y);\n const shapeId = this.#registerShape({\n id,\n x: Math.min(...xs),\n y: Math.min(...ys),\n w: Math.max(...xs) - Math.min(...xs),\n h: Math.max(...ys) - Math.min(...ys),\n });\n this.#records[shapeId] = {\n id: shapeId,\n typeName: 'shape',\n type: 'line',\n x: origin.x,\n y: origin.y,\n rotation: 0,\n index: this.#nextIndex(),\n parentId: PAGE_ID,\n isLocked: false,\n opacity: 1,\n meta: this.#meta(id),\n props: {\n color: props.color ?? DEFAULTS.color,\n dash: props.dash ?? DEFAULTS.dash,\n size: props.size ?? DEFAULTS.size,\n spline: smooth ? 'cubic' : 'line',\n points: Object.fromEntries(\n source.map((point, i) => [\n `a${i + 1}`,\n { id: `a${i + 1}`, index: `a${i + 1}`, x: point.x - origin.x, y: point.y - origin.y },\n ]),\n ),\n scale: 1,\n },\n };\n\n return this;\n }\n\n /** Build the full canvas snapshot (document + page + records). */\n build(): CanvasContent {\n return {\n [DOCUMENT_ID]: { gridSize: 10, name: '', meta: {}, id: DOCUMENT_ID, typeName: 'document' },\n [PAGE_ID]: { meta: {}, id: PAGE_ID, name: 'Page 1', index: 'a1', typeName: 'page' },\n ...this.#records,\n };\n }\n\n /** Return only the generated records (for merging into an existing canvas). */\n records(): CanvasContent {\n return { ...this.#records };\n }\n\n #connector(type: 'arrow' | 'line', props: ConnectorProps): this {\n const from = props.from ? this.#boxes.get(props.from) : undefined;\n const to = props.to ? this.#boxes.get(props.to) : undefined;\n // A referenced handle that resolves to nothing is a typo; fail rather than emit a misplaced connector.\n invariant(!props.from || from, `unknown source shape: ${props.from}`);\n invariant(!props.to || to, `unknown target shape: ${props.to}`);\n const start = from ? center(from) : (props.start ?? { x: 0, y: 0 });\n const end = to ? center(to) : (props.end ?? { x: DEFAULTS.w, y: 0 });\n\n const shapeId = this.#registerShape({ id: props.id, x: start.x, y: start.y, w: 0, h: 0 });\n const relativeEnd = { x: end.x - start.x, y: end.y - start.y };\n const style = {\n color: props.color ?? DEFAULTS.color,\n dash: props.dash ?? DEFAULTS.dash,\n size: props.size ?? DEFAULTS.size,\n };\n\n if (type === 'arrow') {\n this.#records[shapeId] = {\n id: shapeId,\n typeName: 'shape',\n type: 'arrow',\n x: start.x,\n y: start.y,\n rotation: 0,\n index: this.#nextIndex(),\n parentId: PAGE_ID,\n isLocked: false,\n opacity: 1,\n meta: this.#meta(props.id),\n props: {\n ...style,\n labelColor: DEFAULTS.color,\n fill: props.fill ?? DEFAULTS.fill,\n font: props.font ?? DEFAULTS.font,\n arrowheadStart: 'none',\n arrowheadEnd: 'arrow',\n start: { x: 0, y: 0 },\n end: relativeEnd,\n bend: 0,\n text: props.text ?? '',\n labelPosition: 0.5,\n scale: 1,\n },\n };\n\n // Bindings make the arrow track its bound shapes (tldraw recomputes terminals).\n if (from) {\n this.#binding(shapeId, from.id, 'start');\n }\n if (to) {\n this.#binding(shapeId, to.id, 'end');\n }\n } else {\n this.#records[shapeId] = {\n id: shapeId,\n typeName: 'shape',\n type: 'line',\n x: start.x,\n y: start.y,\n rotation: 0,\n index: this.#nextIndex(),\n parentId: PAGE_ID,\n isLocked: false,\n opacity: 1,\n meta: this.#meta(props.id),\n props: {\n ...style,\n spline: 'line',\n points: {\n a1: { id: 'a1', index: 'a1', x: 0, y: 0 },\n a2: { id: 'a2', index: 'a2', x: relativeEnd.x, y: relativeEnd.y },\n },\n scale: 1,\n },\n };\n }\n\n return this;\n }\n\n #binding(arrowId: string, shapeId: string, terminal: 'start' | 'end'): void {\n // Deterministic per-terminal id so re-rendering an arrow overwrites its own bindings.\n const bindingId = `binding:${arrowId.slice('shape:'.length)}/${terminal}-${++this.#bindingCount}`;\n this.#records[bindingId] = {\n id: bindingId,\n typeName: 'binding',\n type: 'arrow',\n fromId: arrowId,\n toId: shapeId,\n meta: {},\n props: {\n terminal,\n normalizedAnchor: { x: 0.5, y: 0.5 },\n isExact: false,\n isPrecise: false,\n },\n };\n }\n\n #meta(handle: string | undefined): Record<string, any> {\n return handle && this.#metaFor ? this.#metaFor(handle) : {};\n }\n\n #registerShape(box: { id?: string; x: number; y: number; w: number; h: number }): string {\n // Skip autogenerated ids that collide with an explicit one (e.g. a user-supplied `s1`).\n let shapeId = box.id ? `shape:${box.id}` : `shape:s${++this.#shapeCount}`;\n while (!box.id && this.#records[shapeId]) {\n shapeId = `shape:s${++this.#shapeCount}`;\n }\n const handle = box.id ?? shapeId;\n // The id is the record-map key; reusing one would silently overwrite the earlier shape.\n invariant(!this.#records[shapeId] && !this.#boxes.has(handle), `duplicate shape id: ${handle}`);\n this.#boxes.set(handle, { id: shapeId, x: box.x, y: box.y, w: box.w, h: box.h });\n return shapeId;\n }\n\n #nextIndex(): string {\n return `a${++this.#indexCount}`;\n }\n}\n\nconst center = (box: Box): Point => ({ x: box.x + box.w / 2, y: box.y + box.h / 2 });\n","//\n// Copyright 2026 DXOS.org\n//\n\n//\n// tldraw backend for the scene DSL: compiles a `WorldObject` into tldraw records.\n// Element identity is stamped into each record's `meta` (`{ object, element, kind, scale }`)\n// so `read.ts` can reconstruct the scene and edits can address records by id.\n//\n\nimport { Scene } from '@dxos/plugin-illustrator/model';\n\nimport {\n type CanvasContent,\n type ConnectorProps,\n type Dash,\n type Fill,\n type PathProps,\n type Point,\n type ShapeProps,\n TldrawBuilder,\n} from './TldrawBuilder';\n\nexport const DEFAULT_SCALE = 1;\n\n/** Canvas-px bounding box of an existing element another object's arrow may bind to. */\nexport type ExternalBox = { x: number; y: number; w: number; h: number };\n\nexport type RenderOptions = {\n origin: Scene.Point;\n scale: number;\n /** Fractional-index seed past the existing canvas content. */\n indexStart: number;\n /** Bounding boxes of existing elements, keyed by `objectId/elementId` (canvas px). */\n external?: Record<string, ExternalBox>;\n dialect?: string;\n};\n\n/** Stable record id for an element: `shape:<objectId>/<elementId>`. */\nexport const shapeId = (objectId: string, elementId: string) => `shape:${objectId}/${elementId}`;\n\nconst strokeToDash: Record<Scene.Stroke, Dash> = {\n sketchy: 'draw',\n solid: 'solid',\n dashed: 'dashed',\n dotted: 'dotted',\n};\n\nconst fillToFill: Record<Scene.Fill, Fill> = {\n none: 'none',\n solid: 'solid',\n pattern: 'pattern',\n};\n\nconst boxKindToGeo = {\n rect: 'rectangle',\n ellipse: 'ellipse',\n diamond: 'diamond',\n triangle: 'triangle',\n} as const;\n\nconst style = (element: Scene.Element): Pick<ShapeProps, 'color' | 'fill' | 'dash' | 'size'> => ({\n color: element.color,\n fill: 'fill' in element && element.fill ? fillToFill[element.fill] : undefined,\n dash: element.stroke ? strokeToDash[element.stroke] : undefined,\n size: element.weight,\n});\n\n/**\n * Compile one world object into tldraw records (canvas-px coordinates).\n * Local coordinates are mapped via `canvas = origin + local * scale`.\n */\nexport const renderObject = (object: Scene.WorldObject, options: RenderOptions): CanvasContent => {\n const { origin, scale, indexStart, external = {}, dialect = 'scene' } = options;\n const point = (local: Scene.Point | { x: number; y: number }): Point => ({\n x: origin.x + local.x * scale,\n y: origin.y + local.y * scale,\n });\n const length = (units: number) => units * scale;\n\n const kinds = new Map<string, string>();\n const builder = new TldrawBuilder({\n indexStart,\n metaFor: (handle) => {\n const [objectId, elementId] = splitHandle(handle);\n return { object: objectId, element: elementId, kind: kinds.get(handle), scale, dialect };\n },\n });\n\n // Register existing canvas elements so arrows can bind across objects.\n for (const [handle, box] of Object.entries(external)) {\n builder.external(handle, box);\n }\n\n // Refs are element ids within this object, or `objectId/elementId` across objects.\n const ref = (value: string) => (value.includes('/') ? value : `${object.id}/${value}`);\n\n for (const element of object.elements) {\n const handle = `${object.id}/${element.id}`;\n kinds.set(handle, element.kind);\n switch (element.kind) {\n case 'rect':\n case 'ellipse':\n case 'diamond':\n case 'triangle': {\n builder.geo(boxKindToGeo[element.kind], {\n id: handle,\n ...point(element),\n w: length(element.w),\n h: length(element.h),\n rotation: element.rotation !== undefined ? (element.rotation * Math.PI) / 180 : undefined,\n text: element.text,\n ...style(element),\n });\n break;\n }\n case 'circle': {\n kinds.set(handle, 'ellipse');\n builder.circle({\n id: handle,\n ...point({ x: element.cx - element.r, y: element.cy - element.r }),\n w: length(element.r * 2),\n text: element.text,\n ...style(element),\n });\n break;\n }\n case 'line': {\n const props: PathProps = {\n id: handle,\n points: element.points.map(point),\n closed: element.closed,\n ...style(element),\n };\n builder.path(props);\n break;\n }\n case 'curve': {\n builder.path({ id: handle, points: element.points.map(point), smooth: true, ...style(element) });\n break;\n }\n case 'arc': {\n kinds.set(handle, 'curve');\n builder.path({ id: handle, points: sampleArc(element).map(point), smooth: true, ...style(element) });\n break;\n }\n case 'text': {\n builder.text({\n id: handle,\n ...point(element),\n w: element.w !== undefined ? length(element.w) : undefined,\n text: element.text,\n color: element.color,\n size: element.weight,\n });\n break;\n }\n case 'arrow': {\n const props: ConnectorProps = {\n id: handle,\n from: element.from ? ref(element.from) : undefined,\n to: element.to ? ref(element.to) : undefined,\n start: element.start ? point(element.start) : undefined,\n end: element.end ? point(element.end) : undefined,\n text: element.text,\n ...style(element),\n };\n builder.arrow(props);\n break;\n }\n }\n }\n\n return builder.records();\n};\n\n/** `objectId/elementId` — element ids may themselves not contain `/`. */\nconst splitHandle = (handle: string): [string, string] => {\n const index = handle.indexOf('/');\n return [handle.slice(0, index), handle.slice(index + 1)];\n};\n\n/** Sample an arc (degrees, clockwise from +x, y-down screen coords) into spline points. */\nconst sampleArc = ({ cx, cy, r, startAngle, endAngle }: Scene.Arc): Scene.Point[] => {\n const sweep = endAngle - startAngle;\n const steps = Math.max(4, Math.ceil(Math.abs(sweep) / 22.5));\n return Array.from({ length: steps + 1 }, (_, i) => {\n const angle = ((startAngle + (sweep * i) / steps) * Math.PI) / 180;\n return { x: cx + r * Math.cos(angle), y: cy + r * Math.sin(angle) };\n });\n};\n","//\n// Copyright 2026 DXOS.org\n//\n\n//\n// Applies scene DSL edit commands to canvas content by mutating the record map in place\n// (callers wrap the call in `Obj.update` so a batch commits atomically).\n//\n\nimport { invariant } from '@dxos/invariant';\nimport { type ApplyResult, type Scene } from '@dxos/plugin-illustrator/model';\n\nimport { elementBoxes, readScene } from './read';\nimport { renderObject } from './render';\nimport { type CanvasContent, DOCUMENT_ID, PAGE_ID } from './TldrawBuilder';\n\n/** Apply a batch of edit commands to the canvas content (mutates `content`). */\nexport const applyCommands = (content: CanvasContent, commands: readonly Scene.Command[]): ApplyResult => {\n ensurePage(content);\n const upserted = new Set<string>();\n let removed = 0;\n\n for (const command of commands) {\n switch (command.op) {\n case 'upsert-object': {\n const previous = readScene(content).scene.objects.find((object) => object.id === command.object.id);\n removed += remove(content, (record) => record.meta?.object === command.object.id);\n merge(content, command.object, {\n origin: command.object.origin ?? previous?.origin ?? { x: 0, y: 0 },\n scale: command.object.scale ?? previous?.scale ?? 1,\n });\n upserted.add(command.object.id);\n break;\n }\n case 'upsert-elements': {\n const previous = readScene(content).scene.objects.find((object) => object.id === command.objectId);\n invariant(previous, `unknown object: ${command.objectId} (use upsert-object to create it)`);\n const ids = new Set(command.elements.map((element) => element.id));\n removed += remove(\n content,\n (record) => record.meta?.object === command.objectId && ids.has(record.meta?.element),\n );\n merge(\n content,\n { id: command.objectId, elements: command.elements },\n { origin: previous.origin, scale: previous.scale },\n );\n upserted.add(command.objectId);\n break;\n }\n case 'remove-elements': {\n const ids = new Set(command.elementIds);\n removed += remove(\n content,\n (record) => record.meta?.object === command.objectId && ids.has(record.meta?.element),\n );\n break;\n }\n case 'remove-object': {\n removed += remove(content, (record) => record.meta?.object === command.objectId);\n break;\n }\n case 'move-object': {\n const previous = readScene(content).scene.objects.find((object) => object.id === command.objectId);\n invariant(previous, `unknown object: ${command.objectId}`);\n const delta = { x: command.origin.x - previous.origin.x, y: command.origin.y - previous.origin.y };\n for (const record of Object.values(content)) {\n if (record?.typeName === 'shape' && record.meta?.object === command.objectId) {\n record.x += delta.x;\n record.y += delta.y;\n }\n }\n upserted.add(command.objectId);\n break;\n }\n }\n }\n\n return { upserted: [...upserted], removed };\n};\n\nconst merge = (\n content: CanvasContent,\n object: Scene.WorldObject | { id: string; elements: readonly Scene.Element[] },\n placement: { origin: Scene.Point; scale: number },\n): void => {\n const records = renderObject(object, {\n ...placement,\n indexStart: nextIndex(content),\n external: elementBoxes(content),\n });\n Object.assign(content, records);\n};\n\n/** Delete matching shape records, then any bindings left dangling. */\nconst remove = (content: CanvasContent, predicate: (record: any) => boolean): number => {\n let removed = 0;\n for (const [key, record] of Object.entries(content)) {\n if (record?.typeName === 'shape' && predicate(record)) {\n delete content[key];\n removed++;\n }\n }\n for (const [key, record] of Object.entries(content)) {\n if (record?.typeName === 'binding' && (!content[record.fromId] || !content[record.toId])) {\n delete content[key];\n }\n }\n return removed;\n};\n\n/** Seed the fractional-index counter past any existing `a<n>` indexes. */\nconst nextIndex = (content: CanvasContent): number => {\n let max = 0;\n let shapes = 0;\n for (const record of Object.values(content)) {\n if (record?.typeName !== 'shape') {\n continue;\n }\n shapes++;\n const match = /^a(\\d+)$/.exec(record.index ?? '');\n if (match) {\n max = Math.max(max, Number(match[1]));\n }\n }\n return Math.max(max, shapes);\n};\n\nconst ensurePage = (content: CanvasContent): void => {\n content[DOCUMENT_ID] ??= { gridSize: 10, name: '', meta: {}, id: DOCUMENT_ID, typeName: 'document' };\n content[PAGE_ID] ??= { meta: {}, id: PAGE_ID, name: 'Page 1', index: 'a1', typeName: 'page' };\n};\n","//\n// Copyright 2026 DXOS.org\n//\n\n//\n// tldraw implementation of the illustrator `SketchBuilder` contract: maps the scene DSL\n// onto the tldraw record map stored in `Tldraw.Canvas.content`.\n//\n\nimport { Obj } from '@dxos/echo';\nimport { invariant } from '@dxos/invariant';\nimport { type ApplyResult, type SketchBuilder } from '@dxos/plugin-illustrator/model';\n\nimport { Tldraw } from '../types';\nimport { applyCommands } from './apply';\nimport { readScene } from './read';\n\nexport const tldrawBuilder: SketchBuilder = {\n read: (canvas) => {\n invariant(Obj.instanceOf(Tldraw.Canvas, canvas));\n return readScene(canvas.content);\n },\n apply: (canvas, commands) => {\n invariant(Obj.instanceOf(Tldraw.Canvas, canvas));\n let result: ApplyResult = { upserted: [], removed: 0 };\n Obj.update(canvas, (canvas) => {\n result = applyCommands(canvas.content as Obj.Mutable<typeof canvas.content>, commands);\n });\n return result;\n },\n};\n","//\n// Copyright 2026 DXOS.org\n//\n\nexport * from './apply';\nexport * from './builder';\nexport * from './read';\nexport * from './render';\nexport * from './TldrawBuilder';\n"],"mappings":";;;;;AAkBA,IAAa,aAAa,YAAuC;CAC/D,MAAM,yBAAS,IAAI,IAA2B;CAC9C,IAAI,YAAY;CAChB,KAAK,MAAM,UAAU,OAAO,OAAO,WAAW,CAAC,CAAC,GAAG;EACjD,IAAI,QAAQ,aAAa,SACvB;EAEF,MAAM,WAAW,OAAO,MAAM;EAC9B,IAAI,OAAO,aAAa,YAAY,OAAO,OAAO,MAAM,YAAY,UAAU;GAC5E;GACA;EACF;EACA,OAAO,IAAI,UAAU,CAAC,GAAI,OAAO,IAAI,QAAQ,KAAK,CAAC,GAAI,MAAM,CAAC;CAChE;CAGA,OAAO;EAAE,OAAO,EAAE,SADF,CAAC,GAAG,OAAO,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,UAAU,aAAa,WAAW,UAAU,SAAS,OAAO,CACtF,EAAQ;EAAG;CAAU;AACzC;;AAGA,IAAa,gBAAgB,YAAwD;CACnF,MAAM,QAAqC,CAAC;CAC5C,KAAK,MAAM,UAAU,OAAO,OAAO,WAAW,CAAC,CAAC,GAC9C,IAAI,QAAQ,aAAa,WAAW,OAAO,MAAM,UAAU,OAAO,MAAM,SACtE,MAAM,GAAG,OAAO,KAAK,OAAO,GAAG,OAAO,KAAK,aAAa,OAAO,MAA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MAAM,GAAA,KAAA,GAAA;GAAA,YAAA;GAAA,GAAA;GAAA,GAAA;GAAA,GAAA,KAAA;GAAA,GAAA,CAAA,yCAAA,EAAA;EAAA,CAAC;EAC/C,OAAO,UAAU,OAAO,OAAO;CACjC;CACA,QAAQ,QAAQ,aAAa;EAC3B,UAAU,IAAI,WAAW,QAAe,MAAM,GAAA,KAAA,GAAA;GAAA,YAAA;GAAA,GAAA;GAAA,GAAA;GAAA,GAAA,KAAA;GAAA,GAAA,CAAA,yCAAA,EAAA;EAAA,CAAC;EAC/C,IAAI,SAAsB;GAAE,UAAU,CAAC;GAAG,SAAS;EAAE;EACrD,IAAI,OAAO,SAAS,WAAW;GAC7B,SAAS,cAAc,OAAO,SAA+C,QAAQ;EACvF,CAAC;EACD,OAAO;CACT;AACF"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { t as meta } from "./chunk-meta.mjs";
|
|
2
|
+
import { Plugin } from "@dxos/app-framework";
|
|
3
|
+
//#region src/plugin.ts
|
|
4
|
+
var TldrawPlugin = Plugin.lazy(meta, () => import("#plugin"));
|
|
5
|
+
//#endregion
|
|
6
|
+
export { TldrawPlugin };
|
|
7
|
+
|
|
8
|
+
//# sourceMappingURL=plugin.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugin.mjs","names":[],"sources":["../../src/plugin.ts"],"sourcesContent":["//\n// Copyright 2023 DXOS.org\n//\n\nimport { Plugin } from '@dxos/app-framework';\n\nimport { meta } from './meta';\n\nexport const TldrawPlugin = Plugin.lazy(meta, () => import('#plugin'));\n"],"mappings":";;;AAQA,IAAa,eAAe,OAAO,KAAK,YAAY,OAAO,UAAU"}
|
|
@@ -0,0 +1,246 @@
|
|
|
1
|
+
//#region src/testing/data.ts
|
|
2
|
+
var data = {
|
|
3
|
+
v1: {
|
|
4
|
+
"document:document": {
|
|
5
|
+
gridSize: 10,
|
|
6
|
+
name: "",
|
|
7
|
+
meta: {},
|
|
8
|
+
id: "document:document",
|
|
9
|
+
typeName: "document"
|
|
10
|
+
},
|
|
11
|
+
"page:4erp5FF7mts21Njur5UKw": {
|
|
12
|
+
meta: {},
|
|
13
|
+
id: "page:4erp5FF7mts21Njur5UKw",
|
|
14
|
+
name: "Page 1",
|
|
15
|
+
index: "a1",
|
|
16
|
+
typeName: "page"
|
|
17
|
+
},
|
|
18
|
+
"shape:_-1kyVBGSUAeNrcxiGAbw": {
|
|
19
|
+
x: 0,
|
|
20
|
+
y: 0,
|
|
21
|
+
rotation: 0,
|
|
22
|
+
isLocked: false,
|
|
23
|
+
opacity: 1,
|
|
24
|
+
meta: {},
|
|
25
|
+
id: "shape:_-1kyVBGSUAeNrcxiGAbw",
|
|
26
|
+
type: "geo",
|
|
27
|
+
props: {
|
|
28
|
+
w: 160,
|
|
29
|
+
h: 160,
|
|
30
|
+
geo: "rectangle",
|
|
31
|
+
color: "black",
|
|
32
|
+
labelColor: "black",
|
|
33
|
+
fill: "none",
|
|
34
|
+
dash: "dotted",
|
|
35
|
+
size: "l",
|
|
36
|
+
font: "draw",
|
|
37
|
+
text: "ECHO",
|
|
38
|
+
align: "middle",
|
|
39
|
+
verticalAlign: "middle",
|
|
40
|
+
growY: 0,
|
|
41
|
+
url: ""
|
|
42
|
+
},
|
|
43
|
+
parentId: "page:4erp5FF7mts21Njur5UKw",
|
|
44
|
+
index: "a1",
|
|
45
|
+
typeName: "shape"
|
|
46
|
+
},
|
|
47
|
+
"shape:kXmGpjXqyzlg1savamgn8": {
|
|
48
|
+
x: 320,
|
|
49
|
+
y: 0,
|
|
50
|
+
rotation: 0,
|
|
51
|
+
isLocked: false,
|
|
52
|
+
opacity: 1,
|
|
53
|
+
meta: {},
|
|
54
|
+
id: "shape:kXmGpjXqyzlg1savamgn8",
|
|
55
|
+
type: "geo",
|
|
56
|
+
props: {
|
|
57
|
+
w: 160,
|
|
58
|
+
h: 160,
|
|
59
|
+
geo: "star",
|
|
60
|
+
color: "yellow",
|
|
61
|
+
labelColor: "black",
|
|
62
|
+
fill: "none",
|
|
63
|
+
dash: "draw",
|
|
64
|
+
size: "m",
|
|
65
|
+
font: "draw",
|
|
66
|
+
text: "DXOS",
|
|
67
|
+
align: "middle",
|
|
68
|
+
verticalAlign: "middle",
|
|
69
|
+
growY: 0,
|
|
70
|
+
url: ""
|
|
71
|
+
},
|
|
72
|
+
parentId: "page:4erp5FF7mts21Njur5UKw",
|
|
73
|
+
index: "a2",
|
|
74
|
+
typeName: "shape"
|
|
75
|
+
},
|
|
76
|
+
"shape:eYiyZDA7Iwoi16QjTkJUE": {
|
|
77
|
+
x: 0,
|
|
78
|
+
y: 240,
|
|
79
|
+
rotation: -15 * (Math.PI / 180),
|
|
80
|
+
isLocked: false,
|
|
81
|
+
opacity: 1,
|
|
82
|
+
meta: {},
|
|
83
|
+
id: "shape:eYiyZDA7Iwoi16QjTkJUE",
|
|
84
|
+
type: "text",
|
|
85
|
+
props: {
|
|
86
|
+
color: "light-green",
|
|
87
|
+
size: "xl",
|
|
88
|
+
w: 320,
|
|
89
|
+
text: "DXOS!",
|
|
90
|
+
font: "mono",
|
|
91
|
+
align: "middle",
|
|
92
|
+
autoSize: true,
|
|
93
|
+
scale: 1
|
|
94
|
+
},
|
|
95
|
+
parentId: "page:4erp5FF7mts21Njur5UKw",
|
|
96
|
+
index: "a4",
|
|
97
|
+
typeName: "shape"
|
|
98
|
+
},
|
|
99
|
+
"shape:F_o1eH6pS_ABcU3-JPadv": {
|
|
100
|
+
x: 0,
|
|
101
|
+
y: 240,
|
|
102
|
+
rotation: -15 * (Math.PI / 180),
|
|
103
|
+
isLocked: false,
|
|
104
|
+
opacity: 1,
|
|
105
|
+
meta: {},
|
|
106
|
+
id: "shape:F_o1eH6pS_ABcU3-JPadv",
|
|
107
|
+
type: "arrow",
|
|
108
|
+
parentId: "page:4erp5FF7mts21Njur5UKw",
|
|
109
|
+
index: "a3",
|
|
110
|
+
props: {
|
|
111
|
+
dash: "draw",
|
|
112
|
+
size: "s",
|
|
113
|
+
fill: "none",
|
|
114
|
+
color: "blue",
|
|
115
|
+
labelColor: "black",
|
|
116
|
+
bend: 0,
|
|
117
|
+
start: {
|
|
118
|
+
type: "binding",
|
|
119
|
+
boundShapeId: "shape:_-1kyVBGSUAeNrcxiGAbw",
|
|
120
|
+
normalizedAnchor: {
|
|
121
|
+
x: .5,
|
|
122
|
+
y: .5
|
|
123
|
+
},
|
|
124
|
+
isExact: false
|
|
125
|
+
},
|
|
126
|
+
end: {
|
|
127
|
+
type: "binding",
|
|
128
|
+
boundShapeId: "shape:kXmGpjXqyzlg1savamgn8",
|
|
129
|
+
normalizedAnchor: {
|
|
130
|
+
x: .5,
|
|
131
|
+
y: .5
|
|
132
|
+
},
|
|
133
|
+
isExact: false
|
|
134
|
+
},
|
|
135
|
+
arrowheadStart: "none",
|
|
136
|
+
arrowheadEnd: "arrow",
|
|
137
|
+
text: "",
|
|
138
|
+
font: "draw"
|
|
139
|
+
},
|
|
140
|
+
typeName: "shape"
|
|
141
|
+
}
|
|
142
|
+
},
|
|
143
|
+
v2: {
|
|
144
|
+
"document:document": {
|
|
145
|
+
gridSize: 10,
|
|
146
|
+
name: "",
|
|
147
|
+
meta: {},
|
|
148
|
+
id: "document:document",
|
|
149
|
+
typeName: "document"
|
|
150
|
+
},
|
|
151
|
+
"page:1": {
|
|
152
|
+
meta: {},
|
|
153
|
+
id: "page:4erp5FF7mts21Njur5UKw",
|
|
154
|
+
name: "Page 1",
|
|
155
|
+
index: "a1",
|
|
156
|
+
typeName: "page"
|
|
157
|
+
},
|
|
158
|
+
"shape:_-1kyVBGSUAeNrcxiGAbw": {
|
|
159
|
+
x: 0,
|
|
160
|
+
y: 0,
|
|
161
|
+
rotation: 0,
|
|
162
|
+
isLocked: false,
|
|
163
|
+
opacity: 1,
|
|
164
|
+
meta: {},
|
|
165
|
+
id: "shape:_-1kyVBGSUAeNrcxiGAbw",
|
|
166
|
+
type: "geo",
|
|
167
|
+
props: {
|
|
168
|
+
w: 160,
|
|
169
|
+
h: 160,
|
|
170
|
+
geo: "rectangle",
|
|
171
|
+
color: "black",
|
|
172
|
+
labelColor: "black",
|
|
173
|
+
fill: "none",
|
|
174
|
+
dash: "dotted",
|
|
175
|
+
size: "l",
|
|
176
|
+
font: "draw",
|
|
177
|
+
text: "ECHO",
|
|
178
|
+
align: "middle",
|
|
179
|
+
verticalAlign: "middle",
|
|
180
|
+
growY: 0,
|
|
181
|
+
url: "",
|
|
182
|
+
scale: 1
|
|
183
|
+
},
|
|
184
|
+
parentId: "page:4erp5FF7mts21Njur5UKw",
|
|
185
|
+
index: "a1",
|
|
186
|
+
typeName: "shape"
|
|
187
|
+
},
|
|
188
|
+
"shape:kXmGpjXqyzlg1savamgn8": {
|
|
189
|
+
x: 320,
|
|
190
|
+
y: 0,
|
|
191
|
+
rotation: 0,
|
|
192
|
+
isLocked: false,
|
|
193
|
+
opacity: 1,
|
|
194
|
+
meta: {},
|
|
195
|
+
id: "shape:kXmGpjXqyzlg1savamgn8",
|
|
196
|
+
type: "geo",
|
|
197
|
+
props: {
|
|
198
|
+
w: 160,
|
|
199
|
+
h: 160,
|
|
200
|
+
geo: "star",
|
|
201
|
+
color: "yellow",
|
|
202
|
+
labelColor: "black",
|
|
203
|
+
fill: "none",
|
|
204
|
+
dash: "draw",
|
|
205
|
+
size: "m",
|
|
206
|
+
font: "draw",
|
|
207
|
+
text: "DXOS",
|
|
208
|
+
align: "middle",
|
|
209
|
+
verticalAlign: "middle",
|
|
210
|
+
growY: 0,
|
|
211
|
+
url: "",
|
|
212
|
+
scale: 1
|
|
213
|
+
},
|
|
214
|
+
parentId: "page:4erp5FF7mts21Njur5UKw",
|
|
215
|
+
index: "a2",
|
|
216
|
+
typeName: "shape"
|
|
217
|
+
},
|
|
218
|
+
"shape:eYiyZDA7Iwoi16QjTkJUE": {
|
|
219
|
+
x: 0,
|
|
220
|
+
y: 240,
|
|
221
|
+
rotation: -15 * (Math.PI / 180),
|
|
222
|
+
isLocked: false,
|
|
223
|
+
opacity: 1,
|
|
224
|
+
meta: {},
|
|
225
|
+
id: "shape:eYiyZDA7Iwoi16QjTkJUE",
|
|
226
|
+
type: "text",
|
|
227
|
+
props: {
|
|
228
|
+
color: "light-green",
|
|
229
|
+
size: "xl",
|
|
230
|
+
w: 320,
|
|
231
|
+
text: "DXOS!",
|
|
232
|
+
font: "mono",
|
|
233
|
+
autoSize: true,
|
|
234
|
+
scale: 1,
|
|
235
|
+
textAlign: "middle"
|
|
236
|
+
},
|
|
237
|
+
parentId: "page:4erp5FF7mts21Njur5UKw",
|
|
238
|
+
index: "a4",
|
|
239
|
+
typeName: "shape"
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
};
|
|
243
|
+
//#endregion
|
|
244
|
+
export { data };
|
|
245
|
+
|
|
246
|
+
//# sourceMappingURL=testing.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"testing.mjs","names":[],"sources":["../../src/testing/data.ts"],"sourcesContent":["//\n// Copyright 2024 DXOS.org\n//\n\nexport const data = {\n v1: {\n 'document:document': { gridSize: 10, name: '', meta: {}, id: 'document:document', typeName: 'document' },\n 'page:4erp5FF7mts21Njur5UKw': {\n meta: {},\n id: 'page:4erp5FF7mts21Njur5UKw',\n name: 'Page 1',\n index: 'a1',\n typeName: 'page',\n },\n 'shape:_-1kyVBGSUAeNrcxiGAbw': {\n x: 0,\n y: 0,\n rotation: 0,\n isLocked: false,\n opacity: 1,\n meta: {},\n id: 'shape:_-1kyVBGSUAeNrcxiGAbw',\n type: 'geo',\n props: {\n w: 160,\n h: 160,\n geo: 'rectangle',\n color: 'black',\n labelColor: 'black',\n fill: 'none',\n dash: 'dotted',\n size: 'l',\n font: 'draw',\n text: 'ECHO',\n align: 'middle',\n verticalAlign: 'middle',\n growY: 0,\n url: '',\n },\n parentId: 'page:4erp5FF7mts21Njur5UKw',\n index: 'a1',\n typeName: 'shape',\n },\n 'shape:kXmGpjXqyzlg1savamgn8': {\n x: 320,\n y: 0,\n rotation: 0,\n isLocked: false,\n opacity: 1,\n meta: {},\n id: 'shape:kXmGpjXqyzlg1savamgn8',\n type: 'geo',\n props: {\n w: 160,\n h: 160,\n geo: 'star',\n color: 'yellow',\n labelColor: 'black',\n fill: 'none',\n dash: 'draw',\n size: 'm',\n font: 'draw',\n text: 'DXOS',\n align: 'middle',\n verticalAlign: 'middle',\n growY: 0,\n url: '',\n },\n parentId: 'page:4erp5FF7mts21Njur5UKw',\n index: 'a2',\n typeName: 'shape',\n },\n 'shape:eYiyZDA7Iwoi16QjTkJUE': {\n x: 0,\n y: 240,\n rotation: -15 * (Math.PI / 180),\n isLocked: false,\n opacity: 1,\n meta: {},\n id: 'shape:eYiyZDA7Iwoi16QjTkJUE',\n type: 'text',\n props: {\n color: 'light-green',\n size: 'xl',\n w: 320,\n text: 'DXOS!',\n font: 'mono',\n align: 'middle',\n autoSize: true,\n scale: 1,\n },\n parentId: 'page:4erp5FF7mts21Njur5UKw',\n index: 'a4',\n typeName: 'shape',\n },\n\n // NOTE: This record will fail to be migrated.\n 'shape:F_o1eH6pS_ABcU3-JPadv': {\n x: 0,\n y: 240,\n rotation: -15 * (Math.PI / 180),\n isLocked: false,\n opacity: 1,\n meta: {},\n id: 'shape:F_o1eH6pS_ABcU3-JPadv',\n type: 'arrow',\n parentId: 'page:4erp5FF7mts21Njur5UKw',\n index: 'a3',\n props: {\n dash: 'draw',\n size: 's',\n fill: 'none',\n color: 'blue',\n labelColor: 'black',\n bend: 0,\n start: {\n // Incompatible with v2 migration.\n type: 'binding',\n boundShapeId: 'shape:_-1kyVBGSUAeNrcxiGAbw',\n normalizedAnchor: { x: 0.5, y: 0.5 },\n isExact: false,\n },\n end: {\n // Incompatible with v2 migration.\n type: 'binding',\n boundShapeId: 'shape:kXmGpjXqyzlg1savamgn8',\n normalizedAnchor: { x: 0.5, y: 0.5 },\n isExact: false,\n },\n arrowheadStart: 'none',\n arrowheadEnd: 'arrow',\n text: '',\n font: 'draw',\n },\n typeName: 'shape',\n },\n },\n\n v2: {\n 'document:document': {\n gridSize: 10,\n name: '',\n meta: {},\n id: 'document:document',\n typeName: 'document',\n },\n 'page:1': {\n meta: {},\n id: 'page:4erp5FF7mts21Njur5UKw',\n name: 'Page 1',\n index: 'a1',\n typeName: 'page',\n },\n 'shape:_-1kyVBGSUAeNrcxiGAbw': {\n x: 0,\n y: 0,\n rotation: 0,\n isLocked: false,\n opacity: 1,\n meta: {},\n id: 'shape:_-1kyVBGSUAeNrcxiGAbw',\n type: 'geo',\n props: {\n w: 160,\n h: 160,\n geo: 'rectangle',\n color: 'black',\n labelColor: 'black',\n fill: 'none',\n dash: 'dotted',\n size: 'l',\n font: 'draw',\n text: 'ECHO',\n align: 'middle',\n verticalAlign: 'middle',\n growY: 0,\n url: '',\n scale: 1,\n },\n parentId: 'page:4erp5FF7mts21Njur5UKw',\n index: 'a1',\n typeName: 'shape',\n },\n 'shape:kXmGpjXqyzlg1savamgn8': {\n x: 320,\n y: 0,\n rotation: 0,\n isLocked: false,\n opacity: 1,\n meta: {},\n id: 'shape:kXmGpjXqyzlg1savamgn8',\n type: 'geo',\n props: {\n w: 160,\n h: 160,\n geo: 'star',\n color: 'yellow',\n labelColor: 'black',\n fill: 'none',\n dash: 'draw',\n size: 'm',\n font: 'draw',\n text: 'DXOS',\n align: 'middle',\n verticalAlign: 'middle',\n growY: 0,\n url: '',\n scale: 1,\n },\n parentId: 'page:4erp5FF7mts21Njur5UKw',\n index: 'a2',\n typeName: 'shape',\n },\n 'shape:eYiyZDA7Iwoi16QjTkJUE': {\n x: 0,\n y: 240,\n rotation: -15 * (Math.PI / 180),\n isLocked: false,\n opacity: 1,\n meta: {},\n id: 'shape:eYiyZDA7Iwoi16QjTkJUE',\n type: 'text',\n props: {\n color: 'light-green',\n size: 'xl',\n w: 320,\n text: 'DXOS!',\n font: 'mono',\n autoSize: true,\n scale: 1,\n textAlign: 'middle',\n },\n parentId: 'page:4erp5FF7mts21Njur5UKw',\n index: 'a4',\n type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B;GAC7B,GAAG;GACH,GAAG;GACH,UAAU,OAAO,KAAK,KAAK;GAC3B,UAAU;GACV,SAAS;GACT,MAAM,CAAC;GACP,IAAI;GACJ,MAAM;GACN,OAAO;IACL,OAAO;IACP,MAAM;IACN,GAAG;IACH,MAAM;IACN,MAAM;IACN,UAAU;IACV,OAAO;IACP,WAAW;GACb;GACA,UAAU;GACV,OAAO;GACP,UAAU;EACZ;CACF;AACF"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { meta } from "#meta";
|
|
2
|
+
//#region src/translations.ts
|
|
3
|
+
var translations = [{ "en-US": { [meta.profile.key]: {
|
|
4
|
+
"plugin.name": "tldraw",
|
|
5
|
+
"settings.hover-tools.label": "Auto hide controls"
|
|
6
|
+
} } }];
|
|
7
|
+
//#endregion
|
|
8
|
+
export { translations };
|
|
9
|
+
|
|
10
|
+
//# sourceMappingURL=translations.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"translations.mjs","names":[],"sources":["../../src/translations.ts"],"sourcesContent":["//\n// Copyright 2023 DXOS.org\n//\n\nimport { type Resource } from '@dxos/react-ui';\n\nimport { meta } from '#meta';\n\nexport const translations = [\n {\n 'en-US': {\n [meta.profile.key]: {\n 'plugin.name': 'tldraw',\n 'settings.hover-tools.label': 'Auto hide controls',\n },\n },\n },\n] as const satisfies Resource[];\n"],"mappings":";;AAQA,IAAa,eAAe,CAC1B,EACE,SAAS,GACN,KAAK,QAAQ,MAAM;CAClB,eAAe;CACf,8BAA8B;AAChC,EACF,EACF,CACF"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
readonly plugin: {
|
|
3
|
+
readonly key: string;
|
|
4
|
+
readonly name: string;
|
|
5
|
+
readonly description?: string | undefined;
|
|
6
|
+
readonly author?: string | undefined;
|
|
7
|
+
readonly homePage?: string | undefined;
|
|
8
|
+
readonly source?: string | undefined;
|
|
9
|
+
readonly screenshots?: readonly {
|
|
10
|
+
readonly light?: string | undefined;
|
|
11
|
+
readonly dark?: string | undefined;
|
|
12
|
+
}[] | undefined;
|
|
13
|
+
readonly tags?: readonly string[] | undefined;
|
|
14
|
+
readonly icon?: {
|
|
15
|
+
readonly key: string;
|
|
16
|
+
readonly hue?: string | undefined;
|
|
17
|
+
} | undefined;
|
|
18
|
+
readonly spec?: string | undefined;
|
|
19
|
+
readonly dependsOn?: readonly string[] | undefined;
|
|
20
|
+
};
|
|
21
|
+
readonly publish?: {
|
|
22
|
+
readonly buildCommand?: string | undefined;
|
|
23
|
+
readonly outputDirectory?: string | undefined;
|
|
24
|
+
readonly assetBaseUrl?: string | undefined;
|
|
25
|
+
} | undefined;
|
|
26
|
+
};
|
|
27
|
+
export default _default;
|
|
28
|
+
//# sourceMappingURL=dx.config.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dx.config.d.ts","sourceRoot":"","sources":["../../dx.config.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TldrawPlugin.d.ts","sourceRoot":"","sources":["../../../src/TldrawPlugin.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAW7C,eAAO,MAAM,YAAY,4BAaxB,CAAC;eAEa,YAAY"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { Capability } from '@dxos/app-framework';
|
|
2
|
+
export declare const SketchVariant: Capability.LazyCapability<void, Capability.ModuleReturn, Error>;
|
|
3
|
+
export declare const TldrawSettings: Capability.LazyCapability<void, Capability.ModuleReturn, Error>;
|
|
4
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/capabilities/index.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAEjD,eAAO,MAAM,aAAa,iEAAqE,CAAC;AAChG,eAAO,MAAM,cAAc,iEAAgE,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import * as Effect from 'effect/Effect';
|
|
2
|
+
import { Capability } from '@dxos/app-framework';
|
|
3
|
+
declare const _default: (props: void) => Effect.Effect<[Capability.Any, Capability.Any], never, import("effect/Scope").Scope>;
|
|
4
|
+
export default _default;
|
|
5
|
+
//# sourceMappingURL=settings.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"settings.d.ts","sourceRoot":"","sources":["../../../../src/capabilities/settings.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAExC,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import * as Effect from 'effect/Effect';
|
|
2
|
+
import { Capability } from '@dxos/app-framework';
|
|
3
|
+
declare const _default: (props: void) => Effect.Effect<Capability.Any, never, import("effect/Scope").Scope>;
|
|
4
|
+
export default _default;
|
|
5
|
+
//# sourceMappingURL=sketch-variant.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sketch-variant.d.ts","sourceRoot":"","sources":["../../../../src/capabilities/sketch-variant.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAExC,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import '@tldraw/tldraw/tldraw.css';
|
|
2
|
+
import './theme.css';
|
|
3
|
+
import React from 'react';
|
|
4
|
+
import { type Settings, type Tldraw } from '#types';
|
|
5
|
+
export type CanvasProps = {
|
|
6
|
+
canvas: Tldraw.Canvas;
|
|
7
|
+
readonly?: boolean;
|
|
8
|
+
autoCenter?: boolean;
|
|
9
|
+
hideUi?: boolean;
|
|
10
|
+
assetsBaseUrl?: string | null;
|
|
11
|
+
settings?: Settings.Settings;
|
|
12
|
+
onThreadCreate?: () => void;
|
|
13
|
+
};
|
|
14
|
+
export declare const CanvasComponent: React.ForwardRefExoticComponent<Omit<CanvasProps, "className"> & {
|
|
15
|
+
classNames?: import("@dxos/ui-types").ClassNameValue;
|
|
16
|
+
} & Pick<React.HTMLAttributes<Element>, "children" | "className" | "role" | "style"> & React.RefAttributes<HTMLDivElement>>;
|
|
17
|
+
//# sourceMappingURL=Canvas.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Canvas.d.ts","sourceRoot":"","sources":["../../../../../src/components/Canvas/Canvas.tsx"],"names":[],"mappings":"AAIA,OAAO,2BAA2B,CAAC;AACnC,OAAO,aAAa,CAAC;AAMrB,OAAO,KAAgD,MAAM,OAAO,CAAC;AAQrE,OAAO,EAAE,KAAK,QAAQ,EAAE,KAAK,MAAM,EAAE,MAAM,QAAQ,CAAC;AAYpD,MAAM,MAAM,WAAW,GAAG;IACxB,MAAM,EAAE,MAAM,CAAC,MAAM,CAAC;IACtB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,aAAa,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B,QAAQ,CAAC,EAAE,QAAQ,CAAC,QAAQ,CAAC;IAC7B,cAAc,CAAC,EAAE,MAAM,IAAI,CAAC;CAC7B,CAAC;AAEF,eAAO,MAAM,eAAe;;2HA8N3B,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { type StoryObj } from '@storybook/react-vite';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
declare const meta: {
|
|
4
|
+
title: string;
|
|
5
|
+
render: () => React.JSX.Element;
|
|
6
|
+
decorators: import("@storybook/react").Decorator[];
|
|
7
|
+
parameters: {
|
|
8
|
+
layout: string;
|
|
9
|
+
};
|
|
10
|
+
};
|
|
11
|
+
export default meta;
|
|
12
|
+
type Story = StoryObj<typeof meta>;
|
|
13
|
+
export declare const Default: Story;
|
|
14
|
+
export declare const Builder: Story;
|
|
15
|
+
//# sourceMappingURL=Canvas.stories.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Canvas.stories.d.ts","sourceRoot":"","sources":["../../../../../src/components/Canvas/Canvas.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAa,KAAK,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACjE,OAAO,KAAmB,MAAM,OAAO,CAAC;AAqDxC,QAAA,MAAM,IAAI;;;;;QAKN,MAAM;;CAE2B,CAAC;eAEvB,IAAI;AAEnB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AAEnC,eAAO,MAAM,OAAO,EAAE,KAAU,CAAC;AA2BjC,eAAO,MAAM,OAAO,EAAE,KAErB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/Canvas/index.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAE3C,cAAc,UAAU,CAAC;eAEV,eAAe"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"actions.d.ts","sourceRoot":"","sources":["../../../../src/components/actions.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAErC;;GAEG;AACH,eAAO,MAAM,UAAU,WAAkB,MAAM,CAAC,MAAM,kBA0BrD,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { type TLGridProps } from '@tldraw/editor';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
export declare const GRID_STEPS: {
|
|
4
|
+
min: number;
|
|
5
|
+
mid: number;
|
|
6
|
+
step: number;
|
|
7
|
+
}[];
|
|
8
|
+
/**
|
|
9
|
+
* https://tldraw.dev/examples/ui/custom-grid
|
|
10
|
+
*/
|
|
11
|
+
export declare const CustomGrid: ({ x, y, z, size }: TLGridProps) => React.JSX.Element;
|
|
12
|
+
//# sourceMappingURL=CustomGrid.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CustomGrid.d.ts","sourceRoot":"","sources":["../../../../../src/components/custom/CustomGrid.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAGlD,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,eAAO,MAAM,UAAU;;;;GAKtB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,UAAU,sBAAuB,WAAW,sBAyCxD,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CustomMenu.d.ts","sourceRoot":"","sources":["../../../../../src/components/custom/CustomMenu.tsx"],"names":[],"mappings":"AAIA,OAAO,EAIL,KAAK,mBAAmB,EAGzB,MAAM,gBAAgB,CAAC;AACxB,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,eAAO,MAAM,UAAU,iBAAkB,mBAAmB,sBAgB3D,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CustomStylePanel.d.ts","sourceRoot":"","sources":["../../../../../src/components/custom/CustomStylePanel.tsx"],"names":[],"mappings":"AAKA,OAAO,EAA4B,KAAK,mBAAmB,EAAqB,MAAM,gBAAgB,CAAC;AACvG,OAAO,KAA4B,MAAM,OAAO,CAAC;AAIjD,eAAO,MAAM,gBAAgB,2CAAuB,mBAAmB,8BA2BrE,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
type ToolSplice = {
|
|
3
|
+
toolId: string;
|
|
4
|
+
position: number;
|
|
5
|
+
};
|
|
6
|
+
declare const DefaultToolbarContent: React.MemoExoticComponent<({ toolsToSplice }: {
|
|
7
|
+
toolsToSplice: ToolSplice[];
|
|
8
|
+
}) => React.JSX.Element>;
|
|
9
|
+
export { DefaultToolbarContent };
|
|
10
|
+
//# sourceMappingURL=CustomToolbar.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CustomToolbar.d.ts","sourceRoot":"","sources":["../../../../../src/components/custom/CustomToolbar.tsx"],"names":[],"mappings":"AAmCA,OAAO,KAAe,MAAM,OAAO,CAAC;AAEpC,KAAK,UAAU,GAAG;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,CAAC;AAEvD,QAAA,MAAM,qBAAqB,gDAA4B;IAAE,aAAa,EAAE,UAAU,EAAE,CAAA;CAAE,uBA4CpF,CAAC;AAIH,OAAO,EAAE,qBAAqB,EAAE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DottedGrid.d.ts","sourceRoot":"","sources":["../../../../../src/components/custom/DottedGrid.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,WAAW,EAAwB,MAAM,gBAAgB,CAAC;AAExE,OAAO,KAAgB,MAAM,OAAO,CAAC;AAiBrC,eAAO,MAAM,UAAU,sBAAuB,WAAW,sBA6BxD,CAAC"}
|