@pairdraw/core 0.17.0 → 0.19.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/canvas/effects.d.ts +5 -11
- package/dist/canvas/effects.d.ts.map +1 -1
- package/dist/canvas/effects.js +25 -30
- package/dist/canvas/effects.js.map +1 -1
- package/dist/canvas/labels/hit-test.d.ts +5 -0
- package/dist/canvas/labels/hit-test.d.ts.map +1 -1
- package/dist/canvas/labels/hit-test.js +1 -1
- package/dist/canvas/labels/hit-test.js.map +1 -1
- package/dist/canvas/labels/paragraph-cache.d.ts.map +1 -1
- package/dist/canvas/labels/paragraph-cache.js +3 -2
- package/dist/canvas/labels/paragraph-cache.js.map +1 -1
- package/dist/canvas/labels/selection.js +3 -2
- package/dist/canvas/labels/selection.js.map +1 -1
- package/dist/canvas/labels/style.d.ts +1 -1
- package/dist/canvas/node-edit-overlay.js +2 -2
- package/dist/canvas/node-edit-overlay.js.map +1 -1
- package/dist/canvas/outline-stroke.d.ts.map +1 -1
- package/dist/canvas/outline-stroke.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/prototype.d.ts +2 -5
- package/dist/canvas/overlays/prototype.d.ts.map +1 -1
- package/dist/canvas/overlays/prototype.js +3 -19
- package/dist/canvas/overlays/prototype.js.map +1 -1
- 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 +4 -37
- package/dist/canvas/overlays/selection.js.map +1 -1
- package/dist/canvas/region-hatch.js +3 -2
- package/dist/canvas/region-hatch.js.map +1 -1
- package/dist/canvas/renderer/colors.d.ts.map +1 -1
- package/dist/canvas/renderer/colors.js +36 -18
- package/dist/canvas/renderer/colors.js.map +1 -1
- package/dist/canvas/renderer/font-waiters.d.ts +9 -0
- package/dist/canvas/renderer/font-waiters.d.ts.map +1 -0
- package/dist/canvas/renderer/font-waiters.js +26 -0
- package/dist/canvas/renderer/font-waiters.js.map +1 -0
- package/dist/canvas/renderer/fonts.d.ts +4 -2
- package/dist/canvas/renderer/fonts.d.ts.map +1 -1
- package/dist/canvas/renderer/fonts.js +25 -10
- 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 -9
- package/dist/canvas/renderer/lifecycle.js.map +1 -1
- package/dist/canvas/renderer/methods.d.ts +4 -5
- 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/paints.d.ts.map +1 -1
- package/dist/canvas/renderer/paints.js +0 -6
- package/dist/canvas/renderer/paints.js.map +1 -1
- package/dist/canvas/renderer/pipeline.d.ts.map +1 -1
- package/dist/canvas/renderer/pipeline.js +20 -2
- package/dist/canvas/renderer/pipeline.js.map +1 -1
- package/dist/canvas/renderer/retained-backing.js +4 -4
- package/dist/canvas/renderer/retained-backing.js.map +1 -1
- package/dist/canvas/renderer/state.js +1 -1
- package/dist/canvas/renderer/state.js.map +1 -1
- package/dist/canvas/renderer/tiles/controller.d.ts +2 -0
- package/dist/canvas/renderer/tiles/controller.d.ts.map +1 -1
- package/dist/canvas/renderer/tiles/controller.js +8 -0
- package/dist/canvas/renderer/tiles/controller.js.map +1 -1
- package/dist/canvas/renderer/tiles/surface-pool.js +1 -1
- package/dist/canvas/renderer/tiles/surface-pool.js.map +1 -1
- package/dist/canvas/renderer/visual-bounds.d.ts.map +1 -1
- package/dist/canvas/renderer/visual-bounds.js +7 -5
- package/dist/canvas/renderer/visual-bounds.js.map +1 -1
- package/dist/canvas/renderer.d.ts +26 -7
- package/dist/canvas/renderer.d.ts.map +1 -1
- package/dist/canvas/renderer.js +50 -11
- package/dist/canvas/renderer.js.map +1 -1
- package/dist/canvas/rulers.d.ts +8 -1
- package/dist/canvas/rulers.d.ts.map +1 -1
- package/dist/canvas/rulers.js +30 -5
- package/dist/canvas/rulers.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 +90 -54
- package/dist/canvas/scene.js.map +1 -1
- package/dist/canvas/shadows/shape.js +1 -1
- package/dist/canvas/shadows/shape.js.map +1 -1
- package/dist/canvas/shadows/silhouette.d.ts.map +1 -1
- package/dist/canvas/shadows/silhouette.js +4 -2
- package/dist/canvas/shadows/silhouette.js.map +1 -1
- package/dist/canvas/shadows.d.ts.map +1 -1
- package/dist/canvas/shadows.js +3 -2
- package/dist/canvas/shadows.js.map +1 -1
- package/dist/canvas/text/derived.d.ts +1 -2
- package/dist/canvas/text/derived.d.ts.map +1 -1
- package/dist/canvas/text/derived.js +1 -7
- package/dist/canvas/text/derived.js.map +1 -1
- package/dist/canvas/text/emoji/index.js +1 -1
- package/dist/canvas/text/emoji/raster.d.ts.map +1 -1
- package/dist/canvas/text/emoji/raster.js +14 -10
- package/dist/canvas/text/emoji/raster.js.map +1 -1
- package/dist/canvas/text/font-families.d.ts +4 -3
- package/dist/canvas/text/font-families.d.ts.map +1 -1
- package/dist/canvas/text/font-families.js +13 -9
- package/dist/canvas/text/font-families.js.map +1 -1
- package/dist/canvas/text/index.d.ts +1 -3
- package/dist/canvas/text/index.d.ts.map +1 -1
- package/dist/canvas/text/index.js +2 -9
- package/dist/canvas/text/index.js.map +1 -1
- package/dist/canvas/text/layout/build.d.ts.map +1 -1
- package/dist/canvas/text/layout/build.js +25 -9
- package/dist/canvas/text/layout/build.js.map +1 -1
- package/dist/canvas/text/layout/index.d.ts.map +1 -1
- package/dist/canvas/text/layout/index.js +8 -4
- package/dist/canvas/text/layout/index.js.map +1 -1
- package/dist/canvas/text/layout/lines.js +5 -3
- package/dist/canvas/text/layout/lines.js.map +1 -1
- package/dist/canvas/text/paragraph/index.d.ts +5 -0
- package/dist/canvas/text/paragraph/index.d.ts.map +1 -1
- package/dist/canvas/text/paragraph/index.js +18 -9
- package/dist/canvas/text/paragraph/index.js.map +1 -1
- package/dist/canvas/text/paragraph/inputs.d.ts +1 -1
- package/dist/canvas/text/paragraph/inputs.d.ts.map +1 -1
- package/dist/canvas/text/paragraph/inputs.js +9 -2
- package/dist/canvas/text/paragraph/inputs.js.map +1 -1
- package/dist/canvas/text/placed.js +3 -3
- package/dist/canvas/text/placed.js.map +1 -1
- package/dist/canvas/text/renderer.d.ts +2 -0
- package/dist/canvas/text/renderer.d.ts.map +1 -1
- package/dist/canvas/text/shape.d.ts +4 -3
- package/dist/canvas/text/shape.d.ts.map +1 -1
- package/dist/canvas/text/shape.js +9 -22
- package/dist/canvas/text/shape.js.map +1 -1
- package/dist/constants.d.ts +6 -2
- package/dist/constants.d.ts.map +1 -1
- package/dist/constants.js +6 -2
- package/dist/constants.js.map +1 -1
- package/dist/design-jsx/renderer.d.ts.map +1 -1
- package/dist/editor/bridges/clipboard.d.ts +1 -0
- package/dist/editor/bridges/clipboard.js +1 -0
- package/dist/editor/bridges/clipboard.js.map +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/frames.d.ts +4 -3
- package/dist/editor/bridges/frames.d.ts.map +1 -1
- package/dist/editor/bridges/frames.js +6 -4
- package/dist/editor/bridges/frames.js.map +1 -1
- package/dist/editor/bridges/structure.d.ts +1 -0
- package/dist/editor/bridges/structure.d.ts.map +1 -1
- package/dist/editor/bridges/structure.js +1 -0
- package/dist/editor/bridges/structure.js.map +1 -1
- package/dist/editor/bridges/undo.d.ts +1 -1
- package/dist/editor/clipboard/detach.js +2 -2
- package/dist/editor/clipboard/detach.js.map +1 -1
- package/dist/editor/clipboard/paste/properties.js +1 -1
- package/dist/editor/clipboard/paste/target.js +2 -2
- package/dist/editor/clipboard/paste/target.js.map +1 -1
- package/dist/editor/clipboard/snapshot.d.ts +3 -0
- package/dist/editor/clipboard/snapshot.d.ts.map +1 -1
- package/dist/editor/clipboard/snapshot.js +2 -0
- package/dist/editor/clipboard/snapshot.js.map +1 -1
- package/dist/editor/clipboard/variables.d.ts.map +1 -1
- package/dist/editor/clipboard/variables.js +14 -1
- package/dist/editor/clipboard/variables.js.map +1 -1
- package/dist/editor/clipboard.d.ts +1 -0
- package/dist/editor/clipboard.d.ts.map +1 -1
- package/dist/editor/clipboard.js +122 -16
- package/dist/editor/clipboard.js.map +1 -1
- package/dist/editor/component-sync.d.ts +10 -1
- package/dist/editor/component-sync.d.ts.map +1 -1
- package/dist/editor/component-sync.js +25 -8
- package/dist/editor/component-sync.js.map +1 -1
- package/dist/editor/components/authoring/text-edit.d.ts.map +1 -1
- package/dist/editor/components/authoring/text-edit.js +11 -2
- package/dist/editor/components/authoring/text-edit.js.map +1 -1
- package/dist/editor/components/authoring/visibility-edit.d.ts.map +1 -1
- package/dist/editor/components/authoring/visibility-edit.js +7 -3
- package/dist/editor/components/authoring/visibility-edit.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 +37 -7
- 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 -0
- package/dist/editor/components/properties.js.map +1 -1
- package/dist/editor/components/slots/authoring.js +2 -1
- package/dist/editor/components/slots/authoring.js.map +1 -1
- package/dist/editor/components.d.ts +2 -0
- package/dist/editor/components.d.ts.map +1 -1
- package/dist/editor/create.d.ts +18 -4
- package/dist/editor/create.d.ts.map +1 -1
- package/dist/editor/create.js +43 -6
- package/dist/editor/create.js.map +1 -1
- package/dist/editor/guides.d.ts.map +1 -1
- package/dist/editor/guides.js +20 -13
- package/dist/editor/guides.js.map +1 -1
- package/dist/editor/history/document-change.d.ts +19 -3
- package/dist/editor/history/document-change.d.ts.map +1 -1
- package/dist/editor/history/document-change.js +94 -8
- package/dist/editor/history/document-change.js.map +1 -1
- package/dist/editor/history/edit.d.ts.map +1 -1
- package/dist/editor/history/edit.js +56 -12
- package/dist/editor/history/edit.js.map +1 -1
- package/dist/editor/history/position.js +1 -4
- package/dist/editor/history/position.js.map +1 -1
- package/dist/editor/history/sources.d.ts +14 -0
- package/dist/editor/history/sources.d.ts.map +1 -0
- package/dist/editor/history/sources.js +24 -0
- package/dist/editor/history/sources.js.map +1 -0
- package/dist/editor/index.d.ts +2 -2
- package/dist/editor/index.js +1 -1
- package/dist/editor/layout-mode.d.ts.map +1 -1
- package/dist/editor/layout-mode.js +16 -1
- package/dist/editor/layout-mode.js.map +1 -1
- package/dist/editor/node-preview.d.ts.map +1 -1
- package/dist/editor/node-preview.js +26 -7
- package/dist/editor/node-preview.js.map +1 -1
- package/dist/editor/nodes.d.ts.map +1 -1
- package/dist/editor/nodes.js +33 -10
- package/dist/editor/nodes.js.map +1 -1
- package/dist/editor/nudge.d.ts.map +1 -1
- package/dist/editor/nudge.js +12 -2
- package/dist/editor/nudge.js.map +1 -1
- package/dist/editor/pages.d.ts +2 -1
- package/dist/editor/pages.d.ts.map +1 -1
- package/dist/editor/pages.js +94 -15
- package/dist/editor/pages.js.map +1 -1
- package/dist/editor/play/states.d.ts.map +1 -1
- package/dist/editor/play/states.js +0 -5
- package/dist/editor/play/states.js.map +1 -1
- package/dist/editor/read-only/actions.js +3 -0
- package/dist/editor/read-only/actions.js.map +1 -1
- package/dist/editor/selection/hit-test.d.ts +2 -1
- package/dist/editor/selection/hit-test.d.ts.map +1 -1
- package/dist/editor/selection/hit-test.js +29 -4
- package/dist/editor/selection/hit-test.js.map +1 -1
- package/dist/editor/selection.d.ts +2 -2
- package/dist/editor/selection.d.ts.map +1 -1
- package/dist/editor/shapes/pen.js +6 -2
- package/dist/editor/shapes/pen.js.map +1 -1
- package/dist/editor/shapes.d.ts.map +1 -1
- package/dist/editor/shapes.js +2 -1
- package/dist/editor/shapes.js.map +1 -1
- package/dist/editor/structure/auto-layout-wrap.d.ts.map +1 -1
- package/dist/editor/structure/auto-layout-wrap.js +12 -0
- package/dist/editor/structure/auto-layout-wrap.js.map +1 -1
- package/dist/editor/structure/boolean.js +1 -1
- package/dist/editor/structure/group/bounds.d.ts +4 -2
- package/dist/editor/structure/group/bounds.d.ts.map +1 -1
- package/dist/editor/structure/group/bounds.js +17 -4
- package/dist/editor/structure/group/bounds.js.map +1 -1
- package/dist/editor/structure/rename.d.ts +2 -3
- package/dist/editor/structure/rename.d.ts.map +1 -1
- package/dist/editor/structure/rename.js +2 -5
- package/dist/editor/structure/rename.js.map +1 -1
- package/dist/editor/structure/reorder.d.ts.map +1 -1
- package/dist/editor/structure/reorder.js +20 -9
- package/dist/editor/structure/reorder.js.map +1 -1
- package/dist/editor/structure/state.js +1 -1
- package/dist/editor/structure.d.ts +1 -0
- package/dist/editor/structure.d.ts.map +1 -1
- package/dist/editor/structure.js +76 -20
- package/dist/editor/structure.js.map +1 -1
- package/dist/editor/text/hyperlink.d.ts.map +1 -1
- package/dist/editor/text/hyperlink.js +1 -1
- package/dist/editor/text/hyperlink.js.map +1 -1
- package/dist/editor/text/name.d.ts +13 -5
- package/dist/editor/text/name.d.ts.map +1 -1
- package/dist/editor/text/name.js +47 -17
- package/dist/editor/text/name.js.map +1 -1
- package/dist/editor/text/pending-layout.d.ts +2 -1
- package/dist/editor/text/pending-layout.d.ts.map +1 -1
- package/dist/editor/text/pending-layout.js +33 -6
- package/dist/editor/text/pending-layout.js.map +1 -1
- package/dist/editor/text/selection-style.d.ts +1 -0
- package/dist/editor/text/selection-style.d.ts.map +1 -1
- package/dist/editor/text/selection-style.js +16 -4
- package/dist/editor/text/selection-style.js.map +1 -1
- package/dist/editor/text.d.ts +5 -0
- package/dist/editor/text.d.ts.map +1 -1
- package/dist/editor/text.js +70 -3
- package/dist/editor/text.js.map +1 -1
- package/dist/editor/types.d.ts +18 -1
- package/dist/editor/types.d.ts.map +1 -1
- package/dist/editor/undo.d.ts.map +1 -1
- package/dist/editor/undo.js +14 -2
- package/dist/editor/undo.js.map +1 -1
- package/dist/editor/variable-bindings.d.ts.map +1 -1
- package/dist/editor/variable-bindings.js +21 -2
- package/dist/editor/variable-bindings.js.map +1 -1
- package/dist/editor/variables.d.ts +1 -1
- package/dist/editor/variables.d.ts.map +1 -1
- package/dist/editor/variables.js +7 -8
- package/dist/editor/variables.js.map +1 -1
- package/dist/editor/viewport.d.ts +11 -2
- package/dist/editor/viewport.d.ts.map +1 -1
- package/dist/editor/viewport.js +61 -21
- package/dist/editor/viewport.js.map +1 -1
- package/dist/editor/views/actions.d.ts.map +1 -1
- package/dist/editor/views/actions.js +13 -5
- package/dist/editor/views/actions.js.map +1 -1
- package/dist/editor/views/present.d.ts +6 -4
- package/dist/editor/views/present.d.ts.map +1 -1
- package/dist/editor/views/present.js +12 -10
- package/dist/editor/views/present.js.map +1 -1
- package/dist/editor/views/types.d.ts +11 -5
- package/dist/editor/views/types.d.ts.map +1 -1
- package/dist/figma-api/accessor-utils.d.ts.map +1 -1
- package/dist/figma-api/accessor-utils.js +4 -1
- package/dist/figma-api/accessor-utils.js.map +1 -1
- package/dist/figma-api/accessors/basic.d.ts.map +1 -1
- package/dist/figma-api/accessors/basic.js +41 -21
- package/dist/figma-api/accessors/basic.js.map +1 -1
- package/dist/figma-api/accessors/layout.d.ts.map +1 -1
- package/dist/figma-api/accessors/layout.js +37 -7
- package/dist/figma-api/accessors/layout.js.map +1 -1
- package/dist/figma-api/accessors/reactions.d.ts +11 -0
- package/dist/figma-api/accessors/reactions.d.ts.map +1 -0
- package/dist/figma-api/accessors/reactions.js +30 -0
- package/dist/figma-api/accessors/reactions.js.map +1 -0
- package/dist/figma-api/accessors/strokes.d.ts.map +1 -1
- package/dist/figma-api/accessors/strokes.js +12 -4
- package/dist/figma-api/accessors/strokes.js.map +1 -1
- package/dist/figma-api/accessors/text/index.d.ts.map +1 -1
- package/dist/figma-api/accessors/text/index.js +3 -1
- package/dist/figma-api/accessors/text/index.js.map +1 -1
- package/dist/figma-api/accessors/vector.d.ts.map +1 -1
- package/dist/figma-api/accessors/vector.js +1 -1
- package/dist/figma-api/accessors/vector.js.map +1 -1
- package/dist/figma-api/accessors/visual.d.ts +6 -5
- package/dist/figma-api/accessors/visual.d.ts.map +1 -1
- package/dist/figma-api/accessors/visual.js +20 -17
- package/dist/figma-api/accessors/visual.js.map +1 -1
- package/dist/figma-api/components.d.ts.map +1 -1
- package/dist/figma-api/components.js +2 -1
- package/dist/figma-api/components.js.map +1 -1
- package/dist/figma-api/finite.d.ts +27 -0
- package/dist/figma-api/finite.d.ts.map +1 -0
- package/dist/figma-api/finite.js +69 -0
- package/dist/figma-api/finite.js.map +1 -0
- package/dist/figma-api/fonts/list.d.ts +13 -0
- package/dist/figma-api/fonts/list.d.ts.map +1 -0
- package/dist/figma-api/fonts/list.js +25 -0
- package/dist/figma-api/fonts/list.js.map +1 -0
- package/dist/figma-api/index.d.ts +63 -10
- package/dist/figma-api/index.d.ts.map +1 -1
- package/dist/figma-api/index.js +104 -17
- package/dist/figma-api/index.js.map +1 -1
- package/dist/figma-api/overrides.d.ts +6 -1
- package/dist/figma-api/overrides.d.ts.map +1 -1
- package/dist/figma-api/overrides.js +2 -2
- package/dist/figma-api/overrides.js.map +1 -1
- package/dist/figma-api/pending-layout.d.ts +12 -2
- package/dist/figma-api/pending-layout.d.ts.map +1 -1
- package/dist/figma-api/pending-layout.js +41 -1
- package/dist/figma-api/pending-layout.js.map +1 -1
- package/dist/figma-api/pending-sync.d.ts +19 -0
- package/dist/figma-api/pending-sync.d.ts.map +1 -0
- package/dist/figma-api/pending-sync.js +52 -0
- package/dist/figma-api/pending-sync.js.map +1 -0
- package/dist/figma-api/proxy.d.ts +15 -2
- package/dist/figma-api/proxy.d.ts.map +1 -1
- package/dist/figma-api/proxy.js +23 -3
- package/dist/figma-api/proxy.js.map +1 -1
- package/dist/figma-api/reactions.d.ts +104 -0
- package/dist/figma-api/reactions.d.ts.map +1 -0
- package/dist/figma-api/reactions.js +157 -0
- package/dist/figma-api/reactions.js.map +1 -0
- package/dist/figma-api/render-bounds.d.ts.map +1 -1
- package/dist/figma-api/render-bounds.js +4 -4
- package/dist/figma-api/render-bounds.js.map +1 -1
- package/dist/figma-api/serialization.js +12 -2
- package/dist/figma-api/serialization.js.map +1 -1
- package/dist/figma-api/slots.d.ts +7 -1
- package/dist/figma-api/slots.d.ts.map +1 -1
- package/dist/figma-api/slots.js +12 -4
- package/dist/figma-api/slots.js.map +1 -1
- package/dist/figma-api/strokes.d.ts +5 -2
- package/dist/figma-api/strokes.d.ts.map +1 -1
- package/dist/figma-api/strokes.js +12 -19
- package/dist/figma-api/strokes.js.map +1 -1
- package/dist/figma-api/text/bindings.js +1 -1
- package/dist/figma-api/text/index.d.ts +2 -3
- package/dist/figma-api/text/index.d.ts.map +1 -1
- package/dist/figma-api/text/index.js +2 -12
- package/dist/figma-api/text/index.js.map +1 -1
- package/dist/figma-api/variables/bindings.js +1 -1
- package/dist/figma-api/variables/variable.d.ts.map +1 -1
- package/dist/figma-api/variables/variable.js +2 -2
- package/dist/figma-api/variables/variable.js.map +1 -1
- package/dist/geometry/connectors.js +2 -14
- package/dist/geometry/connectors.js.map +1 -1
- package/dist/geometry/figma.d.ts +6 -1
- package/dist/geometry/figma.d.ts.map +1 -1
- package/dist/geometry/figma.js +8 -1
- package/dist/geometry/figma.js.map +1 -1
- package/dist/geometry/index.d.ts +3 -3
- package/dist/geometry/index.js +2 -2
- package/dist/geometry/scene.d.ts +3 -1
- package/dist/geometry/scene.d.ts.map +1 -1
- package/dist/geometry/scene.js +16 -1
- package/dist/geometry/scene.js.map +1 -1
- package/dist/geometry/types.d.ts +7 -1
- package/dist/geometry/types.d.ts.map +1 -1
- package/dist/icons/api.d.ts +3 -2
- package/dist/icons/api.d.ts.map +1 -1
- package/dist/icons/api.js +12 -12
- package/dist/icons/api.js.map +1 -1
- package/dist/icons/provider.d.ts +4 -3
- package/dist/icons/provider.d.ts.map +1 -1
- package/dist/icons/provider.js +6 -13
- package/dist/icons/provider.js.map +1 -1
- package/dist/icons/schema.d.ts +33 -1
- package/dist/icons/schema.d.ts.map +1 -1
- package/dist/icons/schema.js +30 -1
- package/dist/icons/schema.js.map +1 -1
- package/dist/icons/svg/presentation.d.ts +8 -1
- package/dist/icons/svg/presentation.d.ts.map +1 -1
- package/dist/icons/svg/presentation.js +21 -3
- package/dist/icons/svg/presentation.js.map +1 -1
- package/dist/icons/svg/text.js +1 -1
- package/dist/icons/svg/text.js.map +1 -1
- package/dist/icons/svg.d.ts +8 -3
- package/dist/icons/svg.d.ts.map +1 -1
- package/dist/icons/svg.js +15 -13
- package/dist/icons/svg.js.map +1 -1
- package/dist/icons/types.d.ts +1 -19
- package/dist/icons/types.d.ts.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.js +1 -1
- package/dist/io/formats/design-tokens/css/read.js +1 -1
- package/dist/io/formats/design-tokens/decode.js +1 -1
- package/dist/io/formats/design-tokens/plan/index.js +4 -2
- package/dist/io/formats/design-tokens/plan/index.js.map +1 -1
- package/dist/io/formats/design-tokens/plan/styles.d.ts +9 -1
- package/dist/io/formats/design-tokens/plan/styles.d.ts.map +1 -1
- package/dist/io/formats/design-tokens/plan/styles.js +23 -3
- package/dist/io/formats/design-tokens/plan/styles.js.map +1 -1
- package/dist/io/formats/design-tokens/styles.d.ts +9 -1
- package/dist/io/formats/design-tokens/styles.d.ts.map +1 -1
- package/dist/io/formats/design-tokens/styles.js +41 -4
- package/dist/io/formats/design-tokens/styles.js.map +1 -1
- package/dist/io/formats/design-tokens/types.d.ts +5 -0
- package/dist/io/formats/design-tokens/types.d.ts.map +1 -1
- package/dist/io/formats/design-tokens/types.js +1 -0
- package/dist/io/formats/design-tokens/types.js.map +1 -1
- package/dist/io/formats/drawio/export.d.ts.map +1 -1
- package/dist/io/formats/drawio/export.js +10 -0
- 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 +32 -1
- package/dist/io/formats/drawio/index.js.map +1 -1
- package/dist/io/formats/drawio/shapes.d.ts +10 -5
- package/dist/io/formats/drawio/shapes.d.ts.map +1 -1
- package/dist/io/formats/drawio/shapes.js +10 -6
- package/dist/io/formats/drawio/shapes.js.map +1 -1
- package/dist/io/formats/drawio/warnings.d.ts +11 -0
- package/dist/io/formats/drawio/warnings.d.ts.map +1 -0
- package/dist/io/formats/drawio/warnings.js +23 -0
- package/dist/io/formats/drawio/warnings.js.map +1 -0
- package/dist/io/formats/fig/export/setup.d.ts.map +1 -1
- package/dist/io/formats/fig/export/setup.js +8 -4
- 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 +2 -2
- package/dist/io/formats/fig/export/variables.js.map +1 -1
- package/dist/io/formats/fig/index.d.ts +2 -2
- package/dist/io/formats/fig/index.js +2 -2
- package/dist/io/formats/fig/read.d.ts +9 -2
- package/dist/io/formats/fig/read.d.ts.map +1 -1
- package/dist/io/formats/fig/read.js +44 -20
- package/dist/io/formats/fig/read.js.map +1 -1
- package/dist/io/formats/html/index.d.ts.map +1 -1
- package/dist/io/formats/html/index.js +2 -6
- package/dist/io/formats/html/index.js.map +1 -1
- package/dist/io/formats/pdf/dom.d.ts +10 -1
- package/dist/io/formats/pdf/dom.d.ts.map +1 -1
- package/dist/io/formats/pdf/dom.js +96 -2
- package/dist/io/formats/pdf/dom.js.map +1 -1
- package/dist/io/formats/pdf/export.js +3 -2
- package/dist/io/formats/pdf/export.js.map +1 -1
- package/dist/io/formats/pdf/prepare.js +1 -1
- package/dist/io/formats/pen/fonts.d.ts +14 -0
- package/dist/io/formats/pen/fonts.d.ts.map +1 -0
- package/dist/io/formats/pen/fonts.js +39 -0
- package/dist/io/formats/pen/fonts.js.map +1 -0
- package/dist/io/formats/pen/index.d.ts.map +1 -1
- package/dist/io/formats/pen/index.js +25 -6
- package/dist/io/formats/pen/index.js.map +1 -1
- package/dist/io/formats/raster/headless.d.ts +3 -3
- package/dist/io/formats/raster/headless.d.ts.map +1 -1
- package/dist/io/formats/raster/headless.js +25 -14
- package/dist/io/formats/raster/headless.js.map +1 -1
- package/dist/io/formats/raster/index.d.ts +2 -2
- package/dist/io/formats/raster/index.js +2 -2
- package/dist/io/formats/raster/render.d.ts +8 -2
- package/dist/io/formats/raster/render.d.ts.map +1 -1
- package/dist/io/formats/raster/render.js +42 -8
- package/dist/io/formats/raster/render.js.map +1 -1
- package/dist/io/formats/svg/export.d.ts.map +1 -1
- package/dist/io/formats/svg/export.js +28 -24
- package/dist/io/formats/svg/export.js.map +1 -1
- package/dist/io/formats/svg/paths.d.ts +8 -2
- package/dist/io/formats/svg/paths.d.ts.map +1 -1
- package/dist/io/formats/svg/paths.js +11 -3
- package/dist/io/formats/svg/paths.js.map +1 -1
- package/dist/io/formats/svg/strokes.d.ts.map +1 -1
- package/dist/io/formats/svg/strokes.js +2 -5
- 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 +19 -1
- package/dist/io/formats/svg/text/export.js.map +1 -1
- package/dist/io/formats/svg/text/import.d.ts.map +1 -1
- package/dist/io/formats/svg/text/import.js +2 -1
- package/dist/io/formats/svg/text/import.js.map +1 -1
- package/dist/io/formats.d.ts.map +1 -1
- package/dist/io/formats.js +3 -1
- package/dist/io/formats.js.map +1 -1
- package/dist/io/registry.d.ts +2 -0
- package/dist/io/registry.d.ts.map +1 -1
- package/dist/io/registry.js +5 -0
- package/dist/io/registry.js.map +1 -1
- package/dist/io/subgraph.d.ts.map +1 -1
- package/dist/io/subgraph.js +5 -2
- package/dist/io/subgraph.js.map +1 -1
- package/dist/io/types.d.ts +2 -0
- package/dist/io/types.d.ts.map +1 -1
- package/dist/kiwi/fig/population/client.d.ts.map +1 -1
- package/dist/kiwi/fig/population/client.js +63 -45
- package/dist/kiwi/fig/population/client.js.map +1 -1
- package/dist/kiwi/fig/population/delta.d.ts +34 -3
- package/dist/kiwi/fig/population/delta.d.ts.map +1 -1
- package/dist/kiwi/fig/population/delta.js +99 -16
- package/dist/kiwi/fig/population/delta.js.map +1 -1
- package/dist/kiwi/fig/population/edits.d.ts +51 -0
- package/dist/kiwi/fig/population/edits.d.ts.map +1 -0
- package/dist/kiwi/fig/population/edits.js +169 -0
- package/dist/kiwi/fig/population/edits.js.map +1 -0
- package/dist/kiwi/fig/session/archive/access.d.ts +3 -0
- package/dist/kiwi/fig/session/archive/access.d.ts.map +1 -1
- package/dist/kiwi/fig/session/archive/access.js +8 -1
- package/dist/kiwi/fig/session/archive/access.js.map +1 -1
- package/dist/kiwi/fig/session/archive/changes.d.ts +2 -1
- package/dist/kiwi/fig/session/archive/changes.d.ts.map +1 -1
- package/dist/kiwi/fig/session/archive/changes.js +12 -5
- package/dist/kiwi/fig/session/archive/changes.js.map +1 -1
- package/dist/kiwi/fig/session/document-state.d.ts +7 -1
- package/dist/kiwi/fig/session/document-state.d.ts.map +1 -1
- package/dist/kiwi/fig/session/document-state.js +16 -2
- package/dist/kiwi/fig/session/document-state.js.map +1 -1
- package/dist/kiwi/fig/session/protocol.d.ts +31 -3
- package/dist/kiwi/fig/session/protocol.d.ts.map +1 -1
- package/dist/kiwi/fig/session/worker.js +33 -8
- package/dist/kiwi/fig/session/worker.js.map +1 -1
- package/dist/layout/apply.d.ts +6 -1
- package/dist/layout/apply.d.ts.map +1 -1
- package/dist/layout/apply.js +39 -14
- package/dist/layout/apply.js.map +1 -1
- package/dist/layout/arrange/boxes.d.ts.map +1 -1
- package/dist/layout/arrange/boxes.js +31 -0
- package/dist/layout/arrange/boxes.js.map +1 -1
- package/dist/layout/flow-edges.d.ts +26 -0
- package/dist/layout/flow-edges.d.ts.map +1 -0
- package/dist/layout/flow-edges.js +105 -0
- package/dist/layout/flow-edges.js.map +1 -0
- package/dist/layout/grid.d.ts.map +1 -1
- package/dist/layout/grid.js +9 -5
- package/dist/layout/grid.js.map +1 -1
- package/dist/layout/text-auto-resize.d.ts.map +1 -1
- package/dist/layout/text-auto-resize.js +9 -4
- package/dist/layout/text-auto-resize.js.map +1 -1
- package/dist/layout/text-measurement.d.ts +15 -1
- package/dist/layout/text-measurement.d.ts.map +1 -1
- package/dist/layout/text-measurement.js +40 -4
- package/dist/layout/text-measurement.js.map +1 -1
- package/dist/layout/variables.d.ts +1 -1
- package/dist/layout.d.ts.map +1 -1
- package/dist/layout.js +35 -35
- package/dist/layout.js.map +1 -1
- package/dist/library/asset-keys.d.ts +3 -2
- package/dist/library/asset-keys.d.ts.map +1 -1
- package/dist/library/asset-keys.js +4 -3
- package/dist/library/asset-keys.js.map +1 -1
- package/dist/library/copied-references.d.ts +8 -3
- package/dist/library/copied-references.d.ts.map +1 -1
- package/dist/library/copied-references.js +15 -5
- package/dist/library/copied-references.js.map +1 -1
- package/dist/library/materialize.js +1 -1
- package/dist/library/materialize.js.map +1 -1
- package/dist/library/schema.js.map +1 -1
- package/dist/library/snapshot.d.ts.map +1 -1
- package/dist/library/snapshot.js +11 -2
- package/dist/library/snapshot.js.map +1 -1
- package/dist/lint/linter.d.ts.map +1 -1
- package/dist/lint/linter.js +11 -2
- package/dist/lint/linter.js.map +1 -1
- package/dist/pairdraw-api/variables.d.ts.map +1 -1
- package/dist/pairdraw-api/variables.js +0 -2
- package/dist/pairdraw-api/variables.js.map +1 -1
- package/dist/profiler/hud-controller.d.ts +4 -3
- package/dist/profiler/hud-controller.d.ts.map +1 -1
- package/dist/profiler/hud-controller.js +7 -5
- package/dist/profiler/hud-controller.js.map +1 -1
- package/dist/profiler/hud-renderer.d.ts +5 -2
- package/dist/profiler/hud-renderer.d.ts.map +1 -1
- package/dist/profiler/hud-renderer.js +8 -5
- package/dist/profiler/hud-renderer.js.map +1 -1
- package/dist/profiler/render-profiler.d.ts +3 -2
- package/dist/profiler/render-profiler.d.ts.map +1 -1
- package/dist/profiler/render-profiler.js +3 -2
- package/dist/profiler/render-profiler.js.map +1 -1
- package/dist/rpc/variables-command.d.ts.map +1 -1
- package/dist/rpc/variables-command.js +4 -2
- package/dist/rpc/variables-command.js.map +1 -1
- package/dist/text/character-style.d.ts +11 -1
- package/dist/text/character-style.d.ts.map +1 -1
- package/dist/text/character-style.js +27 -5
- package/dist/text/character-style.js.map +1 -1
- package/dist/text/coverage.d.ts.map +1 -1
- package/dist/text/coverage.js +16 -14
- package/dist/text/coverage.js.map +1 -1
- package/dist/text/editor.d.ts.map +1 -1
- package/dist/text/editor.js +3 -8
- package/dist/text/editor.js.map +1 -1
- package/dist/text/fallbacks.d.ts +26 -3
- package/dist/text/fallbacks.d.ts.map +1 -1
- package/dist/text/fallbacks.js +135 -18
- package/dist/text/fallbacks.js.map +1 -1
- package/dist/text/font/catalog.d.ts +4 -0
- package/dist/text/font/catalog.d.ts.map +1 -1
- package/dist/text/font/catalog.js +8 -0
- package/dist/text/font/catalog.js.map +1 -1
- package/dist/text/font/collection.d.ts +13 -0
- package/dist/text/font/collection.d.ts.map +1 -0
- package/dist/text/font/collection.js +51 -0
- package/dist/text/font/collection.js.map +1 -0
- package/dist/text/font/faces.d.ts +2 -1
- package/dist/text/font/faces.d.ts.map +1 -1
- package/dist/text/font/faces.js +9 -5
- package/dist/text/font/faces.js.map +1 -1
- package/dist/text/font/glyphs.d.ts +14 -3
- package/dist/text/font/glyphs.d.ts.map +1 -1
- package/dist/text/font/glyphs.js +22 -5
- package/dist/text/font/glyphs.js.map +1 -1
- package/dist/text/font/local.js +2 -2
- package/dist/text/font/local.js.map +1 -1
- package/dist/text/font/manager.d.ts +50 -6
- package/dist/text/font/manager.d.ts.map +1 -1
- package/dist/text/font/manager.js +178 -32
- package/dist/text/font/manager.js.map +1 -1
- package/dist/text/font/style.d.ts +7 -2
- package/dist/text/font/style.d.ts.map +1 -1
- package/dist/text/font/style.js +31 -3
- package/dist/text/font/style.js.map +1 -1
- package/dist/text/index.d.ts +5 -4
- package/dist/text/index.js +5 -4
- package/dist/text/outlines.d.ts.map +1 -1
- package/dist/text/outlines.js +71 -71
- package/dist/text/outlines.js.map +1 -1
- package/dist/text/path/caret.d.ts +2 -4
- package/dist/text/path/caret.d.ts.map +1 -1
- package/dist/text/path/caret.js.map +1 -1
- package/dist/text/prepare.d.ts +5 -1
- package/dist/text/prepare.d.ts.map +1 -1
- package/dist/text/prepare.js +26 -3
- package/dist/text/prepare.js.map +1 -1
- package/dist/text/style-runs.d.ts +14 -2
- package/dist/text/style-runs.d.ts.map +1 -1
- package/dist/text/style-runs.js +22 -14
- package/dist/text/style-runs.js.map +1 -1
- package/dist/text/web-font/assets.d.ts.map +1 -1
- package/dist/text/web-font/assets.js +13 -21
- package/dist/text/web-font/assets.js.map +1 -1
- package/dist/text/web-font/resolver.d.ts.map +1 -1
- package/dist/text/web-font/resolver.js +4 -1
- package/dist/text/web-font/resolver.js.map +1 -1
- package/dist/tools/analyze/overlaps/helpers.d.ts.map +1 -1
- package/dist/tools/analyze/overlaps/helpers.js +9 -1
- package/dist/tools/analyze/overlaps/helpers.js.map +1 -1
- package/dist/tools/analyze/overlaps/index.d.ts.map +1 -1
- package/dist/tools/analyze/overlaps/index.js +27 -5
- package/dist/tools/analyze/overlaps/index.js.map +1 -1
- package/dist/tools/codegen/component-map.js +3 -3
- package/dist/tools/codegen/component-map.js.map +1 -1
- package/dist/tools/create/basic.d.ts.map +1 -1
- package/dist/tools/create/basic.js +5 -4
- package/dist/tools/create/basic.js.map +1 -1
- package/dist/tools/create/components.d.ts +2 -1
- package/dist/tools/create/components.d.ts.map +1 -1
- package/dist/tools/create/components.js +27 -1
- 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 +4 -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 +14 -6
- package/dist/tools/create/icons.js.map +1 -1
- package/dist/tools/create/mermaid.d.ts.map +1 -1
- package/dist/tools/create/mermaid.js +2 -0
- package/dist/tools/create/mermaid.js.map +1 -1
- package/dist/tools/create/render.d.ts.map +1 -1
- package/dist/tools/create/render.js +2 -0
- package/dist/tools/create/render.js.map +1 -1
- package/dist/tools/create/script.js +3 -1
- package/dist/tools/create/script.js.map +1 -1
- package/dist/tools/create/svg.d.ts.map +1 -1
- package/dist/tools/create/svg.js +4 -1
- package/dist/tools/create/svg.js.map +1 -1
- package/dist/tools/create/vector.d.ts.map +1 -1
- package/dist/tools/create/vector.js +13 -10
- package/dist/tools/create/vector.js.map +1 -1
- package/dist/tools/create.d.ts +2 -2
- package/dist/tools/create.js +2 -2
- package/dist/tools/image-ai/apply.js +1 -1
- package/dist/tools/image-ai/generate.d.ts.map +1 -1
- package/dist/tools/image-ai/generate.js +3 -0
- package/dist/tools/image-ai/generate.js.map +1 -1
- package/dist/tools/modify/effects.d.ts.map +1 -1
- package/dist/tools/modify/effects.js +5 -3
- package/dist/tools/modify/effects.js.map +1 -1
- package/dist/tools/modify/matching.d.ts.map +1 -1
- package/dist/tools/modify/matching.js +9 -6
- 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 +7 -5
- package/dist/tools/modify/paint.js.map +1 -1
- package/dist/tools/modify/reactions.d.ts +6 -0
- package/dist/tools/modify/reactions.d.ts.map +1 -0
- package/dist/tools/modify/reactions.js +35 -0
- package/dist/tools/modify/reactions.js.map +1 -0
- package/dist/tools/modify/text.d.ts.map +1 -1
- package/dist/tools/modify/text.js +28 -8
- package/dist/tools/modify/text.js.map +1 -1
- package/dist/tools/modify.d.ts +2 -1
- package/dist/tools/modify.js +2 -1
- package/dist/tools/read/components.js +20 -22
- package/dist/tools/read/components.js.map +1 -1
- package/dist/tools/read/fonts.js +1 -1
- package/dist/tools/read/fonts.js.map +1 -1
- package/dist/tools/read/libraries.d.ts.map +1 -1
- package/dist/tools/read/libraries.js +18 -4
- 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 +38 -16
- package/dist/tools/read/nodes.js.map +1 -1
- package/dist/tools/read/pages.d.ts.map +1 -1
- package/dist/tools/read/pages.js +4 -3
- package/dist/tools/read/pages.js.map +1 -1
- package/dist/tools/read/query.js +1 -0
- package/dist/tools/read/query.js.map +1 -1
- package/dist/tools/read/reactions.d.ts +6 -0
- package/dist/tools/read/reactions.d.ts.map +1 -0
- package/dist/tools/read/reactions.js +24 -0
- package/dist/tools/read/reactions.js.map +1 -0
- package/dist/tools/read/space.js +1 -1
- package/dist/tools/read.d.ts +2 -1
- package/dist/tools/read.js +2 -1
- package/dist/tools/registry/extended.d.ts.map +1 -1
- package/dist/tools/registry/extended.js +6 -1
- package/dist/tools/registry/extended.js.map +1 -1
- package/dist/tools/schema.d.ts +30 -5
- package/dist/tools/schema.d.ts.map +1 -1
- package/dist/tools/schema.js +125 -7
- package/dist/tools/schema.js.map +1 -1
- package/dist/tools/stock-photo/apply.js +8 -9
- package/dist/tools/stock-photo/apply.js.map +1 -1
- package/dist/tools/structure/batch.d.ts.map +1 -1
- package/dist/tools/structure/batch.js +86 -90
- package/dist/tools/structure/batch.js.map +1 -1
- package/dist/tools/variables/values.d.ts.map +1 -1
- package/dist/tools/variables/values.js +4 -2
- package/dist/tools/variables/values.js.map +1 -1
- package/dist/tools/vector/export.d.ts.map +1 -1
- package/dist/tools/vector/export.js +5 -2
- package/dist/tools/vector/export.js.map +1 -1
- package/dist/vector/fill-geometry.d.ts +4 -1
- package/dist/vector/fill-geometry.d.ts.map +1 -1
- package/dist/vector/fill-geometry.js +8 -5
- package/dist/vector/fill-geometry.js.map +1 -1
- package/dist/vector/index.js +1 -1
- package/dist/vector/index.js.map +1 -1
- package/dist/vector/path-helpers.d.ts +1 -1
- package/dist/vector/path-helpers.d.ts.map +1 -1
- package/dist/vector/path-helpers.js +24 -7
- package/dist/vector/path-helpers.js.map +1 -1
- package/dist/vector/placement.js +1 -1
- package/dist/vector/placement.js.map +1 -1
- package/dist/vector/vectorize/preprocess.js +1 -1
- package/dist/vector/vectorize/preprocess.js.map +1 -1
- package/package.json +10 -10
- package/src/canvas/effects.ts +29 -33
- package/src/canvas/labels/hit-test.ts +6 -2
- package/src/canvas/labels/paragraph-cache.ts +2 -1
- package/src/canvas/labels/selection.ts +3 -3
- package/src/canvas/node-edit-overlay.ts +3 -2
- package/src/canvas/outline-stroke.ts +2 -6
- package/src/canvas/overlays/index.ts +0 -1
- package/src/canvas/overlays/prototype.ts +5 -27
- package/src/canvas/overlays/selection.ts +4 -52
- package/src/canvas/region-hatch.ts +7 -2
- package/src/canvas/renderer/colors.ts +41 -26
- package/src/canvas/renderer/font-waiters.ts +25 -0
- package/src/canvas/renderer/fonts.ts +42 -18
- package/src/canvas/renderer/lifecycle.ts +8 -10
- package/src/canvas/renderer/methods.ts +9 -13
- package/src/canvas/renderer/paints.ts +0 -10
- package/src/canvas/renderer/pipeline.ts +29 -3
- package/src/canvas/renderer/retained-backing.ts +4 -4
- package/src/canvas/renderer/state.ts +1 -1
- package/src/canvas/renderer/tiles/controller.ts +8 -0
- package/src/canvas/renderer/tiles/surface-pool.ts +1 -1
- package/src/canvas/renderer/visual-bounds.ts +7 -6
- package/src/canvas/renderer.ts +43 -11
- package/src/canvas/rulers.ts +55 -26
- package/src/canvas/scene.ts +127 -77
- package/src/canvas/shadows/shape.ts +1 -1
- package/src/canvas/shadows/silhouette.ts +4 -2
- package/src/canvas/shadows.ts +4 -2
- package/src/canvas/text/derived.ts +0 -9
- package/src/canvas/text/emoji/raster.ts +14 -10
- package/src/canvas/text/font-families.ts +14 -7
- package/src/canvas/text/index.ts +3 -9
- package/src/canvas/text/layout/build.ts +35 -18
- package/src/canvas/text/layout/index.ts +15 -6
- package/src/canvas/text/layout/lines.ts +10 -4
- package/src/canvas/text/paragraph/index.ts +19 -10
- package/src/canvas/text/paragraph/inputs.ts +4 -2
- package/src/canvas/text/placed.ts +2 -2
- package/src/canvas/text/renderer.ts +2 -0
- package/src/canvas/text/shape.ts +20 -31
- package/src/constants.ts +6 -1
- package/src/editor/bridges/clipboard.ts +1 -0
- package/src/editor/bridges/components.ts +2 -0
- package/src/editor/bridges/frames.ts +6 -4
- package/src/editor/bridges/structure.ts +1 -0
- package/src/editor/clipboard/detach.ts +3 -3
- package/src/editor/clipboard/paste/target.ts +2 -2
- package/src/editor/clipboard/snapshot.ts +7 -0
- package/src/editor/clipboard/variables.ts +20 -0
- package/src/editor/clipboard.ts +133 -14
- package/src/editor/component-sync.ts +28 -7
- package/src/editor/components/authoring/text-edit.ts +15 -2
- package/src/editor/components/authoring/visibility-edit.ts +11 -3
- package/src/editor/components/instances.ts +61 -11
- package/src/editor/components/properties.ts +10 -0
- package/src/editor/components/slots/authoring.ts +4 -1
- package/src/editor/create.ts +58 -8
- package/src/editor/guides.ts +27 -12
- package/src/editor/history/document-change.ts +115 -7
- package/src/editor/history/edit.ts +62 -14
- package/src/editor/history/position.ts +1 -4
- package/src/editor/history/sources.ts +25 -0
- package/src/editor/index.ts +3 -1
- package/src/editor/layout-mode.ts +20 -1
- package/src/editor/node-preview.ts +44 -8
- package/src/editor/nodes.ts +52 -12
- package/src/editor/nudge.ts +16 -2
- package/src/editor/pages.ts +100 -17
- package/src/editor/play/states.ts +0 -7
- package/src/editor/read-only/actions.ts +4 -0
- package/src/editor/selection/hit-test.ts +37 -4
- package/src/editor/shapes/pen.ts +6 -3
- package/src/editor/shapes.ts +2 -1
- package/src/editor/structure/auto-layout-wrap.ts +26 -0
- package/src/editor/structure/group/bounds.ts +22 -4
- package/src/editor/structure/rename.ts +2 -6
- package/src/editor/structure/reorder.ts +26 -8
- package/src/editor/structure.ts +88 -24
- package/src/editor/text/hyperlink.ts +2 -1
- package/src/editor/text/name.ts +51 -15
- package/src/editor/text/pending-layout.ts +42 -4
- package/src/editor/text/selection-style.ts +17 -3
- package/src/editor/text.ts +86 -4
- package/src/editor/types.ts +19 -0
- package/src/editor/undo.ts +21 -2
- package/src/editor/variable-bindings.ts +22 -2
- package/src/editor/variables.ts +10 -6
- package/src/editor/viewport.ts +55 -21
- package/src/editor/views/actions.ts +17 -7
- package/src/editor/views/present.ts +20 -11
- package/src/editor/views/types.ts +11 -5
- package/src/figma-api/accessor-utils.ts +4 -1
- package/src/figma-api/accessors/basic.ts +54 -18
- package/src/figma-api/accessors/layout.ts +46 -7
- package/src/figma-api/accessors/reactions.ts +29 -0
- package/src/figma-api/accessors/strokes.ts +28 -8
- package/src/figma-api/accessors/text/index.ts +4 -0
- package/src/figma-api/accessors/vector.ts +3 -1
- package/src/figma-api/accessors/visual.ts +25 -28
- package/src/figma-api/components.ts +9 -7
- package/src/figma-api/finite.ts +102 -0
- package/src/figma-api/fonts/list.ts +24 -0
- package/src/figma-api/index.ts +170 -19
- package/src/figma-api/overrides.ts +1 -1
- package/src/figma-api/pending-layout.ts +50 -1
- package/src/figma-api/pending-sync.ts +61 -0
- package/src/figma-api/proxy.ts +35 -2
- package/src/figma-api/reactions.ts +212 -0
- package/src/figma-api/render-bounds.ts +13 -4
- package/src/figma-api/serialization.ts +16 -2
- package/src/figma-api/slots.ts +12 -3
- package/src/figma-api/strokes.ts +16 -12
- package/src/figma-api/text/index.ts +9 -15
- package/src/figma-api/variables/variable.ts +3 -2
- package/src/geometry/connectors.ts +2 -12
- package/src/geometry/figma.ts +9 -0
- package/src/geometry/index.ts +2 -1
- package/src/geometry/scene.ts +19 -0
- package/src/geometry/types.ts +8 -0
- package/src/global.d.ts +6 -0
- package/src/icons/api.ts +27 -16
- package/src/icons/provider.ts +9 -20
- package/src/icons/schema.ts +31 -0
- package/src/icons/svg/presentation.ts +27 -3
- package/src/icons/svg/text.ts +1 -1
- package/src/icons/svg.ts +21 -19
- package/src/icons/types.ts +0 -14
- package/src/io/formats/design-tokens/plan/index.ts +7 -1
- package/src/io/formats/design-tokens/plan/styles.ts +40 -4
- package/src/io/formats/design-tokens/styles.ts +60 -3
- package/src/io/formats/design-tokens/types.ts +3 -0
- package/src/io/formats/drawio/export.ts +11 -0
- package/src/io/formats/drawio/index.ts +36 -1
- package/src/io/formats/drawio/shapes.ts +13 -9
- package/src/io/formats/drawio/warnings.ts +27 -0
- package/src/io/formats/fig/export/setup.ts +16 -14
- package/src/io/formats/fig/export/variables.ts +7 -8
- package/src/io/formats/fig/index.ts +1 -0
- package/src/io/formats/fig/read.ts +66 -23
- package/src/io/formats/html/index.ts +2 -6
- package/src/io/formats/pdf/dom.ts +125 -3
- package/src/io/formats/pdf/export.ts +3 -2
- package/src/io/formats/pen/fonts.ts +45 -0
- package/src/io/formats/pen/index.ts +30 -6
- package/src/io/formats/raster/headless.ts +40 -14
- package/src/io/formats/raster/index.ts +3 -0
- package/src/io/formats/raster/render.ts +66 -8
- package/src/io/formats/svg/export.ts +24 -25
- package/src/io/formats/svg/paths.ts +11 -2
- package/src/io/formats/svg/strokes.ts +8 -2
- package/src/io/formats/svg/text/export.ts +23 -0
- package/src/io/formats/svg/text/import.ts +2 -1
- package/src/io/formats.ts +3 -1
- package/src/io/registry.ts +12 -0
- package/src/io/subgraph.ts +3 -1
- package/src/io/types.ts +2 -0
- package/src/kiwi/fig/population/client.ts +77 -43
- package/src/kiwi/fig/population/delta.ts +141 -18
- package/src/kiwi/fig/population/edits.ts +235 -0
- package/src/kiwi/fig/session/archive/access.ts +15 -0
- package/src/kiwi/fig/session/archive/changes.ts +27 -6
- package/src/kiwi/fig/session/document-state.ts +23 -1
- package/src/kiwi/fig/session/protocol.ts +26 -1
- package/src/kiwi/fig/session/worker.ts +38 -11
- package/src/layout/apply.ts +52 -10
- package/src/layout/arrange/boxes.ts +36 -0
- package/src/layout/flow-edges.ts +139 -0
- package/src/layout/grid.ts +14 -4
- package/src/layout/text-auto-resize.ts +13 -4
- package/src/layout/text-measurement.ts +46 -3
- package/src/layout.ts +60 -66
- package/src/library/asset-keys.ts +4 -3
- package/src/library/copied-references.ts +29 -5
- package/src/library/materialize.ts +1 -1
- package/src/library/schema.ts +1 -1
- package/src/library/snapshot.ts +12 -2
- package/src/lint/linter.ts +12 -2
- package/src/pairdraw-api/variables.ts +1 -3
- package/src/profiler/hud-controller.ts +8 -6
- package/src/profiler/hud-renderer.ts +9 -6
- package/src/profiler/render-profiler.ts +4 -3
- package/src/rpc/variables-command.ts +6 -5
- package/src/text/character-style.ts +29 -9
- package/src/text/coverage.ts +29 -15
- package/src/text/editor.ts +3 -8
- package/src/text/fallbacks.ts +163 -22
- package/src/text/font/catalog.ts +10 -0
- package/src/text/font/collection.ts +60 -0
- package/src/text/font/faces.ts +9 -5
- package/src/text/font/glyphs.ts +29 -4
- package/src/text/font/local.ts +2 -2
- package/src/text/font/manager.ts +220 -49
- package/src/text/font/style.ts +52 -3
- package/src/text/index.ts +1 -0
- package/src/text/outlines.ts +106 -90
- package/src/text/path/caret.ts +3 -4
- package/src/text/prepare.ts +51 -2
- package/src/text/style-runs.ts +43 -16
- package/src/text/web-font/assets.ts +11 -15
- package/src/text/web-font/resolver.ts +7 -1
- package/src/tools/analyze/overlaps/helpers.ts +18 -1
- package/src/tools/analyze/overlaps/index.ts +37 -6
- package/src/tools/codegen/component-map.ts +3 -3
- package/src/tools/create/basic.ts +6 -4
- package/src/tools/create/components.ts +33 -0
- package/src/tools/create/html.ts +3 -1
- package/src/tools/create/icons.ts +16 -6
- package/src/tools/create/mermaid.ts +2 -0
- package/src/tools/create/render.ts +2 -0
- package/src/tools/create/script.ts +5 -1
- package/src/tools/create/svg.ts +4 -1
- package/src/tools/create/vector.ts +20 -10
- package/src/tools/create.ts +1 -0
- package/src/tools/image-ai/generate.ts +3 -0
- package/src/tools/modify/effects.ts +11 -4
- package/src/tools/modify/matching.ts +10 -6
- package/src/tools/modify/paint.ts +13 -5
- package/src/tools/modify/reactions.ts +40 -0
- package/src/tools/modify/text.ts +53 -20
- package/src/tools/modify.ts +1 -0
- package/src/tools/read/components.ts +28 -25
- package/src/tools/read/fonts.ts +1 -1
- package/src/tools/read/libraries.ts +24 -4
- package/src/tools/read/nodes.ts +47 -17
- package/src/tools/read/pages.ts +7 -3
- package/src/tools/read/query.ts +2 -0
- package/src/tools/read/reactions.ts +21 -0
- package/src/tools/read.ts +1 -0
- package/src/tools/registry/extended.ts +6 -0
- package/src/tools/schema.ts +166 -6
- package/src/tools/stock-photo/apply.ts +17 -5
- package/src/tools/structure/batch.ts +84 -98
- package/src/tools/variables/values.ts +6 -3
- package/src/tools/vector/export.ts +5 -1
- package/src/vector/fill-geometry.ts +11 -5
- package/src/vector/index.ts +1 -1
- package/src/vector/path-helpers.ts +34 -8
- package/src/vector/placement.ts +1 -1
- package/src/vector/vectorize/preprocess.ts +1 -1
|
@@ -114,16 +114,16 @@ export const designToComponentMap = defineTool({
|
|
|
114
114
|
name: 'design_to_component_map',
|
|
115
115
|
description:
|
|
116
116
|
'Analyze the document and return a structured component decomposition: components (with variants, props, instance counts), screens, and a dependency overview.',
|
|
117
|
-
execution: { kind: '
|
|
117
|
+
execution: { kind: 'async', mutation: 'none' },
|
|
118
118
|
input: v.strictObject({
|
|
119
119
|
page: v.optional(
|
|
120
120
|
v.pipe(v.string(), v.description('Page name to analyze (default: current page)'))
|
|
121
121
|
)
|
|
122
122
|
}),
|
|
123
|
-
execute: (figma, args) => {
|
|
123
|
+
execute: async (figma, args) => {
|
|
124
124
|
if (args.page) {
|
|
125
125
|
const target = figma.root.children.find((page) => page.name === args.page)
|
|
126
|
-
if (target) figma.
|
|
126
|
+
if (target) await figma.setCurrentPageAsync(target)
|
|
127
127
|
else return { error: `Page "${args.page}" not found` }
|
|
128
128
|
}
|
|
129
129
|
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import * as v from 'valibot'
|
|
2
2
|
|
|
3
3
|
import type { FigmaNodeProxy } from '#core/figma-api'
|
|
4
|
+
import { prepareSlotInsertion } from '#core/figma-api/slots'
|
|
4
5
|
import { toolNumber, positionInputs, defineTool, nodeSummary } from '#core/tools/schema'
|
|
5
6
|
|
|
6
7
|
export const createShape = defineTool({
|
|
@@ -23,6 +24,8 @@ export const createShape = defineTool({
|
|
|
23
24
|
execute: (figma, args) => {
|
|
24
25
|
const parentId = args.parent_id
|
|
25
26
|
const parent = parentId ? figma.getNodeById(parentId) : null
|
|
27
|
+
// Refuse before creating, so a refused parent leaves no layer behind on the page.
|
|
28
|
+
if (parent) prepareSlotInsertion(figma.graph, parent.id, 'create_shape')
|
|
26
29
|
const createMap: Record<string, () => FigmaNodeProxy> = {
|
|
27
30
|
FRAME: () => figma.createFrame(),
|
|
28
31
|
RECTANGLE: () => figma.createRectangle(),
|
|
@@ -71,16 +74,15 @@ export const createSlice = defineTool({
|
|
|
71
74
|
parent_id: v.optional(v.pipe(v.string(), v.description('Parent node ID')))
|
|
72
75
|
}),
|
|
73
76
|
execute: (figma, args) => {
|
|
77
|
+
const parent = args.parent_id ? figma.getNodeById(args.parent_id) : null
|
|
78
|
+
if (parent) prepareSlotInsertion(figma.graph, parent.id, 'create_slice')
|
|
74
79
|
const node = figma.createFrame()
|
|
75
80
|
node.x = args.x
|
|
76
81
|
node.y = args.y
|
|
77
82
|
node.resize(args.width, args.height)
|
|
78
83
|
node.name = args.name ?? 'Slice'
|
|
79
84
|
node.fills = []
|
|
80
|
-
if (
|
|
81
|
-
const parent = figma.getNodeById(args.parent_id)
|
|
82
|
-
if (parent) parent.appendChild(node)
|
|
83
|
-
}
|
|
85
|
+
if (parent) parent.appendChild(node)
|
|
84
86
|
return nodeSummary(node)
|
|
85
87
|
}
|
|
86
88
|
})
|
|
@@ -105,3 +105,36 @@ export const exposeInstanceSwap = defineTool({
|
|
|
105
105
|
}
|
|
106
106
|
}
|
|
107
107
|
})
|
|
108
|
+
|
|
109
|
+
export const detachInstance = defineTool({
|
|
110
|
+
name: 'detach_instance',
|
|
111
|
+
|
|
112
|
+
description:
|
|
113
|
+
'Detach instances into plain frames, keeping their children, overrides, and position.',
|
|
114
|
+
execution: { kind: 'sync', mutation: 'document' },
|
|
115
|
+
input: v.strictObject({
|
|
116
|
+
ids: v.pipe(v.array(v.string()), v.minLength(1), v.description('Instance node IDs to detach'))
|
|
117
|
+
}),
|
|
118
|
+
execute: (figma, { ids }) => {
|
|
119
|
+
// Validate every id before the first detach so a refused call changes nothing.
|
|
120
|
+
// A repeated id is detached once; detaching it again would hit a frame that
|
|
121
|
+
// no longer exists as an instance and fail halfway through the batch.
|
|
122
|
+
const instances: FigmaNodeProxy[] = []
|
|
123
|
+
const seen = new Set<string>()
|
|
124
|
+
for (const id of ids) {
|
|
125
|
+
if (seen.has(id)) continue
|
|
126
|
+
seen.add(id)
|
|
127
|
+
const node = figma.getNodeById(id)
|
|
128
|
+
if (!node) return { error: `Node "${id}" not found` }
|
|
129
|
+
if (node.type !== 'INSTANCE') {
|
|
130
|
+
return { error: `Node "${id}" is not an instance (${node.type})` }
|
|
131
|
+
}
|
|
132
|
+
instances.push(node)
|
|
133
|
+
}
|
|
134
|
+
try {
|
|
135
|
+
return { ids: instances.map((instance) => instance.detachInstance().id) }
|
|
136
|
+
} catch (error) {
|
|
137
|
+
return { error: error instanceof Error ? error.message : String(error) }
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
})
|
package/src/tools/create/html.ts
CHANGED
|
@@ -5,6 +5,7 @@ import { getAxisAlignedBoundsInParent } from '@pairdraw/scene-graph/coordinate'
|
|
|
5
5
|
import { applyGraphTransfer, prepareGraphTransfer } from '@pairdraw/scene-graph/transfer'
|
|
6
6
|
|
|
7
7
|
import { flushPendingLayout } from '#core/figma-api'
|
|
8
|
+
import { prepareSlotInsertion } from '#core/figma-api/slots'
|
|
8
9
|
import { sceneGraphFromStyledHTML } from '#core/io/formats/html/layers'
|
|
9
10
|
import { findPageId } from '#core/io/subgraph'
|
|
10
11
|
import { layoutAuthoredNodes } from '#core/layout'
|
|
@@ -34,11 +35,12 @@ export const importHTML = defineTool({
|
|
|
34
35
|
}),
|
|
35
36
|
execute: async (figma, args) => {
|
|
36
37
|
const graph = figma.graph
|
|
38
|
+
const parentId = args.parent_id ?? figma.currentPage.id
|
|
39
|
+
prepareSlotInsertion(graph, parentId, 'import_html')
|
|
37
40
|
const host = getHTMLToolHost(graph)
|
|
38
41
|
if (!host) {
|
|
39
42
|
return { error: 'import_html needs a CSS runtime, which this environment does not provide' }
|
|
40
43
|
}
|
|
41
|
-
const parentId = args.parent_id ?? figma.currentPage.id
|
|
42
44
|
const parent = graph.getNode(parentId)
|
|
43
45
|
if (!parent || (parent.type !== 'CANVAS' && !findPageId(graph, parentId))) {
|
|
44
46
|
return { error: `Parent "${parentId}" not found` }
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import * as v from 'valibot'
|
|
2
2
|
|
|
3
|
-
import { parseColor } from '@pairdraw/scene-graph/color'
|
|
4
3
|
import { iconOptionsSchema, type IconOptions } from '@pairdraw/scene-graph/icons'
|
|
5
4
|
|
|
5
|
+
import { prepareSlotInsertion } from '#core/figma-api/slots'
|
|
6
6
|
import { placeIcon } from '#core/icons'
|
|
7
|
-
import {
|
|
7
|
+
import { defineTool, parseToolColor, toolNumber } from '#core/tools/schema'
|
|
8
8
|
|
|
9
9
|
export const fetchIconsTool = defineTool({
|
|
10
10
|
name: 'fetch_icons',
|
|
@@ -120,6 +120,8 @@ export const insertIcon = defineTool({
|
|
|
120
120
|
v.pipe(v.string(), v.description('Icon color hex (replaces currentColor). Default: #000000'))
|
|
121
121
|
),
|
|
122
122
|
parent_id: v.optional(v.pipe(v.string(), v.description('Parent node ID for all icons'))),
|
|
123
|
+
x: v.optional(toolNumber(v.pipe(v.number(), v.description('X position in the parent')))),
|
|
124
|
+
y: v.optional(toolNumber(v.pipe(v.number(), v.description('Y position in the parent')))),
|
|
123
125
|
...iconOptionInputs
|
|
124
126
|
}),
|
|
125
127
|
execute: async (figma, args) => {
|
|
@@ -127,8 +129,8 @@ export const insertIcon = defineTool({
|
|
|
127
129
|
if (names.length === 0) return { error: 'Provide "names" (array) or "name" (string)' }
|
|
128
130
|
|
|
129
131
|
const size = args.size ?? 24
|
|
130
|
-
const
|
|
131
|
-
|
|
132
|
+
const parsedColor = parseToolColor(args.color ?? '#000000')
|
|
133
|
+
if ('error' in parsedColor) return parsedColor
|
|
132
134
|
const options = iconOptions(args)
|
|
133
135
|
|
|
134
136
|
let icons
|
|
@@ -141,14 +143,22 @@ export const insertIcon = defineTool({
|
|
|
141
143
|
const inserted: { id: string; name: string; icon: string }[] = []
|
|
142
144
|
const notFound: string[] = []
|
|
143
145
|
|
|
146
|
+
const parentId = args.parent_id ?? figma.currentPage.id
|
|
147
|
+
prepareSlotInsertion(figma.graph, parentId, 'insert_icon')
|
|
144
148
|
for (const name of names) {
|
|
145
149
|
const icon = icons.get(name)
|
|
146
150
|
if (!icon || icon.paths.length === 0) {
|
|
147
151
|
notFound.push(name)
|
|
148
152
|
continue
|
|
149
153
|
}
|
|
150
|
-
|
|
151
|
-
const
|
|
154
|
+
// A position puts the icon there; without one, its parent's layout places it.
|
|
155
|
+
const overrides =
|
|
156
|
+
args.x === undefined && args.y === undefined ? {} : { x: args.x ?? 0, y: args.y ?? 0 }
|
|
157
|
+
const frame = placeIcon(figma.graph, parentId, icon, {
|
|
158
|
+
size,
|
|
159
|
+
color: parsedColor,
|
|
160
|
+
overrides
|
|
161
|
+
})
|
|
152
162
|
inserted.push({ id: frame.id, name: frame.name, icon: name })
|
|
153
163
|
}
|
|
154
164
|
|
|
@@ -3,6 +3,7 @@ import * as v from 'valibot'
|
|
|
3
3
|
import { detectMermaidDiagram, parseFlowchart } from '@pairdraw/mermaid'
|
|
4
4
|
import { getAxisAlignedBoundsInParent } from '@pairdraw/scene-graph/coordinate'
|
|
5
5
|
|
|
6
|
+
import { prepareSlotInsertion } from '#core/figma-api/slots'
|
|
6
7
|
import { addFlowchart } from '#core/io/formats/mermaid'
|
|
7
8
|
import { toolNumber, defineTool } from '#core/tools/schema'
|
|
8
9
|
|
|
@@ -39,6 +40,7 @@ export const importMermaid = defineTool({
|
|
|
39
40
|
const { graph } = figma
|
|
40
41
|
const parentId = args.parent_id ?? figma.currentPage.id
|
|
41
42
|
if (!graph.getNode(parentId)) return { error: `Parent ${parentId} not found` }
|
|
43
|
+
prepareSlotInsertion(graph, parentId, 'import_mermaid')
|
|
42
44
|
const content = graph.getNode(parentId)?.childIds ?? []
|
|
43
45
|
const bounds =
|
|
44
46
|
content.length > 0
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import * as v from 'valibot'
|
|
2
2
|
|
|
3
3
|
import { finishRenderPlacement, resolveRenderPlacement } from '#core/design-jsx/placement'
|
|
4
|
+
import { prepareSlotInsertion } from '#core/figma-api/slots'
|
|
4
5
|
import { toolNumber, defineTool } from '#core/tools/schema'
|
|
5
6
|
|
|
6
7
|
export const render = defineTool({
|
|
@@ -36,6 +37,7 @@ export const render = defineTool({
|
|
|
36
37
|
const { renderJSX } = designJSXRenderer(figma.icons)
|
|
37
38
|
|
|
38
39
|
const placement = resolveRenderPlacement(figma.graph, args, figma.currentPageId)
|
|
40
|
+
prepareSlotInsertion(figma.graph, placement.parentId, 'render')
|
|
39
41
|
const results = await renderJSX(figma.graph, args.jsx, placement)
|
|
40
42
|
finishRenderPlacement(figma.graph, results, placement)
|
|
41
43
|
const result = results[0]
|
|
@@ -31,7 +31,11 @@ export const script = defineTool({
|
|
|
31
31
|
if (!host) throw new Error('Script layers are not available in this host.')
|
|
32
32
|
if (args.action === 'create') {
|
|
33
33
|
if (!args.source) throw new Error('create needs a source.')
|
|
34
|
-
|
|
34
|
+
const result = await host.create({ source: args.source, x: args.x, y: args.y })
|
|
35
|
+
// The host drops a layer whose program could not draw; the caller gets the program's error
|
|
36
|
+
// and no id of a node that is no longer there.
|
|
37
|
+
if (!result.ok) throw new Error(result.error ?? 'The code layer did not draw.')
|
|
38
|
+
return result
|
|
35
39
|
}
|
|
36
40
|
if (!args.id) throw new Error(`${args.action} needs the code layer's id.`)
|
|
37
41
|
if (args.action === 'set_source') {
|
package/src/tools/create/svg.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import * as v from 'valibot'
|
|
2
2
|
|
|
3
|
+
import { prepareSlotInsertion } from '#core/figma-api/slots'
|
|
3
4
|
import { createSVGNodesFromImport, prepareSVGImport, svgImportFonts } from '#core/io/formats/svg'
|
|
4
5
|
import { toolNumber, defineTool } from '#core/tools/schema'
|
|
5
6
|
|
|
@@ -42,9 +43,11 @@ export const importSVG = defineTool({
|
|
|
42
43
|
figma.loadFontAsync({ family, style })
|
|
43
44
|
)
|
|
44
45
|
)
|
|
46
|
+
const parentId = args.parent_id ?? figma.currentPage.id
|
|
47
|
+
if (data) prepareSlotInsertion(figma.graph, parentId, 'import_svg')
|
|
45
48
|
const frame =
|
|
46
49
|
data &&
|
|
47
|
-
createSVGNodesFromImport(figma.graph,
|
|
50
|
+
createSVGNodesFromImport(figma.graph, parentId, data, {
|
|
48
51
|
name: args.name,
|
|
49
52
|
x: args.x,
|
|
50
53
|
y: args.y
|
|
@@ -1,11 +1,17 @@
|
|
|
1
1
|
import * as v from 'valibot'
|
|
2
2
|
|
|
3
3
|
import type { VectorNetwork } from '@pairdraw/scene-graph'
|
|
4
|
-
import { parseColor } from '@pairdraw/scene-graph/color'
|
|
5
4
|
import { parseSVGPath } from '@pairdraw/scene-graph/parse-path'
|
|
6
5
|
import { transformVectorNetwork } from '@pairdraw/scene-graph/vector-network'
|
|
7
6
|
|
|
8
|
-
import {
|
|
7
|
+
import { prepareSlotInsertion } from '#core/figma-api/slots'
|
|
8
|
+
import {
|
|
9
|
+
defineTool,
|
|
10
|
+
nodeSummary,
|
|
11
|
+
parseOptionalToolColor,
|
|
12
|
+
positionInputs,
|
|
13
|
+
toolNumber
|
|
14
|
+
} from '#core/tools/schema'
|
|
9
15
|
import { parseVectorNetworkJSON } from '#core/tools/vector/network'
|
|
10
16
|
import { computeAccurateBounds } from '#core/vector/curve-math'
|
|
11
17
|
|
|
@@ -68,6 +74,13 @@ export const createVector = defineTool({
|
|
|
68
74
|
if ('error' in parsed) return parsed
|
|
69
75
|
parsedPath = parsed
|
|
70
76
|
}
|
|
77
|
+
// Both colours are read before the node exists, so a bad one creates nothing.
|
|
78
|
+
const fill = parseOptionalToolColor(args.fill)
|
|
79
|
+
if ('error' in fill) return fill
|
|
80
|
+
const stroke = parseOptionalToolColor(args.stroke)
|
|
81
|
+
if ('error' in stroke) return stroke
|
|
82
|
+
const parent = args.parent_id ? figma.getNodeById(args.parent_id) : null
|
|
83
|
+
if (parent) prepareSlotInsertion(figma.graph, parent.id, 'create_vector')
|
|
71
84
|
|
|
72
85
|
const node = figma.createVector()
|
|
73
86
|
node.x = args.x
|
|
@@ -77,15 +90,15 @@ export const createVector = defineTool({
|
|
|
77
90
|
if (parsedPath.size) node.resize(parsedPath.size.width, parsedPath.size.height)
|
|
78
91
|
figma.graph.updateNode(node.id, { vectorNetwork: parsedPath.network })
|
|
79
92
|
}
|
|
80
|
-
if (
|
|
81
|
-
node.fills = [{ type: 'SOLID', color:
|
|
93
|
+
if (fill.color) {
|
|
94
|
+
node.fills = [{ type: 'SOLID', color: fill.color }]
|
|
82
95
|
}
|
|
83
|
-
if (
|
|
96
|
+
if (stroke.color) {
|
|
84
97
|
figma.graph.updateNode(node.id, {
|
|
85
98
|
strokes: [
|
|
86
99
|
{
|
|
87
100
|
type: 'SOLID',
|
|
88
|
-
color:
|
|
101
|
+
color: stroke.color,
|
|
89
102
|
weight: args.stroke_weight ?? 1,
|
|
90
103
|
opacity: 1,
|
|
91
104
|
visible: true,
|
|
@@ -94,10 +107,7 @@ export const createVector = defineTool({
|
|
|
94
107
|
]
|
|
95
108
|
})
|
|
96
109
|
}
|
|
97
|
-
if (
|
|
98
|
-
const parent = figma.getNodeById(args.parent_id)
|
|
99
|
-
if (parent) parent.appendChild(node)
|
|
100
|
-
}
|
|
110
|
+
if (parent) parent.appendChild(node)
|
|
101
111
|
return nodeSummary(node)
|
|
102
112
|
}
|
|
103
113
|
})
|
package/src/tools/create.ts
CHANGED
|
@@ -5,6 +5,7 @@ import { imageSize } from '@pairdraw/scene-graph/images'
|
|
|
5
5
|
import type { Size } from '@pairdraw/scene-graph/primitives'
|
|
6
6
|
|
|
7
7
|
import { storeImage } from '#core/figma-api/images'
|
|
8
|
+
import { prepareSlotInsertion } from '#core/figma-api/slots'
|
|
8
9
|
import { importSVG } from '#core/tools/create/svg'
|
|
9
10
|
import { defineTool, nodeNotFound, toolFailure, toolNumber } from '#core/tools/schema'
|
|
10
11
|
import { vectorizableImageFill } from '#core/vector/vectorize'
|
|
@@ -131,6 +132,7 @@ export const generateImage = defineTool({
|
|
|
131
132
|
}
|
|
132
133
|
const parentId = args.parent_id ?? figma.currentPage.id
|
|
133
134
|
if (!target && !graph.getNode(parentId)) return { error: `Parent "${parentId}" not found` }
|
|
135
|
+
if (!target) prepareSlotInsertion(graph, parentId, 'generate_image')
|
|
134
136
|
const service = getImageAIService(graph)
|
|
135
137
|
if (!service) return { error: IMAGE_AI_UNAVAILABLE }
|
|
136
138
|
|
|
@@ -170,6 +172,7 @@ export const generateSVG = defineTool({
|
|
|
170
172
|
const graph = figma.graph
|
|
171
173
|
const parentId = args.parent_id ?? figma.currentPage.id
|
|
172
174
|
if (!graph.getNode(parentId)) return { error: `Parent "${parentId}" not found` }
|
|
175
|
+
prepareSlotInsertion(graph, parentId, 'generate_svg')
|
|
173
176
|
const service = getImageAIService(graph)
|
|
174
177
|
if (!service) return { error: IMAGE_AI_UNAVAILABLE }
|
|
175
178
|
|
|
@@ -1,10 +1,14 @@
|
|
|
1
1
|
import * as v from 'valibot'
|
|
2
2
|
|
|
3
|
-
import { parseColor } from '@pairdraw/scene-graph/color'
|
|
4
|
-
|
|
5
3
|
import { DEFAULT_SHADOW_COLOR } from '#core/constants'
|
|
6
4
|
import type { FigmaEffect } from '#core/figma-api/effects'
|
|
7
|
-
import {
|
|
5
|
+
import {
|
|
6
|
+
defineTool,
|
|
7
|
+
nodeIdInputSchema,
|
|
8
|
+
nodeNotFound,
|
|
9
|
+
parseOptionalToolColor,
|
|
10
|
+
toolNumber
|
|
11
|
+
} from '#core/tools/schema'
|
|
8
12
|
|
|
9
13
|
export const setEffects = defineTool({
|
|
10
14
|
name: 'set_effects',
|
|
@@ -30,6 +34,9 @@ export const setEffects = defineTool({
|
|
|
30
34
|
execute: (figma, args) => {
|
|
31
35
|
const node = figma.getNodeById(args.id)
|
|
32
36
|
if (!node) return nodeNotFound(args.id)
|
|
37
|
+
const parsedColor = parseOptionalToolColor(args.color)
|
|
38
|
+
if ('error' in parsedColor) return parsedColor
|
|
39
|
+
const shadowColor = parsedColor.color ?? { ...DEFAULT_SHADOW_COLOR }
|
|
33
40
|
|
|
34
41
|
const effect: FigmaEffect =
|
|
35
42
|
args.type === 'FOREGROUND_BLUR' || args.type === 'BACKGROUND_BLUR'
|
|
@@ -41,7 +48,7 @@ export const setEffects = defineTool({
|
|
|
41
48
|
}
|
|
42
49
|
: {
|
|
43
50
|
type: args.type,
|
|
44
|
-
color:
|
|
51
|
+
color: shadowColor,
|
|
45
52
|
offset: { x: args.offset_x, y: args.offset_y },
|
|
46
53
|
radius: args.radius,
|
|
47
54
|
spread: args.spread,
|
|
@@ -2,7 +2,6 @@ import { mapValues, pick } from 'es-toolkit'
|
|
|
2
2
|
import * as v from 'valibot'
|
|
3
3
|
|
|
4
4
|
import type { Fill, NodeType, SceneNode } from '@pairdraw/scene-graph'
|
|
5
|
-
import { tryParseColor } from '@pairdraw/scene-graph/color'
|
|
6
5
|
import { copyStroke } from '@pairdraw/scene-graph/copy'
|
|
7
6
|
import type { Color } from '@pairdraw/scene-graph/primitives'
|
|
8
7
|
|
|
@@ -12,7 +11,7 @@ import { editNode } from '#core/figma-api/accessor-utils'
|
|
|
12
11
|
import type { FigmaFontNameInput } from '#core/figma-api/fonts/names'
|
|
13
12
|
import { getStyledTextSegments } from '#core/figma-api/text/style'
|
|
14
13
|
import { collectNodeFontFaces } from '#core/text/requirements/collect'
|
|
15
|
-
import { defineTool, toolFailure, toolNumber } from '#core/tools/schema'
|
|
14
|
+
import { defineTool, parseToolColor, toolFailure, toolNumber } from '#core/tools/schema'
|
|
16
15
|
|
|
17
16
|
import { textFonts } from './text'
|
|
18
17
|
|
|
@@ -84,6 +83,13 @@ function channels(color: Color): string {
|
|
|
84
83
|
return [color.r, color.g, color.b].map((value) => Math.round(value * 255)).join(',')
|
|
85
84
|
}
|
|
86
85
|
|
|
86
|
+
/** A colour as a tool reads it, so a bad value fails with the message other tools give. */
|
|
87
|
+
function colorOf(value: string): Color {
|
|
88
|
+
const parsed = parseToolColor(value)
|
|
89
|
+
if ('error' in parsed) throw new Error(parsed.error)
|
|
90
|
+
return parsed
|
|
91
|
+
}
|
|
92
|
+
|
|
87
93
|
interface ColorSwap {
|
|
88
94
|
match: (paint: Fill) => boolean
|
|
89
95
|
apply: (paint: Fill) => Fill
|
|
@@ -91,10 +97,8 @@ interface ColorSwap {
|
|
|
91
97
|
|
|
92
98
|
/** The swap a colour pair makes; throws on a value that is not a colour. */
|
|
93
99
|
function colorSwap(pair: ColorPair): ColorSwap {
|
|
94
|
-
const from =
|
|
95
|
-
const to =
|
|
96
|
-
if (!from) throw new Error(`"${pair.from}" is not a color`)
|
|
97
|
-
if (!to) throw new Error(`"${pair.to}" is not a color`)
|
|
100
|
+
const from = colorOf(pair.from)
|
|
101
|
+
const to = colorOf(pair.to)
|
|
98
102
|
const key = channels(from)
|
|
99
103
|
const percent = (value: number) => Math.round(value * 100)
|
|
100
104
|
return {
|
|
@@ -1,12 +1,17 @@
|
|
|
1
1
|
import { isValid, toUint8Array } from 'js-base64'
|
|
2
2
|
import * as v from 'valibot'
|
|
3
3
|
|
|
4
|
-
import { parseColor } from '@pairdraw/scene-graph/color'
|
|
5
4
|
import { gradientTransformRows, linearGradientTransform } from '@pairdraw/scene-graph/gradient'
|
|
6
5
|
import type { Vector } from '@pairdraw/scene-graph/primitives'
|
|
7
6
|
|
|
8
7
|
import { storeImage } from '#core/figma-api/images'
|
|
9
|
-
import {
|
|
8
|
+
import {
|
|
9
|
+
defineTool,
|
|
10
|
+
nodeIdInputSchema,
|
|
11
|
+
parseToolColor,
|
|
12
|
+
toolFailure,
|
|
13
|
+
toolNumber
|
|
14
|
+
} from '#core/tools/schema'
|
|
10
15
|
|
|
11
16
|
/**
|
|
12
17
|
* Stretch as Figma's API writes it: a crop whose window is the whole image, which the image fill
|
|
@@ -40,10 +45,12 @@ export const setFill = defineTool({
|
|
|
40
45
|
const node = figma.getNodeById(id)
|
|
41
46
|
if (!node) return { error: `Node "${id}" not found` }
|
|
42
47
|
|
|
43
|
-
const c =
|
|
48
|
+
const c = parseToolColor(color)
|
|
49
|
+
if ('error' in c) return c
|
|
44
50
|
|
|
45
51
|
if (gradient && color_end) {
|
|
46
|
-
const cEnd =
|
|
52
|
+
const cEnd = parseToolColor(color_end)
|
|
53
|
+
if ('error' in cEnd) return cEnd
|
|
47
54
|
// Edge middles of the layer's unit square that each direction runs between.
|
|
48
55
|
const ends: Record<string, [Vector, Vector]> = {
|
|
49
56
|
'top-bottom': [
|
|
@@ -104,7 +111,8 @@ export const setStroke = defineTool({
|
|
|
104
111
|
const node = figma.getNodeById(id)
|
|
105
112
|
if (!node) return { error: `Node "${id}" not found` }
|
|
106
113
|
|
|
107
|
-
const c =
|
|
114
|
+
const c = parseToolColor(color)
|
|
115
|
+
if ('error' in c) return c
|
|
108
116
|
node.strokes = [{ type: 'SOLID', color: c }]
|
|
109
117
|
node.strokeWeight = weight
|
|
110
118
|
node.strokeAlign = align
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import * as v from 'valibot'
|
|
2
|
+
|
|
3
|
+
import { figmaReactionsSchema } from '#core/figma-api/reactions'
|
|
4
|
+
import { defineTool, nodeIdInputSchema, nodeNotFound, toolFailure } from '#core/tools/schema'
|
|
5
|
+
|
|
6
|
+
/** Connections in Figma's plugin shape, which the layer's `reactions` reads and writes. */
|
|
7
|
+
const reactionsInputSchema = v.pipe(
|
|
8
|
+
figmaReactionsSchema,
|
|
9
|
+
v.description(
|
|
10
|
+
"Prototype connections in Figma's plugin shape: [{ trigger: { type: 'ON_CLICK' } | " +
|
|
11
|
+
"{ type: 'AFTER_TIMEOUT', timeout: seconds }, actions: [{ type: 'NODE', " +
|
|
12
|
+
"destinationId: '<top-level frame id on the same page>', navigation: 'NAVIGATE' | " +
|
|
13
|
+
"'OVERLAY', transition: { type: 'INSTANT' | 'DISSOLVE', duration: seconds }, " +
|
|
14
|
+
"overlayRelativePosition?: 'CENTER' | ... } | { type: 'BACK' } | { type: 'CLOSE' }] }]"
|
|
15
|
+
)
|
|
16
|
+
)
|
|
17
|
+
|
|
18
|
+
export const setReactions = defineTool({
|
|
19
|
+
name: 'set_reactions',
|
|
20
|
+
|
|
21
|
+
description:
|
|
22
|
+
'Replace the prototype connections on a layer. Use get_reactions to read them back, and ' +
|
|
23
|
+
'point a NODE action at a top-level frame on the same page. Refuses a trigger, action, ' +
|
|
24
|
+
'transition, navigation or destination the prototype play cannot run.',
|
|
25
|
+
execution: { kind: 'sync', mutation: 'properties' },
|
|
26
|
+
input: v.strictObject({
|
|
27
|
+
id: nodeIdInputSchema,
|
|
28
|
+
reactions: reactionsInputSchema
|
|
29
|
+
}),
|
|
30
|
+
execute: (figma, { id, reactions }) => {
|
|
31
|
+
const node = figma.getNodeById(id)
|
|
32
|
+
if (!node) return nodeNotFound(id)
|
|
33
|
+
try {
|
|
34
|
+
node.reactions = reactions
|
|
35
|
+
} catch (error) {
|
|
36
|
+
return toolFailure(error)
|
|
37
|
+
}
|
|
38
|
+
return { id, reactions: node.reactions }
|
|
39
|
+
}
|
|
40
|
+
})
|
package/src/tools/modify/text.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as v from 'valibot'
|
|
2
2
|
|
|
3
|
-
import {
|
|
3
|
+
import type { Color } from '@pairdraw/scene-graph/primitives'
|
|
4
4
|
|
|
5
5
|
import type { FigmaAPI, FigmaNodeProxy } from '#core/figma-api'
|
|
6
6
|
import type { FigmaFontName, FigmaFontNameInput } from '#core/figma-api/fonts/names'
|
|
@@ -9,6 +9,7 @@ import { PairdrawAPI } from '#core/pairdraw-api'
|
|
|
9
9
|
import { normalizeLinkURL } from '#core/text/hyperlink'
|
|
10
10
|
import { collectNodeFontFaces } from '#core/text/requirements/collect'
|
|
11
11
|
import {
|
|
12
|
+
parseOptionalToolColor,
|
|
12
13
|
toolNumber,
|
|
13
14
|
nodeIdInputSchema,
|
|
14
15
|
defineTool,
|
|
@@ -90,9 +91,11 @@ export const setText = defineTool({
|
|
|
90
91
|
})
|
|
91
92
|
|
|
92
93
|
/** Variable font axes a font tool can set, as Figma's `variationSettings`. */
|
|
94
|
+
// An object with a value for every key rather than a record: a record publishes `propertyNames`,
|
|
95
|
+
// which OpenAI refuses, and a JSON object's keys are strings anyway.
|
|
93
96
|
const variationsInputSchema = v.optional(
|
|
94
97
|
v.pipe(
|
|
95
|
-
v.
|
|
98
|
+
v.objectWithRest({}, v.number()),
|
|
96
99
|
v.description(
|
|
97
100
|
'Variable font axis values by OpenType tag (e.g. {"wght": 550, "wdth": 75}); axes left out keep the style\'s values. Without a style, the nearest named style is picked.'
|
|
98
101
|
)
|
|
@@ -162,6 +165,8 @@ export const setFont = defineTool({
|
|
|
162
165
|
execute: (figma, args) => {
|
|
163
166
|
const node = figma.getNodeById(args.id)
|
|
164
167
|
if (!node) return nodeNotFound(args.id)
|
|
168
|
+
const badTag = badVariationTag(args.variations)
|
|
169
|
+
if (badTag) return badTag
|
|
165
170
|
const font = requestedFont(node, args)
|
|
166
171
|
try {
|
|
167
172
|
if (font && 'whole' in font) node.fontName = font.whole
|
|
@@ -185,6 +190,46 @@ function rangeFont(
|
|
|
185
190
|
return fontNameInput(args, typeof current === 'symbol' ? null : current)
|
|
186
191
|
}
|
|
187
192
|
|
|
193
|
+
type RangeEdit = {
|
|
194
|
+
hyperlink: { link: { type: 'URL'; value: string } | null } | null
|
|
195
|
+
color: Color | undefined
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
/** Why a variation setting cannot apply: an axis tag is not four letters. */
|
|
199
|
+
function badVariationTag(variations: FigmaVariationSettings | undefined): { error: string } | null {
|
|
200
|
+
const tag = Object.keys(variations ?? {}).find((key) => key.length !== 4)
|
|
201
|
+
return tag === undefined ? null : { error: `"${tag}" is not a four-letter OpenType axis tag` }
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
/** What a range edit sets, or why it cannot run: nothing named, a bad colour, or a bad link. */
|
|
205
|
+
function rangeEdit(args: {
|
|
206
|
+
family?: string
|
|
207
|
+
size?: number
|
|
208
|
+
style?: string
|
|
209
|
+
variations?: unknown
|
|
210
|
+
color?: string
|
|
211
|
+
hyperlink?: string | null
|
|
212
|
+
}): RangeEdit | { error: string } {
|
|
213
|
+
if (
|
|
214
|
+
!args.family &&
|
|
215
|
+
!args.size &&
|
|
216
|
+
!args.style &&
|
|
217
|
+
!args.variations &&
|
|
218
|
+
!args.color &&
|
|
219
|
+
args.hyperlink === undefined
|
|
220
|
+
) {
|
|
221
|
+
return {
|
|
222
|
+
error:
|
|
223
|
+
'set_font_range needs at least one of family, size, style, variations, color, or hyperlink'
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
const hyperlink = requestedHyperlink(args.hyperlink)
|
|
227
|
+
if (hyperlink && 'error' in hyperlink) return hyperlink
|
|
228
|
+
const color = parseOptionalToolColor(args.color)
|
|
229
|
+
if ('error' in color) return color
|
|
230
|
+
return { hyperlink: hyperlink ?? null, color: color.color }
|
|
231
|
+
}
|
|
232
|
+
|
|
188
233
|
export const setFontRange = defineTool({
|
|
189
234
|
name: 'set_font_range',
|
|
190
235
|
|
|
@@ -213,30 +258,18 @@ export const setFontRange = defineTool({
|
|
|
213
258
|
const node = figma.getNodeById(args.id)
|
|
214
259
|
if (!node) return nodeNotFound(args.id)
|
|
215
260
|
const { start, end } = args
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
!args.color &&
|
|
222
|
-
args.hyperlink === undefined
|
|
223
|
-
) {
|
|
224
|
-
return {
|
|
225
|
-
error:
|
|
226
|
-
'set_font_range needs at least one of family, size, style, variations, color, or hyperlink'
|
|
227
|
-
}
|
|
228
|
-
}
|
|
229
|
-
const hyperlink = requestedHyperlink(args.hyperlink)
|
|
230
|
-
if (hyperlink && 'error' in hyperlink) return hyperlink
|
|
261
|
+
const badTag = badVariationTag(args.variations)
|
|
262
|
+
if (badTag) return badTag
|
|
263
|
+
const edit = rangeEdit(args)
|
|
264
|
+
if ('error' in edit) return edit
|
|
265
|
+
const { hyperlink, color } = edit
|
|
231
266
|
// The range methods reject an empty range or one past the text, before changing anything.
|
|
232
267
|
try {
|
|
233
268
|
if (args.size) node.setRangeFontSize(start, end, args.size)
|
|
234
269
|
if (args.family || args.style || args.variations) {
|
|
235
270
|
node.setRangeFontName(start, end, rangeFont(node, args))
|
|
236
271
|
}
|
|
237
|
-
if (
|
|
238
|
-
node.setRangeFills(start, end, [{ type: 'SOLID', color: parseColor(args.color) }])
|
|
239
|
-
}
|
|
272
|
+
if (color) node.setRangeFills(start, end, [{ type: 'SOLID', color }])
|
|
240
273
|
if (hyperlink) node.setRangeHyperlink(start, end, hyperlink.link)
|
|
241
274
|
} catch (error) {
|
|
242
275
|
return toolFailure(error)
|
package/src/tools/modify.ts
CHANGED
|
@@ -3,6 +3,7 @@ export { rescale, setMinMax, setOpacity, setRadius, setRotation } from './modify
|
|
|
3
3
|
export { setConstraints, setLayout, setLayoutChild } from './modify/layout'
|
|
4
4
|
export { replaceMatchingProperties } from './modify/matching'
|
|
5
5
|
export { setFill, setImageFill, setStroke } from './modify/paint'
|
|
6
|
+
export { setReactions } from './modify/reactions'
|
|
6
7
|
export { setBlend, setLocked, setStrokeAlign, setVisible } from './modify/state'
|
|
7
8
|
export { setFont, setFontRange, setText, setTextProperties, setTextResize } from './modify/text'
|
|
8
9
|
export { updateNode } from './modify/update'
|