@pairdraw/core 0.19.2 → 0.21.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ai/providers.d.ts +6 -0
- package/dist/ai/providers.d.ts.map +1 -1
- package/dist/ai/providers.js.map +1 -1
- package/dist/cache/resource.d.ts +8 -1
- package/dist/cache/resource.d.ts.map +1 -1
- package/dist/cache/resource.js +18 -0
- package/dist/cache/resource.js.map +1 -1
- package/dist/canvas/effects.d.ts +6 -4
- package/dist/canvas/effects.d.ts.map +1 -1
- package/dist/canvas/effects.js +37 -34
- package/dist/canvas/effects.js.map +1 -1
- package/dist/canvas/fills.d.ts.map +1 -1
- package/dist/canvas/fills.js +12 -8
- package/dist/canvas/fills.js.map +1 -1
- package/dist/canvas/images/adjustments.d.ts +18 -0
- package/dist/canvas/images/adjustments.d.ts.map +1 -0
- package/dist/canvas/images/adjustments.js +184 -0
- package/dist/canvas/images/adjustments.js.map +1 -0
- package/dist/canvas/images/sampling.d.ts +13 -0
- package/dist/canvas/images/sampling.d.ts.map +1 -0
- package/dist/canvas/images/sampling.js +49 -0
- package/dist/canvas/images/sampling.js.map +1 -0
- package/dist/canvas/index.d.ts +2 -2
- package/dist/canvas/masks.d.ts +1 -1
- package/dist/canvas/masks.d.ts.map +1 -1
- package/dist/canvas/masks.js.map +1 -1
- package/dist/canvas/noise/render.d.ts +15 -0
- package/dist/canvas/noise/render.d.ts.map +1 -0
- package/dist/canvas/noise/render.js +56 -0
- package/dist/canvas/noise/render.js.map +1 -0
- package/dist/canvas/noise/shader.d.ts +46 -0
- package/dist/canvas/noise/shader.d.ts.map +1 -0
- package/dist/canvas/noise/shader.js +166 -0
- package/dist/canvas/noise/shader.js.map +1 -0
- package/dist/canvas/noise/table.d.ts +13 -0
- package/dist/canvas/noise/table.d.ts.map +1 -0
- package/dist/canvas/noise/table.js +408 -0
- package/dist/canvas/noise/table.js.map +1 -0
- package/dist/canvas/noise/tile.d.ts +22 -0
- package/dist/canvas/noise/tile.d.ts.map +1 -0
- package/dist/canvas/noise/tile.js +74 -0
- package/dist/canvas/noise/tile.js.map +1 -0
- package/dist/canvas/outline-stroke.js +1 -1
- package/dist/canvas/overlays/auto-layout-hover.d.ts.map +1 -1
- package/dist/canvas/overlays/auto-layout-hover.js +31 -71
- package/dist/canvas/overlays/auto-layout-hover.js.map +1 -1
- package/dist/canvas/renderer/chunks/index.d.ts +1 -1
- package/dist/canvas/renderer/colors.d.ts +20 -5
- package/dist/canvas/renderer/colors.d.ts.map +1 -1
- package/dist/canvas/renderer/colors.js +48 -42
- package/dist/canvas/renderer/colors.js.map +1 -1
- package/dist/canvas/renderer/document-surface.d.ts +25 -0
- package/dist/canvas/renderer/document-surface.d.ts.map +1 -0
- package/dist/canvas/renderer/document-surface.js +46 -0
- package/dist/canvas/renderer/document-surface.js.map +1 -0
- package/dist/canvas/renderer/fonts.d.ts.map +1 -1
- package/dist/canvas/renderer/fonts.js +6 -4
- package/dist/canvas/renderer/fonts.js.map +1 -1
- package/dist/canvas/renderer/lifecycle.d.ts.map +1 -1
- package/dist/canvas/renderer/lifecycle.js +10 -3
- package/dist/canvas/renderer/lifecycle.js.map +1 -1
- package/dist/canvas/renderer/methods.d.ts.map +1 -1
- package/dist/canvas/renderer/methods.js +1 -0
- package/dist/canvas/renderer/methods.js.map +1 -1
- package/dist/canvas/renderer/pipeline.d.ts.map +1 -1
- package/dist/canvas/renderer/pipeline.js +36 -3
- package/dist/canvas/renderer/pipeline.js.map +1 -1
- package/dist/canvas/renderer/play-scenes.d.ts +13 -0
- package/dist/canvas/renderer/play-scenes.d.ts.map +1 -0
- package/dist/canvas/renderer/play-scenes.js +40 -0
- package/dist/canvas/renderer/play-scenes.js.map +1 -0
- package/dist/canvas/renderer/retained-backing.d.ts.map +1 -1
- package/dist/canvas/renderer/retained-backing.js +2 -1
- package/dist/canvas/renderer/retained-backing.js.map +1 -1
- package/dist/canvas/renderer/tiles/cache.d.ts +19 -1
- package/dist/canvas/renderer/tiles/cache.d.ts.map +1 -1
- package/dist/canvas/renderer/tiles/cache.js +32 -1
- package/dist/canvas/renderer/tiles/cache.js.map +1 -1
- package/dist/canvas/renderer/tiles/controller.d.ts +11 -0
- package/dist/canvas/renderer/tiles/controller.d.ts.map +1 -1
- package/dist/canvas/renderer/tiles/controller.js +18 -1
- package/dist/canvas/renderer/tiles/controller.js.map +1 -1
- package/dist/canvas/renderer/tiles/index.d.ts +2 -2
- package/dist/canvas/renderer/tiles/planner.d.ts +1 -1
- package/dist/canvas/renderer/tiles/surface-pool.d.ts.map +1 -1
- package/dist/canvas/renderer/tiles/surface-pool.js +2 -7
- package/dist/canvas/renderer/tiles/surface-pool.js.map +1 -1
- package/dist/canvas/renderer/types.d.ts +18 -3
- package/dist/canvas/renderer/types.d.ts.map +1 -1
- package/dist/canvas/renderer/visual-bounds.d.ts +1 -1
- package/dist/canvas/renderer/visual-bounds.js +1 -1
- package/dist/canvas/renderer.d.ts +42 -4
- package/dist/canvas/renderer.d.ts.map +1 -1
- package/dist/canvas/renderer.js +57 -5
- package/dist/canvas/renderer.js.map +1 -1
- package/dist/canvas/scene.d.ts +2 -1
- package/dist/canvas/scene.d.ts.map +1 -1
- package/dist/canvas/scene.js +45 -12
- package/dist/canvas/scene.js.map +1 -1
- package/dist/canvas/shaders/effect.d.ts.map +1 -1
- package/dist/canvas/shaders/effect.js +2 -1
- package/dist/canvas/shaders/effect.js.map +1 -1
- package/dist/canvas/shadows/shape.d.ts.map +1 -1
- package/dist/canvas/shadows/shape.js +4 -2
- package/dist/canvas/shadows/shape.js.map +1 -1
- package/dist/canvas/shadows/silhouette.js +1 -1
- package/dist/canvas/shadows.d.ts.map +1 -1
- package/dist/canvas/shadows.js +4 -2
- package/dist/canvas/shadows.js.map +1 -1
- package/dist/canvas/text/decorations.d.ts +2 -2
- package/dist/canvas/text/decorations.d.ts.map +1 -1
- package/dist/canvas/text/decorations.js +5 -5
- package/dist/canvas/text/decorations.js.map +1 -1
- package/dist/canvas/text/index.js +1 -1
- package/dist/canvas/text/index.js.map +1 -1
- package/dist/canvas/text/paragraph/index.d.ts +2 -2
- package/dist/canvas/text/paragraph/index.d.ts.map +1 -1
- package/dist/canvas/text/paragraph/index.js +16 -5
- package/dist/canvas/text/paragraph/index.js.map +1 -1
- package/dist/canvas/text/renderer.d.ts +2 -1
- package/dist/canvas/text/renderer.d.ts.map +1 -1
- package/dist/canvas/text/shape.js +4 -4
- package/dist/canvas/text/shape.js.map +1 -1
- package/dist/canvas/texture.d.ts +20 -0
- package/dist/canvas/texture.d.ts.map +1 -0
- package/dist/canvas/texture.js +101 -0
- package/dist/canvas/texture.js.map +1 -0
- package/dist/clipboard.js +16 -5
- package/dist/clipboard.js.map +1 -1
- package/dist/constants.d.ts +5 -1
- package/dist/constants.d.ts.map +1 -1
- package/dist/constants.js +5 -1
- package/dist/constants.js.map +1 -1
- package/dist/design-jsx/renderer.d.ts.map +1 -1
- package/dist/design-memory/check.d.ts +90 -0
- package/dist/design-memory/check.d.ts.map +1 -0
- package/dist/design-memory/check.js +281 -0
- package/dist/design-memory/check.js.map +1 -0
- package/dist/design-memory/describe.d.ts +37 -0
- package/dist/design-memory/describe.d.ts.map +1 -0
- package/dist/design-memory/describe.js +52 -0
- package/dist/design-memory/describe.js.map +1 -0
- package/dist/design-memory/distil.d.ts +22 -0
- package/dist/design-memory/distil.d.ts.map +1 -0
- package/dist/design-memory/distil.js +54 -0
- package/dist/design-memory/distil.js.map +1 -0
- package/dist/design-memory/document.d.ts +12 -0
- package/dist/design-memory/document.d.ts.map +1 -0
- package/dist/design-memory/document.js +64 -0
- package/dist/design-memory/document.js.map +1 -0
- package/dist/design-memory/guard.d.ts +48 -0
- package/dist/design-memory/guard.d.ts.map +1 -0
- package/dist/design-memory/guard.js +105 -0
- package/dist/design-memory/guard.js.map +1 -0
- package/dist/design-memory/index.d.ts +9 -0
- package/dist/design-memory/index.js +9 -0
- package/dist/design-memory/refusal.d.ts +32 -0
- package/dist/design-memory/refusal.d.ts.map +1 -0
- package/dist/design-memory/refusal.js +68 -0
- package/dist/design-memory/refusal.js.map +1 -0
- package/dist/design-memory/rules.d.ts +63 -0
- package/dist/design-memory/rules.d.ts.map +1 -0
- package/dist/design-memory/rules.js +224 -0
- package/dist/design-memory/rules.js.map +1 -0
- package/dist/design-memory/values.d.ts +28 -0
- package/dist/design-memory/values.d.ts.map +1 -0
- package/dist/design-memory/values.js +160 -0
- package/dist/design-memory/values.js.map +1 -0
- package/dist/editor/alignment.js +1 -1
- package/dist/editor/bridges/components.d.ts +2 -0
- package/dist/editor/bridges/components.d.ts.map +1 -1
- package/dist/editor/bridges/components.js +2 -0
- package/dist/editor/bridges/components.js.map +1 -1
- package/dist/editor/clipboard/assets.d.ts.map +1 -1
- package/dist/editor/clipboard/assets.js +3 -3
- package/dist/editor/clipboard/assets.js.map +1 -1
- package/dist/editor/clipboard/component-matches.d.ts +13 -0
- package/dist/editor/clipboard/component-matches.d.ts.map +1 -0
- package/dist/editor/clipboard/component-matches.js +50 -0
- package/dist/editor/clipboard/component-matches.js.map +1 -0
- package/dist/editor/clipboard/dependencies.d.ts +7 -0
- package/dist/editor/clipboard/dependencies.d.ts.map +1 -1
- package/dist/editor/clipboard/dependencies.js +5 -0
- package/dist/editor/clipboard/dependencies.js.map +1 -1
- package/dist/editor/clipboard/export.d.ts.map +1 -1
- package/dist/editor/clipboard/export.js +16 -2
- package/dist/editor/clipboard/export.js.map +1 -1
- package/dist/editor/clipboard/placement.d.ts +1 -1
- package/dist/editor/clipboard/placement.js +1 -1
- package/dist/editor/clipboard.d.ts.map +1 -1
- package/dist/editor/clipboard.js +48 -19
- package/dist/editor/clipboard.js.map +1 -1
- package/dist/editor/components/instances.d.ts +2 -0
- package/dist/editor/components/instances.d.ts.map +1 -1
- package/dist/editor/components/instances.js +22 -1
- package/dist/editor/components/instances.js.map +1 -1
- package/dist/editor/components/properties.d.ts.map +1 -1
- package/dist/editor/components/properties.js +3 -3
- package/dist/editor/components/properties.js.map +1 -1
- package/dist/editor/components.d.ts +2 -0
- package/dist/editor/components.d.ts.map +1 -1
- package/dist/editor/connectors/attach.js +1 -1
- package/dist/editor/create.d.ts +26 -2
- package/dist/editor/create.d.ts.map +1 -1
- package/dist/editor/create.js +16 -60
- package/dist/editor/create.js.map +1 -1
- package/dist/editor/design-memory.d.ts +11 -0
- package/dist/editor/design-memory.d.ts.map +1 -0
- package/dist/editor/design-memory.js +40 -0
- package/dist/editor/design-memory.js.map +1 -0
- package/dist/editor/design-tokens.d.ts +4 -0
- package/dist/editor/design-tokens.d.ts.map +1 -1
- package/dist/editor/design-tokens.js +30 -1
- package/dist/editor/design-tokens.js.map +1 -1
- package/dist/editor/document-colors.d.ts +23 -0
- package/dist/editor/document-colors.d.ts.map +1 -0
- package/dist/editor/document-colors.js +53 -0
- package/dist/editor/document-colors.js.map +1 -0
- package/dist/editor/eyedropper.d.ts +47 -0
- package/dist/editor/eyedropper.d.ts.map +1 -0
- package/dist/editor/eyedropper.js +171 -0
- package/dist/editor/eyedropper.js.map +1 -0
- package/dist/editor/fonts.d.ts +9 -0
- package/dist/editor/fonts.d.ts.map +1 -0
- package/dist/editor/fonts.js +14 -0
- package/dist/editor/fonts.js.map +1 -0
- package/dist/editor/history/atomic-tool.d.ts +9 -2
- package/dist/editor/history/atomic-tool.d.ts.map +1 -1
- package/dist/editor/history/atomic-tool.js +9 -2
- package/dist/editor/history/atomic-tool.js.map +1 -1
- package/dist/editor/history/capture.d.ts +13 -0
- package/dist/editor/history/capture.d.ts.map +1 -0
- package/dist/editor/history/capture.js +28 -0
- package/dist/editor/history/capture.js.map +1 -0
- package/dist/editor/history/document-change.d.ts.map +1 -1
- package/dist/editor/history/document-change.js +2 -22
- package/dist/editor/history/document-change.js.map +1 -1
- package/dist/editor/history/edit.d.ts +7 -0
- package/dist/editor/history/edit.d.ts.map +1 -1
- package/dist/editor/history/edit.js +4 -2
- package/dist/editor/history/edit.js.map +1 -1
- package/dist/editor/history/subtree.d.ts +9 -0
- package/dist/editor/history/subtree.d.ts.map +1 -1
- package/dist/editor/history/subtree.js +12 -2
- package/dist/editor/history/subtree.js.map +1 -1
- package/dist/editor/index.d.ts +4 -2
- package/dist/editor/index.js +4 -2
- package/dist/editor/pages.d.ts +7 -5
- package/dist/editor/pages.d.ts.map +1 -1
- package/dist/editor/pages.js +35 -25
- package/dist/editor/pages.js.map +1 -1
- package/dist/editor/play/states.d.ts +3 -1
- package/dist/editor/play/states.d.ts.map +1 -1
- package/dist/editor/play/states.js +1 -1
- package/dist/editor/play/states.js.map +1 -1
- package/dist/editor/read-only/actions.js +4 -0
- package/dist/editor/read-only/actions.js.map +1 -1
- package/dist/editor/render-requests.d.ts +18 -0
- package/dist/editor/render-requests.d.ts.map +1 -0
- package/dist/editor/render-requests.js +76 -0
- package/dist/editor/render-requests.js.map +1 -0
- package/dist/editor/scale/rescale.d.ts +1 -1
- package/dist/editor/selection/overlays.d.ts.map +1 -1
- package/dist/editor/selection/overlays.js +1 -1
- package/dist/editor/selection/overlays.js.map +1 -1
- package/dist/editor/selection/read.d.ts +4 -0
- package/dist/editor/selection.d.ts +5 -0
- package/dist/editor/selection.d.ts.map +1 -1
- package/dist/editor/shapes/pencil.js +1 -1
- package/dist/editor/structure/state.d.ts.map +1 -1
- package/dist/editor/structure/state.js +2 -2
- package/dist/editor/structure/state.js.map +1 -1
- package/dist/editor/text.d.ts.map +1 -1
- package/dist/editor/text.js +2 -2
- package/dist/editor/text.js.map +1 -1
- package/dist/editor/tool-registry.d.ts.map +1 -1
- package/dist/editor/tool-registry.js +2 -1
- package/dist/editor/tool-registry.js.map +1 -1
- package/dist/editor/types.d.ts +5 -1
- package/dist/editor/types.d.ts.map +1 -1
- package/dist/editor/variables.js +3 -3
- package/dist/editor/variables.js.map +1 -1
- package/dist/editor/variations/create.d.ts +28 -0
- package/dist/editor/variations/create.d.ts.map +1 -0
- package/dist/editor/variations/create.js +176 -0
- package/dist/editor/variations/create.js.map +1 -0
- package/dist/editor/variations/pick.d.ts +16 -0
- package/dist/editor/variations/pick.d.ts.map +1 -0
- package/dist/editor/variations/pick.js +23 -0
- package/dist/editor/variations/pick.js.map +1 -0
- package/dist/editor/variations.d.ts +28 -0
- package/dist/editor/variations.d.ts.map +1 -0
- package/dist/editor/variations.js +88 -0
- package/dist/editor/variations.js.map +1 -0
- package/dist/figma-api/accessors/reactions.d.ts.map +1 -1
- package/dist/figma-api/accessors/reactions.js +4 -1
- package/dist/figma-api/accessors/reactions.js.map +1 -1
- package/dist/figma-api/accessors/text/index.js +3 -0
- package/dist/figma-api/accessors/text/index.js.map +1 -1
- package/dist/figma-api/accessors/text/opentype.d.ts +17 -0
- package/dist/figma-api/accessors/text/opentype.d.ts.map +1 -0
- package/dist/figma-api/accessors/text/opentype.js +28 -0
- package/dist/figma-api/accessors/text/opentype.js.map +1 -0
- package/dist/figma-api/accessors/visual.d.ts.map +1 -1
- package/dist/figma-api/accessors/visual.js +33 -0
- package/dist/figma-api/accessors/visual.js.map +1 -1
- package/dist/figma-api/effects.d.ts +79 -3
- package/dist/figma-api/effects.d.ts.map +1 -1
- package/dist/figma-api/effects.js +150 -9
- package/dist/figma-api/effects.js.map +1 -1
- package/dist/figma-api/fresh-read.d.ts +15 -0
- package/dist/figma-api/fresh-read.d.ts.map +1 -0
- package/dist/figma-api/fresh-read.js +54 -0
- package/dist/figma-api/fresh-read.js.map +1 -0
- package/dist/figma-api/graph-ref.d.ts +9 -0
- package/dist/figma-api/graph-ref.d.ts.map +1 -0
- package/dist/figma-api/graph-ref.js +14 -0
- package/dist/figma-api/graph-ref.js.map +1 -0
- package/dist/figma-api/index.d.ts +11 -1
- package/dist/figma-api/index.d.ts.map +1 -1
- package/dist/figma-api/index.js +16 -4
- package/dist/figma-api/index.js.map +1 -1
- package/dist/figma-api/overrides.d.ts +13 -1
- package/dist/figma-api/overrides.d.ts.map +1 -1
- package/dist/figma-api/overrides.js +196 -4
- package/dist/figma-api/overrides.js.map +1 -1
- package/dist/figma-api/paints.d.ts +3 -3
- package/dist/figma-api/paints.d.ts.map +1 -1
- package/dist/figma-api/paints.js +14 -4
- package/dist/figma-api/paints.js.map +1 -1
- package/dist/figma-api/pending-layout.d.ts +3 -3
- package/dist/figma-api/pending-layout.d.ts.map +1 -1
- package/dist/figma-api/pending-layout.js +7 -3
- package/dist/figma-api/pending-layout.js.map +1 -1
- package/dist/figma-api/pending-sync.d.ts +1 -1
- package/dist/figma-api/pending-sync.d.ts.map +1 -1
- package/dist/figma-api/pending-sync.js +3 -1
- package/dist/figma-api/pending-sync.js.map +1 -1
- package/dist/figma-api/proxy.d.ts +4 -1
- package/dist/figma-api/proxy.d.ts.map +1 -1
- package/dist/figma-api/proxy.js +2 -1
- package/dist/figma-api/proxy.js.map +1 -1
- package/dist/figma-api/reactions.d.ts +59 -15
- package/dist/figma-api/reactions.d.ts.map +1 -1
- package/dist/figma-api/reactions.js +160 -32
- package/dist/figma-api/reactions.js.map +1 -1
- package/dist/figma-api/render-bounds.js +1 -1
- package/dist/figma-api/surface.d.ts +6 -3
- package/dist/figma-api/surface.d.ts.map +1 -1
- package/dist/figma-api/surface.js +6 -2
- package/dist/figma-api/surface.js.map +1 -1
- package/dist/figma-api/transform.d.ts +1 -1
- package/dist/figma-api/variables/index.d.ts.map +1 -1
- package/dist/figma-api/variables/index.js +2 -2
- package/dist/figma-api/variables/index.js.map +1 -1
- package/dist/geometry/figma.d.ts +1 -1
- package/dist/geometry/image-crop.d.ts +1 -1
- package/dist/geometry/image-crop.js +1 -1
- package/dist/index.d.ts +4 -2
- package/dist/index.js +4 -2
- package/dist/io/formats/boolean-path.d.ts +19 -0
- package/dist/io/formats/boolean-path.d.ts.map +1 -0
- package/dist/io/formats/boolean-path.js +47 -0
- package/dist/io/formats/boolean-path.js.map +1 -0
- package/dist/io/formats/design-tokens/css/known.js +1 -1
- package/dist/io/formats/design-tokens/css/known.js.map +1 -1
- package/dist/io/formats/design-tokens/css/read.d.ts +3 -1
- package/dist/io/formats/design-tokens/css/read.d.ts.map +1 -1
- package/dist/io/formats/design-tokens/css/read.js +11 -5
- package/dist/io/formats/design-tokens/css/read.js.map +1 -1
- package/dist/io/formats/design-tokens/css/sync.d.ts.map +1 -1
- package/dist/io/formats/design-tokens/css/sync.js +17 -4
- package/dist/io/formats/design-tokens/css/sync.js.map +1 -1
- package/dist/io/formats/design-tokens/css/values.d.ts +6 -5
- package/dist/io/formats/design-tokens/css/values.d.ts.map +1 -1
- package/dist/io/formats/design-tokens/css/values.js +24 -8
- package/dist/io/formats/design-tokens/css/values.js.map +1 -1
- package/dist/io/formats/design-tokens/decode.d.ts +7 -6
- package/dist/io/formats/design-tokens/decode.d.ts.map +1 -1
- package/dist/io/formats/design-tokens/decode.js +14 -13
- package/dist/io/formats/design-tokens/decode.js.map +1 -1
- package/dist/io/formats/design-tokens/export.js +3 -3
- package/dist/io/formats/design-tokens/export.js.map +1 -1
- package/dist/io/formats/design-tokens/index.d.ts +4 -1
- package/dist/io/formats/design-tokens/index.js +4 -1
- package/dist/io/formats/design-tokens/plan/changes.d.ts +5 -3
- package/dist/io/formats/design-tokens/plan/changes.d.ts.map +1 -1
- package/dist/io/formats/design-tokens/plan/changes.js +1 -1
- package/dist/io/formats/design-tokens/plan/changes.js.map +1 -1
- package/dist/io/formats/design-tokens/plan/index.d.ts.map +1 -1
- package/dist/io/formats/design-tokens/plan/index.js +4 -3
- package/dist/io/formats/design-tokens/plan/index.js.map +1 -1
- package/dist/io/formats/design-tokens/plan/styles.d.ts.map +1 -1
- package/dist/io/formats/design-tokens/plan/styles.js +9 -9
- package/dist/io/formats/design-tokens/plan/styles.js.map +1 -1
- package/dist/io/formats/design-tokens/project.d.ts +17 -2
- package/dist/io/formats/design-tokens/project.d.ts.map +1 -1
- package/dist/io/formats/design-tokens/project.js +29 -8
- package/dist/io/formats/design-tokens/project.js.map +1 -1
- package/dist/io/formats/design-tokens/styles.d.ts +4 -4
- package/dist/io/formats/design-tokens/styles.d.ts.map +1 -1
- package/dist/io/formats/design-tokens/styles.js +7 -7
- package/dist/io/formats/design-tokens/styles.js.map +1 -1
- package/dist/io/formats/design-tokens/sync/apply.d.ts +42 -0
- package/dist/io/formats/design-tokens/sync/apply.d.ts.map +1 -0
- package/dist/io/formats/design-tokens/sync/apply.js +73 -0
- package/dist/io/formats/design-tokens/sync/apply.js.map +1 -0
- package/dist/io/formats/design-tokens/sync/drift.d.ts +77 -0
- package/dist/io/formats/design-tokens/sync/drift.d.ts.map +1 -0
- package/dist/io/formats/design-tokens/sync/drift.js +391 -0
- package/dist/io/formats/design-tokens/sync/drift.js.map +1 -0
- package/dist/io/formats/design-tokens/sync/files.d.ts +15 -0
- package/dist/io/formats/design-tokens/sync/files.d.ts.map +1 -0
- package/dist/io/formats/design-tokens/sync/files.js +35 -0
- package/dist/io/formats/design-tokens/sync/files.js.map +1 -0
- package/dist/io/formats/design-tokens/values.d.ts +10 -5
- package/dist/io/formats/design-tokens/values.d.ts.map +1 -1
- package/dist/io/formats/design-tokens/values.js +13 -7
- package/dist/io/formats/design-tokens/values.js.map +1 -1
- package/dist/io/formats/drawio/edges.d.ts +7 -1
- package/dist/io/formats/drawio/edges.d.ts.map +1 -1
- package/dist/io/formats/drawio/edges.js +54 -1
- package/dist/io/formats/drawio/edges.js.map +1 -1
- package/dist/io/formats/drawio/export.d.ts.map +1 -1
- package/dist/io/formats/drawio/export.js +19 -2
- package/dist/io/formats/drawio/export.js.map +1 -1
- package/dist/io/formats/drawio/index.js +1 -0
- package/dist/io/formats/drawio/index.js.map +1 -1
- package/dist/io/formats/drawio/placement.d.ts +1 -1
- package/dist/io/formats/drawio/warnings.js +2 -2
- package/dist/io/formats/drawio/warnings.js.map +1 -1
- package/dist/io/formats/fig/export/index.d.ts.map +1 -1
- package/dist/io/formats/fig/export/index.js +15 -3
- package/dist/io/formats/fig/export/index.js.map +1 -1
- package/dist/io/formats/fig/export/patch/index.d.ts.map +1 -1
- package/dist/io/formats/fig/export/patch/index.js +7 -1
- package/dist/io/formats/fig/export/patch/index.js.map +1 -1
- package/dist/io/formats/fig/export/setup.d.ts +7 -2
- package/dist/io/formats/fig/export/setup.d.ts.map +1 -1
- package/dist/io/formats/fig/export/setup.js +12 -13
- package/dist/io/formats/fig/export/setup.js.map +1 -1
- package/dist/io/formats/fig/export/variables.d.ts.map +1 -1
- package/dist/io/formats/fig/export/variables.js +9 -7
- package/dist/io/formats/fig/export/variables.js.map +1 -1
- package/dist/io/formats/fig/thumbnail-page.d.ts +3 -4
- package/dist/io/formats/fig/thumbnail-page.d.ts.map +1 -1
- package/dist/io/formats/fig/thumbnail-page.js.map +1 -1
- package/dist/io/formats/html/import.d.ts.map +1 -1
- package/dist/io/formats/html/import.js +3 -1
- package/dist/io/formats/html/import.js.map +1 -1
- package/dist/io/formats/html/index.d.ts +2 -2
- package/dist/io/formats/html/index.d.ts.map +1 -1
- package/dist/io/formats/html/index.js +6 -4
- package/dist/io/formats/html/index.js.map +1 -1
- package/dist/io/formats/html/vectors.d.ts +2 -1
- package/dist/io/formats/html/vectors.d.ts.map +1 -1
- package/dist/io/formats/html/vectors.js +4 -2
- package/dist/io/formats/html/vectors.js.map +1 -1
- package/dist/io/formats/mermaid/layers.js +2 -2
- package/dist/io/formats/mermaid/layers.js.map +1 -1
- package/dist/io/formats/pdf/document.d.ts +3 -1
- package/dist/io/formats/pdf/document.d.ts.map +1 -1
- package/dist/io/formats/pdf/document.js +6 -3
- package/dist/io/formats/pdf/document.js.map +1 -1
- package/dist/io/formats/pdf/export.d.ts.map +1 -1
- package/dist/io/formats/pdf/export.js +1 -0
- package/dist/io/formats/pdf/export.js.map +1 -1
- package/dist/io/formats/pdf/prepare.d.ts +4 -4
- package/dist/io/formats/pdf/prepare.d.ts.map +1 -1
- package/dist/io/formats/pdf/prepare.js +2 -2
- package/dist/io/formats/pdf/prepare.js.map +1 -1
- package/dist/io/formats/pen/imports.d.ts +4 -1
- package/dist/io/formats/pen/imports.d.ts.map +1 -1
- package/dist/io/formats/pen/imports.js.map +1 -1
- package/dist/io/formats/pen/index.d.ts.map +1 -1
- package/dist/io/formats/pen/index.js +35 -5
- package/dist/io/formats/pen/index.js.map +1 -1
- package/dist/io/formats/pptx/export.js +1 -1
- package/dist/io/formats/pptx/geometry.d.ts +1 -1
- package/dist/io/formats/pptx/style.js +1 -1
- package/dist/io/formats/raster/adjusted-images.d.ts +15 -0
- package/dist/io/formats/raster/adjusted-images.d.ts.map +1 -0
- package/dist/io/formats/raster/adjusted-images.js +118 -0
- package/dist/io/formats/raster/adjusted-images.js.map +1 -0
- package/dist/io/formats/raster/headless.d.ts +11 -1
- package/dist/io/formats/raster/headless.d.ts.map +1 -1
- package/dist/io/formats/raster/headless.js +4 -4
- package/dist/io/formats/raster/headless.js.map +1 -1
- package/dist/io/formats/raster/index.d.ts +2 -2
- package/dist/io/formats/raster/pixels.d.ts +7 -1
- package/dist/io/formats/raster/pixels.d.ts.map +1 -1
- package/dist/io/formats/raster/pixels.js.map +1 -1
- package/dist/io/formats/raster/render.d.ts +1 -1
- package/dist/io/formats/raster/render.d.ts.map +1 -1
- package/dist/io/formats/raster/render.js +13 -4
- package/dist/io/formats/raster/render.js.map +1 -1
- package/dist/io/formats/svg/defs.d.ts +10 -8
- package/dist/io/formats/svg/defs.d.ts.map +1 -1
- package/dist/io/formats/svg/defs.js +13 -64
- package/dist/io/formats/svg/defs.js.map +1 -1
- package/dist/io/formats/svg/effects.d.ts +16 -0
- package/dist/io/formats/svg/effects.d.ts.map +1 -0
- package/dist/io/formats/svg/effects.js +126 -0
- package/dist/io/formats/svg/effects.js.map +1 -0
- package/dist/io/formats/svg/export.d.ts +11 -2
- package/dist/io/formats/svg/export.d.ts.map +1 -1
- package/dist/io/formats/svg/export.js +177 -37
- package/dist/io/formats/svg/export.js.map +1 -1
- package/dist/io/formats/svg/filter.d.ts +30 -0
- package/dist/io/formats/svg/filter.d.ts.map +1 -0
- package/dist/io/formats/svg/filter.js +48 -0
- package/dist/io/formats/svg/filter.js.map +1 -0
- package/dist/io/formats/svg/grain.d.ts +26 -0
- package/dist/io/formats/svg/grain.d.ts.map +1 -0
- package/dist/io/formats/svg/grain.js +298 -0
- package/dist/io/formats/svg/grain.js.map +1 -0
- package/dist/io/formats/svg/import.d.ts +4 -2
- package/dist/io/formats/svg/import.d.ts.map +1 -1
- package/dist/io/formats/svg/import.js +2 -1
- package/dist/io/formats/svg/import.js.map +1 -1
- package/dist/io/formats/svg/strokes.d.ts +1 -1
- package/dist/io/formats/svg/strokes.d.ts.map +1 -1
- package/dist/io/formats/svg/strokes.js +1 -2
- package/dist/io/formats/svg/strokes.js.map +1 -1
- package/dist/io/formats/svg/text/export.d.ts.map +1 -1
- package/dist/io/formats/svg/text/export.js +8 -8
- package/dist/io/formats/svg/text/export.js.map +1 -1
- package/dist/io/formats/svg/text/import.js +1 -1
- package/dist/io/formats/svg/text/layout.d.ts +5 -2
- package/dist/io/formats/svg/text/layout.d.ts.map +1 -1
- package/dist/io/formats/svg/text/layout.js +8 -5
- package/dist/io/formats/svg/text/layout.js.map +1 -1
- package/dist/io/formats/video/composite.d.ts +18 -0
- package/dist/io/formats/video/composite.d.ts.map +1 -0
- package/dist/io/formats/video/composite.js +79 -0
- package/dist/io/formats/video/composite.js.map +1 -0
- package/dist/io/formats/video/formats.d.ts +29 -0
- package/dist/io/formats/video/formats.d.ts.map +1 -0
- package/dist/io/formats/video/formats.js +43 -0
- package/dist/io/formats/video/formats.js.map +1 -0
- package/dist/io/formats/video/gif.d.ts +13 -0
- package/dist/io/formats/video/gif.d.ts.map +1 -0
- package/dist/io/formats/video/gif.js +56 -0
- package/dist/io/formats/video/gif.js.map +1 -0
- package/dist/io/formats/video/index.d.ts +9 -0
- package/dist/io/formats/video/index.js +9 -0
- package/dist/io/formats/video/plan.d.ts +64 -0
- package/dist/io/formats/video/plan.d.ts.map +1 -0
- package/dist/io/formats/video/plan.js +90 -0
- package/dist/io/formats/video/plan.js.map +1 -0
- package/dist/io/formats/video/record.d.ts +36 -0
- package/dist/io/formats/video/record.d.ts.map +1 -0
- package/dist/io/formats/video/record.js +154 -0
- package/dist/io/formats/video/record.js.map +1 -0
- package/dist/io/formats/video/sink.d.ts +29 -0
- package/dist/io/formats/video/sink.d.ts.map +1 -0
- package/dist/io/formats/video/sink.js +16 -0
- package/dist/io/formats/video/sink.js.map +1 -0
- package/dist/io/formats/video/size.d.ts +19 -0
- package/dist/io/formats/video/size.d.ts.map +1 -0
- package/dist/io/formats/video/size.js +26 -0
- package/dist/io/formats/video/size.js.map +1 -0
- package/dist/io/formats/video/webcodecs.d.ts +18 -0
- package/dist/io/formats/video/webcodecs.d.ts.map +1 -0
- package/dist/io/formats/video/webcodecs.js +74 -0
- package/dist/io/formats/video/webcodecs.js.map +1 -0
- package/dist/io/formats.d.ts.map +1 -1
- package/dist/io/formats.js +41 -11
- package/dist/io/formats.js.map +1 -1
- package/dist/io/subgraph.d.ts.map +1 -1
- package/dist/io/subgraph.js +1 -1
- package/dist/io/subgraph.js.map +1 -1
- package/dist/io/types.d.ts +20 -5
- package/dist/io/types.d.ts.map +1 -1
- package/dist/kiwi/fig/parse/transfer.d.ts +1 -1
- package/dist/kiwi/fig/session/options.d.ts +3 -0
- package/dist/kiwi/fig/session/options.d.ts.map +1 -1
- package/dist/kiwi/fig/session/options.js +4 -0
- package/dist/kiwi/fig/session/options.js.map +1 -1
- package/dist/layout/auto-layout-handles.d.ts +66 -0
- package/dist/layout/auto-layout-handles.d.ts.map +1 -0
- package/dist/layout/auto-layout-handles.js +291 -0
- package/dist/layout/auto-layout-handles.js.map +1 -0
- package/dist/layout/yoga-helpers.d.ts +2 -1
- package/dist/layout/yoga-helpers.d.ts.map +1 -1
- package/dist/layout/yoga-helpers.js +7 -1
- package/dist/layout/yoga-helpers.js.map +1 -1
- package/dist/layout.d.ts +3 -2
- package/dist/layout.d.ts.map +1 -1
- package/dist/layout.js +26 -2
- package/dist/layout.js.map +1 -1
- package/dist/lint/fixes.d.ts.map +1 -1
- package/dist/lint/fixes.js +10 -4
- package/dist/lint/fixes.js.map +1 -1
- package/dist/lint/index.d.ts +3 -2
- package/dist/lint/index.js +2 -1
- package/dist/lint/linter.d.ts +12 -0
- package/dist/lint/linter.d.ts.map +1 -1
- package/dist/lint/linter.js +112 -10
- package/dist/lint/linter.js.map +1 -1
- package/dist/lint/presets.d.ts.map +1 -1
- package/dist/lint/presets.js +2 -0
- package/dist/lint/presets.js.map +1 -1
- package/dist/lint/rules/design-memory.d.ts +15 -0
- package/dist/lint/rules/design-memory.d.ts.map +1 -0
- package/dist/lint/rules/design-memory.js +90 -0
- package/dist/lint/rules/design-memory.js.map +1 -0
- package/dist/lint/rules/index.d.ts +6 -5
- package/dist/lint/rules/index.d.ts.map +1 -1
- package/dist/lint/rules/index.js +6 -2
- package/dist/lint/rules/index.js.map +1 -1
- package/dist/lint/rules/no-unbound-token-values.d.ts +6 -0
- package/dist/lint/rules/no-unbound-token-values.d.ts.map +1 -0
- package/dist/lint/rules/no-unbound-token-values.js +79 -0
- package/dist/lint/rules/no-unbound-token-values.js.map +1 -0
- package/dist/lint/types.d.ts +25 -2
- package/dist/lint/types.d.ts.map +1 -1
- package/dist/node/video.d.ts +12 -0
- package/dist/node/video.d.ts.map +1 -0
- package/dist/node/video.js +206 -0
- package/dist/node/video.js.map +1 -0
- package/dist/pairdraw-api/comments.d.ts +4 -1
- package/dist/pairdraw-api/comments.d.ts.map +1 -1
- package/dist/pairdraw-api/comments.js +5 -0
- package/dist/pairdraw-api/comments.js.map +1 -1
- package/dist/pairdraw-api/design-memory.d.ts +19 -0
- package/dist/pairdraw-api/design-memory.d.ts.map +1 -0
- package/dist/pairdraw-api/design-memory.js +39 -0
- package/dist/pairdraw-api/design-memory.js.map +1 -0
- package/dist/pairdraw-api/index.d.ts +48 -4
- package/dist/pairdraw-api/index.d.ts.map +1 -1
- package/dist/pairdraw-api/index.js +59 -6
- package/dist/pairdraw-api/index.js.map +1 -1
- package/dist/pairdraw-api/nodes.d.ts +13 -2
- package/dist/pairdraw-api/nodes.d.ts.map +1 -1
- package/dist/pairdraw-api/nodes.js +28 -1
- package/dist/pairdraw-api/nodes.js.map +1 -1
- package/dist/pairdraw-api/variations.d.ts +48 -0
- package/dist/pairdraw-api/variations.d.ts.map +1 -0
- package/dist/pairdraw-api/variations.js +76 -0
- package/dist/pairdraw-api/variations.js.map +1 -0
- package/dist/prototype/easing.d.ts +13 -0
- package/dist/prototype/easing.d.ts.map +1 -0
- package/dist/prototype/easing.js +36 -0
- package/dist/prototype/easing.js.map +1 -0
- package/dist/prototype/frames.d.ts +10 -0
- package/dist/prototype/frames.d.ts.map +1 -0
- package/dist/prototype/frames.js +12 -0
- package/dist/prototype/frames.js.map +1 -0
- package/dist/prototype/hit.d.ts +17 -0
- package/dist/prototype/hit.d.ts.map +1 -0
- package/dist/prototype/hit.js +45 -0
- package/dist/prototype/hit.js.map +1 -0
- package/dist/prototype/index.d.ts +14 -0
- package/dist/prototype/index.js +14 -0
- package/dist/prototype/pointer.d.ts +63 -0
- package/dist/prototype/pointer.d.ts.map +1 -0
- package/dist/prototype/pointer.js +104 -0
- package/dist/prototype/pointer.js.map +1 -0
- package/dist/prototype/reactions.d.ts +45 -0
- package/dist/prototype/reactions.d.ts.map +1 -0
- package/dist/prototype/reactions.js +122 -0
- package/dist/prototype/reactions.js.map +1 -0
- package/dist/prototype/scene.d.ts +35 -0
- package/dist/prototype/scene.d.ts.map +1 -0
- package/dist/prototype/scene.js +86 -0
- package/dist/prototype/scene.js.map +1 -0
- package/dist/prototype/scenes.d.ts +81 -0
- package/dist/prototype/scenes.d.ts.map +1 -0
- package/dist/prototype/scenes.js +175 -0
- package/dist/prototype/scenes.js.map +1 -0
- package/dist/prototype/scroll.d.ts +48 -0
- package/dist/prototype/scroll.d.ts.map +1 -0
- package/dist/prototype/scroll.js +159 -0
- package/dist/prototype/scroll.js.map +1 -0
- package/dist/prototype/session.d.ts +71 -0
- package/dist/prototype/session.d.ts.map +1 -0
- package/dist/prototype/session.js +135 -0
- package/dist/prototype/session.js.map +1 -0
- package/dist/prototype/smart-animate/animation.d.ts +34 -0
- package/dist/prototype/smart-animate/animation.d.ts.map +1 -0
- package/dist/prototype/smart-animate/animation.js +212 -0
- package/dist/prototype/smart-animate/animation.js.map +1 -0
- package/dist/prototype/smart-animate/match.d.ts +24 -0
- package/dist/prototype/smart-animate/match.d.ts.map +1 -0
- package/dist/prototype/smart-animate/match.js +72 -0
- package/dist/prototype/smart-animate/match.js.map +1 -0
- package/dist/prototype/snapshot.d.ts +19 -0
- package/dist/prototype/snapshot.d.ts.map +1 -0
- package/dist/prototype/snapshot.js +56 -0
- package/dist/prototype/snapshot.js.map +1 -0
- package/dist/prototype/timeline.d.ts +132 -0
- package/dist/prototype/timeline.d.ts.map +1 -0
- package/dist/prototype/timeline.js +260 -0
- package/dist/prototype/timeline.js.map +1 -0
- package/dist/rpc/analyze-commands.js +1 -1
- package/dist/rpc/read-commands.d.ts +2 -2
- package/dist/rpc/read-commands.js +2 -2
- package/dist/rpc/read-commands.js.map +1 -1
- package/dist/rpc/variables-command.js +2 -2
- package/dist/rpc/variables-command.js.map +1 -1
- package/dist/text/font/features.d.ts +9 -0
- package/dist/text/font/features.d.ts.map +1 -0
- package/dist/text/font/features.js +27 -0
- package/dist/text/font/features.js.map +1 -0
- package/dist/text/font/manager.d.ts +12 -0
- package/dist/text/font/manager.d.ts.map +1 -1
- package/dist/text/font/manager.js +60 -1
- package/dist/text/font/manager.js.map +1 -1
- package/dist/text/font/provider.d.ts +15 -0
- package/dist/text/font/provider.d.ts.map +1 -0
- package/dist/text/font/provider.js +18 -0
- package/dist/text/font/provider.js.map +1 -0
- package/dist/text/font/readiness.d.ts +32 -0
- package/dist/text/font/readiness.d.ts.map +1 -0
- package/dist/text/font/{status.js → readiness.js} +8 -4
- package/dist/text/font/readiness.js.map +1 -0
- package/dist/text/index.d.ts +12 -9
- package/dist/text/index.js +6 -3
- package/dist/text/prepare.d.ts +9 -4
- package/dist/text/prepare.d.ts.map +1 -1
- package/dist/text/prepare.js +9 -4
- package/dist/text/prepare.js.map +1 -1
- package/dist/text/replace-fonts.d.ts +41 -0
- package/dist/text/replace-fonts.d.ts.map +1 -0
- package/dist/text/replace-fonts.js +121 -0
- package/dist/text/replace-fonts.js.map +1 -0
- package/dist/tools/analyze/colors.js +1 -1
- package/dist/tools/analyze/responsive/index.d.ts +15 -0
- package/dist/tools/analyze/responsive/index.d.ts.map +1 -0
- package/dist/tools/analyze/responsive/index.js +192 -0
- package/dist/tools/analyze/responsive/index.js.map +1 -0
- package/dist/tools/analyze/responsive/widths.d.ts +27 -0
- package/dist/tools/analyze/responsive/widths.d.ts.map +1 -0
- package/dist/tools/analyze/responsive/widths.js +49 -0
- package/dist/tools/analyze/responsive/widths.js.map +1 -0
- package/dist/tools/analyze.d.ts +3 -1
- package/dist/tools/analyze.js +3 -1
- package/dist/tools/codegen/token-sync.d.ts +7 -0
- package/dist/tools/codegen/token-sync.d.ts.map +1 -0
- package/dist/tools/codegen/token-sync.js +85 -0
- package/dist/tools/codegen/token-sync.js.map +1 -0
- package/dist/tools/codegen/tokens.d.ts +1 -1
- package/dist/tools/codegen/tokens.d.ts.map +1 -1
- package/dist/tools/codegen/tokens.js +2 -2
- package/dist/tools/codegen/tokens.js.map +1 -1
- package/dist/tools/codegen.d.ts +2 -1
- package/dist/tools/codegen.js +2 -1
- package/dist/tools/comments.d.ts.map +1 -1
- package/dist/tools/comments.js +2 -2
- package/dist/tools/comments.js.map +1 -1
- package/dist/tools/component-catalog.d.ts.map +1 -1
- package/dist/tools/component-catalog.js +5 -3
- package/dist/tools/component-catalog.js.map +1 -1
- package/dist/tools/create/components.d.ts.map +1 -1
- package/dist/tools/create/components.js +4 -0
- package/dist/tools/create/components.js.map +1 -1
- package/dist/tools/create/html.d.ts.map +1 -1
- package/dist/tools/create/html.js +2 -3
- package/dist/tools/create/html.js.map +1 -1
- package/dist/tools/create/icons.d.ts.map +1 -1
- package/dist/tools/create/icons.js +2 -1
- package/dist/tools/create/icons.js.map +1 -1
- package/dist/tools/create/mermaid.js +1 -0
- package/dist/tools/create/mermaid.js.map +1 -1
- package/dist/tools/create/svg.js +5 -1
- package/dist/tools/create/svg.js.map +1 -1
- package/dist/tools/create/vector.js +2 -2
- package/dist/tools/create/vector.js.map +1 -1
- package/dist/tools/css/shorthand.d.ts +20 -0
- package/dist/tools/css/shorthand.d.ts.map +1 -0
- package/dist/tools/css/shorthand.js +54 -0
- package/dist/tools/css/shorthand.js.map +1 -0
- package/dist/tools/describe/index.js +2 -2
- package/dist/tools/describe/index.js.map +1 -1
- package/dist/tools/describe/issues.js +1 -1
- package/dist/tools/design-memory.d.ts +8 -0
- package/dist/tools/design-memory.d.ts.map +1 -0
- package/dist/tools/design-memory.js +68 -0
- package/dist/tools/design-memory.js.map +1 -0
- package/dist/tools/html-host.d.ts.map +1 -1
- package/dist/tools/html-host.js +5 -3
- package/dist/tools/html-host.js.map +1 -1
- package/dist/tools/image-ai/apply.d.ts.map +1 -1
- package/dist/tools/image-ai/apply.js +1 -3
- package/dist/tools/image-ai/apply.js.map +1 -1
- package/dist/tools/image-ai/generate.d.ts.map +1 -1
- package/dist/tools/image-ai/generate.js +2 -0
- package/dist/tools/image-ai/generate.js.map +1 -1
- package/dist/tools/image-ai/service.d.ts.map +1 -1
- package/dist/tools/image-ai/service.js +5 -3
- package/dist/tools/image-ai/service.js.map +1 -1
- package/dist/tools/index.d.ts +3 -1
- package/dist/tools/index.js +3 -1
- package/dist/tools/modify/effects.js +1 -1
- package/dist/tools/modify/effects.js.map +1 -1
- package/dist/tools/modify/fonts.d.ts +6 -0
- package/dist/tools/modify/fonts.d.ts.map +1 -0
- package/dist/tools/modify/fonts.js +27 -0
- package/dist/tools/modify/fonts.js.map +1 -0
- package/dist/tools/modify/geometry.d.ts.map +1 -1
- package/dist/tools/modify/geometry.js +14 -3
- package/dist/tools/modify/geometry.js.map +1 -1
- package/dist/tools/modify/layout.d.ts.map +1 -1
- package/dist/tools/modify/layout.js +35 -8
- package/dist/tools/modify/layout.js.map +1 -1
- package/dist/tools/modify/matching.d.ts.map +1 -1
- package/dist/tools/modify/matching.js +10 -10
- package/dist/tools/modify/matching.js.map +1 -1
- package/dist/tools/modify/paint.d.ts.map +1 -1
- package/dist/tools/modify/paint.js +56 -4
- package/dist/tools/modify/paint.js.map +1 -1
- package/dist/tools/modify/reactions.d.ts.map +1 -1
- package/dist/tools/modify/reactions.js +2 -2
- package/dist/tools/modify/reactions.js.map +1 -1
- package/dist/tools/modify/text.d.ts.map +1 -1
- package/dist/tools/modify/text.js +29 -8
- package/dist/tools/modify/text.js.map +1 -1
- package/dist/tools/modify/update.d.ts +10 -1
- package/dist/tools/modify/update.d.ts.map +1 -1
- package/dist/tools/modify/update.js +34 -3
- package/dist/tools/modify/update.js.map +1 -1
- package/dist/tools/modify.d.ts +2 -1
- package/dist/tools/modify.js +2 -1
- package/dist/tools/prompts/codegen.js +1 -1
- package/dist/tools/prompts/codegen.js.map +1 -1
- package/dist/tools/read/css.d.ts +14 -0
- package/dist/tools/read/css.d.ts.map +1 -0
- package/dist/tools/read/css.js +306 -0
- package/dist/tools/read/css.js.map +1 -0
- package/dist/tools/read/fonts.d.ts.map +1 -1
- package/dist/tools/read/fonts.js +17 -2
- package/dist/tools/read/fonts.js.map +1 -1
- package/dist/tools/read/libraries.js +1 -0
- package/dist/tools/read/libraries.js.map +1 -1
- package/dist/tools/read/reactions.js +1 -1
- package/dist/tools/read/reactions.js.map +1 -1
- package/dist/tools/read/space.d.ts +3 -1
- package/dist/tools/read/space.d.ts.map +1 -1
- package/dist/tools/read/space.js +4 -5
- package/dist/tools/read/space.js.map +1 -1
- package/dist/tools/read.d.ts +2 -1
- package/dist/tools/read.js +2 -1
- package/dist/tools/registry/core.d.ts +1 -1
- package/dist/tools/registry/core.d.ts.map +1 -1
- package/dist/tools/registry/core.js +5 -1
- package/dist/tools/registry/core.js.map +1 -1
- package/dist/tools/registry/extended.d.ts.map +1 -1
- package/dist/tools/registry/extended.js +16 -1
- package/dist/tools/registry/extended.js.map +1 -1
- package/dist/tools/schema.d.ts +24 -6
- package/dist/tools/schema.d.ts.map +1 -1
- package/dist/tools/schema.js +10 -6
- package/dist/tools/schema.js.map +1 -1
- package/dist/tools/script/host.d.ts.map +1 -1
- package/dist/tools/script/host.js +5 -3
- package/dist/tools/script/host.js.map +1 -1
- package/dist/tools/stock-photo.js +1 -0
- package/dist/tools/stock-photo.js.map +1 -1
- package/dist/tools/structure/basic.d.ts.map +1 -1
- package/dist/tools/structure/basic.js +1 -0
- package/dist/tools/structure/basic.js.map +1 -1
- package/dist/tools/structure/batch.d.ts.map +1 -1
- package/dist/tools/structure/batch.js +8 -1
- package/dist/tools/structure/batch.js.map +1 -1
- package/dist/tools/structure/hierarchy.d.ts.map +1 -1
- package/dist/tools/structure/hierarchy.js +4 -0
- package/dist/tools/structure/hierarchy.js.map +1 -1
- package/dist/tools/structure/variations.d.ts +8 -0
- package/dist/tools/structure/variations.d.ts.map +1 -0
- package/dist/tools/structure/variations.js +106 -0
- package/dist/tools/structure/variations.js.map +1 -0
- package/dist/tools/structure.d.ts +2 -1
- package/dist/tools/structure.js +2 -1
- package/dist/tools/styles/types.d.ts +2 -4
- package/dist/tools/styles/types.d.ts.map +1 -1
- package/dist/tools/styles/types.js.map +1 -1
- package/dist/tools/variables/collections.js +1 -1
- package/dist/tools/variables/collections.js.map +1 -1
- package/dist/tools/variables/values.d.ts.map +1 -1
- package/dist/tools/variables/values.js +4 -4
- package/dist/tools/variables/values.js.map +1 -1
- package/dist/tools/vector/boolean.d.ts.map +1 -1
- package/dist/tools/vector/boolean.js +4 -0
- package/dist/tools/vector/boolean.js.map +1 -1
- package/dist/tools/vector/vectorize.d.ts.map +1 -1
- package/dist/tools/vector/vectorize.js +7 -4
- package/dist/tools/vector/vectorize.js.map +1 -1
- package/dist/tools/vector/video.d.ts +6 -0
- package/dist/tools/vector/video.d.ts.map +1 -0
- package/dist/tools/vector/video.js +133 -0
- package/dist/tools/vector/video.js.map +1 -0
- package/dist/tools/vector.d.ts +2 -1
- package/dist/tools/vector.js +2 -1
- package/dist/tools/video-host.d.ts +12 -0
- package/dist/tools/video-host.d.ts.map +1 -0
- package/dist/tools/video-host.js +21 -0
- package/dist/tools/video-host.js.map +1 -0
- package/dist/vector/point-transform.d.ts +1 -1
- package/dist/vector/vectorize/svg/gradients.d.ts +2 -2
- package/dist/vector/vectorize/svg/gradients.d.ts.map +1 -1
- package/dist/vector/vectorize/svg/gradients.js +5 -5
- package/dist/vector/vectorize/svg/gradients.js.map +1 -1
- package/dist/vector/vectorize/svg/to-vectors.d.ts +3 -1
- package/dist/vector/vectorize/svg/to-vectors.d.ts.map +1 -1
- package/dist/vector/vectorize/svg/to-vectors.js +13 -12
- package/dist/vector/vectorize/svg/to-vectors.js.map +1 -1
- package/package.json +31 -9
- package/src/ai/providers.ts +2 -0
- package/src/cache/resource.ts +24 -1
- package/src/canvas/effects.ts +47 -50
- package/src/canvas/fills.ts +19 -15
- package/src/canvas/images/adjustments.ts +203 -0
- package/src/canvas/images/sampling.ts +88 -0
- package/src/canvas/index.ts +1 -0
- package/src/canvas/masks.ts +1 -1
- package/src/canvas/noise/render.ts +75 -0
- package/src/canvas/noise/shader.ts +169 -0
- package/src/canvas/noise/table.ts +91 -0
- package/src/canvas/noise/tile.ts +95 -0
- package/src/canvas/overlays/auto-layout-hover.ts +47 -65
- package/src/canvas/renderer/colors.ts +76 -50
- package/src/canvas/renderer/document-surface.ts +53 -0
- package/src/canvas/renderer/fonts.ts +6 -4
- package/src/canvas/renderer/lifecycle.ts +10 -4
- package/src/canvas/renderer/methods.ts +1 -0
- package/src/canvas/renderer/pipeline.ts +40 -4
- package/src/canvas/renderer/play-scenes.ts +51 -0
- package/src/canvas/renderer/retained-backing.ts +2 -1
- package/src/canvas/renderer/tiles/cache.ts +54 -1
- package/src/canvas/renderer/tiles/controller.ts +30 -1
- package/src/canvas/renderer/tiles/surface-pool.ts +9 -7
- package/src/canvas/renderer/types.ts +18 -2
- package/src/canvas/renderer.ts +76 -14
- package/src/canvas/scene.ts +69 -12
- package/src/canvas/shaders/effect.ts +2 -1
- package/src/canvas/shadows/shape.ts +4 -2
- package/src/canvas/shadows.ts +5 -2
- package/src/canvas/text/decorations.ts +15 -5
- package/src/canvas/text/index.ts +9 -1
- package/src/canvas/text/paragraph/index.ts +16 -6
- package/src/canvas/text/renderer.ts +2 -1
- package/src/canvas/text/shape.ts +4 -4
- package/src/canvas/texture.ts +137 -0
- package/src/clipboard.ts +23 -10
- package/src/constants.ts +6 -0
- package/src/design-memory/check.ts +376 -0
- package/src/design-memory/describe.ts +77 -0
- package/src/design-memory/distil.ts +69 -0
- package/src/design-memory/document.ts +80 -0
- package/src/design-memory/guard.ts +157 -0
- package/src/design-memory/index.ts +8 -0
- package/src/design-memory/refusal.ts +90 -0
- package/src/design-memory/rules.ts +274 -0
- package/src/design-memory/values.ts +179 -0
- package/src/editor/bridges/components.ts +2 -0
- package/src/editor/clipboard/assets.ts +6 -2
- package/src/editor/clipboard/component-matches.ts +65 -0
- package/src/editor/clipboard/dependencies.ts +22 -1
- package/src/editor/clipboard/export.ts +24 -7
- package/src/editor/clipboard.ts +74 -20
- package/src/editor/components/instances.ts +31 -0
- package/src/editor/components/properties.ts +3 -2
- package/src/editor/create.ts +25 -69
- package/src/editor/design-memory.ts +39 -0
- package/src/editor/design-tokens.ts +41 -2
- package/src/editor/document-colors.ts +65 -0
- package/src/editor/eyedropper.ts +208 -0
- package/src/editor/fonts.ts +19 -0
- package/src/editor/history/atomic-tool.ts +32 -3
- package/src/editor/history/capture.ts +19 -0
- package/src/editor/history/document-change.ts +5 -17
- package/src/editor/history/edit.ts +11 -1
- package/src/editor/history/subtree.ts +13 -2
- package/src/editor/index.ts +11 -0
- package/src/editor/pages.ts +40 -29
- package/src/editor/play/states.ts +1 -1
- package/src/editor/read-only/actions.ts +4 -0
- package/src/editor/render-requests.ts +83 -0
- package/src/editor/selection/overlays.ts +1 -0
- package/src/editor/structure/state.ts +2 -1
- package/src/editor/text.ts +2 -1
- package/src/editor/tool-registry.ts +2 -1
- package/src/editor/types.ts +4 -0
- package/src/editor/variables.ts +3 -3
- package/src/editor/variations/create.ts +235 -0
- package/src/editor/variations/pick.ts +35 -0
- package/src/editor/variations.ts +110 -0
- package/src/figma-api/accessors/reactions.ts +11 -1
- package/src/figma-api/accessors/text/index.ts +7 -0
- package/src/figma-api/accessors/text/opentype.ts +33 -0
- package/src/figma-api/accessors/visual.ts +55 -2
- package/src/figma-api/compatibility.ts +5 -2
- package/src/figma-api/effects.ts +143 -5
- package/src/figma-api/fresh-read.ts +57 -0
- package/src/figma-api/graph-ref.ts +13 -0
- package/src/figma-api/index.ts +22 -4
- package/src/figma-api/overrides.ts +295 -3
- package/src/figma-api/paints.ts +24 -9
- package/src/figma-api/pending-layout.ts +7 -3
- package/src/figma-api/pending-sync.ts +4 -1
- package/src/figma-api/proxy.ts +8 -2
- package/src/figma-api/reactions.ts +212 -33
- package/src/figma-api/surface.ts +6 -2
- package/src/figma-api/variables/index.ts +5 -4
- package/src/global.d.ts +26 -0
- package/src/io/formats/boolean-path.ts +60 -0
- package/src/io/formats/design-tokens/css/known.ts +1 -1
- package/src/io/formats/design-tokens/css/read.ts +20 -7
- package/src/io/formats/design-tokens/css/sync.ts +9 -4
- package/src/io/formats/design-tokens/css/values.ts +37 -9
- package/src/io/formats/design-tokens/decode.ts +17 -12
- package/src/io/formats/design-tokens/export.ts +3 -3
- package/src/io/formats/design-tokens/index.ts +21 -0
- package/src/io/formats/design-tokens/plan/changes.ts +4 -1
- package/src/io/formats/design-tokens/plan/index.ts +6 -5
- package/src/io/formats/design-tokens/plan/styles.ts +37 -10
- package/src/io/formats/design-tokens/project.ts +40 -9
- package/src/io/formats/design-tokens/styles.ts +20 -9
- package/src/io/formats/design-tokens/sync/apply.ts +130 -0
- package/src/io/formats/design-tokens/sync/drift.ts +589 -0
- package/src/io/formats/design-tokens/sync/files.ts +40 -0
- package/src/io/formats/design-tokens/values.ts +15 -8
- package/src/io/formats/drawio/edges.ts +65 -0
- package/src/io/formats/drawio/export.ts +37 -14
- package/src/io/formats/drawio/index.ts +2 -0
- package/src/io/formats/drawio/warnings.ts +2 -2
- package/src/io/formats/fig/export/index.ts +36 -3
- package/src/io/formats/fig/export/patch/index.ts +12 -1
- package/src/io/formats/fig/export/setup.ts +25 -15
- package/src/io/formats/fig/export/variables.ts +17 -6
- package/src/io/formats/fig/thumbnail-page.ts +4 -4
- package/src/io/formats/html/import.ts +9 -1
- package/src/io/formats/html/index.ts +14 -7
- package/src/io/formats/html/vectors.ts +9 -2
- package/src/io/formats/mermaid/layers.ts +2 -2
- package/src/io/formats/pdf/document.ts +14 -4
- package/src/io/formats/pdf/export.ts +1 -0
- package/src/io/formats/pdf/prepare.ts +6 -6
- package/src/io/formats/pen/imports.ts +5 -6
- package/src/io/formats/pen/index.ts +41 -7
- package/src/io/formats/raster/adjusted-images.ts +125 -0
- package/src/io/formats/raster/headless.ts +3 -3
- package/src/io/formats/raster/index.ts +6 -1
- package/src/io/formats/raster/pixels.ts +7 -0
- package/src/io/formats/raster/render.ts +24 -5
- package/src/io/formats/svg/defs.ts +24 -80
- package/src/io/formats/svg/effects.ts +131 -0
- package/src/io/formats/svg/export.ts +295 -49
- package/src/io/formats/svg/filter.ts +57 -0
- package/src/io/formats/svg/grain.ts +249 -0
- package/src/io/formats/svg/import.ts +6 -3
- package/src/io/formats/svg/strokes.ts +2 -2
- package/src/io/formats/svg/text/export.ts +10 -8
- package/src/io/formats/svg/text/layout.ts +15 -5
- package/src/io/formats/video/composite.ts +79 -0
- package/src/io/formats/video/formats.ts +77 -0
- package/src/io/formats/video/gif.ts +65 -0
- package/src/io/formats/video/index.ts +30 -0
- package/src/io/formats/video/plan.ts +116 -0
- package/src/io/formats/video/record.ts +227 -0
- package/src/io/formats/video/sink.ts +32 -0
- package/src/io/formats/video/size.ts +25 -0
- package/src/io/formats/video/webcodecs.ts +89 -0
- package/src/io/formats.ts +66 -11
- package/src/io/subgraph.ts +4 -1
- package/src/io/types.ts +29 -10
- package/src/kiwi/fig/session/options.ts +4 -1
- package/src/layout/auto-layout-handles.ts +396 -0
- package/src/layout/yoga-helpers.ts +8 -0
- package/src/layout.ts +49 -1
- package/src/lint/fixes.ts +12 -3
- package/src/lint/index.ts +3 -1
- package/src/lint/linter.ts +108 -11
- package/src/lint/presets.ts +2 -0
- package/src/lint/rules/design-memory.ts +97 -0
- package/src/lint/rules/index.ts +6 -1
- package/src/lint/rules/no-unbound-token-values.ts +73 -0
- package/src/lint/types.ts +32 -0
- package/src/node/video.ts +196 -0
- package/src/pairdraw-api/comments.ts +6 -0
- package/src/pairdraw-api/design-memory.ts +61 -0
- package/src/pairdraw-api/index.ts +88 -9
- package/src/pairdraw-api/nodes.ts +38 -0
- package/src/pairdraw-api/variations.ts +109 -0
- package/src/prototype/easing.ts +37 -0
- package/src/prototype/frames.ts +9 -0
- package/src/prototype/hit.ts +70 -0
- package/src/prototype/index.ts +69 -0
- package/src/prototype/pointer.ts +146 -0
- package/src/prototype/reactions.ts +178 -0
- package/src/prototype/scene.ts +116 -0
- package/src/prototype/scenes.ts +256 -0
- package/src/prototype/scroll.ts +190 -0
- package/src/prototype/session.ts +188 -0
- package/src/prototype/smart-animate/animation.ts +267 -0
- package/src/prototype/smart-animate/match.ts +85 -0
- package/src/prototype/snapshot.ts +60 -0
- package/src/prototype/timeline.ts +400 -0
- package/src/rpc/read-commands.ts +4 -4
- package/src/rpc/variables-command.ts +2 -2
- package/src/text/font/features.ts +27 -0
- package/src/text/font/manager.ts +79 -1
- package/src/text/font/provider.ts +26 -0
- package/src/text/font/{status.ts → readiness.ts} +13 -9
- package/src/text/index.ts +4 -1
- package/src/text/prepare.ts +9 -4
- package/src/text/replace-fonts.ts +171 -0
- package/src/tools/analyze/responsive/index.ts +257 -0
- package/src/tools/analyze/responsive/widths.ts +63 -0
- package/src/tools/analyze.ts +4 -0
- package/src/tools/codegen/token-sync.ts +98 -0
- package/src/tools/codegen/tokens.ts +4 -2
- package/src/tools/codegen.ts +1 -0
- package/src/tools/comments.ts +6 -4
- package/src/tools/component-catalog.ts +5 -3
- package/src/tools/create/components.ts +4 -0
- package/src/tools/create/html.ts +1 -3
- package/src/tools/create/icons.ts +2 -1
- package/src/tools/create/mermaid.ts +1 -0
- package/src/tools/create/svg.ts +5 -1
- package/src/tools/create/vector.ts +2 -2
- package/src/tools/css/shorthand.ts +64 -0
- package/src/tools/describe/index.ts +2 -8
- package/src/tools/design-memory.ts +72 -0
- package/src/tools/html-host.ts +5 -3
- package/src/tools/image-ai/apply.ts +0 -2
- package/src/tools/image-ai/generate.ts +2 -0
- package/src/tools/image-ai/service.ts +5 -3
- package/src/tools/index.ts +3 -0
- package/src/tools/modify/effects.ts +1 -1
- package/src/tools/modify/fonts.ts +34 -0
- package/src/tools/modify/geometry.ts +16 -3
- package/src/tools/modify/layout.ts +47 -13
- package/src/tools/modify/matching.ts +14 -11
- package/src/tools/modify/paint.ts +85 -5
- package/src/tools/modify/reactions.ts +16 -8
- package/src/tools/modify/text.ts +56 -15
- package/src/tools/modify/update.ts +46 -2
- package/src/tools/modify.ts +1 -0
- package/src/tools/prompts/codegen.md +2 -1
- package/src/tools/read/css.ts +365 -0
- package/src/tools/read/fonts.ts +24 -2
- package/src/tools/read/libraries.ts +1 -0
- package/src/tools/read/reactions.ts +3 -2
- package/src/tools/read/space.ts +3 -4
- package/src/tools/read.ts +1 -0
- package/src/tools/registry/core.ts +5 -2
- package/src/tools/registry/extended.ts +28 -1
- package/src/tools/schema.ts +42 -9
- package/src/tools/script/host.ts +6 -3
- package/src/tools/stock-photo.ts +1 -0
- package/src/tools/structure/basic.ts +1 -0
- package/src/tools/structure/batch.ts +12 -1
- package/src/tools/structure/hierarchy.ts +4 -0
- package/src/tools/structure/variations.ts +118 -0
- package/src/tools/structure.ts +2 -0
- package/src/tools/styles/types.ts +3 -4
- package/src/tools/variables/collections.ts +1 -1
- package/src/tools/variables/values.ts +16 -5
- package/src/tools/vector/boolean.ts +4 -0
- package/src/tools/vector/vectorize.ts +11 -4
- package/src/tools/vector/video.ts +228 -0
- package/src/tools/vector.ts +1 -0
- package/src/tools/video-host.ts +20 -0
- package/src/vector/vectorize/svg/gradients.ts +8 -5
- package/src/vector/vectorize/svg/to-vectors.ts +48 -14
- package/dist/text/font/status.d.ts +0 -28
- package/dist/text/font/status.d.ts.map +0 -1
- package/dist/text/font/status.js.map +0 -1
|
@@ -236,5 +236,70 @@ export function bindEdge(
|
|
|
236
236
|
}
|
|
237
237
|
layoutConnector(graph, connector)
|
|
238
238
|
bendConnectorThrough(graph, connector, edge.geometry.points)
|
|
239
|
+
rememberEdge(graph, connector, edge)
|
|
239
240
|
return extra
|
|
240
241
|
}
|
|
242
|
+
|
|
243
|
+
/**
|
|
244
|
+
* Keeps the edge cell a connector was read from on its source metadata, so a write can return
|
|
245
|
+
* the route and style the author set while nothing about the connector was edited.
|
|
246
|
+
*/
|
|
247
|
+
function rememberEdge(graph: SceneGraph, connector: SceneNode, edge: DrawIOCell): void {
|
|
248
|
+
const live = graph.getNode(connector.id)
|
|
249
|
+
if (!live) return
|
|
250
|
+
live.source.drawio = {
|
|
251
|
+
styleNames: [...edge.style.names],
|
|
252
|
+
styleValues: { ...edge.style.values },
|
|
253
|
+
labelX: edge.geometry.x,
|
|
254
|
+
points: edge.geometry.points.map((point) => ({ ...point })),
|
|
255
|
+
sourcePoint: edge.geometry.sourcePoint ? { ...edge.geometry.sourcePoint } : null,
|
|
256
|
+
targetPoint: edge.geometry.targetPoint ? { ...edge.geometry.targetPoint } : null
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
/**
|
|
261
|
+
* The edge cell a connector was read from, while nothing shaping it has been edited since: its
|
|
262
|
+
* own route, its line and label, or an end's layer and the layers that place it. Null once any
|
|
263
|
+
* of those changed, so the writer routes the connector from its live state.
|
|
264
|
+
*/
|
|
265
|
+
export function keptEdge(
|
|
266
|
+
graph: SceneGraph,
|
|
267
|
+
connector: SceneNode
|
|
268
|
+
): NonNullable<SceneNode['source']['drawio']> | null {
|
|
269
|
+
const kept = connector.source.drawio
|
|
270
|
+
if (!kept) return null
|
|
271
|
+
const parts = connectorSublayers(graph, connector)
|
|
272
|
+
if (!parts) return null
|
|
273
|
+
// Layout and its derived fields move or size a connector and its parts without the author
|
|
274
|
+
// touching the edge itself; only a change to what the edge draws or says counts as an edit.
|
|
275
|
+
const appearsEdited = (node: SceneNode) =>
|
|
276
|
+
node.source.editedFields.some((field) => !isDerivedField(field) && !isPlacementField(field))
|
|
277
|
+
if (appearsEdited(connector) || appearsEdited(parts.line) || appearsEdited(parts.label))
|
|
278
|
+
return null
|
|
279
|
+
for (const endpoint of [connector.connectorStart, connector.connectorEnd]) {
|
|
280
|
+
let layer = endpoint?.nodeId ? graph.getNode(endpoint.nodeId) : undefined
|
|
281
|
+
while (layer && layer.type !== 'CANVAS') {
|
|
282
|
+
if (layer.source.editedFields.some((field) => !isDerivedField(field))) return null
|
|
283
|
+
layer = layer.parentId ? graph.getNode(layer.parentId) : undefined
|
|
284
|
+
}
|
|
285
|
+
}
|
|
286
|
+
return kept
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
/** Fields the layout pass computes; writing them is not an edit of the document. */
|
|
290
|
+
function isDerivedField(field: string): boolean {
|
|
291
|
+
return field.startsWith('derived') || field === 'textPicture'
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
/** A part's box, placed by its connector rather than set by hand. */
|
|
295
|
+
const PLACEMENT_FIELDS: Record<string, true> = {
|
|
296
|
+
x: true,
|
|
297
|
+
y: true,
|
|
298
|
+
width: true,
|
|
299
|
+
height: true,
|
|
300
|
+
rotation: true
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
function isPlacementField(field: string): boolean {
|
|
304
|
+
return Object.hasOwn(PLACEMENT_FIELDS, field)
|
|
305
|
+
}
|
|
@@ -9,7 +9,13 @@ import type {
|
|
|
9
9
|
DrawIOPoint,
|
|
10
10
|
DrawIOStyle
|
|
11
11
|
} from '@pairdraw/drawio'
|
|
12
|
-
import type {
|
|
12
|
+
import type {
|
|
13
|
+
ConnectorEndpoint,
|
|
14
|
+
DrawIOEdgeSource,
|
|
15
|
+
SceneGraph,
|
|
16
|
+
SceneNode,
|
|
17
|
+
StrokeCap
|
|
18
|
+
} from '@pairdraw/scene-graph'
|
|
13
19
|
import { colorToHex } from '@pairdraw/scene-graph/color'
|
|
14
20
|
import {
|
|
15
21
|
connectorRoute,
|
|
@@ -29,6 +35,7 @@ import type { Vector } from '@pairdraw/scene-graph/primitives'
|
|
|
29
35
|
import { computeContentBounds } from '#core/io/formats/raster'
|
|
30
36
|
import { renderNodesToSVG } from '#core/io/formats/svg'
|
|
31
37
|
|
|
38
|
+
import { keptEdge } from './edges'
|
|
32
39
|
import { DEFAULT_FONT_FAMILY } from './paint'
|
|
33
40
|
import { EMPTY_GEOMETRY, placed, placedValues, round, type Placed } from './placement'
|
|
34
41
|
import { drawioShapeValues } from './shapes'
|
|
@@ -488,30 +495,46 @@ class PageWriter {
|
|
|
488
495
|
// A connector without its line and label is not one draw.io could draw.
|
|
489
496
|
const parts = connectorSublayers(this.graph, node)
|
|
490
497
|
if (!parts) return
|
|
498
|
+
const kept = keptEdge(this.graph, node)
|
|
499
|
+
const drawnGeometry = this.edgeGeometry(node, parent)
|
|
491
500
|
const startId = node.connectorStart?.nodeId
|
|
492
501
|
const endId = node.connectorEnd?.nodeId
|
|
493
502
|
const lineType = node.connectorLineType
|
|
494
503
|
this.push(node, parent, {
|
|
495
504
|
kind: 'edge',
|
|
496
505
|
value: parts.label.text ? labelHTML(parts.label) : '',
|
|
497
|
-
style:
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
506
|
+
style: kept
|
|
507
|
+
? { names: [...kept.styleNames], values: { ...kept.styleValues } }
|
|
508
|
+
: style([], {
|
|
509
|
+
edgeStyle: lineType === 'ELBOWED' ? 'orthogonalEdgeStyle' : undefined,
|
|
510
|
+
rounded: lineType === 'ELBOWED' ? '1' : undefined,
|
|
511
|
+
curved: lineType === 'CURVED' ? '1' : undefined,
|
|
512
|
+
html: '1',
|
|
513
|
+
startArrow: ARROWS[node.connectorStartCap],
|
|
514
|
+
endArrow: ARROWS[node.connectorEndCap],
|
|
515
|
+
...lineValues(parts.line),
|
|
516
|
+
...this.end(node.connectorStart, 'exit'),
|
|
517
|
+
...this.end(node.connectorEnd, 'entry'),
|
|
518
|
+
...fontValues(parts.label)
|
|
519
|
+
}),
|
|
520
|
+
geometry: kept ? this.keptGeometry(kept) : drawnGeometry,
|
|
510
521
|
source: startId ? (this.ids.get(startId) ?? null) : null,
|
|
511
522
|
target: endId ? (this.ids.get(endId) ?? null) : null
|
|
512
523
|
})
|
|
513
524
|
}
|
|
514
525
|
|
|
526
|
+
/** The geometry the edge was read with, still in the parent's axes it was read in. */
|
|
527
|
+
private keptGeometry(kept: DrawIOEdgeSource): DrawIOGeometry {
|
|
528
|
+
return {
|
|
529
|
+
...EMPTY_GEOMETRY,
|
|
530
|
+
relative: true,
|
|
531
|
+
x: kept.labelX,
|
|
532
|
+
points: kept.points.map((point) => ({ ...point })),
|
|
533
|
+
sourcePoint: kept.sourcePoint ? { ...kept.sourcePoint } : null,
|
|
534
|
+
targetPoint: kept.targetPoint ? { ...kept.targetPoint } : null
|
|
535
|
+
}
|
|
536
|
+
}
|
|
537
|
+
|
|
515
538
|
/**
|
|
516
539
|
* The points a dragged connector bends through, for draw.io to run its edge the same way: an
|
|
517
540
|
* elbow's corners, or the middle of a curve. A connector routing itself leaves draw.io to route.
|
|
@@ -234,6 +234,8 @@ export function drawioToSceneGraph(file: DrawIOFile): SceneGraph {
|
|
|
234
234
|
if (index === 0) graph.updateNode(pageNode.id, { name: page.name })
|
|
235
235
|
new PageBuilder(graph, page, pageNode.id).build()
|
|
236
236
|
}
|
|
237
|
+
// The file wrote every layer as it stands, so nothing built here is an edit of the document.
|
|
238
|
+
for (const node of graph.getAllNodes()) node.source.editedFields = []
|
|
237
239
|
return graph
|
|
238
240
|
}
|
|
239
241
|
|
|
@@ -11,9 +11,9 @@ function counted(count: number, one: string, many: string): string {
|
|
|
11
11
|
* unbound. The writer names that loss instead of writing a file that looks complete.
|
|
12
12
|
*/
|
|
13
13
|
export function drawioDroppedWarnings(graph: SceneGraph): string[] {
|
|
14
|
-
const variables = graph.
|
|
14
|
+
const variables = graph.getLiveVariables().length
|
|
15
15
|
if (variables === 0) return []
|
|
16
|
-
const names =
|
|
16
|
+
const names = graph.getLiveCollections().map((collection) => collection.name)
|
|
17
17
|
const dropped = `draw.io has no variables: ${counted(variables, 'variable', 'variables')} in ${counted(names.length, 'collection', 'collections')} (${names.join(', ')}) not written`
|
|
18
18
|
const bound = [...graph.nodes.values()].filter(
|
|
19
19
|
(node) => Object.keys(node.boundVariables).length > 0
|
|
@@ -1,4 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {
|
|
2
|
+
appendFigRecordBytes,
|
|
3
|
+
compressFigDataSync,
|
|
4
|
+
figRecordBytes,
|
|
5
|
+
readFigArchiveParts,
|
|
6
|
+
renameFigArchive
|
|
7
|
+
} from '@pairdraw/fig'
|
|
2
8
|
import {
|
|
3
9
|
nameImagesForFigma,
|
|
4
10
|
placeSlotContent,
|
|
@@ -8,6 +14,7 @@ import {
|
|
|
8
14
|
import { initCodec } from '@pairdraw/kiwi/fig/codec'
|
|
9
15
|
import type { NodeChange } from '@pairdraw/kiwi/fig/codec'
|
|
10
16
|
import { loadFigDataCompressor, type FigFileKind } from '@pairdraw/kiwi/fig/container'
|
|
17
|
+
import { guidToString } from '@pairdraw/kiwi/fig/guid'
|
|
11
18
|
import type { SceneGraph } from '@pairdraw/scene-graph'
|
|
12
19
|
import { fractionalPosition } from '@pairdraw/scene-graph/order-keys'
|
|
13
20
|
import type { GUID } from '@pairdraw/scene-graph/primitives'
|
|
@@ -16,6 +23,7 @@ import { withFigExportRuntime } from '#core/canvas/text/shape'
|
|
|
16
23
|
import { IS_BROWSER, IS_TAURI } from '#core/constants'
|
|
17
24
|
import { figCompressionLevel } from '#core/io/formats/fig/compression'
|
|
18
25
|
import { cloneSceneGraphForFigExport } from '#core/kiwi/fig/parse/transfer'
|
|
26
|
+
import { figArchive } from '#core/kiwi/fig/session/archive/access'
|
|
19
27
|
import {
|
|
20
28
|
hasPendingReaderPages,
|
|
21
29
|
populateFigInternalPages,
|
|
@@ -139,7 +147,12 @@ async function writeFigFile(
|
|
|
139
147
|
graph = cloneSceneGraphForFigExport(sourceGraph)
|
|
140
148
|
populateReaderExport(sourceGraph, graph)
|
|
141
149
|
}
|
|
142
|
-
|
|
150
|
+
// The archive's records the document never read go back as the file saved them; a source
|
|
151
|
+
// without an archive was never saved, so it has none.
|
|
152
|
+
const archived = await figArchive(sourceGraph)?.info()
|
|
153
|
+
const setup = await prepareFigExport(graph, runtime, {
|
|
154
|
+
unreadVariables: archived?.unreadVariables
|
|
155
|
+
})
|
|
143
156
|
const { compiled, schemaDeflated } = exportSchema(graph)
|
|
144
157
|
const { canvasEntries, internalCanvasGuid, localIdCounter, blobs } = setup
|
|
145
158
|
const nodeChanges: KiwiNodeChange[] = [setup.documentNc]
|
|
@@ -190,7 +203,27 @@ async function writeFigFile(
|
|
|
190
203
|
}
|
|
191
204
|
|
|
192
205
|
const imageNames = nameImagesForFigma(nodeChanges, graph.images)
|
|
193
|
-
|
|
206
|
+
let kiwiData = compiled.encodeMessage(msg)
|
|
207
|
+
// A record of a type the pinned schema does not model cannot be encoded again, so its bytes
|
|
208
|
+
// come from the archive as the file saved them.
|
|
209
|
+
const unread = archived?.unreadVariables ?? []
|
|
210
|
+
if (unread.length > 0) {
|
|
211
|
+
const original = await figArchive(sourceGraph)?.original()
|
|
212
|
+
if (original) {
|
|
213
|
+
const parts = readFigArchiveParts(
|
|
214
|
+
original.buffer.slice(
|
|
215
|
+
original.byteOffset,
|
|
216
|
+
original.byteOffset + original.byteLength
|
|
217
|
+
) as ArrayBuffer
|
|
218
|
+
)
|
|
219
|
+
const ids = unread.flatMap(({ record }) => (record.guid ? [guidToString(record.guid)] : []))
|
|
220
|
+
kiwiData = appendFigRecordBytes(
|
|
221
|
+
parts.schemaDeflated,
|
|
222
|
+
kiwiData,
|
|
223
|
+
figRecordBytes(parts.schemaDeflated, parts.dataRaw, ids)
|
|
224
|
+
)
|
|
225
|
+
}
|
|
226
|
+
}
|
|
194
227
|
const extras = await figFileExtras(graph, imageNames, options)
|
|
195
228
|
|
|
196
229
|
const version = graph.figKiwiVersion ?? undefined
|
|
@@ -181,6 +181,14 @@ function planRecords(
|
|
|
181
181
|
return owner
|
|
182
182
|
}
|
|
183
183
|
for (const id of changes.touched) add(id)
|
|
184
|
+
// A frame that left grid layout leaves its children's anchors pointing at tracks it no longer
|
|
185
|
+
// has, so their records are rewritten too; the serializer clears the anchors it finds.
|
|
186
|
+
for (const id of changes.touched) {
|
|
187
|
+
const node = graph.getNode(id)
|
|
188
|
+
if (!node || node.layoutMode === 'GRID' || !node.source.editedFields.includes('layoutMode'))
|
|
189
|
+
continue
|
|
190
|
+
for (const child of graph.getChildren(id)) add(child.id)
|
|
191
|
+
}
|
|
184
192
|
addComponentInstances(graph, records, add)
|
|
185
193
|
const replaceVariables = changes.changedVariables.size > 0 || changes.collectionsChanged
|
|
186
194
|
if (replaceVariables) addVariableUsers(graph, changes, add)
|
|
@@ -325,6 +333,7 @@ function baselineWriter(info: FigArchiveRecordInfo): RecordWriter {
|
|
|
325
333
|
const written = writeRecords(setup, plan)
|
|
326
334
|
if (!written) return null
|
|
327
335
|
const internalPage = graph.getPages(true).find((page) => page.internalOnly)
|
|
336
|
+
// The baseline holds the document's own records; an unread one is not in the graph.
|
|
328
337
|
return [documentRecord(setup, info), ...written, ...variableRecords(setup, !!internalPage)]
|
|
329
338
|
}
|
|
330
339
|
}
|
|
@@ -344,7 +353,8 @@ async function buildPatch(
|
|
|
344
353
|
blobs: Array.from({ length: info.blobCount }, () => new Uint8Array(0)),
|
|
345
354
|
recordOwners: archived.byGuid,
|
|
346
355
|
archiveRecordIds: info.recordIds,
|
|
347
|
-
archiveResourceIds: changes.resourceIds
|
|
356
|
+
archiveResourceIds: changes.resourceIds,
|
|
357
|
+
unreadVariables: info.unreadVariables
|
|
348
358
|
})
|
|
349
359
|
const records = writeRecords(setup, plan)
|
|
350
360
|
if (!records) return null
|
|
@@ -355,6 +365,7 @@ async function buildPatch(
|
|
|
355
365
|
const internalPage = graph.getPages(true).find((page) => page.internalOnly)
|
|
356
366
|
const internal = setup.canvasEntries.find((entry) => entry.page.internalOnly)
|
|
357
367
|
const canvasWritten = records.some((record) => record === internal?.canvasNc)
|
|
368
|
+
// Unread records stay in the archive's bytes, so the patch never encodes them.
|
|
358
369
|
for (const record of variableRecords(setup, !!internalPage || canvasWritten))
|
|
359
370
|
records.push(record)
|
|
360
371
|
}
|
|
@@ -2,7 +2,12 @@ import type { CanvasKit } from 'canvaskit-wasm'
|
|
|
2
2
|
import { deflateSync, inflateSync } from 'fflate'
|
|
3
3
|
import { toUint8Array } from 'js-base64'
|
|
4
4
|
|
|
5
|
-
import {
|
|
5
|
+
import {
|
|
6
|
+
figArchiveMetaJSON,
|
|
7
|
+
figFontEntries,
|
|
8
|
+
figFontsManifest,
|
|
9
|
+
type FigUnreadVariable
|
|
10
|
+
} from '@pairdraw/fig'
|
|
6
11
|
import {
|
|
7
12
|
buildComponentPropIndex,
|
|
8
13
|
exportCanvasGuides,
|
|
@@ -155,15 +160,14 @@ function assignOwnLayerGuids(
|
|
|
155
160
|
|
|
156
161
|
/**
|
|
157
162
|
* The first local ID the counter can mint in sessions 0 and 1: past every saved GUID and every
|
|
158
|
-
* ID that layers, collections, modes, variables and component properties are
|
|
163
|
+
* ID that layers, collections, modes, variables (deleted ones too) and component properties are
|
|
164
|
+
* saved under.
|
|
159
165
|
*/
|
|
160
|
-
/** The first local ID above every GUID the graph's layers, variables, and properties claim. */
|
|
161
166
|
export function firstUnclaimedLocalId(graph: SceneGraph, propertyIds: readonly string[]): number {
|
|
162
|
-
const ids = [...propertyIds]
|
|
167
|
+
const ids = [...propertyIds, ...graph.variables.keys()]
|
|
163
168
|
for (const node of graph.nodes.values()) ids.push(node.source.id || node.id)
|
|
164
169
|
for (const [collectionId, collection] of graph.variableCollections) {
|
|
165
170
|
ids.push(collectionId, ...collection.modes.map((mode) => mode.modeId))
|
|
166
|
-
ids.push(...collection.variableIds)
|
|
167
171
|
}
|
|
168
172
|
let last = 0
|
|
169
173
|
for (const id of ids) {
|
|
@@ -272,7 +276,7 @@ function buildCanvasEntries(
|
|
|
272
276
|
nodeIdToGuid: Map<string, GUID>,
|
|
273
277
|
assignedGuidValues: Set<string>,
|
|
274
278
|
sourceOwners: ReadonlyMap<string, string>,
|
|
275
|
-
|
|
279
|
+
keepsUnreadRecords: boolean
|
|
276
280
|
): { canvasEntries: CanvasExportEntry[]; internalCanvasGuid: GUID | null } {
|
|
277
281
|
const canvasEntries: CanvasExportEntry[] = []
|
|
278
282
|
let internalCanvasGuid: GUID | null = null
|
|
@@ -284,7 +288,7 @@ function buildCanvasEntries(
|
|
|
284
288
|
const canvasGuid = (() => {
|
|
285
289
|
if (!page.source.id) {
|
|
286
290
|
return (
|
|
287
|
-
|
|
291
|
+
ownGuid(page.id, sourceOwners, assignedGuidValues) ?? {
|
|
288
292
|
sessionID: 0,
|
|
289
293
|
localID: localIdCounter.value++
|
|
290
294
|
}
|
|
@@ -319,10 +323,8 @@ function buildCanvasEntries(
|
|
|
319
323
|
|
|
320
324
|
const hasSharedStyles = [...graph.nodes.values()].some((node) => node.sharedStyleType !== null)
|
|
321
325
|
const hasSlotContent = [...graph.nodes.values()].some((node) => ownsSlotContent(graph, node))
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
internalCanvasGuid === null
|
|
325
|
-
) {
|
|
326
|
+
const hasVariables = graph.variableCollections.size > 0 || keepsUnreadRecords
|
|
327
|
+
if ((hasVariables || hasSharedStyles || hasSlotContent) && internalCanvasGuid === null) {
|
|
326
328
|
internalCanvasGuid = { sessionID: 0, localID: localIdCounter.value++ }
|
|
327
329
|
assignedGuidValues.add(`${internalCanvasGuid.sessionID}:${internalCanvasGuid.localID}`)
|
|
328
330
|
canvasEntries.push({
|
|
@@ -383,6 +385,8 @@ export interface FigExportSetup {
|
|
|
383
385
|
componentPropertyDefinitionsById: ReturnType<typeof buildComponentPropIndex>
|
|
384
386
|
pluginDataOverrides: ReadonlyMap<string, PluginDataEntry[]>
|
|
385
387
|
recordOwners?: ReadonlyMap<string, string>
|
|
388
|
+
/** Variable records the document never read, written back as the archive saved them. */
|
|
389
|
+
unreadVariables: readonly FigUnreadVariable[]
|
|
386
390
|
}
|
|
387
391
|
|
|
388
392
|
export interface FigExportSetupOptions {
|
|
@@ -400,6 +404,8 @@ export interface FigExportSetupOptions {
|
|
|
400
404
|
recordOwners?: ReadonlyMap<string, string>
|
|
401
405
|
/** Writing into an archive: the variables, collections and modes it holds keep their GUIDs. */
|
|
402
406
|
archiveResourceIds?: ReadonlySet<string>
|
|
407
|
+
/** Records the document never read, which the write keeps, so nothing new takes their GUIDs. */
|
|
408
|
+
unreadVariables?: readonly FigUnreadVariable[]
|
|
403
409
|
}
|
|
404
410
|
|
|
405
411
|
/**
|
|
@@ -426,6 +432,9 @@ export async function prepareFigExport(
|
|
|
426
432
|
// Reserve the document GUID to prevent imported nodes with source.id "0:0"
|
|
427
433
|
// from reusing the document's own GUID slot.
|
|
428
434
|
assignedGuidValues.add(`${docGuid.sessionID}:${docGuid.localID}`)
|
|
435
|
+
// No layer takes an unread record's GUID either: the save writes that record back.
|
|
436
|
+
for (const { record } of options.unreadVariables ?? [])
|
|
437
|
+
if (record.guid) assignedGuidValues.add(`${record.guid.sessionID}:${record.guid.localID}`)
|
|
429
438
|
const varIdToGuid = new Map<string, GUID>()
|
|
430
439
|
const modeIdToGuid = new Map<string, GUID>()
|
|
431
440
|
const propertyIdToGuid = new Map<string, GUID>()
|
|
@@ -434,10 +443,10 @@ export async function prepareFigExport(
|
|
|
434
443
|
const sourceOwners = layerSourceOwners(graph)
|
|
435
444
|
const archiveRecordIds = new Set(options.archiveRecordIds)
|
|
436
445
|
const propertyIds = collectComponentPropertyIds(graph)
|
|
437
|
-
// Before any canvas, variable or layer takes a counter GUID, so none collides.
|
|
446
|
+
// Before any canvas, variable or layer takes a counter GUID, so none collides with a reserved one.
|
|
438
447
|
localIdCounter.value = Math.max(
|
|
439
448
|
localIdCounter.value,
|
|
440
|
-
firstUnclaimedLocalId(graph, propertyIds),
|
|
449
|
+
firstUnclaimedLocalId(graph, [...propertyIds, ...assignedGuidValues]),
|
|
441
450
|
options.nextLocalId ?? 0
|
|
442
451
|
)
|
|
443
452
|
|
|
@@ -449,7 +458,7 @@ export async function prepareFigExport(
|
|
|
449
458
|
nodeIdToGuid,
|
|
450
459
|
assignedGuidValues,
|
|
451
460
|
sourceOwners,
|
|
452
|
-
|
|
461
|
+
(options.unreadVariables?.length ?? 0) > 0
|
|
453
462
|
)
|
|
454
463
|
// Archive records keep their GUIDs: claim them before any copy that kept one can.
|
|
455
464
|
for (const [guid, nodeId] of options.recordOwners ?? []) {
|
|
@@ -505,7 +514,8 @@ export async function prepareFigExport(
|
|
|
505
514
|
blobIndexByHex: new Map(),
|
|
506
515
|
componentPropertyDefinitionsById: buildComponentPropIndex(graph),
|
|
507
516
|
pluginDataOverrides,
|
|
508
|
-
recordOwners: options.recordOwners
|
|
517
|
+
recordOwners: options.recordOwners,
|
|
518
|
+
unreadVariables: options.unreadVariables ?? []
|
|
509
519
|
}
|
|
510
520
|
}
|
|
511
521
|
|
|
@@ -22,6 +22,7 @@ import type {
|
|
|
22
22
|
} from '@pairdraw/scene-graph'
|
|
23
23
|
import { fractionalPosition, orderKeyBetween } from '@pairdraw/scene-graph/order-keys'
|
|
24
24
|
import {
|
|
25
|
+
deletedVariablesOf,
|
|
25
26
|
isUnsupportedVariableValue,
|
|
26
27
|
foldFormula,
|
|
27
28
|
formulaValueType,
|
|
@@ -80,7 +81,11 @@ export function assignVariableGuids(
|
|
|
80
81
|
)
|
|
81
82
|
modeIdToGuid.set(mode.modeId, modeGuid)
|
|
82
83
|
}
|
|
83
|
-
|
|
84
|
+
// Deleted variables are written too, so they keep their GUIDs like the listed ones.
|
|
85
|
+
for (const varId of [
|
|
86
|
+
...col.variableIds,
|
|
87
|
+
...deletedVariablesOf(graph, colId).map((item) => item.id)
|
|
88
|
+
]) {
|
|
84
89
|
const varGuid = assignVariableGuid(
|
|
85
90
|
varId,
|
|
86
91
|
localIdCounter,
|
|
@@ -265,11 +270,16 @@ export function appendVariableNodeChanges(
|
|
|
265
270
|
})),
|
|
266
271
|
pluginData: collectionPluginDataNodeChange(collection, modeKey),
|
|
267
272
|
key: collection.key,
|
|
268
|
-
version: collection.version
|
|
273
|
+
version: collection.version,
|
|
274
|
+
...(collection.deleted ? { isSoftDeleted: true } : {})
|
|
269
275
|
})
|
|
270
|
-
for
|
|
271
|
-
|
|
272
|
-
|
|
276
|
+
// Deleted variables follow the listed ones: the file keeps them for the layers bound to them.
|
|
277
|
+
const variables = [
|
|
278
|
+
...collection.variableIds.flatMap((id) => graph.variables.get(id) ?? []),
|
|
279
|
+
...deletedVariablesOf(graph, collection.id)
|
|
280
|
+
]
|
|
281
|
+
for (const variable of variables) {
|
|
282
|
+
const id = variable.id
|
|
273
283
|
changes.push({
|
|
274
284
|
guid: ids.get(id) ?? stringToGuid(id),
|
|
275
285
|
parentIndex: { guid: parent, position: nextPosition() },
|
|
@@ -291,7 +301,8 @@ export function appendVariableNodeChanges(
|
|
|
291
301
|
},
|
|
292
302
|
...variableMetadataNodeChange(variable, modeKey),
|
|
293
303
|
key: variable.key,
|
|
294
|
-
version: variable.version
|
|
304
|
+
version: variable.version,
|
|
305
|
+
...(variable.deleted ? { isSoftDeleted: true } : {})
|
|
295
306
|
})
|
|
296
307
|
}
|
|
297
308
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
type
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import type { SceneNode } from '@pairdraw/scene-graph'
|
|
2
|
+
|
|
3
|
+
/** The fields of a page the thumbnail choice reads. */
|
|
4
|
+
type ThumbnailPage = Pick<SceneNode, 'id' | 'name'>
|
|
5
5
|
|
|
6
6
|
const COVER_PAGE_NAME = 'cover'
|
|
7
7
|
|
|
@@ -36,7 +36,15 @@ export async function readHTMLDocument(
|
|
|
36
36
|
const styled = options.tailwind
|
|
37
37
|
? await tailwindHTMLToDesignDocument(html, options.tailwind, { css: options.cssText, runtime })
|
|
38
38
|
: await htmlToDesignDocument(html, { cssText: options.cssText, runtime })
|
|
39
|
-
|
|
39
|
+
const graph = sceneGraphFromStyledHTML(styled, { pageName: options.pageName })
|
|
40
|
+
// An empty page or markup a parser could not read would otherwise open as an empty document
|
|
41
|
+
// with nothing to tell the user; every caller reports a thrown error.
|
|
42
|
+
if (graph.getPages().every((page) => page.childIds.length === 0)) {
|
|
43
|
+
throw new Error(
|
|
44
|
+
'No layers found in this HTML document; check that it is HTML with visible content.'
|
|
45
|
+
)
|
|
46
|
+
}
|
|
47
|
+
return { styled, graph }
|
|
40
48
|
}
|
|
41
49
|
|
|
42
50
|
/** Styles HTML for `import_html` with the headless CSS runtime, where Node runs the tools. */
|
|
@@ -7,19 +7,25 @@ import {
|
|
|
7
7
|
} from '@pairdraw/dom-css/export'
|
|
8
8
|
import type { SceneGraph } from '@pairdraw/scene-graph'
|
|
9
9
|
|
|
10
|
-
import type { ExportAsset, HTMLExportOptions } from '#core/io/types'
|
|
10
|
+
import type { ExportAsset, HTMLExportOptions, IOContext } from '#core/io/types'
|
|
11
11
|
import { exportWebFontFaceAssets } from '#core/text/web-font/assets'
|
|
12
12
|
|
|
13
13
|
import { vectorElement } from './vectors'
|
|
14
14
|
|
|
15
|
-
function designDocument(
|
|
15
|
+
async function designDocument(
|
|
16
16
|
graph: SceneGraph,
|
|
17
17
|
nodeIds: string[],
|
|
18
|
-
options: HTMLExportOptions
|
|
19
|
-
|
|
18
|
+
options: HTMLExportOptions,
|
|
19
|
+
context?: IOContext
|
|
20
|
+
): Promise<DesignDocument> {
|
|
21
|
+
const { booleanPathResolver, needsBooleanPaths } = await import('#core/io/formats/boolean-path')
|
|
22
|
+
const booleanPath = needsBooleanPaths(graph)
|
|
23
|
+
? await booleanPathResolver(context?.canvasKit, context?.renderer)
|
|
24
|
+
: undefined
|
|
20
25
|
// Layer names help find a layer in the markup; IDs only matter to tools that link back.
|
|
21
26
|
const projection = {
|
|
22
|
-
vectorElement,
|
|
27
|
+
vectorElement: (vectorGraph: SceneGraph, node: Parameters<typeof vectorElement>[1]) =>
|
|
28
|
+
vectorElement(vectorGraph, node, booleanPath),
|
|
23
29
|
includeLayerNames: options.layerNames ?? true,
|
|
24
30
|
includeSourceIds: options.layerIds ?? false
|
|
25
31
|
}
|
|
@@ -36,9 +42,10 @@ export async function renderNodesToHTML(
|
|
|
36
42
|
graph: SceneGraph,
|
|
37
43
|
nodeIds: string[],
|
|
38
44
|
options: HTMLExportOptions = {},
|
|
39
|
-
fileName?: string
|
|
45
|
+
fileName?: string,
|
|
46
|
+
context?: IOContext
|
|
40
47
|
): Promise<{ html: string; assets: ExportAsset[] }> {
|
|
41
|
-
const bundle = await exportHTMLBundle(designDocument(graph, nodeIds, options), {
|
|
48
|
+
const bundle = await exportHTMLBundle(await designDocument(graph, nodeIds, options, context), {
|
|
42
49
|
html: options.html,
|
|
43
50
|
style: options.style,
|
|
44
51
|
assets: options.assets,
|
|
@@ -3,6 +3,7 @@ import { colorToHex } from '@pairdraw/scene-graph/color'
|
|
|
3
3
|
import { isIconModified, readIcon, readIconTint } from '@pairdraw/scene-graph/icons'
|
|
4
4
|
|
|
5
5
|
import { iconColor } from '#core/icons/render'
|
|
6
|
+
import type { BooleanPathResolver } from '#core/io/formats/boolean-path'
|
|
6
7
|
import { renderNodeSVGElement } from '#core/io/formats/svg/export'
|
|
7
8
|
import type { SVGNode } from '#core/io/formats/svg/node'
|
|
8
9
|
|
|
@@ -33,13 +34,19 @@ function idPart(id: string): string {
|
|
|
33
34
|
* were edited. Def ids start with the layer's id, so several SVGs on one page never pick up each
|
|
34
35
|
* other's gradients or filters.
|
|
35
36
|
*/
|
|
36
|
-
export const vectorElement
|
|
37
|
+
export const vectorElement = (
|
|
38
|
+
graph: Parameters<VectorElementRenderer>[0],
|
|
39
|
+
node: Parameters<VectorElementRenderer>[1],
|
|
40
|
+
booleanPath?: BooleanPathResolver
|
|
41
|
+
): ReturnType<VectorElementRenderer> => {
|
|
37
42
|
const idPrefix = `${idPart(node.id)}-`
|
|
38
43
|
const icon = readIcon(node)
|
|
39
44
|
const drawn = renderNodeSVGElement(graph, node, {
|
|
45
|
+
documentColorSpace: graph.documentColorSpace,
|
|
40
46
|
idPrefix,
|
|
41
47
|
colorSpace: graph.documentColorSpace,
|
|
42
|
-
tint: icon ? readIconTint : undefined
|
|
48
|
+
tint: icon ? readIconTint : undefined,
|
|
49
|
+
booleanPath
|
|
43
50
|
})
|
|
44
51
|
const element = drawn && designNode(drawn)
|
|
45
52
|
if (element?.type !== 'element') return null
|
|
@@ -18,7 +18,7 @@ import { applyArrangement, type ArrangePlacement } from '#core/layout/arrange/ap
|
|
|
18
18
|
import { arrangeBoxes, type ArrangeInput } from '#core/layout/arrange/boxes'
|
|
19
19
|
import { connectorLabelSize } from '#core/layout/arrange/routes'
|
|
20
20
|
import { shapeWithTextWidthFor } from '#core/layout/shape-with-text'
|
|
21
|
-
import {
|
|
21
|
+
import { resolveFontReadiness } from '#core/text/prepare'
|
|
22
22
|
|
|
23
23
|
import { figJamShape } from './shapes'
|
|
24
24
|
import { declarationsFor, readStyle, type FlowStyle } from './styles'
|
|
@@ -247,7 +247,7 @@ export async function addFlowchart(
|
|
|
247
247
|
created = added
|
|
248
248
|
// Shapes grow to their labels, and connector labels take their size, before the layout reads
|
|
249
249
|
// them, measured in the fonts they are drawn in.
|
|
250
|
-
await
|
|
250
|
+
await resolveFontReadiness(graph, added)
|
|
251
251
|
for (const node of chart.nodes) builder.fitWidth(node)
|
|
252
252
|
layoutAuthoredNodes(graph, added)
|
|
253
253
|
const enclosing = enclosingSubgraphs(chart)
|
|
@@ -1,5 +1,9 @@
|
|
|
1
|
+
import type { CanvasKit } from 'canvaskit-wasm'
|
|
2
|
+
|
|
1
3
|
import type { SceneGraph } from '@pairdraw/scene-graph'
|
|
2
4
|
|
|
5
|
+
import type { SkiaRenderer } from '#core/canvas/renderer'
|
|
6
|
+
import { bakeAdjustedImages, hasAdjustedImagePaints } from '#core/io/formats/raster/adjusted-images'
|
|
3
7
|
import { fontManager } from '#core/text/font/manager'
|
|
4
8
|
|
|
5
9
|
import { renderPagesToPDFDetailed, type PDFExportResult } from './export'
|
|
@@ -21,14 +25,20 @@ export interface PDFDocumentOptions {
|
|
|
21
25
|
export async function exportPDFDocument(
|
|
22
26
|
graph: SceneGraph,
|
|
23
27
|
specs: readonly PDFPageSpec[],
|
|
24
|
-
options: PDFDocumentOptions
|
|
28
|
+
options: PDFDocumentOptions,
|
|
29
|
+
canvasKit?: CanvasKit,
|
|
30
|
+
renderer?: SkiaRenderer
|
|
25
31
|
): Promise<PDFExportResult | null> {
|
|
32
|
+
const nodeIds = specs.flatMap((spec) => spec.nodeIds)
|
|
33
|
+
const baked = hasAdjustedImagePaints(graph, nodeIds)
|
|
34
|
+
? await bakeAdjustedImages(graph, nodeIds, canvasKit, renderer)
|
|
35
|
+
: graph
|
|
26
36
|
const status = options.layOutPages
|
|
27
|
-
? await preparePagesForPDF(
|
|
28
|
-
: await preparePDFFonts(
|
|
37
|
+
? await preparePagesForPDF(baked, specs)
|
|
38
|
+
: await preparePDFFonts(baked, specs)
|
|
29
39
|
const fonts = options.embedFonts ? pdfFontFaces(status) : undefined
|
|
30
40
|
return withPDFTextLayout((textLayout) =>
|
|
31
|
-
renderPagesToPDFDetailed(
|
|
41
|
+
renderPagesToPDFDetailed(baked, specs, {
|
|
32
42
|
fonts,
|
|
33
43
|
textLayout,
|
|
34
44
|
fallbackFile: (family, style, file) =>
|