@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,7 +9,12 @@ import {
|
|
|
9
9
|
RenderChunkPictureCache
|
|
10
10
|
} from '#core/canvas/renderer/chunks'
|
|
11
11
|
|
|
12
|
-
import {
|
|
12
|
+
import {
|
|
13
|
+
TileImageCache,
|
|
14
|
+
viewportTileBytes,
|
|
15
|
+
viewportTileCacheBudget,
|
|
16
|
+
type TileMemory
|
|
17
|
+
} from './cache'
|
|
13
18
|
import { TILE_DEVICE_SIZE, tileLevel, tileWorldBounds, type TileWorldBounds } from './geometry'
|
|
14
19
|
import { planTiles } from './planner'
|
|
15
20
|
import { deleteRenderedTile, renderTile, tileChunks } from './render'
|
|
@@ -54,6 +59,25 @@ export class TiledSceneController {
|
|
|
54
59
|
maximumJobsPerFrame: MAXIMUM_TILE_JOBS_PER_FRAME
|
|
55
60
|
})
|
|
56
61
|
private readonly measuredCosts = new Map<string, number>()
|
|
62
|
+
private memory: TileMemory = {}
|
|
63
|
+
/** The tile bytes of the last frame's viewport, which a change of memory resizes the cache to. */
|
|
64
|
+
private viewportBytes = 0
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* Tells the cache what the host knows of the memory its tiles share. A hidden canvas draws no
|
|
68
|
+
* frames, so the budget changes at once rather than at the next frame.
|
|
69
|
+
*/
|
|
70
|
+
setMemory(memory: TileMemory): void {
|
|
71
|
+
this.memory = memory
|
|
72
|
+
if (this.viewportBytes > 0) {
|
|
73
|
+
this.tileCache.setBudget(viewportTileCacheBudget(this.viewportBytes, memory))
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
/** The tile cache's current byte budget. */
|
|
78
|
+
tileCacheBytes(): number {
|
|
79
|
+
return this.tileCache.budget()
|
|
80
|
+
}
|
|
57
81
|
|
|
58
82
|
invalidateNode(nodeId: string, graph?: SceneGraph): void {
|
|
59
83
|
const chunks = this.index?.getChunksDependingOnNode(nodeId) ?? []
|
|
@@ -97,6 +121,11 @@ export class TiledSceneController {
|
|
|
97
121
|
if (!index || !renderer.pageId) return this.emptyResult()
|
|
98
122
|
|
|
99
123
|
const level = tileLevel(renderer.zoom * renderer.dpr)
|
|
124
|
+
this.viewportBytes = viewportTileBytes(
|
|
125
|
+
renderer.viewportWidth * renderer.dpr,
|
|
126
|
+
renderer.viewportHeight * renderer.dpr
|
|
127
|
+
)
|
|
128
|
+
this.tileCache.setBudget(viewportTileCacheBudget(this.viewportBytes, this.memory))
|
|
100
129
|
const viewport = {
|
|
101
130
|
minX: -renderer.panX / renderer.zoom,
|
|
102
131
|
minY: -renderer.panY / renderer.zoom,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { VectorRegion, VectorVertex } from '@pairdraw/scene-graph'
|
|
1
|
+
import type { SceneGraph, VectorRegion, VectorVertex } from '@pairdraw/scene-graph'
|
|
2
2
|
import type { Color, Rect, Vector } from '@pairdraw/scene-graph/primitives'
|
|
3
3
|
import type { SnapGuide } from '@pairdraw/scene-graph/snap'
|
|
4
4
|
|
|
@@ -38,10 +38,24 @@ export interface PresenceCursor {
|
|
|
38
38
|
outline?: Rect[]
|
|
39
39
|
}
|
|
40
40
|
|
|
41
|
+
/**
|
|
42
|
+
* A top-level frame a playing prototype changed, which the canvas draws from the frame's private
|
|
43
|
+
* copy: the copy, a count that grows with each change, and the layers the changes touched, whose
|
|
44
|
+
* cached drawings are stale. `@pairdraw/core/prototype`'s play scenes are these.
|
|
45
|
+
*/
|
|
46
|
+
export interface RenderedPlayScene {
|
|
47
|
+
readonly graph: SceneGraph
|
|
48
|
+
readonly revision: number
|
|
49
|
+
readonly touched: ReadonlySet<string>
|
|
50
|
+
}
|
|
51
|
+
|
|
41
52
|
export interface RenderOverlays {
|
|
42
53
|
/** Whether the canvas previews: it draws the design without labels or editing outlines. */
|
|
43
54
|
playing?: boolean
|
|
44
|
-
/**
|
|
55
|
+
/** Top-level frames a playing prototype draws from its own copies instead of the document. */
|
|
56
|
+
playScenes?: ReadonlyMap<string, RenderedPlayScene>
|
|
57
|
+
/** How far a playing prototype scrolled each frame's content, by frame id. */
|
|
58
|
+
playScroll?: ReadonlyMap<string, Vector>
|
|
45
59
|
/** Layers a previewing canvas leaves to its live islands. */
|
|
46
60
|
playIslands?: ReadonlySet<string>
|
|
47
61
|
hoveredNodeId?: string | null
|
|
@@ -53,7 +67,6 @@ export interface RenderOverlays {
|
|
|
53
67
|
imageEdit?: ImageEdit | null
|
|
54
68
|
transforming?: boolean
|
|
55
69
|
measurementMode?: MeasurementMode
|
|
56
|
-
enteredContainerId?: string | null
|
|
57
70
|
editingTextId?: string | null
|
|
58
71
|
/** The layer whose name a field over the canvas renames, whose title the canvas leaves out. */
|
|
59
72
|
renamingLabelId?: string | null
|
|
@@ -72,6 +85,8 @@ export interface RenderOverlays {
|
|
|
72
85
|
autoLayoutHover?: {
|
|
73
86
|
nodeId: string
|
|
74
87
|
kind: 'frame' | 'children' | 'spacing' | 'spacing-value' | 'padding' | 'padding-value'
|
|
88
|
+
/** For a gap: whether it edits the flow's spacing or the wrapped lines' spacing. */
|
|
89
|
+
axis?: 'primary' | 'counter'
|
|
75
90
|
index?: number
|
|
76
91
|
side?: 'top' | 'right' | 'bottom' | 'left'
|
|
77
92
|
} | null
|
package/src/canvas/renderer.ts
CHANGED
|
@@ -18,6 +18,8 @@ import {
|
|
|
18
18
|
COMPONENT_SET_DASH_GAP,
|
|
19
19
|
COMPONENT_SET_BORDER_WIDTH,
|
|
20
20
|
EFFECT_FILTER_CACHE_ENTRIES,
|
|
21
|
+
NOISE_TILE_CACHE_ENTRIES,
|
|
22
|
+
TEXTURE_NOISE_CACHE_ENTRIES,
|
|
21
23
|
IS_BROWSER
|
|
22
24
|
} from '#core/constants'
|
|
23
25
|
import type { EditorState } from '#core/editor/types'
|
|
@@ -47,6 +49,7 @@ import { TextPreparationCache } from './text/preparation/cache'
|
|
|
47
49
|
export type {
|
|
48
50
|
MeasurementMode,
|
|
49
51
|
PresenceCursor,
|
|
52
|
+
RenderedPlayScene,
|
|
50
53
|
RenderOverlays,
|
|
51
54
|
RulerTheme,
|
|
52
55
|
SelectionTheme
|
|
@@ -85,7 +88,12 @@ import type { PlacedStatusLabel } from './labels/status'
|
|
|
85
88
|
import { EffectRasterCache } from './renderer/effect-raster-cache'
|
|
86
89
|
import { TiledSceneController } from './renderer/tiles'
|
|
87
90
|
import type { TransientCanvasPreview } from './renderer/transient-previews'
|
|
88
|
-
import type {
|
|
91
|
+
import type {
|
|
92
|
+
RenderedPlayScene,
|
|
93
|
+
RenderOverlays,
|
|
94
|
+
RulerTheme,
|
|
95
|
+
SelectionTheme
|
|
96
|
+
} from './renderer/types'
|
|
89
97
|
|
|
90
98
|
/**
|
|
91
99
|
* A picture uploaded as a texture that knows its size: an `ImageBitmap`, or a canvas, which
|
|
@@ -125,6 +133,21 @@ export class SkiaRenderer {
|
|
|
125
133
|
maxEntries: EFFECT_FILTER_CACHE_ENTRIES,
|
|
126
134
|
dispose: (filter) => filter.delete()
|
|
127
135
|
})
|
|
136
|
+
/**
|
|
137
|
+
* A noise effect's level and colour tiles, about 4 MB each. Bounded: a density or seed slider
|
|
138
|
+
* would otherwise keep a tile per step of a drag.
|
|
139
|
+
*/
|
|
140
|
+
noiseTileCache = new ResourceCache<string, Image>({
|
|
141
|
+
maxEntries: NOISE_TILE_CACHE_ENTRIES,
|
|
142
|
+
dispose: (image) => image.delete()
|
|
143
|
+
})
|
|
144
|
+
/** The compiled grain shader, made on the first noise drawn. */
|
|
145
|
+
noiseGrainEffect: RuntimeEffect | null = null
|
|
146
|
+
/** A texture's displacement tiles, 256 KB each, kept by grain size and seed. */
|
|
147
|
+
textureNoiseCache = new ResourceCache<string, Image>({
|
|
148
|
+
maxEntries: TEXTURE_NOISE_CACHE_ENTRIES,
|
|
149
|
+
dispose: (image) => image.delete()
|
|
150
|
+
})
|
|
128
151
|
_tmpColor = new Float32Array(4)
|
|
129
152
|
_tmpRect = new Float32Array(4)
|
|
130
153
|
textFont: Font | null = null
|
|
@@ -154,6 +177,11 @@ export class SkiaRenderer {
|
|
|
154
177
|
* with the surface whose GL context holds its texture.
|
|
155
178
|
*/
|
|
156
179
|
readonly liveImages = new Map<string, { image: Image; surface: Surface }>()
|
|
180
|
+
/**
|
|
181
|
+
* A raster export drawn finer than its pixels, and where world space lands on those pixels.
|
|
182
|
+
* An image that lands on them 1:1 is sampled nearest, as Figma keeps it sharp.
|
|
183
|
+
*/
|
|
184
|
+
supersampledOutput: { outputFromWorld: number[] } | null = null
|
|
157
185
|
viewportImageRendering = false
|
|
158
186
|
imageMemoryGraph: SceneGraph | null = null
|
|
159
187
|
imageMemoryPage: string | null = null
|
|
@@ -247,6 +275,10 @@ export class SkiaRenderer {
|
|
|
247
275
|
* presentation shows only its slide; null draws every layer of the page.
|
|
248
276
|
*/
|
|
249
277
|
sceneScopeId: string | null = null
|
|
278
|
+
/** Frames a playing prototype changed, which this canvas draws from their play scenes. */
|
|
279
|
+
playScenes: ReadonlyMap<string, RenderedPlayScene> | null = null
|
|
280
|
+
/** How far a playing prototype scrolled each frame's content, by frame id. */
|
|
281
|
+
playScroll: ReadonlyMap<string, Vector> | null = null
|
|
250
282
|
/** Status labels drawn in the last label pass; clicks on them open the status menu. */
|
|
251
283
|
statusLabels: PlacedStatusLabel[] = []
|
|
252
284
|
|
|
@@ -280,7 +312,6 @@ export class SkiaRenderer {
|
|
|
280
312
|
|
|
281
313
|
declare drawHoverHighlight: RendererDomainMethods['drawHoverHighlight']
|
|
282
314
|
declare drawMeasurements: RendererDomainMethods['drawMeasurements']
|
|
283
|
-
declare drawEnteredContainer: RendererDomainMethods['drawEnteredContainer']
|
|
284
315
|
declare drawSelection: RendererDomainMethods['drawSelection']
|
|
285
316
|
declare drawNodeSelection: RendererDomainMethods['drawNodeSelection']
|
|
286
317
|
declare drawSelectionLabels: RendererDomainMethods['drawSelectionLabels']
|
|
@@ -420,8 +451,13 @@ export class SkiaRenderer {
|
|
|
420
451
|
effectOverflow(node: SceneNode): number {
|
|
421
452
|
let expand = 0
|
|
422
453
|
for (const e of node.effects) {
|
|
423
|
-
// A shader effect has no radius, spread, or offset of its own
|
|
424
|
-
|
|
454
|
+
// A shader effect has no radius, spread, or offset of its own, and a noise stays inside
|
|
455
|
+
// the layer. A clipped texture does too; an unclipped one moves the edges out by its radius.
|
|
456
|
+
if (!e.visible || e.type === 'SHADER' || e.type === 'NOISE') continue
|
|
457
|
+
if (e.type === 'TEXTURE') {
|
|
458
|
+
if (!e.texture.clipToShape) expand = Math.max(expand, e.radius)
|
|
459
|
+
continue
|
|
460
|
+
}
|
|
425
461
|
const blur = e.radius
|
|
426
462
|
const spread = e.spread
|
|
427
463
|
const ox = Math.abs(e.offset.x)
|
package/src/canvas/scene.ts
CHANGED
|
@@ -17,10 +17,11 @@ import {
|
|
|
17
17
|
import { blurSigma } from '@pairdraw/scene-graph/geometry'
|
|
18
18
|
import { drawnChildIds } from '@pairdraw/scene-graph/layout'
|
|
19
19
|
import Matrix from '@pairdraw/scene-graph/matrix'
|
|
20
|
-
import type { Color } from '@pairdraw/scene-graph/primitives'
|
|
20
|
+
import type { Color, Vector } from '@pairdraw/scene-graph/primitives'
|
|
21
21
|
import { textLinesReach, textVerticalOffset } from '@pairdraw/scene-graph/text'
|
|
22
22
|
|
|
23
23
|
import { createSceneGeometry, nodeOrientationMatrix, projectedNode } from '#core/geometry'
|
|
24
|
+
import { liftedChildIds, scrollShiftX, scrollShiftY } from '#core/prototype/scroll'
|
|
24
25
|
import { shownText } from '#core/text/case'
|
|
25
26
|
import { mayHoldEmoji } from '#core/text/emoji'
|
|
26
27
|
import { fontManager } from '#core/text/font/manager'
|
|
@@ -44,6 +45,7 @@ import {
|
|
|
44
45
|
effectRasterScale,
|
|
45
46
|
effectRasterScaleMatches
|
|
46
47
|
} from './renderer/effect-raster-cache'
|
|
48
|
+
import { playSceneGraph } from './renderer/play-scenes'
|
|
47
49
|
import { mapVisualBounds, subtreeVisualBounds } from './renderer/visual-bounds'
|
|
48
50
|
import { drawShaderEffectChain } from './shaders/effect'
|
|
49
51
|
import { isolatesInnerShadows, renderLayerShadows } from './shadows'
|
|
@@ -73,6 +75,7 @@ import {
|
|
|
73
75
|
} from './text/derived'
|
|
74
76
|
import { drawLaidOutEmoji, drawSavedEmoji } from './text/emoji'
|
|
75
77
|
import { stickyPlaceholderNode } from './text/placeholder'
|
|
78
|
+
import { withTextureEffect } from './texture'
|
|
76
79
|
|
|
77
80
|
function drawVisibleFills(
|
|
78
81
|
r: SkiaRenderer,
|
|
@@ -219,24 +222,54 @@ export function renderChildIds(
|
|
|
219
222
|
overlays: RenderOverlays,
|
|
220
223
|
absX: number,
|
|
221
224
|
absY: number,
|
|
222
|
-
hasTransformedAncestor: boolean
|
|
225
|
+
hasTransformedAncestor: boolean,
|
|
226
|
+
scroll?: Vector
|
|
223
227
|
): void {
|
|
224
228
|
renderMaskedChildIds(
|
|
225
229
|
r,
|
|
226
230
|
canvas,
|
|
227
|
-
childIds,
|
|
231
|
+
liftedChildIds(graph, childIds, scroll),
|
|
228
232
|
(childId) => {
|
|
229
233
|
const child = graph.getNode(childId)
|
|
230
234
|
return child?.visible && child.isMask ? child.maskType : null
|
|
231
235
|
},
|
|
232
|
-
(childId) => r.renderNode(canvas, graph, childId, overlays, absX, absY, hasTransformedAncestor),
|
|
233
236
|
(childId) => {
|
|
234
237
|
const child = graph.getNode(childId)
|
|
235
|
-
|
|
238
|
+
const shiftX = child ? scrollShiftX(child, scroll) : 0
|
|
239
|
+
const shiftY = child ? scrollShiftY(child, scroll) : 0
|
|
240
|
+
if (shiftX !== 0 || shiftY !== 0) {
|
|
241
|
+
canvas.save()
|
|
242
|
+
canvas.translate(shiftX, shiftY)
|
|
243
|
+
}
|
|
244
|
+
r.renderNode(
|
|
245
|
+
canvas,
|
|
246
|
+
graph,
|
|
247
|
+
childId,
|
|
248
|
+
overlays,
|
|
249
|
+
absX + shiftX,
|
|
250
|
+
absY + shiftY,
|
|
251
|
+
hasTransformedAncestor
|
|
252
|
+
)
|
|
253
|
+
if (shiftX !== 0 || shiftY !== 0) canvas.restore()
|
|
254
|
+
},
|
|
255
|
+
(childId) => {
|
|
256
|
+
const child = graph.getNode(childId)
|
|
257
|
+
if (child) {
|
|
258
|
+
const shiftX = scrollShiftX(child, scroll)
|
|
259
|
+
const shiftY = scrollShiftY(child, scroll)
|
|
260
|
+
if (shiftX !== 0 || shiftY !== 0) {
|
|
261
|
+
canvas.save()
|
|
262
|
+
canvas.translate(shiftX, shiftY)
|
|
263
|
+
}
|
|
264
|
+
renderMaskNodeContent(r, canvas, graph, child, overlays, absX + shiftX, absY + shiftY)
|
|
265
|
+
if (shiftX !== 0 || shiftY !== 0) canvas.restore()
|
|
266
|
+
}
|
|
236
267
|
},
|
|
237
268
|
(childId) => {
|
|
238
269
|
const child = graph.getNode(childId)
|
|
239
270
|
if (!child) return null
|
|
271
|
+
const shiftX = scrollShiftX(child, scroll)
|
|
272
|
+
const shiftY = scrollShiftY(child, scroll)
|
|
240
273
|
// A mask covers what its silhouette does: a text's lines run past a fixed-size box.
|
|
241
274
|
const silhouette = silhouetteBounds(graph, child, false) ?? {
|
|
242
275
|
x: 0,
|
|
@@ -245,8 +278,8 @@ export function renderChildIds(
|
|
|
245
278
|
height: child.height
|
|
246
279
|
}
|
|
247
280
|
return {
|
|
248
|
-
x: child.x + silhouette.x,
|
|
249
|
-
y: child.y + silhouette.y,
|
|
281
|
+
x: child.x + silhouette.x + shiftX,
|
|
282
|
+
y: child.y + silhouette.y + shiftY,
|
|
250
283
|
width: silhouette.width,
|
|
251
284
|
height: silhouette.height
|
|
252
285
|
}
|
|
@@ -271,7 +304,22 @@ function renderChildren(
|
|
|
271
304
|
if (isClippableContainer && node.clipsContent && childIds.length > 0) {
|
|
272
305
|
canvas.save()
|
|
273
306
|
r.clipNodeShape(canvas, node)
|
|
274
|
-
|
|
307
|
+
// A frame a playing prototype scrolled draws its content moved by the offset, inside the clip.
|
|
308
|
+
const scrolled = overlays.playScroll?.get(node.id)
|
|
309
|
+
if (scrolled) canvas.translate(-scrolled.x, -scrolled.y)
|
|
310
|
+
const contentX = absX - (scrolled?.x ?? 0)
|
|
311
|
+
const contentY = absY - (scrolled?.y ?? 0)
|
|
312
|
+
renderChildIds(
|
|
313
|
+
r,
|
|
314
|
+
canvas,
|
|
315
|
+
graph,
|
|
316
|
+
childIds,
|
|
317
|
+
overlays,
|
|
318
|
+
contentX,
|
|
319
|
+
contentY,
|
|
320
|
+
hasTransformedAncestor,
|
|
321
|
+
scrolled
|
|
322
|
+
)
|
|
275
323
|
canvas.restore()
|
|
276
324
|
} else {
|
|
277
325
|
renderChildIds(r, canvas, graph, childIds, overlays, absX, absY, hasTransformedAncestor)
|
|
@@ -380,6 +428,12 @@ export function renderNode(
|
|
|
380
428
|
): void {
|
|
381
429
|
const found = graph.getNode(nodeId)
|
|
382
430
|
if (!found || !drawsNode(found, overlays)) return
|
|
431
|
+
// A frame a playing prototype changed is drawn from its play scene, not the document.
|
|
432
|
+
const played = playSceneGraph(r, nodeId, overlays)
|
|
433
|
+
if (played && played !== graph) {
|
|
434
|
+
renderNode(r, canvas, played, nodeId, overlays, parentAbsX, parentAbsY, hasTransformedAncestor)
|
|
435
|
+
return
|
|
436
|
+
}
|
|
383
437
|
const node = stickyPlaceholderNode(graph, found, r.stickyPlaceholder) ?? found
|
|
384
438
|
|
|
385
439
|
r._nodeCount++
|
|
@@ -1088,7 +1142,9 @@ export function renderShapeUncached(
|
|
|
1088
1142
|
graph: SceneGraph
|
|
1089
1143
|
): void {
|
|
1090
1144
|
r.renderEffects(canvas, node, graph, 'behind')
|
|
1091
|
-
|
|
1145
|
+
const content = () =>
|
|
1146
|
+
paintShapeContent(r, canvas, node, graph, () => r.renderEffects(canvas, node, graph, 'inner'))
|
|
1147
|
+
if (!withTextureEffect(r, canvas, node, content)) content()
|
|
1092
1148
|
r.renderEffects(canvas, node, graph, 'front')
|
|
1093
1149
|
}
|
|
1094
1150
|
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
import type { Canvas, Image, ImageFilter, Shader } from 'canvaskit-wasm'
|
|
2
|
+
|
|
3
|
+
import type { SceneNode, TextureEffect } from '@pairdraw/scene-graph'
|
|
4
|
+
|
|
5
|
+
import { cellValue } from './noise/tile'
|
|
6
|
+
import type { SkiaRenderer } from './renderer'
|
|
7
|
+
|
|
8
|
+
/** Cells on each side of a texture's displacement tile; it repeats beyond them. */
|
|
9
|
+
const TEXTURE_TILE_CELLS = 256
|
|
10
|
+
|
|
11
|
+
function smooth(t: number): number {
|
|
12
|
+
return t * t * (3 - 2 * t)
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* A cell's red or green displacement as smooth noise over `frequency` cells, sampled where the
|
|
17
|
+
* layer's pixels are: one cycle per grain, and tileable because the corners wrap.
|
|
18
|
+
*/
|
|
19
|
+
function displacement(x: number, y: number, frequency: number, seed: number, salt: number): number {
|
|
20
|
+
const gx = x * frequency
|
|
21
|
+
const gy = y * frequency
|
|
22
|
+
const x0 = Math.floor(gx)
|
|
23
|
+
const y0 = Math.floor(gy)
|
|
24
|
+
const x1 = (x0 + 1) % TEXTURE_TILE_CELLS
|
|
25
|
+
const y1 = (y0 + 1) % TEXTURE_TILE_CELLS
|
|
26
|
+
const tx = smooth(gx - x0)
|
|
27
|
+
const ty = smooth(gy - y0)
|
|
28
|
+
const wrap = (value: number) =>
|
|
29
|
+
((value % TEXTURE_TILE_CELLS) + TEXTURE_TILE_CELLS) % TEXTURE_TILE_CELLS
|
|
30
|
+
const v00 = cellValue(wrap(x0), wrap(y0), seed, salt)
|
|
31
|
+
const v10 = cellValue(x1, wrap(y0), seed, salt)
|
|
32
|
+
const v01 = cellValue(wrap(x0), y1, seed, salt)
|
|
33
|
+
const v11 = cellValue(x1, y1, seed, salt)
|
|
34
|
+
const top = v00 + (v10 - v00) * tx
|
|
35
|
+
const bottom = v01 + (v11 - v01) * tx
|
|
36
|
+
return top + (bottom - top) * ty
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* The displacement tile for a texture: red and green as independent smooth noise one grain to a
|
|
41
|
+
* cycle, as `feTurbulence` writes them, cached by grain size and seed.
|
|
42
|
+
*/
|
|
43
|
+
export function textureDisplacementTile(
|
|
44
|
+
r: SkiaRenderer,
|
|
45
|
+
texture: TextureEffect,
|
|
46
|
+
seed: number
|
|
47
|
+
): Image | null {
|
|
48
|
+
const frequency = (size: number) => (size > 0 ? 1 / size : 0)
|
|
49
|
+
const fx = frequency(texture.texture.noiseSize.x)
|
|
50
|
+
const fy = frequency(texture.texture.noiseSize.y)
|
|
51
|
+
const key = `texture:${fx}:${fy}:${seed}`
|
|
52
|
+
const kept = r.textureNoiseCache.get(key)
|
|
53
|
+
if (kept) return kept
|
|
54
|
+
const pixels = new Uint8Array(TEXTURE_TILE_CELLS * TEXTURE_TILE_CELLS * 4)
|
|
55
|
+
for (let y = 0; y < TEXTURE_TILE_CELLS; y++) {
|
|
56
|
+
for (let x = 0; x < TEXTURE_TILE_CELLS; x++) {
|
|
57
|
+
const at = (y * TEXTURE_TILE_CELLS + x) * 4
|
|
58
|
+
pixels[at] = Math.floor(displacement(x, y, fx, seed, 1) * 256)
|
|
59
|
+
pixels[at + 1] = Math.floor(displacement(x, y, fy, seed, 2) * 256)
|
|
60
|
+
pixels[at + 2] = 0
|
|
61
|
+
pixels[at + 3] = 255
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
const image = r.ck.MakeImage(
|
|
65
|
+
{
|
|
66
|
+
width: TEXTURE_TILE_CELLS,
|
|
67
|
+
height: TEXTURE_TILE_CELLS,
|
|
68
|
+
alphaType: r.ck.AlphaType.Unpremul,
|
|
69
|
+
colorType: r.ck.ColorType.RGBA_8888,
|
|
70
|
+
colorSpace: r.ck.ColorSpace.SRGB
|
|
71
|
+
},
|
|
72
|
+
pixels,
|
|
73
|
+
TEXTURE_TILE_CELLS * 4
|
|
74
|
+
)
|
|
75
|
+
if (!image) return null
|
|
76
|
+
r.textureNoiseCache.set(key, image)
|
|
77
|
+
return image
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
/** The first visible texture effect on a layer, which roughens its edges. */
|
|
81
|
+
export function textureEffectOf(node: SceneNode): TextureEffect | null {
|
|
82
|
+
for (const effect of node.effects) {
|
|
83
|
+
if (effect.visible && effect.type === 'TEXTURE' && effect.radius > 0) return effect
|
|
84
|
+
}
|
|
85
|
+
return null
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
/**
|
|
89
|
+
* Draws a layer's content through the displacement of its texture effect: the noise moves each
|
|
90
|
+
* pixel by up to `radius`, as Figma's filter does, and `clipToShape` keeps the moved pixels inside
|
|
91
|
+
* the layer's box. Returns false when there is no texture to draw, so a caller draws as usual.
|
|
92
|
+
*/
|
|
93
|
+
export function withTextureEffect(
|
|
94
|
+
r: SkiaRenderer,
|
|
95
|
+
canvas: Canvas,
|
|
96
|
+
node: SceneNode,
|
|
97
|
+
draw: () => void
|
|
98
|
+
): boolean {
|
|
99
|
+
const texture = textureEffectOf(node)
|
|
100
|
+
if (!texture) return false
|
|
101
|
+
const tile = textureDisplacementTile(r, texture, texture.texture.seed ?? 0)
|
|
102
|
+
if (!tile) return false
|
|
103
|
+
const repeat = r.ck.TileMode.Repeat
|
|
104
|
+
const shader: Shader = tile.makeShaderOptions(
|
|
105
|
+
repeat,
|
|
106
|
+
repeat,
|
|
107
|
+
r.ck.FilterMode.Linear,
|
|
108
|
+
r.ck.MipmapMode.None
|
|
109
|
+
)
|
|
110
|
+
const displacement: ImageFilter = r.ck.ImageFilter.MakeShader(shader)
|
|
111
|
+
const filter: ImageFilter = r.ck.ImageFilter.MakeDisplacementMap(
|
|
112
|
+
r.ck.ColorChannel.Red,
|
|
113
|
+
r.ck.ColorChannel.Green,
|
|
114
|
+
texture.radius * 2,
|
|
115
|
+
displacement,
|
|
116
|
+
null
|
|
117
|
+
)
|
|
118
|
+
const paint = new r.ck.Paint()
|
|
119
|
+
try {
|
|
120
|
+
paint.setImageFilter(filter)
|
|
121
|
+
const rect = r.ck.LTRBRect(0, 0, node.width, node.height)
|
|
122
|
+
if (texture.texture.clipToShape) r.clipNodeShape(canvas, node)
|
|
123
|
+
canvas.saveLayer(paint, rect)
|
|
124
|
+
try {
|
|
125
|
+
draw()
|
|
126
|
+
} finally {
|
|
127
|
+
canvas.restore()
|
|
128
|
+
}
|
|
129
|
+
} finally {
|
|
130
|
+
paint.delete()
|
|
131
|
+
filter.delete()
|
|
132
|
+
displacement.delete()
|
|
133
|
+
shader.delete()
|
|
134
|
+
}
|
|
135
|
+
return true
|
|
136
|
+
}
|
package/src/clipboard.ts
CHANGED
|
@@ -145,6 +145,7 @@ async function writeFigmaClipboardHTML(
|
|
|
145
145
|
const blobs: Uint8Array[] = []
|
|
146
146
|
const variableIds = new Map<string, GUID>()
|
|
147
147
|
const modeIds = new Map<string, GUID>()
|
|
148
|
+
const propertyIdToGuid = new Map<string, GUID>()
|
|
148
149
|
assignVariableGuids(
|
|
149
150
|
graph,
|
|
150
151
|
localIdCounter,
|
|
@@ -169,6 +170,7 @@ async function writeFigmaClipboardHTML(
|
|
|
169
170
|
varIdToGuid: variableIds,
|
|
170
171
|
assignedGuidValues,
|
|
171
172
|
modeIdToGuid: modeIds,
|
|
173
|
+
propertyIdToGuid,
|
|
172
174
|
slotContentRecords,
|
|
173
175
|
runtime
|
|
174
176
|
})
|
|
@@ -183,16 +185,26 @@ async function writeFigmaClipboardHTML(
|
|
|
183
185
|
}
|
|
184
186
|
for (const node of nodes) mark(node)
|
|
185
187
|
const visitDependencies = (node: SceneNode): void => {
|
|
186
|
-
if (
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
188
|
+
if (node.type === 'INSTANCE' && node.componentId) {
|
|
189
|
+
// A nested instance's copy points at the component's own nested instance, not at a main
|
|
190
|
+
// component; follow the chain to the component it draws, as the export's symbolID does.
|
|
191
|
+
let componentId = node.componentId
|
|
192
|
+
const seen = new Set<string>()
|
|
193
|
+
let component = graph.getNode(componentId)
|
|
194
|
+
while (component?.type === 'INSTANCE' && component.componentId && !seen.has(component.id)) {
|
|
195
|
+
seen.add(component.id)
|
|
196
|
+
componentId = component.componentId
|
|
197
|
+
component = graph.getNode(componentId)
|
|
198
|
+
}
|
|
199
|
+
if (
|
|
200
|
+
component &&
|
|
201
|
+
(component.type === 'COMPONENT' || component.type === 'COMPONENT_SET') &&
|
|
202
|
+
!selected.has(component.id) &&
|
|
203
|
+
!dependencies.has(component.id)
|
|
204
|
+
) {
|
|
205
|
+
dependencies.set(component.id, component)
|
|
206
|
+
visitDependencies(component)
|
|
207
|
+
}
|
|
196
208
|
}
|
|
197
209
|
for (const child of graph.getChildren(node.id)) visitDependencies(child)
|
|
198
210
|
}
|
|
@@ -218,6 +230,7 @@ async function writeFigmaClipboardHTML(
|
|
|
218
230
|
varIdToGuid: variableIds,
|
|
219
231
|
assignedGuidValues,
|
|
220
232
|
modeIdToGuid: modeIds,
|
|
233
|
+
propertyIdToGuid,
|
|
221
234
|
slotContentRecords,
|
|
222
235
|
runtime
|
|
223
236
|
})
|
package/src/constants.ts
CHANGED
|
@@ -276,6 +276,12 @@ export const SECTION_CORNER_RADIUS = 2
|
|
|
276
276
|
/** Effect filters a renderer keeps: a slider drag would otherwise keep every value it passed. */
|
|
277
277
|
export const EFFECT_FILTER_CACHE_ENTRIES = 64
|
|
278
278
|
|
|
279
|
+
/** Noise tiles a renderer keeps, each about 4 MB: a density or seed drag walks through many. */
|
|
280
|
+
export const NOISE_TILE_CACHE_ENTRIES = 8
|
|
281
|
+
|
|
282
|
+
/** Texture displacement tiles a renderer keeps, each 256 KB. */
|
|
283
|
+
export const TEXTURE_NOISE_CACHE_ENTRIES = 16
|
|
284
|
+
|
|
279
285
|
export const ZOOM_DIVISOR = 50
|
|
280
286
|
export const ZOOM_SCALE_MIN = 0.75
|
|
281
287
|
export const ZOOM_SCALE_MAX = 1.25
|
package/src/design-jsx/index.ts
CHANGED
|
@@ -74,4 +74,4 @@ export function designJSXRenderer(icons: IconProvider = defaultIcons) {
|
|
|
74
74
|
}
|
|
75
75
|
|
|
76
76
|
/** Design JSX rendering with Iconify's icons. */
|
|
77
|
-
export const { renderJSX, renderTree } = designJSXRenderer()
|
|
77
|
+
export const { renderJSX, renderRoots, renderTree } = designJSXRenderer()
|