@pairdraw/core 0.19.2 → 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/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/renderer/chunks/index.d.ts +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/pipeline.d.ts.map +1 -1
- package/dist/canvas/renderer/pipeline.js +13 -1
- 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 -3
- package/dist/canvas/renderer/types.d.ts.map +1 -1
- package/dist/canvas/renderer/visual-bounds.d.ts +1 -1
- package/dist/canvas/renderer/visual-bounds.js +1 -1
- package/dist/canvas/renderer.d.ts +22 -2
- 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/renderer.d.ts.map +1 -1
- package/dist/design-memory/check.d.ts +90 -0
- package/dist/design-memory/check.d.ts.map +1 -0
- package/dist/design-memory/check.js +281 -0
- package/dist/design-memory/check.js.map +1 -0
- package/dist/design-memory/describe.d.ts +37 -0
- package/dist/design-memory/describe.d.ts.map +1 -0
- package/dist/design-memory/describe.js +52 -0
- package/dist/design-memory/describe.js.map +1 -0
- package/dist/design-memory/distil.d.ts +22 -0
- package/dist/design-memory/distil.d.ts.map +1 -0
- package/dist/design-memory/distil.js +54 -0
- package/dist/design-memory/distil.js.map +1 -0
- package/dist/design-memory/document.d.ts +12 -0
- package/dist/design-memory/document.d.ts.map +1 -0
- package/dist/design-memory/document.js +64 -0
- package/dist/design-memory/document.js.map +1 -0
- package/dist/design-memory/guard.d.ts +48 -0
- package/dist/design-memory/guard.d.ts.map +1 -0
- package/dist/design-memory/guard.js +105 -0
- package/dist/design-memory/guard.js.map +1 -0
- package/dist/design-memory/index.d.ts +9 -0
- package/dist/design-memory/index.js +9 -0
- package/dist/design-memory/refusal.d.ts +32 -0
- package/dist/design-memory/refusal.d.ts.map +1 -0
- package/dist/design-memory/refusal.js +68 -0
- package/dist/design-memory/refusal.js.map +1 -0
- package/dist/design-memory/rules.d.ts +63 -0
- package/dist/design-memory/rules.d.ts.map +1 -0
- package/dist/design-memory/rules.js +224 -0
- package/dist/design-memory/rules.js.map +1 -0
- package/dist/design-memory/values.d.ts +28 -0
- package/dist/design-memory/values.d.ts.map +1 -0
- package/dist/design-memory/values.js +160 -0
- package/dist/design-memory/values.js.map +1 -0
- package/dist/editor/alignment.js +1 -1
- package/dist/editor/bridges/components.d.ts +2 -0
- package/dist/editor/bridges/components.d.ts.map +1 -1
- package/dist/editor/bridges/components.js +2 -0
- package/dist/editor/bridges/components.js.map +1 -1
- package/dist/editor/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/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 +27 -3
- package/dist/editor/create.d.ts.map +1 -1
- package/dist/editor/create.js +16 -60
- package/dist/editor/create.js.map +1 -1
- package/dist/editor/design-memory.d.ts +11 -0
- package/dist/editor/design-memory.d.ts.map +1 -0
- package/dist/editor/design-memory.js +40 -0
- package/dist/editor/design-memory.js.map +1 -0
- package/dist/editor/design-tokens.d.ts +4 -0
- package/dist/editor/design-tokens.d.ts.map +1 -1
- package/dist/editor/design-tokens.js +30 -1
- package/dist/editor/design-tokens.js.map +1 -1
- package/dist/editor/document-colors.d.ts +23 -0
- package/dist/editor/document-colors.d.ts.map +1 -0
- package/dist/editor/document-colors.js +53 -0
- package/dist/editor/document-colors.js.map +1 -0
- package/dist/editor/eyedropper.d.ts +47 -0
- package/dist/editor/eyedropper.d.ts.map +1 -0
- package/dist/editor/eyedropper.js +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 +4 -2
- package/dist/editor/history/edit.js.map +1 -1
- package/dist/editor/history/subtree.d.ts +9 -0
- package/dist/editor/history/subtree.d.ts.map +1 -1
- package/dist/editor/history/subtree.js +12 -2
- package/dist/editor/history/subtree.js.map +1 -1
- package/dist/editor/index.d.ts +4 -2
- package/dist/editor/index.js +4 -2
- package/dist/editor/pages.d.ts +7 -5
- package/dist/editor/pages.d.ts.map +1 -1
- package/dist/editor/pages.js +35 -25
- package/dist/editor/pages.js.map +1 -1
- package/dist/editor/play/states.d.ts +3 -1
- package/dist/editor/play/states.d.ts.map +1 -1
- package/dist/editor/play/states.js +1 -1
- package/dist/editor/play/states.js.map +1 -1
- package/dist/editor/read-only/actions.js +4 -0
- package/dist/editor/read-only/actions.js.map +1 -1
- package/dist/editor/render-requests.d.ts +18 -0
- package/dist/editor/render-requests.d.ts.map +1 -0
- package/dist/editor/render-requests.js +76 -0
- package/dist/editor/render-requests.js.map +1 -0
- package/dist/editor/scale/rescale.d.ts +1 -1
- package/dist/editor/selection/overlays.d.ts.map +1 -1
- package/dist/editor/selection/overlays.js +1 -1
- package/dist/editor/selection/overlays.js.map +1 -1
- package/dist/editor/selection/read.d.ts +4 -0
- package/dist/editor/selection.d.ts +5 -0
- package/dist/editor/selection.d.ts.map +1 -1
- package/dist/editor/tool-registry.d.ts.map +1 -1
- package/dist/editor/tool-registry.js +2 -1
- package/dist/editor/tool-registry.js.map +1 -1
- package/dist/editor/types.d.ts +5 -1
- package/dist/editor/types.d.ts.map +1 -1
- package/dist/editor/variations/create.d.ts +28 -0
- package/dist/editor/variations/create.d.ts.map +1 -0
- package/dist/editor/variations/create.js +176 -0
- package/dist/editor/variations/create.js.map +1 -0
- package/dist/editor/variations/pick.d.ts +16 -0
- package/dist/editor/variations/pick.d.ts.map +1 -0
- package/dist/editor/variations/pick.js +23 -0
- package/dist/editor/variations/pick.js.map +1 -0
- package/dist/editor/variations.d.ts +28 -0
- package/dist/editor/variations.d.ts.map +1 -0
- package/dist/editor/variations.js +88 -0
- package/dist/editor/variations.js.map +1 -0
- package/dist/figma-api/accessors/reactions.d.ts.map +1 -1
- package/dist/figma-api/accessors/reactions.js +4 -1
- package/dist/figma-api/accessors/reactions.js.map +1 -1
- package/dist/figma-api/accessors/text/index.js +3 -0
- package/dist/figma-api/accessors/text/index.js.map +1 -1
- package/dist/figma-api/accessors/text/opentype.d.ts +17 -0
- package/dist/figma-api/accessors/text/opentype.d.ts.map +1 -0
- package/dist/figma-api/accessors/text/opentype.js +28 -0
- package/dist/figma-api/accessors/text/opentype.js.map +1 -0
- package/dist/figma-api/accessors/visual.d.ts.map +1 -1
- package/dist/figma-api/accessors/visual.js +33 -0
- package/dist/figma-api/accessors/visual.js.map +1 -1
- package/dist/figma-api/effects.d.ts +79 -3
- package/dist/figma-api/effects.d.ts.map +1 -1
- package/dist/figma-api/effects.js +150 -9
- package/dist/figma-api/effects.js.map +1 -1
- package/dist/figma-api/index.d.ts +5 -0
- package/dist/figma-api/index.d.ts.map +1 -1
- package/dist/figma-api/index.js +6 -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/surface.d.ts +6 -3
- package/dist/figma-api/surface.d.ts.map +1 -1
- package/dist/figma-api/surface.js +6 -2
- package/dist/figma-api/surface.js.map +1 -1
- package/dist/figma-api/transform.d.ts +1 -1
- package/dist/geometry/figma.d.ts +1 -1
- package/dist/geometry/image-crop.d.ts +1 -1
- package/dist/geometry/image-crop.js +1 -1
- package/dist/index.d.ts +4 -2
- package/dist/index.js +4 -2
- package/dist/io/formats/boolean-path.d.ts +19 -0
- package/dist/io/formats/boolean-path.d.ts.map +1 -0
- package/dist/io/formats/boolean-path.js +47 -0
- package/dist/io/formats/boolean-path.js.map +1 -0
- package/dist/io/formats/design-tokens/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.js +1 -0
- 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/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/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 +1 -53
- 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 +174 -36
- 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/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.d.ts +3 -2
- package/dist/layout.d.ts.map +1 -1
- package/dist/layout.js +2 -1
- 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 +12 -0
- package/dist/lint/linter.d.ts.map +1 -1
- package/dist/lint/linter.js +110 -8
- package/dist/lint/linter.js.map +1 -1
- package/dist/lint/presets.d.ts.map +1 -1
- package/dist/lint/presets.js +2 -0
- package/dist/lint/presets.js.map +1 -1
- package/dist/lint/rules/design-memory.d.ts +15 -0
- package/dist/lint/rules/design-memory.d.ts.map +1 -0
- package/dist/lint/rules/design-memory.js +90 -0
- package/dist/lint/rules/design-memory.js.map +1 -0
- package/dist/lint/rules/index.d.ts +6 -5
- package/dist/lint/rules/index.d.ts.map +1 -1
- package/dist/lint/rules/index.js +6 -2
- package/dist/lint/rules/index.js.map +1 -1
- package/dist/lint/rules/no-unbound-token-values.d.ts +6 -0
- package/dist/lint/rules/no-unbound-token-values.d.ts.map +1 -0
- package/dist/lint/rules/no-unbound-token-values.js +79 -0
- package/dist/lint/rules/no-unbound-token-values.js.map +1 -0
- package/dist/lint/types.d.ts +25 -2
- package/dist/lint/types.d.ts.map +1 -1
- package/dist/node/video.d.ts +12 -0
- package/dist/node/video.d.ts.map +1 -0
- package/dist/node/video.js +206 -0
- package/dist/node/video.js.map +1 -0
- package/dist/pairdraw-api/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/read-commands.js +1 -1
- package/dist/text/font/features.d.ts +9 -0
- package/dist/text/font/features.d.ts.map +1 -0
- package/dist/text/font/features.js +27 -0
- package/dist/text/font/features.js.map +1 -0
- package/dist/text/font/manager.d.ts +12 -0
- package/dist/text/font/manager.d.ts.map +1 -1
- package/dist/text/font/manager.js +60 -1
- package/dist/text/font/manager.js.map +1 -1
- package/dist/text/index.d.ts +10 -8
- package/dist/text/index.js +3 -1
- package/dist/text/replace-fonts.d.ts +41 -0
- package/dist/text/replace-fonts.d.ts.map +1 -0
- package/dist/text/replace-fonts.js +121 -0
- package/dist/text/replace-fonts.js.map +1 -0
- package/dist/tools/analyze/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/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/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 +8 -1
- package/dist/tools/structure/batch.js.map +1 -1
- package/dist/tools/structure/hierarchy.d.ts.map +1 -1
- package/dist/tools/structure/hierarchy.js +4 -0
- package/dist/tools/structure/hierarchy.js.map +1 -1
- package/dist/tools/structure/variations.d.ts +8 -0
- package/dist/tools/structure/variations.d.ts.map +1 -0
- package/dist/tools/structure/variations.js +106 -0
- package/dist/tools/structure/variations.js.map +1 -0
- package/dist/tools/structure.d.ts +2 -1
- package/dist/tools/structure.js +2 -1
- package/dist/tools/styles/types.d.ts +2 -4
- package/dist/tools/styles/types.d.ts.map +1 -1
- package/dist/tools/styles/types.js.map +1 -1
- package/dist/tools/vector/boolean.d.ts.map +1 -1
- package/dist/tools/vector/boolean.js +4 -0
- package/dist/tools/vector/boolean.js.map +1 -1
- package/dist/tools/vector/vectorize.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/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/renderer/lifecycle.ts +6 -0
- package/src/canvas/renderer/pipeline.ts +19 -1
- 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 -2
- package/src/canvas/renderer.ts +40 -3
- 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-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/components/instances.ts +31 -0
- package/src/editor/create.ts +25 -69
- package/src/editor/design-memory.ts +39 -0
- package/src/editor/design-tokens.ts +41 -2
- package/src/editor/document-colors.ts +65 -0
- package/src/editor/eyedropper.ts +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 +11 -1
- package/src/editor/history/subtree.ts +13 -2
- package/src/editor/index.ts +11 -0
- package/src/editor/pages.ts +40 -29
- package/src/editor/play/states.ts +1 -1
- package/src/editor/read-only/actions.ts +4 -0
- package/src/editor/render-requests.ts +83 -0
- package/src/editor/selection/overlays.ts +1 -0
- package/src/editor/tool-registry.ts +2 -1
- package/src/editor/types.ts +4 -0
- package/src/editor/variations/create.ts +235 -0
- package/src/editor/variations/pick.ts +35 -0
- package/src/editor/variations.ts +110 -0
- package/src/figma-api/accessors/reactions.ts +11 -1
- package/src/figma-api/accessors/text/index.ts +7 -0
- package/src/figma-api/accessors/text/opentype.ts +33 -0
- package/src/figma-api/accessors/visual.ts +55 -2
- package/src/figma-api/compatibility.ts +5 -2
- package/src/figma-api/effects.ts +143 -5
- package/src/figma-api/index.ts +10 -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/surface.ts +6 -2
- package/src/global.d.ts +26 -0
- 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 +2 -0
- 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/vectors.ts +8 -2
- package/src/io/formats/pdf/document.ts +14 -4
- 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 +4 -72
- package/src/io/formats/svg/effects.ts +131 -0
- package/src/io/formats/svg/export.ts +278 -46
- 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/auto-layout-handles.ts +396 -0
- package/src/layout.ts +2 -0
- package/src/lint/fixes.ts +12 -3
- package/src/lint/index.ts +3 -1
- package/src/lint/linter.ts +107 -10
- package/src/lint/presets.ts +2 -0
- package/src/lint/rules/design-memory.ts +97 -0
- package/src/lint/rules/index.ts +6 -1
- package/src/lint/rules/no-unbound-token-values.ts +73 -0
- package/src/lint/types.ts +32 -0
- package/src/node/video.ts +196 -0
- package/src/pairdraw-api/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/text/font/features.ts +27 -0
- package/src/text/font/manager.ts +79 -1
- 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/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/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 +12 -1
- package/src/tools/structure/hierarchy.ts +4 -0
- package/src/tools/structure/variations.ts +118 -0
- package/src/tools/structure.ts +2 -0
- package/src/tools/styles/types.ts +3 -4
- package/src/tools/vector/boolean.ts +4 -0
- 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/dist/constants.d.ts
CHANGED
|
@@ -289,6 +289,10 @@ declare const SECTION_DEFAULT_STROKE: Stroke;
|
|
|
289
289
|
declare const SECTION_CORNER_RADIUS = 2;
|
|
290
290
|
/** Effect filters a renderer keeps: a slider drag would otherwise keep every value it passed. */
|
|
291
291
|
declare const EFFECT_FILTER_CACHE_ENTRIES = 64;
|
|
292
|
+
/** Noise tiles a renderer keeps, each about 4 MB: a density or seed drag walks through many. */
|
|
293
|
+
declare const NOISE_TILE_CACHE_ENTRIES = 8;
|
|
294
|
+
/** Texture displacement tiles a renderer keeps, each 256 KB. */
|
|
295
|
+
declare const TEXTURE_NOISE_CACHE_ENTRIES = 16;
|
|
292
296
|
declare const ZOOM_DIVISOR = 50;
|
|
293
297
|
declare const ZOOM_SCALE_MIN = 0.75;
|
|
294
298
|
declare const ZOOM_SCALE_MAX = 1.25;
|
|
@@ -312,5 +316,5 @@ declare const DEFAULT_TEXT_HEIGHT = 24;
|
|
|
312
316
|
/** Space Figma leaves between a duplicated top-level frame and the layers to its left. */
|
|
313
317
|
declare const DUPLICATE_FRAME_GAP = 40;
|
|
314
318
|
//#endregion
|
|
315
|
-
export { ACPAgentDef, ACPAgentID, ACP_AGENTS, AIProviderDef, AIProviderID, AI_AGENT_COLOR, AI_DONE_COLOR, AI_DONE_DURATION_MS, AI_ENTER_DURATION_MS, AI_ENTER_MAX_DELAY_MS, AI_ENTER_STAGGER_MS, AI_PROVIDERS, AI_SHIMMER_BAND, AI_SHIMMER_PERIOD_MS, AUTOMATION_HTTP_PORT, AUTO_LAYOUT_HOVER_BLUE, AUTO_LAYOUT_HOVER_BLUE_FILL, AUTO_LAYOUT_HOVER_GAP_PILL, AUTO_LAYOUT_HOVER_GAP_REGION_TOLERANCE, AUTO_LAYOUT_HOVER_MAGENTA, AUTO_LAYOUT_HOVER_MAGENTA_FILL, AUTO_LAYOUT_HOVER_PADDING_PILL, AUTO_LAYOUT_HOVER_PADDING_REGION_TOLERANCE, AUTO_LAYOUT_HOVER_STRIPE_GAP, AUTO_LAYOUT_HOVER_STRIPE_WIDTH, AUTO_LAYOUT_HOVER_STROKE_WIDTH, AUTO_LAYOUT_HOVER_TICK_HIT_TOLERANCE, AUTO_LAYOUT_HOVER_TICK_LENGTH, AUTO_LAYOUT_HOVER_VALUE_OFFSET, AUTO_LAYOUT_HOVER_VALUE_PILL_HEIGHT, AUTO_LAYOUT_HOVER_VALUE_PILL_PADDING_X, AUTO_LAYOUT_HOVER_VALUE_PILL_RADIUS, AUTO_LAYOUT_PADDING_EDITOR_OFFSET_X, AUTO_LAYOUT_PADDING_EDITOR_OFFSET_Y, BLACK, BOARD_GRID, BOARD_PAGE_BACKGROUND, CANVAS_BG_COLOR, CJK_FALLBACK_FAMILIES_LINUX, CJK_FALLBACK_FAMILIES_MACOS, CJK_FALLBACK_FAMILIES_WINDOWS, CJK_GOOGLE_FONTS, CODE_FOCUS_FILL_ALPHA, COMPONENT_COLOR, COMPONENT_LABEL_FONT_SIZE, COMPONENT_LABEL_GAP, COMPONENT_LABEL_ICON_GAP, COMPONENT_LABEL_ICON_SIZE, COMPONENT_SET_BORDER_WIDTH, COMPONENT_SET_DASH, COMPONENT_SET_DASH_GAP, COMPONENT_SET_OUTLINE_RADIUS, DEFAULT_AI_MODEL, DEFAULT_AI_PROVIDER, DEFAULT_FONT_FAMILY, DEFAULT_FONT_SIZE, DEFAULT_FRAME_FILL, DEFAULT_SELECTION_THEME, DEFAULT_SHADOW_COLOR, DEFAULT_SHAPE_FILL, DEFAULT_STROKE_MITER_LIMIT, DEFAULT_TEXT_HEIGHT, DEFAULT_TEXT_WIDTH, DROP_HIGHLIGHT_ALPHA, DROP_HIGHLIGHT_STROKE, DUPLICATE_FRAME_GAP, EFFECT_FILTER_CACHE_ENTRIES, FLASH_ATTACK_MS, FLASH_HOLD_MS, FLASH_OVERSHOOT, FLASH_PADDING, FLASH_RADIUS, FLASH_RELEASE_MS, FLASH_STROKE_WIDTH, GOOGLE_FONTS_API_KEY, HANDLE_HALF_SIZE, HANDLE_HIT_RADIUS, HARNESS_PROVIDER_ID, HUD_FONT_SIZE, ISSUE_ERROR_COLOR, ISSUE_HIGHLIGHT_FILL_ALPHA, ISSUE_HIGHLIGHT_STROKE_WIDTH, ISSUE_INFO_COLOR, ISSUE_WARNING_COLOR, IS_BROWSER, IS_TAURI, InterfaceTheme, LABEL_FONT_SIZE, LABEL_OFFSET_Y, LAYER_HIT_PAD, LAYOUT_INDICATOR_STROKE, LAYOUT_OUTLINE_DASH, LAYOUT_OUTLINE_GAP, MARQUEE_FILL_ALPHA, MCP_AGENT_HEADER, MCP_CHAT_HEADER, MEASUREMENT_COLOR, MEASUREMENT_PILL_HEIGHT, MEASUREMENT_PILL_PADDING_X, MEASUREMENT_PILL_RADIUS, MEASUREMENT_TEXT_BASELINE, ModelOption, PAGE_DEFAULT_BACKGROUNDS, PAIRDRAW_MCP_SERVER, PARENT_OUTLINE_ALPHA, PENCIL_STROKE_WEIGHT, PENCIL_TOLERANCE, PEN_ANCHOR_RADIUS, PEN_CLOSE_MIN_POINTS, PEN_CLOSE_RADIUS_BOOST, PEN_CLOSE_THRESHOLD, PEN_HANDLE_RADIUS, PEN_PATH_STROKE_WIDTH, PEN_VERTEX_RADIUS, REASONING_EFFORTS, ROTATION_HANDLE_DISTANCE, ROTATION_SNAP_DEGREES, RULER_BADGE_EXCLUSION, RULER_BADGE_HEIGHT, RULER_BADGE_PADDING, RULER_BADGE_RADIUS, RULER_BG_COLOR, RULER_HIGHLIGHT_ALPHA, RULER_MAJOR_TICK, RULER_MAJOR_TOLERANCE, RULER_MINOR_TICK, RULER_SIZE, RULER_TARGET_PIXEL_SPACING, RULER_TEXT_BASELINE, RULER_TEXT_COLOR, RULER_TICK_COLOR, ReasoningEffort, SECTION_CORNER_RADIUS, SECTION_DEFAULT_FILLS, SECTION_DEFAULT_STROKE, SECTION_HOVER_STROKE_WIDTH, SECTION_TITLE_FONT_FAMILY, SECTION_TITLE_FONT_SIZE, SECTION_TITLE_FONT_URL, SECTION_TITLE_GAP, SECTION_TITLE_HEIGHT, SECTION_TITLE_PADDING_X, SECTION_TITLE_RADIUS, SELECTION_COLOR, SELECTION_DASH_ALPHA, SIZE_FONT_SIZE, SIZE_PILL_HEIGHT, SIZE_PILL_PADDING_X, SIZE_PILL_PADDING_Y, SIZE_PILL_RADIUS, SIZE_PILL_TEXT_OFFSET_Y, SLOT_COLOR, SLOT_EMPTY_FILL_ALPHA, SNAP_COLOR, SNAP_THRESHOLD_SCREEN_PX, SPACING_GUIDE_CAP, TEXT_CARET_COLOR, TEXT_CARET_WIDTH, TEXT_SELECTION_ALPHA, TRANSPARENT, VALUE_FONT_SIZE, VERTEX_SNAP_COLOR, VERTEX_SNAP_GUIDE_ALPHA, VERTEX_SNAP_MARK_RADIUS, ZOOM_DIVISOR, ZOOM_SCALE_MAX, ZOOM_SCALE_MIN };
|
|
319
|
+
export { ACPAgentDef, ACPAgentID, ACP_AGENTS, AIProviderDef, AIProviderID, AI_AGENT_COLOR, AI_DONE_COLOR, AI_DONE_DURATION_MS, AI_ENTER_DURATION_MS, AI_ENTER_MAX_DELAY_MS, AI_ENTER_STAGGER_MS, AI_PROVIDERS, AI_SHIMMER_BAND, AI_SHIMMER_PERIOD_MS, AUTOMATION_HTTP_PORT, AUTO_LAYOUT_HOVER_BLUE, AUTO_LAYOUT_HOVER_BLUE_FILL, AUTO_LAYOUT_HOVER_GAP_PILL, AUTO_LAYOUT_HOVER_GAP_REGION_TOLERANCE, AUTO_LAYOUT_HOVER_MAGENTA, AUTO_LAYOUT_HOVER_MAGENTA_FILL, AUTO_LAYOUT_HOVER_PADDING_PILL, AUTO_LAYOUT_HOVER_PADDING_REGION_TOLERANCE, AUTO_LAYOUT_HOVER_STRIPE_GAP, AUTO_LAYOUT_HOVER_STRIPE_WIDTH, AUTO_LAYOUT_HOVER_STROKE_WIDTH, AUTO_LAYOUT_HOVER_TICK_HIT_TOLERANCE, AUTO_LAYOUT_HOVER_TICK_LENGTH, AUTO_LAYOUT_HOVER_VALUE_OFFSET, AUTO_LAYOUT_HOVER_VALUE_PILL_HEIGHT, AUTO_LAYOUT_HOVER_VALUE_PILL_PADDING_X, AUTO_LAYOUT_HOVER_VALUE_PILL_RADIUS, AUTO_LAYOUT_PADDING_EDITOR_OFFSET_X, AUTO_LAYOUT_PADDING_EDITOR_OFFSET_Y, BLACK, BOARD_GRID, BOARD_PAGE_BACKGROUND, CANVAS_BG_COLOR, CJK_FALLBACK_FAMILIES_LINUX, CJK_FALLBACK_FAMILIES_MACOS, CJK_FALLBACK_FAMILIES_WINDOWS, CJK_GOOGLE_FONTS, CODE_FOCUS_FILL_ALPHA, COMPONENT_COLOR, COMPONENT_LABEL_FONT_SIZE, COMPONENT_LABEL_GAP, COMPONENT_LABEL_ICON_GAP, COMPONENT_LABEL_ICON_SIZE, COMPONENT_SET_BORDER_WIDTH, COMPONENT_SET_DASH, COMPONENT_SET_DASH_GAP, COMPONENT_SET_OUTLINE_RADIUS, DEFAULT_AI_MODEL, DEFAULT_AI_PROVIDER, DEFAULT_FONT_FAMILY, DEFAULT_FONT_SIZE, DEFAULT_FRAME_FILL, DEFAULT_SELECTION_THEME, DEFAULT_SHADOW_COLOR, DEFAULT_SHAPE_FILL, DEFAULT_STROKE_MITER_LIMIT, DEFAULT_TEXT_HEIGHT, DEFAULT_TEXT_WIDTH, DROP_HIGHLIGHT_ALPHA, DROP_HIGHLIGHT_STROKE, DUPLICATE_FRAME_GAP, EFFECT_FILTER_CACHE_ENTRIES, FLASH_ATTACK_MS, FLASH_HOLD_MS, FLASH_OVERSHOOT, FLASH_PADDING, FLASH_RADIUS, FLASH_RELEASE_MS, FLASH_STROKE_WIDTH, GOOGLE_FONTS_API_KEY, HANDLE_HALF_SIZE, HANDLE_HIT_RADIUS, HARNESS_PROVIDER_ID, HUD_FONT_SIZE, ISSUE_ERROR_COLOR, ISSUE_HIGHLIGHT_FILL_ALPHA, ISSUE_HIGHLIGHT_STROKE_WIDTH, ISSUE_INFO_COLOR, ISSUE_WARNING_COLOR, IS_BROWSER, IS_TAURI, InterfaceTheme, LABEL_FONT_SIZE, LABEL_OFFSET_Y, LAYER_HIT_PAD, LAYOUT_INDICATOR_STROKE, LAYOUT_OUTLINE_DASH, LAYOUT_OUTLINE_GAP, MARQUEE_FILL_ALPHA, MCP_AGENT_HEADER, MCP_CHAT_HEADER, MEASUREMENT_COLOR, MEASUREMENT_PILL_HEIGHT, MEASUREMENT_PILL_PADDING_X, MEASUREMENT_PILL_RADIUS, MEASUREMENT_TEXT_BASELINE, ModelOption, NOISE_TILE_CACHE_ENTRIES, PAGE_DEFAULT_BACKGROUNDS, PAIRDRAW_MCP_SERVER, PARENT_OUTLINE_ALPHA, PENCIL_STROKE_WEIGHT, PENCIL_TOLERANCE, PEN_ANCHOR_RADIUS, PEN_CLOSE_MIN_POINTS, PEN_CLOSE_RADIUS_BOOST, PEN_CLOSE_THRESHOLD, PEN_HANDLE_RADIUS, PEN_PATH_STROKE_WIDTH, PEN_VERTEX_RADIUS, REASONING_EFFORTS, ROTATION_HANDLE_DISTANCE, ROTATION_SNAP_DEGREES, RULER_BADGE_EXCLUSION, RULER_BADGE_HEIGHT, RULER_BADGE_PADDING, RULER_BADGE_RADIUS, RULER_BG_COLOR, RULER_HIGHLIGHT_ALPHA, RULER_MAJOR_TICK, RULER_MAJOR_TOLERANCE, RULER_MINOR_TICK, RULER_SIZE, RULER_TARGET_PIXEL_SPACING, RULER_TEXT_BASELINE, RULER_TEXT_COLOR, RULER_TICK_COLOR, ReasoningEffort, SECTION_CORNER_RADIUS, SECTION_DEFAULT_FILLS, SECTION_DEFAULT_STROKE, SECTION_HOVER_STROKE_WIDTH, SECTION_TITLE_FONT_FAMILY, SECTION_TITLE_FONT_SIZE, SECTION_TITLE_FONT_URL, SECTION_TITLE_GAP, SECTION_TITLE_HEIGHT, SECTION_TITLE_PADDING_X, SECTION_TITLE_RADIUS, SELECTION_COLOR, SELECTION_DASH_ALPHA, SIZE_FONT_SIZE, SIZE_PILL_HEIGHT, SIZE_PILL_PADDING_X, SIZE_PILL_PADDING_Y, SIZE_PILL_RADIUS, SIZE_PILL_TEXT_OFFSET_Y, SLOT_COLOR, SLOT_EMPTY_FILL_ALPHA, SNAP_COLOR, SNAP_THRESHOLD_SCREEN_PX, SPACING_GUIDE_CAP, TEXTURE_NOISE_CACHE_ENTRIES, TEXT_CARET_COLOR, TEXT_CARET_WIDTH, TEXT_SELECTION_ALPHA, TRANSPARENT, VALUE_FONT_SIZE, VERTEX_SNAP_COLOR, VERTEX_SNAP_GUIDE_ALPHA, VERTEX_SNAP_MARK_RADIUS, ZOOM_DIVISOR, ZOOM_SCALE_MAX, ZOOM_SCALE_MIN };
|
|
316
320
|
//# sourceMappingURL=constants.d.ts.map
|
package/dist/constants.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","names":[],"sources":["../src/constants.ts"],"mappings":";;;;;cAQa;cACA;cAEA,OAAO;cACP,aAAa;cACb,sBAAsB;cACtB;;;;;;;cAEA,yBAAyB,SAAS;cAIlC;;;;;;;cAEA;;;;;;cACA;cACA;;;;;;;cAEA;;;;;;cACA;cACA;;cAEA;cACA;;;;;;cACA;cACA;cACA;cACA;cACA;;;;;;cACA;;cAEA;cAEA;cACA;;;;;;cACA;;;;;;cACA;;;;;;cACA;cACA;cACA;cACA;cACA;cACA;cACA;cACA;cAEA;cACA;cACA;cACA;cACA;cACA;cACA;cACA;cACA;;cAEA;cACA;cACA;cACA;cAEA;cAEA;cACA;cACA;cACA;cACA;cACA;cAEA;cACA;;cAEA;cACA;cACA;cAEA;cACA;cACA;cACA;cACA;;cAEA;cACA;cACA;cAEA;cACA;cACA;cACA;cACA;cACA;cACA;cACA;cACA;;;;;;cACA;;;;;;cACA;;;;;;cACA;;;;;;cAEA;;;;;;cACA;;;;;;cAEA;cACA;cACA;cACA;;;;;;cAMA;cACA;cACA;cACA;cAEA;cACA;cACA;;cAEA;cACA;cACA;cACA;cACA;cAEA;cACA;cAEA;cACA;cACA;cACA;cACA;cACA;cACA;cAEA;;;;;;cACA;;;;;;cACA;;;;;;cACA;cACA;;cAGA;;;;;cACA;;;;;cACA;;cAEA;;cAEA;;cAEA;;cAEA;;cAEA;;cAGA;;cAEA,kBAAgB;cAChB;cAEA;;;;;cAKA;;cAGA;;;;;cAMA;cAEA;cAEA;cASA;cAUA;cASA;;cAGA,oBAAoB;cAOpB,oBAAoB;;KAQrB;;cAGC,0BAA0B,OAAO,gBAAgB;;cAMjD;;;;;;;cAQA,uBAAuB,OAAO,gBAAgB;cAU9C,wBAAwB;cASxB;;cAGA;cAEA;cACA;cACA;cAEA;;cAEA;;;;;cAKA;;cAEA;cACA;cACA;;cAEA;cACA;cACA;cACA;;cAEA"}
|
|
1
|
+
{"version":3,"file":"constants.d.ts","names":[],"sources":["../src/constants.ts"],"mappings":";;;;;cAQa;cACA;cAEA,OAAO;cACP,aAAa;cACb,sBAAsB;cACtB;;;;;;;cAEA,yBAAyB,SAAS;cAIlC;;;;;;;cAEA;;;;;;cACA;cACA;;;;;;;cAEA;;;;;;cACA;cACA;;cAEA;cACA;;;;;;cACA;cACA;cACA;cACA;cACA;;;;;;cACA;;cAEA;cAEA;cACA;;;;;;cACA;;;;;;cACA;;;;;;cACA;cACA;cACA;cACA;cACA;cACA;cACA;cACA;cAEA;cACA;cACA;cACA;cACA;cACA;cACA;cACA;cACA;;cAEA;cACA;cACA;cACA;cAEA;cAEA;cACA;cACA;cACA;cACA;cACA;cAEA;cACA;;cAEA;cACA;cACA;cAEA;cACA;cACA;cACA;cACA;;cAEA;cACA;cACA;cAEA;cACA;cACA;cACA;cACA;cACA;cACA;cACA;cACA;;;;;;cACA;;;;;;cACA;;;;;;cACA;;;;;;cAEA;;;;;;cACA;;;;;;cAEA;cACA;cACA;cACA;;;;;;cAMA;cACA;cACA;cACA;cAEA;cACA;cACA;;cAEA;cACA;cACA;cACA;cACA;cAEA;cACA;cAEA;cACA;cACA;cACA;cACA;cACA;cACA;cAEA;;;;;;cACA;;;;;;cACA;;;;;;cACA;cACA;;cAGA;;;;;cACA;;;;;cACA;;cAEA;;cAEA;;cAEA;;cAEA;;cAEA;;cAGA;;cAEA,kBAAgB;cAChB;cAEA;;;;;cAKA;;cAGA;;;;;cAMA;cAEA;cAEA;cASA;cAUA;cASA;;cAGA,oBAAoB;cAOpB,oBAAoB;;KAQrB;;cAGC,0BAA0B,OAAO,gBAAgB;;cAMjD;;;;;;;cAQA,uBAAuB,OAAO,gBAAgB;cAU9C,wBAAwB;cASxB;;cAGA;;cAGA;;cAGA;cAEA;cACA;cACA;cAEA;;cAEA;;;;;cAKA;;cAEA;cACA;cACA;;cAEA;cACA;cACA;cACA;;cAEA"}
|
package/dist/constants.js
CHANGED
|
@@ -393,6 +393,10 @@ const SECTION_DEFAULT_STROKE = {
|
|
|
393
393
|
const SECTION_CORNER_RADIUS = 2;
|
|
394
394
|
/** Effect filters a renderer keeps: a slider drag would otherwise keep every value it passed. */
|
|
395
395
|
const EFFECT_FILTER_CACHE_ENTRIES = 64;
|
|
396
|
+
/** Noise tiles a renderer keeps, each about 4 MB: a density or seed drag walks through many. */
|
|
397
|
+
const NOISE_TILE_CACHE_ENTRIES = 8;
|
|
398
|
+
/** Texture displacement tiles a renderer keeps, each 256 KB. */
|
|
399
|
+
const TEXTURE_NOISE_CACHE_ENTRIES = 16;
|
|
396
400
|
const ZOOM_DIVISOR = 50;
|
|
397
401
|
const ZOOM_SCALE_MIN = .75;
|
|
398
402
|
const ZOOM_SCALE_MAX = 1.25;
|
|
@@ -416,6 +420,6 @@ const DEFAULT_TEXT_HEIGHT = 24;
|
|
|
416
420
|
/** Space Figma leaves between a duplicated top-level frame and the layers to its left. */
|
|
417
421
|
const DUPLICATE_FRAME_GAP = 40;
|
|
418
422
|
//#endregion
|
|
419
|
-
export { ACP_AGENTS, AI_AGENT_COLOR, AI_DONE_COLOR, AI_DONE_DURATION_MS, AI_ENTER_DURATION_MS, AI_ENTER_MAX_DELAY_MS, AI_ENTER_STAGGER_MS, AI_PROVIDERS, AI_SHIMMER_BAND, AI_SHIMMER_PERIOD_MS, AUTOMATION_HTTP_PORT, AUTO_LAYOUT_HOVER_BLUE, AUTO_LAYOUT_HOVER_BLUE_FILL, AUTO_LAYOUT_HOVER_GAP_PILL, AUTO_LAYOUT_HOVER_GAP_REGION_TOLERANCE, AUTO_LAYOUT_HOVER_MAGENTA, AUTO_LAYOUT_HOVER_MAGENTA_FILL, AUTO_LAYOUT_HOVER_PADDING_PILL, AUTO_LAYOUT_HOVER_PADDING_REGION_TOLERANCE, AUTO_LAYOUT_HOVER_STRIPE_GAP, AUTO_LAYOUT_HOVER_STRIPE_WIDTH, AUTO_LAYOUT_HOVER_STROKE_WIDTH, AUTO_LAYOUT_HOVER_TICK_HIT_TOLERANCE, AUTO_LAYOUT_HOVER_TICK_LENGTH, AUTO_LAYOUT_HOVER_VALUE_OFFSET, AUTO_LAYOUT_HOVER_VALUE_PILL_HEIGHT, AUTO_LAYOUT_HOVER_VALUE_PILL_PADDING_X, AUTO_LAYOUT_HOVER_VALUE_PILL_RADIUS, AUTO_LAYOUT_PADDING_EDITOR_OFFSET_X, AUTO_LAYOUT_PADDING_EDITOR_OFFSET_Y, BLACK, BOARD_GRID, BOARD_PAGE_BACKGROUND, CANVAS_BG_COLOR, CJK_FALLBACK_FAMILIES_LINUX, CJK_FALLBACK_FAMILIES_MACOS, CJK_FALLBACK_FAMILIES_WINDOWS, CJK_GOOGLE_FONTS, CODE_FOCUS_FILL_ALPHA, COMPONENT_COLOR, COMPONENT_LABEL_FONT_SIZE, COMPONENT_LABEL_GAP, COMPONENT_LABEL_ICON_GAP, COMPONENT_LABEL_ICON_SIZE, COMPONENT_SET_BORDER_WIDTH, COMPONENT_SET_DASH, COMPONENT_SET_DASH_GAP, COMPONENT_SET_OUTLINE_RADIUS, DEFAULT_AI_MODEL, DEFAULT_AI_PROVIDER, DEFAULT_FONT_FAMILY, DEFAULT_FONT_SIZE, DEFAULT_FRAME_FILL, DEFAULT_SELECTION_THEME, DEFAULT_SHADOW_COLOR, DEFAULT_SHAPE_FILL, DEFAULT_STROKE_MITER_LIMIT, DEFAULT_TEXT_HEIGHT, DEFAULT_TEXT_WIDTH, DROP_HIGHLIGHT_ALPHA, DROP_HIGHLIGHT_STROKE, DUPLICATE_FRAME_GAP, EFFECT_FILTER_CACHE_ENTRIES, FLASH_ATTACK_MS, FLASH_HOLD_MS, FLASH_OVERSHOOT, FLASH_PADDING, FLASH_RADIUS, FLASH_RELEASE_MS, FLASH_STROKE_WIDTH, GOOGLE_FONTS_API_KEY, HANDLE_HALF_SIZE, HANDLE_HIT_RADIUS, HARNESS_PROVIDER_ID, HUD_FONT_SIZE, ISSUE_ERROR_COLOR, ISSUE_HIGHLIGHT_FILL_ALPHA, ISSUE_HIGHLIGHT_STROKE_WIDTH, ISSUE_INFO_COLOR, ISSUE_WARNING_COLOR, IS_BROWSER, IS_TAURI, LABEL_FONT_SIZE, LABEL_OFFSET_Y, LAYER_HIT_PAD, LAYOUT_INDICATOR_STROKE, LAYOUT_OUTLINE_DASH, LAYOUT_OUTLINE_GAP, MARQUEE_FILL_ALPHA, MCP_AGENT_HEADER, MCP_CHAT_HEADER, MEASUREMENT_COLOR, MEASUREMENT_PILL_HEIGHT, MEASUREMENT_PILL_PADDING_X, MEASUREMENT_PILL_RADIUS, MEASUREMENT_TEXT_BASELINE, PAGE_DEFAULT_BACKGROUNDS, PAIRDRAW_MCP_SERVER, PARENT_OUTLINE_ALPHA, PENCIL_STROKE_WEIGHT, PENCIL_TOLERANCE, PEN_ANCHOR_RADIUS, PEN_CLOSE_MIN_POINTS, PEN_CLOSE_RADIUS_BOOST, PEN_CLOSE_THRESHOLD, PEN_HANDLE_RADIUS, PEN_PATH_STROKE_WIDTH, PEN_VERTEX_RADIUS, REASONING_EFFORTS, ROTATION_HANDLE_DISTANCE, ROTATION_SNAP_DEGREES, RULER_BADGE_EXCLUSION, RULER_BADGE_HEIGHT, RULER_BADGE_PADDING, RULER_BADGE_RADIUS, RULER_BG_COLOR, RULER_HIGHLIGHT_ALPHA, RULER_MAJOR_TICK, RULER_MAJOR_TOLERANCE, RULER_MINOR_TICK, RULER_SIZE, RULER_TARGET_PIXEL_SPACING, RULER_TEXT_BASELINE, RULER_TEXT_COLOR, RULER_TICK_COLOR, SECTION_CORNER_RADIUS, SECTION_DEFAULT_FILLS, SECTION_DEFAULT_STROKE, SECTION_HOVER_STROKE_WIDTH, SECTION_TITLE_FONT_FAMILY, SECTION_TITLE_FONT_SIZE, SECTION_TITLE_FONT_URL, SECTION_TITLE_GAP, SECTION_TITLE_HEIGHT, SECTION_TITLE_PADDING_X, SECTION_TITLE_RADIUS, SELECTION_COLOR, SELECTION_DASH_ALPHA, SIZE_FONT_SIZE, SIZE_PILL_HEIGHT, SIZE_PILL_PADDING_X, SIZE_PILL_PADDING_Y, SIZE_PILL_RADIUS, SIZE_PILL_TEXT_OFFSET_Y, SLOT_COLOR, SLOT_EMPTY_FILL_ALPHA, SNAP_COLOR, SNAP_THRESHOLD_SCREEN_PX, SPACING_GUIDE_CAP, TEXT_CARET_COLOR, TEXT_CARET_WIDTH, TEXT_SELECTION_ALPHA, TRANSPARENT, VALUE_FONT_SIZE, VERTEX_SNAP_COLOR, VERTEX_SNAP_GUIDE_ALPHA, VERTEX_SNAP_MARK_RADIUS, ZOOM_DIVISOR, ZOOM_SCALE_MAX, ZOOM_SCALE_MIN };
|
|
423
|
+
export { ACP_AGENTS, AI_AGENT_COLOR, AI_DONE_COLOR, AI_DONE_DURATION_MS, AI_ENTER_DURATION_MS, AI_ENTER_MAX_DELAY_MS, AI_ENTER_STAGGER_MS, AI_PROVIDERS, AI_SHIMMER_BAND, AI_SHIMMER_PERIOD_MS, AUTOMATION_HTTP_PORT, AUTO_LAYOUT_HOVER_BLUE, AUTO_LAYOUT_HOVER_BLUE_FILL, AUTO_LAYOUT_HOVER_GAP_PILL, AUTO_LAYOUT_HOVER_GAP_REGION_TOLERANCE, AUTO_LAYOUT_HOVER_MAGENTA, AUTO_LAYOUT_HOVER_MAGENTA_FILL, AUTO_LAYOUT_HOVER_PADDING_PILL, AUTO_LAYOUT_HOVER_PADDING_REGION_TOLERANCE, AUTO_LAYOUT_HOVER_STRIPE_GAP, AUTO_LAYOUT_HOVER_STRIPE_WIDTH, AUTO_LAYOUT_HOVER_STROKE_WIDTH, AUTO_LAYOUT_HOVER_TICK_HIT_TOLERANCE, AUTO_LAYOUT_HOVER_TICK_LENGTH, AUTO_LAYOUT_HOVER_VALUE_OFFSET, AUTO_LAYOUT_HOVER_VALUE_PILL_HEIGHT, AUTO_LAYOUT_HOVER_VALUE_PILL_PADDING_X, AUTO_LAYOUT_HOVER_VALUE_PILL_RADIUS, AUTO_LAYOUT_PADDING_EDITOR_OFFSET_X, AUTO_LAYOUT_PADDING_EDITOR_OFFSET_Y, BLACK, BOARD_GRID, BOARD_PAGE_BACKGROUND, CANVAS_BG_COLOR, CJK_FALLBACK_FAMILIES_LINUX, CJK_FALLBACK_FAMILIES_MACOS, CJK_FALLBACK_FAMILIES_WINDOWS, CJK_GOOGLE_FONTS, CODE_FOCUS_FILL_ALPHA, COMPONENT_COLOR, COMPONENT_LABEL_FONT_SIZE, COMPONENT_LABEL_GAP, COMPONENT_LABEL_ICON_GAP, COMPONENT_LABEL_ICON_SIZE, COMPONENT_SET_BORDER_WIDTH, COMPONENT_SET_DASH, COMPONENT_SET_DASH_GAP, COMPONENT_SET_OUTLINE_RADIUS, DEFAULT_AI_MODEL, DEFAULT_AI_PROVIDER, DEFAULT_FONT_FAMILY, DEFAULT_FONT_SIZE, DEFAULT_FRAME_FILL, DEFAULT_SELECTION_THEME, DEFAULT_SHADOW_COLOR, DEFAULT_SHAPE_FILL, DEFAULT_STROKE_MITER_LIMIT, DEFAULT_TEXT_HEIGHT, DEFAULT_TEXT_WIDTH, DROP_HIGHLIGHT_ALPHA, DROP_HIGHLIGHT_STROKE, DUPLICATE_FRAME_GAP, EFFECT_FILTER_CACHE_ENTRIES, FLASH_ATTACK_MS, FLASH_HOLD_MS, FLASH_OVERSHOOT, FLASH_PADDING, FLASH_RADIUS, FLASH_RELEASE_MS, FLASH_STROKE_WIDTH, GOOGLE_FONTS_API_KEY, HANDLE_HALF_SIZE, HANDLE_HIT_RADIUS, HARNESS_PROVIDER_ID, HUD_FONT_SIZE, ISSUE_ERROR_COLOR, ISSUE_HIGHLIGHT_FILL_ALPHA, ISSUE_HIGHLIGHT_STROKE_WIDTH, ISSUE_INFO_COLOR, ISSUE_WARNING_COLOR, IS_BROWSER, IS_TAURI, LABEL_FONT_SIZE, LABEL_OFFSET_Y, LAYER_HIT_PAD, LAYOUT_INDICATOR_STROKE, LAYOUT_OUTLINE_DASH, LAYOUT_OUTLINE_GAP, MARQUEE_FILL_ALPHA, MCP_AGENT_HEADER, MCP_CHAT_HEADER, MEASUREMENT_COLOR, MEASUREMENT_PILL_HEIGHT, MEASUREMENT_PILL_PADDING_X, MEASUREMENT_PILL_RADIUS, MEASUREMENT_TEXT_BASELINE, NOISE_TILE_CACHE_ENTRIES, PAGE_DEFAULT_BACKGROUNDS, PAIRDRAW_MCP_SERVER, PARENT_OUTLINE_ALPHA, PENCIL_STROKE_WEIGHT, PENCIL_TOLERANCE, PEN_ANCHOR_RADIUS, PEN_CLOSE_MIN_POINTS, PEN_CLOSE_RADIUS_BOOST, PEN_CLOSE_THRESHOLD, PEN_HANDLE_RADIUS, PEN_PATH_STROKE_WIDTH, PEN_VERTEX_RADIUS, REASONING_EFFORTS, ROTATION_HANDLE_DISTANCE, ROTATION_SNAP_DEGREES, RULER_BADGE_EXCLUSION, RULER_BADGE_HEIGHT, RULER_BADGE_PADDING, RULER_BADGE_RADIUS, RULER_BG_COLOR, RULER_HIGHLIGHT_ALPHA, RULER_MAJOR_TICK, RULER_MAJOR_TOLERANCE, RULER_MINOR_TICK, RULER_SIZE, RULER_TARGET_PIXEL_SPACING, RULER_TEXT_BASELINE, RULER_TEXT_COLOR, RULER_TICK_COLOR, SECTION_CORNER_RADIUS, SECTION_DEFAULT_FILLS, SECTION_DEFAULT_STROKE, SECTION_HOVER_STROKE_WIDTH, SECTION_TITLE_FONT_FAMILY, SECTION_TITLE_FONT_SIZE, SECTION_TITLE_FONT_URL, SECTION_TITLE_GAP, SECTION_TITLE_HEIGHT, SECTION_TITLE_PADDING_X, SECTION_TITLE_RADIUS, SELECTION_COLOR, SELECTION_DASH_ALPHA, SIZE_FONT_SIZE, SIZE_PILL_HEIGHT, SIZE_PILL_PADDING_X, SIZE_PILL_PADDING_Y, SIZE_PILL_RADIUS, SIZE_PILL_TEXT_OFFSET_Y, SLOT_COLOR, SLOT_EMPTY_FILL_ALPHA, SNAP_COLOR, SNAP_THRESHOLD_SCREEN_PX, SPACING_GUIDE_CAP, TEXTURE_NOISE_CACHE_ENTRIES, TEXT_CARET_COLOR, TEXT_CARET_WIDTH, TEXT_SELECTION_ALPHA, TRANSPARENT, VALUE_FONT_SIZE, VERTEX_SNAP_COLOR, VERTEX_SNAP_GUIDE_ALPHA, VERTEX_SNAP_MARK_RADIUS, ZOOM_DIVISOR, ZOOM_SCALE_MAX, ZOOM_SCALE_MIN };
|
|
420
424
|
|
|
421
425
|
//# sourceMappingURL=constants.js.map
|
package/dist/constants.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.js","names":[],"sources":["../src/constants.ts"],"sourcesContent":["import type { Fill, Stroke } from '@pairdraw/scene-graph'\nimport { WHITE } from '@pairdraw/scene-graph/constants'\nimport type { Color } from '@pairdraw/scene-graph/primitives'\n\nimport type { SelectionTheme } from '#core/canvas/renderer/types'\n\nexport * from './ai/providers'\n\nexport const IS_BROWSER = typeof window !== 'undefined'\nexport const IS_TAURI = IS_BROWSER && '__TAURI_INTERNALS__' in window\n\nexport const BLACK: Color = { r: 0, g: 0, b: 0, a: 1 }\nexport const TRANSPARENT: Color = { r: 0, g: 0, b: 0, a: 0 }\nexport const DEFAULT_SHADOW_COLOR: Color = { r: 0, g: 0, b: 0, a: 0.25 }\nexport const SELECTION_COLOR = { r: 0.23, g: 0.51, b: 0.96, a: 1 } satisfies Color\n/** Selection chrome when the app sets no accent: the default blue with white text. */\nexport const DEFAULT_SELECTION_THEME: Readonly<SelectionTheme> = {\n color: SELECTION_COLOR,\n foreground: WHITE\n}\nexport const COMPONENT_COLOR = { r: 0.592, g: 0.278, b: 1, a: 1 } satisfies Color\n/** Slot frames and their outlines, `#f24bbc` like the app's `--color-slot`. */\nexport const SLOT_COLOR = { r: 0.949, g: 0.294, b: 0.737, a: 1 } satisfies Color\nexport const SLOT_EMPTY_FILL_ALPHA = 0.08\nexport const SNAP_COLOR = { r: 1.0, g: 0.0, b: 0.56, a: 1 } satisfies Color\n/** Guides through path vertices and their crosses, measured from Figma's pen and vector edit mode. */\nexport const VERTEX_SNAP_COLOR = { r: 0.81, g: 0.3, b: 0.18, a: 1 } satisfies Color\nexport const VERTEX_SNAP_GUIDE_ALPHA = 0.6\nexport const VERTEX_SNAP_MARK_RADIUS = 2.5\n/** Half the length of the ticks that end an equal-spacing indicator, in screen pixels. */\nexport const SPACING_GUIDE_CAP = 4\nexport const MEASUREMENT_COLOR = { r: 0.949, g: 0.282, b: 0.133, a: 1 } satisfies Color\nexport const MEASUREMENT_PILL_PADDING_X = 5\nexport const MEASUREMENT_PILL_HEIGHT = 18\nexport const MEASUREMENT_PILL_RADIUS = 3\nexport const MEASUREMENT_TEXT_BASELINE = 4\nexport const CANVAS_BG_COLOR = { r: 0.96, g: 0.96, b: 0.96, a: 1 } satisfies Color\nexport const SNAP_THRESHOLD_SCREEN_PX = 5\n/** The grid a board's layers land on, as FigJam's dots every 16 units. */\nexport const BOARD_GRID = 16\n\nexport const RULER_SIZE = 20\nexport const RULER_BG_COLOR = { r: 0.14, g: 0.14, b: 0.14, a: 1 } satisfies Color\nexport const RULER_TICK_COLOR = { r: 0.4, g: 0.4, b: 0.4, a: 1 } satisfies Color\nexport const RULER_TEXT_COLOR = { r: 0.55, g: 0.55, b: 0.55, a: 1 } satisfies Color\nexport const RULER_BADGE_HEIGHT = 14\nexport const RULER_BADGE_PADDING = 3\nexport const RULER_BADGE_RADIUS = 2\nexport const RULER_BADGE_EXCLUSION = 30\nexport const RULER_TEXT_BASELINE = 0.65\nexport const RULER_MAJOR_TICK = 0.5\nexport const RULER_MINOR_TICK = 0.25\nexport const RULER_HIGHLIGHT_ALPHA = 0.3\n\nexport const PEN_HANDLE_RADIUS = 2.5\nexport const PEN_VERTEX_RADIUS = 3\nexport const PEN_ANCHOR_RADIUS = 4\nexport const PEN_CLOSE_RADIUS_BOOST = 2\nexport const PEN_PATH_STROKE_WIDTH = 2\nexport const PARENT_OUTLINE_ALPHA = 0.5\nexport const DEFAULT_FONT_FAMILY = 'Inter'\nexport const DEFAULT_FONT_SIZE = 14\nexport const DEFAULT_STROKE_MITER_LIMIT = 4\n/** Figma's stroke weight for a node that has not been given one. */\nexport const LABEL_FONT_SIZE = 11\nexport const SIZE_FONT_SIZE = 10\nexport const HUD_FONT_SIZE = 10\nexport const VALUE_FONT_SIZE = 11\n\nexport const HANDLE_HALF_SIZE = 3\n\nexport const LABEL_OFFSET_Y = 8\nexport const SIZE_PILL_PADDING_X = 6\nexport const SIZE_PILL_PADDING_Y = 6\nexport const SIZE_PILL_HEIGHT = 18\nexport const SIZE_PILL_RADIUS = 4\nexport const SIZE_PILL_TEXT_OFFSET_Y = 13\n\nexport const MARQUEE_FILL_ALPHA = 0.08\nexport const SELECTION_DASH_ALPHA = 0.6\n/** Tint inside the layer of the code element around the cursor, under its hover outline. */\nexport const CODE_FOCUS_FILL_ALPHA = 0.1\nexport const DROP_HIGHLIGHT_ALPHA = 0.8\nexport const DROP_HIGHLIGHT_STROKE = 2\n\nexport const LAYOUT_INDICATOR_STROKE = 2\nexport const AUTO_LAYOUT_HOVER_TICK_LENGTH = 12\nexport const AUTO_LAYOUT_HOVER_STRIPE_GAP = 8\nexport const AUTO_LAYOUT_HOVER_STRIPE_WIDTH = 1\nexport const AUTO_LAYOUT_HOVER_STROKE_WIDTH = 1.5\n/** Dash and gap, in screen pixels, of the dotted outlines around auto layout children (Figma 126). */\nexport const LAYOUT_OUTLINE_DASH = 1.75\nexport const LAYOUT_OUTLINE_GAP = 1.25\nexport const AUTO_LAYOUT_HOVER_VALUE_OFFSET = 18\n// Measured on Figma desktop 126's padding and gap value pills.\nexport const AUTO_LAYOUT_HOVER_VALUE_PILL_HEIGHT = 16.5\nexport const AUTO_LAYOUT_HOVER_VALUE_PILL_RADIUS = 2.5\nexport const AUTO_LAYOUT_HOVER_VALUE_PILL_PADDING_X = 4.5\nexport const AUTO_LAYOUT_HOVER_GAP_REGION_TOLERANCE = 12\nexport const AUTO_LAYOUT_HOVER_TICK_HIT_TOLERANCE = 8\nexport const AUTO_LAYOUT_HOVER_PADDING_REGION_TOLERANCE = 20\nexport const AUTO_LAYOUT_PADDING_EDITOR_OFFSET_X = 18\nexport const AUTO_LAYOUT_PADDING_EDITOR_OFFSET_Y = 36\nexport const AUTO_LAYOUT_HOVER_BLUE = { r: 0.28, g: 0.64, b: 1, a: 0.82 } satisfies Color\nexport const AUTO_LAYOUT_HOVER_BLUE_FILL = { r: 0.28, g: 0.64, b: 1, a: 0.1 } satisfies Color\nexport const AUTO_LAYOUT_HOVER_MAGENTA = { r: 1, g: 0.32, b: 0.68, a: 0.78 } satisfies Color\nexport const AUTO_LAYOUT_HOVER_MAGENTA_FILL = { r: 1, g: 0.32, b: 0.68, a: 0.1 } satisfies Color\n// The value pills over a gap and a padding, sampled from Figma desktop 126.\nexport const AUTO_LAYOUT_HOVER_GAP_PILL = { r: 0.886, g: 0.271, b: 0.686, a: 1 } satisfies Color\nexport const AUTO_LAYOUT_HOVER_PADDING_PILL = { r: 0.271, g: 0.592, b: 0.973, a: 1 } satisfies Color\n\nexport const SECTION_TITLE_HEIGHT = 24\nexport const SECTION_TITLE_PADDING_X = 6\nexport const SECTION_TITLE_RADIUS = 5\nexport const SECTION_TITLE_FONT_SIZE = 11\n/**\n * The family section titles draw in: the bundled Inter SemiBold under a name of its own, on the\n * canvas and in the page, so renaming a title shows the same glyphs and document fonts named\n * Inter cannot replace them.\n */\nexport const SECTION_TITLE_FONT_FAMILY = 'Pairdraw Section Title'\nexport const SECTION_TITLE_FONT_URL = '/Inter-SemiBold.ttf'\nexport const SECTION_TITLE_GAP = 6\nexport const SECTION_HOVER_STROKE_WIDTH = 2\n\nexport const COMPONENT_SET_DASH = 6\nexport const COMPONENT_SET_DASH_GAP = 4\nexport const COMPONENT_SET_BORDER_WIDTH = 1.5\n/** Corners of the outline the editor draws around a component set with no strokes of its own. */\nexport const COMPONENT_SET_OUTLINE_RADIUS = 5\nexport const COMPONENT_LABEL_FONT_SIZE = 11\nexport const COMPONENT_LABEL_GAP = 6\nexport const COMPONENT_LABEL_ICON_SIZE = 10\nexport const COMPONENT_LABEL_ICON_GAP = 4\n\nexport const RULER_TARGET_PIXEL_SPACING = 100\nexport const RULER_MAJOR_TOLERANCE = 0.01\n\nexport const FLASH_ATTACK_MS = 200\nexport const FLASH_HOLD_MS = 400\nexport const FLASH_RELEASE_MS = 300\nexport const FLASH_STROKE_WIDTH = 2\nexport const FLASH_PADDING = 5\nexport const FLASH_OVERSHOOT = 30\nexport const FLASH_RADIUS = 4\n\nexport const ISSUE_ERROR_COLOR = { r: 0.949, g: 0.282, b: 0.133, a: 1 } satisfies Color // #F24822\nexport const ISSUE_WARNING_COLOR = { r: 1, g: 0.702, b: 0.078, a: 1 } satisfies Color // #FFB314\nexport const ISSUE_INFO_COLOR = { r: 0.55, g: 0.55, b: 0.55, a: 1 } satisfies Color\nexport const ISSUE_HIGHLIGHT_STROKE_WIDTH = 1.5\nexport const ISSUE_HIGHLIGHT_FILL_ALPHA = 0.08\n\n/** The violet AI agents show in everywhere, the app's `--color-agent`. */\nexport const AI_AGENT_COLOR = { r: 0.486, g: 0.361, b: 1 }\nexport const AI_DONE_COLOR = { r: 0.16, g: 0.73, b: 0.36 }\nexport const AI_DONE_DURATION_MS = 800\n/** How long a layer an agent adds takes to trace in, once its turn comes. */\nexport const AI_ENTER_DURATION_MS = 480\n/** The pause between the layers of one edit, so they appear one after another. */\nexport const AI_ENTER_STAGGER_MS = 45\n/** The last layer of an edit starts within this, however many layers the edit adds. */\nexport const AI_ENTER_MAX_DELAY_MS = 900\n/** One sweep of the light over an area an agent is working in. */\nexport const AI_SHIMMER_PERIOD_MS = 1600\n/** Width of the sweeping light, in screen pixels. */\nexport const AI_SHIMMER_BAND = 120\n\n/** Opacity of the selection color behind selected text while editing. */\nexport const TEXT_SELECTION_ALPHA = 0.3\n/** The caret's colour where the text's fill gives it none, as Figma's. */\nexport const TEXT_CARET_COLOR = BLACK\nexport const TEXT_CARET_WIDTH = 1\n\nexport const AUTOMATION_HTTP_PORT = 7600\n/**\n * Request header the app's own ACP and Pi harness chats send to the MCP server, so their sessions\n * show as those agents rather than as an outside MCP client.\n */\nexport const MCP_AGENT_HEADER = 'x-pairdraw-agent'\n\n/** The name the app's chats give Pairdraw's MCP server in an agent's session. */\nexport const PAIRDRAW_MCP_SERVER = 'pairdraw'\n\n/**\n * Request header naming the app chat whose agent opens an MCP session, so the app can tell that\n * this chat's agent reached its tools before it sends the prompt.\n */\nexport const MCP_CHAT_HEADER = 'x-pairdraw-chat'\n\nexport const GOOGLE_FONTS_API_KEY = 'AIzaSyD1tYDR_dUEiV-Tw1vksEhZbUytgKW5pc8'\n\nexport const CJK_FALLBACK_FAMILIES_MACOS = [\n 'PingFang SC',\n 'PingFang TC',\n 'Hiragino Sans',\n 'Apple SD Gothic Neo',\n 'Heiti SC',\n 'Heiti TC'\n]\n\nexport const CJK_FALLBACK_FAMILIES_WINDOWS = [\n 'Microsoft YaHei',\n 'Microsoft YaHei UI',\n 'Microsoft JhengHei',\n 'Yu Gothic',\n 'Malgun Gothic',\n 'SimHei',\n 'SimSun'\n]\n\nexport const CJK_FALLBACK_FAMILIES_LINUX = [\n 'Noto Sans CJK SC',\n 'Noto Sans CJK TC',\n 'Noto Sans CJK JP',\n 'Noto Sans CJK KR',\n 'WenQuanYi Micro Hei',\n 'Droid Sans Fallback'\n]\n\nexport const CJK_GOOGLE_FONTS = ['Noto Sans SC', 'Noto Sans TC', 'Noto Sans JP', 'Noto Sans KR']\n\n/** Figma's #D9D9D9 for new shapes. */\nexport const DEFAULT_SHAPE_FILL: Fill = {\n type: 'SOLID',\n color: { r: 217 / 255, g: 217 / 255, b: 217 / 255, a: 1 },\n opacity: 1,\n visible: true\n}\n\nexport const DEFAULT_FRAME_FILL: Fill = {\n type: 'SOLID',\n color: { r: 1, g: 1, b: 1, a: 1 },\n opacity: 1,\n visible: true\n}\n\n/** The light or dark interface a new page or section takes its colors from, as in Figma. */\nexport type InterfaceTheme = 'light' | 'dark'\n\n/** A new page's background, which Figma picks from the interface theme it was made in. */\nexport const PAGE_DEFAULT_BACKGROUNDS: Record<InterfaceTheme, Color> = {\n light: CANVAS_BG_COLOR,\n dark: { r: 0x1e / 255, g: 0x1e / 255, b: 0x1e / 255, a: 1 }\n}\n\n/** A FigJam board's page, #F5F5F5 whatever the interface theme, as Figma saves it. */\nexport const BOARD_PAGE_BACKGROUND = {\n r: 245 / 255,\n g: 245 / 255,\n b: 245 / 255,\n a: 1\n} satisfies Color\n\n/** A new section's fill, which Figma picks from the interface theme it was made in. */\nexport const SECTION_DEFAULT_FILLS: Record<InterfaceTheme, Fill> = {\n light: { type: 'SOLID', color: { r: 1, g: 1, b: 1, a: 1 }, opacity: 1, visible: true },\n dark: {\n type: 'SOLID',\n color: { r: 0x44 / 255, g: 0x44 / 255, b: 0x44 / 255, a: 1 },\n opacity: 1,\n visible: true\n }\n}\n\nexport const SECTION_DEFAULT_STROKE: Stroke = {\n type: 'SOLID',\n color: { r: 1, g: 1, b: 1, a: 1 },\n weight: 1,\n opacity: 0.1,\n visible: true,\n align: 'INSIDE'\n}\n\nexport const SECTION_CORNER_RADIUS = 2\n\n/** Effect filters a renderer keeps: a slider drag would otherwise keep every value it passed. */\nexport const EFFECT_FILTER_CACHE_ENTRIES = 64\n\nexport const ZOOM_DIVISOR = 50\nexport const ZOOM_SCALE_MIN = 0.75\nexport const ZOOM_SCALE_MAX = 1.25\n\nexport const PEN_CLOSE_THRESHOLD = 8\n/** Points a pen path needs before a press on its first point closes it: two make a closed shape, as in Figma. */\nexport const PEN_CLOSE_MIN_POINTS = 2\n/**\n * Screen pixels a pencil sample may stray from the line through its neighbours before the curve\n * keeps it, so a stroke drawn zoomed in keeps more detail.\n */\nexport const PENCIL_TOLERANCE = 2.5\n/** A new pencil layer's stroke weight (Figma desktop 126). */\nexport const PENCIL_STROKE_WEIGHT = 2\nexport const ROTATION_SNAP_DEGREES = 15\nexport const HANDLE_HIT_RADIUS = 6\n/** How far outside a shape, in screen pixels, a click still selects it (Figma desktop 126). */\nexport const LAYER_HIT_PAD = 3.5\nexport const ROTATION_HANDLE_DISTANCE = 24\nexport const DEFAULT_TEXT_WIDTH = 200\nexport const DEFAULT_TEXT_HEIGHT = 24\n/** Space Figma leaves between a duplicated top-level frame and the layers to its left. */\nexport const DUPLICATE_FRAME_GAP = 40\n"],"mappings":";;;AAQA,MAAa,aAAa,OAAO,WAAW;AAC5C,MAAa,WAAW,cAAc,yBAAyB;AAE/D,MAAa,QAAe;CAAE,GAAG;CAAG,GAAG;CAAG,GAAG;CAAG,GAAG;AAAE;AACrD,MAAa,cAAqB;CAAE,GAAG;CAAG,GAAG;CAAG,GAAG;CAAG,GAAG;AAAE;AAC3D,MAAa,uBAA8B;CAAE,GAAG;CAAG,GAAG;CAAG,GAAG;CAAG,GAAG;AAAK;AACvE,MAAa,kBAAkB;CAAE,GAAG;CAAM,GAAG;CAAM,GAAG;CAAM,GAAG;AAAE;;AAEjE,MAAa,0BA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C,MAAa,uBAAuB;;;;;AAKpC,MAAa,mBAAmB;;AAEhC,MAAa,uBAAuB;AACpC,MAAa,wBAAwB;AACrC,MAAa,oBAAoB;;AAEjC,MAAa,gBAAgB;AAC7B,MAAa,2BAA2B;AACxC,MAAa,qBAAqB;AAClC,MAAa,sBAAsB;;AAEnC,MAAa,sBAAsB"}
|
|
1
|
+
{"version":3,"file":"constants.js","names":[],"sources":["../src/constants.ts"],"sourcesContent":["import type { Fill, Stroke } from '@pairdraw/scene-graph'\nimport { WHITE } from '@pairdraw/scene-graph/constants'\nimport type { Color } from '@pairdraw/scene-graph/primitives'\n\nimport type { SelectionTheme } from '#core/canvas/renderer/types'\n\nexport * from './ai/providers'\n\nexport const IS_BROWSER = typeof window !== 'undefined'\nexport const IS_TAURI = IS_BROWSER && '__TAURI_INTERNALS__' in window\n\nexport const BLACK: Color = { r: 0, g: 0, b: 0, a: 1 }\nexport const TRANSPARENT: Color = { r: 0, g: 0, b: 0, a: 0 }\nexport const DEFAULT_SHADOW_COLOR: Color = { r: 0, g: 0, b: 0, a: 0.25 }\nexport const SELECTION_COLOR = { r: 0.23, g: 0.51, b: 0.96, a: 1 } satisfies Color\n/** Selection chrome when the app sets no accent: the default blue with white text. */\nexport const DEFAULT_SELECTION_THEME: Readonly<SelectionTheme> = {\n color: SELECTION_COLOR,\n foreground: WHITE\n}\nexport const COMPONENT_COLOR = { r: 0.592, g: 0.278, b: 1, a: 1 } satisfies Color\n/** Slot frames and their outlines, `#f24bbc` like the app's `--color-slot`. */\nexport const SLOT_COLOR = { r: 0.949, g: 0.294, b: 0.737, a: 1 } satisfies Color\nexport const SLOT_EMPTY_FILL_ALPHA = 0.08\nexport const SNAP_COLOR = { r: 1.0, g: 0.0, b: 0.56, a: 1 } satisfies Color\n/** Guides through path vertices and their crosses, measured from Figma's pen and vector edit mode. */\nexport const VERTEX_SNAP_COLOR = { r: 0.81, g: 0.3, b: 0.18, a: 1 } satisfies Color\nexport const VERTEX_SNAP_GUIDE_ALPHA = 0.6\nexport const VERTEX_SNAP_MARK_RADIUS = 2.5\n/** Half the length of the ticks that end an equal-spacing indicator, in screen pixels. */\nexport const SPACING_GUIDE_CAP = 4\nexport const MEASUREMENT_COLOR = { r: 0.949, g: 0.282, b: 0.133, a: 1 } satisfies Color\nexport const MEASUREMENT_PILL_PADDING_X = 5\nexport const MEASUREMENT_PILL_HEIGHT = 18\nexport const MEASUREMENT_PILL_RADIUS = 3\nexport const MEASUREMENT_TEXT_BASELINE = 4\nexport const CANVAS_BG_COLOR = { r: 0.96, g: 0.96, b: 0.96, a: 1 } satisfies Color\nexport const SNAP_THRESHOLD_SCREEN_PX = 5\n/** The grid a board's layers land on, as FigJam's dots every 16 units. */\nexport const BOARD_GRID = 16\n\nexport const RULER_SIZE = 20\nexport const RULER_BG_COLOR = { r: 0.14, g: 0.14, b: 0.14, a: 1 } satisfies Color\nexport const RULER_TICK_COLOR = { r: 0.4, g: 0.4, b: 0.4, a: 1 } satisfies Color\nexport const RULER_TEXT_COLOR = { r: 0.55, g: 0.55, b: 0.55, a: 1 } satisfies Color\nexport const RULER_BADGE_HEIGHT = 14\nexport const RULER_BADGE_PADDING = 3\nexport const RULER_BADGE_RADIUS = 2\nexport const RULER_BADGE_EXCLUSION = 30\nexport const RULER_TEXT_BASELINE = 0.65\nexport const RULER_MAJOR_TICK = 0.5\nexport const RULER_MINOR_TICK = 0.25\nexport const RULER_HIGHLIGHT_ALPHA = 0.3\n\nexport const PEN_HANDLE_RADIUS = 2.5\nexport const PEN_VERTEX_RADIUS = 3\nexport const PEN_ANCHOR_RADIUS = 4\nexport const PEN_CLOSE_RADIUS_BOOST = 2\nexport const PEN_PATH_STROKE_WIDTH = 2\nexport const PARENT_OUTLINE_ALPHA = 0.5\nexport const DEFAULT_FONT_FAMILY = 'Inter'\nexport const DEFAULT_FONT_SIZE = 14\nexport const DEFAULT_STROKE_MITER_LIMIT = 4\n/** Figma's stroke weight for a node that has not been given one. */\nexport const LABEL_FONT_SIZE = 11\nexport const SIZE_FONT_SIZE = 10\nexport const HUD_FONT_SIZE = 10\nexport const VALUE_FONT_SIZE = 11\n\nexport const HANDLE_HALF_SIZE = 3\n\nexport const LABEL_OFFSET_Y = 8\nexport const SIZE_PILL_PADDING_X = 6\nexport const SIZE_PILL_PADDING_Y = 6\nexport const SIZE_PILL_HEIGHT = 18\nexport const SIZE_PILL_RADIUS = 4\nexport const SIZE_PILL_TEXT_OFFSET_Y = 13\n\nexport const MARQUEE_FILL_ALPHA = 0.08\nexport const SELECTION_DASH_ALPHA = 0.6\n/** Tint inside the layer of the code element around the cursor, under its hover outline. */\nexport const CODE_FOCUS_FILL_ALPHA = 0.1\nexport const DROP_HIGHLIGHT_ALPHA = 0.8\nexport const DROP_HIGHLIGHT_STROKE = 2\n\nexport const LAYOUT_INDICATOR_STROKE = 2\nexport const AUTO_LAYOUT_HOVER_TICK_LENGTH = 12\nexport const AUTO_LAYOUT_HOVER_STRIPE_GAP = 8\nexport const AUTO_LAYOUT_HOVER_STRIPE_WIDTH = 1\nexport const AUTO_LAYOUT_HOVER_STROKE_WIDTH = 1.5\n/** Dash and gap, in screen pixels, of the dotted outlines around auto layout children (Figma 126). */\nexport const LAYOUT_OUTLINE_DASH = 1.75\nexport const LAYOUT_OUTLINE_GAP = 1.25\nexport const AUTO_LAYOUT_HOVER_VALUE_OFFSET = 18\n// Measured on Figma desktop 126's padding and gap value pills.\nexport const AUTO_LAYOUT_HOVER_VALUE_PILL_HEIGHT = 16.5\nexport const AUTO_LAYOUT_HOVER_VALUE_PILL_RADIUS = 2.5\nexport const AUTO_LAYOUT_HOVER_VALUE_PILL_PADDING_X = 4.5\nexport const AUTO_LAYOUT_HOVER_GAP_REGION_TOLERANCE = 12\nexport const AUTO_LAYOUT_HOVER_TICK_HIT_TOLERANCE = 8\nexport const AUTO_LAYOUT_HOVER_PADDING_REGION_TOLERANCE = 20\nexport const AUTO_LAYOUT_PADDING_EDITOR_OFFSET_X = 18\nexport const AUTO_LAYOUT_PADDING_EDITOR_OFFSET_Y = 36\nexport const AUTO_LAYOUT_HOVER_BLUE = { r: 0.28, g: 0.64, b: 1, a: 0.82 } satisfies Color\nexport const AUTO_LAYOUT_HOVER_BLUE_FILL = { r: 0.28, g: 0.64, b: 1, a: 0.1 } satisfies Color\nexport const AUTO_LAYOUT_HOVER_MAGENTA = { r: 1, g: 0.32, b: 0.68, a: 0.78 } satisfies Color\nexport const AUTO_LAYOUT_HOVER_MAGENTA_FILL = { r: 1, g: 0.32, b: 0.68, a: 0.1 } satisfies Color\n// The value pills over a gap and a padding, sampled from Figma desktop 126.\nexport const AUTO_LAYOUT_HOVER_GAP_PILL = { r: 0.886, g: 0.271, b: 0.686, a: 1 } satisfies Color\nexport const AUTO_LAYOUT_HOVER_PADDING_PILL = { r: 0.271, g: 0.592, b: 0.973, a: 1 } satisfies Color\n\nexport const SECTION_TITLE_HEIGHT = 24\nexport const SECTION_TITLE_PADDING_X = 6\nexport const SECTION_TITLE_RADIUS = 5\nexport const SECTION_TITLE_FONT_SIZE = 11\n/**\n * The family section titles draw in: the bundled Inter SemiBold under a name of its own, on the\n * canvas and in the page, so renaming a title shows the same glyphs and document fonts named\n * Inter cannot replace them.\n */\nexport const SECTION_TITLE_FONT_FAMILY = 'Pairdraw Section Title'\nexport const SECTION_TITLE_FONT_URL = '/Inter-SemiBold.ttf'\nexport const SECTION_TITLE_GAP = 6\nexport const SECTION_HOVER_STROKE_WIDTH = 2\n\nexport const COMPONENT_SET_DASH = 6\nexport const COMPONENT_SET_DASH_GAP = 4\nexport const COMPONENT_SET_BORDER_WIDTH = 1.5\n/** Corners of the outline the editor draws around a component set with no strokes of its own. */\nexport const COMPONENT_SET_OUTLINE_RADIUS = 5\nexport const COMPONENT_LABEL_FONT_SIZE = 11\nexport const COMPONENT_LABEL_GAP = 6\nexport const COMPONENT_LABEL_ICON_SIZE = 10\nexport const COMPONENT_LABEL_ICON_GAP = 4\n\nexport const RULER_TARGET_PIXEL_SPACING = 100\nexport const RULER_MAJOR_TOLERANCE = 0.01\n\nexport const FLASH_ATTACK_MS = 200\nexport const FLASH_HOLD_MS = 400\nexport const FLASH_RELEASE_MS = 300\nexport const FLASH_STROKE_WIDTH = 2\nexport const FLASH_PADDING = 5\nexport const FLASH_OVERSHOOT = 30\nexport const FLASH_RADIUS = 4\n\nexport const ISSUE_ERROR_COLOR = { r: 0.949, g: 0.282, b: 0.133, a: 1 } satisfies Color // #F24822\nexport const ISSUE_WARNING_COLOR = { r: 1, g: 0.702, b: 0.078, a: 1 } satisfies Color // #FFB314\nexport const ISSUE_INFO_COLOR = { r: 0.55, g: 0.55, b: 0.55, a: 1 } satisfies Color\nexport const ISSUE_HIGHLIGHT_STROKE_WIDTH = 1.5\nexport const ISSUE_HIGHLIGHT_FILL_ALPHA = 0.08\n\n/** The violet AI agents show in everywhere, the app's `--color-agent`. */\nexport const AI_AGENT_COLOR = { r: 0.486, g: 0.361, b: 1 }\nexport const AI_DONE_COLOR = { r: 0.16, g: 0.73, b: 0.36 }\nexport const AI_DONE_DURATION_MS = 800\n/** How long a layer an agent adds takes to trace in, once its turn comes. */\nexport const AI_ENTER_DURATION_MS = 480\n/** The pause between the layers of one edit, so they appear one after another. */\nexport const AI_ENTER_STAGGER_MS = 45\n/** The last layer of an edit starts within this, however many layers the edit adds. */\nexport const AI_ENTER_MAX_DELAY_MS = 900\n/** One sweep of the light over an area an agent is working in. */\nexport const AI_SHIMMER_PERIOD_MS = 1600\n/** Width of the sweeping light, in screen pixels. */\nexport const AI_SHIMMER_BAND = 120\n\n/** Opacity of the selection color behind selected text while editing. */\nexport const TEXT_SELECTION_ALPHA = 0.3\n/** The caret's colour where the text's fill gives it none, as Figma's. */\nexport const TEXT_CARET_COLOR = BLACK\nexport const TEXT_CARET_WIDTH = 1\n\nexport const AUTOMATION_HTTP_PORT = 7600\n/**\n * Request header the app's own ACP and Pi harness chats send to the MCP server, so their sessions\n * show as those agents rather than as an outside MCP client.\n */\nexport const MCP_AGENT_HEADER = 'x-pairdraw-agent'\n\n/** The name the app's chats give Pairdraw's MCP server in an agent's session. */\nexport const PAIRDRAW_MCP_SERVER = 'pairdraw'\n\n/**\n * Request header naming the app chat whose agent opens an MCP session, so the app can tell that\n * this chat's agent reached its tools before it sends the prompt.\n */\nexport const MCP_CHAT_HEADER = 'x-pairdraw-chat'\n\nexport const GOOGLE_FONTS_API_KEY = 'AIzaSyD1tYDR_dUEiV-Tw1vksEhZbUytgKW5pc8'\n\nexport const CJK_FALLBACK_FAMILIES_MACOS = [\n 'PingFang SC',\n 'PingFang TC',\n 'Hiragino Sans',\n 'Apple SD Gothic Neo',\n 'Heiti SC',\n 'Heiti TC'\n]\n\nexport const CJK_FALLBACK_FAMILIES_WINDOWS = [\n 'Microsoft YaHei',\n 'Microsoft YaHei UI',\n 'Microsoft JhengHei',\n 'Yu Gothic',\n 'Malgun Gothic',\n 'SimHei',\n 'SimSun'\n]\n\nexport const CJK_FALLBACK_FAMILIES_LINUX = [\n 'Noto Sans CJK SC',\n 'Noto Sans CJK TC',\n 'Noto Sans CJK JP',\n 'Noto Sans CJK KR',\n 'WenQuanYi Micro Hei',\n 'Droid Sans Fallback'\n]\n\nexport const CJK_GOOGLE_FONTS = ['Noto Sans SC', 'Noto Sans TC', 'Noto Sans JP', 'Noto Sans KR']\n\n/** Figma's #D9D9D9 for new shapes. */\nexport const DEFAULT_SHAPE_FILL: Fill = {\n type: 'SOLID',\n color: { r: 217 / 255, g: 217 / 255, b: 217 / 255, a: 1 },\n opacity: 1,\n visible: true\n}\n\nexport const DEFAULT_FRAME_FILL: Fill = {\n type: 'SOLID',\n color: { r: 1, g: 1, b: 1, a: 1 },\n opacity: 1,\n visible: true\n}\n\n/** The light or dark interface a new page or section takes its colors from, as in Figma. */\nexport type InterfaceTheme = 'light' | 'dark'\n\n/** A new page's background, which Figma picks from the interface theme it was made in. */\nexport const PAGE_DEFAULT_BACKGROUNDS: Record<InterfaceTheme, Color> = {\n light: CANVAS_BG_COLOR,\n dark: { r: 0x1e / 255, g: 0x1e / 255, b: 0x1e / 255, a: 1 }\n}\n\n/** A FigJam board's page, #F5F5F5 whatever the interface theme, as Figma saves it. */\nexport const BOARD_PAGE_BACKGROUND = {\n r: 245 / 255,\n g: 245 / 255,\n b: 245 / 255,\n a: 1\n} satisfies Color\n\n/** A new section's fill, which Figma picks from the interface theme it was made in. */\nexport const SECTION_DEFAULT_FILLS: Record<InterfaceTheme, Fill> = {\n light: { type: 'SOLID', color: { r: 1, g: 1, b: 1, a: 1 }, opacity: 1, visible: true },\n dark: {\n type: 'SOLID',\n color: { r: 0x44 / 255, g: 0x44 / 255, b: 0x44 / 255, a: 1 },\n opacity: 1,\n visible: true\n }\n}\n\nexport const SECTION_DEFAULT_STROKE: Stroke = {\n type: 'SOLID',\n color: { r: 1, g: 1, b: 1, a: 1 },\n weight: 1,\n opacity: 0.1,\n visible: true,\n align: 'INSIDE'\n}\n\nexport const SECTION_CORNER_RADIUS = 2\n\n/** Effect filters a renderer keeps: a slider drag would otherwise keep every value it passed. */\nexport const EFFECT_FILTER_CACHE_ENTRIES = 64\n\n/** Noise tiles a renderer keeps, each about 4 MB: a density or seed drag walks through many. */\nexport const NOISE_TILE_CACHE_ENTRIES = 8\n\n/** Texture displacement tiles a renderer keeps, each 256 KB. */\nexport const TEXTURE_NOISE_CACHE_ENTRIES = 16\n\nexport const ZOOM_DIVISOR = 50\nexport const ZOOM_SCALE_MIN = 0.75\nexport const ZOOM_SCALE_MAX = 1.25\n\nexport const PEN_CLOSE_THRESHOLD = 8\n/** Points a pen path needs before a press on its first point closes it: two make a closed shape, as in Figma. */\nexport const PEN_CLOSE_MIN_POINTS = 2\n/**\n * Screen pixels a pencil sample may stray from the line through its neighbours before the curve\n * keeps it, so a stroke drawn zoomed in keeps more detail.\n */\nexport const PENCIL_TOLERANCE = 2.5\n/** A new pencil layer's stroke weight (Figma desktop 126). */\nexport const PENCIL_STROKE_WEIGHT = 2\nexport const ROTATION_SNAP_DEGREES = 15\nexport const HANDLE_HIT_RADIUS = 6\n/** How far outside a shape, in screen pixels, a click still selects it (Figma desktop 126). */\nexport const LAYER_HIT_PAD = 3.5\nexport const ROTATION_HANDLE_DISTANCE = 24\nexport const DEFAULT_TEXT_WIDTH = 200\nexport const DEFAULT_TEXT_HEIGHT = 24\n/** Space Figma leaves between a duplicated top-level frame and the layers to its left. */\nexport const DUPLICATE_FRAME_GAP = 40\n"],"mappings":";;;AAQA,MAAa,aAAa,OAAO,WAAW;AAC5C,MAAa,WAAW,cAAc,yBAAyB;AAE/D,MAAa,QAAe;CAAE,GAAG;CAAG,GAAG;CAAG,GAAG;CAAG,GAAG;AAAE;AACrD,MAAa,cAAqB;CAAE,GAAG;CAAG,GAAG;CAAG,GAAG;CAAG,GAAG;AAAE;AAC3D,MAAa,uBAA8B;CAAE,GAAG;CAAG,GAAG;CAAG,GAAG;CAAG,GAAG;AAAK;AACvE,MAAa,kBAAkB;CAAE,GAAG;CAAM,GAAG;CAAM,GAAG;CAAM,GAAG;AAAE;;AAEjE,MAAa,0BAAoD;CAC/D,OAAO;CACP,YAAY;AACd;AACA,MAAa,kBAAkB;CAAE,GAAG;CAAO,GAAG;CAAO,GAAG;CAAG,GAAG;AAAE;;AAEhE,MAAa,aAAa;CAAE,GAAG;CAAO,GAAG;CAAO,GAAG;CAAO,GAAG;AAAE;AAC/D,MAAa,wBAAwB;AACrC,MAAa,aAAa;CAAE,GAAG;CAAK,GAAG;CAAK,GAAG;CAAM,GAAG;AAAE;;AAE1D,MAAa,oBAAoB;CAAE,GAAG;CAAM,GAAG;CAAK,GAAG;CAAM,GAAG;AAAE;AAClE,MAAa,0BAA0B;AACvC,MAAa,0BAA0B;;AAEvC,MAAa,oBAAoB;AACjC,MAAa,oBAAoB;CAAE,GAAG;CAAO,GAAG;CAAO,GAAG;CAAO,GAAG;AAAE;AACtE,MAAa,6BAA6B;AAC1C,MAAa,0BAA0B;AACvC,MAAa,0BAA0B;AACvC,MAAa,4BAA4B;AACzC,MAAa,kBAA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wBAAwB;CACnC,GAAG,MAAM;CACT,GAAG,MAAM;CACT,GAAG,MAAM;CACT,GAAG;AACL;;AAGA,MAAa,wBAAsD;CACjE,OAAO;EAAE,MAAM;EAAS,OAAO;GAAE,GAAG;GAAG,GAAG;GAAG,GAAG;GAAG,GAAG;EAAE;EAAG,SAAS;EAAG,SAAS;CAAK;CACrF,MAAM;EACJ,MAAM;EACN,OAAO;GAAE,GAAG,KAAO;GAAK,GAAG,KAAO;GAAK,GAAG,KAAO;GAAK,GAAG;EAAE;EAC3D,SAAS;EACT,SAAS;CACX;AACF;AAEA,MAAa,yBAAiC;CAC5C,MAAM;CACN,OAAO;EAAE,GAAG;EAAG,GAAG;EAAG,GAAG;EAAG,GAAG;CAAE;CAChC,QAAQ;CACR,SAAS;CACT,SAAS;CACT,OAAO;AACT;AAEA,MAAa,wBAAwB;;AAGrC,MAAa,8BAA8B;;AAG3C,MAAa,2BAA2B;;AAGxC,MAAa,8BAA8B;AAE3C,MAAa,eAAe;AAC5B,MAAa,iBAAiB;AAC9B,MAAa,iBAAiB;AAE9B,MAAa,sBAAsB;;AAEnC,MAAa,uBAAuB;;;;;AAKpC,MAAa,mBAAmB;;AAEhC,MAAa,uBAAuB;AACpC,MAAa,wBAAwB;AACrC,MAAa,oBAAoB;;AAEjC,MAAa,gBAAgB;AAC7B,MAAa,2BAA2B;AACxC,MAAa,qBAAqB;AAClC,MAAa,sBAAsB;;AAEnC,MAAa,sBAAsB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"renderer.d.ts","names":[],"sources":["../../src/design-jsx/renderer.ts"],"mappings":";;;;;;;iBAkEgB,kBAAkB,QAAO;
|
|
1
|
+
{"version":3,"file":"renderer.d.ts","names":[],"sources":["../../src/design-jsx/renderer.ts"],"mappings":";;;;;;;iBAkEgB,kBAAkB,QAAO;EAWk6T,YAAA,uCAAA,YAAA,mBAAA,yCAAC,kBAAA,uCAAA;EAA8K,aAAA,uCAAA,YAAA,qCAAA,UAAA,yCAAC,kBAAA,uCAAA;EAAqL,cAAA,uCAAA,YAAA,qCAAA,UAAA,yCAAC,kBAAA,uCAAA;;;cADlyU,YAAS,uCAAA,YAAA,mBAAA,yCAAA,kBAAA,uCAAA,iBAAE,cAAW,uCAAA,YAAA,qCAAA,UAAA,yCAAA,kBAAA,uCAAA,iBAAE,aAAU,uCAAA,YAAA,qCAAA,UAAA,yCAAA,kBAAA,uCAAA"}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import { AllowedValue, DesignRules } from "./rules.js";
|
|
2
|
+
import { SceneGraph, SceneNode, Variable } from "@pairdraw/scene-graph";
|
|
3
|
+
import { DesignMemoryGroup } from "@pairdraw/scene-graph/design-memory";
|
|
4
|
+
//#region src/design-memory/check.d.ts
|
|
5
|
+
/** A value that breaks the memory, with the closest one it allows. */
|
|
6
|
+
interface DesignViolation {
|
|
7
|
+
group: DesignMemoryGroup;
|
|
8
|
+
severity: 'refuse' | 'warn';
|
|
9
|
+
/** The layer, or the variable, that holds the value. */
|
|
10
|
+
nodeId: string;
|
|
11
|
+
nodeName: string;
|
|
12
|
+
path: string;
|
|
13
|
+
value: string | number;
|
|
14
|
+
nearest: AllowedValue<string | number> | null;
|
|
15
|
+
}
|
|
16
|
+
interface DesignFindings {
|
|
17
|
+
refused: DesignViolation[];
|
|
18
|
+
warnings: DesignViolation[];
|
|
19
|
+
/** The rules the edit was judged by; null when it brought no values to judge. */
|
|
20
|
+
rules: DesignRules | null;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* What an edit did: the layers it created, the fields it changed on others with their values
|
|
24
|
+
* before, the layers it deleted as they were, and the variables it created or changed.
|
|
25
|
+
*/
|
|
26
|
+
interface DesignEdit {
|
|
27
|
+
created: readonly Pick<SceneNode, 'id'>[];
|
|
28
|
+
updated: readonly {
|
|
29
|
+
id: string;
|
|
30
|
+
before: Partial<SceneNode>;
|
|
31
|
+
after: Partial<SceneNode>;
|
|
32
|
+
}[];
|
|
33
|
+
deleted?: readonly SceneNode[];
|
|
34
|
+
/** Each variable created (`before` null) or changed, with what it held before. */
|
|
35
|
+
variables?: readonly {
|
|
36
|
+
id: string;
|
|
37
|
+
before: Partial<Variable> | null;
|
|
38
|
+
}[];
|
|
39
|
+
}
|
|
40
|
+
interface DesignCheckOptions {
|
|
41
|
+
/**
|
|
42
|
+
* Report what the memory would refuse as warnings: for outside content, such as an imported
|
|
43
|
+
* web page, SVG or photo, whose values are its own, and for a call a person made.
|
|
44
|
+
*/
|
|
45
|
+
warnOnly?: boolean;
|
|
46
|
+
/**
|
|
47
|
+
* The rules as they were before the edit, so nothing the edit itself did, such as a variable
|
|
48
|
+
* it created, widens what it is judged by. Resolved from the document now when absent.
|
|
49
|
+
*/
|
|
50
|
+
rules?: DesignRules;
|
|
51
|
+
/**
|
|
52
|
+
* The layers a call copies or converts with their values, such as a clone's original or the
|
|
53
|
+
* layers a boolean joins: a value they already had is not new on what the call made of them.
|
|
54
|
+
* Any other call is judged only against what the memory allows, wherever else a value is used.
|
|
55
|
+
*/
|
|
56
|
+
copiedFrom?: readonly string[];
|
|
57
|
+
/**
|
|
58
|
+
* The call joins the named layers into one and may take a paint from any of them, as flatten
|
|
59
|
+
* and boolean operations do: only a value every named layer had in the same field is theirs.
|
|
60
|
+
*/
|
|
61
|
+
merged?: boolean;
|
|
62
|
+
}
|
|
63
|
+
/** The values on a layer that break the memory, as lint lists them. */
|
|
64
|
+
declare function designViolations(rules: DesignRules, node: SceneNode): DesignViolation[];
|
|
65
|
+
/**
|
|
66
|
+
* Judges what an edit did against the document's design memory; null when the document has
|
|
67
|
+
* none. Only values the edit brought in are judged, against the rules as they were before it:
|
|
68
|
+
* - a value written onto a layer is judged against what the memory allows, wherever else the
|
|
69
|
+
* document uses it, unless the call copied or converted layers that already had it
|
|
70
|
+
* (`copiedFrom`);
|
|
71
|
+
* - Pairdraw's own defaults for a new layer warn at most: the agent did not choose them;
|
|
72
|
+
* - variables and shared styles are judged on every value they now give the system, under their
|
|
73
|
+
* scopes as they are now, so creating, changing or rescoping one cannot widen the rules;
|
|
74
|
+
* binding layers to the existing system stays free.
|
|
75
|
+
* People's edits are never judged here, only agents' and automation's.
|
|
76
|
+
*/
|
|
77
|
+
declare function checkDesignEdit(graph: SceneGraph, edit: DesignEdit, options?: DesignCheckOptions): DesignFindings | null;
|
|
78
|
+
/** A value proposed for a design, judged before it is used. */
|
|
79
|
+
interface DesignValueVerdict {
|
|
80
|
+
group: DesignMemoryGroup;
|
|
81
|
+
value: string | number;
|
|
82
|
+
/** `invalid` for a value the group cannot read, such as a color that is not CSS. */
|
|
83
|
+
verdict: 'ok' | 'warn' | 'refuse' | 'invalid';
|
|
84
|
+
nearest: AllowedValue<string | number> | null;
|
|
85
|
+
}
|
|
86
|
+
/** Judges values an agent means to use, so it can pick allowed ones before it edits. */
|
|
87
|
+
declare function checkDesignValues(rules: DesignRules, proposal: Partial<Record<DesignMemoryGroup, readonly (string | number)[]>>): DesignValueVerdict[];
|
|
88
|
+
//#endregion
|
|
89
|
+
export { DesignCheckOptions, DesignEdit, DesignFindings, DesignValueVerdict, DesignViolation, checkDesignEdit, checkDesignValues, designViolations };
|
|
90
|
+
//# sourceMappingURL=check.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"check.d.ts","names":[],"sources":["../../src/design-memory/check.ts"],"mappings":";;;;;UA6BiB;EACf,OAAO;EACP;;EAEA;EACA;EACA;EACA;EACA,SAAS;;UAGM;EACf,SAAS;EACT,UAAU;;EAEV,OAAO;;;;;;UAOQ;EACf,kBAAkB,KAAK;EACvB;IAAoB;IAAY,QAAQ,QAAQ;IAAY,OAAO,QAAQ;;EAC3E,mBAAmB;;EAEnB;IAAuB;IAAY,QAAQ,QAAQ;;;UAGpC;;;;;EAKf;;;;;EAKA,QAAQ;;;;;;EAMR;;;;;EAKA;;;iBAqDc,iBAAiB,OAAO,aAAa,MAAM,YAAY;;;;;;;;;;;;;iBAkLvD,gBACd,OAAO,YACP,MAAM,YACN,UAAS,qBACR;;UA0Bc;EACf,OAAO;EACP;;EAEA;EACA,SAAS;;;iBAIK,kBACd,OAAO,aACP,UAAU,QAAQ,OAAO,oDACxB"}
|
|
@@ -0,0 +1,281 @@
|
|
|
1
|
+
import { DEFAULT_FONT_FAMILY } from "../constants.js";
|
|
2
|
+
import { newLayerDefaults } from "../editor/shapes/defaults.js";
|
|
3
|
+
import { isStyleNode, nearestColor, nearestNumber, styleValues, variableValues } from "./rules.js";
|
|
4
|
+
import { currentDesignRules } from "./document.js";
|
|
5
|
+
import { copiedValueKey, designValueKey, designValues } from "./values.js";
|
|
6
|
+
import { colorToHex } from "@pairdraw/scene-graph/color";
|
|
7
|
+
import { findInstanceAncestor, hasInstanceOverride } from "@pairdraw/scene-graph/instances";
|
|
8
|
+
import { DESIGN_MEMORY_GROUPS, cachedDesignMemory, normalizeDesignValue } from "@pairdraw/scene-graph/design-memory";
|
|
9
|
+
//#region src/design-memory/check.ts
|
|
10
|
+
/** The neutral colors and the font Pairdraw gives a new layer of every kind. */
|
|
11
|
+
const PAIRDRAW_DEFAULT_KEYS = /* @__PURE__ */ new Set([designValueKey("fonts", DEFAULT_FONT_FAMILY), ...[
|
|
12
|
+
"FRAME",
|
|
13
|
+
"COMPONENT",
|
|
14
|
+
"SECTION",
|
|
15
|
+
"RECTANGLE",
|
|
16
|
+
"LINE",
|
|
17
|
+
"TEXT"
|
|
18
|
+
].flatMap((type) => ["light", "dark"].flatMap((theme) => {
|
|
19
|
+
const { fills = [], strokes = [] } = newLayerDefaults(type, theme);
|
|
20
|
+
return [...fills, ...strokes].map((paint) => designValueKey("colors", colorToHex(paint.color)));
|
|
21
|
+
}))]);
|
|
22
|
+
/** Judges one value; null when the memory allows it or does not check its group. */
|
|
23
|
+
function judge(rules, node, value) {
|
|
24
|
+
const group = rules[value.group];
|
|
25
|
+
if (group.enforce === "off" || value.fromSystem && group.fromSystem) return null;
|
|
26
|
+
let nearest = null;
|
|
27
|
+
if (value.group === "colors" && typeof value.value === "string") {
|
|
28
|
+
const match = nearestColor(rules.colors, value.value);
|
|
29
|
+
if (match && match.distance <= .02) return null;
|
|
30
|
+
nearest = match?.allowed ?? null;
|
|
31
|
+
} else if (value.group === "fonts" && typeof value.value === "string") {
|
|
32
|
+
const family = value.value.toLowerCase();
|
|
33
|
+
if (rules.fonts.allowed.some((allowed) => allowed.value.toLowerCase() === family)) return null;
|
|
34
|
+
} else if (typeof value.value === "number" && value.group !== "colors" && value.group !== "fonts") {
|
|
35
|
+
const match = nearestNumber(rules[value.group], value.value);
|
|
36
|
+
if (match && Math.abs(match.value - value.value) <= .01) return null;
|
|
37
|
+
nearest = match;
|
|
38
|
+
}
|
|
39
|
+
return {
|
|
40
|
+
group: value.group,
|
|
41
|
+
severity: group.enforce === "refuse" && !value.soft ? "refuse" : "warn",
|
|
42
|
+
nodeId: node.id,
|
|
43
|
+
nodeName: node.name,
|
|
44
|
+
path: value.path,
|
|
45
|
+
value: value.value,
|
|
46
|
+
nearest
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
/** The values on a layer that break the memory, as lint lists them. */
|
|
50
|
+
function designViolations(rules, node) {
|
|
51
|
+
const violations = [];
|
|
52
|
+
for (const value of designValues(node)) {
|
|
53
|
+
const violation = judge(rules, node, value);
|
|
54
|
+
if (violation) violations.push(violation);
|
|
55
|
+
}
|
|
56
|
+
return violations;
|
|
57
|
+
}
|
|
58
|
+
const keyOf = (value) => designValueKey(value.group, value.value);
|
|
59
|
+
/**
|
|
60
|
+
* The values an edit brought to a layer: on a layer it created, all of them; on one it changed,
|
|
61
|
+
* those in the fields it changed that the same field did not hold before, as a value that is
|
|
62
|
+
* judged in full, so moving or renaming an old layer judges nothing. A layer inside an instance shows its component's values, so only
|
|
63
|
+
* the fields it overrides are its own.
|
|
64
|
+
*/
|
|
65
|
+
function editedValues(graph, node, change) {
|
|
66
|
+
const inInstance = findInstanceAncestor(graph, node.id) !== void 0;
|
|
67
|
+
const own = (value) => !inInstance || hasInstanceOverride(graph, node.id, String(value.field));
|
|
68
|
+
let values = designValues(node).filter(own);
|
|
69
|
+
if (change) {
|
|
70
|
+
const changed = new Set(Object.keys(change.after));
|
|
71
|
+
values = values.filter((value) => changed.has(String(value.field)));
|
|
72
|
+
const heldKey = (value) => `${String(value.field)}|${copiedValueKey(value)}`;
|
|
73
|
+
const previous = new Set(designValues({
|
|
74
|
+
...node,
|
|
75
|
+
...change.before
|
|
76
|
+
}).map(heldKey));
|
|
77
|
+
values = values.filter((value) => !previous.has(heldKey(value)));
|
|
78
|
+
}
|
|
79
|
+
return values;
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* The values a variable an edit created or changed now gives the system, under its type and
|
|
83
|
+
* scopes as they are now, so a rescoped variable is judged on what it newly admits.
|
|
84
|
+
*/
|
|
85
|
+
function editedVariableValues(graph, change) {
|
|
86
|
+
const variable = graph.variables.get(change.id);
|
|
87
|
+
if (!variable) return null;
|
|
88
|
+
const values = variableValues(graph, variable);
|
|
89
|
+
return values.length > 0 ? {
|
|
90
|
+
variable,
|
|
91
|
+
values
|
|
92
|
+
} : null;
|
|
93
|
+
}
|
|
94
|
+
/** The values a style layer an edit created or changed now gives the system. */
|
|
95
|
+
function editedStyleValues(node) {
|
|
96
|
+
return isStyleNode(node) ? styleValues(node) : [];
|
|
97
|
+
}
|
|
98
|
+
function systemValue(value, path) {
|
|
99
|
+
return {
|
|
100
|
+
...value,
|
|
101
|
+
field: "name",
|
|
102
|
+
path,
|
|
103
|
+
fromSystem: false,
|
|
104
|
+
soft: false
|
|
105
|
+
};
|
|
106
|
+
}
|
|
107
|
+
/** Every value an edit brought in: on layers, in the styles they define, and in variables. */
|
|
108
|
+
function broughtValues(graph, edit) {
|
|
109
|
+
const brought = [];
|
|
110
|
+
const visit = (id, change) => {
|
|
111
|
+
const node = graph.getNode(id);
|
|
112
|
+
if (!node) return;
|
|
113
|
+
const values = editedValues(graph, node, change);
|
|
114
|
+
if (values.length > 0) brought.push({
|
|
115
|
+
owner: node,
|
|
116
|
+
values,
|
|
117
|
+
layer: true
|
|
118
|
+
});
|
|
119
|
+
const styles = editedStyleValues(node).map((value) => systemValue(value, "style"));
|
|
120
|
+
if (styles.length > 0) brought.push({
|
|
121
|
+
owner: node,
|
|
122
|
+
values: styles,
|
|
123
|
+
layer: false
|
|
124
|
+
});
|
|
125
|
+
};
|
|
126
|
+
for (const node of edit.created) visit(node.id, null);
|
|
127
|
+
for (const change of edit.updated) visit(change.id, change);
|
|
128
|
+
for (const change of edit.variables ?? []) {
|
|
129
|
+
const edited = editedVariableValues(graph, change);
|
|
130
|
+
if (!edited) continue;
|
|
131
|
+
brought.push({
|
|
132
|
+
owner: {
|
|
133
|
+
id: edited.variable.id,
|
|
134
|
+
name: edited.variable.name
|
|
135
|
+
},
|
|
136
|
+
values: edited.values.map((value) => systemValue(value, "variable")),
|
|
137
|
+
layer: false
|
|
138
|
+
});
|
|
139
|
+
}
|
|
140
|
+
return brought;
|
|
141
|
+
}
|
|
142
|
+
/**
|
|
143
|
+
* A copied value's key with the field it sits in, so a fill never vouches for a stroke.
|
|
144
|
+
*/
|
|
145
|
+
function provenanceKey(value) {
|
|
146
|
+
return `${String(value.field)}|${copiedValueKey(value)}`;
|
|
147
|
+
}
|
|
148
|
+
/**
|
|
149
|
+
* The values on the layers a copying call names, as they were before it: their subtrees, read
|
|
150
|
+
* as they were where the call changed them, and the layers it deleted, such as a boolean's
|
|
151
|
+
* operands. Only the named layers are read, never the rest of the document. A merging call may
|
|
152
|
+
* take one operand's paint, so it vouches only for a value every named layer had in that field.
|
|
153
|
+
*/
|
|
154
|
+
function copiedValues(graph, edit, sourceIds, merged) {
|
|
155
|
+
const created = new Set(edit.created.map((node) => node.id));
|
|
156
|
+
const before = new Map(edit.updated.map((change) => [change.id, change.before]));
|
|
157
|
+
const deleted = new Map((edit.deleted ?? []).map((node) => [node.id, node]));
|
|
158
|
+
const snapshot = (id) => {
|
|
159
|
+
if (created.has(id)) return void 0;
|
|
160
|
+
const removed = deleted.get(id);
|
|
161
|
+
if (removed) return removed;
|
|
162
|
+
const node = graph.getNode(id);
|
|
163
|
+
if (!node) return void 0;
|
|
164
|
+
const previous = before.get(id);
|
|
165
|
+
return previous ? {
|
|
166
|
+
...node,
|
|
167
|
+
...previous
|
|
168
|
+
} : node;
|
|
169
|
+
};
|
|
170
|
+
const subtreeKeys = (id) => {
|
|
171
|
+
const keys = /* @__PURE__ */ new Set();
|
|
172
|
+
const pending = [id];
|
|
173
|
+
for (let current = pending.pop(); current !== void 0; current = pending.pop()) {
|
|
174
|
+
const node = snapshot(current);
|
|
175
|
+
if (!node) continue;
|
|
176
|
+
for (const value of designValues(node)) keys.add(provenanceKey(value));
|
|
177
|
+
pending.push(...node.childIds);
|
|
178
|
+
}
|
|
179
|
+
return keys;
|
|
180
|
+
};
|
|
181
|
+
const sources = sourceIds.map(subtreeKeys);
|
|
182
|
+
if (!merged) {
|
|
183
|
+
const keys = /* @__PURE__ */ new Set();
|
|
184
|
+
for (const node of edit.deleted ?? []) for (const value of designValues(node)) keys.add(provenanceKey(value));
|
|
185
|
+
for (const keysOfSource of sources) for (const key of keysOfSource) keys.add(key);
|
|
186
|
+
return keys;
|
|
187
|
+
}
|
|
188
|
+
if (sources.length === 0) return /* @__PURE__ */ new Set();
|
|
189
|
+
const [first, ...rest] = sources;
|
|
190
|
+
let keys = first;
|
|
191
|
+
for (const other of rest) keys = new Set([...keys].filter((key) => other.has(key)));
|
|
192
|
+
return keys;
|
|
193
|
+
}
|
|
194
|
+
/**
|
|
195
|
+
* A value written on a layer, as it is judged: none when a copied layer already had it in the
|
|
196
|
+
* same field, and only a warning for Pairdraw's own default for a new layer, which the agent did
|
|
197
|
+
* not choose.
|
|
198
|
+
*/
|
|
199
|
+
function layerValue(value, copied) {
|
|
200
|
+
if (copied?.has(provenanceKey(value))) return null;
|
|
201
|
+
return PAIRDRAW_DEFAULT_KEYS.has(keyOf(value)) ? {
|
|
202
|
+
...value,
|
|
203
|
+
soft: true
|
|
204
|
+
} : value;
|
|
205
|
+
}
|
|
206
|
+
/** A variable's or style's value, judged only where the group takes the system's values. */
|
|
207
|
+
function systemValueIn(rules, value) {
|
|
208
|
+
return rules[value.group].fromSystem ? value : null;
|
|
209
|
+
}
|
|
210
|
+
/**
|
|
211
|
+
* Judges what an edit did against the document's design memory; null when the document has
|
|
212
|
+
* none. Only values the edit brought in are judged, against the rules as they were before it:
|
|
213
|
+
* - a value written onto a layer is judged against what the memory allows, wherever else the
|
|
214
|
+
* document uses it, unless the call copied or converted layers that already had it
|
|
215
|
+
* (`copiedFrom`);
|
|
216
|
+
* - Pairdraw's own defaults for a new layer warn at most: the agent did not choose them;
|
|
217
|
+
* - variables and shared styles are judged on every value they now give the system, under their
|
|
218
|
+
* scopes as they are now, so creating, changing or rescoping one cannot widen the rules;
|
|
219
|
+
* binding layers to the existing system stays free.
|
|
220
|
+
* People's edits are never judged here, only agents' and automation's.
|
|
221
|
+
*/
|
|
222
|
+
function checkDesignEdit(graph, edit, options = {}) {
|
|
223
|
+
const memory = options.rules?.memory ?? cachedDesignMemory(graph);
|
|
224
|
+
if (!memory) return null;
|
|
225
|
+
const findings = {
|
|
226
|
+
refused: [],
|
|
227
|
+
warnings: [],
|
|
228
|
+
rules: null
|
|
229
|
+
};
|
|
230
|
+
const pending = broughtValues(graph, edit);
|
|
231
|
+
if (pending.length === 0) return findings;
|
|
232
|
+
const rules = options.rules ?? currentDesignRules(graph, memory);
|
|
233
|
+
findings.rules = rules;
|
|
234
|
+
const copied = options.copiedFrom?.length ? copiedValues(graph, edit, options.copiedFrom, options.merged === true) : null;
|
|
235
|
+
for (const { owner, values, layer } of pending) for (const value of values) {
|
|
236
|
+
const judged = layer ? layerValue(value, copied) : systemValueIn(rules, value);
|
|
237
|
+
if (!judged) continue;
|
|
238
|
+
const violation = judge(rules, owner, judged);
|
|
239
|
+
if (!violation) continue;
|
|
240
|
+
if (violation.severity === "refuse" && !options.warnOnly) findings.refused.push(violation);
|
|
241
|
+
else findings.warnings.push({
|
|
242
|
+
...violation,
|
|
243
|
+
severity: "warn"
|
|
244
|
+
});
|
|
245
|
+
}
|
|
246
|
+
return findings;
|
|
247
|
+
}
|
|
248
|
+
/** Judges values an agent means to use, so it can pick allowed ones before it edits. */
|
|
249
|
+
function checkDesignValues(rules, proposal) {
|
|
250
|
+
const probe = {
|
|
251
|
+
id: "",
|
|
252
|
+
name: ""
|
|
253
|
+
};
|
|
254
|
+
return DESIGN_MEMORY_GROUPS.flatMap((group) => (proposal[group] ?? []).map((input) => {
|
|
255
|
+
const value = normalizeDesignValue(group, input);
|
|
256
|
+
if (value === null) return {
|
|
257
|
+
group,
|
|
258
|
+
value: input,
|
|
259
|
+
verdict: "invalid",
|
|
260
|
+
nearest: null
|
|
261
|
+
};
|
|
262
|
+
const violation = judge(rules, probe, {
|
|
263
|
+
group,
|
|
264
|
+
field: "name",
|
|
265
|
+
path: group,
|
|
266
|
+
value,
|
|
267
|
+
fromSystem: false,
|
|
268
|
+
soft: false
|
|
269
|
+
});
|
|
270
|
+
return {
|
|
271
|
+
group,
|
|
272
|
+
value,
|
|
273
|
+
verdict: violation?.severity ?? "ok",
|
|
274
|
+
nearest: violation?.nearest ?? null
|
|
275
|
+
};
|
|
276
|
+
}));
|
|
277
|
+
}
|
|
278
|
+
//#endregion
|
|
279
|
+
export { checkDesignEdit, checkDesignValues, designViolations };
|
|
280
|
+
|
|
281
|
+
//# sourceMappingURL=check.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"check.js","names":[],"sources":["../../src/design-memory/check.ts"],"sourcesContent":["import type { SceneGraph, SceneNode, Variable } from '@pairdraw/scene-graph'\nimport { colorToHex } from '@pairdraw/scene-graph/color'\nimport {\n cachedDesignMemory,\n DESIGN_MEMORY_GROUPS,\n normalizeDesignValue,\n type DesignMemoryGroup\n} from '@pairdraw/scene-graph/design-memory'\nimport { findInstanceAncestor, hasInstanceOverride } from '@pairdraw/scene-graph/instances'\n\nimport { DEFAULT_FONT_FAMILY } from '#core/constants'\nimport { newLayerDefaults } from '#core/editor/shapes/defaults'\n\nimport { currentDesignRules } from './document'\nimport {\n COLOR_TOLERANCE,\n isStyleNode,\n nearestColor,\n nearestNumber,\n NUMBER_TOLERANCE,\n styleValues,\n variableValues,\n type AllowedValue,\n type DesignRules,\n type SystemValue\n} from './rules'\nimport { copiedValueKey, designValueKey, designValues, type DesignValue } from './values'\n\n/** A value that breaks the memory, with the closest one it allows. */\nexport interface DesignViolation {\n group: DesignMemoryGroup\n severity: 'refuse' | 'warn'\n /** The layer, or the variable, that holds the value. */\n nodeId: string\n nodeName: string\n path: string\n value: string | number\n nearest: AllowedValue<string | number> | null\n}\n\nexport interface DesignFindings {\n refused: DesignViolation[]\n warnings: DesignViolation[]\n /** The rules the edit was judged by; null when it brought no values to judge. */\n rules: DesignRules | null\n}\n\n/**\n * What an edit did: the layers it created, the fields it changed on others with their values\n * before, the layers it deleted as they were, and the variables it created or changed.\n */\nexport interface DesignEdit {\n created: readonly Pick<SceneNode, 'id'>[]\n updated: readonly { id: string; before: Partial<SceneNode>; after: Partial<SceneNode> }[]\n deleted?: readonly SceneNode[]\n /** Each variable created (`before` null) or changed, with what it held before. */\n variables?: readonly { id: string; before: Partial<Variable> | null }[]\n}\n\nexport interface DesignCheckOptions {\n /**\n * Report what the memory would refuse as warnings: for outside content, such as an imported\n * web page, SVG or photo, whose values are its own, and for a call a person made.\n */\n warnOnly?: boolean\n /**\n * The rules as they were before the edit, so nothing the edit itself did, such as a variable\n * it created, widens what it is judged by. Resolved from the document now when absent.\n */\n rules?: DesignRules\n /**\n * The layers a call copies or converts with their values, such as a clone's original or the\n * layers a boolean joins: a value they already had is not new on what the call made of them.\n * Any other call is judged only against what the memory allows, wherever else a value is used.\n */\n copiedFrom?: readonly string[]\n /**\n * The call joins the named layers into one and may take a paint from any of them, as flatten\n * and boolean operations do: only a value every named layer had in the same field is theirs.\n */\n merged?: boolean\n}\n\n/** The neutral colors and the font Pairdraw gives a new layer of every kind. */\nconst PAIRDRAW_DEFAULT_KEYS: ReadonlySet<string> = new Set([\n designValueKey('fonts', DEFAULT_FONT_FAMILY),\n ...(['FRAME', 'COMPONENT', 'SECTION', 'RECTANGLE', 'LINE', 'TEXT'] as const).flatMap((type) =>\n (['light', 'dark'] as const).flatMap((theme) => {\n const { fills = [], strokes = [] } = newLayerDefaults(type, theme)\n return [...fills, ...strokes].map((paint) =>\n designValueKey('colors', colorToHex(paint.color))\n )\n })\n )\n])\n\n/** Judges one value; null when the memory allows it or does not check its group. */\nfunction judge(\n rules: DesignRules,\n node: Pick<SceneNode, 'id' | 'name'>,\n value: DesignValue\n): DesignViolation | null {\n const group = rules[value.group]\n if (group.enforce === 'off' || (value.fromSystem && group.fromSystem)) return null\n let nearest: AllowedValue<string | number> | null = null\n if (value.group === 'colors' && typeof value.value === 'string') {\n const match = nearestColor(rules.colors, value.value)\n if (match && match.distance <= COLOR_TOLERANCE) return null\n nearest = match?.allowed ?? null\n } else if (value.group === 'fonts' && typeof value.value === 'string') {\n const family = value.value.toLowerCase()\n if (rules.fonts.allowed.some((allowed) => allowed.value.toLowerCase() === family)) return null\n } else if (\n typeof value.value === 'number' &&\n value.group !== 'colors' &&\n value.group !== 'fonts'\n ) {\n const match = nearestNumber(rules[value.group], value.value)\n if (match && Math.abs(match.value - value.value) <= NUMBER_TOLERANCE) return null\n nearest = match\n }\n return {\n group: value.group,\n severity: group.enforce === 'refuse' && !value.soft ? 'refuse' : 'warn',\n nodeId: node.id,\n nodeName: node.name,\n path: value.path,\n value: value.value,\n nearest\n }\n}\n\n/** The values on a layer that break the memory, as lint lists them. */\nexport function designViolations(rules: DesignRules, node: SceneNode): DesignViolation[] {\n const violations: DesignViolation[] = []\n for (const value of designValues(node)) {\n const violation = judge(rules, node, value)\n if (violation) violations.push(violation)\n }\n return violations\n}\n\nconst keyOf = (value: DesignValue | SystemValue) => designValueKey(value.group, value.value)\n\n/**\n * The values an edit brought to a layer: on a layer it created, all of them; on one it changed,\n * those in the fields it changed that the same field did not hold before, as a value that is\n * judged in full, so moving or renaming an old layer judges nothing. A layer inside an instance shows its component's values, so only\n * the fields it overrides are its own.\n */\nfunction editedValues(\n graph: SceneGraph,\n node: SceneNode,\n change: DesignEdit['updated'][number] | null\n): DesignValue[] {\n const inInstance = findInstanceAncestor(graph, node.id) !== undefined\n const own = (value: DesignValue) =>\n !inInstance || hasInstanceOverride(graph, node.id, String(value.field))\n let values = designValues(node).filter(own)\n if (change) {\n const changed = new Set(Object.keys(change.after))\n values = values.filter((value) => changed.has(String(value.field)))\n // Held before means in the same field and as solid a value: a shadow or gradient stop that\n // only warned never vouches for a fill or stroke of the same color.\n const heldKey = (value: DesignValue) => `${String(value.field)}|${copiedValueKey(value)}`\n const previous = new Set(designValues({ ...node, ...change.before }).map(heldKey))\n values = values.filter((value) => !previous.has(heldKey(value)))\n }\n return values\n}\n\n/**\n * The values a variable an edit created or changed now gives the system, under its type and\n * scopes as they are now, so a rescoped variable is judged on what it newly admits.\n */\nfunction editedVariableValues(\n graph: SceneGraph,\n change: NonNullable<DesignEdit['variables']>[number]\n): { variable: Variable; values: SystemValue[] } | null {\n const variable = graph.variables.get(change.id)\n if (!variable) return null\n const values = variableValues(graph, variable)\n return values.length > 0 ? { variable, values } : null\n}\n\n/** The values a style layer an edit created or changed now gives the system. */\nfunction editedStyleValues(node: SceneNode): SystemValue[] {\n return isStyleNode(node) ? styleValues(node) : []\n}\n\nfunction systemValue(value: SystemValue, path: string): DesignValue {\n return { ...value, field: 'name', path, fromSystem: false, soft: false }\n}\n\n/** The values one layer, style or variable got from an edit, and whether a layer holds them. */\ninterface BroughtValues {\n owner: Pick<SceneNode, 'id' | 'name'>\n values: DesignValue[]\n layer: boolean\n}\n\n/** Every value an edit brought in: on layers, in the styles they define, and in variables. */\nfunction broughtValues(graph: SceneGraph, edit: DesignEdit): BroughtValues[] {\n const brought: BroughtValues[] = []\n const visit = (id: string, change: DesignEdit['updated'][number] | null) => {\n const node = graph.getNode(id)\n if (!node) return\n const values = editedValues(graph, node, change)\n if (values.length > 0) brought.push({ owner: node, values, layer: true })\n const styles = editedStyleValues(node).map((value) => systemValue(value, 'style'))\n if (styles.length > 0) brought.push({ owner: node, values: styles, layer: false })\n }\n for (const node of edit.created) visit(node.id, null)\n for (const change of edit.updated) visit(change.id, change)\n for (const change of edit.variables ?? []) {\n const edited = editedVariableValues(graph, change)\n if (!edited) continue\n brought.push({\n owner: { id: edited.variable.id, name: edited.variable.name },\n values: edited.values.map((value) => systemValue(value, 'variable')),\n layer: false\n })\n }\n return brought\n}\n\n/**\n * A copied value's key with the field it sits in, so a fill never vouches for a stroke.\n */\nfunction provenanceKey(value: DesignValue): string {\n return `${String(value.field)}|${copiedValueKey(value)}`\n}\n\n/**\n * The values on the layers a copying call names, as they were before it: their subtrees, read\n * as they were where the call changed them, and the layers it deleted, such as a boolean's\n * operands. Only the named layers are read, never the rest of the document. A merging call may\n * take one operand's paint, so it vouches only for a value every named layer had in that field.\n */\nfunction copiedValues(\n graph: SceneGraph,\n edit: DesignEdit,\n sourceIds: readonly string[],\n merged: boolean\n): Set<string> {\n const created = new Set(edit.created.map((node) => node.id))\n const before = new Map(edit.updated.map((change) => [change.id, change.before]))\n const deleted = new Map((edit.deleted ?? []).map((node) => [node.id, node]))\n const snapshot = (id: string): SceneNode | undefined => {\n if (created.has(id)) return undefined\n const removed = deleted.get(id)\n if (removed) return removed\n const node = graph.getNode(id)\n if (!node) return undefined\n const previous = before.get(id)\n return previous ? { ...node, ...previous } : node\n }\n const subtreeKeys = (id: string): Set<string> => {\n const keys = new Set<string>()\n const pending = [id]\n for (let current = pending.pop(); current !== undefined; current = pending.pop()) {\n const node = snapshot(current)\n if (!node) continue\n for (const value of designValues(node)) keys.add(provenanceKey(value))\n pending.push(...node.childIds)\n }\n return keys\n }\n const sources = sourceIds.map(subtreeKeys)\n if (!merged) {\n const keys = new Set<string>()\n for (const node of edit.deleted ?? []) {\n for (const value of designValues(node)) keys.add(provenanceKey(value))\n }\n for (const keysOfSource of sources) for (const key of keysOfSource) keys.add(key)\n return keys\n }\n if (sources.length === 0) return new Set()\n const [first, ...rest] = sources\n let keys = first\n for (const other of rest) keys = new Set([...keys].filter((key) => other.has(key)))\n return keys\n}\n\n/**\n * A value written on a layer, as it is judged: none when a copied layer already had it in the\n * same field, and only a warning for Pairdraw's own default for a new layer, which the agent did\n * not choose.\n */\nfunction layerValue(value: DesignValue, copied: Set<string> | null): DesignValue | null {\n if (copied?.has(provenanceKey(value))) return null\n return PAIRDRAW_DEFAULT_KEYS.has(keyOf(value)) ? { ...value, soft: true } : value\n}\n\n/** A variable's or style's value, judged only where the group takes the system's values. */\nfunction systemValueIn(rules: DesignRules, value: DesignValue): DesignValue | null {\n return rules[value.group].fromSystem ? value : null\n}\n\n/**\n * Judges what an edit did against the document's design memory; null when the document has\n * none. Only values the edit brought in are judged, against the rules as they were before it:\n * - a value written onto a layer is judged against what the memory allows, wherever else the\n * document uses it, unless the call copied or converted layers that already had it\n * (`copiedFrom`);\n * - Pairdraw's own defaults for a new layer warn at most: the agent did not choose them;\n * - variables and shared styles are judged on every value they now give the system, under their\n * scopes as they are now, so creating, changing or rescoping one cannot widen the rules;\n * binding layers to the existing system stays free.\n * People's edits are never judged here, only agents' and automation's.\n */\nexport function checkDesignEdit(\n graph: SceneGraph,\n edit: DesignEdit,\n options: DesignCheckOptions = {}\n): DesignFindings | null {\n const memory = options.rules?.memory ?? cachedDesignMemory(graph)\n if (!memory) return null\n const findings: DesignFindings = { refused: [], warnings: [], rules: null }\n const pending = broughtValues(graph, edit)\n // Resolving the rules costs more than the check, so only an edit that brought values pays.\n if (pending.length === 0) return findings\n const rules = options.rules ?? currentDesignRules(graph, memory)\n findings.rules = rules\n const copied = options.copiedFrom?.length\n ? copiedValues(graph, edit, options.copiedFrom, options.merged === true)\n : null\n for (const { owner, values, layer } of pending) {\n for (const value of values) {\n const judged = layer ? layerValue(value, copied) : systemValueIn(rules, value)\n if (!judged) continue\n const violation = judge(rules, owner, judged)\n if (!violation) continue\n if (violation.severity === 'refuse' && !options.warnOnly) findings.refused.push(violation)\n else findings.warnings.push({ ...violation, severity: 'warn' })\n }\n }\n return findings\n}\n\n/** A value proposed for a design, judged before it is used. */\nexport interface DesignValueVerdict {\n group: DesignMemoryGroup\n value: string | number\n /** `invalid` for a value the group cannot read, such as a color that is not CSS. */\n verdict: 'ok' | 'warn' | 'refuse' | 'invalid'\n nearest: AllowedValue<string | number> | null\n}\n\n/** Judges values an agent means to use, so it can pick allowed ones before it edits. */\nexport function checkDesignValues(\n rules: DesignRules,\n proposal: Partial<Record<DesignMemoryGroup, readonly (string | number)[]>>\n): DesignValueVerdict[] {\n const probe = { id: '', name: '' }\n return DESIGN_MEMORY_GROUPS.flatMap((group) =>\n (proposal[group] ?? []).map((input): DesignValueVerdict => {\n const value = normalizeDesignValue(group, input)\n if (value === null) return { group, value: input, verdict: 'invalid', nearest: null }\n const violation = judge(rules, probe, {\n group,\n field: 'name',\n path: group,\n value,\n fromSystem: false,\n soft: false\n })\n return {\n group,\n value,\n verdict: violation?.severity ?? 'ok',\n nearest: violation?.nearest ?? null\n }\n })\n )\n}\n"],"mappings":";;;;;;;;;;AAoFA,MAAM,wCAA6C,IAAI,IAAI,CACzD,eAAe,SAAS,mBAAmB,GAC3C,GAAI;CAAC;CAAS;CAAa;CAAW;CAAa;CAAQ;AAAM,CAAC,CAAW,SAAS,SACnF,CAAC,SAAS,MAAM,CAAC,CAAW,SAAS,UAAU;CAC9C,MAAM,EAAE,QAAQ,CAAC,GAAG,UAAU,CAAC,MAAM,iBAAiB,MAAM,KAAK;CACjE,OAAO,CAAC,GAAG,OAAO,GAAG,OAAO,CAAC,CAAC,KAAK,UACjC,eAAe,UAAU,WAAW,MAAM,KAAK,CAAC,CAClD;AACF,CAAC,CACH,CACF,CAAC;;AAGD,SAAS,MACP,OACA,MACA,OACwB;CACxB,MAAM,QAAQ,MAAM,MAAM;CAC1B,IAAI,MAA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N;GACA,YAAY;GACZ,MAAM;EACR,CAAC;EACD,OAAO;GACL;GACA;GACA,SAAS,WAAW,YAAY;GAChC,SAAS,WAAW,WAAW;EACjC;CACF,CAAC,CACH;AACF"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { SceneGraph } from "@pairdraw/scene-graph";
|
|
2
|
+
import { DesignDecisionAuthor, DesignMemoryEnforcement, DesignMemoryGroup } from "@pairdraw/scene-graph/design-memory";
|
|
3
|
+
//#region src/design-memory/describe.d.ts
|
|
4
|
+
interface DesignGroupReport {
|
|
5
|
+
enforce: DesignMemoryEnforcement;
|
|
6
|
+
/** Whether the document's variables and styles count. */
|
|
7
|
+
fromSystem: boolean;
|
|
8
|
+
allowed: {
|
|
9
|
+
value: string | number;
|
|
10
|
+
name: string | null;
|
|
11
|
+
}[];
|
|
12
|
+
/** Allowed values past the listed ones. */
|
|
13
|
+
more: number;
|
|
14
|
+
}
|
|
15
|
+
interface DesignExampleReport {
|
|
16
|
+
id: string;
|
|
17
|
+
/** Null for a layer the document no longer has. */
|
|
18
|
+
name: string | null;
|
|
19
|
+
page: string | null;
|
|
20
|
+
width: number | null;
|
|
21
|
+
height: number | null;
|
|
22
|
+
}
|
|
23
|
+
/** A document's design memory as agents, the CLI and the chat read it. */
|
|
24
|
+
interface DesignMemoryReport {
|
|
25
|
+
groups: Record<DesignMemoryGroup, DesignGroupReport>;
|
|
26
|
+
decisions: {
|
|
27
|
+
id: string;
|
|
28
|
+
text: string;
|
|
29
|
+
author: DesignDecisionAuthor;
|
|
30
|
+
}[];
|
|
31
|
+
examples: DesignExampleReport[];
|
|
32
|
+
}
|
|
33
|
+
/** The document's memory with its allowed values resolved; null when it has none. */
|
|
34
|
+
declare function describeDesignMemory(graph: SceneGraph, limit?: number): DesignMemoryReport | null;
|
|
35
|
+
//#endregion
|
|
36
|
+
export { DesignExampleReport, DesignGroupReport, DesignMemoryReport, describeDesignMemory };
|
|
37
|
+
//# sourceMappingURL=describe.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"describe.d.ts","names":[],"sources":["../../src/design-memory/describe.ts"],"mappings":";;;UAaiB;EACf,SAAS;;EAET;EACA;IAAW;IAAwB;;;EAEnC;;UAGe;EACf;;EAEA;EACA;EACA;EACA;;;UAIe;EACf,QAAQ,OAAO,mBAAmB;EAClC;IAAa;IAAY;IAAc,QAAQ;;EAC/C,UAAU;;;iBAII,qBACd,OAAO,YACP,iBACC"}
|