@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,140 @@
|
|
|
1
|
+
import type { ToolcraftControlSchema } from "@repo/toolcraft-runtime";
|
|
2
|
+
|
|
3
|
+
import type {
|
|
4
|
+
ToolcraftComponentAcceptance,
|
|
5
|
+
ToolcraftCustomControlCapability,
|
|
6
|
+
ToolcraftCustomControlCoverage,
|
|
7
|
+
} from "./types";
|
|
8
|
+
import { builtInToolcraftControlTypeValues } from "./types";
|
|
9
|
+
|
|
10
|
+
const builtInToolcraftControlTypes = new Set<string>(
|
|
11
|
+
builtInToolcraftControlTypeValues,
|
|
12
|
+
);
|
|
13
|
+
|
|
14
|
+
export const requiredCustomControlCoverage: readonly ToolcraftCustomControlCoverage[] = [
|
|
15
|
+
"built-in-gap",
|
|
16
|
+
"kit-primitives",
|
|
17
|
+
"minimal-ui",
|
|
18
|
+
"product-output",
|
|
19
|
+
"runtime-state",
|
|
20
|
+
];
|
|
21
|
+
|
|
22
|
+
export function isCustomToolcraftControl(control: ToolcraftControlSchema): boolean {
|
|
23
|
+
return !builtInToolcraftControlTypes.has(control.type);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
const customControlCapabilities = new Set<ToolcraftCustomControlCapability>([
|
|
27
|
+
"collection",
|
|
28
|
+
"commands",
|
|
29
|
+
"custom-interaction",
|
|
30
|
+
"custom-value-model",
|
|
31
|
+
"custom-visualization",
|
|
32
|
+
"reorder",
|
|
33
|
+
"selection",
|
|
34
|
+
]);
|
|
35
|
+
|
|
36
|
+
export function getBuiltInFitCheckErrors(
|
|
37
|
+
label: string,
|
|
38
|
+
entry: ToolcraftComponentAcceptance,
|
|
39
|
+
control: ToolcraftControlSchema,
|
|
40
|
+
): string[] {
|
|
41
|
+
const fitCheck = entry.builtInFitCheck;
|
|
42
|
+
|
|
43
|
+
if (!fitCheck) {
|
|
44
|
+
return [
|
|
45
|
+
`${label} is a custom control and must declare builtInFitCheck with checkedBuiltIns, closestBuiltIn, whyInsufficient, and productObservable.`,
|
|
46
|
+
];
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
const errors: string[] = [];
|
|
50
|
+
const checkedBuiltIns = Array.isArray(fitCheck.checkedBuiltIns)
|
|
51
|
+
? fitCheck.checkedBuiltIns
|
|
52
|
+
: [];
|
|
53
|
+
const capabilities = Array.isArray(fitCheck.capabilities)
|
|
54
|
+
? fitCheck.capabilities
|
|
55
|
+
: [];
|
|
56
|
+
|
|
57
|
+
if (capabilities.length === 0) {
|
|
58
|
+
errors.push(
|
|
59
|
+
`${label} builtInFitCheck.capabilities must declare the product capabilities that require custom UI; prose labels are not capability evidence.`,
|
|
60
|
+
);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
const unknownCapabilities = capabilities.filter(
|
|
64
|
+
(capability) => !customControlCapabilities.has(capability),
|
|
65
|
+
);
|
|
66
|
+
if (unknownCapabilities.length > 0) {
|
|
67
|
+
errors.push(
|
|
68
|
+
`${label} builtInFitCheck.capabilities contains unknown capabilities: ${unknownCapabilities.join(", ")}.`,
|
|
69
|
+
);
|
|
70
|
+
}
|
|
71
|
+
if (new Set(capabilities).size !== capabilities.length) {
|
|
72
|
+
errors.push(`${label} builtInFitCheck.capabilities must not contain duplicates.`);
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
if (checkedBuiltIns.length === 0) {
|
|
76
|
+
errors.push(
|
|
77
|
+
`${label} builtInFitCheck.checkedBuiltIns must name at least one checked built-in control.`,
|
|
78
|
+
);
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
const unknownCheckedBuiltIns = checkedBuiltIns.filter(
|
|
82
|
+
(builtIn) => !builtInToolcraftControlTypes.has(builtIn),
|
|
83
|
+
);
|
|
84
|
+
|
|
85
|
+
if (unknownCheckedBuiltIns.length > 0) {
|
|
86
|
+
errors.push(
|
|
87
|
+
`${label} builtInFitCheck.checkedBuiltIns contains unknown built-in controls: ${unknownCheckedBuiltIns.join(", ")}.`,
|
|
88
|
+
);
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
if (
|
|
92
|
+
fitCheck.closestBuiltIn !== "none" &&
|
|
93
|
+
!checkedBuiltIns.includes(fitCheck.closestBuiltIn)
|
|
94
|
+
) {
|
|
95
|
+
errors.push(
|
|
96
|
+
`${label} builtInFitCheck.closestBuiltIn must be one of the checked built-ins or "none".`,
|
|
97
|
+
);
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
if (fitCheck.whyInsufficient.trim().length < 24) {
|
|
101
|
+
errors.push(
|
|
102
|
+
`${label} builtInFitCheck.whyInsufficient must explain why the closest built-in cannot express the product interaction.`,
|
|
103
|
+
);
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
if (fitCheck.productObservable.trim().length < 24) {
|
|
107
|
+
errors.push(
|
|
108
|
+
`${label} builtInFitCheck.productObservable must name the product output or side effect that proves the custom control is necessary.`,
|
|
109
|
+
);
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
if (
|
|
113
|
+
capabilities.some((capability) =>
|
|
114
|
+
["collection", "reorder", "selection"].includes(capability),
|
|
115
|
+
) &&
|
|
116
|
+
!checkedBuiltIns.includes("collectionActions")
|
|
117
|
+
) {
|
|
118
|
+
errors.push(
|
|
119
|
+
`${label} builtInFitCheck.checkedBuiltIns must include collectionActions when the custom control owns a growable, removable, selectable, or reorderable runtime item set.`,
|
|
120
|
+
);
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
if (capabilities.includes("commands") && !checkedBuiltIns.includes("actions")) {
|
|
124
|
+
errors.push(
|
|
125
|
+
`${label} builtInFitCheck.checkedBuiltIns must include actions when the custom control exposes local command buttons such as add, remove, delete, duplicate, sort, normalize, or clear.`,
|
|
126
|
+
);
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
if (!capabilities.some((capability) =>
|
|
130
|
+
["custom-interaction", "custom-value-model", "custom-visualization"].includes(
|
|
131
|
+
capability,
|
|
132
|
+
),
|
|
133
|
+
)) {
|
|
134
|
+
errors.push(
|
|
135
|
+
`${label} builtInFitCheck.capabilities must include custom-interaction, custom-value-model, or custom-visualization; collection or command chrome alone is not enough to justify custom UI.`,
|
|
136
|
+
);
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
return errors;
|
|
140
|
+
}
|
|
@@ -0,0 +1,192 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
ResolvedToolcraftAppSchema,
|
|
3
|
+
ToolcraftControlSchema,
|
|
4
|
+
} from "@repo/toolcraft-runtime";
|
|
5
|
+
|
|
6
|
+
import {
|
|
7
|
+
getControlLabelText,
|
|
8
|
+
isToolcraftProductSectionControl,
|
|
9
|
+
} from "./controls";
|
|
10
|
+
import { getToolcraftSectionLabel } from "./sections";
|
|
11
|
+
import { getToolcraftLooseTargetPrefix } from "./semantic";
|
|
12
|
+
|
|
13
|
+
const maxInlineSwitchLabelLength = 16;
|
|
14
|
+
const maxInlineSwitchLabelWordCount = 2;
|
|
15
|
+
|
|
16
|
+
function getInlineSwitchLabelText(
|
|
17
|
+
controlId: string,
|
|
18
|
+
control: ToolcraftControlSchema,
|
|
19
|
+
): string {
|
|
20
|
+
if (control.label === false) {
|
|
21
|
+
return "";
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
const label = getControlLabelText(control).trim();
|
|
25
|
+
|
|
26
|
+
return label || controlId;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
function isInlineSwitchLabelSafe(
|
|
30
|
+
controlId: string,
|
|
31
|
+
control: ToolcraftControlSchema,
|
|
32
|
+
): boolean {
|
|
33
|
+
const label = getInlineSwitchLabelText(controlId, control);
|
|
34
|
+
|
|
35
|
+
if (!label) {
|
|
36
|
+
return true;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
const wordCount = label.split(/\s+/u).filter(Boolean).length;
|
|
40
|
+
|
|
41
|
+
return label.length <= maxInlineSwitchLabelLength && wordCount <= maxInlineSwitchLabelWordCount;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
function isBooleanControl(control: ToolcraftControlSchema | undefined): boolean {
|
|
45
|
+
return control?.type === "checkbox" || control?.type === "switch";
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
function controlsShareToolcraftTargetEntity(
|
|
49
|
+
firstControl: ToolcraftControlSchema,
|
|
50
|
+
secondControl: ToolcraftControlSchema,
|
|
51
|
+
): boolean {
|
|
52
|
+
const firstPrefix = getToolcraftLooseTargetPrefix(firstControl.target);
|
|
53
|
+
const secondPrefix = getToolcraftLooseTargetPrefix(secondControl.target);
|
|
54
|
+
|
|
55
|
+
return Boolean(firstPrefix && firstPrefix === secondPrefix);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
export function sectionHasInlineLayoutGroupForPair(
|
|
59
|
+
section: NonNullable<ResolvedToolcraftAppSchema["panels"]["controls"]>["sections"][number],
|
|
60
|
+
firstControlId: string,
|
|
61
|
+
secondControlId: string,
|
|
62
|
+
): boolean {
|
|
63
|
+
return (section.layoutGroups ?? []).some(
|
|
64
|
+
(layoutGroup) =>
|
|
65
|
+
layoutGroup.layout === "inline" &&
|
|
66
|
+
layoutGroup.columns === 2 &&
|
|
67
|
+
layoutGroup.controls.length === 2 &&
|
|
68
|
+
layoutGroup.controls.includes(firstControlId) &&
|
|
69
|
+
layoutGroup.controls.includes(secondControlId),
|
|
70
|
+
);
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
export function getToolcraftInlineLayoutErrors(
|
|
74
|
+
schema: ResolvedToolcraftAppSchema,
|
|
75
|
+
): string[] {
|
|
76
|
+
const errors: string[] = [];
|
|
77
|
+
|
|
78
|
+
for (const [sectionIndex, section] of (schema.panels.controls?.sections ?? []).entries()) {
|
|
79
|
+
const sectionLabel = getToolcraftSectionLabel(section.title, sectionIndex);
|
|
80
|
+
|
|
81
|
+
for (const layoutGroup of section.layoutGroups ?? []) {
|
|
82
|
+
if (layoutGroup.layout !== "inline") {
|
|
83
|
+
continue;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
const rangeSliderIds = layoutGroup.controls.filter(
|
|
87
|
+
(controlId) => section.controls[controlId]?.type === "rangeSlider",
|
|
88
|
+
);
|
|
89
|
+
|
|
90
|
+
if (rangeSliderIds.length > 0) {
|
|
91
|
+
errors.push(
|
|
92
|
+
`${sectionLabel} layoutGroups inline row "${layoutGroup.controls.join(", ")}" includes rangeSlider ${rangeSliderIds.join(", ")}. RangeSlider is a full-width two-thumb control and must not share a row with another slider or range slider.`,
|
|
93
|
+
);
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
const segmentedIds = layoutGroup.controls.filter(
|
|
97
|
+
(controlId) => section.controls[controlId]?.type === "segmented",
|
|
98
|
+
);
|
|
99
|
+
|
|
100
|
+
if (segmentedIds.length > 0) {
|
|
101
|
+
errors.push(
|
|
102
|
+
`${sectionLabel} layoutGroups inline row "${layoutGroup.controls.join(", ")}" includes segmented control ${segmentedIds.join(", ")}. Segmented is full-width and must not share a two-column or half-width row; use Select when a finite choice must fit beside another control.`,
|
|
103
|
+
);
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
const switchEntries = layoutGroup.controls
|
|
107
|
+
.map((controlId) => [controlId, section.controls[controlId]] as const)
|
|
108
|
+
.filter(
|
|
109
|
+
(entry): entry is readonly [string, ToolcraftControlSchema] =>
|
|
110
|
+
Boolean(entry[1]) && entry[1].type === "switch",
|
|
111
|
+
);
|
|
112
|
+
const booleanEntries = layoutGroup.controls
|
|
113
|
+
.map((controlId) => [controlId, section.controls[controlId]] as const)
|
|
114
|
+
.filter(
|
|
115
|
+
(entry): entry is readonly [string, ToolcraftControlSchema] =>
|
|
116
|
+
Boolean(entry[1]) && isBooleanControl(entry[1]),
|
|
117
|
+
);
|
|
118
|
+
const parameterEntries = layoutGroup.controls
|
|
119
|
+
.map((controlId) => [controlId, section.controls[controlId]] as const)
|
|
120
|
+
.filter(
|
|
121
|
+
(entry): entry is readonly [string, ToolcraftControlSchema] =>
|
|
122
|
+
Boolean(entry[1]) && !isBooleanControl(entry[1]),
|
|
123
|
+
);
|
|
124
|
+
|
|
125
|
+
if (switchEntries.length > 1) {
|
|
126
|
+
const unsafeSwitchLabels = switchEntries.filter(
|
|
127
|
+
([controlId, control]) => !isInlineSwitchLabelSafe(controlId, control),
|
|
128
|
+
);
|
|
129
|
+
|
|
130
|
+
if (unsafeSwitchLabels.length > 0) {
|
|
131
|
+
errors.push(
|
|
132
|
+
`${sectionLabel} layoutGroups inline row "${layoutGroup.controls.join(", ")}" includes switch labels ${unsafeSwitchLabels.map(([controlId, control]) => `${controlId} "${getInlineSwitchLabelText(controlId, control)}"`).join(", ")} that are too long for a two-column toggle row. Switches share a row only when every visible label fits without truncation; shorten labels or stack them.`,
|
|
133
|
+
);
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
if (booleanEntries.length === 1 && parameterEntries.length === 1) {
|
|
138
|
+
const unsafeBooleanLabels = booleanEntries.filter(
|
|
139
|
+
([controlId, control]) => !isInlineSwitchLabelSafe(controlId, control),
|
|
140
|
+
);
|
|
141
|
+
|
|
142
|
+
if (unsafeBooleanLabels.length > 0) {
|
|
143
|
+
errors.push(
|
|
144
|
+
`${sectionLabel} layoutGroups inline row "${layoutGroup.controls.join(", ")}" includes toggle label ${unsafeBooleanLabels.map(([controlId, control]) => `${controlId} "${getInlineSwitchLabelText(controlId, control)}"`).join(", ")} that is too long for a compact toggle-plus-parameter row. Keep the toggle label short, such as "Include" inside Background, or stack the controls.`,
|
|
145
|
+
);
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
const visibleParameterLabels = parameterEntries.filter(
|
|
149
|
+
([, control]) => control.label !== false,
|
|
150
|
+
);
|
|
151
|
+
|
|
152
|
+
if (visibleParameterLabels.length > 0) {
|
|
153
|
+
errors.push(
|
|
154
|
+
`${sectionLabel} layoutGroups inline row "${layoutGroup.controls.join(", ")}" pairs a toggle with parameter labels ${visibleParameterLabels.map(([controlId, control]) => `${controlId} "${getControlLabelText(control)}"`).join(", ")}. In toggle-plus-parameter rows, the non-toggle parameter must use label false; if that label is needed, stack the controls instead.`,
|
|
155
|
+
);
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
const sectionControls = Object.entries(section.controls).filter(([, control]) =>
|
|
161
|
+
isToolcraftProductSectionControl(control),
|
|
162
|
+
);
|
|
163
|
+
|
|
164
|
+
for (let index = 0; index < sectionControls.length - 1; index += 1) {
|
|
165
|
+
const [firstControlId, firstControl] = sectionControls[index] ?? [];
|
|
166
|
+
const [secondControlId, secondControl] = sectionControls[index + 1] ?? [];
|
|
167
|
+
|
|
168
|
+
if (
|
|
169
|
+
!firstControlId ||
|
|
170
|
+
!secondControlId ||
|
|
171
|
+
!firstControl ||
|
|
172
|
+
!secondControl ||
|
|
173
|
+
firstControl.visibleWhen ||
|
|
174
|
+
secondControl.visibleWhen ||
|
|
175
|
+
!isBooleanControl(firstControl) ||
|
|
176
|
+
!isBooleanControl(secondControl) ||
|
|
177
|
+
!isInlineSwitchLabelSafe(firstControlId, firstControl) ||
|
|
178
|
+
!isInlineSwitchLabelSafe(secondControlId, secondControl) ||
|
|
179
|
+
!controlsShareToolcraftTargetEntity(firstControl, secondControl) ||
|
|
180
|
+
sectionHasInlineLayoutGroupForPair(section, firstControlId, secondControlId)
|
|
181
|
+
) {
|
|
182
|
+
continue;
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
errors.push(
|
|
186
|
+
`${sectionLabel} has adjacent short toggle controls "${firstControlId}" and "${secondControlId}" for the same product entity "${getToolcraftLooseTargetPrefix(firstControl.target)}". Put them in a two-column inline layoutGroup so compact paired toggles share one row.`,
|
|
187
|
+
);
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
return errors;
|
|
192
|
+
}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import type { ToolcraftControlSchema } from "@repo/toolcraft-runtime";
|
|
2
|
+
|
|
3
|
+
import type { ToolcraftComponentAcceptance } from "./types";
|
|
4
|
+
|
|
5
|
+
export function getFileDropLifecycleCoverageErrors(
|
|
6
|
+
label: string,
|
|
7
|
+
control: ToolcraftControlSchema,
|
|
8
|
+
entry: ToolcraftComponentAcceptance,
|
|
9
|
+
hasDefaultMediaAssets: boolean,
|
|
10
|
+
): string[] {
|
|
11
|
+
const errors: string[] = [];
|
|
12
|
+
const coverage = new Set(entry.mediaLifecycleCoverage ?? []);
|
|
13
|
+
|
|
14
|
+
if (entry.evidence !== "media-lifecycle") {
|
|
15
|
+
errors.push(
|
|
16
|
+
`${label} fileDrop acceptance evidence must be "media-lifecycle" so upload, clear, and reset behavior cannot be replaced by generic product-output coverage.`,
|
|
17
|
+
);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
if (!coverage.has("upload") || !coverage.has("remove") || !coverage.has("reset")) {
|
|
21
|
+
errors.push(
|
|
22
|
+
`${label} fileDrop acceptance must prove upload/import, clear/remove, and section or global reset restore default source media or remove uploaded source media when no default exists.`,
|
|
23
|
+
);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
if (hasDefaultMediaAssets) {
|
|
27
|
+
if (!coverage.has("default-remove") || !coverage.has("default-reset")) {
|
|
28
|
+
errors.push(
|
|
29
|
+
`${label} fileDrop acceptance must prove predefined media.defaultAssets render as attached files, can be removed to an empty source/canvas state, and are restored by section or global Reset.`,
|
|
30
|
+
);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
if (control.assetKind !== "file") {
|
|
35
|
+
if (
|
|
36
|
+
!coverage.has("rotate") ||
|
|
37
|
+
!coverage.has("flip") ||
|
|
38
|
+
!coverage.has("transform-output")
|
|
39
|
+
) {
|
|
40
|
+
errors.push(
|
|
41
|
+
`${label} image fileDrop acceptance must prove rotate and flip actions update runtime media transform metadata and that preview, renderer, or export consumes the transform.`,
|
|
42
|
+
);
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
if (control.multiple === true) {
|
|
47
|
+
if (!coverage.has("reorder") || !coverage.has("order-output")) {
|
|
48
|
+
errors.push(
|
|
49
|
+
`${label} multiple fileDrop acceptance must prove thumbnail/file reorder updates runtime media order and that preview, renderer, or export consumes that order.`,
|
|
50
|
+
);
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
return errors;
|
|
55
|
+
}
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
import { getControlLabelText } from "./controls";
|
|
2
|
+
import {
|
|
3
|
+
getSearchableControlText,
|
|
4
|
+
type ToolcraftControlsSection,
|
|
5
|
+
type ToolcraftOutputExportFacts,
|
|
6
|
+
} from "./output-export-model";
|
|
7
|
+
import type { ToolcraftVisibleControl } from "./types";
|
|
8
|
+
|
|
9
|
+
function schemaHasOutputBackgroundColorControl(
|
|
10
|
+
controls: readonly ToolcraftVisibleControl[],
|
|
11
|
+
): boolean {
|
|
12
|
+
return controls.some((visibleControl) => {
|
|
13
|
+
const { control } = visibleControl;
|
|
14
|
+
|
|
15
|
+
if (control.type !== "color") {
|
|
16
|
+
return false;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
return /\b(background|backdrop|scene|canvas)\b/i.test(
|
|
20
|
+
getSearchableControlText(visibleControl),
|
|
21
|
+
);
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
function schemaHasOutputBackgroundToggleControl(
|
|
26
|
+
controls: readonly ToolcraftVisibleControl[],
|
|
27
|
+
): boolean {
|
|
28
|
+
return controls.some(isOutputBackgroundToggleControl);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export function isOutputBackgroundToggleControl(
|
|
32
|
+
visibleControl: ToolcraftVisibleControl,
|
|
33
|
+
): boolean {
|
|
34
|
+
const { control } = visibleControl;
|
|
35
|
+
|
|
36
|
+
if (
|
|
37
|
+
control.type !== "switch" &&
|
|
38
|
+
control.type !== "checkbox" &&
|
|
39
|
+
control.type !== "select" &&
|
|
40
|
+
control.type !== "segmented"
|
|
41
|
+
) {
|
|
42
|
+
return false;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
return /\b(background|backdrop|transparent|transparency|alpha)\b/i.test(
|
|
46
|
+
getSearchableControlText(visibleControl),
|
|
47
|
+
);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
function sectionHasEqualWidthOutputBackgroundRow(
|
|
51
|
+
section: ToolcraftControlsSection | undefined,
|
|
52
|
+
toggleControlId: string | undefined,
|
|
53
|
+
colorControlId: string | undefined,
|
|
54
|
+
): boolean {
|
|
55
|
+
if (!section || !toggleControlId || !colorControlId) {
|
|
56
|
+
return false;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
return (section.layoutGroups ?? []).some(
|
|
60
|
+
(layoutGroup) =>
|
|
61
|
+
layoutGroup.layout === "inline" &&
|
|
62
|
+
layoutGroup.columns === 2 &&
|
|
63
|
+
layoutGroup.controls.length === 2 &&
|
|
64
|
+
layoutGroup.controls[0] === toggleControlId &&
|
|
65
|
+
layoutGroup.controls[1] === colorControlId,
|
|
66
|
+
);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
export function getToolcraftOutputBackgroundErrors({
|
|
70
|
+
controls,
|
|
71
|
+
facts,
|
|
72
|
+
}: {
|
|
73
|
+
controls: readonly ToolcraftVisibleControl[];
|
|
74
|
+
facts: ToolcraftOutputExportFacts;
|
|
75
|
+
}): string[] {
|
|
76
|
+
const errors: string[] = [];
|
|
77
|
+
|
|
78
|
+
if (!schemaHasOutputBackgroundColorControl(controls)) {
|
|
79
|
+
errors.push(
|
|
80
|
+
"Product apps with Export PNG must expose a user-facing background color control such as appearance.background or scene.background. Preview, PNG export, and video export must read that runtime value instead of hardcoding the product background.",
|
|
81
|
+
);
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
if (!facts.backgroundColorEntry) {
|
|
85
|
+
errors.push(
|
|
86
|
+
'The "Background" section must contain the renderer-owned background color control, such as appearance.background or scene.background.',
|
|
87
|
+
);
|
|
88
|
+
} else {
|
|
89
|
+
const [, backgroundColorControl] = facts.backgroundColorEntry;
|
|
90
|
+
|
|
91
|
+
if (backgroundColorControl.label !== false) {
|
|
92
|
+
errors.push(
|
|
93
|
+
'The background color control inside the required "Background" section must use label false; the section title already supplies the visible context.',
|
|
94
|
+
);
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
if (!schemaHasOutputBackgroundToggleControl(controls)) {
|
|
99
|
+
errors.push(
|
|
100
|
+
'Product apps with Export PNG must expose export.includeBackground inside the required "Background" section as a Switch labeled "Include". PNG export must pass that runtime value to createToolcraftPngExportCanvas includeBackground; live preview must use shouldIncludeToolcraftPreviewBackground(state); video export keeps the background.',
|
|
101
|
+
);
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
if (!facts.includeBackgroundEntry) {
|
|
105
|
+
errors.push(
|
|
106
|
+
'The "Background" section must contain export.includeBackground as the Include switch.',
|
|
107
|
+
);
|
|
108
|
+
} else {
|
|
109
|
+
const [, includeBackgroundControl] = facts.includeBackgroundEntry;
|
|
110
|
+
|
|
111
|
+
if (includeBackgroundControl.type !== "switch") {
|
|
112
|
+
errors.push('export.includeBackground must be a Switch control labeled "Include".');
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
if (getControlLabelText(includeBackgroundControl) !== "Include") {
|
|
116
|
+
errors.push(
|
|
117
|
+
'export.includeBackground must use the short visible label "Include"; the Background section title already supplies the rest of the context.',
|
|
118
|
+
);
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
if (
|
|
123
|
+
!sectionHasEqualWidthOutputBackgroundRow(
|
|
124
|
+
facts.backgroundSection,
|
|
125
|
+
facts.includeBackgroundEntry?.[0],
|
|
126
|
+
facts.backgroundColorEntry?.[0],
|
|
127
|
+
)
|
|
128
|
+
) {
|
|
129
|
+
errors.push(
|
|
130
|
+
'The "Background" section must render export.includeBackground and the background color in one two-column inline layoutGroup, with Include on the left and the unlabeled background color on the right.',
|
|
131
|
+
);
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
return errors;
|
|
135
|
+
}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { describe, expect, it } from "vitest";
|
|
2
|
+
import { defineToolcraft } from "@repo/toolcraft-runtime";
|
|
3
|
+
|
|
4
|
+
import {
|
|
5
|
+
schemaHasPngExportPanelAction,
|
|
6
|
+
schemaHasVideoExportPanelAction,
|
|
7
|
+
} from "./output-export-actions";
|
|
8
|
+
|
|
9
|
+
function createOutputSchema() {
|
|
10
|
+
return defineToolcraft({
|
|
11
|
+
canvas: { enabled: true },
|
|
12
|
+
panels: {
|
|
13
|
+
controls: {
|
|
14
|
+
sections: [
|
|
15
|
+
{
|
|
16
|
+
controls: {
|
|
17
|
+
output: {
|
|
18
|
+
actions: [
|
|
19
|
+
{
|
|
20
|
+
label: "Guardar imagen",
|
|
21
|
+
role: "export-image",
|
|
22
|
+
value: "salida.imagen",
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
label: "Guardar movimiento",
|
|
26
|
+
role: "export-video",
|
|
27
|
+
value: "salida.movimiento",
|
|
28
|
+
},
|
|
29
|
+
],
|
|
30
|
+
target: "salida.acciones",
|
|
31
|
+
type: "panelActions",
|
|
32
|
+
},
|
|
33
|
+
},
|
|
34
|
+
title: "Salida",
|
|
35
|
+
},
|
|
36
|
+
],
|
|
37
|
+
title: "Controles",
|
|
38
|
+
},
|
|
39
|
+
},
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
describe("Toolcraft typed output action roles", () => {
|
|
44
|
+
it("detects image and video export without parsing labels or values", () => {
|
|
45
|
+
const schema = createOutputSchema();
|
|
46
|
+
|
|
47
|
+
expect(schemaHasPngExportPanelAction(schema)).toBe(true);
|
|
48
|
+
expect(schemaHasVideoExportPanelAction(schema)).toBe(true);
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
it("does not treat export-like prose as semantic output evidence", () => {
|
|
52
|
+
const schema = defineToolcraft({
|
|
53
|
+
canvas: { enabled: true },
|
|
54
|
+
panels: {
|
|
55
|
+
controls: {
|
|
56
|
+
sections: [
|
|
57
|
+
{
|
|
58
|
+
controls: {
|
|
59
|
+
output: {
|
|
60
|
+
actions: [{ label: "Export PNG", value: "export.png" }],
|
|
61
|
+
target: "actions.output",
|
|
62
|
+
type: "panelActions",
|
|
63
|
+
},
|
|
64
|
+
},
|
|
65
|
+
title: "Output",
|
|
66
|
+
},
|
|
67
|
+
],
|
|
68
|
+
title: "Controls",
|
|
69
|
+
},
|
|
70
|
+
},
|
|
71
|
+
});
|
|
72
|
+
|
|
73
|
+
expect(schemaHasPngExportPanelAction(schema)).toBe(false);
|
|
74
|
+
expect(schemaHasVideoExportPanelAction(schema)).toBe(false);
|
|
75
|
+
});
|
|
76
|
+
});
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
ResolvedToolcraftAppSchema,
|
|
3
|
+
ToolcraftActionSchema,
|
|
4
|
+
} from "@repo/toolcraft-runtime";
|
|
5
|
+
|
|
6
|
+
import { getControlActions } from "./actions";
|
|
7
|
+
|
|
8
|
+
function actionLooksLikePngExport(action: ToolcraftActionSchema | string): boolean {
|
|
9
|
+
return typeof action !== "string" && action.role === "export-image";
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
function actionLooksLikeVideoExport(action: ToolcraftActionSchema | string): boolean {
|
|
13
|
+
return typeof action !== "string" && action.role === "export-video";
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export function schemaHasPngExportPanelAction(schema: ResolvedToolcraftAppSchema): boolean {
|
|
17
|
+
return (schema.panels.controls?.sections ?? []).some((section) =>
|
|
18
|
+
Object.values(section.controls).some(
|
|
19
|
+
(control) =>
|
|
20
|
+
control.type === "panelActions" &&
|
|
21
|
+
getControlActions(control).some(actionLooksLikePngExport),
|
|
22
|
+
),
|
|
23
|
+
);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export function schemaHasVideoExportPanelAction(schema: ResolvedToolcraftAppSchema): boolean {
|
|
27
|
+
return (schema.panels.controls?.sections ?? []).some((section) =>
|
|
28
|
+
Object.values(section.controls).some(
|
|
29
|
+
(control) =>
|
|
30
|
+
control.type === "panelActions" &&
|
|
31
|
+
getControlActions(control).some(actionLooksLikeVideoExport),
|
|
32
|
+
),
|
|
33
|
+
);
|
|
34
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import type { ToolcraftOutputExportFacts } from "./output-export-model";
|
|
2
|
+
|
|
3
|
+
export function getToolcraftOutputExportLayoutErrors(
|
|
4
|
+
facts: ToolcraftOutputExportFacts,
|
|
5
|
+
): string[] {
|
|
6
|
+
const errors: string[] = [];
|
|
7
|
+
|
|
8
|
+
if (!facts.backgroundSection) {
|
|
9
|
+
errors.push(
|
|
10
|
+
'Product apps with Export PNG must expose a separate controls section titled "Background" directly before the first export settings section.',
|
|
11
|
+
);
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
if (
|
|
15
|
+
facts.backgroundSectionIndex >= 0 &&
|
|
16
|
+
facts.expectedOutputSettingsIndex >= 0 &&
|
|
17
|
+
facts.backgroundSectionIndex !== facts.expectedOutputSettingsIndex - 1
|
|
18
|
+
) {
|
|
19
|
+
errors.push(
|
|
20
|
+
'The "Background" controls section must sit directly before the first export settings section: Image Export when PNG export exists, otherwise Video Export.',
|
|
21
|
+
);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
if (
|
|
25
|
+
facts.finalExportSettingsIndex >= 0 &&
|
|
26
|
+
facts.panelActionsSectionIndex >= 0 &&
|
|
27
|
+
facts.finalExportSettingsIndex !== facts.panelActionsSectionIndex - 1
|
|
28
|
+
) {
|
|
29
|
+
errors.push(
|
|
30
|
+
'Export settings must sit directly above sticky footer actions: Image Export for still apps, or Video Export after Image Export for animated apps.',
|
|
31
|
+
);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
if (
|
|
35
|
+
facts.hasVideoExportAction &&
|
|
36
|
+
facts.imageExportSectionIndex >= 0 &&
|
|
37
|
+
facts.videoExportSectionIndex >= 0 &&
|
|
38
|
+
facts.imageExportSectionIndex !== facts.videoExportSectionIndex - 1
|
|
39
|
+
) {
|
|
40
|
+
errors.push(
|
|
41
|
+
'Animated apps with both Export PNG and Export Video must place Image Export immediately before Video Export.',
|
|
42
|
+
);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
return errors;
|
|
46
|
+
}
|