@salsita-ai/sdk 0.50.0-develop.abef6d86a1 → 0.50.0-develop.ae9a830ef0
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 +2 -2
- 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 +7 -0
- 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 +48 -48
- 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 -1
- 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-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 +5 -2
- package/dist/application-spec/generate-application/code/templates/skills/sdk-content.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/phoenix-api.d.ts +96 -0
- 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 +3 -1
- 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/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/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/AssistantMarkdown.d.ts +1 -1
- package/dist/configurator/ui/assistant/AssistantMarkdown.js +1 -1
- 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/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/domain-model.mdx +4 -0
- package/dist/docs/phoenix/finalization.mdx +1 -1
- package/dist/docs/phoenix/layout-slots.mdx +114 -0
- package/dist/docs/phoenix/phoenix-cli.mdx +24 -27
- package/dist/docs/phoenix/project-structure.mdx +14 -9
- package/dist/docs/phoenix/quickstart.mdx +2 -2
- package/dist/docs/phoenix/sdk-builder-workflow.mdx +2 -2
- 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/domain/admin-domain/implementation/common-admin-expressions.d.ts +26 -11
- package/dist/domain/admin-domain/implementation/common-admin-publish.d.ts +1 -2
- package/dist/domain/admin-domain/index.js +1 -1
- package/dist/domain/application/GetApplicationWrapperHandler.d.ts +1 -1
- package/dist/domain/application/application-config.d.ts +4 -2
- 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 +9 -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/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.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/configurator-builder.d.ts +1 -1
- package/dist/domain/application/configurator-builder.js +1 -1
- package/dist/domain/application/create-initial-published-data.d.ts +5 -5
- package/dist/domain/application/index.d.ts +0 -1
- package/dist/domain/application/index.js +1 -1
- package/dist/domain/application/published-data/map-published-chunked-data.d.ts +1 -1
- package/dist/domain/application/published-data/map-published-data.d.ts +7 -3
- package/dist/domain/core/component/domain-component-optic.d.ts +11 -19
- package/dist/domain/core/component/domain-component-optic.js +2 -2
- package/dist/domain/core/component/legacy-filter.d.ts +2 -17
- package/dist/domain/core/component/system-component-filter.d.ts +36 -18
- package/dist/domain/core/expression/constant-expressions.d.ts +16 -8
- package/dist/domain/core/expression/custom-expression.d.ts +16 -3
- package/dist/domain/core/invariant/custom-invariants.d.ts +6 -14
- package/dist/domain/core/invariant/invariants.d.ts +1 -4
- package/dist/domain/core/invariant/violation.d.ts +50 -2
- package/dist/domain/core/invariant/violation.js +1 -1
- package/dist/domain/core/model/model.d.ts +1 -1
- package/dist/domain/core/recipe/recipes.d.ts +18 -50
- package/dist/domain/core/recipe/recipes.js +1 -1
- package/dist/domain/core/relation/all-of-type-relation.d.ts +8 -21
- package/dist/domain/core/relation/all-of-type-relation.js +1 -1
- package/dist/domain/core/relation/direct-relation.d.ts +13 -24
- package/dist/domain/core/relation/index.d.ts +0 -1
- package/dist/domain/core/relation/indirect-relation.d.ts +12 -67
- package/dist/domain/core/relation/indirect-relation.js +1 -1
- package/dist/domain/core/relation/relation-factory.d.ts +19 -15
- package/dist/domain/core/relation/relation-factory.js +1 -1
- package/dist/domain/core/state/migrations.d.ts +14 -45
- package/dist/domain/core/state/migrations.js +1 -1
- package/dist/domain/core/state/state.d.ts +1 -1
- package/dist/domain/domain-builder.js +1 -1
- package/dist/domain/domain-runtime/access/selectors.d.ts +9 -0
- package/dist/domain/domain-runtime/access/selectors.js +1 -1
- package/dist/domain/domain-runtime/access/types.d.ts +2 -0
- package/dist/domain/domain-runtime/access/types.js +1 -1
- package/dist/domain/domain-runtime/domain-context/selectors.d.ts +14 -13
- 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 +32 -16
- 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 +1 -1
- package/dist/domain/domain-runtime/spec/index.js +1 -1
- package/dist/domain/domain-runtime/spec/initialize.d.ts +11 -0
- package/dist/domain/domain-runtime/spec/initialize.js +1 -1
- package/dist/domain/domain-runtime/spec/module-checks/index.d.ts +1 -1
- package/dist/domain/domain-runtime/spec/module-checks/project-modules.d.ts +8 -1
- package/dist/domain/domain-runtime/spec/module-checks/project-modules.js +1 -1
- package/dist/domain/domain-runtime/spec/module-checks/resolve-action-modules.js +1 -1
- package/dist/domain/domain-runtime/spec/module-checks/resolve-expression-modules.js +1 -1
- package/dist/domain/domain-runtime/spec/module-checks/resolve-imported-transformers.d.ts +7 -7
- package/dist/domain/domain-runtime/spec/module-checks/resolve-imported-transformers.js +1 -1
- package/dist/domain/domain-runtime/spec/module-checks/resolve-invariant-modules.d.ts +2 -2
- package/dist/domain/domain-runtime/spec/module-checks/resolve-invariant-modules.js +1 -1
- package/dist/domain/extensions/attribute-switch.d.ts +1 -1
- package/dist/domain/extensions/attribute-switch.js +1 -1
- package/dist/domain/extensions/canvas-config.d.ts +1 -1
- package/dist/domain/extensions/client-side-image.d.ts +2 -2
- package/dist/domain/extensions/client-side-image.js +1 -1
- package/dist/domain/extensions/common/angle-indicator-schema.d.ts +2 -2
- package/dist/domain/extensions/common/dimension-indicator-schema.d.ts +2 -2
- package/dist/domain/extensions/editable-angle-indicator.d.ts +1 -1
- package/dist/domain/extensions/editable-distance-dimension-indicator.d.ts +1 -1
- package/dist/domain/extensions/editable-offset-indicator.d.ts +1 -1
- package/dist/domain/extensions/editable-offset-indicator.js +1 -1
- package/dist/domain/extensions/fit-selection-orthographic-camera-component.js +1 -1
- package/dist/domain/extensions/fit-selection-perspective-camera-component.js +1 -1
- package/dist/domain/extensions/horizontal-tabs.d.ts +2 -2
- package/dist/domain/extensions/list-selector-dimension-indicator.d.ts +1 -1
- package/dist/domain/extensions/navigation-steps.d.ts +2 -2
- package/dist/domain/extensions/offset-indicator.js +1 -1
- package/dist/domain/extensions/rotation-handle.d.ts +2 -2
- package/dist/domain/extensions/save-template-thumbnail.d.ts +2 -2
- package/dist/domain/extensions/save-template-thumbnail.js +1 -1
- package/dist/domain/extensions/scene-entity-animation.js +1 -1
- package/dist/domain/mocks/create-mock-domain-context.d.ts +1 -1
- package/dist/domain/mocks/create-mock-domain-runtime.d.ts +18 -9
- 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/camera.d.ts +1 -1
- package/dist/domain/system-components/application-config.d.ts +2 -2
- package/dist/domain/system-components/child-entity-selection.js +1 -1
- package/dist/domain/system-components/collision-box-geometry.d.ts +4 -2
- package/dist/domain/system-components/collision-geometry.d.ts +4 -2
- package/dist/domain/system-components/collision-point-geometry.d.ts +4 -2
- package/dist/domain/system-components/common/material-override-schema.d.ts +2 -2
- package/dist/domain/system-components/common/recipes.d.ts +21 -3
- package/dist/domain/system-components/common/recipes.js +1 -1
- package/dist/domain/system-components/constraint.d.ts +10 -23
- 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/hotspot-drag-handle.d.ts +1 -1
- package/dist/domain/system-components/hotspot-drag-handle.js +1 -1
- package/dist/domain/system-components/material-swatch.js +1 -1
- package/dist/domain/system-components/scene-entity-material-override.d.ts +1 -1
- package/dist/domain/system-components/scene-entity-object-material-override.d.ts +1 -1
- package/dist/domain/system-components/scene-entity-object-text-decal.d.ts +1 -1
- package/dist/domain/system-components/scene-entity-object-transimissive-material-override.d.ts +1 -1
- package/dist/domain/system-components/scene-entity-transimissive-material-override.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.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/editor/domain-editors/use-implementation-files.d.ts +1 -2
- package/dist/editor/mocks/EditorMockContext.js +1 -1
- package/dist/legacy/domain-cli/gen/configurator-builder.js +13 -12
- package/dist/legacy/domain-cli/gen/constant-expressions.js +1 -1
- package/dist/legacy/domain-cli/gen/defaults.js +1 -7
- package/dist/legacy/domain-cli/gen/invariants.js +3 -4
- 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/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/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 +33 -16
- 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 +4 -4
- 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/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/prettier-ignore.d.ts +0 -1
- package/dist/application-spec/generate-application/code/templates/prettier-ignore.js +0 -6
- package/dist/domain/application/resource-builder.d.ts +0 -13
- package/dist/domain/application/resource-builder.js +0 -1
- package/dist/domain/core/relation/relation-implementation.d.ts +0 -7
- package/dist/domain/domain-runtime/spec/invariant-builder.d.ts +0 -26
- package/dist/domain/domain-runtime/spec/invariant-builder.js +0 -1
- /package/dist/{domain/core/relation/relation-implementation.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
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
# Layout Slots
|
|
2
|
+
|
|
3
|
+
A project layout registered as `ConfiguratorLayout` builds its UI from its own components and from the pieces of the built-in layout it wants to keep. Those pieces are the members of `LayoutSlots`, from `@salsita-ai/sdk/configurator`. This page lists every member: what it shows, what in the spec or the configurator's state feeds it, what it renders when the spec configures nothing for it, and what it does in read mode. [Configurator Interface → Loaded Configuration UI](?path=/docs/phoenix-configurator-interface--docs#loaded-configuration-ui) says what a project layout has to mount, and its [Hooks for a Project Layout](?path=/docs/phoenix-configurator-interface--docs#hooks-for-a-project-layout) list the hooks for a layout that draws its own UI.
|
|
4
|
+
|
|
5
|
+
- [How the slots behave](#how-the-slots-behave)
|
|
6
|
+
- [Canvas and services](#canvas-and-services)
|
|
7
|
+
- [Desktop sidebar](#desktop-sidebar)
|
|
8
|
+
- [Header, toolbar and controls](#header-toolbar-and-controls)
|
|
9
|
+
- [Banners and branding](#banners-and-branding)
|
|
10
|
+
- [Page footer](#page-footer)
|
|
11
|
+
- [Phone layout](#phone-layout)
|
|
12
|
+
- [Others](#others)
|
|
13
|
+
|
|
14
|
+
## How the slots behave
|
|
15
|
+
|
|
16
|
+
```tsx
|
|
17
|
+
import { LayoutSlots } from '@salsita-ai/sdk/configurator'
|
|
18
|
+
|
|
19
|
+
// Part of a ConfiguratorLayout: the built-in toolbar, placed by the layout in the bottom right corner
|
|
20
|
+
export const Toolbar = () => (
|
|
21
|
+
<div style={{ position: 'absolute', insetBlockEnd: 24, insetInlineEnd: 24 }}>
|
|
22
|
+
<LayoutSlots.DesktopToolbar />
|
|
23
|
+
</div>
|
|
24
|
+
)
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
- A slot takes no props unless its row names them, and reads what it shows from the spec and the configurator's state. It renders inside the configurator only, under a `ConfiguratorLayout`.
|
|
28
|
+
- A slot brings its own look but not its place: it adds no padding or scrolling around itself, so the layout puts it in a container. Two members differ: `SharedCanvas` fills its nearest positioned ancestor, and `DesktopSidebar` brings the sidebar's spacing and scrolling with it.
|
|
29
|
+
- Read mode means `useAccessService().accessInfo.viewMode` is `true`: a configuration shared for viewing is open, or the host sets the `readonly` property. "No change" in the read-mode column means the slot renders the same for a viewer, so the layout decides whether a viewer sees it.
|
|
30
|
+
- `Desktop*` and `Mobile*` members are twins that differ in size and arrangement; [Phone layout](#phone-layout) lists the phone ones. The container's width, not the window's, decides which one fits: `useActiveViewports()` from `@salsita-ai/sdk/react` returns the breakpoints the container satisfies.
|
|
31
|
+
|
|
32
|
+
## Canvas and services
|
|
33
|
+
|
|
34
|
+
| Member | Shows | Fed by | With nothing configured | Read mode |
|
|
35
|
+
| ---------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------- | ----------------------- | --------- |
|
|
36
|
+
| `SharedCanvas` | The 3D scene, in a container that is `position: absolute; inset: 0` with the scene's background colour. The scene is hidden for a moment while the preview expands or collapses. | The scene of the spec, through `Canvas` | Always renders | No change |
|
|
37
|
+
| `Canvas` | The WebGL canvas alone, or `GPUIssuePage` when the browser has no WebGL or no GPU acceleration. It reports the scene-assets loading phase the app loader waits for. | The scene, the canvas settings and the `CanvasLoader` element | Always renders | No change |
|
|
38
|
+
| `Services` | Nothing visible: it mounts `InvariantViolations` and `SideEffects`, which show the messages of `useConfiguratorMessages()` as snackbars | The configurator's state | Always mounted | No change |
|
|
39
|
+
| `InvariantViolations` | When a change is rejected, a snackbar for each violation of the rejected state, including notices and warnings already present, as `<entity id>: <message>` (a `notice` as info, a `warning` as warning, `fixable` and `fatal` as error), and "Oops, something went wrong" for an error thrown while the state was validated | The spec's invariants | Nothing | No change |
|
|
40
|
+
| `SideEffects` | An info snackbar for each committed update that carries a hint | The hints of committed updates | Nothing | No change |
|
|
41
|
+
| `DesktopSnackbarsRoot` | The element the snackbars are rendered into: a stack anchored to its bottom edge, at most 320 pixels wide | Every snackbar the configurator raises | An empty element | No change |
|
|
42
|
+
|
|
43
|
+
- Mount `SharedCanvas`, not `Canvas`: `Canvas` suspends while it probes the GPU on its first mount, and `SharedCanvas` holds the boundary that catches it. Without either, the app loader stays on screen unless the project sets `appLoader: legacy`.
|
|
44
|
+
- `SharedCanvas` fills its nearest positioned ancestor and paints an opaque background, so the layout positions its own UI after it in the markup.
|
|
45
|
+
- Snackbars are raised by `Services`, and also by the built-in finalize and footer actions when their handler fails and when saving the configuration fails. A layout that shows violations, side-effect hints and validation errors its own way calls `phx.frontend.useConfiguratorMessages(onMessage)` instead of mounting `Services`, see [Configurator Interface → Hooks for a Project Layout](?path=/docs/phoenix-configurator-interface--docs#hooks-for-a-project-layout); the other snackbars still need a root. They render into the snackbar root the layout mounts; with no root mounted they render into the page's `document.body`, outside the configurator. The desktop root is a zero-height element the snackbars stack upwards from, so the layout places it where their bottom edge belongs. The phone root leaves them fixed to the viewport, see `MobileSnackbarsRoot`.
|
|
46
|
+
|
|
47
|
+
## Desktop sidebar
|
|
48
|
+
|
|
49
|
+
| Member | Shows | Fed by | With nothing configured | Read mode |
|
|
50
|
+
| ----------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
51
|
+
| `DesktopSidebar` | The whole built-in desktop sidebar: tabs, back button, property pages and sidebar footer with their spacing, scrolling and empty states, and the assistant panel. Props: `width`, and `side` (`'start'` or `'end'`, typed `DesktopSidebarSide`; `DesktopSidebarProps` types both) | The members below | As its parts | As its parts. In fullscreen it stays in place, transparent and inert |
|
|
52
|
+
| `DesktopSidebarTabs` | Tabs that switch the navigation state | The `sidebarTabs` components of the selected entity; the `horizontalTabs` component is not shown here | Nothing; also nothing while the summary is shown | No change |
|
|
53
|
+
| `useSidebarTabs()` | A hook, `{ tabs, activeTab, onChange }`: each tab is `{ label, icon, value, isActive }`, `activeTab` is the active tab's value or `'none'`, and `onChange(value)` switches to that tab's first navigation state | As `DesktopSidebarTabs` | `tabs` is empty | No change |
|
|
54
|
+
| `DesktopSidebarBackButton` | A "Back" button. Props: the MUI `Button` props and `icon`, also settable in the theme as `PhxDesktopSidebarBackButton`; the application config's `sidebarBackIcon` takes precedence over both | The sidebar's way back: a navigation state to pop, a stacked property page, or a selected entity other than the root, unless the application config sets `showSelectionBackButton` to `false` or sets `ignoreSelectionInSidebar` | Nothing while there is no way back | No change |
|
|
55
|
+
| `DesktopSidebarContent` | The property pages of the selected entity with its entity header, a stacked page opened from them, or the summary page while the summary is shown. With the application config's `ignoreSelectionInSidebar` set, every `propertyPage` of every entity shows under the root, whatever is selected | `propertyPage`, `entityHeader`, `simpleSummary` and `customSummaryPage` components, and `ignoreSelectionInSidebar` | Nothing | **No change: the controls stay editable.** Limit them with `$filter.modes`, or render something else in read mode |
|
|
56
|
+
| `useSidebarContent(options?)` | A hook, `{ content, goBack, hasMiniSidebar, hasSplitSidebar }`: `content` is what `DesktopSidebarContent` shows, `goBack` is the back action or `null`. `options` sets the `HeaderContainer` and `BodyContainer` components the content is wrapped in | As `DesktopSidebarContent` | `content` is empty | No change |
|
|
57
|
+
| `EntityHeader` | An entity's title, subtitle, description and thumbnail, with its primary and secondary buttons, such as delete or replace. Props, typed `EntityHeaderProps`: `entityId` and `headerComponent` | The texts and thumbnail from the entity's `detail` component (the title falls back to the entity type); the buttons from the `entityHeader` component passed in | — | No change |
|
|
58
|
+
| `DesktopSidebarFooter` | The price and the actions | `basicSidebarFooter`, `universalSidebarFooter`, `readSidebarFooter`, `hiddenSidebarFooter` or `customSidebarFooter`. The basic footer offers a `finalizeButton`, else a button for a `finalizePage`, else a disabled button; the universal footer offers the `finalizeAction` and `otherAction` components | The basic footer: the price and a finalize button. With a `navigationSteps` component of two or more steps, previous and next step buttons and the finalize button only on the last step; with a summary and no steps, a **Summary** button until the summary is shown; in a preset embed, **Save Template** instead of finalize | With nothing configured, the read footer: price only. The basic footer hides its buttons. **The universal footer still shows its finalize and other actions to a viewer**; limit them with `$filter.modes` |
|
|
59
|
+
|
|
60
|
+
A sidebar footer with `universalSidebarFooter` does not check read mode, although the component's own description says its buttons are hidden then. A viewer of a shared configuration sees its actions. The `custom` footer renders its children unchanged as well.
|
|
61
|
+
|
|
62
|
+
## Header, toolbar and controls
|
|
63
|
+
|
|
64
|
+
| Member | Shows | Fed by | With nothing configured | Read mode |
|
|
65
|
+
| --------------------- | ---------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- |
|
|
66
|
+
| `DesktopHeader` | The floating, fixed or custom header | The first `floatingHeader`, `fixedHeader`, `hiddenHeader` or `customHeader` component | The floating header. Nothing with `hiddenHeader` or in fullscreen | The floating header shows the back button instead of the step navigation; the fixed header hides its horizontal tabs |
|
|
67
|
+
| `DesktopToolbar` | The toolbar's button groups | The `toolbar` component's `desktop` list, or else a default set | Default buttons: fullscreen and camera reset; language with more than one locale; share unless sharing is disabled; measurements with more than one dimension or with `indicatorSwitch` on (the default), and help in that group when the project registers a `ToolbarHelp` element; undo and redo; the assistant when the spec has an `assistant` section. In fullscreen, only the exit button | The default set drops share and undo/redo; a configured `toolbar` is shown unchanged |
|
|
68
|
+
| `DesktopViewControls` | A toggle between view states | The root entity's `viewControls` component and the active view state | Nothing without the component or without an active view state | No change |
|
|
69
|
+
| `DesktopToolControls` | A vertical group of tool buttons that switch the tool state | The root entity's `toolControls` component | Nothing without the component | No change |
|
|
70
|
+
| `ToolControls` | The same component as `DesktopToolControls` and `MobileToolControls` | As `DesktopToolControls` | Nothing without the component | No change |
|
|
71
|
+
| `DesktopCallToAction` | **The button that leaves a tool mode, not the finalize button.** Clicking it switches to the component's `exitTo` tool state | An `exitToolModeFab` component, usually filtered to the tool states it belongs to | Nothing. It throws when more than one is active | Nothing |
|
|
72
|
+
|
|
73
|
+
## Banners and branding
|
|
74
|
+
|
|
75
|
+
| Member | Shows | Fed by | With nothing configured | Read mode |
|
|
76
|
+
| -------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- |
|
|
77
|
+
| `DesktopReadonlyBanner` | "You're viewing a read-only configuration" with an **Edit configuration** button that opens `CloneToEditDialog`. Props: the MUI `Alert` props and `icon`, also settable in the theme as `PhxDesktopReadonlyBanner` | `useIsCloningAllowed()`; its icon from the application config's `readonlyBannerIcon` | Nothing unless cloning is allowed | **It does not check read mode.** The layout renders it only in read mode, as the built-in layout does while not in fullscreen |
|
|
78
|
+
| `MobileReadonlyBanner` | An **Edit** button that opens `CloneToEditDialog`. Props: the MUI `Button` props and `icon`, also settable in the theme as `PhxMobileReadonlyBanner` | As `DesktopReadonlyBanner` | Nothing unless cloning is allowed | As `DesktopReadonlyBanner` |
|
|
79
|
+
| `CloneToEditDialog` | The "Edit configuration" dialog that creates an editable copy of the configuration and opens it. Props, typed `CloneToEditDialogProps`: `open` and `onClose` | The open configuration | — | — |
|
|
80
|
+
| `useIsCloningAllowed()` | A hook, `boolean`: `true` when the application config sets `shareCloneToEdit` and the session's role may create configurations | The application config and the session | `false` | Does not check read mode |
|
|
81
|
+
| `DesktopPoweredBy` / `MobilePoweredBy` | The "Powered by Salsita" mark, a link | Its props `visible`, `variant` (`'black'` or `'white'`), `href`, `title`, `slots` and `slotProps`. All but `href` and `title` are also settable in the theme as `PhxDesktopBrandingPoweredBy` / `PhxMobileBrandingPoweredBy` | The mark | No change |
|
|
82
|
+
|
|
83
|
+
## Page footer
|
|
84
|
+
|
|
85
|
+
| Member | Shows | Fed by | With nothing configured | Read mode |
|
|
86
|
+
| -------------------------------- | ------------------------------------------------------- | --------------------------------------------------------------------------------------- | ----------------------- | --------- |
|
|
87
|
+
| `DesktopFooter` / `MobileFooter` | A footer below the whole layout, not the sidebar footer | The project's `LayoutFooter` element, registered with `phx.frontend.createLayoutFooter` | Nothing | No change |
|
|
88
|
+
|
|
89
|
+
## Phone layout
|
|
90
|
+
|
|
91
|
+
The phone twins read the same spec as their desktop members.
|
|
92
|
+
|
|
93
|
+
| Member | Shows | Differences from the desktop member |
|
|
94
|
+
| ------------------------- | ------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
95
|
+
| `MobileHeader` | The header | The floating and fixed headers show a back button and the branding; the back button is hidden with steps and in read mode |
|
|
96
|
+
| `MobileToolbar` | The toolbar | Reads the `toolbar` component's `mobile` list, rendered in reverse order. The default set has undo and redo, camera reset, fullscreen and the assistant, and drops undo and redo in read mode |
|
|
97
|
+
| `MobileHamburgerMenu` | A menu button that opens the remaining actions in a dialog | Reads the `toolbar` component's `mobileMenu` list, or else share, measurements, language and help under the same conditions as the desktop toolbar; share is dropped in read mode. Nothing when the list is empty. Props: `icon` and `closeIcon`, also settable in the theme as `PhxMobileHamburgerMenu`; the application config's `hamburgerIcon` and `toolbarCloseIcon` take precedence |
|
|
98
|
+
| `MobileTabs` | Scrollable tabs that switch the navigation state | Reads the selected entity's `sidebarTabs` or the `horizontalTabs` component, and throws when both are active or when more than one of either is active. Nothing without tabs or while the summary is shown. Unlike the desktop fixed header, it keeps horizontal tabs in read mode |
|
|
99
|
+
| `MobileViewControls` | A toolbar button with the active view's icon that opens the list of views | Nothing without the component, an active view state or that view's icon |
|
|
100
|
+
| `MobileToolControls` | The tool buttons | Same component as `DesktopToolControls` |
|
|
101
|
+
| `MobileCallToAction` | The button that leaves a tool mode | Same as `DesktopCallToAction` |
|
|
102
|
+
| `MobileSidebarBackButton` | A "Back" button | Same as `DesktopSidebarBackButton`, smaller, with `sidebarBackIcon` taking precedence the same way; its theme name is `PhxMobileSidebarBackButton` |
|
|
103
|
+
| `MobileSidebarContent` | The property pages | Same content as `DesktopSidebarContent` |
|
|
104
|
+
| `MobileSidebarFooter` | The price and the actions | Same as `DesktopSidebarFooter`; the universal footer adds the step label and progress |
|
|
105
|
+
| `MobileSnackbarsRoot` | The element the snackbars are rendered into | It does not position the snackbars: they keep notistack's `position: fixed` and sit at the viewport's edge wherever the root is. The built-in phone layout positions them with its own styles; a project layout styles `notistackSnackbarClasses.container` from `@salsita-ai/sdk/ui` |
|
|
106
|
+
|
|
107
|
+
## Others
|
|
108
|
+
|
|
109
|
+
| Member | Shows |
|
|
110
|
+
| ------------------------- | ------------------------------------------------------------------------------------------------------------------------------- |
|
|
111
|
+
| `GPUIssuePage` | `WebGLNotSupported` or `GPUAccelerationDisabled`, chosen by its `issue` prop. `Canvas` renders it; a layout does not need it |
|
|
112
|
+
| `GPUIssue` | The two values of that prop, `'no-gpu'` and `'no-acceleration'`, as a constant and a type |
|
|
113
|
+
| `WebGLNotSupported` | A full-page message that WebGL is not supported, with a **Go To Homepage** button that returns to the configurator's start page |
|
|
114
|
+
| `GPUAccelerationDisabled` | A full-page message that GPU acceleration is disabled, with the same button |
|
|
@@ -29,10 +29,11 @@ pnpm phoenix dev
|
|
|
29
29
|
|
|
30
30
|
1. Refuses to run when a `spec/` folder already exists, so it never touches an existing project.
|
|
31
31
|
2. Writes a `package.json` that depends on the CLI's SDK version when the folder has none. An existing `package.json` is kept, as long as it depends on the SDK.
|
|
32
|
-
3.
|
|
33
|
-
4. Writes `
|
|
32
|
+
3. Adds the `dev`, `build`, `deploy`, `check` and `fix` scripts to `package.json` (see [Project Scripts](#project-scripts)). A script the project already has under one of those names keeps its command.
|
|
33
|
+
4. Writes a starter spec (`spec/application.yaml`, `spec/configurator.yaml`) with one resizable, recolorable box, and switches `package.json` to the application-spec pipeline.
|
|
34
|
+
5. Writes `pnpm-workspace.yaml` with the pnpm settings the first install needs: the build scripts of the SDK's dependencies are allowed or denied, and `@salsita-ai/*` packages are exempt from pnpm's minimum release age. A project inside a pnpm monorepo gets no file; the workspace root holds these settings.
|
|
34
35
|
|
|
35
|
-
It asks nothing, writes no `.env` and contacts no server. `phoenix sync` then generates every other project file, including the agent skills described in [Project Structure](?path=/docs/phoenix-project-structure--docs).
|
|
36
|
+
It asks nothing, writes no `.env` and contacts no server. `phoenix sync` then generates every other project file, including the agent skills described in [Project Structure](?path=/docs/phoenix-project-structure--docs). The `.gitignore` is among them only when the folder is inside a git repository, so run `git init` before the first sync, or sync again after it.
|
|
36
37
|
|
|
37
38
|
### Which project `phoenix dev` develops in
|
|
38
39
|
|
|
@@ -114,8 +115,6 @@ For quick local development without a server, use:
|
|
|
114
115
|
|
|
115
116
|
```bash
|
|
116
117
|
phoenix dev --persistence local-storage
|
|
117
|
-
# or use the shortcut script:
|
|
118
|
-
pnpm dev:local
|
|
119
118
|
```
|
|
120
119
|
|
|
121
120
|
**Important:** The server must be running before `deployment:prepare-local` when using `server` persistence mode.
|
|
@@ -158,27 +157,19 @@ spec/application.yaml → Server prepares environment → CLI writes .env.genera
|
|
|
158
157
|
|
|
159
158
|
### Project Scripts
|
|
160
159
|
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
| Script
|
|
164
|
-
|
|
|
165
|
-
| `dev`
|
|
166
|
-
| `
|
|
167
|
-
| `
|
|
168
|
-
| `
|
|
169
|
-
| `
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
| `prettify:fix` | `prettier --write .` | Prettier fix only |
|
|
175
|
-
| `verify:fix` | `phoenix build && phoenix fix && phoenix check --types` | Build, fix, then type-check |
|
|
176
|
-
| `test` | `vitest --passWithNoTests run` | Run tests |
|
|
177
|
-
| `test:watch` | `vitest` | Tests in watch mode |
|
|
178
|
-
| `prepare:ci` | `phoenix prepare:ci` | CI environment setup |
|
|
179
|
-
| `deployment:prepare-local` | `phoenix deployment:prepare-local` | Prepare local environment |
|
|
180
|
-
|
|
181
|
-
Custom scripts you add to `package.json` are preserved during sync. Deprecated scripts (like `environment:create`, `deployment:register`) are automatically removed.
|
|
160
|
+
`phoenix init` writes five scripts into `package.json`, each a shortcut for the CLI command of the same name:
|
|
161
|
+
|
|
162
|
+
| Script | Command | Purpose |
|
|
163
|
+
| -------- | ---------------- | --------------------------------------------- |
|
|
164
|
+
| `dev` | `phoenix dev` | Dev server with hot reload |
|
|
165
|
+
| `build` | `phoenix build` | Production build |
|
|
166
|
+
| `deploy` | `phoenix deploy` | Build and publish the project |
|
|
167
|
+
| `check` | `phoenix check` | Run all checks (TypeScript, ESLint, Prettier) |
|
|
168
|
+
| `fix` | `phoenix fix` | Auto-fix lint and formatting issues |
|
|
169
|
+
|
|
170
|
+
The scripts are yours: change, rename or delete them, and add your own. `phoenix sync` and `phoenix clean` leave the `scripts` section of `package.json` as it is, so they add no script, restore none you removed and remove none. Every CLI command also runs without a script, as `pnpm phoenix <command>`.
|
|
171
|
+
|
|
172
|
+
A project may have other scripts than these five, such as `sync`, `test` or `verify:fix`; they are its own and stay as they are. All of this holds for a project on the application-spec pipeline, which `phoenix init` selects. In a project on the legacy pipeline (see [Current and legacy project tooling](#current-and-legacy-project-tooling)), `phoenix sync` and `phoenix clean` write their own set of scripts into `package.json` on every run, over scripts of the same name.
|
|
182
173
|
|
|
183
174
|
### Server-Generated Variables
|
|
184
175
|
|
|
@@ -231,7 +222,7 @@ A build pipeline that receives the source archive of a [`phoenix deploy`](#phoen
|
|
|
231
222
|
- it refuses an archive over 200 MB, one that extracts to more than 1 GB, or one with more than 100,000 files;
|
|
232
223
|
- it refuses links, special files, absolute paths, paths that leave the folder, names with control characters, and entries that repeat or collide with an earlier one;
|
|
233
224
|
- it refuses an archive it cannot read to the end, such as a truncated upload;
|
|
234
|
-
- it extracts only project files, the
|
|
225
|
+
- it extracts only project files and reports the entries it left out, including the optional `conversation.log` that deploy keeps in the private archive for review.
|
|
235
226
|
|
|
236
227
|
`<folder>` must be new or empty. When the command refuses an archive, it removes the folder, so a partly extracted project is never built.
|
|
237
228
|
|
|
@@ -399,6 +390,8 @@ Removes all build artifacts (`.phoenix/`, `node_modules/`), reinstalls dependenc
|
|
|
399
390
|
|
|
400
391
|
Syncs project dependencies and regenerates all project files without building Vite bundles or webhooks. Faster than `clean` — use this for routine updates after changing spec files or upgrading dependencies. Before installing, it adds the pnpm settings `phoenix init` writes to a standalone project's `pnpm-workspace.yaml` when they are missing; values you set there are kept.
|
|
401
392
|
|
|
393
|
+
With the application-spec pipeline (see [Current and legacy project tooling](#current-and-legacy-project-tooling)), `.gitignore` is written only when the project is inside a git repository: the project folder or one of its parent folders holds a `.git` entry. Outside a repository, sync neither creates the file nor changes one that is already there, and the same holds for `dev`, `build` and `clean`. Run `git init` before the first sync, or sync again after it, to get the file. The legacy pipeline writes `.gitignore` in every project.
|
|
394
|
+
|
|
402
395
|
| Flag | Env Variable | Default | Description |
|
|
403
396
|
| ---------------- | --------------- | ------- | ------------------------------ |
|
|
404
397
|
| `--force` / `-f` | `FORCE_REBUILD` | `false` | Force full rebuild, skip cache |
|
|
@@ -712,6 +705,10 @@ Revokes the token on the server and removes it from the credentials file. `--reg
|
|
|
712
705
|
|
|
713
706
|
Validates the spec, adds the pnpm settings `phoenix init` writes to `pnpm-workspace.yaml` when they are missing, packs and uploads the project, starts its build on the server and follows it until the configurator is live. Before the upload the server compares the domain model with the deployed one: a model that changed under an already deployed model version is refused with the reason, and needs a new model version and a [migration](?path=/docs/phoenix-migrations--docs). Once the build starts it prints `Follow the build in Studio: <url>`, the build's page in the Studio you signed in through; a sign-in stored by an older CLI has no Studio URL, so sign in again to get the link. After `Your configurator is live at <url>` it prints one line for coding agents, which tells them to offer the run evaluation of the `phoenix-feedback` skill once you have nothing more to build; you can ignore it when you run the command yourself. `--region` or `--serverUrl` selects the server, as for `login`; `--no-wait` returns as soon as the build starts.
|
|
714
707
|
|
|
708
|
+
To keep the conversation that led to a build, place a reviewed UTF-8 transcript in `conversation.log` at the project root before deploying. Deploy automatically includes it in the private source archive. Download the build's sources from Studio to read it; access is the same as for the rest of that build's sources. The build extractor skips the log, so it is not an application build input or a public asset. Missing logs produce a warning and deployment continues. Directories, links and special files at that path are rejected.
|
|
709
|
+
|
|
710
|
+
The Phoenix agent skill explains how to prepare the transcript: prefer a native session export; otherwise mark a reconstruction as incomplete. Preserve available user/assistant messages and tool calls, cap individual tool results at 16 KiB with explicit truncation markers, and reference images rather than embedding them. Include the agent, export time, source and known omissions. Review and redact credentials or unrelated sensitive content before approving upload. The CLI uploads the file as supplied; it does not collect agent history, redact content, check freshness or verify completeness. Remove the file from the project root to deploy without it. The log counts toward the source archive's existing size limits; there is no separate conversation upload or viewer.
|
|
711
|
+
|
|
715
712
|
### `phoenix feedback [message]`
|
|
716
713
|
|
|
717
714
|
Sends feedback about the SDK, the CLI, the documentation or Studio to the Phoenix team. It needs `phoenix login`: the server records the workspace, user and API token of the sign-in, so the message itself needs no introduction.
|
|
@@ -53,7 +53,8 @@ Every file in `components/`, `elements/`, `expressions/`, `actions/`, `invariant
|
|
|
53
53
|
(and their `admin/` counterparts) is imported by its location, so its default export must be what that folder's `phx`
|
|
54
54
|
factory returns, or an array of those. A file that exports anything else, such as a plain React component in
|
|
55
55
|
`elements/`, stops the application at start with an `Invalid default export in <file>` error that names the expected
|
|
56
|
-
shape.
|
|
56
|
+
shape. When several files in `handlers/`, `elements/`, `transformers/`, `components/`, `admin/elements/` and
|
|
57
|
+
`admin/components/` are wrong, the error lists all of them, one numbered line per file. Keep plain components and helpers in a `_*` folder.
|
|
57
58
|
|
|
58
59
|
### Admin Folders (src/admin/)
|
|
59
60
|
|
|
@@ -178,14 +179,14 @@ type CustomMaterial = Phx['AdminModel']['CustomMaterial']
|
|
|
178
179
|
|
|
179
180
|
| File | Auto-Generated? | Notes |
|
|
180
181
|
| ------------------------------------------------------ | --------------- | -------------------------------------- |
|
|
181
|
-
| `package.json` | Partially | Dependencies merged, scripts
|
|
182
|
+
| `package.json` | Partially | Dependencies merged, scripts untouched |
|
|
182
183
|
| `tsconfig.json` | Yes | Managed by Phoenix |
|
|
183
184
|
| `eslint.config.js` | Yes | Managed by Phoenix |
|
|
184
185
|
| `prettier.config.js` | Yes | Managed by Phoenix |
|
|
185
|
-
| `.prettierignore` |
|
|
186
|
+
| `.prettierignore` | No | Optional and your own; see below |
|
|
186
187
|
| `.linguirc` | Yes | Managed by Phoenix |
|
|
187
188
|
| `.nvmrc` | Yes | Managed by Phoenix |
|
|
188
|
-
| `.gitignore` | Partially |
|
|
189
|
+
| `.gitignore` | Partially | Only in a git repository; see Markers |
|
|
189
190
|
| `.env` | No | Git-ignored, local config |
|
|
190
191
|
| `.env.example` | No | Template for env vars |
|
|
191
192
|
| `.env.generated` | Yes | Auto-generated IDs, git-ignored |
|
|
@@ -195,10 +196,12 @@ type CustomMaterial = Phx['AdminModel']['CustomMaterial']
|
|
|
195
196
|
|
|
196
197
|
Sync does not write `README.md`, `AGENTS.md`, `.env.example`, `.env.ci` or the `README.md` files in `assets/public/` and `assets/private/`. Earlier SDK versions wrote them once; a project that has them keeps them, and they are yours to edit.
|
|
197
198
|
|
|
199
|
+
With the application-spec pipeline (see [Current and legacy project tooling](?path=/docs/phoenix-phoenix-cli--docs#current-and-legacy-project-tooling)), Phoenix does not write a `.prettierignore`, and a fresh clone or CI checkout of a project has none. `phoenix check` and `phoenix fix` do not read one: they skip `.phoenix/`, `dist/`, the compiled catalogs in `src/locales/`, `pnpm-lock.yaml` and `.linguirc` on their own. A project that runs Prettier directly, as `prettier --check .` or from an editor, can add its own `.prettierignore`. To commit it, add a `!.prettierignore` line after the Phoenix block of `.gitignore`, because that block lists the file. The legacy pipeline writes `.prettierignore` on every sync.
|
|
200
|
+
|
|
198
201
|
### DO NOT EDIT (Fully Auto-Generated)
|
|
199
202
|
|
|
200
203
|
- **Everything in `.phoenix/`** - Completely regenerated on each build. The one exception is `.phoenix/variants/`, where a coding agent writes the option files for `phoenix variants`; a rebuild keeps it
|
|
201
|
-
- `tsconfig.json`, `eslint.config.js`, `prettier.config.js
|
|
204
|
+
- `tsconfig.json`, `eslint.config.js`, `prettier.config.js`
|
|
202
205
|
- `.linguirc`, `.nvmrc`
|
|
203
206
|
- `src/locales/**/*.ts` - Compiled from `.po` catalogs
|
|
204
207
|
- `.env.generated`
|
|
@@ -212,17 +215,19 @@ Projects created by earlier SDK versions had this guidance in `CLAUDE.md`, `.cur
|
|
|
212
215
|
|
|
213
216
|
### Markers for Partial Auto-Generation
|
|
214
217
|
|
|
215
|
-
`.gitignore`
|
|
218
|
+
`.gitignore` holds the Phoenix entries between two marker lines. Sync rewrites that block and keeps everything outside it:
|
|
216
219
|
|
|
217
220
|
```gitignore
|
|
218
|
-
#
|
|
221
|
+
# ===== BEGIN PHOENIX AUTO-GENERATED =====
|
|
219
222
|
# ... Phoenix-managed ignores ...
|
|
220
|
-
#
|
|
223
|
+
# ===== END PHOENIX AUTO-GENERATED =====
|
|
221
224
|
|
|
222
|
-
# Your custom ignores
|
|
225
|
+
# Your custom ignores (preserved)
|
|
223
226
|
my-custom-folder/
|
|
224
227
|
```
|
|
225
228
|
|
|
229
|
+
With the application-spec pipeline (see [Current and legacy project tooling](?path=/docs/phoenix-phoenix-cli--docs#current-and-legacy-project-tooling)), sync writes `.gitignore` only when the project is inside a git repository: the project folder or one of its parent folders holds a `.git` entry. Outside a repository it neither creates the file nor changes one that is already there. Run `git init` before the first sync, or sync again after it, to get the file. The legacy pipeline writes the file in every project.
|
|
230
|
+
|
|
226
231
|
### Safe to Edit
|
|
227
232
|
|
|
228
233
|
- `src/` (except compiled `src/locales/**/*.ts` files)
|
|
@@ -104,10 +104,10 @@ pnpm install
|
|
|
104
104
|
pnpm phoenix sync
|
|
105
105
|
```
|
|
106
106
|
|
|
107
|
-
`phoenix sync` keeps `spec/` and `src/` as your authored inputs and generates the application shell,
|
|
107
|
+
`phoenix sync` keeps `spec/` and `src/` as your authored inputs and generates the application shell, types, and `.phoenix/` implementation. Start development without a server:
|
|
108
108
|
|
|
109
109
|
```sh
|
|
110
|
-
pnpm dev
|
|
110
|
+
pnpm phoenix dev --persistence local-storage
|
|
111
111
|
```
|
|
112
112
|
|
|
113
113
|
Open the URL printed by the command. The application shell loads with the default `<salsita-configurator>` element and an empty 3D scene.
|
|
@@ -22,7 +22,7 @@ pnpm install
|
|
|
22
22
|
pnpm phoenix sync
|
|
23
23
|
```
|
|
24
24
|
|
|
25
|
-
`phoenix init [folder]` writes the starter project: `package.json`, `pnpm-workspace.yaml` and the starter spec, `spec/application.yaml` and `spec/configurator.yaml`, which describe one box you can resize and recolour. The starter depends on the same SDK version as the CLI that created it. `phoenix sync` then adds the rest of the project:
|
|
25
|
+
`phoenix init [folder]` writes the starter project: `package.json`, `pnpm-workspace.yaml` and the starter spec, `spec/application.yaml` and `spec/configurator.yaml`, which describe one box you can resize and recolour. The starter depends on the same SDK version as the CLI that created it, and its `package.json` has the `dev`, `build`, `deploy`, `check` and `fix` scripts, which are yours to change. `phoenix sync` then adds the rest of the project: webhooks and lint config. It writes a `.gitignore` only when the folder is inside a git repository; run `git init` before the first sync, or sync again after it, to get the file.
|
|
26
26
|
|
|
27
27
|
`init` only writes these files: it asks nothing and contacts no server. It refuses a folder that already has a `spec/` folder. A `package.json` already in the folder is kept, as long as it depends on the SDK.
|
|
28
28
|
|
|
@@ -61,7 +61,7 @@ Signed in, `phoenix dev` needs no `.env` and nothing set up in Studio. When it s
|
|
|
61
61
|
|
|
62
62
|
Every user who signs the CLI in gets their own development environment, so a teammate (a super admin of the workspace, like you) who clones the project and signs in doesn't overwrite your schema or take over your webhooks. The development environment is separate from `production`: nothing you do in `phoenix dev` changes the live configurator.
|
|
63
63
|
|
|
64
|
-
`pnpm dev
|
|
64
|
+
`pnpm phoenix dev --persistence local-storage` still runs the project without any server, with state kept in the browser.
|
|
65
65
|
|
|
66
66
|
Coding agents follow the generated `phoenix` skill: before their first change they start `phoenix dev` and open the preview in your browser, and after `phoenix deploy` starts a build they open its page in Studio.
|
|
67
67
|
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
# Testing
|
|
2
|
+
|
|
3
|
+
- [Your application in a test](#your-application-in-a-test)
|
|
4
|
+
- [Run the domain on a preset](#run-the-domain-on-a-preset)
|
|
5
|
+
- [Test a transformer](#test-a-transformer)
|
|
6
|
+
- [Mock a domain context](#mock-a-domain-context)
|
|
7
|
+
- [Options](#options)
|
|
8
|
+
|
|
9
|
+
A project's tests check its own logic, such as an expression on a preset, a transformer that completes an
|
|
10
|
+
edit, a Blender projection or a migration, against the application the project ships. They run with
|
|
11
|
+
Vitest in Node, without a browser or a server.
|
|
12
|
+
|
|
13
|
+
## Your application in a test
|
|
14
|
+
|
|
15
|
+
`createTestApplicationConfig` from `@salsita-ai/sdk/domain` is the way a test builds the project's
|
|
16
|
+
application. It takes the generated application the test imports and returns its application config,
|
|
17
|
+
typed with the project's entities, states and data, with no type argument at the call:
|
|
18
|
+
|
|
19
|
+
```ts
|
|
20
|
+
import { createTestApplicationConfig } from '@salsita-ai/sdk/domain'
|
|
21
|
+
|
|
22
|
+
import { configuratorBuilder } from '../../.phoenix/domain.js'
|
|
23
|
+
|
|
24
|
+
const config = createTestApplicationConfig(configuratorBuilder)
|
|
25
|
+
|
|
26
|
+
config.domain.presets // the presets of spec/presets
|
|
27
|
+
config.initialPublishedData // the published data the application starts with
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
`configuratorBuilder` from `.phoenix/domain.js` is the domain of the configurator: the model, expressions,
|
|
31
|
+
invariants, actions, migrations, presets and the components declared in YAML. `configuratorConfig` from
|
|
32
|
+
`.phoenix/configurator-config.js` is the whole configurator as the browser runs it, with every component,
|
|
33
|
+
handler, element and transformer; it reads the frontend environment when it is imported, so a test that
|
|
34
|
+
uses it stubs `phx.frontendEnv` first.
|
|
35
|
+
|
|
36
|
+
A test passes the generated export to the helper and does not call the export's methods: they are how the
|
|
37
|
+
SDK assembles an application, not an interface for tests, while the helper's call does not depend on that
|
|
38
|
+
assembly.
|
|
39
|
+
|
|
40
|
+
## Run the domain on a preset
|
|
41
|
+
|
|
42
|
+
The config goes into `createDomainRuntime`, which runs the same systems as the configurator:
|
|
43
|
+
|
|
44
|
+
```ts
|
|
45
|
+
import { vi } from 'vitest'
|
|
46
|
+
|
|
47
|
+
import { NoopAnalyticsSystem, createDomainRuntime, createTestApplicationConfig } from '@salsita-ai/sdk/domain'
|
|
48
|
+
|
|
49
|
+
import { configuratorBuilder, createI18n } from '../../.phoenix/domain.js'
|
|
50
|
+
|
|
51
|
+
const logger = {
|
|
52
|
+
info: vi.fn(),
|
|
53
|
+
error: vi.fn(),
|
|
54
|
+
warn: vi.fn(),
|
|
55
|
+
debug: vi.fn(),
|
|
56
|
+
verbose: vi.fn(),
|
|
57
|
+
appendToGlobalContext: vi.fn(),
|
|
58
|
+
}
|
|
59
|
+
const config = createTestApplicationConfig(configuratorBuilder)
|
|
60
|
+
const runtime = createDomainRuntime({
|
|
61
|
+
config,
|
|
62
|
+
services: { analyticsService: new NoopAnalyticsSystem(), i18n: createI18n(), logger },
|
|
63
|
+
})
|
|
64
|
+
|
|
65
|
+
runtime.actions.domainContext.configurator.setExecutionMode('finalize')
|
|
66
|
+
runtime.actions.domainData.setDomainData({
|
|
67
|
+
publishedData: config.initialPublishedData,
|
|
68
|
+
backendData: undefined,
|
|
69
|
+
frontendData: {},
|
|
70
|
+
})
|
|
71
|
+
runtime.actions.sessionContext.setSessionContext({ role: 'anonymous', data: {} })
|
|
72
|
+
|
|
73
|
+
const preset = config.domain.presets[0]!
|
|
74
|
+
runtime.actions.loadedData.completeConfiguratorLoad({
|
|
75
|
+
initialRevisionId: 'test',
|
|
76
|
+
initialEntities: preset.initialDomainEntities,
|
|
77
|
+
modelVersion: config.domain.domainFactory.modelVersion,
|
|
78
|
+
rootEntityType: preset.rootEntityType,
|
|
79
|
+
schemaIdentity: runtime.selectors.spec.getConfiguratorFactory(),
|
|
80
|
+
})
|
|
81
|
+
runtime.selectors.domainContext.configurator.getDomainContext().initialize()
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
## Test a transformer
|
|
85
|
+
|
|
86
|
+
The domain of `configuratorBuilder` has no code-attached components and no transformers. A test adds the
|
|
87
|
+
ones it needs, the way the configurator and the webhooks add them:
|
|
88
|
+
|
|
89
|
+
```ts
|
|
90
|
+
// Files that read `phx.domain` at module scope are imported after `.phoenix/domain.js`.
|
|
91
|
+
const { customComponentOptics } = await import('../../.phoenix/configurator-domain-code.js')
|
|
92
|
+
const { default: addCookingTop } = await import('../transformers/add-cooking-top.js')
|
|
93
|
+
|
|
94
|
+
const config = createTestApplicationConfig(configuratorBuilder, {
|
|
95
|
+
componentModules: customComponentOptics,
|
|
96
|
+
transformers: {
|
|
97
|
+
importedTransformers: [{ origin: 'src/transformers/add-cooking-top.ts', exports: addCookingTop }],
|
|
98
|
+
specTransformers: [{ name: 'addCookingTop', priority: 30 }],
|
|
99
|
+
},
|
|
100
|
+
})
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
`specTransformers` are the entries of the `transformers` section of `spec/application.yaml` that the test
|
|
104
|
+
runs, with the priorities the spec gives them.
|
|
105
|
+
|
|
106
|
+
## Mock a domain context
|
|
107
|
+
|
|
108
|
+
`createMockState`, `createMockDomain` and `createMockDomainContext` take the same config and check the
|
|
109
|
+
mock data against the project's types:
|
|
110
|
+
|
|
111
|
+
```ts
|
|
112
|
+
import { createMockDomainContext, createTestApplicationConfig } from '@salsita-ai/sdk/domain'
|
|
113
|
+
|
|
114
|
+
const config = createTestApplicationConfig(configuratorBuilder)
|
|
115
|
+
const preset = config.domain.presets[0]!
|
|
116
|
+
const { domainContext, destroy } = createMockDomainContext(config, {
|
|
117
|
+
entities: preset.initialDomainEntities,
|
|
118
|
+
rootEntityType: preset.rootEntityType,
|
|
119
|
+
publishedData: config.initialPublishedData,
|
|
120
|
+
frontendData: {},
|
|
121
|
+
sessionData: {},
|
|
122
|
+
backendData: undefined,
|
|
123
|
+
mode: 'owner',
|
|
124
|
+
role: 'anonymous',
|
|
125
|
+
transformers: [],
|
|
126
|
+
})
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
## Options
|
|
130
|
+
|
|
131
|
+
| Option | What it does |
|
|
132
|
+
| ------------------ | ------------------------------------------------------------------------------------------------------------------ |
|
|
133
|
+
| `componentModules` | Component files added after the components the application already has, each `{ origin, exports }` |
|
|
134
|
+
| `transformers` | Replaces the application's transformers: files (`importedTransformers`) and spec entries (`specTransformers`) |
|
|
135
|
+
| `tag` | The tag of the custom element the application mounts as; without it the application's own (`salsita-configurator`) |
|
|
136
|
+
|
|
137
|
+
## See Also
|
|
138
|
+
|
|
139
|
+
- [Best Practices](?path=/docs/phoenix-best-practices--docs) - Where custom code lives
|
|
140
|
+
- [Transformers](?path=/docs/other-features-transformers--docs) - Writing transformers
|
|
@@ -4,21 +4,22 @@ Build component controls with React and browser SDKs without pulling them into t
|
|
|
4
4
|
|
|
5
5
|
## Choose Where Each File Runs
|
|
6
6
|
|
|
7
|
-
| User file
|
|
8
|
-
|
|
|
9
|
-
| Component or admin component without a directive
|
|
10
|
-
| Component or admin component with `'use webhook'`
|
|
11
|
-
| Ordinary handler
|
|
12
|
-
| Published-data or
|
|
13
|
-
| Any other handler with `'use webhook'`
|
|
14
|
-
| File under `src/webhooks/`
|
|
7
|
+
| User file | Frontend | Webhook |
|
|
8
|
+
| ---------------------------------------------------- | -------- | ------- |
|
|
9
|
+
| Component or admin component without a directive | Yes | No |
|
|
10
|
+
| Component or admin component with `'use webhook'` | Yes | Yes |
|
|
11
|
+
| Ordinary handler | Yes | No |
|
|
12
|
+
| Published-data, validator or assistant setup handler | Yes | Yes |
|
|
13
|
+
| Any other handler with `'use webhook'` | Yes | Yes |
|
|
14
|
+
| File under `src/webhooks/` | No | Yes |
|
|
15
15
|
|
|
16
|
-
Published-data and
|
|
16
|
+
Published-data, validator and assistant setup handlers are detected when they register one of these APIs:
|
|
17
17
|
|
|
18
18
|
- `createMapPublishedRevisionDataHandler`
|
|
19
19
|
- `createMapPublishedChunkedDataHandler`
|
|
20
20
|
- `createDataRowValidatorHandler`
|
|
21
21
|
- `createSheetValidatorHandler`
|
|
22
|
+
- `phx.domain.createAssistantSetupHandler`
|
|
22
23
|
|
|
23
24
|
## Pin a Server-Safe Component
|
|
24
25
|
|
|
@@ -148,7 +148,7 @@ resources:
|
|
|
148
148
|
s3Key: clientImage
|
|
149
149
|
```
|
|
150
150
|
|
|
151
|
-
These resources are automatically made available as typed properties in task handlers via the `resources` parameter.
|
|
151
|
+
These resources are automatically made available as typed properties in task handlers via the `resources` parameter. Two static resources with the same name are an error: `phoenix check` and `phoenix build` report the second entry (`DUPLICATE_RESOURCE_NAME`).
|
|
152
152
|
|
|
153
153
|
#### Task Payload
|
|
154
154
|
|
|
@@ -991,7 +991,7 @@ Save the same OAuth client ID, client secret, and base URL in the customer's **C
|
|
|
991
991
|
JWT_SECRET_BASE64=<base64 of a long random key>
|
|
992
992
|
```
|
|
993
993
|
|
|
994
|
-
For a deployment, run `pnpm phoenix deployment:prepare` followed by `pnpm phoenix deployment:finish`. For local development, run `pnpm deployment:prepare-local`. These current commands use the customer settings stored in Studio; the removed `environment:create` and `deployment:register` commands are not part of the setup flow.
|
|
994
|
+
For a deployment, run `pnpm phoenix deployment:prepare` followed by `pnpm phoenix deployment:finish`. For local development, run `pnpm phoenix deployment:prepare-local`. These current commands use the customer settings stored in Studio; the removed `environment:create` and `deployment:register` commands are not part of the setup flow.
|
|
995
995
|
|
|
996
996
|
#### Clerk organization
|
|
997
997
|
|