@dxos/react-ui-canvas 0.13.0 → 0.14.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/README.md +1 -1
- package/dist/lib/index.mjs +9044 -1135
- package/dist/lib/index.mjs.map +1 -1
- package/dist/types/src/components/About/About.d.ts +13 -0
- package/dist/types/src/components/About/About.d.ts.map +1 -0
- package/dist/types/src/components/About/About.stories.d.ts +7 -0
- package/dist/types/src/components/About/About.stories.d.ts.map +1 -0
- package/dist/types/src/components/About/index.d.ts +2 -0
- package/dist/types/src/components/About/index.d.ts.map +1 -0
- package/dist/types/src/components/Breadcrumbs/Breadcrumbs.d.ts.map +1 -1
- package/dist/types/src/components/ControlFrame/ControlFrame.d.ts +8 -2
- package/dist/types/src/components/ControlFrame/ControlFrame.d.ts.map +1 -1
- package/dist/types/src/components/Layers/Layers.d.ts +30 -0
- package/dist/types/src/components/Layers/Layers.d.ts.map +1 -0
- package/dist/types/src/components/Layers/Layers.stories.d.ts +11 -0
- package/dist/types/src/components/Layers/Layers.stories.d.ts.map +1 -0
- package/dist/types/src/components/Layers/index.d.ts +2 -0
- package/dist/types/src/components/Layers/index.d.ts.map +1 -0
- package/dist/types/src/components/Palette/Palette.d.ts +20 -4
- package/dist/types/src/components/Palette/Palette.d.ts.map +1 -1
- package/dist/types/src/components/Palette/Palette.stories.d.ts +22 -0
- package/dist/types/src/components/Palette/Palette.stories.d.ts.map +1 -0
- package/dist/types/src/components/PartEditor/PartEditor.d.ts.map +1 -1
- package/dist/types/src/components/Properties/AlignField.d.ts +23 -0
- package/dist/types/src/components/Properties/AlignField.d.ts.map +1 -0
- package/dist/types/src/components/Properties/ClassField.d.ts +23 -0
- package/dist/types/src/components/Properties/ClassField.d.ts.map +1 -0
- package/dist/types/src/components/Properties/FontField.d.ts +7 -0
- package/dist/types/src/components/Properties/FontField.d.ts.map +1 -0
- package/dist/types/src/components/Properties/LayerField.d.ts +17 -0
- package/dist/types/src/components/Properties/LayerField.d.ts.map +1 -0
- package/dist/types/src/components/Properties/Properties.d.ts +27 -3
- package/dist/types/src/components/Properties/Properties.d.ts.map +1 -1
- package/dist/types/src/components/Properties/Properties.stories.d.ts +20 -0
- package/dist/types/src/components/Properties/Properties.stories.d.ts.map +1 -0
- package/dist/types/src/components/Properties/SceneField.d.ts +8 -0
- package/dist/types/src/components/Properties/SceneField.d.ts.map +1 -0
- package/dist/types/src/components/Properties/StyleGrid.d.ts +15 -5
- package/dist/types/src/components/Properties/StyleGrid.d.ts.map +1 -1
- package/dist/types/src/components/Properties/StyleGrid.stories.d.ts +7 -0
- package/dist/types/src/components/Properties/StyleGrid.stories.d.ts.map +1 -0
- package/dist/types/src/components/SceneLayer/SceneLayer.d.ts +31 -7
- package/dist/types/src/components/SceneLayer/SceneLayer.d.ts.map +1 -1
- package/dist/types/src/components/SceneView/Dock.d.ts +22 -0
- package/dist/types/src/components/SceneView/Dock.d.ts.map +1 -0
- package/dist/types/src/components/SceneView/Dock.stories.d.ts +15 -0
- package/dist/types/src/components/SceneView/Dock.stories.d.ts.map +1 -0
- package/dist/types/src/components/SceneView/SceneView.d.ts +33 -7
- package/dist/types/src/components/SceneView/SceneView.d.ts.map +1 -1
- package/dist/types/src/components/SceneView/SceneView.stories.d.ts +16 -6
- package/dist/types/src/components/SceneView/SceneView.stories.d.ts.map +1 -1
- package/dist/types/src/components/SceneView/SceneViewContext.d.ts +36 -4
- package/dist/types/src/components/SceneView/SceneViewContext.d.ts.map +1 -1
- package/dist/types/src/components/SceneView/Scored.stories.d.ts +4 -4
- package/dist/types/src/components/SceneView/Scored.stories.d.ts.map +1 -1
- package/dist/types/src/components/SceneView/usePointerMachine.d.ts +3 -1
- package/dist/types/src/components/SceneView/usePointerMachine.d.ts.map +1 -1
- package/dist/types/src/components/SceneView/useSceneCamera.d.ts +2 -2
- package/dist/types/src/components/SceneView/useSceneCamera.d.ts.map +1 -1
- package/dist/types/src/components/SceneView/useSceneClipboard.d.ts.map +1 -1
- package/dist/types/src/components/SceneView/useSceneKeys.d.ts.map +1 -1
- package/dist/types/src/components/SceneView/useSceneNavigation.d.ts +7 -4
- package/dist/types/src/components/SceneView/useSceneNavigation.d.ts.map +1 -1
- package/dist/types/src/components/Toolbar/Toolbar.d.ts +2 -0
- package/dist/types/src/components/Toolbar/Toolbar.d.ts.map +1 -1
- package/dist/types/src/components/Toolbar/Toolbar.stories.d.ts.map +1 -1
- package/dist/types/src/components/index.d.ts +2 -0
- package/dist/types/src/components/index.d.ts.map +1 -1
- package/dist/types/src/hooks/useWheel.d.ts +5 -0
- package/dist/types/src/hooks/useWheel.d.ts.map +1 -1
- package/dist/types/src/index.d.ts +4 -1
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/model/atoms.d.ts +21 -3
- package/dist/types/src/model/atoms.d.ts.map +1 -1
- package/dist/types/src/model/projection.d.ts.map +1 -1
- package/dist/types/src/model/projections/constrained.d.ts +2 -1
- package/dist/types/src/model/projections/constrained.d.ts.map +1 -1
- package/dist/types/src/model/projections/dynamic.d.ts.map +1 -1
- package/dist/types/src/model/projections/lattice.d.ts.map +1 -1
- package/dist/types/src/model/registry.d.ts +21 -3
- package/dist/types/src/model/registry.d.ts.map +1 -1
- package/dist/types/src/model/store.d.ts +10 -2
- package/dist/types/src/model/store.d.ts.map +1 -1
- package/dist/types/src/model/types.d.ts +699 -338
- package/dist/types/src/model/types.d.ts.map +1 -1
- package/dist/types/src/playwright/SceneManager.d.ts +1 -1
- package/dist/types/src/playwright/SceneManager.d.ts.map +1 -1
- package/dist/types/src/utils/builder.d.ts +22 -41
- package/dist/types/src/utils/builder.d.ts.map +1 -1
- package/dist/types/src/utils/camera.d.ts +19 -10
- package/dist/types/src/utils/camera.d.ts.map +1 -1
- package/dist/types/src/utils/clipboard.d.ts +4 -2
- package/dist/types/src/utils/clipboard.d.ts.map +1 -1
- package/dist/types/src/utils/diagram.d.ts.map +1 -1
- package/dist/types/src/utils/group.d.ts +14 -0
- package/dist/types/src/utils/group.d.ts.map +1 -0
- package/dist/types/src/utils/group.test.d.ts +2 -0
- package/dist/types/src/utils/group.test.d.ts.map +1 -0
- package/dist/types/src/utils/gutter-route.d.ts +7 -0
- package/dist/types/src/utils/gutter-route.d.ts.map +1 -1
- package/dist/types/src/utils/hit.d.ts +3 -20
- package/dist/types/src/utils/hit.d.ts.map +1 -1
- package/dist/types/src/utils/index.d.ts +3 -0
- package/dist/types/src/utils/index.d.ts.map +1 -1
- package/dist/types/src/utils/lattice.d.ts +5 -0
- package/dist/types/src/utils/lattice.d.ts.map +1 -1
- package/dist/types/src/utils/layers.d.ts +35 -0
- package/dist/types/src/utils/layers.d.ts.map +1 -0
- package/dist/types/src/utils/layers.test.d.ts +2 -0
- package/dist/types/src/utils/layers.test.d.ts.map +1 -0
- package/dist/types/src/utils/parts.d.ts +25 -9
- package/dist/types/src/utils/parts.d.ts.map +1 -1
- package/dist/types/src/utils/ports.d.ts +2 -0
- package/dist/types/src/utils/ports.d.ts.map +1 -1
- package/dist/types/src/utils/properties.d.ts +4 -3
- package/dist/types/src/utils/properties.d.ts.map +1 -1
- package/dist/types/src/utils/route.d.ts +5 -0
- package/dist/types/src/utils/route.d.ts.map +1 -1
- package/dist/types/src/utils/scenes.d.ts +14 -0
- package/dist/types/src/utils/scenes.d.ts.map +1 -0
- package/dist/types/src/utils/scenes.test.d.ts +2 -0
- package/dist/types/src/utils/scenes.test.d.ts.map +1 -0
- package/dist/types/src/utils/shapes.d.ts +23 -9
- package/dist/types/src/utils/shapes.d.ts.map +1 -1
- package/dist/types/src/utils/style.d.ts +29 -6
- package/dist/types/src/utils/style.d.ts.map +1 -1
- package/dist/types/src/utils/style.test.d.ts +2 -0
- package/dist/types/src/utils/style.test.d.ts.map +1 -0
- package/dist/types/src/utils/testing.d.ts +2 -2
- package/dist/types/src/utils/testing.d.ts.map +1 -1
- package/dist/types/src/utils/undo.d.ts +15 -4
- package/dist/types/src/utils/undo.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +20 -26
- package/src/components/About/About.stories.tsx +32 -0
- package/src/components/About/About.tsx +38 -0
- package/src/components/About/index.ts +5 -0
- package/src/components/Breadcrumbs/Breadcrumbs.tsx +17 -3
- package/src/components/ControlFrame/ControlFrame.tsx +138 -82
- package/src/components/Grid/Grid.stories.tsx +1 -1
- package/src/components/Layers/Layers.stories.tsx +131 -0
- package/src/components/Layers/Layers.tsx +216 -0
- package/src/components/Layers/index.ts +5 -0
- package/src/components/Palette/Palette.stories.tsx +135 -0
- package/src/components/Palette/Palette.tsx +230 -39
- package/src/components/PartEditor/PartEditor.tsx +4 -3
- package/src/components/Properties/AlignField.tsx +117 -0
- package/src/components/Properties/ClassField.tsx +44 -0
- package/src/components/Properties/FontField.tsx +73 -0
- package/src/components/Properties/LayerField.tsx +61 -0
- package/src/components/Properties/Properties.stories.tsx +113 -0
- package/src/components/Properties/Properties.tsx +240 -60
- package/src/components/Properties/SceneField.tsx +22 -0
- package/src/components/Properties/StyleGrid.stories.tsx +50 -0
- package/src/components/Properties/StyleGrid.tsx +54 -26
- package/src/components/SceneLayer/SceneLayer.tsx +497 -188
- package/src/components/SceneView/Constrained.stories.tsx +1 -1
- package/src/components/SceneView/Dock.stories.tsx +95 -0
- package/src/components/SceneView/Dock.tsx +146 -0
- package/src/components/SceneView/Dynamic.stories.tsx +1 -1
- package/src/components/SceneView/SceneView.stories.tsx +170 -18
- package/src/components/SceneView/SceneView.tsx +565 -151
- package/src/components/SceneView/SceneViewContext.ts +23 -2
- package/src/components/SceneView/Scored.stories.tsx +11 -11
- package/src/components/SceneView/usePointerMachine.ts +80 -20
- package/src/components/SceneView/useSceneCamera.ts +15 -8
- package/src/components/SceneView/useSceneClipboard.ts +4 -0
- package/src/components/SceneView/useSceneKeys.ts +6 -4
- package/src/components/SceneView/useSceneNavigation.ts +44 -33
- package/src/components/Toolbar/Toolbar.stories.tsx +14 -15
- package/src/components/Toolbar/Toolbar.tsx +15 -4
- package/src/components/index.ts +2 -0
- package/src/hooks/useWheel.ts +35 -0
- package/src/index.ts +4 -3
- package/src/model/atoms.ts +27 -3
- package/src/model/projection.ts +5 -0
- package/src/model/projections/constrained.test.ts +18 -10
- package/src/model/projections/constrained.ts +19 -8
- package/src/model/projections/dynamic.ts +5 -2
- package/src/model/projections/lattice.ts +15 -3
- package/src/model/registry.test.ts +14 -9
- package/src/model/registry.ts +39 -34
- package/src/model/store.ts +12 -2
- package/src/model/types.ts +124 -36
- package/src/playwright/SceneManager.ts +2 -2
- package/src/playwright/create.spec.ts +5 -3
- package/src/playwright/demo.spec.ts +2 -2
- package/src/playwright/lattice.spec.ts +4 -5
- package/src/playwright/scene.spec.ts +27 -25
- package/src/utils/builder.test.ts +46 -9
- package/src/utils/builder.ts +42 -18
- package/src/utils/camera.test.ts +22 -51
- package/src/utils/camera.ts +39 -32
- package/src/utils/clipboard.test.ts +23 -2
- package/src/utils/clipboard.ts +8 -4
- package/src/utils/diagram.test.ts +3 -1
- package/src/utils/diagram.ts +3 -25
- package/src/utils/group.test.ts +69 -0
- package/src/utils/group.ts +94 -0
- package/src/utils/gutter-route.test.ts +49 -0
- package/src/utils/gutter-route.ts +142 -16
- package/src/utils/hit.test.ts +4 -38
- package/src/utils/hit.ts +4 -26
- package/src/utils/index.ts +3 -0
- package/src/utils/lattice.ts +7 -1
- package/src/utils/layers.test.ts +139 -0
- package/src/utils/layers.ts +175 -0
- package/src/utils/parts.test.ts +66 -32
- package/src/utils/parts.ts +63 -41
- package/src/utils/ports.ts +7 -4
- package/src/utils/properties.test.ts +23 -6
- package/src/utils/properties.ts +66 -16
- package/src/utils/route.test.ts +51 -2
- package/src/utils/route.ts +133 -23
- package/src/utils/scenes.test.ts +38 -0
- package/src/utils/scenes.ts +54 -0
- package/src/utils/shapes.test.ts +33 -8
- package/src/utils/shapes.ts +51 -35
- package/src/utils/style.test.ts +54 -0
- package/src/utils/style.ts +153 -40
- package/src/utils/testing.test.ts +3 -3
- package/src/utils/testing.ts +21 -30
- package/src/utils/undo.test.ts +25 -2
- package/src/utils/undo.ts +50 -13
- package/dist/lib/chunk-Grid.mjs +0 -99
- package/dist/lib/chunk-Grid.mjs.map +0 -1
- package/dist/lib/scene.mjs +0 -6835
- package/dist/lib/scene.mjs.map +0 -1
- package/dist/lib/types.mjs +0 -16
- package/dist/lib/types.mjs.map +0 -1
- package/dist/types/src/archive/components/Canvas/Canvas.d.ts +0 -15
- package/dist/types/src/archive/components/Canvas/Canvas.d.ts.map +0 -1
- package/dist/types/src/archive/components/Canvas/Canvas.stories.d.ts +0 -18
- package/dist/types/src/archive/components/Canvas/Canvas.stories.d.ts.map +0 -1
- package/dist/types/src/archive/components/Canvas/index.d.ts +0 -2
- package/dist/types/src/archive/components/Canvas/index.d.ts.map +0 -1
- package/dist/types/src/archive/components/CellGrid/CellGrid.d.ts +0 -21
- package/dist/types/src/archive/components/CellGrid/CellGrid.d.ts.map +0 -1
- package/dist/types/src/archive/components/CellGrid/CellGrid.stories.d.ts +0 -21
- package/dist/types/src/archive/components/CellGrid/CellGrid.stories.d.ts.map +0 -1
- package/dist/types/src/archive/components/CellGrid/headers/Ruler.d.ts +0 -15
- package/dist/types/src/archive/components/CellGrid/headers/Ruler.d.ts.map +0 -1
- package/dist/types/src/archive/components/CellGrid/headers/TrackHeader.d.ts +0 -19
- package/dist/types/src/archive/components/CellGrid/headers/TrackHeader.d.ts.map +0 -1
- package/dist/types/src/archive/components/CellGrid/headers/index.d.ts +0 -3
- package/dist/types/src/archive/components/CellGrid/headers/index.d.ts.map +0 -1
- package/dist/types/src/archive/components/CellGrid/index.d.ts +0 -6
- package/dist/types/src/archive/components/CellGrid/index.d.ts.map +0 -1
- package/dist/types/src/archive/components/CellGrid/input/index.d.ts +0 -3
- package/dist/types/src/archive/components/CellGrid/input/index.d.ts.map +0 -1
- package/dist/types/src/archive/components/CellGrid/input/pointer.d.ts +0 -33
- package/dist/types/src/archive/components/CellGrid/input/pointer.d.ts.map +0 -1
- package/dist/types/src/archive/components/CellGrid/input/wheel.d.ts +0 -14
- package/dist/types/src/archive/components/CellGrid/input/wheel.d.ts.map +0 -1
- package/dist/types/src/archive/components/CellGrid/render/index.d.ts +0 -3
- package/dist/types/src/archive/components/CellGrid/render/index.d.ts.map +0 -1
- package/dist/types/src/archive/components/CellGrid/render/overlay-layer.d.ts +0 -21
- package/dist/types/src/archive/components/CellGrid/render/overlay-layer.d.ts.map +0 -1
- package/dist/types/src/archive/components/CellGrid/render/static-layer.d.ts +0 -36
- package/dist/types/src/archive/components/CellGrid/render/static-layer.d.ts.map +0 -1
- package/dist/types/src/archive/components/CellGrid/state/atoms.d.ts +0 -23
- package/dist/types/src/archive/components/CellGrid/state/atoms.d.ts.map +0 -1
- package/dist/types/src/archive/components/CellGrid/state/index.d.ts +0 -4
- package/dist/types/src/archive/components/CellGrid/state/index.d.ts.map +0 -1
- package/dist/types/src/archive/components/CellGrid/state/types.d.ts +0 -39
- package/dist/types/src/archive/components/CellGrid/state/types.d.ts.map +0 -1
- package/dist/types/src/archive/components/CellGrid/state/viewport.d.ts +0 -52
- package/dist/types/src/archive/components/CellGrid/state/viewport.d.ts.map +0 -1
- package/dist/types/src/archive/components/CellGrid/state/viewport.test.d.ts +0 -2
- package/dist/types/src/archive/components/CellGrid/state/viewport.test.d.ts.map +0 -1
- package/dist/types/src/archive/components/FPS.d.ts +0 -9
- package/dist/types/src/archive/components/FPS.d.ts.map +0 -1
- package/dist/types/src/archive/components/Grid/Grid.d.ts +0 -6
- package/dist/types/src/archive/components/Grid/Grid.d.ts.map +0 -1
- package/dist/types/src/archive/components/Grid/index.d.ts +0 -2
- package/dist/types/src/archive/components/Grid/index.d.ts.map +0 -1
- package/dist/types/src/archive/components/index.d.ts +0 -5
- package/dist/types/src/archive/components/index.d.ts.map +0 -1
- package/dist/types/src/archive/hooks/index.d.ts +0 -5
- package/dist/types/src/archive/hooks/index.d.ts.map +0 -1
- package/dist/types/src/archive/hooks/projection.d.ts +0 -60
- package/dist/types/src/archive/hooks/projection.d.ts.map +0 -1
- package/dist/types/src/archive/hooks/useCanvasContext.d.ts +0 -13
- package/dist/types/src/archive/hooks/useCanvasContext.d.ts.map +0 -1
- package/dist/types/src/archive/hooks/useDrag.d.ts +0 -6
- package/dist/types/src/archive/hooks/useDrag.d.ts.map +0 -1
- package/dist/types/src/archive/hooks/useWheel.d.ts +0 -8
- package/dist/types/src/archive/hooks/useWheel.d.ts.map +0 -1
- package/dist/types/src/archive/index.d.ts +0 -5
- package/dist/types/src/archive/index.d.ts.map +0 -1
- package/dist/types/src/archive/types.d.ts +0 -19
- package/dist/types/src/archive/types.d.ts.map +0 -1
- package/dist/types/src/archive/util/index.d.ts +0 -4
- package/dist/types/src/archive/util/index.d.ts.map +0 -1
- package/dist/types/src/archive/util/svg-path.d.ts +0 -4
- package/dist/types/src/archive/util/svg-path.d.ts.map +0 -1
- package/dist/types/src/archive/util/svg.d.ts +0 -32
- package/dist/types/src/archive/util/svg.d.ts.map +0 -1
- package/dist/types/src/archive/util/svg.stories.d.ts +0 -15
- package/dist/types/src/archive/util/svg.stories.d.ts.map +0 -1
- package/dist/types/src/archive/util/util.d.ts +0 -17
- package/dist/types/src/archive/util/util.d.ts.map +0 -1
- package/dist/types/src/scene.d.ts +0 -5
- package/dist/types/src/scene.d.ts.map +0 -1
- package/src/archive/components/Canvas/Canvas.stories.tsx +0 -111
- package/src/archive/components/Canvas/Canvas.tsx +0 -87
- package/src/archive/components/Canvas/index.ts +0 -5
- package/src/archive/components/CellGrid/CellGrid.stories.tsx +0 -239
- package/src/archive/components/CellGrid/CellGrid.tsx +0 -270
- package/src/archive/components/CellGrid/headers/Ruler.tsx +0 -71
- package/src/archive/components/CellGrid/headers/TrackHeader.tsx +0 -58
- package/src/archive/components/CellGrid/headers/index.ts +0 -6
- package/src/archive/components/CellGrid/index.ts +0 -9
- package/src/archive/components/CellGrid/input/index.ts +0 -6
- package/src/archive/components/CellGrid/input/pointer.ts +0 -236
- package/src/archive/components/CellGrid/input/wheel.ts +0 -68
- package/src/archive/components/CellGrid/render/index.ts +0 -6
- package/src/archive/components/CellGrid/render/overlay-layer.ts +0 -66
- package/src/archive/components/CellGrid/render/static-layer.ts +0 -112
- package/src/archive/components/CellGrid/state/atoms.ts +0 -43
- package/src/archive/components/CellGrid/state/index.ts +0 -7
- package/src/archive/components/CellGrid/state/types.ts +0 -40
- package/src/archive/components/CellGrid/state/viewport.test.ts +0 -50
- package/src/archive/components/CellGrid/state/viewport.ts +0 -94
- package/src/archive/components/FPS.tsx +0 -98
- package/src/archive/components/Grid/Grid.tsx +0 -17
- package/src/archive/components/Grid/index.ts +0 -5
- package/src/archive/components/index.ts +0 -8
- package/src/archive/hooks/index.ts +0 -8
- package/src/archive/hooks/projection.tsx +0 -156
- package/src/archive/hooks/useCanvasContext.ts +0 -32
- package/src/archive/hooks/useDrag.tsx +0 -96
- package/src/archive/hooks/useWheel.tsx +0 -80
- package/src/archive/index.ts +0 -8
- package/src/archive/types.ts +0 -14
- package/src/archive/util/index.ts +0 -7
- package/src/archive/util/svg-path.ts +0 -13
- package/src/archive/util/svg.stories.tsx +0 -46
- package/src/archive/util/svg.tsx +0 -128
- package/src/archive/util/util.ts +0 -50
- package/src/scene.ts +0 -9
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as Schema from 'effect/Schema';
|
|
2
|
-
import
|
|
2
|
+
import * as SchemaAST from 'effect/SchemaAST';
|
|
3
3
|
type Values = Readonly<Record<string, unknown>>;
|
|
4
4
|
/**
|
|
5
5
|
* Whether two property types describe the same values, so one field can edit both. Separately declared
|
|
@@ -8,8 +8,9 @@ type Values = Readonly<Record<string, unknown>>;
|
|
|
8
8
|
*/
|
|
9
9
|
export declare const sameType: (left: SchemaAST.AST, right: SchemaAST.AST) => boolean;
|
|
10
10
|
/**
|
|
11
|
-
* The properties every schema declares alike, as one struct over the first schema's declarations
|
|
12
|
-
* `undefined` when they share none. One schema is
|
|
11
|
+
* The properties every schema declares alike, as one struct over the first schema's declarations, a struct
|
|
12
|
+
* property narrowed to the fields every schema's declares alike; `undefined` when they share none. One schema is
|
|
13
|
+
* its own common schema.
|
|
13
14
|
*/
|
|
14
15
|
export declare const commonSchema: (schemas: readonly Schema.Codec<any, any>[]) => Schema.Codec<any, any> | undefined;
|
|
15
16
|
export type MergedValues = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"properties.d.ts","sourceRoot":"","sources":["../../../../src/utils/properties.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AACxC,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"properties.d.ts","sourceRoot":"","sources":["../../../../src/utils/properties.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AACxC,OAAO,KAAK,SAAS,MAAM,kBAAkB,CAAC;AAI9C,KAAK,MAAM,GAAG,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;AAgChD;;;;GAIG;AACH,eAAO,MAAM,QAAQ,SAAU,SAAS,CAAC,GAAG,SAAS,SAAS,CAAC,GAAG,KAAG,OA2BpE,CAAC;AAiDF;;;;GAIG;AACH,eAAO,MAAM,YAAY,YAAa,SAAS,MAAM,CAAC,KAAK,CAAC,GAAG,EAAE,GAAG,CAAC,EAAE,KAAG,MAAM,CAAC,KAAK,CAAC,GAAG,EAAE,GAAG,CAAC,GAAG,SAclG,CAAC;AAgBF,MAAM,MAAM,YAAY,GAAG;IACzB,mHAAmH;IACnH,MAAM,EAAE,MAAM,CAAC;IACf,wEAAwE;IACxE,KAAK,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;CACpB,CAAC;AAEF,mHAAmH;AACnH,eAAO,MAAM,WAAW,YAAa,SAAS,MAAM,EAAE,QAAQ,SAAS,WAAW,EAAE,KAAG,YAoBtF,CAAC;AAcF;;;GAGG;AACH,eAAO,MAAM,WAAW,YAAa,MAAM,UAAU,MAAM,SAAS,SAAS,MAAM,EAAE,KAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAO7G,CAAC"}
|
|
@@ -1,9 +1,14 @@
|
|
|
1
1
|
import { type NodeRegistry } from '../model/registry.ts';
|
|
2
2
|
import { type Link, type Node, type Point, type Scene, type Side } from '../model/types.ts';
|
|
3
3
|
import { type LatticeSpec } from './lattice.ts';
|
|
4
|
+
/**
|
|
5
|
+
* A resolved link end. `free` marks a point end (one being dragged, or left on empty canvas): it has no port to
|
|
6
|
+
* leave along, so a route runs straight to it rather than turning to its side's normal.
|
|
7
|
+
*/
|
|
4
8
|
export type RouteEnd = {
|
|
5
9
|
point: Point;
|
|
6
10
|
side: Side;
|
|
11
|
+
free?: boolean;
|
|
7
12
|
};
|
|
8
13
|
export declare const linePath: (from: Point, to: Point) => string;
|
|
9
14
|
/** Cubic Bézier whose control points sit `tangent` px out along each port's normal. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"route.d.ts","sourceRoot":"","sources":["../../../../src/utils/route.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,EAGL,KAAK,IAAI,EAET,KAAK,IAAI,EACT,KAAK,KAAK,EAGV,KAAK,KAAK,EACV,KAAK,IAAI,EAEV,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"route.d.ts","sourceRoot":"","sources":["../../../../src/utils/route.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,EAGL,KAAK,IAAI,EAET,KAAK,IAAI,EACT,KAAK,KAAK,EAGV,KAAK,KAAK,EACV,KAAK,IAAI,EAEV,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,cAAc,CAAC;AAwBhD;;;GAGG;AACH,MAAM,MAAM,QAAQ,GAAG;IAAE,KAAK,EAAE,KAAK,CAAC;IAAC,IAAI,EAAE,IAAI,CAAC;IAAC,IAAI,CAAC,EAAE,OAAO,CAAA;CAAE,CAAC;AAIpE,eAAO,MAAM,QAAQ,SAAU,KAAK,MAAM,KAAK,KAAG,MAAqC,CAAC;AAcxF,uFAAuF;AACvF,eAAO,MAAM,SAAS,SAAU,QAAQ,MAAM,QAAQ,KAAG,MAGxD,CAAC;AAEF,gFAAgF;AAChF,eAAO,MAAM,UAAU,SAAU,QAAQ,MAAM,QAAQ,KAAK,MAAM,KAAG,KASpE,CAAC;AAYF;;;;;GAKG;AACH,eAAO,MAAM,UAAU,WAAY,SAAS,KAAK,EAAE,KAAG,MAgBrD,CAAC;AAEF,8GAA8G;AAC9G,eAAO,MAAM,QAAQ,SAAU,IAAI,QAAQ,QAAQ,MAAM,QAAQ,YAAY,YAAY,KAAG,MAkB3F,CAAC;AAEF,kFAAkF;AAClF,MAAM,MAAM,YAAY,GAAG;IAAE,IAAI,EAAE,WAAW,CAAC;IAAC,KAAK,EAAE,SAAS,IAAI,EAAE,CAAA;CAAE,CAAC;AAEzE;;;;GAIG;AACH,eAAO,MAAM,WAAW,SAAU,QAAQ,MAAM,QAAQ,KAAG,KAAK,EAO/D,CAAC;AAEF,MAAM,MAAM,YAAY,GAAG;IAAE,IAAI,EAAE,IAAI,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,QAAQ,CAAC;IAAC,MAAM,EAAE,QAAQ,CAAA;CAAE,CAAC;AAE5F,oGAAoG;AACpG,eAAO,MAAM,UAAU,SAAU,KAAK,MAAM,KAAK,KAAG,IAInD,CAAC;AAiGF;;;GAGG;AACH,eAAO,MAAM,YAAY,UAChB,KAAK,YACF,YAAY,QAChB,IAAI,YACA,WAAW,KACpB,YAAY,GAAG,SAYjB,CAAC;AAyCF;;;;;GAKG;AACH,eAAO,MAAM,iBAAiB,UACrB,KAAK,YACF,YAAY,SACf,SAAS,IAAI,EAAE,YACZ,WAAW,KACpB,YAAY,EAiDd,CAAC;AAEF,iGAAiG;AACjG,eAAO,MAAM,WAAW,SAAU,KAAK,UAAU,SAAS,KAAK,EAAE,MAAM,KAAK,SAAS,KAAK,KAAG,MAY5F,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { type SceneMap } from '../model/store.ts';
|
|
2
|
+
import { type SceneId } from '../model/types.ts';
|
|
3
|
+
/** A scene a scene shape may open, as the properties panel lists it. */
|
|
4
|
+
export type SceneOption = {
|
|
5
|
+
value: SceneId;
|
|
6
|
+
label: string;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* The scenes a shape in the scene at the head of `path` may open: any scene of the store, shared by as many shapes
|
|
10
|
+
* as open it, except one that would open the path again, which would nest the scene in itself without end. An
|
|
11
|
+
* unnamed scene reads as the label of a shape that opens it.
|
|
12
|
+
*/
|
|
13
|
+
export declare const sceneOptions: (scenes: SceneMap, path: readonly SceneId[], filter?: (id: SceneId) => boolean) => SceneOption[];
|
|
14
|
+
//# sourceMappingURL=scenes.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scenes.d.ts","sourceRoot":"","sources":["../../../../src/utils/scenes.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAClD,OAAO,EAAc,KAAK,OAAO,EAAe,MAAM,mBAAmB,CAAC;AAE1E,wEAAwE;AACxE,MAAM,MAAM,WAAW,GAAG;IAAE,KAAK,EAAE,OAAO,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAAC;AAsB5D;;;;GAIG;AACH,eAAO,MAAM,YAAY,WACf,QAAQ,QACV,SAAS,OAAO,EAAE,WAChB,CAAC,EAAE,EAAE,OAAO,KAAK,OAAO,KAC/B,WAAW,EAcb,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scenes.test.d.ts","sourceRoot":"","sources":["../../../../src/utils/scenes.test.ts"],"names":[],"mappings":""}
|
|
@@ -1,19 +1,30 @@
|
|
|
1
|
-
import { type Bounds, type BuiltinNode, type BuiltinNodeType, type Endpoint, type Link, type LinkEnds, type LinkType, type Node, type Point, type Size } from '../model/types.ts';
|
|
1
|
+
import { type Bounds, type BuiltinNode, type BuiltinNodeType, type Endpoint, type Link, type LinkEnds, type LinkType, type LinkValues, type Node, type Point, type Size } from '../model/types.ts';
|
|
2
|
+
import { type PartField } from './parts.ts';
|
|
2
3
|
/** Axis-aligned frame of a node: its size centred on its centre. */
|
|
3
4
|
export declare const nodeBounds: (node: Node) => Bounds;
|
|
4
5
|
export declare const nodeSize: (node: Node) => Size;
|
|
5
6
|
/** The node re-framed to `bounds`. */
|
|
6
7
|
export declare const resizeNode: <N extends Node>(node: N, bounds: Bounds) => N;
|
|
7
|
-
/**
|
|
8
|
-
export declare const
|
|
8
|
+
/** Scene px of one nominal unit (a major grid cell) at the default grid. */
|
|
9
|
+
export declare const DEFAULT_CELL: number;
|
|
10
|
+
/** A nominal size (in major grid cells) in scene px, for a drawing whose major cell is `cell` px. */
|
|
11
|
+
export declare const nominalSize: (size: Size, cell?: number) => Size;
|
|
12
|
+
/**
|
|
13
|
+
* The built-in types' sizes when created, in nominal units: one unit is the drawing's major grid cell, so a
|
|
14
|
+
* new shape scales with the drawing's grid.
|
|
15
|
+
*/
|
|
16
|
+
export declare const NOMINAL_SIZES: Record<BuiltinNodeType, Size>;
|
|
17
|
+
/** The built-in types' sizes in scene px, for fixtures and imports, whose layouts are written against them. */
|
|
9
18
|
export declare const DEFAULT_SIZES: Record<BuiltinNodeType, Size>;
|
|
19
|
+
/** The bounding box a new basic shape gets at the default grid. */
|
|
20
|
+
export declare const DEFAULT_SHAPE_SIZE: Size;
|
|
10
21
|
export type CreateNodeProps = {
|
|
11
22
|
type: BuiltinNodeType;
|
|
12
23
|
id: string;
|
|
13
24
|
z: string;
|
|
14
25
|
center: Point;
|
|
15
26
|
size?: Size;
|
|
16
|
-
/** A
|
|
27
|
+
/** A frame's child scene id. */
|
|
17
28
|
scene?: string;
|
|
18
29
|
};
|
|
19
30
|
/** A new built-in node of `type` with its type's default content; a host type creates through its `NodeDef`. */
|
|
@@ -22,9 +33,7 @@ export declare const createNode: ({ type, id, z, center, size, scene, }: CreateN
|
|
|
22
33
|
* A new shape like `source` (its size, look and ports) built on `fresh`, the type's own new node at the
|
|
23
34
|
* new place: it keeps its own identity and child scene, and the type's text rather than the source's.
|
|
24
35
|
*/
|
|
25
|
-
export declare const cloneShape: (source: Node, fresh: Node) => Node;
|
|
26
|
-
/** The node's display text, in the field its type uses for it; a type without one is returned as is. */
|
|
27
|
-
export declare const withLabel: <N extends Node>(node: N, label: string) => N;
|
|
36
|
+
export declare const cloneShape: (source: Node, fresh: Node, parts?: readonly PartField[]) => Node;
|
|
28
37
|
export type CreateLinkProps = {
|
|
29
38
|
type: LinkType;
|
|
30
39
|
id: string;
|
|
@@ -33,9 +42,14 @@ export type CreateLinkProps = {
|
|
|
33
42
|
target: Endpoint;
|
|
34
43
|
/** Where a new spline gets its first control point; ignored by the other types. */
|
|
35
44
|
midpoint?: Point;
|
|
36
|
-
directed?: boolean;
|
|
37
45
|
ends?: LinkEnds;
|
|
38
46
|
};
|
|
39
47
|
/** A new link of `type`; a spline starts with one control point so it is editable at once. */
|
|
40
|
-
export declare const createLink: ({ type, id, z, source, target, midpoint,
|
|
48
|
+
export declare const createLink: ({ type, id, z, source, target, midpoint, ends }: CreateLinkProps) => Link;
|
|
49
|
+
/**
|
|
50
|
+
* The `update` values that reverse a link: source and target swap while the markers stay at the start and
|
|
51
|
+
* end, so an arrow comes to point the other way; a spline's control points run the other way, so the drawn
|
|
52
|
+
* path keeps its shape.
|
|
53
|
+
*/
|
|
54
|
+
export declare const flipLink: (link: Link) => LinkValues;
|
|
41
55
|
//# sourceMappingURL=shapes.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shapes.d.ts","sourceRoot":"","sources":["../../../../src/utils/shapes.ts"],"names":[],"mappings":"AAUA,OAAO,EACL,KAAK,MAAM,EACX,KAAK,WAAW,EAChB,KAAK,eAAe,
|
|
1
|
+
{"version":3,"file":"shapes.d.ts","sourceRoot":"","sources":["../../../../src/utils/shapes.ts"],"names":[],"mappings":"AAUA,OAAO,EACL,KAAK,MAAM,EACX,KAAK,WAAW,EAChB,KAAK,eAAe,EAEpB,KAAK,QAAQ,EACb,KAAK,IAAI,EACT,KAAK,QAAQ,EACb,KAAK,QAAQ,EACb,KAAK,UAAU,EAEf,KAAK,IAAI,EACT,KAAK,KAAK,EACV,KAAK,IAAI,EACV,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,YAAY,CAAC;AAE5C,oEAAoE;AACpE,eAAO,MAAM,UAAU,SAAU,IAAI,KAAG,MAKtC,CAAC;AAEH,eAAO,MAAM,QAAQ,SAAU,IAAI,KAAG,IAAiB,CAAC;AAExD,sCAAsC;AACtC,eAAO,MAAM,UAAU,GAAI,CAAC,SAAS,IAAI,QAAQ,CAAC,UAAU,MAAM,KAAG,CAInE,CAAC;AAEH,4EAA4E;AAC5E,eAAO,MAAM,YAAY,QAAkC,CAAC;AAE5D,qGAAqG;AACrG,eAAO,MAAM,WAAW,SAAU,IAAI,SAAQ,MAAM,KAAkB,IAGpE,CAAC;AAEH;;;GAGG;AACH,eAAO,MAAM,aAAa,EAAE,MAAM,CAAC,eAAe,EAAE,IAAI,CAKvD,CAAC;AAEF,+GAA+G;AAC/G,eAAO,MAAM,aAAa,EAAE,MAAM,CAAC,eAAe,EAAE,IAAI,CAKvD,CAAC;AAEF,mEAAmE;AACnE,eAAO,MAAM,kBAAkB,EAAE,IAAyB,CAAC;AAE3D,MAAM,MAAM,eAAe,GAAG;IAC5B,IAAI,EAAE,eAAe,CAAC;IACtB,EAAE,EAAE,MAAM,CAAC;IACX,CAAC,EAAE,MAAM,CAAC;IACV,MAAM,EAAE,KAAK,CAAC;IACd,IAAI,CAAC,EAAE,IAAI,CAAC;IACZ,gCAAgC;IAChC,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,gHAAgH;AAChH,eAAO,MAAM,UAAU,0CAOpB,eAAe,KAAG,WAYpB,CAAC;AAKF;;;GAGG;AACH,eAAO,MAAM,UAAU,WAAY,IAAI,SAAS,IAAI,UAAS,SAAS,SAAS,EAAE,KAAQ,IAMxF,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG;IAC5B,IAAI,EAAE,QAAQ,CAAC;IACf,EAAE,EAAE,MAAM,CAAC;IACX,CAAC,EAAE,MAAM,CAAC;IACV,MAAM,EAAE,QAAQ,CAAC;IACjB,MAAM,EAAE,QAAQ,CAAC;IACjB,mFAAmF;IACnF,QAAQ,CAAC,EAAE,KAAK,CAAC;IACjB,IAAI,CAAC,EAAE,QAAQ,CAAC;CACjB,CAAC;AAEF,8FAA8F;AAC9F,eAAO,MAAM,UAAU,oDAAqD,eAAe,KAAG,IAU7F,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,QAAQ,SAAU,IAAI,KAAG,UAIpC,CAAC"}
|
|
@@ -1,12 +1,9 @@
|
|
|
1
|
-
import { type Node, type NodeStyle, type NodeTone } from '../model/types.ts';
|
|
1
|
+
import { type HorizontalAlign, type Link, type Node, type NodeStyle, type NodeTone, type StyleMap, type VerticalAlign } from '../model/types.ts';
|
|
2
2
|
export type HueClasses = {
|
|
3
3
|
surface: string;
|
|
4
4
|
text: string;
|
|
5
5
|
border: string;
|
|
6
6
|
};
|
|
7
|
-
/** The hues the style picker offers, neutral first; any theme hue still renders, at its `medium` tone. */
|
|
8
|
-
export declare const STYLE_HUES: readonly ['neutral', 'red', 'orange', 'amber', 'green', 'teal', 'blue', 'violet', 'pink'];
|
|
9
|
-
export type StyleHue = (typeof STYLE_HUES)[number];
|
|
10
7
|
export declare const TONES: readonly NodeTone[];
|
|
11
8
|
/** What each tone is called, for labels. */
|
|
12
9
|
export declare const TONE_NAMES: Record<NodeTone, string>;
|
|
@@ -14,9 +11,13 @@ export declare const TONE_NAMES: Record<NodeTone, string>;
|
|
|
14
11
|
export declare const DEFAULT_TONE: NodeTone;
|
|
15
12
|
/**
|
|
16
13
|
* The classes a hue at a tone draws with. Every tone keeps the hue's border; tone 0 drops the fill and
|
|
17
|
-
* keeps the default text, and a tone a hue has no fills for draws as `medium
|
|
14
|
+
* keeps the default text, and a tone a hue has no fills for draws as `medium` (its role pair).
|
|
18
15
|
*/
|
|
19
16
|
export declare const hueClasses: (hue: string | undefined, tone?: NodeTone) => HueClasses;
|
|
17
|
+
/** A node as drawn: its class's style under its own (`StyleClass`). */
|
|
18
|
+
export declare const classedNode: (node: Node, styles: StyleMap | undefined) => Node;
|
|
19
|
+
/** A link as drawn: its class's colour and line style under its own. */
|
|
20
|
+
export declare const classedLink: (link: Link, styles: StyleMap | undefined) => Link;
|
|
20
21
|
/**
|
|
21
22
|
* A node's style with the defaults the frame draws spelled out: an unset `fill` or `border` is drawn, so
|
|
22
23
|
* the properties panel must show it as on rather than as an unset (off) toggle.
|
|
@@ -24,7 +25,29 @@ export declare const hueClasses: (hue: string | undefined, tone?: NodeTone) => H
|
|
|
24
25
|
export declare const resolveStyle: (style?: NodeStyle) => NodeStyle;
|
|
25
26
|
/**
|
|
26
27
|
* Frame classes for a node: fill and text colour, border and corner radius from its style; a guide is
|
|
27
|
-
* dashed and unfilled
|
|
28
|
+
* dashed and unfilled.
|
|
28
29
|
*/
|
|
29
30
|
export declare const frameClasses: (node: Node, selected: boolean, hovered?: boolean) => string[];
|
|
31
|
+
export type LineClasses = {
|
|
32
|
+
stroke: string;
|
|
33
|
+
fill: string;
|
|
34
|
+
};
|
|
35
|
+
export declare const lineClasses: (hue: string | undefined) => LineClasses;
|
|
36
|
+
/**
|
|
37
|
+
* Splits an edit of a classed element's look (`edited`, against what the panel `shown`): every field that changed
|
|
38
|
+
* goes to the class, so each element of the class derives it, and the element drops its own value for that field,
|
|
39
|
+
* which would otherwise hide the class's.
|
|
40
|
+
*/
|
|
41
|
+
export declare const splitClassEdit: <T extends object>(shown: object | undefined, edited: unknown, classLook: T, own: T | undefined) => {
|
|
42
|
+
classLook: T;
|
|
43
|
+
own: T | undefined;
|
|
44
|
+
};
|
|
45
|
+
/**
|
|
46
|
+
* Classes placing a text part in its shape by the style's alignment, else by the type's own (`defaults`): the part
|
|
47
|
+
* is a column, so `justify` places it down the shape and `items` across it.
|
|
48
|
+
*/
|
|
49
|
+
export declare const alignClasses: (style: NodeStyle | undefined, defaults: {
|
|
50
|
+
horizontal: HorizontalAlign;
|
|
51
|
+
vertical: VerticalAlign;
|
|
52
|
+
}) => string;
|
|
30
53
|
//# sourceMappingURL=style.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"style.d.ts","sourceRoot":"","sources":["../../../../src/utils/style.ts"],"names":[],"mappings":"AASA,OAAO,
|
|
1
|
+
{"version":3,"file":"style.d.ts","sourceRoot":"","sources":["../../../../src/utils/style.ts"],"names":[],"mappings":"AASA,OAAO,EACL,KAAK,eAAe,EACpB,KAAK,IAAI,EACT,KAAK,IAAI,EACT,KAAK,SAAS,EACd,KAAK,QAAQ,EAGb,KAAK,QAAQ,EACb,KAAK,aAAa,EAInB,MAAM,mBAAmB,CAAC;AAE3B,MAAM,MAAM,UAAU,GAAG;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC;AAuB3E,eAAO,MAAM,KAAK,EAAE,SAAS,QAAQ,EAAiB,CAAC;AAEvD,4CAA4C;AAC5C,eAAO,MAAM,UAAU,EAAE,MAAM,CAAC,QAAQ,EAAE,MAAM,CAA0D,CAAC;AAE3G,4EAA4E;AAC5E,eAAO,MAAM,YAAY,EAAE,QAAY,CAAC;AAoDxC;;;GAGG;AACH,eAAO,MAAM,UAAU,QAAS,MAAM,GAAG,SAAS,SAAQ,QAAQ,KAAkB,UAYnF,CAAC;AAgBF,uEAAuE;AACvE,eAAO,MAAM,WAAW,SAAU,IAAI,UAAU,QAAQ,GAAG,SAAS,KAAG,IAGtE,CAAC;AAEF,wEAAwE;AACxE,eAAO,MAAM,WAAW,SAAU,IAAI,UAAU,QAAQ,GAAG,SAAS,KAAG,IAItE,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,YAAY,WAAW,SAAS,KAAQ,SAInD,CAAC;AAEH;;;GAGG;AACH,eAAO,MAAM,YAAY,SAAU,IAAI,YAAY,OAAO,wBAAoB,MAAM,EAwBnF,CAAC;AAEF,MAAM,MAAM,WAAW,GAAG;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC;AAkB3D,eAAO,MAAM,WAAW,QAAS,MAAM,GAAG,SAAS,KAAG,WACF,CAAC;AAErD;;;;GAIG;AACH,eAAO,MAAM,cAAc,GAAI,CAAC,SAAS,MAAM,SACtC,MAAM,GAAG,SAAS,UACjB,OAAO,aACJ,CAAC,OACP,CAAC,GAAG,SAAS,KACjB;IAAE,SAAS,EAAE,CAAC,CAAC;IAAC,GAAG,EAAE,CAAC,GAAG,SAAS,CAAA;CAcpC,CAAC;AAcF;;;GAGG;AACH,eAAO,MAAM,YAAY,UAChB,SAAS,GAAG,SAAS,YAClB;IAAE,UAAU,EAAE,eAAe,CAAC;IAAC,QAAQ,EAAE,aAAa,CAAA;CAAE,KACjE,MAGC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"style.test.d.ts","sourceRoot":"","sources":["../../../../src/utils/style.test.ts"],"names":[],"mappings":""}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { type SceneTree } from './builder.ts';
|
|
2
2
|
/**
|
|
3
|
-
* A three-level
|
|
3
|
+
* A three-level model diagram over {@link MODEL}: one scene per subsystem, each holding a box per class
|
|
4
4
|
* in a row joined by an association, with a portal per child subsystem below them. Ids are
|
|
5
5
|
* deterministic (`scene:app/editor`, `scene:app/editor/view`) so tests and stories can name elements.
|
|
6
6
|
*/
|
|
7
|
-
export declare const
|
|
7
|
+
export declare const createModelSceneTree: (prefix?: string) => SceneTree;
|
|
8
8
|
/**
|
|
9
9
|
* A tree of scenes `depth` levels deep, written with the scene builder; depth 0 is one empty scene,
|
|
10
10
|
* the blank canvas a new diagram starts from. The root holds a
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"testing.d.ts","sourceRoot":"","sources":["../../../../src/utils/testing.ts"],"names":[],"mappings":"AAIA,OAAO,EAAkE,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"testing.d.ts","sourceRoot":"","sources":["../../../../src/utils/testing.ts"],"names":[],"mappings":"AAIA,OAAO,EAAkE,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAuE9G;;;;GAIG;AACH,eAAO,MAAM,oBAAoB,uBAAqB,SAA8C,CAAC;AAqBrG;;;;;;;;GAQG;AACH,eAAO,MAAM,eAAe,UAAW,MAAM,sBAAoB,SAAgD,CAAC"}
|
|
@@ -1,13 +1,22 @@
|
|
|
1
1
|
import type * as Atom from 'effect/reactivity/Atom';
|
|
2
2
|
import type * as Registry from 'effect/reactivity/AtomRegistry';
|
|
3
3
|
import { type Projection } from '../model/projection.ts';
|
|
4
|
+
import { type SceneMap, type SceneStore } from '../model/store.ts';
|
|
4
5
|
/** Entries older than this are dropped rather than growing without bound. */
|
|
5
6
|
export declare const UNDO_LIMIT = 100;
|
|
7
|
+
/**
|
|
8
|
+
* One undo step: the projection's snapshot from before it, and, for a step that also added or removed scenes (a
|
|
9
|
+
* group into a new scene), the store's scenes from before it, so undo takes the new scene away and redo returns it.
|
|
10
|
+
*/
|
|
11
|
+
export type UndoEntry = {
|
|
12
|
+
model: unknown;
|
|
13
|
+
scenes?: SceneMap;
|
|
14
|
+
};
|
|
6
15
|
export type UndoState = {
|
|
7
16
|
/** Which projection the snapshots belong to; a different one starts an empty log. */
|
|
8
17
|
key: string;
|
|
9
|
-
past:
|
|
10
|
-
future:
|
|
18
|
+
past: UndoEntry[];
|
|
19
|
+
future: UndoEntry[];
|
|
11
20
|
};
|
|
12
21
|
export declare const emptyUndo: (key?: string) => UndoState;
|
|
13
22
|
/**
|
|
@@ -15,6 +24,8 @@ export declare const emptyUndo: (key?: string) => UndoState;
|
|
|
15
24
|
* before and after) records nothing.
|
|
16
25
|
*/
|
|
17
26
|
export declare const withUndo: (projection: Projection, registry: Registry.AtomRegistry, atom: Atom.Writable<UndoState>, key: string) => Projection;
|
|
18
|
-
|
|
19
|
-
export declare const
|
|
27
|
+
/** Marks the step just recorded as one that also changed the store's scenes, which were `scenes` before it. */
|
|
28
|
+
export declare const recordScenes: (registry: Registry.AtomRegistry, atom: Atom.Writable<UndoState>, key: string, scenes: SceneMap) => void;
|
|
29
|
+
export declare const undo: (projection: Projection, registry: Registry.AtomRegistry, atom: Atom.Writable<UndoState>, key: string, store?: SceneStore) => boolean;
|
|
30
|
+
export declare const redo: (projection: Projection, registry: Registry.AtomRegistry, atom: Atom.Writable<UndoState>, key: string, store?: SceneStore) => boolean;
|
|
20
31
|
//# sourceMappingURL=undo.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"undo.d.ts","sourceRoot":"","sources":["../../../../src/utils/undo.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,KAAK,IAAI,MAAM,wBAAwB,CAAC;AACpD,OAAO,KAAK,KAAK,QAAQ,MAAM,gCAAgC,CAAC;AAEhE,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"undo.d.ts","sourceRoot":"","sources":["../../../../src/utils/undo.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,KAAK,IAAI,MAAM,wBAAwB,CAAC;AACpD,OAAO,KAAK,KAAK,QAAQ,MAAM,gCAAgC,CAAC;AAEhE,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,EAAE,KAAK,QAAQ,EAAE,KAAK,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAEnE,6EAA6E;AAC7E,eAAO,MAAM,UAAU,MAAM,CAAC;AAE9B;;;GAGG;AACH,MAAM,MAAM,SAAS,GAAG;IAAE,KAAK,EAAE,OAAO,CAAC;IAAC,MAAM,CAAC,EAAE,QAAQ,CAAA;CAAE,CAAC;AAE9D,MAAM,MAAM,SAAS,GAAG;IACtB,qFAAqF;IACrF,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,SAAS,EAAE,CAAC;IAClB,MAAM,EAAE,SAAS,EAAE,CAAC;CACrB,CAAC;AAEF,eAAO,MAAM,SAAS,oBAAe,SAA4C,CAAC;AAOlF;;;GAGG;AACH,eAAO,MAAM,QAAQ,eACP,UAAU,YACZ,QAAQ,CAAC,YAAY,QACzB,IAAI,CAAC,QAAQ,CAAC,SAAS,CAAC,OACzB,MAAM,KACV,UAWD,CAAC;AAEH,+GAA+G;AAC/G,eAAO,MAAM,YAAY,aACb,QAAQ,CAAC,YAAY,QACzB,IAAI,CAAC,QAAQ,CAAC,SAAS,CAAC,OACzB,MAAM,UACH,QAAQ,KACf,IAMF,CAAC;AAkBF,eAAO,MAAM,IAAI,eACH,UAAU,YACZ,QAAQ,CAAC,YAAY,QACzB,IAAI,CAAC,QAAQ,CAAC,SAAS,CAAC,OACzB,MAAM,UACH,UAAU,KACjB,OASF,CAAC;AAEF,eAAO,MAAM,IAAI,eACH,UAAU,YACZ,QAAQ,CAAC,YAAY,QACzB,IAAI,CAAC,QAAQ,CAAC,SAAS,CAAC,OACzB,MAAM,UACH,UAAU,KACjB,OASF,CAAC"}
|