@pairdraw/core 0.21.1 → 0.22.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/boolean.d.ts +6 -1
- package/dist/canvas/boolean.d.ts.map +1 -1
- package/dist/canvas/boolean.js +10 -2
- package/dist/canvas/boolean.js.map +1 -1
- package/dist/canvas/color-space.d.ts +45 -0
- package/dist/canvas/color-space.d.ts.map +1 -0
- package/dist/canvas/color-space.js +39 -0
- package/dist/canvas/color-space.js.map +1 -0
- package/dist/canvas/fills.d.ts +10 -10
- package/dist/canvas/fills.d.ts.map +1 -1
- package/dist/canvas/fills.js +116 -62
- package/dist/canvas/fills.js.map +1 -1
- package/dist/canvas/flatten.d.ts +11 -3
- package/dist/canvas/flatten.d.ts.map +1 -1
- package/dist/canvas/flatten.js +62 -4
- package/dist/canvas/flatten.js.map +1 -1
- package/dist/canvas/images/previews.d.ts +1 -1
- package/dist/canvas/index.d.ts +2 -1
- package/dist/canvas/index.js +2 -1
- package/dist/canvas/layout-grids.d.ts +5 -2
- package/dist/canvas/layout-grids.d.ts.map +1 -1
- package/dist/canvas/layout-grids.js +7 -2
- package/dist/canvas/layout-grids.js.map +1 -1
- package/dist/canvas/noise/render.d.ts +17 -4
- package/dist/canvas/noise/render.d.ts.map +1 -1
- package/dist/canvas/noise/render.js +21 -6
- package/dist/canvas/noise/render.js.map +1 -1
- package/dist/canvas/noise/shader.d.ts +4 -4
- package/dist/canvas/noise/shader.d.ts.map +1 -1
- package/dist/canvas/noise/shader.js +5 -6
- package/dist/canvas/noise/shader.js.map +1 -1
- package/dist/canvas/overlays/annotations.d.ts +19 -0
- package/dist/canvas/overlays/annotations.d.ts.map +1 -0
- package/dist/canvas/overlays/annotations.js +110 -0
- package/dist/canvas/overlays/annotations.js.map +1 -0
- package/dist/canvas/overlays/auto-layout-hover.d.ts +11 -1
- package/dist/canvas/overlays/auto-layout-hover.d.ts.map +1 -1
- package/dist/canvas/overlays/auto-layout-hover.js +25 -1
- package/dist/canvas/overlays/auto-layout-hover.js.map +1 -1
- package/dist/canvas/overlays/feedback.js +1 -1
- package/dist/canvas/overlays/feedback.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/measurement.d.ts +7 -1
- package/dist/canvas/overlays/measurement.d.ts.map +1 -1
- package/dist/canvas/overlays/measurement.js +42 -4
- package/dist/canvas/overlays/measurement.js.map +1 -1
- package/dist/canvas/overlays/presence.d.ts.map +1 -1
- package/dist/canvas/overlays/presence.js +21 -24
- package/dist/canvas/overlays/presence.js.map +1 -1
- package/dist/canvas/renderer/colors.d.ts +7 -1
- package/dist/canvas/renderer/colors.d.ts.map +1 -1
- package/dist/canvas/renderer/colors.js +9 -1
- package/dist/canvas/renderer/colors.js.map +1 -1
- package/dist/canvas/renderer/document-surface.d.ts +15 -6
- package/dist/canvas/renderer/document-surface.d.ts.map +1 -1
- package/dist/canvas/renderer/document-surface.js +1 -0
- package/dist/canvas/renderer/document-surface.js.map +1 -1
- package/dist/canvas/renderer/lifecycle.d.ts.map +1 -1
- package/dist/canvas/renderer/lifecycle.js +2 -2
- package/dist/canvas/renderer/lifecycle.js.map +1 -1
- package/dist/canvas/renderer/methods.d.ts +1 -0
- package/dist/canvas/renderer/methods.d.ts.map +1 -1
- package/dist/canvas/renderer/methods.js +4 -1
- package/dist/canvas/renderer/methods.js.map +1 -1
- package/dist/canvas/renderer/overlay-pass.d.ts.map +1 -1
- package/dist/canvas/renderer/overlay-pass.js +6 -1
- package/dist/canvas/renderer/overlay-pass.js.map +1 -1
- package/dist/canvas/renderer/pipeline.d.ts.map +1 -1
- package/dist/canvas/renderer/pipeline.js +7 -0
- package/dist/canvas/renderer/pipeline.js.map +1 -1
- package/dist/canvas/renderer/types.d.ts +10 -0
- package/dist/canvas/renderer/types.d.ts.map +1 -1
- package/dist/canvas/renderer.d.ts +10 -2
- package/dist/canvas/renderer.d.ts.map +1 -1
- package/dist/canvas/renderer.js +15 -3
- package/dist/canvas/renderer.js.map +1 -1
- package/dist/canvas/scene.d.ts.map +1 -1
- package/dist/canvas/scene.js +9 -9
- package/dist/canvas/scene.js.map +1 -1
- package/dist/clipboard/pairdraw.d.ts.map +1 -1
- package/dist/clipboard/pairdraw.js +1 -0
- package/dist/clipboard/pairdraw.js.map +1 -1
- package/dist/editor/bridges/clipboard.d.ts +2 -0
- package/dist/editor/bridges/clipboard.d.ts.map +1 -1
- package/dist/editor/bridges/clipboard.js +1 -0
- package/dist/editor/bridges/clipboard.js.map +1 -1
- package/dist/editor/bridges/components.d.ts +14 -7
- package/dist/editor/bridges/components.d.ts.map +1 -1
- package/dist/editor/bridges/components.js +6 -0
- package/dist/editor/bridges/components.js.map +1 -1
- package/dist/editor/bridges/structure.d.ts +1 -1
- package/dist/editor/bridges/structure.d.ts.map +1 -1
- package/dist/editor/bridges/undo.d.ts +1 -1
- package/dist/editor/clipboard/code.d.ts +32 -0
- package/dist/editor/clipboard/code.d.ts.map +1 -0
- package/dist/editor/clipboard/code.js +30 -0
- package/dist/editor/clipboard/code.js.map +1 -0
- package/dist/editor/clipboard/paste/dependencies.d.ts +14 -0
- package/dist/editor/clipboard/paste/dependencies.d.ts.map +1 -0
- package/dist/editor/clipboard/paste/dependencies.js +0 -0
- package/dist/editor/clipboard/paste/run.d.ts +14 -0
- package/dist/editor/clipboard/paste/run.d.ts.map +1 -0
- package/dist/editor/clipboard/paste/run.js +47 -0
- package/dist/editor/clipboard/paste/run.js.map +1 -0
- package/dist/editor/clipboard/styled.d.ts +2 -8
- package/dist/editor/clipboard/styled.d.ts.map +1 -1
- package/dist/editor/clipboard/styled.js +2 -32
- package/dist/editor/clipboard/styled.js.map +1 -1
- package/dist/editor/clipboard.d.ts +2 -0
- package/dist/editor/clipboard.d.ts.map +1 -1
- package/dist/editor/clipboard.js +34 -0
- package/dist/editor/clipboard.js.map +1 -1
- package/dist/editor/components/instances.d.ts +5 -0
- package/dist/editor/components/instances.d.ts.map +1 -1
- package/dist/editor/components/instances.js +69 -4
- package/dist/editor/components/instances.js.map +1 -1
- package/dist/editor/components/slots/index.d.ts.map +1 -1
- package/dist/editor/components/slots/index.js +7 -0
- package/dist/editor/components/slots/index.js.map +1 -1
- package/dist/editor/components.d.ts +6 -0
- package/dist/editor/components.d.ts.map +1 -1
- package/dist/editor/components.js +14 -2
- package/dist/editor/components.js.map +1 -1
- package/dist/editor/create.d.ts +30 -3
- package/dist/editor/create.d.ts.map +1 -1
- package/dist/editor/create.js +11 -2
- package/dist/editor/create.js.map +1 -1
- package/dist/editor/design-tokens.d.ts +1 -1
- package/dist/editor/design-tokens.d.ts.map +1 -1
- package/dist/editor/design-tokens.js +4 -18
- package/dist/editor/design-tokens.js.map +1 -1
- package/dist/editor/image-edit.d.ts.map +1 -1
- package/dist/editor/image-edit.js +1 -2
- package/dist/editor/image-edit.js.map +1 -1
- package/dist/editor/index.d.ts +4 -4
- package/dist/editor/index.js +1 -1
- package/dist/editor/layout-mode.d.ts +3 -1
- package/dist/editor/layout-mode.d.ts.map +1 -1
- package/dist/editor/layout-mode.js +97 -2
- package/dist/editor/layout-mode.js.map +1 -1
- package/dist/editor/nodes.d.ts +2 -0
- package/dist/editor/nodes.d.ts.map +1 -1
- package/dist/editor/nodes.js +22 -7
- package/dist/editor/nodes.js.map +1 -1
- package/dist/editor/read-only/actions.js +6 -0
- package/dist/editor/read-only/actions.js.map +1 -1
- package/dist/editor/selection/overlays.d.ts +1 -0
- package/dist/editor/selection/overlays.d.ts.map +1 -1
- package/dist/editor/selection/overlays.js +7 -0
- package/dist/editor/selection/overlays.js.map +1 -1
- package/dist/editor/selection/read.d.ts +8 -0
- package/dist/editor/selection.d.ts +9 -0
- package/dist/editor/selection.d.ts.map +1 -1
- package/dist/editor/state/shared.js +1 -0
- package/dist/editor/state/shared.js.map +1 -1
- package/dist/editor/state/view.d.ts.map +1 -1
- package/dist/editor/state/view.js +2 -0
- package/dist/editor/state/view.js.map +1 -1
- package/dist/editor/structure/boolean.d.ts +1 -1
- package/dist/editor/structure/boolean.d.ts.map +1 -1
- package/dist/editor/structure/boolean.js +20 -1
- package/dist/editor/structure/boolean.js.map +1 -1
- package/dist/editor/structure/container-wrap.d.ts +8 -2
- package/dist/editor/structure/container-wrap.d.ts.map +1 -1
- package/dist/editor/structure/container-wrap.js +17 -5
- package/dist/editor/structure/container-wrap.js.map +1 -1
- package/dist/editor/structure/flatten.d.ts.map +1 -1
- package/dist/editor/structure/flatten.js +8 -7
- package/dist/editor/structure/flatten.js.map +1 -1
- package/dist/editor/structure/group/ungroup.d.ts.map +1 -1
- package/dist/editor/structure/group/ungroup.js +2 -0
- package/dist/editor/structure/group/ungroup.js.map +1 -1
- package/dist/editor/structure/outline-stroke.d.ts.map +1 -1
- package/dist/editor/structure/outline-stroke.js +5 -0
- package/dist/editor/structure/outline-stroke.js.map +1 -1
- package/dist/editor/structure.d.ts +1 -1
- package/dist/editor/structure.d.ts.map +1 -1
- package/dist/editor/styles.d.ts +26 -0
- package/dist/editor/styles.d.ts.map +1 -0
- package/dist/editor/styles.js +127 -0
- package/dist/editor/styles.js.map +1 -0
- 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 +10 -2
- package/dist/editor/text/selection-style.js.map +1 -1
- package/dist/editor/tool-registry.d.ts.map +1 -1
- package/dist/editor/tool-registry.js +6 -0
- package/dist/editor/tool-registry.js.map +1 -1
- package/dist/editor/types.d.ts +14 -2
- package/dist/editor/types.d.ts.map +1 -1
- package/dist/editor/variable-bindings.d.ts.map +1 -1
- package/dist/editor/variable-bindings.js +6 -1
- package/dist/editor/variable-bindings.js.map +1 -1
- package/dist/figma-api/accessors/basic.d.ts.map +1 -1
- package/dist/figma-api/accessors/basic.js +22 -1
- package/dist/figma-api/accessors/basic.js.map +1 -1
- package/dist/figma-api/accessors/shape.js +1 -1
- package/dist/figma-api/accessors/text/index.js +1 -1
- package/dist/figma-api/accessors/text/ranges.js +1 -1
- package/dist/figma-api/accessors/text/references.js +1 -1
- package/dist/figma-api/accessors/variables.js +1 -1
- package/dist/figma-api/accessors/vector.d.ts.map +1 -1
- package/dist/figma-api/accessors/vector.js +8 -22
- package/dist/figma-api/accessors/vector.js.map +1 -1
- package/dist/figma-api/accessors/visual.js +1 -1
- package/dist/figma-api/compatibility.d.ts +1 -1
- package/dist/figma-api/compatibility.d.ts.map +1 -1
- package/dist/figma-api/component-scope.d.ts +14 -0
- package/dist/figma-api/component-scope.d.ts.map +1 -0
- package/dist/figma-api/component-scope.js +28 -0
- package/dist/figma-api/component-scope.js.map +1 -0
- package/dist/figma-api/components.d.ts.map +1 -1
- package/dist/figma-api/components.js +26 -2
- package/dist/figma-api/components.js.map +1 -1
- package/dist/figma-api/flatten.js +3 -3
- package/dist/figma-api/flatten.js.map +1 -1
- package/dist/figma-api/index.d.ts +77 -6
- package/dist/figma-api/index.d.ts.map +1 -1
- package/dist/figma-api/index.js +188 -2
- package/dist/figma-api/index.js.map +1 -1
- package/dist/figma-api/node-types.d.ts +2 -1
- package/dist/figma-api/node-types.d.ts.map +1 -1
- package/dist/figma-api/overrides.d.ts +26 -1
- package/dist/figma-api/overrides.d.ts.map +1 -1
- package/dist/figma-api/overrides.js +157 -10
- package/dist/figma-api/overrides.js.map +1 -1
- package/dist/figma-api/proxy.d.ts +2 -0
- package/dist/figma-api/proxy.d.ts.map +1 -1
- package/dist/figma-api/proxy.js +10 -2
- package/dist/figma-api/proxy.js.map +1 -1
- package/dist/figma-api/reactions.d.ts +65 -9
- package/dist/figma-api/reactions.d.ts.map +1 -1
- package/dist/figma-api/reactions.js +144 -11
- package/dist/figma-api/reactions.js.map +1 -1
- package/dist/figma-api/shape-with-text.js +1 -1
- package/dist/figma-api/slots.d.ts +3 -1
- package/dist/figma-api/slots.d.ts.map +1 -1
- package/dist/figma-api/slots.js +9 -8
- package/dist/figma-api/slots.js.map +1 -1
- package/dist/index.d.ts +4 -4
- package/dist/index.js +1 -1
- package/dist/io/formats/code/detect.d.ts +23 -0
- package/dist/io/formats/code/detect.d.ts.map +1 -0
- package/dist/io/formats/code/detect.js +46 -0
- package/dist/io/formats/code/detect.js.map +1 -0
- package/dist/io/formats/code/index.d.ts +5 -0
- package/dist/io/formats/code/index.js +5 -0
- package/dist/io/formats/code/read.d.ts +45 -0
- package/dist/io/formats/code/read.d.ts.map +1 -0
- package/dist/io/formats/code/read.js +86 -0
- package/dist/io/formats/code/read.js.map +1 -0
- package/dist/io/formats/code/stylesheet.d.ts +13 -0
- package/dist/io/formats/code/stylesheet.d.ts.map +1 -0
- package/dist/io/formats/code/stylesheet.js +21 -0
- package/dist/io/formats/code/stylesheet.js.map +1 -0
- package/dist/io/formats/code/tokens.d.ts +18 -0
- package/dist/io/formats/code/tokens.d.ts.map +1 -0
- package/dist/io/formats/code/tokens.js +135 -0
- package/dist/io/formats/code/tokens.js.map +1 -0
- package/dist/io/formats/design-tokens/apply.d.ts +7 -3
- package/dist/io/formats/design-tokens/apply.d.ts.map +1 -1
- package/dist/io/formats/design-tokens/apply.js.map +1 -1
- package/dist/io/formats/fig/export/patch/fields.js +5 -0
- package/dist/io/formats/fig/export/patch/fields.js.map +1 -1
- package/dist/io/formats/fig/export/patch/index.d.ts.map +1 -1
- package/dist/io/formats/fig/export/patch/index.js +20 -20
- package/dist/io/formats/fig/export/patch/index.js.map +1 -1
- package/dist/io/formats/fig/export/setup.d.ts.map +1 -1
- package/dist/io/formats/fig/export/setup.js +5 -1
- package/dist/io/formats/fig/export/setup.js.map +1 -1
- package/dist/io/formats/fig/index.d.ts +3 -2
- package/dist/io/formats/fig/index.js +2 -2
- package/dist/io/formats/fig/read.d.ts.map +1 -1
- package/dist/io/formats/fig/read.js +5 -2
- package/dist/io/formats/fig/read.js.map +1 -1
- package/dist/io/formats/html/layers.d.ts +3 -1
- package/dist/io/formats/html/layers.d.ts.map +1 -1
- package/dist/io/formats/html/layers.js +6 -1
- package/dist/io/formats/html/layers.js.map +1 -1
- package/dist/io/formats/pdf/export.d.ts.map +1 -1
- package/dist/io/formats/pdf/export.js +7 -3
- package/dist/io/formats/pdf/export.js.map +1 -1
- package/dist/io/formats/pdf/plan.d.ts +3 -0
- package/dist/io/formats/pdf/plan.d.ts.map +1 -1
- package/dist/io/formats/pdf/plan.js +60 -36
- package/dist/io/formats/pdf/plan.js.map +1 -1
- package/dist/io/formats/raster/headless.d.ts.map +1 -1
- package/dist/io/formats/raster/headless.js +3 -2
- 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 +10 -2
- package/dist/io/formats/raster/render.d.ts.map +1 -1
- package/dist/io/formats/raster/render.js +35 -9
- package/dist/io/formats/raster/render.js.map +1 -1
- package/dist/io/formats/svg/defs.d.ts.map +1 -1
- package/dist/io/formats/svg/defs.js +19 -1
- package/dist/io/formats/svg/defs.js.map +1 -1
- package/dist/io/formats/svg/export.d.ts +5 -2
- package/dist/io/formats/svg/export.d.ts.map +1 -1
- package/dist/io/formats/svg/export.js +59 -10
- package/dist/io/formats/svg/export.js.map +1 -1
- package/dist/io/formats/svg/index.d.ts +2 -2
- package/dist/io/formats/svg/index.js +2 -2
- package/dist/io/formats/svg/text/layout.d.ts.map +1 -1
- package/dist/io/formats/svg/text/layout.js +4 -2
- package/dist/io/formats/svg/text/layout.js.map +1 -1
- package/dist/io/formats/video/record.d.ts.map +1 -1
- package/dist/io/formats/video/record.js +24 -9
- package/dist/io/formats/video/record.js.map +1 -1
- package/dist/io/formats.d.ts.map +1 -1
- package/dist/io/formats.js +20 -13
- package/dist/io/formats.js.map +1 -1
- package/dist/kiwi/fig/population/client.d.ts.map +1 -1
- package/dist/kiwi/fig/population/client.js +2 -1
- package/dist/kiwi/fig/population/client.js.map +1 -1
- package/dist/kiwi/fig/session/document-state.d.ts +46 -2
- package/dist/kiwi/fig/session/document-state.d.ts.map +1 -1
- package/dist/kiwi/fig/session/document-state.js +113 -5
- package/dist/kiwi/fig/session/document-state.js.map +1 -1
- package/dist/kiwi/fig/session/options.d.ts +4 -0
- package/dist/kiwi/fig/session/options.d.ts.map +1 -1
- package/dist/kiwi/fig/session/options.js.map +1 -1
- package/dist/layout/apply.d.ts.map +1 -1
- package/dist/layout/apply.js +8 -4
- package/dist/layout/apply.js.map +1 -1
- package/dist/layout/auto-layout-handles.js +1 -1
- package/dist/layout/auto-layout-handles.js.map +1 -1
- package/dist/layout/axis-sizing.d.ts.map +1 -1
- package/dist/layout/axis-sizing.js +1 -1
- package/dist/layout/axis-sizing.js.map +1 -1
- package/dist/layout/derived.d.ts.map +1 -1
- package/dist/layout/derived.js +1 -1
- package/dist/layout/derived.js.map +1 -1
- package/dist/layout/effective-generated-text.js +1 -1
- package/dist/layout/effective-generated-text.js.map +1 -1
- package/dist/layout/grid.d.ts +3 -1
- package/dist/layout/grid.d.ts.map +1 -1
- package/dist/layout/grid.js +57 -16
- package/dist/layout/grid.js.map +1 -1
- package/dist/layout.d.ts +1 -1
- package/dist/layout.js +6 -5
- package/dist/layout.js.map +1 -1
- package/dist/node/fs.d.ts.map +1 -1
- package/dist/node/fs.js +28 -7
- package/dist/node/fs.js.map +1 -1
- package/dist/prototype/easing.d.ts +13 -5
- package/dist/prototype/easing.d.ts.map +1 -1
- package/dist/prototype/easing.js +46 -6
- package/dist/prototype/easing.js.map +1 -1
- package/dist/prototype/scenes.d.ts +31 -0
- package/dist/prototype/scenes.d.ts.map +1 -1
- package/dist/prototype/scenes.js +220 -31
- package/dist/prototype/scenes.js.map +1 -1
- package/dist/prototype/session.d.ts.map +1 -1
- package/dist/prototype/session.js +1 -0
- package/dist/prototype/session.js.map +1 -1
- package/dist/prototype/smart-animate/animation.d.ts +2 -1
- package/dist/prototype/smart-animate/animation.d.ts.map +1 -1
- package/dist/prototype/smart-animate/animation.js +2 -2
- package/dist/prototype/smart-animate/animation.js.map +1 -1
- package/dist/prototype/timeline.d.ts +10 -1
- package/dist/prototype/timeline.d.ts.map +1 -1
- package/dist/prototype/timeline.js +69 -23
- package/dist/prototype/timeline.js.map +1 -1
- package/dist/prototype/variables.d.ts +23 -0
- package/dist/prototype/variables.d.ts.map +1 -0
- package/dist/prototype/variables.js +237 -0
- package/dist/prototype/variables.js.map +1 -0
- package/dist/rpc/read-commands.d.ts +5 -0
- package/dist/rpc/read-commands.d.ts.map +1 -1
- package/dist/rpc/read-commands.js +4 -1
- package/dist/rpc/read-commands.js.map +1 -1
- package/dist/text/character-style.d.ts +8 -1
- package/dist/text/character-style.d.ts.map +1 -1
- package/dist/text/character-style.js +39 -1
- package/dist/text/character-style.js.map +1 -1
- package/dist/text/font/batch.d.ts +26 -0
- package/dist/text/font/batch.d.ts.map +1 -0
- package/dist/text/font/batch.js +31 -0
- package/dist/text/font/batch.js.map +1 -0
- package/dist/text/font/manager.d.ts.map +1 -1
- package/dist/text/font/manager.js +14 -1
- package/dist/text/font/manager.js.map +1 -1
- package/dist/text/index.d.ts +3 -2
- package/dist/text/index.js +3 -2
- package/dist/tools/create/basic.js +3 -4
- package/dist/tools/create/basic.js.map +1 -1
- package/dist/tools/create/behaviours.js +1 -1
- package/dist/tools/create/code.d.ts +6 -0
- package/dist/tools/create/code.d.ts.map +1 -0
- package/dist/tools/create/code.js +68 -0
- package/dist/tools/create/code.js.map +1 -0
- package/dist/tools/create/html.d.ts.map +1 -1
- package/dist/tools/create/html.js +9 -57
- package/dist/tools/create/html.js.map +1 -1
- package/dist/tools/create/icons.js +1 -1
- package/dist/tools/create/inputs.d.ts +11 -0
- package/dist/tools/create/inputs.d.ts.map +1 -0
- package/dist/tools/create/inputs.js +15 -0
- package/dist/tools/create/inputs.js.map +1 -0
- package/dist/tools/create/mermaid.d.ts.map +1 -1
- package/dist/tools/create/mermaid.js +5 -6
- package/dist/tools/create/mermaid.js.map +1 -1
- package/dist/tools/create/place.d.ts +30 -0
- package/dist/tools/create/place.d.ts.map +1 -0
- package/dist/tools/create/place.js +70 -0
- package/dist/tools/create/place.js.map +1 -0
- package/dist/tools/create/render.js +1 -1
- package/dist/tools/create/svg.js +1 -1
- package/dist/tools/create/vector.js +1 -1
- package/dist/tools/create.d.ts +2 -1
- package/dist/tools/create.js +2 -1
- package/dist/tools/css/gradient.d.ts +28 -0
- package/dist/tools/css/gradient.d.ts.map +1 -0
- package/dist/tools/css/gradient.js +118 -0
- package/dist/tools/css/gradient.js.map +1 -0
- package/dist/tools/image-ai/generate.js +1 -1
- package/dist/tools/modify/geometry.js +5 -5
- package/dist/tools/modify/geometry.js.map +1 -1
- package/dist/tools/modify/layout.d.ts.map +1 -1
- package/dist/tools/modify/layout.js +7 -1
- package/dist/tools/modify/layout.js.map +1 -1
- package/dist/tools/modify/matching.js +1 -1
- package/dist/tools/modify/overrides.d.ts +6 -0
- package/dist/tools/modify/overrides.d.ts.map +1 -0
- package/dist/tools/modify/overrides.js +27 -0
- package/dist/tools/modify/overrides.js.map +1 -0
- package/dist/tools/modify/paint.d.ts.map +1 -1
- package/dist/tools/modify/paint.js +84 -39
- package/dist/tools/modify/paint.js.map +1 -1
- package/dist/tools/modify/text.d.ts +2 -1
- package/dist/tools/modify/text.d.ts.map +1 -1
- package/dist/tools/modify/text.js +79 -8
- package/dist/tools/modify/text.js.map +1 -1
- package/dist/tools/modify/update.d.ts.map +1 -1
- package/dist/tools/modify/update.js +18 -2
- package/dist/tools/modify/update.js.map +1 -1
- package/dist/tools/modify.d.ts +3 -2
- package/dist/tools/modify.js +3 -2
- package/dist/tools/read/css.d.ts.map +1 -1
- package/dist/tools/read/css.js +29 -12
- package/dist/tools/read/css.js.map +1 -1
- package/dist/tools/read/libraries.js +1 -1
- package/dist/tools/read/nodes.d.ts.map +1 -1
- package/dist/tools/read/nodes.js +19 -5
- package/dist/tools/read/nodes.js.map +1 -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/text-range.d.ts +11 -0
- package/dist/tools/text-range.d.ts.map +1 -0
- package/dist/tools/text-range.js +26 -0
- package/dist/tools/text-range.js.map +1 -0
- package/dist/tools/variables/bindings.js +1 -1
- package/dist/tools/variables/bindings.js.map +1 -1
- package/dist/tools/variables/unbind.js +1 -1
- package/dist/tools/variables/unbind.js.map +1 -1
- package/dist/tools/vector/path.d.ts.map +1 -1
- package/dist/tools/vector/path.js +7 -21
- package/dist/tools/vector/path.js.map +1 -1
- package/dist/vector/rebase.d.ts +17 -0
- package/dist/vector/rebase.d.ts.map +1 -0
- package/dist/vector/rebase.js +32 -0
- package/dist/vector/rebase.js.map +1 -0
- package/package.json +14 -9
- package/src/canvas/boolean.ts +12 -1
- package/src/canvas/color-space.ts +73 -0
- package/src/canvas/fills.ts +130 -83
- package/src/canvas/flatten.ts +92 -7
- package/src/canvas/index.ts +9 -0
- package/src/canvas/layout-grids.ts +15 -2
- package/src/canvas/noise/render.ts +35 -7
- package/src/canvas/noise/shader.ts +8 -10
- package/src/canvas/overlays/annotations.ts +117 -0
- package/src/canvas/overlays/auto-layout-hover.ts +41 -1
- package/src/canvas/overlays/feedback.ts +7 -2
- package/src/canvas/overlays/index.ts +1 -1
- package/src/canvas/overlays/measurement.ts +49 -3
- package/src/canvas/overlays/presence.ts +35 -32
- package/src/canvas/renderer/colors.ts +14 -0
- package/src/canvas/renderer/document-surface.ts +16 -6
- package/src/canvas/renderer/lifecycle.ts +2 -2
- package/src/canvas/renderer/methods.ts +4 -0
- package/src/canvas/renderer/overlay-pass.ts +4 -0
- package/src/canvas/renderer/pipeline.ts +8 -0
- package/src/canvas/renderer/types.ts +8 -0
- package/src/canvas/renderer.ts +21 -2
- package/src/canvas/scene.ts +15 -7
- package/src/clipboard/pairdraw.ts +1 -0
- package/src/editor/bridges/clipboard.ts +1 -0
- package/src/editor/bridges/components.ts +10 -0
- package/src/editor/clipboard/code.ts +50 -0
- package/src/editor/clipboard/paste/dependencies.ts +18 -0
- package/src/editor/clipboard/paste/run.ts +64 -0
- package/src/editor/clipboard/styled.ts +4 -52
- package/src/editor/clipboard.ts +40 -0
- package/src/editor/components/instances.ts +92 -4
- package/src/editor/components/slots/index.ts +7 -0
- package/src/editor/components.ts +16 -2
- package/src/editor/create.ts +15 -1
- package/src/editor/design-tokens.ts +3 -23
- package/src/editor/image-edit.ts +5 -2
- package/src/editor/index.ts +1 -0
- package/src/editor/layout-mode.ts +131 -3
- package/src/editor/nodes.ts +30 -5
- package/src/editor/read-only/actions.ts +6 -0
- package/src/editor/selection/overlays.ts +8 -0
- package/src/editor/state/shared.ts +1 -0
- package/src/editor/state/view.ts +2 -0
- package/src/editor/structure/boolean.ts +29 -1
- package/src/editor/structure/container-wrap.ts +20 -4
- package/src/editor/structure/flatten.ts +15 -8
- package/src/editor/structure/group/ungroup.ts +2 -0
- package/src/editor/structure/outline-stroke.ts +5 -0
- package/src/editor/styles.ts +203 -0
- package/src/editor/text/selection-style.ts +18 -1
- package/src/editor/tool-registry.ts +2 -0
- package/src/editor/types.ts +14 -0
- package/src/editor/variable-bindings.ts +11 -0
- package/src/figma-api/accessors/basic.ts +33 -1
- package/src/figma-api/accessors/vector.ts +6 -13
- package/src/figma-api/compatibility.ts +1 -0
- package/src/figma-api/component-scope.ts +36 -0
- package/src/figma-api/components.ts +24 -0
- package/src/figma-api/flatten.ts +7 -3
- package/src/figma-api/index.ts +302 -6
- package/src/figma-api/node-types.ts +1 -0
- package/src/figma-api/overrides.ts +192 -5
- package/src/figma-api/proxy.ts +16 -1
- package/src/figma-api/reactions.ts +163 -12
- package/src/figma-api/slots.ts +10 -9
- package/src/io/formats/code/detect.ts +67 -0
- package/src/io/formats/code/index.ts +17 -0
- package/src/io/formats/code/read.ts +143 -0
- package/src/io/formats/code/stylesheet.ts +24 -0
- package/src/io/formats/code/tokens.ts +159 -0
- package/src/io/formats/design-tokens/apply.ts +3 -2
- package/src/io/formats/fig/export/patch/fields.ts +11 -0
- package/src/io/formats/fig/export/patch/index.ts +23 -19
- package/src/io/formats/fig/export/setup.ts +8 -1
- package/src/io/formats/fig/index.ts +6 -0
- package/src/io/formats/fig/read.ts +11 -2
- package/src/io/formats/html/layers.ts +7 -0
- package/src/io/formats/pdf/export.ts +19 -7
- package/src/io/formats/pdf/plan.ts +71 -32
- package/src/io/formats/raster/headless.ts +3 -1
- package/src/io/formats/raster/index.ts +2 -0
- package/src/io/formats/raster/render.ts +49 -9
- package/src/io/formats/svg/defs.ts +27 -1
- package/src/io/formats/svg/export.ts +75 -13
- package/src/io/formats/svg/index.ts +1 -0
- package/src/io/formats/svg/text/layout.ts +5 -3
- package/src/io/formats/video/record.ts +33 -9
- package/src/io/formats.ts +35 -15
- package/src/kiwi/fig/population/client.ts +6 -1
- package/src/kiwi/fig/session/document-state.ts +195 -5
- package/src/kiwi/fig/session/options.ts +2 -0
- package/src/layout/apply.ts +12 -4
- package/src/layout/auto-layout-handles.ts +1 -1
- package/src/layout/axis-sizing.ts +3 -1
- package/src/layout/derived.ts +3 -1
- package/src/layout/effective-generated-text.ts +1 -1
- package/src/layout/grid.ts +91 -21
- package/src/layout.ts +16 -3
- package/src/node/fs.ts +32 -7
- package/src/prototype/easing.ts +79 -7
- package/src/prototype/scenes.ts +244 -15
- package/src/prototype/session.ts +1 -0
- package/src/prototype/smart-animate/animation.ts +4 -3
- package/src/prototype/timeline.ts +118 -26
- package/src/prototype/variables.ts +189 -0
- package/src/rpc/read-commands.ts +19 -1
- package/src/text/character-style.ts +47 -0
- package/src/text/font/batch.ts +58 -0
- package/src/text/font/manager.ts +17 -1
- package/src/text/index.ts +2 -1
- package/src/tools/create/basic.ts +2 -3
- package/src/tools/create/code.ts +85 -0
- package/src/tools/create/html.ts +9 -46
- package/src/tools/create/inputs.ts +12 -0
- package/src/tools/create/mermaid.ts +6 -6
- package/src/tools/create/place.ts +80 -0
- package/src/tools/create.ts +1 -0
- package/src/tools/css/gradient.ts +147 -0
- package/src/tools/modify/geometry.ts +5 -5
- package/src/tools/modify/layout.ts +19 -0
- package/src/tools/modify/overrides.ts +35 -0
- package/src/tools/modify/paint.ts +124 -54
- package/src/tools/modify/text.ts +91 -7
- package/src/tools/modify/update.ts +23 -2
- package/src/tools/modify.ts +9 -1
- package/src/tools/read/css.ts +46 -12
- package/src/tools/read/nodes.ts +26 -4
- package/src/tools/registry/extended.ts +6 -0
- package/src/tools/text-range.ts +29 -0
- package/src/tools/variables/bindings.ts +4 -1
- package/src/tools/variables/unbind.ts +4 -1
- package/src/tools/vector/path.ts +11 -13
- package/src/vector/rebase.ts +33 -0
|
@@ -1,13 +1,16 @@
|
|
|
1
1
|
import { isValid, toUint8Array } from 'js-base64'
|
|
2
2
|
import * as v from 'valibot'
|
|
3
3
|
|
|
4
|
-
import type { Variable, VariableCollection, VariableValue } from '@pairdraw/scene-graph'
|
|
4
|
+
import type { Fill, Variable, VariableCollection, VariableValue } from '@pairdraw/scene-graph'
|
|
5
5
|
import { gradientTransformRows, linearGradientTransform } from '@pairdraw/scene-graph/gradient'
|
|
6
6
|
import type { Color, Vector } from '@pairdraw/scene-graph/primitives'
|
|
7
7
|
|
|
8
8
|
import type { FigmaAPI } from '#core/figma-api'
|
|
9
9
|
import { storeImage } from '#core/figma-api/images'
|
|
10
|
+
import { toFigmaPaint, type FigmaPaint } from '#core/figma-api/paints'
|
|
10
11
|
import { PairdrawAPI } from '#core/pairdraw-api'
|
|
12
|
+
import type { WritableGradient } from '#core/tools/css/gradient'
|
|
13
|
+
import { gradientFillFromCSS } from '#core/tools/css/gradient'
|
|
11
14
|
import {
|
|
12
15
|
defineTool,
|
|
13
16
|
nodeIdInputSchema,
|
|
@@ -25,6 +28,14 @@ const STRETCH_IMAGE_TRANSFORM: [[number, number, number], [number, number, numbe
|
|
|
25
28
|
[0, 1, 0]
|
|
26
29
|
]
|
|
27
30
|
|
|
31
|
+
/**
|
|
32
|
+
* A solid paint with its alpha where Figma stores it: in `opacity`, with the colour opaque, so the
|
|
33
|
+
* read side's `color.a * opacity` prints the colour that paints. `get_css` writes the same product.
|
|
34
|
+
*/
|
|
35
|
+
function solidFillPaint(color: Color): Fill {
|
|
36
|
+
return { type: 'SOLID', color: { ...color, a: 1 }, opacity: color.a, visible: true }
|
|
37
|
+
}
|
|
38
|
+
|
|
28
39
|
/**
|
|
29
40
|
* `var(--color/brand)` or `var(--color/brand, #4F46E5)`: a token by name, as `get_css` writes it.
|
|
30
41
|
* The fallback runs to the last `)`, since a Display P3 document writes one as `color(display-p3 …)`.
|
|
@@ -57,74 +68,134 @@ function tokenColor(
|
|
|
57
68
|
return { color: value, collection }
|
|
58
69
|
}
|
|
59
70
|
|
|
71
|
+
/** The direction words `set_fill` takes as a gradient, as opposed to a CSS gradient string. */
|
|
72
|
+
const GRADIENT_DIRECTIONS = new Set(['top-bottom', 'bottom-top', 'left-right', 'right-left'])
|
|
73
|
+
|
|
74
|
+
/** A `get_css` gradient string, parsed into the fill it describes, or the reason it cannot be. */
|
|
75
|
+
function cssGradientFill(
|
|
76
|
+
figma: FigmaAPI,
|
|
77
|
+
node: { width: number; height: number },
|
|
78
|
+
gradient: string,
|
|
79
|
+
color: string | undefined,
|
|
80
|
+
color_end: string | undefined
|
|
81
|
+
): { fill: WritableGradient } | { error: string } {
|
|
82
|
+
if (!(node.width > 0) || !(node.height > 0)) {
|
|
83
|
+
return { error: 'A gradient needs a layer with a width and a height.' }
|
|
84
|
+
}
|
|
85
|
+
if (color !== undefined || color_end !== undefined) {
|
|
86
|
+
return {
|
|
87
|
+
error:
|
|
88
|
+
'A CSS gradient string carries its own colours; omit color and color_end. Use a direction word with color for a two-stop gradient.'
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
const parsed = gradientFillFromCSS({
|
|
92
|
+
text: gradient,
|
|
93
|
+
width: node.width,
|
|
94
|
+
height: node.height,
|
|
95
|
+
profile: figma.graph.documentColorSpace,
|
|
96
|
+
color: (text) => parseToolColor(text, figma.graph.documentColorSpace)
|
|
97
|
+
})
|
|
98
|
+
return 'error' in parsed ? parsed : { fill: parsed.fill }
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
/**
|
|
102
|
+
* A `var(--name)` fill, painted with the token it names and bound to it, or the reason it cannot be.
|
|
103
|
+
* `undefined` when `color` is not a token, so the caller paints it as a plain colour.
|
|
104
|
+
*/
|
|
105
|
+
function tokenFill(
|
|
106
|
+
figma: FigmaAPI,
|
|
107
|
+
node: { id: string; fills: readonly FigmaPaint[] | symbol },
|
|
108
|
+
color: string,
|
|
109
|
+
color_end: string | undefined,
|
|
110
|
+
gradient: boolean
|
|
111
|
+
): { id: string; color: Color; bound: string } | { error: string } | undefined {
|
|
112
|
+
const token = COLOR_TOKEN.exec(color)
|
|
113
|
+
const endToken = color_end === undefined ? null : COLOR_TOKEN.exec(color_end)
|
|
114
|
+
// Gradient stops carry no variable binding, so a token there would paint the wrong thing.
|
|
115
|
+
if (gradient && (token !== null || endToken !== null)) {
|
|
116
|
+
const named = [
|
|
117
|
+
token === null ? undefined : `"${token[1]}"`,
|
|
118
|
+
endToken === null ? undefined : `"${endToken[1]}"`
|
|
119
|
+
]
|
|
120
|
+
.filter((entry) => entry !== undefined)
|
|
121
|
+
.join(' and ')
|
|
122
|
+
return {
|
|
123
|
+
error: `A gradient cannot take the token ${named}: gradient stops have no variable binding. Pass hex colours for a gradient, or a token only for a solid fill.`
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
if (token === null) return undefined
|
|
127
|
+
const name = token[1]
|
|
128
|
+
const matches = colorVariablesNamed(figma, name)
|
|
129
|
+
if (matches.length === 0) {
|
|
130
|
+
return {
|
|
131
|
+
error: `No COLOR variable named "${name}". Call find_variables to list the document's tokens.`
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
if (matches.length > 1) {
|
|
135
|
+
const where = matches
|
|
136
|
+
.map(
|
|
137
|
+
(variable) =>
|
|
138
|
+
figma.graph.variableCollections.get(variable.collectionId)?.name ?? variable.collectionId
|
|
139
|
+
)
|
|
140
|
+
.join(', ')
|
|
141
|
+
return {
|
|
142
|
+
error: `${matches.length} variables named "${name}" (${where}); bind one with bind_variable.`
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
for (const variable of matches) {
|
|
146
|
+
const resolved = tokenColor(figma, variable)
|
|
147
|
+
if ('error' in resolved) return resolved
|
|
148
|
+
node.fills = [toFigmaPaint(solidFillPaint(resolved.color))]
|
|
149
|
+
new PairdrawAPI(figma).bindVariable(node.id, 'fills/0/color', variable)
|
|
150
|
+
return { id: node.id, color: resolved.color, bound: name }
|
|
151
|
+
}
|
|
152
|
+
return { error: `No COLOR variable named "${name}"` }
|
|
153
|
+
}
|
|
154
|
+
|
|
60
155
|
export const setFill = defineTool({
|
|
61
156
|
name: 'set_fill',
|
|
62
157
|
|
|
63
158
|
description:
|
|
64
|
-
'Set fill on a node. Solid: color="#ff0000". A token by name: color="var(--color/brand)" paints its colour and binds the fill.
|
|
159
|
+
'Set fill on a node. Solid: color="#ff0000" (rgba() and color(display-p3 … / a) keep their alpha). A token by name: color="var(--color/brand)" paints its colour and binds the fill. Direction gradient: gradient="top-bottom" or "left-right" with color (start) and color_end (end). A CSS gradient string from get_css, such as gradient="linear-gradient(180deg, #FF0000 0%, #0000FF 100%)" or gradient="diamond-gradient(#FF0000, #0000FF)", carries its own colours; gradient stops take colours, not tokens.',
|
|
65
160
|
execution: { kind: 'sync', mutation: 'properties' },
|
|
66
161
|
input: v.strictObject({
|
|
67
162
|
id: nodeIdInputSchema,
|
|
68
|
-
color: v.
|
|
69
|
-
|
|
70
|
-
v.pipe(v.string(), v.description('End color for gradient (if omitted, solid fill)'))
|
|
163
|
+
color: v.optional(
|
|
164
|
+
v.pipe(v.string(), v.description('Color (hex, rgba(), or color(display-p3 …)).'))
|
|
71
165
|
),
|
|
166
|
+
color_end: v.optional(v.pipe(v.string(), v.description('End color for a direction gradient'))),
|
|
72
167
|
gradient: v.optional(
|
|
73
|
-
v.
|
|
74
|
-
v.
|
|
75
|
-
|
|
76
|
-
|
|
168
|
+
v.union([
|
|
169
|
+
v.pipe(
|
|
170
|
+
v.picklist(['top-bottom', 'bottom-top', 'left-right', 'right-left']),
|
|
171
|
+
v.description('Gradient direction')
|
|
172
|
+
),
|
|
173
|
+
v.pipe(
|
|
174
|
+
v.string(),
|
|
175
|
+
v.description('A CSS gradient string from get_css, e.g. linear-gradient(180deg, …)')
|
|
176
|
+
)
|
|
177
|
+
])
|
|
77
178
|
)
|
|
78
179
|
}),
|
|
79
180
|
execute: (figma, { id, color, color_end, gradient }) => {
|
|
80
181
|
const node = figma.getNodeById(id)
|
|
81
182
|
if (!node) return { error: `Node "${id}" not found` }
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
if (gradient && (token !== null || endToken !== null)) {
|
|
88
|
-
const named = [
|
|
89
|
-
token === null ? undefined : `"${token[1]}"`,
|
|
90
|
-
endToken === null ? undefined : `"${endToken[1]}"`
|
|
91
|
-
]
|
|
92
|
-
.filter((entry) => entry !== undefined)
|
|
93
|
-
.join(' and ')
|
|
94
|
-
return {
|
|
95
|
-
error: `A gradient cannot take the token ${named}: gradient stops have no variable binding. Pass hex colours for a gradient, or a token only for a solid fill.`
|
|
96
|
-
}
|
|
183
|
+
if (typeof gradient === 'string' && !GRADIENT_DIRECTIONS.has(gradient)) {
|
|
184
|
+
const result = cssGradientFill(figma, node, gradient, color, color_end)
|
|
185
|
+
if ('error' in result) return result
|
|
186
|
+
node.fills = [result.fill]
|
|
187
|
+
return { id, gradient }
|
|
97
188
|
}
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
if (matches.length === 0) {
|
|
102
|
-
return {
|
|
103
|
-
error: `No COLOR variable named "${name}". Call find_variables to list the document's tokens.`
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
if (matches.length > 1) {
|
|
107
|
-
const where = matches
|
|
108
|
-
.map(
|
|
109
|
-
(variable) =>
|
|
110
|
-
figma.graph.variableCollections.get(variable.collectionId)?.name ??
|
|
111
|
-
variable.collectionId
|
|
112
|
-
)
|
|
113
|
-
.join(', ')
|
|
114
|
-
return {
|
|
115
|
-
error: `${matches.length} variables named "${name}" (${where}); bind one with bind_variable.`
|
|
116
|
-
}
|
|
117
|
-
}
|
|
118
|
-
for (const variable of matches) {
|
|
119
|
-
const resolved = tokenColor(figma, variable)
|
|
120
|
-
if ('error' in resolved) return resolved
|
|
121
|
-
node.fills = [{ type: 'SOLID', color: resolved.color }]
|
|
122
|
-
new PairdrawAPI(figma).bindVariable(node.id, 'fills/0/color', variable)
|
|
123
|
-
return { id, color: resolved.color, bound: name }
|
|
189
|
+
if (color === undefined) {
|
|
190
|
+
return {
|
|
191
|
+
error: 'Provide color for a solid fill, or gradient for a gradient.'
|
|
124
192
|
}
|
|
125
|
-
return { error: `No COLOR variable named "${name}"` }
|
|
126
193
|
}
|
|
127
194
|
|
|
195
|
+
// A token name paints the colour it holds and binds the fill, so the layer follows the token.
|
|
196
|
+
const bound = tokenFill(figma, node, color, color_end, gradient !== undefined)
|
|
197
|
+
if (bound !== undefined) return bound
|
|
198
|
+
|
|
128
199
|
const c = parseToolColor(color, figma.graph.documentColorSpace)
|
|
129
200
|
if ('error' in c) return c
|
|
130
201
|
|
|
@@ -164,8 +235,7 @@ export const setFill = defineTool({
|
|
|
164
235
|
return { id, gradient, start: c, end: cEnd }
|
|
165
236
|
}
|
|
166
237
|
|
|
167
|
-
|
|
168
|
-
node.fills = [{ type: 'SOLID', color: c }]
|
|
238
|
+
node.fills = [toFigmaPaint(solidFillPaint(c))]
|
|
169
239
|
return { id, color: c }
|
|
170
240
|
}
|
|
171
241
|
})
|
|
@@ -193,7 +263,7 @@ export const setStroke = defineTool({
|
|
|
193
263
|
|
|
194
264
|
const c = parseToolColor(color, figma.graph.documentColorSpace)
|
|
195
265
|
if ('error' in c) return c
|
|
196
|
-
node.strokes = [
|
|
266
|
+
node.strokes = [toFigmaPaint(solidFillPaint(c))]
|
|
197
267
|
node.strokeWeight = weight
|
|
198
268
|
node.strokeAlign = align
|
|
199
269
|
return { id, color: c, weight: weight }
|
package/src/tools/modify/text.ts
CHANGED
|
@@ -17,6 +17,7 @@ import {
|
|
|
17
17
|
nodeNotFound,
|
|
18
18
|
toolFailure
|
|
19
19
|
} from '#core/tools/schema'
|
|
20
|
+
import { textRangeError } from '#core/tools/text-range'
|
|
20
21
|
|
|
21
22
|
/**
|
|
22
23
|
* A link a text tool sets, as the editor's link field takes it: a web or mail address, with
|
|
@@ -257,6 +258,17 @@ function rangeEdit(
|
|
|
257
258
|
return { hyperlink: hyperlink ?? null, color: color.color }
|
|
258
259
|
}
|
|
259
260
|
|
|
261
|
+
const rangeIndex = (description: string) =>
|
|
262
|
+
toolNumber(v.pipe(v.number(), v.integer(), v.minValue(0), v.description(description)))
|
|
263
|
+
|
|
264
|
+
/** A TEXT node for a range edit, or the error the tool returns when the id is not one. */
|
|
265
|
+
function textNodeFor(figma: FigmaAPI, id: string): FigmaNodeProxy | { error: string } {
|
|
266
|
+
const node = figma.getNodeById(id)
|
|
267
|
+
if (!node) return nodeNotFound(id)
|
|
268
|
+
if (node.type !== 'TEXT') return { error: `Node "${id}" is not a TEXT node` }
|
|
269
|
+
return node
|
|
270
|
+
}
|
|
271
|
+
|
|
260
272
|
export const setFontRange = defineTool({
|
|
261
273
|
name: 'set_font_range',
|
|
262
274
|
|
|
@@ -264,8 +276,8 @@ export const setFontRange = defineTool({
|
|
|
264
276
|
execution: { kind: 'sync', mutation: 'properties' },
|
|
265
277
|
input: v.strictObject({
|
|
266
278
|
id: nodeIdInputSchema,
|
|
267
|
-
start:
|
|
268
|
-
end:
|
|
279
|
+
start: rangeIndex('Start character index, in UTF-16 code units'),
|
|
280
|
+
end: rangeIndex('End character index, in UTF-16 code units'),
|
|
269
281
|
family: v.optional(v.pipe(v.string(), v.description('Font family name'))),
|
|
270
282
|
size: v.optional(toolNumber(v.pipe(v.number(), v.minValue(1), v.description('Font size')))),
|
|
271
283
|
style: v.optional(v.pipe(v.string(), v.description('Font style'))),
|
|
@@ -284,8 +296,8 @@ export const setFontRange = defineTool({
|
|
|
284
296
|
return [...(font ? [font] : []), ...(laysOut ? textFonts(figma, args.id) : [])]
|
|
285
297
|
},
|
|
286
298
|
execute: (figma, args) => {
|
|
287
|
-
const node = figma
|
|
288
|
-
if (
|
|
299
|
+
const node = textNodeFor(figma, args.id)
|
|
300
|
+
if ('error' in node) return node
|
|
289
301
|
const { start, end } = args
|
|
290
302
|
const badTag = badVariationTag(args.variations)
|
|
291
303
|
if (badTag) return badTag
|
|
@@ -293,6 +305,8 @@ export const setFontRange = defineTool({
|
|
|
293
305
|
if (badFeature) return badFeature
|
|
294
306
|
const edit = rangeEdit(args, figma.graph.documentColorSpace)
|
|
295
307
|
if ('error' in edit) return edit
|
|
308
|
+
const rangeError = textRangeError(node.characters, start, end)
|
|
309
|
+
if (rangeError) return { error: rangeError }
|
|
296
310
|
const { hyperlink, color } = edit
|
|
297
311
|
// The range methods reject an empty range or one past the text, before changing anything.
|
|
298
312
|
try {
|
|
@@ -316,6 +330,77 @@ export const setFontRange = defineTool({
|
|
|
316
330
|
}
|
|
317
331
|
})
|
|
318
332
|
|
|
333
|
+
export const setTextRangeStyle = defineTool({
|
|
334
|
+
name: 'set_text_range_style',
|
|
335
|
+
|
|
336
|
+
description:
|
|
337
|
+
"Set line height, letter spacing, text case, or decoration for a character range. Indices are UTF-16 code units, as the editor's text ranges are.",
|
|
338
|
+
|
|
339
|
+
execution: { kind: 'sync', mutation: 'properties' },
|
|
340
|
+
input: v.strictObject({
|
|
341
|
+
id: nodeIdInputSchema,
|
|
342
|
+
start: rangeIndex('Start index, in UTF-16 code units'),
|
|
343
|
+
end: rangeIndex('End index, in UTF-16 code units'),
|
|
344
|
+
line_height: v.optional(
|
|
345
|
+
toolNumber(v.pipe(v.number(), v.minValue(0), v.description('Line height in pixels')))
|
|
346
|
+
),
|
|
347
|
+
letter_spacing: v.optional(
|
|
348
|
+
toolNumber(v.pipe(v.number(), v.description('Letter spacing in pixels')))
|
|
349
|
+
),
|
|
350
|
+
text_case: v.optional(
|
|
351
|
+
v.pipe(
|
|
352
|
+
v.picklist(['ORIGINAL', 'UPPER', 'LOWER', 'TITLE']),
|
|
353
|
+
v.description('Letter case in the range')
|
|
354
|
+
)
|
|
355
|
+
),
|
|
356
|
+
text_decoration: v.optional(
|
|
357
|
+
v.pipe(
|
|
358
|
+
v.picklist(['NONE', 'UNDERLINE', 'STRIKETHROUGH']),
|
|
359
|
+
v.description('Decoration in the range')
|
|
360
|
+
)
|
|
361
|
+
)
|
|
362
|
+
}),
|
|
363
|
+
fonts: (figma, { id }) => textFonts(figma, id),
|
|
364
|
+
execute: (figma, args) => {
|
|
365
|
+
const node = textNodeFor(figma, args.id)
|
|
366
|
+
if ('error' in node) return node
|
|
367
|
+
const updated: string[] = []
|
|
368
|
+
if (args.line_height !== undefined) updated.push('lineHeight')
|
|
369
|
+
if (args.letter_spacing !== undefined) updated.push('letterSpacing')
|
|
370
|
+
if (args.text_case !== undefined) updated.push('textCase')
|
|
371
|
+
if (args.text_decoration !== undefined) updated.push('textDecoration')
|
|
372
|
+
if (updated.length === 0) {
|
|
373
|
+
return {
|
|
374
|
+
error:
|
|
375
|
+
'set_text_range_style needs at least one of line_height, letter_spacing, text_case, or text_decoration'
|
|
376
|
+
}
|
|
377
|
+
}
|
|
378
|
+
const rangeError = textRangeError(node.characters, args.start, args.end)
|
|
379
|
+
if (rangeError) return { error: rangeError }
|
|
380
|
+
// The range setters reject a bad range, but the guard above names what went wrong.
|
|
381
|
+
try {
|
|
382
|
+
if (args.line_height !== undefined) {
|
|
383
|
+
node.setRangeLineHeight(args.start, args.end, { unit: 'PIXELS', value: args.line_height })
|
|
384
|
+
}
|
|
385
|
+
if (args.letter_spacing !== undefined) {
|
|
386
|
+
node.setRangeLetterSpacing(args.start, args.end, {
|
|
387
|
+
unit: 'PIXELS',
|
|
388
|
+
value: args.letter_spacing
|
|
389
|
+
})
|
|
390
|
+
}
|
|
391
|
+
if (args.text_case !== undefined) {
|
|
392
|
+
node.setRangeTextCase(args.start, args.end, args.text_case)
|
|
393
|
+
}
|
|
394
|
+
if (args.text_decoration !== undefined) {
|
|
395
|
+
node.setRangeTextDecoration(args.start, args.end, args.text_decoration)
|
|
396
|
+
}
|
|
397
|
+
} catch (error) {
|
|
398
|
+
return toolFailure(error)
|
|
399
|
+
}
|
|
400
|
+
return { id: args.id, range: { start: args.start, end: args.end }, updated }
|
|
401
|
+
}
|
|
402
|
+
})
|
|
403
|
+
|
|
319
404
|
export const setTextResize = defineTool({
|
|
320
405
|
name: 'set_text_resize',
|
|
321
406
|
|
|
@@ -371,9 +456,8 @@ export const setTextProperties = defineTool({
|
|
|
371
456
|
}),
|
|
372
457
|
fonts: (figma, { id }) => textFonts(figma, id),
|
|
373
458
|
execute: (figma, args) => {
|
|
374
|
-
const node = figma
|
|
375
|
-
if (
|
|
376
|
-
if (node.type !== 'TEXT') return { error: `Node "${args.id}" is not a TEXT node` }
|
|
459
|
+
const node = textNodeFor(figma, args.id)
|
|
460
|
+
if ('error' in node) return node
|
|
377
461
|
// Refused before anything changes, so a bad address leaves the text as it was.
|
|
378
462
|
const hyperlink = requestedHyperlink(args.hyperlink)
|
|
379
463
|
if (hyperlink && 'error' in hyperlink) return hyperlink
|
|
@@ -63,6 +63,17 @@ export function scrollBehaviorInput() {
|
|
|
63
63
|
)
|
|
64
64
|
}
|
|
65
65
|
|
|
66
|
+
/** Why this edit cannot run, before anything is written. */
|
|
67
|
+
function editRefusal(
|
|
68
|
+
node: FigmaNodeProxy,
|
|
69
|
+
args: { overflow_direction?: string; boolean_operation?: string }
|
|
70
|
+
): string | null {
|
|
71
|
+
if (args.overflow_direction !== undefined) return scrollRefusal(node)
|
|
72
|
+
if (args.boolean_operation !== undefined && node.type !== 'BOOLEAN_OPERATION')
|
|
73
|
+
return `Only a boolean operation has boolean_operation; ${node.type} "${node.name}" does not.`
|
|
74
|
+
return null
|
|
75
|
+
}
|
|
76
|
+
|
|
66
77
|
export const updateNode = defineTool({
|
|
67
78
|
name: 'update_node',
|
|
68
79
|
|
|
@@ -102,14 +113,20 @@ export const updateNode = defineTool({
|
|
|
102
113
|
),
|
|
103
114
|
name: v.optional(v.pipe(v.string(), v.description('Layer name'))),
|
|
104
115
|
overflow_direction: v.optional(overflowDirectionInput()),
|
|
105
|
-
scroll_behavior: v.optional(scrollBehaviorInput())
|
|
116
|
+
scroll_behavior: v.optional(scrollBehaviorInput()),
|
|
117
|
+
boolean_operation: v.optional(
|
|
118
|
+
v.pipe(
|
|
119
|
+
v.picklist(['UNION', 'SUBTRACT', 'INTERSECT', 'EXCLUDE']),
|
|
120
|
+
v.description('How a BOOLEAN_OPERATION combines its children')
|
|
121
|
+
)
|
|
122
|
+
)
|
|
106
123
|
}),
|
|
107
124
|
execute: (figma, args) => {
|
|
108
125
|
const node = figma.getNodeById(args.id)
|
|
109
126
|
if (!node) return nodeNotFound(args.id)
|
|
110
127
|
assertNodeEditable(figma.graph, args.id)
|
|
111
128
|
// Refused before anything is written, so the call changes all or nothing.
|
|
112
|
-
const refusal =
|
|
129
|
+
const refusal = editRefusal(node, args)
|
|
113
130
|
if (refusal) return { error: refusal }
|
|
114
131
|
// Written to the layer directly, since the plugin setters need a loaded font; an edit to a
|
|
115
132
|
// text style's field leaves the style, as the editor's updates do.
|
|
@@ -176,6 +193,10 @@ export const updateNode = defineTool({
|
|
|
176
193
|
node.scrollBehavior = args.scroll_behavior
|
|
177
194
|
updated.push('scrollBehavior')
|
|
178
195
|
}
|
|
196
|
+
if (args.boolean_operation !== undefined) {
|
|
197
|
+
node.booleanOperation = args.boolean_operation
|
|
198
|
+
updated.push('booleanOperation')
|
|
199
|
+
}
|
|
179
200
|
return { id: args.id, updated }
|
|
180
201
|
}
|
|
181
202
|
})
|
package/src/tools/modify.ts
CHANGED
|
@@ -3,8 +3,16 @@ export { replaceFonts } from './modify/fonts'
|
|
|
3
3
|
export { rescale, setMinMax, setOpacity, setRadius, setRotation } from './modify/geometry'
|
|
4
4
|
export { setConstraints, setLayout, setLayoutChild } from './modify/layout'
|
|
5
5
|
export { replaceMatchingProperties } from './modify/matching'
|
|
6
|
+
export { resetOverrideFields } from './modify/overrides'
|
|
6
7
|
export { setFill, setImageFill, setStroke } from './modify/paint'
|
|
7
8
|
export { setReactions } from './modify/reactions'
|
|
8
9
|
export { setBlend, setLocked, setStrokeAlign, setVisible } from './modify/state'
|
|
9
|
-
export {
|
|
10
|
+
export {
|
|
11
|
+
setFont,
|
|
12
|
+
setFontRange,
|
|
13
|
+
setText,
|
|
14
|
+
setTextProperties,
|
|
15
|
+
setTextRangeStyle,
|
|
16
|
+
setTextResize
|
|
17
|
+
} from './modify/text'
|
|
10
18
|
export { updateNode } from './modify/update'
|
package/src/tools/read/css.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import * as v from 'valibot'
|
|
2
2
|
|
|
3
|
+
import { diamondFillToCSS, gradientFillToCSS } from '@pairdraw/dom-css/export'
|
|
3
4
|
import type { ColorProfile, SceneGraph, SceneNode, ShadowEffect } from '@pairdraw/scene-graph'
|
|
4
5
|
import { colorToDocumentCSS } from '@pairdraw/scene-graph/color'
|
|
5
6
|
import type { Color } from '@pairdraw/scene-graph/primitives'
|
|
@@ -80,11 +81,25 @@ function boundName(graph: SceneGraph, node: SceneNode, field: string): string |
|
|
|
80
81
|
|
|
81
82
|
/**
|
|
82
83
|
* A stored colour as the shorthand writes it: `#RRGGBB` in an sRGB document, `color(display-p3 …)`
|
|
83
|
-
* in a Display P3 one, where hex would name a different colour
|
|
84
|
-
*
|
|
84
|
+
* in a Display P3 one, where hex would name a different colour, and `rgba()` or `color(… / a)` when
|
|
85
|
+
* the paint is translucent. What paints is the colour's alpha times the paint's `opacity`, so both
|
|
86
|
+
* are folded into the shorthand; the setters store that product the same way.
|
|
85
87
|
*/
|
|
86
|
-
function cssColor(color: Color, profile: ColorProfile): string {
|
|
87
|
-
return colorToDocumentCSS({ ...color, a:
|
|
88
|
+
function cssColor(color: Color, opacity: number, profile: ColorProfile): string {
|
|
89
|
+
return colorToDocumentCSS({ ...color, a: color.a * opacity }, profile)
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
/** A solid paint's colour and opacity, which the shorthand folds into one colour. */
|
|
93
|
+
interface SolidFill {
|
|
94
|
+
color: Color
|
|
95
|
+
opacity: number
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
/** The first visible solid fill and its index, which a text colour or a background can name. */
|
|
99
|
+
function solidFill(node: SceneNode): { index: number; fill: SolidFill } | null {
|
|
100
|
+
const index = node.fills.findIndex((candidate) => candidate.type === 'SOLID' && candidate.visible)
|
|
101
|
+
const fill = index === -1 ? undefined : node.fills[index]
|
|
102
|
+
return fill?.type === 'SOLID' ? { index, fill } : null
|
|
88
103
|
}
|
|
89
104
|
|
|
90
105
|
/** A colour in the document's profile, or `var(--token, …)` when a variable paints it. */
|
|
@@ -94,23 +109,39 @@ function paintOf(node: SceneNode, graph: SceneGraph, field: string, paint: strin
|
|
|
94
109
|
}
|
|
95
110
|
|
|
96
111
|
function background(node: SceneNode, graph: SceneGraph): string | null {
|
|
97
|
-
const
|
|
98
|
-
const solid = index === -1 ? undefined : node.fills[index]
|
|
112
|
+
const solid = solidFill(node)
|
|
99
113
|
if (solid) {
|
|
100
|
-
const paint = cssColor(solid.color, graph.documentColorSpace)
|
|
101
|
-
return paintOf(node, graph, `fills/${index}/color`, paint)
|
|
114
|
+
const paint = cssColor(solid.fill.color, solid.fill.opacity, graph.documentColorSpace)
|
|
115
|
+
return paintOf(node, graph, `fills/${solid.index}/color`, paint)
|
|
102
116
|
}
|
|
103
117
|
const otherIndex = node.fills.findIndex((candidate) => candidate.visible)
|
|
104
118
|
const other = otherIndex === -1 ? undefined : node.fills[otherIndex]
|
|
105
119
|
if (!other) return null
|
|
106
|
-
|
|
120
|
+
switch (other.type) {
|
|
121
|
+
case 'GRADIENT_DIAMOND':
|
|
122
|
+
// CSS has no diamond; the Pairdraw spelling carries the same stops so set_fill can close the
|
|
123
|
+
// round trip instead of losing them behind a word.
|
|
124
|
+
return diamondFillToCSS(other, graph.documentColorSpace) ?? 'gradient'
|
|
125
|
+
case 'GRADIENT_LINEAR':
|
|
126
|
+
case 'GRADIENT_RADIAL':
|
|
127
|
+
case 'GRADIENT_ANGULAR':
|
|
128
|
+
return (
|
|
129
|
+
gradientFillToCSS(other, node.width, node.height, graph.documentColorSpace) ?? 'gradient'
|
|
130
|
+
)
|
|
131
|
+
case 'IMAGE':
|
|
132
|
+
return `image(${other.imageScaleMode ?? 'FILL'})`
|
|
133
|
+
default:
|
|
134
|
+
// A paint CSS has neither a gradient nor an image for keeps the image word, as §3.3's table
|
|
135
|
+
// says, rather than claiming a gradient it would not draw.
|
|
136
|
+
return 'image'
|
|
137
|
+
}
|
|
107
138
|
}
|
|
108
139
|
|
|
109
140
|
function border(node: SceneNode, graph: SceneGraph): string | null {
|
|
110
141
|
const index = node.strokes.findIndex((candidate) => candidate.visible)
|
|
111
142
|
const stroke = index === -1 ? undefined : node.strokes[index]
|
|
112
143
|
if (!stroke) return null
|
|
113
|
-
const paint = cssColor(stroke.color, graph.documentColorSpace)
|
|
144
|
+
const paint = cssColor(stroke.color, stroke.opacity, graph.documentColorSpace)
|
|
114
145
|
return `${px(stroke.weight)} ${paintOf(node, graph, `strokes/${index}/color`, paint)}`
|
|
115
146
|
}
|
|
116
147
|
|
|
@@ -127,7 +158,8 @@ function padding(node: SceneNode): string | null {
|
|
|
127
158
|
}
|
|
128
159
|
|
|
129
160
|
function shadowOf(prefix: string, effect: ShadowEffect, profile: ColorProfile): string {
|
|
130
|
-
|
|
161
|
+
// A shadow's colour carries its whole alpha; the effect has no separate opacity.
|
|
162
|
+
return `${prefix}:${px(effect.offset.x)} ${px(effect.offset.y)} ${px(effect.radius)} ${cssColor(effect.color, 1, profile)}`
|
|
131
163
|
}
|
|
132
164
|
|
|
133
165
|
function effects(node: SceneNode, profile: ColorProfile): string[] {
|
|
@@ -197,8 +229,10 @@ function textDecls(node: SceneNode, graph: SceneGraph): string[] {
|
|
|
197
229
|
const out = [
|
|
198
230
|
`font:${node.fontWeight} ${px(node.fontSize)}/${lineHeightOf(node)} ${node.fontFamily}`
|
|
199
231
|
]
|
|
232
|
+
// `color:` takes a colour; a gradient or an image fill is not one, and no setter writes a text
|
|
233
|
+
// paint, so text with such a fill prints no colour line at all.
|
|
200
234
|
const bg = background(node, graph)
|
|
201
|
-
if (bg) out.push(`color:${bg}`)
|
|
235
|
+
if (bg && solidFill(node)) out.push(`color:${bg}`)
|
|
202
236
|
if (node.textAlignHorizontal !== 'LEFT') {
|
|
203
237
|
out.push(`text-align:${node.textAlignHorizontal.toLowerCase()}`)
|
|
204
238
|
}
|
package/src/tools/read/nodes.ts
CHANGED
|
@@ -122,6 +122,16 @@ export const getPageTree = defineTool({
|
|
|
122
122
|
}
|
|
123
123
|
})
|
|
124
124
|
|
|
125
|
+
function withTextRuns(
|
|
126
|
+
figma: FigmaAPI,
|
|
127
|
+
id: string,
|
|
128
|
+
result: Record<string, unknown>
|
|
129
|
+
): Record<string, unknown> {
|
|
130
|
+
const node = figma.graph.getNode(id)
|
|
131
|
+
if (node?.type !== 'TEXT') return result
|
|
132
|
+
return { ...result, styleRuns: node.styleRuns, textParagraphs: node.textParagraphs }
|
|
133
|
+
}
|
|
134
|
+
|
|
125
135
|
export const getNode = defineTool({
|
|
126
136
|
name: 'get_node',
|
|
127
137
|
description:
|
|
@@ -136,17 +146,29 @@ export const getNode = defineTool({
|
|
|
136
146
|
v.description('Max depth of children to include (0 = no children). Default: unlimited')
|
|
137
147
|
)
|
|
138
148
|
)
|
|
149
|
+
),
|
|
150
|
+
include_text_runs: v.optional(
|
|
151
|
+
v.pipe(
|
|
152
|
+
v.boolean(),
|
|
153
|
+
v.description(
|
|
154
|
+
'Include character style runs and paragraph styles, so mixed text can be read'
|
|
155
|
+
)
|
|
156
|
+
)
|
|
139
157
|
)
|
|
140
158
|
}),
|
|
141
|
-
executeSync: (figma, { id, depth }) => {
|
|
159
|
+
executeSync: (figma, { id, depth, include_text_runs }) => {
|
|
142
160
|
const node = figma.getNodeById(id)
|
|
143
|
-
|
|
161
|
+
if (!node) return undefined
|
|
162
|
+
const result = nodeToResult(node, depth)
|
|
163
|
+
return include_text_runs ? withTextRuns(figma, id, result) : result
|
|
144
164
|
},
|
|
145
|
-
execute: async (figma, { id, depth }) => {
|
|
165
|
+
execute: async (figma, { id, depth, include_text_runs }) => {
|
|
146
166
|
const node = figma.getNodeById(id)
|
|
147
167
|
// A layer on a page not yet visited loads that page, as in Figma's dynamic-page mode.
|
|
148
168
|
const loaded = node ?? (await figma.getNodeByIdAsync(id))
|
|
149
|
-
|
|
169
|
+
if (!loaded) return { error: `Node "${id}" not found` }
|
|
170
|
+
const result = nodeToResult(loaded, depth)
|
|
171
|
+
return include_text_runs ? withTextRuns(figma, id, result) : result
|
|
150
172
|
}
|
|
151
173
|
})
|
|
152
174
|
|
|
@@ -31,6 +31,7 @@ import {
|
|
|
31
31
|
createSlot,
|
|
32
32
|
fetchIconsTool,
|
|
33
33
|
getBehaviour,
|
|
34
|
+
importCode,
|
|
34
35
|
importHTML,
|
|
35
36
|
importMermaid,
|
|
36
37
|
importSVG,
|
|
@@ -57,8 +58,10 @@ import {
|
|
|
57
58
|
setEffects,
|
|
58
59
|
setFont,
|
|
59
60
|
setFontRange,
|
|
61
|
+
setTextRangeStyle,
|
|
60
62
|
setImageFill,
|
|
61
63
|
setLocked,
|
|
64
|
+
resetOverrideFields,
|
|
62
65
|
setMinMax,
|
|
63
66
|
replaceMatchingProperties,
|
|
64
67
|
rescale,
|
|
@@ -183,6 +186,7 @@ export const EXTENDED_TOOLS: ToolDef[] = [
|
|
|
183
186
|
createComponent,
|
|
184
187
|
createInstance,
|
|
185
188
|
detachInstance,
|
|
189
|
+
resetOverrideFields,
|
|
186
190
|
exposeInstanceSwap,
|
|
187
191
|
createSlot,
|
|
188
192
|
getBehaviour,
|
|
@@ -193,6 +197,7 @@ export const EXTENDED_TOOLS: ToolDef[] = [
|
|
|
193
197
|
createConnectorTool,
|
|
194
198
|
importSVG,
|
|
195
199
|
importMermaid,
|
|
200
|
+
importCode,
|
|
196
201
|
importHTML,
|
|
197
202
|
// Image AI, run on the services the user set up in the app
|
|
198
203
|
generateImage,
|
|
@@ -209,6 +214,7 @@ export const EXTENDED_TOOLS: ToolDef[] = [
|
|
|
209
214
|
setRotation,
|
|
210
215
|
setMinMax,
|
|
211
216
|
setFontRange,
|
|
217
|
+
setTextRangeStyle,
|
|
212
218
|
setTextResize,
|
|
213
219
|
replaceFonts,
|
|
214
220
|
setBlend,
|