@pairdraw/core 0.19.1 → 0.20.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/previews.d.ts +1 -1
- 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 +43 -0
- package/dist/canvas/noise/shader.d.ts.map +1 -0
- package/dist/canvas/noise/shader.js +161 -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 +73 -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/overlays/index.d.ts +2 -2
- package/dist/canvas/overlays/index.js +2 -2
- package/dist/canvas/overlays/selection.d.ts +1 -2
- package/dist/canvas/overlays/selection.d.ts.map +1 -1
- package/dist/canvas/overlays/selection.js +2 -9
- package/dist/canvas/overlays/selection.js.map +1 -1
- package/dist/canvas/renderer/chunks/index.d.ts +1 -1
- package/dist/canvas/renderer/fonts.d.ts.map +1 -1
- package/dist/canvas/renderer/fonts.js +2 -0
- package/dist/canvas/renderer/fonts.js.map +1 -1
- package/dist/canvas/renderer/lifecycle.d.ts.map +1 -1
- package/dist/canvas/renderer/lifecycle.js +6 -0
- package/dist/canvas/renderer/lifecycle.js.map +1 -1
- package/dist/canvas/renderer/methods.d.ts +0 -1
- package/dist/canvas/renderer/methods.d.ts.map +1 -1
- package/dist/canvas/renderer/methods.js +1 -4
- package/dist/canvas/renderer/methods.js.map +1 -1
- package/dist/canvas/renderer/overlay-pass.d.ts.map +1 -1
- package/dist/canvas/renderer/overlay-pass.js +0 -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 +13 -2
- 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/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/types.d.ts +18 -4
- 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 +22 -3
- package/dist/canvas/renderer.d.ts.map +1 -1
- package/dist/canvas/renderer.js +29 -1
- 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 +41 -9
- package/dist/canvas/scene.js.map +1 -1
- package/dist/canvas/shadows/silhouette.js +1 -1
- package/dist/canvas/texture.d.ts +20 -0
- package/dist/canvas/texture.d.ts.map +1 -0
- package/dist/canvas/texture.js +100 -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/index.d.ts +2 -2
- package/dist/design-jsx/index.js +2 -2
- package/dist/design-jsx/renderer.d.ts +3 -2
- package/dist/design-jsx/renderer.d.ts.map +1 -1
- package/dist/design-jsx/renderer.js +2 -2
- package/dist/design-jsx/renderer.js.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/bridges/undo.d.ts +1 -1
- package/dist/editor/clipboard/assets.js +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/snapshot.d.ts.map +1 -1
- package/dist/editor/clipboard/snapshot.js +12 -4
- package/dist/editor/clipboard/snapshot.js.map +1 -1
- package/dist/editor/clipboard.d.ts.map +1 -1
- package/dist/editor/clipboard.js +2 -7
- package/dist/editor/clipboard.js.map +1 -1
- package/dist/editor/color-space.d.ts.map +1 -1
- package/dist/editor/color-space.js +33 -38
- package/dist/editor/color-space.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.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 +36 -8
- package/dist/editor/create.d.ts.map +1 -1
- package/dist/editor/create.js +26 -61
- 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 +168 -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 +6 -0
- 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 +6 -3
- 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/nudge.js +1 -1
- package/dist/editor/nudge.js.map +1 -1
- 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 +6 -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/container.d.ts +2 -0
- package/dist/editor/selection/container.d.ts.map +1 -1
- package/dist/editor/selection/container.js +17 -1
- package/dist/editor/selection/container.js.map +1 -1
- package/dist/editor/selection/navigation.js +7 -4
- package/dist/editor/selection/navigation.js.map +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 +6 -2
- package/dist/editor/selection.d.ts +9 -2
- package/dist/editor/selection.d.ts.map +1 -1
- package/dist/editor/shapes/with-text.d.ts.map +1 -1
- package/dist/editor/shapes/with-text.js +2 -5
- package/dist/editor/shapes/with-text.js.map +1 -1
- package/dist/editor/structure/auto-layout-wrap.js +1 -1
- package/dist/editor/structure/auto-layout-wrap.js.map +1 -1
- package/dist/editor/structure/boolean.d.ts +2 -3
- package/dist/editor/structure/boolean.d.ts.map +1 -1
- package/dist/editor/structure/boolean.js.map +1 -1
- package/dist/editor/structure/group/bounds.d.ts.map +1 -1
- package/dist/editor/structure/group/bounds.js +1 -3
- package/dist/editor/structure/group/bounds.js.map +1 -1
- package/dist/editor/structure/outline-stroke.js +3 -3
- package/dist/editor/structure/outline-stroke.js.map +1 -1
- package/dist/editor/structure/reorder.d.ts.map +1 -1
- package/dist/editor/structure/reorder.js +7 -14
- package/dist/editor/structure/reorder.js.map +1 -1
- package/dist/editor/structure/state.js +1 -1
- package/dist/editor/structure/state.js.map +1 -1
- package/dist/editor/structure.d.ts +1 -2
- package/dist/editor/structure.d.ts.map +1 -1
- package/dist/editor/structure.js +3 -3
- package/dist/editor/structure.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 +9 -2
- package/dist/editor/types.d.ts.map +1 -1
- package/dist/editor/variables.d.ts.map +1 -1
- package/dist/editor/variables.js +57 -1
- 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.d.ts.map +1 -1
- package/dist/figma-api/accessors/text/index.js +7 -1
- 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/fonts/loaded.d.ts +3 -1
- package/dist/figma-api/fonts/loaded.d.ts.map +1 -1
- package/dist/figma-api/fonts/loaded.js +8 -1
- package/dist/figma-api/fonts/loaded.js.map +1 -1
- package/dist/figma-api/index.d.ts +18 -0
- package/dist/figma-api/index.d.ts.map +1 -1
- package/dist/figma-api/index.js +19 -1
- 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/proxy.d.ts +4 -1
- package/dist/figma-api/proxy.d.ts.map +1 -1
- package/dist/figma-api/proxy.js +1 -1
- package/dist/figma-api/proxy.js.map +1 -1
- package/dist/figma-api/reactions.d.ts +41 -13
- package/dist/figma-api/reactions.d.ts.map +1 -1
- package/dist/figma-api/reactions.js +113 -31
- package/dist/figma-api/reactions.js.map +1 -1
- package/dist/figma-api/render-bounds.js +1 -1
- package/dist/figma-api/serialization.d.ts.map +1 -1
- package/dist/figma-api/serialization.js +2 -1
- package/dist/figma-api/serialization.js.map +1 -1
- package/dist/figma-api/shape-details.d.ts +26 -0
- package/dist/figma-api/shape-details.d.ts.map +1 -0
- package/dist/figma-api/shape-details.js +28 -0
- package/dist/figma-api/shape-details.js.map +1 -0
- package/dist/figma-api/shape-with-text.js +2 -5
- package/dist/figma-api/shape-with-text.js.map +1 -1
- package/dist/figma-api/surface.d.ts +7 -4
- package/dist/figma-api/surface.d.ts.map +1 -1
- package/dist/figma-api/surface.js +7 -2
- package/dist/figma-api/surface.js.map +1 -1
- package/dist/figma-api/transform.d.ts +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/icons/svg.js +1 -1
- package/dist/icons/svg.js.map +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/decode.js +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/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.map +1 -1
- 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/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.d.ts.map +1 -1
- package/dist/io/formats/drawio/index.js +2 -1
- package/dist/io/formats/drawio/index.js.map +1 -1
- package/dist/io/formats/drawio/label.js +1 -1
- package/dist/io/formats/drawio/paint.js +1 -1
- package/dist/io/formats/drawio/placement.d.ts +1 -1
- package/dist/io/formats/fig/export/patch/index.d.ts.map +1 -1
- package/dist/io/formats/fig/export/patch/index.js +5 -0
- package/dist/io/formats/fig/export/patch/index.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/layers.d.ts +7 -4
- package/dist/io/formats/html/layers.d.ts.map +1 -1
- package/dist/io/formats/html/layers.js +4 -1
- package/dist/io/formats/html/layers.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 +3 -2
- package/dist/io/formats/html/vectors.js.map +1 -1
- package/dist/io/formats/mermaid/styles.js +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/dom.d.ts +6 -1
- package/dist/io/formats/pdf/dom.d.ts.map +1 -1
- package/dist/io/formats/pdf/dom.js +9 -22
- package/dist/io/formats/pdf/dom.js.map +1 -1
- package/dist/io/formats/pdf/export.js +1 -1
- package/dist/io/formats/pdf/export.js.map +1 -1
- package/dist/io/formats/pdf/prepare.d.ts +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 +31 -3
- 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/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.map +1 -1
- package/dist/io/formats/raster/render.js +4 -0
- package/dist/io/formats/raster/render.js.map +1 -1
- package/dist/io/formats/svg/defs.d.ts +5 -6
- package/dist/io/formats/svg/defs.d.ts.map +1 -1
- package/dist/io/formats/svg/defs.js +4 -54
- 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 +7 -1
- package/dist/io/formats/svg/export.d.ts.map +1 -1
- package/dist/io/formats/svg/export.js +224 -50
- package/dist/io/formats/svg/export.js.map +1 -1
- package/dist/io/formats/svg/filter.d.ts +27 -0
- package/dist/io/formats/svg/filter.d.ts.map +1 -0
- package/dist/io/formats/svg/filter.js +44 -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/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/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 +6 -3
- 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 +40 -11
- package/dist/io/formats.js.map +1 -1
- package/dist/io/types.d.ts +19 -4
- package/dist/io/types.d.ts.map +1 -1
- package/dist/kiwi/fig/parse/transfer.d.ts +1 -1
- package/dist/layout/apply.d.ts.map +1 -1
- package/dist/layout/apply.js +50 -12
- package/dist/layout/apply.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/derived.d.ts +7 -1
- package/dist/layout/derived.d.ts.map +1 -1
- package/dist/layout/derived.js +11 -1
- package/dist/layout/derived.js.map +1 -1
- package/dist/layout/grid.d.ts +7 -2
- package/dist/layout/grid.d.ts.map +1 -1
- package/dist/layout/grid.js +27 -9
- package/dist/layout/grid.js.map +1 -1
- package/dist/layout/mutations.d.ts +1 -0
- package/dist/layout/mutations.d.ts.map +1 -1
- package/dist/layout/mutations.js +10 -0
- package/dist/layout/mutations.js.map +1 -1
- package/dist/layout/strokes.d.ts +9 -1
- package/dist/layout/strokes.d.ts.map +1 -1
- package/dist/layout/strokes.js +12 -1
- package/dist/layout/strokes.js.map +1 -1
- package/dist/layout/yoga-helpers.d.ts +3 -1
- package/dist/layout/yoga-helpers.d.ts.map +1 -1
- package/dist/layout/yoga-helpers.js +16 -2
- 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 +73 -39
- package/dist/layout.js.map +1 -1
- package/dist/lint/fixes.d.ts.map +1 -1
- package/dist/lint/fixes.js +9 -3
- 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 +13 -0
- package/dist/lint/linter.d.ts.map +1 -1
- package/dist/lint/linter.js +123 -9
- 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/effect-style-required.js +1 -0
- package/dist/lint/rules/effect-style-required.js.map +1 -1
- 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/rules/text-style-required.js +1 -0
- package/dist/lint/rules/text-style-required.js.map +1 -1
- package/dist/lint/types.d.ts +32 -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/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 +45 -1
- package/dist/pairdraw-api/index.d.ts.map +1 -1
- package/dist/pairdraw-api/index.js +55 -2
- package/dist/pairdraw-api/index.js.map +1 -1
- package/dist/pairdraw-api/nodes.d.ts +12 -1
- 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/commands.d.ts +2 -2
- package/dist/rpc/index.d.ts +2 -2
- package/dist/rpc/read-commands.d.ts +18 -8
- package/dist/rpc/read-commands.d.ts.map +1 -1
- package/dist/rpc/read-commands.js +18 -9
- package/dist/rpc/read-commands.js.map +1 -1
- package/dist/text/font/faces.d.ts +12 -1
- package/dist/text/font/faces.d.ts.map +1 -1
- package/dist/text/font/faces.js +15 -1
- package/dist/text/font/faces.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 +66 -12
- package/dist/text/font/manager.js.map +1 -1
- package/dist/text/index.d.ts +11 -9
- package/dist/text/index.js +4 -2
- 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/responsive/index.d.ts +15 -0
- package/dist/tools/analyze/responsive/index.d.ts.map +1 -0
- package/dist/tools/analyze/responsive/index.js +203 -0
- package/dist/tools/analyze/responsive/index.js.map +1 -0
- package/dist/tools/analyze.d.ts +2 -1
- package/dist/tools/analyze.js +2 -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.d.ts +2 -1
- package/dist/tools/codegen.js +2 -1
- package/dist/tools/create/basic.js +1 -1
- package/dist/tools/create/behaviours.js +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.js +3 -2
- package/dist/tools/create/html.js.map +1 -1
- package/dist/tools/create/icons.d.ts.map +1 -1
- package/dist/tools/create/icons.js +2 -1
- package/dist/tools/create/icons.js.map +1 -1
- package/dist/tools/create/mermaid.js +2 -1
- package/dist/tools/create/mermaid.js.map +1 -1
- package/dist/tools/create/render.js +1 -1
- package/dist/tools/create/svg.js +2 -1
- package/dist/tools/create/svg.js.map +1 -1
- package/dist/tools/create/vector.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/image-ai/generate.d.ts.map +1 -1
- package/dist/tools/image-ai/generate.js +3 -1
- package/dist/tools/image-ai/generate.js.map +1 -1
- package/dist/tools/index.d.ts +2 -1
- package/dist/tools/index.js +2 -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/layout.d.ts.map +1 -1
- package/dist/tools/modify/layout.js +1 -0
- package/dist/tools/modify/layout.js.map +1 -1
- package/dist/tools/modify/paint.js +1 -1
- package/dist/tools/modify/reactions.d.ts.map +1 -1
- package/dist/tools/modify/reactions.js +3 -3
- 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 +26 -5
- 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/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 +2 -1
- package/dist/tools/read/libraries.js.map +1 -1
- package/dist/tools/read/nodes.d.ts.map +1 -1
- package/dist/tools/read/nodes.js.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 -3
- package/dist/tools/read/space.js.map +1 -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 +3 -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 +18 -2
- package/dist/tools/schema.d.ts.map +1 -1
- package/dist/tools/schema.js +1 -1
- package/dist/tools/schema.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 +22 -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/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/path.d.ts.map +1 -1
- package/dist/tools/vector/path.js +39 -7
- package/dist/tools/vector/path.js.map +1 -1
- package/dist/tools/vector/vectorize.js +1 -0
- 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 +19 -0
- package/dist/tools/video-host.js.map +1 -0
- package/dist/vector/point-transform.d.ts +1 -1
- package/dist/vector/vectorize/svg/to-vectors.d.ts +1 -1
- package/dist/xpath.d.ts +3 -0
- package/dist/xpath.d.ts.map +1 -1
- package/dist/xpath.js +3 -1
- package/dist/xpath.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 +161 -0
- package/src/canvas/noise/table.ts +91 -0
- package/src/canvas/noise/tile.ts +94 -0
- package/src/canvas/overlays/auto-layout-hover.ts +47 -65
- package/src/canvas/overlays/index.ts +0 -1
- package/src/canvas/overlays/selection.ts +1 -12
- package/src/canvas/renderer/fonts.ts +2 -0
- package/src/canvas/renderer/lifecycle.ts +6 -0
- package/src/canvas/renderer/methods.ts +0 -9
- package/src/canvas/renderer/overlay-pass.ts +0 -1
- package/src/canvas/renderer/pipeline.ts +19 -2
- package/src/canvas/renderer/play-scenes.ts +51 -0
- package/src/canvas/renderer/tiles/cache.ts +54 -1
- package/src/canvas/renderer/tiles/controller.ts +30 -1
- package/src/canvas/renderer/types.ts +18 -3
- package/src/canvas/renderer.ts +40 -4
- package/src/canvas/scene.ts +65 -9
- package/src/canvas/texture.ts +136 -0
- package/src/clipboard.ts +23 -10
- package/src/constants.ts +6 -0
- package/src/design-jsx/index.ts +1 -1
- package/src/design-jsx/renderer.ts +1 -1
- 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/export.ts +24 -7
- package/src/editor/clipboard/snapshot.ts +21 -4
- package/src/editor/clipboard.ts +4 -14
- package/src/editor/color-space.ts +47 -38
- package/src/editor/components/instances.ts +31 -0
- package/src/editor/create.ts +39 -71
- 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 +198 -0
- package/src/editor/fonts.ts +19 -0
- package/src/editor/history/atomic-tool.ts +29 -1
- package/src/editor/history/capture.ts +19 -0
- package/src/editor/history/document-change.ts +5 -17
- package/src/editor/history/edit.ts +16 -2
- package/src/editor/history/subtree.ts +13 -2
- package/src/editor/index.ts +11 -0
- package/src/editor/nudge.ts +1 -1
- package/src/editor/pages.ts +40 -29
- package/src/editor/play/states.ts +1 -1
- package/src/editor/read-only/actions.ts +6 -0
- package/src/editor/render-requests.ts +83 -0
- package/src/editor/selection/container.ts +24 -1
- package/src/editor/selection/navigation.ts +8 -6
- package/src/editor/selection/overlays.ts +1 -0
- package/src/editor/shapes/with-text.ts +2 -5
- package/src/editor/structure/auto-layout-wrap.ts +1 -1
- package/src/editor/structure/boolean.ts +1 -3
- package/src/editor/structure/group/bounds.ts +1 -5
- package/src/editor/structure/outline-stroke.ts +3 -3
- package/src/editor/structure/reorder.ts +8 -14
- package/src/editor/structure/state.ts +1 -1
- package/src/editor/structure.ts +5 -8
- package/src/editor/tool-registry.ts +2 -1
- package/src/editor/types.ts +8 -1
- package/src/editor/variables.ts +74 -2
- 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 +17 -1
- 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/fonts/loaded.ts +9 -0
- package/src/figma-api/index.ts +35 -0
- package/src/figma-api/overrides.ts +295 -3
- package/src/figma-api/paints.ts +24 -9
- package/src/figma-api/proxy.ts +6 -1
- package/src/figma-api/reactions.ts +130 -32
- package/src/figma-api/serialization.ts +2 -1
- package/src/figma-api/shape-details.ts +50 -0
- package/src/figma-api/shape-with-text.ts +2 -5
- package/src/figma-api/surface.ts +7 -2
- package/src/global.d.ts +31 -0
- package/src/icons/svg.ts +3 -1
- package/src/io/formats/boolean-path.ts +60 -0
- 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/project.ts +40 -9
- package/src/io/formats/design-tokens/styles.ts +10 -2
- package/src/io/formats/design-tokens/sync/apply.ts +130 -0
- package/src/io/formats/design-tokens/sync/drift.ts +587 -0
- package/src/io/formats/design-tokens/sync/files.ts +40 -0
- 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 +5 -1
- package/src/io/formats/fig/export/patch/index.ts +8 -0
- 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/layers.ts +11 -2
- package/src/io/formats/html/vectors.ts +8 -2
- package/src/io/formats/pdf/document.ts +14 -4
- package/src/io/formats/pdf/dom.ts +10 -18
- package/src/io/formats/pdf/export.ts +1 -1
- package/src/io/formats/pen/imports.ts +5 -6
- package/src/io/formats/pen/index.ts +36 -5
- 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 +12 -1
- package/src/io/formats/svg/defs.ts +14 -73
- package/src/io/formats/svg/effects.ts +131 -0
- package/src/io/formats/svg/export.ts +371 -64
- package/src/io/formats/svg/filter.ts +47 -0
- package/src/io/formats/svg/grain.ts +249 -0
- package/src/io/formats/svg/strokes.ts +2 -2
- package/src/io/formats/svg/text/layout.ts +13 -3
- 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 +59 -11
- package/src/io/types.ts +29 -10
- package/src/layout/apply.ts +87 -21
- package/src/layout/auto-layout-handles.ts +396 -0
- package/src/layout/derived.ts +14 -0
- package/src/layout/grid.ts +33 -9
- package/src/layout/mutations.ts +13 -1
- package/src/layout/strokes.ts +12 -0
- package/src/layout/yoga-helpers.ts +18 -1
- package/src/layout.ts +96 -49
- package/src/lint/fixes.ts +12 -3
- package/src/lint/index.ts +3 -1
- package/src/lint/linter.ts +124 -12
- package/src/lint/presets.ts +2 -0
- package/src/lint/rules/design-memory.ts +97 -0
- package/src/lint/rules/effect-style-required.ts +2 -0
- package/src/lint/rules/index.ts +6 -1
- package/src/lint/rules/no-unbound-token-values.ts +73 -0
- package/src/lint/rules/text-style-required.ts +2 -0
- package/src/lint/types.ts +40 -0
- package/src/node/video.ts +196 -0
- package/src/pairdraw-api/design-memory.ts +61 -0
- package/src/pairdraw-api/index.ts +81 -0
- 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/index.ts +1 -0
- package/src/rpc/read-commands.ts +40 -23
- package/src/text/font/faces.ts +22 -0
- package/src/text/font/features.ts +27 -0
- package/src/text/font/manager.ts +88 -12
- package/src/text/index.ts +2 -0
- package/src/text/replace-fonts.ts +171 -0
- package/src/tools/analyze/responsive/index.ts +264 -0
- package/src/tools/analyze.ts +2 -0
- package/src/tools/codegen/token-sync.ts +98 -0
- package/src/tools/codegen.ts +1 -0
- package/src/tools/create/components.ts +4 -0
- package/src/tools/create/html.ts +1 -0
- package/src/tools/create/icons.ts +1 -0
- package/src/tools/create/mermaid.ts +1 -0
- package/src/tools/create/svg.ts +1 -0
- package/src/tools/design-memory.ts +72 -0
- package/src/tools/image-ai/generate.ts +2 -0
- package/src/tools/index.ts +1 -0
- package/src/tools/modify/fonts.ts +34 -0
- package/src/tools/modify/layout.ts +5 -0
- package/src/tools/modify/reactions.ts +15 -8
- package/src/tools/modify/text.ts +42 -5
- package/src/tools/modify/update.ts +46 -2
- package/src/tools/modify.ts +1 -0
- package/src/tools/read/fonts.ts +24 -2
- package/src/tools/read/libraries.ts +1 -0
- package/src/tools/read/nodes.ts +0 -1
- package/src/tools/read/space.ts +3 -2
- package/src/tools/registry/core.ts +3 -1
- package/src/tools/registry/extended.ts +28 -1
- package/src/tools/schema.ts +28 -4
- package/src/tools/stock-photo.ts +1 -0
- package/src/tools/structure/basic.ts +1 -0
- package/src/tools/structure/batch.ts +34 -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/vector/boolean.ts +4 -0
- package/src/tools/vector/path.ts +30 -6
- package/src/tools/vector/vectorize.ts +1 -0
- package/src/tools/vector/video.ts +228 -0
- package/src/tools/vector.ts +1 -0
- package/src/tools/video-host.ts +18 -0
- package/src/xpath.ts +6 -1
|
@@ -9,6 +9,8 @@ export default defineRule({
|
|
|
9
9
|
check(node, context) {
|
|
10
10
|
const visibleEffects = node.effects.filter((effect) => effect.visible)
|
|
11
11
|
if (visibleEffects.length === 0) return
|
|
12
|
+
// A link to a shared EFFECT style is already the preset this rule asks for.
|
|
13
|
+
if (context.isSharedStyle('effect', node.effectStyleId)) return
|
|
12
14
|
context.report({
|
|
13
15
|
node,
|
|
14
16
|
message: `Effect without shared style: ${visibleEffects.map((effect) => `${effect.type} ${effect.radius}px`).join(', ')}`,
|
package/src/lint/rules/index.ts
CHANGED
|
@@ -15,12 +15,14 @@ export { default as noGroups } from './no-groups'
|
|
|
15
15
|
export { default as effectStyleRequired } from './effect-style-required'
|
|
16
16
|
export { default as noMixedStyles } from './no-mixed-styles'
|
|
17
17
|
export { default as noDetachedInstances } from './no-detached-instances'
|
|
18
|
+
export { default as noUnboundTokenValues } from './no-unbound-token-values'
|
|
18
19
|
|
|
19
20
|
import type { Rule } from '#core/lint/types'
|
|
20
21
|
|
|
21
22
|
import colorContrast from './color-contrast'
|
|
22
23
|
import consistentRadius from './consistent-radius'
|
|
23
24
|
import consistentSpacing from './consistent-spacing'
|
|
25
|
+
import { designMemoryRules } from './design-memory'
|
|
24
26
|
import effectStyleRequired from './effect-style-required'
|
|
25
27
|
import minTextSize from './min-text-size'
|
|
26
28
|
import noDeeplyNested from './no-deeply-nested'
|
|
@@ -31,6 +33,7 @@ import noGroups from './no-groups'
|
|
|
31
33
|
import noHardcodedColors from './no-hardcoded-colors'
|
|
32
34
|
import noHiddenLayers from './no-hidden-layers'
|
|
33
35
|
import noMixedStyles from './no-mixed-styles'
|
|
36
|
+
import noUnboundTokenValues from './no-unbound-token-values'
|
|
34
37
|
import pixelPerfect from './pixel-perfect'
|
|
35
38
|
import preferAutoLayout from './prefer-auto-layout'
|
|
36
39
|
import textStyleRequired from './text-style-required'
|
|
@@ -38,6 +41,7 @@ import touchTargetSize from './touch-target-size'
|
|
|
38
41
|
|
|
39
42
|
export const allRules: Record<string, Rule> = {
|
|
40
43
|
'no-hardcoded-colors': noHardcodedColors,
|
|
44
|
+
'no-unbound-token-values': noUnboundTokenValues,
|
|
41
45
|
'no-default-names': noDefaultNames,
|
|
42
46
|
'prefer-auto-layout': preferAutoLayout,
|
|
43
47
|
'consistent-spacing': consistentSpacing,
|
|
@@ -53,5 +57,6 @@ export const allRules: Record<string, Rule> = {
|
|
|
53
57
|
'no-groups': noGroups,
|
|
54
58
|
'effect-style-required': effectStyleRequired,
|
|
55
59
|
'no-mixed-styles': noMixedStyles,
|
|
56
|
-
'no-detached-instances': noDetachedInstances
|
|
60
|
+
'no-detached-instances': noDetachedInstances,
|
|
61
|
+
...designMemoryRules
|
|
57
62
|
}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { defineRule } from '#core/lint/rule'
|
|
2
|
+
import type { LintFix, LintNode, TokenNumberField } from '#core/lint/types'
|
|
3
|
+
|
|
4
|
+
const SPACING_FIELDS = [
|
|
5
|
+
'itemSpacing',
|
|
6
|
+
'paddingTop',
|
|
7
|
+
'paddingRight',
|
|
8
|
+
'paddingBottom',
|
|
9
|
+
'paddingLeft'
|
|
10
|
+
] as const satisfies readonly TokenNumberField[]
|
|
11
|
+
|
|
12
|
+
const FIELD_LABELS: Record<TokenNumberField, string> = {
|
|
13
|
+
cornerRadius: 'Corner radius',
|
|
14
|
+
itemSpacing: 'Gap',
|
|
15
|
+
paddingTop: 'Top padding',
|
|
16
|
+
paddingRight: 'Right padding',
|
|
17
|
+
paddingBottom: 'Bottom padding',
|
|
18
|
+
paddingLeft: 'Left padding',
|
|
19
|
+
fontSize: 'Font size'
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* The fields a layer of this kind sets for itself: spacing only in auto layout, and no font size
|
|
24
|
+
* where a text style supplies it, since the style is where a binding belongs.
|
|
25
|
+
*/
|
|
26
|
+
function fieldsOf(node: LintNode): TokenNumberField[] {
|
|
27
|
+
if (node.type === 'TEXT') return node.textStyleId ? [] : ['fontSize']
|
|
28
|
+
const fields: TokenNumberField[] = ['cornerRadius']
|
|
29
|
+
if (node.layoutMode !== 'NONE') fields.push(...SPACING_FIELDS)
|
|
30
|
+
return fields
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
function bindTo(field: TokenNumberField, variable: { id: string; name: string }): LintFix {
|
|
34
|
+
return {
|
|
35
|
+
kind: 'bind-variable',
|
|
36
|
+
path: field,
|
|
37
|
+
variableId: variable.id,
|
|
38
|
+
variableName: variable.name
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export default defineRule({
|
|
43
|
+
meta: {
|
|
44
|
+
id: 'no-unbound-token-values',
|
|
45
|
+
category: 'design-tokens',
|
|
46
|
+
description: 'Radii, spacing, and font sizes that equal a token should be bound to it'
|
|
47
|
+
},
|
|
48
|
+
match: ['RECTANGLE', 'FRAME', 'COMPONENT', 'INSTANCE', 'TEXT'],
|
|
49
|
+
check(node, context) {
|
|
50
|
+
const { numbersByField } = context.variables
|
|
51
|
+
if (numbersByField.size === 0) return
|
|
52
|
+
for (const field of fieldsOf(node)) {
|
|
53
|
+
const value = node[field]
|
|
54
|
+
// Zero means "none" far more often than it means a token.
|
|
55
|
+
if (value <= 0 || node.boundVariables[field]) continue
|
|
56
|
+
const matches = numbersByField.get(field)?.get(value) ?? []
|
|
57
|
+
const only = matches.at(0)
|
|
58
|
+
if (!only) continue
|
|
59
|
+
const label = FIELD_LABELS[field]
|
|
60
|
+
const names = matches.map((variable) => `"${variable.name}"`).join(', ')
|
|
61
|
+
context.report({
|
|
62
|
+
node,
|
|
63
|
+
message: `${label} ${value} matches token ${names}`,
|
|
64
|
+
suggest:
|
|
65
|
+
matches.length === 1 ? `Bind ${label.toLowerCase()} to "${only.name}"` : 'Bind one token',
|
|
66
|
+
data: { field, value, variableId: only.id, variableName: only.name },
|
|
67
|
+
...(matches.length === 1
|
|
68
|
+
? { fix: bindTo(field, only) }
|
|
69
|
+
: { suggestions: matches.map((variable) => bindTo(field, variable)) })
|
|
70
|
+
})
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
})
|
|
@@ -9,6 +9,8 @@ export default defineRule({
|
|
|
9
9
|
match: ['TEXT'],
|
|
10
10
|
check(node, context) {
|
|
11
11
|
if (node.text.length <= 2) return
|
|
12
|
+
// A shared text style is already the shared typography this rule asks for.
|
|
13
|
+
if (context.isSharedStyle('text', node.textStyleId)) return
|
|
12
14
|
if (node.boundVariables.fontSize || node.boundVariables.fontFamily) return
|
|
13
15
|
// Suggesting a binding is only actionable when the document has typography values to bind.
|
|
14
16
|
const { FLOAT, STRING } = context.variables.counts
|
package/src/lint/types.ts
CHANGED
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
import type { SharedStyleKind } from '@pairdraw/scene-graph'
|
|
2
|
+
|
|
3
|
+
import type { DesignRules, DesignViolation } from '#core/design-memory'
|
|
4
|
+
|
|
1
5
|
export type Severity = 'error' | 'warning' | 'info' | 'off'
|
|
2
6
|
|
|
3
7
|
export type Category =
|
|
@@ -8,6 +12,7 @@ export type Category =
|
|
|
8
12
|
| 'components'
|
|
9
13
|
| 'design-tokens'
|
|
10
14
|
| 'typography'
|
|
15
|
+
| 'design-memory'
|
|
11
16
|
|
|
12
17
|
export interface RuleMeta {
|
|
13
18
|
id: string
|
|
@@ -124,6 +129,10 @@ export interface LintNode {
|
|
|
124
129
|
visible: boolean
|
|
125
130
|
radius: number
|
|
126
131
|
}>
|
|
132
|
+
/** The shared text style this layer uses, when it has one. */
|
|
133
|
+
textStyleId: string | null
|
|
134
|
+
/** The shared effect style this layer uses, when it has one. */
|
|
135
|
+
effectStyleId: string | null
|
|
127
136
|
parent?: LintNode
|
|
128
137
|
}
|
|
129
138
|
|
|
@@ -133,10 +142,39 @@ export interface LintVariables {
|
|
|
133
142
|
counts: Readonly<Record<'COLOR' | 'FLOAT' | 'STRING' | 'BOOLEAN', number>>
|
|
134
143
|
/** Color variables by their resolved `#RRGGBB` value, for suggesting an exact match. */
|
|
135
144
|
colorsByHex: ReadonlyMap<string, { id: string; name: string }>
|
|
145
|
+
/**
|
|
146
|
+
* Number variables by the layer field their kind of token sets (`cornerRadius` for a radius,
|
|
147
|
+
* the gap and padding for spacing, `fontSize` for text) and then by their resolved value.
|
|
148
|
+
*/
|
|
149
|
+
numbersByField: ReadonlyMap<
|
|
150
|
+
TokenNumberField,
|
|
151
|
+
ReadonlyMap<number, ReadonlyArray<{ id: string; name: string }>>
|
|
152
|
+
>
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
/** Layer fields a number token can stand for. */
|
|
156
|
+
export type TokenNumberField =
|
|
157
|
+
| 'cornerRadius'
|
|
158
|
+
| 'itemSpacing'
|
|
159
|
+
| 'paddingTop'
|
|
160
|
+
| 'paddingRight'
|
|
161
|
+
| 'paddingBottom'
|
|
162
|
+
| 'paddingLeft'
|
|
163
|
+
| 'fontSize'
|
|
164
|
+
|
|
165
|
+
/** The document's design memory, for the rules that check layers against it. */
|
|
166
|
+
export interface LintDesignMemory {
|
|
167
|
+
rules: DesignRules
|
|
168
|
+
/** The values on the layer that break the memory. */
|
|
169
|
+
violations(node: LintNode): readonly DesignViolation[]
|
|
136
170
|
}
|
|
137
171
|
|
|
138
172
|
export interface RuleContext {
|
|
139
173
|
variables: LintVariables
|
|
174
|
+
/** Whether `id`, a layer's style link, names a shared style of that kind in the document. */
|
|
175
|
+
isSharedStyle(kind: SharedStyleKind, id: string | null): boolean
|
|
176
|
+
/** Absent or null when the document has no design memory. */
|
|
177
|
+
design?: LintDesignMemory | null
|
|
140
178
|
report(issue: {
|
|
141
179
|
node: LintNode
|
|
142
180
|
message: string
|
|
@@ -144,6 +182,8 @@ export interface RuleContext {
|
|
|
144
182
|
data?: LintMessageData
|
|
145
183
|
fix?: LintFix
|
|
146
184
|
suggestions?: LintFix[]
|
|
185
|
+
/** A milder severity for this finding than the rule's, never a harsher one. */
|
|
186
|
+
severity?: Exclude<Severity, 'off' | 'error'>
|
|
147
187
|
}): void
|
|
148
188
|
getConfig(): unknown
|
|
149
189
|
getParent(node: LintNode): LintNode | null
|
|
@@ -0,0 +1,196 @@
|
|
|
1
|
+
import { spawn } from 'node:child_process'
|
|
2
|
+
import { once } from 'node:events'
|
|
3
|
+
import { rmSync } from 'node:fs'
|
|
4
|
+
import { mkdtemp, readFile, rm, stat } from 'node:fs/promises'
|
|
5
|
+
import { tmpdir } from 'node:os'
|
|
6
|
+
import { join } from 'node:path'
|
|
7
|
+
|
|
8
|
+
import type { VideoFormat, VideoHostEncoder, VideoSink } from '#core/io/formats/video'
|
|
9
|
+
|
|
10
|
+
/** The encoder and settings ffmpeg records each format with: H.264 and VP9 in 4:2:0. */
|
|
11
|
+
const ENCODERS = {
|
|
12
|
+
mp4: {
|
|
13
|
+
encoder: 'libx264',
|
|
14
|
+
args: ['-c:v', 'libx264', '-preset', 'medium', '-crf', '20', '-movflags', '+faststart']
|
|
15
|
+
},
|
|
16
|
+
webm: { encoder: 'libvpx-vp9', args: ['-c:v', 'libvpx-vp9', '-b:v', '0', '-crf', '32'] }
|
|
17
|
+
} as const
|
|
18
|
+
|
|
19
|
+
/** The tail of ffmpeg's error output a failure reports. */
|
|
20
|
+
const STDERR_TAIL = 2000
|
|
21
|
+
|
|
22
|
+
/** Folders of ffmpeg sinks still running in this process, removed when it is interrupted. */
|
|
23
|
+
const temporaryDirs = new Set<string>()
|
|
24
|
+
let cleanupInstalled = false
|
|
25
|
+
|
|
26
|
+
function cleanupTemporaryDirs(): void {
|
|
27
|
+
for (const dir of temporaryDirs) rmSync(dir, { recursive: true, force: true })
|
|
28
|
+
temporaryDirs.clear()
|
|
29
|
+
removeCleanupListeners()
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
function interrupted(signal: 'SIGINT' | 'SIGTERM'): void {
|
|
33
|
+
cleanupTemporaryDirs()
|
|
34
|
+
// With our listener gone, the same signal takes its default path, so the exit code stays.
|
|
35
|
+
process.kill(process.pid, signal)
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
const onInterrupt = () => interrupted('SIGINT')
|
|
39
|
+
const onTerminate = () => interrupted('SIGTERM')
|
|
40
|
+
|
|
41
|
+
function installCleanupListeners(): void {
|
|
42
|
+
if (cleanupInstalled) return
|
|
43
|
+
cleanupInstalled = true
|
|
44
|
+
process.once('exit', cleanupTemporaryDirs)
|
|
45
|
+
process.once('SIGINT', onInterrupt)
|
|
46
|
+
process.once('SIGTERM', onTerminate)
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
function removeCleanupListeners(): void {
|
|
50
|
+
if (!cleanupInstalled) return
|
|
51
|
+
cleanupInstalled = false
|
|
52
|
+
process.off('exit', cleanupTemporaryDirs)
|
|
53
|
+
process.off('SIGINT', onInterrupt)
|
|
54
|
+
process.off('SIGTERM', onTerminate)
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
function trackTemporaryDir(dir: string): void {
|
|
58
|
+
temporaryDirs.add(dir)
|
|
59
|
+
installCleanupListeners()
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
function releaseTemporaryDir(dir: string): void {
|
|
63
|
+
temporaryDirs.delete(dir)
|
|
64
|
+
if (temporaryDirs.size === 0) removeCleanupListeners()
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
/** The encoders `command` lists, or none when it cannot run. */
|
|
68
|
+
function listEncoders(command: string): Promise<string> {
|
|
69
|
+
return new Promise((resolve) => {
|
|
70
|
+
const child = spawn(command, ['-hide_banner', '-encoders'], {
|
|
71
|
+
stdio: ['ignore', 'pipe', 'ignore']
|
|
72
|
+
})
|
|
73
|
+
let output = ''
|
|
74
|
+
child.stdout.setEncoding('utf8')
|
|
75
|
+
child.stdout.on('data', (chunk: string) => {
|
|
76
|
+
output += chunk
|
|
77
|
+
})
|
|
78
|
+
child.on('error', () => resolve(''))
|
|
79
|
+
child.on('close', (code) => resolve(code === 0 ? output : ''))
|
|
80
|
+
})
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
* Encodes recorded frames with an ffmpeg on the machine, for hosts without WebCodecs such as the
|
|
85
|
+
* CLI: raw RGBA frames go to its input as they come, and the file is read back when it ends.
|
|
86
|
+
* A missing `command`, or one without libx264 or libvpx-vp9, supports nothing.
|
|
87
|
+
*/
|
|
88
|
+
export function createFFmpegEncoder(command = 'ffmpeg'): VideoHostEncoder {
|
|
89
|
+
let encoders: Promise<string> | null = null
|
|
90
|
+
|
|
91
|
+
return {
|
|
92
|
+
async supports(format: VideoFormat) {
|
|
93
|
+
if (format === 'gif') return false
|
|
94
|
+
encoders ??= listEncoders(command)
|
|
95
|
+
return (await encoders).includes(ENCODERS[format].encoder)
|
|
96
|
+
},
|
|
97
|
+
async create(format, options): Promise<VideoSink> {
|
|
98
|
+
if (format === 'gif') throw new Error('ffmpeg records MP4 and WebM, not GIF')
|
|
99
|
+
const dir = await mkdtemp(join(tmpdir(), 'pairdraw-ffmpeg-'))
|
|
100
|
+
trackTemporaryDir(dir)
|
|
101
|
+
const output = join(dir, `video.${format}`)
|
|
102
|
+
let byteLength = 0
|
|
103
|
+
const state = {
|
|
104
|
+
/** finish or cancel ran, so no frame may follow. */
|
|
105
|
+
ended: false,
|
|
106
|
+
/** ffmpeg stopped reading, which a dying ffmpeg does before it exits. */
|
|
107
|
+
inputClosed: false
|
|
108
|
+
}
|
|
109
|
+
const child = spawn(
|
|
110
|
+
command,
|
|
111
|
+
[
|
|
112
|
+
'-hide_banner',
|
|
113
|
+
'-loglevel',
|
|
114
|
+
'error',
|
|
115
|
+
'-f',
|
|
116
|
+
'rawvideo',
|
|
117
|
+
'-pix_fmt',
|
|
118
|
+
'rgba',
|
|
119
|
+
'-s',
|
|
120
|
+
`${options.width}x${options.height}`,
|
|
121
|
+
'-r',
|
|
122
|
+
String(options.fps),
|
|
123
|
+
'-i',
|
|
124
|
+
'pipe:0',
|
|
125
|
+
...ENCODERS[format].args,
|
|
126
|
+
'-pix_fmt',
|
|
127
|
+
'yuv420p',
|
|
128
|
+
'-y',
|
|
129
|
+
output
|
|
130
|
+
],
|
|
131
|
+
{ stdio: ['pipe', 'ignore', 'pipe'] }
|
|
132
|
+
)
|
|
133
|
+
let stderr = ''
|
|
134
|
+
// ffmpeg stopping early closes its input; the frame that finds it closed reports why.
|
|
135
|
+
child.stdin.on('error', () => {
|
|
136
|
+
state.inputClosed = true
|
|
137
|
+
})
|
|
138
|
+
child.stderr.setEncoding('utf8')
|
|
139
|
+
child.stderr.on('data', (chunk: string) => {
|
|
140
|
+
stderr = (stderr + chunk).slice(-STDERR_TAIL)
|
|
141
|
+
})
|
|
142
|
+
const exited = new Promise<number | null>((resolve) => {
|
|
143
|
+
child.on('error', () => resolve(-1))
|
|
144
|
+
child.on('close', (code) => resolve(code))
|
|
145
|
+
})
|
|
146
|
+
|
|
147
|
+
const failure = () =>
|
|
148
|
+
new Error(`ffmpeg could not encode the video: ${stderr.trim() || 'it stopped'}`)
|
|
149
|
+
/** Waits for ffmpeg to exit, so its error output is complete, then reports it. */
|
|
150
|
+
const failed = async (): Promise<never> => {
|
|
151
|
+
await exited
|
|
152
|
+
throw failure()
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
return {
|
|
156
|
+
async add(image) {
|
|
157
|
+
if (state.ended) throw new Error('The recording has ended')
|
|
158
|
+
if (state.inputClosed) await failed()
|
|
159
|
+
if (!child.stdin.write(image.data)) {
|
|
160
|
+
// `once` drops its listeners whichever way the wait ends; ffmpeg exiting ends it too.
|
|
161
|
+
const drained = once(child.stdin, 'drain').then(() => true)
|
|
162
|
+
const ok = await Promise.race([drained, exited.then(() => false)]).catch(() => false)
|
|
163
|
+
if (!ok || state.inputClosed) await failed()
|
|
164
|
+
}
|
|
165
|
+
byteLength = (await stat(output).catch(() => null))?.size ?? byteLength
|
|
166
|
+
},
|
|
167
|
+
async finish() {
|
|
168
|
+
if (state.ended) throw new Error('The recording has ended')
|
|
169
|
+
state.ended = true
|
|
170
|
+
child.stdin.end()
|
|
171
|
+
const code = await exited
|
|
172
|
+
try {
|
|
173
|
+
if (code !== 0) throw failure()
|
|
174
|
+
return new Uint8Array(await readFile(output))
|
|
175
|
+
} finally {
|
|
176
|
+
await rm(dir, { recursive: true, force: true })
|
|
177
|
+
releaseTemporaryDir(dir)
|
|
178
|
+
}
|
|
179
|
+
},
|
|
180
|
+
async cancel() {
|
|
181
|
+
if (!state.ended) {
|
|
182
|
+
state.ended = true
|
|
183
|
+
child.kill('SIGKILL')
|
|
184
|
+
}
|
|
185
|
+
await exited
|
|
186
|
+
// Whatever ended the recording, its folder goes with it.
|
|
187
|
+
await rm(dir, { recursive: true, force: true })
|
|
188
|
+
releaseTemporaryDir(dir)
|
|
189
|
+
},
|
|
190
|
+
get byteLength() {
|
|
191
|
+
return byteLength
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import type { SceneGraph } from '@pairdraw/scene-graph'
|
|
2
|
+
import {
|
|
3
|
+
addDesignDecision,
|
|
4
|
+
cachedDesignMemory,
|
|
5
|
+
pinDesignExample,
|
|
6
|
+
writeDesignMemory,
|
|
7
|
+
type DesignMemory,
|
|
8
|
+
type DesignMemoryGroup
|
|
9
|
+
} from '@pairdraw/scene-graph/design-memory'
|
|
10
|
+
|
|
11
|
+
import { checkDesignValues, currentDesignRules, type DesignValueVerdict } from '#core/design-memory'
|
|
12
|
+
|
|
13
|
+
import { nodeOf, type NodeRef } from './behaviours'
|
|
14
|
+
|
|
15
|
+
const NO_MEMORY =
|
|
16
|
+
'This document has no design memory; the person creates one in the Design panel with nothing selected.'
|
|
17
|
+
|
|
18
|
+
function memoryOf(graph: SceneGraph): DesignMemory {
|
|
19
|
+
const memory = cachedDesignMemory(graph)
|
|
20
|
+
if (!memory) throw new Error(NO_MEMORY)
|
|
21
|
+
return memory
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
/** Judges values before they are used: `ok`, `warn`, `refuse`, or `invalid`, with the nearest allowed. */
|
|
25
|
+
export function checkProposedDesignValues(
|
|
26
|
+
graph: SceneGraph,
|
|
27
|
+
proposal: Partial<Record<DesignMemoryGroup, readonly (string | number)[]>>
|
|
28
|
+
): DesignValueVerdict[] {
|
|
29
|
+
return checkDesignValues(currentDesignRules(graph, memoryOf(graph)), proposal)
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Writes down a decision an agent made, and pins `example` as a layer that shows it. Agents add
|
|
34
|
+
* to the memory but never change what it allows: only the person does that.
|
|
35
|
+
*/
|
|
36
|
+
export function recordDesignDecision(
|
|
37
|
+
graph: SceneGraph,
|
|
38
|
+
text: string,
|
|
39
|
+
example?: NodeRef
|
|
40
|
+
): { decisions: number; examples: number } {
|
|
41
|
+
let memory = memoryOf(graph)
|
|
42
|
+
const decisions = memory.decisions.length
|
|
43
|
+
memory = addDesignDecision(memory, text, 'agent')
|
|
44
|
+
if (memory.decisions.length === decisions) {
|
|
45
|
+
throw new Error(
|
|
46
|
+
text.trim()
|
|
47
|
+
? 'The design memory holds as many decisions as it can; ask the person to remove some.'
|
|
48
|
+
: 'A decision needs text.'
|
|
49
|
+
)
|
|
50
|
+
}
|
|
51
|
+
if (example !== undefined) {
|
|
52
|
+
const nodeId = nodeOf(graph, example).id
|
|
53
|
+
memory = pinDesignExample(memory, nodeId)
|
|
54
|
+
if (!memory.examples.some((pinned) => pinned.nodeId === nodeId))
|
|
55
|
+
throw new Error(
|
|
56
|
+
'The design memory holds as many examples as it can; ask the person to unpin some.'
|
|
57
|
+
)
|
|
58
|
+
}
|
|
59
|
+
writeDesignMemory(graph, memory)
|
|
60
|
+
return { decisions: memory.decisions.length, examples: memory.examples.length }
|
|
61
|
+
}
|
|
@@ -6,8 +6,14 @@ import {
|
|
|
6
6
|
type BehaviourSpec
|
|
7
7
|
} from '@pairdraw/scene-graph/behaviours'
|
|
8
8
|
import type { OkHCLColor, OkHCLPayload } from '@pairdraw/scene-graph/color'
|
|
9
|
+
import type { DesignMemoryGroup } from '@pairdraw/scene-graph/design-memory'
|
|
9
10
|
import { parseVariableFormula } from '@pairdraw/scene-graph/variables'
|
|
10
11
|
|
|
12
|
+
import {
|
|
13
|
+
describeDesignMemory,
|
|
14
|
+
type DesignMemoryReport,
|
|
15
|
+
type DesignValueVerdict
|
|
16
|
+
} from '#core/design-memory'
|
|
11
17
|
import { exposeInstanceSwap } from '#core/figma-api/components'
|
|
12
18
|
import type { FigmaAPI, FigmaNodeProxy } from '#core/figma-api/index'
|
|
13
19
|
import { writeVariableValue } from '#core/figma-api/variables'
|
|
@@ -29,22 +35,32 @@ import {
|
|
|
29
35
|
type CommentHandle,
|
|
30
36
|
type NewComment
|
|
31
37
|
} from './comments'
|
|
38
|
+
import { checkProposedDesignValues, recordDesignDecision } from './design-memory'
|
|
32
39
|
import {
|
|
33
40
|
readFillOkHCL,
|
|
34
41
|
readLayoutDirection,
|
|
35
42
|
readStrokeOkHCL,
|
|
36
43
|
readTextDirection,
|
|
37
44
|
writeFillOkHCL,
|
|
45
|
+
writeFontFeatures,
|
|
38
46
|
writeLayoutDirection,
|
|
47
|
+
writeRangeFontFeatures,
|
|
39
48
|
writeStrokeOkHCL,
|
|
40
49
|
writeTextDirection
|
|
41
50
|
} from './nodes'
|
|
42
51
|
import { getStatus, listStatuses, setStatus, type StatusInfo } from './statuses'
|
|
43
52
|
import { bindVariable, unbindVariable, type VariableRef } from './variables'
|
|
53
|
+
import {
|
|
54
|
+
createVariationSet,
|
|
55
|
+
getVariationSet,
|
|
56
|
+
listVariationSets,
|
|
57
|
+
type VariationSetHandle
|
|
58
|
+
} from './variations'
|
|
44
59
|
|
|
45
60
|
export { BehaviourHandle, type NodeRef } from './behaviours'
|
|
46
61
|
export type { StatusInfo } from './statuses'
|
|
47
62
|
export type { VariableRef } from './variables'
|
|
63
|
+
export { VariationSetHandle, type VariationSetInfo } from './variations'
|
|
48
64
|
export {
|
|
49
65
|
CommentHandle,
|
|
50
66
|
DEFAULT_COMMENT_AUTHOR,
|
|
@@ -176,6 +192,56 @@ export class PairdrawAPI {
|
|
|
176
192
|
setStatus(this.figma.graph, node, status)
|
|
177
193
|
}
|
|
178
194
|
|
|
195
|
+
/**
|
|
196
|
+
* The document's design memory: the colors, fonts, sizes, spacing and radii agents may use,
|
|
197
|
+
* whether an off-system value is refused or warned about, the decisions written down, and the
|
|
198
|
+
* layers pinned as examples. Null when the document has none.
|
|
199
|
+
*/
|
|
200
|
+
get designMemory(): DesignMemoryReport | null {
|
|
201
|
+
return describeDesignMemory(this.figma.graph)
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
/**
|
|
205
|
+
* Judge values before using them, such as `{ colors: ['#FF00AA'], spacing: [13] }`: each comes
|
|
206
|
+
* back `ok`, `warn`, `refuse` or `invalid`, with the nearest allowed value.
|
|
207
|
+
*/
|
|
208
|
+
checkDesignValues(
|
|
209
|
+
proposal: Partial<Record<DesignMemoryGroup, readonly (string | number)[]>>
|
|
210
|
+
): DesignValueVerdict[] {
|
|
211
|
+
return checkProposedDesignValues(this.figma.graph, proposal)
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
/**
|
|
215
|
+
* Write a decision down in the design memory, optionally pinning a layer that shows it as an
|
|
216
|
+
* example. The memory's allowed values stay as the person set them.
|
|
217
|
+
*/
|
|
218
|
+
recordDesignDecision(text: string, example?: NodeRef): { decisions: number; examples: number } {
|
|
219
|
+
return recordDesignDecision(this.figma.graph, text, example)
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
/**
|
|
223
|
+
* Copy a layer `count` times (1 to 8) into a section of variations beside it, made the first
|
|
224
|
+
* time; `labels` name what each version tries, as in `V2 · Calmer palette`. On a version, it
|
|
225
|
+
* copies that version into its set. The original does not change.
|
|
226
|
+
*/
|
|
227
|
+
createVariations(
|
|
228
|
+
node: NodeRef,
|
|
229
|
+
options: { count: number; labels?: readonly string[] }
|
|
230
|
+
): { set: VariationSetHandle; versions: FigmaNodeProxy[] } {
|
|
231
|
+
const { set, created } = createVariationSet(this.figma, node, options)
|
|
232
|
+
return { set, versions: created }
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
/** The set of variations a layer belongs to, from its section, a version or a layer inside one. */
|
|
236
|
+
getVariations(node: NodeRef): VariationSetHandle | null {
|
|
237
|
+
return getVariationSet(this.figma, node)
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
/** The sets of variations on the current page. */
|
|
241
|
+
get variations(): VariationSetHandle[] {
|
|
242
|
+
return listVariationSets(this.figma, this.figma.currentPageId)
|
|
243
|
+
}
|
|
244
|
+
|
|
179
245
|
/**
|
|
180
246
|
* Expose a swap on instances as one INSTANCE_SWAP property, offering the candidate components;
|
|
181
247
|
* returns the layer that holds the property.
|
|
@@ -239,4 +305,19 @@ export class PairdrawAPI {
|
|
|
239
305
|
setTextDirection(node: NodeRef, direction: string): void {
|
|
240
306
|
writeTextDirection(this.figma.graph, node, direction)
|
|
241
307
|
}
|
|
308
|
+
|
|
309
|
+
/** Merges OpenType feature toggles into the text's own, keeping the tags it does not name. */
|
|
310
|
+
setFontFeatures(node: NodeRef, features: Record<string, boolean>): void {
|
|
311
|
+
writeFontFeatures(this.figma.graph, node, features)
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
/** Merges OpenType feature toggles into a text range's own, keeping its other features. */
|
|
315
|
+
setRangeFontFeatures(
|
|
316
|
+
node: NodeRef,
|
|
317
|
+
start: number,
|
|
318
|
+
end: number,
|
|
319
|
+
features: Record<string, boolean>
|
|
320
|
+
): void {
|
|
321
|
+
writeRangeFontFeatures(this.figma.graph, node, start, end, features)
|
|
322
|
+
}
|
|
242
323
|
}
|
|
@@ -12,6 +12,9 @@ import {
|
|
|
12
12
|
import { recordInstanceOverride } from '@pairdraw/scene-graph/instances'
|
|
13
13
|
|
|
14
14
|
import { assertNodeEditable } from '#core/editor/capabilities'
|
|
15
|
+
import { openTypeFeaturesPatch } from '#core/figma-api/accessors/text/opentype'
|
|
16
|
+
import { assertTextRange } from '#core/figma-api/text/style'
|
|
17
|
+
import { styleRunsWithPatch } from '#core/text/character-style'
|
|
15
18
|
|
|
16
19
|
import { nodeOf, type NodeRef } from './behaviours'
|
|
17
20
|
|
|
@@ -82,3 +85,38 @@ export function readTextDirection(graph: SceneGraph, ref: NodeRef): TextDirectio
|
|
|
82
85
|
export function writeTextDirection(graph: SceneGraph, ref: NodeRef, value: string): void {
|
|
83
86
|
editNode(graph, nodeOf(graph, ref), { textDirection: direction(value) })
|
|
84
87
|
}
|
|
88
|
+
|
|
89
|
+
/**
|
|
90
|
+
* Merges OpenType features into a text's own: the given tags replace their entries, the rest
|
|
91
|
+
* stay, as the panel's feature switches do. Figma's plugin API only reads a node's features;
|
|
92
|
+
* this is the write path the tools and the panel share.
|
|
93
|
+
*/
|
|
94
|
+
export function writeFontFeatures(
|
|
95
|
+
graph: SceneGraph,
|
|
96
|
+
ref: NodeRef,
|
|
97
|
+
features: Record<string, boolean>
|
|
98
|
+
): void {
|
|
99
|
+
const node = nodeOf(graph, ref)
|
|
100
|
+
const merged = new Map(node.fontFeatures.map((feature) => [feature.tag, feature.enabled]))
|
|
101
|
+
for (const [tag, enabled] of Object.entries(features)) merged.set(tag.toUpperCase(), enabled)
|
|
102
|
+
editNode(graph, node, {
|
|
103
|
+
fontFeatures: [...merged].map(([tag, enabled]) => ({ tag, enabled }))
|
|
104
|
+
})
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
/**
|
|
108
|
+
* Merges OpenType features into a text range's own, keeping the features its characters already
|
|
109
|
+
* had. Figma's plugin API has no range feature setter, so this lives on `pairdraw`.
|
|
110
|
+
*/
|
|
111
|
+
export function writeRangeFontFeatures(
|
|
112
|
+
graph: SceneGraph,
|
|
113
|
+
ref: NodeRef,
|
|
114
|
+
start: number,
|
|
115
|
+
end: number,
|
|
116
|
+
features: Record<string, boolean>
|
|
117
|
+
): void {
|
|
118
|
+
const node = nodeOf(graph, ref)
|
|
119
|
+
assertTextRange('setRangeFontFeatures', node, start, end)
|
|
120
|
+
const patch = openTypeFeaturesPatch('setRangeFontFeatures', node, start, features)
|
|
121
|
+
editNode(graph, node, { styleRuns: styleRunsWithPatch(node, start, end, patch) })
|
|
122
|
+
}
|