@pairdraw/core 0.19.2 → 0.21.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/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 +46 -0
- package/dist/canvas/noise/shader.d.ts.map +1 -0
- package/dist/canvas/noise/shader.js +166 -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 +74 -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/renderer/chunks/index.d.ts +1 -1
- package/dist/canvas/renderer/colors.d.ts +20 -5
- package/dist/canvas/renderer/colors.d.ts.map +1 -1
- package/dist/canvas/renderer/colors.js +48 -42
- package/dist/canvas/renderer/colors.js.map +1 -1
- package/dist/canvas/renderer/document-surface.d.ts +25 -0
- package/dist/canvas/renderer/document-surface.d.ts.map +1 -0
- package/dist/canvas/renderer/document-surface.js +46 -0
- package/dist/canvas/renderer/document-surface.js.map +1 -0
- package/dist/canvas/renderer/fonts.d.ts.map +1 -1
- package/dist/canvas/renderer/fonts.js +6 -4
- 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 +10 -3
- package/dist/canvas/renderer/lifecycle.js.map +1 -1
- package/dist/canvas/renderer/methods.d.ts.map +1 -1
- package/dist/canvas/renderer/methods.js +1 -0
- package/dist/canvas/renderer/methods.js.map +1 -1
- package/dist/canvas/renderer/pipeline.d.ts.map +1 -1
- package/dist/canvas/renderer/pipeline.js +36 -3
- 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/retained-backing.d.ts.map +1 -1
- package/dist/canvas/renderer/retained-backing.js +2 -1
- package/dist/canvas/renderer/retained-backing.js.map +1 -1
- 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/tiles/surface-pool.d.ts.map +1 -1
- package/dist/canvas/renderer/tiles/surface-pool.js +2 -7
- package/dist/canvas/renderer/tiles/surface-pool.js.map +1 -1
- package/dist/canvas/renderer/types.d.ts +18 -3
- 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 +42 -4
- package/dist/canvas/renderer.d.ts.map +1 -1
- package/dist/canvas/renderer.js +57 -5
- 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 +45 -12
- package/dist/canvas/scene.js.map +1 -1
- package/dist/canvas/shaders/effect.d.ts.map +1 -1
- package/dist/canvas/shaders/effect.js +2 -1
- package/dist/canvas/shaders/effect.js.map +1 -1
- package/dist/canvas/shadows/shape.d.ts.map +1 -1
- package/dist/canvas/shadows/shape.js +4 -2
- package/dist/canvas/shadows/shape.js.map +1 -1
- package/dist/canvas/shadows/silhouette.js +1 -1
- package/dist/canvas/shadows.d.ts.map +1 -1
- package/dist/canvas/shadows.js +4 -2
- package/dist/canvas/shadows.js.map +1 -1
- package/dist/canvas/text/decorations.d.ts +2 -2
- package/dist/canvas/text/decorations.d.ts.map +1 -1
- package/dist/canvas/text/decorations.js +5 -5
- package/dist/canvas/text/decorations.js.map +1 -1
- package/dist/canvas/text/index.js +1 -1
- package/dist/canvas/text/index.js.map +1 -1
- package/dist/canvas/text/paragraph/index.d.ts +2 -2
- package/dist/canvas/text/paragraph/index.d.ts.map +1 -1
- package/dist/canvas/text/paragraph/index.js +16 -5
- package/dist/canvas/text/paragraph/index.js.map +1 -1
- package/dist/canvas/text/renderer.d.ts +2 -1
- package/dist/canvas/text/renderer.d.ts.map +1 -1
- package/dist/canvas/text/shape.js +4 -4
- package/dist/canvas/text/shape.js.map +1 -1
- package/dist/canvas/texture.d.ts +20 -0
- package/dist/canvas/texture.d.ts.map +1 -0
- package/dist/canvas/texture.js +101 -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/renderer.d.ts.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/clipboard/assets.d.ts.map +1 -1
- package/dist/editor/clipboard/assets.js +3 -3
- package/dist/editor/clipboard/assets.js.map +1 -1
- package/dist/editor/clipboard/component-matches.d.ts +13 -0
- package/dist/editor/clipboard/component-matches.d.ts.map +1 -0
- package/dist/editor/clipboard/component-matches.js +50 -0
- package/dist/editor/clipboard/component-matches.js.map +1 -0
- package/dist/editor/clipboard/dependencies.d.ts +7 -0
- package/dist/editor/clipboard/dependencies.d.ts.map +1 -1
- package/dist/editor/clipboard/dependencies.js +5 -0
- package/dist/editor/clipboard/dependencies.js.map +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.d.ts.map +1 -1
- package/dist/editor/clipboard.js +48 -19
- package/dist/editor/clipboard.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/properties.d.ts.map +1 -1
- package/dist/editor/components/properties.js +3 -3
- package/dist/editor/components/properties.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 +26 -2
- package/dist/editor/create.d.ts.map +1 -1
- package/dist/editor/create.js +16 -60
- 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 +171 -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 +9 -2
- 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 +4 -2
- 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/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 +4 -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/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 +4 -0
- package/dist/editor/selection.d.ts +5 -0
- package/dist/editor/selection.d.ts.map +1 -1
- package/dist/editor/shapes/pencil.js +1 -1
- package/dist/editor/structure/state.d.ts.map +1 -1
- package/dist/editor/structure/state.js +2 -2
- package/dist/editor/structure/state.js.map +1 -1
- package/dist/editor/text.d.ts.map +1 -1
- package/dist/editor/text.js +2 -2
- package/dist/editor/text.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 +5 -1
- package/dist/editor/types.d.ts.map +1 -1
- package/dist/editor/variables.js +3 -3
- 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.js +3 -0
- 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/fresh-read.d.ts +15 -0
- package/dist/figma-api/fresh-read.d.ts.map +1 -0
- package/dist/figma-api/fresh-read.js +54 -0
- package/dist/figma-api/fresh-read.js.map +1 -0
- package/dist/figma-api/graph-ref.d.ts +9 -0
- package/dist/figma-api/graph-ref.d.ts.map +1 -0
- package/dist/figma-api/graph-ref.js +14 -0
- package/dist/figma-api/graph-ref.js.map +1 -0
- package/dist/figma-api/index.d.ts +11 -1
- package/dist/figma-api/index.d.ts.map +1 -1
- package/dist/figma-api/index.js +16 -4
- 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/pending-layout.d.ts +3 -3
- package/dist/figma-api/pending-layout.d.ts.map +1 -1
- package/dist/figma-api/pending-layout.js +7 -3
- package/dist/figma-api/pending-layout.js.map +1 -1
- package/dist/figma-api/pending-sync.d.ts +1 -1
- package/dist/figma-api/pending-sync.d.ts.map +1 -1
- package/dist/figma-api/pending-sync.js +3 -1
- package/dist/figma-api/pending-sync.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 +2 -1
- package/dist/figma-api/proxy.js.map +1 -1
- package/dist/figma-api/reactions.d.ts +59 -15
- package/dist/figma-api/reactions.d.ts.map +1 -1
- package/dist/figma-api/reactions.js +160 -32
- package/dist/figma-api/reactions.js.map +1 -1
- package/dist/figma-api/render-bounds.js +1 -1
- package/dist/figma-api/surface.d.ts +6 -3
- package/dist/figma-api/surface.d.ts.map +1 -1
- package/dist/figma-api/surface.js +6 -2
- package/dist/figma-api/surface.js.map +1 -1
- package/dist/figma-api/transform.d.ts +1 -1
- package/dist/figma-api/variables/index.d.ts.map +1 -1
- package/dist/figma-api/variables/index.js +2 -2
- package/dist/figma-api/variables/index.js.map +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/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/css/known.js +1 -1
- package/dist/io/formats/design-tokens/css/known.js.map +1 -1
- package/dist/io/formats/design-tokens/css/read.d.ts +3 -1
- package/dist/io/formats/design-tokens/css/read.d.ts.map +1 -1
- package/dist/io/formats/design-tokens/css/read.js +11 -5
- package/dist/io/formats/design-tokens/css/read.js.map +1 -1
- package/dist/io/formats/design-tokens/css/sync.d.ts.map +1 -1
- package/dist/io/formats/design-tokens/css/sync.js +17 -4
- package/dist/io/formats/design-tokens/css/sync.js.map +1 -1
- package/dist/io/formats/design-tokens/css/values.d.ts +6 -5
- package/dist/io/formats/design-tokens/css/values.d.ts.map +1 -1
- package/dist/io/formats/design-tokens/css/values.js +24 -8
- package/dist/io/formats/design-tokens/css/values.js.map +1 -1
- package/dist/io/formats/design-tokens/decode.d.ts +7 -6
- package/dist/io/formats/design-tokens/decode.d.ts.map +1 -1
- package/dist/io/formats/design-tokens/decode.js +14 -13
- package/dist/io/formats/design-tokens/decode.js.map +1 -1
- package/dist/io/formats/design-tokens/export.js +3 -3
- package/dist/io/formats/design-tokens/export.js.map +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/plan/index.d.ts.map +1 -1
- package/dist/io/formats/design-tokens/plan/index.js +4 -3
- package/dist/io/formats/design-tokens/plan/index.js.map +1 -1
- package/dist/io/formats/design-tokens/plan/styles.d.ts.map +1 -1
- package/dist/io/formats/design-tokens/plan/styles.js +9 -9
- package/dist/io/formats/design-tokens/plan/styles.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 +4 -4
- package/dist/io/formats/design-tokens/styles.d.ts.map +1 -1
- package/dist/io/formats/design-tokens/styles.js +7 -7
- 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/design-tokens/values.d.ts +10 -5
- package/dist/io/formats/design-tokens/values.d.ts.map +1 -1
- package/dist/io/formats/design-tokens/values.js +13 -7
- package/dist/io/formats/design-tokens/values.js.map +1 -1
- 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.js +1 -0
- package/dist/io/formats/drawio/index.js.map +1 -1
- package/dist/io/formats/drawio/placement.d.ts +1 -1
- package/dist/io/formats/drawio/warnings.js +2 -2
- package/dist/io/formats/drawio/warnings.js.map +1 -1
- package/dist/io/formats/fig/export/index.d.ts.map +1 -1
- package/dist/io/formats/fig/export/index.js +15 -3
- package/dist/io/formats/fig/export/index.js.map +1 -1
- package/dist/io/formats/fig/export/patch/index.d.ts.map +1 -1
- package/dist/io/formats/fig/export/patch/index.js +7 -1
- package/dist/io/formats/fig/export/patch/index.js.map +1 -1
- package/dist/io/formats/fig/export/setup.d.ts +7 -2
- package/dist/io/formats/fig/export/setup.d.ts.map +1 -1
- package/dist/io/formats/fig/export/setup.js +12 -13
- package/dist/io/formats/fig/export/setup.js.map +1 -1
- package/dist/io/formats/fig/export/variables.d.ts.map +1 -1
- package/dist/io/formats/fig/export/variables.js +9 -7
- package/dist/io/formats/fig/export/variables.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/vectors.d.ts +2 -1
- package/dist/io/formats/html/vectors.d.ts.map +1 -1
- package/dist/io/formats/html/vectors.js +4 -2
- package/dist/io/formats/html/vectors.js.map +1 -1
- package/dist/io/formats/mermaid/layers.js +2 -2
- package/dist/io/formats/mermaid/layers.js.map +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/export.d.ts.map +1 -1
- package/dist/io/formats/pdf/export.js +1 -0
- package/dist/io/formats/pdf/export.js.map +1 -1
- package/dist/io/formats/pdf/prepare.d.ts +4 -4
- package/dist/io/formats/pdf/prepare.d.ts.map +1 -1
- package/dist/io/formats/pdf/prepare.js +2 -2
- package/dist/io/formats/pdf/prepare.js.map +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 +35 -5
- 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/pptx/style.js +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 +1 -1
- package/dist/io/formats/raster/render.d.ts.map +1 -1
- package/dist/io/formats/raster/render.js +13 -4
- package/dist/io/formats/raster/render.js.map +1 -1
- package/dist/io/formats/svg/defs.d.ts +10 -8
- package/dist/io/formats/svg/defs.d.ts.map +1 -1
- package/dist/io/formats/svg/defs.js +13 -64
- 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 +11 -2
- package/dist/io/formats/svg/export.d.ts.map +1 -1
- package/dist/io/formats/svg/export.js +177 -37
- package/dist/io/formats/svg/export.js.map +1 -1
- package/dist/io/formats/svg/filter.d.ts +30 -0
- package/dist/io/formats/svg/filter.d.ts.map +1 -0
- package/dist/io/formats/svg/filter.js +48 -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/import.d.ts +4 -2
- package/dist/io/formats/svg/import.d.ts.map +1 -1
- package/dist/io/formats/svg/import.js +2 -1
- package/dist/io/formats/svg/import.js.map +1 -1
- 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/export.d.ts.map +1 -1
- package/dist/io/formats/svg/text/export.js +8 -8
- package/dist/io/formats/svg/text/export.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 +8 -5
- 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 +41 -11
- package/dist/io/formats.js.map +1 -1
- package/dist/io/subgraph.d.ts.map +1 -1
- package/dist/io/subgraph.js +1 -1
- package/dist/io/subgraph.js.map +1 -1
- package/dist/io/types.d.ts +20 -5
- package/dist/io/types.d.ts.map +1 -1
- package/dist/kiwi/fig/parse/transfer.d.ts +1 -1
- package/dist/kiwi/fig/session/options.d.ts +3 -0
- package/dist/kiwi/fig/session/options.d.ts.map +1 -1
- package/dist/kiwi/fig/session/options.js +4 -0
- package/dist/kiwi/fig/session/options.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/yoga-helpers.d.ts +2 -1
- package/dist/layout/yoga-helpers.d.ts.map +1 -1
- package/dist/layout/yoga-helpers.js +7 -1
- 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 +26 -2
- package/dist/layout.js.map +1 -1
- package/dist/lint/fixes.d.ts.map +1 -1
- package/dist/lint/fixes.js +10 -4
- 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 +12 -0
- package/dist/lint/linter.d.ts.map +1 -1
- package/dist/lint/linter.js +112 -10
- 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/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/types.d.ts +25 -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/comments.d.ts +4 -1
- package/dist/pairdraw-api/comments.d.ts.map +1 -1
- package/dist/pairdraw-api/comments.js +5 -0
- package/dist/pairdraw-api/comments.js.map +1 -1
- 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 +48 -4
- package/dist/pairdraw-api/index.d.ts.map +1 -1
- package/dist/pairdraw-api/index.js +59 -6
- package/dist/pairdraw-api/index.js.map +1 -1
- package/dist/pairdraw-api/nodes.d.ts +13 -2
- 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/analyze-commands.js +1 -1
- package/dist/rpc/read-commands.d.ts +2 -2
- package/dist/rpc/read-commands.js +2 -2
- package/dist/rpc/read-commands.js.map +1 -1
- package/dist/rpc/variables-command.js +2 -2
- package/dist/rpc/variables-command.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 +60 -1
- package/dist/text/font/manager.js.map +1 -1
- package/dist/text/font/provider.d.ts +15 -0
- package/dist/text/font/provider.d.ts.map +1 -0
- package/dist/text/font/provider.js +18 -0
- package/dist/text/font/provider.js.map +1 -0
- package/dist/text/font/readiness.d.ts +32 -0
- package/dist/text/font/readiness.d.ts.map +1 -0
- package/dist/text/font/{status.js → readiness.js} +8 -4
- package/dist/text/font/readiness.js.map +1 -0
- package/dist/text/index.d.ts +12 -9
- package/dist/text/index.js +6 -3
- package/dist/text/prepare.d.ts +9 -4
- package/dist/text/prepare.d.ts.map +1 -1
- package/dist/text/prepare.js +9 -4
- package/dist/text/prepare.js.map +1 -1
- 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/colors.js +1 -1
- 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 +192 -0
- package/dist/tools/analyze/responsive/index.js.map +1 -0
- package/dist/tools/analyze/responsive/widths.d.ts +27 -0
- package/dist/tools/analyze/responsive/widths.d.ts.map +1 -0
- package/dist/tools/analyze/responsive/widths.js +49 -0
- package/dist/tools/analyze/responsive/widths.js.map +1 -0
- package/dist/tools/analyze.d.ts +3 -1
- package/dist/tools/analyze.js +3 -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/tokens.d.ts.map +1 -1
- package/dist/tools/codegen/tokens.js +2 -2
- package/dist/tools/codegen/tokens.js.map +1 -1
- package/dist/tools/codegen.d.ts +2 -1
- package/dist/tools/codegen.js +2 -1
- package/dist/tools/comments.d.ts.map +1 -1
- package/dist/tools/comments.js +2 -2
- package/dist/tools/comments.js.map +1 -1
- package/dist/tools/component-catalog.d.ts.map +1 -1
- package/dist/tools/component-catalog.js +5 -3
- package/dist/tools/component-catalog.js.map +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.d.ts.map +1 -1
- package/dist/tools/create/html.js +2 -3
- 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 +1 -0
- package/dist/tools/create/mermaid.js.map +1 -1
- package/dist/tools/create/svg.js +5 -1
- package/dist/tools/create/svg.js.map +1 -1
- package/dist/tools/create/vector.js +2 -2
- package/dist/tools/create/vector.js.map +1 -1
- package/dist/tools/css/shorthand.d.ts +20 -0
- package/dist/tools/css/shorthand.d.ts.map +1 -0
- package/dist/tools/css/shorthand.js +54 -0
- package/dist/tools/css/shorthand.js.map +1 -0
- package/dist/tools/describe/index.js +2 -2
- package/dist/tools/describe/index.js.map +1 -1
- package/dist/tools/describe/issues.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/html-host.d.ts.map +1 -1
- package/dist/tools/html-host.js +5 -3
- package/dist/tools/html-host.js.map +1 -1
- package/dist/tools/image-ai/apply.d.ts.map +1 -1
- package/dist/tools/image-ai/apply.js +1 -3
- package/dist/tools/image-ai/apply.js.map +1 -1
- package/dist/tools/image-ai/generate.d.ts.map +1 -1
- package/dist/tools/image-ai/generate.js +2 -0
- package/dist/tools/image-ai/generate.js.map +1 -1
- package/dist/tools/image-ai/service.d.ts.map +1 -1
- package/dist/tools/image-ai/service.js +5 -3
- package/dist/tools/image-ai/service.js.map +1 -1
- package/dist/tools/index.d.ts +3 -1
- package/dist/tools/index.js +3 -1
- package/dist/tools/modify/effects.js +1 -1
- package/dist/tools/modify/effects.js.map +1 -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/geometry.d.ts.map +1 -1
- package/dist/tools/modify/geometry.js +14 -3
- package/dist/tools/modify/geometry.js.map +1 -1
- package/dist/tools/modify/layout.d.ts.map +1 -1
- package/dist/tools/modify/layout.js +35 -8
- package/dist/tools/modify/layout.js.map +1 -1
- package/dist/tools/modify/matching.d.ts.map +1 -1
- package/dist/tools/modify/matching.js +10 -10
- package/dist/tools/modify/matching.js.map +1 -1
- package/dist/tools/modify/paint.d.ts.map +1 -1
- package/dist/tools/modify/paint.js +56 -4
- package/dist/tools/modify/paint.js.map +1 -1
- package/dist/tools/modify/reactions.d.ts.map +1 -1
- package/dist/tools/modify/reactions.js +2 -2
- 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 +29 -8
- 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/prompts/codegen.js +1 -1
- package/dist/tools/prompts/codegen.js.map +1 -1
- package/dist/tools/read/css.d.ts +14 -0
- package/dist/tools/read/css.d.ts.map +1 -0
- package/dist/tools/read/css.js +306 -0
- package/dist/tools/read/css.js.map +1 -0
- 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 +1 -0
- package/dist/tools/read/libraries.js.map +1 -1
- package/dist/tools/read/reactions.js +1 -1
- package/dist/tools/read/reactions.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 -5
- package/dist/tools/read/space.js.map +1 -1
- package/dist/tools/read.d.ts +2 -1
- package/dist/tools/read.js +2 -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 +5 -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 +24 -6
- package/dist/tools/schema.d.ts.map +1 -1
- package/dist/tools/schema.js +10 -6
- package/dist/tools/schema.js.map +1 -1
- package/dist/tools/script/host.d.ts.map +1 -1
- package/dist/tools/script/host.js +5 -3
- package/dist/tools/script/host.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 +8 -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/variables/collections.js +1 -1
- package/dist/tools/variables/collections.js.map +1 -1
- package/dist/tools/variables/values.d.ts.map +1 -1
- package/dist/tools/variables/values.js +4 -4
- package/dist/tools/variables/values.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/vectorize.d.ts.map +1 -1
- package/dist/tools/vector/vectorize.js +7 -4
- 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 +21 -0
- package/dist/tools/video-host.js.map +1 -0
- package/dist/vector/point-transform.d.ts +1 -1
- package/dist/vector/vectorize/svg/gradients.d.ts +2 -2
- package/dist/vector/vectorize/svg/gradients.d.ts.map +1 -1
- package/dist/vector/vectorize/svg/gradients.js +5 -5
- package/dist/vector/vectorize/svg/gradients.js.map +1 -1
- package/dist/vector/vectorize/svg/to-vectors.d.ts +3 -1
- package/dist/vector/vectorize/svg/to-vectors.d.ts.map +1 -1
- package/dist/vector/vectorize/svg/to-vectors.js +13 -12
- package/dist/vector/vectorize/svg/to-vectors.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 +169 -0
- package/src/canvas/noise/table.ts +91 -0
- package/src/canvas/noise/tile.ts +95 -0
- package/src/canvas/overlays/auto-layout-hover.ts +47 -65
- package/src/canvas/renderer/colors.ts +76 -50
- package/src/canvas/renderer/document-surface.ts +53 -0
- package/src/canvas/renderer/fonts.ts +6 -4
- package/src/canvas/renderer/lifecycle.ts +10 -4
- package/src/canvas/renderer/methods.ts +1 -0
- package/src/canvas/renderer/pipeline.ts +40 -4
- package/src/canvas/renderer/play-scenes.ts +51 -0
- package/src/canvas/renderer/retained-backing.ts +2 -1
- package/src/canvas/renderer/tiles/cache.ts +54 -1
- package/src/canvas/renderer/tiles/controller.ts +30 -1
- package/src/canvas/renderer/tiles/surface-pool.ts +9 -7
- package/src/canvas/renderer/types.ts +18 -2
- package/src/canvas/renderer.ts +76 -14
- package/src/canvas/scene.ts +69 -12
- package/src/canvas/shaders/effect.ts +2 -1
- package/src/canvas/shadows/shape.ts +4 -2
- package/src/canvas/shadows.ts +5 -2
- package/src/canvas/text/decorations.ts +15 -5
- package/src/canvas/text/index.ts +9 -1
- package/src/canvas/text/paragraph/index.ts +16 -6
- package/src/canvas/text/renderer.ts +2 -1
- package/src/canvas/text/shape.ts +4 -4
- package/src/canvas/texture.ts +137 -0
- package/src/clipboard.ts +23 -10
- package/src/constants.ts +6 -0
- 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/assets.ts +6 -2
- package/src/editor/clipboard/component-matches.ts +65 -0
- package/src/editor/clipboard/dependencies.ts +22 -1
- package/src/editor/clipboard/export.ts +24 -7
- package/src/editor/clipboard.ts +74 -20
- package/src/editor/components/instances.ts +31 -0
- package/src/editor/components/properties.ts +3 -2
- package/src/editor/create.ts +25 -69
- 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 +208 -0
- package/src/editor/fonts.ts +19 -0
- package/src/editor/history/atomic-tool.ts +32 -3
- package/src/editor/history/capture.ts +19 -0
- package/src/editor/history/document-change.ts +5 -17
- package/src/editor/history/edit.ts +11 -1
- package/src/editor/history/subtree.ts +13 -2
- package/src/editor/index.ts +11 -0
- package/src/editor/pages.ts +40 -29
- package/src/editor/play/states.ts +1 -1
- package/src/editor/read-only/actions.ts +4 -0
- package/src/editor/render-requests.ts +83 -0
- package/src/editor/selection/overlays.ts +1 -0
- package/src/editor/structure/state.ts +2 -1
- package/src/editor/text.ts +2 -1
- package/src/editor/tool-registry.ts +2 -1
- package/src/editor/types.ts +4 -0
- package/src/editor/variables.ts +3 -3
- 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 +7 -0
- 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/fresh-read.ts +57 -0
- package/src/figma-api/graph-ref.ts +13 -0
- package/src/figma-api/index.ts +22 -4
- package/src/figma-api/overrides.ts +295 -3
- package/src/figma-api/paints.ts +24 -9
- package/src/figma-api/pending-layout.ts +7 -3
- package/src/figma-api/pending-sync.ts +4 -1
- package/src/figma-api/proxy.ts +8 -2
- package/src/figma-api/reactions.ts +212 -33
- package/src/figma-api/surface.ts +6 -2
- package/src/figma-api/variables/index.ts +5 -4
- package/src/global.d.ts +26 -0
- package/src/io/formats/boolean-path.ts +60 -0
- package/src/io/formats/design-tokens/css/known.ts +1 -1
- package/src/io/formats/design-tokens/css/read.ts +20 -7
- package/src/io/formats/design-tokens/css/sync.ts +9 -4
- package/src/io/formats/design-tokens/css/values.ts +37 -9
- package/src/io/formats/design-tokens/decode.ts +17 -12
- package/src/io/formats/design-tokens/export.ts +3 -3
- 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/plan/index.ts +6 -5
- package/src/io/formats/design-tokens/plan/styles.ts +37 -10
- package/src/io/formats/design-tokens/project.ts +40 -9
- package/src/io/formats/design-tokens/styles.ts +20 -9
- package/src/io/formats/design-tokens/sync/apply.ts +130 -0
- package/src/io/formats/design-tokens/sync/drift.ts +589 -0
- package/src/io/formats/design-tokens/sync/files.ts +40 -0
- package/src/io/formats/design-tokens/values.ts +15 -8
- 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 +2 -0
- package/src/io/formats/drawio/warnings.ts +2 -2
- package/src/io/formats/fig/export/index.ts +36 -3
- package/src/io/formats/fig/export/patch/index.ts +12 -1
- package/src/io/formats/fig/export/setup.ts +25 -15
- package/src/io/formats/fig/export/variables.ts +17 -6
- 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/vectors.ts +9 -2
- package/src/io/formats/mermaid/layers.ts +2 -2
- package/src/io/formats/pdf/document.ts +14 -4
- package/src/io/formats/pdf/export.ts +1 -0
- package/src/io/formats/pdf/prepare.ts +6 -6
- package/src/io/formats/pen/imports.ts +5 -6
- package/src/io/formats/pen/index.ts +41 -7
- 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 +24 -5
- package/src/io/formats/svg/defs.ts +24 -80
- package/src/io/formats/svg/effects.ts +131 -0
- package/src/io/formats/svg/export.ts +295 -49
- package/src/io/formats/svg/filter.ts +57 -0
- package/src/io/formats/svg/grain.ts +249 -0
- package/src/io/formats/svg/import.ts +6 -3
- package/src/io/formats/svg/strokes.ts +2 -2
- package/src/io/formats/svg/text/export.ts +10 -8
- package/src/io/formats/svg/text/layout.ts +15 -5
- 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 +66 -11
- package/src/io/subgraph.ts +4 -1
- package/src/io/types.ts +29 -10
- package/src/kiwi/fig/session/options.ts +4 -1
- package/src/layout/auto-layout-handles.ts +396 -0
- package/src/layout/yoga-helpers.ts +8 -0
- package/src/layout.ts +49 -1
- package/src/lint/fixes.ts +12 -3
- package/src/lint/index.ts +3 -1
- package/src/lint/linter.ts +108 -11
- package/src/lint/presets.ts +2 -0
- package/src/lint/rules/design-memory.ts +97 -0
- package/src/lint/rules/index.ts +6 -1
- package/src/lint/rules/no-unbound-token-values.ts +73 -0
- package/src/lint/types.ts +32 -0
- package/src/node/video.ts +196 -0
- package/src/pairdraw-api/comments.ts +6 -0
- package/src/pairdraw-api/design-memory.ts +61 -0
- package/src/pairdraw-api/index.ts +88 -9
- 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/read-commands.ts +4 -4
- package/src/rpc/variables-command.ts +2 -2
- package/src/text/font/features.ts +27 -0
- package/src/text/font/manager.ts +79 -1
- package/src/text/font/provider.ts +26 -0
- package/src/text/font/{status.ts → readiness.ts} +13 -9
- package/src/text/index.ts +4 -1
- package/src/text/prepare.ts +9 -4
- package/src/text/replace-fonts.ts +171 -0
- package/src/tools/analyze/responsive/index.ts +257 -0
- package/src/tools/analyze/responsive/widths.ts +63 -0
- package/src/tools/analyze.ts +4 -0
- package/src/tools/codegen/token-sync.ts +98 -0
- package/src/tools/codegen/tokens.ts +4 -2
- package/src/tools/codegen.ts +1 -0
- package/src/tools/comments.ts +6 -4
- package/src/tools/component-catalog.ts +5 -3
- package/src/tools/create/components.ts +4 -0
- package/src/tools/create/html.ts +1 -3
- package/src/tools/create/icons.ts +2 -1
- package/src/tools/create/mermaid.ts +1 -0
- package/src/tools/create/svg.ts +5 -1
- package/src/tools/create/vector.ts +2 -2
- package/src/tools/css/shorthand.ts +64 -0
- package/src/tools/describe/index.ts +2 -8
- package/src/tools/design-memory.ts +72 -0
- package/src/tools/html-host.ts +5 -3
- package/src/tools/image-ai/apply.ts +0 -2
- package/src/tools/image-ai/generate.ts +2 -0
- package/src/tools/image-ai/service.ts +5 -3
- package/src/tools/index.ts +3 -0
- package/src/tools/modify/effects.ts +1 -1
- package/src/tools/modify/fonts.ts +34 -0
- package/src/tools/modify/geometry.ts +16 -3
- package/src/tools/modify/layout.ts +47 -13
- package/src/tools/modify/matching.ts +14 -11
- package/src/tools/modify/paint.ts +85 -5
- package/src/tools/modify/reactions.ts +16 -8
- package/src/tools/modify/text.ts +56 -15
- package/src/tools/modify/update.ts +46 -2
- package/src/tools/modify.ts +1 -0
- package/src/tools/prompts/codegen.md +2 -1
- package/src/tools/read/css.ts +365 -0
- package/src/tools/read/fonts.ts +24 -2
- package/src/tools/read/libraries.ts +1 -0
- package/src/tools/read/reactions.ts +3 -2
- package/src/tools/read/space.ts +3 -4
- package/src/tools/read.ts +1 -0
- package/src/tools/registry/core.ts +5 -2
- package/src/tools/registry/extended.ts +28 -1
- package/src/tools/schema.ts +42 -9
- package/src/tools/script/host.ts +6 -3
- package/src/tools/stock-photo.ts +1 -0
- package/src/tools/structure/basic.ts +1 -0
- package/src/tools/structure/batch.ts +12 -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/variables/collections.ts +1 -1
- package/src/tools/variables/values.ts +16 -5
- package/src/tools/vector/boolean.ts +4 -0
- package/src/tools/vector/vectorize.ts +11 -4
- package/src/tools/vector/video.ts +228 -0
- package/src/tools/vector.ts +1 -0
- package/src/tools/video-host.ts +20 -0
- package/src/vector/vectorize/svg/gradients.ts +8 -5
- package/src/vector/vectorize/svg/to-vectors.ts +48 -14
- package/dist/text/font/status.d.ts +0 -28
- package/dist/text/font/status.d.ts.map +0 -1
- package/dist/text/font/status.js.map +0 -1
package/src/tools/comments.ts
CHANGED
|
@@ -16,9 +16,10 @@ export const getComments = defineTool({
|
|
|
16
16
|
name: 'get_comments',
|
|
17
17
|
description:
|
|
18
18
|
'Read the comments people left on the canvas, oldest first: each thread with its text, ' +
|
|
19
|
-
'author, page, the layer it is pinned to, its position,
|
|
20
|
-
'
|
|
21
|
-
'feedback to act on, then reply_to_comment
|
|
19
|
+
'author, page, the layer it is pinned to, its position, the marked area it was drawn ' +
|
|
20
|
+
'around when it has one, replies, and whether it is resolved. Open threads only unless ' +
|
|
21
|
+
'includeResolved is set. Use it to find review feedback to act on, then reply_to_comment ' +
|
|
22
|
+
'and resolve_comment.',
|
|
22
23
|
execution: { kind: 'sync', mutation: 'none' },
|
|
23
24
|
input: v.strictObject({
|
|
24
25
|
includeResolved: v.optional(v.pipe(v.boolean(), v.description('Also list resolved threads'))),
|
|
@@ -45,7 +46,8 @@ export const addComment = defineTool({
|
|
|
45
46
|
name: 'add_comment',
|
|
46
47
|
description:
|
|
47
48
|
'Leave a comment on the canvas, as a person does with the Comment tool: pinned on a layer ' +
|
|
48
|
-
'by ID, which it then follows, or at x, y on a page.
|
|
49
|
+
'by ID, which it then follows, or at x, y on a page. A comment may carry a stroke the person ' +
|
|
50
|
+
'drew around the area to change. Text may use Markdown: **bold**, ' +
|
|
49
51
|
'*italic*, ~~strikethrough~~, [links](https://…), and - or 1. lists.',
|
|
50
52
|
execution: { kind: 'sync', mutation: 'document' },
|
|
51
53
|
input: v.strictObject({
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { underlyingGraph } from '#core/figma-api/graph-ref'
|
|
1
2
|
import type { LibraryAssetDescriptor, LibrarySummary } from '#core/library'
|
|
2
3
|
|
|
3
4
|
export type ComponentCatalogSource = 'document' | 'libraries' | 'all'
|
|
@@ -34,12 +35,13 @@ export interface ComponentCatalog {
|
|
|
34
35
|
const catalogs = new WeakMap<object, ComponentCatalog>()
|
|
35
36
|
|
|
36
37
|
export function registerComponentCatalog(owner: object, catalog: ComponentCatalog): () => void {
|
|
37
|
-
|
|
38
|
+
const target = underlyingGraph(owner)
|
|
39
|
+
catalogs.set(target, catalog)
|
|
38
40
|
return () => {
|
|
39
|
-
if (catalogs.get(
|
|
41
|
+
if (catalogs.get(target) === catalog) catalogs.delete(target)
|
|
40
42
|
}
|
|
41
43
|
}
|
|
42
44
|
|
|
43
45
|
export function getComponentCatalog(owner: object): ComponentCatalog | undefined {
|
|
44
|
-
return catalogs.get(owner)
|
|
46
|
+
return catalogs.get(underlyingGraph(owner))
|
|
45
47
|
}
|
|
@@ -9,6 +9,7 @@ export const createComponent = defineTool({
|
|
|
9
9
|
|
|
10
10
|
description: 'Convert a frame/group into a component.',
|
|
11
11
|
execution: { kind: 'sync', mutation: 'document' },
|
|
12
|
+
content: 'copied',
|
|
12
13
|
input: v.strictObject({
|
|
13
14
|
id: v.pipe(v.string(), v.description('Node ID to convert'))
|
|
14
15
|
}),
|
|
@@ -25,6 +26,7 @@ export const createInstance = defineTool({
|
|
|
25
26
|
|
|
26
27
|
description: 'Create an instance of a component.',
|
|
27
28
|
execution: { kind: 'sync', mutation: 'document' },
|
|
29
|
+
content: 'copied',
|
|
28
30
|
input: v.strictObject({
|
|
29
31
|
component_id: v.pipe(v.string(), v.description('Component node ID')),
|
|
30
32
|
x: v.optional(toolNumber(v.pipe(v.number(), v.description('X position')))),
|
|
@@ -48,6 +50,7 @@ export const combineAsVariants = defineTool({
|
|
|
48
50
|
'as Figma names variants, "State=On, Size=Large", get those variant properties; names like ' +
|
|
49
51
|
'"Button/Primary" derive a Variant property from the segments after the first slash.',
|
|
50
52
|
execution: { kind: 'sync', mutation: 'document' },
|
|
53
|
+
content: 'copied',
|
|
51
54
|
input: v.strictObject({
|
|
52
55
|
ids: v.pipe(v.array(v.string()), v.minLength(1), v.description('Component node IDs to combine'))
|
|
53
56
|
}),
|
|
@@ -112,6 +115,7 @@ export const detachInstance = defineTool({
|
|
|
112
115
|
description:
|
|
113
116
|
'Detach instances into plain frames, keeping their children, overrides, and position.',
|
|
114
117
|
execution: { kind: 'sync', mutation: 'document' },
|
|
118
|
+
content: 'copied',
|
|
115
119
|
input: v.strictObject({
|
|
116
120
|
ids: v.pipe(v.array(v.string()), v.minLength(1), v.description('Instance node IDs to detach'))
|
|
117
121
|
}),
|
package/src/tools/create/html.ts
CHANGED
|
@@ -4,7 +4,6 @@ import type { SceneGraph } from '@pairdraw/scene-graph'
|
|
|
4
4
|
import { getAxisAlignedBoundsInParent } from '@pairdraw/scene-graph/coordinate'
|
|
5
5
|
import { applyGraphTransfer, prepareGraphTransfer } from '@pairdraw/scene-graph/transfer'
|
|
6
6
|
|
|
7
|
-
import { flushPendingLayout } from '#core/figma-api'
|
|
8
7
|
import { prepareSlotInsertion } from '#core/figma-api/slots'
|
|
9
8
|
import { sceneGraphFromStyledHTML } from '#core/io/formats/html/layers'
|
|
10
9
|
import { findPageId } from '#core/io/subgraph'
|
|
@@ -18,6 +17,7 @@ export const importHTML = defineTool({
|
|
|
18
17
|
description:
|
|
19
18
|
'Import HTML and CSS as editable layers in the open document, styled as a browser styles them: flex and grid become auto layout, and text, fills, borders, radii, shadows, and images carry over. <style> blocks in the HTML apply; css adds a stylesheet; tailwind compiles the Tailwind classes the markup uses. Without x and y the layers go to the right of what the parent already holds. Returns the ids of the top-level layers.',
|
|
20
19
|
execution: { kind: 'async', mutation: 'document' },
|
|
20
|
+
content: 'imported',
|
|
21
21
|
input: v.strictObject({
|
|
22
22
|
html: v.pipe(
|
|
23
23
|
v.string(),
|
|
@@ -61,8 +61,6 @@ export const importHTML = defineTool({
|
|
|
61
61
|
const bounds = getAxisAlignedBoundsInParent(roots, page.id, source)
|
|
62
62
|
let topLeft = { x: args.x ?? 0, y: args.y ?? 0 }
|
|
63
63
|
if (args.x === undefined || args.y === undefined) {
|
|
64
|
-
// What an earlier edit changed may not be laid out yet, and the free space depends on it.
|
|
65
|
-
flushPendingLayout(graph)
|
|
66
64
|
const beside = spaceBesideContent(graph, parentId, bounds)
|
|
67
65
|
topLeft = { x: args.x ?? beside.x, y: args.y ?? beside.y }
|
|
68
66
|
}
|
|
@@ -99,6 +99,7 @@ export const insertIcon = defineTool({
|
|
|
99
99
|
description:
|
|
100
100
|
'Insert one or more vector icons onto the canvas. Pass a single name or multiple names to batch-insert into the same parent. If already cached by fetch_icons — instant, no network request. Material Symbols icons (material-symbols-outlined, -rounded, -sharp) take weight, fill, grade, and optical_size; the icon keeps them when swapped.',
|
|
101
101
|
execution: { kind: 'async', mutation: 'document' },
|
|
102
|
+
content: 'imported',
|
|
102
103
|
capabilities: ['document:write', 'network:access'],
|
|
103
104
|
input: v.strictObject({
|
|
104
105
|
names: v.optional(
|
|
@@ -129,7 +130,7 @@ export const insertIcon = defineTool({
|
|
|
129
130
|
if (names.length === 0) return { error: 'Provide "names" (array) or "name" (string)' }
|
|
130
131
|
|
|
131
132
|
const size = args.size ?? 24
|
|
132
|
-
const parsedColor = parseToolColor(args.color ?? '#000000')
|
|
133
|
+
const parsedColor = parseToolColor(args.color ?? '#000000', figma.graph.documentColorSpace)
|
|
133
134
|
if ('error' in parsedColor) return parsedColor
|
|
134
135
|
const options = iconOptions(args)
|
|
135
136
|
|
|
@@ -16,6 +16,7 @@ export const importMermaid = defineTool({
|
|
|
16
16
|
description:
|
|
17
17
|
'Import a Mermaid flowchart (`flowchart` or `graph`) as editable FigJam layers, laid out automatically so nothing overlaps: each node a shape with text in its Mermaid shape, each subgraph a section, and each edge an elbowed connector joined to the layers it links, with its arrowheads, dotted or thick line, and label. classDef, class, and style fills, strokes, and text colours carry over. Without x and y the diagram goes to the right of what the parent already holds. Returns the layer id of every node and subgraph and the connector id of every edge, by Mermaid id.',
|
|
18
18
|
execution: { kind: 'async', mutation: 'document' },
|
|
19
|
+
content: 'imported',
|
|
19
20
|
input: v.strictObject({
|
|
20
21
|
mermaid: v.pipe(
|
|
21
22
|
v.string(),
|
package/src/tools/create/svg.ts
CHANGED
|
@@ -10,6 +10,7 @@ export const importSVG = defineTool({
|
|
|
10
10
|
description:
|
|
11
11
|
'Import raw SVG markup onto the canvas as editable layers, as pasting it into Figma does: a frame (a group when the SVG has no width, height, or viewBox) with a group per <g>, a vector per shape, and a text layer per <text>, named by their ids, and a mask group around clipped content. Supports common SVG shapes, text with <tspan> styles, inherited presentation attributes, opacity, transforms, gradients, clip paths, and internal <use> references.',
|
|
12
12
|
execution: { kind: 'async', mutation: 'document' },
|
|
13
|
+
content: 'imported',
|
|
13
14
|
input: v.strictObject({
|
|
14
15
|
svg: v.pipe(
|
|
15
16
|
v.string(),
|
|
@@ -36,7 +37,10 @@ export const importSVG = defineTool({
|
|
|
36
37
|
execute: async (figma, args) => {
|
|
37
38
|
if (!args.svg || typeof args.svg !== 'string') return { error: 'svg parameter is required' }
|
|
38
39
|
|
|
39
|
-
const data = prepareSVGImport(args.svg, {
|
|
40
|
+
const data = prepareSVGImport(args.svg, {
|
|
41
|
+
defaultColor: args.color,
|
|
42
|
+
profile: figma.graph.documentColorSpace
|
|
43
|
+
})
|
|
40
44
|
// Text is measured and placed as it is created, so its fonts load first.
|
|
41
45
|
await Promise.all(
|
|
42
46
|
(data ? svgImportFonts(data) : []).map(({ family, style }) =>
|
|
@@ -75,9 +75,9 @@ export const createVector = defineTool({
|
|
|
75
75
|
parsedPath = parsed
|
|
76
76
|
}
|
|
77
77
|
// Both colours are read before the node exists, so a bad one creates nothing.
|
|
78
|
-
const fill = parseOptionalToolColor(args.fill)
|
|
78
|
+
const fill = parseOptionalToolColor(args.fill, figma.graph.documentColorSpace)
|
|
79
79
|
if ('error' in fill) return fill
|
|
80
|
-
const stroke = parseOptionalToolColor(args.stroke)
|
|
80
|
+
const stroke = parseOptionalToolColor(args.stroke, figma.graph.documentColorSpace)
|
|
81
81
|
if ('error' in stroke) return stroke
|
|
82
82
|
const parent = args.parent_id ? figma.getNodeById(args.parent_id) : null
|
|
83
83
|
if (parent) prepareSlotInsertion(figma.graph, parent.id, 'create_vector')
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CSS length shorthand for tool setters: `padding: 16px 24px`, `gap: 12px 4px`, `radius: 8px 8px 0 0`.
|
|
3
|
+
* The parser is the one place a shorthand string becomes numbers, so a setter can refuse bad input
|
|
4
|
+
* before it touches a node.
|
|
5
|
+
*/
|
|
6
|
+
import { compact } from 'es-toolkit/array'
|
|
7
|
+
import * as v from 'valibot'
|
|
8
|
+
|
|
9
|
+
export type LengthShorthand = number | string
|
|
10
|
+
|
|
11
|
+
/** How many lengths a field reads; the result always has four, in CSS order. */
|
|
12
|
+
export type LengthSlots = 1 | 2 | 4
|
|
13
|
+
|
|
14
|
+
const LENGTH = /^(-?\d+(?:\.\d+)?)(?:px)?$/
|
|
15
|
+
|
|
16
|
+
function expand(values: number[], slots: LengthSlots): number[] {
|
|
17
|
+
const [first = 0, second = first] = values
|
|
18
|
+
if (slots === 1) return [first]
|
|
19
|
+
if (slots === 2) return [first, second]
|
|
20
|
+
const [, , third = first, fourth = second] = values
|
|
21
|
+
return [first, second, third, fourth]
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Four lengths in CSS order (top right bottom left, or the four corners), or an `error` naming the
|
|
26
|
+
* field so the caller can return it as the tool's refusal.
|
|
27
|
+
*/
|
|
28
|
+
export function parseLengthShorthand(
|
|
29
|
+
value: LengthShorthand,
|
|
30
|
+
slots: LengthSlots,
|
|
31
|
+
field: string
|
|
32
|
+
): number[] | { error: string } {
|
|
33
|
+
if (typeof value === 'number') {
|
|
34
|
+
if (!Number.isFinite(value)) return { error: `"${field}" expects a finite number` }
|
|
35
|
+
if (value < 0) return { error: `"${field}" must not be negative` }
|
|
36
|
+
return expand([value], slots)
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
const parts = compact(value.trim().split(/\s+/))
|
|
40
|
+
if (parts.length === 0) return { error: `"${field}" expects at least one length` }
|
|
41
|
+
if (parts.length > slots) {
|
|
42
|
+
return { error: `"${field}" takes 1 to ${slots} lengths, got ${parts.length}` }
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
const numbers: number[] = []
|
|
46
|
+
for (const part of parts) {
|
|
47
|
+
const match = LENGTH.exec(part)
|
|
48
|
+
if (!match) return { error: `"${field}" expects px lengths, got "${part}"` }
|
|
49
|
+
numbers.push(Number(match[1]))
|
|
50
|
+
}
|
|
51
|
+
if (numbers.some((value) => value < 0)) return { error: `"${field}" must not be negative` }
|
|
52
|
+
return expand(numbers, slots)
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* A tool input that takes a length or the CSS shorthand for one: the parser decides what the
|
|
57
|
+
* string means, so the schema only has to accept it.
|
|
58
|
+
*/
|
|
59
|
+
export function lengthShorthandInput(description: string) {
|
|
60
|
+
return v.union([
|
|
61
|
+
v.pipe(v.number(), v.minValue(0), v.maxValue(Number.MAX_VALUE), v.description(description)),
|
|
62
|
+
v.pipe(v.string(), v.description(description))
|
|
63
|
+
])
|
|
64
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as v from 'valibot'
|
|
2
2
|
|
|
3
|
-
import {
|
|
3
|
+
import { defineTool, nodeIdsField, toolNumber } from '#core/tools/schema'
|
|
4
4
|
|
|
5
5
|
import { autoDepth, describeOneNode } from './tree'
|
|
6
6
|
|
|
@@ -12,13 +12,7 @@ export const describe = defineTool({
|
|
|
12
12
|
exposure: { webmcp: false },
|
|
13
13
|
input: v.strictObject({
|
|
14
14
|
id: v.optional(v.pipe(v.string(), v.description('Node ID (single node)'))),
|
|
15
|
-
ids:
|
|
16
|
-
v.pipe(
|
|
17
|
-
v.array(v.string()),
|
|
18
|
-
v.minLength(1),
|
|
19
|
-
v.description('Node IDs (multiple nodes in one call)')
|
|
20
|
-
)
|
|
21
|
-
),
|
|
15
|
+
ids: nodeIdsField('Node IDs (multiple nodes in one call)'),
|
|
22
16
|
depth: v.optional(
|
|
23
17
|
toolNumber(v.pipe(v.number(), v.description('Override depth (auto if omitted, max: 5)')))
|
|
24
18
|
),
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import * as v from 'valibot'
|
|
2
|
+
|
|
3
|
+
import { PairdrawAPI } from '#core/pairdraw-api'
|
|
4
|
+
import { defineTool, toolFailure } from '#core/tools/schema'
|
|
5
|
+
|
|
6
|
+
function valuesInput<T extends v.GenericSchema>(description: string, value: T) {
|
|
7
|
+
return v.optional(v.pipe(v.array(value), v.maxLength(64), v.description(description)))
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export const getDesignMemory = defineTool({
|
|
11
|
+
name: 'get_design_memory',
|
|
12
|
+
description:
|
|
13
|
+
'Read the document’s design memory before you design in it: the colors, fonts, font sizes, ' +
|
|
14
|
+
'spacing and corner radii it allows (its variables and styles plus values the person added), ' +
|
|
15
|
+
'whether an edit with another value is refused or warned about, the decisions written down, ' +
|
|
16
|
+
'and frames pinned as examples to follow (read them with get_jsx or export_image). ' +
|
|
17
|
+
'Returns null when the document has none.',
|
|
18
|
+
execution: { kind: 'sync', mutation: 'none' },
|
|
19
|
+
input: v.strictObject({}),
|
|
20
|
+
execute: (figma) => ({ design_memory: new PairdrawAPI(figma).designMemory })
|
|
21
|
+
})
|
|
22
|
+
|
|
23
|
+
export const checkDesignValuesTool = defineTool({
|
|
24
|
+
name: 'check_design_values',
|
|
25
|
+
description:
|
|
26
|
+
'Check values against the document’s design memory before you use them: each comes back ' +
|
|
27
|
+
'ok, warn (allowed with a warning), refuse (an edit using it is undone) or invalid, with the ' +
|
|
28
|
+
'nearest allowed value and the variable that holds it.',
|
|
29
|
+
execution: { kind: 'sync', mutation: 'none' },
|
|
30
|
+
input: v.strictObject({
|
|
31
|
+
colors: valuesInput('CSS colors, such as #1A73E8', v.string()),
|
|
32
|
+
fonts: valuesInput('Font families', v.string()),
|
|
33
|
+
font_sizes: valuesInput('Font sizes in px', v.number()),
|
|
34
|
+
spacing: valuesInput('Gaps and padding in px', v.number()),
|
|
35
|
+
radius: valuesInput('Corner radii in px', v.number())
|
|
36
|
+
}),
|
|
37
|
+
execute: (figma, { colors, fonts, font_sizes, spacing, radius }) => {
|
|
38
|
+
try {
|
|
39
|
+
const verdicts = new PairdrawAPI(figma).checkDesignValues({
|
|
40
|
+
colors,
|
|
41
|
+
fonts,
|
|
42
|
+
fontSizes: font_sizes,
|
|
43
|
+
spacing,
|
|
44
|
+
radius
|
|
45
|
+
})
|
|
46
|
+
return { verdicts }
|
|
47
|
+
} catch (error) {
|
|
48
|
+
return toolFailure(error)
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
})
|
|
52
|
+
|
|
53
|
+
export const recordDesignDecisionTool = defineTool({
|
|
54
|
+
name: 'record_design_decision',
|
|
55
|
+
description:
|
|
56
|
+
'Write a design decision down in the document’s design memory, such as “Cards use 16 px ' +
|
|
57
|
+
'padding and the Surface/Raised color”, so later work follows it; optionally pin a frame ' +
|
|
58
|
+
'that shows it as an example. It cannot change which values the memory allows: only the ' +
|
|
59
|
+
'person can.',
|
|
60
|
+
execution: { kind: 'sync', mutation: 'document' },
|
|
61
|
+
input: v.strictObject({
|
|
62
|
+
text: v.pipe(v.string(), v.description('The decision, at most 400 characters')),
|
|
63
|
+
example_node_id: v.optional(v.pipe(v.string(), v.description('A layer that shows it')))
|
|
64
|
+
}),
|
|
65
|
+
execute: (figma, { text, example_node_id }) => {
|
|
66
|
+
try {
|
|
67
|
+
return new PairdrawAPI(figma).recordDesignDecision(text, example_node_id)
|
|
68
|
+
} catch (error) {
|
|
69
|
+
return toolFailure(error)
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
})
|
package/src/tools/html-host.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { TailwindStylesheetLoader } from '@pairdraw/dom-css/export'
|
|
2
2
|
|
|
3
|
+
import { underlyingGraph } from '#core/figma-api/graph-ref'
|
|
3
4
|
import type { HTMLStyler } from '#core/io/formats/html/layers'
|
|
4
5
|
|
|
5
6
|
/**
|
|
@@ -20,12 +21,13 @@ const hosts = new WeakMap<object, HTMLToolHost>()
|
|
|
20
21
|
|
|
21
22
|
/** Lets the HTML tools run for the documents of `owner`, a document's graph. */
|
|
22
23
|
export function registerHTMLToolHost(owner: object, host: HTMLToolHost): () => void {
|
|
23
|
-
|
|
24
|
+
const target = underlyingGraph(owner)
|
|
25
|
+
hosts.set(target, host)
|
|
24
26
|
return () => {
|
|
25
|
-
if (hosts.get(
|
|
27
|
+
if (hosts.get(target) === host) hosts.delete(target)
|
|
26
28
|
}
|
|
27
29
|
}
|
|
28
30
|
|
|
29
31
|
export function getHTMLToolHost(owner: object): HTMLToolHost | undefined {
|
|
30
|
-
return hosts.get(owner)
|
|
32
|
+
return hosts.get(underlyingGraph(owner))
|
|
31
33
|
}
|
|
@@ -3,7 +3,6 @@ import { getAxisAlignedBoundsInParent } from '@pairdraw/scene-graph/coordinate'
|
|
|
3
3
|
import { computeBounds } from '@pairdraw/scene-graph/geometry'
|
|
4
4
|
|
|
5
5
|
import { TRANSPARENT } from '#core/constants'
|
|
6
|
-
import { flushPendingLayout } from '#core/figma-api'
|
|
7
6
|
import { storeImage } from '#core/figma-api/images'
|
|
8
7
|
import { DEFAULT_SPACE_GAP, findEmptySpace } from '#core/tools/read/space'
|
|
9
8
|
|
|
@@ -90,7 +89,6 @@ export function placeBesideSiblings(graph: SceneGraph, nodeId: string): void {
|
|
|
90
89
|
const parent = node?.parentId ? graph.getNode(node.parentId) : undefined
|
|
91
90
|
if (!node || !parent) return
|
|
92
91
|
if (parent.type !== 'CANVAS' && parent.layoutMode !== 'NONE') return
|
|
93
|
-
flushPendingLayout(graph)
|
|
94
92
|
const obstacles = parent.childIds.flatMap((id) => {
|
|
95
93
|
const sibling = id === nodeId ? undefined : graph.getNode(id)
|
|
96
94
|
return sibling ? [getAxisAlignedBoundsInParent([sibling], parent.id, graph)] : []
|
|
@@ -99,6 +99,7 @@ export const generateImage = defineTool({
|
|
|
99
99
|
description:
|
|
100
100
|
'Generate an image from a text prompt with the image service the user set up in Settings → Image services (BYOK). With id, the image fills that layer: it replaces the image the layer shows, or goes on top of its fills. Without id, it becomes a new rectangle layer at the image’s size (or the given width), beside the parent’s content unless x and y are given. It sends the prompt to that service with the user’s own key, costs them money, and takes a while, so call it only when the user asks for a generated image; prefer stock_photo for ordinary photography.',
|
|
101
101
|
execution: { kind: 'async', mutation: 'document' },
|
|
102
|
+
content: 'imported',
|
|
102
103
|
capabilities: ['document:write', 'network:access'],
|
|
103
104
|
input: v.strictObject({
|
|
104
105
|
prompt: promptInput('What the image shows, its style, and its mood, in English'),
|
|
@@ -163,6 +164,7 @@ export const generateSVG = defineTool({
|
|
|
163
164
|
description:
|
|
164
165
|
'Generate an illustration, icon, or logo mark from a text prompt as SVG with the vectorize service the user set up in Settings → Image services, and import it as editable vector layers, as import_svg does. The new frame goes beside the parent’s content unless x and y are given. It uses the user’s own key and takes a while, so call it only when the user asks for generated vector art; use insert_icon for standard icons.',
|
|
165
166
|
execution: { kind: 'async', mutation: 'document' },
|
|
167
|
+
content: 'imported',
|
|
166
168
|
capabilities: ['document:write', 'network:access'],
|
|
167
169
|
input: v.strictObject({
|
|
168
170
|
prompt: promptInput('What the artwork shows and its style, in English'),
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { underlyingGraph } from '#core/figma-api/graph-ref'
|
|
1
2
|
import type { ImageVectorizeRequest } from '#core/tools/vector/vectorize'
|
|
2
3
|
|
|
3
4
|
/** The shape of a generated image; each maps to a size the image services accept. */
|
|
@@ -35,14 +36,15 @@ const services = new WeakMap<object, ImageAIService>()
|
|
|
35
36
|
* `registerImageVectorizer` does for `vectorize_image`.
|
|
36
37
|
*/
|
|
37
38
|
export function registerImageAIService(owner: object, service: ImageAIService): () => void {
|
|
38
|
-
|
|
39
|
+
const target = underlyingGraph(owner)
|
|
40
|
+
services.set(target, service)
|
|
39
41
|
return () => {
|
|
40
|
-
if (services.get(
|
|
42
|
+
if (services.get(target) === service) services.delete(target)
|
|
41
43
|
}
|
|
42
44
|
}
|
|
43
45
|
|
|
44
46
|
export function getImageAIService(owner: object): ImageAIService | undefined {
|
|
45
|
-
return services.get(owner)
|
|
47
|
+
return services.get(underlyingGraph(owner))
|
|
46
48
|
}
|
|
47
49
|
|
|
48
50
|
/** What a tool answers where no host set the services up, such as the CLI or a headless server. */
|
package/src/tools/index.ts
CHANGED
|
@@ -7,6 +7,7 @@ export type {
|
|
|
7
7
|
ComponentCatalogLibraryAsset
|
|
8
8
|
} from './component-catalog'
|
|
9
9
|
export { getHTMLToolHost, registerHTMLToolHost, type HTMLToolHost } from './html-host'
|
|
10
|
+
export { getVideoEncoder, registerVideoEncoder } from './video-host'
|
|
10
11
|
export { getScriptToolHost, registerScriptToolHost, type ScriptToolHost } from './script/host'
|
|
11
12
|
export { SCRIPT_EXAMPLES, type ScriptExampleName } from './script/examples'
|
|
12
13
|
export { ALL_TOOLS, CORE_TOOLS, EXTENDED_TOOLS } from './registry'
|
|
@@ -42,6 +43,8 @@ export {
|
|
|
42
43
|
compileScript,
|
|
43
44
|
diffDocuments,
|
|
44
45
|
diffPageLayersJSX,
|
|
46
|
+
layoutFrameAtWidth,
|
|
47
|
+
widthVariants,
|
|
45
48
|
wrapEvalCode
|
|
46
49
|
} from './analyze'
|
|
47
50
|
export type { DocumentDiff, DocumentDiffOptions, LayerJSXChange } from './analyze'
|
|
@@ -34,7 +34,7 @@ export const setEffects = defineTool({
|
|
|
34
34
|
execute: (figma, args) => {
|
|
35
35
|
const node = figma.getNodeById(args.id)
|
|
36
36
|
if (!node) return nodeNotFound(args.id)
|
|
37
|
-
const parsedColor = parseOptionalToolColor(args.color)
|
|
37
|
+
const parsedColor = parseOptionalToolColor(args.color, figma.graph.documentColorSpace)
|
|
38
38
|
if ('error' in parsedColor) return parsedColor
|
|
39
39
|
const shadowColor = parsedColor.color ?? { ...DEFAULT_SHADOW_COLOR }
|
|
40
40
|
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import * as v from 'valibot'
|
|
2
|
+
|
|
3
|
+
import { replaceDocumentFonts } from '#core/text/replace-fonts'
|
|
4
|
+
import { defineTool } from '#core/tools/schema'
|
|
5
|
+
|
|
6
|
+
const faceInputSchema = v.strictObject({
|
|
7
|
+
family: v.pipe(v.string(), v.description('Font family, as list_fonts or a text node names it')),
|
|
8
|
+
style: v.pipe(v.string(), v.description('Face style, such as "Regular" or "Semi Bold"'))
|
|
9
|
+
})
|
|
10
|
+
|
|
11
|
+
const replacementInputSchema = v.strictObject({
|
|
12
|
+
from: faceInputSchema,
|
|
13
|
+
to: faceInputSchema
|
|
14
|
+
})
|
|
15
|
+
|
|
16
|
+
export const replaceFonts = defineTool({
|
|
17
|
+
name: 'replace_fonts',
|
|
18
|
+
description:
|
|
19
|
+
'Replace font faces everywhere in the document: text layers, character runs, and text ' +
|
|
20
|
+
'styles. Other faces keep their runs. One undoable step. Run list_fonts with scope ' +
|
|
21
|
+
'"document" first to see the faces in use and which are missing.',
|
|
22
|
+
execution: { kind: 'sync', mutation: 'document' },
|
|
23
|
+
exposure: { webmcp: false },
|
|
24
|
+
input: v.strictObject({
|
|
25
|
+
replacements: v.pipe(
|
|
26
|
+
v.array(replacementInputSchema),
|
|
27
|
+
v.minLength(1),
|
|
28
|
+
v.description(
|
|
29
|
+
'Faces to swap, each { from: { family, style }, to: { family, style } }. A source face may appear once.'
|
|
30
|
+
)
|
|
31
|
+
)
|
|
32
|
+
}),
|
|
33
|
+
execute: (figma, args) => replaceDocumentFonts(figma.graph, args.replacements)
|
|
34
|
+
})
|
|
@@ -4,6 +4,7 @@ import { MIN_RESCALE } from '@pairdraw/scene-graph/scaling'
|
|
|
4
4
|
|
|
5
5
|
import { assertNodeEditable } from '#core/editor/capabilities'
|
|
6
6
|
import { rescaleNodes, SCALE_ANCHORS } from '#core/editor/scale'
|
|
7
|
+
import { lengthShorthandInput, parseLengthShorthand } from '#core/tools/css/shorthand'
|
|
7
8
|
import {
|
|
8
9
|
toolNumber,
|
|
9
10
|
nodeIdInputSchema,
|
|
@@ -51,12 +52,15 @@ export const setOpacity = defineTool({
|
|
|
51
52
|
export const setRadius = defineTool({
|
|
52
53
|
name: 'set_radius',
|
|
53
54
|
|
|
54
|
-
description:
|
|
55
|
+
description:
|
|
56
|
+
'Set corner radius. Use individual corners for independent values, or radius as CSS shorthand: "12px", "12px 0 12px 0".',
|
|
55
57
|
execution: { kind: 'sync', mutation: 'properties' },
|
|
56
58
|
input: v.strictObject({
|
|
57
59
|
id: nodeIdInputSchema,
|
|
58
60
|
radius: v.optional(
|
|
59
|
-
|
|
61
|
+
lengthShorthandInput(
|
|
62
|
+
'Corner radius: one length for every corner, or CSS shorthand "12px 12px 4px 4px" (top-left, top-right, bottom-right, bottom-left)'
|
|
63
|
+
)
|
|
60
64
|
),
|
|
61
65
|
top_left: v.optional(
|
|
62
66
|
toolNumber(v.pipe(v.number(), v.minValue(0), v.description('Top-left radius')))
|
|
@@ -75,7 +79,16 @@ export const setRadius = defineTool({
|
|
|
75
79
|
const node = figma.getNodeById(args.id)
|
|
76
80
|
if (!node) return nodeNotFound(args.id)
|
|
77
81
|
if (args.radius !== undefined) {
|
|
78
|
-
|
|
82
|
+
const corners = parseLengthShorthand(args.radius, 4, 'radius')
|
|
83
|
+
if ('error' in corners) return corners
|
|
84
|
+
if (corners.every((value) => value === corners[0])) {
|
|
85
|
+
node.cornerRadius = corners[0]
|
|
86
|
+
} else {
|
|
87
|
+
node.topLeftRadius = corners[0]
|
|
88
|
+
node.topRightRadius = corners[1]
|
|
89
|
+
node.bottomRightRadius = corners[2]
|
|
90
|
+
node.bottomLeftRadius = corners[3]
|
|
91
|
+
}
|
|
79
92
|
}
|
|
80
93
|
if (args.top_left !== undefined) node.topLeftRadius = args.top_left
|
|
81
94
|
if (args.top_right !== undefined) node.topRightRadius = args.top_right
|
|
@@ -1,12 +1,49 @@
|
|
|
1
1
|
import * as v from 'valibot'
|
|
2
2
|
|
|
3
|
+
import type { FigmaNodeProxy } from '#core/figma-api'
|
|
3
4
|
import { PairdrawAPI } from '#core/pairdraw-api'
|
|
5
|
+
import { lengthShorthandInput, parseLengthShorthand } from '#core/tools/css/shorthand'
|
|
4
6
|
import { toolNumber, nodeIdInputSchema, defineTool, nodeNotFound } from '#core/tools/schema'
|
|
5
7
|
|
|
8
|
+
type SpacingArgs = { padding?: number | string; gap?: number | string }
|
|
9
|
+
|
|
10
|
+
/** Parses the shorthand before the frame changes, so bad input leaves it as it was. */
|
|
11
|
+
function parseSpacing(
|
|
12
|
+
args: SpacingArgs
|
|
13
|
+
): { padding?: number[]; gap?: number[] } | { error: string } {
|
|
14
|
+
const parsed: { padding?: number[]; gap?: number[] } = {}
|
|
15
|
+
if (args.padding !== undefined) {
|
|
16
|
+
const padding = parseLengthShorthand(args.padding, 4, 'padding')
|
|
17
|
+
if ('error' in padding) return padding
|
|
18
|
+
parsed.padding = padding
|
|
19
|
+
}
|
|
20
|
+
if (args.gap !== undefined) {
|
|
21
|
+
const gap = parseLengthShorthand(args.gap, 2, 'gap')
|
|
22
|
+
if ('error' in gap) return gap
|
|
23
|
+
parsed.gap = gap
|
|
24
|
+
}
|
|
25
|
+
return parsed
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
function writeSpacing(node: FigmaNodeProxy, spacing: { padding?: number[]; gap?: number[] }): void {
|
|
29
|
+
if (spacing.padding) {
|
|
30
|
+
const [top, right, bottom, left] = spacing.padding
|
|
31
|
+
node.paddingTop = top
|
|
32
|
+
node.paddingRight = right
|
|
33
|
+
node.paddingBottom = bottom
|
|
34
|
+
node.paddingLeft = left
|
|
35
|
+
}
|
|
36
|
+
if (spacing.gap) {
|
|
37
|
+
node.itemSpacing = spacing.gap[0]
|
|
38
|
+
node.counterAxisSpacing = spacing.gap[1]
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
|
|
6
42
|
export const setLayout = defineTool({
|
|
7
43
|
name: 'set_layout',
|
|
8
44
|
|
|
9
|
-
description:
|
|
45
|
+
description:
|
|
46
|
+
'Set auto-layout (flexbox) on a frame. Direction, alignment, spacing, padding, which also take CSS shorthand: padding="16px 24px", gap="12px 4px".',
|
|
10
47
|
execution: { kind: 'sync', mutation: 'properties' },
|
|
11
48
|
input: v.strictObject({
|
|
12
49
|
id: v.pipe(v.string(), v.description('Frame node ID')),
|
|
@@ -26,14 +63,13 @@ export const setLayout = defineTool({
|
|
|
26
63
|
)
|
|
27
64
|
),
|
|
28
65
|
padding: v.optional(
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
v.number(),
|
|
32
|
-
v.minValue(0),
|
|
33
|
-
v.description('Equal padding on all sides (only changes if provided)')
|
|
34
|
-
)
|
|
66
|
+
lengthShorthandInput(
|
|
67
|
+
'Padding: one length for every side, or CSS shorthand "16px 24px" / "8px 16px 4px 24px"'
|
|
35
68
|
)
|
|
36
69
|
),
|
|
70
|
+
gap: v.optional(
|
|
71
|
+
lengthShorthandInput('Gap: one length, or "12px 4px" for main-axis and cross-axis spacing')
|
|
72
|
+
),
|
|
37
73
|
padding_horizontal: v.optional(
|
|
38
74
|
toolNumber(v.pipe(v.number(), v.minValue(0), v.description('Horizontal padding')))
|
|
39
75
|
),
|
|
@@ -62,6 +98,9 @@ export const setLayout = defineTool({
|
|
|
62
98
|
)
|
|
63
99
|
}),
|
|
64
100
|
execute: (figma, args) => {
|
|
101
|
+
const spacing = parseSpacing(args)
|
|
102
|
+
if ('error' in spacing) return spacing
|
|
103
|
+
|
|
65
104
|
const node = figma.getNodeById(args.id)
|
|
66
105
|
if (!node) return nodeNotFound(args.id)
|
|
67
106
|
|
|
@@ -89,12 +128,7 @@ export const setLayout = defineTool({
|
|
|
89
128
|
if (args.flow_direction !== undefined)
|
|
90
129
|
new PairdrawAPI(figma).setLayoutDirection(node, args.flow_direction)
|
|
91
130
|
|
|
92
|
-
|
|
93
|
-
node.paddingTop = args.padding
|
|
94
|
-
node.paddingRight = args.padding
|
|
95
|
-
node.paddingBottom = args.padding
|
|
96
|
-
node.paddingLeft = args.padding
|
|
97
|
-
}
|
|
131
|
+
writeSpacing(node, spacing)
|
|
98
132
|
if (args.padding_horizontal !== undefined) {
|
|
99
133
|
node.paddingLeft = args.padding_horizontal
|
|
100
134
|
node.paddingRight = args.padding_horizontal
|