@pairdraw/core 0.19.1 → 0.20.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/ai/providers.d.ts +6 -0
- package/dist/ai/providers.d.ts.map +1 -1
- package/dist/ai/providers.js.map +1 -1
- package/dist/cache/resource.d.ts +8 -1
- package/dist/cache/resource.d.ts.map +1 -1
- package/dist/cache/resource.js +18 -0
- package/dist/cache/resource.js.map +1 -1
- package/dist/canvas/effects.d.ts +6 -4
- package/dist/canvas/effects.d.ts.map +1 -1
- package/dist/canvas/effects.js +37 -34
- package/dist/canvas/effects.js.map +1 -1
- package/dist/canvas/fills.d.ts.map +1 -1
- package/dist/canvas/fills.js +12 -8
- package/dist/canvas/fills.js.map +1 -1
- package/dist/canvas/images/adjustments.d.ts +18 -0
- package/dist/canvas/images/adjustments.d.ts.map +1 -0
- package/dist/canvas/images/adjustments.js +184 -0
- package/dist/canvas/images/adjustments.js.map +1 -0
- package/dist/canvas/images/previews.d.ts +1 -1
- package/dist/canvas/images/sampling.d.ts +13 -0
- package/dist/canvas/images/sampling.d.ts.map +1 -0
- package/dist/canvas/images/sampling.js +49 -0
- package/dist/canvas/images/sampling.js.map +1 -0
- package/dist/canvas/index.d.ts +2 -2
- package/dist/canvas/masks.d.ts +1 -1
- package/dist/canvas/masks.d.ts.map +1 -1
- package/dist/canvas/masks.js.map +1 -1
- package/dist/canvas/noise/render.d.ts +15 -0
- package/dist/canvas/noise/render.d.ts.map +1 -0
- package/dist/canvas/noise/render.js +56 -0
- package/dist/canvas/noise/render.js.map +1 -0
- package/dist/canvas/noise/shader.d.ts +43 -0
- package/dist/canvas/noise/shader.d.ts.map +1 -0
- package/dist/canvas/noise/shader.js +161 -0
- package/dist/canvas/noise/shader.js.map +1 -0
- package/dist/canvas/noise/table.d.ts +13 -0
- package/dist/canvas/noise/table.d.ts.map +1 -0
- package/dist/canvas/noise/table.js +408 -0
- package/dist/canvas/noise/table.js.map +1 -0
- package/dist/canvas/noise/tile.d.ts +22 -0
- package/dist/canvas/noise/tile.d.ts.map +1 -0
- package/dist/canvas/noise/tile.js +73 -0
- package/dist/canvas/noise/tile.js.map +1 -0
- package/dist/canvas/outline-stroke.js +1 -1
- package/dist/canvas/overlays/auto-layout-hover.d.ts.map +1 -1
- package/dist/canvas/overlays/auto-layout-hover.js +31 -71
- package/dist/canvas/overlays/auto-layout-hover.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/selection.d.ts +1 -2
- package/dist/canvas/overlays/selection.d.ts.map +1 -1
- package/dist/canvas/overlays/selection.js +2 -9
- package/dist/canvas/overlays/selection.js.map +1 -1
- package/dist/canvas/renderer/chunks/index.d.ts +1 -1
- package/dist/canvas/renderer/fonts.d.ts.map +1 -1
- package/dist/canvas/renderer/fonts.js +2 -0
- package/dist/canvas/renderer/fonts.js.map +1 -1
- package/dist/canvas/renderer/lifecycle.d.ts.map +1 -1
- package/dist/canvas/renderer/lifecycle.js +6 -0
- package/dist/canvas/renderer/lifecycle.js.map +1 -1
- package/dist/canvas/renderer/methods.d.ts +0 -1
- package/dist/canvas/renderer/methods.d.ts.map +1 -1
- package/dist/canvas/renderer/methods.js +1 -4
- 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 +0 -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 +13 -2
- package/dist/canvas/renderer/pipeline.js.map +1 -1
- package/dist/canvas/renderer/play-scenes.d.ts +13 -0
- package/dist/canvas/renderer/play-scenes.d.ts.map +1 -0
- package/dist/canvas/renderer/play-scenes.js +40 -0
- package/dist/canvas/renderer/play-scenes.js.map +1 -0
- package/dist/canvas/renderer/tiles/cache.d.ts +19 -1
- package/dist/canvas/renderer/tiles/cache.d.ts.map +1 -1
- package/dist/canvas/renderer/tiles/cache.js +32 -1
- package/dist/canvas/renderer/tiles/cache.js.map +1 -1
- package/dist/canvas/renderer/tiles/controller.d.ts +11 -0
- package/dist/canvas/renderer/tiles/controller.d.ts.map +1 -1
- package/dist/canvas/renderer/tiles/controller.js +18 -1
- package/dist/canvas/renderer/tiles/controller.js.map +1 -1
- package/dist/canvas/renderer/tiles/index.d.ts +2 -2
- package/dist/canvas/renderer/tiles/planner.d.ts +1 -1
- package/dist/canvas/renderer/types.d.ts +18 -4
- package/dist/canvas/renderer/types.d.ts.map +1 -1
- package/dist/canvas/renderer/visual-bounds.d.ts +1 -1
- package/dist/canvas/renderer/visual-bounds.js +1 -1
- package/dist/canvas/renderer.d.ts +22 -3
- package/dist/canvas/renderer.d.ts.map +1 -1
- package/dist/canvas/renderer.js +29 -1
- package/dist/canvas/renderer.js.map +1 -1
- package/dist/canvas/scene.d.ts +2 -1
- package/dist/canvas/scene.d.ts.map +1 -1
- package/dist/canvas/scene.js +41 -9
- package/dist/canvas/scene.js.map +1 -1
- package/dist/canvas/shadows/silhouette.js +1 -1
- package/dist/canvas/texture.d.ts +20 -0
- package/dist/canvas/texture.d.ts.map +1 -0
- package/dist/canvas/texture.js +100 -0
- package/dist/canvas/texture.js.map +1 -0
- package/dist/clipboard.js +16 -5
- package/dist/clipboard.js.map +1 -1
- package/dist/constants.d.ts +5 -1
- package/dist/constants.d.ts.map +1 -1
- package/dist/constants.js +5 -1
- package/dist/constants.js.map +1 -1
- package/dist/design-jsx/index.d.ts +2 -2
- package/dist/design-jsx/index.js +2 -2
- package/dist/design-jsx/renderer.d.ts +3 -2
- package/dist/design-jsx/renderer.d.ts.map +1 -1
- package/dist/design-jsx/renderer.js +2 -2
- package/dist/design-jsx/renderer.js.map +1 -1
- package/dist/design-memory/check.d.ts +90 -0
- package/dist/design-memory/check.d.ts.map +1 -0
- package/dist/design-memory/check.js +281 -0
- package/dist/design-memory/check.js.map +1 -0
- package/dist/design-memory/describe.d.ts +37 -0
- package/dist/design-memory/describe.d.ts.map +1 -0
- package/dist/design-memory/describe.js +52 -0
- package/dist/design-memory/describe.js.map +1 -0
- package/dist/design-memory/distil.d.ts +22 -0
- package/dist/design-memory/distil.d.ts.map +1 -0
- package/dist/design-memory/distil.js +54 -0
- package/dist/design-memory/distil.js.map +1 -0
- package/dist/design-memory/document.d.ts +12 -0
- package/dist/design-memory/document.d.ts.map +1 -0
- package/dist/design-memory/document.js +64 -0
- package/dist/design-memory/document.js.map +1 -0
- package/dist/design-memory/guard.d.ts +48 -0
- package/dist/design-memory/guard.d.ts.map +1 -0
- package/dist/design-memory/guard.js +105 -0
- package/dist/design-memory/guard.js.map +1 -0
- package/dist/design-memory/index.d.ts +9 -0
- package/dist/design-memory/index.js +9 -0
- package/dist/design-memory/refusal.d.ts +32 -0
- package/dist/design-memory/refusal.d.ts.map +1 -0
- package/dist/design-memory/refusal.js +68 -0
- package/dist/design-memory/refusal.js.map +1 -0
- package/dist/design-memory/rules.d.ts +63 -0
- package/dist/design-memory/rules.d.ts.map +1 -0
- package/dist/design-memory/rules.js +224 -0
- package/dist/design-memory/rules.js.map +1 -0
- package/dist/design-memory/values.d.ts +28 -0
- package/dist/design-memory/values.d.ts.map +1 -0
- package/dist/design-memory/values.js +160 -0
- package/dist/design-memory/values.js.map +1 -0
- package/dist/editor/alignment.js +1 -1
- package/dist/editor/bridges/components.d.ts +2 -0
- package/dist/editor/bridges/components.d.ts.map +1 -1
- package/dist/editor/bridges/components.js +2 -0
- package/dist/editor/bridges/components.js.map +1 -1
- package/dist/editor/bridges/undo.d.ts +1 -1
- package/dist/editor/clipboard/assets.js +1 -1
- package/dist/editor/clipboard/export.d.ts.map +1 -1
- package/dist/editor/clipboard/export.js +16 -2
- package/dist/editor/clipboard/export.js.map +1 -1
- package/dist/editor/clipboard/placement.d.ts +1 -1
- package/dist/editor/clipboard/placement.js +1 -1
- package/dist/editor/clipboard/snapshot.d.ts.map +1 -1
- package/dist/editor/clipboard/snapshot.js +12 -4
- package/dist/editor/clipboard/snapshot.js.map +1 -1
- package/dist/editor/clipboard.d.ts.map +1 -1
- package/dist/editor/clipboard.js +2 -7
- package/dist/editor/clipboard.js.map +1 -1
- package/dist/editor/color-space.d.ts.map +1 -1
- package/dist/editor/color-space.js +33 -38
- package/dist/editor/color-space.js.map +1 -1
- package/dist/editor/components/instances.d.ts +2 -0
- package/dist/editor/components/instances.d.ts.map +1 -1
- package/dist/editor/components/instances.js +22 -1
- package/dist/editor/components/instances.js.map +1 -1
- package/dist/editor/components.d.ts +2 -0
- package/dist/editor/components.d.ts.map +1 -1
- package/dist/editor/connectors/attach.js +1 -1
- package/dist/editor/create.d.ts +36 -8
- package/dist/editor/create.d.ts.map +1 -1
- package/dist/editor/create.js +26 -61
- package/dist/editor/create.js.map +1 -1
- package/dist/editor/design-memory.d.ts +11 -0
- package/dist/editor/design-memory.d.ts.map +1 -0
- package/dist/editor/design-memory.js +40 -0
- package/dist/editor/design-memory.js.map +1 -0
- package/dist/editor/design-tokens.d.ts +4 -0
- package/dist/editor/design-tokens.d.ts.map +1 -1
- package/dist/editor/design-tokens.js +30 -1
- package/dist/editor/design-tokens.js.map +1 -1
- package/dist/editor/document-colors.d.ts +23 -0
- package/dist/editor/document-colors.d.ts.map +1 -0
- package/dist/editor/document-colors.js +53 -0
- package/dist/editor/document-colors.js.map +1 -0
- package/dist/editor/eyedropper.d.ts +47 -0
- package/dist/editor/eyedropper.d.ts.map +1 -0
- package/dist/editor/eyedropper.js +168 -0
- package/dist/editor/eyedropper.js.map +1 -0
- package/dist/editor/fonts.d.ts +9 -0
- package/dist/editor/fonts.d.ts.map +1 -0
- package/dist/editor/fonts.js +14 -0
- package/dist/editor/fonts.js.map +1 -0
- package/dist/editor/history/atomic-tool.d.ts +9 -2
- package/dist/editor/history/atomic-tool.d.ts.map +1 -1
- package/dist/editor/history/atomic-tool.js +6 -0
- package/dist/editor/history/atomic-tool.js.map +1 -1
- package/dist/editor/history/capture.d.ts +13 -0
- package/dist/editor/history/capture.d.ts.map +1 -0
- package/dist/editor/history/capture.js +28 -0
- package/dist/editor/history/capture.js.map +1 -0
- package/dist/editor/history/document-change.d.ts.map +1 -1
- package/dist/editor/history/document-change.js +2 -22
- package/dist/editor/history/document-change.js.map +1 -1
- package/dist/editor/history/edit.d.ts +7 -0
- package/dist/editor/history/edit.d.ts.map +1 -1
- package/dist/editor/history/edit.js +6 -3
- package/dist/editor/history/edit.js.map +1 -1
- package/dist/editor/history/subtree.d.ts +9 -0
- package/dist/editor/history/subtree.d.ts.map +1 -1
- package/dist/editor/history/subtree.js +12 -2
- package/dist/editor/history/subtree.js.map +1 -1
- package/dist/editor/index.d.ts +4 -2
- package/dist/editor/index.js +4 -2
- package/dist/editor/nudge.js +1 -1
- package/dist/editor/nudge.js.map +1 -1
- package/dist/editor/pages.d.ts +7 -5
- package/dist/editor/pages.d.ts.map +1 -1
- package/dist/editor/pages.js +35 -25
- package/dist/editor/pages.js.map +1 -1
- package/dist/editor/play/states.d.ts +3 -1
- package/dist/editor/play/states.d.ts.map +1 -1
- package/dist/editor/play/states.js +1 -1
- package/dist/editor/play/states.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/render-requests.d.ts +18 -0
- package/dist/editor/render-requests.d.ts.map +1 -0
- package/dist/editor/render-requests.js +76 -0
- package/dist/editor/render-requests.js.map +1 -0
- package/dist/editor/scale/rescale.d.ts +1 -1
- package/dist/editor/selection/container.d.ts +2 -0
- package/dist/editor/selection/container.d.ts.map +1 -1
- package/dist/editor/selection/container.js +17 -1
- package/dist/editor/selection/container.js.map +1 -1
- package/dist/editor/selection/navigation.js +7 -4
- package/dist/editor/selection/navigation.js.map +1 -1
- package/dist/editor/selection/overlays.d.ts.map +1 -1
- package/dist/editor/selection/overlays.js +1 -1
- package/dist/editor/selection/overlays.js.map +1 -1
- package/dist/editor/selection/read.d.ts +6 -2
- package/dist/editor/selection.d.ts +9 -2
- package/dist/editor/selection.d.ts.map +1 -1
- package/dist/editor/shapes/with-text.d.ts.map +1 -1
- package/dist/editor/shapes/with-text.js +2 -5
- package/dist/editor/shapes/with-text.js.map +1 -1
- package/dist/editor/structure/auto-layout-wrap.js +1 -1
- package/dist/editor/structure/auto-layout-wrap.js.map +1 -1
- package/dist/editor/structure/boolean.d.ts +2 -3
- package/dist/editor/structure/boolean.d.ts.map +1 -1
- package/dist/editor/structure/boolean.js.map +1 -1
- package/dist/editor/structure/group/bounds.d.ts.map +1 -1
- package/dist/editor/structure/group/bounds.js +1 -3
- package/dist/editor/structure/group/bounds.js.map +1 -1
- package/dist/editor/structure/outline-stroke.js +3 -3
- package/dist/editor/structure/outline-stroke.js.map +1 -1
- package/dist/editor/structure/reorder.d.ts.map +1 -1
- package/dist/editor/structure/reorder.js +7 -14
- package/dist/editor/structure/reorder.js.map +1 -1
- package/dist/editor/structure/state.js +1 -1
- package/dist/editor/structure/state.js.map +1 -1
- package/dist/editor/structure.d.ts +1 -2
- package/dist/editor/structure.d.ts.map +1 -1
- package/dist/editor/structure.js +3 -3
- package/dist/editor/structure.js.map +1 -1
- package/dist/editor/tool-registry.d.ts.map +1 -1
- package/dist/editor/tool-registry.js +2 -1
- package/dist/editor/tool-registry.js.map +1 -1
- package/dist/editor/types.d.ts +9 -2
- package/dist/editor/types.d.ts.map +1 -1
- package/dist/editor/variables.d.ts.map +1 -1
- package/dist/editor/variables.js +57 -1
- package/dist/editor/variables.js.map +1 -1
- package/dist/editor/variations/create.d.ts +28 -0
- package/dist/editor/variations/create.d.ts.map +1 -0
- package/dist/editor/variations/create.js +176 -0
- package/dist/editor/variations/create.js.map +1 -0
- package/dist/editor/variations/pick.d.ts +16 -0
- package/dist/editor/variations/pick.d.ts.map +1 -0
- package/dist/editor/variations/pick.js +23 -0
- package/dist/editor/variations/pick.js.map +1 -0
- package/dist/editor/variations.d.ts +28 -0
- package/dist/editor/variations.d.ts.map +1 -0
- package/dist/editor/variations.js +88 -0
- package/dist/editor/variations.js.map +1 -0
- package/dist/figma-api/accessors/reactions.d.ts.map +1 -1
- package/dist/figma-api/accessors/reactions.js +4 -1
- package/dist/figma-api/accessors/reactions.js.map +1 -1
- package/dist/figma-api/accessors/text/index.d.ts.map +1 -1
- package/dist/figma-api/accessors/text/index.js +7 -1
- package/dist/figma-api/accessors/text/index.js.map +1 -1
- package/dist/figma-api/accessors/text/opentype.d.ts +17 -0
- package/dist/figma-api/accessors/text/opentype.d.ts.map +1 -0
- package/dist/figma-api/accessors/text/opentype.js +28 -0
- package/dist/figma-api/accessors/text/opentype.js.map +1 -0
- package/dist/figma-api/accessors/visual.d.ts.map +1 -1
- package/dist/figma-api/accessors/visual.js +33 -0
- package/dist/figma-api/accessors/visual.js.map +1 -1
- package/dist/figma-api/effects.d.ts +79 -3
- package/dist/figma-api/effects.d.ts.map +1 -1
- package/dist/figma-api/effects.js +150 -9
- package/dist/figma-api/effects.js.map +1 -1
- package/dist/figma-api/fonts/loaded.d.ts +3 -1
- package/dist/figma-api/fonts/loaded.d.ts.map +1 -1
- package/dist/figma-api/fonts/loaded.js +8 -1
- package/dist/figma-api/fonts/loaded.js.map +1 -1
- package/dist/figma-api/index.d.ts +18 -0
- package/dist/figma-api/index.d.ts.map +1 -1
- package/dist/figma-api/index.js +19 -1
- package/dist/figma-api/index.js.map +1 -1
- package/dist/figma-api/overrides.d.ts +13 -1
- package/dist/figma-api/overrides.d.ts.map +1 -1
- package/dist/figma-api/overrides.js +196 -4
- package/dist/figma-api/overrides.js.map +1 -1
- package/dist/figma-api/paints.d.ts +3 -3
- package/dist/figma-api/paints.d.ts.map +1 -1
- package/dist/figma-api/paints.js +14 -4
- package/dist/figma-api/paints.js.map +1 -1
- package/dist/figma-api/proxy.d.ts +4 -1
- package/dist/figma-api/proxy.d.ts.map +1 -1
- package/dist/figma-api/proxy.js +1 -1
- package/dist/figma-api/proxy.js.map +1 -1
- package/dist/figma-api/reactions.d.ts +41 -13
- package/dist/figma-api/reactions.d.ts.map +1 -1
- package/dist/figma-api/reactions.js +113 -31
- package/dist/figma-api/reactions.js.map +1 -1
- package/dist/figma-api/render-bounds.js +1 -1
- package/dist/figma-api/serialization.d.ts.map +1 -1
- package/dist/figma-api/serialization.js +2 -1
- package/dist/figma-api/serialization.js.map +1 -1
- package/dist/figma-api/shape-details.d.ts +26 -0
- package/dist/figma-api/shape-details.d.ts.map +1 -0
- package/dist/figma-api/shape-details.js +28 -0
- package/dist/figma-api/shape-details.js.map +1 -0
- package/dist/figma-api/shape-with-text.js +2 -5
- package/dist/figma-api/shape-with-text.js.map +1 -1
- package/dist/figma-api/surface.d.ts +7 -4
- package/dist/figma-api/surface.d.ts.map +1 -1
- package/dist/figma-api/surface.js +7 -2
- package/dist/figma-api/surface.js.map +1 -1
- package/dist/figma-api/transform.d.ts +1 -1
- package/dist/geometry/figma.d.ts +1 -1
- package/dist/geometry/image-crop.d.ts +1 -1
- package/dist/geometry/image-crop.js +1 -1
- package/dist/icons/svg.js +1 -1
- package/dist/icons/svg.js.map +1 -1
- package/dist/index.d.ts +4 -2
- package/dist/index.js +4 -2
- package/dist/io/formats/boolean-path.d.ts +19 -0
- package/dist/io/formats/boolean-path.d.ts.map +1 -0
- package/dist/io/formats/boolean-path.js +47 -0
- package/dist/io/formats/boolean-path.js.map +1 -0
- package/dist/io/formats/design-tokens/decode.js +1 -1
- package/dist/io/formats/design-tokens/index.d.ts +4 -1
- package/dist/io/formats/design-tokens/index.js +4 -1
- package/dist/io/formats/design-tokens/plan/changes.d.ts +5 -3
- package/dist/io/formats/design-tokens/plan/changes.d.ts.map +1 -1
- package/dist/io/formats/design-tokens/plan/changes.js +1 -1
- package/dist/io/formats/design-tokens/plan/changes.js.map +1 -1
- package/dist/io/formats/design-tokens/project.d.ts +17 -2
- package/dist/io/formats/design-tokens/project.d.ts.map +1 -1
- package/dist/io/formats/design-tokens/project.js +29 -8
- package/dist/io/formats/design-tokens/project.js.map +1 -1
- package/dist/io/formats/design-tokens/styles.d.ts.map +1 -1
- package/dist/io/formats/design-tokens/styles.js.map +1 -1
- package/dist/io/formats/design-tokens/sync/apply.d.ts +42 -0
- package/dist/io/formats/design-tokens/sync/apply.d.ts.map +1 -0
- package/dist/io/formats/design-tokens/sync/apply.js +73 -0
- package/dist/io/formats/design-tokens/sync/apply.js.map +1 -0
- package/dist/io/formats/design-tokens/sync/drift.d.ts +77 -0
- package/dist/io/formats/design-tokens/sync/drift.d.ts.map +1 -0
- package/dist/io/formats/design-tokens/sync/drift.js +391 -0
- package/dist/io/formats/design-tokens/sync/drift.js.map +1 -0
- package/dist/io/formats/design-tokens/sync/files.d.ts +15 -0
- package/dist/io/formats/design-tokens/sync/files.d.ts.map +1 -0
- package/dist/io/formats/design-tokens/sync/files.js +35 -0
- package/dist/io/formats/design-tokens/sync/files.js.map +1 -0
- package/dist/io/formats/drawio/edges.d.ts +7 -1
- package/dist/io/formats/drawio/edges.d.ts.map +1 -1
- package/dist/io/formats/drawio/edges.js +54 -1
- package/dist/io/formats/drawio/edges.js.map +1 -1
- package/dist/io/formats/drawio/export.d.ts.map +1 -1
- package/dist/io/formats/drawio/export.js +19 -2
- package/dist/io/formats/drawio/export.js.map +1 -1
- package/dist/io/formats/drawio/index.d.ts.map +1 -1
- package/dist/io/formats/drawio/index.js +2 -1
- package/dist/io/formats/drawio/index.js.map +1 -1
- package/dist/io/formats/drawio/label.js +1 -1
- package/dist/io/formats/drawio/paint.js +1 -1
- package/dist/io/formats/drawio/placement.d.ts +1 -1
- package/dist/io/formats/fig/export/patch/index.d.ts.map +1 -1
- package/dist/io/formats/fig/export/patch/index.js +5 -0
- package/dist/io/formats/fig/export/patch/index.js.map +1 -1
- package/dist/io/formats/fig/thumbnail-page.d.ts +3 -4
- package/dist/io/formats/fig/thumbnail-page.d.ts.map +1 -1
- package/dist/io/formats/fig/thumbnail-page.js.map +1 -1
- package/dist/io/formats/html/import.d.ts.map +1 -1
- package/dist/io/formats/html/import.js +3 -1
- package/dist/io/formats/html/import.js.map +1 -1
- package/dist/io/formats/html/index.d.ts +2 -2
- package/dist/io/formats/html/index.d.ts.map +1 -1
- package/dist/io/formats/html/index.js +6 -4
- package/dist/io/formats/html/index.js.map +1 -1
- package/dist/io/formats/html/layers.d.ts +7 -4
- package/dist/io/formats/html/layers.d.ts.map +1 -1
- package/dist/io/formats/html/layers.js +4 -1
- package/dist/io/formats/html/layers.js.map +1 -1
- package/dist/io/formats/html/vectors.d.ts +2 -1
- package/dist/io/formats/html/vectors.d.ts.map +1 -1
- package/dist/io/formats/html/vectors.js +3 -2
- package/dist/io/formats/html/vectors.js.map +1 -1
- package/dist/io/formats/mermaid/styles.js +1 -1
- package/dist/io/formats/pdf/document.d.ts +3 -1
- package/dist/io/formats/pdf/document.d.ts.map +1 -1
- package/dist/io/formats/pdf/document.js +6 -3
- package/dist/io/formats/pdf/document.js.map +1 -1
- package/dist/io/formats/pdf/dom.d.ts +6 -1
- package/dist/io/formats/pdf/dom.d.ts.map +1 -1
- package/dist/io/formats/pdf/dom.js +9 -22
- package/dist/io/formats/pdf/dom.js.map +1 -1
- package/dist/io/formats/pdf/export.js +1 -1
- package/dist/io/formats/pdf/export.js.map +1 -1
- package/dist/io/formats/pdf/prepare.d.ts +1 -1
- package/dist/io/formats/pen/imports.d.ts +4 -1
- package/dist/io/formats/pen/imports.d.ts.map +1 -1
- package/dist/io/formats/pen/imports.js.map +1 -1
- package/dist/io/formats/pen/index.d.ts.map +1 -1
- package/dist/io/formats/pen/index.js +31 -3
- package/dist/io/formats/pen/index.js.map +1 -1
- package/dist/io/formats/pptx/export.js +1 -1
- package/dist/io/formats/pptx/geometry.d.ts +1 -1
- package/dist/io/formats/raster/adjusted-images.d.ts +15 -0
- package/dist/io/formats/raster/adjusted-images.d.ts.map +1 -0
- package/dist/io/formats/raster/adjusted-images.js +118 -0
- package/dist/io/formats/raster/adjusted-images.js.map +1 -0
- package/dist/io/formats/raster/headless.d.ts +11 -1
- package/dist/io/formats/raster/headless.d.ts.map +1 -1
- package/dist/io/formats/raster/headless.js +4 -4
- 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/pixels.d.ts +7 -1
- package/dist/io/formats/raster/pixels.d.ts.map +1 -1
- package/dist/io/formats/raster/pixels.js.map +1 -1
- package/dist/io/formats/raster/render.d.ts.map +1 -1
- package/dist/io/formats/raster/render.js +4 -0
- package/dist/io/formats/raster/render.js.map +1 -1
- package/dist/io/formats/svg/defs.d.ts +5 -6
- package/dist/io/formats/svg/defs.d.ts.map +1 -1
- package/dist/io/formats/svg/defs.js +4 -54
- package/dist/io/formats/svg/defs.js.map +1 -1
- package/dist/io/formats/svg/effects.d.ts +16 -0
- package/dist/io/formats/svg/effects.d.ts.map +1 -0
- package/dist/io/formats/svg/effects.js +126 -0
- package/dist/io/formats/svg/effects.js.map +1 -0
- package/dist/io/formats/svg/export.d.ts +7 -1
- package/dist/io/formats/svg/export.d.ts.map +1 -1
- package/dist/io/formats/svg/export.js +224 -50
- package/dist/io/formats/svg/export.js.map +1 -1
- package/dist/io/formats/svg/filter.d.ts +27 -0
- package/dist/io/formats/svg/filter.d.ts.map +1 -0
- package/dist/io/formats/svg/filter.js +44 -0
- package/dist/io/formats/svg/filter.js.map +1 -0
- package/dist/io/formats/svg/grain.d.ts +26 -0
- package/dist/io/formats/svg/grain.d.ts.map +1 -0
- package/dist/io/formats/svg/grain.js +298 -0
- package/dist/io/formats/svg/grain.js.map +1 -0
- package/dist/io/formats/svg/strokes.d.ts +1 -1
- package/dist/io/formats/svg/strokes.d.ts.map +1 -1
- package/dist/io/formats/svg/strokes.js +1 -2
- package/dist/io/formats/svg/strokes.js.map +1 -1
- package/dist/io/formats/svg/text/import.js +1 -1
- package/dist/io/formats/svg/text/layout.d.ts +5 -2
- package/dist/io/formats/svg/text/layout.d.ts.map +1 -1
- package/dist/io/formats/svg/text/layout.js +6 -3
- package/dist/io/formats/svg/text/layout.js.map +1 -1
- package/dist/io/formats/video/composite.d.ts +18 -0
- package/dist/io/formats/video/composite.d.ts.map +1 -0
- package/dist/io/formats/video/composite.js +79 -0
- package/dist/io/formats/video/composite.js.map +1 -0
- package/dist/io/formats/video/formats.d.ts +29 -0
- package/dist/io/formats/video/formats.d.ts.map +1 -0
- package/dist/io/formats/video/formats.js +43 -0
- package/dist/io/formats/video/formats.js.map +1 -0
- package/dist/io/formats/video/gif.d.ts +13 -0
- package/dist/io/formats/video/gif.d.ts.map +1 -0
- package/dist/io/formats/video/gif.js +56 -0
- package/dist/io/formats/video/gif.js.map +1 -0
- package/dist/io/formats/video/index.d.ts +9 -0
- package/dist/io/formats/video/index.js +9 -0
- package/dist/io/formats/video/plan.d.ts +64 -0
- package/dist/io/formats/video/plan.d.ts.map +1 -0
- package/dist/io/formats/video/plan.js +90 -0
- package/dist/io/formats/video/plan.js.map +1 -0
- package/dist/io/formats/video/record.d.ts +36 -0
- package/dist/io/formats/video/record.d.ts.map +1 -0
- package/dist/io/formats/video/record.js +154 -0
- package/dist/io/formats/video/record.js.map +1 -0
- package/dist/io/formats/video/sink.d.ts +29 -0
- package/dist/io/formats/video/sink.d.ts.map +1 -0
- package/dist/io/formats/video/sink.js +16 -0
- package/dist/io/formats/video/sink.js.map +1 -0
- package/dist/io/formats/video/size.d.ts +19 -0
- package/dist/io/formats/video/size.d.ts.map +1 -0
- package/dist/io/formats/video/size.js +26 -0
- package/dist/io/formats/video/size.js.map +1 -0
- package/dist/io/formats/video/webcodecs.d.ts +18 -0
- package/dist/io/formats/video/webcodecs.d.ts.map +1 -0
- package/dist/io/formats/video/webcodecs.js +74 -0
- package/dist/io/formats/video/webcodecs.js.map +1 -0
- package/dist/io/formats.d.ts.map +1 -1
- package/dist/io/formats.js +40 -11
- package/dist/io/formats.js.map +1 -1
- package/dist/io/types.d.ts +19 -4
- package/dist/io/types.d.ts.map +1 -1
- package/dist/kiwi/fig/parse/transfer.d.ts +1 -1
- package/dist/layout/apply.d.ts.map +1 -1
- package/dist/layout/apply.js +50 -12
- package/dist/layout/apply.js.map +1 -1
- package/dist/layout/auto-layout-handles.d.ts +66 -0
- package/dist/layout/auto-layout-handles.d.ts.map +1 -0
- package/dist/layout/auto-layout-handles.js +291 -0
- package/dist/layout/auto-layout-handles.js.map +1 -0
- package/dist/layout/derived.d.ts +7 -1
- package/dist/layout/derived.d.ts.map +1 -1
- package/dist/layout/derived.js +11 -1
- package/dist/layout/derived.js.map +1 -1
- package/dist/layout/grid.d.ts +7 -2
- package/dist/layout/grid.d.ts.map +1 -1
- package/dist/layout/grid.js +27 -9
- package/dist/layout/grid.js.map +1 -1
- package/dist/layout/mutations.d.ts +1 -0
- package/dist/layout/mutations.d.ts.map +1 -1
- package/dist/layout/mutations.js +10 -0
- package/dist/layout/mutations.js.map +1 -1
- package/dist/layout/strokes.d.ts +9 -1
- package/dist/layout/strokes.d.ts.map +1 -1
- package/dist/layout/strokes.js +12 -1
- package/dist/layout/strokes.js.map +1 -1
- package/dist/layout/yoga-helpers.d.ts +3 -1
- package/dist/layout/yoga-helpers.d.ts.map +1 -1
- package/dist/layout/yoga-helpers.js +16 -2
- package/dist/layout/yoga-helpers.js.map +1 -1
- package/dist/layout.d.ts +3 -2
- package/dist/layout.d.ts.map +1 -1
- package/dist/layout.js +73 -39
- package/dist/layout.js.map +1 -1
- package/dist/lint/fixes.d.ts.map +1 -1
- package/dist/lint/fixes.js +9 -3
- package/dist/lint/fixes.js.map +1 -1
- package/dist/lint/index.d.ts +3 -2
- package/dist/lint/index.js +2 -1
- package/dist/lint/linter.d.ts +13 -0
- package/dist/lint/linter.d.ts.map +1 -1
- package/dist/lint/linter.js +123 -9
- package/dist/lint/linter.js.map +1 -1
- package/dist/lint/presets.d.ts.map +1 -1
- package/dist/lint/presets.js +2 -0
- package/dist/lint/presets.js.map +1 -1
- package/dist/lint/rules/design-memory.d.ts +15 -0
- package/dist/lint/rules/design-memory.d.ts.map +1 -0
- package/dist/lint/rules/design-memory.js +90 -0
- package/dist/lint/rules/design-memory.js.map +1 -0
- package/dist/lint/rules/effect-style-required.js +1 -0
- package/dist/lint/rules/effect-style-required.js.map +1 -1
- package/dist/lint/rules/index.d.ts +6 -5
- package/dist/lint/rules/index.d.ts.map +1 -1
- package/dist/lint/rules/index.js +6 -2
- package/dist/lint/rules/index.js.map +1 -1
- package/dist/lint/rules/no-unbound-token-values.d.ts +6 -0
- package/dist/lint/rules/no-unbound-token-values.d.ts.map +1 -0
- package/dist/lint/rules/no-unbound-token-values.js +79 -0
- package/dist/lint/rules/no-unbound-token-values.js.map +1 -0
- package/dist/lint/rules/text-style-required.js +1 -0
- package/dist/lint/rules/text-style-required.js.map +1 -1
- package/dist/lint/types.d.ts +32 -2
- package/dist/lint/types.d.ts.map +1 -1
- package/dist/node/video.d.ts +12 -0
- package/dist/node/video.d.ts.map +1 -0
- package/dist/node/video.js +206 -0
- package/dist/node/video.js.map +1 -0
- package/dist/pairdraw-api/design-memory.d.ts +19 -0
- package/dist/pairdraw-api/design-memory.d.ts.map +1 -0
- package/dist/pairdraw-api/design-memory.js +39 -0
- package/dist/pairdraw-api/design-memory.js.map +1 -0
- package/dist/pairdraw-api/index.d.ts +45 -1
- package/dist/pairdraw-api/index.d.ts.map +1 -1
- package/dist/pairdraw-api/index.js +55 -2
- package/dist/pairdraw-api/index.js.map +1 -1
- package/dist/pairdraw-api/nodes.d.ts +12 -1
- package/dist/pairdraw-api/nodes.d.ts.map +1 -1
- package/dist/pairdraw-api/nodes.js +28 -1
- package/dist/pairdraw-api/nodes.js.map +1 -1
- package/dist/pairdraw-api/variations.d.ts +48 -0
- package/dist/pairdraw-api/variations.d.ts.map +1 -0
- package/dist/pairdraw-api/variations.js +76 -0
- package/dist/pairdraw-api/variations.js.map +1 -0
- package/dist/prototype/easing.d.ts +13 -0
- package/dist/prototype/easing.d.ts.map +1 -0
- package/dist/prototype/easing.js +36 -0
- package/dist/prototype/easing.js.map +1 -0
- package/dist/prototype/frames.d.ts +10 -0
- package/dist/prototype/frames.d.ts.map +1 -0
- package/dist/prototype/frames.js +12 -0
- package/dist/prototype/frames.js.map +1 -0
- package/dist/prototype/hit.d.ts +17 -0
- package/dist/prototype/hit.d.ts.map +1 -0
- package/dist/prototype/hit.js +45 -0
- package/dist/prototype/hit.js.map +1 -0
- package/dist/prototype/index.d.ts +14 -0
- package/dist/prototype/index.js +14 -0
- package/dist/prototype/pointer.d.ts +63 -0
- package/dist/prototype/pointer.d.ts.map +1 -0
- package/dist/prototype/pointer.js +104 -0
- package/dist/prototype/pointer.js.map +1 -0
- package/dist/prototype/reactions.d.ts +45 -0
- package/dist/prototype/reactions.d.ts.map +1 -0
- package/dist/prototype/reactions.js +122 -0
- package/dist/prototype/reactions.js.map +1 -0
- package/dist/prototype/scene.d.ts +35 -0
- package/dist/prototype/scene.d.ts.map +1 -0
- package/dist/prototype/scene.js +86 -0
- package/dist/prototype/scene.js.map +1 -0
- package/dist/prototype/scenes.d.ts +81 -0
- package/dist/prototype/scenes.d.ts.map +1 -0
- package/dist/prototype/scenes.js +175 -0
- package/dist/prototype/scenes.js.map +1 -0
- package/dist/prototype/scroll.d.ts +48 -0
- package/dist/prototype/scroll.d.ts.map +1 -0
- package/dist/prototype/scroll.js +159 -0
- package/dist/prototype/scroll.js.map +1 -0
- package/dist/prototype/session.d.ts +71 -0
- package/dist/prototype/session.d.ts.map +1 -0
- package/dist/prototype/session.js +135 -0
- package/dist/prototype/session.js.map +1 -0
- package/dist/prototype/smart-animate/animation.d.ts +34 -0
- package/dist/prototype/smart-animate/animation.d.ts.map +1 -0
- package/dist/prototype/smart-animate/animation.js +212 -0
- package/dist/prototype/smart-animate/animation.js.map +1 -0
- package/dist/prototype/smart-animate/match.d.ts +24 -0
- package/dist/prototype/smart-animate/match.d.ts.map +1 -0
- package/dist/prototype/smart-animate/match.js +72 -0
- package/dist/prototype/smart-animate/match.js.map +1 -0
- package/dist/prototype/snapshot.d.ts +19 -0
- package/dist/prototype/snapshot.d.ts.map +1 -0
- package/dist/prototype/snapshot.js +56 -0
- package/dist/prototype/snapshot.js.map +1 -0
- package/dist/prototype/timeline.d.ts +132 -0
- package/dist/prototype/timeline.d.ts.map +1 -0
- package/dist/prototype/timeline.js +260 -0
- package/dist/prototype/timeline.js.map +1 -0
- package/dist/rpc/commands.d.ts +2 -2
- package/dist/rpc/index.d.ts +2 -2
- package/dist/rpc/read-commands.d.ts +18 -8
- package/dist/rpc/read-commands.d.ts.map +1 -1
- package/dist/rpc/read-commands.js +18 -9
- package/dist/rpc/read-commands.js.map +1 -1
- package/dist/text/font/faces.d.ts +12 -1
- package/dist/text/font/faces.d.ts.map +1 -1
- package/dist/text/font/faces.js +15 -1
- package/dist/text/font/faces.js.map +1 -1
- package/dist/text/font/features.d.ts +9 -0
- package/dist/text/font/features.d.ts.map +1 -0
- package/dist/text/font/features.js +27 -0
- package/dist/text/font/features.js.map +1 -0
- package/dist/text/font/manager.d.ts +12 -0
- package/dist/text/font/manager.d.ts.map +1 -1
- package/dist/text/font/manager.js +66 -12
- package/dist/text/font/manager.js.map +1 -1
- package/dist/text/index.d.ts +11 -9
- package/dist/text/index.js +4 -2
- package/dist/text/replace-fonts.d.ts +41 -0
- package/dist/text/replace-fonts.d.ts.map +1 -0
- package/dist/text/replace-fonts.js +121 -0
- package/dist/text/replace-fonts.js.map +1 -0
- package/dist/tools/analyze/responsive/index.d.ts +15 -0
- package/dist/tools/analyze/responsive/index.d.ts.map +1 -0
- package/dist/tools/analyze/responsive/index.js +203 -0
- package/dist/tools/analyze/responsive/index.js.map +1 -0
- package/dist/tools/analyze.d.ts +2 -1
- package/dist/tools/analyze.js +2 -1
- package/dist/tools/codegen/token-sync.d.ts +7 -0
- package/dist/tools/codegen/token-sync.d.ts.map +1 -0
- package/dist/tools/codegen/token-sync.js +85 -0
- package/dist/tools/codegen/token-sync.js.map +1 -0
- package/dist/tools/codegen/tokens.d.ts +1 -1
- package/dist/tools/codegen.d.ts +2 -1
- package/dist/tools/codegen.js +2 -1
- package/dist/tools/create/basic.js +1 -1
- package/dist/tools/create/behaviours.js +1 -1
- package/dist/tools/create/components.d.ts.map +1 -1
- package/dist/tools/create/components.js +4 -0
- package/dist/tools/create/components.js.map +1 -1
- package/dist/tools/create/html.js +3 -2
- package/dist/tools/create/html.js.map +1 -1
- package/dist/tools/create/icons.d.ts.map +1 -1
- package/dist/tools/create/icons.js +2 -1
- package/dist/tools/create/icons.js.map +1 -1
- package/dist/tools/create/mermaid.js +2 -1
- package/dist/tools/create/mermaid.js.map +1 -1
- package/dist/tools/create/render.js +1 -1
- package/dist/tools/create/svg.js +2 -1
- package/dist/tools/create/svg.js.map +1 -1
- package/dist/tools/create/vector.js +1 -1
- package/dist/tools/design-memory.d.ts +8 -0
- package/dist/tools/design-memory.d.ts.map +1 -0
- package/dist/tools/design-memory.js +68 -0
- package/dist/tools/design-memory.js.map +1 -0
- package/dist/tools/image-ai/generate.d.ts.map +1 -1
- package/dist/tools/image-ai/generate.js +3 -1
- package/dist/tools/image-ai/generate.js.map +1 -1
- package/dist/tools/index.d.ts +2 -1
- package/dist/tools/index.js +2 -1
- package/dist/tools/modify/fonts.d.ts +6 -0
- package/dist/tools/modify/fonts.d.ts.map +1 -0
- package/dist/tools/modify/fonts.js +27 -0
- package/dist/tools/modify/fonts.js.map +1 -0
- package/dist/tools/modify/layout.d.ts.map +1 -1
- package/dist/tools/modify/layout.js +1 -0
- package/dist/tools/modify/layout.js.map +1 -1
- package/dist/tools/modify/paint.js +1 -1
- package/dist/tools/modify/reactions.d.ts.map +1 -1
- package/dist/tools/modify/reactions.js +3 -3
- package/dist/tools/modify/reactions.js.map +1 -1
- package/dist/tools/modify/text.d.ts.map +1 -1
- package/dist/tools/modify/text.js +26 -5
- package/dist/tools/modify/text.js.map +1 -1
- package/dist/tools/modify/update.d.ts +10 -1
- package/dist/tools/modify/update.d.ts.map +1 -1
- package/dist/tools/modify/update.js +34 -3
- package/dist/tools/modify/update.js.map +1 -1
- package/dist/tools/modify.d.ts +2 -1
- package/dist/tools/modify.js +2 -1
- package/dist/tools/read/fonts.d.ts.map +1 -1
- package/dist/tools/read/fonts.js +17 -2
- package/dist/tools/read/fonts.js.map +1 -1
- package/dist/tools/read/libraries.js +2 -1
- package/dist/tools/read/libraries.js.map +1 -1
- package/dist/tools/read/nodes.d.ts.map +1 -1
- package/dist/tools/read/nodes.js.map +1 -1
- package/dist/tools/read/space.d.ts +3 -1
- package/dist/tools/read/space.d.ts.map +1 -1
- package/dist/tools/read/space.js +4 -3
- package/dist/tools/read/space.js.map +1 -1
- package/dist/tools/registry/core.d.ts +1 -1
- package/dist/tools/registry/core.d.ts.map +1 -1
- package/dist/tools/registry/core.js +3 -1
- package/dist/tools/registry/core.js.map +1 -1
- package/dist/tools/registry/extended.d.ts.map +1 -1
- package/dist/tools/registry/extended.js +16 -1
- package/dist/tools/registry/extended.js.map +1 -1
- package/dist/tools/schema.d.ts +18 -2
- package/dist/tools/schema.d.ts.map +1 -1
- package/dist/tools/schema.js +1 -1
- package/dist/tools/schema.js.map +1 -1
- package/dist/tools/stock-photo.js +1 -0
- package/dist/tools/stock-photo.js.map +1 -1
- package/dist/tools/structure/basic.d.ts.map +1 -1
- package/dist/tools/structure/basic.js +1 -0
- package/dist/tools/structure/basic.js.map +1 -1
- package/dist/tools/structure/batch.d.ts.map +1 -1
- package/dist/tools/structure/batch.js +22 -1
- package/dist/tools/structure/batch.js.map +1 -1
- package/dist/tools/structure/hierarchy.d.ts.map +1 -1
- package/dist/tools/structure/hierarchy.js +4 -0
- package/dist/tools/structure/hierarchy.js.map +1 -1
- package/dist/tools/structure/variations.d.ts +8 -0
- package/dist/tools/structure/variations.d.ts.map +1 -0
- package/dist/tools/structure/variations.js +106 -0
- package/dist/tools/structure/variations.js.map +1 -0
- package/dist/tools/structure.d.ts +2 -1
- package/dist/tools/structure.js +2 -1
- package/dist/tools/styles/types.d.ts +2 -4
- package/dist/tools/styles/types.d.ts.map +1 -1
- package/dist/tools/styles/types.js.map +1 -1
- package/dist/tools/vector/boolean.d.ts.map +1 -1
- package/dist/tools/vector/boolean.js +4 -0
- package/dist/tools/vector/boolean.js.map +1 -1
- package/dist/tools/vector/path.d.ts.map +1 -1
- package/dist/tools/vector/path.js +39 -7
- package/dist/tools/vector/path.js.map +1 -1
- package/dist/tools/vector/vectorize.js +1 -0
- package/dist/tools/vector/vectorize.js.map +1 -1
- package/dist/tools/vector/video.d.ts +6 -0
- package/dist/tools/vector/video.d.ts.map +1 -0
- package/dist/tools/vector/video.js +133 -0
- package/dist/tools/vector/video.js.map +1 -0
- package/dist/tools/vector.d.ts +2 -1
- package/dist/tools/vector.js +2 -1
- package/dist/tools/video-host.d.ts +12 -0
- package/dist/tools/video-host.d.ts.map +1 -0
- package/dist/tools/video-host.js +19 -0
- package/dist/tools/video-host.js.map +1 -0
- package/dist/vector/point-transform.d.ts +1 -1
- package/dist/vector/vectorize/svg/to-vectors.d.ts +1 -1
- package/dist/xpath.d.ts +3 -0
- package/dist/xpath.d.ts.map +1 -1
- package/dist/xpath.js +3 -1
- package/dist/xpath.js.map +1 -1
- package/package.json +31 -9
- package/src/ai/providers.ts +2 -0
- package/src/cache/resource.ts +24 -1
- package/src/canvas/effects.ts +47 -50
- package/src/canvas/fills.ts +19 -15
- package/src/canvas/images/adjustments.ts +203 -0
- package/src/canvas/images/sampling.ts +88 -0
- package/src/canvas/index.ts +1 -0
- package/src/canvas/masks.ts +1 -1
- package/src/canvas/noise/render.ts +75 -0
- package/src/canvas/noise/shader.ts +161 -0
- package/src/canvas/noise/table.ts +91 -0
- package/src/canvas/noise/tile.ts +94 -0
- package/src/canvas/overlays/auto-layout-hover.ts +47 -65
- package/src/canvas/overlays/index.ts +0 -1
- package/src/canvas/overlays/selection.ts +1 -12
- package/src/canvas/renderer/fonts.ts +2 -0
- package/src/canvas/renderer/lifecycle.ts +6 -0
- package/src/canvas/renderer/methods.ts +0 -9
- package/src/canvas/renderer/overlay-pass.ts +0 -1
- package/src/canvas/renderer/pipeline.ts +19 -2
- package/src/canvas/renderer/play-scenes.ts +51 -0
- package/src/canvas/renderer/tiles/cache.ts +54 -1
- package/src/canvas/renderer/tiles/controller.ts +30 -1
- package/src/canvas/renderer/types.ts +18 -3
- package/src/canvas/renderer.ts +40 -4
- package/src/canvas/scene.ts +65 -9
- package/src/canvas/texture.ts +136 -0
- package/src/clipboard.ts +23 -10
- package/src/constants.ts +6 -0
- package/src/design-jsx/index.ts +1 -1
- package/src/design-jsx/renderer.ts +1 -1
- package/src/design-memory/check.ts +376 -0
- package/src/design-memory/describe.ts +77 -0
- package/src/design-memory/distil.ts +69 -0
- package/src/design-memory/document.ts +80 -0
- package/src/design-memory/guard.ts +157 -0
- package/src/design-memory/index.ts +8 -0
- package/src/design-memory/refusal.ts +90 -0
- package/src/design-memory/rules.ts +274 -0
- package/src/design-memory/values.ts +179 -0
- package/src/editor/bridges/components.ts +2 -0
- package/src/editor/clipboard/export.ts +24 -7
- package/src/editor/clipboard/snapshot.ts +21 -4
- package/src/editor/clipboard.ts +4 -14
- package/src/editor/color-space.ts +47 -38
- package/src/editor/components/instances.ts +31 -0
- package/src/editor/create.ts +39 -71
- package/src/editor/design-memory.ts +39 -0
- package/src/editor/design-tokens.ts +41 -2
- package/src/editor/document-colors.ts +65 -0
- package/src/editor/eyedropper.ts +198 -0
- package/src/editor/fonts.ts +19 -0
- package/src/editor/history/atomic-tool.ts +29 -1
- package/src/editor/history/capture.ts +19 -0
- package/src/editor/history/document-change.ts +5 -17
- package/src/editor/history/edit.ts +16 -2
- package/src/editor/history/subtree.ts +13 -2
- package/src/editor/index.ts +11 -0
- package/src/editor/nudge.ts +1 -1
- package/src/editor/pages.ts +40 -29
- package/src/editor/play/states.ts +1 -1
- package/src/editor/read-only/actions.ts +6 -0
- package/src/editor/render-requests.ts +83 -0
- package/src/editor/selection/container.ts +24 -1
- package/src/editor/selection/navigation.ts +8 -6
- package/src/editor/selection/overlays.ts +1 -0
- package/src/editor/shapes/with-text.ts +2 -5
- package/src/editor/structure/auto-layout-wrap.ts +1 -1
- package/src/editor/structure/boolean.ts +1 -3
- package/src/editor/structure/group/bounds.ts +1 -5
- package/src/editor/structure/outline-stroke.ts +3 -3
- package/src/editor/structure/reorder.ts +8 -14
- package/src/editor/structure/state.ts +1 -1
- package/src/editor/structure.ts +5 -8
- package/src/editor/tool-registry.ts +2 -1
- package/src/editor/types.ts +8 -1
- package/src/editor/variables.ts +74 -2
- package/src/editor/variations/create.ts +235 -0
- package/src/editor/variations/pick.ts +35 -0
- package/src/editor/variations.ts +110 -0
- package/src/figma-api/accessors/reactions.ts +11 -1
- package/src/figma-api/accessors/text/index.ts +17 -1
- package/src/figma-api/accessors/text/opentype.ts +33 -0
- package/src/figma-api/accessors/visual.ts +55 -2
- package/src/figma-api/compatibility.ts +5 -2
- package/src/figma-api/effects.ts +143 -5
- package/src/figma-api/fonts/loaded.ts +9 -0
- package/src/figma-api/index.ts +35 -0
- package/src/figma-api/overrides.ts +295 -3
- package/src/figma-api/paints.ts +24 -9
- package/src/figma-api/proxy.ts +6 -1
- package/src/figma-api/reactions.ts +130 -32
- package/src/figma-api/serialization.ts +2 -1
- package/src/figma-api/shape-details.ts +50 -0
- package/src/figma-api/shape-with-text.ts +2 -5
- package/src/figma-api/surface.ts +7 -2
- package/src/global.d.ts +31 -0
- package/src/icons/svg.ts +3 -1
- package/src/io/formats/boolean-path.ts +60 -0
- package/src/io/formats/design-tokens/index.ts +21 -0
- package/src/io/formats/design-tokens/plan/changes.ts +4 -1
- package/src/io/formats/design-tokens/project.ts +40 -9
- package/src/io/formats/design-tokens/styles.ts +10 -2
- package/src/io/formats/design-tokens/sync/apply.ts +130 -0
- package/src/io/formats/design-tokens/sync/drift.ts +587 -0
- package/src/io/formats/design-tokens/sync/files.ts +40 -0
- package/src/io/formats/drawio/edges.ts +65 -0
- package/src/io/formats/drawio/export.ts +37 -14
- package/src/io/formats/drawio/index.ts +5 -1
- package/src/io/formats/fig/export/patch/index.ts +8 -0
- package/src/io/formats/fig/thumbnail-page.ts +4 -4
- package/src/io/formats/html/import.ts +9 -1
- package/src/io/formats/html/index.ts +14 -7
- package/src/io/formats/html/layers.ts +11 -2
- package/src/io/formats/html/vectors.ts +8 -2
- package/src/io/formats/pdf/document.ts +14 -4
- package/src/io/formats/pdf/dom.ts +10 -18
- package/src/io/formats/pdf/export.ts +1 -1
- package/src/io/formats/pen/imports.ts +5 -6
- package/src/io/formats/pen/index.ts +36 -5
- package/src/io/formats/raster/adjusted-images.ts +125 -0
- package/src/io/formats/raster/headless.ts +3 -3
- package/src/io/formats/raster/index.ts +6 -1
- package/src/io/formats/raster/pixels.ts +7 -0
- package/src/io/formats/raster/render.ts +12 -1
- package/src/io/formats/svg/defs.ts +14 -73
- package/src/io/formats/svg/effects.ts +131 -0
- package/src/io/formats/svg/export.ts +371 -64
- package/src/io/formats/svg/filter.ts +47 -0
- package/src/io/formats/svg/grain.ts +249 -0
- package/src/io/formats/svg/strokes.ts +2 -2
- package/src/io/formats/svg/text/layout.ts +13 -3
- package/src/io/formats/video/composite.ts +79 -0
- package/src/io/formats/video/formats.ts +77 -0
- package/src/io/formats/video/gif.ts +65 -0
- package/src/io/formats/video/index.ts +30 -0
- package/src/io/formats/video/plan.ts +116 -0
- package/src/io/formats/video/record.ts +227 -0
- package/src/io/formats/video/sink.ts +32 -0
- package/src/io/formats/video/size.ts +25 -0
- package/src/io/formats/video/webcodecs.ts +89 -0
- package/src/io/formats.ts +59 -11
- package/src/io/types.ts +29 -10
- package/src/layout/apply.ts +87 -21
- package/src/layout/auto-layout-handles.ts +396 -0
- package/src/layout/derived.ts +14 -0
- package/src/layout/grid.ts +33 -9
- package/src/layout/mutations.ts +13 -1
- package/src/layout/strokes.ts +12 -0
- package/src/layout/yoga-helpers.ts +18 -1
- package/src/layout.ts +96 -49
- package/src/lint/fixes.ts +12 -3
- package/src/lint/index.ts +3 -1
- package/src/lint/linter.ts +124 -12
- package/src/lint/presets.ts +2 -0
- package/src/lint/rules/design-memory.ts +97 -0
- package/src/lint/rules/effect-style-required.ts +2 -0
- package/src/lint/rules/index.ts +6 -1
- package/src/lint/rules/no-unbound-token-values.ts +73 -0
- package/src/lint/rules/text-style-required.ts +2 -0
- package/src/lint/types.ts +40 -0
- package/src/node/video.ts +196 -0
- package/src/pairdraw-api/design-memory.ts +61 -0
- package/src/pairdraw-api/index.ts +81 -0
- package/src/pairdraw-api/nodes.ts +38 -0
- package/src/pairdraw-api/variations.ts +109 -0
- package/src/prototype/easing.ts +37 -0
- package/src/prototype/frames.ts +9 -0
- package/src/prototype/hit.ts +70 -0
- package/src/prototype/index.ts +69 -0
- package/src/prototype/pointer.ts +146 -0
- package/src/prototype/reactions.ts +178 -0
- package/src/prototype/scene.ts +116 -0
- package/src/prototype/scenes.ts +256 -0
- package/src/prototype/scroll.ts +190 -0
- package/src/prototype/session.ts +188 -0
- package/src/prototype/smart-animate/animation.ts +267 -0
- package/src/prototype/smart-animate/match.ts +85 -0
- package/src/prototype/snapshot.ts +60 -0
- package/src/prototype/timeline.ts +400 -0
- package/src/rpc/index.ts +1 -0
- package/src/rpc/read-commands.ts +40 -23
- package/src/text/font/faces.ts +22 -0
- package/src/text/font/features.ts +27 -0
- package/src/text/font/manager.ts +88 -12
- package/src/text/index.ts +2 -0
- package/src/text/replace-fonts.ts +171 -0
- package/src/tools/analyze/responsive/index.ts +264 -0
- package/src/tools/analyze.ts +2 -0
- package/src/tools/codegen/token-sync.ts +98 -0
- package/src/tools/codegen.ts +1 -0
- package/src/tools/create/components.ts +4 -0
- package/src/tools/create/html.ts +1 -0
- package/src/tools/create/icons.ts +1 -0
- package/src/tools/create/mermaid.ts +1 -0
- package/src/tools/create/svg.ts +1 -0
- package/src/tools/design-memory.ts +72 -0
- package/src/tools/image-ai/generate.ts +2 -0
- package/src/tools/index.ts +1 -0
- package/src/tools/modify/fonts.ts +34 -0
- package/src/tools/modify/layout.ts +5 -0
- package/src/tools/modify/reactions.ts +15 -8
- package/src/tools/modify/text.ts +42 -5
- package/src/tools/modify/update.ts +46 -2
- package/src/tools/modify.ts +1 -0
- package/src/tools/read/fonts.ts +24 -2
- package/src/tools/read/libraries.ts +1 -0
- package/src/tools/read/nodes.ts +0 -1
- package/src/tools/read/space.ts +3 -2
- package/src/tools/registry/core.ts +3 -1
- package/src/tools/registry/extended.ts +28 -1
- package/src/tools/schema.ts +28 -4
- package/src/tools/stock-photo.ts +1 -0
- package/src/tools/structure/basic.ts +1 -0
- package/src/tools/structure/batch.ts +34 -1
- package/src/tools/structure/hierarchy.ts +4 -0
- package/src/tools/structure/variations.ts +118 -0
- package/src/tools/structure.ts +2 -0
- package/src/tools/styles/types.ts +3 -4
- package/src/tools/vector/boolean.ts +4 -0
- package/src/tools/vector/path.ts +30 -6
- package/src/tools/vector/vectorize.ts +1 -0
- package/src/tools/vector/video.ts +228 -0
- package/src/tools/vector.ts +1 -0
- package/src/tools/video-host.ts +18 -0
- package/src/xpath.ts +6 -1
|
@@ -9,7 +9,6 @@ import type {
|
|
|
9
9
|
VariableCollection
|
|
10
10
|
} from '@pairdraw/scene-graph'
|
|
11
11
|
import { withLiveComments } from '@pairdraw/scene-graph/comments'
|
|
12
|
-
import { cloneInstanceOverrideState } from '@pairdraw/scene-graph/instances/overrides'
|
|
13
12
|
import {
|
|
14
13
|
createSceneMutationImpact,
|
|
15
14
|
recordSceneMutations
|
|
@@ -18,6 +17,7 @@ import {
|
|
|
18
17
|
import type { EditorContext } from '#core/editor/types'
|
|
19
18
|
import { computeAllLayouts } from '#core/layout'
|
|
20
19
|
|
|
20
|
+
import { captureNode } from './capture'
|
|
21
21
|
import { diffFields, type FieldChanges } from './diff'
|
|
22
22
|
|
|
23
23
|
type Side = 'before' | 'after'
|
|
@@ -134,21 +134,6 @@ function restoreLayer(graph: SceneGraph, update: LayerUpdate, side: Side): void
|
|
|
134
134
|
graph.restoreNodeProperties(update.id, changes, update.fields?.absent[side] ?? [])
|
|
135
135
|
}
|
|
136
136
|
|
|
137
|
-
/**
|
|
138
|
-
* A copy that keeps the layer's values as they are now. Values are replaced, never written into
|
|
139
|
-
* (`materialize-instance.ts` in `@pairdraw/fig`), so sharing them is safe; the graph edits
|
|
140
|
-
* child lists, source metadata, and override maps in place, so those are copied.
|
|
141
|
-
*/
|
|
142
|
-
function captureNode(node: SceneNode): SceneNode {
|
|
143
|
-
const { source, instanceOverrides } = node
|
|
144
|
-
return {
|
|
145
|
-
...node,
|
|
146
|
-
childIds: [...node.childIds],
|
|
147
|
-
source: { ...source, fig: { ...source.fig, rawNodeFields: { ...source.fig.rawNodeFields } } },
|
|
148
|
-
instanceOverrides: cloneInstanceOverrideState(instanceOverrides)
|
|
149
|
-
}
|
|
150
|
-
}
|
|
151
|
-
|
|
152
137
|
/** Copies a page's layers not copied yet; a layer moved in from another page keeps its copy. */
|
|
153
138
|
function capturePage(graph: SceneGraph, pageId: string, captured: Map<string, SceneNode>): void {
|
|
154
139
|
const stack = [pageId]
|
|
@@ -199,7 +184,10 @@ function recordLayer(
|
|
|
199
184
|
if (!previous) {
|
|
200
185
|
if (current) change.created.push(structuredClone(current))
|
|
201
186
|
} else if (!current) {
|
|
202
|
-
|
|
187
|
+
// `previous` is this edit's own copy, made before the layer changed (`captureNode`), and the
|
|
188
|
+
// layer it copies is gone; restoring it copies it again, so the record stays as it is.
|
|
189
|
+
// Copying it here too cost a deep clone per layer, which made deleting thousands slow.
|
|
190
|
+
change.deleted.push(previous)
|
|
203
191
|
} else {
|
|
204
192
|
const update = diffLayer(id, previous, current)
|
|
205
193
|
if (update) change.updated.push(update)
|
|
@@ -42,6 +42,13 @@ export interface RecordEditOptions {
|
|
|
42
42
|
* back after it threw changed nothing.
|
|
43
43
|
*/
|
|
44
44
|
onRecorded?: (change: DocumentChange) => void
|
|
45
|
+
/**
|
|
46
|
+
* Judges what the edit changed once it finished without throwing. An error it returns fails
|
|
47
|
+
* the edit: with `rollbackOnThrow` the edit is put back and the error thrown, as the design
|
|
48
|
+
* memory refuses an agent's off-system values. When the edit cannot be put back, its step is
|
|
49
|
+
* recorded and nothing is thrown, so the caller reports the error some other way.
|
|
50
|
+
*/
|
|
51
|
+
verify?: (change: DocumentChange) => Error | null
|
|
45
52
|
}
|
|
46
53
|
|
|
47
54
|
function unchanged(pageId: string): DocumentChange {
|
|
@@ -157,11 +164,13 @@ function begin(ctx: EditorContext, options: RecordEditOptions, awaits = false) {
|
|
|
157
164
|
if (awaits) keepOpenRecorder(ctx, recorder)
|
|
158
165
|
// A synchronous edit runs alone; one that awaits shares the document while it waits.
|
|
159
166
|
const othersWrote = awaits ? watchOtherWrites(ctx) : () => false
|
|
160
|
-
const finish = (
|
|
167
|
+
const finish = (threw: boolean) => {
|
|
161
168
|
if (awaits) releaseOpenRecorder(ctx, recorder)
|
|
162
169
|
const others = othersWrote()
|
|
163
170
|
const change = recorder.finish()
|
|
164
171
|
const empty = isEmptyDocumentChange(change)
|
|
172
|
+
const refusal = !threw && !empty && options.verify ? options.verify(change) : null
|
|
173
|
+
const failed = threw || refusal !== null
|
|
165
174
|
if (
|
|
166
175
|
failed &&
|
|
167
176
|
options.rollbackOnThrow &&
|
|
@@ -171,12 +180,17 @@ function begin(ctx: EditorContext, options: RecordEditOptions, awaits = false) {
|
|
|
171
180
|
rollBack(ctx, graph, change)
|
|
172
181
|
) {
|
|
173
182
|
options.onRecorded?.(unchanged(pageId))
|
|
183
|
+
if (refusal) throw refusal
|
|
174
184
|
return
|
|
175
185
|
}
|
|
176
186
|
// An edit that changed nothing, such as a read-only script, leaves no empty step behind.
|
|
177
187
|
if (options.push !== false && !empty) {
|
|
178
188
|
const entry = changeStep(ctx, options.label, change)
|
|
179
|
-
if (
|
|
189
|
+
if (ctx.graph !== graph) {
|
|
190
|
+
// The document the edit began on was swapped away while it awaited: its step stays with
|
|
191
|
+
// that document, and the one now open never carries an edit it did not see.
|
|
192
|
+
ctx.parkStep(graph, entry)
|
|
193
|
+
} else if (options.ownStep) ctx.undo.pushStep(entry)
|
|
180
194
|
else ctx.undo.push(entry)
|
|
181
195
|
}
|
|
182
196
|
options.onRecorded?.(change)
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import type { SceneGraph, SceneNode } from '@pairdraw/scene-graph'
|
|
2
2
|
|
|
3
|
+
import { captureNode } from './capture'
|
|
4
|
+
|
|
3
5
|
export function collectSubtrees(graph: SceneGraph, rootIds: string[]): SceneNode[] {
|
|
4
6
|
const result: SceneNode[] = []
|
|
5
7
|
function walk(id: string) {
|
|
@@ -12,25 +14,34 @@ export function collectSubtrees(graph: SceneGraph, rootIds: string[]): SceneNode
|
|
|
12
14
|
return result
|
|
13
15
|
}
|
|
14
16
|
|
|
17
|
+
/**
|
|
18
|
+
* Copies of a layer and its layers by id, for undo to put back. Each is a `captureNode` copy,
|
|
19
|
+
* not a deep clone, so deleting thousands of layers stays quick.
|
|
20
|
+
*/
|
|
15
21
|
export function snapshotSubtree(graph: SceneGraph, rootId: string): Map<string, SceneNode> {
|
|
16
22
|
const index = new Map<string, SceneNode>()
|
|
17
23
|
const walk = (id: string) => {
|
|
18
24
|
const node = graph.getNode(id)
|
|
19
25
|
if (!node) return
|
|
20
|
-
index.set(id,
|
|
26
|
+
index.set(id, captureNode(node))
|
|
21
27
|
for (const childId of node.childIds) walk(childId)
|
|
22
28
|
}
|
|
23
29
|
walk(rootId)
|
|
24
30
|
return index
|
|
25
31
|
}
|
|
26
32
|
|
|
33
|
+
/**
|
|
34
|
+
* Puts a snapshot back under `parentId`, its layers in order. The layer it makes gets a copy of
|
|
35
|
+
* the snapshot's child list, source metadata and override maps, which the graph edits in place,
|
|
36
|
+
* so the snapshot stays as it is for the next undo or redo.
|
|
37
|
+
*/
|
|
27
38
|
export function restoreSubtree(
|
|
28
39
|
graph: SceneGraph,
|
|
29
40
|
snapshot: SceneNode,
|
|
30
41
|
parentId: string,
|
|
31
42
|
index: Map<string, SceneNode>
|
|
32
43
|
): void {
|
|
33
|
-
const { parentId: _parentId, childIds, ...rest } = snapshot
|
|
44
|
+
const { parentId: _parentId, childIds, ...rest } = captureNode(snapshot)
|
|
34
45
|
graph.createNode(snapshot.type, parentId, { ...rest, id: snapshot.id })
|
|
35
46
|
for (const childId of childIds) {
|
|
36
47
|
const child = index.get(childId)
|
package/src/editor/index.ts
CHANGED
|
@@ -28,6 +28,7 @@ export {
|
|
|
28
28
|
selectionColorsShown,
|
|
29
29
|
type SelectionColor
|
|
30
30
|
} from './selection/colors'
|
|
31
|
+
export { DOCUMENT_COLOR_LIMIT, documentColors, type DocumentColor } from './document-colors'
|
|
31
32
|
export {
|
|
32
33
|
copyEditorViewState,
|
|
33
34
|
createDefaultEditorViewState,
|
|
@@ -37,7 +38,9 @@ export { createDefaultEditorState, createEditor } from './create'
|
|
|
37
38
|
export { syncEditedComponents } from './component-sync'
|
|
38
39
|
export { executeAtomicTool } from './history/atomic-tool'
|
|
39
40
|
export {
|
|
41
|
+
applyDocumentChange,
|
|
40
42
|
isEmptyDocumentChange,
|
|
43
|
+
recordDocumentChange,
|
|
41
44
|
touchedTopLevelIds,
|
|
42
45
|
type DocumentChange
|
|
43
46
|
} from './history/document-change'
|
|
@@ -89,6 +92,14 @@ export { opacityFromBuffer } from './nodes'
|
|
|
89
92
|
export { layerTypeOptions, type LayerType } from './structure/layer-type'
|
|
90
93
|
export type { NodePreview } from './node-preview'
|
|
91
94
|
export { BOARD_TOOL_SHORTCUTS, BOARD_TOOLS, EDITOR_TOOLS, TOOL_SHORTCUTS } from './tool-registry'
|
|
95
|
+
export {
|
|
96
|
+
applySampledColor,
|
|
97
|
+
eyedropperChanges,
|
|
98
|
+
sampleSceneColor,
|
|
99
|
+
sampleScenePixels,
|
|
100
|
+
scenePixelColor
|
|
101
|
+
} from './eyedropper'
|
|
102
|
+
export type { EyedropperTarget, ScenePixels } from './eyedropper'
|
|
92
103
|
export {
|
|
93
104
|
DEFAULT_SCALE_ANCHOR,
|
|
94
105
|
isScaleAnchor,
|
package/src/editor/nudge.ts
CHANGED
|
@@ -57,7 +57,7 @@ export function createNudgeActions(ctx: EditorContext) {
|
|
|
57
57
|
|
|
58
58
|
function applyOrder(parentId: string, order: readonly string[]) {
|
|
59
59
|
order.forEach((id, index) => ctx.graph.insertChildAt(id, parentId, index))
|
|
60
|
-
ctx.
|
|
60
|
+
ctx.runLayoutForParents([parentId])
|
|
61
61
|
}
|
|
62
62
|
|
|
63
63
|
function commitReorder() {
|
package/src/editor/pages.ts
CHANGED
|
@@ -67,26 +67,29 @@ interface PageDrawing {
|
|
|
67
67
|
}
|
|
68
68
|
|
|
69
69
|
/**
|
|
70
|
-
* The other pages that
|
|
71
|
-
*
|
|
72
|
-
*
|
|
70
|
+
* The component sets on other pages that instances on `pageId` show a variant of, nested
|
|
71
|
+
* instances included, and the sets those sets' variants use in turn. Reading a page brings in
|
|
72
|
+
* each such set whole, so its variants can be switched to; they get fonts and layout here
|
|
73
|
+
* rather than their pages, whose other layers the page does not use.
|
|
73
74
|
*/
|
|
74
|
-
export function
|
|
75
|
-
const
|
|
75
|
+
export function componentSetsUsed(graph: SceneGraph, pageId: string): string[] {
|
|
76
|
+
const sets = new Set<string>()
|
|
77
|
+
const pending = [pageId]
|
|
76
78
|
const visit = (id: string): void => {
|
|
77
79
|
for (const node of graph.getChildren(id)) {
|
|
78
80
|
if (node.type === 'INSTANCE') {
|
|
79
81
|
const component = instanceMainComponent(graph, node)
|
|
80
82
|
const set = component?.parentId ? graph.getNode(component.parentId) : undefined
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
83
|
+
if (set?.type === 'COMPONENT_SET' && graph.pageOf(set.id) !== pageId && !sets.has(set.id)) {
|
|
84
|
+
sets.add(set.id)
|
|
85
|
+
pending.push(set.id)
|
|
86
|
+
}
|
|
84
87
|
}
|
|
85
88
|
visit(node.id)
|
|
86
89
|
}
|
|
87
90
|
}
|
|
88
|
-
visit(
|
|
89
|
-
return [...
|
|
91
|
+
for (let id = pending.pop(); id !== undefined; id = pending.pop()) visit(id)
|
|
92
|
+
return [...sets]
|
|
90
93
|
}
|
|
91
94
|
|
|
92
95
|
export function createPageActions(ctx: EditorContext, drawing?: PageDrawing) {
|
|
@@ -141,12 +144,13 @@ export function createPageActions(ctx: EditorContext, drawing?: PageDrawing) {
|
|
|
141
144
|
return false
|
|
142
145
|
}
|
|
143
146
|
|
|
144
|
-
|
|
145
|
-
|
|
147
|
+
/** Loads the fonts the layers under `rootIds` use, with fallbacks for their scripts. */
|
|
148
|
+
async function resolveFonts(
|
|
149
|
+
rootIds: readonly string[],
|
|
146
150
|
pageName: string,
|
|
147
151
|
options: PreparePageOptions
|
|
148
152
|
): Promise<void> {
|
|
149
|
-
const childIds = ctx.graph.getChildren(
|
|
153
|
+
const childIds = rootIds.flatMap((id) => ctx.graph.getChildren(id).map((node) => node.id))
|
|
150
154
|
const toLoad = fontManager.collectFontKeys(ctx.graph, childIds)
|
|
151
155
|
const requirements = collectGraphFontRequirements(ctx.graph, childIds)
|
|
152
156
|
options.onProgress?.({
|
|
@@ -217,23 +221,17 @@ export function createPageActions(ctx: EditorContext, drawing?: PageDrawing) {
|
|
|
217
221
|
options.onProgress?.({ phase: 'populating-page', detail: page.name })
|
|
218
222
|
const populated = await populatePage(pageId, generation, options.signal)
|
|
219
223
|
if (populated === null || generation !== pageSwitchGeneration) return null
|
|
220
|
-
//
|
|
221
|
-
//
|
|
222
|
-
//
|
|
223
|
-
const
|
|
224
|
-
|
|
225
|
-
for (let setPageId = pending.shift(); setPageId !== undefined; setPageId = pending.shift()) {
|
|
226
|
-
if (seen.has(setPageId)) continue
|
|
227
|
-
seen.add(setPageId)
|
|
228
|
-
const ready = await preparePageNodes(setPageId)
|
|
229
|
-
throwIfAborted(options.signal)
|
|
230
|
-
if (!ready || generation !== pageSwitchGeneration) return null
|
|
231
|
-
pending.push(...componentSetPages(ctx.graph, setPageId))
|
|
232
|
-
}
|
|
233
|
-
|
|
234
|
-
await resolvePageFonts(pageId, page.name, options)
|
|
224
|
+
// Switching a variant, in the panel or in preview, needs the rest of its set laid out with
|
|
225
|
+
// its fonts. Reading the page brought each set it uses in whole; those on other pages are
|
|
226
|
+
// laid out here, without the rest of their pages.
|
|
227
|
+
const sets = componentSetsUsed(ctx.graph, pageId)
|
|
228
|
+
await resolveFonts([pageId, ...sets], page.name, options)
|
|
235
229
|
throwIfAborted(options.signal)
|
|
236
230
|
if (generation !== pageSwitchGeneration) return null
|
|
231
|
+
if (sets.length > 0)
|
|
232
|
+
ctx.graph.applyDerivedLayoutDuring(() => {
|
|
233
|
+
for (const setId of sets) computeAllLayouts(ctx.graph, setId)
|
|
234
|
+
})
|
|
237
235
|
// A page visited before keeps the layout it got then, unless something it depends on changed.
|
|
238
236
|
if ((ctx.getRenderer() || populated) && !pageLayouts.isCurrent(pageId)) {
|
|
239
237
|
options.onProgress?.({ phase: 'layout', detail: page.name })
|
|
@@ -248,6 +246,18 @@ export function createPageActions(ctx: EditorContext, drawing?: PageDrawing) {
|
|
|
248
246
|
return generation === pageSwitchGeneration ? { pageId, generation } : null
|
|
249
247
|
}
|
|
250
248
|
|
|
249
|
+
/**
|
|
250
|
+
* Lays out the page on screen again when what sized its text has changed since, as for a page
|
|
251
|
+
* shown before any canvas could measure text, which preparing it leaves to the canvas.
|
|
252
|
+
*/
|
|
253
|
+
function layOutStaleCurrentPage(): void {
|
|
254
|
+
const pageId = ctx.state.currentPageId
|
|
255
|
+
if (ctx.graph.getNode(pageId)?.type !== 'CANVAS' || pageLayouts.isCurrent(pageId)) return
|
|
256
|
+
ctx.graph.applyDerivedLayoutDuring(() => computeAllLayouts(ctx.graph, pageId))
|
|
257
|
+
pageLayouts.record(pageId)
|
|
258
|
+
ctx.requestRender()
|
|
259
|
+
}
|
|
260
|
+
|
|
251
261
|
function commitPageSwitch(prepared: PreparedPage): boolean {
|
|
252
262
|
if (prepared.generation !== pageSwitchGeneration) return false
|
|
253
263
|
const page = ctx.graph.getNode(prepared.pageId)
|
|
@@ -292,7 +302,7 @@ export function createPageActions(ctx: EditorContext, drawing?: PageDrawing) {
|
|
|
292
302
|
async function prepareOffscreenPage(graph: SceneGraph, page: SceneNode): Promise<boolean> {
|
|
293
303
|
const populated = await populatePage(page.id, null)
|
|
294
304
|
if (populated === null || graph !== ctx.graph) return false
|
|
295
|
-
await
|
|
305
|
+
await resolveFonts([page.id], page.name, {})
|
|
296
306
|
if (graph !== ctx.graph) return false
|
|
297
307
|
graph.applyDerivedLayoutDuring(() => computeAllLayouts(graph, page.id))
|
|
298
308
|
return true
|
|
@@ -475,6 +485,7 @@ export function createPageActions(ctx: EditorContext, drawing?: PageDrawing) {
|
|
|
475
485
|
preparePage,
|
|
476
486
|
commitPageSwitch,
|
|
477
487
|
switchPage,
|
|
488
|
+
layOutStaleCurrentPage,
|
|
478
489
|
switchToNextPage: () => switchToAdjacentPage(1),
|
|
479
490
|
switchToPreviousPage: () => switchToAdjacentPage(-1),
|
|
480
491
|
addPage,
|
|
@@ -57,7 +57,7 @@ function variantFor(
|
|
|
57
57
|
}
|
|
58
58
|
|
|
59
59
|
/** Let auto layout size a changed layer's ancestors again, not as a `.fig` file recorded them. */
|
|
60
|
-
function reflow(graph: SceneGraph, nodeId: string): void {
|
|
60
|
+
export function reflow(graph: SceneGraph, nodeId: string): void {
|
|
61
61
|
let current = graph.getNode(nodeId)
|
|
62
62
|
while (current) {
|
|
63
63
|
if (current.derivedLayout) graph.updateNode(current.id, { derivedLayout: null })
|
|
@@ -12,9 +12,11 @@ export const READ_ONLY_ACTIONS: ReadonlySet<string> = new Set([
|
|
|
12
12
|
'canArrangeNodes',
|
|
13
13
|
'canAutoArrangeNodes',
|
|
14
14
|
'canConvertToFrame',
|
|
15
|
+
'canCreateVariations',
|
|
15
16
|
'canDistributeNodes',
|
|
16
17
|
'canEditImage',
|
|
17
18
|
'collectVariantOptions',
|
|
19
|
+
'designMemory',
|
|
18
20
|
'componentInstanceCount',
|
|
19
21
|
'figCompression',
|
|
20
22
|
'findVariantByValues',
|
|
@@ -45,6 +47,8 @@ export const READ_ONLY_ACTIONS: ReadonlySet<string> = new Set([
|
|
|
45
47
|
'getVariableCount',
|
|
46
48
|
'getVariablesByType',
|
|
47
49
|
'getVariablesForCollection',
|
|
50
|
+
'getVariationSet',
|
|
51
|
+
'isVariationOriginalChanged',
|
|
48
52
|
'getVariantOptionAvailability',
|
|
49
53
|
'getVariantOptions',
|
|
50
54
|
'hitTestAtPoint',
|
|
@@ -69,7 +73,9 @@ export const READ_ONLY_ACTIONS: ReadonlySet<string> = new Set([
|
|
|
69
73
|
// Selection and hover
|
|
70
74
|
'clearSelection',
|
|
71
75
|
'enterContainer',
|
|
76
|
+
'enterContainerOf',
|
|
72
77
|
'exitContainer',
|
|
78
|
+
'exitContainers',
|
|
73
79
|
'select',
|
|
74
80
|
'selectAll',
|
|
75
81
|
'selectAtPoint',
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import { emitNavigationTrace } from '#core/profiler'
|
|
2
|
+
|
|
3
|
+
import type { EditorEventName, EditorEvents, EditorState } from './types'
|
|
4
|
+
|
|
5
|
+
type EmitEditorEvent = <K extends EditorEventName>(
|
|
6
|
+
event: K,
|
|
7
|
+
...args: Parameters<EditorEvents[K]>
|
|
8
|
+
) => void
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* How the editor asks the canvas and its views to catch up: a full render after a document
|
|
12
|
+
* change, a repaint of the canvas alone, a refresh of graph views, a text selection change, and
|
|
13
|
+
* the navigation phase that tells drawing a pan or zoom is under way.
|
|
14
|
+
*/
|
|
15
|
+
export function createRenderRequests(state: EditorState, emitEditorEvent: EmitEditorEvent) {
|
|
16
|
+
function requestRender() {
|
|
17
|
+
state.renderVersion++
|
|
18
|
+
state.sceneVersion++
|
|
19
|
+
state.canvasVersion++
|
|
20
|
+
emitNavigationTrace('render:requested', {
|
|
21
|
+
kind: 'render',
|
|
22
|
+
renderVersion: state.renderVersion,
|
|
23
|
+
sceneVersion: state.sceneVersion
|
|
24
|
+
})
|
|
25
|
+
emitEditorEvent('render:requested', {
|
|
26
|
+
renderVersion: state.renderVersion,
|
|
27
|
+
sceneVersion: state.sceneVersion
|
|
28
|
+
})
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* The caret or selection of the edited text moved: the canvas repaints its overlay and the
|
|
33
|
+
* views that follow the selection update, without the document counting as changed.
|
|
34
|
+
*/
|
|
35
|
+
function textSelectionChanged() {
|
|
36
|
+
state.textSelectionVersion++
|
|
37
|
+
requestRepaint()
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
function requestRefresh() {
|
|
41
|
+
state.sceneVersion++
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
function requestRepaint() {
|
|
45
|
+
state.renderVersion++
|
|
46
|
+
emitNavigationTrace('render:requested', {
|
|
47
|
+
kind: 'repaint',
|
|
48
|
+
renderVersion: state.renderVersion,
|
|
49
|
+
sceneVersion: state.sceneVersion
|
|
50
|
+
})
|
|
51
|
+
emitEditorEvent('repaint:requested', {
|
|
52
|
+
renderVersion: state.renderVersion,
|
|
53
|
+
sceneVersion: state.sceneVersion
|
|
54
|
+
})
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
function setNavigationPhase(phase: EditorState['navigation']['phase'], inputAt = 0) {
|
|
58
|
+
const previous = { ...state.navigation }
|
|
59
|
+
const active = phase === 'pan' || phase === 'zoom' || phase === 'momentum'
|
|
60
|
+
const wasActive =
|
|
61
|
+
previous.phase === 'pan' || previous.phase === 'zoom' || previous.phase === 'momentum'
|
|
62
|
+
state.navigation = {
|
|
63
|
+
phase,
|
|
64
|
+
generation: active && !wasActive ? previous.generation + 1 : previous.generation,
|
|
65
|
+
lastInputAt: inputAt || previous.lastInputAt
|
|
66
|
+
}
|
|
67
|
+
if (
|
|
68
|
+
state.navigation.phase !== previous.phase ||
|
|
69
|
+
state.navigation.generation !== previous.generation ||
|
|
70
|
+
state.navigation.lastInputAt !== previous.lastInputAt
|
|
71
|
+
) {
|
|
72
|
+
emitNavigationTrace('navigation:phase', {
|
|
73
|
+
phase: state.navigation.phase,
|
|
74
|
+
previousPhase: previous.phase,
|
|
75
|
+
generation: state.navigation.generation,
|
|
76
|
+
lastInputAt: state.navigation.lastInputAt
|
|
77
|
+
})
|
|
78
|
+
emitEditorEvent('navigation:changed', state.navigation, previous)
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
return { requestRender, requestRefresh, requestRepaint, textSelectionChanged, setNavigationPhase }
|
|
83
|
+
}
|
|
@@ -11,6 +11,18 @@ export function createSelectionContainerActions(ctx: EditorContext) {
|
|
|
11
11
|
ctx.state.enteredContainerId = id
|
|
12
12
|
}
|
|
13
13
|
|
|
14
|
+
/**
|
|
15
|
+
* Enters the container a click reached the layer through, as a double-click would have: its
|
|
16
|
+
* direct parent, unless that is the page or a container a click looks into by itself (a top-level
|
|
17
|
+
* frame, a section, a component set), which is never entered.
|
|
18
|
+
*/
|
|
19
|
+
function enterContainerOf(nodeId: string) {
|
|
20
|
+
const parentId = ctx.graph.getNode(nodeId)?.parentId ?? null
|
|
21
|
+
const entered =
|
|
22
|
+
parentId && parentId !== ctx.state.currentPageId && !ctx.graph.isOpenContainer(parentId)
|
|
23
|
+
ctx.state.enteredContainerId = entered ? parentId : null
|
|
24
|
+
}
|
|
25
|
+
|
|
14
26
|
function exitContainer() {
|
|
15
27
|
const entered = ctx.state.enteredContainerId
|
|
16
28
|
if (!entered) return
|
|
@@ -24,5 +36,16 @@ export function createSelectionContainerActions(ctx: EditorContext) {
|
|
|
24
36
|
ctx.setSelectedIds(new Set(entered ? [entered] : []))
|
|
25
37
|
}
|
|
26
38
|
|
|
27
|
-
|
|
39
|
+
/** Leaves every entered container; Escape then lands on the page and clears the selection. */
|
|
40
|
+
function exitContainers() {
|
|
41
|
+
ctx.state.enteredContainerId = null
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
return {
|
|
45
|
+
validateEnteredContainer,
|
|
46
|
+
enterContainer,
|
|
47
|
+
enterContainerOf,
|
|
48
|
+
exitContainer,
|
|
49
|
+
exitContainers
|
|
50
|
+
}
|
|
28
51
|
}
|
|
@@ -14,14 +14,16 @@ export function createSelectionNavigationActions(ctx: EditorContext, select: Sel
|
|
|
14
14
|
}
|
|
15
15
|
|
|
16
16
|
/**
|
|
17
|
-
*
|
|
18
|
-
*
|
|
17
|
+
* Replaces each selected layer that has children with its children, as Figma's Enter does, and
|
|
18
|
+
* keeps the others selected; a selection where none has children stays. A generated frame, such
|
|
19
|
+
* as a sticky note, has none to offer: its template owns its layers.
|
|
19
20
|
*/
|
|
20
21
|
function selectChildren() {
|
|
21
|
-
const
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
if (
|
|
22
|
+
const nodes = selectedNodes()
|
|
23
|
+
const opens = (node: (typeof nodes)[number]) =>
|
|
24
|
+
!isGeneratedFrame(node) && node.childIds.length > 0
|
|
25
|
+
if (!nodes.some(opens)) return
|
|
26
|
+
select(nodes.flatMap((node) => (opens(node) ? node.childIds : [node.id])))
|
|
25
27
|
}
|
|
26
28
|
|
|
27
29
|
/** Selects the parents of the selected layers; layers directly on the page stay selected. */
|
|
@@ -97,6 +97,7 @@ export function createSelectionOverlayActions(ctx: EditorContext) {
|
|
|
97
97
|
if (
|
|
98
98
|
current?.nodeId === hover?.nodeId &&
|
|
99
99
|
current?.kind === hover?.kind &&
|
|
100
|
+
current?.axis === hover?.axis &&
|
|
100
101
|
current?.index === hover?.index &&
|
|
101
102
|
current?.side === hover?.side
|
|
102
103
|
) {
|
|
@@ -12,7 +12,7 @@ import {
|
|
|
12
12
|
type FigJamLineStyle,
|
|
13
13
|
type FigJamTextSize
|
|
14
14
|
} from '@pairdraw/scene-graph/figjam'
|
|
15
|
-
import {
|
|
15
|
+
import { shapeWithTextKindFields, shapeWithTextLabel } from '@pairdraw/scene-graph/generated'
|
|
16
16
|
import type { ShapeWithTextType } from '@pairdraw/scene-graph/shape-with-text'
|
|
17
17
|
|
|
18
18
|
import { recordSubtreeEdit } from '#core/editor/components/slots/history'
|
|
@@ -60,10 +60,7 @@ export function createShapeWithTextActions(ctx: EditorContext, nodes: NodeAction
|
|
|
60
60
|
'Change shape',
|
|
61
61
|
changing.map((shape) => shape.id),
|
|
62
62
|
(shape) => {
|
|
63
|
-
nodes.updateNode(shape.id,
|
|
64
|
-
shapeWithTextType: kind,
|
|
65
|
-
...shapeWithTextFrameFields(kind, shape.width, shape.height)
|
|
66
|
-
})
|
|
63
|
+
nodes.updateNode(shape.id, shapeWithTextKindFields(shape, kind))
|
|
67
64
|
}
|
|
68
65
|
)
|
|
69
66
|
}
|
|
@@ -105,7 +105,7 @@ export function wrapInAutoLayout(ctx: EditorContext, selectedNodes: SceneNode[])
|
|
|
105
105
|
ctx.graph.deleteNode(frameId)
|
|
106
106
|
order.forEach((id, index) => ctx.graph.insertChildAt(id, parentId, index))
|
|
107
107
|
for (const [id, rect] of geometry) ctx.graph.updateNode(id, rect)
|
|
108
|
-
ctx.
|
|
108
|
+
ctx.runLayoutForParents([parentId])
|
|
109
109
|
ctx.setSelectedIds(prevSelection)
|
|
110
110
|
}
|
|
111
111
|
})
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { SceneGraph, SceneNode } from '@pairdraw/scene-graph'
|
|
1
|
+
import type { BooleanOperation, SceneGraph, SceneNode } from '@pairdraw/scene-graph'
|
|
2
2
|
import { copyFills } from '@pairdraw/scene-graph/copy'
|
|
3
3
|
import {
|
|
4
4
|
fitEnclosingGroups,
|
|
@@ -15,8 +15,6 @@ import type { EditorContext } from '#core/editor/types'
|
|
|
15
15
|
import { canvasWrapIndex, inStackOrder, wrapNodes } from './container-wrap'
|
|
16
16
|
import { selectedNodesInSharedParent } from './selection'
|
|
17
17
|
|
|
18
|
-
export type BooleanOperation = 'UNION' | 'SUBTRACT' | 'INTERSECT' | 'EXCLUDE'
|
|
19
|
-
|
|
20
18
|
/**
|
|
21
19
|
* Wraps sibling layers in a boolean operation named after it, as Figma names one from the canvas
|
|
22
20
|
* and from the plugin API. Shared by the editor command and the plugin API; `props` gives the look.
|
|
@@ -22,11 +22,7 @@ export function fitEnclosingGroupsWithUndo(ctx: EditorContext, parentIds: Iterab
|
|
|
22
22
|
...[...fit.before.keys()].map((id) => ctx.graph.getNode(id)?.parentId),
|
|
23
23
|
...fit.removed.map(({ node }) => node.parentId)
|
|
24
24
|
])
|
|
25
|
-
const layoutAround = () =>
|
|
26
|
-
for (const parentId of new Set(fittedParents)) {
|
|
27
|
-
if (parentId) ctx.runLayoutForNode(parentId)
|
|
28
|
-
}
|
|
29
|
-
}
|
|
25
|
+
const layoutAround = () => ctx.runLayoutForParents(fittedParents)
|
|
30
26
|
layoutAround()
|
|
31
27
|
ctx.undo.push({
|
|
32
28
|
label: 'Fit groups',
|
|
@@ -87,7 +87,7 @@ export function outlineStrokeSelected(
|
|
|
87
87
|
})
|
|
88
88
|
const parentIds = new Set(plan.map((entry) => entry.parentId))
|
|
89
89
|
const prevSelection = new Set(ctx.state.selectedIds)
|
|
90
|
-
|
|
90
|
+
ctx.runLayoutForParents(parentIds)
|
|
91
91
|
ctx.setSelectedIds(new Set(madeIds))
|
|
92
92
|
|
|
93
93
|
// Groups around the outlines fit them, which can reach past the layers they replace, in the
|
|
@@ -121,7 +121,7 @@ function pushOutlineUndo(
|
|
|
121
121
|
forward: () => {
|
|
122
122
|
for (const { node } of plan) ctx.graph.deleteNode(node.id)
|
|
123
123
|
restoreAt(ctx, made)
|
|
124
|
-
|
|
124
|
+
ctx.runLayoutForParents(parentIds)
|
|
125
125
|
ctx.setSelectedIds(new Set(madeIds))
|
|
126
126
|
},
|
|
127
127
|
inverse: () => {
|
|
@@ -135,7 +135,7 @@ function pushOutlineUndo(
|
|
|
135
135
|
snapshot
|
|
136
136
|
}))
|
|
137
137
|
)
|
|
138
|
-
|
|
138
|
+
ctx.runLayoutForParents(parentIds)
|
|
139
139
|
ctx.setSelectedIds(new Set(prevSelection))
|
|
140
140
|
}
|
|
141
141
|
})
|
|
@@ -7,7 +7,6 @@ import { assertNodeEditable } from '#core/editor/capabilities'
|
|
|
7
7
|
import { prepareSlotEdits } from '#core/editor/components/slots'
|
|
8
8
|
import { fitEnclosingGroupsWithUndo } from '#core/editor/structure/group/bounds'
|
|
9
9
|
import type { EditorContext } from '#core/editor/types'
|
|
10
|
-
import { computeLayout } from '#core/layout'
|
|
11
10
|
|
|
12
11
|
export function createStructureReorderActions(ctx: EditorContext) {
|
|
13
12
|
function doReorderChild(nodeId: string, parentId: string, insertIndex: number) {
|
|
@@ -23,8 +22,7 @@ export function createStructureReorderActions(ctx: EditorContext) {
|
|
|
23
22
|
}
|
|
24
23
|
|
|
25
24
|
ctx.graph.insertChildAt(nodeId, parentId, insertIndex)
|
|
26
|
-
|
|
27
|
-
ctx.runLayoutForNode(parentId)
|
|
25
|
+
ctx.runLayoutForParents([parentId])
|
|
28
26
|
}
|
|
29
27
|
|
|
30
28
|
function reorderInAutoLayout(nodeId: string, parentId: string, insertIndex: number) {
|
|
@@ -54,12 +52,7 @@ export function createStructureReorderActions(ctx: EditorContext) {
|
|
|
54
52
|
inverse: () => {
|
|
55
53
|
ctx.graph.insertChildAt(nodeId, origParentId, origIndex >= 0 ? origIndex : 0)
|
|
56
54
|
ctx.graph.updateNode(nodeId, { x: origX, y: origY })
|
|
57
|
-
|
|
58
|
-
ctx.runLayoutForNode(origParentId)
|
|
59
|
-
if (origParentId !== parentId) {
|
|
60
|
-
computeLayout(ctx.graph, parentId)
|
|
61
|
-
ctx.runLayoutForNode(parentId)
|
|
62
|
-
}
|
|
55
|
+
ctx.runLayoutForParents([origParentId, parentId])
|
|
63
56
|
}
|
|
64
57
|
})
|
|
65
58
|
fitEnclosingGroupsWithUndo(ctx, [origParentId])
|
|
@@ -90,8 +83,9 @@ export function createStructureReorderActions(ctx: EditorContext) {
|
|
|
90
83
|
const place = () => {
|
|
91
84
|
if (reparents) ctx.graph.reparentNode(nodeId, newParentId)
|
|
92
85
|
ctx.graph.insertChildAt(nodeId, newParentId, insertIndex)
|
|
93
|
-
|
|
94
|
-
if (reparents) ctx.runLayoutForNode(
|
|
86
|
+
// A new parent can change what the layer inherits, such as its layout direction.
|
|
87
|
+
if (reparents) ctx.runLayoutForNode(nodeId)
|
|
88
|
+
ctx.runLayoutForParents([newParentId, origParentId])
|
|
95
89
|
}
|
|
96
90
|
place()
|
|
97
91
|
|
|
@@ -101,8 +95,8 @@ export function createStructureReorderActions(ctx: EditorContext) {
|
|
|
101
95
|
inverse: () => {
|
|
102
96
|
ctx.graph.insertChildAt(nodeId, origParentId, origIndex)
|
|
103
97
|
ctx.graph.updateNode(nodeId, origPlace)
|
|
104
|
-
ctx.runLayoutForNode(
|
|
105
|
-
|
|
98
|
+
if (reparents) ctx.runLayoutForNode(nodeId)
|
|
99
|
+
ctx.runLayoutForParents([origParentId, newParentId])
|
|
106
100
|
}
|
|
107
101
|
})
|
|
108
102
|
// Groups the layer left or joined fit their layers; a stacking change can move a group's box
|
|
@@ -123,7 +117,7 @@ export function createStructureReorderActions(ctx: EditorContext) {
|
|
|
123
117
|
if (ctx.graph.getNode(parentId)?.childIds[index] === childId) continue
|
|
124
118
|
ctx.graph.insertChildAt(childId, parentId, index)
|
|
125
119
|
}
|
|
126
|
-
ctx.
|
|
120
|
+
ctx.runLayoutForParents([parentId])
|
|
127
121
|
ctx.requestRender()
|
|
128
122
|
}
|
|
129
123
|
|