@salsita-ai/sdk 0.50.0-develop.b9eb39baf0 → 0.50.0-develop.bc08a38ffe
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 +3 -3
- package/dist/admin/create-admin-pages-from-spec.d.ts +1 -1
- package/dist/application-spec/core/components/component-filter.d.ts +53 -0
- package/dist/application-spec/core/components/component-filter.js +1 -0
- package/dist/application-spec/core/components/index.d.ts +2 -0
- package/dist/application-spec/core/components/index.js +1 -0
- package/dist/application-spec/core/components/sdk-code-ref.d.ts +9 -0
- package/dist/application-spec/core/components/sdk-code-ref.js +1 -0
- package/dist/application-spec/core/enhanced-json-value.d.ts +0 -68
- package/dist/application-spec/core/enhanced-json-value.js +1 -1
- package/dist/application-spec/core/expressions/index.d.ts +2 -0
- package/dist/application-spec/core/expressions/index.js +1 -0
- package/dist/application-spec/core/expressions/relation-expression-params.d.ts +11 -0
- package/dist/application-spec/core/expressions/sdk-expression-implementation.d.ts +24 -0
- package/dist/application-spec/core/expressions/sdk-expression-implementation.js +1 -0
- package/dist/application-spec/core/index.d.ts +2 -0
- package/dist/application-spec/core/index.js +1 -1
- package/dist/application-spec/core/json-value.d.ts +1 -1
- package/dist/application-spec/{core → enhanced-json}/eval-to-constant.d.ts +1 -1
- package/dist/application-spec/enhanced-json/index.d.ts +4 -0
- package/dist/application-spec/enhanced-json/index.js +1 -0
- package/dist/application-spec/enhanced-json/is-enhanced-json-array.d.ts +2 -0
- package/dist/application-spec/enhanced-json/is-enhanced-json-array.js +1 -0
- package/dist/application-spec/enhanced-json/resolve-enhanced-json-value.d.ts +18 -0
- package/dist/application-spec/enhanced-json/resolve-enhanced-json-value.js +1 -0
- package/dist/application-spec/enhanced-json/schema-from-value.d.ts +24 -0
- package/dist/application-spec/enhanced-json/schema-from-value.js +1 -0
- package/dist/application-spec/enhanced-json/stringify-enhanced-json-value.d.ts +14 -0
- package/dist/application-spec/enhanced-json/stringify-enhanced-json-value.js +1 -0
- package/dist/application-spec/enhanced-json/validate-enhanced-json-value-caps.d.ts +12 -0
- package/dist/application-spec/enhanced-json/validate-enhanced-json-value-caps.js +1 -0
- package/dist/application-spec/enhanced-json/validate-no-legacy-code-ref.d.ts +13 -0
- package/dist/application-spec/enhanced-json/validate-no-legacy-code-ref.js +1 -0
- package/dist/application-spec/errors/diagnostic-codes.d.ts +9 -0
- package/dist/application-spec/errors/diagnostic-codes.js +1 -1
- package/dist/application-spec/errors/diagnostic-messages.d.ts +12 -0
- package/dist/application-spec/errors/diagnostic-messages.js +1 -1
- package/dist/application-spec/generate-application/code/project-scaffolding.d.ts +8 -1
- package/dist/application-spec/generate-application/code/project-scaffolding.js +2 -2
- package/dist/application-spec/generate-application/code/templates/domain-spec/generate-component-optics.js +4 -4
- package/dist/application-spec/generate-application/code/templates/domain-spec/generate-defaults.d.ts +4 -2
- package/dist/application-spec/generate-application/code/templates/domain-spec/generate-defaults.js +1 -1
- package/dist/application-spec/generate-application/code/templates/domain-spec/generate-domain-block.js +56 -56
- package/dist/application-spec/generate-application/code/templates/domain-spec/generate-invariants.d.ts +1 -1
- package/dist/application-spec/generate-application/code/templates/domain-spec/generate-invariants.js +1 -1
- package/dist/application-spec/generate-application/code/templates/domain-spec/generate-phx-globals.js +3 -0
- package/dist/application-spec/generate-application/code/templates/domain-spec/generate-relation-expressions.js +1 -1
- package/dist/application-spec/generate-application/code/templates/domain-spec/generate-resources.d.ts +6 -8
- package/dist/application-spec/generate-application/code/templates/domain-spec/generate-resources.js +11 -11
- package/dist/application-spec/generate-application/code/templates/domain-spec/index.d.ts +1 -1
- package/dist/application-spec/generate-application/code/templates/domain-spec/index.js +1 -1
- package/dist/application-spec/generate-application/code/templates/domain-spec.js +12 -12
- package/dist/application-spec/generate-application/code/templates/domain.js +3 -3
- package/dist/application-spec/generate-application/code/templates/globals.js +5 -4
- package/dist/application-spec/generate-application/code/templates/index.d.ts +0 -7
- package/dist/application-spec/generate-application/code/templates/index.js +1 -1
- package/dist/application-spec/generate-application/code/templates/package-json.js +1 -1
- package/dist/application-spec/generate-application/code/templates/skills/phoenix-create-configurator-skill.js +66 -42
- package/dist/application-spec/generate-application/code/templates/skills/phoenix-review-skill.js +8 -2
- package/dist/application-spec/generate-application/code/templates/skills/phoenix-skill.js +1 -1
- package/dist/application-spec/generate-application/code/templates/skills/sdk-content.d.ts +14 -14
- package/dist/application-spec/generate-application/code/templates/skills/sdk-content.js +6 -8
- package/dist/application-spec/generate-application/code/templates/webhook-builders.js +4 -3
- package/dist/application-spec/generate-application/code/templates/webhooks-config.js +2 -2
- package/dist/application-spec/generate-application/runtime/application-runtime.d.ts +1 -3
- package/dist/application-spec/generate-application/runtime/configurator-runtime/configurator-runtime.d.ts +1 -3
- package/dist/application-spec/generate-application/runtime/sections/build-sdk-optic.d.ts +1 -1
- package/dist/application-spec/generate-application/runtime/sections/build-sdk-optic.js +1 -1
- package/dist/application-spec/generate-application/runtime/sections/component-optic.d.ts +2 -1
- package/dist/application-spec/generate-application/runtime/sections/expression-runtime.js +1 -1
- package/dist/application-spec/generate-application/runtime/sections/transformers-runtime.d.ts +2 -4
- package/dist/application-spec/index.d.ts +1 -0
- package/dist/application-spec/index.js +1 -1
- package/dist/application-spec/parse-application-files/categorize/module-analysis.d.ts +1 -1
- package/dist/application-spec/parse-application-files/categorize/module-analysis.js +1 -1
- package/dist/application-spec/parse-application-files/raw-spec/raw-assistant.d.ts +16 -3
- package/dist/application-spec/parse-application-files/raw-spec/raw-assistant.js +1 -1
- package/dist/application-spec/parse-application-files/raw-spec/raw-spec-file.js +1 -1
- package/dist/application-spec/parse-application-files/spec/application/admin-spec/admin-spec.js +1 -1
- package/dist/application-spec/parse-application-files/spec/application/configurator-spec/configurator-spec.js +1 -1
- package/dist/application-spec/parse-application-files/spec/components/component-entry.d.ts +1 -9
- package/dist/application-spec/parse-application-files/spec/components/component-entry.js +1 -1
- package/dist/application-spec/parse-application-files/spec/components/component-filter.d.ts +1 -54
- package/dist/application-spec/parse-application-files/spec/components/component-filter.js +1 -1
- package/dist/application-spec/parse-application-files/spec/components/index.d.ts +1 -1
- package/dist/application-spec/parse-application-files/spec/components/index.js +1 -1
- package/dist/application-spec/parse-application-files/spec/expressions/expression.d.ts +1 -28
- package/dist/application-spec/parse-application-files/spec/expressions/expression.js +1 -1
- package/dist/application-spec/parse-application-files/spec/expressions/expressions.d.ts +1 -1
- package/dist/application-spec/parse-application-files/spec/expressions/expressions.js +1 -1
- package/dist/application-spec/parse-application-files/spec/expressions/index.d.ts +0 -1
- package/dist/application-spec/parse-application-files/spec/expressions/index.js +1 -1
- package/dist/application-spec/parse-application-files/spec/expressions/memo-eval-plan.js +1 -1
- package/dist/application-spec/parse-application-files/spec/expressions/user-expressions.js +1 -1
- package/dist/application-spec/parse-application-files/spec/model/defaults.d.ts +7 -2
- package/dist/application-spec/parse-application-files/spec/model/defaults.js +1 -1
- package/dist/application-spec/parse-application-files/spec/relations/reference-field-type.d.ts +25 -0
- package/dist/application-spec/parse-application-files/spec/relations/reference-field-type.js +1 -0
- package/dist/application-spec/parse-application-files/spec/relations/relation-field-mismatch.d.ts +46 -0
- package/dist/application-spec/parse-application-files/spec/relations/relation-field-mismatch.js +1 -0
- package/dist/application-spec/parse-application-files/spec/relations/relations.d.ts +4 -3
- package/dist/application-spec/parse-application-files/spec/relations/relations.js +1 -1
- package/dist/application-spec/parse-application-files/spec/sections/assistant/assistant-schema.js +1 -1
- package/dist/application-spec/parse-application-files/spec/sections/infra.d.ts +2 -0
- package/dist/application-spec/parse-application-files/spec/sections/infra.js +1 -1
- package/dist/client/authorized-client.d.ts +3 -1
- package/dist/client/authorized-client.js +1 -1
- package/dist/client/contract.d.ts +34 -0
- package/dist/client/contract.js +1 -1
- package/dist/client/index.d.ts +2 -2
- package/dist/client/index.js +1 -1
- package/dist/client/local-authorized-client.d.ts +3 -1
- package/dist/client/local-authorized-client.js +1 -1
- package/dist/client/memory-authorized-client.d.ts +3 -1
- package/dist/client/memory-authorized-client.js +1 -1
- package/dist/client/phoenix-api.d.ts +311 -2
- package/dist/configurator/application-runtime/extensions/create-configurator-extensions.js +1 -1
- package/dist/configurator/application-runtime/extensions/selectors.d.ts +3 -1
- package/dist/configurator/application-runtime/extensions/selectors.js +1 -1
- package/dist/configurator/application-runtime/extensions/systems/assistant-system/assistant-system.d.ts +92 -3
- package/dist/configurator/application-runtime/extensions/systems/assistant-system/assistant-system.js +1 -1
- package/dist/configurator/application-runtime/extensions/systems/drag-and-drop-system/drag-and-drop-system.d.ts +3 -3
- package/dist/configurator/application-runtime/extensions/systems/graphql-system/entity-meta.js +1 -1
- package/dist/configurator/application-runtime/extensions/systems/graphql-system/graphql-system.d.ts +14 -4
- package/dist/configurator/application-runtime/extensions/systems/graphql-system/graphql-system.js +1 -1
- package/dist/configurator/application-runtime/extensions/systems/graphql-system/inject-assistant-lenses.d.ts +11 -0
- package/dist/configurator/application-runtime/extensions/systems/graphql-system/inject-assistant-lenses.js +1 -0
- package/dist/configurator/application-runtime/extensions/systems/index.d.ts +1 -1
- package/dist/configurator/application-runtime/extensions/systems/layout-system/layout-system.d.ts +2 -2
- package/dist/configurator/application-runtime/extensions/systems/layout-system/layout-system.js +1 -1
- package/dist/configurator/common/configurator-interface.d.ts +11 -1
- package/dist/configurator/common/configurator-interface.js +1 -1
- package/dist/configurator/common/frontend-analytics.d.ts +2 -0
- package/dist/configurator/common/frontend-analytics.js +1 -1
- package/dist/configurator/configurator-context/configurator-hooks/layout-hooks.d.ts +1 -1
- package/dist/configurator/pages/DefaultConfiguratorLayout.d.ts +6 -0
- package/dist/configurator/pages/DefaultConfiguratorLayout.js +1 -0
- package/dist/configurator/pages/LoadedConfiguratorDetailPage.js +1 -1
- package/dist/configurator/scene/scene-controls/hotspot-drag-handle/HotspotDragHandle.d.ts +1 -1
- package/dist/configurator/scene/scene-controls/hotspot-drag-handle/HotspotDragSceneHandle.d.ts +1 -1
- package/dist/configurator/scene/scene-entity/dimension-indicators/DimensionIndicator.d.ts +1 -1
- package/dist/configurator/scene/scene-entity/dimension-indicators/DimensionIndicatorInternal.d.ts +1 -1
- package/dist/configurator/scene/scene-entity/drag-and-drop/shared.d.ts +2 -2
- package/dist/configurator/scene/scene-entity/drag-and-drop/use-drag-object.d.ts +1 -1
- package/dist/configurator/scene/scene-entity/materials/RemoteReplacedMaterial.js +1 -1
- package/dist/configurator/scene/scene-entity/objects/SceneEntityObjectTextDecal.d.ts +1 -1
- package/dist/configurator/ui/assistant/AssistantComposer.d.ts +2 -1
- package/dist/configurator/ui/assistant/AssistantComposer.js +1 -1
- package/dist/configurator/ui/assistant/AssistantMarkdown.d.ts +1 -1
- package/dist/configurator/ui/assistant/AssistantMarkdown.js +1 -1
- package/dist/configurator/ui/assistant/AssistantThread.d.ts +6 -2
- package/dist/configurator/ui/assistant/AssistantThread.js +1 -1
- package/dist/configurator/ui/assistant/entity-link/AssistantEntityLink.d.ts +13 -0
- package/dist/configurator/ui/assistant/entity-link/AssistantEntityLink.js +1 -0
- package/dist/configurator/ui/assistant/entity-link/entity-link-selection.d.ts +22 -0
- package/dist/configurator/ui/assistant/entity-link/entity-link-selection.js +1 -0
- package/dist/configurator/ui/assistant/entity-link/entity-link-state.d.ts +27 -0
- package/dist/configurator/ui/assistant/entity-link/entity-link-state.js +1 -0
- package/dist/configurator/ui/assistant/entity-link/entity-link-target.d.ts +5 -0
- package/dist/configurator/ui/assistant/entity-link/entity-link-target.js +1 -0
- package/dist/configurator/ui/assistant/entity-link/index.d.ts +3 -0
- package/dist/configurator/ui/assistant/entity-link/index.js +1 -0
- package/dist/configurator/ui/assistant/thread-items.d.ts +13 -2
- package/dist/configurator/ui/assistant/thread-items.js +1 -1
- package/dist/configurator/ui/configurator-layout/sidebar-keys/index.d.ts +1 -0
- package/dist/configurator/ui/configurator-layout/sidebar-keys/index.js +1 -0
- package/dist/configurator/ui/configurator-layout/sidebar-keys/sidebar-keys.d.ts +11 -0
- package/dist/configurator/ui/configurator-layout/sidebar-keys/sidebar-keys.js +1 -0
- package/dist/configurator/ui/configurator-layout/slots/desktop-sidebar/DesktopSidebar.d.ts +101 -0
- package/dist/configurator/ui/configurator-layout/slots/desktop-sidebar/DesktopSidebar.js +16 -0
- package/dist/configurator/ui/configurator-layout/slots/desktop-sidebar/index.d.ts +1 -0
- package/dist/configurator/ui/configurator-layout/slots/desktop-sidebar/index.js +1 -0
- package/dist/configurator/ui/configurator-layout/slots/services/InvariantViolations.d.ts +4 -4
- package/dist/configurator/ui/configurator-layout/slots/services/InvariantViolations.js +1 -1
- package/dist/configurator/ui/configurator-layout/slots/services/SideEffects.d.ts +3 -6
- package/dist/configurator/ui/configurator-layout/slots/services/SideEffects.js +1 -1
- package/dist/configurator/ui/configurator-layout/slots/slots.d.ts +1 -0
- package/dist/configurator/ui/configurator-layout/slots/slots.js +1 -1
- package/dist/configurator/ui/configurator-layout/universal/DesktopLayout.d.ts +0 -74
- package/dist/configurator/ui/configurator-layout/universal/DesktopLayout.js +5 -20
- package/dist/configurator/ui/configurator-layout/universal/DesktopPreview.js +1 -1
- package/dist/configurator/ui/configurator-layout/universal/MobileLayout.js +4 -4
- package/dist/configurator/ui/configurator-layout/universal/MobilePreview.js +1 -1
- package/dist/configurator/ui/configurator-layout/universal/use-layout-scene-safe-area.d.ts +47 -0
- package/dist/configurator/ui/configurator-layout/universal/use-layout-scene-safe-area.js +1 -0
- package/dist/configurator/ui/configurator-layout/universal/use-scene-safe-area.d.ts +11 -26
- package/dist/configurator/ui/configurator-layout/universal/use-scene-safe-area.js +1 -1
- package/dist/configurator/ui/legacy/layout/steps/StepsNavigation.d.ts +2 -2
- package/dist/configurator/ui/phoenix-layout-elements/header/common/step-navigation/StepsNavigation.d.ts +2 -2
- package/dist/docs/complex-use-cases/filtered-controls-with-fix-dialog.mdx +16 -19
- package/dist/docs/complex-use-cases/sketching.mdx +0 -38
- package/dist/docs/controls/select-attribute/cardselect.mdx +9 -13
- package/dist/docs/dimensions/3d-scene-integration/dimension-indicators.mdx +2 -2
- package/dist/docs/dimensions/3d-scene-integration/editable-angle-indicator.mdx +1 -1
- package/dist/docs/dimensions/3d-scene-integration/editable-distance-dimension-indicator.mdx +1 -1
- package/dist/docs/dimensions/3d-scene-integration/list-selector-dimension-indicator.mdx +1 -1
- package/dist/docs/drag-and-drop/drag-handle.mdx +1 -1
- package/dist/docs/drag-and-drop/hotspot-handle.mdx +1 -1
- package/dist/docs/drag-and-drop/planes.mdx +1 -1
- package/dist/docs/drag-and-drop/rotatable.mdx +2 -2
- package/dist/docs/index.json +42 -1
- package/dist/docs/integrations/woocommerce/local-development.mdx +1 -1
- package/dist/docs/layouts/custom-layout.mdx +1164 -0
- package/dist/docs/layouts/header/fixed.mdx +2 -2
- package/dist/docs/layouts/header/floating.mdx +2 -2
- package/dist/docs/layouts/sidebar/in-a-custom-layout.mdx +380 -0
- package/dist/docs/layouts/sidebar-footer/basic.mdx +32 -77
- package/dist/docs/other-features/client-side-rendering/declarative.mdx +1 -1
- package/dist/docs/other-features/side-effects.mdx +8 -11
- package/dist/docs/other-features/transformers.mdx +4 -0
- package/dist/docs/other-features/violation-messages.mdx +52 -56
- package/dist/docs/phoenix/application-states.mdx +9 -7
- package/dist/docs/phoenix/configurator-interface.mdx +184 -80
- package/dist/docs/phoenix/deployments.mdx +1 -1
- package/dist/docs/phoenix/domain-model.mdx +4 -0
- package/dist/docs/phoenix/expression-context.mdx +11 -3
- package/dist/docs/phoenix/finalization.mdx +1 -1
- package/dist/docs/phoenix/getting-started.mdx +1 -1
- package/dist/docs/phoenix/layout-slots.mdx +114 -0
- package/dist/docs/phoenix/phoenix-cli.mdx +48 -48
- package/dist/docs/phoenix/project-structure.mdx +18 -11
- package/dist/docs/phoenix/quickstart.mdx +2 -2
- package/dist/docs/phoenix/sdk-builder-workflow.mdx +8 -8
- package/dist/docs/phoenix/testing.mdx +140 -0
- package/dist/docs/phoenix/webhook-membership.mdx +10 -9
- package/dist/docs/phoenix/webhooks.mdx +2 -2
- package/dist/docs/ux-guidelines/choosing-a-control.mdx +11 -0
- package/dist/domain/admin-domain/__generated/enhanced-model.d.ts +1 -2
- package/dist/domain/admin-domain/implementation/common-admin-expressions.d.ts +26 -12
- package/dist/domain/admin-domain/implementation/common-admin-publish.d.ts +1 -2
- package/dist/domain/admin-domain/index.d.ts +9 -5
- package/dist/domain/admin-domain/index.js +1 -1
- package/dist/domain/application/GetApplicationWrapperHandler.d.ts +2 -2
- package/dist/domain/application/GetThemeHandler.d.ts +1 -1
- package/dist/domain/application/GetWebComponentOptions.d.ts +1 -1
- package/dist/domain/application/admin-page-factories.d.ts +1 -2
- package/dist/domain/application/application-config.d.ts +7 -26
- package/dist/domain/application/assistant/assistant-fields.d.ts +12 -0
- package/dist/domain/application/assistant/assistant-fields.js +1 -0
- package/dist/domain/application/assistant/assistant-manifest.d.ts +11 -1
- package/dist/domain/application/assistant/assistant-resolved-manifest.d.ts +38 -2
- package/dist/domain/application/assistant/assistant-resolved-manifest.js +1 -1
- package/dist/domain/application/assistant/assistant-value-type.js +1 -1
- package/dist/domain/application/assistant/build-assistant-lenses.d.ts +14 -0
- package/dist/domain/application/assistant/build-assistant-lenses.js +5 -0
- package/dist/domain/application/assistant/build-assistant-manifest.js +1 -1
- package/dist/domain/application/assistant/create-assistant-execution-schema.d.ts +32 -0
- package/dist/domain/application/assistant/create-assistant-execution-schema.js +1 -0
- package/dist/domain/application/assistant/generate-assistant-prompt.d.ts +1 -11
- package/dist/domain/application/assistant/generate-assistant-prompt.js +1 -1
- package/dist/domain/application/assistant/index.d.ts +6 -1
- package/dist/domain/application/assistant/index.js +1 -1
- package/dist/domain/application/assistant/session-setup/AssistantSetupHandler.d.ts +20 -0
- package/dist/domain/application/assistant/session-setup/AssistantSetupHandler.js +1 -0
- package/dist/domain/application/assistant/session-setup/apply-assistant-setup.d.ts +10 -0
- package/dist/domain/application/assistant/session-setup/apply-assistant-setup.js +1 -0
- package/dist/domain/application/assistant/session-setup/assistant-setup-manifest.d.ts +48 -0
- package/dist/domain/application/assistant/session-setup/assistant-setup-manifest.js +1 -0
- package/dist/domain/application/assistant/session-setup/create-session-assistant.d.ts +15 -0
- package/dist/domain/application/assistant/session-setup/create-session-assistant.js +1 -0
- package/dist/domain/application/assistant/session-setup/index.d.ts +4 -0
- package/dist/domain/application/assistant/session-setup/index.js +1 -0
- package/dist/domain/application/assistant-mutations.d.ts +2 -2
- package/dist/domain/application/assistant-mutations.js +1 -1
- package/dist/domain/application/assistant-recipe-groups.d.ts +2 -4
- package/dist/domain/application/configurator-builder.d.ts +2 -2
- package/dist/domain/application/configurator-builder.js +1 -1
- package/dist/domain/application/create-initial-published-data.d.ts +6 -7
- package/dist/domain/application/index.d.ts +2 -6
- package/dist/domain/application/index.js +1 -1
- package/dist/domain/application/published-data/DataRowValidatorHandler.d.ts +1 -1
- package/dist/domain/application/published-data/FilterPublishedChunksHandler.d.ts +1 -1
- package/dist/domain/application/published-data/MapPublishedChunkedDataHandler.d.ts +1 -1
- package/dist/domain/application/published-data/MapPublishedRevisionDataHandler.d.ts +1 -1
- package/dist/domain/application/published-data/SheetValidatorHandler.d.ts +1 -1
- package/dist/domain/application/published-data/build-legend-data.d.ts +1 -1
- package/dist/domain/application/published-data/format-field-type.d.ts +1 -1
- package/dist/domain/application/published-data/map-data-to-sheet.d.ts +1 -1
- package/dist/domain/application/published-data/map-published-chunked-data.d.ts +3 -3
- package/dist/domain/application/published-data/map-published-data.d.ts +7 -3
- package/dist/domain/application/published-data/validate-sheet-data.d.ts +1 -1
- package/dist/domain/available-system-components.js +1 -1
- package/dist/domain/core/action/action-factory.d.ts +11 -0
- package/dist/domain/core/{action.d.ts → action/action.d.ts} +21 -17
- package/dist/domain/core/action/index.d.ts +2 -0
- package/dist/domain/core/action/index.js +1 -0
- package/dist/domain/{components → core/component}/component-reader-types.d.ts +1 -1
- package/dist/domain/{components → core/component}/debug-state-component.d.ts +1 -1
- package/dist/domain/core/component/debug-state-component.js +1 -0
- package/dist/domain/core/component/domain-component-optic.d.ts +65 -0
- package/dist/domain/core/component/domain-component-optic.js +16 -0
- package/dist/domain/{components → core/component}/drag-state-component.d.ts +1 -1
- package/dist/domain/core/component/drag-state-component.js +1 -0
- package/dist/domain/{components → core/component}/export-state-component.d.ts +1 -1
- package/dist/domain/core/component/export-state-component.js +1 -0
- package/dist/domain/{components → core/component}/fullscreen-state-component.d.ts +1 -1
- package/dist/domain/core/component/fullscreen-state-component.js +1 -0
- package/dist/domain/{components → core/component}/group-components-by-entity-id-and-name.d.ts +1 -1
- package/dist/domain/core/component/group-components-by-entity-id-and-name.js +1 -0
- package/dist/domain/{components → core/component}/hover-state-component.d.ts +1 -1
- package/dist/domain/core/component/hover-state-component.js +1 -0
- package/dist/domain/core/component/index.d.ts +18 -0
- package/dist/domain/core/component/index.js +1 -0
- package/dist/domain/{components → core/component}/legacy-filter.d.ts +4 -18
- package/dist/domain/{components → core/component}/navigation-state-component.d.ts +1 -1
- package/dist/domain/core/component/navigation-state-component.js +1 -0
- package/dist/domain/{components → core/component}/selection-state-component.d.ts +1 -1
- package/dist/domain/core/component/selection-state-component.js +1 -0
- package/dist/domain/{components → core/component}/system-component-builder.d.ts +1 -1
- package/dist/domain/core/component/system-component-builder.js +1 -0
- package/dist/domain/{components → core/component}/system-component-filter.d.ts +38 -18
- package/dist/domain/core/component/system-virtual-entity.js +1 -0
- package/dist/domain/{components → core/component}/tool-state-component.d.ts +1 -1
- package/dist/domain/core/component/tool-state-component.js +1 -0
- package/dist/domain/{components → core/component}/updates.d.ts +1 -1
- package/dist/domain/{components → core/component}/view-state-component.d.ts +1 -1
- package/dist/domain/core/component/view-state-component.js +1 -0
- package/dist/domain/{components → core/component}/viewport-state-component.d.ts +1 -1
- package/dist/domain/core/component/viewport-state-component.js +1 -0
- package/dist/domain/core/data-schema/data-cell-value.d.ts +4 -0
- package/dist/domain/core/data-schema/data-schema-array-field.d.ts +5 -0
- package/dist/domain/core/data-schema/data-schema-field-object.d.ts +4 -0
- package/dist/domain/core/data-schema/data-schema-field-object.js +1 -0
- package/dist/domain/core/data-schema/data-schema-field.d.ts +2 -0
- package/dist/domain/core/data-schema/data-schema-field.js +1 -0
- package/dist/domain/core/data-schema/data-schema-localized-field.d.ts +4 -0
- package/dist/domain/core/data-schema/data-schema-localized-field.js +1 -0
- package/dist/domain/core/data-schema/data-schema-primitive-field.d.ts +5 -0
- package/dist/domain/core/data-schema/data-schema-primitive-field.js +1 -0
- package/dist/domain/core/data-schema/data-schema.d.ts +2 -0
- package/dist/domain/core/data-schema/data-schema.js +1 -0
- package/dist/domain/core/data-schema/index.d.ts +7 -0
- package/dist/domain/core/data-schema/index.js +1 -0
- package/dist/domain/core/domain-factory.d.ts +3 -3
- package/dist/domain/core/domain.d.ts +3 -3
- package/dist/domain/core/emission/index.d.ts +8 -0
- package/dist/domain/core/emission/index.js +1 -0
- package/dist/domain/core/emission/reset-state-emission.d.ts +12 -0
- package/dist/domain/core/emission/reset-state-emission.js +1 -0
- package/dist/domain/core/emission/state-emission.d.ts +4 -0
- package/dist/domain/core/emission/state-emission.js +1 -0
- package/dist/domain/core/emission/state-update-emission.d.ts +14 -0
- package/dist/domain/core/emission/state-update-emission.js +1 -0
- package/dist/domain/core/emission/state-validation-result.d.ts +18 -0
- package/dist/domain/core/emission/state-validation-result.js +1 -0
- package/dist/domain/core/emission/transformation-log.d.ts +2 -0
- package/dist/domain/core/emission/transformation-log.js +1 -0
- package/dist/domain/core/emission/transformer-log-entry.d.ts +6 -0
- package/dist/domain/core/emission/transformer-log-entry.js +1 -0
- package/dist/domain/core/emission/transformer-log.d.ts +11 -0
- package/dist/domain/core/emission/transformer-log.js +1 -0
- package/dist/domain/core/emission/transformer-phase.d.ts +1 -0
- package/dist/domain/core/emission/transformer-phase.js +1 -0
- package/dist/domain/core/expression/aliased-expressions.d.ts +10 -0
- package/dist/domain/core/expression/aliased-expressions.js +1 -0
- package/dist/domain/core/expression/constant-expressions.d.ts +16 -0
- package/dist/domain/core/expression/constant-expressions.js +1 -0
- package/dist/domain/core/expression/custom-expression.d.ts +25 -0
- package/dist/domain/core/expression/custom-expression.js +1 -0
- package/dist/domain/core/expression/expression.d.ts +46 -0
- package/dist/domain/core/expression/expression.js +1 -0
- package/dist/domain/core/expression/index.d.ts +4 -0
- package/dist/domain/core/expression/index.js +1 -0
- package/dist/domain/core/index.d.ts +9 -4
- package/dist/domain/core/index.js +1 -1
- package/dist/domain/{invariants → core/invariant}/builtin-invariant.d.ts +2 -1
- package/dist/domain/core/invariant/custom-invariants.d.ts +13 -0
- package/dist/domain/core/invariant/custom-invariants.js +1 -0
- package/dist/domain/core/invariant/index.d.ts +5 -0
- package/dist/domain/core/invariant/index.js +1 -0
- package/dist/domain/core/invariant/invariants.d.ts +10 -0
- package/dist/domain/core/invariant/invariants.js +1 -0
- package/dist/domain/core/invariant/violation-component.js +1 -0
- package/dist/domain/{invariants → core/invariant}/violation.d.ts +52 -4
- package/dist/domain/core/invariant/violation.js +1 -0
- package/dist/domain/core/model/model.d.ts +1 -1
- package/dist/domain/core/recipe/index.d.ts +1 -0
- package/dist/domain/core/recipe/index.js +1 -0
- package/dist/domain/core/recipe/recipes.d.ts +23 -0
- package/dist/domain/core/recipe/recipes.js +1 -0
- package/dist/domain/core/relation/all-of-type-relation.d.ts +19 -0
- package/dist/domain/core/relation/all-of-type-relation.js +1 -0
- package/dist/domain/{relations → core/relation}/component-factories.d.ts +1 -1
- package/dist/domain/core/relation/component-factories.js +1 -0
- package/dist/domain/{relations → core/relation}/composed-of.d.ts +1 -1
- package/dist/domain/core/relation/composed-of.js +1 -0
- package/dist/domain/core/relation/direct-relation.d.ts +17 -0
- package/dist/domain/core/relation/index.d.ts +8 -0
- package/dist/domain/core/relation/index.js +1 -0
- package/dist/domain/core/relation/indirect-relation.d.ts +25 -0
- package/dist/domain/core/relation/indirect-relation.js +1 -0
- package/dist/domain/{relations → core/relation}/reference-component.d.ts +4 -4
- package/dist/domain/core/relation/reference-component.js +1 -0
- package/dist/domain/{relations → core/relation}/reference-field.d.ts +1 -1
- package/dist/domain/core/relation/reference-field.js +1 -0
- package/dist/domain/core/relation/relation-factory.d.ts +22 -0
- package/dist/domain/core/relation/relation-factory.js +1 -0
- package/dist/domain/core/state/id-sequence.d.ts +15 -0
- package/dist/domain/core/state/id-sequence.js +1 -0
- package/dist/domain/core/state/index.d.ts +3 -0
- package/dist/domain/core/state/index.js +1 -0
- package/dist/domain/core/{migrations.d.ts → state/migrations.d.ts} +15 -46
- package/dist/domain/core/state/migrations.js +1 -0
- package/dist/domain/core/{state.d.ts → state/state.d.ts} +2 -2
- package/dist/domain/domain-builder.d.ts +2 -5
- package/dist/domain/domain-builder.js +1 -1
- package/dist/domain/domain-context/action-system/action-system.d.ts +2 -2
- package/dist/domain/domain-context/action-system/action-system.js +1 -1
- package/dist/domain/domain-context/action-system/index.d.ts +1 -0
- package/dist/domain/domain-context/action-system/index.js +1 -0
- package/dist/domain/domain-context/analytics-system/index.d.ts +2 -0
- package/dist/domain/domain-context/analytics-system/index.js +1 -0
- package/dist/domain/domain-context/create-transformer.d.ts +1 -1
- package/dist/domain/domain-context/dimension-system/dimension-state.js +1 -1
- package/dist/domain/domain-context/dimension-system/dimension-system.d.ts +3 -4
- package/dist/domain/domain-context/dimension-system/dimension-system.js +1 -1
- package/dist/domain/domain-context/dimension-system/index.d.ts +1 -0
- package/dist/domain/domain-context/dimension-system/index.js +1 -0
- package/dist/domain/domain-context/domain-context-systems.d.ts +7 -7
- package/dist/domain/domain-context/index.d.ts +8 -18
- package/dist/domain/domain-context/index.js +1 -1
- package/dist/domain/domain-context/navigation-system/index.d.ts +3 -0
- package/dist/domain/domain-context/navigation-system/index.js +1 -0
- package/dist/domain/domain-context/navigation-system/navigation-system.d.ts +5 -7
- package/dist/domain/domain-context/navigation-system/navigation-system.js +1 -1
- package/dist/domain/domain-context/navigation-system/navigation-updates.d.ts +1 -12
- package/dist/domain/domain-context/navigation-system/navigation-updates.js +1 -1
- package/dist/domain/domain-context/navigation-system/selection-transformers.d.ts +1 -1
- package/dist/domain/domain-context/recipe-system/index.d.ts +1 -0
- package/dist/domain/domain-context/recipe-system/index.js +1 -0
- package/dist/domain/domain-context/recipe-system/recipe-cooker-system.d.ts +2 -4
- package/dist/domain/domain-context/recipe-system/recipe-cooker-system.js +1 -1
- package/dist/domain/domain-context/relation-transformers/cascade-deletes.d.ts +2 -2
- package/dist/domain/domain-context/relation-transformers/cascade-deletes.js +1 -1
- package/dist/domain/domain-context/relation-transformers/cascade-ref-pruning.d.ts +3 -3
- package/dist/domain/domain-context/relation-transformers/cascade-ref-pruning.js +1 -1
- package/dist/domain/domain-context/relation-transformers/create-entity-refs.d.ts +3 -3
- package/dist/domain/domain-context/relation-transformers/create-entity-refs.js +2 -2
- package/dist/domain/domain-context/relation-transformers/index.d.ts +4 -0
- package/dist/domain/domain-context/relation-transformers/index.js +1 -0
- package/dist/domain/domain-context/relation-transformers/replace-refs.d.ts +3 -3
- package/dist/domain/domain-context/relation-transformers/replace-refs.js +1 -1
- package/dist/domain/domain-context/store-system/apply-updates.d.ts +1 -2
- package/dist/domain/domain-context/store-system/index.d.ts +4 -0
- package/dist/domain/domain-context/store-system/index.js +1 -0
- package/dist/domain/domain-context/store-system/next-domain-entity-id.d.ts +1 -12
- package/dist/domain/domain-context/store-system/reconcile-projected-entities.d.ts +1 -2
- package/dist/domain/domain-context/store-system/reconcile-projected-entities.js +1 -1
- package/dist/domain/domain-context/store-system/store-system.d.ts +2 -37
- package/dist/domain/domain-context/store-system/store-system.js +2 -2
- package/dist/domain/domain-context/store-system/system-state.d.ts +2 -2
- package/dist/domain/domain-context/store-system/system-state.js +1 -1
- package/dist/domain/domain-context/transformers/actions-builder.d.ts +1 -2
- package/dist/domain/domain-context/transformers/actions-builder.js +1 -1
- package/dist/domain/domain-context/transformers/auto-snap-transformer.d.ts +6 -9
- package/dist/domain/domain-context/transformers/auto-snap-transformer.js +1 -1
- package/dist/domain/domain-context/transformers/chain-builder.d.ts +1 -1
- package/dist/domain/domain-context/transformers/context.d.ts +2 -6
- package/dist/domain/domain-context/transformers/context.js +1 -1
- package/dist/domain/domain-context/transformers/entity-builder.d.ts +1 -5
- package/dist/domain/domain-context/transformers/entity-builder.js +1 -1
- package/dist/domain/domain-context/transformers/index.d.ts +1 -1
- package/dist/domain/domain-context/transformers/index.js +1 -1
- package/dist/domain/domain-context/transformers/then-builder.d.ts +1 -2
- package/dist/domain/domain-context/transformers/when-builder.d.ts +3 -8
- package/dist/domain/domain-context/transformers/when-builder.js +1 -1
- package/dist/domain/domain-context/undo-system.d.ts +2 -3
- package/dist/domain/domain-runtime/access/selectors.d.ts +9 -0
- package/dist/domain/domain-runtime/access/selectors.js +1 -1
- package/dist/domain/domain-runtime/access/types.d.ts +2 -0
- package/dist/domain/domain-runtime/access/types.js +1 -1
- package/dist/domain/domain-runtime/domain-context/action-context.d.ts +11 -0
- package/dist/domain/domain-runtime/domain-context/action-context.js +1 -0
- package/dist/domain/domain-runtime/domain-context/component-reader.d.ts +1 -2
- package/dist/domain/domain-runtime/domain-context/component-reader.js +1 -1
- package/dist/domain/domain-runtime/domain-context/domain-context.js +1 -1
- package/dist/domain/domain-runtime/domain-context/expression-context.d.ts +8 -0
- package/dist/domain/domain-runtime/domain-context/expression-context.js +1 -0
- package/dist/domain/domain-runtime/domain-context/index.d.ts +3 -0
- package/dist/domain/domain-runtime/domain-context/runtime-expression-context.d.ts +18 -0
- package/dist/domain/domain-runtime/domain-context/runtime-expression-context.js +1 -0
- package/dist/domain/domain-runtime/domain-context/selectors.d.ts +19 -24
- package/dist/domain/domain-runtime/domain-context/selectors.js +1 -1
- package/dist/domain/domain-runtime/domain-context/types.d.ts +4 -1
- package/dist/domain/domain-runtime/domain-runtime.d.ts +84 -68
- package/dist/domain/domain-runtime/errors/implementation-error-collector.d.ts +19 -0
- package/dist/domain/domain-runtime/errors/implementation-error-collector.js +1 -0
- package/dist/domain/domain-runtime/errors/implementation-error.d.ts +46 -0
- package/dist/domain/domain-runtime/errors/implementation-error.js +1 -0
- package/dist/domain/domain-runtime/errors/implementation-errors.d.ts +13 -0
- package/dist/domain/domain-runtime/errors/implementation-errors.js +1 -0
- package/dist/domain/domain-runtime/errors/index.d.ts +4 -0
- package/dist/domain/domain-runtime/errors/index.js +1 -0
- package/dist/domain/domain-runtime/errors/to-implementation-errors.d.ts +10 -0
- package/dist/domain/domain-runtime/errors/to-implementation-errors.js +1 -0
- package/dist/domain/domain-runtime/index.d.ts +1 -0
- package/dist/domain/domain-runtime/index.js +1 -1
- package/dist/domain/domain-runtime/spec/create-violation-expressions.d.ts +24 -0
- package/dist/domain/domain-runtime/spec/create-violation-expressions.js +1 -0
- package/dist/domain/domain-runtime/spec/index.d.ts +5 -0
- package/dist/domain/domain-runtime/spec/index.js +1 -1
- package/dist/domain/domain-runtime/spec/initialize.d.ts +11 -0
- package/dist/domain/domain-runtime/spec/initialize.js +1 -1
- package/dist/domain/{expressions → domain-runtime/spec}/memoize-expression.d.ts +1 -1
- package/dist/domain/{application → domain-runtime/spec/module-checks}/element-registration.d.ts +2 -2
- package/dist/domain/domain-runtime/spec/module-checks/element-registration.js +1 -0
- package/dist/domain/{application → domain-runtime/spec/module-checks}/handler-registration.d.ts +1 -1
- package/dist/domain/domain-runtime/spec/module-checks/handler-registration.js +1 -0
- package/dist/domain/domain-runtime/spec/module-checks/index.d.ts +8 -0
- package/dist/domain/domain-runtime/spec/module-checks/index.js +1 -0
- package/dist/domain/{project-modules → domain-runtime/spec/module-checks}/project-modules.d.ts +8 -17
- package/dist/domain/domain-runtime/spec/module-checks/project-modules.js +1 -0
- package/dist/domain/domain-runtime/spec/module-checks/resolve-action-modules.d.ts +4 -0
- package/dist/domain/domain-runtime/spec/module-checks/resolve-action-modules.js +1 -0
- package/dist/domain/domain-runtime/spec/module-checks/resolve-component-optic-modules.d.ts +4 -0
- package/dist/domain/domain-runtime/spec/module-checks/resolve-component-optic-modules.js +1 -0
- package/dist/domain/domain-runtime/spec/module-checks/resolve-expression-modules.d.ts +15 -0
- package/dist/domain/domain-runtime/spec/module-checks/resolve-expression-modules.js +1 -0
- package/dist/domain/domain-runtime/spec/module-checks/resolve-imported-transformers.d.ts +22 -0
- package/dist/domain/domain-runtime/spec/module-checks/resolve-imported-transformers.js +1 -0
- package/dist/domain/domain-runtime/spec/module-checks/resolve-invariant-modules.d.ts +6 -0
- package/dist/domain/domain-runtime/spec/module-checks/resolve-invariant-modules.js +1 -0
- package/dist/domain/{actions → domain-runtime/spec}/prepare-action-implementations.d.ts +1 -1
- package/dist/domain/domain-runtime/spec/prepare-action-implementations.js +5 -0
- package/dist/domain/{expressions → domain-runtime/spec}/prepare-domain-expressions.d.ts +1 -1
- package/dist/domain/domain-runtime/spec/selectors.d.ts +5 -6
- package/dist/domain/domain-runtime/spec/selectors.js +1 -1
- package/dist/domain/domain-runtime/spec/types.d.ts +4 -4
- package/dist/domain/extensions/angle-indicator.js +1 -0
- package/dist/domain/{system-components → extensions}/attribute-switch.d.ts +1 -1
- package/dist/domain/extensions/attribute-switch.js +1 -0
- package/dist/domain/{system-components → extensions}/autorotate-camera-component.d.ts +1 -1
- package/dist/domain/extensions/autorotate-camera-component.js +1 -0
- package/dist/domain/extensions/basic-sidebar-footer.js +1 -0
- package/dist/domain/extensions/camera-based-hidden-entity-object.js +1 -0
- package/dist/domain/extensions/camera-based-hidden-entity.js +1 -0
- package/dist/domain/{system-components → extensions}/canvas-config.d.ts +1 -1
- package/dist/domain/extensions/canvas-config.js +1 -0
- package/dist/domain/extensions/canvas-custom-environment.js +1 -0
- package/dist/domain/extensions/canvas-padding.js +1 -0
- package/dist/domain/extensions/canvas-preset-environment.js +1 -0
- package/dist/domain/{system-components → extensions}/child-entity-recipe-hierarchy.d.ts +2 -2
- package/dist/domain/extensions/child-entity-recipe-hierarchy.js +1 -0
- package/dist/domain/{system-components → extensions}/client-side-image.d.ts +2 -2
- package/dist/domain/extensions/client-side-image.js +1 -0
- package/dist/domain/extensions/color-value.js +1 -0
- package/dist/domain/{system-components → extensions}/common/angle-indicator-schema.d.ts +3 -3
- package/dist/domain/extensions/common/angle-indicator-schema.js +1 -0
- package/dist/domain/{system-components → extensions}/common/dimension-indicator-schema.d.ts +2 -2
- package/dist/domain/extensions/common/index.d.ts +4 -0
- package/dist/domain/extensions/common/index.js +1 -0
- package/dist/domain/{system-components → extensions}/custom-header.d.ts +1 -1
- package/dist/domain/extensions/custom-header.js +1 -0
- package/dist/domain/extensions/custom-price-footer.js +1 -0
- package/dist/domain/{system-components → extensions}/custom-sidebar-footer.d.ts +1 -1
- package/dist/domain/extensions/custom-sidebar-footer.js +1 -0
- package/dist/domain/extensions/dimension-indicator.js +1 -0
- package/dist/domain/{system-components → extensions}/editable-angle-indicator.d.ts +3 -2
- package/dist/domain/extensions/editable-angle-indicator.js +1 -0
- package/dist/domain/{system-components → extensions}/editable-distance-dimension-indicator.d.ts +3 -2
- package/dist/domain/extensions/editable-distance-dimension-indicator.js +1 -0
- package/dist/domain/{system-components → extensions}/editable-offset-indicator.d.ts +3 -2
- package/dist/domain/extensions/editable-offset-indicator.js +1 -0
- package/dist/domain/{system-components → extensions}/editable-size-indicator.d.ts +2 -1
- package/dist/domain/extensions/editable-size-indicator.js +1 -0
- package/dist/domain/{system-components → extensions}/entity-header.d.ts +1 -1
- package/dist/domain/extensions/entity-header.js +1 -0
- package/dist/domain/extensions/exit-tool-mode-fab.js +1 -0
- package/dist/domain/extensions/finalize-action.js +1 -0
- package/dist/domain/extensions/finalize-component.js +1 -0
- package/dist/domain/extensions/fit-selection-orthographic-camera-component.js +1 -0
- package/dist/domain/extensions/fit-selection-perspective-camera-component.js +1 -0
- package/dist/domain/extensions/fixed-header.js +1 -0
- package/dist/domain/extensions/floating-header.js +1 -0
- package/dist/domain/extensions/hidden-header.js +1 -0
- package/dist/domain/extensions/hidden-sidebar-footer.js +1 -0
- package/dist/domain/{system-components → extensions}/horizontal-tabs.d.ts +2 -2
- package/dist/domain/extensions/horizontal-tabs.js +1 -0
- package/dist/domain/extensions/index.d.ts +69 -0
- package/dist/domain/extensions/index.js +1 -0
- package/dist/domain/{system-components → extensions}/list-selector-dimension-indicator.d.ts +3 -2
- package/dist/domain/extensions/list-selector-dimension-indicator.js +1 -0
- package/dist/domain/extensions/multilingual-text-value.js +1 -0
- package/dist/domain/{system-components → extensions}/navigation-steps.d.ts +2 -2
- package/dist/domain/extensions/navigation-steps.js +1 -0
- package/dist/domain/extensions/offset-anchors.js +1 -0
- package/dist/domain/extensions/offset-indicator.js +1 -0
- package/dist/domain/extensions/offset.js +1 -0
- package/dist/domain/extensions/other-action.js +1 -0
- package/dist/domain/{system-components → extensions}/property-page.d.ts +1 -1
- package/dist/domain/extensions/property-page.js +1 -0
- package/dist/domain/extensions/read-sidebar-footer.js +1 -0
- package/dist/domain/{system-components → extensions}/replace-entity-recipe-hierarchy.d.ts +2 -2
- package/dist/domain/extensions/replace-entity-recipe-hierarchy.js +1 -0
- package/dist/domain/extensions/rotatable.js +1 -0
- package/dist/domain/{system-components → extensions}/rotation-handle.d.ts +2 -2
- package/dist/domain/extensions/rotation-handle.js +1 -0
- package/dist/domain/{system-components → extensions}/save-template-thumbnail.d.ts +2 -2
- package/dist/domain/extensions/save-template-thumbnail.js +1 -0
- package/dist/domain/{system-components → extensions}/scene-entity-add-fab.d.ts +1 -1
- package/dist/domain/extensions/scene-entity-add-fab.js +1 -0
- package/dist/domain/extensions/scene-entity-animation.js +1 -0
- package/dist/domain/extensions/scene-entity-control.js +1 -0
- package/dist/domain/{system-components → extensions}/scene-entity-delete-fab.d.ts +1 -1
- package/dist/domain/extensions/scene-entity-delete-fab.js +1 -0
- package/dist/domain/extensions/scene-entity-floor-object.js +1 -0
- package/dist/domain/{system-components → extensions}/scene-entity-html-hotspot.d.ts +1 -1
- package/dist/domain/extensions/scene-entity-html-hotspot.js +1 -0
- package/dist/domain/{system-components → extensions}/scene-entity-navigation-hotspot.d.ts +1 -1
- package/dist/domain/extensions/scene-entity-navigation-hotspot.js +1 -0
- package/dist/domain/{system-components → extensions}/scene-entity-object-html-hotspot.d.ts +1 -1
- package/dist/domain/extensions/scene-entity-object-html-hotspot.js +1 -0
- package/dist/domain/{system-components → extensions}/scene-entity-select-hotspot.d.ts +1 -1
- package/dist/domain/extensions/scene-entity-select-hotspot.js +1 -0
- package/dist/domain/extensions/scene-entity-wall-object.js +1 -0
- package/dist/domain/extensions/selectable-component.js +1 -0
- package/dist/domain/extensions/sidebar-tabs.js +1 -0
- package/dist/domain/extensions/simple-summary.js +1 -0
- package/dist/domain/extensions/size.js +1 -0
- package/dist/domain/extensions/sketching-draw.js +1 -0
- package/dist/domain/{system-components → extensions}/sketching-edit.d.ts +1 -1
- package/dist/domain/extensions/sketching-edit.js +1 -0
- package/dist/domain/extensions/summary-component.js +1 -0
- package/dist/domain/extensions/text-value.js +1 -0
- package/dist/domain/extensions/tool-controls.js +1 -0
- package/dist/domain/{system-components → extensions}/tool-menu-fab.d.ts +1 -1
- package/dist/domain/extensions/tool-menu-fab.js +1 -0
- package/dist/domain/{system-components → extensions}/toolbar.d.ts +1 -1
- package/dist/domain/extensions/toolbar.js +1 -0
- package/dist/domain/extensions/universal-sidebar-footer.js +1 -0
- package/dist/domain/extensions/view-controls.js +1 -0
- package/dist/domain/index.d.ts +2 -33
- package/dist/domain/index.js +1 -1
- package/dist/domain/mocks/create-mock-domain-context.d.ts +1 -1
- package/dist/domain/mocks/create-mock-domain-runtime-services.d.ts +1 -1
- package/dist/domain/mocks/create-mock-domain-runtime.d.ts +28 -19
- package/dist/domain/mocks/create-mock-domain-runtime.js +1 -1
- package/dist/domain/mocks/create-mock-domain.d.ts +1 -1
- package/dist/domain/mocks/create-mock-domain.js +1 -1
- package/dist/domain/mocks/create-mock-state.d.ts +2 -2
- package/dist/domain/mocks/create-test-application-config.d.ts +59 -0
- package/dist/domain/mocks/create-test-application-config.js +1 -0
- package/dist/domain/mocks/index.d.ts +1 -0
- package/dist/domain/mocks/index.js +1 -1
- package/dist/domain/projections/blender-projections/blender-projections.d.ts +2 -3
- package/dist/domain/projections/blender-projections/blender-projections.js +1 -1
- package/dist/domain/projections/blender-projections/camera.d.ts +2 -2
- package/dist/domain/projections/collision-projections.d.ts +1 -1
- package/dist/domain/projections/composition-projections.d.ts +1 -1
- package/dist/domain/projections/composition-projections.js +1 -1
- package/dist/domain/projections/constraint-projections.d.ts +1 -1
- package/dist/domain/projections/index.d.ts +1 -1
- package/dist/domain/projections/position-projections.d.ts +1 -1
- package/dist/domain/projections/projected-entities-projections.d.ts +1 -1
- package/dist/domain/projections/snapping-projections.d.ts +1 -1
- package/dist/domain/projections/validation-projections.d.ts +3 -20
- package/dist/domain/projections/validation-projections.js +1 -1
- package/dist/domain/sketching/sketching-projections.d.ts +1 -1
- package/dist/domain/system-components/admin-sidebar.js +1 -1
- package/dist/domain/system-components/angle-dimension.js +1 -1
- package/dist/domain/system-components/application-config.d.ts +2 -2
- package/dist/domain/system-components/application-config.js +1 -1
- package/dist/domain/system-components/attribute-selection.js +1 -1
- package/dist/domain/system-components/bounding-box-component.d.ts +1 -1
- package/dist/domain/system-components/bounding-box-component.js +1 -1
- package/dist/domain/system-components/bounding-sphere-component.d.ts +1 -1
- package/dist/domain/system-components/bounding-sphere-component.js +1 -1
- package/dist/domain/system-components/child-entity-recipes.d.ts +1 -1
- package/dist/domain/system-components/child-entity-recipes.js +1 -1
- package/dist/domain/system-components/child-entity-selection.d.ts +1 -2
- package/dist/domain/system-components/child-entity-selection.js +1 -1
- package/dist/domain/system-components/collision-box-geometry.d.ts +5 -3
- package/dist/domain/system-components/collision-box-geometry.js +1 -1
- package/dist/domain/system-components/collision-geometry.d.ts +5 -3
- package/dist/domain/system-components/collision-geometry.js +1 -1
- package/dist/domain/system-components/collision-point-geometry.d.ts +5 -3
- package/dist/domain/system-components/collision-point-geometry.js +1 -1
- package/dist/domain/system-components/common/index.d.ts +0 -4
- package/dist/domain/system-components/common/index.js +1 -1
- package/dist/domain/system-components/common/material-override-schema.d.ts +2 -2
- package/dist/domain/system-components/common/recipes.d.ts +21 -4
- package/dist/domain/system-components/common/recipes.js +1 -1
- package/dist/domain/system-components/constraint.d.ts +11 -24
- package/dist/domain/system-components/constraint.js +1 -1
- package/dist/domain/system-components/custom-scene-entity.js +1 -1
- package/dist/domain/system-components/detail.js +1 -1
- package/dist/domain/system-components/distance-dimension-select.js +1 -1
- package/dist/domain/system-components/distance-dimension.js +1 -1
- package/dist/domain/system-components/drag-handle.d.ts +1 -1
- package/dist/domain/system-components/drag-handle.js +1 -1
- package/dist/domain/system-components/fit-entity-orthographic-camera-component.js +1 -1
- package/dist/domain/system-components/fit-entity-perspective-camera-component.js +1 -1
- package/dist/domain/system-components/fit-root-orthographic-camera-component.js +1 -1
- package/dist/domain/system-components/fit-root-perspective-camera-component.js +1 -1
- package/dist/domain/system-components/generic-dimension.js +1 -1
- package/dist/domain/system-components/hidden-entity.js +1 -1
- package/dist/domain/system-components/hotspot-drag-handle.d.ts +2 -3
- package/dist/domain/system-components/hotspot-drag-handle.js +1 -1
- package/dist/domain/system-components/index.d.ts +0 -68
- package/dist/domain/system-components/index.js +1 -1
- package/dist/domain/system-components/material-override-property-transition.js +1 -1
- package/dist/domain/system-components/material-override-transformer.js +1 -1
- package/dist/domain/system-components/material-swatch.js +1 -1
- package/dist/domain/system-components/navigation-page.js +1 -1
- package/dist/domain/system-components/navigation-panel-list.js +1 -1
- package/dist/domain/system-components/phoenix-entity-elements/admin-data-table-sidebar.d.ts +1 -1
- package/dist/domain/system-components/phoenix-layout-elements/admin-connected-resource-page.d.ts +1 -1
- package/dist/domain/system-components/phoenix-layout-elements/admin-data-table-actions.d.ts +1 -1
- package/dist/domain/system-components/phoenix-layout-elements/admin-data-table-page.d.ts +1 -1
- package/dist/domain/system-components/pivot-point.js +1 -1
- package/dist/domain/system-components/price.js +1 -1
- package/dist/domain/system-components/projected-entities.js +1 -1
- package/dist/domain/system-components/replace-entity-recipes.d.ts +1 -1
- package/dist/domain/system-components/replace-entity-recipes.js +1 -1
- package/dist/domain/system-components/scene-entity-ambient-light.js +1 -1
- package/dist/domain/system-components/scene-entity-box-object.js +1 -1
- package/dist/domain/system-components/scene-entity-directional-light.js +1 -1
- package/dist/domain/system-components/scene-entity-local-material-override.js +1 -1
- package/dist/domain/system-components/scene-entity-material-override.d.ts +1 -1
- package/dist/domain/system-components/scene-entity-material-override.js +1 -1
- package/dist/domain/system-components/scene-entity-object-clip.js +1 -1
- package/dist/domain/system-components/scene-entity-object-decal.js +1 -1
- package/dist/domain/system-components/scene-entity-object-group.js +1 -1
- package/dist/domain/system-components/scene-entity-object-local-material-override.js +1 -1
- package/dist/domain/system-components/scene-entity-object-material-override.d.ts +1 -1
- package/dist/domain/system-components/scene-entity-object-material-override.js +1 -1
- package/dist/domain/system-components/scene-entity-object-properties.js +1 -1
- package/dist/domain/system-components/scene-entity-object-remote-material-override.js +1 -1
- package/dist/domain/system-components/scene-entity-object-text-decal.d.ts +1 -1
- package/dist/domain/system-components/scene-entity-object-text-decal.js +1 -1
- package/dist/domain/system-components/scene-entity-object-transformer.js +1 -1
- package/dist/domain/system-components/scene-entity-object-transimissive-material-override.d.ts +1 -1
- package/dist/domain/system-components/scene-entity-object-transimissive-material-override.js +1 -1
- package/dist/domain/system-components/scene-entity-object.js +1 -1
- package/dist/domain/system-components/scene-entity-point-light.js +1 -1
- package/dist/domain/system-components/scene-entity-properties.js +1 -1
- package/dist/domain/system-components/scene-entity-rect-area-light.js +1 -1
- package/dist/domain/system-components/scene-entity-remote-material-override.js +1 -1
- package/dist/domain/system-components/scene-entity-remote-object.js +1 -1
- package/dist/domain/system-components/scene-entity-spot-light.js +1 -1
- package/dist/domain/system-components/scene-entity-transimissive-material-override.d.ts +1 -1
- package/dist/domain/system-components/scene-entity-transimissive-material-override.js +1 -1
- package/dist/domain/system-components/sketching-line.js +1 -1
- package/dist/domain/system-components/sketching-rectangle.js +1 -1
- package/dist/domain/system-components/sketching.js +1 -1
- package/dist/domain/system-components/snap-axis.js +1 -1
- package/dist/domain/system-components/snap-edge.js +1 -1
- package/dist/domain/system-components/snap-plane.js +1 -1
- package/dist/domain/system-components/snap-point.js +1 -1
- package/dist/domain/system-components/static-orthographic-camera-component.d.ts +1 -1
- package/dist/domain/system-components/static-orthographic-camera-component.js +1 -1
- package/dist/domain/system-components/static-perspective-camera-component.d.ts +1 -1
- package/dist/domain/system-components/static-perspective-camera-component.js +1 -1
- package/dist/domain/utils/eval-cache.d.ts +1 -1
- package/dist/domain/utils/map-nested-object.d.ts +1 -1
- package/dist/domain/utils/memo-eval.d.ts +2 -2
- package/dist/editor/domain-editors/use-implementation-files.d.ts +1 -2
- package/dist/editor/mocks/EditorMockContext.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/gen/configurator-builder.js +13 -12
- package/dist/legacy/domain-cli/gen/constant-expressions.js +1 -3
- package/dist/legacy/domain-cli/gen/defaults.js +1 -7
- package/dist/legacy/domain-cli/gen/implementation.js +7 -11
- package/dist/legacy/domain-cli/gen/invariants.js +7 -6
- package/dist/legacy/domain-cli/gen/relations.js +1 -1
- package/dist/legacy/domain-cli/utils/cache.d.ts +1 -1
- package/dist/legacy/domain-cli/utils/cache.js +1 -1
- package/dist/legacy/domain-spec/__generated/domain-schema.d.ts +81 -68
- 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 +2 -0
- package/dist/legacy/phoenix-cli/project-gen/generators/file-templates/domain-index.js +17 -15
- package/dist/legacy/phoenix-cli/project-gen/generators/file-templates/env-example.d.ts +1 -1
- package/dist/legacy/phoenix-cli/project-gen/generators/file-templates/env-example.js +4 -0
- package/dist/phoenix/application-spec/application-spec-builder.js +1 -1
- package/dist/phoenix/commands/deploy.js +1 -1
- package/dist/phoenix/commands/init.d.ts +4 -4
- package/dist/phoenix/commands/init.js +1 -1
- package/dist/phoenix/commands/prettier.js +1 -1
- package/dist/phoenix/scripts/build-admin.js +1 -1
- package/dist/phoenix/services/source-archive.d.ts +1 -0
- package/dist/phoenix/services/source-archive.js +1 -1
- package/dist/phoenix/utils/git/index.d.ts +1 -0
- package/dist/phoenix/utils/git/index.js +1 -0
- package/dist/phoenix/utils/git/is-inside-git-repository.d.ts +6 -0
- package/dist/phoenix/utils/git/is-inside-git-repository.js +1 -0
- package/dist/phoenix/utils/index.d.ts +1 -0
- package/dist/phoenix/utils/index.js +1 -1
- package/dist/react-sdk/application-runtime/hooks/use-access-service.d.ts +2 -0
- package/dist/react-sdk/application-runtime/mocks/create-mock-application-runtime.js +1 -1
- package/dist/react-sdk/application-runtime/routing/access-service.d.ts +1 -0
- package/dist/react-sdk/application-runtime/runtime/create-application-runtime.d.ts +53 -36
- package/dist/react-sdk/application-runtime/runtime/create-application-runtime.js +1 -1
- package/dist/react-sdk/domain-context/common-hooks/use-configurator-messages.d.ts +30 -0
- package/dist/react-sdk/domain-context/common-hooks/use-configurator-messages.js +1 -0
- package/dist/react-sdk/domain-context/common-hooks/use-domain-context.d.ts +9 -9
- package/dist/react-sdk/domain-context/index.d.ts +2 -1
- package/dist/react-sdk/domain-context/index.js +1 -1
- package/dist/react-sdk/domain-context/system-hooks/navigation-hooks.d.ts +6 -0
- package/dist/react-sdk/domain-context/system-hooks/navigation-hooks.js +1 -1
- package/dist/react-sdk/domain-controls/hooks/use-angle-dimension.d.ts +1 -1
- package/dist/ui-sdk/theme/types.d.ts +1 -1
- package/dist/webhook/builders/common.d.ts +5 -0
- package/dist/webhook/builders/webhook-builder.js +1 -1
- package/package.json +3 -3
- package/schema/domain-spec.json +1115 -209
- package/dist/application-spec/generate-application/code/templates/env-ci.d.ts +0 -1
- package/dist/application-spec/generate-application/code/templates/env-ci.js +0 -25
- package/dist/application-spec/generate-application/code/templates/env-example.d.ts +0 -1
- package/dist/application-spec/generate-application/code/templates/env-example.js +0 -90
- package/dist/application-spec/generate-application/code/templates/prettier-ignore.d.ts +0 -1
- package/dist/application-spec/generate-application/code/templates/prettier-ignore.js +0 -6
- package/dist/application-spec/generate-application/code/templates/private-assets-readme.d.ts +0 -1
- package/dist/application-spec/generate-application/code/templates/private-assets-readme.js +0 -24
- package/dist/application-spec/generate-application/code/templates/public-assets-readme.d.ts +0 -1
- package/dist/application-spec/generate-application/code/templates/public-assets-readme.js +0 -24
- package/dist/application-spec/generate-application/code/templates/readme.d.ts +0 -1
- package/dist/application-spec/generate-application/code/templates/readme.js +0 -23
- package/dist/application-spec/generate-application/code/templates/skills/agents-md.d.ts +0 -1
- package/dist/application-spec/generate-application/code/templates/skills/agents-md.js +0 -2
- package/dist/domain/actions/action-factory.d.ts +0 -10
- package/dist/domain/actions/prepare-action-implementations.js +0 -5
- package/dist/domain/application/element-registration.js +0 -1
- package/dist/domain/application/handler-registration.js +0 -1
- package/dist/domain/application/resolve-imported-transformers.d.ts +0 -23
- package/dist/domain/application/resolve-imported-transformers.js +0 -1
- package/dist/domain/application/resource-builder.d.ts +0 -13
- package/dist/domain/application/resource-builder.js +0 -1
- package/dist/domain/components/debug-state-component.js +0 -1
- package/dist/domain/components/domain-component-optic.d.ts +0 -75
- package/dist/domain/components/domain-component-optic.js +0 -16
- package/dist/domain/components/drag-state-component.js +0 -1
- package/dist/domain/components/export-state-component.js +0 -1
- package/dist/domain/components/fullscreen-state-component.js +0 -1
- package/dist/domain/components/group-components-by-entity-id-and-name.js +0 -1
- package/dist/domain/components/hover-state-component.js +0 -1
- package/dist/domain/components/index.d.ts +0 -2
- package/dist/domain/components/index.js +0 -1
- package/dist/domain/components/navigation-state-component.js +0 -1
- package/dist/domain/components/selection-state-component.js +0 -1
- package/dist/domain/components/system-component-builder.js +0 -1
- package/dist/domain/components/system-virtual-entity.js +0 -1
- package/dist/domain/components/tool-state-component.js +0 -1
- package/dist/domain/components/view-state-component.js +0 -1
- package/dist/domain/components/viewport-state-component.js +0 -1
- package/dist/domain/core/expression.d.ts +0 -49
- package/dist/domain/core/migrations.js +0 -1
- package/dist/domain/domain-context/recipe-system/recipes.d.ts +0 -55
- package/dist/domain/domain-context/recipe-system/recipes.js +0 -1
- package/dist/domain/expressions/constant-expressions.d.ts +0 -7
- package/dist/domain/expressions/constant-expressions.js +0 -1
- package/dist/domain/expressions/custom-expression.d.ts +0 -10
- package/dist/domain/expressions/custom-expression.js +0 -1
- package/dist/domain/expressions/index.d.ts +0 -1
- package/dist/domain/expressions/index.js +0 -1
- package/dist/domain/invariants/custom-invariants.d.ts +0 -21
- package/dist/domain/invariants/custom-invariants.js +0 -1
- package/dist/domain/invariants/invariants.d.ts +0 -74
- package/dist/domain/invariants/invariants.js +0 -1
- package/dist/domain/invariants/violation-component.js +0 -1
- package/dist/domain/invariants/violation.js +0 -1
- package/dist/domain/project-modules/index.d.ts +0 -1
- package/dist/domain/project-modules/index.js +0 -1
- package/dist/domain/project-modules/project-modules.js +0 -1
- package/dist/domain/relations/all-of-type-relation.d.ts +0 -30
- package/dist/domain/relations/all-of-type-relation.js +0 -1
- package/dist/domain/relations/component-factories.js +0 -1
- package/dist/domain/relations/composed-of.js +0 -1
- package/dist/domain/relations/direct-relation.d.ts +0 -27
- package/dist/domain/relations/indirect-relation.d.ts +0 -78
- package/dist/domain/relations/indirect-relation.js +0 -1
- package/dist/domain/relations/reference-component.js +0 -1
- package/dist/domain/relations/relation-factory.d.ts +0 -17
- package/dist/domain/relations/relation-factory.js +0 -1
- package/dist/domain/relations/relation-implementation.d.ts +0 -5
- package/dist/domain/system-components/angle-indicator.js +0 -1
- package/dist/domain/system-components/attribute-switch.js +0 -1
- package/dist/domain/system-components/autorotate-camera-component.js +0 -1
- package/dist/domain/system-components/basic-sidebar-footer.js +0 -1
- package/dist/domain/system-components/camera-based-hidden-entity-object.js +0 -1
- package/dist/domain/system-components/camera-based-hidden-entity.js +0 -1
- package/dist/domain/system-components/canvas-config.js +0 -1
- package/dist/domain/system-components/canvas-custom-environment.js +0 -1
- package/dist/domain/system-components/canvas-padding.js +0 -1
- package/dist/domain/system-components/canvas-preset-environment.js +0 -1
- package/dist/domain/system-components/child-entity-recipe-hierarchy.js +0 -1
- package/dist/domain/system-components/client-side-image.js +0 -1
- package/dist/domain/system-components/color-value.js +0 -1
- package/dist/domain/system-components/common/angle-indicator-schema.js +0 -1
- package/dist/domain/system-components/custom-header.js +0 -1
- package/dist/domain/system-components/custom-price-footer.js +0 -1
- package/dist/domain/system-components/custom-sidebar-footer.js +0 -1
- package/dist/domain/system-components/dimension-indicator.js +0 -1
- package/dist/domain/system-components/editable-angle-indicator.js +0 -1
- package/dist/domain/system-components/editable-distance-dimension-indicator.js +0 -1
- package/dist/domain/system-components/editable-offset-indicator.js +0 -1
- package/dist/domain/system-components/editable-size-indicator.js +0 -1
- package/dist/domain/system-components/entity-header.js +0 -1
- package/dist/domain/system-components/exit-tool-mode-fab.js +0 -1
- package/dist/domain/system-components/finalize-action.js +0 -1
- package/dist/domain/system-components/finalize-component.js +0 -1
- package/dist/domain/system-components/fit-selection-orthographic-camera-component.js +0 -1
- package/dist/domain/system-components/fit-selection-perspective-camera-component.js +0 -1
- package/dist/domain/system-components/fixed-header.js +0 -1
- package/dist/domain/system-components/floating-header.js +0 -1
- package/dist/domain/system-components/hidden-header.js +0 -1
- package/dist/domain/system-components/hidden-sidebar-footer.js +0 -1
- package/dist/domain/system-components/horizontal-tabs.js +0 -1
- package/dist/domain/system-components/list-selector-dimension-indicator.js +0 -1
- package/dist/domain/system-components/multilingual-text-value.js +0 -1
- package/dist/domain/system-components/navigation-steps.js +0 -1
- package/dist/domain/system-components/offset-anchors.js +0 -1
- package/dist/domain/system-components/offset-indicator.js +0 -1
- package/dist/domain/system-components/offset.js +0 -1
- package/dist/domain/system-components/other-action.js +0 -1
- package/dist/domain/system-components/property-page.js +0 -1
- package/dist/domain/system-components/read-sidebar-footer.js +0 -1
- package/dist/domain/system-components/replace-entity-recipe-hierarchy.js +0 -1
- package/dist/domain/system-components/rotatable.js +0 -1
- package/dist/domain/system-components/rotation-handle.js +0 -1
- package/dist/domain/system-components/save-template-thumbnail.js +0 -1
- package/dist/domain/system-components/scene-entity-add-fab.js +0 -1
- package/dist/domain/system-components/scene-entity-animation.js +0 -1
- package/dist/domain/system-components/scene-entity-control.js +0 -1
- package/dist/domain/system-components/scene-entity-delete-fab.js +0 -1
- package/dist/domain/system-components/scene-entity-floor-object.js +0 -1
- package/dist/domain/system-components/scene-entity-html-hotspot.js +0 -1
- package/dist/domain/system-components/scene-entity-navigation-hotspot.js +0 -1
- package/dist/domain/system-components/scene-entity-object-html-hotspot.js +0 -1
- package/dist/domain/system-components/scene-entity-select-hotspot.js +0 -1
- package/dist/domain/system-components/scene-entity-wall-object.js +0 -1
- package/dist/domain/system-components/selectable-component.js +0 -1
- package/dist/domain/system-components/sidebar-tabs.js +0 -1
- package/dist/domain/system-components/simple-summary.js +0 -1
- package/dist/domain/system-components/size.js +0 -1
- package/dist/domain/system-components/sketching-draw.js +0 -1
- package/dist/domain/system-components/sketching-edit.js +0 -1
- package/dist/domain/system-components/summary-component.js +0 -1
- package/dist/domain/system-components/text-value.js +0 -1
- package/dist/domain/system-components/tool-controls.js +0 -1
- package/dist/domain/system-components/tool-menu-fab.js +0 -1
- package/dist/domain/system-components/toolbar.js +0 -1
- package/dist/domain/system-components/universal-sidebar-footer.js +0 -1
- package/dist/domain/system-components/view-controls.js +0 -1
- /package/dist/{domain/components/component-reader-types.js → application-spec/core/expressions/relation-expression-params.js} +0 -0
- /package/dist/application-spec/{core → enhanced-json}/eval-code-uses-self.d.ts +0 -0
- /package/dist/application-spec/{core → enhanced-json}/eval-code-uses-self.js +0 -0
- /package/dist/application-spec/{core → enhanced-json}/eval-to-constant.js +0 -0
- /package/dist/domain/{actions → core/action}/action-factory.js +0 -0
- /package/dist/domain/core/{action.js → action/action.js} +0 -0
- /package/dist/domain/core/{expression.js → component/component-reader-types.js} +0 -0
- /package/dist/domain/{components → core/component}/legacy-filter.js +0 -0
- /package/dist/domain/{components → core/component}/system-component-filter.js +0 -0
- /package/dist/domain/{components → core/component}/system-virtual-entity.d.ts +0 -0
- /package/dist/domain/{components → core/component}/updates.js +0 -0
- /package/dist/domain/{relations/reference-field.js → core/data-schema/data-cell-value.js} +0 -0
- /package/dist/domain/{relations/relation-implementation.js → core/data-schema/data-schema-array-field.js} +0 -0
- /package/dist/domain/{invariants → core/invariant}/builtin-invariant.js +0 -0
- /package/dist/domain/{invariants → core/invariant}/violation-component.d.ts +0 -0
- /package/dist/domain/{relations → core/relation}/direct-relation.js +0 -0
- /package/dist/domain/core/{state.js → state/state.js} +0 -0
- /package/dist/domain/{expressions → domain-runtime/spec}/memoize-expression.js +0 -0
- /package/dist/domain/{expressions → domain-runtime/spec}/prepare-domain-expressions.js +0 -0
- /package/dist/domain/{system-components → extensions}/angle-indicator.d.ts +0 -0
- /package/dist/domain/{system-components → extensions}/basic-sidebar-footer.d.ts +0 -0
- /package/dist/domain/{system-components → extensions}/camera-based-hidden-entity-object.d.ts +0 -0
- /package/dist/domain/{system-components → extensions}/camera-based-hidden-entity.d.ts +0 -0
- /package/dist/domain/{system-components → extensions}/canvas-custom-environment.d.ts +0 -0
- /package/dist/domain/{system-components → extensions}/canvas-padding.d.ts +0 -0
- /package/dist/domain/{system-components → extensions}/canvas-preset-environment.d.ts +0 -0
- /package/dist/domain/{system-components → extensions}/color-value.d.ts +0 -0
- /package/dist/domain/{system-components → extensions}/common/dimension-indicator-schema.js +0 -0
- /package/dist/domain/{system-components → extensions}/common/dimension-indicators.d.ts +0 -0
- /package/dist/domain/{system-components → extensions}/common/dimension-indicators.js +0 -0
- /package/dist/domain/{system-components → extensions}/common/editable-indicator-button-variant.d.ts +0 -0
- /package/dist/domain/{system-components → extensions}/common/editable-indicator-button-variant.js +0 -0
- /package/dist/domain/{system-components → extensions}/custom-price-footer.d.ts +0 -0
- /package/dist/domain/{system-components → extensions}/dimension-indicator.d.ts +0 -0
- /package/dist/domain/{system-components → extensions}/exit-tool-mode-fab.d.ts +0 -0
- /package/dist/domain/{system-components → extensions}/finalize-action.d.ts +0 -0
- /package/dist/domain/{system-components → extensions}/finalize-component.d.ts +0 -0
- /package/dist/domain/{system-components → extensions}/fit-selection-orthographic-camera-component.d.ts +0 -0
- /package/dist/domain/{system-components → extensions}/fit-selection-perspective-camera-component.d.ts +0 -0
- /package/dist/domain/{system-components → extensions}/fixed-header.d.ts +0 -0
- /package/dist/domain/{system-components → extensions}/floating-header.d.ts +0 -0
- /package/dist/domain/{system-components → extensions}/hidden-header.d.ts +0 -0
- /package/dist/domain/{system-components → extensions}/hidden-sidebar-footer.d.ts +0 -0
- /package/dist/domain/{system-components → extensions}/multilingual-text-value.d.ts +0 -0
- /package/dist/domain/{system-components → extensions}/offset-anchors.d.ts +0 -0
- /package/dist/domain/{system-components → extensions}/offset-indicator.d.ts +0 -0
- /package/dist/domain/{system-components → extensions}/offset.d.ts +0 -0
- /package/dist/domain/{system-components → extensions}/other-action.d.ts +0 -0
- /package/dist/domain/{system-components → extensions}/read-sidebar-footer.d.ts +0 -0
- /package/dist/domain/{system-components → extensions}/rotatable.d.ts +0 -0
- /package/dist/domain/{system-components → extensions}/scene-entity-animation.d.ts +0 -0
- /package/dist/domain/{system-components → extensions}/scene-entity-control.d.ts +0 -0
- /package/dist/domain/{system-components → extensions}/scene-entity-floor-object.d.ts +0 -0
- /package/dist/domain/{system-components → extensions}/scene-entity-wall-object.d.ts +0 -0
- /package/dist/domain/{system-components → extensions}/selectable-component.d.ts +0 -0
- /package/dist/domain/{system-components → extensions}/sidebar-tabs.d.ts +0 -0
- /package/dist/domain/{system-components → extensions}/simple-summary.d.ts +0 -0
- /package/dist/domain/{system-components → extensions}/size.d.ts +0 -0
- /package/dist/domain/{system-components → extensions}/sketching-draw.d.ts +0 -0
- /package/dist/domain/{system-components → extensions}/summary-component.d.ts +0 -0
- /package/dist/domain/{system-components → extensions}/text-value.d.ts +0 -0
- /package/dist/domain/{system-components → extensions}/tool-controls.d.ts +0 -0
- /package/dist/domain/{system-components → extensions}/universal-sidebar-footer.d.ts +0 -0
- /package/dist/domain/{system-components → extensions}/view-controls.d.ts +0 -0
|
@@ -0,0 +1,1164 @@
|
|
|
1
|
+
# Custom Layout
|
|
2
|
+
|
|
3
|
+
Make the configurator look like the brand's own product page. A furniture shop wants its table configurator to read like the rest of its site: a floating panel on the left with the product's name, the edge finishes as picture cards, the price in large type and one clear call to action, and the table in the space beside it. The project writes that page as one React component. Phoenix supplies the 3D scene, the product's state and a few hooks; every pixel around the scene is the project's own.
|
|
4
|
+
|
|
5
|
+
- [Choose this approach](#choose-this-approach)
|
|
6
|
+
- [Register the layout](#register-the-layout)
|
|
7
|
+
- [What the layout has to do](#what-the-layout-has-to-do)
|
|
8
|
+
- [Read and change the product](#read-and-change-the-product)
|
|
9
|
+
- [Draw the choices](#draw-the-choices)
|
|
10
|
+
- [Offer fullscreen](#offer-fullscreen)
|
|
11
|
+
- [Show messages](#show-messages)
|
|
12
|
+
- [Serve read mode](#serve-read-mode)
|
|
13
|
+
- [The spec the layout reads](#the-spec-the-layout-reads)
|
|
14
|
+
- [Try the example](#try-the-example)
|
|
15
|
+
- [Test cases](#test-cases)
|
|
16
|
+
- [Known gaps](#known-gaps)
|
|
17
|
+
- [Related pages](#related-pages)
|
|
18
|
+
- [Complete Implementation](#complete-implementation)
|
|
19
|
+
|
|
20
|
+
## Choose this approach
|
|
21
|
+
|
|
22
|
+
Write your own layout when the configurator has to follow a design the built-in layout cannot take on: the brand's typography, controls and spacing, a panel on the left, a top bar with the price, an area the built-in layout has no place for.
|
|
23
|
+
|
|
24
|
+
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).
|
|
25
|
+
|
|
26
|
+
A project layout replaces all of that. None of the built-in sidebar, footer, toolbar or property pages is rendered for it, so the layout builds every control the user needs. This example uses no SDK component that draws UI: only the scene, the safe-area hook and hooks that read and change the product's state. A layout may also mount the SDK's own pieces where it wants them, see [Configurator Interface → Loaded Configuration UI](?path=/docs/phoenix-configurator-interface--docs#loaded-configuration-ui).
|
|
27
|
+
|
|
28
|
+
## Register the layout
|
|
29
|
+
|
|
30
|
+
Create `src/elements/ConfiguratorLayout.tsx` with a default export made by `phx.frontend.createCustomPhoenixLayoutElement`. The name `ConfiguratorLayout` is what makes it the layout: Phoenix renders the element registered under that name for every loaded configuration, in owner and in read mode, whatever `layout` the spec sets. Nothing in the YAML refers to it.
|
|
31
|
+
|
|
32
|
+
```tsx
|
|
33
|
+
import { Box } from '@mui/material'
|
|
34
|
+
|
|
35
|
+
import { LayoutSlots, useSceneSafeArea } from '@salsita-ai/sdk/configurator'
|
|
36
|
+
|
|
37
|
+
import { phx } from '../../.phoenix/phx.js'
|
|
38
|
+
import { FullscreenToggle } from '../_shared/FullscreenToggle.js'
|
|
39
|
+
import { MessageToast } from '../_shared/MessageToast.js'
|
|
40
|
+
import { ProductPanel } from '../_shared/ProductPanel.js'
|
|
41
|
+
|
|
42
|
+
const GUTTER = 24
|
|
43
|
+
const PANEL_WIDTH = 380
|
|
44
|
+
|
|
45
|
+
const ConfiguratorLayout = () => {
|
|
46
|
+
const { containerRef, safeAreaRef } = useSceneSafeArea()
|
|
47
|
+
const isFullscreen = phx.frontend.useIsFullscreenActive()
|
|
48
|
+
|
|
49
|
+
return (
|
|
50
|
+
<Box component="div" ref={containerRef} sx={{ position: 'absolute', inset: 0 }}>
|
|
51
|
+
<LayoutSlots.SharedCanvas />
|
|
52
|
+
|
|
53
|
+
{!isFullscreen && (
|
|
54
|
+
<Box
|
|
55
|
+
component="aside"
|
|
56
|
+
sx={{
|
|
57
|
+
position: 'absolute',
|
|
58
|
+
insetBlockStart: GUTTER,
|
|
59
|
+
insetInlineStart: GUTTER,
|
|
60
|
+
inlineSize: PANEL_WIDTH,
|
|
61
|
+
maxBlockSize: `calc(100% - ${2 * GUTTER}px)`,
|
|
62
|
+
display: 'flex',
|
|
63
|
+
flexDirection: 'column',
|
|
64
|
+
borderRadius: 5,
|
|
65
|
+
bgcolor: 'background.paper',
|
|
66
|
+
boxShadow: '0 12px 40px rgba(0, 0, 0, 0.12)',
|
|
67
|
+
overflow: 'hidden',
|
|
68
|
+
}}
|
|
69
|
+
>
|
|
70
|
+
<ProductPanel />
|
|
71
|
+
</Box>
|
|
72
|
+
)}
|
|
73
|
+
|
|
74
|
+
<Box
|
|
75
|
+
component="div"
|
|
76
|
+
ref={safeAreaRef}
|
|
77
|
+
sx={{
|
|
78
|
+
position: 'absolute',
|
|
79
|
+
insetBlock: 0,
|
|
80
|
+
insetInlineStart: isFullscreen ? 0 : PANEL_WIDTH + 2 * GUTTER,
|
|
81
|
+
insetInlineEnd: 0,
|
|
82
|
+
pointerEvents: 'none',
|
|
83
|
+
}}
|
|
84
|
+
>
|
|
85
|
+
<Box
|
|
86
|
+
component="div"
|
|
87
|
+
sx={{ position: 'absolute', insetBlockStart: GUTTER, insetInlineEnd: GUTTER, pointerEvents: 'auto' }}
|
|
88
|
+
>
|
|
89
|
+
<FullscreenToggle />
|
|
90
|
+
</Box>
|
|
91
|
+
<Box
|
|
92
|
+
component="div"
|
|
93
|
+
sx={{ position: 'absolute', insetBlockEnd: GUTTER, insetInlineStart: GUTTER, pointerEvents: 'auto' }}
|
|
94
|
+
>
|
|
95
|
+
<MessageToast />
|
|
96
|
+
</Box>
|
|
97
|
+
</Box>
|
|
98
|
+
</Box>
|
|
99
|
+
)
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
export default phx.frontend.createCustomPhoenixLayoutElement('ConfiguratorLayout', ConfiguratorLayout)
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
The components it uses live in `src/_shared/`, which Phoenix does not import by convention, so the layout imports them itself. Application projects receive `phx` as a global. Storybook examples cannot rely on that project environment, so these files import it from `../../.phoenix/phx.js`; leave that import out in a project.
|
|
106
|
+
|
|
107
|
+
## What the layout has to do
|
|
108
|
+
|
|
109
|
+
- **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`.
|
|
110
|
+
- **Mount the shared canvas.** The app loader stays on screen until the scene has loaded. A layout without `LayoutSlots.SharedCanvas` never gets past the loader unless the project sets `appLoader: legacy`.
|
|
111
|
+
- **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.
|
|
112
|
+
- **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. 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.
|
|
113
|
+
- **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.
|
|
114
|
+
- **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 and lets the safe area start at the left edge, so the camera frames the product in the whole canvas.
|
|
115
|
+
- **Serve read mode.** The same element renders a configuration shared for viewing, and the layout decides what a viewer sees.
|
|
116
|
+
|
|
117
|
+
## Read and change the product
|
|
118
|
+
|
|
119
|
+
The panel reads everything it shows from hooks and writes the customer's choice back through one of them. The table lists the hooks the whole layout uses:
|
|
120
|
+
|
|
121
|
+
```tsx
|
|
122
|
+
import { Box, Button, Typography } from '@mui/material'
|
|
123
|
+
|
|
124
|
+
import { detailComponent } from '@salsita-ai/sdk/domain'
|
|
125
|
+
import { useResolveLocalizable } from '@salsita-ai/sdk/react'
|
|
126
|
+
|
|
127
|
+
import { phx } from '../../.phoenix/phx.js'
|
|
128
|
+
import { EdgeFinishCards } from './EdgeFinishCards.js'
|
|
129
|
+
|
|
130
|
+
export const ProductPanel = () => {
|
|
131
|
+
const resolve = useResolveLocalizable()
|
|
132
|
+
const detail = phx.frontend.useFirstRootComponent(detailComponent)
|
|
133
|
+
const price = phx.frontend.useRootEntityPrice()
|
|
134
|
+
const tableId = phx.frontend.useRootEntityId()
|
|
135
|
+
const edgeFinish = phx.frontend.useAttributeSelection(tableId, 'edgeFinish')
|
|
136
|
+
const { accessInfo } = phx.frontend.useAccessService()
|
|
137
|
+
const navigationState = phx.frontend.useActiveNavigationState()
|
|
138
|
+
const pushNavigate = phx.frontend.usePushNavigate()
|
|
139
|
+
const popNavigate = phx.frontend.usePopNavigate()
|
|
140
|
+
|
|
141
|
+
const isReadMode = accessInfo.viewMode
|
|
142
|
+
const isReview = isReadMode || navigationState === 'checkout'
|
|
143
|
+
const chosenEdge = edgeFinish.options.find(option => option.value === edgeFinish.value)
|
|
144
|
+
|
|
145
|
+
return (
|
|
146
|
+
<>
|
|
147
|
+
<Box component="header" sx={{ display: 'grid', gap: 1, padding: 3, paddingBlockEnd: 2 }}>
|
|
148
|
+
{isReadMode ? (
|
|
149
|
+
<Typography
|
|
150
|
+
variant="overline"
|
|
151
|
+
sx={{ justifySelf: 'start', paddingInline: 1.5, borderRadius: 999, bgcolor: 'action.selected' }}
|
|
152
|
+
>
|
|
153
|
+
View only
|
|
154
|
+
</Typography>
|
|
155
|
+
) : (
|
|
156
|
+
<Typography variant="overline" color="text.secondary">
|
|
157
|
+
{resolve(detail?.state.subtitle)}
|
|
158
|
+
</Typography>
|
|
159
|
+
)}
|
|
160
|
+
<Typography variant="h5" component="h2" fontWeight={700}>
|
|
161
|
+
{resolve(detail?.state.title)}
|
|
162
|
+
</Typography>
|
|
163
|
+
<Typography variant="body2" color="text.secondary">
|
|
164
|
+
{resolve(detail?.state.description)}
|
|
165
|
+
</Typography>
|
|
166
|
+
</Box>
|
|
167
|
+
|
|
168
|
+
<Box component="div" sx={{ display: 'grid', gap: 1.5, paddingInline: 3, paddingBlockEnd: 3, overflowY: 'auto' }}>
|
|
169
|
+
<Typography variant="subtitle2" component="h3">
|
|
170
|
+
Edge finish
|
|
171
|
+
</Typography>
|
|
172
|
+
{isReview ? (
|
|
173
|
+
<Box component="div" sx={{ padding: 2, borderRadius: 3, bgcolor: 'action.hover' }}>
|
|
174
|
+
<Typography variant="body2" fontWeight={600}>
|
|
175
|
+
{resolve(chosenEdge?.title)}
|
|
176
|
+
</Typography>
|
|
177
|
+
<Typography variant="caption" color="text.secondary">
|
|
178
|
+
{resolve(chosenEdge?.description)}
|
|
179
|
+
</Typography>
|
|
180
|
+
</Box>
|
|
181
|
+
) : (
|
|
182
|
+
<EdgeFinishCards selection={edgeFinish} />
|
|
183
|
+
)}
|
|
184
|
+
</Box>
|
|
185
|
+
|
|
186
|
+
<Box component="footer" sx={{ display: 'grid', gap: 2, padding: 3, borderTop: 1, borderColor: 'divider' }}>
|
|
187
|
+
<Box component="div" sx={{ display: 'flex', alignItems: 'baseline', justifyContent: 'space-between' }}>
|
|
188
|
+
<Typography variant="body2" color="text.secondary">
|
|
189
|
+
Total price
|
|
190
|
+
</Typography>
|
|
191
|
+
<Typography variant="h5" component="p" fontWeight={700}>
|
|
192
|
+
{price}
|
|
193
|
+
</Typography>
|
|
194
|
+
</Box>
|
|
195
|
+
{isReview && !isReadMode && (
|
|
196
|
+
<Typography variant="body2" color="text.secondary">
|
|
197
|
+
Your table is ready for a quote. A real shop collects the contact details here.
|
|
198
|
+
</Typography>
|
|
199
|
+
)}
|
|
200
|
+
{!isReadMode && (
|
|
201
|
+
<Button
|
|
202
|
+
size="large"
|
|
203
|
+
variant={isReview ? 'outlined' : 'contained'}
|
|
204
|
+
onClick={isReview ? popNavigate : () => pushNavigate('checkout')}
|
|
205
|
+
sx={{ minBlockSize: 48, borderRadius: 999, textTransform: 'none', fontWeight: 600 }}
|
|
206
|
+
>
|
|
207
|
+
{isReview ? 'Back to the configuration' : 'Review and request a quote'}
|
|
208
|
+
</Button>
|
|
209
|
+
)}
|
|
210
|
+
</Box>
|
|
211
|
+
</>
|
|
212
|
+
)
|
|
213
|
+
}
|
|
214
|
+
```
|
|
215
|
+
|
|
216
|
+
| Hook | What the layout uses it for |
|
|
217
|
+
| ---------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
218
|
+
| `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. |
|
|
219
|
+
| `phx.frontend.useRootEntityId()` | The id of the table, which the control hooks take. |
|
|
220
|
+
| `phx.frontend.useAttributeSelection(entityId, instanceName)` | The `attributeSelection` component named `edgeFinish`: the current `value` and the `options`, each with `title`, `description`, `value`, `disabled` and `onSelect`. |
|
|
221
|
+
| `phx.frontend.useRootEntityPrice()` | The root entity's `price` component, formatted for the current locale and currency, or `null` without one. |
|
|
222
|
+
| `phx.frontend.useAccessService()` | `accessInfo.viewMode` is `true` while a configuration shared for viewing is open, and also while the host sets the `readonly` property. |
|
|
223
|
+
| `phx.frontend.useActiveNavigationState()` | The active navigation state; the panel shows its review step while it is `checkout`. |
|
|
224
|
+
| `phx.frontend.usePushNavigate()` and `phx.frontend.usePopNavigate()` | Enter the review step and leave it again. |
|
|
225
|
+
| `phx.frontend.useIsFullscreenActive()` and `phx.frontend.useSetFullscreen()` | Read the fullscreen flag, and set it from the layout's own button. |
|
|
226
|
+
| `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). |
|
|
227
|
+
| `useResolveLocalizable()` from `@salsita-ai/sdk/react` | Turns the localizable texts of the spec into strings in the current language. [Localization](?path=/docs/phoenix-localization--docs) describes it and `LocalizableMessage`. |
|
|
228
|
+
|
|
229
|
+
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`.
|
|
230
|
+
|
|
231
|
+
The review step is the layout's own: the button pushes the `checkout` navigation state, and the panel shows a summary instead of the cards. A real shop collects the contact details there and sends the request.
|
|
232
|
+
|
|
233
|
+
## Draw the choices
|
|
234
|
+
|
|
235
|
+
The edge finish is a visual choice, so the panel shows it as cards with a drawing of each profile, as [Choosing a Control](?path=/docs/ux-guidelines-choosing-a-control--docs) recommends for shapes. The selected card has a border in the theme's primary colour, a tinted background and a check mark, so the state does not depend on colour alone. The cards form a radio group: the group has `role="radiogroup"` and a label, each card `role="radio"` and `aria-checked`, only the selected card is in the tab order, and the arrow keys move the selection, skipping disabled options, as in a native radio group. Each card is at least 44 pixels high and shows a focus ring for keyboard users.
|
|
236
|
+
|
|
237
|
+
```tsx
|
|
238
|
+
import { Box, ButtonBase, type SxProps, type Theme, Typography } from '@mui/material'
|
|
239
|
+
import type { KeyboardEvent } from 'react'
|
|
240
|
+
|
|
241
|
+
import { type UseAttributeSelection, useResolveLocalizable } from '@salsita-ai/sdk/react'
|
|
242
|
+
|
|
243
|
+
// Cross-sections of the tabletop's edge, keyed by the option values of the spec.
|
|
244
|
+
const EDGE_PROFILES: Readonly<Record<string, string>> = {
|
|
245
|
+
None: 'M0 4H32V20H0Z',
|
|
246
|
+
Facet: 'M0 4H26L32 10V14L26 20H0Z',
|
|
247
|
+
Round: 'M0 4H24A8 8 0 0 1 24 20H0Z',
|
|
248
|
+
TreeTrunk: 'M0 4H27C33 5 28 9 34 11C29 13 34 17 27 20H0Z',
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
const CHECK_BADGE: SxProps<Theme> = {
|
|
252
|
+
position: 'absolute',
|
|
253
|
+
insetBlockStart: 10,
|
|
254
|
+
insetInlineEnd: 10,
|
|
255
|
+
display: 'grid',
|
|
256
|
+
placeItems: 'center',
|
|
257
|
+
inlineSize: 22,
|
|
258
|
+
blockSize: 22,
|
|
259
|
+
borderRadius: '50%',
|
|
260
|
+
bgcolor: 'primary.main',
|
|
261
|
+
color: 'primary.contrastText',
|
|
262
|
+
fontSize: 13,
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
// Arrow keys move the selection between the cards, as in a native radio group.
|
|
266
|
+
const ARROW_STEPS: Readonly<Record<string, number | undefined>> = {
|
|
267
|
+
ArrowRight: 1,
|
|
268
|
+
ArrowDown: 1,
|
|
269
|
+
ArrowLeft: -1,
|
|
270
|
+
ArrowUp: -1,
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
interface EdgeFinishCardsProps {
|
|
274
|
+
readonly selection: ReturnType<UseAttributeSelection>
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
export const EdgeFinishCards = ({ selection }: EdgeFinishCardsProps) => {
|
|
278
|
+
const resolve = useResolveLocalizable()
|
|
279
|
+
const { options } = selection
|
|
280
|
+
// The card in the tab order: the selected one, or the first enabled one. Disabled cards are never in it.
|
|
281
|
+
const selectedIndex = options.findIndex(option => option.value === selection.value && !option.disabled)
|
|
282
|
+
const focusIndex = selectedIndex >= 0 ? selectedIndex : options.findIndex(option => !option.disabled)
|
|
283
|
+
|
|
284
|
+
const handleKeyDown = (event: KeyboardEvent<HTMLElement>, index: number) => {
|
|
285
|
+
const step = ARROW_STEPS[event.key]
|
|
286
|
+
|
|
287
|
+
if (step === undefined) {
|
|
288
|
+
return
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
event.preventDefault()
|
|
292
|
+
// The next enabled option in the arrow's direction, wrapping around; disabled options are skipped.
|
|
293
|
+
const count = options.length
|
|
294
|
+
const next = Array.from(
|
|
295
|
+
{ length: count - 1 },
|
|
296
|
+
(_, offset) => (((index + step * (offset + 1)) % count) + count) % count
|
|
297
|
+
).find(candidate => !options[candidate]?.disabled)
|
|
298
|
+
|
|
299
|
+
if (next === undefined) {
|
|
300
|
+
return
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
options[next]?.onSelect()
|
|
304
|
+
event.currentTarget.parentElement?.querySelectorAll<HTMLElement>('[role="radio"]')[next]?.focus()
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
return (
|
|
308
|
+
<Box
|
|
309
|
+
component="div"
|
|
310
|
+
role="radiogroup"
|
|
311
|
+
aria-label="Edge finish"
|
|
312
|
+
sx={{ display: 'grid', gridTemplateColumns: '1fr 1fr', gap: 1.5 }}
|
|
313
|
+
>
|
|
314
|
+
{options.map((option, index) => {
|
|
315
|
+
const isSelected = option.value === selection.value
|
|
316
|
+
|
|
317
|
+
return (
|
|
318
|
+
<ButtonBase
|
|
319
|
+
key={String(option.value)}
|
|
320
|
+
role="radio"
|
|
321
|
+
aria-checked={isSelected}
|
|
322
|
+
tabIndex={index === focusIndex ? 0 : -1}
|
|
323
|
+
disabled={option.disabled}
|
|
324
|
+
onClick={option.onSelect}
|
|
325
|
+
onKeyDown={event => handleKeyDown(event, index)}
|
|
326
|
+
sx={{
|
|
327
|
+
position: 'relative',
|
|
328
|
+
display: 'grid',
|
|
329
|
+
justifyItems: 'start',
|
|
330
|
+
gap: 0.5,
|
|
331
|
+
padding: 2,
|
|
332
|
+
borderRadius: 3,
|
|
333
|
+
border: 2,
|
|
334
|
+
borderColor: isSelected ? 'primary.main' : 'divider',
|
|
335
|
+
bgcolor: isSelected ? 'action.hover' : 'transparent',
|
|
336
|
+
textAlign: 'start',
|
|
337
|
+
transition: 'border-color 150ms, background-color 150ms',
|
|
338
|
+
'&:hover': { borderColor: isSelected ? 'primary.main' : 'text.disabled' },
|
|
339
|
+
'&.Mui-focusVisible': { outline: 2, outlineColor: 'primary.main', outlineOffset: 2 },
|
|
340
|
+
'&.Mui-disabled': { opacity: 0.4 },
|
|
341
|
+
}}
|
|
342
|
+
>
|
|
343
|
+
{isSelected && (
|
|
344
|
+
<Box component="span" aria-hidden sx={CHECK_BADGE}>
|
|
345
|
+
✓
|
|
346
|
+
</Box>
|
|
347
|
+
)}
|
|
348
|
+
<Box
|
|
349
|
+
component="svg"
|
|
350
|
+
viewBox="0 0 36 24"
|
|
351
|
+
aria-hidden
|
|
352
|
+
sx={{ inlineSize: 60, blockSize: 40, color: '#b98b5e' }}
|
|
353
|
+
>
|
|
354
|
+
<path d={EDGE_PROFILES[String(option.value)]} fill="currentColor" />
|
|
355
|
+
</Box>
|
|
356
|
+
<Typography variant="body2" fontWeight={600}>
|
|
357
|
+
{resolve(option.title)}
|
|
358
|
+
</Typography>
|
|
359
|
+
<Typography variant="caption" color="text.secondary">
|
|
360
|
+
{resolve(option.description)}
|
|
361
|
+
</Typography>
|
|
362
|
+
</ButtonBase>
|
|
363
|
+
)
|
|
364
|
+
})}
|
|
365
|
+
</Box>
|
|
366
|
+
)
|
|
367
|
+
}
|
|
368
|
+
```
|
|
369
|
+
|
|
370
|
+
The drawings are keyed by the option values of the spec. A spec can carry a picture per option instead, as `img`, which the hook returns as `imageSrc`; [CardSelect](?path=/docs/controls-select-attribute-cardselect--docs) shows the SDK's own card control.
|
|
371
|
+
|
|
372
|
+
## Offer fullscreen
|
|
373
|
+
|
|
374
|
+
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.
|
|
375
|
+
|
|
376
|
+
```tsx
|
|
377
|
+
import { Button } from '@mui/material'
|
|
378
|
+
|
|
379
|
+
import { phx } from '../../.phoenix/phx.js'
|
|
380
|
+
|
|
381
|
+
const ENTER_ICON = 'M4 9V4h5M15 4h5v5M20 15v5h-5M9 20H4v-5'
|
|
382
|
+
const EXIT_ICON = 'M9 4v5H4M15 4v5h5M15 20v-5h5M9 20v-5H4'
|
|
383
|
+
|
|
384
|
+
export const FullscreenToggle = () => {
|
|
385
|
+
const isFullscreen = phx.frontend.useIsFullscreenActive()
|
|
386
|
+
const setFullscreen = phx.frontend.useSetFullscreen()
|
|
387
|
+
|
|
388
|
+
return (
|
|
389
|
+
<Button
|
|
390
|
+
onClick={() => setFullscreen(!isFullscreen)}
|
|
391
|
+
startIcon={
|
|
392
|
+
<svg viewBox="0 0 24 24" width={20} height={20} fill="none" stroke="currentColor" strokeWidth={2}>
|
|
393
|
+
<path d={isFullscreen ? EXIT_ICON : ENTER_ICON} />
|
|
394
|
+
</svg>
|
|
395
|
+
}
|
|
396
|
+
sx={{
|
|
397
|
+
minBlockSize: 44,
|
|
398
|
+
paddingInline: 2.5,
|
|
399
|
+
borderRadius: 999,
|
|
400
|
+
bgcolor: 'background.paper',
|
|
401
|
+
color: 'text.primary',
|
|
402
|
+
boxShadow: '0 4px 16px rgba(0, 0, 0, 0.12)',
|
|
403
|
+
textTransform: 'none',
|
|
404
|
+
fontWeight: 600,
|
|
405
|
+
'&:hover': { bgcolor: 'background.paper', boxShadow: '0 6px 20px rgba(0, 0, 0, 0.18)' },
|
|
406
|
+
}}
|
|
407
|
+
>
|
|
408
|
+
{isFullscreen ? 'Exit fullscreen' : 'Fullscreen'}
|
|
409
|
+
</Button>
|
|
410
|
+
)
|
|
411
|
+
}
|
|
412
|
+
```
|
|
413
|
+
|
|
414
|
+
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.
|
|
415
|
+
|
|
416
|
+
## Show messages
|
|
417
|
+
|
|
418
|
+
When a change is rejected because it breaks an invariant, when a committed change carries a hint, or when an error is thrown while a change is validated, 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 at the bottom of the free area shows a message for six seconds, colored by its severity:
|
|
419
|
+
|
|
420
|
+
```tsx
|
|
421
|
+
import { Alert } from '@mui/material'
|
|
422
|
+
import { useEffect, useState } from 'react'
|
|
423
|
+
|
|
424
|
+
import type { ConfiguratorMessage } from '@salsita-ai/sdk/react'
|
|
425
|
+
|
|
426
|
+
import { phx } from '../../.phoenix/phx.js'
|
|
427
|
+
|
|
428
|
+
const VIOLATION_SEVERITY = { fatal: 'error', fixable: 'error', warning: 'warning', notice: 'info' } as const
|
|
429
|
+
const RANK = { info: 0, warning: 1, error: 2 } as const
|
|
430
|
+
const VISIBLE_MS = 6000
|
|
431
|
+
|
|
432
|
+
const severityOf = (message: ConfiguratorMessage) => {
|
|
433
|
+
if (message.kind === 'violation') {
|
|
434
|
+
return VIOLATION_SEVERITY[message.violation.severity]
|
|
435
|
+
}
|
|
436
|
+
|
|
437
|
+
return message.kind === 'error' ? 'error' : 'info'
|
|
438
|
+
}
|
|
439
|
+
|
|
440
|
+
export const MessageToast = () => {
|
|
441
|
+
const [message, setMessage] = useState<ConfiguratorMessage | null>(null)
|
|
442
|
+
|
|
443
|
+
// A rejected change also reports the notices already present; keep the worst message while it is shown
|
|
444
|
+
phx.frontend.useConfiguratorMessages(next => {
|
|
445
|
+
setMessage(shown => (shown !== null && RANK[severityOf(next)] < RANK[severityOf(shown)] ? shown : next))
|
|
446
|
+
})
|
|
447
|
+
|
|
448
|
+
useEffect(() => {
|
|
449
|
+
if (message === null) {
|
|
450
|
+
return
|
|
451
|
+
}
|
|
452
|
+
|
|
453
|
+
const timeout = setTimeout(() => setMessage(null), VISIBLE_MS)
|
|
454
|
+
|
|
455
|
+
return () => clearTimeout(timeout)
|
|
456
|
+
}, [message])
|
|
457
|
+
|
|
458
|
+
if (message === null) {
|
|
459
|
+
return null
|
|
460
|
+
}
|
|
461
|
+
|
|
462
|
+
return (
|
|
463
|
+
<Alert
|
|
464
|
+
severity={severityOf(message)}
|
|
465
|
+
onClose={() => setMessage(null)}
|
|
466
|
+
sx={{ maxInlineSize: 420, borderRadius: 3, boxShadow: '0 12px 40px rgba(0, 0, 0, 0.12)' }}
|
|
467
|
+
>
|
|
468
|
+
{message.text}
|
|
469
|
+
</Alert>
|
|
470
|
+
)
|
|
471
|
+
}
|
|
472
|
+
```
|
|
473
|
+
|
|
474
|
+
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 `'error'`; 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.
|
|
475
|
+
|
|
476
|
+
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:
|
|
477
|
+
|
|
478
|
+
```ts
|
|
479
|
+
import { msg } from '@lingui/core/macro'
|
|
480
|
+
|
|
481
|
+
import { phx } from '../../.phoenix/phx.js'
|
|
482
|
+
|
|
483
|
+
// A tree-trunk edge is cut by hand; choosing it carries a hint, which reaches the layout as a side-effect message
|
|
484
|
+
export default phx.frontend.transformerBuilder.when
|
|
485
|
+
.entity(['Table'])
|
|
486
|
+
.modified({ atFields: ['edgeFinish'] })
|
|
487
|
+
.then.overrideMatchingUpdate(({ update }) => {
|
|
488
|
+
if (update.stateDelta.edgeFinish !== 'TreeTrunk') {
|
|
489
|
+
return [update]
|
|
490
|
+
}
|
|
491
|
+
|
|
492
|
+
return [{ ...update, hint: msg`Tree trunk edges are cut by hand, so delivery takes three weeks longer.` }]
|
|
493
|
+
})
|
|
494
|
+
.build('tree-trunk-delivery')
|
|
495
|
+
```
|
|
496
|
+
|
|
497
|
+
[Configurator Interface → Loaded Configuration UI](?path=/docs/phoenix-configurator-interface--docs#loaded-configuration-ui) lists the messages the hook does not deliver: a failure to save, errors of the built-in finalize and other actions, and preset errors stay snackbars.
|
|
498
|
+
|
|
499
|
+
## Serve read mode
|
|
500
|
+
|
|
501
|
+
While `accessInfo.viewMode` is `true` the panel marks the view as view only, replaces the cards with the chosen finish and shows the price without an action. The 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.
|
|
502
|
+
|
|
503
|
+
## The spec the layout reads
|
|
504
|
+
|
|
505
|
+
The layout reads three components of the root entity and one navigation state; the scene components are in the complete implementation below.
|
|
506
|
+
|
|
507
|
+
```yaml
|
|
508
|
+
navigationStates:
|
|
509
|
+
- configure
|
|
510
|
+
- checkout
|
|
511
|
+
|
|
512
|
+
components:
|
|
513
|
+
Table:
|
|
514
|
+
detail:
|
|
515
|
+
main:
|
|
516
|
+
title: Linden dining table
|
|
517
|
+
subtitle: Solid oak, seats six
|
|
518
|
+
description: A solid oak top on slender steel legs, finished with the edge profile of your choice.
|
|
519
|
+
price:
|
|
520
|
+
main:
|
|
521
|
+
price:
|
|
522
|
+
$read: $price
|
|
523
|
+
attributeSelection:
|
|
524
|
+
edgeFinish:
|
|
525
|
+
value:
|
|
526
|
+
$bind: edgeFinish
|
|
527
|
+
options:
|
|
528
|
+
- label: Square
|
|
529
|
+
description: Crisp and modern
|
|
530
|
+
value: None
|
|
531
|
+
- label: Facet
|
|
532
|
+
description: A light bevel
|
|
533
|
+
value: Facet
|
|
534
|
+
- label: Round
|
|
535
|
+
description: Soft to the touch
|
|
536
|
+
value: Round
|
|
537
|
+
- label: Tree trunk
|
|
538
|
+
description: The natural edge
|
|
539
|
+
value: TreeTrunk
|
|
540
|
+
|
|
541
|
+
transformers:
|
|
542
|
+
- name: tree-trunk-delivery
|
|
543
|
+
```
|
|
544
|
+
|
|
545
|
+
`$price` is a custom expression in `src/expressions/table.ts` that adds a surcharge per finish, and `tree-trunk-delivery` is the transformer in `src/transformers/tree-trunk-delivery.ts` that adds the hint shown in [Show messages](#show-messages). The example sets no `applicationConfig` and no layout components: `layout`, the header, the sidebar footer, the toolbar, `viewControls` and property pages configure the built-in layout and have no effect on this one.
|
|
546
|
+
|
|
547
|
+
## Try the example
|
|
548
|
+
|
|
549
|
+
To see read mode, open **Mocks** in the editor rail on the left and apply the **Read User** template.
|
|
550
|
+
|
|
551
|
+
## Test cases
|
|
552
|
+
|
|
553
|
+
- The panel is on the left and the table is centred in the area to the right of it, not in the whole canvas.
|
|
554
|
+
- 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.
|
|
555
|
+
- 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.
|
|
556
|
+
- Tab reaches the selected card, and the arrow keys move the selection to the next or previous card.
|
|
557
|
+
- Dragging in the area to the right of the panel orbits the camera.
|
|
558
|
+
- **Review and request a quote** replaces the cards with the chosen finish; **Back to the configuration** brings them back.
|
|
559
|
+
- **Fullscreen** removes the panel and the table moves to the centre of the canvas; **Exit fullscreen** brings both back.
|
|
560
|
+
- With the **Read User** mock the panel says **View only**, shows the chosen finish and the price, and has no button.
|
|
561
|
+
|
|
562
|
+
## Known gaps
|
|
563
|
+
|
|
564
|
+
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.
|
|
565
|
+
|
|
566
|
+
- **Phone width.** The panel is written for desktop: on a narrow screen it covers the scene. A phone layout puts the panel in a bottom sheet and moves the safe area above it.
|
|
567
|
+
- **Messages that stay snackbars.** The toast shows violations, side effects and errors. A failure to save the configuration is still raised as a snackbar, which renders into `LayoutSlots.DesktopSnackbarsRoot`; this layout mounts no snackbar root, so it appears outside the configurator. A layout that wants it inside mounts the root.
|
|
568
|
+
- **Finalize actions from the spec.** The review step here is the layout's own and submits nothing. It does not offer the spec's `finalizeAction` components and does not check `phx.frontend.useFinalizeViolations()`; [Configurator Interface → Hooks for a Project Layout](?path=/docs/phoenix-configurator-interface--docs#hooks-for-a-project-layout) describes both, and [Finalization](?path=/docs/phoenix-finalization--docs) covers what a real flow does.
|
|
569
|
+
- **Toolbar actions.** Undo and redo, camera reset, measurements, sharing and language switching are not offered. A layout can mount `LayoutSlots.DesktopToolbar` for the toolbar the spec configures, or build its own buttons.
|
|
570
|
+
- **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 they do not appear.
|
|
571
|
+
- **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`.
|
|
572
|
+
- **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.
|
|
573
|
+
- **Clone to edit in read mode.** With `shareCloneToEdit` set, the built-in layout's `LayoutSlots.DesktopReadonlyBanner` offers **Edit configuration** to a viewer; this layout's "View only" label offers nothing. A layout mounts the banner, or builds its own action with `LayoutSlots.useIsCloningAllowed()` and `LayoutSlots.CloneToEditDialog`.
|
|
574
|
+
- **Back and close.** The built-in header's back button returns to the product choice, runs the host's close action or leaves the expanded view, whichever applies. This layout has none of them. `useCloseAction()` from `@salsita-ai/sdk/configurator` returns the host's close action, or `null` when there is none; the hook that chooses among the three is not exported.
|
|
575
|
+
- **Analytics.** The built-in fullscreen and finalize buttons record `FullScreenModeToggled` and `FinalizeButtonClicked`; this layout's buttons record nothing. A layout that wants the events pushes `FrontendAnalyticsFactory.FullScreenModeToggled()` and the like, from `@salsita-ai/sdk/configurator`, with `phx.frontend.useAnalytics().push(...)`.
|
|
576
|
+
- **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.
|
|
577
|
+
- **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.
|
|
578
|
+
- **"Powered by Salsita" mark.** The built-in layout shows it; a project layout decides whether to mount `LayoutSlots.DesktopPoweredBy`, and this one does not.
|
|
579
|
+
|
|
580
|
+
## Related pages
|
|
581
|
+
|
|
582
|
+
- [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.
|
|
583
|
+
- [Universal](?path=/docs/layouts-universal--docs) is the built-in layout this one replaces.
|
|
584
|
+
- [Header / Custom](?path=/docs/layouts-header-custom--docs) replaces only the header, with the price from `useRootEntityPrice()`.
|
|
585
|
+
- [Canvas Padding](?path=/docs/layouts-canvas-padding--docs) scales the gaps `useSceneSafeArea()` measures.
|
|
586
|
+
- [Presets / Custom](?path=/docs/layouts-presets-custom--docs) replaces the preset screen the same way.
|
|
587
|
+
|
|
588
|
+
## Complete Implementation
|
|
589
|
+
|
|
590
|
+
{/* AUTO-GENERATED SECTION: This section is automatically updated by 'phoenix story build' */}
|
|
591
|
+
|
|
592
|
+
<details>
|
|
593
|
+
<summary>Click to view the complete implementation files</summary>
|
|
594
|
+
|
|
595
|
+
### ./spec/domain.yaml
|
|
596
|
+
|
|
597
|
+
```yaml
|
|
598
|
+
model:
|
|
599
|
+
latest:
|
|
600
|
+
entityTypes:
|
|
601
|
+
- Table
|
|
602
|
+
aliases:
|
|
603
|
+
RootEntity:
|
|
604
|
+
- Table
|
|
605
|
+
commonTypes:
|
|
606
|
+
EdgeFinish:
|
|
607
|
+
enum:
|
|
608
|
+
- None
|
|
609
|
+
- Facet
|
|
610
|
+
- Round
|
|
611
|
+
- TreeTrunk
|
|
612
|
+
shapes:
|
|
613
|
+
Table:
|
|
614
|
+
edgeFinish:
|
|
615
|
+
$ref: '#/model/latest/commonTypes/EdgeFinish'
|
|
616
|
+
|
|
617
|
+
presets:
|
|
618
|
+
- rootEntityType: Table
|
|
619
|
+
initialDomainEntities:
|
|
620
|
+
- id: Table-1
|
|
621
|
+
type: Table
|
|
622
|
+
edgeFinish: None
|
|
623
|
+
|
|
624
|
+
navigationStates:
|
|
625
|
+
- configure
|
|
626
|
+
- checkout
|
|
627
|
+
|
|
628
|
+
components:
|
|
629
|
+
Table:
|
|
630
|
+
detail:
|
|
631
|
+
main:
|
|
632
|
+
title: Linden dining table
|
|
633
|
+
subtitle: Solid oak, seats six
|
|
634
|
+
description: A solid oak top on slender steel legs, finished with the edge profile of your choice.
|
|
635
|
+
price:
|
|
636
|
+
main:
|
|
637
|
+
price:
|
|
638
|
+
$read: $price
|
|
639
|
+
attributeSelection:
|
|
640
|
+
edgeFinish:
|
|
641
|
+
value:
|
|
642
|
+
$bind: edgeFinish
|
|
643
|
+
options:
|
|
644
|
+
- label: Square
|
|
645
|
+
description: Crisp and modern
|
|
646
|
+
value: None
|
|
647
|
+
- label: Facet
|
|
648
|
+
description: A light bevel
|
|
649
|
+
value: Facet
|
|
650
|
+
- label: Round
|
|
651
|
+
description: Soft to the touch
|
|
652
|
+
value: Round
|
|
653
|
+
- label: Tree trunk
|
|
654
|
+
description: The natural edge
|
|
655
|
+
value: TreeTrunk
|
|
656
|
+
fitRootPerspectiveCamera:
|
|
657
|
+
main:
|
|
658
|
+
priority: 1
|
|
659
|
+
fov: 35
|
|
660
|
+
near: 100
|
|
661
|
+
far: 10000
|
|
662
|
+
minDistance: 1000
|
|
663
|
+
maxDistance: 9000
|
|
664
|
+
distance: 5000
|
|
665
|
+
azimuthAngle: 1.5
|
|
666
|
+
polarAngle: 1.1
|
|
667
|
+
fitMeshChanges: true
|
|
668
|
+
sceneEntityRemoteObject:
|
|
669
|
+
top:
|
|
670
|
+
fileUrl: /models/tables.gltf
|
|
671
|
+
objectName: RECHTHOEK_RECTANGLE
|
|
672
|
+
dimensionUnit: m
|
|
673
|
+
leg:
|
|
674
|
+
fileUrl: /models/tables.gltf
|
|
675
|
+
objectName: AXL_LEG
|
|
676
|
+
dimensionUnit: m
|
|
677
|
+
sceneEntityObjectProperties:
|
|
678
|
+
top:
|
|
679
|
+
offsetY: 820
|
|
680
|
+
morphTargetInfluences:
|
|
681
|
+
Facet:
|
|
682
|
+
value:
|
|
683
|
+
$read: $edgeFinishFacet
|
|
684
|
+
scaleOne: 1
|
|
685
|
+
scaleZero: 0
|
|
686
|
+
Bol:
|
|
687
|
+
value:
|
|
688
|
+
$read: $edgeFinishRound
|
|
689
|
+
scaleOne: 1
|
|
690
|
+
scaleZero: 0
|
|
691
|
+
Boomstamrand:
|
|
692
|
+
value:
|
|
693
|
+
$read: $edgeFinishTreeTrunk
|
|
694
|
+
scaleOne: 1
|
|
695
|
+
scaleZero: 0
|
|
696
|
+
leg:
|
|
697
|
+
morphTargetInfluences:
|
|
698
|
+
Length:
|
|
699
|
+
value: 1000
|
|
700
|
+
scaleOne: 3000
|
|
701
|
+
scaleZero: 1400
|
|
702
|
+
Width:
|
|
703
|
+
value: 700
|
|
704
|
+
scaleOne: 1300
|
|
705
|
+
scaleZero: 600
|
|
706
|
+
Height:
|
|
707
|
+
value: 780
|
|
708
|
+
scaleOne: 780
|
|
709
|
+
scaleZero: 740
|
|
710
|
+
|
|
711
|
+
transformers:
|
|
712
|
+
- name: tree-trunk-delivery
|
|
713
|
+
```
|
|
714
|
+
|
|
715
|
+
### ./src/\_shared/EdgeFinishCards.tsx
|
|
716
|
+
|
|
717
|
+
```tsx
|
|
718
|
+
import { Box, ButtonBase, type SxProps, type Theme, Typography } from '@mui/material'
|
|
719
|
+
import type { KeyboardEvent } from 'react'
|
|
720
|
+
|
|
721
|
+
import { type UseAttributeSelection, useResolveLocalizable } from '@salsita-ai/sdk/react'
|
|
722
|
+
|
|
723
|
+
// Cross-sections of the tabletop's edge, keyed by the option values of the spec.
|
|
724
|
+
const EDGE_PROFILES: Readonly<Record<string, string>> = {
|
|
725
|
+
None: 'M0 4H32V20H0Z',
|
|
726
|
+
Facet: 'M0 4H26L32 10V14L26 20H0Z',
|
|
727
|
+
Round: 'M0 4H24A8 8 0 0 1 24 20H0Z',
|
|
728
|
+
TreeTrunk: 'M0 4H27C33 5 28 9 34 11C29 13 34 17 27 20H0Z',
|
|
729
|
+
}
|
|
730
|
+
|
|
731
|
+
const CHECK_BADGE: SxProps<Theme> = {
|
|
732
|
+
position: 'absolute',
|
|
733
|
+
insetBlockStart: 10,
|
|
734
|
+
insetInlineEnd: 10,
|
|
735
|
+
display: 'grid',
|
|
736
|
+
placeItems: 'center',
|
|
737
|
+
inlineSize: 22,
|
|
738
|
+
blockSize: 22,
|
|
739
|
+
borderRadius: '50%',
|
|
740
|
+
bgcolor: 'primary.main',
|
|
741
|
+
color: 'primary.contrastText',
|
|
742
|
+
fontSize: 13,
|
|
743
|
+
}
|
|
744
|
+
|
|
745
|
+
// Arrow keys move the selection between the cards, as in a native radio group.
|
|
746
|
+
const ARROW_STEPS: Readonly<Record<string, number | undefined>> = {
|
|
747
|
+
ArrowRight: 1,
|
|
748
|
+
ArrowDown: 1,
|
|
749
|
+
ArrowLeft: -1,
|
|
750
|
+
ArrowUp: -1,
|
|
751
|
+
}
|
|
752
|
+
|
|
753
|
+
interface EdgeFinishCardsProps {
|
|
754
|
+
readonly selection: ReturnType<UseAttributeSelection>
|
|
755
|
+
}
|
|
756
|
+
|
|
757
|
+
export const EdgeFinishCards = ({ selection }: EdgeFinishCardsProps) => {
|
|
758
|
+
const resolve = useResolveLocalizable()
|
|
759
|
+
const { options } = selection
|
|
760
|
+
// The card in the tab order: the selected one, or the first enabled one. Disabled cards are never in it.
|
|
761
|
+
const selectedIndex = options.findIndex(option => option.value === selection.value && !option.disabled)
|
|
762
|
+
const focusIndex = selectedIndex >= 0 ? selectedIndex : options.findIndex(option => !option.disabled)
|
|
763
|
+
|
|
764
|
+
const handleKeyDown = (event: KeyboardEvent<HTMLElement>, index: number) => {
|
|
765
|
+
const step = ARROW_STEPS[event.key]
|
|
766
|
+
|
|
767
|
+
if (step === undefined) {
|
|
768
|
+
return
|
|
769
|
+
}
|
|
770
|
+
|
|
771
|
+
event.preventDefault()
|
|
772
|
+
// The next enabled option in the arrow's direction, wrapping around; disabled options are skipped.
|
|
773
|
+
const count = options.length
|
|
774
|
+
const next = Array.from(
|
|
775
|
+
{ length: count - 1 },
|
|
776
|
+
(_, offset) => (((index + step * (offset + 1)) % count) + count) % count
|
|
777
|
+
).find(candidate => !options[candidate]?.disabled)
|
|
778
|
+
|
|
779
|
+
if (next === undefined) {
|
|
780
|
+
return
|
|
781
|
+
}
|
|
782
|
+
|
|
783
|
+
options[next]?.onSelect()
|
|
784
|
+
event.currentTarget.parentElement?.querySelectorAll<HTMLElement>('[role="radio"]')[next]?.focus()
|
|
785
|
+
}
|
|
786
|
+
|
|
787
|
+
return (
|
|
788
|
+
<Box
|
|
789
|
+
component="div"
|
|
790
|
+
role="radiogroup"
|
|
791
|
+
aria-label="Edge finish"
|
|
792
|
+
sx={{ display: 'grid', gridTemplateColumns: '1fr 1fr', gap: 1.5 }}
|
|
793
|
+
>
|
|
794
|
+
{options.map((option, index) => {
|
|
795
|
+
const isSelected = option.value === selection.value
|
|
796
|
+
|
|
797
|
+
return (
|
|
798
|
+
<ButtonBase
|
|
799
|
+
key={String(option.value)}
|
|
800
|
+
role="radio"
|
|
801
|
+
aria-checked={isSelected}
|
|
802
|
+
tabIndex={index === focusIndex ? 0 : -1}
|
|
803
|
+
disabled={option.disabled}
|
|
804
|
+
onClick={option.onSelect}
|
|
805
|
+
onKeyDown={event => handleKeyDown(event, index)}
|
|
806
|
+
sx={{
|
|
807
|
+
position: 'relative',
|
|
808
|
+
display: 'grid',
|
|
809
|
+
justifyItems: 'start',
|
|
810
|
+
gap: 0.5,
|
|
811
|
+
padding: 2,
|
|
812
|
+
borderRadius: 3,
|
|
813
|
+
border: 2,
|
|
814
|
+
borderColor: isSelected ? 'primary.main' : 'divider',
|
|
815
|
+
bgcolor: isSelected ? 'action.hover' : 'transparent',
|
|
816
|
+
textAlign: 'start',
|
|
817
|
+
transition: 'border-color 150ms, background-color 150ms',
|
|
818
|
+
'&:hover': { borderColor: isSelected ? 'primary.main' : 'text.disabled' },
|
|
819
|
+
'&.Mui-focusVisible': { outline: 2, outlineColor: 'primary.main', outlineOffset: 2 },
|
|
820
|
+
'&.Mui-disabled': { opacity: 0.4 },
|
|
821
|
+
}}
|
|
822
|
+
>
|
|
823
|
+
{isSelected && (
|
|
824
|
+
<Box component="span" aria-hidden sx={CHECK_BADGE}>
|
|
825
|
+
✓
|
|
826
|
+
</Box>
|
|
827
|
+
)}
|
|
828
|
+
<Box
|
|
829
|
+
component="svg"
|
|
830
|
+
viewBox="0 0 36 24"
|
|
831
|
+
aria-hidden
|
|
832
|
+
sx={{ inlineSize: 60, blockSize: 40, color: '#b98b5e' }}
|
|
833
|
+
>
|
|
834
|
+
<path d={EDGE_PROFILES[String(option.value)]} fill="currentColor" />
|
|
835
|
+
</Box>
|
|
836
|
+
<Typography variant="body2" fontWeight={600}>
|
|
837
|
+
{resolve(option.title)}
|
|
838
|
+
</Typography>
|
|
839
|
+
<Typography variant="caption" color="text.secondary">
|
|
840
|
+
{resolve(option.description)}
|
|
841
|
+
</Typography>
|
|
842
|
+
</ButtonBase>
|
|
843
|
+
)
|
|
844
|
+
})}
|
|
845
|
+
</Box>
|
|
846
|
+
)
|
|
847
|
+
}
|
|
848
|
+
```
|
|
849
|
+
|
|
850
|
+
### ./src/\_shared/FullscreenToggle.tsx
|
|
851
|
+
|
|
852
|
+
```tsx
|
|
853
|
+
import { Button } from '@mui/material'
|
|
854
|
+
|
|
855
|
+
import { phx } from '../../.phoenix/phx.js'
|
|
856
|
+
|
|
857
|
+
const ENTER_ICON = 'M4 9V4h5M15 4h5v5M20 15v5h-5M9 20H4v-5'
|
|
858
|
+
const EXIT_ICON = 'M9 4v5H4M15 4v5h5M15 20v-5h5M9 20v-5H4'
|
|
859
|
+
|
|
860
|
+
export const FullscreenToggle = () => {
|
|
861
|
+
const isFullscreen = phx.frontend.useIsFullscreenActive()
|
|
862
|
+
const setFullscreen = phx.frontend.useSetFullscreen()
|
|
863
|
+
|
|
864
|
+
return (
|
|
865
|
+
<Button
|
|
866
|
+
onClick={() => setFullscreen(!isFullscreen)}
|
|
867
|
+
startIcon={
|
|
868
|
+
<svg viewBox="0 0 24 24" width={20} height={20} fill="none" stroke="currentColor" strokeWidth={2}>
|
|
869
|
+
<path d={isFullscreen ? EXIT_ICON : ENTER_ICON} />
|
|
870
|
+
</svg>
|
|
871
|
+
}
|
|
872
|
+
sx={{
|
|
873
|
+
minBlockSize: 44,
|
|
874
|
+
paddingInline: 2.5,
|
|
875
|
+
borderRadius: 999,
|
|
876
|
+
bgcolor: 'background.paper',
|
|
877
|
+
color: 'text.primary',
|
|
878
|
+
boxShadow: '0 4px 16px rgba(0, 0, 0, 0.12)',
|
|
879
|
+
textTransform: 'none',
|
|
880
|
+
fontWeight: 600,
|
|
881
|
+
'&:hover': { bgcolor: 'background.paper', boxShadow: '0 6px 20px rgba(0, 0, 0, 0.18)' },
|
|
882
|
+
}}
|
|
883
|
+
>
|
|
884
|
+
{isFullscreen ? 'Exit fullscreen' : 'Fullscreen'}
|
|
885
|
+
</Button>
|
|
886
|
+
)
|
|
887
|
+
}
|
|
888
|
+
```
|
|
889
|
+
|
|
890
|
+
### ./src/\_shared/MessageToast.tsx
|
|
891
|
+
|
|
892
|
+
```tsx
|
|
893
|
+
import { Alert } from '@mui/material'
|
|
894
|
+
import { useEffect, useState } from 'react'
|
|
895
|
+
|
|
896
|
+
import type { ConfiguratorMessage } from '@salsita-ai/sdk/react'
|
|
897
|
+
|
|
898
|
+
import { phx } from '../../.phoenix/phx.js'
|
|
899
|
+
|
|
900
|
+
const VIOLATION_SEVERITY = { fatal: 'error', fixable: 'error', warning: 'warning', notice: 'info' } as const
|
|
901
|
+
const RANK = { info: 0, warning: 1, error: 2 } as const
|
|
902
|
+
const VISIBLE_MS = 6000
|
|
903
|
+
|
|
904
|
+
const severityOf = (message: ConfiguratorMessage) => {
|
|
905
|
+
if (message.kind === 'violation') {
|
|
906
|
+
return VIOLATION_SEVERITY[message.violation.severity]
|
|
907
|
+
}
|
|
908
|
+
|
|
909
|
+
return message.kind === 'error' ? 'error' : 'info'
|
|
910
|
+
}
|
|
911
|
+
|
|
912
|
+
export const MessageToast = () => {
|
|
913
|
+
const [message, setMessage] = useState<ConfiguratorMessage | null>(null)
|
|
914
|
+
|
|
915
|
+
// A rejected change also reports the notices already present; keep the worst message while it is shown
|
|
916
|
+
phx.frontend.useConfiguratorMessages(next => {
|
|
917
|
+
setMessage(shown => (shown !== null && RANK[severityOf(next)] < RANK[severityOf(shown)] ? shown : next))
|
|
918
|
+
})
|
|
919
|
+
|
|
920
|
+
useEffect(() => {
|
|
921
|
+
if (message === null) {
|
|
922
|
+
return
|
|
923
|
+
}
|
|
924
|
+
|
|
925
|
+
const timeout = setTimeout(() => setMessage(null), VISIBLE_MS)
|
|
926
|
+
|
|
927
|
+
return () => clearTimeout(timeout)
|
|
928
|
+
}, [message])
|
|
929
|
+
|
|
930
|
+
if (message === null) {
|
|
931
|
+
return null
|
|
932
|
+
}
|
|
933
|
+
|
|
934
|
+
return (
|
|
935
|
+
<Alert
|
|
936
|
+
severity={severityOf(message)}
|
|
937
|
+
onClose={() => setMessage(null)}
|
|
938
|
+
sx={{ maxInlineSize: 420, borderRadius: 3, boxShadow: '0 12px 40px rgba(0, 0, 0, 0.12)' }}
|
|
939
|
+
>
|
|
940
|
+
{message.text}
|
|
941
|
+
</Alert>
|
|
942
|
+
)
|
|
943
|
+
}
|
|
944
|
+
```
|
|
945
|
+
|
|
946
|
+
### ./src/\_shared/ProductPanel.tsx
|
|
947
|
+
|
|
948
|
+
```tsx
|
|
949
|
+
import { Box, Button, Typography } from '@mui/material'
|
|
950
|
+
|
|
951
|
+
import { detailComponent } from '@salsita-ai/sdk/domain'
|
|
952
|
+
import { useResolveLocalizable } from '@salsita-ai/sdk/react'
|
|
953
|
+
|
|
954
|
+
import { phx } from '../../.phoenix/phx.js'
|
|
955
|
+
import { EdgeFinishCards } from './EdgeFinishCards.js'
|
|
956
|
+
|
|
957
|
+
export const ProductPanel = () => {
|
|
958
|
+
const resolve = useResolveLocalizable()
|
|
959
|
+
const detail = phx.frontend.useFirstRootComponent(detailComponent)
|
|
960
|
+
const price = phx.frontend.useRootEntityPrice()
|
|
961
|
+
const tableId = phx.frontend.useRootEntityId()
|
|
962
|
+
const edgeFinish = phx.frontend.useAttributeSelection(tableId, 'edgeFinish')
|
|
963
|
+
const { accessInfo } = phx.frontend.useAccessService()
|
|
964
|
+
const navigationState = phx.frontend.useActiveNavigationState()
|
|
965
|
+
const pushNavigate = phx.frontend.usePushNavigate()
|
|
966
|
+
const popNavigate = phx.frontend.usePopNavigate()
|
|
967
|
+
|
|
968
|
+
const isReadMode = accessInfo.viewMode
|
|
969
|
+
const isReview = isReadMode || navigationState === 'checkout'
|
|
970
|
+
const chosenEdge = edgeFinish.options.find(option => option.value === edgeFinish.value)
|
|
971
|
+
|
|
972
|
+
return (
|
|
973
|
+
<>
|
|
974
|
+
<Box component="header" sx={{ display: 'grid', gap: 1, padding: 3, paddingBlockEnd: 2 }}>
|
|
975
|
+
{isReadMode ? (
|
|
976
|
+
<Typography
|
|
977
|
+
variant="overline"
|
|
978
|
+
sx={{ justifySelf: 'start', paddingInline: 1.5, borderRadius: 999, bgcolor: 'action.selected' }}
|
|
979
|
+
>
|
|
980
|
+
View only
|
|
981
|
+
</Typography>
|
|
982
|
+
) : (
|
|
983
|
+
<Typography variant="overline" color="text.secondary">
|
|
984
|
+
{resolve(detail?.state.subtitle)}
|
|
985
|
+
</Typography>
|
|
986
|
+
)}
|
|
987
|
+
<Typography variant="h5" component="h2" fontWeight={700}>
|
|
988
|
+
{resolve(detail?.state.title)}
|
|
989
|
+
</Typography>
|
|
990
|
+
<Typography variant="body2" color="text.secondary">
|
|
991
|
+
{resolve(detail?.state.description)}
|
|
992
|
+
</Typography>
|
|
993
|
+
</Box>
|
|
994
|
+
|
|
995
|
+
<Box component="div" sx={{ display: 'grid', gap: 1.5, paddingInline: 3, paddingBlockEnd: 3, overflowY: 'auto' }}>
|
|
996
|
+
<Typography variant="subtitle2" component="h3">
|
|
997
|
+
Edge finish
|
|
998
|
+
</Typography>
|
|
999
|
+
{isReview ? (
|
|
1000
|
+
<Box component="div" sx={{ padding: 2, borderRadius: 3, bgcolor: 'action.hover' }}>
|
|
1001
|
+
<Typography variant="body2" fontWeight={600}>
|
|
1002
|
+
{resolve(chosenEdge?.title)}
|
|
1003
|
+
</Typography>
|
|
1004
|
+
<Typography variant="caption" color="text.secondary">
|
|
1005
|
+
{resolve(chosenEdge?.description)}
|
|
1006
|
+
</Typography>
|
|
1007
|
+
</Box>
|
|
1008
|
+
) : (
|
|
1009
|
+
<EdgeFinishCards selection={edgeFinish} />
|
|
1010
|
+
)}
|
|
1011
|
+
</Box>
|
|
1012
|
+
|
|
1013
|
+
<Box component="footer" sx={{ display: 'grid', gap: 2, padding: 3, borderTop: 1, borderColor: 'divider' }}>
|
|
1014
|
+
<Box component="div" sx={{ display: 'flex', alignItems: 'baseline', justifyContent: 'space-between' }}>
|
|
1015
|
+
<Typography variant="body2" color="text.secondary">
|
|
1016
|
+
Total price
|
|
1017
|
+
</Typography>
|
|
1018
|
+
<Typography variant="h5" component="p" fontWeight={700}>
|
|
1019
|
+
{price}
|
|
1020
|
+
</Typography>
|
|
1021
|
+
</Box>
|
|
1022
|
+
{isReview && !isReadMode && (
|
|
1023
|
+
<Typography variant="body2" color="text.secondary">
|
|
1024
|
+
Your table is ready for a quote. A real shop collects the contact details here.
|
|
1025
|
+
</Typography>
|
|
1026
|
+
)}
|
|
1027
|
+
{!isReadMode && (
|
|
1028
|
+
<Button
|
|
1029
|
+
size="large"
|
|
1030
|
+
variant={isReview ? 'outlined' : 'contained'}
|
|
1031
|
+
onClick={isReview ? popNavigate : () => pushNavigate('checkout')}
|
|
1032
|
+
sx={{ minBlockSize: 48, borderRadius: 999, textTransform: 'none', fontWeight: 600 }}
|
|
1033
|
+
>
|
|
1034
|
+
{isReview ? 'Back to the configuration' : 'Review and request a quote'}
|
|
1035
|
+
</Button>
|
|
1036
|
+
)}
|
|
1037
|
+
</Box>
|
|
1038
|
+
</>
|
|
1039
|
+
)
|
|
1040
|
+
}
|
|
1041
|
+
```
|
|
1042
|
+
|
|
1043
|
+
### ./src/elements/ConfiguratorLayout.tsx
|
|
1044
|
+
|
|
1045
|
+
```tsx
|
|
1046
|
+
import { Box } from '@mui/material'
|
|
1047
|
+
|
|
1048
|
+
import { LayoutSlots, useSceneSafeArea } from '@salsita-ai/sdk/configurator'
|
|
1049
|
+
|
|
1050
|
+
import { phx } from '../../.phoenix/phx.js'
|
|
1051
|
+
import { FullscreenToggle } from '../_shared/FullscreenToggle.js'
|
|
1052
|
+
import { MessageToast } from '../_shared/MessageToast.js'
|
|
1053
|
+
import { ProductPanel } from '../_shared/ProductPanel.js'
|
|
1054
|
+
|
|
1055
|
+
const GUTTER = 24
|
|
1056
|
+
const PANEL_WIDTH = 380
|
|
1057
|
+
|
|
1058
|
+
const ConfiguratorLayout = () => {
|
|
1059
|
+
const { containerRef, safeAreaRef } = useSceneSafeArea()
|
|
1060
|
+
const isFullscreen = phx.frontend.useIsFullscreenActive()
|
|
1061
|
+
|
|
1062
|
+
return (
|
|
1063
|
+
<Box component="div" ref={containerRef} sx={{ position: 'absolute', inset: 0 }}>
|
|
1064
|
+
<LayoutSlots.SharedCanvas />
|
|
1065
|
+
|
|
1066
|
+
{!isFullscreen && (
|
|
1067
|
+
<Box
|
|
1068
|
+
component="aside"
|
|
1069
|
+
sx={{
|
|
1070
|
+
position: 'absolute',
|
|
1071
|
+
insetBlockStart: GUTTER,
|
|
1072
|
+
insetInlineStart: GUTTER,
|
|
1073
|
+
inlineSize: PANEL_WIDTH,
|
|
1074
|
+
maxBlockSize: `calc(100% - ${2 * GUTTER}px)`,
|
|
1075
|
+
display: 'flex',
|
|
1076
|
+
flexDirection: 'column',
|
|
1077
|
+
borderRadius: 5,
|
|
1078
|
+
bgcolor: 'background.paper',
|
|
1079
|
+
boxShadow: '0 12px 40px rgba(0, 0, 0, 0.12)',
|
|
1080
|
+
overflow: 'hidden',
|
|
1081
|
+
}}
|
|
1082
|
+
>
|
|
1083
|
+
<ProductPanel />
|
|
1084
|
+
</Box>
|
|
1085
|
+
)}
|
|
1086
|
+
|
|
1087
|
+
<Box
|
|
1088
|
+
component="div"
|
|
1089
|
+
ref={safeAreaRef}
|
|
1090
|
+
sx={{
|
|
1091
|
+
position: 'absolute',
|
|
1092
|
+
insetBlock: 0,
|
|
1093
|
+
insetInlineStart: isFullscreen ? 0 : PANEL_WIDTH + 2 * GUTTER,
|
|
1094
|
+
insetInlineEnd: 0,
|
|
1095
|
+
pointerEvents: 'none',
|
|
1096
|
+
}}
|
|
1097
|
+
>
|
|
1098
|
+
<Box
|
|
1099
|
+
component="div"
|
|
1100
|
+
sx={{ position: 'absolute', insetBlockStart: GUTTER, insetInlineEnd: GUTTER, pointerEvents: 'auto' }}
|
|
1101
|
+
>
|
|
1102
|
+
<FullscreenToggle />
|
|
1103
|
+
</Box>
|
|
1104
|
+
<Box
|
|
1105
|
+
component="div"
|
|
1106
|
+
sx={{ position: 'absolute', insetBlockEnd: GUTTER, insetInlineStart: GUTTER, pointerEvents: 'auto' }}
|
|
1107
|
+
>
|
|
1108
|
+
<MessageToast />
|
|
1109
|
+
</Box>
|
|
1110
|
+
</Box>
|
|
1111
|
+
</Box>
|
|
1112
|
+
)
|
|
1113
|
+
}
|
|
1114
|
+
|
|
1115
|
+
export default phx.frontend.createCustomPhoenixLayoutElement('ConfiguratorLayout', ConfiguratorLayout)
|
|
1116
|
+
```
|
|
1117
|
+
|
|
1118
|
+
### ./src/expressions/table.ts
|
|
1119
|
+
|
|
1120
|
+
```ts
|
|
1121
|
+
import { phx } from '../../.phoenix/phx.js'
|
|
1122
|
+
|
|
1123
|
+
const EDGE_FINISH_SURCHARGE = { None: 0, Facet: 90, Round: 120, TreeTrunk: 340 }
|
|
1124
|
+
|
|
1125
|
+
export default phx.domain.implementCustomExpressions({
|
|
1126
|
+
Table: {
|
|
1127
|
+
$price: s => {
|
|
1128
|
+
return 1290 + EDGE_FINISH_SURCHARGE[s.edgeFinish]
|
|
1129
|
+
},
|
|
1130
|
+
$edgeFinishFacet: s => {
|
|
1131
|
+
return s.edgeFinish === 'Facet' ? 1 : 0
|
|
1132
|
+
},
|
|
1133
|
+
$edgeFinishRound: s => {
|
|
1134
|
+
return s.edgeFinish === 'Round' ? 1 : 0
|
|
1135
|
+
},
|
|
1136
|
+
$edgeFinishTreeTrunk: s => {
|
|
1137
|
+
return s.edgeFinish === 'TreeTrunk' ? 1 : 0
|
|
1138
|
+
},
|
|
1139
|
+
},
|
|
1140
|
+
})
|
|
1141
|
+
```
|
|
1142
|
+
|
|
1143
|
+
### ./src/transformers/tree-trunk-delivery.ts
|
|
1144
|
+
|
|
1145
|
+
```ts
|
|
1146
|
+
import { msg } from '@lingui/core/macro'
|
|
1147
|
+
|
|
1148
|
+
import { phx } from '../../.phoenix/phx.js'
|
|
1149
|
+
|
|
1150
|
+
// A tree-trunk edge is cut by hand; choosing it carries a hint, which reaches the layout as a side-effect message
|
|
1151
|
+
export default phx.frontend.transformerBuilder.when
|
|
1152
|
+
.entity(['Table'])
|
|
1153
|
+
.modified({ atFields: ['edgeFinish'] })
|
|
1154
|
+
.then.overrideMatchingUpdate(({ update }) => {
|
|
1155
|
+
if (update.stateDelta.edgeFinish !== 'TreeTrunk') {
|
|
1156
|
+
return [update]
|
|
1157
|
+
}
|
|
1158
|
+
|
|
1159
|
+
return [{ ...update, hint: msg`Tree trunk edges are cut by hand, so delivery takes three weeks longer.` }]
|
|
1160
|
+
})
|
|
1161
|
+
.build('tree-trunk-delivery')
|
|
1162
|
+
```
|
|
1163
|
+
|
|
1164
|
+
</details>
|