@salsita-ai/sdk 0.50.0-develop.801a817d3f → 0.50.0-develop.85e8f9df39
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 +20 -15
- package/dist/admin/create-admin-pages-from-spec.d.ts +1 -1
- package/dist/admin/default-admin-elements.d.ts +9 -0
- package/dist/admin/default-admin-elements.js +1 -0
- package/dist/admin/default-elements/built-in-entity-element.d.ts +10 -0
- package/dist/admin/default-elements/built-in-entity-element.js +1 -0
- package/dist/admin/default-elements/built-in-layout-element.d.ts +10 -0
- package/dist/admin/default-elements/built-in-layout-element.js +1 -0
- package/dist/admin/default-elements/index.d.ts +2 -0
- package/dist/admin/default-elements/index.js +1 -0
- package/dist/admin/index.d.ts +1 -0
- package/dist/admin/index.js +1 -1
- package/dist/application-spec/caching/content-diff.js +1 -1
- package/dist/application-spec/core/application-file.d.ts +0 -2
- package/dist/application-spec/core/application-file.js +1 -1
- package/dist/application-spec/core/components/component-filter.d.ts +53 -0
- package/dist/application-spec/core/components/component-filter.js +1 -0
- package/dist/application-spec/core/components/index.d.ts +2 -0
- package/dist/application-spec/core/components/index.js +1 -0
- package/dist/application-spec/core/components/sdk-code-ref.d.ts +9 -0
- package/dist/application-spec/core/components/sdk-code-ref.js +1 -0
- package/dist/application-spec/core/enhanced-json-value.d.ts +0 -68
- package/dist/application-spec/core/enhanced-json-value.js +1 -1
- package/dist/application-spec/core/expressions/index.d.ts +2 -0
- package/dist/application-spec/core/expressions/index.js +1 -0
- package/dist/application-spec/core/expressions/relation-expression-params.d.ts +11 -0
- package/dist/application-spec/core/expressions/sdk-expression-implementation.d.ts +24 -0
- package/dist/application-spec/core/expressions/sdk-expression-implementation.js +1 -0
- package/dist/application-spec/core/index.d.ts +2 -0
- package/dist/application-spec/core/index.js +1 -1
- package/dist/application-spec/core/json-value.d.ts +1 -1
- package/dist/application-spec/enhanced-json/eval-to-constant.d.ts +14 -0
- package/dist/application-spec/enhanced-json/index.d.ts +4 -0
- package/dist/application-spec/enhanced-json/index.js +1 -0
- package/dist/application-spec/enhanced-json/is-enhanced-json-array.d.ts +2 -0
- package/dist/application-spec/enhanced-json/is-enhanced-json-array.js +1 -0
- package/dist/application-spec/enhanced-json/resolve-enhanced-json-value.d.ts +18 -0
- package/dist/application-spec/enhanced-json/resolve-enhanced-json-value.js +1 -0
- package/dist/application-spec/enhanced-json/schema-from-value.d.ts +24 -0
- package/dist/application-spec/enhanced-json/schema-from-value.js +1 -0
- package/dist/application-spec/enhanced-json/stringify-enhanced-json-value.d.ts +14 -0
- package/dist/application-spec/enhanced-json/stringify-enhanced-json-value.js +1 -0
- package/dist/application-spec/enhanced-json/validate-enhanced-json-value-caps.d.ts +12 -0
- package/dist/application-spec/enhanced-json/validate-enhanced-json-value-caps.js +1 -0
- package/dist/application-spec/enhanced-json/validate-no-legacy-code-ref.d.ts +13 -0
- package/dist/application-spec/enhanced-json/validate-no-legacy-code-ref.js +1 -0
- package/dist/application-spec/errors/diagnostic-codes.d.ts +14 -0
- package/dist/application-spec/errors/diagnostic-codes.js +1 -1
- package/dist/application-spec/errors/diagnostic-messages.d.ts +17 -0
- package/dist/application-spec/errors/diagnostic-messages.js +1 -1
- package/dist/application-spec/generate-application/code/common/code-imports.js +1 -1
- package/dist/application-spec/generate-application/code/common/env-reader.js +2 -2
- package/dist/application-spec/generate-application/code/common/index.d.ts +2 -0
- package/dist/application-spec/generate-application/code/common/index.js +1 -1
- package/dist/application-spec/generate-application/code/common/project-module-list.d.ts +8 -0
- package/dist/application-spec/generate-application/code/common/project-module-list.js +3 -0
- package/dist/application-spec/generate-application/code/common/single-quoted-string.d.ts +6 -0
- package/dist/application-spec/generate-application/code/common/single-quoted-string.js +1 -0
- package/dist/application-spec/generate-application/code/domain-runtime-files.js +1 -1
- package/dist/application-spec/generate-application/code/generate-application-code.d.ts +3 -2
- package/dist/application-spec/generate-application/code/generate-application-code.js +1 -1
- package/dist/application-spec/generate-application/code/project-scaffolding.d.ts +22 -14
- package/dist/application-spec/generate-application/code/project-scaffolding.js +2 -2
- package/dist/application-spec/generate-application/code/standalone-app-files.d.ts +2 -2
- package/dist/application-spec/generate-application/code/standalone-app-files.js +1 -1
- package/dist/application-spec/generate-application/code/story-files.js +1 -1
- package/dist/application-spec/generate-application/code/templates/admin-config.js +3 -0
- package/dist/application-spec/generate-application/code/templates/admin-domain-code.d.ts +1 -2
- package/dist/application-spec/generate-application/code/templates/admin-domain-code.js +6 -14
- package/dist/application-spec/generate-application/code/templates/admin-frontend-code.d.ts +1 -2
- package/dist/application-spec/generate-application/code/templates/admin-frontend-code.js +4 -4
- package/dist/application-spec/generate-application/code/templates/common/format-property-key.d.ts +7 -0
- package/dist/application-spec/generate-application/code/templates/common/format-property-key.js +1 -0
- package/dist/application-spec/generate-application/code/templates/common/schema-to-type-string.js +3 -3
- package/dist/application-spec/generate-application/code/templates/configurator-config.js +6 -4
- package/dist/application-spec/generate-application/code/templates/configurator-domain-code.d.ts +1 -2
- package/dist/application-spec/generate-application/code/templates/configurator-domain-code.js +7 -16
- package/dist/application-spec/generate-application/code/templates/configurator-frontend-code.d.ts +1 -2
- package/dist/application-spec/generate-application/code/templates/configurator-frontend-code.js +7 -9
- package/dist/application-spec/generate-application/code/templates/domain-spec/factory-types/domain-factory-types.d.ts +35 -0
- package/dist/application-spec/generate-application/code/templates/domain-spec/factory-types/domain-factory-types.js +5 -0
- package/dist/application-spec/generate-application/code/templates/domain-spec/factory-types/index.d.ts +1 -0
- package/dist/application-spec/generate-application/code/templates/domain-spec/factory-types/index.js +1 -0
- package/dist/application-spec/generate-application/code/templates/domain-spec/generate-assistant.d.ts +2 -2
- package/dist/application-spec/generate-application/code/templates/domain-spec/generate-assistant.js +1 -1
- package/dist/application-spec/generate-application/code/templates/domain-spec/generate-component-optics.d.ts +1 -1
- package/dist/application-spec/generate-application/code/templates/domain-spec/generate-component-optics.js +7 -7
- package/dist/application-spec/generate-application/code/templates/domain-spec/generate-defaults.d.ts +4 -2
- package/dist/application-spec/generate-application/code/templates/domain-spec/generate-defaults.js +1 -1
- package/dist/application-spec/generate-application/code/templates/domain-spec/generate-domain-block.js +72 -76
- package/dist/application-spec/generate-application/code/templates/domain-spec/generate-invariants.d.ts +9 -1
- package/dist/application-spec/generate-application/code/templates/domain-spec/generate-invariants.js +1 -1
- package/dist/application-spec/generate-application/code/templates/domain-spec/generate-phx-globals.js +3 -0
- package/dist/application-spec/generate-application/code/templates/domain-spec/generate-presets.js +1 -1
- package/dist/application-spec/generate-application/code/templates/domain-spec/generate-relation-expressions.js +1 -1
- package/dist/application-spec/generate-application/code/templates/domain-spec/generate-resources.d.ts +6 -8
- package/dist/application-spec/generate-application/code/templates/domain-spec/generate-resources.js +21 -21
- package/dist/application-spec/generate-application/code/templates/domain-spec/generate-states.d.ts +1 -1
- package/dist/application-spec/generate-application/code/templates/domain-spec/generate-states.js +2 -2
- package/dist/application-spec/generate-application/code/templates/domain-spec/index.d.ts +3 -2
- package/dist/application-spec/generate-application/code/templates/domain-spec/index.js +1 -1
- package/dist/application-spec/generate-application/code/templates/domain-spec.js +12 -12
- package/dist/application-spec/generate-application/code/templates/domain.js +5 -5
- package/dist/application-spec/generate-application/code/templates/eslint-config.d.ts +5 -0
- package/dist/application-spec/generate-application/code/templates/eslint-config.js +4 -5
- package/dist/application-spec/generate-application/code/templates/frontend-config.js +3 -5
- package/dist/application-spec/generate-application/code/templates/gitignore.js +0 -3
- package/dist/application-spec/generate-application/code/templates/global-definition/generate-phx-types.d.ts +43 -0
- package/dist/application-spec/generate-application/code/templates/global-definition/generate-phx-types.js +31 -0
- package/dist/application-spec/generate-application/code/templates/global-definition/index.d.ts +1 -0
- package/dist/application-spec/generate-application/code/templates/global-definition/index.js +1 -1
- package/dist/application-spec/generate-application/code/templates/globals.js +24 -43
- package/dist/application-spec/generate-application/code/templates/index.d.ts +4 -10
- package/dist/application-spec/generate-application/code/templates/index.js +1 -1
- package/dist/application-spec/generate-application/code/templates/lingui-rc.d.ts +5 -0
- package/dist/application-spec/generate-application/code/templates/lingui-rc.js +4 -4
- package/dist/application-spec/generate-application/code/templates/prettier-config.d.ts +5 -0
- package/dist/application-spec/generate-application/code/templates/prettier-config.js +4 -5
- package/dist/application-spec/generate-application/code/templates/root-tsconfig.d.ts +6 -0
- package/dist/application-spec/generate-application/code/templates/root-tsconfig.js +2 -0
- package/dist/application-spec/generate-application/code/templates/skills/phoenix-cli-skill.js +1 -1
- package/dist/application-spec/generate-application/code/templates/skills/phoenix-create-configurator-skill.js +93 -41
- package/dist/application-spec/generate-application/code/templates/skills/phoenix-feedback-skill.js +5 -5
- package/dist/application-spec/generate-application/code/templates/skills/phoenix-review-skill.js +10 -4
- package/dist/application-spec/generate-application/code/templates/skills/phoenix-skill.js +1 -1
- package/dist/application-spec/generate-application/code/templates/skills/phoenix-variants-skill.d.ts +1 -0
- package/dist/application-spec/generate-application/code/templates/skills/phoenix-variants-skill.js +6 -0
- package/dist/application-spec/generate-application/code/templates/skills/sdk-content.d.ts +60 -16
- package/dist/application-spec/generate-application/code/templates/skills/sdk-content.js +19 -7
- package/dist/application-spec/generate-application/code/templates/spec-code/collect-spec-code.d.ts +58 -0
- package/dist/application-spec/generate-application/code/templates/spec-code/collect-spec-code.js +1 -0
- package/dist/application-spec/generate-application/code/templates/spec-code/index.d.ts +2 -0
- package/dist/application-spec/generate-application/code/templates/spec-code/index.js +1 -0
- package/dist/application-spec/generate-application/code/templates/spec-code/spec-code.d.ts +18 -0
- package/dist/application-spec/generate-application/code/templates/spec-code/spec-code.js +41 -0
- package/dist/application-spec/generate-application/code/templates/spec-messages/index.d.ts +1 -0
- package/dist/application-spec/generate-application/code/templates/spec-messages/index.js +1 -0
- package/dist/application-spec/generate-application/code/templates/spec-messages/spec-messages.d.ts +20 -0
- package/dist/application-spec/generate-application/code/templates/spec-messages/spec-messages.js +6 -0
- package/dist/application-spec/generate-application/code/templates/story/phx-module.d.ts +8 -2
- package/dist/application-spec/generate-application/code/templates/story/phx-module.js +15 -3
- package/dist/application-spec/generate-application/code/templates/story/wrapper.d.ts +3 -0
- package/dist/application-spec/generate-application/code/templates/story/wrapper.js +2 -1
- package/dist/application-spec/generate-application/code/templates/tsconfig.d.ts +5 -0
- package/dist/application-spec/generate-application/code/templates/tsconfig.js +1 -1
- package/dist/application-spec/generate-application/code/templates/webhook-builders.js +9 -4
- package/dist/application-spec/generate-application/code/templates/webhook-index.d.ts +6 -1
- package/dist/application-spec/generate-application/code/templates/webhook-index.js +10 -1
- package/dist/application-spec/generate-application/code/templates/webhooks-config.js +2 -3
- package/dist/application-spec/generate-application/index.d.ts +2 -0
- package/dist/application-spec/generate-application/index.js +1 -1
- package/dist/application-spec/generate-application/runtime/admin-runtime/admin-model-runtime.d.ts +6 -4
- package/dist/application-spec/generate-application/runtime/admin-runtime/admin-model-runtime.js +1 -1
- package/dist/application-spec/generate-application/runtime/admin-runtime/admin-runtime.d.ts +8 -3
- package/dist/application-spec/generate-application/runtime/admin-runtime/admin-runtime.js +1 -1
- package/dist/application-spec/generate-application/runtime/admin-runtime/states-runtime.d.ts +2 -2
- package/dist/application-spec/generate-application/runtime/application-runtime.d.ts +19 -7
- package/dist/application-spec/generate-application/runtime/application-runtime.js +1 -1
- package/dist/application-spec/generate-application/runtime/configurator-runtime/configurator-model-runtime.d.ts +6 -4
- package/dist/application-spec/generate-application/runtime/configurator-runtime/configurator-model-runtime.js +1 -1
- package/dist/application-spec/generate-application/runtime/configurator-runtime/configurator-runtime.d.ts +7 -4
- package/dist/application-spec/generate-application/runtime/configurator-runtime/configurator-runtime.js +1 -1
- package/dist/application-spec/generate-application/runtime/configurator-runtime/states-runtime.d.ts +2 -2
- package/dist/application-spec/generate-application/runtime/factory-data/factory-data-runtime.d.ts +43 -0
- package/dist/application-spec/generate-application/runtime/factory-data/factory-data-runtime.js +1 -0
- package/dist/application-spec/generate-application/runtime/factory-data/index.d.ts +3 -0
- package/dist/application-spec/generate-application/runtime/factory-data/index.js +1 -0
- package/dist/application-spec/generate-application/runtime/factory-data/recipe-defaults.d.ts +13 -0
- package/dist/application-spec/generate-application/runtime/factory-data/recipe-defaults.js +1 -0
- package/dist/application-spec/generate-application/runtime/factory-data/static-violations.d.ts +16 -0
- package/dist/application-spec/generate-application/runtime/factory-data/static-violations.js +1 -0
- package/dist/application-spec/generate-application/runtime/migrations/index.d.ts +1 -0
- package/dist/application-spec/generate-application/runtime/migrations/index.js +1 -0
- package/dist/application-spec/generate-application/runtime/migrations/migration-runtime.d.ts +53 -0
- package/dist/application-spec/generate-application/runtime/migrations/migration-runtime.js +1 -0
- package/dist/application-spec/generate-application/runtime/sections/assistant-runtime.d.ts +5 -4
- package/dist/application-spec/generate-application/runtime/sections/assistant-runtime.js +1 -1
- package/dist/application-spec/generate-application/runtime/sections/build-sdk-optic.d.ts +3 -2
- package/dist/application-spec/generate-application/runtime/sections/build-sdk-optic.js +1 -1
- package/dist/application-spec/generate-application/runtime/sections/build-user-bound-optic.d.ts +2 -1
- package/dist/application-spec/generate-application/runtime/sections/build-user-bound-optic.js +1 -1
- package/dist/application-spec/generate-application/runtime/sections/component-optic.d.ts +5 -1
- package/dist/application-spec/generate-application/runtime/sections/component-optic.js +1 -1
- package/dist/application-spec/generate-application/runtime/sections/data-runtime.d.ts +4 -4
- package/dist/application-spec/generate-application/runtime/sections/expression-runtime.d.ts +7 -4
- package/dist/application-spec/generate-application/runtime/sections/expression-runtime.js +1 -1
- package/dist/application-spec/generate-application/runtime/sections/generate-memo-eval-plan-runtime.d.ts +9 -5
- package/dist/application-spec/generate-application/runtime/sections/generate-memo-eval-plan-runtime.js +1 -1
- package/dist/application-spec/generate-application/runtime/sections/reflection-constants-runtime.d.ts +3 -1
- package/dist/application-spec/generate-application/runtime/sections/reflection-constants-runtime.js +1 -1
- package/dist/application-spec/generate-application/runtime/sections/theme-runtime.d.ts +2 -2
- package/dist/application-spec/generate-application/runtime/sections/transformers-runtime.d.ts +4 -6
- package/dist/application-spec/generate-application/runtime/spec-code/index.d.ts +2 -0
- package/dist/application-spec/generate-application/runtime/spec-code/index.js +1 -0
- package/dist/application-spec/generate-application/runtime/spec-code/resolve-spec-code.d.ts +18 -0
- package/dist/application-spec/generate-application/runtime/spec-code/resolve-spec-code.js +1 -0
- package/dist/application-spec/generate-application/runtime/spec-code/spec-code-module.d.ts +17 -0
- package/dist/application-spec/generate-application/runtime-spec/decode-runtime-spec.d.ts +9 -0
- package/dist/application-spec/generate-application/runtime-spec/decode-runtime-spec.js +1 -0
- package/dist/application-spec/generate-application/runtime-spec/encode-runtime-spec.d.ts +8 -0
- package/dist/application-spec/generate-application/runtime-spec/encode-runtime-spec.js +1 -0
- package/dist/application-spec/generate-application/runtime-spec/encoded-runtime-spec.d.ts +27 -0
- package/dist/application-spec/generate-application/runtime-spec/encoded-runtime-spec.js +1 -0
- package/dist/application-spec/generate-application/runtime-spec/index.d.ts +5 -0
- package/dist/application-spec/generate-application/runtime-spec/index.js +1 -0
- package/dist/application-spec/generate-application/runtime-spec/runtime-spec.d.ts +68 -0
- package/dist/application-spec/generate-application/runtime-spec/runtime-spec.js +1 -0
- package/dist/application-spec/generate-application/runtime-spec/spec-code-id.d.ts +40 -0
- package/dist/application-spec/generate-application/runtime-spec/spec-code-id.js +1 -0
- package/dist/application-spec/index.d.ts +1 -0
- package/dist/application-spec/index.js +1 -1
- package/dist/application-spec/parse-application-files/categorize/categorize-files.d.ts +34 -0
- package/dist/application-spec/parse-application-files/categorize/categorize-files.js +1 -1
- package/dist/application-spec/parse-application-files/categorize/earlier-generated-editor-configs.d.ts +16 -0
- package/dist/application-spec/parse-application-files/categorize/earlier-generated-editor-configs.js +9 -0
- package/dist/application-spec/parse-application-files/categorize/earlier-generated-tsconfig.d.ts +9 -0
- package/dist/application-spec/parse-application-files/categorize/earlier-generated-tsconfig.js +1 -0
- package/dist/application-spec/parse-application-files/categorize/module-analysis.d.ts +1 -1
- package/dist/application-spec/parse-application-files/categorize/module-analysis.js +1 -1
- package/dist/application-spec/parse-application-files/raw-spec/parse-yaml-spec-file.js +1 -1
- package/dist/application-spec/parse-application-files/raw-spec/raw-assistant.d.ts +16 -3
- package/dist/application-spec/parse-application-files/raw-spec/raw-assistant.js +1 -1
- package/dist/application-spec/parse-application-files/raw-spec/raw-spec-file.js +1 -1
- package/dist/application-spec/parse-application-files/spec/application/admin-spec/admin-spec.js +1 -1
- package/dist/application-spec/parse-application-files/spec/application/configurator-spec/configurator-spec.js +1 -1
- package/dist/application-spec/parse-application-files/spec/common/index.d.ts +1 -0
- package/dist/application-spec/parse-application-files/spec/common/index.js +1 -1
- package/dist/application-spec/parse-application-files/spec/common/value-type/format-value-type.d.ts +3 -0
- package/dist/application-spec/parse-application-files/spec/common/value-type/format-value-type.js +1 -0
- package/dist/application-spec/parse-application-files/spec/common/value-type/index.d.ts +5 -0
- package/dist/application-spec/parse-application-files/spec/common/value-type/index.js +1 -0
- package/dist/application-spec/parse-application-files/spec/common/value-type/intersect-value-types.d.ts +6 -0
- package/dist/application-spec/parse-application-files/spec/common/value-type/intersect-value-types.js +1 -0
- package/dist/application-spec/parse-application-files/spec/common/value-type/is-assignable-value-type.d.ts +8 -0
- package/dist/application-spec/parse-application-files/spec/common/value-type/is-assignable-value-type.js +1 -0
- package/dist/application-spec/parse-application-files/spec/common/value-type/value-type-at.d.ts +10 -0
- package/dist/application-spec/parse-application-files/spec/common/value-type/value-type-at.js +1 -0
- package/dist/application-spec/parse-application-files/spec/common/value-type/value-type.d.ts +98 -0
- package/dist/application-spec/parse-application-files/spec/common/value-type/value-type.js +1 -0
- package/dist/application-spec/parse-application-files/spec/components/bindings/component-path.d.ts +13 -0
- package/dist/application-spec/parse-application-files/spec/components/bindings/component-path.js +1 -0
- package/dist/application-spec/parse-application-files/spec/components/bindings/index.d.ts +2 -0
- package/dist/application-spec/parse-application-files/spec/components/bindings/index.js +1 -1
- package/dist/application-spec/parse-application-files/spec/components/bindings/read-binding-type.d.ts +24 -0
- package/dist/application-spec/parse-application-files/spec/components/bindings/read-binding-type.js +1 -0
- package/dist/application-spec/parse-application-files/spec/components/component-entry.d.ts +1 -9
- package/dist/application-spec/parse-application-files/spec/components/component-entry.js +1 -1
- package/dist/application-spec/parse-application-files/spec/components/component-filter.d.ts +1 -54
- package/dist/application-spec/parse-application-files/spec/components/component-filter.js +1 -1
- package/dist/application-spec/parse-application-files/spec/components/component-state-type.d.ts +8 -0
- package/dist/application-spec/parse-application-files/spec/components/component-state-type.js +1 -0
- package/dist/application-spec/parse-application-files/spec/components/filter-criterion-types.d.ts +13 -0
- package/dist/application-spec/parse-application-files/spec/components/filter-criterion-types.js +1 -0
- package/dist/application-spec/parse-application-files/spec/components/index.d.ts +1 -1
- package/dist/application-spec/parse-application-files/spec/components/index.js +1 -1
- package/dist/application-spec/parse-application-files/spec/components/static-entity-id.d.ts +14 -0
- package/dist/application-spec/parse-application-files/spec/components/static-entity-id.js +1 -0
- package/dist/application-spec/parse-application-files/spec/components/user-component-entry.d.ts +6 -0
- package/dist/application-spec/parse-application-files/spec/components/user-component-entry.js +1 -1
- package/dist/application-spec/parse-application-files/spec/components/user-components.d.ts +7 -4
- package/dist/application-spec/parse-application-files/spec/components/user-components.js +1 -1
- package/dist/application-spec/parse-application-files/spec/expressions/expression-read-types.d.ts +24 -0
- package/dist/application-spec/parse-application-files/spec/expressions/expression-read-types.js +1 -0
- package/dist/application-spec/parse-application-files/spec/expressions/expression-read.d.ts +13 -0
- package/dist/application-spec/parse-application-files/spec/expressions/expression-value-type.d.ts +9 -0
- package/dist/application-spec/parse-application-files/spec/expressions/expression-value-type.js +1 -0
- package/dist/application-spec/parse-application-files/spec/expressions/expression.d.ts +1 -28
- package/dist/application-spec/parse-application-files/spec/expressions/expression.js +1 -1
- package/dist/application-spec/parse-application-files/spec/expressions/expressions.d.ts +7 -3
- package/dist/application-spec/parse-application-files/spec/expressions/expressions.js +1 -1
- package/dist/application-spec/parse-application-files/spec/expressions/index.d.ts +0 -1
- package/dist/application-spec/parse-application-files/spec/expressions/index.js +1 -1
- package/dist/application-spec/parse-application-files/spec/expressions/memo-eval-plan.js +1 -1
- package/dist/application-spec/parse-application-files/spec/expressions/user-expressions.d.ts +3 -1
- package/dist/application-spec/parse-application-files/spec/expressions/user-expressions.js +1 -1
- package/dist/application-spec/parse-application-files/spec/invariants/invariants.d.ts +2 -2
- package/dist/application-spec/parse-application-files/spec/invariants/invariants.js +1 -1
- package/dist/application-spec/parse-application-files/spec/model/defaults.d.ts +7 -2
- package/dist/application-spec/parse-application-files/spec/model/defaults.js +1 -1
- package/dist/application-spec/parse-application-files/spec/model/index.d.ts +1 -0
- package/dist/application-spec/parse-application-files/spec/model/index.js +1 -1
- package/dist/application-spec/parse-application-files/spec/model/model-type-resolution.d.ts +10 -0
- package/dist/application-spec/parse-application-files/spec/model/model-type-resolution.js +1 -0
- package/dist/application-spec/parse-application-files/spec/relations/reference-field-type.d.ts +25 -0
- package/dist/application-spec/parse-application-files/spec/relations/reference-field-type.js +1 -0
- package/dist/application-spec/parse-application-files/spec/relations/relation-field-mismatch.d.ts +46 -0
- package/dist/application-spec/parse-application-files/spec/relations/relation-field-mismatch.js +1 -0
- package/dist/application-spec/parse-application-files/spec/relations/relations.d.ts +4 -3
- package/dist/application-spec/parse-application-files/spec/relations/relations.js +1 -1
- package/dist/application-spec/parse-application-files/spec/sections/assistant/assistant-field-type.d.ts +3 -8
- package/dist/application-spec/parse-application-files/spec/sections/assistant/assistant-field-type.js +1 -1
- package/dist/application-spec/parse-application-files/spec/sections/assistant/assistant-schema.d.ts +9 -43
- package/dist/application-spec/parse-application-files/spec/sections/assistant/assistant-schema.js +1 -1
- package/dist/application-spec/parse-application-files/spec/sections/assistant/assistant-server-settings.d.ts +2 -2
- package/dist/application-spec/parse-application-files/spec/sections/assistant/assistant.d.ts +5 -21
- package/dist/application-spec/parse-application-files/spec/sections/infra.d.ts +2 -0
- package/dist/application-spec/parse-application-files/spec/sections/infra.js +1 -1
- package/dist/client/authorized-client.d.ts +3 -1
- package/dist/client/authorized-client.js +1 -1
- package/dist/client/contract.d.ts +34 -0
- package/dist/client/contract.js +1 -1
- package/dist/client/index.d.ts +2 -2
- package/dist/client/index.js +1 -1
- package/dist/client/local-authorized-client.d.ts +3 -1
- package/dist/client/local-authorized-client.js +1 -1
- package/dist/client/memory-authorized-client.d.ts +3 -1
- package/dist/client/memory-authorized-client.js +1 -1
- package/dist/client/phoenix-api.d.ts +761 -57
- package/dist/configurator/ConfiguratorApp.js +1 -1
- package/dist/configurator/application-runtime/extensions/create-configurator-extensions.js +1 -1
- package/dist/configurator/application-runtime/extensions/selectors.d.ts +3 -1
- package/dist/configurator/application-runtime/extensions/selectors.js +1 -1
- package/dist/configurator/application-runtime/extensions/systems/assistant-system/assistant-system.d.ts +158 -8
- package/dist/configurator/application-runtime/extensions/systems/assistant-system/assistant-system.js +1 -1
- package/dist/configurator/application-runtime/extensions/systems/assistant-system/change-recorder.d.ts +85 -0
- package/dist/configurator/application-runtime/extensions/systems/assistant-system/change-recorder.js +1 -0
- package/dist/configurator/application-runtime/extensions/systems/assistant-system/graphql-tools.d.ts +11 -1
- package/dist/configurator/application-runtime/extensions/systems/assistant-system/graphql-tools.js +1 -1
- package/dist/configurator/application-runtime/extensions/systems/camera-control-system/camera-control-system.d.ts +1 -1
- package/dist/configurator/application-runtime/extensions/systems/drag-and-drop-system/drag-and-drop-system.d.ts +3 -3
- package/dist/configurator/application-runtime/extensions/systems/graphql-system/close-unclosed-braces.d.ts +12 -0
- package/dist/configurator/application-runtime/extensions/systems/graphql-system/close-unclosed-braces.js +1 -0
- package/dist/configurator/application-runtime/extensions/systems/graphql-system/entity-meta.js +1 -1
- package/dist/configurator/application-runtime/extensions/systems/graphql-system/graphql-system.d.ts +26 -4
- package/dist/configurator/application-runtime/extensions/systems/graphql-system/graphql-system.js +1 -1
- package/dist/configurator/application-runtime/extensions/systems/graphql-system/inject-assistant-lenses.d.ts +11 -0
- package/dist/configurator/application-runtime/extensions/systems/graphql-system/inject-assistant-lenses.js +1 -0
- package/dist/configurator/application-runtime/extensions/systems/index.d.ts +1 -1
- package/dist/configurator/application-runtime/extensions/systems/layout-system/layout-system.d.ts +2 -2
- package/dist/configurator/application-runtime/extensions/systems/layout-system/layout-system.js +1 -1
- package/dist/configurator/common/configurator-interface.d.ts +45 -1
- package/dist/configurator/common/configurator-interface.js +1 -1
- package/dist/configurator/common/index.d.ts +3 -1
- package/dist/configurator/common/index.js +1 -1
- package/dist/configurator/common/use-reset-camera.d.ts +6 -0
- package/dist/configurator/common/use-reset-camera.js +1 -0
- package/dist/configurator/configuration-not-found-page/ConfigurationNotFoundPageElement.d.ts +12 -0
- package/dist/configurator/configuration-not-found-page/ConfigurationNotFoundPageElement.js +1 -0
- package/dist/configurator/configuration-not-found-page/index.d.ts +1 -0
- package/dist/configurator/configuration-not-found-page/index.js +1 -0
- package/dist/configurator/configurator-context/ConfiguratorResponsiveProvider.d.ts +12 -0
- package/dist/configurator/configurator-context/ConfiguratorResponsiveProvider.js +1 -0
- package/dist/configurator/configurator-context/PresetSelectionProvider.js +1 -1
- package/dist/configurator/configurator-context/PreviewContextProvider.js +1 -1
- package/dist/configurator/configurator-context/ViewportStateSync.d.ts +2 -2
- package/dist/configurator/configurator-context/ViewportStateSync.js +1 -1
- package/dist/configurator/configurator-context/configurator-hooks/layout-hooks.d.ts +7 -1
- package/dist/configurator/pages/ConfiguratorNotFoundPage.js +1 -1
- package/dist/configurator/pages/DefaultConfiguratorLayout.d.ts +7 -0
- package/dist/configurator/pages/DefaultConfiguratorLayout.js +1 -0
- package/dist/configurator/pages/DefaultNotAuthenticatedPage.d.ts +8 -0
- package/dist/configurator/pages/DefaultNotAuthenticatedPage.js +1 -0
- package/dist/configurator/pages/DefaultPresetUi.d.ts +7 -0
- package/dist/configurator/pages/DefaultPresetUi.js +1 -0
- package/dist/configurator/pages/LoadedConfiguratorDetailPage.js +1 -1
- package/dist/configurator/pages/NewConfiguratorPage.js +1 -1
- package/dist/configurator/pages/RootPage.js +1 -1
- package/dist/configurator/pages/configurator-layout-name.d.ts +2 -0
- package/dist/configurator/pages/configurator-layout-name.js +1 -0
- package/dist/configurator/pages/default-configurator-elements.d.ts +11 -0
- package/dist/configurator/pages/default-configurator-elements.js +1 -0
- package/dist/configurator/pages/default-elements/built-in-entity-element.d.ts +10 -0
- package/dist/configurator/pages/default-elements/built-in-entity-element.js +1 -0
- package/dist/configurator/pages/default-elements/built-in-layout-element.d.ts +10 -0
- package/dist/configurator/pages/default-elements/built-in-layout-element.js +1 -0
- package/dist/configurator/pages/default-elements/domain-control-elements.d.ts +6 -0
- package/dist/configurator/pages/default-elements/domain-control-elements.js +1 -0
- package/dist/configurator/pages/default-elements/index.d.ts +4 -0
- package/dist/configurator/pages/default-elements/index.js +1 -0
- package/dist/configurator/pages/default-elements/recipe-panel-elements.d.ts +3 -0
- package/dist/configurator/pages/default-elements/recipe-panel-elements.js +1 -0
- package/dist/configurator/pages/default-elements/sidebar-footer-elements.d.ts +7 -0
- package/dist/configurator/pages/default-elements/sidebar-footer-elements.js +1 -0
- package/dist/configurator/pages/default-elements/toolbar-elements.d.ts +7 -0
- package/dist/configurator/pages/default-elements/toolbar-elements.js +1 -0
- package/dist/configurator/pages/index.d.ts +1 -0
- package/dist/configurator/pages/index.js +1 -1
- package/dist/configurator/preset-screen-elements/PresetDeviceNotSupportedElement.d.ts +4 -0
- package/dist/configurator/preset-screen-elements/PresetDeviceNotSupportedElement.js +1 -0
- package/dist/configurator/preset-screen-elements/PresetPageActionElement.d.ts +4 -0
- package/dist/configurator/preset-screen-elements/PresetPageActionElement.js +1 -0
- package/dist/configurator/preset-screen-elements/index.d.ts +2 -0
- package/dist/configurator/preset-screen-elements/index.js +1 -0
- package/dist/configurator/scene/scene-controls/DeleteEntityFab.js +1 -1
- package/dist/configurator/scene/scene-controls/SelectionHotspot.js +1 -1
- package/dist/configurator/scene/scene-controls/hotspot-drag-handle/HotspotDragHandle.d.ts +1 -1
- package/dist/configurator/scene/scene-controls/hotspot-drag-handle/HotspotDragSceneHandle.d.ts +1 -1
- package/dist/configurator/scene/scene-entity/dimension-indicators/DimensionIndicator.d.ts +1 -1
- package/dist/configurator/scene/scene-entity/dimension-indicators/DimensionIndicatorInternal.d.ts +1 -1
- package/dist/configurator/scene/scene-entity/drag-and-drop/shared.d.ts +2 -2
- package/dist/configurator/scene/scene-entity/drag-and-drop/use-drag-object.d.ts +1 -1
- package/dist/configurator/scene/scene-entity/materials/RemoteReplacedMaterial.js +1 -1
- package/dist/configurator/scene/scene-entity/objects/SceneEntityObjectTextDecal.d.ts +1 -1
- package/dist/configurator/ui/assistant/AssistantChips.d.ts +8 -2
- package/dist/configurator/ui/assistant/AssistantChips.js +1 -1
- package/dist/configurator/ui/assistant/AssistantComposer.d.ts +2 -1
- package/dist/configurator/ui/assistant/AssistantComposer.js +1 -1
- package/dist/configurator/ui/assistant/AssistantMarkdown.d.ts +7 -2
- package/dist/configurator/ui/assistant/AssistantMarkdown.js +1 -1
- package/dist/configurator/ui/assistant/AssistantPanel.js +1 -1
- package/dist/configurator/ui/assistant/AssistantThread.d.ts +6 -2
- package/dist/configurator/ui/assistant/AssistantThread.js +1 -1
- package/dist/configurator/ui/assistant/entity-link/AssistantEntityLink.d.ts +13 -0
- package/dist/configurator/ui/assistant/entity-link/AssistantEntityLink.js +1 -0
- package/dist/configurator/ui/assistant/entity-link/entity-link-selection.d.ts +22 -0
- package/dist/configurator/ui/assistant/entity-link/entity-link-selection.js +1 -0
- package/dist/configurator/ui/assistant/entity-link/entity-link-state.d.ts +27 -0
- package/dist/configurator/ui/assistant/entity-link/entity-link-state.js +1 -0
- package/dist/configurator/ui/assistant/entity-link/index.d.ts +2 -0
- package/dist/configurator/ui/assistant/entity-link/index.js +1 -0
- package/dist/configurator/ui/assistant/form/AssistantForm.d.ts +19 -0
- package/dist/configurator/ui/assistant/form/AssistantForm.js +1 -0
- package/dist/configurator/ui/assistant/form/built-in-form-registry.d.ts +10 -0
- package/dist/configurator/ui/assistant/form/built-in-form-registry.js +1 -0
- package/dist/configurator/ui/assistant/form/compose-answer.d.ts +11 -0
- package/dist/configurator/ui/assistant/form/compose-answer.js +1 -0
- package/dist/configurator/ui/assistant/form/describe-build-errors.d.ts +6 -0
- package/dist/configurator/ui/assistant/form/describe-build-errors.js +1 -0
- package/dist/configurator/ui/assistant/form/form-element-definition.d.ts +14 -0
- package/dist/configurator/ui/assistant/form/form-model.d.ts +38 -0
- package/dist/configurator/ui/assistant/form/form-registry.d.ts +31 -0
- package/dist/configurator/ui/assistant/form/form-registry.js +8 -0
- package/dist/configurator/ui/assistant/form/form-state.d.ts +4 -0
- package/dist/configurator/ui/assistant/form/index.d.ts +2 -0
- package/dist/configurator/ui/assistant/form/index.js +1 -0
- package/dist/configurator/ui/assistant/form/parse-form-block.d.ts +9 -0
- package/dist/configurator/ui/assistant/form/parse-form-block.js +1 -0
- package/dist/configurator/ui/assistant/form/read-form-attributes.d.ts +13 -0
- package/dist/configurator/ui/assistant/form/read-form-attributes.js +1 -0
- package/dist/configurator/ui/assistant/form-elements/FormGroup.d.ts +3 -0
- package/dist/configurator/ui/assistant/form-elements/FormGroup.js +1 -0
- package/dist/configurator/ui/assistant/form-elements/FormOptions.d.ts +3 -0
- package/dist/configurator/ui/assistant/form-elements/FormOptions.js +1 -0
- package/dist/configurator/ui/assistant/form-elements/FormReply.d.ts +3 -0
- package/dist/configurator/ui/assistant/form-elements/FormReply.js +1 -0
- package/dist/configurator/ui/assistant/form-elements/FormText.d.ts +3 -0
- package/dist/configurator/ui/assistant/form-elements/FormText.js +1 -0
- package/dist/configurator/ui/assistant/form-elements/form-element-props.d.ts +34 -0
- package/dist/configurator/ui/assistant/form-elements/index.d.ts +5 -0
- package/dist/configurator/ui/assistant/form-elements/index.js +1 -0
- package/dist/configurator/ui/assistant/reference-link/AssistantReferenceLink.d.ts +16 -0
- package/dist/configurator/ui/assistant/reference-link/AssistantReferenceLink.js +1 -0
- package/dist/configurator/ui/assistant/reference-link/assistant-link-target.d.ts +34 -0
- package/dist/configurator/ui/assistant/reference-link/assistant-link-target.js +1 -0
- package/dist/configurator/ui/assistant/reference-link/assistant-reference-details.d.ts +25 -0
- package/dist/configurator/ui/assistant/reference-link/assistant-reference-details.js +1 -0
- package/dist/configurator/ui/assistant/reference-link/index.d.ts +3 -0
- package/dist/configurator/ui/assistant/reference-link/index.js +1 -0
- package/dist/configurator/ui/assistant/reference-link/reference-styles.d.ts +12 -0
- package/dist/configurator/ui/assistant/reference-link/reference-styles.js +1 -0
- package/dist/configurator/ui/assistant/reference-link/use-assistant-reference-details.d.ts +8 -0
- package/dist/configurator/ui/assistant/reference-link/use-assistant-reference-details.js +1 -0
- package/dist/configurator/ui/assistant/resource-image/AssistantImage.d.ts +9 -0
- package/dist/configurator/ui/assistant/resource-image/AssistantImage.js +1 -0
- package/dist/configurator/ui/assistant/resource-image/index.d.ts +3 -0
- package/dist/configurator/ui/assistant/resource-image/index.js +1 -0
- package/dist/configurator/ui/assistant/resource-image/resource-path.d.ts +11 -0
- package/dist/configurator/ui/assistant/resource-image/resource-path.js +1 -0
- package/dist/configurator/ui/assistant/resource-image/use-resource-image-url.d.ts +5 -0
- package/dist/configurator/ui/assistant/resource-image/use-resource-image-url.js +1 -0
- package/dist/configurator/ui/assistant/streamed-markdown.d.ts +2 -0
- package/dist/configurator/ui/assistant/streamed-markdown.js +2 -2
- package/dist/configurator/ui/assistant/thread-items.d.ts +21 -3
- package/dist/configurator/ui/assistant/thread-items.js +1 -1
- package/dist/configurator/ui/assistant/tool-chip.d.ts +8 -1
- package/dist/configurator/ui/assistant/tool-chip.js +1 -1
- package/dist/configurator/ui/assistant/use-follow-stream.js +1 -1
- package/dist/configurator/ui/configurator-layout/sidebar-keys/index.d.ts +1 -0
- package/dist/configurator/ui/configurator-layout/sidebar-keys/index.js +1 -0
- package/dist/configurator/ui/configurator-layout/sidebar-keys/sidebar-keys.d.ts +11 -0
- package/dist/configurator/ui/configurator-layout/sidebar-keys/sidebar-keys.js +1 -0
- package/dist/configurator/ui/configurator-layout/slots/desktop-sidebar/DesktopSidebar.d.ts +101 -0
- package/dist/configurator/ui/configurator-layout/slots/desktop-sidebar/DesktopSidebar.js +16 -0
- package/dist/configurator/ui/configurator-layout/slots/desktop-sidebar/index.d.ts +1 -0
- package/dist/configurator/ui/configurator-layout/slots/desktop-sidebar/index.js +1 -0
- package/dist/configurator/ui/configurator-layout/slots/mobile-tabs/use-mobile-tabs.d.ts +1 -1
- package/dist/configurator/ui/configurator-layout/slots/mobile-tabs/use-mobile-tabs.js +1 -1
- package/dist/configurator/ui/configurator-layout/slots/services/InvariantViolations.d.ts +4 -4
- package/dist/configurator/ui/configurator-layout/slots/services/InvariantViolations.js +1 -1
- package/dist/configurator/ui/configurator-layout/slots/services/Services.js +1 -1
- package/dist/configurator/ui/configurator-layout/slots/services/SideEffects.d.ts +3 -6
- package/dist/configurator/ui/configurator-layout/slots/services/SideEffects.js +1 -1
- package/dist/configurator/ui/configurator-layout/slots/sidebar-tabs/use-sidebar-tabs.d.ts +1 -1
- package/dist/configurator/ui/configurator-layout/slots/sidebar-tabs/use-sidebar-tabs.js +1 -1
- package/dist/configurator/ui/configurator-layout/slots/slots.d.ts +1 -0
- package/dist/configurator/ui/configurator-layout/slots/slots.js +1 -1
- package/dist/configurator/ui/configurator-layout/universal/DesktopLayout.d.ts +0 -74
- package/dist/configurator/ui/configurator-layout/universal/DesktopLayout.js +5 -20
- package/dist/configurator/ui/configurator-layout/universal/DesktopPreview.js +1 -1
- package/dist/configurator/ui/configurator-layout/universal/MobileLayout.js +4 -4
- package/dist/configurator/ui/configurator-layout/universal/MobilePreview.js +1 -1
- package/dist/configurator/ui/configurator-layout/universal/use-layout-scene-safe-area.d.ts +47 -0
- package/dist/configurator/ui/configurator-layout/universal/use-layout-scene-safe-area.js +1 -0
- package/dist/configurator/ui/configurator-layout/universal/use-scene-safe-area.d.ts +11 -26
- package/dist/configurator/ui/configurator-layout/universal/use-scene-safe-area.js +1 -1
- package/dist/configurator/ui/legacy/layout/common/CommonFinalizeButton.js +1 -1
- package/dist/configurator/ui/legacy/layout/common/CommonSummaryButton.js +1 -1
- package/dist/configurator/ui/legacy/layout/common/CommonTopNavigation.js +1 -1
- package/dist/configurator/ui/legacy/layout/common/ResponsiveFinalizeButton.js +1 -1
- package/dist/configurator/ui/legacy/layout/common/SummaryReadLayout.js +1 -1
- package/dist/configurator/ui/legacy/layout/simple/SimpleOwnerLayout.js +1 -1
- package/dist/configurator/ui/legacy/layout/simple/SimpleTopNavigation.js +1 -1
- package/dist/configurator/ui/legacy/layout/steps/StepsNavigation.d.ts +2 -2
- package/dist/configurator/ui/legacy/layout/steps/StepsNavigation.js +1 -1
- package/dist/configurator/ui/legacy/layout/steps/StepsOwnerLayout.js +1 -1
- package/dist/configurator/ui/legacy/layout/steps/StepsSidebarFooter.js +1 -1
- package/dist/configurator/ui/legacy/layout/tabs/TabsOwnerLayout.js +1 -1
- package/dist/configurator/ui/legacy/toolbar/common/DimensionUnitSelector.js +1 -1
- package/dist/configurator/ui/legacy/toolbar/common/MeasurementsIndicatorsSwitch.js +1 -1
- package/dist/configurator/ui/legacy/toolbar/desktop-toolbar/FullscreenToolbarAction.js +1 -1
- package/dist/configurator/ui/legacy/toolbar/desktop-toolbar/HelpToolbarAction.js +1 -1
- package/dist/configurator/ui/legacy/toolbar/desktop-toolbar/MeasurementsToolbarAction.js +1 -1
- package/dist/configurator/ui/legacy/toolbar/desktop-toolbar/UndoRedoToolbarGroup.js +1 -1
- package/dist/configurator/ui/phoenix-layout-elements/AppLoader.js +3 -3
- package/dist/configurator/ui/phoenix-layout-elements/EnterFullscreenToolbarButton.js +1 -1
- package/dist/configurator/ui/phoenix-layout-elements/ExitFullscreenToolbarButton.js +1 -1
- package/dist/configurator/ui/phoenix-layout-elements/HelpToolbarButton.js +1 -1
- package/dist/configurator/ui/phoenix-layout-elements/LayoutCustomOwnerUi.d.ts +1 -0
- package/dist/configurator/ui/phoenix-layout-elements/LayoutCustomOwnerUi.js +1 -1
- package/dist/configurator/ui/phoenix-layout-elements/LayoutCustomReadUi.d.ts +1 -0
- package/dist/configurator/ui/phoenix-layout-elements/LayoutCustomReadUi.js +1 -1
- package/dist/configurator/ui/phoenix-layout-elements/MeasurementsToolbarButton.js +1 -1
- package/dist/configurator/ui/phoenix-layout-elements/RedoToolbarButton.js +1 -1
- package/dist/configurator/ui/phoenix-layout-elements/UndoToolbarButton.js +1 -1
- package/dist/configurator/ui/phoenix-layout-elements/header/common/back-button/use-go-back-action.js +1 -1
- package/dist/configurator/ui/phoenix-layout-elements/header/common/horizontal-tabs/DesktopHorizontalTabs.js +1 -1
- package/dist/configurator/ui/phoenix-layout-elements/header/common/step-navigation/DesktopNavigationSteps.d.ts +1 -1
- package/dist/configurator/ui/phoenix-layout-elements/header/common/step-navigation/DesktopNavigationSteps.js +1 -1
- package/dist/configurator/ui/phoenix-layout-elements/header/common/step-navigation/StepsNavigation.d.ts +2 -8
- package/dist/configurator/ui/phoenix-layout-elements/header/common/step-navigation/StepsNavigation.js +1 -1
- package/dist/configurator/ui/phoenix-layout-elements/measurements/DimensionUnitSelector.js +1 -1
- package/dist/configurator/ui/phoenix-layout-elements/measurements/MeasurementsIndicatorsSwitch.js +1 -1
- package/dist/configurator/ui/phoenix-layout-elements/sidebar-footer/basic/BasicFinalizeButton.js +1 -1
- package/dist/configurator/ui/phoenix-layout-elements/sidebar-footer/common/CustomFinalizeButton.js +1 -1
- package/dist/configurator/ui/phoenix-layout-elements/sidebar-footer/common/EnterSummaryButton.js +1 -1
- package/dist/configurator/ui/phoenix-layout-elements/sidebar-footer/common/FinalizeActions.js +1 -1
- package/dist/configurator/ui/phoenix-layout-elements/sidebar-footer/common/NextStepButton.js +1 -1
- package/dist/configurator/ui/phoenix-layout-elements/sidebar-footer/common/PreviousStepButton.js +1 -1
- package/dist/configurator/ui/preset-layout/CategoryPresetUi.js +1 -1
- package/dist/configurator/ui/preset-layout/PresetUi.d.ts +4 -0
- package/dist/configurator/ui/preset-layout/PresetUi.js +1 -1
- package/dist/configurator/ui/save-message-snackbars/SaveMessageSnackbars.d.ts +10 -0
- package/dist/configurator/ui/save-message-snackbars/SaveMessageSnackbars.js +1 -0
- package/dist/configurator/ui/save-message-snackbars/index.d.ts +1 -0
- package/dist/configurator/ui/save-message-snackbars/index.js +1 -0
- package/dist/docs/complex-use-cases/filtered-controls-with-fix-dialog.mdx +100 -117
- package/dist/docs/complex-use-cases/navigation-reset-selection.mdx +18 -12
- package/dist/docs/complex-use-cases/sketching.mdx +0 -38
- package/dist/docs/controls/select-attribute/cardselect.mdx +9 -13
- package/dist/docs/controls/select-child-entity/cardselect.mdx +1 -0
- package/dist/docs/dimensions/3d-scene-integration/dimension-indicators.mdx +2 -2
- package/dist/docs/dimensions/3d-scene-integration/editable-angle-indicator.mdx +1 -1
- package/dist/docs/dimensions/3d-scene-integration/editable-distance-dimension-indicator.mdx +1 -1
- package/dist/docs/dimensions/3d-scene-integration/list-selector-dimension-indicator.mdx +1 -1
- package/dist/docs/drag-and-drop/drag-handle.mdx +1 -1
- package/dist/docs/drag-and-drop/hotspot-handle.mdx +1 -1
- package/dist/docs/drag-and-drop/planes.mdx +1 -1
- package/dist/docs/drag-and-drop/rotatable.mdx +2 -2
- package/dist/docs/fabs/basic.mdx +2 -2
- package/dist/docs/index.json +42 -1
- package/dist/docs/integrations/woocommerce/local-development.mdx +1 -1
- package/dist/docs/layouts/custom-layout.mdx +2435 -0
- package/dist/docs/layouts/custom-price.mdx +14 -16
- package/dist/docs/layouts/header/fixed.mdx +2 -2
- package/dist/docs/layouts/header/floating.mdx +2 -2
- package/dist/docs/layouts/sidebar/in-a-custom-layout.mdx +380 -0
- package/dist/docs/layouts/sidebar/tabs.mdx +24 -21
- package/dist/docs/layouts/sidebar-footer/basic.mdx +32 -77
- package/dist/docs/other-features/client-side-rendering/declarative.mdx +1 -1
- package/dist/docs/other-features/domain-actions.mdx +1 -1
- package/dist/docs/other-features/not-found-404.mdx +1 -1
- package/dist/docs/other-features/side-effects.mdx +58 -48
- package/dist/docs/other-features/transformers.mdx +5 -1
- package/dist/docs/other-features/violation-messages.mdx +52 -56
- package/dist/docs/phoenix/admin.mdx +9 -24
- package/dist/docs/phoenix/application-states.mdx +9 -7
- package/dist/docs/phoenix/clerk-sign-in.mdx +1 -1
- package/dist/docs/phoenix/components.mdx +6 -0
- package/dist/docs/phoenix/configurator-interface.mdx +301 -81
- package/dist/docs/phoenix/deployments.mdx +3 -7
- package/dist/docs/phoenix/domain-model.mdx +6 -0
- package/dist/docs/phoenix/expression-context.mdx +11 -3
- package/dist/docs/phoenix/finalization.mdx +1 -1
- package/dist/docs/phoenix/getting-started.mdx +7 -4
- package/dist/docs/phoenix/layout-slots.mdx +116 -0
- package/dist/docs/phoenix/localization.mdx +13 -28
- package/dist/docs/phoenix/migration-guide.mdx +24 -11
- package/dist/docs/phoenix/phoenix-cli.mdx +192 -66
- package/dist/docs/phoenix/project-structure.mdx +86 -35
- package/dist/docs/phoenix/quickstart.mdx +9 -9
- package/dist/docs/phoenix/sdk-builder-workflow.mdx +18 -17
- package/dist/docs/phoenix/testing.mdx +148 -0
- package/dist/docs/phoenix/webhook-membership.mdx +10 -9
- package/dist/docs/phoenix/webhooks.mdx +23 -6
- package/dist/docs/recipes-and-delete/recipe-hierarchy-selection.mdx +15 -13
- package/dist/docs/relations/hierarchy.mdx +13 -2
- package/dist/docs/ux-guidelines/choosing-a-control.mdx +11 -0
- package/dist/domain/admin-domain/__generated/enhanced-model.d.ts +1 -2
- package/dist/domain/admin-domain/__generated/model/versions/v1.d.ts +1 -1
- package/dist/domain/admin-domain/__generated/model/versions/v2.d.ts +1 -1
- package/dist/domain/admin-domain/__generated/model/versions/v3.d.ts +1 -1
- package/dist/domain/admin-domain/__generated/model/versions/v4.d.ts +1 -1
- package/dist/domain/admin-domain/__generated/model/versions/v5.d.ts +1 -1
- package/dist/domain/admin-domain/__generated/model/versions/v6.d.ts +2 -2
- package/dist/domain/admin-domain/__generated/model/versions/v6.js +1 -1
- package/dist/domain/admin-domain/implementation/common-admin-expressions.d.ts +26 -14
- package/dist/domain/admin-domain/implementation/common-admin-migrations.d.ts +1 -1
- package/dist/domain/admin-domain/implementation/common-admin-publish.d.ts +1 -2
- package/dist/domain/admin-domain/index.d.ts +9 -5
- package/dist/domain/admin-domain/index.js +1 -1
- package/dist/domain/application/GetApplicationWrapperHandler.d.ts +2 -2
- package/dist/domain/application/GetThemeHandler.d.ts +1 -1
- package/dist/domain/application/GetWebComponentOptions.d.ts +1 -1
- package/dist/domain/application/admin-page-factories.d.ts +1 -2
- package/dist/domain/application/application-config.d.ts +30 -97
- package/dist/domain/application/assistant/assistant-fields.d.ts +12 -0
- package/dist/domain/application/assistant/assistant-fields.js +1 -0
- package/dist/domain/application/assistant/assistant-form-elements.d.ts +28 -0
- package/dist/domain/application/assistant/assistant-form-elements.js +1 -0
- package/dist/domain/application/assistant/assistant-manifest.d.ts +71 -0
- package/dist/domain/application/assistant/assistant-manifest.js +1 -0
- package/dist/domain/application/assistant/assistant-resolved-manifest.d.ts +131 -0
- package/dist/domain/application/assistant/assistant-resolved-manifest.js +1 -0
- package/dist/domain/application/assistant/assistant-value-type.d.ts +9 -0
- package/dist/domain/application/assistant/assistant-value-type.js +1 -0
- package/dist/domain/application/assistant/build-assistant-lenses.d.ts +14 -0
- package/dist/domain/application/assistant/build-assistant-lenses.js +5 -0
- package/dist/domain/application/assistant/build-assistant-manifest.d.ts +4 -0
- package/dist/domain/application/assistant/build-assistant-manifest.js +1 -0
- package/dist/domain/application/assistant/create-assistant-execution-schema.d.ts +32 -0
- package/dist/domain/application/assistant/create-assistant-execution-schema.js +1 -0
- package/dist/domain/application/assistant/generate-assistant-prompt.d.ts +3 -0
- package/dist/domain/application/assistant/generate-assistant-prompt.js +1 -0
- package/dist/domain/application/assistant/index.d.ts +11 -0
- package/dist/domain/application/assistant/index.js +1 -0
- package/dist/domain/application/assistant/session-setup/AssistantSetupHandler.d.ts +20 -0
- package/dist/domain/application/assistant/session-setup/AssistantSetupHandler.js +1 -0
- package/dist/domain/application/assistant/session-setup/apply-assistant-setup.d.ts +10 -0
- package/dist/domain/application/assistant/session-setup/apply-assistant-setup.js +1 -0
- package/dist/domain/application/assistant/session-setup/assistant-setup-manifest.d.ts +48 -0
- package/dist/domain/application/assistant/session-setup/assistant-setup-manifest.js +1 -0
- package/dist/domain/application/assistant/session-setup/create-session-assistant.d.ts +15 -0
- package/dist/domain/application/assistant/session-setup/create-session-assistant.js +1 -0
- package/dist/domain/application/assistant/session-setup/index.d.ts +4 -0
- package/dist/domain/application/assistant/session-setup/index.js +1 -0
- package/dist/domain/application/assistant-field-options.d.ts +2 -3
- package/dist/domain/application/assistant-mutations.d.ts +3 -5
- package/dist/domain/application/assistant-mutations.js +1 -1
- package/dist/domain/application/assistant-recipe-groups.d.ts +6 -8
- package/dist/domain/application/configurator-builder.d.ts +36 -18
- package/dist/domain/application/configurator-builder.js +1 -1
- package/dist/domain/application/create-initial-published-data.d.ts +6 -7
- package/dist/domain/application/index.d.ts +3 -6
- package/dist/domain/application/index.js +1 -1
- package/dist/domain/application/published-data/DataRowValidatorHandler.d.ts +1 -1
- package/dist/domain/application/published-data/FilterPublishedChunksHandler.d.ts +1 -1
- package/dist/domain/application/published-data/MapPublishedChunkedDataHandler.d.ts +1 -1
- package/dist/domain/application/published-data/MapPublishedRevisionDataHandler.d.ts +1 -1
- package/dist/domain/application/published-data/SheetValidatorHandler.d.ts +1 -1
- package/dist/domain/application/published-data/build-legend-data.d.ts +1 -1
- package/dist/domain/application/published-data/create-finalize-admin-domain.d.ts +1 -2
- package/dist/domain/application/published-data/format-field-type.d.ts +1 -1
- package/dist/domain/application/published-data/map-data-to-sheet.d.ts +1 -1
- package/dist/domain/application/published-data/map-published-chunked-data.d.ts +3 -3
- package/dist/domain/application/published-data/map-published-data.d.ts +7 -4
- package/dist/domain/application/published-data/validate-sheet-data.d.ts +1 -1
- package/dist/domain/available-system-components.js +1 -1
- package/dist/domain/core/action/action-factory.d.ts +11 -0
- package/dist/domain/core/action/action.d.ts +71 -0
- package/dist/domain/core/action/action.js +1 -0
- package/dist/domain/core/action/index.d.ts +2 -0
- package/dist/domain/core/action/index.js +1 -0
- package/dist/domain/core/component/component-reader-types.d.ts +43 -0
- package/dist/domain/core/component/component-reader-types.js +1 -0
- package/dist/domain/core/component/debug-state-component.d.ts +14 -0
- package/dist/domain/core/component/debug-state-component.js +1 -0
- package/dist/domain/core/component/domain-component-optic.d.ts +65 -0
- package/dist/domain/core/component/domain-component-optic.js +16 -0
- package/dist/domain/core/component/drag-state-component.d.ts +16 -0
- package/dist/domain/core/component/drag-state-component.js +1 -0
- package/dist/domain/core/component/export-state-component.d.ts +15 -0
- package/dist/domain/core/component/export-state-component.js +1 -0
- package/dist/domain/core/component/fullscreen-state-component.d.ts +14 -0
- package/dist/domain/core/component/fullscreen-state-component.js +1 -0
- package/dist/domain/core/component/group-components-by-entity-id-and-name.d.ts +8 -0
- package/dist/domain/core/component/group-components-by-entity-id-and-name.js +1 -0
- package/dist/domain/core/component/hover-state-component.d.ts +14 -0
- package/dist/domain/core/component/hover-state-component.js +1 -0
- package/dist/domain/core/component/index.d.ts +18 -0
- package/dist/domain/core/component/index.js +1 -0
- package/dist/domain/core/component/legacy-filter.d.ts +498 -0
- package/dist/domain/core/component/navigation-state-component.d.ts +15 -0
- package/dist/domain/core/component/navigation-state-component.js +1 -0
- package/dist/domain/core/component/selection-state-component.d.ts +14 -0
- package/dist/domain/core/component/selection-state-component.js +1 -0
- package/dist/domain/core/component/system-component-builder.d.ts +11 -0
- package/dist/domain/core/component/system-component-builder.js +1 -0
- package/dist/domain/core/component/system-component-filter.d.ts +811 -0
- package/dist/domain/core/component/system-virtual-entity.js +1 -0
- package/dist/domain/core/component/tool-state-component.d.ts +14 -0
- package/dist/domain/core/component/tool-state-component.js +1 -0
- package/dist/domain/core/component/updates.d.ts +123 -0
- package/dist/domain/core/component/view-state-component.d.ts +14 -0
- package/dist/domain/core/component/view-state-component.js +1 -0
- package/dist/domain/core/component/viewport-state-component.d.ts +29 -0
- package/dist/domain/core/component/viewport-state-component.js +1 -0
- package/dist/domain/core/data-schema/data-cell-value.d.ts +4 -0
- package/dist/domain/core/data-schema/data-cell-value.js +1 -0
- package/dist/domain/core/data-schema/data-schema-array-field.d.ts +5 -0
- package/dist/domain/core/data-schema/data-schema-array-field.js +1 -0
- package/dist/domain/core/data-schema/data-schema-field-object.d.ts +4 -0
- package/dist/domain/core/data-schema/data-schema-field-object.js +1 -0
- package/dist/domain/core/data-schema/data-schema-field.d.ts +2 -0
- package/dist/domain/core/data-schema/data-schema-field.js +1 -0
- package/dist/domain/core/data-schema/data-schema-localized-field.d.ts +4 -0
- package/dist/domain/core/data-schema/data-schema-localized-field.js +1 -0
- package/dist/domain/core/data-schema/data-schema-primitive-field.d.ts +5 -0
- package/dist/domain/core/data-schema/data-schema-primitive-field.js +1 -0
- package/dist/domain/core/data-schema/data-schema.d.ts +2 -0
- package/dist/domain/core/data-schema/data-schema.js +1 -0
- package/dist/domain/core/data-schema/index.d.ts +7 -0
- package/dist/domain/core/data-schema/index.js +1 -0
- package/dist/domain/core/decoder/create-decoder.d.ts +6 -0
- package/dist/domain/core/decoder/create-decoder.js +1 -0
- package/dist/domain/core/decoder/decoder.d.ts +6 -0
- package/dist/domain/core/decoder/decoder.js +1 -0
- package/dist/domain/core/decoder/index.d.ts +2 -0
- package/dist/domain/core/decoder/index.js +1 -0
- package/dist/domain/core/domain-factory.d.ts +4 -5
- package/dist/domain/core/domain-factory.js +1 -1
- package/dist/domain/core/domain.d.ts +4 -5
- package/dist/domain/core/domain.js +1 -1
- package/dist/domain/core/emission/index.d.ts +8 -0
- package/dist/domain/core/emission/index.js +1 -0
- package/dist/domain/core/emission/reset-state-emission.d.ts +12 -0
- package/dist/domain/core/emission/reset-state-emission.js +1 -0
- package/dist/domain/core/emission/state-emission.d.ts +4 -0
- package/dist/domain/core/emission/state-emission.js +1 -0
- package/dist/domain/core/emission/state-update-emission.d.ts +14 -0
- package/dist/domain/core/emission/state-update-emission.js +1 -0
- package/dist/domain/core/emission/state-validation-result.d.ts +18 -0
- package/dist/domain/core/emission/state-validation-result.js +1 -0
- package/dist/domain/core/emission/transformation-log.d.ts +2 -0
- package/dist/domain/core/emission/transformation-log.js +1 -0
- package/dist/domain/core/emission/transformer-log-entry.d.ts +6 -0
- package/dist/domain/core/emission/transformer-log-entry.js +1 -0
- package/dist/domain/core/emission/transformer-log.d.ts +11 -0
- package/dist/domain/core/emission/transformer-log.js +1 -0
- package/dist/domain/core/emission/transformer-phase.d.ts +1 -0
- package/dist/domain/core/emission/transformer-phase.js +1 -0
- package/dist/domain/core/expression/aliased-expressions.d.ts +10 -0
- package/dist/domain/core/expression/aliased-expressions.js +1 -0
- package/dist/domain/core/expression/constant-expressions.d.ts +16 -0
- package/dist/domain/core/expression/constant-expressions.js +1 -0
- package/dist/domain/core/expression/custom-expression.d.ts +25 -0
- package/dist/domain/core/expression/custom-expression.js +1 -0
- package/dist/domain/core/expression/expression.d.ts +46 -0
- package/dist/domain/core/expression/expression.js +1 -0
- package/dist/domain/core/expression/index.d.ts +4 -0
- package/dist/domain/core/expression/index.js +1 -0
- package/dist/domain/core/index.d.ts +13 -17
- package/dist/domain/core/index.js +1 -1
- package/dist/domain/core/invariant/builtin-invariant.d.ts +5 -0
- package/dist/domain/core/invariant/custom-invariants.d.ts +13 -0
- package/dist/domain/core/invariant/custom-invariants.js +1 -0
- package/dist/domain/core/invariant/index.d.ts +5 -0
- package/dist/domain/core/invariant/index.js +1 -0
- package/dist/domain/core/invariant/invariants.d.ts +10 -0
- package/dist/domain/core/invariant/invariants.js +1 -0
- package/dist/domain/core/invariant/violation-component.js +1 -0
- package/dist/domain/core/invariant/violation.d.ts +133 -0
- package/dist/domain/core/invariant/violation.js +1 -0
- package/dist/domain/core/model/component.d.ts +46 -0
- package/dist/domain/core/model/index.d.ts +6 -0
- package/dist/domain/core/model/index.js +1 -0
- package/dist/domain/core/model/model.d.ts +127 -0
- package/dist/domain/core/model/reflection.d.ts +114 -0
- package/dist/domain/core/model/reflection.js +1 -0
- package/dist/domain/core/recipe/index.d.ts +1 -0
- package/dist/domain/core/recipe/index.js +1 -0
- package/dist/domain/core/recipe/recipes.d.ts +23 -0
- package/dist/domain/core/recipe/recipes.js +1 -0
- package/dist/domain/core/relation/all-of-type-relation.d.ts +19 -0
- package/dist/domain/core/relation/all-of-type-relation.js +1 -0
- package/dist/domain/core/relation/component-factories.d.ts +14 -0
- package/dist/domain/core/relation/component-factories.js +1 -0
- package/dist/domain/core/relation/composed-of.d.ts +12 -0
- package/dist/domain/core/relation/composed-of.js +1 -0
- package/dist/domain/core/relation/direct-relation.d.ts +17 -0
- package/dist/domain/core/relation/index.d.ts +8 -0
- package/dist/domain/core/relation/index.js +1 -0
- package/dist/domain/core/relation/indirect-relation.d.ts +25 -0
- package/dist/domain/core/relation/indirect-relation.js +1 -0
- package/dist/domain/core/relation/reference-component.d.ts +17 -0
- package/dist/domain/core/relation/reference-component.js +1 -0
- package/dist/domain/core/relation/reference-field.d.ts +7 -0
- package/dist/domain/core/relation/reference-field.js +1 -0
- package/dist/domain/core/relation/relation-factory.d.ts +22 -0
- package/dist/domain/core/relation/relation-factory.js +1 -0
- package/dist/domain/core/schema/enhanced-json-schema.js +1 -0
- package/dist/domain/core/schema/extended-schema-validator.js +1 -0
- package/dist/domain/core/schema/index.d.ts +3 -0
- package/dist/domain/core/schema/index.js +1 -0
- package/dist/domain/core/schema/schema-validator.js +1 -0
- package/dist/domain/core/state/id-sequence.d.ts +15 -0
- package/dist/domain/core/state/id-sequence.js +1 -0
- package/dist/domain/core/state/index.d.ts +3 -0
- package/dist/domain/core/state/index.js +1 -0
- package/dist/domain/core/state/migrations.d.ts +67 -0
- package/dist/domain/core/state/migrations.js +1 -0
- package/dist/domain/core/state/state.d.ts +9 -0
- package/dist/domain/domain-builder.d.ts +11 -11
- package/dist/domain/domain-builder.js +1 -1
- package/dist/domain/domain-context/action-system/action-system.d.ts +2 -4
- package/dist/domain/domain-context/action-system/action-system.js +1 -1
- package/dist/domain/domain-context/action-system/index.d.ts +1 -0
- package/dist/domain/domain-context/action-system/index.js +1 -0
- package/dist/domain/domain-context/analytics-system/index.d.ts +2 -0
- package/dist/domain/domain-context/analytics-system/index.js +1 -0
- package/dist/domain/domain-context/create-transformer.d.ts +2 -2
- package/dist/domain/domain-context/dimension-system/dimension-state.js +1 -1
- package/dist/domain/domain-context/dimension-system/dimension-system.d.ts +3 -4
- package/dist/domain/domain-context/dimension-system/dimension-system.js +1 -1
- package/dist/domain/domain-context/dimension-system/index.d.ts +1 -0
- package/dist/domain/domain-context/dimension-system/index.js +1 -0
- package/dist/domain/domain-context/domain-context-systems.d.ts +8 -10
- package/dist/domain/domain-context/index.d.ts +8 -18
- package/dist/domain/domain-context/index.js +1 -1
- package/dist/domain/domain-context/navigation-system/index.d.ts +3 -0
- package/dist/domain/domain-context/navigation-system/index.js +1 -0
- package/dist/domain/domain-context/navigation-system/navigation-system.d.ts +5 -8
- package/dist/domain/domain-context/navigation-system/navigation-system.js +1 -1
- package/dist/domain/domain-context/navigation-system/navigation-updates.d.ts +1 -12
- package/dist/domain/domain-context/navigation-system/navigation-updates.js +1 -1
- package/dist/domain/domain-context/navigation-system/selection-transformers.d.ts +2 -2
- package/dist/domain/domain-context/navigation-system/selection-transformers.js +1 -1
- package/dist/domain/domain-context/recipe-system/index.d.ts +1 -0
- package/dist/domain/domain-context/recipe-system/index.js +1 -0
- package/dist/domain/domain-context/recipe-system/recipe-cooker-system.d.ts +2 -4
- package/dist/domain/domain-context/recipe-system/recipe-cooker-system.js +1 -1
- package/dist/domain/domain-context/relation-transformers/cascade-deletes.d.ts +3 -3
- package/dist/domain/domain-context/relation-transformers/cascade-deletes.js +1 -1
- package/dist/domain/domain-context/relation-transformers/cascade-ref-pruning.d.ts +3 -3
- package/dist/domain/domain-context/relation-transformers/cascade-ref-pruning.js +1 -1
- package/dist/domain/domain-context/relation-transformers/create-entity-refs.d.ts +3 -3
- package/dist/domain/domain-context/relation-transformers/create-entity-refs.js +2 -2
- package/dist/domain/domain-context/relation-transformers/index.d.ts +4 -0
- package/dist/domain/domain-context/relation-transformers/index.js +1 -0
- package/dist/domain/domain-context/relation-transformers/replace-refs.d.ts +3 -3
- package/dist/domain/domain-context/relation-transformers/replace-refs.js +1 -1
- package/dist/domain/domain-context/store-system/apply-updates.d.ts +1 -3
- package/dist/domain/domain-context/store-system/apply-updates.js +1 -1
- package/dist/domain/domain-context/store-system/index.d.ts +4 -0
- package/dist/domain/domain-context/store-system/index.js +1 -0
- package/dist/domain/domain-context/store-system/next-domain-entity-id.d.ts +1 -13
- package/dist/domain/domain-context/store-system/next-domain-entity-id.js +1 -1
- package/dist/domain/domain-context/store-system/reconcile-projected-entities.d.ts +1 -2
- package/dist/domain/domain-context/store-system/reconcile-projected-entities.js +1 -1
- package/dist/domain/domain-context/store-system/store-system.d.ts +2 -39
- package/dist/domain/domain-context/store-system/store-system.js +2 -2
- package/dist/domain/domain-context/store-system/system-state.d.ts +2 -4
- package/dist/domain/domain-context/store-system/system-state.js +1 -1
- package/dist/domain/domain-context/transformers/actions-builder.d.ts +1 -2
- package/dist/domain/domain-context/transformers/actions-builder.js +1 -1
- package/dist/domain/domain-context/transformers/auto-snap-transformer.d.ts +6 -10
- package/dist/domain/domain-context/transformers/auto-snap-transformer.js +1 -1
- package/dist/domain/domain-context/transformers/chain-builder.d.ts +3 -3
- package/dist/domain/domain-context/transformers/context.d.ts +2 -7
- package/dist/domain/domain-context/transformers/context.js +1 -1
- package/dist/domain/domain-context/transformers/entity-builder.d.ts +1 -5
- package/dist/domain/domain-context/transformers/entity-builder.js +1 -1
- package/dist/domain/domain-context/transformers/index.d.ts +1 -1
- package/dist/domain/domain-context/transformers/index.js +1 -1
- package/dist/domain/domain-context/transformers/then-builder.d.ts +1 -2
- package/dist/domain/domain-context/transformers/then-builder.js +1 -1
- package/dist/domain/domain-context/transformers/when-builder.d.ts +3 -9
- package/dist/domain/domain-context/transformers/when-builder.js +1 -1
- package/dist/domain/domain-context/undo-system.d.ts +29 -3
- package/dist/domain/domain-context/undo-system.js +1 -1
- package/dist/domain/domain-runtime/access/selectors.d.ts +9 -0
- package/dist/domain/domain-runtime/access/selectors.js +1 -1
- package/dist/domain/domain-runtime/access/types.d.ts +2 -0
- package/dist/domain/domain-runtime/access/types.js +1 -1
- package/dist/domain/domain-runtime/domain-context/action-context.d.ts +11 -0
- package/dist/domain/domain-runtime/domain-context/action-context.js +1 -0
- package/dist/domain/domain-runtime/domain-context/component-reader.d.ts +1 -4
- package/dist/domain/domain-runtime/domain-context/component-reader.js +1 -1
- package/dist/domain/domain-runtime/domain-context/domain-context.js +1 -1
- package/dist/domain/domain-runtime/domain-context/expression-context.d.ts +8 -0
- package/dist/domain/domain-runtime/domain-context/expression-context.js +1 -0
- package/dist/domain/domain-runtime/domain-context/index.d.ts +3 -0
- package/dist/domain/domain-runtime/domain-context/runtime-expression-context.d.ts +18 -0
- package/dist/domain/domain-runtime/domain-context/runtime-expression-context.js +1 -0
- package/dist/domain/domain-runtime/domain-context/selectors.d.ts +19 -25
- package/dist/domain/domain-runtime/domain-context/selectors.js +1 -1
- package/dist/domain/domain-runtime/domain-context/types.d.ts +4 -1
- package/dist/domain/domain-runtime/domain-runtime.d.ts +88 -72
- package/dist/domain/domain-runtime/errors/implementation-error-collector.d.ts +19 -0
- package/dist/domain/domain-runtime/errors/implementation-error-collector.js +1 -0
- package/dist/domain/domain-runtime/errors/implementation-error.d.ts +46 -0
- package/dist/domain/domain-runtime/errors/implementation-error.js +1 -0
- package/dist/domain/domain-runtime/errors/implementation-errors.d.ts +13 -0
- package/dist/domain/domain-runtime/errors/implementation-errors.js +1 -0
- package/dist/domain/domain-runtime/errors/index.d.ts +4 -0
- package/dist/domain/domain-runtime/errors/index.js +1 -0
- package/dist/domain/domain-runtime/errors/to-implementation-errors.d.ts +10 -0
- package/dist/domain/domain-runtime/errors/to-implementation-errors.js +1 -0
- package/dist/domain/domain-runtime/index.d.ts +1 -0
- package/dist/domain/domain-runtime/index.js +1 -1
- package/dist/domain/domain-runtime/spec/create-violation-expressions.d.ts +24 -0
- package/dist/domain/domain-runtime/spec/create-violation-expressions.js +1 -0
- package/dist/domain/domain-runtime/spec/index.d.ts +5 -0
- package/dist/domain/domain-runtime/spec/index.js +1 -1
- package/dist/domain/domain-runtime/spec/initialize.d.ts +11 -0
- package/dist/domain/domain-runtime/spec/initialize.js +1 -1
- package/dist/domain/domain-runtime/spec/memoize-expression.d.ts +16 -0
- package/dist/domain/domain-runtime/spec/module-checks/element-registration.d.ts +111 -0
- package/dist/domain/domain-runtime/spec/module-checks/element-registration.js +1 -0
- package/dist/domain/domain-runtime/spec/module-checks/handler-registration.d.ts +34 -0
- package/dist/domain/domain-runtime/spec/module-checks/handler-registration.js +1 -0
- package/dist/domain/domain-runtime/spec/module-checks/index.d.ts +8 -0
- package/dist/domain/domain-runtime/spec/module-checks/index.js +1 -0
- package/dist/domain/domain-runtime/spec/module-checks/project-modules.d.ts +32 -0
- package/dist/domain/domain-runtime/spec/module-checks/project-modules.js +1 -0
- package/dist/domain/domain-runtime/spec/module-checks/resolve-action-modules.d.ts +4 -0
- package/dist/domain/domain-runtime/spec/module-checks/resolve-action-modules.js +1 -0
- package/dist/domain/domain-runtime/spec/module-checks/resolve-component-optic-modules.d.ts +4 -0
- package/dist/domain/domain-runtime/spec/module-checks/resolve-component-optic-modules.js +1 -0
- package/dist/domain/domain-runtime/spec/module-checks/resolve-expression-modules.d.ts +15 -0
- package/dist/domain/domain-runtime/spec/module-checks/resolve-expression-modules.js +1 -0
- package/dist/domain/domain-runtime/spec/module-checks/resolve-imported-transformers.d.ts +22 -0
- package/dist/domain/domain-runtime/spec/module-checks/resolve-imported-transformers.js +1 -0
- package/dist/domain/domain-runtime/spec/module-checks/resolve-invariant-modules.d.ts +6 -0
- package/dist/domain/domain-runtime/spec/module-checks/resolve-invariant-modules.js +1 -0
- package/dist/domain/domain-runtime/spec/prepare-action-implementations.d.ts +15 -0
- package/dist/domain/domain-runtime/spec/prepare-action-implementations.js +5 -0
- package/dist/domain/domain-runtime/spec/prepare-domain-expressions.d.ts +16 -0
- package/dist/domain/domain-runtime/spec/selectors.d.ts +7 -8
- package/dist/domain/domain-runtime/spec/selectors.js +1 -1
- package/dist/domain/domain-runtime/spec/types.d.ts +8 -6
- package/dist/domain/extensions/angle-indicator.d.ts +21 -0
- package/dist/domain/extensions/angle-indicator.js +1 -0
- package/dist/domain/extensions/attribute-switch.d.ts +8 -0
- package/dist/domain/extensions/attribute-switch.js +1 -0
- package/dist/domain/extensions/autorotate-camera-component.d.ts +19 -0
- package/dist/domain/extensions/autorotate-camera-component.js +1 -0
- package/dist/domain/extensions/basic-sidebar-footer.d.ts +8 -0
- package/dist/domain/extensions/basic-sidebar-footer.js +1 -0
- package/dist/domain/extensions/camera-based-hidden-entity-object.js +1 -0
- package/dist/domain/extensions/camera-based-hidden-entity.js +1 -0
- package/dist/domain/extensions/canvas-config.d.ts +87 -0
- package/dist/domain/extensions/canvas-config.js +1 -0
- package/dist/domain/extensions/canvas-custom-environment.js +1 -0
- package/dist/domain/extensions/canvas-padding.d.ts +25 -0
- package/dist/domain/extensions/canvas-padding.js +1 -0
- package/dist/domain/extensions/canvas-preset-environment.d.ts +37 -0
- package/dist/domain/extensions/canvas-preset-environment.js +1 -0
- package/dist/domain/extensions/child-entity-recipe-hierarchy.d.ts +21 -0
- package/dist/domain/extensions/child-entity-recipe-hierarchy.js +1 -0
- package/dist/domain/extensions/client-side-image.d.ts +14 -0
- package/dist/domain/extensions/client-side-image.js +1 -0
- package/dist/domain/extensions/color-value.js +1 -0
- package/dist/domain/extensions/common/angle-indicator-schema.d.ts +292 -0
- package/dist/domain/extensions/common/angle-indicator-schema.js +1 -0
- package/dist/domain/extensions/common/dimension-indicator-schema.d.ts +607 -0
- package/dist/domain/extensions/common/dimension-indicator-schema.js +1 -0
- package/dist/domain/extensions/common/index.d.ts +4 -0
- package/dist/domain/extensions/common/index.js +1 -0
- package/dist/domain/extensions/custom-header.d.ts +11 -0
- package/dist/domain/extensions/custom-header.js +1 -0
- package/dist/domain/extensions/custom-price-footer.js +1 -0
- package/dist/domain/extensions/custom-sidebar-footer.d.ts +11 -0
- package/dist/domain/extensions/custom-sidebar-footer.js +1 -0
- package/dist/domain/extensions/dimension-indicator.d.ts +31 -0
- package/dist/domain/extensions/dimension-indicator.js +1 -0
- package/dist/domain/extensions/editable-angle-indicator.d.ts +39 -0
- package/dist/domain/extensions/editable-angle-indicator.js +1 -0
- package/dist/domain/extensions/editable-distance-dimension-indicator.d.ts +43 -0
- package/dist/domain/extensions/editable-distance-dimension-indicator.js +1 -0
- package/dist/domain/extensions/editable-offset-indicator.d.ts +42 -0
- package/dist/domain/extensions/editable-offset-indicator.js +1 -0
- package/dist/domain/extensions/editable-size-indicator.d.ts +39 -0
- package/dist/domain/extensions/editable-size-indicator.js +1 -0
- package/dist/domain/extensions/entity-header.d.ts +22 -0
- package/dist/domain/extensions/entity-header.js +1 -0
- package/dist/domain/extensions/exit-tool-mode-fab.d.ts +25 -0
- package/dist/domain/extensions/exit-tool-mode-fab.js +1 -0
- package/dist/domain/extensions/finalize-action.d.ts +20 -0
- package/dist/domain/extensions/finalize-action.js +1 -0
- package/dist/domain/extensions/finalize-component.js +1 -0
- package/dist/domain/extensions/fit-selection-orthographic-camera-component.js +1 -0
- package/dist/domain/extensions/fit-selection-perspective-camera-component.js +1 -0
- package/dist/domain/extensions/fixed-header.d.ts +10 -0
- package/dist/domain/extensions/fixed-header.js +1 -0
- package/dist/domain/extensions/floating-header.d.ts +10 -0
- package/dist/domain/extensions/floating-header.js +1 -0
- package/dist/domain/extensions/hidden-header.d.ts +8 -0
- package/dist/domain/extensions/hidden-header.js +1 -0
- package/dist/domain/extensions/hidden-sidebar-footer.d.ts +21 -0
- package/dist/domain/extensions/hidden-sidebar-footer.js +1 -0
- package/dist/domain/extensions/horizontal-tabs.d.ts +28 -0
- package/dist/domain/extensions/horizontal-tabs.js +1 -0
- package/dist/domain/extensions/index.d.ts +69 -0
- package/dist/domain/extensions/index.js +1 -0
- package/dist/domain/extensions/list-selector-dimension-indicator.d.ts +31 -0
- package/dist/domain/extensions/list-selector-dimension-indicator.js +1 -0
- package/dist/domain/extensions/multilingual-text-value.js +1 -0
- package/dist/domain/extensions/navigation-steps.d.ts +19 -0
- package/dist/domain/extensions/navigation-steps.js +1 -0
- package/dist/domain/extensions/offset-anchors.d.ts +20 -0
- package/dist/domain/extensions/offset-anchors.js +1 -0
- package/dist/domain/extensions/offset-indicator.d.ts +83 -0
- package/dist/domain/extensions/offset-indicator.js +1 -0
- package/dist/domain/extensions/offset.d.ts +31 -0
- package/dist/domain/extensions/offset.js +1 -0
- package/dist/domain/extensions/other-action.d.ts +14 -0
- package/dist/domain/extensions/other-action.js +1 -0
- package/dist/domain/extensions/property-page.d.ts +16 -0
- package/dist/domain/extensions/property-page.js +1 -0
- package/dist/domain/extensions/read-sidebar-footer.d.ts +8 -0
- package/dist/domain/extensions/read-sidebar-footer.js +1 -0
- package/dist/domain/extensions/replace-entity-recipe-hierarchy.d.ts +21 -0
- package/dist/domain/extensions/replace-entity-recipe-hierarchy.js +1 -0
- package/dist/domain/extensions/rotatable.js +1 -0
- package/dist/domain/extensions/rotation-handle.d.ts +53 -0
- package/dist/domain/extensions/rotation-handle.js +1 -0
- package/dist/domain/extensions/save-template-thumbnail.d.ts +14 -0
- package/dist/domain/extensions/save-template-thumbnail.js +1 -0
- package/dist/domain/extensions/scene-entity-add-fab.d.ts +32 -0
- package/dist/domain/extensions/scene-entity-add-fab.js +1 -0
- package/dist/domain/extensions/scene-entity-animation.js +1 -0
- package/dist/domain/extensions/scene-entity-control.js +1 -0
- package/dist/domain/extensions/scene-entity-delete-fab.d.ts +19 -0
- package/dist/domain/extensions/scene-entity-delete-fab.js +1 -0
- package/dist/domain/extensions/scene-entity-floor-object.js +1 -0
- package/dist/domain/extensions/scene-entity-html-hotspot.d.ts +27 -0
- package/dist/domain/extensions/scene-entity-html-hotspot.js +1 -0
- package/dist/domain/extensions/scene-entity-navigation-hotspot.d.ts +20 -0
- package/dist/domain/extensions/scene-entity-navigation-hotspot.js +1 -0
- package/dist/domain/extensions/scene-entity-object-html-hotspot.d.ts +31 -0
- package/dist/domain/extensions/scene-entity-object-html-hotspot.js +1 -0
- package/dist/domain/extensions/scene-entity-select-hotspot.d.ts +5 -0
- package/dist/domain/extensions/scene-entity-select-hotspot.js +1 -0
- package/dist/domain/extensions/scene-entity-wall-object.js +1 -0
- package/dist/domain/extensions/selectable-component.js +1 -0
- package/dist/domain/extensions/sidebar-tabs.d.ts +29 -0
- package/dist/domain/extensions/sidebar-tabs.js +1 -0
- package/dist/domain/extensions/simple-summary.js +1 -0
- package/dist/domain/extensions/size.d.ts +21 -0
- package/dist/domain/extensions/size.js +1 -0
- package/dist/domain/extensions/sketching-draw.d.ts +17 -0
- package/dist/domain/extensions/sketching-draw.js +1 -0
- package/dist/domain/extensions/sketching-edit.d.ts +28 -0
- package/dist/domain/extensions/sketching-edit.js +1 -0
- package/dist/domain/extensions/summary-component.js +1 -0
- package/dist/domain/extensions/text-value.js +1 -0
- package/dist/domain/extensions/tool-controls.js +1 -0
- package/dist/domain/extensions/tool-menu-fab.d.ts +40 -0
- package/dist/domain/extensions/tool-menu-fab.js +1 -0
- package/dist/domain/extensions/toolbar.d.ts +13 -0
- package/dist/domain/extensions/toolbar.js +1 -0
- package/dist/domain/extensions/universal-sidebar-footer.d.ts +12 -0
- package/dist/domain/extensions/universal-sidebar-footer.js +1 -0
- package/dist/domain/extensions/view-controls.js +1 -0
- package/dist/domain/index.d.ts +2 -32
- package/dist/domain/index.js +1 -1
- package/dist/domain/mocks/create-mock-domain-context.d.ts +1 -1
- package/dist/domain/mocks/create-mock-domain-runtime-services.d.ts +1 -1
- package/dist/domain/mocks/create-mock-domain-runtime.d.ts +30 -21
- package/dist/domain/mocks/create-mock-domain-runtime.js +1 -1
- package/dist/domain/mocks/create-mock-domain.d.ts +1 -1
- package/dist/domain/mocks/create-mock-domain.js +1 -1
- package/dist/domain/mocks/create-mock-state.d.ts +2 -2
- package/dist/domain/mocks/create-test-application-config.d.ts +59 -0
- package/dist/domain/mocks/create-test-application-config.js +1 -0
- package/dist/domain/mocks/index.d.ts +1 -0
- package/dist/domain/mocks/index.js +1 -1
- package/dist/domain/projections/blender-projections/blender-projections.d.ts +2 -3
- package/dist/domain/projections/blender-projections/blender-projections.js +1 -1
- package/dist/domain/projections/blender-projections/camera.d.ts +2 -2
- package/dist/domain/projections/collision-projections.d.ts +1 -1
- package/dist/domain/projections/composition-projections.d.ts +1 -1
- package/dist/domain/projections/composition-projections.js +1 -1
- package/dist/domain/projections/constraint-projections.d.ts +1 -1
- package/dist/domain/projections/index.d.ts +1 -1
- package/dist/domain/projections/position-projections.d.ts +1 -1
- package/dist/domain/projections/projected-entities-projections.d.ts +2 -3
- package/dist/domain/projections/snap-matching.d.ts +1 -2
- package/dist/domain/projections/snap-utils.d.ts +1 -2
- package/dist/domain/projections/snapping-projections.d.ts +1 -1
- package/dist/domain/projections/validation-projections.d.ts +3 -20
- package/dist/domain/projections/validation-projections.js +1 -1
- package/dist/domain/sketching/sketching-projections.d.ts +1 -1
- package/dist/domain/system-components/admin-sidebar.d.ts +1 -1
- package/dist/domain/system-components/admin-sidebar.js +1 -1
- package/dist/domain/system-components/angle-dimension.js +1 -1
- package/dist/domain/system-components/application-config.d.ts +3 -3
- package/dist/domain/system-components/application-config.js +1 -1
- package/dist/domain/system-components/attribute-selection.js +1 -1
- package/dist/domain/system-components/bounding-box-component.d.ts +1 -1
- package/dist/domain/system-components/bounding-box-component.js +1 -1
- package/dist/domain/system-components/bounding-sphere-component.d.ts +1 -1
- package/dist/domain/system-components/bounding-sphere-component.js +1 -1
- package/dist/domain/system-components/child-entity-recipes.d.ts +1 -1
- package/dist/domain/system-components/child-entity-recipes.js +1 -1
- package/dist/domain/system-components/child-entity-selection.d.ts +1 -2
- package/dist/domain/system-components/child-entity-selection.js +1 -1
- package/dist/domain/system-components/collision-box-geometry.d.ts +5 -3
- package/dist/domain/system-components/collision-box-geometry.js +1 -1
- package/dist/domain/system-components/collision-geometries.d.ts +1 -1
- package/dist/domain/system-components/collision-geometry.d.ts +5 -3
- package/dist/domain/system-components/collision-geometry.js +1 -1
- package/dist/domain/system-components/collision-point-geometry.d.ts +5 -3
- package/dist/domain/system-components/collision-point-geometry.js +1 -1
- package/dist/domain/system-components/common/index.d.ts +0 -4
- package/dist/domain/system-components/common/index.js +1 -1
- package/dist/domain/system-components/common/material-override-schema.d.ts +2 -2
- package/dist/domain/system-components/common/recipes.d.ts +21 -4
- package/dist/domain/system-components/common/recipes.js +1 -1
- package/dist/domain/system-components/common/scene-entity-control-schema.d.ts +3 -0
- package/dist/domain/system-components/common/scene-entity-control-schema.js +1 -1
- package/dist/domain/system-components/constraint.d.ts +11 -24
- package/dist/domain/system-components/constraint.js +1 -1
- package/dist/domain/system-components/create-blueprint.d.ts +1 -1
- package/dist/domain/system-components/custom-scene-entity.d.ts +1 -1
- package/dist/domain/system-components/custom-scene-entity.js +1 -1
- package/dist/domain/system-components/detail.js +1 -1
- package/dist/domain/system-components/distance-dimension-select.d.ts +1 -1
- package/dist/domain/system-components/distance-dimension-select.js +1 -1
- package/dist/domain/system-components/distance-dimension.d.ts +1 -1
- package/dist/domain/system-components/distance-dimension.js +1 -1
- package/dist/domain/system-components/drag-handle.d.ts +2 -2
- package/dist/domain/system-components/drag-handle.js +1 -1
- package/dist/domain/system-components/fit-entity-orthographic-camera-component.js +1 -1
- package/dist/domain/system-components/fit-entity-perspective-camera-component.js +1 -1
- package/dist/domain/system-components/fit-root-orthographic-camera-component.js +1 -1
- package/dist/domain/system-components/fit-root-perspective-camera-component.js +1 -1
- package/dist/domain/system-components/generic-dimension.d.ts +1 -1
- package/dist/domain/system-components/generic-dimension.js +1 -1
- package/dist/domain/system-components/hidden-entity.js +1 -1
- package/dist/domain/system-components/hotspot-drag-handle.d.ts +2 -3
- package/dist/domain/system-components/hotspot-drag-handle.js +1 -1
- package/dist/domain/system-components/index.d.ts +0 -68
- package/dist/domain/system-components/index.js +1 -1
- package/dist/domain/system-components/material-override-property-transition.js +1 -1
- package/dist/domain/system-components/material-override-transformer.js +1 -1
- package/dist/domain/system-components/material-swatch.js +1 -1
- package/dist/domain/system-components/navigation-page.js +1 -1
- package/dist/domain/system-components/navigation-panel-list.js +1 -1
- package/dist/domain/system-components/phoenix-entity-elements/admin-data-table-sidebar.d.ts +1 -1
- package/dist/domain/system-components/phoenix-layout-elements/admin-connected-resource-page.d.ts +1 -1
- package/dist/domain/system-components/phoenix-layout-elements/admin-data-table-actions.d.ts +1 -1
- package/dist/domain/system-components/phoenix-layout-elements/admin-data-table-page.d.ts +1 -1
- package/dist/domain/system-components/pivot-point.d.ts +1 -1
- package/dist/domain/system-components/pivot-point.js +1 -1
- package/dist/domain/system-components/price.js +1 -1
- package/dist/domain/system-components/projected-entities.d.ts +1 -1
- package/dist/domain/system-components/projected-entities.js +1 -1
- package/dist/domain/system-components/replace-entity-recipes.d.ts +1 -1
- package/dist/domain/system-components/replace-entity-recipes.js +1 -1
- package/dist/domain/system-components/scene-entity-ambient-light.js +1 -1
- package/dist/domain/system-components/scene-entity-box-object.js +1 -1
- package/dist/domain/system-components/scene-entity-directional-light.js +1 -1
- package/dist/domain/system-components/scene-entity-local-material-override.js +1 -1
- package/dist/domain/system-components/scene-entity-material-override.d.ts +1 -1
- package/dist/domain/system-components/scene-entity-material-override.js +1 -1
- package/dist/domain/system-components/scene-entity-object-clip.js +1 -1
- package/dist/domain/system-components/scene-entity-object-decal.js +1 -1
- package/dist/domain/system-components/scene-entity-object-group.js +1 -1
- package/dist/domain/system-components/scene-entity-object-local-material-override.js +1 -1
- package/dist/domain/system-components/scene-entity-object-material-override.d.ts +1 -1
- package/dist/domain/system-components/scene-entity-object-material-override.js +1 -1
- package/dist/domain/system-components/scene-entity-object-properties.js +1 -1
- package/dist/domain/system-components/scene-entity-object-remote-material-override.js +1 -1
- package/dist/domain/system-components/scene-entity-object-text-decal.d.ts +1 -1
- package/dist/domain/system-components/scene-entity-object-text-decal.js +1 -1
- package/dist/domain/system-components/scene-entity-object-transformer.js +1 -1
- package/dist/domain/system-components/scene-entity-object-transimissive-material-override.d.ts +1 -1
- package/dist/domain/system-components/scene-entity-object-transimissive-material-override.js +1 -1
- package/dist/domain/system-components/scene-entity-object.js +1 -1
- package/dist/domain/system-components/scene-entity-point-light.js +1 -1
- package/dist/domain/system-components/scene-entity-properties.js +1 -1
- package/dist/domain/system-components/scene-entity-rect-area-light.js +1 -1
- package/dist/domain/system-components/scene-entity-remote-material-override.js +1 -1
- package/dist/domain/system-components/scene-entity-remote-object.js +1 -1
- package/dist/domain/system-components/scene-entity-spot-light.js +1 -1
- package/dist/domain/system-components/scene-entity-transimissive-material-override.d.ts +1 -1
- package/dist/domain/system-components/scene-entity-transimissive-material-override.js +1 -1
- package/dist/domain/system-components/sketching-line.d.ts +1 -1
- package/dist/domain/system-components/sketching-line.js +1 -1
- package/dist/domain/system-components/sketching-rectangle.d.ts +1 -1
- package/dist/domain/system-components/sketching-rectangle.js +1 -1
- package/dist/domain/system-components/sketching.d.ts +1 -1
- package/dist/domain/system-components/sketching.js +1 -1
- package/dist/domain/system-components/snap-axis.d.ts +1 -1
- package/dist/domain/system-components/snap-axis.js +1 -1
- package/dist/domain/system-components/snap-edge.d.ts +1 -1
- package/dist/domain/system-components/snap-edge.js +1 -1
- package/dist/domain/system-components/snap-plane.d.ts +1 -1
- package/dist/domain/system-components/snap-plane.js +1 -1
- package/dist/domain/system-components/snap-point.d.ts +1 -1
- package/dist/domain/system-components/snap-point.js +1 -1
- package/dist/domain/system-components/static-orthographic-camera-component.d.ts +1 -1
- package/dist/domain/system-components/static-orthographic-camera-component.js +1 -1
- package/dist/domain/system-components/static-perspective-camera-component.d.ts +1 -1
- package/dist/domain/system-components/static-perspective-camera-component.js +1 -1
- package/dist/domain/utils/eval-cache.d.ts +2 -3
- package/dist/domain/utils/map-nested-object.d.ts +1 -1
- package/dist/domain/utils/memo-eval.d.ts +2 -4
- package/dist/editor/Editor.d.ts +7 -0
- package/dist/editor/Editor.js +1 -1
- package/dist/editor/domain-editors/use-implementation-files.d.ts +8 -8
- package/dist/editor/domain-editors/use-implementation-files.js +1 -1
- package/dist/editor/mocks/CreateMockYaml.js +2 -2
- package/dist/editor/mocks/EditorMockContext.d.ts +2 -0
- package/dist/editor/mocks/EditorMockContext.js +1 -1
- package/dist/editor/variants/VariantAnswerFooter.d.ts +17 -0
- package/dist/editor/variants/VariantAnswerFooter.js +1 -0
- package/dist/editor/variants/VariantPreviewHandler.d.ts +6 -0
- package/dist/editor/variants/VariantPreviewHandler.js +1 -0
- package/dist/editor/variants/variant-preview-styles.d.ts +49 -0
- package/dist/editor/variants/variant-preview-styles.js +1 -0
- package/dist/globals/index.d.ts +2 -0
- package/dist/i18n/locales/cs/messages.js +1 -1
- package/dist/i18n/locales/da/messages.js +1 -1
- package/dist/i18n/locales/de/messages.js +1 -1
- package/dist/i18n/locales/de-AT/messages.js +1 -1
- package/dist/i18n/locales/en/messages.js +1 -1
- package/dist/i18n/locales/en-AU/messages.js +1 -1
- package/dist/i18n/locales/en-GB/messages.js +1 -1
- package/dist/i18n/locales/es/messages.js +1 -1
- package/dist/i18n/locales/fr/messages.js +1 -1
- package/dist/i18n/locales/hu/messages.js +1 -1
- package/dist/i18n/locales/it/messages.js +1 -1
- package/dist/i18n/locales/nl/messages.js +1 -1
- package/dist/i18n/locales/pl/messages.js +1 -1
- package/dist/i18n/locales/pt/messages.js +1 -1
- package/dist/i18n/locales/ro/messages.js +1 -1
- package/dist/i18n/locales/sk/messages.js +1 -1
- package/dist/i18n/locales/tr/messages.js +1 -1
- package/dist/legacy/domain-cli/gen/configurator-builder.js +30 -16
- package/dist/legacy/domain-cli/gen/constant-expressions.js +1 -3
- package/dist/legacy/domain-cli/gen/defaults.js +1 -7
- package/dist/legacy/domain-cli/gen/implementation.js +7 -11
- package/dist/legacy/domain-cli/gen/invariants.js +7 -6
- package/dist/legacy/domain-cli/gen/relations.js +1 -1
- package/dist/legacy/domain-cli/utils/cache.d.ts +1 -1
- package/dist/legacy/domain-cli/utils/cache.js +1 -1
- package/dist/legacy/domain-spec/__generated/domain-schema.d.ts +160 -148
- package/dist/legacy/phoenix-cli/project-gen/generators/file-templates/agents/claude-md.d.ts +1 -1
- package/dist/legacy/phoenix-cli/project-gen/generators/file-templates/agents/cursor-rules.d.ts +1 -1
- package/dist/legacy/phoenix-cli/project-gen/generators/file-templates/agents/shared-sdk-content.d.ts +1 -1
- package/dist/legacy/phoenix-cli/project-gen/generators/file-templates/agents/shared-sdk-content.js +7 -0
- package/dist/legacy/phoenix-cli/project-gen/generators/file-templates/domain-index.js +17 -15
- package/dist/legacy/phoenix-cli/project-gen/generators/file-templates/env-example.d.ts +1 -1
- package/dist/legacy/phoenix-cli/project-gen/generators/file-templates/env-example.js +4 -0
- package/dist/legacy/phoenix-cli/project-gen/generators/file-templates/frontend-admin.js +18 -18
- package/dist/legacy/phoenix-cli/project-gen/generators/file-templates/frontend-configurator.js +16 -15
- package/dist/legacy/phoenix-cli/project-gen/generators/file-templates/frontend-embedded-admin.js +24 -24
- package/dist/legacy/phoenix-cli/project-gen/generators/file-templates/frontend-embedded-configurator.js +16 -15
- package/dist/legacy/phoenix-cli/project-gen/generators/file-templates/generator-shared.d.ts +7 -2
- package/dist/legacy/phoenix-cli/project-gen/generators/file-templates/generator-shared.js +8 -12
- package/dist/legacy/phoenix-cli/project-gen/generators/file-templates/index.d.ts +1 -1
- package/dist/legacy/phoenix-cli/project-gen/generators/file-templates/index.js +1 -1
- package/dist/legacy/phoenix-cli/project-gen/generators/file-templates/webhook-builders.js +7 -7
- package/dist/phoenix/application-spec/application-spec-builder.d.ts +0 -2
- package/dist/phoenix/application-spec/application-spec-builder.js +1 -1
- package/dist/phoenix/application-spec/generate-application-spec-project.d.ts +0 -2
- package/dist/phoenix/application-spec/generate-application-spec-project.js +2 -2
- package/dist/phoenix/application-spec/generate-application-spec-story.js +2 -2
- package/dist/phoenix/application-spec/generate-project-files.d.ts +0 -2
- package/dist/phoenix/application-spec/project-files.js +1 -1
- package/dist/phoenix/application-spec/resolve-deployment-data.d.ts +4 -3
- package/dist/phoenix/application-spec/resolve-deployment-data.js +2 -2
- package/dist/phoenix/bin.d.ts +2 -0
- package/dist/phoenix/bin.js +2 -0
- package/dist/phoenix/check-configs/built-in-eslint-config.d.ts +9 -0
- package/dist/phoenix/check-configs/built-in-eslint-config.js +1 -0
- package/dist/phoenix/check-configs/eslint-config.d.ts +10 -0
- package/dist/phoenix/check-configs/eslint-config.js +1 -0
- package/dist/phoenix/check-configs/index.d.ts +8 -0
- package/dist/phoenix/check-configs/index.js +1 -0
- package/dist/phoenix/check-configs/typescript-project.d.ts +5 -0
- package/dist/phoenix/check-configs/typescript-project.js +1 -0
- package/dist/phoenix/cli.d.ts +0 -1
- package/dist/phoenix/cli.js +1 -2
- package/dist/phoenix/commands/build.js +1 -1
- package/dist/phoenix/commands/check.js +1 -1
- package/dist/phoenix/commands/clean.js +1 -1
- package/dist/phoenix/commands/deploy.js +2 -2
- package/dist/phoenix/commands/deps/deps.d.ts +73 -0
- package/dist/phoenix/commands/deps/deps.js +3 -0
- package/dist/phoenix/commands/deps/index.d.ts +1 -0
- package/dist/phoenix/commands/deps/index.js +1 -0
- package/dist/phoenix/commands/deps/sdk-manifest.d.ts +12 -0
- package/dist/phoenix/commands/deps/sdk-manifest.js +1 -0
- package/dist/phoenix/commands/dev.js +5 -5
- package/dist/phoenix/commands/fix.js +1 -1
- package/dist/phoenix/commands/index.d.ts +2 -0
- package/dist/phoenix/commands/index.js +1 -1
- package/dist/phoenix/commands/init.d.ts +17 -5
- package/dist/phoenix/commands/init.js +1 -1
- package/dist/phoenix/commands/link.js +1 -1
- package/dist/phoenix/commands/prepare-deployment-command.js +2 -2
- package/dist/phoenix/commands/prepare-local-environment-command.js +1 -1
- package/dist/phoenix/commands/prettier.js +1 -1
- package/dist/phoenix/commands/story-dev.js +2 -2
- package/dist/phoenix/commands/sync.js +1 -1
- package/dist/phoenix/commands/unlink.js +1 -1
- package/dist/phoenix/commands/variants.d.ts +35 -0
- package/dist/phoenix/commands/variants.js +1 -0
- package/dist/phoenix/editor-server/commands-router.d.ts +68 -1
- package/dist/phoenix/editor-server/commands-router.js +1 -1
- package/dist/phoenix/editor-server/editor-router.d.ts +65 -0
- package/dist/phoenix/editor-server/editor-server.d.ts +3 -3
- package/dist/phoenix/editor-server/editor-server.js +1 -1
- package/dist/phoenix/editor-server/protocol.d.ts +1 -0
- package/dist/phoenix/editor-server/spec-router.js +1 -1
- package/dist/phoenix/editor-server/trpc.d.ts +3 -0
- package/dist/phoenix/scripts/build-admin.js +1 -1
- package/dist/phoenix/services/application-spec-project-watcher.d.ts +15 -4
- package/dist/phoenix/services/application-spec-project-watcher.js +3 -3
- package/dist/phoenix/services/index.d.ts +4 -0
- package/dist/phoenix/services/index.js +1 -1
- package/dist/phoenix/services/lingui.d.ts +8 -0
- package/dist/phoenix/services/lingui.js +1 -1
- package/dist/phoenix/services/phoenix-application.d.ts +21 -0
- package/dist/phoenix/services/phoenix-application.js +1 -0
- package/dist/phoenix/services/phoenix-store.d.ts +48 -0
- package/dist/phoenix/services/phoenix-store.js +1 -0
- package/dist/phoenix/services/phx-variant-previews-plugin.d.ts +9 -0
- package/dist/phoenix/services/phx-variant-previews-plugin.js +1 -0
- package/dist/phoenix/services/prepare-development-environment.js +1 -1
- package/dist/phoenix/services/source-archive.d.ts +1 -0
- package/dist/phoenix/services/source-archive.js +1 -1
- package/dist/phoenix/services/swc.js +1 -1
- package/dist/phoenix/services/variant-file-session.d.ts +36 -0
- package/dist/phoenix/services/variant-file-session.js +1 -0
- package/dist/phoenix/services/variant-preview-service.d.ts +80 -0
- package/dist/phoenix/services/variant-preview-service.js +1 -0
- package/dist/phoenix/services/vite-config.js +1 -1
- package/dist/phoenix/utils/git/index.d.ts +1 -0
- package/dist/phoenix/utils/git/index.js +1 -0
- package/dist/phoenix/utils/git/is-inside-git-repository.d.ts +6 -0
- package/dist/phoenix/utils/git/is-inside-git-repository.js +1 -0
- package/dist/phoenix/utils/index.d.ts +5 -2
- package/dist/phoenix/utils/index.js +1 -1
- package/dist/phoenix/utils/node-version/index.d.ts +1 -0
- package/dist/phoenix/utils/node-version/index.js +1 -0
- package/dist/phoenix/utils/node-version/supported-node-version.d.ts +12 -0
- package/dist/phoenix/utils/node-version/supported-node-version.js +4 -0
- package/dist/phoenix/utils/package-info.d.ts +0 -9
- package/dist/phoenix/utils/package-info.js +1 -1
- package/dist/phoenix/utils/package-manager/index.d.ts +2 -0
- package/dist/phoenix/utils/package-manager/index.js +1 -0
- package/dist/phoenix/utils/package-manager/package-manager-commands.d.ts +19 -0
- package/dist/phoenix/utils/package-manager/package-manager-commands.js +1 -0
- package/dist/phoenix/utils/package-manager/pnpm-project.d.ts +9 -0
- package/dist/phoenix/utils/package-manager/pnpm-project.js +1 -0
- package/dist/phoenix/utils/run-command.d.ts +11 -0
- package/dist/phoenix/utils/run-command.js +1 -1
- package/dist/phoenix/utils/sdk-tool/index.d.ts +1 -0
- package/dist/phoenix/utils/sdk-tool/index.js +1 -0
- package/dist/phoenix/utils/sdk-tool/resolve-sdk-tool-bin.d.ts +15 -0
- package/dist/phoenix/utils/sdk-tool/resolve-sdk-tool-bin.js +1 -0
- package/dist/react-sdk/application-runtime/common-services/analytics/frontend-analytics.d.ts +48 -0
- package/dist/react-sdk/application-runtime/common-services/analytics/frontend-analytics.js +1 -0
- package/dist/react-sdk/application-runtime/common-services/analytics/index.d.ts +1 -0
- package/dist/react-sdk/application-runtime/common-services/analytics/index.js +1 -1
- package/dist/react-sdk/application-runtime/hooks/use-access-service.d.ts +2 -0
- package/dist/react-sdk/application-runtime/hooks/use-domain-application-props.d.ts +5 -2
- package/dist/react-sdk/application-runtime/hooks/use-spec.d.ts +1 -1
- package/dist/react-sdk/application-runtime/mocks/create-mock-application-runtime.d.ts +1 -1
- package/dist/react-sdk/application-runtime/mocks/create-mock-application-runtime.js +1 -1
- package/dist/react-sdk/application-runtime/routing/access-service.d.ts +1 -0
- package/dist/react-sdk/application-runtime/runtime/create-application-runtime.d.ts +57 -40
- package/dist/react-sdk/application-runtime/runtime/create-application-runtime.js +1 -1
- package/dist/react-sdk/domain-application-context/DomainLifecycleBoundary.js +1 -1
- package/dist/react-sdk/domain-context/common-hooks/use-configurator-messages.d.ts +41 -0
- package/dist/react-sdk/domain-context/common-hooks/use-configurator-messages.js +1 -0
- package/dist/react-sdk/domain-context/common-hooks/use-domain-context.d.ts +9 -9
- package/dist/react-sdk/domain-context/index.d.ts +5 -1
- package/dist/react-sdk/domain-context/index.js +1 -1
- package/dist/react-sdk/domain-context/system-hooks/navigation-hooks.d.ts +11 -0
- package/dist/react-sdk/domain-context/system-hooks/navigation-hooks.js +1 -1
- package/dist/react-sdk/domain-context/system-hooks/step-navigation-hooks.d.ts +57 -0
- package/dist/react-sdk/domain-context/system-hooks/step-navigation-hooks.js +1 -0
- package/dist/react-sdk/domain-context/system-hooks/tab-navigation-hooks.d.ts +61 -0
- package/dist/react-sdk/domain-context/system-hooks/tab-navigation-hooks.js +1 -0
- package/dist/react-sdk/domain-context/system-hooks/undo-redo-hooks.d.ts +20 -0
- package/dist/react-sdk/domain-context/system-hooks/undo-redo-hooks.js +1 -0
- package/dist/react-sdk/domain-controls/hooks/use-angle-dimension.d.ts +1 -1
- package/dist/react-sdk/handlers/FinalizeActionRunner.d.ts +13 -0
- package/dist/react-sdk/handlers/FinalizeActionRunner.js +1 -0
- package/dist/react-sdk/handlers/FinalizeActionsHost.d.ts +10 -0
- package/dist/react-sdk/handlers/FinalizeActionsHost.js +1 -0
- package/dist/react-sdk/handlers/FinalizeActionsProvider.d.ts +11 -0
- package/dist/react-sdk/handlers/FinalizeActionsProvider.js +1 -0
- package/dist/react-sdk/handlers/finalize-actions-context.d.ts +6 -0
- package/dist/react-sdk/handlers/finalize-actions-context.js +1 -0
- package/dist/react-sdk/handlers/finalize-actions-store.d.ts +23 -0
- package/dist/react-sdk/handlers/finalize-actions-store.js +1 -0
- package/dist/react-sdk/handlers/index.d.ts +6 -0
- package/dist/react-sdk/handlers/index.js +1 -1
- package/dist/react-sdk/handlers/use-finalize-action.d.ts +32 -0
- package/dist/react-sdk/handlers/use-finalize-action.js +1 -0
- package/dist/react-sdk/handlers/use-finalize-actions.d.ts +53 -0
- package/dist/react-sdk/handlers/use-finalize-actions.js +1 -0
- package/dist/react-sdk/index.d.ts +1 -0
- package/dist/react-sdk/index.js +1 -1
- package/dist/react-sdk/responsive-state/ResponsiveStateProvider.d.ts +25 -0
- package/dist/react-sdk/responsive-state/ResponsiveStateProvider.js +1 -0
- package/dist/react-sdk/responsive-state/canvas-padding.d.ts +14 -0
- package/dist/react-sdk/responsive-state/canvas-padding.js +1 -0
- package/dist/react-sdk/responsive-state/index.d.ts +5 -0
- package/dist/react-sdk/responsive-state/index.js +1 -0
- package/dist/react-sdk/responsive-state/responsive-state-manager.d.ts +111 -0
- package/dist/react-sdk/responsive-state/responsive-state-manager.js +1 -0
- package/dist/react-sdk/responsive-state/use-responsive-state-manager.d.ts +10 -0
- package/dist/react-sdk/responsive-state/use-responsive-state-manager.js +1 -0
- package/dist/react-sdk/responsive-state/use-responsive-state.d.ts +11 -0
- package/dist/react-sdk/responsive-state/use-responsive-state.js +1 -0
- package/dist/react-sdk/session/NotAuthenticatedPage.d.ts +4 -0
- package/dist/react-sdk/session/NotAuthenticatedPage.js +1 -1
- package/dist/ui-sdk/responsive-application/ResponsiveApplicationProvider.d.ts +9 -0
- package/dist/ui-sdk/responsive-application/ResponsiveApplicationProvider.js +1 -1
- package/dist/ui-sdk/responsive-application/index.d.ts +1 -0
- package/dist/ui-sdk/responsive-application/responsive-state-store.d.ts +57 -0
- package/dist/ui-sdk/responsive-application/responsive-state-store.js +1 -0
- package/dist/ui-sdk/responsive-application/use-store-responsive-info.d.ts +7 -0
- package/dist/ui-sdk/responsive-application/use-store-responsive-info.js +1 -0
- package/dist/ui-sdk/theme/types.d.ts +1 -1
- package/dist/webhook/builders/common.d.ts +8 -0
- package/dist/webhook/builders/webhook-builder.d.ts +1 -1
- package/dist/webhook/builders/webhook-builder.js +1 -1
- package/package.json +48 -36
- package/schema/domain-spec.json +1201 -217
- package/dist/application-spec/core/eval-to-constant.d.ts +0 -14
- package/dist/application-spec/generate-application/code/templates/env-ci.d.ts +0 -1
- package/dist/application-spec/generate-application/code/templates/env-ci.js +0 -25
- package/dist/application-spec/generate-application/code/templates/env-example.d.ts +0 -1
- package/dist/application-spec/generate-application/code/templates/env-example.js +0 -90
- package/dist/application-spec/generate-application/code/templates/nvmrc.d.ts +0 -1
- package/dist/application-spec/generate-application/code/templates/nvmrc.js +0 -2
- package/dist/application-spec/generate-application/code/templates/package-json.d.ts +0 -10
- package/dist/application-spec/generate-application/code/templates/package-json.js +0 -1
- package/dist/application-spec/generate-application/code/templates/prettier-ignore.d.ts +0 -1
- package/dist/application-spec/generate-application/code/templates/prettier-ignore.js +0 -6
- package/dist/application-spec/generate-application/code/templates/private-assets-readme.d.ts +0 -1
- package/dist/application-spec/generate-application/code/templates/private-assets-readme.js +0 -24
- package/dist/application-spec/generate-application/code/templates/public-assets-readme.d.ts +0 -1
- package/dist/application-spec/generate-application/code/templates/public-assets-readme.js +0 -24
- package/dist/application-spec/generate-application/code/templates/readme.d.ts +0 -1
- package/dist/application-spec/generate-application/code/templates/readme.js +0 -23
- package/dist/application-spec/generate-application/code/templates/skills/agents-md.d.ts +0 -1
- package/dist/application-spec/generate-application/code/templates/skills/agents-md.js +0 -2
- package/dist/application-spec/generate-application/code/templates/webhook-implementation.d.ts +0 -1
- package/dist/application-spec/generate-application/code/templates/webhook-implementation.js +0 -7
- package/dist/configurator/common/frontend-analytics.d.ts +0 -46
- package/dist/configurator/common/frontend-analytics.js +0 -1
- package/dist/domain/actions/action-factory.d.ts +0 -10
- package/dist/domain/actions/prepare-action-implementations.d.ts +0 -15
- package/dist/domain/actions/prepare-action-implementations.js +0 -5
- package/dist/domain/application/element-registration.d.ts +0 -105
- package/dist/domain/application/element-registration.js +0 -1
- package/dist/domain/application/handler-registration.d.ts +0 -29
- package/dist/domain/application/handler-registration.js +0 -1
- package/dist/domain/application/resolve-imported-transformers.d.ts +0 -13
- package/dist/domain/application/resolve-imported-transformers.js +0 -1
- package/dist/domain/application/resource-builder.d.ts +0 -13
- package/dist/domain/application/resource-builder.js +0 -1
- package/dist/domain/components/component-reader-types.d.ts +0 -44
- package/dist/domain/components/debug-state-component.d.ts +0 -14
- package/dist/domain/components/debug-state-component.js +0 -1
- package/dist/domain/components/domain-component-optic.d.ts +0 -76
- package/dist/domain/components/domain-component-optic.js +0 -16
- package/dist/domain/components/drag-state-component.d.ts +0 -16
- package/dist/domain/components/drag-state-component.js +0 -1
- package/dist/domain/components/export-state-component.d.ts +0 -15
- package/dist/domain/components/export-state-component.js +0 -1
- package/dist/domain/components/fullscreen-state-component.d.ts +0 -14
- package/dist/domain/components/fullscreen-state-component.js +0 -1
- package/dist/domain/components/group-components-by-entity-id-and-name.d.ts +0 -9
- package/dist/domain/components/group-components-by-entity-id-and-name.js +0 -1
- package/dist/domain/components/hover-state-component.d.ts +0 -14
- package/dist/domain/components/hover-state-component.js +0 -1
- package/dist/domain/components/index.d.ts +0 -2
- package/dist/domain/components/index.js +0 -1
- package/dist/domain/components/legacy-filter.d.ts +0 -513
- package/dist/domain/components/navigation-state-component.d.ts +0 -15
- package/dist/domain/components/navigation-state-component.js +0 -1
- package/dist/domain/components/selection-state-component.d.ts +0 -14
- package/dist/domain/components/selection-state-component.js +0 -1
- package/dist/domain/components/system-component-builder.d.ts +0 -12
- package/dist/domain/components/system-component-builder.js +0 -1
- package/dist/domain/components/system-component-filter.d.ts +0 -793
- package/dist/domain/components/system-virtual-entity.js +0 -1
- package/dist/domain/components/tool-state-component.d.ts +0 -14
- package/dist/domain/components/tool-state-component.js +0 -1
- package/dist/domain/components/updates.d.ts +0 -124
- package/dist/domain/components/view-state-component.d.ts +0 -14
- package/dist/domain/components/view-state-component.js +0 -1
- package/dist/domain/components/viewport-state-component.d.ts +0 -29
- package/dist/domain/components/viewport-state-component.js +0 -1
- package/dist/domain/core/action.d.ts +0 -67
- package/dist/domain/core/component.d.ts +0 -46
- package/dist/domain/core/expression.d.ts +0 -50
- package/dist/domain/core/json-schema.js +0 -1
- package/dist/domain/core/migrations.d.ts +0 -99
- package/dist/domain/core/migrations.js +0 -1
- package/dist/domain/core/model.d.ts +0 -127
- package/dist/domain/core/reflection.d.ts +0 -114
- package/dist/domain/core/reflection.js +0 -1
- package/dist/domain/core/state.d.ts +0 -10
- package/dist/domain/domain-context/recipe-system/recipes.d.ts +0 -57
- package/dist/domain/domain-context/recipe-system/recipes.js +0 -1
- package/dist/domain/expressions/constant-expressions.d.ts +0 -9
- package/dist/domain/expressions/constant-expressions.js +0 -1
- package/dist/domain/expressions/custom-expression.d.ts +0 -13
- package/dist/domain/expressions/custom-expression.js +0 -1
- package/dist/domain/expressions/index.d.ts +0 -1
- package/dist/domain/expressions/index.js +0 -1
- package/dist/domain/expressions/memoize-expression.d.ts +0 -17
- package/dist/domain/expressions/prepare-domain-expressions.d.ts +0 -16
- package/dist/domain/invariants/builtin-invariant.d.ts +0 -5
- package/dist/domain/invariants/custom-invariants.d.ts +0 -22
- package/dist/domain/invariants/custom-invariants.js +0 -1
- package/dist/domain/invariants/invariants.d.ts +0 -68
- package/dist/domain/invariants/invariants.js +0 -1
- package/dist/domain/invariants/violation-component.js +0 -1
- package/dist/domain/invariants/violation.d.ts +0 -85
- package/dist/domain/invariants/violation.js +0 -1
- package/dist/domain/relations/all-of-type-relation.d.ts +0 -33
- package/dist/domain/relations/all-of-type-relation.js +0 -1
- package/dist/domain/relations/component-factories.d.ts +0 -15
- package/dist/domain/relations/component-factories.js +0 -1
- package/dist/domain/relations/composed-of.d.ts +0 -12
- package/dist/domain/relations/composed-of.js +0 -1
- package/dist/domain/relations/direct-relation.d.ts +0 -29
- package/dist/domain/relations/indirect-relation.d.ts +0 -81
- package/dist/domain/relations/indirect-relation.js +0 -1
- package/dist/domain/relations/reference-component.d.ts +0 -18
- package/dist/domain/relations/reference-component.js +0 -1
- package/dist/domain/relations/reference-field.d.ts +0 -7
- package/dist/domain/relations/relation-factory.d.ts +0 -19
- package/dist/domain/relations/relation-factory.js +0 -1
- package/dist/domain/relations/relation-implementation.d.ts +0 -8
- package/dist/domain/system-components/angle-indicator.d.ts +0 -21
- package/dist/domain/system-components/angle-indicator.js +0 -1
- package/dist/domain/system-components/attribute-switch.d.ts +0 -8
- package/dist/domain/system-components/attribute-switch.js +0 -1
- package/dist/domain/system-components/autorotate-camera-component.d.ts +0 -19
- package/dist/domain/system-components/autorotate-camera-component.js +0 -1
- package/dist/domain/system-components/basic-sidebar-footer.d.ts +0 -8
- package/dist/domain/system-components/basic-sidebar-footer.js +0 -1
- package/dist/domain/system-components/camera-based-hidden-entity-object.js +0 -1
- package/dist/domain/system-components/camera-based-hidden-entity.js +0 -1
- package/dist/domain/system-components/canvas-config.d.ts +0 -87
- package/dist/domain/system-components/canvas-config.js +0 -1
- package/dist/domain/system-components/canvas-custom-environment.js +0 -1
- package/dist/domain/system-components/canvas-padding.d.ts +0 -25
- package/dist/domain/system-components/canvas-padding.js +0 -1
- package/dist/domain/system-components/canvas-preset-environment.d.ts +0 -37
- package/dist/domain/system-components/canvas-preset-environment.js +0 -1
- package/dist/domain/system-components/child-entity-recipe-hierarchy.d.ts +0 -21
- package/dist/domain/system-components/child-entity-recipe-hierarchy.js +0 -1
- package/dist/domain/system-components/client-side-image.d.ts +0 -14
- package/dist/domain/system-components/client-side-image.js +0 -1
- package/dist/domain/system-components/color-value.js +0 -1
- package/dist/domain/system-components/common/angle-indicator-schema.d.ts +0 -292
- package/dist/domain/system-components/common/angle-indicator-schema.js +0 -1
- package/dist/domain/system-components/common/dimension-indicator-schema.d.ts +0 -607
- package/dist/domain/system-components/common/dimension-indicator-schema.js +0 -1
- package/dist/domain/system-components/custom-header.d.ts +0 -11
- package/dist/domain/system-components/custom-header.js +0 -1
- package/dist/domain/system-components/custom-price-footer.js +0 -1
- package/dist/domain/system-components/custom-sidebar-footer.d.ts +0 -11
- package/dist/domain/system-components/custom-sidebar-footer.js +0 -1
- package/dist/domain/system-components/dimension-indicator.d.ts +0 -31
- package/dist/domain/system-components/dimension-indicator.js +0 -1
- package/dist/domain/system-components/editable-angle-indicator.d.ts +0 -38
- package/dist/domain/system-components/editable-angle-indicator.js +0 -1
- package/dist/domain/system-components/editable-distance-dimension-indicator.d.ts +0 -42
- package/dist/domain/system-components/editable-distance-dimension-indicator.js +0 -1
- package/dist/domain/system-components/editable-offset-indicator.d.ts +0 -41
- package/dist/domain/system-components/editable-offset-indicator.js +0 -1
- package/dist/domain/system-components/editable-size-indicator.d.ts +0 -38
- package/dist/domain/system-components/editable-size-indicator.js +0 -1
- package/dist/domain/system-components/entity-header.d.ts +0 -22
- package/dist/domain/system-components/entity-header.js +0 -1
- package/dist/domain/system-components/exit-tool-mode-fab.d.ts +0 -25
- package/dist/domain/system-components/exit-tool-mode-fab.js +0 -1
- package/dist/domain/system-components/finalize-action.d.ts +0 -20
- package/dist/domain/system-components/finalize-action.js +0 -1
- package/dist/domain/system-components/finalize-component.js +0 -1
- package/dist/domain/system-components/fit-selection-orthographic-camera-component.js +0 -1
- package/dist/domain/system-components/fit-selection-perspective-camera-component.js +0 -1
- package/dist/domain/system-components/fixed-header.d.ts +0 -10
- package/dist/domain/system-components/fixed-header.js +0 -1
- package/dist/domain/system-components/floating-header.d.ts +0 -10
- package/dist/domain/system-components/floating-header.js +0 -1
- package/dist/domain/system-components/hidden-header.d.ts +0 -8
- package/dist/domain/system-components/hidden-header.js +0 -1
- package/dist/domain/system-components/hidden-sidebar-footer.d.ts +0 -21
- package/dist/domain/system-components/hidden-sidebar-footer.js +0 -1
- package/dist/domain/system-components/horizontal-tabs.d.ts +0 -28
- package/dist/domain/system-components/horizontal-tabs.js +0 -1
- package/dist/domain/system-components/list-selector-dimension-indicator.d.ts +0 -30
- package/dist/domain/system-components/list-selector-dimension-indicator.js +0 -1
- package/dist/domain/system-components/multilingual-text-value.js +0 -1
- package/dist/domain/system-components/navigation-steps.d.ts +0 -19
- package/dist/domain/system-components/navigation-steps.js +0 -1
- package/dist/domain/system-components/offset-anchors.d.ts +0 -20
- package/dist/domain/system-components/offset-anchors.js +0 -1
- package/dist/domain/system-components/offset-indicator.d.ts +0 -84
- package/dist/domain/system-components/offset-indicator.js +0 -1
- package/dist/domain/system-components/offset.d.ts +0 -31
- package/dist/domain/system-components/offset.js +0 -1
- package/dist/domain/system-components/other-action.d.ts +0 -14
- package/dist/domain/system-components/other-action.js +0 -1
- package/dist/domain/system-components/property-page.d.ts +0 -16
- package/dist/domain/system-components/property-page.js +0 -1
- package/dist/domain/system-components/read-sidebar-footer.d.ts +0 -8
- package/dist/domain/system-components/read-sidebar-footer.js +0 -1
- package/dist/domain/system-components/replace-entity-recipe-hierarchy.d.ts +0 -21
- package/dist/domain/system-components/replace-entity-recipe-hierarchy.js +0 -1
- package/dist/domain/system-components/rotatable.js +0 -1
- package/dist/domain/system-components/rotation-handle.d.ts +0 -53
- package/dist/domain/system-components/rotation-handle.js +0 -1
- package/dist/domain/system-components/save-template-thumbnail.d.ts +0 -14
- package/dist/domain/system-components/save-template-thumbnail.js +0 -1
- package/dist/domain/system-components/scene-entity-add-fab.d.ts +0 -32
- package/dist/domain/system-components/scene-entity-add-fab.js +0 -1
- package/dist/domain/system-components/scene-entity-animation.js +0 -1
- package/dist/domain/system-components/scene-entity-control.js +0 -1
- package/dist/domain/system-components/scene-entity-delete-fab.d.ts +0 -19
- package/dist/domain/system-components/scene-entity-delete-fab.js +0 -1
- package/dist/domain/system-components/scene-entity-floor-object.js +0 -1
- package/dist/domain/system-components/scene-entity-html-hotspot.d.ts +0 -27
- package/dist/domain/system-components/scene-entity-html-hotspot.js +0 -1
- package/dist/domain/system-components/scene-entity-navigation-hotspot.d.ts +0 -20
- package/dist/domain/system-components/scene-entity-navigation-hotspot.js +0 -1
- package/dist/domain/system-components/scene-entity-object-html-hotspot.d.ts +0 -31
- package/dist/domain/system-components/scene-entity-object-html-hotspot.js +0 -1
- package/dist/domain/system-components/scene-entity-select-hotspot.d.ts +0 -5
- package/dist/domain/system-components/scene-entity-select-hotspot.js +0 -1
- package/dist/domain/system-components/scene-entity-wall-object.js +0 -1
- package/dist/domain/system-components/selectable-component.js +0 -1
- package/dist/domain/system-components/sidebar-tabs.d.ts +0 -29
- package/dist/domain/system-components/sidebar-tabs.js +0 -1
- package/dist/domain/system-components/simple-summary.js +0 -1
- package/dist/domain/system-components/size.d.ts +0 -21
- package/dist/domain/system-components/size.js +0 -1
- package/dist/domain/system-components/sketching-draw.d.ts +0 -17
- package/dist/domain/system-components/sketching-draw.js +0 -1
- package/dist/domain/system-components/sketching-edit.d.ts +0 -28
- package/dist/domain/system-components/sketching-edit.js +0 -1
- package/dist/domain/system-components/summary-component.js +0 -1
- package/dist/domain/system-components/text-value.js +0 -1
- package/dist/domain/system-components/tool-controls.js +0 -1
- package/dist/domain/system-components/tool-menu-fab.d.ts +0 -40
- package/dist/domain/system-components/tool-menu-fab.js +0 -1
- package/dist/domain/system-components/toolbar.d.ts +0 -13
- package/dist/domain/system-components/toolbar.js +0 -1
- package/dist/domain/system-components/universal-sidebar-footer.d.ts +0 -12
- package/dist/domain/system-components/universal-sidebar-footer.js +0 -1
- package/dist/domain/system-components/view-controls.js +0 -1
- package/dist/phoenix/application-spec/generate-assistant-prompt.d.ts +0 -12
- package/dist/phoenix/application-spec/generate-assistant-prompt.js +0 -1
- package/dist/phoenix/commands/generate-project-files.d.ts +0 -6
- package/dist/phoenix/commands/generate-project-files.js +0 -1
- /package/dist/{domain/components/component-reader-types.js → application-spec/core/expressions/relation-expression-params.js} +0 -0
- /package/dist/application-spec/{core → enhanced-json}/eval-code-uses-self.d.ts +0 -0
- /package/dist/application-spec/{core → enhanced-json}/eval-code-uses-self.js +0 -0
- /package/dist/application-spec/{core → enhanced-json}/eval-to-constant.js +0 -0
- /package/dist/{domain/core/action.js → application-spec/generate-application/runtime/spec-code/spec-code-module.js} +0 -0
- /package/dist/{domain/core/enhanced-json-schema.js → application-spec/parse-application-files/spec/expressions/expression-read.js} +0 -0
- /package/dist/{domain/core/schema-validator.js → configurator/ui/assistant/form/form-element-definition.js} +0 -0
- /package/dist/{domain/relations/reference-field.js → configurator/ui/assistant/form/form-model.js} +0 -0
- /package/dist/{domain/relations/relation-implementation.js → configurator/ui/assistant/form/form-state.js} +0 -0
- /package/dist/{domain/core/expression.js → configurator/ui/assistant/form-elements/form-element-props.js} +0 -0
- /package/dist/domain/{actions → core/action}/action-factory.js +0 -0
- /package/dist/domain/{components → core/component}/legacy-filter.js +0 -0
- /package/dist/domain/{components → core/component}/system-component-filter.js +0 -0
- /package/dist/domain/{components → core/component}/system-virtual-entity.d.ts +0 -0
- /package/dist/domain/{components → core/component}/updates.js +0 -0
- /package/dist/domain/{invariants → core/invariant}/builtin-invariant.js +0 -0
- /package/dist/domain/{invariants → core/invariant}/violation-component.d.ts +0 -0
- /package/dist/domain/core/{alias.d.ts → model/alias.d.ts} +0 -0
- /package/dist/domain/core/{alias.js → model/alias.js} +0 -0
- /package/dist/domain/core/{common-definitions.d.ts → model/common-definitions.d.ts} +0 -0
- /package/dist/domain/core/{common-definitions.js → model/common-definitions.js} +0 -0
- /package/dist/domain/core/{component.js → model/component.js} +0 -0
- /package/dist/domain/core/{model.js → model/model.js} +0 -0
- /package/dist/domain/core/{preset.d.ts → model/preset.d.ts} +0 -0
- /package/dist/domain/core/{preset.js → model/preset.js} +0 -0
- /package/dist/domain/{relations → core/relation}/direct-relation.js +0 -0
- /package/dist/domain/core/{schema-validator-ajv.d.ts → schema/create-ajv-schema-validator.d.ts} +0 -0
- /package/dist/domain/core/{schema-validator-ajv.js → schema/create-ajv-schema-validator.js} +0 -0
- /package/dist/domain/core/{schema-validator-csp.d.ts → schema/create-csp-schema-validator.d.ts} +0 -0
- /package/dist/domain/core/{schema-validator-csp.js → schema/create-csp-schema-validator.js} +0 -0
- /package/dist/domain/core/{enhanced-json-schema.d.ts → schema/enhanced-json-schema.d.ts} +0 -0
- /package/dist/domain/core/{json-schema.d.ts → schema/extended-schema-validator.d.ts} +0 -0
- /package/dist/domain/core/{schema-validator.d.ts → schema/schema-validator.d.ts} +0 -0
- /package/dist/domain/core/{state.js → state/state.js} +0 -0
- /package/dist/domain/{expressions → domain-runtime/spec}/memoize-expression.js +0 -0
- /package/dist/domain/{expressions → domain-runtime/spec}/prepare-domain-expressions.js +0 -0
- /package/dist/domain/{system-components → extensions}/camera-based-hidden-entity-object.d.ts +0 -0
- /package/dist/domain/{system-components → extensions}/camera-based-hidden-entity.d.ts +0 -0
- /package/dist/domain/{system-components → extensions}/canvas-custom-environment.d.ts +0 -0
- /package/dist/domain/{system-components → extensions}/color-value.d.ts +0 -0
- /package/dist/domain/{system-components → extensions}/common/dimension-indicators.d.ts +0 -0
- /package/dist/domain/{system-components → extensions}/common/dimension-indicators.js +0 -0
- /package/dist/domain/{system-components → extensions}/common/editable-indicator-button-variant.d.ts +0 -0
- /package/dist/domain/{system-components → extensions}/common/editable-indicator-button-variant.js +0 -0
- /package/dist/domain/{system-components → extensions}/custom-price-footer.d.ts +0 -0
- /package/dist/domain/{system-components → extensions}/finalize-component.d.ts +0 -0
- /package/dist/domain/{system-components → extensions}/fit-selection-orthographic-camera-component.d.ts +0 -0
- /package/dist/domain/{system-components → extensions}/fit-selection-perspective-camera-component.d.ts +0 -0
- /package/dist/domain/{system-components → extensions}/multilingual-text-value.d.ts +0 -0
- /package/dist/domain/{system-components → extensions}/rotatable.d.ts +0 -0
- /package/dist/domain/{system-components → extensions}/scene-entity-animation.d.ts +0 -0
- /package/dist/domain/{system-components → extensions}/scene-entity-control.d.ts +0 -0
- /package/dist/domain/{system-components → extensions}/scene-entity-floor-object.d.ts +0 -0
- /package/dist/domain/{system-components → extensions}/scene-entity-wall-object.d.ts +0 -0
- /package/dist/domain/{system-components → extensions}/selectable-component.d.ts +0 -0
- /package/dist/domain/{system-components → extensions}/simple-summary.d.ts +0 -0
- /package/dist/domain/{system-components → extensions}/summary-component.d.ts +0 -0
- /package/dist/domain/{system-components → extensions}/text-value.d.ts +0 -0
- /package/dist/domain/{system-components → extensions}/tool-controls.d.ts +0 -0
- /package/dist/domain/{system-components → extensions}/view-controls.d.ts +0 -0
|
@@ -0,0 +1,2435 @@
|
|
|
1
|
+
# Custom Layout
|
|
2
|
+
|
|
3
|
+
Make the configurator look like the brand's own product page. A furniture shop wants its table configurator to read like the rest of its site: a floating panel on the left with the product's name, the edge finishes as picture cards, the price in large type and one clear call to action, and the table in the space beside it. On a phone the panel becomes a sheet at the bottom, and a button on the table's edge offers the finishes right where they apply, and the layout's own buttons switch between the whole table and a close-up of its edge. The project writes that page as one React component. Phoenix supplies the 3D scene, the product's state and a few hooks; every pixel around the scene is the project's own.
|
|
4
|
+
|
|
5
|
+
- [Choose this approach](#choose-this-approach)
|
|
6
|
+
- [Register the layout](#register-the-layout)
|
|
7
|
+
- [What the layout has to do](#what-the-layout-has-to-do)
|
|
8
|
+
- [Read and change the product](#read-and-change-the-product)
|
|
9
|
+
- [Draw the choices](#draw-the-choices)
|
|
10
|
+
- [Offer fullscreen](#offer-fullscreen)
|
|
11
|
+
- [Show messages](#show-messages)
|
|
12
|
+
- [Request a quote](#request-a-quote)
|
|
13
|
+
- [Serve read mode](#serve-read-mode)
|
|
14
|
+
- [Fit a phone](#fit-a-phone)
|
|
15
|
+
- [Put a control on the product](#put-a-control-on-the-product)
|
|
16
|
+
- [Control the scene](#control-the-scene)
|
|
17
|
+
- [The spec the layout reads](#the-spec-the-layout-reads)
|
|
18
|
+
- [Try the example](#try-the-example)
|
|
19
|
+
- [Test cases](#test-cases)
|
|
20
|
+
- [Known gaps](#known-gaps)
|
|
21
|
+
- [Related pages](#related-pages)
|
|
22
|
+
- [Complete Implementation](#complete-implementation)
|
|
23
|
+
|
|
24
|
+
## Choose this approach
|
|
25
|
+
|
|
26
|
+
Write your own layout when the configurator has to follow a design the built-in layout cannot take on: the brand's typography, controls and spacing, a panel on the left, a top bar with the price, an area the built-in layout has no place for.
|
|
27
|
+
|
|
28
|
+
Stay with the built-in layout when its structure fits and only its parts change. [Universal](?path=/docs/layouts-universal--docs) demonstrates that layout, and the pages of its parts describe what the spec configures: [Header](?path=/docs/layouts-header-floating--docs), [Sidebar](?path=/docs/layouts-sidebar-general--docs), [Sidebar Footer](?path=/docs/layouts-sidebar-footer-basic--docs), [Toolbar](?path=/docs/layouts-toolbar--docs) and [View Controls](?path=/docs/layouts-view-controls--docs).
|
|
29
|
+
|
|
30
|
+
A project layout replaces all of that. None of the built-in sidebar, footer, toolbar or property pages is rendered for it, so the layout builds every control the user needs. This example uses no SDK component that draws UI: only the scene, the safe-area hook and hooks that read and change the product's state. A layout may also mount the SDK's own pieces where it wants them, see [Configurator Interface → Loaded Configuration UI](?path=/docs/phoenix-configurator-interface--docs#loaded-configuration-ui).
|
|
31
|
+
|
|
32
|
+
## Register the layout
|
|
33
|
+
|
|
34
|
+
Create `src/elements/ConfiguratorLayout.tsx` with a default export made by `phx.frontend.createCustomPhoenixLayoutElement`. The name `ConfiguratorLayout` is what makes it the layout: Phoenix renders the element registered under that name for every loaded configuration, in owner and in read mode, whatever `layout` the spec sets. Nothing in the YAML refers to it.
|
|
35
|
+
|
|
36
|
+
```tsx
|
|
37
|
+
import { Box } from '@mui/material'
|
|
38
|
+
import { useState } from 'react'
|
|
39
|
+
|
|
40
|
+
import { LayoutSlots, useSceneSafeArea } from '@salsita-ai/sdk/configurator'
|
|
41
|
+
import { useActiveViewports } from '@salsita-ai/sdk/react'
|
|
42
|
+
|
|
43
|
+
import { phx } from '../../.phoenix/phx.js'
|
|
44
|
+
import { BottomSheet } from '../_shared/BottomSheet.js'
|
|
45
|
+
import { FullscreenToggle } from '../_shared/FullscreenToggle.js'
|
|
46
|
+
import { MessageToast } from '../_shared/MessageToast.js'
|
|
47
|
+
import { ProductPanel } from '../_shared/ProductPanel.js'
|
|
48
|
+
import { SceneControls } from '../_shared/SceneControls.js'
|
|
49
|
+
|
|
50
|
+
const GUTTER = 24
|
|
51
|
+
const PANEL_WIDTH = 380
|
|
52
|
+
const PHONE_GUTTER = 16
|
|
53
|
+
const TOUCH_TARGET = 44
|
|
54
|
+
|
|
55
|
+
const ConfiguratorLayout = () => {
|
|
56
|
+
const { containerRef, safeAreaRef } = useSceneSafeArea()
|
|
57
|
+
const isFullscreen = phx.frontend.useIsFullscreenActive()
|
|
58
|
+
// `null` until the container has been measured; the layout shows only the scene until then
|
|
59
|
+
const viewports = useActiveViewports()
|
|
60
|
+
const [isSheetOpen, setSheetOpen] = useState(false)
|
|
61
|
+
|
|
62
|
+
const isDesktop = viewports?.includes('desktop') ?? false
|
|
63
|
+
const gutter = isDesktop ? GUTTER : PHONE_GUTTER
|
|
64
|
+
|
|
65
|
+
return (
|
|
66
|
+
<Box
|
|
67
|
+
component="div"
|
|
68
|
+
ref={containerRef}
|
|
69
|
+
// `clip`, not `hidden`: what overflows, such as the sheet's fill below its edge, can never be scrolled into view,
|
|
70
|
+
// not even by the browser when the focus moves
|
|
71
|
+
sx={{ position: 'absolute', inset: 0, display: 'flex', flexDirection: 'column', overflow: 'clip' }}
|
|
72
|
+
>
|
|
73
|
+
<LayoutSlots.SharedCanvas />
|
|
74
|
+
|
|
75
|
+
{viewports !== null && isDesktop && !isFullscreen && (
|
|
76
|
+
<Box
|
|
77
|
+
component="aside"
|
|
78
|
+
sx={{
|
|
79
|
+
position: 'absolute',
|
|
80
|
+
insetBlockStart: GUTTER,
|
|
81
|
+
insetInlineStart: GUTTER,
|
|
82
|
+
inlineSize: PANEL_WIDTH,
|
|
83
|
+
maxBlockSize: `calc(100% - ${2 * GUTTER}px)`,
|
|
84
|
+
display: 'flex',
|
|
85
|
+
flexDirection: 'column',
|
|
86
|
+
borderRadius: 5,
|
|
87
|
+
bgcolor: 'background.paper',
|
|
88
|
+
boxShadow: '0 12px 40px rgba(0, 0, 0, 0.12)',
|
|
89
|
+
// A very short container, such as a phone held sideways, scrolls the panel instead of clipping its footer
|
|
90
|
+
overflowX: 'hidden',
|
|
91
|
+
overflowY: 'auto',
|
|
92
|
+
overscrollBehavior: 'contain',
|
|
93
|
+
}}
|
|
94
|
+
>
|
|
95
|
+
<ProductPanel />
|
|
96
|
+
</Box>
|
|
97
|
+
)}
|
|
98
|
+
|
|
99
|
+
{viewports !== null && (
|
|
100
|
+
<Box
|
|
101
|
+
component="div"
|
|
102
|
+
ref={safeAreaRef}
|
|
103
|
+
sx={{
|
|
104
|
+
// Desktop: right of the panel. Phone: above the sheet, whose height the column gives the rest.
|
|
105
|
+
...(isDesktop
|
|
106
|
+
? {
|
|
107
|
+
position: 'absolute',
|
|
108
|
+
insetBlock: 0,
|
|
109
|
+
insetInlineStart: isFullscreen ? 0 : PANEL_WIDTH + 2 * GUTTER,
|
|
110
|
+
insetInlineEnd: 0,
|
|
111
|
+
}
|
|
112
|
+
: { position: 'relative', flex: '1 1 0', minBlockSize: 0 }),
|
|
113
|
+
pointerEvents: 'none',
|
|
114
|
+
}}
|
|
115
|
+
>
|
|
116
|
+
<Box
|
|
117
|
+
component="div"
|
|
118
|
+
sx={{ position: 'absolute', insetBlockStart: gutter, insetInlineEnd: gutter, pointerEvents: 'auto' }}
|
|
119
|
+
>
|
|
120
|
+
<FullscreenToggle compact={!isDesktop} />
|
|
121
|
+
</Box>
|
|
122
|
+
<Box
|
|
123
|
+
component="div"
|
|
124
|
+
sx={{
|
|
125
|
+
position: 'absolute',
|
|
126
|
+
pointerEvents: 'auto',
|
|
127
|
+
// Desktop: bottom left, above the row of view controls. Phone: at the top beside the fullscreen button,
|
|
128
|
+
// clear of the sheet's handle and the view controls.
|
|
129
|
+
...(isDesktop
|
|
130
|
+
? { insetBlockEnd: 2 * GUTTER + TOUCH_TARGET, insetInlineStart: GUTTER }
|
|
131
|
+
: { insetBlockStart: gutter, insetInline: `${gutter}px ${2 * gutter + TOUCH_TARGET}px` }),
|
|
132
|
+
}}
|
|
133
|
+
>
|
|
134
|
+
<MessageToast />
|
|
135
|
+
</Box>
|
|
136
|
+
{/* A phone in fullscreen keeps only the reset, as the built-in layout does. Below 1024 pixels (`tablet`) the
|
|
137
|
+
free area beside the panel is narrow, so the reset shows only its icon there too. */}
|
|
138
|
+
<Box
|
|
139
|
+
component="div"
|
|
140
|
+
sx={{ position: 'absolute', insetBlockEnd: gutter, insetInlineEnd: gutter, pointerEvents: 'auto' }}
|
|
141
|
+
>
|
|
142
|
+
<SceneControls
|
|
143
|
+
compact={!isDesktop || (viewports?.includes('tablet') ?? false)}
|
|
144
|
+
resetOnly={!isDesktop && isFullscreen}
|
|
145
|
+
/>
|
|
146
|
+
</Box>
|
|
147
|
+
</Box>
|
|
148
|
+
)}
|
|
149
|
+
|
|
150
|
+
{viewports !== null && !isDesktop && !isFullscreen && (
|
|
151
|
+
<BottomSheet open={isSheetOpen} onOpenChange={setSheetOpen} label="Product details">
|
|
152
|
+
<ProductPanel collapsed={!isSheetOpen} inSheet />
|
|
153
|
+
</BottomSheet>
|
|
154
|
+
)}
|
|
155
|
+
</Box>
|
|
156
|
+
)
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
export default phx.frontend.createCustomPhoenixLayoutElement('ConfiguratorLayout', ConfiguratorLayout)
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
The components it uses live in `src/_shared/`, which Phoenix does not import by convention, so the layout imports them itself. Application projects receive `phx` as a global. Storybook examples cannot rely on that project environment, so these files import it from `../../.phoenix/phx.js`; leave that import out in a project.
|
|
163
|
+
|
|
164
|
+
## What the layout has to do
|
|
165
|
+
|
|
166
|
+
- **Position the root and cover the page.** `LayoutSlots.SharedCanvas` is absolutely positioned and fills its nearest positioned ancestor. The root here is `position: absolute; inset: 0`.
|
|
167
|
+
- **Mount the shared canvas.** The app loader stays on screen until the scene has loaded. A layout without `LayoutSlots.SharedCanvas` never gets past the loader unless the project sets `appLoader: legacy`.
|
|
168
|
+
- **Put the UI above the canvas.** The canvas is opaque. Content that is positioned and comes after it in the markup is painted above it; unpositioned content is painted under it and cannot be seen.
|
|
169
|
+
- **Tell the camera where the free area is.** `useSceneSafeArea()` returns two refs. `containerRef` goes on the element that covers the whole canvas, `safeAreaRef` on the region the product should stay visible in, here everything right of the panel, or above the sheet on a phone. The camera then frames the product in that region. The hook measures again whenever either of the two elements resizes; for a change no resize reports, such as a `transform` on an ancestor settling at the end of an animation, it also returns `update` to call. Without the two refs the product is centred in the whole canvas and sits against the panel.
|
|
170
|
+
- **Let the pointer through.** The safe-area element lies over the canvas, so it sets `pointerEvents: 'none'`; otherwise the scene cannot be orbited. The fullscreen button inside it switches pointer events back on.
|
|
171
|
+
- **Honour fullscreen.** Fullscreen is a flag in the product's state, not a browser feature. The layout reads it with `phx.frontend.useIsFullscreenActive()`, removes the panel or the sheet and lets the safe area cover the canvas, so the camera frames the product in the whole canvas.
|
|
172
|
+
- **Fit the width it is given.** The configurator can be embedded in a narrow column or opened on a phone. The layout reads the container's width class with `useActiveViewports()` and renders a desktop or a phone arrangement, see [Fit a phone](#fit-a-phone).
|
|
173
|
+
- **Serve read mode.** The same element renders a configuration shared for viewing, and the layout decides what a viewer sees.
|
|
174
|
+
|
|
175
|
+
## Read and change the product
|
|
176
|
+
|
|
177
|
+
The panel reads everything it shows from hooks and writes the customer's choice back through one of them. The table lists the hooks the whole layout uses:
|
|
178
|
+
|
|
179
|
+
```tsx
|
|
180
|
+
import { Box, Button, Typography } from '@mui/material'
|
|
181
|
+
|
|
182
|
+
import { detailComponent, finalizeActionComponent } from '@salsita-ai/sdk/domain'
|
|
183
|
+
import { PhoenixHandlerBoundary, useResolveLocalizable } from '@salsita-ai/sdk/react'
|
|
184
|
+
|
|
185
|
+
import { phx } from '../../.phoenix/phx.js'
|
|
186
|
+
import { EdgeFinishCards } from './EdgeFinishCards.js'
|
|
187
|
+
import { ReviewActions } from './ReviewActions.js'
|
|
188
|
+
|
|
189
|
+
const BUTTON_SX = { minBlockSize: 48, borderRadius: 999, textTransform: 'none', fontWeight: 600 } as const
|
|
190
|
+
|
|
191
|
+
interface ProductPanelProps {
|
|
192
|
+
// Only the name, the price and the action, for a collapsed bottom sheet
|
|
193
|
+
readonly collapsed?: boolean
|
|
194
|
+
// In a bottom sheet the cards region keeps the top of the cards in view, and the sheet scrolls when that does not fit
|
|
195
|
+
readonly inSheet?: boolean
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
export const ProductPanel = ({ collapsed = false, inSheet = false }: ProductPanelProps) => {
|
|
199
|
+
const resolve = useResolveLocalizable()
|
|
200
|
+
const detail = phx.frontend.useFirstRootComponent(detailComponent)
|
|
201
|
+
const price = phx.frontend.useRootEntityPrice()
|
|
202
|
+
const tableId = phx.frontend.useRootEntityId()
|
|
203
|
+
const edgeFinish = phx.frontend.useAttributeSelection(tableId, 'edgeFinish')
|
|
204
|
+
const { accessInfo } = phx.frontend.useAccessService()
|
|
205
|
+
const navigationState = phx.frontend.useActiveNavigationState()
|
|
206
|
+
const pushNavigate = phx.frontend.usePushNavigate()
|
|
207
|
+
const popNavigate = phx.frontend.usePopNavigate()
|
|
208
|
+
const navigate = phx.frontend.useNavigate()
|
|
209
|
+
const finalizeActions = phx.frontend.useComponents({ componentTypes: [finalizeActionComponent] }) ?? []
|
|
210
|
+
|
|
211
|
+
const isReadMode = accessInfo.viewMode
|
|
212
|
+
const isReview = isReadMode || navigationState !== 'configure'
|
|
213
|
+
// The spec's primary finalize action, or its first one
|
|
214
|
+
const quoteAction = finalizeActions.find(action => action.state.variant === 'primary') ?? finalizeActions[0]
|
|
215
|
+
const chosenEdge = edgeFinish.options.find(option => option.value === edgeFinish.value)
|
|
216
|
+
|
|
217
|
+
return (
|
|
218
|
+
<>
|
|
219
|
+
<Box component="header" sx={{ display: 'grid', gap: 1, padding: 3, paddingBlockEnd: 2 }}>
|
|
220
|
+
{isReadMode ? (
|
|
221
|
+
<Typography
|
|
222
|
+
variant="overline"
|
|
223
|
+
sx={{ justifySelf: 'start', paddingInline: 1.5, borderRadius: 999, bgcolor: 'action.selected' }}
|
|
224
|
+
>
|
|
225
|
+
View only
|
|
226
|
+
</Typography>
|
|
227
|
+
) : (
|
|
228
|
+
<Typography variant="overline" color="text.secondary">
|
|
229
|
+
{resolve(detail?.state.subtitle)}
|
|
230
|
+
</Typography>
|
|
231
|
+
)}
|
|
232
|
+
<Typography variant="h5" component="h2" fontWeight={700}>
|
|
233
|
+
{resolve(detail?.state.title)}
|
|
234
|
+
</Typography>
|
|
235
|
+
{!collapsed && (
|
|
236
|
+
<Typography variant="body2" color="text.secondary">
|
|
237
|
+
{resolve(detail?.state.description)}
|
|
238
|
+
</Typography>
|
|
239
|
+
)}
|
|
240
|
+
</Box>
|
|
241
|
+
|
|
242
|
+
{!collapsed && (
|
|
243
|
+
<Box
|
|
244
|
+
component="div"
|
|
245
|
+
sx={{
|
|
246
|
+
display: 'grid',
|
|
247
|
+
gap: 1.5,
|
|
248
|
+
paddingInline: 3,
|
|
249
|
+
paddingBlockEnd: 3,
|
|
250
|
+
// In a short container the region shrinks and scrolls; a scroll past its end moves its container on
|
|
251
|
+
minBlockSize: inSheet ? 120 : 0,
|
|
252
|
+
overflowY: 'auto',
|
|
253
|
+
}}
|
|
254
|
+
>
|
|
255
|
+
<Typography variant="subtitle2" component="h3">
|
|
256
|
+
Edge finish
|
|
257
|
+
</Typography>
|
|
258
|
+
{isReview ? (
|
|
259
|
+
<Box component="div" sx={{ padding: 2, borderRadius: 3, bgcolor: 'action.hover' }}>
|
|
260
|
+
<Typography variant="body2" fontWeight={600}>
|
|
261
|
+
{resolve(chosenEdge?.title)}
|
|
262
|
+
</Typography>
|
|
263
|
+
<Typography variant="caption" color="text.secondary">
|
|
264
|
+
{resolve(chosenEdge?.description)}
|
|
265
|
+
</Typography>
|
|
266
|
+
</Box>
|
|
267
|
+
) : (
|
|
268
|
+
<EdgeFinishCards selection={edgeFinish} />
|
|
269
|
+
)}
|
|
270
|
+
</Box>
|
|
271
|
+
)}
|
|
272
|
+
|
|
273
|
+
<Box component="footer" sx={{ display: 'grid', gap: 2, padding: 3, borderTop: 1, borderColor: 'divider' }}>
|
|
274
|
+
<Box component="div" sx={{ display: 'flex', alignItems: 'baseline', justifyContent: 'space-between' }}>
|
|
275
|
+
<Typography variant="body2" color="text.secondary">
|
|
276
|
+
Total price
|
|
277
|
+
</Typography>
|
|
278
|
+
<Typography variant="h5" component="p" fontWeight={700}>
|
|
279
|
+
{price}
|
|
280
|
+
</Typography>
|
|
281
|
+
</Box>
|
|
282
|
+
{!isReadMode && navigationState === 'configure' && (
|
|
283
|
+
<Button size="large" variant="contained" onClick={() => pushNavigate('checkout')} sx={BUTTON_SX}>
|
|
284
|
+
Review and request a quote
|
|
285
|
+
</Button>
|
|
286
|
+
)}
|
|
287
|
+
{!isReadMode && navigationState === 'checkout' && (
|
|
288
|
+
<>
|
|
289
|
+
<Typography variant="body2" color="text.secondary">
|
|
290
|
+
Your table is ready for a quote. A real shop collects the contact details here.
|
|
291
|
+
</Typography>
|
|
292
|
+
{quoteAction ? (
|
|
293
|
+
<PhoenixHandlerBoundary name={quoteAction.state.handler}>
|
|
294
|
+
<ReviewActions
|
|
295
|
+
handler={quoteAction.state.handler}
|
|
296
|
+
label={resolve(quoteAction.state.label)}
|
|
297
|
+
onBack={popNavigate}
|
|
298
|
+
/>
|
|
299
|
+
</PhoenixHandlerBoundary>
|
|
300
|
+
) : (
|
|
301
|
+
<Button size="large" variant="outlined" onClick={popNavigate} sx={BUTTON_SX}>
|
|
302
|
+
Back to the configuration
|
|
303
|
+
</Button>
|
|
304
|
+
)}
|
|
305
|
+
</>
|
|
306
|
+
)}
|
|
307
|
+
{!isReadMode && navigationState === 'requested' && (
|
|
308
|
+
<>
|
|
309
|
+
<Typography variant="body2" role="status">
|
|
310
|
+
Thank you. Your quote request is on its way, and the shop replies within two working days.
|
|
311
|
+
</Typography>
|
|
312
|
+
<Button size="large" variant="outlined" onClick={() => navigate('configure')} sx={BUTTON_SX}>
|
|
313
|
+
Back to the configuration
|
|
314
|
+
</Button>
|
|
315
|
+
</>
|
|
316
|
+
)}
|
|
317
|
+
</Box>
|
|
318
|
+
</>
|
|
319
|
+
)
|
|
320
|
+
}
|
|
321
|
+
```
|
|
322
|
+
|
|
323
|
+
| Hook | What the layout uses it for |
|
|
324
|
+
| ---------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
325
|
+
| `phx.frontend.useFirstRootComponent(detailComponent)` | The `detail` component of the root entity: name, subtitle and description. `detailComponent` comes from `@salsita-ai/sdk/domain`; the hook returns `null` without one. |
|
|
326
|
+
| `phx.frontend.useRootEntityId()` | The id of the table, which the control hooks take. |
|
|
327
|
+
| `phx.frontend.useAttributeSelection(entityId, instanceName)` | The `attributeSelection` component named `edgeFinish`: the current `value` and the `options`, each with `title`, `description`, `value`, `disabled` and `onSelect`. |
|
|
328
|
+
| `phx.frontend.useRootEntityPrice()` | The root entity's `price` component, formatted for the current locale and currency, or `null` without one. |
|
|
329
|
+
| `phx.frontend.useAccessService()` | `accessInfo.viewMode` is `true` while a configuration shared for viewing is open, and also while the host sets the `readonly` property. |
|
|
330
|
+
| `phx.frontend.useActiveNavigationState()` | The active navigation state; the panel shows its review step while it is `checkout`. |
|
|
331
|
+
| `phx.frontend.usePushNavigate()` and `phx.frontend.usePopNavigate()` | Enter the review step and leave it again. |
|
|
332
|
+
| `phx.frontend.useNavigate()` | Return from the confirmation to the configuration, forgetting the review step. |
|
|
333
|
+
| `phx.frontend.useComponents({ componentTypes: [finalizeActionComponent] })` | The spec's `finalizeAction` components; the panel offers the primary one in its review step. `finalizeActionComponent` comes from `@salsita-ai/sdk/domain`. |
|
|
334
|
+
| `phx.frontend.useFinalizeAction(handler)` | Run the finalize action's handler, with its pending state, its error and whether finalizing is possible; see [Request a quote](#request-a-quote). |
|
|
335
|
+
| `phx.frontend.useIsFullscreenActive()` and `phx.frontend.useSetFullscreen()` | Read the fullscreen flag, and set it from the layout's own button. |
|
|
336
|
+
| `phx.frontend.useActiveViewState()` and `phx.frontend.useSetViewState()` | Read the active view state, one of the spec's `viewStates`, to mark the active view button, and make another one active; see [Control the scene](#control-the-scene). |
|
|
337
|
+
| `phx.frontend.useResetCamera()` | Move the camera back to the framing of the active camera, undoing the customer's orbit, pan and zoom. |
|
|
338
|
+
| `phx.frontend.useUndoRedo()` | Not used here: whether there is a change to undo or redo, and `undo` and `redo`, for a layout's own undo and redo buttons; see [Known gaps](#known-gaps). |
|
|
339
|
+
| `useActiveViewports()` from `@salsita-ai/sdk/react` | The width classes of the configurator's container, or `null` before it is measured; the layout renders its phone arrangement unless it includes `desktop`, see [Fit a phone](#fit-a-phone). |
|
|
340
|
+
| `phx.frontend.useConfiguratorMessages(onMessage)` | Receive violations, side-effect hints and errors one by one, with their text resolved, for the layout's own toast; see [Show messages](#show-messages). |
|
|
341
|
+
| `useResolveLocalizable()` from `@salsita-ai/sdk/react` | Turns the localizable texts of the spec into strings in the current language. [Localization](?path=/docs/phoenix-localization--docs) describes it and `LocalizableMessage`. |
|
|
342
|
+
| `PhoenixHandlerBoundary` from `@salsita-ai/sdk/react` | Wraps the review step's buttons, so an edited handler takes effect without a reload. |
|
|
343
|
+
|
|
344
|
+
Calling an option's `onSelect` is the whole write: it changes `edgeFinish` on the table, the scene morphs the edge and the price expression recalculates. The option fields are named for display: the spec's `label` arrives as `title`, its `img` as `imageSrc`.
|
|
345
|
+
|
|
346
|
+
The review step is the layout's own: the button pushes the `checkout` navigation state, and the panel shows a summary instead of the cards. There **Request a quote** runs the spec's finalize action, whose handler moves the panel on to the `requested` state and its confirmation; see [Request a quote](#request-a-quote). A real shop collects the contact details in the review step before it sends the request.
|
|
347
|
+
|
|
348
|
+
## Draw the choices
|
|
349
|
+
|
|
350
|
+
The edge finish is a visual choice, so the panel shows it as cards with a drawing of each profile, as [Choosing a Control](?path=/docs/ux-guidelines-choosing-a-control--docs) recommends for shapes. The selected card has a border in the theme's primary colour, a tinted background and a check mark, so the state does not depend on colour alone. The cards form a radio group: the group has `role="radiogroup"` and a label, each card `role="radio"` and `aria-checked`, only the selected card is in the tab order, and the arrow keys move the selection, skipping disabled options, as in a native radio group. Each card is at least 44 pixels high and shows a focus ring for keyboard users.
|
|
351
|
+
|
|
352
|
+
```tsx
|
|
353
|
+
import { Box, ButtonBase, type SxProps, type Theme, Typography } from '@mui/material'
|
|
354
|
+
import type { KeyboardEvent } from 'react'
|
|
355
|
+
|
|
356
|
+
import { type UseAttributeSelection, useResolveLocalizable } from '@salsita-ai/sdk/react'
|
|
357
|
+
|
|
358
|
+
// Cross-sections of the tabletop's edge, keyed by the option values of the spec.
|
|
359
|
+
const EDGE_PROFILES: Readonly<Record<string, string>> = {
|
|
360
|
+
None: 'M0 4H32V20H0Z',
|
|
361
|
+
Facet: 'M0 4H26L32 10V14L26 20H0Z',
|
|
362
|
+
Round: 'M0 4H24A8 8 0 0 1 24 20H0Z',
|
|
363
|
+
TreeTrunk: 'M0 4H27C33 5 28 9 34 11C29 13 34 17 27 20H0Z',
|
|
364
|
+
}
|
|
365
|
+
|
|
366
|
+
const CHECK_BADGE: SxProps<Theme> = {
|
|
367
|
+
position: 'absolute',
|
|
368
|
+
insetBlockStart: 10,
|
|
369
|
+
insetInlineEnd: 10,
|
|
370
|
+
display: 'grid',
|
|
371
|
+
placeItems: 'center',
|
|
372
|
+
inlineSize: 22,
|
|
373
|
+
blockSize: 22,
|
|
374
|
+
borderRadius: '50%',
|
|
375
|
+
bgcolor: 'primary.main',
|
|
376
|
+
color: 'primary.contrastText',
|
|
377
|
+
fontSize: 13,
|
|
378
|
+
}
|
|
379
|
+
|
|
380
|
+
// Arrow keys move the selection between the cards, as in a native radio group.
|
|
381
|
+
const ARROW_STEPS: Readonly<Record<string, number | undefined>> = {
|
|
382
|
+
ArrowRight: 1,
|
|
383
|
+
ArrowDown: 1,
|
|
384
|
+
ArrowLeft: -1,
|
|
385
|
+
ArrowUp: -1,
|
|
386
|
+
}
|
|
387
|
+
|
|
388
|
+
interface EdgeFinishCardsProps {
|
|
389
|
+
readonly selection: ReturnType<UseAttributeSelection>
|
|
390
|
+
}
|
|
391
|
+
|
|
392
|
+
export const EdgeFinishCards = ({ selection }: EdgeFinishCardsProps) => {
|
|
393
|
+
const resolve = useResolveLocalizable()
|
|
394
|
+
const { options } = selection
|
|
395
|
+
// The card in the tab order: the selected one, or the first enabled one. Disabled cards are never in it.
|
|
396
|
+
const selectedIndex = options.findIndex(option => option.value === selection.value && !option.disabled)
|
|
397
|
+
const focusIndex = selectedIndex >= 0 ? selectedIndex : options.findIndex(option => !option.disabled)
|
|
398
|
+
|
|
399
|
+
const handleKeyDown = (event: KeyboardEvent<HTMLElement>, index: number) => {
|
|
400
|
+
const step = ARROW_STEPS[event.key]
|
|
401
|
+
|
|
402
|
+
if (step === undefined) {
|
|
403
|
+
return
|
|
404
|
+
}
|
|
405
|
+
|
|
406
|
+
event.preventDefault()
|
|
407
|
+
// The next enabled option in the arrow's direction, wrapping around; disabled options are skipped.
|
|
408
|
+
const count = options.length
|
|
409
|
+
const next = Array.from(
|
|
410
|
+
{ length: count - 1 },
|
|
411
|
+
(_, offset) => (((index + step * (offset + 1)) % count) + count) % count
|
|
412
|
+
).find(candidate => !options[candidate]?.disabled)
|
|
413
|
+
|
|
414
|
+
if (next === undefined) {
|
|
415
|
+
return
|
|
416
|
+
}
|
|
417
|
+
|
|
418
|
+
options[next]?.onSelect()
|
|
419
|
+
event.currentTarget.parentElement?.querySelectorAll<HTMLElement>('[role="radio"]')[next]?.focus()
|
|
420
|
+
}
|
|
421
|
+
|
|
422
|
+
return (
|
|
423
|
+
<Box
|
|
424
|
+
component="div"
|
|
425
|
+
role="radiogroup"
|
|
426
|
+
aria-label="Edge finish"
|
|
427
|
+
sx={{ display: 'grid', gridTemplateColumns: '1fr 1fr', gap: 1.5 }}
|
|
428
|
+
>
|
|
429
|
+
{options.map((option, index) => {
|
|
430
|
+
const isSelected = option.value === selection.value
|
|
431
|
+
|
|
432
|
+
return (
|
|
433
|
+
<ButtonBase
|
|
434
|
+
key={String(option.value)}
|
|
435
|
+
role="radio"
|
|
436
|
+
aria-checked={isSelected}
|
|
437
|
+
tabIndex={index === focusIndex ? 0 : -1}
|
|
438
|
+
disabled={option.disabled}
|
|
439
|
+
onClick={option.onSelect}
|
|
440
|
+
onKeyDown={event => handleKeyDown(event, index)}
|
|
441
|
+
sx={{
|
|
442
|
+
position: 'relative',
|
|
443
|
+
display: 'grid',
|
|
444
|
+
justifyItems: 'start',
|
|
445
|
+
gap: 0.5,
|
|
446
|
+
padding: 2,
|
|
447
|
+
borderRadius: 3,
|
|
448
|
+
border: 2,
|
|
449
|
+
borderColor: isSelected ? 'primary.main' : 'divider',
|
|
450
|
+
bgcolor: isSelected ? 'action.hover' : 'transparent',
|
|
451
|
+
textAlign: 'start',
|
|
452
|
+
transition: 'border-color 150ms, background-color 150ms',
|
|
453
|
+
'&:hover': { borderColor: isSelected ? 'primary.main' : 'text.disabled' },
|
|
454
|
+
'&.Mui-focusVisible': { outline: 2, outlineColor: 'primary.main', outlineOffset: 2 },
|
|
455
|
+
'&.Mui-disabled': { opacity: 0.4 },
|
|
456
|
+
}}
|
|
457
|
+
>
|
|
458
|
+
{isSelected && (
|
|
459
|
+
<Box component="span" aria-hidden sx={CHECK_BADGE}>
|
|
460
|
+
✓
|
|
461
|
+
</Box>
|
|
462
|
+
)}
|
|
463
|
+
<Box
|
|
464
|
+
component="svg"
|
|
465
|
+
viewBox="0 0 36 24"
|
|
466
|
+
aria-hidden
|
|
467
|
+
sx={{ inlineSize: 60, blockSize: 40, color: '#b98b5e' }}
|
|
468
|
+
>
|
|
469
|
+
<path d={EDGE_PROFILES[String(option.value)]} fill="currentColor" />
|
|
470
|
+
</Box>
|
|
471
|
+
<Typography variant="body2" fontWeight={600}>
|
|
472
|
+
{resolve(option.title)}
|
|
473
|
+
</Typography>
|
|
474
|
+
<Typography variant="caption" color="text.secondary">
|
|
475
|
+
{resolve(option.description)}
|
|
476
|
+
</Typography>
|
|
477
|
+
</ButtonBase>
|
|
478
|
+
)
|
|
479
|
+
})}
|
|
480
|
+
</Box>
|
|
481
|
+
)
|
|
482
|
+
}
|
|
483
|
+
```
|
|
484
|
+
|
|
485
|
+
The drawings are keyed by the option values of the spec. A spec can carry a picture per option instead, as `img`, which the hook returns as `imageSrc`; [CardSelect](?path=/docs/controls-select-attribute-cardselect--docs) shows the SDK's own card control.
|
|
486
|
+
|
|
487
|
+
## Offer fullscreen
|
|
488
|
+
|
|
489
|
+
Fullscreen is a flag in the configurator's state, not the browser's fullscreen mode. `phx.frontend.useIsFullscreenActive()` reads it and `phx.frontend.useSetFullscreen()` returns a function that sets it: `setFullscreen(true)` turns it on, `setFullscreen(false)` off. The layout's own button flips it, and the layout decides what to hide.
|
|
490
|
+
|
|
491
|
+
```tsx
|
|
492
|
+
import { Button, Tooltip } from '@mui/material'
|
|
493
|
+
|
|
494
|
+
import { phx } from '../../.phoenix/phx.js'
|
|
495
|
+
|
|
496
|
+
const ENTER_ICON = 'M4 9V4h5M15 4h5v5M20 15v5h-5M9 20H4v-5'
|
|
497
|
+
const EXIT_ICON = 'M9 4v5H4M15 4v5h5M15 20v-5h5M9 20v-5H4'
|
|
498
|
+
|
|
499
|
+
interface FullscreenToggleProps {
|
|
500
|
+
// Only the icon, with the label as its accessible name and tooltip, where a label would cover the product
|
|
501
|
+
readonly compact?: boolean
|
|
502
|
+
}
|
|
503
|
+
|
|
504
|
+
export const FullscreenToggle = ({ compact = false }: FullscreenToggleProps) => {
|
|
505
|
+
const isFullscreen = phx.frontend.useIsFullscreenActive()
|
|
506
|
+
const setFullscreen = phx.frontend.useSetFullscreen()
|
|
507
|
+
const label = isFullscreen ? 'Exit fullscreen' : 'Fullscreen'
|
|
508
|
+
const icon = (
|
|
509
|
+
<svg viewBox="0 0 24 24" width={20} height={20} fill="none" stroke="currentColor" strokeWidth={2}>
|
|
510
|
+
<path d={isFullscreen ? EXIT_ICON : ENTER_ICON} />
|
|
511
|
+
</svg>
|
|
512
|
+
)
|
|
513
|
+
|
|
514
|
+
return (
|
|
515
|
+
<Tooltip title={compact ? label : ''}>
|
|
516
|
+
<Button
|
|
517
|
+
onClick={() => setFullscreen(!isFullscreen)}
|
|
518
|
+
aria-label={compact ? label : undefined}
|
|
519
|
+
startIcon={compact ? undefined : icon}
|
|
520
|
+
sx={{
|
|
521
|
+
minBlockSize: 44,
|
|
522
|
+
minInlineSize: 44,
|
|
523
|
+
paddingInline: compact ? 0 : 2.5,
|
|
524
|
+
borderRadius: 999,
|
|
525
|
+
bgcolor: 'background.paper',
|
|
526
|
+
color: 'text.primary',
|
|
527
|
+
boxShadow: '0 4px 16px rgba(0, 0, 0, 0.12)',
|
|
528
|
+
textTransform: 'none',
|
|
529
|
+
fontWeight: 600,
|
|
530
|
+
'&:hover': { bgcolor: 'background.paper', boxShadow: '0 6px 20px rgba(0, 0, 0, 0.18)' },
|
|
531
|
+
}}
|
|
532
|
+
>
|
|
533
|
+
{compact ? icon : label}
|
|
534
|
+
</Button>
|
|
535
|
+
</Tooltip>
|
|
536
|
+
)
|
|
537
|
+
}
|
|
538
|
+
```
|
|
539
|
+
|
|
540
|
+
The button stays in the free area in both states, so the way back is always where the user left it. [Interaction Modes](?path=/docs/ux-guidelines-interaction-modes--docs#full-screen-preview) describes what fullscreen hides.
|
|
541
|
+
|
|
542
|
+
## Show messages
|
|
543
|
+
|
|
544
|
+
When a change is rejected because it breaks an invariant, when a committed change carries a hint, when an error is thrown while a change is validated, or when saving the configuration fails and later succeeds again, the configurator has a message for the customer. `phx.frontend.useConfiguratorMessages(onMessage)` calls `onMessage` once for each, with the text already in the customer's language, and the layout shows it its own way. Here a toast shows a message for six seconds, colored by its severity, at the bottom left of the free area above the view controls on a desktop, and at its top on a phone:
|
|
545
|
+
|
|
546
|
+
```tsx
|
|
547
|
+
import { Alert } from '@mui/material'
|
|
548
|
+
import { useEffect, useState } from 'react'
|
|
549
|
+
|
|
550
|
+
import type { ConfiguratorMessage } from '@salsita-ai/sdk/react'
|
|
551
|
+
|
|
552
|
+
import { phx } from '../../.phoenix/phx.js'
|
|
553
|
+
|
|
554
|
+
const VIOLATION_SEVERITY = { fatal: 'error', fixable: 'error', warning: 'warning', notice: 'info' } as const
|
|
555
|
+
const RANK = { info: 0, warning: 1, error: 2 } as const
|
|
556
|
+
const VISIBLE_MS = 6000
|
|
557
|
+
|
|
558
|
+
const severityOf = (message: ConfiguratorMessage) => {
|
|
559
|
+
if (message.kind === 'violation') {
|
|
560
|
+
return VIOLATION_SEVERITY[message.violation.severity]
|
|
561
|
+
}
|
|
562
|
+
|
|
563
|
+
return message.kind === 'error' || message.kind === 'saveError' ? 'error' : 'info'
|
|
564
|
+
}
|
|
565
|
+
|
|
566
|
+
export const MessageToast = () => {
|
|
567
|
+
const [message, setMessage] = useState<ConfiguratorMessage | null>(null)
|
|
568
|
+
|
|
569
|
+
// A rejected change also reports the notices already present; keep the worst message while it is shown
|
|
570
|
+
phx.frontend.useConfiguratorMessages(next => {
|
|
571
|
+
setMessage(shown => (shown !== null && RANK[severityOf(next)] < RANK[severityOf(shown)] ? shown : next))
|
|
572
|
+
})
|
|
573
|
+
|
|
574
|
+
useEffect(() => {
|
|
575
|
+
if (message === null) {
|
|
576
|
+
return
|
|
577
|
+
}
|
|
578
|
+
|
|
579
|
+
const timeout = setTimeout(() => setMessage(null), VISIBLE_MS)
|
|
580
|
+
|
|
581
|
+
return () => clearTimeout(timeout)
|
|
582
|
+
}, [message])
|
|
583
|
+
|
|
584
|
+
if (message === null) {
|
|
585
|
+
return null
|
|
586
|
+
}
|
|
587
|
+
|
|
588
|
+
return (
|
|
589
|
+
<Alert
|
|
590
|
+
severity={severityOf(message)}
|
|
591
|
+
onClose={() => setMessage(null)}
|
|
592
|
+
sx={{ maxInlineSize: 420, borderRadius: 3, boxShadow: '0 12px 40px rgba(0, 0, 0, 0.12)' }}
|
|
593
|
+
>
|
|
594
|
+
{message.text}
|
|
595
|
+
</Alert>
|
|
596
|
+
)
|
|
597
|
+
}
|
|
598
|
+
```
|
|
599
|
+
|
|
600
|
+
The hook takes a new function on every render without missing a message, so passing the state setter, or an inline function, is fine. `message.kind` is `'violation'`, `'sideEffect'`, `'error'`, `'saveError'` or `'saveRecovery'`; the toast shows an error and a failed save as errors, a hint and the save that succeeded again as information. A violation also carries `entityId` and the `violation` itself, with its `severity`. A rejected change brings one message for each violation of the rejected state, including notices and warnings that were already present, so the toast keeps the most severe message while it is shown instead of letting a later notice replace the reason for the rejection. The layout mounts the toast in the safe-area element, which sets `pointerEvents: 'none'`, so the toast's wrapper switches pointer events back on for the close button.
|
|
601
|
+
|
|
602
|
+
To give the toast something to show, the spec registers one transformer. Choosing **Tree trunk** keeps the change and adds a hint to it, which arrives as a `sideEffect` message:
|
|
603
|
+
|
|
604
|
+
```ts
|
|
605
|
+
import { msg } from '@lingui/core/macro'
|
|
606
|
+
|
|
607
|
+
import { phx } from '../../.phoenix/phx.js'
|
|
608
|
+
|
|
609
|
+
// A tree-trunk edge is cut by hand; choosing it carries a hint, which reaches the layout as a side-effect message
|
|
610
|
+
export default phx.frontend.transformerBuilder.when
|
|
611
|
+
.entity(['Table'])
|
|
612
|
+
.modified({ atFields: ['edgeFinish'] })
|
|
613
|
+
.then.overrideMatchingUpdate(({ update }) => {
|
|
614
|
+
if (update.stateDelta.edgeFinish !== 'TreeTrunk') {
|
|
615
|
+
return [update]
|
|
616
|
+
}
|
|
617
|
+
|
|
618
|
+
return [{ ...update, hint: msg`Tree trunk edges are cut by hand, so delivery takes three weeks longer.` }]
|
|
619
|
+
})
|
|
620
|
+
.build('tree-trunk-delivery')
|
|
621
|
+
```
|
|
622
|
+
|
|
623
|
+
[Configurator Interface → Loaded Configuration UI](?path=/docs/phoenix-configurator-interface--docs#loaded-configuration-ui) lists the messages the hook does not deliver: errors of the built-in finalize and other actions stay snackbars, and a failure to start from a preset is raised on the preset screen.
|
|
624
|
+
|
|
625
|
+
## Request a quote
|
|
626
|
+
|
|
627
|
+
The spec declares what finalizing means for this product as a `finalizeAction` component, and the project registers the handler it names:
|
|
628
|
+
|
|
629
|
+
```yaml
|
|
630
|
+
components:
|
|
631
|
+
Table:
|
|
632
|
+
finalizeAction:
|
|
633
|
+
quote:
|
|
634
|
+
variant: primary
|
|
635
|
+
label: Request a quote
|
|
636
|
+
title: Send the configuration to the shop for a quote
|
|
637
|
+
icon: PaperPlaneTilt
|
|
638
|
+
handler: requestQuote
|
|
639
|
+
```
|
|
640
|
+
|
|
641
|
+
```ts
|
|
642
|
+
import { useCallback } from 'react'
|
|
643
|
+
|
|
644
|
+
import { phx } from '../../.phoenix/phx.js'
|
|
645
|
+
|
|
646
|
+
// Stands in for the shop's quote service: the request takes a moment, then the panel shows the confirmation
|
|
647
|
+
export default phx.frontend.createPhoenixHandler('requestQuote', () => {
|
|
648
|
+
const navigate = phx.frontend.useNavigate()
|
|
649
|
+
|
|
650
|
+
return {
|
|
651
|
+
handler: useCallback(async () => {
|
|
652
|
+
await new Promise(resolve => setTimeout(resolve, 1500))
|
|
653
|
+
navigate('requested')
|
|
654
|
+
}, [navigate]),
|
|
655
|
+
}
|
|
656
|
+
})
|
|
657
|
+
```
|
|
658
|
+
|
|
659
|
+
The handler stands in for the shop's quote service: it waits a moment, as a request would, and then enters the `requested` navigation state, in which the panel thanks the customer. A handler is a hook factory, so it can use any hook, here `phx.frontend.useNavigate()`.
|
|
660
|
+
|
|
661
|
+
The panel lists the finalize actions with `phx.frontend.useComponents({ componentTypes: [finalizeActionComponent] })` and offers the primary one, or the first when none is primary, in its review step. It renders the review step's buttons in a component of their own inside `<PhoenixHandlerBoundary name={handler}>`, because `phx.frontend.useFinalizeAction(handler)` runs the project's handler factory: it is called once per component, never in a loop, and the boundary remounts the buttons when the handler is edited. **Back to the configuration** lives in the same component, so it can be disabled while the request is pending.
|
|
662
|
+
|
|
663
|
+
```tsx
|
|
664
|
+
import { Alert, Box, Button, CircularProgress, Typography } from '@mui/material'
|
|
665
|
+
|
|
666
|
+
import { phx } from '../../.phoenix/phx.js'
|
|
667
|
+
|
|
668
|
+
const BUTTON_SX = { minBlockSize: 48, borderRadius: 999, textTransform: 'none', fontWeight: 600 } as const
|
|
669
|
+
|
|
670
|
+
interface ReviewActionsProps {
|
|
671
|
+
readonly handler: string
|
|
672
|
+
readonly label: string
|
|
673
|
+
readonly onBack: () => void
|
|
674
|
+
}
|
|
675
|
+
|
|
676
|
+
// The review step's buttons: one finalize action and the way back. `useFinalizeAction` runs the action's handler,
|
|
677
|
+
// so this component calls it exactly once and is rendered inside a `PhoenixHandlerBoundary` for that handler.
|
|
678
|
+
// Back is disabled while the request is pending, so the customer cannot change the configuration while it is sent.
|
|
679
|
+
// The pending state belongs to this component: when the panel unmounts, as in fullscreen, the request goes on and
|
|
680
|
+
// the remounted buttons are enabled again.
|
|
681
|
+
export const ReviewActions = ({ handler, label, onBack }: ReviewActionsProps) => {
|
|
682
|
+
const { run, isPending, error, disabled, hints } = phx.frontend.useFinalizeAction(handler)
|
|
683
|
+
|
|
684
|
+
return (
|
|
685
|
+
<Box component="div" sx={{ display: 'grid', gap: 2 }}>
|
|
686
|
+
<Box component="div" sx={{ display: 'grid', gap: 1 }}>
|
|
687
|
+
<Button
|
|
688
|
+
size="large"
|
|
689
|
+
variant="contained"
|
|
690
|
+
disabled={disabled || isPending}
|
|
691
|
+
onClick={run}
|
|
692
|
+
startIcon={isPending ? <CircularProgress size={18} color="inherit" /> : undefined}
|
|
693
|
+
sx={BUTTON_SX}
|
|
694
|
+
>
|
|
695
|
+
{isPending ? 'Sending the request…' : label}
|
|
696
|
+
</Button>
|
|
697
|
+
{disabled && hints && (
|
|
698
|
+
<Typography variant="caption" color="text.secondary">
|
|
699
|
+
{hints}
|
|
700
|
+
</Typography>
|
|
701
|
+
)}
|
|
702
|
+
{error && <Alert severity="error">The request could not be sent: {error.message}</Alert>}
|
|
703
|
+
</Box>
|
|
704
|
+
<Button size="large" variant="outlined" disabled={isPending} onClick={onBack} sx={BUTTON_SX}>
|
|
705
|
+
Back to the configuration
|
|
706
|
+
</Button>
|
|
707
|
+
</Box>
|
|
708
|
+
)
|
|
709
|
+
}
|
|
710
|
+
```
|
|
711
|
+
|
|
712
|
+
- `run()` records the finalize-button click for analytics and runs the handler; it does nothing while `disabled` or `isPending`.
|
|
713
|
+
- While `isPending` the button shows a spinner and cannot be clicked again, and **Back to the configuration** is disabled, so the customer cannot change the configuration while it is sent. `isPending` and `error` belong to the mounted component: entering fullscreen unmounts the panel, the request goes on, and the panel shown after fullscreen starts with both buttons enabled. A layout that must rule that out keeps the review step mounted, or hides its fullscreen button while a request runs.
|
|
714
|
+
- `error` is what the handler rejected with. The layout shows it under the button; no snackbar is raised. It is cleared when the customer tries again.
|
|
715
|
+
- `disabled` and `hints` come from the configuration's violations: while a `warning` or worse holds, or the configuration failed to save, finalizing is not possible and `hints` says why.
|
|
716
|
+
|
|
717
|
+
The review step stays: a quote request is a commitment, so the customer sees the summary first, and a real shop collects the contact details there. A product that finalizes without a review offers the button in place of **Review and request a quote**. [Configurator Interface → Hooks for a Project Layout](?path=/docs/phoenix-configurator-interface--docs#hooks-for-a-project-layout) describes the hook, and [Finalization](?path=/docs/phoenix-finalization--docs) what a real flow does on the server.
|
|
718
|
+
|
|
719
|
+
## Serve read mode
|
|
720
|
+
|
|
721
|
+
While `accessInfo.viewMode` is `true` the panel marks the view as view only, replaces the cards with the chosen finish and shows the price without an action; the finalize action is not offered, since `useFinalizeAction` does not check read mode itself. The hooks do not hide or disable anything in read mode: what a viewer can change is decided by what the layout renders. Rotating and zooming the scene, and fullscreen, stay available, as [Interaction Modes](?path=/docs/ux-guidelines-interaction-modes--docs#view-only-mode) recommends. The button on the table's edge is hidden for viewers by the spec, see [Put a control on the product](#put-a-control-on-the-product).
|
|
722
|
+
|
|
723
|
+
## Fit a phone
|
|
724
|
+
|
|
725
|
+
A panel 380 pixels wide beside the scene leaves nothing of the table on a phone. Below a desktop width the layout puts the panel into a sheet at the bottom and lets the camera frame the table in the area above it. The layout above shows both arrangements.
|
|
726
|
+
|
|
727
|
+
**The switch.** `useActiveViewports()` from `@salsita-ai/sdk/react` returns the width classes the configurator's container satisfies. The container decides, not the window, so a configurator embedded in a narrow column of a wide page gets the phone arrangement too. The built-in layout switches on `desktop` as well.
|
|
728
|
+
|
|
729
|
+
| Value | When it is active |
|
|
730
|
+
| ----------- | ---------------------------------------------------------------------------------- |
|
|
731
|
+
| `phone` | The container is narrower than 480 pixels. |
|
|
732
|
+
| `mobile` | The container is at most 768 pixels wide. |
|
|
733
|
+
| `tablet` | The container is wider than 480 and narrower than 1024 pixels. |
|
|
734
|
+
| `desktop` | The container is wider than 768 pixels; `mobile` and `desktop` exclude each other. |
|
|
735
|
+
| `landscape` | The browser window, not the container, is wider than it is high. |
|
|
736
|
+
| `portrait` | The browser window, not the container, is higher than it is wide. |
|
|
737
|
+
|
|
738
|
+
The hook returns `null` until the container has been measured, and the layout renders only the scene until then, so a phone never shows the desktop panel for a frame.
|
|
739
|
+
|
|
740
|
+
**The sheet.** On a phone the layout is a column: the safe-area element takes the height the sheet leaves, and the sheet sits below it. The sheet has two positions. Collapsed, it shows the name, the price and the action; open, it shows the description and the cards too. The `collapsed` prop of the panel hides the description and the cards, and nothing else, and `inSheet` keeps the top of the cards in view. The sheet scrolls what does not fit, so the price, the review step, **Request a quote** and the thank-you message are reachable in both positions.
|
|
741
|
+
|
|
742
|
+
```tsx
|
|
743
|
+
import { Box, ButtonBase } from '@mui/material'
|
|
744
|
+
import { type MouseEvent, type PointerEvent, type ReactNode, useRef } from 'react'
|
|
745
|
+
|
|
746
|
+
// A drag shorter than this is a tap, and the handle's click toggles the sheet
|
|
747
|
+
const TAP_DISTANCE = 6
|
|
748
|
+
// A drag that ends this far from where it started snaps to the other position
|
|
749
|
+
const SNAP_DISTANCE = 48
|
|
750
|
+
// A drag faster than this, in pixels per millisecond, snaps in its direction even when it is short
|
|
751
|
+
const SNAP_VELOCITY = 0.5
|
|
752
|
+
// How far the sheet follows the finger towards the position it is already in
|
|
753
|
+
const OVERDRAG = 0.25
|
|
754
|
+
|
|
755
|
+
interface BottomSheetProps {
|
|
756
|
+
readonly open: boolean
|
|
757
|
+
readonly onOpenChange: (open: boolean) => void
|
|
758
|
+
readonly label: string
|
|
759
|
+
readonly children: ReactNode
|
|
760
|
+
}
|
|
761
|
+
|
|
762
|
+
interface Drag {
|
|
763
|
+
readonly startY: number
|
|
764
|
+
readonly startTime: number
|
|
765
|
+
delta: number
|
|
766
|
+
}
|
|
767
|
+
|
|
768
|
+
// A persistent sheet at the bottom of the layout with two positions, open and collapsed. It is not a modal: the scene
|
|
769
|
+
// above it stays interactive. Its height comes from its content, so the layout's safe area ends where the sheet
|
|
770
|
+
// starts and changes only when the sheet snaps. While the handle is dragged the sheet follows the finger with a
|
|
771
|
+
// transform, which the safe area does not see, so the camera refits once per snap and not on every move.
|
|
772
|
+
export const BottomSheet = ({ open, onOpenChange, label, children }: BottomSheetProps) => {
|
|
773
|
+
const sheetRef = useRef<HTMLElement>(null)
|
|
774
|
+
const dragRef = useRef<Drag | null>(null)
|
|
775
|
+
const draggedRef = useRef(false)
|
|
776
|
+
|
|
777
|
+
const moveSheet = (offset: number, animate: boolean) => {
|
|
778
|
+
if (sheetRef.current) {
|
|
779
|
+
sheetRef.current.style.transition = animate ? 'transform 200ms ease-out' : 'none'
|
|
780
|
+
sheetRef.current.style.transform = offset === 0 ? '' : `translateY(${offset}px)`
|
|
781
|
+
}
|
|
782
|
+
}
|
|
783
|
+
|
|
784
|
+
const handlePointerDown = (event: PointerEvent<HTMLButtonElement>) => {
|
|
785
|
+
event.currentTarget.setPointerCapture(event.pointerId)
|
|
786
|
+
dragRef.current = { startY: event.clientY, startTime: event.timeStamp, delta: 0 }
|
|
787
|
+
draggedRef.current = false
|
|
788
|
+
}
|
|
789
|
+
|
|
790
|
+
const handlePointerMove = (event: PointerEvent<HTMLButtonElement>) => {
|
|
791
|
+
const drag = dragRef.current
|
|
792
|
+
|
|
793
|
+
if (drag === null) {
|
|
794
|
+
return
|
|
795
|
+
}
|
|
796
|
+
|
|
797
|
+
drag.delta = event.clientY - drag.startY
|
|
798
|
+
// Down closes an open sheet and up opens a collapsed one; the other direction only gives a little
|
|
799
|
+
const towardsOther = open ? drag.delta > 0 : drag.delta < 0
|
|
800
|
+
moveSheet(towardsOther ? drag.delta : drag.delta * OVERDRAG, false)
|
|
801
|
+
}
|
|
802
|
+
|
|
803
|
+
const handlePointerEnd = (event: PointerEvent<HTMLButtonElement>) => {
|
|
804
|
+
const drag = dragRef.current
|
|
805
|
+
dragRef.current = null
|
|
806
|
+
|
|
807
|
+
if (drag === null) {
|
|
808
|
+
return
|
|
809
|
+
}
|
|
810
|
+
|
|
811
|
+
moveSheet(0, true)
|
|
812
|
+
|
|
813
|
+
if (Math.abs(drag.delta) < TAP_DISTANCE) {
|
|
814
|
+
return
|
|
815
|
+
}
|
|
816
|
+
|
|
817
|
+
draggedRef.current = true
|
|
818
|
+
const velocity = drag.delta / Math.max(event.timeStamp - drag.startTime, 1)
|
|
819
|
+
const flicked = Math.abs(drag.delta) >= SNAP_DISTANCE || Math.abs(velocity) >= SNAP_VELOCITY
|
|
820
|
+
|
|
821
|
+
if (flicked && (open ? drag.delta > 0 : drag.delta < 0)) {
|
|
822
|
+
onOpenChange(!open)
|
|
823
|
+
}
|
|
824
|
+
}
|
|
825
|
+
|
|
826
|
+
// A tap, Enter or Space toggles the sheet. The pointer click that ends a drag has already been handled; a keyboard
|
|
827
|
+
// click (`detail` 0) always toggles, also after a touch drag that was followed by no click.
|
|
828
|
+
const handleClick = (event: MouseEvent<HTMLButtonElement>) => {
|
|
829
|
+
const dragged = draggedRef.current
|
|
830
|
+
draggedRef.current = false
|
|
831
|
+
|
|
832
|
+
if (dragged && event.detail !== 0) {
|
|
833
|
+
return
|
|
834
|
+
}
|
|
835
|
+
|
|
836
|
+
onOpenChange(!open)
|
|
837
|
+
}
|
|
838
|
+
|
|
839
|
+
return (
|
|
840
|
+
<Box
|
|
841
|
+
component="section"
|
|
842
|
+
ref={sheetRef}
|
|
843
|
+
aria-label={label}
|
|
844
|
+
sx={{
|
|
845
|
+
position: 'relative',
|
|
846
|
+
flexShrink: 0,
|
|
847
|
+
display: 'flex',
|
|
848
|
+
flexDirection: 'column',
|
|
849
|
+
maxBlockSize: '55%',
|
|
850
|
+
paddingBlockEnd: 'env(safe-area-inset-bottom)',
|
|
851
|
+
borderStartStartRadius: 20,
|
|
852
|
+
borderStartEndRadius: 20,
|
|
853
|
+
bgcolor: 'background.paper',
|
|
854
|
+
boxShadow: '0 -8px 32px rgba(0, 0, 0, 0.12)',
|
|
855
|
+
// Fills the gap below the sheet while it is dragged up
|
|
856
|
+
'&::after': {
|
|
857
|
+
content: '""',
|
|
858
|
+
position: 'absolute',
|
|
859
|
+
insetInline: 0,
|
|
860
|
+
insetBlockStart: '100%',
|
|
861
|
+
blockSize: '100vh',
|
|
862
|
+
bgcolor: 'background.paper',
|
|
863
|
+
},
|
|
864
|
+
}}
|
|
865
|
+
>
|
|
866
|
+
<ButtonBase
|
|
867
|
+
aria-expanded={open}
|
|
868
|
+
disableRipple
|
|
869
|
+
aria-label={open ? `Collapse ${label.toLowerCase()}` : `Expand ${label.toLowerCase()}`}
|
|
870
|
+
onClick={handleClick}
|
|
871
|
+
onPointerDown={handlePointerDown}
|
|
872
|
+
onPointerMove={handlePointerMove}
|
|
873
|
+
onPointerUp={handlePointerEnd}
|
|
874
|
+
onPointerCancel={handlePointerEnd}
|
|
875
|
+
sx={{
|
|
876
|
+
flexShrink: 0,
|
|
877
|
+
blockSize: 36,
|
|
878
|
+
touchAction: 'none',
|
|
879
|
+
'&.Mui-focusVisible': { outline: 2, outlineColor: 'primary.main', outlineOffset: -4, borderRadius: 3 },
|
|
880
|
+
}}
|
|
881
|
+
>
|
|
882
|
+
<Box component="span" sx={{ inlineSize: 40, blockSize: 4, borderRadius: 2, bgcolor: 'text.disabled' }} />
|
|
883
|
+
</ButtonBase>
|
|
884
|
+
{/* A column, so the panel's cards region shrinks first and the price and action stay in view; below the cards
|
|
885
|
+
region's minimum height the content scrolls as a whole, as the review step does on a short phone */}
|
|
886
|
+
<Box
|
|
887
|
+
component="div"
|
|
888
|
+
sx={{
|
|
889
|
+
display: 'flex',
|
|
890
|
+
flexDirection: 'column',
|
|
891
|
+
flex: '1 1 auto',
|
|
892
|
+
minBlockSize: 0,
|
|
893
|
+
overflowY: 'auto',
|
|
894
|
+
overscrollBehavior: 'contain',
|
|
895
|
+
}}
|
|
896
|
+
>
|
|
897
|
+
{children}
|
|
898
|
+
</Box>
|
|
899
|
+
</Box>
|
|
900
|
+
)
|
|
901
|
+
}
|
|
902
|
+
```
|
|
903
|
+
|
|
904
|
+
- The handle is a real button with `aria-expanded`. A tap, Enter or Space toggles the sheet, and dragging it up or down snaps the sheet to the other position when the drag is long or fast enough. `touchAction: 'none'` is set on the handle only, so the cards still scroll by touch.
|
|
905
|
+
- The sheet's height comes from its content and is at most 55% of the configurator; when the content does not fit, the cards region shrinks until only the top of the cards shows and scrolls, and below that the sheet's content scrolls as a whole. On a phone with room for the header, the top of the cards and the footer, the price and the action stay in view with the sheet open; on a shorter one the customer scrolls the sheet to them, and the review step's buttons are reached the same way in both positions. A scroll on the cards that reaches their end moves the sheet on. Because the safe-area element is its neighbour in the column, the free area ends where the sheet starts without anything being measured by the layout.
|
|
906
|
+
- While the handle is dragged the sheet follows the finger with a `transform`. `useSceneSafeArea()` does not see a transform, so the free area changes once, when the sheet snaps, and the camera refits once. A safe area that followed the finger would refit the camera on every move and reset an orbit the customer made.
|
|
907
|
+
- The sheet is not a modal: no backdrop covers the scene, so the table can be orbited with one finger and zoomed with two while the sheet is open. MUI's temporary `Drawer` and `SwipeableDrawer` are modals and would block the scene; their persistent and permanent variants have no backdrop, but no drag handle with two positions either.
|
|
908
|
+
|
|
909
|
+
**What else moves.** The toast sits at the top of the free area, so it does not cover the sheet's handle, and the fullscreen button shows only its icon, with its label as tooltip and accessible name, so the toast has room beside it. Fullscreen removes the sheet as it removes the panel on a desktop. The sheet keeps its position while fullscreen is on.
|
|
910
|
+
|
|
911
|
+
**A camera for the phone.** The desktop camera is close enough to fill a wide free area, and on a narrow one it cuts off the ends of the table. So each camera has a filter on the viewport: the desktop camera `main` applies while `desktop` is active, and a second camera, `phone`, with a larger distance frames the whole table while `mobile` is. The filters exclude each other once the container is measured. Before that, for example when an image of the configuration is rendered, no viewport is known and a viewport filter matches, so both cameras apply and the higher priority of `main` decides:
|
|
912
|
+
|
|
913
|
+
```yaml
|
|
914
|
+
components:
|
|
915
|
+
Table:
|
|
916
|
+
fitRootPerspectiveCamera:
|
|
917
|
+
main:
|
|
918
|
+
priority: 2
|
|
919
|
+
fov: 35
|
|
920
|
+
near: 100
|
|
921
|
+
far: 10000
|
|
922
|
+
minDistance: 1000
|
|
923
|
+
maxDistance: 9000
|
|
924
|
+
distance: 5000
|
|
925
|
+
azimuthAngle: 1.5
|
|
926
|
+
polarAngle: 1.1
|
|
927
|
+
fitMeshChanges: true
|
|
928
|
+
$filter:
|
|
929
|
+
viewports: [desktop]
|
|
930
|
+
phone:
|
|
931
|
+
priority: 1
|
|
932
|
+
fov: 35
|
|
933
|
+
near: 100
|
|
934
|
+
far: 10000
|
|
935
|
+
minDistance: 1000
|
|
936
|
+
maxDistance: 12000
|
|
937
|
+
distance: 8000
|
|
938
|
+
azimuthAngle: 1.5
|
|
939
|
+
polarAngle: 1.1
|
|
940
|
+
fitMeshChanges: true
|
|
941
|
+
$filter:
|
|
942
|
+
viewports: [mobile]
|
|
943
|
+
```
|
|
944
|
+
|
|
945
|
+
## Put a control on the product
|
|
946
|
+
|
|
947
|
+
The edge finish is a detail of the tabletop, so the layout also offers it on the table itself: a round button on the middle of the long edge opens the four finishes next to the edge. On a phone it is a way to change the edge without opening the sheet.
|
|
948
|
+
|
|
949
|
+
A control in the scene is a spec component that names an element of the project. `htmlHotspot` places an HTML element at an offset from the entity's origin, in the model's units, here millimetres: half the table's depth towards the camera and just below the top's surface. Its `$filter` shows it only to the owner and only while the `configure` navigation state is active, so a viewer and the review step do not get it, and the element does not check either itself:
|
|
950
|
+
|
|
951
|
+
```yaml
|
|
952
|
+
components:
|
|
953
|
+
Table:
|
|
954
|
+
htmlHotspot:
|
|
955
|
+
edgeFinish:
|
|
956
|
+
name: EdgeFinishHotspot
|
|
957
|
+
offsetX: 500
|
|
958
|
+
offsetY: 800
|
|
959
|
+
offsetZ: 0
|
|
960
|
+
$filter:
|
|
961
|
+
modes: [owner]
|
|
962
|
+
navigationStates: [configure]
|
|
963
|
+
```
|
|
964
|
+
|
|
965
|
+
The element is registered with `phx.frontend.createCustomPhoenixEntityElement` under the name the spec gives. It receives the id of the entity the hotspot belongs to, and reads the same `attributeSelection` the panel reads:
|
|
966
|
+
|
|
967
|
+
```tsx
|
|
968
|
+
import { Box, ButtonBase, Popover, Tooltip } from '@mui/material'
|
|
969
|
+
import { useState } from 'react'
|
|
970
|
+
|
|
971
|
+
import { phx } from '../../.phoenix/phx.js'
|
|
972
|
+
import { EdgeFinishCards } from '../_shared/EdgeFinishCards.js'
|
|
973
|
+
|
|
974
|
+
// The edge profile the button shows, the square edge of the cards' drawings
|
|
975
|
+
const EDGE_ICON = 'M3 7H17L21 11V13L17 17H3Z'
|
|
976
|
+
|
|
977
|
+
// Rendered by the spec's `htmlHotspot` on the table's edge: a button on the product that opens the edge finishes
|
|
978
|
+
// next to the edge, with the same cards as the panel. The spec's `$filter` decides when it is shown.
|
|
979
|
+
export default phx.frontend.createCustomPhoenixEntityElement('EdgeFinishHotspot', ({ entityId }) => {
|
|
980
|
+
const edgeFinish = phx.frontend.useAttributeSelection(entityId, 'edgeFinish')
|
|
981
|
+
const [anchor, setAnchor] = useState<HTMLElement | null>(null)
|
|
982
|
+
|
|
983
|
+
return (
|
|
984
|
+
<>
|
|
985
|
+
<Tooltip title="Edge finish">
|
|
986
|
+
<ButtonBase
|
|
987
|
+
aria-label="Edge finish"
|
|
988
|
+
aria-haspopup="dialog"
|
|
989
|
+
aria-expanded={anchor !== null}
|
|
990
|
+
onClick={event => setAnchor(event.currentTarget)}
|
|
991
|
+
sx={{
|
|
992
|
+
display: 'grid',
|
|
993
|
+
placeItems: 'center',
|
|
994
|
+
inlineSize: 44,
|
|
995
|
+
blockSize: 44,
|
|
996
|
+
borderRadius: '50%',
|
|
997
|
+
bgcolor: 'background.paper',
|
|
998
|
+
color: 'primary.main',
|
|
999
|
+
boxShadow: '0 4px 16px rgba(0, 0, 0, 0.2)',
|
|
1000
|
+
'&.Mui-focusVisible': { outline: 2, outlineColor: 'primary.main', outlineOffset: 2 },
|
|
1001
|
+
}}
|
|
1002
|
+
>
|
|
1003
|
+
<svg viewBox="0 0 24 24" width={22} height={22} aria-hidden>
|
|
1004
|
+
<path d={EDGE_ICON} fill="currentColor" />
|
|
1005
|
+
</svg>
|
|
1006
|
+
</ButtonBase>
|
|
1007
|
+
</Tooltip>
|
|
1008
|
+
<Popover
|
|
1009
|
+
open={anchor !== null}
|
|
1010
|
+
anchorEl={anchor}
|
|
1011
|
+
onClose={() => setAnchor(null)}
|
|
1012
|
+
anchorOrigin={{ vertical: 'top', horizontal: 'center' }}
|
|
1013
|
+
transformOrigin={{ vertical: 'bottom', horizontal: 'center' }}
|
|
1014
|
+
slotProps={{
|
|
1015
|
+
paper: { role: 'dialog', 'aria-label': 'Edge finish', sx: { borderRadius: 4, marginBlockStart: -1 } },
|
|
1016
|
+
}}
|
|
1017
|
+
>
|
|
1018
|
+
<Box component="div" sx={{ inlineSize: 340, maxInlineSize: 'calc(100vw - 32px)', padding: 2 }}>
|
|
1019
|
+
<EdgeFinishCards selection={edgeFinish} />
|
|
1020
|
+
</Box>
|
|
1021
|
+
</Popover>
|
|
1022
|
+
</>
|
|
1023
|
+
)
|
|
1024
|
+
})
|
|
1025
|
+
```
|
|
1026
|
+
|
|
1027
|
+
- The hotspot is rendered inside the scene, but it has the theme and every `phx.frontend` hook, like the layout. MUI's `Popover` and `Tooltip` render into the configurator's own modal root, so they are styled and work inside its shadow root.
|
|
1028
|
+
- The cards in the popover are the panel's `EdgeFinishCards`, used a second time. A choice changes the edge, the price and the panel's cards at once, and the popover stays open so the customer can compare the finishes on the table.
|
|
1029
|
+
- Keyboard: the button is in the tab order, Enter and Space open the popover and move the focus into it, the arrow keys change the finish, and Escape closes it and returns the focus to the button.
|
|
1030
|
+
- `controlHotspot: true` would hide the hotspot while a change is being applied, which would also unmount the open popover on every choice, so this hotspot does not set it.
|
|
1031
|
+
- The scene's HTML is painted inside the canvas's stacking context, under the layout's panel and sheet. A hotspot that a panel covers cannot be clicked there.
|
|
1032
|
+
|
|
1033
|
+
[Html Hotspots](?path=/docs/controls-scene-html-hotspots--docs) describes the component and its other properties.
|
|
1034
|
+
|
|
1035
|
+
## Control the scene
|
|
1036
|
+
|
|
1037
|
+
The four finishes differ by a few millimetres on a table two metres long, so from the default distance the difference is hard to judge. The layout offers two views, **Whole table** and **Edge close-up**, a close and low look at a corner of the top, and a **Reset view** button that brings back the framing after the customer has orbited, panned or zoomed.
|
|
1038
|
+
|
|
1039
|
+
**Views are view states.** The spec lists them, and each camera says by its `$filter` in which view states and at which widths it applies. The two close-up cameras have the highest priorities and apply only in the `edge` view state, the desktop one with `desktop` and the phone one with `mobile`, a little farther away. In the `overview` view state, the first in the list and so the initial one, only the two whole-table cameras of [Fit a phone](#fit-a-phone) apply. A camera always looks at the middle of the table, so the close-up shows the near corner, where the edge profile is seen on both sides:
|
|
1040
|
+
|
|
1041
|
+
```yaml
|
|
1042
|
+
viewStates:
|
|
1043
|
+
- overview
|
|
1044
|
+
- edge
|
|
1045
|
+
|
|
1046
|
+
components:
|
|
1047
|
+
Table:
|
|
1048
|
+
fitRootPerspectiveCamera:
|
|
1049
|
+
edge:
|
|
1050
|
+
priority: 4
|
|
1051
|
+
fov: 35
|
|
1052
|
+
near: 100
|
|
1053
|
+
far: 10000
|
|
1054
|
+
minDistance: 800
|
|
1055
|
+
maxDistance: 9000
|
|
1056
|
+
distance: 2000
|
|
1057
|
+
azimuthAngle: 0.5
|
|
1058
|
+
polarAngle: 1.15
|
|
1059
|
+
fitMeshChanges: true
|
|
1060
|
+
$filter:
|
|
1061
|
+
viewports: [desktop]
|
|
1062
|
+
viewStates: [edge]
|
|
1063
|
+
edgePhone:
|
|
1064
|
+
priority: 3
|
|
1065
|
+
fov: 35
|
|
1066
|
+
near: 100
|
|
1067
|
+
far: 10000
|
|
1068
|
+
minDistance: 800
|
|
1069
|
+
maxDistance: 12000
|
|
1070
|
+
distance: 3000
|
|
1071
|
+
azimuthAngle: 0.5
|
|
1072
|
+
polarAngle: 1.15
|
|
1073
|
+
fitMeshChanges: true
|
|
1074
|
+
$filter:
|
|
1075
|
+
viewports: [mobile]
|
|
1076
|
+
viewStates: [edge]
|
|
1077
|
+
```
|
|
1078
|
+
|
|
1079
|
+
**The buttons.** `phx.frontend.useActiveViewState()` returns the active view state and `phx.frontend.useSetViewState()` a function that makes another one active; the camera then moves to the camera of that view state. `phx.frontend.useResetCamera()` returns a function that moves the camera back to the framing of the active camera, the whole table or the close-up:
|
|
1080
|
+
|
|
1081
|
+
```tsx
|
|
1082
|
+
import { Box, Button, Tooltip } from '@mui/material'
|
|
1083
|
+
|
|
1084
|
+
import { phx } from '../../.phoenix/phx.js'
|
|
1085
|
+
|
|
1086
|
+
// The spec's view states, each with the label of the button that shows it
|
|
1087
|
+
const VIEWS = [
|
|
1088
|
+
{ state: 'overview', label: 'Whole table' },
|
|
1089
|
+
{ state: 'edge', label: 'Edge close-up' },
|
|
1090
|
+
] as const
|
|
1091
|
+
|
|
1092
|
+
const RESET_ICON = 'M4 12a8 8 0 1 0 2.4-5.7M4 4v4h4'
|
|
1093
|
+
|
|
1094
|
+
const SURFACE_SX = {
|
|
1095
|
+
borderRadius: 999,
|
|
1096
|
+
bgcolor: 'background.paper',
|
|
1097
|
+
boxShadow: '0 4px 16px rgba(0, 0, 0, 0.12)',
|
|
1098
|
+
} as const
|
|
1099
|
+
|
|
1100
|
+
const BUTTON_SX = {
|
|
1101
|
+
minBlockSize: 44,
|
|
1102
|
+
minInlineSize: 44,
|
|
1103
|
+
borderRadius: 999,
|
|
1104
|
+
textTransform: 'none',
|
|
1105
|
+
fontWeight: 600,
|
|
1106
|
+
whiteSpace: 'nowrap',
|
|
1107
|
+
} as const
|
|
1108
|
+
|
|
1109
|
+
interface SceneControlsProps {
|
|
1110
|
+
// The reset button shows only its icon, with its label as tooltip and accessible name
|
|
1111
|
+
readonly compact?: boolean
|
|
1112
|
+
// Only the reset button, without the view buttons
|
|
1113
|
+
readonly resetOnly?: boolean
|
|
1114
|
+
}
|
|
1115
|
+
|
|
1116
|
+
// The layout's own camera controls: one button per view state of the spec, and a reset that undoes an orbit
|
|
1117
|
+
export const SceneControls = ({ compact = false, resetOnly = false }: SceneControlsProps) => {
|
|
1118
|
+
const activeView = phx.frontend.useActiveViewState()
|
|
1119
|
+
const setViewState = phx.frontend.useSetViewState()
|
|
1120
|
+
const resetCamera = phx.frontend.useResetCamera()
|
|
1121
|
+
const resetIcon = (
|
|
1122
|
+
<svg viewBox="0 0 24 24" width={20} height={20} fill="none" stroke="currentColor" strokeWidth={2}>
|
|
1123
|
+
<path d={RESET_ICON} />
|
|
1124
|
+
</svg>
|
|
1125
|
+
)
|
|
1126
|
+
|
|
1127
|
+
return (
|
|
1128
|
+
<Box component="div" sx={{ display: 'flex', gap: 1 }}>
|
|
1129
|
+
{!resetOnly && (
|
|
1130
|
+
<Box component="div" role="group" aria-label="View" sx={{ ...SURFACE_SX, display: 'flex' }}>
|
|
1131
|
+
{VIEWS.map(view => {
|
|
1132
|
+
const isActive = activeView === view.state
|
|
1133
|
+
|
|
1134
|
+
return (
|
|
1135
|
+
<Button
|
|
1136
|
+
key={view.state}
|
|
1137
|
+
aria-pressed={isActive}
|
|
1138
|
+
onClick={() => setViewState(view.state)}
|
|
1139
|
+
sx={{
|
|
1140
|
+
...BUTTON_SX,
|
|
1141
|
+
paddingInline: 2,
|
|
1142
|
+
bgcolor: isActive ? 'text.primary' : 'transparent',
|
|
1143
|
+
color: isActive ? 'background.paper' : 'text.primary',
|
|
1144
|
+
'&:hover': { bgcolor: isActive ? 'text.primary' : 'action.hover' },
|
|
1145
|
+
}}
|
|
1146
|
+
>
|
|
1147
|
+
{view.label}
|
|
1148
|
+
</Button>
|
|
1149
|
+
)
|
|
1150
|
+
})}
|
|
1151
|
+
</Box>
|
|
1152
|
+
)}
|
|
1153
|
+
<Tooltip title={compact ? 'Reset view' : ''}>
|
|
1154
|
+
<Button
|
|
1155
|
+
onClick={resetCamera}
|
|
1156
|
+
aria-label={compact ? 'Reset view' : undefined}
|
|
1157
|
+
startIcon={compact ? undefined : resetIcon}
|
|
1158
|
+
sx={{
|
|
1159
|
+
...SURFACE_SX,
|
|
1160
|
+
...BUTTON_SX,
|
|
1161
|
+
paddingInline: compact ? 0 : 2,
|
|
1162
|
+
color: 'text.primary',
|
|
1163
|
+
'&:hover': { bgcolor: 'background.paper', boxShadow: '0 6px 20px rgba(0, 0, 0, 0.18)' },
|
|
1164
|
+
}}
|
|
1165
|
+
>
|
|
1166
|
+
{compact ? resetIcon : 'Reset view'}
|
|
1167
|
+
</Button>
|
|
1168
|
+
</Tooltip>
|
|
1169
|
+
</Box>
|
|
1170
|
+
)
|
|
1171
|
+
}
|
|
1172
|
+
```
|
|
1173
|
+
|
|
1174
|
+
- The view buttons are a group with `aria-pressed`, so a screen reader announces which view is active, and the active one is drawn dark, not only in another colour.
|
|
1175
|
+
- On a desktop the controls sit at the bottom right of the free area and the toast above its bottom left; on a phone they sit at the bottom of the free area, just above the sheet. On a phone, and on a desktop arrangement below 1024 pixels, where `tablet` is also active and the free area beside the panel is narrow, **Reset view** shows only its icon, with its label as tooltip and accessible name.
|
|
1176
|
+
- In fullscreen the controls stay on a desktop. On a phone the view buttons are hidden and **Reset view** stays, as [Interaction Modes](?path=/docs/ux-guidelines-interaction-modes--docs#full-screen-preview) describes for the built-in layout: on a phone the canvas is small and the product comes first, and the way back to the framed product is still needed after an orbit.
|
|
1177
|
+
- The controls stay in the review step and in read mode: changing the view changes nothing in the configuration, and a viewer may look at the product as closely as the customer.
|
|
1178
|
+
- The hooks need no `viewControls` component. That component configures the built-in layout's view controls and has no effect here.
|
|
1179
|
+
|
|
1180
|
+
## The spec the layout reads
|
|
1181
|
+
|
|
1182
|
+
The layout reads four components of the root entity and its navigation and view states; the scene components are in the complete implementation below. `SceneControls` names the view states `overview` and `edge` in its code, so they must match the spec's `viewStates`.
|
|
1183
|
+
|
|
1184
|
+
```yaml
|
|
1185
|
+
navigationStates:
|
|
1186
|
+
- configure
|
|
1187
|
+
- checkout
|
|
1188
|
+
- requested
|
|
1189
|
+
|
|
1190
|
+
viewStates:
|
|
1191
|
+
- overview
|
|
1192
|
+
- edge
|
|
1193
|
+
|
|
1194
|
+
components:
|
|
1195
|
+
Table:
|
|
1196
|
+
detail:
|
|
1197
|
+
main:
|
|
1198
|
+
title: Linden dining table
|
|
1199
|
+
subtitle: Solid oak, seats six
|
|
1200
|
+
description: A solid oak top on slender steel legs, finished with the edge profile of your choice.
|
|
1201
|
+
price:
|
|
1202
|
+
main:
|
|
1203
|
+
price:
|
|
1204
|
+
$read: $price
|
|
1205
|
+
attributeSelection:
|
|
1206
|
+
edgeFinish:
|
|
1207
|
+
value:
|
|
1208
|
+
$bind: edgeFinish
|
|
1209
|
+
options:
|
|
1210
|
+
- label: Square
|
|
1211
|
+
description: Crisp and modern
|
|
1212
|
+
value: None
|
|
1213
|
+
- label: Facet
|
|
1214
|
+
description: A light bevel
|
|
1215
|
+
value: Facet
|
|
1216
|
+
- label: Round
|
|
1217
|
+
description: Soft to the touch
|
|
1218
|
+
value: Round
|
|
1219
|
+
- label: Tree trunk
|
|
1220
|
+
description: The natural edge
|
|
1221
|
+
value: TreeTrunk
|
|
1222
|
+
finalizeAction:
|
|
1223
|
+
quote:
|
|
1224
|
+
variant: primary
|
|
1225
|
+
label: Request a quote
|
|
1226
|
+
title: Send the configuration to the shop for a quote
|
|
1227
|
+
icon: PaperPlaneTilt
|
|
1228
|
+
handler: requestQuote
|
|
1229
|
+
|
|
1230
|
+
transformers:
|
|
1231
|
+
- name: tree-trunk-delivery
|
|
1232
|
+
```
|
|
1233
|
+
|
|
1234
|
+
`$price` is a custom expression in `src/expressions/table.ts` that adds a surcharge per finish, and `tree-trunk-delivery` is the transformer in `src/transformers/tree-trunk-delivery.ts` that adds the hint shown in [Show messages](#show-messages), and `requestQuote` is the handler in `src/handlers/request-quote.ts`. The example sets no `applicationConfig` and no layout components: `layout`, the header, the sidebar footer, the toolbar, `viewControls` and property pages configure the built-in layout and have no effect on this one. The `finalizeAction` is not one of them: it describes the product's own finalizing, which this layout offers itself.
|
|
1235
|
+
|
|
1236
|
+
## Try the example
|
|
1237
|
+
|
|
1238
|
+
To see read mode, open **Mocks** in the editor rail on the left and apply the **Read User** template.
|
|
1239
|
+
|
|
1240
|
+
The same layout in a frame 390 pixels wide, as on a phone. Opened on its own from the sidebar, the **Phone** story sets Storybook's viewport to 390 × 844.
|
|
1241
|
+
|
|
1242
|
+
## Test cases
|
|
1243
|
+
|
|
1244
|
+
- The panel is on the left and the table is centred in the area to the right of it, not in the whole canvas.
|
|
1245
|
+
- Choosing **Tree trunk** moves the check mark to that card, changes the edge of the tabletop and raises the price from $1,290.00 to $1,630.00.
|
|
1246
|
+
- Choosing **Tree trunk** also shows "Tree trunk edges are cut by hand, so delivery takes three weeks longer." at the bottom left of the free area, above the view controls, until its close button is clicked or six seconds pass. Choosing another finish shows nothing.
|
|
1247
|
+
- Tab reaches the selected card, and the arrow keys move the selection to the next or previous card.
|
|
1248
|
+
- Dragging in the area to the right of the panel orbits the camera.
|
|
1249
|
+
- **Review and request a quote** replaces the cards with the chosen finish and offers **Request a quote**; **Back to the configuration** brings the cards back.
|
|
1250
|
+
- **Request a quote** shows a spinner and "Sending the request…" for about a second and a half, with **Back to the configuration** disabled, then "Thank you. Your quote request is on its way, and the shop replies within two working days."; **Back to the configuration** then returns to the cards.
|
|
1251
|
+
- **Fullscreen** removes the panel and the table moves to the centre of the canvas; **Exit fullscreen** brings both back.
|
|
1252
|
+
- With the **Read User** mock the panel says **View only**, shows the chosen finish and the price, and has no button, so no quote can be requested.
|
|
1253
|
+
- A round button sits on the middle of the table's long edge. Clicking it opens the four finishes next to it; choosing **Round** there moves the check mark in the popover and in the panel, rounds the edge and raises the price to $1,410.00. Escape closes the popover.
|
|
1254
|
+
- Tab reaches the button on the edge, and Enter or Space opens the popover.
|
|
1255
|
+
- The button on the edge is gone in the review step, in the confirmation and with the **Read User** mock, and stays in fullscreen.
|
|
1256
|
+
- In the **Phone** story the panel is a sheet at the bottom showing the name, the price and **Review and request a quote**, and the whole table is visible above it.
|
|
1257
|
+
- Tapping the sheet's handle, or dragging it up, opens the sheet with the cards; the table moves up once the sheet has snapped and stays fully visible. Dragging the handle down, or tapping it again, collapses the sheet.
|
|
1258
|
+
- On the phone, the review step, **Request a quote** and the thank-you message work with the sheet collapsed and open.
|
|
1259
|
+
- On the phone, choosing **Tree trunk** shows the hint at the top of the free area, beside the fullscreen button.
|
|
1260
|
+
- On the phone, the fullscreen button removes the sheet and the table moves to the centre of the canvas; pressing it again brings the sheet back in the position it had.
|
|
1261
|
+
- **Edge close-up** moves the camera close to the near corner of the top, where the edge profile shows; the button is drawn dark and the other light. **Whole table** returns to the whole table.
|
|
1262
|
+
- After dragging in the free area to orbit the table, **Reset view** returns to the framing of the active view, the whole table or the close-up.
|
|
1263
|
+
- The view buttons and **Reset view** sit at the bottom right of the free area on a desktop and just above the sheet on a phone, and overlap neither the panel, the sheet, the button on the edge nor the toast.
|
|
1264
|
+
- In fullscreen the view controls stay on a desktop. On a phone the view buttons are hidden and **Reset view** stays; after an orbit it restores the framing.
|
|
1265
|
+
|
|
1266
|
+
## Known gaps
|
|
1267
|
+
|
|
1268
|
+
A project layout has only what it renders. This one leaves out the following, each of which a product may need. [Layout Slots](?path=/docs/phoenix-layout-slots--docs) describes every `LayoutSlots` member named here.
|
|
1269
|
+
|
|
1270
|
+
- **Messages that stay snackbars.** The toast shows violations, side effects, errors and failed saves, and the finalize button shows its own error. Two kinds of message stay snackbars. An error of a built-in action, such as one from `LayoutSlots.DesktopToolbar`, renders into `LayoutSlots.DesktopSnackbarsRoot`; this layout mounts neither, and a layout that mounts such an action mounts the root too, or the snackbar appears outside the configurator. A failure to start from a preset appears on the preset screen, before this layout mounts; a project replaces that screen with `phx.frontend.createPresetUi`, see [Configurator Interface → Preset UI](?path=/docs/phoenix-configurator-interface--docs#preset-ui).
|
|
1271
|
+
- **Toolbar actions.** Undo and redo, measurements, sharing and language switching are not offered. A layout can mount `LayoutSlots.DesktopToolbar` for the toolbar the spec configures, or build its own buttons; for undo and redo, `phx.frontend.useUndoRedo()` gives `canUndo`, `canRedo`, `undo` and `redo`, and pushes the same analytics events as the built-in buttons.
|
|
1272
|
+
- **The spec's view controls, tool controls and leaving a tool mode.** A spec can configure view controls and tool controls, and a tool mode has a button that leaves it. The built-in layout places them with `LayoutSlots.DesktopViewControls`, `LayoutSlots.DesktopToolControls` and `LayoutSlots.DesktopCallToAction`; this layout mounts none of them, so the spec's `viewControls` and `toolControls` do not appear. Its views come from its own buttons instead, see [Control the scene](#control-the-scene), and it has no tool modes.
|
|
1273
|
+
- **A project's layout dialog.** A dialog the project registers with `phx.frontend.createLayoutDialog` is shown by `LayoutDialog`, which the built-in layout mounts. This layout does not; a layout that needs the dialog mounts `LayoutDialog` from `@salsita-ai/sdk/configurator`.
|
|
1274
|
+
- **Selection.** The table has no parts to select. A product with selectable parts reads `phx.frontend.useSelectedDomainEntityId()` and shows the controls of the selected part.
|
|
1275
|
+
- **Clone to edit in read mode.** With `shareCloneToEdit` set, the built-in layout's `LayoutSlots.DesktopReadonlyBanner` offers **Edit configuration** to a viewer; this layout's "View only" label offers nothing. A layout mounts the banner, or builds its own action with `LayoutSlots.useIsCloningAllowed()` and `LayoutSlots.CloneToEditDialog`.
|
|
1276
|
+
- **Back and close.** The built-in header's back button returns to the product choice, runs the host's close action or leaves the expanded view, whichever applies. This layout has none of them. `useCloseAction()` from `@salsita-ai/sdk/configurator` returns the host's close action, or `null` when there is none; the hook that chooses among the three is not exported.
|
|
1277
|
+
- **Analytics.** The finalize button records `FinalizeButtonClicked` through `useFinalizeAction`. The built-in fullscreen button records `FullScreenModeToggled`; this layout's fullscreen and other buttons record nothing. A layout that wants the events pushes `FrontendAnalyticsFactory.FullScreenModeToggled()` and the like, from `@salsita-ai/sdk/configurator`, with `phx.frontend.useAnalytics().push(...)`.
|
|
1278
|
+
- **Preview start screen.** The built-in layout shows a preview while `usePreview().isPreview` is set, which `preview: auto` does on phones without the project opting in. This layout ignores it and always renders the interface.
|
|
1279
|
+
- **Assistant panel.** A project layout gets it only with `LayoutSlots.DesktopSidebar`, the built-in sidebar as one piece, see [Sidebar in a Custom Layout](?path=/docs/layouts-sidebar-in-a-custom-layout--docs); this layout does not use it.
|
|
1280
|
+
- **"Powered by Salsita" mark.** The built-in layout shows it; a project layout decides whether to mount `LayoutSlots.DesktopPoweredBy`, and this one does not.
|
|
1281
|
+
|
|
1282
|
+
## Related pages
|
|
1283
|
+
|
|
1284
|
+
- [Configurator Interface → Loaded Configuration UI](?path=/docs/phoenix-configurator-interface--docs#loaded-configuration-ui) is the reference for the element name, the minimal layout, the SDK pieces a layout can mount and the hooks it reads.
|
|
1285
|
+
- [Universal](?path=/docs/layouts-universal--docs) is the built-in layout this one replaces.
|
|
1286
|
+
- [Header / Custom](?path=/docs/layouts-header-custom--docs) replaces only the header, with the price from `useRootEntityPrice()`.
|
|
1287
|
+
- [Canvas Padding](?path=/docs/layouts-canvas-padding--docs) scales the gaps `useSceneSafeArea()` measures.
|
|
1288
|
+
- [Presets / Custom](?path=/docs/layouts-presets-custom--docs) replaces the preset screen the same way.
|
|
1289
|
+
|
|
1290
|
+
## Complete Implementation
|
|
1291
|
+
|
|
1292
|
+
{/* AUTO-GENERATED SECTION: This section is automatically updated by 'phoenix story build' */}
|
|
1293
|
+
|
|
1294
|
+
<details>
|
|
1295
|
+
<summary>Click to view the complete implementation files</summary>
|
|
1296
|
+
|
|
1297
|
+
### ./spec/domain.yaml
|
|
1298
|
+
|
|
1299
|
+
```yaml
|
|
1300
|
+
model:
|
|
1301
|
+
latest:
|
|
1302
|
+
entityTypes:
|
|
1303
|
+
- Table
|
|
1304
|
+
aliases:
|
|
1305
|
+
RootEntity:
|
|
1306
|
+
- Table
|
|
1307
|
+
commonTypes:
|
|
1308
|
+
EdgeFinish:
|
|
1309
|
+
enum:
|
|
1310
|
+
- None
|
|
1311
|
+
- Facet
|
|
1312
|
+
- Round
|
|
1313
|
+
- TreeTrunk
|
|
1314
|
+
shapes:
|
|
1315
|
+
Table:
|
|
1316
|
+
edgeFinish:
|
|
1317
|
+
$ref: '#/model/latest/commonTypes/EdgeFinish'
|
|
1318
|
+
|
|
1319
|
+
presets:
|
|
1320
|
+
- rootEntityType: Table
|
|
1321
|
+
initialDomainEntities:
|
|
1322
|
+
- id: Table-1
|
|
1323
|
+
type: Table
|
|
1324
|
+
edgeFinish: None
|
|
1325
|
+
|
|
1326
|
+
navigationStates:
|
|
1327
|
+
- configure
|
|
1328
|
+
- checkout
|
|
1329
|
+
- requested
|
|
1330
|
+
|
|
1331
|
+
viewStates:
|
|
1332
|
+
- overview
|
|
1333
|
+
- edge
|
|
1334
|
+
|
|
1335
|
+
components:
|
|
1336
|
+
Table:
|
|
1337
|
+
detail:
|
|
1338
|
+
main:
|
|
1339
|
+
title: Linden dining table
|
|
1340
|
+
subtitle: Solid oak, seats six
|
|
1341
|
+
description: A solid oak top on slender steel legs, finished with the edge profile of your choice.
|
|
1342
|
+
price:
|
|
1343
|
+
main:
|
|
1344
|
+
price:
|
|
1345
|
+
$read: $price
|
|
1346
|
+
attributeSelection:
|
|
1347
|
+
edgeFinish:
|
|
1348
|
+
value:
|
|
1349
|
+
$bind: edgeFinish
|
|
1350
|
+
options:
|
|
1351
|
+
- label: Square
|
|
1352
|
+
description: Crisp and modern
|
|
1353
|
+
value: None
|
|
1354
|
+
- label: Facet
|
|
1355
|
+
description: A light bevel
|
|
1356
|
+
value: Facet
|
|
1357
|
+
- label: Round
|
|
1358
|
+
description: Soft to the touch
|
|
1359
|
+
value: Round
|
|
1360
|
+
- label: Tree trunk
|
|
1361
|
+
description: The natural edge
|
|
1362
|
+
value: TreeTrunk
|
|
1363
|
+
finalizeAction:
|
|
1364
|
+
quote:
|
|
1365
|
+
variant: primary
|
|
1366
|
+
label: Request a quote
|
|
1367
|
+
title: Send the configuration to the shop for a quote
|
|
1368
|
+
icon: PaperPlaneTilt
|
|
1369
|
+
handler: requestQuote
|
|
1370
|
+
htmlHotspot:
|
|
1371
|
+
edgeFinish:
|
|
1372
|
+
name: EdgeFinishHotspot
|
|
1373
|
+
offsetX: 500
|
|
1374
|
+
offsetY: 800
|
|
1375
|
+
offsetZ: 0
|
|
1376
|
+
$filter:
|
|
1377
|
+
modes: [owner]
|
|
1378
|
+
navigationStates: [configure]
|
|
1379
|
+
fitRootPerspectiveCamera:
|
|
1380
|
+
main:
|
|
1381
|
+
priority: 2
|
|
1382
|
+
fov: 35
|
|
1383
|
+
near: 100
|
|
1384
|
+
far: 10000
|
|
1385
|
+
minDistance: 1000
|
|
1386
|
+
maxDistance: 9000
|
|
1387
|
+
distance: 5000
|
|
1388
|
+
azimuthAngle: 1.5
|
|
1389
|
+
polarAngle: 1.1
|
|
1390
|
+
fitMeshChanges: true
|
|
1391
|
+
$filter:
|
|
1392
|
+
viewports: [desktop]
|
|
1393
|
+
phone:
|
|
1394
|
+
priority: 1
|
|
1395
|
+
fov: 35
|
|
1396
|
+
near: 100
|
|
1397
|
+
far: 10000
|
|
1398
|
+
minDistance: 1000
|
|
1399
|
+
maxDistance: 12000
|
|
1400
|
+
distance: 8000
|
|
1401
|
+
azimuthAngle: 1.5
|
|
1402
|
+
polarAngle: 1.1
|
|
1403
|
+
fitMeshChanges: true
|
|
1404
|
+
$filter:
|
|
1405
|
+
viewports: [mobile]
|
|
1406
|
+
edge:
|
|
1407
|
+
priority: 4
|
|
1408
|
+
fov: 35
|
|
1409
|
+
near: 100
|
|
1410
|
+
far: 10000
|
|
1411
|
+
minDistance: 800
|
|
1412
|
+
maxDistance: 9000
|
|
1413
|
+
distance: 2000
|
|
1414
|
+
azimuthAngle: 0.5
|
|
1415
|
+
polarAngle: 1.15
|
|
1416
|
+
fitMeshChanges: true
|
|
1417
|
+
$filter:
|
|
1418
|
+
viewports: [desktop]
|
|
1419
|
+
viewStates: [edge]
|
|
1420
|
+
edgePhone:
|
|
1421
|
+
priority: 3
|
|
1422
|
+
fov: 35
|
|
1423
|
+
near: 100
|
|
1424
|
+
far: 10000
|
|
1425
|
+
minDistance: 800
|
|
1426
|
+
maxDistance: 12000
|
|
1427
|
+
distance: 3000
|
|
1428
|
+
azimuthAngle: 0.5
|
|
1429
|
+
polarAngle: 1.15
|
|
1430
|
+
fitMeshChanges: true
|
|
1431
|
+
$filter:
|
|
1432
|
+
viewports: [mobile]
|
|
1433
|
+
viewStates: [edge]
|
|
1434
|
+
sceneEntityRemoteObject:
|
|
1435
|
+
top:
|
|
1436
|
+
fileUrl: /models/tables.gltf
|
|
1437
|
+
objectName: RECHTHOEK_RECTANGLE
|
|
1438
|
+
dimensionUnit: m
|
|
1439
|
+
leg:
|
|
1440
|
+
fileUrl: /models/tables.gltf
|
|
1441
|
+
objectName: AXL_LEG
|
|
1442
|
+
dimensionUnit: m
|
|
1443
|
+
sceneEntityObjectProperties:
|
|
1444
|
+
top:
|
|
1445
|
+
offsetY: 820
|
|
1446
|
+
morphTargetInfluences:
|
|
1447
|
+
Facet:
|
|
1448
|
+
value:
|
|
1449
|
+
$read: $edgeFinishFacet
|
|
1450
|
+
scaleOne: 1
|
|
1451
|
+
scaleZero: 0
|
|
1452
|
+
Bol:
|
|
1453
|
+
value:
|
|
1454
|
+
$read: $edgeFinishRound
|
|
1455
|
+
scaleOne: 1
|
|
1456
|
+
scaleZero: 0
|
|
1457
|
+
Boomstamrand:
|
|
1458
|
+
value:
|
|
1459
|
+
$read: $edgeFinishTreeTrunk
|
|
1460
|
+
scaleOne: 1
|
|
1461
|
+
scaleZero: 0
|
|
1462
|
+
leg:
|
|
1463
|
+
morphTargetInfluences:
|
|
1464
|
+
Length:
|
|
1465
|
+
value: 1000
|
|
1466
|
+
scaleOne: 3000
|
|
1467
|
+
scaleZero: 1400
|
|
1468
|
+
Width:
|
|
1469
|
+
value: 700
|
|
1470
|
+
scaleOne: 1300
|
|
1471
|
+
scaleZero: 600
|
|
1472
|
+
Height:
|
|
1473
|
+
value: 780
|
|
1474
|
+
scaleOne: 780
|
|
1475
|
+
scaleZero: 740
|
|
1476
|
+
|
|
1477
|
+
transformers:
|
|
1478
|
+
- name: tree-trunk-delivery
|
|
1479
|
+
```
|
|
1480
|
+
|
|
1481
|
+
### ./src/\_shared/BottomSheet.tsx
|
|
1482
|
+
|
|
1483
|
+
```tsx
|
|
1484
|
+
import { Box, ButtonBase } from '@mui/material'
|
|
1485
|
+
import { type MouseEvent, type PointerEvent, type ReactNode, useRef } from 'react'
|
|
1486
|
+
|
|
1487
|
+
// A drag shorter than this is a tap, and the handle's click toggles the sheet
|
|
1488
|
+
const TAP_DISTANCE = 6
|
|
1489
|
+
// A drag that ends this far from where it started snaps to the other position
|
|
1490
|
+
const SNAP_DISTANCE = 48
|
|
1491
|
+
// A drag faster than this, in pixels per millisecond, snaps in its direction even when it is short
|
|
1492
|
+
const SNAP_VELOCITY = 0.5
|
|
1493
|
+
// How far the sheet follows the finger towards the position it is already in
|
|
1494
|
+
const OVERDRAG = 0.25
|
|
1495
|
+
|
|
1496
|
+
interface BottomSheetProps {
|
|
1497
|
+
readonly open: boolean
|
|
1498
|
+
readonly onOpenChange: (open: boolean) => void
|
|
1499
|
+
readonly label: string
|
|
1500
|
+
readonly children: ReactNode
|
|
1501
|
+
}
|
|
1502
|
+
|
|
1503
|
+
interface Drag {
|
|
1504
|
+
readonly startY: number
|
|
1505
|
+
readonly startTime: number
|
|
1506
|
+
delta: number
|
|
1507
|
+
}
|
|
1508
|
+
|
|
1509
|
+
// A persistent sheet at the bottom of the layout with two positions, open and collapsed. It is not a modal: the scene
|
|
1510
|
+
// above it stays interactive. Its height comes from its content, so the layout's safe area ends where the sheet
|
|
1511
|
+
// starts and changes only when the sheet snaps. While the handle is dragged the sheet follows the finger with a
|
|
1512
|
+
// transform, which the safe area does not see, so the camera refits once per snap and not on every move.
|
|
1513
|
+
export const BottomSheet = ({ open, onOpenChange, label, children }: BottomSheetProps) => {
|
|
1514
|
+
const sheetRef = useRef<HTMLElement>(null)
|
|
1515
|
+
const dragRef = useRef<Drag | null>(null)
|
|
1516
|
+
const draggedRef = useRef(false)
|
|
1517
|
+
|
|
1518
|
+
const moveSheet = (offset: number, animate: boolean) => {
|
|
1519
|
+
if (sheetRef.current) {
|
|
1520
|
+
sheetRef.current.style.transition = animate ? 'transform 200ms ease-out' : 'none'
|
|
1521
|
+
sheetRef.current.style.transform = offset === 0 ? '' : `translateY(${offset}px)`
|
|
1522
|
+
}
|
|
1523
|
+
}
|
|
1524
|
+
|
|
1525
|
+
const handlePointerDown = (event: PointerEvent<HTMLButtonElement>) => {
|
|
1526
|
+
event.currentTarget.setPointerCapture(event.pointerId)
|
|
1527
|
+
dragRef.current = { startY: event.clientY, startTime: event.timeStamp, delta: 0 }
|
|
1528
|
+
draggedRef.current = false
|
|
1529
|
+
}
|
|
1530
|
+
|
|
1531
|
+
const handlePointerMove = (event: PointerEvent<HTMLButtonElement>) => {
|
|
1532
|
+
const drag = dragRef.current
|
|
1533
|
+
|
|
1534
|
+
if (drag === null) {
|
|
1535
|
+
return
|
|
1536
|
+
}
|
|
1537
|
+
|
|
1538
|
+
drag.delta = event.clientY - drag.startY
|
|
1539
|
+
// Down closes an open sheet and up opens a collapsed one; the other direction only gives a little
|
|
1540
|
+
const towardsOther = open ? drag.delta > 0 : drag.delta < 0
|
|
1541
|
+
moveSheet(towardsOther ? drag.delta : drag.delta * OVERDRAG, false)
|
|
1542
|
+
}
|
|
1543
|
+
|
|
1544
|
+
const handlePointerEnd = (event: PointerEvent<HTMLButtonElement>) => {
|
|
1545
|
+
const drag = dragRef.current
|
|
1546
|
+
dragRef.current = null
|
|
1547
|
+
|
|
1548
|
+
if (drag === null) {
|
|
1549
|
+
return
|
|
1550
|
+
}
|
|
1551
|
+
|
|
1552
|
+
moveSheet(0, true)
|
|
1553
|
+
|
|
1554
|
+
if (Math.abs(drag.delta) < TAP_DISTANCE) {
|
|
1555
|
+
return
|
|
1556
|
+
}
|
|
1557
|
+
|
|
1558
|
+
draggedRef.current = true
|
|
1559
|
+
const velocity = drag.delta / Math.max(event.timeStamp - drag.startTime, 1)
|
|
1560
|
+
const flicked = Math.abs(drag.delta) >= SNAP_DISTANCE || Math.abs(velocity) >= SNAP_VELOCITY
|
|
1561
|
+
|
|
1562
|
+
if (flicked && (open ? drag.delta > 0 : drag.delta < 0)) {
|
|
1563
|
+
onOpenChange(!open)
|
|
1564
|
+
}
|
|
1565
|
+
}
|
|
1566
|
+
|
|
1567
|
+
// A tap, Enter or Space toggles the sheet. The pointer click that ends a drag has already been handled; a keyboard
|
|
1568
|
+
// click (`detail` 0) always toggles, also after a touch drag that was followed by no click.
|
|
1569
|
+
const handleClick = (event: MouseEvent<HTMLButtonElement>) => {
|
|
1570
|
+
const dragged = draggedRef.current
|
|
1571
|
+
draggedRef.current = false
|
|
1572
|
+
|
|
1573
|
+
if (dragged && event.detail !== 0) {
|
|
1574
|
+
return
|
|
1575
|
+
}
|
|
1576
|
+
|
|
1577
|
+
onOpenChange(!open)
|
|
1578
|
+
}
|
|
1579
|
+
|
|
1580
|
+
return (
|
|
1581
|
+
<Box
|
|
1582
|
+
component="section"
|
|
1583
|
+
ref={sheetRef}
|
|
1584
|
+
aria-label={label}
|
|
1585
|
+
sx={{
|
|
1586
|
+
position: 'relative',
|
|
1587
|
+
flexShrink: 0,
|
|
1588
|
+
display: 'flex',
|
|
1589
|
+
flexDirection: 'column',
|
|
1590
|
+
maxBlockSize: '55%',
|
|
1591
|
+
paddingBlockEnd: 'env(safe-area-inset-bottom)',
|
|
1592
|
+
borderStartStartRadius: 20,
|
|
1593
|
+
borderStartEndRadius: 20,
|
|
1594
|
+
bgcolor: 'background.paper',
|
|
1595
|
+
boxShadow: '0 -8px 32px rgba(0, 0, 0, 0.12)',
|
|
1596
|
+
// Fills the gap below the sheet while it is dragged up
|
|
1597
|
+
'&::after': {
|
|
1598
|
+
content: '""',
|
|
1599
|
+
position: 'absolute',
|
|
1600
|
+
insetInline: 0,
|
|
1601
|
+
insetBlockStart: '100%',
|
|
1602
|
+
blockSize: '100vh',
|
|
1603
|
+
bgcolor: 'background.paper',
|
|
1604
|
+
},
|
|
1605
|
+
}}
|
|
1606
|
+
>
|
|
1607
|
+
<ButtonBase
|
|
1608
|
+
aria-expanded={open}
|
|
1609
|
+
disableRipple
|
|
1610
|
+
aria-label={open ? `Collapse ${label.toLowerCase()}` : `Expand ${label.toLowerCase()}`}
|
|
1611
|
+
onClick={handleClick}
|
|
1612
|
+
onPointerDown={handlePointerDown}
|
|
1613
|
+
onPointerMove={handlePointerMove}
|
|
1614
|
+
onPointerUp={handlePointerEnd}
|
|
1615
|
+
onPointerCancel={handlePointerEnd}
|
|
1616
|
+
sx={{
|
|
1617
|
+
flexShrink: 0,
|
|
1618
|
+
blockSize: 36,
|
|
1619
|
+
touchAction: 'none',
|
|
1620
|
+
'&.Mui-focusVisible': { outline: 2, outlineColor: 'primary.main', outlineOffset: -4, borderRadius: 3 },
|
|
1621
|
+
}}
|
|
1622
|
+
>
|
|
1623
|
+
<Box component="span" sx={{ inlineSize: 40, blockSize: 4, borderRadius: 2, bgcolor: 'text.disabled' }} />
|
|
1624
|
+
</ButtonBase>
|
|
1625
|
+
{/* A column, so the panel's cards region shrinks first and the price and action stay in view; below the cards
|
|
1626
|
+
region's minimum height the content scrolls as a whole, as the review step does on a short phone */}
|
|
1627
|
+
<Box
|
|
1628
|
+
component="div"
|
|
1629
|
+
sx={{
|
|
1630
|
+
display: 'flex',
|
|
1631
|
+
flexDirection: 'column',
|
|
1632
|
+
flex: '1 1 auto',
|
|
1633
|
+
minBlockSize: 0,
|
|
1634
|
+
overflowY: 'auto',
|
|
1635
|
+
overscrollBehavior: 'contain',
|
|
1636
|
+
}}
|
|
1637
|
+
>
|
|
1638
|
+
{children}
|
|
1639
|
+
</Box>
|
|
1640
|
+
</Box>
|
|
1641
|
+
)
|
|
1642
|
+
}
|
|
1643
|
+
```
|
|
1644
|
+
|
|
1645
|
+
### ./src/\_shared/EdgeFinishCards.tsx
|
|
1646
|
+
|
|
1647
|
+
```tsx
|
|
1648
|
+
import { Box, ButtonBase, type SxProps, type Theme, Typography } from '@mui/material'
|
|
1649
|
+
import type { KeyboardEvent } from 'react'
|
|
1650
|
+
|
|
1651
|
+
import { type UseAttributeSelection, useResolveLocalizable } from '@salsita-ai/sdk/react'
|
|
1652
|
+
|
|
1653
|
+
// Cross-sections of the tabletop's edge, keyed by the option values of the spec.
|
|
1654
|
+
const EDGE_PROFILES: Readonly<Record<string, string>> = {
|
|
1655
|
+
None: 'M0 4H32V20H0Z',
|
|
1656
|
+
Facet: 'M0 4H26L32 10V14L26 20H0Z',
|
|
1657
|
+
Round: 'M0 4H24A8 8 0 0 1 24 20H0Z',
|
|
1658
|
+
TreeTrunk: 'M0 4H27C33 5 28 9 34 11C29 13 34 17 27 20H0Z',
|
|
1659
|
+
}
|
|
1660
|
+
|
|
1661
|
+
const CHECK_BADGE: SxProps<Theme> = {
|
|
1662
|
+
position: 'absolute',
|
|
1663
|
+
insetBlockStart: 10,
|
|
1664
|
+
insetInlineEnd: 10,
|
|
1665
|
+
display: 'grid',
|
|
1666
|
+
placeItems: 'center',
|
|
1667
|
+
inlineSize: 22,
|
|
1668
|
+
blockSize: 22,
|
|
1669
|
+
borderRadius: '50%',
|
|
1670
|
+
bgcolor: 'primary.main',
|
|
1671
|
+
color: 'primary.contrastText',
|
|
1672
|
+
fontSize: 13,
|
|
1673
|
+
}
|
|
1674
|
+
|
|
1675
|
+
// Arrow keys move the selection between the cards, as in a native radio group.
|
|
1676
|
+
const ARROW_STEPS: Readonly<Record<string, number | undefined>> = {
|
|
1677
|
+
ArrowRight: 1,
|
|
1678
|
+
ArrowDown: 1,
|
|
1679
|
+
ArrowLeft: -1,
|
|
1680
|
+
ArrowUp: -1,
|
|
1681
|
+
}
|
|
1682
|
+
|
|
1683
|
+
interface EdgeFinishCardsProps {
|
|
1684
|
+
readonly selection: ReturnType<UseAttributeSelection>
|
|
1685
|
+
}
|
|
1686
|
+
|
|
1687
|
+
export const EdgeFinishCards = ({ selection }: EdgeFinishCardsProps) => {
|
|
1688
|
+
const resolve = useResolveLocalizable()
|
|
1689
|
+
const { options } = selection
|
|
1690
|
+
// The card in the tab order: the selected one, or the first enabled one. Disabled cards are never in it.
|
|
1691
|
+
const selectedIndex = options.findIndex(option => option.value === selection.value && !option.disabled)
|
|
1692
|
+
const focusIndex = selectedIndex >= 0 ? selectedIndex : options.findIndex(option => !option.disabled)
|
|
1693
|
+
|
|
1694
|
+
const handleKeyDown = (event: KeyboardEvent<HTMLElement>, index: number) => {
|
|
1695
|
+
const step = ARROW_STEPS[event.key]
|
|
1696
|
+
|
|
1697
|
+
if (step === undefined) {
|
|
1698
|
+
return
|
|
1699
|
+
}
|
|
1700
|
+
|
|
1701
|
+
event.preventDefault()
|
|
1702
|
+
// The next enabled option in the arrow's direction, wrapping around; disabled options are skipped.
|
|
1703
|
+
const count = options.length
|
|
1704
|
+
const next = Array.from(
|
|
1705
|
+
{ length: count - 1 },
|
|
1706
|
+
(_, offset) => (((index + step * (offset + 1)) % count) + count) % count
|
|
1707
|
+
).find(candidate => !options[candidate]?.disabled)
|
|
1708
|
+
|
|
1709
|
+
if (next === undefined) {
|
|
1710
|
+
return
|
|
1711
|
+
}
|
|
1712
|
+
|
|
1713
|
+
options[next]?.onSelect()
|
|
1714
|
+
event.currentTarget.parentElement?.querySelectorAll<HTMLElement>('[role="radio"]')[next]?.focus()
|
|
1715
|
+
}
|
|
1716
|
+
|
|
1717
|
+
return (
|
|
1718
|
+
<Box
|
|
1719
|
+
component="div"
|
|
1720
|
+
role="radiogroup"
|
|
1721
|
+
aria-label="Edge finish"
|
|
1722
|
+
sx={{ display: 'grid', gridTemplateColumns: '1fr 1fr', gap: 1.5 }}
|
|
1723
|
+
>
|
|
1724
|
+
{options.map((option, index) => {
|
|
1725
|
+
const isSelected = option.value === selection.value
|
|
1726
|
+
|
|
1727
|
+
return (
|
|
1728
|
+
<ButtonBase
|
|
1729
|
+
key={String(option.value)}
|
|
1730
|
+
role="radio"
|
|
1731
|
+
aria-checked={isSelected}
|
|
1732
|
+
tabIndex={index === focusIndex ? 0 : -1}
|
|
1733
|
+
disabled={option.disabled}
|
|
1734
|
+
onClick={option.onSelect}
|
|
1735
|
+
onKeyDown={event => handleKeyDown(event, index)}
|
|
1736
|
+
sx={{
|
|
1737
|
+
position: 'relative',
|
|
1738
|
+
display: 'grid',
|
|
1739
|
+
justifyItems: 'start',
|
|
1740
|
+
gap: 0.5,
|
|
1741
|
+
padding: 2,
|
|
1742
|
+
borderRadius: 3,
|
|
1743
|
+
border: 2,
|
|
1744
|
+
borderColor: isSelected ? 'primary.main' : 'divider',
|
|
1745
|
+
bgcolor: isSelected ? 'action.hover' : 'transparent',
|
|
1746
|
+
textAlign: 'start',
|
|
1747
|
+
transition: 'border-color 150ms, background-color 150ms',
|
|
1748
|
+
'&:hover': { borderColor: isSelected ? 'primary.main' : 'text.disabled' },
|
|
1749
|
+
'&.Mui-focusVisible': { outline: 2, outlineColor: 'primary.main', outlineOffset: 2 },
|
|
1750
|
+
'&.Mui-disabled': { opacity: 0.4 },
|
|
1751
|
+
}}
|
|
1752
|
+
>
|
|
1753
|
+
{isSelected && (
|
|
1754
|
+
<Box component="span" aria-hidden sx={CHECK_BADGE}>
|
|
1755
|
+
✓
|
|
1756
|
+
</Box>
|
|
1757
|
+
)}
|
|
1758
|
+
<Box
|
|
1759
|
+
component="svg"
|
|
1760
|
+
viewBox="0 0 36 24"
|
|
1761
|
+
aria-hidden
|
|
1762
|
+
sx={{ inlineSize: 60, blockSize: 40, color: '#b98b5e' }}
|
|
1763
|
+
>
|
|
1764
|
+
<path d={EDGE_PROFILES[String(option.value)]} fill="currentColor" />
|
|
1765
|
+
</Box>
|
|
1766
|
+
<Typography variant="body2" fontWeight={600}>
|
|
1767
|
+
{resolve(option.title)}
|
|
1768
|
+
</Typography>
|
|
1769
|
+
<Typography variant="caption" color="text.secondary">
|
|
1770
|
+
{resolve(option.description)}
|
|
1771
|
+
</Typography>
|
|
1772
|
+
</ButtonBase>
|
|
1773
|
+
)
|
|
1774
|
+
})}
|
|
1775
|
+
</Box>
|
|
1776
|
+
)
|
|
1777
|
+
}
|
|
1778
|
+
```
|
|
1779
|
+
|
|
1780
|
+
### ./src/\_shared/FullscreenToggle.tsx
|
|
1781
|
+
|
|
1782
|
+
```tsx
|
|
1783
|
+
import { Button, Tooltip } from '@mui/material'
|
|
1784
|
+
|
|
1785
|
+
import { phx } from '../../.phoenix/phx.js'
|
|
1786
|
+
|
|
1787
|
+
const ENTER_ICON = 'M4 9V4h5M15 4h5v5M20 15v5h-5M9 20H4v-5'
|
|
1788
|
+
const EXIT_ICON = 'M9 4v5H4M15 4v5h5M15 20v-5h5M9 20v-5H4'
|
|
1789
|
+
|
|
1790
|
+
interface FullscreenToggleProps {
|
|
1791
|
+
// Only the icon, with the label as its accessible name and tooltip, where a label would cover the product
|
|
1792
|
+
readonly compact?: boolean
|
|
1793
|
+
}
|
|
1794
|
+
|
|
1795
|
+
export const FullscreenToggle = ({ compact = false }: FullscreenToggleProps) => {
|
|
1796
|
+
const isFullscreen = phx.frontend.useIsFullscreenActive()
|
|
1797
|
+
const setFullscreen = phx.frontend.useSetFullscreen()
|
|
1798
|
+
const label = isFullscreen ? 'Exit fullscreen' : 'Fullscreen'
|
|
1799
|
+
const icon = (
|
|
1800
|
+
<svg viewBox="0 0 24 24" width={20} height={20} fill="none" stroke="currentColor" strokeWidth={2}>
|
|
1801
|
+
<path d={isFullscreen ? EXIT_ICON : ENTER_ICON} />
|
|
1802
|
+
</svg>
|
|
1803
|
+
)
|
|
1804
|
+
|
|
1805
|
+
return (
|
|
1806
|
+
<Tooltip title={compact ? label : ''}>
|
|
1807
|
+
<Button
|
|
1808
|
+
onClick={() => setFullscreen(!isFullscreen)}
|
|
1809
|
+
aria-label={compact ? label : undefined}
|
|
1810
|
+
startIcon={compact ? undefined : icon}
|
|
1811
|
+
sx={{
|
|
1812
|
+
minBlockSize: 44,
|
|
1813
|
+
minInlineSize: 44,
|
|
1814
|
+
paddingInline: compact ? 0 : 2.5,
|
|
1815
|
+
borderRadius: 999,
|
|
1816
|
+
bgcolor: 'background.paper',
|
|
1817
|
+
color: 'text.primary',
|
|
1818
|
+
boxShadow: '0 4px 16px rgba(0, 0, 0, 0.12)',
|
|
1819
|
+
textTransform: 'none',
|
|
1820
|
+
fontWeight: 600,
|
|
1821
|
+
'&:hover': { bgcolor: 'background.paper', boxShadow: '0 6px 20px rgba(0, 0, 0, 0.18)' },
|
|
1822
|
+
}}
|
|
1823
|
+
>
|
|
1824
|
+
{compact ? icon : label}
|
|
1825
|
+
</Button>
|
|
1826
|
+
</Tooltip>
|
|
1827
|
+
)
|
|
1828
|
+
}
|
|
1829
|
+
```
|
|
1830
|
+
|
|
1831
|
+
### ./src/\_shared/MessageToast.tsx
|
|
1832
|
+
|
|
1833
|
+
```tsx
|
|
1834
|
+
import { Alert } from '@mui/material'
|
|
1835
|
+
import { useEffect, useState } from 'react'
|
|
1836
|
+
|
|
1837
|
+
import type { ConfiguratorMessage } from '@salsita-ai/sdk/react'
|
|
1838
|
+
|
|
1839
|
+
import { phx } from '../../.phoenix/phx.js'
|
|
1840
|
+
|
|
1841
|
+
const VIOLATION_SEVERITY = { fatal: 'error', fixable: 'error', warning: 'warning', notice: 'info' } as const
|
|
1842
|
+
const RANK = { info: 0, warning: 1, error: 2 } as const
|
|
1843
|
+
const VISIBLE_MS = 6000
|
|
1844
|
+
|
|
1845
|
+
const severityOf = (message: ConfiguratorMessage) => {
|
|
1846
|
+
if (message.kind === 'violation') {
|
|
1847
|
+
return VIOLATION_SEVERITY[message.violation.severity]
|
|
1848
|
+
}
|
|
1849
|
+
|
|
1850
|
+
return message.kind === 'error' || message.kind === 'saveError' ? 'error' : 'info'
|
|
1851
|
+
}
|
|
1852
|
+
|
|
1853
|
+
export const MessageToast = () => {
|
|
1854
|
+
const [message, setMessage] = useState<ConfiguratorMessage | null>(null)
|
|
1855
|
+
|
|
1856
|
+
// A rejected change also reports the notices already present; keep the worst message while it is shown
|
|
1857
|
+
phx.frontend.useConfiguratorMessages(next => {
|
|
1858
|
+
setMessage(shown => (shown !== null && RANK[severityOf(next)] < RANK[severityOf(shown)] ? shown : next))
|
|
1859
|
+
})
|
|
1860
|
+
|
|
1861
|
+
useEffect(() => {
|
|
1862
|
+
if (message === null) {
|
|
1863
|
+
return
|
|
1864
|
+
}
|
|
1865
|
+
|
|
1866
|
+
const timeout = setTimeout(() => setMessage(null), VISIBLE_MS)
|
|
1867
|
+
|
|
1868
|
+
return () => clearTimeout(timeout)
|
|
1869
|
+
}, [message])
|
|
1870
|
+
|
|
1871
|
+
if (message === null) {
|
|
1872
|
+
return null
|
|
1873
|
+
}
|
|
1874
|
+
|
|
1875
|
+
return (
|
|
1876
|
+
<Alert
|
|
1877
|
+
severity={severityOf(message)}
|
|
1878
|
+
onClose={() => setMessage(null)}
|
|
1879
|
+
sx={{ maxInlineSize: 420, borderRadius: 3, boxShadow: '0 12px 40px rgba(0, 0, 0, 0.12)' }}
|
|
1880
|
+
>
|
|
1881
|
+
{message.text}
|
|
1882
|
+
</Alert>
|
|
1883
|
+
)
|
|
1884
|
+
}
|
|
1885
|
+
```
|
|
1886
|
+
|
|
1887
|
+
### ./src/\_shared/ProductPanel.tsx
|
|
1888
|
+
|
|
1889
|
+
```tsx
|
|
1890
|
+
import { Box, Button, Typography } from '@mui/material'
|
|
1891
|
+
|
|
1892
|
+
import { detailComponent, finalizeActionComponent } from '@salsita-ai/sdk/domain'
|
|
1893
|
+
import { PhoenixHandlerBoundary, useResolveLocalizable } from '@salsita-ai/sdk/react'
|
|
1894
|
+
|
|
1895
|
+
import { phx } from '../../.phoenix/phx.js'
|
|
1896
|
+
import { EdgeFinishCards } from './EdgeFinishCards.js'
|
|
1897
|
+
import { ReviewActions } from './ReviewActions.js'
|
|
1898
|
+
|
|
1899
|
+
const BUTTON_SX = { minBlockSize: 48, borderRadius: 999, textTransform: 'none', fontWeight: 600 } as const
|
|
1900
|
+
|
|
1901
|
+
interface ProductPanelProps {
|
|
1902
|
+
// Only the name, the price and the action, for a collapsed bottom sheet
|
|
1903
|
+
readonly collapsed?: boolean
|
|
1904
|
+
// In a bottom sheet the cards region keeps the top of the cards in view, and the sheet scrolls when that does not fit
|
|
1905
|
+
readonly inSheet?: boolean
|
|
1906
|
+
}
|
|
1907
|
+
|
|
1908
|
+
export const ProductPanel = ({ collapsed = false, inSheet = false }: ProductPanelProps) => {
|
|
1909
|
+
const resolve = useResolveLocalizable()
|
|
1910
|
+
const detail = phx.frontend.useFirstRootComponent(detailComponent)
|
|
1911
|
+
const price = phx.frontend.useRootEntityPrice()
|
|
1912
|
+
const tableId = phx.frontend.useRootEntityId()
|
|
1913
|
+
const edgeFinish = phx.frontend.useAttributeSelection(tableId, 'edgeFinish')
|
|
1914
|
+
const { accessInfo } = phx.frontend.useAccessService()
|
|
1915
|
+
const navigationState = phx.frontend.useActiveNavigationState()
|
|
1916
|
+
const pushNavigate = phx.frontend.usePushNavigate()
|
|
1917
|
+
const popNavigate = phx.frontend.usePopNavigate()
|
|
1918
|
+
const navigate = phx.frontend.useNavigate()
|
|
1919
|
+
const finalizeActions = phx.frontend.useComponents({ componentTypes: [finalizeActionComponent] }) ?? []
|
|
1920
|
+
|
|
1921
|
+
const isReadMode = accessInfo.viewMode
|
|
1922
|
+
const isReview = isReadMode || navigationState !== 'configure'
|
|
1923
|
+
// The spec's primary finalize action, or its first one
|
|
1924
|
+
const quoteAction = finalizeActions.find(action => action.state.variant === 'primary') ?? finalizeActions[0]
|
|
1925
|
+
const chosenEdge = edgeFinish.options.find(option => option.value === edgeFinish.value)
|
|
1926
|
+
|
|
1927
|
+
return (
|
|
1928
|
+
<>
|
|
1929
|
+
<Box component="header" sx={{ display: 'grid', gap: 1, padding: 3, paddingBlockEnd: 2 }}>
|
|
1930
|
+
{isReadMode ? (
|
|
1931
|
+
<Typography
|
|
1932
|
+
variant="overline"
|
|
1933
|
+
sx={{ justifySelf: 'start', paddingInline: 1.5, borderRadius: 999, bgcolor: 'action.selected' }}
|
|
1934
|
+
>
|
|
1935
|
+
View only
|
|
1936
|
+
</Typography>
|
|
1937
|
+
) : (
|
|
1938
|
+
<Typography variant="overline" color="text.secondary">
|
|
1939
|
+
{resolve(detail?.state.subtitle)}
|
|
1940
|
+
</Typography>
|
|
1941
|
+
)}
|
|
1942
|
+
<Typography variant="h5" component="h2" fontWeight={700}>
|
|
1943
|
+
{resolve(detail?.state.title)}
|
|
1944
|
+
</Typography>
|
|
1945
|
+
{!collapsed && (
|
|
1946
|
+
<Typography variant="body2" color="text.secondary">
|
|
1947
|
+
{resolve(detail?.state.description)}
|
|
1948
|
+
</Typography>
|
|
1949
|
+
)}
|
|
1950
|
+
</Box>
|
|
1951
|
+
|
|
1952
|
+
{!collapsed && (
|
|
1953
|
+
<Box
|
|
1954
|
+
component="div"
|
|
1955
|
+
sx={{
|
|
1956
|
+
display: 'grid',
|
|
1957
|
+
gap: 1.5,
|
|
1958
|
+
paddingInline: 3,
|
|
1959
|
+
paddingBlockEnd: 3,
|
|
1960
|
+
// In a short container the region shrinks and scrolls; a scroll past its end moves its container on
|
|
1961
|
+
minBlockSize: inSheet ? 120 : 0,
|
|
1962
|
+
overflowY: 'auto',
|
|
1963
|
+
}}
|
|
1964
|
+
>
|
|
1965
|
+
<Typography variant="subtitle2" component="h3">
|
|
1966
|
+
Edge finish
|
|
1967
|
+
</Typography>
|
|
1968
|
+
{isReview ? (
|
|
1969
|
+
<Box component="div" sx={{ padding: 2, borderRadius: 3, bgcolor: 'action.hover' }}>
|
|
1970
|
+
<Typography variant="body2" fontWeight={600}>
|
|
1971
|
+
{resolve(chosenEdge?.title)}
|
|
1972
|
+
</Typography>
|
|
1973
|
+
<Typography variant="caption" color="text.secondary">
|
|
1974
|
+
{resolve(chosenEdge?.description)}
|
|
1975
|
+
</Typography>
|
|
1976
|
+
</Box>
|
|
1977
|
+
) : (
|
|
1978
|
+
<EdgeFinishCards selection={edgeFinish} />
|
|
1979
|
+
)}
|
|
1980
|
+
</Box>
|
|
1981
|
+
)}
|
|
1982
|
+
|
|
1983
|
+
<Box component="footer" sx={{ display: 'grid', gap: 2, padding: 3, borderTop: 1, borderColor: 'divider' }}>
|
|
1984
|
+
<Box component="div" sx={{ display: 'flex', alignItems: 'baseline', justifyContent: 'space-between' }}>
|
|
1985
|
+
<Typography variant="body2" color="text.secondary">
|
|
1986
|
+
Total price
|
|
1987
|
+
</Typography>
|
|
1988
|
+
<Typography variant="h5" component="p" fontWeight={700}>
|
|
1989
|
+
{price}
|
|
1990
|
+
</Typography>
|
|
1991
|
+
</Box>
|
|
1992
|
+
{!isReadMode && navigationState === 'configure' && (
|
|
1993
|
+
<Button size="large" variant="contained" onClick={() => pushNavigate('checkout')} sx={BUTTON_SX}>
|
|
1994
|
+
Review and request a quote
|
|
1995
|
+
</Button>
|
|
1996
|
+
)}
|
|
1997
|
+
{!isReadMode && navigationState === 'checkout' && (
|
|
1998
|
+
<>
|
|
1999
|
+
<Typography variant="body2" color="text.secondary">
|
|
2000
|
+
Your table is ready for a quote. A real shop collects the contact details here.
|
|
2001
|
+
</Typography>
|
|
2002
|
+
{quoteAction ? (
|
|
2003
|
+
<PhoenixHandlerBoundary name={quoteAction.state.handler}>
|
|
2004
|
+
<ReviewActions
|
|
2005
|
+
handler={quoteAction.state.handler}
|
|
2006
|
+
label={resolve(quoteAction.state.label)}
|
|
2007
|
+
onBack={popNavigate}
|
|
2008
|
+
/>
|
|
2009
|
+
</PhoenixHandlerBoundary>
|
|
2010
|
+
) : (
|
|
2011
|
+
<Button size="large" variant="outlined" onClick={popNavigate} sx={BUTTON_SX}>
|
|
2012
|
+
Back to the configuration
|
|
2013
|
+
</Button>
|
|
2014
|
+
)}
|
|
2015
|
+
</>
|
|
2016
|
+
)}
|
|
2017
|
+
{!isReadMode && navigationState === 'requested' && (
|
|
2018
|
+
<>
|
|
2019
|
+
<Typography variant="body2" role="status">
|
|
2020
|
+
Thank you. Your quote request is on its way, and the shop replies within two working days.
|
|
2021
|
+
</Typography>
|
|
2022
|
+
<Button size="large" variant="outlined" onClick={() => navigate('configure')} sx={BUTTON_SX}>
|
|
2023
|
+
Back to the configuration
|
|
2024
|
+
</Button>
|
|
2025
|
+
</>
|
|
2026
|
+
)}
|
|
2027
|
+
</Box>
|
|
2028
|
+
</>
|
|
2029
|
+
)
|
|
2030
|
+
}
|
|
2031
|
+
```
|
|
2032
|
+
|
|
2033
|
+
### ./src/\_shared/ReviewActions.tsx
|
|
2034
|
+
|
|
2035
|
+
```tsx
|
|
2036
|
+
import { Alert, Box, Button, CircularProgress, Typography } from '@mui/material'
|
|
2037
|
+
|
|
2038
|
+
import { phx } from '../../.phoenix/phx.js'
|
|
2039
|
+
|
|
2040
|
+
const BUTTON_SX = { minBlockSize: 48, borderRadius: 999, textTransform: 'none', fontWeight: 600 } as const
|
|
2041
|
+
|
|
2042
|
+
interface ReviewActionsProps {
|
|
2043
|
+
readonly handler: string
|
|
2044
|
+
readonly label: string
|
|
2045
|
+
readonly onBack: () => void
|
|
2046
|
+
}
|
|
2047
|
+
|
|
2048
|
+
// The review step's buttons: one finalize action and the way back. `useFinalizeAction` runs the action's handler,
|
|
2049
|
+
// so this component calls it exactly once and is rendered inside a `PhoenixHandlerBoundary` for that handler.
|
|
2050
|
+
// Back is disabled while the request is pending, so the customer cannot change the configuration while it is sent.
|
|
2051
|
+
// The pending state belongs to this component: when the panel unmounts, as in fullscreen, the request goes on and
|
|
2052
|
+
// the remounted buttons are enabled again.
|
|
2053
|
+
export const ReviewActions = ({ handler, label, onBack }: ReviewActionsProps) => {
|
|
2054
|
+
const { run, isPending, error, disabled, hints } = phx.frontend.useFinalizeAction(handler)
|
|
2055
|
+
|
|
2056
|
+
return (
|
|
2057
|
+
<Box component="div" sx={{ display: 'grid', gap: 2 }}>
|
|
2058
|
+
<Box component="div" sx={{ display: 'grid', gap: 1 }}>
|
|
2059
|
+
<Button
|
|
2060
|
+
size="large"
|
|
2061
|
+
variant="contained"
|
|
2062
|
+
disabled={disabled || isPending}
|
|
2063
|
+
onClick={run}
|
|
2064
|
+
startIcon={isPending ? <CircularProgress size={18} color="inherit" /> : undefined}
|
|
2065
|
+
sx={BUTTON_SX}
|
|
2066
|
+
>
|
|
2067
|
+
{isPending ? 'Sending the request…' : label}
|
|
2068
|
+
</Button>
|
|
2069
|
+
{disabled && hints && (
|
|
2070
|
+
<Typography variant="caption" color="text.secondary">
|
|
2071
|
+
{hints}
|
|
2072
|
+
</Typography>
|
|
2073
|
+
)}
|
|
2074
|
+
{error && <Alert severity="error">The request could not be sent: {error.message}</Alert>}
|
|
2075
|
+
</Box>
|
|
2076
|
+
<Button size="large" variant="outlined" disabled={isPending} onClick={onBack} sx={BUTTON_SX}>
|
|
2077
|
+
Back to the configuration
|
|
2078
|
+
</Button>
|
|
2079
|
+
</Box>
|
|
2080
|
+
)
|
|
2081
|
+
}
|
|
2082
|
+
```
|
|
2083
|
+
|
|
2084
|
+
### ./src/\_shared/SceneControls.tsx
|
|
2085
|
+
|
|
2086
|
+
```tsx
|
|
2087
|
+
import { Box, Button, Tooltip } from '@mui/material'
|
|
2088
|
+
|
|
2089
|
+
import { phx } from '../../.phoenix/phx.js'
|
|
2090
|
+
|
|
2091
|
+
// The spec's view states, each with the label of the button that shows it
|
|
2092
|
+
const VIEWS = [
|
|
2093
|
+
{ state: 'overview', label: 'Whole table' },
|
|
2094
|
+
{ state: 'edge', label: 'Edge close-up' },
|
|
2095
|
+
] as const
|
|
2096
|
+
|
|
2097
|
+
const RESET_ICON = 'M4 12a8 8 0 1 0 2.4-5.7M4 4v4h4'
|
|
2098
|
+
|
|
2099
|
+
const SURFACE_SX = {
|
|
2100
|
+
borderRadius: 999,
|
|
2101
|
+
bgcolor: 'background.paper',
|
|
2102
|
+
boxShadow: '0 4px 16px rgba(0, 0, 0, 0.12)',
|
|
2103
|
+
} as const
|
|
2104
|
+
|
|
2105
|
+
const BUTTON_SX = {
|
|
2106
|
+
minBlockSize: 44,
|
|
2107
|
+
minInlineSize: 44,
|
|
2108
|
+
borderRadius: 999,
|
|
2109
|
+
textTransform: 'none',
|
|
2110
|
+
fontWeight: 600,
|
|
2111
|
+
whiteSpace: 'nowrap',
|
|
2112
|
+
} as const
|
|
2113
|
+
|
|
2114
|
+
interface SceneControlsProps {
|
|
2115
|
+
// The reset button shows only its icon, with its label as tooltip and accessible name
|
|
2116
|
+
readonly compact?: boolean
|
|
2117
|
+
// Only the reset button, without the view buttons
|
|
2118
|
+
readonly resetOnly?: boolean
|
|
2119
|
+
}
|
|
2120
|
+
|
|
2121
|
+
// The layout's own camera controls: one button per view state of the spec, and a reset that undoes an orbit
|
|
2122
|
+
export const SceneControls = ({ compact = false, resetOnly = false }: SceneControlsProps) => {
|
|
2123
|
+
const activeView = phx.frontend.useActiveViewState()
|
|
2124
|
+
const setViewState = phx.frontend.useSetViewState()
|
|
2125
|
+
const resetCamera = phx.frontend.useResetCamera()
|
|
2126
|
+
const resetIcon = (
|
|
2127
|
+
<svg viewBox="0 0 24 24" width={20} height={20} fill="none" stroke="currentColor" strokeWidth={2}>
|
|
2128
|
+
<path d={RESET_ICON} />
|
|
2129
|
+
</svg>
|
|
2130
|
+
)
|
|
2131
|
+
|
|
2132
|
+
return (
|
|
2133
|
+
<Box component="div" sx={{ display: 'flex', gap: 1 }}>
|
|
2134
|
+
{!resetOnly && (
|
|
2135
|
+
<Box component="div" role="group" aria-label="View" sx={{ ...SURFACE_SX, display: 'flex' }}>
|
|
2136
|
+
{VIEWS.map(view => {
|
|
2137
|
+
const isActive = activeView === view.state
|
|
2138
|
+
|
|
2139
|
+
return (
|
|
2140
|
+
<Button
|
|
2141
|
+
key={view.state}
|
|
2142
|
+
aria-pressed={isActive}
|
|
2143
|
+
onClick={() => setViewState(view.state)}
|
|
2144
|
+
sx={{
|
|
2145
|
+
...BUTTON_SX,
|
|
2146
|
+
paddingInline: 2,
|
|
2147
|
+
bgcolor: isActive ? 'text.primary' : 'transparent',
|
|
2148
|
+
color: isActive ? 'background.paper' : 'text.primary',
|
|
2149
|
+
'&:hover': { bgcolor: isActive ? 'text.primary' : 'action.hover' },
|
|
2150
|
+
}}
|
|
2151
|
+
>
|
|
2152
|
+
{view.label}
|
|
2153
|
+
</Button>
|
|
2154
|
+
)
|
|
2155
|
+
})}
|
|
2156
|
+
</Box>
|
|
2157
|
+
)}
|
|
2158
|
+
<Tooltip title={compact ? 'Reset view' : ''}>
|
|
2159
|
+
<Button
|
|
2160
|
+
onClick={resetCamera}
|
|
2161
|
+
aria-label={compact ? 'Reset view' : undefined}
|
|
2162
|
+
startIcon={compact ? undefined : resetIcon}
|
|
2163
|
+
sx={{
|
|
2164
|
+
...SURFACE_SX,
|
|
2165
|
+
...BUTTON_SX,
|
|
2166
|
+
paddingInline: compact ? 0 : 2,
|
|
2167
|
+
color: 'text.primary',
|
|
2168
|
+
'&:hover': { bgcolor: 'background.paper', boxShadow: '0 6px 20px rgba(0, 0, 0, 0.18)' },
|
|
2169
|
+
}}
|
|
2170
|
+
>
|
|
2171
|
+
{compact ? resetIcon : 'Reset view'}
|
|
2172
|
+
</Button>
|
|
2173
|
+
</Tooltip>
|
|
2174
|
+
</Box>
|
|
2175
|
+
)
|
|
2176
|
+
}
|
|
2177
|
+
```
|
|
2178
|
+
|
|
2179
|
+
### ./src/elements/ConfiguratorLayout.tsx
|
|
2180
|
+
|
|
2181
|
+
```tsx
|
|
2182
|
+
import { Box } from '@mui/material'
|
|
2183
|
+
import { useState } from 'react'
|
|
2184
|
+
|
|
2185
|
+
import { LayoutSlots, useSceneSafeArea } from '@salsita-ai/sdk/configurator'
|
|
2186
|
+
import { useActiveViewports } from '@salsita-ai/sdk/react'
|
|
2187
|
+
|
|
2188
|
+
import { phx } from '../../.phoenix/phx.js'
|
|
2189
|
+
import { BottomSheet } from '../_shared/BottomSheet.js'
|
|
2190
|
+
import { FullscreenToggle } from '../_shared/FullscreenToggle.js'
|
|
2191
|
+
import { MessageToast } from '../_shared/MessageToast.js'
|
|
2192
|
+
import { ProductPanel } from '../_shared/ProductPanel.js'
|
|
2193
|
+
import { SceneControls } from '../_shared/SceneControls.js'
|
|
2194
|
+
|
|
2195
|
+
const GUTTER = 24
|
|
2196
|
+
const PANEL_WIDTH = 380
|
|
2197
|
+
const PHONE_GUTTER = 16
|
|
2198
|
+
const TOUCH_TARGET = 44
|
|
2199
|
+
|
|
2200
|
+
const ConfiguratorLayout = () => {
|
|
2201
|
+
const { containerRef, safeAreaRef } = useSceneSafeArea()
|
|
2202
|
+
const isFullscreen = phx.frontend.useIsFullscreenActive()
|
|
2203
|
+
// `null` until the container has been measured; the layout shows only the scene until then
|
|
2204
|
+
const viewports = useActiveViewports()
|
|
2205
|
+
const [isSheetOpen, setSheetOpen] = useState(false)
|
|
2206
|
+
|
|
2207
|
+
const isDesktop = viewports?.includes('desktop') ?? false
|
|
2208
|
+
const gutter = isDesktop ? GUTTER : PHONE_GUTTER
|
|
2209
|
+
|
|
2210
|
+
return (
|
|
2211
|
+
<Box
|
|
2212
|
+
component="div"
|
|
2213
|
+
ref={containerRef}
|
|
2214
|
+
// `clip`, not `hidden`: what overflows, such as the sheet's fill below its edge, can never be scrolled into view,
|
|
2215
|
+
// not even by the browser when the focus moves
|
|
2216
|
+
sx={{ position: 'absolute', inset: 0, display: 'flex', flexDirection: 'column', overflow: 'clip' }}
|
|
2217
|
+
>
|
|
2218
|
+
<LayoutSlots.SharedCanvas />
|
|
2219
|
+
|
|
2220
|
+
{viewports !== null && isDesktop && !isFullscreen && (
|
|
2221
|
+
<Box
|
|
2222
|
+
component="aside"
|
|
2223
|
+
sx={{
|
|
2224
|
+
position: 'absolute',
|
|
2225
|
+
insetBlockStart: GUTTER,
|
|
2226
|
+
insetInlineStart: GUTTER,
|
|
2227
|
+
inlineSize: PANEL_WIDTH,
|
|
2228
|
+
maxBlockSize: `calc(100% - ${2 * GUTTER}px)`,
|
|
2229
|
+
display: 'flex',
|
|
2230
|
+
flexDirection: 'column',
|
|
2231
|
+
borderRadius: 5,
|
|
2232
|
+
bgcolor: 'background.paper',
|
|
2233
|
+
boxShadow: '0 12px 40px rgba(0, 0, 0, 0.12)',
|
|
2234
|
+
// A very short container, such as a phone held sideways, scrolls the panel instead of clipping its footer
|
|
2235
|
+
overflowX: 'hidden',
|
|
2236
|
+
overflowY: 'auto',
|
|
2237
|
+
overscrollBehavior: 'contain',
|
|
2238
|
+
}}
|
|
2239
|
+
>
|
|
2240
|
+
<ProductPanel />
|
|
2241
|
+
</Box>
|
|
2242
|
+
)}
|
|
2243
|
+
|
|
2244
|
+
{viewports !== null && (
|
|
2245
|
+
<Box
|
|
2246
|
+
component="div"
|
|
2247
|
+
ref={safeAreaRef}
|
|
2248
|
+
sx={{
|
|
2249
|
+
// Desktop: right of the panel. Phone: above the sheet, whose height the column gives the rest.
|
|
2250
|
+
...(isDesktop
|
|
2251
|
+
? {
|
|
2252
|
+
position: 'absolute',
|
|
2253
|
+
insetBlock: 0,
|
|
2254
|
+
insetInlineStart: isFullscreen ? 0 : PANEL_WIDTH + 2 * GUTTER,
|
|
2255
|
+
insetInlineEnd: 0,
|
|
2256
|
+
}
|
|
2257
|
+
: { position: 'relative', flex: '1 1 0', minBlockSize: 0 }),
|
|
2258
|
+
pointerEvents: 'none',
|
|
2259
|
+
}}
|
|
2260
|
+
>
|
|
2261
|
+
<Box
|
|
2262
|
+
component="div"
|
|
2263
|
+
sx={{ position: 'absolute', insetBlockStart: gutter, insetInlineEnd: gutter, pointerEvents: 'auto' }}
|
|
2264
|
+
>
|
|
2265
|
+
<FullscreenToggle compact={!isDesktop} />
|
|
2266
|
+
</Box>
|
|
2267
|
+
<Box
|
|
2268
|
+
component="div"
|
|
2269
|
+
sx={{
|
|
2270
|
+
position: 'absolute',
|
|
2271
|
+
pointerEvents: 'auto',
|
|
2272
|
+
// Desktop: bottom left, above the row of view controls. Phone: at the top beside the fullscreen button,
|
|
2273
|
+
// clear of the sheet's handle and the view controls.
|
|
2274
|
+
...(isDesktop
|
|
2275
|
+
? { insetBlockEnd: 2 * GUTTER + TOUCH_TARGET, insetInlineStart: GUTTER }
|
|
2276
|
+
: { insetBlockStart: gutter, insetInline: `${gutter}px ${2 * gutter + TOUCH_TARGET}px` }),
|
|
2277
|
+
}}
|
|
2278
|
+
>
|
|
2279
|
+
<MessageToast />
|
|
2280
|
+
</Box>
|
|
2281
|
+
{/* A phone in fullscreen keeps only the reset, as the built-in layout does. Below 1024 pixels (`tablet`) the
|
|
2282
|
+
free area beside the panel is narrow, so the reset shows only its icon there too. */}
|
|
2283
|
+
<Box
|
|
2284
|
+
component="div"
|
|
2285
|
+
sx={{ position: 'absolute', insetBlockEnd: gutter, insetInlineEnd: gutter, pointerEvents: 'auto' }}
|
|
2286
|
+
>
|
|
2287
|
+
<SceneControls
|
|
2288
|
+
compact={!isDesktop || (viewports?.includes('tablet') ?? false)}
|
|
2289
|
+
resetOnly={!isDesktop && isFullscreen}
|
|
2290
|
+
/>
|
|
2291
|
+
</Box>
|
|
2292
|
+
</Box>
|
|
2293
|
+
)}
|
|
2294
|
+
|
|
2295
|
+
{viewports !== null && !isDesktop && !isFullscreen && (
|
|
2296
|
+
<BottomSheet open={isSheetOpen} onOpenChange={setSheetOpen} label="Product details">
|
|
2297
|
+
<ProductPanel collapsed={!isSheetOpen} inSheet />
|
|
2298
|
+
</BottomSheet>
|
|
2299
|
+
)}
|
|
2300
|
+
</Box>
|
|
2301
|
+
)
|
|
2302
|
+
}
|
|
2303
|
+
|
|
2304
|
+
export default phx.frontend.createCustomPhoenixLayoutElement('ConfiguratorLayout', ConfiguratorLayout)
|
|
2305
|
+
```
|
|
2306
|
+
|
|
2307
|
+
### ./src/elements/EdgeFinishHotspot.tsx
|
|
2308
|
+
|
|
2309
|
+
```tsx
|
|
2310
|
+
import { Box, ButtonBase, Popover, Tooltip } from '@mui/material'
|
|
2311
|
+
import { useState } from 'react'
|
|
2312
|
+
|
|
2313
|
+
import { phx } from '../../.phoenix/phx.js'
|
|
2314
|
+
import { EdgeFinishCards } from '../_shared/EdgeFinishCards.js'
|
|
2315
|
+
|
|
2316
|
+
// The edge profile the button shows, the square edge of the cards' drawings
|
|
2317
|
+
const EDGE_ICON = 'M3 7H17L21 11V13L17 17H3Z'
|
|
2318
|
+
|
|
2319
|
+
// Rendered by the spec's `htmlHotspot` on the table's edge: a button on the product that opens the edge finishes
|
|
2320
|
+
// next to the edge, with the same cards as the panel. The spec's `$filter` decides when it is shown.
|
|
2321
|
+
export default phx.frontend.createCustomPhoenixEntityElement('EdgeFinishHotspot', ({ entityId }) => {
|
|
2322
|
+
const edgeFinish = phx.frontend.useAttributeSelection(entityId, 'edgeFinish')
|
|
2323
|
+
const [anchor, setAnchor] = useState<HTMLElement | null>(null)
|
|
2324
|
+
|
|
2325
|
+
return (
|
|
2326
|
+
<>
|
|
2327
|
+
<Tooltip title="Edge finish">
|
|
2328
|
+
<ButtonBase
|
|
2329
|
+
aria-label="Edge finish"
|
|
2330
|
+
aria-haspopup="dialog"
|
|
2331
|
+
aria-expanded={anchor !== null}
|
|
2332
|
+
onClick={event => setAnchor(event.currentTarget)}
|
|
2333
|
+
sx={{
|
|
2334
|
+
display: 'grid',
|
|
2335
|
+
placeItems: 'center',
|
|
2336
|
+
inlineSize: 44,
|
|
2337
|
+
blockSize: 44,
|
|
2338
|
+
borderRadius: '50%',
|
|
2339
|
+
bgcolor: 'background.paper',
|
|
2340
|
+
color: 'primary.main',
|
|
2341
|
+
boxShadow: '0 4px 16px rgba(0, 0, 0, 0.2)',
|
|
2342
|
+
'&.Mui-focusVisible': { outline: 2, outlineColor: 'primary.main', outlineOffset: 2 },
|
|
2343
|
+
}}
|
|
2344
|
+
>
|
|
2345
|
+
<svg viewBox="0 0 24 24" width={22} height={22} aria-hidden>
|
|
2346
|
+
<path d={EDGE_ICON} fill="currentColor" />
|
|
2347
|
+
</svg>
|
|
2348
|
+
</ButtonBase>
|
|
2349
|
+
</Tooltip>
|
|
2350
|
+
<Popover
|
|
2351
|
+
open={anchor !== null}
|
|
2352
|
+
anchorEl={anchor}
|
|
2353
|
+
onClose={() => setAnchor(null)}
|
|
2354
|
+
anchorOrigin={{ vertical: 'top', horizontal: 'center' }}
|
|
2355
|
+
transformOrigin={{ vertical: 'bottom', horizontal: 'center' }}
|
|
2356
|
+
slotProps={{
|
|
2357
|
+
paper: { role: 'dialog', 'aria-label': 'Edge finish', sx: { borderRadius: 4, marginBlockStart: -1 } },
|
|
2358
|
+
}}
|
|
2359
|
+
>
|
|
2360
|
+
<Box component="div" sx={{ inlineSize: 340, maxInlineSize: 'calc(100vw - 32px)', padding: 2 }}>
|
|
2361
|
+
<EdgeFinishCards selection={edgeFinish} />
|
|
2362
|
+
</Box>
|
|
2363
|
+
</Popover>
|
|
2364
|
+
</>
|
|
2365
|
+
)
|
|
2366
|
+
})
|
|
2367
|
+
```
|
|
2368
|
+
|
|
2369
|
+
### ./src/expressions/table.ts
|
|
2370
|
+
|
|
2371
|
+
```ts
|
|
2372
|
+
import { phx } from '../../.phoenix/phx.js'
|
|
2373
|
+
|
|
2374
|
+
const EDGE_FINISH_SURCHARGE = { None: 0, Facet: 90, Round: 120, TreeTrunk: 340 }
|
|
2375
|
+
|
|
2376
|
+
export default phx.domain.implementCustomExpressions({
|
|
2377
|
+
Table: {
|
|
2378
|
+
$price: s => {
|
|
2379
|
+
return 1290 + EDGE_FINISH_SURCHARGE[s.edgeFinish]
|
|
2380
|
+
},
|
|
2381
|
+
$edgeFinishFacet: s => {
|
|
2382
|
+
return s.edgeFinish === 'Facet' ? 1 : 0
|
|
2383
|
+
},
|
|
2384
|
+
$edgeFinishRound: s => {
|
|
2385
|
+
return s.edgeFinish === 'Round' ? 1 : 0
|
|
2386
|
+
},
|
|
2387
|
+
$edgeFinishTreeTrunk: s => {
|
|
2388
|
+
return s.edgeFinish === 'TreeTrunk' ? 1 : 0
|
|
2389
|
+
},
|
|
2390
|
+
},
|
|
2391
|
+
})
|
|
2392
|
+
```
|
|
2393
|
+
|
|
2394
|
+
### ./src/handlers/request-quote.ts
|
|
2395
|
+
|
|
2396
|
+
```ts
|
|
2397
|
+
import { useCallback } from 'react'
|
|
2398
|
+
|
|
2399
|
+
import { phx } from '../../.phoenix/phx.js'
|
|
2400
|
+
|
|
2401
|
+
// Stands in for the shop's quote service: the request takes a moment, then the panel shows the confirmation
|
|
2402
|
+
export default phx.frontend.createPhoenixHandler('requestQuote', () => {
|
|
2403
|
+
const navigate = phx.frontend.useNavigate()
|
|
2404
|
+
|
|
2405
|
+
return {
|
|
2406
|
+
handler: useCallback(async () => {
|
|
2407
|
+
await new Promise(resolve => setTimeout(resolve, 1500))
|
|
2408
|
+
navigate('requested')
|
|
2409
|
+
}, [navigate]),
|
|
2410
|
+
}
|
|
2411
|
+
})
|
|
2412
|
+
```
|
|
2413
|
+
|
|
2414
|
+
### ./src/transformers/tree-trunk-delivery.ts
|
|
2415
|
+
|
|
2416
|
+
```ts
|
|
2417
|
+
import { msg } from '@lingui/core/macro'
|
|
2418
|
+
|
|
2419
|
+
import { phx } from '../../.phoenix/phx.js'
|
|
2420
|
+
|
|
2421
|
+
// A tree-trunk edge is cut by hand; choosing it carries a hint, which reaches the layout as a side-effect message
|
|
2422
|
+
export default phx.frontend.transformerBuilder.when
|
|
2423
|
+
.entity(['Table'])
|
|
2424
|
+
.modified({ atFields: ['edgeFinish'] })
|
|
2425
|
+
.then.overrideMatchingUpdate(({ update }) => {
|
|
2426
|
+
if (update.stateDelta.edgeFinish !== 'TreeTrunk') {
|
|
2427
|
+
return [update]
|
|
2428
|
+
}
|
|
2429
|
+
|
|
2430
|
+
return [{ ...update, hint: msg`Tree trunk edges are cut by hand, so delivery takes three weeks longer.` }]
|
|
2431
|
+
})
|
|
2432
|
+
.build('tree-trunk-delivery')
|
|
2433
|
+
```
|
|
2434
|
+
|
|
2435
|
+
</details>
|