@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
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React, { type ReactNode } from 'react';
|
|
2
|
+
import type * as Util from '@dxos/react-ui/Util';
|
|
3
|
+
export type AboutStat = {
|
|
4
|
+
id: string;
|
|
5
|
+
label: string;
|
|
6
|
+
value: ReactNode;
|
|
7
|
+
};
|
|
8
|
+
export type AboutProps = Util.ThemedClassName<{
|
|
9
|
+
stats: readonly AboutStat[];
|
|
10
|
+
}>;
|
|
11
|
+
/** A two-column table of the drawing's figures, one per list-height row: a label and its value. */
|
|
12
|
+
export declare const About: ({ classNames, stats }: AboutProps) => React.JSX.Element;
|
|
13
|
+
//# sourceMappingURL=About.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"About.d.ts","sourceRoot":"","sources":["../../../../../src/components/About/About.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,EAAY,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAKxD,OAAO,KAAK,KAAK,IAAI,MAAM,qBAAqB,CAAC;AAEjD,MAAM,MAAM,SAAS,GAAG;IAAE,EAAE,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,SAAS,CAAA;CAAE,CAAC;AAExE,MAAM,MAAM,UAAU,GAAG,IAAI,CAAC,eAAe,CAAC;IAC5C,KAAK,EAAE,SAAS,SAAS,EAAE,CAAC;CAC7B,CAAC,CAAC;AAEH,mGAAmG;AACnG,eAAO,MAAM,KAAK,0BAA2B,UAAU,sBAmBtD,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { type Meta, type StoryObj } from '@storybook/react-vite';
|
|
2
|
+
import { About } from './About.tsx';
|
|
3
|
+
declare const meta: Meta<typeof About>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof meta>;
|
|
6
|
+
export declare const Default: Story;
|
|
7
|
+
//# sourceMappingURL=About.stories.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"About.stories.d.ts","sourceRoot":"","sources":["../../../../../src/components/About/About.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,IAAI,EAAE,KAAK,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAKjE,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAEpC,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,KAAK,CAc5B,CAAC;eAEa,IAAI;AAEnB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AAEnC,eAAO,MAAM,OAAO,EAAE,KAAU,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/About/index.ts"],"names":[],"mappings":"AAIA,cAAc,aAAa,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Breadcrumbs.d.ts","sourceRoot":"","sources":["../../../../../src/components/Breadcrumbs/Breadcrumbs.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAmB,MAAM,OAAO,CAAC;AAIxC,OAAO,EAAE,KAAK,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAEpD,MAAM,MAAM,gBAAgB,GAAG;IAC7B,IAAI,EAAE,OAAO,EAAE,CAAC;IAChB,MAAM,EAAE,CAAC,EAAE,EAAE,OAAO,KAAK,MAAM,CAAC;IAChC,sFAAsF;IACtF,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;CACnC,CAAC;AAGF,eAAO,MAAM,WAAW,+BAAgC,gBAAgB,
|
|
1
|
+
{"version":3,"file":"Breadcrumbs.d.ts","sourceRoot":"","sources":["../../../../../src/components/Breadcrumbs/Breadcrumbs.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAmB,MAAM,OAAO,CAAC;AAIxC,OAAO,EAAE,KAAK,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAEpD,MAAM,MAAM,gBAAgB,GAAG;IAC7B,IAAI,EAAE,OAAO,EAAE,CAAC;IAChB,MAAM,EAAE,CAAC,EAAE,EAAE,OAAO,KAAK,MAAM,CAAC;IAChC,sFAAsF;IACtF,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;CACnC,CAAC;AAGF,eAAO,MAAM,WAAW,+BAAgC,gBAAgB,sBAyBvE,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { type ControlPointRef, type Drag, type Handle } from '../../model/atoms.ts';
|
|
3
3
|
import { type NodeRegistry } from '../../model/registry.ts';
|
|
4
|
-
import { type Bounds, type Capabilities, type ElementId, type Link, type Node, type Point, type Port, type Scene, type SplineLink } from '../../model/types.ts';
|
|
4
|
+
import { type Bounds, type Capabilities, type ElementId, type Link, type LinkId, type Node, type Point, type Port, type Scene, type SplineLink } from '../../model/types.ts';
|
|
5
5
|
import { type LatticeSpec } from '../../utils/lattice.ts';
|
|
6
6
|
export declare const handlePoint: (bounds: Bounds, handle: Handle) => Point;
|
|
7
7
|
export type LinkEnd = 'source' | 'target';
|
|
@@ -12,11 +12,17 @@ export type ControlFrameProps = {
|
|
|
12
12
|
capabilities: Capabilities;
|
|
13
13
|
selection: ReadonlySet<ElementId>;
|
|
14
14
|
hover?: ElementId;
|
|
15
|
+
/** The link under the pointer: it shows its end handles, as a selected link does. */
|
|
16
|
+
hoveredLink?: LinkId;
|
|
17
|
+
/** The pointer entered or left a hovered link's handles, which keeps the link hovered while on them. */
|
|
18
|
+
onLinkHover?: (id: LinkId | undefined) => void;
|
|
15
19
|
selectedPoint?: ControlPointRef;
|
|
16
20
|
zoom: number;
|
|
17
21
|
drag?: Drag;
|
|
18
22
|
/** The bounds a create gesture in flight would land, drawn as a provisional frame. */
|
|
19
23
|
createFrame?: Bounds;
|
|
24
|
+
/** Where the nodes of a move in flight will land, drawn under them as they follow the pointer. */
|
|
25
|
+
landing?: readonly Bounds[];
|
|
20
26
|
/** The gesture in flight would be refused (an overlap on the lattice): its outlines turn red. */
|
|
21
27
|
blocked?: boolean;
|
|
22
28
|
/** The scene's lattice, so a selected smart link's handles sit on its gutter route. */
|
|
@@ -29,5 +35,5 @@ export type ControlFrameProps = {
|
|
|
29
35
|
onMidpointPointerDown?: (link: SplineLink, index: number, point: Point, event: React.PointerEvent) => void;
|
|
30
36
|
onPointContextMenu?: (link: SplineLink, index: number, event: React.MouseEvent) => void;
|
|
31
37
|
};
|
|
32
|
-
export declare const ControlFrame: React.MemoExoticComponent<({ scene, registry, capabilities, selection, hover, selectedPoint, zoom, drag, createFrame, blocked, lattice, onHandlePointerDown, onPortPointerDown, onEndPointerDown, onPointPointerDown, onMidpointPointerDown, onPointContextMenu, }: ControlFrameProps) => React.JSX.Element>;
|
|
38
|
+
export declare const ControlFrame: React.MemoExoticComponent<({ scene, registry, capabilities, selection, hover, hoveredLink, onLinkHover, selectedPoint, zoom, drag, createFrame, landing, blocked, lattice, onHandlePointerDown, onPortPointerDown, onEndPointerDown, onPointPointerDown, onMidpointPointerDown, onPointContextMenu, }: ControlFrameProps) => React.JSX.Element>;
|
|
33
39
|
//# sourceMappingURL=ControlFrame.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ControlFrame.d.ts","sourceRoot":"","sources":["../../../../../src/components/ControlFrame/ControlFrame.tsx"],"names":[],"mappings":"AAUA,OAAO,KAAe,MAAM,OAAO,CAAC;AAIpC,OAAO,EAAE,KAAK,eAAe,EAAE,KAAK,IAAI,EAAE,KAAK,MAAM,
|
|
1
|
+
{"version":3,"file":"ControlFrame.d.ts","sourceRoot":"","sources":["../../../../../src/components/ControlFrame/ControlFrame.tsx"],"names":[],"mappings":"AAUA,OAAO,KAAe,MAAM,OAAO,CAAC;AAIpC,OAAO,EAAE,KAAK,eAAe,EAAE,KAAK,IAAI,EAAE,KAAK,MAAM,EAAY,MAAM,sBAAsB,CAAC;AAE9F,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAC5D,OAAO,EACL,KAAK,MAAM,EACX,KAAK,YAAY,EACjB,KAAK,SAAS,EAEd,KAAK,IAAI,EACT,KAAK,MAAM,EACX,KAAK,IAAI,EACT,KAAK,KAAK,EACV,KAAK,IAAI,EACT,KAAK,KAAK,EACV,KAAK,UAAU,EAGhB,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAO1D,eAAO,MAAM,WAAW,WAAY,MAAM,UAAU,MAAM,KAAG,KAY5D,CAAC;AAKF,MAAM,MAAM,OAAO,GAAG,QAAQ,GAAG,QAAQ,CAAC;AAE1C,MAAM,MAAM,iBAA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EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,CAAC,YAAY,KAAK,IAAI,CAAC;IAC3G,kBAAkB,CAAC,EAAE,CAAC,IAAI,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,CAAC,UAAU,KAAK,IAAI,CAAC;CACzF,CAAC;AAWF,eAAO,MAAM,YAAY,ySAsBpB,iBAAiB,uBA2PrB,CAAC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type * as Util from '@dxos/react-ui/Util';
|
|
3
|
+
import { type Layer, type LayerId } from '../../model/types.ts';
|
|
4
|
+
export type LayersPanelProps = Util.ThemedClassName<{
|
|
5
|
+
/** The scene's layers, bottom first (`sceneLayers`); the panel lists them top first, as they stack. */
|
|
6
|
+
layers: readonly Layer[];
|
|
7
|
+
/** The selected layers; the top-most of them is the one new shapes go on. */
|
|
8
|
+
selected?: readonly LayerId[];
|
|
9
|
+
readonly?: boolean;
|
|
10
|
+
onSelectedChange?: (ids: LayerId[]) => void;
|
|
11
|
+
/** Shows or hides a layer. */
|
|
12
|
+
onToggle?: (id: LayerId) => void;
|
|
13
|
+
onRename?: (id: LayerId, name: string) => void;
|
|
14
|
+
/** Moves a layer to `index` in the bottom-first order. */
|
|
15
|
+
onMove?: (id: LayerId, index: number) => void;
|
|
16
|
+
/** Adds a layer; the panel opens the name of the one whose id it returns. */
|
|
17
|
+
onCreate?: () => LayerId | void;
|
|
18
|
+
/** Removes the selected layers and their shapes; offered while at least one layer would remain. */
|
|
19
|
+
onDelete?: (ids: LayerId[]) => void;
|
|
20
|
+
/** Merges the selected layers into the top-most of them; offered while two or more are selected. */
|
|
21
|
+
onMerge?: (ids: LayerId[], into: LayerId) => void;
|
|
22
|
+
/** Whether the panel is docked beside the canvas. */
|
|
23
|
+
docked?: boolean;
|
|
24
|
+
}>;
|
|
25
|
+
/**
|
|
26
|
+
* A scene's layers, top first as they stack: the active one is selected, each shows or hides from its eye, renames on
|
|
27
|
+
* a double-click and reorders by its handle. The toolbar adds a layer, deletes the active one, and merges it down.
|
|
28
|
+
*/
|
|
29
|
+
export declare const LayersPanel: ({ classNames, layers, selected: selectedProp, readonly, onSelectedChange, onToggle, onRename, onMove, onCreate, onDelete, onMerge, docked, }: LayersPanelProps) => React.JSX.Element;
|
|
30
|
+
//# sourceMappingURL=Layers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Layers.d.ts","sourceRoot":"","sources":["../../../../../src/components/Layers/Layers.tsx"],"names":[],"mappings":"AAIA,OAAO,KAA4B,MAAM,OAAO,CAAC;AAQjD,OAAO,KAAK,KAAK,IAAI,MAAM,qBAAqB,CAAC;AAEjD,OAAO,EAAE,KAAK,KAAK,EAAE,KAAK,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAEhE,MAAM,MAAM,gBAAgB,GAAG,IAAI,CAAC,eAAe,CAAC;IAClD,uGAAuG;IACvG,MAAM,EAAE,SAAS,KAAK,EAAE,CAAC;IACzB,6EAA6E;IAC7E,QAAQ,CAAC,EAAE,SAAS,OAAO,EAAE,CAAC;IAC9B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,gBAAgB,CAAC,EAAE,CAAC,GAAG,EAAE,OAAO,EAAE,KAAK,IAAI,CAAC;IAC5C,8BAA8B;IAC9B,QAAQ,CAAC,EAAE,CAAC,EAAE,EAAE,OAAO,KAAK,IAAI,CAAC;IACjC,QAAQ,CAAC,EAAE,CAAC,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IAC/C,0DAA0D;IAC1D,MAAM,CAAC,EAAE,CAAC,EAAE,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAC9C,6EAA6E;IAC7E,QAAQ,CAAC,EAAE,MAAM,OAAO,GAAG,IAAI,CAAC;IAChC,mGAAmG;IACnG,QAAQ,CAAC,EAAE,CAAC,GAAG,EAAE,OAAO,EAAE,KAAK,IAAI,CAAC;IACpC,oGAAoG;IACpG,OAAO,CAAC,EAAE,CAAC,GAAG,EAAE,OAAO,EAAE,EAAE,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;IAClD,qDAAqD;IACrD,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB,CAAC,CAAC;AAyCH;;;GAGG;AACH,eAAO,MAAM,WAAW,iJAarB,gBAAgB,sBAyHlB,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { type Meta, type StoryObj } from '@storybook/react-vite';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
/** The panel over local state, as a host keeps the scene's layers. */
|
|
4
|
+
declare const DefaultStory: () => React.JSX.Element;
|
|
5
|
+
declare const meta: Meta<typeof DefaultStory>;
|
|
6
|
+
export default meta;
|
|
7
|
+
type Story = StoryObj<typeof meta>;
|
|
8
|
+
export declare const Default: Story;
|
|
9
|
+
/** Every toolbar action and an inline rename, against the panel's local state. */
|
|
10
|
+
export declare const Test: Story;
|
|
11
|
+
//# sourceMappingURL=Layers.stories.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Layers.stories.d.ts","sourceRoot":"","sources":["../../../../../src/components/Layers/Layers.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,IAAI,EAAE,KAAK,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACjE,OAAO,KAAmB,MAAM,OAAO,CAAC;AAmBxC,sEAAsE;AACtE,QAAA,MAAM,YAAY,yBAyCjB,CAAC;AAEF,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,YAAY,CAKnC,CAAC;eAEa,IAAI;AAEnB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AAEnC,eAAO,MAAM,OAAO,EAAE,KAAU,CAAC;AAEjC,kFAAkF;AAClF,eAAO,MAAM,IAAI,EAAE,KAgDlB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/Layers/index.ts"],"names":[],"mappings":"AAIA,cAAc,cAAc,CAAC"}
|
|
@@ -7,10 +7,18 @@ type Entry = {
|
|
|
7
7
|
label: string;
|
|
8
8
|
key?: string;
|
|
9
9
|
};
|
|
10
|
+
/** A run of palette entries; a group of node types may fold into one flyout button when the rail runs out of room. */
|
|
11
|
+
export type PaletteGroup = {
|
|
12
|
+
name: string;
|
|
13
|
+
entries: Entry[];
|
|
14
|
+
collapsible: boolean;
|
|
15
|
+
};
|
|
10
16
|
/**
|
|
11
|
-
* Palette
|
|
12
|
-
*
|
|
17
|
+
* Palette groups: the fixed tools, then the node types by group, then a link per link type; a group the projection
|
|
18
|
+
* cannot apply (`create`, `link`) is left out rather than offered and silently dropped. Only node groups fold.
|
|
13
19
|
*/
|
|
20
|
+
export declare const paletteGroups: (nodes: NodeRegistry, links: LinkRegistry, capabilities: Capabilities) => PaletteGroup[];
|
|
21
|
+
/** Palette entries by group, flat within each. */
|
|
14
22
|
export declare const paletteEntries: (nodes: NodeRegistry, links: LinkRegistry, capabilities: Capabilities) => Entry[][];
|
|
15
23
|
export declare const sameTool: (left: Tool, right: Tool) => boolean;
|
|
16
24
|
export declare const toolForKey: (nodes: NodeRegistry, links: LinkRegistry, capabilities: Capabilities, key: string) => Tool | undefined;
|
|
@@ -19,12 +27,20 @@ export type PaletteProps = {
|
|
|
19
27
|
nodes: NodeRegistry;
|
|
20
28
|
links: LinkRegistry;
|
|
21
29
|
capabilities: Capabilities;
|
|
30
|
+
/**
|
|
31
|
+
* Folds each group of node types into one flyout button: `auto` (the default) does so only when the flat rail would
|
|
32
|
+
* not fit the space below it, so a small registry keeps every tool one click away.
|
|
33
|
+
*/
|
|
34
|
+
collapse?: 'auto' | boolean;
|
|
35
|
+
/** How a folded group lists its tools: one per row with its name (the default), or a grid of icons. */
|
|
36
|
+
flyout?: 'list' | 'grid';
|
|
22
37
|
onToolChange: (tool: Tool) => void;
|
|
23
38
|
};
|
|
24
39
|
/**
|
|
25
40
|
* Tool palette: a click picks the tool; a node type can also be dragged onto the canvas, which creates
|
|
26
|
-
* it where it drops (the canvas is a pragmatic-dnd drop target for `nodeDragData`).
|
|
41
|
+
* it where it drops (the canvas is a pragmatic-dnd drop target for `nodeDragData`). With many types the node
|
|
42
|
+
* groups fold into flyouts (`collapse`), each showing its active or last-used tool.
|
|
27
43
|
*/
|
|
28
|
-
export declare const Palette: ({ tool, nodes, links, capabilities, onToolChange }: PaletteProps) => React.JSX.Element;
|
|
44
|
+
export declare const Palette: ({ tool, nodes, links, capabilities, collapse, flyout, onToolChange, }: PaletteProps) => React.JSX.Element;
|
|
29
45
|
export {};
|
|
30
46
|
//# sourceMappingURL=Palette.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Palette.d.ts","sourceRoot":"","sources":["../../../../../src/components/Palette/Palette.tsx"],"names":[],"mappings":"AAMA,OAAO,
|
|
1
|
+
{"version":3,"file":"Palette.d.ts","sourceRoot":"","sources":["../../../../../src/components/Palette/Palette.tsx"],"names":[],"mappings":"AAMA,OAAO,KAA6F,MAAM,OAAO,CAAC;AAOlH,OAAO,EAAE,KAAK,YAAY,EAAE,KAAK,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAC/E,OAAO,EAAE,KAAK,YAAY,EAAE,KAAK,IAAI,EAAE,MAAM,sBAAsB,CAAC;AAGpE,KAAK,KAAK,GAAG;IAAE,IAAI,EAAE,IAAI,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,GAAG,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AAOvE,sHAAsH;AACtH,MAAM,MAAM,YAAY,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,KAAK,EAAE,CAAC;IAAC,WAAW,EAAE,OAAO,CAAA;CAAE,CAAC;AAepF;;;GAGG;AACH,eAAO,MAAM,aAAa,UAAW,YAAY,SAAS,YAAY,gBAAgB,YAAY,KAAG,YAAY,EAgBlE,CAAC;AAEhD,kDAAkD;AAClD,eAAO,MAAM,cAAc,UAAW,YAAY,SAAS,YAAY,gBAAgB,YAAY,KAAG,KAAK,EAAE,EACpC,CAAC;AAE1E,eAAO,MAAM,QAAQ,SAAU,IAAI,SAAS,IAAI,KAAG,OAC6D,CAAC;AAEjH,eAAO,MAAM,UAAU,UACd,YAAY,SACZ,YAAY,gBACL,YAAY,OACrB,MAAM,KACV,IAAI,GAAG,SAG4E,CAAC;AAEvF,MAAM,MAAM,YAAY,GAAG;IACzB,IAAI,EAAE,IAAI,CAAC;IACX,KAAK,EAAE,YAAY,CAAC;IACpB,KAAK,EAAE,YAAY,CAAC;IACpB,YAAY,EAAE,YAAY,CAAC;IAC3B;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;IAC5B,uGAAuG;IACvG,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACzB,YAAY,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,IAAI,CAAC;CACpC,CAAC;AAmCF;;;;GAIG;AACH,eAAO,MAAM,OAAO,0EAQjB,YAAY,sBAgCd,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { type Meta, type StoryObj } from '@storybook/react-vite';
|
|
2
|
+
import { type PaletteProps } from './Palette.tsx';
|
|
3
|
+
type StoryArgs = Pick<PaletteProps, 'collapse' | 'flyout'> & {
|
|
4
|
+
/** Many types in groups, or the built-in few. */
|
|
5
|
+
many: boolean;
|
|
6
|
+
/** The height of the view the rail floats in. */
|
|
7
|
+
height: number;
|
|
8
|
+
};
|
|
9
|
+
declare const meta: Meta<StoryArgs>;
|
|
10
|
+
export default meta;
|
|
11
|
+
type Story = StoryObj<StoryArgs>;
|
|
12
|
+
/** The built-in types: few enough that the rail stays flat. */
|
|
13
|
+
export declare const Default: Story;
|
|
14
|
+
/** Many types in a short view: the node groups fold into flyouts. */
|
|
15
|
+
export declare const Many: Story;
|
|
16
|
+
/** Many types folded, each group's tools as a grid of icons rather than a list. */
|
|
17
|
+
export declare const ManyGrid: Story;
|
|
18
|
+
/** Many types with room to spare: still flat, every tool one click away. */
|
|
19
|
+
export declare const ManyTall: Story;
|
|
20
|
+
/** A folded group picks its face, opens its grid, and shows the tool picked from it. */
|
|
21
|
+
export declare const Test: Story;
|
|
22
|
+
//# sourceMappingURL=Palette.stories.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Palette.stories.d.ts","sourceRoot":"","sources":["../../../../../src/components/Palette/Palette.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,IAAI,EAAE,KAAK,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AASjE,OAAO,EAAW,KAAK,YAAY,EAAE,MAAM,eAAe,CAAC;AAiC3D,KAAK,SAAS,GAAG,IAAI,CAAC,YAAY,EAAE,UAAU,GAAG,QAAQ,CAAC,GAAG;IAC3D,iDAAiD;IACjD,IAAI,EAAE,OAAO,CAAC;IACd,iDAAiD;IACjD,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAyBF,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,SAAS,CASzB,CAAC;eAEa,IAAI;AAEnB,KAAK,KAAK,GAAG,QAAQ,CAAC,SAAS,CAAC,CAAC;AAEjC,+DAA+D;AAC/D,eAAO,MAAM,OAAO,EAAE,KAAU,CAAC;AAEjC,qEAAqE;AACrE,eAAO,MAAM,IAAI,EAAE,KAAgC,CAAC;AAEpD,mFAAmF;AACnF,eAAO,MAAM,QAAQ,EAAE,KAAgD,CAAC;AAExE,4EAA4E;AAC5E,eAAO,MAAM,QAAQ,EAAE,KAA8C,CAAC;AAEtE,wFAAwF;AACxF,eAAO,MAAM,IAAI,EAAE,KA8BlB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PartEditor.d.ts","sourceRoot":"","sources":["../../../../../src/components/PartEditor/PartEditor.tsx"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,EAAE,KAAK,iBAAiB,EAAU,MAAM,OAAO,CAAC;AAI9D,OAAO,KAAK,KAAK,IAAI,MAAM,qBAAqB,CAAC;AAIjD,OAAO,EAAE,KAAK,WAAW,EAAE,KAAK,OAAO,
|
|
1
|
+
{"version":3,"file":"PartEditor.d.ts","sourceRoot":"","sources":["../../../../../src/components/PartEditor/PartEditor.tsx"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,EAAE,KAAK,iBAAiB,EAAU,MAAM,OAAO,CAAC;AAI9D,OAAO,KAAK,KAAK,IAAI,MAAM,qBAAqB,CAAC;AAIjD,OAAO,EAAE,KAAK,WAAW,EAAE,KAAK,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAEtE,MAAM,MAAM,aAAa,GAAG,IAAI,CAAC,eAAe,CAC9C,iBAAiB,CAAC;IAChB,IAAI,EAAE,OAAO,CAAC;IACd,6DAA6D;IAC7D,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,WAAW,CAAC;CACvB,CAAC,CACH,CAAC;AAEF,2FAA2F;AAC3F,eAAO,MAAM,QAAQ,kDAAmD,aAAa,sBAQlF,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { type FormFieldRenderer } from '@dxos/react-ui-form';
|
|
3
|
+
export type IconToggleOption<T extends string> = {
|
|
4
|
+
value: T;
|
|
5
|
+
icon: string;
|
|
6
|
+
label: string;
|
|
7
|
+
};
|
|
8
|
+
export type IconToggleProps<T extends string> = {
|
|
9
|
+
label: string;
|
|
10
|
+
options: readonly IconToggleOption<T>[];
|
|
11
|
+
value?: T;
|
|
12
|
+
readonly?: boolean;
|
|
13
|
+
onValueChange: (value: T) => void;
|
|
14
|
+
};
|
|
15
|
+
/** One choice of a few, each an icon: a single-select toggle group whose pressed item is the value. */
|
|
16
|
+
export declare const IconToggle: <T extends string>({ label, options, value, readonly, onValueChange, }: IconToggleProps<T>) => React.JSX.Element;
|
|
17
|
+
/**
|
|
18
|
+
* The text alignment, rendered at `style.alignHorizontal`: the horizontal and vertical toggles side by side in one
|
|
19
|
+
* row (`style.alignVertical` is hidden). Each writes only its own path, so an edit across a selection leaves each
|
|
20
|
+
* element's other style values.
|
|
21
|
+
*/
|
|
22
|
+
export declare const AlignField: FormFieldRenderer;
|
|
23
|
+
//# sourceMappingURL=AlignField.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AlignField.d.ts","sourceRoot":"","sources":["../../../../../src/components/Properties/AlignField.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAQ,KAAK,iBAAiB,EAAqB,MAAM,qBAAqB,CAAC;AAMtF,MAAM,MAAM,gBAAgB,CAAC,CAAC,SAAS,MAAM,IAAI;IAAE,KAAK,EAAE,CAAC,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAAC;AAE3F,MAAM,MAAM,eAAe,CAAC,CAAC,SAAS,MAAM,IAAI;IAC9C,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,SAAS,gBAAgB,CAAC,CAAC,CAAC,EAAE,CAAC;IACxC,KAAK,CAAC,EAAE,CAAC,CAAC;IACV,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,aAAa,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,IAAI,CAAC;CACnC,CAAC;AAEF,uGAAuG;AACvG,eAAO,MAAM,UAAU,GAAI,CAAC,SAAS,MAAM,uDAMxC,eAAe,CAAC,CAAC,CAAC,sBA0BpB,CAAC;AAcF;;;;GAIG;AACH,eAAO,MAAM,UAAU,EAAE,iBAyCxB,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { type FormFieldRenderer } from '@dxos/react-ui-form';
|
|
3
|
+
/** The drawing's style classes, for the class field; unset when the host offers none, so the field is hidden. */
|
|
4
|
+
export declare const StyleClassesContext: React.Context<Readonly<Record<string, {
|
|
5
|
+
readonly id: string;
|
|
6
|
+
readonly name: string;
|
|
7
|
+
readonly style?: {
|
|
8
|
+
readonly hue?: string | undefined;
|
|
9
|
+
readonly lineStyle?: "dashed" | "dotted" | "solid" | undefined;
|
|
10
|
+
readonly tone?: 0 | 1 | 2 | 3 | undefined;
|
|
11
|
+
readonly rounded?: boolean | undefined;
|
|
12
|
+
readonly fill?: boolean | undefined;
|
|
13
|
+
readonly border?: boolean | undefined;
|
|
14
|
+
readonly guide?: boolean | undefined;
|
|
15
|
+
readonly fontFamily?: "default" | "monospace" | undefined;
|
|
16
|
+
readonly fontSize?: number | undefined;
|
|
17
|
+
readonly alignHorizontal?: "center" | "left" | "right" | undefined;
|
|
18
|
+
readonly alignVertical?: "bottom" | "middle" | "top" | undefined;
|
|
19
|
+
} | undefined;
|
|
20
|
+
}>> | undefined>;
|
|
21
|
+
/** An element's style class: one of the drawing's, or none, leaving only its own style. */
|
|
22
|
+
export declare const ClassField: FormFieldRenderer;
|
|
23
|
+
//# sourceMappingURL=ClassField.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ClassField.d.ts","sourceRoot":"","sources":["../../../../../src/components/Properties/ClassField.tsx"],"names":[],"mappings":"AAIA,OAAO,KAA6C,MAAM,OAAO,CAAC;AAElE,OAAO,EAAQ,KAAK,iBAAiB,EAAiB,MAAM,qBAAqB,CAAC;AAIlF,iHAAiH;AACjH,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;gBAAiD,CAAC;AAKlF,2FAA2F;AAC3F,eAAO,MAAM,UAAU,EAAE,iBA0BxB,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { type FormFieldRenderer } from '@dxos/react-ui-form';
|
|
2
|
+
/**
|
|
3
|
+
* The text face and size, rendered at `style.fontFamily`: the two side by side in one row (`style.fontSize` is
|
|
4
|
+
* hidden). Each writes only its own path, so an edit across a selection leaves each element's other style values.
|
|
5
|
+
*/
|
|
6
|
+
export declare const FontField: FormFieldRenderer;
|
|
7
|
+
//# sourceMappingURL=FontField.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FontField.d.ts","sourceRoot":"","sources":["../../../../../src/components/Properties/FontField.tsx"],"names":[],"mappings":"AAMA,OAAO,EAAQ,KAAK,iBAAiB,EAAoC,MAAM,qBAAqB,CAAC;AAarG;;;GAGG;AACH,eAAO,MAAM,SAAS,EAAE,iBAiDvB,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { type FormFieldRenderer } from '@dxos/react-ui-form';
|
|
3
|
+
/** The scene's layers, bottom first, for the layer field. */
|
|
4
|
+
export declare const LayersContext: React.Context<readonly {
|
|
5
|
+
readonly id: string;
|
|
6
|
+
readonly name: string;
|
|
7
|
+
readonly z: string;
|
|
8
|
+
readonly hidden?: boolean | undefined;
|
|
9
|
+
}[]>;
|
|
10
|
+
/** The layer an element is on: one of the scene's, listed top first as they stack. */
|
|
11
|
+
export declare const LayerField: FormFieldRenderer;
|
|
12
|
+
/**
|
|
13
|
+
* The layer and the style class side by side in one row, rendered at `layer` (`class` is hidden); the class select
|
|
14
|
+
* only while the host offers classes.
|
|
15
|
+
*/
|
|
16
|
+
export declare const LayerClassField: FormFieldRenderer;
|
|
17
|
+
//# sourceMappingURL=LayerField.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LayerField.d.ts","sourceRoot":"","sources":["../../../../../src/components/Properties/LayerField.tsx"],"names":[],"mappings":"AAKA,OAAO,KAA6C,MAAM,OAAO,CAAC;AAElE,OAAO,EAAQ,KAAK,iBAAiB,EAAoC,MAAM,qBAAqB,CAAC;AAMrG,6DAA6D;AAC7D,eAAO,MAAM,aAAa;;;;;IAAsC,CAAC;AAEjE,sFAAsF;AACtF,eAAO,MAAM,UAAU,EAAE,iBAkBxB,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,eAAe,EAAE,iBAmB7B,CAAC"}
|
|
@@ -1,10 +1,20 @@
|
|
|
1
|
+
import type * as Atom from 'effect/reactivity/Atom';
|
|
1
2
|
import React from 'react';
|
|
2
|
-
import { type
|
|
3
|
+
import { type Database } from '@dxos/echo';
|
|
4
|
+
import { type FormFieldMap, type FormFieldOverride, type FormFieldRenderer, type RefFieldDataProps } from '@dxos/react-ui-form';
|
|
3
5
|
import type * as Util from '@dxos/react-ui/Util';
|
|
4
6
|
import { type SceneViewAtoms } from '../../model/atoms.ts';
|
|
5
7
|
import { type Projection } from '../../model/projection.ts';
|
|
6
8
|
import { type NodeRegistry } from '../../model/registry.ts';
|
|
7
|
-
|
|
9
|
+
import { type Element, type StyleMap } from '../../model/types.ts';
|
|
10
|
+
import { type SceneOption } from '../../utils/scenes.ts';
|
|
11
|
+
/**
|
|
12
|
+
* A string list as one entry per line: a UML compartment reads as a block of text, so a textarea
|
|
13
|
+
* beats the generic array field's row of inputs. Blank lines survive while typing (they round-trip
|
|
14
|
+
* through split/join) and are dropped on blur, when the form saves.
|
|
15
|
+
*/
|
|
16
|
+
export declare const LinesField: FormFieldRenderer;
|
|
17
|
+
/** Renderers by field path the panel always uses (the style grid); node types add their own (`NodeDef.fields`). */
|
|
8
18
|
export declare const DEFAULT_FIELDS: FormFieldMap;
|
|
9
19
|
export type PropertiesProps = Util.ThemedClassName<{
|
|
10
20
|
projection: Projection;
|
|
@@ -13,6 +23,20 @@ export type PropertiesProps = Util.ThemedClassName<{
|
|
|
13
23
|
fields?: FormFieldMap;
|
|
14
24
|
/** Show the fields without letting them change; also implied by a projection that cannot `update`. */
|
|
15
25
|
readonly?: boolean;
|
|
26
|
+
/** The database a reference field picks from; without it reference fields are read-only. */
|
|
27
|
+
db?: Database.Database;
|
|
28
|
+
/** Narrows a reference field's candidates (e.g. to objects of one kind). */
|
|
29
|
+
getOptions?: RefFieldDataProps['getOptions'];
|
|
30
|
+
/** A host's per-selection field overrides (e.g. a field it allows only in some states), over the panel's own. */
|
|
31
|
+
overrides?: (elements: readonly Element[]) => Record<string, FormFieldOverride>;
|
|
32
|
+
/** The scenes a scene shape may open (`sceneOptions`); without them its scene is not editable here. */
|
|
33
|
+
sceneOptions?: readonly SceneOption[];
|
|
34
|
+
/** The drawing's style classes (`SceneStore.styles`); without them elements take no class. */
|
|
35
|
+
styles?: Atom.Writable<StyleMap>;
|
|
36
|
+
/** Moves the selection into a new scene (`groupIntoScene`); offered for a selection of several elements. */
|
|
37
|
+
onGroup?: () => void;
|
|
38
|
+
/** Whether the panel is docked beside the canvas. */
|
|
39
|
+
docked?: boolean;
|
|
16
40
|
}>;
|
|
17
|
-
export declare const Properties: ({ classNames, projection, atoms, nodes, fields, readonly: readonlyProp, }: PropertiesProps) => React.JSX.Element;
|
|
41
|
+
export declare const Properties: ({ classNames, projection, atoms, nodes, fields, readonly: readonlyProp, db, getOptions, overrides, sceneOptions, styles, onGroup, docked, }: PropertiesProps) => React.JSX.Element;
|
|
18
42
|
//# sourceMappingURL=Properties.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Properties.d.ts","sourceRoot":"","sources":["../../../../../src/components/Properties/Properties.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Properties.d.ts","sourceRoot":"","sources":["../../../../../src/components/Properties/Properties.tsx"],"names":[],"mappings":"AAYA,OAAO,KAAK,KAAK,IAAI,MAAM,wBAAwB,CAAC;AAEpD,OAAO,KAA+B,MAAM,OAAO,CAAC;AAEpD,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,YAAY,CAAC;AAC3C,OAAO,EAEL,KAAK,YAAY,EACjB,KAAK,iBAAiB,EACtB,KAAK,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,IAAI,CAAC;IACrB,qDAAqD;IACrD,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB,CAAC,CAAC;AAEH,eAAO,MAAM,UAAU,gJAcpB,eAAe,sBA8LjB,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { type Meta, type StoryObj } from '@storybook/react-vite';
|
|
2
|
+
import { type ElementId } from '../../model/types.ts';
|
|
3
|
+
type StoryArgs = {
|
|
4
|
+
/** The elements the panel edits. */
|
|
5
|
+
select: ElementId[];
|
|
6
|
+
};
|
|
7
|
+
declare const meta: Meta<StoryArgs>;
|
|
8
|
+
export default meta;
|
|
9
|
+
type Story = StoryObj<StoryArgs>;
|
|
10
|
+
/** A shape: its layer, class and the whole style (the full colour grid, line style and text alignment). */
|
|
11
|
+
export declare const Default: Story;
|
|
12
|
+
/** A link: the common style base alone (the outline row and line style), its layer and class. */
|
|
13
|
+
export declare const Link: Story;
|
|
14
|
+
/** A shape and a link: only what both declare, the style narrowed to its common base. */
|
|
15
|
+
export declare const Mixed: Story;
|
|
16
|
+
/** A note on its own layer. */
|
|
17
|
+
export declare const Note: Story;
|
|
18
|
+
/** The layer selector lists the scene's layers top first and shows the element's own. */
|
|
19
|
+
export declare const Test: Story;
|
|
20
|
+
//# sourceMappingURL=Properties.stories.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Properties.stories.d.ts","sourceRoot":"","sources":["../../../../../src/components/Properties/Properties.stories.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAE,KAAK,IAAI,EAAE,KAAK,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAajE,OAAO,EAAE,KAAK,SAAS,EAAsC,MAAM,sBAAsB,CAAC;AA6B1F,KAAK,SAAS,GAAG;IACf,oCAAoC;IACpC,MAAM,EAAE,SAAS,EAAE,CAAC;CACrB,CAAC;AAyBF,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,SAAS,CAMzB,CAAC;eAEa,IAAI;AAEnB,KAAK,KAAK,GAAG,QAAQ,CAAC,SAAS,CAAC,CAAC;AAEjC,2GAA2G;AAC3G,eAAO,MAAM,OAAO,EAAE,KAAU,CAAC;AAEjC,iGAAiG;AACjG,eAAO,MAAM,IAAI,EAAE,KAAoC,CAAC;AAExD,yFAAyF;AACzF,eAAO,MAAM,KAAK,EAAE,KAAyC,CAAC;AAE9D,+BAA+B;AAC/B,eAAO,MAAM,IAAI,EAAE,KAAmC,CAAC;AAEvD,yFAAyF;AACzF,eAAO,MAAM,IAAI,EAAE,KAYlB,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { type FormFieldRenderer } from '@dxos/react-ui-form';
|
|
3
|
+
import { type SceneOption } from '../../utils/scenes.ts';
|
|
4
|
+
/** The scenes a selected scene shape may open, as the panel's host lists them (`sceneOptions`). */
|
|
5
|
+
export declare const SceneOptionsContext: React.Context<readonly SceneOption[]>;
|
|
6
|
+
/** A scene shape's `scene`: which scene of this drawing it opens, so several shapes may open one scene. */
|
|
7
|
+
export declare const SceneField: FormFieldRenderer;
|
|
8
|
+
//# sourceMappingURL=SceneField.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SceneField.d.ts","sourceRoot":"","sources":["../../../../../src/components/Properties/SceneField.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAoC,MAAM,OAAO,CAAC;AAEzD,OAAO,EAAQ,KAAK,iBAAiB,EAAe,MAAM,qBAAqB,CAAC;AAEhF,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAEzD,mGAAmG;AACnG,eAAO,MAAM,mBAAmB,uCAA4C,CAAC;AAE7E,2GAA2G;AAC3G,eAAO,MAAM,UAAU,EAAE,iBAOxB,CAAC"}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { type FormFieldRenderer } from '@dxos/react-ui-form';
|
|
3
|
-
import { type NodeTone } from '../../model/types.ts';
|
|
4
|
-
import { type StyleHue } from '../../utils/style.ts';
|
|
3
|
+
import { type NodeTone, type StyleHue } from '../../model/types.ts';
|
|
5
4
|
export type StyleChoice = {
|
|
6
5
|
hue: StyleHue;
|
|
7
6
|
tone: NodeTone;
|
|
@@ -13,16 +12,27 @@ export type StyleGridProps = {
|
|
|
13
12
|
/** Several nodes disagree: no swatch is selected until one is picked. */
|
|
14
13
|
indeterminate?: boolean;
|
|
15
14
|
readonly?: boolean;
|
|
15
|
+
/** The rows offered; all tones by default, or one row (e.g. a line's outline colour only). */
|
|
16
|
+
tones?: readonly NodeTone[];
|
|
16
17
|
onValueChange: (choice: StyleChoice) => void;
|
|
17
18
|
};
|
|
18
19
|
/**
|
|
19
20
|
* Each offered hue in a column and its tones down the rows, every swatch drawn with the classes the node
|
|
20
21
|
* itself would take, so a pick is a preview. A hue the grid does not offer, or none, selects nothing.
|
|
21
22
|
*/
|
|
22
|
-
export declare const StyleGrid: ({ hue, tone, indeterminate, readonly, onValueChange }: StyleGridProps) => React.JSX.Element;
|
|
23
|
+
export declare const StyleGrid: ({ hue, tone, indeterminate, readonly, tones, onValueChange, }: StyleGridProps) => React.JSX.Element;
|
|
24
|
+
export type StyleFieldOptions = {
|
|
25
|
+
/** Offer the fill rows (tones 1–3) as well as the outline; a link, or a selection with one, has no fill. */
|
|
26
|
+
fills: boolean;
|
|
27
|
+
};
|
|
23
28
|
/**
|
|
24
|
-
* The properties panel's style
|
|
25
|
-
*
|
|
29
|
+
* The properties panel's style picker, rendered at `style.hue`, for every kind of element: with `fills`, one pick
|
|
30
|
+
* sets the hue and its tone together (a node); without, the outline row sets the hue alone (a link, or a
|
|
31
|
+
* selection mixing kinds, which edits only the style they share).
|
|
26
32
|
*/
|
|
33
|
+
export declare const createStyleField: ({ fills }: StyleFieldOptions) => FormFieldRenderer;
|
|
34
|
+
/** The style picker with its fill rows: a node's, or a selection of nodes. */
|
|
27
35
|
export declare const StyleGridField: FormFieldRenderer;
|
|
36
|
+
/** The style picker's outline row alone: a link's, or a selection with a link in it. */
|
|
37
|
+
export declare const OutlineStyleField: FormFieldRenderer;
|
|
28
38
|
//# sourceMappingURL=StyleGrid.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StyleGrid.d.ts","sourceRoot":"","sources":["../../../../../src/components/Properties/StyleGrid.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAQ,KAAK,iBAAiB,EAAqB,MAAM,qBAAqB,CAAC;AAItF,OAAO,EAAa,KAAK,QAAQ,
|
|
1
|
+
{"version":3,"file":"StyleGrid.d.ts","sourceRoot":"","sources":["../../../../../src/components/Properties/StyleGrid.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAQ,KAAK,iBAAiB,EAAqB,MAAM,qBAAqB,CAAC;AAItF,OAAO,EAAa,KAAK,QAAQ,EAAc,KAAK,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAG3F,MAAM,MAAM,WAAW,GAAG;IAAE,GAAG,EAAE,QAAQ,CAAC;IAAC,IAAI,EAAE,QAAQ,CAAA;CAAE,CAAC;AAkB5D,MAAM,MAAM,cAAc,GAAG;IAC3B,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,wDAAwD;IACxD,IAAI,CAAC,EAAE,QAAQ,CAAC;IAChB,yEAAyE;IACzE,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,8FAA8F;IAC9F,KAAK,CAAC,EAAE,SAAS,QAAQ,EAAE,CAAC;IAC5B,aAAa,EAAE,CAAC,MAAM,EAAE,WAAW,KAAK,IAAI,CAAC;CAC9C,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,SAAS,kEAOnB,cAAc,sBA8ChB,CAAC;AAKF,MAAM,MAAM,iBAAiB,GAAG;IAC9B,4GAA4G;IAC5G,KAAK,EAAE,OAAO,CAAC;CAChB,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,gBAAgB,cAAe,iBAAiB,KAAG,iBAwB/D,CAAC;AAEF,8EAA8E;AAC9E,eAAO,MAAM,cAAc,mBAAoC,CAAC;AAEhE,wFAAwF;AACxF,eAAO,MAAM,iBAAiB,mBAAqC,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { type Meta, type StoryObj } from '@storybook/react-vite';
|
|
2
|
+
import { type StyleGridProps } from './StyleGrid.tsx';
|
|
3
|
+
type StoryArgs = Pick<StyleGridProps, 'indeterminate' | 'readonly'>;
|
|
4
|
+
declare const meta: Meta<StoryArgs>;
|
|
5
|
+
export default meta;
|
|
6
|
+
export declare const Default: StoryObj<StoryArgs>;
|
|
7
|
+
//# sourceMappingURL=StyleGrid.stories.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"StyleGrid.stories.d.ts","sourceRoot":"","sources":["../../../../../src/components/Properties/StyleGrid.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,IAAI,EAAE,KAAK,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAQjE,OAAO,EAAa,KAAK,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAEjE,KAAK,SAAS,GAAG,IAAI,CAAC,cAAc,EAAE,eAAe,GAAG,UAAU,CAAC,CAAC;AAuBpE,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,SAAS,CAQzB,CAAC;eAEa,IAAI;AAEnB,eAAO,MAAM,OAAO,EAAE,QAAQ,CAAC,SAAS,CAAM,CAAC"}
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { type NodeRegistry, type NodeViewProps } from '../../model/registry.ts';
|
|
3
3
|
import { type SceneStore } from '../../model/store.ts';
|
|
4
|
-
import { type ElementId, type Link, type Node, type NodeId, type Scene } from '../../model/types.ts';
|
|
4
|
+
import { type ElementId, type Link, type LinkId, type Node, type NodeId, type Scene } from '../../model/types.ts';
|
|
5
5
|
import { type LatticeSpec } from '../../utils/lattice.ts';
|
|
6
6
|
import { type PartKey } from '../../utils/parts.ts';
|
|
7
|
-
/** Screen px below which a portal
|
|
7
|
+
/** Screen px below which a portal shows only its title; above it a portal showing its contents mounts the child live. */
|
|
8
8
|
export declare const DOT_PX = 40;
|
|
9
|
-
export declare const PREVIEW_PX = 260;
|
|
10
9
|
/** Default for `liveDepth`: root plus this many live nested levels (decision 10). */
|
|
11
10
|
export declare const MAX_LIVE_DEPTH = 1;
|
|
12
11
|
export type Tier = 'dot' | 'preview' | 'live';
|
|
@@ -19,6 +18,8 @@ export type ElementHandlers = {
|
|
|
19
18
|
/** The in-place editor of `part` finished with `text` (commit) or was dismissed (cancel). */
|
|
20
19
|
onPartCommit?: (node: Node, part: PartKey, text: string) => void;
|
|
21
20
|
onPartCancel?: () => void;
|
|
21
|
+
/** The pointer entered a link (its id) or left it (`undefined`). */
|
|
22
|
+
onLinkHover?: (id: LinkId | undefined) => void;
|
|
22
23
|
/** A node's own open control was pressed (a portal's zoom-in icon). */
|
|
23
24
|
onNodeOpen?: (node: Node) => void;
|
|
24
25
|
};
|
|
@@ -31,14 +32,25 @@ export type SceneLayerProps = {
|
|
|
31
32
|
depth: number;
|
|
32
33
|
liveDepth: number;
|
|
33
34
|
selected?: ReadonlySet<ElementId>;
|
|
35
|
+
/** The selection is drawn as it looks, without its outline (a move in flight shows the shapes themselves). */
|
|
36
|
+
plain?: boolean;
|
|
34
37
|
hover?: NodeId;
|
|
38
|
+
/** The link under the pointer, outlined as a hovered shape is. */
|
|
39
|
+
hoveredLink?: LinkId;
|
|
35
40
|
/** The portal a drill-in is animating into, while it is. */
|
|
36
41
|
opening?: ElementId;
|
|
42
|
+
/** The portal filling most of the view, and the opacity of everything else on the layer as it does. */
|
|
43
|
+
focus?: {
|
|
44
|
+
id: ElementId;
|
|
45
|
+
opacity: number;
|
|
46
|
+
};
|
|
37
47
|
/** The text part being edited in place, if any. */
|
|
38
48
|
editing?: {
|
|
39
49
|
id: NodeId;
|
|
40
50
|
part: PartKey;
|
|
41
51
|
};
|
|
52
|
+
/** The node whose embedded content takes input. */
|
|
53
|
+
active?: NodeId;
|
|
42
54
|
/** A node drawn as a preview of what a gesture will create: translucent, dashed, and not pressable. */
|
|
43
55
|
ghost?: NodeId;
|
|
44
56
|
/** Frames show their id, type and geometry. */
|
|
@@ -47,20 +59,32 @@ export type SceneLayerProps = {
|
|
|
47
59
|
handlers?: ElementHandlers;
|
|
48
60
|
/** The scene's lattice, when it has one: smart links route through its gutters. */
|
|
49
61
|
lattice?: LatticeSpec;
|
|
62
|
+
/** Scene px of one nominal unit (the drawing's major grid cell); a nested layer inherits its parent's. */
|
|
63
|
+
cell?: number;
|
|
50
64
|
};
|
|
51
|
-
export declare const SceneLayer: React.MemoExoticComponent<({ store, scene, registry, zoom, depth, liveDepth, selected, hover, opening, editing, ghost, debug, handlers, lattice, }: SceneLayerProps) => React.JSX.Element>;
|
|
65
|
+
export declare const SceneLayer: React.MemoExoticComponent<({ store, scene: sceneProp, registry, zoom, depth, liveDepth, selected, plain, hover, hoveredLink, opening, focus, editing, active, ghost, debug, handlers, lattice: latticeProp, cell: cellProp, }: SceneLayerProps) => React.JSX.Element>;
|
|
66
|
+
/**
|
|
67
|
+
* How much thicker a layer draws its lines: a scene seen inside another is small, so its borders and links thicken,
|
|
68
|
+
* up to double, as it shrinks; at its own size (as it is drilled into) it is back to 1, so nothing jumps at the swap.
|
|
69
|
+
*/
|
|
70
|
+
export declare const lineWeight: (depth: number, zoom: number) => number;
|
|
52
71
|
declare const LabelNodeView: ({ node, editing }: NodeViewProps) => React.JSX.Element;
|
|
53
72
|
/** The `box` prototype's body: its centred label. */
|
|
54
73
|
export declare const BoxNodeView: typeof LabelNodeView;
|
|
55
74
|
export declare const EllipseNodeView: typeof LabelNodeView;
|
|
56
|
-
export declare const ClassNodeView: ({ node, editing }: NodeViewProps) => React.JSX.Element | null;
|
|
57
75
|
/** A node whose type the registry does not know: its frame and type name, so the scene still reads. */
|
|
58
76
|
export declare const UnknownNodeView: ({ node }: NodeViewProps) => React.JSX.Element;
|
|
59
77
|
export declare const NoteNodeView: ({ node, editing }: NodeViewProps) => React.JSX.Element;
|
|
60
78
|
/**
|
|
61
|
-
* A
|
|
79
|
+
* A frame over a child scene: the centred label, or with `contents` the child drawn inside the frame (a
|
|
62
80
|
* preview, then the live scene as it grows on screen), and a zoom-in control at the top-right.
|
|
63
81
|
*/
|
|
64
|
-
export declare const
|
|
82
|
+
export declare const FrameNodeView: (props: NodeViewProps) => React.JSX.Element;
|
|
83
|
+
export type OpenControlProps = {
|
|
84
|
+
label?: string;
|
|
85
|
+
onOpen: () => void;
|
|
86
|
+
};
|
|
87
|
+
/** The open control at a frame's top-right; it takes the press, so it neither drags nor selects the node. */
|
|
88
|
+
export declare const OpenControl: ({ label, onOpen }: OpenControlProps) => React.JSX.Element;
|
|
65
89
|
export {};
|
|
66
90
|
//# sourceMappingURL=SceneLayer.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SceneLayer.d.ts","sourceRoot":"","sources":["../../../../../src/components/SceneLayer/SceneLayer.tsx"],"names":[],"mappings":"AAUA,OAAO,
|
|
1
|
+
{"version":3,"file":"SceneLayer.d.ts","sourceRoot":"","sources":["../../../../../src/components/SceneLayer/SceneLayer.tsx"],"names":[],"mappings":"AAUA,OAAO,KAWN,MAAM,OAAO,CAAC;AAMf,OAAO,EAAE,KAAK,YAAY,EAAE,KAAK,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAChF,OAAO,EAAa,KAAK,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAClE,OAAO,EACL,KAAK,SAAS,EAEd,KAAK,IAAI,EACT,KAAK,MAAM,EAGX,KAAK,IAAI,EACT,KAAK,MAAM,EACX,KAAK,KAAK,EAMX,MAAM,sBAAsB,CAAC;AAG9B,OAAO,EAAE,KAAK,W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