@salsita-ai/sdk 0.50.0-develop.ca72986c39 → 0.50.0-develop.d08a6c0e83
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 +9 -5
- 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/index.d.ts +1 -0
- package/dist/application/index.js +1 -1
- package/dist/application/mount-application.d.ts +1 -1
- package/dist/application/mount-application.js +1 -1
- package/dist/application/mount-configurator.d.ts +19 -0
- package/dist/application/mount-configurator.js +1 -0
- package/dist/application/mounted-application-runtime.d.ts +4 -0
- package/dist/application/mounted-application-runtime.js +1 -0
- package/dist/application/register-web-component.d.ts +2 -0
- package/dist/application/register-web-component.js +1 -0
- 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/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 +15 -1
- 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 +1 -0
- package/dist/application-spec/generate-application/code/common/index.js +1 -1
- 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/project-scaffolding.d.ts +10 -14
- package/dist/application-spec/generate-application/code/project-scaffolding.js +2 -2
- 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/application-types.js +6 -6
- package/dist/application-spec/generate-application/code/templates/common/doc-comment.d.ts +2 -0
- package/dist/application-spec/generate-application/code/templates/common/doc-comment.js +1 -0
- 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-globals.d.ts +2 -1
- package/dist/application-spec/generate-application/code/templates/configurator-globals.js +19 -6
- 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-component-optics.d.ts +1 -1
- package/dist/application-spec/generate-application/code/templates/domain-spec/generate-component-optics.js +6 -6
- package/dist/application-spec/generate-application/code/templates/domain-spec/generate-domain-block.js +59 -63
- package/dist/application-spec/generate-application/code/templates/domain-spec/generate-invariants.d.ts +8 -0
- 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-presets.js +1 -1
- package/dist/application-spec/generate-application/code/templates/domain-spec/generate-resources.js +13 -13
- 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 +2 -1
- package/dist/application-spec/generate-application/code/templates/domain-spec/index.js +1 -1
- 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/gitignore.js +1 -3
- package/dist/application-spec/generate-application/code/templates/global-definition/generate-action-types.js +7 -7
- package/dist/application-spec/generate-application/code/templates/global-definition/generate-assistant-form-element-types.d.ts +12 -0
- package/dist/application-spec/generate-application/code/templates/global-definition/generate-assistant-form-element-types.js +7 -0
- 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 +33 -0
- package/dist/application-spec/generate-application/code/templates/global-definition/index.d.ts +2 -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 -8
- 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/skills/phoenix-cli-skill.js +1 -1
- package/dist/application-spec/generate-application/code/templates/skills/phoenix-create-configurator-skill.js +1 -1
- 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 +3 -3
- package/dist/application-spec/generate-application/code/templates/skills/phoenix-skill-bundle.d.ts +10 -0
- package/dist/application-spec/generate-application/code/templates/skills/phoenix-skill-bundle.js +7 -0
- 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.js +2 -2
- package/dist/application-spec/generate-application/code/templates/skills/sdk-content.d.ts +26 -8
- package/dist/application-spec/generate-application/code/templates/skills/sdk-content.js +2 -2
- 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/implementations/phx-application-types.d.ts +25 -0
- package/dist/application-spec/generate-application/implementations/phx-application-types.js +1 -0
- package/dist/application-spec/generate-application/implementations/phx-domain.d.ts +36 -0
- package/dist/application-spec/generate-application/implementations/phx-domain.js +1 -0
- package/dist/application-spec/generate-application/implementations/phx-model.d.ts +24 -0
- package/dist/application-spec/generate-application/implementations/phx-model.js +1 -0
- package/dist/application-spec/generate-application/implementations/phx.d.ts +22 -0
- package/dist/application-spec/generate-application/implementations/phx.js +1 -0
- 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 +9 -5
- package/dist/application-spec/generate-application/runtime/admin-runtime/admin-runtime.js +1 -1
- package/dist/application-spec/generate-application/runtime/admin-runtime/admin-spec-runtime.d.ts +16 -0
- package/dist/application-spec/generate-application/runtime/admin-runtime/admin-spec-runtime.js +1 -0
- 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 +29 -9
- package/dist/application-spec/generate-application/runtime/application-runtime.js +1 -1
- package/dist/application-spec/generate-application/runtime/application-spec-slice.d.ts +71 -0
- package/dist/application-spec/generate-application/runtime/application-spec-slice.js +1 -0
- package/dist/application-spec/generate-application/runtime/configurator-runtime/configurator-model-runtime.d.ts +7 -5
- 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 +9 -6
- package/dist/application-spec/generate-application/runtime/configurator-runtime/configurator-runtime.js +1 -1
- package/dist/application-spec/generate-application/runtime/configurator-runtime/configurator-spec-runtime.d.ts +16 -0
- package/dist/application-spec/generate-application/runtime/configurator-runtime/configurator-spec-runtime.js +1 -0
- package/dist/application-spec/generate-application/runtime/configurator-runtime/states-runtime.d.ts +2 -2
- package/dist/application-spec/generate-application/runtime/create-application.d.ts +57 -0
- package/dist/application-spec/generate-application/runtime/create-application.js +1 -0
- package/dist/application-spec/generate-application/runtime/index.d.ts +8 -0
- package/dist/application-spec/generate-application/runtime/index.js +1 -0
- package/dist/application-spec/generate-application/runtime/migrations/migration-runtime.d.ts +2 -2
- package/dist/application-spec/generate-application/runtime/sections/assistant-runtime.d.ts +2 -2
- package/dist/application-spec/generate-application/runtime/sections/build-sdk-optic.d.ts +2 -1
- 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 +3 -0
- 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 +15 -6
- 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 +3 -3
- 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-code/spec-code-module.js +1 -0
- package/dist/application-spec/generate-application/runtime/spec-runtime.d.ts +21 -0
- package/dist/application-spec/generate-application/runtime/spec-runtime.js +1 -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 +28 -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 +103 -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/parse-application-files/categorize/categorize-files.d.ts +18 -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/raw-spec/parse-yaml-spec-file.js +1 -1
- package/dist/application-spec/parse-application-files/raw-spec/raw-assistant.d.ts +33 -3
- package/dist/application-spec/parse-application-files/raw-spec/raw-assistant.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-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/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-read.js +1 -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/expressions.d.ts +6 -2
- package/dist/application-spec/parse-application-files/spec/expressions/expressions.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/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/sections/assistant/assistant-form-elements.d.ts +9 -0
- package/dist/application-spec/parse-application-files/spec/sections/assistant/assistant-form-elements.js +1 -0
- package/dist/application-spec/parse-application-files/spec/sections/assistant/assistant-schema.d.ts +4 -1
- package/dist/application-spec/parse-application-files/spec/sections/assistant/assistant-schema.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 +17 -0
- package/dist/client/index.d.ts +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 +4 -1
- package/dist/client/memory-authorized-client.js +1 -1
- package/dist/client/phoenix-api.d.ts +228 -0
- package/dist/configurator/ConfiguratorApp.js +1 -1
- package/dist/configurator/app-loader-content/DefaultAppLoaderContent.d.ts +2 -0
- package/dist/configurator/app-loader-content/DefaultAppLoaderContent.js +5 -0
- package/dist/configurator/app-loader-content/index.d.ts +1 -0
- package/dist/configurator/app-loader-content/index.js +1 -0
- package/dist/configurator/application-runtime/extensions/selectors.js +1 -1
- package/dist/configurator/application-runtime/extensions/systems/assistant-system/assistant-system.d.ts +24 -4
- package/dist/configurator/application-runtime/extensions/systems/assistant-system/assistant-system.js +1 -1
- package/dist/configurator/application-runtime/extensions/systems/assistant-system/graphql-tools.d.ts +34 -7
- 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/canvas-system.d.ts +8 -0
- package/dist/configurator/application-runtime/extensions/systems/canvas-system.js +1 -1
- package/dist/configurator/application-runtime/extensions/systems/export-system/export-busy-error.d.ts +8 -0
- package/dist/configurator/application-runtime/extensions/systems/export-system/export-busy-error.js +1 -0
- package/dist/configurator/application-runtime/extensions/systems/export-system/export-system.d.ts +23 -1
- package/dist/configurator/application-runtime/extensions/systems/export-system/export-system.js +1 -1
- 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.d.ts +14 -1
- 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 +52 -5
- package/dist/configurator/application-runtime/extensions/systems/graphql-system/graphql-system.js +1 -1
- package/dist/configurator/application-runtime/extensions/systems/image-rendering-system/image-rendering-system.d.ts +14 -5
- package/dist/configurator/application-runtime/extensions/systems/image-rendering-system/image-rendering-system.js +1 -1
- package/dist/configurator/application-runtime/extensions/systems/index.d.ts +1 -1
- package/dist/configurator/common/configurator-interface.d.ts +121 -6
- package/dist/configurator/common/configurator-interface.js +1 -1
- package/dist/configurator/common/index.d.ts +2 -2
- package/dist/configurator/common/index.js +1 -1
- package/dist/configurator/configuration-not-found-page/BuiltInConfigurationNotFoundPage.d.ts +5 -0
- package/dist/configurator/configuration-not-found-page/BuiltInConfigurationNotFoundPage.js +1 -0
- package/dist/configurator/configuration-not-found-page/ConfigurationNotFoundPageElement.d.ts +6 -0
- package/dist/configurator/configuration-not-found-page/ConfigurationNotFoundPageElement.js +1 -0
- package/dist/configurator/configuration-not-found-page/index.d.ts +2 -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 +10 -0
- package/dist/configurator/configurator-context/configurator-routing/ConfiguratorRoutingProvider.js +1 -1
- package/dist/configurator/configurator-error-page/BuiltInConfiguratorErrorPage.d.ts +6 -0
- package/dist/configurator/configurator-error-page/BuiltInConfiguratorErrorPage.js +1 -0
- package/dist/configurator/configurator-error-page/ConfiguratorErrorPageElement.d.ts +7 -0
- package/dist/configurator/configurator-error-page/ConfiguratorErrorPageElement.js +1 -0
- package/dist/configurator/configurator-error-page/index.d.ts +2 -0
- package/dist/configurator/configurator-error-page/index.js +1 -0
- package/dist/configurator/index.d.ts +10 -0
- package/dist/configurator/index.js +1 -1
- package/dist/configurator/pages/ConfiguratorErrorPage.d.ts +0 -1
- package/dist/configurator/pages/ConfiguratorErrorPage.js +1 -1
- package/dist/configurator/pages/ConfiguratorNotFoundPage.js +1 -1
- package/dist/configurator/pages/DefaultConfiguratorLayout.d.ts +3 -2
- 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/PresetCreationErrorPage.d.ts +1 -1
- package/dist/configurator/pages/PresetCreationErrorPage.js +1 -1
- package/dist/configurator/pages/RootPage.js +1 -1
- package/dist/configurator/pages/default-configurator-elements.d.ts +7 -1
- package/dist/configurator/pages/default-configurator-elements.js +1 -1
- 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 +5 -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/scene-controls/BuiltInAddEntityFab.d.ts +3 -0
- package/dist/configurator/pages/default-elements/scene-controls/BuiltInAddEntityFab.js +1 -0
- package/dist/configurator/pages/default-elements/scene-controls/BuiltInDeleteEntityFab.d.ts +3 -0
- package/dist/configurator/pages/default-elements/scene-controls/BuiltInDeleteEntityFab.js +1 -0
- package/dist/configurator/pages/default-elements/scene-controls/BuiltInNavigationHotspot.d.ts +3 -0
- package/dist/configurator/pages/default-elements/scene-controls/BuiltInNavigationHotspot.js +1 -0
- package/dist/configurator/pages/default-elements/scene-controls/BuiltInSelectionHotspot.d.ts +3 -0
- package/dist/configurator/pages/default-elements/scene-controls/BuiltInSelectionHotspot.js +1 -0
- package/dist/configurator/pages/default-elements/scene-controls/BuiltInToolMenuFab.d.ts +3 -0
- package/dist/configurator/pages/default-elements/scene-controls/BuiltInToolMenuFab.js +1 -0
- package/dist/configurator/pages/default-elements/scene-controls/index.d.ts +6 -0
- package/dist/configurator/pages/default-elements/scene-controls/index.js +1 -0
- package/dist/configurator/pages/default-elements/scene-controls/scene-control-elements.d.ts +6 -0
- package/dist/configurator/pages/default-elements/scene-controls/scene-control-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/error-boundaries/GeneralErrorBoundary.js +1 -1
- package/dist/configurator/pages/error-boundaries/LoadingErrorBoundary.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/index.d.ts +1 -0
- package/dist/configurator/scene/index.js +1 -1
- 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/ToolFab.d.ts +4 -0
- package/dist/configurator/scene/scene-controls/ToolFab.js +1 -1
- package/dist/configurator/scene/scene-controls/use-scene-control-tooltip.d.ts +2 -1
- package/dist/configurator/scene/scene-entity/scene-controls/SceneEntityHtmlHotspots.js +1 -1
- package/dist/configurator/toolbar-actions/index.d.ts +3 -0
- package/dist/configurator/toolbar-actions/index.js +1 -0
- package/dist/configurator/toolbar-actions/use-assistant-panel.d.ts +18 -0
- package/dist/configurator/toolbar-actions/use-assistant-panel.js +1 -0
- package/dist/configurator/toolbar-actions/use-measurements.d.ts +35 -0
- package/dist/configurator/toolbar-actions/use-measurements.js +1 -0
- package/dist/configurator/toolbar-actions/use-toolbar-actions.d.ts +100 -0
- package/dist/configurator/toolbar-actions/use-toolbar-actions.js +1 -0
- package/dist/configurator/toolbar-actions/use-toolbar-help.d.ts +7 -0
- package/dist/configurator/toolbar-actions/use-toolbar-help.js +1 -0
- package/dist/configurator/ui/assistant/AssistantChips.d.ts +3 -2
- package/dist/configurator/ui/assistant/AssistantChips.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.js +1 -1
- package/dist/configurator/ui/assistant/alert/AssistantAlert.d.ts +8 -0
- package/dist/configurator/ui/assistant/alert/AssistantAlert.js +1 -0
- package/dist/configurator/ui/assistant/alert/index.d.ts +2 -0
- package/dist/configurator/ui/assistant/alert/index.js +1 -0
- package/dist/configurator/ui/assistant/alert/remark-alerts.d.ts +10 -0
- package/dist/configurator/ui/assistant/alert/remark-alerts.js +1 -0
- package/dist/configurator/ui/assistant/entity-link/AssistantEntityLink.d.ts +1 -1
- package/dist/configurator/ui/assistant/entity-link/AssistantEntityLink.js +1 -1
- package/dist/configurator/ui/assistant/entity-link/entity-link-state.d.ts +1 -1
- package/dist/configurator/ui/assistant/entity-link/index.d.ts +0 -1
- package/dist/configurator/ui/assistant/entity-link/index.js +1 -1
- 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/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-model.d.ts +37 -0
- package/dist/configurator/ui/assistant/form/form-model.js +1 -0
- package/dist/configurator/ui/assistant/form/form-state.d.ts +4 -0
- package/dist/configurator/ui/assistant/form/form-state.js +1 -0
- package/dist/configurator/ui/assistant/form/index.d.ts +4 -0
- package/dist/configurator/ui/assistant/form/index.js +1 -0
- package/dist/configurator/ui/assistant/form/parse-form-block.d.ts +10 -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/registry/built-in-form-elements.d.ts +3 -0
- package/dist/configurator/ui/assistant/form/registry/built-in-form-elements.js +1 -0
- package/dist/configurator/ui/assistant/form/registry/create-assistant-form-element.d.ts +31 -0
- package/dist/configurator/ui/assistant/form/registry/create-assistant-form-element.js +1 -0
- package/dist/configurator/ui/assistant/form/registry/form-element-definition.d.ts +16 -0
- package/dist/configurator/ui/assistant/form/registry/form-element-definition.js +1 -0
- package/dist/configurator/ui/assistant/form/registry/form-registry.d.ts +31 -0
- package/dist/configurator/ui/assistant/form/registry/form-registry.js +1 -0
- package/dist/configurator/ui/assistant/form/registry/index.d.ts +6 -0
- package/dist/configurator/ui/assistant/form/registry/index.js +1 -0
- package/dist/configurator/ui/assistant/form/registry/use-form-registry.d.ts +8 -0
- package/dist/configurator/ui/assistant/form/registry/use-form-registry.js +1 -0
- package/dist/configurator/ui/assistant/form-elements/FormCard.d.ts +9 -0
- package/dist/configurator/ui/assistant/form-elements/FormCard.js +1 -0
- package/dist/configurator/ui/assistant/form-elements/FormConfirm.d.ts +9 -0
- package/dist/configurator/ui/assistant/form-elements/FormConfirm.js +1 -0
- package/dist/configurator/ui/assistant/form-elements/FormGroup.d.ts +6 -0
- package/dist/configurator/ui/assistant/form-elements/FormGroup.js +1 -0
- package/dist/configurator/ui/assistant/form-elements/FormNumber.d.ts +9 -0
- package/dist/configurator/ui/assistant/form-elements/FormNumber.js +1 -0
- package/dist/configurator/ui/assistant/form-elements/FormOptions.d.ts +6 -0
- package/dist/configurator/ui/assistant/form-elements/FormOptions.js +1 -0
- package/dist/configurator/ui/assistant/form-elements/FormReply.d.ts +6 -0
- package/dist/configurator/ui/assistant/form-elements/FormReply.js +1 -0
- package/dist/configurator/ui/assistant/form-elements/FormSwatch.d.ts +10 -0
- package/dist/configurator/ui/assistant/form-elements/FormSwatch.js +1 -0
- package/dist/configurator/ui/assistant/form-elements/FormText.d.ts +6 -0
- package/dist/configurator/ui/assistant/form-elements/FormText.js +1 -0
- package/dist/configurator/ui/assistant/form-elements/clamp-form-number.d.ts +10 -0
- package/dist/configurator/ui/assistant/form-elements/clamp-form-number.js +1 -0
- package/dist/configurator/ui/assistant/form-elements/form-element-props.d.ts +38 -0
- package/dist/configurator/ui/assistant/form-elements/form-element-props.js +1 -0
- package/dist/configurator/ui/assistant/form-elements/index.d.ts +9 -0
- package/dist/configurator/ui/assistant/form-elements/index.js +1 -0
- package/dist/configurator/ui/assistant/index.d.ts +3 -0
- package/dist/configurator/ui/assistant/index.js +1 -1
- 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 +2 -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/screenshots/ScreenshotThumbnails.d.ts +9 -0
- package/dist/configurator/ui/assistant/screenshots/ScreenshotThumbnails.js +1 -0
- package/dist/configurator/ui/assistant/screenshots/index.d.ts +2 -0
- package/dist/configurator/ui/assistant/screenshots/index.js +1 -0
- package/dist/configurator/ui/assistant/screenshots/tool-screenshots.d.ts +22 -0
- package/dist/configurator/ui/assistant/screenshots/tool-screenshots.js +1 -0
- package/dist/configurator/ui/assistant/screenshots/use-screenshot-src.d.ts +8 -0
- package/dist/configurator/ui/assistant/screenshots/use-screenshot-src.js +1 -0
- package/dist/configurator/ui/assistant/streamed-markdown.d.ts +4 -2
- package/dist/configurator/ui/assistant/streamed-markdown.js +2 -2
- package/dist/configurator/ui/assistant/thread-items.d.ts +8 -1
- package/dist/configurator/ui/assistant/thread-items.js +1 -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/slots/canvas/LayoutCanvas.js +1 -1
- package/dist/configurator/ui/configurator-layout/slots/canvas/SharedCanvas.js +1 -1
- 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.js +1 -1
- package/dist/configurator/ui/configurator-layout/slots/services/Services.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/universal/ExportingOverlay.d.ts +5 -0
- package/dist/configurator/ui/configurator-layout/universal/ExportingOverlay.js +1 -0
- package/dist/configurator/ui/configurator-layout/universal/Layout.js +1 -1
- package/dist/configurator/ui/configurator-layout/universal/use-layout-scene-safe-area.d.ts +1 -1
- package/dist/configurator/ui/configurator-layout/universal/use-layout-scene-safe-area.js +1 -1
- package/dist/configurator/ui/configurator-layout/universal/use-scene-safe-area.d.ts +1 -1
- package/dist/configurator/ui/index.d.ts +1 -0
- package/dist/configurator/ui/index.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/ReactiveInterfaceLayout.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.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.d.ts +0 -7
- package/dist/configurator/ui/phoenix-layout-elements/AppLoader.js +2 -6
- package/dist/configurator/ui/phoenix-layout-elements/AssistantToolbarButton.js +1 -1
- 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/LanguageMenuAction.js +1 -1
- package/dist/configurator/ui/phoenix-layout-elements/LanguageToolbarButton.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/MeasurementsMenuAction.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/ShareToolbarButton.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/index.d.ts +8 -1
- package/dist/configurator/ui/phoenix-layout-elements/index.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/share/ShareModal.js +1 -1
- package/dist/configurator/ui/phoenix-layout-elements/share/use-share.d.ts +7 -8
- package/dist/configurator/ui/phoenix-layout-elements/share/use-share.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 -2
- package/dist/configurator/ui/preset-layout/PresetUi.js +1 -1
- package/dist/configurator/ui/preset-layout/index.d.ts +6 -1
- package/dist/configurator/ui/preset-layout/index.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/focus-mode.mdx +2 -0
- package/dist/docs/controls/select-child-entity/cardselect.mdx +1 -0
- package/dist/docs/fabs/basic.mdx +6 -2
- package/dist/docs/index.json +95 -1
- package/dist/docs/integrations/webcomponent-api/basics.mdx +2 -0
- package/dist/docs/layouts/custom-layout.mdx +637 -165
- package/dist/docs/layouts/gallery/ardent-compressor.mdx +3516 -0
- package/dist/docs/layouts/gallery/corvid-drone.mdx +3428 -0
- package/dist/docs/layouts/gallery/fenwick-window.mdx +2803 -0
- package/dist/docs/layouts/gallery/ferrule-bar-station.mdx +6567 -0
- package/dist/docs/layouts/gallery/kestrel-kettle.mdx +1858 -0
- package/dist/docs/layouts/gallery/nightjar-guitar.mdx +3698 -0
- package/dist/docs/layouts/gallery/sunfold-solar.mdx +2683 -0
- package/dist/docs/layouts/gallery/tidepool-aquascape.mdx +5203 -0
- package/dist/docs/other-features/client-side-rendering/declarative.mdx +1 -1
- package/dist/docs/other-features/error-5xx.mdx +1 -1
- package/dist/docs/other-features/navigation-hotspot.mdx +2 -0
- package/dist/docs/other-features/not-found-404.mdx +1 -1
- 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 +223 -59
- package/dist/docs/phoenix/domain-model.mdx +6 -1
- package/dist/docs/phoenix/finalization.mdx +1 -1
- package/dist/docs/phoenix/getting-started.mdx +5 -3
- package/dist/docs/phoenix/layout-slots.mdx +23 -23
- package/dist/docs/phoenix/localization.mdx +6 -2
- package/dist/docs/phoenix/migration-guide.mdx +12 -10
- package/dist/docs/phoenix/phoenix-cli.mdx +43 -20
- package/dist/docs/phoenix/project-structure.mdx +57 -31
- package/dist/docs/phoenix/quickstart.mdx +7 -7
- package/dist/docs/phoenix/sdk-builder-workflow.mdx +13 -11
- package/dist/docs/phoenix/sessions-and-access.mdx +2 -0
- package/dist/docs/phoenix/testing.mdx +8 -0
- package/dist/docs/selection-and-highlight/hotspots.mdx +2 -0
- package/dist/domain/application/assistant/assistant-manifest.d.ts +16 -1
- package/dist/domain/application/assistant/assistant-resolved-manifest.d.ts +8 -1
- package/dist/domain/application/assistant/build-assistant-manifest.js +1 -1
- package/dist/domain/application/assistant/form/assistant-form-element-name.d.ts +11 -0
- package/dist/domain/application/assistant/form/assistant-form-element-name.js +8 -0
- package/dist/domain/application/assistant/form/assistant-form-elements.d.ts +174 -0
- package/dist/domain/application/assistant/form/assistant-form-elements.js +1 -0
- package/dist/domain/application/assistant/form/assistant-resource-path.d.ts +10 -0
- package/dist/domain/application/assistant/form/assistant-resource-path.js +1 -0
- package/dist/domain/application/assistant/form/index.d.ts +4 -0
- package/dist/domain/application/assistant/form/index.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 -1
- package/dist/domain/application/assistant/index.d.ts +2 -1
- package/dist/domain/application/assistant/index.js +1 -1
- package/dist/domain/application/assistant/session-setup/apply-assistant-setup.js +1 -1
- package/dist/domain/application/assistant/session-setup/assistant-setup-manifest.d.ts +2 -0
- package/dist/domain/application/assistant/session-setup/assistant-setup-manifest.js +1 -1
- package/dist/domain/application/assistant-recipe-groups.d.ts +3 -1
- package/dist/domain/application/configurator-builder.d.ts +7 -1
- package/dist/domain/application/configurator-builder.js +1 -1
- package/dist/domain/application/index.d.ts +1 -1
- package/dist/domain/application/index.js +1 -1
- package/dist/domain/application/standard-properties.js +1 -1
- package/dist/domain/application/web-component-property.d.ts +3 -1
- package/dist/domain/application/web-component-property.js +1 -1
- package/dist/domain/available-system-components.d.ts +1 -1
- package/dist/domain/available-system-components.js +1 -1
- package/dist/domain/core/schema/extended-schema-validator.js +1 -1
- package/dist/domain/domain-builder.d.ts +9 -3
- package/dist/domain/domain-builder.js +1 -1
- package/dist/domain/domain-context/store-system/store-system.d.ts +5 -0
- package/dist/domain/domain-context/store-system/store-system.js +1 -1
- package/dist/domain/domain-runtime/application.d.ts +39 -0
- package/dist/domain/domain-runtime/application.js +1 -0
- package/dist/domain/domain-runtime/domain-context/selectors.d.ts +1 -0
- package/dist/domain/domain-runtime/domain-context/selectors.js +1 -1
- package/dist/domain/domain-runtime/domain-runtime.d.ts +44 -4
- package/dist/domain/domain-runtime/domain-runtime.js +1 -1
- package/dist/domain/domain-runtime/environment/initialize.d.ts +1 -1
- package/dist/domain/domain-runtime/environment/types.d.ts +1 -1
- package/dist/domain/domain-runtime/errors/implementation-error-collector.d.ts +2 -0
- package/dist/domain/domain-runtime/errors/implementation-error-collector.js +1 -1
- package/dist/domain/domain-runtime/index.d.ts +2 -1
- package/dist/domain/domain-runtime/index.js +1 -1
- package/dist/domain/domain-runtime/spec/index.d.ts +1 -1
- package/dist/domain/domain-runtime/spec/index.js +1 -1
- package/dist/domain/domain-runtime/spec/initialize.js +1 -1
- package/dist/domain/domain-runtime/spec/module-checks/element-registration.d.ts +27 -12
- package/dist/domain/domain-runtime/spec/module-checks/element-registration.js +1 -1
- package/dist/domain/domain-runtime/spec/module-checks/find-assistant-form-element-errors.d.ts +12 -0
- package/dist/domain/domain-runtime/spec/module-checks/find-assistant-form-element-errors.js +1 -0
- package/dist/domain/domain-runtime/spec/module-checks/index.d.ts +3 -1
- package/dist/domain/domain-runtime/spec/module-checks/index.js +1 -1
- package/dist/domain/domain-runtime/spec/module-checks/merge-expression-modules.d.ts +23 -0
- package/dist/domain/domain-runtime/spec/module-checks/merge-expression-modules.js +1 -0
- package/dist/domain/domain-runtime/spec/module-checks/resolve-expression-modules.d.ts +3 -4
- package/dist/domain/domain-runtime/spec/module-checks/resolve-expression-modules.js +1 -1
- package/dist/domain/domain-runtime/spec/selectors.d.ts +3 -1
- package/dist/domain/domain-runtime/spec/selectors.js +1 -1
- package/dist/domain/domain-runtime/web-component/actions.d.ts +3 -0
- package/dist/domain/domain-runtime/web-component/actions.js +1 -1
- package/dist/domain/domain-runtime/web-component/initialize.d.ts +1 -0
- package/dist/domain/domain-runtime/web-component/initialize.js +1 -1
- package/dist/domain/domain-runtime/web-component/selectors.d.ts +2 -0
- package/dist/domain/domain-runtime/web-component/selectors.js +1 -1
- package/dist/domain/domain-runtime/web-component/types.d.ts +6 -3
- package/dist/domain/extensions/export-images/agent-screenshot.d.ts +24 -0
- package/dist/domain/extensions/export-images/agent-screenshot.js +1 -0
- package/dist/domain/extensions/{client-side-image.d.ts → export-images/client-side-image.d.ts} +2 -2
- package/dist/domain/extensions/export-images/client-side-image.js +1 -0
- package/dist/domain/extensions/export-images/index.d.ts +3 -0
- package/dist/domain/extensions/export-images/index.js +1 -0
- package/dist/domain/extensions/{save-template-thumbnail.d.ts → export-images/save-template-thumbnail.d.ts} +2 -2
- package/dist/domain/extensions/export-images/save-template-thumbnail.js +1 -0
- package/dist/domain/extensions/index.d.ts +1 -2
- package/dist/domain/extensions/index.js +1 -1
- package/dist/domain/mocks/create-mock-domain-runtime.d.ts +9 -0
- package/dist/domain/system-components/child-entity-selection.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/editor/Editor.d.ts +7 -0
- package/dist/editor/Editor.js +1 -1
- package/dist/editor/domain-editors/DomainSpecContext.js +1 -1
- package/dist/editor/domain-editors/apply-spec-update.d.ts +10 -2
- package/dist/editor/domain-editors/apply-spec-update.js +1 -1
- package/dist/editor/domain-editors/use-implementation-files.d.ts +6 -14
- 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/screenshot/ScreenshotHandler.js +1 -1
- 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/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 +95 -80
- package/dist/legacy/domain-spec/spec/domain-spec.js +1 -1
- 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 +11 -5
- package/dist/legacy/phoenix-cli/project-gen/generators/file-templates/frontend-admin.js +10 -11
- package/dist/legacy/phoenix-cli/project-gen/generators/file-templates/frontend-embedded-admin.js +9 -10
- 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 +11 -0
- 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 +22 -1
- package/dist/phoenix/commands/deps/deps.js +2 -2
- package/dist/phoenix/commands/deps/index.d.ts +1 -1
- package/dist/phoenix/commands/deps/index.js +1 -1
- package/dist/phoenix/commands/deps/sdk-manifest.js +1 -1
- package/dist/phoenix/commands/dev.js +5 -5
- package/dist/phoenix/commands/fix.js +1 -1
- package/dist/phoenix/commands/generated-env-markers.d.ts +1 -0
- package/dist/phoenix/commands/generated-env-markers.js +1 -1
- package/dist/phoenix/commands/index.d.ts +1 -1
- 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/prettier.js +1 -1
- package/dist/phoenix/commands/sync.js +1 -1
- package/dist/phoenix/commands/unlink.js +1 -1
- package/dist/phoenix/services/application-spec-project-watcher.d.ts +3 -3
- package/dist/phoenix/services/application-spec-project-watcher.js +2 -2
- package/dist/phoenix/services/index.d.ts +1 -0
- package/dist/phoenix/services/index.js +1 -1
- package/dist/phoenix/services/lingui.d.ts +11 -0
- package/dist/phoenix/services/lingui.js +1 -1
- package/dist/phoenix/services/prepare-development-environment.js +1 -1
- package/dist/phoenix/services/swc.js +1 -1
- package/dist/phoenix/services/vite-config.js +1 -1
- package/dist/phoenix/utils/index.d.ts +3 -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/analytics-service.d.ts +1 -1
- package/dist/{configurator/common → react-sdk/application-runtime/common-services/analytics}/frontend-analytics.d.ts +4 -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/common-services/initialize.d.ts +2 -2
- package/dist/react-sdk/application-runtime/hooks/index.d.ts +2 -0
- package/dist/react-sdk/application-runtime/hooks/index.js +1 -1
- package/dist/react-sdk/application-runtime/hooks/loading/index.d.ts +5 -0
- package/dist/react-sdk/application-runtime/hooks/loading/index.js +1 -0
- package/dist/react-sdk/application-runtime/hooks/loading/loader-host-context.d.ts +11 -0
- package/dist/react-sdk/application-runtime/hooks/loading/loader-host-context.js +1 -0
- package/dist/react-sdk/application-runtime/hooks/loading/use-is-awaiting-loading-phase.d.ts +8 -0
- package/dist/react-sdk/application-runtime/hooks/loading/use-is-awaiting-loading-phase.js +1 -0
- package/dist/react-sdk/application-runtime/hooks/loading/use-is-loader-hosted.d.ts +7 -0
- package/dist/react-sdk/application-runtime/hooks/loading/use-is-loader-hosted.js +1 -0
- package/dist/react-sdk/application-runtime/hooks/loading/use-loading-actions.d.ts +9 -0
- package/dist/react-sdk/application-runtime/hooks/loading/use-loading-actions.js +1 -0
- package/dist/react-sdk/application-runtime/hooks/loading/use-loading-application.d.ts +24 -0
- package/dist/react-sdk/application-runtime/hooks/loading/use-loading-application.js +1 -0
- package/dist/react-sdk/application-runtime/hooks/responsive/index.d.ts +3 -0
- package/dist/react-sdk/application-runtime/hooks/responsive/index.js +1 -0
- package/dist/react-sdk/application-runtime/hooks/responsive/use-responsive-actions.d.ts +9 -0
- package/dist/react-sdk/application-runtime/hooks/responsive/use-responsive-actions.js +1 -0
- package/dist/react-sdk/application-runtime/hooks/responsive/use-responsive-application.d.ts +26 -0
- package/dist/react-sdk/application-runtime/hooks/responsive/use-responsive-application.js +1 -0
- package/dist/react-sdk/application-runtime/hooks/responsive/use-responsive-state.d.ts +10 -0
- package/dist/react-sdk/application-runtime/hooks/responsive/use-responsive-state.js +1 -0
- package/dist/react-sdk/application-runtime/hooks/responsive/use-responsive-store.d.ts +24 -0
- package/dist/react-sdk/application-runtime/hooks/responsive/use-responsive-store.js +1 -0
- package/dist/react-sdk/application-runtime/hooks/use-access-service.d.ts +5 -0
- package/dist/react-sdk/application-runtime/hooks/use-access-service.js +1 -1
- package/dist/react-sdk/application-runtime/hooks/use-phoenix-element-slots.d.ts +2 -1
- package/dist/react-sdk/application-runtime/hooks/use-web-component-readonly-sync.d.ts +4 -11
- package/dist/react-sdk/application-runtime/hooks/use-web-component-readonly-sync.js +1 -1
- package/dist/react-sdk/application-runtime/hooks/use-web-component.d.ts +5 -0
- package/dist/react-sdk/application-runtime/hooks/use-web-component.js +1 -1
- package/dist/react-sdk/application-runtime/host-properties/actions.d.ts +15 -0
- package/dist/react-sdk/application-runtime/host-properties/actions.js +1 -0
- package/dist/react-sdk/application-runtime/host-properties/connect-host-properties.d.ts +30 -0
- package/dist/react-sdk/application-runtime/host-properties/connect-host-properties.js +1 -0
- package/dist/react-sdk/application-runtime/host-properties/domain-host-properties.d.ts +7 -0
- package/dist/react-sdk/application-runtime/host-properties/domain-host-properties.js +1 -0
- package/dist/react-sdk/application-runtime/host-properties/host-property-descriptors.d.ts +21 -0
- package/dist/react-sdk/application-runtime/host-properties/host-property-descriptors.js +1 -0
- package/dist/react-sdk/application-runtime/host-properties/host-property-scopes.d.ts +42 -0
- package/dist/react-sdk/application-runtime/host-properties/host-property-scopes.js +1 -0
- package/dist/react-sdk/application-runtime/host-properties/index.d.ts +8 -0
- package/dist/react-sdk/application-runtime/host-properties/index.js +1 -0
- package/dist/react-sdk/application-runtime/host-properties/initialize.d.ts +7 -0
- package/dist/react-sdk/application-runtime/host-properties/initialize.js +1 -0
- package/dist/react-sdk/application-runtime/host-properties/selectors.d.ts +54 -0
- package/dist/react-sdk/application-runtime/host-properties/selectors.js +1 -0
- package/dist/react-sdk/application-runtime/host-properties/types.d.ts +18 -0
- package/dist/react-sdk/application-runtime/host-properties/types.js +1 -0
- package/dist/react-sdk/application-runtime/index.d.ts +3 -0
- package/dist/react-sdk/application-runtime/integration/initialize.d.ts +7 -6
- package/dist/react-sdk/application-runtime/integration/initialize.js +1 -1
- package/dist/react-sdk/application-runtime/integration/selectors.d.ts +11 -2
- package/dist/react-sdk/application-runtime/integration/selectors.js +1 -1
- package/dist/react-sdk/application-runtime/integration/types.d.ts +5 -2
- package/dist/react-sdk/application-runtime/loading/actions.d.ts +45 -0
- package/dist/react-sdk/application-runtime/loading/actions.js +1 -0
- package/dist/react-sdk/application-runtime/loading/index.d.ts +4 -0
- package/dist/react-sdk/application-runtime/loading/index.js +1 -0
- package/dist/react-sdk/application-runtime/loading/initialize.d.ts +3 -0
- package/dist/react-sdk/application-runtime/loading/initialize.js +1 -0
- package/dist/react-sdk/application-runtime/loading/selectors.d.ts +18 -0
- package/dist/react-sdk/application-runtime/loading/selectors.js +1 -0
- package/dist/react-sdk/application-runtime/loading/types.d.ts +59 -0
- package/dist/react-sdk/application-runtime/loading/types.js +1 -0
- package/dist/react-sdk/application-runtime/mocks/create-mock-application-runtime.js +1 -1
- package/dist/react-sdk/application-runtime/provider/ApplicationRuntime.d.ts +6 -0
- package/dist/react-sdk/application-runtime/provider/ApplicationRuntime.js +1 -1
- package/dist/react-sdk/application-runtime/provider/ApplicationType.d.ts +7 -0
- package/dist/react-sdk/application-runtime/provider/ApplicationType.js +1 -1
- package/dist/react-sdk/application-runtime/responsive/actions.d.ts +47 -0
- package/dist/react-sdk/application-runtime/responsive/actions.js +1 -0
- package/dist/react-sdk/application-runtime/responsive/index.d.ts +4 -0
- package/dist/react-sdk/application-runtime/responsive/index.js +1 -0
- package/dist/react-sdk/application-runtime/responsive/initialize.d.ts +3 -0
- package/dist/react-sdk/application-runtime/responsive/initialize.js +1 -0
- package/dist/react-sdk/application-runtime/responsive/selectors.d.ts +20 -0
- package/dist/react-sdk/application-runtime/responsive/selectors.js +1 -0
- package/dist/react-sdk/application-runtime/responsive/types.d.ts +104 -0
- package/dist/react-sdk/application-runtime/responsive/types.js +1 -0
- package/dist/react-sdk/application-runtime/routing/routing-service.d.ts +34 -2
- package/dist/react-sdk/application-runtime/routing/routing-service.js +1 -1
- package/dist/react-sdk/application-runtime/runtime/create-application-runtime.d.ts +313 -10
- package/dist/react-sdk/application-runtime/runtime/create-application-runtime.js +1 -1
- package/dist/react-sdk/domain-application-context/BackendDataProvider.js +1 -1
- package/dist/react-sdk/domain-application-context/DomainLifecycleBoundary.js +1 -1
- package/dist/react-sdk/domain-application-context/FrontendDataProvider.js +1 -1
- package/dist/react-sdk/domain-application-context/PublishedDataProvider.js +1 -1
- package/dist/react-sdk/domain-context/common-hooks/index.d.ts +9 -0
- package/dist/react-sdk/domain-context/common-hooks/index.js +1 -0
- package/dist/react-sdk/domain-context/common-hooks/use-configuration-save-state.d.ts +23 -0
- package/dist/react-sdk/domain-context/common-hooks/use-configuration-save-state.js +1 -0
- package/dist/react-sdk/domain-context/common-hooks/use-configurator-messages.d.ts +15 -4
- package/dist/react-sdk/domain-context/common-hooks/use-configurator-messages.js +1 -1
- package/dist/react-sdk/domain-context/common-hooks/use-domain-context.d.ts +1 -0
- package/dist/react-sdk/domain-context/component-hooks/index.d.ts +1 -0
- package/dist/react-sdk/domain-context/component-hooks/index.js +1 -0
- package/dist/react-sdk/domain-context/component-hooks/use-component.js +1 -1
- package/dist/react-sdk/domain-context/entity-hooks/use-domain-entity-state.js +1 -1
- package/dist/react-sdk/domain-context/entity-hooks/use-entity-price.js +1 -1
- package/dist/react-sdk/domain-context/entity-hooks/use-root-entity-id.js +1 -1
- package/dist/react-sdk/domain-context/entity-hooks/use-root-entity-state.js +1 -1
- package/dist/react-sdk/domain-context/index.d.ts +7 -0
- package/dist/react-sdk/domain-context/index.js +1 -1
- package/dist/react-sdk/domain-context/system-hooks/composition-hooks.js +1 -1
- package/dist/react-sdk/domain-context/system-hooks/dimension-hooks.js +1 -1
- package/dist/react-sdk/domain-context/system-hooks/generate-share-link-hooks.d.ts +8 -0
- package/dist/react-sdk/domain-context/system-hooks/generate-share-link-hooks.js +1 -0
- package/dist/react-sdk/domain-context/system-hooks/hover-hooks.js +1 -1
- package/dist/react-sdk/domain-context/system-hooks/locale-switch-hooks.d.ts +24 -0
- package/dist/react-sdk/domain-context/system-hooks/locale-switch-hooks.js +1 -0
- package/dist/react-sdk/domain-context/system-hooks/navigation-hooks.js +1 -1
- package/dist/react-sdk/domain-context/system-hooks/selection-hooks.js +1 -1
- package/dist/react-sdk/domain-context/system-hooks/share-links-hooks.d.ts +32 -0
- package/dist/react-sdk/domain-context/system-hooks/share-links-hooks.js +1 -0
- 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/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/{configurator/common → react-sdk/handlers}/use-finalize-action.d.ts +3 -2
- 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 +2 -0
- package/dist/react-sdk/index.js +1 -1
- package/dist/react-sdk/loading-state/LoaderHost.d.ts +20 -0
- package/dist/react-sdk/loading-state/LoaderHost.js +1 -0
- package/dist/react-sdk/loading-state/built-in-loading-phase.d.ts +9 -0
- package/dist/react-sdk/loading-state/built-in-loading-phase.js +1 -0
- package/dist/react-sdk/loading-state/create-app-loader.d.ts +18 -0
- package/dist/react-sdk/loading-state/create-app-loader.js +1 -0
- package/dist/react-sdk/loading-state/index.d.ts +4 -2
- package/dist/react-sdk/loading-state/index.js +1 -1
- package/dist/react-sdk/loading-state/{LoadingStateProvider.d.ts → loading-state-hooks.d.ts} +3 -12
- package/dist/react-sdk/loading-state/loading-state-hooks.js +1 -0
- package/dist/react-sdk/page-elements/ConfigurationNotFoundPagePropsProvider.d.ts +17 -0
- package/dist/react-sdk/page-elements/ConfigurationNotFoundPagePropsProvider.js +1 -0
- package/dist/react-sdk/page-elements/ConfiguratorErrorPagePropsProvider.d.ts +17 -0
- package/dist/react-sdk/page-elements/ConfiguratorErrorPagePropsProvider.js +1 -0
- package/dist/react-sdk/page-elements/configurator-error-page-props.d.ts +20 -0
- package/dist/react-sdk/page-elements/configurator-error-page-props.js +1 -0
- package/dist/react-sdk/page-elements/create-configuration-not-found-page.d.ts +15 -0
- package/dist/react-sdk/page-elements/create-configuration-not-found-page.js +1 -0
- package/dist/react-sdk/page-elements/create-configurator-error-page.d.ts +14 -0
- package/dist/react-sdk/page-elements/create-configurator-error-page.js +1 -0
- package/dist/react-sdk/page-elements/create-preset-ui.d.ts +9 -0
- package/dist/react-sdk/page-elements/create-preset-ui.js +1 -0
- package/dist/react-sdk/page-elements/index.d.ts +6 -0
- package/dist/react-sdk/page-elements/index.js +1 -0
- package/dist/react-sdk/scene-control-elements/AddEntityFabElement.d.ts +36 -0
- package/dist/react-sdk/scene-control-elements/AddEntityFabElement.js +1 -0
- package/dist/react-sdk/scene-control-elements/DeleteEntityFabElement.d.ts +44 -0
- package/dist/react-sdk/scene-control-elements/DeleteEntityFabElement.js +1 -0
- package/dist/react-sdk/scene-control-elements/NavigationHotspotElement.d.ts +38 -0
- package/dist/react-sdk/scene-control-elements/NavigationHotspotElement.js +1 -0
- package/dist/react-sdk/scene-control-elements/SelectionHotspotElement.d.ts +30 -0
- package/dist/react-sdk/scene-control-elements/SelectionHotspotElement.js +1 -0
- package/dist/react-sdk/scene-control-elements/ToolMenuFabElement.d.ts +30 -0
- package/dist/react-sdk/scene-control-elements/ToolMenuFabElement.js +1 -0
- package/dist/react-sdk/scene-control-elements/create-add-entity-fab.d.ts +9 -0
- package/dist/react-sdk/scene-control-elements/create-add-entity-fab.js +1 -0
- package/dist/react-sdk/scene-control-elements/create-delete-entity-fab.d.ts +9 -0
- package/dist/react-sdk/scene-control-elements/create-delete-entity-fab.js +1 -0
- package/dist/react-sdk/scene-control-elements/create-navigation-hotspot.d.ts +10 -0
- package/dist/react-sdk/scene-control-elements/create-navigation-hotspot.js +1 -0
- package/dist/react-sdk/scene-control-elements/create-selection-hotspot.d.ts +9 -0
- package/dist/react-sdk/scene-control-elements/create-selection-hotspot.js +1 -0
- package/dist/react-sdk/scene-control-elements/create-tool-menu-fab.d.ts +9 -0
- package/dist/react-sdk/scene-control-elements/create-tool-menu-fab.js +1 -0
- package/dist/react-sdk/scene-control-elements/index.d.ts +11 -0
- package/dist/react-sdk/scene-control-elements/index.js +1 -0
- package/dist/react-sdk/scene-control-elements/scene-control-tooltip-visibility.d.ts +5 -0
- package/dist/react-sdk/scene-control-elements/scene-control-tooltip-visibility.js +1 -0
- package/dist/react-sdk/session/NotAuthenticatedPage.d.ts +4 -0
- package/dist/react-sdk/session/NotAuthenticatedPage.js +1 -1
- package/dist/react-sdk/session/SessionServiceProvider.js +1 -1
- package/dist/react-sdk/web-component/create-web-component.js +1 -1
- package/dist/react-sdk/web-component/god-mode/god-mode-registry.d.ts +30 -0
- package/dist/react-sdk/web-component/god-mode/god-mode-registry.js +1 -0
- package/dist/react-sdk/web-component/god-mode/index.d.ts +1 -0
- package/dist/react-sdk/web-component/god-mode/index.js +1 -0
- package/dist/ui-sdk/icons/__generated/Lightbulb.d.ts +3 -0
- package/dist/ui-sdk/icons/__generated/Lightbulb.js +1 -0
- package/dist/ui-sdk/icons/__generated/XCircle.d.ts +3 -0
- package/dist/ui-sdk/icons/__generated/XCircle.js +1 -0
- package/dist/ui-sdk/icons/__generated/index.d.ts +4 -0
- package/dist/ui-sdk/icons/__generated/index.js +1 -1
- package/dist/ui-sdk/icons/icons-registry.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 +59 -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 +5 -1
- package/package.json +29 -11
- package/schema/domain-spec.json +226 -8
- 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/configurator/common/use-finalize-action.js +0 -1
- package/dist/configurator/ui/assistant/entity-link/entity-link-target.d.ts +0 -5
- package/dist/configurator/ui/assistant/entity-link/entity-link-target.js +0 -1
- package/dist/configurator/ui/phoenix-layout-elements/language/use-locale-options.d.ts +0 -4
- package/dist/configurator/ui/phoenix-layout-elements/language/use-locale-options.js +0 -1
- package/dist/configurator/ui/phoenix-layout-elements/measurements/use-measurements-visibility.d.ts +0 -4
- package/dist/configurator/ui/phoenix-layout-elements/measurements/use-measurements-visibility.js +0 -1
- package/dist/domain/extensions/client-side-image.js +0 -1
- package/dist/domain/extensions/save-template-thumbnail.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/react-sdk/application-runtime/runtime/god-mode.d.ts +0 -19
- package/dist/react-sdk/application-runtime/runtime/god-mode.js +0 -1
- package/dist/react-sdk/loading-state/LoadingStateProvider.js +0 -1
- package/dist/react-sdk/loading-state/loading-state-manager.d.ts +0 -32
- package/dist/react-sdk/loading-state/loading-state-manager.js +0 -1
- /package/dist/{configurator/common → react-sdk/application-runtime/common-services/analytics}/frontend-analytics.js +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Custom Layout
|
|
2
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. 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.
|
|
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
4
|
|
|
5
5
|
- [Choose this approach](#choose-this-approach)
|
|
6
6
|
- [Register the layout](#register-the-layout)
|
|
@@ -8,11 +8,13 @@ Make the configurator look like the brand's own product page. A furniture shop w
|
|
|
8
8
|
- [Read and change the product](#read-and-change-the-product)
|
|
9
9
|
- [Draw the choices](#draw-the-choices)
|
|
10
10
|
- [Offer fullscreen](#offer-fullscreen)
|
|
11
|
+
- [Undo and redo](#undo-and-redo)
|
|
11
12
|
- [Show messages](#show-messages)
|
|
12
13
|
- [Request a quote](#request-a-quote)
|
|
13
14
|
- [Serve read mode](#serve-read-mode)
|
|
14
15
|
- [Fit a phone](#fit-a-phone)
|
|
15
16
|
- [Put a control on the product](#put-a-control-on-the-product)
|
|
17
|
+
- [Control the scene](#control-the-scene)
|
|
16
18
|
- [The spec the layout reads](#the-spec-the-layout-reads)
|
|
17
19
|
- [Try the example](#try-the-example)
|
|
18
20
|
- [Test cases](#test-cases)
|
|
@@ -26,7 +28,7 @@ Write your own layout when the configurator has to follow a design the built-in
|
|
|
26
28
|
|
|
27
29
|
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).
|
|
28
30
|
|
|
29
|
-
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
|
|
31
|
+
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 and the `phx.frontend` hooks that measure the free area, read and change the product's state and record analytics. 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).
|
|
30
32
|
|
|
31
33
|
## Register the layout
|
|
32
34
|
|
|
@@ -36,14 +38,15 @@ Create `src/elements/ConfiguratorLayout.tsx` with a default export made by `phx.
|
|
|
36
38
|
import { Box } from '@mui/material'
|
|
37
39
|
import { useState } from 'react'
|
|
38
40
|
|
|
39
|
-
import { LayoutSlots
|
|
40
|
-
import { useActiveViewports } from '@salsita-ai/sdk/react'
|
|
41
|
+
import { LayoutSlots } from '@salsita-ai/sdk/configurator'
|
|
41
42
|
|
|
42
43
|
import { phx } from '../../.phoenix/phx.js'
|
|
43
44
|
import { BottomSheet } from '../_shared/BottomSheet.js'
|
|
44
45
|
import { FullscreenToggle } from '../_shared/FullscreenToggle.js'
|
|
45
46
|
import { MessageToast } from '../_shared/MessageToast.js'
|
|
46
47
|
import { ProductPanel } from '../_shared/ProductPanel.js'
|
|
48
|
+
import { SceneControls } from '../_shared/SceneControls.js'
|
|
49
|
+
import { UndoRedo } from '../_shared/UndoRedo.js'
|
|
47
50
|
|
|
48
51
|
const GUTTER = 24
|
|
49
52
|
const PANEL_WIDTH = 380
|
|
@@ -51,10 +54,10 @@ const PHONE_GUTTER = 16
|
|
|
51
54
|
const TOUCH_TARGET = 44
|
|
52
55
|
|
|
53
56
|
const ConfiguratorLayout = () => {
|
|
54
|
-
const { containerRef, safeAreaRef } = useSceneSafeArea()
|
|
57
|
+
const { containerRef, safeAreaRef } = phx.frontend.useSceneSafeArea()
|
|
55
58
|
const isFullscreen = phx.frontend.useIsFullscreenActive()
|
|
56
59
|
// `null` until the container has been measured; the layout shows only the scene until then
|
|
57
|
-
const viewports = useActiveViewports()
|
|
60
|
+
const viewports = phx.frontend.useActiveViewports()
|
|
58
61
|
const [isSheetOpen, setSheetOpen] = useState(false)
|
|
59
62
|
|
|
60
63
|
const isDesktop = viewports?.includes('desktop') ?? false
|
|
@@ -113,8 +116,16 @@ const ConfiguratorLayout = () => {
|
|
|
113
116
|
>
|
|
114
117
|
<Box
|
|
115
118
|
component="div"
|
|
116
|
-
sx={{
|
|
119
|
+
sx={{
|
|
120
|
+
position: 'absolute',
|
|
121
|
+
insetBlockStart: gutter,
|
|
122
|
+
insetInlineEnd: gutter,
|
|
123
|
+
display: 'flex',
|
|
124
|
+
gap: 1,
|
|
125
|
+
pointerEvents: 'auto',
|
|
126
|
+
}}
|
|
117
127
|
>
|
|
128
|
+
{!isFullscreen && <UndoRedo />}
|
|
118
129
|
<FullscreenToggle compact={!isDesktop} />
|
|
119
130
|
</Box>
|
|
120
131
|
<Box
|
|
@@ -122,14 +133,26 @@ const ConfiguratorLayout = () => {
|
|
|
122
133
|
sx={{
|
|
123
134
|
position: 'absolute',
|
|
124
135
|
pointerEvents: 'auto',
|
|
125
|
-
// Desktop: bottom left. Phone: at the top
|
|
136
|
+
// Desktop: bottom left, above the row of view controls. Phone: at the top below the row of undo, redo and
|
|
137
|
+
// fullscreen, clear of the sheet's handle and the view controls.
|
|
126
138
|
...(isDesktop
|
|
127
|
-
? { insetBlockEnd: GUTTER, insetInlineStart: GUTTER }
|
|
128
|
-
: { insetBlockStart: gutter
|
|
139
|
+
? { insetBlockEnd: 2 * GUTTER + TOUCH_TARGET, insetInlineStart: GUTTER }
|
|
140
|
+
: { insetBlockStart: gutter + TOUCH_TARGET + gutter / 2, insetInline: gutter }),
|
|
129
141
|
}}
|
|
130
142
|
>
|
|
131
143
|
<MessageToast />
|
|
132
144
|
</Box>
|
|
145
|
+
{/* A phone in fullscreen keeps only the reset, as the built-in layout does. Below 1024 pixels (`tablet`) the
|
|
146
|
+
free area beside the panel is narrow, so the reset shows only its icon there too. */}
|
|
147
|
+
<Box
|
|
148
|
+
component="div"
|
|
149
|
+
sx={{ position: 'absolute', insetBlockEnd: gutter, insetInlineEnd: gutter, pointerEvents: 'auto' }}
|
|
150
|
+
>
|
|
151
|
+
<SceneControls
|
|
152
|
+
compact={!isDesktop || (viewports?.includes('tablet') ?? false)}
|
|
153
|
+
resetOnly={!isDesktop && isFullscreen}
|
|
154
|
+
/>
|
|
155
|
+
</Box>
|
|
133
156
|
</Box>
|
|
134
157
|
)}
|
|
135
158
|
|
|
@@ -150,13 +173,13 @@ The components it uses live in `src/_shared/`, which Phoenix does not import by
|
|
|
150
173
|
## What the layout has to do
|
|
151
174
|
|
|
152
175
|
- **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`.
|
|
153
|
-
- **Mount the shared canvas.**
|
|
176
|
+
- **Mount the shared canvas.** It renders the scene, and the app loader stays on screen until the scene has loaded. A layout without a canvas is not held by the loader: it leaves once the configuration is up.
|
|
154
177
|
- **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.
|
|
155
|
-
- **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.
|
|
178
|
+
- **Tell the camera where the free area is.** `phx.frontend.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.
|
|
156
179
|
- **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.
|
|
157
180
|
- **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.
|
|
158
|
-
- **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).
|
|
159
|
-
- **Serve read mode.** The same element renders a configuration shared for viewing, and the layout decides what a viewer sees.
|
|
181
|
+
- **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 `phx.frontend.useActiveViewports()` and renders a desktop or a phone arrangement, see [Fit a phone](#fit-a-phone).
|
|
182
|
+
- **Serve read mode.** The same element renders a configuration shared for viewing, or one the host page opens read-only, and the layout decides what a viewer sees; see [Serve read mode](#serve-read-mode).
|
|
160
183
|
|
|
161
184
|
## Read and change the product
|
|
162
185
|
|
|
@@ -165,8 +188,7 @@ The panel reads everything it shows from hooks and writes the customer's choice
|
|
|
165
188
|
```tsx
|
|
166
189
|
import { Box, Button, Typography } from '@mui/material'
|
|
167
190
|
|
|
168
|
-
import { detailComponent
|
|
169
|
-
import { PhoenixHandlerBoundary, useResolveLocalizable } from '@salsita-ai/sdk/react'
|
|
191
|
+
import { detailComponent } from '@salsita-ai/sdk/domain'
|
|
170
192
|
|
|
171
193
|
import { phx } from '../../.phoenix/phx.js'
|
|
172
194
|
import { EdgeFinishCards } from './EdgeFinishCards.js'
|
|
@@ -182,7 +204,7 @@ interface ProductPanelProps {
|
|
|
182
204
|
}
|
|
183
205
|
|
|
184
206
|
export const ProductPanel = ({ collapsed = false, inSheet = false }: ProductPanelProps) => {
|
|
185
|
-
const resolve = useResolveLocalizable()
|
|
207
|
+
const resolve = phx.frontend.useResolveLocalizable()
|
|
186
208
|
const detail = phx.frontend.useFirstRootComponent(detailComponent)
|
|
187
209
|
const price = phx.frontend.useRootEntityPrice()
|
|
188
210
|
const tableId = phx.frontend.useRootEntityId()
|
|
@@ -192,12 +214,9 @@ export const ProductPanel = ({ collapsed = false, inSheet = false }: ProductPane
|
|
|
192
214
|
const pushNavigate = phx.frontend.usePushNavigate()
|
|
193
215
|
const popNavigate = phx.frontend.usePopNavigate()
|
|
194
216
|
const navigate = phx.frontend.useNavigate()
|
|
195
|
-
const finalizeActions = phx.frontend.useComponents({ componentTypes: [finalizeActionComponent] }) ?? []
|
|
196
217
|
|
|
197
218
|
const isReadMode = accessInfo.viewMode
|
|
198
219
|
const isReview = isReadMode || navigationState !== 'configure'
|
|
199
|
-
// The spec's primary finalize action, or its first one
|
|
200
|
-
const quoteAction = finalizeActions.find(action => action.state.variant === 'primary') ?? finalizeActions[0]
|
|
201
220
|
const chosenEdge = edgeFinish.options.find(option => option.value === edgeFinish.value)
|
|
202
221
|
|
|
203
222
|
return (
|
|
@@ -275,19 +294,7 @@ export const ProductPanel = ({ collapsed = false, inSheet = false }: ProductPane
|
|
|
275
294
|
<Typography variant="body2" color="text.secondary">
|
|
276
295
|
Your table is ready for a quote. A real shop collects the contact details here.
|
|
277
296
|
</Typography>
|
|
278
|
-
{
|
|
279
|
-
<PhoenixHandlerBoundary name={quoteAction.state.handler}>
|
|
280
|
-
<ReviewActions
|
|
281
|
-
handler={quoteAction.state.handler}
|
|
282
|
-
label={resolve(quoteAction.state.label)}
|
|
283
|
-
onBack={popNavigate}
|
|
284
|
-
/>
|
|
285
|
-
</PhoenixHandlerBoundary>
|
|
286
|
-
) : (
|
|
287
|
-
<Button size="large" variant="outlined" onClick={popNavigate} sx={BUTTON_SX}>
|
|
288
|
-
Back to the configuration
|
|
289
|
-
</Button>
|
|
290
|
-
)}
|
|
297
|
+
<ReviewActions onBack={popNavigate} />
|
|
291
298
|
</>
|
|
292
299
|
)}
|
|
293
300
|
{!isReadMode && navigationState === 'requested' && (
|
|
@@ -306,23 +313,26 @@ export const ProductPanel = ({ collapsed = false, inSheet = false }: ProductPane
|
|
|
306
313
|
}
|
|
307
314
|
```
|
|
308
315
|
|
|
309
|
-
| Hook | What the layout uses it for
|
|
310
|
-
| ---------------------------------------------------------------------------- |
|
|
311
|
-
| `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.
|
|
312
|
-
| `phx.frontend.useRootEntityId()` | The id of the table, which the control hooks take.
|
|
313
|
-
| `phx.frontend.useAttributeSelection(entityId, instanceName)` | The `attributeSelection` component named `edgeFinish`: the current `value` and the `options`, each with `title`, `description`, `value`, `disabled` and `onSelect`.
|
|
314
|
-
| `phx.frontend.useRootEntityPrice()` | The root entity's `price` component, formatted for the current locale and currency, or `null` without one.
|
|
315
|
-
| `phx.frontend.
|
|
316
|
-
| `phx.frontend.
|
|
317
|
-
| `phx.frontend.
|
|
318
|
-
| `phx.frontend.
|
|
319
|
-
| `phx.frontend.
|
|
320
|
-
| `phx.frontend.
|
|
321
|
-
| `phx.frontend.
|
|
322
|
-
| `
|
|
323
|
-
| `phx.frontend.
|
|
324
|
-
| `
|
|
325
|
-
| `
|
|
316
|
+
| Hook | What the layout uses it for |
|
|
317
|
+
| ---------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
318
|
+
| `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. |
|
|
319
|
+
| `phx.frontend.useRootEntityId()` | The id of the table, which the control hooks take. |
|
|
320
|
+
| `phx.frontend.useAttributeSelection(entityId, instanceName)` | The `attributeSelection` component named `edgeFinish`: the current `value` and the `options`, each with `title`, `description`, `value`, `disabled` and `onSelect`. |
|
|
321
|
+
| `phx.frontend.useRootEntityPrice()` | The root entity's `price` component, formatted for the current locale and currency, or `null` without one. |
|
|
322
|
+
| `phx.frontend.useResolveLocalizable()` | Turns the localizable texts of the spec into strings in the current language. [Localization](?path=/docs/phoenix-localization--docs) describes it, `phx.frontend.useLocalizable(text)` and `LocalizableMessage`. |
|
|
323
|
+
| `phx.frontend.useAccessService()` | `accessInfo.viewMode` is `true` while a configuration shared for viewing is open, and also while the host sets the `readonly` property; see [Serve read mode](#serve-read-mode). |
|
|
324
|
+
| `phx.frontend.useActiveNavigationState()` | The active navigation state; the panel shows its review step while it is `checkout`. |
|
|
325
|
+
| `phx.frontend.usePushNavigate()` and `phx.frontend.usePopNavigate()` | Enter the review step and leave it again. |
|
|
326
|
+
| `phx.frontend.useNavigate()` | Return from the confirmation to the configuration, forgetting the review step. |
|
|
327
|
+
| `phx.frontend.useFinalizeActions()` | The spec's `finalizeAction` components with what a button needs; the review step offers the `primary` one and runs it, with its pending state, its error and whether finalizing is possible; see [Request a quote](#request-a-quote). |
|
|
328
|
+
| `phx.frontend.useUndoRedo()` | Whether there is a change to undo or redo, and `undo` and `redo`, for the layout's own buttons; see [Undo and redo](#undo-and-redo). |
|
|
329
|
+
| `phx.frontend.useIsFullscreenActive()` and `phx.frontend.useSetFullscreen()` | Read the fullscreen flag, and set it from the layout's own button. |
|
|
330
|
+
| `phx.frontend.useAnalytics()` | Record the fullscreen button's click as the built-in button does; see [Offer fullscreen](#offer-fullscreen). |
|
|
331
|
+
| `phx.frontend.useSceneSafeArea()` | The two refs that tell the camera which part of the canvas the panel or the sheet leaves free; see [What the layout has to do](#what-the-layout-has-to-do). |
|
|
332
|
+
| `phx.frontend.useActiveViewports()` | 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). |
|
|
333
|
+
| `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). |
|
|
334
|
+
| `phx.frontend.useResetCamera()` | Move the camera back to the framing of the active camera, undoing the customer's orbit, pan and zoom. |
|
|
335
|
+
| `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). |
|
|
326
336
|
|
|
327
337
|
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`.
|
|
328
338
|
|
|
@@ -336,7 +346,9 @@ The edge finish is a visual choice, so the panel shows it as cards with a drawin
|
|
|
336
346
|
import { Box, ButtonBase, type SxProps, type Theme, Typography } from '@mui/material'
|
|
337
347
|
import type { KeyboardEvent } from 'react'
|
|
338
348
|
|
|
339
|
-
import {
|
|
349
|
+
import type { UseAttributeSelection } from '@salsita-ai/sdk/react'
|
|
350
|
+
|
|
351
|
+
import { phx } from '../../.phoenix/phx.js'
|
|
340
352
|
|
|
341
353
|
// Cross-sections of the tabletop's edge, keyed by the option values of the spec.
|
|
342
354
|
const EDGE_PROFILES: Readonly<Record<string, string>> = {
|
|
@@ -373,7 +385,7 @@ interface EdgeFinishCardsProps {
|
|
|
373
385
|
}
|
|
374
386
|
|
|
375
387
|
export const EdgeFinishCards = ({ selection }: EdgeFinishCardsProps) => {
|
|
376
|
-
const resolve = useResolveLocalizable()
|
|
388
|
+
const resolve = phx.frontend.useResolveLocalizable()
|
|
377
389
|
const { options } = selection
|
|
378
390
|
// The card in the tab order: the selected one, or the first enabled one. Disabled cards are never in it.
|
|
379
391
|
const selectedIndex = options.findIndex(option => option.value === selection.value && !option.disabled)
|
|
@@ -469,11 +481,13 @@ The drawings are keyed by the option values of the spec. A spec can carry a pict
|
|
|
469
481
|
|
|
470
482
|
## Offer fullscreen
|
|
471
483
|
|
|
472
|
-
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.
|
|
484
|
+
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. Before it flips the flag, the button records the click with `phx.frontend.useAnalytics().push(FrontendAnalyticsFactory.FullScreenModeToggled())`, the event the built-in fullscreen button records, so the shop's analytics count fullscreen the same way with either layout. `FrontendAnalyticsFactory` comes from `@salsita-ai/sdk/configurator`.
|
|
473
485
|
|
|
474
486
|
```tsx
|
|
475
487
|
import { Button, Tooltip } from '@mui/material'
|
|
476
488
|
|
|
489
|
+
import { FrontendAnalyticsFactory } from '@salsita-ai/sdk/configurator'
|
|
490
|
+
|
|
477
491
|
import { phx } from '../../.phoenix/phx.js'
|
|
478
492
|
|
|
479
493
|
const ENTER_ICON = 'M4 9V4h5M15 4h5v5M20 15v5h-5M9 20H4v-5'
|
|
@@ -487,6 +501,7 @@ interface FullscreenToggleProps {
|
|
|
487
501
|
export const FullscreenToggle = ({ compact = false }: FullscreenToggleProps) => {
|
|
488
502
|
const isFullscreen = phx.frontend.useIsFullscreenActive()
|
|
489
503
|
const setFullscreen = phx.frontend.useSetFullscreen()
|
|
504
|
+
const analytics = phx.frontend.useAnalytics()
|
|
490
505
|
const label = isFullscreen ? 'Exit fullscreen' : 'Fullscreen'
|
|
491
506
|
const icon = (
|
|
492
507
|
<svg viewBox="0 0 24 24" width={20} height={20} fill="none" stroke="currentColor" strokeWidth={2}>
|
|
@@ -494,10 +509,16 @@ export const FullscreenToggle = ({ compact = false }: FullscreenToggleProps) =>
|
|
|
494
509
|
</svg>
|
|
495
510
|
)
|
|
496
511
|
|
|
512
|
+
// The same event the built-in fullscreen button records, for entering and for leaving
|
|
513
|
+
const toggle = () => {
|
|
514
|
+
analytics.push(FrontendAnalyticsFactory.FullScreenModeToggled())
|
|
515
|
+
setFullscreen(!isFullscreen)
|
|
516
|
+
}
|
|
517
|
+
|
|
497
518
|
return (
|
|
498
519
|
<Tooltip title={compact ? label : ''}>
|
|
499
520
|
<Button
|
|
500
|
-
onClick={
|
|
521
|
+
onClick={toggle}
|
|
501
522
|
aria-label={compact ? label : undefined}
|
|
502
523
|
startIcon={compact ? undefined : icon}
|
|
503
524
|
sx={{
|
|
@@ -522,9 +543,81 @@ export const FullscreenToggle = ({ compact = false }: FullscreenToggleProps) =>
|
|
|
522
543
|
|
|
523
544
|
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.
|
|
524
545
|
|
|
546
|
+
## Undo and redo
|
|
547
|
+
|
|
548
|
+
The customer tries the four finishes against each other, so the layout offers **Undo** and **Redo** at the top right of the free area, beside the fullscreen button. `phx.frontend.useUndoRedo()` returns `canUndo` and `canRedo`, whether the history has a change to undo or to redo, and `undo` and `redo`, which change the configuration back or forward as the built-in toolbar's buttons do and push the same analytics events:
|
|
549
|
+
|
|
550
|
+
```tsx
|
|
551
|
+
import { Box, IconButton, Tooltip } from '@mui/material'
|
|
552
|
+
|
|
553
|
+
import { phx } from '../../.phoenix/phx.js'
|
|
554
|
+
|
|
555
|
+
const UNDO_ICON = 'M9 14 4 9l5-5M4 9h10.5a5.5 5.5 0 0 1 0 11H11'
|
|
556
|
+
const REDO_ICON = 'M15 14l5-5-5-5M20 9H9.5a5.5 5.5 0 0 0 0 11H13'
|
|
557
|
+
|
|
558
|
+
interface HistoryButtonProps {
|
|
559
|
+
readonly label: string
|
|
560
|
+
readonly icon: string
|
|
561
|
+
readonly enabled: boolean
|
|
562
|
+
readonly onClick: () => void
|
|
563
|
+
}
|
|
564
|
+
|
|
565
|
+
const HistoryButton = ({ label, icon, enabled, onClick }: HistoryButtonProps) => (
|
|
566
|
+
<Tooltip title={label}>
|
|
567
|
+
{/* A disabled button fires no pointer events, so the span keeps the tooltip working */}
|
|
568
|
+
<span>
|
|
569
|
+
<IconButton
|
|
570
|
+
aria-label={label}
|
|
571
|
+
disabled={!enabled}
|
|
572
|
+
onClick={onClick}
|
|
573
|
+
sx={{ inlineSize: 44, blockSize: 44, color: 'text.primary' }}
|
|
574
|
+
>
|
|
575
|
+
<svg viewBox="0 0 24 24" width={20} height={20} fill="none" stroke="currentColor" strokeWidth={2}>
|
|
576
|
+
<path d={icon} />
|
|
577
|
+
</svg>
|
|
578
|
+
</IconButton>
|
|
579
|
+
</span>
|
|
580
|
+
</Tooltip>
|
|
581
|
+
)
|
|
582
|
+
|
|
583
|
+
// Undo and redo for the customer's choices. They change the configuration, so they are offered only where the cards
|
|
584
|
+
// are: not to a viewer, and not in the review step, where the summary and a running request must not change under the
|
|
585
|
+
// customer. `useUndoRedo` pushes the same analytics events as the built-in toolbar's buttons.
|
|
586
|
+
export const UndoRedo = () => {
|
|
587
|
+
const { canUndo, canRedo, undo, redo } = phx.frontend.useUndoRedo()
|
|
588
|
+
const { accessInfo } = phx.frontend.useAccessService()
|
|
589
|
+
const navigationState = phx.frontend.useActiveNavigationState()
|
|
590
|
+
|
|
591
|
+
if (accessInfo.viewMode || navigationState !== 'configure') {
|
|
592
|
+
return null
|
|
593
|
+
}
|
|
594
|
+
|
|
595
|
+
return (
|
|
596
|
+
<Box
|
|
597
|
+
component="div"
|
|
598
|
+
role="group"
|
|
599
|
+
aria-label="History"
|
|
600
|
+
sx={{
|
|
601
|
+
display: 'flex',
|
|
602
|
+
borderRadius: 999,
|
|
603
|
+
bgcolor: 'background.paper',
|
|
604
|
+
boxShadow: '0 4px 16px rgba(0, 0, 0, 0.12)',
|
|
605
|
+
}}
|
|
606
|
+
>
|
|
607
|
+
<HistoryButton label="Undo" icon={UNDO_ICON} enabled={canUndo} onClick={undo} />
|
|
608
|
+
<HistoryButton label="Redo" icon={REDO_ICON} enabled={canRedo} onClick={redo} />
|
|
609
|
+
</Box>
|
|
610
|
+
)
|
|
611
|
+
}
|
|
612
|
+
```
|
|
613
|
+
|
|
614
|
+
- Each choice of a finish is one step of the history, whether it is made on the cards or on the button on the table's edge; undoing it moves the check mark back, changes the edge back and restores the price.
|
|
615
|
+
- Each button is disabled while there is nothing to undo or redo, and keeps its tooltip and accessible name. A disabled MUI button receives no pointer events, so a `span` around it carries the tooltip.
|
|
616
|
+
- The hook does not look at read mode or at the navigation state. The buttons change the configuration, so the component renders them only while the cards are shown: not to a viewer, not in the review step, where the summary and a running request must not change under the customer, and not in the confirmation. The layout also leaves them out in fullscreen, which gives the canvas to the product and keeps only the controls placed on it or for looking at it. The button on the table's edge stays there and still changes the finish; the history keeps that change, so **Undo** undoes it after fullscreen is left.
|
|
617
|
+
|
|
525
618
|
## Show messages
|
|
526
619
|
|
|
527
|
-
When a change is rejected because it breaks an invariant, when a committed change carries a hint,
|
|
620
|
+
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, below the row of buttons, on a phone:
|
|
528
621
|
|
|
529
622
|
```tsx
|
|
530
623
|
import { Alert } from '@mui/material'
|
|
@@ -543,7 +636,7 @@ const severityOf = (message: ConfiguratorMessage) => {
|
|
|
543
636
|
return VIOLATION_SEVERITY[message.violation.severity]
|
|
544
637
|
}
|
|
545
638
|
|
|
546
|
-
return message.kind === 'error' ? 'error' : 'info'
|
|
639
|
+
return message.kind === 'error' || message.kind === 'saveError' ? 'error' : 'info'
|
|
547
640
|
}
|
|
548
641
|
|
|
549
642
|
export const MessageToast = () => {
|
|
@@ -580,7 +673,7 @@ export const MessageToast = () => {
|
|
|
580
673
|
}
|
|
581
674
|
```
|
|
582
675
|
|
|
583
|
-
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'` or `'
|
|
676
|
+
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.
|
|
584
677
|
|
|
585
678
|
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:
|
|
586
679
|
|
|
@@ -603,7 +696,7 @@ export default phx.frontend.transformerBuilder.when
|
|
|
603
696
|
.build('tree-trunk-delivery')
|
|
604
697
|
```
|
|
605
698
|
|
|
606
|
-
[Configurator Interface → Loaded Configuration UI](?path=/docs/phoenix-configurator-interface--docs#loaded-configuration-ui) lists the messages the hook does not deliver:
|
|
699
|
+
[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.
|
|
607
700
|
|
|
608
701
|
## Request a quote
|
|
609
702
|
|
|
@@ -641,7 +734,7 @@ export default phx.frontend.createPhoenixHandler('requestQuote', () => {
|
|
|
641
734
|
|
|
642
735
|
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()`.
|
|
643
736
|
|
|
644
|
-
The
|
|
737
|
+
The review step offers the spec's primary finalize action, or the first one when none is primary, with `phx.frontend.useFinalizeActions()`. The hook lists the active `finalizeAction` components with what a button needs, the label and the title resolved to the customer's language, and runs their handlers itself, beside the layout, so the buttons need no handler boundary and the component may be called anywhere and as often as the layout likes. **Back to the configuration** lives in the same component, so it can be disabled while the request is pending.
|
|
645
738
|
|
|
646
739
|
```tsx
|
|
647
740
|
import { Alert, Box, Button, CircularProgress, Typography } from '@mui/material'
|
|
@@ -651,39 +744,40 @@ import { phx } from '../../.phoenix/phx.js'
|
|
|
651
744
|
const BUTTON_SX = { minBlockSize: 48, borderRadius: 999, textTransform: 'none', fontWeight: 600 } as const
|
|
652
745
|
|
|
653
746
|
interface ReviewActionsProps {
|
|
654
|
-
readonly handler: string
|
|
655
|
-
readonly label: string
|
|
656
747
|
readonly onBack: () => void
|
|
657
748
|
}
|
|
658
749
|
|
|
659
|
-
// The review step's buttons:
|
|
660
|
-
//
|
|
661
|
-
//
|
|
662
|
-
//
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
const
|
|
750
|
+
// The review step's buttons: the spec's primary finalize action and the way back. `useFinalizeActions` runs the
|
|
751
|
+
// action's handler beside the layout, so its pending state and error outlive this component: when the panel unmounts,
|
|
752
|
+
// as in fullscreen, the request goes on and the remounted buttons still show it. Back is disabled while the request
|
|
753
|
+
// is pending, so the customer cannot change the configuration while it is sent.
|
|
754
|
+
export const ReviewActions = ({ onBack }: ReviewActionsProps) => {
|
|
755
|
+
const { primary, hints } = phx.frontend.useFinalizeActions()
|
|
756
|
+
const isPending = primary?.isPending ?? false
|
|
666
757
|
|
|
667
758
|
return (
|
|
668
759
|
<Box component="div" sx={{ display: 'grid', gap: 2 }}>
|
|
669
|
-
|
|
670
|
-
<
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
760
|
+
{primary && (
|
|
761
|
+
<Box component="div" sx={{ display: 'grid', gap: 1 }}>
|
|
762
|
+
<Button
|
|
763
|
+
size="large"
|
|
764
|
+
variant="contained"
|
|
765
|
+
disabled={primary.disabled || isPending}
|
|
766
|
+
onClick={() => void primary.run()}
|
|
767
|
+
title={primary.title}
|
|
768
|
+
startIcon={isPending ? <CircularProgress size={18} color="inherit" /> : undefined}
|
|
769
|
+
sx={BUTTON_SX}
|
|
770
|
+
>
|
|
771
|
+
{isPending ? 'Sending the request…' : primary.label}
|
|
772
|
+
</Button>
|
|
773
|
+
{primary.disabled && hints && (
|
|
774
|
+
<Typography variant="caption" color="text.secondary">
|
|
775
|
+
{hints}
|
|
776
|
+
</Typography>
|
|
777
|
+
)}
|
|
778
|
+
{primary.error && <Alert severity="error">The request could not be sent: {primary.error.message}</Alert>}
|
|
779
|
+
</Box>
|
|
780
|
+
)}
|
|
687
781
|
<Button size="large" variant="outlined" disabled={isPending} onClick={onBack} sx={BUTTON_SX}>
|
|
688
782
|
Back to the configuration
|
|
689
783
|
</Button>
|
|
@@ -692,22 +786,30 @@ export const ReviewActions = ({ handler, label, onBack }: ReviewActionsProps) =>
|
|
|
692
786
|
}
|
|
693
787
|
```
|
|
694
788
|
|
|
695
|
-
- `
|
|
696
|
-
-
|
|
789
|
+
- `primary` is the first `'primary'` action, or else the first action, or `null` when the spec has none; the component then shows only **Back to the configuration**. `secondary` holds the others, which this product does not have.
|
|
790
|
+
- `run()` records the finalize-button click for analytics and runs the handler; it does nothing while `disabled` or `isPending`, and returns a promise that never rejects.
|
|
791
|
+
- 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. The configurator keeps `isPending` and `error` while the layout's components unmount: entering fullscreen during the request removes the panel, and the panel shown after fullscreen still shows the spinner until the handler settles.
|
|
697
792
|
- `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.
|
|
698
793
|
- `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.
|
|
699
794
|
|
|
700
|
-
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.
|
|
795
|
+
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 `phx.frontend.useFinalizeAction(handler)`, which runs one known action inside the layout instead, and [Finalization](?path=/docs/phoenix-finalization--docs) what a real flow does on the server.
|
|
701
796
|
|
|
702
797
|
## Serve read mode
|
|
703
798
|
|
|
704
|
-
|
|
799
|
+
A configuration is in read mode by one of two routes, and the layout does not need to know which:
|
|
800
|
+
|
|
801
|
+
- **A configuration shared for viewing.** The configuration is opened with `read-revision` access, as a viewer of a shared link opens it. The `read` mock template sets that access, and the **Read Mode** story below opens it.
|
|
802
|
+
- **The host page sets `readonly`.** The page that embeds the configurator sets the web component's `readonly` property, here on a configuration the user owns. The mock template `mocks/readonly-host.yaml`, **Host sets readonly** in the editor's **Mocks** panel, keeps `access: owner` and sets the property with `webComponentProperties: { readonly: true }`.
|
|
803
|
+
|
|
804
|
+
Both routes set `accessInfo.viewMode` to `true`, and both switch the spec's filter mode to read, so a component filtered with `$filter.modes: [owner]` is left out either way. While `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; neither the finalize action nor undo and redo are offered, since `useFinalizeActions` and `useUndoRedo` do not check read mode themselves. 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).
|
|
805
|
+
|
|
806
|
+
A viewer of a shared configuration has no way here to edit a copy of it; see **Clone to edit in read mode** in [Known gaps](#known-gaps).
|
|
705
807
|
|
|
706
808
|
## Fit a phone
|
|
707
809
|
|
|
708
810
|
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.
|
|
709
811
|
|
|
710
|
-
**The switch.** `useActiveViewports()`
|
|
812
|
+
**The switch.** `phx.frontend.useActiveViewports()` 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.
|
|
711
813
|
|
|
712
814
|
| Value | When it is active |
|
|
713
815
|
| ----------- | ---------------------------------------------------------------------------------- |
|
|
@@ -886,10 +988,10 @@ export const BottomSheet = ({ open, onOpenChange, label, children }: BottomSheet
|
|
|
886
988
|
|
|
887
989
|
- 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.
|
|
888
990
|
- 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.
|
|
889
|
-
- 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.
|
|
991
|
+
- While the handle is dragged the sheet follows the finger with a `transform`. `phx.frontend.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.
|
|
890
992
|
- 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.
|
|
891
993
|
|
|
892
|
-
**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
|
|
994
|
+
**What else moves.** The toast sits at the top of the free area, below the row of undo, redo and fullscreen buttons, 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. Fullscreen removes the sheet as it removes the panel on a desktop. The sheet keeps its position while fullscreen is on.
|
|
893
995
|
|
|
894
996
|
**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:
|
|
895
997
|
|
|
@@ -1015,9 +1117,156 @@ export default phx.frontend.createCustomPhoenixEntityElement('EdgeFinishHotspot'
|
|
|
1015
1117
|
|
|
1016
1118
|
[Html Hotspots](?path=/docs/controls-scene-html-hotspots--docs) describes the component and its other properties.
|
|
1017
1119
|
|
|
1120
|
+
The SDK's own controls on the product, such as `sceneEntityAddFab` and `sceneEntitySelectHotspot`, keep the SDK's look in a project layout too. Each is rendered through an entity element of its own name, so a project gives it the brand's look by registering that name, for example with `phx.frontend.createAddEntityFab`; see [Configurator Interface → In-Scene Controls](?path=/docs/phoenix-configurator-interface--docs#in-scene-controls). `htmlHotspot` is for a control the SDK has none of, like this one.
|
|
1121
|
+
|
|
1122
|
+
## Control the scene
|
|
1123
|
+
|
|
1124
|
+
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.
|
|
1125
|
+
|
|
1126
|
+
**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:
|
|
1127
|
+
|
|
1128
|
+
```yaml
|
|
1129
|
+
viewStates:
|
|
1130
|
+
- overview
|
|
1131
|
+
- edge
|
|
1132
|
+
|
|
1133
|
+
components:
|
|
1134
|
+
Table:
|
|
1135
|
+
fitRootPerspectiveCamera:
|
|
1136
|
+
edge:
|
|
1137
|
+
priority: 4
|
|
1138
|
+
fov: 35
|
|
1139
|
+
near: 100
|
|
1140
|
+
far: 10000
|
|
1141
|
+
minDistance: 800
|
|
1142
|
+
maxDistance: 9000
|
|
1143
|
+
distance: 2000
|
|
1144
|
+
azimuthAngle: 0.5
|
|
1145
|
+
polarAngle: 1.15
|
|
1146
|
+
fitMeshChanges: true
|
|
1147
|
+
$filter:
|
|
1148
|
+
viewports: [desktop]
|
|
1149
|
+
viewStates: [edge]
|
|
1150
|
+
edgePhone:
|
|
1151
|
+
priority: 3
|
|
1152
|
+
fov: 35
|
|
1153
|
+
near: 100
|
|
1154
|
+
far: 10000
|
|
1155
|
+
minDistance: 800
|
|
1156
|
+
maxDistance: 12000
|
|
1157
|
+
distance: 3000
|
|
1158
|
+
azimuthAngle: 0.5
|
|
1159
|
+
polarAngle: 1.15
|
|
1160
|
+
fitMeshChanges: true
|
|
1161
|
+
$filter:
|
|
1162
|
+
viewports: [mobile]
|
|
1163
|
+
viewStates: [edge]
|
|
1164
|
+
```
|
|
1165
|
+
|
|
1166
|
+
**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:
|
|
1167
|
+
|
|
1168
|
+
```tsx
|
|
1169
|
+
import { Box, Button, Tooltip } from '@mui/material'
|
|
1170
|
+
|
|
1171
|
+
import { phx } from '../../.phoenix/phx.js'
|
|
1172
|
+
|
|
1173
|
+
// The spec's view states, each with the label of the button that shows it
|
|
1174
|
+
const VIEWS = [
|
|
1175
|
+
{ state: 'overview', label: 'Whole table' },
|
|
1176
|
+
{ state: 'edge', label: 'Edge close-up' },
|
|
1177
|
+
] as const
|
|
1178
|
+
|
|
1179
|
+
const RESET_ICON = 'M4 12a8 8 0 1 0 2.4-5.7M4 4v4h4'
|
|
1180
|
+
|
|
1181
|
+
const SURFACE_SX = {
|
|
1182
|
+
borderRadius: 999,
|
|
1183
|
+
bgcolor: 'background.paper',
|
|
1184
|
+
boxShadow: '0 4px 16px rgba(0, 0, 0, 0.12)',
|
|
1185
|
+
} as const
|
|
1186
|
+
|
|
1187
|
+
const BUTTON_SX = {
|
|
1188
|
+
minBlockSize: 44,
|
|
1189
|
+
minInlineSize: 44,
|
|
1190
|
+
borderRadius: 999,
|
|
1191
|
+
textTransform: 'none',
|
|
1192
|
+
fontWeight: 600,
|
|
1193
|
+
whiteSpace: 'nowrap',
|
|
1194
|
+
} as const
|
|
1195
|
+
|
|
1196
|
+
interface SceneControlsProps {
|
|
1197
|
+
// The reset button shows only its icon, with its label as tooltip and accessible name
|
|
1198
|
+
readonly compact?: boolean
|
|
1199
|
+
// Only the reset button, without the view buttons
|
|
1200
|
+
readonly resetOnly?: boolean
|
|
1201
|
+
}
|
|
1202
|
+
|
|
1203
|
+
// The layout's own camera controls: one button per view state of the spec, and a reset that undoes an orbit
|
|
1204
|
+
export const SceneControls = ({ compact = false, resetOnly = false }: SceneControlsProps) => {
|
|
1205
|
+
const activeView = phx.frontend.useActiveViewState()
|
|
1206
|
+
const setViewState = phx.frontend.useSetViewState()
|
|
1207
|
+
const resetCamera = phx.frontend.useResetCamera()
|
|
1208
|
+
const resetIcon = (
|
|
1209
|
+
<svg viewBox="0 0 24 24" width={20} height={20} fill="none" stroke="currentColor" strokeWidth={2}>
|
|
1210
|
+
<path d={RESET_ICON} />
|
|
1211
|
+
</svg>
|
|
1212
|
+
)
|
|
1213
|
+
|
|
1214
|
+
return (
|
|
1215
|
+
<Box component="div" sx={{ display: 'flex', gap: 1 }}>
|
|
1216
|
+
{!resetOnly && (
|
|
1217
|
+
<Box component="div" role="group" aria-label="View" sx={{ ...SURFACE_SX, display: 'flex' }}>
|
|
1218
|
+
{VIEWS.map(view => {
|
|
1219
|
+
const isActive = activeView === view.state
|
|
1220
|
+
|
|
1221
|
+
return (
|
|
1222
|
+
<Button
|
|
1223
|
+
key={view.state}
|
|
1224
|
+
aria-pressed={isActive}
|
|
1225
|
+
onClick={() => setViewState(view.state)}
|
|
1226
|
+
sx={{
|
|
1227
|
+
...BUTTON_SX,
|
|
1228
|
+
paddingInline: 2,
|
|
1229
|
+
bgcolor: isActive ? 'text.primary' : 'transparent',
|
|
1230
|
+
color: isActive ? 'background.paper' : 'text.primary',
|
|
1231
|
+
'&:hover': { bgcolor: isActive ? 'text.primary' : 'action.hover' },
|
|
1232
|
+
}}
|
|
1233
|
+
>
|
|
1234
|
+
{view.label}
|
|
1235
|
+
</Button>
|
|
1236
|
+
)
|
|
1237
|
+
})}
|
|
1238
|
+
</Box>
|
|
1239
|
+
)}
|
|
1240
|
+
<Tooltip title={compact ? 'Reset view' : ''}>
|
|
1241
|
+
<Button
|
|
1242
|
+
onClick={resetCamera}
|
|
1243
|
+
aria-label={compact ? 'Reset view' : undefined}
|
|
1244
|
+
startIcon={compact ? undefined : resetIcon}
|
|
1245
|
+
sx={{
|
|
1246
|
+
...SURFACE_SX,
|
|
1247
|
+
...BUTTON_SX,
|
|
1248
|
+
paddingInline: compact ? 0 : 2,
|
|
1249
|
+
color: 'text.primary',
|
|
1250
|
+
'&:hover': { bgcolor: 'background.paper', boxShadow: '0 6px 20px rgba(0, 0, 0, 0.18)' },
|
|
1251
|
+
}}
|
|
1252
|
+
>
|
|
1253
|
+
{compact ? resetIcon : 'Reset view'}
|
|
1254
|
+
</Button>
|
|
1255
|
+
</Tooltip>
|
|
1256
|
+
</Box>
|
|
1257
|
+
)
|
|
1258
|
+
}
|
|
1259
|
+
```
|
|
1260
|
+
|
|
1261
|
+
- 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.
|
|
1262
|
+
- 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.
|
|
1263
|
+
- 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.
|
|
1264
|
+
- 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.
|
|
1265
|
+
- The hooks need no `viewControls` component. That component configures the built-in layout's view controls and has no effect here.
|
|
1266
|
+
|
|
1018
1267
|
## The spec the layout reads
|
|
1019
1268
|
|
|
1020
|
-
The layout reads four components of the root entity and its navigation states; the scene components are in the complete implementation below.
|
|
1269
|
+
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`.
|
|
1021
1270
|
|
|
1022
1271
|
```yaml
|
|
1023
1272
|
navigationStates:
|
|
@@ -1025,6 +1274,10 @@ navigationStates:
|
|
|
1025
1274
|
- checkout
|
|
1026
1275
|
- requested
|
|
1027
1276
|
|
|
1277
|
+
viewStates:
|
|
1278
|
+
- overview
|
|
1279
|
+
- edge
|
|
1280
|
+
|
|
1028
1281
|
components:
|
|
1029
1282
|
Table:
|
|
1030
1283
|
detail:
|
|
@@ -1069,7 +1322,7 @@ transformers:
|
|
|
1069
1322
|
|
|
1070
1323
|
## Try the example
|
|
1071
1324
|
|
|
1072
|
-
|
|
1325
|
+
Each story names the mock template it opens with `args: { mockTemplate }`: **Example** and **Phone** open `default-user`, and **Read Mode** opens `read`. A template applied from the **Mocks** panel lasts until the story is opened again.
|
|
1073
1326
|
|
|
1074
1327
|
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.
|
|
1075
1328
|
|
|
@@ -1077,35 +1330,44 @@ The same layout in a frame 390 pixels wide, as on a phone. Opened on its own fro
|
|
|
1077
1330
|
|
|
1078
1331
|
- The panel is on the left and the table is centred in the area to the right of it, not in the whole canvas.
|
|
1079
1332
|
- 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.
|
|
1080
|
-
- Choosing **Tree trunk** also shows "Tree trunk edges are cut by hand, so delivery takes three weeks longer." at the bottom of the free area, until its close button is clicked or six seconds pass. Choosing another finish shows nothing.
|
|
1333
|
+
- 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.
|
|
1081
1334
|
- Tab reaches the selected card, and the arrow keys move the selection to the next or previous card.
|
|
1082
1335
|
- Dragging in the area to the right of the panel orbits the camera.
|
|
1083
1336
|
- **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.
|
|
1084
1337
|
- **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.
|
|
1085
1338
|
- **Fullscreen** removes the panel and the table moves to the centre of the canvas; **Exit fullscreen** brings both back.
|
|
1086
|
-
-
|
|
1339
|
+
- In the **Read Mode** story the panel says **View only**, shows the chosen finish and the price, and has no button, so no quote can be requested; **Undo**, **Redo** and the button on the table's edge are not shown, and **Fullscreen**, the view buttons and **Reset view** work.
|
|
1340
|
+
- Applying **Host sets readonly** from the **Mocks** panel in the **Example** story shows the same read mode: **View only**, the chosen finish, no button in the panel, no **Undo**, **Redo** or button on the table's edge. Applying **Default User** brings the cards back.
|
|
1341
|
+
- **Undo** and **Redo** are disabled when the story opens. After choosing **Tree trunk**, **Undo** restores **Square** and $1,290.00 and enables **Redo**; **Redo** chooses **Tree trunk** again at $1,630.00.
|
|
1342
|
+
- **Undo** and **Redo** are not shown in the review step, in the confirmation or in fullscreen.
|
|
1343
|
+
- Clicking **Fullscreen** and **Exit fullscreen** each pushes the `fullscreenButton` user-action event, as an `AnalyticsService.push` line in the browser console shows: without a Google Tag Manager id, Storybook's analytics only log their events with `console.debug`, which the console shows only with its Verbose level enabled.
|
|
1344
|
+
- Entering fullscreen while **Request a quote** is pending and leaving it again shows the panel with the spinner still running, until the thank-you message appears.
|
|
1087
1345
|
- 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.
|
|
1088
1346
|
- Tab reaches the button on the edge, and Enter or Space opens the popover.
|
|
1089
|
-
- The button on the edge is gone in the review step, in the confirmation and
|
|
1347
|
+
- The button on the edge is gone in the review step, in the confirmation and in both read routes, and stays in fullscreen.
|
|
1090
1348
|
- 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.
|
|
1091
1349
|
- 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.
|
|
1092
1350
|
- On the phone, the review step, **Request a quote** and the thank-you message work with the sheet collapsed and open.
|
|
1093
|
-
- On the phone, choosing **Tree trunk** shows the hint at the top of the free area,
|
|
1351
|
+
- On the phone, choosing **Tree trunk** shows the hint at the top of the free area, below the undo, redo and fullscreen buttons.
|
|
1094
1352
|
- 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.
|
|
1353
|
+
- **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.
|
|
1354
|
+
- 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.
|
|
1355
|
+
- 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.
|
|
1356
|
+
- 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.
|
|
1095
1357
|
|
|
1096
1358
|
## Known gaps
|
|
1097
1359
|
|
|
1098
1360
|
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.
|
|
1099
1361
|
|
|
1100
|
-
- **Messages that stay snackbars.** The toast shows violations, side effects and
|
|
1101
|
-
- **Toolbar actions.**
|
|
1102
|
-
- **
|
|
1362
|
+
- **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).
|
|
1363
|
+
- **Toolbar actions.** Measurements, sharing and language switching are not offered; undo and redo are the layout's own buttons, see [Undo and redo](#undo-and-redo). A layout can mount `LayoutSlots.DesktopToolbar` for the toolbar the spec configures, or build its own buttons: `phx.frontend.useToolbarActions()` returns the spec's toolbar as runnable entries, and `phx.frontend.useUndoRedo()`, `useMeasurements()`, `useShareLinks()` and `useLocaleSwitch()` serve single actions, pushing the same analytics events as the built-in buttons; see [Configurator Interface → Hooks for a Project Layout](?path=/docs/phoenix-configurator-interface--docs#hooks-for-a-project-layout).
|
|
1364
|
+
- **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.
|
|
1103
1365
|
- **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`.
|
|
1104
1366
|
- **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.
|
|
1105
|
-
- **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 `
|
|
1106
|
-
- **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()`
|
|
1107
|
-
- **Analytics.** The finalize button records `FinalizeButtonClicked` through `
|
|
1108
|
-
- **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.
|
|
1367
|
+
- **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 `phx.frontend.useIsCloningAllowed()` and `LayoutSlots.CloneToEditDialog`. The example leaves it out because Storybook cannot show the result: the dialog creates and opens the copy, but the mock template keeps its `read-revision` access on every configuration it opens, so the copy opens in read mode again.
|
|
1368
|
+
- **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. `phx.frontend.useCloseAction()` returns the host's close action, or `null` when there is none, as in this Storybook example; the hook that chooses among the three is not exported.
|
|
1369
|
+
- **Analytics.** The finalize button records `FinalizeButtonClicked` through `useFinalizeActions`, the cards record the attribute choice through `useAttributeSelection`, undo and redo record their events through `useUndoRedo`, and the fullscreen button records `FullScreenModeToggled` itself. The review step's navigation buttons, the view buttons, **Reset view**, the sheet's handle and the button on the table's edge record nothing. A layout that wants more events pushes them from `FrontendAnalyticsFactory`, from `@salsita-ai/sdk/configurator`, with `phx.frontend.useAnalytics().push(...)`, as [Offer fullscreen](#offer-fullscreen) does.
|
|
1370
|
+
- **Preview start screen.** The built-in layout shows a preview while `phx.frontend.usePreview().isPreview` is set, which `preview: auto` does on phones without the project opting in. This layout ignores it and always renders the interface.
|
|
1109
1371
|
- **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.
|
|
1110
1372
|
- **"Powered by Salsita" mark.** The built-in layout shows it; a project layout decides whether to mount `LayoutSlots.DesktopPoweredBy`, and this one does not.
|
|
1111
1373
|
|
|
@@ -1114,7 +1376,7 @@ A project layout has only what it renders. This one leaves out the following, ea
|
|
|
1114
1376
|
- [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.
|
|
1115
1377
|
- [Universal](?path=/docs/layouts-universal--docs) is the built-in layout this one replaces.
|
|
1116
1378
|
- [Header / Custom](?path=/docs/layouts-header-custom--docs) replaces only the header, with the price from `useRootEntityPrice()`.
|
|
1117
|
-
- [Canvas Padding](?path=/docs/layouts-canvas-padding--docs) scales the gaps `useSceneSafeArea()` measures.
|
|
1379
|
+
- [Canvas Padding](?path=/docs/layouts-canvas-padding--docs) scales the gaps `phx.frontend.useSceneSafeArea()` measures.
|
|
1118
1380
|
- [Presets / Custom](?path=/docs/layouts-presets-custom--docs) replaces the preset screen the same way.
|
|
1119
1381
|
|
|
1120
1382
|
## Complete Implementation
|
|
@@ -1158,6 +1420,10 @@ navigationStates:
|
|
|
1158
1420
|
- checkout
|
|
1159
1421
|
- requested
|
|
1160
1422
|
|
|
1423
|
+
viewStates:
|
|
1424
|
+
- overview
|
|
1425
|
+
- edge
|
|
1426
|
+
|
|
1161
1427
|
components:
|
|
1162
1428
|
Table:
|
|
1163
1429
|
detail:
|
|
@@ -1229,6 +1495,34 @@ components:
|
|
|
1229
1495
|
fitMeshChanges: true
|
|
1230
1496
|
$filter:
|
|
1231
1497
|
viewports: [mobile]
|
|
1498
|
+
edge:
|
|
1499
|
+
priority: 4
|
|
1500
|
+
fov: 35
|
|
1501
|
+
near: 100
|
|
1502
|
+
far: 10000
|
|
1503
|
+
minDistance: 800
|
|
1504
|
+
maxDistance: 9000
|
|
1505
|
+
distance: 2000
|
|
1506
|
+
azimuthAngle: 0.5
|
|
1507
|
+
polarAngle: 1.15
|
|
1508
|
+
fitMeshChanges: true
|
|
1509
|
+
$filter:
|
|
1510
|
+
viewports: [desktop]
|
|
1511
|
+
viewStates: [edge]
|
|
1512
|
+
edgePhone:
|
|
1513
|
+
priority: 3
|
|
1514
|
+
fov: 35
|
|
1515
|
+
near: 100
|
|
1516
|
+
far: 10000
|
|
1517
|
+
minDistance: 800
|
|
1518
|
+
maxDistance: 12000
|
|
1519
|
+
distance: 3000
|
|
1520
|
+
azimuthAngle: 0.5
|
|
1521
|
+
polarAngle: 1.15
|
|
1522
|
+
fitMeshChanges: true
|
|
1523
|
+
$filter:
|
|
1524
|
+
viewports: [mobile]
|
|
1525
|
+
viewStates: [edge]
|
|
1232
1526
|
sceneEntityRemoteObject:
|
|
1233
1527
|
top:
|
|
1234
1528
|
fileUrl: /models/tables.gltf
|
|
@@ -1446,7 +1740,9 @@ export const BottomSheet = ({ open, onOpenChange, label, children }: BottomSheet
|
|
|
1446
1740
|
import { Box, ButtonBase, type SxProps, type Theme, Typography } from '@mui/material'
|
|
1447
1741
|
import type { KeyboardEvent } from 'react'
|
|
1448
1742
|
|
|
1449
|
-
import {
|
|
1743
|
+
import type { UseAttributeSelection } from '@salsita-ai/sdk/react'
|
|
1744
|
+
|
|
1745
|
+
import { phx } from '../../.phoenix/phx.js'
|
|
1450
1746
|
|
|
1451
1747
|
// Cross-sections of the tabletop's edge, keyed by the option values of the spec.
|
|
1452
1748
|
const EDGE_PROFILES: Readonly<Record<string, string>> = {
|
|
@@ -1483,7 +1779,7 @@ interface EdgeFinishCardsProps {
|
|
|
1483
1779
|
}
|
|
1484
1780
|
|
|
1485
1781
|
export const EdgeFinishCards = ({ selection }: EdgeFinishCardsProps) => {
|
|
1486
|
-
const resolve = useResolveLocalizable()
|
|
1782
|
+
const resolve = phx.frontend.useResolveLocalizable()
|
|
1487
1783
|
const { options } = selection
|
|
1488
1784
|
// The card in the tab order: the selected one, or the first enabled one. Disabled cards are never in it.
|
|
1489
1785
|
const selectedIndex = options.findIndex(option => option.value === selection.value && !option.disabled)
|
|
@@ -1580,6 +1876,8 @@ export const EdgeFinishCards = ({ selection }: EdgeFinishCardsProps) => {
|
|
|
1580
1876
|
```tsx
|
|
1581
1877
|
import { Button, Tooltip } from '@mui/material'
|
|
1582
1878
|
|
|
1879
|
+
import { FrontendAnalyticsFactory } from '@salsita-ai/sdk/configurator'
|
|
1880
|
+
|
|
1583
1881
|
import { phx } from '../../.phoenix/phx.js'
|
|
1584
1882
|
|
|
1585
1883
|
const ENTER_ICON = 'M4 9V4h5M15 4h5v5M20 15v5h-5M9 20H4v-5'
|
|
@@ -1593,6 +1891,7 @@ interface FullscreenToggleProps {
|
|
|
1593
1891
|
export const FullscreenToggle = ({ compact = false }: FullscreenToggleProps) => {
|
|
1594
1892
|
const isFullscreen = phx.frontend.useIsFullscreenActive()
|
|
1595
1893
|
const setFullscreen = phx.frontend.useSetFullscreen()
|
|
1894
|
+
const analytics = phx.frontend.useAnalytics()
|
|
1596
1895
|
const label = isFullscreen ? 'Exit fullscreen' : 'Fullscreen'
|
|
1597
1896
|
const icon = (
|
|
1598
1897
|
<svg viewBox="0 0 24 24" width={20} height={20} fill="none" stroke="currentColor" strokeWidth={2}>
|
|
@@ -1600,10 +1899,16 @@ export const FullscreenToggle = ({ compact = false }: FullscreenToggleProps) =>
|
|
|
1600
1899
|
</svg>
|
|
1601
1900
|
)
|
|
1602
1901
|
|
|
1902
|
+
// The same event the built-in fullscreen button records, for entering and for leaving
|
|
1903
|
+
const toggle = () => {
|
|
1904
|
+
analytics.push(FrontendAnalyticsFactory.FullScreenModeToggled())
|
|
1905
|
+
setFullscreen(!isFullscreen)
|
|
1906
|
+
}
|
|
1907
|
+
|
|
1603
1908
|
return (
|
|
1604
1909
|
<Tooltip title={compact ? label : ''}>
|
|
1605
1910
|
<Button
|
|
1606
|
-
onClick={
|
|
1911
|
+
onClick={toggle}
|
|
1607
1912
|
aria-label={compact ? label : undefined}
|
|
1608
1913
|
startIcon={compact ? undefined : icon}
|
|
1609
1914
|
sx={{
|
|
@@ -1645,7 +1950,7 @@ const severityOf = (message: ConfiguratorMessage) => {
|
|
|
1645
1950
|
return VIOLATION_SEVERITY[message.violation.severity]
|
|
1646
1951
|
}
|
|
1647
1952
|
|
|
1648
|
-
return message.kind === 'error' ? 'error' : 'info'
|
|
1953
|
+
return message.kind === 'error' || message.kind === 'saveError' ? 'error' : 'info'
|
|
1649
1954
|
}
|
|
1650
1955
|
|
|
1651
1956
|
export const MessageToast = () => {
|
|
@@ -1687,8 +1992,7 @@ export const MessageToast = () => {
|
|
|
1687
1992
|
```tsx
|
|
1688
1993
|
import { Box, Button, Typography } from '@mui/material'
|
|
1689
1994
|
|
|
1690
|
-
import { detailComponent
|
|
1691
|
-
import { PhoenixHandlerBoundary, useResolveLocalizable } from '@salsita-ai/sdk/react'
|
|
1995
|
+
import { detailComponent } from '@salsita-ai/sdk/domain'
|
|
1692
1996
|
|
|
1693
1997
|
import { phx } from '../../.phoenix/phx.js'
|
|
1694
1998
|
import { EdgeFinishCards } from './EdgeFinishCards.js'
|
|
@@ -1704,7 +2008,7 @@ interface ProductPanelProps {
|
|
|
1704
2008
|
}
|
|
1705
2009
|
|
|
1706
2010
|
export const ProductPanel = ({ collapsed = false, inSheet = false }: ProductPanelProps) => {
|
|
1707
|
-
const resolve = useResolveLocalizable()
|
|
2011
|
+
const resolve = phx.frontend.useResolveLocalizable()
|
|
1708
2012
|
const detail = phx.frontend.useFirstRootComponent(detailComponent)
|
|
1709
2013
|
const price = phx.frontend.useRootEntityPrice()
|
|
1710
2014
|
const tableId = phx.frontend.useRootEntityId()
|
|
@@ -1714,12 +2018,9 @@ export const ProductPanel = ({ collapsed = false, inSheet = false }: ProductPane
|
|
|
1714
2018
|
const pushNavigate = phx.frontend.usePushNavigate()
|
|
1715
2019
|
const popNavigate = phx.frontend.usePopNavigate()
|
|
1716
2020
|
const navigate = phx.frontend.useNavigate()
|
|
1717
|
-
const finalizeActions = phx.frontend.useComponents({ componentTypes: [finalizeActionComponent] }) ?? []
|
|
1718
2021
|
|
|
1719
2022
|
const isReadMode = accessInfo.viewMode
|
|
1720
2023
|
const isReview = isReadMode || navigationState !== 'configure'
|
|
1721
|
-
// The spec's primary finalize action, or its first one
|
|
1722
|
-
const quoteAction = finalizeActions.find(action => action.state.variant === 'primary') ?? finalizeActions[0]
|
|
1723
2024
|
const chosenEdge = edgeFinish.options.find(option => option.value === edgeFinish.value)
|
|
1724
2025
|
|
|
1725
2026
|
return (
|
|
@@ -1797,19 +2098,7 @@ export const ProductPanel = ({ collapsed = false, inSheet = false }: ProductPane
|
|
|
1797
2098
|
<Typography variant="body2" color="text.secondary">
|
|
1798
2099
|
Your table is ready for a quote. A real shop collects the contact details here.
|
|
1799
2100
|
</Typography>
|
|
1800
|
-
{
|
|
1801
|
-
<PhoenixHandlerBoundary name={quoteAction.state.handler}>
|
|
1802
|
-
<ReviewActions
|
|
1803
|
-
handler={quoteAction.state.handler}
|
|
1804
|
-
label={resolve(quoteAction.state.label)}
|
|
1805
|
-
onBack={popNavigate}
|
|
1806
|
-
/>
|
|
1807
|
-
</PhoenixHandlerBoundary>
|
|
1808
|
-
) : (
|
|
1809
|
-
<Button size="large" variant="outlined" onClick={popNavigate} sx={BUTTON_SX}>
|
|
1810
|
-
Back to the configuration
|
|
1811
|
-
</Button>
|
|
1812
|
-
)}
|
|
2101
|
+
<ReviewActions onBack={popNavigate} />
|
|
1813
2102
|
</>
|
|
1814
2103
|
)}
|
|
1815
2104
|
{!isReadMode && navigationState === 'requested' && (
|
|
@@ -1838,39 +2127,40 @@ import { phx } from '../../.phoenix/phx.js'
|
|
|
1838
2127
|
const BUTTON_SX = { minBlockSize: 48, borderRadius: 999, textTransform: 'none', fontWeight: 600 } as const
|
|
1839
2128
|
|
|
1840
2129
|
interface ReviewActionsProps {
|
|
1841
|
-
readonly handler: string
|
|
1842
|
-
readonly label: string
|
|
1843
2130
|
readonly onBack: () => void
|
|
1844
2131
|
}
|
|
1845
2132
|
|
|
1846
|
-
// The review step's buttons:
|
|
1847
|
-
//
|
|
1848
|
-
//
|
|
1849
|
-
//
|
|
1850
|
-
|
|
1851
|
-
|
|
1852
|
-
const
|
|
2133
|
+
// The review step's buttons: the spec's primary finalize action and the way back. `useFinalizeActions` runs the
|
|
2134
|
+
// action's handler beside the layout, so its pending state and error outlive this component: when the panel unmounts,
|
|
2135
|
+
// as in fullscreen, the request goes on and the remounted buttons still show it. Back is disabled while the request
|
|
2136
|
+
// is pending, so the customer cannot change the configuration while it is sent.
|
|
2137
|
+
export const ReviewActions = ({ onBack }: ReviewActionsProps) => {
|
|
2138
|
+
const { primary, hints } = phx.frontend.useFinalizeActions()
|
|
2139
|
+
const isPending = primary?.isPending ?? false
|
|
1853
2140
|
|
|
1854
2141
|
return (
|
|
1855
2142
|
<Box component="div" sx={{ display: 'grid', gap: 2 }}>
|
|
1856
|
-
|
|
1857
|
-
<
|
|
1858
|
-
|
|
1859
|
-
|
|
1860
|
-
|
|
1861
|
-
|
|
1862
|
-
|
|
1863
|
-
|
|
1864
|
-
|
|
1865
|
-
|
|
1866
|
-
|
|
1867
|
-
|
|
1868
|
-
|
|
1869
|
-
|
|
1870
|
-
|
|
1871
|
-
|
|
1872
|
-
|
|
1873
|
-
|
|
2143
|
+
{primary && (
|
|
2144
|
+
<Box component="div" sx={{ display: 'grid', gap: 1 }}>
|
|
2145
|
+
<Button
|
|
2146
|
+
size="large"
|
|
2147
|
+
variant="contained"
|
|
2148
|
+
disabled={primary.disabled || isPending}
|
|
2149
|
+
onClick={() => void primary.run()}
|
|
2150
|
+
title={primary.title}
|
|
2151
|
+
startIcon={isPending ? <CircularProgress size={18} color="inherit" /> : undefined}
|
|
2152
|
+
sx={BUTTON_SX}
|
|
2153
|
+
>
|
|
2154
|
+
{isPending ? 'Sending the request…' : primary.label}
|
|
2155
|
+
</Button>
|
|
2156
|
+
{primary.disabled && hints && (
|
|
2157
|
+
<Typography variant="caption" color="text.secondary">
|
|
2158
|
+
{hints}
|
|
2159
|
+
</Typography>
|
|
2160
|
+
)}
|
|
2161
|
+
{primary.error && <Alert severity="error">The request could not be sent: {primary.error.message}</Alert>}
|
|
2162
|
+
</Box>
|
|
2163
|
+
)}
|
|
1874
2164
|
<Button size="large" variant="outlined" disabled={isPending} onClick={onBack} sx={BUTTON_SX}>
|
|
1875
2165
|
Back to the configuration
|
|
1876
2166
|
</Button>
|
|
@@ -1879,20 +2169,182 @@ export const ReviewActions = ({ handler, label, onBack }: ReviewActionsProps) =>
|
|
|
1879
2169
|
}
|
|
1880
2170
|
```
|
|
1881
2171
|
|
|
2172
|
+
### ./src/\_shared/SceneControls.tsx
|
|
2173
|
+
|
|
2174
|
+
```tsx
|
|
2175
|
+
import { Box, Button, Tooltip } from '@mui/material'
|
|
2176
|
+
|
|
2177
|
+
import { phx } from '../../.phoenix/phx.js'
|
|
2178
|
+
|
|
2179
|
+
// The spec's view states, each with the label of the button that shows it
|
|
2180
|
+
const VIEWS = [
|
|
2181
|
+
{ state: 'overview', label: 'Whole table' },
|
|
2182
|
+
{ state: 'edge', label: 'Edge close-up' },
|
|
2183
|
+
] as const
|
|
2184
|
+
|
|
2185
|
+
const RESET_ICON = 'M4 12a8 8 0 1 0 2.4-5.7M4 4v4h4'
|
|
2186
|
+
|
|
2187
|
+
const SURFACE_SX = {
|
|
2188
|
+
borderRadius: 999,
|
|
2189
|
+
bgcolor: 'background.paper',
|
|
2190
|
+
boxShadow: '0 4px 16px rgba(0, 0, 0, 0.12)',
|
|
2191
|
+
} as const
|
|
2192
|
+
|
|
2193
|
+
const BUTTON_SX = {
|
|
2194
|
+
minBlockSize: 44,
|
|
2195
|
+
minInlineSize: 44,
|
|
2196
|
+
borderRadius: 999,
|
|
2197
|
+
textTransform: 'none',
|
|
2198
|
+
fontWeight: 600,
|
|
2199
|
+
whiteSpace: 'nowrap',
|
|
2200
|
+
} as const
|
|
2201
|
+
|
|
2202
|
+
interface SceneControlsProps {
|
|
2203
|
+
// The reset button shows only its icon, with its label as tooltip and accessible name
|
|
2204
|
+
readonly compact?: boolean
|
|
2205
|
+
// Only the reset button, without the view buttons
|
|
2206
|
+
readonly resetOnly?: boolean
|
|
2207
|
+
}
|
|
2208
|
+
|
|
2209
|
+
// The layout's own camera controls: one button per view state of the spec, and a reset that undoes an orbit
|
|
2210
|
+
export const SceneControls = ({ compact = false, resetOnly = false }: SceneControlsProps) => {
|
|
2211
|
+
const activeView = phx.frontend.useActiveViewState()
|
|
2212
|
+
const setViewState = phx.frontend.useSetViewState()
|
|
2213
|
+
const resetCamera = phx.frontend.useResetCamera()
|
|
2214
|
+
const resetIcon = (
|
|
2215
|
+
<svg viewBox="0 0 24 24" width={20} height={20} fill="none" stroke="currentColor" strokeWidth={2}>
|
|
2216
|
+
<path d={RESET_ICON} />
|
|
2217
|
+
</svg>
|
|
2218
|
+
)
|
|
2219
|
+
|
|
2220
|
+
return (
|
|
2221
|
+
<Box component="div" sx={{ display: 'flex', gap: 1 }}>
|
|
2222
|
+
{!resetOnly && (
|
|
2223
|
+
<Box component="div" role="group" aria-label="View" sx={{ ...SURFACE_SX, display: 'flex' }}>
|
|
2224
|
+
{VIEWS.map(view => {
|
|
2225
|
+
const isActive = activeView === view.state
|
|
2226
|
+
|
|
2227
|
+
return (
|
|
2228
|
+
<Button
|
|
2229
|
+
key={view.state}
|
|
2230
|
+
aria-pressed={isActive}
|
|
2231
|
+
onClick={() => setViewState(view.state)}
|
|
2232
|
+
sx={{
|
|
2233
|
+
...BUTTON_SX,
|
|
2234
|
+
paddingInline: 2,
|
|
2235
|
+
bgcolor: isActive ? 'text.primary' : 'transparent',
|
|
2236
|
+
color: isActive ? 'background.paper' : 'text.primary',
|
|
2237
|
+
'&:hover': { bgcolor: isActive ? 'text.primary' : 'action.hover' },
|
|
2238
|
+
}}
|
|
2239
|
+
>
|
|
2240
|
+
{view.label}
|
|
2241
|
+
</Button>
|
|
2242
|
+
)
|
|
2243
|
+
})}
|
|
2244
|
+
</Box>
|
|
2245
|
+
)}
|
|
2246
|
+
<Tooltip title={compact ? 'Reset view' : ''}>
|
|
2247
|
+
<Button
|
|
2248
|
+
onClick={resetCamera}
|
|
2249
|
+
aria-label={compact ? 'Reset view' : undefined}
|
|
2250
|
+
startIcon={compact ? undefined : resetIcon}
|
|
2251
|
+
sx={{
|
|
2252
|
+
...SURFACE_SX,
|
|
2253
|
+
...BUTTON_SX,
|
|
2254
|
+
paddingInline: compact ? 0 : 2,
|
|
2255
|
+
color: 'text.primary',
|
|
2256
|
+
'&:hover': { bgcolor: 'background.paper', boxShadow: '0 6px 20px rgba(0, 0, 0, 0.18)' },
|
|
2257
|
+
}}
|
|
2258
|
+
>
|
|
2259
|
+
{compact ? resetIcon : 'Reset view'}
|
|
2260
|
+
</Button>
|
|
2261
|
+
</Tooltip>
|
|
2262
|
+
</Box>
|
|
2263
|
+
)
|
|
2264
|
+
}
|
|
2265
|
+
```
|
|
2266
|
+
|
|
2267
|
+
### ./src/\_shared/UndoRedo.tsx
|
|
2268
|
+
|
|
2269
|
+
```tsx
|
|
2270
|
+
import { Box, IconButton, Tooltip } from '@mui/material'
|
|
2271
|
+
|
|
2272
|
+
import { phx } from '../../.phoenix/phx.js'
|
|
2273
|
+
|
|
2274
|
+
const UNDO_ICON = 'M9 14 4 9l5-5M4 9h10.5a5.5 5.5 0 0 1 0 11H11'
|
|
2275
|
+
const REDO_ICON = 'M15 14l5-5-5-5M20 9H9.5a5.5 5.5 0 0 0 0 11H13'
|
|
2276
|
+
|
|
2277
|
+
interface HistoryButtonProps {
|
|
2278
|
+
readonly label: string
|
|
2279
|
+
readonly icon: string
|
|
2280
|
+
readonly enabled: boolean
|
|
2281
|
+
readonly onClick: () => void
|
|
2282
|
+
}
|
|
2283
|
+
|
|
2284
|
+
const HistoryButton = ({ label, icon, enabled, onClick }: HistoryButtonProps) => (
|
|
2285
|
+
<Tooltip title={label}>
|
|
2286
|
+
{/* A disabled button fires no pointer events, so the span keeps the tooltip working */}
|
|
2287
|
+
<span>
|
|
2288
|
+
<IconButton
|
|
2289
|
+
aria-label={label}
|
|
2290
|
+
disabled={!enabled}
|
|
2291
|
+
onClick={onClick}
|
|
2292
|
+
sx={{ inlineSize: 44, blockSize: 44, color: 'text.primary' }}
|
|
2293
|
+
>
|
|
2294
|
+
<svg viewBox="0 0 24 24" width={20} height={20} fill="none" stroke="currentColor" strokeWidth={2}>
|
|
2295
|
+
<path d={icon} />
|
|
2296
|
+
</svg>
|
|
2297
|
+
</IconButton>
|
|
2298
|
+
</span>
|
|
2299
|
+
</Tooltip>
|
|
2300
|
+
)
|
|
2301
|
+
|
|
2302
|
+
// Undo and redo for the customer's choices. They change the configuration, so they are offered only where the cards
|
|
2303
|
+
// are: not to a viewer, and not in the review step, where the summary and a running request must not change under the
|
|
2304
|
+
// customer. `useUndoRedo` pushes the same analytics events as the built-in toolbar's buttons.
|
|
2305
|
+
export const UndoRedo = () => {
|
|
2306
|
+
const { canUndo, canRedo, undo, redo } = phx.frontend.useUndoRedo()
|
|
2307
|
+
const { accessInfo } = phx.frontend.useAccessService()
|
|
2308
|
+
const navigationState = phx.frontend.useActiveNavigationState()
|
|
2309
|
+
|
|
2310
|
+
if (accessInfo.viewMode || navigationState !== 'configure') {
|
|
2311
|
+
return null
|
|
2312
|
+
}
|
|
2313
|
+
|
|
2314
|
+
return (
|
|
2315
|
+
<Box
|
|
2316
|
+
component="div"
|
|
2317
|
+
role="group"
|
|
2318
|
+
aria-label="History"
|
|
2319
|
+
sx={{
|
|
2320
|
+
display: 'flex',
|
|
2321
|
+
borderRadius: 999,
|
|
2322
|
+
bgcolor: 'background.paper',
|
|
2323
|
+
boxShadow: '0 4px 16px rgba(0, 0, 0, 0.12)',
|
|
2324
|
+
}}
|
|
2325
|
+
>
|
|
2326
|
+
<HistoryButton label="Undo" icon={UNDO_ICON} enabled={canUndo} onClick={undo} />
|
|
2327
|
+
<HistoryButton label="Redo" icon={REDO_ICON} enabled={canRedo} onClick={redo} />
|
|
2328
|
+
</Box>
|
|
2329
|
+
)
|
|
2330
|
+
}
|
|
2331
|
+
```
|
|
2332
|
+
|
|
1882
2333
|
### ./src/elements/ConfiguratorLayout.tsx
|
|
1883
2334
|
|
|
1884
2335
|
```tsx
|
|
1885
2336
|
import { Box } from '@mui/material'
|
|
1886
2337
|
import { useState } from 'react'
|
|
1887
2338
|
|
|
1888
|
-
import { LayoutSlots
|
|
1889
|
-
import { useActiveViewports } from '@salsita-ai/sdk/react'
|
|
2339
|
+
import { LayoutSlots } from '@salsita-ai/sdk/configurator'
|
|
1890
2340
|
|
|
1891
2341
|
import { phx } from '../../.phoenix/phx.js'
|
|
1892
2342
|
import { BottomSheet } from '../_shared/BottomSheet.js'
|
|
1893
2343
|
import { FullscreenToggle } from '../_shared/FullscreenToggle.js'
|
|
1894
2344
|
import { MessageToast } from '../_shared/MessageToast.js'
|
|
1895
2345
|
import { ProductPanel } from '../_shared/ProductPanel.js'
|
|
2346
|
+
import { SceneControls } from '../_shared/SceneControls.js'
|
|
2347
|
+
import { UndoRedo } from '../_shared/UndoRedo.js'
|
|
1896
2348
|
|
|
1897
2349
|
const GUTTER = 24
|
|
1898
2350
|
const PANEL_WIDTH = 380
|
|
@@ -1900,10 +2352,10 @@ const PHONE_GUTTER = 16
|
|
|
1900
2352
|
const TOUCH_TARGET = 44
|
|
1901
2353
|
|
|
1902
2354
|
const ConfiguratorLayout = () => {
|
|
1903
|
-
const { containerRef, safeAreaRef } = useSceneSafeArea()
|
|
2355
|
+
const { containerRef, safeAreaRef } = phx.frontend.useSceneSafeArea()
|
|
1904
2356
|
const isFullscreen = phx.frontend.useIsFullscreenActive()
|
|
1905
2357
|
// `null` until the container has been measured; the layout shows only the scene until then
|
|
1906
|
-
const viewports = useActiveViewports()
|
|
2358
|
+
const viewports = phx.frontend.useActiveViewports()
|
|
1907
2359
|
const [isSheetOpen, setSheetOpen] = useState(false)
|
|
1908
2360
|
|
|
1909
2361
|
const isDesktop = viewports?.includes('desktop') ?? false
|
|
@@ -1962,8 +2414,16 @@ const ConfiguratorLayout = () => {
|
|
|
1962
2414
|
>
|
|
1963
2415
|
<Box
|
|
1964
2416
|
component="div"
|
|
1965
|
-
sx={{
|
|
2417
|
+
sx={{
|
|
2418
|
+
position: 'absolute',
|
|
2419
|
+
insetBlockStart: gutter,
|
|
2420
|
+
insetInlineEnd: gutter,
|
|
2421
|
+
display: 'flex',
|
|
2422
|
+
gap: 1,
|
|
2423
|
+
pointerEvents: 'auto',
|
|
2424
|
+
}}
|
|
1966
2425
|
>
|
|
2426
|
+
{!isFullscreen && <UndoRedo />}
|
|
1967
2427
|
<FullscreenToggle compact={!isDesktop} />
|
|
1968
2428
|
</Box>
|
|
1969
2429
|
<Box
|
|
@@ -1971,14 +2431,26 @@ const ConfiguratorLayout = () => {
|
|
|
1971
2431
|
sx={{
|
|
1972
2432
|
position: 'absolute',
|
|
1973
2433
|
pointerEvents: 'auto',
|
|
1974
|
-
// Desktop: bottom left. Phone: at the top
|
|
2434
|
+
// Desktop: bottom left, above the row of view controls. Phone: at the top below the row of undo, redo and
|
|
2435
|
+
// fullscreen, clear of the sheet's handle and the view controls.
|
|
1975
2436
|
...(isDesktop
|
|
1976
|
-
? { insetBlockEnd: GUTTER, insetInlineStart: GUTTER }
|
|
1977
|
-
: { insetBlockStart: gutter
|
|
2437
|
+
? { insetBlockEnd: 2 * GUTTER + TOUCH_TARGET, insetInlineStart: GUTTER }
|
|
2438
|
+
: { insetBlockStart: gutter + TOUCH_TARGET + gutter / 2, insetInline: gutter }),
|
|
1978
2439
|
}}
|
|
1979
2440
|
>
|
|
1980
2441
|
<MessageToast />
|
|
1981
2442
|
</Box>
|
|
2443
|
+
{/* A phone in fullscreen keeps only the reset, as the built-in layout does. Below 1024 pixels (`tablet`) the
|
|
2444
|
+
free area beside the panel is narrow, so the reset shows only its icon there too. */}
|
|
2445
|
+
<Box
|
|
2446
|
+
component="div"
|
|
2447
|
+
sx={{ position: 'absolute', insetBlockEnd: gutter, insetInlineEnd: gutter, pointerEvents: 'auto' }}
|
|
2448
|
+
>
|
|
2449
|
+
<SceneControls
|
|
2450
|
+
compact={!isDesktop || (viewports?.includes('tablet') ?? false)}
|
|
2451
|
+
resetOnly={!isDesktop && isFullscreen}
|
|
2452
|
+
/>
|
|
2453
|
+
</Box>
|
|
1982
2454
|
</Box>
|
|
1983
2455
|
)}
|
|
1984
2456
|
|