@pixel-point/toolcraft 0.0.14 → 0.0.15
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 +13 -2
- package/package.json +1 -1
- package/scripts/prepare-pack.mjs +2 -28
- package/src/cli-io.mjs +174 -0
- package/src/cli-package-manager-flow.test.mjs +206 -0
- package/src/cli.mjs +7 -495
- package/src/cli.test.mjs +34 -177
- package/src/create-command.mjs +152 -0
- package/src/create-options.mjs +194 -0
- package/src/generate-test-assertions.mjs +27 -0
- package/src/generate-test-doc-assertions.mjs +162 -0
- package/src/generate-test-file-assertions.mjs +251 -0
- package/src/generate-test-fs-utils.mjs +59 -0
- package/src/generate-test-integrity-assertions.mjs +30 -0
- package/src/generate-test-integrity-framework-assertions.mjs +222 -0
- package/src/generate-test-integrity-manifest-assertions.mjs +150 -0
- package/src/generate-test-integrity-ownership-assertions.mjs +127 -0
- package/src/generate-test-integrity-test-utils.mjs +102 -0
- package/src/generate-test-package-assertions.mjs +75 -0
- package/src/generate-test-product-fixture.mjs +84 -0
- package/src/generate-test-product-fixture.test.mjs +73 -0
- package/src/generate-test-standalone-assertions.mjs +209 -0
- package/src/generate-transactional.test.mjs +151 -0
- package/src/generate.mjs +182 -102
- package/src/generate.test.mjs +242 -338
- package/src/generated-integrity-manifest.mjs +127 -0
- package/src/generated-integrity-manifest.test.mjs +151 -0
- package/src/generated-source-policy.mjs +22 -0
- package/src/generated-source-policy.test.mjs +35 -0
- package/src/generated-target-policy.mjs +55 -0
- package/src/generation-transaction.mjs +135 -0
- package/src/generation-transaction.test.mjs +74 -0
- package/src/package-json.mjs +18 -1
- package/src/package-json.test.mjs +38 -5
- package/src/package-manager.mjs +2 -0
- package/src/package-manager.test.mjs +5 -1
- package/src/packaged-template-fallback.test.mjs +126 -0
- package/src/prepare-pack-templates.mjs +34 -0
- package/templates/runtime/contracts/component-contract-builders.ts +95 -0
- package/templates/runtime/contracts/component-contracts.choices.test.ts +293 -0
- package/templates/runtime/contracts/component-contracts.choices.ts +322 -0
- package/templates/runtime/contracts/component-contracts.inputs.test.ts +210 -0
- package/templates/runtime/contracts/component-contracts.inputs.ts +252 -0
- package/templates/runtime/contracts/component-contracts.media-custom.test.ts +116 -0
- package/templates/runtime/contracts/component-contracts.media-custom.ts +144 -0
- package/templates/runtime/contracts/component-contracts.runtime-acceptance.test.ts +229 -0
- package/templates/runtime/contracts/component-contracts.runtime-labels.test.ts +76 -0
- package/templates/runtime/contracts/component-contracts.runtime-panels.test.ts +135 -0
- package/templates/runtime/contracts/component-contracts.runtime-shell.test.ts +148 -0
- package/templates/runtime/contracts/component-contracts.runtime.ts +361 -0
- package/templates/runtime/contracts/component-contracts.test.ts +39 -1458
- package/templates/runtime/contracts/component-contracts.ts +44 -1505
- package/templates/runtime/contracts/component-contracts.visual.test.ts +316 -0
- package/templates/runtime/contracts/component-contracts.visual.ts +385 -0
- package/templates/runtime/contracts/contract-manifest.test.ts +64 -0
- package/templates/runtime/contracts/decision-contracts.test.ts +29 -4
- package/templates/runtime/contracts/decision-contracts.ts +38 -1
- package/templates/runtime/index.ts +1 -0
- package/templates/runtime/react/{runtime-public-api.test.tsx → app-shell/runtime-public-api.test.tsx} +29 -7
- package/templates/runtime/react/{settings-transfer.test.ts → app-shell/settings-transfer.test.ts} +4 -4
- package/templates/runtime/react/{settings-transfer.ts → app-shell/settings-transfer.ts} +3 -3
- package/templates/runtime/react/{toolbar-panel.test.tsx → app-shell/toolbar-panel.test.tsx} +2 -2
- package/templates/runtime/react/{toolbar-panel.tsx → app-shell/toolbar-panel.tsx} +3 -3
- package/templates/runtime/react/{toolcraft-app.integration.test.tsx → app-shell/toolcraft-app.integration.test.tsx} +6 -6
- package/templates/runtime/react/{toolcraft-app.test.tsx → app-shell/toolcraft-app.test.tsx} +3 -3
- package/templates/runtime/react/{toolcraft-app.tsx → app-shell/toolcraft-app.tsx} +11 -8
- package/templates/runtime/react/{toolcraft-root.test.tsx → app-shell/toolcraft-root.test.tsx} +1 -1
- package/templates/runtime/react/{toolcraft-root.tsx → app-shell/toolcraft-root.tsx} +5 -5
- package/templates/runtime/react/{use-toolcraft.ts → app-shell/use-toolcraft.ts} +1 -1
- package/templates/runtime/react/canvas/canvas-default-media-layer.tsx +81 -0
- package/templates/runtime/react/canvas/canvas-media-transform.ts +33 -0
- package/templates/runtime/react/canvas/canvas-shell-interactions.test.tsx +156 -0
- package/templates/runtime/react/canvas/canvas-shell-media-rendering.test.tsx +87 -0
- package/templates/runtime/react/canvas/canvas-shell-rendering.test.tsx +102 -0
- package/templates/runtime/react/canvas/canvas-shell-test-utils.tsx +108 -0
- package/templates/runtime/react/canvas/canvas-shell-upload.test.tsx +106 -0
- package/templates/runtime/react/canvas/canvas-shell.tsx +146 -0
- package/templates/runtime/react/canvas/canvas-upload-routing.ts +84 -0
- package/templates/runtime/react/{media-file.ts → canvas/media-file.ts} +1 -1
- package/templates/runtime/react/canvas/use-canvas-drop-import.ts +145 -0
- package/templates/runtime/react/canvas/use-canvas-viewport-interactions.ts +227 -0
- package/templates/runtime/react/controls-panel/__tests__/control-conditions.test.ts +89 -0
- package/templates/runtime/react/{controls-panel-filedrop-reorder.test.tsx → controls-panel/__tests__/controls-panel-filedrop-reorder.test.tsx} +4 -4
- package/templates/runtime/react/controls-panel/__tests__/controls-panel.actions-layout.test.tsx +91 -0
- package/templates/runtime/react/controls-panel/__tests__/controls-panel.collection-actions.test.tsx +213 -0
- package/templates/runtime/react/controls-panel/__tests__/controls-panel.color-layout.test.tsx +366 -0
- package/templates/runtime/react/controls-panel/__tests__/controls-panel.color-picker-models.test.tsx +169 -0
- package/templates/runtime/react/controls-panel/__tests__/controls-panel.compound-layout.test.tsx +160 -0
- package/templates/runtime/react/controls-panel/__tests__/controls-panel.control-visibility.test.tsx +352 -0
- package/templates/runtime/react/controls-panel/__tests__/controls-panel.curves.test.tsx +226 -0
- package/templates/runtime/react/controls-panel/__tests__/controls-panel.floating-shell.test.tsx +13 -0
- package/templates/runtime/react/controls-panel/__tests__/controls-panel.font-picker.test.tsx +302 -0
- package/templates/runtime/react/controls-panel/__tests__/controls-panel.footer-actions.test.tsx +401 -0
- package/templates/runtime/react/controls-panel/__tests__/controls-panel.gradient-control.test.tsx +139 -0
- package/templates/runtime/react/controls-panel/__tests__/controls-panel.help-policy.test.tsx +103 -0
- package/templates/runtime/react/controls-panel/__tests__/controls-panel.image-picker.test.tsx +16 -0
- package/templates/runtime/react/controls-panel/__tests__/controls-panel.inline-layout.test.tsx +290 -0
- package/templates/runtime/react/controls-panel/__tests__/controls-panel.keyframes.test.tsx +175 -0
- package/templates/runtime/react/controls-panel/__tests__/controls-panel.media-upload-files.test.tsx +121 -0
- package/templates/runtime/react/controls-panel/__tests__/controls-panel.media-upload-image.test.tsx +363 -0
- package/templates/runtime/react/controls-panel/__tests__/controls-panel.media-upload-multi-image.test.tsx +105 -0
- package/templates/runtime/react/controls-panel/__tests__/controls-panel.range-slider-editing.test.tsx +149 -0
- package/templates/runtime/react/controls-panel/__tests__/controls-panel.section-shell.test.tsx +138 -0
- package/templates/runtime/react/controls-panel/__tests__/controls-panel.select-layout.test.tsx +148 -0
- package/templates/runtime/react/controls-panel/__tests__/controls-panel.setup-controls.test.tsx +189 -0
- package/templates/runtime/react/controls-panel/__tests__/controls-panel.slider-rendering.test.tsx +317 -0
- package/templates/runtime/react/controls-panel/__tests__/controls-panel.state-reset.test.tsx +137 -0
- package/templates/runtime/react/controls-panel/__tests__/controls-panel.structure.test.tsx +66 -0
- package/templates/runtime/react/controls-panel/__tests__/controls-panel.text-input.test.tsx +205 -0
- package/templates/runtime/react/controls-panel/__tests__/controls-panel.vector-interaction.test.tsx +388 -0
- package/templates/runtime/react/controls-panel/__tests__/controls-panel.vector-layout.test.tsx +155 -0
- package/templates/runtime/react/controls-panel/actions/controls-panel-actions.ts +172 -0
- package/templates/runtime/react/{control-conditions.ts → controls-panel/conditions/control-conditions.ts} +26 -3
- package/templates/runtime/react/{control-renderers.ts → controls-panel/control-renderers.ts} +2 -2
- package/templates/runtime/react/controls-panel/controls-panel.tsx +250 -0
- package/templates/runtime/react/controls-panel/keyframes/controls-panel-keyframes.tsx +265 -0
- package/templates/runtime/react/controls-panel/layout/controls-panel-collapse-storage.ts +131 -0
- package/templates/runtime/react/controls-panel/layout/controls-panel-help.tsx +132 -0
- package/templates/runtime/react/controls-panel/layout/controls-panel-inline-layout.tsx +311 -0
- package/templates/runtime/react/controls-panel/layout/controls-panel-layout.tsx +216 -0
- package/templates/runtime/react/controls-panel/layout/controls-panel-section.tsx +401 -0
- package/templates/runtime/react/controls-panel/renderers/controls-panel-action-renderer.tsx +137 -0
- package/templates/runtime/react/controls-panel/renderers/controls-panel-basic-renderers.tsx +421 -0
- package/templates/runtime/react/controls-panel/renderers/controls-panel-collection-renderer.tsx +286 -0
- package/templates/runtime/react/controls-panel/renderers/controls-panel-compound-renderers.tsx +366 -0
- package/templates/runtime/react/controls-panel/renderers/controls-panel-media-renderer.tsx +173 -0
- package/templates/runtime/react/controls-panel/renderers/controls-panel-renderer-registry.test.ts +23 -0
- package/templates/runtime/react/controls-panel/renderers/controls-panel-renderer-registry.ts +55 -0
- package/templates/runtime/react/controls-panel/renderers/controls-panel-settings-transfer-renderer.tsx +45 -0
- package/templates/runtime/react/controls-panel/testing/controls-panel-test-utils.tsx +300 -0
- package/templates/runtime/react/controls-panel/values/controls-panel-aspect-ratio-values.ts +94 -0
- package/templates/runtime/react/controls-panel/values/controls-panel-collection-values.ts +87 -0
- package/templates/runtime/react/controls-panel/values/controls-panel-color-values.ts +82 -0
- package/templates/runtime/react/controls-panel/values/controls-panel-font-values.ts +69 -0
- package/templates/runtime/react/controls-panel/values/controls-panel-spatial-values.ts +64 -0
- package/templates/runtime/react/controls-panel/values/controls-panel-value-labels.ts +93 -0
- package/templates/runtime/react/controls-panel/values/controls-panel-value-primitives.ts +30 -0
- package/templates/runtime/react/controls-panel/values/controls-panel-values.ts +7 -0
- package/templates/runtime/react/index.ts +13 -13
- package/templates/runtime/react/{layer-tree.ts → layers/layer-tree.ts} +1 -1
- package/templates/runtime/react/layers/layers-panel-drag-drop.test.tsx +190 -0
- package/templates/runtime/react/layers/layers-panel-editing.test.tsx +41 -0
- package/templates/runtime/react/layers/layers-panel-insert-targets.test.ts +87 -0
- package/templates/runtime/react/layers/layers-panel-insert-targets.ts +254 -0
- package/templates/runtime/react/layers/layers-panel-model.ts +15 -0
- package/templates/runtime/react/layers/layers-panel-rendering.test.tsx +43 -0
- package/templates/runtime/react/layers/layers-panel-reorder.ts +148 -0
- package/templates/runtime/react/layers/layers-panel-row.tsx +475 -0
- package/templates/runtime/react/layers/layers-panel-test-utils.tsx +135 -0
- package/templates/runtime/react/layers/layers-panel-visibility.test.tsx +126 -0
- package/templates/runtime/react/layers/layers-panel.tsx +349 -0
- package/templates/runtime/react/layers/use-layers-panel-drag-controller.ts +327 -0
- package/templates/runtime/react/{panel-host-types.ts → panel-host/panel-host-types.ts} +2 -2
- package/templates/runtime/react/{panel-host.test.tsx → panel-host/panel-host.test.tsx} +3 -3
- package/templates/runtime/react/{panel-host.tsx → panel-host/panel-host.tsx} +1 -1
- package/templates/runtime/react/timeline/timeline-easing-editor.tsx +409 -0
- package/templates/runtime/react/timeline/timeline-easing-geometry.ts +42 -0
- package/templates/runtime/react/timeline/timeline-easing-icons.tsx +135 -0
- package/templates/runtime/react/timeline/timeline-easing-model.test.ts +87 -0
- package/templates/runtime/react/timeline/timeline-easing-model.ts +271 -0
- package/templates/runtime/react/timeline/timeline-easing-popover-content.tsx +227 -0
- package/templates/runtime/react/timeline/timeline-easing-popover-layout.ts +69 -0
- package/templates/runtime/react/timeline/timeline-easing-popover.tsx +60 -0
- package/templates/runtime/react/timeline/timeline-event-targets.ts +19 -0
- package/templates/runtime/react/timeline/timeline-expanded-content.tsx +299 -0
- package/templates/runtime/react/timeline/timeline-icon-button.tsx +51 -0
- package/templates/runtime/react/timeline/timeline-keyframe-row.tsx +360 -0
- package/templates/runtime/react/timeline/timeline-keyframes.ts +23 -0
- package/templates/runtime/react/timeline/timeline-panel-floating-layout.test.tsx +328 -0
- package/templates/runtime/react/timeline/timeline-panel-header.tsx +404 -0
- package/templates/runtime/react/timeline/timeline-panel-keyframes.test.tsx +90 -0
- package/templates/runtime/react/timeline/timeline-panel-layout.ts +30 -0
- package/templates/runtime/react/timeline/timeline-panel-responsive-layout.ts +182 -0
- package/templates/runtime/react/timeline/timeline-panel-test-utils.tsx +88 -0
- package/templates/runtime/react/timeline/timeline-panel-transport.test.tsx +202 -0
- package/templates/runtime/react/timeline/timeline-panel-upload.test.tsx +53 -0
- package/templates/runtime/react/timeline/timeline-panel.tsx +449 -0
- package/templates/runtime/react/timeline/timeline-playback-hooks.ts +254 -0
- package/templates/runtime/schema/assembly-contract.ts +271 -0
- package/templates/runtime/schema/control-schema-normalization.ts +55 -0
- package/templates/runtime/schema/controls-panel-actions.ts +141 -0
- package/templates/runtime/schema/controls-panel-layout-groups.ts +144 -0
- package/templates/runtime/schema/controls-panel-normalization.ts +19 -0
- package/templates/runtime/schema/controls-panel-section-layout.ts +140 -0
- package/templates/runtime/schema/controls-panel-section-titles.ts +161 -0
- package/templates/runtime/schema/define-toolcraft-test-utils.ts +18 -0
- package/templates/runtime/schema/define-toolcraft.actions.test.ts +182 -0
- package/templates/runtime/schema/define-toolcraft.assembly.test.ts +246 -0
- package/templates/runtime/schema/define-toolcraft.canvas.test.ts +150 -0
- package/templates/runtime/schema/define-toolcraft.control-layout.test.ts +345 -0
- package/templates/runtime/schema/define-toolcraft.control-sections.test.ts +304 -0
- package/templates/runtime/schema/define-toolcraft.setup-canvas.test.ts +69 -0
- package/templates/runtime/schema/define-toolcraft.setup-persistence.test.ts +66 -0
- package/templates/runtime/schema/define-toolcraft.setup-render-scale-timeline.test.ts +116 -0
- package/templates/runtime/schema/define-toolcraft.setup-settings-transfer.test.ts +291 -0
- package/templates/runtime/schema/define-toolcraft.ts +24 -1449
- package/templates/runtime/schema/panels-schema-normalization.ts +49 -0
- package/templates/runtime/schema/runtime-section-titles.ts +1 -0
- package/templates/runtime/schema/runtime-setup-section.ts +282 -0
- package/templates/runtime/schema/schema-resolvers.ts +168 -0
- package/templates/runtime/schema/types.ts +17 -0
- package/templates/runtime/state/canvas-reducer.ts +106 -0
- package/templates/runtime/state/canvas-state.ts +209 -0
- package/templates/runtime/state/controls-reducer.ts +277 -0
- package/templates/runtime/state/history-patches.ts +174 -0
- package/templates/runtime/state/layer-state.ts +12 -0
- package/templates/runtime/state/layers-reducer.ts +318 -0
- package/templates/runtime/state/media-reducer.ts +283 -0
- package/templates/runtime/state/media-state.ts +105 -0
- package/templates/runtime/state/panels-reducer.ts +58 -0
- package/templates/runtime/state/persistence-merge.ts +53 -0
- package/templates/runtime/state/persistence-reader-canvas.ts +27 -0
- package/templates/runtime/state/persistence-reader-layers.ts +73 -0
- package/templates/runtime/state/persistence-reader-media.ts +82 -0
- package/templates/runtime/state/persistence-reader-panels.ts +56 -0
- package/templates/runtime/state/persistence-reader-primitives.ts +27 -0
- package/templates/runtime/state/persistence-reader-timeline.ts +145 -0
- package/templates/runtime/state/persistence-reader-values.ts +40 -0
- package/templates/runtime/state/persistence-readers.ts +72 -0
- package/templates/runtime/state/persistence-shared.ts +23 -0
- package/templates/runtime/state/persistence-snapshot.ts +57 -0
- package/templates/runtime/state/persistence.ts +16 -581
- package/templates/runtime/state/reducer-canvas-panels.test.ts +324 -0
- package/templates/runtime/state/reducer-controls.test.ts +158 -0
- package/templates/runtime/state/reducer-layers.test.ts +306 -0
- package/templates/runtime/state/reducer-media-import-sizing.test.ts +197 -0
- package/templates/runtime/state/reducer-media-reorder-history.test.ts +116 -0
- package/templates/runtime/state/reducer-media-reset.test.ts +249 -0
- package/templates/runtime/state/reducer-media-test-utils.ts +40 -0
- package/templates/runtime/state/reducer-media-transform.test.ts +52 -0
- package/templates/runtime/state/reducer-test-utils.ts +30 -0
- package/templates/runtime/state/reducer-timeline.test.ts +242 -0
- package/templates/runtime/state/reducer.ts +57 -1785
- package/templates/runtime/state/timeline-reducer.ts +412 -0
- package/templates/runtime/state/timeline-values.test.ts +45 -0
- package/templates/runtime/state/timeline-values.ts +45 -0
- package/templates/runtime/testing/performance-browser-policy.test.ts +81 -0
- package/templates/runtime/testing/performance-browser-policy.ts +102 -0
- package/templates/runtime/testing/performance-budget-validation.ts +84 -0
- package/templates/runtime/testing/performance-control-classification.test.ts +106 -0
- package/templates/runtime/testing/performance-control-classification.ts +101 -0
- package/templates/runtime/testing/performance-coverage-context.ts +44 -0
- package/templates/runtime/testing/performance-coverage-renderer-policy.ts +221 -0
- package/templates/runtime/testing/performance-coverage-scenario-policy.ts +147 -0
- package/templates/runtime/testing/performance-coverage-target-policy.ts +121 -0
- package/templates/runtime/testing/performance-coverage-validator.ts +34 -0
- package/templates/runtime/testing/performance-export-coverage.test.ts +234 -0
- package/templates/runtime/testing/performance-fixture-load-profile.test.ts +360 -0
- package/templates/runtime/testing/performance-fixture-media.test.ts +80 -0
- package/templates/runtime/testing/performance-fixture-stress.test.ts +314 -0
- package/templates/runtime/testing/performance-fixture-validation.ts +255 -0
- package/templates/runtime/testing/performance-fixture-values.ts +275 -0
- package/templates/runtime/testing/performance-fixture-workload.test.ts +140 -0
- package/templates/runtime/testing/performance-load-profile-validation.ts +467 -0
- package/templates/runtime/testing/performance-renderer-coverage.test.ts +325 -0
- package/templates/runtime/testing/performance-renderer-pipeline-coverage.test.ts +115 -0
- package/templates/runtime/testing/performance-renderer-pipeline-interactions.test.ts +201 -0
- package/templates/runtime/testing/performance-renderer-pipeline-passes.test.ts +247 -0
- package/templates/runtime/testing/performance-renderer-pipeline-validation.ts +360 -0
- package/templates/runtime/testing/performance-renderer-technique-validation.ts +329 -0
- package/templates/runtime/testing/performance-renderer-technique.test.ts +275 -0
- package/templates/runtime/testing/performance-renderer-validation.ts +2 -0
- package/templates/runtime/testing/performance-scenario-coverage.test.ts +303 -0
- package/templates/runtime/testing/performance-scenario-validation.ts +49 -0
- package/templates/runtime/testing/performance-schema-derived-workloads.test.ts +231 -0
- package/templates/runtime/testing/performance-schema-queries.ts +181 -0
- package/templates/runtime/testing/performance-test-fixtures/index.ts +4 -0
- package/templates/runtime/testing/performance-test-fixtures/renderer-pipelines.ts +322 -0
- package/templates/runtime/testing/performance-test-fixtures/scenarios.ts +172 -0
- package/templates/runtime/testing/performance-test-fixtures/schemas.ts +151 -0
- package/templates/runtime/testing/performance-test-fixtures/stress-fixtures.ts +133 -0
- package/templates/runtime/testing/performance-test-fixtures.ts +1 -0
- package/templates/runtime/testing/performance-types.ts +338 -0
- package/templates/runtime/testing/performance.ts +15 -2485
- package/templates/starter/AGENTS.md +41 -26
- package/templates/starter/LICENSE.md +18 -95
- package/templates/starter/NOTICE.md +3 -3
- package/templates/starter/docs/toolcraft/README.md +5 -5
- package/templates/starter/docs/toolcraft/acceptance-testing.md +36 -8
- package/templates/starter/docs/toolcraft/assembly-workflow.md +12 -15
- package/templates/starter/docs/toolcraft/component-rules.md +6 -2
- package/templates/starter/docs/toolcraft/core/layout.md +1 -0
- package/templates/starter/docs/toolcraft/core/performance.md +7 -4
- package/templates/starter/docs/toolcraft/core/runtime-boundary.md +11 -4
- package/templates/starter/docs/toolcraft/core/timeline-animation.md +1 -0
- package/templates/starter/docs/toolcraft/custom-controls.md +8 -1
- package/templates/starter/docs/toolcraft/decision-contract.md +26 -22
- package/templates/starter/docs/toolcraft/performance.md +42 -16
- package/templates/starter/docs/toolcraft/schema-reference.md +34 -23
- package/templates/starter/docs/toolcraft/workflow.md +25 -17
- package/templates/starter/e2e/app-browser-acceptance-evidence.spec.ts +111 -0
- package/templates/starter/e2e/app-browser-control-coverage.spec.ts +118 -0
- package/templates/starter/e2e/app-browser-performance-evidence.spec.ts +217 -0
- package/templates/starter/e2e/app-browser-performance-probe.spec.ts +322 -0
- package/templates/starter/e2e/app-browser-proof-session.spec.ts +196 -0
- package/templates/starter/e2e/app-browser-runtime-evidence.spec.ts +9 -0
- package/templates/starter/e2e/app-browser-runtime-provenance.spec.ts +240 -0
- package/templates/starter/e2e/app-browser-runtime-reporter.spec.ts +180 -0
- package/templates/starter/e2e/app-browser-runtime-requirements.spec.ts +310 -0
- package/templates/starter/e2e/app-browser-semantic-evidence.spec.ts +432 -0
- package/templates/starter/e2e/app-browser-shell.spec.ts +171 -0
- package/templates/starter/e2e/app-browser-timeline-layers-reference.spec.ts +70 -0
- package/templates/starter/e2e/app-performance.spec.ts +0 -491
- package/templates/starter/e2e/browser-acceptance-outcome-helpers.ts +97 -0
- package/templates/starter/e2e/browser-acceptance-transition-helpers.ts +74 -0
- package/templates/starter/e2e/browser-conditional-output-evidence-helpers.ts +230 -0
- package/templates/starter/e2e/browser-control-target-helpers.ts +109 -0
- package/templates/starter/e2e/browser-layer-evidence-helpers.ts +229 -0
- package/templates/starter/e2e/browser-proof-session.ts +392 -0
- package/templates/starter/e2e/browser-runtime-evidence-reporter.ts +136 -0
- package/templates/starter/e2e/browser-runtime-evidence-requirements.ts +290 -0
- package/templates/starter/e2e/browser-runtime-evidence.ts +27 -0
- package/templates/starter/e2e/browser-state-evidence-helpers.ts +205 -0
- package/templates/starter/e2e/browser-timeline-evidence-helpers.ts +319 -0
- package/templates/starter/e2e/canvas-handle-helpers.ts +86 -4
- package/templates/starter/e2e/export-artifact-helpers.ts +132 -0
- package/templates/starter/e2e/performance-budget-helpers.ts +159 -0
- package/templates/starter/e2e/performance-canvas-helpers.ts +123 -0
- package/templates/starter/e2e/performance-control-helpers.ts +3 -0
- package/templates/starter/e2e/performance-control-layout-helpers.ts +161 -0
- package/templates/starter/e2e/performance-fixture-helpers.ts +217 -0
- package/templates/starter/e2e/performance-frame-probe.ts +247 -0
- package/templates/starter/e2e/performance-helpers.ts +6 -854
- package/templates/starter/e2e/performance-interaction-measurement.ts +251 -0
- package/templates/starter/e2e/performance-measurement-evidence.ts +72 -0
- package/templates/starter/e2e/performance-output-action-helpers.spec.ts +43 -0
- package/templates/starter/e2e/performance-output-action-helpers.ts +109 -0
- package/templates/starter/e2e/performance-probe-helpers.ts +12 -0
- package/templates/starter/e2e/performance-render-scale-helpers.ts +55 -0
- package/templates/starter/e2e/performance-slider-helpers.ts +271 -0
- package/templates/starter/e2e/product-observable-helpers.ts +72 -17
- package/templates/starter/e2e/stable-outcome-helpers.ts +208 -0
- package/templates/starter/package.json +10 -5
- package/templates/starter/playwright.config.ts +5 -2
- package/templates/starter/scripts/check-ai-skills.mjs +14 -8
- package/templates/starter/scripts/check-ai-skills.test.mjs +64 -0
- package/templates/starter/scripts/check-toolcraft-code-health.mjs +108 -0
- package/templates/starter/scripts/check-toolcraft-code-health.test.mjs +213 -0
- package/templates/starter/scripts/check-toolcraft-docs.mjs +47 -34
- package/templates/starter/scripts/check-toolcraft-integrity.mjs +141 -144
- package/templates/starter/scripts/run-browser-performance.mjs +118 -0
- package/templates/starter/scripts/run-browser-performance.test.mjs +53 -0
- package/templates/starter/scripts/toolcraft-code-health-core.mjs +297 -0
- package/templates/starter/scripts/toolcraft-contract-doc-integrity.mjs +77 -0
- package/templates/starter/scripts/toolcraft-contract-doc-integrity.test.mjs +81 -0
- package/templates/starter/scripts/toolcraft-contract-manifest.json +113 -0
- package/templates/starter/scripts/toolcraft-contract-manifest.mjs +128 -0
- package/templates/starter/scripts/toolcraft-contract-manifest.test.mjs +72 -0
- package/templates/starter/scripts/toolcraft-integrity-manifest.mjs +172 -0
- package/templates/starter/scripts/toolcraft-integrity-policy.mjs +60 -0
- package/templates/starter/scripts/toolcraft-product-boundary-ast-utils.mjs +23 -0
- package/templates/starter/scripts/toolcraft-product-boundary-ast.mjs +264 -0
- package/templates/starter/scripts/toolcraft-product-boundary-test-fixtures.mjs +16 -0
- package/templates/starter/scripts/toolcraft-product-boundary.mjs +243 -0
- package/templates/starter/scripts/toolcraft-product-boundary.test.mjs +289 -0
- package/templates/starter/scripts/toolcraft-product-dependency-graph.mjs +176 -0
- package/templates/starter/scripts/toolcraft-product-dependency-graph.test.mjs +196 -0
- package/templates/starter/scripts/toolcraft-product-dependency-resolution.mjs +279 -0
- package/templates/starter/scripts/toolcraft-product-evidence-boundary-ast.mjs +91 -0
- package/templates/starter/scripts/toolcraft-product-evidence-boundary.test.mjs +138 -0
- package/templates/starter/scripts/toolcraft-product-style-boundary.mjs +219 -0
- package/templates/starter/scripts/toolcraft-source-inventory.d.mts +46 -0
- package/templates/starter/scripts/toolcraft-source-inventory.mjs +187 -0
- package/templates/starter/scripts/toolcraft-source-inventory.test.mjs +132 -0
- package/templates/starter/scripts/toolcraft-source-ownership.mjs +167 -0
- package/templates/starter/scripts/toolcraft-source-ownership.test.mjs +113 -0
- package/templates/starter/scripts/toolcraft-static-string.mjs +104 -0
- package/templates/starter/scripts/toolcraft-verification-inventory.mjs +123 -0
- package/templates/starter/scripts/toolcraft-verification-receipt.d.mts +19 -0
- package/templates/starter/scripts/toolcraft-verification-receipt.mjs +284 -0
- package/templates/starter/scripts/toolcraft-verification-receipt.test.mjs +282 -0
- package/templates/starter/scripts/toolcraft-vitest-runtime-contract.d.mts +32 -0
- package/templates/starter/scripts/toolcraft-vitest-runtime-contract.mjs +88 -0
- package/templates/starter/scripts/toolcraft-vitest-runtime-contract.test.mjs +87 -0
- package/templates/starter/scripts/toolcraft-vitest-runtime-evidence-reporter.mjs +109 -0
- package/templates/starter/scripts/toolcraft-vitest-runtime-evidence-reporter.test.mjs +111 -0
- package/templates/starter/scripts/toolcraft-workflow-routes.mjs +314 -0
- package/templates/starter/scripts/toolcraft-workflow-routes.test.mjs +204 -0
- package/templates/starter/src/app/acceptance/actions.ts +30 -0
- package/templates/starter/src/app/acceptance/animation-intent.ts +184 -0
- package/templates/starter/src/app/acceptance/canvas-handle-acceptance.ts +70 -0
- package/templates/starter/src/app/acceptance/color-bank-labels.ts +164 -0
- package/templates/starter/src/app/acceptance/conditions.ts +80 -0
- package/templates/starter/src/app/acceptance/control-acceptance-context.ts +70 -0
- package/templates/starter/src/app/acceptance/control-acceptance-coverage.ts +271 -0
- package/templates/starter/src/app/acceptance/control-acceptance-kind-rules.ts +149 -0
- package/templates/starter/src/app/acceptance/control-acceptance-policy.ts +189 -0
- package/templates/starter/src/app/acceptance/control-acceptance.ts +70 -0
- package/templates/starter/src/app/acceptance/control-component-rules.ts +277 -0
- package/templates/starter/src/app/acceptance/control-labels.ts +223 -0
- package/templates/starter/src/app/acceptance/control-layout-dependency-rules.ts +107 -0
- package/templates/starter/src/app/acceptance/control-layout-entity-rules.ts +104 -0
- package/templates/starter/src/app/acceptance/control-layout-model.ts +159 -0
- package/templates/starter/src/app/acceptance/control-layout-section-rules.ts +164 -0
- package/templates/starter/src/app/acceptance/control-layout.ts +45 -0
- package/templates/starter/src/app/acceptance/control-order.ts +123 -0
- package/templates/starter/src/app/acceptance/control-parts.ts +47 -0
- package/templates/starter/src/app/acceptance/control-section-inventory.ts +183 -0
- package/templates/starter/src/app/acceptance/controls.ts +27 -0
- package/templates/starter/src/app/acceptance/coverage.ts +81 -0
- package/templates/starter/src/app/acceptance/custom-controls.ts +140 -0
- package/templates/starter/src/app/acceptance/inline-layout.ts +192 -0
- package/templates/starter/src/app/acceptance/media-upload.ts +55 -0
- package/templates/starter/src/app/acceptance/output-background-rules.ts +135 -0
- package/templates/starter/src/app/acceptance/output-export-actions.test.ts +76 -0
- package/templates/starter/src/app/acceptance/output-export-actions.ts +34 -0
- package/templates/starter/src/app/acceptance/output-export-layout-rules.ts +46 -0
- package/templates/starter/src/app/acceptance/output-export-model.ts +146 -0
- package/templates/starter/src/app/acceptance/output-export.ts +45 -0
- package/templates/starter/src/app/acceptance/output-image-export-rules.ts +87 -0
- package/templates/starter/src/app/acceptance/reference-runtime-coverage.ts +96 -0
- package/templates/starter/src/app/acceptance/reference-runtime-feature-inventory.ts +171 -0
- package/templates/starter/src/app/acceptance/reference-runtime-study.ts +73 -0
- package/templates/starter/src/app/acceptance/reference-runtime-timeline.ts +291 -0
- package/templates/starter/src/app/acceptance/reference-runtime.ts +99 -0
- package/templates/starter/src/app/acceptance/runtime-coverage.ts +290 -0
- package/templates/starter/src/app/acceptance/runtime-setup.ts +117 -0
- package/templates/starter/src/app/acceptance/section-title-rules.ts +8 -0
- package/templates/starter/src/app/acceptance/sections.ts +6 -0
- package/templates/starter/src/app/acceptance/semantic.ts +63 -0
- package/templates/starter/src/app/acceptance/timeline-loop.ts +21 -0
- package/templates/starter/src/app/acceptance/types.ts +363 -0
- package/templates/starter/src/app/acceptance/validate-coverage.ts +217 -0
- package/templates/starter/src/app/acceptance/validation-pipeline.test.ts +56 -0
- package/templates/starter/src/app/acceptance/validation-pipeline.ts +60 -0
- package/templates/starter/src/app/acceptance/video-reference-study.ts +217 -0
- package/templates/starter/src/app/starter-acceptance-data.ts +21 -0
- package/templates/starter/src/app/starter-acceptance.animation-intent.test.ts +383 -0
- package/templates/starter/src/app/starter-acceptance.background-export.test.ts +349 -0
- package/templates/starter/src/app/starter-acceptance.base-coverage.test.ts +47 -0
- package/templates/starter/src/app/starter-acceptance.canvas-handles.test.ts +71 -0
- package/templates/starter/src/app/starter-acceptance.canvas-sizing.test.ts +199 -0
- package/templates/starter/src/app/starter-acceptance.compound-part-coverage.test.ts +244 -0
- package/templates/starter/src/app/starter-acceptance.contract-fixtures.ts +63 -0
- package/templates/starter/src/app/starter-acceptance.control-label-context.test.ts +172 -0
- package/templates/starter/src/app/starter-acceptance.control-labels.test.ts +387 -0
- package/templates/starter/src/app/starter-acceptance.control-naming-rules.test.ts +215 -0
- package/templates/starter/src/app/starter-acceptance.control-order.test.ts +274 -0
- package/templates/starter/src/app/starter-acceptance.control-state.test.ts +275 -0
- package/templates/starter/src/app/starter-acceptance.curves-rules.test.ts +184 -0
- package/templates/starter/src/app/starter-acceptance.custom-control-collections.test.ts +200 -0
- package/templates/starter/src/app/starter-acceptance.custom-control-coverage.test.ts +111 -0
- package/templates/starter/src/app/starter-acceptance.custom-control-fit-check.test.ts +135 -0
- package/templates/starter/src/app/starter-acceptance.custom-control-valid.test.ts +74 -0
- package/templates/starter/src/app/starter-acceptance.export-test-utils.ts +107 -0
- package/templates/starter/src/app/starter-acceptance.framework-boundary.test.ts +327 -0
- package/templates/starter/src/app/starter-acceptance.image-video-export-settings.test.ts +328 -0
- package/templates/starter/src/app/starter-acceptance.keyframes.test.ts +242 -0
- package/templates/starter/src/app/starter-acceptance.layers.test.ts +203 -0
- package/templates/starter/src/app/starter-acceptance.media-upload.fixtures.ts +110 -0
- package/templates/starter/src/app/starter-acceptance.media-upload.test.ts +153 -0
- package/templates/starter/src/app/starter-acceptance.output-export-rules.test.ts +97 -0
- package/templates/starter/src/app/starter-acceptance.persistence-coverage.test.ts +134 -0
- package/templates/starter/src/app/starter-acceptance.product-output-export.test.ts +202 -0
- package/templates/starter/src/app/starter-acceptance.product-readiness-rules.test.ts +14 -0
- package/templates/starter/src/app/starter-acceptance.product-readiness-test-utils.ts +25 -0
- package/templates/starter/src/app/starter-acceptance.product-readiness.test.ts +50 -0
- package/templates/starter/src/app/starter-acceptance.product-worklog.test.ts +27 -0
- package/templates/starter/src/app/starter-acceptance.range-slider-rules.test.ts +147 -0
- package/templates/starter/src/app/starter-acceptance.reference-custom-timeline.test.ts +197 -0
- package/templates/starter/src/app/starter-acceptance.reference-foundation.test.ts +304 -0
- package/templates/starter/src/app/starter-acceptance.reference-test-utils.ts +102 -0
- package/templates/starter/src/app/starter-acceptance.reference-timeline.test.ts +267 -0
- package/templates/starter/src/app/starter-acceptance.schema-test-utils.ts +116 -0
- package/templates/starter/src/app/starter-acceptance.section-cohesion.test.ts +373 -0
- package/templates/starter/src/app/starter-acceptance.section-dependencies.test.ts +260 -0
- package/templates/starter/src/app/starter-acceptance.section-titles.test.ts +180 -0
- package/templates/starter/src/app/starter-acceptance.setup-readiness.test.ts +205 -0
- package/templates/starter/src/app/starter-acceptance.slider-rules.test.ts +470 -0
- package/templates/starter/src/app/starter-acceptance.slider-unit-rules.test.ts +61 -0
- package/templates/starter/src/app/starter-acceptance.source-test-utils.ts +43 -0
- package/templates/starter/src/app/starter-acceptance.test-utils.ts +21 -0
- package/templates/starter/src/app/starter-acceptance.text-control-kind.test.ts +89 -0
- package/templates/starter/src/app/starter-acceptance.timeline-playback.test.ts +264 -0
- package/templates/starter/src/app/starter-acceptance.timeline-test-utils.ts +56 -0
- package/templates/starter/src/app/starter-acceptance.toggle-pair-layout.test.ts +200 -0
- package/templates/starter/src/app/starter-acceptance.toggle-parameter-layout.test.ts +277 -0
- package/templates/starter/src/app/starter-acceptance.ts +151 -4576
- package/templates/starter/src/app/starter-acceptance.video-export-test-utils.ts +37 -0
- package/templates/starter/src/app/starter-acceptance.video-reference-study.test.ts +262 -0
- package/templates/starter/src/app/starter-acceptance.worklog-test-utils.ts +428 -0
- package/templates/starter/src/app/starter-acceptance.worklog.test.ts +283 -0
- package/templates/starter/src/app/starter-automated-runtime-evidence.test.ts +34 -0
- package/templates/starter/src/app/starter-composition.tsx +7 -0
- package/templates/starter/src/app/starter-performance-test-utils.ts +275 -0
- package/templates/starter/src/app/starter-performance.budgets.test.ts +374 -0
- package/templates/starter/src/app/starter-performance.gates.test.ts +128 -0
- package/templates/starter/src/app/starter-performance.renderer-source.test.ts +136 -0
- package/templates/starter/src/app/starter-performance.renderer-technique.test.ts +291 -0
- package/templates/starter/src/app/starter-performance.scenarios.test.ts +355 -0
- package/templates/starter/src/app/test-evidence/browser-runtime-contract.test.ts +253 -0
- package/templates/starter/src/app/test-evidence/browser-runtime-contract.ts +243 -0
- package/templates/starter/src/routes/index.tsx +11 -2
- package/templates/starter/vite.config.ts +8 -0
- package/templates/ui/components/controls/color/color-control-types.ts +38 -0
- package/templates/ui/components/controls/color/color-control.tsx +19 -437
- package/templates/ui/components/controls/color/color-footer.tsx +272 -0
- package/templates/ui/components/controls/color/color-model-slider.tsx +271 -0
- package/templates/ui/components/controls/color/color-opacity-input.tsx +94 -0
- package/templates/ui/components/controls/color/color-surface.tsx +194 -0
- package/templates/ui/components/controls/color/color-value-control.tsx +159 -0
- package/templates/ui/components/controls/color/color-value-utils.ts +170 -0
- package/templates/ui/components/controls/color/index.ts +10 -3
- package/templates/ui/components/controls/color/palette-control-controller.ts +407 -0
- package/templates/ui/components/controls/color/palette-control-layout.ts +14 -0
- package/templates/ui/components/controls/color/palette-control-types.ts +50 -0
- package/templates/ui/components/controls/color/palette-control-view.tsx +174 -0
- package/templates/ui/components/controls/color/palette-control.tsx +6 -544
- package/templates/ui/components/controls/color/style-guide-color-picker-color-utils.ts +39 -0
- package/templates/ui/components/controls/color/style-guide-color-picker-controller.ts +370 -0
- package/templates/ui/components/controls/color/style-guide-color-picker-hue-handlers.ts +66 -0
- package/templates/ui/components/controls/color/style-guide-color-picker-interaction-state.ts +49 -0
- package/templates/ui/components/controls/color/style-guide-color-picker-interactions.ts +2 -2
- package/templates/ui/components/controls/color/style-guide-color-picker-model.ts +125 -0
- package/templates/ui/components/controls/color/style-guide-color-picker-parts.tsx +10 -707
- package/templates/ui/components/controls/color/style-guide-color-picker-surface-drag.ts +93 -0
- package/templates/ui/components/controls/color/style-guide-color-picker-surface-geometry.ts +114 -0
- package/templates/ui/components/controls/color/style-guide-color-picker-surface-preview.ts +45 -0
- package/templates/ui/components/controls/color/style-guide-color-picker-types.ts +84 -0
- package/templates/ui/components/controls/color/style-guide-color-picker-view.tsx +69 -0
- package/templates/ui/components/controls/color/style-guide-color-picker.tsx +6 -495
- package/templates/ui/components/controls/curves/curves-control.tsx +4 -3
- package/templates/ui/components/controls/file-drop/file-drop-control.tsx +39 -515
- package/templates/ui/components/controls/file-drop/file-drop-empty-state.tsx +35 -0
- package/templates/ui/components/controls/file-drop/file-drop-file-list.tsx +160 -0
- package/templates/ui/components/controls/file-drop/file-drop-image-grid.tsx +175 -0
- package/templates/ui/components/controls/file-drop/file-drop-model.tsx +170 -0
- package/templates/ui/components/controls/file-drop/file-drop-single-preview.tsx +63 -0
- package/templates/ui/components/controls/file-drop/file-drop-types.ts +48 -0
- package/templates/ui/components/controls/file-drop/index.ts +2 -2
- package/templates/ui/components/controls/font-picker/font-picker-control.tsx +133 -906
- package/templates/ui/components/controls/font-picker/font-picker-footer.tsx +116 -0
- package/templates/ui/components/controls/font-picker/font-picker-list.tsx +194 -0
- package/templates/ui/components/controls/font-picker/font-picker-popover-content.tsx +191 -0
- package/templates/ui/components/controls/font-picker/font-picker-value.ts +222 -0
- package/templates/ui/components/controls/font-picker/index.ts +4 -1
- package/templates/ui/components/controls/font-picker/use-font-picker-preview-pipeline.ts +163 -0
- package/templates/ui/components/controls/font-picker/use-font-picker-virtual-list.ts +293 -0
- package/templates/ui/components/controls/gradient/gradient-control-utils.ts +2 -25
- package/templates/ui/components/controls/gradient/gradient-control.tsx +4 -464
- package/templates/ui/components/controls/gradient/gradient-stops-controller.ts +332 -0
- package/templates/ui/components/controls/gradient/gradient-stops-track.tsx +159 -0
- package/templates/ui/components/controls/vector/vector-control-types.ts +26 -0
- package/templates/ui/components/controls/vector/vector-control.tsx +10 -486
- package/templates/ui/components/controls/vector/vector-pad-field.tsx +211 -0
- package/templates/ui/components/controls/vector/vector-pad-geometry.ts +61 -0
- package/templates/ui/components/controls/vector/vector-pad-parts.tsx +72 -0
- package/templates/ui/components/controls/vector/vector-pad-variants.ts +20 -0
- package/templates/ui/components/controls/vector/vector-size-field.tsx +104 -0
- package/templates/ui/components/controls/vector/vector-value.ts +46 -0
- package/templates/ui/components/primitives/slider/slider-discrete-state.ts +181 -0
- package/templates/ui/components/primitives/slider/slider-marker-policy.ts +52 -0
- package/templates/ui/components/primitives/slider/slider-pointer-dragging.ts +87 -0
- package/templates/ui/components/primitives/slider/slider-runtime.ts +109 -0
- package/templates/ui/components/primitives/slider/slider-types.ts +21 -0
- package/templates/ui/components/primitives/slider/slider.tsx +2 -403
- package/templates/runtime/react/canvas-shell.test.tsx +0 -554
- package/templates/runtime/react/canvas-shell.tsx +0 -585
- package/templates/runtime/react/controls-panel.test.tsx +0 -5446
- package/templates/runtime/react/controls-panel.tsx +0 -3220
- package/templates/runtime/react/layers-panel.test.tsx +0 -487
- package/templates/runtime/react/layers-panel.tsx +0 -1348
- package/templates/runtime/react/timeline-panel.test.tsx +0 -751
- package/templates/runtime/react/timeline-panel.tsx +0 -3078
- package/templates/runtime/schema/define-toolcraft.test.ts +0 -1742
- package/templates/runtime/state/reducer.test.ts +0 -1703
- package/templates/runtime/testing/performance.test.ts +0 -3081
- package/templates/starter/e2e/app-browser-acceptance.spec.ts +0 -785
- package/templates/starter/src/app/starter-acceptance.test.ts +0 -10068
- package/templates/starter/src/app/starter-performance.test.ts +0 -1583
- package/templates/ui/components/controls/color/style-guide-color-picker-logic.ts +0 -490
- /package/templates/runtime/react/{storage-key-migration.ts → app-shell/storage-key-migration.ts} +0 -0
- /package/templates/runtime/react/{theme-runtime.tsx → app-shell/theme-runtime.tsx} +0 -0
- /package/templates/runtime/react/{curve-geometry.test.ts → controls-panel/__tests__/curve-geometry.test.ts} +0 -0
- /package/templates/runtime/react/{panel-host-config.ts → panel-host/panel-host-config.ts} +0 -0
- /package/templates/runtime/react/{panel-host-geometry.test.ts → panel-host/panel-host-geometry.test.ts} +0 -0
- /package/templates/runtime/react/{panel-host-geometry.ts → panel-host/panel-host-geometry.ts} +0 -0
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
ResolvedToolcraftAppSchema,
|
|
3
|
+
ToolcraftControlSchema,
|
|
4
|
+
} from "../schema/types";
|
|
5
|
+
import type { ToolcraftPerformanceValueSet } from "./performance-types";
|
|
6
|
+
|
|
7
|
+
export function getAllSchemaControls(
|
|
8
|
+
schema: ResolvedToolcraftAppSchema,
|
|
9
|
+
): ToolcraftControlSchema[] {
|
|
10
|
+
return (schema.panels.controls?.sections ?? []).flatMap((section) =>
|
|
11
|
+
Object.values(section.controls),
|
|
12
|
+
);
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export function getVisiblePerformanceControlTargets(schema: ResolvedToolcraftAppSchema): string[] {
|
|
16
|
+
return getAllSchemaControls(schema)
|
|
17
|
+
.filter((control) => control.type !== "panelActions")
|
|
18
|
+
.map((control) => control.target);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
function isFiniteNumber(value: unknown): value is number {
|
|
22
|
+
return typeof value === "number" && Number.isFinite(value);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export function getToolcraftControlPerformanceValues(
|
|
26
|
+
control: ToolcraftControlSchema | undefined,
|
|
27
|
+
): ToolcraftPerformanceValueSet | null {
|
|
28
|
+
if (!control) {
|
|
29
|
+
return null;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
if (
|
|
33
|
+
control.type === "slider" &&
|
|
34
|
+
isFiniteNumber(control.defaultValue) &&
|
|
35
|
+
isFiniteNumber(control.max) &&
|
|
36
|
+
isFiniteNumber(control.min)
|
|
37
|
+
) {
|
|
38
|
+
return {
|
|
39
|
+
default: control.defaultValue,
|
|
40
|
+
max: control.max,
|
|
41
|
+
min: control.min,
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
if (
|
|
46
|
+
control.type === "rangeSlider" &&
|
|
47
|
+
Array.isArray(control.defaultValue) &&
|
|
48
|
+
control.defaultValue.length === 2 &&
|
|
49
|
+
control.defaultValue.every(isFiniteNumber) &&
|
|
50
|
+
isFiniteNumber(control.max) &&
|
|
51
|
+
isFiniteNumber(control.min)
|
|
52
|
+
) {
|
|
53
|
+
return {
|
|
54
|
+
default: [...control.defaultValue],
|
|
55
|
+
max: [control.max, control.max],
|
|
56
|
+
min: [control.min, control.min],
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
if (
|
|
61
|
+
(control.type === "select" || control.type === "segmented") &&
|
|
62
|
+
control.options &&
|
|
63
|
+
control.options.length > 0
|
|
64
|
+
) {
|
|
65
|
+
return {
|
|
66
|
+
default: control.defaultValue ?? control.options[0]?.value,
|
|
67
|
+
max: control.options.at(-1)?.value,
|
|
68
|
+
min: control.options[0]?.value,
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
return null;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
export function getToolcraftSchemaPerformanceValues(
|
|
76
|
+
schema: ResolvedToolcraftAppSchema,
|
|
77
|
+
target: string,
|
|
78
|
+
): ToolcraftPerformanceValueSet | null {
|
|
79
|
+
return getToolcraftControlPerformanceValues(
|
|
80
|
+
getAllSchemaControls(schema).find((control) => control.target === target),
|
|
81
|
+
);
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
export function requireToolcraftSchemaPerformanceValues(
|
|
85
|
+
schema: ResolvedToolcraftAppSchema,
|
|
86
|
+
target: string,
|
|
87
|
+
): ToolcraftPerformanceValueSet {
|
|
88
|
+
const values = getToolcraftSchemaPerformanceValues(schema, target);
|
|
89
|
+
|
|
90
|
+
if (!values) {
|
|
91
|
+
throw new Error(
|
|
92
|
+
`Toolcraft schema target "${target}" does not expose a derivable performance range.`,
|
|
93
|
+
);
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
return values;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
function getActionValue(
|
|
100
|
+
action: NonNullable<ToolcraftControlSchema["actions"]>[number],
|
|
101
|
+
): string {
|
|
102
|
+
return typeof action === "string" ? action : action.value;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
function getActionLabel(
|
|
106
|
+
action: NonNullable<ToolcraftControlSchema["actions"]>[number],
|
|
107
|
+
): string | undefined {
|
|
108
|
+
return typeof action === "string" ? undefined : action.label;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
function normalizeActionReference(value: string | undefined): string {
|
|
112
|
+
return String(value ?? "")
|
|
113
|
+
.trim()
|
|
114
|
+
.replace(/([a-z0-9])([A-Z])/g, "$1 $2")
|
|
115
|
+
.toLowerCase()
|
|
116
|
+
.replace(/[^a-z0-9]+/g, " ")
|
|
117
|
+
.trim();
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
const outputDeliveryActionRoles = new Set([
|
|
121
|
+
"copy-output",
|
|
122
|
+
"download-output",
|
|
123
|
+
"export-image",
|
|
124
|
+
"export-video",
|
|
125
|
+
]);
|
|
126
|
+
|
|
127
|
+
function isOutputDeliveryAction(
|
|
128
|
+
action: NonNullable<ToolcraftControlSchema["actions"]>[number],
|
|
129
|
+
): boolean {
|
|
130
|
+
return typeof action !== "string" && outputDeliveryActionRoles.has(action.role ?? "");
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
function getOutputDeliveryActions(
|
|
134
|
+
schema: ResolvedToolcraftAppSchema,
|
|
135
|
+
): NonNullable<ToolcraftControlSchema["actions"]>[number][] {
|
|
136
|
+
return getAllSchemaControls(schema).flatMap((control) => {
|
|
137
|
+
if (control.type !== "panelActions") {
|
|
138
|
+
return [];
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
return (control.actions ?? []).filter(isOutputDeliveryAction);
|
|
142
|
+
});
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
export function hasOutputDeliveryAction(schema: ResolvedToolcraftAppSchema): boolean {
|
|
146
|
+
return getOutputDeliveryActions(schema).length > 0;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
export function hasOutputDeliveryActionReference(
|
|
150
|
+
schema: ResolvedToolcraftAppSchema,
|
|
151
|
+
reference: { actionValue?: string; controlLabel?: string },
|
|
152
|
+
): boolean {
|
|
153
|
+
const outputActions = getOutputDeliveryActions(schema);
|
|
154
|
+
const expectedActionValue = reference.actionValue?.trim();
|
|
155
|
+
if (!expectedActionValue) {
|
|
156
|
+
return false;
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
const matchingAction = outputActions.find(
|
|
160
|
+
(action) => getActionValue(action).trim() === expectedActionValue,
|
|
161
|
+
);
|
|
162
|
+
if (!matchingAction) {
|
|
163
|
+
return false;
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
const expectedLabel = normalizeActionReference(reference.controlLabel);
|
|
167
|
+
return (
|
|
168
|
+
!expectedLabel ||
|
|
169
|
+
normalizeActionReference(
|
|
170
|
+
getActionLabel(matchingAction) ?? getActionValue(matchingAction),
|
|
171
|
+
) === expectedLabel
|
|
172
|
+
);
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
export function hasKeyframeTimeline(schema: ResolvedToolcraftAppSchema): boolean {
|
|
176
|
+
return schema.panels.timeline?.enabled === true && schema.panels.timeline.mode === "keyframes";
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
export function hasLayersPanel(schema: ResolvedToolcraftAppSchema): boolean {
|
|
180
|
+
return schema.panels.layers === true;
|
|
181
|
+
}
|
|
@@ -0,0 +1,322 @@
|
|
|
1
|
+
export function createMeasuredWebglEvidence(scenarioId = "text-preview-render") {
|
|
2
|
+
return [
|
|
3
|
+
{
|
|
4
|
+
alternativeStrategy: "webgl" as const,
|
|
5
|
+
decision:
|
|
6
|
+
"Canvas 2D remains selected because cached CPU rendering stayed within budget for this product fixture while preserving export parity.",
|
|
7
|
+
fixture: "large product stress fixture at render scale 2",
|
|
8
|
+
measuredResult:
|
|
9
|
+
"WebGL comparison: maxFrameGapMs 72, maxLongTaskMs 64; Canvas 2D comparison: maxFrameGapMs 68, maxLongTaskMs 58.",
|
|
10
|
+
scenarioId,
|
|
11
|
+
},
|
|
12
|
+
];
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export function createTextRendererPipeline() {
|
|
16
|
+
return {
|
|
17
|
+
interactionInvalidation: [
|
|
18
|
+
{
|
|
19
|
+
interaction: "control-drag",
|
|
20
|
+
invalidates: ["text-layout"],
|
|
21
|
+
targets: ["render.density"],
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
interaction: "control-change",
|
|
25
|
+
invalidates: ["text-layout"],
|
|
26
|
+
targets: ["render.mode"],
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
interaction: "viewport-zoom",
|
|
30
|
+
invalidates: [],
|
|
31
|
+
mustNotInvalidate: ["text-layout"],
|
|
32
|
+
targets: ["canvas.viewport"],
|
|
33
|
+
},
|
|
34
|
+
],
|
|
35
|
+
passes: [
|
|
36
|
+
{
|
|
37
|
+
cacheKey: ["product.content", "render.density", "render.mode"],
|
|
38
|
+
id: "text-layout",
|
|
39
|
+
inputs: ["product.content", "render.density", "render.mode"],
|
|
40
|
+
invalidatedBy: ["product.content", "render.density", "render.mode"],
|
|
41
|
+
kind: "text-layout",
|
|
42
|
+
output: "preview",
|
|
43
|
+
quality: "full",
|
|
44
|
+
runsOn: "main",
|
|
45
|
+
},
|
|
46
|
+
],
|
|
47
|
+
} as const;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
export function createAnimatedVectorRendererPipeline() {
|
|
51
|
+
return {
|
|
52
|
+
interactionInvalidation: [
|
|
53
|
+
{
|
|
54
|
+
interaction: "control-drag",
|
|
55
|
+
invalidates: ["vector-build"],
|
|
56
|
+
targets: ["render.density"],
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
interaction: "control-change",
|
|
60
|
+
invalidates: ["vector-build"],
|
|
61
|
+
targets: ["render.mode"],
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
interaction: "animation-frame",
|
|
65
|
+
invalidates: ["animation-composite"],
|
|
66
|
+
mustNotInvalidate: ["vector-build"],
|
|
67
|
+
targets: ["animation.time"],
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
interaction: "timeline-playback",
|
|
71
|
+
invalidates: ["animation-composite"],
|
|
72
|
+
mustNotInvalidate: ["vector-build"],
|
|
73
|
+
targets: ["timeline.currentTime"],
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
interaction: "timeline-scrub",
|
|
77
|
+
invalidates: ["animation-composite"],
|
|
78
|
+
mustNotInvalidate: ["vector-build"],
|
|
79
|
+
targets: ["timeline.currentTime"],
|
|
80
|
+
},
|
|
81
|
+
{
|
|
82
|
+
interaction: "viewport-drag",
|
|
83
|
+
invalidates: [],
|
|
84
|
+
mustNotInvalidate: ["vector-build", "animation-composite"],
|
|
85
|
+
targets: ["canvas.viewport"],
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
interaction: "viewport-zoom",
|
|
89
|
+
invalidates: [],
|
|
90
|
+
mustNotInvalidate: ["vector-build", "animation-composite"],
|
|
91
|
+
targets: ["canvas.viewport"],
|
|
92
|
+
},
|
|
93
|
+
],
|
|
94
|
+
passes: [
|
|
95
|
+
{
|
|
96
|
+
id: "vector-build",
|
|
97
|
+
inputs: ["render.density", "render.mode"],
|
|
98
|
+
invalidatedBy: ["render.density", "render.mode"],
|
|
99
|
+
kind: "vector-build",
|
|
100
|
+
output: "preview",
|
|
101
|
+
quality: "full",
|
|
102
|
+
runsOn: "main",
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
cacheKey: ["vector-build", "animation.time", "timeline.currentTime"],
|
|
106
|
+
id: "animation-composite",
|
|
107
|
+
inputs: ["vector-build", "animation.time", "timeline.currentTime"],
|
|
108
|
+
invalidatedBy: ["animation.time", "timeline.currentTime"],
|
|
109
|
+
kind: "composite",
|
|
110
|
+
output: "preview",
|
|
111
|
+
quality: "preview",
|
|
112
|
+
runsOn: "main",
|
|
113
|
+
},
|
|
114
|
+
],
|
|
115
|
+
} as const;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
export function createDenseCanvasPipeline() {
|
|
119
|
+
return {
|
|
120
|
+
interactionInvalidation: [
|
|
121
|
+
{
|
|
122
|
+
interaction: "control-drag",
|
|
123
|
+
invalidates: ["dense-background", "export-composite"],
|
|
124
|
+
targets: ["render.density"],
|
|
125
|
+
},
|
|
126
|
+
{
|
|
127
|
+
interaction: "control-change",
|
|
128
|
+
invalidates: ["export-composite"],
|
|
129
|
+
targets: ["render.mode"],
|
|
130
|
+
},
|
|
131
|
+
{
|
|
132
|
+
interaction: "viewport-zoom",
|
|
133
|
+
invalidates: [],
|
|
134
|
+
mustNotInvalidate: ["dense-background", "export-composite"],
|
|
135
|
+
targets: ["canvas.viewport"],
|
|
136
|
+
},
|
|
137
|
+
{
|
|
138
|
+
interaction: "export",
|
|
139
|
+
invalidates: ["export-composite"],
|
|
140
|
+
mustNotInvalidate: ["dense-background"],
|
|
141
|
+
targets: ["export.image.resolution"],
|
|
142
|
+
},
|
|
143
|
+
],
|
|
144
|
+
passes: [
|
|
145
|
+
{
|
|
146
|
+
cacheKey: ["render.density", "canvas.size", "canvas.renderScale"],
|
|
147
|
+
id: "dense-background",
|
|
148
|
+
inputs: ["render.density", "canvas.size", "canvas.renderScale"],
|
|
149
|
+
invalidatedBy: ["render.density", "canvas.size", "canvas.renderScale"],
|
|
150
|
+
kind: "rasterize",
|
|
151
|
+
output: "preview",
|
|
152
|
+
quality: "retina",
|
|
153
|
+
runsOn: "worker",
|
|
154
|
+
},
|
|
155
|
+
{
|
|
156
|
+
id: "semantic-foreground",
|
|
157
|
+
inputs: ["product.geometry"],
|
|
158
|
+
invalidatedBy: ["product.geometry"],
|
|
159
|
+
kind: "vector-build",
|
|
160
|
+
output: "preview",
|
|
161
|
+
quality: "full",
|
|
162
|
+
runsOn: "main",
|
|
163
|
+
},
|
|
164
|
+
{
|
|
165
|
+
cacheKey: ["dense-background", "semantic-foreground", "export.image.resolution"],
|
|
166
|
+
id: "export-composite",
|
|
167
|
+
inputs: ["dense-background", "semantic-foreground", "export.image.resolution"],
|
|
168
|
+
invalidatedBy: ["dense-background", "semantic-foreground", "export.image.resolution"],
|
|
169
|
+
kind: "composite",
|
|
170
|
+
output: "export",
|
|
171
|
+
quality: "export",
|
|
172
|
+
runsOn: "export-only",
|
|
173
|
+
},
|
|
174
|
+
],
|
|
175
|
+
} as const;
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
export function createMainThreadCanvasCompositePipeline() {
|
|
179
|
+
return {
|
|
180
|
+
interactionInvalidation: [
|
|
181
|
+
{
|
|
182
|
+
interaction: "control-drag",
|
|
183
|
+
invalidates: ["text-texture", "warp-composite", "optical-composite"],
|
|
184
|
+
targets: ["render.density"],
|
|
185
|
+
},
|
|
186
|
+
{
|
|
187
|
+
interaction: "control-change",
|
|
188
|
+
invalidates: ["text-texture", "warp-composite", "optical-composite"],
|
|
189
|
+
targets: ["render.mode"],
|
|
190
|
+
},
|
|
191
|
+
{
|
|
192
|
+
interaction: "viewport-zoom",
|
|
193
|
+
invalidates: [],
|
|
194
|
+
mustNotInvalidate: ["text-texture", "warp-composite", "optical-composite"],
|
|
195
|
+
targets: ["canvas.viewport"],
|
|
196
|
+
},
|
|
197
|
+
],
|
|
198
|
+
passes: [
|
|
199
|
+
{
|
|
200
|
+
cacheKey: ["product.content", "render.density", "canvas.size", "canvas.renderScale"],
|
|
201
|
+
id: "text-texture",
|
|
202
|
+
inputs: ["product.content", "render.density", "canvas.size", "canvas.renderScale"],
|
|
203
|
+
invalidatedBy: ["product.content", "render.density", "canvas.size", "canvas.renderScale"],
|
|
204
|
+
kind: "rasterize",
|
|
205
|
+
output: "intermediate",
|
|
206
|
+
quality: "retina",
|
|
207
|
+
runsOn: "main",
|
|
208
|
+
},
|
|
209
|
+
{
|
|
210
|
+
cacheKey: ["text-texture", "render.density", "canvas.size"],
|
|
211
|
+
id: "warp-composite",
|
|
212
|
+
inputs: ["text-texture", "render.density", "canvas.size"],
|
|
213
|
+
invalidatedBy: ["text-texture", "render.density", "canvas.size"],
|
|
214
|
+
kind: "composite",
|
|
215
|
+
output: "preview",
|
|
216
|
+
quality: "retina",
|
|
217
|
+
runsOn: "main",
|
|
218
|
+
},
|
|
219
|
+
{
|
|
220
|
+
cacheKey: ["warp-composite", "render.mode", "canvas.renderScale"],
|
|
221
|
+
id: "optical-composite",
|
|
222
|
+
inputs: ["warp-composite", "render.mode", "canvas.renderScale"],
|
|
223
|
+
invalidatedBy: ["warp-composite", "render.mode", "canvas.renderScale"],
|
|
224
|
+
kind: "composite",
|
|
225
|
+
output: "preview",
|
|
226
|
+
quality: "retina",
|
|
227
|
+
runsOn: "main",
|
|
228
|
+
},
|
|
229
|
+
],
|
|
230
|
+
} as const;
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
export function createPixelRendererPipeline() {
|
|
234
|
+
return {
|
|
235
|
+
interactionInvalidation: [
|
|
236
|
+
{
|
|
237
|
+
interaction: "control-drag",
|
|
238
|
+
invalidates: ["pixel-transform"],
|
|
239
|
+
targets: ["render.density"],
|
|
240
|
+
},
|
|
241
|
+
{
|
|
242
|
+
interaction: "control-change",
|
|
243
|
+
invalidates: ["pixel-transform"],
|
|
244
|
+
targets: ["render.mode"],
|
|
245
|
+
},
|
|
246
|
+
{
|
|
247
|
+
interaction: "viewport-zoom",
|
|
248
|
+
invalidates: [],
|
|
249
|
+
mustNotInvalidate: ["pixel-transform"],
|
|
250
|
+
targets: ["canvas.viewport"],
|
|
251
|
+
},
|
|
252
|
+
],
|
|
253
|
+
passes: [
|
|
254
|
+
{
|
|
255
|
+
cacheKey: ["render.density", "render.mode", "canvas.size", "canvas.renderScale"],
|
|
256
|
+
id: "pixel-transform",
|
|
257
|
+
inputs: ["render.density", "render.mode", "canvas.size", "canvas.renderScale"],
|
|
258
|
+
invalidatedBy: ["render.density", "render.mode", "canvas.size", "canvas.renderScale"],
|
|
259
|
+
kind: "pixel-transform",
|
|
260
|
+
output: "preview",
|
|
261
|
+
quality: "retina",
|
|
262
|
+
runsOn: "worker",
|
|
263
|
+
},
|
|
264
|
+
],
|
|
265
|
+
} as const;
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
export function createMediaRendererPipeline() {
|
|
269
|
+
return {
|
|
270
|
+
interactionInvalidation: [
|
|
271
|
+
{
|
|
272
|
+
interaction: "media-import",
|
|
273
|
+
invalidates: ["source-decode", "media-preprocess"],
|
|
274
|
+
targets: ["source.image"],
|
|
275
|
+
},
|
|
276
|
+
{
|
|
277
|
+
interaction: "control-drag",
|
|
278
|
+
invalidates: ["effect-composite"],
|
|
279
|
+
mustNotInvalidate: ["source-decode", "media-preprocess"],
|
|
280
|
+
targets: ["render.density"],
|
|
281
|
+
},
|
|
282
|
+
{
|
|
283
|
+
interaction: "viewport-zoom",
|
|
284
|
+
invalidates: [],
|
|
285
|
+
mustNotInvalidate: ["source-decode", "media-preprocess", "effect-composite"],
|
|
286
|
+
targets: ["canvas.viewport"],
|
|
287
|
+
},
|
|
288
|
+
],
|
|
289
|
+
passes: [
|
|
290
|
+
{
|
|
291
|
+
cacheKey: ["source.image.id", "source.image.width", "source.image.height"],
|
|
292
|
+
id: "source-decode",
|
|
293
|
+
inputs: ["source.image"],
|
|
294
|
+
invalidatedBy: ["source.image"],
|
|
295
|
+
kind: "decode",
|
|
296
|
+
output: "source",
|
|
297
|
+
quality: "full",
|
|
298
|
+
runsOn: "worker",
|
|
299
|
+
},
|
|
300
|
+
{
|
|
301
|
+
cacheKey: ["source-decode", "source.image.id"],
|
|
302
|
+
id: "media-preprocess",
|
|
303
|
+
inputs: ["source-decode"],
|
|
304
|
+
invalidatedBy: ["source-decode"],
|
|
305
|
+
kind: "preprocess",
|
|
306
|
+
output: "intermediate",
|
|
307
|
+
quality: "full",
|
|
308
|
+
runsOn: "worker-or-gpu",
|
|
309
|
+
},
|
|
310
|
+
{
|
|
311
|
+
cacheKey: ["media-preprocess", "render.density"],
|
|
312
|
+
id: "effect-composite",
|
|
313
|
+
inputs: ["media-preprocess", "render.density"],
|
|
314
|
+
invalidatedBy: ["media-preprocess", "render.density"],
|
|
315
|
+
kind: "composite",
|
|
316
|
+
output: "preview",
|
|
317
|
+
quality: "retina",
|
|
318
|
+
runsOn: "gpu",
|
|
319
|
+
},
|
|
320
|
+
],
|
|
321
|
+
} as const;
|
|
322
|
+
}
|
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
import { defineToolcraftPerformance } from "../performance";
|
|
2
|
+
import {
|
|
3
|
+
createAnimatedVectorRendererPipeline,
|
|
4
|
+
createTextRendererPipeline,
|
|
5
|
+
} from "./renderer-pipelines";
|
|
6
|
+
import {
|
|
7
|
+
createCombinedRendererStressFixture,
|
|
8
|
+
createCustomStressFixture,
|
|
9
|
+
createLargeTextStressFixture,
|
|
10
|
+
createSchemaMaxValueStressFixture,
|
|
11
|
+
} from "./stress-fixtures";
|
|
12
|
+
import { testSchema } from "./schemas";
|
|
13
|
+
|
|
14
|
+
export function createViewportZoomStressScenario() {
|
|
15
|
+
return {
|
|
16
|
+
automated: true,
|
|
17
|
+
automatedTestName: "perf: detailed canvas zoom stays smooth",
|
|
18
|
+
browser: true,
|
|
19
|
+
browserTestName: "browser perf: detailed canvas zoom stays smooth",
|
|
20
|
+
budget: { maxFrameGapMs: 80, maxInteractionMs: 500, maxLongTaskMs: 80 },
|
|
21
|
+
expectedObservable:
|
|
22
|
+
"Zooming detailed product output does not shake the canvas or block frames.",
|
|
23
|
+
fixture: "detailed renderer zoom fixture",
|
|
24
|
+
id: "viewport-zoom-stress",
|
|
25
|
+
interaction: "viewport-zoom-stress" as const,
|
|
26
|
+
stress: true,
|
|
27
|
+
stressFixture: createCombinedRendererStressFixture(),
|
|
28
|
+
target: "canvas.viewport",
|
|
29
|
+
workload: false,
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export function createTextRendererScenarios(
|
|
34
|
+
options: { includeStressPreview?: boolean; includeViewportZoomStress?: boolean } = {},
|
|
35
|
+
) {
|
|
36
|
+
const includeStressPreview = options.includeStressPreview ?? true;
|
|
37
|
+
const includeViewportZoomStress = options.includeViewportZoomStress ?? true;
|
|
38
|
+
|
|
39
|
+
return [
|
|
40
|
+
{
|
|
41
|
+
automated: true,
|
|
42
|
+
automatedTestName: "perf: text preview render stays under budget",
|
|
43
|
+
browser: true,
|
|
44
|
+
browserTestName: "browser perf: text preview render stays under budget",
|
|
45
|
+
budget: { maxLongTaskMs: 80, maxPreviewMs: 1000 },
|
|
46
|
+
expectedObservable: "Text preview renders crisply without freezing.",
|
|
47
|
+
fixture: "native-resolution glyph output fixture",
|
|
48
|
+
id: "text-preview-render",
|
|
49
|
+
interaction: "preview-render" as const,
|
|
50
|
+
stress: includeStressPreview,
|
|
51
|
+
...(includeStressPreview
|
|
52
|
+
? { stressFixture: createCombinedRendererStressFixture() }
|
|
53
|
+
: {}),
|
|
54
|
+
workload: false,
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
automated: true,
|
|
58
|
+
automatedTestName: "perf: density drag stays responsive",
|
|
59
|
+
browser: true,
|
|
60
|
+
browserTestName: "browser perf: density drag stays responsive",
|
|
61
|
+
budget: { maxFrameGapMs: 80, maxInteractionMs: 500 },
|
|
62
|
+
controlLabel: "Density",
|
|
63
|
+
expectedObservable: "Dragging Density updates text output without blocking the UI.",
|
|
64
|
+
fixture: "runtime density fixture",
|
|
65
|
+
id: "density-drag",
|
|
66
|
+
interaction: "control-drag" as const,
|
|
67
|
+
stressFixture: createSchemaMaxValueStressFixture(
|
|
68
|
+
testSchema,
|
|
69
|
+
"render.density",
|
|
70
|
+
"Density max is the heaviest glyph output fixture.",
|
|
71
|
+
),
|
|
72
|
+
target: "render.density",
|
|
73
|
+
workloadFixture: createLargeTextStressFixture(),
|
|
74
|
+
workload: true,
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
automated: true,
|
|
78
|
+
automatedTestName: "perf: mode change stays responsive",
|
|
79
|
+
browser: true,
|
|
80
|
+
browserTestName: "browser perf: mode change stays responsive",
|
|
81
|
+
budget: { maxFrameGapMs: 80, maxInteractionMs: 500 },
|
|
82
|
+
controlLabel: "Mode",
|
|
83
|
+
expectedObservable: "Changing Mode updates text output without blocking the UI.",
|
|
84
|
+
fixture: "runtime mode fixture",
|
|
85
|
+
id: "mode-change",
|
|
86
|
+
interaction: "control-change" as const,
|
|
87
|
+
target: "render.mode",
|
|
88
|
+
values: { default: "soft", max: "sharp", min: "soft" },
|
|
89
|
+
workload: false,
|
|
90
|
+
},
|
|
91
|
+
{
|
|
92
|
+
automated: true,
|
|
93
|
+
automatedTestName: "perf: viewport stays stable",
|
|
94
|
+
browser: true,
|
|
95
|
+
browserTestName: "browser perf: viewport stays stable",
|
|
96
|
+
budget: { maxFrameGapMs: 80 },
|
|
97
|
+
expectedObservable: "Viewport remains stable.",
|
|
98
|
+
fixture: "native-resolution glyph output fixture",
|
|
99
|
+
id: "viewport-stability",
|
|
100
|
+
interaction: "viewport-stability" as const,
|
|
101
|
+
workload: false,
|
|
102
|
+
},
|
|
103
|
+
...(includeViewportZoomStress ? [createViewportZoomStressScenario()] : []),
|
|
104
|
+
];
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
export function createAnimationFrameScenario() {
|
|
108
|
+
return {
|
|
109
|
+
automated: true,
|
|
110
|
+
automatedTestName: "perf: animation frame loop stays smooth",
|
|
111
|
+
browser: true,
|
|
112
|
+
browserTestName: "browser perf: animation frame loop stays smooth",
|
|
113
|
+
budget: { maxFrameGapMs: 80, maxLongTaskMs: 80 },
|
|
114
|
+
expectedObservable: "Animated renderer advances without long frame gaps.",
|
|
115
|
+
fixture: "animated renderer fixture",
|
|
116
|
+
id: "animation-frame-loop",
|
|
117
|
+
interaction: "animation-frame" as const,
|
|
118
|
+
stress: true,
|
|
119
|
+
stressFixture: createCustomStressFixture(
|
|
120
|
+
{ animation: "fastest", density: 12 },
|
|
121
|
+
"Animation stress must sample the heaviest animated output.",
|
|
122
|
+
),
|
|
123
|
+
workload: false,
|
|
124
|
+
};
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
export function createAnimationViewportDragScenario() {
|
|
128
|
+
return {
|
|
129
|
+
automated: true,
|
|
130
|
+
automatedTestName: "perf: animated canvas drag stays smooth",
|
|
131
|
+
browser: true,
|
|
132
|
+
browserTestName: "browser perf: animated canvas drag stays smooth",
|
|
133
|
+
budget: { maxFrameGapMs: 80, maxInteractionMs: 500, maxLongTaskMs: 80 },
|
|
134
|
+
expectedObservable: "Animated renderer stays smooth while the canvas viewport is dragged.",
|
|
135
|
+
fixture: "animated renderer canvas drag fixture",
|
|
136
|
+
id: "animation-viewport-drag",
|
|
137
|
+
interaction: "animation-viewport-drag" as const,
|
|
138
|
+
stress: true,
|
|
139
|
+
stressFixture: createCustomStressFixture(
|
|
140
|
+
{ animation: "fastest", density: 12 },
|
|
141
|
+
"Animated viewport drag must run while the heaviest animated output is visible.",
|
|
142
|
+
),
|
|
143
|
+
target: "canvas.viewport",
|
|
144
|
+
workload: false,
|
|
145
|
+
};
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
export function createAnimatedVectorRendererConfig(options: { includeViewportDrag: boolean }) {
|
|
149
|
+
return defineToolcraftPerformance({
|
|
150
|
+
rendererStrategy: "svg",
|
|
151
|
+
rendererTechnique: {
|
|
152
|
+
exportRenderer: "svg",
|
|
153
|
+
fidelityRisks: ["animated vector output must stay crisp while panning"],
|
|
154
|
+
performanceRisks: ["dense vector animation can jank while the viewport moves"],
|
|
155
|
+
previewRenderer: "svg",
|
|
156
|
+
productRepresentation: "vector",
|
|
157
|
+
rendererStrategy: "svg",
|
|
158
|
+
rendererWorkload: "vector-output",
|
|
159
|
+
sourceRepresentation: "procedural-data",
|
|
160
|
+
whyNotAlternativeStrategies: ["svg preserves semantic vector output for this fixture"],
|
|
161
|
+
},
|
|
162
|
+
rendererWorkload: "vector-output",
|
|
163
|
+
rendererPipeline: createAnimatedVectorRendererPipeline(),
|
|
164
|
+
scenarios: [
|
|
165
|
+
...createTextRendererScenarios(),
|
|
166
|
+
createAnimationFrameScenario(),
|
|
167
|
+
...(options.includeViewportDrag ? [createAnimationViewportDragScenario()] : []),
|
|
168
|
+
],
|
|
169
|
+
usesCustomRenderer: true,
|
|
170
|
+
workloadTargets: ["render.density"],
|
|
171
|
+
});
|
|
172
|
+
}
|