@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
package/src/tools/read/space.ts
CHANGED
|
@@ -30,7 +30,8 @@ export interface EmptySpace extends Rect {
|
|
|
30
30
|
direction: SpaceDirection | null
|
|
31
31
|
}
|
|
32
32
|
|
|
33
|
-
|
|
33
|
+
/** Whether `rect` comes within `gap` of `obstacle`, or covers part of it when `gap` is 0. */
|
|
34
|
+
export function rectsOverlap(rect: Rect, obstacle: Rect, gap: number): boolean {
|
|
34
35
|
return (
|
|
35
36
|
rect.x < obstacle.x + obstacle.width + gap &&
|
|
36
37
|
rect.x + rect.width + gap > obstacle.x &&
|
|
@@ -67,7 +68,7 @@ function spaceToward(request: EmptySpaceRequest, anchor: Rect, direction: SpaceD
|
|
|
67
68
|
: { x: anchor.x, y: offset, width, height }
|
|
68
69
|
for (const offset of candidates) {
|
|
69
70
|
const rect = place(offset)
|
|
70
|
-
if (!obstacles.some((obstacle) =>
|
|
71
|
+
if (!obstacles.some((obstacle) => rectsOverlap(rect, obstacle, gap))) return rect
|
|
71
72
|
}
|
|
72
73
|
// Unreachable: the farthest candidate clears every obstacle along this axis.
|
|
73
74
|
return place(candidates[candidates.length - 1] ?? start)
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { diffChanges, diffCreate, diffVisual, evalCode } from '#core/tools/analyze'
|
|
2
|
+
import { checkResponsive } from '#core/tools/analyze/responsive'
|
|
2
3
|
import { calc } from '#core/tools/calc'
|
|
3
4
|
import { render } from '#core/tools/create'
|
|
4
5
|
import { describe } from '#core/tools/describe'
|
|
@@ -19,7 +20,7 @@ import { batchUpdate, deleteNode, nodeResize, reparentNode } from '#core/tools/s
|
|
|
19
20
|
import { viewportZoomToFit } from '#core/tools/vector'
|
|
20
21
|
|
|
21
22
|
/**
|
|
22
|
-
* Core tools registered by default in AI chat (
|
|
23
|
+
* Core tools registered by default in AI chat (27 tools, ~5K schema tokens).
|
|
23
24
|
* Covers 90%+ of design sessions: render, describe, modify, structure, and diff checks.
|
|
24
25
|
*/
|
|
25
26
|
export const CORE_TOOLS: ToolDef[] = [
|
|
@@ -52,6 +53,7 @@ export const CORE_TOOLS: ToolDef[] = [
|
|
|
52
53
|
diffCreate,
|
|
53
54
|
diffJSX,
|
|
54
55
|
diffVisual,
|
|
56
|
+
checkResponsive,
|
|
55
57
|
calc,
|
|
56
58
|
evalCode,
|
|
57
59
|
viewportZoomToFit
|
|
@@ -9,7 +9,13 @@ import {
|
|
|
9
9
|
lint,
|
|
10
10
|
lintFix
|
|
11
11
|
} from '#core/tools/analyze'
|
|
12
|
-
import {
|
|
12
|
+
import {
|
|
13
|
+
designToComponentMap,
|
|
14
|
+
designToTokens,
|
|
15
|
+
importDesignTokens,
|
|
16
|
+
syncTokens,
|
|
17
|
+
tokenDrift
|
|
18
|
+
} from '#core/tools/codegen'
|
|
13
19
|
import { addComment, getComments, replyToComment, resolveComment } from '#core/tools/comments'
|
|
14
20
|
import {
|
|
15
21
|
createComponent,
|
|
@@ -33,6 +39,11 @@ import {
|
|
|
33
39
|
searchIconsTool,
|
|
34
40
|
setBehaviour
|
|
35
41
|
} from '#core/tools/create'
|
|
42
|
+
import {
|
|
43
|
+
checkDesignValuesTool,
|
|
44
|
+
getDesignMemory,
|
|
45
|
+
recordDesignDecisionTool
|
|
46
|
+
} from '#core/tools/design-memory'
|
|
36
47
|
import {
|
|
37
48
|
generateImage,
|
|
38
49
|
generateSVG,
|
|
@@ -40,6 +51,7 @@ import {
|
|
|
40
51
|
replaceBackground
|
|
41
52
|
} from '#core/tools/image-ai'
|
|
42
53
|
import {
|
|
54
|
+
replaceFonts,
|
|
43
55
|
setBlend,
|
|
44
56
|
setConstraints,
|
|
45
57
|
setEffects,
|
|
@@ -79,8 +91,10 @@ import { getStatuses, setStatus } from '#core/tools/statuses'
|
|
|
79
91
|
import {
|
|
80
92
|
arrangeNodes,
|
|
81
93
|
cloneNode,
|
|
94
|
+
createVariationsTool,
|
|
82
95
|
flattenNodes,
|
|
83
96
|
groupNodes,
|
|
97
|
+
listVariations,
|
|
84
98
|
nodeAncestors,
|
|
85
99
|
nodeBindings,
|
|
86
100
|
nodeBounds,
|
|
@@ -89,6 +103,7 @@ import {
|
|
|
89
103
|
nodeReplaceWith,
|
|
90
104
|
nodeToComponent,
|
|
91
105
|
nodeTree,
|
|
106
|
+
pickVariation,
|
|
92
107
|
renameNode,
|
|
93
108
|
ungroupNode
|
|
94
109
|
} from '#core/tools/structure'
|
|
@@ -116,6 +131,7 @@ import {
|
|
|
116
131
|
exportImage,
|
|
117
132
|
exportPDF,
|
|
118
133
|
exportSVG,
|
|
134
|
+
exportVideo,
|
|
119
135
|
pathFlip,
|
|
120
136
|
pathGet,
|
|
121
137
|
pathMove,
|
|
@@ -150,6 +166,9 @@ export const EXTENDED_TOOLS: ToolDef[] = [
|
|
|
150
166
|
resolveComment,
|
|
151
167
|
getStatuses,
|
|
152
168
|
setStatus,
|
|
169
|
+
getDesignMemory,
|
|
170
|
+
checkDesignValuesTool,
|
|
171
|
+
recordDesignDecisionTool,
|
|
153
172
|
getFontStatus,
|
|
154
173
|
listFonts,
|
|
155
174
|
listAvailableFonts,
|
|
@@ -191,6 +210,7 @@ export const EXTENDED_TOOLS: ToolDef[] = [
|
|
|
191
210
|
setMinMax,
|
|
192
211
|
setFontRange,
|
|
193
212
|
setTextResize,
|
|
213
|
+
replaceFonts,
|
|
194
214
|
setBlend,
|
|
195
215
|
setLocked,
|
|
196
216
|
setStrokeAlign,
|
|
@@ -212,6 +232,10 @@ export const EXTENDED_TOOLS: ToolDef[] = [
|
|
|
212
232
|
nodeBindings,
|
|
213
233
|
nodeReplaceWith,
|
|
214
234
|
arrangeNodes,
|
|
235
|
+
// Variations: versions of a layer side by side, one of which can replace it
|
|
236
|
+
createVariationsTool,
|
|
237
|
+
listVariations,
|
|
238
|
+
pickVariation,
|
|
215
239
|
// Variables
|
|
216
240
|
listVariables,
|
|
217
241
|
listCollections,
|
|
@@ -241,6 +265,7 @@ export const EXTENDED_TOOLS: ToolDef[] = [
|
|
|
241
265
|
exportSVG,
|
|
242
266
|
exportPDF,
|
|
243
267
|
exportImage,
|
|
268
|
+
exportVideo,
|
|
244
269
|
exportHTML,
|
|
245
270
|
// Analyze & diff
|
|
246
271
|
analyzeColors,
|
|
@@ -257,5 +282,7 @@ export const EXTENDED_TOOLS: ToolDef[] = [
|
|
|
257
282
|
// Codegen
|
|
258
283
|
designToTokens,
|
|
259
284
|
importDesignTokens,
|
|
285
|
+
tokenDrift,
|
|
286
|
+
syncTokens,
|
|
260
287
|
designToComponentMap
|
|
261
288
|
]
|
package/src/tools/schema.ts
CHANGED
|
@@ -26,7 +26,15 @@ export type ToolCapability =
|
|
|
26
26
|
|
|
27
27
|
export type ToolExecution =
|
|
28
28
|
| { kind: 'sync'; mutation: 'none' | 'view' | 'properties' | 'document' }
|
|
29
|
-
| {
|
|
29
|
+
| {
|
|
30
|
+
kind: 'async'
|
|
31
|
+
mutation: 'none' | 'view' | 'document'
|
|
32
|
+
/**
|
|
33
|
+
* The call can run for a long time even when it only reads, such as recording a video, so
|
|
34
|
+
* bridges give it the deadline they give an edit.
|
|
35
|
+
*/
|
|
36
|
+
long?: boolean
|
|
37
|
+
}
|
|
30
38
|
|
|
31
39
|
export type ToolInterface = 'mcp' | 'ai' | 'webmcp'
|
|
32
40
|
export type ToolExposure = Partial<Record<ToolInterface, boolean>>
|
|
@@ -39,6 +47,16 @@ interface ToolMetadata {
|
|
|
39
47
|
exposure: ToolExposure
|
|
40
48
|
capabilities: readonly ToolCapability[]
|
|
41
49
|
availability: 'default' | 'eval'
|
|
50
|
+
/**
|
|
51
|
+
* What a call's values come from, for the document's design memory:
|
|
52
|
+
* - `imported`: outside content, such as a web page, an SVG, a photo or a library component,
|
|
53
|
+
* whose colors and type are its own, so the memory warns about them rather than refusing;
|
|
54
|
+
* - `copied`: the layers the call names, which it copies or converts with their values, such
|
|
55
|
+
* as a clone, a group or a boolean, so values those layers already had are not new.
|
|
56
|
+
* - `merged`: layers the call joins into one, which may take a paint from any of them, such as
|
|
57
|
+
* flatten and boolean operations; a value is only theirs when every named layer had it.
|
|
58
|
+
*/
|
|
59
|
+
content?: 'imported' | 'copied' | 'merged'
|
|
42
60
|
}
|
|
43
61
|
|
|
44
62
|
export interface ToolDef extends ToolMetadata {
|
|
@@ -51,7 +69,8 @@ export interface ToolDef extends ToolMetadata {
|
|
|
51
69
|
* synchronous tool still edits in one step.
|
|
52
70
|
*/
|
|
53
71
|
loadFonts: (figma: FigmaAPI, args: Record<string, unknown>) => Promise<void>
|
|
54
|
-
|
|
72
|
+
/** `signal` aborts a caller's cancelled request, which a long export checks while it runs. */
|
|
73
|
+
execute: (figma: FigmaAPI, args: Record<string, unknown>, signal?: AbortSignal) => unknown
|
|
55
74
|
/**
|
|
56
75
|
* The synchronous answer of a read whose `execute` may load a page first, or `undefined`
|
|
57
76
|
* when answering would load. Hosts that cannot wait refuse on `undefined` before any load.
|
|
@@ -71,7 +90,11 @@ export function defineTool<P extends v.ObjectEntries, R>(
|
|
|
71
90
|
figma: FigmaAPI,
|
|
72
91
|
args: v.InferOutput<v.StrictObjectSchema<P, undefined>>
|
|
73
92
|
) => FigmaFontNameInput[]
|
|
74
|
-
execute: (
|
|
93
|
+
execute: (
|
|
94
|
+
figma: FigmaAPI,
|
|
95
|
+
args: v.InferOutput<v.StrictObjectSchema<P, undefined>>,
|
|
96
|
+
signal?: AbortSignal
|
|
97
|
+
) => R
|
|
75
98
|
executeSync?: (
|
|
76
99
|
figma: FigmaAPI,
|
|
77
100
|
args: v.InferOutput<v.StrictObjectSchema<P, undefined>>
|
|
@@ -96,7 +119,8 @@ export function defineTool<P extends v.ObjectEntries, R>(
|
|
|
96
119
|
if (!parsed.success) return
|
|
97
120
|
for (const font of fonts(figma, parsed.output)) await figma.loadFontAsync(font)
|
|
98
121
|
},
|
|
99
|
-
execute: (figma, args) =>
|
|
122
|
+
execute: (figma, args, signal) =>
|
|
123
|
+
def.execute(figma, parseToolArgs(def.name, def.input, args), signal),
|
|
100
124
|
executeSync: def.executeSync
|
|
101
125
|
? (figma, args) => def.executeSync?.(figma, parseToolArgs(def.name, def.input, args))
|
|
102
126
|
: undefined
|
package/src/tools/stock-photo.ts
CHANGED
|
@@ -17,6 +17,7 @@ export const stockPhoto = defineTool({
|
|
|
17
17
|
'Pass a JSON array; each item is {id, query, index?, orientation?}. ' +
|
|
18
18
|
'Containers with content, text, lines, and structural nodes are rejected.',
|
|
19
19
|
execution: { kind: 'async', mutation: 'document' },
|
|
20
|
+
content: 'imported',
|
|
20
21
|
capabilities: ['document:write', 'network:access'],
|
|
21
22
|
input: v.strictObject({
|
|
22
23
|
requests: v.pipe(
|
|
@@ -4,6 +4,11 @@ import type { LayoutAlign } from '@pairdraw/scene-graph'
|
|
|
4
4
|
|
|
5
5
|
import type { FigmaNodeProxy } from '#core/figma-api'
|
|
6
6
|
import { textFonts } from '#core/tools/modify/text'
|
|
7
|
+
import {
|
|
8
|
+
overflowDirectionInput,
|
|
9
|
+
scrollBehaviorInput,
|
|
10
|
+
scrollRefusal
|
|
11
|
+
} from '#core/tools/modify/update'
|
|
7
12
|
import { defineTool, nodeNotFound, toolNumber } from '#core/tools/schema'
|
|
8
13
|
|
|
9
14
|
const nonNegative = () => toolNumber(v.pipe(v.number(), v.minValue(0)))
|
|
@@ -33,7 +38,9 @@ const batchPropsSchema = v.strictObject({
|
|
|
33
38
|
corner_radius: v.optional(nonNegative()),
|
|
34
39
|
opacity: v.optional(toolNumber(v.pipe(v.number(), v.minValue(0), v.maxValue(1)))),
|
|
35
40
|
auto_resize: v.optional(v.picklist(['NONE', 'WIDTH_AND_HEIGHT', 'HEIGHT', 'TRUNCATE'])),
|
|
36
|
-
direction: v.optional(v.picklist(['HORIZONTAL', 'VERTICAL']))
|
|
41
|
+
direction: v.optional(v.picklist(['HORIZONTAL', 'VERTICAL'])),
|
|
42
|
+
overflow_direction: v.optional(overflowDirectionInput()),
|
|
43
|
+
scroll_behavior: v.optional(scrollBehaviorInput())
|
|
37
44
|
})
|
|
38
45
|
type BatchProps = v.InferOutput<typeof batchPropsSchema>
|
|
39
46
|
|
|
@@ -50,6 +57,20 @@ function parseOperations(operations: BatchOp[] | string): BatchOp[] | { error: s
|
|
|
50
57
|
return { error: `Invalid operations:\n${v.summarize(result.issues)}` }
|
|
51
58
|
}
|
|
52
59
|
|
|
60
|
+
/** The props a frame's auto layout holds; a page holds no layout, so it takes none of them. */
|
|
61
|
+
const LAYOUT_PROPS = [
|
|
62
|
+
'spacing',
|
|
63
|
+
'padding',
|
|
64
|
+
'padding_horizontal',
|
|
65
|
+
'padding_vertical',
|
|
66
|
+
'align',
|
|
67
|
+
'counter_align',
|
|
68
|
+
'sizing_horizontal',
|
|
69
|
+
'sizing_vertical',
|
|
70
|
+
'grow',
|
|
71
|
+
'direction'
|
|
72
|
+
] as const satisfies readonly (keyof BatchProps)[]
|
|
73
|
+
|
|
53
74
|
function applyBatchProps(node: FigmaNodeProxy, props: BatchProps): void {
|
|
54
75
|
if (props.spacing !== undefined) node.itemSpacing = props.spacing
|
|
55
76
|
if (props.padding !== undefined) {
|
|
@@ -77,6 +98,8 @@ function applyBatchProps(node: FigmaNodeProxy, props: BatchProps): void {
|
|
|
77
98
|
if (props.opacity !== undefined) node.opacity = props.opacity
|
|
78
99
|
if (props.auto_resize !== undefined) node.textAutoResize = props.auto_resize
|
|
79
100
|
if (props.direction !== undefined) node.layoutMode = props.direction
|
|
101
|
+
if (props.overflow_direction !== undefined) node.overflowDirection = props.overflow_direction
|
|
102
|
+
if (props.scroll_behavior !== undefined) node.scrollBehavior = props.scroll_behavior
|
|
80
103
|
}
|
|
81
104
|
|
|
82
105
|
export const batchUpdate = defineTool({
|
|
@@ -113,6 +136,16 @@ export const batchUpdate = defineTool({
|
|
|
113
136
|
for (const op of ops) {
|
|
114
137
|
const node = figma.getNodeById(op.id)
|
|
115
138
|
if (!node) return nodeNotFound(op.id)
|
|
139
|
+
// Refused before anything is written, so the batch stays all or nothing.
|
|
140
|
+
if (
|
|
141
|
+
figma.graph.getNode(op.id)?.type === 'CANVAS' &&
|
|
142
|
+
LAYOUT_PROPS.some((key) => op.props[key] !== undefined)
|
|
143
|
+
)
|
|
144
|
+
return {
|
|
145
|
+
error: `A page cannot hold auto layout. Set it on a frame inside the page (${op.id}).`
|
|
146
|
+
}
|
|
147
|
+
const refusal = op.props.overflow_direction === undefined ? null : scrollRefusal(node)
|
|
148
|
+
if (refusal) return { error: refusal }
|
|
116
149
|
targets.push({ node, props: op.props })
|
|
117
150
|
}
|
|
118
151
|
|
|
@@ -26,6 +26,7 @@ export const groupNodes = defineTool({
|
|
|
26
26
|
|
|
27
27
|
description: 'Group selected nodes.',
|
|
28
28
|
execution: { kind: 'sync', mutation: 'document' },
|
|
29
|
+
content: 'copied',
|
|
29
30
|
input: v.strictObject({
|
|
30
31
|
ids: v.pipe(v.array(v.string()), v.minLength(2), v.description('Node IDs to group'))
|
|
31
32
|
}),
|
|
@@ -43,6 +44,7 @@ export const ungroupNode = defineTool({
|
|
|
43
44
|
|
|
44
45
|
description: 'Ungroup a group node.',
|
|
45
46
|
execution: { kind: 'sync', mutation: 'document' },
|
|
47
|
+
content: 'copied',
|
|
46
48
|
input: v.strictObject({
|
|
47
49
|
id: v.pipe(v.string(), v.description('Group node ID'))
|
|
48
50
|
}),
|
|
@@ -59,6 +61,7 @@ export const flattenNodes = defineTool({
|
|
|
59
61
|
|
|
60
62
|
description: 'Flatten nodes into a single vector.',
|
|
61
63
|
execution: { kind: 'sync', mutation: 'document' },
|
|
64
|
+
content: 'merged',
|
|
62
65
|
input: v.strictObject({
|
|
63
66
|
ids: v.pipe(v.array(v.string()), v.minLength(1), v.description('Node IDs to flatten'))
|
|
64
67
|
}),
|
|
@@ -74,6 +77,7 @@ export const nodeToComponent = defineTool({
|
|
|
74
77
|
|
|
75
78
|
description: 'Convert one or more frames/groups into components.',
|
|
76
79
|
execution: { kind: 'sync', mutation: 'document' },
|
|
80
|
+
content: 'copied',
|
|
77
81
|
input: v.strictObject({
|
|
78
82
|
ids: v.pipe(v.array(v.string()), v.minLength(1), v.description('Node IDs to convert'))
|
|
79
83
|
}),
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
import * as v from 'valibot'
|
|
2
|
+
|
|
3
|
+
import { VARIATION_LABEL_MAX_LENGTH, VARIATION_MAX_COUNT } from '@pairdraw/scene-graph/variations'
|
|
4
|
+
|
|
5
|
+
import { PairdrawAPI, type VariationSetHandle } from '#core/pairdraw-api'
|
|
6
|
+
import { defineTool, nodeIdInputSchema, toolFailure, toolNumber } from '#core/tools/schema'
|
|
7
|
+
|
|
8
|
+
/** What an agent does after making versions, returned with them. */
|
|
9
|
+
const NEXT_STEPS =
|
|
10
|
+
'Change each version in its own direction by editing the layers inside it (batch_update, ' +
|
|
11
|
+
"set_*, or render with parent_id or replace_id inside the version); keep each version's root " +
|
|
12
|
+
'layer. Then check them together with export_image of set_id. Do not call pick_variation ' +
|
|
13
|
+
'unless the person asks you to pick or discard.'
|
|
14
|
+
|
|
15
|
+
/** A set as the tools report it. */
|
|
16
|
+
function setResult(set: VariationSetHandle) {
|
|
17
|
+
const { id, original, versions } = set.toJSON()
|
|
18
|
+
return { set_id: id, original, versions }
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export const createVariationsTool = defineTool({
|
|
22
|
+
name: 'create_variations',
|
|
23
|
+
description:
|
|
24
|
+
`Copy a layer 1 to ${VARIATION_MAX_COUNT} times as versions side by side in a section beside it, ` +
|
|
25
|
+
'so the person can compare them and keep one. Label each version with the one idea it tries ' +
|
|
26
|
+
'("Calmer palette", "Denser list"). Then change the layers inside each version with ' +
|
|
27
|
+
'batch_update, set_* or render (parent_id = the version, or replace_id = a layer inside it); ' +
|
|
28
|
+
"keep each version's own root layer, since a version whose root becomes another kind of " +
|
|
29
|
+
'layer (a frame for an instance) cannot replace the original. Check them all at once with ' +
|
|
30
|
+
'export_image of the set id. The original does not change. On a version, it copies that ' +
|
|
31
|
+
'version into the same set. Leave picking to the person (pick_variation).',
|
|
32
|
+
execution: { kind: 'sync', mutation: 'document' },
|
|
33
|
+
input: v.strictObject({
|
|
34
|
+
id: v.pipe(nodeIdInputSchema, v.description('Layer to vary, or a version to copy')),
|
|
35
|
+
count: toolNumber(
|
|
36
|
+
v.pipe(
|
|
37
|
+
v.number(),
|
|
38
|
+
v.integer(),
|
|
39
|
+
v.minValue(1),
|
|
40
|
+
v.maxValue(VARIATION_MAX_COUNT),
|
|
41
|
+
v.description('How many versions to make')
|
|
42
|
+
)
|
|
43
|
+
),
|
|
44
|
+
labels: v.optional(
|
|
45
|
+
v.pipe(
|
|
46
|
+
v.array(v.pipe(v.string(), v.maxLength(VARIATION_LABEL_MAX_LENGTH))),
|
|
47
|
+
v.maxLength(VARIATION_MAX_COUNT),
|
|
48
|
+
v.description('What each version tries, in order; one per version at most')
|
|
49
|
+
)
|
|
50
|
+
)
|
|
51
|
+
}),
|
|
52
|
+
execute: (figma, { id, count, labels }) => {
|
|
53
|
+
try {
|
|
54
|
+
const { set, versions } = new PairdrawAPI(figma).createVariations(id, { count, labels })
|
|
55
|
+
const { original } = set.toJSON()
|
|
56
|
+
return {
|
|
57
|
+
set_id: set.id,
|
|
58
|
+
original_id: original?.id ?? id,
|
|
59
|
+
versions: versions.map((version) => ({ id: version.id, name: version.name })),
|
|
60
|
+
next: NEXT_STEPS
|
|
61
|
+
}
|
|
62
|
+
} catch (error) {
|
|
63
|
+
return toolFailure(error)
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
})
|
|
67
|
+
|
|
68
|
+
export const listVariations = defineTool({
|
|
69
|
+
name: 'list_variations',
|
|
70
|
+
description:
|
|
71
|
+
'List sets of variations: the set holding a layer (its section, a version, or a layer ' +
|
|
72
|
+
'inside one), or every set on the current page, each with its original and versions.',
|
|
73
|
+
execution: { kind: 'sync', mutation: 'none' },
|
|
74
|
+
input: v.strictObject({
|
|
75
|
+
id: v.optional(v.pipe(nodeIdInputSchema, v.description('A layer in the set to read')))
|
|
76
|
+
}),
|
|
77
|
+
execute: (figma, { id }) => {
|
|
78
|
+
try {
|
|
79
|
+
const pairdraw = new PairdrawAPI(figma)
|
|
80
|
+
if (id === undefined) return { sets: pairdraw.variations.map(setResult) }
|
|
81
|
+
const set = pairdraw.getVariations(id)
|
|
82
|
+
return { sets: set ? [setResult(set)] : [] }
|
|
83
|
+
} catch (error) {
|
|
84
|
+
return toolFailure(error)
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
})
|
|
88
|
+
|
|
89
|
+
export const pickVariation = defineTool({
|
|
90
|
+
name: 'pick_variation',
|
|
91
|
+
description:
|
|
92
|
+
'Only when the person asked to pick or discard: keep one version of a set of variations in ' +
|
|
93
|
+
'place of its original, which keeps its id, name, and place, and remove the rest; or discard ' +
|
|
94
|
+
'them all with keep: null.',
|
|
95
|
+
execution: { kind: 'sync', mutation: 'document' },
|
|
96
|
+
input: v.strictObject({
|
|
97
|
+
set_id: v.pipe(nodeIdInputSchema, v.description('The set, or any layer in it')),
|
|
98
|
+
keep: v.pipe(
|
|
99
|
+
v.nullable(nodeIdInputSchema),
|
|
100
|
+
v.description('The version to keep, or null to discard every version')
|
|
101
|
+
)
|
|
102
|
+
}),
|
|
103
|
+
execute: (figma, { set_id, keep }) => {
|
|
104
|
+
try {
|
|
105
|
+
const set = new PairdrawAPI(figma).getVariations(set_id)
|
|
106
|
+
if (!set) return { error: `"${set_id}" is not in a set of variations` }
|
|
107
|
+
const { original, versions } = set.toJSON()
|
|
108
|
+
if (keep === null) {
|
|
109
|
+
set.discard()
|
|
110
|
+
return { original_id: original?.id ?? null, kept: null, removed: versions.length }
|
|
111
|
+
}
|
|
112
|
+
const kept = set.use(keep)
|
|
113
|
+
return { original_id: kept.id, kept: keep, removed: versions.length - 1 }
|
|
114
|
+
} catch (error) {
|
|
115
|
+
return toolFailure(error)
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
})
|
package/src/tools/structure.ts
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import type { FontFaceReference } from '#core/text/replace-fonts'
|
|
2
|
+
|
|
1
3
|
/**
|
|
2
4
|
* The curated visual directions `get_style` serves, by id. Each one is Pairdraw's own: tokens
|
|
3
5
|
* here and its written direction in `guides/<id>.md`.
|
|
@@ -29,10 +31,7 @@ export const STYLE_ARCHETYPE_IDS = [
|
|
|
29
31
|
export type StyleArchetypeId = (typeof STYLE_ARCHETYPE_IDS)[number]
|
|
30
32
|
|
|
31
33
|
/** A font face as the text tools name it: a family the web font services carry and a style. */
|
|
32
|
-
export
|
|
33
|
-
family: string
|
|
34
|
-
style: string
|
|
35
|
-
}
|
|
34
|
+
export type StyleFont = FontFaceReference
|
|
36
35
|
|
|
37
36
|
/** The colors of a direction by role, as hex. Text roles meet WCAG AA on what they sit on. */
|
|
38
37
|
export interface StylePalette {
|
|
@@ -23,6 +23,7 @@ export const booleanUnion = defineTool({
|
|
|
23
23
|
|
|
24
24
|
description: 'Union (combine) multiple nodes.',
|
|
25
25
|
execution: { kind: 'sync', mutation: 'document' },
|
|
26
|
+
content: 'merged',
|
|
26
27
|
input: v.strictObject({
|
|
27
28
|
ids: v.pipe(v.array(v.string()), v.minLength(2), v.description('Node IDs to union'))
|
|
28
29
|
}),
|
|
@@ -36,6 +37,7 @@ export const booleanSubtract = defineTool({
|
|
|
36
37
|
|
|
37
38
|
description: 'Subtract the second node from the first.',
|
|
38
39
|
execution: { kind: 'sync', mutation: 'document' },
|
|
40
|
+
content: 'merged',
|
|
39
41
|
input: v.strictObject({
|
|
40
42
|
ids: v.pipe(v.array(v.string()), v.minLength(2), v.description('Node IDs (first minus rest)'))
|
|
41
43
|
}),
|
|
@@ -49,6 +51,7 @@ export const booleanIntersect = defineTool({
|
|
|
49
51
|
|
|
50
52
|
description: 'Intersect multiple nodes.',
|
|
51
53
|
execution: { kind: 'sync', mutation: 'document' },
|
|
54
|
+
content: 'merged',
|
|
52
55
|
input: v.strictObject({
|
|
53
56
|
ids: v.pipe(v.array(v.string()), v.minLength(2), v.description('Node IDs to intersect'))
|
|
54
57
|
}),
|
|
@@ -62,6 +65,7 @@ export const booleanExclude = defineTool({
|
|
|
62
65
|
|
|
63
66
|
description: 'Exclude (XOR) multiple nodes.',
|
|
64
67
|
execution: { kind: 'sync', mutation: 'document' },
|
|
68
|
+
content: 'merged',
|
|
65
69
|
input: v.strictObject({
|
|
66
70
|
ids: v.pipe(v.array(v.string()), v.minLength(2), v.description('Node IDs to exclude'))
|
|
67
71
|
}),
|
package/src/tools/vector/path.ts
CHANGED
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import * as v from 'valibot'
|
|
2
2
|
|
|
3
3
|
import type { SceneNode, VectorNetwork } from '@pairdraw/scene-graph'
|
|
4
|
-
import { cloneVectorNetwork } from '@pairdraw/scene-graph/vector-network'
|
|
4
|
+
import { cloneVectorNetwork, transformVectorNetwork } from '@pairdraw/scene-graph/vector-network'
|
|
5
5
|
|
|
6
6
|
import type { FigmaAPI } from '#core/figma-api'
|
|
7
7
|
import { defineTool, nodeIdInputSchema, nodeInputSchema, toolNumber } from '#core/tools/schema'
|
|
8
8
|
import { parseVectorNetworkJSON } from '#core/tools/vector/network'
|
|
9
|
+
import { computeAccurateBounds } from '#core/vector/curve-math'
|
|
10
|
+
import { regenerateFillGeometry } from '#core/vector/fill-geometry'
|
|
9
11
|
|
|
10
12
|
function getVectorNode(
|
|
11
13
|
figma: FigmaAPI,
|
|
@@ -17,6 +19,28 @@ function getVectorNode(
|
|
|
17
19
|
return { node, vn: cloneVectorNetwork(node.vectorNetwork) }
|
|
18
20
|
}
|
|
19
21
|
|
|
22
|
+
/**
|
|
23
|
+
* Writes an edited path as the plugin API's vectorNetwork setter does: the layer's box fits the
|
|
24
|
+
* path, the vertices rebase to it, and imported fillGeometry rebuilds from the new path so fills
|
|
25
|
+
* follow the edit instead of drawing the old shape.
|
|
26
|
+
*/
|
|
27
|
+
function writePath(figma: FigmaAPI, node: SceneNode, network: VectorNetwork): void {
|
|
28
|
+
const bounds = computeAccurateBounds(network)
|
|
29
|
+
const hasGeometry = network.vertices.length > 0
|
|
30
|
+
const rebased = hasGeometry
|
|
31
|
+
? transformVectorNetwork([1, 0, -bounds.x, 0, 1, -bounds.y, 0, 0, 1], network)
|
|
32
|
+
: network
|
|
33
|
+
figma.graph.updateNode(node.id, {
|
|
34
|
+
x: hasGeometry ? node.x + bounds.x : node.x,
|
|
35
|
+
y: hasGeometry ? node.y + bounds.y : node.y,
|
|
36
|
+
width: hasGeometry ? bounds.width : 0,
|
|
37
|
+
height: hasGeometry ? bounds.height : 0,
|
|
38
|
+
vectorNetwork: rebased,
|
|
39
|
+
fillGeometry: regenerateFillGeometry(rebased, node.fillGeometry, node.cornerRadius),
|
|
40
|
+
strokeGeometry: []
|
|
41
|
+
})
|
|
42
|
+
}
|
|
43
|
+
|
|
20
44
|
export const pathGet = defineTool({
|
|
21
45
|
name: 'path_get',
|
|
22
46
|
description: 'Get vector path data of a node.',
|
|
@@ -45,7 +69,7 @@ export const pathSet = defineTool({
|
|
|
45
69
|
if (!raw) return { error: `Node "${args.id}" not found` }
|
|
46
70
|
const parsed = parseVectorNetworkJSON(args.path)
|
|
47
71
|
if ('error' in parsed) return parsed
|
|
48
|
-
figma
|
|
72
|
+
writePath(figma, raw, parsed.network)
|
|
49
73
|
return { id: args.id }
|
|
50
74
|
}
|
|
51
75
|
})
|
|
@@ -76,7 +100,7 @@ export const pathScale = defineTool({
|
|
|
76
100
|
segment.tangentEnd.y *= factor
|
|
77
101
|
}
|
|
78
102
|
|
|
79
|
-
figma
|
|
103
|
+
writePath(figma, raw, vn)
|
|
80
104
|
return { id, factor }
|
|
81
105
|
}
|
|
82
106
|
})
|
|
@@ -107,7 +131,7 @@ export const pathFlip = defineTool({
|
|
|
107
131
|
else segment.tangentEnd.y = -segment.tangentEnd.y
|
|
108
132
|
}
|
|
109
133
|
|
|
110
|
-
figma
|
|
134
|
+
writePath(figma, raw, vn)
|
|
111
135
|
return { id, axis }
|
|
112
136
|
}
|
|
113
137
|
})
|
|
@@ -125,13 +149,13 @@ export const pathMove = defineTool({
|
|
|
125
149
|
execute: (figma, { id, dx, dy }) => {
|
|
126
150
|
const result = getVectorNode(figma, id)
|
|
127
151
|
if ('error' in result) return result
|
|
128
|
-
const { vn } = result
|
|
152
|
+
const { node: raw, vn } = result
|
|
129
153
|
for (const vertex of vn.vertices) {
|
|
130
154
|
vertex.x += dx
|
|
131
155
|
vertex.y += dy
|
|
132
156
|
}
|
|
133
157
|
|
|
134
|
-
figma
|
|
158
|
+
writePath(figma, raw, vn)
|
|
135
159
|
return { id, dx, dy }
|
|
136
160
|
}
|
|
137
161
|
})
|
|
@@ -40,6 +40,7 @@ export const vectorizeImage = defineTool({
|
|
|
40
40
|
description:
|
|
41
41
|
'Convert the image a layer shows (its topmost visible image fill, on a layer of any kind) into editable vector paths with the vectorize service the user set up in Settings. The original layer stays; the paths go in a new frame beside it, whose id is returned. It sends the image to that service with the user’s own key and can take a few minutes, so call it only when the user asks for vectors from an image.',
|
|
42
42
|
execution: { kind: 'async', mutation: 'document' },
|
|
43
|
+
content: 'imported',
|
|
43
44
|
capabilities: ['document:write', 'network:access'],
|
|
44
45
|
input: v.strictObject({
|
|
45
46
|
id: v.pipe(nodeIdInputSchema, v.description('Layer whose image fill to vectorize'))
|