@salsita-ai/sdk 0.50.0-develop.c1dcc73e88 → 0.50.0-develop.ca72986c39
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +13 -12
- 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/relation-expression-params.js +1 -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 +4 -0
- package/dist/application-spec/errors/diagnostic-codes.js +1 -1
- package/dist/application-spec/errors/diagnostic-messages.d.ts +7 -0
- package/dist/application-spec/errors/diagnostic-messages.js +1 -1
- package/dist/application-spec/generate-application/code/generate-application-code.d.ts +3 -2
- package/dist/application-spec/generate-application/code/generate-application-code.js +1 -1
- package/dist/application-spec/generate-application/code/project-scaffolding.d.ts +9 -4
- package/dist/application-spec/generate-application/code/project-scaffolding.js +2 -2
- package/dist/application-spec/generate-application/code/standalone-app-files.d.ts +2 -2
- package/dist/application-spec/generate-application/code/standalone-app-files.js +1 -1
- package/dist/application-spec/generate-application/code/templates/configurator-config.js +6 -4
- 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.js +1 -1
- package/dist/application-spec/generate-application/code/templates/domain-spec/generate-domain-block.js +41 -40
- package/dist/application-spec/generate-application/code/templates/domain-spec/generate-phx-globals.js +3 -0
- package/dist/application-spec/generate-application/code/templates/frontend-config.js +3 -5
- package/dist/application-spec/generate-application/code/templates/gitignore.js +1 -2
- package/dist/application-spec/generate-application/code/templates/globals.js +3 -3
- package/dist/application-spec/generate-application/code/templates/index.d.ts +1 -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/root-tsconfig.d.ts +6 -0
- package/dist/application-spec/generate-application/code/templates/root-tsconfig.js +2 -0
- package/dist/application-spec/generate-application/code/templates/skills/phoenix-cli-skill.js +1 -1
- package/dist/application-spec/generate-application/code/templates/skills/phoenix-review-skill.js +9 -3
- 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 +15 -7
- package/dist/application-spec/generate-application/code/templates/skills/sdk-content.js +2 -2
- package/dist/application-spec/generate-application/code/templates/tsconfig.d.ts +5 -0
- package/dist/application-spec/generate-application/code/templates/tsconfig.js +1 -1
- package/dist/application-spec/generate-application/code/templates/webhook-index.d.ts +6 -1
- package/dist/application-spec/generate-application/code/templates/webhook-index.js +10 -1
- package/dist/application-spec/generate-application/code/templates/webhooks-config.js +2 -3
- package/dist/application-spec/generate-application/index.d.ts +2 -0
- package/dist/application-spec/generate-application/index.js +1 -1
- package/dist/application-spec/generate-application/runtime/admin-runtime/admin-runtime.d.ts +6 -2
- package/dist/application-spec/generate-application/runtime/admin-runtime/admin-runtime.js +1 -1
- package/dist/application-spec/generate-application/runtime/application-runtime.d.ts +8 -1
- package/dist/application-spec/generate-application/runtime/application-runtime.js +1 -1
- package/dist/application-spec/generate-application/runtime/configurator-runtime/configurator-runtime.d.ts +5 -1
- package/dist/application-spec/generate-application/runtime/configurator-runtime/configurator-runtime.js +1 -1
- package/dist/application-spec/generate-application/runtime/factory-data/factory-data-runtime.d.ts +43 -0
- package/dist/application-spec/generate-application/runtime/factory-data/factory-data-runtime.js +1 -0
- package/dist/application-spec/generate-application/runtime/factory-data/index.d.ts +3 -0
- package/dist/application-spec/generate-application/runtime/factory-data/index.js +1 -0
- package/dist/application-spec/generate-application/runtime/factory-data/recipe-defaults.d.ts +13 -0
- package/dist/application-spec/generate-application/runtime/factory-data/recipe-defaults.js +1 -0
- package/dist/application-spec/generate-application/runtime/factory-data/static-violations.d.ts +16 -0
- package/dist/application-spec/generate-application/runtime/factory-data/static-violations.js +1 -0
- package/dist/application-spec/generate-application/runtime/migrations/index.d.ts +1 -0
- package/dist/application-spec/generate-application/runtime/migrations/index.js +1 -0
- package/dist/application-spec/generate-application/runtime/migrations/migration-runtime.d.ts +53 -0
- package/dist/application-spec/generate-application/runtime/migrations/migration-runtime.js +1 -0
- package/dist/application-spec/generate-application/runtime/sections/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/expression-runtime.js +1 -1
- package/dist/application-spec/index.d.ts +1 -0
- package/dist/application-spec/index.js +1 -1
- package/dist/application-spec/parse-application-files/categorize/categorize-files.d.ts +16 -0
- package/dist/application-spec/parse-application-files/categorize/categorize-files.js +1 -1
- package/dist/application-spec/parse-application-files/categorize/earlier-generated-tsconfig.d.ts +9 -0
- package/dist/application-spec/parse-application-files/categorize/earlier-generated-tsconfig.js +1 -0
- package/dist/application-spec/parse-application-files/categorize/module-analysis.d.ts +1 -1
- package/dist/application-spec/parse-application-files/categorize/module-analysis.js +1 -1
- package/dist/application-spec/parse-application-files/raw-spec/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/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.js +1 -1
- package/dist/application-spec/parse-application-files/spec/sections/assistant/assistant-schema.js +1 -1
- package/dist/client/phoenix-api.d.ts +463 -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 +32 -1
- package/dist/configurator/application-runtime/extensions/systems/assistant-system/assistant-system.js +1 -1
- package/dist/configurator/application-runtime/extensions/systems/assistant-system/graphql-tools.d.ts +7 -1
- package/dist/configurator/application-runtime/extensions/systems/assistant-system/graphql-tools.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 +20 -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 +22 -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/common/index.d.ts +2 -0
- package/dist/configurator/common/index.js +1 -1
- package/dist/configurator/common/use-finalize-action.d.ts +31 -0
- package/dist/configurator/common/use-finalize-action.js +1 -0
- package/dist/configurator/common/use-reset-camera.d.ts +6 -0
- package/dist/configurator/common/use-reset-camera.js +1 -0
- package/dist/configurator/configurator-context/configurator-hooks/layout-hooks.d.ts +1 -1
- package/dist/configurator/pages/DefaultConfiguratorLayout.d.ts +2 -2
- package/dist/configurator/pages/LoadedConfiguratorDetailPage.js +1 -1
- package/dist/configurator/pages/configurator-layout-name.d.ts +2 -0
- package/dist/configurator/pages/configurator-layout-name.js +1 -0
- package/dist/configurator/pages/default-configurator-elements.d.ts +7 -0
- package/dist/configurator/pages/default-configurator-elements.js +1 -0
- package/dist/configurator/pages/index.d.ts +1 -0
- package/dist/configurator/pages/index.js +1 -1
- package/dist/configurator/scene/scene-controls/hotspot-drag-handle/HotspotDragHandle.d.ts +1 -1
- package/dist/configurator/scene/scene-controls/hotspot-drag-handle/HotspotDragSceneHandle.d.ts +1 -1
- package/dist/configurator/scene/scene-entity/dimension-indicators/DimensionIndicator.d.ts +1 -1
- package/dist/configurator/scene/scene-entity/dimension-indicators/DimensionIndicatorInternal.d.ts +1 -1
- package/dist/configurator/scene/scene-entity/drag-and-drop/shared.d.ts +2 -2
- package/dist/configurator/scene/scene-entity/drag-and-drop/use-drag-object.d.ts +1 -1
- package/dist/configurator/scene/scene-entity/materials/RemoteReplacedMaterial.js +1 -1
- package/dist/configurator/scene/scene-entity/objects/SceneEntityObjectTextDecal.d.ts +1 -1
- package/dist/configurator/ui/assistant/AssistantChips.d.ts +8 -2
- package/dist/configurator/ui/assistant/AssistantChips.js +1 -1
- package/dist/configurator/ui/assistant/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/{universal → slots/desktop-sidebar}/DesktopSidebar.d.ts +23 -14
- 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 +1 -1
- package/dist/configurator/ui/configurator-layout/universal/DesktopLayout.js +2 -2
- 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/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/layouts/custom-layout.mdx +2125 -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/transformers.mdx +4 -0
- package/dist/docs/phoenix/application-states.mdx +9 -7
- package/dist/docs/phoenix/configurator-interface.mdx +136 -18
- package/dist/docs/phoenix/deployments.mdx +2 -6
- package/dist/docs/phoenix/finalization.mdx +1 -1
- package/dist/docs/phoenix/getting-started.mdx +1 -0
- package/dist/docs/phoenix/layout-slots.mdx +116 -0
- package/dist/docs/phoenix/localization.mdx +4 -4
- package/dist/docs/phoenix/migration-guide.mdx +19 -8
- package/dist/docs/phoenix/phoenix-cli.mdx +44 -8
- package/dist/docs/phoenix/project-structure.mdx +23 -7
- 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 +21 -4
- package/dist/domain/application/application-config.d.ts +3 -1
- 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 +5 -2
- package/dist/domain/application/configurator-builder.js +1 -1
- package/dist/domain/core/expression/constant-expressions.d.ts +16 -8
- 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/domain-context/index.d.ts +1 -1
- package/dist/domain/domain-context/undo-system.d.ts +28 -1
- package/dist/domain/domain-context/undo-system.js +1 -1
- package/dist/domain/domain-runtime/access/selectors.d.ts +9 -0
- package/dist/domain/domain-runtime/access/selectors.js +1 -1
- package/dist/domain/domain-runtime/access/types.d.ts +2 -0
- package/dist/domain/domain-runtime/access/types.js +1 -1
- package/dist/domain/domain-runtime/domain-context/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 +16 -0
- 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/initialize.d.ts +11 -0
- package/dist/domain/domain-runtime/spec/initialize.js +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.js +1 -1
- package/dist/domain/domain-runtime/spec/module-checks/resolve-invariant-modules.js +1 -1
- package/dist/domain/domain-runtime/spec/selectors.js +1 -1
- package/dist/domain/domain-runtime/spec/types.d.ts +2 -0
- 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-runtime.d.ts +9 -0
- package/dist/domain/mocks/create-mock-domain-runtime.js +1 -1
- package/dist/domain/mocks/create-mock-domain.js +1 -1
- 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/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/editor/mocks/EditorMockContext.js +1 -1
- package/dist/globals/index.d.ts +2 -0
- package/dist/i18n/locales/cs/messages.js +1 -1
- package/dist/i18n/locales/da/messages.js +1 -1
- package/dist/i18n/locales/de/messages.js +1 -1
- package/dist/i18n/locales/de-AT/messages.js +1 -1
- package/dist/i18n/locales/en/messages.js +1 -1
- package/dist/i18n/locales/en-AU/messages.js +1 -1
- package/dist/i18n/locales/en-GB/messages.js +1 -1
- package/dist/i18n/locales/es/messages.js +1 -1
- package/dist/i18n/locales/fr/messages.js +1 -1
- package/dist/i18n/locales/hu/messages.js +1 -1
- package/dist/i18n/locales/it/messages.js +1 -1
- package/dist/i18n/locales/nl/messages.js +1 -1
- package/dist/i18n/locales/pl/messages.js +1 -1
- package/dist/i18n/locales/pt/messages.js +1 -1
- package/dist/i18n/locales/ro/messages.js +1 -1
- package/dist/i18n/locales/sk/messages.js +1 -1
- package/dist/i18n/locales/tr/messages.js +1 -1
- package/dist/legacy/domain-cli/gen/constant-expressions.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 +7 -1
- package/dist/legacy/phoenix-cli/project-gen/generators/file-templates/frontend-admin.js +18 -16
- package/dist/legacy/phoenix-cli/project-gen/generators/file-templates/frontend-configurator.js +14 -12
- package/dist/legacy/phoenix-cli/project-gen/generators/file-templates/frontend-embedded-admin.js +13 -11
- package/dist/legacy/phoenix-cli/project-gen/generators/file-templates/frontend-embedded-configurator.js +13 -11
- package/dist/phoenix/application-spec/application-spec-builder.js +1 -1
- package/dist/phoenix/application-spec/project-files.js +1 -1
- package/dist/phoenix/cli.js +1 -1
- package/dist/phoenix/commands/check.js +1 -1
- package/dist/phoenix/commands/deploy.js +1 -1
- package/dist/phoenix/commands/deps/deps.d.ts +52 -0
- package/dist/phoenix/commands/deps/deps.js +3 -0
- package/dist/phoenix/commands/deps/index.d.ts +1 -0
- package/dist/phoenix/commands/deps/index.js +1 -0
- package/dist/phoenix/commands/deps/sdk-manifest.d.ts +12 -0
- package/dist/phoenix/commands/deps/sdk-manifest.js +1 -0
- package/dist/phoenix/commands/dev.js +5 -5
- package/dist/phoenix/commands/fix.js +1 -1
- package/dist/phoenix/commands/index.d.ts +1 -0
- package/dist/phoenix/commands/index.js +1 -1
- package/dist/phoenix/services/application-spec-project-watcher.d.ts +2 -0
- package/dist/phoenix/services/application-spec-project-watcher.js +3 -3
- package/dist/phoenix/services/source-archive.d.ts +1 -0
- package/dist/phoenix/services/source-archive.js +1 -1
- package/dist/phoenix/services/swc.js +1 -1
- package/dist/phoenix/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 +17 -0
- 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/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 +5 -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 +33 -29
- package/schema/domain-spec.json +1115 -209
- package/dist/application-spec/generate-application/code/templates/webhook-implementation.d.ts +0 -1
- package/dist/application-spec/generate-application/code/templates/webhook-implementation.js +0 -7
- package/dist/configurator/ui/configurator-layout/universal/DesktopSidebar.js +0 -16
- /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
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { AccessLevel } from '@salsita-ai/contracts/api';
|
|
1
2
|
import type { OverridesSelectorState, OverridesSelectors } from '../overrides/index.js';
|
|
2
3
|
import type { AccessService, ApplicationAccessInfo } from './types.js';
|
|
3
4
|
/**
|
|
@@ -17,24 +18,28 @@ export declare const requireAccessService: (applicationName: 'configurator' | 'a
|
|
|
17
18
|
export declare const createAccessInfoSelectors: (context: Context) => {
|
|
18
19
|
selectConfiguratorRawAccessInfo: import("@salsita-ai/common/utils").Selector<AccessSelectorState, {
|
|
19
20
|
raw: string;
|
|
21
|
+
access: AccessLevel;
|
|
20
22
|
viewMode: boolean;
|
|
21
23
|
revisionId: string | undefined;
|
|
22
24
|
configurationId: string;
|
|
23
25
|
} | null>;
|
|
24
26
|
selectAdminRawAccessInfo: import("@salsita-ai/common/utils").Selector<AccessSelectorState, {
|
|
25
27
|
raw: string;
|
|
28
|
+
access: AccessLevel;
|
|
26
29
|
viewMode: boolean;
|
|
27
30
|
revisionId: string | undefined;
|
|
28
31
|
configurationId: string;
|
|
29
32
|
} | null>;
|
|
30
33
|
selectConfiguratorAccessInfo: import("@salsita-ai/common/utils").Selector<AccessSelectorState, {
|
|
31
34
|
raw: string;
|
|
35
|
+
access: AccessLevel;
|
|
32
36
|
viewMode: boolean;
|
|
33
37
|
revisionId: string | undefined;
|
|
34
38
|
configurationId: string;
|
|
35
39
|
}>;
|
|
36
40
|
selectAdminAccessInfo: import("@salsita-ai/common/utils").Selector<AccessSelectorState, {
|
|
37
41
|
raw: string;
|
|
42
|
+
access: AccessLevel;
|
|
38
43
|
viewMode: boolean;
|
|
39
44
|
revisionId: string | undefined;
|
|
40
45
|
configurationId: string;
|
|
@@ -47,24 +52,28 @@ export declare const createAccessInfoSelectors: (context: Context) => {
|
|
|
47
52
|
selectAdminConfigurationId: import("@salsita-ai/common/utils").Selector<AccessSelectorState, string>;
|
|
48
53
|
getConfiguratorRawAccessInfo: () => {
|
|
49
54
|
raw: string;
|
|
55
|
+
access: AccessLevel;
|
|
50
56
|
viewMode: boolean;
|
|
51
57
|
revisionId: string | undefined;
|
|
52
58
|
configurationId: string;
|
|
53
59
|
} | null;
|
|
54
60
|
getAdminRawAccessInfo: () => {
|
|
55
61
|
raw: string;
|
|
62
|
+
access: AccessLevel;
|
|
56
63
|
viewMode: boolean;
|
|
57
64
|
revisionId: string | undefined;
|
|
58
65
|
configurationId: string;
|
|
59
66
|
} | null;
|
|
60
67
|
getConfiguratorAccessInfo: () => {
|
|
61
68
|
raw: string;
|
|
69
|
+
access: AccessLevel;
|
|
62
70
|
viewMode: boolean;
|
|
63
71
|
revisionId: string | undefined;
|
|
64
72
|
configurationId: string;
|
|
65
73
|
};
|
|
66
74
|
getAdminAccessInfo: () => {
|
|
67
75
|
raw: string;
|
|
76
|
+
access: AccessLevel;
|
|
68
77
|
viewMode: boolean;
|
|
69
78
|
revisionId: string | undefined;
|
|
70
79
|
configurationId: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{createSelector as e}from"@salsita-ai/common/utils";let
|
|
1
|
+
import{createSelector as e}from"@salsita-ai/common/utils";import{AccessLevel as c}from"@salsita-ai/contracts/api";let i=e=>Error(`Cannot read ${e} access info because valid access is not loaded. Access info is written by the ${e} lifecycle after token validation. Move this read into the loaded ${e} lifecycle.`),n=e=>({accessInfo:e,configurationId:e.configurationId});export const requireAccessService=(e,c)=>{if(null===c)throw i(e);return c};export const createAccessInfoSelectors=o=>{let{getState:r,overridesSelectors:s}=o,t=e.withTypes(),a=t([t.leaf(e=>e.access.configuratorAccessInfo)],e=>e),l=t([t.leaf(e=>e.access.adminAccessInfo)],e=>e),f=t([a],e=>{if(null===e)throw i("configurator");return e}),u=t([l],e=>{if(null===e)throw i("admin");return e}),d=t([a,s.selectAccessService,s.selectAccessLevel],(e,i,o)=>{var r;let s,t,a=i??(null===e?null:n(e));return null===a||null===o?a:(r={configurationId:a.configurationId,...void 0===a.accessInfo.revisionId?{}:{revisionId:a.accessInfo.revisionId},access:o},s=e=>btoa(JSON.stringify(e)).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,""),t=`${s({alg:"none",typ:"JWT"})}.${s(r)}.`,{configurationId:a.configurationId,accessInfo:{raw:t,access:"owner"===o?c.Owner:"read-revision"===o?c.ReadRevision:c.Read,viewMode:"read-revision"===o,revisionId:a.accessInfo.revisionId,configurationId:a.configurationId}})}),g=t([l,s.selectAccessService],(e,c)=>null!==c?c:null===e?null:n(e)),I=t([d],e=>requireAccessService("configurator",e)),v=t([g],e=>requireAccessService("admin",e)),A=t([I],e=>e.configurationId),m=t([v],e=>e.configurationId);return{selectConfiguratorRawAccessInfo:a,selectAdminRawAccessInfo:l,selectConfiguratorAccessInfo:f,selectAdminAccessInfo:u,selectConfiguratorRawAccessService:d,selectAdminRawAccessService:g,selectConfiguratorAccessService:I,selectAdminAccessService:v,selectConfiguratorConfigurationId:A,selectAdminConfigurationId:m,getConfiguratorRawAccessInfo:()=>a(r()),getAdminRawAccessInfo:()=>l(r()),getConfiguratorAccessInfo:()=>f(r()),getAdminAccessInfo:()=>u(r()),getConfiguratorRawAccessService:()=>d(r()),getAdminRawAccessService:()=>g(r()),getConfiguratorAccessService:()=>I(r()),getAdminAccessService:()=>v(r()),getConfiguratorConfigurationId:()=>A(r()),getAdminConfigurationId:()=>m(r())}};
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
+
import { AccessLevel } from '@salsita-ai/contracts/api';
|
|
1
2
|
export declare const decodeAccessInfo: (accessToken: string, configurationId: string) => {
|
|
2
3
|
raw: string;
|
|
4
|
+
access: AccessLevel;
|
|
3
5
|
viewMode: boolean;
|
|
4
6
|
revisionId: string | undefined;
|
|
5
7
|
configurationId: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jwtDecode as
|
|
1
|
+
import{jwtDecode as e}from"jwt-decode";import{AccessLevel as o}from"@salsita-ai/contracts/api";export const decodeAccessInfo=(i,r)=>{try{let c=e(i),n=c.exp;if(void 0!==n&&n<Date.now()/1e3||c.configurationId!==r)return null;return{raw:i,access:c.access,viewMode:c.access===o.ReadRevision,revisionId:c.revisionId,configurationId:c.configurationId}}catch(e){return null}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{createSelector as e}from"@salsita-ai/common/utils";import{Domain as t,createInitialDomainState as n}from"../../core/index.js";import{ActionSystem as o,DimensionSystem as i,NavigationSystem as a,RecipeCookerSystem as s,StoreSystem as r,UndoSystem as c}from"../../domain-context/index.js";import{BlenderProjections as l,CollisionProjections as m,CompositionProjections as d,ConstraintProjections as g,PositionProjections as f,ProjectedEntitiesProjections as u,SnappingProjections as p,ValidationProjections as y}from"../../projections/index.js";import{SketchingProjections as w}from"../../sketching/sketching-projections.js";import{requireAccessService as h}from"../access/index.js";import{prepareActionImplementations as S,prepareDomainExpressions as x}from"../spec/index.js";import{ComponentReader as C}from"./component-reader.js";import{DomainContext as D}from"./domain-context.js";let j=e.withTypes(),v=[],I={},P={role:"admin",data:I},M=e=>{if(null!==e)return e;throw Error("Cannot read the session role and data because the domain session context is not set. The session context is written into the domain runtime by the session lifecycle after authentication. Move this read into the loaded session lifecycle.")};export const createDomainContextSelectors=e=>{let{applicationType:A,getState:R,actions:E,specSelectors:T,accessSelectors:b,webComponentSelectors:$,domainDataSelectors:k,sessionContextSelectors:N,domainServicesSelectors:z,environmentSelectors:L,getExtensionSystems:V}=e,B="configurator"===A?T.selectConfiguratorSpec:T.selectAdminSpec,F="configurator"===A?b.selectConfiguratorRawAccessService:b.selectAdminRawAccessService,W=j.leaf(e=>e.domainContext[A]),_=j([W],e=>e.initializationContext),q=j([_],e=>{if(null===e)throw Error(`Domain lifecycle context is not available for ${A}! Read it from an active domain lifecycle.`);return e}),O=j([W],e=>e.executionMode),U=j([W],e=>e.isInitialized),G=j([B],e=>e.factory),H=j([B],e=>e.expressions),J=j([B],e=>e.actions),K=j([B],e=>e.actionImplementations),Q=j([J,K],S),X=j([B],e=>e.$entityReflections),Y=j([H,X],(e,t)=>x({expressions:e,$entityReflections:t})),Z=j([B],e=>e.modelVersion),ee=j([B],e=>e.aliasMap),et=j([B],e=>e.allowedRootEntityTypes),en=j([B],e=>e.entityReflections),eo=j([B],e=>e.migrate),ei=j([O,$.selectReadonly,F],(e,t,n)=>"finalize"===e?"finalize":h(A,n).accessInfo.viewMode||t?"read":"owner"),ea=j([F],e=>e?.configurationId??null),es="configurator"===A?N.selectSessionContext:j([],()=>P),er=j([es],e=>e?.role??null),ec=j([es],e=>e?.data??null),el=j([j.leaf(e=>e.loadedData)],e=>"configurator"===A?e.configuratorLoadedData:e.adminLoadedData),em=j([el],e=>e?.schemaIdentity??null),ed=j([el,G],(e,t)=>{if(null===e)return"coherent";let n=e.schemaIdentity;return void 0===n?"missing-stamp":n===t?"coherent":"schema-mismatch"}),eg=j([ea,er,ec,em,ed],(e,t,n,o,i)=>null===e||null===t||null===n||null===o||"coherent"!==i?null:{configurationId:e,role:t,schemaIdentity:o,sessionData:n}),ef=j([F,$.selectReadonly],(e,t)=>e?.accessInfo.viewMode===!0||t),eu=j([eg,_,U,ef],(e,t,n,o)=>{let i=null!==e&&null!==t&&n&&t.configurationId===e.configurationId&&t.role===e.role&&t.schemaIdentity===e.schemaIdentity&&t.sessionData===e.sessionData;return{identity:e,isCurrent:i,isViewMode:o}}),ep=j([B],e=>e.componentOptics),ey=j([ep],e=>(e=>{let t=new Map,n=new Map,o=new Map,i=new Map;for(let n of e)for(let e of n.entityTypes){let o=t.get(e);o||(o=new Map,t.set(e,o));let a=o.get(n.componentType);if(a||(a=new Map,o.set(n.componentType,a)),a.has(n.instanceName))throw Error(`Component instance ${n.instanceName} already exists for type ${n.componentType.name} in entity ${e}. This is likely a bug in the component definition! InstanceNames must be unique within an entity and component.`);if(a.set(n.instanceName,n),"dynamic"===n.kind){let t=i.get(e);t||(t=new Map,i.set(e,t));let o=t.get(n.componentType)??[],a=o.find(e=>{var t;return t=n.instanceName,e.startsWith(`${t}_`)||t.startsWith(`${e}_`)});if(a)throw Error(`Cannot register dynamic component instance ${n.instanceName} for component ${n.componentType.name} on entity ${e} because it overlaps with dynamic instance ${a}. Rename one dynamic instance so compound names cannot be ambiguous.`);t.set(n.componentType,[...o,n.instanceName])}}for(let[e,i]of t.entries()){n.set(e,new Set(i.keys()));let t=new Map;for(let[n,a]of(o.set(e,t),i.entries()))t.set(n,new Set(a.keys()))}return{opticMap:t,allComponentTypes:n,allComponentInstanceNames:o,dynamicInstanceNames:i}})(e)),ew=j([ey,Y,et],(e,t,n)=>({componentReaderIndexes:e,domainExpressions:t,allowedRootEntityTypes:n})),eh=j([B],e=>e.navigationStates),eS=j([B],e=>e.viewStates),ex="configurator"===A?j([T.selectConfiguratorSpec],e=>e.toolStates):j([],()=>v),eC="configurator"===A?j([T.selectConfiguratorSpec],e=>e.exportStates):j([],()=>v),eD="configurator"===A?j([T.selectConfiguratorSpec],e=>e.createTransformers):j([],()=>void 0),ej=j([el],e=>{if(null===e)throw Error(`Loaded data is not available for ${A}! Loaded data is written after the configuration fetch succeeds and before the domain context initialization starts.`);return e}),ev=j([ej,G],(e,t)=>n(t.validateAndMigrateState(e.initialEntities,e.modelVersion),e.rootEntityType)),eI="configurator"===A?k.selectConfiguratorFrontendData:k.selectAdminFrontendData,eP="configurator"===A?k.selectConfiguratorBackendData:k.selectAdminBackendData,eM="configurator"===A?k.selectConfiguratorPublishedData:k.selectAdminPublishedData,eA="configurator"===A?j([N.selectSessionContext],e=>M(e).role):j([],()=>"admin"),eR="configurator"===A?j([N.selectSessionContext],e=>M(e).data):j([],()=>I),eE=j([ea,ei,eA,eR,ej],(e,t,n,o,i)=>({configurationId:e,mode:t,role:n,schemaIdentity:i.schemaIdentity,sessionData:o})),eT=j([q],e=>e.mode),eb=j([q],e=>{let t=e.configurationId;if(null===t)throw Error(`Configuration id is not available for ${A}! Read it from an active interactive domain lifecycle.`);return t}),e$=j([q],e=>e.role),ek=j([q],e=>e.sessionData),eN=j([eT,e$,ek,eI,eP,eM,eo],(e,t,n,o,i,a,s)=>({mode:e,role:t,sessionData:n,frontendData:o,backendData:i,publishedData:a,migrate:s,domain:eL,componentReader:eV,positionProjections:eq,sketchingProjections:e_,collisionProjections:eO,constraintProjections:eG,snappingProjections:eU,projectedEntitiesProjections:eH})),ez={selectApplicationSpec:B,selectRawAccessService:F,selectDomainContextState:W,selectInitializationContext:_,selectActiveInitializationContext:q,selectExecutionMode:O,selectIsInitialized:U,selectFactory:G,selectSpecExpressions:H,select$SpecEntityReflections:X,selectDomainExpressions:Y,selectModelVersion:Z,selectAliasMap:ee,selectAllowedRootEntityTypes:et,selectEntityReflections:en,selectMigrate:eo,selectLatestMode:ei,selectLatestConfigurationId:ea,selectLatestSessionContext:es,selectLatestRoleOrNull:er,selectLatestSessionDataOrNull:ec,selectLatestSchemaIdentity:em,selectSchemaCoherence:ed,selectInitializationIdentity:eg,selectIsViewMode:ef,selectInitializationState:eu,selectComponentOptics:ep,selectComponentReaderIndexes:ey,selectStoreRuntimeDependencies:ew,selectNavigationStates:eh,selectViewStates:eS,selectToolStates:ex,selectExportStates:eC,selectCreateTransformers:eD,selectLatestLoadedData:el,selectLoadedData:ej,selectInitialDomainState:ev,selectFrontendData:eI,selectBackendData:eP,selectPublishedData:eM,selectLatestRole:eA,selectLatestSessionData:eR,selectNextInitializationContext:eE,selectActiveMode:eT,selectActiveConfigurationId:eb,selectActiveRole:e$,selectActiveSessionData:ek,selectExpressionContext:eN,getInitializationContext:()=>_(R()),getInitializationState:()=>eu(R()),getNextInitializationContext:()=>eE(R()),getLatestLoadedData:()=>el(R()),getSchemaCoherence:()=>ed(R()),getActiveConfigurationId:()=>eb(R()),getFactory:()=>G(R()),getDomainExpressions:()=>Y(R()),getActionDefinitions:()=>J(R()),getActionImplementations:()=>Q(R()),getModelVersion:()=>Z(R()),getAliasMap:()=>ee(R()),getAllowedRootEntityTypes:()=>et(R()),getEntityReflections:()=>en(R()),getMigrate:()=>eo(R()),getActiveMode:()=>eT(R()),getIsInitialized:()=>U(R()),getComponentReaderIndexes:()=>ey(R()),getStoreRuntimeDependencies:()=>ew(R()),getNavigationStates:()=>eh(R()),getViewStates:()=>eS(R()),getToolStates:()=>ex(R()),getExportStates:()=>eC(R()),getCreateTransformers:()=>eD(R()),getLoadedData:()=>ej(R()),getInitialDomainState:()=>ev(R()),getFrontendData:()=>eI(R()),getBackendData:()=>eP(R()),getPublishedData:()=>eM(R()),getActiveRole:()=>e$(R()),getActiveSessionData:()=>ek(R()),getDomain:()=>eL,getComponentReader:()=>eV,getCompositionProjections:()=>eB,getDimensionSystem:()=>eF,getValidationProjections:()=>eW,getSketchingProjections:()=>e_,getPositionProjections:()=>eq,getCollisionProjections:()=>eO,getSnappingProjections:()=>eU,getConstraintProjections:()=>eG,getProjectedEntitiesProjections:()=>eH,getStoreSystem:()=>eJ,getNavigationSystem:()=>eK,getUndoSystem:()=>eQ,getRecipeCookerSystem:()=>eX,getActionSystem:()=>eY,getBlenderProjections:()=>eZ,getExpressionContext:()=>eN(R()),getDomainSystems:function(){return e0},getDomainContext:function(){return e1}},eL=new t({selectors:ez}),eV=new C({selectors:ez}),eB=new d({selectors:ez}),eF=new i({selectors:ez}),eW=new y({selectors:ez}),e_=new w({selectors:ez}),eq=new f({selectors:ez}),eO=new m({selectors:ez}),eU=new p({selectors:ez}),eG=new g({selectors:ez}),eH=new u({selectors:ez}),eJ=new r({selectors:ez,domainServicesSelectors:z,environmentSelectors:L}),eK=new a({selectors:ez,domainServicesSelectors:z}),eQ=new c({selectors:ez}),eX=new s({selectors:ez}),eY=new o({selectors:ez}),eZ=new l({selectors:ez,domainServicesSelectors:z}),e0={domainContextSelectors:ez,domain:eL,componentReader:eV,compositionProjections:eB,blenderProjections:eZ,validationProjections:eW,storeSystem:eJ,navigationSystem:eK,dimensionSystem:eF,undoSystem:eQ,recipeCooker:eX,actionSystem:eY,sketchingProjections:e_,collisionProjections:eO,positionProjections:eq,snappingProjections:eU,projectedEntitiesProjections:eH,constraintProjections:eG},e1=new D({selectors:ez,actions:E,getExtensionSystems:V});return ez};
|
|
1
|
+
import{createSelector as e}from"@salsita-ai/common/utils";import{Domain as t,createInitialDomainState as n}from"../../core/index.js";import{ActionSystem as o,DimensionSystem as i,NavigationSystem as a,RecipeCookerSystem as s,StoreSystem as r,UndoSystem as c}from"../../domain-context/index.js";import{BlenderProjections as l,CollisionProjections as m,CompositionProjections as d,ConstraintProjections as g,PositionProjections as f,ProjectedEntitiesProjections as u,SnappingProjections as p,ValidationProjections as y}from"../../projections/index.js";import{SketchingProjections as w}from"../../sketching/sketching-projections.js";import{requireAccessService as h}from"../access/index.js";import{prepareActionImplementations as S,prepareDomainExpressions as x}from"../spec/index.js";import{ComponentReader as C}from"./component-reader.js";import{DomainContext as D}from"./domain-context.js";let j=e.withTypes(),I=[],v={},P={role:"admin",data:v},M=e=>{if(null!==e)return e;throw Error("Cannot read the session role and data because the domain session context is not set. The session context is written into the domain runtime by the session lifecycle after authentication. Move this read into the loaded session lifecycle.")};export const createDomainContextSelectors=e=>{let{applicationType:A,getState:R,actions:E,specSelectors:T,accessSelectors:b,webComponentSelectors:$,domainDataSelectors:k,sessionContextSelectors:N,domainServicesSelectors:z,environmentSelectors:L,getExtensionSystems:V}=e,B="configurator"===A?T.selectConfiguratorSpec:T.selectAdminSpec,F="configurator"===A?b.selectConfiguratorRawAccessService:b.selectAdminRawAccessService,W=j.leaf(e=>e.domainContext[A]),_=j([W],e=>e.initializationContext),q=j([_],e=>{if(null===e)throw Error(`Domain lifecycle context is not available for ${A}! Read it from an active domain lifecycle.`);return e}),O=j([W],e=>e.executionMode),U=j([W],e=>e.isInitialized),G=j([B],e=>e.factory),H=j([B],e=>e.expressions),J=j([B],e=>e.actions),K=j([B],e=>e.actionImplementations),Q=j([J,K],S),X=j([B],e=>e.$entityReflections),Y=j([H,X],(e,t)=>x({expressions:e,$entityReflections:t})),Z=j([B],e=>e.modelVersion),ee=j([B],e=>e.aliasMap),et=j([B],e=>e.allowedRootEntityTypes),en=j([B],e=>e.entityReflections),eo=j([B],e=>e.migrate),ei=j([O,$.selectReadonly,F],(e,t,n)=>"finalize"===e?"finalize":h(A,n).accessInfo.viewMode||t?"read":"owner"),ea=j([F],e=>e?.configurationId??null),es="configurator"===A?N.selectSessionContext:j([],()=>P),er=j([es],e=>e?.role??null),ec=j([es],e=>e?.data??null),el=j([j.leaf(e=>e.loadedData)],e=>"configurator"===A?e.configuratorLoadedData:e.adminLoadedData),em=j([el],e=>e?.schemaIdentity??null),ed=j([el,G],(e,t)=>{if(null===e)return"coherent";let n=e.schemaIdentity;return void 0===n?"missing-stamp":n===t?"coherent":"schema-mismatch"}),eg=j([ea,er,ec,em,ed,F],(e,t,n,o,i,a)=>null===e||null===a||null===t||null===n||null===o||"coherent"!==i?null:{access:a.accessInfo.access,configurationId:e,role:t,schemaIdentity:o,sessionData:n}),ef=j([F,$.selectReadonly],(e,t)=>e?.accessInfo.viewMode===!0||t),eu=j([eg,_,U,ef],(e,t,n,o)=>{let i=null!==e&&null!==t&&n&&t.access===e.access&&t.configurationId===e.configurationId&&t.role===e.role&&t.schemaIdentity===e.schemaIdentity&&t.sessionData===e.sessionData;return{identity:e,isCurrent:i,isViewMode:o}}),ep=j([B],e=>e.componentOptics),ey=j([ep],e=>(e=>{let t=new Map,n=new Map,o=new Map,i=new Map;for(let n of e)for(let e of n.entityTypes){let o=t.get(e);o||(o=new Map,t.set(e,o));let a=o.get(n.componentType);if(a||(a=new Map,o.set(n.componentType,a)),a.has(n.instanceName))throw Error(`Component instance ${n.instanceName} already exists for type ${n.componentType.name} in entity ${e}. This is likely a bug in the component definition! InstanceNames must be unique within an entity and component.`);if(a.set(n.instanceName,n),"dynamic"===n.kind){let t=i.get(e);t||(t=new Map,i.set(e,t));let o=t.get(n.componentType)??[],a=o.find(e=>{var t;return t=n.instanceName,e.startsWith(`${t}_`)||t.startsWith(`${e}_`)});if(a)throw Error(`Cannot register dynamic component instance ${n.instanceName} for component ${n.componentType.name} on entity ${e} because it overlaps with dynamic instance ${a}. Rename one dynamic instance so compound names cannot be ambiguous.`);t.set(n.componentType,[...o,n.instanceName])}}for(let[e,i]of t.entries()){n.set(e,new Set(i.keys()));let t=new Map;for(let[n,a]of(o.set(e,t),i.entries()))t.set(n,new Set(a.keys()))}return{opticMap:t,allComponentTypes:n,allComponentInstanceNames:o,dynamicInstanceNames:i}})(e)),ew=j([ey,Y,et],(e,t,n)=>({componentReaderIndexes:e,domainExpressions:t,allowedRootEntityTypes:n})),eh=j([B],e=>e.navigationStates),eS=j([B],e=>e.viewStates),ex="configurator"===A?j([T.selectConfiguratorSpec],e=>e.toolStates):j([],()=>I),eC="configurator"===A?j([T.selectConfiguratorSpec],e=>e.exportStates):j([],()=>I),eD="configurator"===A?j([T.selectConfiguratorSpec],e=>e.createTransformers):j([],()=>void 0),ej=j([el],e=>{if(null===e)throw Error(`Loaded data is not available for ${A}! Loaded data is written after the configuration fetch succeeds and before the domain context initialization starts.`);return e}),eI=j([ej,G],(e,t)=>n(t.validateAndMigrateState(e.initialEntities,e.modelVersion),e.rootEntityType)),ev="configurator"===A?k.selectConfiguratorFrontendData:k.selectAdminFrontendData,eP="configurator"===A?k.selectConfiguratorBackendData:k.selectAdminBackendData,eM="configurator"===A?k.selectConfiguratorPublishedData:k.selectAdminPublishedData,eA="configurator"===A?j([N.selectSessionContext],e=>M(e).role):j([],()=>"admin"),eR="configurator"===A?j([N.selectSessionContext],e=>M(e).data):j([],()=>v),eE=j([ea,ei,eA,eR,ej,F],(e,t,n,o,i,a)=>({access:a?.accessInfo.access??null,configurationId:e,mode:t,role:n,schemaIdentity:i.schemaIdentity,sessionData:o})),eT=j([q],e=>e.mode),eb=j([q],e=>{let t=e.configurationId;if(null===t)throw Error(`Configuration id is not available for ${A}! Read it from an active interactive domain lifecycle.`);return t}),e$=j([q],e=>e.role),ek=j([q],e=>e.sessionData),eN=j([eT,e$,ek,ev,eP,eM,eo],(e,t,n,o,i,a,s)=>({mode:e,role:t,sessionData:n,frontendData:o,backendData:i,publishedData:a,migrate:s,domain:eL,componentReader:eV,positionProjections:eq,sketchingProjections:e_,collisionProjections:eO,constraintProjections:eG,snappingProjections:eU,projectedEntitiesProjections:eH})),ez={selectApplicationSpec:B,selectRawAccessService:F,selectDomainContextState:W,selectInitializationContext:_,selectActiveInitializationContext:q,selectExecutionMode:O,selectIsInitialized:U,selectFactory:G,selectSpecExpressions:H,select$SpecEntityReflections:X,selectDomainExpressions:Y,selectModelVersion:Z,selectAliasMap:ee,selectAllowedRootEntityTypes:et,selectEntityReflections:en,selectMigrate:eo,selectLatestMode:ei,selectLatestConfigurationId:ea,selectLatestSessionContext:es,selectLatestRoleOrNull:er,selectLatestSessionDataOrNull:ec,selectLatestSchemaIdentity:em,selectSchemaCoherence:ed,selectInitializationIdentity:eg,selectIsViewMode:ef,selectInitializationState:eu,selectComponentOptics:ep,selectComponentReaderIndexes:ey,selectStoreRuntimeDependencies:ew,selectNavigationStates:eh,selectViewStates:eS,selectToolStates:ex,selectExportStates:eC,selectCreateTransformers:eD,selectLatestLoadedData:el,selectLoadedData:ej,selectInitialDomainState:eI,selectFrontendData:ev,selectBackendData:eP,selectPublishedData:eM,selectLatestRole:eA,selectLatestSessionData:eR,selectNextInitializationContext:eE,selectActiveMode:eT,selectActiveConfigurationId:eb,selectActiveRole:e$,selectActiveSessionData:ek,selectExpressionContext:eN,getInitializationContext:()=>_(R()),getInitializationState:()=>eu(R()),getNextInitializationContext:()=>eE(R()),getLatestLoadedData:()=>el(R()),getSchemaCoherence:()=>ed(R()),getActiveConfigurationId:()=>eb(R()),getFactory:()=>G(R()),getDomainExpressions:()=>Y(R()),getActionDefinitions:()=>J(R()),getActionImplementations:()=>Q(R()),getModelVersion:()=>Z(R()),getAliasMap:()=>ee(R()),getAllowedRootEntityTypes:()=>et(R()),getEntityReflections:()=>en(R()),getMigrate:()=>eo(R()),getActiveMode:()=>eT(R()),getIsInitialized:()=>U(R()),getComponentReaderIndexes:()=>ey(R()),getStoreRuntimeDependencies:()=>ew(R()),getNavigationStates:()=>eh(R()),getViewStates:()=>eS(R()),getToolStates:()=>ex(R()),getExportStates:()=>eC(R()),getCreateTransformers:()=>eD(R()),getLoadedData:()=>ej(R()),getInitialDomainState:()=>eI(R()),getFrontendData:()=>ev(R()),getBackendData:()=>eP(R()),getPublishedData:()=>eM(R()),getActiveRole:()=>e$(R()),getActiveSessionData:()=>ek(R()),getDomain:()=>eL,getComponentReader:()=>eV,getCompositionProjections:()=>eB,getDimensionSystem:()=>eF,getValidationProjections:()=>eW,getSketchingProjections:()=>e_,getPositionProjections:()=>eq,getCollisionProjections:()=>eO,getSnappingProjections:()=>eU,getConstraintProjections:()=>eG,getProjectedEntitiesProjections:()=>eH,getStoreSystem:()=>eJ,getNavigationSystem:()=>eK,getUndoSystem:()=>eQ,getRecipeCookerSystem:()=>eX,getActionSystem:()=>eY,getBlenderProjections:()=>eZ,getExpressionContext:()=>eN(R()),getDomainSystems:function(){return e0},getDomainContext:function(){return e1}},eL=new t({selectors:ez}),eV=new C({selectors:ez}),eB=new d({selectors:ez}),eF=new i({selectors:ez}),eW=new y({selectors:ez}),e_=new w({selectors:ez}),eq=new f({selectors:ez}),eO=new m({selectors:ez}),eU=new p({selectors:ez}),eG=new g({selectors:ez}),eH=new u({selectors:ez}),eJ=new r({selectors:ez,domainServicesSelectors:z,environmentSelectors:L}),eK=new a({selectors:ez,domainServicesSelectors:z}),eQ=new c({selectors:ez}),eX=new s({selectors:ez}),eY=new o({selectors:ez}),eZ=new l({selectors:ez,domainServicesSelectors:z}),e0={domainContextSelectors:ez,domain:eL,componentReader:eV,compositionProjections:eB,blenderProjections:eZ,validationProjections:eW,storeSystem:eJ,navigationSystem:eK,dimensionSystem:eF,undoSystem:eQ,recipeCooker:eX,actionSystem:eY,sketchingProjections:e_,collisionProjections:eO,positionProjections:eq,snappingProjections:eU,projectedEntitiesProjections:eH,constraintProjections:eG},e1=new D({selectors:ez,actions:E,getExtensionSystems:V});return ez};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { SessionRole } from '@salsita-ai/contracts/api';
|
|
1
|
+
import type { AccessLevel, SessionRole } from '@salsita-ai/contracts/api';
|
|
2
2
|
import type { AnyDomainFactory, DomainMode } from '../../core/index.js';
|
|
3
3
|
/** A retained system that refreshes its configuration-owned state on every initialization. */
|
|
4
4
|
export interface InitializableSystem {
|
|
@@ -26,6 +26,7 @@ export type DomainExecutionMode = 'interactive' | 'finalize';
|
|
|
26
26
|
export type SchemaCoherence = 'coherent' | 'schema-mismatch' | 'missing-stamp';
|
|
27
27
|
/** Runtime inputs that identify the interactive configuration rendered by a lifecycle host. */
|
|
28
28
|
export interface DomainContextInitializationIdentity {
|
|
29
|
+
readonly access: AccessLevel;
|
|
29
30
|
readonly configurationId: string;
|
|
30
31
|
readonly role: SessionRole;
|
|
31
32
|
readonly schemaIdentity: AnyDomainFactory;
|
|
@@ -33,6 +34,8 @@ export interface DomainContextInitializationIdentity {
|
|
|
33
34
|
}
|
|
34
35
|
/** Inputs captured by the latest successful domain-context initialization. */
|
|
35
36
|
export interface DomainContextInitializationContext {
|
|
37
|
+
/** Token access captured with the session inputs; finalization has no interactive access. */
|
|
38
|
+
readonly access: AccessLevel | null;
|
|
36
39
|
/** Finalization has no interactive access and therefore no configuration id. */
|
|
37
40
|
readonly configurationId: string | null;
|
|
38
41
|
readonly mode: DomainMode;
|
|
@@ -272,24 +272,28 @@ export declare function createDomainRuntimeSlices<State extends DomainRuntimeSta
|
|
|
272
272
|
access: {
|
|
273
273
|
selectConfiguratorRawAccessInfo: import("@salsita-ai/common/utils").Selector<import("./index.js").AccessSelectorState, {
|
|
274
274
|
raw: string;
|
|
275
|
+
access: import("@salsita-ai/contracts/api").AccessLevel;
|
|
275
276
|
viewMode: boolean;
|
|
276
277
|
revisionId: string | undefined;
|
|
277
278
|
configurationId: string;
|
|
278
279
|
} | null>;
|
|
279
280
|
selectAdminRawAccessInfo: import("@salsita-ai/common/utils").Selector<import("./index.js").AccessSelectorState, {
|
|
280
281
|
raw: string;
|
|
282
|
+
access: import("@salsita-ai/contracts/api").AccessLevel;
|
|
281
283
|
viewMode: boolean;
|
|
282
284
|
revisionId: string | undefined;
|
|
283
285
|
configurationId: string;
|
|
284
286
|
} | null>;
|
|
285
287
|
selectConfiguratorAccessInfo: import("@salsita-ai/common/utils").Selector<import("./index.js").AccessSelectorState, {
|
|
286
288
|
raw: string;
|
|
289
|
+
access: import("@salsita-ai/contracts/api").AccessLevel;
|
|
287
290
|
viewMode: boolean;
|
|
288
291
|
revisionId: string | undefined;
|
|
289
292
|
configurationId: string;
|
|
290
293
|
}>;
|
|
291
294
|
selectAdminAccessInfo: import("@salsita-ai/common/utils").Selector<import("./index.js").AccessSelectorState, {
|
|
292
295
|
raw: string;
|
|
296
|
+
access: import("@salsita-ai/contracts/api").AccessLevel;
|
|
293
297
|
viewMode: boolean;
|
|
294
298
|
revisionId: string | undefined;
|
|
295
299
|
configurationId: string;
|
|
@@ -302,24 +306,28 @@ export declare function createDomainRuntimeSlices<State extends DomainRuntimeSta
|
|
|
302
306
|
selectAdminConfigurationId: import("@salsita-ai/common/utils").Selector<import("./index.js").AccessSelectorState, string>;
|
|
303
307
|
getConfiguratorRawAccessInfo: () => {
|
|
304
308
|
raw: string;
|
|
309
|
+
access: import("@salsita-ai/contracts/api").AccessLevel;
|
|
305
310
|
viewMode: boolean;
|
|
306
311
|
revisionId: string | undefined;
|
|
307
312
|
configurationId: string;
|
|
308
313
|
} | null;
|
|
309
314
|
getAdminRawAccessInfo: () => {
|
|
310
315
|
raw: string;
|
|
316
|
+
access: import("@salsita-ai/contracts/api").AccessLevel;
|
|
311
317
|
viewMode: boolean;
|
|
312
318
|
revisionId: string | undefined;
|
|
313
319
|
configurationId: string;
|
|
314
320
|
} | null;
|
|
315
321
|
getConfiguratorAccessInfo: () => {
|
|
316
322
|
raw: string;
|
|
323
|
+
access: import("@salsita-ai/contracts/api").AccessLevel;
|
|
317
324
|
viewMode: boolean;
|
|
318
325
|
revisionId: string | undefined;
|
|
319
326
|
configurationId: string;
|
|
320
327
|
};
|
|
321
328
|
getAdminAccessInfo: () => {
|
|
322
329
|
raw: string;
|
|
330
|
+
access: import("@salsita-ai/contracts/api").AccessLevel;
|
|
323
331
|
viewMode: boolean;
|
|
324
332
|
revisionId: string | undefined;
|
|
325
333
|
configurationId: string;
|
|
@@ -862,24 +870,28 @@ export declare const createDomainRuntime: (props: Omit<Props<DomainRuntimeState>
|
|
|
862
870
|
access: {
|
|
863
871
|
selectConfiguratorRawAccessInfo: import("@salsita-ai/common/utils").Selector<import("./index.js").AccessSelectorState, {
|
|
864
872
|
raw: string;
|
|
873
|
+
access: import("@salsita-ai/contracts/api").AccessLevel;
|
|
865
874
|
viewMode: boolean;
|
|
866
875
|
revisionId: string | undefined;
|
|
867
876
|
configurationId: string;
|
|
868
877
|
} | null>;
|
|
869
878
|
selectAdminRawAccessInfo: import("@salsita-ai/common/utils").Selector<import("./index.js").AccessSelectorState, {
|
|
870
879
|
raw: string;
|
|
880
|
+
access: import("@salsita-ai/contracts/api").AccessLevel;
|
|
871
881
|
viewMode: boolean;
|
|
872
882
|
revisionId: string | undefined;
|
|
873
883
|
configurationId: string;
|
|
874
884
|
} | null>;
|
|
875
885
|
selectConfiguratorAccessInfo: import("@salsita-ai/common/utils").Selector<import("./index.js").AccessSelectorState, {
|
|
876
886
|
raw: string;
|
|
887
|
+
access: import("@salsita-ai/contracts/api").AccessLevel;
|
|
877
888
|
viewMode: boolean;
|
|
878
889
|
revisionId: string | undefined;
|
|
879
890
|
configurationId: string;
|
|
880
891
|
}>;
|
|
881
892
|
selectAdminAccessInfo: import("@salsita-ai/common/utils").Selector<import("./index.js").AccessSelectorState, {
|
|
882
893
|
raw: string;
|
|
894
|
+
access: import("@salsita-ai/contracts/api").AccessLevel;
|
|
883
895
|
viewMode: boolean;
|
|
884
896
|
revisionId: string | undefined;
|
|
885
897
|
configurationId: string;
|
|
@@ -892,24 +904,28 @@ export declare const createDomainRuntime: (props: Omit<Props<DomainRuntimeState>
|
|
|
892
904
|
selectAdminConfigurationId: import("@salsita-ai/common/utils").Selector<import("./index.js").AccessSelectorState, string>;
|
|
893
905
|
getConfiguratorRawAccessInfo: () => {
|
|
894
906
|
raw: string;
|
|
907
|
+
access: import("@salsita-ai/contracts/api").AccessLevel;
|
|
895
908
|
viewMode: boolean;
|
|
896
909
|
revisionId: string | undefined;
|
|
897
910
|
configurationId: string;
|
|
898
911
|
} | null;
|
|
899
912
|
getAdminRawAccessInfo: () => {
|
|
900
913
|
raw: string;
|
|
914
|
+
access: import("@salsita-ai/contracts/api").AccessLevel;
|
|
901
915
|
viewMode: boolean;
|
|
902
916
|
revisionId: string | undefined;
|
|
903
917
|
configurationId: string;
|
|
904
918
|
} | null;
|
|
905
919
|
getConfiguratorAccessInfo: () => {
|
|
906
920
|
raw: string;
|
|
921
|
+
access: import("@salsita-ai/contracts/api").AccessLevel;
|
|
907
922
|
viewMode: boolean;
|
|
908
923
|
revisionId: string | undefined;
|
|
909
924
|
configurationId: string;
|
|
910
925
|
};
|
|
911
926
|
getAdminAccessInfo: () => {
|
|
912
927
|
raw: string;
|
|
928
|
+
access: import("@salsita-ai/contracts/api").AccessLevel;
|
|
913
929
|
viewMode: boolean;
|
|
914
930
|
revisionId: string | undefined;
|
|
915
931
|
configurationId: string;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { type ImplementationError } from './implementation-error.js';
|
|
2
|
+
/**
|
|
3
|
+
* Gathers the implementation errors of one application start. Checks that do not depend on each
|
|
4
|
+
* other run through `attempt`, so that the failure of one does not hide the failures of the others.
|
|
5
|
+
*/
|
|
6
|
+
export interface ImplementationErrorCollector {
|
|
7
|
+
/**
|
|
8
|
+
* Runs one independent check. An implementation error it throws is recorded and `fallback` is
|
|
9
|
+
* returned, so the checks after it still run. Anything else it throws propagates.
|
|
10
|
+
*/
|
|
11
|
+
readonly attempt: <T>(check: () => T, fallback: T) => T;
|
|
12
|
+
readonly add: (error: ImplementationError) => void;
|
|
13
|
+
/**
|
|
14
|
+
* Throws the recorded errors as one {@link ImplementationErrors}, in the order they were
|
|
15
|
+
* recorded. Does nothing when there are none.
|
|
16
|
+
*/
|
|
17
|
+
readonly throwIfAny: () => void;
|
|
18
|
+
}
|
|
19
|
+
export declare const createImplementationErrorCollector: () => ImplementationErrorCollector;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{isImplementationError as r}from"./implementation-error.js";import{ImplementationErrors as t,isImplementationErrors as e}from"./implementation-errors.js";export const createImplementationErrorCollector=()=>{let o=[],n=r=>{o.push(r)};return{add:n,attempt:(t,o)=>{try{return t()}catch(t){if(e(t))return t.errors.forEach(n),o;if(r(t))return n(t),o;throw t}},throwIfAny:()=>{if(o.length>0)throw new t(o)}}};
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* What kind of mistake an {@link ImplementationError} reports. A host that shows the error, such as
|
|
3
|
+
* a webhook log, reads the code instead of parsing the message.
|
|
4
|
+
*
|
|
5
|
+
* - `MISSING_EXPORT`: a convention file exports nothing where its folder requires an export.
|
|
6
|
+
* - `INVALID_EXPORT`: a convention file exports a value that does not match its folder's contract.
|
|
7
|
+
* - `MISSING_IMPLEMENTATION`: the spec declares something that no project file implements.
|
|
8
|
+
* - `DUPLICATE_DEFINITION`: two files define what only one may define.
|
|
9
|
+
* - `INVALID_CONFIGURATION`: the application's configuration is incomplete or contradictory.
|
|
10
|
+
* - `STARTUP_FAILED`: project or SDK code threw while the application was starting.
|
|
11
|
+
*/
|
|
12
|
+
export type ImplementationErrorCode = 'MISSING_EXPORT' | 'INVALID_EXPORT' | 'MISSING_IMPLEMENTATION' | 'DUPLICATE_DEFINITION' | 'INVALID_CONFIGURATION' | 'STARTUP_FAILED';
|
|
13
|
+
/** The parts an {@link ImplementationError} is made of. Its message is built from them. */
|
|
14
|
+
export interface ImplementationErrorProps {
|
|
15
|
+
readonly code: ImplementationErrorCode;
|
|
16
|
+
/** Project-relative path of the file to fix, or `null` when the mistake belongs to no single file. */
|
|
17
|
+
readonly origin: string | null;
|
|
18
|
+
/** What went wrong, without the file name and without a full stop. */
|
|
19
|
+
readonly problem: string;
|
|
20
|
+
/** What the SDK requires at that place, when the mistake is a wrong value. */
|
|
21
|
+
readonly expected?: string;
|
|
22
|
+
/** What it found instead. It is part of the message only together with `expected`. */
|
|
23
|
+
readonly received?: string;
|
|
24
|
+
/** What the developer can do to fix it, as one or more full sentences. */
|
|
25
|
+
readonly fix: string;
|
|
26
|
+
/** What was thrown, when the error reports a failure of other code. */
|
|
27
|
+
readonly cause?: unknown;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* A mistake in a project's implementation that stops its application from starting: a convention
|
|
31
|
+
* file with the wrong export, a definition made twice, a project file that throws.
|
|
32
|
+
*
|
|
33
|
+
* The checks the domain runtime runs on a project's files throw it, so that every host of the
|
|
34
|
+
* runtime (the web component, the editor, a webhook) can tell it from a defect of its own and report
|
|
35
|
+
* it in its own medium. `message` is the whole report as one text; the fields hold its parts.
|
|
36
|
+
*/
|
|
37
|
+
export declare class ImplementationError extends Error {
|
|
38
|
+
readonly code: ImplementationErrorCode;
|
|
39
|
+
readonly origin: string | null;
|
|
40
|
+
readonly problem: string;
|
|
41
|
+
readonly expected: string | null;
|
|
42
|
+
readonly received: string | null;
|
|
43
|
+
readonly fix: string;
|
|
44
|
+
constructor(props: ImplementationErrorProps);
|
|
45
|
+
}
|
|
46
|
+
export declare const isImplementationError: (error: unknown) => error is ImplementationError;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export class ImplementationError extends Error{code;origin;problem;expected;received;fix;constructor(e){let i,r,o;super((i=null===e.origin?"":` in ${e.origin}`,r=void 0===e.received?"":`, but got ${e.received}`,o=void 0===e.expected?"":`: expected ${e.expected}${r}`,`${e.problem}${i}${o}. ${e.fix}`),void 0===e.cause?void 0:{cause:e.cause}),this.name="ImplementationError",this.code=e.code,this.origin=e.origin,this.problem=e.problem,this.expected=e.expected??null,this.received=e.received??null,this.fix=e.fix}}export const isImplementationError=e=>e instanceof ImplementationError;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { ImplementationError } from './implementation-error.js';
|
|
2
|
+
/**
|
|
3
|
+
* Every {@link ImplementationError} one start of an application found, reported together, so that a
|
|
4
|
+
* developer with four wrong files reads four errors instead of fixing them one reload at a time.
|
|
5
|
+
*
|
|
6
|
+
* The message of a list with one error is that error's message. The message of a longer list is a
|
|
7
|
+
* headline with the count, followed by one numbered line per error in the order of `errors`.
|
|
8
|
+
*/
|
|
9
|
+
export declare class ImplementationErrors extends Error {
|
|
10
|
+
readonly errors: readonly ImplementationError[];
|
|
11
|
+
constructor(errors: readonly ImplementationError[]);
|
|
12
|
+
}
|
|
13
|
+
export declare const isImplementationErrors: (error: unknown) => error is ImplementationErrors;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export class ImplementationErrors extends Error{errors;constructor(r){super((r=>{let[e]=r;return 1===r.length&&e?e.message:[`The application cannot start: ${r.length} implementation errors were found.`,...r.map((r,e)=>`${e+1}. ${r.message}`)].join("\n")})(r)),this.name="ImplementationErrors",this.errors=r}}export const isImplementationErrors=r=>r instanceof ImplementationErrors;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { type ImplementationErrorCode, type ImplementationErrorProps, ImplementationError, isImplementationError, } from './implementation-error.js';
|
|
2
|
+
export { type ImplementationErrorCollector, createImplementationErrorCollector, } from './implementation-error-collector.js';
|
|
3
|
+
export { ImplementationErrors, isImplementationErrors } from './implementation-errors.js';
|
|
4
|
+
export { type StartupStage, toImplementationErrors } from './to-implementation-errors.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export{ImplementationError,isImplementationError}from"./implementation-error.js";export{createImplementationErrorCollector}from"./implementation-error-collector.js";export{ImplementationErrors,isImplementationErrors}from"./implementation-errors.js";export{toImplementationErrors}from"./to-implementation-errors.js";
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ImplementationErrors } from './implementation-errors.js';
|
|
2
|
+
/** The step of an application start during which a failure that the SDK did not raise itself was caught. */
|
|
3
|
+
export type StartupStage = 'import' | 'initialize' | 'render';
|
|
4
|
+
/**
|
|
5
|
+
* Turns whatever stopped an application from starting into a list of implementation errors, so that
|
|
6
|
+
* a host handles one shape. A list is passed through and a single implementation error becomes a
|
|
7
|
+
* list of one. Anything else, such as a project file that throws while it loads, becomes one
|
|
8
|
+
* `STARTUP_FAILED` error that names the stage and keeps what was thrown as its `cause`.
|
|
9
|
+
*/
|
|
10
|
+
export declare const toImplementationErrors: (error: unknown, stage: StartupStage) => ImplementationErrors;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{ImplementationError as e,isImplementationError as i}from"./implementation-error.js";import{ImplementationErrors as t,isImplementationErrors as r}from"./implementation-errors.js";let n={import:"while its code was loading",initialize:"while its runtime was initializing",render:"while it was rendering"};export const toImplementationErrors=(o,a)=>r(o)?o:i(o)?new t([o]):new t([new e({code:"STARTUP_FAILED",origin:null,problem:`The application failed ${n[a]}: ${o instanceof Error?o.message:String(o)}`,fix:"Read the stack trace of the cause to find the file that threw, and fix the code it points to.",cause:o})]);
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export * from './domain-runtime.js';
|
|
2
2
|
export * from './domain-context/index.js';
|
|
3
3
|
export * from './domain-services/index.js';
|
|
4
|
+
export { type ImplementationErrorCode, type ImplementationErrorProps, type StartupStage, ImplementationError, ImplementationErrors, isImplementationError, isImplementationErrors, toImplementationErrors, } from './errors/index.js';
|
|
4
5
|
export * from './spec/index.js';
|
|
5
6
|
export * from './environment/index.js';
|
|
6
7
|
export * from './access/index.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export*from"./domain-runtime.js";export*from"./domain-context/index.js";export*from"./domain-services/index.js";export*from"./spec/index.js";export*from"./environment/index.js";export*from"./access/index.js";export*from"./overrides/index.js";export*from"./loaded-data/index.js";export*from"./domain-data/index.js";export*from"./session-context/index.js";export*from"./web-component/index.js";
|
|
1
|
+
export*from"./domain-runtime.js";export*from"./domain-context/index.js";export*from"./domain-services/index.js";export{ImplementationError,ImplementationErrors,isImplementationError,isImplementationErrors,toImplementationErrors}from"./errors/index.js";export*from"./spec/index.js";export*from"./environment/index.js";export*from"./access/index.js";export*from"./overrides/index.js";export*from"./loaded-data/index.js";export*from"./domain-data/index.js";export*from"./session-context/index.js";export*from"./web-component/index.js";
|
|
@@ -1,3 +1,14 @@
|
|
|
1
1
|
import type { AnyApplicationConfig } from '../../application/index.js';
|
|
2
2
|
import type { ApplicationSpec } from './types.js';
|
|
3
|
+
/**
|
|
4
|
+
* Builds the runtime spec of an application from its config.
|
|
5
|
+
*
|
|
6
|
+
* Project files reach the config unchecked; this is where each one is held to its folder's
|
|
7
|
+
* contract. Every file is checked on its own, and all the files that break their contract are
|
|
8
|
+
* thrown together as one `ImplementationErrors`. Its errors are ordered by folder (handlers,
|
|
9
|
+
* elements, transformers, configurator components, admin components) and inside a folder by the
|
|
10
|
+
* order of the config's list. No spec is returned when a file is wrong, so nothing that reads the
|
|
11
|
+
* spec, such as the transformer selection, runs on a list with a file missing and reports the
|
|
12
|
+
* mistake a second time.
|
|
13
|
+
*/
|
|
3
14
|
export declare const initializeSpec: (config: AnyApplicationConfig) => ApplicationSpec;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{SessionRole as e}from"@salsita-ai/contracts/api";import{
|
|
1
|
+
import{SessionRole as e}from"@salsita-ai/contracts/api";import{createImplementationErrorCollector as t}from"../errors/index.js";import{resolveComponentOpticModules as a,resolveElementModule as n,resolveHandlerModule as o,resolveImportedTransformers as i,resolveTransformerModule as s}from"./module-checks/index.js";let r=(e,t,a)=>e.flatMap(e=>a.attempt(()=>t(e),[]));export const initializeSpec=m=>{let c=m.adminDomain.presets[0];if(!c)throw Error("Cannot register application spec because admin preset is required.");let d=t(),l=r(m.handlers,o,d),p=r(m.elements,n,d),y=r(m.transformers?.importedTransformers??[],e=>[s(e)],d),u=r(m.domain.componentOptics,e=>a([e]),d),f=r(m.adminDomain.componentOptics,e=>a([e]),d);d.throwIfAny();let x=(e=>{let t={};for(let a of e)t[a.name]=(void 0)??a.name;return t})(l),g=(e=>{let t={},a=0;for(let n of e)if("entity"===n.type||"layout"===n.type)t[n.name]=(void 0)??n.name;else{let e=`icon:${a}`;t[e]=(void 0)??`${e}:${n.elements.length}`,a+=1}return t})(p),v=m.transformers?.specTransformers??[];return{version:m.version,dataConfig:m.dataSpec??null,chunks:m.chunks,publishedDataHash:m.publishedDataHash,initialPublishedData:m.initialPublishedData,canCreate:m.features?.acl?.canCreate??Object.values(e),enableAdminRelease:m.features?.enableAdminRelease??!1,textLanguages:m.domain.textLanguages??m.adminDomain.textLanguages??["en"],baseResourcesUrl:m.resources?.baseResourcesUrl??m.defaultEnvs?.resourcesUrl??"",configurator:{factory:m.domain.domainFactory,presets:m.domain.presets,aliasMap:m.domain.domainFactory.context.aliasMap,entityReflections:m.domain.domainFactory.context.entityReflections,$entityReflections:m.domain.domainFactory.context.$entityReflections,expressions:m.domain.domainFactory.context.expressions,actions:m.domain.domainFactory.context.actions,actionImplementations:m.domain.domainFactory.context.actionImplementations,allowedRootEntityTypes:m.domain.domainFactory.context.allowedRootEntityTypes,migrate:m.domain.domainFactory.context.migrate,componentOptics:u,createTransformers:e=>i(y,v,e),navigationStates:m.navigation?.navigationStates??[],viewStates:m.navigation?.viewStates??[],toolStates:m.navigation?.toolStates??[],exportStates:m.navigation?.exportStates??[],handlers:l,handlerHashes:x,elements:p,defaultElements:m.defaultElements??[],elementHashes:g,appLoader:m.ui?.appLoader??"universal",preview:m.ui?.preview??"auto",alwaysExpand:m.ui?.alwaysExpand??!1,theme:m.ui?.theme??{},assistant:m.assistant??null,deploymentQueryDisabled:m.resources?.deploymentQueryDisabled??!1,prefetchTextureUrls:m.resources?.prefetchTextureUrls??[],modelVersion:m.domain.domainFactory.modelVersion},admin:{factory:m.adminDomain.domainFactory,modelVersion:m.adminDomain.domainFactory.modelVersion,aliasMap:m.adminDomain.domainFactory.context.aliasMap,entityReflections:m.adminDomain.domainFactory.context.entityReflections,$entityReflections:m.adminDomain.domainFactory.context.$entityReflections,expressions:m.adminDomain.domainFactory.context.expressions,actions:m.adminDomain.domainFactory.context.actions,actionImplementations:m.adminDomain.domainFactory.context.actionImplementations,allowedRootEntityTypes:m.adminDomain.domainFactory.context.allowedRootEntityTypes,migrate:m.adminDomain.domainFactory.context.migrate,preset:c,componentOptics:f,navigationStates:m.adminNavigation?.navigationStates??[],viewStates:m.adminNavigation?.viewStates??[],handlers:l,handlerHashes:x,elements:p,elementHashes:g}}};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { ImplementationError } from '../../errors/index.js';
|
|
1
2
|
/**
|
|
2
3
|
* The default export of one file in a project convention folder (`src/elements/`, `src/handlers/`,
|
|
3
4
|
* `src/expressions/`, …), paired with the project-relative path it was imported from.
|
|
@@ -17,7 +18,13 @@ export interface ProjectModuleContract {
|
|
|
17
18
|
}
|
|
18
19
|
export declare const SHARED_FOLDER_HINT = "or move the file to an underscore-prefixed folder such as src/_shared/ when it is shared code";
|
|
19
20
|
export declare const isRecord: (value: unknown) => value is Record<string, unknown>;
|
|
20
|
-
|
|
21
|
+
/**
|
|
22
|
+
* The error of a file whose default export does not match its folder's contract. `received` is the
|
|
23
|
+
* value the message reports: the export itself, or the item of an array export that fails. The
|
|
24
|
+
* code is `MISSING_EXPORT` when the file has no default export at all, and `INVALID_EXPORT`
|
|
25
|
+
* otherwise, also when an item of an array export is `undefined`.
|
|
26
|
+
*/
|
|
27
|
+
export declare const createContractError: (module: ProjectModule, contract: ProjectModuleContract, received: unknown) => ImplementationError;
|
|
21
28
|
/**
|
|
22
29
|
* Checks a file of a folder whose contract is one item or an array of them, and returns its items.
|
|
23
30
|
* The first item that fails the check is the value the error reports.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export const SHARED_FOLDER_HINT="or move the file to an underscore-prefixed folder such as src/_shared/ when it is shared code";export const isRecord=e=>"object"==typeof e&&null!==e&&!Array.isArray(e);export const createContractError=(
|
|
1
|
+
import{ImplementationError as e}from"../../errors/index.js";export const SHARED_FOLDER_HINT="or move the file to an underscore-prefixed folder such as src/_shared/ when it is shared code";export const isRecord=e=>"object"==typeof e&&null!==e&&!Array.isArray(e);export const createContractError=(r,t,o)=>new e({code:void 0===r.exports?"MISSING_EXPORT":"INVALID_EXPORT",origin:r.origin,problem:"Invalid default export",expected:t.expected,received:(e=>{if(void 0===e)return"nothing (the file has no default export)";if(null===e)return"null";if("function"==typeof e)return e.name?`the function "${e.name}"`:"an anonymous function";if(Array.isArray(e))return`an array of ${e.length} item(s)`;if(isRecord(e)){let r=Object.keys(e);return r.length>0?`an object with the keys ${r.join(", ")}`:"an empty object"}return`the ${typeof e} ${JSON.stringify(e)}`})(o),fix:`Every file in this folder is loaded by convention, so each one must default-export that shape. ${t.fix}`});export const resolveListModule=(e,r,t)=>{let o=Array.isArray(e.exports)?e.exports:[e.exports],n=[];for(let i of o){if(!t(i))throw createContractError(e,r,i);n.push(i)}return n};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{SHARED_FOLDER_HINT as e,createContractError as t,isRecord as o}from"./project-modules.js";let i={expected:"an object of action implementations keyed by action name",fix:`Create it with phx.domain.implementActions({ ... }), ${e}.`},n=e=>"function"==typeof e;export const resolveActionModules=e=>e.reduce((e,r)=>{let c;if(!(o(c=r.exports)&&Object.values(c).every(n)))throw t(r
|
|
1
|
+
import{SHARED_FOLDER_HINT as e,createContractError as t,isRecord as o}from"./project-modules.js";let i={expected:"an object of action implementations keyed by action name",fix:`Create it with phx.domain.implementActions({ ... }), ${e}.`},n=e=>"function"==typeof e;export const resolveActionModules=e=>e.reduce((e,r)=>{let c;if(!(o(c=r.exports)&&Object.values(c).every(n)))throw t(r,i,r.exports);return{...e,...r.exports}},{});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{SHARED_FOLDER_HINT as e,createContractError as o,isRecord as t}from"./project-modules.js";let i={expected:"an object of expressions keyed by entity type or alias, then by expression name",fix:`Create it with phx.domain.implementCustomExpressions({ ... }) (phx.domain.admin.implementCustomExpressions({ ... }) under src/admin/), ${e}.`},r=e=>t(e)&&"function"==typeof e.evaluate,n=e=>t(e)&&Object.values(e).every(r);export const resolveExpressionModules=(e,r)=>{let s=new Map;return e.map(e=>{let p;if(!(t(p=e.exports)&&Object.values(p).every(n)))throw o(e
|
|
1
|
+
import{SHARED_FOLDER_HINT as e,createContractError as o,isRecord as t}from"./project-modules.js";let i={expected:"an object of expressions keyed by entity type or alias, then by expression name",fix:`Create it with phx.domain.implementCustomExpressions({ ... }) (phx.domain.admin.implementCustomExpressions({ ... }) under src/admin/), ${e}.`},r=e=>t(e)&&"function"==typeof e.evaluate,n=e=>t(e)&&Object.values(e).every(r);export const resolveExpressionModules=(e,r)=>{let s=new Map;return e.map(e=>{let p;if(!(t(p=e.exports)&&Object.values(p).every(n)))throw o(e,i,e.exports);for(let[o,t]of Object.entries(e.exports))for(let i of r[o]??[o])for(let o of Object.keys(t)){let t=`${i}.${o}`,r=s.get(t);if(void 0!==r&&r!==e.origin)throw Error(`Duplicate expression ${t}: it is defined in both ${r} and ${e.origin}, which would make its value depend on file order. Keep one definition and remove the other.`);s.set(t,e.origin)}return{origin:e.origin,expressions:e.exports}})};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{SHARED_FOLDER_HINT as r,createContractError as e,isRecord as t}from"./project-modules.js";let o={expected:"a transformer (a function of the domain context, or an object with a register method), or an array of them",fix:`Create it with phx.frontend.transformerBuilder, ${r}.`},n=r=>"function"==typeof r||t(r)&&"function"==typeof r.register;export const resolveTransformerModule=r=>{let t;if(!(Array.isArray(t=r.exports)?t.every(n):n(t)))throw e(r
|
|
1
|
+
import{SHARED_FOLDER_HINT as r,createContractError as e,isRecord as t}from"./project-modules.js";let o={expected:"a transformer (a function of the domain context, or an object with a register method), or an array of them",fix:`Create it with phx.frontend.transformerBuilder, ${r}.`},n=r=>"function"==typeof r||t(r)&&"function"==typeof r.register;export const resolveTransformerModule=r=>{let t;if(!(Array.isArray(t=r.exports)?t.every(n):n(t)))throw e(r,o,r.exports);return{name:r.origin.replace(/^.*\//,"").replace(/\.tsx?$/,""),transformer:r.exports}};export const resolveTransformerModules=r=>r.map(resolveTransformerModule);export const resolveImportedTransformers=(r,e,t)=>{let o=r.flatMap(({name:r,transformer:e})=>{if(Array.isArray(e))return e.map((e,o)=>{if("register"in e)return e.register(t);if("function"==typeof e)return{priority:1/0,transformer:e(t),name:`${r}[${o}]`};throw Error(`Transformer '${r}[${o}]' must be either a RegistrableTransformer (with register method) or a TransformerFactory (function)`)});if("register"in e)return e.register(t);if("function"==typeof e)return{priority:1/0,transformer:e(t),name:r};throw Error(`Transformer '${r}' must be either a RegistrableTransformer (with register method) or a TransformerFactory (function)`)}),n=[];for(let r of e){let e=o.find(e=>e.name===r.name);if(!e){let e=o.map(r=>r.name).filter(Boolean).join(", ");throw Error(`Transformer '${r.name}' not found in imported transformer files. Available transformers: ${e||"none"}`)}n.push({priority:r.priority??1/0,transformer:e.transformer,name:r.name})}return n};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{SHARED_FOLDER_HINT as e,createContractError as t,isRecord as r}from"./project-modules.js";let o={expected:"an object of invariant lists keyed by entity type or alias",fix:`Create it with phx.domain.implementCustomInvariants({ ... }) (phx.domain.admin.implementCustomInvariants({ ... }) under src/admin/), ${e}.`},i=e=>r(e)&&"function"==typeof e.evaluate,n=e=>r(e)&&Object.values(e).every(e=>Array.isArray(e)&&e.every(i));export const resolveInvariantModules=e=>{let r={};for(let i of e){if(!n(i.exports))throw t(i
|
|
1
|
+
import{SHARED_FOLDER_HINT as e,createContractError as t,isRecord as r}from"./project-modules.js";let o={expected:"an object of invariant lists keyed by entity type or alias",fix:`Create it with phx.domain.implementCustomInvariants({ ... }) (phx.domain.admin.implementCustomInvariants({ ... }) under src/admin/), ${e}.`},i=e=>r(e)&&"function"==typeof e.evaluate,n=e=>r(e)&&Object.values(e).every(e=>Array.isArray(e)&&e.every(i));export const resolveInvariantModules=e=>{let r={};for(let i of e){if(!n(i.exports))throw t(i,o,i.exports);for(let[e,t]of Object.entries(i.exports))r[e]=[...r[e]??[],...t]}return r};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{createSelector as e}from"@salsita-ai/common/utils";import{buildAssistantManifest as t}from"../../application/assistant/index.js";import{systemElementRegistry as n}from"./module-checks/index.js";export const createSpecSelectors=a=>{let{getState:s}=a,r=e.withTypes(),
|
|
1
|
+
import{createSelector as e}from"@salsita-ai/common/utils";import{buildAssistantManifest as t}from"../../application/assistant/index.js";import{systemElementRegistry as n}from"./module-checks/index.js";export const createSpecSelectors=a=>{let{getState:s}=a,r=e.withTypes(),l=r([r.leaf(e=>e.spec)],e=>e),o=r([l],e=>e.version),i=r([l],e=>e.baseResourcesUrl),m=r([l],e=>e.configurator),g=r([l],e=>e.dataConfig),p=r([l],e=>e.chunks),d=r([l],e=>e.publishedDataHash),c=r([l],e=>e.initialPublishedData),u=r([l],e=>e.canCreate),h=r([l],e=>e.enableAdminRelease),y=r([l],e=>e.textLanguages),f=r([m],e=>e.modelVersion),C=r([l],e=>e.admin),E=r([C],e=>e.preset),x=r([C],e=>e.modelVersion),A=r([m],e=>e.theme),b=r([m],e=>e.assistant),H=r([b],e=>e?t(e):null),D=r([m],e=>e.factory),P=r([C],e=>e.factory),S=r([m],e=>e.componentOptics),w=r([C],e=>e.componentOptics),O=r([m],e=>e.appLoader),T=r([m],e=>e.preview),V=r([m],e=>e.alwaysExpand),L=r([m],e=>e.presets),R=r([m],e=>e.deploymentQueryDisabled),U=r([m],e=>e.prefetchTextureUrls),k=r([m],e=>e.handlerHashes),v=r([m],e=>e.handlers),j=r([v,k],(e,t)=>({...(e=>{let t={},n={},a={};for(let s of e)"phoenix"===s.type&&(t[s.name]=s.handler),"system"===s.type&&(n[s.name]=s.handler),"system-async"===s.type&&(a[s.name]=s.handler);return{handlers:t,systemHandlers:n,systemAsyncHandlers:a}})(e),hashes:t})),F=r([m],e=>e.elementHashes),M=r([m],e=>e.elements),Q=r([m],e=>e.defaultElements),B=r([Q,M,F],(e,t,a)=>({...(e=>{let t={},a={};for(let n of e)"layout"===n.type&&(t[n.name]=n.element),"entity"===n.type&&(a[n.name]=n.element);return{entityElements:{...n.entityElements,...a},layoutElements:{...n.layoutElements,...t}}})([...e,...t]),hashes:a}));return{selectSpec:l,selectVersion:o,selectBaseResourcesUrl:i,selectConfiguratorSpec:m,selectConfiguratorModelVersion:f,selectAdminSpec:C,selectAdminPreset:E,selectAdminModelVersion:x,selectThemeOptions:A,selectAssistant:H,selectConfiguratorFactory:D,selectAdminFactory:P,selectConfiguratorComponentOptics:S,selectAdminComponentOptics:w,selectAppLoader:O,selectPreview:T,selectAlwaysExpand:V,selectPresetSeed:L,selectDeploymentQueryDisabled:R,selectPrefetchTextureUrls:U,selectTextLanguages:y,selectHandlerHashes:k,selectHandlers:v,selectHandlerSlots:j,selectElementHashes:F,selectElements:M,selectElementSlots:B,selectDataConfig:g,selectChunks:p,selectPublishedDataHash:d,selectInitialPublishedData:c,selectCanCreate:u,selectEnableAdminRelease:h,getVersion:()=>o(s()),getBaseResourcesUrl:()=>i(s()),getConfiguratorSpec:()=>m(s()),getConfiguratorModelVersion:()=>f(s()),getAdminSpec:()=>C(s()),getAdminPreset:()=>E(s()),getAdminModelVersion:()=>x(s()),getThemeOptions:()=>A(s()),getAssistant:()=>H(s()),getConfiguratorFactory:()=>D(s()),getAdminFactory:()=>P(s()),getConfiguratorComponentOptics:()=>S(s()),getAdminComponentOptics:()=>w(s()),getAppLoader:()=>O(s()),getPreview:()=>T(s()),getAlwaysExpand:()=>V(s()),getPresetSeed:()=>L(s()),getDeploymentQueryDisabled:()=>R(s()),getPrefetchTextureUrls:()=>U(s()),getTextLanguages:()=>y(s()),getHandlerHashes:()=>k(s()),getHandlers:()=>v(s()),getHandlerSlots:()=>j(s()),getElementHashes:()=>F(s()),getElements:()=>M(s()),getElementSlots:()=>B(s()),getDataConfig:()=>g(s()),getChunks:()=>p(s()),getPublishedDataHash:()=>d(s()),getInitialPublishedData:()=>c(s()),getCanCreate:()=>u(s()),getEnableAdminRelease:()=>h(s())}};
|
|
@@ -35,6 +35,8 @@ export interface ApplicationConfiguratorSpec {
|
|
|
35
35
|
*/
|
|
36
36
|
readonly handlerHashes: Record<string, string>;
|
|
37
37
|
readonly elements: readonly ElementRegistration[];
|
|
38
|
+
/** The SDK's default element registrations; an entry of `elements` with the same name replaces one. */
|
|
39
|
+
readonly defaultElements: readonly ElementRegistration[];
|
|
38
40
|
/**
|
|
39
41
|
* Per-element content hash. Used as remount key so only the specific element
|
|
40
42
|
* whose source changed remounts. Unchanged elements keep their hash and stay mounted.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{SystemComponentBuilder as t}from"../core/index.js";export const AttributeSwitchValueSchema={type:
|
|
1
|
+
import{SystemComponentBuilder as t}from"../core/index.js";export const AttributeSwitchValueSchema={type:"boolean"};export const attributeSwitchComponent=t.component("attributeSwitch").withState({type:"object",properties:{value:AttributeSwitchValueSchema},tsType:"AttributeSwitchComponentState",import:[{module:"@salsita-ai/sdk/domain",member:"AttributeSwitchComponentState"}],required:["value"],additionalProperties:!1}).withWritableKeys(["value"]).build();
|
|
@@ -41,7 +41,7 @@ export type CanvasConfigComponentState = {
|
|
|
41
41
|
/**
|
|
42
42
|
* Can be "high-performance", "low-power" or "default"
|
|
43
43
|
*/
|
|
44
|
-
readonly powerPreference?:
|
|
44
|
+
readonly powerPreference?: 'high-performance' | 'low-power' | 'default' | undefined;
|
|
45
45
|
/**
|
|
46
46
|
* default is true.
|
|
47
47
|
*/
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { type
|
|
1
|
+
import { type HexColor } from '@salsita-ai/common/utils';
|
|
2
2
|
export type ClientSideImageComponentState = {
|
|
3
3
|
readonly exportState: string;
|
|
4
4
|
readonly width: number;
|
|
5
5
|
readonly height: number;
|
|
6
6
|
readonly fileFormat: 'PNG' | 'JPEG';
|
|
7
|
-
readonly backgroundColor?:
|
|
7
|
+
readonly backgroundColor?: HexColor;
|
|
8
8
|
readonly toolState: string;
|
|
9
9
|
readonly viewState: string;
|
|
10
10
|
readonly navigationState: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{SystemComponentBuilder as t,isSnapshotOfComponentType as e}from"../core/index.js";export const clientSideImageComponent=t.component("clientSideImage").withState({type:"object",tsType:"ClientSideImageComponentState",import:[{module:"@salsita-ai/sdk/domain",member:"ClientSideImageComponentState"}],properties:{exportState:{type:"string"},width:{type:"number"},height:{type:"number"},fileFormat:{type:"string",enum:["PNG","JPEG"]},backgroundColor:{type:"string",pattern:"^#[0-9a-fA-F]{6}$"},toolState:{type:"string"},viewState:{type:"string"},navigationState:{type:"string"}},required:["exportState","width","height","fileFormat","toolState","viewState","navigationState"],additionalProperties:!1}).build();export const isClientSideImageComponentSnapshot=e(clientSideImageComponent);
|
|
1
|
+
import{SystemComponentBuilder as t,isSnapshotOfComponentType as e}from"../core/index.js";export const clientSideImageComponent=t.component("clientSideImage").withState({type:"object",tsType:"ClientSideImageComponentState",import:[{module:"@salsita-ai/sdk/domain",member:"ClientSideImageComponentState"}],properties:{exportState:{type:"string"},width:{type:"number"},height:{type:"number"},fileFormat:{type:"string",enum:["PNG","JPEG"]},backgroundColor:{type:"string",pattern:"^#[0-9a-fA-F]{6}$",tsType:"HexColor",import:[{module:"@salsita-ai/sdk/common/utils",member:"HexColor"}]},toolState:{type:"string"},viewState:{type:"string"},navigationState:{type:"string"}},required:["exportState","width","height","fileFormat","toolState","viewState","navigationState"],additionalProperties:!1}).build();export const isClientSideImageComponentSnapshot=e(clientSideImageComponent);
|