@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
|
@@ -0,0 +1,212 @@
|
|
|
1
|
+
import * as v from 'valibot'
|
|
2
|
+
|
|
3
|
+
import { generateId } from '@pairdraw/scene-graph'
|
|
4
|
+
import type {
|
|
5
|
+
PrototypeAction,
|
|
6
|
+
PrototypeNavigationType,
|
|
7
|
+
PrototypeOverlayPositionType,
|
|
8
|
+
PrototypeReaction,
|
|
9
|
+
PrototypeTransitionType,
|
|
10
|
+
PrototypeTriggerType,
|
|
11
|
+
SceneGraph
|
|
12
|
+
} from '@pairdraw/scene-graph'
|
|
13
|
+
|
|
14
|
+
import { issuePath } from '#core/figma-api/effects'
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Triggers Figma's plugin API offers that a prototype in Pairdraw cannot start from, and the
|
|
18
|
+
* message it gets instead. Only a click and a timeout play.
|
|
19
|
+
*/
|
|
20
|
+
const UNSUPPORTED_TRIGGERS: Record<string, true> = {
|
|
21
|
+
ON_DRAG: true,
|
|
22
|
+
ON_HOVER: true,
|
|
23
|
+
ON_PRESS: true,
|
|
24
|
+
MOUSE_ENTER: true,
|
|
25
|
+
MOUSE_LEAVE: true,
|
|
26
|
+
MOUSE_UP: true,
|
|
27
|
+
MOUSE_DOWN: true,
|
|
28
|
+
ON_KEY_DOWN: true
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/** Actions Figma's plugin API offers that a prototype in Pairdraw cannot run. */
|
|
32
|
+
const UNSUPPORTED_ACTIONS: Record<string, true> = {
|
|
33
|
+
URL: true,
|
|
34
|
+
SET_VARIABLE: true,
|
|
35
|
+
CONDITIONAL: true,
|
|
36
|
+
SET_VARIABLE_MODE: true
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
// No `v.finite()` action: the MCP tool contract turns this schema into JSON Schema, which
|
|
40
|
+
// has no notion of infinities, and JSON numbers are always finite anyway.
|
|
41
|
+
const secondsSchema = v.pipe(v.number(), v.minValue(0))
|
|
42
|
+
|
|
43
|
+
const overlayPositionSchema = v.picklist([
|
|
44
|
+
'CENTER',
|
|
45
|
+
'TOP_LEFT',
|
|
46
|
+
'TOP_CENTER',
|
|
47
|
+
'TOP_RIGHT',
|
|
48
|
+
'BOTTOM_LEFT',
|
|
49
|
+
'BOTTOM_CENTER',
|
|
50
|
+
'BOTTOM_RIGHT'
|
|
51
|
+
] satisfies PrototypeOverlayPositionType[])
|
|
52
|
+
|
|
53
|
+
const transitionSchema = v.strictObject({
|
|
54
|
+
type: v.picklist(['INSTANT', 'DISSOLVE'] satisfies PrototypeTransitionType[]),
|
|
55
|
+
duration: secondsSchema
|
|
56
|
+
})
|
|
57
|
+
|
|
58
|
+
const nodeActionSchema = v.strictObject({
|
|
59
|
+
type: v.literal('NODE'),
|
|
60
|
+
destinationId: v.pipe(v.string(), v.minLength(1), v.description('Top-level frame on the page.')),
|
|
61
|
+
navigation: v.picklist(['NAVIGATE', 'OVERLAY'] satisfies PrototypeNavigationType[]),
|
|
62
|
+
transition: v.optional(transitionSchema, { type: 'INSTANT', duration: 0 }),
|
|
63
|
+
overlayRelativePosition: v.optional(overlayPositionSchema, 'CENTER')
|
|
64
|
+
})
|
|
65
|
+
|
|
66
|
+
const actionSchema = v.variant('type', [
|
|
67
|
+
nodeActionSchema,
|
|
68
|
+
v.strictObject({ type: v.literal('BACK') }),
|
|
69
|
+
v.strictObject({ type: v.literal('CLOSE') })
|
|
70
|
+
])
|
|
71
|
+
|
|
72
|
+
const triggerSchema = v.variant('type', [
|
|
73
|
+
v.strictObject({ type: v.literal('ON_CLICK') }),
|
|
74
|
+
v.strictObject({ type: v.literal('AFTER_TIMEOUT'), timeout: secondsSchema })
|
|
75
|
+
])
|
|
76
|
+
|
|
77
|
+
const reactionSchema = v.strictObject({
|
|
78
|
+
trigger: triggerSchema,
|
|
79
|
+
actions: v.pipe(v.array(actionSchema), v.minLength(1))
|
|
80
|
+
})
|
|
81
|
+
|
|
82
|
+
const reactionsSchema = v.array(reactionSchema)
|
|
83
|
+
|
|
84
|
+
/** The plugin shape as a contract, for a tool that takes connections as arguments. */
|
|
85
|
+
export const figmaReactionsSchema = reactionsSchema
|
|
86
|
+
|
|
87
|
+
/** A reaction as Figma's plugin API reads and writes it (`Reaction` in `@figma/plugin-typings`). */
|
|
88
|
+
export type FigmaReaction = v.InferOutput<typeof reactionSchema>
|
|
89
|
+
export type FigmaReactionTrigger = FigmaReaction['trigger']
|
|
90
|
+
export type FigmaReactionAction = FigmaReaction['actions'][number]
|
|
91
|
+
|
|
92
|
+
/** `reaction` in the plugin shape: the trigger and every action, named as Figma names them. */
|
|
93
|
+
export function toFigmaReaction(reaction: PrototypeReaction): FigmaReaction {
|
|
94
|
+
const trigger: FigmaReactionTrigger =
|
|
95
|
+
reaction.trigger.type === 'AFTER_TIMEOUT'
|
|
96
|
+
? { type: 'AFTER_TIMEOUT', timeout: reaction.trigger.delay }
|
|
97
|
+
: { type: 'ON_CLICK' }
|
|
98
|
+
return { trigger, actions: reaction.actions.map(toFigmaAction) }
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
function toFigmaAction(action: PrototypeAction): FigmaReactionAction {
|
|
102
|
+
if (action.type !== 'NODE') return { type: action.type }
|
|
103
|
+
return {
|
|
104
|
+
type: 'NODE',
|
|
105
|
+
destinationId: action.nodeId ?? '',
|
|
106
|
+
navigation: action.navigation,
|
|
107
|
+
transition: { type: action.transition.type, duration: action.transition.duration },
|
|
108
|
+
overlayRelativePosition: action.overlayPosition
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
/** The validation context: where the reactions live, and what they may point at. */
|
|
113
|
+
export interface ReactionContext {
|
|
114
|
+
graph: SceneGraph
|
|
115
|
+
/** The page the layer is on; a destination must be a top-level frame on it. */
|
|
116
|
+
pageId: string
|
|
117
|
+
/** The reactions the layer has now, whose ids this keeps by position. */
|
|
118
|
+
previous?: readonly PrototypeReaction[]
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
/**
|
|
122
|
+
* `value` as the layer's prototype reactions, or an error naming what Pairdraw cannot play.
|
|
123
|
+
* Accepts Figma's plugin shape only: a trigger Figma offers but playback does not start from,
|
|
124
|
+
* an action, transition, navigation or overlay spot outside the model, and a destination that
|
|
125
|
+
* is not a top-level frame on the layer's page are refused rather than kept unplayable.
|
|
126
|
+
*/
|
|
127
|
+
export function parseFigmaReactions(value: unknown, context: ReactionContext): PrototypeReaction[] {
|
|
128
|
+
const unsupported = unsupportedKind(value)
|
|
129
|
+
if (unsupported) throw new Error(`Property "reactions" failed validation: ${unsupported}`)
|
|
130
|
+
const result = v.safeParse(reactionsSchema, value)
|
|
131
|
+
if (!result.success) {
|
|
132
|
+
const [issue] = result.issues
|
|
133
|
+
throw new Error(
|
|
134
|
+
`Property "reactions" failed validation: ${issue.message} at ${issuePath(issue.path) || 'reactions'}`
|
|
135
|
+
)
|
|
136
|
+
}
|
|
137
|
+
return result.output.map((reaction, index) => {
|
|
138
|
+
const id = context.previous?.[index]?.id ?? generateId()
|
|
139
|
+
return {
|
|
140
|
+
id,
|
|
141
|
+
trigger: toTrigger(reaction.trigger),
|
|
142
|
+
actions: reaction.actions.map((action) => toAction(action, context, index))
|
|
143
|
+
}
|
|
144
|
+
})
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
function toTrigger(trigger: FigmaReactionTrigger): PrototypeReaction['trigger'] {
|
|
148
|
+
const type: PrototypeTriggerType = trigger.type
|
|
149
|
+
return { type, delay: trigger.type === 'AFTER_TIMEOUT' ? trigger.timeout : 0 }
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
function toAction(
|
|
153
|
+
action: FigmaReactionAction,
|
|
154
|
+
context: ReactionContext,
|
|
155
|
+
reactionIndex: number
|
|
156
|
+
): PrototypeAction {
|
|
157
|
+
if (action.type !== 'NODE') return { type: action.type }
|
|
158
|
+
assertDestination(action.destinationId, context, reactionIndex)
|
|
159
|
+
return {
|
|
160
|
+
type: 'NODE',
|
|
161
|
+
nodeId: action.destinationId,
|
|
162
|
+
navigation: action.navigation,
|
|
163
|
+
transition: action.transition,
|
|
164
|
+
// Only an overlay uses the spot; Figma keeps CENTER on a navigation.
|
|
165
|
+
overlayPosition: action.navigation === 'OVERLAY' ? action.overlayRelativePosition : 'CENTER'
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
/** A destination must be a frame at the top of the layer's page, as the play can only show one. */
|
|
170
|
+
function assertDestination(destinationId: string, context: ReactionContext, index: number): void {
|
|
171
|
+
const destination = context.graph.getNode(destinationId)
|
|
172
|
+
const at = `reactions[${index}]`
|
|
173
|
+
if (!destination) {
|
|
174
|
+
throw new Error(
|
|
175
|
+
`Property "reactions" failed validation: no layer ${destinationId} at ${at}.actions[0].destinationId`
|
|
176
|
+
)
|
|
177
|
+
}
|
|
178
|
+
if (destination.type !== 'FRAME' || destination.parentId !== context.pageId) {
|
|
179
|
+
throw new Error(
|
|
180
|
+
`Property "reactions" failed validation: ${at} must navigate to a top-level frame on the same page, not ${destination.type} "${destination.name}"`
|
|
181
|
+
)
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
/** Figma's first unsupported trigger or action kind in `value`, if it has one. */
|
|
186
|
+
function unsupportedKind(value: unknown): string | null {
|
|
187
|
+
if (!Array.isArray(value)) return null
|
|
188
|
+
const reactions = value.filter(
|
|
189
|
+
(reaction): reaction is Record<string, unknown> =>
|
|
190
|
+
Boolean(reaction) && typeof reaction === 'object'
|
|
191
|
+
)
|
|
192
|
+
for (const reaction of reactions) {
|
|
193
|
+
const trigger = reaction.trigger
|
|
194
|
+
if (trigger && typeof trigger === 'object' && 'type' in trigger) {
|
|
195
|
+
const type = trigger.type
|
|
196
|
+
if (typeof type === 'string' && type in UNSUPPORTED_TRIGGERS) {
|
|
197
|
+
return `a prototype starts from ON_CLICK or AFTER_TIMEOUT, not ${type}`
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
const actions = reaction.actions
|
|
201
|
+
if (!Array.isArray(actions)) continue
|
|
202
|
+
for (const action of actions) {
|
|
203
|
+
if (action && typeof action === 'object' && 'type' in action) {
|
|
204
|
+
const type = action.type
|
|
205
|
+
if (typeof type === 'string' && type in UNSUPPORTED_ACTIONS) {
|
|
206
|
+
return `an action is NODE, BACK or CLOSE, not ${type}`
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
return null
|
|
212
|
+
}
|
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
} from '@pairdraw/scene-graph/geometry'
|
|
10
10
|
import Matrix from '@pairdraw/scene-graph/matrix'
|
|
11
11
|
import type { Rect, Vector } from '@pairdraw/scene-graph/primitives'
|
|
12
|
-
import {
|
|
12
|
+
import { textLinesReach } from '@pairdraw/scene-graph/text'
|
|
13
13
|
|
|
14
14
|
const INTRINSIC_CONTAINER_TYPES = new Set([
|
|
15
15
|
'FRAME',
|
|
@@ -87,8 +87,15 @@ function ownRenderBounds(node: SceneNode, graph: SceneGraph): VisualBounds | nul
|
|
|
87
87
|
if (!hasRenderableGeometry(node)) return null
|
|
88
88
|
|
|
89
89
|
// Text lines past a fixed-size box draw, and cast their shadow, as in Figma.
|
|
90
|
-
const
|
|
91
|
-
const base = transformedRect(
|
|
90
|
+
const linesReach = textLinesReach(node)
|
|
91
|
+
const base = transformedRect(
|
|
92
|
+
node,
|
|
93
|
+
graph,
|
|
94
|
+
0,
|
|
95
|
+
linesReach.minY,
|
|
96
|
+
node.width,
|
|
97
|
+
linesReach.maxY - linesReach.minY
|
|
98
|
+
)
|
|
92
99
|
const stroke = strokeOverflow(node.strokes, node.strokeCap, node.vectorNetwork, node)
|
|
93
100
|
let bounds = transformedRect(
|
|
94
101
|
node,
|
|
@@ -114,7 +121,9 @@ function ownRenderBounds(node: SceneNode, graph: SceneGraph): VisualBounds | nul
|
|
|
114
121
|
) ?? bounds
|
|
115
122
|
}
|
|
116
123
|
|
|
117
|
-
if (
|
|
124
|
+
if (linesReach.minY < 0 || linesReach.maxY > node.height) {
|
|
125
|
+
bounds = unionVisualBounds(bounds, base) ?? bounds
|
|
126
|
+
}
|
|
118
127
|
|
|
119
128
|
for (const effect of node.effects) {
|
|
120
129
|
if (!effect.visible) continue
|
|
@@ -54,10 +54,13 @@ export function nodeProxyToJSON(
|
|
|
54
54
|
width: n.width,
|
|
55
55
|
height: n.height
|
|
56
56
|
}
|
|
57
|
-
if (n.fills.length > 0) obj.fills = figmaFills(
|
|
58
|
-
if (n.strokes.length > 0) obj.strokes = figmaStrokes(
|
|
57
|
+
if (n.fills.length > 0) obj.fills = figmaFills(n)
|
|
58
|
+
if (n.strokes.length > 0) obj.strokes = figmaStrokes(n)
|
|
59
59
|
if (n.effects.length > 0) obj.effects = n.effects
|
|
60
60
|
if (n.opacity !== 1) obj.opacity = n.opacity
|
|
61
|
+
// The angle `set_rotation` writes, as the Figma API reports it. The scene stores the turn in
|
|
62
|
+
// the opposite direction and keeps floating-point noise, so read it through the proxy.
|
|
63
|
+
if (n.rotation !== 0) obj.rotation = api.wrapNode(nodeId).rotation
|
|
61
64
|
if (n.cornerRadius > 0) obj.cornerRadius = n.cornerRadius
|
|
62
65
|
if (!n.visible) obj.visible = false
|
|
63
66
|
if (n.text) obj.characters = n.text
|
|
@@ -65,9 +68,20 @@ export function nodeProxyToJSON(
|
|
|
65
68
|
appendTextProps(obj, n)
|
|
66
69
|
}
|
|
67
70
|
if (n.layoutMode !== 'NONE') {
|
|
71
|
+
// An auto layout frame reports the insets and alignment a tool sets, so a caller can read back
|
|
72
|
+
// what it wrote instead of measuring the result.
|
|
73
|
+
const proxy = api.wrapNode(nodeId)
|
|
68
74
|
obj.layoutMode = n.layoutMode
|
|
69
75
|
obj.layoutDirection = n.layoutDirection
|
|
70
76
|
obj.itemSpacing = n.itemSpacing
|
|
77
|
+
obj.paddingTop = proxy.paddingTop
|
|
78
|
+
obj.paddingRight = proxy.paddingRight
|
|
79
|
+
obj.paddingBottom = proxy.paddingBottom
|
|
80
|
+
obj.paddingLeft = proxy.paddingLeft
|
|
81
|
+
obj.primaryAxisAlignItems = proxy.primaryAxisAlignItems
|
|
82
|
+
obj.counterAxisAlignItems = proxy.counterAxisAlignItems
|
|
83
|
+
obj.primaryAxisSizingMode = proxy.primaryAxisSizingMode
|
|
84
|
+
obj.counterAxisSizingMode = proxy.counterAxisSizingMode
|
|
71
85
|
}
|
|
72
86
|
// Include variable bindings with resolved values
|
|
73
87
|
const bindings = resolveBindings(graph, n)
|
package/src/figma-api/slots.ts
CHANGED
|
@@ -76,15 +76,24 @@ export function prepareSlotMove(
|
|
|
76
76
|
childId: string,
|
|
77
77
|
method: 'appendChild' | 'insertChild'
|
|
78
78
|
): void {
|
|
79
|
+
const sourceParentId = g.getNode(childId)?.parentId
|
|
80
|
+
const source = sourceParentId ? slotScope(g, sourceParentId) : undefined
|
|
81
|
+
prepareSlotInsertion(g, parentId, method)
|
|
82
|
+
if (source?.kind === 'slot') claimSlotContent(g, source)
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
/**
|
|
86
|
+
* Ready adding new layers under `parentId`, as a tool that builds layers in place does, by the
|
|
87
|
+
* rule appendChild follows: the locked part of an instance refuses them, since its layers come
|
|
88
|
+
* from the component, and a slot's content becomes the instance's own first.
|
|
89
|
+
*/
|
|
90
|
+
export function prepareSlotInsertion(g: SceneGraph, parentId: string, method: string): void {
|
|
79
91
|
const target = slotScope(g, parentId)
|
|
80
92
|
if (target.kind === 'locked')
|
|
81
93
|
throw new Error(
|
|
82
94
|
`in ${method}: Cannot move node. New parent is an instance or is inside of an instance`
|
|
83
95
|
)
|
|
84
|
-
const sourceParentId = g.getNode(childId)?.parentId
|
|
85
|
-
const source = sourceParentId ? slotScope(g, sourceParentId) : undefined
|
|
86
96
|
if (target.kind === 'slot') claimSlotContent(g, target)
|
|
87
|
-
if (source?.kind === 'slot') claimSlotContent(g, source)
|
|
88
97
|
}
|
|
89
98
|
|
|
90
99
|
/**
|
package/src/figma-api/strokes.ts
CHANGED
|
@@ -1,26 +1,30 @@
|
|
|
1
1
|
import type { SceneGraph, SceneNode, Stroke } from '@pairdraw/scene-graph'
|
|
2
|
-
import { copyStroke } from '@pairdraw/scene-graph/copy'
|
|
3
2
|
import { recordInstanceOverride } from '@pairdraw/scene-graph/instances'
|
|
4
3
|
|
|
5
4
|
/**
|
|
6
5
|
* Sets the weight of all of a node's strokes and the weight it keeps with none, as Figma's
|
|
7
|
-
* node-level `strokeWeight` does;
|
|
6
|
+
* node-level `strokeWeight` does; the graph gives the strokes the layer's value
|
|
7
|
+
* (`strokeLineChanges`).
|
|
8
8
|
*/
|
|
9
9
|
export function setStrokeWeight(graph: SceneGraph, node: SceneNode, weight: number): void {
|
|
10
|
-
graph.updateNode(node.id, {
|
|
11
|
-
|
|
12
|
-
strokes: node.strokes.map((stroke) => ({ ...copyStroke(stroke), weight }))
|
|
13
|
-
})
|
|
14
|
-
recordInstanceOverride(graph, node.id, ['strokes', 'strokeWeight'])
|
|
10
|
+
graph.updateNode(node.id, { strokeWeight: weight })
|
|
11
|
+
recordInstanceOverride(graph, node.id, ['strokeWeight'])
|
|
15
12
|
}
|
|
16
13
|
|
|
17
14
|
/** Sets the alignment of all of a node's strokes and the one it keeps with none. */
|
|
18
15
|
export function setStrokeAlign(graph: SceneGraph, node: SceneNode, align: Stroke['align']): void {
|
|
19
|
-
graph.updateNode(node.id, {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
16
|
+
graph.updateNode(node.id, { strokeAlign: align })
|
|
17
|
+
recordInstanceOverride(graph, node.id, ['strokeAlign'])
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
/** Dashes the layer and every stroke on it. */
|
|
21
|
+
export function setDashPattern(
|
|
22
|
+
graph: SceneGraph,
|
|
23
|
+
node: SceneNode,
|
|
24
|
+
pattern: readonly number[]
|
|
25
|
+
): void {
|
|
26
|
+
graph.updateNode(node.id, { dashPattern: [...pattern] })
|
|
27
|
+
recordInstanceOverride(graph, node.id, ['dashPattern'])
|
|
24
28
|
}
|
|
25
29
|
|
|
26
30
|
export function setIndependentStrokeWeight(
|
|
@@ -27,7 +27,13 @@ import {
|
|
|
27
27
|
|
|
28
28
|
import { invalid, received } from '#core/figma-api/accessors/text/messages'
|
|
29
29
|
import { assertTextFontsLoaded } from '#core/figma-api/fonts/loaded'
|
|
30
|
-
import {
|
|
30
|
+
import {
|
|
31
|
+
adjustRunsForDelete,
|
|
32
|
+
getStyleAt,
|
|
33
|
+
insertedStyleAt,
|
|
34
|
+
insertRunsWithStyle,
|
|
35
|
+
type InsertStyleSource
|
|
36
|
+
} from '#core/text/style-runs'
|
|
31
37
|
|
|
32
38
|
import { assertTextRange } from './style'
|
|
33
39
|
|
|
@@ -93,22 +99,10 @@ export function letterSpacingValue(value: unknown): TextLength {
|
|
|
93
99
|
return { unit: length.unit as TextLength['unit'], value: length.value as number }
|
|
94
100
|
}
|
|
95
101
|
|
|
96
|
-
|
|
97
|
-
export type InsertStyleSource = 'BEFORE' | 'AFTER'
|
|
102
|
+
export type { InsertStyleSource }
|
|
98
103
|
|
|
99
104
|
const INSERT_STYLE_SOURCES: ReadonlySet<string> = new Set(['BEFORE', 'AFTER'])
|
|
100
105
|
|
|
101
|
-
/**
|
|
102
|
-
* The style inserted characters take, as Figma gives it: the preceding character's for `BEFORE`
|
|
103
|
-
* and the following one's for `AFTER`, or the closest character's at either end of the text.
|
|
104
|
-
*/
|
|
105
|
-
function insertedStyle(node: SceneNode, start: number, useStyle: InsertStyleSource) {
|
|
106
|
-
if (node.text.length === 0) return {}
|
|
107
|
-
const preferred = useStyle === 'BEFORE' ? start - 1 : start
|
|
108
|
-
const index = Math.min(Math.max(preferred, 0), node.text.length - 1)
|
|
109
|
-
return getStyleAt(node.styleRuns, index)
|
|
110
|
-
}
|
|
111
|
-
|
|
112
106
|
/**
|
|
113
107
|
* A text's style runs once its characters are replaced. Figma resets the styles applied to
|
|
114
108
|
* character ranges, so the whole text keeps the style of its first character.
|
|
@@ -148,7 +142,7 @@ export function insertCharacters(
|
|
|
148
142
|
node.styleRuns,
|
|
149
143
|
start,
|
|
150
144
|
characters.length,
|
|
151
|
-
|
|
145
|
+
insertedStyleAt(node.styleRuns, node.text.length, start, useStyle)
|
|
152
146
|
)
|
|
153
147
|
graph.updateNode(node.id, { text, textParagraphs, styleRuns })
|
|
154
148
|
recordInstanceOverride(graph, node.id, ['text', 'textParagraphs', 'styleRuns'])
|
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
type VariableType,
|
|
11
11
|
type VariableValue
|
|
12
12
|
} from '@pairdraw/scene-graph'
|
|
13
|
-
import { updateTokenExpression } from '@pairdraw/scene-graph/variables'
|
|
13
|
+
import { modesInListedOrder, updateTokenExpression } from '@pairdraw/scene-graph/variables'
|
|
14
14
|
|
|
15
15
|
import { reconcileVariableLayouts } from '#core/layout/variables'
|
|
16
16
|
|
|
@@ -232,7 +232,8 @@ export class FigmaVariableCollection {
|
|
|
232
232
|
}
|
|
233
233
|
|
|
234
234
|
get modes(): Array<{ modeId: string; name: string }> {
|
|
235
|
-
|
|
235
|
+
// Figma lists a collection's modes by sort position, not by their saved array order.
|
|
236
|
+
return modesInListedOrder(this.#collection).map(({ modeId, name }) => ({ modeId, name }))
|
|
236
237
|
}
|
|
237
238
|
|
|
238
239
|
get defaultModeId(): string {
|
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
import Matrix from '@pairdraw/scene-graph/matrix'
|
|
9
9
|
import type { Rect, Vector } from '@pairdraw/scene-graph/primitives'
|
|
10
10
|
|
|
11
|
-
import { createSceneGeometry } from './scene'
|
|
11
|
+
import { createSceneGeometry, nodeScreenBounds } from './scene'
|
|
12
12
|
import type { RotationPreview, ViewportTransform } from './types'
|
|
13
13
|
|
|
14
14
|
/** Where a connector's line starts and ends on screen, where its end handles sit. */
|
|
@@ -88,15 +88,5 @@ export function connectorScreenLabel(
|
|
|
88
88
|
): Rect | null {
|
|
89
89
|
const parts = connectorSublayers(graph, connector)
|
|
90
90
|
if (!parts || parts.label.text === '' || !parts.labelBackground.visible) return null
|
|
91
|
-
|
|
92
|
-
const [x0, y0, x1, y1] = Matrix.mapPoints(
|
|
93
|
-
createSceneGeometry(graph, preview).screenMatrix(plate, viewport),
|
|
94
|
-
[0, 0, plate.width, plate.height]
|
|
95
|
-
)
|
|
96
|
-
return {
|
|
97
|
-
x: Math.min(x0, x1),
|
|
98
|
-
y: Math.min(y0, y1),
|
|
99
|
-
width: Math.abs(x1 - x0),
|
|
100
|
-
height: Math.abs(y1 - y0)
|
|
101
|
-
}
|
|
91
|
+
return nodeScreenBounds(graph, parts.labelBackground, viewport, preview)
|
|
102
92
|
}
|
package/src/geometry/figma.ts
CHANGED
|
@@ -4,6 +4,15 @@ import Matrix, { type Mat3 } from '@pairdraw/scene-graph/matrix'
|
|
|
4
4
|
import { FITTED_CONTAINER_TYPES } from '@pairdraw/scene-graph/node-defaults'
|
|
5
5
|
import type { Vector } from '@pairdraw/scene-graph/primitives'
|
|
6
6
|
|
|
7
|
+
/**
|
|
8
|
+
* A number as Figma's Design panel and size label show it: rounded to two decimals, so 33.333
|
|
9
|
+
* reads 33.33 and 0.126 reads 0.13. The layer keeps its exact value.
|
|
10
|
+
*/
|
|
11
|
+
export function panelNumber(value: number): number {
|
|
12
|
+
// A small negative value rounds to -0, which reads as 0.
|
|
13
|
+
return Math.round(value * 100) / 100 + 0
|
|
14
|
+
}
|
|
15
|
+
|
|
7
16
|
/**
|
|
8
17
|
* Figma's rotation of a transform: counterclockwise degrees in (-180, 180]. The plugin API and the
|
|
9
18
|
* properties panel both report it; our nodes store a clockwise angle about their center.
|
package/src/geometry/index.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export {
|
|
2
2
|
figmaRotation,
|
|
3
|
+
panelNumber,
|
|
3
4
|
panelPosition,
|
|
4
5
|
panelPositionChange,
|
|
5
6
|
panelRotation,
|
|
@@ -98,4 +99,4 @@ export {
|
|
|
98
99
|
} from './transform-zones'
|
|
99
100
|
export type { CornerPosition, HandlePosition, TransformZone } from './transform-zones'
|
|
100
101
|
export type { RotationHandleLayout } from './selection'
|
|
101
|
-
export type { RotationPreview, ViewportTransform } from './types'
|
|
102
|
+
export type { LineSegment, RotationPreview, ViewportTransform } from './types'
|
package/src/geometry/scene.ts
CHANGED
|
@@ -27,6 +27,25 @@ export function viewportMatrix(viewport: ViewportTransform) {
|
|
|
27
27
|
)
|
|
28
28
|
}
|
|
29
29
|
|
|
30
|
+
/** A node's axis-aligned box on screen, around its corners as drawn. */
|
|
31
|
+
export function nodeScreenBounds(
|
|
32
|
+
graph: SceneGraph,
|
|
33
|
+
node: SceneNode,
|
|
34
|
+
viewport: ViewportTransform,
|
|
35
|
+
preview?: RotationPreview | null
|
|
36
|
+
): Rect {
|
|
37
|
+
const [x0, y0, x1, y1] = Matrix.mapPoints(
|
|
38
|
+
createSceneGeometry(graph, preview).screenMatrix(node, viewport),
|
|
39
|
+
[0, 0, node.width, node.height]
|
|
40
|
+
)
|
|
41
|
+
return {
|
|
42
|
+
x: Math.min(x0, x1),
|
|
43
|
+
y: Math.min(y0, y1),
|
|
44
|
+
width: Math.abs(x1 - x0),
|
|
45
|
+
height: Math.abs(y1 - y0)
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
|
|
30
49
|
/** A read-only view for one draw or input operation. Recreate when the preview changes. */
|
|
31
50
|
export function createSceneGeometry(graph: SceneGraph, preview?: RotationPreview | null) {
|
|
32
51
|
const node = (source: SceneNode) => projectedNode(source, preview)
|
package/src/geometry/types.ts
CHANGED
package/src/global.d.ts
CHANGED
|
@@ -14,3 +14,9 @@ declare module '*?raw' {
|
|
|
14
14
|
const content: string
|
|
15
15
|
export default content
|
|
16
16
|
}
|
|
17
|
+
|
|
18
|
+
/** opencc-js types its converters only; a dictionary module is `key value…` entries joined by `|`. */
|
|
19
|
+
declare module 'opencc-js/dict/TSCharacters' {
|
|
20
|
+
const entries: string
|
|
21
|
+
export default entries
|
|
22
|
+
}
|
package/src/icons/api.ts
CHANGED
|
@@ -2,8 +2,8 @@ import { uniq } from 'es-toolkit'
|
|
|
2
2
|
import { createFetch } from 'ofetch'
|
|
3
3
|
import * as v from 'valibot'
|
|
4
4
|
|
|
5
|
-
import { collectionListSchema, collectionsSchema } from './schema'
|
|
6
|
-
import type { IconCollection,
|
|
5
|
+
import { collectionListSchema, collectionsSchema, iconSetSchema, type IconSet } from './schema'
|
|
6
|
+
import type { IconCollection, IconSearchResult } from './types'
|
|
7
7
|
|
|
8
8
|
const ICONIFY_API = 'https://api.iconify.design'
|
|
9
9
|
const FETCH_TIMEOUT_MS = 10_000
|
|
@@ -18,32 +18,40 @@ export function createIconifyAPIClient(
|
|
|
18
18
|
timeout: FETCH_TIMEOUT_MS
|
|
19
19
|
})
|
|
20
20
|
|
|
21
|
-
/**
|
|
22
|
-
|
|
21
|
+
/**
|
|
22
|
+
* A response body as text, so callers validate what the API sent rather than trust it. A failure
|
|
23
|
+
* names `what` failed, which for a set is its prefix, the name a caller knows the set by.
|
|
24
|
+
*/
|
|
25
|
+
async function text(
|
|
26
|
+
path: string,
|
|
27
|
+
query: Record<string, string> | undefined,
|
|
28
|
+
what: string
|
|
29
|
+
): Promise<string> {
|
|
23
30
|
const response = await iconifyAPI.raw<string, 'text'>(path, {
|
|
24
31
|
ignoreResponseError: true,
|
|
25
32
|
responseType: 'text',
|
|
26
33
|
query
|
|
27
34
|
})
|
|
28
|
-
if (!response.ok) throw new Error(`Iconify API error: ${response.status} for ${
|
|
35
|
+
if (!response.ok) throw new Error(`Iconify API error: ${response.status} for ${what}`)
|
|
29
36
|
return response._data ?? ''
|
|
30
37
|
}
|
|
31
38
|
|
|
32
39
|
return {
|
|
33
|
-
async fetchCollection(prefix: string, iconNames: string[]): Promise<
|
|
34
|
-
const
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
if (!
|
|
39
|
-
|
|
40
|
-
}
|
|
41
|
-
return response._data as IconifyResponse
|
|
40
|
+
async fetchCollection(prefix: string, iconNames: string[]): Promise<IconSet> {
|
|
41
|
+
const parsed = v.safeParse(
|
|
42
|
+
iconSetSchema,
|
|
43
|
+
await text(`/${prefix}.json`, { icons: iconNames.join(',') }, `prefix "${prefix}"`)
|
|
44
|
+
)
|
|
45
|
+
if (!parsed.success) throw new Error(`Iconify API returned unexpected icons for "${prefix}"`)
|
|
46
|
+
return parsed.output
|
|
42
47
|
},
|
|
43
48
|
|
|
44
49
|
/** Every icon set the API serves, retired ones left out. */
|
|
45
50
|
async collections(): Promise<IconCollection[]> {
|
|
46
|
-
const parsed = v.safeParse(
|
|
51
|
+
const parsed = v.safeParse(
|
|
52
|
+
collectionsSchema,
|
|
53
|
+
await text('/collections', undefined, 'the icon set list')
|
|
54
|
+
)
|
|
47
55
|
if (!parsed.success) throw new Error('Iconify API returned an unexpected set list')
|
|
48
56
|
return Object.entries(parsed.output)
|
|
49
57
|
.filter(([, info]) => !info.hidden)
|
|
@@ -59,7 +67,10 @@ export function createIconifyAPIClient(
|
|
|
59
67
|
|
|
60
68
|
/** Every icon in the set `prefix`, as `prefix:name`, in the set's own order. */
|
|
61
69
|
async collectionIcons(prefix: string): Promise<string[]> {
|
|
62
|
-
const parsed = v.safeParse(
|
|
70
|
+
const parsed = v.safeParse(
|
|
71
|
+
collectionListSchema,
|
|
72
|
+
await text('/collection', { prefix }, `prefix "${prefix}"`)
|
|
73
|
+
)
|
|
63
74
|
if (!parsed.success)
|
|
64
75
|
throw new Error(`Iconify API returned an unexpected list for "${prefix}"`)
|
|
65
76
|
const { uncategorized = [], categories = {} } = parsed.output
|