@pairdraw/core 0.21.1 → 0.22.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/dist/canvas/boolean.d.ts +6 -1
- package/dist/canvas/boolean.d.ts.map +1 -1
- package/dist/canvas/boolean.js +10 -2
- package/dist/canvas/boolean.js.map +1 -1
- package/dist/canvas/color-space.d.ts +45 -0
- package/dist/canvas/color-space.d.ts.map +1 -0
- package/dist/canvas/color-space.js +39 -0
- package/dist/canvas/color-space.js.map +1 -0
- package/dist/canvas/fills.d.ts +10 -10
- package/dist/canvas/fills.d.ts.map +1 -1
- package/dist/canvas/fills.js +116 -62
- package/dist/canvas/fills.js.map +1 -1
- package/dist/canvas/flatten.d.ts +11 -3
- package/dist/canvas/flatten.d.ts.map +1 -1
- package/dist/canvas/flatten.js +62 -4
- package/dist/canvas/flatten.js.map +1 -1
- package/dist/canvas/index.d.ts +2 -1
- package/dist/canvas/index.js +2 -1
- package/dist/canvas/layout-grids.d.ts +5 -2
- package/dist/canvas/layout-grids.d.ts.map +1 -1
- package/dist/canvas/layout-grids.js +7 -2
- package/dist/canvas/layout-grids.js.map +1 -1
- package/dist/canvas/noise/render.d.ts +17 -4
- package/dist/canvas/noise/render.d.ts.map +1 -1
- package/dist/canvas/noise/render.js +21 -6
- package/dist/canvas/noise/render.js.map +1 -1
- package/dist/canvas/noise/shader.d.ts +4 -4
- package/dist/canvas/noise/shader.d.ts.map +1 -1
- package/dist/canvas/noise/shader.js +5 -6
- package/dist/canvas/noise/shader.js.map +1 -1
- package/dist/canvas/overlays/annotations.d.ts +19 -0
- package/dist/canvas/overlays/annotations.d.ts.map +1 -0
- package/dist/canvas/overlays/annotations.js +110 -0
- package/dist/canvas/overlays/annotations.js.map +1 -0
- package/dist/canvas/overlays/auto-layout-hover.d.ts +11 -1
- package/dist/canvas/overlays/auto-layout-hover.d.ts.map +1 -1
- package/dist/canvas/overlays/auto-layout-hover.js +25 -1
- package/dist/canvas/overlays/auto-layout-hover.js.map +1 -1
- package/dist/canvas/overlays/feedback.js +1 -1
- package/dist/canvas/overlays/feedback.js.map +1 -1
- package/dist/canvas/overlays/index.d.ts +2 -2
- package/dist/canvas/overlays/index.js +2 -2
- package/dist/canvas/overlays/measurement.d.ts +7 -1
- package/dist/canvas/overlays/measurement.d.ts.map +1 -1
- package/dist/canvas/overlays/measurement.js +42 -4
- package/dist/canvas/overlays/measurement.js.map +1 -1
- package/dist/canvas/overlays/presence.d.ts.map +1 -1
- package/dist/canvas/overlays/presence.js +21 -24
- package/dist/canvas/overlays/presence.js.map +1 -1
- package/dist/canvas/renderer/colors.d.ts +7 -1
- package/dist/canvas/renderer/colors.d.ts.map +1 -1
- package/dist/canvas/renderer/colors.js +9 -1
- package/dist/canvas/renderer/colors.js.map +1 -1
- package/dist/canvas/renderer/document-surface.d.ts +15 -6
- package/dist/canvas/renderer/document-surface.d.ts.map +1 -1
- package/dist/canvas/renderer/document-surface.js +1 -0
- package/dist/canvas/renderer/document-surface.js.map +1 -1
- package/dist/canvas/renderer/lifecycle.d.ts.map +1 -1
- package/dist/canvas/renderer/lifecycle.js +2 -2
- package/dist/canvas/renderer/lifecycle.js.map +1 -1
- package/dist/canvas/renderer/methods.d.ts +1 -0
- package/dist/canvas/renderer/methods.d.ts.map +1 -1
- package/dist/canvas/renderer/methods.js +4 -1
- package/dist/canvas/renderer/methods.js.map +1 -1
- package/dist/canvas/renderer/overlay-pass.d.ts.map +1 -1
- package/dist/canvas/renderer/overlay-pass.js +6 -1
- package/dist/canvas/renderer/overlay-pass.js.map +1 -1
- package/dist/canvas/renderer/pipeline.d.ts.map +1 -1
- package/dist/canvas/renderer/pipeline.js +7 -0
- package/dist/canvas/renderer/pipeline.js.map +1 -1
- package/dist/canvas/renderer/types.d.ts +10 -0
- package/dist/canvas/renderer/types.d.ts.map +1 -1
- package/dist/canvas/renderer.d.ts +10 -2
- package/dist/canvas/renderer.d.ts.map +1 -1
- package/dist/canvas/renderer.js +15 -3
- package/dist/canvas/renderer.js.map +1 -1
- package/dist/canvas/scene.d.ts.map +1 -1
- package/dist/canvas/scene.js +9 -9
- package/dist/canvas/scene.js.map +1 -1
- package/dist/clipboard/pairdraw.d.ts.map +1 -1
- package/dist/clipboard/pairdraw.js +1 -0
- package/dist/clipboard/pairdraw.js.map +1 -1
- package/dist/editor/bridges/clipboard.d.ts +2 -0
- package/dist/editor/bridges/clipboard.d.ts.map +1 -1
- package/dist/editor/bridges/clipboard.js +1 -0
- package/dist/editor/bridges/clipboard.js.map +1 -1
- package/dist/editor/bridges/components.d.ts +14 -7
- package/dist/editor/bridges/components.d.ts.map +1 -1
- package/dist/editor/bridges/components.js +6 -0
- package/dist/editor/bridges/components.js.map +1 -1
- package/dist/editor/bridges/structure.d.ts +1 -1
- package/dist/editor/bridges/structure.d.ts.map +1 -1
- package/dist/editor/clipboard/code.d.ts +32 -0
- package/dist/editor/clipboard/code.d.ts.map +1 -0
- package/dist/editor/clipboard/code.js +30 -0
- package/dist/editor/clipboard/code.js.map +1 -0
- package/dist/editor/clipboard/paste/dependencies.d.ts +14 -0
- package/dist/editor/clipboard/paste/dependencies.d.ts.map +1 -0
- package/dist/editor/clipboard/paste/dependencies.js +0 -0
- package/dist/editor/clipboard/paste/run.d.ts +14 -0
- package/dist/editor/clipboard/paste/run.d.ts.map +1 -0
- package/dist/editor/clipboard/paste/run.js +47 -0
- package/dist/editor/clipboard/paste/run.js.map +1 -0
- package/dist/editor/clipboard/styled.d.ts +2 -8
- package/dist/editor/clipboard/styled.d.ts.map +1 -1
- package/dist/editor/clipboard/styled.js +2 -32
- package/dist/editor/clipboard/styled.js.map +1 -1
- package/dist/editor/clipboard.d.ts +2 -0
- package/dist/editor/clipboard.d.ts.map +1 -1
- package/dist/editor/clipboard.js +34 -0
- package/dist/editor/clipboard.js.map +1 -1
- package/dist/editor/components/instances.d.ts +5 -0
- package/dist/editor/components/instances.d.ts.map +1 -1
- package/dist/editor/components/instances.js +69 -4
- package/dist/editor/components/instances.js.map +1 -1
- package/dist/editor/components/slots/index.d.ts.map +1 -1
- package/dist/editor/components/slots/index.js +7 -0
- package/dist/editor/components/slots/index.js.map +1 -1
- package/dist/editor/components.d.ts +6 -0
- package/dist/editor/components.d.ts.map +1 -1
- package/dist/editor/components.js +14 -2
- package/dist/editor/components.js.map +1 -1
- package/dist/editor/create.d.ts +29 -2
- package/dist/editor/create.d.ts.map +1 -1
- package/dist/editor/create.js +11 -2
- package/dist/editor/create.js.map +1 -1
- package/dist/editor/design-tokens.d.ts +1 -1
- package/dist/editor/design-tokens.d.ts.map +1 -1
- package/dist/editor/design-tokens.js +4 -18
- package/dist/editor/design-tokens.js.map +1 -1
- package/dist/editor/image-edit.d.ts.map +1 -1
- package/dist/editor/image-edit.js +1 -2
- package/dist/editor/image-edit.js.map +1 -1
- package/dist/editor/index.d.ts +4 -4
- package/dist/editor/index.js +1 -1
- package/dist/editor/layout-mode.d.ts +3 -1
- package/dist/editor/layout-mode.d.ts.map +1 -1
- package/dist/editor/layout-mode.js +97 -2
- package/dist/editor/layout-mode.js.map +1 -1
- package/dist/editor/nodes.d.ts +2 -0
- package/dist/editor/nodes.d.ts.map +1 -1
- package/dist/editor/nodes.js +22 -7
- package/dist/editor/nodes.js.map +1 -1
- package/dist/editor/read-only/actions.js +6 -0
- package/dist/editor/read-only/actions.js.map +1 -1
- package/dist/editor/selection/overlays.d.ts +1 -0
- package/dist/editor/selection/overlays.d.ts.map +1 -1
- package/dist/editor/selection/overlays.js +7 -0
- package/dist/editor/selection/overlays.js.map +1 -1
- package/dist/editor/selection/read.d.ts +8 -0
- package/dist/editor/selection.d.ts +9 -0
- package/dist/editor/selection.d.ts.map +1 -1
- package/dist/editor/state/shared.js +1 -0
- package/dist/editor/state/shared.js.map +1 -1
- package/dist/editor/state/view.d.ts.map +1 -1
- package/dist/editor/state/view.js +2 -0
- package/dist/editor/state/view.js.map +1 -1
- package/dist/editor/structure/boolean.d.ts +1 -1
- package/dist/editor/structure/boolean.d.ts.map +1 -1
- package/dist/editor/structure/boolean.js +20 -1
- package/dist/editor/structure/boolean.js.map +1 -1
- package/dist/editor/structure/container-wrap.d.ts +8 -2
- package/dist/editor/structure/container-wrap.d.ts.map +1 -1
- package/dist/editor/structure/container-wrap.js +17 -5
- package/dist/editor/structure/container-wrap.js.map +1 -1
- package/dist/editor/structure/flatten.d.ts.map +1 -1
- package/dist/editor/structure/flatten.js +8 -7
- package/dist/editor/structure/flatten.js.map +1 -1
- package/dist/editor/structure/group/ungroup.d.ts.map +1 -1
- package/dist/editor/structure/group/ungroup.js +2 -0
- package/dist/editor/structure/group/ungroup.js.map +1 -1
- package/dist/editor/structure/outline-stroke.d.ts.map +1 -1
- package/dist/editor/structure/outline-stroke.js +5 -0
- package/dist/editor/structure/outline-stroke.js.map +1 -1
- package/dist/editor/structure.d.ts +1 -1
- package/dist/editor/structure.d.ts.map +1 -1
- package/dist/editor/styles.d.ts +26 -0
- package/dist/editor/styles.d.ts.map +1 -0
- package/dist/editor/styles.js +127 -0
- package/dist/editor/styles.js.map +1 -0
- package/dist/editor/text/selection-style.d.ts +1 -0
- package/dist/editor/text/selection-style.d.ts.map +1 -1
- package/dist/editor/text/selection-style.js +10 -2
- package/dist/editor/text/selection-style.js.map +1 -1
- package/dist/editor/tool-registry.d.ts.map +1 -1
- package/dist/editor/tool-registry.js +6 -0
- package/dist/editor/tool-registry.js.map +1 -1
- package/dist/editor/types.d.ts +14 -2
- package/dist/editor/types.d.ts.map +1 -1
- package/dist/editor/variable-bindings.d.ts.map +1 -1
- package/dist/editor/variable-bindings.js +6 -1
- package/dist/editor/variable-bindings.js.map +1 -1
- package/dist/figma-api/accessors/basic.d.ts.map +1 -1
- package/dist/figma-api/accessors/basic.js +22 -1
- package/dist/figma-api/accessors/basic.js.map +1 -1
- package/dist/figma-api/accessors/shape.js +1 -1
- package/dist/figma-api/accessors/text/index.js +1 -1
- package/dist/figma-api/accessors/text/ranges.js +1 -1
- package/dist/figma-api/accessors/text/references.js +1 -1
- package/dist/figma-api/accessors/variables.js +1 -1
- package/dist/figma-api/accessors/vector.d.ts.map +1 -1
- package/dist/figma-api/accessors/vector.js +8 -22
- package/dist/figma-api/accessors/vector.js.map +1 -1
- package/dist/figma-api/accessors/visual.js +1 -1
- package/dist/figma-api/compatibility.d.ts +1 -1
- package/dist/figma-api/compatibility.d.ts.map +1 -1
- package/dist/figma-api/component-scope.d.ts +14 -0
- package/dist/figma-api/component-scope.d.ts.map +1 -0
- package/dist/figma-api/component-scope.js +28 -0
- package/dist/figma-api/component-scope.js.map +1 -0
- package/dist/figma-api/components.d.ts.map +1 -1
- package/dist/figma-api/components.js +26 -2
- package/dist/figma-api/components.js.map +1 -1
- package/dist/figma-api/flatten.js +3 -3
- package/dist/figma-api/flatten.js.map +1 -1
- package/dist/figma-api/index.d.ts +77 -6
- package/dist/figma-api/index.d.ts.map +1 -1
- package/dist/figma-api/index.js +188 -2
- package/dist/figma-api/index.js.map +1 -1
- package/dist/figma-api/node-types.d.ts +2 -1
- package/dist/figma-api/node-types.d.ts.map +1 -1
- package/dist/figma-api/overrides.d.ts +26 -1
- package/dist/figma-api/overrides.d.ts.map +1 -1
- package/dist/figma-api/overrides.js +157 -10
- package/dist/figma-api/overrides.js.map +1 -1
- package/dist/figma-api/proxy.d.ts +2 -0
- package/dist/figma-api/proxy.d.ts.map +1 -1
- package/dist/figma-api/proxy.js +10 -2
- package/dist/figma-api/proxy.js.map +1 -1
- package/dist/figma-api/reactions.d.ts +61 -5
- package/dist/figma-api/reactions.d.ts.map +1 -1
- package/dist/figma-api/reactions.js +144 -11
- package/dist/figma-api/reactions.js.map +1 -1
- package/dist/figma-api/shape-with-text.js +1 -1
- package/dist/figma-api/slots.d.ts +3 -1
- package/dist/figma-api/slots.d.ts.map +1 -1
- package/dist/figma-api/slots.js +9 -8
- package/dist/figma-api/slots.js.map +1 -1
- package/dist/index.d.ts +4 -4
- package/dist/index.js +1 -1
- package/dist/io/formats/code/detect.d.ts +23 -0
- package/dist/io/formats/code/detect.d.ts.map +1 -0
- package/dist/io/formats/code/detect.js +46 -0
- package/dist/io/formats/code/detect.js.map +1 -0
- package/dist/io/formats/code/index.d.ts +5 -0
- package/dist/io/formats/code/index.js +5 -0
- package/dist/io/formats/code/read.d.ts +45 -0
- package/dist/io/formats/code/read.d.ts.map +1 -0
- package/dist/io/formats/code/read.js +86 -0
- package/dist/io/formats/code/read.js.map +1 -0
- package/dist/io/formats/code/stylesheet.d.ts +13 -0
- package/dist/io/formats/code/stylesheet.d.ts.map +1 -0
- package/dist/io/formats/code/stylesheet.js +21 -0
- package/dist/io/formats/code/stylesheet.js.map +1 -0
- package/dist/io/formats/code/tokens.d.ts +18 -0
- package/dist/io/formats/code/tokens.d.ts.map +1 -0
- package/dist/io/formats/code/tokens.js +135 -0
- package/dist/io/formats/code/tokens.js.map +1 -0
- package/dist/io/formats/design-tokens/apply.d.ts +7 -3
- package/dist/io/formats/design-tokens/apply.d.ts.map +1 -1
- package/dist/io/formats/design-tokens/apply.js.map +1 -1
- package/dist/io/formats/fig/export/patch/fields.js +5 -0
- package/dist/io/formats/fig/export/patch/fields.js.map +1 -1
- package/dist/io/formats/fig/export/patch/index.d.ts.map +1 -1
- package/dist/io/formats/fig/export/patch/index.js +20 -20
- package/dist/io/formats/fig/export/patch/index.js.map +1 -1
- package/dist/io/formats/fig/export/setup.d.ts.map +1 -1
- package/dist/io/formats/fig/export/setup.js +5 -1
- package/dist/io/formats/fig/export/setup.js.map +1 -1
- package/dist/io/formats/fig/index.d.ts +3 -2
- package/dist/io/formats/fig/index.js +2 -2
- package/dist/io/formats/fig/read.d.ts.map +1 -1
- package/dist/io/formats/fig/read.js +5 -2
- package/dist/io/formats/fig/read.js.map +1 -1
- package/dist/io/formats/html/layers.d.ts +3 -1
- package/dist/io/formats/html/layers.d.ts.map +1 -1
- package/dist/io/formats/html/layers.js +6 -1
- package/dist/io/formats/html/layers.js.map +1 -1
- package/dist/io/formats/pdf/export.d.ts.map +1 -1
- package/dist/io/formats/pdf/export.js +7 -3
- package/dist/io/formats/pdf/export.js.map +1 -1
- package/dist/io/formats/pdf/plan.d.ts +3 -0
- package/dist/io/formats/pdf/plan.d.ts.map +1 -1
- package/dist/io/formats/pdf/plan.js +60 -36
- package/dist/io/formats/pdf/plan.js.map +1 -1
- package/dist/io/formats/raster/headless.d.ts.map +1 -1
- package/dist/io/formats/raster/headless.js +3 -2
- package/dist/io/formats/raster/headless.js.map +1 -1
- package/dist/io/formats/raster/index.d.ts +2 -2
- package/dist/io/formats/raster/index.js +2 -2
- package/dist/io/formats/raster/render.d.ts +10 -2
- package/dist/io/formats/raster/render.d.ts.map +1 -1
- package/dist/io/formats/raster/render.js +35 -9
- package/dist/io/formats/raster/render.js.map +1 -1
- package/dist/io/formats/svg/defs.d.ts.map +1 -1
- package/dist/io/formats/svg/defs.js +19 -1
- package/dist/io/formats/svg/defs.js.map +1 -1
- package/dist/io/formats/svg/export.d.ts +5 -2
- package/dist/io/formats/svg/export.d.ts.map +1 -1
- package/dist/io/formats/svg/export.js +59 -10
- package/dist/io/formats/svg/export.js.map +1 -1
- package/dist/io/formats/svg/index.d.ts +2 -2
- package/dist/io/formats/svg/index.js +2 -2
- package/dist/io/formats/svg/text/layout.d.ts.map +1 -1
- package/dist/io/formats/svg/text/layout.js +4 -2
- package/dist/io/formats/svg/text/layout.js.map +1 -1
- package/dist/io/formats/video/record.d.ts.map +1 -1
- package/dist/io/formats/video/record.js +24 -9
- package/dist/io/formats/video/record.js.map +1 -1
- package/dist/io/formats.d.ts.map +1 -1
- package/dist/io/formats.js +20 -13
- package/dist/io/formats.js.map +1 -1
- package/dist/kiwi/fig/population/client.d.ts.map +1 -1
- package/dist/kiwi/fig/population/client.js +2 -1
- package/dist/kiwi/fig/population/client.js.map +1 -1
- package/dist/kiwi/fig/session/document-state.d.ts +46 -2
- package/dist/kiwi/fig/session/document-state.d.ts.map +1 -1
- package/dist/kiwi/fig/session/document-state.js +113 -5
- package/dist/kiwi/fig/session/document-state.js.map +1 -1
- package/dist/kiwi/fig/session/options.d.ts +4 -0
- package/dist/kiwi/fig/session/options.d.ts.map +1 -1
- package/dist/kiwi/fig/session/options.js.map +1 -1
- package/dist/layout/apply.d.ts.map +1 -1
- package/dist/layout/apply.js +8 -4
- package/dist/layout/apply.js.map +1 -1
- package/dist/layout/auto-layout-handles.js +1 -1
- package/dist/layout/auto-layout-handles.js.map +1 -1
- package/dist/layout/axis-sizing.d.ts.map +1 -1
- package/dist/layout/axis-sizing.js +1 -1
- package/dist/layout/axis-sizing.js.map +1 -1
- package/dist/layout/derived.d.ts.map +1 -1
- package/dist/layout/derived.js +1 -1
- package/dist/layout/derived.js.map +1 -1
- package/dist/layout/effective-generated-text.js +1 -1
- package/dist/layout/effective-generated-text.js.map +1 -1
- package/dist/layout/grid.d.ts +3 -1
- package/dist/layout/grid.d.ts.map +1 -1
- package/dist/layout/grid.js +57 -16
- package/dist/layout/grid.js.map +1 -1
- package/dist/layout.d.ts +1 -1
- package/dist/layout.js +6 -5
- package/dist/layout.js.map +1 -1
- package/dist/node/fs.d.ts.map +1 -1
- package/dist/node/fs.js +28 -7
- package/dist/node/fs.js.map +1 -1
- package/dist/prototype/easing.d.ts +13 -5
- package/dist/prototype/easing.d.ts.map +1 -1
- package/dist/prototype/easing.js +46 -6
- package/dist/prototype/easing.js.map +1 -1
- package/dist/prototype/scenes.d.ts +31 -0
- package/dist/prototype/scenes.d.ts.map +1 -1
- package/dist/prototype/scenes.js +220 -31
- package/dist/prototype/scenes.js.map +1 -1
- package/dist/prototype/session.d.ts.map +1 -1
- package/dist/prototype/session.js +1 -0
- package/dist/prototype/session.js.map +1 -1
- package/dist/prototype/smart-animate/animation.d.ts +2 -1
- package/dist/prototype/smart-animate/animation.d.ts.map +1 -1
- package/dist/prototype/smart-animate/animation.js +2 -2
- package/dist/prototype/smart-animate/animation.js.map +1 -1
- package/dist/prototype/timeline.d.ts +10 -1
- package/dist/prototype/timeline.d.ts.map +1 -1
- package/dist/prototype/timeline.js +69 -23
- package/dist/prototype/timeline.js.map +1 -1
- package/dist/prototype/variables.d.ts +23 -0
- package/dist/prototype/variables.d.ts.map +1 -0
- package/dist/prototype/variables.js +237 -0
- package/dist/prototype/variables.js.map +1 -0
- package/dist/rpc/read-commands.d.ts +5 -0
- package/dist/rpc/read-commands.d.ts.map +1 -1
- package/dist/rpc/read-commands.js +4 -1
- package/dist/rpc/read-commands.js.map +1 -1
- package/dist/text/character-style.d.ts +8 -1
- package/dist/text/character-style.d.ts.map +1 -1
- package/dist/text/character-style.js +39 -1
- package/dist/text/character-style.js.map +1 -1
- package/dist/text/index.d.ts +2 -2
- package/dist/text/index.js +2 -2
- package/dist/tools/create/basic.js +3 -4
- package/dist/tools/create/basic.js.map +1 -1
- package/dist/tools/create/behaviours.js +1 -1
- package/dist/tools/create/code.d.ts +6 -0
- package/dist/tools/create/code.d.ts.map +1 -0
- package/dist/tools/create/code.js +68 -0
- package/dist/tools/create/code.js.map +1 -0
- package/dist/tools/create/html.d.ts.map +1 -1
- package/dist/tools/create/html.js +9 -57
- package/dist/tools/create/html.js.map +1 -1
- package/dist/tools/create/icons.js +1 -1
- package/dist/tools/create/inputs.d.ts +11 -0
- package/dist/tools/create/inputs.d.ts.map +1 -0
- package/dist/tools/create/inputs.js +15 -0
- package/dist/tools/create/inputs.js.map +1 -0
- package/dist/tools/create/mermaid.d.ts.map +1 -1
- package/dist/tools/create/mermaid.js +5 -6
- package/dist/tools/create/mermaid.js.map +1 -1
- package/dist/tools/create/place.d.ts +30 -0
- package/dist/tools/create/place.d.ts.map +1 -0
- package/dist/tools/create/place.js +70 -0
- package/dist/tools/create/place.js.map +1 -0
- package/dist/tools/create/render.js +1 -1
- package/dist/tools/create/svg.js +1 -1
- package/dist/tools/create/vector.js +1 -1
- package/dist/tools/create.d.ts +2 -1
- package/dist/tools/create.js +2 -1
- package/dist/tools/css/gradient.d.ts +28 -0
- package/dist/tools/css/gradient.d.ts.map +1 -0
- package/dist/tools/css/gradient.js +118 -0
- package/dist/tools/css/gradient.js.map +1 -0
- package/dist/tools/image-ai/generate.js +1 -1
- package/dist/tools/modify/geometry.js +5 -5
- package/dist/tools/modify/geometry.js.map +1 -1
- package/dist/tools/modify/layout.d.ts.map +1 -1
- package/dist/tools/modify/layout.js +7 -1
- package/dist/tools/modify/layout.js.map +1 -1
- package/dist/tools/modify/matching.js +1 -1
- package/dist/tools/modify/overrides.d.ts +6 -0
- package/dist/tools/modify/overrides.d.ts.map +1 -0
- package/dist/tools/modify/overrides.js +27 -0
- package/dist/tools/modify/overrides.js.map +1 -0
- package/dist/tools/modify/paint.d.ts.map +1 -1
- package/dist/tools/modify/paint.js +84 -39
- package/dist/tools/modify/paint.js.map +1 -1
- package/dist/tools/modify/text.d.ts +2 -1
- package/dist/tools/modify/text.d.ts.map +1 -1
- package/dist/tools/modify/text.js +79 -8
- package/dist/tools/modify/text.js.map +1 -1
- package/dist/tools/modify/update.d.ts.map +1 -1
- package/dist/tools/modify/update.js +18 -2
- package/dist/tools/modify/update.js.map +1 -1
- package/dist/tools/modify.d.ts +3 -2
- package/dist/tools/modify.js +3 -2
- package/dist/tools/read/css.d.ts.map +1 -1
- package/dist/tools/read/css.js +29 -12
- package/dist/tools/read/css.js.map +1 -1
- package/dist/tools/read/libraries.js +1 -1
- package/dist/tools/read/nodes.d.ts.map +1 -1
- package/dist/tools/read/nodes.js +19 -5
- package/dist/tools/read/nodes.js.map +1 -1
- package/dist/tools/registry/extended.d.ts.map +1 -1
- package/dist/tools/registry/extended.js +6 -1
- package/dist/tools/registry/extended.js.map +1 -1
- package/dist/tools/text-range.d.ts +11 -0
- package/dist/tools/text-range.d.ts.map +1 -0
- package/dist/tools/text-range.js +26 -0
- package/dist/tools/text-range.js.map +1 -0
- package/dist/tools/variables/bindings.js +1 -1
- package/dist/tools/variables/bindings.js.map +1 -1
- package/dist/tools/variables/unbind.js +1 -1
- package/dist/tools/variables/unbind.js.map +1 -1
- package/dist/tools/vector/path.d.ts.map +1 -1
- package/dist/tools/vector/path.js +7 -21
- package/dist/tools/vector/path.js.map +1 -1
- package/dist/vector/rebase.d.ts +17 -0
- package/dist/vector/rebase.d.ts.map +1 -0
- package/dist/vector/rebase.js +32 -0
- package/dist/vector/rebase.js.map +1 -0
- package/package.json +14 -9
- package/src/canvas/boolean.ts +12 -1
- package/src/canvas/color-space.ts +73 -0
- package/src/canvas/fills.ts +130 -83
- package/src/canvas/flatten.ts +92 -7
- package/src/canvas/index.ts +9 -0
- package/src/canvas/layout-grids.ts +15 -2
- package/src/canvas/noise/render.ts +35 -7
- package/src/canvas/noise/shader.ts +8 -10
- package/src/canvas/overlays/annotations.ts +117 -0
- package/src/canvas/overlays/auto-layout-hover.ts +41 -1
- package/src/canvas/overlays/feedback.ts +7 -2
- package/src/canvas/overlays/index.ts +1 -1
- package/src/canvas/overlays/measurement.ts +49 -3
- package/src/canvas/overlays/presence.ts +35 -32
- package/src/canvas/renderer/colors.ts +14 -0
- package/src/canvas/renderer/document-surface.ts +16 -6
- package/src/canvas/renderer/lifecycle.ts +2 -2
- package/src/canvas/renderer/methods.ts +4 -0
- package/src/canvas/renderer/overlay-pass.ts +4 -0
- package/src/canvas/renderer/pipeline.ts +8 -0
- package/src/canvas/renderer/types.ts +8 -0
- package/src/canvas/renderer.ts +21 -2
- package/src/canvas/scene.ts +15 -7
- package/src/clipboard/pairdraw.ts +1 -0
- package/src/editor/bridges/clipboard.ts +1 -0
- package/src/editor/bridges/components.ts +10 -0
- package/src/editor/clipboard/code.ts +50 -0
- package/src/editor/clipboard/paste/dependencies.ts +18 -0
- package/src/editor/clipboard/paste/run.ts +64 -0
- package/src/editor/clipboard/styled.ts +4 -52
- package/src/editor/clipboard.ts +40 -0
- package/src/editor/components/instances.ts +92 -4
- package/src/editor/components/slots/index.ts +7 -0
- package/src/editor/components.ts +16 -2
- package/src/editor/create.ts +15 -1
- package/src/editor/design-tokens.ts +3 -23
- package/src/editor/image-edit.ts +5 -2
- package/src/editor/index.ts +1 -0
- package/src/editor/layout-mode.ts +131 -3
- package/src/editor/nodes.ts +30 -5
- package/src/editor/read-only/actions.ts +6 -0
- package/src/editor/selection/overlays.ts +8 -0
- package/src/editor/state/shared.ts +1 -0
- package/src/editor/state/view.ts +2 -0
- package/src/editor/structure/boolean.ts +29 -1
- package/src/editor/structure/container-wrap.ts +20 -4
- package/src/editor/structure/flatten.ts +15 -8
- package/src/editor/structure/group/ungroup.ts +2 -0
- package/src/editor/structure/outline-stroke.ts +5 -0
- package/src/editor/styles.ts +203 -0
- package/src/editor/text/selection-style.ts +18 -1
- package/src/editor/tool-registry.ts +2 -0
- package/src/editor/types.ts +14 -0
- package/src/editor/variable-bindings.ts +11 -0
- package/src/figma-api/accessors/basic.ts +33 -1
- package/src/figma-api/accessors/vector.ts +6 -13
- package/src/figma-api/compatibility.ts +1 -0
- package/src/figma-api/component-scope.ts +36 -0
- package/src/figma-api/components.ts +24 -0
- package/src/figma-api/flatten.ts +7 -3
- package/src/figma-api/index.ts +302 -6
- package/src/figma-api/node-types.ts +1 -0
- package/src/figma-api/overrides.ts +192 -5
- package/src/figma-api/proxy.ts +16 -1
- package/src/figma-api/reactions.ts +163 -12
- package/src/figma-api/slots.ts +10 -9
- package/src/io/formats/code/detect.ts +67 -0
- package/src/io/formats/code/index.ts +17 -0
- package/src/io/formats/code/read.ts +143 -0
- package/src/io/formats/code/stylesheet.ts +24 -0
- package/src/io/formats/code/tokens.ts +159 -0
- package/src/io/formats/design-tokens/apply.ts +3 -2
- package/src/io/formats/fig/export/patch/fields.ts +11 -0
- package/src/io/formats/fig/export/patch/index.ts +23 -19
- package/src/io/formats/fig/export/setup.ts +8 -1
- package/src/io/formats/fig/index.ts +6 -0
- package/src/io/formats/fig/read.ts +11 -2
- package/src/io/formats/html/layers.ts +7 -0
- package/src/io/formats/pdf/export.ts +19 -7
- package/src/io/formats/pdf/plan.ts +71 -32
- package/src/io/formats/raster/headless.ts +3 -1
- package/src/io/formats/raster/index.ts +2 -0
- package/src/io/formats/raster/render.ts +49 -9
- package/src/io/formats/svg/defs.ts +27 -1
- package/src/io/formats/svg/export.ts +75 -13
- package/src/io/formats/svg/index.ts +1 -0
- package/src/io/formats/svg/text/layout.ts +5 -3
- package/src/io/formats/video/record.ts +33 -9
- package/src/io/formats.ts +35 -15
- package/src/kiwi/fig/population/client.ts +6 -1
- package/src/kiwi/fig/session/document-state.ts +195 -5
- package/src/kiwi/fig/session/options.ts +2 -0
- package/src/layout/apply.ts +12 -4
- package/src/layout/auto-layout-handles.ts +1 -1
- package/src/layout/axis-sizing.ts +3 -1
- package/src/layout/derived.ts +3 -1
- package/src/layout/effective-generated-text.ts +1 -1
- package/src/layout/grid.ts +91 -21
- package/src/layout.ts +16 -3
- package/src/node/fs.ts +32 -7
- package/src/prototype/easing.ts +79 -7
- package/src/prototype/scenes.ts +244 -15
- package/src/prototype/session.ts +1 -0
- package/src/prototype/smart-animate/animation.ts +4 -3
- package/src/prototype/timeline.ts +118 -26
- package/src/prototype/variables.ts +189 -0
- package/src/rpc/read-commands.ts +19 -1
- package/src/text/character-style.ts +47 -0
- package/src/text/index.ts +1 -1
- package/src/tools/create/basic.ts +2 -3
- package/src/tools/create/code.ts +85 -0
- package/src/tools/create/html.ts +9 -46
- package/src/tools/create/inputs.ts +12 -0
- package/src/tools/create/mermaid.ts +6 -6
- package/src/tools/create/place.ts +80 -0
- package/src/tools/create.ts +1 -0
- package/src/tools/css/gradient.ts +147 -0
- package/src/tools/modify/geometry.ts +5 -5
- package/src/tools/modify/layout.ts +19 -0
- package/src/tools/modify/overrides.ts +35 -0
- package/src/tools/modify/paint.ts +124 -54
- package/src/tools/modify/text.ts +91 -7
- package/src/tools/modify/update.ts +23 -2
- package/src/tools/modify.ts +9 -1
- package/src/tools/read/css.ts +46 -12
- package/src/tools/read/nodes.ts +26 -4
- package/src/tools/registry/extended.ts +6 -0
- package/src/tools/text-range.ts +29 -0
- package/src/tools/variables/bindings.ts +4 -1
- package/src/tools/variables/unbind.ts +4 -1
- package/src/tools/vector/path.ts +11 -13
- package/src/vector/rebase.ts +33 -0
package/src/editor/create.ts
CHANGED
|
@@ -64,6 +64,7 @@ import { createDefaultEditorState } from './state'
|
|
|
64
64
|
import { createStatusActions } from './statuses'
|
|
65
65
|
import { createStickyActions } from './stickies'
|
|
66
66
|
import { createStructureActions } from './structure'
|
|
67
|
+
import { createStyleActions } from './styles'
|
|
67
68
|
import { createTextActions } from './text'
|
|
68
69
|
import { createTextHyperlinkActions } from './text/hyperlink'
|
|
69
70
|
import { createPendingTextLayout } from './text/pending-layout'
|
|
@@ -181,6 +182,10 @@ export function createEditor(options?: EditorOptions) {
|
|
|
181
182
|
const previous = [...state.selectedIds]
|
|
182
183
|
state.selectedIds = ids
|
|
183
184
|
if (ids.size === 0) state.measurementMode = 'off'
|
|
185
|
+
// The spacing bands belong to the layer whose field asked for them; a selection that no
|
|
186
|
+
// longer holds it must not keep showing them.
|
|
187
|
+
if (state.layoutSpacingNodeId && !ids.has(state.layoutSpacingNodeId))
|
|
188
|
+
state.layoutSpacingNodeId = null
|
|
184
189
|
const selected = [...ids]
|
|
185
190
|
if (
|
|
186
191
|
previous.length !== selected.length ||
|
|
@@ -194,7 +199,10 @@ export function createEditor(options?: EditorOptions) {
|
|
|
194
199
|
if (offeredTool(state, tool) !== tool) return
|
|
195
200
|
const previous = state.activeTool
|
|
196
201
|
state.activeTool = tool
|
|
197
|
-
if (tool !== 'SELECT')
|
|
202
|
+
if (tool !== 'SELECT') {
|
|
203
|
+
state.measurementMode = 'off'
|
|
204
|
+
state.layoutSpacingNodeId = null
|
|
205
|
+
}
|
|
198
206
|
if (previous === tool) return
|
|
199
207
|
// Guides the pen showed for its next point do not belong to the next tool.
|
|
200
208
|
if (previous === 'PEN') state.snapGuides = []
|
|
@@ -292,6 +300,7 @@ export function createEditor(options?: EditorOptions) {
|
|
|
292
300
|
)
|
|
293
301
|
const variables = createVariableActions(ctx)
|
|
294
302
|
const designTokens = createDesignTokenActions(ctx, variables, nodes)
|
|
303
|
+
const styles = createStyleActions(ctx, nodes)
|
|
295
304
|
const vectorize = createVectorizeActions(ctx)
|
|
296
305
|
const icons = createIconActions(ctx)
|
|
297
306
|
const stickies = createStickyActions(ctx, nodes)
|
|
@@ -414,6 +423,7 @@ export function createEditor(options?: EditorOptions) {
|
|
|
414
423
|
state.hoveredNodeId = null
|
|
415
424
|
state.transforming = false
|
|
416
425
|
state.measurementMode = 'off'
|
|
426
|
+
state.layoutSpacingNodeId = null
|
|
417
427
|
state.snapGuides = []
|
|
418
428
|
state.guides = { preview: null, hovered: null, selected: null, redline: null }
|
|
419
429
|
state.layoutInsertIndicator = null
|
|
@@ -509,6 +519,7 @@ export function createEditor(options?: EditorOptions) {
|
|
|
509
519
|
nodes.updateNodeWithUndo(target, next, label)
|
|
510
520
|
),
|
|
511
521
|
getTextSelectionStyle: textSelectionStyle.selectionStyle,
|
|
522
|
+
isTextStyleMixed: textSelectionStyle.isTextStyleMixed,
|
|
512
523
|
layerChanges: textSelectionStyle.layerChanges,
|
|
513
524
|
|
|
514
525
|
// Alignment (align, flip, rotate)
|
|
@@ -545,6 +556,9 @@ export function createEditor(options?: EditorOptions) {
|
|
|
545
556
|
...variables,
|
|
546
557
|
...designTokens,
|
|
547
558
|
|
|
559
|
+
// Shared styles
|
|
560
|
+
...styles,
|
|
561
|
+
|
|
548
562
|
// Text editing
|
|
549
563
|
...text,
|
|
550
564
|
...fonts,
|
|
@@ -8,14 +8,13 @@ import {
|
|
|
8
8
|
// Not the format's barrel: the editor always loads this file, and the exporter is loaded on demand.
|
|
9
9
|
import {
|
|
10
10
|
applyTokenImport,
|
|
11
|
-
styleNodeProps,
|
|
12
|
-
styleNodeType,
|
|
13
11
|
type TokenImportResult,
|
|
14
12
|
type TokenImportTarget
|
|
15
13
|
} from '#core/io/formats/design-tokens/apply'
|
|
16
14
|
import type { TokenImportPlan } from '#core/io/formats/design-tokens/plan'
|
|
17
15
|
|
|
18
16
|
import type { NodeActions } from './nodes'
|
|
17
|
+
import { createStyleNode } from './styles'
|
|
19
18
|
import type { EditorContext } from './types'
|
|
20
19
|
import type { createVariableActions } from './variables'
|
|
21
20
|
|
|
@@ -25,31 +24,12 @@ export function createDesignTokenActions(
|
|
|
25
24
|
variables: VariableActions,
|
|
26
25
|
nodes: NodeActions
|
|
27
26
|
) {
|
|
28
|
-
/** A new style node,
|
|
27
|
+
/** A new style node, shared with the style picker's creation action. */
|
|
29
28
|
function addStyle(
|
|
30
29
|
style: Parameters<TokenImportTarget['addStyle']>[0],
|
|
31
30
|
fields: Partial<SceneNode>
|
|
32
31
|
) {
|
|
33
|
-
|
|
34
|
-
styleNodeType(style),
|
|
35
|
-
ctx.state.currentPageId,
|
|
36
|
-
styleNodeProps(style, fields)
|
|
37
|
-
)
|
|
38
|
-
node.source.id = crypto.randomUUID()
|
|
39
|
-
const snapshot = structuredClone(node)
|
|
40
|
-
const parentId = node.parentId
|
|
41
|
-
ctx.undo.push({
|
|
42
|
-
label: 'Add style',
|
|
43
|
-
forward: () => {
|
|
44
|
-
ctx.graph.createNodeWithId(snapshot.id, snapshot.type, parentId, structuredClone(snapshot))
|
|
45
|
-
ctx.requestRender()
|
|
46
|
-
},
|
|
47
|
-
inverse: () => {
|
|
48
|
-
ctx.graph.deleteNode(snapshot.id)
|
|
49
|
-
ctx.requestRender()
|
|
50
|
-
}
|
|
51
|
-
})
|
|
52
|
-
return node
|
|
32
|
+
return createStyleNode(ctx, style.kind, fields)
|
|
53
33
|
}
|
|
54
34
|
|
|
55
35
|
/** The import's changes made through the editor's actions, each one undoable. */
|
package/src/editor/image-edit.ts
CHANGED
|
@@ -6,11 +6,14 @@ import type {
|
|
|
6
6
|
SceneNode
|
|
7
7
|
} from '@pairdraw/scene-graph'
|
|
8
8
|
import { getNodeLocalMatrix } from '@pairdraw/scene-graph/coordinate'
|
|
9
|
-
import {
|
|
9
|
+
import {
|
|
10
|
+
coverImageTransform,
|
|
11
|
+
imageSize,
|
|
12
|
+
makeImageFillLocalMatrix
|
|
13
|
+
} from '@pairdraw/scene-graph/images'
|
|
10
14
|
import Matrix from '@pairdraw/scene-graph/matrix'
|
|
11
15
|
import type { Size, Vector } from '@pairdraw/scene-graph/primitives'
|
|
12
16
|
|
|
13
|
-
import { makeImageFillLocalMatrix } from '#core/canvas/fills'
|
|
14
17
|
import {
|
|
15
18
|
coveringImageBounds,
|
|
16
19
|
createSceneGeometry,
|
package/src/editor/index.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { LayoutMode, SceneNode } from '@pairdraw/scene-graph'
|
|
1
|
+
import type { GridPosition, LayoutMode, SceneNode } from '@pairdraw/scene-graph'
|
|
2
2
|
|
|
3
3
|
import type { NodePreview } from './node-preview'
|
|
4
4
|
import type { EditorContext } from './types'
|
|
@@ -18,7 +18,18 @@ export function createLayoutModeActions(
|
|
|
18
18
|
const preview = beginNodePreview(mode === 'NONE' ? 'Remove auto layout' : 'Add auto layout')
|
|
19
19
|
// A group is only its children's bounds; a flow needs a frame to own it, as Figma converts.
|
|
20
20
|
if (node.type === 'GROUP' && mode !== 'NONE') preview.update(id, { type: 'FRAME' })
|
|
21
|
-
|
|
21
|
+
const updates = layoutModeUpdates(ctx, node, id, mode)
|
|
22
|
+
preview.update(id, updates)
|
|
23
|
+
// A grid that returns from auto layout may have fewer tracks than the placements left behind.
|
|
24
|
+
if (mode === 'GRID' && updates.gridTemplateColumns && updates.gridTemplateRows) {
|
|
25
|
+
clampGridChildren(
|
|
26
|
+
ctx,
|
|
27
|
+
preview,
|
|
28
|
+
node,
|
|
29
|
+
updates.gridTemplateColumns.length,
|
|
30
|
+
updates.gridTemplateRows.length
|
|
31
|
+
)
|
|
32
|
+
}
|
|
22
33
|
preview.commit()
|
|
23
34
|
}
|
|
24
35
|
|
|
@@ -51,7 +62,124 @@ export function createLayoutModeActions(
|
|
|
51
62
|
preview.commit()
|
|
52
63
|
}
|
|
53
64
|
|
|
54
|
-
|
|
65
|
+
/**
|
|
66
|
+
* A grid child's start line or span, from the panel's grid placement fields. `0` starts and a
|
|
67
|
+
* span of `1` mean auto placement, so a layer back on those defaults carries no position and
|
|
68
|
+
* `.fig` and JSX leave it out. Every selected grid child changes in one undo step.
|
|
69
|
+
*/
|
|
70
|
+
function setGridPlacement(ids: readonly string[], patch: Partial<GridPosition>) {
|
|
71
|
+
const targets = ids.flatMap((id) => {
|
|
72
|
+
const node = ctx.graph.getNode(id)
|
|
73
|
+
if (!node) return []
|
|
74
|
+
const parent = node.parentId ? ctx.graph.getNode(node.parentId) : undefined
|
|
75
|
+
if (parent?.layoutMode !== 'GRID') return []
|
|
76
|
+
const current = node.gridPosition ?? { column: 0, row: 0, columnSpan: 1, rowSpan: 1 }
|
|
77
|
+
const next = normalizedGridPosition({ ...current, ...patch })
|
|
78
|
+
if (sameGridPosition(node.gridPosition, next)) return []
|
|
79
|
+
return [{ id, next }]
|
|
80
|
+
})
|
|
81
|
+
if (targets.length === 0) return
|
|
82
|
+
const preview = beginNodePreview('Change grid placement')
|
|
83
|
+
for (const { id, next } of targets) preview.update(id, { gridPosition: next })
|
|
84
|
+
preview.commit()
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
/**
|
|
88
|
+
* Removes one column or row track and keeps every placed child inside the grid that remains:
|
|
89
|
+
* a start past the new count moves to the nearest track and a span shrinks to fit. The track and
|
|
90
|
+
* the placements commit as one undo step.
|
|
91
|
+
*/
|
|
92
|
+
function removeGridTrack(
|
|
93
|
+
id: string,
|
|
94
|
+
prop: 'gridTemplateColumns' | 'gridTemplateRows',
|
|
95
|
+
index: number
|
|
96
|
+
) {
|
|
97
|
+
const node = ctx.graph.getNode(id)
|
|
98
|
+
if (node?.layoutMode !== 'GRID') return
|
|
99
|
+
const tracks = node[prop]
|
|
100
|
+
if (index < 0 || index >= tracks.length) return
|
|
101
|
+
const remaining = tracks.filter((_, trackIndex) => trackIndex !== index)
|
|
102
|
+
const preview = beginNodePreview('Remove grid track')
|
|
103
|
+
preview.update(id, { [prop]: remaining })
|
|
104
|
+
// A last track leaves no line to clamp to; the placements stay for a grid that returns.
|
|
105
|
+
if (remaining.length > 0) {
|
|
106
|
+
const columns =
|
|
107
|
+
prop === 'gridTemplateColumns' ? remaining.length : node.gridTemplateColumns.length
|
|
108
|
+
const rows = prop === 'gridTemplateRows' ? remaining.length : node.gridTemplateRows.length
|
|
109
|
+
clampGridChildren(ctx, preview, node, columns, rows)
|
|
110
|
+
}
|
|
111
|
+
preview.commit()
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
return { setLayoutMode, setLayoutPositioning, setGridPlacement, removeGridTrack }
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
/**
|
|
118
|
+
* Moves every placed child of a grid inside its track counts: a start past the last line moves to
|
|
119
|
+
* the nearest one and a span shrinks to fit, while an auto start stays auto.
|
|
120
|
+
*/
|
|
121
|
+
function clampGridChildren(
|
|
122
|
+
ctx: EditorContext,
|
|
123
|
+
preview: NodePreview,
|
|
124
|
+
parent: SceneNode,
|
|
125
|
+
columns: number,
|
|
126
|
+
rows: number
|
|
127
|
+
) {
|
|
128
|
+
for (const childId of parent.childIds) {
|
|
129
|
+
const position = ctx.graph.getNode(childId)?.gridPosition
|
|
130
|
+
if (!position) continue
|
|
131
|
+
const next = clampedGridPosition(position, columns, rows)
|
|
132
|
+
if (
|
|
133
|
+
next.column === position.column &&
|
|
134
|
+
next.row === position.row &&
|
|
135
|
+
next.columnSpan === position.columnSpan &&
|
|
136
|
+
next.rowSpan === position.rowSpan
|
|
137
|
+
) {
|
|
138
|
+
continue
|
|
139
|
+
}
|
|
140
|
+
preview.update(childId, { gridPosition: next })
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
/** The nearest placement a grid keeps after its track counts change. */
|
|
145
|
+
function clampedGridPosition(position: GridPosition, columns: number, rows: number): GridPosition {
|
|
146
|
+
const axis = (start: number, span: number, count: number) => {
|
|
147
|
+
const nextSpan = Math.min(span, count)
|
|
148
|
+
return {
|
|
149
|
+
start: start === 0 ? 0 : Math.max(1, Math.min(start, count - nextSpan + 1)),
|
|
150
|
+
span: nextSpan
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
const column = axis(position.column, position.columnSpan, columns)
|
|
154
|
+
const row = axis(position.row, position.rowSpan, rows)
|
|
155
|
+
return {
|
|
156
|
+
column: column.start,
|
|
157
|
+
columnSpan: column.span,
|
|
158
|
+
row: row.start,
|
|
159
|
+
rowSpan: row.span
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
function normalizedGridPosition(position: GridPosition): GridPosition | null {
|
|
164
|
+
const whole = (value: number, min: number) => Math.max(min, Math.round(value))
|
|
165
|
+
const next = {
|
|
166
|
+
column: whole(position.column, 0),
|
|
167
|
+
row: whole(position.row, 0),
|
|
168
|
+
columnSpan: whole(position.columnSpan, 1),
|
|
169
|
+
rowSpan: whole(position.rowSpan, 1)
|
|
170
|
+
}
|
|
171
|
+
const auto = next.column === 0 && next.row === 0 && next.columnSpan === 1 && next.rowSpan === 1
|
|
172
|
+
return auto ? null : next
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
function sameGridPosition(current: GridPosition | null, next: GridPosition | null): boolean {
|
|
176
|
+
if (!current || !next) return current === next
|
|
177
|
+
return (
|
|
178
|
+
current.column === next.column &&
|
|
179
|
+
current.row === next.row &&
|
|
180
|
+
current.columnSpan === next.columnSpan &&
|
|
181
|
+
current.rowSpan === next.rowSpan
|
|
182
|
+
)
|
|
55
183
|
}
|
|
56
184
|
|
|
57
185
|
function layoutModeUpdates(
|
package/src/editor/nodes.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { isEqual } from 'es-toolkit'
|
|
1
2
|
import { pick } from 'es-toolkit/object'
|
|
2
3
|
|
|
3
4
|
import type { SceneNode } from '@pairdraw/scene-graph'
|
|
@@ -9,6 +10,12 @@ import {
|
|
|
9
10
|
} from '@pairdraw/scene-graph/instances'
|
|
10
11
|
import { cloneInstanceOverrideState } from '@pairdraw/scene-graph/instances/overrides'
|
|
11
12
|
import { styleDetachmentChanges } from '@pairdraw/scene-graph/shared-styles'
|
|
13
|
+
import {
|
|
14
|
+
enclosingSlotScope,
|
|
15
|
+
restoreSlotClaim,
|
|
16
|
+
snapshotSlotClaim,
|
|
17
|
+
type SlotClaimSnapshot
|
|
18
|
+
} from '@pairdraw/scene-graph/slots'
|
|
12
19
|
import { strokeLineChanges } from '@pairdraw/scene-graph/strokes'
|
|
13
20
|
|
|
14
21
|
import { groupFitOptions } from '#core/canvas/boolean'
|
|
@@ -43,6 +50,21 @@ function layOutByParent(ctx: EditorContext, id: string): boolean {
|
|
|
43
50
|
return parent !== undefined && parent.layoutMode !== 'NONE'
|
|
44
51
|
}
|
|
45
52
|
|
|
53
|
+
/** The fields whose value the edit really changes, so a no-op write neither records nor claims. */
|
|
54
|
+
function changedOverrideFields(node: SceneNode, changes: Partial<SceneNode>): string[] {
|
|
55
|
+
return instanceOverrideFields(node, changes).filter(
|
|
56
|
+
(field) => !isEqual(node[field as keyof SceneNode], changes[field as keyof SceneNode])
|
|
57
|
+
)
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
/** The slot claim this edit would make, captured before the write for the undo step. */
|
|
61
|
+
function slotClaimBeforeEdit(graph: EditorContext['graph'], id: string): SlotClaimSnapshot | null {
|
|
62
|
+
const parentId = graph.getNode(id)?.parentId
|
|
63
|
+
if (!parentId) return null
|
|
64
|
+
const scope = enclosingSlotScope(graph, parentId)
|
|
65
|
+
return scope ? snapshotSlotClaim(graph, scope) : null
|
|
66
|
+
}
|
|
67
|
+
|
|
46
68
|
export function createNodeActions(ctx: EditorContext) {
|
|
47
69
|
// Function declarations below are hoisted, so the preview can wrap updateNode here.
|
|
48
70
|
const previewActions = createNodePreviewActions(ctx, updateNode)
|
|
@@ -72,9 +94,9 @@ export function createNodeActions(ctx: EditorContext) {
|
|
|
72
94
|
...textAutoResizeChanges(node, changes),
|
|
73
95
|
...pathTextEditChanges(node, changes)
|
|
74
96
|
})
|
|
75
|
-
const overridden =
|
|
97
|
+
const overridden = changedOverrideFields(node, nextChanges)
|
|
76
98
|
ctx.graph.updateNode(id, nextChanges)
|
|
77
|
-
recordInstanceOverride(ctx.graph, id, overridden)
|
|
99
|
+
if (overridden.length > 0) recordInstanceOverride(ctx.graph, id, overridden)
|
|
78
100
|
// The groups around the layer fit in the step that records the edit, so undo takes the box
|
|
79
101
|
// back with the layer. This call changes no step: a drag writes here between its own steps.
|
|
80
102
|
runChangedLayout(id, nextChanges)
|
|
@@ -116,9 +138,11 @@ export function createNodeActions(ctx: EditorContext) {
|
|
|
116
138
|
...(Object.keys(nextChanges) as (keyof SceneNode)[]),
|
|
117
139
|
...(restoreSize ? (['width', 'height'] as const) : [])
|
|
118
140
|
]) as Partial<SceneNode>
|
|
119
|
-
|
|
141
|
+
// Claiming the slot is part of this step, so undo has to release it again.
|
|
142
|
+
const slotClaim = slotClaimBeforeEdit(ctx.graph, id)
|
|
143
|
+
const overridden = changedOverrideFields(node, nextChanges)
|
|
120
144
|
ctx.graph.updateNode(id, nextChanges)
|
|
121
|
-
recordInstanceOverride(ctx.graph, id, overridden)
|
|
145
|
+
if (overridden.length > 0) recordInstanceOverride(ctx.graph, id, overridden)
|
|
122
146
|
runChangedLayout(id, nextChanges, false)
|
|
123
147
|
// A group's box follows its children, so the fit goes in this step: it moves the layer's own
|
|
124
148
|
// coordinates too, and undo has to put both back. A layer an auto layout frame places is
|
|
@@ -134,7 +158,7 @@ export function createNodeActions(ctx: EditorContext) {
|
|
|
134
158
|
label,
|
|
135
159
|
forward: () => {
|
|
136
160
|
ctx.graph.updateNode(id, nextChanges)
|
|
137
|
-
recordInstanceOverride(ctx.graph, id, overridden)
|
|
161
|
+
if (overridden.length > 0) recordInstanceOverride(ctx.graph, id, overridden)
|
|
138
162
|
runChangedLayout(id, nextChanges, false)
|
|
139
163
|
if (fit) redoGroupFit(ctx.graph, fit)
|
|
140
164
|
},
|
|
@@ -145,6 +169,7 @@ export function createNodeActions(ctx: EditorContext) {
|
|
|
145
169
|
ctx.graph.updateNode(owner.id, {
|
|
146
170
|
instanceOverrides: cloneInstanceOverrideState(previousOverrides)
|
|
147
171
|
})
|
|
172
|
+
if (slotClaim) restoreSlotClaim(ctx.graph, slotClaim)
|
|
148
173
|
runChangedLayout(id, nextChanges, false)
|
|
149
174
|
}
|
|
150
175
|
})
|
|
@@ -11,7 +11,9 @@ export const READ_ONLY_ACTIONS: ReadonlySet<string> = new Set([
|
|
|
11
11
|
'acceptsChildren',
|
|
12
12
|
'canArrangeNodes',
|
|
13
13
|
'canAutoArrangeNodes',
|
|
14
|
+
'canCombineComponentsAsVariants',
|
|
14
15
|
'canConvertToFrame',
|
|
16
|
+
'canPushInstanceOverrides',
|
|
15
17
|
'canCreateVariations',
|
|
16
18
|
'canDistributeNodes',
|
|
17
19
|
'canEditImage',
|
|
@@ -35,6 +37,8 @@ export const READ_ONLY_ACTIONS: ReadonlySet<string> = new Set([
|
|
|
35
37
|
'getImage',
|
|
36
38
|
'getInstanceComponentPropertyDefinitions',
|
|
37
39
|
'getInstanceComponentPropertyValue',
|
|
40
|
+
'instanceHasOverrides',
|
|
41
|
+
'layerHasOverrides',
|
|
38
42
|
'getLayerTree',
|
|
39
43
|
'getNode',
|
|
40
44
|
'getPages',
|
|
@@ -43,6 +47,7 @@ export const READ_ONLY_ACTIONS: ReadonlySet<string> = new Set([
|
|
|
43
47
|
'getShownStatus',
|
|
44
48
|
'getTextHyperlink',
|
|
45
49
|
'getTextSelectionStyle',
|
|
50
|
+
'isTextStyleMixed',
|
|
46
51
|
'getVariable',
|
|
47
52
|
'getVariableCount',
|
|
48
53
|
'getVariablesByType',
|
|
@@ -88,6 +93,7 @@ export const READ_ONLY_ACTIONS: ReadonlySet<string> = new Set([
|
|
|
88
93
|
'setHoveredNode',
|
|
89
94
|
'setMarquee',
|
|
90
95
|
'setMeasurementMode',
|
|
96
|
+
'setLayoutSpacingPreview',
|
|
91
97
|
'setTool',
|
|
92
98
|
'validateEnteredContainer',
|
|
93
99
|
|
|
@@ -107,6 +107,13 @@ export function createSelectionOverlayActions(ctx: EditorContext) {
|
|
|
107
107
|
ctx.requestRepaint()
|
|
108
108
|
}
|
|
109
109
|
|
|
110
|
+
/** Shows a flow layer's padding and gap bands while its spacing control is in use. */
|
|
111
|
+
function setLayoutSpacingPreview(nodeId: string | null) {
|
|
112
|
+
if (ctx.state.layoutSpacingNodeId === nodeId) return
|
|
113
|
+
ctx.state.layoutSpacingNodeId = nodeId
|
|
114
|
+
ctx.requestRepaint()
|
|
115
|
+
}
|
|
116
|
+
|
|
110
117
|
function setConnectorTarget(target: ConnectorTarget | null) {
|
|
111
118
|
if (isEqual(ctx.state.connectorTarget, target)) return
|
|
112
119
|
ctx.state.connectorTarget = target
|
|
@@ -136,6 +143,7 @@ export function createSelectionOverlayActions(ctx: EditorContext) {
|
|
|
136
143
|
setRenamingLabel,
|
|
137
144
|
setLayoutInsertIndicator,
|
|
138
145
|
setAutoLayoutHover,
|
|
146
|
+
setLayoutSpacingPreview,
|
|
139
147
|
setShapeHandleHover
|
|
140
148
|
}
|
|
141
149
|
}
|
|
@@ -9,6 +9,7 @@ export function createDefaultEditorSharedState(): EditorSharedState {
|
|
|
9
9
|
documentKind: 'design',
|
|
10
10
|
snappingPreferences: { ...DEFAULT_SNAPPING_PREFERENCES },
|
|
11
11
|
showPixelGrid: true,
|
|
12
|
+
showLayoutGrids: true,
|
|
12
13
|
gradientEdit: null,
|
|
13
14
|
imageEdit: null,
|
|
14
15
|
presenceCursors: [],
|
package/src/editor/state/view.ts
CHANGED
|
@@ -22,6 +22,7 @@ export function createDefaultEditorViewState(pageId: string): EditorViewState {
|
|
|
22
22
|
penCursorY: null,
|
|
23
23
|
pencilState: null,
|
|
24
24
|
autoLayoutHover: null,
|
|
25
|
+
layoutSpacingNodeId: null,
|
|
25
26
|
shapeHandleHover: null,
|
|
26
27
|
connectorTarget: null,
|
|
27
28
|
panX: 0,
|
|
@@ -51,6 +52,7 @@ export function copyEditorViewState(source: EditorViewState): EditorViewState {
|
|
|
51
52
|
penState: structuredClone(source.penState),
|
|
52
53
|
pencilState: structuredClone(source.pencilState),
|
|
53
54
|
autoLayoutHover: structuredClone(source.autoLayoutHover),
|
|
55
|
+
layoutSpacingNodeId: source.layoutSpacingNodeId,
|
|
54
56
|
shapeHandleHover: structuredClone(source.shapeHandleHover),
|
|
55
57
|
connectorTarget: structuredClone(source.connectorTarget),
|
|
56
58
|
pageColor: { ...source.pageColor },
|
|
@@ -6,6 +6,7 @@ import {
|
|
|
6
6
|
type GroupFit,
|
|
7
7
|
type GroupFitOptions
|
|
8
8
|
} from '@pairdraw/scene-graph/group-bounds'
|
|
9
|
+
import { assertGroupPlacement, slotScope } from '@pairdraw/scene-graph/slots'
|
|
9
10
|
|
|
10
11
|
import { canMakeBooleanSourceNode, groupFitOptions } from '#core/canvas/boolean'
|
|
11
12
|
import { restoreSubtree, snapshotSubtree } from '#core/editor/history/subtree'
|
|
@@ -59,10 +60,37 @@ export function booleanOperationSelected(
|
|
|
59
60
|
selectedNodes: SceneNode[],
|
|
60
61
|
operation: BooleanOperation
|
|
61
62
|
) {
|
|
63
|
+
// Figma changes a selected boolean group in place instead of wrapping it in another boolean.
|
|
64
|
+
const existing = selectedNodes.length === 1 ? selectedNodes[0] : undefined
|
|
65
|
+
if (existing?.type === 'BOOLEAN_OPERATION') {
|
|
66
|
+
// The operation is part of the component's structure, not an instance override, so a copy
|
|
67
|
+
// inside a locked instance keeps the operation its component has.
|
|
68
|
+
if (existing.parentId && slotScope(ctx.graph, existing.parentId).kind === 'locked') return null
|
|
69
|
+
const before = existing.booleanOperation
|
|
70
|
+
if (before === undefined || before === operation) return null
|
|
71
|
+
const apply = (next: BooleanOperation) => {
|
|
72
|
+
ctx.graph.updateNode(existing.id, { booleanOperation: next })
|
|
73
|
+
ctx.runLayoutForNode(existing.id)
|
|
74
|
+
}
|
|
75
|
+
apply(operation)
|
|
76
|
+
ctx.undo.push({
|
|
77
|
+
label: operationLabel(operation),
|
|
78
|
+
forward: () => apply(operation),
|
|
79
|
+
inverse: () => apply(before)
|
|
80
|
+
})
|
|
81
|
+
return ctx.graph.getNode(existing.id) ?? null
|
|
82
|
+
}
|
|
83
|
+
|
|
62
84
|
const selection = selectedNodesInSharedParent(ctx, selectedNodes)
|
|
63
85
|
if (!selection || selection.topLevel.length < 2) return null
|
|
64
86
|
const { parentId, parent } = selection
|
|
65
87
|
if (selection.topLevel.some((node) => !canMakeBooleanSourceNode(node, ctx.graph))) return null
|
|
88
|
+
assertGroupPlacement(
|
|
89
|
+
ctx.graph,
|
|
90
|
+
parentId,
|
|
91
|
+
selection.topLevel.map((node) => node.id),
|
|
92
|
+
'boolean operation'
|
|
93
|
+
)
|
|
66
94
|
|
|
67
95
|
const operands = inStackOrder(ctx.graph, selection.topLevel, parentId)
|
|
68
96
|
const prevSelection = new Set(ctx.state.selectedIds)
|
|
@@ -124,7 +152,7 @@ export function booleanOperationSelected(
|
|
|
124
152
|
}
|
|
125
153
|
})
|
|
126
154
|
|
|
127
|
-
return booleanId
|
|
155
|
+
return ctx.graph.getNode(booleanId) ?? null
|
|
128
156
|
}
|
|
129
157
|
|
|
130
158
|
function operationLabel(operation: BooleanOperation) {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { SceneGraph, SceneNode } from '@pairdraw/scene-graph'
|
|
2
2
|
import { getAxisAlignedBoundsInParent } from '@pairdraw/scene-graph/coordinate'
|
|
3
3
|
import { groupBounds } from '@pairdraw/scene-graph/group-bounds'
|
|
4
|
+
import { slotScope } from '@pairdraw/scene-graph/slots'
|
|
4
5
|
|
|
5
6
|
import { prepareSlotEdits } from '#core/editor/components/slots'
|
|
6
7
|
import { nextNumberedName } from '#core/editor/structure/rename'
|
|
@@ -29,14 +30,26 @@ const NUMBERED_WHEN_WRAPPED: ReadonlySet<WrapContainerType> = new Set([
|
|
|
29
30
|
|
|
30
31
|
/**
|
|
31
32
|
* The parent these layers share when a new container may go there, or null when they are not
|
|
32
|
-
* siblings or sit in the locked part of an instance.
|
|
33
|
+
* siblings or sit in the locked part of an instance. Reads only: callers that need a slot
|
|
34
|
+
* claimed for the edit do it through `wrapParentId`.
|
|
33
35
|
*/
|
|
34
|
-
export function
|
|
36
|
+
export function wrappableParentId(ctx: EditorContext, nodes: readonly SceneNode[]): string | null {
|
|
35
37
|
const first = nodes.at(0)
|
|
36
38
|
if (!first) return null
|
|
37
39
|
const parentId = first.parentId ?? ctx.state.currentPageId
|
|
38
40
|
if (nodes.some((node) => (node.parentId ?? ctx.state.currentPageId) !== parentId)) return null
|
|
39
|
-
|
|
41
|
+
if (ctx.graph.getNode(parentId)?.type === 'SLICE') return null
|
|
42
|
+
if (slotScope(ctx.graph, parentId).kind === 'locked') return null
|
|
43
|
+
return parentId
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* The parent that may take a new container, claiming an untouched slot first so the edit lands
|
|
48
|
+
* in content the instance owns. This mutates; capability checks use `wrappableParentId`.
|
|
49
|
+
*/
|
|
50
|
+
export function wrapParentId(ctx: EditorContext, nodes: readonly SceneNode[]): string | null {
|
|
51
|
+
const parentId = wrappableParentId(ctx, nodes)
|
|
52
|
+
return parentId && prepareSlotEdits(ctx, [parentId]) ? parentId : null
|
|
40
53
|
}
|
|
41
54
|
|
|
42
55
|
/**
|
|
@@ -117,7 +130,10 @@ export function wrapSelectionInContainer(
|
|
|
117
130
|
ctx.setSelectedIds(new Set([containerId]))
|
|
118
131
|
|
|
119
132
|
ctx.undo.push({
|
|
120
|
-
label:
|
|
133
|
+
label:
|
|
134
|
+
containerType === 'COMPONENT_SET'
|
|
135
|
+
? 'Combine as variants'
|
|
136
|
+
: `Create ${containerType.toLowerCase().replace('_', ' ')}`,
|
|
121
137
|
forward: () => {
|
|
122
138
|
const nodes = origPositions.flatMap((n) => ctx.graph.getNode(n.id) ?? [])
|
|
123
139
|
wrapNodes(ctx.graph, containerType, nodes, parentId, index, {
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import type { SceneNode } from '@pairdraw/scene-graph'
|
|
2
|
+
import { assertGroupPlacement } from '@pairdraw/scene-graph/slots'
|
|
2
3
|
|
|
3
|
-
import { canMakeBooleanSourceNode } from '#core/canvas/boolean'
|
|
4
|
-
import { flattenNodesToVectorProps } from '#core/canvas/flatten'
|
|
4
|
+
import { canContainFlattenableChildren, canMakeBooleanSourceNode } from '#core/canvas/boolean'
|
|
5
|
+
import { flattenLayerToVectorProps, flattenNodesToVectorProps } from '#core/canvas/flatten'
|
|
5
6
|
import { restoreSubtree, snapshotSubtree } from '#core/editor/history/subtree'
|
|
6
7
|
import type { EditorContext } from '#core/editor/types'
|
|
7
8
|
|
|
@@ -24,25 +25,31 @@ export function flattenSelected(
|
|
|
24
25
|
const canFlattenNode =
|
|
25
26
|
options.canFlattenNode ?? ((node: SceneNode) => canMakeBooleanSourceNode(node, ctx.graph))
|
|
26
27
|
const vectorPropsFactory = options.vectorPropsFactory ?? flattenNodesToVectorProps
|
|
27
|
-
const renderer = ctx.getRenderer()
|
|
28
|
-
if (!renderer) return null
|
|
29
28
|
|
|
30
29
|
const selection = selectedNodesInSharedParent(ctx, selectedNodes)
|
|
31
30
|
if (!selection) return null
|
|
32
31
|
const { topLevel, parentId, parent } = selection
|
|
33
32
|
if (topLevel.some((node) => !canFlattenNode(node))) return null
|
|
34
|
-
|
|
35
33
|
const childIds = topLevel.map((node) => node.id)
|
|
34
|
+
assertGroupPlacement(ctx.graph, parentId, childIds, 'flatten')
|
|
35
|
+
const renderer = ctx.getRenderer()
|
|
36
|
+
if (!renderer) return null
|
|
36
37
|
const childSnapshots = childIds.map((id) => ({ id, subtree: snapshotSubtree(ctx.graph, id) }))
|
|
37
38
|
const prevSelection = new Set(ctx.state.selectedIds)
|
|
38
39
|
const firstIndex = Math.min(...childIds.map((id) => parent.childIds.indexOf(id)))
|
|
39
|
-
|
|
40
|
+
// One layer keeps its own appearance, as Figma's Flatten does; several become one silhouette
|
|
41
|
+
// painted with the topmost layer's fills, and a container keeps giving its children's shapes.
|
|
42
|
+
const vectorProps =
|
|
43
|
+
!options.vectorPropsFactory &&
|
|
44
|
+
topLevel.length === 1 &&
|
|
45
|
+
!canContainFlattenableChildren(topLevel[0])
|
|
46
|
+
? flattenLayerToVectorProps(renderer, ctx.graph, topLevel[0])
|
|
47
|
+
: vectorPropsFactory(renderer, ctx.graph, topLevel)
|
|
40
48
|
if (!vectorProps) return null
|
|
41
49
|
|
|
42
50
|
const vector = ctx.graph.createNode('VECTOR', parentId, {
|
|
43
51
|
...vectorProps,
|
|
44
|
-
name: label
|
|
45
|
-
strokes: []
|
|
52
|
+
name: label
|
|
46
53
|
})
|
|
47
54
|
const vectorSnapshot = structuredClone(vector)
|
|
48
55
|
ctx.graph.insertChildAt(vector.id, parentId, firstIndex)
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { SceneGraph, SceneNode } from '@pairdraw/scene-graph'
|
|
2
|
+
import { assertChildPlacement } from '@pairdraw/scene-graph/slots'
|
|
2
3
|
|
|
3
4
|
import type { EditorContext } from '#core/editor/types'
|
|
4
5
|
|
|
@@ -11,6 +12,7 @@ export function ungroupNode(graph: SceneGraph, nodeId: string): string[] | null
|
|
|
11
12
|
const node = graph.getNode(nodeId)
|
|
12
13
|
const parent = node?.parentId ? graph.getNode(node.parentId) : undefined
|
|
13
14
|
if (!node || !parent) return null
|
|
15
|
+
assertChildPlacement(graph, parent.id, 'ungroup')
|
|
14
16
|
const index = parent.childIds.indexOf(node.id)
|
|
15
17
|
const childIds = [...node.childIds]
|
|
16
18
|
childIds.forEach((id, i) => {
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { SceneNode } from '@pairdraw/scene-graph'
|
|
2
|
+
import { assertChildPlacement, assertNodeMovable } from '@pairdraw/scene-graph/slots'
|
|
2
3
|
|
|
3
4
|
import {
|
|
4
5
|
layersToOutline,
|
|
@@ -58,6 +59,10 @@ export function outlineStrokeSelected(
|
|
|
58
59
|
const plan: Outlining[] = []
|
|
59
60
|
for (const node of layersToOutline(selectedNodes, ctx.graph)) {
|
|
60
61
|
const parent = node.parentId ? ctx.graph.getNode(node.parentId) : undefined
|
|
62
|
+
if (parent) {
|
|
63
|
+
assertChildPlacement(ctx.graph, parent.id, 'Outline stroke')
|
|
64
|
+
assertNodeMovable(ctx.graph, node.id, 'Outline stroke')
|
|
65
|
+
}
|
|
61
66
|
const outlined = parent ? outlineStrokeLayer(renderer, node, ctx.graph) : null
|
|
62
67
|
if (!parent || !outlined) continue
|
|
63
68
|
plan.push({
|