@imgly/codesign-mcp 0.7.2 → 0.7.3-next.20261125135902.gfdc6ee3
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/README.md +35 -17
- package/dist/cli/license.js +1 -1
- package/dist/runtime/cli/commands.d.ts +2 -0
- package/dist/runtime/cli/commands.d.ts.map +1 -1
- package/dist/runtime/cli/commands.js +56 -1
- package/dist/runtime/cli/commands.js.map +1 -1
- package/dist/runtime/cli/main.d.ts.map +1 -1
- package/dist/runtime/cli/main.js +5 -0
- package/dist/runtime/cli/main.js.map +1 -1
- package/dist/runtime/codesign-shim/codesign-router/protocol/types.mjs +1 -0
- package/dist/runtime/codesign-shim/codesign-router/release-build.generated.mjs +1 -1
- package/dist/server-client-types/protocol/types.d.ts +25 -3
- package/dist/server-client.mjs +1 -0
- package/dist/server.d.ts +2 -0
- package/dist/server.d.ts.map +1 -1
- package/dist/server.js +4 -2
- package/dist/server.js.map +1 -1
- package/node_modules/@imgly/codesign-billing/README.md +138 -0
- package/node_modules/@imgly/{codesign-sdk/dist/executor/billing → codesign-billing/dist}/charge.d.ts +30 -5
- package/node_modules/@imgly/codesign-billing/dist/charge.d.ts.map +1 -0
- package/node_modules/@imgly/{codesign-sdk/dist/executor/billing → codesign-billing/dist}/charge.js +16 -1
- package/node_modules/@imgly/codesign-billing/dist/charge.js.map +1 -0
- package/node_modules/@imgly/codesign-billing/dist/charges.d.ts +71 -0
- package/node_modules/@imgly/codesign-billing/dist/charges.d.ts.map +1 -0
- package/node_modules/@imgly/codesign-billing/dist/charges.js +198 -0
- package/node_modules/@imgly/codesign-billing/dist/charges.js.map +1 -0
- package/node_modules/@imgly/codesign-billing/dist/index.d.ts +6 -0
- package/node_modules/@imgly/codesign-billing/dist/index.d.ts.map +1 -0
- package/node_modules/@imgly/codesign-billing/dist/index.js +6 -0
- package/node_modules/@imgly/codesign-billing/dist/index.js.map +1 -0
- package/node_modules/@imgly/codesign-billing/dist/ledger.d.ts +55 -0
- package/node_modules/@imgly/codesign-billing/dist/ledger.d.ts.map +1 -0
- package/node_modules/@imgly/codesign-billing/dist/ledger.js +80 -0
- package/node_modules/@imgly/codesign-billing/dist/ledger.js.map +1 -0
- package/node_modules/@imgly/{codesign-sdk/dist/executor/billing → codesign-billing/dist}/metering.d.ts +9 -1
- package/node_modules/@imgly/codesign-billing/dist/metering.d.ts.map +1 -0
- package/node_modules/@imgly/{codesign-sdk/dist/executor/billing → codesign-billing/dist}/metering.js +77 -21
- package/node_modules/@imgly/codesign-billing/dist/metering.js.map +1 -0
- package/node_modules/@imgly/codesign-billing/dist/refusal.d.ts +20 -0
- package/node_modules/@imgly/codesign-billing/dist/refusal.d.ts.map +1 -0
- package/node_modules/@imgly/codesign-billing/dist/refusal.js +13 -0
- package/node_modules/@imgly/codesign-billing/dist/refusal.js.map +1 -0
- package/node_modules/@imgly/codesign-billing/package.json +30 -0
- package/node_modules/@imgly/codesign-router/dist/config/unit-config.d.ts +13 -5
- package/node_modules/@imgly/codesign-router/dist/config/unit-config.d.ts.map +1 -1
- package/node_modules/@imgly/codesign-router/dist/config/unit-config.js +18 -12
- package/node_modules/@imgly/codesign-router/dist/config/unit-config.js.map +1 -1
- package/node_modules/@imgly/codesign-router/dist/consent.d.ts +6 -2
- package/node_modules/@imgly/codesign-router/dist/consent.d.ts.map +1 -1
- package/node_modules/@imgly/codesign-router/dist/consent.js +65 -9
- package/node_modules/@imgly/codesign-router/dist/consent.js.map +1 -1
- package/node_modules/@imgly/codesign-router/dist/protocol/types.d.ts +25 -3
- package/node_modules/@imgly/codesign-router/dist/protocol/types.d.ts.map +1 -1
- package/node_modules/@imgly/codesign-router/dist/protocol/types.js +1 -0
- package/node_modules/@imgly/codesign-router/dist/protocol/types.js.map +1 -1
- package/node_modules/@imgly/codesign-router/dist/release-build.generated.d.ts +1 -1
- package/node_modules/@imgly/codesign-router/dist/release-build.generated.d.ts.map +1 -1
- package/node_modules/@imgly/codesign-router/dist/release-build.generated.js +1 -1
- package/node_modules/@imgly/codesign-router/dist/release-build.generated.js.map +1 -1
- package/node_modules/@imgly/codesign-router/dist/router/channels-v2.d.ts.map +1 -1
- package/node_modules/@imgly/codesign-router/dist/router/channels-v2.js +14 -4
- package/node_modules/@imgly/codesign-router/dist/router/channels-v2.js.map +1 -1
- package/node_modules/@imgly/codesign-router/dist/router/main.d.ts.map +1 -1
- package/node_modules/@imgly/codesign-router/dist/router/main.js +9 -1
- package/node_modules/@imgly/codesign-router/dist/router/main.js.map +1 -1
- package/node_modules/@imgly/codesign-sdk/CHANGELOG.md +24 -0
- package/node_modules/@imgly/codesign-sdk/README.md +8 -7
- package/node_modules/@imgly/codesign-sdk/dist/abort.d.ts +1 -0
- package/node_modules/@imgly/codesign-sdk/dist/abort.js +18 -0
- package/node_modules/@imgly/codesign-sdk/dist/assets/inline.generated.js +12 -12
- package/node_modules/@imgly/codesign-sdk/dist/browser/index.d.ts +1 -1
- package/node_modules/@imgly/codesign-sdk/dist/browser/worker.d.ts +1 -1
- package/node_modules/@imgly/codesign-sdk/dist/browser/worker.js +15 -8
- package/node_modules/@imgly/codesign-sdk/dist/cesdk-utils/index.js +2 -0
- package/node_modules/@imgly/codesign-sdk/dist/codesign-error.d.ts +38 -1
- package/node_modules/@imgly/codesign-sdk/dist/codesign-error.js +9 -0
- package/node_modules/@imgly/codesign-sdk/dist/codesign.d.ts +19 -12
- package/node_modules/@imgly/codesign-sdk/dist/codesign.js +268 -43
- package/node_modules/@imgly/codesign-sdk/dist/design/animatable.generated.js +3 -0
- package/node_modules/@imgly/codesign-sdk/dist/design/capabilities.generated.js +1 -0
- package/node_modules/@imgly/codesign-sdk/dist/design/facade.d.ts +1 -1
- package/node_modules/@imgly/codesign-sdk/dist/design/facade.js +128 -36
- package/node_modules/@imgly/codesign-sdk/dist/design/keyframes.js +2 -1
- package/node_modules/@imgly/codesign-sdk/dist/design/lint.d.ts +1 -1
- package/node_modules/@imgly/codesign-sdk/dist/design/lint.js +82 -5
- package/node_modules/@imgly/codesign-sdk/dist/design/props.generated.js +3 -0
- package/node_modules/@imgly/codesign-sdk/dist/design/run-offsets.d.ts +10 -0
- package/node_modules/@imgly/codesign-sdk/dist/design/run-offsets.js +26 -0
- package/node_modules/@imgly/codesign-sdk/dist/design/scene-lint.d.ts +23 -1
- package/node_modules/@imgly/codesign-sdk/dist/design/scene-lint.js +194 -3
- package/node_modules/@imgly/codesign-sdk/dist/design/timeline-poses.d.ts +8 -0
- package/node_modules/@imgly/codesign-sdk/dist/design/timeline-poses.js +53 -0
- package/node_modules/@imgly/codesign-sdk/dist/design/variables.d.ts +14 -0
- package/node_modules/@imgly/codesign-sdk/dist/design/variables.js +250 -37
- package/node_modules/@imgly/codesign-sdk/dist/designs/s3-presigner.d.ts +50 -0
- package/node_modules/@imgly/codesign-sdk/dist/designs/s3-presigner.js +116 -0
- package/node_modules/@imgly/codesign-sdk/dist/designs/types.d.ts +79 -3
- package/node_modules/@imgly/codesign-sdk/dist/engine/audio-extract.d.ts +12 -1
- package/node_modules/@imgly/codesign-sdk/dist/engine/audio-extract.js +20 -4
- package/node_modules/@imgly/codesign-sdk/dist/engine/engine-capacity.d.ts +20 -7
- package/node_modules/@imgly/codesign-sdk/dist/engine/engine-capacity.js +31 -14
- package/node_modules/@imgly/codesign-sdk/dist/engine/headless.d.ts +4 -0
- package/node_modules/@imgly/codesign-sdk/dist/engine/headless.js +20 -0
- package/node_modules/@imgly/codesign-sdk/dist/executor/billing/check.d.ts +1 -14
- package/node_modules/@imgly/codesign-sdk/dist/executor/billing/check.js +2 -7
- package/node_modules/@imgly/codesign-sdk/dist/executor/billing/metered.d.ts +1 -2
- package/node_modules/@imgly/codesign-sdk/dist/executor/billing/metered.js +120 -91
- package/node_modules/@imgly/codesign-sdk/dist/executor/encode-watchdog.d.ts +2 -2
- package/node_modules/@imgly/codesign-sdk/dist/executor/encode-watchdog.js +10 -4
- package/node_modules/@imgly/codesign-sdk/dist/executor/engine-protocol.d.ts +1 -1
- package/node_modules/@imgly/codesign-sdk/dist/executor/engine-protocol.js +13 -3
- package/node_modules/@imgly/codesign-sdk/dist/executor/executor-options.d.ts +6 -7
- package/node_modules/@imgly/codesign-sdk/dist/executor/executor-options.js +14 -7
- package/node_modules/@imgly/codesign-sdk/dist/executor/handler.d.ts +47 -2
- package/node_modules/@imgly/codesign-sdk/dist/executor/handler.js +519 -8
- package/node_modules/@imgly/codesign-sdk/dist/executor/node.d.ts +42 -6
- package/node_modules/@imgly/codesign-sdk/dist/executor/node.js +231 -9
- package/node_modules/@imgly/codesign-sdk/dist/exporters/fig.d.ts +13 -0
- package/node_modules/@imgly/codesign-sdk/dist/exporters/fig.js +28 -0
- package/node_modules/@imgly/codesign-sdk/dist/exporters/html.d.ts +18 -2
- package/node_modules/@imgly/codesign-sdk/dist/exporters/html.js +129 -15
- package/node_modules/@imgly/codesign-sdk/dist/exporters/index.d.ts +5 -2
- package/node_modules/@imgly/codesign-sdk/dist/exporters/index.js +2 -2
- package/node_modules/@imgly/codesign-sdk/dist/exporters/node.d.ts +1 -1
- package/node_modules/@imgly/codesign-sdk/dist/exporters/node.js +4 -3
- package/node_modules/@imgly/codesign-sdk/dist/exporters/psd.js +1 -1
- package/node_modules/@imgly/codesign-sdk/dist/formats/av-limit.d.ts +2 -0
- package/node_modules/@imgly/codesign-sdk/dist/formats/av-limit.js +1 -1
- package/node_modules/@imgly/codesign-sdk/dist/formats/design-sniff.d.ts +3 -1
- package/node_modules/@imgly/codesign-sdk/dist/formats/design-sniff.js +7 -0
- package/node_modules/@imgly/codesign-sdk/dist/formats/import-registry.d.ts +1 -1
- package/node_modules/@imgly/codesign-sdk/dist/formats/import-registry.js +4 -2
- package/node_modules/@imgly/codesign-sdk/dist/formats/import-warnings.d.ts +5 -0
- package/node_modules/@imgly/codesign-sdk/dist/formats/import-warnings.js +31 -0
- package/node_modules/@imgly/codesign-sdk/dist/formats/media-facts.d.ts +15 -0
- package/node_modules/@imgly/codesign-sdk/dist/formats/media-facts.js +26 -0
- package/node_modules/@imgly/codesign-sdk/dist/formats/mime.d.ts +6 -0
- package/node_modules/@imgly/codesign-sdk/dist/formats/mime.js +37 -0
- package/node_modules/@imgly/codesign-sdk/dist/formats/refuse-media.d.ts +7 -0
- package/node_modules/@imgly/codesign-sdk/dist/formats/refuse-media.js +46 -0
- package/node_modules/@imgly/codesign-sdk/dist/formats/svg-export.d.ts +6 -0
- package/node_modules/@imgly/codesign-sdk/dist/formats/svg-export.js +20 -0
- package/node_modules/@imgly/codesign-sdk/dist/formats/svg-import.d.ts +3 -0
- package/node_modules/@imgly/codesign-sdk/dist/formats/svg-import.js +25 -0
- package/node_modules/@imgly/codesign-sdk/dist/formats/zip-entries.d.ts +2 -0
- package/node_modules/@imgly/codesign-sdk/dist/formats/zip-entries.js +1 -0
- package/node_modules/@imgly/codesign-sdk/dist/gateway/asset-generate.d.ts +10 -4
- package/node_modules/@imgly/codesign-sdk/dist/gateway/asset-generate.js +205 -79
- package/node_modules/@imgly/codesign-sdk/dist/gateway/client.d.ts +23 -2
- package/node_modules/@imgly/codesign-sdk/dist/gateway/client.js +40 -41
- package/node_modules/@imgly/codesign-sdk/dist/gateway/index.d.ts +3 -0
- package/node_modules/@imgly/codesign-sdk/dist/gateway/index.js +4 -0
- package/node_modules/@imgly/codesign-sdk/dist/gateway/types.d.ts +18 -3
- package/node_modules/@imgly/codesign-sdk/dist/gateway/upload-origin.d.ts +3 -0
- package/node_modules/@imgly/codesign-sdk/dist/gateway/upload-origin.js +5 -0
- package/node_modules/@imgly/codesign-sdk/dist/host/edit-code.d.ts +2 -0
- package/node_modules/@imgly/codesign-sdk/dist/host/edit-code.js +8 -1
- package/node_modules/@imgly/codesign-sdk/dist/host/preview-size.d.ts +4 -2
- package/node_modules/@imgly/codesign-sdk/dist/host/preview-size.js +7 -4
- package/node_modules/@imgly/codesign-sdk/dist/host.d.ts +34 -5
- package/node_modules/@imgly/codesign-sdk/dist/host.js +6 -0
- package/node_modules/@imgly/codesign-sdk/dist/importers/fig.d.ts +4 -0
- package/node_modules/@imgly/codesign-sdk/dist/importers/fig.js +57 -0
- package/node_modules/@imgly/codesign-sdk/dist/importers/index.d.ts +2 -2
- package/node_modules/@imgly/codesign-sdk/dist/importers/index.js +38 -25
- package/node_modules/@imgly/codesign-sdk/dist/importers/node.d.ts +5 -0
- package/node_modules/@imgly/codesign-sdk/dist/importers/node.js +8 -0
- package/node_modules/@imgly/codesign-sdk/dist/importers/pdf-fonts.d.ts +20 -0
- package/node_modules/@imgly/codesign-sdk/dist/importers/pdf-fonts.js +76 -0
- package/node_modules/@imgly/codesign-sdk/dist/importers/shared.d.ts +14 -0
- package/node_modules/@imgly/codesign-sdk/dist/importers/shared.js +18 -0
- package/node_modules/@imgly/codesign-sdk/dist/index.d.ts +5 -4
- package/node_modules/@imgly/codesign-sdk/dist/index.js +2 -1
- package/node_modules/@imgly/codesign-sdk/dist/internal/index.d.ts +24 -17
- package/node_modules/@imgly/codesign-sdk/dist/internal/index.js +19 -10
- package/node_modules/@imgly/codesign-sdk/dist/node/edit-renders.d.ts +5 -0
- package/node_modules/@imgly/codesign-sdk/dist/node/edit-renders.js +73 -0
- package/node_modules/@imgly/codesign-sdk/dist/node/engine-child.js +18 -2
- package/node_modules/@imgly/codesign-sdk/dist/node/engine-http.js +8 -2
- package/node_modules/@imgly/codesign-sdk/dist/node/index.d.ts +1 -0
- package/node_modules/@imgly/codesign-sdk/dist/node/index.js +1 -0
- package/node_modules/@imgly/codesign-sdk/dist/node/media-probe.js +1 -1
- package/node_modules/@imgly/codesign-sdk/dist/sdk-version.generated.js +2 -2
- package/node_modules/@imgly/codesign-sdk/dist/session/engine-session.d.ts +59 -13
- package/node_modules/@imgly/codesign-sdk/dist/session/engine-session.js +19 -0
- package/node_modules/@imgly/codesign-sdk/dist/session/export-facts.d.ts +1 -14
- package/node_modules/@imgly/codesign-sdk/dist/session/export-facts.js +15 -4
- package/node_modules/@imgly/codesign-sdk/dist/session/file-formats.d.ts +5 -0
- package/node_modules/@imgly/codesign-sdk/dist/session/guarded-engine-session.d.ts +2 -0
- package/node_modules/@imgly/codesign-sdk/dist/session/guarded-engine-session.js +18 -7
- package/node_modules/@imgly/codesign-sdk/dist/session/local-engine-session.js +247 -68
- package/node_modules/@imgly/codesign-sdk/dist/session/local-engine.js +2 -2
- package/node_modules/@imgly/codesign-sdk/dist/session/multipart.js +10 -2
- package/node_modules/@imgly/codesign-sdk/dist/session/pending-video.js +2 -3
- package/node_modules/@imgly/codesign-sdk/dist/session/read-resolved.js +93 -6
- package/node_modules/@imgly/codesign-sdk/dist/session/remote.d.ts +34 -10
- package/node_modules/@imgly/codesign-sdk/dist/session/remote.js +377 -87
- package/node_modules/@imgly/codesign-sdk/dist/session/render-id.js +11 -2
- package/node_modules/@imgly/codesign-sdk/dist/session/session.d.ts +67 -6
- package/node_modules/@imgly/codesign-sdk/dist/session/session.js +213 -32
- package/node_modules/@imgly/codesign-sdk/dist/session/silent-audio.d.ts +18 -0
- package/node_modules/@imgly/codesign-sdk/dist/session/silent-audio.js +47 -0
- package/node_modules/@imgly/codesign-sdk/dist/session/transfers.d.ts +85 -0
- package/node_modules/@imgly/codesign-sdk/dist/session/transfers.js +80 -0
- package/node_modules/@imgly/codesign-sdk/dist/session/url-guard.d.ts +30 -0
- package/node_modules/@imgly/codesign-sdk/dist/session/url-guard.js +187 -0
- package/node_modules/@imgly/codesign-sdk/dist/session/url-source.d.ts +21 -0
- package/node_modules/@imgly/codesign-sdk/dist/session/url-source.js +163 -0
- package/node_modules/@imgly/codesign-sdk/dist/session/wire.d.ts +8 -1
- package/node_modules/@imgly/codesign-sdk/dist/session/wire.js +2 -1
- package/node_modules/@imgly/codesign-sdk/dist/session-instructions.js +2 -2
- package/node_modules/@imgly/codesign-sdk/dist/sessions/state.d.ts +3 -1
- package/node_modules/@imgly/codesign-sdk/dist/sessions/state.js +5 -1
- package/node_modules/@imgly/codesign-sdk/dist/signed-urls.d.ts +3 -0
- package/node_modules/@imgly/codesign-sdk/dist/signed-urls.js +30 -0
- package/node_modules/@imgly/codesign-sdk/dist/skill-tool.js +12 -12
- package/node_modules/@imgly/codesign-sdk/dist/sources/handshake.d.ts +2 -0
- package/node_modules/@imgly/codesign-sdk/dist/sources/mime.js +0 -1
- package/node_modules/@imgly/codesign-sdk/dist/sources/route.d.ts +8 -1
- package/node_modules/@imgly/codesign-sdk/dist/sources/route.js +17 -2
- package/node_modules/@imgly/codesign-sdk/dist/sources/search.js +9 -2
- package/node_modules/@imgly/codesign-sdk/dist/sources/types.d.ts +8 -1
- package/node_modules/@imgly/codesign-sdk/dist/testing/conformance.js +11 -6
- package/node_modules/@imgly/codesign-sdk/dist/testing/fake-engine.d.ts +1 -1
- package/node_modules/@imgly/codesign-sdk/dist/testing/fake-engine.js +11 -4
- package/node_modules/@imgly/codesign-sdk/dist/tools/edit.js +11 -4
- package/node_modules/@imgly/codesign-sdk/dist/tools/errors.js +2 -2
- package/node_modules/@imgly/codesign-sdk/dist/tools/export-formats/table.d.ts +4 -4
- package/node_modules/@imgly/codesign-sdk/dist/tools/export-formats/table.js +8 -0
- package/node_modules/@imgly/codesign-sdk/dist/tools/export.d.ts +3 -1
- package/node_modules/@imgly/codesign-sdk/dist/tools/export.js +75 -12
- package/node_modules/@imgly/codesign-sdk/dist/tools/omit-defaults.d.ts +3 -0
- package/node_modules/@imgly/codesign-sdk/dist/tools/omit-defaults.js +7 -0
- package/node_modules/@imgly/codesign-sdk/dist/tools/preview.js +42 -19
- package/node_modules/@imgly/codesign-sdk/dist/tools/source-tools.js +11 -4
- package/node_modules/@imgly/codesign-sdk/package.json +18 -10
- package/node_modules/@imgly/codesign-server/assets/ai-plugins/apps.mjs +5 -5
- package/node_modules/@imgly/codesign-server/assets/ai-plugins/image-gateway.mjs +5 -5
- package/node_modules/@imgly/codesign-server/assets/ai-plugins/version.json +1 -1
- package/node_modules/@imgly/codesign-server/dist/catalog/link.d.ts.map +1 -1
- package/node_modules/@imgly/codesign-server/dist/catalog/link.js +2 -1
- package/node_modules/@imgly/codesign-server/dist/catalog/link.js.map +1 -1
- package/node_modules/@imgly/codesign-server/dist/catalog/local-server.d.ts.map +1 -1
- package/node_modules/@imgly/codesign-server/dist/catalog/local-server.js +1 -0
- package/node_modules/@imgly/codesign-server/dist/catalog/local-server.js.map +1 -1
- package/node_modules/@imgly/codesign-server/dist/catalog/tools/asset-add.d.ts +59 -1
- package/node_modules/@imgly/codesign-server/dist/catalog/tools/asset-add.d.ts.map +1 -1
- package/node_modules/@imgly/codesign-server/dist/catalog/tools/asset-add.js +127 -23
- package/node_modules/@imgly/codesign-server/dist/catalog/tools/asset-add.js.map +1 -1
- package/node_modules/@imgly/codesign-server/dist/catalog/tools/asset-search.d.ts +7 -0
- package/node_modules/@imgly/codesign-server/dist/catalog/tools/asset-search.d.ts.map +1 -1
- package/node_modules/@imgly/codesign-server/dist/catalog/tools/asset-search.js +65 -15
- package/node_modules/@imgly/codesign-server/dist/catalog/tools/asset-search.js.map +1 -1
- package/node_modules/@imgly/codesign-server/dist/catalog/tools/checklist.d.ts +2 -0
- package/node_modules/@imgly/codesign-server/dist/catalog/tools/checklist.d.ts.map +1 -1
- package/node_modules/@imgly/codesign-server/dist/catalog/tools/checklist.js +15 -5
- package/node_modules/@imgly/codesign-server/dist/catalog/tools/checklist.js.map +1 -1
- package/node_modules/@imgly/codesign-server/dist/catalog/tools/export-description.d.ts +1 -1
- package/node_modules/@imgly/codesign-server/dist/catalog/tools/export-description.d.ts.map +1 -1
- package/node_modules/@imgly/codesign-server/dist/catalog/tools/export-description.js +7 -6
- package/node_modules/@imgly/codesign-server/dist/catalog/tools/export-description.js.map +1 -1
- package/node_modules/@imgly/codesign-server/dist/catalog/tools/export-formats/modules.d.ts +2 -2
- package/node_modules/@imgly/codesign-server/dist/catalog/tools/export-formats/modules.d.ts.map +1 -1
- package/node_modules/@imgly/codesign-server/dist/catalog/tools/export-formats/modules.js +14 -4
- package/node_modules/@imgly/codesign-server/dist/catalog/tools/export-formats/modules.js.map +1 -1
- package/node_modules/@imgly/codesign-server/dist/catalog/tools/import.d.ts +10 -0
- package/node_modules/@imgly/codesign-server/dist/catalog/tools/import.d.ts.map +1 -1
- package/node_modules/@imgly/codesign-server/dist/catalog/tools/import.js +106 -22
- package/node_modules/@imgly/codesign-server/dist/catalog/tools/import.js.map +1 -1
- package/node_modules/@imgly/codesign-server/dist/cli/connectors.js +1 -1
- package/node_modules/@imgly/codesign-server/dist/cli/connectors.js.map +1 -1
- package/node_modules/@imgly/codesign-server/dist/cli/doctor/checks/mcp-servers.js +1 -1
- package/node_modules/@imgly/codesign-server/dist/cli/doctor/checks/mcp-servers.js.map +1 -1
- package/node_modules/@imgly/codesign-server/dist/cli/pack.d.ts +1 -1
- package/node_modules/@imgly/codesign-server/dist/cli/pack.d.ts.map +1 -1
- package/node_modules/@imgly/codesign-server/dist/cli/pack.js +24 -18
- package/node_modules/@imgly/codesign-server/dist/cli/pack.js.map +1 -1
- package/node_modules/@imgly/codesign-server/dist/conversation/instructions.js +1 -1
- package/node_modules/@imgly/codesign-server/dist/conversation/instructions.js.map +1 -1
- package/node_modules/@imgly/codesign-server/dist/conversation/main.d.ts.map +1 -1
- package/node_modules/@imgly/codesign-server/dist/conversation/main.js +4 -3
- package/node_modules/@imgly/codesign-server/dist/conversation/main.js.map +1 -1
- package/node_modules/@imgly/codesign-server/dist/conversation/stage.d.ts +4 -0
- package/node_modules/@imgly/codesign-server/dist/conversation/stage.d.ts.map +1 -1
- package/node_modules/@imgly/codesign-server/dist/conversation/stage.js +13 -0
- package/node_modules/@imgly/codesign-server/dist/conversation/stage.js.map +1 -1
- package/node_modules/@imgly/codesign-server/dist/credentials/credential-store.d.ts +0 -6
- package/node_modules/@imgly/codesign-server/dist/credentials/credential-store.d.ts.map +1 -1
- package/node_modules/@imgly/codesign-server/dist/credentials/credential-store.js +0 -58
- package/node_modules/@imgly/codesign-server/dist/credentials/credential-store.js.map +1 -1
- package/node_modules/@imgly/codesign-server/dist/credentials/keychain.d.ts +10 -0
- package/node_modules/@imgly/codesign-server/dist/credentials/keychain.d.ts.map +1 -0
- package/node_modules/@imgly/codesign-server/dist/credentials/keychain.js +84 -0
- package/node_modules/@imgly/codesign-server/dist/credentials/keychain.js.map +1 -0
- package/node_modules/@imgly/codesign-server/dist/credentials/token-store.d.ts +1 -3
- package/node_modules/@imgly/codesign-server/dist/credentials/token-store.d.ts.map +1 -1
- package/node_modules/@imgly/codesign-server/dist/credentials/token-store.js +3 -23
- package/node_modules/@imgly/codesign-server/dist/credentials/token-store.js.map +1 -1
- package/node_modules/@imgly/codesign-server/dist/design/design-library-tools.d.ts +59 -8
- package/node_modules/@imgly/codesign-server/dist/design/design-library-tools.d.ts.map +1 -1
- package/node_modules/@imgly/codesign-server/dist/design/design-library-tools.js +317 -40
- package/node_modules/@imgly/codesign-server/dist/design/design-library-tools.js.map +1 -1
- package/node_modules/@imgly/codesign-server/dist/design/engine.js +4 -9
- package/node_modules/@imgly/codesign-server/dist/design/engine.js.map +1 -1
- package/node_modules/@imgly/codesign-server/dist/design/engines.d.ts +5 -0
- package/node_modules/@imgly/codesign-server/dist/design/engines.d.ts.map +1 -1
- package/node_modules/@imgly/codesign-server/dist/design/engines.js +49 -0
- package/node_modules/@imgly/codesign-server/dist/design/engines.js.map +1 -1
- package/node_modules/@imgly/codesign-server/dist/design/host.d.ts +2 -0
- package/node_modules/@imgly/codesign-server/dist/design/host.d.ts.map +1 -1
- package/node_modules/@imgly/codesign-server/dist/design/host.js +10 -6
- package/node_modules/@imgly/codesign-server/dist/design/host.js.map +1 -1
- package/node_modules/@imgly/codesign-server/dist/design/lazy-executors.d.ts.map +1 -1
- package/node_modules/@imgly/codesign-server/dist/design/lazy-executors.js +34 -5
- package/node_modules/@imgly/codesign-server/dist/design/lazy-executors.js.map +1 -1
- package/node_modules/@imgly/codesign-server/dist/design/local-design.d.ts +42 -5
- package/node_modules/@imgly/codesign-server/dist/design/local-design.d.ts.map +1 -1
- package/node_modules/@imgly/codesign-server/dist/design/local-design.js +175 -38
- package/node_modules/@imgly/codesign-server/dist/design/local-design.js.map +1 -1
- package/node_modules/@imgly/codesign-server/dist/design/local-tools.d.ts +27 -1
- package/node_modules/@imgly/codesign-server/dist/design/local-tools.d.ts.map +1 -1
- package/node_modules/@imgly/codesign-server/dist/design/local-tools.js +65 -7
- package/node_modules/@imgly/codesign-server/dist/design/local-tools.js.map +1 -1
- package/node_modules/@imgly/codesign-server/dist/design/main.d.ts.map +1 -1
- package/node_modules/@imgly/codesign-server/dist/design/main.js +23 -10
- package/node_modules/@imgly/codesign-server/dist/design/main.js.map +1 -1
- package/node_modules/@imgly/codesign-server/dist/design/node-exporters.d.ts +4 -0
- package/node_modules/@imgly/codesign-server/dist/design/node-exporters.d.ts.map +1 -0
- package/node_modules/@imgly/codesign-server/dist/design/node-exporters.js +13 -0
- package/node_modules/@imgly/codesign-server/dist/design/node-exporters.js.map +1 -0
- package/node_modules/@imgly/codesign-server/dist/design/probe-media.d.ts +2 -0
- package/node_modules/@imgly/codesign-server/dist/design/probe-media.d.ts.map +1 -0
- package/node_modules/@imgly/codesign-server/dist/design/probe-media.js +16 -0
- package/node_modules/@imgly/codesign-server/dist/design/probe-media.js.map +1 -0
- package/node_modules/@imgly/codesign-server/dist/design/remote-resources.d.ts +22 -3
- package/node_modules/@imgly/codesign-server/dist/design/remote-resources.d.ts.map +1 -1
- package/node_modules/@imgly/codesign-server/dist/design/remote-resources.js +123 -32
- package/node_modules/@imgly/codesign-server/dist/design/remote-resources.js.map +1 -1
- package/node_modules/@imgly/codesign-server/dist/design/save.d.ts +5 -0
- package/node_modules/@imgly/codesign-server/dist/design/save.d.ts.map +1 -1
- package/node_modules/@imgly/codesign-server/dist/design/save.js +9 -0
- package/node_modules/@imgly/codesign-server/dist/design/save.js.map +1 -1
- package/node_modules/@imgly/codesign-server/dist/design/sessions/store.d.ts +33 -4
- package/node_modules/@imgly/codesign-server/dist/design/sessions/store.d.ts.map +1 -1
- package/node_modules/@imgly/codesign-server/dist/design/sessions/store.js +121 -43
- package/node_modules/@imgly/codesign-server/dist/design/sessions/store.js.map +1 -1
- package/node_modules/@imgly/codesign-server/dist/design/workspace-files.d.ts +8 -0
- package/node_modules/@imgly/codesign-server/dist/design/workspace-files.d.ts.map +1 -1
- package/node_modules/@imgly/codesign-server/dist/design/workspace-files.js +50 -61
- package/node_modules/@imgly/codesign-server/dist/design/workspace-files.js.map +1 -1
- package/node_modules/@imgly/codesign-server/dist/design/workspace-library.d.ts +24 -2
- package/node_modules/@imgly/codesign-server/dist/design/workspace-library.d.ts.map +1 -1
- package/node_modules/@imgly/codesign-server/dist/design/workspace-library.js +132 -17
- package/node_modules/@imgly/codesign-server/dist/design/workspace-library.js.map +1 -1
- package/node_modules/@imgly/codesign-server/dist/services/archives/create.d.ts.map +1 -1
- package/node_modules/@imgly/codesign-server/dist/services/archives/create.js +19 -6
- package/node_modules/@imgly/codesign-server/dist/services/archives/create.js.map +1 -1
- package/node_modules/@imgly/codesign-server/dist/services/archives/handlers.d.ts.map +1 -1
- package/node_modules/@imgly/codesign-server/dist/services/archives/handlers.js +10 -7
- package/node_modules/@imgly/codesign-server/dist/services/archives/handlers.js.map +1 -1
- package/node_modules/@imgly/codesign-server/dist/services/archives/pack.d.ts +3 -1
- package/node_modules/@imgly/codesign-server/dist/services/archives/pack.d.ts.map +1 -1
- package/node_modules/@imgly/codesign-server/dist/services/archives/pack.js +5 -4
- package/node_modules/@imgly/codesign-server/dist/services/archives/pack.js.map +1 -1
- package/node_modules/@imgly/codesign-server/dist/services/archives/seed-pack.d.ts +56 -0
- package/node_modules/@imgly/codesign-server/dist/services/archives/seed-pack.d.ts.map +1 -0
- package/node_modules/@imgly/codesign-server/dist/services/archives/seed-pack.js +218 -0
- package/node_modules/@imgly/codesign-server/dist/services/archives/seed-pack.js.map +1 -0
- package/node_modules/@imgly/codesign-server/dist/services/archives/seed.d.ts.map +1 -1
- package/node_modules/@imgly/codesign-server/dist/services/archives/seed.js +33 -124
- package/node_modules/@imgly/codesign-server/dist/services/archives/seed.js.map +1 -1
- package/node_modules/@imgly/codesign-server/dist/services/archives/template.d.ts +1 -0
- package/node_modules/@imgly/codesign-server/dist/services/archives/template.d.ts.map +1 -1
- package/node_modules/@imgly/codesign-server/dist/services/archives/template.js +1 -1
- package/node_modules/@imgly/codesign-server/dist/services/archives/template.js.map +1 -1
- package/node_modules/@imgly/codesign-server/dist/services/auth/login-manager.d.ts.map +1 -1
- package/node_modules/@imgly/codesign-server/dist/services/auth/login-manager.js +2 -1
- package/node_modules/@imgly/codesign-server/dist/services/auth/login-manager.js.map +1 -1
- package/node_modules/@imgly/codesign-server/dist/services/diagnostics/status.d.ts +9 -5
- package/node_modules/@imgly/codesign-server/dist/services/diagnostics/status.d.ts.map +1 -1
- package/node_modules/@imgly/codesign-server/dist/services/diagnostics/status.js +14 -19
- package/node_modules/@imgly/codesign-server/dist/services/diagnostics/status.js.map +1 -1
- package/node_modules/@imgly/codesign-server/dist/services/diagnostics/tool.d.ts +2 -0
- package/node_modules/@imgly/codesign-server/dist/services/diagnostics/tool.d.ts.map +1 -1
- package/node_modules/@imgly/codesign-server/dist/services/diagnostics/tool.js +1 -0
- package/node_modules/@imgly/codesign-server/dist/services/diagnostics/tool.js.map +1 -1
- package/node_modules/@imgly/codesign-server/dist/services/engine/workspace-image-source.d.ts.map +1 -1
- package/node_modules/@imgly/codesign-server/dist/services/engine/workspace-image-source.js +4 -1
- package/node_modules/@imgly/codesign-server/dist/services/engine/workspace-image-source.js.map +1 -1
- package/node_modules/@imgly/codesign-server/dist/services/engine/workspace-source-module.d.ts +5 -1
- package/node_modules/@imgly/codesign-server/dist/services/engine/workspace-source-module.d.ts.map +1 -1
- package/node_modules/@imgly/codesign-server/dist/services/engine/workspace-source-module.js +67 -6
- package/node_modules/@imgly/codesign-server/dist/services/engine/workspace-source-module.js.map +1 -1
- package/node_modules/@imgly/codesign-server/dist/services/flags/manifest.js +2 -2
- package/node_modules/@imgly/codesign-server/dist/services/flags/manifest.js.map +1 -1
- package/node_modules/@imgly/codesign-server/dist/services/flags/release-flags.generated.d.ts +3 -3
- package/node_modules/@imgly/codesign-server/dist/services/flags/release-flags.generated.d.ts.map +1 -1
- package/node_modules/@imgly/codesign-server/dist/services/flags/release-flags.generated.js +3 -3
- package/node_modules/@imgly/codesign-server/dist/services/flags/release-flags.generated.js.map +1 -1
- package/node_modules/@imgly/codesign-server/dist/services/gateway-bearer.d.ts +15 -0
- package/node_modules/@imgly/codesign-server/dist/services/gateway-bearer.d.ts.map +1 -0
- package/node_modules/@imgly/codesign-server/dist/services/gateway-bearer.js +14 -0
- package/node_modules/@imgly/codesign-server/dist/services/gateway-bearer.js.map +1 -0
- package/node_modules/@imgly/codesign-server/dist/services/telemetry/error-policy.d.ts.map +1 -1
- package/node_modules/@imgly/codesign-server/dist/services/telemetry/error-policy.js +36 -0
- package/node_modules/@imgly/codesign-server/dist/services/telemetry/error-policy.js.map +1 -1
- package/node_modules/@imgly/codesign-server/dist/services/telemetry/usage-sink.d.ts +2 -2
- package/node_modules/@imgly/codesign-server/dist/services/telemetry/usage-sink.d.ts.map +1 -1
- package/node_modules/@imgly/codesign-server/dist/services/telemetry/usage-sink.js +3 -5
- package/node_modules/@imgly/codesign-server/dist/services/telemetry/usage-sink.js.map +1 -1
- package/node_modules/@imgly/codesign-server/dist/services/viewer/ai-plugin-assets.d.ts.map +1 -1
- package/node_modules/@imgly/codesign-server/dist/services/viewer/ai-plugin-assets.js +5 -4
- package/node_modules/@imgly/codesign-server/dist/services/viewer/ai-plugin-assets.js.map +1 -1
- package/node_modules/@imgly/codesign-server/dist/services/viewer/spa-assets.generated.d.ts.map +1 -1
- package/node_modules/@imgly/codesign-server/dist/services/viewer/spa-assets.generated.js +0 -64
- package/node_modules/@imgly/codesign-server/dist/services/viewer/spa-assets.generated.js.map +1 -1
- package/node_modules/@imgly/codesign-server/dist/services/viewer/url-builder.d.ts +4 -0
- package/node_modules/@imgly/codesign-server/dist/services/viewer/url-builder.d.ts.map +1 -1
- package/node_modules/@imgly/codesign-server/dist/services/viewer/url-builder.js +4 -0
- package/node_modules/@imgly/codesign-server/dist/services/viewer/url-builder.js.map +1 -1
- package/node_modules/@imgly/codesign-server/dist/services/viewer/workspace-source-route.d.ts.map +1 -1
- package/node_modules/@imgly/codesign-server/dist/services/viewer/workspace-source-route.js +2 -24
- package/node_modules/@imgly/codesign-server/dist/services/viewer/workspace-source-route.js.map +1 -1
- package/node_modules/@imgly/codesign-server/dist/services/workspace/asset-sidecars.d.ts +4 -2
- package/node_modules/@imgly/codesign-server/dist/services/workspace/asset-sidecars.d.ts.map +1 -1
- package/node_modules/@imgly/codesign-server/dist/services/workspace/asset-sidecars.js +15 -14
- package/node_modules/@imgly/codesign-server/dist/services/workspace/asset-sidecars.js.map +1 -1
- package/node_modules/@imgly/codesign-server/dist/services/workspace/asset-store.d.ts +12 -2
- package/node_modules/@imgly/codesign-server/dist/services/workspace/asset-store.d.ts.map +1 -1
- package/node_modules/@imgly/codesign-server/dist/services/workspace/asset-store.js +42 -12
- package/node_modules/@imgly/codesign-server/dist/services/workspace/asset-store.js.map +1 -1
- package/node_modules/@imgly/codesign-server/dist/services/workspace/assets-handlers.d.ts.map +1 -1
- package/node_modules/@imgly/codesign-server/dist/services/workspace/assets-handlers.js +1 -2
- package/node_modules/@imgly/codesign-server/dist/services/workspace/assets-handlers.js.map +1 -1
- package/node_modules/@imgly/codesign-server/dist/services/workspace/image-listing.d.ts.map +1 -1
- package/node_modules/@imgly/codesign-server/dist/services/workspace/image-listing.js +24 -2
- package/node_modules/@imgly/codesign-server/dist/services/workspace/image-listing.js.map +1 -1
- package/node_modules/@imgly/codesign-server/dist/services/workspace/layout-keys.d.ts +47 -0
- package/node_modules/@imgly/codesign-server/dist/services/workspace/layout-keys.d.ts.map +1 -0
- package/node_modules/@imgly/codesign-server/dist/services/workspace/layout-keys.js +167 -0
- package/node_modules/@imgly/codesign-server/dist/services/workspace/layout-keys.js.map +1 -0
- package/node_modules/@imgly/codesign-server/dist/services/workspace/layout.d.ts +2 -0
- package/node_modules/@imgly/codesign-server/dist/services/workspace/layout.d.ts.map +1 -1
- package/node_modules/@imgly/codesign-server/dist/services/workspace/layout.js +2 -0
- package/node_modules/@imgly/codesign-server/dist/services/workspace/layout.js.map +1 -1
- package/node_modules/@imgly/codesign-server/dist/services/workspace/object-store-fs.d.ts +32 -0
- package/node_modules/@imgly/codesign-server/dist/services/workspace/object-store-fs.d.ts.map +1 -0
- package/node_modules/@imgly/codesign-server/dist/services/workspace/object-store-fs.js +79 -0
- package/node_modules/@imgly/codesign-server/dist/services/workspace/object-store-fs.js.map +1 -0
- package/node_modules/@imgly/codesign-server/dist/services/workspace/object-store-workspace.d.ts +35 -0
- package/node_modules/@imgly/codesign-server/dist/services/workspace/object-store-workspace.d.ts.map +1 -0
- package/node_modules/@imgly/codesign-server/dist/services/workspace/object-store-workspace.js +185 -0
- package/node_modules/@imgly/codesign-server/dist/services/workspace/object-store-workspace.js.map +1 -0
- package/node_modules/@imgly/codesign-server/dist/services/workspace/object-store.d.ts +74 -0
- package/node_modules/@imgly/codesign-server/dist/services/workspace/object-store.d.ts.map +1 -0
- package/node_modules/@imgly/codesign-server/dist/services/workspace/object-store.js +82 -0
- package/node_modules/@imgly/codesign-server/dist/services/workspace/object-store.js.map +1 -0
- package/node_modules/@imgly/codesign-server/dist/services/workspace/types.d.ts +10 -0
- package/node_modules/@imgly/codesign-server/dist/services/workspace/types.d.ts.map +1 -1
- package/node_modules/@imgly/codesign-server/dist/services/workspace/types.js +1 -0
- package/node_modules/@imgly/codesign-server/dist/services/workspace/types.js.map +1 -1
- package/node_modules/@imgly/codesign-server/dist/services/workspace/write-atomic.d.ts.map +1 -1
- package/node_modules/@imgly/codesign-server/dist/services/workspace/write-atomic.js +5 -0
- package/node_modules/@imgly/codesign-server/dist/services/workspace/write-atomic.js.map +1 -1
- package/node_modules/@imgly/codesign-server/package.json +13 -11
- package/node_modules/@imgly/design-lint/dist/rules/text-legibility.d.ts +2 -1
- package/node_modules/@imgly/design-lint/dist/rules/text-legibility.d.ts.map +1 -1
- package/node_modules/@imgly/design-lint/dist/rules/text-legibility.js +5 -1
- package/node_modules/@imgly/design-lint/dist/rules/text-legibility.js.map +1 -1
- package/node_modules/@imgly/design-lint/package.json +2 -2
- package/node_modules/@imgly/figma-exporter/CHANGELOG.md +79 -0
- package/node_modules/@imgly/figma-exporter/LICENSE.md +137 -0
- package/node_modules/@imgly/figma-exporter/README.md +201 -0
- package/node_modules/@imgly/figma-exporter/THIRD_PARTY_NOTICES.md +475 -0
- package/node_modules/@imgly/figma-exporter/dist/index.cjs +1 -0
- package/node_modules/@imgly/figma-exporter/dist/index.d.cts +8833 -0
- package/node_modules/@imgly/figma-exporter/dist/index.d.ts +8833 -0
- package/node_modules/@imgly/figma-exporter/dist/index.js +1 -0
- package/node_modules/@imgly/figma-exporter/package.json +92 -0
- package/node_modules/@imgly/figma-importer/CHANGELOG.md +84 -0
- package/node_modules/@imgly/figma-importer/LICENSE.md +137 -0
- package/node_modules/@imgly/figma-importer/README.md +256 -0
- package/node_modules/@imgly/figma-importer/THIRD_PARTY_NOTICES.md +446 -0
- package/node_modules/@imgly/figma-importer/dist/index.cjs +2 -0
- package/node_modules/@imgly/figma-importer/dist/index.d.cts +12831 -0
- package/node_modules/@imgly/figma-importer/dist/index.d.ts +12831 -0
- package/node_modules/@imgly/figma-importer/dist/index.js +2 -0
- package/node_modules/@imgly/figma-importer/package.json +85 -0
- package/node_modules/@imgly/html-exporter/CHANGELOG.md +35 -0
- package/node_modules/@imgly/html-exporter/README.md +45 -4
- package/node_modules/@imgly/html-exporter/dist/index.cjs +610 -493
- package/node_modules/@imgly/html-exporter/dist/index.d.cts +235 -216
- package/node_modules/@imgly/html-exporter/dist/index.d.ts +235 -216
- package/node_modules/@imgly/html-exporter/dist/index.js +610 -493
- package/node_modules/@imgly/html-exporter/package.json +15 -10
- package/node_modules/@imgly/idml-exporter/CHANGELOG.md +10 -0
- package/node_modules/@imgly/idml-exporter/README.md +17 -18
- package/node_modules/@imgly/idml-exporter/dist/harfbuzz.browser.js +1 -1
- package/node_modules/@imgly/idml-exporter/dist/index.cjs +8 -11
- package/node_modules/@imgly/idml-exporter/dist/index.d.cts +14480 -10275
- package/node_modules/@imgly/idml-exporter/dist/index.d.ts +14480 -10275
- package/node_modules/@imgly/idml-exporter/dist/index.js +8 -10
- package/node_modules/@imgly/idml-exporter/dist/woff2.browser.js +14 -14
- package/node_modules/@imgly/idml-exporter/package.json +17 -12
- package/node_modules/@imgly/idml-importer/CHANGELOG.md +37 -0
- package/node_modules/@imgly/idml-importer/README.md +148 -17
- package/node_modules/@imgly/idml-importer/dist/index.cjs +6 -5
- package/node_modules/@imgly/idml-importer/dist/index.d.cts +1003 -632
- package/node_modules/@imgly/idml-importer/dist/index.d.ts +1003 -632
- package/node_modules/@imgly/idml-importer/dist/index.js +6 -5
- package/node_modules/@imgly/idml-importer/package.json +9 -9
- package/node_modules/@imgly/pdf-importer/CHANGELOG.md +59 -0
- package/node_modules/@imgly/pdf-importer/README.md +71 -7
- package/node_modules/@imgly/pdf-importer/dist/browser.d.ts +940 -788
- package/node_modules/@imgly/pdf-importer/dist/browser.js +17 -15
- package/node_modules/@imgly/pdf-importer/dist/node.cjs +17 -16
- package/node_modules/@imgly/pdf-importer/dist/node.d.cts +940 -788
- package/node_modules/@imgly/pdf-importer/dist/node.d.ts +940 -788
- package/node_modules/@imgly/pdf-importer/dist/node.js +17 -15
- package/node_modules/@imgly/pdf-importer/dist/pdf.worker.mjs +80265 -61990
- package/node_modules/@imgly/pdf-importer/package.json +13 -13
- package/node_modules/@imgly/psd-exporter/CHANGELOG.md +12 -0
- package/node_modules/@imgly/psd-exporter/README.md +50 -7
- package/node_modules/@imgly/psd-exporter/dist/index.cjs +5 -7
- package/node_modules/@imgly/psd-exporter/dist/index.d.cts +14332 -10063
- package/node_modules/@imgly/psd-exporter/dist/index.d.ts +14332 -10063
- package/node_modules/@imgly/psd-exporter/dist/index.js +5 -6
- package/node_modules/@imgly/psd-exporter/dist/wawoff2-LICENSE.txt +19 -0
- package/node_modules/@imgly/psd-exporter/dist/woff2.browser.js +19 -0
- package/node_modules/@imgly/psd-exporter/package.json +26 -9
- package/node_modules/@imgly/psd-importer/CHANGELOG.md +29 -1
- package/node_modules/@imgly/psd-importer/README.md +22 -30
- package/node_modules/@imgly/psd-importer/dist/index.cjs +11 -11
- package/node_modules/@imgly/psd-importer/dist/index.d.cts +10479 -12978
- package/node_modules/@imgly/psd-importer/dist/index.d.ts +10479 -12978
- package/node_modules/@imgly/psd-importer/dist/index.js +11 -11
- package/node_modules/@imgly/psd-importer/package.json +8 -11
- package/package.json +28 -17
- package/node_modules/@imgly/pdf-importer/dist/browser.d.cts +0 -941
|
@@ -5,14 +5,14 @@ export const INLINE_ASSETS = {
|
|
|
5
5
|
"docs/animate/reference/multipage.md": "# Multi-page designs\n\n`apply.js` builds all of this; this page is for reading a result and for edits the scheduler does\nnot cover.\n\nThe chosen pages are combined onto one video page (the first chosen page) in the animated design;\npages left out of a pick are dropped from it. The saved multi-page still stays as it was.\n\n- **Order and length:** from intake. Each scene gets\n `max(entrance window + readability hold, total ÷ pages)`, and the echo reports the total.\n- **Shared blocks:** blocks that are identical on every page (same type, same text or fill,\n bounding box within 1 px) are kept once. That copy spans `[0, L]`, gets one entrance in scene 1,\n and is **moved to the top of the z-order**. The duplicates are destroyed.\n- **Background track:** each scene's bottom-most full-bleed layer becomes a leaf clip on\n `bg-track` (at z-index 0, auto-arrange off). Clip `i` has `timeOffset = startᵢ` and\n `duration = LEN + T`, except the last clip, which has `LEN`.\n- **Overlay track:** any other full-bleed layer (a gradient or scrim) goes on `overlay-track`,\n directly above the background track, with the same timings and transitions. It must not be in the\n content group: there, the incoming scene's overlay darkens the outgoing text during the cut. An\n overlay whose neighbouring scene has none exits (or enters) with the transition's own motion\n instead of cutting.\n- **Transitions:** the style's type on both tracks, set in a second pass after all clips exist.\n- **Content group per scene:** the remaining children go into `s<n>/content`.\n - Scene 1 runs `[0, LEN + T]`; each later scene `n` runs `[startₙ + T, startₙ + LEN (+T)]`, so\n incoming content builds after the transition.\n - Child offsets are **relative** to the group.\n - Every scene except the last gets an out-animation matching the transition, using the\n transition's own easing (`push` Left → `slide` direction `π`, EaseInOutQuint; `cross-fade` →\n `fade`).\n<!-- requires:interactive -->\n- **Size:** if pages differ in size, ask once, defaulting to the first page's size. No silent\n reflow.\n<!-- /requires:interactive -->\n<!-- unless:interactive -->\n- **Size:** if pages differ in size, use the first page's size and say so. No silent reflow.\n<!-- /unless:interactive -->\n\n## Block names\n\n`bg-track`, `overlay-track`, and per scene `s<n>/content`. Existing backgrounds and overlays keep\ntheir own names; find them by their `codesign/motion-beat` tag. Only a background `apply.js` has to\ncreate (a page fill) is named `s<n>/bg`.\n",
|
|
6
6
|
"docs/animate/reference/schedule.md": "# Scheduler and applier\n\n`schedule.js` turns a layer inventory into a timed plan in a read-only `edit`; `apply.js`\napplies the plan in ONE `edit`. Never work out timings by hand.\n\n## Inventory — one read-only edit\n\nRun this block as the whole code of an `edit` with `render: false`. It returns, per page in order,\nthe page `id`, size and fill kind, every group (`id`, `name`, enclosing `group`) and every leaf\nlayer: `id`, `type`, `name`, global `bbox`, `fill` kind, the enclosing `group`, and for text blocks\nonly `text`, `words` and `fontSize` (design px). Text properties exist only on text blocks: reading\nthem on an image or shape throws.\n\n<!-- prettier-ignore -->\n```js\n// inventory.js — the whole body of ONE read-only edit (render: false)\nconst d = engine.design;\nconst box = (g) => ({ x: Math.round(g.x), y: Math.round(g.y), w: Math.round(g.width), h: Math.round(g.height) });\nconst fillOf = async (id) => ((await d.getCapabilities(id)).includes('fill') ? ((await d.getProps(id, ['fill'])).fill?.type ?? null) : null);\nconst pages = [];\nfor (const page of await d.findByType('page')) {\n const { width, height } = await d.getProps(page, ['width', 'height']);\n const out = { id: page, width, height, fill: await fillOf(page), groups: [], layers: [] };\n const walk = async (id, group) => {\n const { type, name, globalBoundingBox } = await d.getProps(id, ['type', 'name', 'globalBoundingBox']);\n if (type === 'group') {\n out.groups.push({ id, name, group });\n for (const c of await d.getChildren(id)) await walk(c, id);\n return;\n }\n const layer = { id, type, name, bbox: box(globalBoundingBox), fill: await fillOf(id), group };\n if (type === 'text') {\n const { text } = await d.getProps(id, ['text.string', 'text.fontSize']);\n Object.assign(layer, { text: text.string, words: text.string.split(/\\s+/).filter(Boolean).length, fontSize: Math.round(parseFloat(text.fontSize)) });\n }\n out.layers.push(layer);\n };\n for (const c of await d.getChildren(page)) await walk(c, null);\n pages.push(out);\n}\nreturn { type: 'text', text: JSON.stringify({ pages }) };\n```\n\nTurn it into the schedule input: one entry in `pages` per chosen page, a key and role per layer, every\ngroup's key in that page's `containers`, and every id — each page as `\"s<n>\"`, each layer and each\ngroup — under `ids`.\n\n## Input\n\nThe input is the layer inventory plus the resolved intake. `key` is the tag the agent writes on\neach block (`codesign/motion-beat`); `ids` maps keys to this session's block ids. On the first\napply `ids` must also map every page id to its page (`\"s1\": <page id>`): `apply.js` builds the\nvideo on the first planned page and copies a page's fill when it has no background layer. Re-applies\nneed no `ids`: blocks are tagged by then. `containers` lists every group: each must span the page,\nor its children vanish when the group's 5 s default ends. A Frankfurt poster, calm would be:\n\n```json\n{\n \"canvas\": { \"width\": 1920, \"height\": 1080 },\n \"intake\": {\n \"style\": \"calm\",\n \"length\": 10,\n \"ending\": \"hold\",\n \"hero\": \"s1/title\"\n },\n \"pages\": [\n {\n \"id\": \"s1\",\n \"containers\": [\"s1/g-art\", \"s1/g-type\"],\n \"layers\": [\n {\n \"key\": \"s1/bg\",\n \"role\": \"background\",\n \"bbox\": { \"x\": 0, \"y\": 0, \"w\": 1920, \"h\": 1080 }\n },\n {\n \"key\": \"s1/bridge\",\n \"role\": \"image\",\n \"bbox\": { \"x\": 455, \"y\": 418, \"w\": 703, \"h\": 391 }\n },\n {\n \"key\": \"s1/overline\",\n \"role\": \"body\",\n \"words\": 5,\n \"fontSize\": 5,\n \"bbox\": { \"x\": 96, \"y\": 96, \"w\": 319, \"h\": 17 }\n },\n {\n \"key\": \"s1/title\",\n \"role\": \"headline\",\n \"words\": 1,\n \"fontSize\": 56,\n \"bbox\": { \"x\": 96, \"y\": 126, \"w\": 335, \"h\": 56 }\n },\n {\n \"key\": \"s1/rule\",\n \"role\": \"decoration\",\n \"bbox\": { \"x\": 96, \"y\": 198, \"w\": 45, \"h\": 2 }\n }\n ]\n }\n ],\n \"ids\": {\n \"s1\": 3,\n \"s1/bg\": 12,\n \"s1/bridge\": 14,\n \"s1/overline\": 21,\n \"s1/title\": 22,\n \"s1/rule\": 23,\n \"s1/g-art\": 30,\n \"s1/g-type\": 31\n }\n}\n```\n\n`intake` carries `style`, `length` (seconds, omit to fit to content), `ending` (`hold`, `loop` or\n`outro`) and `hero` (a layer key). A key in `hero`, `static` or `order` that names no layer, or any\nother `ending`, throws. One entry in `pages` per page; multi-page layers also carry `sig`.\nRun the block below as the whole code of a read-only `edit` (`render: false`), its first line\n`const INPUT = <the input>, CHANGE = null;`. It returns the plan as JSON; `plan.apply` is what\n`apply.js` walks. To iterate, `INPUT` is the page's stored `codesign/motion` metadata and `CHANGE`\nthe change (the animate skill's Iterate table) — it returns the new plan.\n\n<!-- prettier-ignore -->\n```js\n// schedule.js — the whole body of ONE read-only edit (render: false); first line: const INPUT = <input>, CHANGE = null;\n\nconst PI = Math.PI;\n\nconst TYPES = {\n slide: { easing: true, opts: ['direction', 'fade'] },\n pan: { easing: true, opts: ['direction', 'distance', 'fade'] },\n fade: { easing: true, opts: [] },\n blur: { easing: true, opts: ['fade', 'intensity'] },\n grow: { easing: true, opts: ['direction', 'scaleFactor'] },\n zoom: { easing: true, opts: ['fade'] },\n pop: { easing: false, opts: [] },\n wipe: { easing: true, opts: ['direction'] },\n baseline: { easing: true, opts: ['direction'] },\n crop_zoom: { easing: true, opts: ['fade', 'scale'] },\n spin: { easing: true, opts: ['direction', 'fade', 'intensity'] },\n ken_burns: { easing: true, opts: ['direction', 'fade', 'travelDistanceRatio', 'zoomIntensity'] },\n typewriter_text: { easing: false, opts: [] },\n block_swipe_text: { easing: false, opts: ['blockColor', 'direction', 'useTextColor'] },\n spread_text: { easing: true, opts: ['fade', 'intensity'] },\n merge_text: { easing: true, opts: ['direction', 'intensity'] },\n breathing_loop: { easing: false, opts: ['intensity'] },\n pulsating_loop: { easing: false, opts: ['intensity'] },\n jump_loop: { easing: false, opts: ['direction', 'intensity'] },\n sway_loop: { easing: false, opts: ['intensity'] },\n spin_loop: { easing: false, opts: ['direction'] },\n fade_loop: { easing: false, opts: [] },\n blur_loop: { easing: false, opts: ['intensity'] },\n squeeze_loop: { easing: false, opts: [] },\n scale_loop: { easing: true, opts: ['direction', 'easingDuration', 'endScale', 'holdDuration', 'startDelay', 'startScale'] }\n};\nconst COMMON = new Set(['type', 'duration', 'writingStyle', 'overlap']);\n\nfunction legal(spec) {\n const t = TYPES[spec.type];\n if (!t) throw new Error(`unknown animation type '${spec.type}'`);\n const out = {};\n for (const [k, v] of Object.entries(spec)) {\n if (k === 'easing') {\n if (t.easing) out.easing = v;\n } else if (COMMON.has(k)) out[k] = v;\n else if (k !== spec.type) throw new Error(`'${spec.type}' has no option '${k}'`);\n else {\n for (const o of Object.keys(v)) if (!t.opts.includes(o)) throw new Error(`'${spec.type}' has no option '${o}'`);\n out[k] = { ...v };\n }\n }\n return out;\n}\n\nconst STYLES = {\n calm: {\n stagger: 0.25, dur: 1.0, heroDur: 1.2, easing: 'EaseOutQuint',\n image: { type: 'fade' }, text: { type: 'fade', writingStyle: 'Line' },\n hero: { type: 'blur', blur: { fade: true } }, decoration: { type: 'wipe', wipe: { direction: 'Right' } },\n loop: { type: 'breathing_loop' },\n transition: { type: 'cross-fade', duration: 0.8, easing: 'EaseInOutQuint' }\n },\n energetic: {\n stagger: 0.12, dur: 0.4, heroDur: 0.5, easing: 'EaseOutBack',\n image: { type: 'slide' }, text: { type: 'block_swipe_text', writingStyle: 'Line' },\n hero: { type: 'zoom', zoom: { fade: true } }, decoration: { type: 'pop' },\n loop: { type: 'pulsating_loop' },\n transition: { type: 'push', direction: 'Left', duration: 0.4, easing: 'EaseInOutQuint' }\n },\n playful: {\n stagger: 0.15, dur: 0.55, heroDur: 0.7, easing: 'EaseOutSpring',\n image: { type: 'pop' }, text: { type: 'baseline', writingStyle: 'Character', overlap: 0.4 },\n hero: { type: 'spin', spin: { fade: true } }, decoration: { type: 'grow' },\n loop: { type: 'sway_loop' },\n transition: { type: 'stack', direction: 'Up', duration: 0.5, easing: 'EaseInOutQuint' }\n },\n cinematic: {\n stagger: 0.4, dur: 1.3, heroDur: 1.6, easing: 'EaseInOutQuart',\n image: { type: 'blur', blur: { fade: true } }, text: { type: 'spread_text', writingStyle: 'Word' },\n hero: { type: 'grow' }, decoration: { type: 'fade' },\n loop: null,\n transition: { type: 'fade-to-black', duration: 1.0, easing: 'EaseInOutQuart' }\n }\n};\nconst STYLE_ORDER = ['cinematic', 'calm', 'playful', 'energetic'];\nconst RANK = { background: 0, image: 1, body: 2, decoration: 3, headline: 4, logo: 5, cta: 6, hero: 7 };\nconst TEXT_MIN = (words) => Math.max(0.8, 0.3 * words);\nconst r3 = (x) => Math.round(x * 1000) / 1000;\nconst up = (x) => Math.ceil(x * 10 - 1e-9) / 10;\n\nfunction slideFrom(bbox, canvas) {\n const edges = [\n [bbox.x, 0],\n [bbox.y, PI / 2],\n [canvas.width - (bbox.x + bbox.w), PI],\n [canvas.height - (bbox.y + bbox.h), (3 * PI) / 2]\n ];\n return edges.reduce((a, c) => (c[0] < a[0] ? c : a))[1];\n}\n\nfunction pickHero(layers) {\n const texts = layers.filter((l) => (l.words ?? 0) > 0 && l.role !== 'body');\n const pool = texts.length ? texts : layers.filter((l) => l.role === 'image');\n const area = (l) => l.bbox.w * l.bbox.h;\n return [...pool].sort((a, b) => (b.fontSize ?? 0) - (a.fontSize ?? 0) || area(b) - area(a))[0]?.key ?? null;\n}\n\nfunction entranceFor(l, S, canvas, o, hero) {\n const d = (hero ? S.heroDur : S.dur) * o.speed;\n let spec;\n if (l.role === 'background')\n spec = { type: 'crop_zoom', duration: Math.min(3, Math.max(1.2, S.dur * 2.5)) * o.speed, easing: 'EaseOutQuint', crop_zoom: { fade: false, scale: 1.12 } };\n else if (hero) spec = { ...S.hero, duration: d, easing: S.easing };\n else if (l.role === 'logo') spec = { type: S.image.type === 'pop' || S.decoration.type === 'pop' ? 'pop' : 'fade', duration: d, easing: S.easing };\n else if (l.role === 'body' || ((l.words ?? 0) > 0 && (l.fontSize ?? 99) < 24)) spec = { type: 'fade', duration: d, easing: 'EaseOutQuint' };\n else if ((l.words ?? 0) > 0) spec = { ...S.text, duration: d, easing: S.easing };\n else if (l.role === 'decoration') spec = { ...S.decoration, duration: d, easing: S.easing };\n else {\n spec = { ...S.image, duration: d, easing: S.easing };\n if (spec.type === 'slide') spec.slide = { direction: slideFrom(l.bbox, canvas), fade: true };\n }\n if (o.noBounce) {\n if (spec.type === 'pop') spec = { type: 'fade', duration: spec.duration, easing: 'EaseOutQuint' };\n if (/Back|Spring/.test(spec.easing ?? '')) spec.easing = 'EaseOutQuint';\n }\n spec.duration = r3(spec.duration);\n return legal(spec);\n}\n\nfunction sceneBeats(layers, S, canvas, o) {\n const animated = layers.filter((l) => l.role !== 'overlay' && !o.static.includes(l.key));\n const heroKey = o.hero && animated.some((l) => l.key === o.hero) ? o.hero : pickHero(animated);\n const rank = (l) =>\n o.order[l.key] === 'first' ? 0.5 : o.order[l.key] === 'last' ? 99 : l.key === heroKey ? 8 : (RANK[l.role] ?? 3);\n const list = [...animated].sort((a, b) => rank(a) - rank(b) || a.bbox.y - b.bbox.y || a.bbox.x - b.bbox.x);\n let t = 0;\n const beats = list.map((l) => {\n const hero = l.key === heroKey;\n const start = l.role === 'background' ? 0 : r3((t += S.stagger * o.speed));\n return { key: l.key, role: hero ? 'hero' : l.role, words: l.words ?? 0, start, in: entranceFor(l, S, canvas, o, hero) };\n });\n return { heroKey, beats };\n}\n\nfunction exitSpan(beats, S, o) {\n if (!beats.length) return 0;\n return (beats.length - 1) * S.stagger * 0.5 * o.speed + Math.max(...beats.map((b) => b.in.duration * 0.6));\n}\n\nfunction fitLength(beats, ending, S, o, delay = 0) {\n const settle = delay + Math.max(0, ...beats.map((b) => b.start + b.in.duration));\n const read = delay + Math.max(0, ...beats.filter((b) => b.words > 0).map((b) => b.start + b.in.duration + TEXT_MIN(b.words)));\n const tail = ending === 'outro' ? 0.2 : ending === 'loop' ? 0.1 : 0;\n const exit = ending === 'hold' ? 0 : exitSpan(beats, S, o) + tail;\n return up(Math.max(settle / 0.6, read + exit));\n}\n\nfunction withEnding(beats, len, ending, S, o, heroKey) {\n const n = beats.length;\n return beats.map((b, i) => {\n const e = { ...b, end: r3(len) };\n if (ending === 'loop' && b.role === 'background') return { ...e, in: undefined };\n if (ending !== 'hold' && b.role !== 'background') {\n const tail = ending === 'outro' ? 0.2 : 0.1;\n e.end = r3(len - tail - (n - 1 - i) * S.stagger * 0.5 * o.speed);\n e.out = legal({ ...b.in, duration: r3(b.in.duration * 0.6) });\n }\n if (ending === 'loop' && b.key === heroKey) e.loop = legal({ ...(S.loop ?? { type: 'breathing_loop' }), duration: 2 });\n return e;\n });\n}\n\nconst ENDINGS = ['hold', 'loop', 'outro'];\n\nfunction options(intake, pages) {\n if (intake.ending != null && !ENDINGS.includes(intake.ending)) throw new Error(`unknown ending '${intake.ending}' (hold, loop or outro)`);\n const keys = new Set(pages.flatMap((p) => p.layers.map((l) => l.key)));\n for (const k of [...(intake.hero == null ? [] : [intake.hero]), ...(intake.static ?? []), ...Object.keys(intake.order ?? {})])\n if (!keys.has(k)) throw new Error(`no layer '${k}' on any page`);\n return {\n speed: intake.speed ?? 1,\n noBounce: intake.noBounce === true,\n static: intake.static ?? [],\n order: intake.order ?? {},\n hero: intake.hero ?? null\n };\n}\n\nfunction entryOf(b) {\n return { key: b.key, timeOffset: b.start, duration: r3(b.end - b.start), in: b.in ?? null, out: b.out ?? null, loop: b.loop ?? null };\n}\n\nfunction single(i, S, o) {\n const p = i.pages[0];\n const ending = i.intake.ending ?? 'hold';\n const { heroKey, beats } = sceneBeats(p.layers, S, i.canvas, o);\n const fit = fitLength(beats, ending, S, o);\n const L = i.intake.length ? Math.max(i.intake.length, fit) : fit;\n const timed = withEnding(beats, L, ending, S, o, heroKey).map((b) => ({ ...b, scene: p.id }));\n const animatedKeys = new Set(timed.map((b) => b.key));\n const apply = [\n { page: true, duration: L },\n ...(p.containers ?? []).map((key) => ({ key, timeOffset: 0, duration: L })),\n ...timed.map(entryOf),\n ...p.layers.filter((l) => !animatedKeys.has(l.key)).map((l) => ({ key: l.key, timeOffset: 0, duration: L, in: null, out: null, loop: null }))\n ];\n return { length: L, stretched: !!i.intake.length && fit > i.intake.length, T: 0, scenes: [{ id: p.id, start: 0, length: L }], beats: timed, apply };\n}\n\nfunction schedule(input) {\n const { ids, ...rest } = input;\n const S = STYLES[rest.intake.style];\n if (!S) throw new Error(`unknown style '${rest.intake.style}'`);\n const o = options(rest.intake, rest.pages);\n const body = rest.pages.length === 1 ? single(rest, S, o) : multi(rest, S, o);\n return { v: 1, input: rest, ...(ids ? { ids } : {}), ...body };\n}\n\nconst TRAVEL = { Left: PI, Right: 0, Up: (3 * PI) / 2, Down: PI / 2 };\nconst MOVING = new Set(['push', 'slide', 'stack']);\n\nfunction exitFor(tr) {\n if (MOVING.has(tr.type))\n return legal({ type: 'slide', duration: tr.duration, easing: tr.easing, slide: { direction: TRAVEL[tr.direction], fade: false } });\n return legal({ type: 'fade', duration: tr.duration, easing: tr.easing });\n}\n\nfunction multi(i, S, o) {\n const ending = i.intake.ending ?? 'hold';\n const N = i.pages.length;\n const tr = { ...S.transition, duration: r3(S.transition.duration * o.speed) };\n const T = tr.duration;\n const isChrome = (l) => !!l.sig && !['background', 'overlay', 'image'].includes(l.role);\n const count = new Map();\n for (const p of i.pages) for (const s of new Set(p.layers.filter(isChrome).map((l) => l.sig))) count.set(s, (count.get(s) ?? 0) + 1);\n const shared = (l) => isChrome(l) && count.get(l.sig) === N;\n const bgIn = (l) => entranceFor(l, S, i.canvas, o, false);\n\n const scenes = i.pages.map((p, n) => {\n const bg = p.layers.find((l) => l.role === 'background') ?? null;\n const overlay = p.layers.find((l) => l.role === 'overlay') ?? null;\n const content = p.layers.filter((l) => l !== bg && l !== overlay && !shared(l));\n const last = n === N - 1;\n const sb = sceneBeats(content, S, i.canvas, o);\n const delay = n > 0 ? T : 0;\n const bgFit = bg && (n === 0 || !MOVING.has(tr.type)) ? bgIn(bg).duration / 0.6 : 0;\n const fit = Math.max(fitLength(sb.beats, last ? ending : 'hold', S, o, delay), up(bgFit));\n return { p, n, bg, overlay, content, last, ...sb, fit };\n });\n const per = i.intake.length ? i.intake.length / N : 0;\n const LEN = up(Math.max(per, ...scenes.map((s) => s.fit)));\n const L = r3(LEN * N);\n\n const apply = [{ page: true, duration: L }];\n for (const s of scenes)\n for (const l of s.p.layers.filter(shared))\n apply.push(\n s.n === 0\n ? { key: l.key, timeOffset: 0, duration: L, in: legal({ type: 'fade', duration: 0.3, easing: 'EaseOutQuint' }), out: null, loop: null, front: true }\n : { key: l.key, destroy: true }\n );\n\n const beats = [];\n for (const s of scenes) {\n const start = r3(s.n * LEN);\n const span = r3(LEN + (s.last ? 0 : T));\n const nextHasOverlay = !s.last && !!scenes[s.n + 1].overlay;\n const moved = s.n > 0 && MOVING.has(tr.type);\n if (s.bg)\n apply.push({ key: s.bg.key, track: 'bg', timeOffset: start, duration: span, in: moved ? null : bgIn(s.bg), out: null, loop: null, transition: s.last ? null : { ...tr } });\n else\n apply.push({ key: `${s.p.id}/bg`, create: 'page-fill', source: s.p.id, track: 'bg', timeOffset: start, duration: span, in: null, out: null, loop: null, transition: s.last ? null : { ...tr } });\n if (s.overlay) {\n const enters = s.n > 0 && !scenes[s.n - 1].overlay;\n const leaves = !s.last && !nextHasOverlay;\n apply.push({ key: s.overlay.key, track: 'overlay', timeOffset: start, duration: span, in: enters ? exitFor(tr) : null, out: leaves ? exitFor(tr) : null, loop: null, transition: nextHasOverlay ? { ...tr } : null });\n }\n\n if (!s.content.length) continue;\n const gStart = r3(s.n === 0 ? 0 : start + T);\n const gDur = r3(start + span - gStart);\n const g = `${s.p.id}/content`;\n apply.push({ group: g, members: s.content.map((l) => l.key), timeOffset: gStart, duration: gDur, in: null, loop: null, out: s.last ? null : exitFor(tr) });\n const timed = withEnding(s.beats, gDur, s.last ? ending : 'hold', S, o, s.heroKey);\n const keys = new Set(timed.map((b) => b.key));\n for (const b of timed) {\n beats.push({ ...b, scene: s.p.id });\n apply.push({ ...entryOf(b), parent: g });\n }\n for (const l of s.content.filter((l) => !keys.has(l.key)))\n apply.push({ key: l.key, parent: g, timeOffset: 0, duration: gDur, in: null, out: null, loop: null });\n }\n return {\n length: L,\n stretched: !!i.intake.length && LEN * N > i.intake.length + 1e-9,\n T,\n scenes: scenes.map((s) => ({ id: s.p.id, start: r3(s.n * LEN), length: LEN })),\n beats,\n apply\n };\n}\n\nfunction transform(plan, change) {\n const input = structuredClone(plan.input);\n const x = input.intake;\n switch (change.kind) {\n case 'slower': x.speed = (x.speed ?? 1) * 1.3; break;\n case 'faster': x.speed = (x.speed ?? 1) / 1.3; break;\n case 'first':\n case 'last': x.order = { ...(x.order ?? {}), [change.key]: change.kind }; break;\n case 'noBounce': x.noBounce = true; break;\n case 'energy':\n case 'calmer': {\n const k = STYLE_ORDER.indexOf(x.style) + (change.kind === 'energy' ? 1 : -1);\n x.style = STYLE_ORDER[Math.min(STYLE_ORDER.length - 1, Math.max(0, k))];\n break;\n }\n case 'static': x.static = [...(x.static ?? []), change.key]; break;\n case 'ending': x.ending = change.to; break;\n default: throw new Error(`unknown change '${change.kind}'`);\n }\n return schedule({ ...input, ...(plan.ids ? { ids: plan.ids } : {}) });\n}\n\nreturn { type: 'text', text: JSON.stringify(CHANGE ? transform(INPUT, CHANGE) : schedule(INPUT)) };\n```\n\n## apply.js — one edit\n\nPrepend `const PLAN = <the plan schedule.js returned>;`. Run it as one `edit` on the design you animate: the first apply on the copy of the still, every re-apply with a transformed plan on the animated design (the still has no `codesign/motion-beat` tags, and a stored plan carries no ids).\n\n<!-- prettier-ignore -->\n```js\n// apply.js — the body of ONE edit; first line of that edit: const PLAN = <schedule.js output>;\nconst d = engine.design;\nconst TAG = 'codesign/motion-beat';\nconst [scene] = await d.findByType('scene');\nawait d.setProps(scene, { scene: { mode: 'Video' } });\nconst tagged = new Map(), meta = new Map(), live = new Set();\nconst walk = async (id, first) => {\n live.add(id);\n if (first) {\n const { metadata } = await d.getProps(id, ['metadata']);\n meta.set(id, metadata);\n if (metadata[TAG] !== undefined) tagged.set(metadata[TAG], id);\n }\n for (const c of await d.getChildren(id)) await walk(c, first);\n};\nawait walk(scene, true);\nconst refresh = async () => { live.clear(); await walk(scene, false); }; // after destroys\nconst found = (key) => { const id = tagged.get(key) ?? PLAN.ids?.[key]; return live.has(id) ? id : undefined; };\nconst idOf = (key) => { const id = found(key); if (id === undefined) throw new Error(`no block for '${key}': tag it or pass its id in PLAN.ids`); return id; };\nconst tag = async (key, id) => { await d.setProps(id, { metadata: { [TAG]: key } }); tagged.set(key, id); };\nconst pages = await d.findByType('page');\nconst motion = pages.find((p) => meta.get(p)?.['codesign/motion'] !== undefined);\nconst planned = motion !== undefined ? [motion] : PLAN.input.pages.map((p) => idOf(p.id));\nconst [page, ...rest] = planned;\nfor (const p of pages) if (!planned.includes(p)) await d.destroy(p);\nawait refresh();\n\nawait d.setProps(page, { playback: { duration: PLAN.length } });\nfor (const a of PLAN.apply) if (a.destroy && found(a.key) !== undefined) await d.destroy(idOf(a.key));\nawait refresh();\n\nconst tracks = {};\nconst trackFor = async (name) => {\n if (tracks[name] !== undefined) return tracks[name];\n let t = (await d.findByName(`${name}-track`))[0];\n if (t === undefined) {\n t = await d.create({ type: 'track', name: `${name}-track`, props: { track: { automaticallyManageBlockOffsets: false } } }, { parent: page, index: name === 'bg' ? 0 : 1 });\n }\n return (tracks[name] = t);\n};\nfor (const a of PLAN.apply.filter((x) => x.track)) {\n if (a.create === 'page-fill' && found(a.key) === undefined) {\n const { width, height } = await d.getProps(page, ['width', 'height']);\n const { fill } = await d.getProps(idOf(a.source), ['fill']); // a page's fill, copied as its spec\n const id = await d.create({ type: 'graphic', name: a.key, props: { shape: { type: 'rect' }, width, height, fill } }, { parent: page });\n live.add(id);\n await tag(a.key, id);\n }\n const id = idOf(a.key);\n const t = await trackFor(a.track);\n if ((await d.getParent(id)) !== t) await d.appendChild(t, id);\n}\n\nconst groups = {};\nfor (const a of PLAN.apply.filter((x) => x.group)) {\n let g = (await d.findByName(a.group))[0];\n if (g === undefined) {\n const ids = a.members.map(idOf);\n for (const id of ids) if ((await d.getParent(id)) !== page) await d.appendChild(page, id); // onto the video page\n g = await d.group(ids);\n await d.setProps(g, { name: a.group });\n }\n groups[a.group] = g;\n}\n\nfor (const a of PLAN.apply) {\n if (a.destroy || a.page) continue;\n const id = a.group ? groups[a.group] : idOf(a.key);\n if (a.key) await tag(a.key, id);\n await d.setProps(id, { playback: { timeOffset: a.timeOffset, duration: a.duration } });\n if ('in' in a || 'out' in a || 'loop' in a) await d.setProps(id, { animations: { in: a.in ?? null, loop: a.loop ?? null, out: a.out ?? null } });\n}\n\nfor (const a of PLAN.apply.filter((x) => x.track)) {\n const tr = a.transition;\n const spec = tr && { type: tr.type, duration: tr.duration, ...(tr.easing ? { easing: tr.easing } : {}), ...(tr.direction ? { [tr.type]: { direction: tr.direction } } : {}) };\n await d.setProps(idOf(a.key), { transition: spec || null }); // replaces any earlier one\n}\n\nfor (const a of PLAN.apply) if (a.front) await d.appendChild(page, idOf(a.key)); // z-order to front\nlet left = 0;\nfor (const p of rest) {\n if ((await d.getChildren(p)).length === 0) await d.destroy(p);\n else left++;\n}\nawait d.setProps(page, { metadata: { 'codesign/motion': JSON.stringify({ v: PLAN.v, input: PLAN.input }) } });\nreturn { type: 'text', text: `animated ${PLAN.length}s · ${PLAN.apply.length} entries · ${left} source page(s) still hold unplanned blocks` };\n```\n",
|
|
7
7
|
"docs/animate/reference/styles.md": "# Styles\n\nThe numbers live in `schedule.js` (`STYLES`); this page explains them. Change both together.\n\n| Style | Entrances | Easing | Stagger | Entrance duration | Text | Loop | Transitions |\n| --------- | --------------------------------- | --------------------------- | ------- | ----------------- | ------------------------ | ------------------------ | ----------------------------- |\n| calm | `fade`, soft `slide`, `blur` | EaseOutQuint / EaseOut | 0.25 s | 0.8–1.2 s | `fade`, Line | `breathing_loop` | `cross-fade`, `cross-blur` |\n| energetic | `pop`, `zoom`, `slide`, `wipe` | EaseOutBack / EaseOutQuint | 0.12 s | 0.3–0.5 s | `block_swipe_text`, Line | `pulsating_loop` | `push`, `slide`, `cross-zoom` |\n| playful | `pop`, `spin`, `grow`, `baseline` | EaseOutBack / EaseOutSpring | 0.15 s | 0.4–0.7 s | `baseline`, Character | `jump_loop`, `sway_loop` | `stack`, `splice` |\n| cinematic | `blur`, slow `grow`, `crop_zoom` | EaseInOutQuart | 0.4 s | 1.0–1.6 s | `spread_text`, Word | none | `fade-to-black`, `cross-warp` |\n\nAn easing applies only to types that accept one: `pop`, `typewriter_text`, `block_swipe_text` and\nevery `*_loop` except `scale_loop` take none. The scheduler drops it for those.\n\n## Per-role rules\n\nThey override the style.\n\n- Backgrounds and full-bleed images: `crop_zoom { scale: 1.1–1.15, fade: false }` over 1.2–3 s,\n EaseOutQuint. `zoom` is too strong (no intensity setting), and a whole-length drift would break\n the settle rule.\n- Logo: a simple `fade` or `pop`, never character-by-character.\n- Body text under ~24 px: `fade` only.\n- `slide` enters from the element's nearest canvas edge, using the angle map below.\n\n## Slide angles\n\n`slide.direction` is the direction of travel in radians:\n\n| enters from | direction |\n| ----------- | --------- |\n| left | `0` |\n| top | `π/2` |\n| right | `π` |\n| bottom | `3π/2` |\n",
|
|
8
|
-
"docs/api/SKILL.md": "---\nname: api\ndescription: |\n Authoritative TypeScript signatures for `engine.design`, the only API edit\n code uses. Use this skill whenever you need the exact signature, prop path,\n or return type — especially before calling a member you haven't used yet.\n Generated from the running engine's own `.d.ts`: THE source of truth.\n\n Its entry document carries the whole edit-code API inline, in one read.\n\n The sub-file \"signatures.d.ts\" adds the upstream CE.SDK core as reference\n only (edit code never calls it), every vocabulary type flattened to its\n literal union.\n---\n\n## Start here: `engine.design` (inside `edit` code)\n\nEdit code uses `engine.design` only (the edit gate refuses every other\nengine namespace). One nested-props dialect, one call per block:\n\n```js\nconst [scene] = await engine.design.findByType('scene');\nconst page = await engine.design.create(\n { type: 'page', props: { width: 1080, height: 1920 } },\n { parent: scene } // a page goes into the scene's stack\n);\nconst chip = await engine.design.create(\n {\n type: 'text',\n name: 'chip',\n props: {\n backgroundColor: {\n enabled: true,\n color: ACCENT,\n paddingLeft: 24,\n cornerRadius: 999\n }\n }\n },\n { parent: page }\n);\nawait engine.design.setProps(title, {\n opacity: 0.9,\n stroke: { enabled: true, width: 2 }\n});\nconst { width } = await engine.design.getProps(page, ['width']);\n```\n\n- `create(spec, { parent?, index? })` (await it!) is THE constructor — one\n block or a whole subtree, the same spec shape at every level. It folds\n create, appendChild and property writes into one call and rolls back on\n failure. Returns the root block id.\n- A spec node carries exactly `type`, `name`, `props` and `children` (nested,\n same shape). Everything else IS props — including the font: naming a\n family (`text: { font: { family, weight } }`) makes `create` — and\n `setProps` — look the family up in this deployment's typeface sources and\n pick that weight's file. Every `engine.design` member, `findText(copy)`\n and `findAllText(copy)` return a Promise: always `await` it (a Promise as\n a block id is refused).\n `text: { string, ranges }` (style ranges replayed reshape-safe), inline\n `fill: { type, ... }` / `shape` / `blur` / `effects: [...]` / `animations`\n specs all sit under `props`.\n- `name` on any node is written onto the block itself:\n `const [chip] = await engine.design.findByName('chip')` resolves it in this edit\n and in every later one. Name every block you may touch again.\n- No `describe`: identity IS props — `getProps(id)` for everything valued,\n `getProps(id, ['type'])` for what a block is, `getCapabilities(idOrType)`\n for what it supports.\n- Text is all props too: `setProps(id, { text: { string, font, weight,\ncase, ranges, path, decoration } })` (a range also takes\n `scriptStyle: 'Superscript' | 'Subscript'`) — leaves apply in a safe order and\n a string-only write auto-preserves style ranges. Read back via\n `getProps(id, ['text.ranges'])` / `['text.paragraphs']`.\n- A font size (`text.fontSize`, a range's `size`) requires a unit (`'32pt'`).\n- `setProps` validates **every** leaf before touching the scene: a bad leaf\n throws listing all bad paths with suggestions, and nothing is applied.\n- On a group, only colours (`fill`/`stroke`/`dropShadow`/`text` `.color`)\n reach the descendants that take them.\n- `getProps(id, ['position', 'stroke'])` reads leaves or whole subtrees; an\n unknown selector throws — it never answers a typo with `undefined`.\n- Attachment state is a discriminated union: assign `{ type, ...props }` to\n `fill`/`shape`/`blur`/`effects`/`animations`/`transition`. The type picks\n the arm and the arm names every prop it carries. A type MATCHING what is\n attached edits it in place; a different type replaces it; `null` detaches\n (except `effects`, replaced wholesale — `[]` clears). Reads answer in the\n same shape, so `getProps` output feeds straight back in; attachment ids\n never circulate. Tree/layout verbs\n live on `engine.design` (group, appendChild, align); saving and exporting\n are the `export` tool.\n- Where each prop is taught: `shape.modifiers`, compound `subshapes` and\n `stroke.fill` (angles in **radians**) → `{{skill:api#shapes.md}}`; `masks`\n and `matte` (`source` is a name or uuid) → `{{skill:formats#print.md}}`;\n `variables` and `bindings`
|
|
9
|
-
"docs/api/animation.md": "<!-- requires:video -->\n# Animation: entrance, exit and loop animations\n\nAny block in a design with a timeline (`{{skill:api#video.md}}`) can move.\n\nEvery block takes up to three animations: `in` (entrance, from the block's\nstart), `out` (exit, ending at its end) and `loop` (the whole time it is\nvisible). They combine; the engine keeps `in` and `out` from overlapping.\n\n```js\nawait engine.design.setProps(headline, {\n animations: {\n in: { type: 'slide', duration: 0.6, easing: 'EaseOutQuint', slide: { direction: Math.PI, fade: true } },\n out: { type: 'pop', duration: 0.4 },\n loop: { type: 'sway_loop', duration: 1.5, sway_loop: { intensity: 0.3 } }\n }\n});\nawait engine.design.setProps(headline, { animations: { loop: null } }); // remove one\n```\n\n`ken_burns` (images and video) sets the fill to Cover.\n\n- **Verify with `preview` at `time`** inside the animation (start + half its\n duration); a still that shows the block at rest there means it is not\n attached or not where you think.\n\n## Keyframes: custom motion\n\nPresets cover entrances, exits and loops. For any other move (a logo gliding\nalong an arc, a colour sweep, a wipe that reveals a photo) key the leaves\nyourself, on the block or inside the spec of the attachment that owns the\nleaf. The `Keyframes` type names the shapes; the traps:\n\n```js\nawait engine.design.setProps(logo, {\n playback: { duration: 6 }, // FIRST: keys run over the block's own duration\n transform: { anchor: { x: 60, y: 60 } }, // pivot, design units from the frame's top-left\n keyframes: {\n position: [\n { at: 0, value: { x: '-200px', y: '400px' }, easing: 'EaseOutQuint', spatialOut: { x: 150, y: -250 } },\n { at: 1.2, value: { x: '120px', y: '380px' } }\n ],\n opacity: [{ at: 0, value: 0 }, { at: '15%', value: 1 }]\n }\n});\nawait engine.design.setProps(photo, {\n effects: [{ type: 'linear_wipe', keyframes: { 'linear_wipe.completion': [{ at: 0, value: 1 }, { at: 1, value: 0, easing: 'EaseInOut' }] } }]\n});\n```\n\n- **`at` is seconds from the block's start** (`1.2`, `'1.2s'`) or a share of\n its duration (`'25%'`). A new block lasts 5 s whatever its page does, so a\n key at 8 s is refused until the block's `playback.duration` covers it (the\n same write is enough). A later duration change stretches the keys. An\n attachment's keys run over its block's duration.\n- **Keys name the leaf as the props do** (`position`, `position.x`,\n `transform.scale.x`, `stroke.color`, `text.string`); in a spec, drop the\n slot (`color.value` in a fill, `stops` in a gradient fill with the same\n count on every key). List entries carry their own (`masks[i]`,\n `shape.modifiers[i]`, `shape.subshapes[i]`, `text.animators[i]`). A leaf\n that cannot be keyed is refused, naming those that can; audio cannot be\n keyed. Lengths take `'px'`/`'mm'`/`'pt'`, never `'%'`.\n- **Text whose `text.string` keys add lines needs `heightMode: 'Absolute'`**\n with a height that fits the longest key. With `'Auto'`, the first MP4\n export keeps the height the text had before the export and cuts the added\n lines, though previews show them. `measure` on a fixed height returns that\n height, so measure each key on an unkeyed copy, at the final font size:\n\n ```js\n const keys = (await engine.design.getProps(id, ['keyframes'])).keyframes['text.string'];\n if (keys) {\n const probe = await engine.design.duplicate(id);\n await engine.design.setProps(probe, { keyframes: { 'text.string': null }, heightMode: 'Auto' });\n let height = 0;\n for (const k of keys) {\n await engine.design.setProps(probe, { text: { string: k.value } });\n height = Math.max(height, (await engine.design.measure(probe)).height);\n }\n await engine.design.destroy(probe);\n await engine.design.setProps(id, { heightMode: 'Absolute', height });\n }\n ```\n\n To change the keyed copy (a translation), map each key's `value` and write\n the list back (`keyframes: { 'text.string': keys }`), keeping `at` and\n `easing`; then measure again. A change of font size measures again too.\n- **`text.string` keys draw in the text's first run.** A key whose string\n differs from the static one takes the first character's colour and size,\n so the style ranges (an accent colour or size) are gone in renders, though\n `getProps` still reports them. Build an accented keyed headline as separate\n text blocks, the accent in its own, and group them. If the words before the\n accent change length, the accent overlaps them or leaves a hole. For a\n one-line, left-aligned, left-to-right text with the accent last on the\n line, key the accent's `position.x` too: one key per `text.string` key at\n the same `at` in seconds (both blocks with the same start and\n `playback.duration`), `easing: 'Hold'`, each value the text's\n `measure(id).x` (the group's space, as `position.x`) plus that key's own\n width (`measure(probe).width` on an unkeyed copy as above, writing\n `widthMode: 'Auto'` where the snippet writes `heightMode: 'Auto'`; one\n width per key, not the largest) plus the gap. Write these keys again after\n the text moves or its keys change.\n- **`easing`** is the curve to the NEXT key: a preset, `'Hold'` (jump at the\n next key), or `{ type: 'Bezier', out, in }` as CSS\n `cubic-bezier(out.x, out.y, in.x, in.y)`. Default `'Linear'`.\n `{ mode: 'Relative', keys }` adds the keys to the static value (numbers and\n `{ x, y }`): a wobble that follows wherever the block is placed.\n- **A static write does not override a track.** `opacity: 1` on a block with\n an opacity track changes nothing you can see: remove the track\n (`keyframes: { opacity: null }`; `keyframes: null` removes all).\n- **A rotation track turns around the frame centre** until the block has a\n `transform.anchor`; with one (even `{ x: 0, y: 0 }`) it turns around the\n anchor, as `transform.scale` does. Static `rotation` always turns about the\n centre. `transform.skew` and `skewAxis` key in radians, like their static\n values.\n- **Replacing an attachment drops its keys**: a spec of the same `type` keeps\n them, another type starts empty; `effects` is replaced whole, so give every\n effect its `keyframes` again (`getProps` returns them in each spec).\n- **Presets and keys add up.** A fade-in multiplies a keyed opacity, a slide\n starts from the keyed position. Keep the preset for the entrance and key the\n move, or key both ends yourself.\n- **Reveals through a shape**: a `linear_wipe`, `radial_wipe` or\n `venetian_blinds` effect (`completion` 0 shows all, 1 hides all), a soft\n `masks` entry, or a `matte` (\"Matte reveal\" below). **Draw a line on**: a\n stroke-only shape with a `trim` modifier whose `end` is keyed from 0 to 1\n (`{{skill:api#shapes.md}}`).\n- Verify with `preview` at `time` on each key and between keys.\n\n### Scale a group: camera push\n\nA group takes no `transform` keys and no anchor. To zoom several pieces as\none, key a graphic and link each piece to it with `transformParent`:\n\n```js\nconst cam = await engine.design.create({ type: 'graphic', name: 'cam', props: {\n shape: { type: 'rect' }, opacity: 0, width: 1080, height: 1080, position: { x: 0, y: 0 },\n transform: { anchor: { x: 540, y: 540 } }, playback: { duration: 6 }\n} }, { parent: page });\nconst push = [{ at: 0, value: 1 }, { at: 6, value: 1.15, easing: 'EaseInOut' }];\nawait engine.design.setProps(cam, { keyframes: { 'transform.scale.x': push, 'transform.scale.y': push } });\nfor (const piece of [headline, photo, photoMatte]) await engine.design.setProps(piece, { transformParent: cam });\n```\n\n- **A linked piece's `position` counts from the parent's top-left**: the\n same `{ x: 60, y: 60 }` now draws 60 units inside the parent, not on the\n page. Cover the page with the parent to keep page positions.\n- The pieces take the parent's position, rotation and scale, around its\n anchor, not its opacity: an invisible parent still drives them.\n- **Link a matte's source too**, or the cut-out keeps its size while the\n piece grows. Pieces in a group stay grouped: link each child.\n\n## Matte reveal: a line rising through a matte\n\nA line that slides out from behind an invisible edge is a `matte`: the text\nshows only where its source block draws, and the source itself never draws.\nKey the text through a window that stays put.\n\n```js\nconst D = engine.design;\nconst words = await D.create({ type: 'track', name: 'words' }, { parent: page });\nconst mattes = await D.create({ type: 'track', name: 'mattes' }, { parent: page });\nconst line = await D.create(\n {\n type: 'text',\n name: 'b1/headline',\n props: {\n widthMode: 'Auto',\n text: { string: 'Night shift', fontSize: '96px', font: { family: 'Inter', weight: 'bold' }, lineHeight: { visual: 1.1 } },\n position: { x: 96, y: 400 }\n }\n },\n { parent: words }\n);\nconst box = await D.measure(line);\nconst win = await D.create(\n {\n type: 'graphic',\n name: 'b1/headline-matte',\n props: {\n shape: { type: 'rect' },\n fill: { type: 'color', color: { value: { r: 0, g: 0, b: 0, a: 1 } } },\n width: box.width,\n height: box.height,\n position: { x: box.x, y: box.y }\n }\n },\n { parent: mattes }\n);\nawait D.setProps(win, { playback: { timeOffset: 1, duration: 4 } });\nawait D.setProps(line, {\n playback: { timeOffset: 1, duration: 4 }, // FIRST, as for any keys\n matte: { source: 'b1/headline-matte', mode: 'Alpha' }, // a name or uuid\n keyframes: {\n 'position.y': [\n { at: 0, value: `${box.y + box.height}px`, easing: 'EaseOutQuart' },\n { at: 0.6, value: `${box.y}px` }\n ]\n }\n});\n```\n\n- **The window is the source's shape, at every moment.** Any part of the\n text inside it shows, so a line parked half under the edge shows its top\n before it moves. Start it fully outside (offset by its full height), or key\n `opacity` to 0 with `'Hold'` until the move starts.\n- **The text draws only while its source is on screen.** Give the source the\n text's `timeOffset` and `duration`: a new block lasts 5 s, so a source left\n at the default makes its text vanish at 5 s.\n- **Give the source a track of its own.** On the text's track it lands\n after the text, so the text does not draw; give it overlapping times and\n it moves to a new track above at the end of the edit (\"Overlaps move up\"\n in `{{skill:api#video.md}}`). Which track does not matter: the source\n does not draw.\n- **A matte does not change stacking.** The text draws at its own layer, so a\n block above the text covers it, wherever the source sits.\n- **One matte per block**; a second `matte` write replaces the first. For\n several windows on one text, make the source a group of shapes\n (`D.group([...])`); lines that move on their own are separate text blocks.\n- **The `baseline` preset clips to the text's own frame** (its bottom edge\n on the way in, its top edge on the way out). For an edge anywhere else (a\n rule, a line inside a taller frame), use a matte.\n- `Alpha` follows the source's alpha, so its colour does not matter. A matte\n does not survive SVG export (`{{skill:formats#print.md}}`).\n- Verify with `preview` at `time` before the move, halfway and after it.\n\n## Per-glyph motion: text animators\n\n`text.animators` (on a caption: `caption.animators`, track-wide) is the\nAfter-Effects-style tool under the text presets: a **range selector** over the\nglyphs and what it does to the selected ones (the `TextAnimator` type).\n\n```js\nawait engine.design.setProps(title, { text: { animators: [{\n selectorBasedOn: 'Words', positionY: '40px', opacity: 0,\n keyframes: { selectorOffset: [{ at: 0, value: 0 }, { at: 1.2, value: 1, easing: 'EaseOutQuart' }] }\n}] } }); // words rise in left to right as the selection slides off them\n```\n\n- **Which one.** A plain reveal or exit (fade, slide, typewriter per word,\n with `overlap`) is a preset: shorter, and the `animate` skill schedules it.\n Reach for an animator only for what presets cannot do: a wave through the\n letters, a colour or highlight sweep, per-letter tracking or blur, a random\n order, a karaoke word highlight. An `in` preset plays on top of them.\n- **A static animator only styles; keyframes make it move.** The usual motion\n is a `selectorOffset` track: the selection covers everything at offset 0 and\n nothing at 1 or −1. `selectorShape` fades the effect across the range edge:\n `RampUp` turns the sweep into a stagger, `Triangle` into a wave. Times are\n seconds of the text block.\n- Scale and rotation pivot on the glyph's baseline centre, moved by\n `anchorX/Y`. A negative `selectorAmount` inverts every effect. A stroke\n needs the text's own `stroke: { enabled: true }`; `width: 0` there strokes\n only the selected glyphs. `animators: [...]` replaces the whole list in order; `[]`\n removes them.\n<!-- /requires:video -->\n",
|
|
8
|
+
"docs/api/SKILL.md": "---\nname: api\ndescription: |\n Authoritative TypeScript signatures for `engine.design`, the only API edit\n code uses. Use this skill whenever you need the exact signature, prop path,\n or return type — especially before calling a member you haven't used yet.\n Generated from the running engine's own `.d.ts`: THE source of truth.\n\n Its entry document carries the whole edit-code API inline, in one read.\n\n The sub-file \"signatures.d.ts\" adds the upstream CE.SDK core as reference\n only (edit code never calls it), every vocabulary type flattened to its\n literal union.\n---\n\n## Start here: `engine.design` (inside `edit` code)\n\nEdit code uses `engine.design` only (the edit gate refuses every other\nengine namespace). One nested-props dialect, one call per block:\n\n```js\nconst [scene] = await engine.design.findByType('scene');\nconst page = await engine.design.create(\n { type: 'page', props: { width: 1080, height: 1920 } },\n { parent: scene } // a page goes into the scene's stack\n);\nconst chip = await engine.design.create(\n {\n type: 'text',\n name: 'chip',\n props: {\n backgroundColor: {\n enabled: true,\n color: ACCENT,\n paddingLeft: 24,\n cornerRadius: 999\n }\n }\n },\n { parent: page }\n);\nawait engine.design.setProps(title, {\n opacity: 0.9,\n stroke: { enabled: true, width: 2 }\n});\nconst { width } = await engine.design.getProps(page, ['width']);\n```\n\n- `create(spec, { parent?, index? })` (await it!) is THE constructor — one\n block or a whole subtree, the same spec shape at every level. It folds\n create, appendChild and property writes into one call and rolls back on\n failure. Returns the root block id.\n- A spec node carries exactly `type`, `name`, `props` and `children` (nested,\n same shape). Everything else IS props — including the font: naming a\n family (`text: { font: { family, weight } }`) makes `create` — and\n `setProps` — look the family up in this deployment's typeface sources and\n pick that weight's file. Every `engine.design` member, `findText(copy)`\n and `findAllText(copy)` return a Promise: always `await` it (a Promise as\n a block id is refused).\n `text: { string, ranges }` (style ranges replayed reshape-safe), inline\n `fill: { type, ... }` / `shape` / `blur` / `effects: [...]` / `animations`\n specs all sit under `props`.\n- `name` on any node is written onto the block itself:\n `const [chip] = await engine.design.findByName('chip')` resolves it in this edit\n and in every later one. Name every block you may touch again.\n- No `describe`: identity IS props — `getProps(id)` for everything valued,\n `getProps(id, ['type'])` for what a block is, `getCapabilities(idOrType)`\n for what it supports.\n- Text is all props too: `setProps(id, { text: { string, font, weight,\ncase, ranges, path, decoration } })` (a range also takes\n `scriptStyle: 'Superscript' | 'Subscript'`) — leaves apply in a safe order and\n a string-only write auto-preserves style ranges. Read back via\n `getProps(id, ['text.ranges'])` / `['text.paragraphs']`.\n- A font size (`text.fontSize`, a range's `size`) requires a unit (`'32pt'`).\n- `setProps` validates **every** leaf before touching the scene: a bad leaf\n throws listing all bad paths with suggestions, and nothing is applied.\n- On a group, only colours (`fill`/`stroke`/`dropShadow`/`text` `.color`)\n reach the descendants that take them.\n- `getProps(id, ['position', 'stroke'])` reads leaves or whole subtrees; an\n unknown selector throws — it never answers a typo with `undefined`.\n- Attachment state is a discriminated union: assign `{ type, ...props }` to\n `fill`/`shape`/`blur`/`effects`/`animations`/`transition`. The type picks\n the arm and the arm names every prop it carries. A type MATCHING what is\n attached edits it in place; a different type replaces it; `null` detaches\n (except `effects`, replaced wholesale — `[]` clears). Reads answer in the\n same shape, so `getProps` output feeds straight back in; attachment ids\n never circulate. Tree/layout verbs\n live on `engine.design` (group, appendChild, align); saving and exporting\n are the `export` tool.\n- Where each prop is taught: `shape.modifiers`, compound `subshapes` and\n `stroke.fill` (angles in **radians**) → `{{skill:api#shapes.md}}`; `masks`\n and `matte` (`source` is a name or uuid) → `{{skill:formats#print.md}}`;\n `variables`, `valueSets`, `activeValueSet` and `bindings` →\n `{{skill:templates}}`; `baselineShift` →\n design-rules §6.1.9.\n- `transform` bends a block in place around `transform.anchor` (design\n units from the frame's top-left): `scale: { x, y }` is a factor, `skew` a\n shear in **radians** (shown up to ±1.48, 85°) along `skewAxis` in radians\n (0 shears along x, π/2 along y), like the block's own `rotation`. Every\n angle is radians but motion blur's `shutterAngle`/`shutterPhase` (degrees).\n Keep `scene.angleUnit` at `Radian`: everything here assumes it.\n Without an anchor the skew pivots on an edge and the block slides, so give\n it the centre. A shear widens a block by its height × tan|skew|; a slanted\n 400 × 300 board that stays within its width:\n `setProps(board, { transform: { anchor: { x: 200, y: 150 }, skew: -0.35, scale: { x: 0.7 } } })`.\n- Document state is on the scene block (`variables`, `spotColors`,\n `markers`, `scene.*`); a new document is `create({ type: 'scene', children })`.\n<!-- requires:video -->\n- Any design can become a video: add timed content to the scene you have,\n never rebuild it. `playback`, `animations`, `audio` and `track` props; read\n `{{skill:api#video.md}}` before any timeline work. `keyframes` (on a block\n and in every spec, `at` in seconds of the block), `transform`,\n `transformParent`, `text.animators` (kinetic type) and matte reveals (a\n `matte` in motion) → `{{skill:api#animation.md}}`.\n<!-- requires:export -->\n<!-- requires:video-limit -->\n- An mp4, wav or m4a export is at most {{max-video-seconds}} seconds long, a video\n at most as much work as {{max-video-seconds}} seconds of 1080p at 30 fps\n (frames × pixels): plan the timeline within it.\n<!-- /requires:video-limit -->\n<!-- /requires:export -->\n<!-- /requires:video -->\n- Scalar wrappers (`setOpacity`, …), `is*`/`supports*` predicates and\n editor-UI methods are in `signatures-extended.d.ts`, for reference only.\n\n## Reference: `signatures.d.ts`\n\n`{{skill:api#signatures.d.ts}}`: the upstream CE.SDK surface `engine.design`\nwraps (~2000 lines) — read it to understand a prop or enum, never to call\nit. Types are flattened to their values. Class start lines:\n\n| Class | Start line |\n| ------------ | ---------- |\n| AssetAPI | 830 |\n| **BlockAPI** | **1145** |\n| EditorAPI | 1380 |\n| EventAPI | 1531 |\n| **SceneAPI** | **1669** |\n| VariableAPI | 1918 |\n\n## What is NOT in this file\n\n- **Parameter semantics**: colour channels are 0–1, never 0–255; for what\n a bare `number`/`string` leaves open, check the topic page.\n- On demand, `{{skill:api#recipes.md}}`: read its section as you reach the\n call (\"Fonts\", \"Custom shapes\", \"Z-order\", \"Group blocks\"), or \"Known\n engine defects\" on a cryptic error. Print: `{{skill:formats#print.md}}`.\n Templates: `{{skill:templates}}`.\n<!-- requires:video -->\n- Timeline, captions, animations: `{{skill:api#video.md}}`,\n `{{skill:api#animation.md}}`.\n<!-- /requires:video -->\n",
|
|
9
|
+
"docs/api/animation.md": "<!-- requires:video -->\n# Animation: entrance, exit and loop animations\n\nAny block in a design with a timeline (`{{skill:api#video.md}}`) can move.\n\nEvery block takes up to three animations: `in` (entrance, from the block's\nstart), `out` (exit, ending at its end) and `loop` (the whole time it is\nvisible). They combine; the engine keeps `in` and `out` from overlapping.\n\n```js\nawait engine.design.setProps(headline, {\n animations: {\n in: { type: 'slide', duration: 0.6, easing: 'EaseOutQuint', slide: { direction: Math.PI, fade: true } },\n out: { type: 'pop', duration: 0.4 },\n loop: { type: 'sway_loop', duration: 1.5, sway_loop: { intensity: 0.3 } }\n }\n});\nawait engine.design.setProps(headline, { animations: { loop: null } }); // remove one\n```\n\n`ken_burns` (images and video) sets the fill to Cover.\n\n- **Verify with `preview` at `time`** inside the animation (start + half its\n duration); a still that shows the block at rest there means it is not\n attached or not where you think.\n\n## Keyframes: custom motion\n\nPresets cover entrances, exits and loops. For any other move (a logo gliding\nalong an arc, a colour sweep, a wipe that reveals a photo) key the leaves\nyourself, on the block or inside the spec of the attachment that owns the\nleaf. The `Keyframes` type names the shapes; the traps:\n\n```js\nawait engine.design.setProps(logo, {\n playback: { duration: 6 }, // FIRST: keys run over the block's own duration\n transform: { anchor: { x: 60, y: 60 } }, // pivot, design units from the frame's top-left\n keyframes: {\n position: [\n { at: 0, value: { x: '-200px', y: '400px' }, easing: 'EaseOutQuint', spatialOut: { x: 150, y: -250 } },\n { at: 1.2, value: { x: '120px', y: '380px' } }\n ],\n opacity: [{ at: 0, value: 0 }, { at: '15%', value: 1 }]\n }\n});\nawait engine.design.setProps(photo, {\n effects: [{ type: 'linear_wipe', keyframes: { 'linear_wipe.completion': [{ at: 0, value: 1 }, { at: 1, value: 0, easing: 'EaseInOut' }] } }]\n});\n```\n\n- **`at` is seconds from the block's start** (`1.2`, `'1.2s'`) or a share of\n its duration (`'25%'`). A key past the block's `playback.duration` is\n refused until the duration covers it (the same write is enough). A later\n duration change stretches the keys. An attachment's keys run over its\n block's duration.\n- **Keys name the leaf as the props do** (`position`, `position.x`,\n `transform.scale` with `{ x, y }` values or `transform.scale.x`,\n `stroke.color`, `text.string`); in a spec, drop the\n slot (`color.value` in a fill, `stops` in a gradient fill with the same\n count on every key). List entries carry their own (`masks[i]`,\n `shape.modifiers[i]`, `shape.subshapes[i]`, `text.animators[i]`). A leaf\n that cannot be keyed is refused, naming those that can; audio cannot be\n keyed. Lengths take `'px'`/`'mm'`/`'pt'`, never `'%'`.\n- **Text whose `text.string` keys add lines needs `heightMode: 'Absolute'`**\n with a height that fits the longest key. With `'Auto'`, the first MP4\n export keeps the height the text had before the export and cuts the added\n lines, though previews show them. `measure` on a fixed height returns that\n height, so measure each key on an unkeyed copy, at the final font size:\n\n ```js\n const keys = (await engine.design.getProps(id, ['keyframes'])).keyframes['text.string'];\n if (keys) {\n const probe = await engine.design.duplicate(id);\n await engine.design.setProps(probe, { keyframes: { 'text.string': null }, heightMode: 'Auto' });\n let height = 0;\n for (const k of keys) {\n await engine.design.setProps(probe, { text: { string: k.value } });\n height = Math.max(height, (await engine.design.measure(probe)).height);\n }\n await engine.design.destroy(probe);\n await engine.design.setProps(id, { heightMode: 'Absolute', height });\n }\n ```\n\n To change the keyed copy (a translation), map each key's `value` and write\n the list back (`keyframes: { 'text.string': keys }`), keeping `at` and\n `easing`; then measure again. A change of font size measures again too.\n- **`text.string` keys draw in the text's first run.** A key whose string\n differs from the static one takes the first character's colour and size,\n so the style ranges (an accent colour or size) are gone in renders, though\n `getProps` still reports them. Build an accented keyed headline as separate\n text blocks, the accent in its own, and group them. If the words before the\n accent change length, the accent overlaps them or leaves a hole. For a\n one-line, left-aligned, left-to-right text with the accent last on the\n line, key the accent's `position.x` too: one key per `text.string` key at\n the same `at` in seconds (both blocks with the same start and\n `playback.duration`), `easing: 'Hold'`, each value the text's\n `measure(id).x` (the group's space, as `position.x`) plus that key's own\n width (`measure(probe).width` on an unkeyed copy as above, writing\n `widthMode: 'Auto'` where the snippet writes `heightMode: 'Auto'`; one\n width per key, not the largest) plus the gap. Write these keys again after\n the text moves or its keys change.\n- **`easing`** is the curve to the NEXT key: a preset, `'Hold'` (jump at the\n next key), or `{ type: 'Bezier', out, in }` as CSS\n `cubic-bezier(out.x, out.y, in.x, in.y)`. Default `'Linear'`.\n `{ mode: 'Relative', keys }` adds the keys to the static value (numbers and\n `{ x, y }`): a wobble that follows wherever the block is placed.\n A `transform.scale` track reads back as `transform.scale.x` and `.y`;\n key it or its axes in one write, not both.\n- **A static write does not override a track.** `opacity: 1` on a block with\n an opacity track changes nothing you can see: remove the track\n (`keyframes: { opacity: null }`; `keyframes: null` removes all).\n- **A rotation track turns around the frame centre** until the block has a\n `transform.anchor`; with one (even `{ x: 0, y: 0 }`) it turns around the\n anchor, as `transform.scale` does. Static `rotation` always turns about the\n centre. `transform.skew` and `skewAxis` key in radians, like their static\n values.\n- **Replacing an attachment drops its keys**: a spec of the same `type` keeps\n them, another type starts empty; `effects` is replaced whole, so give every\n effect its `keyframes` again (`getProps` returns them in each spec).\n- **Presets and keys add up.** A fade-in multiplies a keyed opacity, a slide\n starts from the keyed position. Keep the preset for the entrance and key the\n move, or key both ends yourself.\n- **Reveals through a shape**: a `linear_wipe`, `radial_wipe` or\n `venetian_blinds` effect (`completion` 0 shows all, 1 hides all), a soft\n `masks` entry, or a `matte` (\"Matte reveal\" below). **Draw a line on**: a\n stroke-only shape with a `trim` modifier whose `end` is keyed from 0 to 1\n (`{{skill:api#shapes.md}}`).\n- Verify with `preview` at `time` on each key and between keys.\n\n### Scale a group: camera push\n\nA group takes no `transform` keys and no anchor. To zoom several pieces as\none, key a graphic and link each piece to it with `transformParent`:\n\n```js\nconst cam = await engine.design.create({ type: 'graphic', name: 'cam', props: {\n shape: { type: 'rect' }, opacity: 0, width: 1080, height: 1080, position: { x: 0, y: 0 },\n transform: { anchor: { x: 540, y: 540 } }, playback: { duration: 6 }\n} }, { parent: page });\nconst push = [{ at: 0, value: { x: 1, y: 1 } }, { at: 6, value: { x: 1.15, y: 1.15 }, easing: 'EaseInOut' }];\nawait engine.design.setProps(cam, { keyframes: { 'transform.scale': push } });\nfor (const piece of [headline, photo, photoMatte]) await engine.design.setProps(piece, { transformParent: cam });\n```\n\n- **A linked piece's `position` counts from the parent's top-left**: the\n same `{ x: 60, y: 60 }` now draws 60 units inside the parent, not on the\n page. Cover the page with the parent to keep page positions.\n- The pieces take the parent's position, rotation and scale, around its\n anchor, not its opacity: an invisible parent still drives them.\n- **Link a matte's source too**, or the cut-out keeps its size while the\n piece grows. Pieces in a group stay grouped: link each child.\n\n## Matte reveal: a line rising through a matte\n\nA line that slides out from behind an invisible edge is a `matte`: the text\nshows only where its source block draws, and the source itself never draws.\nKey the text through a window that stays put.\n\n```js\nconst D = engine.design;\nconst words = await D.create({ type: 'track', name: 'words' }, { parent: page });\nconst mattes = await D.create({ type: 'track', name: 'mattes' }, { parent: page });\nconst line = await D.create(\n {\n type: 'text',\n name: 'b1/headline',\n props: {\n widthMode: 'Auto',\n text: { string: 'Night shift', fontSize: '96px', font: { family: 'Inter', weight: 'bold' }, lineHeight: { visual: 1.1 } },\n position: { x: 96, y: 400 }\n }\n },\n { parent: words }\n);\nconst box = await D.measure(line);\nconst win = await D.create(\n {\n type: 'graphic',\n name: 'b1/headline-matte',\n props: {\n shape: { type: 'rect' },\n fill: { type: 'color', color: { value: { r: 0, g: 0, b: 0, a: 1 } } },\n width: box.width,\n height: box.height,\n position: { x: box.x, y: box.y }\n }\n },\n { parent: mattes }\n);\nawait D.setProps(win, { playback: { timeOffset: 1, duration: 4 } });\nawait D.setProps(line, {\n playback: { timeOffset: 1, duration: 4 }, // FIRST, as for any keys\n matte: { source: 'b1/headline-matte', mode: 'Alpha' }, // a name or uuid\n keyframes: {\n 'position.y': [\n { at: 0, value: `${box.y + box.height}px`, easing: 'EaseOutQuart' },\n { at: 0.6, value: `${box.y}px` }\n ]\n }\n});\n```\n\n- **The window is the source's shape, at every moment.** Any part of the\n text inside it shows, so a line parked half under the edge shows its top\n before it moves. Start it fully outside (offset by its full height), or key\n `opacity` to 0 with `'Hold'` until the move starts.\n- **The text draws only while its source is on screen.** Give the source the\n text's `timeOffset` and `duration`: a new block on a track lasts 5 s, so a\n source left at the default makes its text vanish at 5 s.\n- **Give the source a track of its own.** On the text's track it lands\n after the text, so the text does not draw; give it overlapping times and\n it moves to a new track above at the end of the edit (\"Overlaps move up\"\n in `{{skill:api#video.md}}`). Which track does not matter: the source\n does not draw.\n- **A matte does not change stacking.** The text draws at its own layer, so a\n block above the text covers it, wherever the source sits.\n- **One matte per block**; a second `matte` write replaces the first. For\n several windows on one text, make the source a group of shapes\n (`D.group([...])`); lines that move on their own are separate text blocks.\n- **The `baseline` preset clips to the text's own frame** (its bottom edge\n on the way in, its top edge on the way out). For an edge anywhere else (a\n rule, a line inside a taller frame), use a matte.\n- `Alpha` follows the source's alpha, so its colour does not matter. A matte\n does not survive SVG export (`{{skill:formats#print.md}}`).\n- Verify with `preview` at `time` before the move, halfway and after it.\n\n## Per-glyph motion: text animators\n\n`text.animators` (on a caption: `caption.animators`, track-wide) is the\nAfter-Effects-style tool under the text presets: a **range selector** over the\nglyphs and what it does to the selected ones (the `TextAnimator` type).\n\n```js\nawait engine.design.setProps(title, { text: { animators: [{\n selectorBasedOn: 'Words', positionY: '40px', opacity: 0,\n keyframes: { selectorOffset: [{ at: 0, value: 0 }, { at: 1.2, value: 1, easing: 'EaseOutQuart' }] }\n}] } }); // words rise in left to right as the selection slides off them\n```\n\n- **Which one.** A plain reveal or exit (fade, slide, typewriter per word,\n with `overlap`) is a preset: shorter, and the `animate` skill schedules it.\n Reach for an animator only for what presets cannot do: a wave through the\n letters, a colour or highlight sweep, per-letter tracking or blur, a random\n order, a karaoke word highlight. An `in` preset plays on top of them.\n- **A static animator only styles; keyframes make it move.** The usual motion\n is a `selectorOffset` track: the selection covers everything at offset 0 and\n nothing at 1 or −1. `selectorShape` fades the effect across the range edge:\n `RampUp` turns the sweep into a stagger, `Triangle` into a wave. Times are\n seconds of the text block.\n- Scale and rotation pivot on the glyph's baseline centre, moved by\n `anchorX/Y`. A negative `selectorAmount` inverts every effect. A stroke\n needs the text's own `stroke: { enabled: true }`; `width: 0` there strokes\n only the selected glyphs. `animators: [...]` replaces the whole list in order; `[]`\n removes them.\n<!-- /requires:video -->\n",
|
|
10
10
|
"docs/api/recipes.md": "# Recipes — the constructs edit code uses, and the engine's known defects\n\nWorked examples next to the signatures in this skill's entry document: how a\npage is built, which construct each design rule calls for, fonts, custom\nshapes, stacking and grouping. The rules that choose between them are\n`{{skill:judge#design-rules.md}}`; the last sections are the engine's known\ndefects and what to check when text does not render.\n\n## Build ONE complete page per `edit`\n\nThe unit of work is the **page**: each `edit` emits one complete page — one\n`engine.design.create` with every block, font and size (it awaits resource\nloads itself), then positioning. Do **not** split one page's build across\ncalls: each tool call costs 20–200 s of streaming, so one ~10000-character\ncall beats three ~3000-character ones.\n\n```js\n// 1. Structure + every block of the page — ONE awaited create call\nconst scene = await engine.design.create({ type: 'scene' });\nconst page = await engine.design.create(\n {\n type: 'page',\n props: { width: 720, height: 1008 },\n children: [\n {\n type: 'text',\n name: 'title',\n props: {\n text: {\n // A FAMILY name makes create look the family up and pick\n // that weight's file — no findAssets/fonts[0] hairline trap.\n font: { family: 'Playfair Display', weight: 'bold' },\n string: 'Alex & Jordan',\n fontSize: '48px'\n },\n widthMode: 'Auto',\n heightMode: 'Auto'\n }\n }\n // ... every other block — all of it in props: ranges via\n // text: { string, ranges: [{ from, to, color }] } (reshape-safe),\n // solid panels via fill: { type: 'color', color: { value } }\n ]\n },\n { parent: scene } // the page lands in the scene's stack\n);\n// create() awaited the subtree's font/image loads — measurements are live.\n\n// 2. Position with measured frame dims\nconst [title] = await engine.design.findByName('title');\nconst { width: w } = await engine.design.measure(title);\nawait engine.design.setProps(title, {\n position: { x: (720 - w) / 2, y: 250 }\n});\n// ... position everything ...\n\nreturn { type: 'text', text: `page=${page} ready` };\n```\n\n**A new scene replaces the design you edit.** `create({ type: 'scene' })` is\nfor an empty design; continue a design that is already open with `edit`.\n\n**Name every block you may touch again**: `findByName` finds it in every\nlater edit, where matching copy breaks on an NBSP, a line break or shared text.\n\n**Text frames: Auto + measure.** Build text Auto-sized and position it by\n`measure`; body copy at a fixed column is `widthMode: 'Absolute'` with an Auto\nheight. `create`, `measure`, rendering and saving load fonts and images\nthemselves: never add a wait-for-fonts edit.\n\n**Editing an existing multi-page design:** a mechanical change applied\nuniformly (swap a font everywhere, recolour a brand accent) is one `edit`\nlooping over `await engine.design.findByType('page')`. Substantial per-page\nrework goes page by page, like a build.\n\n**Fix in place, never wipe and rebuild.** Identify the block and change it\nwith a targeted `setProps` — position, `fontSize`, the string. A new\n`create({ type: 'scene' })` is for a scene graph that is genuinely\nunrecoverable, which is rare: a rebuild costs about ten extra calls.\n\n## Which construct, by design rule\n\n- **A text-only chip** (pill, eyebrow, badge, tag, button) is a native text\n background on the text block, never a rect behind floating text (design\n rules §6.5.1):\n\n```js\n// A panel is a graphic; a text-only chip/pill/badge is NOT (next call).\nawait engine.design.create(\n { type: 'graphic', props: { shape: 'rect', fill: { type: 'color', color: { value: c } } } },\n { parent: page }\n);\nawait engine.design.setProps(text, {\n backgroundColor: {\n enabled: true,\n color: c,\n cornerRadius: 'pill',\n paddingLeft: 16, // horizontal ~1.5–2.5× vertical\n paddingRight: 16,\n paddingTop: 8,\n paddingBottom: 8\n }\n});\n```\n\n- **Rich text** (an accent word, a bold lead-in, a price, ®/™) is `text.ranges`\n in one block, never a second block beside the first (§6.1.9); keyed\n `text.string` is the exception: the accent is its own block, grouped with\n the rest (§6.1.9).\n- **All caps** is `text.case: 'Uppercase'`, never typed capitals (§6.1.6).\n- **Multi-paragraph copy and lists** are ONE block: one paragraph per item,\n `listStyle` markers with a hanging indent, never \"• \" typed, a marker block\n or a block per item (§6.1.8).\n- **Curved type** is ONE text block on `text.path` (`{ shape: 'circle',\n diameter }` for a ring), never a block per letter; on a custom arc\n `pathOffset` is a 0..1 fraction from the path's own `M` (§6.5.4).\n- **Fonts** are named by family, `text.font: { family, weight }`; a hand-built\n `{ typeface, uri }` only for a font file you hold a uri for (below).\n\n## Fonts\n\nSet a font by family name inside `edit` code, `text: { font: { family, weight } }`: the API looks the family up<!-- requires:ly.img.gfonts --> in `ly.img.gfonts` (~2,000 Google families)<!-- /requires:ly.img.gfonts -->, picks the weight's file and loads it. Never hardcode font URLs or fetch font CSS yourself; pick an available family rather than guessing a URI. Which families to pair: design rules §6.7.\n<!-- requires:asset_search -->\n<!-- requires:ly.img.gfonts -->\n`asset_search({ source: 'ly.img.gfonts', query })` shows what exists: each hit carries `typeface: { name, weights, styles }` and no font URIs.\n<!-- /requires:ly.img.gfonts -->\n<!-- /requires:asset_search -->\n\n**Digits that must not change width** (counters, prices, timers, scores, tables): the engine has no `tnum` and no width or optical-size axis. Keep the number in one text block, never one block per digit, in a family whose digits are already equal width.\n<!-- requires:ly.img.gfonts -->\nThese are, in every style: Roboto, Roboto Condensed, IBM Plex Sans, IBM Plex Sans Condensed, Open Sans, Noto Sans, Lato, Chivo, Familjen Grotesk, Archivo Narrow, Bebas Neue, and the monos JetBrains Mono, IBM Plex Mono, Geist Mono and Space Mono; Source Sans 3 in upright styles only. Inter, Montserrat, DM Sans, Poppins and most display faces are not. For a condensed cut, use a condensed family (Roboto Condensed, Archivo Narrow, IBM Plex Sans Condensed): `wdth` and `opsz` values cannot be set.\n<!-- /requires:ly.img.gfonts -->\n\n<!-- requires:asset_add -->\nA font file on the user's machine (brand kit, purchased face) is imported first: `asset_add({ source: { path } })` returns a `uri`; use it verbatim as `text.font`'s `uri` and in `typeface.fonts[].uri`. A font a saved style's `tokens.json` names by URI is already in the store: use that URI as it is, no `asset_add`.\n<!-- /requires:asset_add -->\n<!-- unless:asset_add -->\nBrand and purchased fonts are available only when one of this deployment's typeface sources carries them; look them up by family like any other. A font file no source carries cannot be brought in from here: say so, and use the closest available family.\n<!-- /unless:asset_add -->\n\n## Custom shapes — `vector_path`, not a pile of rects\n\n**Any mark with a diagonal, a curve or a hole is one `vector_path` block.** The\nprimitives cannot express those, so approximating a mark out of rects and\nellipses produces stepped edges where a slope should be, and costs one block per\nstep: a windowed facade drawn that way came to 79 blocks and still rendered as a\nstaircase. The same mark as a path is one block with clean geometry.\nCutouts from primitives (`compound`), repeats, rounding, zigzags, draw-on\ntrims (`modifiers`) and gradient strokes (`stroke.fill`): `{{skill:api#shapes.md}}`.\n\n```js\nconst graphic = await engine.design.create(\n {\n type: 'graphic',\n props: {\n shape: {\n type: 'vector_path',\n vector_path: { path: d, width: 100, height: 100 }\n },\n fill: { type: 'color', color: { value: INK } },\n width: 420, // on-canvas size, independent of the frame\n height: 460\n }\n },\n { parent: page }\n);\n```\n\n`vector_path` fills `NonZero` unless you name `fillRule`, so solid subpaths that\ncross union instead of knocking a hole where they meet. Put cut-outs in\n`vector_path: { path, holes: [d, …] }` — the facade winds them, whichever way\nthey are drawn.\n\n```js\nshape: { type: 'vector_path', vector_path: { path: body, holes: [windowD], width: 100, height: 100 } }\n```\n\n**Prefer four cubic Béziers to an SVG arc** for circles and rounded caps — it\nsidesteps `A` command largeArc/sweep flag handling entirely. Control points sit\nat `k = 0.5522847498 * r`.\n\n**Holes are real holes.** A `vector_path` hole shows whatever is behind the\nblock — page ground, another graphic, a photograph. Over a flat ground that is\nwhat you want; over a photograph it reads as a hard-edged cut-out rather than a\nprinted mark, so emit the solid subpaths only and drop the holes. Never fake a\nhole with a ground-coloured shape on top: it only matches a flat, known ground.\n\n## Z-order via child order (no z-index property)\n\nLater children paint on top. **Build pages back-to-front** — a default stack\nfor a designed page:\n\n1. page background — `setProps(page, { background: color })`\n2. full-bleed photo / image (first child, index 0)\n3. scrim / vignette / gradient overlay\n4. structural rules — grid hairlines, dividers, frames\n5. accent shapes — pills, badges, accent bars, icons\n6. body text\n7. headline / display text\n8. foreground decoration (corner brackets, stickers)\n\nIf you create text before its background pill, the pill covers the text.\nDeviate when intent demands — it is a default, not a rule. Fix an existing\nscene by moving a sibling, never by destroying and recreating it:\n\n```js\nawait engine.design.order(pillId, { below: textId }); // or { above: id }, 'front', 'back'\n```\n\n## Group blocks — every page is a tree\n\nA finished page is a **tree, not a flat list of siblings**. Cluster every set\nthat reads as one unit — inline in `create` (`{ type: 'group', name, children }`)\nor `await engine.design.group(ids)` after positioning — and **nest groups into\nparent groups** where the clusters nest. The group hierarchy is how z-order,\nmoving and a later `resize` work on semantic units instead of loose blocks, it\nencodes the reading structure the judge scores (design rules §6.3), and it\nsurvives an `.imgly` round-trip.\n\nGroup **after** positioning: the group's bounding box comes from its children's\nplaced frames.\n\n```js\nconst group = async (ids) =>\n (await engine.design.isGroupable(ids)) ? await engine.design.group(ids) : null;\n\n// 1) group each leaf cluster after it is built + positioned\nconst gHeader = await group([topRule, kickerL, kickerR]);\nconst gHero = await group([title1, title2, tagline]);\nconst gDetail = await group([divider1, divider2, ...detailCells]);\n\n// 2) group the groups → a nested super-cluster (group-of-groups)\nconst gMasthead = await group([gHeader, gHero]);\n```\n\nNever group across pages. Close the build by returning the group manifest in the\nedit `note` (e.g. `groups: masthead=… detail=… lineup=…`) so the hierarchy is\nlegible when you re-ground.\n\n## Known engine defects\n\nCE.SDK errors are short and opaque. Look up a fragment of the error message or\nthe symptom here before bisecting. Branch a `catch` on `e.code`\n(`'BLOCK.UNKNOWN'`, `'DESIGN.*'`), never `instanceof`. Each entry is a defect,\nnot intended behaviour; its workaround goes away once the upstream fix ships.\n\nNone that this host's engine can reach.\n\n<!-- requires:video -->\n**Tracks auto-arrange until you write an offset.** A track places its clips\nback-to-back in child order; writing a clip's `timeOffset` turns that off, and\nevery clip keeps the offset it has (`{{skill:api#video.md}}`).\n<!-- /requires:video -->\n\n## Text doesn't render — diagnosis order\n\nCheap → expensive:\n\n1. **Frame height** — an Absolute height below one line draws nothing (an imported block can arrive that way): use Auto height.\n2. **Position on page** — block within `[0, pageWidth] × [0, pageHeight]`?\n<!-- requires:asset_add -->\n3. **Font URI valid** — was `text.font` declared by `family`, or — for a brand file imported with `asset_add`, or one a saved style's `tokens.json` names by URI — with that `uri`? Never a hand-built typeface with a guessed URI.\n<!-- /requires:asset_add -->\n<!-- unless:asset_add -->\n3. **Font URI valid** — was `text.font` declared by `family`, or with a `uri` you were given? Never a hand-built typeface with a guessed URI.\n<!-- /unless:asset_add -->\n\nIf `measure(id).width` is `0`, the URI didn't deliver a renderable font — look\nthe typeface up by family instead of hardcoding a URI (\"Fonts\" above).\n",
|
|
11
11
|
"docs/api/shapes.md": "# Shapes: compound cutouts, modifiers, stroke paint\n\nA graphic's `shape` spec can combine shapes (`compound`), reshape its path\n(`modifiers`), and its stroke can be painted with a gradient (`stroke.fill`).\nAll three stay vector in PDF and SVG exports.\n\n## Compound shapes: cutouts from primitives\n\nA `compound` combines its `subshapes` in order: the first is the base, each\nlater one combines with the result by `compound.mode`. Use it for notches,\npunched holes, rings and cut corners built from rects, ellipses, stars and\npolygons; draw any other mark as one `vector_path` (`{{skill:api#recipes.md}}`, \"Custom shapes\").\n\n```js\n// A print ticket, 160 × 60 mm in a Millimeter scene: a semicircle notch on each short edge.\nawait engine.design.create(\n {\n type: 'graphic',\n name: 'ticket',\n props: {\n width: 160,\n height: 60,\n fill: { type: 'color', color: { value: INK } },\n shape: {\n type: 'compound',\n compound: { mode: 'Subtract', width: 160, height: 60 },\n subshapes: [\n { type: 'rect', width: 160, height: 60, rect: { cornerRadiusTL: 3, cornerRadiusTR: 3, cornerRadiusBL: 3, cornerRadiusBR: 3 } },\n { type: 'ellipse', width: 12, height: 12, position: { x: -6, y: 24 } },\n { type: 'ellipse', width: 12, height: 12, position: { x: 154, y: 24 } }\n ]\n }\n }\n },\n { parent: page }\n);\n```\n\n- **Coordinates.** Subshapes sit in the compound's box, `compound: { width,\n height }` (default 100 × 100), which is stretched onto the block's frame. Set\n the box to the block's size and every subshape number is in design units.\n A later block resize stretches the whole compound, like a `vector_path`.\n- **Placement** of a subshape: `position` is its top-left corner, `width` and\n `height` its size, `rotation`, `skew` and `skewAxis` are in **radians**\n (like a block's own `rotation`), `scale: { x, y }` is a factor, and\n `anchor: { x, y }` is the point of the subshape (in its own units) that sits\n at `position` and that rotation and scale turn around. Parts outside the\n box draw outside the block's frame; they are not clipped.\n- **Modes:** `Add` unions; `Subtract` removes every later subshape from the\n base; `Intersect` keeps the overlap; `Exclude` keeps what only one covers.\n `Merge` only collects the outlines, and `compound.fillRule` decides overlaps\n (`NonZero` fills them, `EvenOdd` makes them holes).\n- A `line` cannot be a subshape. Compounds nest (a subshape can be a\n compound), and every subshape takes its own `modifiers`.\n- A block's own shape always fills its frame: placement keys (`position`,\n `width`, `rotation`, …) are refused outside `subshapes`.\n\n## Modifiers: repeat, round, offset, zigzag, twist, trim\n\n`modifiers` is a list on any shape spec, applied in order. Each modifier's\noptions sit under a key named after its type.\n\n```js\nawait engine.design.setProps(dot, {\n shape: { modifiers: [{ type: 'repeater', repeater: { copies: 5, positionX: 40 } }] }\n});\nawait engine.design.setProps(badge, {\n shape: { type: 'star', star: { points: 12 }, modifiers: [{ type: 'round_corners', round_corners: { radius: 6 } }] }\n});\n```\n\n| type | options and units |\n| -------------- | --------------------------------------------------------------------------------- |\n| `trim` | `start` and `end` as 0–1 of the path's length, plus a wrapping offset in the same unit; `mode` `Simultaneous` (each subpath) or `Individual` (one after another) |\n| `repeater` | `copies` (whole number); per copy: `positionX/Y` step (design units), `rotation` (radians), `scaleX/Y` (factor), around `anchorX/Y` (design units); its offset shifts by whole copies; `startOpacity`/`endOpacity` 0–1; `composite` `Below`/`Above` |\n| `round_corners`| `radius` (design units) |\n| offset | `amount` (design units, negative shrinks); `join` `Miter`/`Round`/`Bevel`; `miterLimit` |\n| `zigzag` | `size` (amplitude, design units); `ridges` per segment; `pointType` `Corner`/`Smooth` |\n| `pucker_bloat` | `amount` −1 (pucker) … 1 (bloat) |\n| `twist` | `angle` (radians) around `centerX/Y` (design units from the shape's top-left) |\n\nDesign units are measured from the top-left of the block's frame. A shape spec\nof the attached type without `modifiers` keeps them; a `modifiers` list\nreplaces the whole list; `[]` clears it; another shape type drops them.\n\n<!-- requires:video -->\n**Draw-on line.** A `trim` with keyframes on `end` draws a stroke along its\npath — a route on a map, an underline, a signature. Give the block a stroke and\nno fill, and see `{{skill:api#animation.md}}` for the keyframe times:\n\n```js\nawait engine.design.setProps(route, {\n fill: { enabled: false },\n stroke: { enabled: true, width: 6, color: BRAND },\n shape: { modifiers: [{ type: 'trim', trim: { start: 0, end: 0 },\n keyframes: { end: [{ at: 0.3, value: 0 }, { at: 3, value: 1, easing: 'EaseInOut' }] } }] }\n});\n```\n<!-- /requires:video -->\n\n## Stroke paint: `stroke.fill`\n\n`stroke: { fill }` paints the stroke with a `color`, `gradient/linear`,\n`gradient/radial`, `gradient/conical` or `stripe` fill spec instead of\n`stroke.color`; `fill: null` goes back to the colour. Graphic and page blocks\nonly (text strokes take `stroke.color`). A stroke colour with alpha 0 still\nhides the stroke.\n\n```js\nawait engine.design.setProps(frame, {\n stroke: { enabled: true, width: 8, fill: { type: 'gradient/linear', stops: [\n { color: BRAND_A, stop: 0 }, { color: BRAND_B, stop: 1 }] } }\n});\n```\n\n## Print\n\nCompound shapes and modified paths export as vector paths in PDF and SVG, and\na gradient stroke as a PDF shading or an SVG gradient: a cutout made this way\nis a real cut in the artwork, with no raster mask. `{{skill:formats#print.md}}`.\n",
|
|
12
|
-
"docs/api/signatures-extended.d.ts": "// Editor-UI machinery moved out of signatures.d.ts: selection,\n// highlighting, hover, zoom/camera, undo-redo history, scopes,\n// edit-mode/cursor state, asset-source plumbing. Same engine, same\n// classes — these members are for interactive editors, not design\n// generation. Search this file for the member you need.\n// ---- AssetAPI (editor-UI members) ----\n registerApplyMiddleware(middleware: (sourceId: string, assetResult: AssetResult, apply: AssetAPI['apply'], context: ApplyAssetOptions) => Promise<DesignBlockId | undefined>): VoidFunction;\n registerApplyToBlockMiddleware(middleware: (sourceId: string, assetResult: AssetResult, block: DesignBlockId, applyToBlock: AssetAPI['applyToBlock']) => Promise<void>): VoidFunction;\n getGroups(id: string): Promise<string[]>;\n getCredits(sourceId: string): {\n name: string;\n url: string | undefined;\n } | undefined;\n getLicense(sourceId: string): {\n name: string;\n url: string | undefined;\n } | undefined;\n assetSourceContentsChanged(sourceID: string): void;\n// ---- BlockAPI (editor-UI members) ----\n export(handle: DesignBlockId, options?: ExportOptions): Promise<Blob>;\n exportWithColorMask(handle: DesignBlockId, maskColorR: number, maskColorG: number, maskColorB: number, options?: ExportOptions): Promise<Blob[]>;\n exportVideo(handle: DesignBlockId, options?: VideoExportOptions): Promise<Blob>;\n exportAudio(handle: DesignBlockId, options?: AudioExportOptions): Promise<Blob>;\n loadFromString(content: string): Promise<DesignBlockId[]>;\n loadFromArchiveURL(url: string, options?: AbortOptions): Promise<DesignBlockId[]>;\n loadFromURL(url: string, options?: AbortOptions): Promise<DesignBlockId[]>;\n saveToString(blocks: DesignBlockId[], allowedResourceSchemes?: string[], onDisallowedResourceScheme?: (url: string, dataHash: string) => Promise<string>, options?: AbortOptions): Promise<string>;\n saveToArchive(blocks: DesignBlockId[], options?: AbortOptions): Promise<Blob>;\n create(type: DesignBlockType): DesignBlockId;\n createFill(type: FillType): DesignBlockId;\n getAudioTrackCountFromVideo(videoFillBlock: DesignBlockId): number;\n createAudioFromVideo(videoFillBlock: DesignBlockId, trackIndex: number, options?: AudioFromVideoOptions): DesignBlockId;\n createAudiosFromVideo(videoFillBlock: DesignBlockId, options?: AudioFromVideoOptions): DesignBlockId[];\n getAudioInfoFromVideo(videoFillBlock: DesignBlockId): AudioTrackInfo[];\n createCaptionsFromURI(uri: string, options?: AbortOptions): Promise<DesignBlockId[]>;\n getType(id: DesignBlockId): ObjectTypeLonghand;\n getKind(id: DesignBlockId): string;\n setKind(id: DesignBlockId, kind: string): void;\n select(id: DesignBlockId): void;\n setSelected(id: DesignBlockId, selected: boolean): void;\n isSelected(id: DesignBlockId): boolean;\n findAllSelected(): DesignBlockId[];\n isGroupable(ids: DesignBlockId[]): boolean;\n group(ids: DesignBlockId[]): DesignBlockId;\n ungroup(id: DesignBlockId): void;\n setName(id: DesignBlockId, name: string): void;\n getName(id: DesignBlockId): string;\n getUUID(id: DesignBlockId): string;\n findByName(name: string): DesignBlockId[];\n findByType(type: ObjectType): DesignBlockId[];\n findAllPlaceholders(): DesignBlockId[];\n createShape(type: ShapeType): DesignBlockId;\n /** @deprecated Use supportsShape instead. */\n hasShape(id: DesignBlockId): boolean;\n supportsShape(id: DesignBlockId): boolean;\n getShape(id: DesignBlockId): DesignBlockId;\n setShape(id: DesignBlockId, shape: DesignBlockId): void;\n getSubshapes(id: DesignBlockId): DesignBlockId[];\n insertSubshape(id: DesignBlockId, subshapeId: DesignBlockId, index: number): void;\n appendSubshape(id: DesignBlockId, subshapeId: DesignBlockId): void;\n isVisible(id: DesignBlockId): boolean;\n setVisible(id: DesignBlockId, visible: boolean): void;\n isClipped(id: DesignBlockId): boolean;\n setClipped(id: DesignBlockId, clipped: boolean): void;\n setKeyframes(id: DesignBlockId, property: string, keyframes: Keyframe_2[], mode?: TrackMode): void;\n getKeyframes(id: DesignBlockId, property: string): Keyframe_2[];\n getKeyframeMode(id: DesignBlockId, property: string): TrackMode;\n removeKeyframes(id: DesignBlockId, property: string): void;\n getAnimatedProperties(id: DesignBlockId): string[];\n isPropertyAnimatable(id: DesignBlockId, property: string): boolean;\n getMatte(id: DesignBlockId): BlockMatte | null;\n setMatte(id: DesignBlockId, source: DesignBlockId | null, mode?: MatteMode): void;\n isTransformLocked(id: DesignBlockId): boolean;\n setTransformLocked(id: DesignBlockId, locked: boolean): void;\n getPositionX(id: DesignBlockId): number;\n getPositionXMode(id: DesignBlockId): PositionXMode;\n getPositionY(id: DesignBlockId): number;\n getPositionYMode(id: DesignBlockId): PositionYMode;\n setPositionX(id: DesignBlockId, value: number): void;\n setPositionXMode(id: DesignBlockId, mode: PositionXMode): void;\n setPositionY(id: DesignBlockId, value: number): void;\n setPositionYMode(id: DesignBlockId, mode: PositionYMode): void;\n setAlwaysOnTop(id: DesignBlockId, enabled: boolean): void;\n setAlwaysOnBottom(id: DesignBlockId, enabled: boolean): void;\n isAlwaysOnTop(id: DesignBlockId): boolean;\n isAlwaysOnBottom(id: DesignBlockId): boolean;\n bringToFront(id: DesignBlockId): void;\n sendToBack(id: DesignBlockId): void;\n bringForward(id: DesignBlockId): void;\n sendBackward(id: DesignBlockId): void;\n getRotation(id: DesignBlockId): number;\n setRotation(id: DesignBlockId, radians: number): void;\n getFlipHorizontal(id: DesignBlockId): boolean;\n getFlipVertical(id: DesignBlockId): boolean;\n setFlipHorizontal(id: DesignBlockId, flip: boolean): void;\n setFlipVertical(id: DesignBlockId, flip: boolean): void;\n /** @deprecated Use supportsContentFillMode instead. */\n hasContentFillMode(id: DesignBlockId): boolean;\n supportsContentFillMode(id: DesignBlockId): boolean;\n getWidth(id: DesignBlockId): number;\n getWidthMode(id: DesignBlockId): WidthMode;\n getHeight(id: DesignBlockId): number;\n getHeightMode(id: DesignBlockId): HeightMode;\n setSize(id: DesignBlockId, width: number, height: number, options?: {\n maintainCrop?: boolean;\n sizeMode?: SizeMode;\n }): void;\n setPosition(id: DesignBlockId, x: number, y: number, options?: {\n positionMode?: PositionMode;\n }): void;\n setWidth(id: DesignBlockId, value: number, maintainCrop?: boolean): void;\n setWidthMode(id: DesignBlockId, mode: WidthMode): void;\n setHeight(id: DesignBlockId, value: number, maintainCrop?: boolean): void;\n setHeightMode(id: DesignBlockId, mode: HeightMode): void;\n getFrameX(id: DesignBlockId): number;\n getFrameY(id: DesignBlockId): number;\n getFrameWidth(id: DesignBlockId): number;\n getFrameHeight(id: DesignBlockId): number;\n setContentFillMode(id: DesignBlockId, mode: ContentFillMode): void;\n getContentFillMode(id: DesignBlockId): ContentFillMode;\n setContentFillHorizontalAlignment(id: DesignBlockId, alignment: HorizontalContentFillAlignment): void;\n getContentFillHorizontalAlignment(id: DesignBlockId): HorizontalContentFillAlignment;\n setContentFillVerticalAlignment(id: DesignBlockId, alignment: VerticalContentFillAlignment): void;\n getContentFillVerticalAlignment(id: DesignBlockId): VerticalContentFillAlignment;\n duplicate(id: DesignBlockId, attachToParent?: boolean): DesignBlockId;\n destroy(id: DesignBlockId): void;\n getParent(id: DesignBlockId): DesignBlockId | null;\n setTransformParent(id: DesignBlockId, parent: DesignBlockId | null): void;\n getTransformParent(id: DesignBlockId): DesignBlockId | null;\n hasTransformAnchor(id: DesignBlockId): boolean;\n getChildren(id: DesignBlockId): DesignBlockId[];\n insertChild(parent: DesignBlockId, child: DesignBlockId, index: number): void;\n appendChild(parent: DesignBlockId, child: DesignBlockId): void;\n referencesAnyVariables(id: DesignBlockId): boolean;\n setVariableBinding(id: DesignBlockId, property: string, key: string): void;\n getVariableBinding(id: DesignBlockId, property: string): string | null;\n removeVariableBinding(id: DesignBlockId, property: string): void;\n findAllVariableBindings(id: DesignBlockId): string[];\n getGlobalBoundingBoxX(id: DesignBlockId): number;\n getGlobalBoundingBoxY(id: DesignBlockId): number;\n getGlobalBoundingBoxWidth(id: DesignBlockId): number;\n getGlobalBoundingBoxHeight(id: DesignBlockId): number;\n alignHorizontally(ids: DesignBlockId[], horizontalBlockAlignment: TextHorizontalAlignment): void;\n alignVertically(ids: DesignBlockId[], verticalBlockAlignment: TextVerticalAlignment): void;\n isAlignable(ids: DesignBlockId[]): boolean;\n distributeHorizontally(ids: DesignBlockId[]): void;\n distributeVertically(ids: DesignBlockId[]): void;\n isDistributable(ids: DesignBlockId[]): boolean;\n fillParent(id: DesignBlockId): void;\n resizeContentAware(ids: DesignBlockId[], width: number, height: number): void;\n scale(id: DesignBlockId, scale: number, anchorX?: number, anchorY?: number): void;\n findAllProperties(id: DesignBlockId): string[];\n setBool(id: DesignBlockId, property: BoolPropertyName, value: boolean): void;\n getBool(id: DesignBlockId, property: BoolPropertyName): boolean;\n setInt(id: DesignBlockId, property: IntPropertyName, value: number): void;\n getInt(id: DesignBlockId, property: IntPropertyName): number;\n setFloat(id: DesignBlockId, property: FloatPropertyName, value: number): void;\n getFloat(id: DesignBlockId, property: FloatPropertyName): number;\n setDouble(id: DesignBlockId, property: DoublePropertyName, value: number): void;\n getDouble(id: DesignBlockId, property: DoublePropertyName): number;\n setVec2(id: DesignBlockId, property: Vec2PropertyName, value: Vec2): void;\n getVec2(id: DesignBlockId, property: Vec2PropertyName): Vec2;\n setString(id: DesignBlockId, property: StringPropertyName, value: string): void;\n getString(id: DesignBlockId, property: StringPropertyName): string;\n setColor(id: DesignBlockId, property: ColorPropertyName, value: Color): void;\n getColor(id: DesignBlockId, property: ColorPropertyName): Color;\n /** @deprecated Use setColor() instead. */\n setColorRGBA(id: DesignBlockId, property: string, r: number, g: number, b: number, a?: number): void;\n /** @deprecated Use getColor() instead. */\n getColorRGBA(id: DesignBlockId, property: string): RGBA;\n /** @deprecated Use setColor() instead. */\n setColorSpot(id: DesignBlockId, property: string, name: string, tint?: number): void;\n setGradientColorStops(id: DesignBlockId, property: string, colors: GradientColorStop[]): void;\n getGradientColorStops(id: DesignBlockId, property: string): GradientColorStop[];\n getSourceSet(id: DesignBlockId, property: SourceSetPropertyName): Source[];\n setSourceSet(id: DesignBlockId, property: SourceSetPropertyName, sourceSet: Source[]): void;\n addImageFileURIToSourceSet(id: DesignBlockId, property: SourceSetPropertyName, uri: string, options?: AbortOptions): Promise<void>;\n setEnum<T extends keyof BlockEnumType>(id: DesignBlockId, property: T, value: BlockEnumType[T]): void;\n setEnum(id: DesignBlockId, property: string, value: string): void;\n getEnum<T extends keyof BlockEnumType>(id: DesignBlockId, property: T): BlockEnumType[T];\n getEnum(id: DesignBlockId, property: string): string;\n /** @deprecated Use supportsCrop() instead. */\n hasCrop(id: DesignBlockId): boolean;\n supportsCrop(id: DesignBlockId): boolean;\n setCropScaleX(id: DesignBlockId, scaleX: number): void;\n setCropScaleY(id: DesignBlockId, scaleY: number): void;\n setCropRotation(id: DesignBlockId, rotation: number): void;\n setCropScaleRatio(id: DesignBlockId, scaleRatio: number): void;\n setCropTranslationX(id: DesignBlockId, translationX: number): void;\n setCropTranslationY(id: DesignBlockId, translationY: number): void;\n resetCrop(id: DesignBlockId): void;\n getCropScaleX(id: DesignBlockId): number;\n getCropScaleY(id: DesignBlockId): number;\n getCropRotation(id: DesignBlockId): number;\n getCropScaleRatio(id: DesignBlockId): number;\n getCropTranslationX(id: DesignBlockId): number;\n getCropTranslationY(id: DesignBlockId): number;\n adjustCropToFillFrame(id: DesignBlockId, minScaleRatio: number): number;\n flipCropHorizontal(id: DesignBlockId): void;\n flipCropVertical(id: DesignBlockId): void;\n setCropAspectRatioLocked(id: DesignBlockId, locked: boolean): void;\n /** @deprecated Use supportsOpacity() instead. */\n hasOpacity(id: DesignBlockId): boolean;\n supportsOpacity(id: DesignBlockId): boolean;\n setOpacity(id: DesignBlockId, opacity: number): void;\n getOpacity(id: DesignBlockId): number;\n /** @deprecated Use supportsBlendMode() instead. */\n hasBlendMode(id: DesignBlockId): boolean;\n supportsBlendMode(id: DesignBlockId): boolean;\n setBlendMode(id: DesignBlockId, blendMode: BlendMode): void;\n getBlendMode(id: DesignBlockId): BlendMode;\n /** @deprecated Query the fill's type using getFill() and getType() instead. */\n hasFillColor(id: DesignBlockId): boolean;\n isIncludedInExport(id: DesignBlockId): boolean;\n setIncludedInExport(id: DesignBlockId, enabled: boolean): void;\n /** @deprecated Use setFillSolidColor() instead. */\n setFillColorRGBA(id: DesignBlockId, r: number, g: number, b: number, a?: number): void;\n /** @deprecated Use getFillSolidColor() instead. */\n getFillColorRGBA(id: DesignBlockId): RGBA;\n /** @deprecated Use setFillEnabled() instead. */\n setFillColorEnabled(id: DesignBlockId, enabled: boolean): void;\n /** @deprecated Use isFillEnabled() instead. */\n isFillColorEnabled(id: DesignBlockId): boolean;\n createEffect(type: EffectType): DesignBlockId;\n /** @deprecated Use supportsEffects instead. */\n hasEffects(id: DesignBlockId): boolean;\n supportsEffects(id: DesignBlockId): boolean;\n getEffects(id: DesignBlockId): DesignBlockId[];\n insertEffect(id: DesignBlockId, effectId: DesignBlockId, index: number): void;\n appendEffect(id: DesignBlockId, effectId: DesignBlockId): void;\n removeEffect(id: DesignBlockId, index: number): void;\n createTextAnimator(): DesignBlockId;\n supportsTextAnimators(id: DesignBlockId): boolean;\n getTextAnimators(id: DesignBlockId): DesignBlockId[];\n insertTextAnimator(id: DesignBlockId, animatorId: DesignBlockId, index: number): void;\n appendTextAnimator(id: DesignBlockId, animatorId: DesignBlockId): void;\n removeTextAnimator(id: DesignBlockId, index: number): void;\n createModifier(type: ModifierType): DesignBlockId;\n supportsModifiers(id: DesignBlockId): boolean;\n getModifiers(id: DesignBlockId): DesignBlockId[];\n insertModifier(id: DesignBlockId, modifierId: DesignBlockId, index: number): void;\n appendModifier(id: DesignBlockId, modifierId: DesignBlockId): void;\n /** @deprecated Calls to this function can be removed. All effects can be enabled and disabled. */\n hasEffectEnabled(effectId: DesignBlockId): boolean;\n setEffectEnabled(effectId: DesignBlockId, enabled: boolean): void;\n createMask(): DesignBlockId;\n supportsMasks(id: DesignBlockId): boolean;\n getMasks(id: DesignBlockId): DesignBlockId[];\n insertMask(id: DesignBlockId, maskId: DesignBlockId, index: number): void;\n appendMask(id: DesignBlockId, maskId: DesignBlockId): void;\n removeMask(id: DesignBlockId, index: number): void;\n setEffectSource(effectId: DesignBlockId, source: DesignBlockId | null): void;\n getEffectSource(effectId: DesignBlockId): DesignBlockId | null;\n createBlur(type: BlurType): DesignBlockId;\n /** @deprecated Use supportsBlur instead. */\n hasBlur(id: DesignBlockId): boolean;\n supportsBlur(id: DesignBlockId): boolean;\n setBlur(id: DesignBlockId, blurId: DesignBlockId): void;\n getBlur(id: DesignBlockId): DesignBlockId;\n setBlurEnabled(id: DesignBlockId, enabled: boolean): void;\n isBlurEnabled(id: DesignBlockId): boolean;\n /** @deprecated Use supportsBackgroundColor() instead. */\n hasBackgroundColor(id: DesignBlockId): boolean;\n supportsBackgroundColor(id: DesignBlockId): boolean;\n /** @deprecated Use `Use setColor() with the key path 'backgroundColor/color' instead.`. */\n setBackgroundColorRGBA(id: DesignBlockId, r: number, g: number, b: number, a?: number): void;\n /** @deprecated Use `Use getColor() with the key path 'backgroundColor/color' instead.`. */\n getBackgroundColorRGBA(id: DesignBlockId): RGBA;\n setBackgroundColorEnabled(id: DesignBlockId, enabled: boolean): void;\n isBackgroundColorEnabled(id: DesignBlockId): boolean;\n /** @deprecated Use supportsStroke() instead. */\n hasStroke(id: DesignBlockId): boolean;\n supportsStroke(id: DesignBlockId): boolean;\n setStrokeEnabled(id: DesignBlockId, enabled: boolean): void;\n isStrokeEnabled(id: DesignBlockId): boolean;\n setStrokeOverprint(id: DesignBlockId, overprint: boolean): void;\n getStrokeOverprint(id: DesignBlockId): boolean;\n /** @deprecated Use setStrokeColor() instead. */\n setStrokeColorRGBA(id: DesignBlockId, r: number, g: number, b: number, a?: number): void;\n setStrokeColor(id: DesignBlockId, color: Color): void;\n /** @deprecated Use getStrokeColor() instead. */\n getStrokeColorRGBA(id: DesignBlockId): RGBA;\n getStrokeColor(id: DesignBlockId): Color;\n setStrokeWidth(id: DesignBlockId, width: number): void;\n getStrokeWidth(id: DesignBlockId): number;\n setStrokeStyle(id: DesignBlockId, style: StrokeStyle): void;\n getStrokeStyle(id: DesignBlockId): StrokeStyle;\n setStrokePosition(id: DesignBlockId, position: StrokePosition): void;\n getStrokePosition(id: DesignBlockId): StrokePosition;\n setStrokeCornerGeometry(id: DesignBlockId, cornerGeometry: StrokeCornerGeometry): void;\n getStrokeCornerGeometry(id: DesignBlockId): StrokeCornerGeometry;\n /** @deprecated Use `setStrokeStartCap` and `setStrokeEndCap` to set each end independently. */\n setStrokeCap(id: DesignBlockId, cap: StrokeCap): void;\n /** @deprecated Use `getStrokeStartCap` and `getStrokeEndCap` instead. */\n getStrokeCap(id: DesignBlockId): StrokeCap;\n setStrokeStartCap(id: DesignBlockId, cap: StrokeCap): void;\n getStrokeStartCap(id: DesignBlockId): StrokeCap;\n setStrokeEndCap(id: DesignBlockId, cap: StrokeCap): void;\n getStrokeEndCap(id: DesignBlockId): StrokeCap;\n setStrokeDashStartCap(id: DesignBlockId, cap: StrokeCap): void;\n getStrokeDashStartCap(id: DesignBlockId): StrokeCap;\n setStrokeDashEndCap(id: DesignBlockId, cap: StrokeCap): void;\n getStrokeDashEndCap(id: DesignBlockId): StrokeCap;\n setStrokeDashArray(id: DesignBlockId, dashArray: number[]): void;\n getStrokeDashArray(id: DesignBlockId): number[];\n setStrokeDashOffset(id: DesignBlockId, dashOffset: number): void;\n getStrokeDashOffset(id: DesignBlockId): number;\n /** @deprecated Use supportsDropShadow() instead. */\n hasDropShadow(id: DesignBlockId): boolean;\n supportsDropShadow(id: DesignBlockId): boolean;\n setDropShadowEnabled(id: DesignBlockId, enabled: boolean): void;\n isDropShadowEnabled(id: DesignBlockId): boolean;\n /** @deprecated Use setDropShadowColor() instead. */\n setDropShadowColorRGBA(id: DesignBlockId, r: number, g: number, b: number, a?: number): void;\n setDropShadowColor(id: DesignBlockId, color: Color): void;\n /** @deprecated Use getDropShadowColor instead. */\n getDropShadowColorRGBA(id: DesignBlockId): RGBA;\n getDropShadowColor(id: DesignBlockId): Color;\n setDropShadowOffsetX(id: DesignBlockId, offsetX: number): void;\n getDropShadowOffsetX(id: DesignBlockId): number;\n setDropShadowOffsetY(id: DesignBlockId, offsetY: number): void;\n getDropShadowOffsetY(id: DesignBlockId): number;\n setDropShadowBlurRadiusX(id: DesignBlockId, blurRadiusX: number): void;\n getDropShadowBlurRadiusX(id: DesignBlockId): number;\n setDropShadowBlurRadiusY(id: DesignBlockId, blurRadiusY: number): void;\n getDropShadowBlurRadiusY(id: DesignBlockId): number;\n setDropShadowClip(id: DesignBlockId, clip: boolean): void;\n getDropShadowClip(id: DesignBlockId): boolean;\n replaceText(id: DesignBlockId, text: string, from?: number, to?: number): void;\n setTextColor(id: DesignBlockId, color: Color, from?: number, to?: number): void;\n getTextColors(id: DesignBlockId, from?: number, to?: number): Array<Color>;\n setTextFontWeight(id: DesignBlockId, fontWeight: FontWeight, from?: number, to?: number): void;\n getTextFontWeights(id: DesignBlockId, from?: number, to?: number): FontWeight[];\n setTextFontSize(id: DesignBlockId, fontSize: number, options?: TextFontSizeOptions): void;\n getTextFontSizes(id: DesignBlockId, options?: TextFontSizeOptions): number[];\n setTextFontStyle(id: DesignBlockId, fontStyle: FontStyle, from?: number, to?: number): void;\n getTextFontStyles(id: DesignBlockId, from?: number, to?: number): FontStyle[];\n getTextCases(id: DesignBlockId, from?: number, to?: number): TextCase[];\n setTextCase(id: DesignBlockId, textCase: TextCase, from?: number, to?: number): void;\n setTextDecoration(id: DesignBlockId, config: TextDecorationConfig, from?: number, to?: number): void;\n setTextKerning(id: DesignBlockId, kerning: number, from?: number, to?: number): void;\n getTextKernings(id: DesignBlockId, from?: number, to?: number): number[];\n setTextBaselineShift(id: DesignBlockId, baselineShift: number, from?: number, to?: number): void;\n getTextBaselineShifts(id: DesignBlockId, from?: number, to?: number): number[];\n toggleTextDecorationUnderline(id: DesignBlockId, from?: number, to?: number): void;\n toggleTextDecorationStrikethrough(id: DesignBlockId, from?: number, to?: number): void;\n toggleTextDecorationOverline(id: DesignBlockId, from?: number, to?: number): void;\n getTextHorizontalAlignment(id: DesignBlockId, paragraphIndex?: number): TextHorizontalAlignment | undefined;\n setTextHorizontalAlignment(id: DesignBlockId, alignment: TextHorizontalAlignment | undefined, paragraphIndex?: number): void;\n getTextListStyle(id: DesignBlockId, paragraphIndex: number): ListStyle;\n setTextListStyle(id: DesignBlockId, listStyle: ListStyle, paragraphIndex?: number, listLevel?: number): void;\n getTextListLevel(id: DesignBlockId, paragraphIndex: number): number;\n setTextListLevel(id: DesignBlockId, listLevel: number, paragraphIndex?: number): void;\n getTextParagraphIndices(id: DesignBlockId, from?: number, to?: number): number[];\n setTextLineHeight(id: DesignBlockId, lineHeight: number | null, paragraphIndex?: number): void;\n getTextLineHeight(id: DesignBlockId, paragraphIndex: number): number;\n toggleBoldFont(id: DesignBlockId, from?: number, to?: number): void;\n toggleItalicFont(id: DesignBlockId, from?: number, to?: number): void;\n setFont(id: DesignBlockId, fontFileUri: string, typeface: Typeface): void;\n setTypeface(id: DesignBlockId, typeface: Typeface, from?: number, to?: number): void;\n getTypeface(id: DesignBlockId): Typeface;\n getTypefaces(id: DesignBlockId, from?: number, to?: number): Typeface[];\n getTextRuns(id: DesignBlockId, from?: number, to?: number): TextRunInfo[];\n getTextVisibleLineCount(id: DesignBlockId): number;\n getTextVisibleLineContent(id: DesignBlockId, lineIndex: number): string;\n getTextCharacterInkBoxes(id: DesignBlockId, from?: number, to?: number): CharacterInkBox[];\n setTextOnPath(id: DesignBlockId, svgPath: string | null): void;\n getTextOnPath(id: DesignBlockId): string | null;\n setTextOnPathOffset(id: DesignBlockId, offset: number): void;\n getTextOnPathOffset(id: DesignBlockId): number;\n setTextOnPathFlipped(id: DesignBlockId, flipped: boolean): void;\n getTextOnPathFlipped(id: DesignBlockId): boolean;\n /** @deprecated Use supportsFill instead. */\n hasFill(id: DesignBlockId): boolean;\n supportsFill(id: DesignBlockId): boolean;\n isFillEnabled(id: DesignBlockId): boolean;\n setFillEnabled(id: DesignBlockId, enabled: boolean): void;\n getFillOverprint(id: DesignBlockId): boolean;\n setFillOverprint(id: DesignBlockId, overprint: boolean): void;\n getFill(id: DesignBlockId): DesignBlockId;\n setFill(id: DesignBlockId, fill: DesignBlockId): void;\n getStrokeFill(id: DesignBlockId): DesignBlockId | null;\n setStrokeFill(id: DesignBlockId, fill: DesignBlockId | null): void;\n setFillSolidColor(id: DesignBlockId, r: number, g: number, b: number, a?: number): void;\n getFillSolidColor(id: DesignBlockId): RGBA;\n setPlaceholderEnabled(id: DesignBlockId, enabled: boolean): void;\n isPlaceholderEnabled(id: DesignBlockId): boolean;\n /** @deprecated Use supportsPlaceholderBehavior instead. */\n hasPlaceholderBehavior(id: DesignBlockId): boolean;\n supportsPlaceholderBehavior(id: DesignBlockId): boolean;\n setPlaceholderBehaviorEnabled(id: DesignBlockId, enabled: boolean): void;\n isPlaceholderBehaviorEnabled(id: DesignBlockId): boolean;\n /** @deprecated Use supportsPlaceholderControls instead. */\n hasPlaceholderControls(id: DesignBlockId): boolean;\n supportsPlaceholderControls(id: DesignBlockId): boolean;\n setPlaceholderControlsOverlayEnabled(id: DesignBlockId, enabled: boolean): void;\n setPlaceholderControlsButtonEnabled(id: DesignBlockId, enabled: boolean): void;\n setMetadata(id: DesignBlockId, key: string, value: string): void;\n getMetadata(id: DesignBlockId, key: string): string;\n hasMetadata(id: DesignBlockId, key: string): boolean;\n findAllMetadata(id: DesignBlockId): string[];\n removeMetadata(id: DesignBlockId, key: string): void;\n setScopeEnabled(id: DesignBlockId, key: Scope, enabled: boolean): void;\n isScopeEnabled(id: DesignBlockId, key: Scope): boolean;\n isAllowedByScope(id: DesignBlockId, key: Scope): boolean;\n /** @deprecated Use supportsDuration instead. */\n hasDuration(id: DesignBlockId): boolean;\n supportsDuration(id: DesignBlockId): boolean;\n setDuration(id: DesignBlockId, duration: number): void;\n getDuration(id: DesignBlockId): number;\n supportsPageDurationSource(page: DesignBlockId, id: DesignBlockId): boolean;\n /** @deprecated Use supportsTimeOffset instead. */\n hasTimeOffset(id: DesignBlockId): boolean;\n supportsTimeOffset(id: DesignBlockId): boolean;\n setTimeOffset(id: DesignBlockId, offset: number): void;\n getTimeOffset(id: DesignBlockId): number;\n /** @deprecated Use supportsTrim instead. */\n hasTrim(id: DesignBlockId): boolean;\n supportsTrim(id: DesignBlockId): boolean;\n setTrimOffset(id: DesignBlockId, offset: number): void;\n getTrimOffset(id: DesignBlockId): number;\n setTrimLength(id: DesignBlockId, length: number): void;\n getTrimLength(id: DesignBlockId): number;\n setPlaying(id: DesignBlockId, enabled: boolean): void;\n isPlaying(id: DesignBlockId): boolean;\n /** @deprecated Use supportsPlaybackTime instead. */\n hasPlaybackTime(id: DesignBlockId): boolean;\n supportsPlaybackTime(id: DesignBlockId): boolean;\n setPlaybackTime(id: DesignBlockId, time: number): void;\n getPlaybackTime(id: DesignBlockId): number;\n setSoloPlaybackEnabled(id: DesignBlockId, enabled: boolean): void;\n isSoloPlaybackEnabled(id: DesignBlockId): boolean;\n /** @deprecated Use supportsPlaybackControl instead */\n hasPlaybackControl(id: DesignBlockId): boolean;\n supportsPlaybackControl(id: DesignBlockId): boolean;\n setLooping(id: DesignBlockId, looping: boolean): void;\n isLooping(id: DesignBlockId): boolean;\n setMuted(id: DesignBlockId, muted: boolean): void;\n isMuted(id: DesignBlockId): boolean;\n setVolume(id: DesignBlockId, volume: number): void;\n getVolume(id: DesignBlockId): number;\n setPlaybackSpeed(id: DesignBlockId, speed: number): void;\n getPlaybackSpeed(id: DesignBlockId): number;\n forceLoadAVResource(id: DesignBlockId, options?: AbortOptions): Promise<void>;\n getAVResourceTotalDuration(id: DesignBlockId): number;\n generateAudioThumbnailSequence(id: DesignBlockId, samplesPerChunk: number, timeBegin: number, timeEnd: number, numberOfSamples: number, numberOfChannels: number, onChunk: (chunkIndex: number, result: Float32Array | Error) => void): () => void;\n createAnimation(type: AnimationType): DesignBlockId;\n supportsAnimation(id: DesignBlockId): boolean;\n setInAnimation(id: DesignBlockId, animation: DesignBlockId): void;\n setLoopAnimation(id: DesignBlockId, animation: DesignBlockId): void;\n setOutAnimation(id: DesignBlockId, animation: DesignBlockId): void;\n getInAnimation(id: DesignBlockId): DesignBlockId;\n getLoopAnimation(id: DesignBlockId): DesignBlockId;\n getOutAnimation(id: DesignBlockId): DesignBlockId;\n createTransition(type: TransitionType): DesignBlockId;\n supportsTransition(id: DesignBlockId): boolean;\n setTransition(id: DesignBlockId, transition: DesignBlockId): void;\n removeTransition(id: DesignBlockId): void;\n getTransition(id: DesignBlockId): DesignBlockId;\n forceLoadResources(ids: DesignBlockId[], options?: AbortOptions): Promise<void>;\n// ---- EditorAPI (editor-UI members) ----\n setEditMode(mode: EditMode, baseMode?: string): void;\n getEditMode(): EditMode;\n hasSelectedVectorNode(): boolean;\n hasSelectedVectorControlPoint(): boolean;\n getCursorType(): 'Arrow' | 'Move' | 'MoveNotPermitted' | 'Resize' | 'Rotate' | 'Text' | 'Cell';\n getCursorRotation(): number;\n createHistory(): HistoryId;\n destroyHistory(history: HistoryId): void;\n setActiveHistory(history: HistoryId): void;\n getActiveHistory(): HistoryId;\n addUndoStep(): void;\n undo(): void;\n redo(): void;\n canUndo(): boolean;\n canRedo(): boolean;\n findAllScopes(): Scope[];\n setGlobalScope(key: Scope, value: 'Allow' | 'Deny' | 'Defer'): void;\n getGlobalScope(key: Scope): 'Allow' | 'Deny' | 'Defer';\n isHighlightingEnabled(id: DesignBlockId): boolean;\n setHighlightingEnabled(id: DesignBlockId, enabled: boolean): void;\n isSelectionEnabled(id: DesignBlockId): boolean;\n setSelectionEnabled(id: DesignBlockId, enabled: boolean): void;\n getMovementConstraint(id: DesignBlockId): ResolvedMovementConstraint;\n// ---- SceneAPI (editor-UI members) ----\n loadFromString(sceneContent: string, options?: LoadSceneOptions): Promise<DesignBlockId>;\n loadFromString(sceneContent: string, overrideEditorConfig?: boolean, waitForResources?: boolean): Promise<DesignBlockId>;\n loadFromURL(url: string, options?: LoadSceneOptions): Promise<DesignBlockId>;\n loadFromURL(url: string, overrideEditorConfig?: boolean, waitForResources?: boolean): Promise<DesignBlockId>;\n loadFromArchiveURL(url: string, options?: LoadSceneOptions): Promise<DesignBlockId>;\n loadFromArchiveURL(url: string, overrideEditorConfig?: boolean, waitForResources?: boolean): Promise<DesignBlockId>;\n saveToString(options?: {\n allowedResourceSchemes?: string[];\n onDisallowedResourceScheme?: (url: string, dataHash: string) => Promise<string>;\n compression?: {\n format?: CompressionFormat_2;\n level?: CompressionLevel;\n };\n abortSignal?: AbortSignal;\n }): Promise<string>;\n saveToArchive(options?: SaveToArchiveOptions): Promise<Blob>;\n create(sceneLayout?: SceneLayout, options?: CreateSceneOptions): DesignBlockId;\n setZoomLevel(zoomLevel?: number): void;\n getZoomLevel(): number;\n zoomToBlock(id: DesignBlockId, options?: ZoomOptions): Promise<void>;\n enableZoomAutoFit(id: DesignBlockId, axis: 'Horizontal' | 'Vertical', paddingBefore?: number, paddingAfter?: number): void;\n enableZoomAutoFit(id: DesignBlockId, axis: 'Both', paddingLeft?: number, paddingTop?: number, paddingRight?: number, paddingBottom?: number): void;\n disableZoomAutoFit(blockOrScene: DesignBlockId): void;\n isZoomAutoFitEnabled(blockOrScene: DesignBlockId): boolean;\n unstable_enableCameraZoomClamping(ids: DesignBlockId[], minZoomLimit?: number, maxZoomLimit?: number, paddingLeft?: number, paddingTop?: number, paddingRight?: number, paddingBottom?: number): void;\n unstable_disableCameraZoomClamping(blockOrScene?: number | null): void;\n unstable_isCameraZoomClampingEnabled(blockOrScene?: number | null): boolean;\n setPlaying(play: boolean): void;\n// ---- VariableAPI (editor-UI members) ----\n setString(key: string, value: string): void;\n getString(key: string): string;\n setColor(key: string, value: Color): void;\n getColor(key: string): Color;\n setTypeface(key: string, typeface: Typeface): void;\n getTypeface(key: string): Typeface;\n getType(key: string): VariableType;\n\n// ---- types referenced only by extended members ----\ninterface AssetResultCredits {\n name: string;\n url: string;\n}\ninterface AssetResultLicense {\n name: string;\n url: string;\n}\ntype AudioExportOptions = {\n mimeType?: AudioMimeType;\n onProgress?: (numberOfRenderedFrames: number, numberOfEncodedFrames: number, totalNumberOfFrames: number) => void;\n timeOffset?: number;\n duration?: number;\n sampleRate?: number;\n numberOfChannels?: number;\n skipEncoding?: boolean;\n audioCodec?: AudioCodec;\n abortSignal?: AbortSignal;\n};\ntype AudioFromVideoOptions = {\n keepTrimSettings?: boolean;\n muteOriginalVideo?: boolean;\n};\ninterface AudioTrackInfo {\n audioCodec: string;\n channels: number;\n sampleRate: number;\n audioDuration: number;\n numAudioPackets: number;\n numAudioFrames: number;\n trackName: string;\n trackIndex: number;\n language: string;\n}\ntype BlockEnumType = {\n 'blend/mode': BlendMode;\n 'contentFill/horizontalAlignment': HorizontalContentFillAlignment;\n 'contentFill/mode': ContentFillMode;\n 'contentFill/verticalAlignment': VerticalContentFillAlignment;\n 'height/mode': HeightMode;\n 'position/x/mode': PositionXMode;\n 'position/y/mode': PositionYMode;\n 'scene/angleUnit': SceneAngleUnit;\n 'scene/colorConversionMode': SceneColorConversionMode;\n 'scene/designUnit': DesignUnit;\n 'scene/fontSizeUnit': FontSizeUnit;\n 'scene/layout': SceneLayout;\n 'scene/mode': SceneMode;\n 'width/mode': WidthMode;\n 'page/guides/source': PageGuidesSource;\n 'stroke/cap': StrokeCap;\n 'stroke/cornerGeometry': StrokeCornerGeometry;\n 'stroke/dashEndCap': StrokeDashEndCap;\n 'stroke/dashStartCap': StrokeDashStartCap;\n 'stroke/endCap': StrokeEndCap;\n 'stroke/position': StrokePosition;\n 'stroke/startCap': StrokeStartCap;\n 'stroke/style': StrokeStyle;\n 'playback/fadeIn/easing': PlaybackFadeInEasing;\n 'playback/fadeOut/easing': PlaybackFadeOutEasing;\n 'text/horizontalAlignment': TextHorizontalAlignment;\n 'text/verticalAlignment': TextVerticalAlignment;\n 'cutout/type': CutoutType;\n 'caption/horizontalAlignment': CaptionHorizontalAlignment;\n 'caption/verticalAlignment': CaptionVerticalAlignment;\n animationEasing: AnimationEasing;\n textAnimationWritingStyle: TextAnimationWritingStyle;\n 'animation/grow/direction': AnimationGrowDirection;\n 'animation/wipe/direction': AnimationWipeDirection;\n 'animation/baseline/direction': AnimationBaselineDirection;\n 'animation/spin/direction': AnimationSpinDirection;\n 'animation/spin_loop/direction': AnimationSpinLoopDirection;\n 'animation/jump_loop/direction': AnimationJumpLoopDirection;\n 'animation/typewriter_text/writingStyle': AnimationTypewriterTextWritingStyle;\n 'animation/block_swipe_text/direction': AnimationBlockSwipeTextDirection;\n 'animation/merge_text/direction': AnimationMergeTextDirection;\n 'animation/ken_burns/direction': AnimationKenBurnsDirection;\n 'blur/uniform/mode': BlurUniformMode;\n 'modifier/trim/mode': ModifierTrimMode;\n 'modifier/repeater/composite': ModifierRepeaterComposite;\n 'modifier/offset/join': ModifierOffsetJoin;\n 'modifier/zigzag/pointType': ModifierZigzagPointType;\n 'effect/displacement_map/horizontalChannel': EffectDisplacementMapHorizontalChannel;\n 'effect/displacement_map/mapBehavior': EffectDisplacementMapMapBehavior;\n 'effect/displacement_map/verticalChannel': EffectDisplacementMapVerticalChannel;\n 'effect/invert/channel': EffectInvertChannel;\n 'effect/radial_wipe/direction': EffectRadialWipeDirection;\n 'effect/shift_channels/takeAlphaFrom': EffectShiftChannelsTakeAlphaFrom;\n 'effect/shift_channels/takeBlueFrom': EffectShiftChannelsTakeBlueFrom;\n 'effect/shift_channels/takeGreenFrom': EffectShiftChannelsTakeGreenFrom;\n 'effect/shift_channels/takeRedFrom': EffectShiftChannelsTakeRedFrom;\n 'effect/stroke/paintStyle': EffectStrokePaintStyle;\n 'effect/wave_warp/waveType': EffectWaveWarpWaveType;\n 'fill/pixelStream/orientation': FillPixelStreamOrientation;\n 'shape/vector_path/fillRule': ShapeVectorPathFillRule;\n 'shape/compound/fillRule': ShapeCompoundFillRule;\n 'shape/compound/mode': ShapeCompoundMode;\n 'mask/mode': MaskMode;\n 'text_animator/selectorBasedOn': TextAnimatorSelectorBasedOn;\n 'text_animator/selectorShape': TextAnimatorSelectorShape;\n 'text_animator/selectorUnits': TextAnimatorSelectorUnits;\n};\ninterface BlockMatte {\n source: DesignBlockId;\n mode: MatteMode;\n}\ninterface BlockStateEngineError {\n code: string;\n message: string;\n category: string;\n hint: string;\n args: Record<string, boolean | number | string>;\n docsUrl: string | null;\n silent: boolean;\n}\ntype BlurType = 'uniform' | 'linear' | 'mirrored' | 'radial'; // each also valid as '//ly.img.ubq/blur/<name>'\ntype BlurTypeLonghand = `//ly.img.ubq/blur/${BlurTypeShorthand}`;\ninterface Buffer_2 {\n handle: string;\n buffer: Uint8Array;\n}\ninterface CharacterInkBox {\n x: number;\n y: number;\n width: number;\n height: number;\n baselineY: number;\n}\ntype EditMode = 'Transform' | 'Crop' | 'Text' | 'Playback' | 'Trim' | 'Vector' | (string & {});\ntype EffectType = 'adjustments' | 'bulge' | 'corner_pin' | 'cross_cut' | 'displacement_map' | 'dot_pattern' | 'duotone_filter' | 'extrude_blur' | 'fill' | 'glow' | 'green_screen' | 'half_tone' | 'invert' | 'levels' | 'linear_wipe' | 'linocut' | 'liquid' | 'lut_filter' | 'mirror' | 'outliner' | 'pixelize' | 'posterize' | 'radial_pixel' | 'radial_wipe' | 'recolor' | 'sharpie' | 'shift_channels' | 'shifter' | 'stroke' | 'threshold' | 'tilt_shift' | 'tint' | 'tritone' | 'tv_glitch' | 'venetian_blinds' | 'vignette' | 'wave_warp'; // each also valid as '//ly.img.ubq/effect/<name>'\ntype EffectTypeLonghand = `//ly.img.ubq/effect/${EffectTypeShorthand}`;\ntype EngineActionId = keyof EngineActionsRegistry & string;\ninterface EnginePlugin {\n name: string;\n version: string;\n initialize: (context: EnginePluginContext) => void | Promise<void>;\n}\ntype EnumValues = BlendMode | HorizontalContentFillAlignment | ContentFillMode | VerticalContentFillAlignment | HeightMode | PositionXMode | PositionYMode | SceneAngleUnit | SceneColorConversionMode | DesignUnit | FontSizeUnit | SceneLayout | SceneMode | WidthMode | PageGuidesSource | StrokeCap | StrokeCornerGeometry | StrokeDashEndCap | StrokeDashStartCap | StrokeEndCap | StrokePosition | StrokeStartCap | StrokeStyle | PlaybackFadeInEasing | PlaybackFadeOutEasing | TextHorizontalAlignment | TextVerticalAlignment | CutoutType | CaptionHorizontalAlignment | CaptionVerticalAlignment | AnimationEasing | TextAnimationWritingStyle | AnimationGrowDirection | AnimationWipeDirection | AnimationBaselineDirection | AnimationSpinDirection | AnimationSpinLoopDirection | AnimationJumpLoopDirection | AnimationTypewriterTextWritingStyle | AnimationBlockSwipeTextDirection | AnimationMergeTextDirection | AnimationKenBurnsDirection | BlurUniformMode | ModifierTrimMode | ModifierRepeaterComposite | ModifierOffsetJoin | ModifierZigzagPointType | EffectDisplacementMapHorizontalChannel | EffectDisplacementMapMapBehavior | EffectDisplacementMapVerticalChannel | EffectInvertChannel | EffectRadialWipeDirection | EffectShiftChannelsTakeAlphaFrom | EffectShiftChannelsTakeBlueFrom | EffectShiftChannelsTakeGreenFrom | EffectShiftChannelsTakeRedFrom | EffectStrokePaintStyle | EffectWaveWarpWaveType | FillPixelStreamOrientation | ShapeVectorPathFillRule | ShapeCompoundFillRule | ShapeCompoundMode | MaskMode | TextAnimatorSelectorBasedOn | TextAnimatorSelectorShape | TextAnimatorSelectorUnits | (string & {});\ntype ExportOptions = {\n mimeType?: ImageMimeType | Exclude<ApplicationMimeType, 'application/zip'>;\n pngCompressionLevel?: number;\n jpegQuality?: number;\n webpQuality?: number;\n targetWidth?: number;\n targetHeight?: number;\n exportPdfWithHighCompatibility?: boolean;\n exportPdfWithUnderlayer?: boolean;\n underlayerSpotColorName?: string;\n underlayerOffset?: number;\n underlayerRenderRatio?: number;\n underlayerMaxError?: number;\n allowTextOverhang?: boolean;\n exportPdfWithDeviceCMYK?: boolean;\n exportPdfWithCropMarks?: boolean;\n exportPdfWithRegistrationMarks?: boolean;\n printMarkOffset?: number;\n printMarkWidth?: number;\n cropMarkLength?: number;\n pdfImageQuality?: number;\n pdfChunkSize?: number;\n onProgress?: (exportedPages: number, totalPages: number) => void;\n abortSignal?: AbortSignal;\n};\ntype FillType = 'color' | 'gradient/linear' | 'gradient/radial' | 'gradient/conical' | 'image' | 'video' | 'pixelStream' | 'stripe'; // each also valid as '//ly.img.ubq/fill/<name>'\ntype FillTypeLonghand = `//ly.img.ubq/fill/${FillTypeShorthand}`;\ninterface FindAssetsQuery {\n perPage: number;\n page: number;\n query: string;\n tags: string[];\n groups: string[];\n excludeGroups: string[];\n locale: string;\n sortingOrder: SortingOrder;\n sortKey: string;\n sortActiveFirst: boolean;\n filter: AssetFilter[];\n facets: AssetFacetPath[];\n}\ninterface Flip {\n horizontal: boolean;\n vertical: boolean;\n}\ntype GradientstopRGBA = [\n stop: number,\n r: number,\n g: number,\n b: number,\n a: number\n];\ntype HistoryId = number;\ntype HorizontalBlockAlignment = 'Left' | 'Right' | 'Center' | 'Justify' | 'Auto';\nfunction isCMYKColor(color: Color): color is CMYKColor;\nfunction isRGBAColor(color: Color): color is RGBAColor;\nfunction isSpotColor(color: Color): color is SpotColor;\ninterface Keyframe_2 {\n time: number;\n value: KeyframeValue;\n easing?: KeyframeEasing;\n spatialOut?: Vec2;\n spatialIn?: Vec2;\n}\ntype ModifierType = 'trim' | 'repeater' | 'round_corners' | 'offset' | 'zigzag' | 'pucker_bloat' | 'twist'; // each also valid as '//ly.img.ubq/modifier/<name>'\ntype ModifierTypeLonghand = `//ly.img.ubq/modifier/${ModifierTypeShorthand}`;\ntype ObjectType = ObjectTypeShorthand | ObjectTypeLonghand;\ninterface PageDuration {\n pageId: DesignBlockId;\n duration: number;\n start: number;\n end: number;\n}\ntype PaletteColor = HexColorString | RGBColor | RGBAColor | SpotColor;\ntype ResolvedMovementConstraint = {\n overshoot: number;\n} | null;\ninterface SaveToArchiveOptions {\n compression?: CompressionOptions;\n abortSignal?: AbortSignal;\n}\ninterface SaveToStringOptions {\n resourceSchemesAllowed?: string[];\n persistenceCallback?: (url: string, dataHash: string, persistedCallback: PersistedCallback) => void;\n compression?: CompressionOptions;\n}\ntype SettingEnumPropertyName = 'touch/pinchAction' | 'touch/rotateAction' | 'camera/clamping/overshootMode' | 'controlGizmo/moveHandleVisibility' | 'controlGizmo/resizeHandlesVisibility' | 'controlGizmo/scaleHandlesVisibility' | 'controlGizmo/rotateHandlesVisibility' | 'doubleClickSelectionMode' | 'colorPicker/colorMode' | 'timeline/trackVisibility' | (string & {});\ntype SettingEnumValues = TouchPinchAction | TouchRotateAction | CameraClampingOvershootMode | ControlGizmoMoveHandleVisibility | ControlGizmoResizeHandlesVisibility | ControlGizmoScaleHandlesVisibility | ControlGizmoRotateHandlesVisibility | DoubleClickSelectionMode | ColorPickerColorMode | TimelineTrackVisibility | (string & {});\ntype SettingsEnum = SettingEnumType;\ntype ShapeType = 'rect' | 'line' | 'ellipse' | 'polygon' | 'star' | 'vector_path' | 'compound'; // each also valid as '//ly.img.ubq/shape/<name>'\ntype ShapeTypeLonghand = `//ly.img.ubq/shape/${ShapeTypeShorthand}`;\ninterface Size2 {\n width: number;\n height: number;\n}\ntype Subscription = number;\ninterface TextFontSizeOptions {\n unit?: TextFontSizeUnit;\n from?: number;\n to?: number;\n}\ninterface TextRunInfo {\n from: number;\n to: number;\n text: string;\n color: Color;\n fontWeight: FontWeight;\n fontStyle: FontStyle;\n fontSize: number;\n textCase: TextCase;\n typeface: Typeface;\n resolvedFontFileUri: string;\n textDecoration: TextDecorationConfig;\n scriptStyle: ScriptStyle;\n kerning: number;\n}\ntype TrackMode = 'Absolute' | 'Relative';\ntype TransitionType = 'none' | 'cross-fade' | 'cross-blur' | 'cross-spin' | 'cross-zoom' | 'cross-warp' | 'push' | 'slide' | 'stack' | 'splice' | 'diagonal-splice' | 'fade' | 'fade-to-white' | 'fade-to-black' | 'color-wipe' | 'line-wipe' | 'wipe' | 'clock-wipe' | 'chop' | 'gradient-fade' | 'two-stripes'; // each also valid as '//ly.img.ubq/transition/<name>'\ntype TransitionTypeLonghand = `//ly.img.ubq/transition/${TransitionTypeShorthand}`;\ninterface UBQAudioFromVideoOptions {\n keepTrimSettings: boolean;\n muteOriginalVideo: boolean;\n}\ninterface UBQExportAudioOptions {\n sampleRate: number;\n numberOfChannels: number;\n skipEncoding?: boolean;\n audioCodec: number;\n}\ninterface UBQExportOptions {\n jpegQuality: number;\n webpQuality: number;\n pngCompressionLevel: number;\n useTargetSize: boolean;\n targetWidth: number;\n targetHeight: number;\n exportPdfWithHighCompatibility: boolean;\n exportPdfWithUnderlayer: boolean;\n underlayerSpotColorName: string;\n underlayerOffset: number;\n underlayerRenderRatio: number;\n underlayerMaxError: number;\n allowTextOverhang: boolean;\n exportPdfWithDeviceCMYK: boolean;\n exportPdfWithCropMarks: boolean;\n exportPdfWithRegistrationMarks: boolean;\n printMarkOffset: number;\n cropMarkLength: number;\n printMarkWidth: number;\n pdfImageQuality: number;\n pdfChunkSize: number;\n}\ninterface UBQExportVideoOptions {\n coverTimeOffset: number | undefined;\n h264Profile: number;\n h264Level: number;\n framerate?: number;\n videoBitrate: number;\n audioBitrate: number;\n useTargetSize: boolean;\n targetWidth: number;\n targetHeight: number;\n allowTextOverhang: boolean;\n audioCodec: number;\n}\ninterface UBQSplitOptions {\n attachToParent: boolean;\n createParentTrackIfNeeded: boolean;\n selectNewBlock: boolean;\n}\ntype Vec2PropertyName = 'position' | 'shape/position' | (string & {});\ninterface Vec3 {\n x: number;\n y: number;\n z: number;\n}\ntype VerticalBlockAlignment = 'Top' | 'Bottom' | 'Center';\ntype VideoExportOptions = {\n coverTimeOffset?: number | null;\n mimeType?: VideoMimeType;\n onProgress?: (numberOfRenderedFrames: number, numberOfEncodedFrames: number, totalNumberOfFrames: number) => void;\n h264Profile?: number;\n h264Level?: number;\n videoBitrate?: number | VideoBitrateMode;\n audioBitrate?: number;\n audioCodec?: AudioCodec;\n timeOffset?: number;\n duration?: number;\n framerate?: number;\n targetWidth?: number;\n targetHeight?: number;\n allowTextOverhang?: boolean;\n abortSignal?: AbortSignal;\n};\ntype ZoomAutoFitAxis = 'Horizontal' | 'Vertical' | 'Both';\ntype ZoomOptions = {\n padding?: number | {\n x?: number;\n y?: number;\n } | {\n top?: number;\n bottom?: number;\n left?: number;\n right?: number;\n };\n animate?: boolean | {\n duration?: number;\n easing?: AnimationEasing;\n interruptible?: boolean;\n };\n};\n\n// ---- types referenced only by extended members ----\ntype AnimationBaselineDirection = 'Up' | 'Right' | 'Down' | 'Left';\ntype AnimationBlockSwipeTextDirection = 'Up' | 'Right' | 'Down' | 'Left';\ntype AnimationGrowDirection = 'Horizontal' | 'Vertical' | 'All' | 'TopLeft' | 'TopRight' | 'BottomLeft' | 'BottomRight';\ntype AnimationJumpLoopDirection = 'Up' | 'Right' | 'Down' | 'Left';\ntype AnimationKenBurnsDirection = 'Up' | 'Right' | 'Down' | 'Left';\ntype AnimationMergeTextDirection = 'Right' | 'Left';\ntype AnimationSpinDirection = 'Clockwise' | 'CounterClockwise';\ntype AnimationSpinLoopDirection = 'Clockwise' | 'CounterClockwise';\ntype AnimationTypewriterTextWritingStyle = 'Character' | 'Word';\ntype AnimationWipeDirection = 'Up' | 'Right' | 'Down' | 'Left';\ntype ApplicationMimeType = Extract<MimeType_2, 'application/octet-stream' | 'application/pdf' | 'application/zip'>;\ntype AudioMimeType = Extract<MimeType_2, 'audio/wav' | 'audio/mp4'>;\ntype BlendMode = 'PassThrough' | 'Normal' | 'Darken' | 'Multiply' | 'ColorBurn' | 'LinearBurn' | 'DarkenColor' | 'Lighten' | 'Screen' | 'ColorDodge' | 'LinearDodge' | 'LightenColor' | 'Overlay' | 'SoftLight' | 'HardLight' | 'VividLight' | 'LinearLight' | 'PinLight' | 'HardMix' | 'Difference' | 'Exclusion' | 'Subtract' | 'Divide' | 'Hue' | 'Saturation' | 'Color' | 'Luminosity';\ntype BlurUniformMode = 'Fill' | 'Block';\ntype CaptionHorizontalAlignment = 'Left' | 'Right' | 'Center' | 'Justify' | 'Auto';\ntype CaptionVerticalAlignment = 'Top' | 'Bottom' | 'Center';\ninterface CompressionOptions {\n format?: CompressionFormat_2;\n level?: CompressionLevel;\n}\ntype ContentFillMode = 'Crop' | 'Cover' | 'Contain';\ntype EffectDisplacementMapHorizontalChannel = 'Red' | 'Green' | 'Blue' | 'Alpha' | 'Luminance' | 'Hue' | 'Lightness' | 'Saturation' | 'Full' | 'Half' | 'Off';\ntype EffectDisplacementMapMapBehavior = 'Center' | 'Stretch' | 'Tile';\ntype EffectDisplacementMapVerticalChannel = 'Red' | 'Green' | 'Blue' | 'Alpha' | 'Luminance' | 'Hue' | 'Lightness' | 'Saturation' | 'Full' | 'Half' | 'Off';\ntype EffectInvertChannel = 'RGB' | 'Red' | 'Green' | 'Blue' | 'HLS' | 'Hue' | 'Lightness' | 'Saturation' | 'YIQ' | 'Luma' | 'InPhaseChroma' | 'QuadratureChroma' | 'Alpha';\ntype EffectRadialWipeDirection = 'Clockwise' | 'Counterclockwise' | 'Both';\ntype EffectShiftChannelsTakeAlphaFrom = 'Alpha' | 'Red' | 'Green' | 'Blue' | 'Luminance' | 'Hue' | 'Lightness' | 'Saturation' | 'FullOn' | 'FullOff';\ntype EffectShiftChannelsTakeBlueFrom = 'Alpha' | 'Red' | 'Green' | 'Blue' | 'Luminance' | 'Hue' | 'Lightness' | 'Saturation' | 'FullOn' | 'FullOff';\ntype EffectShiftChannelsTakeGreenFrom = 'Alpha' | 'Red' | 'Green' | 'Blue' | 'Luminance' | 'Hue' | 'Lightness' | 'Saturation' | 'FullOn' | 'FullOff';\ntype EffectShiftChannelsTakeRedFrom = 'Alpha' | 'Red' | 'Green' | 'Blue' | 'Luminance' | 'Hue' | 'Lightness' | 'Saturation' | 'FullOn' | 'FullOff';\ntype EffectStrokePaintStyle = 'OnOriginalImage' | 'OnTransparent';\ntype EffectWaveWarpWaveType = 'Sine' | 'Square' | 'Triangle' | 'Sawtooth';\ntype EnginePluginContext = {\n engine: CreativeEngine;\n};\ntype FillPixelStreamOrientation = 'Up' | 'Down' | 'Left' | 'Right' | 'UpMirrored' | 'DownMirrored' | 'LeftMirrored' | 'RightMirrored';\ntype TextFontSizeUnit = DesignUnit | 'Point';\ntype HeightMode = 'Absolute' | 'Percent' | 'Auto';\ntype HexColorString = string;\ntype HorizontalContentFillAlignment = 'Left' | 'Center' | 'Right';\ntype ImageMimeType = Extract<MimeType_2, 'image/png' | 'image/jpeg' | 'image/webp' | 'image/x-tga' | 'image/svg+xml'>;\ntype KeyframeEasing = {\n type: 'Preset';\n preset: AnimationEasing;\n} | {\n type: 'Bezier';\n out: Vec2;\n in: Vec2;\n} | {\n type: 'Hold';\n};\ntype KeyframeValue = {\n type: 'Float';\n value: number;\n} | {\n type: 'Vec2';\n value: Vec2;\n} | {\n type: 'Color';\n value: Color;\n} | {\n type: 'Path';\n value: {\n vertices: KeyframePathVertex[];\n closed: boolean;\n };\n} | {\n type: 'List';\n value: number[];\n} | {\n type: 'Discrete';\n value: boolean | number | string;\n};\ntype MaskMode = 'Add' | 'Subtract' | 'Intersect' | 'Lighten' | 'Darken' | 'Difference' | 'None';\ntype MatteMode = 'Alpha' | 'AlphaInverted' | 'Luma' | 'LumaInverted';\ntype ModifierOffsetJoin = 'Bevel' | 'Miter' | 'Round';\ntype ModifierRepeaterComposite = 'Below' | 'Above';\ntype ModifierTrimMode = 'Simultaneous' | 'Individual';\ntype ModifierZigzagPointType = 'Corner' | 'Smooth';\ntype ObjectTypeLonghand = DesignBlockTypeLonghand | ShapeTypeLonghand | FillTypeLonghand | EffectTypeLonghand | ModifierTypeLonghand | BlurTypeLonghand | AnimationTypeLonghand | TransitionTypeLonghand | '//ly.img.ubq/text_animator' | '//ly.img.ubq/mask';\ntype ObjectTypeShorthand = DesignBlockTypeShorthand | `shape/${ShapeTypeShorthand}` | `fill/${FillTypeShorthand}` | `effect/${EffectTypeShorthand}` | `modifier/${ModifierTypeShorthand}` | `blur/${BlurTypeShorthand}` | `animation/${AnimationTypeShorthand}` | `transition/${TransitionTypeShorthand}` | 'text_animator' | 'mask';\ntype PageGuidesSource = 'Document' | 'Custom';\ntype PersistedCallback = (url: string, persistedUrl: unknown, error: string | undefined) => void;\ntype PlaybackFadeInEasing = 'Linear' | 'EaseIn' | 'EaseOut' | 'EaseInOut' | 'EaseInQuart' | 'EaseOutQuart' | 'EaseInOutQuart' | 'EaseInQuint' | 'EaseOutQuint' | 'EaseInOutQuint' | 'EaseInBack' | 'EaseOutBack' | 'EaseInOutBack' | 'EaseInSpring' | 'EaseOutSpring' | 'EaseInOutSpring';\ntype PlaybackFadeOutEasing = 'Linear' | 'EaseIn' | 'EaseOut' | 'EaseInOut' | 'EaseInQuart' | 'EaseOutQuart' | 'EaseInOutQuart' | 'EaseInQuint' | 'EaseOutQuint' | 'EaseInOutQuint' | 'EaseInBack' | 'EaseOutBack' | 'EaseInOutBack' | 'EaseInSpring' | 'EaseOutSpring' | 'EaseInOutSpring';\ntype PositionXMode = 'Absolute' | 'Percent' | 'Auto';\ntype PositionYMode = 'Absolute' | 'Percent' | 'Auto';\ntype SceneColorConversionMode = 'Managed' | 'Legacy';\ntype ShapeCompoundFillRule = 'EvenOdd' | 'NonZero';\ntype ShapeCompoundMode = 'Merge' | 'Add' | 'Subtract' | 'Intersect' | 'Exclude';\ntype ShapeVectorPathFillRule = 'EvenOdd' | 'NonZero';\ntype StrokeCap = 'Butt' | 'Round' | 'Square';\ntype StrokeCornerGeometry = 'Bevel' | 'Miter' | 'Round';\ntype StrokeDashEndCap = 'Butt' | 'Round' | 'Square';\ntype StrokeDashStartCap = 'Butt' | 'Round' | 'Square';\ntype StrokeEndCap = 'Butt' | 'Round' | 'Square';\ntype StrokePosition = 'Center' | 'Inner' | 'Outer';\ntype StrokeStartCap = 'Butt' | 'Round' | 'Square';\ntype StrokeStyle = 'Dashed' | 'DashedRound' | 'Dotted' | 'LongDashed' | 'LongDashedRound' | 'Solid';\ntype TextAnimationWritingStyle = 'Block' | 'Line' | 'Character' | 'Word';\ntype TextAnimatorSelectorBasedOn = 'Characters' | 'CharactersExcludingSpaces' | 'Words' | 'Lines';\ntype TextAnimatorSelectorShape = 'Square' | 'RampUp' | 'RampDown' | 'Triangle' | 'Round' | 'Smooth';\ntype TextAnimatorSelectorUnits = 'Percentage' | 'Index';\ntype TextHorizontalAlignment = 'Left' | 'Right' | 'Center' | 'Justify' | 'Auto';\ntype TextVerticalAlignment = 'Top' | 'Bottom' | 'Center';\ntype VerticalContentFillAlignment = 'Top' | 'Center' | 'Bottom';\ntype VideoBitrateMode = 'System' | 'Auto';\ntype VideoMimeType = Extract<MimeType_2, 'video/mp4'>;\ntype WidthMode = 'Absolute' | 'Percent' | 'Auto';\n\n// ---- types referenced only by extended members ----\ntype BlurTypeShorthand = 'uniform' | 'linear' | 'mirrored' | 'radial';\nenum CompressionFormat_2 {\n None = 0,\n Zstd = 1\n}\nenum CompressionLevel {\n Fastest = 0,\n Default = 1,\n Best = 2\n}\ntype EffectTypeShorthand = 'adjustments' | 'bulge' | 'corner_pin' | 'cross_cut' | 'displacement_map' | 'dot_pattern' | 'duotone_filter' | 'extrude_blur' | 'fill' | 'glow' | 'green_screen' | 'half_tone' | 'invert' | 'levels' | 'linear_wipe' | 'linocut' | 'liquid' | 'lut_filter' | 'mirror' | 'outliner' | 'pixelize' | 'posterize' | 'radial_pixel' | 'radial_wipe' | 'recolor' | 'sharpie' | 'shift_channels' | 'shifter' | 'stroke' | 'threshold' | 'tilt_shift' | 'tint' | 'tritone' | 'tv_glitch' | 'venetian_blinds' | 'vignette' | 'wave_warp';\ntype FillTypeShorthand = 'color' | 'gradient/linear' | 'gradient/radial' | 'gradient/conical' | 'image' | 'video' | 'pixelStream' | 'stripe';\ninterface KeyframePathVertex {\n point: Vec2;\n inTangent: Vec2;\n outTangent: Vec2;\n}\ntype ModifierTypeShorthand = 'trim' | 'repeater' | 'round_corners' | 'offset' | 'zigzag' | 'pucker_bloat' | 'twist';\ntype ShapeTypeShorthand = 'rect' | 'line' | 'ellipse' | 'polygon' | 'star' | 'vector_path' | 'compound';\ntype TransitionTypeShorthand = 'none' | 'cross-fade' | 'cross-blur' | 'cross-spin' | 'cross-zoom' | 'cross-warp' | 'push' | 'slide' | 'stack' | 'splice' | 'diagonal-splice' | 'fade' | 'fade-to-white' | 'fade-to-black' | 'color-wipe' | 'line-wipe' | 'wipe' | 'clock-wipe' | 'chop' | 'gradient-fade' | 'two-stripes';\n",
|
|
13
|
-
"docs/api/signatures.d.ts": "// ============================================================================\n// codesign extension: engine.design — the ONLY API `edit` code uses.\n// engine.block/scene/variable/editor/asset/event are refused by the edit\n// gate, which names the engine.design equivalent; the upstream classes after\n// this section are reference only. Scene-wide state (variables,\n// spotColors, scene.*) lives on the scene block.\n//\n// Length: design-unit number or '3mm'/'0.1in'/'32pt'/'40px'; reads answer\n// numbers. '50%' also sets '<leaf>Mode' to 'Percent'. letterSpacing is a FACTOR, never a length. lineHeight: write { visual: n }\n// (CSS-style x fontSize, converted per font); a bare number is the ENGINE\n// scale and renders looser. paragraphSpacing: write { px: n } or { em: n }.\n// Text glyph color is per-character: fill.solid.color on a text block is\n// REJECTED — write setProps(id, { text: { color } }) instead.\n// ============================================================================\n// Branded attachment ids — nominal guidance (runtime dispatch enforces the\n// category): a FillId/EffectId/... is where the matching attachment props\n// tree applies, never BlockProps.\n// Durable identity: every id parameter also accepts the block's UUID string\n// (read it via getProps(id, ['uuid']) or a tree read) — the identity that\n// persists in the scene file and crosses edits/revisions. An unknown uuid\n// throws \"not in this revision\"; a stale numeric handle can't be caught.\ntype BlockRef = DesignBlockId | string /* uuid */;\ntype Length = number | `${number}${'px' | 'pt' | 'mm' | 'in'}`;\n// One node of the document read as a tree; feed a (subset of a) node tree\n// back to setProps to patch every node by uuid.\ninterface PropsNode { uuid: string; name?: string; type: string; props: BlockProps; children: PropsNode[] }\n// Tracks by leaf; at = seconds of the (host) block or '25%'; null removes.\ntype Keyframes = { [leaf: string]: { at: number | string; value: unknown; easing?: string | object }[] | null };\ntype FillId = DesignBlockId & { readonly __kind?: 'fill' };\ntype EffectId = DesignBlockId & { readonly __kind?: 'effect' };\ntype BlurId = DesignBlockId & { readonly __kind?: 'blur' };\ntype ShapeId = DesignBlockId & { readonly __kind?: 'shape' };\ntype AnimationId = DesignBlockId & { readonly __kind?: 'animation' };\ninterface DesignApi {\n /** EVERY member returns a Promise — always: await engine.design.x(...)\n * (a floating rejection fails the edit at commit). */\n /** THE constructor: one block or a whole subtree, same spec shape at\n * every level. Looks up any font: { family, weight }, applies props,\n * attaches to the parent and loads fonts/images. Rolls the\n * WHOLE subtree back on failure. Name the nodes you will touch again:\n * the name lands on the block and findByName resolves it later.\n * Text without a height sizes to its text; a fixed height below its\n * lines throws (setProps too).\n * A NEW document: create({ type: 'scene', props: { scene: { mode?:\n * 'Video', layout?, designUnit? }, stack?: { spacing? }, variables?,\n * spotColors? }, children: [pages] }) replaces the current scene; a\n * page whose parent is the scene goes into its stack (gap 48 px). */\n create(spec: BuildSpec, opts?: { parent?: BlockRef; index?: number /* 0 = back */ }): Promise<DesignBlockId>;\n /** Partial deep-merge write. Brand-dispatched: pass a FILL/EFFECT/BLUR/\n * SHAPE/ANIMATION block id and the matching attachment props tree\n * (effect/*, fill/*, … paths as nested keys) applies instead.\n * Given a PropsNode TREE (a node with uuid+props or children) it\n * patches every node by uuid — read the tree, transform it in JS,\n * write it back. Patch-only: an absent block/prop is untouched, never\n * deleted; uuids resolve for the whole tree before anything applies. */\n setProps(id: BlockRef, props: BlockProps | PropsNode): Promise<void>;\n /** Read leaves or whole subtrees — getProps(id, ['position', 'stroke']) —\n * or omit select for EVERY applicable prop of this block, valued.\n * In a list, a selector this block lacks answers undefined (a\n * page's opacity); alone, it throws and says why. { children: true,\n * props?: [...] } reads the\n * whole SUBTREE as one uuid-keyed PropsNode tree — filter it with\n * plain JS (a selector a block kind lacks is skipped for that block).\n * The snapshot never enters your reply unless you print it. */\n getProps(id: BlockRef, select?: string[] | { children: true; props?: string[] }): Promise<BlockProps>;\n /** Editor settings, same dialect; SettingsProps is in signatures.d.ts. */\n setSettings(props: SettingsProps): Promise<void>;\n getSettings(select?: string[]): Promise<SettingsProps>;\n // text.path's circle spec centres the glyph run and sets the D×D frame\n // (align: 'bottom' = upright underside). getProps(id, ['type']) names a\n // block; attachment ids never circulate.\n /** Editing scopes (what the browser-editor user may change). Saved with\n * the design: the lock an editor opened for filling in a template obeys.\n * THIS session ignores locks — every write still succeeds here; an\n * editor obeys them where its own global scopes defer. A slot\n * needs its own scope (image: fill/change, text: text/edit) plus\n * editor/select, or it cannot be clicked. { recursive: true } writes the\n * block and every descendant: lock a page with every scope false, then\n * open the slots. */\n getScopes(id: BlockRef): Promise<Record<Scope, boolean>>;\n setScopes(id: BlockRef, scopes: Partial<Record<Scope, boolean>>, opts?: { recursive?: boolean }): Promise<void>;\n getCapabilities(idOrType: BlockRef | DesignBlockType): Promise<readonly string[]>;\n // Attachment values are the unions below (replaced blocks are destroyed):\n // await setProps(id, { fill: { type: 'color', color: { value } } })\n // await setProps(id, { fill: { enabled: false } }) // no type ⇒ host leaves\n // Gradient fills round-trip stops; image fills round-trip sourceSet —\n // getProps(id, ['fill']) → tweak → setProps is lossless.\n // await setProps(id, { shape: { type: 'rect' } }) · { blur: { type: 'uniform' } }\n // await setProps(id, { effects: [{ type: 'displacement_map', source: 'map' /* BlockRef */ }] })\n // await setProps(id, { animations: { in: { type: 'slide', … } } }) // null detaches\n // TEXT is all props too, applied in canonical order (font → string →\n // styles → ranges) whatever the key order:\n // await setProps(id, { text: { string, font: { typeface }, weight, case,\n // listStyle, path, pathOffset, pathFlipped,\n // ranges: [{ from, to, color?, weight?, style?, size?, case?, scriptStyle?,\n // decoration?, kerning? }] } })\n // A string write WITHOUT other text styling auto-preserves existing\n // ranges; with styling, ranges reset (pass ranges to keep or ranges: []\n // to wipe); font/size/lineHeight writes auto-reshape. Read the per-run\n // truth via getProps(id, ['text.ranges']); paragraphs (read-only) carry\n // listStyle + listLevel.\n // TIMELINE: page→track→clips; a later track draws above. A track plays\n // its clips back-to-back until a timeOffset is written. A transition\n // joins a clip to the next one on its track.\n // CAPTIONS: page→captionTrack→caption, caption.* as text.*; style+layout TRACK-WIDE,\n // caption.ranges per caption (one track per page). Background box = the whole frame + padding.\n adjustCropToFillFrame(id: BlockRef, minScaleRatio: number): Promise<number>;\n // Multi-block layout verbs:\n /** Axis-keyed ('Center' is never ambiguous); one call may do both axes. */\n align(ids: BlockRef[], alignment: { horizontal?: 'Left' | 'Center' | 'Right'; vertical?: 'Top' | 'Center' | 'Bottom' }): Promise<void>;\n distribute(ids: BlockRef[], axis: 'horizontal' | 'vertical'): Promise<void>;\n isAlignable(ids: BlockRef[]): Promise<boolean>;\n isDistributable(ids: BlockRef[]): Promise<boolean>;\n bringForward(id: BlockRef): Promise<void>;\n sendBackward(id: BlockRef): Promise<void>;\n order(id: BlockRef, to: 'front' | 'back' | { above: BlockRef } | { below: BlockRef }): Promise<void>;\n scale(id: BlockRef, factor: number, opts?: { anchorX?: number; anchorY?: number }): Promise<void>;\n resizeContentAware(ids: BlockRef[], size: { width: number; height: number }): Promise<void>;\n /** Measured layout frame (post-layout px, resources loaded) — the\n * numbers you position by. Unpadded: backgroundColor padding is outside.\n * Rotated: x/y = pivot corner (the unrotated origin).\n * textLines: visible line count; ink: { from, to } adds glyph ink boxes. Text only. */\n measure(id: BlockRef, opts?: { ink?: { from?: number; to?: number } }): Promise<{ x: number; y: number; width: number; height: number; textLines?: number; ink?: Array<{ x: number; y: number; width: number; height: number; baselineY: number }> }>;\n /** Await pending font/image loads for these subtrees (create does this itself). */\n loadResources(ids: BlockRef[]): Promise<void>;\n isGroupable(ids: BlockRef[]): Promise<boolean>;\n // Tree verbs. Child order is paint order: first = back, last = front.\n appendChild(parent: BlockRef, child: BlockRef): Promise<void>;\n insertChild(parent: BlockRef, child: BlockRef, index: number): Promise<void>;\n getParent(id: BlockRef): Promise<DesignBlockId | null>;\n getChildren(id: BlockRef): Promise<DesignBlockId[]>;\n /** 'page' answers in document order. */\n findByType(type: DesignBlockType): Promise<DesignBlockId[]>;\n /** Blocks carrying this name. create writes a spec node's name onto the\n * block, so this is how a LATER edit re-finds what an earlier made. */\n findByName(name: string): Promise<DesignBlockId[]>;\n group(ids: BlockRef[]): Promise<DesignBlockId>;\n ungroup(id: BlockRef): Promise<void>;\n duplicate(id: BlockRef): Promise<DesignBlockId>;\n destroy(id: BlockRef): Promise<void>;\n // Media and CoDesign services — what CE.SDK does not answer itself:\n /** A font and its metrics, by family (create's lookup) or uri; warms the\n * cache text.lineHeight: { visual } reads. */\n font(spec: { family?: string; uri?: string; weight?: FontWeight; style?: FontStyle }): Promise<{ typeface?: Typeface; uri: string; contentArea: number; metrics: { ascender: number; descender: number; lineGap: number; unitsPerEm: number; capHeight: number; xHeight: number; underlineOffset: number; underlineSize: number } }>;\n /** Words of an asset_generate transcript (its transcriptUri) starting in [from, to) source seconds. */\n readTranscript(uri: string, range?: { from?: number; to?: number }): Promise<{ words: Array<{ text: string; start: number; end: number }> }>;\n /** An audio block's beats in PAGE seconds; bpm picks half/double tempo;\n * bpm/fit null = no steady beat (cut on accents/onsets). */\n readBeats(id: BlockRef, opts?: { bpm?: number }): Promise<{ start: number; duration: number; bpm: number | null; requestedBpm: number | null; fit: { onsets: number; onGrid: number; meanErrMs: number } | null; beats: number[]; accents: number[]; onsets: Array<{ t: number; strength: number }> }>;\n}\n// Also in edit scope: a text block by its copy, NBSP/thin spaces folded and\n// ends trimmed, else exact. A miss lists the design's copy.\ndeclare function findText(copy: string): Promise<DesignBlockId>; // rejects unless one matches\ndeclare function findAllText(copy: string): Promise<DesignBlockId[]>; // [] for none\ninterface BuildSpec {\n type: DesignBlockType;\n /** Written onto the block; findByName(name) resolves it, in this edit\n * and in every later one. */\n name?: string;\n /** Everything the block IS, attachments and the text subtree included;\n * text.font: { family, weight } is looked up (create and setProps). */\n props?: BlockProps;\n children?: BuildSpec[];\n}\n// Capability matrix (measured against the engine; type-determined —\n// no need to call supports* for blocks you created):\n// capability audio caption captionTrack cutout graphic group page text track\n// animation ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓\n// backgroundColor · ✓ · · · · · ✓ ·\n// blendMode · ✓ · · ✓ ✓ ✓ ✓ ·\n// blur · · · · ✓ ✓ ✓ · ·\n// contentFillMode ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓\n// crop · · · · ✓ · · · ·\n// dropShadow · ✓ · · ✓ · ✓ ✓ ·\n// duration ✓ ✓ ✓ · ✓ ✓ ✓ ✓ ✓\n// effects · · · · ✓ · ✓ · ·\n// fill · ✓ · · ✓ · ✓ ✓ ·\n// masks · ✓ · · ✓ ✓ · ✓ ·\n// opacity · ✓ · · ✓ ✓ · ✓ ·\n// placeholderBehavior· ✓ · · · · · ✓ ·\n// placeholderControls· · · ✓ ✓ · ✓ · ·\n// playbackControl ✓ · · · · · ✓ · ·\n// playbackTime ✓ · · · · · ✓ · ·\n// shape · · · · ✓ · · · ·\n// stroke · ✓ · · ✓ · ✓ ✓ ·\n// textAnimators · ✓ · · · · · ✓ ·\n// timeOffset ✓ ✓ ✓ · ✓ ✓ · ✓ ✓\n// trim ✓ · · · · · · · ·\n\ninterface BlockProps {\n alwaysOnBottom?: boolean;\n alwaysOnTop?: boolean;\n animations?: { in?: Animation | null; loop?: Animation | null; out?: Animation | null };\n audio?: { fileURI?: string; totalDuration?: number };\n background?: Color /* page only; paints under its children */;\n backgroundColor?: {\n color?: Color;\n cornerRadius?: Length | 'pill' /* fully rounded */;\n enabled?: boolean;\n paddingBottom?: Length;\n paddingLeft?: Length;\n paddingRight?: Length;\n paddingTop?: Length;\n };\n bindings?: { [leaf: string]: string | null };\n blend?: {\n mode?: 'PassThrough' | 'Normal' | 'Darken' | 'Multiply' | 'ColorBurn' | 'LinearBurn' | 'DarkenColor' | 'Lighten' | 'Screen' | 'ColorDodge' | 'LinearDodge' | 'LightenColor' | 'Overlay' | 'SoftLight' | 'HardLight' | 'VividLight' | 'LinearLight' | 'PinLight' | 'HardMix' | 'Difference' | 'Exclusion' | 'Subtract' | 'Divide' | 'Hue' | 'Saturation' | 'Color' | 'Luminosity';\n };\n blur?: Blur | null;\n camera?: {\n pixelRatio?: number;\n resolution?: { height?: number; width?: number };\n zoomLevel?: number;\n };\n caption?: {\n animators?: TextAnimator[] /* in signatures.d.ts; [] clears */;\n automaticFontSizeEnabled?: boolean;\n clipLinesOutsideOfFrame?: boolean;\n color?: Color;\n font?: { family: string; weight?: FontWeight } | { typeface: Typeface; uri?: string };\n fontSize?: string /* '48px' */;\n horizontalAlignment?: 'Left' | 'Right' | 'Center' | 'Justify' | 'Auto';\n letterSpacing?: number;\n lineHeight?: number | { visual: number };\n maxAutomaticFontSize?: number;\n minAutomaticFontSize?: number;\n paragraphSpacing?: number | { px: number } | { em: number };\n pathFlipped?: boolean;\n pathOffset?: number;\n ranges?: { from: number; to: number; color?: Color; weight?: FontWeight; style?: string; size?: string /* px or pt string */; case?: TextCase; scriptStyle?: ScriptStyle; baselineShift?: number | string; typeface?: Typeface; decoration?: TextDecorationConfig; kerning?: number }[];\n style?: string;\n subscriptFontScale?: number;\n subscriptVerticalShift?: number;\n superscriptFontScale?: number;\n superscriptVerticalShift?: number;\n text?: string;\n useContextualAlternates?: boolean;\n useContextualLigatures?: boolean;\n useDiscretionaryLigatures?: boolean;\n useKerning?: boolean;\n useLigatures?: boolean;\n verticalAlignment?: 'Top' | 'Bottom' | 'Center';\n weight?: string;\n };\n captionTrack?: { automaticallyManageBlockOffsets?: boolean };\n clipped?: boolean;\n contentFill?: {\n horizontalAlignment?: 'Left' | 'Center' | 'Right';\n mode?: 'Crop' | 'Cover' | 'Contain' /* image default Cover; a logo: Contain */;\n verticalAlignment?: 'Top' | 'Center' | 'Bottom';\n };\n crop?: null | {\n aspectRatioLocked?: boolean;\n rotation?: number;\n scaleRatio?: number;\n scaleX?: number;\n scaleY?: number;\n translationX?: number;\n translationY?: number;\n };\n cutout?: {\n offset?: number;\n path?: string;\n smoothing?: number;\n type?: 'Solid' | 'Dashed' /* spotColors ink with this cutout */;\n };\n dropShadow?: {\n blurRadius?: { x?: Length; y?: Length };\n clip?: boolean;\n color?: Color;\n enabled?: boolean;\n offset?: { x?: Length; y?: Length };\n };\n effects?: Effect[];\n exclusionArea?: {\n constrains?: boolean;\n punchOut?: boolean /* exclusionArea is never exported; punchOut cuts a hole */;\n };\n fill?: Fill | null;\n flip?: { horizontal?: boolean; vertical?: boolean };\n globalBoundingBox?: { height?: number; width?: number; x?: number; y?: number };\n height?: Length | `${number}%`;\n heightMode?: 'Absolute' | 'Percent' | 'Auto';\n highlightEnabled?: boolean;\n includedInExport?: boolean;\n keyframes?: Keyframes | null;\n kind?: string;\n lastFrame?: { height?: number; width?: number; x?: number; y?: number };\n markers?: { name: string; time: number; duration?: number }[];\n masks?: Mask[];\n matte?: { source: BlockRef; mode?: 'Alpha' | 'AlphaInverted' | 'Luma' | 'LumaInverted' } | null;\n metadata?: { [key: string]: string | null } /* block tags; null deletes */;\n motionBlur?: {\n enabled?: boolean /* graphic, text, caption */;\n samples?: number /* SCENE only: 1–64 */;\n shutterAngle?: number /* SCENE only: 0–720° */;\n shutterPhase?: number /* SCENE only: −360–360° */;\n };\n movement?: { constraint?: number };\n name?: string;\n opacity?: number;\n page?: {\n guides?: {\n gridColor?: Color;\n gridEnabled?: boolean;\n gridSnapEnabled?: boolean;\n gridSpacingX?: number;\n gridSpacingY?: number;\n source?: 'Document' | 'Custom';\n };\n margin?: { bottom?: Length; left?: Length; right?: Length; top?: Length };\n marginEnabled?: boolean /* bleed: page.margin, outside the trim size */;\n marginScale?: number;\n safetyEnabled?: boolean /* safetyInset: text-free band, not exported */;\n safetyInset?: { bottom?: Length; left?: Length; right?: Length; top?: Length };\n titleTemplate?: string;\n };\n placeholder?: { enabled?: boolean };\n placeholderBehavior?: { enabled?: boolean };\n placeholderControls?: { showButton?: boolean; showOverlay?: boolean };\n playback?: {\n duration?: number /* s */;\n fadeIn?: { duration?: number; easing?: AnimationEasing };\n fadeOut?: { duration?: number; easing?: AnimationEasing };\n looping?: boolean;\n muted?: boolean;\n playing?: boolean;\n soloPlaybackEnabled?: boolean;\n speed?: number /* 0.25–3; duration = trimLength / speed */;\n time?: number /* on a page, the playhead: a still export renders this frame */;\n timeOffset?: number /* s from the parent's start; writing one stops its track's auto-arrange */;\n trimLength?: number /* s of the source */;\n trimOffset?: number /* s of the source */;\n volume?: number /* 0–1 */;\n };\n position?: {\n x?: Length | `${number}%`;\n xMode?: 'Absolute' | 'Percent' | 'Auto';\n y?: Length | `${number}%`;\n yMode?: 'Absolute' | 'Percent' | 'Auto';\n };\n rotation?: number;\n scene?: {\n angleUnit?: 'Radian' | 'Degree';\n aspectRatioLock?: boolean;\n colorConversionMode?: 'Managed' | 'Legacy';\n designUnit?: 'Pixel' | 'Millimeter' | 'Inch';\n dpi?: number /* print: 300, designUnit 'Millimeter' */;\n extendedPanningArea?: boolean;\n fontSizeUnit?: 'Pixel' | 'Point';\n frameRate?: number;\n layout?: 'Free' | 'VerticalStack' | 'HorizontalStack' | 'DepthStack';\n mode?: 'Design' | 'Video' /* optional: timelines play in any mode */;\n pageDimensions?: { height?: number; width?: number };\n pageFormatId?: string;\n pixelScaleFactor?: number;\n };\n selected?: boolean;\n selectionEnabled?: boolean;\n shape?: Shape | null;\n spotColors?: { [ink: string]: { rgb?: { r: number; g: number; b: number }; cmyk?: { c: number; m: number; y: number; k: number }; cutout?: 'Solid' | 'Dashed' } | null } /* SCENE only: print inks, swatch-book names */;\n stack?: { spacing?: number; spacingInScreenspace?: boolean };\n stroke?: {\n cap?: 'Butt' | 'Round' | 'Square';\n color?: Color;\n cornerGeometry?: 'Bevel' | 'Miter' | 'Round';\n dashArray?: number[];\n dashEndCap?: 'Butt' | 'Round' | 'Square';\n dashOffset?: number;\n dashStartCap?: 'Butt' | 'Round' | 'Square';\n enabled?: boolean;\n endCap?: 'Butt' | 'Round' | 'Square';\n fill?: Fill | null /* paints the stroke instead of stroke.color: 'color', 'gradient/linear|radial|conical' or 'stripe'; graphic and page blocks; null = stroke.color again */;\n miterLimit?: number;\n overprint?: boolean /* no knockout of inks below (fill.overprint too) */;\n position?: 'Center' | 'Inner' | 'Outer';\n startCap?: 'Butt' | 'Round' | 'Square';\n style?: 'Dashed' | 'DashedRound' | 'Dotted' | 'LongDashed' | 'LongDashedRound' | 'Solid';\n width?: Length;\n };\n subtitles?: string /* captionTrack, WRITE-only: SRT/VTT uri replaces its captions */;\n text?: {\n animators?: TextAnimator[] /* in signatures.d.ts; [] clears */;\n automaticFontSizeEnabled?: boolean;\n baselineShift?: number | string /* + up; per range: ranges[i] */;\n case?: TextCase /* 'Uppercase' lifts tracking < 0.05 to 0.1 */;\n clipLinesOutsideOfFrame?: boolean;\n color?: Color;\n decoration?: TextDecorationConfig;\n externalReference?: string;\n font?: { family: string; weight?: FontWeight; style?: string } /* create only: a lookup */ | { typeface: Typeface; uri?: string } /* 400 unless a weight is written */;\n fontSize?: string /* needs a unit: '64px' | '24pt'; reads answer one too — parseFloat() before math */;\n hasClippedLines?: boolean;\n horizontalAlignment?: 'Left' | 'Right' | 'Center' | 'Justify' | 'Auto';\n letterSpacing?: number;\n lineHeight?: number /* engine scale */ | { visual: number } /* CSS-style */;\n lineHeightVisual?: number /* READ-ONLY: lineHeight in CSS terms */;\n listStyle?: ListStyle /* whole block; nesting via paragraphs: [{ index, listLevel }] */;\n maxAutomaticFontSize?: number;\n minAutomaticFontSize?: number;\n paragraphs?: { index: number; from?: number; listStyle?: ListStyle; listLevel?: number; horizontalAlignment?: 'Left' | 'Right' | 'Center' | 'Justify' | 'Auto'; lineHeight?: number | { visual: number } }[];\n paragraphSpacing?: number /* engine scale */ | { px: number } | { em: number };\n path?: string /* SVG path baseline */ | { shape: 'circle'; diameter: number; align?: 'top' | 'bottom' | number } | null;\n pathExternalRef?: string;\n pathFlipped?: boolean /* true = underside, reversed direction */;\n pathOffset?: number /* 0..1 start along the path */;\n ranges?: { from: number; to: number; color?: Color; weight?: FontWeight; style?: string; size?: string /* px or pt string */; case?: TextCase; scriptStyle?: ScriptStyle; baselineShift?: number | string; typeface?: Typeface; decoration?: TextDecorationConfig; kerning?: number }[];\n style?: string;\n subscriptFontScale?: number;\n subscriptVerticalShift?: number;\n superscriptFontScale?: number;\n superscriptVerticalShift?: number;\n string?: string;\n typeface?: string;\n useContextualAlternates?: boolean;\n useContextualLigatures?: boolean;\n useDiscretionaryLigatures?: boolean;\n useKerning?: boolean;\n useLigatures?: boolean;\n verticalAlignment?: 'Top' | 'Bottom' | 'Center';\n weight?: string;\n };\n track?: { automaticallyManageBlockOffsets?: boolean };\n transform?: {\n anchor?: { x?: Length; y?: Length };\n autoOrient?: boolean;\n hasAnchor?: boolean /* read-only */;\n scale?: { x?: number; y?: number };\n skew?: number;\n skewAxis?: number;\n };\n transformLocked?: boolean;\n transformParent?: BlockRef | null;\n transition?: Transition | null;\n type?: string;\n uuid?: string;\n variables?: { [name: string]: string | { color: Color } | { number: number } | { image: string } | { font: { family: string } } | { rename: string } | null };\n visible?: boolean;\n width?: Length | `${number}%`;\n widthMode?: 'Absolute' | 'Percent' | 'Auto';\n}\n// Attachments. The type field picks the arm, and the arm names every prop\n// that type carries — nothing else applies. Assigning one whose type MATCHES\n// what is already attached edits it in place; a different type replaces it.\n// Each shorthand is also valid as '//ly.img.ubq/<slot>/<name>'.\n// Their angles (stripe fill, star, subshapes, modifiers, effects, the venetian_blinds and wave_warp direction included) are radians.\ntype Fill = { enabled?: boolean; overprint?: boolean; keyframes?: Keyframes } & (\n | { type: 'color'; color?: { value?: Color } }\n | { type: 'gradient/linear'; stops?: GradientColorStop[]; gradient?: { linear?: { endPointX?: number; endPointY?: number; startPointX?: number; startPointY?: number }; }; }\n | { type: 'gradient/radial'; stops?: GradientColorStop[]; gradient?: { radial?: { centerPointX?: number; centerPointY?: number; focalX?: number; focalY?: number; radius?: number }; }; }\n | { type: 'gradient/conical'; stops?: GradientColorStop[]; gradient?: { conical?: { centerPointX?: number; centerPointY?: number }; }; }\n | { type: 'image'; uri?: string /* shorthand for image.imageFileURI */; sourceSet?: Source[]; placeholderBehavior?: { enabled?: boolean } /* a graphic's replace-me switch: on its fill, never on the block */; image?: { externalReference?: string; imageFileURI?: string; previewFileURI?: string }; }\n | { type: 'video'; uri?: string /* shorthand for video.fileURI */; playback?: { trimOffset?: number; trimLength?: number; volume?: number } /* as block playback */; placeholderBehavior?: { enabled?: boolean } /* a graphic's replace-me switch: on its fill, never on the block */; video?: { fileURI?: string; totalDuration?: number }; }\n | { type: 'pixelStream'; pixelStream?: { orientation?: 'Up' | 'Down' | 'Left' | 'Right' | 'UpMirrored' | 'DownMirrored' | 'LeftMirrored' | 'RightMirrored' } }\n | { type: 'stripe'; stripe?: { angle?: number; color?: Color; gap?: number; width?: number } }\n);\ntype Shape = { modifiers?: Modifier[] /* applied in order; [] clears */; keyframes?: Keyframes } & (\n | { type: 'rect'; rect?: { cornerRadiusBL?: number; cornerRadiusBR?: number; cornerRadiusTL?: number; cornerRadiusTR?: number } }\n | { type: 'line' }\n | { type: 'ellipse' }\n | { type: 'polygon'; polygon?: { cornerRadius?: number; sides?: number } }\n | { type: 'star'; star?: { cornerRadius?: number; innerDiameter?: number; innerRadius?: number; innerRoundness?: number; outerRadius?: number; outerRoundness?: number; points?: number; rotation?: number } }\n | { type: 'vector_path'; vector_path?: { cornerRadius?: number; fillRule?: 'EvenOdd' | 'NonZero'; height?: number; holes?: string[] /* cut-outs, wound for you */; path?: string; width?: number /* width/height: the path's frame, not the block size */ } }\n | { type: 'compound'; subshapes?: Subshape[] /* combined in order by compound.mode; [] clears */; compound?: { fillRule?: 'EvenOdd' | 'NonZero'; height?: number; mode?: 'Merge' | 'Add' | 'Subtract' | 'Intersect' | 'Exclude'; width?: number; }; }\n);\n// Subshape and modifier angles are radians; units: api#shapes.md.\ntype Subshape = Shape & { height?: number; rotation?: number; skew?: number; skewAxis?: number; width?: number; anchor?: { x?: number; y?: number }; position?: { x?: number; y?: number }; scale?: { x?: number; y?: number } };\ntype Modifier = { keyframes?: Keyframes } & (\n | { type: 'trim'; trim?: { end?: number; mode?: 'Simultaneous' | 'Individual'; offset?: number; start?: number } }\n | { type: 'repeater'; repeater?: { anchorX?: number; anchorY?: number; composite?: 'Below' | 'Above'; copies?: number; endOpacity?: number; offset?: number; positionX?: number; positionY?: number; rotation?: number; scaleX?: number; scaleY?: number; startOpacity?: number } }\n | { type: 'round_corners'; round_corners?: { radius?: number } }\n | { type: 'offset'; offset?: { amount?: number; join?: 'Bevel' | 'Miter' | 'Round'; miterLimit?: number } }\n | { type: 'zigzag'; zigzag?: { pointType?: 'Corner' | 'Smooth'; ridges?: number; size?: number } }\n | { type: 'pucker_bloat'; pucker_bloat?: { amount?: number } }\n | { type: 'twist'; twist?: { angle?: number; centerX?: number; centerY?: number } }\n);\ntype Blur = { enabled?: boolean; keyframes?: Keyframes } & (\n | { type: 'uniform'; uniform?: { intensity?: number; mode?: 'Fill' | 'Block' } }\n | { type: 'linear'; linear?: { blurRadius?: number; x1?: number; x2?: number; y1?: number; y2?: number } }\n | { type: 'mirrored'; mirrored?: { blurRadius?: number; gradientSize?: number; size?: number; x1?: number; x2?: number; y1?: number; y2?: number } }\n | { type: 'radial'; radial?: { blurRadius?: number; gradientRadius?: number; radius?: number; x?: number; y?: number } }\n);\n// Effect (the effects: [...] arms) is below the upstream marker, for its size.\ntype Mask = { shape: Shape | Shape['type']; expansion?: number; feather?: number; inverted?: boolean; mode?: 'Add' | 'Subtract' | 'Intersect' | 'Lighten' | 'Darken' | 'Difference' | 'None'; opacity?: number; keyframes?: Keyframes };\ntype Animation = { duration?: number /* s; a loop's: one cycle */; easing?: AnimationEasing /* ignored by pop spin_loop fade_loop blur_loop pulsating_loop breathing_loop jump_loop squeeze_loop sway_loop typewriter_text block_swipe_text */; writingStyle?: 'Block' | 'Line' | 'Character' | 'Word' /* text only: slide pan fade blur grow zoom pop wipe baseline spin block_swipe_text */; overlap?: number /* 0–1, text units */ } & (\n | { type: 'slide'; slide?: { direction?: number /* radians: 0 = right, π/2 down, π left, 3π/2 up */; fade?: boolean } }\n | { type: 'pan'; pan?: { direction?: number /* radians, as slide */; distance?: number; fade?: boolean } }\n | { type: 'fade' }\n | { type: 'blur'; blur?: { fade?: boolean; intensity?: number } }\n | { type: 'grow'; grow?: { direction?: 'Horizontal' | 'Vertical' | 'All' | 'TopLeft' | 'TopRight' | 'BottomLeft' | 'BottomRight'; scaleFactor?: number } }\n | { type: 'zoom'; zoom?: { fade?: boolean } }\n | { type: 'pop' }\n | { type: 'wipe'; wipe?: { direction?: 'Up' | 'Right' | 'Down' | 'Left' } }\n | { type: 'baseline'; baseline?: { direction?: 'Up' | 'Right' | 'Down' | 'Left' } }\n | { type: 'crop_zoom'; crop_zoom?: { fade?: boolean; scale?: number } }\n | { type: 'spin'; spin?: { direction?: 'Clockwise' | 'CounterClockwise'; fade?: boolean; intensity?: number } }\n | { type: 'spin_loop'; spin_loop?: { direction?: 'Clockwise' | 'CounterClockwise' } }\n | { type: 'fade_loop' }\n | { type: 'blur_loop'; blur_loop?: { intensity?: number } }\n | { type: 'pulsating_loop'; pulsating_loop?: { intensity?: number } }\n | { type: 'breathing_loop'; breathing_loop?: { intensity?: number } }\n | { type: 'jump_loop'; jump_loop?: { direction?: 'Up' | 'Right' | 'Down' | 'Left'; intensity?: number } }\n | { type: 'squeeze_loop' }\n | { type: 'sway_loop'; sway_loop?: { intensity?: number } }\n | { type: 'scale_loop' }\n | { type: 'typewriter_text'; typewriter_text?: { writingStyle?: 'Character' | 'Word' } }\n | { type: 'block_swipe_text'; block_swipe_text?: { blockColor?: Color; direction?: 'Up' | 'Right' | 'Down' | 'Left'; useTextColor?: boolean } }\n | { type: 'spread_text'; spread_text?: { fade?: boolean; intensity?: number } }\n | { type: 'merge_text'; merge_text?: { direction?: 'Right' | 'Left'; intensity?: number } }\n | { type: 'ken_burns'; ken_burns?: { direction?: 'Up' | 'Right' | 'Down' | 'Left'; fade?: boolean; travelDistanceRatio?: number; zoomIntensity?: number } }\n);\ntype Transition = { duration?: number /* s, default 1.2: overlap with the next clip */; easing?: AnimationEasing /* default EaseInOutQuint */ } & (\n | { type: 'cross-fade'; 'cross-fade'?: { morph?: boolean }; }\n | { type: 'cross-blur'; 'cross-blur'?: { morph?: boolean; sigma?: number }; }\n | { type: 'cross-spin'; 'cross-spin'?: { direction?: 'Clockwise' | 'CounterClockwise'; intensity?: number }; }\n | { type: 'cross-zoom'; 'cross-zoom'?: { morph?: boolean; zoom?: number }; }\n | { type: 'cross-warp'; 'cross-warp'?: { morph?: boolean; zoom?: number }; }\n | { type: 'push'; push?: { direction?: 'Left' | 'Right' | 'Up' | 'Down'; morph?: boolean } }\n | { type: 'slide'; slide?: { direction?: 'Left' | 'Right' | 'Up' | 'Down'; morph?: boolean } }\n | { type: 'stack'; stack?: { direction?: 'Left' | 'Right' | 'Up' | 'Down'; morph?: boolean } }\n | { type: 'splice'; splice?: { bandCount?: number; direction?: 'Left' | 'Right' | 'Up' | 'Down'; morph?: boolean } }\n | { type: 'diagonal-splice'; 'diagonal-splice'?: { direction?: 'RaisedRamp' | 'LoweredRamp'; morph?: boolean }; }\n | { type: 'fade'; fade?: { color?: Color; morph?: boolean } }\n | { type: 'fade-to-white'; 'fade-to-white'?: { morph?: boolean }; }\n | { type: 'fade-to-black'; 'fade-to-black'?: { morph?: boolean }; }\n | { type: 'color-wipe'; 'color-wipe'?: { color?: Color; direction?: 'Left' | 'Right' | 'Up' | 'Down'; morph?: boolean }; }\n | { type: 'line-wipe'; 'line-wipe'?: { morph?: boolean }; }\n | { type: 'wipe'; wipe?: { direction?: 'Left' | 'Right' | 'Up' | 'Down'; morph?: boolean } }\n | { type: 'clock-wipe' }\n | { type: 'chop'; chop?: { corner?: 'TopLeft' | 'TopRight' | 'BottomLeft' | 'BottomRight'; direction?: 'Clockwise' | 'CounterClockwise'; morph?: boolean } }\n | { type: 'gradient-fade'; 'gradient-fade'?: { color?: Color; direction?: 'Left' | 'Right' | 'Up' | 'Down'; morph?: boolean }; }\n | { type: 'two-stripes'; 'two-stripes'?: { direction?: 'Horizontal' | 'Vertical'; morph?: boolean }; }\n);\n// ---- vocabulary referenced above (hoisted from the upstream core) ----\ninterface CMYKColor {\n c: number;\n m: number;\n y: number;\n k: number;\n tint?: number /* 0..1, default 1 */;\n}\ninterface Font {\n uri: string;\n subFamily?: string;\n weight?: FontWeight;\n style?: FontStyle;\n}\ninterface GradientColorStop {\n color: Color;\n stop: number;\n}\ninterface RGBAColor {\n r: number;\n g: number;\n b: number;\n a: number;\n}\ninterface Source {\n uri: string;\n width: number;\n height: number;\n}\ninterface SpotColor {\n name: string /* a spotColors ink */;\n tint?: number /* 0..1, default 1 */;\n externalReference?: string /* default '' */;\n}\ninterface TextDecorationConfig {\n lines: TextDecorationLine[];\n style?: TextDecorationStyle;\n underlineColor?: Color;\n underlineThickness?: number;\n underlineOffset?: number;\n skipInk?: boolean;\n}\ninterface Typeface {\n name: string;\n fonts: Font[];\n}\ntype AnimationEasing = 'Linear' | 'EaseIn' | 'EaseOut' | 'EaseInOut' | 'EaseInQuart' | 'EaseOutQuart' | 'EaseInOutQuart' | 'EaseInQuint' | 'EaseOutQuint' | 'EaseInOutQuint' | 'EaseInBack' | 'EaseOutBack' | 'EaseInOutBack' | 'EaseInSpring' | 'EaseOutSpring' | 'EaseInOutSpring';\ntype Color = RGBAColor | CMYKColor | SpotColor;\ntype DesignBlockId = number;\ntype DesignBlockType = 'scene' | 'stack' | 'camera' | 'page' | 'graphic' | 'audio' | 'text' | 'group' | 'cutout' | 'track' | 'caption' | 'captionTrack' | 'exclusionArea'; // each also valid as '//ly.img.ubq/<name>'\ntype FontStyle = 'normal' | 'italic';\ntype FontWeight = 'thin' | 'extraLight' | 'light' | 'normal' | 'medium' | 'semiBold' | 'bold' | 'extraBold' | 'heavy';\ntype ListStyle = 'None' | 'Unordered' | 'Ordered';\ntype Scope = 'text/edit' | 'text/character' | 'fill/change' | 'fill/changeType' | 'stroke/change' | 'shape/change' | 'layer/move' | 'layer/resize' | 'layer/rotate' | 'layer/flip' | 'layer/crop' | 'layer/opacity' | 'layer/blendMode' | 'layer/visibility' | 'layer/clipping' | 'appearance/adjustments' | 'appearance/filter' | 'appearance/effect' | 'appearance/blur' | 'appearance/shadow' | 'appearance/animation' | 'lifecycle/destroy' | 'lifecycle/duplicate' | 'editor/add' | 'editor/select';\ntype ScriptStyle = 'Normal' | 'Superscript' | 'Subscript';\ntype TextCase = 'Normal' | 'Uppercase' | 'Lowercase' | 'Titlecase';\ntype TextDecorationLine = 'None' | 'Underline' | 'Strikethrough' | 'Overline';\ntype TextDecorationStyle = 'Solid' | 'Double' | 'Dotted' | 'Dashed' | 'Wavy';\n\n// ============================================================================\n// Upstream CE.SDK surface (flattened) follows — REFERENCE ONLY: edit code\n// never calls it; engine.design above covers it. Exports are the export tool.\n// ============================================================================\n// engine.design's setSettings/getSettings (kept here, outside the inline\n// section, for its size): editor settings in the props dialect.\ninterface SettingsProps {\n archival?: { bundleOnlyUsedFontVariants?: boolean };\n basePath?: string;\n blockAnimations?: { enabled?: boolean };\n borderOutlineColor?: Color;\n camera?: {\n clamping?: { overshootMode?: 'Center' | 'Reverse' };\n };\n clampThumbnailTextureSizes?: boolean;\n clearColor?: Color;\n colorMaskingSettings?: { maskColor?: Color };\n colorPicker?: { colorMode?: string };\n controlGizmo?: {\n blockScaleDownLimit?: number;\n moveHandleVisibility?: 'auto' | 'always' | 'never';\n resizeHandlesVisibility?: 'auto' | 'always' | 'never';\n rotateHandlesVisibility?: 'auto' | 'always' | 'never';\n scaleHandlesVisibility?: 'auto' | 'always' | 'never';\n showCropHandles?: boolean;\n showCropScaleHandles?: boolean;\n };\n cropOverlayColor?: Color;\n defaultEmojiFontFileUri?: string;\n defaultFontFileUri?: string;\n doubleClickSelectionMode?: 'Direct' | 'Hierarchical';\n doubleClickToCropEnabled?: boolean;\n dragToSwapFills?: { enabled?: boolean; longPressDurationMs?: number };\n errorStateColor?: Color;\n exportPendingTimeoutSeconds?: number;\n fallbackCMYKProfileUri?: string;\n fallbackFontUri?: string;\n forceSystemEmojis?: boolean;\n grid?: { color?: Color; enabled?: boolean; snapEnabled?: boolean; spacingX?: number; spacingY?: number };\n handleFillColor?: Color;\n highlightColor?: Color;\n license?: string;\n listIndentPerLevel?: number /* em per level */;\n maxConcurrentRequestsPerHost?: number;\n maxImageSize?: number;\n maxPreviewResolution?: number;\n mouse?: { enableScroll?: boolean; enableZoom?: boolean };\n page?: {\n allowCropInteraction?: boolean;\n allowMoveInteraction?: boolean;\n allowResizeInteraction?: boolean;\n allowRotateInteraction?: boolean;\n allowShapeChange?: boolean;\n dimOutOfPageAreas?: boolean;\n exclusionAreaFillColor?: Color;\n exclusionAreaFrameColor?: Color;\n flipDimensionsOn90DegreeCropRotation?: boolean;\n highlightDropTarget?: boolean;\n highlightWhenCropping?: boolean;\n innerBorderColor?: Color;\n marginFillColor?: Color;\n marginFrameColor?: Color;\n marqueeSelectOnBodyDrag?: boolean;\n moveChildrenWhenCroppingFill?: boolean;\n outerBorderColor?: Color;\n reparentBlocksToSceneWhenOutOfPage?: boolean;\n restrictPageSelectionToBorderAndTitle?: boolean;\n restrictResizeInteractionToFixedAspectRatio?: boolean;\n safetyFillColor?: Color;\n safetyFrameColor?: Color;\n safetyRevealDuringTransform?: boolean;\n selectWhenNoBlocksSelected?: boolean;\n title?: {\n appendPageName?: boolean;\n canEdit?: boolean;\n color?: Color;\n fontFileUri?: string;\n separator?: string;\n show?: boolean;\n showOnSinglePage?: boolean;\n showPageTitleTemplate?: boolean;\n };\n };\n pageHighlightColor?: Color;\n placeholderControls?: { showButton?: boolean; showOverlay?: boolean };\n placeholderHighlightColor?: Color;\n playback?: { showAllBlocks?: boolean };\n positionSnappingThreshold?: number;\n progressColor?: Color;\n rotationSnappingGuideColor?: Color;\n rotationSnappingThreshold?: number;\n showBuildVersion?: boolean;\n snappingGuideColor?: Color;\n tabStopInterval?: number;\n textVariableHighlightColor?: Color;\n timeline?: { trackVisibility?: string };\n touch?: {\n dragStartCanSelect?: boolean;\n pinchAction?: 'None' | 'Zoom' | 'Scale' | 'Auto' | 'Dynamic';\n rotateAction?: 'None' | 'Rotate';\n singlePointPanning?: boolean;\n };\n upload?: { supportedMimeTypes?: string };\n useSystemFontFallback?: boolean;\n web?: { fetchCredentials?: string };\n}\n// engine.design's effects: [...] (kept here, outside the inline section, for its\n// size): one arm per effect type, its options under a key named after it.\ntype Effect = { enabled?: boolean; keyframes?: Keyframes } & (\n | { type: 'adjustments'; adjustments?: { blacks?: number; brightness?: number; clarity?: number; contrast?: number; exposure?: number; gamma?: number; highlights?: number; saturation?: number; shadows?: number; sharpness?: number; temperature?: number; whites?: number } }\n | { type: 'bulge'; bulge?: { centerX?: number; centerY?: number; height?: number; horizontalRadius?: number; verticalRadius?: number } }\n | { type: 'corner_pin'; corner_pin?: { lowerLeftX?: number; lowerLeftY?: number; lowerRightX?: number; lowerRightY?: number; upperLeftX?: number; upperLeftY?: number; upperRightX?: number; upperRightY?: number } }\n | { type: 'cross_cut'; cross_cut?: { offset?: number; slices?: number; speedV?: number; time?: number } }\n | { type: 'displacement_map'; displacement_map?: { horizontalChannel?: 'Red' | 'Green' | 'Blue' | 'Alpha' | 'Luminance' | 'Hue' | 'Lightness' | 'Saturation' | 'Full' | 'Half' | 'Off'; mapBehavior?: 'Center' | 'Stretch' | 'Tile'; maxHorizontal?: number; maxVertical?: number; verticalChannel?: 'Red' | 'Green' | 'Blue' | 'Alpha' | 'Luminance' | 'Hue' | 'Lightness' | 'Saturation' | 'Full' | 'Half' | 'Off'; wrapPixels?: boolean } }\n | { type: 'dot_pattern'; dot_pattern?: { blur?: number; dots?: number; size?: number } }\n | { type: 'duotone_filter'; duotone_filter?: { darkColor?: Color; intensity?: number; lightColor?: Color } }\n | { type: 'extrude_blur'; extrude_blur?: { amount?: number } }\n | { type: 'fill'; fill?: { color?: Color; opacity?: number } }\n | { type: 'glow'; glow?: { amount?: number; darkness?: number; size?: number } }\n | { type: 'green_screen'; green_screen?: { colorMatch?: number; fromColor?: Color; smoothness?: number; spill?: number } }\n | { type: 'half_tone'; half_tone?: { angle?: number; scale?: number } }\n | { type: 'invert'; invert?: { channel?: 'RGB' | 'Red' | 'Green' | 'Blue' | 'HLS' | 'Hue' | 'Lightness' | 'Saturation' | 'YIQ' | 'Luma' | 'InPhaseChroma' | 'QuadratureChroma' | 'Alpha' } }\n | { type: 'levels'; levels?: { alphaGamma?: number; alphaInBlack?: number; alphaInWhite?: number; alphaOutBlack?: number; alphaOutWhite?: number; blueGamma?: number; blueInBlack?: number; blueInWhite?: number; blueOutBlack?: number; blueOutWhite?: number; clipToOutBlack?: boolean; clipToOutWhite?: boolean; greenGamma?: number; greenInBlack?: number; greenInWhite?: number; greenOutBlack?: number; greenOutWhite?: number; redGamma?: number; redInBlack?: number; redInWhite?: number; redOutBlack?: number; redOutWhite?: number; rgbGamma?: number; rgbInBlack?: number; rgbInWhite?: number; rgbOutBlack?: number; rgbOutWhite?: number } }\n | { type: 'linear_wipe'; linear_wipe?: { angle?: number; completion?: number; feather?: number } }\n | { type: 'linocut'; linocut?: { scale?: number } }\n | { type: 'liquid'; liquid?: { amount?: number; scale?: number; time?: number } }\n | { type: 'lut_filter'; lut_filter?: { filterId?: string; horizontalTileCount?: number; intensity?: number; lutFileURI?: string; verticalTileCount?: number } }\n | { type: 'mirror'; mirror?: { side?: number } }\n | { type: 'outliner'; outliner?: { amount?: number; passthrough?: number } }\n | { type: 'pixelize'; pixelize?: { horizontalPixelSize?: number; verticalPixelSize?: number } }\n | { type: 'posterize'; posterize?: { levels?: number } }\n | { type: 'radial_pixel'; radial_pixel?: { radius?: number; segments?: number } }\n | { type: 'radial_wipe'; radial_wipe?: { centerX?: number; centerY?: number; completion?: number; direction?: 'Clockwise' | 'Counterclockwise' | 'Both'; feather?: number; startAngle?: number } }\n | { type: 'recolor'; recolor?: { brightnessMatch?: number; colorMatch?: number; fromColor?: Color; smoothness?: number; toColor?: Color } }\n | { type: 'sharpie' }\n | { type: 'shift_channels'; shift_channels?: { takeAlphaFrom?: 'Alpha' | 'Red' | 'Green' | 'Blue' | 'Luminance' | 'Hue' | 'Lightness' | 'Saturation' | 'FullOn' | 'FullOff'; takeBlueFrom?: 'Alpha' | 'Red' | 'Green' | 'Blue' | 'Luminance' | 'Hue' | 'Lightness' | 'Saturation' | 'FullOn' | 'FullOff'; takeGreenFrom?: 'Alpha' | 'Red' | 'Green' | 'Blue' | 'Luminance' | 'Hue' | 'Lightness' | 'Saturation' | 'FullOn' | 'FullOff'; takeRedFrom?: 'Alpha' | 'Red' | 'Green' | 'Blue' | 'Luminance' | 'Hue' | 'Lightness' | 'Saturation' | 'FullOn' | 'FullOff' } }\n | { type: 'shifter'; shifter?: { amount?: number; angle?: number } }\n | { type: 'stroke'; stroke?: { allMasks?: boolean; brushSize?: number; color?: Color; end?: number; hardness?: number; maskIndex?: number; opacity?: number; paintStyle?: 'OnOriginalImage' | 'OnTransparent'; spacing?: number; start?: number } }\n | { type: 'threshold'; threshold?: { level?: number } }\n | { type: 'tilt_shift'; tilt_shift?: { amount?: number; position?: number } }\n | { type: 'tint'; tint?: { amount?: number; mapBlackTo?: Color; mapWhiteTo?: Color } }\n | { type: 'tritone'; tritone?: { amount?: number; highlights?: Color; midtones?: Color; shadows?: Color } }\n | { type: 'tv_glitch'; tv_glitch?: { distortion?: number; distortion2?: number; rollSpeed?: number; speed?: number } }\n | { type: 'venetian_blinds'; venetian_blinds?: { completion?: number; direction?: number; feather?: number; width?: number } }\n | { type: 'vignette'; vignette?: { darkness?: number; offset?: number } }\n | { type: 'wave_warp'; wave_warp?: { direction?: number; height?: number; phase?: number; waveType?: 'Sine' | 'Square' | 'Triangle' | 'Sawtooth'; width?: number } }\n);\n// engine.design's text.animators[i] / caption.animators[i] (kept here, outside\n// the inline section, for its size): a range selector over the glyphs and what\n// it does to them. Writing opacity/fillColor/strokeColor sets its *Enabled.\n// selectorStart/End/Offset: 0..1 of the text, or unit indices (end exclusive) with selectorUnits 'Index'; rotation: radians; skew/skewAxis: radians; lengths: design units, +y down; strokeWidth: needs the text stroke.enabled\ninterface TextAnimator {\n anchorX?: number | string; anchorY?: number | string; blurX?: number | string; blurY?: number | string;\n fillColor?: Color; fillColorEnabled?: boolean; opacity?: number; opacityEnabled?: boolean;\n positionX?: number | string; positionY?: number | string; rotation?: number; scaleX?: number; scaleY?: number;\n selectorAmount?: number; selectorBasedOn?: 'Characters' | 'CharactersExcludingSpaces' | 'Words' | 'Lines';\n selectorEaseHigh?: number; selectorEaseLow?: number; selectorEnabled?: boolean; selectorEnd?: number;\n selectorOffset?: number; selectorRandomize?: boolean; selectorSeed?: number;\n selectorShape?: 'Square' | 'RampUp' | 'RampDown' | 'Triangle' | 'Round' | 'Smooth';\n selectorSmoothness?: number; selectorStart?: number; selectorUnits?: 'Percentage' | 'Index'; skew?: number;\n skewAxis?: number; strokeColor?: Color; strokeColorEnabled?: boolean; strokeWidth?: number | string;\n tracking?: number | string; keyframes?: { [leaf: string]: unknown };\n}\n// Scalar get/set wrappers (setOpacity, setStrokeWidth, setPositionX, …),\n// is*/supports*/has* predicates, and editor-UI machinery are in\n// signatures-extended.d.ts — prefer engine.design.setProps/getProps/\n// getCapabilities and the capability matrix above; search the sibling\n// file signatures-extended.d.ts when you need the old names.\n\n// CE.SDK CreativeEngine — flattened API signatures. GENERATED by\n// scripts/lib/api-signatures.ts from the @cesdk/node index.d.ts; do not\n// edit. JSDoc is stripped, deprecated overloads with a surviving\n// namesake are dropped, and type aliases are flattened to their literal\n// unions so every string vocabulary is one lookup. Recipes live in\n// the api skill's recipes.md; this file is the exact call surface.\ntype AbortOptions = {\n abortSignal?: AbortSignal;\n};\ntype AddImageOptions = {\n sizeMode?: SizeMode;\n positionMode?: PositionMode;\n x?: number;\n y?: number;\n cornerRadius?: number;\n size?: number | {\n width: number;\n height: number;\n };\n timeline?: {\n timeOffset?: number;\n duration?: number;\n };\n shadow?: DropShadowOptions;\n animation?: AnimationOptions;\n};\ninterface AddVideoOptions {\n sizeMode?: SizeMode;\n positionMode?: PositionMode;\n x?: number;\n y?: number;\n cornerRadius?: number;\n timeline?: {\n timeOffset?: number;\n duration?: number;\n };\n shadow?: DropShadowOptions;\n animation?: AnimationOptions;\n}\ntype AnimationEntry = {\n type: AnimationType;\n duration: number;\n easing?: AnimationEasing;\n};\ntype AnimationOptions = {\n in?: AnimationEntry;\n loop?: AnimationEntry;\n out?: AnimationEntry;\n};\ntype AnimationType = 'slide' | 'pan' | 'fade' | 'blur' | 'grow' | 'zoom' | 'pop' | 'wipe' | 'baseline' | 'crop_zoom' | 'spin' | 'spin_loop' | 'fade_loop' | 'blur_loop' | 'pulsating_loop' | 'breathing_loop' | 'jump_loop' | 'squeeze_loop' | 'sway_loop' | 'scale_loop' | 'typewriter_text' | 'block_swipe_text' | 'spread_text' | 'merge_text' | 'ken_burns'; // each also valid as '//ly.img.ubq/animation/<name>'\ntype AnimationTypeLonghand = `//ly.img.ubq/animation/${AnimationTypeShorthand}`;\ntype AnimationTypeShorthand = 'slide' | 'pan' | 'fade' | 'blur' | 'grow' | 'zoom' | 'pop' | 'wipe' | 'baseline' | 'crop_zoom' | 'spin' | 'spin_loop' | 'fade_loop' | 'blur_loop' | 'pulsating_loop' | 'breathing_loop' | 'jump_loop' | 'squeeze_loop' | 'sway_loop' | 'scale_loop' | 'typewriter_text' | 'block_swipe_text' | 'spread_text' | 'merge_text' | 'ken_burns';\ninterface ApplyAssetOptions {\n clipType?: 'clip' | 'overlay';\n placement?: AssetPlacement;\n abortSignal?: AbortSignal;\n [key: string]: unknown;\n}\ninterface Asset {\n id: string;\n groups?: AssetGroups;\n meta?: AssetMetaData;\n payload?: AssetPayload;\n}\nclass AssetAPI {\n #private;\n addSource(source: AssetSource): void;\n addLocalSource(id: string, supportedMimeTypes?: string[], applyAsset?: (asset: CompleteAssetResult) => Promise<DesignBlockId | undefined>, applyAssetToBlock?: (asset: CompleteAssetResult, block: DesignBlockId) => Promise<void>): void;\n addLocalAssetSourceFromJSONString(contentJSON: string, basePath?: string, options?: {\n matcher?: string[];\n }): Promise<string>;\n addLocalAssetSourceFromJSONURI(contentURI: string, options?: {\n matcher?: string[];\n abortSignal?: AbortSignal;\n }): Promise<string>;\n removeSource(id: string): void;\n findAllSources(): string[];\n findAssets(sourceId: string, query: AssetQueryData): Promise<AssetsQueryResult<CompleteAssetResult>>;\n fetchAsset(sourceId: string, assetId: string, params?: Pick<AssetQueryData, 'locale'>): Promise<CompleteAssetResult | null>;\n getSupportedMimeTypes(sourceId: string): string[];\n /** @deprecated The flag this reads is deprecated. To control whether an upload button is rendered, use the `canAdd` option on an asset library entry instead. */\n canManageAssets(sourceId: string): boolean;\n addAssetToSource(sourceId: string, asset: AssetDefinition): void;\n removeAssetFromSource(sourceId: string, assetId: string): void;\n apply(sourceId: string, assetResult: AssetResult, options?: ApplyAssetOptions): Promise<DesignBlockId | undefined>;\n applyToBlock(sourceId: string, assetResult: AssetResult, block: DesignBlockId): Promise<void>;\n applyProperty(sourceId: string, assetResult: AssetResult, property: AssetProperty): Promise<void>;\n defaultApplyAsset(assetResult: AssetResult, options?: DefaultApplyAssetOptions): Promise<DesignBlockId | undefined>;\n defaultApplyAssetToBlock(assetResult: AssetResult, block: DesignBlockId): Promise<void>;\n onAssetSourceAdded: (callback: (sourceID: string) => void) => (() => void);\n onAssetSourceRemoved: (callback: (sourceID: string) => void) => (() => void);\n onAssetSourceUpdated: (callback: (sourceID: string) => void) => (() => void);\n}\ninterface AssetBooleanProperty {\n property: string;\n type: 'Boolean';\n value: boolean;\n defaultValue: boolean;\n}\ninterface AssetCMYKColor {\n colorSpace: 'CMYK';\n c: number;\n m: number;\n y: number;\n k: number;\n}\ntype AssetColor = AssetRGBColor | AssetCMYKColor | AssetSpotColor;\ninterface AssetColorProperty {\n property: string;\n type: 'Color';\n value: Color;\n defaultValue: Color;\n}\ninterface AssetContentAspectRatio {\n type: 'ContentAspectRatio';\n}\ninterface AssetDefinition extends Asset {\n label?: Record<Locale, string>;\n tags?: Record<Locale, string[]>;\n}\ninterface AssetDropPayload {\n sourceId: string;\n assetId: string;\n target: DesignBlockId | null;\n page: DesignBlockId | null;\n pageX: number;\n pageY: number;\n}\ninterface AssetEnumProperty {\n property: string;\n type: 'Enum';\n value: string;\n defaultValue: string;\n options: string[];\n}\ntype AssetFacetPath = 'tags' | 'groups' | `meta.${string}`;\ninterface AssetFacetValue {\n value: string;\n count?: number;\n}\ntype AssetFilter = AssetPropertyFilter | {\n and: AssetFilter[];\n or?: never;\n not?: never;\n property?: never;\n} | {\n or: AssetFilter[];\n and?: never;\n not?: never;\n property?: never;\n} | {\n not: AssetFilter;\n and?: never;\n or?: never;\n property?: never;\n};\ninterface AssetFixedAspectRatio {\n type: 'FixedAspectRatio';\n width: number;\n height: number;\n}\ninterface AssetFixedSize {\n type: 'FixedSize';\n width: number;\n height: number;\n designUnit: DesignUnit;\n}\ninterface AssetFreeAspectRatio {\n type: 'FreeAspectRatio';\n}\ntype AssetGroups = string[];\ntype AssetMetaData = {\n mimeType?: string;\n blockType?: string;\n fillType?: string;\n shapeType?: string;\n kind?: string;\n uri?: string;\n thumbUri?: string;\n previewUri?: string;\n sourceSet?: Source[];\n filename?: string;\n vectorPath?: string;\n width?: number;\n height?: number;\n duration?: string;\n effectType?: string;\n blurType?: string;\n looping?: boolean;\n} & Record<string, unknown>;\ninterface AssetNumberProperty {\n property: string;\n type: 'Int' | 'Float' | 'Double';\n value: number;\n defaultValue: number;\n min: number;\n max: number;\n step: number;\n}\ninterface AssetPayload {\n color?: AssetColor;\n sourceSet?: Source[];\n typeface?: Typeface;\n transformPreset?: AssetTransformPreset;\n properties?: AssetProperty[];\n stylePreset?: AssetStylePreset;\n}\ninterface AssetPlacement {\n parent?: DesignBlockId;\n center?: {\n x: number;\n y: number;\n };\n}\ntype AssetProperty = AssetBooleanProperty | AssetColorProperty | AssetEnumProperty | AssetNumberProperty | AssetStringProperty;\ntype AssetPropertyFilter = {\n property: AssetPropertyPath;\n} & ({\n contains: string;\n equals?: never;\n} | {\n equals: string;\n contains?: never;\n});\ntype AssetPropertyPath = 'label' | 'tags' | 'id' | 'groups' | `meta.${string}`;\ninterface AssetQueryData {\n query?: string;\n page: number;\n tags?: string | string[];\n groups?: AssetGroups;\n excludeGroups?: AssetGroups;\n locale?: Locale;\n perPage: number;\n sortingOrder?: SortingOrder;\n sortKey?: string;\n sortActiveFirst?: boolean;\n filter?: AssetFilter[];\n facets?: AssetFacetPath[];\n}\ninterface AssetResult extends Asset {\n locale?: Locale;\n label?: string;\n tags?: string[];\n active?: boolean;\n credits?: {\n name: string;\n url?: string;\n };\n license?: {\n name: string;\n url?: string;\n };\n utm?: {\n source?: string;\n medium?: string;\n };\n}\ninterface AssetRGBColor {\n colorSpace: 'sRGB';\n r: number;\n g: number;\n b: number;\n}\ninterface AssetSource {\n id: string;\n findAssets(queryData: AssetQueryData): Promise<AssetsQueryResult | undefined>;\n fetchAsset?: (id: string, params?: Pick<AssetQueryData, 'locale'>) => Promise<AssetResult | null>;\n getGroups?: () => Promise<string[]>;\n credits?: {\n name: string;\n url?: string;\n };\n license?: {\n name: string;\n url?: string;\n };\n /** @deprecated Will be removed in v1.11. Use `canAdd` and `canRemove` in the asset library configuration */\n canManageAssets?: boolean;\n applyAsset?: (asset: CompleteAssetResult) => Promise<DesignBlockId | undefined>;\n applyAssetToBlock?: (asset: CompleteAssetResult, block: DesignBlockId) => Promise<void>;\n applyAssetProperty?: (asset: CompleteAssetResult, property: AssetProperty) => Promise<void>;\n addAsset?(asset: AssetDefinition): void;\n removeAsset?(assetId: string): void;\n getSupportedMimeTypes?(): string[] | undefined;\n}\ninterface AssetSpotColor {\n colorSpace: 'SpotColor';\n name: string;\n externalReference: string;\n representation: AssetRGBColor | AssetCMYKColor;\n}\ninterface AssetsQueryResult<T extends AssetResult = AssetResult> {\n assets: T[];\n currentPage: number;\n nextPage?: number;\n total: number;\n facets?: {\n [path: string]: AssetFacetValue[];\n };\n}\ninterface AssetStringProperty {\n property: string;\n type: 'String';\n value: string;\n defaultValue: string;\n}\ninterface AssetStylePreset {\n blockType?: '//ly.img.ubq/text' | '//ly.img.ubq/caption';\n mode?: 'replace' | 'merge';\n typeface?: {\n family: string;\n weight?: FontWeight;\n style?: FontStyle;\n };\n fontSize?: {\n scale: number;\n resizeExistingOnApply?: boolean;\n };\n scaleWithFontSize?: Array<{\n property: AssetStylePresetScalableProperty;\n ratio: number;\n }>;\n properties?: AssetStylePresetProperties;\n inAnimation?: AssetStylePresetAnimation;\n outAnimation?: AssetStylePresetAnimation;\n loopAnimation?: AssetStylePresetAnimation;\n}\ninterface AssetStylePresetAnimation {\n type: AnimationTypeLonghand;\n properties?: AssetStylePresetAnimationProperties;\n}\ntype AssetStylePresetAnimationProperties = {\n [K in Extract<BoolPropertyName, `animation/${string}`>]?: boolean;\n} & {\n [K in Extract<EnumPropertyName, `animation/${string}`>]?: string;\n} & {\n [K in Extract<FloatPropertyName, `animation/${string}`>]?: number;\n} & {\n [K in Extract<ColorPropertyName, `animation/${string}`>]?: RGBColor | RGBAColor;\n} & {\n 'playback/duration'?: number;\n animationEasing?: string;\n textWritingStyle?: string;\n textWritingOverlap?: number;\n} & {\n [path: string]: AssetStylePresetPropertyValue;\n};\ntype AssetStylePresetProperties = {\n [K in BoolPropertyName as string extends K ? never : K]?: boolean;\n} & {\n [K in IntPropertyName as string extends K ? never : K]?: number;\n} & {\n [K in FloatPropertyName as string extends K ? never : K]?: number;\n} & {\n [K in DoublePropertyName as string extends K ? never : K]?: number;\n} & {\n [K in StringPropertyName as string extends K ? never : K]?: string;\n} & {\n [K in EnumPropertyName as string extends K ? never : K]?: string;\n} & {\n [K in ColorPropertyName as string extends K ? never : K]?: RGBColor | RGBAColor;\n} & {\n 'text/path'?: string | null;\n} & {\n [path: string]: AssetStylePresetPropertyValue;\n};\ntype AssetStylePresetPropertyValue = boolean | number | string | RGBColor | RGBAColor | null;\ntype AssetStylePresetScalableProperty = 'stroke/width' | 'dropShadow/offset/x' | 'dropShadow/offset/y' | 'dropShadow/blurRadius/x' | 'dropShadow/blurRadius/y' | 'backgroundColor/cornerRadius';\ntype AssetTransformPreset = AssetFixedAspectRatio | AssetFreeAspectRatio | AssetContentAspectRatio | AssetFixedSize;\ntype AsyncURIResolver = (URI: string, defaultURIResolver: (URI: string) => string) => Promise<string> | string;\nconst AudioCodec: {\n readonly Auto: 0;\n readonly AAC: 1;\n readonly Opus: 2;\n};\ntype AudioCodec = (typeof AudioCodec)[keyof typeof AudioCodec];\nclass BlockAPI {\n #private;\n getDominantColors(handle: DesignBlockId, options?: DominantColorsOptions): Promise<DominantColor[]>;\n onSelectionChanged: (callback: () => void) => (() => void);\n onClicked: (callback: (id: DesignBlockId) => void) => (() => void);\n enterGroup(id: DesignBlockId): void;\n exitGroup(id: DesignBlockId): void;\n isCombinable(ids: DesignBlockId[]): boolean;\n combine(ids: DesignBlockId[], op: BooleanOperation): DesignBlockId;\n findByKind(kind: string): DesignBlockId[];\n findAll(): DesignBlockId[];\n findAllUnused(): DesignBlockId[];\n findAllInExclusionAreas(): DesignBlockId[];\n removeSubshape(id: DesignBlockId, index: number): void;\n isLineOrigin(id: DesignBlockId): boolean;\n isValid(id: DesignBlockId): boolean;\n getScreenSpaceBoundingBoxXYWH(ids: DesignBlockId[]): XYWH;\n isPropertyReadable(property: string): boolean;\n isPropertyWritable(property: string): boolean;\n getPropertyType(property: string): PropertyType;\n getEnumValues<T = string>(enumProperty: string): T[];\n /** @deprecated Use getColor() instead. */\n getColorSpotName(id: DesignBlockId, property: string): string;\n /** @deprecated Use getColor() instead. */\n getColorSpotTint(id: DesignBlockId, property: string): number;\n addVideoFileURIToSourceSet(id: DesignBlockId, property: SourceSetPropertyName, uri: string, options?: AbortOptions): Promise<void>;\n isCropAspectRatioLocked(id: DesignBlockId): boolean;\n canRevertToOriginalRatio(id: DesignBlockId): boolean;\n removeModifier(id: DesignBlockId, index: number): void;\n isEffectEnabled(effectId: DesignBlockId): boolean;\n createCutoutFromBlocks(ids: DesignBlockId[], vectorizeDistanceThreshold?: number, simplifyDistanceThreshold?: number, useExistingShapeInformation?: boolean): DesignBlockId;\n createCutoutFromPath(path: string): DesignBlockId;\n createCutoutFromOperation(ids: DesignBlockId[], op: CutoutOperation): DesignBlockId;\n removeText(id: DesignBlockId, from?: number, to?: number): void;\n setTextBackgroundColor(id: DesignBlockId, color: Color, from?: number, to?: number): void;\n getTextBackgroundColors(id: DesignBlockId, from?: number, to?: number): Array<Color>;\n getTextScriptStyles(id: DesignBlockId, from?: number, to?: number): ScriptStyle[];\n setTextScriptStyle(id: DesignBlockId, scriptStyle: ScriptStyle, from?: number, to?: number): void;\n getTextDecorations(id: DesignBlockId, from?: number, to?: number): TextDecorationConfig[];\n canToggleBoldFont(id: DesignBlockId, from?: number, to?: number): boolean;\n canToggleItalicFont(id: DesignBlockId, from?: number, to?: number): boolean;\n getTextCursorRange(): Range_2;\n setTextCursorRange(range: Range_2): void;\n getTextVisibleLineGlobalBoundingBoxXYWH(id: DesignBlockId, lineIndex: number): XYWH;\n getTextEffectiveHorizontalAlignment(id: DesignBlockId): 'Left' | 'Right' | 'Center' | 'Justify';\n isPlaceholderControlsOverlayEnabled(id: DesignBlockId): boolean;\n isPlaceholderControlsButtonEnabled(id: DesignBlockId): boolean;\n setPageDurationSource(page: DesignBlockId, id: DesignBlockId): void;\n isPageDurationSource(id: DesignBlockId): boolean;\n removePageDurationSource(id: DesignBlockId): void;\n split(id: DesignBlockId, atTime: number, options?: SplitOptions): DesignBlockId;\n /** @deprecated Use `getDuration` and pass a page block. */\n getTotalSceneDuration(scene: DesignBlockId): number;\n isVisibleAtCurrentPlaybackTime(id: DesignBlockId): boolean;\n isForceMuted(id: DesignBlockId): boolean;\n setAudioFadeIn(id: DesignBlockId, duration: number, easing?: AnimationEasing): void;\n setAudioFadeOut(id: DesignBlockId, duration: number, easing?: AnimationEasing): void;\n unstable_isAVResourceLoaded(id: DesignBlockId): boolean;\n unstable_setImportedImageDefinition(id: DesignBlockId, definition: ImportedImageDefinitionInput): void;\n unstable_getImportedImageDefinition(id: DesignBlockId): ImportedImageDefinitionInfo;\n getVideoWidth(id: DesignBlockId): number;\n getVideoHeight(id: DesignBlockId): number;\n generateVideoThumbnailSequence(id: DesignBlockId, thumbnailHeight: number, timeBegin: number, timeEnd: number, numberOfFrames: number, onFrame: (frameIndex: number, result: ImageData | Error) => void): () => void;\n /** @deprecated Use `generateVideoThumbnailSequence` instead. */\n getVideoFillThumbnail(id: DesignBlockId, thumbnailHeight: number): Promise<Blob>;\n /** @deprecated Use `generateVideoThumbnailSequence` instead. */\n getVideoFillThumbnailAtlas(id: DesignBlockId, numberOfColumns: number, numberOfRows: number, thumbnailHeight: number): Promise<Blob>;\n /** @deprecated Use `generateVideoThumbnailSequence` instead. */\n getPageThumbnailAtlas(id: DesignBlockId, numberOfColumns: number, numberOfRows: number, thumbnailHeight: number): Promise<Blob>;\n setNativePixelBuffer(id: number, buffer: HTMLCanvasElement | HTMLVideoElement): void;\n getState(id: DesignBlockId): BlockState;\n setState(id: DesignBlockId, state: BlockState): void;\n onStateChanged: (ids: DesignBlockId[], callback: (ids: DesignBlockId[]) => void) => (() => void);\n addImage(url: string, options?: AddImageOptions): Promise<DesignBlockId>;\n addVideo(url: string, width: number, height: number, options?: AddVideoOptions): Promise<DesignBlockId>;\n applyAnimation(block: DesignBlockId, animation?: AnimationOptions): void;\n applyDropShadow(block: DesignBlockId, options?: DropShadowOptions): void;\n generateThumbnailAtTimeOffset(height: number, time: number): Promise<Blob>;\n getBackgroundTrack(): DesignBlockId | null;\n moveToBackgroundTrack(block: DesignBlockId): void;\n}\ninterface BlockEvent {\n block: DesignBlockId;\n type: 'Created' | 'Updated' | 'Destroyed';\n}\ntype BlockState = BlockStateError | BlockStatePending | BlockStateReady;\ninterface BlockStateError {\n type: 'Error';\n error: 'AudioDecoding' | 'ImageDecoding' | 'FileFetch' | 'Unknown' | 'VideoDecoding';\n engineError?: EngineError;\n}\ninterface BlockStatePending {\n type: 'Pending';\n progress: number;\n}\ninterface BlockStateReady {\n type: 'Ready';\n}\ntype BooleanOperation = 'Difference' | 'Intersection' | 'Union' | 'XOR';\ntype BoolPropertyName = 'alwaysOnBottom' | 'alwaysOnTop' | 'clipped' | 'flip/horizontal' | 'flip/vertical' | 'highlightEnabled' | 'includedInExport' | 'placeholder/enabled' | 'playback/playing' | 'playback/soloPlaybackEnabled' | 'scene/aspectRatioLock' | 'scene/extendedPanningArea' | 'selected' | 'selectionEnabled' | 'transformLocked' | 'visible' | 'blur/enabled' | 'dropShadow/clip' | 'dropShadow/enabled' | 'fill/enabled' | 'fill/overprint' | 'page/guides/gridEnabled' | 'page/guides/gridSnapEnabled' | 'page/marginEnabled' | 'page/safetyEnabled' | 'placeholderControls/showButton' | 'placeholderControls/showOverlay' | 'playback/looping' | 'playback/muted' | 'stroke/enabled' | 'stroke/overprint' | 'motionBlur/enabled' | 'transform/autoOrient' | 'backgroundColor/enabled' | 'placeholderBehavior/enabled' | 'text/automaticFontSizeEnabled' | 'text/clipLinesOutsideOfFrame' | 'text/hasClippedLines' | 'text/pathFlipped' | 'text/useContextualAlternates' | 'text/useContextualLigatures' | 'text/useDiscretionaryLigatures' | 'text/useKerning' | 'text/useLigatures' | 'exclusionArea/constrains' | 'exclusionArea/punchOut' | 'track/automaticallyManageBlockOffsets' | 'caption/automaticFontSizeEnabled' | 'caption/clipLinesOutsideOfFrame' | 'caption/hasClippedLines' | 'caption/pathFlipped' | 'caption/useContextualAlternates' | 'caption/useContextualLigatures' | 'caption/useDiscretionaryLigatures' | 'caption/useKerning' | 'caption/useLigatures' | 'captionTrack/automaticallyManageBlockOffsets' | 'animation/slide/fade' | 'animation/pan/fade' | 'animation/blur/fade' | 'animation/zoom/fade' | 'animation/crop_zoom/fade' | 'animation/spin/fade' | 'animation/block_swipe_text/useTextColor' | 'animation/spread_text/fade' | 'animation/ken_burns/fade' | 'effect/enabled' | 'effect/displacement_map/wrapPixels' | 'effect/levels/clipToOutBlack' | 'effect/levels/clipToOutWhite' | 'effect/stroke/allMasks' | 'mask/inverted' | 'text_animator/fillColorEnabled' | 'text_animator/opacityEnabled' | 'text_animator/selectorEnabled' | 'text_animator/selectorRandomize' | 'text_animator/strokeColorEnabled' | (string & {});\ntype CameraClampingOvershootMode = 'Center' | 'Reverse';\ntype CMYK = [\n c: number,\n m: number,\n y: number,\n k: number\n];\ninterface CMYKProfileInfo {\n contentHash: string;\n name: string;\n uri: string;\n}\ntype ColorPickerColorMode = 'RGB' | 'CMYK' | 'Any';\ntype ColorPropertyName = 'dropShadow/color' | 'fill/solid/color' | 'page/guides/gridColor' | 'stroke/color' | 'backgroundColor/color' | 'animation/block_swipe_text/blockColor' | 'effect/duotone_filter/darkColor' | 'effect/duotone_filter/lightColor' | 'effect/fill/color' | 'effect/green_screen/fromColor' | 'effect/recolor/fromColor' | 'effect/recolor/toColor' | 'effect/stroke/color' | 'effect/tint/mapBlackTo' | 'effect/tint/mapWhiteTo' | 'effect/tritone/highlights' | 'effect/tritone/midtones' | 'effect/tritone/shadows' | 'fill/color/value' | 'fill/stripe/color' | 'text_animator/fillColor' | 'text_animator/strokeColor' | (string & {});\nenum ColorRenderingIntent {\n Perceptual = 0,\n RelativeColorimetric = 1,\n Saturation = 2,\n AbsoluteColorimetric = 3\n}\ntype ColorSpace = 'sRGB' | 'CMYK' | 'SpotColor';\ninterface CompleteAssetResult extends AssetResult {\n context: {\n sourceId: string;\n };\n active: boolean;\n}\ninterface Configuration {\n baseURL: string;\n license?: string;\n userId?: string;\n core: {\n baseURL: string;\n };\n logger: Logger;\n featureFlags?: {\n [flag: string]: boolean | string;\n };\n /** @deprecated This config key is not used anymore and will be removed. */\n presets: {\n typefaces?: {\n [id: string]: TypefaceDefinition;\n };\n };\n forceWebGL1?: boolean;\n audioOutput?: 'auto' | 'none';\n role?: RoleString;\n}\ntype ControlGizmoMoveHandleVisibility = 'auto' | 'always' | 'never';\ntype ControlGizmoResizeHandlesVisibility = 'auto' | 'always' | 'never';\ntype ControlGizmoRotateHandlesVisibility = 'auto' | 'always' | 'never';\ntype ControlGizmoScaleHandlesVisibility = 'auto' | 'always' | 'never';\ntype CreateSceneOptions = {\n page?: {\n size: number | {\n width: number;\n height: number;\n };\n color?: Color;\n };\n designUnit?: DesignUnit;\n fontSizeUnit?: FontSizeUnit;\n angleUnit?: SceneAngleUnit;\n};\nclass CreativeEngine {\n #private;\n static readonly version: string;\n asset: AssetAPI;\n block: BlockAPI;\n editor: EditorAPI;\n event: EventAPI;\n scene: SceneAPI;\n variable: VariableAPI;\n actions: EngineActions;\n version: string;\n update(): boolean;\n dispose(): void;\n static init(config?: Partial<Configuration>): Promise<CreativeEngine>;\n /** @deprecated This method uses legacy v4 asset source IDs and will be removed in a future version. Please migrate to v5 asset sources using engine.asset.addLocalAssetSourceFromJSONURI(). */\n addDefaultAssetSources({ baseURL, excludeAssetSourceIds }?: {\n baseURL?: string;\n excludeAssetSourceIds?: DefaultAssetSourceId[];\n }): Promise<void>;\n /** @deprecated This method uses legacy v3 demo asset source IDs and will be removed in a future version. Please migrate to v4 asset sources using engine.asset.addLocalAssetSourceFromJSONURI(). */\n addDemoAssetSources({ baseURL, excludeAssetSourceIds, sceneMode, withUploadAssetSources }?: {\n baseURL?: string;\n excludeAssetSourceIds?: DemoAssetSourceId[];\n sceneMode?: SceneMode;\n withUploadAssetSources?: boolean;\n }): Promise<void>;\n getBaseURL(): string;\n}\ntype CutoutOperation = 'Difference' | 'Intersection' | 'Union' | 'XOR';\ntype CutoutType = 'Solid' | 'Dashed';\ninterface DefaultApplyAssetOptions {\n placement?: AssetPlacement;\n abortSignal?: AbortSignal;\n}\n/** @deprecated This function uses legacy v4 asset source IDs. Please migrate to v5 asset sources using engine.asset.addLocalAssetSourceFromJSONURI() directly. */\ntype DefaultAssetSourceId = 'ly.img.sticker' | 'ly.img.vectorpath' | 'ly.img.colors.defaultPalette' | 'ly.img.filter.lut' | 'ly.img.filter.duotone' | 'ly.img.effect' | 'ly.img.blur' | 'ly.img.typeface' | 'ly.img.page.presets' | 'ly.img.page.presets.video' | 'ly.img.crop.presets' | 'ly.img.text' | 'ly.img.captionPresets';\n/** @deprecated This function uses legacy v3 demo asset source IDs. Please migrate to v4 asset sources using engine.asset.addLocalAssetSourceFromJSONURI() directly. */\ntype DemoAssetSourceId = 'ly.img.template' | 'ly.img.image.upload' | 'ly.img.video.upload' | 'ly.img.audio.upload' | 'ly.img.image' | 'ly.img.video' | 'ly.img.video.template' | 'ly.img.audio' | 'ly.img.textComponents';\ntype DesignBlockTypeLonghand = `//ly.img.ubq/${DesignBlockTypeShorthand}`;\ntype DesignBlockTypeShorthand = 'scene' | 'stack' | 'camera' | 'page' | 'graphic' | 'audio' | 'text' | 'group' | 'cutout' | 'track' | 'caption' | 'captionTrack' | 'exclusionArea';\ninterface DominantColor {\n r: number;\n g: number;\n b: number;\n weight: number;\n}\ninterface DominantColorsOptions {\n count?: number;\n ignoreWhite?: boolean;\n abortSignal?: AbortSignal;\n}\ntype DoubleClickSelectionMode = 'Direct' | 'Hierarchical';\ntype DoublePropertyName = 'playback/time' | 'playback/duration' | 'playback/timeOffset' | 'audio/totalDuration' | 'playback/fadeIn/duration' | 'playback/fadeOut/duration' | 'playback/trimLength' | 'playback/trimOffset' | 'fill/video/totalDuration' | (string & {});\ntype DropShadowOptions = {\n color?: Color;\n offset?: {\n x?: number;\n y?: number;\n };\n blur?: {\n x?: number;\n y?: number;\n };\n};\nclass EditorAPI {\n #private;\n /** @deprecated Use {@link EditorAPI.getCapabilityState}, which says whether the capability has * been measured yet. To ask whether this browser can play or export video, run the * `video.decode.checkSupport` or `video.encode.checkSupport` action, which measures first. * * */\n isCapabilitySupported(capability: EngineCapability): boolean;\n getCapabilityState(capability: EngineCapability): EngineCapabilityState;\n checkCapabilities(): Promise<void>;\n onStateChanged: (callback: () => void) => (() => void);\n unstable_isInteractionHappening(): boolean;\n addVectorNode(): void;\n deleteVectorNode(): void;\n deleteSelectedVectorControlPoints(): void;\n toggleSelectedVectorNodeSmooth(): void;\n setVectorEditBendMode(active: boolean): void;\n getVectorEditBendMode(): boolean;\n setVectorEditAddMode(active: boolean): void;\n getVectorEditAddMode(): boolean;\n setVectorEditDeleteMode(active: boolean): void;\n getVectorEditDeleteMode(): boolean;\n setSelectedVectorNodeMirrorMode(mode: number): void;\n getSelectedVectorNodeMirrorMode(): number;\n getTextCursorPositionInScreenSpaceX(): number;\n getTextCursorPositionInScreenSpaceY(): number;\n removeUndoStep(): void;\n /** @deprecated Use {@link onHistoryUpdatedWithKind}instead, which additionally reports a {@link HistoryUpdate}* describing the kind of update. * * */\n onHistoryUpdated: (callback: () => void) => (() => void);\n onHistoryUpdatedWithKind: (callback: (kind: HistoryUpdate) => void) => (() => void);\n onSettingsChanged: (callback: () => void) => (() => void);\n onRoleChanged: (callback: (role: RoleString) => void) => (() => void);\n setSetting<K extends SettingKey>(keypath: OptionalPrefix<K>, value: SettingValueType<K>): void;\n getSetting<K extends SettingKey>(keypath: OptionalPrefix<K>): SettingValueType<K>;\n setSettingBool(keypath: SettingsBool, value: boolean): void;\n getSettingBool(keypath: SettingsBool): boolean;\n getSettingBool(keypath: SettingBoolPropertyName): boolean;\n setSettingInt(keypath: SettingsInt, value: number): void;\n setSettingInt(keypath: SettingIntPropertyName, value: number): void;\n getSettingInt(keypath: SettingsInt): number;\n getSettingInt(keypath: SettingIntPropertyName): number;\n setSettingFloat(keypath: SettingsFloat, value: number): void;\n setSettingFloat(keypath: SettingFloatPropertyName, value: number): void;\n getSettingFloat(keypath: SettingsFloat): number;\n getSettingFloat(keypath: SettingFloatPropertyName): number;\n setSettingString(keypath: SettingsString, value: string): void;\n setSettingString(keypath: SettingStringPropertyName, value: string): void;\n getSettingString(keypath: SettingsString): string;\n getSettingString(keypath: SettingStringPropertyName): string;\n setSettingColor(keypath: SettingsColor, value: Color): void;\n setSettingColor(keypath: SettingColorPropertyName, value: Color): void;\n getSettingColor(keypath: SettingsColor): Color;\n getSettingColor(keypath: SettingColorPropertyName): Color;\n /** @deprecated Use setSettingColor() instead. */\n setSettingColorRGBA(keypath: SettingsColorRGBA | `ubq://${SettingsColorRGBA}`, r: number, g: number, b: number, a?: number): void;\n /** @deprecated Use getSettingColor() instead. */\n getSettingColorRGBA(keypath: SettingsColorRGBA | `ubq://${SettingsColorRGBA}`): RGBA;\n setSettingEnum<T extends keyof SettingEnumType>(keypath: T, value: SettingEnumType[T]): void;\n setSettingEnum(keypath: string, value: string): void;\n getSettingEnum<T extends keyof SettingEnumType>(keypath: T): SettingEnumType[T];\n getSettingEnum(keypath: string): string;\n getSettingEnumOptions<T extends keyof SettingEnumType>(keypath: T): SettingEnumType[T][];\n getSettingEnumOptions(keypath: string): string[];\n setRole(role: RoleString): void;\n getRole(): RoleString;\n findAllSettings(): string[];\n getSettingType(keypath: string): SettingType;\n getAvailableMemory(): number;\n getUsedMemory(): number;\n getMaxExportSize(): number;\n setURIResolver(resolver?: SyncURIResolver | null): void;\n setURIResolverAsync(resolver?: AsyncURIResolver | null): void;\n defaultURIResolver(relativePath: string): string;\n getAbsoluteURI(relativePath: string): Promise<string>;\n findAllSpotColors(): string[];\n getSpotColorRGBA(name: string): RGBA;\n getSpotColorCMYK(name: string): CMYK;\n setSpotColorRGB(name: string, r: number, g: number, b: number): void;\n setSpotColorCMYK(name: string, c: number, m: number, y: number, k: number): void;\n removeSpotColor(name: string): void;\n setSpotColorForCutoutType(type: CutoutType, color: string): void;\n getSpotColorForCutoutType(type: CutoutType): string;\n convertColorToColorSpace(color: Color, colorSpace: 'sRGB'): RGBAColor;\n convertColorToColorSpace(color: Color, colorSpace: 'CMYK'): CMYKColor;\n convertColorToColorSpace(color: Color, colorSpace: ColorSpace): never;\n loadCMYKProfile(options?: AbortOptions): Promise<void>;\n createBuffer(): string;\n destroyBuffer(uri: string): void;\n setBufferData(uri: string, offset: number, data: Uint8Array): void;\n getBufferData(uri: string, offset: number, length: number): Uint8Array;\n setBufferLength(uri: string, length: number): void;\n getBufferLength(uri: string): number;\n getMimeType(uri: string, options?: AbortOptions): Promise<string>;\n getFontMetrics(fontFileUri: string, options?: AbortOptions): Promise<FontMetrics>;\n findAllTransientResources(): TransientResource[];\n findAllMediaURIs(): string[];\n getResourceData(uri: string, chunkSize: number, onData: (result: Uint8Array) => boolean): void;\n relocateResource(currentUrl: string, relocatedUrl: string): void;\n setSafeAreaInsets(insets: {\n left?: number;\n top?: number;\n right?: number;\n bottom?: number;\n }): void;\n getSafeAreaInsets(): {\n left: number;\n top: number;\n right: number;\n bottom: number;\n };\n setMovementConstraint(rules: MovementConstraintRule | MovementConstraintRule[]): void;\n removeMovementConstraint(scopes?: MovementConstraintScope | MovementConstraintScope[]): void;\n}\ninterface EngineActionInfo {\n id: string;\n enabled: boolean;\n argSchema: string | null;\n}\nclass EngineActions<Registry extends object = EngineActionsRegistry> {\n #private;\n register<K extends keyof Registry & string>(id: K, fn: Registry[K] extends (...args: any[]) => any ? Registry[K] : EngineCustomActionFunction): void;\n register(id: string, fn: EngineCustomActionFunction): void;\n get<K extends keyof Registry & string>(id: K): Registry[K] | undefined;\n get(id: string): EngineCustomActionFunction | undefined;\n run<K extends keyof Registry & string>(id: K, ...args: Registry[K] extends (...args: infer A) => any ? A : unknown[]): Promise<Registry[K] extends (...args: any[]) => infer R ? Awaited<R> : unknown>;\n run<R = unknown>(id: string, ...args: unknown[]): Promise<R>;\n has(id: string): boolean;\n unregister(id: string): boolean;\n list(options?: {\n matcher?: string;\n }): EngineActionInfo[];\n}\ninterface EngineActionsRegistry {\n 'asset.drop': (payload: AssetDropPayload) => void | Promise<void>;\n 'video.decode.checkSupport': () => Promise<boolean>;\n 'video.encode.checkSupport': () => Promise<boolean>;\n}\ntype EngineCapability = 'aacEncode' | 'opusEncode' | 'h264Encode' | 'hevcEncode' | 'vp9Encode' | 'av1Encode' | 'h264Decode' | 'hevcDecode' | 'vp9Decode' | 'av1Decode' | 'tempFileStorage' | 'concurrentFileRead';\ntype EngineCapabilityState = 'unchecked' | 'pending' | 'supported' | 'unsupported';\ntype EngineCustomActionFunction = (...args: any[]) => unknown;\nclass EngineError extends Error {\n readonly code: string;\n readonly category: string;\n readonly hint: string;\n readonly args: Record<string, EngineErrorArg>;\n readonly silent: boolean;\n readonly docsUrl: string | null;\n}\ntype EngineErrorArg = boolean | number | string;\ntype EnumPropertyName = 'blend/mode' | 'contentFill/horizontalAlignment' | 'contentFill/mode' | 'contentFill/verticalAlignment' | 'height/mode' | 'position/x/mode' | 'position/y/mode' | 'scene/angleUnit' | 'scene/colorConversionMode' | 'scene/designUnit' | 'scene/fontSizeUnit' | 'scene/layout' | 'scene/mode' | 'width/mode' | 'page/guides/source' | 'stroke/cap' | 'stroke/cornerGeometry' | 'stroke/dashEndCap' | 'stroke/dashStartCap' | 'stroke/endCap' | 'stroke/position' | 'stroke/startCap' | 'stroke/style' | 'playback/fadeIn/easing' | 'playback/fadeOut/easing' | 'text/horizontalAlignment' | 'text/verticalAlignment' | 'cutout/type' | 'caption/horizontalAlignment' | 'caption/verticalAlignment' | 'animationEasing' | 'textAnimationWritingStyle' | 'animation/grow/direction' | 'animation/wipe/direction' | 'animation/baseline/direction' | 'animation/spin/direction' | 'animation/spin_loop/direction' | 'animation/jump_loop/direction' | 'animation/typewriter_text/writingStyle' | 'animation/block_swipe_text/direction' | 'animation/merge_text/direction' | 'animation/ken_burns/direction' | 'blur/uniform/mode' | 'modifier/trim/mode' | 'modifier/repeater/composite' | 'modifier/offset/join' | 'modifier/zigzag/pointType' | 'effect/displacement_map/horizontalChannel' | 'effect/displacement_map/mapBehavior' | 'effect/displacement_map/verticalChannel' | 'effect/invert/channel' | 'effect/radial_wipe/direction' | 'effect/shift_channels/takeAlphaFrom' | 'effect/shift_channels/takeBlueFrom' | 'effect/shift_channels/takeGreenFrom' | 'effect/shift_channels/takeRedFrom' | 'effect/stroke/paintStyle' | 'effect/wave_warp/waveType' | 'fill/pixelStream/orientation' | 'shape/vector_path/fillRule' | 'shape/compound/fillRule' | 'shape/compound/mode' | 'mask/mode' | 'text_animator/selectorBasedOn' | 'text_animator/selectorShape' | 'text_animator/selectorUnits' | (string & {});\nclass EventAPI {\n #private;\n subscribe: (blocks: DesignBlockId[], callback: (events: BlockEvent[]) => void) => (() => void);\n}\ntype FloatPropertyName = 'globalBoundingBox/height' | 'globalBoundingBox/width' | 'globalBoundingBox/x' | 'globalBoundingBox/y' | 'height' | 'lastFrame/height' | 'lastFrame/width' | 'lastFrame/x' | 'lastFrame/y' | 'motionBlur/shutterAngle' | 'motionBlur/shutterPhase' | 'movement/constraint' | 'position/x' | 'position/y' | 'rotation' | 'scene/dpi' | 'scene/frameRate' | 'scene/pageDimensions/height' | 'scene/pageDimensions/width' | 'scene/pixelScaleFactor' | 'width' | 'camera/pixelRatio' | 'camera/resolution/height' | 'camera/resolution/width' | 'camera/zoomLevel' | 'dropShadow/blurRadius/x' | 'dropShadow/blurRadius/y' | 'dropShadow/offset/x' | 'dropShadow/offset/y' | 'page/guides/gridSpacingX' | 'page/guides/gridSpacingY' | 'page/margin/bottom' | 'page/margin/left' | 'page/margin/right' | 'page/margin/top' | 'page/marginScale' | 'page/safetyInset/bottom' | 'page/safetyInset/left' | 'page/safetyInset/right' | 'page/safetyInset/top' | 'playback/speed' | 'playback/volume' | 'stroke/dashOffset' | 'stroke/miterLimit' | 'stroke/width' | 'opacity' | 'transform/anchor/x' | 'transform/anchor/y' | 'transform/scale/x' | 'transform/scale/y' | 'transform/skew' | 'transform/skewAxis' | 'backgroundColor/cornerRadius' | 'backgroundColor/paddingBottom' | 'backgroundColor/paddingLeft' | 'backgroundColor/paddingRight' | 'backgroundColor/paddingTop' | 'text/backgroundCornerRadius' | 'text/backgroundPadding/bottom' | 'text/backgroundPadding/left' | 'text/backgroundPadding/right' | 'text/backgroundPadding/top' | 'text/fontSize' | 'text/letterSpacing' | 'text/lineHeight' | 'text/maxAutomaticFontSize' | 'text/minAutomaticFontSize' | 'text/paragraphSpacing' | 'text/pathOffset' | 'text/subscriptFontScale' | 'text/subscriptVerticalShift' | 'text/superscriptFontScale' | 'text/superscriptVerticalShift' | 'cutout/offset' | 'cutout/smoothing' | 'caption/backgroundCornerRadius' | 'caption/backgroundPadding/bottom' | 'caption/backgroundPadding/left' | 'caption/backgroundPadding/right' | 'caption/backgroundPadding/top' | 'caption/fontSize' | 'caption/letterSpacing' | 'caption/lineHeight' | 'caption/maxAutomaticFontSize' | 'caption/minAutomaticFontSize' | 'caption/paragraphSpacing' | 'caption/pathOffset' | 'caption/subscriptFontScale' | 'caption/subscriptVerticalShift' | 'caption/superscriptFontScale' | 'caption/superscriptVerticalShift' | 'animation/slide/direction' | 'textAnimationOverlap' | 'animation/pan/direction' | 'animation/pan/distance' | 'animation/blur/intensity' | 'animation/grow/scaleFactor' | 'animation/crop_zoom/scale' | 'animation/spin/intensity' | 'animation/blur_loop/intensity' | 'animation/pulsating_loop/intensity' | 'animation/breathing_loop/intensity' | 'animation/jump_loop/intensity' | 'animation/sway_loop/intensity' | 'animation/spread_text/intensity' | 'animation/merge_text/intensity' | 'animation/ken_burns/travelDistanceRatio' | 'animation/ken_burns/zoomIntensity' | 'blur/uniform/intensity' | 'blur/linear/blurRadius' | 'blur/linear/x1' | 'blur/linear/x2' | 'blur/linear/y1' | 'blur/linear/y2' | 'blur/mirrored/blurRadius' | 'blur/mirrored/gradientSize' | 'blur/mirrored/size' | 'blur/mirrored/x1' | 'blur/mirrored/x2' | 'blur/mirrored/y1' | 'blur/mirrored/y2' | 'blur/radial/blurRadius' | 'blur/radial/gradientRadius' | 'blur/radial/radius' | 'blur/radial/x' | 'blur/radial/y' | 'modifier/trim/end' | 'modifier/trim/offset' | 'modifier/trim/start' | 'modifier/repeater/anchorX' | 'modifier/repeater/anchorY' | 'modifier/repeater/copies' | 'modifier/repeater/endOpacity' | 'modifier/repeater/offset' | 'modifier/repeater/positionX' | 'modifier/repeater/positionY' | 'modifier/repeater/rotation' | 'modifier/repeater/scaleX' | 'modifier/repeater/scaleY' | 'modifier/repeater/startOpacity' | 'modifier/round_corners/radius' | 'modifier/offset/amount' | 'modifier/offset/miterLimit' | 'modifier/zigzag/ridges' | 'modifier/zigzag/size' | 'modifier/pucker_bloat/amount' | 'modifier/twist/angle' | 'modifier/twist/centerX' | 'modifier/twist/centerY' | 'effect/adjustments/blacks' | 'effect/adjustments/brightness' | 'effect/adjustments/clarity' | 'effect/adjustments/contrast' | 'effect/adjustments/exposure' | 'effect/adjustments/gamma' | 'effect/adjustments/highlights' | 'effect/adjustments/saturation' | 'effect/adjustments/shadows' | 'effect/adjustments/sharpness' | 'effect/adjustments/temperature' | 'effect/adjustments/whites' | 'effect/bulge/centerX' | 'effect/bulge/centerY' | 'effect/bulge/height' | 'effect/bulge/horizontalRadius' | 'effect/bulge/verticalRadius' | 'effect/corner_pin/lowerLeftX' | 'effect/corner_pin/lowerLeftY' | 'effect/corner_pin/lowerRightX' | 'effect/corner_pin/lowerRightY' | 'effect/corner_pin/upperLeftX' | 'effect/corner_pin/upperLeftY' | 'effect/corner_pin/upperRightX' | 'effect/corner_pin/upperRightY' | 'effect/cross_cut/offset' | 'effect/cross_cut/slices' | 'effect/cross_cut/speedV' | 'effect/cross_cut/time' | 'effect/displacement_map/maxHorizontal' | 'effect/displacement_map/maxVertical' | 'effect/dot_pattern/blur' | 'effect/dot_pattern/dots' | 'effect/dot_pattern/size' | 'effect/duotone_filter/intensity' | 'effect/extrude_blur/amount' | 'effect/fill/opacity' | 'effect/glow/amount' | 'effect/glow/darkness' | 'effect/glow/size' | 'effect/green_screen/colorMatch' | 'effect/green_screen/smoothness' | 'effect/green_screen/spill' | 'effect/half_tone/angle' | 'effect/half_tone/scale' | 'effect/levels/alphaGamma' | 'effect/levels/alphaInBlack' | 'effect/levels/alphaInWhite' | 'effect/levels/alphaOutBlack' | 'effect/levels/alphaOutWhite' | 'effect/levels/blueGamma' | 'effect/levels/blueInBlack' | 'effect/levels/blueInWhite' | 'effect/levels/blueOutBlack' | 'effect/levels/blueOutWhite' | 'effect/levels/greenGamma' | 'effect/levels/greenInBlack' | 'effect/levels/greenInWhite' | 'effect/levels/greenOutBlack' | 'effect/levels/greenOutWhite' | 'effect/levels/redGamma' | 'effect/levels/redInBlack' | 'effect/levels/redInWhite' | 'effect/levels/redOutBlack' | 'effect/levels/redOutWhite' | 'effect/levels/rgbGamma' | 'effect/levels/rgbInBlack' | 'effect/levels/rgbInWhite' | 'effect/levels/rgbOutBlack' | 'effect/levels/rgbOutWhite' | 'effect/linear_wipe/angle' | 'effect/linear_wipe/completion' | 'effect/linear_wipe/feather' | 'effect/linocut/scale' | 'effect/liquid/amount' | 'effect/liquid/scale' | 'effect/liquid/time' | 'effect/lut_filter/intensity' | 'effect/outliner/amount' | 'effect/outliner/passthrough' | 'effect/posterize/levels' | 'effect/radial_pixel/radius' | 'effect/radial_pixel/segments' | 'effect/radial_wipe/centerX' | 'effect/radial_wipe/centerY' | 'effect/radial_wipe/completion' | 'effect/radial_wipe/feather' | 'effect/radial_wipe/startAngle' | 'effect/recolor/brightnessMatch' | 'effect/recolor/colorMatch' | 'effect/recolor/smoothness' | 'effect/shifter/amount' | 'effect/shifter/angle' | 'effect/stroke/brushSize' | 'effect/stroke/end' | 'effect/stroke/hardness' | 'effect/stroke/opacity' | 'effect/stroke/spacing' | 'effect/stroke/start' | 'effect/threshold/level' | 'effect/tilt_shift/amount' | 'effect/tilt_shift/position' | 'effect/tint/amount' | 'effect/tritone/amount' | 'effect/tv_glitch/distortion' | 'effect/tv_glitch/distortion2' | 'effect/tv_glitch/rollSpeed' | 'effect/tv_glitch/speed' | 'effect/venetian_blinds/completion' | 'effect/venetian_blinds/direction' | 'effect/venetian_blinds/feather' | 'effect/venetian_blinds/width' | 'effect/vignette/darkness' | 'effect/vignette/offset' | 'effect/wave_warp/direction' | 'effect/wave_warp/height' | 'effect/wave_warp/phase' | 'effect/wave_warp/width' | 'fill/gradient/linear/endPointX' | 'fill/gradient/linear/endPointY' | 'fill/gradient/linear/startPointX' | 'fill/gradient/linear/startPointY' | 'fill/gradient/radial/centerPointX' | 'fill/gradient/radial/centerPointY' | 'fill/gradient/radial/focalX' | 'fill/gradient/radial/focalY' | 'fill/gradient/radial/radius' | 'fill/gradient/conical/centerPointX' | 'fill/gradient/conical/centerPointY' | 'fill/stripe/angle' | 'fill/stripe/gap' | 'fill/stripe/width' | 'shape/anchor/x' | 'shape/anchor/y' | 'shape/height' | 'shape/position/x' | 'shape/position/y' | 'shape/rect/cornerRadiusBL' | 'shape/rect/cornerRadiusBR' | 'shape/rect/cornerRadiusTL' | 'shape/rect/cornerRadiusTR' | 'shape/rotation' | 'shape/scale/x' | 'shape/scale/y' | 'shape/skew' | 'shape/skewAxis' | 'shape/width' | 'shape/polygon/cornerRadius' | 'shape/star/cornerRadius' | 'shape/star/innerDiameter' | 'shape/star/innerRadius' | 'shape/star/innerRoundness' | 'shape/star/outerRadius' | 'shape/star/outerRoundness' | 'shape/star/rotation' | 'shape/vector_path/cornerRadius' | 'shape/vector_path/height' | 'shape/vector_path/width' | 'shape/compound/height' | 'shape/compound/width' | 'mask/expansion' | 'mask/feather' | 'mask/opacity' | 'text_animator/anchorX' | 'text_animator/anchorY' | 'text_animator/blurX' | 'text_animator/blurY' | 'text_animator/opacity' | 'text_animator/positionX' | 'text_animator/positionY' | 'text_animator/rotation' | 'text_animator/scaleX' | 'text_animator/scaleY' | 'text_animator/selectorAmount' | 'text_animator/selectorEaseHigh' | 'text_animator/selectorEaseLow' | 'text_animator/selectorEnd' | 'text_animator/selectorOffset' | 'text_animator/selectorSmoothness' | 'text_animator/selectorStart' | 'text_animator/skew' | 'text_animator/skewAxis' | 'text_animator/strokeWidth' | 'text_animator/tracking' | (string & {});\ninterface FontMetrics {\n ascender: number;\n descender: number;\n unitsPerEm: number;\n lineGap: number;\n capHeight: number;\n xHeight: number;\n underlineOffset: number;\n underlineSize: number;\n strikeoutOffset: number;\n strikeoutSize: number;\n}\ntype HistoryUpdate = 'Updated' | 'Activated';\ntype ImportedImageColorSpace = 'DeviceGray' | 'DeviceRGB' | 'DeviceCMYK' | 'ICCBased';\ninterface ImportedImageDefinitionInfo {\n colorSpace: ImportedImageColorSpace;\n declaredColorSpace: ImportedImageColorSpace;\n profileContentHash: string;\n decode: number[];\n colorTransform?: number;\n renderingIntent?: ColorRenderingIntent;\n importerRecord: string;\n importerRecordFormat: string;\n colorKeyMask?: number[];\n mask?: ImportedImageMaskInfo;\n}\ninterface ImportedImageDefinitionInput {\n colorSpace: ImportedImageColorSpace;\n declaredColorSpace?: ImportedImageColorSpace;\n iccProfile?: Uint8Array;\n decode?: number[];\n colorTransform?: number;\n renderingIntent?: ColorRenderingIntent;\n importerRecord?: string;\n importerRecordFormat?: string;\n colorKeyMask?: number[];\n mask?: ImportedImageMaskInput;\n}\ninterface ImportedImageMaskInfo {\n width: number;\n height: number;\n decode: number[];\n interpolate: boolean;\n matte: number[];\n kind: ImportedImageMaskKind;\n}\ninterface ImportedImageMaskInput {\n jpegBytes?: Uint8Array;\n bitPackedBytes?: Uint8Array;\n width: number;\n height: number;\n decode?: number[];\n interpolate?: boolean;\n kind?: ImportedImageMaskKind;\n matte?: number[];\n}\ntype ImportedImageMaskKind = 'Stencil' | 'Soft';\ntype IntPropertyName = 'motionBlur/samples' | 'effect/lut_filter/horizontalTileCount' | 'effect/lut_filter/verticalTileCount' | 'effect/mirror/side' | 'effect/pixelize/horizontalPixelSize' | 'effect/pixelize/verticalPixelSize' | 'effect/stroke/maskIndex' | 'shape/polygon/sides' | 'shape/star/points' | 'text_animator/selectorSeed' | (string & {});\ntype LoadSceneOptions = {\n overrideEditorConfig?: boolean;\n waitForResources?: boolean;\n onProgress?: (percent: number) => void;\n abortSignal?: AbortSignal;\n};\ntype Locale = string;\ninterface Logger {\n (message: string, level?: LogLevel): void;\n}\ntype LogLevel = 'Info' | 'Warning' | 'Error';\n/** @deprecated Specifying log levels via `LogLevel.Info` has been deprecated. Please use the desired LogLevel string directly. */\nconst LogLevel: {\n readonly Info: 'Info';\n readonly Warning: 'Warning';\n readonly Error: 'Error';\n};\n/** @deprecated Use the `MimeType` string literal types instead. */\nconst MimeType_2: {\n readonly Png: 'image/png';\n readonly Jpeg: 'image/jpeg';\n readonly WebP: 'image/webp';\n readonly Tga: 'image/x-tga';\n readonly Svg: 'image/svg+xml';\n readonly Wav: 'audio/wav';\n readonly Mp4Audio: 'audio/mp4';\n readonly Mp4: 'video/mp4';\n readonly QuickTime: 'video/quicktime';\n readonly Binary: 'application/octet-stream';\n readonly Pdf: 'application/pdf';\n readonly Zip: 'application/zip';\n};\ntype MimeType_2 = (typeof MimeType_2)[keyof typeof MimeType_2];\ntype MovementConstraintRule = {\n overshoot: number;\n} | {\n overshoot: number;\n block: DesignBlockId;\n} | {\n overshoot: number;\n blockType: string;\n};\ntype MovementConstraintScope = {\n block: DesignBlockId;\n} | {\n blockType: string;\n};\ntype OptionalPrefix<T extends string> = `ubq://${T}` | T;\ntype PositionMode = 'Absolute' | 'Percent' | 'Auto' | 'Absolute' | 'Percent' | 'Auto';\ntype PropertyType = 'Bool' | 'Int' | 'Float' | 'String' | 'Color' | 'Enum' | 'Struct' | 'Double' | 'SourceSet' | 'Vec2';\ninterface Range_2 {\n from: number;\n to: number;\n}\ntype RGBA = [\n r: number,\n g: number,\n b: number,\n a: number\n];\ninterface RGBColor {\n r: number;\n g: number;\n b: number;\n}\ntype RoleString = 'Creator' | 'Adopter' | 'Viewer' | 'Presenter';\ntype SceneAngleUnit = 'Radian' | 'Degree';\nclass SceneAPI {\n #private;\n setCMYKProfile(uri: string, options?: AbortOptions): Promise<void>;\n setCMYKProfileFromData(data: Uint8Array): void;\n getCMYKProfileInfo(): CMYKProfileInfo;\n removeCMYKProfile(): void;\n getColorRenderingIntent(): ColorRenderingIntent;\n setColorRenderingIntent(intent: ColorRenderingIntent): void;\n isBlackPointCompensationEnabled(): boolean;\n setBlackPointCompensationEnabled(enabled: boolean): void;\n load(source: string | URL, options?: LoadSceneOptions): Promise<DesignBlockId>;\n load(source: string | URL, overrideEditorConfig?: boolean, waitForResources?: boolean): Promise<DesignBlockId>;\n /** @deprecated Scene mode no longer affects engine behavior. Use `create()` followed by `setMode('Video')` instead. ```javascript const scene = engine.scene.createVideo(); ``` */\n createVideo(options?: CreateSceneOptions): DesignBlockId;\n createFromImage(url: string, dpi?: number, pixelScaleFactor?: number, sceneLayout?: SceneLayout, spacing?: number, spacingInScreenSpace?: boolean, options?: AbortOptions): Promise<DesignBlockId>;\n createFromVideo(url: string, options?: AbortOptions): Promise<DesignBlockId>;\n get(): DesignBlockId | null;\n applyTemplateFromString(content: string): Promise<void>;\n applyTemplateFromURL(url: string, options?: AbortOptions): Promise<void>;\n /** @deprecated Scene mode no longer affects engine behavior. All features work regardless of mode. ```javascript const mode = scene.getMode(); ``` */\n getMode(): SceneMode | null;\n /** @deprecated Scene mode no longer affects engine behavior. All features work regardless of mode. ```javascript engine.scene.setMode('Video'); ``` */\n setMode(mode: SceneMode): void;\n setDesignUnit(designUnit: DesignUnit): void;\n getDesignUnit(): DesignUnit;\n setFontSizeUnit(fontSizeUnit: FontSizeUnit): void;\n getFontSizeUnit(): FontSizeUnit;\n setAngleUnit(angleUnit: SceneAngleUnit): void;\n getAngleUnit(): SceneAngleUnit;\n addMarker(name: string, time: number, duration?: number): void;\n getMarkers(): SceneMarker[];\n removeMarker(index: number): void;\n getLayout(): SceneLayout;\n setLayout(layout: SceneLayout): void;\n getPages(): DesignBlockId[];\n getCurrentPage(): DesignBlockId | null;\n setCurrentPages(pages: DesignBlockId[]): void;\n getCurrentPages(): DesignBlockId[];\n findNearestToViewPortCenterByType(type: DesignBlockType): DesignBlockId[];\n findNearestToViewPortCenterByKind(kind: string): DesignBlockId[];\n unstable_enableCameraPositionClamping(ids: DesignBlockId[], paddingLeft?: number, paddingTop?: number, paddingRight?: number, paddingBottom?: number, scaledPaddingLeft?: number, scaledPaddingTop?: number, scaledPaddingRight?: number, scaledPaddingBottom?: number): void;\n unstable_disableCameraPositionClamping(blockOrScene?: number | null): void;\n unstable_isCameraPositionClampingEnabled(blockOrScene?: number | null): boolean;\n onZoomLevelChanged: (callback: () => void) => (() => void);\n onActiveChanged: (callback: () => void) => (() => void);\n}\ntype DesignUnit = 'Pixel' | 'Millimeter' | 'Inch';\ntype FontSizeUnit = 'Pixel' | 'Point';\ntype SceneLayout = 'Free' | 'VerticalStack' | 'HorizontalStack' | 'DepthStack';\ninterface SceneMarker {\n name: string;\n time: number;\n duration: number;\n}\ntype SceneMode = 'Design' | 'Video';\ntype SettingBoolPropertyName = 'doubleClickToCropEnabled' | 'showBuildVersion' | 'placeholderControls/showButton' | 'placeholderControls/showOverlay' | 'blockAnimations/enabled' | 'playback/showAllBlocks' | 'grid/enabled' | 'grid/snapEnabled' | 'archival/bundleOnlyUsedFontVariants' | 'touch/dragStartCanSelect' | 'touch/singlePointPanning' | 'mouse/enableZoom' | 'mouse/enableScroll' | 'dragToSwapFills/enabled' | 'controlGizmo/showCropHandles' | 'controlGizmo/showMoveHandles' | 'controlGizmo/dynamicMoveHandleVisibility' | 'controlGizmo/showResizeHandles' | 'controlGizmo/showScaleHandles' | 'controlGizmo/showRotateHandles' | 'controlGizmo/showCropScaleHandles' | 'page/title/show' | 'page/title/showPageTitleTemplate' | 'page/title/appendPageName' | 'page/title/showOnSinglePage' | 'page/title/canEdit' | 'page/safetyRevealDuringTransform' | 'page/dimOutOfPageAreas' | 'page/allowCropInteraction' | 'page/allowResizeInteraction' | 'page/restrictResizeInteractionToFixedAspectRatio' | 'page/allowRotateInteraction' | 'page/allowMoveInteraction' | 'page/marqueeSelectOnBodyDrag' | 'page/restrictPageSelectionToBorderAndTitle' | 'page/moveChildrenWhenCroppingFill' | 'page/selectWhenNoBlocksSelected' | 'page/highlightWhenCropping' | 'page/allowShapeChange' | 'page/highlightDropTarget' | 'page/reparentBlocksToSceneWhenOutOfPage' | 'page/flipDimensionsOn90DegreeCropRotation' | 'clampThumbnailTextureSizes' | 'useSystemFontFallback' | 'forceSystemEmojis' | (string & {});\ntype SettingColorPropertyName = 'clearColor' | 'handleFillColor' | 'highlightColor' | 'pageHighlightColor' | 'placeholderHighlightColor' | 'snappingGuideColor' | 'rotationSnappingGuideColor' | 'cropOverlayColor' | 'textVariableHighlightColor' | 'borderOutlineColor' | 'progressColor' | 'errorStateColor' | 'grid/color' | 'page/title/color' | 'page/marginFillColor' | 'page/marginFrameColor' | 'page/safetyFillColor' | 'page/safetyFrameColor' | 'page/exclusionAreaFillColor' | 'page/exclusionAreaFrameColor' | 'page/innerBorderColor' | 'page/outerBorderColor' | 'colorMaskingSettings/maskColor' | (string & {});\ntype SettingEnumType = {\n 'touch/pinchAction': TouchPinchAction;\n 'touch/rotateAction': TouchRotateAction;\n 'camera/clamping/overshootMode': CameraClampingOvershootMode;\n 'controlGizmo/moveHandleVisibility': ControlGizmoMoveHandleVisibility;\n 'controlGizmo/resizeHandlesVisibility': ControlGizmoResizeHandlesVisibility;\n 'controlGizmo/scaleHandlesVisibility': ControlGizmoScaleHandlesVisibility;\n 'controlGizmo/rotateHandlesVisibility': ControlGizmoRotateHandlesVisibility;\n doubleClickSelectionMode: DoubleClickSelectionMode;\n 'colorPicker/colorMode': ColorPickerColorMode;\n 'timeline/trackVisibility': TimelineTrackVisibility;\n};\ntype SettingFloatPropertyName = 'positionSnappingThreshold' | 'rotationSnappingThreshold' | 'grid/spacingX' | 'grid/spacingY' | 'dragToSwapFills/longPressDurationMs' | 'controlGizmo/blockScaleDownLimit' | 'exportPendingTimeoutSeconds' | 'listIndentPerLevel' | 'tabStopInterval' | (string & {});\ntype SettingIntPropertyName = 'maxImageSize' | 'maxPreviewResolution' | 'maxConcurrentRequestsPerHost' | (string & {});\ntype SettingKey = keyof Settings;\ninterface Settings {\n 'controlGizmo/showCropHandles': boolean;\n 'controlGizmo/showCropScaleHandles': boolean;\n /** @deprecated Use `controlGizmo/moveHandleVisibility`. `false` hides the move handle. */\n 'controlGizmo/showMoveHandles': boolean;\n /** @deprecated Use `controlGizmo/moveHandleVisibility`. `false` shows the move handle at any block size. */\n 'controlGizmo/dynamicMoveHandleVisibility': boolean;\n /** @deprecated Use `controlGizmo/resizeHandlesVisibility`. `false` hides the edge (resize) handles. */\n 'controlGizmo/showResizeHandles': boolean;\n /** @deprecated Use `controlGizmo/rotateHandlesVisibility`. `false` hides the rotation handle. */\n 'controlGizmo/showRotateHandles': boolean;\n /** @deprecated Use `controlGizmo/scaleHandlesVisibility`. `false` hides the corner (scale) handles. */\n 'controlGizmo/showScaleHandles': boolean;\n doubleClickToCropEnabled: boolean;\n 'dragToSwapFills/enabled': boolean;\n 'features/singlePageModeEnabled': boolean;\n 'features/fileSystemUsageEnabled': boolean;\n 'features/pageCarouselEnabled': boolean;\n 'features/transformEditsRetainCoverMode': boolean;\n 'features/clampTextBlockWidthToPageDimensionsDuringEditing': boolean;\n 'features/equalDistanceSnappingEnabled': boolean;\n 'features/previewMotionBlurEnabled': boolean;\n 'features/fontLineGapEnabled': boolean;\n 'mouse/enableScroll': boolean;\n 'mouse/enableZoom': boolean;\n 'page/allowCropInteraction': boolean;\n 'page/allowMoveInteraction': boolean;\n 'page/marqueeSelectOnBodyDrag': boolean;\n 'page/restrictPageSelectionToBorderAndTitle': boolean;\n 'page/allowResizeInteraction': boolean;\n 'page/allowRotateInteraction': boolean;\n 'page/allowShapeChange': boolean;\n 'page/dimOutOfPageAreas': boolean;\n 'page/restrictResizeInteractionToFixedAspectRatio': boolean;\n 'page/moveChildrenWhenCroppingFill': boolean;\n 'page/title/appendPageName': boolean;\n 'page/title/canEdit': boolean;\n 'page/title/show': boolean;\n 'page/title/showOnSinglePage': boolean;\n 'page/title/showPageTitleTemplate': boolean;\n 'page/safetyRevealDuringTransform': boolean;\n 'placeholderControls/showButton': boolean;\n 'placeholderControls/showOverlay': boolean;\n 'blockAnimations/enabled': boolean;\n 'playback/showAllBlocks': boolean;\n 'grid/enabled': boolean;\n 'grid/snapEnabled': boolean;\n showBuildVersion: boolean;\n 'touch/dragStartCanSelect': boolean;\n 'touch/singlePointPanning': boolean;\n useSystemFontFallback: boolean;\n forceSystemEmojis: boolean;\n 'page/selectWhenNoBlocksSelected': boolean;\n 'page/highlightWhenCropping': boolean;\n 'page/highlightDropTarget': boolean;\n 'page/reparentBlocksToSceneWhenOutOfPage': boolean;\n clampThumbnailTextureSizes: boolean;\n 'dock/hideLabels': boolean;\n basePath: string;\n defaultEmojiFontFileUri: string;\n defaultFontFileUri: string;\n license: string;\n 'page/title/fontFileUri': string;\n 'page/title/separator': string;\n fallbackFontUri: string;\n fallbackCMYKProfileUri: string;\n 'upload/supportedMimeTypes': string;\n 'web/fetchCredentials': 'omit' | 'same-origin' | 'include';\n 'controlGizmo/blockScaleDownLimit': number;\n listIndentPerLevel: number;\n tabStopInterval: number;\n positionSnappingThreshold: number;\n rotationSnappingThreshold: number;\n 'grid/spacingX': number;\n 'grid/spacingY': number;\n 'dragToSwapFills/longPressDurationMs': number;\n exportPendingTimeoutSeconds: number;\n maxImageSize: number;\n maxPreviewResolution: number;\n maxConcurrentRequestsPerHost: number;\n borderOutlineColor: Color;\n clearColor: Color;\n 'colorMaskingSettings/maskColor': Color;\n cropOverlayColor: Color;\n errorStateColor: Color;\n highlightColor: Color;\n 'page/exclusionAreaFillColor': Color;\n 'page/exclusionAreaFrameColor': Color;\n 'page/innerBorderColor': Color;\n 'page/marginFillColor': Color;\n 'page/marginFrameColor': Color;\n 'page/outerBorderColor': Color;\n 'page/safetyFillColor': Color;\n 'page/safetyFrameColor': Color;\n 'page/title/color': Color;\n pageHighlightColor: Color;\n placeholderHighlightColor: Color;\n progressColor: Color;\n rotationSnappingGuideColor: Color;\n ruleOfThirdsLineColor: Color;\n snappingGuideColor: Color;\n textVariableHighlightColor: Color;\n handleFillColor: Color;\n 'grid/color': Color;\n 'controlGizmo/moveHandleVisibility': 'auto' | 'always' | 'never';\n 'controlGizmo/resizeHandlesVisibility': 'auto' | 'always' | 'never';\n 'controlGizmo/scaleHandlesVisibility': 'auto' | 'always' | 'never';\n 'controlGizmo/rotateHandlesVisibility': 'auto' | 'always' | 'never';\n doubleClickSelectionMode: 'Direct' | 'Hierarchical';\n 'touch/pinchAction': 'None' | 'Zoom' | 'Scale' | 'Auto' | 'Dynamic';\n 'touch/rotateAction': 'None' | 'Rotate';\n 'camera/clamping/overshootMode': 'Center' | 'Reverse';\n 'dock/iconSize': 'normal' | 'large';\n 'colorPicker/colorMode': 'RGB' | 'CMYK' | 'Any';\n 'timeline/trackVisibility': 'all' | 'active';\n 'timeline/transitionControlVisibility': 'hover' | 'always';\n 'features/textEditModeTransformHandlesEnabled': boolean;\n 'features/automaticSourceSetsEnabled': boolean;\n}\ntype SettingsBool = SettingBoolPropertyName;\ntype SettingsColor = SettingColorPropertyName;\n/** @deprecated Use SettingsColor instead. */\ntype SettingsColorRGBA = SettingsColor;\ntype SettingsFloat = SettingFloatPropertyName;\ntype SettingsInt = SettingIntPropertyName;\ntype SettingsString = SettingStringPropertyName;\ntype SettingStringPropertyName = 'basePath' | 'defaultEmojiFontFileUri' | 'defaultFontFileUri' | 'upload/supportedMimeTypes' | 'license' | 'web/fetchCredentials' | 'page/title/separator' | 'page/title/fontFileUri' | 'fallbackFontUri' | 'fallbackCMYKProfileUri' | (string & {});\ntype SettingType = 'Bool' | 'Int' | 'Float' | 'String' | 'Color' | 'Enum';\ntype SettingValueType<K extends SettingKey> = Settings[K];\ntype SizeMode = 'Absolute' | 'Percent' | 'Auto' | 'Absolute' | 'Percent' | 'Auto';\ntype SortingOrder = 'None' | 'Ascending' | 'Descending';\ntype SourceSetPropertyName = 'fill/image/sourceSet' | (string & {});\ntype SplitOptions = {\n attachToParent?: boolean;\n createParentTrackIfNeeded?: boolean;\n selectNewBlock?: boolean;\n};\ntype StringPropertyName = 'name' | 'scene/pageFormatId' | 'type' | 'uuid' | 'page/titleTemplate' | 'audio/fileURI' | 'text/externalReference' | 'text/fontFileUri' | 'text/pathExternalRef' | 'text/text' | 'text/typeface' | 'cutout/path' | 'caption/externalReference' | 'caption/fontFileUri' | 'caption/pathExternalRef' | 'caption/text' | 'caption/typeface' | 'effect/lut_filter/filterId' | 'effect/lut_filter/lutFileURI' | 'fill/image/externalReference' | 'fill/image/imageFileURI' | 'fill/image/previewFileURI' | 'fill/video/fileURI' | 'shape/vector_path/path' | (string & {});\ntype SyncURIResolver = (URI: string, defaultURIResolver: (URI: string) => string) => string;\ntype TimelineTrackVisibility = 'all' | 'active';\ntype TouchPinchAction = 'None' | 'Zoom' | 'Scale' | 'Auto' | 'Dynamic';\ntype TouchRotateAction = 'None' | 'Rotate';\ninterface TransientResource {\n URL: string;\n size: number;\n}\n/** @deprecated This type definition is not used anymore and will be removed. Defines the structure of a typeface definition, including metadata, family name, and font details. - 'meta': Optional metadata for the typeface, including default status, library, and categories. - 'family': The name of the typeface family. - 'fonts': An array of font definitions, each containing a font URL, weight, and style. */\ntype TypefaceDefinition = {\n meta?: {\n default?: boolean;\n library?: string;\n categories?: string[];\n };\n family: string;\n fonts: {\n fontURL: string;\n weight: FontWeight;\n style: FontStyle;\n }[];\n};\nclass VariableAPI {\n #private;\n findAll(): string[];\n remove(key: string): void;\n rename(from: string, to: string): void;\n setNumber(key: string, value: number): void;\n getNumber(key: string): number;\n setImage(key: string, uri: string): void;\n getImage(key: string): string;\n findAllOfType(type: VariableType): string[];\n}\ntype VariableType = 'String' | 'Color' | 'Number' | 'Image' | 'Typeface';\ninterface Vec2 {\n x: number;\n y: number;\n}\ntype XYWH = [\n x: number,\n y: number,\n w: number,\n h: number\n];\n",
|
|
14
|
-
"docs/api/video.md": "<!-- requires:video -->\n# Video: any design can become a video\n\n<!-- requires:export -->\nScenes are not \"static\" or \"video\" at creation time — add time-based content\nto the scene you already have, then `export({ format: \"mp4\", blockId: page })` renders the page's\nauthored timeline. Do NOT rebuild a scene with `create({ type: 'scene' })` just to\nanimate it. `preview` seeks (`time`) and `export` renders the timeline in any\nscene mode.\n<!-- /requires:export -->\n<!-- unless:export -->\nScenes are not \"static\" or \"video\" at creation time — add time-based content\nto the scene you already have; the product renders the authored\ntimeline. Do NOT rebuild a scene with `create({ type: 'scene' })` just to\nanimate it. `preview` seeks (`time`) any page with a timeline, in any scene\nmode.\n<!-- /unless:export -->\n\n```js\n// Video mode: groups last to the page's end and previews report {time, duration}.\nconst [scene] = await engine.design.findByType('scene');\nawait engine.design.setProps(scene, { scene: { mode: 'Video' } });\n\n// Page duration = length of the video.\nawait engine.design.setProps(page, { playback: { duration: 10 } }); // seconds\n\n// Timed visuals live on tracks, one track per layer (see \"Timeline: one track per layer\" below).\nconst track = await engine.design.create({ type: 'track' }, { parent: page });\nconst block = await engine.design.create(\n {\n type: 'graphic',\n props: { width: 1920, height: 1080 }\n },\n { parent: track } // the next clip of this layer goes on the same track\n);\nawait engine.design.setProps(block, {\n playback: { timeOffset: 1.0, duration: 5.0 } // enters at t=1s, visible 5s\n});\n\n<!-- requires:asset_add -->\n// Video fill — use the `uri` that `asset_add` returned.\n<!-- /requires:asset_add -->\n<!-- unless:asset_add -->\n// Video fill — use a video `uri` the design or the brief supplies.\n<!-- /unless:asset_add -->\nawait engine.design.setProps(block, {\n fill: { type: 'video', video: { fileURI: '<opaque handle>' } }\n});\nawait engine.design.setProps(block, { playback: { trimOffset: 2.0, trimLength: 5.0 } });\n\n// Animation timing and text styling are spec keys — no raw animation ids.\nawait engine.design.setProps(block, {\n animations: {\n in: { type: 'slide', duration: 0.8, easing: 'EaseOutBack' },\n loop: { type: 'breathing_loop', duration: 2 }\n }\n});\n// Every animation type and its options: the api skill's `Animation` type.\n\n// Audio block — plays during the page's timeline; fades are facade props.\nawait engine.design.create(\n {\n type: 'audio',\n props: {\n audio: { fileURI: '<opaque handle>' },\n playback: {\n timeOffset: 0,\n duration: 10,\n volume: 0.8,\n fadeIn: { duration: 0.5 },\n fadeOut: { duration: 1 }\n }\n }\n },\n { parent: page }\n);\n```\n\nSeveral audio blocks can sit on the page at once — a music bed plus a short\nsound effect per cut, each placed with its own `playback.timeOffset`.\n\n## Timeline: one track per layer\n\nA track holds a sequence of clips in one timeline row. A block placed\ndirectly on the page gets a row of its own, so a 30 s video built that way\nopens in the editor as 50+ rows, one per text and shape. Build the timeline\nthe way an editor would:\n\n- **One track per layer, created bottom first** — for example backgrounds,\n media, headline, subline, chip. Every beat's element for that layer goes\n on the same track, one after another. Only audio sits on the page itself.\n- **Tracks are layers.** A later track draws above an earlier one, for the\n whole video. Two things on screen at the same time sit on two tracks.\n- **Overlaps move up.** A clip that overlaps another on its track, beyond a\n transition, moves to a new track right above it at the end of the edit.\n- **A track is a layer, not an element.** Reuse it across beats: beat 2's\n third line and beat 3's third chip can share one track, because they are\n never on screen together. Aim for the number of layers a frame needs\n (typically 3–6), not one track per element.\n- **Things that enter together are one clip.** A list of lines or a row of\n chips that appears within one beat is a group on one track. Its children\n keep their own `timeOffset`s and in-animations for the stagger, so the\n group needs no track per item. A group takes no transition: transitions\n join two leaf clips (graphic, text, video) that follow each other on one\n track.\n- **Name clips by beat and layer** (`b3/bg`, `b3/headline`) so later edits\n find them with `findByName`.\n\n```js\n// Three beats, two layers: a background sequence and a headline sequence.\nconst bgs = await engine.design.create({ type: 'track' }, { parent: page }); // bottom\nconst words = await engine.design.create({ type: 'track' }, { parent: page }); // above\nfor (const [i, beat] of beats.entries()) {\n const bg = await engine.design.create(\n {\n type: 'graphic',\n name: `b${i}/bg`,\n props: {\n shape: { type: 'rect' },\n width: W,\n height: H,\n fill: { type: 'color', color: { value: beat.color } }\n }\n },\n { parent: bgs } // auto-arranged: back-to-back in creation order\n );\n await engine.design.setProps(bg, { playback: { duration: beat.length } });\n const line = await engine.design.create(\n {\n type: 'text',\n name: `b${i}/headline`,\n props: { text: { string: beat.line, font: { family: 'Inter', weight: 'bold' }, lineHeight: { visual: 1.1 } } }\n },\n { parent: words }\n );\n await engine.design.setProps(line, {\n playback: { timeOffset: beat.start + 0.2, duration: beat.length - 0.4 }\n });\n}\n```\n\nThe `edit` result reports it when the timeline has more rows than its\ntiming needs (\"N timeline rows (… blocks directly on the page, … tracks); by\ntheir timing the clips fit on M tracks\"). Move the blocks onto shared tracks\nin stacking order: each keeps its `timeOffset` and `duration`, and the frames\nstay the same.\n\n### Clips timed to one another: tag the sequence\n\nWhen clips are timed to the keyframes of one clip (captions,\na highlight and dividers that follow a strip's stops, the clip that ends that\nsequence), give every clip of the sequence the same `codesign/sync` metadata\nvalue, and the clip they follow `codesign/sync-lead: 'true'` too. When the user trims\nthe lead in an editor that reads the tags (the CoDesign app's), its motion\nruns faster or slower and the others inside its span compress or stretch with\nit, while those after it move up. A trim of any other member moves no other\nmember.\n\n```js\nfor (const id of [strip, highlight, ...captions, ...dividers, ending])\n await engine.design.setProps(id, { metadata: { 'codesign/sync': 'strip' } });\nawait engine.design.setProps(strip, { metadata: { 'codesign/sync-lead': 'true' } });\n```\n\n- One lead per sequence: a graphic or text whose keyframes carry the beats\n (keyframe times scale with the clip's length; entrance, exit and loop\n animations do not). Never a group, a video or an audio clip: trimming\n media cuts its content, so nothing follows it.\n- One value per sequence on a page. Clips that only share the page, not a\n timing (a headline or logo that stays for the whole video), stay untagged.\n- Tag the clips a track or the page holds, not a group's children: the group\n is the clip.\n\n## Sound: music, voiceover, sound effects\n\n<!-- requires:export -->\nAudio is part of the design, not an afterthought: it plays under the page's\ntimeline and ships inside the mp4 (or alone as `wav`/`m4a`, see Notes). A silent video is a complete deliverable\nwhen the brief chose it — say so, rather than leaving sound out by omission.\n<!-- /requires:export -->\n<!-- unless:export -->\nAudio is part of the design, not an afterthought: it plays under the page's\ntimeline and ships inside the rendered video. A silent video is a complete\ndeliverable when the brief chose it — say so, rather than leaving sound out by\nomission.\n<!-- /unless:export -->\n\n<!-- requires:asset_add -->\n- **Sources.** The user's own file → `asset_add` (mp3, wav, m4a, ogg, aac).\n<!-- /requires:asset_add -->\n<!-- unless:asset_add -->\n- **Sources.** The user's own audio, by a `uri` the design or the brief supplies.\n<!-- /unless:asset_add -->\n<!-- requires:asset_generate -->\n Otherwise `asset_generate`: music and sound effects are provider\n models (`capability: \"text2audio\", source: \"all\"`), a voiceover is\n `elevenlabs/eleven-v3-tts`, and `elevenlabs/scribe-v2` transcribes speech\n into a `transcriptUri` plus every timed sentence, or for a long recording an\n outline of where to look (its description says whether it also takes video\n and long recordings). Prompts and\n parameters per model are in\n `{{skill:models#audio.md}}`, including how to write brand names in a\n voiceover's text so they are said right. Each returns a `uri` and, when the\n file states it, a `duration` — size the page and the clips from it.\n<!-- /requires:asset_generate -->\n- **Timing.** Put a voiceover on the timeline where its sentence belongs and cut\n or animate to its words: inside `edit`,\n `engine.design.readTranscript(transcriptUri, { from, to })` gives each\n word's start and end in seconds of the source (captions and word-timed text\n use the same times).\n Music drives the cuts when there is no voice:\n `engine.design.readBeats(audio, { bpm })` maps its beats in page seconds\n (the `launch-video` skill shows how to cut to them).\n- **Levels.** One audio block per sound. Duck the\n music under a voiceover (0.3–0.5 while it speaks); a sound effect is a short\n block at the cut, 0.5–0.8 under the music. Give the bed a `fadeOut` that ends with the page\n (and a `fadeIn` unless it starts on a hit). A bed shorter than the page\n leaves a silent tail — pick a longer track, or end the page with the music.\n<!-- requires:export -->\n- **Checking it.** `preview` renders pictures, not sound: the audio is only\n heard in the exported mp4. Export once, after the judge gate passes, then confirm from the export result that\n `audioDuration` is present and about equals `duration` (no `audioDuration` means\n the mp4 has no audio track), and listen to it when your host can play it;\n otherwise tell the user which sounds sit where.\n<!-- /requires:export -->\n<!-- unless:export -->\n- **Checking it.** `preview` renders pictures, not sound: tell the user which\n sounds sit where, so they can check them in the rendered video.\n<!-- /unless:export -->\n\n## Transitions between clips\n\nA transition joins a clip to the NEXT clip on the same track (`push`, `wipe`,\n`cross-zoom`, …) and renders in the video. Only leaf clips on a track qualify —\na graphic, text or video block that is a track's child. Blocks placed on\nthe page directly, groups, pages and tracks do not. A layer's sequence of beats is\none track (see \"Timeline: one track per layer\"), so each layer gets its own\ntransitions.\n\n```js\n// clipA → the clip after it on the track; duration defaults to 1.2\nawait engine.design.setProps(clipA, {\n transition: { type: 'push', duration: 0.3, easing: 'EaseOutQuint', push: { direction: 'Up' } }\n});\n```\n\n- **Timing.** The transition runs during the overlap of the two clips. With\n auto-arrange on, a transition starts the next clip `duration` before\n the current one ends. With auto-arrange off, lengthen each clip by the transition duration yourself\n (`timeOffset` of the next clip = the cut time; this clip's duration runs\n past it by the transition length) — keep that overlap equal to the\n transition's duration, or the transition drifts off the cut.\n- **Verify transitions with `preview`.** A still at `time` inside a\n transition renders it as the mp4 does — preview its middle\n (`time` = cut + duration/2). A still that shows one clip whole there means\n the transition is not applied or not where you think: check the clip is a\n track child and the overlap equals the transition's duration.\n\n## Captions\n\nNative captions burn into the mp4 and stay editable in the editor:\npage → one `captionTrack` → one `caption` per phrase.\n\n```js\nconst track = await engine.design.create(\n { type: 'captionTrack' },\n { parent: page }\n);\nconst ids = [];\nfor (const p of phrases) // { text, start, end } from transcript word times\n ids.push(\n await engine.design.create(\n {\n type: 'caption',\n props: {\n caption: { text: p.text },\n playback: { timeOffset: p.start, duration: p.end - p.start }\n }\n },\n { parent: track }\n )\n );\n// style ONCE — every caption on the track takes it\nawait engine.design.setProps(ids[0], {\n caption: {\n font: { family: 'Inter', weight: 'bold' },\n fontSize: '56px',\n color: { r: 1, g: 1, b: 1, a: 1 },\n horizontalAlignment: 'Center'\n },\n position: { x: 90, y: 1500 },\n width: 900,\n height: 200\n});\n```\n\n- **Style and layout are track-wide.** Position, size, font, font size, colour,\n alignment, `backgroundColor` and stroke written on ANY caption apply to every\n caption on its track, and a new caption adopts them. Write them once; text,\n `playback` timing, opacity and animations are per caption.\n- **Highlight a word on one caption with `caption.ranges`**\n (`[{ from, to, color }]`, offsets into `caption.text`, the same shape\n as `text.ranges`): ranges stay on that caption. A karaoke line is one\n caption per spoken word, each carrying the full phrase with its active word\n coloured. Write the track style first: a later `caption.color` replaces\n every caption's ranges.\n- **One track per page.** A second track is a second, independent style.\n- **Phrases, not words.** Group transcript words into 2–6-word phrases that\n fit the frame; consecutive captions should not overlap in time.\n- **From a subtitle file:** `create({ type: 'captionTrack', props: { subtitles: uri } }, { parent: page })`\n parses an SRT or VTT the brief supplies into timed captions on the track\n (writing `subtitles` again replaces them); style one as above.\n- **Animate captions per caption** (`animations` on each id, set once the\n caption is on its track), e.g. a 0.2 s `fade` in; a word-by-word reveal is\n one caption per word. A caption renders no `writingStyle` and no\n typewriter_text, block_swipe_text, spread_text or merge_text\n (`{{skill:api#animation.md}}`).\n\n## Notes\n\n- **Groups time their children.** A child's `timeOffset` inside a group counts from the group's\n start. A group on a page of a Video scene (`create`'s group node or `group(ids)`) lasts to the\n page's end; `create` also stretches its children that name no duration.\n A longer `playback.duration` on a group later lengthens those children too; a child\n whose duration you set, one with `keyframes`, and video or audio keep theirs.\n<!-- requires:import -->\n- **A Lottie animation** (`.json` or `.lottie`) imports as a Video design: one page of its size\n and length, its layers editable blocks with their keyframes, its markers the scene's. A layer\n CE.SDK cannot draw as blocks plays from a video fill, which `import` names in `warnings`: its\n colours, effects and speed stay as they are. A longer `playback.duration` on a block and its\n group stretches that block's keys.\n<!-- /requires:import -->\n<!-- requires:export -->\n- **Animating an existing still design?** The `animate` skill does it end to end:\n `{{skill:animate}}`.\n- Export: `export({ format: \"mp4\", blockId: page })`.\n Duration and resolution come from the page, or pass `width`/`height` for a\n file of another size: the video scales with its aspect kept, the design stays\n as it is. A size the encoder refuses gets an error naming one that fits. The\n frame rate is `fps`, else\n the scene's `scene.frameRate` (30 unless set; above 0, at most 240). The page's audio blocks are\n mixed into the mp4 (AAC; Opus where the engine has no AAC encoder). The mp4's embedded cover\n image is the frame at the page's playhead (`playback.time`).\n<!-- requires:video-limit -->\n- An mp4, wav or m4a export is at most {{max-video-seconds}} seconds long, and a video at most as much\n work as {{max-video-seconds}} seconds of 1080p at 30 fps (frames × pixels): a larger one is refused\n before it renders. Shorten the page, export it smaller with `width`/`height`, pass a lower `fps`,\n or split the video into pages and export each.\n<!-- /requires:video-limit -->\n- Audio only: `export({ format: \"wav\" | \"m4a\", blockId: page })`\n renders the page's audio mix (`wav` = 48 kHz stereo 16-bit PCM). Page only; for one\n clip alone, export while it is the only audio on the page. Every clip sounds\n over exactly its own window (within a few ms) — same timing as the mp4.\n<!-- /requires:export -->\n<!-- unless:export -->\n- Duration and resolution come from the page.\n<!-- /unless:export -->\n<!-- requires:diagnostics -->\n- Needs the native engine (the default). If the server fell back to WASM,\n video/audio tools refuse with the reason; `diagnostics` shows\n `status.config.videoAvailable`.\n<!-- /requires:diagnostics -->\n- Motion beyond timing — entrance/exit/loop animations, animated text, and\n custom moves with `keyframes` (seconds of the block's own duration):\n `{{skill:api#animation.md}}`; every type and its options are the api skill's\n `Animation` type.\n- **Motion blur** smears fast moves like a camera shutter:\n `setProps(block, { motionBlur: { enabled: true } })`, and on the scene\n `motionBlur: { samples, shutterAngle, shutterPhase }` (1–64, 0–720°,\n −360–360°). More samples cost export time. Preview stills and image\n exports are always sharp: check motion blur in the exported MP4.\n- **`transformParent: '<uuid or name>'`** makes a graphic or text follow\n another graphic's or text's position, rotation and scale (not its opacity\n or stacking). Its `position` then counts from the parent's top-left, so it\n moves on screen when linked; `null` unlinks. Scaling a group this way:\n `{{skill:api#animation.md}}`.\n- Markers: `setProps(scene, { markers: [{ name: 'drop', time: 8.2, duration? }] })`\n keeps named moments (seconds) in the design for later edits and the\n editor's timeline — e.g. the beats you cut to. The list is replaced\n wholesale; `getProps(scene, ['markers'])` reads it.\n- `preview` renders a STILL frame, not motion — pass `time` (seconds) to seek\n any page with a timeline, whatever the scene mode: verify a few salient\n moments (start, mid-beat, the middle of each transition, the end). Each\n timed preview returns `{time, duration}` JSON next to the image.\n<!-- requires:export -->\n Export for the real thing.\n- Resource loading during export is handled server-side — you do NOT need a\n `loadResources` barrier before `export`.\n Trim writes, an audio block's `playback.speed` and reading a clip's length\n (`getProps(clip, ['fill']).fill.video.totalDuration`, audio: `audio.totalDuration`)\n load the clip themselves.\n- On video, the fill's `trimLength` sets the block's `duration`, one way only.\n<!-- /requires:export -->\n<!-- /requires:video -->\n",
|
|
15
|
-
"docs/brand/SKILL.md": "---\nname: brand\ndescription: >-\n Use when applying a brand kit / brand style to an existing CoDesign / CE.SDK design — a\n rules-governed restyle (recolor + refont + logo + treatment by role), not a free-form style\n change; when a restyled design reads off-brand (free-chosen colors, wrong accent, a second\n colour used as structure, a coloured button the brand forbids, a headline set in a weight the\n brand bans, a flat bordered card, or the wrong / recoloured / redrawn logo); when loading a\n brand's fonts, wordmark SVG, or signature device into a scene; or when turning an external brand\n (a guidelines PDF, a website / URL, a Figma file, or a raw asset dump) into a reusable brand kit.\n---\n\n# brand\n\nPoint this skill at the current design and a brand kit, and it re-skins the design to that brand\n<!-- requires:export -->\nunder the brand's **strict rules**. It operates on the **design in the current session**, and the\nrestyle is **exported as its own `.imgly` file**. Single home for the brand workflow: the\n<!-- /requires:export -->\n<!-- unless:export -->\nunder the brand's **strict rules**. It operates on the **design in the current session**.\nSingle home for the brand workflow: the\n<!-- /unless:export -->\n**role → token map**, the **restyle routine**, the **graded conformance pass**, and the brand\n**no-goes**.\n\n<!-- requires:export -->\n**Keep the source; restyle a copy.** A session holds one design and a restyle changes it in place,\nso take the source's `uri` first and `import` it — the restyle goes to the copy, and\nthe source stays as it was:\n\n```\nexport({ format: 'imgly' }) → SOURCE_URI (the un-branded original, kept)\n<!-- requires:open -->\nimport({ source: { uri: SOURCE_URI } }) → a copy of it is the session\n<!-- /requires:open -->\n<!-- unless:open -->\n<!-- requires:version -->\nimport({ source: { uri: SOURCE_URI } }) → a copy of it: a new design, with its own design and version\n<!-- /requires:version -->\n<!-- unless:version -->\nimport({ source: { uri: SOURCE_URI } }) → the source replaces the session; its save is a new file\n<!-- /unless:version -->\n<!-- /unless:open -->\nedit(…) restyle + conform\npreview() → diff against the source's render\nexport({ format: 'imgly' }) → the restyled edition, its own file\n```\n\nBoth editions then exist. Skipping the first two steps means the un-branded original is gone\nthe moment you restyle — and the source-parity diff the `judge` gate requires has nothing to\ncompare against.\n<!-- unless:open -->\n<!-- unless:version -->\n**Check the second save's returned `uri` is not `SOURCE_URI`** (re-saving a session\nrevises one file) — a restyle that landed back on the source replaced the un-branded original\ninstead of joining it.\n<!-- /unless:version -->\n<!-- /unless:open -->\n\n<!-- /requires:export -->\n<!-- unless:export -->\n**The source stays intact.** The product opens the restyle as its own session, so restyling the\ndesign in front of you does not touch the original. `preview` it before you change anything: that\nrender is the source the `judge` gate's parity diff compares against.\n\n<!-- /unless:export -->\nIt builds on things it does _not_ restate: design rules §6.1–§6.5 (the general typography / colour /\nhierarchy / composition / craft thresholds), the `api` skill's engine mechanics (the `text.font`\ndeclaration, fill specs, auto-reshape, `loadResources`, the content-area line-height\nconversion §6.1.3), and its two siblings. The brand kit's own `tokens.json` supplies the\n**values**; this skill supplies the **procedure**.\n\n**Scoring:** a restyle is judged with the `judge` skill — every applicable axis ≥ 8, no averaging,\nN/A = 10. The brand kit's `avoid` list + `do-dont/` gallery are an **additional** gate on top of\nthe axes: a single hard `avoid` violation (a second colour used as structure, a banned button, a\nredrawn logo, a free-chosen colour) fails the restyle even if the axes would pass — include an\n\"avoid-list\" row in the judge scorecard.\n\n## Reference files (load on demand)\n\nThis `SKILL.md` is the always-needed spine: inputs, core principle, role map, workflow, restyle\nroutine, conformance pass, the **brand conformance checklist**, no-goes. Two situational bodies live\nbeside it:\n\n- **`reference/brandkit-spec.md`** — the canonical brand-kit **schema** (what `tokens.json` must\n contain, required-core vs optional sections, how the skill degrades when a section is absent).\n Read it when validating a kit or unsure what a token means.\n- **`reference/authoring.md`** — the **intake** mode: turning an _external_ brand (a guidelines PDF,\n a website/URL, a Figma file, or a raw asset dump) into a canonical `<kit>/` before\n applying — extraction per source form, the not-invent discipline, the avoid-list hard-stop, the\n font-subset trap. Read it whenever the kit isn't already a valid canonical folder.\n- **`reference/asset-loading.md`** — the **asset mechanics** (resolving brand fonts to a fetchable\n<!-- requires:asset_add -->\n URI incl. the local-TTF → imported-`uri` bridge, the hex → 0-1 RGBA conversion, placing the\n<!-- /requires:asset_add -->\n<!-- unless:asset_add -->\n URI, the hex → 0-1 RGBA conversion, placing the\n<!-- /unless:asset_add -->\n wordmark SVG, recolouring monochrome icons, building the **kicker pill** on a text background,\n block-**opacity** vs colour-alpha, `text.color` vs colour-fill, the whole-block colour that\n flattens per-run colour). Unlike\n its two siblings this one is NOT situational — every restyle touches fonts, colours, or the\n logo, so it is required reading before the restyle routine; it lives beside the spine only to\n keep this entry document lean.\n\n## localize / resize vs brand — the three surgeries\n\nThe three sibling skills each change exactly one layer and hold the rest fixed:\n\n- **localize** — changes the **words** (+ the script's font); **snaps geometry** back to\n the reference. Any geometry move is drift.\n- **resize** — changes the **canvas**; **re-derives geometry** for the new aspect. Copy\n and style are held.\n- **brand** — changes the **style layer** (colour, type, logo, treatment) **by role**;\n **holds copy and composition**. Geometry moves only in the graded conformance pass, and only\n where a brand _rule_ requires it — never a free re-layout.\n\nNever confuse them: don't re-word or re-flow inside a brand pass (that's localize / resize), and\nif a brand genuinely needs a different _layout_ (not just a different skin), that is a **resize**,\nnot a brand restyle — cross-ref and stop, don't silently re-compose.\n\n## Inputs — what to restyle, into which brand, in which scheme\n\n<!-- requires:interactive -->\nResolve these by the intake contract — derive, ask once, echo, invent nothing:\n`{{skill:create#intake.md}}`. **R** = required, no default; **A** = ask if\nunderived; **D** = defaultable.\n<!-- /requires:interactive -->\n<!-- unless:interactive -->\nResolve these by the intake contract — derive, decide what is missing, echo, invent nothing:\n`{{skill:create#intake.md}}`. **R** = required, no default; **A** = has a default, resolved by the intake when underived; **D** = defaultable.\n<!-- /unless:interactive -->\n\n| Parameter | Kind | Chips / values | Default |\n| ------------- | ------- | ------------------------------------------------------------------------- | --------------------------------- |\n| brand kit | **R** | the kits you can find · `Provide a brand source` · Other | **none — never invented** |\n| colour scheme | A | the chosen kit's `colorSchemes.approved` · `Decide automatically` · Other | the neutral / `paper` scheme |\n| source design | derived | — | the design in the current session |\n\n<!-- requires:export -->\n**1. The source** — the design in the current session. **Export it as `.imgly` first** (`export({ format: 'imgly' })`)\nand keep its `uri`: a restyle preserves that design's geometry and copy — only the style layer\nchanges — and that file is both the un-branded original and your reference for the parity\ndiff.\n<!-- requires:open -->\nIf the user means a design saved earlier, its `uri` IS `SOURCE_URI`: `open` it to `preview` and\ncapture it, skip the first export, then `import` a copy to restyle.\n<!-- /requires:open -->\n<!-- unless:open -->\n<!-- requires:version -->\nIf the user means a design saved earlier, its `design` IS the source: `preview` it and capture it,\nskip the first export, then `import` a copy to restyle.\n<!-- /requires:version -->\n<!-- unless:version -->\nIf the user means a design saved earlier, load it with `import({ source: { uri: '<its uri>' } })`.\n<!-- /unless:version -->\n<!-- /unless:open -->\n<!-- /requires:export -->\n<!-- unless:export -->\n**1. The source** — the design in the current session. `preview` it before you change anything:\na restyle preserves that design's geometry and copy — only the style layer changes — and that\nrender is your reference for the parity diff.\n<!-- /unless:export -->\n\n**2. The brand kit** — a folder the user points you at (`<kit>/`), holding `tokens.json` (+\n`BRAND.md`, fonts, logos, icons, imagery, `do-dont/`). Parse `tokens.json` **first**; it is the\nmachine-readable law. Validate it against `reference/brandkit-spec.md`.\n<!-- requires:ly.img.workspace.styles -->\nA style the user names without handing it to you (_\"in our Acme style\"_) is saved in the\nworkspace: find it with `asset_search({ source: 'ly.img.workspace.styles', query: '<its name>' })`.\nThat answer carries the style's `STYLE.md` and `tokens.json`: they are its kit, so read nothing\nelse to apply it. When it says no style has exactly that name and others match, the kit it carries\nis a guess: ask which one is meant, or, with nobody to ask, say in your reply which one you used.\nAnother style's kit comes from a search by its id. The kits you can find are that source's assets;\na pack's style has the group `pack:<pack id>`.\n<!-- /requires:ly.img.workspace.styles -->\n<!-- requires:asset_add -->\nA saved style names its fonts, logos, icons and images in `tokens.json` by URI, not by a path in\nits folder: those files are already in the store, so use each URI as it is.\n<!-- /requires:asset_add -->\n\n<!-- requires:interactive -->\nIf no kit is named, **ask** — _**Which brand should this use?**_ — offering the kits you can find\nplus `Provide a brand source`. A brand is the user's own fact: there is no\ndefaulting to \"a sensible brand\", and no proceeding on an inferred one.\n<!-- /requires:interactive -->\n<!-- unless:interactive -->\nIf no kit is named, change nothing and say in your reply that the restyle needs a brand kit. A\nbrand is the user's own fact: there is no defaulting to \"a sensible brand\", and no proceeding on an\ninferred one.\n<!-- /unless:interactive -->\n\n<!-- requires:interactive -->\nIf what the user gives you is **not** a canonical kit yet — an external source (a guidelines PDF, a\nwebsite/URL, a Figma file, or a raw asset dump), or a folder with no valid `tokens.json` —\n**scaffold it into the canonical shape first** (extract → map → `tokens.json` + `BRAND.md` + assets\n→ validate), per **`reference/authoring.md`**, then apply against the new kit. Ask the user where\nthe kit folder should live; it is theirs to keep and reuse.\n<!-- /requires:interactive -->\n<!-- unless:interactive -->\nIf what the user gives you is **not** a canonical kit yet — an external source (a guidelines PDF, a\nwebsite/URL, a Figma file, or a raw asset dump), or a folder with no valid `tokens.json` —\n**scaffold it into the canonical shape first** (extract → map → `tokens.json` + `BRAND.md` + assets\n→ validate), per **`reference/authoring.md`**, then apply against the new kit. Put the kit folder\nbeside the source you were given, and say where it is; it is theirs to keep and reuse.\n<!-- /unless:interactive -->\n\n<!-- requires:interactive -->\n**If the required-core is incomplete, ask for the missing piece — don't stop, and don't guess.**\nNever fill a gap in a kit with a value of your own: not a colour, not a typeface, not a logo.\nName what is missing and ask for exactly that, e.g.\n\n> The Acme kit has no display font — `typography.display` is empty, and I won't pick one for your\n> brand.\n> **Which font should headlines use?** `Provide a font file` · `Name a Google font` ·\n> `Use the kit's body font` · Other\n<!-- /requires:interactive -->\n<!-- unless:interactive -->\n**If the required-core is incomplete, don't guess.** Never fill a gap in a kit with a value of\nyour own: not a colour, not a typeface, not a logo. Change nothing, and name in your reply exactly\nwhat is missing, e.g. \"The Acme kit has no display font — `typography.display` is empty, and I\nwon't pick one for your brand.\" \n<!-- /unless:interactive -->\n\n**3. The scheme** — one **approved** `colorScheme` from `tokens.colorSchemes.approved`, chosen\ndeliberately per `backgroundSelection` (default the neutral/`paper` scheme; use the full-bleed\nbrand-colour scheme only for a deliberate hero). If the kit offers more than one approved scheme\n<!-- requires:interactive -->\nand nothing in the request implies which, ask — _**Which colour scheme?**_ — with the kit's own\napproved schemes as chips plus `Decide automatically`. Reading the chips from `tokens.json` is not\ninvention; free-choosing a `(bg, text, accent)` triple is. **One scheme per piece** — never a\n`denied` combination.\n<!-- /requires:interactive -->\n<!-- unless:interactive -->\nand nothing in the request implies which, take the default and say so in the echo. Choosing among\nthe schemes in `tokens.json` is not invention; free-choosing a `(bg, text, accent)` triple is.\n**One scheme per piece** — never a `denied` combination.\n<!-- /unless:interactive -->\n\nThen echo what you resolved in one line (\"acme restyle, paper scheme (defaulted), 1 design\") and\nrun the Workflow. The restyling `edit` gets a `note` naming the brand and scheme (e.g. \"acme\nrestyle, paper scheme\").\n\n## Core principle — re-skin by role, then conform to the brand's law\n\nA brand kit is not a palette swap — it is a **role system**. Restyling is two layers:\n\n- **Layer 1 — Restyle (always).** Classify each source block by its **design role**, then set its\n colour + font + treatment from the **brand token for that role** (background → scheme background;\n headline → display family; the one focal moment → accent; eyebrow → kicker style; …). Geometry\n unchanged. This is deterministic once roles are mapped.\n- **Layer 2 — Graded conformance.** Enforce the brand's structural law where it does **not** fight\n the source composition: kill every hard `avoid` / `denied` violation (non-negotiable), then apply\n the applicable structural rules (proportion, safe-area margins, kicker-as-pill, card shadow,\n signature device, size thresholds). A rule that would require re-laying-out the piece is\n out-of-scope — flag it (→ resize), don't force it.\n\nThe brand's `avoid` list is the floor: **no restyle ships with a hard `avoid` violation**, even if\nevery axis scores ≥ 8.\n\n**Bound designs re-theme in one write.** Read `getProps(id, ['bindings'])` on the blocks first: a\nleaf bound to a scene variable (`'fill.color': 'accent'`, `'text.font': 'display'`) refuses a\ndirect write (`DESIGN.PROPERTY_BOUND`) — set the variable instead, and every block bound to it\nfollows: `setProps(scene, { variables: { accent: { color: TOKEN }, display: { font: { family } } } })`.\nWhen the brief asks for a design that switches between brands or schemes, build it that way: one\ncolour or font variable per role token, each role's blocks bound to it\n(`{{skill:templates}}`); the switch is then one `variables` write per scheme. A\nreopened design keeps its bindings but reads none of its own variable values: write every bound\nvariable.\n\n## Role → token map\n\nClassify by measurable role (as in the localize skill's block classification), then map:\n\n| Source block role | Brand token (from `tokens.json`) |\n| ------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |\n| full-bleed background | chosen `colorSchemes.approved[].background` |\n| headline / display / big number | `typography.display` family; text = scheme `text` (or `primary-foreground` on a colour field); **respect `headlineWeight`** — never exceed the brand's weight _at that size_ (a `typography.display.weightRule` may vary it by size) |\n| subline / lead / body | `typography.body` family; text = scheme `text` or `muted-foreground` |\n| the single focal moment (one accent) | scheme `accent` / `semanticColors.primary` — **one per piece**, but the `avoid` list wins (see the trap below): on a full-bleed brand-colour scheme the accent role often has **no valid target** — drop it, the field is the moment |\n| eyebrow / kicker | `elements.kicker` (pill shape + its text colour) — not a bare coloured label |\n| divider / rule | `elements.divider` (hairline) — never a coloured/second-colour stroke |\n| card / panel / tile | `shape` corner radius + `elevation` shadow — never a flat bordered box |\n| CTA | `elements.button` **only on interactive/mockup media**; on static media a CTA is text/URL |\n| logo / wordmark | `logo.variantsByBackground` picked by the chosen background — exact bundled SVG only; if the asset is `$meta.gaps`-flagged (trademark-locked / not fetched), skip or placeholder it, never invent/redraw |\n| monochrome icon | recolour its ink to the role colour (`reference/asset-loading.md`) |\n| photographic / product media | keep; grade per `imagery` if the brand specifies; never tint to a banned colour |\n\nWhere the source has no block for an optional brand element (device, kicker), the conformance pass\n_may_ add it if it fits; where the brand kit lacks an optional token, skip that rule (graceful\ndegradation — `reference/brandkit-spec.md`).\n\n**The scheme-accent trap — `avoid` overrides the scheme.** A `colorSchemes.approved` entry may list\nan `accent` the `avoid` list forbids in the context you're applying it (e.g. IMG.LY's `indigo-moment`\nlists a mint accent, but `avoid` bans mint text on an indigo field). When the scheme's accent and\nthe `avoid` list conflict, **the `avoid` list wins**: apply **no** accent and let the full-bleed\nfield be the moment. Do not add a mint (or any denied) accent just because the role map has an\n\"accent\" row — an empty accent role is correct here.\n\n**Non-hero archetypes.** The role map is written for a headline+subline hero, but many designs aren't\none — a quote card is eyebrow / quote-as-display / attribution-caption with no \"lead\". Map by the\n_nearest_ role (quote → `typography.display`; attribution → `typography.body`/caption) and ignore\nrows with no matching block; don't invent a subline to satisfy `typography.pairing`.\n\n## Workflow\n\n1. **Load & validate the brand kit.** Parse `tokens.json`; read `avoid` + skim `do-dont/`. Resolve\n<!-- requires:asset_add -->\n every needed font to a fetchable URI and `asset_add` the logo SVG(s) — **`reference/asset-loading.md`**;\n a file `tokens.json` names by URI already is one: use it as it is, no `asset_add`.\n<!-- /requires:asset_add -->\n<!-- unless:asset_add -->\n every needed font and the logo SVG(s) to fetchable URIs — **`reference/asset-loading.md`**.\n<!-- /unless:asset_add -->\n<!-- requires:export -->\n2. **Read the source, and export it.** The design resolved in Inputs is the reference — its geometry\n and copy are what the restyle preserves. `preview` it now and `export({ format: 'imgly' })` it:\n that render is the only source render the parity diff in step 7 will have, and that file is the\n un-branded original.\n<!-- requires:import -->\n Then `import({ source: { uri: SOURCE_URI } })` — restyle the copy, never the source.\n<!-- /requires:import -->\n<!-- /requires:export -->\n<!-- unless:export -->\n2. **Read the source.** The design resolved in Inputs is the reference — its geometry\n and copy are what the restyle preserves. `preview` it now, before any change: that render is\n the only source render the parity diff in step 7 will have.\n<!-- /unless:export -->\n3. **Capture source roles + style.** Walk the scene; classify blocks by role; read each block's\n current colour / font / geometry (see routine).\n4. **Pick one approved scheme** per piece (per `backgroundSelection`); pick the logo variant by the\n chosen background.\n5. **Layer 1 — Restyle.** For each block set the brand token for its role — recolour,\n refont (unique `typeface.name`), apply radius/shadow/accent, swap the logo. **Re-map the accent\n runs in the same write** — a font/size change auto-reshapes with ranges preserved, but the\n whole-block role colour flattens per-character colour, so the accent runs go back on as\n `text.ranges` in that same `setProps`. Geometry untouched.\n6. **Layer 2 — Graded conformance.** Fix every hard `avoid`/`denied` violation; apply the structural\n rules that fit the source (proportion ~ the brand's ratio, safe-area margins, kicker pill, card\n shadow, device placement, size thresholds). Flag any layout-level need as out-of-scope (→ resize).\n7. **Judge against the source** — a restyle is a **source-derived variant**: diff this render\n against the source render you captured in step 2. Copy, geometry, and composition must be the\n<!-- requires:import -->\n<!-- requires:open -->\n source's; only the style layer moved. (Lost that render? `export({ format: 'imgly' })` the\n restyle for its `uri`, `open` the source, `preview` it, then `open` the restyle's `uri` to\n return.) Then run the `judge` skill with the brand `avoid`/`do-dont`\n<!-- /requires:open -->\n<!-- unless:open -->\n<!-- requires:version -->\n source's; only the style layer moved. (Lost that render? `preview({ design: '<source design>' })`\n it, then carry on with the restyle by its own `design`.) Then run the `judge` skill with the\n brand `avoid`/`do-dont`\n<!-- /requires:version -->\n<!-- unless:version -->\n source's; only the style layer moved. (Lost that render? Save the restyle first —\n `export({ format: 'imgly' })` — then `import` the saved source, `preview` it, and `import` the\n restyle's `uri` back; its next save is a new file, so report that `uri`.) Then run the `judge`\n skill with the brand `avoid`/`do-dont`\n<!-- /unless:version -->\n<!-- /unless:open -->\n<!-- /requires:import -->\n<!-- unless:import -->\n source's; only the style layer moved. Then run the `judge` skill with the brand `avoid`/`do-dont`\n<!-- /unless:import -->\n added to the criteria; contrast ≥ 4.5:1 after every recolour. Fix anything < 8 or any hard\n violation.\n<!-- requires:export -->\n<!-- requires:drafts -->\n8. **`loadResources` → `preview` → `export`.** Preview the restyle — wrong face, lost colour, low\n contrast, and a banned tell only show in the render. Then `export({ format: 'imgly' })`: that\n file is the branded edition to hand over (the copy itself is saved as you edit it). Report\n both `uri`s — original and restyle.\n<!-- /requires:drafts -->\n<!-- unless:drafts -->\n8. **`loadResources` → `preview`.** Preview the restyle — wrong face, lost colour, low\n contrast, and a banned tell only show in the render. The restyle is kept as you edit it;\n `export({ format: 'imgly' })` returns its `uri`. Report both `uri`s — original and restyle.\n<!-- /unless:drafts -->\n<!-- /requires:export -->\n<!-- unless:export -->\n8. **`loadResources` → `preview`.** Preview the restyle — wrong face, lost colour, low\n contrast, and a banned tell only show in the render. The product keeps the restyle after every\n successful `edit`; there is nothing to save.\n<!-- /unless:export -->\n\nDry-run the conformance checklist (below) against each render before reporting done.\n\n## The restyle routine\n\n<!-- requires:export -->\nLayer-1 as a CoDesign `edit`, run on the copy of the source. It classifies, maps role →\n<!-- /requires:export -->\n<!-- unless:export -->\nLayer-1 as a CoDesign `edit`, run on the source. It classifies, maps role →\n<!-- /unless:export -->\ntoken, and recolours/refonts with the accent re-map guard. It is a **judgment-driven\nfirst pass** (the role classification and the focal-moment choice need your eye), not a blind\ntransform. Adapt the classification to the design; fill `SCHEME` and the font URIs from the kit\n(resolve fonts per `reference/asset-loading.md`).\n\n**Capture the source's roles + current style** (run on the source page):\n\n```js\nconst [page] = await engine.design.findByType('page');\nconst out = [];\nconst read = async (id) => {\n const p = await engine.design.getProps(id, [\n 'type',\n 'width',\n 'height',\n 'position',\n 'opacity'\n ]);\n const r = {\n id,\n type: p.type, // the SHORT name: 'text', 'graphic', 'page'\n x: Math.round(p.position.x),\n y: Math.round(p.position.y),\n w: Math.round(p.width),\n h: Math.round(p.height),\n opacity: p.opacity\n }; // a \"faint\" block is usually low opacity, NOT low colour-alpha\n if (p.type === 'text') {\n const t = (await engine.design.getProps(id, ['text'])).text;\n r.s = t.string.slice(0, 20);\n r.color = t.color; // run 0 = the base style; per-run truth is text.ranges\n // the read carries its unit ('32px', always pixels) and writes straight back\n r.fs = (await engine.design.getProps(id, ['text.fontSize'])).text.fontSize;\n }\n out.push(r);\n for (const c of await engine.design.getChildren(id)) await read(c);\n};\nfor (const c of await engine.design.getChildren(page)) await read(c);\nconst pg = await engine.design.getProps(page, ['width', 'height']);\nreturn {\n type: 'text',\n text: JSON.stringify({ pw: pg.width, ph: pg.height, b: out }, null, 1)\n};\n```\n\n**Apply brand tokens to the source** (first pass, then conform + preview):\n\n```js\n// hex '#RRGGBB' -> CE.SDK 0-1 RGBA. See reference/asset-loading.md.\nconst rgba = (hex, a = 1) => ({\n r: parseInt(hex.slice(1, 3), 16) / 255,\n g: parseInt(hex.slice(3, 5), 16) / 255,\n b: parseInt(hex.slice(5, 7), 16) / 255,\n a\n});\nconst tf = (name, uri) => ({\n name,\n fonts: [{ uri, subFamily: 'Regular', weight: 'normal', style: 'normal' }]\n});\n\n// --- from the kit: the chosen approved scheme + resolved font URIs (unique names!) ---\nconst SCHEME = { background: '#FBFBFC', text: '#2E2E2F', accent: '#471AFF' };\nconst DISPLAY = {\n uri: '<opaque handle>',\n name: 'GT Walsheim Pro Medium'\n}; // headlineWeight only\nconst BODY = { uri: '<opaque handle>', name: 'Inter' };\n// A font swap changes the content area, so re-convert any target line-height from the NEW\n// font's metrics — not a fixed factor (design rules §6.1.3). Call after the font write; the\n// lineHeight write reshapes on its own, ranges preserved.\nconst setLineHeight = async (id, targetLH) =>\n await engine.design.setProps(id, { text: { lineHeight: { visual: targetLH } } });\n\nconst [page] = await engine.design.findByType('page');\nawait engine.design.loadResources([page]);\n// classify from the capture (background = full-bleed graphic; headline = largest text;\n// lead/body = remaining text; eyebrow = small text above headline; logo/media = image fills).\n\n// text: ONE write — font + size + role colour + the re-mapped accent ranges. The font/size\n// write auto-reshapes with ranges preserved, so there is no capture → reshape → replay dance;\n// the runs are read only because the whole-block role colour flattens per-character colour.\nconst setTextRole = async (id, font, hex, px, accentHex) => {\n const runs = (await engine.design.getProps(id, ['text.ranges'])).text.ranges; // NOT text.color — that is run 0 only\n await engine.design.setProps(id, {\n text: {\n font: { typeface: tf(font.name, font.uri), uri: font.uri },\n ...(px ? { fontSize: px + 'px' } : {}), // the unit is required\n color: rgba(hex), // role colour = the base style\n // When RE-branding, re-map the accent runs to the new brand's accent — replaying\n // r.color verbatim would keep the OLD brand's colour. The old face's typeface/style\n // are NOT replayed: the new family may not ship them.\n ranges: runs.slice(1).map((r) => ({\n from: r.from,\n to: r.to,\n color: accentHex ? rgba(accentHex) : r.color,\n ...(r.weight ? { weight: r.weight } : {})\n }))\n }\n });\n};\n// graphic fill (background / accent shape)\nconst setFillRole = async (id, hex) => {\n await engine.design.setProps(id, {\n fill: { type: 'color', color: { value: rgba(hex) } }\n });\n};\n// e.g.: await setFillRole(bgId, SCHEME.background);\n// await setTextRole(headlineId, DISPLAY, SCHEME.text);\n// await setTextRole(leadId, BODY, SCHEME.text);\n// await setTextRole(accentWordId, DISPLAY, SCHEME.accent); // the ONE accent moment\n<!-- requires:asset_add -->\n// logo: asset_add the variant SVG for this background (a file named by URI: that URI as is), set as image fill (asset-loading.md).\n<!-- /requires:asset_add -->\n<!-- unless:asset_add -->\n// logo: the variant SVG for this background, by a fetchable uri, set as image fill (asset-loading.md).\n<!-- /unless:asset_add -->\n\nawait engine.design.loadResources([page]);\nreturn {\n type: 'text',\n text: 'restyled — now run the conformance pass and preview'\n};\n```\n\n## Graded conformance pass (Layer 2)\n\nAfter the restyle, walk the render against the kit and fix — hard `avoid`/`denied` first\n(non-negotiable), then structural rules where they fit the source:\n\n- **Hard `avoid` / `denied`** (always fix): a second/accent colour used as a stroke, underline,\n divider, label, or icon (accent is a fill pop only); the accent colour as a button fill when the\n kit bans it; a headline in a banned weight; a flat bordered card with no shadow; the logo redrawn,\n recoloured, or the wrong background variant; a free-chosen colour or a `denied` scheme; a\n background that matches a placed photo's dominant hue.\n- **Proportion** — roughly the kit's neutrals/text/accent ratio (e.g. 70/20/10). If it reads\n \"colourful\", there's too much accent and too little neutral.\n- **Safe-area margins** — content inside the kit's outer margin; logo in its clear zone; nothing\n crowds an edge, the media, or the logo. If it doesn't fit, shrink the headline — never the subline.\n- **Elements** — eyebrow → pill kicker; divider → hairline; CTA → text/URL on static media (only a\n real button on interactive/mockup media, in the kit's button style).\n- **Wordmark vs preserved copy** — if the source's _copy_ already carries a **foreign brand** in the\n signature slot (a handle/URL for a different brand, kept because copy is preserved), don't overwrite\n it and don't imply the foreign brand is yours. Place the brand wordmark in a **non-competing**\n safe-area corner as the publisher mark, treat the foreign handle as attribution, or omit the\n wordmark — never stack two brands as co-equal marks.\n- **Device** (optional) — if the kit has a signature device and the composition has room, place it\n per its placement grammar (one per piece, bleed off one edge, atmosphere behind content).\n- **Size thresholds** — drop the wordmark for the symbol / drop the kicker below the kit's minimums\n rather than shrinking them illegibly.\n\nA fix that would require re-laying-out the piece (not just re-skinning) is **out of scope** — record\nit and recommend a resize.\n\n## Before reporting done\n\nRun the **brand conformance checklist** below against each render — **with the source render beside\nit** — then close with a `judge` run (the `judge` skill; a restyle is a source-derived variant, so\nits source-parity diff is a mandatory gate step, and the kit's `avoid` list is an extra scorecard\nrow on top of the axes). Score honestly — a surviving hard `avoid` violation is a fail, say so.\n\n### Brand conformance checklist\n\nAny \"no\" on an applicable line drops the axis below 8 (or, for the `avoid` rows, fails the restyle\noutright).\n\n**Source parity — what a restyle must NOT change**\n\n- [ ] **Copy verbatim** — every string is the source's string; nothing re-worded, shortened, or\n dropped to fit the new face. (Re-wording is `localize`.)\n- [ ] **Geometry held** — every block sits at its source position and size; the only moves are ones a\n named brand rule demanded (safe-area margin, kicker pill, size threshold), and you can name\n which rule for each\n- [ ] **Element inventory complete** — every source cluster (text, image, chip, icon, decoration) has a\n counterpart; nothing dropped, nothing invented to satisfy a role row\n- [ ] **Role parity** — the block that was the background is still the background, the one accent\n moment is still that block, the divider is still a divider. Values changed; roles didn't\n- [ ] **Hierarchy preserved** — the same dominant element, the same reading order; relative weight and\n size order across blocks matches the source (§6.3)\n- [ ] **Group hierarchy intact** — the restyle didn't flatten or re-nest the source's groups\n- [ ] **No re-wrap fallout** — the font swap didn't change any block's line count into an overflow,\n a collision, or a pushed neighbour (diff line counts against the source, not just positions)\n\n**Brand conformance — what a restyle must change**\n\n- [ ] **Zero hard `avoid` / `denied` violations** — no accent as structure (stroke/underline/divider/\n label/icon), no banned button or headline weight, no flat bordered card, no free-chosen colour,\n no `denied` scheme combination\n- [ ] **Logo untampered** — exact bundled SVG, the variant matching the chosen background, scaled\n proportionally; never redrawn, recoloured, or stretched; `$meta.gaps`-flagged assets skipped,\n not invented\n- [ ] **One approved scheme**, applied whole; the accent role empty where the `avoid` list forbids it\n on this field (the scheme-accent trap)\n- [ ] **Every role mapped to its token** — display family on headlines, body family on body, kicker as\n a pill, divider as a hairline, card radius + elevation; rows with no matching block skipped, not\n forced\n- [ ] **Proportion** ≈ the kit's neutrals/text/accent ratio; the piece doesn't read \"colourful\"\n- [ ] **Safe-area margins + logo clear zone** respected; nothing crowds an edge, the media, or the mark\n- [ ] **No competing marks** — a foreign brand preserved in the copy is attribution, not a co-equal\n lockup with the kit's wordmark\n\n**Craft / baseline**\n\n- [ ] **Fonts actually swapped** — unique `typeface.name` per typeface; every weight you set is\n declared in `typeface.fonts` (a variable TTF serves them all, one entry per weight)\n- [ ] **Accent colours survived the recolour** — the whole-block role colour flattens per-run\n colour, so every accent run went back on as a `text.ranges` entry in the same write; no block\n left at the engine default\n- [ ] **Contrast ≥ 4.5:1** for every text block on its actual background, checked after recolour\n- [ ] **Zero tofu** — the brand font covers every glyph in the preserved copy, checked in `preview`\n- [ ] Native export dimensions (the page's own pixel size)\n\n## No-goes / red flags\n\n- **Free-chosen colour** — a colour not from an approved scheme / a ramp step. Pick a scheme; move\n along a ramp for variation; never invent a hue.\n- **Accent used as structure** — the brand's accent (e.g. a mint/green) as a stroke, tick, underline,\n divider, label, or icon. Accent is a rare fill pop, not a co-lead.\n- **Banned button / weight** — a coloured button the kit forbids, a drawn button on static media, or\n a headline in a weight the kit doesn't ship.\n- **Logo tampering** — recreating, redrawing, recolouring, or stretching the wordmark, or the wrong\n background variant (dot vanishes on a matching fill). Exact bundled SVG only; scale proportionally.\n- **Role colour flattened the accent** — a whole-block `text.color` write collapses every run to\n the role colour. Re-apply the accent runs as `text.ranges` in the same `setProps`.\n- **Font not actually swapped** — a new URI under a reused `typeface.name` silently no-ops. Unique\n names; and declare every weight you set (a variable TTF needs one `fonts[]` entry per weight).\n- **Tofu** — brand font lacks a glyph in the copy; only `preview` catches it.\n- **Contrast fail** — text < 4.5:1 after recolour (esp. on a colour field). Re-pick the role colour.\n- **Geometry drift** — moving/re-flowing blocks in a restyle. This is not resize; hold the source\n geometry (conformance moves only what a brand _rule_ demands).\n- **Copy drift** — re-wording, shortening, or dropping a line because the brand face runs longer.\n Copy is held; fix the type (size within its band, measure, leading), never the text. Rewriting is\n `localize`'s layer, not this one.\n- **Re-wrap fallout** — the swapped face has different advance widths, so an auto-height block can\n re-wrap to a new line count, grow, and collide with or push a neighbour **without any block being\n moved**. Geometry looks held and the layout still broke. Diff line counts against the source after\n the refont, not just positions.\n- **Role inversion** — every value came from the kit, but a role moved: a rule recoloured into a\n second lead, a caption promoted to the accent moment, the background and card swapped. Values\n change in a restyle; roles don't.\n- **Judged in isolation** — scoring the restyle's own PNG without the source beside it. A restyle is\n a source-derived variant; the source-parity diff is a mandatory gate step (`judge`), not a\n nice-to-have.\n\n## Cross-references\n\n- **`reference/brandkit-spec.md`** — the brand-kit schema contract (required-core vs optional;\n graceful degradation) — the _target shape_.\n- **`reference/authoring.md`** — the intake mode: ingesting an external brand (PDF / URL / Figma /\n asset dump) into that shape — _how to reach it_.\n<!-- requires:asset_add -->\n- **`reference/asset-loading.md`** — font-URI resolution (CDN + local-TTF → the returned `uri` bridge),\n<!-- /requires:asset_add -->\n<!-- unless:asset_add -->\n- **`reference/asset-loading.md`** — font-URI resolution,\n<!-- /unless:asset_add -->\n hex → RGBA, logo SVG placement, icon recolour, colour-fill mechanics.\n- design rules §6.1–§6.5 — the general typography / colour / hierarchy / composition / craft\n thresholds this skill applies through a brand's values; and the `api` skill's engine mechanics\n (the `text.font` declaration, fill specs, auto-reshape, `loadResources`, content-area\n line-height conversion §6.1.3, pixel font sizes).\n- **`judge`** — the acceptance gate; a restyle is judged as a **source-derived variant** (preview the\n source, diff the two renders), with the brand's `avoid` list added to the criteria as its own\n scorecard row.\n- **`localize`** — translate a design (snap geometry); **`resize`** — reformat a design\n (re-derive geometry). Brand is the third surgery (swap the style layer).\n",
|
|
12
|
+
"docs/api/signatures-extended.d.ts": "// Editor-UI machinery moved out of signatures.d.ts: selection,\n// highlighting, hover, zoom/camera, undo-redo history, scopes,\n// edit-mode/cursor state, asset-source plumbing. Same engine, same\n// classes — these members are for interactive editors, not design\n// generation. Search this file for the member you need.\n// ---- AssetAPI (editor-UI members) ----\n registerApplyMiddleware(middleware: (sourceId: string, assetResult: AssetResult, apply: AssetAPI['apply'], context: ApplyAssetOptions) => Promise<DesignBlockId | undefined>): VoidFunction;\n registerApplyToBlockMiddleware(middleware: (sourceId: string, assetResult: AssetResult, block: DesignBlockId, applyToBlock: AssetAPI['applyToBlock']) => Promise<void>): VoidFunction;\n getGroups(id: string): Promise<string[]>;\n getCredits(sourceId: string): {\n name: string;\n url: string | undefined;\n } | undefined;\n getLicense(sourceId: string): {\n name: string;\n url: string | undefined;\n } | undefined;\n assetSourceContentsChanged(sourceID: string): void;\n// ---- BlockAPI (editor-UI members) ----\n export(handle: DesignBlockId, options?: ExportOptions): Promise<Blob>;\n exportWithColorMask(handle: DesignBlockId, maskColorR: number, maskColorG: number, maskColorB: number, options?: ExportOptions): Promise<Blob[]>;\n exportVideo(handle: DesignBlockId, options?: VideoExportOptions): Promise<Blob>;\n exportAudio(handle: DesignBlockId, options?: AudioExportOptions): Promise<Blob>;\n loadFromString(content: string): Promise<DesignBlockId[]>;\n loadFromArchiveURL(url: string, options?: AbortOptions): Promise<DesignBlockId[]>;\n loadFromURL(url: string, options?: AbortOptions): Promise<DesignBlockId[]>;\n saveToString(blocks: DesignBlockId[], allowedResourceSchemes?: string[], onDisallowedResourceScheme?: (url: string, dataHash: string) => Promise<string>, options?: AbortOptions): Promise<string>;\n saveToArchive(blocks: DesignBlockId[], options?: AbortOptions): Promise<Blob>;\n create(type: DesignBlockType): DesignBlockId;\n createFill(type: FillType): DesignBlockId;\n getAudioTrackCountFromVideo(videoFillBlock: DesignBlockId): number;\n createAudioFromVideo(videoFillBlock: DesignBlockId, trackIndex: number, options?: AudioFromVideoOptions): DesignBlockId;\n createAudiosFromVideo(videoFillBlock: DesignBlockId, options?: AudioFromVideoOptions): DesignBlockId[];\n getAudioInfoFromVideo(videoFillBlock: DesignBlockId): AudioTrackInfo[];\n createCaptionsFromURI(uri: string, options?: AbortOptions): Promise<DesignBlockId[]>;\n getType(id: DesignBlockId): ObjectTypeLonghand;\n getKind(id: DesignBlockId): string;\n setKind(id: DesignBlockId, kind: string): void;\n select(id: DesignBlockId): void;\n setSelected(id: DesignBlockId, selected: boolean): void;\n isSelected(id: DesignBlockId): boolean;\n findAllSelected(): DesignBlockId[];\n isGroupable(ids: DesignBlockId[]): boolean;\n group(ids: DesignBlockId[]): DesignBlockId;\n ungroup(id: DesignBlockId): void;\n setName(id: DesignBlockId, name: string): void;\n getName(id: DesignBlockId): string;\n getUUID(id: DesignBlockId): string;\n findByName(name: string): DesignBlockId[];\n findByType(type: ObjectType): DesignBlockId[];\n findAllPlaceholders(): DesignBlockId[];\n createShape(type: ShapeType): DesignBlockId;\n /** @deprecated Use supportsShape instead. */\n hasShape(id: DesignBlockId): boolean;\n supportsShape(id: DesignBlockId): boolean;\n getShape(id: DesignBlockId): DesignBlockId;\n setShape(id: DesignBlockId, shape: DesignBlockId): void;\n getSubshapes(id: DesignBlockId): DesignBlockId[];\n insertSubshape(id: DesignBlockId, subshapeId: DesignBlockId, index: number): void;\n appendSubshape(id: DesignBlockId, subshapeId: DesignBlockId): void;\n isVisible(id: DesignBlockId): boolean;\n setVisible(id: DesignBlockId, visible: boolean): void;\n isClipped(id: DesignBlockId): boolean;\n setClipped(id: DesignBlockId, clipped: boolean): void;\n setKeyframes(id: DesignBlockId, property: string, keyframes: Keyframe_2[], mode?: TrackMode): void;\n getKeyframes(id: DesignBlockId, property: string): Keyframe_2[];\n getKeyframeMode(id: DesignBlockId, property: string): TrackMode;\n removeKeyframes(id: DesignBlockId, property: string): void;\n getAnimatedProperties(id: DesignBlockId): string[];\n isPropertyAnimatable(id: DesignBlockId, property: string): boolean;\n getMatte(id: DesignBlockId): BlockMatte | null;\n setMatte(id: DesignBlockId, source: DesignBlockId | null, mode?: MatteMode): void;\n isTransformLocked(id: DesignBlockId): boolean;\n setTransformLocked(id: DesignBlockId, locked: boolean): void;\n getPositionX(id: DesignBlockId): number;\n getPositionXMode(id: DesignBlockId): PositionXMode;\n getPositionY(id: DesignBlockId): number;\n getPositionYMode(id: DesignBlockId): PositionYMode;\n setPositionX(id: DesignBlockId, value: number): void;\n setPositionXMode(id: DesignBlockId, mode: PositionXMode): void;\n setPositionY(id: DesignBlockId, value: number): void;\n setPositionYMode(id: DesignBlockId, mode: PositionYMode): void;\n setAlwaysOnTop(id: DesignBlockId, enabled: boolean): void;\n setAlwaysOnBottom(id: DesignBlockId, enabled: boolean): void;\n isAlwaysOnTop(id: DesignBlockId): boolean;\n isAlwaysOnBottom(id: DesignBlockId): boolean;\n bringToFront(id: DesignBlockId): void;\n sendToBack(id: DesignBlockId): void;\n bringForward(id: DesignBlockId): void;\n sendBackward(id: DesignBlockId): void;\n getRotation(id: DesignBlockId): number;\n setRotation(id: DesignBlockId, radians: number): void;\n getFlipHorizontal(id: DesignBlockId): boolean;\n getFlipVertical(id: DesignBlockId): boolean;\n setFlipHorizontal(id: DesignBlockId, flip: boolean): void;\n setFlipVertical(id: DesignBlockId, flip: boolean): void;\n /** @deprecated Use supportsContentFillMode instead. */\n hasContentFillMode(id: DesignBlockId): boolean;\n supportsContentFillMode(id: DesignBlockId): boolean;\n getWidth(id: DesignBlockId): number;\n getWidthMode(id: DesignBlockId): WidthMode;\n getHeight(id: DesignBlockId): number;\n getHeightMode(id: DesignBlockId): HeightMode;\n setSize(id: DesignBlockId, width: number, height: number, options?: {\n maintainCrop?: boolean;\n sizeMode?: SizeMode;\n }): void;\n setPosition(id: DesignBlockId, x: number, y: number, options?: {\n positionMode?: PositionMode;\n }): void;\n setWidth(id: DesignBlockId, value: number, maintainCrop?: boolean): void;\n setWidthMode(id: DesignBlockId, mode: WidthMode): void;\n setHeight(id: DesignBlockId, value: number, maintainCrop?: boolean): void;\n setHeightMode(id: DesignBlockId, mode: HeightMode): void;\n getFrameX(id: DesignBlockId): number;\n getFrameY(id: DesignBlockId): number;\n getFrameWidth(id: DesignBlockId): number;\n getFrameHeight(id: DesignBlockId): number;\n setContentFillMode(id: DesignBlockId, mode: ContentFillMode): void;\n getContentFillMode(id: DesignBlockId): ContentFillMode;\n setContentFillHorizontalAlignment(id: DesignBlockId, alignment: HorizontalContentFillAlignment): void;\n getContentFillHorizontalAlignment(id: DesignBlockId): HorizontalContentFillAlignment;\n setContentFillVerticalAlignment(id: DesignBlockId, alignment: VerticalContentFillAlignment): void;\n getContentFillVerticalAlignment(id: DesignBlockId): VerticalContentFillAlignment;\n duplicate(id: DesignBlockId, attachToParent?: boolean): DesignBlockId;\n destroy(id: DesignBlockId): void;\n getParent(id: DesignBlockId): DesignBlockId | null;\n setTransformParent(id: DesignBlockId, parent: DesignBlockId | null): void;\n getTransformParent(id: DesignBlockId): DesignBlockId | null;\n hasTransformAnchor(id: DesignBlockId): boolean;\n getChildren(id: DesignBlockId): DesignBlockId[];\n insertChild(parent: DesignBlockId, child: DesignBlockId, index: number): void;\n appendChild(parent: DesignBlockId, child: DesignBlockId): void;\n referencesAnyVariables(id: DesignBlockId): boolean;\n setVariableBinding(id: DesignBlockId, property: string, key: string): void;\n getVariableBinding(id: DesignBlockId, property: string): string | null;\n removeVariableBinding(id: DesignBlockId, property: string): void;\n findAllVariableBindings(id: DesignBlockId): string[];\n getGlobalBoundingBoxX(id: DesignBlockId): number;\n getGlobalBoundingBoxY(id: DesignBlockId): number;\n getGlobalBoundingBoxWidth(id: DesignBlockId): number;\n getGlobalBoundingBoxHeight(id: DesignBlockId): number;\n alignHorizontally(ids: DesignBlockId[], horizontalBlockAlignment: TextHorizontalAlignment): void;\n alignVertically(ids: DesignBlockId[], verticalBlockAlignment: TextVerticalAlignment): void;\n isAlignable(ids: DesignBlockId[]): boolean;\n distributeHorizontally(ids: DesignBlockId[]): void;\n distributeVertically(ids: DesignBlockId[]): void;\n isDistributable(ids: DesignBlockId[]): boolean;\n fillParent(id: DesignBlockId): void;\n resizeContentAware(ids: DesignBlockId[], width: number, height: number): void;\n scale(id: DesignBlockId, scale: number, anchorX?: number, anchorY?: number): void;\n findAllProperties(id: DesignBlockId): string[];\n setBool(id: DesignBlockId, property: BoolPropertyName, value: boolean): void;\n getBool(id: DesignBlockId, property: BoolPropertyName): boolean;\n setInt(id: DesignBlockId, property: IntPropertyName, value: number): void;\n getInt(id: DesignBlockId, property: IntPropertyName): number;\n setFloat(id: DesignBlockId, property: FloatPropertyName, value: number): void;\n getFloat(id: DesignBlockId, property: FloatPropertyName): number;\n setDouble(id: DesignBlockId, property: DoublePropertyName, value: number): void;\n getDouble(id: DesignBlockId, property: DoublePropertyName): number;\n setVec2(id: DesignBlockId, property: Vec2PropertyName, value: Vec2): void;\n getVec2(id: DesignBlockId, property: Vec2PropertyName): Vec2;\n setString(id: DesignBlockId, property: StringPropertyName, value: string): void;\n getString(id: DesignBlockId, property: StringPropertyName): string;\n setColor(id: DesignBlockId, property: ColorPropertyName, value: Color): void;\n getColor(id: DesignBlockId, property: ColorPropertyName): Color;\n /** @deprecated Use setColor() instead. */\n setColorRGBA(id: DesignBlockId, property: string, r: number, g: number, b: number, a?: number): void;\n /** @deprecated Use getColor() instead. */\n getColorRGBA(id: DesignBlockId, property: string): RGBA;\n /** @deprecated Use setColor() instead. */\n setColorSpot(id: DesignBlockId, property: string, name: string, tint?: number): void;\n setGradientColorStops(id: DesignBlockId, property: string, colors: GradientColorStop[]): void;\n getGradientColorStops(id: DesignBlockId, property: string): GradientColorStop[];\n getSourceSet(id: DesignBlockId, property: SourceSetPropertyName): Source[];\n setSourceSet(id: DesignBlockId, property: SourceSetPropertyName, sourceSet: Source[]): void;\n addImageFileURIToSourceSet(id: DesignBlockId, property: SourceSetPropertyName, uri: string, options?: AbortOptions): Promise<void>;\n setEnum<T extends keyof BlockEnumType>(id: DesignBlockId, property: T, value: BlockEnumType[T]): void;\n setEnum(id: DesignBlockId, property: string, value: string): void;\n getEnum<T extends keyof BlockEnumType>(id: DesignBlockId, property: T): BlockEnumType[T];\n getEnum(id: DesignBlockId, property: string): string;\n /** @deprecated Use supportsCrop() instead. */\n hasCrop(id: DesignBlockId): boolean;\n supportsCrop(id: DesignBlockId): boolean;\n setCropScaleX(id: DesignBlockId, scaleX: number): void;\n setCropScaleY(id: DesignBlockId, scaleY: number): void;\n setCropRotation(id: DesignBlockId, rotation: number): void;\n setCropScaleRatio(id: DesignBlockId, scaleRatio: number): void;\n setCropTranslationX(id: DesignBlockId, translationX: number): void;\n setCropTranslationY(id: DesignBlockId, translationY: number): void;\n resetCrop(id: DesignBlockId): void;\n getCropScaleX(id: DesignBlockId): number;\n getCropScaleY(id: DesignBlockId): number;\n getCropRotation(id: DesignBlockId): number;\n getCropScaleRatio(id: DesignBlockId): number;\n getCropTranslationX(id: DesignBlockId): number;\n getCropTranslationY(id: DesignBlockId): number;\n adjustCropToFillFrame(id: DesignBlockId, minScaleRatio: number): number;\n flipCropHorizontal(id: DesignBlockId): void;\n flipCropVertical(id: DesignBlockId): void;\n setCropAspectRatioLocked(id: DesignBlockId, locked: boolean): void;\n /** @deprecated Use supportsOpacity() instead. */\n hasOpacity(id: DesignBlockId): boolean;\n supportsOpacity(id: DesignBlockId): boolean;\n setOpacity(id: DesignBlockId, opacity: number): void;\n getOpacity(id: DesignBlockId): number;\n /** @deprecated Use supportsBlendMode() instead. */\n hasBlendMode(id: DesignBlockId): boolean;\n supportsBlendMode(id: DesignBlockId): boolean;\n setBlendMode(id: DesignBlockId, blendMode: BlendMode): void;\n getBlendMode(id: DesignBlockId): BlendMode;\n /** @deprecated Query the fill's type using getFill() and getType() instead. */\n hasFillColor(id: DesignBlockId): boolean;\n isIncludedInExport(id: DesignBlockId): boolean;\n setIncludedInExport(id: DesignBlockId, enabled: boolean): void;\n /** @deprecated Use setFillSolidColor() instead. */\n setFillColorRGBA(id: DesignBlockId, r: number, g: number, b: number, a?: number): void;\n /** @deprecated Use getFillSolidColor() instead. */\n getFillColorRGBA(id: DesignBlockId): RGBA;\n /** @deprecated Use setFillEnabled() instead. */\n setFillColorEnabled(id: DesignBlockId, enabled: boolean): void;\n /** @deprecated Use isFillEnabled() instead. */\n isFillColorEnabled(id: DesignBlockId): boolean;\n createEffect(type: EffectType): DesignBlockId;\n /** @deprecated Use supportsEffects instead. */\n hasEffects(id: DesignBlockId): boolean;\n supportsEffects(id: DesignBlockId): boolean;\n getEffects(id: DesignBlockId): DesignBlockId[];\n insertEffect(id: DesignBlockId, effectId: DesignBlockId, index: number): void;\n appendEffect(id: DesignBlockId, effectId: DesignBlockId): void;\n removeEffect(id: DesignBlockId, index: number): void;\n createTextAnimator(): DesignBlockId;\n supportsTextAnimators(id: DesignBlockId): boolean;\n getTextAnimators(id: DesignBlockId): DesignBlockId[];\n insertTextAnimator(id: DesignBlockId, animatorId: DesignBlockId, index: number): void;\n appendTextAnimator(id: DesignBlockId, animatorId: DesignBlockId): void;\n removeTextAnimator(id: DesignBlockId, index: number): void;\n createModifier(type: ModifierType): DesignBlockId;\n supportsModifiers(id: DesignBlockId): boolean;\n getModifiers(id: DesignBlockId): DesignBlockId[];\n insertModifier(id: DesignBlockId, modifierId: DesignBlockId, index: number): void;\n appendModifier(id: DesignBlockId, modifierId: DesignBlockId): void;\n /** @deprecated Calls to this function can be removed. All effects can be enabled and disabled. */\n hasEffectEnabled(effectId: DesignBlockId): boolean;\n setEffectEnabled(effectId: DesignBlockId, enabled: boolean): void;\n createMask(): DesignBlockId;\n supportsMasks(id: DesignBlockId): boolean;\n getMasks(id: DesignBlockId): DesignBlockId[];\n insertMask(id: DesignBlockId, maskId: DesignBlockId, index: number): void;\n appendMask(id: DesignBlockId, maskId: DesignBlockId): void;\n removeMask(id: DesignBlockId, index: number): void;\n setEffectSource(effectId: DesignBlockId, source: DesignBlockId | null): void;\n getEffectSource(effectId: DesignBlockId): DesignBlockId | null;\n createBlur(type: BlurType): DesignBlockId;\n /** @deprecated Use supportsBlur instead. */\n hasBlur(id: DesignBlockId): boolean;\n supportsBlur(id: DesignBlockId): boolean;\n setBlur(id: DesignBlockId, blurId: DesignBlockId): void;\n getBlur(id: DesignBlockId): DesignBlockId;\n setBlurEnabled(id: DesignBlockId, enabled: boolean): void;\n isBlurEnabled(id: DesignBlockId): boolean;\n /** @deprecated Use supportsBackgroundColor() instead. */\n hasBackgroundColor(id: DesignBlockId): boolean;\n supportsBackgroundColor(id: DesignBlockId): boolean;\n /** @deprecated Use `Use setColor() with the key path 'backgroundColor/color' instead.`. */\n setBackgroundColorRGBA(id: DesignBlockId, r: number, g: number, b: number, a?: number): void;\n /** @deprecated Use `Use getColor() with the key path 'backgroundColor/color' instead.`. */\n getBackgroundColorRGBA(id: DesignBlockId): RGBA;\n setBackgroundColorEnabled(id: DesignBlockId, enabled: boolean): void;\n isBackgroundColorEnabled(id: DesignBlockId): boolean;\n /** @deprecated Use supportsStroke() instead. */\n hasStroke(id: DesignBlockId): boolean;\n supportsStroke(id: DesignBlockId): boolean;\n setStrokeEnabled(id: DesignBlockId, enabled: boolean): void;\n isStrokeEnabled(id: DesignBlockId): boolean;\n setStrokeOverprint(id: DesignBlockId, overprint: boolean): void;\n getStrokeOverprint(id: DesignBlockId): boolean;\n /** @deprecated Use setStrokeColor() instead. */\n setStrokeColorRGBA(id: DesignBlockId, r: number, g: number, b: number, a?: number): void;\n setStrokeColor(id: DesignBlockId, color: Color): void;\n /** @deprecated Use getStrokeColor() instead. */\n getStrokeColorRGBA(id: DesignBlockId): RGBA;\n getStrokeColor(id: DesignBlockId): Color;\n setStrokeWidth(id: DesignBlockId, width: number): void;\n getStrokeWidth(id: DesignBlockId): number;\n setStrokeStyle(id: DesignBlockId, style: StrokeStyle): void;\n getStrokeStyle(id: DesignBlockId): StrokeStyle;\n setStrokePosition(id: DesignBlockId, position: StrokePosition): void;\n getStrokePosition(id: DesignBlockId): StrokePosition;\n setStrokeCornerGeometry(id: DesignBlockId, cornerGeometry: StrokeCornerGeometry): void;\n getStrokeCornerGeometry(id: DesignBlockId): StrokeCornerGeometry;\n /** @deprecated Use `setStrokeStartCap` and `setStrokeEndCap` to set each end independently. */\n setStrokeCap(id: DesignBlockId, cap: StrokeCap): void;\n /** @deprecated Use `getStrokeStartCap` and `getStrokeEndCap` instead. */\n getStrokeCap(id: DesignBlockId): StrokeCap;\n setStrokeStartCap(id: DesignBlockId, cap: StrokeCap): void;\n getStrokeStartCap(id: DesignBlockId): StrokeCap;\n setStrokeEndCap(id: DesignBlockId, cap: StrokeCap): void;\n getStrokeEndCap(id: DesignBlockId): StrokeCap;\n setStrokeDashStartCap(id: DesignBlockId, cap: StrokeCap): void;\n getStrokeDashStartCap(id: DesignBlockId): StrokeCap;\n setStrokeDashEndCap(id: DesignBlockId, cap: StrokeCap): void;\n getStrokeDashEndCap(id: DesignBlockId): StrokeCap;\n setStrokeDashArray(id: DesignBlockId, dashArray: number[]): void;\n getStrokeDashArray(id: DesignBlockId): number[];\n setStrokeDashOffset(id: DesignBlockId, dashOffset: number): void;\n getStrokeDashOffset(id: DesignBlockId): number;\n /** @deprecated Use supportsDropShadow() instead. */\n hasDropShadow(id: DesignBlockId): boolean;\n supportsDropShadow(id: DesignBlockId): boolean;\n setDropShadowEnabled(id: DesignBlockId, enabled: boolean): void;\n isDropShadowEnabled(id: DesignBlockId): boolean;\n /** @deprecated Use setDropShadowColor() instead. */\n setDropShadowColorRGBA(id: DesignBlockId, r: number, g: number, b: number, a?: number): void;\n setDropShadowColor(id: DesignBlockId, color: Color): void;\n /** @deprecated Use getDropShadowColor instead. */\n getDropShadowColorRGBA(id: DesignBlockId): RGBA;\n getDropShadowColor(id: DesignBlockId): Color;\n setDropShadowOffsetX(id: DesignBlockId, offsetX: number): void;\n getDropShadowOffsetX(id: DesignBlockId): number;\n setDropShadowOffsetY(id: DesignBlockId, offsetY: number): void;\n getDropShadowOffsetY(id: DesignBlockId): number;\n setDropShadowBlurRadiusX(id: DesignBlockId, blurRadiusX: number): void;\n getDropShadowBlurRadiusX(id: DesignBlockId): number;\n setDropShadowBlurRadiusY(id: DesignBlockId, blurRadiusY: number): void;\n getDropShadowBlurRadiusY(id: DesignBlockId): number;\n setDropShadowClip(id: DesignBlockId, clip: boolean): void;\n getDropShadowClip(id: DesignBlockId): boolean;\n replaceText(id: DesignBlockId, text: string, from?: number, to?: number): void;\n setTextColor(id: DesignBlockId, color: Color, from?: number, to?: number): void;\n getTextColors(id: DesignBlockId, from?: number, to?: number): Array<Color>;\n setTextFontWeight(id: DesignBlockId, fontWeight: FontWeight, from?: number, to?: number): void;\n getTextFontWeights(id: DesignBlockId, from?: number, to?: number): FontWeight[];\n setTextFontSize(id: DesignBlockId, fontSize: number, options?: TextFontSizeOptions): void;\n getTextFontSizes(id: DesignBlockId, options?: TextFontSizeOptions): number[];\n setTextFontStyle(id: DesignBlockId, fontStyle: FontStyle, from?: number, to?: number): void;\n getTextFontStyles(id: DesignBlockId, from?: number, to?: number): FontStyle[];\n getTextCases(id: DesignBlockId, from?: number, to?: number): TextCase[];\n setTextCase(id: DesignBlockId, textCase: TextCase, from?: number, to?: number): void;\n setTextDecoration(id: DesignBlockId, config: TextDecorationConfig, from?: number, to?: number): void;\n setTextKerning(id: DesignBlockId, kerning: number, from?: number, to?: number): void;\n getTextKernings(id: DesignBlockId, from?: number, to?: number): number[];\n setTextBaselineShift(id: DesignBlockId, baselineShift: number, from?: number, to?: number): void;\n getTextBaselineShifts(id: DesignBlockId, from?: number, to?: number): number[];\n toggleTextDecorationUnderline(id: DesignBlockId, from?: number, to?: number): void;\n toggleTextDecorationStrikethrough(id: DesignBlockId, from?: number, to?: number): void;\n toggleTextDecorationOverline(id: DesignBlockId, from?: number, to?: number): void;\n getTextHorizontalAlignment(id: DesignBlockId, paragraphIndex?: number): TextHorizontalAlignment | undefined;\n setTextHorizontalAlignment(id: DesignBlockId, alignment: TextHorizontalAlignment | undefined, paragraphIndex?: number): void;\n getTextListStyle(id: DesignBlockId, paragraphIndex: number): ListStyle;\n setTextListStyle(id: DesignBlockId, listStyle: ListStyle, paragraphIndex?: number, listLevel?: number): void;\n getTextListLevel(id: DesignBlockId, paragraphIndex: number): number;\n setTextListLevel(id: DesignBlockId, listLevel: number, paragraphIndex?: number): void;\n getTextParagraphIndices(id: DesignBlockId, from?: number, to?: number): number[];\n setTextLineHeight(id: DesignBlockId, lineHeight: number | null, paragraphIndex?: number): void;\n getTextLineHeight(id: DesignBlockId, paragraphIndex: number): number;\n toggleBoldFont(id: DesignBlockId, from?: number, to?: number): void;\n toggleItalicFont(id: DesignBlockId, from?: number, to?: number): void;\n setFont(id: DesignBlockId, fontFileUri: string, typeface: Typeface): void;\n setTypeface(id: DesignBlockId, typeface: Typeface, from?: number, to?: number): void;\n getTypeface(id: DesignBlockId): Typeface;\n getTypefaces(id: DesignBlockId, from?: number, to?: number): Typeface[];\n getTextRuns(id: DesignBlockId, from?: number, to?: number): TextRunInfo[];\n getTextVisibleLineCount(id: DesignBlockId): number;\n getTextVisibleLineContent(id: DesignBlockId, lineIndex: number): string;\n getTextCharacterInkBoxes(id: DesignBlockId, from?: number, to?: number): CharacterInkBox[];\n setTextOnPath(id: DesignBlockId, svgPath: string | null): void;\n getTextOnPath(id: DesignBlockId): string | null;\n setTextOnPathOffset(id: DesignBlockId, offset: number): void;\n getTextOnPathOffset(id: DesignBlockId): number;\n setTextOnPathFlipped(id: DesignBlockId, flipped: boolean): void;\n getTextOnPathFlipped(id: DesignBlockId): boolean;\n /** @deprecated Use supportsFill instead. */\n hasFill(id: DesignBlockId): boolean;\n supportsFill(id: DesignBlockId): boolean;\n isFillEnabled(id: DesignBlockId): boolean;\n setFillEnabled(id: DesignBlockId, enabled: boolean): void;\n getFillOverprint(id: DesignBlockId): boolean;\n setFillOverprint(id: DesignBlockId, overprint: boolean): void;\n getFill(id: DesignBlockId): DesignBlockId;\n setFill(id: DesignBlockId, fill: DesignBlockId): void;\n getStrokeFill(id: DesignBlockId): DesignBlockId | null;\n setStrokeFill(id: DesignBlockId, fill: DesignBlockId | null): void;\n setFillSolidColor(id: DesignBlockId, r: number, g: number, b: number, a?: number): void;\n getFillSolidColor(id: DesignBlockId): RGBA;\n setPlaceholderEnabled(id: DesignBlockId, enabled: boolean): void;\n isPlaceholderEnabled(id: DesignBlockId): boolean;\n /** @deprecated Use supportsPlaceholderBehavior instead. */\n hasPlaceholderBehavior(id: DesignBlockId): boolean;\n supportsPlaceholderBehavior(id: DesignBlockId): boolean;\n setPlaceholderBehaviorEnabled(id: DesignBlockId, enabled: boolean): void;\n isPlaceholderBehaviorEnabled(id: DesignBlockId): boolean;\n /** @deprecated Use supportsPlaceholderControls instead. */\n hasPlaceholderControls(id: DesignBlockId): boolean;\n supportsPlaceholderControls(id: DesignBlockId): boolean;\n setPlaceholderControlsOverlayEnabled(id: DesignBlockId, enabled: boolean): void;\n setPlaceholderControlsButtonEnabled(id: DesignBlockId, enabled: boolean): void;\n setMetadata(id: DesignBlockId, key: string, value: string): void;\n getMetadata(id: DesignBlockId, key: string): string;\n hasMetadata(id: DesignBlockId, key: string): boolean;\n findAllMetadata(id: DesignBlockId): string[];\n removeMetadata(id: DesignBlockId, key: string): void;\n setScopeEnabled(id: DesignBlockId, key: Scope, enabled: boolean): void;\n isScopeEnabled(id: DesignBlockId, key: Scope): boolean;\n isAllowedByScope(id: DesignBlockId, key: Scope): boolean;\n /** @deprecated Use supportsDuration instead. */\n hasDuration(id: DesignBlockId): boolean;\n supportsDuration(id: DesignBlockId): boolean;\n setDuration(id: DesignBlockId, duration: number): void;\n getDuration(id: DesignBlockId): number;\n supportsPageDurationSource(page: DesignBlockId, id: DesignBlockId): boolean;\n /** @deprecated Use supportsTimeOffset instead. */\n hasTimeOffset(id: DesignBlockId): boolean;\n supportsTimeOffset(id: DesignBlockId): boolean;\n setTimeOffset(id: DesignBlockId, offset: number): void;\n getTimeOffset(id: DesignBlockId): number;\n /** @deprecated Use supportsTrim instead. */\n hasTrim(id: DesignBlockId): boolean;\n supportsTrim(id: DesignBlockId): boolean;\n setTrimOffset(id: DesignBlockId, offset: number): void;\n getTrimOffset(id: DesignBlockId): number;\n setTrimLength(id: DesignBlockId, length: number): void;\n getTrimLength(id: DesignBlockId): number;\n setPlaying(id: DesignBlockId, enabled: boolean): void;\n isPlaying(id: DesignBlockId): boolean;\n /** @deprecated Use supportsPlaybackTime instead. */\n hasPlaybackTime(id: DesignBlockId): boolean;\n supportsPlaybackTime(id: DesignBlockId): boolean;\n setPlaybackTime(id: DesignBlockId, time: number): void;\n getPlaybackTime(id: DesignBlockId): number;\n setSoloPlaybackEnabled(id: DesignBlockId, enabled: boolean): void;\n isSoloPlaybackEnabled(id: DesignBlockId): boolean;\n /** @deprecated Use supportsPlaybackControl instead */\n hasPlaybackControl(id: DesignBlockId): boolean;\n supportsPlaybackControl(id: DesignBlockId): boolean;\n setLooping(id: DesignBlockId, looping: boolean): void;\n isLooping(id: DesignBlockId): boolean;\n setMuted(id: DesignBlockId, muted: boolean): void;\n isMuted(id: DesignBlockId): boolean;\n setVolume(id: DesignBlockId, volume: number): void;\n getVolume(id: DesignBlockId): number;\n setPlaybackSpeed(id: DesignBlockId, speed: number): void;\n getPlaybackSpeed(id: DesignBlockId): number;\n forceLoadAVResource(id: DesignBlockId, options?: AbortOptions): Promise<void>;\n getAVResourceTotalDuration(id: DesignBlockId): number;\n generateAudioThumbnailSequence(id: DesignBlockId, samplesPerChunk: number, timeBegin: number, timeEnd: number, numberOfSamples: number, numberOfChannels: number, onChunk: (chunkIndex: number, result: Float32Array | Error) => void): () => void;\n createAnimation(type: AnimationType): DesignBlockId;\n supportsAnimation(id: DesignBlockId): boolean;\n setInAnimation(id: DesignBlockId, animation: DesignBlockId): void;\n setLoopAnimation(id: DesignBlockId, animation: DesignBlockId): void;\n setOutAnimation(id: DesignBlockId, animation: DesignBlockId): void;\n getInAnimation(id: DesignBlockId): DesignBlockId;\n getLoopAnimation(id: DesignBlockId): DesignBlockId;\n getOutAnimation(id: DesignBlockId): DesignBlockId;\n createTransition(type: TransitionType): DesignBlockId;\n supportsTransition(id: DesignBlockId): boolean;\n setTransition(id: DesignBlockId, transition: DesignBlockId): void;\n removeTransition(id: DesignBlockId): void;\n getTransition(id: DesignBlockId): DesignBlockId;\n forceLoadResources(ids: DesignBlockId[], options?: AbortOptions): Promise<void>;\n// ---- EditorAPI (editor-UI members) ----\n setEditMode(mode: EditMode, baseMode?: string): void;\n getEditMode(): EditMode;\n hasSelectedVectorNode(): boolean;\n hasSelectedVectorControlPoint(): boolean;\n getCursorType(): 'Arrow' | 'Move' | 'MoveNotPermitted' | 'Resize' | 'Rotate' | 'Text' | 'Cell';\n getCursorRotation(): number;\n createHistory(): HistoryId;\n destroyHistory(history: HistoryId): void;\n setActiveHistory(history: HistoryId): void;\n getActiveHistory(): HistoryId;\n addUndoStep(): void;\n undo(): void;\n redo(): void;\n canUndo(): boolean;\n canRedo(): boolean;\n findAllScopes(): Scope[];\n setGlobalScope(key: Scope, value: 'Allow' | 'Deny' | 'Defer'): void;\n getGlobalScope(key: Scope): 'Allow' | 'Deny' | 'Defer';\n isHighlightingEnabled(id: DesignBlockId): boolean;\n setHighlightingEnabled(id: DesignBlockId, enabled: boolean): void;\n isSelectionEnabled(id: DesignBlockId): boolean;\n setSelectionEnabled(id: DesignBlockId, enabled: boolean): void;\n getMovementConstraint(id: DesignBlockId): ResolvedMovementConstraint;\n// ---- SceneAPI (editor-UI members) ----\n loadFromString(sceneContent: string, options?: LoadSceneOptions): Promise<DesignBlockId>;\n loadFromString(sceneContent: string, overrideEditorConfig?: boolean, waitForResources?: boolean): Promise<DesignBlockId>;\n loadFromURL(url: string, options?: LoadSceneOptions): Promise<DesignBlockId>;\n loadFromURL(url: string, overrideEditorConfig?: boolean, waitForResources?: boolean): Promise<DesignBlockId>;\n loadFromArchiveURL(url: string, options?: LoadSceneOptions): Promise<DesignBlockId>;\n loadFromArchiveURL(url: string, overrideEditorConfig?: boolean, waitForResources?: boolean): Promise<DesignBlockId>;\n saveToString(options?: {\n allowedResourceSchemes?: string[];\n onDisallowedResourceScheme?: (url: string, dataHash: string) => Promise<string>;\n compression?: {\n format?: CompressionFormat_2;\n level?: CompressionLevel;\n };\n abortSignal?: AbortSignal;\n }): Promise<string>;\n saveToArchive(options?: SaveToArchiveOptions): Promise<Blob>;\n create(sceneLayout?: SceneLayout, options?: CreateSceneOptions): DesignBlockId;\n setZoomLevel(zoomLevel?: number): void;\n getZoomLevel(): number;\n zoomToBlock(id: DesignBlockId, options?: ZoomOptions): Promise<void>;\n enableZoomAutoFit(id: DesignBlockId, axis: 'Horizontal' | 'Vertical', paddingBefore?: number, paddingAfter?: number): void;\n enableZoomAutoFit(id: DesignBlockId, axis: 'Both', paddingLeft?: number, paddingTop?: number, paddingRight?: number, paddingBottom?: number): void;\n disableZoomAutoFit(blockOrScene: DesignBlockId): void;\n isZoomAutoFitEnabled(blockOrScene: DesignBlockId): boolean;\n unstable_enableCameraZoomClamping(ids: DesignBlockId[], minZoomLimit?: number, maxZoomLimit?: number, paddingLeft?: number, paddingTop?: number, paddingRight?: number, paddingBottom?: number): void;\n unstable_disableCameraZoomClamping(blockOrScene?: number | null): void;\n unstable_isCameraZoomClampingEnabled(blockOrScene?: number | null): boolean;\n setPlaying(play: boolean): void;\n// ---- VariableAPI (editor-UI members) ----\n setString(key: string, value: string, options?: VariableOptions | null): void;\n getString(key: string, options?: VariableOptions | null): string;\n setColor(key: string, value: Color, options?: VariableOptions | null): void;\n getColor(key: string, options?: VariableOptions | null): Color;\n setTypeface(key: string, typeface: Typeface, options?: VariableOptions | null): void;\n getTypeface(key: string, options?: VariableOptions | null): Typeface;\n getType(key: string, options?: VariableOptions | null): VariableType;\n\n// ---- types referenced only by extended members ----\ninterface AssetResultCredits {\n name: string;\n url: string;\n}\ninterface AssetResultLicense {\n name: string;\n url: string;\n}\ntype AudioExportOptions = {\n mimeType?: AudioMimeType;\n onProgress?: (numberOfRenderedFrames: number, numberOfEncodedFrames: number, totalNumberOfFrames: number) => void;\n timeOffset?: number;\n duration?: number;\n sampleRate?: number;\n numberOfChannels?: number;\n skipEncoding?: boolean;\n audioCodec?: AudioCodec;\n abortSignal?: AbortSignal;\n};\ntype AudioFromVideoOptions = {\n keepTrimSettings?: boolean;\n muteOriginalVideo?: boolean;\n};\ninterface AudioTrackInfo {\n audioCodec: string;\n channels: number;\n sampleRate: number;\n audioDuration: number;\n numAudioPackets: number;\n numAudioFrames: number;\n trackName: string;\n trackIndex: number;\n language: string;\n}\ntype BlockEnumType = {\n 'blend/mode': BlendMode;\n 'contentFill/horizontalAlignment': HorizontalContentFillAlignment;\n 'contentFill/mode': ContentFillMode;\n 'contentFill/verticalAlignment': VerticalContentFillAlignment;\n 'height/mode': HeightMode;\n 'position/x/mode': PositionXMode;\n 'position/y/mode': PositionYMode;\n 'scene/angleUnit': SceneAngleUnit;\n 'scene/colorConversionMode': SceneColorConversionMode;\n 'scene/designUnit': DesignUnit;\n 'scene/fontSizeUnit': FontSizeUnit;\n 'scene/layout': SceneLayout;\n 'scene/mode': SceneMode;\n 'width/mode': WidthMode;\n 'page/guides/source': PageGuidesSource;\n 'stroke/cap': StrokeCap;\n 'stroke/cornerGeometry': StrokeCornerGeometry;\n 'stroke/dashEndCap': StrokeDashEndCap;\n 'stroke/dashStartCap': StrokeDashStartCap;\n 'stroke/endCap': StrokeEndCap;\n 'stroke/position': StrokePosition;\n 'stroke/startCap': StrokeStartCap;\n 'stroke/style': StrokeStyle;\n 'playback/fadeIn/easing': PlaybackFadeInEasing;\n 'playback/fadeOut/easing': PlaybackFadeOutEasing;\n 'text/horizontalAlignment': TextHorizontalAlignment;\n 'text/verticalAlignment': TextVerticalAlignment;\n 'cutout/type': CutoutType;\n 'caption/horizontalAlignment': CaptionHorizontalAlignment;\n 'caption/verticalAlignment': CaptionVerticalAlignment;\n animationEasing: AnimationEasing;\n textAnimationWritingStyle: TextAnimationWritingStyle;\n 'animation/grow/direction': AnimationGrowDirection;\n 'animation/wipe/direction': AnimationWipeDirection;\n 'animation/baseline/direction': AnimationBaselineDirection;\n 'animation/spin/direction': AnimationSpinDirection;\n 'animation/spin_loop/direction': AnimationSpinLoopDirection;\n 'animation/jump_loop/direction': AnimationJumpLoopDirection;\n 'animation/typewriter_text/writingStyle': AnimationTypewriterTextWritingStyle;\n 'animation/block_swipe_text/direction': AnimationBlockSwipeTextDirection;\n 'animation/merge_text/direction': AnimationMergeTextDirection;\n 'animation/ken_burns/direction': AnimationKenBurnsDirection;\n 'blur/uniform/mode': BlurUniformMode;\n 'modifier/trim/mode': ModifierTrimMode;\n 'modifier/repeater/composite': ModifierRepeaterComposite;\n 'modifier/offset/join': ModifierOffsetJoin;\n 'modifier/zigzag/pointType': ModifierZigzagPointType;\n 'effect/displacement_map/horizontalChannel': EffectDisplacementMapHorizontalChannel;\n 'effect/displacement_map/mapBehavior': EffectDisplacementMapMapBehavior;\n 'effect/displacement_map/verticalChannel': EffectDisplacementMapVerticalChannel;\n 'effect/invert/channel': EffectInvertChannel;\n 'effect/radial_wipe/direction': EffectRadialWipeDirection;\n 'effect/shift_channels/takeAlphaFrom': EffectShiftChannelsTakeAlphaFrom;\n 'effect/shift_channels/takeBlueFrom': EffectShiftChannelsTakeBlueFrom;\n 'effect/shift_channels/takeGreenFrom': EffectShiftChannelsTakeGreenFrom;\n 'effect/shift_channels/takeRedFrom': EffectShiftChannelsTakeRedFrom;\n 'effect/stroke/paintStyle': EffectStrokePaintStyle;\n 'effect/wave_warp/waveType': EffectWaveWarpWaveType;\n 'fill/pixelStream/orientation': FillPixelStreamOrientation;\n 'shape/vector_path/fillRule': ShapeVectorPathFillRule;\n 'shape/compound/fillRule': ShapeCompoundFillRule;\n 'shape/compound/mode': ShapeCompoundMode;\n 'mask/mode': MaskMode;\n 'text_animator/selectorBasedOn': TextAnimatorSelectorBasedOn;\n 'text_animator/selectorShape': TextAnimatorSelectorShape;\n 'text_animator/selectorUnits': TextAnimatorSelectorUnits;\n};\ninterface BlockMatte {\n source: DesignBlockId;\n mode: MatteMode;\n}\ninterface BlockStateEngineError {\n code: string;\n message: string;\n category: string;\n hint: string;\n args: Record<string, boolean | number | string>;\n docsUrl: string | null;\n silent: boolean;\n}\ntype BlurType = 'uniform' | 'linear' | 'mirrored' | 'radial'; // each also valid as '//ly.img.ubq/blur/<name>'\ntype BlurTypeLonghand = `//ly.img.ubq/blur/${BlurTypeShorthand}`;\ninterface Buffer_2 {\n handle: string;\n buffer: Uint8Array;\n}\ninterface CharacterInkBox {\n x: number;\n y: number;\n width: number;\n height: number;\n baselineY: number;\n}\ntype EditMode = 'Transform' | 'Crop' | 'Text' | 'Playback' | 'Trim' | 'Vector' | (string & {});\ntype EffectType = 'adjustments' | 'bulge' | 'corner_pin' | 'cross_cut' | 'displacement_map' | 'dot_pattern' | 'duotone_filter' | 'extrude_blur' | 'fill' | 'glow' | 'green_screen' | 'half_tone' | 'invert' | 'levels' | 'linear_wipe' | 'linocut' | 'liquid' | 'lut_filter' | 'mirror' | 'outliner' | 'pixelize' | 'posterize' | 'radial_pixel' | 'radial_wipe' | 'recolor' | 'sharpie' | 'shift_channels' | 'shifter' | 'stroke' | 'threshold' | 'tilt_shift' | 'tint' | 'tritone' | 'tv_glitch' | 'venetian_blinds' | 'vignette' | 'wave_warp'; // each also valid as '//ly.img.ubq/effect/<name>'\ntype EffectTypeLonghand = `//ly.img.ubq/effect/${EffectTypeShorthand}`;\ntype EngineActionId = keyof EngineActionsRegistry & string;\ninterface EnginePlugin {\n name: string;\n version: string;\n initialize: (context: EnginePluginContext) => void | Promise<void>;\n}\ntype EnumValues = BlendMode | HorizontalContentFillAlignment | ContentFillMode | VerticalContentFillAlignment | HeightMode | PositionXMode | PositionYMode | SceneAngleUnit | SceneColorConversionMode | DesignUnit | FontSizeUnit | SceneLayout | SceneMode | WidthMode | PageGuidesSource | StrokeCap | StrokeCornerGeometry | StrokeDashEndCap | StrokeDashStartCap | StrokeEndCap | StrokePosition | StrokeStartCap | StrokeStyle | PlaybackFadeInEasing | PlaybackFadeOutEasing | TextHorizontalAlignment | TextVerticalAlignment | CutoutType | CaptionHorizontalAlignment | CaptionVerticalAlignment | AnimationEasing | TextAnimationWritingStyle | AnimationGrowDirection | AnimationWipeDirection | AnimationBaselineDirection | AnimationSpinDirection | AnimationSpinLoopDirection | AnimationJumpLoopDirection | AnimationTypewriterTextWritingStyle | AnimationBlockSwipeTextDirection | AnimationMergeTextDirection | AnimationKenBurnsDirection | BlurUniformMode | ModifierTrimMode | ModifierRepeaterComposite | ModifierOffsetJoin | ModifierZigzagPointType | EffectDisplacementMapHorizontalChannel | EffectDisplacementMapMapBehavior | EffectDisplacementMapVerticalChannel | EffectInvertChannel | EffectRadialWipeDirection | EffectShiftChannelsTakeAlphaFrom | EffectShiftChannelsTakeBlueFrom | EffectShiftChannelsTakeGreenFrom | EffectShiftChannelsTakeRedFrom | EffectStrokePaintStyle | EffectWaveWarpWaveType | FillPixelStreamOrientation | ShapeVectorPathFillRule | ShapeCompoundFillRule | ShapeCompoundMode | MaskMode | TextAnimatorSelectorBasedOn | TextAnimatorSelectorShape | TextAnimatorSelectorUnits | (string & {});\ntype ExportOptions = {\n mimeType?: ImageMimeType | Exclude<ApplicationMimeType, 'application/zip'>;\n pngCompressionLevel?: number;\n jpegQuality?: number;\n webpQuality?: number;\n targetWidth?: number;\n targetHeight?: number;\n exportPdfWithHighCompatibility?: boolean;\n exportPdfWithUnderlayer?: boolean;\n underlayerSpotColorName?: string;\n underlayerOffset?: number;\n underlayerRenderRatio?: number;\n underlayerMaxError?: number;\n allowTextOverhang?: boolean;\n exportPdfWithDeviceCMYK?: boolean;\n exportPdfWithCropMarks?: boolean;\n exportPdfWithRegistrationMarks?: boolean;\n printMarkOffset?: number;\n printMarkWidth?: number;\n cropMarkLength?: number;\n pdfImageQuality?: number;\n pdfChunkSize?: number;\n onProgress?: (exportedPages: number, totalPages: number) => void;\n abortSignal?: AbortSignal;\n};\ntype FillType = 'color' | 'gradient/linear' | 'gradient/radial' | 'gradient/conical' | 'image' | 'video' | 'pixelStream' | 'stripe'; // each also valid as '//ly.img.ubq/fill/<name>'\ntype FillTypeLonghand = `//ly.img.ubq/fill/${FillTypeShorthand}`;\ninterface FindAssetsQuery {\n perPage: number;\n page: number;\n query: string;\n tags: string[];\n groups: string[];\n excludeGroups: string[];\n locale: string;\n sortingOrder: SortingOrder;\n sortKey: string;\n sortActiveFirst: boolean;\n filter: AssetFilter[];\n facets: AssetFacetPath[];\n}\ninterface Flip {\n horizontal: boolean;\n vertical: boolean;\n}\ntype GradientstopRGBA = [\n stop: number,\n r: number,\n g: number,\n b: number,\n a: number\n];\ntype HistoryId = number;\ntype HorizontalBlockAlignment = 'Left' | 'Right' | 'Center' | 'Justify' | 'Auto';\nfunction isCMYKColor(color: Color): color is CMYKColor;\nfunction isRGBAColor(color: Color): color is RGBAColor;\nfunction isSpotColor(color: Color): color is SpotColor;\ninterface Keyframe_2 {\n time: number;\n value: KeyframeValue;\n easing?: KeyframeEasing;\n spatialOut?: Vec2;\n spatialIn?: Vec2;\n}\ntype ModifierType = 'trim' | 'repeater' | 'round_corners' | 'offset' | 'zigzag' | 'pucker_bloat' | 'twist'; // each also valid as '//ly.img.ubq/modifier/<name>'\ntype ModifierTypeLonghand = `//ly.img.ubq/modifier/${ModifierTypeShorthand}`;\ntype ObjectType = ObjectTypeShorthand | ObjectTypeLonghand;\ninterface PageDuration {\n pageId: DesignBlockId;\n duration: number;\n start: number;\n end: number;\n}\ntype PaletteColor = HexColorString | RGBColor | RGBAColor | SpotColor;\ntype ResolvedMovementConstraint = {\n overshoot: number;\n} | null;\ninterface SaveToArchiveOptions {\n compression?: CompressionOptions;\n abortSignal?: AbortSignal;\n}\ninterface SaveToStringOptions {\n resourceSchemesAllowed?: string[];\n persistenceCallback?: (url: string, dataHash: string, persistedCallback: PersistedCallback) => void;\n compression?: CompressionOptions;\n}\ntype SettingEnumPropertyName = 'clip/initialDurationMode' | 'touch/pinchAction' | 'touch/rotateAction' | 'camera/clamping/overshootMode' | 'controlGizmo/moveHandleVisibility' | 'controlGizmo/resizeHandlesVisibility' | 'controlGizmo/scaleHandlesVisibility' | 'controlGizmo/rotateHandlesVisibility' | 'doubleClickSelectionMode' | 'colorPicker/colorMode' | 'timeline/trackVisibility' | (string & {});\ntype SettingEnumValues = ClipInitialDurationMode | TouchPinchAction | TouchRotateAction | CameraClampingOvershootMode | ControlGizmoMoveHandleVisibility | ControlGizmoResizeHandlesVisibility | ControlGizmoScaleHandlesVisibility | ControlGizmoRotateHandlesVisibility | DoubleClickSelectionMode | ColorPickerColorMode | TimelineTrackVisibility | (string & {});\ntype SettingsEnum = SettingEnumType;\ntype ShapeType = 'rect' | 'line' | 'ellipse' | 'polygon' | 'star' | 'vector_path' | 'compound'; // each also valid as '//ly.img.ubq/shape/<name>'\ntype ShapeTypeLonghand = `//ly.img.ubq/shape/${ShapeTypeShorthand}`;\ninterface Size2 {\n width: number;\n height: number;\n}\ntype Subscription = number;\ninterface TextFontSizeOptions {\n unit?: TextFontSizeUnit;\n from?: number;\n to?: number;\n}\ninterface TextRunInfo {\n from: number;\n to: number;\n text: string;\n color: Color;\n fontWeight: FontWeight;\n fontStyle: FontStyle;\n fontSize: number;\n textCase: TextCase;\n typeface: Typeface;\n resolvedFontFileUri: string;\n textDecoration: TextDecorationConfig;\n scriptStyle: ScriptStyle;\n kerning: number;\n}\ntype TrackMode = 'Absolute' | 'Relative';\ntype TransitionType = 'none' | 'cross-fade' | 'cross-blur' | 'cross-spin' | 'cross-zoom' | 'cross-warp' | 'push' | 'slide' | 'stack' | 'splice' | 'diagonal-splice' | 'fade' | 'fade-to-white' | 'fade-to-black' | 'color-wipe' | 'line-wipe' | 'wipe' | 'clock-wipe' | 'chop' | 'gradient-fade' | 'two-stripes'; // each also valid as '//ly.img.ubq/transition/<name>'\ntype TransitionTypeLonghand = `//ly.img.ubq/transition/${TransitionTypeShorthand}`;\ninterface UBQAudioFromVideoOptions {\n keepTrimSettings: boolean;\n muteOriginalVideo: boolean;\n}\ninterface UBQExportAudioOptions {\n sampleRate: number;\n numberOfChannels: number;\n skipEncoding?: boolean;\n audioCodec: number;\n}\ninterface UBQExportOptions {\n jpegQuality: number;\n webpQuality: number;\n pngCompressionLevel: number;\n useTargetSize: boolean;\n targetWidth: number;\n targetHeight: number;\n exportPdfWithHighCompatibility: boolean;\n exportPdfWithUnderlayer: boolean;\n underlayerSpotColorName: string;\n underlayerOffset: number;\n underlayerRenderRatio: number;\n underlayerMaxError: number;\n allowTextOverhang: boolean;\n exportPdfWithDeviceCMYK: boolean;\n exportPdfWithCropMarks: boolean;\n exportPdfWithRegistrationMarks: boolean;\n printMarkOffset: number;\n cropMarkLength: number;\n printMarkWidth: number;\n pdfImageQuality: number;\n pdfChunkSize: number;\n}\ninterface UBQExportVideoOptions {\n coverTimeOffset: number | undefined;\n h264Profile: number;\n h264Level: number;\n framerate?: number;\n videoBitrate: number;\n audioBitrate: number;\n useTargetSize: boolean;\n targetWidth: number;\n targetHeight: number;\n allowTextOverhang: boolean;\n audioCodec: number;\n videoCodec: number;\n exportAlpha: boolean;\n}\ninterface UBQSplitOptions {\n attachToParent: boolean;\n createParentTrackIfNeeded: boolean;\n selectNewBlock: boolean;\n}\ntype Vec2PropertyName = 'position' | 'shape/position' | (string & {});\ninterface Vec3 {\n x: number;\n y: number;\n z: number;\n}\ntype VerticalBlockAlignment = 'Top' | 'Bottom' | 'Center';\ntype VideoExportOptions = {\n coverTimeOffset?: number | null;\n mimeType?: VideoMimeType;\n onProgress?: (numberOfRenderedFrames: number, numberOfEncodedFrames: number, totalNumberOfFrames: number) => void;\n h264Profile?: number;\n h264Level?: number;\n videoBitrate?: number | VideoBitrateMode;\n audioBitrate?: number;\n audioCodec?: AudioCodec;\n videoCodec?: VideoCodec;\n exportAlpha?: boolean;\n timeOffset?: number;\n duration?: number;\n framerate?: number;\n targetWidth?: number;\n targetHeight?: number;\n allowTextOverhang?: boolean;\n abortSignal?: AbortSignal;\n};\ntype ZoomAutoFitAxis = 'Horizontal' | 'Vertical' | 'Both';\ntype ZoomOptions = {\n padding?: number | {\n x?: number;\n y?: number;\n } | {\n top?: number;\n bottom?: number;\n left?: number;\n right?: number;\n };\n animate?: boolean | {\n duration?: number;\n easing?: AnimationEasing;\n interruptible?: boolean;\n };\n};\n\n// ---- types referenced only by extended members ----\ntype AnimationBaselineDirection = 'Up' | 'Right' | 'Down' | 'Left';\ntype AnimationBlockSwipeTextDirection = 'Up' | 'Right' | 'Down' | 'Left';\ntype AnimationGrowDirection = 'Horizontal' | 'Vertical' | 'All' | 'TopLeft' | 'TopRight' | 'BottomLeft' | 'BottomRight';\ntype AnimationJumpLoopDirection = 'Up' | 'Right' | 'Down' | 'Left';\ntype AnimationKenBurnsDirection = 'Up' | 'Right' | 'Down' | 'Left';\ntype AnimationMergeTextDirection = 'Right' | 'Left';\ntype AnimationSpinDirection = 'Clockwise' | 'CounterClockwise';\ntype AnimationSpinLoopDirection = 'Clockwise' | 'CounterClockwise';\ntype AnimationTypewriterTextWritingStyle = 'Character' | 'Word';\ntype AnimationWipeDirection = 'Up' | 'Right' | 'Down' | 'Left';\ntype ApplicationMimeType = Extract<MimeType_2, 'application/octet-stream' | 'application/pdf' | 'application/zip'>;\ntype AudioMimeType = Extract<MimeType_2, 'audio/wav' | 'audio/mp4' | 'audio/webm'>;\ntype BlendMode = 'PassThrough' | 'Normal' | 'Darken' | 'Multiply' | 'ColorBurn' | 'LinearBurn' | 'DarkenColor' | 'Lighten' | 'Screen' | 'ColorDodge' | 'LinearDodge' | 'LightenColor' | 'Overlay' | 'SoftLight' | 'HardLight' | 'VividLight' | 'LinearLight' | 'PinLight' | 'HardMix' | 'Difference' | 'Exclusion' | 'Subtract' | 'Divide' | 'Hue' | 'Saturation' | 'Color' | 'Luminosity';\ntype BlurUniformMode = 'Fill' | 'Block';\ntype CaptionHorizontalAlignment = 'Left' | 'Right' | 'Center' | 'Justify' | 'Auto';\ntype CaptionVerticalAlignment = 'Top' | 'Bottom' | 'Center';\ninterface CompressionOptions {\n format?: CompressionFormat_2;\n level?: CompressionLevel;\n}\ntype ContentFillMode = 'Crop' | 'Cover' | 'Contain';\ntype EffectDisplacementMapHorizontalChannel = 'Red' | 'Green' | 'Blue' | 'Alpha' | 'Luminance' | 'Hue' | 'Lightness' | 'Saturation' | 'Full' | 'Half' | 'Off';\ntype EffectDisplacementMapMapBehavior = 'Center' | 'Stretch' | 'Tile';\ntype EffectDisplacementMapVerticalChannel = 'Red' | 'Green' | 'Blue' | 'Alpha' | 'Luminance' | 'Hue' | 'Lightness' | 'Saturation' | 'Full' | 'Half' | 'Off';\ntype EffectInvertChannel = 'RGB' | 'Red' | 'Green' | 'Blue' | 'HLS' | 'Hue' | 'Lightness' | 'Saturation' | 'YIQ' | 'Luma' | 'InPhaseChroma' | 'QuadratureChroma' | 'Alpha';\ntype EffectRadialWipeDirection = 'Clockwise' | 'Counterclockwise' | 'Both';\ntype EffectShiftChannelsTakeAlphaFrom = 'Alpha' | 'Red' | 'Green' | 'Blue' | 'Luminance' | 'Hue' | 'Lightness' | 'Saturation' | 'FullOn' | 'FullOff';\ntype EffectShiftChannelsTakeBlueFrom = 'Alpha' | 'Red' | 'Green' | 'Blue' | 'Luminance' | 'Hue' | 'Lightness' | 'Saturation' | 'FullOn' | 'FullOff';\ntype EffectShiftChannelsTakeGreenFrom = 'Alpha' | 'Red' | 'Green' | 'Blue' | 'Luminance' | 'Hue' | 'Lightness' | 'Saturation' | 'FullOn' | 'FullOff';\ntype EffectShiftChannelsTakeRedFrom = 'Alpha' | 'Red' | 'Green' | 'Blue' | 'Luminance' | 'Hue' | 'Lightness' | 'Saturation' | 'FullOn' | 'FullOff';\ntype EffectStrokePaintStyle = 'OnOriginalImage' | 'OnTransparent';\ntype EffectWaveWarpWaveType = 'Sine' | 'Square' | 'Triangle' | 'Sawtooth';\ntype EnginePluginContext = {\n engine: CreativeEngine;\n};\ntype FillPixelStreamOrientation = 'Up' | 'Down' | 'Left' | 'Right' | 'UpMirrored' | 'DownMirrored' | 'LeftMirrored' | 'RightMirrored';\ntype TextFontSizeUnit = DesignUnit | 'Point';\ntype HeightMode = 'Absolute' | 'Percent' | 'Auto';\ntype HexColorString = string;\ntype HorizontalContentFillAlignment = 'Left' | 'Center' | 'Right';\ntype ImageMimeType = Extract<MimeType_2, 'image/png' | 'image/jpeg' | 'image/webp' | 'image/x-tga' | 'image/svg+xml'>;\ntype KeyframeEasing = {\n type: 'Preset';\n preset: AnimationEasing;\n} | {\n type: 'Bezier';\n out: Vec2;\n in: Vec2;\n} | {\n type: 'Hold';\n};\ntype KeyframeValue = {\n type: 'Float';\n value: number;\n} | {\n type: 'Vec2';\n value: Vec2;\n} | {\n type: 'Color';\n value: Color;\n} | {\n type: 'Path';\n value: {\n vertices: KeyframePathVertex[];\n closed: boolean;\n };\n} | {\n type: 'List';\n value: number[];\n} | {\n type: 'Discrete';\n value: boolean | number | string;\n};\ntype MaskMode = 'Add' | 'Subtract' | 'Intersect' | 'Lighten' | 'Darken' | 'Difference' | 'None';\ntype MatteMode = 'Alpha' | 'AlphaInverted' | 'Luma' | 'LumaInverted';\ntype ModifierOffsetJoin = 'Bevel' | 'Miter' | 'Round';\ntype ModifierRepeaterComposite = 'Below' | 'Above';\ntype ModifierTrimMode = 'Simultaneous' | 'Individual';\ntype ModifierZigzagPointType = 'Corner' | 'Smooth';\ntype ObjectTypeLonghand = DesignBlockTypeLonghand | ShapeTypeLonghand | FillTypeLonghand | EffectTypeLonghand | ModifierTypeLonghand | BlurTypeLonghand | AnimationTypeLonghand | TransitionTypeLonghand | '//ly.img.ubq/text_animator' | '//ly.img.ubq/mask';\ntype ObjectTypeShorthand = DesignBlockTypeShorthand | `shape/${ShapeTypeShorthand}` | `fill/${FillTypeShorthand}` | `effect/${EffectTypeShorthand}` | `modifier/${ModifierTypeShorthand}` | `blur/${BlurTypeShorthand}` | `animation/${AnimationTypeShorthand}` | `transition/${TransitionTypeShorthand}` | 'text_animator' | 'mask';\ntype PageGuidesSource = 'Document' | 'Custom';\ntype PersistedCallback = (url: string, persistedUrl: unknown, error: string | undefined) => void;\ntype PlaybackFadeInEasing = 'Linear' | 'EaseIn' | 'EaseOut' | 'EaseInOut' | 'EaseInQuart' | 'EaseOutQuart' | 'EaseInOutQuart' | 'EaseInQuint' | 'EaseOutQuint' | 'EaseInOutQuint' | 'EaseInBack' | 'EaseOutBack' | 'EaseInOutBack' | 'EaseInSpring' | 'EaseOutSpring' | 'EaseInOutSpring';\ntype PlaybackFadeOutEasing = 'Linear' | 'EaseIn' | 'EaseOut' | 'EaseInOut' | 'EaseInQuart' | 'EaseOutQuart' | 'EaseInOutQuart' | 'EaseInQuint' | 'EaseOutQuint' | 'EaseInOutQuint' | 'EaseInBack' | 'EaseOutBack' | 'EaseInOutBack' | 'EaseInSpring' | 'EaseOutSpring' | 'EaseInOutSpring';\ntype PositionXMode = 'Absolute' | 'Percent' | 'Auto';\ntype PositionYMode = 'Absolute' | 'Percent' | 'Auto';\ntype SceneColorConversionMode = 'Managed' | 'Legacy';\ntype ShapeCompoundFillRule = 'EvenOdd' | 'NonZero';\ntype ShapeCompoundMode = 'Merge' | 'Add' | 'Subtract' | 'Intersect' | 'Exclude';\ntype ShapeVectorPathFillRule = 'EvenOdd' | 'NonZero';\ntype StrokeCap = 'Butt' | 'Round' | 'Square';\ntype StrokeCornerGeometry = 'Bevel' | 'Miter' | 'Round';\ntype StrokeDashEndCap = 'Butt' | 'Round' | 'Square';\ntype StrokeDashStartCap = 'Butt' | 'Round' | 'Square';\ntype StrokeEndCap = 'Butt' | 'Round' | 'Square';\ntype StrokePosition = 'Center' | 'Inner' | 'Outer';\ntype StrokeStartCap = 'Butt' | 'Round' | 'Square';\ntype StrokeStyle = 'Dashed' | 'DashedRound' | 'Dotted' | 'LongDashed' | 'LongDashedRound' | 'Solid';\ntype TextAnimationWritingStyle = 'Block' | 'Line' | 'Character' | 'Word';\ntype TextAnimatorSelectorBasedOn = 'Characters' | 'CharactersExcludingSpaces' | 'Words' | 'Lines';\ntype TextAnimatorSelectorShape = 'Square' | 'RampUp' | 'RampDown' | 'Triangle' | 'Round' | 'Smooth';\ntype TextAnimatorSelectorUnits = 'Percentage' | 'Index';\ntype TextHorizontalAlignment = 'Left' | 'Right' | 'Center' | 'Justify' | 'Auto';\ntype TextVerticalAlignment = 'Top' | 'Bottom' | 'Center';\ntype VerticalContentFillAlignment = 'Top' | 'Center' | 'Bottom';\ntype VideoBitrateMode = 'System' | 'Auto';\ntype VideoMimeType = Extract<MimeType_2, 'video/mp4' | 'video/webm'>;\ntype WidthMode = 'Absolute' | 'Percent' | 'Auto';\n\n// ---- types referenced only by extended members ----\ntype BlurTypeShorthand = 'uniform' | 'linear' | 'mirrored' | 'radial';\nenum CompressionFormat_2 {\n None = 0,\n Zstd = 1\n}\nenum CompressionLevel {\n Fastest = 0,\n Default = 1,\n Best = 2\n}\ntype EffectTypeShorthand = 'adjustments' | 'bulge' | 'corner_pin' | 'cross_cut' | 'displacement_map' | 'dot_pattern' | 'duotone_filter' | 'extrude_blur' | 'fill' | 'glow' | 'green_screen' | 'half_tone' | 'invert' | 'levels' | 'linear_wipe' | 'linocut' | 'liquid' | 'lut_filter' | 'mirror' | 'outliner' | 'pixelize' | 'posterize' | 'radial_pixel' | 'radial_wipe' | 'recolor' | 'sharpie' | 'shift_channels' | 'shifter' | 'stroke' | 'threshold' | 'tilt_shift' | 'tint' | 'tritone' | 'tv_glitch' | 'venetian_blinds' | 'vignette' | 'wave_warp';\ntype FillTypeShorthand = 'color' | 'gradient/linear' | 'gradient/radial' | 'gradient/conical' | 'image' | 'video' | 'pixelStream' | 'stripe';\ninterface KeyframePathVertex {\n point: Vec2;\n inTangent: Vec2;\n outTangent: Vec2;\n}\ntype ModifierTypeShorthand = 'trim' | 'repeater' | 'round_corners' | 'offset' | 'zigzag' | 'pucker_bloat' | 'twist';\ntype ShapeTypeShorthand = 'rect' | 'line' | 'ellipse' | 'polygon' | 'star' | 'vector_path' | 'compound';\ntype TransitionTypeShorthand = 'none' | 'cross-fade' | 'cross-blur' | 'cross-spin' | 'cross-zoom' | 'cross-warp' | 'push' | 'slide' | 'stack' | 'splice' | 'diagonal-splice' | 'fade' | 'fade-to-white' | 'fade-to-black' | 'color-wipe' | 'line-wipe' | 'wipe' | 'clock-wipe' | 'chop' | 'gradient-fade' | 'two-stripes';\n",
|
|
13
|
+
"docs/api/signatures.d.ts": "// ============================================================================\n// codesign extension: engine.design — the ONLY API `edit` code uses.\n// engine.block/scene/variable/editor/asset/event are refused by the edit\n// gate, which names the engine.design equivalent; the upstream classes after\n// this section are reference only. Scene-wide state (variables,\n// spotColors, scene.*) lives on the scene block.\n//\n// Length: design-unit number or '3mm'/'0.1in'/'32pt'/'40px'; reads answer\n// numbers. '50%' also sets '<leaf>Mode' to 'Percent'. letterSpacing is a FACTOR, never a length. lineHeight: write { visual: n }\n// (CSS-style x fontSize, converted per font); a bare number is the ENGINE\n// scale and renders looser. paragraphSpacing: write { px: n } or { em: n }.\n// Text glyph color is per-character: fill.solid.color on a text block is\n// REJECTED — write setProps(id, { text: { color } }) instead.\n// ============================================================================\n// Branded attachment ids — nominal guidance (runtime dispatch enforces the\n// category): a FillId/EffectId/... is where the matching attachment props\n// tree applies, never BlockProps.\n// Durable identity: every id parameter also accepts the block's UUID string\n// (read it via getProps(id, ['uuid']) or a tree read) — the identity that\n// persists in the scene file and crosses edits/revisions. An unknown uuid\n// throws \"not in this revision\"; a stale numeric handle can't be caught.\ntype BlockRef = DesignBlockId | string /* uuid */;\ntype Length = number | `${number}${'px' | 'pt' | 'mm' | 'in'}`;\n// One node of the document read as a tree; feed a (subset of a) node tree\n// back to setProps to patch every node by uuid.\ninterface PropsNode { uuid: string; name?: string; type: string; props: BlockProps; children: PropsNode[] }\n// Tracks by leaf; at = seconds of the (host) block or '25%'; null removes.\ntype Keyframes = { [leaf: string]: { at: number | string; value: unknown; easing?: string | object }[] | null };\ntype FillId = DesignBlockId & { readonly __kind?: 'fill' };\ntype EffectId = DesignBlockId & { readonly __kind?: 'effect' };\ntype BlurId = DesignBlockId & { readonly __kind?: 'blur' };\ntype ShapeId = DesignBlockId & { readonly __kind?: 'shape' };\ntype AnimationId = DesignBlockId & { readonly __kind?: 'animation' };\ninterface DesignApi {\n /** EVERY member returns a Promise — always: await engine.design.x(...)\n * (a floating rejection fails the edit at commit). */\n /** THE constructor: one block or a whole subtree, same spec shape at\n * every level. Looks up any font: { family, weight }, applies props,\n * attaches to the parent and loads fonts/images. Rolls the\n * WHOLE subtree back on failure. Name the nodes you will touch again:\n * the name lands on the block and findByName resolves it later.\n * Text without a height sizes to its text; a fixed height below its\n * lines throws (setProps too).\n * A NEW document: create({ type: 'scene', props: { scene: { mode?:\n * 'Video', layout?, designUnit? }, stack?: { spacing? }, variables?,\n * spotColors? }, children: [pages] }) replaces the current scene; a\n * page whose parent is the scene goes into its stack (gap 48 px). */\n create(spec: BuildSpec, opts?: { parent?: BlockRef; index?: number /* 0 = back */ }): Promise<DesignBlockId>;\n /** Partial deep-merge write. Brand-dispatched: pass a FILL/EFFECT/BLUR/\n * SHAPE/ANIMATION block id and the matching attachment props tree\n * (effect/*, fill/*, … paths as nested keys) applies instead.\n * Given a PropsNode TREE (a node with uuid+props or children) it\n * patches every node by uuid — read the tree, transform it in JS,\n * write it back. Patch-only: an absent block/prop is untouched, never\n * deleted; uuids resolve for the whole tree before anything applies. */\n setProps(id: BlockRef, props: BlockProps | PropsNode): Promise<void>;\n /** Read leaves or whole subtrees — getProps(id, ['position', 'stroke']) —\n * or omit select for EVERY applicable prop of this block, valued.\n * In a list, a selector this block lacks answers undefined (a\n * page's opacity); alone, it throws and says why. { children: true,\n * props?: [...] } reads the\n * whole SUBTREE as one uuid-keyed PropsNode tree — filter it with\n * plain JS (a selector a block kind lacks is skipped for that block).\n * The snapshot never enters your reply unless you print it. */\n getProps(id: BlockRef, select?: string[] | { children: true; props?: string[] }): Promise<BlockProps>;\n /** Editor settings, same dialect; SettingsProps is in signatures.d.ts. */\n setSettings(props: SettingsProps): Promise<void>;\n getSettings(select?: string[]): Promise<SettingsProps>;\n // text.path's circle spec centres the glyph run and sets the D×D frame\n // (align: 'bottom' = upright underside). getProps(id, ['type']) names a\n // block; attachment ids never circulate.\n /** Editing scopes (what the browser-editor user may change). Saved with\n * the design: the lock an editor opened for filling in a template obeys.\n * THIS session ignores locks — every write still succeeds here; an\n * editor obeys them where its own global scopes defer. A slot\n * needs its own scope (image: fill/change, text: text/edit) plus\n * editor/select, or it cannot be clicked. { recursive: true } writes the\n * block and every descendant: lock a page with every scope false, then\n * open the slots. */\n getScopes(id: BlockRef): Promise<Record<Scope, boolean>>;\n setScopes(id: BlockRef, scopes: Partial<Record<Scope, boolean>>, opts?: { recursive?: boolean }): Promise<void>;\n getCapabilities(idOrType: BlockRef | DesignBlockType): Promise<readonly string[]>;\n // Attachment values are the unions below (replaced blocks are destroyed):\n // await setProps(id, { fill: { type: 'color', color: { value } } })\n // await setProps(id, { fill: { enabled: false } }) // no type ⇒ host leaves\n // Gradient fills round-trip stops; image fills round-trip sourceSet —\n // getProps(id, ['fill']) → tweak → setProps is lossless.\n // await setProps(id, { shape: { type: 'rect' } }) · { blur: { type: 'uniform' } }\n // await setProps(id, { effects: [{ type: 'displacement_map', source: 'map' /* BlockRef */ }] })\n // await setProps(id, { animations: { in: { type: 'slide', … } } }) // null detaches\n // TEXT is all props too, applied in canonical order (font → string →\n // styles → ranges) whatever the key order:\n // await setProps(id, { text: { string, font: { typeface }, weight, case,\n // listStyle, path, pathOffset, pathFlipped,\n // ranges: [{ from, to, color?, weight?, style?, size?, case?, scriptStyle?,\n // decoration?, kerning? }] } })\n // A string write WITHOUT other text styling auto-preserves existing\n // ranges; with styling, ranges reset (pass ranges to keep or ranges: []\n // to wipe); font/size/lineHeight writes auto-reshape. Read the per-run\n // truth via getProps(id, ['text.ranges']); paragraphs (read-only) carry\n // listStyle + listLevel.\n // TIMELINE: page→track→clips; a later track draws above. A track plays\n // its clips back-to-back until a timeOffset is written. A transition\n // joins a clip to the next one on its track.\n // CAPTIONS: page→captionTrack→caption, caption.* as text.*; style+layout TRACK-WIDE,\n // caption.ranges per caption (one track per page). Background box = the whole frame + padding.\n adjustCropToFillFrame(id: BlockRef, minScaleRatio: number): Promise<number>;\n // Multi-block layout verbs:\n /** Axis-keyed ('Center' is never ambiguous); one call may do both axes. */\n align(ids: BlockRef[], alignment: { horizontal?: 'Left' | 'Center' | 'Right'; vertical?: 'Top' | 'Center' | 'Bottom' }): Promise<void>;\n distribute(ids: BlockRef[], axis: 'horizontal' | 'vertical'): Promise<void>;\n isAlignable(ids: BlockRef[]): Promise<boolean>;\n isDistributable(ids: BlockRef[]): Promise<boolean>;\n bringForward(id: BlockRef): Promise<void>;\n sendBackward(id: BlockRef): Promise<void>;\n order(id: BlockRef, to: 'front' | 'back' | { above: BlockRef } | { below: BlockRef }): Promise<void>;\n scale(id: BlockRef, factor: number, opts?: { anchorX?: number; anchorY?: number }): Promise<void>;\n resizeContentAware(ids: BlockRef[], size: { width: number; height: number }): Promise<void>;\n /** Measured layout frame (post-layout px, resources loaded) — the\n * numbers you position by. Unpadded: backgroundColor padding is outside.\n * Rotated: x/y = pivot corner (the unrotated origin).\n * textLines: visible line count; ink: { from, to } adds glyph ink boxes. Text only. */\n measure(id: BlockRef, opts?: { ink?: { from?: number; to?: number } }): Promise<{ x: number; y: number; width: number; height: number; textLines?: number; ink?: Array<{ x: number; y: number; width: number; height: number; baselineY: number }> }>;\n /** Await pending font/image loads for these subtrees (create does this itself). */\n loadResources(ids: BlockRef[]): Promise<void>;\n isGroupable(ids: BlockRef[]): Promise<boolean>;\n // Tree verbs. Child order is paint order: first = back, last = front.\n appendChild(parent: BlockRef, child: BlockRef): Promise<void>;\n insertChild(parent: BlockRef, child: BlockRef, index: number): Promise<void>;\n getParent(id: BlockRef): Promise<DesignBlockId | null>;\n getChildren(id: BlockRef): Promise<DesignBlockId[]>;\n /** 'page' answers in document order. */\n findByType(type: DesignBlockType): Promise<DesignBlockId[]>;\n /** Blocks carrying this name. create writes a spec node's name onto the\n * block, so this is how a LATER edit re-finds what an earlier made. */\n findByName(name: string): Promise<DesignBlockId[]>;\n group(ids: BlockRef[]): Promise<DesignBlockId>;\n ungroup(id: BlockRef): Promise<void>;\n duplicate(id: BlockRef): Promise<DesignBlockId>;\n destroy(id: BlockRef): Promise<void>;\n // Media and CoDesign services — what CE.SDK does not answer itself:\n /** A font and its metrics, by family (create's lookup) or uri; warms the\n * cache text.lineHeight: { visual } reads. */\n font(spec: { family?: string; uri?: string; weight?: FontWeight; style?: FontStyle }): Promise<{ typeface?: Typeface; uri: string; contentArea: number; metrics: { ascender: number; descender: number; lineGap: number; unitsPerEm: number; capHeight: number; xHeight: number; underlineOffset: number; underlineSize: number } }>;\n /** Words of an asset_generate transcript (its transcriptUri) starting in [from, to) source seconds. */\n readTranscript(uri: string, range?: { from?: number; to?: number }): Promise<{ words: Array<{ text: string; start: number; end: number }> }>;\n /** An audio block's beats in PAGE seconds; bpm picks half/double tempo;\n * bpm/fit null = no steady beat (cut on accents/onsets). */\n readBeats(id: BlockRef, opts?: { bpm?: number }): Promise<{ start: number; duration: number; bpm: number | null; requestedBpm: number | null; fit: { onsets: number; onGrid: number; meanErrMs: number } | null; beats: number[]; accents: number[]; onsets: Array<{ t: number; strength: number }> }>;\n}\n// Also in edit scope: a text block by its copy, NBSP/thin spaces folded and\n// ends trimmed, else exact. A miss lists the design's copy.\ndeclare function findText(copy: string): Promise<DesignBlockId>; // rejects unless one matches\ndeclare function findAllText(copy: string): Promise<DesignBlockId[]>; // [] for none\ninterface BuildSpec {\n type: DesignBlockType;\n /** Written onto the block; findByName(name) resolves it, in this edit\n * and in every later one. */\n name?: string;\n /** Everything the block IS, attachments and the text subtree included;\n * text.font: { family, weight } is looked up (create and setProps). */\n props?: BlockProps;\n children?: BuildSpec[];\n}\n// Capability matrix (measured against the engine; type-determined —\n// no need to call supports* for blocks you created):\n// capability audio caption captionTrack cutout graphic group page text track\n// animation ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓\n// backgroundColor · ✓ · · · · · ✓ ·\n// blendMode · ✓ · · ✓ ✓ ✓ ✓ ·\n// blur · · · · ✓ ✓ ✓ · ·\n// contentFillMode ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓\n// crop · · · · ✓ · · · ·\n// dropShadow · ✓ · · ✓ · ✓ ✓ ·\n// duration ✓ ✓ ✓ · ✓ ✓ ✓ ✓ ✓\n// effects · · · · ✓ · ✓ · ·\n// fill · ✓ · · ✓ · ✓ ✓ ·\n// masks · ✓ · · ✓ ✓ · ✓ ·\n// opacity · ✓ · · ✓ ✓ · ✓ ·\n// placeholderBehavior· ✓ · · · · · ✓ ·\n// placeholderControls· · · ✓ ✓ · ✓ · ·\n// playbackControl ✓ · · · · · ✓ · ·\n// playbackTime ✓ · · · · · ✓ · ·\n// shape · · · · ✓ · · · ·\n// stroke · ✓ · · ✓ · ✓ ✓ ·\n// textAnimators · ✓ · · · · · ✓ ·\n// timeOffset ✓ ✓ ✓ · ✓ ✓ · ✓ ✓\n// trim ✓ · · · · · · · ·\n\ninterface BlockProps {\n activeValueSet?: string | null /* SCENE: the set text, bound leaves and exports show; null = the defaults */;\n alwaysOnBottom?: boolean;\n alwaysOnTop?: boolean;\n animations?: { in?: Animation | null; loop?: Animation | null; out?: Animation | null };\n audio?: { fileURI?: string; totalDuration?: number };\n background?: Color /* page only; paints under its children */;\n backgroundColor?: {\n color?: Color;\n cornerRadius?: Length | 'pill' /* fully rounded */;\n enabled?: boolean;\n paddingBottom?: Length;\n paddingLeft?: Length;\n paddingRight?: Length;\n paddingTop?: Length;\n };\n bindings?: { [leaf: string]: string | null };\n blend?: {\n mode?: 'PassThrough' | 'Normal' | 'Darken' | 'Multiply' | 'ColorBurn' | 'LinearBurn' | 'DarkenColor' | 'Lighten' | 'Screen' | 'ColorDodge' | 'LinearDodge' | 'LightenColor' | 'Overlay' | 'SoftLight' | 'HardLight' | 'VividLight' | 'LinearLight' | 'PinLight' | 'HardMix' | 'Difference' | 'Exclusion' | 'Subtract' | 'Divide' | 'Hue' | 'Saturation' | 'Color' | 'Luminosity';\n };\n blur?: Blur | null;\n camera?: {\n pixelRatio?: number;\n resolution?: { height?: number; width?: number };\n zoomLevel?: number;\n };\n caption?: {\n animators?: TextAnimator[] /* in signatures.d.ts; [] clears */;\n automaticFontSizeEnabled?: boolean;\n clipLinesOutsideOfFrame?: boolean;\n color?: Color;\n font?: { family: string; weight?: FontWeight } | { typeface: Typeface; uri?: string };\n fontSize?: string /* '48px' */;\n horizontalAlignment?: 'Left' | 'Right' | 'Center' | 'Justify' | 'Auto';\n letterSpacing?: number;\n lineHeight?: number | { visual: number };\n maxAutomaticFontSize?: number;\n minAutomaticFontSize?: number;\n paragraphSpacing?: number | { px: number } | { em: number };\n pathFlipped?: boolean;\n pathOffset?: number;\n ranges?: { from: number; to: number; color?: Color; weight?: FontWeight; style?: string; size?: string /* px or pt string */; case?: TextCase; scriptStyle?: ScriptStyle; baselineShift?: number | string; typeface?: Typeface; decoration?: TextDecorationConfig; kerning?: number }[];\n style?: string;\n subscriptFontScale?: number;\n subscriptVerticalShift?: number;\n superscriptFontScale?: number;\n superscriptVerticalShift?: number;\n text?: string;\n useContextualAlternates?: boolean;\n useContextualLigatures?: boolean;\n useDiscretionaryLigatures?: boolean;\n useKerning?: boolean;\n useLigatures?: boolean;\n verticalAlignment?: 'Top' | 'Bottom' | 'Center';\n weight?: string;\n };\n captionTrack?: { automaticallyManageBlockOffsets?: boolean };\n clipped?: boolean;\n contentFill?: {\n horizontalAlignment?: 'Left' | 'Center' | 'Right';\n mode?: 'Crop' | 'Cover' | 'Contain' /* image default Cover; a logo: Contain */;\n verticalAlignment?: 'Top' | 'Center' | 'Bottom';\n };\n crop?: null | {\n aspectRatioLocked?: boolean;\n rotation?: number;\n scaleRatio?: number;\n scaleX?: number;\n scaleY?: number;\n translationX?: number;\n translationY?: number;\n };\n cutout?: {\n offset?: number;\n path?: string;\n smoothing?: number;\n type?: 'Solid' | 'Dashed' /* spotColors ink with this cutout */;\n };\n dropShadow?: {\n blurRadius?: { x?: Length; y?: Length };\n clip?: boolean;\n color?: Color;\n enabled?: boolean;\n offset?: { x?: Length; y?: Length };\n };\n effects?: Effect[];\n exclusionArea?: {\n constrains?: boolean;\n punchOut?: boolean /* exclusionArea is never exported; punchOut cuts a hole */;\n };\n fill?: Fill | null;\n flip?: { horizontal?: boolean; vertical?: boolean };\n globalBoundingBox?: { height?: number; width?: number; x?: number; y?: number };\n height?: Length | `${number}%`;\n heightMode?: 'Absolute' | 'Percent' | 'Auto';\n highlightEnabled?: boolean;\n includedInExport?: boolean;\n keyframes?: Keyframes | null;\n kind?: string;\n lastFrame?: { height?: number; width?: number; x?: number; y?: number };\n markers?: { name: string; time: number; duration?: number }[];\n masks?: Mask[];\n matte?: { source: BlockRef; mode?: 'Alpha' | 'AlphaInverted' | 'Luma' | 'LumaInverted' } | null;\n metadata?: { [key: string]: string | null } /* block tags; null deletes */;\n motionBlur?: {\n enabled?: boolean /* graphic, text, caption */;\n samples?: number /* SCENE only: 1–64 */;\n shutterAngle?: number /* SCENE only: 0–720° */;\n shutterPhase?: number /* SCENE only: −360–360° */;\n };\n movement?: { constraint?: number };\n name?: string;\n opacity?: number;\n page?: {\n guides?: {\n gridColor?: Color;\n gridEnabled?: boolean;\n gridSnapEnabled?: boolean;\n gridSpacingX?: number;\n gridSpacingY?: number;\n source?: 'Document' | 'Custom';\n };\n margin?: { bottom?: Length; left?: Length; right?: Length; top?: Length };\n marginEnabled?: boolean /* bleed: page.margin, outside the trim size */;\n marginScale?: number;\n safetyEnabled?: boolean /* safetyInset: text-free band, not exported */;\n safetyInset?: { bottom?: Length; left?: Length; right?: Length; top?: Length };\n titleTemplate?: string;\n };\n placeholder?: { enabled?: boolean };\n placeholderBehavior?: { enabled?: boolean };\n placeholderControls?: { showButton?: boolean; showOverlay?: boolean };\n playback?: {\n duration?: number /* s */;\n fadeIn?: { duration?: number; easing?: AnimationEasing };\n fadeOut?: { duration?: number; easing?: AnimationEasing };\n looping?: boolean;\n muted?: boolean;\n playing?: boolean;\n soloPlaybackEnabled?: boolean;\n speed?: number /* 0.25–3; duration = trimLength / speed */;\n time?: number /* on a page, the playhead: a still export renders this frame */;\n timeOffset?: number /* s from the parent's start; writing one stops its track's auto-arrange */;\n trimLength?: number /* s of the source */;\n trimOffset?: number /* s of the source */;\n volume?: number /* 0–1 */;\n };\n position?: {\n x?: Length | `${number}%`;\n xMode?: 'Absolute' | 'Percent' | 'Auto';\n y?: Length | `${number}%`;\n yMode?: 'Absolute' | 'Percent' | 'Auto';\n };\n rotation?: number;\n scene?: {\n angleUnit?: 'Radian' | 'Degree';\n aspectRatioLock?: boolean;\n colorConversionMode?: 'Managed' | 'Legacy';\n designUnit?: 'Pixel' | 'Millimeter' | 'Inch';\n dpi?: number /* print: 300, designUnit 'Millimeter' */;\n extendedPanningArea?: boolean;\n fontSizeUnit?: 'Pixel' | 'Point';\n frameRate?: number;\n layout?: 'Free' | 'VerticalStack' | 'HorizontalStack' | 'DepthStack';\n mode?: 'Design' | 'Video' /* optional: timelines play in any mode */;\n pageDimensions?: { height?: number; width?: number };\n pageFormatId?: string;\n pixelScaleFactor?: number;\n };\n selected?: boolean;\n selectionEnabled?: boolean;\n shape?: Shape | null;\n spotColors?: { [ink: string]: { rgb?: { r: number; g: number; b: number }; cmyk?: { c: number; m: number; y: number; k: number }; cutout?: 'Solid' | 'Dashed' } | null } /* SCENE only: print inks, swatch-book names */;\n stack?: { spacing?: number; spacingInScreenspace?: boolean };\n stroke?: {\n cap?: 'Butt' | 'Round' | 'Square';\n color?: Color;\n cornerGeometry?: 'Bevel' | 'Miter' | 'Round';\n dashArray?: number[];\n dashEndCap?: 'Butt' | 'Round' | 'Square';\n dashOffset?: number;\n dashStartCap?: 'Butt' | 'Round' | 'Square';\n enabled?: boolean;\n endCap?: 'Butt' | 'Round' | 'Square';\n fill?: Fill | null /* paints the stroke instead of stroke.color: 'color', 'gradient/linear|radial|conical' or 'stripe'; graphic and page blocks; null = stroke.color again */;\n miterLimit?: number;\n overprint?: boolean /* no knockout of inks below (fill.overprint too) */;\n position?: 'Center' | 'Inner' | 'Outer';\n startCap?: 'Butt' | 'Round' | 'Square';\n style?: 'Dashed' | 'DashedRound' | 'Dotted' | 'LongDashed' | 'LongDashedRound' | 'Solid';\n width?: Length;\n };\n subtitles?: string /* captionTrack, WRITE-only: SRT/VTT uri replaces its captions */;\n text?: {\n animators?: TextAnimator[] /* in signatures.d.ts; [] clears */;\n automaticFontSizeEnabled?: boolean;\n baselineShift?: number | string /* + up; per range: ranges[i] */;\n case?: TextCase /* 'Uppercase' lifts tracking < 0.05 to 0.1 */;\n clipLinesOutsideOfFrame?: boolean;\n color?: Color;\n decoration?: TextDecorationConfig;\n externalReference?: string;\n font?: { family: string; weight?: FontWeight; style?: string } /* create only: a lookup */ | { typeface: Typeface; uri?: string } /* 400 unless a weight is written */;\n fontSize?: string /* needs a unit: '64px' | '24pt'; reads answer one too — parseFloat() before math */;\n hasClippedLines?: boolean;\n horizontalAlignment?: 'Left' | 'Right' | 'Center' | 'Justify' | 'Auto';\n letterSpacing?: number;\n lineHeight?: number /* engine scale */ | { visual: number } /* CSS-style */;\n lineHeightVisual?: number /* READ-ONLY: lineHeight in CSS terms */;\n listStyle?: ListStyle /* whole block; nesting via paragraphs: [{ index, listLevel }] */;\n maxAutomaticFontSize?: number;\n minAutomaticFontSize?: number;\n paragraphs?: { index: number; from?: number; listStyle?: ListStyle; listLevel?: number; horizontalAlignment?: 'Left' | 'Right' | 'Center' | 'Justify' | 'Auto'; lineHeight?: number | { visual: number } }[];\n paragraphSpacing?: number /* engine scale */ | { px: number } | { em: number };\n path?: string /* SVG path baseline */ | { shape: 'circle'; diameter: number; align?: 'top' | 'bottom' | number } | null;\n pathExternalRef?: string;\n pathFlipped?: boolean /* true = underside, reversed direction */;\n pathOffset?: number /* 0..1 start along the path */;\n ranges?: { from: number; to: number; color?: Color; weight?: FontWeight; style?: string; size?: string /* px or pt string */; case?: TextCase; scriptStyle?: ScriptStyle; baselineShift?: number | string; typeface?: Typeface; decoration?: TextDecorationConfig; kerning?: number }[];\n style?: string;\n subscriptFontScale?: number;\n subscriptVerticalShift?: number;\n superscriptFontScale?: number;\n superscriptVerticalShift?: number;\n string?: string;\n typeface?: string;\n useContextualAlternates?: boolean;\n useContextualLigatures?: boolean;\n useDiscretionaryLigatures?: boolean;\n useKerning?: boolean;\n useLigatures?: boolean;\n verticalAlignment?: 'Top' | 'Bottom' | 'Center';\n weight?: string;\n };\n track?: { automaticallyManageBlockOffsets?: boolean };\n transform?: {\n anchor?: { x?: Length; y?: Length };\n autoOrient?: boolean;\n hasAnchor?: boolean /* read-only */;\n scale?: { x?: number; y?: number };\n skew?: number;\n skewAxis?: number;\n };\n transformLocked?: boolean;\n transformParent?: BlockRef | null;\n transition?: Transition | null;\n type?: string;\n uuid?: string;\n valueSets?: { [set: string]: { values?: { [variable: string]: string | { color: Color } | { number: number } | { image: string } | { font: { family: string } } | null }; rename?: string } | null } /* SCENE: named alternative values; variables holds the defaults */;\n variables?: { [name: string]: string | { color: Color } | { number: number } | { image: string } | { font: { family: string } } | { rename: string } | null };\n visible?: boolean;\n width?: Length | `${number}%`;\n widthMode?: 'Absolute' | 'Percent' | 'Auto';\n}\n// Attachments. The type field picks the arm, and the arm names every prop\n// that type carries — nothing else applies. Assigning one whose type MATCHES\n// what is already attached edits it in place; a different type replaces it.\n// Each shorthand is also valid as '//ly.img.ubq/<slot>/<name>'.\n// Their angles (stripe fill, star, subshapes, modifiers, effects, the venetian_blinds and wave_warp direction included) are radians.\ntype Fill = { enabled?: boolean; overprint?: boolean; keyframes?: Keyframes } & (\n | { type: 'color'; color?: { value?: Color } }\n | { type: 'gradient/linear'; stops?: GradientColorStop[]; gradient?: { linear?: { endPointX?: number; endPointY?: number; startPointX?: number; startPointY?: number }; }; }\n | { type: 'gradient/radial'; stops?: GradientColorStop[]; gradient?: { radial?: { centerPointX?: number; centerPointY?: number; focalX?: number; focalY?: number; radius?: number }; }; }\n | { type: 'gradient/conical'; stops?: GradientColorStop[]; gradient?: { conical?: { centerPointX?: number; centerPointY?: number }; }; }\n | { type: 'image'; uri?: string /* shorthand for image.imageFileURI */; sourceSet?: Source[]; placeholderBehavior?: { enabled?: boolean } /* a graphic's replace-me switch: on its fill, never on the block */; image?: { externalReference?: string; imageFileURI?: string; previewFileURI?: string }; }\n | { type: 'video'; uri?: string /* shorthand for video.fileURI */; playback?: { trimOffset?: number; trimLength?: number; volume?: number } /* as block playback */; placeholderBehavior?: { enabled?: boolean } /* a graphic's replace-me switch: on its fill, never on the block */; video?: { fileURI?: string; totalDuration?: number }; }\n | { type: 'pixelStream'; pixelStream?: { orientation?: 'Up' | 'Down' | 'Left' | 'Right' | 'UpMirrored' | 'DownMirrored' | 'LeftMirrored' | 'RightMirrored' } }\n | { type: 'stripe'; stripe?: { angle?: number; color?: Color; gap?: number; width?: number } }\n);\ntype Shape = { modifiers?: Modifier[] /* applied in order; [] clears */; keyframes?: Keyframes } & (\n | { type: 'rect'; rect?: { cornerRadiusBL?: number; cornerRadiusBR?: number; cornerRadiusTL?: number; cornerRadiusTR?: number } }\n | { type: 'line' }\n | { type: 'ellipse' }\n | { type: 'polygon'; polygon?: { cornerRadius?: number; sides?: number } }\n | { type: 'star'; star?: { cornerRadius?: number; innerDiameter?: number; innerRadius?: number; innerRoundness?: number; outerRadius?: number; outerRoundness?: number; points?: number; rotation?: number } }\n | { type: 'vector_path'; vector_path?: { cornerRadius?: number; fillRule?: 'EvenOdd' | 'NonZero'; height?: number; holes?: string[] /* cut-outs, wound for you */; path?: string; width?: number /* width/height: the path's frame, not the block size */ } }\n | { type: 'compound'; subshapes?: Subshape[] /* combined in order by compound.mode; [] clears */; compound?: { fillRule?: 'EvenOdd' | 'NonZero'; height?: number; mode?: 'Merge' | 'Add' | 'Subtract' | 'Intersect' | 'Exclude'; width?: number; }; }\n);\n// Subshape and modifier angles are radians; units: api#shapes.md.\ntype Subshape = Shape & { height?: number; rotation?: number; skew?: number; skewAxis?: number; width?: number; anchor?: { x?: number; y?: number }; position?: { x?: number; y?: number }; scale?: { x?: number; y?: number } };\ntype Modifier = { keyframes?: Keyframes } & (\n | { type: 'trim'; trim?: { end?: number; mode?: 'Simultaneous' | 'Individual'; offset?: number; start?: number } }\n | { type: 'repeater'; repeater?: { anchorX?: number; anchorY?: number; composite?: 'Below' | 'Above'; copies?: number; endOpacity?: number; offset?: number; positionX?: number; positionY?: number; rotation?: number; scaleX?: number; scaleY?: number; startOpacity?: number } }\n | { type: 'round_corners'; round_corners?: { radius?: number } }\n | { type: 'offset'; offset?: { amount?: number; join?: 'Bevel' | 'Miter' | 'Round'; miterLimit?: number } }\n | { type: 'zigzag'; zigzag?: { pointType?: 'Corner' | 'Smooth'; ridges?: number; size?: number } }\n | { type: 'pucker_bloat'; pucker_bloat?: { amount?: number } }\n | { type: 'twist'; twist?: { angle?: number; centerX?: number; centerY?: number } }\n);\ntype Blur = { enabled?: boolean; keyframes?: Keyframes } & (\n | { type: 'uniform'; uniform?: { intensity?: number; mode?: 'Fill' | 'Block' } }\n | { type: 'linear'; linear?: { blurRadius?: number; x1?: number; x2?: number; y1?: number; y2?: number } }\n | { type: 'mirrored'; mirrored?: { blurRadius?: number; gradientSize?: number; size?: number; x1?: number; x2?: number; y1?: number; y2?: number } }\n | { type: 'radial'; radial?: { blurRadius?: number; gradientRadius?: number; radius?: number; x?: number; y?: number } }\n);\n// Effect (the effects: [...] arms) is below the upstream marker, for its size.\ntype Mask = { shape: Shape | Shape['type']; expansion?: number; feather?: number; inverted?: boolean; mode?: 'Add' | 'Subtract' | 'Intersect' | 'Lighten' | 'Darken' | 'Difference' | 'None'; opacity?: number; keyframes?: Keyframes };\ntype Animation = { duration?: number /* s; a loop's: one cycle */; easing?: AnimationEasing /* ignored by pop spin_loop fade_loop blur_loop pulsating_loop breathing_loop jump_loop squeeze_loop sway_loop typewriter_text block_swipe_text */; writingStyle?: 'Block' | 'Line' | 'Character' | 'Word' /* text only: slide pan fade blur grow zoom pop wipe baseline spin block_swipe_text */; overlap?: number /* 0–1, text units */ } & (\n | { type: 'slide'; slide?: { direction?: number /* radians: 0 = right, π/2 down, π left, 3π/2 up */; fade?: boolean } }\n | { type: 'pan'; pan?: { direction?: number /* radians, as slide */; distance?: number; fade?: boolean } }\n | { type: 'fade' }\n | { type: 'blur'; blur?: { fade?: boolean; intensity?: number } }\n | { type: 'grow'; grow?: { direction?: 'Horizontal' | 'Vertical' | 'All' | 'TopLeft' | 'TopRight' | 'BottomLeft' | 'BottomRight'; scaleFactor?: number } }\n | { type: 'zoom'; zoom?: { fade?: boolean } }\n | { type: 'pop' }\n | { type: 'wipe'; wipe?: { direction?: 'Up' | 'Right' | 'Down' | 'Left' } }\n | { type: 'baseline'; baseline?: { direction?: 'Up' | 'Right' | 'Down' | 'Left' } }\n | { type: 'crop_zoom'; crop_zoom?: { fade?: boolean; scale?: number } }\n | { type: 'spin'; spin?: { direction?: 'Clockwise' | 'CounterClockwise'; fade?: boolean; intensity?: number } }\n | { type: 'spin_loop'; spin_loop?: { direction?: 'Clockwise' | 'CounterClockwise' } }\n | { type: 'fade_loop' }\n | { type: 'blur_loop'; blur_loop?: { intensity?: number } }\n | { type: 'pulsating_loop'; pulsating_loop?: { intensity?: number } }\n | { type: 'breathing_loop'; breathing_loop?: { intensity?: number } }\n | { type: 'jump_loop'; jump_loop?: { direction?: 'Up' | 'Right' | 'Down' | 'Left'; intensity?: number } }\n | { type: 'squeeze_loop' }\n | { type: 'sway_loop'; sway_loop?: { intensity?: number } }\n | { type: 'scale_loop' }\n | { type: 'typewriter_text'; typewriter_text?: { writingStyle?: 'Character' | 'Word' } }\n | { type: 'block_swipe_text'; block_swipe_text?: { blockColor?: Color; direction?: 'Up' | 'Right' | 'Down' | 'Left'; useTextColor?: boolean } }\n | { type: 'spread_text'; spread_text?: { fade?: boolean; intensity?: number } }\n | { type: 'merge_text'; merge_text?: { direction?: 'Right' | 'Left'; intensity?: number } }\n | { type: 'ken_burns'; ken_burns?: { direction?: 'Up' | 'Right' | 'Down' | 'Left'; fade?: boolean; travelDistanceRatio?: number; zoomIntensity?: number } }\n);\ntype Transition = { duration?: number /* s, default 1.2: overlap with the next clip */; easing?: AnimationEasing /* default EaseInOutQuint */ } & (\n | { type: 'cross-fade'; 'cross-fade'?: { morph?: boolean }; }\n | { type: 'cross-blur'; 'cross-blur'?: { morph?: boolean; sigma?: number }; }\n | { type: 'cross-spin'; 'cross-spin'?: { direction?: 'Clockwise' | 'CounterClockwise'; intensity?: number }; }\n | { type: 'cross-zoom'; 'cross-zoom'?: { morph?: boolean; zoom?: number }; }\n | { type: 'cross-warp'; 'cross-warp'?: { morph?: boolean; zoom?: number }; }\n | { type: 'push'; push?: { direction?: 'Left' | 'Right' | 'Up' | 'Down'; morph?: boolean } }\n | { type: 'slide'; slide?: { direction?: 'Left' | 'Right' | 'Up' | 'Down'; morph?: boolean } }\n | { type: 'stack'; stack?: { direction?: 'Left' | 'Right' | 'Up' | 'Down'; morph?: boolean } }\n | { type: 'splice'; splice?: { bandCount?: number; direction?: 'Left' | 'Right' | 'Up' | 'Down'; morph?: boolean } }\n | { type: 'diagonal-splice'; 'diagonal-splice'?: { direction?: 'RaisedRamp' | 'LoweredRamp'; morph?: boolean }; }\n | { type: 'fade'; fade?: { color?: Color; morph?: boolean } }\n | { type: 'fade-to-white'; 'fade-to-white'?: { morph?: boolean }; }\n | { type: 'fade-to-black'; 'fade-to-black'?: { morph?: boolean }; }\n | { type: 'color-wipe'; 'color-wipe'?: { color?: Color; direction?: 'Left' | 'Right' | 'Up' | 'Down'; morph?: boolean }; }\n | { type: 'line-wipe'; 'line-wipe'?: { morph?: boolean }; }\n | { type: 'wipe'; wipe?: { direction?: 'Left' | 'Right' | 'Up' | 'Down'; morph?: boolean } }\n | { type: 'clock-wipe' }\n | { type: 'chop'; chop?: { corner?: 'TopLeft' | 'TopRight' | 'BottomLeft' | 'BottomRight'; direction?: 'Clockwise' | 'CounterClockwise'; morph?: boolean } }\n | { type: 'gradient-fade'; 'gradient-fade'?: { color?: Color; direction?: 'Left' | 'Right' | 'Up' | 'Down'; morph?: boolean }; }\n | { type: 'two-stripes'; 'two-stripes'?: { direction?: 'Horizontal' | 'Vertical'; morph?: boolean }; }\n);\n// ---- vocabulary referenced above (hoisted from the upstream core) ----\ninterface CMYKColor {\n c: number;\n m: number;\n y: number;\n k: number;\n tint?: number /* 0..1, default 1 */;\n}\ninterface Font {\n uri: string;\n subFamily?: string;\n weight?: FontWeight;\n style?: FontStyle;\n}\ninterface GradientColorStop {\n color: Color;\n stop: number;\n}\ninterface RGBAColor {\n r: number;\n g: number;\n b: number;\n a: number;\n}\ninterface Source {\n uri: string;\n width: number;\n height: number;\n}\ninterface SpotColor {\n name: string /* a spotColors ink */;\n tint?: number /* 0..1, default 1 */;\n externalReference?: string /* default '' */;\n}\ninterface TextDecorationConfig {\n lines: TextDecorationLine[];\n style?: TextDecorationStyle;\n underlineColor?: Color;\n underlineThickness?: number;\n underlineOffset?: number;\n skipInk?: boolean;\n}\ninterface Typeface {\n name: string;\n fonts: Font[];\n}\ntype AnimationEasing = 'Linear' | 'EaseIn' | 'EaseOut' | 'EaseInOut' | 'EaseInQuart' | 'EaseOutQuart' | 'EaseInOutQuart' | 'EaseInQuint' | 'EaseOutQuint' | 'EaseInOutQuint' | 'EaseInBack' | 'EaseOutBack' | 'EaseInOutBack' | 'EaseInSpring' | 'EaseOutSpring' | 'EaseInOutSpring';\ntype Color = RGBAColor | CMYKColor | SpotColor;\ntype DesignBlockId = number;\ntype DesignBlockType = 'scene' | 'stack' | 'camera' | 'page' | 'graphic' | 'audio' | 'text' | 'group' | 'cutout' | 'track' | 'caption' | 'captionTrack' | 'exclusionArea'; // each also valid as '//ly.img.ubq/<name>'\ntype FontStyle = 'normal' | 'italic';\ntype FontWeight = 'thin' | 'extraLight' | 'light' | 'normal' | 'medium' | 'semiBold' | 'bold' | 'extraBold' | 'heavy';\ntype ListStyle = 'None' | 'Unordered' | 'Ordered';\ntype Scope = 'text/edit' | 'text/character' | 'fill/change' | 'fill/changeType' | 'stroke/change' | 'shape/change' | 'layer/move' | 'layer/resize' | 'layer/rotate' | 'layer/flip' | 'layer/crop' | 'layer/opacity' | 'layer/blendMode' | 'layer/visibility' | 'layer/clipping' | 'appearance/adjustments' | 'appearance/filter' | 'appearance/effect' | 'appearance/blur' | 'appearance/shadow' | 'appearance/animation' | 'lifecycle/destroy' | 'lifecycle/duplicate' | 'editor/add' | 'editor/select';\ntype ScriptStyle = 'Normal' | 'Superscript' | 'Subscript';\ntype TextCase = 'Normal' | 'Uppercase' | 'Lowercase' | 'Titlecase';\ntype TextDecorationLine = 'None' | 'Underline' | 'Strikethrough' | 'Overline';\ntype TextDecorationStyle = 'Solid' | 'Double' | 'Dotted' | 'Dashed' | 'Wavy';\n\n// ============================================================================\n// Upstream CE.SDK surface (flattened) follows — REFERENCE ONLY: edit code\n// never calls it; engine.design above covers it. Exports are the export tool.\n// ============================================================================\n// engine.design's setSettings/getSettings (kept here, outside the inline\n// section, for its size): editor settings in the props dialect.\ninterface SettingsProps {\n archival?: { bundleOnlyUsedFontVariants?: boolean };\n basePath?: string;\n blockAnimations?: { enabled?: boolean };\n borderOutlineColor?: Color;\n camera?: {\n clamping?: { overshootMode?: 'Center' | 'Reverse' };\n };\n clampThumbnailTextureSizes?: boolean;\n clearColor?: Color;\n clip?: { defaultDurationValue?: number; initialDurationMode?: 'default' | 'followParent' };\n colorMaskingSettings?: { maskColor?: Color };\n colorPicker?: { colorMode?: string };\n controlGizmo?: {\n blockScaleDownLimit?: number;\n moveHandleVisibility?: 'auto' | 'always' | 'never';\n resizeHandlesVisibility?: 'auto' | 'always' | 'never';\n rotateHandlesVisibility?: 'auto' | 'always' | 'never';\n scaleHandlesVisibility?: 'auto' | 'always' | 'never';\n showCropHandles?: boolean;\n showCropScaleHandles?: boolean;\n };\n cropOverlayColor?: Color;\n defaultEmojiFontFileUri?: string;\n defaultFontFileUri?: string;\n doubleClickSelectionMode?: 'Direct' | 'Hierarchical';\n doubleClickToCropEnabled?: boolean;\n dragToSwapFills?: { enabled?: boolean; longPressDurationMs?: number };\n errorStateColor?: Color;\n exportPendingTimeoutSeconds?: number;\n fallbackCMYKProfileUri?: string;\n fallbackFontUri?: string;\n forceSystemEmojis?: boolean;\n grid?: { color?: Color; enabled?: boolean; snapEnabled?: boolean; spacingX?: number; spacingY?: number };\n handleFillColor?: Color;\n highlightColor?: Color;\n license?: string;\n listIndentPerLevel?: number /* em per level */;\n maxConcurrentRequestsPerHost?: number;\n maxImageSize?: number;\n maxPreviewResolution?: number;\n mouse?: { enableScroll?: boolean; enableZoom?: boolean };\n page?: {\n allowCropInteraction?: boolean;\n allowMoveInteraction?: boolean;\n allowResizeInteraction?: boolean;\n allowRotateInteraction?: boolean;\n allowShapeChange?: boolean;\n dimOutOfPageAreas?: boolean;\n exclusionAreaFillColor?: Color;\n exclusionAreaFrameColor?: Color;\n flipDimensionsOn90DegreeCropRotation?: boolean;\n highlightDropTarget?: boolean;\n highlightWhenCropping?: boolean;\n imageFillCoversBleed?: boolean;\n innerBorderColor?: Color;\n marginFillColor?: Color;\n marginFrameColor?: Color;\n marqueeSelectOnBodyDrag?: boolean;\n moveChildrenWhenCroppingFill?: boolean;\n outerBorderColor?: Color;\n reparentBlocksToSceneWhenOutOfPage?: boolean;\n restrictPageSelectionToBorderAndTitle?: boolean;\n restrictResizeInteractionToFixedAspectRatio?: boolean;\n safetyFillColor?: Color;\n safetyFrameColor?: Color;\n safetyRevealDuringTransform?: boolean;\n selectWhenNoBlocksSelected?: boolean;\n title?: {\n appendPageName?: boolean;\n canEdit?: boolean;\n color?: Color;\n fontFileUri?: string;\n separator?: string;\n show?: boolean;\n showOnSinglePage?: boolean;\n showPageTitleTemplate?: boolean;\n };\n };\n pageHighlightColor?: Color;\n placeholderControls?: { showButton?: boolean; showOverlay?: boolean };\n placeholderHighlightColor?: Color;\n playback?: { showAllBlocks?: boolean };\n positionSnappingThreshold?: number;\n progressColor?: Color;\n rotationSnappingGuideColor?: Color;\n rotationSnappingThreshold?: number;\n showBuildVersion?: boolean;\n snappingGuideColor?: Color;\n tabStopInterval?: number;\n textVariableHighlightColor?: Color;\n timeline?: { trackVisibility?: string };\n touch?: {\n dragStartCanSelect?: boolean;\n pinchAction?: 'None' | 'Zoom' | 'Scale' | 'Auto' | 'Dynamic';\n rotateAction?: 'None' | 'Rotate';\n singlePointPanning?: boolean;\n };\n upload?: { supportedMimeTypes?: string };\n useSystemFontFallback?: boolean;\n web?: { fetchCredentials?: string };\n}\n// engine.design's effects: [...] (kept here, outside the inline section, for its\n// size): one arm per effect type, its options under a key named after it.\ntype Effect = { enabled?: boolean; keyframes?: Keyframes } & (\n | { type: 'adjustments'; adjustments?: { blacks?: number; brightness?: number; clarity?: number; contrast?: number; exposure?: number; gamma?: number; highlights?: number; saturation?: number; shadows?: number; sharpness?: number; temperature?: number; whites?: number } }\n | { type: 'bulge'; bulge?: { centerX?: number; centerY?: number; height?: number; horizontalRadius?: number; verticalRadius?: number } }\n | { type: 'corner_pin'; corner_pin?: { lowerLeftX?: number; lowerLeftY?: number; lowerRightX?: number; lowerRightY?: number; upperLeftX?: number; upperLeftY?: number; upperRightX?: number; upperRightY?: number } }\n | { type: 'cross_cut'; cross_cut?: { offset?: number; slices?: number; speedV?: number; time?: number } }\n | { type: 'displacement_map'; displacement_map?: { horizontalChannel?: 'Red' | 'Green' | 'Blue' | 'Alpha' | 'Luminance' | 'Hue' | 'Lightness' | 'Saturation' | 'Full' | 'Half' | 'Off'; mapBehavior?: 'Center' | 'Stretch' | 'Tile'; maxHorizontal?: number; maxVertical?: number; verticalChannel?: 'Red' | 'Green' | 'Blue' | 'Alpha' | 'Luminance' | 'Hue' | 'Lightness' | 'Saturation' | 'Full' | 'Half' | 'Off'; wrapPixels?: boolean } }\n | { type: 'dot_pattern'; dot_pattern?: { blur?: number; dots?: number; size?: number } }\n | { type: 'duotone_filter'; duotone_filter?: { darkColor?: Color; intensity?: number; lightColor?: Color } }\n | { type: 'extrude_blur'; extrude_blur?: { amount?: number } }\n | { type: 'fill'; fill?: { color?: Color; opacity?: number } }\n | { type: 'glow'; glow?: { amount?: number; darkness?: number; size?: number } }\n | { type: 'green_screen'; green_screen?: { colorMatch?: number; fromColor?: Color; smoothness?: number; spill?: number } }\n | { type: 'half_tone'; half_tone?: { angle?: number; scale?: number } }\n | { type: 'invert'; invert?: { channel?: 'RGB' | 'Red' | 'Green' | 'Blue' | 'HLS' | 'Hue' | 'Lightness' | 'Saturation' | 'YIQ' | 'Luma' | 'InPhaseChroma' | 'QuadratureChroma' | 'Alpha' } }\n | { type: 'levels'; levels?: { alphaGamma?: number; alphaInBlack?: number; alphaInWhite?: number; alphaOutBlack?: number; alphaOutWhite?: number; blueGamma?: number; blueInBlack?: number; blueInWhite?: number; blueOutBlack?: number; blueOutWhite?: number; clipToOutBlack?: boolean; clipToOutWhite?: boolean; greenGamma?: number; greenInBlack?: number; greenInWhite?: number; greenOutBlack?: number; greenOutWhite?: number; redGamma?: number; redInBlack?: number; redInWhite?: number; redOutBlack?: number; redOutWhite?: number; rgbGamma?: number; rgbInBlack?: number; rgbInWhite?: number; rgbOutBlack?: number; rgbOutWhite?: number } }\n | { type: 'linear_wipe'; linear_wipe?: { angle?: number; completion?: number; feather?: number } }\n | { type: 'linocut'; linocut?: { scale?: number } }\n | { type: 'liquid'; liquid?: { amount?: number; scale?: number; time?: number } }\n | { type: 'lut_filter'; lut_filter?: { filterId?: string; horizontalTileCount?: number; intensity?: number; lutFileURI?: string; verticalTileCount?: number } }\n | { type: 'mirror'; mirror?: { side?: number } }\n | { type: 'outliner'; outliner?: { amount?: number; passthrough?: number } }\n | { type: 'pixelize'; pixelize?: { horizontalPixelSize?: number; verticalPixelSize?: number } }\n | { type: 'posterize'; posterize?: { levels?: number } }\n | { type: 'radial_pixel'; radial_pixel?: { radius?: number; segments?: number } }\n | { type: 'radial_wipe'; radial_wipe?: { centerX?: number; centerY?: number; completion?: number; direction?: 'Clockwise' | 'Counterclockwise' | 'Both'; feather?: number; startAngle?: number } }\n | { type: 'recolor'; recolor?: { brightnessMatch?: number; colorMatch?: number; fromColor?: Color; smoothness?: number; toColor?: Color } }\n | { type: 'sharpie' }\n | { type: 'shift_channels'; shift_channels?: { takeAlphaFrom?: 'Alpha' | 'Red' | 'Green' | 'Blue' | 'Luminance' | 'Hue' | 'Lightness' | 'Saturation' | 'FullOn' | 'FullOff'; takeBlueFrom?: 'Alpha' | 'Red' | 'Green' | 'Blue' | 'Luminance' | 'Hue' | 'Lightness' | 'Saturation' | 'FullOn' | 'FullOff'; takeGreenFrom?: 'Alpha' | 'Red' | 'Green' | 'Blue' | 'Luminance' | 'Hue' | 'Lightness' | 'Saturation' | 'FullOn' | 'FullOff'; takeRedFrom?: 'Alpha' | 'Red' | 'Green' | 'Blue' | 'Luminance' | 'Hue' | 'Lightness' | 'Saturation' | 'FullOn' | 'FullOff' } }\n | { type: 'shifter'; shifter?: { amount?: number; angle?: number } }\n | { type: 'stroke'; stroke?: { allMasks?: boolean; brushSize?: number; color?: Color; end?: number; hardness?: number; maskIndex?: number; opacity?: number; paintStyle?: 'OnOriginalImage' | 'OnTransparent'; spacing?: number; start?: number } }\n | { type: 'threshold'; threshold?: { level?: number } }\n | { type: 'tilt_shift'; tilt_shift?: { amount?: number; position?: number } }\n | { type: 'tint'; tint?: { amount?: number; mapBlackTo?: Color; mapWhiteTo?: Color } }\n | { type: 'tritone'; tritone?: { amount?: number; highlights?: Color; midtones?: Color; shadows?: Color } }\n | { type: 'tv_glitch'; tv_glitch?: { distortion?: number; distortion2?: number; rollSpeed?: number; speed?: number } }\n | { type: 'venetian_blinds'; venetian_blinds?: { completion?: number; direction?: number; feather?: number; width?: number } }\n | { type: 'vignette'; vignette?: { darkness?: number; offset?: number } }\n | { type: 'wave_warp'; wave_warp?: { direction?: number; height?: number; phase?: number; waveType?: 'Sine' | 'Square' | 'Triangle' | 'Sawtooth'; width?: number } }\n);\n// engine.design's text.animators[i] / caption.animators[i] (kept here, outside\n// the inline section, for its size): a range selector over the glyphs and what\n// it does to them. Writing opacity/fillColor/strokeColor sets its *Enabled.\n// selectorStart/End/Offset: 0..1 of the text, or unit indices (end exclusive) with selectorUnits 'Index'; rotation: radians; skew/skewAxis: radians; lengths: design units, +y down; strokeWidth: needs the text stroke.enabled\ninterface TextAnimator {\n anchorX?: number | string; anchorY?: number | string; blurX?: number | string; blurY?: number | string;\n fillColor?: Color; fillColorEnabled?: boolean; opacity?: number; opacityEnabled?: boolean;\n positionX?: number | string; positionY?: number | string; rotation?: number; scaleX?: number; scaleY?: number;\n selectorAmount?: number; selectorBasedOn?: 'Characters' | 'CharactersExcludingSpaces' | 'Words' | 'Lines';\n selectorEaseHigh?: number; selectorEaseLow?: number; selectorEnabled?: boolean; selectorEnd?: number;\n selectorOffset?: number; selectorRandomize?: boolean; selectorSeed?: number;\n selectorShape?: 'Square' | 'RampUp' | 'RampDown' | 'Triangle' | 'Round' | 'Smooth';\n selectorSmoothness?: number; selectorStart?: number; selectorUnits?: 'Percentage' | 'Index'; skew?: number;\n skewAxis?: number; strokeColor?: Color; strokeColorEnabled?: boolean; strokeWidth?: number | string;\n tracking?: number | string; keyframes?: { [leaf: string]: unknown };\n}\n// Scalar get/set wrappers (setOpacity, setStrokeWidth, setPositionX, …),\n// is*/supports*/has* predicates, and editor-UI machinery are in\n// signatures-extended.d.ts — prefer engine.design.setProps/getProps/\n// getCapabilities and the capability matrix above; search the sibling\n// file signatures-extended.d.ts when you need the old names.\n\n// CE.SDK CreativeEngine — flattened API signatures. GENERATED by\n// scripts/lib/api-signatures.ts from the @cesdk/node index.d.ts; do not\n// edit. JSDoc is stripped, deprecated overloads with a surviving\n// namesake are dropped, and type aliases are flattened to their literal\n// unions so every string vocabulary is one lookup. Recipes live in\n// the api skill's recipes.md; this file is the exact call surface.\ntype AbortOptions = {\n abortSignal?: AbortSignal;\n};\ntype AddImageOptions = {\n sizeMode?: SizeMode;\n positionMode?: PositionMode;\n x?: number;\n y?: number;\n cornerRadius?: number;\n size?: number | {\n width: number;\n height: number;\n };\n timeline?: {\n timeOffset?: number;\n duration?: number;\n };\n shadow?: DropShadowOptions;\n animation?: AnimationOptions;\n};\ninterface AddVideoOptions {\n sizeMode?: SizeMode;\n positionMode?: PositionMode;\n x?: number;\n y?: number;\n cornerRadius?: number;\n timeline?: {\n timeOffset?: number;\n duration?: number;\n };\n shadow?: DropShadowOptions;\n animation?: AnimationOptions;\n}\ntype AnimationEntry = {\n type: AnimationType;\n duration: number;\n easing?: AnimationEasing;\n};\ntype AnimationOptions = {\n in?: AnimationEntry;\n loop?: AnimationEntry;\n out?: AnimationEntry;\n};\ntype AnimationType = 'slide' | 'pan' | 'fade' | 'blur' | 'grow' | 'zoom' | 'pop' | 'wipe' | 'baseline' | 'crop_zoom' | 'spin' | 'spin_loop' | 'fade_loop' | 'blur_loop' | 'pulsating_loop' | 'breathing_loop' | 'jump_loop' | 'squeeze_loop' | 'sway_loop' | 'scale_loop' | 'typewriter_text' | 'block_swipe_text' | 'spread_text' | 'merge_text' | 'ken_burns'; // each also valid as '//ly.img.ubq/animation/<name>'\ntype AnimationTypeLonghand = `//ly.img.ubq/animation/${AnimationTypeShorthand}`;\ntype AnimationTypeShorthand = 'slide' | 'pan' | 'fade' | 'blur' | 'grow' | 'zoom' | 'pop' | 'wipe' | 'baseline' | 'crop_zoom' | 'spin' | 'spin_loop' | 'fade_loop' | 'blur_loop' | 'pulsating_loop' | 'breathing_loop' | 'jump_loop' | 'squeeze_loop' | 'sway_loop' | 'scale_loop' | 'typewriter_text' | 'block_swipe_text' | 'spread_text' | 'merge_text' | 'ken_burns';\ninterface ApplyAssetOptions {\n clipType?: 'clip' | 'overlay';\n placement?: AssetPlacement;\n abortSignal?: AbortSignal;\n [key: string]: unknown;\n}\ninterface Asset {\n id: string;\n groups?: AssetGroups;\n meta?: AssetMetaData;\n payload?: AssetPayload;\n}\nclass AssetAPI {\n #private;\n addSource(source: AssetSource): void;\n addLocalSource(id: string, supportedMimeTypes?: string[], applyAsset?: (asset: CompleteAssetResult) => Promise<DesignBlockId | undefined>, applyAssetToBlock?: (asset: CompleteAssetResult, block: DesignBlockId) => Promise<void>): void;\n addLocalAssetSourceFromJSONString(contentJSON: string, basePath?: string, options?: {\n matcher?: string[];\n }): Promise<string>;\n addLocalAssetSourceFromJSONURI(contentURI: string, options?: {\n matcher?: string[];\n abortSignal?: AbortSignal;\n }): Promise<string>;\n removeSource(id: string): void;\n findAllSources(): string[];\n findAssets(sourceId: string, query: AssetQueryData): Promise<AssetsQueryResult<CompleteAssetResult>>;\n fetchAsset(sourceId: string, assetId: string, params?: Pick<AssetQueryData, 'locale'>): Promise<CompleteAssetResult | null>;\n getSupportedMimeTypes(sourceId: string): string[];\n /** @deprecated The flag this reads is deprecated. To control whether an upload button is rendered, use the `canAdd` option on an asset library entry instead. */\n canManageAssets(sourceId: string): boolean;\n addAssetToSource(sourceId: string, asset: AssetDefinition): void;\n removeAssetFromSource(sourceId: string, assetId: string): void;\n apply(sourceId: string, assetResult: AssetResult, options?: ApplyAssetOptions): Promise<DesignBlockId | undefined>;\n applyToBlock(sourceId: string, assetResult: AssetResult, block: DesignBlockId): Promise<void>;\n applyProperty(sourceId: string, assetResult: AssetResult, property: AssetProperty): Promise<void>;\n defaultApplyAsset(assetResult: AssetResult, options?: DefaultApplyAssetOptions): Promise<DesignBlockId | undefined>;\n defaultApplyAssetToBlock(assetResult: AssetResult, block: DesignBlockId): Promise<void>;\n onAssetSourceAdded: (callback: (sourceID: string) => void) => (() => void);\n onAssetSourceRemoved: (callback: (sourceID: string) => void) => (() => void);\n onAssetSourceUpdated: (callback: (sourceID: string) => void) => (() => void);\n}\ninterface AssetBooleanProperty {\n property: string;\n type: 'Boolean';\n value: boolean;\n defaultValue: boolean;\n}\ninterface AssetCMYKColor {\n colorSpace: 'CMYK';\n c: number;\n m: number;\n y: number;\n k: number;\n}\ntype AssetColor = AssetRGBColor | AssetCMYKColor | AssetSpotColor;\ninterface AssetColorProperty {\n property: string;\n type: 'Color';\n value: Color;\n defaultValue: Color;\n}\ninterface AssetContentAspectRatio {\n type: 'ContentAspectRatio';\n}\ninterface AssetDefinition extends Asset {\n label?: Record<Locale, string>;\n tags?: Record<Locale, string[]>;\n}\ninterface AssetDropPayload {\n sourceId: string;\n assetId: string;\n target: DesignBlockId | null;\n page: DesignBlockId | null;\n pageX: number;\n pageY: number;\n}\ninterface AssetEnumProperty {\n property: string;\n type: 'Enum';\n value: string;\n defaultValue: string;\n options: string[];\n}\ntype AssetFacetPath = 'tags' | 'groups' | `meta.${string}`;\ninterface AssetFacetValue {\n value: string;\n count?: number;\n}\ntype AssetFilter = AssetPropertyFilter | {\n and: AssetFilter[];\n or?: never;\n not?: never;\n property?: never;\n} | {\n or: AssetFilter[];\n and?: never;\n not?: never;\n property?: never;\n} | {\n not: AssetFilter;\n and?: never;\n or?: never;\n property?: never;\n};\ninterface AssetFixedAspectRatio {\n type: 'FixedAspectRatio';\n width: number;\n height: number;\n}\ninterface AssetFixedSize {\n type: 'FixedSize';\n width: number;\n height: number;\n designUnit: DesignUnit;\n}\ninterface AssetFreeAspectRatio {\n type: 'FreeAspectRatio';\n}\ntype AssetGroups = string[];\ntype AssetMetaData = {\n mimeType?: string;\n blockType?: string;\n fillType?: string;\n shapeType?: string;\n kind?: string;\n uri?: string;\n thumbUri?: string;\n previewUri?: string;\n sourceSet?: Source[];\n filename?: string;\n vectorPath?: string;\n width?: number;\n height?: number;\n duration?: string;\n effectType?: string;\n blurType?: string;\n looping?: boolean;\n} & Record<string, unknown>;\ninterface AssetNumberProperty {\n property: string;\n type: 'Int' | 'Float' | 'Double';\n value: number;\n defaultValue: number;\n min: number;\n max: number;\n step: number;\n}\ninterface AssetPayload {\n color?: AssetColor;\n sourceSet?: Source[];\n typeface?: Typeface;\n transformPreset?: AssetTransformPreset;\n properties?: AssetProperty[];\n stylePreset?: AssetStylePreset;\n}\ninterface AssetPlacement {\n parent?: DesignBlockId;\n center?: {\n x: number;\n y: number;\n };\n}\ntype AssetProperty = AssetBooleanProperty | AssetColorProperty | AssetEnumProperty | AssetNumberProperty | AssetStringProperty;\ntype AssetPropertyFilter = {\n property: AssetPropertyPath;\n} & ({\n contains: string;\n equals?: never;\n} | {\n equals: string;\n contains?: never;\n});\ntype AssetPropertyPath = 'label' | 'tags' | 'id' | 'groups' | `meta.${string}`;\ninterface AssetQueryData {\n query?: string;\n page: number;\n tags?: string | string[];\n groups?: AssetGroups;\n excludeGroups?: AssetGroups;\n locale?: Locale;\n perPage: number;\n sortingOrder?: SortingOrder;\n sortKey?: string;\n sortActiveFirst?: boolean;\n filter?: AssetFilter[];\n facets?: AssetFacetPath[];\n}\ninterface AssetResult extends Asset {\n locale?: Locale;\n label?: string;\n tags?: string[];\n active?: boolean;\n credits?: {\n name: string;\n url?: string;\n };\n license?: {\n name: string;\n url?: string;\n };\n utm?: {\n source?: string;\n medium?: string;\n };\n}\ninterface AssetRGBColor {\n colorSpace: 'sRGB';\n r: number;\n g: number;\n b: number;\n}\ninterface AssetSource {\n id: string;\n findAssets(queryData: AssetQueryData): Promise<AssetsQueryResult | undefined>;\n fetchAsset?: (id: string, params?: Pick<AssetQueryData, 'locale'>) => Promise<AssetResult | null>;\n getGroups?: () => Promise<string[]>;\n credits?: {\n name: string;\n url?: string;\n };\n license?: {\n name: string;\n url?: string;\n };\n /** @deprecated Will be removed in v1.11. Use `canAdd` and `canRemove` in the asset library configuration */\n canManageAssets?: boolean;\n applyAsset?: (asset: CompleteAssetResult) => Promise<DesignBlockId | undefined>;\n applyAssetToBlock?: (asset: CompleteAssetResult, block: DesignBlockId) => Promise<void>;\n applyAssetProperty?: (asset: CompleteAssetResult, property: AssetProperty) => Promise<void>;\n addAsset?(asset: AssetDefinition): void;\n removeAsset?(assetId: string): void;\n getSupportedMimeTypes?(): string[] | undefined;\n}\ninterface AssetSpotColor {\n colorSpace: 'SpotColor';\n name: string;\n externalReference: string;\n representation: AssetRGBColor | AssetCMYKColor;\n}\ninterface AssetsQueryResult<T extends AssetResult = AssetResult> {\n assets: T[];\n currentPage: number;\n nextPage?: number;\n total: number;\n facets?: {\n [path: string]: AssetFacetValue[];\n };\n}\ninterface AssetStringProperty {\n property: string;\n type: 'String';\n value: string;\n defaultValue: string;\n}\ninterface AssetStylePreset {\n blockType?: '//ly.img.ubq/text' | '//ly.img.ubq/caption';\n mode?: 'replace' | 'merge';\n keepExisting?: AssetStylePresetKeptProperty[];\n typeface?: {\n family: string;\n weight?: FontWeight;\n style?: FontStyle;\n };\n fontSize?: {\n scale: number;\n resizeExistingOnApply?: boolean;\n };\n scaleWithFontSize?: Array<{\n property: AssetStylePresetScalableProperty;\n ratio: number;\n }>;\n properties?: AssetStylePresetProperties;\n inAnimation?: AssetStylePresetAnimation;\n outAnimation?: AssetStylePresetAnimation;\n loopAnimation?: AssetStylePresetAnimation;\n}\ninterface AssetStylePresetAnimation {\n type: AnimationTypeLonghand;\n properties?: AssetStylePresetAnimationProperties;\n}\ntype AssetStylePresetAnimationProperties = {\n [K in Extract<BoolPropertyName, `animation/${string}`>]?: boolean;\n} & {\n [K in Extract<EnumPropertyName, `animation/${string}`>]?: string;\n} & {\n [K in Extract<FloatPropertyName, `animation/${string}`>]?: number;\n} & {\n [K in Extract<ColorPropertyName, `animation/${string}`>]?: RGBColor | RGBAColor;\n} & {\n 'playback/duration'?: number;\n animationEasing?: string;\n textWritingStyle?: string;\n textWritingOverlap?: number;\n} & {\n [path: string]: AssetStylePresetPropertyValue;\n};\ntype AssetStylePresetKeptProperty = 'text' | 'typeface' | 'fontSize' | 'path' | 'case' | 'text/path' | 'text/case' | BoolPropertyName | IntPropertyName | FloatPropertyName | DoublePropertyName | StringPropertyName | EnumPropertyName | ColorPropertyName;\ntype AssetStylePresetProperties = {\n [K in BoolPropertyName as string extends K ? never : K]?: boolean;\n} & {\n [K in IntPropertyName as string extends K ? never : K]?: number;\n} & {\n [K in FloatPropertyName as string extends K ? never : K]?: number;\n} & {\n [K in DoublePropertyName as string extends K ? never : K]?: number;\n} & {\n [K in StringPropertyName as string extends K ? never : K]?: string;\n} & {\n [K in EnumPropertyName as string extends K ? never : K]?: string;\n} & {\n [K in ColorPropertyName as string extends K ? never : K]?: RGBColor | RGBAColor;\n} & {\n 'text/path'?: string | null;\n} & {\n [path: string]: AssetStylePresetPropertyValue;\n};\ntype AssetStylePresetPropertyValue = boolean | number | string | RGBColor | RGBAColor | null;\ntype AssetStylePresetScalableProperty = 'stroke/width' | 'dropShadow/offset/x' | 'dropShadow/offset/y' | 'dropShadow/blurRadius/x' | 'dropShadow/blurRadius/y' | 'backgroundColor/cornerRadius';\ntype AssetTransformPreset = AssetFixedAspectRatio | AssetFreeAspectRatio | AssetContentAspectRatio | AssetFixedSize;\ntype AsyncURIResolver = (URI: string, defaultURIResolver: (URI: string) => string) => Promise<string> | string;\nconst AudioCodec: {\n readonly Auto: 0;\n readonly AAC: 1;\n readonly Opus: 2;\n readonly Vorbis: 3;\n};\ntype AudioCodec = (typeof AudioCodec)[keyof typeof AudioCodec];\nclass BlockAPI {\n #private;\n getDominantColors(handle: DesignBlockId, options?: DominantColorsOptions): Promise<DominantColor[]>;\n exportPreview(handle: DesignBlockId): Promise<Blob>;\n onSelectionChanged: (callback: () => void) => (() => void);\n onClicked: (callback: (id: DesignBlockId) => void) => (() => void);\n enterGroup(id: DesignBlockId): void;\n exitGroup(id: DesignBlockId): void;\n isCombinable(ids: DesignBlockId[]): boolean;\n combine(ids: DesignBlockId[], op: BooleanOperation): DesignBlockId;\n findByKind(kind: string): DesignBlockId[];\n findAll(): DesignBlockId[];\n findAllUnused(): DesignBlockId[];\n findAllInExclusionAreas(): DesignBlockId[];\n removeSubshape(id: DesignBlockId, index: number): void;\n isLineOrigin(id: DesignBlockId): boolean;\n isValid(id: DesignBlockId): boolean;\n getScreenSpaceBoundingBoxXYWH(ids: DesignBlockId[]): XYWH;\n isPropertyReadable(property: string): boolean;\n isPropertyWritable(property: string): boolean;\n getPropertyType(property: string): PropertyType;\n getEnumValues<T = string>(enumProperty: string): T[];\n /** @deprecated Use getColor() instead. */\n getColorSpotName(id: DesignBlockId, property: string): string;\n /** @deprecated Use getColor() instead. */\n getColorSpotTint(id: DesignBlockId, property: string): number;\n addVideoFileURIToSourceSet(id: DesignBlockId, property: SourceSetPropertyName, uri: string, options?: AbortOptions): Promise<void>;\n isCropAspectRatioLocked(id: DesignBlockId): boolean;\n canRevertToOriginalRatio(id: DesignBlockId): boolean;\n removeModifier(id: DesignBlockId, index: number): void;\n isEffectEnabled(effectId: DesignBlockId): boolean;\n createCutoutFromBlocks(ids: DesignBlockId[], vectorizeDistanceThreshold?: number, simplifyDistanceThreshold?: number, useExistingShapeInformation?: boolean): DesignBlockId;\n createCutoutFromPath(path: string): DesignBlockId;\n createCutoutFromOperation(ids: DesignBlockId[], op: CutoutOperation): DesignBlockId;\n removeText(id: DesignBlockId, from?: number, to?: number): void;\n setTextBackgroundColor(id: DesignBlockId, color: Color, from?: number, to?: number): void;\n getTextBackgroundColors(id: DesignBlockId, from?: number, to?: number): Array<Color>;\n getTextScriptStyles(id: DesignBlockId, from?: number, to?: number): ScriptStyle[];\n setTextScriptStyle(id: DesignBlockId, scriptStyle: ScriptStyle, from?: number, to?: number): void;\n getTextDecorations(id: DesignBlockId, from?: number, to?: number): TextDecorationConfig[];\n canToggleBoldFont(id: DesignBlockId, from?: number, to?: number): boolean;\n canToggleItalicFont(id: DesignBlockId, from?: number, to?: number): boolean;\n getTextCursorRange(): Range_2;\n setTextCursorRange(range: Range_2): void;\n getTextVisibleLineGlobalBoundingBoxXYWH(id: DesignBlockId, lineIndex: number): XYWH;\n getTextEffectiveHorizontalAlignment(id: DesignBlockId): 'Left' | 'Right' | 'Center' | 'Justify';\n isPlaceholderControlsOverlayEnabled(id: DesignBlockId): boolean;\n isPlaceholderControlsButtonEnabled(id: DesignBlockId): boolean;\n setPageDurationSource(page: DesignBlockId, id: DesignBlockId): void;\n isPageDurationSource(id: DesignBlockId): boolean;\n removePageDurationSource(id: DesignBlockId): void;\n split(id: DesignBlockId, atTime: number, options?: SplitOptions): DesignBlockId;\n /** @deprecated Use `getDuration` and pass a page block. */\n getTotalSceneDuration(scene: DesignBlockId): number;\n isVisibleAtCurrentPlaybackTime(id: DesignBlockId): boolean;\n isForceMuted(id: DesignBlockId): boolean;\n setAudioFadeIn(id: DesignBlockId, duration: number, easing?: AnimationEasing): void;\n setAudioFadeOut(id: DesignBlockId, duration: number, easing?: AnimationEasing): void;\n unstable_isAVResourceLoaded(id: DesignBlockId): boolean;\n unstable_setImportedImageDefinition(id: DesignBlockId, definition: ImportedImageDefinitionInput): void;\n unstable_getImportedImageDefinition(id: DesignBlockId): ImportedImageDefinitionInfo;\n getVideoWidth(id: DesignBlockId): number;\n getVideoHeight(id: DesignBlockId): number;\n generateVideoThumbnailSequence(id: DesignBlockId, thumbnailHeight: number, timeBegin: number, timeEnd: number, numberOfFrames: number, onFrame: (frameIndex: number, result: ImageData | Error) => void): () => void;\n /** @deprecated Use `generateVideoThumbnailSequence` instead. */\n getVideoFillThumbnail(id: DesignBlockId, thumbnailHeight: number): Promise<Blob>;\n /** @deprecated Use `generateVideoThumbnailSequence` instead. */\n getVideoFillThumbnailAtlas(id: DesignBlockId, numberOfColumns: number, numberOfRows: number, thumbnailHeight: number): Promise<Blob>;\n /** @deprecated Use `generateVideoThumbnailSequence` instead. */\n getPageThumbnailAtlas(id: DesignBlockId, numberOfColumns: number, numberOfRows: number, thumbnailHeight: number): Promise<Blob>;\n setNativePixelBuffer(id: number, buffer: HTMLCanvasElement | HTMLVideoElement): void;\n getState(id: DesignBlockId): BlockState;\n setState(id: DesignBlockId, state: BlockState): void;\n onStateChanged: (ids: DesignBlockId[], callback: (ids: DesignBlockId[]) => void) => (() => void);\n addImage(url: string, options?: AddImageOptions): Promise<DesignBlockId>;\n addVideo(url: string, width: number, height: number, options?: AddVideoOptions): Promise<DesignBlockId>;\n applyAnimation(block: DesignBlockId, animation?: AnimationOptions): void;\n applyDropShadow(block: DesignBlockId, options?: DropShadowOptions): void;\n generateThumbnailAtTimeOffset(height: number, time: number): Promise<Blob>;\n getBackgroundTrack(): DesignBlockId | null;\n moveToBackgroundTrack(block: DesignBlockId): void;\n}\ninterface BlockEvent {\n block: DesignBlockId;\n type: 'Created' | 'Updated' | 'Destroyed';\n}\ntype BlockState = BlockStateError | BlockStatePending | BlockStateReady;\ninterface BlockStateError {\n type: 'Error';\n error: 'AudioDecoding' | 'ImageDecoding' | 'FileFetch' | 'Unknown' | 'VideoDecoding';\n engineError?: EngineError;\n}\ninterface BlockStatePending {\n type: 'Pending';\n progress: number;\n}\ninterface BlockStateReady {\n type: 'Ready';\n}\ntype BooleanOperation = 'Difference' | 'Intersection' | 'Union' | 'XOR';\ntype BoolPropertyName = 'alwaysOnBottom' | 'alwaysOnTop' | 'clipped' | 'flip/horizontal' | 'flip/vertical' | 'highlightEnabled' | 'includedInExport' | 'placeholder/enabled' | 'playback/playing' | 'playback/soloPlaybackEnabled' | 'scene/aspectRatioLock' | 'scene/extendedPanningArea' | 'selected' | 'selectionEnabled' | 'transformLocked' | 'visible' | 'blur/enabled' | 'dropShadow/clip' | 'dropShadow/enabled' | 'fill/enabled' | 'fill/overprint' | 'page/guides/gridEnabled' | 'page/guides/gridSnapEnabled' | 'page/marginEnabled' | 'page/safetyEnabled' | 'placeholderControls/showButton' | 'placeholderControls/showOverlay' | 'playback/looping' | 'playback/muted' | 'stroke/enabled' | 'stroke/overprint' | 'motionBlur/enabled' | 'transform/autoOrient' | 'backgroundColor/enabled' | 'placeholderBehavior/enabled' | 'text/automaticFontSizeEnabled' | 'text/clipLinesOutsideOfFrame' | 'text/hasClippedLines' | 'text/pathFlipped' | 'text/useContextualAlternates' | 'text/useContextualLigatures' | 'text/useDiscretionaryLigatures' | 'text/useKerning' | 'text/useLigatures' | 'exclusionArea/constrains' | 'exclusionArea/punchOut' | 'track/automaticallyManageBlockOffsets' | 'caption/automaticFontSizeEnabled' | 'caption/clipLinesOutsideOfFrame' | 'caption/hasClippedLines' | 'caption/pathFlipped' | 'caption/useContextualAlternates' | 'caption/useContextualLigatures' | 'caption/useDiscretionaryLigatures' | 'caption/useKerning' | 'caption/useLigatures' | 'captionTrack/automaticallyManageBlockOffsets' | 'animation/slide/fade' | 'animation/pan/fade' | 'animation/blur/fade' | 'animation/zoom/fade' | 'animation/crop_zoom/fade' | 'animation/spin/fade' | 'animation/block_swipe_text/useTextColor' | 'animation/spread_text/fade' | 'animation/ken_burns/fade' | 'effect/enabled' | 'effect/displacement_map/wrapPixels' | 'effect/levels/clipToOutBlack' | 'effect/levels/clipToOutWhite' | 'effect/stroke/allMasks' | 'mask/inverted' | 'text_animator/fillColorEnabled' | 'text_animator/opacityEnabled' | 'text_animator/selectorEnabled' | 'text_animator/selectorRandomize' | 'text_animator/strokeColorEnabled' | (string & {});\ntype CameraClampingOvershootMode = 'Center' | 'Reverse';\ntype ClipInitialDurationMode = 'default' | 'followParent';\ntype CMYK = [\n c: number,\n m: number,\n y: number,\n k: number\n];\ninterface CMYKProfileInfo {\n contentHash: string;\n name: string;\n uri: string;\n}\ntype ColorPickerColorMode = 'RGB' | 'CMYK' | 'Any';\ntype ColorPropertyName = 'dropShadow/color' | 'fill/solid/color' | 'page/guides/gridColor' | 'stroke/color' | 'backgroundColor/color' | 'animation/block_swipe_text/blockColor' | 'effect/duotone_filter/darkColor' | 'effect/duotone_filter/lightColor' | 'effect/fill/color' | 'effect/green_screen/fromColor' | 'effect/recolor/fromColor' | 'effect/recolor/toColor' | 'effect/stroke/color' | 'effect/tint/mapBlackTo' | 'effect/tint/mapWhiteTo' | 'effect/tritone/highlights' | 'effect/tritone/midtones' | 'effect/tritone/shadows' | 'fill/color/value' | 'fill/stripe/color' | 'text_animator/fillColor' | 'text_animator/strokeColor' | (string & {});\nenum ColorRenderingIntent {\n Perceptual = 0,\n RelativeColorimetric = 1,\n Saturation = 2,\n AbsoluteColorimetric = 3\n}\ntype ColorSpace = 'sRGB' | 'CMYK' | 'SpotColor';\ninterface CompleteAssetResult extends AssetResult {\n context: {\n sourceId: string;\n };\n active: boolean;\n}\ninterface Configuration {\n baseURL: string;\n license?: string;\n userId?: string;\n core: {\n baseURL: string;\n };\n logger: Logger;\n featureFlags?: {\n [flag: string]: boolean | string;\n };\n /** @deprecated This config key is not used anymore and will be removed. */\n presets: {\n typefaces?: {\n [id: string]: TypefaceDefinition;\n };\n };\n forceWebGL1?: boolean;\n audioOutput?: 'auto' | 'none';\n role?: RoleString;\n}\ntype ControlGizmoMoveHandleVisibility = 'auto' | 'always' | 'never';\ntype ControlGizmoResizeHandlesVisibility = 'auto' | 'always' | 'never';\ntype ControlGizmoRotateHandlesVisibility = 'auto' | 'always' | 'never';\ntype ControlGizmoScaleHandlesVisibility = 'auto' | 'always' | 'never';\ntype CreateSceneOptions = {\n page?: {\n size: number | {\n width: number;\n height: number;\n };\n color?: Color;\n };\n designUnit?: DesignUnit;\n fontSizeUnit?: FontSizeUnit;\n angleUnit?: SceneAngleUnit;\n};\nclass CreativeEngine {\n #private;\n static readonly version: string;\n asset: AssetAPI;\n block: BlockAPI;\n editor: EditorAPI;\n event: EventAPI;\n scene: SceneAPI;\n variable: VariableAPI;\n actions: EngineActions;\n version: string;\n update(): boolean;\n dispose(): void;\n static init(config?: Partial<Configuration>): Promise<CreativeEngine>;\n /** @deprecated This method uses legacy v4 asset source IDs and will be removed in a future version. Please migrate to v5 asset sources using engine.asset.addLocalAssetSourceFromJSONURI(). */\n addDefaultAssetSources({ baseURL, excludeAssetSourceIds }?: {\n baseURL?: string;\n excludeAssetSourceIds?: DefaultAssetSourceId[];\n }): Promise<void>;\n /** @deprecated This method uses legacy v3 demo asset source IDs and will be removed in a future version. Please migrate to v4 asset sources using engine.asset.addLocalAssetSourceFromJSONURI(). */\n addDemoAssetSources({ baseURL, excludeAssetSourceIds, sceneMode, withUploadAssetSources }?: {\n baseURL?: string;\n excludeAssetSourceIds?: DemoAssetSourceId[];\n sceneMode?: SceneMode;\n withUploadAssetSources?: boolean;\n }): Promise<void>;\n getBaseURL(): string;\n}\ntype CutoutOperation = 'Difference' | 'Intersection' | 'Union' | 'XOR';\ntype CutoutType = 'Solid' | 'Dashed';\ninterface DefaultApplyAssetOptions {\n placement?: AssetPlacement;\n abortSignal?: AbortSignal;\n}\n/** @deprecated This function uses legacy v4 asset source IDs. Please migrate to v5 asset sources using engine.asset.addLocalAssetSourceFromJSONURI() directly. */\ntype DefaultAssetSourceId = 'ly.img.sticker' | 'ly.img.vectorpath' | 'ly.img.colors.defaultPalette' | 'ly.img.filter.lut' | 'ly.img.filter.duotone' | 'ly.img.effect' | 'ly.img.blur' | 'ly.img.typeface' | 'ly.img.page.presets' | 'ly.img.page.presets.video' | 'ly.img.crop.presets' | 'ly.img.text' | 'ly.img.captionPresets';\n/** @deprecated This function uses legacy v3 demo asset source IDs. Please migrate to v4 asset sources using engine.asset.addLocalAssetSourceFromJSONURI() directly. */\ntype DemoAssetSourceId = 'ly.img.template' | 'ly.img.image.upload' | 'ly.img.video.upload' | 'ly.img.audio.upload' | 'ly.img.image' | 'ly.img.video' | 'ly.img.video.template' | 'ly.img.audio' | 'ly.img.textComponents';\ntype DesignBlockTypeLonghand = `//ly.img.ubq/${DesignBlockTypeShorthand}`;\ntype DesignBlockTypeShorthand = 'scene' | 'stack' | 'camera' | 'page' | 'graphic' | 'audio' | 'text' | 'group' | 'cutout' | 'track' | 'caption' | 'captionTrack' | 'exclusionArea';\ninterface DocumentColorProfileInfo {\n contentHash: string;\n name: string;\n uri: string;\n}\ninterface DominantColor {\n r: number;\n g: number;\n b: number;\n weight: number;\n}\ninterface DominantColorsOptions {\n count?: number;\n ignoreWhite?: boolean;\n abortSignal?: AbortSignal;\n}\ntype DoubleClickSelectionMode = 'Direct' | 'Hierarchical';\ntype DoublePropertyName = 'playback/time' | 'playback/duration' | 'playback/timeOffset' | 'audio/totalDuration' | 'playback/fadeIn/duration' | 'playback/fadeOut/duration' | 'playback/trimLength' | 'playback/trimOffset' | 'fill/video/totalDuration' | (string & {});\ntype DropShadowOptions = {\n color?: Color;\n offset?: {\n x?: number;\n y?: number;\n };\n blur?: {\n x?: number;\n y?: number;\n };\n};\nclass EditorAPI {\n #private;\n /** @deprecated Use {@link EditorAPI.getCapabilityState}, which says whether the capability has * been measured yet. To ask whether this browser can play or export video, run the * `video.decode.checkSupport` or `video.encode.checkSupport` action, which measures first. * * */\n isCapabilitySupported(capability: EngineCapability): boolean;\n getCapabilityState(capability: EngineCapability): EngineCapabilityState;\n checkCapabilities(): Promise<void>;\n onStateChanged: (callback: () => void) => (() => void);\n unstable_isInteractionHappening(): boolean;\n addVectorNode(): void;\n deleteVectorNode(): void;\n deleteSelectedVectorControlPoints(): void;\n toggleSelectedVectorNodeSmooth(): void;\n setVectorEditBendMode(active: boolean): void;\n getVectorEditBendMode(): boolean;\n setVectorEditAddMode(active: boolean): void;\n getVectorEditAddMode(): boolean;\n setVectorEditDeleteMode(active: boolean): void;\n getVectorEditDeleteMode(): boolean;\n setSelectedVectorNodeMirrorMode(mode: number): void;\n getSelectedVectorNodeMirrorMode(): number;\n getTextCursorPositionInScreenSpaceX(): number;\n getTextCursorPositionInScreenSpaceY(): number;\n removeUndoStep(): void;\n /** @deprecated Use {@link onHistoryUpdatedWithKind}instead, which additionally reports a {@link HistoryUpdate}* describing the kind of update. * * */\n onHistoryUpdated: (callback: () => void) => (() => void);\n onHistoryUpdatedWithKind: (callback: (kind: HistoryUpdate) => void) => (() => void);\n onSettingsChanged: (callback: () => void) => (() => void);\n onRoleChanged: (callback: (role: RoleString) => void) => (() => void);\n setSetting<K extends SettingKey>(keypath: OptionalPrefix<K>, value: SettingValueType<K>): void;\n getSetting<K extends SettingKey>(keypath: OptionalPrefix<K>): SettingValueType<K>;\n setSettingBool(keypath: SettingsBool, value: boolean): void;\n getSettingBool(keypath: SettingsBool): boolean;\n getSettingBool(keypath: SettingBoolPropertyName): boolean;\n setSettingInt(keypath: SettingsInt, value: number): void;\n setSettingInt(keypath: SettingIntPropertyName, value: number): void;\n getSettingInt(keypath: SettingsInt): number;\n getSettingInt(keypath: SettingIntPropertyName): number;\n setSettingFloat(keypath: SettingsFloat, value: number): void;\n setSettingFloat(keypath: SettingFloatPropertyName, value: number): void;\n getSettingFloat(keypath: SettingsFloat): number;\n getSettingFloat(keypath: SettingFloatPropertyName): number;\n setSettingDouble(keypath: OptionalPrefix<SettingsDouble>, value: number): void;\n getSettingDouble(keypath: OptionalPrefix<SettingsDouble>): number;\n setSettingString(keypath: SettingsString, value: string): void;\n setSettingString(keypath: SettingStringPropertyName, value: string): void;\n getSettingString(keypath: SettingsString): string;\n getSettingString(keypath: SettingStringPropertyName): string;\n setSettingColor(keypath: SettingsColor, value: Color): void;\n setSettingColor(keypath: SettingColorPropertyName, value: Color): void;\n getSettingColor(keypath: SettingsColor): Color;\n getSettingColor(keypath: SettingColorPropertyName): Color;\n /** @deprecated Use setSettingColor() instead. */\n setSettingColorRGBA(keypath: SettingsColorRGBA | `ubq://${SettingsColorRGBA}`, r: number, g: number, b: number, a?: number): void;\n /** @deprecated Use getSettingColor() instead. */\n getSettingColorRGBA(keypath: SettingsColorRGBA | `ubq://${SettingsColorRGBA}`): RGBA;\n setSettingEnum<T extends keyof SettingEnumType>(keypath: T, value: SettingEnumType[T]): void;\n setSettingEnum(keypath: string, value: string): void;\n getSettingEnum<T extends keyof SettingEnumType>(keypath: T): SettingEnumType[T];\n getSettingEnum(keypath: string): string;\n getSettingEnumOptions<T extends keyof SettingEnumType>(keypath: T): SettingEnumType[T][];\n getSettingEnumOptions(keypath: string): string[];\n setRole(role: RoleString): void;\n getRole(): RoleString;\n findAllSettings(): string[];\n getSettingType(keypath: string): SettingType;\n getAvailableMemory(): number;\n getUsedMemory(): number;\n releaseMemory(): void;\n getMaxExportSize(): number;\n setURIResolver(resolver?: SyncURIResolver | null): void;\n setURIResolverAsync(resolver?: AsyncURIResolver | null): void;\n defaultURIResolver(relativePath: string): string;\n getAbsoluteURI(relativePath: string): Promise<string>;\n findAllSpotColors(): string[];\n getSpotColorRGBA(name: string): RGBA;\n getSpotColorCMYK(name: string): CMYK;\n setSpotColorRGB(name: string, r: number, g: number, b: number): void;\n setSpotColorCMYK(name: string, c: number, m: number, y: number, k: number): void;\n removeSpotColor(name: string): void;\n setSpotColorForCutoutType(type: CutoutType, color: string): void;\n getSpotColorForCutoutType(type: CutoutType): string;\n convertColorToColorSpace(color: Color, colorSpace: 'sRGB'): RGBAColor;\n convertColorToColorSpace(color: Color, colorSpace: 'CMYK'): CMYKColor;\n convertColorToColorSpace(color: Color, colorSpace: ColorSpace): never;\n loadColorProfiles(options?: AbortOptions): Promise<void>;\n /** @deprecated Use `loadColorProfiles` instead. */\n loadCMYKProfile(options?: AbortOptions): Promise<void>;\n createBuffer(): string;\n destroyBuffer(uri: string): void;\n setBufferData(uri: string, offset: number, data: Uint8Array): void;\n getBufferData(uri: string, offset: number, length: number): Uint8Array;\n setBufferLength(uri: string, length: number): void;\n getBufferLength(uri: string): number;\n getMimeType(uri: string, options?: AbortOptions): Promise<string>;\n getFontMetrics(fontFileUri: string, options?: AbortOptions): Promise<FontMetrics>;\n findAllTransientResources(): TransientResource[];\n findAllMediaURIs(): string[];\n getResourceData(uri: string, chunkSize: number, onData: (result: Uint8Array) => boolean): void;\n relocateResource(currentUrl: string, relocatedUrl: string): void;\n setSafeAreaInsets(insets: {\n left?: number;\n top?: number;\n right?: number;\n bottom?: number;\n }): void;\n getSafeAreaInsets(): {\n left: number;\n top: number;\n right: number;\n bottom: number;\n };\n setMovementConstraint(rules: MovementConstraintRule | MovementConstraintRule[]): void;\n removeMovementConstraint(scopes?: MovementConstraintScope | MovementConstraintScope[]): void;\n}\ninterface EngineActionInfo {\n id: string;\n enabled: boolean;\n argSchema: string | null;\n}\nclass EngineActions<Registry extends object = EngineActionsRegistry> {\n #private;\n register<K extends keyof Registry & string>(id: K, fn: Registry[K] extends (...args: any[]) => any ? Registry[K] : EngineCustomActionFunction): void;\n register(id: string, fn: EngineCustomActionFunction): void;\n get<K extends keyof Registry & string>(id: K): Registry[K] | undefined;\n get(id: string): EngineCustomActionFunction | undefined;\n run<K extends keyof Registry & string>(id: K, ...args: Registry[K] extends (...args: infer A) => any ? A : unknown[]): Promise<Registry[K] extends (...args: any[]) => infer R ? Awaited<R> : unknown>;\n run<R = unknown>(id: string, ...args: unknown[]): Promise<R>;\n has(id: string): boolean;\n unregister(id: string): boolean;\n list(options?: {\n matcher?: string;\n }): EngineActionInfo[];\n}\ninterface EngineActionsRegistry {\n 'asset.drop': (payload: AssetDropPayload) => void | Promise<void>;\n 'video.decode.checkSupport': () => Promise<boolean>;\n 'video.encode.checkSupport': () => Promise<boolean>;\n}\ntype EngineCapability = 'aacEncode' | 'opusEncode' | 'h264Encode' | 'hevcEncode' | 'vp9Encode' | 'av1Encode' | 'h264Decode' | 'hevcDecode' | 'vp9Decode' | 'av1Decode' | 'tempFileStorage' | 'concurrentFileRead' | 'vp8Encode' | 'vp8Decode' | 'opusDecode' | 'vorbisEncode' | 'vorbisDecode';\ntype EngineCapabilityState = 'unchecked' | 'pending' | 'supported' | 'unsupported';\ntype EngineCustomActionFunction = (...args: any[]) => unknown;\nclass EngineError extends Error {\n readonly code: string;\n readonly category: string;\n readonly hint: string;\n readonly args: Record<string, EngineErrorArg>;\n readonly silent: boolean;\n readonly docsUrl: string | null;\n}\ntype EngineErrorArg = boolean | number | string;\ntype EnumPropertyName = 'blend/mode' | 'contentFill/horizontalAlignment' | 'contentFill/mode' | 'contentFill/verticalAlignment' | 'height/mode' | 'position/x/mode' | 'position/y/mode' | 'scene/angleUnit' | 'scene/colorConversionMode' | 'scene/designUnit' | 'scene/fontSizeUnit' | 'scene/layout' | 'scene/mode' | 'width/mode' | 'page/guides/source' | 'stroke/cap' | 'stroke/cornerGeometry' | 'stroke/dashEndCap' | 'stroke/dashStartCap' | 'stroke/endCap' | 'stroke/position' | 'stroke/startCap' | 'stroke/style' | 'playback/fadeIn/easing' | 'playback/fadeOut/easing' | 'text/horizontalAlignment' | 'text/verticalAlignment' | 'cutout/type' | 'caption/horizontalAlignment' | 'caption/verticalAlignment' | 'animationEasing' | 'textAnimationWritingStyle' | 'animation/grow/direction' | 'animation/wipe/direction' | 'animation/baseline/direction' | 'animation/spin/direction' | 'animation/spin_loop/direction' | 'animation/jump_loop/direction' | 'animation/typewriter_text/writingStyle' | 'animation/block_swipe_text/direction' | 'animation/merge_text/direction' | 'animation/ken_burns/direction' | 'blur/uniform/mode' | 'modifier/trim/mode' | 'modifier/repeater/composite' | 'modifier/offset/join' | 'modifier/zigzag/pointType' | 'effect/displacement_map/horizontalChannel' | 'effect/displacement_map/mapBehavior' | 'effect/displacement_map/verticalChannel' | 'effect/invert/channel' | 'effect/radial_wipe/direction' | 'effect/shift_channels/takeAlphaFrom' | 'effect/shift_channels/takeBlueFrom' | 'effect/shift_channels/takeGreenFrom' | 'effect/shift_channels/takeRedFrom' | 'effect/stroke/paintStyle' | 'effect/wave_warp/waveType' | 'fill/pixelStream/orientation' | 'shape/vector_path/fillRule' | 'shape/compound/fillRule' | 'shape/compound/mode' | 'mask/mode' | 'text_animator/selectorBasedOn' | 'text_animator/selectorShape' | 'text_animator/selectorUnits' | (string & {});\nclass EventAPI {\n #private;\n subscribe: (blocks: DesignBlockId[], callback: (events: BlockEvent[]) => void) => (() => void);\n}\ntype FloatPropertyName = 'globalBoundingBox/height' | 'globalBoundingBox/width' | 'globalBoundingBox/x' | 'globalBoundingBox/y' | 'height' | 'lastFrame/height' | 'lastFrame/width' | 'lastFrame/x' | 'lastFrame/y' | 'motionBlur/shutterAngle' | 'motionBlur/shutterPhase' | 'movement/constraint' | 'position/x' | 'position/y' | 'rotation' | 'scene/dpi' | 'scene/frameRate' | 'scene/pageDimensions/height' | 'scene/pageDimensions/width' | 'scene/pixelScaleFactor' | 'width' | 'camera/pixelRatio' | 'camera/resolution/height' | 'camera/resolution/width' | 'camera/zoomLevel' | 'dropShadow/blurRadius/x' | 'dropShadow/blurRadius/y' | 'dropShadow/offset/x' | 'dropShadow/offset/y' | 'page/guides/gridSpacingX' | 'page/guides/gridSpacingY' | 'page/margin/bottom' | 'page/margin/left' | 'page/margin/right' | 'page/margin/top' | 'page/marginScale' | 'page/safetyInset/bottom' | 'page/safetyInset/left' | 'page/safetyInset/right' | 'page/safetyInset/top' | 'playback/speed' | 'playback/volume' | 'stroke/dashOffset' | 'stroke/miterLimit' | 'stroke/width' | 'opacity' | 'transform/anchor/x' | 'transform/anchor/y' | 'transform/scale/x' | 'transform/scale/y' | 'transform/skew' | 'transform/skewAxis' | 'backgroundColor/cornerRadius' | 'backgroundColor/paddingBottom' | 'backgroundColor/paddingLeft' | 'backgroundColor/paddingRight' | 'backgroundColor/paddingTop' | 'text/backgroundCornerRadius' | 'text/backgroundPadding/bottom' | 'text/backgroundPadding/left' | 'text/backgroundPadding/right' | 'text/backgroundPadding/top' | 'text/fontSize' | 'text/letterSpacing' | 'text/lineHeight' | 'text/maxAutomaticFontSize' | 'text/minAutomaticFontSize' | 'text/paragraphSpacing' | 'text/pathOffset' | 'text/subscriptFontScale' | 'text/subscriptVerticalShift' | 'text/superscriptFontScale' | 'text/superscriptVerticalShift' | 'cutout/offset' | 'cutout/smoothing' | 'caption/backgroundCornerRadius' | 'caption/backgroundPadding/bottom' | 'caption/backgroundPadding/left' | 'caption/backgroundPadding/right' | 'caption/backgroundPadding/top' | 'caption/fontSize' | 'caption/letterSpacing' | 'caption/lineHeight' | 'caption/maxAutomaticFontSize' | 'caption/minAutomaticFontSize' | 'caption/paragraphSpacing' | 'caption/pathOffset' | 'caption/subscriptFontScale' | 'caption/subscriptVerticalShift' | 'caption/superscriptFontScale' | 'caption/superscriptVerticalShift' | 'animation/slide/direction' | 'textAnimationOverlap' | 'animation/pan/direction' | 'animation/pan/distance' | 'animation/blur/intensity' | 'animation/grow/scaleFactor' | 'animation/crop_zoom/scale' | 'animation/spin/intensity' | 'animation/blur_loop/intensity' | 'animation/pulsating_loop/intensity' | 'animation/breathing_loop/intensity' | 'animation/jump_loop/intensity' | 'animation/sway_loop/intensity' | 'animation/spread_text/intensity' | 'animation/merge_text/intensity' | 'animation/ken_burns/travelDistanceRatio' | 'animation/ken_burns/zoomIntensity' | 'blur/uniform/intensity' | 'blur/linear/blurRadius' | 'blur/linear/x1' | 'blur/linear/x2' | 'blur/linear/y1' | 'blur/linear/y2' | 'blur/mirrored/blurRadius' | 'blur/mirrored/gradientSize' | 'blur/mirrored/size' | 'blur/mirrored/x1' | 'blur/mirrored/x2' | 'blur/mirrored/y1' | 'blur/mirrored/y2' | 'blur/radial/blurRadius' | 'blur/radial/gradientRadius' | 'blur/radial/radius' | 'blur/radial/x' | 'blur/radial/y' | 'modifier/trim/end' | 'modifier/trim/offset' | 'modifier/trim/start' | 'modifier/repeater/anchorX' | 'modifier/repeater/anchorY' | 'modifier/repeater/copies' | 'modifier/repeater/endOpacity' | 'modifier/repeater/offset' | 'modifier/repeater/positionX' | 'modifier/repeater/positionY' | 'modifier/repeater/rotation' | 'modifier/repeater/scaleX' | 'modifier/repeater/scaleY' | 'modifier/repeater/startOpacity' | 'modifier/round_corners/radius' | 'modifier/offset/amount' | 'modifier/offset/miterLimit' | 'modifier/zigzag/ridges' | 'modifier/zigzag/size' | 'modifier/pucker_bloat/amount' | 'modifier/twist/angle' | 'modifier/twist/centerX' | 'modifier/twist/centerY' | 'effect/adjustments/blacks' | 'effect/adjustments/brightness' | 'effect/adjustments/clarity' | 'effect/adjustments/contrast' | 'effect/adjustments/exposure' | 'effect/adjustments/gamma' | 'effect/adjustments/highlights' | 'effect/adjustments/saturation' | 'effect/adjustments/shadows' | 'effect/adjustments/sharpness' | 'effect/adjustments/temperature' | 'effect/adjustments/whites' | 'effect/bulge/centerX' | 'effect/bulge/centerY' | 'effect/bulge/height' | 'effect/bulge/horizontalRadius' | 'effect/bulge/verticalRadius' | 'effect/corner_pin/lowerLeftX' | 'effect/corner_pin/lowerLeftY' | 'effect/corner_pin/lowerRightX' | 'effect/corner_pin/lowerRightY' | 'effect/corner_pin/upperLeftX' | 'effect/corner_pin/upperLeftY' | 'effect/corner_pin/upperRightX' | 'effect/corner_pin/upperRightY' | 'effect/cross_cut/offset' | 'effect/cross_cut/slices' | 'effect/cross_cut/speedV' | 'effect/cross_cut/time' | 'effect/displacement_map/maxHorizontal' | 'effect/displacement_map/maxVertical' | 'effect/dot_pattern/blur' | 'effect/dot_pattern/dots' | 'effect/dot_pattern/size' | 'effect/duotone_filter/intensity' | 'effect/extrude_blur/amount' | 'effect/fill/opacity' | 'effect/glow/amount' | 'effect/glow/darkness' | 'effect/glow/size' | 'effect/green_screen/colorMatch' | 'effect/green_screen/smoothness' | 'effect/green_screen/spill' | 'effect/half_tone/angle' | 'effect/half_tone/scale' | 'effect/levels/alphaGamma' | 'effect/levels/alphaInBlack' | 'effect/levels/alphaInWhite' | 'effect/levels/alphaOutBlack' | 'effect/levels/alphaOutWhite' | 'effect/levels/blueGamma' | 'effect/levels/blueInBlack' | 'effect/levels/blueInWhite' | 'effect/levels/blueOutBlack' | 'effect/levels/blueOutWhite' | 'effect/levels/greenGamma' | 'effect/levels/greenInBlack' | 'effect/levels/greenInWhite' | 'effect/levels/greenOutBlack' | 'effect/levels/greenOutWhite' | 'effect/levels/redGamma' | 'effect/levels/redInBlack' | 'effect/levels/redInWhite' | 'effect/levels/redOutBlack' | 'effect/levels/redOutWhite' | 'effect/levels/rgbGamma' | 'effect/levels/rgbInBlack' | 'effect/levels/rgbInWhite' | 'effect/levels/rgbOutBlack' | 'effect/levels/rgbOutWhite' | 'effect/linear_wipe/angle' | 'effect/linear_wipe/completion' | 'effect/linear_wipe/feather' | 'effect/linocut/scale' | 'effect/liquid/amount' | 'effect/liquid/scale' | 'effect/liquid/time' | 'effect/lut_filter/intensity' | 'effect/outliner/amount' | 'effect/outliner/passthrough' | 'effect/posterize/levels' | 'effect/radial_pixel/radius' | 'effect/radial_pixel/segments' | 'effect/radial_wipe/centerX' | 'effect/radial_wipe/centerY' | 'effect/radial_wipe/completion' | 'effect/radial_wipe/feather' | 'effect/radial_wipe/startAngle' | 'effect/recolor/brightnessMatch' | 'effect/recolor/colorMatch' | 'effect/recolor/smoothness' | 'effect/shifter/amount' | 'effect/shifter/angle' | 'effect/stroke/brushSize' | 'effect/stroke/end' | 'effect/stroke/hardness' | 'effect/stroke/opacity' | 'effect/stroke/spacing' | 'effect/stroke/start' | 'effect/threshold/level' | 'effect/tilt_shift/amount' | 'effect/tilt_shift/position' | 'effect/tint/amount' | 'effect/tritone/amount' | 'effect/tv_glitch/distortion' | 'effect/tv_glitch/distortion2' | 'effect/tv_glitch/rollSpeed' | 'effect/tv_glitch/speed' | 'effect/venetian_blinds/completion' | 'effect/venetian_blinds/direction' | 'effect/venetian_blinds/feather' | 'effect/venetian_blinds/width' | 'effect/vignette/darkness' | 'effect/vignette/offset' | 'effect/wave_warp/direction' | 'effect/wave_warp/height' | 'effect/wave_warp/phase' | 'effect/wave_warp/width' | 'fill/gradient/linear/endPointX' | 'fill/gradient/linear/endPointY' | 'fill/gradient/linear/startPointX' | 'fill/gradient/linear/startPointY' | 'fill/gradient/radial/centerPointX' | 'fill/gradient/radial/centerPointY' | 'fill/gradient/radial/focalX' | 'fill/gradient/radial/focalY' | 'fill/gradient/radial/radius' | 'fill/gradient/conical/centerPointX' | 'fill/gradient/conical/centerPointY' | 'fill/stripe/angle' | 'fill/stripe/gap' | 'fill/stripe/width' | 'shape/anchor/x' | 'shape/anchor/y' | 'shape/height' | 'shape/position/x' | 'shape/position/y' | 'shape/rect/cornerRadiusBL' | 'shape/rect/cornerRadiusBR' | 'shape/rect/cornerRadiusTL' | 'shape/rect/cornerRadiusTR' | 'shape/rotation' | 'shape/scale/x' | 'shape/scale/y' | 'shape/skew' | 'shape/skewAxis' | 'shape/width' | 'shape/polygon/cornerRadius' | 'shape/star/cornerRadius' | 'shape/star/innerDiameter' | 'shape/star/innerRadius' | 'shape/star/innerRoundness' | 'shape/star/outerRadius' | 'shape/star/outerRoundness' | 'shape/star/rotation' | 'shape/vector_path/cornerRadius' | 'shape/vector_path/height' | 'shape/vector_path/width' | 'shape/compound/height' | 'shape/compound/width' | 'mask/expansion' | 'mask/feather' | 'mask/opacity' | 'text_animator/anchorX' | 'text_animator/anchorY' | 'text_animator/blurX' | 'text_animator/blurY' | 'text_animator/opacity' | 'text_animator/positionX' | 'text_animator/positionY' | 'text_animator/rotation' | 'text_animator/scaleX' | 'text_animator/scaleY' | 'text_animator/selectorAmount' | 'text_animator/selectorEaseHigh' | 'text_animator/selectorEaseLow' | 'text_animator/selectorEnd' | 'text_animator/selectorOffset' | 'text_animator/selectorSmoothness' | 'text_animator/selectorStart' | 'text_animator/skew' | 'text_animator/skewAxis' | 'text_animator/strokeWidth' | 'text_animator/tracking' | (string & {});\ninterface FontMetrics {\n ascender: number;\n descender: number;\n unitsPerEm: number;\n lineGap: number;\n capHeight: number;\n xHeight: number;\n underlineOffset: number;\n underlineSize: number;\n strikeoutOffset: number;\n strikeoutSize: number;\n}\ntype HistoryUpdate = 'Updated' | 'Activated';\ntype ImportedImageColorSpace = 'DeviceGray' | 'DeviceRGB' | 'DeviceCMYK' | 'ICCBased';\ninterface ImportedImageDefinitionInfo {\n colorSpace: ImportedImageColorSpace;\n declaredColorSpace: ImportedImageColorSpace;\n profileContentHash: string;\n decode: number[];\n colorTransform?: number;\n renderingIntent?: ColorRenderingIntent;\n importerRecord: string;\n importerRecordFormat: string;\n colorKeyMask?: number[];\n mask?: ImportedImageMaskInfo;\n}\ninterface ImportedImageDefinitionInput {\n colorSpace: ImportedImageColorSpace;\n declaredColorSpace?: ImportedImageColorSpace;\n iccProfile?: Uint8Array;\n decode?: number[];\n colorTransform?: number;\n renderingIntent?: ColorRenderingIntent;\n importerRecord?: string;\n importerRecordFormat?: string;\n colorKeyMask?: number[];\n mask?: ImportedImageMaskInput;\n}\ninterface ImportedImageMaskInfo {\n width: number;\n height: number;\n decode: number[];\n interpolate: boolean;\n matte: number[];\n kind: ImportedImageMaskKind;\n}\ninterface ImportedImageMaskInput {\n jpegBytes?: Uint8Array;\n bitPackedBytes?: Uint8Array;\n width: number;\n height: number;\n decode?: number[];\n interpolate?: boolean;\n kind?: ImportedImageMaskKind;\n matte?: number[];\n}\ntype ImportedImageMaskKind = 'Stencil' | 'Soft';\ntype IntPropertyName = 'motionBlur/samples' | 'effect/lut_filter/horizontalTileCount' | 'effect/lut_filter/verticalTileCount' | 'effect/mirror/side' | 'effect/pixelize/horizontalPixelSize' | 'effect/pixelize/verticalPixelSize' | 'effect/stroke/maskIndex' | 'shape/polygon/sides' | 'shape/star/points' | 'text_animator/selectorSeed' | (string & {});\ntype LoadSceneOptions = {\n overrideEditorConfig?: boolean;\n waitForResources?: boolean;\n onProgress?: (percent: number) => void;\n abortSignal?: AbortSignal;\n};\ntype Locale = string;\ninterface Logger {\n (message: string, level?: LogLevel): void;\n}\ntype LogLevel = 'Info' | 'Warning' | 'Error';\n/** @deprecated Specifying log levels via `LogLevel.Info` has been deprecated. Please use the desired LogLevel string directly. */\nconst LogLevel: {\n readonly Info: 'Info';\n readonly Warning: 'Warning';\n readonly Error: 'Error';\n};\n/** @deprecated Use the `MimeType` string literal types instead. */\nconst MimeType_2: {\n readonly Png: 'image/png';\n readonly Jpeg: 'image/jpeg';\n readonly WebP: 'image/webp';\n readonly Tga: 'image/x-tga';\n readonly Svg: 'image/svg+xml';\n readonly Wav: 'audio/wav';\n readonly Mp4Audio: 'audio/mp4';\n readonly WebMAudio: 'audio/webm';\n readonly Mp4: 'video/mp4';\n readonly WebM: 'video/webm';\n readonly QuickTime: 'video/quicktime';\n readonly Binary: 'application/octet-stream';\n readonly Pdf: 'application/pdf';\n readonly Zip: 'application/zip';\n};\ntype MimeType_2 = (typeof MimeType_2)[keyof typeof MimeType_2];\ntype MovementConstraintRule = {\n overshoot: number;\n} | {\n overshoot: number;\n block: DesignBlockId;\n} | {\n overshoot: number;\n blockType: string;\n};\ntype MovementConstraintScope = {\n block: DesignBlockId;\n} | {\n blockType: string;\n};\ntype OptionalPrefix<T extends string> = `ubq://${T}` | T;\ntype PositionMode = 'Absolute' | 'Percent' | 'Auto' | 'Absolute' | 'Percent' | 'Auto';\ntype ProfileColorSpace = 'RGB' | 'CMYK' | 'Gray';\ntype ProfileRole = 'Default' | 'Output';\ninterface ProfileSlot {\n role: ProfileRole;\n space: ProfileColorSpace;\n}\ntype PropertyType = 'Bool' | 'Int' | 'Float' | 'String' | 'Color' | 'Enum' | 'Struct' | 'Double' | 'SourceSet' | 'Vec2';\ninterface Range_2 {\n from: number;\n to: number;\n}\ntype RGBA = [\n r: number,\n g: number,\n b: number,\n a: number\n];\ninterface RGBColor {\n r: number;\n g: number;\n b: number;\n}\ntype RoleString = 'Creator' | 'Adopter' | 'Viewer' | 'Presenter';\ntype SceneAngleUnit = 'Radian' | 'Degree';\nclass SceneAPI {\n #private;\n setDocumentColorProfile(slot: ProfileSlot, uri: string, options?: AbortOptions): Promise<void>;\n setDocumentColorProfileFromData(slot: ProfileSlot, data: Uint8Array): void;\n getDocumentColorProfileInfo(slot: ProfileSlot): DocumentColorProfileInfo;\n removeDocumentColorProfile(slot: ProfileSlot): void;\n /** @deprecated Use `setDocumentColorProfile` with Default/CMYK. */\n setCMYKProfile(uri: string, options?: AbortOptions): Promise<void>;\n /** @deprecated Use `setDocumentColorProfileFromData` with Default/CMYK. */\n setCMYKProfileFromData(data: Uint8Array): void;\n /** @deprecated Use `getDocumentColorProfileInfo` with Default/CMYK. */\n getCMYKProfileInfo(): CMYKProfileInfo;\n /** @deprecated Use `removeDocumentColorProfile` with Default/CMYK. */\n removeCMYKProfile(): void;\n getColorRenderingIntent(): ColorRenderingIntent;\n setColorRenderingIntent(intent: ColorRenderingIntent): void;\n isBlackPointCompensationEnabled(): boolean;\n setBlackPointCompensationEnabled(enabled: boolean): void;\n load(source: string | URL, options?: LoadSceneOptions): Promise<DesignBlockId>;\n load(source: string | URL, overrideEditorConfig?: boolean, waitForResources?: boolean): Promise<DesignBlockId>;\n /** @deprecated Scene mode no longer affects engine behavior. Use `create()` followed by `setMode('Video')` instead. ```javascript const scene = engine.scene.createVideo(); ``` */\n createVideo(options?: CreateSceneOptions): DesignBlockId;\n createFromImage(url: string, dpi?: number, pixelScaleFactor?: number, sceneLayout?: SceneLayout, spacing?: number, spacingInScreenSpace?: boolean, options?: AbortOptions): Promise<DesignBlockId>;\n createFromVideo(url: string, options?: AbortOptions): Promise<DesignBlockId>;\n get(): DesignBlockId | null;\n applyTemplateFromString(content: string): Promise<void>;\n applyTemplateFromURL(url: string, options?: AbortOptions): Promise<void>;\n /** @deprecated Scene mode no longer affects engine behavior. All features work regardless of mode. ```javascript const mode = scene.getMode(); ``` */\n getMode(): SceneMode | null;\n /** @deprecated Scene mode no longer affects engine behavior. All features work regardless of mode. ```javascript engine.scene.setMode('Video'); ``` */\n setMode(mode: SceneMode): void;\n setDesignUnit(designUnit: DesignUnit): void;\n getDesignUnit(): DesignUnit;\n setFontSizeUnit(fontSizeUnit: FontSizeUnit): void;\n getFontSizeUnit(): FontSizeUnit;\n setAngleUnit(angleUnit: SceneAngleUnit): void;\n getAngleUnit(): SceneAngleUnit;\n addMarker(name: string, time: number, duration?: number): void;\n getMarkers(): SceneMarker[];\n removeMarker(index: number): void;\n getLayout(): SceneLayout;\n setLayout(layout: SceneLayout): void;\n getPages(): DesignBlockId[];\n getCurrentPage(): DesignBlockId | null;\n setCurrentPages(pages: DesignBlockId[]): void;\n getCurrentPages(): DesignBlockId[];\n findNearestToViewPortCenterByType(type: DesignBlockType): DesignBlockId[];\n findNearestToViewPortCenterByKind(kind: string): DesignBlockId[];\n unstable_enableCameraPositionClamping(ids: DesignBlockId[], paddingLeft?: number, paddingTop?: number, paddingRight?: number, paddingBottom?: number, scaledPaddingLeft?: number, scaledPaddingTop?: number, scaledPaddingRight?: number, scaledPaddingBottom?: number): void;\n unstable_disableCameraPositionClamping(blockOrScene?: number | null): void;\n unstable_isCameraPositionClampingEnabled(blockOrScene?: number | null): boolean;\n onZoomLevelChanged: (callback: () => void) => (() => void);\n onActiveChanged: (callback: () => void) => (() => void);\n}\ntype DesignUnit = 'Pixel' | 'Millimeter' | 'Inch';\ntype FontSizeUnit = 'Pixel' | 'Point';\ntype SceneLayout = 'Free' | 'VerticalStack' | 'HorizontalStack' | 'DepthStack';\ninterface SceneMarker {\n name: string;\n time: number;\n duration: number;\n}\ntype SceneMode = 'Design' | 'Video';\ntype SettingBoolPropertyName = 'doubleClickToCropEnabled' | 'showBuildVersion' | 'placeholderControls/showButton' | 'placeholderControls/showOverlay' | 'blockAnimations/enabled' | 'playback/showAllBlocks' | 'grid/enabled' | 'grid/snapEnabled' | 'archival/bundleOnlyUsedFontVariants' | 'touch/dragStartCanSelect' | 'touch/singlePointPanning' | 'mouse/enableZoom' | 'mouse/enableScroll' | 'dragToSwapFills/enabled' | 'controlGizmo/showCropHandles' | 'controlGizmo/showMoveHandles' | 'controlGizmo/dynamicMoveHandleVisibility' | 'controlGizmo/showResizeHandles' | 'controlGizmo/showScaleHandles' | 'controlGizmo/showRotateHandles' | 'controlGizmo/showCropScaleHandles' | 'page/title/show' | 'page/title/showPageTitleTemplate' | 'page/title/appendPageName' | 'page/title/showOnSinglePage' | 'page/title/canEdit' | 'page/safetyRevealDuringTransform' | 'page/dimOutOfPageAreas' | 'page/allowCropInteraction' | 'page/allowResizeInteraction' | 'page/restrictResizeInteractionToFixedAspectRatio' | 'page/allowRotateInteraction' | 'page/allowMoveInteraction' | 'page/marqueeSelectOnBodyDrag' | 'page/restrictPageSelectionToBorderAndTitle' | 'page/moveChildrenWhenCroppingFill' | 'page/imageFillCoversBleed' | 'page/selectWhenNoBlocksSelected' | 'page/highlightWhenCropping' | 'page/allowShapeChange' | 'page/highlightDropTarget' | 'page/reparentBlocksToSceneWhenOutOfPage' | 'page/flipDimensionsOn90DegreeCropRotation' | 'clampThumbnailTextureSizes' | 'useSystemFontFallback' | 'forceSystemEmojis' | (string & {});\ntype SettingColorPropertyName = 'clearColor' | 'handleFillColor' | 'highlightColor' | 'pageHighlightColor' | 'placeholderHighlightColor' | 'snappingGuideColor' | 'rotationSnappingGuideColor' | 'cropOverlayColor' | 'textVariableHighlightColor' | 'borderOutlineColor' | 'progressColor' | 'errorStateColor' | 'grid/color' | 'page/title/color' | 'page/marginFillColor' | 'page/marginFrameColor' | 'page/safetyFillColor' | 'page/safetyFrameColor' | 'page/exclusionAreaFillColor' | 'page/exclusionAreaFrameColor' | 'page/innerBorderColor' | 'page/outerBorderColor' | 'colorMaskingSettings/maskColor' | (string & {});\ntype SettingDoublePropertyName = 'clip/defaultDurationValue' | (string & {});\ntype SettingEnumType = {\n 'clip/initialDurationMode': ClipInitialDurationMode;\n 'touch/pinchAction': TouchPinchAction;\n 'touch/rotateAction': TouchRotateAction;\n 'camera/clamping/overshootMode': CameraClampingOvershootMode;\n 'controlGizmo/moveHandleVisibility': ControlGizmoMoveHandleVisibility;\n 'controlGizmo/resizeHandlesVisibility': ControlGizmoResizeHandlesVisibility;\n 'controlGizmo/scaleHandlesVisibility': ControlGizmoScaleHandlesVisibility;\n 'controlGizmo/rotateHandlesVisibility': ControlGizmoRotateHandlesVisibility;\n doubleClickSelectionMode: DoubleClickSelectionMode;\n 'colorPicker/colorMode': ColorPickerColorMode;\n 'timeline/trackVisibility': TimelineTrackVisibility;\n};\ntype SettingFloatPropertyName = 'positionSnappingThreshold' | 'rotationSnappingThreshold' | 'grid/spacingX' | 'grid/spacingY' | 'dragToSwapFills/longPressDurationMs' | 'controlGizmo/blockScaleDownLimit' | 'exportPendingTimeoutSeconds' | 'listIndentPerLevel' | 'tabStopInterval' | (string & {});\ntype SettingIntPropertyName = 'maxImageSize' | 'maxPreviewResolution' | 'maxConcurrentRequestsPerHost' | (string & {});\ntype SettingKey = keyof Settings;\ninterface Settings {\n 'clip/defaultDurationValue': number;\n 'clip/initialDurationMode': 'default' | 'followParent';\n 'controlGizmo/showCropHandles': boolean;\n 'controlGizmo/showCropScaleHandles': boolean;\n /** @deprecated Use `controlGizmo/moveHandleVisibility`. `false` hides the move handle. */\n 'controlGizmo/showMoveHandles': boolean;\n /** @deprecated Use `controlGizmo/moveHandleVisibility`. `false` shows the move handle at any block size. */\n 'controlGizmo/dynamicMoveHandleVisibility': boolean;\n /** @deprecated Use `controlGizmo/resizeHandlesVisibility`. `false` hides the edge (resize) handles. */\n 'controlGizmo/showResizeHandles': boolean;\n /** @deprecated Use `controlGizmo/rotateHandlesVisibility`. `false` hides the rotation handle. */\n 'controlGizmo/showRotateHandles': boolean;\n /** @deprecated Use `controlGizmo/scaleHandlesVisibility`. `false` hides the corner (scale) handles. */\n 'controlGizmo/showScaleHandles': boolean;\n doubleClickToCropEnabled: boolean;\n 'dragToSwapFills/enabled': boolean;\n 'features/singlePageModeEnabled': boolean;\n 'features/fileSystemUsageEnabled': boolean;\n 'features/pageCarouselEnabled': boolean;\n 'features/transformEditsRetainCoverMode': boolean;\n 'features/clampTextBlockWidthToPageDimensionsDuringEditing': boolean;\n 'features/equalDistanceSnappingEnabled': boolean;\n 'features/transformLockedClickThroughEnabled': boolean;\n 'features/previewMotionBlurEnabled': boolean;\n 'features/fontLineGapEnabled': boolean;\n 'features/historyEnabled': boolean;\n 'mouse/enableScroll': boolean;\n 'mouse/enableZoom': boolean;\n 'page/allowCropInteraction': boolean;\n 'page/allowMoveInteraction': boolean;\n 'page/marqueeSelectOnBodyDrag': boolean;\n 'page/restrictPageSelectionToBorderAndTitle': boolean;\n 'page/allowResizeInteraction': boolean;\n 'page/allowRotateInteraction': boolean;\n 'page/allowShapeChange': boolean;\n 'page/dimOutOfPageAreas': boolean;\n 'page/restrictResizeInteractionToFixedAspectRatio': boolean;\n 'page/moveChildrenWhenCroppingFill': boolean;\n 'page/imageFillCoversBleed': boolean;\n 'page/title/appendPageName': boolean;\n 'page/title/canEdit': boolean;\n 'page/title/show': boolean;\n 'page/title/showOnSinglePage': boolean;\n 'page/title/showPageTitleTemplate': boolean;\n 'page/safetyRevealDuringTransform': boolean;\n 'placeholderControls/showButton': boolean;\n 'placeholderControls/showOverlay': boolean;\n 'blockAnimations/enabled': boolean;\n 'playback/showAllBlocks': boolean;\n 'grid/enabled': boolean;\n 'grid/snapEnabled': boolean;\n showBuildVersion: boolean;\n 'touch/dragStartCanSelect': boolean;\n 'touch/singlePointPanning': boolean;\n useSystemFontFallback: boolean;\n forceSystemEmojis: boolean;\n 'page/selectWhenNoBlocksSelected': boolean;\n 'page/highlightWhenCropping': boolean;\n 'page/highlightDropTarget': boolean;\n 'page/reparentBlocksToSceneWhenOutOfPage': boolean;\n clampThumbnailTextureSizes: boolean;\n 'dock/hideLabels': boolean;\n basePath: string;\n defaultEmojiFontFileUri: string;\n defaultFontFileUri: string;\n license: string;\n 'page/title/fontFileUri': string;\n 'page/title/separator': string;\n fallbackFontUri: string;\n fallbackCMYKProfileUri: string;\n 'upload/supportedMimeTypes': string;\n 'web/fetchCredentials': 'omit' | 'same-origin' | 'include';\n 'controlGizmo/blockScaleDownLimit': number;\n listIndentPerLevel: number;\n tabStopInterval: number;\n positionSnappingThreshold: number;\n rotationSnappingThreshold: number;\n 'grid/spacingX': number;\n 'grid/spacingY': number;\n 'dragToSwapFills/longPressDurationMs': number;\n exportPendingTimeoutSeconds: number;\n maxImageSize: number;\n maxPreviewResolution: number;\n maxConcurrentRequestsPerHost: number;\n borderOutlineColor: Color;\n clearColor: Color;\n 'colorMaskingSettings/maskColor': Color;\n cropOverlayColor: Color;\n errorStateColor: Color;\n highlightColor: Color;\n 'page/exclusionAreaFillColor': Color;\n 'page/exclusionAreaFrameColor': Color;\n 'page/innerBorderColor': Color;\n 'page/marginFillColor': Color;\n 'page/marginFrameColor': Color;\n 'page/outerBorderColor': Color;\n 'page/safetyFillColor': Color;\n 'page/safetyFrameColor': Color;\n 'page/title/color': Color;\n pageHighlightColor: Color;\n placeholderHighlightColor: Color;\n progressColor: Color;\n rotationSnappingGuideColor: Color;\n ruleOfThirdsLineColor: Color;\n snappingGuideColor: Color;\n textVariableHighlightColor: Color;\n handleFillColor: Color;\n 'grid/color': Color;\n 'controlGizmo/moveHandleVisibility': 'auto' | 'always' | 'never';\n 'controlGizmo/resizeHandlesVisibility': 'auto' | 'always' | 'never';\n 'controlGizmo/scaleHandlesVisibility': 'auto' | 'always' | 'never';\n 'controlGizmo/rotateHandlesVisibility': 'auto' | 'always' | 'never';\n doubleClickSelectionMode: 'Direct' | 'Hierarchical';\n 'touch/pinchAction': 'None' | 'Zoom' | 'Scale' | 'Auto' | 'Dynamic';\n 'touch/rotateAction': 'None' | 'Rotate';\n 'camera/clamping/overshootMode': 'Center' | 'Reverse';\n 'dock/iconSize': 'normal' | 'large';\n 'colorPicker/colorMode': 'RGB' | 'CMYK' | 'Any';\n 'timeline/trackVisibility': 'all' | 'active';\n 'timeline/transitionControlVisibility': 'hover' | 'always';\n 'features/textEditModeTransformHandlesEnabled': boolean;\n 'features/automaticSourceSetsEnabled': boolean;\n}\ntype SettingsBool = SettingBoolPropertyName;\ntype SettingsColor = SettingColorPropertyName;\n/** @deprecated Use SettingsColor instead. */\ntype SettingsColorRGBA = SettingsColor;\ntype SettingsDouble = SettingDoublePropertyName;\ntype SettingsFloat = SettingFloatPropertyName;\ntype SettingsInt = SettingIntPropertyName;\ntype SettingsString = SettingStringPropertyName;\ntype SettingStringPropertyName = 'basePath' | 'defaultEmojiFontFileUri' | 'defaultFontFileUri' | 'upload/supportedMimeTypes' | 'license' | 'web/fetchCredentials' | 'page/title/separator' | 'page/title/fontFileUri' | 'fallbackFontUri' | 'fallbackCMYKProfileUri' | (string & {});\ntype SettingType = 'Bool' | 'Int' | 'Float' | 'Double' | 'String' | 'Color' | 'Enum';\ntype SettingValueType<K extends SettingKey> = Settings[K];\ntype SizeMode = 'Absolute' | 'Percent' | 'Auto' | 'Absolute' | 'Percent' | 'Auto';\ntype SortingOrder = 'None' | 'Ascending' | 'Descending';\ntype SourceSetPropertyName = 'fill/image/sourceSet' | (string & {});\ntype SplitOptions = {\n attachToParent?: boolean;\n createParentTrackIfNeeded?: boolean;\n selectNewBlock?: boolean;\n};\ntype StringPropertyName = 'name' | 'scene/pageFormatId' | 'type' | 'uuid' | 'page/titleTemplate' | 'audio/fileURI' | 'text/externalReference' | 'text/fontFileUri' | 'text/pathExternalRef' | 'text/text' | 'text/typeface' | 'cutout/path' | 'caption/externalReference' | 'caption/fontFileUri' | 'caption/pathExternalRef' | 'caption/text' | 'caption/typeface' | 'effect/lut_filter/filterId' | 'effect/lut_filter/lutFileURI' | 'fill/image/externalReference' | 'fill/image/imageFileURI' | 'fill/image/previewFileURI' | 'fill/video/fileURI' | 'shape/vector_path/path' | (string & {});\ntype SyncURIResolver = (URI: string, defaultURIResolver: (URI: string) => string) => string;\ntype TimelineTrackVisibility = 'all' | 'active';\ntype TouchPinchAction = 'None' | 'Zoom' | 'Scale' | 'Auto' | 'Dynamic';\ntype TouchRotateAction = 'None' | 'Rotate';\ninterface TransientResource {\n URL: string;\n size: number;\n}\n/** @deprecated This type definition is not used anymore and will be removed. Defines the structure of a typeface definition, including metadata, family name, and font details. - 'meta': Optional metadata for the typeface, including default status, library, and categories. - 'family': The name of the typeface family. - 'fonts': An array of font definitions, each containing a font URL, weight, and style. */\ntype TypefaceDefinition = {\n meta?: {\n default?: boolean;\n library?: string;\n categories?: string[];\n };\n family: string;\n fonts: {\n fontURL: string;\n weight: FontWeight;\n style: FontStyle;\n }[];\n};\ntype ValueSetId = string;\nclass VariableAPI {\n #private;\n findAll(): string[];\n remove(key: string, options?: VariableOptions | null): void;\n createValueSet(name: string): ValueSetId;\n destroyValueSet(set: ValueSetId): void;\n setValueSetName(set: ValueSetId, name: string): void;\n getValueSetName(set: ValueSetId): string;\n findAllValueSets(): ValueSetId[];\n findValueSetByName(name: string): ValueSetId | null;\n setActiveValueSet(set: ValueSetId | null): void;\n getActiveValueSet(): ValueSetId | null;\n rename(from: string, to: string): void;\n setNumber(key: string, value: number, options?: VariableOptions | null): void;\n getNumber(key: string, options?: VariableOptions | null): number;\n setImage(key: string, uri: string, options?: VariableOptions | null): void;\n getImage(key: string, options?: VariableOptions | null): string;\n findAllOfType(type: VariableType): string[];\n}\ninterface VariableOptions {\n target?: VariableTarget | null;\n}\ntype VariableTarget = 'Default' | {\n valueSet: ValueSetId;\n};\ntype VariableType = 'String' | 'Color' | 'Number' | 'Image' | 'Typeface';\ninterface Vec2 {\n x: number;\n y: number;\n}\nconst VideoCodec: {\n readonly H264: 0;\n readonly HEVC: 1;\n readonly VP8: 2;\n readonly VP9: 3;\n readonly AV1: 4;\n readonly Auto: 5;\n};\ntype VideoCodec = (typeof VideoCodec)[keyof typeof VideoCodec];\ntype XYWH = [\n x: number,\n y: number,\n w: number,\n h: number\n];\n",
|
|
14
|
+
"docs/api/video.md": "<!-- requires:video -->\n# Video: any design can become a video\n\n<!-- requires:export -->\nScenes are not \"static\" or \"video\" at creation time — add time-based content\nto the scene you already have, then `export({ format: \"mp4\", blockId: page })` renders the page's\nauthored timeline. Do NOT rebuild a scene with `create({ type: 'scene' })` just to\nanimate it. `preview` seeks (`time`) and `export` renders the timeline in any\nscene mode.\n<!-- /requires:export -->\n<!-- unless:export -->\nScenes are not \"static\" or \"video\" at creation time — add time-based content\nto the scene you already have; the product renders the authored\ntimeline. Do NOT rebuild a scene with `create({ type: 'scene' })` just to\nanimate it. `preview` seeks (`time`) any page with a timeline, in any scene\nmode.\n<!-- /unless:export -->\n\n```js\n// Video mode: new blocks and groups last to the page's end and previews report {time, duration}.\nconst [scene] = await engine.design.findByType('scene');\nawait engine.design.setProps(scene, { scene: { mode: 'Video' } });\n\n// Page duration = length of the video.\nawait engine.design.setProps(page, { playback: { duration: 10 } }); // seconds\n\n// Timed visuals live on tracks, one track per layer (see \"Timeline: one track per layer\" below).\nconst track = await engine.design.create({ type: 'track' }, { parent: page });\nconst block = await engine.design.create(\n {\n type: 'graphic',\n props: { width: 1920, height: 1080 }\n },\n { parent: track } // the next clip of this layer goes on the same track\n);\nawait engine.design.setProps(block, {\n playback: { timeOffset: 1.0, duration: 5.0 } // enters at t=1s, visible 5s\n});\n\n<!-- requires:asset_add -->\n// Video fill — use the `uri` that `asset_add` returned.\n<!-- /requires:asset_add -->\n<!-- unless:asset_add -->\n// Video fill — use a video `uri` the design or the brief supplies.\n<!-- /unless:asset_add -->\nawait engine.design.setProps(block, {\n fill: { type: 'video', video: { fileURI: '<opaque handle>' } }\n});\nawait engine.design.setProps(block, { playback: { trimOffset: 2.0, trimLength: 5.0 } });\n\n// Animation timing and text styling are spec keys — no raw animation ids.\nawait engine.design.setProps(block, {\n animations: {\n in: { type: 'slide', duration: 0.8, easing: 'EaseOutBack' },\n loop: { type: 'breathing_loop', duration: 2 }\n }\n});\n// Every animation type and its options: the api skill's `Animation` type.\n\n// Audio block — plays during the page's timeline; fades are facade props.\nawait engine.design.create(\n {\n type: 'audio',\n props: {\n audio: { fileURI: '<opaque handle>' },\n playback: {\n timeOffset: 0,\n duration: 10,\n volume: 0.8,\n fadeIn: { duration: 0.5 },\n fadeOut: { duration: 1 }\n }\n }\n },\n { parent: page }\n);\n```\n\nSeveral audio blocks can sit on the page at once — a music bed plus a short\nsound effect per cut, each placed with its own `playback.timeOffset`.\n\n## Timeline: one track per layer\n\nA track holds a sequence of clips in one timeline row. A block placed\ndirectly on the page gets a row of its own, so a 30 s video built that way\nopens in the editor as 50+ rows, one per text and shape. Build the timeline\nthe way an editor would:\n\n- **One track per layer, created bottom first** — for example backgrounds,\n media, headline, subline, chip. Every beat's element for that layer goes\n on the same track, one after another. Only audio sits on the page itself.\n- **Tracks are layers.** A later track draws above an earlier one, for the\n whole video. Two things on screen at the same time sit on two tracks.\n- **Overlaps move up.** A clip that overlaps another on its track, beyond a\n transition, moves to a new track right above it at the end of the edit.\n- **A track is a layer, not an element.** Reuse it across beats: beat 2's\n third line and beat 3's third chip can share one track, because they are\n never on screen together. Aim for the number of layers a frame needs\n (typically 3–6), not one track per element.\n- **Things that enter together are one clip.** A list of lines or a row of\n chips that appears within one beat is a group on one track. Its children\n keep their own `timeOffset`s and in-animations for the stagger, so the\n group needs no track per item. A group takes no transition: transitions\n join two leaf clips (graphic, text, video) that follow each other on one\n track.\n- **Name clips by beat and layer** (`b3/bg`, `b3/headline`) so later edits\n find them with `findByName`.\n\n```js\n// Three beats, two layers: a background sequence and a headline sequence.\nconst bgs = await engine.design.create({ type: 'track' }, { parent: page }); // bottom\nconst words = await engine.design.create({ type: 'track' }, { parent: page }); // above\nfor (const [i, beat] of beats.entries()) {\n const bg = await engine.design.create(\n {\n type: 'graphic',\n name: `b${i}/bg`,\n props: {\n shape: { type: 'rect' },\n width: W,\n height: H,\n fill: { type: 'color', color: { value: beat.color } }\n }\n },\n { parent: bgs } // auto-arranged: back-to-back in creation order\n );\n await engine.design.setProps(bg, { playback: { duration: beat.length } });\n const line = await engine.design.create(\n {\n type: 'text',\n name: `b${i}/headline`,\n props: { text: { string: beat.line, font: { family: 'Inter', weight: 'bold' }, lineHeight: { visual: 1.1 } } }\n },\n { parent: words }\n );\n await engine.design.setProps(line, {\n playback: { timeOffset: beat.start + 0.2, duration: beat.length - 0.4 }\n });\n}\n```\n\nThe `edit` result reports it when the timeline has more rows than its\ntiming needs (\"N timeline rows (… blocks directly on the page, … tracks); by\ntheir timing the clips fit on M tracks\"). Move the blocks onto shared tracks\nin stacking order: each keeps its `timeOffset` and `duration`, and the frames\nstay the same.\n\n### Clips timed to one another: tag the sequence\n\nWhen clips are timed to the keyframes of one clip (captions,\na highlight and dividers that follow a strip's stops, the clip that ends that\nsequence), give every clip of the sequence the same `codesign/sync` metadata\nvalue, and the clip they follow `codesign/sync-lead: 'true'` too. When the user trims\nthe lead in an editor that reads the tags (the CoDesign app's), its motion\nruns faster or slower and the others inside its span compress or stretch with\nit, while those after it move up. A trim of any other member moves no other\nmember.\n\n```js\nfor (const id of [strip, highlight, ...captions, ...dividers, ending])\n await engine.design.setProps(id, { metadata: { 'codesign/sync': 'strip' } });\nawait engine.design.setProps(strip, { metadata: { 'codesign/sync-lead': 'true' } });\n```\n\n- One lead per sequence: a graphic or text whose keyframes carry the beats\n (keyframe times scale with the clip's length; entrance, exit and loop\n animations do not). Never a group, a video or an audio clip: trimming\n media cuts its content, so nothing follows it.\n- One value per sequence on a page. Clips that only share the page, not a\n timing (a headline or logo that stays for the whole video), stay untagged.\n- Tag the clips a track or the page holds, not a group's children: the group\n is the clip.\n\n## Sound: music, voiceover, sound effects\n\n<!-- requires:export -->\nAudio is part of the design, not an afterthought: it plays under the page's\ntimeline and ships inside the mp4 (or alone as `wav`/`m4a`, see Notes). A silent video is a complete deliverable\nwhen the brief chose it — say so, rather than leaving sound out by omission.\n<!-- /requires:export -->\n<!-- unless:export -->\nAudio is part of the design, not an afterthought: it plays under the page's\ntimeline and ships inside the rendered video. A silent video is a complete\ndeliverable when the brief chose it — say so, rather than leaving sound out by\nomission.\n<!-- /unless:export -->\n\n<!-- requires:asset_add -->\n- **Sources.** The user's own file → `asset_add` (mp3, wav, m4a, ogg, aac).\n<!-- /requires:asset_add -->\n<!-- unless:asset_add -->\n- **Sources.** The user's own audio, by a `uri` the design or the brief supplies.\n<!-- /unless:asset_add -->\n<!-- requires:asset_generate -->\n Otherwise `asset_generate`: music and sound effects are provider\n models (`capability: \"text2audio\", source: \"all\"`), a voiceover is\n `elevenlabs/eleven-v3-tts`, and `elevenlabs/scribe-v2` transcribes speech\n into a `transcriptUri` plus every timed sentence, or for a long recording an\n outline of where to look (its description says whether it also takes video\n and long recordings). Prompts and\n parameters per model are in\n `{{skill:models#audio.md}}`, including how to write brand names in a\n voiceover's text so they are said right. Each returns a `uri` and, when the\n file states it, a `duration` — size the page and the clips from it.\n<!-- /requires:asset_generate -->\n- **Timing.** Put a voiceover on the timeline where its sentence belongs and cut\n or animate to its words: inside `edit`,\n `engine.design.readTranscript(transcriptUri, { from, to })` gives each\n word's start and end in seconds of the source (captions and word-timed text\n use the same times).\n Music drives the cuts when there is no voice:\n `engine.design.readBeats(audio, { bpm })` maps its beats in page seconds\n (the `launch-video` skill shows how to cut to them).\n- **Levels.** One audio block per sound. Duck the\n music under a voiceover (0.3–0.5 while it speaks); a sound effect is a short\n block at the cut, 0.5–0.8 under the music. Give the bed a `fadeOut` that ends with the page\n (and a `fadeIn` unless it starts on a hit). A bed shorter than the page\n leaves a silent tail — pick a longer track, or end the page with the music.\n<!-- requires:export -->\n- **Checking it.** `preview` renders pictures, not sound: the audio is only\n heard in the exported mp4. Export once, after the judge gate passes, then confirm from the export result that\n `audioDuration` is present and about equals `duration` (no `audioDuration` means\n the mp4 has no audio track), and listen to it when your host can play it;\n otherwise tell the user which sounds sit where.\n<!-- /requires:export -->\n<!-- unless:export -->\n- **Checking it.** `preview` renders pictures, not sound: tell the user which\n sounds sit where, so they can check them in the rendered video.\n<!-- /unless:export -->\n\n## Transitions between clips\n\nA transition joins a clip to the NEXT clip on the same track (`push`, `wipe`,\n`cross-zoom`, …) and renders in the video. Only leaf clips on a track qualify —\na graphic, text or video block that is a track's child. Blocks placed on\nthe page directly, groups, pages and tracks do not. A layer's sequence of beats is\none track (see \"Timeline: one track per layer\"), so each layer gets its own\ntransitions.\n\n```js\n// clipA → the clip after it on the track; duration defaults to 1.2\nawait engine.design.setProps(clipA, {\n transition: { type: 'push', duration: 0.3, easing: 'EaseOutQuint', push: { direction: 'Up' } }\n});\n```\n\n- **Timing.** The transition runs during the overlap of the two clips. With\n auto-arrange on, a transition starts the next clip `duration` before\n the current one ends. With auto-arrange off, lengthen each clip by the transition duration yourself\n (`timeOffset` of the next clip = the cut time; this clip's duration runs\n past it by the transition length) — keep that overlap equal to the\n transition's duration, or the transition drifts off the cut.\n- **Verify transitions with `preview`.** A still at `time` inside a\n transition renders it as the mp4 does — preview its middle\n (`time` = cut + duration/2). A still that shows one clip whole there means\n the transition is not applied or not where you think: check the clip is a\n track child and the overlap equals the transition's duration.\n\n## Captions\n\nNative captions burn into the mp4 and stay editable in the editor:\npage → one `captionTrack` → one `caption` per phrase.\n\n```js\nconst track = await engine.design.create(\n { type: 'captionTrack' },\n { parent: page }\n);\nconst ids = [];\nfor (const p of phrases) // { text, start, end } from transcript word times\n ids.push(\n await engine.design.create(\n {\n type: 'caption',\n props: {\n caption: { text: p.text },\n playback: { timeOffset: p.start, duration: p.end - p.start }\n }\n },\n { parent: track }\n )\n );\n// style ONCE — every caption on the track takes it\nawait engine.design.setProps(ids[0], {\n caption: {\n font: { family: 'Inter', weight: 'bold' },\n fontSize: '56px',\n color: { r: 1, g: 1, b: 1, a: 1 },\n horizontalAlignment: 'Center'\n },\n position: { x: 90, y: 1500 },\n width: 900,\n height: 200\n});\n```\n\n- **Style and layout are track-wide.** Position, size, font, font size, colour,\n alignment, `backgroundColor` and stroke written on ANY caption apply to every\n caption on its track, and a new caption adopts them. Write them once; text,\n `playback` timing, opacity and animations are per caption.\n- **Highlight a word on one caption with `caption.ranges`**\n (`[{ from, to, color }]`, offsets into `caption.text`, the same shape\n as `text.ranges`): ranges stay on that caption. A karaoke line is one\n caption per spoken word, each carrying the full phrase with its active word\n coloured. Write the track style first: a later `caption.color` replaces\n every caption's ranges.\n- **One track per page.** A second track is a second, independent style.\n- **Phrases, not words.** Group transcript words into 2–6-word phrases that\n fit the frame; consecutive captions should not overlap in time.\n- **From a subtitle file:** `create({ type: 'captionTrack', props: { subtitles: uri } }, { parent: page })`\n parses an SRT or VTT the brief supplies into timed captions on the track\n (writing `subtitles` again replaces them); style one as above.\n- **Animate captions per caption** (`animations` on each id, set once the\n caption is on its track), e.g. a 0.2 s `fade` in; a word-by-word reveal is\n one caption per word. A caption renders no `writingStyle` and no\n typewriter_text, block_swipe_text, spread_text or merge_text\n (`{{skill:api#animation.md}}`).\n\n## Notes\n\n- **A new block lasts to its parent's end.** A text or graphic that `create` puts on a page (or a\n group) of a Video scene without a `playback.duration` lasts from its `timeOffset` to the end of\n the page or group it is in; one on a track, a video clip and audio are not stretched. Set `duration` for a shorter\n beat.\n- **Groups time their children.** A child's `timeOffset` inside a group counts from the group's\n start. A group on a page of a Video scene (`create`'s group node or `group(ids)`) lasts to the\n page's end; `create` also stretches its children that name no duration.\n A longer `playback.duration` on a group later lengthens those children too; a child\n whose duration you set, one with `keyframes`, and video or audio keep theirs.\n<!-- requires:import -->\n- **A Lottie animation** (`.json` or `.lottie`) imports as a Video design: one page of its size\n and length, its layers editable blocks with their keyframes, its markers the scene's. A layer\n CE.SDK cannot draw as blocks plays from a video fill, which `import` names in `warnings`: its\n colours, effects and speed stay as they are. A longer `playback.duration` on a block and its\n group stretches that block's keys.\n<!-- /requires:import -->\n<!-- requires:export -->\n- **Animating an existing still design?** The `animate` skill does it end to end:\n `{{skill:animate}}`.\n- Export: `export({ format: \"mp4\", blockId: page })`.\n Duration and resolution come from the page, or pass `width`/`height` for a\n file of another size: the video scales with its aspect kept, the design stays\n as it is. A size the encoder refuses gets an error naming one that fits. The\n frame rate is `fps`, else\n the scene's `scene.frameRate` (30 unless set; above 0, at most 240). The page's audio blocks are\n mixed into the mp4 (AAC; Opus where the engine has no AAC encoder). The mp4's embedded cover\n image is the frame at the page's playhead (`playback.time`).\n<!-- requires:video-limit -->\n- An mp4, wav or m4a export is at most {{max-video-seconds}} seconds long, and a video at most as much\n work as {{max-video-seconds}} seconds of 1080p at 30 fps (frames × pixels): a larger one is refused\n before it renders. Shorten the page, export it smaller with `width`/`height`, pass a lower `fps`,\n or split the video into pages and export each.\n<!-- /requires:video-limit -->\n- Audio only: `export({ format: \"wav\" | \"m4a\", blockId: page })`\n renders the page's audio mix (`wav` = 48 kHz stereo 16-bit PCM). Page only; for one\n clip alone, export while it is the only audio on the page. Every clip sounds\n over exactly its own window (within a few ms) — same timing as the mp4.\n<!-- /requires:export -->\n<!-- unless:export -->\n- Duration and resolution come from the page.\n<!-- /unless:export -->\n<!-- requires:diagnostics -->\n- Needs the native engine (the default). If the server fell back to WASM,\n video/audio tools refuse with the reason; `diagnostics` shows\n `status.config.videoAvailable`.\n<!-- /requires:diagnostics -->\n- Motion beyond timing — entrance/exit/loop animations, animated text, and\n custom moves with `keyframes` (seconds of the block's own duration):\n `{{skill:api#animation.md}}`; every type and its options are the api skill's\n `Animation` type.\n- **Motion blur** smears fast moves like a camera shutter:\n `setProps(block, { motionBlur: { enabled: true } })`, and on the scene\n `motionBlur: { samples, shutterAngle, shutterPhase }` (1–64, 0–720°,\n −360–360°). More samples cost export time. Preview stills and image\n exports are always sharp: check motion blur in the exported MP4.\n- **`transformParent: '<uuid or name>'`** makes a graphic or text follow\n another graphic's or text's position, rotation and scale (not its opacity\n or stacking). Its `position` then counts from the parent's top-left, so it\n moves on screen when linked; `null` unlinks. Scaling a group this way:\n `{{skill:api#animation.md}}`.\n- Markers: `setProps(scene, { markers: [{ name: 'drop', time: 8.2, duration? }] })`\n keeps named moments (seconds) in the design for later edits and the\n editor's timeline — e.g. the beats you cut to. The list is replaced\n wholesale; `getProps(scene, ['markers'])` reads it.\n- `preview` renders a STILL frame, not motion — pass `time` (seconds) to seek\n any page with a timeline, whatever the scene mode: verify a few salient\n moments (start, mid-beat, the middle of each transition, the end). Each\n timed preview returns `{time, duration}` JSON next to the image.\n<!-- requires:export -->\n Export for the real thing.\n- Resource loading during export is handled server-side — you do NOT need a\n `loadResources` barrier before `export`.\n Trim writes, an audio block's `playback.speed` and reading a clip's length\n (`getProps(clip, ['fill']).fill.video.totalDuration`, audio: `audio.totalDuration`)\n load the clip themselves.\n- On video, the fill's `trimLength` sets the block's `duration`, one way only.\n<!-- /requires:export -->\n<!-- /requires:video -->\n",
|
|
15
|
+
"docs/brand/SKILL.md": "---\nname: brand\ndescription: >-\n Use when applying a brand kit / brand style to an existing CoDesign / CE.SDK design — a\n rules-governed restyle (recolor + refont + logo + treatment by role), not a free-form style\n change; when a restyled design reads off-brand (free-chosen colors, wrong accent, a second\n colour used as structure, a coloured button the brand forbids, a headline set in a weight the\n brand bans, a flat bordered card, or the wrong / recoloured / redrawn logo); when loading a\n brand's fonts, wordmark SVG, or signature device into a scene; or when turning an external brand\n (a guidelines PDF, a website / URL, a Figma file, or a raw asset dump) into a reusable brand kit.\n---\n\n# brand\n\nPoint this skill at the current design and a brand kit, and it re-skins the design to that brand\n<!-- requires:export -->\nunder the brand's **strict rules**. It operates on the **design in the current session**, and the\nrestyle is **exported as its own `.imgly` file**. Single home for the brand workflow: the\n<!-- /requires:export -->\n<!-- unless:export -->\nunder the brand's **strict rules**. It operates on the **design in the current session**.\nSingle home for the brand workflow: the\n<!-- /unless:export -->\n**role → token map**, the **restyle routine**, the **graded conformance pass**, and the brand\n**no-goes**.\n\n<!-- requires:export -->\n**Keep the source; restyle a copy.** A session holds one design and a restyle changes it in place,\nso take the source's `uri` first and `import` it — the restyle goes to the copy, and\nthe source stays as it was:\n\n```\nexport({ format: 'imgly' }) → SOURCE_URI (the un-branded original, kept)\n<!-- requires:open -->\nimport({ source: { uri: SOURCE_URI } }) → a copy of it is the session\n<!-- /requires:open -->\n<!-- unless:open -->\n<!-- requires:version -->\nimport({ source: { uri: SOURCE_URI } }) → a copy of it: a new design, with its own design and version\n<!-- /requires:version -->\n<!-- unless:version -->\nimport({ source: { uri: SOURCE_URI } }) → the source replaces the session; its save is a new file\n<!-- /unless:version -->\n<!-- /unless:open -->\nedit(…) restyle + conform\npreview() → diff against the source's render\nexport({ format: 'imgly' }) → the restyled edition, its own file\n```\n\nBoth editions then exist. Skipping the first two steps means the un-branded original is gone\nthe moment you restyle — and the source-parity diff the `judge` gate requires has nothing to\ncompare against.\n<!-- unless:open -->\n<!-- unless:version -->\n**Check the second save's returned `uri` is not `SOURCE_URI`** (re-saving a session\nrevises one file) — a restyle that landed back on the source replaced the un-branded original\ninstead of joining it.\n<!-- /unless:version -->\n<!-- /unless:open -->\n\n<!-- /requires:export -->\n<!-- unless:export -->\n**The source stays intact.** The product opens the restyle as its own session, so restyling the\ndesign in front of you does not touch the original. `preview` it before you change anything: that\nrender is the source the `judge` gate's parity diff compares against.\n\n<!-- /unless:export -->\nIt builds on things it does _not_ restate: design rules §6.1–§6.5 (the general typography / colour /\nhierarchy / composition / craft thresholds), the `api` skill's engine mechanics (the `text.font`\ndeclaration, fill specs, auto-reshape, `loadResources`, the content-area line-height\nconversion §6.1.3), and its two siblings. The brand kit's own `tokens.json` supplies the\n**values**; this skill supplies the **procedure**.\n\n**Scoring:** a restyle is judged with the `judge` skill — every applicable axis ≥ 8, no averaging,\nN/A = 10. The brand kit's `avoid` list + `do-dont/` gallery are an **additional** gate on top of\nthe axes: a single hard `avoid` violation (a second colour used as structure, a banned button, a\nredrawn logo, a free-chosen colour) fails the restyle even if the axes would pass — include an\n\"avoid-list\" row in the judge scorecard.\n\n## Reference files (load on demand)\n\nThis `SKILL.md` is the always-needed spine: inputs, core principle, role map, workflow, restyle\nroutine, conformance pass, the **brand conformance checklist**, no-goes. Two situational bodies live\nbeside it:\n\n- **`reference/brandkit-spec.md`** — the canonical brand-kit **schema** (what `tokens.json` must\n contain, required-core vs optional sections, how the skill degrades when a section is absent).\n Read it when validating a kit or unsure what a token means.\n- **`reference/authoring.md`** — the **intake** mode: turning an _external_ brand (a guidelines PDF,\n a website/URL, a Figma file, or a raw asset dump) into a canonical `<kit>/` before\n applying — extraction per source form, the not-invent discipline, the avoid-list hard-stop, the\n font-subset trap. Read it whenever the kit isn't already a valid canonical folder.\n- **`reference/asset-loading.md`** — the **asset mechanics** (resolving brand fonts to a fetchable\n<!-- requires:asset_add -->\n URI incl. the local-TTF → imported-`uri` bridge, the hex → 0-1 RGBA conversion, placing the\n<!-- /requires:asset_add -->\n<!-- unless:asset_add -->\n URI, the hex → 0-1 RGBA conversion, placing the\n<!-- /unless:asset_add -->\n wordmark SVG, recolouring monochrome icons, building the **kicker pill** on a text background,\n block-**opacity** vs colour-alpha, `text.color` vs colour-fill, the whole-block colour that\n flattens per-run colour). Unlike\n its two siblings this one is NOT situational — every restyle touches fonts, colours, or the\n logo, so it is required reading before the restyle routine; it lives beside the spine only to\n keep this entry document lean.\n\n## localize / resize vs brand — the three surgeries\n\nThe three sibling skills each change exactly one layer and hold the rest fixed:\n\n- **localize** — changes the **words** (+ the script's font); **snaps geometry** back to\n the reference. Any geometry move is drift.\n- **resize** — changes the **canvas**; **re-derives geometry** for the new aspect. Copy\n and style are held.\n- **brand** — changes the **style layer** (colour, type, logo, treatment) **by role**;\n **holds copy and composition**. Geometry moves only in the graded conformance pass, and only\n where a brand _rule_ requires it — never a free re-layout.\n\nNever confuse them: don't re-word or re-flow inside a brand pass (that's localize / resize), and\nif a brand genuinely needs a different _layout_ (not just a different skin), that is a **resize**,\nnot a brand restyle — cross-ref and stop, don't silently re-compose.\n\n## Inputs — what to restyle, into which brand, in which scheme\n\n<!-- requires:interactive -->\nResolve these by the intake contract — derive, ask once, echo, invent nothing:\n`{{skill:create#intake.md}}`. **R** = required, no default; **A** = ask if\nunderived; **D** = defaultable.\n<!-- /requires:interactive -->\n<!-- unless:interactive -->\nResolve these by the intake contract — derive, decide what is missing, echo, invent nothing:\n`{{skill:create#intake.md}}`. **R** = required, no default; **A** = has a default, resolved by the intake when underived; **D** = defaultable.\n<!-- /unless:interactive -->\n\n| Parameter | Kind | Chips / values | Default |\n| ------------- | ------- | ------------------------------------------------------------------------- | --------------------------------- |\n| brand kit | **R** | the kits you can find · `Provide a brand source` · Other | **none — never invented** |\n| colour scheme | A | the chosen kit's `colorSchemes.approved` · `Decide automatically` · Other | the neutral / `paper` scheme |\n| source design | derived | — | the design in the current session |\n\n<!-- requires:export -->\n**1. The source** — the design in the current session. **Export it as `.imgly` first** (`export({ format: 'imgly' })`)\nand keep its `uri`: a restyle preserves that design's geometry and copy — only the style layer\nchanges — and that file is both the un-branded original and your reference for the parity\ndiff.\n<!-- requires:open -->\nIf the user means a design saved earlier, its `uri` IS `SOURCE_URI`: `open` it to `preview` and\ncapture it, skip the first export, then `import` a copy to restyle.\n<!-- /requires:open -->\n<!-- unless:open -->\n<!-- requires:version -->\nIf the user means a design saved earlier, its `design` IS the source: `preview` it and capture it,\nskip the first export, then `import` a copy to restyle.\n<!-- /requires:version -->\n<!-- unless:version -->\nIf the user means a design saved earlier, load it with `import({ source: { uri: '<its uri>' } })`.\n<!-- /unless:version -->\n<!-- /unless:open -->\n<!-- /requires:export -->\n<!-- unless:export -->\n**1. The source** — the design in the current session. `preview` it before you change anything:\na restyle preserves that design's geometry and copy — only the style layer changes — and that\nrender is your reference for the parity diff.\n<!-- /unless:export -->\n\n**2. The brand kit** — a folder the user points you at (`<kit>/`), holding `tokens.json` (+\n`BRAND.md`, fonts, logos, icons, imagery, `do-dont/`). Parse `tokens.json` **first**; it is the\nmachine-readable law. Validate it against `reference/brandkit-spec.md`.\n<!-- requires:ly.img.workspace.styles -->\nA style the user names without handing it to you (_\"in our Acme style\"_) is saved in the\nworkspace: find it with `asset_search({ source: 'ly.img.workspace.styles', query: '<its name>' })`.\nThat answer carries the style's `STYLE.md` and `tokens.json`: they are its kit, so read nothing\nelse to apply it. When it says no style has exactly that name and others match, the kit it carries\nis a guess: ask which one is meant, or, with nobody to ask, say in your reply which one you used.\nAnother style's kit comes from a search by its id. The kits you can find are that source's assets.\n<!-- /requires:ly.img.workspace.styles -->\n<!-- requires:asset_add -->\nA saved style names its fonts, logos, icons and images in `tokens.json` by URI, not by a path in\nits folder: those files are already in the store, so use each URI as it is.\n<!-- /requires:asset_add -->\n\n<!-- requires:interactive -->\nIf no kit is named, **ask** — _**Which brand should this use?**_ — offering the kits you can find\nplus `Provide a brand source`. A brand is the user's own fact: there is no\ndefaulting to \"a sensible brand\", and no proceeding on an inferred one.\n<!-- /requires:interactive -->\n<!-- unless:interactive -->\nIf no kit is named, change nothing and say in your reply that the restyle needs a brand kit. A\nbrand is the user's own fact: there is no defaulting to \"a sensible brand\", and no proceeding on an\ninferred one.\n<!-- /unless:interactive -->\n\n<!-- requires:interactive -->\nIf what the user gives you is **not** a canonical kit yet — an external source (a guidelines PDF, a\nwebsite/URL, a Figma file, or a raw asset dump), or a folder with no valid `tokens.json` —\n**scaffold it into the canonical shape first** (extract → map → `tokens.json` + `BRAND.md` + assets\n→ validate), per **`reference/authoring.md`**, then apply against the new kit. Ask the user where\nthe kit folder should live; it is theirs to keep and reuse.\n<!-- /requires:interactive -->\n<!-- unless:interactive -->\nIf what the user gives you is **not** a canonical kit yet — an external source (a guidelines PDF, a\nwebsite/URL, a Figma file, or a raw asset dump), or a folder with no valid `tokens.json` —\n**scaffold it into the canonical shape first** (extract → map → `tokens.json` + `BRAND.md` + assets\n→ validate), per **`reference/authoring.md`**, then apply against the new kit. Put the kit folder\nbeside the source you were given, and say where it is; it is theirs to keep and reuse.\n<!-- /unless:interactive -->\n\n<!-- requires:interactive -->\n**If the required-core is incomplete, ask for the missing piece — don't stop, and don't guess.**\nNever fill a gap in a kit with a value of your own: not a colour, not a typeface, not a logo.\nName what is missing and ask for exactly that, e.g.\n\n> The Acme kit has no display font — `typography.display` is empty, and I won't pick one for your\n> brand.\n> **Which font should headlines use?** `Provide a font file` · `Name a Google font` ·\n> `Use the kit's body font` · Other\n<!-- /requires:interactive -->\n<!-- unless:interactive -->\n**If the required-core is incomplete, don't guess.** Never fill a gap in a kit with a value of\nyour own: not a colour, not a typeface, not a logo. Change nothing, and name in your reply exactly\nwhat is missing, e.g. \"The Acme kit has no display font — `typography.display` is empty, and I\nwon't pick one for your brand.\" \n<!-- /unless:interactive -->\n\n**3. The scheme** — one **approved** `colorScheme` from `tokens.colorSchemes.approved`, chosen\ndeliberately per `backgroundSelection` (default the neutral/`paper` scheme; use the full-bleed\nbrand-colour scheme only for a deliberate hero). If the kit offers more than one approved scheme\n<!-- requires:interactive -->\nand nothing in the request implies which, ask — _**Which colour scheme?**_ — with the kit's own\napproved schemes as chips plus `Decide automatically`. Reading the chips from `tokens.json` is not\ninvention; free-choosing a `(bg, text, accent)` triple is. **One scheme per piece** — never a\n`denied` combination.\n<!-- /requires:interactive -->\n<!-- unless:interactive -->\nand nothing in the request implies which, take the default and say so in the echo. Choosing among\nthe schemes in `tokens.json` is not invention; free-choosing a `(bg, text, accent)` triple is.\n**One scheme per piece** — never a `denied` combination.\n<!-- /unless:interactive -->\n\nThen echo what you resolved in one line (\"acme restyle, paper scheme (defaulted), 1 design\") and\nrun the Workflow. The restyling `edit` gets a `note` naming the brand and scheme (e.g. \"acme\nrestyle, paper scheme\").\n\n## Core principle — re-skin by role, then conform to the brand's law\n\nA brand kit is not a palette swap — it is a **role system**. Restyling is two layers:\n\n- **Layer 1 — Restyle (always).** Classify each source block by its **design role**, then set its\n colour + font + treatment from the **brand token for that role** (background → scheme background;\n headline → display family; the one focal moment → accent; eyebrow → kicker style; …). Geometry\n unchanged. This is deterministic once roles are mapped.\n- **Layer 2 — Graded conformance.** Enforce the brand's structural law where it does **not** fight\n the source composition: kill every hard `avoid` / `denied` violation (non-negotiable), then apply\n the applicable structural rules (proportion, safe-area margins, kicker-as-pill, card shadow,\n signature device, size thresholds). A rule that would require re-laying-out the piece is\n out-of-scope — flag it (→ resize), don't force it.\n\nThe brand's `avoid` list is the floor: **no restyle ships with a hard `avoid` violation**, even if\nevery axis scores ≥ 8.\n\n**Bound designs re-theme in one write.** Read `getProps(id, ['bindings'])` on the blocks first: a\nleaf bound to a scene variable (`'fill.color': 'accent'`, `'text.font': 'display'`) refuses a\ndirect write (`DESIGN.PROPERTY_BOUND`) — set the variable instead, and every block bound to it\nfollows: `setProps(scene, { variables: { accent: { color: TOKEN }, display: { font: { family } } } })`.\nWhen the brief asks for a design that switches between brands or schemes, build it that way: one\ncolour or font variable per role token, each role's blocks bound to it\n(`{{skill:templates}}`); the switch is then one `variables` write per scheme, or one value set per\nscheme that `activeValueSet` picks. A design with bindings but no `variables` was saved before\nvariables were kept: write every bound variable.\n\n## Role → token map\n\nClassify by measurable role (as in the localize skill's block classification), then map:\n\n| Source block role | Brand token (from `tokens.json`) |\n| ------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |\n| full-bleed background | chosen `colorSchemes.approved[].background` |\n| headline / display / big number | `typography.display` family; text = scheme `text` (or `primary-foreground` on a colour field); **respect `headlineWeight`** — never exceed the brand's weight _at that size_ (a `typography.display.weightRule` may vary it by size) |\n| subline / lead / body | `typography.body` family; text = scheme `text` or `muted-foreground` |\n| the single focal moment (one accent) | scheme `accent` / `semanticColors.primary` — **one per piece**, but the `avoid` list wins (see the trap below): on a full-bleed brand-colour scheme the accent role often has **no valid target** — drop it, the field is the moment |\n| eyebrow / kicker | `elements.kicker` (pill shape + its text colour) — not a bare coloured label |\n| divider / rule | `elements.divider` (hairline) — never a coloured/second-colour stroke |\n| card / panel / tile | `shape` corner radius + `elevation` shadow — never a flat bordered box |\n| CTA | `elements.button` **only on interactive/mockup media**; on static media a CTA is text/URL |\n| logo / wordmark | `logo.variantsByBackground` picked by the chosen background — exact bundled SVG only; if the asset is `$meta.gaps`-flagged (trademark-locked / not fetched), skip or placeholder it, never invent/redraw |\n| monochrome icon | recolour its ink to the role colour (`reference/asset-loading.md`) |\n| photographic / product media | keep; grade per `imagery` if the brand specifies; never tint to a banned colour |\n\nWhere the source has no block for an optional brand element (device, kicker), the conformance pass\n_may_ add it if it fits; where the brand kit lacks an optional token, skip that rule (graceful\ndegradation — `reference/brandkit-spec.md`).\n\n**The scheme-accent trap — `avoid` overrides the scheme.** A `colorSchemes.approved` entry may list\nan `accent` the `avoid` list forbids in the context you're applying it (e.g. IMG.LY's `indigo-moment`\nlists a mint accent, but `avoid` bans mint text on an indigo field). When the scheme's accent and\nthe `avoid` list conflict, **the `avoid` list wins**: apply **no** accent and let the full-bleed\nfield be the moment. Do not add a mint (or any denied) accent just because the role map has an\n\"accent\" row — an empty accent role is correct here.\n\n**Non-hero archetypes.** The role map is written for a headline+subline hero, but many designs aren't\none — a quote card is eyebrow / quote-as-display / attribution-caption with no \"lead\". Map by the\n_nearest_ role (quote → `typography.display`; attribution → `typography.body`/caption) and ignore\nrows with no matching block; don't invent a subline to satisfy `typography.pairing`.\n\n## Workflow\n\n1. **Load & validate the brand kit.** Parse `tokens.json`; read `avoid` + skim `do-dont/`. Resolve\n<!-- requires:asset_add -->\n every needed font to a fetchable URI and `asset_add` the logo SVG(s) — **`reference/asset-loading.md`**;\n a file `tokens.json` names by URI already is one: use it as it is, no `asset_add`.\n<!-- /requires:asset_add -->\n<!-- unless:asset_add -->\n every needed font and the logo SVG(s) to fetchable URIs — **`reference/asset-loading.md`**.\n<!-- /unless:asset_add -->\n<!-- requires:export -->\n2. **Read the source, and export it.** The design resolved in Inputs is the reference — its geometry\n and copy are what the restyle preserves. `preview` it now and `export({ format: 'imgly' })` it:\n that render is the only source render the parity diff in step 7 will have, and that file is the\n un-branded original.\n<!-- requires:import -->\n Then `import({ source: { uri: SOURCE_URI } })` — restyle the copy, never the source.\n<!-- /requires:import -->\n<!-- /requires:export -->\n<!-- unless:export -->\n2. **Read the source.** The design resolved in Inputs is the reference — its geometry\n and copy are what the restyle preserves. `preview` it now, before any change: that render is\n the only source render the parity diff in step 7 will have.\n<!-- /unless:export -->\n3. **Capture source roles + style.** Walk the scene; classify blocks by role; read each block's\n current colour / font / geometry (see routine).\n4. **Pick one approved scheme** per piece (per `backgroundSelection`); pick the logo variant by the\n chosen background.\n5. **Layer 1 — Restyle.** For each block set the brand token for its role — recolour,\n refont (unique `typeface.name`), apply radius/shadow/accent, swap the logo. **Re-map the accent\n runs in the same write** — a font/size change auto-reshapes with ranges preserved, but the\n whole-block role colour flattens per-character colour, so the accent runs go back on as\n `text.ranges` in that same `setProps`. Geometry untouched.\n6. **Layer 2 — Graded conformance.** Fix every hard `avoid`/`denied` violation; apply the structural\n rules that fit the source (proportion ~ the brand's ratio, safe-area margins, kicker pill, card\n shadow, device placement, size thresholds). Flag any layout-level need as out-of-scope (→ resize).\n7. **Judge against the source** — a restyle is a **source-derived variant**: diff this render\n against the source render you captured in step 2. Copy, geometry, and composition must be the\n<!-- requires:import -->\n<!-- requires:open -->\n source's; only the style layer moved. (Lost that render? `export({ format: 'imgly' })` the\n restyle for its `uri`, `open` the source, `preview` it, then `open` the restyle's `uri` to\n return.) Then run the `judge` skill with the brand `avoid`/`do-dont`\n<!-- /requires:open -->\n<!-- unless:open -->\n<!-- requires:version -->\n source's; only the style layer moved. (Lost that render? `preview({ design: '<source design>' })`\n it, then carry on with the restyle by its own `design`.) Then run the `judge` skill with the\n brand `avoid`/`do-dont`\n<!-- /requires:version -->\n<!-- unless:version -->\n source's; only the style layer moved. (Lost that render? Save the restyle first —\n `export({ format: 'imgly' })` — then `import` the saved source, `preview` it, and `import` the\n restyle's `uri` back; its next save is a new file, so report that `uri`.) Then run the `judge`\n skill with the brand `avoid`/`do-dont`\n<!-- /unless:version -->\n<!-- /unless:open -->\n<!-- /requires:import -->\n<!-- unless:import -->\n source's; only the style layer moved. Then run the `judge` skill with the brand `avoid`/`do-dont`\n<!-- /unless:import -->\n added to the criteria; contrast ≥ 4.5:1 after every recolour. Fix anything < 8 or any hard\n violation.\n<!-- requires:export -->\n<!-- requires:drafts -->\n8. **`loadResources` → `preview` → `export`.** Preview the restyle — wrong face, lost colour, low\n contrast, and a banned tell only show in the render. Then `export({ format: 'imgly' })`: that\n file is the branded edition to hand over (the copy itself is saved as you edit it). Report\n both `uri`s — original and restyle.\n<!-- /requires:drafts -->\n<!-- unless:drafts -->\n8. **`loadResources` → `preview`.** Preview the restyle — wrong face, lost colour, low\n contrast, and a banned tell only show in the render. The restyle is kept as you edit it;\n `export({ format: 'imgly' })` returns its `uri`. Report both `uri`s — original and restyle.\n<!-- /unless:drafts -->\n<!-- /requires:export -->\n<!-- unless:export -->\n8. **`loadResources` → `preview`.** Preview the restyle — wrong face, lost colour, low\n contrast, and a banned tell only show in the render. The product keeps the restyle after every\n successful `edit`; there is nothing to save.\n<!-- /unless:export -->\n\nDry-run the conformance checklist (below) against each render before reporting done.\n\n## The restyle routine\n\n<!-- requires:export -->\nLayer-1 as a CoDesign `edit`, run on the copy of the source. It classifies, maps role →\n<!-- /requires:export -->\n<!-- unless:export -->\nLayer-1 as a CoDesign `edit`, run on the source. It classifies, maps role →\n<!-- /unless:export -->\ntoken, and recolours/refonts with the accent re-map guard. It is a **judgment-driven\nfirst pass** (the role classification and the focal-moment choice need your eye), not a blind\ntransform. Adapt the classification to the design; fill `SCHEME` and the font URIs from the kit\n(resolve fonts per `reference/asset-loading.md`).\n\n**Capture the source's roles + current style** (run on the source page):\n\n```js\nconst [page] = await engine.design.findByType('page');\nconst out = [];\nconst read = async (id) => {\n const p = await engine.design.getProps(id, [\n 'type',\n 'width',\n 'height',\n 'position',\n 'opacity'\n ]);\n const r = {\n id,\n type: p.type, // the SHORT name: 'text', 'graphic', 'page'\n x: Math.round(p.position.x),\n y: Math.round(p.position.y),\n w: Math.round(p.width),\n h: Math.round(p.height),\n opacity: p.opacity\n }; // a \"faint\" block is usually low opacity, NOT low colour-alpha\n if (p.type === 'text') {\n const t = (await engine.design.getProps(id, ['text'])).text;\n r.s = t.string.slice(0, 20);\n r.color = t.color; // run 0 = the base style; per-run truth is text.ranges\n // the read carries its unit ('32px', always pixels) and writes straight back\n r.fs = (await engine.design.getProps(id, ['text.fontSize'])).text.fontSize;\n }\n out.push(r);\n for (const c of await engine.design.getChildren(id)) await read(c);\n};\nfor (const c of await engine.design.getChildren(page)) await read(c);\nconst pg = await engine.design.getProps(page, ['width', 'height']);\nreturn {\n type: 'text',\n text: JSON.stringify({ pw: pg.width, ph: pg.height, b: out }, null, 1)\n};\n```\n\n**Apply brand tokens to the source** (first pass, then conform + preview):\n\n```js\n// hex '#RRGGBB' -> CE.SDK 0-1 RGBA. See reference/asset-loading.md.\nconst rgba = (hex, a = 1) => ({\n r: parseInt(hex.slice(1, 3), 16) / 255,\n g: parseInt(hex.slice(3, 5), 16) / 255,\n b: parseInt(hex.slice(5, 7), 16) / 255,\n a\n});\nconst tf = (name, uri) => ({\n name,\n fonts: [{ uri, subFamily: 'Regular', weight: 'normal', style: 'normal' }]\n});\n\n// --- from the kit: the chosen approved scheme + resolved font URIs (unique names!) ---\nconst SCHEME = { background: '#FBFBFC', text: '#2E2E2F', accent: '#471AFF' };\nconst DISPLAY = {\n uri: '<opaque handle>',\n name: 'GT Walsheim Pro Medium'\n}; // headlineWeight only\nconst BODY = { uri: '<opaque handle>', name: 'Inter' };\n// A font swap changes the content area, so re-convert any target line-height from the NEW\n// font's metrics — not a fixed factor (design rules §6.1.3). Call after the font write; the\n// lineHeight write reshapes on its own, ranges preserved.\nconst setLineHeight = async (id, targetLH) =>\n await engine.design.setProps(id, { text: { lineHeight: { visual: targetLH } } });\n\nconst [page] = await engine.design.findByType('page');\nawait engine.design.loadResources([page]);\n// classify from the capture (background = full-bleed graphic; headline = largest text;\n// lead/body = remaining text; eyebrow = small text above headline; logo/media = image fills).\n\n// text: ONE write — font + size + role colour + the re-mapped accent ranges. The font/size\n// write auto-reshapes with ranges preserved, so there is no capture → reshape → replay dance;\n// the runs are read only because the whole-block role colour flattens per-character colour.\nconst setTextRole = async (id, font, hex, px, accentHex) => {\n const runs = (await engine.design.getProps(id, ['text.ranges'])).text.ranges; // NOT text.color — that is run 0 only\n await engine.design.setProps(id, {\n text: {\n font: { typeface: tf(font.name, font.uri), uri: font.uri },\n ...(px ? { fontSize: px + 'px' } : {}), // the unit is required\n color: rgba(hex), // role colour = the base style\n // When RE-branding, re-map the accent runs to the new brand's accent — replaying\n // r.color verbatim would keep the OLD brand's colour. The old face's typeface/style\n // are NOT replayed: the new family may not ship them.\n ranges: runs.slice(1).map((r) => ({\n from: r.from,\n to: r.to,\n color: accentHex ? rgba(accentHex) : r.color,\n ...(r.weight ? { weight: r.weight } : {})\n }))\n }\n });\n};\n// graphic fill (background / accent shape)\nconst setFillRole = async (id, hex) => {\n await engine.design.setProps(id, {\n fill: { type: 'color', color: { value: rgba(hex) } }\n });\n};\n// e.g.: await setFillRole(bgId, SCHEME.background);\n// await setTextRole(headlineId, DISPLAY, SCHEME.text);\n// await setTextRole(leadId, BODY, SCHEME.text);\n// await setTextRole(accentWordId, DISPLAY, SCHEME.accent); // the ONE accent moment\n<!-- requires:asset_add -->\n// logo: asset_add the variant SVG for this background (a file named by URI: that URI as is), set as image fill (asset-loading.md).\n<!-- /requires:asset_add -->\n<!-- unless:asset_add -->\n// logo: the variant SVG for this background, by a fetchable uri, set as image fill (asset-loading.md).\n<!-- /unless:asset_add -->\n\nawait engine.design.loadResources([page]);\nreturn {\n type: 'text',\n text: 'restyled — now run the conformance pass and preview'\n};\n```\n\n## Graded conformance pass (Layer 2)\n\nAfter the restyle, walk the render against the kit and fix — hard `avoid`/`denied` first\n(non-negotiable), then structural rules where they fit the source:\n\n- **Hard `avoid` / `denied`** (always fix): a second/accent colour used as a stroke, underline,\n divider, label, or icon (accent is a fill pop only); the accent colour as a button fill when the\n kit bans it; a headline in a banned weight; a flat bordered card with no shadow; the logo redrawn,\n recoloured, or the wrong background variant; a free-chosen colour or a `denied` scheme; a\n background that matches a placed photo's dominant hue.\n- **Proportion** — roughly the kit's neutrals/text/accent ratio (e.g. 70/20/10). If it reads\n \"colourful\", there's too much accent and too little neutral.\n- **Safe-area margins** — content inside the kit's outer margin; logo in its clear zone; nothing\n crowds an edge, the media, or the logo. If it doesn't fit, shrink the headline — never the subline.\n- **Elements** — eyebrow → pill kicker; divider → hairline; CTA → text/URL on static media (only a\n real button on interactive/mockup media, in the kit's button style).\n- **Wordmark vs preserved copy** — if the source's _copy_ already carries a **foreign brand** in the\n signature slot (a handle/URL for a different brand, kept because copy is preserved), don't overwrite\n it and don't imply the foreign brand is yours. Place the brand wordmark in a **non-competing**\n safe-area corner as the publisher mark, treat the foreign handle as attribution, or omit the\n wordmark — never stack two brands as co-equal marks.\n- **Device** (optional) — if the kit has a signature device and the composition has room, place it\n per its placement grammar (one per piece, bleed off one edge, atmosphere behind content).\n- **Size thresholds** — drop the wordmark for the symbol / drop the kicker below the kit's minimums\n rather than shrinking them illegibly.\n\nA fix that would require re-laying-out the piece (not just re-skinning) is **out of scope** — record\nit and recommend a resize.\n\n## Before reporting done\n\nRun the **brand conformance checklist** below against each render — **with the source render beside\nit** — then close with a `judge` run (the `judge` skill; a restyle is a source-derived variant, so\nits source-parity diff is a mandatory gate step, and the kit's `avoid` list is an extra scorecard\nrow on top of the axes). Score honestly — a surviving hard `avoid` violation is a fail, say so.\n\n### Brand conformance checklist\n\nAny \"no\" on an applicable line drops the axis below 8 (or, for the `avoid` rows, fails the restyle\noutright).\n\n**Source parity — what a restyle must NOT change**\n\n- [ ] **Copy verbatim** — every string is the source's string; nothing re-worded, shortened, or\n dropped to fit the new face. (Re-wording is `localize`.)\n- [ ] **Geometry held** — every block sits at its source position and size; the only moves are ones a\n named brand rule demanded (safe-area margin, kicker pill, size threshold), and you can name\n which rule for each\n- [ ] **Element inventory complete** — every source cluster (text, image, chip, icon, decoration) has a\n counterpart; nothing dropped, nothing invented to satisfy a role row\n- [ ] **Role parity** — the block that was the background is still the background, the one accent\n moment is still that block, the divider is still a divider. Values changed; roles didn't\n- [ ] **Hierarchy preserved** — the same dominant element, the same reading order; relative weight and\n size order across blocks matches the source (§6.3)\n- [ ] **Group hierarchy intact** — the restyle didn't flatten or re-nest the source's groups\n- [ ] **No re-wrap fallout** — the font swap didn't change any block's line count into an overflow,\n a collision, or a pushed neighbour (diff line counts against the source, not just positions)\n\n**Brand conformance — what a restyle must change**\n\n- [ ] **Zero hard `avoid` / `denied` violations** — no accent as structure (stroke/underline/divider/\n label/icon), no banned button or headline weight, no flat bordered card, no free-chosen colour,\n no `denied` scheme combination\n- [ ] **Logo untampered** — exact bundled SVG, the variant matching the chosen background, scaled\n proportionally; never redrawn, recoloured, or stretched; `$meta.gaps`-flagged assets skipped,\n not invented\n- [ ] **One approved scheme**, applied whole; the accent role empty where the `avoid` list forbids it\n on this field (the scheme-accent trap)\n- [ ] **Every role mapped to its token** — display family on headlines, body family on body, kicker as\n a pill, divider as a hairline, card radius + elevation; rows with no matching block skipped, not\n forced\n- [ ] **Proportion** ≈ the kit's neutrals/text/accent ratio; the piece doesn't read \"colourful\"\n- [ ] **Safe-area margins + logo clear zone** respected; nothing crowds an edge, the media, or the mark\n- [ ] **No competing marks** — a foreign brand preserved in the copy is attribution, not a co-equal\n lockup with the kit's wordmark\n\n**Craft / baseline**\n\n- [ ] **Fonts actually swapped** — unique `typeface.name` per typeface; every weight you set is\n declared in `typeface.fonts` (a variable TTF serves them all, one entry per weight)\n- [ ] **Accent colours survived the recolour** — the whole-block role colour flattens per-run\n colour, so every accent run went back on as a `text.ranges` entry in the same write; no block\n left at the engine default\n- [ ] **Contrast ≥ 4.5:1** for every text block on its actual background, checked after recolour\n- [ ] **Zero tofu** — the brand font covers every glyph in the preserved copy, checked in `preview`\n- [ ] Native export dimensions (the page's own pixel size)\n\n## No-goes / red flags\n\n- **Free-chosen colour** — a colour not from an approved scheme / a ramp step. Pick a scheme; move\n along a ramp for variation; never invent a hue.\n- **Accent used as structure** — the brand's accent (e.g. a mint/green) as a stroke, tick, underline,\n divider, label, or icon. Accent is a rare fill pop, not a co-lead.\n- **Banned button / weight** — a coloured button the kit forbids, a drawn button on static media, or\n a headline in a weight the kit doesn't ship.\n- **Logo tampering** — recreating, redrawing, recolouring, or stretching the wordmark, or the wrong\n background variant (dot vanishes on a matching fill). Exact bundled SVG only; scale proportionally.\n- **Role colour flattened the accent** — a whole-block `text.color` write collapses every run to\n the role colour. Re-apply the accent runs as `text.ranges` in the same `setProps`.\n- **Font not actually swapped** — a new URI under a reused `typeface.name` silently no-ops. Unique\n names; and declare every weight you set (a variable TTF needs one `fonts[]` entry per weight).\n- **Tofu** — brand font lacks a glyph in the copy; only `preview` catches it.\n- **Contrast fail** — text < 4.5:1 after recolour (esp. on a colour field). Re-pick the role colour.\n- **Geometry drift** — moving/re-flowing blocks in a restyle. This is not resize; hold the source\n geometry (conformance moves only what a brand _rule_ demands).\n- **Copy drift** — re-wording, shortening, or dropping a line because the brand face runs longer.\n Copy is held; fix the type (size within its band, measure, leading), never the text. Rewriting is\n `localize`'s layer, not this one.\n- **Re-wrap fallout** — the swapped face has different advance widths, so an auto-height block can\n re-wrap to a new line count, grow, and collide with or push a neighbour **without any block being\n moved**. Geometry looks held and the layout still broke. Diff line counts against the source after\n the refont, not just positions.\n- **Role inversion** — every value came from the kit, but a role moved: a rule recoloured into a\n second lead, a caption promoted to the accent moment, the background and card swapped. Values\n change in a restyle; roles don't.\n- **Judged in isolation** — scoring the restyle's own PNG without the source beside it. A restyle is\n a source-derived variant; the source-parity diff is a mandatory gate step (`judge`), not a\n nice-to-have.\n\n## Cross-references\n\n- **`reference/brandkit-spec.md`** — the brand-kit schema contract (required-core vs optional;\n graceful degradation) — the _target shape_.\n- **`reference/authoring.md`** — the intake mode: ingesting an external brand (PDF / URL / Figma /\n asset dump) into that shape — _how to reach it_.\n<!-- requires:asset_add -->\n- **`reference/asset-loading.md`** — font-URI resolution (CDN + local-TTF → the returned `uri` bridge),\n<!-- /requires:asset_add -->\n<!-- unless:asset_add -->\n- **`reference/asset-loading.md`** — font-URI resolution,\n<!-- /unless:asset_add -->\n hex → RGBA, logo SVG placement, icon recolour, colour-fill mechanics.\n- design rules §6.1–§6.5 — the general typography / colour / hierarchy / composition / craft\n thresholds this skill applies through a brand's values; and the `api` skill's engine mechanics\n (the `text.font` declaration, fill specs, auto-reshape, `loadResources`, content-area\n line-height conversion §6.1.3, pixel font sizes).\n- **`judge`** — the acceptance gate; a restyle is judged as a **source-derived variant** (preview the\n source, diff the two renders), with the brand's `avoid` list added to the criteria as its own\n scorecard row.\n- **`localize`** — translate a design (snap geometry); **`resize`** — reformat a design\n (re-derive geometry). Brand is the third surgery (swap the style layer).\n",
|
|
16
16
|
"docs/brand/reference/asset-loading.md": "# Brand-asset loading (CoDesign / CE.SDK)\n\nReference for the `brand` skill. Read this before the restyle routine — every restyle needs a\nfetchable font URI, a colour conversion, and (usually) the wordmark placed. Mechanics verified\nagainst this server.\n\n## 1. Fonts — resolve every brand font to a fetchable URI\n\n<!-- requires:asset_add -->\nA font write — `setProps(id, { text: { font: { typeface, uri } } })` — takes **one `uri`** that\nmust resolve to a **single, complete, static-or-variable TTF**, over a **fetchable source only** (an\n`https://` URL, or a `uri` from `asset_add` — local `file:` paths are rejected when the scene is\nsaved, and a `data:` URI is kept only by a host with an asset source that takes uploaded files). The\n`typeface` is `{ name, fonts:[{ uri, subFamily, weight, style }] }`.\n<!-- /requires:asset_add -->\n<!-- unless:asset_add -->\nA font write — `setProps(id, { text: { font: { typeface, uri } } })` — takes **one `uri`** that\nmust resolve to a **single, complete, static-or-variable TTF**, over a **fetchable source only** (an\n`https://` URL — local `file:` paths are rejected when the scene is saved, and a `data:` URI is\nkept only by a host with an asset source that takes uploaded files). The `typeface` is\n`{ name, fonts:[{ uri, subFamily, weight, style }] }`.\n<!-- /unless:asset_add -->\n\n<!-- requires:asset_add -->\n**A saved style's files are already in the store.** When `tokens.json` names a font, logo, icon\nor image by URI rather than by a path in the kit's folder, that URI is fetchable as it is: put it in\n`font.uri` and every `typeface.fonts[].uri`, or in the image fill, without bringing the file in again. The rest\nof this section is for a kit whose files are paths in its folder.\n<!-- /requires:asset_add -->\n\nTwo sources, in order of preference:\n\n**A. On a public CDN (OFL / Google-hosted families — Inter, Roboto, Montserrat, …):** use the\n`https://` URI directly, exactly as `{{skill:localize#reference/font-loading.md}}` does (jsDelivr\n`https://cdn.jsdelivr.net/gh/google/fonts@main/ofl/<dir>/<File>.ttf`), or look the family up by\nname (`text.font: { family }`). No bridge needed. Most brands' **body** font resolves\nthis way (the IMG.LY kit's Inter does).\n\n<!-- requires:asset_add -->\n**B. Proprietary / not-on-a-CDN (e.g. GT Walsheim):** pass the bundled font file straight to\n`asset_add` — it accepts `.ttf`, `.otf`, `.woff` and `.woff2` alongside images, and returns the\n`uri` to use:\n\n```js\n// asset_add({ source: { path: '<kit>/fonts/<Font>.ttf' } })\n// -> { uri: '<opaque handle>', kind: 'font', ... }\n```\n\nThen `setProps(id, { text: { font: { typeface: tf('<Brand Display Name>', uri), uri } } })` — the\nreturned `uri` goes in BOTH places: `font.uri` and every `typeface.fonts[].uri`. That handle is a sanctioned,\npersistable scheme, so the saved `design.imgly` stays loadable (the bytes are in the store). Never\nhand-copy files into the workspace store: `asset_add` content-addresses them for you, and a\nhand-placed file with the wrong hash is unreachable. On a hosted CoDesign server (no disk access,\nso no `{ path }` arm), host the proprietary font at an `https://` URL instead and use that.\n<!-- /requires:asset_add -->\n<!-- unless:asset_add -->\n**B. Proprietary / not-on-a-CDN (e.g. GT Walsheim):** look the family up by name if one of this\ndeployment's typeface sources carries it; otherwise it needs an `https://` URL. A font file cannot be\nbrought in from here — if neither exists, ask for one rather than substituting a face.\n<!-- /unless:asset_add -->\n\n### Weights from a variable file\n\nA variable TTF gives **every weight you declare**: list each one as its own `typeface.fonts` entry,\nall pointing at the same file (`{ uri, subFamily: 'Bold', weight: 'bold', style: 'normal' }`), and\nthe engine draws that weight. A typeface that declares one entry has only that weight — asking for\nanother fails with \"Failed to find a font with the specified weight\". The IMG.LY kit ships **no Bold GT Walsheim on purpose** (`headlineWeight` = 500\nMedium); honour that — never fake a heavier weight.\n\n### Font-write gotchas (script-agnostic)\n\n- **Unique `typeface.name` per distinct face.** CE.SDK treats two typefaces with the same `name` as\n identical and skips the reload — a new URI under a reused name **silently no-ops** and the old\n font stays. Give the brand faces distinct names (`\"GT Walsheim Pro Medium\"`, `\"Inter\"`).\n- **A font, size or line-height write reshapes on its own, ranges preserved.** A whole-block\n `text.color` write flattens per-character colour, so read `text.ranges` first and re-map the\n accent runs in the same write (§2); `text.color` reads run 0 only.\n- **Await before you measure or capture:** `await engine.design.loadResources([page])`;\n `(await engine.design.measure(id)).width > 0` is the \"loaded + shaped\" signal (`width` is 0 in\n Auto mode).\n- **Always `preview`.** A missing-glyph tofu or a silent sans fallback only shows in the render.\n\n## 2. Colour — hex → CE.SDK 0-1 RGBA\n\nCE.SDK colours are **0-1 floats**, not 0-255 and not hex. Brand kits author hex, so bridge:\n\n```js\nconst rgba = (hex, a = 1) => ({\n r: parseInt(hex.slice(1, 3), 16) / 255,\n g: parseInt(hex.slice(3, 5), 16) / 255,\n b: parseInt(hex.slice(5, 7), 16) / 255,\n a\n});\n// '#471AFF' -> { r:0.278, g:0.102, b:1, a:1 }\n```\n\nTwo writes:\n\n- **Text:** `await engine.design.setProps(id, { text: { color: rgba('#2E2E2F') } })` (whole block) or\n `text: { ranges: [{ from, to, color }] }` for a character range (e.g. one accent word).\n- **Shape / background fill (graphic block):**\n\n ```js\n await engine.design.setProps(graphicId, {\n fill: { type: 'color', color: { value: rgba('#FBFBFC') } }\n });\n ```\n\n A flat page colour is `setProps(page, { background: color })`; anything richer is a full-bleed\n `graphic`, appended back-most.\n\n**Border at N% alpha** (kits express e.g. \"border = ink @ 16%\"): set the fill/stroke colour's `a`\nto the fraction (`rgba('#2E2E2F', 0.16)`).\n\n## 3. Logo — place the wordmark SVG\n\n<!-- requires:asset_add -->\nA logo `tokens.json` names by URI is placed by that URI as it is, without bringing the file in again.\n<!-- /requires:asset_add -->\n\n<!-- requires:asset_add -->\n`asset_add` **accepts SVG** (and png/webp/jpg/gif). Bring the exact bundled variant in, then set it as\n<!-- /requires:asset_add -->\n<!-- unless:asset_add -->\nThe logo needs a fetchable `uri` — an `https://` URL to the exact bundled variant. Set it as\n<!-- /unless:asset_add -->\nan image fill on a graphic block sized to the logo's aspect (IMG.LY wordmark = 142×30 ≈ 4.7:1):\n\n```js\n<!-- requires:asset_add -->\n// asset_add returns { uri:'<opaque handle>', ... } — embed uri, never httpUrl\n<!-- /requires:asset_add -->\n<!-- unless:asset_add -->\n// LOGO_URI: a fetchable uri for the exact bundled variant\n<!-- /unless:asset_add -->\nconst logo = await engine.design.create(\n {\n type: 'graphic',\n props: {\n width: 220,\n height: 46.5,\n shape: 'rect',\n contentFill: { mode: 'Contain' }, // keep aspect; never stretch a logo\n fill: { type: 'image', uri: LOGO_URI } // create awaits the load\n }\n },\n { parent: page }\n);\n```\n\n**Pick the variant by the chosen background** (`logo.variantsByBackground`): the ink/dark-letter\nvariant on light, the white variant on a light photo, the all-white/`-mono` variant on a brand-colour\nor dark fill (a variant whose dot is baked to the brand colour disappears on a matching fill). Use\nthe **exact bundled SVG** — never recolour, redraw, or recreate the wordmark or its dot; to suit a\ndifferent background pick a different file.\n\n## 4. Icons — recolour the monochrome set\n\nBrand icons usually ship as monochrome SVG with a single fixed ink hex (the IMG.LY set uses\n`#282F35` and `#2E2E2F`). Rebuild the icon from its paths in the design instead of placing the\nfile: read the SVG's text (it is small) and run this block inside an `edit`. Each `<path>` becomes a\n`vector_path` graphic in one group named `NAME` (its id is `icon`), with the ink — fill or stroke —\nset to `INK` and any white kept white, so it stays vector and sharp at every size. It refuses\nanything that is not a monochrome path icon (masks, clip paths, gradients, several inks,\ntransforms):\n<!-- requires:asset_add -->\nplace that file unchanged with `asset_add` and an image fill (§3).\n<!-- /requires:asset_add -->\n<!-- unless:asset_add -->\nuse it only in a colour variant the kit hosts at an `https://` URL (§3) — never redraw one.\n<!-- /unless:asset_add -->\nFor several icons in one edit, wrap each run of the block, first line included, in its own `{ … }`.\n\n<!-- prettier-ignore -->\n```js\n// icon.js — part of an edit; first line: const SVG = `<the icon file's text>`, INK = '#471AFF', NAME = 'icon/search', PARENT = <page or group id>, BOX = { x: 96, y: 96, size: 48 };\nconst src = SVG.replace(/<!--[\\s\\S]*?-->/g, '');\nconst attrs = (tag) => Object.fromEntries([...tag.matchAll(/([\\w:-]+)=\"([^\"]*)\"/g)].map((m) => [m[1], m[2]]));\nconst refuse = (why) => {\n throw new Error(`icon.js: ${why} — not a monochrome icon; place the file unchanged as an image fill (§3), never recolour it`);\n};\nconst root = attrs(/<svg\\b[^>]*>/.exec(src)?.[0] ?? refuse('no <svg> element'));\nconst [vx, vy, vw, vh] = (root.viewBox ?? `0 0 ${parseFloat(root.width)} ${parseFloat(root.height)}`).split(/[\\s,]+/).map(Number);\nif (vx || vy || !(vw > 0) || !(vh > 0)) refuse(`viewBox \"${root.viewBox}\"`);\nconst extra = /<(mask|clipPath|linearGradient|radialGradient|pattern|filter|image|text|use|rect|circle|ellipse|line|polyline|polygon)\\b/.exec(src);\nif (extra) refuse(`<${extra[1]}>`);\nfor (const g of src.match(/<g\\b[^>]*>/g) ?? []) if (Object.keys(attrs(g)).some((k) => k !== 'id')) refuse(`styled group ${g}`);\nconst paths = (src.match(/<path\\b[^>]*>/g) ?? []).map(attrs);\nif (!paths.length) refuse('no <path>');\nconst styled = paths.flatMap(Object.keys).find((k) => /^(transform|opacity|fill-opacity|stroke-opacity|style|stroke-dasharray)$/.test(k));\nif (styled) refuse(`path attribute ${styled}`);\nconst isWhite = (c) => /^(white|#fff|#ffffff)$/i.test(c);\nconst fillOf = (p) => p.fill ?? root.fill ?? 'black';\nconst strokeOf = (p) => p.stroke ?? root.stroke ?? 'none';\nconst inks = new Set(paths.flatMap((p) => [fillOf(p), strokeOf(p)]).filter((c) => c !== 'none' && !isWhite(c)).map((c) => c.toLowerCase()));\nif (inks.size > 1) refuse(`${inks.size} ink colours (${[...inks].join(', ')})`);\nconst rgba = (hex) => {\n const h = hex.length === 4 ? hex.slice(1).replace(/./g, '$&$&') : hex.slice(1);\n return { r: parseInt(h.slice(0, 2), 16) / 255, g: parseInt(h.slice(2, 4), 16) / 255, b: parseInt(h.slice(4, 6), 16) / 255, a: 1 };\n};\nconst paint = (c) => rgba(isWhite(c) ? '#FFFFFF' : INK);\nconst k = BOX.size / Math.max(vw, vh);\nconst JOIN = { miter: 'Miter', round: 'Round', bevel: 'Bevel' };\nconst icon = await engine.design.create(\n {\n type: 'group',\n name: NAME,\n children: paths.map((p) => ({\n type: 'graphic',\n props: {\n shape: { type: 'vector_path', vector_path: { path: p.d, width: vw, height: vh, fillRule: p['fill-rule'] === 'evenodd' ? 'EvenOdd' : 'NonZero' } },\n width: vw * k,\n height: vh * k,\n position: { x: BOX.x, y: BOX.y },\n fill: fillOf(p) === 'none' ? null : { type: 'color', color: { value: paint(fillOf(p)) } },\n ...(strokeOf(p) === 'none'\n ? {}\n : { stroke: { enabled: true, color: paint(strokeOf(p)), width: parseFloat(p['stroke-width'] ?? '1') * k, position: 'Center', cornerGeometry: JOIN[p['stroke-linejoin'] ?? 'miter'] } })\n }\n }))\n },\n { parent: PARENT }\n);\n```\n\nWatch the kit's exceptions: two-tone marks keep an intentional white knockout (the block recolours\nthe ink and leaves the white); full-colour logo icons must **not** be flattened (the block refuses them). Keep icons monochrome, one ink\nper context, on the 24px grid — never gradients/shadows, and don't mix in a third-party icon set.\n\n## 5. Kicker pill (eyebrow → pill badge)\n\nA brand's `elements.kicker` is usually a pill badge, not a bare label. Build it on the **eyebrow text\nblock itself** via its text background — no separate shape needed:\n\n```js\nconst rgba = (hex, a = 1) => ({\n r: parseInt(hex.slice(1, 3), 16) / 255,\n g: parseInt(hex.slice(3, 5), 16) / 255,\n b: parseInt(hex.slice(5, 7), 16) / 255,\n a\n});\n// pill must HUG the glyphs → Auto width/height, else the background spans\n// the block's old fixed width (a full-width bar, not a pill).\nawait engine.design.setProps(kickerId, {\n widthMode: 'Auto',\n heightMode: 'Auto',\n backgroundColor: {\n enabled: true,\n color: rgba('#FFFFFF', 0.12), // subtle fill or an outline\n cornerRadius: 999, // full pill\n paddingLeft: 16,\n paddingRight: 16,\n paddingTop: 8,\n paddingBottom: 8\n }\n});\n```\n\nText stays normal-case, ~`text-xs`, in the kit's kicker text colour (ink / muted / brand — never an\naccent-as-structure colour). For an outline pill, use a transparent fill + the stroke properties;\nkeep the fill subtle so it reads as a badge, not a button.\n\n## 6. Block opacity ≠ colour alpha\n\nA \"faint\" or ghost element (an oversized decorative quote, a watermark) is usually **block opacity**,\nnot a low colour-alpha. Its colour can read fully opaque while it still renders faint. Capture\n`(await engine.design.getProps(id, ['opacity'])).opacity` alongside the colour, and re-apply it\n(`setProps(id, { opacity })`) after recolouring, or the ghost comes back at full strength and\ncompetes with the headline.\n\n## 7. Order of operations (avoids the common failures)\n\n<!-- requires:asset_add -->\n1. Resolve fonts (CDN URI or workspace bridge) and `asset_add` the logo/icon SVGs **before** the edit.\n<!-- /requires:asset_add -->\n<!-- unless:asset_add -->\n1. Resolve fonts and the logo/icon SVGs to fetchable URIs **before** the edit.\n<!-- /unless:asset_add -->\n2. In the edit: recolour fills → one text write per block (font + size + colour + re-mapped accent\n ranges) → position → `await engine.design.loadResources([page])`.\n3. `preview` — verify the real face rendered (not a fallback), colour survived the reshape, contrast\n holds, the logo dot reads, and no tofu.\n",
|
|
17
17
|
"docs/brand/reference/authoring.md": "# Authoring a kit — ingesting an external brand into the canonical shape\n\nReference for the `brand` skill. This is the **intake** step: when the kit the user pointed you at is\n**not** already a canonical `<kit>/` folder — it's a brand guidelines PDF, a website /\nURL, a Figma file, or a raw asset dump — **scaffold a canonical kit first**, then apply. The output\nis a validated `<kit>/` (`tokens.json` + `BRAND.md` + real assets + optional `do-dont/`)\nthat the rest of the skill can read. The **target shape** and every field's meaning live in\n`reference/brandkit-spec.md`; this file is **how you get there** from messy source material.\n\n## When to scaffold vs apply directly\n\n- the kit the user pointed you at is a `<kit>/` with a valid `tokens.json` (required-core complete)\n → apply directly (main workflow).\n- the kit the user pointed you at is anything else (a `.pdf`, an `http(s)://` URL, a Figma file/URL,\n a folder/zip of assets, loose prose + screenshots), **or** a `<kit>/` whose `tokens.json` is missing\n or fails the required-core → **scaffold first** (below), announce the new folder, then apply.\n\n## The two disciplines (read before extracting)\n\n1. **Exact over inferred.** Prefer machine-exact sources: CSS custom properties / design-system\n tokens, Figma variables, a stated hex / Pantone / CMYK. Fall back to sampling a swatch or an\n image only when nothing exact exists, and **say so** (a sampled colour is provisional).\n2. **Never invent — omit and flag.** Where the source is silent on an **optional** section (no dark\n theme, no print CMYK, no stated accent proportion, no signature device), **leave that section\n out** and record it under `$meta.gaps` (a list of \"not specified by the source — needs\n confirmation\"). Do not fabricate a value to fill the schema. The required-core must be real; an\n optional section absent-and-flagged is correct.\n\n **Hard-stop on the `avoid` list.** The `avoid` list is the highest-leverage and hardest-to-extract\n section (it's what a mis-generated piece does that this brand never does). Draft it from the\n source's explicit don'ts + the brand's own usage, then **stop and confirm the draft with the\n user** before finalizing the kit. Everything else is infer-and-flag; the `avoid` list is\n confirm-before-write. **Shape while unconfirmed:** keep the real `avoid` key **absent** (it must\n stay a flat `string[]` for validators — don't write a `{_status, draft}` object into it); hold the\n draft in **`$meta.avoidDraft`** (a `string[]`, each line tagged SOURCED vs INFERRED) plus a\n `$meta.gaps` entry \"avoid list drafted, needs confirmation\". On confirmation, move the lines into\n the flat `avoid` array.\n\n## Extraction by source form\n\n### A. Brand guidelines PDF (the classic brand book)\n\nRead the pages (the `Read` tool renders PDF). Pull, in priority order:\n\n- **Colour** — the palette page(s): named colours with **hex / Pantone / CMYK / RGB**. Build the\n ramps in `colorPrimitives`; map the \"primary / text / background / accent\" callouts to\n `semanticColors` roles. A colour shown only as an ink swatch with no value → sample + flag.\n- **Type** — families, weights, and especially the **heading weight rule** (`headlineWeight`) and any\n \"never use weight X for headings\" ban. Roles/sizes if a type-scale page exists.\n- **Logo** — the variants (mono / reversed / on-photo), **clear space**, **min size**, and the\n \"logo don'ts\" page → `logo.variantsByBackground` + `logo.avoid`.\n- **The do/don't spreads** — the richest source for the `avoid` list and `colorSchemes.denied`.\n- Voice / tone pages → `voice`.\n\n### B. Website / URL (best when the site is a design system)\n\n`WebFetch` the site (and its CSS if reachable). **Prefer the design system's published token\npackage / source repo over the rendered docs site** — the docs pages often truncate under fetch and\nbrand pages may 403, whereas the token source is exact and complete (e.g. Carbon's colours/themes/type\nlive in `@carbon/*/src` on GitHub, not the rendered `carbondesignsystem.com`). Pull:\n\n- **Colour** — CSS custom properties (`--color-*`, often authored in **OKLCH** or hex) are exact.\n The IMG.LY reference kit was derived exactly this way (`custom-colors.css` → `colorPrimitives`,\n `starwind.css` `:root`/`.dark` → `semanticColors.light`/`.dark`).\n- **Type** — `@font-face` / the fonts config → families + weights; the CSS heading rules →\n `headlineWeight` and the type scale.\n- **Logo / assets** — the SVG wordmark(s) and favicons served by the site.\n- **Voice** — real page copy → `voice.exemplars` + `voice.principles`; the site's own writing\n guidelines if published.\n- Caveat: a site usually ships **Latin-subset WOFF2**, not a full TTF — see Fonts below.\n\n### C. Figma file (via the Figma MCP)\n\nUse the Figma MCP (load the `figma-use` skill first). `get_variable_defs` / `get_design_context`\nreturn **exact** token values:\n\n- Colour/number/string **variables** → `colorPrimitives` + `semanticColors` (Figma modes map to\n light/dark); text styles → `typography.roles`; effect styles → `elevation`; corner radii →\n `shape`. Components named \"logo\", \"button\", \"badge/kicker\" → `logo` / `elements`.\n- Exact values, no sampling — the highest-fidelity source when available.\n\n### D. Raw asset folder / zip + loose prose / screenshots (heaviest inference)\n\nInventory the folder (`ls`/`Read`): fonts (`.ttf`/`.otf`/`.woff2`), logo files, any `colors`/\n`swatches`/`tokens` file, imagery. Parse any prose brand notes. Infer roles from filenames + how\nassets are used; sample colours from screenshots only as a last resort. This form produces the most\n`$meta.gaps` entries — flag generously and confirm.\n\n## Mapping to `tokens.json`\n\nFill in this order (definitions: `reference/brandkit-spec.md`):\n\n1. **Required-core first** — `colorPrimitives` (hex minimum), `semanticColors` role map,\n `typography.display`/`.body` + `headlineWeight`, `logo`, and the `avoid` list (drafted to\n `$meta.avoidDraft` until confirmed, per the hard-stop above). A required-core _field_ that can't be\n sourced means **stop** (say what's missing) — but a `logo`/`device` _asset_ that can't be fetched\n or is trademark-locked is **not** a blocker: record the real logo _rules_, put the missing asset in\n `$meta.gaps` with a placeholder path, and the kit is still **scaffold-complete** (see\n `brandkit-spec.md` → completeness levels). **`headlineWeight`** is a scalar for a fixed-weight\n brand, or `typography.display.weightRule` + a dominant `headlineWeight` for a size-responsive\n design system — don't lossily flatten a per-size rule into one number without recording the rule.\n2. **Optional sections the source supports** — `colorSchemes` (approved triples + denied combos +\n proportion), `elements`, `shape`, `elevation`, `device`, `safeArea`/`layout`/`spacing`/\n `composition`, `imagery`, `motion`, `voice`, `sizeThresholds`. Omit any the source doesn't state\n (→ `$meta.gaps`). **Product design systems** (Carbon, Material) ship _themes_ (light/dark), not\n marketing `(bg,text,accent)` triples: map each theme to an approved scheme from its\n `semanticColors`, and accept that there is **no** `proportion` or `denied` list to find — omit and\n flag, never invent a ratio.\n3. **`$meta`** — `name`, `source` (where it came from), `colorNote` (OKLCH-authoritative? sampled?),\n and `gaps` (the flagged omissions).\n\nThen write **`BRAND.md`** as the prose companion (identity, per-section usage rules, do/don't), and\ndrop the real assets into the subfolders.\n\n## Fonts — the subset trap\n\nA brand's site/PDF often only exposes a **Latin-subset WOFF2** (or an outlined logo), not a full\nTTF. `setFont` needs a complete static-or-variable TTF (`reference/asset-loading.md`). So:\n\n- **Prefer the full font from the foundry / Google Fonts** (OFL families resolve to a CDN URI\n directly). Get the real family, not the site's subset.\n- **Proprietary display faces** (a foundry-licensed brand font) may not be obtainable as a full TTF\n — bundle whatever the brand supplies, record it under `$meta.gaps` as \"display font needs full-TTF\n provisioning\", and flag that headlines may fall back until it's provided. Note the licensing (many\n brand fonts are internal-use-only — private-repo bundling, not redistribution).\n\n## do-dont/ (optional)\n\nIf the source's don'ts are concrete, render the target DO/DON'T pairs (a small HTML → PNG, in the\nbrand's real fonts/colours) so future applies can pattern-match. If time-boxed, create the folder\nwith a `README` listing the intended pairs and leave rendering for later. Never block the kit on it.\n\n## Validate, then apply\n\nRun the new `<kit>/` through `reference/brandkit-spec.md`. **Scaffold-complete** (the\ningestion goal): every required-core _field_ is real, `$meta.gaps` records every omission (flagged\nplaceholder assets are fine), the `avoid` draft is in `$meta.avoidDraft` awaiting confirmation.\n**Apply-complete** (needed before restyling): the `logo`/`device` assets exist and fonts resolve; a\ngaps-flagged missing/locked logo means the apply step skips or placeholders it rather than inventing\none. Announce the kit and its gaps, get the `avoid` list confirmed, then continue into the main apply\nworkflow.\n",
|
|
18
18
|
"docs/brand/reference/brandkit-spec.md": "# Brand-kit schema — the canonical ruleset shape\n\nReference for the `brand` skill. This defines the **one shape every brand maps into** so the skill\n(and any design-generation agent) can apply any brand the same way. A brand kit is a\n`<kit>/` folder; `tokens.json` is its machine-readable law, `BRAND.md` the prose\ncompanion, and the subfolders hold real assets.\n\n## The core idea — brand-agnostic keys, brand-named values\n\nThe **keys** of `tokens.json` are fixed and brand-neutral (`semanticColors`, `typography`, `logo`,\n`colorSchemes`, `elements`, `device`, `safeArea`, …). The **values** are the brand's own — its ramp\nnames, hexes, font families, logo files, and rules. Mapping a new brand = filling the same keys with\nthat brand's values. A brand names its own ramps (`brand`, `mintyparadise`) and devices\n(`gradientCloud`); the skill reads them by their **role**, not their name, via `semanticColors` /\n`colorSchemes` / `typography.roles`. So two brands with utterly different palettes are applied by\nthe identical procedure.\n\n## `<kit>/` layout\n\n```\n<kit>/\n├── tokens.json ← machine-readable law (parse FIRST)\n├── BRAND.md ← prose usage rules + do/don't (human companion)\n├── fonts/ ← the brand TTFs (+ a README on the weights each file serves)\n├── icons/ … ← monochrome icon set (+ recoloured variants) and logos/\n├── images/ ← logo lockups, visuals, the signature device asset\n├── videos/ ← reference footage (optional)\n└── do-dont/ ← rendered DO/DON'T target pairs (spacing/scale/logo/schemes/margins)\n```\n\n<!-- requires:asset_add -->\nA **saved style** is a folder holding `tokens.json`, `STYLE.md` (its `BRAND.md`) and\n`metadata.json`; it has no `fonts/`, `images/`, `icons/` or `do-dont/` folders: `tokens.json`\nnames each of those files by URI, a file already in the store. Use that URI as it is wherever the\nfile goes (a `font.uri`, an image fill).\n<!-- /requires:asset_add -->\n\n## `tokens.json` — sections\n\n### Required core (the skill refuses to guess these; a kit missing them is incomplete)\n\n| Section | Carries | Used for |\n| -------------------------------- | --------------------------------------------------------------------------------------------------------- | -------------------------------------------------------- |\n| `colorPrimitives` | named ramps, each step with `hex` (+ `rgb`/`oklch`/`pantone`/`cmyk`) | the source of every colour; variation moves along a ramp |\n| `semanticColors.light` / `.dark` | role → colour map (`background`, `foreground`, `primary`, `accent`, `muted`, `border`, …) | the role → token map when no explicit scheme fits |\n| `typography.display` / `.body` | family, role, weights, **`headlineWeight`**, font `files`, `fallback` | which font each text role gets; the banned-weight rule |\n| `logo` | the exact wordmark files, `variantsByBackground`, `dotColor`, `aspect`, `clearSpace`, `minWidth`, `avoid` | placing the correct, untampered logo |\n| `avoid` | a flat `string[]` of hard don'ts (the off-brand tells) | the non-negotiable conformance gate |\n\n**`headlineWeight` may be a scalar or a rule.** Marketing brands have one heading weight (`headlineWeight: 500`). Size-responsive **product design systems** (Carbon, Material) vary heading weight by size — express that with an optional `typography.display.weightRule` (a per-size map or prose) and set `headlineWeight` to the dominant/large-display weight. The role-map rule is \"never exceed the brand's weight **at that size**\", not a single number.\n\n**Two completeness levels.** A kit is **scaffold-complete** when every required-core _field_ is real (sourced, not guessed) — even if a `logo`/`device` binary is a flagged placeholder (a trademark-locked or not-yet-fetched asset recorded in `$meta.gaps`). It is **apply-complete** when those assets also exist and the fonts resolve. Ingestion (`reference/authoring.md`) targets scaffold-complete; apply needs apply-complete, and must handle a gaps-flagged missing/locked logo (skip it or use a flagged placeholder — never invent or redraw the mark).\n\n**Drafted-but-unconfirmed `avoid`.** The `avoid` list is confirm-before-write (`reference/authoring.md`): until the user confirms it, **keep `avoid` absent** (preserve the flat-`string[]` shape for validators) and hold the draft in **`$meta.avoidDraft`** plus a `$meta.gaps` entry. On confirmation, move the lines into the flat `avoid` array.\n\n### Optional richness (used when present; the skill degrades gracefully when absent)\n\n| Section | Carries | If absent |\n| ------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- |\n| `colorSchemes` | `approved` `(name,background,text,accent)` triples + `denied` combos + `proportion` (e.g. 70/20/10) | fall back to composing a scheme from `semanticColors` roles; skip the denied-combo check |\n| ‑ (note) | a **product design system** (Carbon, Material) ships _themes_ (light/dark), not marketing `(bg,text,accent)` triples with a proportion | map each theme to an approved scheme from its `semanticColors`; it legitimately has **no** `proportion`/`denied` — omit and flag, don't infer a ratio |\n| `backgroundSelection` | the procedure for choosing a canvas background | default to the neutral scheme |\n| `typography.roles` / `.pairing` / `.scale` | per-role sizes, the headline↔lead ratio, the type scale | keep source sizes; apply only family + weight |\n| `elements` | `button`, `kicker`, `divider` specs | leave those blocks styled by role colour only |\n| `shape` / `elevation` | corner radii, soft-shadow specs, hairline border | leave card treatment as-is |\n| `device` | the signature reusable graphic(s) + placement grammar | don't add a device |\n| `safeArea` / `layout` / `spacing` / `composition` | margins, per-aspect defaults, rhythm, scale-contrast rules | rely on design rules §6.3/§6.4 defaults |\n| `imagery` | art-direction attributes + grade | don't re-grade media |\n| `motion` | signature easing, ratios | video/animation only |\n| `voice` | tone principles, headline formulas, avoid-words | **not applied by a restyle** — copy is preserved (that's a content pass, not a brand skin) |\n| `sizeThresholds` | drop-vs-shrink rules for small canvases | keep elements at source size |\n| `$meta` / `doDontGallery` | provenance + pointers to `do-dont/` | informational |\n\n## Reading a scheme the right way\n\n`colorSchemes.approved[]` encodes colour as **fixed-role triples** — `(background, text, accent)`,\norder load-bearing. The skill **picks one** approved scheme per piece; it never free-chooses a\ntriple and never uses a `denied` combination. `accent` is the single most-important moment (one per\npiece), not a second structural colour. `proportion` (e.g. neutrals ~70% / text ~20% / accent ~10%)\nis the conformance target — if a restyle reads \"colourful\", there is too much accent.\n\n## Authoring a new brand into the shape\n\n> To ingest an **external** source (a guidelines PDF, a website/URL, a Figma file, or a raw asset\n> dump) into this shape, follow `reference/authoring.md` — it covers extraction per source form and\n> the not-invent discipline. The checklist below is the field-fill order it targets.\n\n1. Fill `colorPrimitives` with the brand's ramps (hex minimum; add oklch/pantone/cmyk if known).\n2. Map `semanticColors` roles to ramp steps (light, and dark if the brand has a dark theme).\n3. Set `typography.display` + `.body` with the real families, `headlineWeight`, and the TTF `files`.\n4. List the exact `logo` files + `variantsByBackground` + the dot/clear-space/min-width rules.\n5. Write the `avoid` list — the brand's specific off-brand tells (what a mis-generated piece does\n that this brand never does). This is the highest-leverage section; be concrete.\n6. Add optional sections as the brand warrants (a signature `device`, `elements`, `colorSchemes`).\n7. Drop the real assets in the subfolders; render a `do-dont/` pair for each recurring defect.\n8. Validate: **scaffold-complete** = every required-core _field_ is real and `$meta.gaps` records\n every omission (a flagged placeholder asset is fine). **apply-complete** additionally needs the\n `logo`/`device` assets present and the fonts resolvable (`reference/asset-loading.md`).\n\nModel every field on the shapes above.\n",
|
|
@@ -29,20 +29,20 @@ export const INLINE_ASSETS = {
|
|
|
29
29
|
"docs/formats/ig-story.md": "# ig-story — Instagram story / reel\n\n- **Size:** 1080 × 1920 px\n- **Aspect:** 9:16 (tall)\n- **Medium:** screen\n\n## Safe zones\n\nPlatform UI overlays the edges — keep text, logos and CTAs clear of:\n\n- **Top 269 px** (14%) — profile, timestamp, close button.\n- **Bottom 672 px** (35%) — caption, reply box, CTA.\n- **Left and right 65 px** (6%).\n- **Lower-right corner, 227 × 768 px** — the like / comment / share column on reels.\n\nThese are Meta's published figures for Reels and Stories on Instagram and Facebook.\n\n**Center the content group in the safe band** rather than top-anchoring it — top-anchoring is\nexactly what turns a 4:5 layout into a failed 9:16 letterbox.\n\n## Notes\n\n- Tall: **fill + safe zones** are the whole game. Grow type within its bands and/or open spacing\n to occupy the height; never leave the lower third empty.\n",
|
|
30
30
|
"docs/formats/linkedin-post.md": "# linkedin-post — LinkedIn feed image\n\n- **Size:** 1200 × 627 px\n- **Aspect:** ≈1.91:1 (landscape)\n- **Medium:** screen\n\n## Notes\n\n- Feed rendering may crop close to the edges — keep text and key content well inside the margins.\n- Landscape and short: favor a horizontal flow with a short measure; a single strong headline\n reads better than stacked copy at this height.\n",
|
|
31
31
|
"docs/formats/poster.md": "# poster\n\n- **Print size:** A2 portrait, 420 × 594 mm (A1 594 × 841 mm / A3 297 × 420 mm on request) — the\n page is this trim size; **3 mm bleed** is the page's bleed setting, outside it (`SKILL.md`, Print\n basics)\n- **Screen size:** 1080 × 1920 px (9:16) unless stated\n- **Medium:** both — ask (or derive) print vs screen; print is the default venue\n\n## Print rules\n\n- ≥300 dpi; fonts embedded/outlined; text inside the **~8% safe margin**, out of the bleed\n (design rules §6.1.10, §6.4).\n- Work in mm/points against the trim size; the bleed is trim allowance, not layout space.\n\n## Notes\n\n- Viewed at a distance — hierarchy carries the poster: one dominant element, display sizes at the\n top of the scale bands (design rules §6.3, §6.1.2).\n- Screen venue behaves like `ig-story` **without** platform safe zones (no chrome).\n",
|
|
32
|
-
"docs/formats/print.md": "# Print: CMYK, spot colours, bleed, PDF/X\n\nA design for a printer: page at trim size, bleed, colours the press can\nreproduce (CMYK, spot inks), and a PDF the print shop accepts.\n\n**Only for a print job.** Use this page when the brief names a printer, bleed,\nCMYK, spot inks or PDF/X. A PDF for reading, sharing or a template sample is\nnot one: keep the page at the asked size with `marginEnabled: false` and export\nplain `pdf`, so the file is exactly that size.\n\n**A bled page exports with its bleed, a PNG included, and a whole-page\n`preview` shows it; a zoomed `preview` (one block, or a `region`) shows the\ntrim area.** For a PNG/JPEG/WebP at trim size next to the print PDF, pass\n`bleed: false` to `export`; the design keeps its bleed. Sizes and the safe\nmargin per format are in the `formats` skill; the type rules for print are in\n`{{skill:judge#design-rules.md}}` §6.1.10.\n\n## Set up the page\n\nPrint page: the TRIM size (`width: '148mm'`), the bleed as\n`page: { marginEnabled: true, margin: { top: '3mm', right: '3mm', bottom: '3mm', left: '3mm' } }`\n(3 mm unless the printer states another value), and\n`scene: { designUnit: 'Millimeter', dpi: 300 }`. The `api` skill's types\ndocument the bleed, safety inset, exclusion areas and units.\n\n- Anything that touches a trim edge runs to the bleed's outer edge: a full\n background sits at `position: { x: '-3mm', y: '-3mm' }` and is 6 mm wider and\n taller than the page. A page's own fill
|
|
32
|
+
"docs/formats/print.md": "# Print: CMYK, spot colours, bleed, PDF/X\n\nA design for a printer: page at trim size, bleed, colours the press can\nreproduce (CMYK, spot inks), and a PDF the print shop accepts.\n\n**Only for a print job.** Use this page when the brief names a printer, bleed,\nCMYK, spot inks or PDF/X. A PDF for reading, sharing or a template sample is\nnot one: keep the page at the asked size with `marginEnabled: false` and export\nplain `pdf`, so the file is exactly that size.\n\n**A bled page exports with its bleed, a PNG included, and a whole-page\n`preview` shows it; a zoomed `preview` (one block, or a `region`) shows the\ntrim area.** For a PNG/JPEG/WebP at trim size next to the print PDF, pass\n`bleed: false` to `export`; the design keeps its bleed. Sizes and the safe\nmargin per format are in the `formats` skill; the type rules for print are in\n`{{skill:judge#design-rules.md}}` §6.1.10.\n\n## Set up the page\n\nPrint page: the TRIM size (`width: '148mm'`), the bleed as\n`page: { marginEnabled: true, margin: { top: '3mm', right: '3mm', bottom: '3mm', left: '3mm' } }`\n(3 mm unless the printer states another value), and\n`scene: { designUnit: 'Millimeter', dpi: 300 }`. The `api` skill's types\ndocument the bleed, safety inset, exclusion areas and units.\n\n- Anything that touches a trim edge runs to the bleed's outer edge: a full\n background sits at `position: { x: '-3mm', y: '-3mm' }` and is 6 mm wider and\n taller than the page. A page's own fill covers the bleed, an image or video\n fill too: its crop at scale 1 fills the trim plus the bleed.\n- **Multi-page print** (a folded leaflet, a booklet): one `page` per side, all\n the same size, each with the same bleed. Pages render in order; each becomes\n one page of the PDF.\n\n## CMYK colours\n\nEvery `Color` slot (fill, `text.color`, stroke, drop shadow, gradient stops,\n`backgroundColor`) takes one of three shapes:\n\n```js\nconst rgb = { r: 0.1, g: 0.1, b: 0.1, a: 1 }; // sRGB, 0–1\nconst cmyk = { c: 0, m: 0.95, y: 0.85, k: 0 }; // CMYK, 0–1\nconst spot = { name: 'PANTONE 186 C' }; // a named ink, below\n\nawait engine.design.setProps(bg, { fill: { type: 'color', color: { value: cmyk } } });\nawait engine.design.setProps(headline, { text: { color: { c: 0, m: 0, y: 0, k: 1, tint: 1 } } });\nawait engine.design.setProps(rule, { stroke: { enabled: true, width: '0.5mm', color: cmyk } });\n```\n\n- Print colours are CMYK; body text black is `{ c: 0, m: 0, y: 0, k: 1, tint: 1 }`.\n The edit lint names RGB and four-colour black on small type.\n- **An RGB brand colour:** use the CMYK values the brand book gives; when it\n gives none, ask for them. An RGB value left in is converted by the export's\n profile, and a `pdfx` export warns about it (below).\n\n## Spot colours\n\nA spot colour is a named, premixed ink (`PANTONE 186 C`, a brand ink, a white\nunderprint, a die line). It prints as its own separation; the RGB and CMYK\nvalues you give it are only how it previews.\n\n```js\n// Define it once on the scene: the name is the ink; both approximations are previews.\nconst [scene] = await engine.design.findByType('scene');\nawait engine.design.setProps(scene, {\n spotColors: {\n 'PANTONE 186 C': { rgb: { r: 0.784, g: 0.063, b: 0.18 }, cmyk: { c: 0, m: 1, y: 0.81, k: 0.04 } }\n }\n});\n\nconst pms186 = { name: 'PANTONE 186 C' };\nawait engine.design.setProps(logoMark, { fill: { type: 'color', color: { value: pms186 } } });\nawait engine.design.setProps(accentWord, { text: { color: pms186 } });\nawait engine.design.setProps(underline, {\n stroke: { enabled: true, width: '1mm', color: { ...pms186, tint: 0.4 } } // a 40 % screen of the same ink\n});\n```\n\n- **The name is the contract with the printer.** Spell it exactly as the\n swatch book does (`PANTONE 186 C`, with spaces); the PDF's separation carries\n that name.\n- **Both approximations.** `rgb` drives the screen preview; `cmyk` the CMYK\n preview and any CMYK fallback. Set both with the swatch's published values.\n- Read back: `getProps(scene, ['spotColors'])` answers every ink in the same\n shape. Writing a name again updates every block using it.\n- A spot colour works in every `Color` slot, gradients included, and keeps\n its separation through both `pdf` and `pdfx` exports.\n\n## Masks and mattes in PDF and SVG\n\n`masks: [{ shape, mode?, feather?, expansion?, inverted?, opacity?, keyframes? }]`\ncuts a block (graphic, text, group) to shapes, combined in order; each mask's\nshape fills the block, so a `vector_path` sized to the block places one\ninside it. `feather` and `expansion` take lengths (`'12px'`). `[]` removes\nthem. `matte: { source, mode? }` shows the block only where its `source` (a\nname or uuid on the same page) draws, and the source stops drawing on its\nown; `null` unlinks.\n\nMeasured on CE.SDK 1.85: what stays vector when the design leaves as a file.\n\n| on the block | PDF | SVG |\n| ------------------------------------- | ---------------------------------------- | ------------------------------------ |\n| `masks` with hard edges (any `mode`, `inverted`) | vector clip | vector clip path |\n| a mask with `feather` | rasterised soft mask | feather dropped: hard edge |\n| a mask with `opacity` below 1 | vector soft mask | opacity dropped: full strength |\n| `matte`, mode `Alpha` | vector soft mask | ignored: the block exports whole |\n| `matte`, mode `Luma` | rasterised soft mask | ignored: the block exports whole |\n\nSo for a print or vector deliverable, cut with hard-edged `masks`; keep\nfeathers and luma mattes for screen, video and PNG. An SVG must not rely on\na matte at all.\n\n<!-- requires:export -->\n## Cutouts and gradient strokes\n\nA die-cut look (notches, punched holes, a ticket stub) is one `compound`\nshape, and a gradient outline is `stroke: { fill }`\n(`{{skill:api#shapes.md}}`). Both export as vector paths in PDF and SVG,\nwith no raster mask, so the cut stays sharp at any print size.\n\n## Export for print\n\n- **`export({ format: 'pdf' })`** writes DeviceCMYK: CMYK values stay CMYK,\n spot colours stay separations, and a page with bleed is trim + bleed with\n the trim marked (TrimBox / BleedBox). No PDF/X markers and no output intent.\n- **`export({ format: 'pdfx' })`** is what a print shop asks for when it says\n \"print-ready\" or \"PDF/X\": the same PDF converted to a PDF/X standard with an\n embedded ICC output profile. Its optional `pdfx` object:\n\n | key | values |\n | --------------------------------------------- | ------------------------------------------------------------------------------------------ |\n | `outputStandard` | `'PDF/X-4'` (default, keeps live transparency) · `'PDF/X-3'` · `'PDF/X-1a'` (always flattens) |\n | `outputProfile` | `'fogra39'` (default, Europe) · `'gracol'` (US) · `'srgb'` (never compliant) · `'custom'` |\n | `profileUri` | the printer's `.icc` for `'custom'` |\n | `flattenTransparency` / `flattenResolution` | flatten live transparency; dpi of flattened areas (default 300) |\n | `embedICCProfile` | default `true`; PDF/X needs it |\n | `title`, `outputCondition`, `outputConditionIdentifier` | OutputIntent metadata |\n\n Use the printer's standard and profile when the brief names them; else\n PDF/X-4 + `fogra39` (Europe) or `gracol` (US).\n- **Read the result's `warnings`.** A `pdfx` export reports every rule the\n file breaks, each with its fix (e.g. an RGB colour under a CMYK profile).\n Fix and re-export before calling the file print-ready.\n- **Verify what you deliver.** `preview` cannot show separations; the export\n result and its warnings are the evidence. Name the standard, profile,\n bleed and spot inks in your reply.\n<!-- /requires:export -->\n\n## Checklist\n\n- [ ] Page = trim size; bleed set on the page; edge-touching art runs into it\n- [ ] Text and logos inside the safe margin (~8 % or the printer's figure)\n- [ ] Every colour CMYK or a defined spot colour; body text 100 % K\n- [ ] Spot names spelt as the swatch book\n- [ ] Type ≥ print minimums (design-rules §6.1.2); `scene.dpi` 300\n- [ ] Masks hard-edged (no `feather`, no luma `matte`) where the PDF must stay vector\n<!-- requires:export -->\n- [ ] `pdfx` export with the printer's standard/profile; no warnings left\n<!-- /requires:export -->\n",
|
|
33
33
|
"docs/formats/tiktok.md": "# tiktok — TikTok video\n\n- **Size:** 1080 × 1920 px\n- **Aspect:** 9:16 (tall)\n- **Medium:** screen (video)\n\n## Safe zones\n\nPlatform UI overlays the edges — keep primary content, captions and CTAs clear of:\n\n- **Top 240 px** — Following / For You tabs, search.\n- **Bottom 660 px** — caption, username, sound ticker.\n- **Left and right 120 px** — cropped on some devices.\n- **Right column, 300 px wide from 840 px down** — like / comment / share / profile.\n\nThese are the figures of TikTok's own in-feed template; a longer caption takes more of the\nbottom, so treat them as minimums.\n\n## Notes\n\n- Same canvas as `ig-story` with about the same bottom band, wider sides and a right-hand column\n that starts higher (840 px): an ig-story layout that runs to its side margins is cropped here.\n- Burned-in captions sit above the bottom band, left-aligned or centered within the width that\n clears the right column.\n",
|
|
34
34
|
"docs/formats/widescreen.md": "# widescreen — 16:9 landscape\n\n- **Size:** 1920 × 1080 px\n- **Aspect:** 16:9 (wide)\n- **Medium:** screen\n\n## Notes\n\n- Wide and short: re-flow content **horizontally**, shorten the measure (long lines hurt\n readability — design rules §6.1.4), and beware a tall stack overflowing the reduced height.\n- Content format: no platform chrome — full frame inside the margins.\n- For a slide deck at this size, see `deck.md`.\n",
|
|
35
35
|
"docs/formats/x-post.md": "# x-post — X (Twitter) post image\n\n- **Size:** 1600 × 900 px\n- **Aspect:** 16:9 (landscape)\n- **Medium:** screen\n\n## Notes\n\n- Timeline previews crop edges on some clients — keep text and key content well inside the\n margins.\n- Same aspect as `widescreen` at lower resolution; the widescreen composition guidance applies\n (horizontal flow, short measure).\n",
|
|
36
36
|
"docs/formats/youtube-thumbnail.md": "# youtube-thumbnail — YouTube video thumbnail\n\n- **Size:** 1280 × 720 px\n- **Aspect:** 16:9 (landscape)\n- **Medium:** screen\n- **Upload limit:** 2 MB — JPG, PNG or GIF; export JPEG unless the design needs transparency\n\n## Safe zones\n\n- **Bottom-right ~120 × 60 px:** the player's duration badge covers it in feeds and search\n (YouTube publishes no figure; guides differ by a few pixels).\n- **Bottom edge:** a red watch-progress bar overlays it on videos the viewer has started.\n\n## Notes\n\n- Shown as small as ~168 × 94 px in sidebars and on phones — headlines need few words, heavy\n weights and an outline or shadow to read at that size.\n<!-- requires:asset_add -->\n- Building a reusable thumbnail template for a channel is the `video-thumbnail-template` skill.\n<!-- /requires:asset_add -->\n",
|
|
37
37
|
"docs/formats/yt-shorts.md": "# yt-shorts — YouTube Shorts\n\n- **Size:** 1080 × 1920 px\n- **Aspect:** 9:16 (tall)\n- **Medium:** screen (video)\n\n## Safe zones\n\nPlatform UI overlays the edges — keep primary content, captions and CTAs clear of:\n\n- **Top 288 px** — search, menu.\n- **Bottom 672 px** — title, channel, subscribe, sound.\n- **Right 192 px** — like / dislike / comment / share / remix column.\n- **Left 48 px.**\n\nThese are Google's published figures for vertical video on YouTube; treat them as minimums.\n\n## Notes\n\n- Same canvas as `ig-story` / `tiktok`, with the tallest top band of the three. A layout that has\n to work on all three keeps its text inside x 120–780, y 288–1248.\n",
|
|
38
|
-
"docs/judge/SKILL.md": "---\nname: judge\ndescription: >-\n The quality gate and the rules every design is built to. Read it, with its\n design-rules.md, before the first `edit` of any design: the rules are what you\n build to, and the gate is the mandatory step before reporting a design done.\n Also when the user asks for a design review, score, audit, or QA, or when a design\n needs remediation after a failed review. The axes, the gate, the scorecard format\n and the remediation loop are defined in this skill's body — do not judge from\n memory of this description.\n---\n\n# judge — the build → judge → remediate loop\n\n**Before the first `edit` of a design, read `{{skill:judge#design-rules.md}}`** (in the same message as the `api` skill): the full rubric — typography, colour, hierarchy, composition, craft — with the numeric thresholds every axis below is scored against. Build to it; scoring a design against rules you read only afterwards means rebuilding it.\n\nYou are the design's QA judge. Judging is scored against what you SEE in `preview` renders of the **session's current state** — never against the code that produced it, and never from memory. `preview` always renders that current state, so there is nothing to re-ground: if you are unsure what the design looks like now, call `preview` again.\n\n## The 8 axes\n\nScore each axis 0–10 against the render. `baseline` is the execution floor; the other seven map to the sections of `design-rules.md`:\n\n| Axis | What it scores | Rubric |\n| ---------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------- |\n| **baseline** | Nothing broken: no overflow, no blank/placeholder text, no tofu (□), no clipped ascenders/descenders, nothing off-canvas, no unintended overlap | §6.1.7, §6.4 |\n| **hierarchy** | One dominant element; unambiguous reading order; ≈3 (≤4) levels; rank carried by size > weight > color > spacing > position; structure expressed as a grouped block hierarchy (nested where nested) | §6.3 |\n| **typography** | Families/weights, scale bands, leading (incl. the content-area conversion and diacritic/non-Latin rules), measure, rag, tracking, micro-typography, lists & paragraph structure, inline style ranges | §6.1 (checklist §6.1.11) |\n| **color** | Palette ≤ 3 + neutrals; exactly one consistent accent; contrast on the actual background | §6.2 |\n| **composition** | Margins 8–12% of the shortest dimension; shared grid; spacing ladder; balanced whitespace — no dead void; nothing off-canvas | §6.4 |\n| **craft** | Chips/pills/badges built per the chip system; intentional crops; clean decoration; consistent component geometry | §6.5 (checklist §6.5.2) |\n| **copy** | The words say something only this business/occasion could say: no nothing-tagline, transformation claim, uncheckable superlative, upbeat closer or abstract-noun padding; trade idiom and specifics left intact | §6.8 (Copy rules, below) |\n| **localization** | Localized variants only: correct per-language typography, no drift from the source layout, RTL mirrored, script-correct fonts; **source-parity** (appearance/weight/element/decoration match the source render — see below) | §6.6 + the `localize` skill |\n\n**Some axes cannot be judged from a single PNG.** Nine checks below are **instrumented** — they read a measured value, the scene graph, or a second render, not an eyeball — because the naked render either hides the defect or can't reveal the cause. Five of them (chip construction, curved type, list construction, inline emphasis, paragraph structure) catch **construction** defects that render pixel-identically to the correct build: scoring the image alone passes them every time.\n\n- **Leading (typography):** read `getProps(id, ['text.lineHeightVisual'])` and judge the **rendered** gap against §6.1.3, not the raw `text/lineHeight`. Required on every headline/display block and on every text block of a localized variant — the most common defect, and it survives a clean-looking PNG.\n- **Grouping (hierarchy):** walk `getChildren` from the page; each cluster (eyebrow+headline, label+value, icon+text) must be a group block, not loose siblings (§6.3). Ungrouped RTL icons also break on mirror.\n- **Chip construction (craft):** every text-only chip's field is the text block's own `backgroundColor/*`, not a sibling shape behind it; a text block centred on a same-size rect is the tell (§6.5.1).\n- **Curved type (craft):** every arced text is one block whose `(await engine.design.getProps(id, ['text.path'])).text.path` is non-null; single-glyph blocks at stepped rotations are the tell (§6.5.4, and §6.3).\n- **List construction (typography):** every list is one block whose `getProps(id, ['text.paragraphs'])` paragraphs each carry a `listStyle` ≠ `'None'`. Tells: a typed `\"• \"`/`\"1. \"`, a lone marker-glyph block, one block per item (§6.1.8; the last two fail §6.3 too).\n- **Inline emphasis (typography):** emphasis inside a line is a range on one block (`getProps(id, ['text.ranges'])` has more than one); two blocks on one baseline and face, differing only in colour or weight, are the tell (§6.1.9), unless one of the pieces has `text.string` keys and the pieces share one group. Capitals typed into the string with no `case` range are frozen caps (§6.1.9).\n- **Paragraph structure (typography):** a string with `\\n\\n` and `text/paragraphSpacing == 0`, or N stacked one-paragraph blocks that read as one passage, fail §6.1.8.\n- **Copy (copy):** score the words, not their setting. Read every string from the walk below in render order, as one voice, and ask whether a competitor could paste the lines onto their own page unchanged (§6.8, bundled at the end). Bias hard toward leaving copy alone: specifics and trade idiom are not tells, and em dashes and curly quotes are correct typography (§6.1.7). **A thin brief does not license inventing:** generic but true passes this axis; a name, price, date, place or claim the brief did not give fails. On a source-derived edition, a re-worded string fails **baseline** (Copy parity below), not this axis.\n- **Source-parity (localization + composition + craft + typography):** a variant is judged against **its source**, not in isolation — see the next section. Applies to every design derived from another: a **localization**, a **resize**, and a **brand restyle**. For a localized variant, also confirm the source's **style ranges survived**: if the source block has multiple runs and the variant has one, the translation flattened the accent (`localize`), which fails **localization** even when the render looks clean.\n\n## The gate\n\n**Every applicable axis ≥ 8. No averaging. N/A = 10.** One axis at 7 fails the design. An axis is N/A only when it genuinely cannot apply (e.g. `localization` on a single-language design) — score it 10 and mark it N/A in the scorecard.\n\nThe caller may override the default: narrow the axes (\"judge typography and composition only\") or move the threshold (\"pass ≥ 9\"). Apply the override for that run; otherwise the full gate is the default.\n\n**This skill never asks.** Its two parameters — the axis set and the threshold — are both\ndefaultable, and it runs as the gate of the loop on every build, so a question here would interrupt\nevery design this server makes. Take the override if the caller gave one, otherwise take the full\ngate, and score. This is the stated exception to the intake contract (`{{skill:create#intake.md}}`), which every other skill follows.\n\n**A source-derived variant (localization, resize, or brand restyle) cannot pass on its standalone render.** The source-parity diff below is a **mandatory gate step**, not an \"if in doubt\" — a variant judged only against its own PNG has not been judged. If you did not `preview` the source and diff it, the gate is incomplete and the design is not done.\n\n## Source-derived variants — judge against the source, not just the render\n\nA **localization**, a **resize**, and a **brand restyle** are not standalone designs: each is derived from a source, and each changes exactly **one** layer — the words, the canvas, or the style — while carrying the rest faithfully. Judging one in isolation passes variants that are internally clean but **infidelity to the original** — the single largest class of derived defects (wrong leading after a font swap, a fill/effect/corner-radius/weight that silently changed, decoration that drifted, an element that vanished, a restyle that quietly re-flowed the layout, an icon the RTL flip disassembled). None of these show up scoring the variant's PNG alone; **all** of them show up the moment you put the variant next to the source.\n\n**So for every variant with a source, `preview` the source too and diff the two renders — always, before scoring.** First name **which layer the variant is allowed to change** (words / canvas / style); everything else is held, and every difference outside that layer is a defect until you can name it as a deliberate consequence. Then judge these against the source (they feed the axes noted):\n\n- **Element inventory** (localization + composition) — every content cluster on the source has a counterpart on the variant; nothing silently dropped or added. Missing elements read as \"too simplistic.\"\n- **Copy parity** (baseline; **brand** + resize) — the strings are the source's strings. A restyle and a reformat carry copy verbatim: no re-worded headline, no shortened subline, no dropped line \"to fit\" the new face or canvas. Re-wording is the `localize` layer; if the copy no longer fits, fix the type, not the text.\n- **Appearance parity** (craft + color) — fills, gradients, effect/blur stacks, opacity, corner radius, stroke, shadow, and any overlay match the source; none re-created by eye, none added/removed (a cover that \"became darker,\" a rounded corner gone square). **For a brand restyle this check inverts:** appearance is _supposed_ to change, so parity is on the **role assignment**, not the values — the block that was the background is still the background, the one accent moment is still that block, the divider is still a divider. A restyle that recoloured a rule into a second lead, or promoted a caption to the accent, broke role parity even though every value came from the kit.\n- **Weight parity** (typography) — every block renders at the source block's weight; the font swap did not land on the family's default regular cut. For a brand restyle, the target is the **brand's** weight for that role — but relative weight order across blocks still matches the source's hierarchy.\n- **Geometry / decoration drift** (localization for localize; composition for resize; craft + composition for brand) — for **localize**, every block sits on the source grid (position + size), baseline-relative where the face changed; decoration with an internal geometric relationship (a ring of stars, evenly-stepped dashes) holds that relationship. For **resize**, geometry is _re-derived_ (drift ≠ moved), so instead judge that the **system** and **identity** carried (§6.4/§6.3) and nothing was lost. For **brand**, geometry is held like a localization — a block moved for anything but a stated brand rule (safe-area margin, kicker pill, size threshold) is drift; a re-layout is a `resize`, not a restyle.\n- **Re-wrap fallout** (baseline; **brand** + localization) — a font swap changes the measure, so an auto-height block can re-wrap to a new line count, grow, and collide with or push its neighbour even though nothing was moved. Diff the **line counts** against the source, not just the positions.\n- **RTL selectivity** (localization) — icons/logos/marks/numerals/charts/photos are **not** mirrored; composed marks moved as groups, not disassembled.\n\nA variant that is clean on its own but diverges from the source on any of these fails the axis noted — **do not pass it on the strength of the standalone render.** When a divergence is a deliberate, correct adaptation (a headline re-wrapped for a longer language, a block re-flowed for a new aspect, a margin widened to the brand's safe area), that is not drift; name it and pass.\n\n**A brand restyle carries a second gate.** The kit's `avoid` list and `do-dont/` gallery sit **on top of** the axes: a single hard `avoid` violation fails the restyle even when every axis is ≥ 8. Add an **avoid-list** row to the scorecard and score it against the kit, not the rubric (the `brand` skill).\n\n<!-- requires:video -->\n## Videos — judge the timeline, not its first frame\n\nA page with a timeline (clips, animations, audio) is judged across its whole duration. A plain `preview` shows one frame; judged alone it passes a video whose middle is broken. `time` applies to every block in a call, so it is one `preview` call per moment — pick them from the timeline you built:\n\n- **Frames** — a representative set, about six moments: the first frame, a few beats once their entrance has settled (the busiest ones), the **middle of a transition** (cut + duration/2; every transition when there are few), and the last frame (`duration` − 0.1; the timed preview reports `duration`). Score all eight axes on every frame: a headline that collides mid-slide or a chip that leaves the canvas mid-animation fails `baseline` like it would on a still.\n- **Motion** (`baseline` + `craft`) — a transition midpoint shows both clips blended; one clip shown whole there means the transition is missing or off its cut. Every line of text stays on screen long enough to read: a short label at least 0.8 s after it settles, a sentence about 0.3 s per word. The last frame is a deliberate end card, not an empty tail.\n- **Audio** (instrumented — `preview` has no sound) — read the page's `audio` blocks in the scene-graph walk: each block's `playback` window lies inside the page's duration; a music bed spans the page and has a `fadeOut`; the music is ducked under a voiceover (0.3–0.5 while it speaks). A missing bed or voiceover the brief asked for, or a silent tail, fails `baseline`; unset fades or levels that fight each other fail `craft`. A silent video is a complete deliverable when the brief or its defaults chose it (no sign-in to generate music, the user said so) — name that in the brief line.\n<!-- requires:export -->\n- **The export** — judge frames with `preview`, not with trial exports: an mp4 export is slow, so export once, after the gate passes. Then check that one export from its result: `audioDuration` present and about equal to `duration` (absent means the mp4 has no audio track — a defect when the design has audio). Re-export only if that check finds a defect.\n<!-- /requires:export -->\n\nRecord the verdict on the frames you scored, as for any design.\n<!-- /requires:video -->\n\n## The loop\n\n<!-- requires:import -->\n1. **Preview** — `preview` every page that matters, in **one call**: `preview()` with `blockIds` omitted renders every page of the current design, so scoring the whole design costs no more than scoring page 1. Judging an old render is judging the wrong design. A render is invalidated by **content** changes: if nothing has changed the scene since a render you already have in this conversation (a diagnostic/read-only `edit`), that render is still current — reuse it instead of re-rendering. **Type too small to see in the page render is not judged until you zoom it:** legal copy, captions, disclaimers and any label under ~12 px on the canvas come back as a smudge at 0.25 MP, so `baseline` and `typography` on those blocks are being scored on nothing. The page render names them for you: a `preview` of a page ends with whatever it was too coarse to resolve — type under ~10 rendered px, strokes under one — and the exact call that shows them. Follow it — `preview({ blockIds: [<textId>] })` frames the block on its page, no coordinates needed — and judge how it is SET: clipped ascenders or descenders, tofu, a hairline that washes out at size, contrast against what is actually behind it, a collision the page view hid. The words themselves you already have from the scene-graph walk below; the zoom is for what the strings cannot tell you. **If the design is a localization, a resize, or a brand restyle, you need the SOURCE's render too** for the source-parity checks above. `preview` only ever renders the current session, so the source render has to come from the conversation: those three skills each `preview` the source and save it before starting the variant, precisely so the render is already in front of you here.\n<!-- requires:video -->\n **A page with a timeline needs one `preview` per moment** — see Videos above.\n<!-- /requires:video -->\n<!-- requires:open -->\nIf it is not, `open({ uri: '<source uri>' })` and `preview` it, then `open` the variant's `uri` (the one its `import` returned) to return to it — `import` would give you copies instead.\n<!-- /requires:open -->\n<!-- unless:open -->\n<!-- requires:version -->\nIf it is not, `preview({ design: '<source design>' })` it, then carry on with the variant by its own `design` and `version` — nothing needs saving or loading back.\n<!-- /requires:version -->\n<!-- unless:version -->\nIf it is not, save the variant first (`export({ format: 'imgly' })`) and keep its `uri`, load the saved source back (`import({ source: { uri: '<source uri>' } })`) and `preview` it, then `import` the variant's `uri` to return to it. The variant's next save is then a new file — report that `uri`, not the earlier one.\n<!-- /unless:version -->\n<!-- /unless:open -->\n<!-- /requires:import -->\n<!-- unless:import -->\n1. **Preview** — `preview` every page that matters, in **one call**: `preview()` with `blockIds` omitted renders every page of the current design, so scoring the whole design costs no more than scoring page 1. Judging an old render is judging the wrong design. A render is invalidated by **content** changes: if nothing has changed the scene since a render you already have in this conversation (a diagnostic/read-only `edit`), that render is still current — reuse it instead of re-rendering. **Type too small to see in the page render is not judged until you zoom it:** legal copy, captions, disclaimers and any label under ~12 px on the canvas come back as a smudge at 0.25 MP, so `baseline` and `typography` on those blocks are being scored on nothing. The page render names them for you: a `preview` of a page ends with whatever it was too coarse to resolve — type under ~10 rendered px, strokes under one — and the exact call that shows them. Follow it — `preview({ blockIds: [<textId>] })` frames the block on its page, no coordinates needed — and judge how it is SET: clipped ascenders or descenders, tofu, a hairline that washes out at size, contrast against what is actually behind it, a collision the page view hid. The words themselves you already have from the scene-graph walk below; the zoom is for what the strings cannot tell you. **If the design is a localization, a resize, or a brand restyle, you need the SOURCE's render too** for the source-parity checks above. `preview` only ever renders the current session, so the source render has to come from the conversation: preview the design **before** you change it — that render is the source. If it is not in front of you, skip the source-parity checks and say so in the brief line (step 3).\n<!-- requires:video -->\n **A page with a timeline needs one `preview` per moment** — see Videos above.\n<!-- /requires:video -->\n<!-- /unless:import -->\n2. **Judge** — score each applicable axis against the render. For `typography` and `craft`, dry-run the §6.1.11 and §6.5.2 checklists line by line (read them via `{{skill:judge#design-rules.md}}`); for `copy`, apply §6.8 (bundled at the end of this document) before scoring the words. Any \"no\" on an applicable checklist line caps that axis below 8. Run the **instrumented checks** where they apply — as the TAIL of a remediation `edit` when one is happening anyway, standalone only when nothing needs fixing: the leading read-back (text.lineHeightVisual vs band), the scene-graph reads for grouping, chip construction, curved type, list construction, inline emphasis, paragraph structure and copy, and — for source-derived variants — the source-parity diff. A clean-looking PNG is not sufficient for these nine. **All seven scene-graph reads share one walk** of `engine.design.getChildren` from the page — do them in a single pass, not seven. For each text block that walk reaches, one read of `await engine.design.getProps(id, ['text', 'text.ranges', 'text.paragraphs'])` (paragraphSpacing, the string, `path`, the style runs, the per-paragraph `listStyle`) answers six of the seven; grouping is answered by the walk itself.\n3. **Scorecard** — report the result in this shape (conversational markdown; no files):\n\n | Axis | Score | Violations | Fix |\n | ----------- | ----- | ---------------------------------------------------------------- | ---------------------------------------------------- |\n | typography | 6 | all-caps eyebrow untracked (§6.1.6); body leading unset (§6.1.3) | set letterSpacing 0.12; set converted lineHeight 1.5 |\n | composition | 8 | — | — |\n\n One row per applicable axis, N/A rows marked. Below the table: the verdict (`PASS` / `FAIL — remediating`) and, on failure, the remediation order (worst axis first).\n\n **Then one line for the brief.** Restate the brief this design was built from and name any place the design departs from it — a direction, palette, format or audience that is not what was asked for or agreed. The eight axes score execution only, so a design built beautifully in a direction nobody chose passes all of them; this line is the only thing that catches it. It does not gate (a deliberate, explained departure is fine) and it never becomes a question — `judge` does not ask. If the design was built with a parameter **defaulted rather than asked**, say which: that is the sentence the user needs in order to correct it in one word.\n\n4. **Remediate** — apply the fixes via `edit`. Remediation is surgical: fix the flagged blocks in place (`{{skill:api#recipes.md}}`, \"Fix in place\"); lean on setProps for remediation writes — font/size/line-height changes auto-reshape with every style range preserved (§6.1.3). Never rebuild the scene to fix a spacing violation. **Fold the instrumented checks INTO this edit** — run the scene-graph walk and read-backs at the END of the same `edit` that applies the fixes (return their results), never as a separate read-only edit: a standalone audit edit costs a full turn and measured runs spent 1–2 of them per session. The edit result's own `lint:` notice already covers the mechanical §6.1 checks — trust it instead of re-measuring those.\n5. **Re-judge from the edit's own render** — the remediation edit's result already ends with a render of the page it changed: that IS your re-preview for that page. Re-judge from it and call `preview` again only for pages the edit did not touch, or when a fine judgment (hairline weights, small type) needs full size — the inline render is downscaled. Re-rendering untouched pages puts near-identical copies of the same design into the conversation, which makes it harder, not easier, to see what moved. Repeat from step 2 until the gate passes.\n<!-- requires:scorecard -->\n<!-- requires:open -->\n6. **Record the verdict** — `scorecard({ verdict: 'pass' })`. The verdict covers the session's **current state**, which is exactly what the passing renders came from, so record it before you touch the scene again. If the loop is being cut short with an axis still below 8 (e.g. the user says ship anyway), record `verdict: 'fail'` — the failure belongs on record, not silently dropped. **The record is a claim about work done**: never record a verdict for renders you did not score. **Any later `edit`, `import` or `open` clears the verdict** and re-arms the gate — judge again, record again. A session resumed after a restart reads as unjudged; that is deliberate, and re-judging is the answer.\n<!-- /requires:open -->\n<!-- unless:open -->\n6. **Record the verdict** — `scorecard({ verdict: 'pass' })`. The verdict covers the session's **current state**, which is exactly what the passing renders came from, so record it before you touch the scene again. If the loop is being cut short with an axis still below 8 (e.g. the user says ship anyway), record `verdict: 'fail'` — the failure belongs on record, not silently dropped. **The record is a claim about work done**: never record a verdict for renders you did not score. **Any later `edit` or `import` clears the verdict** and re-arms the gate — judge again, record again. A session resumed after a restart reads as unjudged; that is deliberate, and re-judging is the answer.\n<!-- /unless:open -->\n<!-- /requires:scorecard -->\n<!-- unless:scorecard -->\n6. **State the verdict** — end the loop with the step 3 table and verdict in your reply. It covers the session's **current state**, which is exactly what the passing renders came from. If the loop is being cut short with an axis still below 8 (e.g. the user says ship anyway), say `FAIL` — the failure belongs on record, not silently dropped. Never claim scores for renders you did not look at. **Any later `edit` re-arms the gate** — judge again.\n<!-- /unless:scorecard -->\n<!-- requires:drafts -->\n7. **Report done** — there is nothing to save: every change is saved to the design as you make it. Report the design's `uri`.\n<!-- /requires:drafts -->\n<!-- unless:drafts -->\n<!-- requires:export -->\n7. **Report done** — there is nothing to save: the product keeps the design after every successful `edit`. `export({ format: 'imgly' })` returns its `uri` to report.\n<!-- /requires:export -->\n<!-- unless:export -->\n7. **Report done** — there is nothing to save: the product keeps the design after every successful `edit`.\n<!-- /unless:export -->\n<!-- /unless:drafts -->\n<!-- requires:scorecard -->\n<!-- requires:export -->\n The gate hangs on `export`: an `export` the current verdict does not cover comes back with an unjudged notice, which is the loop asking you to run again.\n<!-- /requires:export -->\n<!-- /requires:scorecard -->\n\n## Judging discipline\n\n- **Judge the render, not the intent.** A rule satisfied in code but broken on screen is broken.\n- **Imagery fits the subject.** An unrelated photo caps `craft` at 6: swap in the person's image, a generated one if this host makes images, else a solid palette-colour shape (never an empty frame); name the swap in the brief line.\n- **Be harsh on your own work.** The common failure is scoring 8 by charity. If you hesitated, it is a 7.\n- **Score honestly on partial remediation.** If a violation cannot be fixed without re-laying-out the design, say so and recommend the `resize` skill (a layout problem) or a rebuild — do not inflate the score.\n- **The brief wins where the rubric is silent**; the rubric wins on hard-threshold conflicts (§6 intro).\n",
|
|
38
|
+
"docs/judge/SKILL.md": "---\nname: judge\ndescription: >-\n The quality gate and the rules every design is built to. Read it, with its\n design-rules.md, before the first `edit` of any design: the rules are what you\n build to, and the gate is the mandatory step before reporting a design done.\n Also when the user asks for a design review, score, audit, or QA, or when a design\n needs remediation after a failed review. The axes, the gate, the scorecard format\n and the remediation loop are defined in this skill's body — do not judge from\n memory of this description.\n---\n\n# judge — the build → judge → remediate loop\n\n**Before the first `edit` of a design, read `{{skill:judge#design-rules.md}}`** (in the same message as the `api` skill): the full rubric — typography, colour, hierarchy, composition, craft — with the numeric thresholds every axis below is scored against. Build to it; scoring a design against rules you read only afterwards means rebuilding it.\n\nYou are the design's QA judge. Judging is scored against what you SEE in `preview` renders of the **session's current state** — never against the code that produced it, and never from memory. `preview` always renders that current state, so there is nothing to re-ground: if you are unsure what the design looks like now, call `preview` again.\n\n## The 8 axes\n\nScore each axis 0–10 against the render. `baseline` is the execution floor; the other seven map to the sections of `design-rules.md`:\n\n| Axis | What it scores | Rubric |\n| ---------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------- |\n| **baseline** | Nothing broken: no overflow, no blank/placeholder text, no tofu (□), no clipped ascenders/descenders, nothing off-canvas, no unintended overlap | §6.1.7, §6.4 |\n| **hierarchy** | One dominant element; unambiguous reading order; ≈3 (≤4) levels; rank carried by size > weight > color > spacing > position; structure expressed as a grouped block hierarchy (nested where nested) | §6.3 |\n| **typography** | Families/weights, scale bands, leading (incl. the content-area conversion and diacritic/non-Latin rules), measure, rag, tracking, micro-typography, lists & paragraph structure, inline style ranges | §6.1 (checklist §6.1.11) |\n| **color** | Palette ≤ 3 + neutrals; exactly one consistent accent; contrast on the actual background | §6.2 |\n| **composition** | Margins 8–12% of the shortest dimension; shared grid; spacing ladder; balanced whitespace — no dead void; nothing off-canvas | §6.4 |\n| **craft** | Chips/pills/badges built per the chip system; intentional crops; clean decoration; consistent component geometry | §6.5 (checklist §6.5.2) |\n| **copy** | The words say something only this business/occasion could say: no nothing-tagline, transformation claim, uncheckable superlative, upbeat closer or abstract-noun padding; trade idiom and specifics left intact | §6.8 (Copy rules, below) |\n| **localization** | Localized variants only: correct per-language typography, no drift from the source layout, RTL mirrored, script-correct fonts; **source-parity** (appearance/weight/element/decoration match the source render — see below) | §6.6 + the `localize` skill |\n\n**Some axes cannot be judged from a single PNG.** Nine checks below are **instrumented** — they read a measured value, the scene graph, or a second render, not an eyeball — because the naked render either hides the defect or can't reveal the cause. Five of them (chip construction, curved type, list construction, inline emphasis, paragraph structure) catch **construction** defects that render pixel-identically to the correct build: scoring the image alone passes them every time.\n\n- **Leading (typography):** read `getProps(id, ['text.lineHeightVisual'])` and judge the **rendered** gap against §6.1.3, not the raw `text/lineHeight`. Required on every headline/display block and on every text block of a localized variant — the most common defect, and it survives a clean-looking PNG.\n- **Grouping (hierarchy):** walk `getChildren` from the page; each cluster (eyebrow+headline, label+value, icon+text) must be a group block, not loose siblings (§6.3). Ungrouped RTL icons also break on mirror.\n- **Chip construction (craft):** every text-only chip's field is the text block's own `backgroundColor/*`, not a sibling shape behind it; a text block centred on a same-size rect is the tell (§6.5.1).\n- **Curved type (craft):** every arced text is one block whose `(await engine.design.getProps(id, ['text.path'])).text.path` is non-null; single-glyph blocks at stepped rotations are the tell (§6.5.4, and §6.3).\n- **List construction (typography):** every list is one block whose `getProps(id, ['text.paragraphs'])` paragraphs each carry a `listStyle` ≠ `'None'`. Tells: a typed `\"• \"`/`\"1. \"`, a lone marker-glyph block, one block per item (§6.1.8; the last two fail §6.3 too).\n- **Inline emphasis (typography):** emphasis inside a line is a range on one block (`getProps(id, ['text.ranges'])` has more than one); two blocks on one baseline and face, differing only in colour or weight, are the tell (§6.1.9), unless one of the pieces has `text.string` keys and the pieces share one group. Capitals typed into the string with no `case` range are frozen caps (§6.1.9).\n- **Paragraph structure (typography):** a string with `\\n\\n` and `text/paragraphSpacing == 0`, or N stacked one-paragraph blocks that read as one passage, fail §6.1.8.\n- **Copy (copy):** score the words, not their setting. Read every string from the walk below in render order, as one voice, and ask whether a competitor could paste the lines onto their own page unchanged (§6.8, bundled at the end). Bias hard toward leaving copy alone: specifics and trade idiom are not tells, and em dashes and curly quotes are correct typography (§6.1.7). **A thin brief does not license inventing:** generic but true passes this axis; a name, price, date, place or claim the brief did not give fails. On a source-derived edition, a re-worded string fails **baseline** (Copy parity below), not this axis.\n- **Source-parity (localization + composition + craft + typography):** a variant is judged against **its source**, not in isolation — see the next section. Applies to every design derived from another: a **localization**, a **resize**, and a **brand restyle**. For a localized variant, also confirm the source's **style ranges survived**: if the source block has multiple runs and the variant has one, the translation flattened the accent (`localize`), which fails **localization** even when the render looks clean.\n\n## The gate\n\n**Every applicable axis ≥ 8. No averaging. N/A = 10.** One axis at 7 fails the design. An axis is N/A only when it genuinely cannot apply (e.g. `localization` on a single-language design) — score it 10 and mark it N/A in the scorecard.\n\nThe caller may override the default: narrow the axes (\"judge typography and composition only\") or move the threshold (\"pass ≥ 9\"). Apply the override for that run; otherwise the full gate is the default.\n\n**This skill never asks.** Its two parameters — the axis set and the threshold — are both\ndefaultable, and it runs as the gate of the loop on every build, so a question here would interrupt\nevery design this server makes. Take the override if the caller gave one, otherwise take the full\ngate, and score. This is the stated exception to the intake contract (`{{skill:create#intake.md}}`), which every other skill follows.\n\n**A source-derived variant (localization, resize, or brand restyle) cannot pass on its standalone render.** The source-parity diff below is a **mandatory gate step**, not an \"if in doubt\" — a variant judged only against its own PNG has not been judged. If you did not `preview` the source and diff it, the gate is incomplete and the design is not done.\n\n## Source-derived variants — judge against the source, not just the render\n\nA **localization**, a **resize**, and a **brand restyle** are not standalone designs: each is derived from a source, and each changes exactly **one** layer — the words, the canvas, or the style — while carrying the rest faithfully. Judging one in isolation passes variants that are internally clean but **infidelity to the original** — the single largest class of derived defects (wrong leading after a font swap, a fill/effect/corner-radius/weight that silently changed, decoration that drifted, an element that vanished, a restyle that quietly re-flowed the layout, an icon the RTL flip disassembled). None of these show up scoring the variant's PNG alone; **all** of them show up the moment you put the variant next to the source.\n\n**So for every variant with a source, `preview` the source too and diff the two renders — always, before scoring.** First name **which layer the variant is allowed to change** (words / canvas / style); everything else is held, and every difference outside that layer is a defect until you can name it as a deliberate consequence. Then judge these against the source (they feed the axes noted):\n\n- **Element inventory** (localization + composition) — every content cluster on the source has a counterpart on the variant; nothing silently dropped or added. Missing elements read as \"too simplistic.\"\n- **Copy parity** (baseline; **brand** + resize) — the strings are the source's strings. A restyle and a reformat carry copy verbatim: no re-worded headline, no shortened subline, no dropped line \"to fit\" the new face or canvas. Re-wording is the `localize` layer; if the copy no longer fits, fix the type, not the text.\n- **Appearance parity** (craft + color) — fills, gradients, effect/blur stacks, opacity, corner radius, stroke, shadow, and any overlay match the source; none re-created by eye, none added/removed (a cover that \"became darker,\" a rounded corner gone square). **For a brand restyle this check inverts:** appearance is _supposed_ to change, so parity is on the **role assignment**, not the values — the block that was the background is still the background, the one accent moment is still that block, the divider is still a divider. A restyle that recoloured a rule into a second lead, or promoted a caption to the accent, broke role parity even though every value came from the kit.\n- **Weight parity** (typography) — every block renders at the source block's weight; the font swap did not land on the family's default regular cut. For a brand restyle, the target is the **brand's** weight for that role — but relative weight order across blocks still matches the source's hierarchy.\n- **Geometry / decoration drift** (localization for localize; composition for resize; craft + composition for brand) — for **localize**, every block sits on the source grid (position + size), baseline-relative where the face changed; decoration with an internal geometric relationship (a ring of stars, evenly-stepped dashes) holds that relationship. For **resize**, geometry is _re-derived_ (drift ≠ moved), so instead judge that the **system** and **identity** carried (§6.4/§6.3) and nothing was lost. For **brand**, geometry is held like a localization — a block moved for anything but a stated brand rule (safe-area margin, kicker pill, size threshold) is drift; a re-layout is a `resize`, not a restyle.\n- **Re-wrap fallout** (baseline; **brand** + localization) — a font swap changes the measure, so an auto-height block can re-wrap to a new line count, grow, and collide with or push its neighbour even though nothing was moved. Diff the **line counts** against the source, not just the positions.\n- **RTL selectivity** (localization) — icons/logos/marks/numerals/charts/photos are **not** mirrored; composed marks moved as groups, not disassembled.\n\nA variant that is clean on its own but diverges from the source on any of these fails the axis noted — **do not pass it on the strength of the standalone render.** When a divergence is a deliberate, correct adaptation (a headline re-wrapped for a longer language, a block re-flowed for a new aspect, a margin widened to the brand's safe area), that is not drift; name it and pass.\n\n**A brand restyle carries a second gate.** The kit's `avoid` list and `do-dont/` gallery sit **on top of** the axes: a single hard `avoid` violation fails the restyle even when every axis is ≥ 8. Add an **avoid-list** row to the scorecard and score it against the kit, not the rubric (the `brand` skill).\n\n<!-- requires:video -->\n## Videos — judge the timeline, not its first frame\n\nA page with a timeline (clips, animations, audio) is judged across its whole duration. A plain `preview` shows one frame; judged alone it passes a video whose middle is broken. `time` applies to every block in a call, so it is one `preview` call per moment — pick them from the timeline you built:\n\n- **Frames** — a representative set, about six moments: the first frame, a few beats once their entrance has settled (the busiest ones), the **middle of a transition** (cut + duration/2; every transition when there are few), and the last frame (`duration` − 0.1; the timed preview reports `duration`). Score all eight axes on every frame: a headline that collides mid-slide or a chip that leaves the canvas mid-animation fails `baseline` like it would on a still.\n- **Motion** (`baseline` + `craft`) — a transition midpoint shows both clips blended; one clip shown whole there means the transition is missing or off its cut. Every line of text stays on screen long enough to read: a short label at least 0.8 s after it settles, a sentence about 0.3 s per word. The last frame is a deliberate end card, not an empty tail.\n- **Audio** (instrumented — `preview` has no sound) — read the page's `audio` blocks in the scene-graph walk: each block's `playback` window lies inside the page's duration; a music bed spans the page and has a `fadeOut`; the music is ducked under a voiceover (0.3–0.5 while it speaks). A missing bed or voiceover the brief asked for, or a silent tail, fails `baseline`; unset fades or levels that fight each other fail `craft`. A silent video is a complete deliverable when the brief or its defaults chose it (no sign-in to generate music, the user said so) — name that in the brief line.\n<!-- requires:export -->\n- **The export** — judge frames with `preview`, not with trial exports: an mp4 export is slow, so export once, after the gate passes. Then check that one export from its result: `audioDuration` present and about equal to `duration` (absent means the mp4 has no audio track — a defect when the design has audio). Re-export only if that check finds a defect.\n<!-- /requires:export -->\n\nRecord the verdict on the frames you scored, as for any design.\n<!-- /requires:video -->\n\n## The loop\n\n<!-- requires:import -->\n1. **Preview** — `preview` every page that matters, in **one call**: `preview()` with `blockIds` omitted renders every page of the current design, so scoring the whole design costs no more than scoring page 1. Judging an old render is judging the wrong design. A render is invalidated by **content** changes: if nothing has changed the scene since a render you already have in this conversation (a diagnostic/read-only `edit`), that render is still current — reuse it instead of re-rendering. **Type too small to see in the page render is not judged until you zoom it:** legal copy, captions, disclaimers and any label under ~12 px on the canvas come back as a smudge at 0.25 MP, so `baseline` and `typography` on those blocks are being scored on nothing. The page render names them for you: a `preview` of a page ends with whatever it was too coarse to resolve — type under ~10 rendered px, strokes under one — and the exact call that shows them. Follow it — `preview({ blockIds: [<textId>] })` frames the block on its page, no coordinates needed — and judge how it is SET: clipped ascenders or descenders, tofu, a hairline that washes out at size, contrast against what is actually behind it, a collision the page view hid. The words themselves you already have from the scene-graph walk below; the zoom is for what the strings cannot tell you. **If the design is a localization, a resize, or a brand restyle, you need the SOURCE's render too** for the source-parity checks above. `preview` only ever renders the current session, so the source render has to come from the conversation: those three skills each `preview` the source and save it before starting the variant, precisely so the render is already in front of you here.\n<!-- requires:video -->\n **A page with a timeline needs one `preview` per moment** — see Videos above.\n<!-- /requires:video -->\n<!-- requires:open -->\nIf it is not, `open({ uri: '<source uri>' })` and `preview` it, then `open` the variant's `uri` (the one its `import` returned) to return to it — `import` would give you copies instead.\n<!-- /requires:open -->\n<!-- unless:open -->\n<!-- requires:version -->\nIf it is not, `preview({ design: '<source design>' })` it, then carry on with the variant by its own `design` and `version` — nothing needs saving or loading back.\n<!-- /requires:version -->\n<!-- unless:version -->\nIf it is not, save the variant first (`export({ format: 'imgly' })`) and keep its `uri`, load the saved source back (`import({ source: { uri: '<source uri>' } })`) and `preview` it, then `import` the variant's `uri` to return to it. The variant's next save is then a new file — report that `uri`, not the earlier one.\n<!-- /unless:version -->\n<!-- /unless:open -->\n<!-- /requires:import -->\n<!-- unless:import -->\n1. **Preview** — `preview` every page that matters, in **one call**: `preview()` with `blockIds` omitted renders every page of the current design, so scoring the whole design costs no more than scoring page 1. Judging an old render is judging the wrong design. A render is invalidated by **content** changes: if nothing has changed the scene since a render you already have in this conversation (a diagnostic/read-only `edit`), that render is still current — reuse it instead of re-rendering. **Type too small to see in the page render is not judged until you zoom it:** legal copy, captions, disclaimers and any label under ~12 px on the canvas come back as a smudge at 0.25 MP, so `baseline` and `typography` on those blocks are being scored on nothing. The page render names them for you: a `preview` of a page ends with whatever it was too coarse to resolve — type under ~10 rendered px, strokes under one — and the exact call that shows them. Follow it — `preview({ blockIds: [<textId>] })` frames the block on its page, no coordinates needed — and judge how it is SET: clipped ascenders or descenders, tofu, a hairline that washes out at size, contrast against what is actually behind it, a collision the page view hid. The words themselves you already have from the scene-graph walk below; the zoom is for what the strings cannot tell you. **If the design is a localization, a resize, or a brand restyle, you need the SOURCE's render too** for the source-parity checks above. `preview` only ever renders the current session, so the source render has to come from the conversation: preview the design **before** you change it — that render is the source. If it is not in front of you, skip the source-parity checks and say so in the brief line (step 3).\n<!-- requires:video -->\n **A page with a timeline needs one `preview` per moment** — see Videos above.\n<!-- /requires:video -->\n<!-- /unless:import -->\n2. **Judge** — score each applicable axis against the render. For `typography` and `craft`, dry-run the §6.1.11 and §6.5.2 checklists line by line (read them via `{{skill:judge#design-rules.md}}`); for `copy`, apply §6.8 (bundled at the end of this document) before scoring the words. Any \"no\" on an applicable checklist line caps that axis below 8. Run the **instrumented checks** where they apply — as the TAIL of a remediation `edit` when one is happening anyway, standalone only when nothing needs fixing: the leading read-back (text.lineHeightVisual vs band), the scene-graph reads for grouping, chip construction, curved type, list construction, inline emphasis, paragraph structure and copy, and — for source-derived variants — the source-parity diff. A clean-looking PNG is not sufficient for these nine. **All seven scene-graph reads share one walk** of `engine.design.getChildren` from the page — do them in a single pass, not seven. For each text block that walk reaches, one read of `await engine.design.getProps(id, ['text', 'text.ranges', 'text.paragraphs'])` (paragraphSpacing, the string, `path`, the style runs, the per-paragraph `listStyle`) answers six of the seven; grouping is answered by the walk itself.\n3. **Scorecard** — report the result in this shape (conversational markdown; no files):\n\n | Axis | Score | Violations | Fix |\n | ----------- | ----- | ---------------------------------------------------------------- | ---------------------------------------------------- |\n | typography | 6 | all-caps eyebrow untracked (§6.1.6); body leading unset (§6.1.3) | set letterSpacing 0.12; set converted lineHeight 1.5 |\n | composition | 8 | — | — |\n\n One row per applicable axis, N/A rows marked. Below the table: the verdict (`PASS` / `FAIL — remediating`) and, on failure, the remediation order (worst axis first).\n\n **Then one line for the brief.** Restate the brief this design was built from and name any place the design departs from it — a direction, palette, format or audience that is not what was asked for or agreed. The eight axes score execution only, so a design built beautifully in a direction nobody chose passes all of them; this line is the only thing that catches it. It does not gate (a deliberate, explained departure is fine) and it never becomes a question — `judge` does not ask. If the design was built with a parameter **defaulted rather than asked**, say which: that is the sentence the user needs in order to correct it in one word.\n\n4. **Remediate** — apply the fixes via `edit`. Remediation is surgical: fix the flagged blocks in place (`{{skill:api#recipes.md}}`, \"Fix in place\"); lean on setProps for remediation writes — font/size/line-height changes auto-reshape with every style range preserved (§6.1.3). Never rebuild the scene to fix a spacing violation. **Fold the instrumented checks INTO this edit** — run the scene-graph walk and read-backs at the END of the same `edit` that applies the fixes (return their results), never as a separate read-only edit: a standalone audit edit costs a full turn and measured runs spent 1–2 of them per session. The edit result's own `lint:` notice already covers the mechanical §6.1 checks — trust it instead of re-measuring those.\n5. **Re-judge from the edit's own render** — the remediation edit's result already ends with a render of the page it changed: that IS your re-preview for that page. Re-judge from it and call `preview` again only for pages the edit did not touch, or when the edit's result notes something too small to read (follow the zoom call it names) — the inline render is the same page render `preview` gives, note included. Re-rendering untouched pages puts near-identical copies of the same design into the conversation, which makes it harder, not easier, to see what moved. Repeat from step 2 until the gate passes.\n<!-- requires:scorecard -->\n<!-- requires:open -->\n6. **Record the verdict** — `scorecard({ verdict: 'pass' })`. The verdict covers the session's **current state**, which is exactly what the passing renders came from, so record it before you touch the scene again. If the loop is being cut short with an axis still below 8 (e.g. the user says ship anyway), record `verdict: 'fail'` — the failure belongs on record, not silently dropped. **The record is a claim about work done**: never record a verdict for renders you did not score. **Any later `edit`, `import` or `open` clears the verdict** and re-arms the gate — judge again, record again. A session resumed after a restart reads as unjudged; that is deliberate, and re-judging is the answer.\n<!-- /requires:open -->\n<!-- unless:open -->\n6. **Record the verdict** — `scorecard({ verdict: 'pass' })`. The verdict covers the session's **current state**, which is exactly what the passing renders came from, so record it before you touch the scene again. If the loop is being cut short with an axis still below 8 (e.g. the user says ship anyway), record `verdict: 'fail'` — the failure belongs on record, not silently dropped. **The record is a claim about work done**: never record a verdict for renders you did not score. **Any later `edit` or `import` clears the verdict** and re-arms the gate — judge again, record again. A session resumed after a restart reads as unjudged; that is deliberate, and re-judging is the answer.\n<!-- /unless:open -->\n<!-- /requires:scorecard -->\n<!-- unless:scorecard -->\n6. **State the verdict** — end the loop with the step 3 table and verdict in your reply. It covers the session's **current state**, which is exactly what the passing renders came from. If the loop is being cut short with an axis still below 8 (e.g. the user says ship anyway), say `FAIL` — the failure belongs on record, not silently dropped. Never claim scores for renders you did not look at. **Any later `edit` re-arms the gate** — judge again.\n<!-- /unless:scorecard -->\n<!-- requires:drafts -->\n7. **Report done** — there is nothing to save: every change is saved to the design as you make it. Report the design's `uri`.\n<!-- /requires:drafts -->\n<!-- unless:drafts -->\n<!-- requires:export -->\n7. **Report done** — there is nothing to save: the product keeps the design after every successful `edit`. `export({ format: 'imgly' })` returns its `uri` to report.\n<!-- /requires:export -->\n<!-- unless:export -->\n7. **Report done** — there is nothing to save: the product keeps the design after every successful `edit`.\n<!-- /unless:export -->\n<!-- /unless:drafts -->\n<!-- requires:scorecard -->\n<!-- requires:export -->\n The gate hangs on `export`: an `export` the current verdict does not cover comes back with an unjudged notice, which is the loop asking you to run again.\n<!-- /requires:export -->\n<!-- /requires:scorecard -->\n\n## Judging discipline\n\n- **Judge the render, not the intent.** A rule satisfied in code but broken on screen is broken.\n- **Imagery fits the subject.** An unrelated photo caps `craft` at 6: swap in the person's image, a generated one if this host makes images, else a solid palette-colour shape (never an empty frame); name the swap in the brief line.\n- **Be harsh on your own work.** The common failure is scoring 8 by charity. If you hesitated, it is a 7.\n- **Score honestly on partial remediation.** If a violation cannot be fixed without re-laying-out the design, say so and recommend the `resize` skill (a layout problem) or a rebuild — do not inflate the score.\n- **The brief wins where the rubric is silent**; the rubric wins on hard-threshold conflicts (§6 intro).\n",
|
|
39
39
|
"docs/judge/copy-writing-rules.md": "Expands the **copy** axis. Every other section governs how the design looks; this one governs what it says. A page can pass all seven other axes and still be obviously machine-written, because nothing else in this rubric reads the words.\n\nThe rules below are adapted from Wikipedia's [\"Signs of AI writing\"](https://en.wikipedia.org/wiki/Wikipedia:Signs_of_AI_writing) (WikiProject AI Cleanup), narrowed to copy that lives inside a layout. Template copy is not an essay: a slide headline is six words, a menu item is three, a chart caption is one sentence explaining a number. The judgment is not \"does this paragraph flow\" but **\"would a person who actually runs this business write this line on this artifact.\"**\n\n#### The tells worth hunting\n\n- **The nothing tagline.** A line that could sit on any brand in any category. _\"We navigate the intersection of raw human emotion and digital precision to redefine the modern aesthetic\"_ describes no business. Replace it with what the business actually does.\n- **The transformation claim.** _turns X into Y_, _stops being X and becomes Y_, _from a bottleneck into a safety net_. State the change plainly and once. The same shape twice in one design is the confession.\n- **The superlative nobody can check.** _world-class_, _best-in-class_, _premier_, _unparalleled_, _the world's most-loved_. A real company writes the number instead — and when a number is already in the sentence, the superlative is doing nothing.\n- **The upbeat closer.** _the compounding is just getting started_, _exciting times ahead_, _a major step in the right direction_. Cut the sentence; the line before it already made the point.\n- **Manufactured depth.** Present-participle tails that add no fact (_…, reflecting the community's deep connection to the land_), abstract-noun openers that delay the point (_X has always run on a quiet contradiction_), and aphorism formulas (_X is the language of Y_).\n- **Rule-of-three padding.** Three abstract nouns where one concrete one would do: _disciplined growth, operational resilience, and durable long-term value_.\n- **Vocabulary that marks the text as generated.** _elevate, unlock, seamless, empower, effortless, bespoke, timeless, vibrant, tapestry, testament, redefine, leverage, holistic, curated_. Judge each in context — `curated wine pairing` on a restaurant menu is ordinary English; `curated experiences that elevate your journey` is not. The word is never the tell; the emptiness is.\n- **Filler body text.** Copy that fills a frame without saying anything. Delete the block and ask whether the page lost information. If it did not, the block needs a real sentence, not a shorter version of the same nothing.\n\n#### What is not a tell\n\nThe failure mode of a copy pass is damaging good writing. Leave copy alone when it is:\n\n- **Specific.** Numbers, dates, names, addresses, real figures. `ARR reached $48.2M, up 27% year over year` is not slop, whatever its cadence.\n- **Domain idiom.** `synergy targets` in a CV, `transformation programme` in consulting, `house-made` on a menu. Trade language is how those trades write.\n- **The voice the brief asked for.** A luxury stationery card is meant to sound formal; a pull quote is meant to sound quotable; a greeting card is warm and formulaic because that is the product.\n- **Deliberately generic placeholder copy**, where the design ships as a template for someone else's words.\n\n#### Typography is not a tell\n\nTwo rules from general anti-AI-writing guidance are written for web prose and are **wrong here**:\n\n- **Em and en dashes stay.** In a layout the em dash is typography: `Reception 7:00 PM — Dinner at 8:00` is correct setting, and so is a dash in a pull quote or a chart annotation. What can be a tell is **density** — three or more in one short block, or a dash in every second line of a deck. Flag the pattern, never the character.\n- **Curly quotes stay.** `“…”` and `’` are correct typography and §6.1.7 already requires them. Straight quotes are the defect, not the fix — except in a monospace or terminal design where the plain glyph is the point.\n\nLikewise, do not inject personality where the artifact does not want it. Adding opinions, first person or asides is right for a blog post and wrong for a wedding invitation, a lab report cover or a compliance footer, where neutral and plain **is** the correct human voice.\n\n#### Editing copy in an existing design\n\n- **Length is a layout constraint.** The text sits in a frame laid out around it. Keep a rewrite within ~10% of the original character count, preserve explicit line breaks and their positions, and preserve leading/trailing spaces — some strings are fragments of a sentence split across styled blocks. One string in, one string out: never merge or split blocks to make a rewrite fit.\n- **Localized editions move together.** A source-derived edition shares its blocks with the source (§6.6), so rewriting only the source language leaves the German saying what the English used to. Rewrite every language, or leave the string alone.\n- **Check the glyphs before you commit.** A saved archive carries **subsetted** fonts — only the glyphs the copy needed when it was built. A rewrite that introduces a new character has no glyph, and the engine falls back to another face silently rather than failing: the render comes back with mixed stroke weights inside one headline and looks almost right. Latin copy rarely trips this; a CJK subset can be ~150 glyphs, so nearly any rewrite does. Re-render and read the result, and prefer characters the design already uses.\n\n#### Pass\n\nEvery line names something true about this business, product or occasion that a competitor could not paste into their own page; no transformation claim, uncheckable superlative or upbeat closer; no abstract-noun opener or participle tail standing in for a fact; vocabulary chosen for the trade rather than for the register; every rewrite within its frame's length, its line breaks intact, its sibling languages carried, and its glyphs actually present in the packed fonts.\n",
|
|
40
40
|
"docs/judge/design-rules.md": "# Design rules (the full rubric)\n\nThe enforceable design best practices this server's designs are built to and the `judge` skill scores against. Read it before the first `edit` of a design. Section numbers here are canonical: `§6.x` references in every skill resolve to this file.\n\n- **Web vs print** — where the two media diverge (line height, minimum sizes) the rules are split **Web** / **Print**; \"web\" values apply to screen-destined canvases (social posts, banners). An unqualified rule applies to both.\n- **N/A = 10** — a rule that cannot apply to a given design scores N/A, i.e. 10.\n- **Defaults fill silence** — where the brief gives an explicit value, use it; where it is silent, apply this file's defined **default** rather than leaving it unset or letting the engine default stand. Every numeric rule below that names a _default_ (line-height §6.1.3, type scale §6.1.2, measure §6.1.4, all-caps tracking §6.1.6, margins §6.4) is that fallback. A brief value that violates a hard threshold is clamped to it — except line-height, judged by the rendered gap after conversion, never by the raw number (§6.1.3).\n\n### 6.1 Typography\n\nExpands **Axis 3 — Typography** (\"≤3 font families, correct pairing, sizes in band, sane line-spacing and leading, no tofu\"). Every subsection below must hold for Axis 3 to score ≥ 8.\n\n#### 6.1.1 Font families & pairing\n\n- Use **≤3 font families** per design (≤2 preferred); no more than **4 weights** total. Every extra family/weight dilutes hierarchy and reads as inconsistency.\n- Pair by **contrast**, not similarity — e.g. a serif display against a sans body, or one superfamily used across roles. Never pair two families that are almost alike (two humanist sans, two geometric sans).\n- Give every family a defined fallback: an **embedded/outlined** font (print) — and verify glyph coverage for every character in the copy (web/canvas). System substitution silently changes metrics and breaks leading and measure.\n- **Pass:** ≤3 families, ≤4 weights, pairing is by intentional contrast/superfamily, every family verified to cover the copy (print: embedded/outlined).\n\n#### 6.1.2 Type scale & size bands\n\n- Derive all sizes from **one modular scale** (ratio 1.2–1.618; 1.25 is a safe default). No arbitrary one-off sizes.\n- Keep text in clear **bands** — Display/Headline, Subhead, Body, Caption, Fine print — each separated by **≥1 scale step** so the hierarchy is unambiguous (supports Axis 2).\n- Minimum legible sizes:\n - **Web** — body ≥ **16px**, caption ≥ **12px**, never below **11px**.\n - **Print** — body **9–12pt**, caption ≥ **7pt**, never below **5pt**.\n- **Pass:** every size snaps to one modular scale; body ≥ 16px (web) / ≥ 9pt (print); bands are ≥1 step apart and visually distinct.\n\n**Canvas guidance — sizes as % of page height:**\n\n| Role | % of page height | Example for 1080 px page |\n| ----------- | ---------------- | ------------------------ |\n| Headline | 3 – 5 % | 32 – 54 px |\n| Body | 1.5 – 2 % | 16 – 22 px |\n| Caption | 1.2 – 1.5 % | 13 – 16 px |\n| Min legible | — | 14 px |\n\n#### 6.1.3 Line height / leading — the headline rule\n\nLine spacing is the top driver of the \"inconsistent typography\" complaint. Three principles govern it: **explicitness** (every text block carries a deliberately set line-height — never an inherited default), the **inverse rule** (small text needs more line-height; large display needs less), and **consistency** (identical leading across same-band text within one design).\n\n- **Set line-height explicitly on every text block** — including single-line labels, captions, and all-caps titles, not just multi-line body copy. An unset line-height (the engine/CSS default) is a defect even when the block is one line: it silently tracks the font's default metrics, can't be verified against the bands below, and defeats both the consistency and all-caps rules. A one-line all-caps label still takes the tighter all-caps multiplier (**0.9–1.0**); the value is judged by band + intent, not by whether the text happens to wrap. Same-band single-line blocks (e.g. an attribution and a caption in the same face) share their leading just as body blocks do.\n\n> **Authoring in CoDesign / CE.SDK — write line-heights as `{ visual }`.** Every line-height figure in this section is a _visual_ CSS-style multiplier of the font size. The engine's raw `text/lineHeight` is a different scale (it multiplies the font's per-face content area), so a raw number renders looser than it reads. The facade converts for you — write the band value directly:\n>\n> ```js\n> await engine.design.setProps(block, {\n> text: { lineHeight: { visual: 1.2 } }\n> });\n> // read back in the same terms:\n> await engine.design.getProps(block, ['text.lineHeightVisual']); // → 1.2\n> ```\n>\n> The conversion loads the face's metrics itself. A `{ visual }` (or font/size) write reshapes and replays every per-character style range for you. If you ever reshape via the raw APIs instead: **⚠ re-setting the string wipes every per-character style range** — capture with `getProps(id, ['text.ranges'])` and replay (§6.1.9). The judge scores the _rendered_ gap (§6.1.6), and reads it back via `text.lineHeightVisual` — same numbers as the bands below.\n>\n> **⚠ An explicit line-height from the user's brief is a visual target too** — write it as `{ visual }` and judge the rendered gap, never the raw engine number. A prompt asking for all-caps line-height **1.15** is not \"too loose for the 0.9–1.0 band\" until the _rendered_ gap violates §6.1.6; when the prompt names a line-height, the default is to use it.\n\n- **Web (unitless multipliers):**\n - Body **1.4–1.6** (default **1.5**); long-form reading up to **1.65**.\n - Headlines **1.1–1.25** (default **1.1**); large display **≤1.1** (default **1.1**).\n - **All-caps display / headlines** take a **tighter** multiplier than mixed-case — **0.9–1.0** for multi-line — because caps fill only the cap-height band (~70% of the em) and use no descender space; a value that looks tight for mixed-case leaves a descender-sized void between all-caps lines. Judge by the **visual gap** (target ~0.15–0.25× cap height), not the number.\n - **WCAG:** body line-height ≥ **1.5**; paragraph spacing ≥ **2×** the font size.\n- **Print (leading as a unitless multiplier of point size):**\n - Body **1.2–1.45** (default **1.2**). Push toward the low end for dense or large-x-height faces, toward the high end for airy or small type.\n - Headlines **1.0–1.2** (default **1.05**); tight display setting may go slightly negative (**0.95–1.0**).\n - **All-caps titles: 0.9–1.0** (tighter than mixed-case display's 1.0–1.2) — same cap-height reason.\n- **Localized / non-Latin copy — the per-script rules live in the `localize` skill.** Per-script leading bands and diacritic rules — the capital-diacritic all-caps loosening, the marked-capital mixed-case nudge, the localized-display default, and the CJK / Arabic-Naskh / Vietnamese bands — live in the `localize` skill's `reference/` family files (`latin-expansion.md`, `arabic.md`, `cjk.md`, `vietnamese.md`, `cyrillic.md`). All values there are **visual multipliers** — apply this section's content-area conversion like every value here (§6.6).\n- **Tune leading to measure** — longer measure needs more leading; short measure needs less. Never set leading in isolation from line length (§6.1.4).\n- **Consistency** — every body block in one design shares the same leading; every same-band heading shares the same leading.\n- **Pass:** **every text block carries an explicit line-height (incl. single-line & all-caps labels)**; body line-height **1.4–1.6** (web) / **1.2–1.45** (print); headline leading tighter than body; **all-caps titles tighter still (0.9–1.0, web & print), no descender-void between lines**; leading uniform across same-band text; **localized / non-Latin leading set per the `localize` skill's family files**; WCAG body ≥ 1.5 (web).\n\n#### 6.1.4 Measure (line length)\n\n- Set body **measure to 45–75 characters** (~66 ideal for a single column; **40–50** per column in multi-column layouts). Too-long lines lose the return sweep; too-short lines fracture rhythm.\n- On wide canvases, constrain body width — don't let body text run the full canvas width.\n- **Pass:** body measure 45–75 chars (40–50 multi-column); no full-canvas-width body lines.\n\n#### 6.1.5 Alignment, rag, justification\n\n- Default body alignment: **left** (LTR) / **right** (RTL). Avoid centered or justified _running_ text.\n- Justify only with **hyphenation on** and rivers controlled (print); **never justify short measure**.\n- Keep a **soft rag** — no ladders (repeated hyphens/word-shapes down the edge), no line more than ~50% shorter than its neighbors.\n- **Set alignment and a growth anchor explicitly — build to survive a text-length change.** A block that _looks_ centred only because its current string happens to be that width is **not** centred: encode the intent. Give every text block an **explicit horizontal alignment** (`text/horizontalAlignment`), and set its width mode so it **grows from the correct edge** when the string changes length — a label centred under a number stays `Center`; a value aligned to a right margin is right-anchored; a column of labels shares one alignment. This is what makes a design **localizable**: when the German string is 30% longer it must grow symmetrically (or from the anchored edge), not drift right off a left-anchored Auto frame. A source that encodes position instead of intent forces the localizer to re-infer alignment from the render and get it wrong (the \"labels drifted right / SEAT not aligned with BLOCK\" defect originates **in the source**, not the localization). Applies equally to chips (§6.5.1: the field grows with the label).\n- **Pass:** body not centered/justified without cause; RTL layouts mirrored (ties to the RTL axis); rag is soft, no ladders; **every text block carries an explicit alignment and grows from the intended edge on a length change (localization-safe), not an incidental centering that breaks when the copy changes.**\n\n#### 6.1.6 Tracking / letter-spacing & case\n\n- **Don't letter-space lowercase body text.** Tighten large display slightly (**−1% to −3%**).\n- **Loosen all-caps and small-caps — always, and to a defined default.** Never leave all-caps at 0 tracking. **Default +10% (0.1em)** — `case: 'Uppercase'` sets 0.1 em on a block tracked below 0.05 em (raise it to the web floor yourself); acceptable band **+5% to +25% (0.05–0.25em)**, scaled by size and length — tighter (~+8%) for larger/longer strings, looser (up to +25%) for short airy display labels and wide-set wordmarks. On **web**, never below the WCAG floor of **0.12em** — so a web all-caps label defaults to **0.12em**, not 0.1em. This default applies even to one-line labels and even when the prompt is silent on tracking (per \"Defaults fill silence\" at the top of this file).\n- Avoid long strings of **all-caps** — reserve caps for short labels; they slow reading in body copy.\n- **Setting all-caps titles** — caps have no ascender/descender extension, so set them **optically**: pull line-height below the mixed-case display range (see §6.1.3), space to **cap height** rather than the em box, and prefer real small-caps to shrunk-and-tracked caps where the family offers them. Keep all-caps to a line or two of display — never a paragraph.\n- Use **real weights and real italics**, never faux-bold or faux-oblique when the family provides the true cut.\n- **Pass:** body untracked; all-caps loosened to the defined default (**+10%; web ≥0.12em**, band +5–25%) and short, **with line-height tightened per §6.1.3 (no inter-line void)**; no faux styling where a real weight/italic exists.\n\n#### 6.1.7 Micro-typography\n\n- Use **smart punctuation**: curly quotes (\" \" ' '), en dash (–) and em dash (—) correctly, real ellipsis (…). No straight quotes, no `--` for a dash.\n- **No double spaces.** Use **non-breaking spaces** to prevent bad breaks (number + unit, \"Fig. 4\", brand names).\n- **No widows or orphans**; no single-word last line; no hyphen on a paragraph's last line.\n- **No missing glyphs / tofu (□)** and **no clipped** ascenders/descenders — the direct expansion of Axis 3's \"no tofu.\" Verify the chosen font actually covers every character in the copy (critical for localized text).\n- **Pass:** smart punctuation throughout; zero tofu and zero clipping; no widows/orphans in headings or short blocks.\n\n#### 6.1.8 Lists & paragraph structure\n\n**Both rules here are construction rules, and construction is invisible in a PNG** — a hand-built list and a native one render almost identically. They are verified by **reading the scene graph**, like grouping (§6.3), chips (§6.5.1) and curved type (§6.5.4).\n\n- **A multi-line list item hangs — wrapped lines align to the text, not under the marker.** When a bulleted / numbered item wraps, the continuation line must indent to the **text start** (a hanging indent), never fall back under the bullet or number. Text wrapping under its own marker is the most common list defect and reads as broken structure.\n- **One text block holds the whole list — one paragraph per item.** Set the marker with the engine's list feature (`text: { listStyle }` whole-block, `text: { paragraphs: [{ index, listStyle, listLevel }] }` per paragraph). There are three hand-built fakes and all three are wrong: **(1)** a marker typed into the string (`\"• \"`) — no hanging indent; **(2)** a lone marker glyph block beside a left-aligned text frame — the marker is unbound and drifts off its text on any copy, font or locale change; **(3)** one text block per item — there is no list at all, just N loose ungrouped blocks that also fail §6.3. Only the native feature keeps the marker, the gap and the hanging indent bound to the item.\n- **Consistent marker, spacing, and alignment** across every item in a list; nested levels step the indent by one unit (`paragraphs[].listLevel`; `listIndentPerLevel` sets the step).\n- **Multi-paragraph copy is ONE text block with paragraph spacing** — `text/paragraphSpacing`, plus per-paragraph alignment and leading (`setProps(id, { text: { paragraphs: [{ index, horizontalAlignment, lineHeight }] } })`; read them back with `getProps(id, ['text.paragraphs'])`). Write it as `{ em: n }` (**0.4–0.8** is the usable band) or `{ px: n }`; a bare number is the engine's own scale and a pixel-shaped one silently runs the copy off the page. Not blank lines: an empty line is a full line box, so it scales with the font size instead of the spacing ladder (§6.4) and can't be tuned independently. And not N stacked blocks: those don't reflow together, drift apart on any length change, and arrive ungrouped.\n- **Pass:** multi-line items use a hanging indent (wrap aligns to the text, not the marker); every list is the native list feature on a single block, one paragraph per item — no typed markers, no lone marker blocks, no block-per-item; marker style, gap, and indent uniform per list; multi-paragraph copy is one block with real paragraph spacing rather than blank lines or stacked blocks.\n\n#### 6.1.9 Rich text — inline style ranges\n\nEmphasis **inside** a line — an accent-coloured word, a bold lead-in, an inline price, a struck-through old price, a superscript unit or mark — is a **style range on one text block**, never a second text block placed beside the first. Like §6.1.8, this is a construction rule: the two builds render near-identically and are told apart in the block tree.\n\n- **A range is the unit of emphasis.** Character styling is a `text.ranges` entry: `setProps(id, { text: { ranges: [{ from, to, color?, weight?, style?, size?, typeface?, case?, scriptStyle?, baselineShift?, decoration? }] } })`. Read them back with `getProps(id, ['text.ranges'])`.\n- **Superscript and subscript are `scriptStyle: 'Superscript' | 'Subscript'` on a range** — ®, ™, m², 1st, footnote marks, H₂O, a price's cents. Never fake one with a smaller `size` range plus a shift, or with a second block: those drift on every reflow and read as a typo. Tune the look per block with `text: { superscriptFontScale, superscriptVerticalShift }` (and the `subscript…` pair), fractions of the font size.\n- **Baseline shift is the optical nudge, not a superscript.** `baselineShift` on a range (`ranges: [{ from, to, baselineShift: '4px' }]`, design units or a length, + up) moves glyphs off the baseline at their own size, without changing the line height; `text: { baselineShift }` moves the whole text. Use it where the glyph is already the right size but sits wrong: a ® or ™ the font draws at cap height that should hang a little higher or lower, a fraction the font has no glyph for (3/16: a smaller `size` on both numbers, the numerator raised), a bullet, arrow or dingbat centred on the x-height, a currency sign aligned to the numerals. Keep it small — a few percent of the font size. A mark that should also be smaller is a `scriptStyle`, not a size and a shift; fractions are the one place both go on a range. It survives reflow and re-styling like any range.\n- **Splitting a headline into blocks to colour one word is the anti-pattern.** Nothing binds the pieces: the gap between them is hand-set, so it re-breaks on any copy, font or locale change; the phrase stops being one string (unsearchable, and the localizer receives fragments instead of a sentence); and it ships as loose siblings that fail grouping (§6.3). The tell in the scene graph is two or more text blocks sharing a baseline and a face, differing only in colour or weight. **The one exception is keyed text:** a `text.string` key whose string differs from the static one draws in the first run's style, so the accent's range does not render; there the accent is a separate text block, and the pieces share one group.\n- **All-caps is `text: { case: 'Uppercase' }`, not capitals typed into the string.** The property re-cases at render time, so the string stays real words — translatable, searchable, and correct in scripts that have no case at all (where typed capitals are simply wrong and unrecoverable). Applies to whole blocks and ranges alike; tracking still follows §6.1.6.\n- **Restraint.** One accent per headline, drawn from the single accent colour (§6.2) — a second colour inside a line reads as a mistake, not emphasis. Don't stack emphasis (bold **and** colour **and** underline on the same span). Never fake a weight or an italic with a range when the family has the real cut (§6.1.6).\n- **Underline is not general emphasis** — reserve it for links and annotations, and keep `skipInk` on so descenders stay legible; prefer weight or colour for emphasis in display type. (Skip-ink only _shows_ at a small `underlineOffset`: push the rule far enough below the baseline and it clears the descenders anyway, so the setting is neither visible nor verifiable in the render. Judge it at the default offset.) Strikethrough is for superseded content (an old price), not decoration.\n- **Ranges do not survive a raw string write.** Any raw write to `text/text` — including the same-string reshape a font/size/line-height change requires — wipes every range. `setProps` handles this for you: a string-only write captures and replays existing ranges, and font/size/line-height writes reshape with the ranges preserved. A write that mixes `string` with new styling resets ranges — pass the `ranges` you want kept in the same call. `getTextColors(id)[0]` is run 0 only; re-applying it whole-block is itself the flattening bug. Offsets are indices into the string, so they replay verbatim after a **resize** but never after a **translation** (see the `localize` skill).\n- **Replay every run, not just the emphasised ones.** The wipe collapses the whole string to **run 0's** formatting, not to a neutral base. If run 0 was a bold lead-in, replaying only the accent span leaves the rest of the paragraph bold — and the spot-check that would catch it is the one nobody runs, because reading the _accent_ range back shows exactly what was asked for; it is the **unemphasised** text that changed. Either replay all captured runs, or reset the base style across `0..length` before re-applying the emphasis.\n- **Pass:** every inline emphasis is a range on a single text block — verified in the block tree, not the render (keyed `text.string` excepted: its accent may be a separate block in one group with the rest); no sibling text blocks that differ only in colour/weight on a shared baseline; all-caps carried as `text.case` rather than typed capitals; at most one accent per headline, using the design's single accent colour; no faux weight/italic; underline reserved for links/annotations; and any variant (resized, re-branded, localized) still carries its ranges.\n\n#### 6.1.10 Print-specific rules\n\n- Work in **points/picas** and set text to a **baseline grid** so leading stays consistent across columns and pages.\n- Honor the print minimum sizes (§6.1.2); target **≥300dpi**; **embed or outline** all fonts; keep text out of bleed and inside the safe margin (**~8%**, ties to Composition/Axis 5).\n- **Pass:** baseline-grid aligned; fonts embedded/outlined; sizes ≥ print minimums; text inside the safe area, clear of bleed.\n\n#### 6.1.11 Typography pass checklist\n\nExpands **Axis 3 (Typography) — must score ≥ 8.** Each line is a yes/no the judge skill runs against the rendered output, **except the lines marked _scene graph_ — those are read from the block tree, because the defect they catch is invisible in a render.** Any \"no\" on an applicable line drops Axis 3 below 8.\n\n**Both media**\n\n- [ ] ≤3 font families (`edit` warns), ≤4 weights, pairing by contrast/superfamily (§6.1.1)\n- [ ] Every family has a defined fallback / is embedded-outlined (§6.1.1)\n- [ ] All sizes come from one modular scale; bands ≥1 step apart (§6.1.2)\n- [ ] Line-height set explicitly on every text block, incl. single-line & all-caps labels (§6.1.3)\n- [ ] Headline leading tighter than body; leading uniform across same-band text (§6.1.3)\n- [ ] All-caps titles set by cap-height — line-height tightened, no descender-void between lines (§6.1.3, §6.1.6)\n- [ ] Localized / non-Latin text: leading bands + per-language conventions pass the `localize` skill's family files & checklist (§6.1.3 pointer, §6.6)\n- [ ] Body measure 45–75 chars (40–50 multi-column) (§6.1.4)\n- [ ] Body not centered/justified without cause; rag soft, no ladders (§6.1.5)\n- [ ] Every text block has explicit alignment + grows from the intended edge on a length change (localization-safe), not incidental centering (§6.1.5)\n- [ ] Multi-line list items hang (wrap aligns to text, not the marker); marker/gap/indent uniform (§6.1.8)\n- [ ] _(scene graph)_ Every list is the native list feature on ONE block, one paragraph per item — no typed \"• \", no lone marker blocks, no block-per-item (§6.1.8)\n- [ ] _(scene graph)_ Multi-paragraph copy is one block with `text/paragraphSpacing` — not blank lines, not stacked blocks (§6.1.8)\n- [ ] _(scene graph)_ Inline emphasis is a style range on one block — no sibling blocks differing only in colour/weight on a shared baseline, unless one of the pieces has `text.string` keys and the pieces share one group (§6.1.9)\n- [ ] _(scene graph)_ All-caps carried as `text.case`, not capitals typed into the string (§6.1.9, §6.1.6)\n- [ ] ≤1 accent per headline, from the single accent colour; no stacked emphasis; underline only for links/annotations (§6.1.9)\n- [ ] Body untracked; all-caps loosened to default (+10%; web ≥0.12em, band +5–25%) and short; no faux bold/italic (§6.1.6)\n- [ ] Smart punctuation and no double spaces (`edit` warns); non-breaking spaces where needed (§6.1.7)\n- [ ] No widows (`edit` warns) or orphans; zero tofu; no clipped ascenders/descenders (§6.1.7)\n\n**Web**\n\n- [ ] Body ≥16px, caption ≥12px, never <11px (§6.1.2)\n- [ ] Body line-height 1.4–1.6; WCAG body ≥1.5, paragraph spacing ≥2× size (§6.1.3)\n- [ ] All-caps display line-height 0.9–1.0 (tighter than mixed-case display) (§6.1.3)\n\n**Print**\n\n- [ ] Body 9–12pt, caption ≥7pt, never <5pt (§6.1.2)\n- [ ] Body leading 1.2–1.45; headlines 1.0–1.2; all-caps titles 0.9–1.0 (§6.1.3)\n- [ ] Baseline-grid aligned; fonts embedded/outlined; ≥300dpi; text inside ~8% safe margin (§6.1.10)\n\n### 6.2 Color\n\nExpands **Axis 4 — Color** (palette respected, exactly one consistent accent, strong contrast everywhere, esp. text on photos/dark backgrounds).\n\n#### Color hierarchy (text on dark backgrounds)\n\n| Role | RGB |\n| --------------------------- | ------------------ |\n| Primary text (headline) | (1.0, 1.0, 1.0) |\n| Accent text (subtitle) | brand color |\n| Secondary text (tagline) | (0.75, 0.75, 0.80) |\n| Tertiary text (description) | (0.5, 0.5, 0.55) |\n\n**Pass:** ≤ 3 colors + neutrals; exactly one consistent accent; all text meets a contrast ratio of at least **4.5:1** on its actual background (fill, photo, or field — not the page).\n\n### 6.3 Hierarchy\n\nExpands **Axis 2 — Hierarchy**: one element dominates, the reading order is unambiguous, and the eye lands where it should first.\n\n- **One primary element.** Exactly one thing is the hero — the largest, heaviest, highest-contrast element on the page. Everything else is visibly subordinate. Two elements competing at the same visual weight is the most common hierarchy failure: neither wins and the eye stalls.\n- **Rank with the hierarchy chain — `size > weight > color > spacing > position`.** Establish rank primarily by **size**, then **weight**, then **color/contrast**, then the **space around** an element, and only last by position. Don't lean on position alone — a block isn't dominant just because it sits at the top; size/weight/contrast must carry it.\n- **Reading order is deliberate.** The scale steps map to the intended path: hero → supporting → detail. A reader should never hunt for where to start or what comes next. Keep the levels few — ≈3 (primary / secondary / tertiary); more than ~4 competing sizes reads as noise.\n- **Group related, separate unrelated (proximity).** Tight spacing binds a set (eyebrow + headline, label + value); wider spacing sets groups apart (§6.4's ladder). Proximity — not boxes or rules — is the first grouping tool.\n- **Colour serves rank, not decoration.** The single accent (§6.2) marks the one thing it should pull the eye to; spending it on secondary elements flattens the hierarchy.\n- **Express the structure as a block hierarchy.** Proximity is the visual grouping tool; the **block tree** is its structural counterpart. Every logical cluster (eyebrow + headline; label + value; a detail cell; a CTA bar and its text) must be an actual **group block**, and clusters that nest must nest as **groups-of-groups** — no orphan block that belongs to a cluster left as a loose sibling. A page built as one flat list of ungrouped blocks has no expressed hierarchy even when it looks ranked. (Mechanics: `{{skill:api#recipes.md}}`, \"Group blocks\".)\n- **Pass:** exactly one dominant element; no two elements competing at the same level; reading order unambiguous (hero → supporting → detail); rank carried by size/weight/colour/spacing, not position alone; ≈3 (≤4) distinct levels; related items grouped tighter than unrelated ones; the accent reinforces the primary; **and the reading structure is expressed as grouped block clusters, nested where they nest — a flat page of ungrouped siblings fails.**\n\n### 6.4 Composition & grid\n\nExpands **Axis 5 — Composition**: proper margins, a shared grid, a consistent spacing scale, balanced whitespace, and nothing off-canvas or overlapping. Composition is **relative to the canvas** — every number below scales with the page, so it holds across formats.\n\n- **One margin line / shared grid.** Left-aligned elements share one X; centered elements are **mathematically centered** (`pageX + (pageW − blockW)/2`); right-aligned share one right edge. Pick an alignment per element and hold it — a block that's \"almost\" on the margin reads as a mistake.\n- **Page margins = 8–12% of the _shortest_ page dimension.** Key the outer margin to the shortest side so it stays proportional on any aspect (≈86–130px on a 1080-wide canvas). Content lives inside this frame; nothing crosses it except a deliberate full-bleed background.\n- **One spacing scale.** Base unit ≈0.5–1% of page height; use multiples — 1× / 2× / 3× / 4× / 6× — never arbitrary gaps. More space above a heading than below it; tighter within a group than between groups. The spacing ladder (proportion of page height):\n\n | Relationship | Spacing |\n | --------------------------- | ------- |\n | Accent / decoration → title | 0.5–1× |\n | Title → subtitle | 1–2× |\n | Subtitle → body | 2–3× |\n | Between body paragraphs | 1.5–2× |\n | Between content groups | 4–6× |\n\n- **Content inside a container is spaced relative to the _container_, not the page.** The margins and ladder above are **page**-relative; a card, panel, circle, or badge sitting on the page is a **sub-canvas** with its own inner frame. Give every container an **inner padding keyed to its _own_ shortest dimension** (≈6–10% of the container's short side — a chart inside a 400px card is inset from the card's edge, not the page's), and apply the spacing ladder **relative to the container** a group lives in. Nested content spaced by page-relative numbers, or by eye, crowds the container edge (\"text/chart doesn't respect the card's padding,\" \"elements too close to the edges\"). Content must never touch a container's inner edge.\n- **A logo is shown whole, at its own aspect, in the variant that reads on its background.** An image fill defaults to `Cover`, which fills the frame and crops what does not fit: right for a photo, wrong for a mark. Give a logo (and any mark, icon or wordmark image) a frame at its own aspect, from the `width` and `height` its asset carries, or `contentFill: { mode: 'Contain' }`. Scale it uniformly; never stretch, crop or redraw it. When the brand has light and dark versions, pick the one that contrasts with the field behind it (the light one on a dark or brand-colour field). If it has only one and that one does not read, change the field behind the logo, not the logo.\n- **Lock up a mark and its wordmark as one unit.** A logo mark + wordmark, an avatar + name, an icon + label is a **lockup**: fixed relative spacing and alignment between the two, grouped, positioned as a unit. Its internal gap is set by the pair (roughly the wordmark's cap-height), not the page ladder — too tight reads as collision (\"logo text too close to the mark,\" \"name crossing the avatar\"), too loose as two unrelated elements.\n- **Balanced whitespace — no lopsided dead void.** Whitespace is intentional and distributed; the content should occupy or balance the whole canvas. A large empty band on one side — a top-clustered layout that letterboxes the bottom of a tall canvas — fails composition even when every element is individually fine. Balance the content group within the frame; don't top-anchor and leave a void.\n- **Nothing off-canvas or overlapping.** Every element sits fully within the page (bar intentional edge-bleed decoration); no unintended overlap, no clipping at the edges.\n- **Background back-most.** The full-bleed background / photo is the first child (behind everything); structural rules, then accents, then text paint on top — build back-to-front.\n- **Pass:** margins 8–12% of the shortest dimension; every element on the shared grid / one alignment; one consistent spacing scale following the ladder; **content inside every container inset by the container's own inner padding (never touching its edge), ladder applied container-relative; mark+wordmark / avatar+name lockups grouped at a fixed intra-pair gap**; whitespace balanced with no lopsided dead void; nothing off-canvas, clipped, or overlapping; background back-most.\n\n#### Background\n\n<!-- requires:asset_add -->\n- Card / poster with theme → use a generated or imported background image; place back-most via `await engine.design.create(…, { parent: page, index: 0 })` (`{{skill:api#recipes.md}}`, \"Z-order\"). If text contrast suffers, add a semi-transparent overlay.\n<!-- /requires:asset_add -->\n<!-- unless:asset_add -->\n<!-- requires:asset_generate -->\n- Card / poster with theme → use a generated background image or one the design already has; place back-most via `await engine.design.create(…, { parent: page, index: 0 })` (`{{skill:api#recipes.md}}`, \"Z-order\"). If text contrast suffers, add a semi-transparent overlay.\n<!-- /requires:asset_generate -->\n<!-- unless:asset_generate -->\n- Card / poster with theme → use a background image the design or the brief supplies, else a themed colour field or gradient; place back-most via `await engine.design.create(…, { parent: page, index: 0 })` (`{{skill:api#recipes.md}}`, \"Z-order\"). If text contrast suffers, add a semi-transparent overlay.\n<!-- /unless:asset_generate -->\n<!-- /unless:asset_add -->\n- Card without theme → solid color or subtle gradient.\n- Document / form / data → solid color or white.\n\n#### Decorative elements\n\n- Low opacity (15 – 30 %) for background decoration.\n- Echo the existing color system — never introduce new colors for decoration alone.\n- Less is more — one accent bar > three.\n- **Place decoration with an internal geometric relationship parametrically, not by transcribed coordinates.** A ring of stars around a circle, evenly-stepped dashes, dots on an arc, elements mirrored about an axis — anything whose _parts relate to each other_ — is generated from the relationship (`cx + r·cos θ`, a fixed angular/linear step, a reflection), **not** placed as N loose blocks at hand-computed x/y. Absolute-coordinate decoration is what \"drifts\": any re-composition, re-snap, or localization has to reproduce N independent numbers and gets some wrong, so the _relationship_ visibly breaks (stars land in a straight line instead of on the arc; dashes space unevenly). Build the relationship once; then a resize scales `r` and a localization leaves it untouched. Group the generated set so it moves and mirrors as a unit (§6.3, §6.6).\n\n### 6.5 Craft & finish\n\nExpands **Axis 6 — Craft** (no overflow/overlap/blank text, legible chart labels with correct proportions, intentional crops, clean decorative elements). Most of this axis is still to be written on the §6.1 pattern; the written topics are accent components (§6.5.1) and curved type (§6.5.4).\n\n**Two of this section's rules are construction rules, and construction is invisible in a PNG.** A rect-behind-text chip and a native text background render pixel-identically; so do one curved text block and a row of hand-rotated letters. Both are therefore verified by **reading the scene graph**, exactly as grouping is (§6.3) — see the instrumented checks in the `judge` skill. A render-only pass will score them 10 while they are wrong.\n\n#### 6.5.1 Accent components — pills, badges, buttons, tags\n\nA **chip** — a pill/eyebrow, badge, tag, or button — is a short label sitting on its own filled, rounded field. How it's _built_ is a craft concern: a well-made chip binds the field to the label so they never drift.\n\n- **Build it as a text block with a native text background — not a rectangle behind floating text** — rationale: a separate backing shape forces you to hand-measure the label width and re-center it inside the box, and the two fall out of sync on any copy/font/localization change (label creeps off-center, box mis-fits, re-fit math must be redone per variant). Binding the field to the text keeps them locked and reflows correctly when the label changes. _(CoDesign: `setProps(text, { backgroundColor: { enabled: true, color, paddingLeft, paddingRight, paddingTop, paddingBottom, cornerRadius } })` on the text block itself.)_ A separate container block is legitimate **only** for a chip carrying **non-text** content — an icon + text, an image, multiple elements.\n- **Radius matches the chip's intent** — key the corner radius to the field's padded height `h`: **pill / capsule = `h/2`** (true stadium ends — eyebrows, status, filter chips); **badge / tag / button (soft rectangle) = ~0.1–0.25×h** (≈6–12px on a standard control); **`0` = a square tag**. Pick capsule _or_ clearly-soft-rect — never an ambiguous near-capsule that reads as a mistake.\n- **Padding — horizontal roomier than vertical, symmetric per axis** — left = right, top = bottom (unless deliberately asymmetric); horizontal padding **~1.5–2.5× the vertical**; against the label size, horizontal **~0.8–1.5× the font size**, vertical **~0.4–0.7×**. The label must never touch the field edge. Compensate trailing **letter-spacing** on all-caps labels (§6.1.6) — tracking adds space after the last glyph, so trim right padding a hair to keep the label optically centered.\n- **The label is still a label** — it obeys the type rules like any other text: all-caps tracking (§6.1.6), explicit line-height (§6.1.3), and the type-scale minimums (§6.1.2) — a chip never licenses sub-minimum text. Keep it **short (≤3 words)**; a chip is not a text container.\n- **Align by the field edge, not the text.** A chip aligns to the margin line, the grid, and to neighbouring elements (a headline edge, another chip) by its **background field's outer edge** — the padded box — never by its glyph run. The two differ by the padding, so aligning on the text leaves the visible chip off the line by exactly that padding. **The padding expands the field outward from the text frame**, and `engine.design.measure(id)` reports the **unpadded** extent (measured: 17px frame inside a 35px padded field) — so landing a chip's field edge on the margin means positioning the frame at `margin + paddingLeft`, and a true capsule is `cornerRadius: 'pill'`, not `frameHeight / 2`. **Measure the field's real edge** — the outer edge of the padded box (the glyph extent ± its padding), not the label's glyph run alone; and beware that engine glyph metrics can misreport (especially for RTL/Arabic), silently drifting the chip off-margin.\n- **RTL** — the whole chip mirrors to the opposite margin (§6.6), its field edge on that margin.\n- **Color & contrast** — the field uses the design's single accent or a neutral, **never a new color** (§6.2); check the label's contrast **on the fill**, not against the page (§6.2).\n- **Consistency across the design** — all chips share one system: one radius family (all capsules _or_ all the same soft-rect radius — don't mix), one padding scale, one label treatment. One-off chip geometry reads as a defect.\n- **Pass:** every text-only chip is a text block with a native text background (no separate backing rectangle); radius matches intent (pill = h/2; tag/button ~0.1–0.25×h, no ambiguous near-capsule); padding symmetric per axis, horizontal ~1.5–2.5× vertical, label clear of the field edge with trailing tracking compensated; label follows §6.1.2/§6.1.3/§6.1.6 and stays ≤3 words; the chip is aligned to the margin line / grid / neighbouring elements by its **background field edge** (not its text), measured from the field's real rendered edge, and mirrored to the opposite margin in RTL; single-accent (or neutral) fill with the label contrast-checked on the fill; all chips in the design share one radius/padding/label system.\n\n#### 6.5.2 Craft pass checklist\n\nExpands **Axis 6 (Craft) — must score ≥ 8.** Each line is a yes/no the judge skill runs against the rendered output, **except the two lines marked _scene graph_ — those are read from the block tree, because the defect they catch is invisible in a render.** Any \"no\" on an applicable line drops Axis 6 below 8. _(Craft is otherwise still being written; this checklist currently covers §6.5.1 — accent components, §6.5.3 — text fitted to a container, and §6.5.4 — curved type. Construction is medium-agnostic, so there is no Web/Print split.)_\n\n**Both media**\n\n- [ ] _(scene graph)_ Text-only chips (pills/badges/buttons/tags) built as a text block with a native text background — no separate rectangle behind floating text (§6.5.1)\n- [ ] _(scene graph)_ Curved/circular type is ONE text block on a path — not a run of per-letter text blocks rotated into an arc (§6.5.4)\n- [ ] Radius matches intent: pill/capsule = half the padded height; tag/button = small fixed radius (~0.1–0.25×h); no ambiguous near-capsule (§6.5.1)\n- [ ] Padding symmetric per axis, horizontal ~1.5–2.5× vertical, label never touching the field edge; trailing all-caps tracking compensated (§6.5.1, §6.1.6)\n- [ ] Chip label follows label typography — all-caps tracking (§6.1.6), explicit line-height (§6.1.3), ≥ type-scale minimum (§6.1.2) — and stays ≤3 words (§6.5.1)\n- [ ] Chip aligned to margin / grid / neighbouring elements by its background **field edge**, not its text — measured from the field's real rendered edge (§6.5.1, §6.4); whole chip mirrored to the opposite margin in RTL (§6.5.1, §6.6)\n- [ ] Single-accent (or neutral) fill, no new color; label contrast checked on the fill, not the page (§6.5.1, §6.2)\n- [ ] All chips in the design share one radius family, one padding scale, one label treatment (§6.5.1)\n- [ ] Text inside a shape/container fitted within its band to sit fully inside the padded box — no overshoot, no edge-crowding (§6.5.3)\n- [ ] Short labels/numbers in a badge/circle/pill optically centered by cap height, not the frame (§6.5.3)\n- [ ] Image/photo crops: full coverage (no gap in the frame), uniform scale (no stretch), subject inside the window (§6.5.3, resize crop invariants)\n\n#### 6.5.3 Text fitted to a shape or container\n\nA text block and the shape it visually sits in (a circle, pill, card, panel, badge) are two independent blocks with independent sizes. Nothing binds them unless you bind them — so a size picked by eye, or a copy/locale change, breaks the relationship: the type overshoots the circle, or crowds the frame edge.\n\n- **Fit the type to the container — don't set it by eye.** Shrink the block within its **type-scale band** until its **measured** frame fits inside the container's inner box (§6.4 inner padding), with the minimum inset clear on every side. In CoDesign this is a measure-and-shrink loop (`engine.design.measure(id)` vs the container's padded box, step the font size down; or auto/fit-to-frame sizing where available) — the same shape as `localize`'s overflow guard, generalized to any text-in-container. Never let the glyph run cross the container edge; a pricing number must sit **fully inside** its circle.\n- **Center optically, not geometrically — by cap height, not the em box.** Centering a text block by its **frame** centers the em box, which includes ascender headroom and descender depth the glyphs don't use. For a short all-caps or numeric label — exactly what goes in a badge or circle — the inked area then sits **above** the true center and reads as \"hanging low.\" Center by the **cap-height band**: offset the block down by roughly half the (ascender-gap − descender) so the ink, not the box, is centered (derive the offset from `design.font({ uri }).metrics`; §6.1.6 sets all-caps optically for the same reason). Check the render — optical centering is judged by the visible gap above vs below the glyphs.\n- **Pass:** text inside a shape/container is fitted within its band to sit fully inside the container's padded box (no overshoot, no edge-crowding); short labels/numbers in a badge/circle/pill are **optically** centered by cap height (inked area centered, not the frame), verified in the render.\n\n#### 6.5.4 Curved type — text on a path\n\nCircular or arced type — \"EST. 2026\" around a seal, a badge arc, a ribbon, a rosette, type following a curve — is a **native text feature**, not a layout to assemble by hand. Like §6.5.1, this is a construction rule: the two builds can look nearly identical in a render and are told apart by reading the block tree.\n\n- **One text block on a path — never one block per letter.** Set the baseline on the text block itself and let the engine lay the glyphs along it. Hand-placing a text block per character and rotating each into an arc is the anti-pattern: there is no real baseline, so letter spacing is uneven and optically wrong at the arc's ends; the \"text\" is no longer text (uneditable, unsearchable, untranslatable); it re-breaks completely on any copy, font, or locale change; and it ships as N loose blocks that also fail hierarchy's grouping rule (§6.3). _(CoDesign/CE.SDK: `setProps(id, { text: { path, pathOffset, pathFlipped } })` — `pathOffset` for the start position along the curve, `pathFlipped` for the underside; `path: null` clears it.)_\n- **Single contour (one `M`), and the recipe is `text.path` in the `api` skill** — measure the flat glyph-run width with Auto modes before computing `pathOffset`.\n\n### 6.6 Localization & RTL\n\nExpands the localization axis. The base typographic couplings live above: font coverage and no-tofu (§6.1.7), mirrored alignment (§6.1.5), and the content-area line-height conversion (§6.1.3). Everything language-specific — per-script leading bands and diacritic rules (the `localize` skill's `reference/` family files: `latin-expansion.md`, `arabic.md`, `cjk.md`, `vietnamese.md`, `cyrillic.md`), the snap-to-reference workflow, per-language conventions, RTL mirroring, and non-Latin font loading — lives in the `localize` skill.\n\n- **RTL mirroring is selective and operates on groups — keep a do-not-mirror inventory.** Mirroring flips the **reading order** and directional decoration; it is **not** a blanket flip of every block. **Never mirror:** icons, logos, brand/glyph marks, numerals and number strings, charts, photographs, and any pictogram whose handedness carries meaning. **Mirror on the group, not its parts:** a composed icon, a lockup, or a badge moves as one unit — flip the group's position and leave its internal layout intact (or exempt it). Loose sibling parts flipped per-block disassemble the mark (the \"mail icon broke on RTL,\" \"elements moved right / off-center in frames\" defect). Content inside a frame is re-anchored with its frame, never flipped independently. Full inventory + mechanics: `{{skill:localize#reference/arabic.md}}`.\n\n### 6.7 Font pairing by context\n\nSet fonts by family (`text.font: { family, weight }`); the lookup, brand fonts and font files are `{{skill:api#recipes.md}}`, \"Fonts\".\n\n| Context | Style | Pairing |\n| ------------------- | ----------------------------- | ---------------------------------------------- |\n| Wedding invitation | Elegant serif + script accent | Playfair Display + Great Vibes + Source Sans 3 |\n| Restaurant menu | Serif heading + sans body | Cormorant Garamond + Inter |\n| Tech / startup | Clean modern sans | Inter (single family, weight variation) |\n| News / editorial | Traditional, authoritative | EB Garamond + Source Sans 3 |\n| Luxury brand | High-contrast serif | Cormorant Garamond + Montserrat |\n| Children's brand | Rounded, playful | Caveat + Open Sans |\n| E-commerce | Readable, trustworthy | Montserrat + Open Sans |\n| Portfolio / agency | Bold, creative | Playfair Display + Inter |\n| Academic / research | Classic, formal | EB Garamond + Source Sans 3 |\n\n<!-- requires:ly.img.gfonts -->\nEvery family above resolves via the `ly.img.gfonts` lookup. For contexts not listed: apply the contrast principle (serif heading + sans body, or a single family with weight variation). Never use more than 3 families.\n<!-- /requires:ly.img.gfonts -->\n<!-- unless:ly.img.gfonts -->\nThe families above are Google Fonts — use one only if a declared font source carries it, else the closest family that is available. For contexts not listed: apply the contrast principle (serif heading + sans body, or a single family with weight variation). Never use more than 3 families.\n<!-- /unless:ly.img.gfonts -->\n",
|
|
41
41
|
"docs/launch-video/SKILL.md": "---\nname: launch-video\ndescription: >-\n Use when turning a project — a repo, an app, a product, a website — into a short launch or\n promo video (15–25 s, mp4): \"make a launch video\", \"brag about this\", \"make a promo for what we\n built\", \"turn this into a video\". Reads the project itself for the story, then builds, animates,\n scores and exports the video with CoDesign.\nrequires: video, export, asset_add\n---\n\n# launch-video\n\nTurn the project in front of you into a 15–25 second launch video: find the story in the project,\nstoryboard it on a beat grid, score it, build it as one animated CoDesign page cut to the music,\nverify it frame by frame, and export an `mp4` plus a poster and share copy.\n\nBuilds on, without restating: the design loop, the video recipe\n(`{{skill:api#video.md}}` — timing, tracks, transitions, video fills, audio), the intake\ncontract (`{{skill:create#intake.md}}`), the `brand` skill (a project's colours, fonts and logo),\nthe `formats` skill and the `judge` gate.\n<!-- requires:asset_generate -->\nGenerating music, sound and voice: the `models` skill.\n<!-- /requires:asset_generate -->\nInspired by the MIT-licensed `/brag` skill (github.com/latent-spaces/brag); this one builds on\nCoDesign instead of HTML.\n\nIf `export format=mp4` refuses because this engine cannot encode video, stop and tell the user\nthe reason it gives — do not ship stills instead.\n\n## Input\n\nThe project is the current working directory unless the user names another. Options, from flags or\nplain language:\n\n| Option | Values | Default |\n| ----------- | ----------------------------------------------------------------- | -------------------------------------- |\n| `tone` | a preset below, or freeform (\"fake Series A launch\", \"museum\") | inferred from the project |\n| `format` | `landscape` 1920×1080 · `vertical` 1080×1920 · `square` 1080×1080 | `landscape` |\n| `duration` | seconds, 15–25 | fitted to the storyboard |\n| `title` | the product name to show | from the project |\n| `music` | a path to an audio file the user owns, `generate`, or `none` | `generate` when signed in, else `none` |\n| `voiceover` | `on` / `off` | `off` |\n| `out` | output folder | `./launch-video/` |\n\n<!-- requires:asset_generate -->\n<!-- requires:login -->\nGenerating sound needs a signed-in account (`login`); without one, use the user's file or ship\nsilent — a silent video is a complete deliverable.\n<!-- /requires:login -->\n<!-- unless:login -->\nWhen generation is refused, use the user's file or ship silent — a silent video is a complete\ndeliverable.\n<!-- /unless:login -->\n<!-- /requires:asset_generate -->\n<!-- unless:asset_generate -->\nThis server cannot generate sound: `music` is the user's file or `none`. A silent video is a\ncomplete deliverable.\n<!-- /unless:asset_generate -->\nIf `out` already holds a previous run, use `out-YYYYMMDD-HHMMSS/` instead of overwriting.\n\n## 1 — Inspect the project\n\nRead the project, not a pitch about it: `README`, package or app metadata, the landing page or docs\ncopy, the changelog, and any logo, icon, screenshot or brand file in the repo. Answer, in your own\nnotes:\n\n1. What is it, in one plain sentence a stranger would repeat?\n2. Who is it for?\n3. What does it do that is surprising or specific — the one thing to lead with?\n4. Two or three highlights, each in the project's **own words** (a real feature, number or claim).\n5. What can be **shown**: real UI, output, screenshots, a logo, a key visual?\n6. Brand: colours, fonts, logo (use the `brand` skill's lookup when the repo carries a kit).\n7. Tone that fits — or the one the user asked for.\n8. The call to action: product name plus how to get it — the real install step and the URL.\n\nIf 1, 3 or 8 cannot be answered from the project, ask once, per the intake contract.\n\n## 2 — Plan the storyboard\n\nStory before motion — read `{{skill:launch-video#reference/story.md}}` first. Decide the one\nline, the viewer's problem, the structure (outcome first, before/after, story spine or hook →\nreveal → proof) and the **proof moment** — the beat where the claim becomes undeniable on screen.\n\nThen pick the tempo — 100–128 BPM suits most launches, so a beat is 0.47–0.6 s — and write\n`<out>/plan.md`: the one line, the structure, the proof moment, the BPM, then a beat table — start,\nend, what is on screen, the exact words, the motion, the transition out. Run the story checks at\nthe end of `story.md` on it; a beat that only says a claim instead of showing it is rewritten or\ncut.\n\n### Make it catchy\n\n- **Hook in the first second.** Open on full-bleed kinetic type or a smash-cut montage of results —\n never a logo on a blank screen, never a slow fade up.\n- **Cut on the grid.** Every cut lands on a beat: 0.5, 1 or 2 bars' worth, at the track's BPM.\n Shots are 0.4–2 s long; vary them — a run of short cuts, then one longer hold.\n- **One big line per beat.** No explanatory captions or HUD chrome. One line, set big — it fills\n the frame; product UI on screen is the exception, simplified so it reads at a glance.\n- **Fill the frame.** Alternate dark beats with full-bleed accent-colour beats so every cut reads.\n- **Move between beats.** A transition on every cut (`{{skill:api#video.md}}`, \"Transitions\n between clips\"), matched to the tone below; the biggest move on the musical accents.\n- **Keep the camera alive.** A slow drift on every shot — `ken_burns` or `crop_zoom` on images; a\n clip-long `zoom` in-animation (its `animation/zoom/fade` off, `Linear` easing) settles type from\n large to rest.\n- **Show, never list.** No run of slogans on colour fields: each beat shows the product doing\n something — its UI or output in action, the input visible before the result.\n\nEvery beat also stays:\n\n- **Readable.** A short label stays at least 0.8 s after it settles; a sentence ~0.3 s per word.\n Keep the pace in motion and cuts, never in flashing text.\n- **Specific.** It must be about this project; \"streamline your workflow\" and other generic SaaS\n lines are banned — use the project's own copy.\n- **Funny only if the project is.** Humour comes from the project, not from trying.\n\nEnd on the call to action and hold it: the product name, the real install step — for a Claude Code\nplugin that is the plugin commands, not a raw `npx` line — and the URL. For CoDesign itself:\n\n```\nclaude plugin marketplace add imgly/codesign\nclaude plugin install codesign@imgly-codesign\ncodesign.co\n```\n\nShow the user the angle and the beat table and wait for a go before building, unless they asked you\nto just make it.\n\n## 3 — Score\n\nSound comes before the build, because the cuts are timed to it. Per\n`{{skill:launch-video#reference/sound.md}}`:\n\n1. Music — generate a track at the planned BPM and length, or `asset_add` the user's file.\n2. Start the video in one `edit`: the page as step 4 describes it (size, `Video` mode, duration)\n with only the music bed on it, ending with `readBeats` at the planned BPM. Save its\n result as `<out>/build/beats.json` — the beat grid and the accents.\n3. Snap the beat table to it: every cut, transition and loop pulse on a beat time; accents get the\n big moves. Update `plan.md` with the snapped times.\n4. A short whoosh or hit per transition; a voiceover and word-timed captions only when\n `voiceover=on`.\n\n## 4 — Build\n\nOne page is the whole video — the one step 3 started with the music: size it per `format`,\nset the scene's `scene: { mode: 'Video' }`, and set the page's `playback.duration` to the storyboard total. Plan the tracks before the first build `edit`: list\nthe layers the storyboard uses (backgrounds, media, headline, subline, chip, …), bottom first, and\nwrite that track plan into `plan.md`. Each layer is ONE track that holds every beat's clip for that\nlayer, one after another; nothing but audio goes on the page directly (`{{skill:api#video.md}}`,\n\"Timeline: one track per layer\"). Tracks also make transitions possible, since only track clips take\nthem. Reuse each track across beats, and make items that enter together in one beat (a list, a row\nof chips) one group clip. Name every block by beat and layer (`b3/bg`, `b3/line`) so later edits\nfind them. When an `edit` result says the clips \"fit on M tracks\", merge them onto that many tracks\nbefore going on.\n\nAnimate entrances, exits and loops on top of the transitions. Type, options, duration, easing and\ntext writing style are all facade keys:\n\n```js\nawait engine.design.setProps(title, {\n animations: {\n in: {\n type: 'slide',\n duration: 0.6,\n easing: 'EaseOutBack',\n slide: { direction: 4.71 }\n },\n out: { type: 'fade', duration: 0.3 }\n }\n});\nawait engine.design.setProps(line, {\n animations: {\n in: { type: 'fade', writingStyle: 'Word', overlap: 0.3, duration: 0.8 }\n }\n});\n```\n\n- Types: entrances and exits `slide` `fade` `blur` `grow` `zoom` `pop` `wipe` `pan` `spin` `baseline`\n `crop_zoom`; text `typewriter_text` `block_swipe_text` `spread_text` `merge_text`; loops\n `*_loop`; images `ken_burns`. Reference: `{{skill:api#animation.md}}`.\n- Word- or letter-wise text reveals: `writingStyle` (`Line` `Word` `Character` `Block`) plus\n `overlap` (0–1) — see `{{skill:api#animation.md}}`.\n- Keep entrances 0.3–0.8 s; a beat's exit must finish before its duration ends.\n- Real visuals first: `asset_add` screenshots and the logo. Stock or generated imagery only fills\n what the project cannot show.\n- Audio: the music bed spans the page with a 1 s `fadeOut`; each sound effect is its own audio block\n at its cut (the video recipe).\n\nSave the code of every `edit` you run to `<out>/build/NN-<step>.js`, in order — with the plan and\n`beats.json`, that is what makes the video reproducible.\n\n## 5 — Verify, export, deliver\n\n- `preview` the page with `time` at the middle of every beat. Run the judge loop on those frames:\n every line readable at its hold time, nothing clipped at the canvas edge, the hierarchy clear at\n a glance. Fix in place and re-check.\n- `preview` the middle of every transition too: the still shows it as the mp4 will. One clip whole\n there means the transition is missing or off its cut — fix it before exporting.\n- `export({ format: \"mp4\", blockId: page })` → `<out>/launch.mp4`.\n- Poster: pick the strongest frame from the previews, export it as `png` → `<out>/poster.png`.\n- `export({ format: \"imgly\" })` → `<out>/design.imgly`, the editable source.\n- Write `<out>/share-copy.txt`: a one-line post, a two-sentence post, and alt text.\n- Report: the `mp4` path, its length, and one sentence per beat.\n\n## 6 — Editions\n\nThe exported design is the master. Derive every other edition from it rather than rebuilding:\nthe `resize` skill for `vertical` and `square` cuts (re-check that each beat's line still fills the\nnew frame and clears the edges), the `localize` skill for other languages (captions and the\nvoiceover re-generated in that language, the cut times kept). Export each to\n`<out>/launch-<format>-<lang>.mp4`.\n\n## Tones\n\nPresets set pacing, type personality and transitions; the user's own direction always refines them.\n\n| Tone | Energy | Motion | Transitions |\n| ----------- | ------------------------ | --------------------------------------------------------- | ---------------------------------- |\n| `default` | playful, clean, postable | `pop`, `slide`, quick cuts | `push`, `slide`, `wipe` |\n| `polished` | serious, elegant | `fade`, slow `slide`, `ken_burns`, long holds | `cross-fade`, `cross-blur` |\n| `yc-parody` | deadpan startup energy | big claims, `typewriter_text`, hard cuts | none — hard cuts |\n| `chaotic` | fast, loud, over the top | `zoom`, `spin`, `jump_loop`, short holds (still readable) | `cross-zoom`, `cross-spin`, `chop` |\n| `deadpan` | calm, dry, understated | `fade` only, centred text, silence | `fade-to-black` |\n| `cinematic` | trailer-scale drama | dark palette, `blur` in, slow `grow`, `spread_text` | `fade-to-black`, `cross-warp` |\n| `app-store` | smooth feature cards | device-frame screenshots, `slide` cards, clean sans | `stack`, `slide` |\n",
|
|
42
42
|
"docs/launch-video/reference/sound.md": "# Sound — music, beat map, effects, voice\n\nReference for the `launch-video` skill: score the video before building it, then cut to the music.\n<!-- requires:asset_generate -->\nGeneration runs through `asset_generate`; how to find a model, read its input schema and pass its\ninputs is in the `models` skill.\n<!-- /requires:asset_generate -->\n<!-- unless:asset_generate -->\nThis server cannot generate audio: score with the user's own files, or ship silent.\n<!-- /unless:asset_generate -->\nPlacing audio in the design is the video recipe (`{{skill:api#video.md}}`).\n\n## Music\n\n<!-- requires:asset_generate -->\n1. Find a music model: `asset_generate({ capability: 'text2audio', source: 'all' })`, then read the\n one you pick with `asset_generate({ model, schema: true })`. Prefer one that takes a length (an\n ElevenLabs music model takes a length and a composition plan).\n2. Ask for exactly what the edit needs — instrumental, the genre, **the BPM**, 4/4, **the length in\n seconds**, a hit on the first downbeat and a clean ending on the last one:\n\n ```js\n await asset_generate({\n model, // from the catalog\n prompt:\n 'Instrumental electronic pop, 120 BPM, 4/4, 20 seconds. Punchy drum hit on the first ' +\n 'downbeat, driving four-on-the-floor, lift at 12 s, clean button ending at 20 s.',\n params: {} // the length / composition-plan fields the schema names\n });\n ```\n\n3. A refusal such as `model_not_supported` costs nothing — take the next music model. A model that\n picks its own length is fine: the audio block's `playback.duration` cuts it to the page.\n4. `asset_add` the user's own file instead when they gave one.\n<!-- /requires:asset_generate -->\n<!-- unless:asset_generate -->\n`asset_add` the user's own track. Its tempo is what it is — the beat map below finds it.\n<!-- /unless:asset_generate -->\n\n## Beat map\n\nThe engine analyses the track itself — no program to install. Put the music on the video page as\nits own audio block first (`playback.timeOffset` where it starts), then run this as the tail of\nthat `edit`, or alone in a read-only `edit` (`render: false`), with the block id and the BPM you\nasked for. Save the returned JSON as `<out>/build/beats.json`.\n\n```js\n// beats.js — the tail of the edit that placed the music, or ONE read-only edit\nconst beats = await engine.design.readBeats(music, { bpm: 120 }); // the BPM you asked for\nreturn { type: 'text', text: JSON.stringify(beats) };\n```\n\n`beats.json` holds `bpm`, `beats` (the grid), `fit`, `accents` (the loudest hits) and `onsets`\n(every hit, `strength` 0–1) — every time in page seconds, from `start` (the block's `timeOffset`)\nfor `duration`. Checked against a click track (tempo within 1 %, beats within one 23 ms analysis\nframe) and a syncopated groove whose loud hits repeat every 1.5 beats (the beat, not the 2:3 alias).\n\n- **Pass the tempo you asked for** as `bpm`. `readBeats` settles related tempos itself — a grid at\n 2/3 or 3/4 of the beat carries less of the attack and loses — and uses `bpm` only to choose\n between halving and doubling, which fit equally well. `bpm` may still differ from the request by a\n few tenths — that is the track's real tempo; use it.\n- **Check `fit`**: `meanErrMs` is how far the hits on the grid sit from it, `onGrid` of `onsets` how\n many sit on it — a click keeps them all, a busy track with off-beat hits about a third. Above\n ~25 ms the lock is loose: listen before cutting to it. `bpm: null` means no rhythm was found (an\n ambient pad): cut on your own grid at the requested BPM.\n- **Snap every planned time to the grid**: each cut, each transition's start, each loop pulse moves\n to the nearest `beats` entry. A bar is four beats — cut on bars for the long holds, on single\n beats for the fast runs.\n- **Accents get the big moves**: the smash cut, the full-bleed colour flip, the biggest transition,\n the call to action's entrance.\n- Keep the cut on the beat and the transition around it: a transition of length `d` into a cut at\n `t` overlaps the two clips from `t` to `t + d`.\n\n## Sound effects\n\nOne whoosh or hit per transition carries the cuts. Generate one or two and reuse them — a\nsound-effects model takes its description in `text` and a `duration_seconds` (0.5–1 s for a\nwhoosh). Place each as its own audio block: a whoosh starting ~0.15 s before its cut so the swell\nlands on it, a hit starting exactly on the accent. Volume 0.5–0.8 under the music.\n\n## Voiceover and captions (optional)\n\nOnly with `voiceover=on`. Write the script to the beat table's timing (~2.5 words per second), then:\n\n1. **Voice** — a text-to-speech model; the voice is an enum in its schema. Its result's `duration`\n says how long the line runs — fit the beat to it, not the other way around. Spell brand names\n the way they are spoken in the voice's text, never in the captions<!-- requires:asset_generate --> (`{{skill:models#audio.md}}`)<!-- /requires:asset_generate -->.\n2. **Word timings** — a speech-to-text model on that file stores every word with `start`/`end`\n seconds in its `transcriptUri`; read them inside `edit` with\n `engine.design.readTranscript(transcriptUri)`. Group words into caption lines of 2–4 words by those timings; each line is a text clip\n on a captions track at its first word's `start`.\n3. **Mix** — duck the music under the voice (`volume` 0.3–0.5 while it speaks).\n\n## Mix-down\n\nMusic spans the page with `fadeOut: { duration: 1 }` so the video never ends on a cut-off note;\nnothing new starts in the last second. Listen to the export, not the parts — check that every\neffect sits on its cut.\n",
|
|
43
43
|
"docs/launch-video/reference/story.md": "# Story — what makes a launch video convincing\n\nMotion makes a video catchy; the story makes it convincing. A reel of slogans on colour fields\n(\"Fast. Flexible. Powerful.\") is the most common failure: every line is a claim, nothing on screen\nproves it, and nobody is in it. Plan the story before the beats.\n\n## Rules\n\n1. **One idea, one line.** A 15–30 s video sells one promise. Write it as a line a stranger would\n repeat — the iPod was \"1,000 songs in your pocket\", not a spec list. Every beat serves it.\n2. **The viewer is the hero; the product is the guide.** Start from the viewer's problem or\n desire, not the company's pride. Brand-as-hero reads as an ad nobody asked for.\n3. **Show one continuous flow, not feature cards.** Input → key action → result, with the cause\n visible before the effect. An output that appears without its input looks faked.\n4. **Stage a proof moment.** One beat where the claim becomes undeniable on screen — Apple pulled\n the MacBook Air out of an office envelope instead of saying \"thin\". Design the whole video\n around it; it is the beat people remember.\n5. **The product is on screen.** Its real UI, output or an honest recreation of it — never a\n diagram of what it does. Abstract motion proves nothing.\n6. **Before and after.** Contrast makes value obvious at a glance: the old way (slow, painful,\n sped up) against the new one.\n7. **Compress time honestly.** Cut the waiting, keep every state change that matters.\n8. **Concrete words, no jargon.** \"AI-powered\", \"seamless\", \"next-gen\", \"layers, not pixels\" mean\n nothing until something on screen shows them. Prefer verbs the viewer does: \"change\", \"drag\",\n \"translate\".\n9. **Readable with sound off.** Every claim is also on screen as text — most social video plays\n muted.\n10. **End with a direction.** Product name, the real install step, the URL — held.\n\n## Structures that fit 15–30 s\n\n| Structure | Beats (≈ 24 s) |\n| ------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| **Outcome first** | the finished result as the hook 0–3 · reveal how it was made 3–6 · the flow, input to editable result 6–16 · it scales / changes 16–20 · line + CTA 20–24 |\n| **Before / after** | the pain, sped up 0–4 · the turn (one prompt, one key) 4–6 · the product doing it 6–16 · proof / payoff 16–20 · CTA 20–24 |\n| **Story spine** | \"Every day…\" 0–4 · \"One day…\" 4–6 · \"Because of that…\" ×2 6–18 · \"Until finally…\" + line 18–21 · CTA 21–24 |\n| **Hook → reveal → proof** | a pattern interrupt 0–2 · the product named 2–5 · 2–3 proofs, each a shown action 5–18 · punchline 18–21 · CTA 21–24 |\n\nPick one and write its name in `plan.md`.\n\n## Hooks for the first second\n\n- **The result first**, then \"how?\" — the finished thing, then rewind to its cause.\n- **The product at 0 s** — its UI mid-action, no intro.\n- **Name the pain** — \"Your launch video takes two weeks.\"\n- **A prompt being typed** — the input on screen from frame one.\n- **Something that should not be possible** — a pattern interrupt that makes the viewer ask.\n\nNever a logo on an empty screen, never a slow fade up.\n\n## Recreating product UI honestly\n\nWhen the product's UI is on screen but not captured, rebuild it as design: the real layout, real\nlabels, real colours, simplified — not an invented interface. Animate it as the real thing\nbehaves: a cursor that moves to a control before it changes, a panel that updates after the\nclick, a terminal whose prompt types before its output prints.\n\n## Check the plan before building\n\n- Can you say the video's one line in one breath?\n- Where is the proof moment, and would someone describe it to a friend?\n- Is every claim shown, or only said? Delete or replace every beat that only says.\n- Is the input visible before each output?\n- Would the video still make sense for this project only — or could any product use it?\n",
|
|
44
44
|
"docs/layerize/SKILL.md": "---\nname: layerize\ndescription: >-\n Use when rebuilding a flat raster image — an ad, banner, social post, poster or other\n creative (PNG / JPEG / WebP) — as an editable, layered CoDesign design or `.imgly` file; when\n asked to layerize, decompose, de-flatten or \"make editable\" an image; or when splitting an\n image into separate layers with live, editable text.\nrequires: asset_generate, asset_search\n---\n\n# layerize\n\nRebuild a source image as an editable CoDesign design: pixel layers from Seedream's layer decomposition, text rebuilt as real, editable text.\n\n## Inputs\n\n<!-- requires:asset_add -->\n\n- **Source image** — the file the user points at.\n- **Output path** — where the `.imgly` deliverable goes. If the user named none, use the source's path with the extension replaced by `.imgly`.\n\nKeep intermediate files (layer metadata, comparison renders, cut-outs) out of the output location.\n\n<!-- /requires:asset_add -->\n<!-- unless:asset_add -->\n\n- **Source image** — a `uri` an earlier tool result gave you (find the person's upload or library image with `asset_search`), or an `https` URL the person gave. Use it as it is: never re-encode or rebuild it.\n- **Output** — the design you build. Your edits are kept as you make them.\n<!-- /unless:asset_add -->\n\n## Stage 1 — Layers (Seedream)\n\nCall `asset_generate` — **one successful call per image**:\n\n- `model`: `bytedance/seedream-5-pro-layerize`\n<!-- requires:asset_add -->\n- `image_uris`: `[uri]` — the source image, added to the workspace with `asset_add({ source: { path } })`\n <!-- /requires:asset_add -->\n <!-- unless:asset_add -->\n- `image_uris`: `[uri]` — the source image's uri or URL, unchanged\n<!-- /unless:asset_add -->\n- An image under 512 × 512 pixels is refused: upscale it first (`{{skill:models#upscalers.md}}`), one more paid generation, and pass the upscaled result's `id`.\n- `prompt`: exactly what the `models` skill prescribes for this model. Read `{{skill:models#bytedance-seedream.md}}` before the call — it also explains the result (which asset is the background, why cut-outs come back rescaled, how bounding boxes are written).\n\n<!-- requires:asset_add -->\n\n**Never retry a call that may have generated.** If it times out, find its output with `asset_search({ sourceId: 'ly.img.workspace.images' })` (newest first): the images created together with the source's dimensions or smaller, the full-size one being the background. If it returns an error instead, check the same way first; only when none of its output is in the workspace did it not run — fix the cause the error names and call it again.\n\n<!-- /requires:asset_add -->\n<!-- unless:asset_add -->\n\n**Never retry a call that may have generated.** If it times out, look for its output with `asset_search({ mimeType: ['image/*'] })`: images created together, with the source's dimensions or smaller, the full-size one being the background. If none is there, or the result returned an error, the call did not keep anything — fix the cause the error names and call it again.\n\n<!-- /unless:asset_add -->\n<!-- requires:interactive -->\n\nAfter the third failure, stop: build nothing, report the errors with their `gw_…` request ids, and ask the user how to proceed.\n\n<!-- /requires:interactive -->\n<!-- unless:interactive -->\n\nAfter the third failure, stop: build nothing, and report the errors with their `gw_…` request ids.\n\n<!-- /unless:interactive -->\n\nSeedream is not optional: no other model and no local cut-outs replace it.\n\n<!-- requires:asset_add -->\n\nSave the returned `metadata` (layer names, z order, bounding boxes) as soon as you have it.\n\n<!-- /requires:asset_add -->\n<!-- unless:asset_add -->\n\nKeep the returned `assets` and `metadata` (layer names, z order, bounding boxes) in your notes as soon as you have them: they are the only copy.\n\n<!-- /unless:asset_add -->\n\nPlace the layers with this `edit` code first — the page at the background's size, the background, then every cut-out at its bounding box. Paste the whole `asset_generate` result as `RESULT`:\n\n```js\nconst result = RESULT;\nconst layers = result.metadata.find((m) => m.type === 'layers').data.layers;\nconst [bg, ...cutouts] = result.assets;\nconst width = Number(bg.meta.width);\nconst height = Number(bg.meta.height);\nconst [existing] = await engine.design.findByType('page');\nconst [scene] = await engine.design.findByType('scene');\nconst page =\n existing ??\n (await engine.design.create(\n { type: 'page', props: { width, height } },\n { parent: scene }\n ));\nawait engine.design.setProps(page, { width, height });\nconst image = (name, uri, [x0, y0, x1, y1]) =>\n engine.design.create(\n {\n type: 'graphic',\n name,\n props: {\n position: { x: x0, y: y0 },\n width: x1 - x0,\n height: y1 - y0,\n shape: { type: 'rect' },\n fill: { type: 'image', uri },\n contentFill: { mode: 'Contain' }\n }\n },\n { parent: page }\n );\nawait image('background', bg.id, [0, 0, width, height]);\nfor (const [i, asset] of cutouts.entries()) {\n const layer = layers[i + 1];\n const box = layer?.bounding_box?.absolute;\n if (box) await image(layer.name || `layer-${i + 1}`, asset.id, box);\n}\nreturn {\n type: 'text',\n text: JSON.stringify({ page, layers: layers.map((l) => l.name) })\n};\n```\n\nThen handle Seedream's layers as follows (its output is not trustworthy as-is):\n\n- Every layer sits at its bounding box; cut-outs come back rescaled, and `contentFill: Contain` fits each one into its box. If the bounding boxes are missing, find each layer's scale and position by matching it against the original.\n<!-- requires:asset_add -->\n- Drop Seedream's text layers; text is rebuilt in stage 2. Check that the background no longer shows the text. If it still does, inpaint it.\n <!-- /requires:asset_add -->\n <!-- unless:asset_add -->\n- Drop Seedream's text layers; text is rebuilt in stage 2. Check that the background no longer shows the text. If it still does, inpaint it: one `asset_generate` call with an image-edit model (see `{{skill:models}}`) on the background's uri, asking to remove the text and change nothing else. If that call says the uri could not be read, keep the background and say so.\n<!-- /unless:asset_add -->\n- Inventory: every visible element must be in exactly one layer.\n- Drop duplicate layers.\n<!-- requires:asset_add -->\n- Cut any element Seedream missed straight from the original (take the alpha from the difference between the original and the composite).\n <!-- /requires:asset_add -->\n <!-- unless:asset_add -->\n- Rebuild any element Seedream missed from the original: place the source image again, cropped to the element's box (`crop`), as its own layer.\n<!-- /unless:asset_add -->\n- A part that sits in front of another object (e.g. a hand holding a product) may be its own layer, grouped with the object it belongs to.\n- Background: keep the original pixels wherever no element covers them, and color-match the filled-in areas to the original.\n\n## Stage 2 — Text (you do the vision pass yourself)\n\nFor each visible text block, record:\n\n- exact string with line breaks\n- role (headline / sub / body / cta / legal / price)\n- pixel bounding box and alignment\n- cap height and line pitch in px\n- font characteristics (serif/sans/script, width, weight, italic, caps)\n- fill, stroke and shadow colors as hex\n- whether it sits on a shape\n\nRules:\n\n- Ignore text printed on products, packaging, labels, barcodes or logos.\n- Keep a visually coherent block as ONE entry: a three-line headline is one block, not three.\n- Transcribe literally; write \"unknown\" instead of guessing.\n\nSet each block as real, editable text:\n\n- closest Google Font (name a fallback too)\n- uppercase through the text case property (`text.case: 'Uppercase'`), not typed capitals\n- font size derived from the measured cap height\n- letter spacing (`text.letterSpacing`, a factor) and line height (`text.lineHeight: { visual }`) fitted to the measured line widths and line pitch\n- shadow (`dropShadow`) or stroke tuned to match the original\n- a button or chip keeps its shape as a separate layer under the text\n\n**Matching the original beats CoDesign's typography lint:** keep the original's tracking and leading even when the lint warns about them.\n\n## Build\n\n- One page at the source's pixel size.\n- Layers from back to front: background, scene groups, logo, text.\n- Give every layer a descriptive name (`background`, `left-figure`, `product-can`, `logo-…`, `headline-…`).\n- Group each scene's layers together, and group the text blocks.\n\n## Acceptance\n\nCompare against the original: place the source image once more as the top layer, at the page's size, with `blend: { mode: 'Difference' }`, and `preview` it. Where the rebuild matches, the preview is black; every bright shape is a difference — a missing or doubled element, text off its baseline, a wrong color. Then destroy that layer.\n\n<!-- requires:asset_add -->\n\nCheck with a PNG export (`export({ format: 'png' })`) compared against the original. Fix and re-export until every point holds:\n\n<!-- /requires:asset_add -->\n<!-- unless:asset_add -->\n\nFix and compare again until every point holds:\n\n<!-- /unless:asset_add -->\n\n- text baselines within ±2 px, line widths within ±2 %\n- text shadow visually matches the original\n<!-- requires:asset_add -->\n- average absolute pixel difference below 10/255\n <!-- /requires:asset_add -->\n <!-- unless:asset_add -->\n- the difference preview is near black, apart from fine edges\n<!-- /unless:asset_add -->\n- no element missing, no element appearing twice\n- named layers, grouped per scene\n\n<!-- requires:asset_add -->\n\nThen run the judge loop against the source (`{{skill:judge}}`), export with `export({ format: 'imgly', outPath: '<output path>' })`, and report:\n\n- the layer list\n- what Seedream got wrong and how it was fixed\n- where the intermediate files are\n <!-- /requires:asset_add -->\n <!-- unless:asset_add -->\n\n Then run the judge loop against the source (`{{skill:judge}}`) and report:\n\n- the layer list\n- what Seedream got wrong and how it was fixed\n<!-- /unless:asset_add -->\n",
|
|
45
|
-
"docs/localize/SKILL.md": "---\nname: localize\ndescription: >-\n Use when creating or fixing translated / localized variants of an existing CoDesign / CE.SDK\n design (e.g. de/ja/ru/ar editions); when a localized edition's text blocks or\n decorative elements have drifted, re-centered, or resized away from the source layout; when\n translated copy is tofu, overflowing, mis-tracked, or the wrong font after a language swap; or\n when loading a non-Latin script (Cyrillic / CJK / Arabic RTL / Vietnamese) font into a scene.\n Also for animated / video designs: longer holds, re-timed reveals, a new voice-over and captions\n per language.\n---\n\n# localize\n\n<!-- requires:export -->\nPoint this skill at the current design and the target locales, and it produces or repairs the localized editions. It operates on the **design in the current session**, and each locale is **exported as its own `.imgly` file**. Single home for localizing CoDesign designs: the **operational workflow**, the **font-loading mechanics**, and the **per-language quality rules**. It builds on two things it does _not_ restate: design rules §6.1 (general typographic thresholds — leading, tracking, all-caps, the content-area line-height conversion (`design.font`), smart punctuation, reshape-recolor) and design rules §6.7 (font discovery and pairing; `text.font` declarations are typed in the `api` skill). This skill is the non-Latin / localization extension of both.\n<!-- /requires:export -->\n<!-- unless:export -->\nPoint this skill at the current design and the target locales, and it produces or repairs the localized editions. It operates on the **design in the current session** — the product opens one session per locale, each holding the source, so localize the design in front of you into its one locale. Single home for localizing CoDesign designs: the **operational workflow**, the **font-loading mechanics**, and the **per-language quality rules**. It builds on two things it does _not_ restate: design rules §6.1 (general typographic thresholds — leading, tracking, all-caps, the content-area line-height conversion (`design.font`), smart punctuation, reshape-recolor) and design rules §6.7 (font discovery and pairing; `text.font` declarations are typed in the `api` skill). This skill is the non-Latin / localization extension of both.\n<!-- /unless:export -->\n\n**Scoring:** localizing is judged with the `judge` skill — every applicable axis ≥ 8, no averaging, N/A = 10. A single tofu glyph, an overflow after expansion, un-mirrored RTL, or a block that drifted off the source grid fails the edition (the `localization` axis).\n\n## Reference files (load on demand)\n\nThis `SKILL.md` holds the always-needed spine: inputs, core principle, workflow, block\nclassification, and the snap-to-reference routine. Two situational bodies of rules live beside it\nand are pulled in only when the task needs them:\n\n- **`reference/font-loading.md`** — getting a non-Latin face to render (jsDelivr\n picks, weights from a variable file, font-declaration gotchas, the silent-sans failure). Read it whenever the\n target locale needs a Cyrillic / CJK / Arabic / Vietnamese font, or copy came out tofu / wrong\n face.\n- **`reference/language-rules.md`** — the cross-language spine: preserve-vs-localize, translation\n quality, layout integrity after translation, and the localization pass checklist.\n- **`reference/<family>.md`** — per-script-family conventions, numeric leading bands, and\n quotation marks, one file per family: `latin-expansion.md` (de/fr/es…), `arabic.md`, `cjk.md`\n (ja/zh/ko), `vietnamese.md`, `cyrillic.md` (ru…). Read the file(s) for the **target locale(s)**\n you're building, e.g. `{{skill:localize#reference/arabic.md}}`.\n\nSeveral locales of one design, or re-applying a master fix to locales you already built: the\n**master → editions** workflow, `{{skill:resize#editions.md}}`.\n<!-- requires:video -->\nFor an animated or video design, read **Video and animated designs** below as well.\n<!-- /requires:video -->\n\n## Inputs — what to localize, and into what\n\n<!-- requires:interactive -->\nResolved before any work by the intake contract — derive, ask once, echo, invent nothing:\n`{{skill:create#intake.md}}`. **R** = required, no default; **A** = ask if\nunderived; **D** = defaultable.\n<!-- /requires:interactive -->\n<!-- unless:interactive -->\nResolved before any work by the intake contract — derive, decide what is missing, echo, invent\nnothing: `{{skill:create#intake.md}}`. **R** = required, no default; **A** = has a default, resolved by the intake when underived; **D** = defaultable.\n<!-- /unless:interactive -->\n\n| Parameter | Kind | Chips / values | Default |\n| -------------- | ------- | --------------------------------------------------------------------------- | --------------------------------- |\n| target locales | **R** | `German` · `French` · `Spanish` · `Japanese` · `Chinese` · `Arabic` · Other | none |\n| source locale | A | detected from the design's copy · Other | detected, stated in the echo |\n| source design | derived | — | the design in the current session |\n\n<!-- requires:export -->\n**1. The source (reference)** — the design in the current session, in its source language (usually `en`). **Export it as `.imgly` first** (`export({ format: 'imgly' })`) and keep its `uri`: its geometry is the grid every target locale snaps to, and every locale starts by re-importing that file. Never localize _from_ a non-reference locale.\n<!-- requires:open -->\nIf the user means a design saved earlier, its `uri` IS the reference `uri`: `open` it to `preview` and capture it, skip the first export, then `import` a copy of it per locale.\n<!-- /requires:open -->\n<!-- unless:open -->\n<!-- requires:version -->\nIf the user means a design saved earlier, its `design` IS the reference: `preview` it and capture it, skip the first export, then `import` a copy of it per locale.\n<!-- /requires:version -->\n<!-- unless:version -->\nIf the user means a design saved earlier, load it with `import({ source: { uri: '<its uri>' } })`.\n<!-- /unless:version -->\n<!-- /unless:open -->\n<!-- /requires:export -->\n<!-- unless:export -->\n**1. The source (reference)** — the design in the current session, in its source language (usually `en`), which the product opened for this one locale. Capture its geometry and `preview` it **before** you change anything: it is the grid the locale snaps to, and once you edit, the session holds nothing else to go back to. Never localize _from_ a non-reference locale.\n<!-- /unless:export -->\n\n<!-- requires:export -->\nA session holds one design, so the locales are built in sequence and the exported reference is what you return to between them:\n\n```\nexport({ format: 'imgly' }) → REFERENCE_URI (export the source FIRST)\nper locale:\n<!-- requires:open -->\n import({ source: { uri: REFERENCE_URI } }) → a copy of the reference is the session\n<!-- /requires:open -->\n<!-- unless:open -->\n<!-- requires:version -->\n import({ source: { uri: REFERENCE_URI } }) → a copy of the reference: a new design, with its own design and version\n<!-- /requires:version -->\n<!-- unless:version -->\n import({ source: { uri: REFERENCE_URI } }) → the reference replaces the session; its save is a new file\n<!-- /unless:version -->\n<!-- /unless:open -->\n edit(…) translate + swap the script font + snap to the reference geometry\n preview() → check it against the reference render\n export({ format: 'imgly' }) → that locale's own file\n```\n<!-- unless:open -->\n\n**Check each locale's returned `uri` is not `REFERENCE_URI`** (re-saving a session revises one file) — a locale that landed back on the reference overwrote the grid every other locale snaps to.\n<!-- /unless:open -->\n\n<!-- /requires:export -->\n<!-- requires:interactive -->\n**2. The locales** — the target languages, e.g. `de ja ru ar`. If omitted, **ask** —\n_**Which languages do you need?**_ — with the chips above; there is no defaulting to a language the\nuser didn't name. Then echo the resolved set (\"1 design × 3 locales, source `en` (detected)\") before\nbuilding.\n<!-- /requires:interactive -->\n<!-- unless:interactive -->\n**2. The locales** — the target languages, e.g. `de ja ru ar`. If omitted, change nothing and say\nin your reply which languages you need; there is no defaulting to a language the user didn't name.\nOtherwise echo the resolved set (\"1 design × 3 locales, source `en` (detected)\") before building.\n<!-- /unless:interactive -->\n\n<!-- requires:interactive -->\n**Never invent copy.** A translation is the user's own content: if a block's meaning is ambiguous,\nor a term is a name/product you cannot safely render in the target script, ask rather than guess —\nsee the keep-byte-identical list in `reference/language-rules.md` §1.\n<!-- /requires:interactive -->\n<!-- unless:interactive -->\n**Never invent copy.** A translation is the user's own content: if a block's meaning is ambiguous,\nor a term is a name/product you cannot safely render in the target script, keep it as written and\nname it in your reply rather than guess — see the keep-byte-identical list in\n`reference/language-rules.md` §1.\n<!-- /unless:interactive -->\n\n<!-- requires:export -->\n<!-- requires:drafts -->\n**Per locale, then:** run the Workflow below (re-import the reference, or load an existing localized file and snap it). Give each locale's `edit` a `note` naming the locale, `preview` it, and `export({ format: 'imgly' })` it — the locale's file to hand over (the copy itself is saved as you edit it). Report every locale's `uri` at the end.\n<!-- /requires:drafts -->\n<!-- unless:drafts -->\n**Per locale, then:** run the Workflow below (re-import the reference, or load an existing localized file and snap it). Give each locale's `edit` a `note` naming the locale and `preview` it. Each locale is kept as you edit it — `export({ format: 'imgly' })` returns its `uri`. Report every locale's `uri` at the end.\n<!-- /unless:drafts -->\n<!-- /requires:export -->\n<!-- unless:export -->\n**Then:** run the Workflow below. Give the locale's `edit` a `note` naming the locale, and `preview` it.\n<!-- /unless:export -->\n\n## Core principle — localize, then snap back to the reference\n\nLocalizing is **surgical**: change the words + the font the new script forces, and **nothing\nelse**. Then **snap every block back to the reference variant's geometry** so the localized\nedition is positionally identical to the source.\n\n- The **reference** is the source-locale variant (usually `en`) **of the same size**. Each size\n has its own reference grid.\n- **Never re-center or re-size a block per variant \"to fit better.\"** That independent re-fitting\n is exactly what makes a localized set drift — the eyebrow creeps up, the quote grows, the rule\n and footer slide down, and the editions stop matching. If there is room for the translated text\n at the reference position/size, keep the reference position/size.\n- Deviate from the reference **only** when the translated text genuinely overflows (expansion\n languages) — then shrink _that block's_ font within its band; do not move its neighbours.\n- **Swap the script font per block, not per scene.** Apply the new face **only to blocks whose\n copy is actually in the target script.** A block that stays in the source script — a personal\n name, brand/wordmark, `@handle`, URL, email, number, date, or product/tech name (the \"keep\n byte-identical\" list in `reference/language-rules.md` §1) — **keeps its original typeface.**\n Re-fonting it to the script face is drift even though its text was correctly preserved: a Latin\n name rendered in the Arabic/CJK serif is the classic tell. So a localized edition differs from\n its reference in **only the translated blocks' text + face**; every untranslated block is\n byte-identical (position mirrored for RTL).\n- **Bound faces and sizes: write the variable, not the block.** If the design binds `text.font`\n or `text.fontSize` to a scene variable (`getProps(id, ['bindings'])`), a direct write to that\n leaf is refused (`DESIGN.PROPERTY_BOUND`). Swap the script face for every block bound to it in\n one write — `setProps(scene, { variables: { body: { font: { family: 'Noto Sans JP' } } } })` —\n and shrink a long language's sizes through their `{ number }` variable. A block in the source\n script that shares that variable (a name, a URL) must keep its face: unbind it first\n (`bindings: { 'text.font': null }`) so the swap skips it. Building a multi-script template,\n bind each translatable block's `text.font` to one font variable per script role\n (`{{skill:templates}}`). A reopened source keeps its bindings but reads\n none of its own variable values: take them from the reply that built it, or ask, and set\n every variable it binds before you swap one.\n\n## When to use\n\n- Producing new locale editions (de/ja/ru/ar/…) of a finished design, across one or more sizes.\n- Fixing a localized set whose blocks drifted / re-centered / resized vs the source.\n- Post-translation breakage: tofu, overflow, wrong tracking, Latin-looking sans where a script\n font should be.\n- Loading a non-Latin typeface into a scene.\n\n**Not for:** the original design build (that's `create` and the design rules); pure copy edits in the\nsame language. To change\nthe **size/format** — re-compose a design for a new aspect rather than translate it — use the **resize** skill\n(localize snaps geometry; resize re-derives it).\n\n<!-- requires:import -->\n## Reuse an existing localized build vs build fresh\n\n<!-- requires:open -->\n- **A saved file for the locale already exists** (an earlier pass built it — the user has its `uri`):\n **reuse its build** — `open({ uri })` it (`import` would give you a copy); the translated copy,\n script fonts, and RTL are already solved — but still **snap it to the reference geometry**.\n Earlier builds commonly drift; reuse the assets, fix the positions. Your fix goes to that design\n itself.\n- **No existing build:** `import` a copy of the reference file and swap text + font.\n<!-- /requires:open -->\n<!-- unless:open -->\n<!-- requires:version -->\n- **A design for the locale already exists** (an earlier pass built it):\n **reuse its build** — work on it by its `design` (`import` would give you a copy); the translated\n copy, script fonts, and RTL are already solved — but still **snap it to the reference geometry**.\n Earlier builds commonly drift; reuse the assets, fix the positions. Your fix goes to that design.\n- **No existing build:** `import` a copy of the reference and swap text + font.\n<!-- /requires:version -->\n<!-- unless:version -->\n- **A saved file for the locale already exists** (an earlier pass built it — the user has its `uri`):\n **reuse its build** — `import` it; the translated copy, script fonts, and RTL are already solved —\n but still **snap it to the reference geometry**. Earlier builds commonly drift; reuse the assets,\n fix the positions. Save it when you are done: its save is a new file — report the new `uri` in\n place of the old.\n- **No existing build:** re-import the reference file and swap text + font.\n<!-- /unless:version -->\n<!-- /unless:open -->\n\nEither way the last step is the same: every block lands on the reference grid.\n\n<!-- /requires:import -->\n## Workflow\n\n1. **Capture the reference geometry.** With the source-locale design in the session, `preview` it\n (that render is your parity reference for the `judge` gate) and read, per\n block: `x, y, width, widthMode, heightMode, fontSize (Pixel), lineHeight, letterSpacing,\nalignment`, plus page `w/h`, the ghost's anchor (left / centered), and the rule position. Do this\n **once**; the captured JSON is what you carry from locale to locale.\n<!-- requires:import -->\n<!-- requires:open -->\n2. **Load the target** — `open` the existing localized file to fix, or `import` a copy of the\n reference file for a fresh build.\n<!-- /requires:open -->\n<!-- unless:open -->\n<!-- requires:version -->\n2. **Load the target** — work on the existing localized design by its `design`, or `import` a copy\n of the reference for a fresh build.\n<!-- /requires:version -->\n<!-- unless:version -->\n2. **Load the target** — `import` the existing localized file to fix, or re-import the reference\n file for a fresh build.\n<!-- /unless:version -->\n<!-- /unless:open -->\n<!-- /requires:import -->\n<!-- unless:import -->\n2. **Translate in place** — the product opened this locale's session from the reference: swap each\n block's text for the target locale's copy, and the font for one that covers the script.\n<!-- /unless:import -->\n3. **Classify blocks by role** (see below).\n4. **Apply the reference geometry** to each corresponding block; keep the localized **text** and\n the **script font** (for a non-Latin face see `reference/font-loading.md`). Set\n per-locale: `letterSpacing = 0` for CJK & Arabic; RTL ghost mirrored to the right; alignment as\n the reference (centered-symmetric stays centered — see `reference/arabic.md`).\n5. **Reconcile ghost count.** Keep the reference's number of decorative glyphs. If the localized\n scene has extra ones (e.g. an Arabic closing-quote bookend the English lacks), **destroy the\n extras**; mirror the kept one for RTL.\n6. **Overflow guard.** After setting the reference font size, measure the quote's frame height; if\n it collides with the element below, step the font size down (only that block) until it fits.\n Never move neighbours to make room.\n7. **Re-apply rich text after a TRANSLATED string lands.** Font/size/line-height changes via\n `setProps` auto-reshape with every style range preserved — no manual step. A **translated\n string** is different: the write replays ranges at their OLD offsets, which are source-string\n indices. Capture each block with `getProps(id, ['text.ranges'])` first (each range carries its\n `text` substring), re-apply semantically after. ⚠ `getTextColors(id)[0]`\n is **not** a capture — it reads the first run only, so re-applying it flattens a two-color\n headline onto one color and the accent is gone with no error. Paragraph state\n (`getProps(id, ['text.paragraphs'])` — listStyle/listLevel per paragraph) survives a same-string reshape but not\n a **re-write**, so re-apply it whenever the string itself changed. **Ranges are index-based on\n the source string** — a translated string has different offsets, so never replay `from`/`to`\n verbatim; re-locate the styled substring in the target language (§ \"Carrying rich text across\n a translation\").\n8. **`loadResources` → `preview`.** One preview per locale — tofu / RTL / overflow /\n position match are only visible in the render.\n<!-- requires:video -->\n A video design needs several per locale, at different `time`s (below).\n<!-- /requires:video -->\n\nThen apply the per-locale quality rules in `reference/language-rules.md` **and the family\nfile(s) for the target locale(s)** (`reference/latin-expansion.md`, `arabic.md`, `cjk.md`,\n`vietnamese.md`, `cyrillic.md`), and dry-run the localization pass checklist against the render\nbefore reporting done.\n\n## Block-role classification\n\nClassify by measurable properties, not hard-coded ids (ids are session-scoped). For a\nquote-card family the roles are:\n\n- **ghost** (oversized decorative quote) — largest font size **and** trimmed string length ≤ 2.\n A design may have **more than one** (opening + closing bookend); collect all.\n- **footer / handle** — text containing `@`.\n- **quote / headline** — the largest remaining text after removing ghosts + footer.\n- **eyebrow** vs **attribution** — the two small texts; eyebrow sits **above** the quote,\n attribution **below**.\n- **rule / divider** — the graphic (non-text) block.\n\nRoles are design-specific. The general rule: **map each localized block to its reference block by\n<!-- requires:import -->\nrole, or by index** (every locale is imported from the same reference file, so they keep the same\n<!-- /requires:import -->\n<!-- unless:import -->\nrole, or by index** (every locale starts from the same reference design, so they keep the same\n<!-- /unless:import -->\nchild order), then restore that reference block's geometry.\n\n## The snap-to-reference routine\n\nA single CoDesign `edit` body. Fill the `EN` reference geometry (from step 1) and the locale\nflags, then it classifies, restores geometry, reconciles ghosts, applies per-locale tracking /\nRTL mirroring, guards overflow, and re-applies colors across the reshape.\n\n⚠ This routine is a **worked example, not a template**: every number in `EN` below is from one\nexample quote-card, and the classification heuristics (`fs >= 150`, `s.includes('@')`, …) are\nthat card's — never reuse either literally. Fill `EN` only from your own reference capture (the\nread at the bottom), and rewrite the classification for the actual design's roles.\n\n```js\n// --- config: reference geometry (read from the source-locale variant of THIS size) ---\nconst PW = 1080,\n PH = 1350; // page dims\nconst EN = {\n // lh = VISUAL leading target (from the target locale's script band, NOT the reference's\n // raw engine number) — setLeading() converts it through each block's target face. For a\n // localized display headline in a diacritic language, this is where the conditional +0.2\n // lives (latin-expansion.md): bump ≤1.2 → ~1.35 only if the rendered gap needs it.\n ghost: { x: 70, y: 55, fs: 300, lh: 1 }, // Auto-sized; keep size+lh, reposition\n eyebrow: { x: 110, y: 395, w: 860, fs: 16, lh: 1, ls: 0.25 },\n quote: { x: 110, y: 529, w: 860, fs: 62, lh: 0.85 }, // ls always 0\n rule: { x: 504, y: 930, w: 72 }, // graphic\n attribution: { x: 110, y: 960, w: 860, fs: 16, lh: 1, ls: 0.25 },\n footer: { x: 110, y: 1225, w: 860, fs: 15, lh: 1, ls: 0.12 }\n};\nconst RTL = false; // true for Arabic\nconst trackOK = true; // false for CJK/Arabic → force letterSpacing 0 on eyebrow/attr/footer\nconst ghostAnchor = 'left'; // 'left' (post/square) mirrors to the right for RTL; 'center' (story) stays centered\nconst belowQuoteY = EN.rule.y; // element the quote must stay above\n\nconst [page] = await engine.design.findByType('page');\nconst blocks = [];\nconst walk = async (id) => {\n for (const c of await engine.design.getChildren(id)) {\n blocks.push(c);\n await walk(c);\n }\n};\nawait walk(page);\nconst typeOf = async (id) => (await engine.design.getProps(id, ['type'])).type;\nconst texts = [];\nlet graphic;\nfor (const id of blocks) {\n const type = await typeOf(id);\n if (type === 'text') texts.push(id);\n else if (type === 'graphic') graphic ??= id;\n}\nawait engine.design.loadResources([page]);\n\nconst meta = async (id) => {\n const p = await engine.design.getProps(id, [\n 'text.string',\n 'text.fontSize',\n 'position'\n ]);\n return {\n id,\n s: p.text.string,\n fs: parseFloat(p.text.fontSize),\n y: p.position.y\n };\n};\nconst tm = [];\nfor (const id of texts) tm.push(await meta(id));\n\n// classify\nconst ghosts = tm.filter((t) => t.fs >= 150 && t.s.trim().length <= 2);\nlet ghost =\n ghosts.find((t) => t.s.includes('“')) ||\n ghosts.slice().sort((a, b) => a.y - b.y)[0];\nfor (const g of ghosts.filter((t) => t !== ghost))\n await engine.design.destroy(g.id); // drop extra bookend glyphs\nconst footer = tm.find((t) => t.s.includes('@'));\nconst rest = tm.filter((t) => !ghosts.includes(t) && t !== footer);\nconst quote = rest.reduce((a, b) => (b.fs > a.fs ? b : a));\nconst others = rest.filter((t) => t !== quote);\nconst eyebrow = others.reduce((a, b) => (b.y < a.y ? b : a));\nconst attribution = others.find((t) => t !== eyebrow);\n\n// capture rich text — each range carries its run's `text` substring, which is\n// what semantic re-location needs (offsets are source-string indices).\nconst runsOf = async (id) => {\n try {\n return (await engine.design.getProps(id, ['text.ranges'])).text.ranges;\n } catch (e) {\n return [];\n }\n};\nconst runs = {};\nfor (const t of [ghost, eyebrow, quote, attribution, footer])\n runs[t.id] = await runsOf(t.id);\n// Re-apply captured styling as ONE ranges assignment. Run 0 is the base style\n// and covers the whole block; any further run is an accent whose SOURCE offsets\n// are meaningless once the string is translated, so it is re-located by its\n// target-language substring (SPANS below).\n// Returns false when the accent could not be placed — flag it, never silently flatten.\nconst restyle = async (id, rs, spans = []) => {\n if (!rs.length) return true;\n const s = (await engine.design.getProps(id, ['text'])).text.text;\n const ranges = [{ ...rs[0], from: 0, to: s.length }]; // base over the whole string\n let ok = true;\n rs.slice(1).forEach((r, i) => {\n const span = spans[i]; // translator-supplied target-language accent text\n const at = span ? s.indexOf(span) : -1;\n if (at < 0) {\n ok = false; // accent lost in translation — report it, don't fake it\n return;\n }\n ranges.push({ ...r, from: at, to: at + span.length });\n });\n await engine.design.setProps(id, { text: { ranges } });\n return ok;\n};\n// Accent spans IN THE TARGET LANGUAGE, one per non-base run, keyed by block.\n// Empty for single-run blocks — which is every block in this quote card.\nconst SPANS = {};\n// setProps auto-reshapes on font/size/lineHeight writes — no manual reshape.\n// ⚠ Leading is RE-DERIVED on the TARGET face — never copied raw from the reference.\n// `text/lineHeight` multiplies the font's content area (per-face, ~1.15–1.35), so the\n// same engine number renders a DIFFERENT visual gap once the script font is swapped —\n// the #1 localized-leading defect. So EN.*.lh below is a VISUAL leading target (taken\n// from the target locale's script band in the family file — latin/arabic/cjk — NOT the\n// reference's raw engine value), converted through THIS block's now-current font via\n// design.font({ uri }) → contentArea (design rules §6.1.3).\nconst setLeading = async (id, visual) =>\n // facade converts per font (metrics cached at font resolve / loadResources)\n await engine.design.setProps(id, { text: { lineHeight: { visual } } }); // auto-reshapes, ranges preserved\nconst applyText = async (t, g, ls) => {\n await engine.design.setProps(t.id, {\n widthMode: 'Absolute',\n width: g.w,\n heightMode: 'Auto',\n text: {\n fontSize: g.fs + 'px',\n letterSpacing: ls,\n horizontalAlignment: 'Center'\n }\n }); // fontSize/letterSpacing writes auto-reshape, ranges preserved\n await setLeading(t.id, g.lh); // visual target → target-face content area (§6.1.3)\n};\n\nawait engine.design.setProps(ghost.id, {\n text: { fontSize: EN.ghost.fs + 'px' }\n});\nawait setLeading(ghost.id, EN.ghost.lh);\nawait applyText(eyebrow, EN.eyebrow, trackOK ? EN.eyebrow.ls : 0);\nawait applyText(attribution, EN.attribution, trackOK ? EN.attribution.ls : 0);\nawait applyText(footer, EN.footer, trackOK ? EN.footer.ls : 0);\nawait applyText(quote, EN.quote, 0);\nawait engine.design.setProps(graphic, { width: EN.rule.w });\nfor (const t of [ghost, eyebrow, quote, attribution, footer])\n await restyle(t.id, runs[t.id], SPANS[t.id]);\nawait engine.design.loadResources([page]);\n\n// position (ghost measured for mirroring; others straight from EN)\nconst { width: gw } = await engine.design.measure(ghost.id);\nawait engine.design.setProps(ghost.id, {\n position: {\n x:\n ghostAnchor === 'center'\n ? (PW - gw) / 2\n : RTL\n ? PW - EN.ghost.x - gw\n : EN.ghost.x,\n y: EN.ghost.y\n }\n});\nfor (const [t, g] of [\n [eyebrow, EN.eyebrow],\n [quote, EN.quote],\n [attribution, EN.attribution],\n [footer, EN.footer]\n]) {\n await engine.design.setProps(t.id, { position: { x: g.x, y: g.y } });\n}\nawait engine.design.setProps(graphic, {\n position: { x: EN.rule.x, y: EN.rule.y }\n});\n\n// overflow guard — shrink ONLY the quote, never move neighbours\nawait engine.design.loadResources([page]);\nlet qfs = EN.quote.fs;\nconst avail = belowQuoteY - EN.quote.y - 16;\nwhile ((await engine.design.measure(quote.id)).height > avail && qfs > 44) {\n qfs -= 2;\n // the fontSize write auto-reshapes AND auto-preserves the style ranges.\n await engine.design.setProps(quote.id, { text: { fontSize: qfs + 'px' } });\n await engine.design.loadResources([page]);\n}\nreturn { type: 'text', text: JSON.stringify({ page, qfs }, null, 1) };\n```\n\nReference-capture read (run on the source variant to fill `EN`):\n\n```js\nconst [page] = await engine.design.findByType('page');\nconst ids = [];\nconst walk = async (id) => {\n for (const c of await engine.design.getChildren(id)) {\n ids.push(c);\n await walk(c);\n }\n};\nawait walk(page);\nconst TEXT = [\n 'text.string',\n 'text.fontSize',\n 'text.lineHeight',\n 'text.letterSpacing'\n];\nconst out = [];\nfor (const id of ids) {\n const { type } = await engine.design.getProps(id, ['type']);\n const p = await engine.design.getProps(id, [\n 'position',\n 'width',\n 'widthMode',\n ...(type === 'text' ? TEXT : [])\n ]);\n out.push({\n t: type,\n x: Math.round(p.position.x),\n y: Math.round(p.position.y),\n w: Math.round(p.width),\n wm: p.widthMode,\n ...(p.text && {\n s: p.text.string.slice(0, 14),\n fs: Math.round(parseFloat(p.text.fontSize)),\n lh: +p.text.lineHeight.toFixed(2),\n ls: +p.text.letterSpacing.toFixed(2)\n })\n });\n}\nconst { width: pw, height: ph } = await engine.design.getProps(page, [\n 'width',\n 'height'\n]);\nreturn { type: 'text', text: JSON.stringify({ pw, ph, b: out }) };\n```\n\n<!-- requires:video -->\n## Video and animated designs\n\nApplies when the page has a `playback.duration`, timed blocks, `animations`, an `audio` voice-over\nor a `captionTrack`. Geometry still snaps to the reference; the **timeline** is re-derived from the\nnew language's speech and reading time.\n\n- **Reading time sets the hold.** A line must stay on screen ≈**0.3 s per word** after its\n entrance finishes. Expansion languages (German, French, Spanish run 15–35 % longer) need longer\n holds: extend the block's `playback.duration`, shift what follows, and grow the page's\n `playback.duration` — never shorten reading time or speed up speech to fit the source length.\n- **Word-by-word reveals scale with the target.** A `typewriter_text` (or any text animation whose\n `textAnimationWritingStyle` is `Word` / `Character`) reveals per word or per character: scale its\n duration by target ÷ source word (or character) count, and check that the reveal ends with the\n 0.3 s-per-word hold still ahead of it. Patch it with the same type:\n `setProps(id, { animations: { in: { type, duration: s } } })`.\n- **Keyed text: translate the keys AND the static string.** For a block whose `text.string`\n has keys, read them after any `playback.duration` change above (it stretches them). In one\n write, map each key's `value` (keep `at` and `easing`) and set the static string to the very\n translation of the key it equals, else translate it on its own; then `restyle` (step 7). The\n key equal to the static string keeps the accent; every other key draws in the first run.\n- **Keyed text: guard every key, then fix the height.** Step 6's `measure(quote.id)` sees only\n the static string. Measure each translated key on an unkeyed copy\n (`{{skill:api#animation.md}}`, \"Keyframes\"), write each smaller font size to the copy, the\n block and, by the same ratio, an accent block, then destroy the copy and write\n `heightMode: 'Absolute'` with the tallest key's height (with `'Auto'` the first mp4 export cuts\n the added lines). An accent block beside it with `position.x` keys: give it the text's start\n and `playback.duration`, then one `position.x` key per translated `text.string` key, while that\n page's conditions hold (`{{skill:api#animation.md}}`, \"`text.string` keys draw in the text's\n first run\"). When the translation breaks them (right-to-left, not left-aligned, the accent\n leaves the line's end, a key wraps), write the static string and every key as its full\n translated line, accent word included where the language puts it, in the text's colour,\n destroy the accent block, run this guard again, and say so.\n<!-- requires:asset_generate -->\n- **Re-voice, don't re-use.** Generate the voice-over again from the translated script with a\n `text2speech` model — `asset_generate({ capability: 'text2speech' })` lists them (e.g.\n `elevenlabs/eleven-v3-tts`); keep the master's voice across locales via `params`\n (`asset_generate({ model, schema: true })` names the model's inputs). Swap the file on the\n existing audio block — `setProps(audio, { audio: { fileURI } })` — so its offset and volume stay.\n Respell names in the translated script as they are said in that language, and keep the written\n names in the captions (`{{skill:models#audio.md}}`).\n- **Captions come from the new take.** Transcribe it with a `speech2text` model\n (`elevenlabs/scribe-v2`, via `params` — check its inputs with `schema: true`); read each word's\n `start` / `end` from its `transcriptUri` with `engine.design.readTranscript` inside `edit`.\n<!-- /requires:asset_generate -->\n<!-- unless:asset_generate -->\n- **Re-voice, don't re-use.** A voice-over in the source language does not belong in the edition.\n Swap in a voice-over for the target language when the brief supplies one —\n `setProps(audio, { audio: { fileURI } })` on the existing audio block, so its offset and volume\n stay — and ask for it, or for its word timings, when it does not.\n- **Captions come from the new take**, timed by its word-level `start` / `end`.\n<!-- /unless:asset_generate -->\n Rebuild the captions from those words: a caption per phrase (break at\n sentence ends, and at commas once a phrase has two words), `timeOffset` = the audio block's\n offset + the first word's `start`, held until the next caption. Carry the master captions' frame\n and style onto **every** new caption (it is per caption, not shared) — and their typeface:\n captions have their own font (`caption/typeface`, `caption/fontFileUri`), so the script face goes\n there too, not only on text blocks.\n- **Re-snap the timeline to the new speech — one rule.** Every timed block that enters on a spoken\n cue keeps its **lead**: new `timeOffset` = master `timeOffset` − master cue time + target cue\n time. A block that ended where another began still ends there; a block that ran to the end of\n the page still does; page duration = max(master duration, voice-over offset + last word's `end` +\n the master's closing silence).\n- **RTL mirrors the motion, not only the layout.** For Arabic / Hebrew, mirror horizontal\n directions: `slide` / `pan` `direction` θ → `π − θ` (`0` ↔ `π`; it is the direction of travel),\n `wipe` `Left` ↔ `Right`, `caption/horizontalAlignment` `Left` ↔ `Right`. The do-not-mirror\n inventory (icons, logos, numerals, photos) holds for motion too.\n- **Preview at several `time`s, per locale.** Mid-reveal of each word-by-word line, the end of each\n hold, each caption change and the last second (`preview({ time })`) — a caption out of sync with\n the voice or a line that leaves mid-sentence shows only in time.\n<!-- requires:export -->\n Then export the mp4.\n<!-- /requires:export -->\n<!-- /requires:video -->\n\n## Carrying rich text across a translation\n\nStyled ranges are stored as character offsets into the block's string. Translate the string and\nthose offsets point at different words — sometimes at nothing. So a localized variant must carry\nrich text **semantically**, not numerically.\n\n- **Capture with `getProps(id, ['text.ranges'])`, never `getTextColors(id)[0]`.** The latter reads run 0 only.\n Re-applying it whole-block is what silently flattens a two-color headline.\n- **Run 0 is the base style**; apply it across the whole translated string first.\n- **Every further run is an accent**, and you need its **target-language substring** to place it.\n Ask for it as part of the translation: translate `\"Save 20% today\"` **and** tell me which\n target-language span carries the accent (`\"20 %\"`, `\"٪٢٠\"`, …). Locate that span with\n `indexOf`, then re-apply.\n- **A span that can't be located is a reportable defect**, not something to paper over. Apply the\n base style, leave the accent off, and say so — a flattened headline that nobody mentions is\n exactly the failure this section exists to prevent.\n- **The accent may not survive as a span at all.** Word order moves it, agglutinative targets fuse\n it into a longer word, and some languages have no equivalent fragment. When that happens, prefer\n moving the emphasis to the phrase the target language actually stresses over splitting a word.\n- **Paragraph state is separate from runs.** List style/level and per-paragraph alignment/leading\n live on paragraph indices, not character offsets — re-apply them per paragraph after any string\n re-write, and keep the item count matched (a translation that merges two bullets into one\n silently drops a list item).\n- **`text.case` is not a translation artefact.** All-caps set through the `case` prop re-cases the\n target string automatically; all-caps typed into the string is frozen English and cannot be\n correctly cased in scripts that have no case at all. Carry the property, not typed capitals.\n\n## Common mistakes / red flags\n\n- **Per-variant re-centering / re-sizing** → drift. If you're re-centering a block because the\n translation is a different length, STOP — snap it to the reference position instead.\n- **Line-height copied raw across the font swap** → wrong gap. `text/lineHeight` is content-area\n scaled and per-face; re-derive it on the target face (`setLeading`, §6.1.3), never carry the\n reference's engine number. The single most common localized-leading defect.\n- **Whole block landed a few px low (ar/ja \"moved down\")** → **baseline drift**. A `position.y` write\n snaps the frame **top** (= ascender line), but the script face's ascender/descender differ from\n the Latin source, so identical `y` renders a different baseline. Snap **baseline-relative** when\n the face changes: after positioning + `loadResources`, nudge `y` by the ascent delta\n `(refAscent − targetAscent) × fontSize` (both `ascender/unitsPerEm` via `design.font({ uri }).metrics`), or\n align the block by a shared optical anchor rather than the frame top. Confirm against the source\n render (the `judge` source-parity check).\n- **A weight the typeface does not declare** → \"Failed to find a font with the specified weight\". Declare it: a variable TTF takes one `fonts[]` entry per weight, same `uri` (`reference/font-loading.md`).\n- **Weight not carried onto the swapped face (text \"too light\" or \"too heavy\")** → the swap lands on\n the family's regular (400) cut. Capture the reference block's weight and re-apply it on the target\n face (verify it actually renders — declare the weight, `font-loading.md`); parity is checked\n by the `judge` source-parity render diff.\n- **Appearance not carried (fill/gradient/effect/corner-radius/overlay differs from the source)** →\n<!-- requires:import -->\n import the exported reference file so surface styling is inherited; if you rebuilt instead, or a\n<!-- /requires:import -->\n<!-- unless:import -->\n start from the reference design so surface styling is inherited; if you rebuilt instead, or a\n<!-- /unless:import -->\n reshape/recolor dropped it, re-capture and re-apply. Don't re-create a fill or effect \"by eye\" —\n read its values off the source.\n- **Reshape wiped the accent color / bold / underline** → capture with `getProps(id, ['text.ranges'])` before the\n reshape and re-apply after. If you captured with `getTextColors(id)[0]` you captured run 0 only,\n and re-applying it whole-block is itself the flattening bug.\n- **Accent landed on the wrong word after translation** → run offsets were replayed verbatim. They\n are source-string indices; re-locate the accent by its target-language substring instead.\n- **Bullets became separate blocks / lost their hanging indent in the variant** → list state is\n per-paragraph and does not survive a string re-write. Re-apply `text: { listStyle }` (and the level via raw `setTextListLevel`)\n per paragraph after translating.\n- **Letter-spacing on Arabic** → severs joins. `letterSpacing = 0`.\n- **RTL flip disassembled an icon / broke in-frame centering** → mirror operates on **groups, not\n loose blocks**, and **icons/logos/brand marks/numerals/charts/photos must not mirror** at all.\n Group a composed icon and flip the group as a unit (or exempt it); see the do-not-mirror\n inventory in `reference/arabic.md`.\n- **Plausible page, wrong font** → silent sans fallback / tofu. Preview every locale.\n- **Extra or missing decorative glyph** vs the reference → reconcile the count.\n- **Non-native export size** → export the page at its own pixel dimensions.\n\n## Cross-references\n\n- **`reference/font-loading.md`** — non-Latin font mechanics (this skill's font body).\n- **`reference/language-rules.md`** — cross-language quality rules + pass checklist.\n- **`reference/latin-expansion.md` / `arabic.md` / `cjk.md` / `vietnamese.md` / `cyrillic.md`** — per-script-family conventions, leading bands, quotation marks.\n- design rules §6.1 — general typographic thresholds (leading, tracking, all-caps & diacritic leading, the content-area line-height conversion (`design.font`), smart punctuation, reshape-then-recolor); §6.7 — the Latin font baseline; and the `api` skill's runtime notes.\n- **`judge`** — the acceptance gate (the `localization` axis scores this skill's output).\n- **`resize`** — the sibling skill for changing size/format (re-compose for a new aspect).\n",
|
|
45
|
+
"docs/localize/SKILL.md": "---\nname: localize\ndescription: >-\n Use when creating or fixing translated / localized variants of an existing CoDesign / CE.SDK\n design (e.g. de/ja/ru/ar editions); when a localized edition's text blocks or\n decorative elements have drifted, re-centered, or resized away from the source layout; when\n translated copy is tofu, overflowing, mis-tracked, or the wrong font after a language swap; or\n when loading a non-Latin script (Cyrillic / CJK / Arabic RTL / Vietnamese) font into a scene.\n Also for animated / video designs: longer holds, re-timed reveals, a new voice-over and captions\n per language.\n---\n\n# localize\n\n<!-- requires:export -->\nPoint this skill at the current design and the target locales, and it produces or repairs the localized editions. It operates on the **design in the current session**, and each locale is **exported as its own `.imgly` file**. Single home for localizing CoDesign designs: the **operational workflow**, the **font-loading mechanics**, and the **per-language quality rules**. It builds on two things it does _not_ restate: design rules §6.1 (general typographic thresholds — leading, tracking, all-caps, the content-area line-height conversion (`design.font`), smart punctuation, reshape-recolor) and design rules §6.7 (font discovery and pairing; `text.font` declarations are typed in the `api` skill). This skill is the non-Latin / localization extension of both.\n<!-- /requires:export -->\n<!-- unless:export -->\nPoint this skill at the current design and the target locales, and it produces or repairs the localized editions. It operates on the **design in the current session** — the product opens one session per locale, each holding the source, so localize the design in front of you into its one locale. Single home for localizing CoDesign designs: the **operational workflow**, the **font-loading mechanics**, and the **per-language quality rules**. It builds on two things it does _not_ restate: design rules §6.1 (general typographic thresholds — leading, tracking, all-caps, the content-area line-height conversion (`design.font`), smart punctuation, reshape-recolor) and design rules §6.7 (font discovery and pairing; `text.font` declarations are typed in the `api` skill). This skill is the non-Latin / localization extension of both.\n<!-- /unless:export -->\n\n**Scoring:** localizing is judged with the `judge` skill — every applicable axis ≥ 8, no averaging, N/A = 10. A single tofu glyph, an overflow after expansion, un-mirrored RTL, or a block that drifted off the source grid fails the edition (the `localization` axis).\n\n## Reference files (load on demand)\n\nThis `SKILL.md` holds the always-needed spine: inputs, core principle, workflow, block\nclassification, and the snap-to-reference routine. Two situational bodies of rules live beside it\nand are pulled in only when the task needs them:\n\n- **`reference/font-loading.md`** — getting a non-Latin face to render (jsDelivr\n picks, weights from a variable file, font-declaration gotchas, the silent-sans failure). Read it whenever the\n target locale needs a Cyrillic / CJK / Arabic / Vietnamese font, or copy came out tofu / wrong\n face.\n- **`reference/language-rules.md`** — the cross-language spine: preserve-vs-localize, translation\n quality, layout integrity after translation, and the localization pass checklist.\n- **`reference/<family>.md`** — per-script-family conventions, numeric leading bands, and\n quotation marks, one file per family: `latin-expansion.md` (de/fr/es…), `arabic.md`, `cjk.md`\n (ja/zh/ko), `vietnamese.md`, `cyrillic.md` (ru…). Read the file(s) for the **target locale(s)**\n you're building, e.g. `{{skill:localize#reference/arabic.md}}`.\n\nSeveral locales of one design, or re-applying a master fix to locales you already built: the\n**master → editions** workflow, `{{skill:resize#editions.md}}`.\n<!-- requires:video -->\nFor an animated or video design, read **Video and animated designs** below as well.\n<!-- /requires:video -->\n\n## Inputs — what to localize, and into what\n\n<!-- requires:interactive -->\nResolved before any work by the intake contract — derive, ask once, echo, invent nothing:\n`{{skill:create#intake.md}}`. **R** = required, no default; **A** = ask if\nunderived; **D** = defaultable.\n<!-- /requires:interactive -->\n<!-- unless:interactive -->\nResolved before any work by the intake contract — derive, decide what is missing, echo, invent\nnothing: `{{skill:create#intake.md}}`. **R** = required, no default; **A** = has a default, resolved by the intake when underived; **D** = defaultable.\n<!-- /unless:interactive -->\n\n| Parameter | Kind | Chips / values | Default |\n| -------------- | ------- | --------------------------------------------------------------------------- | --------------------------------- |\n| target locales | **R** | `German` · `French` · `Spanish` · `Japanese` · `Chinese` · `Arabic` · Other | none |\n| source locale | A | detected from the design's copy · Other | detected, stated in the echo |\n| source design | derived | — | the design in the current session |\n\n<!-- requires:export -->\n**1. The source (reference)** — the design in the current session, in its source language (usually `en`). **Export it as `.imgly` first** (`export({ format: 'imgly' })`) and keep its `uri`: its geometry is the grid every target locale snaps to, and every locale starts by re-importing that file. Never localize _from_ a non-reference locale.\n<!-- requires:open -->\nIf the user means a design saved earlier, its `uri` IS the reference `uri`: `open` it to `preview` and capture it, skip the first export, then `import` a copy of it per locale.\n<!-- /requires:open -->\n<!-- unless:open -->\n<!-- requires:version -->\nIf the user means a design saved earlier, its `design` IS the reference: `preview` it and capture it, skip the first export, then `import` a copy of it per locale.\n<!-- /requires:version -->\n<!-- unless:version -->\nIf the user means a design saved earlier, load it with `import({ source: { uri: '<its uri>' } })`.\n<!-- /unless:version -->\n<!-- /unless:open -->\n<!-- /requires:export -->\n<!-- unless:export -->\n**1. The source (reference)** — the design in the current session, in its source language (usually `en`), which the product opened for this one locale. Capture its geometry and `preview` it **before** you change anything: it is the grid the locale snaps to, and once you edit, the session holds nothing else to go back to. Never localize _from_ a non-reference locale.\n<!-- /unless:export -->\n\n<!-- requires:export -->\nA session holds one design, so the locales are built in sequence and the exported reference is what you return to between them:\n\n```\nexport({ format: 'imgly' }) → REFERENCE_URI (export the source FIRST)\nper locale:\n<!-- requires:open -->\n import({ source: { uri: REFERENCE_URI } }) → a copy of the reference is the session\n<!-- /requires:open -->\n<!-- unless:open -->\n<!-- requires:version -->\n import({ source: { uri: REFERENCE_URI } }) → a copy of the reference: a new design, with its own design and version\n<!-- /requires:version -->\n<!-- unless:version -->\n import({ source: { uri: REFERENCE_URI } }) → the reference replaces the session; its save is a new file\n<!-- /unless:version -->\n<!-- /unless:open -->\n edit(…) translate + swap the script font + snap to the reference geometry\n preview() → check it against the reference render\n export({ format: 'imgly' }) → that locale's own file\n```\n<!-- unless:open -->\n\n**Check each locale's returned `uri` is not `REFERENCE_URI`** (re-saving a session revises one file) — a locale that landed back on the reference overwrote the grid every other locale snaps to.\n<!-- /unless:open -->\n\n<!-- /requires:export -->\n<!-- requires:interactive -->\n**2. The locales** — the target languages, e.g. `de ja ru ar`. If omitted, **ask** —\n_**Which languages do you need?**_ — with the chips above; there is no defaulting to a language the\nuser didn't name. Then echo the resolved set (\"1 design × 3 locales, source `en` (detected)\") before\nbuilding.\n<!-- /requires:interactive -->\n<!-- unless:interactive -->\n**2. The locales** — the target languages, e.g. `de ja ru ar`. If omitted, change nothing and say\nin your reply which languages you need; there is no defaulting to a language the user didn't name.\nOtherwise echo the resolved set (\"1 design × 3 locales, source `en` (detected)\") before building.\n<!-- /unless:interactive -->\n\n<!-- requires:interactive -->\n**Never invent copy.** A translation is the user's own content: if a block's meaning is ambiguous,\nor a term is a name/product you cannot safely render in the target script, ask rather than guess —\nsee the keep-byte-identical list in `reference/language-rules.md` §1.\n<!-- /requires:interactive -->\n<!-- unless:interactive -->\n**Never invent copy.** A translation is the user's own content: if a block's meaning is ambiguous,\nor a term is a name/product you cannot safely render in the target script, keep it as written and\nname it in your reply rather than guess — see the keep-byte-identical list in\n`reference/language-rules.md` §1.\n<!-- /unless:interactive -->\n\n<!-- requires:export -->\n<!-- requires:drafts -->\n**Per locale, then:** run the Workflow below (re-import the reference, or load an existing localized file and snap it). Give each locale's `edit` a `note` naming the locale, `preview` it, and `export({ format: 'imgly' })` it — the locale's file to hand over (the copy itself is saved as you edit it). Report every locale's `uri` at the end.\n<!-- /requires:drafts -->\n<!-- unless:drafts -->\n**Per locale, then:** run the Workflow below (re-import the reference, or load an existing localized file and snap it). Give each locale's `edit` a `note` naming the locale and `preview` it. Each locale is kept as you edit it — `export({ format: 'imgly' })` returns its `uri`. Report every locale's `uri` at the end.\n<!-- /unless:drafts -->\n<!-- /requires:export -->\n<!-- unless:export -->\n**Then:** run the Workflow below. Give the locale's `edit` a `note` naming the locale, and `preview` it.\n<!-- /unless:export -->\n\n## Core principle — localize, then snap back to the reference\n\nLocalizing is **surgical**: change the words + the font the new script forces, and **nothing\nelse**. Then **snap every block back to the reference variant's geometry** so the localized\nedition is positionally identical to the source.\n\n- The **reference** is the source-locale variant (usually `en`) **of the same size**. Each size\n has its own reference grid.\n- **Never re-center or re-size a block per variant \"to fit better.\"** That independent re-fitting\n is exactly what makes a localized set drift — the eyebrow creeps up, the quote grows, the rule\n and footer slide down, and the editions stop matching. If there is room for the translated text\n at the reference position/size, keep the reference position/size.\n- Deviate from the reference **only** when the translated text genuinely overflows (expansion\n languages) — then shrink _that block's_ font within its band; do not move its neighbours.\n- **Swap the script font per block, not per scene.** Apply the new face **only to blocks whose\n copy is actually in the target script.** A block that stays in the source script — a personal\n name, brand/wordmark, `@handle`, URL, email, number, date, or product/tech name (the \"keep\n byte-identical\" list in `reference/language-rules.md` §1) — **keeps its original typeface.**\n Re-fonting it to the script face is drift even though its text was correctly preserved: a Latin\n name rendered in the Arabic/CJK serif is the classic tell. So a localized edition differs from\n its reference in **only the translated blocks' text + face**; every untranslated block is\n byte-identical (position mirrored for RTL).\n- **Bound faces and sizes: write the variable, not the block.** If the design binds `text.font`\n or `text.fontSize` to a scene variable (`getProps(id, ['bindings'])`), a direct write to that\n leaf is refused (`DESIGN.PROPERTY_BOUND`). Swap the script face for every block bound to it in\n one write — `setProps(scene, { variables: { body: { font: { family: 'Noto Sans JP' } } } })` —\n and shrink a long language's sizes through their `{ number }` variable. A block in the source\n script that shares that variable (a name, a URL) must keep its face: unbind it first\n (`bindings: { 'text.font': null }`) so the swap skips it. Building a multi-script template,\n bind each translatable block's `text.font` to one font variable per script role\n (`{{skill:templates}}`). A source with bindings or `{{tokens}}` but no `variables` was saved\n before variables were kept: take the values from the reply that built it, or ask, and set\n every variable it binds before you swap one.\n- **One design that switches language: value sets.** When the brief wants the languages inside\n one design (not one design per language), put each language's strings in a value set\n (`valueSets: { Deutsch: { values: { title: '…' } } }`, `{{skill:templates}}`) and render each by\n setting `activeValueSet`; size every text block for its longest value across the sets.\n\n## When to use\n\n- Producing new locale editions (de/ja/ru/ar/…) of a finished design, across one or more sizes.\n- Fixing a localized set whose blocks drifted / re-centered / resized vs the source.\n- Post-translation breakage: tofu, overflow, wrong tracking, Latin-looking sans where a script\n font should be.\n- Loading a non-Latin typeface into a scene.\n\n**Not for:** the original design build (that's `create` and the design rules); pure copy edits in the\nsame language. To change\nthe **size/format** — re-compose a design for a new aspect rather than translate it — use the **resize** skill\n(localize snaps geometry; resize re-derives it).\n\n<!-- requires:import -->\n## Reuse an existing localized build vs build fresh\n\n<!-- requires:open -->\n- **A saved file for the locale already exists** (an earlier pass built it — the user has its `uri`):\n **reuse its build** — `open({ uri })` it (`import` would give you a copy); the translated copy,\n script fonts, and RTL are already solved — but still **snap it to the reference geometry**.\n Earlier builds commonly drift; reuse the assets, fix the positions. Your fix goes to that design\n itself.\n- **No existing build:** `import` a copy of the reference file and swap text + font.\n<!-- /requires:open -->\n<!-- unless:open -->\n<!-- requires:version -->\n- **A design for the locale already exists** (an earlier pass built it):\n **reuse its build** — work on it by its `design` (`import` would give you a copy); the translated\n copy, script fonts, and RTL are already solved — but still **snap it to the reference geometry**.\n Earlier builds commonly drift; reuse the assets, fix the positions. Your fix goes to that design.\n- **No existing build:** `import` a copy of the reference and swap text + font.\n<!-- /requires:version -->\n<!-- unless:version -->\n- **A saved file for the locale already exists** (an earlier pass built it — the user has its `uri`):\n **reuse its build** — `import` it; the translated copy, script fonts, and RTL are already solved —\n but still **snap it to the reference geometry**. Earlier builds commonly drift; reuse the assets,\n fix the positions. Save it when you are done: its save is a new file — report the new `uri` in\n place of the old.\n- **No existing build:** re-import the reference file and swap text + font.\n<!-- /unless:version -->\n<!-- /unless:open -->\n\nEither way the last step is the same: every block lands on the reference grid.\n\n<!-- /requires:import -->\n## Workflow\n\n1. **Capture the reference geometry.** With the source-locale design in the session, `preview` it\n (that render is your parity reference for the `judge` gate) and read, per\n block: `x, y, width, widthMode, heightMode, fontSize (Pixel), lineHeight, letterSpacing,\nalignment`, plus page `w/h`, the ghost's anchor (left / centered), and the rule position. Do this\n **once**; the captured JSON is what you carry from locale to locale.\n<!-- requires:import -->\n<!-- requires:open -->\n2. **Load the target** — `open` the existing localized file to fix, or `import` a copy of the\n reference file for a fresh build.\n<!-- /requires:open -->\n<!-- unless:open -->\n<!-- requires:version -->\n2. **Load the target** — work on the existing localized design by its `design`, or `import` a copy\n of the reference for a fresh build.\n<!-- /requires:version -->\n<!-- unless:version -->\n2. **Load the target** — `import` the existing localized file to fix, or re-import the reference\n file for a fresh build.\n<!-- /unless:version -->\n<!-- /unless:open -->\n<!-- /requires:import -->\n<!-- unless:import -->\n2. **Translate in place** — the product opened this locale's session from the reference: swap each\n block's text for the target locale's copy, and the font for one that covers the script.\n<!-- /unless:import -->\n3. **Classify blocks by role** (see below).\n4. **Apply the reference geometry** to each corresponding block; keep the localized **text** and\n the **script font** (for a non-Latin face see `reference/font-loading.md`). Set\n per-locale: `letterSpacing = 0` for CJK & Arabic; RTL ghost mirrored to the right; alignment as\n the reference (centered-symmetric stays centered — see `reference/arabic.md`).\n5. **Reconcile ghost count.** Keep the reference's number of decorative glyphs. If the localized\n scene has extra ones (e.g. an Arabic closing-quote bookend the English lacks), **destroy the\n extras**; mirror the kept one for RTL.\n6. **Overflow guard.** After setting the reference font size, measure the quote's frame height; if\n it collides with the element below, step the font size down (only that block) until it fits.\n Never move neighbours to make room.\n7. **Re-apply rich text after a TRANSLATED string lands.** Font/size/line-height changes via\n `setProps` auto-reshape with every style range preserved — no manual step. A **translated\n string** is different: the write replays ranges at their OLD offsets, which are source-string\n indices. Capture each block with `getProps(id, ['text.ranges'])` first (each range carries its\n `text` substring), re-apply semantically after. ⚠ `getTextColors(id)[0]`\n is **not** a capture — it reads the first run only, so re-applying it flattens a two-color\n headline onto one color and the accent is gone with no error. Paragraph state\n (`getProps(id, ['text.paragraphs'])` — listStyle/listLevel per paragraph) survives a same-string reshape but not\n a **re-write**, so re-apply it whenever the string itself changed. **Ranges are index-based on\n the source string** — a translated string has different offsets, so never replay `from`/`to`\n verbatim; re-locate the styled substring in the target language (§ \"Carrying rich text across\n a translation\").\n8. **`loadResources` → `preview`.** One preview per locale — tofu / RTL / overflow /\n position match are only visible in the render.\n<!-- requires:video -->\n A video design needs several per locale, at different `time`s (below).\n<!-- /requires:video -->\n\nThen apply the per-locale quality rules in `reference/language-rules.md` **and the family\nfile(s) for the target locale(s)** (`reference/latin-expansion.md`, `arabic.md`, `cjk.md`,\n`vietnamese.md`, `cyrillic.md`), and dry-run the localization pass checklist against the render\nbefore reporting done.\n\n## Block-role classification\n\nClassify by measurable properties, not hard-coded ids (ids are session-scoped). For a\nquote-card family the roles are:\n\n- **ghost** (oversized decorative quote) — largest font size **and** trimmed string length ≤ 2.\n A design may have **more than one** (opening + closing bookend); collect all.\n- **footer / handle** — text containing `@`.\n- **quote / headline** — the largest remaining text after removing ghosts + footer.\n- **eyebrow** vs **attribution** — the two small texts; eyebrow sits **above** the quote,\n attribution **below**.\n- **rule / divider** — the graphic (non-text) block.\n\nRoles are design-specific. The general rule: **map each localized block to its reference block by\n<!-- requires:import -->\nrole, or by index** (every locale is imported from the same reference file, so they keep the same\n<!-- /requires:import -->\n<!-- unless:import -->\nrole, or by index** (every locale starts from the same reference design, so they keep the same\n<!-- /unless:import -->\nchild order), then restore that reference block's geometry.\n\n## The snap-to-reference routine\n\nA single CoDesign `edit` body. Fill the `EN` reference geometry (from step 1) and the locale\nflags, then it classifies, restores geometry, reconciles ghosts, applies per-locale tracking /\nRTL mirroring, guards overflow, and re-applies colors across the reshape.\n\n⚠ This routine is a **worked example, not a template**: every number in `EN` below is from one\nexample quote-card, and the classification heuristics (`fs >= 150`, `s.includes('@')`, …) are\nthat card's — never reuse either literally. Fill `EN` only from your own reference capture (the\nread at the bottom), and rewrite the classification for the actual design's roles.\n\n```js\n// --- config: reference geometry (read from the source-locale variant of THIS size) ---\nconst PW = 1080,\n PH = 1350; // page dims\nconst EN = {\n // lh = VISUAL leading target (from the target locale's script band, NOT the reference's\n // raw engine number) — setLeading() converts it through each block's target face. For a\n // localized display headline in a diacritic language, this is where the conditional +0.2\n // lives (latin-expansion.md): bump ≤1.2 → ~1.35 only if the rendered gap needs it.\n ghost: { x: 70, y: 55, fs: 300, lh: 1 }, // Auto-sized; keep size+lh, reposition\n eyebrow: { x: 110, y: 395, w: 860, fs: 16, lh: 1, ls: 0.25 },\n quote: { x: 110, y: 529, w: 860, fs: 62, lh: 0.85 }, // ls always 0\n rule: { x: 504, y: 930, w: 72 }, // graphic\n attribution: { x: 110, y: 960, w: 860, fs: 16, lh: 1, ls: 0.25 },\n footer: { x: 110, y: 1225, w: 860, fs: 15, lh: 1, ls: 0.12 }\n};\nconst RTL = false; // true for Arabic\nconst trackOK = true; // false for CJK/Arabic → force letterSpacing 0 on eyebrow/attr/footer\nconst ghostAnchor = 'left'; // 'left' (post/square) mirrors to the right for RTL; 'center' (story) stays centered\nconst belowQuoteY = EN.rule.y; // element the quote must stay above\n\nconst [page] = await engine.design.findByType('page');\nconst blocks = [];\nconst walk = async (id) => {\n for (const c of await engine.design.getChildren(id)) {\n blocks.push(c);\n await walk(c);\n }\n};\nawait walk(page);\nconst typeOf = async (id) => (await engine.design.getProps(id, ['type'])).type;\nconst texts = [];\nlet graphic;\nfor (const id of blocks) {\n const type = await typeOf(id);\n if (type === 'text') texts.push(id);\n else if (type === 'graphic') graphic ??= id;\n}\nawait engine.design.loadResources([page]);\n\nconst meta = async (id) => {\n const p = await engine.design.getProps(id, [\n 'text.string',\n 'text.fontSize',\n 'position'\n ]);\n return {\n id,\n s: p.text.string,\n fs: parseFloat(p.text.fontSize),\n y: p.position.y\n };\n};\nconst tm = [];\nfor (const id of texts) tm.push(await meta(id));\n\n// classify\nconst ghosts = tm.filter((t) => t.fs >= 150 && t.s.trim().length <= 2);\nlet ghost =\n ghosts.find((t) => t.s.includes('“')) ||\n ghosts.slice().sort((a, b) => a.y - b.y)[0];\nfor (const g of ghosts.filter((t) => t !== ghost))\n await engine.design.destroy(g.id); // drop extra bookend glyphs\nconst footer = tm.find((t) => t.s.includes('@'));\nconst rest = tm.filter((t) => !ghosts.includes(t) && t !== footer);\nconst quote = rest.reduce((a, b) => (b.fs > a.fs ? b : a));\nconst others = rest.filter((t) => t !== quote);\nconst eyebrow = others.reduce((a, b) => (b.y < a.y ? b : a));\nconst attribution = others.find((t) => t !== eyebrow);\n\n// capture rich text — each range carries its run's `text` substring, which is\n// what semantic re-location needs (offsets are source-string indices).\nconst runsOf = async (id) => {\n try {\n return (await engine.design.getProps(id, ['text.ranges'])).text.ranges;\n } catch (e) {\n return [];\n }\n};\nconst runs = {};\nfor (const t of [ghost, eyebrow, quote, attribution, footer])\n runs[t.id] = await runsOf(t.id);\n// Re-apply captured styling as ONE ranges assignment. Run 0 is the base style\n// and covers the whole block; any further run is an accent whose SOURCE offsets\n// are meaningless once the string is translated, so it is re-located by its\n// target-language substring (SPANS below).\n// Returns false when the accent could not be placed — flag it, never silently flatten.\nconst restyle = async (id, rs, spans = []) => {\n if (!rs.length) return true;\n const s = (await engine.design.getProps(id, ['text'])).text.text;\n const ranges = [{ ...rs[0], from: 0, to: s.length }]; // base over the whole string\n let ok = true;\n rs.slice(1).forEach((r, i) => {\n const span = spans[i]; // translator-supplied target-language accent text\n const at = span ? s.indexOf(span) : -1;\n if (at < 0) {\n ok = false; // accent lost in translation — report it, don't fake it\n return;\n }\n ranges.push({ ...r, from: at, to: at + span.length });\n });\n await engine.design.setProps(id, { text: { ranges } });\n return ok;\n};\n// Accent spans IN THE TARGET LANGUAGE, one per non-base run, keyed by block.\n// Empty for single-run blocks — which is every block in this quote card.\nconst SPANS = {};\n// setProps auto-reshapes on font/size/lineHeight writes — no manual reshape.\n// ⚠ Leading is RE-DERIVED on the TARGET face — never copied raw from the reference.\n// `text/lineHeight` multiplies the font's content area (per-face, ~1.15–1.35), so the\n// same engine number renders a DIFFERENT visual gap once the script font is swapped —\n// the #1 localized-leading defect. So EN.*.lh below is a VISUAL leading target (taken\n// from the target locale's script band in the family file — latin/arabic/cjk — NOT the\n// reference's raw engine value), converted through THIS block's now-current font via\n// design.font({ uri }) → contentArea (design rules §6.1.3).\nconst setLeading = async (id, visual) =>\n // facade converts per font (metrics cached at font resolve / loadResources)\n await engine.design.setProps(id, { text: { lineHeight: { visual } } }); // auto-reshapes, ranges preserved\nconst applyText = async (t, g, ls) => {\n await engine.design.setProps(t.id, {\n widthMode: 'Absolute',\n width: g.w,\n heightMode: 'Auto',\n text: {\n fontSize: g.fs + 'px',\n letterSpacing: ls,\n horizontalAlignment: 'Center'\n }\n }); // fontSize/letterSpacing writes auto-reshape, ranges preserved\n await setLeading(t.id, g.lh); // visual target → target-face content area (§6.1.3)\n};\n\nawait engine.design.setProps(ghost.id, {\n text: { fontSize: EN.ghost.fs + 'px' }\n});\nawait setLeading(ghost.id, EN.ghost.lh);\nawait applyText(eyebrow, EN.eyebrow, trackOK ? EN.eyebrow.ls : 0);\nawait applyText(attribution, EN.attribution, trackOK ? EN.attribution.ls : 0);\nawait applyText(footer, EN.footer, trackOK ? EN.footer.ls : 0);\nawait applyText(quote, EN.quote, 0);\nawait engine.design.setProps(graphic, { width: EN.rule.w });\nfor (const t of [ghost, eyebrow, quote, attribution, footer])\n await restyle(t.id, runs[t.id], SPANS[t.id]);\nawait engine.design.loadResources([page]);\n\n// position (ghost measured for mirroring; others straight from EN)\nconst { width: gw } = await engine.design.measure(ghost.id);\nawait engine.design.setProps(ghost.id, {\n position: {\n x:\n ghostAnchor === 'center'\n ? (PW - gw) / 2\n : RTL\n ? PW - EN.ghost.x - gw\n : EN.ghost.x,\n y: EN.ghost.y\n }\n});\nfor (const [t, g] of [\n [eyebrow, EN.eyebrow],\n [quote, EN.quote],\n [attribution, EN.attribution],\n [footer, EN.footer]\n]) {\n await engine.design.setProps(t.id, { position: { x: g.x, y: g.y } });\n}\nawait engine.design.setProps(graphic, {\n position: { x: EN.rule.x, y: EN.rule.y }\n});\n\n// overflow guard — shrink ONLY the quote, never move neighbours\nawait engine.design.loadResources([page]);\nlet qfs = EN.quote.fs;\nconst avail = belowQuoteY - EN.quote.y - 16;\nwhile ((await engine.design.measure(quote.id)).height > avail && qfs > 44) {\n qfs -= 2;\n // the fontSize write auto-reshapes AND auto-preserves the style ranges.\n await engine.design.setProps(quote.id, { text: { fontSize: qfs + 'px' } });\n await engine.design.loadResources([page]);\n}\nreturn { type: 'text', text: JSON.stringify({ page, qfs }, null, 1) };\n```\n\nReference-capture read (run on the source variant to fill `EN`):\n\n```js\nconst [page] = await engine.design.findByType('page');\nconst ids = [];\nconst walk = async (id) => {\n for (const c of await engine.design.getChildren(id)) {\n ids.push(c);\n await walk(c);\n }\n};\nawait walk(page);\nconst TEXT = [\n 'text.string',\n 'text.fontSize',\n 'text.lineHeight',\n 'text.letterSpacing'\n];\nconst out = [];\nfor (const id of ids) {\n const { type } = await engine.design.getProps(id, ['type']);\n const p = await engine.design.getProps(id, [\n 'position',\n 'width',\n 'widthMode',\n ...(type === 'text' ? TEXT : [])\n ]);\n out.push({\n t: type,\n x: Math.round(p.position.x),\n y: Math.round(p.position.y),\n w: Math.round(p.width),\n wm: p.widthMode,\n ...(p.text && {\n s: p.text.string.slice(0, 14),\n fs: Math.round(parseFloat(p.text.fontSize)),\n lh: +p.text.lineHeight.toFixed(2),\n ls: +p.text.letterSpacing.toFixed(2)\n })\n });\n}\nconst { width: pw, height: ph } = await engine.design.getProps(page, [\n 'width',\n 'height'\n]);\nreturn { type: 'text', text: JSON.stringify({ pw, ph, b: out }) };\n```\n\n<!-- requires:video -->\n## Video and animated designs\n\nApplies when the page has a `playback.duration`, timed blocks, `animations`, an `audio` voice-over\nor a `captionTrack`. Geometry still snaps to the reference; the **timeline** is re-derived from the\nnew language's speech and reading time.\n\n- **Reading time sets the hold.** A line must stay on screen ≈**0.3 s per word** after its\n entrance finishes. Expansion languages (German, French, Spanish run 15–35 % longer) need longer\n holds: extend the block's `playback.duration`, shift what follows, and grow the page's\n `playback.duration` — never shorten reading time or speed up speech to fit the source length.\n- **Word-by-word reveals scale with the target.** A `typewriter_text` (or any text animation whose\n `textAnimationWritingStyle` is `Word` / `Character`) reveals per word or per character: scale its\n duration by target ÷ source word (or character) count, and check that the reveal ends with the\n 0.3 s-per-word hold still ahead of it. Patch it with the same type:\n `setProps(id, { animations: { in: { type, duration: s } } })`.\n- **Keyed text: translate the keys AND the static string.** For a block whose `text.string`\n has keys, read them after any `playback.duration` change above (it stretches them). In one\n write, map each key's `value` (keep `at` and `easing`) and set the static string to the very\n translation of the key it equals, else translate it on its own; then `restyle` (step 7). The\n key equal to the static string keeps the accent; every other key draws in the first run.\n- **Keyed text: guard every key, then fix the height.** Step 6's `measure(quote.id)` sees only\n the static string. Measure each translated key on an unkeyed copy\n (`{{skill:api#animation.md}}`, \"Keyframes\"), write each smaller font size to the copy, the\n block and, by the same ratio, an accent block, then destroy the copy and write\n `heightMode: 'Absolute'` with the tallest key's height (with `'Auto'` the first mp4 export cuts\n the added lines). An accent block beside it with `position.x` keys: give it the text's start\n and `playback.duration`, then one `position.x` key per translated `text.string` key, while that\n page's conditions hold (`{{skill:api#animation.md}}`, \"`text.string` keys draw in the text's\n first run\"). When the translation breaks them (right-to-left, not left-aligned, the accent\n leaves the line's end, a key wraps), write the static string and every key as its full\n translated line, accent word included where the language puts it, in the text's colour,\n destroy the accent block, run this guard again, and say so.\n<!-- requires:asset_generate -->\n- **Re-voice, don't re-use.** Generate the voice-over again from the translated script with a\n `text2speech` model — `asset_generate({ capability: 'text2speech' })` lists them (e.g.\n `elevenlabs/eleven-v3-tts`); keep the master's voice across locales via `params`\n (`asset_generate({ model, schema: true })` names the model's inputs). Swap the file on the\n existing audio block — `setProps(audio, { audio: { fileURI } })` — so its offset and volume stay.\n Respell names in the translated script as they are said in that language, and keep the written\n names in the captions (`{{skill:models#audio.md}}`).\n- **Captions come from the new take.** Transcribe it with a `speech2text` model\n (`elevenlabs/scribe-v2`, via `params` — check its inputs with `schema: true`); read each word's\n `start` / `end` from its `transcriptUri` with `engine.design.readTranscript` inside `edit`.\n<!-- /requires:asset_generate -->\n<!-- unless:asset_generate -->\n- **Re-voice, don't re-use.** A voice-over in the source language does not belong in the edition.\n Swap in a voice-over for the target language when the brief supplies one —\n `setProps(audio, { audio: { fileURI } })` on the existing audio block, so its offset and volume\n stay — and ask for it, or for its word timings, when it does not.\n- **Captions come from the new take**, timed by its word-level `start` / `end`.\n<!-- /unless:asset_generate -->\n Rebuild the captions from those words: a caption per phrase (break at\n sentence ends, and at commas once a phrase has two words), `timeOffset` = the audio block's\n offset + the first word's `start`, held until the next caption. Carry the master captions' frame\n and style onto **every** new caption (it is per caption, not shared) — and their typeface:\n captions have their own font (`caption/typeface`, `caption/fontFileUri`), so the script face goes\n there too, not only on text blocks.\n- **Re-snap the timeline to the new speech — one rule.** Every timed block that enters on a spoken\n cue keeps its **lead**: new `timeOffset` = master `timeOffset` − master cue time + target cue\n time. A block that ended where another began still ends there; a block that ran to the end of\n the page still does; page duration = max(master duration, voice-over offset + last word's `end` +\n the master's closing silence).\n- **RTL mirrors the motion, not only the layout.** For Arabic / Hebrew, mirror horizontal\n directions: `slide` / `pan` `direction` θ → `π − θ` (`0` ↔ `π`; it is the direction of travel),\n `wipe` `Left` ↔ `Right`, `caption/horizontalAlignment` `Left` ↔ `Right`. The do-not-mirror\n inventory (icons, logos, numerals, photos) holds for motion too.\n- **Preview at several `time`s, per locale.** Mid-reveal of each word-by-word line, the end of each\n hold, each caption change and the last second (`preview({ time })`) — a caption out of sync with\n the voice or a line that leaves mid-sentence shows only in time.\n<!-- requires:export -->\n Then export the mp4.\n<!-- /requires:export -->\n<!-- /requires:video -->\n\n## Carrying rich text across a translation\n\nStyled ranges are stored as character offsets into the block's string. Translate the string and\nthose offsets point at different words — sometimes at nothing. So a localized variant must carry\nrich text **semantically**, not numerically.\n\n- **Capture with `getProps(id, ['text.ranges'])`, never `getTextColors(id)[0]`.** The latter reads run 0 only.\n Re-applying it whole-block is what silently flattens a two-color headline.\n- **Run 0 is the base style**; apply it across the whole translated string first.\n- **Every further run is an accent**, and you need its **target-language substring** to place it.\n Ask for it as part of the translation: translate `\"Save 20% today\"` **and** tell me which\n target-language span carries the accent (`\"20 %\"`, `\"٪٢٠\"`, …). Locate that span with\n `indexOf`, then re-apply.\n- **A span that can't be located is a reportable defect**, not something to paper over. Apply the\n base style, leave the accent off, and say so — a flattened headline that nobody mentions is\n exactly the failure this section exists to prevent.\n- **The accent may not survive as a span at all.** Word order moves it, agglutinative targets fuse\n it into a longer word, and some languages have no equivalent fragment. When that happens, prefer\n moving the emphasis to the phrase the target language actually stresses over splitting a word.\n- **Paragraph state is separate from runs.** List style/level and per-paragraph alignment/leading\n live on paragraph indices, not character offsets — re-apply them per paragraph after any string\n re-write, and keep the item count matched (a translation that merges two bullets into one\n silently drops a list item).\n- **`text.case` is not a translation artefact.** All-caps set through the `case` prop re-cases the\n target string automatically; all-caps typed into the string is frozen English and cannot be\n correctly cased in scripts that have no case at all. Carry the property, not typed capitals.\n\n## Common mistakes / red flags\n\n- **Per-variant re-centering / re-sizing** → drift. If you're re-centering a block because the\n translation is a different length, STOP — snap it to the reference position instead.\n- **Line-height copied raw across the font swap** → wrong gap. `text/lineHeight` is content-area\n scaled and per-face; re-derive it on the target face (`setLeading`, §6.1.3), never carry the\n reference's engine number. The single most common localized-leading defect.\n- **Whole block landed a few px low (ar/ja \"moved down\")** → **baseline drift**. A `position.y` write\n snaps the frame **top** (= ascender line), but the script face's ascender/descender differ from\n the Latin source, so identical `y` renders a different baseline. Snap **baseline-relative** when\n the face changes: after positioning + `loadResources`, nudge `y` by the ascent delta\n `(refAscent − targetAscent) × fontSize` (both `ascender/unitsPerEm` via `design.font({ uri }).metrics`), or\n align the block by a shared optical anchor rather than the frame top. Confirm against the source\n render (the `judge` source-parity check).\n- **A weight the typeface does not declare** → \"Failed to find a font with the specified weight\". Declare it: a variable TTF takes one `fonts[]` entry per weight, same `uri` (`reference/font-loading.md`).\n- **Weight not carried onto the swapped face (text \"too light\" or \"too heavy\")** → the swap lands on\n the family's regular (400) cut. Capture the reference block's weight and re-apply it on the target\n face (verify it actually renders — declare the weight, `font-loading.md`); parity is checked\n by the `judge` source-parity render diff.\n- **Appearance not carried (fill/gradient/effect/corner-radius/overlay differs from the source)** →\n<!-- requires:import -->\n import the exported reference file so surface styling is inherited; if you rebuilt instead, or a\n<!-- /requires:import -->\n<!-- unless:import -->\n start from the reference design so surface styling is inherited; if you rebuilt instead, or a\n<!-- /unless:import -->\n reshape/recolor dropped it, re-capture and re-apply. Don't re-create a fill or effect \"by eye\" —\n read its values off the source.\n- **Reshape wiped the accent color / bold / underline** → capture with `getProps(id, ['text.ranges'])` before the\n reshape and re-apply after. If you captured with `getTextColors(id)[0]` you captured run 0 only,\n and re-applying it whole-block is itself the flattening bug.\n- **Accent landed on the wrong word after translation** → run offsets were replayed verbatim. They\n are source-string indices; re-locate the accent by its target-language substring instead.\n- **Bullets became separate blocks / lost their hanging indent in the variant** → list state is\n per-paragraph and does not survive a string re-write. Re-apply `text: { listStyle }` (and the level via raw `setTextListLevel`)\n per paragraph after translating.\n- **Letter-spacing on Arabic** → severs joins. `letterSpacing = 0`.\n- **RTL flip disassembled an icon / broke in-frame centering** → mirror operates on **groups, not\n loose blocks**, and **icons/logos/brand marks/numerals/charts/photos must not mirror** at all.\n Group a composed icon and flip the group as a unit (or exempt it); see the do-not-mirror\n inventory in `reference/arabic.md`.\n- **Plausible page, wrong font** → silent sans fallback / tofu. Preview every locale.\n- **Extra or missing decorative glyph** vs the reference → reconcile the count.\n- **Non-native export size** → export the page at its own pixel dimensions.\n\n## Cross-references\n\n- **`reference/font-loading.md`** — non-Latin font mechanics (this skill's font body).\n- **`reference/language-rules.md`** — cross-language quality rules + pass checklist.\n- **`reference/latin-expansion.md` / `arabic.md` / `cjk.md` / `vietnamese.md` / `cyrillic.md`** — per-script-family conventions, leading bands, quotation marks.\n- design rules §6.1 — general typographic thresholds (leading, tracking, all-caps & diacritic leading, the content-area line-height conversion (`design.font`), smart punctuation, reshape-then-recolor); §6.7 — the Latin font baseline; and the `api` skill's runtime notes.\n- **`judge`** — the acceptance gate (the `localization` axis scores this skill's output).\n- **`resize`** — the sibling skill for changing size/format (re-compose for a new aspect).\n",
|
|
46
46
|
"docs/localize/reference/arabic.md": "# Arabic (RTL)\n\nFamily file for the `localize` skill: conventions, leading bands, and quotation marks for Arabic.\nEvery leading value here is a **visual** multiplier — apply design rules §6.1.3 content-area\nconversion (write `lineHeight: { visual }` — the facade converts) before setting\n`text/lineHeight`.\n\n## Conventions\n\n- **MSA** (Modern Standard Arabic), not dialect; **Western numerals**.\n- **Mirror the layout, not just the text.** Right-align running text; flow directional &\n decorative elements right-to-left (a leading decorative quote glyph → mirror `“`→`”`/`»`). A\n **centered, symmetric** composition is already mirror-invariant — it **stays centered**; only\n text direction and the ghost's side change (the snap routine mirrors a `ghostAnchor:'left'`\n ghost to the right, leaves a `'center'` ghost centered).\n- **Never letter-space Arabic** — joined script; tracking severs the joins. `text/letterSpacing = 0`\n (design rules §6.1.6).\n- Keep names/brands/URLs/numbers as-is (Latin runs stay LTR via bidi) **and in their source\n typeface** — declare the Arabic face (`text.font`) **only on Arabic-script blocks**; never re-font a\n Latin-only block (a name, wordmark, chips, dates) to the Arabic serif. Transliteration optional.\n- **Mirror by anchoring to an edge, not by measured width.** `getFrameWidth` can **under-measure\n Auto-width Arabic** (joined-script shaping), so mirroring a block via `x = pageW − x −\ngetFrameWidth(id)` can push it off-page. Give a mirrored Arabic block an **Absolute width,\n right-aligned and anchored to a known right edge** — don't position it by measured width.\n- **Mirror the reading order — not every block. Keep a do-not-mirror inventory.** Mirroring is a\n **selective** transform over a **classified** tree, not a blanket flip of every block's `x`.\n Flip: the column/reading order (what was leftmost becomes rightmost), running-text alignment, and\n **directional** decoration (a leading quote glyph, an arrow that points into the text). Do **not**\n mirror, ever: **icons, logos, brand/wordmarks, glyph-built marks, numerals and number strings,\n charts/graphs, photographs**, and any pictogram whose handedness carries meaning (a check, a\n play triangle). Mirroring these is the \"icons broke / elements moved to the right / off-center in\n their frames\" defect. A photo the mirrored column would now cover is **panned, not flipped**: shift\n its crop (`crop: { translationX }`) so the subject moves to the side the text left.\n- **Mirror on the GROUP, not its parts.** A composed icon (mail = envelope body + flap + lines),\n a lockup (mark + wordmark), or a badge (field + label + icon) must move **as one unit** — mirror\n the group's position, and leave the group's _internal_ layout intact (or exempt the group\n entirely if it's in the do-not-mirror list). If the parts are loose siblings, a per-block flip\n disassembles them — **group first, then decide mirror-or-exempt for the whole group.** Content\n that sits _inside_ a frame (text/icon centered in a shape) is re-anchored with its frame, never\n flipped independently.\n\n## Leading\n\nTall ascenders + deep descenders demand more vertical room than Latin — set explicitly:\n\n- **Body 1.6–1.8**\n- **Display / headline 1.3–1.5**\n\nNo all-caps concept applies (Arabic has no case).\n\n## Quotation marks\n\n| Locale | Primary quotes | Notes |\n| ------ | -------------- | ------------------------------ |\n| AR | « » | RTL; opening mark on the right |\n\nSecondary: „ “.\n\n## Fonts\n\nUse a script face with full Arabic coverage **matched to the Latin face's character**\n(`language-rules.md` §6), not just any Arabic font:\n\n- **Editorial / high-contrast serif** Latin → **Amiri** (Naskh serif — verified).\n- **Geometric / grotesque sans** Latin → **IBM Plex Sans Arabic / Cairo / Tajawal** (matched sans).\n Do **not** use Amiri here — a Naskh serif on a sans design is a mismatch.\n- **Handwritten / script** accent → **Aref Ruqaa** (Ruqʿah calligraphy) or **Lalezar** (rounded\n playful display), never a flat sans.\n\nLoading mechanics + jsDelivr paths + declaring weights are in `font-loading.md`. A Latin face\nsilently falling back to a system sans is the classic failure — `preview` every Arabic edition.\n\n## Cross-references\n\n- `language-rules.md` — preserve-vs-localize, translation quality, layout integrity, the RTL rows\n of the pass checklist.\n- design rules §6.1.5 — mirrored alignment; §6.1.6 — the no-tracking rule; §6.1.3 — the content-area\n conversion.\n- `judge` — the `localization` axis scores mirroring, bidi, and tofu.\n",
|
|
47
47
|
"docs/localize/reference/cjk.md": "# CJK (Japanese, Chinese, Korean)\n\nFamily file for the `localize` skill: conventions, leading bands, and quotation marks for CJK\nscripts. The general sections below are written from Japanese practice and hold for CJK broadly;\n**Korean diverges on spacing, punctuation and fonts — read \"Korean (ko-KR)\" before setting Hangul.**\nEvery leading value here is a **visual** multiplier — apply design rules §6.1.3 content-area\nconversion (write `lineHeight: { visual }` — the facade converts) before setting\n`text/lineHeight`.\n\n## Conventions\n\n- **Real kanji**, idiomatic; no romaji dumps.\n- **No all-caps, no italics** — CJK has neither; never fake them. Foreign names may stay Latin\n or, optionally, be written in katakana.\n- **Font swap only on CJK blocks.** Foreign names/brands/URLs/numbers kept in Latin **retain their\n source typeface** — declare the CJK face (`text.font`) only on blocks that carry CJK text; don't re-font a\n Latin-only block (a name, wordmark, chips, dates) into the CJK serif.\n- **Full-width punctuation:** 、 。 「 」 『 』 ( ). Do not reuse Latin `, . \" ()`.\n- Respect **kinsoku** — a line shouldn't _start_ with 、 or 。. The engine usually handles this —\n verify in `preview`.\n\n## Leading & tracking\n\nFull-width glyphs fill the em and pack dense — set leading explicitly, looser than Latin:\n\n- **Body 1.6–1.75**\n- **Display / headline 1.25–1.35**\n- **No tracking** — `text/letterSpacing = 0` (design rules §6.1.6); CJK is never letter-spaced.\n\n## Korean (ko-KR)\n\nKorean is **not** Japanese with different glyphs. Four differences change the output:\n\n- **Korean has inter-word spacing** (띄어쓰기) and breaks lines at spaces like Latin does. Do not\n carry Japanese habits over: no ideographic space (U+3000) as a field separator, and kinsoku is\n not the mechanism here.\n- **Punctuation is Latin-width** — `, . ? !` with ordinary spacing, not 、 。. Primary quotes are\n **“ ”** (secondary ‘ ’); 「 」 belong to literary or vertical setting, not marketing copy.\n- **Leading sits between Latin and Japanese** — body **1.5–1.7**, display **1.2–1.3**. Hangul\n syllables are full-width and pack densely, but word spaces open the line up.\n- **Contraction is mild.** Character count badly overstates it: against English, expect roughly\n **−20% to −30%** of rendered width for a headline, and a short CTA may not shrink at all. Do not\n re-scale or re-flow a layout to \"fill\" space that was never freed.\n\nEverything else in this file applies: no all-caps (Hangul has no case), no italics, no tracking,\nand the font swap goes on Hangul blocks only.\n\n**Fonts — Gothic (고딕) is the Korean sans, Myeongjo (명조) the serif:**\n\n- Geometric / grotesque sans Latin → **Gothic A1** (nine static weights) or **Nanum Gothic**.\n- Editorial serif Latin → **Nanum Myeongjo** or **Gowun Batang**.\n- A heavy display lockup → **Black Han Sans** / **Do Hyeon** (single weight each).\n\n⚠ **A Japanese face has no Hangul.** `Noto Sans JP` on Korean copy is a page of tofu, and \"it is a\nCJK font\" is not a coverage claim — the scripts do not share faces. Note also that **Noto Sans KR\nand Noto Serif KR are variable** on jsDelivr: declare each weight you set; see `font-loading.md`.\n\n## Quotation marks\n\n| Locale | Primary quotes | Notes |\n| -------- | -------------- | ------------------------------------------------------- |\n| JA / CJK | 「 」 『 』 | full-width corner brackets |\n| KO | “ ” ‘ ’ | Latin-style quotes; 「 」 only in literary/vertical set |\n\n## Fonts\n\nA CJK-covering face is mandatory, **matched to the Latin face's character** (`language-rules.md`\n§6) — **Mincho is the CJK serif, Gothic is the CJK sans**:\n\n- **Editorial / high-contrast serif** Latin → **Shippori Mincho / Noto Serif JP** (Mincho).\n- **Geometric / grotesque sans** Latin → **Noto Sans JP / Zen Kaku Gothic New** (Gothic). Setting a\n sans design in Mincho is the common inverted mismatch — check the Latin character both ways.\n- **Handwritten / casual** accent → **Yomogi / RocknRoll One**.\n- No italic/cursive in CJK — carry emphasis with **weight + size**, not a separate style.\n\nLoading mechanics + jsDelivr paths are in `font-loading.md`. Latin faces have zero CJK coverage — a\nwrong font is instant tofu; `preview` every edition.\n\nFor **bold** CJK headings use a Bold file (`ofl/shipporimincho/ShipporiMincho-Bold.ttf`) or a\nvariable file with its bold declared (`font-loading.md`) — a static Regular file renders **Regular\nonly**. If no bold is available, carry the heading's weight with **size/color** instead of a\nfaux-bold.\n\n## Cross-references\n\n- `language-rules.md` — preserve-vs-localize, translation quality, layout integrity, the pass\n checklist.\n- design rules §6.1.3 — the content-area conversion; §6.1.6 — the no-tracking rule.\n- `judge` — the `localization` axis scores kanji quality, punctuation, and tofu.\n",
|
|
48
48
|
"docs/localize/reference/cyrillic.md": "# Cyrillic (Russian, Ukrainian, Serbian, Bulgarian…)\n\nFamily file for the `localize` skill: conventions and quotation marks for Cyrillic-script\nlanguages.\n\n## Conventions\n\n- **Font coverage is the trap:** most geometric-sans Latin favourites don't ship Cyrillic —\n **Poppins has none**. Use a Cyrillic-covering face with a real bold; **Fira Sans** is the\n default pick (see `font-loading.md`).\n- Modest expansion (~+10–15% vs English); verify against `language-rules.md` §4, though it rarely\n overflows a box that held English.\n- **Casing & italics are Latin-like** — normal upper/lower and italics apply (unlike CJK). Keep\n the reference's tracking; Cyrillic tolerates the same letter-spacing as Latin.\n- Latin brand names / `@handles` / URLs stay Latin, correct via bidi.\n\n## Leading\n\nNo script-specific bands — the **base Latin bands in design rules §6.1.3 apply** (body 1.4–1.6 web /\n1.2–1.45 print, display per its band, all-caps 0.9–1.0). Cyrillic capitals carry no diacritics\nthat breach the cap-height band.\n\n## Quotation marks\n\n| Locale | Primary quotes | Notes |\n| ------------- | -------------- | ------------- |\n| RU / Cyrillic | « » | secondary „ “ |\n\nAs a _decorative_ glyph, keep the source `“` motif or localize to `«` — consistently across the\nset (`language-rules.md` §5).\n\n## Cross-references\n\n- `language-rules.md` — preserve-vs-localize, translation quality, layout integrity, the pass\n checklist.\n- `font-loading.md` — the Fira Sans row and declaring weights from a variable file.\n- design rules §6.1.3 — the Latin leading bands this family inherits.\n",
|
|
@@ -56,11 +56,11 @@ export const INLINE_ASSETS = {
|
|
|
56
56
|
"docs/models/bytedance-seedream.md": "# ByteDance Seedream — layer decomposition\n\n`bytedance/seedream-5-pro-layerize` (image-to-image) splits one image into a background and\nindependently placeable cut-outs. The other Seedream ids in the catalog (text-to-image and edit)\nhave no verified guidance yet.\n\n## Prompt\n\nSend `split image into layers` — exactly this. Do not describe the image or the layers you want.\nThe tool requires a prompt; the model decomposes on its own.\n\nWhy (tests, September 2026): on one ad image, prompts over 1,000 characters failed 7 of 7, and\nprompts of 14–420 characters succeeded 3 of 5. Describing the wanted layers did not improve the\nsplit — `split image into layers` and a deliberately unrelated prompt returned the same nine\nlayers, bounding boxes within 1 px (only their order differed). A 1,541-character prompt did succeed on a different image, and a short one sometimes\nfails, so the minimal prompt is the better bet, not a guarantee.\n\n## Input\n\n<!-- requires:asset_add -->\nPass the original file through `asset_add` unchanged. Re-encoded copies (RGB JPEG and RGB PNG) of\nthe test ad were rejected by the content checker 4 of 4, while the original RGBA PNG went through.\n<!-- /requires:asset_add -->\n<!-- unless:asset_add -->\nPass the original image unchanged. Re-encoded copies (RGB JPEG and RGB PNG) of\nthe test ad were rejected by the content checker 4 of 4, while the original RGBA PNG went through.\n<!-- /unless:asset_add -->\n\nThe image needs at least 262144 pixels (512 × 512); a smaller one is rejected with `Image dimensions are too small`.\n\n## Result\n\n- `assets[0]` — the residual background: source size, RGB, extracted elements inpainted away. Its\n `layers` entry has no name and no bounding box. It can still show part of an element that also\n came back as its own layer — compare before using it.\n- `assets[1…]` — RGBA cut-outs, one per `metadata` `layers` entry in the same order; `z_index`\n equals the index, back to front. The order is not stable between calls (the same layers came back\n stacked differently), so decide the stacking yourself.\n- `bounding_box.absolute` is `[x0, y0, x1, y1]` in source pixels; `normalized` is the same box in\n per-mille (0–999).\n- **Cut-outs come back rescaled**, by a different factor per layer (seen 1.08× to 4.3×, aspect\n kept). Size each layer to its bounding box — never to the asset's pixel size.\n- A call takes 50–150 s.\n\n## Errors seen\n\n- `The model rejected the input: image_url: The provided image could not be processed for layer decomposition. Try a different image.`\n- `The model rejected the input: image: The content could not be processed because it contained material flagged by a content checker.`\n- `Upstream service error`\n- `The model rejected the input: image_url: Image dimensions are too small. Minimum area is 262144 pixels²` — the image is under 512 × 512; this one is final for that file.\n\nThe first three appeared for inputs that succeeded on another call, so none of them proves the image\nis unusable.\n",
|
|
57
57
|
"docs/models/upscalers.md": "# Upscalers\n\nNeither upscaler preserves transparency.\n\n| model | output | factor | alpha | also |\n| --------------------------- | --------------- | ---------- | -------------------------------- | ------------------------- |\n| `bytedance/seedvr2-upscale` | JPEG | 2× | lost — flat grey behind subject | restyled a face |\n| `recraft/crisp-upscale` | WebP (lossless) | 3.3 × – 4× | dropped (`alpha_is_used: false`) | softened paper grain ~40% |\n\n## Upscaling a cut-out\n\nRun `recraft/crisp-upscale`, then `bria/rmbg-2.0` on its result, and verify the alpha before\nplacing it. In testing this restored clean transparency (a figure came back 46.6 % fully\ntransparent, corners at alpha 0). Placing an upscaled cut-out directly paints an opaque rectangle\nover the design.\n\n## Prompt\n\nThe tool requires one. Whether the wording changes an upscaler's result is untested.\n",
|
|
58
58
|
"docs/models/video.md": "# Video\n\nCatalog models: `google/veo-3.1-fast`, `google/veo-3.1-lite`, `kling/v3-pro`,\n`bytedance/seedance-2.5`, `minimax/h3-max` (+ `-turbo`); each has an image-to-video twin with an\n`-i2v` suffix that takes its start frame through `image_uris`.\n\nNot yet run through this server — read the model's `schema: true` for its `duration`,\n`resolution` and aspect fields before the first call, and expect a generation to take minutes and\ncost far more than an image. Check the `cost` of the first result before generating several.\n\nThe result is an MP4 (`meta.kind: 'video'`, with `meta.duration` from its header).\n<!-- requires:video -->\nPlace it as a video fill: `{{skill:api#video.md}}`.\n<!-- /requires:video -->\n<!-- unless:video -->\nVideo is off on this server, so it cannot be placed in a design here.\n<!-- /unless:video -->\n",
|
|
59
|
-
"docs/onboard/SKILL.md": "---\nname: onboard\ndescription: >-\n Use when the user is new here or asks what this server is / what it\n can do (\"what is CoDesign\", \"what can you make\", \"show me\"). A guided, plain-language\n introduction for a HUMAN: explain what CoDesign is in everyday terms, put the six\n jobs it does on the table, let the user pick one, then run it either on the bundled\n demo design or on the user's own idea — closing with the optional (never required)\n IMG.LY sign-in and the ways to earn more credits. Not a design manual: the `api` and `judge`\n skills remain the required reads before any edit.\nrequires: import, export, drafts, interactive\n---\n\n# onboard — introduce CoDesign, then do one real job\n\nYou are talking to a person who may have never used this before. The goal is that they\nleave with **one finished thing** and an accurate idea of what to come back for.\n\n**Bundled files:** `demo-brief.md` — the canned demo brief, read only when the user\npicks the demo for the `generate` job. The choice-copy rules every question below\nfollows live in `{{skill:create#choice-copy.md}}`.\n\n**Narration mode — this flow only.** Be conversational and a little verbose. Announce\neach step before you take it, and after every `preview` say in one or two sentences\nwhat it just proved (\"I changed only the headline — nothing else re-rolled; that's\nwhat makes this a design file and not a picture\"). Normal design work outside this\nflow keeps the usual concise style.\n\n**Honesty rules, throughout.** Claim only what this server does. Never guess a version\n<!-- requires:diagnostics -->\nnumber — call `diagnostics` if asked. Never disparage image or video generators;\n<!-- /requires:diagnostics -->\n<!-- unless:diagnostics -->\nnumber. Never disparage image or video generators;\n<!-- /unless:diagnostics -->\nCoDesign works with them. Do not promise video.\n\n**Credits: never quote an amount, and never promise a grant.** Say \"credits\" and\n\"more credits\" — never a number, a total, or a per-design estimate, not for the\nsign-in and not for any rung of the ladder in Beat 5. The amounts live on\n<https://img.ly/pricing/> and in the Discord, and change without this server knowing.\nNor can this server verify a Discord join or hand out a credit: the ladder is what\nIMG.LY offers, linked, not something you are granting.\n\n**Terms: link, never paraphrase.** The account, the AI gateway and the credits — how\nthey are earned, and that they expire — are governed by\n<https://img.ly/tos/codesign>. Point at it when the account comes up (Beat 4) and list\nit in the close (Beat 5). Do not summarise a clause, restate a right or a restriction,\nor answer a specific terms question from memory: the page is the authority and it\nchanges without this server knowing. The same discipline as amounts — link, don't\nrecite.\n\n---\n\n## Beat 1 — what this is, in plain words\n\nNo jargon. Do not say \"CE.SDK\", \"engine\", \"session\", \"checkpoint\", \"blocks\" or\n\"scene\". Cover,\nin your own words, about a paragraph:\n\n- **I make a real design document, not a picture of one.** Text stays text, shapes\n stay shapes, layers stay layers.\n- **So one word can change without re-rolling everything.** Ask for a different\n headline and only the headline moves.\n<!-- requires:view -->\n- **You can take over at any point.** Every design I save opens in a browser editor — move\n things yourself, save, and I pick your version up from there.\n<!-- /requires:view -->\n<!-- unless:view -->\n- **You get the source, not just the picture.** Every design comes back as an\n editable design file alongside the finished export.\n<!-- /unless:view -->\n<!-- requires:video -->\n- **It ends in something usable:** print-quality PDF, images in whatever size you\n need, or an mp4 video with its sound.\n<!-- /requires:video -->\n<!-- unless:video -->\n- **It ends in something usable:** print-quality PDF, or images in whatever size you\n need.\n<!-- /unless:video -->\n\n## Beat 2 — the six jobs\n\nPut them on the table, one line each, in plain language. Then ask **one** question —\n_**What would you like to do first?**_ Use your environment's structured question tool\nif it has one (options become chips); otherwise a compact markdown list.\n\nOffer the titles and subtext **verbatim**: they follow the choice-copy rules in\n`{{skill:create#choice-copy.md}}`, which govern every list of choices this server puts to a\nuser. Do not paraphrase them into your own voice.\n\n**Verbatim binds the content, not the English.** If the user writes in another\nlanguage, these cards are written in theirs (the language rule in your instructions) — keep each title's\n`Label: Action phrase` shape, keep them verb-led and pronoun-free, and keep the\nsubtext saying the same thing. What you must not do is drift the _meaning_ or\nre-voice them. The job ids in the first column are values, never translated.\n\n| Job | Card title | Subtext | Then run |\n| ---------- | ------------------------------------------------------ | --------------------------------------------------------------------------------------- | -------------------------------- |\n| `generate` | **Create: Make something** | Builds a deck, poster, flyer, social post, business card, video, or any custom size. | `create` |\n| `import` | **Import: Convert an existing file** | Turns Photoshop, InDesign, PowerPoint, PDF, Lottie animations or images back into something you can edit. | `import`, then the design loop |\n| `resize` | **Resize: Ship one design in different sizes** | Re-composes the layout per format and platform — not just scaled. | `resize` |\n| `rebrand` | **Rebrand: Enforce your brand design rules** | Applies your colors, fonts, and logo across the whole design. | `brand` |\n| `localize` | **Localize: Translate a design to multiple languages** | Keeps the layout intact, right-to-left included. | `localize` |\n| `judge` | **Judge: Give feedback to an existing design** | Scores a design against a rubric, then fixes what's weak. | `judge` |\n\n<!-- requires:view -->\nAlways add the closing line: **however you start, you can finish with a print-ready\nPDF or a link that hands the design to a colleague.** That is not a seventh option —\nit is true of all six.\n\n<!-- /requires:view -->\n<!-- unless:view -->\nAlways add the closing line: **however you start, you finish with a print-ready PDF\nand an editable design file you can keep working on.** That is not a seventh option —\nit is true of all six.\n\n<!-- /unless:view -->\nIf the user answers with something not on this list, take them at their word and go to\nthe closest skill; don't force the menu.\n\n## Beat 3 — the demo, or their own idea?\n\nAsk **one** question — _**How would you like to start?**_ — with these two cards,\nverbatim (in the user's language, on the same terms as Beat 2):\n\n| Card title | Subtext |\n| ----------------------- | -------------------------------------------------------------------------------- |\n| **Use the demo design** | Runs the job you picked on a finished example, so the result appears in seconds. |\n| **Describe an idea** | Runs the job on your own brief instead of the example. |\n\nIf they already described their own idea, skip the question and run it.\n\n**Their own idea** → hand straight to the skill from Beat 2, carrying everything they\nsaid. The `create` skill runs its own intake — do not pre-empt it with questions of\nyour own. Note that the three questions above are about **navigation**, not about the\ndesign: `create` still has to ask its own, and a user who has answered three questions\nalready has not answered any of those.\n\n**The demo** — two paths, by job:\n\n- Job `generate` → **build it in front of them.** Read `demo-brief.md` and run it\n through the normal design loop. Narrate as you go, and `preview` your work.\n\n<!-- requires:login -->\n **Check for `asset_generate` before you start.** This build's hero visual is\n generated, so it needs a free IMG.LY sign-in. If the tool isn't in your list,\n **propose the sign-in first** — one line on why (the demo generates its own artwork),\n then `login`. Never start building and hit the wall halfway. If they'd rather not\n sign in, don't build a degraded version and don't leave an empty slot: load the\n finished design instead (below), say plainly that only the _build_ step needs an\n account, and carry on. Beat 4 then has nothing left to ask — skip it.\n<!-- /requires:login -->\n<!-- unless:login -->\n<!-- unless:asset_generate -->\n **This build's hero visual is generated, and image generation is not available\n here.** Don't build a degraded version and don't leave an empty slot: load the\n finished design instead (below), say plainly that only the _build_ step needs image\n generation, and carry on.\n<!-- /unless:asset_generate -->\n<!-- /unless:login -->\n\n- Jobs `import`, `resize`, `rebrand`, `localize`, `judge` → **rebuild nothing.**\n Load the finished demo in one call:\n\n ```\n import({ source: { demo: \"cybernews\" } })\n ```\n\n Then do the job they picked on it and show the result against the original: resize\n it to a story format, restyle it to a brand, localize it, or run the `judge` gate\n over it. That contrast is the point — a variation appears in seconds and nothing was\n regenerated from scratch.\n\n<!-- requires:view -->\nWhichever path ran, the work is already saved: every change goes to the design, and the\neditor shows it. Give them the `view` link, plus an `export` (`pdf`, `png`, …) when a\ndeliverable makes sense for that job. Say explicitly that the link is live and\neditable, and that whatever they change there comes back to you.\n\n<!-- /requires:view -->\n<!-- unless:view -->\nWhichever path ran, finish with two `export` calls — the deliverable that fits the job\n(`pdf` for print, `png`/`jpeg` for screen) and `format: \"imgly\"` for the editable\ndesign file — and tell them where both files are. Say explicitly that the `.imgly` is\nthe working copy: hand it back any time and you carry on from it.\n\n<!-- /unless:view -->\n## Beat 4 — the optional account (ask once)\n\nDo this **after** the job, once, and never raise it again in the session.\n\n<!-- requires:login -->\nFirst check what is actually available: if `asset_generate` is already in your tool\nlist, say so in one line — image generation is on, nothing to do — and skip the rest\nof this beat.\n\nOtherwise, say this honestly:\n\n> Everything you just saw ran with **no account and no API key** — that's the normal\n> way to use this. If you want more, a free IMG.LY sign-in adds the **AI Gateway**: I\n> can generate images from a prompt and drop them into the design as a real layer —\n> the floating glass cubes in the demo design were made exactly that way. Signing in\n> comes with credits to spend on it, and it covers commercial\n> licensing when you get there.\n\nThen ask **one** question — _**How would you like to continue?**_ — with these two\ncards, verbatim (in the user's language, on the same terms as Beat 2):\n\n| Card title | Subtext |\n| ------------------------------- | ---------------------------------------------------------------------------- |\n| **Sign in to IMG.LY** | Free. Adds image generation, and starts you off with credits to spend on it. |\n| **Continue without an account** | Everything except image generation keeps working exactly as it does now. |\n\nOn the first, call `login` — it opens their browser and returns immediately; call\n`login` again to confirm once they're back. On the second, drop it cheerfully:\neverything except image generation works exactly the same.\n\n**Point at the terms once, when the account comes up — don't paraphrase them.** One\nline alongside the question: the account, the gateway and the credits are covered by\nthe CoDesign terms of service, <https://img.ly/tos/codesign>. Link it and move on. You\nare not the authority on what the terms say: never summarise a clause, never state a\nright or a restriction they don't ask about, and if they do ask something specific,\nsend them to the page rather than answering from the description above.\n<!-- /requires:login -->\n<!-- unless:login -->\n<!-- requires:asset_generate -->\nImage generation is already on here: say so in one line — nothing to do.\n<!-- /requires:asset_generate -->\n<!-- unless:asset_generate -->\nThere is no sign-in on this server: mention the account only as a pointer\n(<https://img.ly/signup>) and ask nothing.\n<!-- /unless:asset_generate -->\n<!-- /unless:login -->\n\n## Beat 5 — close\n\nTwo short blocks, no wall of text.\n\n**First, where they stand.** Print the ladder as a checklist, ticking only what\nactually happened:\n\n```\nWhere you stand:\n ✓ Install CoDesign free, and stays free\n ✓ Sign in to IMG.LY credits added\n □ Join the Discord → more credits\n □ Post a design in #showcase → more credits\n □ Get a design featured → the biggest top-up; we pick one every Friday\n\n Discord https://discord.gg/tCRKuykXQN\n More https://img.ly/pricing/\n Terms https://img.ly/tos/codesign\n```\n\nRow 1 is always ticked — installing is free and stays free.\n<!-- requires:login -->\nRow 2 is ticked **only if `login` actually succeeded in this session**; if they\ndeclined, leave it unticked and point at <https://img.ly/signup>.\n<!-- /requires:login -->\n<!-- unless:login -->\nRow 2 stays unticked — there is no sign-in on this server; point at\n<https://img.ly/signup>.\n<!-- /unless:login -->\nRows 3–5 are never ticked: you have no way to know, and guessing would breach the\nhonesty rules.\n\nThe code fence is a layout, not a string: write the rows in the user's language\n(the language rule in your instructions). The three URLs and `#showcase` are values and stay exactly as they are.\n\n**Then, three short lines:**\n\n1. **Three starter prompts they can copy**, tailored to the job they picked (e.g.\n _\"resize this to a LinkedIn banner and an A4 poster\"_, _\"restyle it in our brand\n colors #0b0b0b and #ff4d2e\"_, _\"make a German and an Arabic edition\"_).\n2. Asking for the `onboard` skill brings this back any time; `/codesign <brief>` starts a new design directly.\n3. One line, only if they seem to be building software: this runs on IMG.LY's CE.SDK —\n the same design layer is available as an SDK.\n\n**Last line of the whole flow**, as an afterthought and not a lead:\n\n> Credits expire three months after they land — no rush, but they don't wait forever.\n",
|
|
60
|
-
"docs/onboard/demo-brief.md": "# The demo brief\n\nThe canned brief behind the `generate` job's demo — build it through the normal\ndesign loop, exactly as if the user had asked for it.\n\n<!-- requires:login -->\n**This build needs image generation, so it needs an account.** The hero visual is\ngenerated with `asset_generate`, which requires a free IMG.LY sign-in. Do **not**\nstart building and discover this halfway: check for `asset_generate` in your tool\nlist **before** you begin, and if it isn't there, propose the free sign-in first (call\n`login`, then continue once they're back). If they'd rather not sign in, don't build a\ndegraded version and don't leave an empty slot — load the finished design instead\n(`import({ source: { demo: \"cybernews\" } })`), say plainly that the build step needs an\naccount for the image but the design itself doesn't, and carry on with the flow. Beat 4\nthen has nothing left to ask.\n<!-- /requires:login -->\n<!-- unless:login -->\n<!-- unless:asset_generate -->\n**This build needs image generation, which this server does not offer.** Don't build a\ndegraded version and don't leave an empty slot — load the finished design instead\n(`import({ source: { demo: \"cybernews\" } })`), say plainly that the build step needs\nimage generation but the design itself doesn't, and carry on with the flow.\n<!-- /unless:asset_generate -->\n<!-- /unless:login -->\n\nThe same design ships finished as `import({ source: { demo: \"cybernews\" } })` — use that\nfor the import / resize / rebrand / localize / judge demos instead of rebuilding it.\n\n---\n\n## Secure Grid — cybersecurity growth report, Instagram post\n\nA data-editorial social post in a modern brutalist register: one massive statistic\nanchoring a dark, grainy canvas, with floating translucent cubes overlapping the\nheadline for depth.\n\n**Format** — 1080 × 1350 px, single page. Instagram portrait (this is a **4:5** ratio —\nnot 4:3, whatever the source brief called it). Strict **80 px** safe-zone margin on all\nsides.\n\n**Palette** — Deep Charcoal `#121212` (background) · Acid Lime `#D1FF00` (the single\naccent) · Optical White `#FFFFFF` (ink). Acid Lime is the **only** vibrant colour on\nthe canvas and appears on exactly two things: the `24%` metric and the `$140 Billion`\namount. Anything else in lime breaks the anchor.\n\n**Typography** — Inter only, weights 400/500/700/800. All sizes are absolute pixels.\nNo emoji anywhere; use Unicode glyphs (`›`, `█`) where a symbol is wanted.\n\n**Layout, back to front**\n\n1. **Background** — solid `#121212` with heavy digital noise / analog film grain. Matte,\n non-reflective. The grain is the surface, not a texture image pasted on top.\n2. **Hero visual** — three to four abstract 3D translucent glass cubes with glowing\n neon-green internal cores, at varied angles, floating asymmetrically from the\n top-left toward the centre-right. Glassmorphism: real refraction, soft glowing\n edges. The cubes fill the frame and **partially overlap the headline** — that\n overlap is what creates depth, so don't tuck them into a corner and don't crop them.\n<!-- requires:asset_generate -->\n Generate this with `asset_generate` (see the account note above).\n<!-- /requires:asset_generate -->\n3. **Top-left brand** — `█ GRID`, 32 px.\n4. **Top-right brand** — `CYBERARCHIVE®`, 28 px, white.\n5. **Context label (mid-left)** — a pill-shaped **outline** chip reading `FinTech Sector ›`.\n Build it as a text block with a native text background (§6.5.1) — never a rectangle\n behind floating text.\n6. **Headline** — `Cloud Vulnerability / Projected to Drop by`, 80 px, bold, white.\n7. **Billboard metric** — `24%` at **240 px**, bold, Acid Lime. This is the visual\n anchor; everything else defers to it.\n8. **Financial sub-text** — `Saving Companies Over $140 Billion Annually` at 38 px, with\n `$140 Billion` in Acid Lime inside a Unicode oval outline.\n9. **Bottom-left metadata** — `INNOVATIVE / SECURITY LABS`, 22 px, stacked on two lines.\n10. **Bottom-right date** — `© 2026`, 22 px.\n\n**Deliverables** — a `preview` of the page at 1080 × 1350, and, if the user wants a\nfile, an export. Run the `judge` gate before calling it done, as with any design.\n",
|
|
59
|
+
"docs/onboard/SKILL.md": "---\nname: onboard\ndescription: >-\n Use when the user is new here or asks what this server is / what it\n can do (\"what is CoDesign\", \"what can you make\", \"show me\"). A guided, plain-language\n introduction for a HUMAN: explain what CoDesign is in everyday terms, put the six\n jobs it does on the table, let the user pick one, then run it either on the bundled\n demo design or on the user's own idea — closing with the optional (never required)\n IMG.LY sign-in and the ways to earn more credits. Not a design manual: the `api` and `judge`\n skills remain the required reads before any edit.\nrequires: import, export, drafts, interactive\n---\n\n# onboard — introduce CoDesign, then do one real job\n\nYou are talking to a person who may have never used this before. The goal is that they\nleave with **one finished thing** and an accurate idea of what to come back for.\n\n<!-- requires:import.demo -->\n**Bundled files:** `demo-brief.md` — the canned demo brief, read only when the user\npicks the demo for the `generate` job. The choice-copy rules every question below\nfollows live in `{{skill:create#choice-copy.md}}`.\n<!-- /requires:import.demo -->\n<!-- unless:import.demo -->\n**Bundled files:** `demo-brief.md` — the canned demo brief, read when the user picks\nthe demo, for any job. The choice-copy rules every question below follows live in\n`{{skill:create#choice-copy.md}}`.\n<!-- /unless:import.demo -->\n\n**Narration mode — this flow only.** Be conversational and a little verbose. Announce\neach step before you take it, and after every `preview` say in one or two sentences\nwhat it just proved (\"I changed only the headline — nothing else re-rolled; that's\nwhat makes this a design file and not a picture\"). Normal design work outside this\nflow keeps the usual concise style.\n\n**Honesty rules, throughout.** Claim only what this server does. Never guess a version\n<!-- requires:diagnostics -->\nnumber — call `diagnostics` if asked. Never disparage image or video generators;\n<!-- /requires:diagnostics -->\n<!-- unless:diagnostics -->\nnumber. Never disparage image or video generators;\n<!-- /unless:diagnostics -->\nCoDesign works with them. Do not promise video.\n\n**Credits: never quote an amount, and never promise a grant.** Say \"credits\" and\n\"more credits\" — never a number, a total, or a per-design estimate, not for the\nsign-in and not for any rung of the ladder in Beat 5. The amounts live on\n<https://img.ly/pricing/> and in the Discord, and change without this server knowing.\nNor can this server verify a Discord join or hand out a credit: the ladder is what\nIMG.LY offers, linked, not something you are granting.\n\n**Terms: link, never paraphrase.** The account, the AI gateway and the credits — how\nthey are earned, and that they expire — are governed by\n<https://img.ly/tos/codesign>. Point at it when the account comes up (Beat 4) and list\nit in the close (Beat 5). Do not summarise a clause, restate a right or a restriction,\nor answer a specific terms question from memory: the page is the authority and it\nchanges without this server knowing. The same discipline as amounts — link, don't\nrecite.\n\n---\n\n## Beat 1 — what this is, in plain words\n\nNo jargon. Do not say \"CE.SDK\", \"engine\", \"session\", \"checkpoint\", \"blocks\" or\n\"scene\". Cover,\nin your own words, about a paragraph:\n\n- **I make a real design document, not a picture of one.** Text stays text, shapes\n stay shapes, layers stay layers.\n- **So one word can change without re-rolling everything.** Ask for a different\n headline and only the headline moves.\n<!-- requires:view -->\n- **You can take over at any point.** Every design I save opens in a browser editor — move\n things yourself, save, and I pick your version up from there.\n<!-- /requires:view -->\n<!-- unless:view -->\n- **You get the source, not just the picture.** Every design comes back as an\n editable design file alongside the finished export.\n<!-- /unless:view -->\n<!-- requires:video -->\n- **It ends in something usable:** print-quality PDF, images in whatever size you\n need, or an mp4 video with its sound.\n<!-- /requires:video -->\n<!-- unless:video -->\n- **It ends in something usable:** print-quality PDF, or images in whatever size you\n need.\n<!-- /unless:video -->\n\n## Beat 2 — the six jobs\n\nPut them on the table, one line each, in plain language. Then ask **one** question —\n_**What would you like to do first?**_ Use your environment's structured question tool\nif it has one (options become chips); otherwise a compact markdown list.\n\nOffer the titles and subtext **verbatim**: they follow the choice-copy rules in\n`{{skill:create#choice-copy.md}}`, which govern every list of choices this server puts to a\nuser. Do not paraphrase them into your own voice.\n\n**Verbatim binds the content, not the English.** If the user writes in another\nlanguage, these cards are written in theirs (the language rule in your instructions) — keep each title's\n`Label: Action phrase` shape, keep them verb-led and pronoun-free, and keep the\nsubtext saying the same thing. What you must not do is drift the _meaning_ or\nre-voice them. The job ids in the first column are values, never translated.\n\n| Job | Card title | Subtext | Then run |\n| ---------- | ------------------------------------------------------ | --------------------------------------------------------------------------------------- | -------------------------------- |\n| `generate` | **Create: Make something** | Builds a deck, poster, flyer, social post, business card, video, or any custom size. | `create` |\n| `import` | **Import: Convert an existing file** | Turns Photoshop, InDesign, PowerPoint, PDF, Figma, Lottie animations or images back into something you can edit. | `import`, then the design loop |\n| `resize` | **Resize: Ship one design in different sizes** | Re-composes the layout per format and platform — not just scaled. | `resize` |\n| `rebrand` | **Rebrand: Enforce your brand design rules** | Applies your colors, fonts, and logo across the whole design. | `brand` |\n| `localize` | **Localize: Translate a design to multiple languages** | Keeps the layout intact, right-to-left included. | `localize` |\n| `judge` | **Judge: Give feedback to an existing design** | Scores a design against a rubric, then fixes what's weak. | `judge` |\n\n<!-- requires:view -->\nAlways add the closing line: **however you start, you can finish with a print-ready\nPDF or a link that hands the design to a colleague.** That is not a seventh option —\nit is true of all six.\n\n<!-- /requires:view -->\n<!-- unless:view -->\nAlways add the closing line: **however you start, you finish with a print-ready PDF\nand an editable design file you can keep working on.** That is not a seventh option —\nit is true of all six.\n\n<!-- /unless:view -->\nIf the user answers with something not on this list, take them at their word and go to\nthe closest skill; don't force the menu.\n\n## Beat 3 — the demo, or their own idea?\n\nAsk **one** question — _**How would you like to start?**_ — with these two cards,\nverbatim (in the user's language, on the same terms as Beat 2):\n\n| Card title | Subtext |\n| ----------------------- | -------------------------------------------------------------------------------- |\n<!-- requires:import.demo -->\n| **Use the demo design** | Runs the job you picked on a finished example, so the result appears in seconds. |\n<!-- /requires:import.demo -->\n<!-- unless:import.demo -->\n| **Use the demo design** | Runs the job you picked on an example design, built for you first. |\n<!-- /unless:import.demo -->\n| **Describe an idea** | Runs the job on your own brief instead of the example. |\n\nIf they already described their own idea, skip the question and run it.\n\n**Their own idea** → hand straight to the skill from Beat 2, carrying everything they\nsaid. The `create` skill runs its own intake — do not pre-empt it with questions of\nyour own. Note that the three questions above are about **navigation**, not about the\ndesign: `create` still has to ask its own, and a user who has answered three questions\nalready has not answered any of those.\n\n**The demo** — two paths, by job:\n\n- Job `generate` → **build it in front of them.** Read `demo-brief.md` and run it\n through the normal design loop. Narrate as you go, and `preview` your work.\n\n<!-- requires:login -->\n<!-- requires:import.demo -->\n **Check for `asset_generate` before you start.** This build's hero visual is\n generated, so it needs a free IMG.LY sign-in. If the tool isn't in your list,\n **propose the sign-in first** — one line on why (the demo generates its own artwork),\n then `login`. Never start building and hit the wall halfway. If they'd rather not\n sign in, don't build a degraded version and don't leave an empty slot: load the\n finished design instead (below), say plainly that only the _build_ step needs an\n account, and carry on. Beat 4 then has nothing left to ask — skip it.\n<!-- /requires:import.demo -->\n<!-- unless:import.demo -->\n **Check for `asset_generate` before you start.** This build's hero visual is\n generated, so it needs a free IMG.LY sign-in. If the tool isn't in your list,\n **propose the sign-in first** — one line on why (the demo generates its own artwork),\n then `login`. Never start building and hit the wall halfway. If they'd rather not\n sign in, don't build a degraded version and don't leave an empty slot: offer to run\n the job on an idea of their own instead.\n<!-- /unless:import.demo -->\n<!-- /requires:login -->\n<!-- unless:login -->\n<!-- unless:asset_generate -->\n<!-- requires:import.demo -->\n **This build's hero visual is generated, and image generation is not available\n here.** Don't build a degraded version and don't leave an empty slot: load the\n finished design instead (below), say plainly that only the _build_ step needs image\n generation, and carry on.\n<!-- /requires:import.demo -->\n<!-- unless:import.demo -->\n **This build's hero visual is generated, and image generation is not available\n here.** Don't build a degraded version and don't leave an empty slot: offer to run\n the job on an idea of their own instead.\n<!-- /unless:import.demo -->\n<!-- /unless:asset_generate -->\n<!-- /unless:login -->\n\n<!-- requires:import.demo -->\n- Jobs `import`, `resize`, `rebrand`, `localize`, `judge` → **rebuild nothing.**\n Load the finished demo in one call:\n\n ```\n import({ source: { demo: \"cybernews\" } })\n ```\n\n Then do the job they picked on it and show the result against the original: resize\n it to a story format, restyle it to a brand, localize it, or run the `judge` gate\n over it. That contrast is the point — a variation appears in seconds and nothing was\n regenerated from scratch.\n<!-- /requires:import.demo -->\n<!-- unless:import.demo -->\n- Jobs `import`, `resize`, `rebrand`, `localize`, `judge` → **build the demo first**,\n as for `generate` above, and say so in one line. Then do the job they picked on it\n and show the result against the original: resize it to a story format, restyle it to\n a brand, localize it, or run the `judge` gate over it. That contrast is the point —\n the variation changes only what the job asks and regenerates nothing.\n<!-- /unless:import.demo -->\n\n<!-- requires:view -->\nWhichever path ran, the work is already saved: every change goes to the design, so tell\nthem they can come back to it any time, and add an `export` (`pdf`, `png`, …) when a\ndeliverable makes sense for that job.\nHand out a `view` link only when they ask to see or change the design themselves.\n\n<!-- /requires:view -->\n<!-- unless:view -->\nWhichever path ran, finish with two `export` calls — the deliverable that fits the job\n(`pdf` for print, `png`/`jpeg` for screen) and `format: \"imgly\"` for the editable\ndesign file — and tell them where both files are. Say explicitly that the `.imgly` is\nthe working copy: hand it back any time and you carry on from it.\n\n<!-- /unless:view -->\n## Beat 4 — the optional account (ask once)\n\nDo this **after** the job, once, and never raise it again in the session.\n\n<!-- requires:login -->\nFirst check what is actually available: if `asset_generate` is already in your tool\nlist, say so in one line — image generation is on, nothing to do — and skip the rest\nof this beat.\n\nOtherwise, say this honestly:\n\n> Everything you just saw ran with **no account and no API key** — that's the normal\n> way to use this. If you want more, a free IMG.LY sign-in adds the **AI Gateway**: I\n> can generate images from a prompt and drop them into the design as a real layer —\n> the floating glass cubes in the demo design were made exactly that way. Signing in\n> comes with credits to spend on it, and it covers commercial\n> licensing when you get there.\n\nThen ask **one** question — _**How would you like to continue?**_ — with these two\ncards, verbatim (in the user's language, on the same terms as Beat 2):\n\n| Card title | Subtext |\n| ------------------------------- | ---------------------------------------------------------------------------- |\n| **Sign in to IMG.LY** | Free. Adds image generation, and starts you off with credits to spend on it. |\n| **Continue without an account** | Everything except image generation keeps working exactly as it does now. |\n\nOn the first, call `login` — it opens their browser and returns immediately; call\n`login` again to confirm once they're back. On the second, drop it cheerfully:\neverything except image generation works exactly the same.\n\n**Point at the terms once, when the account comes up — don't paraphrase them.** One\nline alongside the question: the account, the gateway and the credits are covered by\nthe CoDesign terms of service, <https://img.ly/tos/codesign>. Link it and move on. You\nare not the authority on what the terms say: never summarise a clause, never state a\nright or a restriction they don't ask about, and if they do ask something specific,\nsend them to the page rather than answering from the description above.\n<!-- /requires:login -->\n<!-- unless:login -->\n<!-- requires:asset_generate -->\nImage generation is already on here: say so in one line — nothing to do.\n<!-- /requires:asset_generate -->\n<!-- unless:asset_generate -->\nThere is no sign-in on this server: mention the account only as a pointer\n(<https://img.ly/signup>) and ask nothing.\n<!-- /unless:asset_generate -->\n<!-- /unless:login -->\n\n## Beat 5 — close\n\nTwo short blocks, no wall of text.\n\n**First, where they stand.** Print the ladder as a checklist, ticking only what\nactually happened:\n\n```\nWhere you stand:\n ✓ Install CoDesign free, and stays free\n ✓ Sign in to IMG.LY credits added\n □ Join the Discord → more credits\n □ Post a design in #showcase → more credits\n □ Get a design featured → the biggest top-up; we pick one every Friday\n\n Discord https://discord.gg/tCRKuykXQN\n More https://img.ly/pricing/\n Terms https://img.ly/tos/codesign\n```\n\nRow 1 is always ticked — installing is free and stays free.\n<!-- requires:login -->\nRow 2 is ticked **only if `login` actually succeeded in this session**; if they\ndeclined, leave it unticked and point at <https://img.ly/signup>.\n<!-- /requires:login -->\n<!-- unless:login -->\nRow 2 stays unticked — there is no sign-in on this server; point at\n<https://img.ly/signup>.\n<!-- /unless:login -->\nRows 3–5 are never ticked: you have no way to know, and guessing would breach the\nhonesty rules.\n\nThe code fence is a layout, not a string: write the rows in the user's language\n(the language rule in your instructions). The three URLs and `#showcase` are values and stay exactly as they are.\n\n**Then, three short lines:**\n\n1. **Three starter prompts they can copy**, tailored to the job they picked (e.g.\n _\"resize this to a LinkedIn banner and an A4 poster\"_, _\"restyle it in our brand\n colors #0b0b0b and #ff4d2e\"_, _\"make a German and an Arabic edition\"_).\n2. Asking for the `onboard` skill brings this back any time; `/codesign <brief>` starts a new design directly.\n3. One line, only if they seem to be building software: this runs on IMG.LY's CE.SDK —\n the same design layer is available as an SDK.\n\n**Last line of the whole flow**, as an afterthought and not a lead:\n\n> Credits expire three months after they land — no rush, but they don't wait forever.\n",
|
|
60
|
+
"docs/onboard/demo-brief.md": "# The demo brief\n\nThe canned brief behind the `generate` job's demo — build it through the normal\ndesign loop, exactly as if the user had asked for it.\n\n<!-- requires:login -->\n**This build needs image generation, so it needs an account.** The hero visual is\ngenerated with `asset_generate`, which requires a free IMG.LY sign-in. Do **not**\nstart building and discover this halfway: check for `asset_generate` in your tool\nlist **before** you begin, and if it isn't there, propose the free sign-in first (call\n<!-- requires:import.demo -->\n`login`, then continue once they're back). If they'd rather not sign in, don't build a\ndegraded version and don't leave an empty slot — load the finished design instead\n(`import({ source: { demo: \"cybernews\" } })`), say plainly that the build step needs an\naccount for the image but the design itself doesn't, and carry on with the flow. Beat 4\nthen has nothing left to ask.\n<!-- /requires:import.demo -->\n<!-- unless:import.demo -->\n`login`, then continue once they're back). If they'd rather not sign in, don't build a\ndegraded version and don't leave an empty slot — offer to run the job on an idea of\ntheir own instead.\n<!-- /unless:import.demo -->\n<!-- /requires:login -->\n<!-- unless:login -->\n<!-- unless:asset_generate -->\n<!-- requires:import.demo -->\n**This build needs image generation, which this server does not offer.** Don't build a\ndegraded version and don't leave an empty slot — load the finished design instead\n(`import({ source: { demo: \"cybernews\" } })`), say plainly that the build step needs\nimage generation but the design itself doesn't, and carry on with the flow.\n<!-- /requires:import.demo -->\n<!-- unless:import.demo -->\n**This build needs image generation, which this server does not offer.** Don't build a\ndegraded version and don't leave an empty slot — offer to run the job on an idea of\ntheir own instead.\n<!-- /unless:import.demo -->\n<!-- /unless:asset_generate -->\n<!-- /unless:login -->\n\n<!-- requires:import.demo -->\nThe same design ships finished as `import({ source: { demo: \"cybernews\" } })` — use that\nfor the import / resize / rebrand / localize / judge demos instead of rebuilding it.\n<!-- /requires:import.demo -->\n<!-- unless:import.demo -->\nBuild this same design for the import / resize / rebrand / localize / judge demos too,\nthen run the job on it.\n<!-- /unless:import.demo -->\n\n---\n\n## Secure Grid — cybersecurity growth report, Instagram post\n\nA data-editorial social post in a modern brutalist register: one massive statistic\nanchoring a dark, grainy canvas, with floating translucent cubes overlapping the\nheadline for depth.\n\n**Format** — 1080 × 1350 px, single page. Instagram portrait (this is a **4:5** ratio —\nnot 4:3, whatever the source brief called it). Strict **80 px** safe-zone margin on all\nsides.\n\n**Palette** — Deep Charcoal `#121212` (background) · Acid Lime `#D1FF00` (the single\naccent) · Optical White `#FFFFFF` (ink). Acid Lime is the **only** vibrant colour on\nthe canvas and appears on exactly two things: the `24%` metric and the `$140 Billion`\namount. Anything else in lime breaks the anchor.\n\n**Typography** — Inter only, weights 400/500/700/800. All sizes are absolute pixels.\nNo emoji anywhere; use Unicode glyphs (`›`, `█`) where a symbol is wanted.\n\n**Layout, back to front**\n\n1. **Background** — solid `#121212` with heavy digital noise / analog film grain. Matte,\n non-reflective. The grain is the surface, not a texture image pasted on top.\n2. **Hero visual** — three to four abstract 3D translucent glass cubes with glowing\n neon-green internal cores, at varied angles, floating asymmetrically from the\n top-left toward the centre-right. Glassmorphism: real refraction, soft glowing\n edges. The cubes fill the frame and **partially overlap the headline** — that\n overlap is what creates depth, so don't tuck them into a corner and don't crop them.\n<!-- requires:asset_generate -->\n Generate this with `asset_generate` (see the account note above).\n<!-- /requires:asset_generate -->\n3. **Top-left brand** — `█ GRID`, 32 px.\n4. **Top-right brand** — `CYBERARCHIVE®`, 28 px, white.\n5. **Context label (mid-left)** — a pill-shaped **outline** chip reading `FinTech Sector ›`.\n Build it as a text block with a native text background (§6.5.1) — never a rectangle\n behind floating text.\n6. **Headline** — `Cloud Vulnerability / Projected to Drop by`, 80 px, bold, white.\n7. **Billboard metric** — `24%` at **240 px**, bold, Acid Lime. This is the visual\n anchor; everything else defers to it.\n8. **Financial sub-text** — `Saving Companies Over $140 Billion Annually` at 38 px, with\n `$140 Billion` in Acid Lime inside a Unicode oval outline.\n9. **Bottom-left metadata** — `INNOVATIVE / SECURITY LABS`, 22 px, stacked on two lines.\n10. **Bottom-right date** — `© 2026`, 22 px.\n\n**Deliverables** — a `preview` of the page at 1080 × 1350, and, if the user wants a\nfile, an export. Run the `judge` gate before calling it done, as with any design.\n",
|
|
61
61
|
"docs/resize/SKILL.md": "---\nname: resize\ndescription: >-\n Use when resizing or reformatting a CoDesign / CE.SDK design to a new size or aspect ratio\n (ig-post ↔ ig-square ↔ ig-story ↔ widescreen, or a custom W×H); when building the size/format\n editions of a design from an existing design or from a brief; or when a reformatted\n edition has a dead void / letterboxed empty band, drifted or broken margins, off-canvas or\n clipped elements, mis-scaled decoration, or a stretched / squished layout. Also for animated /\n video designs: timed blocks, animations, captions, and audio carried into each edition.\n---\n\n# resize\n\n<!-- requires:export -->\nPoint this skill at the current design and one or more target formats, and it produces or repairs the size/format editions by **re-composing** each for its new aspect. It operates on the **design in the current session**, and each produced format is **exported as its own `.imgly` file**. Single home for the resize workflow, the re-composition technique, and the reformat **no-goes**.\n<!-- /requires:export -->\n<!-- unless:export -->\nPoint this skill at the current design and one or more target formats, and it produces or repairs the size/format editions by **re-composing** each for its new aspect. It operates on the **design in the current session** — the product opens one session per target format, each holding the source, so re-compose the design in front of you for its one format. Single home for the resize workflow, the re-composition technique, and the reformat **no-goes**.\n<!-- /unless:export -->\n\n<!-- requires:export -->\n**The one mechanic to understand before anything else.** A session holds one design, so N formats are produced in sequence, not in parallel, and the **exported source file is what you return to between them**:\n\n```\nexport({ format: 'imgly' }) → SOURCE_URI (export the source FIRST)\nper format:\n<!-- requires:open -->\n import({ source: { uri: SOURCE_URI } }) → a copy of the source is the session\n<!-- /requires:open -->\n<!-- unless:open -->\n<!-- requires:version -->\n import({ source: { uri: SOURCE_URI } }) → a copy of the source: a new design, with its own design and version\n<!-- /requires:version -->\n<!-- unless:version -->\n import({ source: { uri: SOURCE_URI } }) → the source replaces the session; its save is a new file\n<!-- /unless:version -->\n<!-- /unless:open -->\n edit(…) re-compose for the new canvas\n preview() → check it\n export({ format: 'imgly' }) → this format's own file\n```\n\nExport the source before you touch it. Re-importing is what makes every format a re-composition **of the source** rather than of the previous format — and it is why \"never resize a resize\" is a mechanical rule here, not just advice.\n<!-- unless:open -->\n<!-- unless:version -->\n**Check each save's returned `uri` is not `SOURCE_URI`** (re-saving a session revises one file) — a format that landed back on the source overwrote the thing every other format is built from.\n<!-- /unless:version -->\n<!-- /unless:open -->\n\n<!-- /requires:export -->\n<!-- unless:export -->\n**The one mechanic to understand before anything else.** A session holds one design, and the product opens one session per target format, each starting from the source — so every format is a re-composition **of the source**, never of another format (\"never resize a resize\"). Capture the source's layout **before** your first change: once you edit, the session holds nothing else to go back to.\n\n<!-- /unless:export -->\nBuilds on two things it does _not_ restate: design rules §6.3 Hierarchy + §6.4 Composition & grid (margins as % of the shortest dimension, the spacing ladder, balanced whitespace / no dead void, nothing off-canvas) and §6.1.2 type-scale bands; and the `api` skill's engine mechanics (the `text.font` declaration, auto-reshape, `loadResources`). For the _same-aspect, translate-the-strings_ case, use the `localize` skill instead.\n\n**Scoring:** reformatting is judged with the `judge` skill — every applicable axis ≥ 8. A dead void, a stretched element, a broken margin, or anything off-canvas fails **composition**.\n\n## Reference files (load on demand)\n\nThis `SKILL.md` holds the always-needed spine: inputs, the localize-vs-resize distinction, core\nprinciple, workflow, the re-composition routine, the no-goes, and the **resize composition\nchecklist** (end of this file). Per-format data lives in the **`formats` skill** — exact W×H,\naspect, and platform safe zones, one file per format: `{{skill:formats}}` for the index,\n`{{skill:formats#<id>.md}}` for the format(s) you're building.\n\nBuilding several editions of one design, or re-applying a fix to editions you already built: the\n**master → editions** workflow, `{{skill:resize#editions.md}}`.\n<!-- requires:video -->\nFor an animated or video design, read **Video and animated designs** below as well.\n<!-- /requires:video -->\n\n## Localize vs resize — snap vs re-compose\n\n**Format is the outer distinction: a different format is a different layout; a different language is the same layout with different strings.**\n\n- **localize** — _same_ canvas: change words + the script's font, then **snap every block\n back to the reference geometry**. Any geometry deviation is drift.\n- **resize** — _new_ canvas: the geometry **must** change. You **re-derive** the layout\n from the design system on the new canvas. Here \"drift\" is not \"moved from the reference\" — it's\n re-composition that **loses the design's identity** or leaves the canvas **unbalanced**.\n\nNever confuse the two: don't snap a resize (that reproduces the source's proportions on the wrong\ncanvas → a dead void), and don't re-compose a localization (that's how localized sets drift).\n\n## Inputs — what to resize, and into what\n\n<!-- requires:interactive -->\nTwo inputs, resolved before any work by the intake contract — derive, ask once, echo, invent\nnothing: `{{skill:create#intake.md}}`. **R** = required, no default; **A** =\nask if underived; **D** = defaultable.\n<!-- /requires:interactive -->\n<!-- unless:interactive -->\nTwo inputs, resolved before any work by the intake contract — derive, decide what is missing,\necho, invent nothing: `{{skill:create#intake.md}}`. **R** = required, no default; **A** = has a default, resolved by the intake when underived; **D** = defaultable.\n<!-- /unless:interactive -->\n\n| Parameter | Kind | Chips / values | Default |\n| -------------- | ------- | ---------------------------------------------------------------------------------------------------- | --------------------------------- |\n| target formats | **R** | `Instagram post` · `Instagram story` · `LinkedIn` · `Widescreen` · `A4 print` · `Custom W×H` · Other | none |\n| source design | derived | — | the design in the current session |\n\n<!-- requires:export -->\n**1. The source** — the design in the current session. **Export it as `.imgly` first** (`export({ format: 'imgly' })`) and hold onto its `uri`: every target format is re-composed _from_ that file — **never resize a resize** (don't chain; re-import the source between formats).\n<!-- requires:open -->\nIf the user asks to resize a design saved earlier, its `uri` IS the source `uri`: `open` it to `preview` and capture it, skip the first export, then `import` a copy of it per format.\n<!-- /requires:open -->\n<!-- unless:open -->\n<!-- requires:version -->\nIf the user asks to resize a design saved earlier, its `design` IS the source: `preview` it and capture it, skip the first export, then `import` a copy of it per format.\n<!-- /requires:version -->\n<!-- unless:version -->\nIf the user asks to resize a design saved earlier, load it with `import({ source: { uri: '<its uri>' } })`.\n<!-- /unless:version -->\n<!-- /unless:open -->\nIf the request is a brief (no design exists yet), **build the native base first** at the brief's canvas per design rules §6, preview and sanity-check it, then export it as `.imgly` and treat that file as the source.\n<!-- /requires:export -->\n<!-- unless:export -->\n**1. The source** — the design in the current session, which the product opened for this one target format. Capture its layout before you change anything (Workflow step 1) — **never resize a resize**. If the request is a brief (no design exists yet), build it at the target format with the `create` skill instead.\n<!-- /unless:export -->\n\n**2. The formats** — named formats (`ig-post`, `ig-square`, `ig-story`, `widescreen`, and the\nrest of the `formats` skill's index) or a custom `W×H`. Resolve each named format's exact size,\naspect, and safe zones from the **`formats` skill** (`{{skill:formats#<id>.md}}`).\n\n<!-- requires:interactive -->\nIf the format set is not stated, **ask** — _**Which sizes do you need?**_ — with the chips above;\na format set has no sensible default, so never pick one for the user. Then echo the resolved set\n(\"1 design → 3 formats\") before building.\n<!-- /requires:interactive -->\n<!-- unless:interactive -->\nIf the format set is not stated, change nothing and say in your reply which sizes you need: a\nformat set has no sensible default, so never pick one for the user. Otherwise echo the resolved\nset (\"1 design → 3 formats\") before building.\n<!-- /unless:interactive -->\n\n## Core principle — re-compose for the aspect, preserve the system\n\nA new format is a **new layout**. Re-lay it out for the new canvas while holding the **design\nsystem** constant:\n\n- **Invariant (carry to every format):** palette + the single accent; type-scale _bands_ (headline\n / body / caption as % of page height, §6.1.2); margin ratio (§6.4: 8–12% of the shortest side);\n spacing scale (§6.4 ladder); hierarchy order (§6.3); the **group hierarchy** (carry the source's\n grouping — re-group each cluster after re-composition, don't ship a flattened tree); the **region\n of interest** of every image/video fill (the subject stays framed — see the ROI section below);\n each decoration's _role_ (a ghost quote stays a ghost quote); the **element inventory** (every\n content cluster on the source has a counterpart on the new canvas — see below); and the\n **appearance** of every block (fill/gradient, effect/blur stack, opacity, corner radius, stroke,\n<!-- requires:import -->\n shadow, and font weight — carried in by re-importing the source, not re-created by eye).\n<!-- /requires:import -->\n<!-- unless:import -->\n shadow, and font weight — carried over from the source blocks, not re-created by eye).\n<!-- /unless:import -->\n- **Element inventory — nothing silently dropped.** A reformat re-composes; a tight format tempts\n you to drop elements, and the result reads \"way too simplistic / missing elements from the\n original.\" Before finishing, **count**: every text cluster, image, chip, icon, and decoration on\n the source must have a counterpart on the new canvas. An element may be **omitted only\n deliberately** (it genuinely can't earn its place on a smaller canvas) — never by oversight, and\n the omission is a judgment you can name. Re-composing from an _impression_ of the source instead\n of its actual block list is how elements vanish.\n- **Variable (re-derive per canvas):** absolute positions, absolute sizes, wrap width, line count,\n and how the content group is distributed vertically.\n\nNever **stretch or squish** the whole design to force-fit (that distorts type and shapes — resize\nby re-flow, not by scaling the canvas contents). Never leave a **lopsided void** (§6.4).\n\n## Workflow\n\n<!-- requires:export -->\n0. **Export the source as `.imgly` and keep its `uri`** — `export({ format: 'imgly' })`. Everything below\n re-imports it, once per format.\n<!-- /requires:export -->\n1. **Read the source's design system** (palette, accent, type bands, margin %, spacing rhythm,\n hierarchy) and **capture its layout as fractions** of the source canvas (positions/sizes as % of\n source W/H — see routine). Do this once, on the source; the JSON it returns is what you carry\n from format to format.\n<!-- requires:import -->\n2. **Re-import the source** for this target format (`import({ source: { uri: SOURCE_URI } })`);\n<!-- /requires:import -->\n<!-- unless:import -->\n2. **For this target format**,\n<!-- /unless:import -->\n **set the page** to the new W×H and resize the full-bleed background to cover it. Each\n image/video fill keeps its region of interest through the resize (ROI section below).\n3. **Re-derive from the new canvas:** margins = 8–12% of the new **shortest** dimension; type sizes\n from the new page **height** within their bands (§6.1.2); gaps from the spacing scale (§6.4).\n4. **Proportional re-flow to fill, then balance.** Place blocks by their captured fractions × the\n new canvas (this fills a taller/wider canvas instead of letterboxing it), then **center or\n distribute the content group within the platform safe band** — no top-anchored void. (Safe-zone\n bounds and per-format guidance: the `formats` skill, `<id>.md`.)\n5. **Scale decoration proportionally** to the canvas (a ghost glyph sized as % of page height grows\n on a taller format, shrinks on a shorter one) — keep its role and framing.\n6. **Re-wrap & re-fit:** text re-wraps at the new column width; check **overflow / clipping /\n off-canvas**; adjust size _within its band_ only.\n7. **Let the size/font write carry the rich text.** A `text.fontSize` / `text.font` /\n `text.lineHeight` write reshapes on its own and **preserves every per-character style range** —\n color, weight, style, case, decoration (design rules §6.1.3). A resize keeps the **same string**, so\n there is nothing to capture and replay. What still flattens the accent is a **whole-block**\n styling write: `getProps(id, ['text.color']).text.color` reads run 0 only, and writing it back as\n `text: { color }` collapses the whole block to run 0's formatting. Don't re-apply whole-block\n styling in a resize; if you must, pass the runs from `getProps(id, ['text.ranges'])` back as\n `text: { ranges: [...] }` in the same `setProps` — **every** run, not just the accent.\n<!-- requires:export -->\n<!-- requires:drafts -->\n8. **`loadResources` → `preview` this format** (dead void / crop / tofu only show in the\n render), then `export({ format: 'imgly' })`: that file is the format's edition to hand over (the\n copy itself is saved as you edit it). Collect the returned `uri`s and report them all at the\n end. Give each build's `edit` a `note` naming the format (e.g. \"ig-story 1080×1920\"). Then go\n back to step 2 for the next format.\n<!-- /requires:drafts -->\n<!-- unless:drafts -->\n8. **`loadResources` → `preview` this format** (dead void / crop / tofu only show in the\n render). The edition is kept as you edit it — `export({ format: 'imgly' })` returns its `uri`.\n Collect the `uri`s and report them all at the end. Give each build's `edit` a `note`\n naming the format (e.g. \"ig-story 1080×1920\"). Then go back to step 2 for the next format.\n<!-- /unless:drafts -->\n<!-- /requires:export -->\n<!-- unless:export -->\n8. **`loadResources` → `preview` this format** (dead void / crop / tofu only show in the\n render). The product keeps it after every successful `edit` — there is nothing to save. Give the\n build's `edit` a `note` naming the format (e.g. \"ig-story 1080×1920\").\n<!-- /unless:export -->\n<!-- requires:video -->\n For a video design, preview each format at several `time`s — see **Video and animated\n designs** below.\n<!-- /requires:video -->\n\n## Proportional re-composition routine\n\nThe resize analog of localize's snap-to-reference — but a **first pass, not the finish**. It fills\nthe new canvas proportionally (killing the letterbox void); you then clamp margins/bands/safe-zones\nand **judge the balance in `preview`**. Resize is judgment-driven; there is no single deterministic\nanswer.\n\n**Capture the source as fractions** (run on the source page):\n\n```js\nconst [page] = await engine.design.findByType('page');\nconst pg = await engine.design.getProps(page, ['width', 'height']);\nconst PW = pg.width,\n PH = pg.height;\nconst out = [];\nasync function walk(id) {\n const p = await engine.design.getProps(id, [\n 'type',\n 'width',\n 'height',\n 'position'\n ]);\n const r = {\n type: p.type, // the SHORT name: 'text', 'graphic', 'page'\n fx: p.position.x / PW,\n fy: p.position.y / PH,\n fw: p.width / PW,\n fh: p.height / PH\n };\n if (p.type === 'text') {\n const t = (await engine.design.getProps(id, ['text'])).text;\n r.s = t.string;\n // the size read carries its unit ('32px', always pixels) — parse for math\n r.ffs = parseFloat(t.fontSize) / PH; // fraction of page height\n r.lh = t.lineHeight;\n r.ls = t.letterSpacing;\n r.align = t.horizontalAlignment;\n }\n if (id !== page) out.push(r);\n for (const c of await engine.design.getChildren(id)) await walk(c);\n}\nawait walk(page);\nreturn { type: 'text', text: JSON.stringify({ PW, PH, blocks: out }, null, 1) };\n```\n\n<!-- requires:import -->\n**Apply to the re-imported source at the new size** (first pass, then clamp):\n<!-- /requires:import -->\n<!-- unless:import -->\n**Apply to the source at the new size** (first pass, then clamp):\n<!-- /unless:import -->\n\n```js\nconst NW = 1080,\n NH = 1920; // target format\nconst SAFE_TOP = 250,\n SAFE_BOT = 320; // ig-story/reel UI chrome (authoritative per-format values: formats skill, <id>.md); 0 for post/square/widescreen\nconst [page] = await engine.design.findByType('page');\nawait engine.design.setProps(page, { width: NW, height: NH });\n\n// full-bleed background → cover the new page (don't reposition it proportionally)\nlet bg;\nfor (const id of await engine.design.getChildren(page)) {\n const p = await engine.design.getProps(id, ['type', 'width']);\n if (p.type === 'graphic' && p.width >= NW * 0.9) {\n bg = id;\n break;\n }\n}\nif (bg !== undefined) {\n // the fill keeps its region of interest on the new aspect — ROI section\n await engine.design.setProps(bg, {\n position: { x: 0, y: 0 },\n width: NW,\n height: NH\n });\n}\n\n// content blocks → position/size by captured fractions (fill), then you clamp + balance below\n// for each captured fraction f matched to its block id:\n// await engine.design.setProps(id, { position: { x: f.fx*NW, y: f.fy*NH } }); // fills the taller canvas\n// if (f.fw) await engine.design.setProps(id, { width: f.fw*NW }); // a logo: set height by the same factor\n// if (f.ffs) await engine.design.setProps(id, { text: { fontSize: clampToBand(f.ffs*NH) + 'pt' } });\n// // the unit is required; the write auto-reshapes, ranges preserved\n//\n// THEN, not optional:\n// • margins: ensure left/right within 8–12% of min(NW,NH); re-center centered blocks on NW.\n// • safe band: shift the whole content group so nothing vital sits above SAFE_TOP or below NH-SAFE_BOT.\n// • balance: if proportional spread looks airy/crowded, distribute the group evenly or center it —\n// preview and adjust. Scale decoration with the canvas; keep type within §6.1.2 bands.\nreturn {\n type: 'text',\n text: 'first pass placed — now clamp margins/safe-zone/balance and preview'\n};\n```\n\nPlatform safe zones and per-format notes are in the `formats` skill — read `<id>.md` for each\ntarget format.\n\n## Preserve the region of interest (image / video / pattern fills)\n\nA block backed by an **image or video fill** shows a _window_ onto its source. Writing the block's\n`width`/`height` with `engine.design.setProps` keeps that window's subject framed on the new aspect: a `Cover` or `Contain` fill\nre-fits to its `contentFill.horizontalAlignment` / `verticalAlignment` (the focal side it keeps),\nand an unrotated `Crop` fill keeps the centre of its window and its uniform scale, showing no more of the\nsource than before. A `crop` written in the same `setProps` call stands as written. When the brief\nor the asset's metadata names a focal point, bias the alignment (Cover) or `crop.translationX/Y`\n(Crop) toward it, then `preview` each format — the render is the only place a subject cut off by a\nnew aspect shows.\n\n**Crop invariants — the three properties every photo-in-a-frame must hold** (checked in `preview`;\nthey fail independently of ROI focus, and a shape frame — circle/rounded card — makes them easy to\nmiss). A **logo or other mark is the exception**: it is shown whole, never cropped — keep its frame\nat the logo's own aspect (scale width and height by the same factor) or its `Contain` mode, and\nleave the space around it empty (design rules, \"A logo is shown whole\").\n\n1. **Full coverage, zero gap.** The fill covers its frame completely — no sliver of empty frame at\n any edge (the \"gap at the top of the circle\" defect). If a hand-set crop leaves a gap,\n `adjustCropToFillFrame` (Crop) or the Cover mode refills it; never leave the frame partly unfilled.\n2. **Uniform scale — no stretch.** The image scales the **same on both axes**; a hand-set\n non-uniform crop distorts the subject. Scale is one ratio, not two. (`Contain` never stretches:\n it scales uniformly and leaves the rest of the frame empty — which is why it suits a logo and\n breaks invariant 1 for a photo.)\n3. **Subject inside the window.** After 1–2, the focal point is still within the visible crop, not\n pushed out by the refill. This is the ROI check above — do it last, after coverage is guaranteed.\n\n**Re-group after re-composition.** Resize moves and resizes loose blocks; before you finish, restore\nthe source's **group hierarchy** on the new canvas (`{{skill:api#recipes.md}}`, \"Group blocks\") so each\nformat ships the same grouped, nested structure — not a flattened tree.\n\n<!-- requires:video -->\n## Video and animated designs\n\nApplies when the page has a `playback.duration`, blocks carry `playback.timeOffset` /\n`playback.duration`, `animations`, an `audio` block, or a `captionTrack`. A resize re-composes the\n**frame**; the **timeline** is invariant.\n\n- **Fork, move, resize — never recreate a timed block.** A page resize keeps every block's\n `timeOffset`, `duration`, animations, audio and video trims; a re-created block loses all of them.\n Walk the whole tree, not just the page's children: timed blocks can sit under `track`s and\n captions under a `captionTrack` (the capture `walk` above already recurses).\n- **Re-aim every entrance for the new layout.** `slide` / `pan` `direction` is the **direction of\n travel** in radians, y pointing down: `0` enters from the left moving right, `π/2` from the top\n moving down, `π` from the right, `3π/2` from the bottom moving up. A slide that entered from the\n photo's side on 16:9 crosses the photo once 9:16 stacks text under it — aim it along the new\n reading axis. Patch in place with the **same type**, which keeps the animation's duration:\n `setProps(id, { animations: { in: { type: 'slide', slide: { direction: (3 * Math.PI) / 2 } } } })`\n (a different type replaces the animation and resets its duration); `duration: s` in the same\n spec sets it.\n- **Scaling entrances overdraw.** `zoom` / `grow` scale around the block's centre, so a\n full-height photo spills over its neighbours during the entrance — check the first frames after\n every re-layout.\n- **Vertical safe zones hold for the whole timeline.** Story / reel / TikTok / Shorts UI covers the\n top and bottom bands (and the right edge on TikTok / Shorts) — `{{skill:formats#ig-story.md}}`,\n `{{skill:formats#tiktok.md}}`, `{{skill:formats#yt-shorts.md}}`. Captions and CTAs belong inside\n the safe band, and so does every block's position _mid-entrance_.\n- **Captions carry their own frame, per caption.** Writing the first caption's position or size\n does not reach the others — set `position`, `width`, `height`, `caption/fontSize` on **every**\n caption, with `caption/automaticFontSizeEnabled` off (otherwise the text grows past its frame\n and over the layout). Keep the frame's bottom at or above `H − bottom safe band`.\n- **A fill's region of interest moves over time.** Check it at the start, middle and end of every video clip and of every `ken_burns` / `pan` move — a\n crop that frames the subject at 0 s can cut it at 3 s.\n- **Preview at several `time`s, per edition.** One frame of a video proves nothing about the\n rest: `preview({ time })` at the first frame, mid-entrance of each timed block, each hold, each\n caption change and the last second.\n<!-- requires:export -->\n Then `export({ format: 'mp4', blockId: page })` for the real motion.\n<!-- /requires:export -->\n<!-- /requires:video -->\n\n## No-goes / red flags\n\n- **Dead void / letterboxing** — the headline failure: content clustered on one side of a\n taller/wider canvas, an empty band elsewhere. Fill or balance the group; respect safe zones.\n- **Design drift** — re-composition that loses the design's identity: margins wander, the type\n scale or hierarchy shifts, the accent is misused, or decoration loses its role. Re-compose\n _within_ the system, don't redesign.\n- **Stretch / squish** — scaling the canvas contents non-proportionally to force-fit. Never distort\n type or shapes; re-flow instead.\n- **Broken margin rhythm** — margins not re-derived from the new shortest dimension, or asymmetric.\n- **Off-canvas / clipping / overflow** — elements pushed past the new edges; decoration over-cropped;\n text overflowing the new column.\n- **Decoration mis-scale** — a ghost glyph or accent kept at the source's absolute size instead of\n scaling with the canvas.\n- **ROI drift** — a resized image/video fill re-centered and cropped the subject out of frame\n (face, product, logo, focal point). `setProps` keeps an unrotated Crop fill's region on a resize\n and Cover/Contain re-fit; check the subject is still framed in `preview`.\n- **Missing elements** — the reformat re-composed from an impression and silently dropped source\n content (\"too simplistic / elements missing from the original\"). Inventory every source cluster\n against the new canvas; omit only deliberately, never by oversight.\n- **Appearance drift** — a block's fill/gradient/effect/corner-radius/overlay differs from the\n source, or an overlay was added/removed the source didn't have (a cover that \"became darker\").\n<!-- requires:import -->\n Appearance is inherited by re-importing the exported source; don't re-create or restyle it by eye.\n<!-- /requires:import -->\n<!-- unless:import -->\n Appearance is inherited from the source blocks; don't re-create or restyle it by eye.\n<!-- /unless:import -->\n- **Crop broken** — a fill leaves a gap inside its frame, or was stretched non-uniformly. See the\n three crop invariants (coverage, uniform scale, subject-in-window).\n- **Flattened hierarchy** — the resize dropped the source's group blocks and shipped a flat list of\n siblings. Re-group each cluster (nested where nested) on the new canvas.\n- **Ignoring platform safe zones** — vital content under story/reel UI chrome.\n<!-- requires:video -->\n- **Timeline drift (video)** — a timed block re-created instead of moved, an entrance still aimed\n across the old layout, or a caption left in the platform's UI band.\n<!-- /requires:video -->\n- **tofu / overflow at new wrap widths** — a new measure can push a glyph the font lacks, or wrap to\n a line count that overflows; only `preview` catches it.\n\n## Before reporting done\n\nRun the **resize composition checklist** below against each format's render, then close with a `judge` run per format (the `judge` skill; composition and hierarchy are the axes reformatting most often breaks). Score honestly — a residual void is a composition fail, say so.\n\n### Resize composition checklist\n\nAny \"no\" on an applicable line drops the axis below 8.\n\n**Composition (§6.4)**\n\n- [ ] Margins 8–12% of the new shortest dimension; on the shared grid / one alignment\n- [ ] Whitespace balanced — **no lopsided dead void / letterbox**; content occupies or balances the canvas\n- [ ] Consistent spacing scale (§6.4 ladder); nothing off-canvas, clipped, or overlapping\n- [ ] Primary content within the format's safe band (per its `formats` file; story/reel: clear of top 269px / bottom 672px)\n\n**Hierarchy (§6.3) & identity**\n\n- [ ] One dominant element preserved; reading order intact; ≈3 levels\n- [ ] Palette + single accent, type-scale bands (§6.1.2), and each decoration's role carried over\n- [ ] Decoration scaled proportionally to the canvas (not the source's absolute size)\n- [ ] Every image/video fill keeps its **region of interest** — subject/focal point still framed, nothing important cropped out or newly empty (checked in `preview`)\n- [ ] Source's **group hierarchy** restored on the new canvas (grouped clusters, nested where nested — not a flat list)\n- [ ] **Element inventory complete** — every source content cluster (text, image, chip, icon, decoration) has a counterpart on the new canvas; any omission is deliberate and nameable, not an oversight\n- [ ] **Appearance parity** — every block's fill/gradient, effect/blur, opacity, corner radius, stroke, shadow, and font weight match the source; no overlay added or removed the source didn't have (checked against the source render)\n\n**Craft / baseline**\n\n- [ ] No stretch/squish; type re-fit within its band, not distorted\n- [ ] **Crop invariants** hold on every fill-in-frame — full coverage (no gap), uniform scale (no stretch), subject inside the window (checked in `preview`)\n- [ ] Zero tofu / overflow at the new wrap width, checked in `preview`\n- [ ] Native export dimensions (the page's own pixel size)\n\n<!-- requires:video -->\n**Video / animated (when the design has a timeline)**\n\n- [ ] Every block's `timeOffset` / `duration`, animations and audio carried over — moved, not re-created\n- [ ] Every entrance re-aimed for the new layout (`direction` = direction of travel); no block crosses the photo or leaves the safe band mid-entrance\n- [ ] Every caption framed and sized on the new canvas, inside the safe band, auto font size off\n- [ ] Checked at several `time`s (entrances, holds, caption changes, last second), not one frame\n<!-- /requires:video -->\n\n## Cross-references\n\n- **`formats` skill** — per-format W×H, aspect, and platform safe zones (one file per format id).\n- design rules §6.3 Hierarchy, §6.4 Composition & grid, §6.1.2 type-scale bands — the general composition criteria this skill operationalizes; §6.1.2's canvas table for type sizing by % of page height; and the `api` skill's engine mechanics (the `text.font` declaration, auto-reshape, `loadResources`, dirty-on-throw).\n- **`judge`** — the acceptance gate every produced format must pass.\n- **`localize`** — the sibling for _translating_ a design at the _same_ size (snap, don't re-compose).\n",
|
|
62
62
|
"docs/resize/editions.md": "# Master → editions\n\nOne design, many deliverables: a **master** and the **editions** derived from it (sizes, locales,\nor both). This page is the convention that makes a master fix reach every edition by **re-running**\neach edition's build step, instead of redoing it by hand. Used by `resize` (size editions) and\n`localize` (language editions).\n\n## The rules\n\n<!-- requires:export -->\n1. **The master is one saved design.** It is the native design — layout, brand, timeline,\n voice-over — in its source size and language, saved with `export({ format: 'imgly' })` →\n `MASTER_URI`. Name every block you will touch in an edition (`create({ type, name, … })`);\n editions find blocks with `engine.design.findByName(name)`.\n2. **An edition is one `edit` on a fresh copy of the master.** `import({ source: { uri: MASTER_URI } })`,\n then one `edit({ code, note: 'edition: ig-story 1080×1920' })`, `preview`, and\n `export({ format: 'imgly' })` — the edition's own file. Always start from the master — never\n from another edition (a resize of a resize, a translation of a translation compounds every\n error).\n<!-- unless:open -->\n Check each edition's returned `uri` is not `MASTER_URI`.\n<!-- /unless:open -->\n<!-- /requires:export -->\n<!-- unless:export -->\n1. **The master is the source design.** It is the native design — layout, brand, timeline,\n voice-over — in its source size and language. Name every block you will touch in an edition\n (`create({ type, name, … })`); editions find blocks with `engine.design.findByName(name)`.\n2. **An edition is one `edit` on the master.** The product opens a session per edition, each\n holding the master; give the edition's `edit` a `note` naming it\n (`'edition: ig-story 1080×1920'`). Never build one edition from another (a resize of a resize,\n a translation of a translation compounds every error).\n<!-- /unless:export -->\n3. **The edition's code is self-contained.** It resolves blocks by **name**, never by numeric id\n (ids are session-scoped — a replay with literal ids edits the wrong blocks or throws). It carries\n its inputs inline — target size, copy, the asset `uri`s it places, a transcript's word timings —\n and reads anything that comes from the master (positions, offsets, styles) from the scene at run\n time, so a changed master flows through.\n4. **Keep that one body, and fold follow-up fixes into it.** The server keeps no history of your\n edits, so the edition's code is its build step only if you keep it. If you corrected the edition\n in a second `edit`, merge the correction into the edition's code, so the edition stays a single\n replayable step.\n5. **A combined edition runs both bodies.** A German vertical = one `edit` on the master whose code\n is the resize body followed by the localize body.\n\n<!-- requires:export -->\n## Re-applying a master fix\n\n1. Fix the master: `import({ source: { uri: MASTER_URI } })`, `edit({ code, note: 'master fix: …' })`,\n `export({ format: 'imgly' })` → the new master.\n2. For each edition: `import` the new master and run the edition's kept code again, with its\n `note`; `export({ format: 'imgly' })` it.\n3. `preview` every re-run edition (at several `time`s for video) and judge it again — a fix that\n is right for the master can still break an edition's layout.\n\nIf a replay throws, the fix renamed or removed a block the edition names: correct the edition's\ncode, not its output.\n<!-- /requires:export -->\n",
|
|
63
|
-
"docs/templates/SKILL.md": "---\nname: templates\ndescription: >-\n Use when a design is a template someone else fills in — \"make this a template\",\n \"lock the layout\", \"editable fields\", text variables (`{{key}}` tokens), image or text\n placeholders, or which parts a person may change. Covers text and typed variables,\n bindings (re-theme in one write), placeholder slots, locking with scopes, and delivering\n a filled-in, judged template.\n---\n\n# templates — variables, bindings, placeholders, locking\n\nA template is a design someone else fills in: the copy that changes is a\n**text variable**, the photo that changes is a **placeholder**, and\neverything else is **locked** so the person filling it in cannot break the\nlayout. Placeholders and locks are saved with the design and honoured by the\nbrowser editor that opens it. The variables are not saved yet: a reopened\ndesign keeps its bindings and tokens but reads none of its own variable\nvalues, so set every variable again before you preview or export it.\n\n## Text variables\n\nA variable is a `{{key}}` token inside a text block's string. The engine\nreplaces it with the variable's value at render time; the token stays in\nthe text, so the next value replaces it again.\n\n```js\nconst title = await engine.design.create(\n {\n type: 'text',\n name: 'title',\n props: { text: { string: '{{title}}', fontSize: '96px' } }\n },\n { parent: page }\n);\nawait engine.design.create(\n {\n type: 'text',\n name: 'when',\n props: { text: { string: '{{date}} · {{time}}', fontSize: '36px' } } // several tokens, plain text around them\n },\n { parent: page }\n);\n\n// Variables are scene-wide: they live on the scene block.\nconst [scene] = await engine.design.findByType('scene');\nawait engine.design.setProps(scene, {\n variables: { title: 'Sunrise Flow', date: 'Sat 14 June', time: '6:30 am' }\n});\n```\n\n- Size each text block for its variable's longest plausible value (Auto\n height, a width the layout can take).\n- `variables` is a patch: a write creates or updates the keys it names and\n leaves the others; `{ key: null }` deletes one.\n `getProps(scene, ['variables'])` reads every key and value.\n- Keys are plain identifiers (`title`, `eventDate`). Styling (font, size, colour, ranges) applies to the\n rendered value as to any text.\n\n## Typed variables and bindings: themes in one write\n\nA colour, number, image or font can be a variable too. A block leaf\n**bound** to it follows it: one write to the variable changes every bound\nleaf in the design — a brand swap, a hero image per campaign, a heading\nface per script.\n\n```js\nconst [scene] = await engine.design.findByType('scene');\nawait engine.design.setProps(scene, {\n variables: {\n brand: { color: { r: 0.9, g: 0.1, b: 0.2, a: 1 } },\n heading: { font: { family: 'Inter' } }, // the family; each text keeps its weight\n hero: { image: uri },\n headSize: { number: 72 }, // engine units, see below\n city: 'Berlin' // a string stays a text variable: {{city}} in text\n }\n});\nawait engine.design.setProps(cta, { bindings: { 'fill.color': 'brand', 'stroke.color': 'brand' } });\nawait engine.design.setProps(title, {\n bindings: { 'text.color': 'brand', 'text.font': 'heading', 'text.fontSize': 'headSize' }\n});\nawait engine.design.setProps(photo, { bindings: { 'fill.image': 'hero' } });\n\n// Re-theme: one write, every bound leaf follows.\nawait engine.design.setProps(scene, { variables: { brand: { color: OTHER } } });\n```\n\n- **Pairs.** colour → colour leaves (`fill.color` on a colour fill,\n `text.color`, `stroke.color`, `dropShadow.color`, …); number → number\n leaves (`width`, `opacity`, `text.fontSize`, …); image → `fill.image`,\n `fill.video`; font → `text.font`, `caption.font`. A text variable is not\n bound: it is a `{{key}}` token. A wrong pair is refused with\n `DESIGN.VARIABLE_TYPE`, which lists the leaves that variable type binds\n to on that block.\n- **A number is engine-native.** Bound to a length it is in the scene's\n design unit; bound to `text.fontSize` it is in `scene.fontSizeUnit`\n (points unless the scene says `'Pixel'`: 72 pt is 300 px at 300 dpi).\n A value a bound leaf refuses (an opacity of 5) is refused, and the\n variable keeps its old value.\n- **A bound leaf refuses direct writes** (`DESIGN.PROPERTY_BOUND`, nothing\n applied) — on a text, a bound `text.color` or `text.fontSize` also locks\n the ranges' `color`/`size`. Change the variable, or unbind first:\n `bindings: { 'text.color': null }` (the leaf keeps its value). Writing the\n value it already has is a no-op, so `getProps` output still writes back.\n- `getProps(id, ['bindings'])` lists a block's bound leaves; a block without\n any reads no `bindings` key. `getProps(scene, ['variables'])` reads every\n variable in its own shape (a font as `{ font: { typeface } }`).\n- `{ name: { rename: 'newName' } }` renames a variable: its `{{tokens}}` and\n bindings follow. `{ name: null }` deletes it and unbinds its leaves (they\n keep their last value). A variable keeps its type: to change it, delete\n it first, then write the new value in a second `setProps`.\n- A fill spec of another `type` replaces the fill, and the fill's bindings\n go with it; rebind after.\n\n## Placeholders\n\nA placeholder is a block the person filling in the template replaces —\nan image slot (`fill/change`) or a text slot (`text/edit`). Two switches,\non different blocks:\n\n```js\nconst hero = await engine.design.create(\n {\n type: 'graphic',\n name: 'hero',\n props: {\n shape: { type: 'rect' },\n fill: {\n type: 'image',\n image: { imageFileURI: sampleUri }, // a sample photo, replaced later\n placeholderBehavior: { enabled: true } // a graphic's lives on its fill\n },\n width: 1080,\n height: 760,\n placeholder: { enabled: true }, // the BLOCK is a slot\n placeholderControls: { showOverlay: true, showButton: true } // the editor's \"replace\" overlay + button\n }\n },\n { parent: page }\n);\n// Text: behaviour and slot are both on the block.\nawait engine.design.setProps(title, {\n placeholder: { enabled: true },\n placeholderBehavior: { enabled: true }\n});\n```\n\n- Blocks start with every scope off; the edit lint names a slot whose\n `editor/select` and `fill/change` / `text/edit` are not on. Useful\n companions: `fill/changeType`, `layer/crop` (image), `text/character`\n (text formatting).\n- **Fill the slot with a real sample** so the preview shows the intended\n crop and contrast; the placeholder is what makes it replaceable.\n- `getProps(scene, { children: true, props: ['placeholder'] })` reads the\n whole tree; the nodes with `placeholder.enabled` are the slots — check\n they are exactly the ones the brief asks for.\n\n## Locking: scopes\n\nWhat a person may change is decided per **scope**, on each block:\n`await engine.design.setScopes(id, { 'layer/move': false, … })`, read with\n`await engine.design.getScopes(id)`. Block scopes are **saved with the\ndesign** — they are the lock.\n\nThe scopes (the keys `getScopes(id)` answers):\n\n| group | scopes |\n| ---------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| text | `text/edit` (content) · `text/character` (font, size, colour) |\n| fill/shape | `fill/change` · `fill/changeType` · `stroke/change` · `shape/change` |\n| layer | `layer/move` · `layer/resize` · `layer/rotate` · `layer/flip` · `layer/crop` · `layer/opacity` · `layer/blendMode` · `layer/visibility` · `layer/clipping` |\n| appearance | `appearance/adjustments` · `appearance/filter` · `appearance/effect` · `appearance/blur` · `appearance/shadow` · `appearance/animation` |\n| lifecycle | `lifecycle/destroy` · `lifecycle/duplicate` |\n| editor | `editor/add` · `editor/select` |\n\n### Recipe: lock the layout, open the slots\n\n```js\nconst ALL = Object.keys(await engine.design.getScopes(page));\n// 1. The page and every block under it: nothing editable.\nawait engine.design.setScopes(\n page,\n Object.fromEntries(ALL.map((s) => [s, false])),\n { recursive: true }\n);\n\n// 2. Open exactly the slots. editor/select first: an unselectable block cannot be edited at all.\nfor (const name of ['title', 'when', 'where'])\n for (const id of await engine.design.findByName(name))\n await engine.design.setScopes(id, {\n 'editor/select': true,\n 'text/edit': true\n });\nfor (const id of await engine.design.findByName('hero'))\n await engine.design.setScopes(id, {\n 'editor/select': true,\n 'fill/change': true,\n 'layer/crop': true\n });\n```\n\n- **Without `editor/select`** a locked block cannot even be selected\n (watermarks, logos, legal lines).\n- **Variables are values, not slots.** A text block whose string is\n `{{title}}` is filled by setting the variable; give it `text/edit` only if\n the person may also retype it directly.\n- Check the lock before saving: `(await engine.design.getScopes(id))[scope]`\n for each slot and each locked block.\n\n## Delivering a template\n\n1. Bind every changing line to a variable and set sample values.\n2. Make each replaceable image a placeholder with a sample fill.\n3. Lock everything; open only the slots (`editor/select` + their scope).\n4. Judge the filled-in design like any other.\n<!-- requires:export -->\n5. Save it — `export({ format: 'imgly' })` carries placeholders, block\nscopes and bindings, but not the variables: a reopened design reads none of\nits own values, so its tokens show raw `{{key}}` or another design's value. List every variable and its\nvalue in your reply, so you or the person opening it can set them again — and\nexport the preview format the brief asks for.\n<!-- /requires:export -->\n",
|
|
63
|
+
"docs/templates/SKILL.md": "---\nname: templates\ndescription: >-\n Use when a design is a template someone else fills in — \"make this a template\",\n \"lock the layout\", \"editable fields\", text variables (`{{key}}` tokens), image or text\n placeholders, or which parts a person may change. Covers text and typed variables,\n bindings (re-theme in one write), value sets (one design, several languages or copy\n variants), placeholder slots, locking with scopes, and delivering a filled-in, judged\n template.\n---\n\n# templates — variables, bindings, placeholders, locking\n\nA template is a design someone else fills in: the copy that changes is a\n**text variable**, the photo that changes is a **placeholder**, and\neverything else is **locked** so the person filling it in cannot break the\nlayout. Placeholders, locks, variables and value sets are saved with the\ndesign and honoured by the browser editor that opens it. A design with\n`{{tokens}}` or bindings but no `variables` was saved before variables were\nkept: set every variable it uses again before you preview or export it.\n\n## Text variables\n\nA variable is a `{{key}}` token inside a text block's string. The engine\nreplaces it with the variable's value at render time; the token stays in\nthe text, so the next value replaces it again.\n\n```js\nconst title = await engine.design.create(\n {\n type: 'text',\n name: 'title',\n props: { text: { string: '{{title}}', fontSize: '96px' } }\n },\n { parent: page }\n);\nawait engine.design.create(\n {\n type: 'text',\n name: 'when',\n props: { text: { string: '{{date}} · {{time}}', fontSize: '36px' } } // several tokens, plain text around them\n },\n { parent: page }\n);\n\n// Variables are scene-wide: they live on the scene block.\nconst [scene] = await engine.design.findByType('scene');\nawait engine.design.setProps(scene, {\n variables: { title: 'Sunrise Flow', date: 'Sat 14 June', time: '6:30 am' }\n});\n```\n\n- Size each text block for its variable's longest plausible value (Auto\n height, a width the layout can take).\n- `variables` is a patch: a write creates or updates the keys it names and\n leaves the others; `{ key: null }` deletes one.\n `getProps(scene, ['variables'])` reads every key and value.\n- Keys are plain identifiers (`title`, `eventDate`). Styling (font, size, colour, ranges) applies to the\n rendered value as to any text. `scene_root`, names starting with `ubq.`,\n and names that are empty, padded with spaces or hold `{{`/`}}` are\n refused before anything applies.\n\n## Typed variables and bindings: themes in one write\n\nA colour, number, image or font can be a variable too. A block leaf\n**bound** to it follows it: one write to the variable changes every bound\nleaf in the design — a brand swap, a hero image per campaign, a heading\nface per script.\n\n```js\nconst [scene] = await engine.design.findByType('scene');\nawait engine.design.setProps(scene, {\n variables: {\n brand: { color: { r: 0.9, g: 0.1, b: 0.2, a: 1 } },\n heading: { font: { family: 'Inter' } }, // the family; each text keeps its weight\n hero: { image: uri },\n headSize: { number: 72 }, // engine units, see below\n city: 'Berlin' // a string stays a text variable: {{city}} in text\n }\n});\nawait engine.design.setProps(cta, { bindings: { 'fill.color': 'brand', 'stroke.color': 'brand' } });\nawait engine.design.setProps(title, {\n bindings: { 'text.color': 'brand', 'text.font': 'heading', 'text.fontSize': 'headSize' }\n});\nawait engine.design.setProps(photo, { bindings: { 'fill.image': 'hero' } });\n\n// Re-theme: one write, every bound leaf follows.\nawait engine.design.setProps(scene, { variables: { brand: { color: OTHER } } });\n```\n\n- **Pairs.** colour → colour leaves (`fill.color` on a colour fill,\n `text.color`, `stroke.color`, `dropShadow.color`, …); number → number\n leaves (`width`, `opacity`, `text.fontSize`, …); image → `fill.image`,\n `fill.video`; font → `text.font`, `caption.font`. A text variable is not\n bound: it is a `{{key}}` token. A wrong pair is refused with\n `DESIGN.VARIABLE_TYPE`, which lists the leaves that variable type binds\n to on that block.\n- **A number is engine-native.** Bound to a length it is in the scene's\n design unit; bound to `text.fontSize` it is in `scene.fontSizeUnit`\n (points unless the scene says `'Pixel'`: 72 pt is 300 px at 300 dpi).\n A value a bound leaf refuses (an opacity of 5) is refused, and the\n variable keeps its old value.\n- **A bound leaf refuses direct writes** (`DESIGN.PROPERTY_BOUND`, nothing\n applied) — on a text, a bound `text.color` or `text.fontSize` also locks\n the ranges' `color`/`size`. Change the variable, or unbind first:\n `bindings: { 'text.color': null }` (the leaf keeps its value). Writing the\n value it already has is a no-op, so `getProps` output still writes back.\n- `getProps(id, ['bindings'])` lists a block's bound leaves; a block without\n any reads no `bindings` key. `getProps(scene, ['variables'])` reads every\n variable in its own shape (a font as `{ font: { typeface } }`).\n- `{ name: { rename: 'newName' } }` renames a variable: its `{{tokens}}` and\n bindings follow. `{ name: null }` deletes it and unbinds its leaves (they\n keep their last value). A variable keeps its type: to change it, delete\n it first, then write the new value in a second `setProps`.\n- A fill spec of another `type` replaces the fill, and the fill's bindings\n go with it; rebind after.\n\n## Value sets: one design, several versions of its values\n\nA **value set** is a named set of alternative values for some variables —\na language, long names, a second campaign. `variables` holds the defaults;\n`activeValueSet` picks the set that text, bound leaves, previews and\nexports show. A variable the set has no value for shows its default.\n\n```js\nawait engine.design.setProps(scene, {\n variables: { title: 'Summer Sale', brand: { color: RED } }, // the defaults\n valueSets: {\n Deutsch: { values: { title: 'Sommerschlussverkauf' } },\n Night: { values: { brand: { color: NAVY } } }\n },\n activeValueSet: 'Deutsch' // null shows the defaults again\n});\n// preview or export each version: set activeValueSet, then preview/export\n```\n\n- A set holds values only for variables that exist, each in its variable's\n type (`DESIGN.VARIABLE_TYPE` otherwise). Create the variable in the same\n write or before.\n- `valueSets` is a patch like `variables`: `{ Deutsch: { values: { title:\n null } } }` drops one value, `{ Deutsch: null }` deletes the set,\n `{ Deutsch: { rename: 'German' } }` renames it (an active set stays\n active). Set names must not be empty or padded with spaces.\n- `variables` always writes and reads the defaults, also while a set is\n active. `getProps(scene, ['variables', 'valueSets', 'activeValueSet'])`\n reads all three and writes back; a scene without sets reads\n `valueSets: {}` and `activeValueSet: null`. A number is stored as a\n 32-bit float, so `{ number: 0.3 }` reads back as\n `0.30000001192092896`: compare with a tolerance.\n- A value a bound leaf refuses (an opacity of 5) is refused when the set\n is written, and again when a set is activated whose value a leaf bound\n later refuses (`DESIGN.LEAF_VALUE`, the active set stays as it was).\n Renaming a set that does not exist is refused too.\n- A refused value inside a write that also changes variables or other sets\n leaves what that write applied before it; an error the edit does not catch\n discards the whole edit.\n- Size each text block for the longest value across all sets, and judge\n the design with each set active.\n\n## Placeholders\n\nA placeholder is a block the person filling in the template replaces —\nan image slot (`fill/change`) or a text slot (`text/edit`). Two switches,\non different blocks:\n\n```js\nconst hero = await engine.design.create(\n {\n type: 'graphic',\n name: 'hero',\n props: {\n shape: { type: 'rect' },\n fill: {\n type: 'image',\n image: { imageFileURI: sampleUri }, // a sample photo, replaced later\n placeholderBehavior: { enabled: true } // a graphic's lives on its fill\n },\n width: 1080,\n height: 760,\n placeholder: { enabled: true }, // the BLOCK is a slot\n placeholderControls: { showOverlay: true, showButton: true } // the editor's \"replace\" overlay + button\n }\n },\n { parent: page }\n);\n// Text: behaviour and slot are both on the block.\nawait engine.design.setProps(title, {\n placeholder: { enabled: true },\n placeholderBehavior: { enabled: true }\n});\n```\n\n- Blocks start with every scope off; the edit lint names a slot whose\n `editor/select` and `fill/change` / `text/edit` are not on. Useful\n companions: `fill/changeType`, `layer/crop` (image), `text/character`\n (text formatting).\n- **Fill the slot with a real sample** so the preview shows the intended\n crop and contrast; the placeholder is what makes it replaceable.\n- `getProps(scene, { children: true, props: ['placeholder'] })` reads the\n whole tree; the nodes with `placeholder.enabled` are the slots — check\n they are exactly the ones the brief asks for.\n\n## Locking: scopes\n\nWhat a person may change is decided per **scope**, on each block:\n`await engine.design.setScopes(id, { 'layer/move': false, … })`, read with\n`await engine.design.getScopes(id)`. Block scopes are **saved with the\ndesign** — they are the lock.\n\nThe scopes (the keys `getScopes(id)` answers):\n\n| group | scopes |\n| ---------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| text | `text/edit` (content) · `text/character` (font, size, colour) |\n| fill/shape | `fill/change` · `fill/changeType` · `stroke/change` · `shape/change` |\n| layer | `layer/move` · `layer/resize` · `layer/rotate` · `layer/flip` · `layer/crop` · `layer/opacity` · `layer/blendMode` · `layer/visibility` · `layer/clipping` |\n| appearance | `appearance/adjustments` · `appearance/filter` · `appearance/effect` · `appearance/blur` · `appearance/shadow` · `appearance/animation` |\n| lifecycle | `lifecycle/destroy` · `lifecycle/duplicate` |\n| editor | `editor/add` · `editor/select` |\n\n### Recipe: lock the layout, open the slots\n\n```js\nconst ALL = Object.keys(await engine.design.getScopes(page));\n// 1. The page and every block under it: nothing editable.\nawait engine.design.setScopes(\n page,\n Object.fromEntries(ALL.map((s) => [s, false])),\n { recursive: true }\n);\n\n// 2. Open exactly the slots. editor/select first: an unselectable block cannot be edited at all.\nfor (const name of ['title', 'when', 'where'])\n for (const id of await engine.design.findByName(name))\n await engine.design.setScopes(id, {\n 'editor/select': true,\n 'text/edit': true\n });\nfor (const id of await engine.design.findByName('hero'))\n await engine.design.setScopes(id, {\n 'editor/select': true,\n 'fill/change': true,\n 'layer/crop': true\n });\n```\n\n- **Without `editor/select`** a locked block cannot even be selected\n (watermarks, logos, legal lines).\n- **Variables are values, not slots.** A text block whose string is\n `{{title}}` is filled by setting the variable; give it `text/edit` only if\n the person may also retype it directly.\n- Check the lock before saving: `(await engine.design.getScopes(id))[scope]`\n for each slot and each locked block.\n\n## Delivering a template\n\n1. Bind every changing line to a variable and set sample values.\n2. Make each replaceable image a placeholder with a sample fill.\n3. Lock everything; open only the slots (`editor/select` + their scope).\n4. Judge the filled-in design like any other.\n<!-- requires:export -->\n5. Save it — `export({ format: 'imgly' })` carries placeholders, block\nscopes, bindings, variables and value sets — and export the preview format\nthe brief asks for.\n<!-- /requires:export -->\n",
|
|
64
64
|
"docs/video-thumbnail-template/SKILL.md": "---\nname: video-thumbnail-template\ndescription: >-\n Use when building a reusable thumbnail template and design guideline for a video channel\n (YouTube and other 16:9 video platforms) — from a channel link whose latest thumbnails set the\n style, from one or more example thumbnails or designs, or from scratch; or when making new\n thumbnails from such a template, one at a time or in a batch.\nrequires: asset_generate, asset_add, export, import, scorecard\n---\n\n# video-thumbnail-template\n\nTurn a channel's thumbnail style into a design guideline (a brand kit) and a CoDesign template\nwith named slots, then fill the template for each new video.\n\nBuilds on, without restating: the design loop, the `brand` skill's kit format, the `layerize`\nskill (Seedream decomposition), the `models` skill, the `formats` skill (`youtube-thumbnail.md`)\nand the `judge` gate.\n\n## Input\n\nOne of three, resolved with the intake contract (`{{skill:create#intake.md}}`):\n\n- **Channel link** — its latest 10 thumbnails set the style.\n- **Example thumbnails or designs** — one or more images, or design files (`.imgly`, `.psd`, …).\n- **Nothing** — start fresh; ask for the visual direction per the intake contract.\n\nThe format defaults to `youtube-thumbnail` (1280 × 720). Everything goes into one output folder\n(default `./<channel-or-topic>-thumbnails/`): `reference/`, `brand-kit/`, the template and the\nthumbnails. References live in the CoDesign workspace, not on disk: `reference/refs.md` lists them. A thumbnail style is the channel's brand: never invent it when references exist.\n\n## 1 — Collect references\n\nEvery reference comes in through `import` as a one-page design; nothing is downloaded or copied to\ndisk. Take them one at a time, because the next `import` moves on to a new design: `import` it,\n`preview()` it and record its layout (step 2), then read the image's `uri` in a read-only `edit`\n(`render: false`) — the imported image is the page's fill,\n`(await engine.design.getProps(page, ['fill'])).fill.image.imageFileURI`. `reference/refs.md` lists,\nper reference, the video id or file name, the page size and that uri, which stays valid after you\nmove on. Each reference stays in the workspace as a design of its own.\n\n**Channel link.** CoDesign cannot read web pages, so the video ids come from your host's built-in\nweb-fetch tool — used only to read the channel's `/videos` page (e.g.\n`https://www.youtube.com/@handle/videos`); no shell, no downloads. That tab lists regular uploads\nonly, newest first; the ids are in the page source as `\"videoId\":\"<11 chars>\"`. Take the first 10\ndistinct ids. Without a web-fetch tool, or when the page cannot be read, ask the user for links to\ntheir latest videos and take the id from each (`watch?v=<id>`, `youtu.be/<id>`, `/shorts/<id>`).\nThen `import({ source: { url: 'https://i.ytimg.com/vi/<id>/maxresdefault.jpg' } })` for each id —\npublic URLs, no API key or login. A 404 means the video has no full-size thumbnail: import\n`hqdefault.jpg` instead, a 480 × 360 frame whose 16:9 picture sits between black bars.\n\n**Example thumbnails.** `import({ source: { path } })` each file the user named. A design file goes\nthrough `import` the same way — its layers show the structure directly.\n\n**Nothing.** No references; go to step 3 with the direction the user chose.\n\n## 2 — Analyse the layouts\n\nLook at every reference yourself — its `preview` from step 1. For **each** one, record its layout — positions and sizes as\nfractions of the canvas, so they compare across images:\n\n- zones: where the host, the headline and the subject sit, and how much of the canvas each takes\n- headline: the words, line count, the role of each line (hook vs punch word), case, relative\n size, colour, stroke, shadow, closest Google Font\n- host: side, crop, expression, gaze, outline or glow\n- background: image or colour, mood, whether it repeats\n- devices: arrows, badges, frames, blur, emoji\n\nThen compare the set: what repeats in most references is the **system**, what appears once is an\noption, and what changes from video to video becomes a **slot**. A set that splits into two or\nthree distinct layouts gets one template per layout — name them and ask which to build if unsure.\n\n## 3 — Design guideline (brand kit)\n\nWrite the guideline as a brand kit in the `brand` skill's format — `brand-kit/tokens.json` +\n`brand-kit/BRAND.md`. Read `{{skill:brand#reference/brandkit-spec.md}}` for the\nshape and `reference/authoring.md` for the rules (screenshots are its source form D). Fill it from\nthe analysis:\n\n- `colorPrimitives` / `semanticColors` — the colours sampled from the references (say they are\n sampled)\n- `typography` — the headline font(s), weights, case and the size ratio between the lines\n- `layout` / `composition` — the zones from step 2, as fractions of the canvas\n- `safeArea` — the platform's (the duration badge, bottom right, for YouTube)\n- `imagery` — host crop and treatment, background mood\n- `device` — the recurring devices\n- `voice` — headline formulas: words per line, the punch words in use\n- `logo` — the channel's mark if the thumbnails carry one; otherwise record it in `$meta.gaps`\n\nDraft the `avoid` list from what the references never do and confirm it with the user, as\n`authoring.md` requires.\n\n**Starting fresh**, the guideline comes first too: turn the chosen direction into the same kit,\nshow the user its key choices (palette, fonts, layout) and confirm them before building.\n\n## 4 — Layers and assets\n\nWhen a reference supplies a host, subject or background worth reusing, split it with the `layerize`\nskill's Stage 1 (Seedream) and follow its rules, with the reference's `uri` from\n`refs.md` as the source image — it is already in the workspace. Keep the person, subject and residual background\nlayers; drop the text layers — the headline is rebuilt as live text.\n\nA user's host photo that is not cut out goes through background removal (`models` skill,\n`bria-rmbg.md`). A missing background can be generated from the kit's `imagery` mood,\n`format: '16:9'`, with \"no people, no text, no logos\" in the prompt.\n\n## 5 — Build the template\n\nBuild from the kit: one page at the format size, the zones from `layout`, back to front. Name the\nslots so they can be filled later:\n\n| name | kind | notes |\n| ---------- | ------- | ------------------------------------------------------ |\n| `bg` | graphic | full-bleed image fill, `Cover` |\n| `host` | graphic | cut-out, `Contain`, anchored to the edge it grows from |\n| `subject` | graphic | optional cut-out, `Contain` |\n| `line1` | text | the hook |\n| `line2` | text | optional punch word, `text.case: 'Uppercase'` |\n| `headline` | group | `line1` + `line2` |\n\nDrop `host` when the style has no presenter; decoration from the style gets its own descriptive\nname. When a headline line is too long for its column, shrink it until it fits — never let it run\nto the edge or into the safe-area corner.\n\nTest the template with a long punch word, a word with a capital diacritic (`ÜBERNIMMT`) and a\nthumbnail without the optional slots, then run the `judge` loop with the kit as the brief. The\nreferences are the style: tight headlines or a host bleeding off the canvas are not faults.\n\nExport it with `export({ format: 'imgly', outPath })` into the output folder and report the kit,\nthe slots and any `$meta.gaps`.\n\n## 6 — New thumbnails\n\nFor each thumbnail, start from the **saved template** — `import({ source: { uri } })` with the\n`uri` its save returned — never chain one thumbnail onto the previous. Fill the slots, hide the\nempty ones, fit the headline, and export JPEG (`export({ format: 'jpeg', blockId: <page>, outPath })`;\nYouTube rejects uploads over 2 MB).\n<!-- requires:open -->\nEach `import` is a copy, so the template stays as it was; `export({ format: 'imgly' })` a filled\nthumbnail only when the user wants it editable too.\n<!-- /requires:open -->\n<!-- unless:open -->\n<!-- requires:version -->\nEach `import` is a copy, a new design with its own `design` and `version`, so the template stays as it was.\n<!-- /requires:version -->\n<!-- unless:version -->\nNever `export({ format: 'imgly' })` a filled thumbnail: the session is still saving into the\ntemplate, so that would overwrite it.\n<!-- /unless:version -->\n<!-- /unless:open -->\nLook at every export and check it against the kit's `avoid` list.\n\nFor a batch, agree on a simple table with the user (e.g. a CSV with one row per video: headline\nlines and image files) and repeat the above per row. If they want to render outside the agent,\nwrite them a small `@cesdk/node` script that loads the exported `.imgly`, fills the same slots by\nname and exports each row; without a CE.SDK licence key it watermarks its output — say so.\n\n## Common mistakes\n\n| Mistake | Fix |\n| --------------------------------------- | ---------------------------------------------------------------------- |\n| Styling from one thumbnail of ten | analyse every reference; the system is what repeats |\n| Building before the guideline exists | write and confirm the kit first — the template is built from it |\n| New image fill comes out zoomed/cropped | `forceLoadResources([slot])`, then `contentFill: { mode: 'Cover' }` |\n| Moving `line1`/`line2` while grouped | positions are relative to the group — ungroup, position, regroup |\n| Typing capitals into `line2` | keep the text as typed; the slot's `text.case` sets it |\n| Sizing Seedream cut-outs by pixel size | place by `bounding_box.absolute` |\n| A person placed with `Cover` | `Contain`, anchored to the bottom edge |\n",
|
|
65
65
|
};
|
|
66
66
|
/** Binary assets, base64-encoded — see the generator header. */
|