@salsita-ai/sdk 0.49.0-develop.fc391028c9 → 0.50.0-develop.03ef51a292
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/CHANGELOG.md +479 -0
- package/README.md +20 -12
- package/dist/admin/create-admin-pages-from-spec.d.ts +1 -1
- package/dist/application-spec/errors/diagnostic-codes.d.ts +6 -0
- package/dist/application-spec/errors/diagnostic-codes.js +1 -1
- package/dist/application-spec/errors/diagnostic-messages.d.ts +6 -0
- package/dist/application-spec/errors/diagnostic-messages.js +1 -1
- package/dist/application-spec/generate-application/code/common/index.d.ts +1 -0
- package/dist/application-spec/generate-application/code/common/index.js +1 -1
- package/dist/application-spec/generate-application/code/common/project-module-list.d.ts +8 -0
- package/dist/application-spec/generate-application/code/common/project-module-list.js +3 -0
- package/dist/application-spec/generate-application/code/domain-runtime-files.js +1 -1
- package/dist/application-spec/generate-application/code/project-scaffolding.js +2 -2
- package/dist/application-spec/generate-application/code/templates/admin-domain-code.d.ts +1 -2
- package/dist/application-spec/generate-application/code/templates/admin-domain-code.js +6 -14
- package/dist/application-spec/generate-application/code/templates/admin-frontend-code.d.ts +1 -2
- package/dist/application-spec/generate-application/code/templates/admin-frontend-code.js +4 -4
- package/dist/application-spec/generate-application/code/templates/application-types.js +6 -6
- package/dist/application-spec/generate-application/code/templates/configurator-domain-code.d.ts +2 -2
- package/dist/application-spec/generate-application/code/templates/configurator-domain-code.js +7 -13
- package/dist/application-spec/generate-application/code/templates/configurator-frontend-code.d.ts +1 -2
- package/dist/application-spec/generate-application/code/templates/configurator-frontend-code.js +7 -9
- package/dist/application-spec/generate-application/code/templates/domain-spec/generate-assistant.d.ts +2 -2
- package/dist/application-spec/generate-application/code/templates/domain-spec/generate-assistant.js +1 -1
- package/dist/application-spec/generate-application/code/templates/domain-spec/generate-domain-block.d.ts +3 -1
- package/dist/application-spec/generate-application/code/templates/domain-spec/generate-domain-block.js +70 -66
- package/dist/application-spec/generate-application/code/templates/domain-spec/generate-phx-globals.js +3 -0
- package/dist/application-spec/generate-application/code/templates/domain-spec.js +7 -7
- package/dist/application-spec/generate-application/code/templates/domain.js +4 -4
- package/dist/application-spec/generate-application/code/templates/global-definition/generate-action-types.d.ts +11 -0
- package/dist/application-spec/generate-application/code/templates/global-definition/generate-action-types.js +8 -0
- package/dist/application-spec/generate-application/code/templates/global-definition/index.d.ts +1 -0
- package/dist/application-spec/generate-application/code/templates/global-definition/index.js +1 -1
- package/dist/application-spec/generate-application/code/templates/globals.js +1 -0
- package/dist/application-spec/generate-application/code/templates/index.d.ts +7 -6
- package/dist/application-spec/generate-application/code/templates/index.js +1 -1
- package/dist/application-spec/generate-application/code/templates/skills/agents-md.js +2 -0
- package/dist/application-spec/generate-application/code/templates/skills/phoenix-cli-skill.js +1 -0
- package/dist/application-spec/generate-application/code/templates/{phoenix-create-configurator-skill.d.ts → skills/phoenix-create-configurator-skill.d.ts} +1 -1
- package/dist/application-spec/generate-application/code/templates/{phoenix-create-configurator-skill.js → skills/phoenix-create-configurator-skill.js} +43 -13
- package/dist/application-spec/generate-application/code/templates/skills/phoenix-feedback-skill.js +54 -0
- package/dist/application-spec/generate-application/code/templates/{phoenix-review-skill.js → skills/phoenix-review-skill.js} +7 -5
- package/dist/application-spec/generate-application/code/templates/skills/phoenix-skill.js +1 -0
- package/dist/application-spec/generate-application/code/templates/skills/phoenix-variants-skill.d.ts +1 -0
- package/dist/application-spec/generate-application/code/templates/skills/phoenix-variants-skill.js +6 -0
- package/dist/application-spec/generate-application/code/templates/{common → skills}/sdk-content.d.ts +53 -3
- package/dist/application-spec/generate-application/code/templates/skills/sdk-content.js +81 -0
- package/dist/application-spec/generate-application/code/templates/webhook-builders.js +8 -4
- package/dist/application-spec/generate-application/runtime/configurator-runtime/configurator-runtime.d.ts +2 -0
- package/dist/application-spec/generate-application/runtime/configurator-runtime/configurator-runtime.js +1 -1
- package/dist/application-spec/generate-application/runtime/sections/actions-runtime.d.ts +14 -0
- package/dist/application-spec/generate-application/runtime/sections/actions-runtime.js +1 -0
- package/dist/application-spec/generate-application/runtime/sections/assistant-runtime.d.ts +4 -3
- package/dist/application-spec/generate-application/runtime/sections/assistant-runtime.js +1 -1
- package/dist/application-spec/generate-application/runtime/sections/index.d.ts +1 -0
- package/dist/application-spec/generate-application/runtime/sections/index.js +1 -1
- package/dist/application-spec/parse-application-files/categorize/categorize-files.d.ts +3 -1
- package/dist/application-spec/parse-application-files/categorize/categorize-files.js +1 -1
- package/dist/application-spec/parse-application-files/merge/index.d.ts +1 -0
- package/dist/application-spec/parse-application-files/merge/index.js +1 -1
- package/dist/application-spec/parse-application-files/merge/merged-actions.d.ts +11 -0
- package/dist/application-spec/parse-application-files/merge/merged-actions.js +1 -0
- package/dist/application-spec/parse-application-files/merge/merged-spec.d.ts +2 -0
- package/dist/application-spec/parse-application-files/merge/merged-spec.js +1 -1
- package/dist/application-spec/parse-application-files/raw-spec/index.d.ts +1 -0
- package/dist/application-spec/parse-application-files/raw-spec/index.js +1 -1
- package/dist/application-spec/parse-application-files/raw-spec/raw-actions.d.ts +18 -0
- package/dist/application-spec/parse-application-files/raw-spec/raw-actions.js +1 -0
- package/dist/application-spec/parse-application-files/raw-spec/raw-assistant.d.ts +14 -2
- 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.d.ts +2 -0
- package/dist/application-spec/parse-application-files/raw-spec/raw-spec-file.js +1 -1
- package/dist/application-spec/parse-application-files/resolve/resolve-import-modules.js +1 -1
- package/dist/application-spec/parse-application-files/spec/application/application-spec.js +1 -1
- package/dist/application-spec/parse-application-files/spec/application/configurator-spec/configurator-spec.d.ts +4 -2
- package/dist/application-spec/parse-application-files/spec/application/configurator-spec/configurator-spec.js +1 -1
- package/dist/application-spec/parse-application-files/spec/common/index.d.ts +1 -0
- package/dist/application-spec/parse-application-files/spec/common/index.js +1 -1
- package/dist/application-spec/parse-application-files/spec/common/schema-ref-resolver.d.ts +23 -0
- package/dist/application-spec/parse-application-files/spec/common/schema-ref-resolver.js +1 -0
- package/dist/application-spec/parse-application-files/spec/model/names/action-name.d.ts +10 -0
- package/dist/application-spec/parse-application-files/spec/model/names/action-name.js +1 -0
- package/dist/application-spec/parse-application-files/spec/model/names/index.d.ts +1 -0
- package/dist/application-spec/parse-application-files/spec/model/names/index.js +1 -1
- package/dist/application-spec/parse-application-files/spec/sections/actions.d.ts +35 -0
- package/dist/application-spec/parse-application-files/spec/sections/actions.js +1 -0
- package/dist/application-spec/parse-application-files/spec/sections/assistant/assistant-field-type.d.ts +5 -21
- package/dist/application-spec/parse-application-files/spec/sections/assistant/assistant-field-type.js +1 -1
- package/dist/application-spec/parse-application-files/spec/sections/assistant/assistant-schema.d.ts +14 -39
- package/dist/application-spec/parse-application-files/spec/sections/assistant/assistant-schema.js +1 -1
- package/dist/application-spec/parse-application-files/spec/sections/assistant/assistant-server-settings.d.ts +2 -2
- package/dist/application-spec/parse-application-files/spec/sections/assistant/assistant.d.ts +5 -19
- package/dist/application-spec/parse-application-files/spec/sections/index.d.ts +1 -0
- package/dist/application-spec/parse-application-files/spec/sections/index.js +1 -1
- package/dist/client/phoenix-api.d.ts +63 -31
- package/dist/configurator/application-runtime/extensions/configurator-extension-systems.d.ts +2 -1
- package/dist/configurator/application-runtime/extensions/configurator-extension-systems.js +1 -1
- package/dist/configurator/application-runtime/extensions/selectors.d.ts +2 -1
- package/dist/configurator/application-runtime/extensions/selectors.js +1 -1
- package/dist/configurator/application-runtime/extensions/systems/assistant-system/assistant-system.d.ts +180 -0
- package/dist/configurator/application-runtime/extensions/systems/assistant-system/assistant-system.js +1 -0
- package/dist/configurator/{assistant → application-runtime/extensions/systems/assistant-system}/browser-details.d.ts +1 -1
- package/dist/configurator/application-runtime/extensions/systems/assistant-system/browser-details.js +1 -0
- package/dist/configurator/application-runtime/extensions/systems/assistant-system/change-recorder.d.ts +85 -0
- package/dist/configurator/application-runtime/extensions/systems/assistant-system/change-recorder.js +1 -0
- package/dist/configurator/{assistant → application-runtime/extensions/systems/assistant-system}/graphql-tools.d.ts +20 -16
- package/dist/configurator/application-runtime/extensions/systems/assistant-system/graphql-tools.js +1 -0
- package/dist/configurator/application-runtime/extensions/systems/graphql-system/entity-meta.d.ts +4 -0
- package/dist/configurator/application-runtime/extensions/systems/graphql-system/entity-meta.js +1 -1
- package/dist/configurator/application-runtime/extensions/systems/graphql-system/graphql-system.d.ts +16 -1
- package/dist/configurator/application-runtime/extensions/systems/graphql-system/graphql-system.js +1 -1
- package/dist/configurator/application-runtime/extensions/systems/graphql-system/side-effects.d.ts +9 -0
- package/dist/configurator/application-runtime/extensions/systems/graphql-system/side-effects.js +1 -0
- package/dist/configurator/application-runtime/extensions/systems/index.d.ts +1 -0
- package/dist/configurator/application-runtime/extensions/systems/index.js +1 -1
- package/dist/configurator/application-runtime/extensions/systems/layout-system/layout-system.d.ts +2 -0
- package/dist/configurator/application-runtime/extensions/systems/layout-system/layout-system.js +1 -1
- package/dist/configurator/common/frontend-analytics.d.ts +21 -21
- package/dist/configurator/index.d.ts +0 -1
- package/dist/configurator/index.js +1 -1
- package/dist/configurator/pages/LoadedConfiguratorDetailPage.js +1 -1
- package/dist/configurator/scene/scene-analytics/scene-analytics.d.ts +2 -2
- package/dist/configurator/ui/assistant/AssistantChips.d.ts +11 -0
- package/dist/configurator/ui/assistant/AssistantChips.js +1 -0
- package/dist/configurator/ui/assistant/AssistantComposer.d.ts +6 -0
- package/dist/configurator/ui/assistant/AssistantComposer.js +1 -0
- package/dist/configurator/ui/assistant/AssistantMarkdown.d.ts +7 -0
- package/dist/configurator/ui/assistant/AssistantMarkdown.js +1 -0
- package/dist/configurator/ui/assistant/AssistantPanel.d.ts +11 -0
- package/dist/configurator/ui/assistant/AssistantPanel.js +1 -0
- package/dist/configurator/ui/assistant/AssistantThread.d.ts +6 -0
- package/dist/configurator/ui/assistant/AssistantThread.js +1 -0
- package/dist/configurator/ui/assistant/assistant-failure.d.ts +18 -0
- package/dist/configurator/ui/assistant/assistant-failure.js +1 -0
- package/dist/configurator/ui/assistant/index.d.ts +2 -0
- package/dist/configurator/ui/assistant/index.js +1 -0
- package/dist/configurator/ui/assistant/streamed-markdown.d.ts +6 -0
- package/dist/configurator/ui/assistant/streamed-markdown.js +2 -0
- package/dist/configurator/ui/assistant/theme.d.ts +2 -0
- package/dist/configurator/ui/assistant/theme.js +1 -0
- package/dist/configurator/ui/assistant/thread-items.d.ts +37 -0
- package/dist/configurator/ui/assistant/thread-items.js +1 -0
- package/dist/configurator/ui/assistant/tool-chip.d.ts +44 -0
- package/dist/configurator/ui/assistant/tool-chip.js +1 -0
- package/dist/configurator/ui/assistant/use-follow-stream.d.ts +17 -0
- package/dist/configurator/ui/assistant/use-follow-stream.js +1 -0
- package/dist/configurator/ui/assistant/use-is-assistant-panel-open.d.ts +5 -0
- package/dist/configurator/ui/assistant/use-is-assistant-panel-open.js +1 -0
- package/dist/configurator/ui/configurator-layout/universal/DesktopLayout.js +5 -5
- package/dist/configurator/ui/configurator-layout/universal/MobileLayout.d.ts +2 -0
- package/dist/configurator/ui/configurator-layout/universal/MobileLayout.js +4 -4
- package/dist/configurator/ui/legacy/mobile-controls/MobileControls.d.ts +1 -1
- package/dist/configurator/ui/phoenix-layout-elements/AssistantToolbarButton.d.ts +10 -0
- package/dist/configurator/ui/phoenix-layout-elements/AssistantToolbarButton.js +1 -0
- package/dist/configurator/ui/phoenix-layout-elements/index.d.ts +1 -0
- package/dist/configurator/ui/phoenix-layout-elements/index.js +1 -1
- package/dist/docs/complex-use-cases/filtered-controls-with-fix-dialog.mdx +84 -98
- package/dist/docs/complex-use-cases/navigation-reset-selection.mdx +18 -12
- package/dist/docs/index.json +12 -2
- package/dist/docs/layouts/custom-price.mdx +14 -16
- package/dist/docs/layouts/sidebar/tabs.mdx +24 -21
- package/dist/docs/layouts/toolbar.mdx +6 -0
- package/dist/docs/other-features/domain-actions.mdx +418 -0
- package/dist/docs/other-features/side-effects.mdx +68 -34
- package/dist/docs/other-features/transformers.mdx +1 -1
- package/dist/docs/phoenix/admin.mdx +11 -26
- package/dist/docs/phoenix/best-practices.mdx +1 -0
- package/dist/docs/phoenix/finalization.mdx +1 -1
- package/dist/docs/phoenix/integration/headless-mode-external.mdx +5 -5
- package/dist/docs/phoenix/integration/widget-mode-external.mdx +5 -5
- package/dist/docs/phoenix/localization.mdx +3 -22
- package/dist/docs/phoenix/migrations.mdx +45 -5
- package/dist/docs/phoenix/phoenix-cli.mdx +139 -20
- package/dist/docs/phoenix/project-structure.mdx +13 -3
- package/dist/docs/phoenix/sdk-builder-workflow.mdx +12 -8
- package/dist/docs/phoenix/state-management.mdx +1 -1
- package/dist/docs/recipes-and-delete/recipe-hierarchy-selection.mdx +15 -13
- package/dist/docs/relations/hierarchy.mdx +13 -2
- package/dist/domain/admin-domain/__generated/enhanced-model.d.ts +1 -2
- package/dist/domain/admin-domain/__generated/model/versions/v1.d.ts +1 -1
- package/dist/domain/admin-domain/__generated/model/versions/v2.d.ts +1 -1
- package/dist/domain/admin-domain/__generated/model/versions/v3.d.ts +1 -1
- package/dist/domain/admin-domain/__generated/model/versions/v4.d.ts +1 -1
- package/dist/domain/admin-domain/__generated/model/versions/v5.d.ts +1 -1
- package/dist/domain/admin-domain/__generated/model/versions/v6.d.ts +2 -2
- package/dist/domain/admin-domain/__generated/model/versions/v6.js +1 -1
- package/dist/domain/admin-domain/implementation/common-admin-expressions.d.ts +1 -4
- package/dist/domain/admin-domain/implementation/common-admin-migrations.d.ts +1 -1
- package/dist/domain/admin-domain/index.d.ts +2 -3
- package/dist/domain/admin-domain/index.js +1 -1
- package/dist/domain/application/admin-page-factories.d.ts +1 -1
- package/dist/domain/application/application-config.d.ts +25 -73
- package/dist/domain/application/assistant/assistant-manifest.d.ts +63 -0
- package/dist/domain/application/assistant/assistant-resolved-manifest.d.ts +95 -0
- package/dist/domain/application/assistant/assistant-value-type.d.ts +9 -0
- package/dist/domain/application/assistant/assistant-value-type.js +1 -0
- package/dist/domain/application/assistant/build-assistant-manifest.d.ts +4 -0
- package/dist/domain/application/assistant/build-assistant-manifest.js +1 -0
- package/dist/domain/application/assistant/generate-assistant-prompt.d.ts +3 -0
- package/dist/domain/application/assistant/generate-assistant-prompt.js +1 -0
- package/dist/domain/application/assistant/index.d.ts +4 -0
- package/dist/domain/application/assistant/index.js +1 -0
- package/dist/domain/application/assistant-field-options.d.ts +2 -3
- package/dist/domain/application/assistant-mutations.d.ts +15 -17
- package/dist/domain/application/assistant-mutations.js +1 -1
- package/dist/domain/application/assistant-recipe-groups.d.ts +2 -6
- package/dist/domain/application/configurator-builder.d.ts +33 -18
- package/dist/domain/application/configurator-builder.js +1 -1
- package/dist/domain/application/element-registration.d.ts +5 -0
- package/dist/domain/application/element-registration.js +1 -1
- package/dist/domain/application/handler-registration.d.ts +5 -0
- package/dist/domain/application/handler-registration.js +1 -1
- package/dist/domain/application/index.d.ts +5 -4
- package/dist/domain/application/index.js +1 -1
- package/dist/domain/application/published-data/create-finalize-admin-domain.d.ts +1 -2
- package/dist/domain/application/published-data/map-published-chunked-data.d.ts +1 -1
- package/dist/domain/application/published-data/map-published-data.d.ts +1 -2
- package/dist/domain/application/resolve-imported-transformers.d.ts +12 -2
- package/dist/domain/application/resolve-imported-transformers.js +1 -1
- package/dist/domain/available-system-components.js +1 -1
- package/dist/domain/core/action/action-factory.d.ts +11 -0
- package/dist/domain/core/action/action-factory.js +1 -0
- package/dist/domain/core/action/action.d.ts +66 -0
- package/dist/domain/core/action/index.d.ts +3 -0
- package/dist/domain/core/action/index.js +1 -0
- package/dist/domain/core/action/prepare-action-implementations.d.ts +15 -0
- package/dist/domain/core/action/prepare-action-implementations.js +5 -0
- package/dist/domain/{components → core/component}/component-reader-types.d.ts +1 -2
- package/dist/domain/{components → core/component}/debug-state-component.d.ts +1 -1
- package/dist/domain/core/component/debug-state-component.js +1 -0
- package/dist/domain/{components → core/component}/domain-component-optic.d.ts +6 -6
- package/dist/domain/core/component/domain-component-optic.js +16 -0
- package/dist/domain/{components → core/component}/drag-state-component.d.ts +1 -1
- package/dist/domain/core/component/drag-state-component.js +1 -0
- package/dist/domain/{components → core/component}/export-state-component.d.ts +1 -1
- package/dist/domain/core/component/export-state-component.js +1 -0
- package/dist/domain/{components → core/component}/fullscreen-state-component.d.ts +1 -1
- package/dist/domain/core/component/fullscreen-state-component.js +1 -0
- package/dist/domain/{components → core/component}/group-components-by-entity-id-and-name.d.ts +1 -2
- package/dist/domain/core/component/group-components-by-entity-id-and-name.js +1 -0
- package/dist/domain/{components → core/component}/hover-state-component.d.ts +1 -1
- package/dist/domain/core/component/hover-state-component.js +1 -0
- package/dist/domain/core/component/index.d.ts +18 -0
- package/dist/domain/core/component/index.js +1 -0
- package/dist/domain/{components → core/component}/legacy-filter.d.ts +2 -2
- package/dist/domain/{components → core/component}/navigation-state-component.d.ts +1 -1
- package/dist/domain/core/component/navigation-state-component.js +1 -0
- package/dist/domain/{components → core/component}/selection-state-component.d.ts +1 -1
- package/dist/domain/core/component/selection-state-component.js +1 -0
- package/dist/domain/{components → core/component}/system-component-builder.d.ts +1 -2
- package/dist/domain/core/component/system-component-builder.js +1 -0
- package/dist/domain/{components → core/component}/system-component-filter.d.ts +3 -3
- package/dist/domain/core/component/system-virtual-entity.js +1 -0
- package/dist/domain/{components → core/component}/tool-state-component.d.ts +1 -1
- package/dist/domain/core/component/tool-state-component.js +1 -0
- package/dist/domain/{components → core/component}/updates.d.ts +17 -2
- package/dist/domain/{components → core/component}/view-state-component.d.ts +1 -1
- package/dist/domain/core/component/view-state-component.js +1 -0
- package/dist/domain/{components → core/component}/viewport-state-component.d.ts +1 -1
- package/dist/domain/core/component/viewport-state-component.js +1 -0
- package/dist/domain/core/decoder/create-decoder.d.ts +6 -0
- package/dist/domain/core/decoder/create-decoder.js +1 -0
- package/dist/domain/core/decoder/decoder.d.ts +6 -0
- package/dist/domain/core/decoder/decoder.js +1 -0
- package/dist/domain/core/decoder/index.d.ts +2 -0
- package/dist/domain/core/decoder/index.js +1 -0
- package/dist/domain/core/domain-factory.d.ts +7 -4
- package/dist/domain/core/domain-factory.js +1 -1
- package/dist/domain/core/domain.d.ts +3 -4
- package/dist/domain/core/domain.js +1 -1
- package/dist/domain/{expressions → core/expression}/constant-expressions.d.ts +2 -3
- package/dist/domain/core/expression/constant-expressions.js +1 -0
- package/dist/domain/{expressions → core/expression}/custom-expression.d.ts +4 -5
- package/dist/domain/core/expression/custom-expression.js +1 -0
- package/dist/domain/core/{expression.d.ts → expression/expression.d.ts} +6 -8
- package/dist/domain/core/expression/expression.js +1 -0
- package/dist/domain/core/expression/index.d.ts +5 -0
- package/dist/domain/core/expression/index.js +1 -0
- package/dist/domain/{expressions → core/expression}/memoize-expression.d.ts +2 -2
- package/dist/domain/{expressions → core/expression}/prepare-domain-expressions.d.ts +1 -1
- package/dist/domain/core/index.d.ts +9 -16
- package/dist/domain/core/index.js +1 -1
- package/dist/domain/{invariants → core/invariant}/builtin-invariant.d.ts +2 -2
- package/dist/domain/{invariants → core/invariant}/custom-invariants.d.ts +2 -3
- package/dist/domain/core/invariant/custom-invariants.js +1 -0
- package/dist/domain/core/invariant/index.d.ts +5 -0
- package/dist/domain/core/invariant/index.js +1 -0
- package/dist/domain/{invariants → core/invariant}/invariants.d.ts +12 -4
- package/dist/domain/core/invariant/invariants.js +1 -0
- package/dist/domain/core/invariant/violation-component.js +1 -0
- package/dist/domain/{invariants → core/invariant}/violation.d.ts +2 -2
- package/dist/domain/core/{component.d.ts → model/component.d.ts} +1 -1
- package/dist/domain/core/model/index.d.ts +6 -0
- package/dist/domain/core/model/index.js +1 -0
- package/dist/domain/core/{reflection.d.ts → model/reflection.d.ts} +1 -1
- package/dist/domain/core/model/reflection.js +1 -0
- package/dist/domain/core/schema/enhanced-json-schema.js +1 -0
- package/dist/domain/core/schema/extended-schema-validator.js +1 -0
- package/dist/domain/core/schema/index.d.ts +3 -0
- package/dist/domain/core/schema/index.js +1 -0
- package/dist/domain/core/schema/schema-validator.js +1 -0
- package/dist/domain/core/state/id-sequence.d.ts +15 -0
- package/dist/domain/core/state/id-sequence.js +1 -0
- package/dist/domain/core/state/index.d.ts +3 -0
- package/dist/domain/core/state/index.js +1 -0
- package/dist/domain/core/{migrations.d.ts → state/migrations.d.ts} +1 -2
- package/dist/domain/core/{state.d.ts → state/state.d.ts} +1 -2
- package/dist/domain/domain-builder.d.ts +16 -6
- package/dist/domain/domain-builder.js +1 -1
- package/dist/domain/domain-context/action-system/action-system.d.ts +38 -0
- package/dist/domain/domain-context/action-system/action-system.js +1 -0
- package/dist/domain/domain-context/create-transformer.d.ts +1 -1
- package/dist/domain/domain-context/dimension-system/dimension-state.js +1 -1
- package/dist/domain/domain-context/dimension-system/dimension-system.d.ts +1 -2
- package/dist/domain/domain-context/domain-context-systems.d.ts +5 -4
- package/dist/domain/domain-context/index.d.ts +3 -2
- package/dist/domain/domain-context/index.js +1 -1
- package/dist/domain/domain-context/navigation-system/navigation-system.d.ts +3 -5
- package/dist/domain/domain-context/navigation-system/navigation-system.js +1 -1
- package/dist/domain/domain-context/navigation-system/navigation-updates.d.ts +1 -12
- package/dist/domain/domain-context/navigation-system/navigation-updates.js +1 -1
- package/dist/domain/domain-context/navigation-system/selection-transformers.d.ts +1 -1
- package/dist/domain/domain-context/navigation-system/selection-transformers.js +1 -1
- package/dist/domain/domain-context/recipe-system/recipe-cooker-system.d.ts +1 -2
- package/dist/domain/domain-context/recipe-system/recipe-cooker-system.js +1 -1
- package/dist/domain/domain-context/recipe-system/recipes.d.ts +1 -3
- package/dist/domain/domain-context/recipe-system/recipes.js +1 -1
- package/dist/domain/domain-context/relation-transformers/cascade-deletes.d.ts +1 -1
- package/dist/domain/domain-context/relation-transformers/cascade-deletes.js +1 -1
- package/dist/domain/domain-context/relation-transformers/cascade-ref-pruning.d.ts +1 -1
- package/dist/domain/domain-context/relation-transformers/cascade-ref-pruning.js +1 -1
- package/dist/domain/domain-context/relation-transformers/create-entity-refs.d.ts +1 -1
- package/dist/domain/domain-context/relation-transformers/create-entity-refs.js +2 -2
- package/dist/domain/domain-context/relation-transformers/replace-refs.d.ts +1 -1
- package/dist/domain/domain-context/relation-transformers/replace-refs.js +1 -1
- package/dist/domain/domain-context/store-system/apply-updates.d.ts +1 -3
- package/dist/domain/domain-context/store-system/apply-updates.js +1 -1
- package/dist/domain/domain-context/store-system/next-domain-entity-id.d.ts +1 -13
- package/dist/domain/domain-context/store-system/next-domain-entity-id.js +1 -1
- package/dist/domain/domain-context/store-system/reconcile-projected-entities.d.ts +1 -2
- package/dist/domain/domain-context/store-system/reconcile-projected-entities.js +1 -1
- package/dist/domain/domain-context/store-system/store-system.d.ts +1 -5
- package/dist/domain/domain-context/store-system/store-system.js +2 -2
- package/dist/domain/domain-context/store-system/system-state.d.ts +1 -3
- package/dist/domain/domain-context/store-system/system-state.js +1 -1
- package/dist/domain/domain-context/transformers/actions-builder.d.ts +1 -2
- package/dist/domain/domain-context/transformers/actions-builder.js +1 -1
- package/dist/domain/domain-context/transformers/auto-snap-transformer.d.ts +1 -3
- package/dist/domain/domain-context/transformers/chain-builder.d.ts +2 -2
- package/dist/domain/domain-context/transformers/context.d.ts +1 -5
- package/dist/domain/domain-context/transformers/entity-builder.d.ts +1 -5
- package/dist/domain/domain-context/transformers/entity-builder.js +1 -1
- package/dist/domain/domain-context/transformers/then-builder.d.ts +1 -2
- package/dist/domain/domain-context/transformers/then-builder.js +1 -1
- package/dist/domain/domain-context/transformers/when-builder.d.ts +1 -6
- package/dist/domain/domain-context/transformers/when-builder.js +1 -1
- package/dist/domain/domain-context/undo-system.d.ts +1 -1
- package/dist/domain/domain-runtime/domain-context/component-reader.d.ts +1 -4
- package/dist/domain/domain-runtime/domain-context/component-reader.js +1 -1
- package/dist/domain/domain-runtime/domain-context/domain-context.js +1 -1
- package/dist/domain/domain-runtime/domain-context/selectors.d.ts +5 -3
- package/dist/domain/domain-runtime/domain-context/selectors.js +1 -1
- package/dist/domain/domain-runtime/domain-runtime.d.ts +16 -4
- package/dist/domain/domain-runtime/spec/initialize.js +1 -1
- package/dist/domain/domain-runtime/spec/selectors.d.ts +2 -2
- package/dist/domain/domain-runtime/spec/selectors.js +1 -1
- package/dist/domain/domain-runtime/spec/types.d.ts +18 -5
- package/dist/domain/index.d.ts +1 -25
- package/dist/domain/index.js +1 -1
- package/dist/domain/mocks/create-mock-domain-runtime.d.ts +9 -3
- package/dist/domain/mocks/create-mock-domain-runtime.js +1 -1
- package/dist/domain/project-modules/index.d.ts +1 -0
- package/dist/domain/project-modules/index.js +1 -0
- package/dist/domain/project-modules/project-modules.d.ts +41 -0
- package/dist/domain/project-modules/project-modules.js +1 -0
- package/dist/domain/projections/blender-projections/blender-projections.d.ts +1 -1
- package/dist/domain/projections/blender-projections/blender-projections.js +1 -1
- package/dist/domain/projections/composition-projections.js +1 -1
- package/dist/domain/projections/projected-entities-projections.d.ts +1 -2
- package/dist/domain/projections/snap-matching.d.ts +1 -2
- package/dist/domain/projections/snap-utils.d.ts +1 -2
- package/dist/domain/projections/validation-projections.d.ts +1 -2
- package/dist/domain/projections/validation-projections.js +1 -1
- package/dist/domain/relations/all-of-type-relation.d.ts +1 -4
- package/dist/domain/relations/all-of-type-relation.js +1 -1
- package/dist/domain/relations/component-factories.d.ts +1 -2
- package/dist/domain/relations/composed-of.d.ts +1 -1
- package/dist/domain/relations/composed-of.js +1 -1
- package/dist/domain/relations/direct-relation.d.ts +1 -3
- package/dist/domain/relations/indirect-relation.d.ts +1 -4
- package/dist/domain/relations/indirect-relation.js +1 -1
- package/dist/domain/relations/reference-component.d.ts +3 -5
- package/dist/domain/relations/reference-component.js +1 -1
- package/dist/domain/relations/reference-field.d.ts +1 -1
- package/dist/domain/relations/relation-factory.d.ts +1 -3
- package/dist/domain/relations/relation-implementation.d.ts +1 -4
- package/dist/domain/system-components/admin-sidebar.d.ts +1 -1
- package/dist/domain/system-components/admin-sidebar.js +1 -1
- package/dist/domain/system-components/angle-dimension.js +1 -1
- package/dist/domain/system-components/angle-indicator.d.ts +1 -1
- package/dist/domain/system-components/angle-indicator.js +1 -1
- package/dist/domain/system-components/application-config.d.ts +1 -1
- package/dist/domain/system-components/application-config.js +1 -1
- package/dist/domain/system-components/attribute-selection.js +1 -1
- package/dist/domain/system-components/attribute-switch.js +1 -1
- package/dist/domain/system-components/autorotate-camera-component.d.ts +1 -1
- package/dist/domain/system-components/autorotate-camera-component.js +1 -1
- package/dist/domain/system-components/basic-sidebar-footer.d.ts +1 -1
- package/dist/domain/system-components/basic-sidebar-footer.js +1 -1
- package/dist/domain/system-components/bounding-box-component.d.ts +1 -1
- package/dist/domain/system-components/bounding-box-component.js +1 -1
- package/dist/domain/system-components/bounding-sphere-component.d.ts +1 -1
- package/dist/domain/system-components/bounding-sphere-component.js +1 -1
- package/dist/domain/system-components/camera-based-hidden-entity-object.js +1 -1
- package/dist/domain/system-components/camera-based-hidden-entity.js +1 -1
- package/dist/domain/system-components/canvas-config.d.ts +1 -1
- package/dist/domain/system-components/canvas-config.js +1 -1
- package/dist/domain/system-components/canvas-custom-environment.js +1 -1
- package/dist/domain/system-components/canvas-padding.d.ts +1 -1
- package/dist/domain/system-components/canvas-padding.js +1 -1
- package/dist/domain/system-components/canvas-preset-environment.d.ts +1 -1
- package/dist/domain/system-components/canvas-preset-environment.js +1 -1
- package/dist/domain/system-components/child-entity-recipe-hierarchy.d.ts +1 -1
- package/dist/domain/system-components/child-entity-recipe-hierarchy.js +1 -1
- package/dist/domain/system-components/child-entity-recipes.d.ts +1 -1
- package/dist/domain/system-components/child-entity-recipes.js +1 -1
- package/dist/domain/system-components/child-entity-selection.d.ts +1 -1
- package/dist/domain/system-components/child-entity-selection.js +1 -1
- package/dist/domain/system-components/client-side-image.js +1 -1
- package/dist/domain/system-components/collision-box-geometry.d.ts +1 -1
- package/dist/domain/system-components/collision-box-geometry.js +1 -1
- package/dist/domain/system-components/collision-geometries.d.ts +1 -1
- package/dist/domain/system-components/collision-geometry.d.ts +1 -1
- package/dist/domain/system-components/collision-geometry.js +1 -1
- package/dist/domain/system-components/collision-point-geometry.d.ts +1 -1
- package/dist/domain/system-components/collision-point-geometry.js +1 -1
- package/dist/domain/system-components/color-value.js +1 -1
- package/dist/domain/system-components/common/dimension-indicator-schema.d.ts +1 -1
- package/dist/domain/system-components/common/dimension-indicator-schema.js +1 -1
- package/dist/domain/system-components/constraint.d.ts +1 -1
- package/dist/domain/system-components/constraint.js +1 -1
- package/dist/domain/system-components/create-blueprint.d.ts +1 -1
- package/dist/domain/system-components/custom-header.d.ts +1 -1
- package/dist/domain/system-components/custom-header.js +1 -1
- package/dist/domain/system-components/custom-price-footer.js +1 -1
- package/dist/domain/system-components/custom-scene-entity.d.ts +1 -1
- package/dist/domain/system-components/custom-scene-entity.js +1 -1
- package/dist/domain/system-components/custom-sidebar-footer.d.ts +1 -1
- package/dist/domain/system-components/custom-sidebar-footer.js +1 -1
- package/dist/domain/system-components/detail.js +1 -1
- package/dist/domain/system-components/dimension-indicator.d.ts +1 -1
- package/dist/domain/system-components/dimension-indicator.js +1 -1
- package/dist/domain/system-components/distance-dimension-select.d.ts +1 -1
- package/dist/domain/system-components/distance-dimension-select.js +1 -1
- package/dist/domain/system-components/distance-dimension.d.ts +1 -1
- package/dist/domain/system-components/distance-dimension.js +1 -1
- package/dist/domain/system-components/drag-handle.d.ts +1 -1
- package/dist/domain/system-components/drag-handle.js +1 -1
- package/dist/domain/system-components/editable-angle-indicator.d.ts +1 -1
- package/dist/domain/system-components/editable-angle-indicator.js +1 -1
- package/dist/domain/system-components/editable-distance-dimension-indicator.d.ts +1 -1
- package/dist/domain/system-components/editable-distance-dimension-indicator.js +1 -1
- package/dist/domain/system-components/editable-offset-indicator.d.ts +1 -1
- package/dist/domain/system-components/editable-offset-indicator.js +1 -1
- package/dist/domain/system-components/editable-size-indicator.d.ts +1 -1
- package/dist/domain/system-components/editable-size-indicator.js +1 -1
- package/dist/domain/system-components/entity-header.js +1 -1
- package/dist/domain/system-components/exit-tool-mode-fab.d.ts +1 -1
- package/dist/domain/system-components/exit-tool-mode-fab.js +1 -1
- package/dist/domain/system-components/finalize-action.d.ts +1 -1
- package/dist/domain/system-components/finalize-action.js +1 -1
- package/dist/domain/system-components/finalize-component.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/fit-selection-orthographic-camera-component.js +1 -1
- package/dist/domain/system-components/fit-selection-perspective-camera-component.js +1 -1
- package/dist/domain/system-components/fixed-header.d.ts +1 -1
- package/dist/domain/system-components/fixed-header.js +1 -1
- package/dist/domain/system-components/floating-header.d.ts +1 -1
- package/dist/domain/system-components/floating-header.js +1 -1
- package/dist/domain/system-components/generic-dimension.d.ts +1 -1
- package/dist/domain/system-components/generic-dimension.js +1 -1
- package/dist/domain/system-components/hidden-entity.js +1 -1
- package/dist/domain/system-components/hidden-header.d.ts +1 -1
- package/dist/domain/system-components/hidden-header.js +1 -1
- package/dist/domain/system-components/hidden-sidebar-footer.d.ts +1 -1
- package/dist/domain/system-components/hidden-sidebar-footer.js +1 -1
- package/dist/domain/system-components/horizontal-tabs.d.ts +1 -1
- package/dist/domain/system-components/horizontal-tabs.js +1 -1
- package/dist/domain/system-components/hotspot-drag-handle.d.ts +1 -2
- package/dist/domain/system-components/hotspot-drag-handle.js +1 -1
- package/dist/domain/system-components/list-selector-dimension-indicator.d.ts +1 -1
- package/dist/domain/system-components/list-selector-dimension-indicator.js +1 -1
- package/dist/domain/system-components/material-override-property-transition.js +1 -1
- package/dist/domain/system-components/material-override-transformer.js +1 -1
- package/dist/domain/system-components/material-swatch.js +1 -1
- package/dist/domain/system-components/multilingual-text-value.js +1 -1
- package/dist/domain/system-components/navigation-page.js +1 -1
- package/dist/domain/system-components/navigation-panel-list.js +1 -1
- package/dist/domain/system-components/navigation-steps.js +1 -1
- package/dist/domain/system-components/offset-anchors.d.ts +1 -1
- package/dist/domain/system-components/offset-anchors.js +1 -1
- package/dist/domain/system-components/offset-indicator.d.ts +1 -2
- package/dist/domain/system-components/offset-indicator.js +1 -1
- package/dist/domain/system-components/offset.d.ts +1 -1
- package/dist/domain/system-components/offset.js +1 -1
- package/dist/domain/system-components/other-action.d.ts +1 -1
- package/dist/domain/system-components/other-action.js +1 -1
- package/dist/domain/system-components/phoenix-layout-elements/assistant-toolbar-button.d.ts +44 -0
- package/dist/domain/system-components/phoenix-layout-elements/assistant-toolbar-button.js +1 -0
- package/dist/domain/system-components/phoenix-layout-elements/index.d.ts +1 -0
- package/dist/domain/system-components/phoenix-layout-elements/index.js +1 -1
- package/dist/domain/system-components/phoenix-layout-elements/phoenix-layout-element.d.ts +2 -1
- package/dist/domain/system-components/phoenix-layout-elements/phoenix-layout-element.js +1 -1
- package/dist/domain/system-components/pivot-point.d.ts +1 -1
- package/dist/domain/system-components/pivot-point.js +1 -1
- package/dist/domain/system-components/price.js +1 -1
- package/dist/domain/system-components/projected-entities.d.ts +1 -1
- package/dist/domain/system-components/projected-entities.js +1 -1
- package/dist/domain/system-components/property-page.d.ts +1 -1
- package/dist/domain/system-components/property-page.js +1 -1
- package/dist/domain/system-components/read-sidebar-footer.d.ts +1 -1
- package/dist/domain/system-components/read-sidebar-footer.js +1 -1
- package/dist/domain/system-components/replace-entity-recipe-hierarchy.d.ts +1 -1
- package/dist/domain/system-components/replace-entity-recipe-hierarchy.js +1 -1
- package/dist/domain/system-components/replace-entity-recipes.d.ts +1 -1
- package/dist/domain/system-components/replace-entity-recipes.js +1 -1
- package/dist/domain/system-components/rotatable.js +1 -1
- package/dist/domain/system-components/rotation-handle.js +1 -1
- package/dist/domain/system-components/save-template-thumbnail.js +1 -1
- package/dist/domain/system-components/scene-entity-add-fab.js +1 -1
- package/dist/domain/system-components/scene-entity-ambient-light.js +1 -1
- package/dist/domain/system-components/scene-entity-animation.js +1 -1
- package/dist/domain/system-components/scene-entity-box-object.js +1 -1
- package/dist/domain/system-components/scene-entity-control.js +1 -1
- package/dist/domain/system-components/scene-entity-delete-fab.js +1 -1
- package/dist/domain/system-components/scene-entity-directional-light.js +1 -1
- package/dist/domain/system-components/scene-entity-floor-object.js +1 -1
- package/dist/domain/system-components/scene-entity-html-hotspot.js +1 -1
- package/dist/domain/system-components/scene-entity-local-material-override.js +1 -1
- package/dist/domain/system-components/scene-entity-material-override.js +1 -1
- package/dist/domain/system-components/scene-entity-navigation-hotspot.js +1 -1
- package/dist/domain/system-components/scene-entity-object-clip.js +1 -1
- package/dist/domain/system-components/scene-entity-object-decal.js +1 -1
- package/dist/domain/system-components/scene-entity-object-group.js +1 -1
- package/dist/domain/system-components/scene-entity-object-html-hotspot.js +1 -1
- package/dist/domain/system-components/scene-entity-object-local-material-override.js +1 -1
- package/dist/domain/system-components/scene-entity-object-material-override.js +1 -1
- package/dist/domain/system-components/scene-entity-object-properties.js +1 -1
- package/dist/domain/system-components/scene-entity-object-remote-material-override.js +1 -1
- package/dist/domain/system-components/scene-entity-object-text-decal.js +1 -1
- package/dist/domain/system-components/scene-entity-object-transformer.js +1 -1
- package/dist/domain/system-components/scene-entity-object-transimissive-material-override.js +1 -1
- package/dist/domain/system-components/scene-entity-object.js +1 -1
- package/dist/domain/system-components/scene-entity-point-light.js +1 -1
- package/dist/domain/system-components/scene-entity-properties.js +1 -1
- package/dist/domain/system-components/scene-entity-rect-area-light.js +1 -1
- package/dist/domain/system-components/scene-entity-remote-material-override.js +1 -1
- package/dist/domain/system-components/scene-entity-remote-object.js +1 -1
- package/dist/domain/system-components/scene-entity-select-hotspot.js +1 -1
- package/dist/domain/system-components/scene-entity-spot-light.js +1 -1
- package/dist/domain/system-components/scene-entity-transimissive-material-override.js +1 -1
- package/dist/domain/system-components/scene-entity-wall-object.js +1 -1
- package/dist/domain/system-components/selectable-component.js +1 -1
- package/dist/domain/system-components/sidebar-tabs.d.ts +1 -1
- package/dist/domain/system-components/sidebar-tabs.js +1 -1
- package/dist/domain/system-components/simple-summary.js +1 -1
- package/dist/domain/system-components/size.d.ts +1 -1
- package/dist/domain/system-components/size.js +1 -1
- package/dist/domain/system-components/sketching-draw.d.ts +1 -1
- package/dist/domain/system-components/sketching-draw.js +1 -1
- package/dist/domain/system-components/sketching-edit.d.ts +1 -1
- package/dist/domain/system-components/sketching-edit.js +1 -1
- package/dist/domain/system-components/sketching-line.d.ts +1 -1
- package/dist/domain/system-components/sketching-line.js +1 -1
- package/dist/domain/system-components/sketching-rectangle.d.ts +1 -1
- package/dist/domain/system-components/sketching-rectangle.js +1 -1
- package/dist/domain/system-components/sketching.d.ts +1 -1
- package/dist/domain/system-components/sketching.js +1 -1
- package/dist/domain/system-components/snap-axis.d.ts +1 -1
- package/dist/domain/system-components/snap-axis.js +1 -1
- package/dist/domain/system-components/snap-edge.d.ts +1 -1
- package/dist/domain/system-components/snap-edge.js +1 -1
- package/dist/domain/system-components/snap-plane.d.ts +1 -1
- package/dist/domain/system-components/snap-plane.js +1 -1
- package/dist/domain/system-components/snap-point.d.ts +1 -1
- package/dist/domain/system-components/snap-point.js +1 -1
- package/dist/domain/system-components/static-orthographic-camera-component.d.ts +1 -1
- package/dist/domain/system-components/static-orthographic-camera-component.js +1 -1
- package/dist/domain/system-components/static-perspective-camera-component.d.ts +1 -1
- package/dist/domain/system-components/static-perspective-camera-component.js +1 -1
- package/dist/domain/system-components/summary-component.js +1 -1
- package/dist/domain/system-components/text-value.js +1 -1
- package/dist/domain/system-components/tool-controls.js +1 -1
- package/dist/domain/system-components/tool-menu-fab.d.ts +1 -1
- package/dist/domain/system-components/tool-menu-fab.js +1 -1
- package/dist/domain/system-components/toolbar.d.ts +1 -1
- package/dist/domain/system-components/toolbar.js +1 -1
- package/dist/domain/system-components/universal-sidebar-footer.d.ts +1 -1
- package/dist/domain/system-components/universal-sidebar-footer.js +1 -1
- package/dist/domain/system-components/view-controls.js +1 -1
- package/dist/domain/utils/eval-cache.d.ts +1 -2
- package/dist/domain/utils/memo-eval.d.ts +1 -3
- package/dist/editor/Editor.js +1 -1
- package/dist/editor/domain-editors/DomainSpecContext.js +1 -1
- package/dist/editor/domain-editors/apply-spec-update.js +1 -1
- package/dist/editor/domain-editors/use-implementation-files.d.ts +11 -6
- package/dist/editor/domain-editors/use-implementation-files.js +1 -1
- package/dist/editor/graphql/GraphQLPanel.js +1 -1
- package/dist/editor/variants/VariantAnswerFooter.d.ts +17 -0
- package/dist/editor/variants/VariantAnswerFooter.js +1 -0
- package/dist/editor/variants/VariantPreviewHandler.d.ts +6 -0
- package/dist/editor/variants/VariantPreviewHandler.js +1 -0
- package/dist/editor/variants/variant-preview-styles.d.ts +49 -0
- package/dist/editor/variants/variant-preview-styles.js +1 -0
- package/dist/i18n/locales/cs/messages.js +1 -1
- package/dist/i18n/locales/da/messages.js +1 -1
- package/dist/i18n/locales/de/messages.js +1 -1
- package/dist/i18n/locales/de-AT/messages.js +1 -1
- package/dist/i18n/locales/en/messages.js +1 -1
- package/dist/i18n/locales/en-AU/messages.js +1 -1
- package/dist/i18n/locales/en-GB/messages.js +1 -1
- package/dist/i18n/locales/es/messages.js +1 -1
- package/dist/i18n/locales/fr/messages.js +1 -1
- package/dist/i18n/locales/hu/messages.js +1 -1
- package/dist/i18n/locales/it/messages.js +1 -1
- package/dist/i18n/locales/nl/messages.js +1 -1
- package/dist/i18n/locales/pl/messages.js +1 -1
- package/dist/i18n/locales/pt/messages.js +1 -1
- package/dist/i18n/locales/ro/messages.js +1 -1
- package/dist/i18n/locales/sk/messages.js +1 -1
- package/dist/i18n/locales/tr/messages.js +1 -1
- package/dist/legacy/domain-cli/gen/configurator-builder.js +21 -8
- 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 +6 -0
- package/dist/legacy/phoenix-cli/project-gen/generators/file-templates/frontend-admin.js +18 -19
- package/dist/legacy/phoenix-cli/project-gen/generators/file-templates/frontend-configurator.js +15 -16
- package/dist/legacy/phoenix-cli/project-gen/generators/file-templates/frontend-embedded-admin.js +22 -23
- package/dist/legacy/phoenix-cli/project-gen/generators/file-templates/frontend-embedded-configurator.js +15 -16
- package/dist/legacy/phoenix-cli/project-gen/generators/file-templates/generator-shared.d.ts +7 -2
- package/dist/legacy/phoenix-cli/project-gen/generators/file-templates/generator-shared.js +8 -12
- package/dist/legacy/phoenix-cli/project-gen/generators/file-templates/index.d.ts +1 -1
- package/dist/legacy/phoenix-cli/project-gen/generators/file-templates/index.js +1 -1
- package/dist/legacy/phoenix-cli/project-gen/generators/file-templates/webhook-builders.js +7 -7
- package/dist/phoenix/application-spec/application-spec-builder.js +1 -1
- package/dist/phoenix/application-spec/resolve-deployment-data.d.ts +4 -3
- package/dist/phoenix/application-spec/resolve-deployment-data.js +2 -2
- package/dist/phoenix/cli.js +1 -1
- package/dist/phoenix/commands/build.d.ts +5 -0
- package/dist/phoenix/commands/build.js +1 -1
- package/dist/phoenix/commands/deploy.js +2 -2
- package/dist/phoenix/commands/dev.js +5 -5
- package/dist/phoenix/commands/feedback.d.ts +2 -1
- package/dist/phoenix/commands/feedback.js +1 -1
- package/dist/phoenix/commands/index.d.ts +1 -0
- package/dist/phoenix/commands/index.js +1 -1
- package/dist/phoenix/commands/login.d.ts +24 -6
- package/dist/phoenix/commands/login.js +2 -2
- package/dist/phoenix/commands/prepare-deployment-command.js +2 -2
- package/dist/phoenix/commands/prepare-local-environment-command.js +1 -1
- package/dist/phoenix/commands/story-dev.js +2 -2
- package/dist/phoenix/commands/variants.d.ts +35 -0
- package/dist/phoenix/commands/variants.js +1 -0
- package/dist/phoenix/editor-server/commands-router.d.ts +68 -1
- package/dist/phoenix/editor-server/commands-router.js +1 -1
- package/dist/phoenix/editor-server/editor-router.d.ts +65 -0
- package/dist/phoenix/editor-server/editor-server.d.ts +3 -3
- package/dist/phoenix/editor-server/editor-server.js +1 -1
- package/dist/phoenix/editor-server/protocol.d.ts +1 -0
- package/dist/phoenix/editor-server/spec-router.js +1 -1
- package/dist/phoenix/editor-server/trpc.d.ts +3 -0
- package/dist/phoenix/scripts/build-admin.js +1 -1
- package/dist/phoenix/services/application-spec-project-watcher.d.ts +13 -2
- package/dist/phoenix/services/application-spec-project-watcher.js +3 -3
- package/dist/phoenix/services/index.d.ts +5 -0
- package/dist/phoenix/services/index.js +1 -1
- package/dist/phoenix/services/phoenix-application.d.ts +21 -0
- package/dist/phoenix/services/phoenix-application.js +1 -0
- package/dist/phoenix/services/phoenix-store.d.ts +48 -0
- package/dist/phoenix/services/phoenix-store.js +1 -0
- package/dist/phoenix/services/phx-banner-plugin.d.ts +32 -0
- package/dist/phoenix/services/phx-banner-plugin.js +1 -0
- package/dist/phoenix/services/phx-licenses-plugin.d.ts +55 -0
- package/dist/phoenix/services/phx-licenses-plugin.js +8 -0
- package/dist/phoenix/services/phx-variant-previews-plugin.d.ts +9 -0
- package/dist/phoenix/services/phx-variant-previews-plugin.js +1 -0
- package/dist/phoenix/services/prepare-development-environment.js +1 -1
- package/dist/phoenix/services/variant-file-session.d.ts +36 -0
- package/dist/phoenix/services/variant-file-session.js +1 -0
- package/dist/phoenix/services/variant-preview-service.d.ts +80 -0
- package/dist/phoenix/services/variant-preview-service.js +1 -0
- package/dist/phoenix/services/vite-config.d.ts +2 -0
- package/dist/phoenix/services/vite-config.js +1 -1
- package/dist/phoenix/utils/index.d.ts +1 -0
- package/dist/phoenix/utils/index.js +1 -1
- package/dist/phoenix/utils/read-git-commit.d.ts +14 -0
- package/dist/phoenix/utils/read-git-commit.js +1 -0
- package/dist/react-sdk/application-runtime/common-services/analytics/analytics-service.d.ts +2 -2
- package/dist/react-sdk/application-runtime/common-services/analytics/domain-controls-analytics.d.ts +21 -21
- package/dist/react-sdk/application-runtime/hooks/data/use-published-data.d.ts +1 -1
- package/dist/react-sdk/application-runtime/hooks/use-domain-application-props.d.ts +5 -2
- package/dist/react-sdk/application-runtime/hooks/use-spec.d.ts +1 -1
- package/dist/react-sdk/application-runtime/mocks/create-mock-application-runtime.d.ts +1 -1
- package/dist/react-sdk/application-runtime/mocks/create-mock-application-runtime.js +1 -1
- package/dist/react-sdk/application-runtime/runtime/create-application-runtime.d.ts +16 -4
- package/dist/react-sdk/domain-context/common-hooks/use-domain-context.d.ts +3 -0
- package/dist/ui-sdk/common/use-viewport-size.d.ts +4 -1
- package/dist/ui-sdk/common/use-viewport-size.js +1 -1
- package/dist/ui-sdk/components/mobile-controls/index.d.ts +1 -1
- package/dist/ui-sdk/theme/types.d.ts +4 -0
- package/dist/webhook/builders/common.d.ts +3 -0
- package/dist/webhook/builders/webhook-builder.d.ts +1 -1
- package/dist/webhook/builders/webhook-builder.js +1 -1
- package/package.json +5 -8
- package/schema/domain-spec.json +24 -0
- package/dist/application-spec/generate-application/code/templates/agents-md.js +0 -2
- package/dist/application-spec/generate-application/code/templates/common/sdk-content.js +0 -67
- package/dist/application-spec/generate-application/code/templates/phoenix-cli-skill.js +0 -1
- package/dist/application-spec/generate-application/code/templates/phoenix-feedback-skill.js +0 -31
- package/dist/application-spec/generate-application/code/templates/phoenix-skill.js +0 -1
- package/dist/configurator/assistant/browser-details.js +0 -1
- package/dist/configurator/assistant/graphql-tools.js +0 -1
- package/dist/configurator/assistant/index.d.ts +0 -1
- package/dist/configurator/assistant/index.js +0 -1
- package/dist/configurator/assistant/use-assistant-chat.d.ts +0 -20
- package/dist/configurator/assistant/use-assistant-chat.js +0 -1
- package/dist/domain/components/debug-state-component.js +0 -1
- package/dist/domain/components/domain-component-optic.js +0 -16
- package/dist/domain/components/drag-state-component.js +0 -1
- package/dist/domain/components/export-state-component.js +0 -1
- package/dist/domain/components/fullscreen-state-component.js +0 -1
- package/dist/domain/components/group-components-by-entity-id-and-name.js +0 -1
- package/dist/domain/components/hover-state-component.js +0 -1
- package/dist/domain/components/index.d.ts +0 -2
- package/dist/domain/components/index.js +0 -1
- package/dist/domain/components/navigation-state-component.js +0 -1
- package/dist/domain/components/selection-state-component.js +0 -1
- package/dist/domain/components/system-component-builder.js +0 -1
- package/dist/domain/components/system-virtual-entity.js +0 -1
- package/dist/domain/components/tool-state-component.js +0 -1
- package/dist/domain/components/view-state-component.js +0 -1
- package/dist/domain/components/viewport-state-component.js +0 -1
- package/dist/domain/core/json-schema.js +0 -1
- package/dist/domain/core/reflection.js +0 -1
- package/dist/domain/expressions/constant-expressions.js +0 -1
- package/dist/domain/expressions/custom-expression.js +0 -1
- package/dist/domain/expressions/index.d.ts +0 -1
- package/dist/domain/expressions/index.js +0 -1
- package/dist/domain/invariants/custom-invariants.js +0 -1
- package/dist/domain/invariants/invariants.js +0 -1
- package/dist/domain/invariants/violation-component.js +0 -1
- package/dist/extras/assistant/AssistantChat.d.ts +0 -6
- package/dist/extras/assistant/AssistantChat.js +0 -1
- package/dist/extras/assistant/index.d.ts +0 -1
- package/dist/extras/assistant/index.js +0 -1
- package/dist/phoenix/application-spec/generate-assistant-prompt.d.ts +0 -12
- package/dist/phoenix/application-spec/generate-assistant-prompt.js +0 -1
- /package/dist/application-spec/generate-application/code/templates/{common → skills}/agent-skill.d.ts +0 -0
- /package/dist/application-spec/generate-application/code/templates/{common → skills}/agent-skill.js +0 -0
- /package/dist/application-spec/generate-application/code/templates/{agents-md.d.ts → skills/agents-md.d.ts} +0 -0
- /package/dist/application-spec/generate-application/code/templates/{phoenix-cli-skill.d.ts → skills/phoenix-cli-skill.d.ts} +0 -0
- /package/dist/application-spec/generate-application/code/templates/{phoenix-feedback-skill.d.ts → skills/phoenix-feedback-skill.d.ts} +0 -0
- /package/dist/application-spec/generate-application/code/templates/{phoenix-review-skill.d.ts → skills/phoenix-review-skill.d.ts} +0 -0
- /package/dist/application-spec/generate-application/code/templates/{phoenix-skill.d.ts → skills/phoenix-skill.d.ts} +0 -0
- /package/dist/domain/{components/component-reader-types.js → application/assistant/assistant-manifest.js} +0 -0
- /package/dist/domain/{core/enhanced-json-schema.js → application/assistant/assistant-resolved-manifest.js} +0 -0
- /package/dist/domain/core/{expression.js → action/action.js} +0 -0
- /package/dist/domain/core/{schema-validator.js → component/component-reader-types.js} +0 -0
- /package/dist/domain/{components → core/component}/legacy-filter.js +0 -0
- /package/dist/domain/{components → core/component}/system-component-filter.js +0 -0
- /package/dist/domain/{components → core/component}/system-virtual-entity.d.ts +0 -0
- /package/dist/domain/{components → core/component}/updates.js +0 -0
- /package/dist/domain/{expressions → core/expression}/memoize-expression.js +0 -0
- /package/dist/domain/{expressions → core/expression}/prepare-domain-expressions.js +0 -0
- /package/dist/domain/{invariants → core/invariant}/builtin-invariant.js +0 -0
- /package/dist/domain/{invariants → core/invariant}/violation-component.d.ts +0 -0
- /package/dist/domain/{invariants → core/invariant}/violation.js +0 -0
- /package/dist/domain/core/{alias.d.ts → model/alias.d.ts} +0 -0
- /package/dist/domain/core/{alias.js → model/alias.js} +0 -0
- /package/dist/domain/core/{common-definitions.d.ts → model/common-definitions.d.ts} +0 -0
- /package/dist/domain/core/{common-definitions.js → model/common-definitions.js} +0 -0
- /package/dist/domain/core/{component.js → model/component.js} +0 -0
- /package/dist/domain/core/{model.d.ts → model/model.d.ts} +0 -0
- /package/dist/domain/core/{model.js → model/model.js} +0 -0
- /package/dist/domain/core/{preset.d.ts → model/preset.d.ts} +0 -0
- /package/dist/domain/core/{preset.js → model/preset.js} +0 -0
- /package/dist/domain/core/{schema-validator-ajv.d.ts → schema/create-ajv-schema-validator.d.ts} +0 -0
- /package/dist/domain/core/{schema-validator-ajv.js → schema/create-ajv-schema-validator.js} +0 -0
- /package/dist/domain/core/{schema-validator-csp.d.ts → schema/create-csp-schema-validator.d.ts} +0 -0
- /package/dist/domain/core/{schema-validator-csp.js → schema/create-csp-schema-validator.js} +0 -0
- /package/dist/domain/core/{enhanced-json-schema.d.ts → schema/enhanced-json-schema.d.ts} +0 -0
- /package/dist/domain/core/{json-schema.d.ts → schema/extended-schema-validator.d.ts} +0 -0
- /package/dist/domain/core/{schema-validator.d.ts → schema/schema-validator.d.ts} +0 -0
- /package/dist/domain/core/{migrations.js → state/migrations.js} +0 -0
- /package/dist/domain/core/{state.js → state/state.js} +0 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { DomainEntity, DomainEntityId } from '../
|
|
2
|
-
import type { DomainState } from '../
|
|
1
|
+
import type { DomainEntity, DomainEntityId } from '../model/index.js';
|
|
2
|
+
import type { DomainState } from '../state/index.js';
|
|
3
3
|
import type { Invariant } from './invariants.js';
|
|
4
4
|
import type { Violation } from './violation.js';
|
|
5
5
|
export declare const createInvariant: <VIOLATION_TYPE extends string>(evaluate: (selfId: DomainEntityId<string>, state: DomainState<DomainEntity<string>>) => ReadonlyArray<Violation<VIOLATION_TYPE>>) => Invariant<DomainEntity<string>, DomainEntity<string>, Record<string, unknown>, Record<string, unknown>, Record<string, unknown>, DomainEntity<string>, VIOLATION_TYPE>;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import type { OmitEmpty, OmitNever } from '@salsita-ai/common/utils';
|
|
2
|
-
import type {
|
|
3
|
-
import type { $DomainEntity, DomainEntity } from '../
|
|
4
|
-
import type { CustomExpression } from '../expressions/custom-expression.js';
|
|
2
|
+
import type { CustomExpression } from '../expression/index.js';
|
|
3
|
+
import type { $DomainEntity, DomainEntity, ExpandAlias, TypeOrAlias } from '../model/index.js';
|
|
5
4
|
import type { Invariant } from './invariants.js';
|
|
6
5
|
import type { Violation } from './violation.js';
|
|
7
6
|
export type CustomInvariantsFromBlueprints<ENTITIES extends DomainEntity<string>, ALLOWED_ROOT_ENTITIES extends ENTITIES, $MAP extends Record<ENTITIES['type'], $DomainEntity<ENTITIES>>, PUBLISHED_DATA extends Record<string, unknown>, SESSION_DATA extends Record<string, unknown>, FRONTEND_DATA extends Record<string, unknown>, BLUEPRINTS extends Partial<Record<keyof $MAP & string, Record<string, boolean | string>>>> = {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{withProfilerLabel as t}from"../../utils/profiler-label.js";export const createCustomInvariantFactory=()=>e=>r=>{let n={};return Object.entries(r).forEach(([r,o])=>{let a=Object.entries(o).map(([n,o])=>({evaluate:t(`${r}_invariant_${n}`,(t,a,i)=>{let l=o(i.domain.get$Entity(t,a),a,i);if("boolean"==typeof l){let t=e[r]?.[n];if(!t)throw Error(`Cannot find statically defined violation for ${r}.${n}`);return l?[]:[t]}return l})}));n[r]=a}),n};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export*from"./builtin-invariant.js";export*from"./custom-invariants.js";export*from"./invariants.js";export*from"./violation-component.js";export*from"./violation.js";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { OmitNever } from '@salsita-ai/common/utils';
|
|
2
|
-
import { type
|
|
3
|
-
import type { AnonymousExpression, ExpressionContext } from '../
|
|
4
|
-
import type
|
|
5
|
-
import type { DomainState } from '../
|
|
2
|
+
import { type ProjectModule } from '../../project-modules/index.js';
|
|
3
|
+
import type { AnonymousExpression, ExpressionContext } from '../expression/index.js';
|
|
4
|
+
import { type $DomainEntity, type AliasMap, type DomainEntity, type EntityByType, type EventualAlias, type ExpandAlias, type ExtractFromAliasedRecord, type TypeOrAlias } from '../model/index.js';
|
|
5
|
+
import type { DomainState } from '../state/index.js';
|
|
6
6
|
import { type Violation } from './violation.js';
|
|
7
7
|
export interface Invariant<ENTITIES extends DomainEntity<string>, ALLOWED_ROOT_ENTITIES extends ENTITIES, PUBLISHED_DATA extends Record<string, unknown>, SESSION_DATA extends Record<string, unknown>, FRONTEND_DATA extends Record<string, unknown>, ENTITY extends ENTITIES, VIOLATION_TYPE extends string> {
|
|
8
8
|
evaluate(selfId: ENTITY['id'], state: DomainState<ENTITIES>, ctx: ExpressionContext<ENTITIES, ALLOWED_ROOT_ENTITIES, PUBLISHED_DATA, SESSION_DATA, FRONTEND_DATA>): ReadonlyArray<Violation<VIOLATION_TYPE>>;
|
|
@@ -38,10 +38,18 @@ type ExpressionsFromInvariants<ENTITIES extends DomainEntity<string>, ALLOWED_RO
|
|
|
38
38
|
};
|
|
39
39
|
};
|
|
40
40
|
type BuildViolationExpressions<ENTITIES extends DomainEntity<string>, ALLOWED_ROOT_ENTITIES extends ENTITIES, $MAP extends Record<ENTITIES['type'], $DomainEntity<ENTITIES>>, PUBLISHED_DATA extends Record<string, unknown>, SESSION_DATA extends Record<string, unknown>, FRONTEND_DATA extends Record<string, unknown>, INVARIANTS extends Partial<Record<ENTITIES['type'], ReadonlyArray<Invariant<ENTITIES, ALLOWED_ROOT_ENTITIES, PUBLISHED_DATA, SESSION_DATA, FRONTEND_DATA, ENTITIES, string>>>>> = Record<never, never> extends ConflictingInvariants<ENTITIES, ALLOWED_ROOT_ENTITIES, PUBLISHED_DATA, SESSION_DATA, FRONTEND_DATA, DeclaredInvariants<ENTITIES, ALLOWED_ROOT_ENTITIES, $MAP, PUBLISHED_DATA, SESSION_DATA, FRONTEND_DATA>, INVARIANTS> ? () => ExpressionsFromInvariants<ENTITIES, ALLOWED_ROOT_ENTITIES, PUBLISHED_DATA, SESSION_DATA, FRONTEND_DATA, INVARIANTS> : never;
|
|
41
|
+
type AnyInvariant = Invariant<any, any, any, any, any, any, string>;
|
|
42
|
+
/** Validates the `src/invariants/` files and concatenates their invariants per entity type or alias. */
|
|
43
|
+
export declare const resolveInvariantModules: (modules: readonly ProjectModule[]) => Readonly<Record<string, readonly AnyInvariant[]>>;
|
|
41
44
|
export declare class InvariantBuilder<ENTITIES extends DomainEntity<string>, ALLOWED_ROOT_ENTITIES extends ENTITIES, $MAP extends Record<ENTITIES['type'], $DomainEntity<ENTITIES>>, PUBLISHED_DATA extends Record<string, unknown>, SESSION_DATA extends Record<string, unknown>, FRONTEND_DATA extends Record<string, unknown>, ALIASES extends Record<string, ENTITIES>, INVARIANTS extends Partial<Record<ENTITIES['type'], ReadonlyArray<Invariant<ENTITIES, ALLOWED_ROOT_ENTITIES, PUBLISHED_DATA, SESSION_DATA, FRONTEND_DATA, ENTITIES, string>>>> = Record<never, never>> {
|
|
42
45
|
private readonly aliasMap;
|
|
43
46
|
private readonly invariants;
|
|
44
47
|
constructor(aliasMap: AliasMap<ALIASES>, invariants?: INVARIANTS);
|
|
48
|
+
/**
|
|
49
|
+
* Adds the invariants of the `src/invariants/` files, as the generated barrel lists them, after
|
|
50
|
+
* checking each file against the folder's contract.
|
|
51
|
+
*/
|
|
52
|
+
withInvariantModules(modules: readonly ProjectModule[]): InvariantBuilder<ENTITIES, ALLOWED_ROOT_ENTITIES, $MAP, PUBLISHED_DATA, SESSION_DATA, FRONTEND_DATA, ALIASES, ExpandAndMergeInvariants<ENTITIES, ALLOWED_ROOT_ENTITIES, PUBLISHED_DATA, SESSION_DATA, FRONTEND_DATA, ALIASES, INVARIANTS, AliasedInvariants<ENTITIES, ALLOWED_ROOT_ENTITIES, PUBLISHED_DATA, SESSION_DATA, FRONTEND_DATA, ALIASES, string>>>;
|
|
45
53
|
withInvariants<ALIASED_INVARIANTS extends AliasedInvariants<ENTITIES, ALLOWED_ROOT_ENTITIES, PUBLISHED_DATA, SESSION_DATA, FRONTEND_DATA, ALIASES, string>>(aliasedInvariants: ALIASED_INVARIANTS): InvariantBuilder<ENTITIES, ALLOWED_ROOT_ENTITIES, $MAP, PUBLISHED_DATA, SESSION_DATA, FRONTEND_DATA, ALIASES, ExpandAndMergeInvariants<ENTITIES, ALLOWED_ROOT_ENTITIES, PUBLISHED_DATA, SESSION_DATA, FRONTEND_DATA, ALIASES, INVARIANTS, ALIASED_INVARIANTS>>;
|
|
46
54
|
/**
|
|
47
55
|
* DO NOT USE in runtime!
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{SHARED_FOLDER_HINT as t,createContractError as e,isRecord as a}from"../../project-modules/index.js";import{expandAlias as i}from"../model/index.js";let r={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/), ${t}.`},n=t=>a(t)&&"function"==typeof t.evaluate,s=t=>a(t)&&Object.values(t).every(t=>Array.isArray(t)&&t.every(n));export const resolveInvariantModules=t=>{let a={};for(let i of t){if(!s(i.exports))throw e(i.origin,r,i.exports);for(let[t,e]of Object.entries(i.exports))a[t]=[...a[t]??[],...e]}return a};export class InvariantBuilder{aliasMap;invariants;constructor(t,e={}){this.aliasMap=t,this.invariants=e}withInvariantModules(t){return this.withInvariants(resolveInvariantModules(t))}withInvariants(t){let e={...this.invariants};return Object.entries(t).forEach(([t,a])=>{i(this.aliasMap,t).forEach(t=>{e[t]=[...e[t]??[],...a]})}),new InvariantBuilder(this.aliasMap,e)}_conflicts={};buildViolationExpressions=()=>{let t={};return Object.entries(this.invariants).forEach(([e,a])=>{t[e]={$violations:{evaluate:(t,e,i)=>a.flatMap(a=>a.evaluate(t,e,i)),meta:{}}}}),t}}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{SystemComponentBuilder as o}from"../component/index.js";import{ViolationSchema as t}from"./violation.js";export const violationsComponent=o.component("violations").withState({tsType:"ViolationComponentState",type:"object",properties:{violations:{type:"array",items:t}},required:["violations"],additionalProperties:!1}).build();
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { I18n } from '@lingui/core';
|
|
2
2
|
import type { Localizable } from '@salsita-ai/common/utils';
|
|
3
|
-
import type {
|
|
4
|
-
import type {
|
|
3
|
+
import type { StateEmission } from '../../domain-context/store-system/store-system.js';
|
|
4
|
+
import type { $DomainEntity, DomainEntity, EntityId } from '../model/index.js';
|
|
5
5
|
/**
|
|
6
6
|
* An **ORDERED** list of violation severities.
|
|
7
7
|
* Do not change the order of the items in this list.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type ExtendedJsonSchema } from '@salsita-ai/common/utils';
|
|
2
|
+
import type { PhxValidateFunction } from '../schema/index.js';
|
|
2
3
|
import type { EntityId } from './model.js';
|
|
3
|
-
import type { PhxValidateFunction } from './schema-validator.js';
|
|
4
4
|
/**
|
|
5
5
|
* Definition of how the component looks like, it's name, state and other properties. It is used to instantiate components.
|
|
6
6
|
*/
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export*from"./alias.js";export*from"./common-definitions.js";export*from"./component.js";export*from"./model.js";export*from"./preset.js";export*from"./reflection.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { ExtendedJsonSchema } from '@salsita-ai/common/utils';
|
|
2
|
+
import { type PhxValidateFunction } from '../schema/index.js';
|
|
2
3
|
import { type $DomainEntity, type DomainEntity, type EntityByType, type EntityId } from './model.js';
|
|
3
|
-
import type { PhxValidateFunction } from './schema-validator.js';
|
|
4
4
|
type RequiredKeys<T> = {
|
|
5
5
|
[K in keyof T]: undefined extends T[K] ? never : K;
|
|
6
6
|
}[keyof T];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{extendedSchemaValidator as t}from"../schema/index.js";import{domainEntityTypeFromId as e,isDomainEntityId as s}from"./model.js";export class SchemaReflection{_meta;constructor(e,s){this._meta={name:e,schema:s,validator:t.compile(s)}}is=t=>this._meta.validator(t);assert(t){if(!this._meta.validator(t))throw Error(`Expected value to match schema of '${this._meta.name}' but got ${t}`)}}export class EnumReflection extends SchemaReflection{constructor(t,e){for(let s of(super(t,e),e.enum))Object.defineProperty(this,s,{value:s,writable:!1,enumerable:!0,configurable:!1})}values=()=>this._meta.schema.enum}let o=class BaseDomainEntityReflection{type;constructor(t){this.type=t}is=t=>t.type===this.type;assert(t){if(!this.is(t))throw Error(`Expected entity #${t.id} to be of type ${this.type} but got ${t.type}`)}isId=t=>s(t)&&e(t)===this.type;assertId(t){if(!this.isId(t))throw Error(`Expected entity id to be of type ${this.type} but got ${t}`)}assertIds(t){t.forEach(t=>{this.assertId(t)})}};export class DomainEntityReflection extends o{_meta;constructor(e,s){super(e);let o=s.reduce((t,e)=>{let s=e.$defs;return"object"==typeof s&&null!==s&&Object.assign(t,s),t},{}),r={type:"object",properties:{id:{type:"string",pattern:`^${e}-[0-9]+$`},type:{type:"string",const:e},...s.reduce((t,e)=>({...t,...e.properties}),{})},required:["id","type",...s.flatMap(t=>t.required??[])],additionalProperties:!1},i={...r,$defs:o};this._meta={name:e,schema:r,validator:t.compile(i)}}}let r=class $DomainEntityReflectionClass extends o{expressions;constructor(t,e,s){super(t),this.expressions=e,Object.assign(this,s)}};export const $DomainEntityReflection=r;let i=class BaseAliasReflection{name;types;typeSet;constructor(t,e){this.name=t,this.types=e,this.typeSet=new Set(e)}is=t=>this.typeSet.has(t.type);assert(t){if(!this.is(t))throw Error(`Expected entity #${t.id} to be a member of alias ${this.name} but got ${t.type}`)}isId=t=>s(t)&&this.typeSet.has(e(t));assertId(t){if(!this.isId(t))throw Error(`Expected entity id to be of a member of alias ${this.name} but got ${t}`)}assertIds(t){t.forEach(t=>{this.assertId(t)})}};export class RawAliasReflection extends i{reflections;constructor(t,e){super(t,e.map(t=>t.type)),this.reflections=e}}let a=class EnhancedAliasReflectionClass extends i{constructor(t,e,s){super(t,e),Object.assign(this,s)}};export const EnhancedAliasReflection=a;export function assertString(t){if("string"!=typeof t)throw Error(`Expected value to be a string but got ${t}`)}export function assertNumber(t){if("number"!=typeof t)throw Error(`Expected value to be a number but got ${t}`)}export function assertBoolean(t){if("boolean"!=typeof t)throw Error(`Expected value to be a boolean but got ${t}`)}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export{};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{createAjvSchemaValidator as e}from"./create-ajv-schema-validator.js";import{createCspSchemaValidator as a}from"./create-csp-schema-validator.js";let t="csp-compatible"===globalThis.PHX_SCHEMA_VALIDATOR?a:e;export const getExtendedSchemaValidator=()=>{let e=t();return e.addKeyword("tsType"),e.addKeyword("import"),e.addKeyword("declared"),e};export const extendedSchemaValidator=getExtendedSchemaValidator();
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export type { EnhancedJsonObjectSchemaType, EnhancedJsonSchemaType, JsonSchemaType, MemberImport, } from './enhanced-json-schema.js';
|
|
2
|
+
export { extendedSchemaValidator, getExtendedSchemaValidator } from './extended-schema-validator.js';
|
|
3
|
+
export type { PhxValidateFunction, PhxValidationError, SchemaValidator } from './schema-validator.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export{extendedSchemaValidator,getExtendedSchemaValidator}from"./extended-schema-validator.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export{};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { DomainEntity, DomainEntityId } from '../model/index.js';
|
|
2
|
+
/**
|
|
3
|
+
* Hands out the ids of entities that are about to be created, one sequence per entity type. An
|
|
4
|
+
* action or a transformer asks it for an id instead of computing one from the state.
|
|
5
|
+
*/
|
|
6
|
+
export type IdSequence<ENTITIES extends DomainEntity<string>> = {
|
|
7
|
+
/**
|
|
8
|
+
* Returns the next available entity ID for the given type.
|
|
9
|
+
* This automatically increments the sequence number for the given type, so that the next call will return a new ID.
|
|
10
|
+
*
|
|
11
|
+
* @param type the entity type
|
|
12
|
+
* @returns a new domain entity ID for the given type
|
|
13
|
+
*/
|
|
14
|
+
nextId: <TYPE extends ENTITIES['type']>(type: TYPE) => DomainEntityId<TYPE>;
|
|
15
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export{};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export*from"./migrations.js";export*from"./state.js";
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { type Logger } from '@salsita-ai/common/utils';
|
|
2
|
-
import type { DomainEntity } from '
|
|
3
|
-
import type { EntityReflections } from './reflection.js';
|
|
2
|
+
import type { DomainEntity, EntityReflections } from '../model/index.js';
|
|
4
3
|
/**
|
|
5
4
|
* Thrown when domain state cannot be validated/migrated to the latest model
|
|
6
5
|
* version: an entity is invalid against its schema, an entity type or model
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import type { ComponentSnapshot, SystemComponentTypeConstraint } from '
|
|
2
|
-
import type { DomainEntity } from './model.js';
|
|
1
|
+
import type { ComponentSnapshot, DomainEntity, SystemComponentTypeConstraint } from '../model/index.js';
|
|
3
2
|
export interface DomainState<ENTITIES extends DomainEntity<string>> {
|
|
4
3
|
readonly rootEntityId: ENTITIES['id'];
|
|
5
4
|
readonly rootEntityType: ENTITIES['type'];
|
|
@@ -1,10 +1,6 @@
|
|
|
1
1
|
import { type ExtendedJsonSchema } from '@salsita-ai/common/utils';
|
|
2
|
-
import { type AliasMap, type ExpandAlias, type TypeOrAlias } from './core/
|
|
3
|
-
import type
|
|
4
|
-
import { DomainFactory } from './core/index.js';
|
|
5
|
-
import { type MigrateFunction } from './core/migrations.js';
|
|
6
|
-
import { type $DomainEntity, type DomainEntity, type EntityByType } from './core/model.js';
|
|
7
|
-
import type { $DomainEntityReflection, EntityReflections, SchemaOfObject } from './core/reflection.js';
|
|
2
|
+
import { type $DomainEntity, type $DomainEntityReflection, type ActionDefinition, type AliasMap, type AnonymousExpression, type AnyActionImplementations, type DomainEntity, DomainFactory, type EntityByType, type EntityReflections, type ExpandAlias, type MigrateFunction, type SchemaOfObject, type TypeOrAlias } from './core/index.js';
|
|
3
|
+
import { type ProjectModule } from './project-modules/index.js';
|
|
8
4
|
export type AliasedExpressions<ENTITIES extends DomainEntity<string>, ALLOWED_ROOT_ENTITIES extends ENTITIES, PUBLISHED_DATA extends Record<string, unknown>, SESSION_DATA extends Record<string, unknown>, FRONTEND_DATA extends Record<string, unknown>, ALIASES extends Record<string, ENTITIES>> = {
|
|
9
5
|
[K in TypeOrAlias<ENTITIES, ALIASES>]?: Record<string, AnonymousExpression<ENTITIES, ALLOWED_ROOT_ENTITIES, PUBLISHED_DATA, SESSION_DATA, FRONTEND_DATA, ExpandAlias<ENTITIES, ALIASES, K>, unknown>>;
|
|
10
6
|
};
|
|
@@ -24,10 +20,24 @@ export declare class DomainBuilder<ENTITIES extends DomainEntity<string>, ALLOWE
|
|
|
24
20
|
private readonly backendData;
|
|
25
21
|
private readonly migrate;
|
|
26
22
|
private readonly isAdminDomain;
|
|
23
|
+
private readonly actions;
|
|
24
|
+
private readonly actionImplementations;
|
|
27
25
|
private constructor();
|
|
28
26
|
static from<ENTITIES extends DomainEntity<string>, ALLOWED_ROOT_ENTITIES extends ENTITIES, $MAP extends Record<ENTITIES['type'], $DomainEntity<ENTITIES>>, PUBLISHED_DATA extends Record<string, unknown>, SESSION_DATA extends Record<string, unknown>, FRONTEND_DATA extends Record<string, unknown>, ALIASES extends Readonly<Record<string, ENTITIES>>>(entities: EntityReflections<ENTITIES>, aliasMap: AliasMap<ALIASES>, $entityReflections: $EntityReflections<ENTITIES>, allowedRootEntityTypes: ReadonlyArray<ALLOWED_ROOT_ENTITIES['type']>, modelVersion: number, publishedData: SchemaOfObject<PUBLISHED_DATA>, sessionData: SchemaOfObject<SESSION_DATA>, frontendData: SchemaOfObject<FRONTEND_DATA>, backendData: ExtendedJsonSchema | undefined, isAdminDomain: boolean): DomainBuilder<ENTITIES, ALLOWED_ROOT_ENTITIES, ALIASES, $MAP, PUBLISHED_DATA, SESSION_DATA, FRONTEND_DATA>;
|
|
29
27
|
withMigrate(migration: MigrateFunction<ENTITIES>): DomainBuilder<ENTITIES, ALLOWED_ROOT_ENTITIES, ALIASES, $MAP, PUBLISHED_DATA, SESSION_DATA, FRONTEND_DATA>;
|
|
30
28
|
withExpressions(implementation: AliasedExpressions<ENTITIES, ALLOWED_ROOT_ENTITIES, PUBLISHED_DATA, SESSION_DATA, FRONTEND_DATA, ALIASES>): DomainBuilder<ENTITIES, ALLOWED_ROOT_ENTITIES, ALIASES, $MAP, PUBLISHED_DATA, SESSION_DATA, FRONTEND_DATA>;
|
|
29
|
+
/**
|
|
30
|
+
* Adds the expressions of the `src/expressions/` files, as the generated barrel lists them. Each file
|
|
31
|
+
* is checked against the folder's contract and added on its own, so an expression defined twice is
|
|
32
|
+
* reported with both files instead of being overwritten by file order.
|
|
33
|
+
*/
|
|
34
|
+
withExpressionModules(modules: readonly ProjectModule[]): DomainBuilder<ENTITIES, ALLOWED_ROOT_ENTITIES, ALIASES, $MAP, PUBLISHED_DATA, SESSION_DATA, FRONTEND_DATA>;
|
|
35
|
+
/** Declares the actions of the domain, as the generated `domain-spec.ts` reads them from the spec's `actions` section. */
|
|
36
|
+
withActions(actions: readonly ActionDefinition[]): DomainBuilder<ENTITIES, ALLOWED_ROOT_ENTITIES, ALIASES, $MAP, PUBLISHED_DATA, SESSION_DATA, FRONTEND_DATA>;
|
|
37
|
+
/** Adds the action implementations of the `src/actions/` files, as the generated barrel lists them, after checking each file against the folder's contract. */
|
|
38
|
+
withActionModules(modules: readonly ProjectModule[]): DomainBuilder<ENTITIES, ALLOWED_ROOT_ENTITIES, ALIASES, $MAP, PUBLISHED_DATA, SESSION_DATA, FRONTEND_DATA>;
|
|
39
|
+
/** Adds the implementations of the declared actions, already merged by action name. */
|
|
40
|
+
withActionImplementations(implementations: AnyActionImplementations): DomainBuilder<ENTITIES, ALLOWED_ROOT_ENTITIES, ALIASES, $MAP, PUBLISHED_DATA, SESSION_DATA, FRONTEND_DATA>;
|
|
31
41
|
build: () => DomainFactory<ENTITIES, ALLOWED_ROOT_ENTITIES, $MAP, PUBLISHED_DATA, SESSION_DATA, FRONTEND_DATA>;
|
|
32
42
|
}
|
|
33
43
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{DomainFactory as t,MigrateFunctionBuilder as i,expandAlias as e}from"./core/index.js";import{resolveActionModules as s,resolveExpressionModules as n}from"./project-modules/index.js";import{withProfilerLabel as a}from"./utils/profiler-label.js";export class DomainBuilder{entities;aliasMap;$entityReflections;allowedRootEntityTypes;implemented;modelVersion;publishedData;sessionData;frontendData;backendData;migrate;isAdminDomain;actions;actionImplementations;constructor(t,i,e,s,n,a,o,h,l,r,m,d,p,c){this.entities=t,this.aliasMap=i,this.$entityReflections=e,this.allowedRootEntityTypes=s,this.implemented=n,this.modelVersion=a,this.publishedData=o,this.sessionData=h,this.frontendData=l,this.backendData=r,this.migrate=m,this.isAdminDomain=d,this.actions=p,this.actionImplementations=c}static from(t,e,s,n,a,o,h,l,r,m){let d=i.fromVersions({1:t}).to(1).using({}).build();return new DomainBuilder(t,e,s,n,{},a,o,h,l,r,d,m,{},{})}withMigrate(t){return new DomainBuilder(this.entities,this.aliasMap,this.$entityReflections,this.allowedRootEntityTypes,this.implemented,this.modelVersion,this.publishedData,this.sessionData,this.frontendData,this.backendData,t,this.isAdminDomain,this.actions,this.actionImplementations)}withExpressions(t){let i={...this.implemented};return Object.entries(t).forEach(([t,s])=>{e(this.aliasMap,t).forEach(e=>{let n={...i[e]};i[e]=n,Object.entries(s).forEach(([i,s])=>{let o=n[i];if(o)throw Error(`Duplicate expression ${e}.${i}: The expression is defined on both ${t} and ${o.origin.typeOrAlias}, which would lead to ambiguous usage. Please ensure that expressions are only defined once.`);n[i]={...s,evaluate:a(`${e}_${i}`,s.evaluate),origin:{name:i,typeOrAlias:t}}})})}),new DomainBuilder(this.entities,this.aliasMap,this.$entityReflections,this.allowedRootEntityTypes,i,this.modelVersion,this.publishedData,this.sessionData,this.frontendData,this.backendData,this.migrate,this.isAdminDomain,this.actions,this.actionImplementations)}withExpressionModules(t){return n(t,this.aliasMap).reduce((t,i)=>t.withExpressions(i.expressions),this)}withActions(t){return new DomainBuilder(this.entities,this.aliasMap,this.$entityReflections,this.allowedRootEntityTypes,this.implemented,this.modelVersion,this.publishedData,this.sessionData,this.frontendData,this.backendData,this.migrate,this.isAdminDomain,Object.fromEntries(t.map(t=>[t.name,t])),this.actionImplementations)}withActionModules(t){return this.withActionImplementations(s(t))}withActionImplementations(t){return new DomainBuilder(this.entities,this.aliasMap,this.$entityReflections,this.allowedRootEntityTypes,this.implemented,this.modelVersion,this.publishedData,this.sessionData,this.frontendData,this.backendData,this.migrate,this.isAdminDomain,this.actions,{...this.actionImplementations,...t})}build=()=>{let e=this.implemented,s=this.migrate??i.fromVersions({1:this.entities}).to(1).using({}).build();return new t({aliasMap:this.aliasMap,entityReflections:this.entities,$entityReflections:this.$entityReflections,expressions:e,allowedRootEntityTypes:this.allowedRootEntityTypes,modelVersion:this.modelVersion,migrate:s,publishedData:this.publishedData,sessionData:this.sessionData,frontendData:this.frontendData,backendData:this.backendData,isAdminDomain:this.isAdminDomain,actions:this.actions,actionImplementations:this.actionImplementations})}}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { type $DomainEntity, type ActionContext, type ActionTypes, type DomainEntity, type DomainState, type PreparedAction } from '../../core/index.js';
|
|
2
|
+
import type { DomainContextSelectors } from '../../domain-runtime/domain-context/index.js';
|
|
3
|
+
export interface ActionSystemContext {
|
|
4
|
+
/**
|
|
5
|
+
* The action system's window into the runtime registry: the declared actions and their
|
|
6
|
+
* implementations are read per call, never snapshotted, so a hot-reloaded spec or action file is
|
|
7
|
+
* observed without rebuilding the system.
|
|
8
|
+
*/
|
|
9
|
+
readonly selectors: DomainContextSelectors;
|
|
10
|
+
}
|
|
11
|
+
/** ActionSystem with its types erased — how the runtime selectors expose the instance. */
|
|
12
|
+
export type AnyActionSystem = ActionSystem<any, any, any, any, any, any, any, any, any, any, any>;
|
|
13
|
+
/**
|
|
14
|
+
* Runs the actions an application declares under `actions` and implements in `src/actions/`. It
|
|
15
|
+
* only prepares: an action gets the state it is called on and returns the updates it wants applied
|
|
16
|
+
* with a reader for its result, and the caller stages, commits or dry-runs them. Every caller of an
|
|
17
|
+
* action goes through it, so all of them run the same domain logic.
|
|
18
|
+
*/
|
|
19
|
+
export declare class ActionSystem<ENTITIES extends DomainEntity<string>, ALLOWED_ROOT_ENTITIES extends ENTITIES, $MAP extends Record<ENTITIES['type'], $DomainEntity<ENTITIES>>, PUBLISHED_DATA extends Record<string, unknown>, SESSION_DATA extends Record<string, unknown>, FRONTEND_DATA extends Record<string, unknown>, NAVIGATION_STATES extends string, VIEW_STATES extends string, TOOL_STATES extends string, EXPORT_STATES extends string, ACTION_TYPES extends ActionTypes> {
|
|
20
|
+
private readonly _context;
|
|
21
|
+
/** One compiled validator per declared action, rebuilt only when the declarations change. */
|
|
22
|
+
private readonly _selectValidators;
|
|
23
|
+
private readonly _updates;
|
|
24
|
+
constructor(_context: ActionSystemContext);
|
|
25
|
+
/**
|
|
26
|
+
* The context an implementation runs with on `state`. Code that prepares updates outside an
|
|
27
|
+
* action can run on the same context, so it can do everything an action can, the same way.
|
|
28
|
+
*/
|
|
29
|
+
readonly createContext: (state: DomainState<ENTITIES>) => ActionContext<ENTITIES, ALLOWED_ROOT_ENTITIES, $MAP, PUBLISHED_DATA, SESSION_DATA, FRONTEND_DATA, NAVIGATION_STATES, VIEW_STATES, TOOL_STATES, EXPORT_STATES>;
|
|
30
|
+
/**
|
|
31
|
+
* Prepares the action `name` with `args` on `state`. The arguments are validated against the
|
|
32
|
+
* params schema the action declares, and the implementation is called with the validated
|
|
33
|
+
* parameters and the context of the state; nothing is staged or committed. Throws for an unknown
|
|
34
|
+
* action, arguments that do not fit the schema, or a declared action without an implementation.
|
|
35
|
+
* The result of `readResult` is not validated: the generated type is its contract.
|
|
36
|
+
*/
|
|
37
|
+
readonly prepareAction: <NAME extends keyof ACTION_TYPES & string>(name: NAME, args: unknown, state: DomainState<ENTITIES>) => PreparedAction<ENTITIES, ACTION_TYPES[NAME]['result']>;
|
|
38
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{createSelector as t}from"@salsita-ai/common/utils";import{createUpdateFactory as e,extendedSchemaValidator as s}from"../../core/index.js";import{getIdSequence as n}from"../store-system/next-domain-entity-id.js";export class ActionSystem{_context;_selectValidators=t([t.leaf(t=>t)],t=>new Map(Object.values(t).map(t=>[t.name,s.compile(t.params)])));_updates=e();constructor(t){this._context=t}createContext=t=>({expressionContext:this._context.selectors.getExpressionContext(),systems:this._context.selectors.getDomainSystems(),getIdSequence:()=>n(t.entities,[]),updates:this._updates});prepareAction=(t,e,n)=>{let o=this._context.selectors.getActionDefinitions(),i=Object.values(o).find(e=>e.name===t);if(!i){let e=Object.values(o).map(t=>`"${t.name}"`);throw Error(`Unknown action "${t}". ${e.length>0?`The application declares these actions: ${e.join(", ")}.`:"The application declares no actions."} Declare it under "actions" in a spec file and implement it in src/actions/.`)}let a=this._selectValidators(o).get(i.name);if(a&&!a(e))throw Error(`The arguments of action "${t}" do not fit its params: ${s.errorsText(a.errors)}. Nothing was changed. Send arguments that fit the params the action declares.`);return(Object.entries(this._context.selectors.getActionImplementations()).find(([e])=>e===t)?.[1])(e,n,this.createContext(n))}}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { $DomainEntity, DomainEntity } from '../core/
|
|
1
|
+
import type { $DomainEntity, DomainEntity } from '../core/index.js';
|
|
2
2
|
import type { DomainContextSystems } from './domain-context-systems.js';
|
|
3
3
|
import type { UpdateTransformer } from './store-system/store-system.js';
|
|
4
4
|
export declare const createTransformer: <ENTITIES extends DomainEntity<string>, ALLOWED_ROOT_ENTITIES extends ENTITIES, $MAP extends Record<ENTITIES['type'], $DomainEntity<ENTITIES>>, NAVIGATION_STATES extends string, VIEW_STATES extends string, TOOL_STATES extends string, EXPORT_STATES extends string>(transformer: (ctx: DomainContextSystems<ENTITIES, ALLOWED_ROOT_ENTITIES, $MAP, NAVIGATION_STATES, VIEW_STATES, TOOL_STATES, EXPORT_STATES>) => UpdateTransformer<ENTITIES>) => (ctx: DomainContextSystems<ENTITIES, ALLOWED_ROOT_ENTITIES, $MAP, NAVIGATION_STATES, VIEW_STATES, TOOL_STATES, EXPORT_STATES>) => UpdateTransformer<ENTITIES>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{SystemComponentBuilder as t}from"../../
|
|
1
|
+
import{SystemComponentBuilder as t}from"../../core/index.js";import{DimensionUnitSchema as e}from"../../dimensions/index.js";export const dimensionStateComponent=t.component("dimensionStateComponent").withState({type:"object",properties:{unit:e},required:["unit"],additionalProperties:!1}).withWritableKeys(["unit"]).build();
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import type { DomainEntity, DomainState } from '../../core/index.js';
|
|
1
|
+
import type { DomainEntity, DomainState, EntityViolation } from '../../core/index.js';
|
|
2
2
|
import { DimensionUnit, type UnitsConfig } from '../../dimensions/index.js';
|
|
3
3
|
import type { DomainContextSelectors } from '../../domain-runtime/domain-context/index.js';
|
|
4
|
-
import type { EntityViolation } from '../../invariants/violation.js';
|
|
5
4
|
import { SystemState } from '../store-system/system-state.js';
|
|
6
5
|
import { type DimensionStateComponent } from './dimension-state.js';
|
|
7
6
|
export type DistanceDimensionViolation = `${string}.distanceDimension.tooLarge` | `${string}.distanceDimension.tooSmall`;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import type { Domain } from '../core/
|
|
2
|
-
import type { $DomainEntity, DomainEntity } from '../core/model.js';
|
|
1
|
+
import type { $DomainEntity, ActionTypes, Domain, DomainEntity } from '../core/index.js';
|
|
3
2
|
import type { ComponentReader, DomainContextSelectors } from '../domain-runtime/domain-context/index.js';
|
|
4
3
|
import type { BlenderProjections, CollisionProjections, CompositionProjections, ConstraintProjections, PositionProjections, ProjectedEntitiesProjections, SnappingProjections, ValidationProjections } from '../projections/index.js';
|
|
5
4
|
import type { SketchingProjections } from '../sketching/sketching-projections.js';
|
|
5
|
+
import type { ActionSystem } from './action-system/action-system.js';
|
|
6
6
|
import type { DimensionSystem } from './dimension-system/dimension-system.js';
|
|
7
7
|
import type { NavigationSystem } from './navigation-system/navigation-system.js';
|
|
8
8
|
import type { RecipeCookerSystem } from './recipe-system/recipe-cooker-system.js';
|
|
@@ -14,7 +14,7 @@ import type { UndoSystem } from './undo-system.js';
|
|
|
14
14
|
* The `DomainContext` lifecycle orchestrates these systems but does not expose them.
|
|
15
15
|
* Consumers read this record through `DomainContextSelectors.getDomainSystems()`.
|
|
16
16
|
*/
|
|
17
|
-
export interface DomainContextSystems<ENTITIES extends DomainEntity<string>, ALLOWED_ROOT_ENTITIES extends ENTITIES, $MAP extends Record<ENTITIES['type'], $DomainEntity<ENTITIES>>, NAVIGATION_STATES extends string, VIEW_STATES extends string, TOOL_STATES extends string, EXPORT_STATES extends string> {
|
|
17
|
+
export interface DomainContextSystems<ENTITIES extends DomainEntity<string>, ALLOWED_ROOT_ENTITIES extends ENTITIES, $MAP extends Record<ENTITIES['type'], $DomainEntity<ENTITIES>>, NAVIGATION_STATES extends string, VIEW_STATES extends string, TOOL_STATES extends string, EXPORT_STATES extends string, ACTION_TYPES extends ActionTypes = ActionTypes> {
|
|
18
18
|
/**
|
|
19
19
|
* The system graph's window into the runtime registry. Consumers outside the domain systems use
|
|
20
20
|
* it to read spec-derived values live rather than through construction-time snapshots.
|
|
@@ -30,6 +30,7 @@ export interface DomainContextSystems<ENTITIES extends DomainEntity<string>, ALL
|
|
|
30
30
|
readonly dimensionSystem: DimensionSystem<ENTITIES>;
|
|
31
31
|
readonly undoSystem: UndoSystem<ENTITIES, $MAP>;
|
|
32
32
|
readonly recipeCooker: RecipeCookerSystem<ENTITIES>;
|
|
33
|
+
readonly actionSystem: ActionSystem<ENTITIES, ALLOWED_ROOT_ENTITIES, $MAP, Record<string, unknown>, Record<string, unknown>, Record<string, unknown>, NAVIGATION_STATES, VIEW_STATES, TOOL_STATES, EXPORT_STATES, ACTION_TYPES>;
|
|
33
34
|
readonly sketchingProjections: SketchingProjections<ENTITIES>;
|
|
34
35
|
readonly collisionProjections: CollisionProjections<ENTITIES>;
|
|
35
36
|
readonly positionProjections: PositionProjections<ENTITIES>;
|
|
@@ -37,4 +38,4 @@ export interface DomainContextSystems<ENTITIES extends DomainEntity<string>, ALL
|
|
|
37
38
|
readonly projectedEntitiesProjections: ProjectedEntitiesProjections<ENTITIES>;
|
|
38
39
|
readonly constraintProjections: ConstraintProjections<ENTITIES>;
|
|
39
40
|
}
|
|
40
|
-
export type AnyDomainContextSystems = DomainContextSystems<any, any, any, any, any, any, any>;
|
|
41
|
+
export type AnyDomainContextSystems = DomainContextSystems<any, any, any, any, any, any, any, any>;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
export { type AnalyticsSystem, NoopAnalyticsSystem } from './analytics-system/analytics-system.js';
|
|
2
|
-
export { type AnalyticsEvent, AnalyticsEventFactory, AnalyticsEventType, } from './analytics-system/analytics-contracts.js';
|
|
2
|
+
export { type AnalyticsEvent, AnalyticsEventFactory, AnalyticsEventType, type DataLoadedEvent, type InitEvent, type NavigationEvent, type SessionAuthenticatedEvent, type SystemEvent, type UserActionEvent, } from './analytics-system/analytics-contracts.js';
|
|
3
3
|
export { NavigationUpdateTag, isInitialNavigationUpdate, isNavigationUpdate, isInitialViewUpdate, isViewUpdate, isInitialSelectionUpdate, isSelectUpdate, isDeselectUpdate, isInitialFullscreenUpdate, isToggleFullscreenUpdate, isInitialDebugUpdate, isInitialViewportUpdate, isSetViewportUpdate, isInitialDragUpdate, isDragStartUpdate, isDragEndUpdate, isInitialToolUpdate, isToolUpdate, isExportUpdate, } from './navigation-system/navigation-updates.js';
|
|
4
4
|
export { createAutoSelectionTransformer, NavigationSystem, type NavigationSystemContext, } from './navigation-system/navigation-system.js';
|
|
5
5
|
export { createResetSelectionOnNavigationTransformer, createNavigationOnSelectionTransformer, createNavigationOnDeselectTransformer, createSelectParentOnDeselectionTransformer, createNavigationOnSelectionChangeTransformer, } from './navigation-system/selection-transformers.js';
|
|
6
6
|
export { StoreSystem, type TransformerRegistration, type StateEmission, type UpdateTransformer, type TransformerLogFunction, type Transformers, type StateSliceName, type StateUpdateEmission, type StateEmissionKind, type CommitPreparedOutcome, } from './store-system/store-system.js';
|
|
7
|
-
export { nextDomainEntityId, getIdSequence
|
|
7
|
+
export { nextDomainEntityId, getIdSequence } from './store-system/next-domain-entity-id.js';
|
|
8
8
|
export { applyUpdates } from './store-system/apply-updates.js';
|
|
9
9
|
export { SystemState, SystemStateInitialUpdateTag, SystemStateUpdateTag, type SystemStateContext, } from './store-system/system-state.js';
|
|
10
10
|
export { createRefReplaceTransformer } from './relation-transformers/replace-refs.js';
|
|
@@ -13,6 +13,7 @@ export { createCascadeRefPruningTransformer } from './relation-transformers/casc
|
|
|
13
13
|
export { createCreateEntityRefsTransformer } from './relation-transformers/create-entity-refs.js';
|
|
14
14
|
export { type CanBeUndonePredicate, type CanBeUndoneContext, type UndoCapabilities, UndoSystem, UNDO_REDO_RESET_TAG, isUndoRedoReset, } from './undo-system.js';
|
|
15
15
|
export { DimensionSystem, type AnyDimensionSystem, type DimensionSystemContext, type AngleDimensionViolation, type DistanceDimensionViolation, type GenericDimensionViolation, } from './dimension-system/dimension-system.js';
|
|
16
|
+
export { ActionSystem, type AnyActionSystem, type ActionSystemContext } from './action-system/action-system.js';
|
|
16
17
|
export { RecipeFactoryBuilder, type EntityRecipe } from './recipe-system/recipes.js';
|
|
17
18
|
export { RecipeCookerSystem, type AnyRecipeCookerSystem, type RecipeCookerSystemContext, ReplaceRecipeUpdateTag, isReplaceEntityUpdate, type IsReplaceRecipeUpdate, CreateRecipeUpdateTag, isCreateEntityUpdate, type IsCreateRecipeUpdate, } from './recipe-system/recipe-cooker-system.js';
|
|
18
19
|
export { type DomainContextSystems, type AnyDomainContextSystems } from './domain-context-systems.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{NoopAnalyticsSystem}from"./analytics-system/analytics-system.js";export{AnalyticsEventFactory,AnalyticsEventType}from"./analytics-system/analytics-contracts.js";export{NavigationUpdateTag,isInitialNavigationUpdate,isNavigationUpdate,isInitialViewUpdate,isViewUpdate,isInitialSelectionUpdate,isSelectUpdate,isDeselectUpdate,isInitialFullscreenUpdate,isToggleFullscreenUpdate,isInitialDebugUpdate,isInitialViewportUpdate,isSetViewportUpdate,isInitialDragUpdate,isDragStartUpdate,isDragEndUpdate,isInitialToolUpdate,isToolUpdate,isExportUpdate}from"./navigation-system/navigation-updates.js";export{createAutoSelectionTransformer,NavigationSystem}from"./navigation-system/navigation-system.js";export{createResetSelectionOnNavigationTransformer,createNavigationOnSelectionTransformer,createNavigationOnDeselectTransformer,createSelectParentOnDeselectionTransformer,createNavigationOnSelectionChangeTransformer}from"./navigation-system/selection-transformers.js";export{StoreSystem}from"./store-system/store-system.js";export{nextDomainEntityId,getIdSequence}from"./store-system/next-domain-entity-id.js";export{applyUpdates}from"./store-system/apply-updates.js";export{SystemState,SystemStateInitialUpdateTag,SystemStateUpdateTag}from"./store-system/system-state.js";export{createRefReplaceTransformer}from"./relation-transformers/replace-refs.js";export{createCascadeDeletesTransformer}from"./relation-transformers/cascade-deletes.js";export{createCascadeRefPruningTransformer}from"./relation-transformers/cascade-ref-pruning.js";export{createCreateEntityRefsTransformer}from"./relation-transformers/create-entity-refs.js";export{UndoSystem,UNDO_REDO_RESET_TAG,isUndoRedoReset}from"./undo-system.js";export{DimensionSystem}from"./dimension-system/dimension-system.js";export{RecipeFactoryBuilder}from"./recipe-system/recipes.js";export{RecipeCookerSystem,ReplaceRecipeUpdateTag,isReplaceEntityUpdate,CreateRecipeUpdateTag,isCreateEntityUpdate}from"./recipe-system/recipe-cooker-system.js";export{createTransformer}from"./create-transformer.js";export*from"./transformers/index.js";
|
|
1
|
+
export{NoopAnalyticsSystem}from"./analytics-system/analytics-system.js";export{AnalyticsEventFactory,AnalyticsEventType}from"./analytics-system/analytics-contracts.js";export{NavigationUpdateTag,isInitialNavigationUpdate,isNavigationUpdate,isInitialViewUpdate,isViewUpdate,isInitialSelectionUpdate,isSelectUpdate,isDeselectUpdate,isInitialFullscreenUpdate,isToggleFullscreenUpdate,isInitialDebugUpdate,isInitialViewportUpdate,isSetViewportUpdate,isInitialDragUpdate,isDragStartUpdate,isDragEndUpdate,isInitialToolUpdate,isToolUpdate,isExportUpdate}from"./navigation-system/navigation-updates.js";export{createAutoSelectionTransformer,NavigationSystem}from"./navigation-system/navigation-system.js";export{createResetSelectionOnNavigationTransformer,createNavigationOnSelectionTransformer,createNavigationOnDeselectTransformer,createSelectParentOnDeselectionTransformer,createNavigationOnSelectionChangeTransformer}from"./navigation-system/selection-transformers.js";export{StoreSystem}from"./store-system/store-system.js";export{nextDomainEntityId,getIdSequence}from"./store-system/next-domain-entity-id.js";export{applyUpdates}from"./store-system/apply-updates.js";export{SystemState,SystemStateInitialUpdateTag,SystemStateUpdateTag}from"./store-system/system-state.js";export{createRefReplaceTransformer}from"./relation-transformers/replace-refs.js";export{createCascadeDeletesTransformer}from"./relation-transformers/cascade-deletes.js";export{createCascadeRefPruningTransformer}from"./relation-transformers/cascade-ref-pruning.js";export{createCreateEntityRefsTransformer}from"./relation-transformers/create-entity-refs.js";export{UndoSystem,UNDO_REDO_RESET_TAG,isUndoRedoReset}from"./undo-system.js";export{DimensionSystem}from"./dimension-system/dimension-system.js";export{ActionSystem}from"./action-system/action-system.js";export{RecipeFactoryBuilder}from"./recipe-system/recipes.js";export{RecipeCookerSystem,ReplaceRecipeUpdateTag,isReplaceEntityUpdate,CreateRecipeUpdateTag,isCreateEntityUpdate}from"./recipe-system/recipe-cooker-system.js";export{createTransformer}from"./create-transformer.js";export*from"./transformers/index.js";
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
import { type Viewport } from '../../
|
|
2
|
-
import type { DomainEntity } from '../../core/model.js';
|
|
3
|
-
import type { DomainState } from '../../core/state.js';
|
|
1
|
+
import { type DomainEntity, type DomainState, type Viewport } from '../../core/index.js';
|
|
4
2
|
import type { DomainContextSelectors } from '../../domain-runtime/domain-context/index.js';
|
|
5
3
|
import type { DomainServicesSelectors } from '../../domain-runtime/domain-services/index.js';
|
|
6
4
|
import type { UpdateTransformer } from '../store-system/store-system.js';
|
|
@@ -37,7 +35,7 @@ export declare class NavigationSystem<ENTITIES extends DomainEntity<string>, NAV
|
|
|
37
35
|
private get _initialExportState();
|
|
38
36
|
constructor(_context: NavigationSystemContext);
|
|
39
37
|
initialize: () => void;
|
|
40
|
-
getInitialUpdates: () => (import("../../index.js").EphemeralRecordCreation<import("../../index.js").SystemComponentType<"debugState", import("../../index.js").DebugStateComponentState, "enabled">> | import("../../index.js").EphemeralRecordCreation<import("../../index.js").SystemComponentType<"dragState", import("../../index.js").DragStateComponentState, "draggedEntityId">> | import("../../index.js").EphemeralRecordCreation<import("../../index.js").SystemComponentType<"exportState", import("../../
|
|
38
|
+
getInitialUpdates: () => (import("../../index.js").EphemeralRecordCreation<import("../../index.js").SystemComponentType<"debugState", import("../../index.js").DebugStateComponentState, "enabled">> | import("../../index.js").EphemeralRecordCreation<import("../../index.js").SystemComponentType<"dragState", import("../../index.js").DragStateComponentState, "draggedEntityId">> | import("../../index.js").EphemeralRecordCreation<import("../../index.js").SystemComponentType<"exportState", import("../../index.js").ExportStateComponentState, "activeState" | "exportedEntityId">> | import("../../index.js").EphemeralRecordCreation<import("../../index.js").SystemComponentType<"fullscreenState", import("../../index.js").FullscreenStateComponentState, "enabled">> | import("../../index.js").EphemeralRecordCreation<import("../../index.js").SystemComponentType<"hoverState", import("../../index.js").HoverStateComponentState, "hoveredEntityId">> | import("../../index.js").EphemeralRecordCreation<import("../../index.js").SystemComponentType<"navigationState", import("../../index.js").NavigationStateComponentState, "activeState" | "historyStack">> | import("../../index.js").EphemeralRecordCreation<import("../../index.js").SystemComponentType<"selectionState", import("../../index.js").SelectionStateComponentState, "selectedEntityId">> | import("../../index.js").EphemeralRecordCreation<import("../../index.js").SystemComponentType<"toolState", import("../../index.js").ToolStateComponentState, "activeState">> | import("../../index.js").EphemeralRecordCreation<import("../../index.js").SystemComponentType<"viewState", import("../../index.js").ViewStateComponentState, "activeState">> | import("../../index.js").EphemeralRecordCreation<import("../../index.js").SystemComponentType<"viewportState", import("../../index.js").ViewportStateComponentState, "active">>)[];
|
|
41
39
|
/**
|
|
42
40
|
* Get the current navigation state from the provided system state. This method should be only used in transformers or other imperative contexts, for
|
|
43
41
|
* other use cases, use the observables provided by the NavigationSystem.
|
|
@@ -102,7 +100,7 @@ export declare class NavigationSystem<ENTITIES extends DomainEntity<string>, NAV
|
|
|
102
100
|
getPopNavigationUpdate: (state: DomainState<ENTITIES>) => import("../../index.js").EphemeralRecordModification<import("../../index.js").SystemComponentType<"navigationState", import("../../index.js").NavigationStateComponentState, "activeState" | "historyStack">> | null;
|
|
103
101
|
getViewUpdate: (activeState: VIEW_STATES) => import("../../index.js").EphemeralRecordModification<import("../../index.js").SystemComponentType<"viewState", import("../../index.js").ViewStateComponentState, "activeState">>;
|
|
104
102
|
getToolUpdate: (activeState: TOOL_STATES) => import("../../index.js").EphemeralRecordModification<import("../../index.js").SystemComponentType<"toolState", import("../../index.js").ToolStateComponentState, "activeState">>;
|
|
105
|
-
getExportUpdate: (activeState: EXPORT_STATES, exportedEntityId: ENTITIES['id']) => import("../../index.js").EphemeralRecordModification<import("../../index.js").SystemComponentType<"exportState", import("../../
|
|
103
|
+
getExportUpdate: (activeState: EXPORT_STATES, exportedEntityId: ENTITIES['id']) => import("../../index.js").EphemeralRecordModification<import("../../index.js").SystemComponentType<"exportState", import("../../index.js").ExportStateComponentState, "activeState" | "exportedEntityId">>;
|
|
106
104
|
getSelectUpdate: (selectedEntityId: ENTITIES['id']) => import("../../index.js").EphemeralRecordModification<import("../../index.js").SystemComponentType<"selectionState", import("../../index.js").SelectionStateComponentState, "selectedEntityId">>;
|
|
107
105
|
getDeselectUpdate: () => import("../../index.js").EphemeralRecordModification<import("../../index.js").SystemComponentType<"selectionState", import("../../index.js").SelectionStateComponentState, "selectedEntityId">>;
|
|
108
106
|
getHoverInUpdate: (hoveredEntityId: ENTITIES['id']) => import("../../index.js").EphemeralRecordModification<import("../../index.js").SystemComponentType<"hoverState", import("../../index.js").HoverStateComponentState, "hoveredEntityId">>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Subject as t,debounceTime as e,distinctUntilChanged as
|
|
1
|
+
import{Subject as t,debounceTime as e,distinctUntilChanged as i,map as n}from"rxjs";import{match as a}from"ts-pattern";import{isNonNullish as o}from"@salsita-ai/common/utils";import{debugStateComponent as r,dragStateComponent as c,exportStateComponent as s,fullscreenStateComponent as l,getComponentSystemFilterState as p,hoverStateComponent as d,navigationStateComponent as S,selectionStateComponent as g,systemUpdateFactory as m,systemVirtualEntityId as y,toolStateComponent as h,viewStateComponent as u,viewportStateComponent as I}from"../../core/index.js";import{AnalyticsEventFactory as v}from"../analytics-system/analytics-contracts.js";import{NavigationUpdateTag as T}from"./navigation-updates.js";export const createAutoSelectionTransformer=t=>(e,i)=>{let n=t.getActiveSelectionState(i),a=e.find(t=>"createDomainEntity"===t.kind);if(null!=a)return[...e,t.getSelectUpdate(a.entityId)];let o=e.find(t=>"replaceDomainEntity"===t.kind&&n===t.entityId);return null!=o?[...e,t.getSelectUpdate(o.replacementEntity.id)]:null!=e.find(t=>"deleteEntity"===t.kind&&n===t.entityId)?[...e,t.getDeselectUpdate()]:e};export class NavigationSystem{_context;_generation=null;_hoverSubject=new t;get _initialNavigationState(){return this._context.selectors.getNavigationStates()[0]}get _initialViewState(){return this._context.selectors.getViewStates()[0]}get _initialToolState(){return this._context.selectors.getToolStates()[0]}get _initialExportState(){return this._context.selectors.getExportStates()[0]}constructor(t){this._context=t,this._context.selectors.getStoreSystem().stateSlices.committed.pipe(n(t=>this.getActiveNavigationState(t.state)),i()).subscribe(t=>{this._context.domainServicesSelectors.getAnalyticsService().push(v.NavigationEvent({navigationState:t})),this._context.domainServicesSelectors.getLogger().appendToGlobalContext({navigationState:t})}),this._context.selectors.getStoreSystem().registerTransformer(100,createAutoSelectionTransformer(this),"AutoSelectionTransformer"),this._hoverSubject.pipe(e(20)).subscribe(({hoveredEntityId:t,generation:e})=>{if(e?.active===!0){if(t){if(this.getActiveHoverState(this._context.selectors.getStoreSystem().stateSlices.rendered.value.state)!==t){let e=this._context.selectors.getStoreSystem().prepareStateEmission([this.getHoverInUpdate(t)],this._context.selectors.getStoreSystem().stateSlices.rendered.value.state,"staged");this._context.selectors.getStoreSystem().emit(e)}}else if(this.getActiveHoverState(this._context.selectors.getStoreSystem().stateSlices.rendered.value.state)){let t=this._context.selectors.getStoreSystem().prepareStateEmission([this.getHoverOutUpdate()],this._context.selectors.getStoreSystem().stateSlices.rendered.value.state,"staged");this._context.selectors.getStoreSystem().emit(t)}}})}initialize=()=>{null!==this._generation&&(this._generation.active=!1),this._generation={active:!0},this._context.selectors.getStoreSystem().stageAndCommit(this.getInitialUpdates())};getInitialUpdates=()=>[this._initialNavigationState?m.EphemeralRecordCreation({componentInstance:{entityId:y,componentType:S},updateTag:T.Initial,initialState:{activeState:this._initialNavigationState,historyStack:[]}}):null,m.EphemeralRecordCreation({componentInstance:{entityId:y,componentType:g},updateTag:T.Initial,initialState:{selectedEntityId:this._context.selectors.getStoreSystem().stateSlices.committed.value.state.rootEntityId}}),m.EphemeralRecordCreation({componentInstance:{entityId:y,componentType:d},updateTag:T.Initial,initialState:{hoveredEntityId:null}}),m.EphemeralRecordCreation({componentInstance:{entityId:y,componentType:r},updateTag:T.Initial,initialState:{enabled:!1}}),this._initialViewState?m.EphemeralRecordCreation({componentInstance:{entityId:y,componentType:u},updateTag:T.Initial,initialState:{activeState:this._initialViewState}}):null,this._initialToolState?m.EphemeralRecordCreation({componentInstance:{entityId:y,componentType:h},updateTag:T.Initial,initialState:{activeState:this._initialToolState}}):null,this._initialExportState?m.EphemeralRecordCreation({componentInstance:{entityId:y,componentType:s},updateTag:T.Initial,initialState:{activeState:this._initialExportState,exportedEntityId:this._context.selectors.getStoreSystem().stateSlices.committed.value.state.rootEntityId}}):null,m.EphemeralRecordCreation({componentInstance:{entityId:y,componentType:l},updateTag:T.Initial,initialState:{enabled:!1}}),m.EphemeralRecordCreation({componentInstance:{entityId:y,componentType:c},updateTag:T.Initial,initialState:{draggedEntityId:null}}),m.EphemeralRecordCreation({componentInstance:{entityId:y,componentType:I},updateTag:T.Initial,initialState:{active:null}})].filter(o);getActiveNavigationState(t){return p(t).navigationState??this._initialNavigationState}getActiveSelectionState(t){return p(t).selectedEntityId??t.rootEntityId}getActiveHoverState(t){return p(t).hoveredEntityId??null}getActiveViewState(t){return p(t).viewState??this._initialViewState}getActiveToolState(t){return p(t).toolState??""}getActiveExportState(t){let e=p(t);return{activeState:e.exportState??this._initialExportState??"",exportedEntityId:e.exportedEntityId??t.rootEntityId}}getActiveFullscreenState(t){let e=this._context.selectors.getComponentReader().readOneComponent({entityId:y,componentType:l},t);return e?.state.enabled??!1}getActiveDragState(t){return p(t).draggedEntityId??null}getActiveViewportState(t){return p(t).viewports??null}getNavigationUpdate=t=>m.EphemeralRecordModification({componentInstance:{entityId:y,componentType:S},updateTag:T.ReplaceNavigation,writableState:{activeState:t,historyStack:[]}});getPushNavigationUpdate=(t,e,i={})=>{let n=this.getActiveNavigationState(e),o=[...this.getHistoryStack(e),n],r=a(i.canStackOnto).with(void 0,()=>o).otherwise(t=>{let e;for(let i=o.length-1;i>=0;i--)if(t.includes(o[i])){e=i;break}return void 0===e?[]:o.slice(0,e+1)});return m.EphemeralRecordModification({componentInstance:{entityId:y,componentType:S},updateTag:T.PushNavigation,writableState:{activeState:t,historyStack:r}})};getIsRootSelected=t=>this.getActiveSelectionState(t)===t.rootEntityId;getHistoryStack=t=>{let e=this._context.selectors.getComponentReader().readOneComponent({entityId:y,componentType:S},t);return e?.state.historyStack??[]};getHasStackToPop=t=>this.getHistoryStack(t).length>0;getPopNavigationUpdate=t=>{let e=this.getHistoryStack(t),i=e.at(-1);if(!i)return null;let n=e.slice(0,-1);return m.EphemeralRecordModification({componentInstance:{entityId:y,componentType:S},updateTag:T.PopNavigation,writableState:{activeState:i,historyStack:n}})};getViewUpdate=t=>m.EphemeralRecordModification({componentInstance:{entityId:y,componentType:u},updateTag:T.ActiveateView,writableState:{activeState:t}});getToolUpdate=t=>m.EphemeralRecordModification({componentInstance:{entityId:y,componentType:h},updateTag:T.ActivateTool,writableState:{activeState:t}});getExportUpdate=(t,e)=>m.EphemeralRecordModification({componentInstance:{entityId:y,componentType:s},updateTag:T.SetExportState,writableState:{activeState:t,exportedEntityId:e}});getSelectUpdate=t=>m.EphemeralRecordModification({componentInstance:{entityId:y,componentType:g},updateTag:T.SelectEntity,writableState:{selectedEntityId:t}});getDeselectUpdate=()=>m.EphemeralRecordModification({componentInstance:{entityId:y,componentType:g},updateTag:T.Deselect,writableState:{selectedEntityId:this._context.selectors.getStoreSystem().stateSlices.committed.value.state.rootEntityId}});getHoverInUpdate=t=>m.EphemeralRecordModification({componentInstance:{entityId:y,componentType:d},updateTag:T.HoverIn,writableState:{hoveredEntityId:t}});getHoverOutUpdate=()=>m.EphemeralRecordModification({componentInstance:{entityId:y,componentType:d},updateTag:T.HoverOut,writableState:{hoveredEntityId:null}});getFullscreenUpdate=t=>m.EphemeralRecordModification({componentInstance:{entityId:y,componentType:l},updateTag:T.ToggleFullscreen,writableState:{enabled:t}});getDragStartUpdate=t=>m.EphemeralRecordModification({componentInstance:{entityId:y,componentType:c},updateTag:T.DragStart,writableState:{draggedEntityId:t}});getDragEndUpdate=()=>m.EphemeralRecordModification({componentInstance:{entityId:y,componentType:c},updateTag:T.DragEnd,writableState:{draggedEntityId:null}});getViewportUpdate=t=>m.EphemeralRecordModification({componentInstance:{entityId:y,componentType:I},updateTag:T.SetViewport,writableState:{active:t}});getToggleFullscreenUpdate=(t=this._context.selectors.getStoreSystem().stateSlices.committed.value.state)=>{let e=this.getActiveFullscreenState(t);return this.getFullscreenUpdate(!e)};debouncedToggleHover=t=>{this._hoverSubject.next({hoveredEntityId:t,generation:this._generation})};resetApplicationStates(){}}
|
|
@@ -1,16 +1,5 @@
|
|
|
1
1
|
import type { ValueOf } from '@salsita-ai/common/utils';
|
|
2
|
-
import { debugStateComponent } from '../../
|
|
3
|
-
import { dragStateComponent } from '../../components/drag-state-component.js';
|
|
4
|
-
import { exportStateComponent } from '../../components/export-state-component.js';
|
|
5
|
-
import { fullscreenStateComponent } from '../../components/fullscreen-state-component.js';
|
|
6
|
-
import { hoverStateComponent } from '../../components/hover-state-component.js';
|
|
7
|
-
import { navigationStateComponent } from '../../components/navigation-state-component.js';
|
|
8
|
-
import { selectionStateComponent } from '../../components/selection-state-component.js';
|
|
9
|
-
import { toolStateComponent } from '../../components/tool-state-component.js';
|
|
10
|
-
import type { EphemeralRecordCreation, EphemeralRecordModification, StateUpdate } from '../../components/updates.js';
|
|
11
|
-
import { viewStateComponent } from '../../components/view-state-component.js';
|
|
12
|
-
import { viewportStateComponent } from '../../components/viewport-state-component.js';
|
|
13
|
-
import type { DomainEntity } from '../../core/model.js';
|
|
2
|
+
import { type DomainEntity, type EphemeralRecordCreation, type EphemeralRecordModification, type StateUpdate, debugStateComponent, dragStateComponent, exportStateComponent, fullscreenStateComponent, hoverStateComponent, navigationStateComponent, selectionStateComponent, toolStateComponent, viewStateComponent, viewportStateComponent } from '../../core/index.js';
|
|
14
3
|
/**
|
|
15
4
|
* All updates performed by the navigation system.
|
|
16
5
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{debugStateComponent as e
|
|
1
|
+
import{debugStateComponent as e,dragStateComponent as t,exportStateComponent as a,fullscreenStateComponent as n,hoverStateComponent as o,navigationStateComponent as i,selectionStateComponent as p,toolStateComponent as c,viewStateComponent as d,viewportStateComponent as g}from"../../core/index.js";export const NavigationUpdateTag={Initial:"navigation.initial",ReplaceNavigation:"navigation.replaceNavigation",PushNavigation:"navigation.pushNavigation",PopNavigation:"navigation.popNavigation",ActiveateView:"navigation.activateView",ActivateTool:"navigation.activateTool",SetExportState:"navigation.setExportState",SelectEntity:"navigation.selectEntity",Deselect:"navigation.deselect",ToggleFullscreen:"navigation.toggleFullscreen",SetViewport:"navigation.setViewport",HoverIn:"navigation.hoverIn",HoverOut:"navigation.hoverOut",DragStart:"navigation.dragStart",DragEnd:"navigation.dragEnd"};export const isInitialNavigationUpdate=e=>e.updateTag===NavigationUpdateTag.Initial&&"createEphemeralRecord"===e.kind&&e.componentInstance.componentType===i;export const isNavigationUpdate=e=>(e.updateTag===NavigationUpdateTag.ReplaceNavigation||e.updateTag===NavigationUpdateTag.PushNavigation||e.updateTag===NavigationUpdateTag.PopNavigation)&&"modifyEphemeralRecord"===e.kind&&e.componentInstance.componentType===i;export const isInitialViewUpdate=e=>e.updateTag===NavigationUpdateTag.Initial&&"createEphemeralRecord"===e.kind&&e.componentInstance.componentType===d;export const isInitialToolUpdate=e=>e.updateTag===NavigationUpdateTag.Initial&&"createEphemeralRecord"===e.kind&&e.componentInstance.componentType===c;export const isViewUpdate=e=>e.updateTag===NavigationUpdateTag.ActiveateView&&"modifyEphemeralRecord"===e.kind&&e.componentInstance.componentType===d;export const isToolUpdate=e=>e.updateTag===NavigationUpdateTag.ActivateTool&&"modifyEphemeralRecord"===e.kind&&e.componentInstance.componentType===c;export const isExportUpdate=e=>e.updateTag===NavigationUpdateTag.SetExportState&&"modifyEphemeralRecord"===e.kind&&e.componentInstance.componentType===a;export const isInitialSelectionUpdate=e=>e.updateTag===NavigationUpdateTag.Initial&&"createEphemeralRecord"===e.kind&&e.componentInstance.componentType===p;export const isSelectUpdate=e=>e.updateTag===NavigationUpdateTag.SelectEntity&&"modifyEphemeralRecord"===e.kind&&e.componentInstance.componentType===p;export const isDeselectUpdate=e=>e.updateTag===NavigationUpdateTag.Deselect&&"modifyEphemeralRecord"===e.kind&&e.componentInstance.componentType===p;export const isHoverInUpdate=e=>e.updateTag===NavigationUpdateTag.HoverIn&&"modifyEphemeralRecord"===e.kind&&e.componentInstance.componentType===o;export const isHoverOutUpdate=e=>e.updateTag===NavigationUpdateTag.HoverOut&&"modifyEphemeralRecord"===e.kind&&e.componentInstance.componentType===o;export const isInitialFullscreenUpdate=e=>e.updateTag===NavigationUpdateTag.Initial&&"createEphemeralRecord"===e.kind&&e.componentInstance.componentType===n;export const isToggleFullscreenUpdate=e=>e.updateTag===NavigationUpdateTag.ToggleFullscreen&&"modifyEphemeralRecord"===e.kind&&e.componentInstance.componentType===n;export const isInitialDebugUpdate=t=>t.updateTag===NavigationUpdateTag.Initial&&"createEphemeralRecord"===t.kind&&t.componentInstance.componentType===e;export const isInitialViewportUpdate=e=>e.updateTag===NavigationUpdateTag.Initial&&"createEphemeralRecord"===e.kind&&e.componentInstance.componentType===g;export const isSetViewportUpdate=e=>e.updateTag===NavigationUpdateTag.SetViewport&&"modifyEphemeralRecord"===e.kind&&e.componentInstance.componentType===g;export const isInitialDragUpdate=e=>e.updateTag===NavigationUpdateTag.Initial&&"createEphemeralRecord"===e.kind&&e.componentInstance.componentType===t;export const isDragStartUpdate=e=>e.updateTag===NavigationUpdateTag.DragStart&&"modifyEphemeralRecord"===e.kind&&e.componentInstance.componentType===t;export const isDragEndUpdate=e=>e.updateTag===NavigationUpdateTag.DragEnd&&"modifyEphemeralRecord"===e.kind&&e.componentInstance.componentType===t;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type $DomainEntity, type DomainEntity } from '../../core/
|
|
1
|
+
import { type $DomainEntity, type DomainEntity } from '../../core/index.js';
|
|
2
2
|
import type { DomainContextSystems } from '../domain-context-systems.js';
|
|
3
3
|
import type { UpdateTransformer } from '../store-system/store-system.js';
|
|
4
4
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{domainEntityTypeFromId as t,isDomainEntityId as e}from"../../core/
|
|
1
|
+
import{domainEntityTypeFromId as t,isDomainEntityId as e}from"../../core/index.js";import{isDeselectUpdate as a,isNavigationUpdate as n,isSelectUpdate as i}from"./navigation-updates.js";export const createResetSelectionOnNavigationTransformer=(t,e)=>a=>a.flatMap(a=>n(a)&&t.includes(a.writableState.activeState)?[a,e.navigationSystem.getDeselectUpdate()]:[a]);export const createNavigationOnSelectionTransformer=(e,a,n)=>o=>o.flatMap(o=>i(o)&&t(o.writableState.selectedEntityId)===e?[o,n.navigationSystem.getNavigationUpdate(a)]:[o]);export const createNavigationOnSelectionChangeTransformer=(e,a,n,o)=>(r,s)=>r.flatMap(r=>{if(!i(r))return[r];let c=t(o.navigationSystem.getActiveSelectionState(s)),l=t(r.writableState.selectedEntityId);return c===e&&l===a?[r,o.navigationSystem.getNavigationUpdate(n)]:[r]});export const createNavigationOnDeselectTransformer=(t,e)=>n=>n.flatMap(n=>a(n)?[n,e.navigationSystem.getNavigationUpdate(t)]:[n]);export const createSelectParentOnDeselectionTransformer=t=>(n,i)=>{let o=t.navigationSystem.getActiveSelectionState(i);return n.flatMap(n=>{if(a(n)&&e(o)){let e=t.compositionProjections.getTree(i).map.get(o);if(!e)throw Error(`Can not fallback to parent selected entity, entity with id ${o} not found in the composition tree. The state is invalid!`);return e.parent?[n,t.navigationSystem.getSelectUpdate(e.parent.id)]:[n]}return[n]})};
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { type DomainEntityCreation, type DomainEntityReplacement, type StateUpdate } from '../../
|
|
2
|
-
import { type DomainEntity, type DomainEntityId, type DomainState } from '../../core/index.js';
|
|
1
|
+
import { type DomainEntity, type DomainEntityCreation, type DomainEntityId, type DomainEntityReplacement, type DomainState, type StateUpdate } from '../../core/index.js';
|
|
3
2
|
import type { DomainContextSelectors } from '../../domain-runtime/domain-context/index.js';
|
|
4
3
|
import type { EntityRecipe } from './recipes.js';
|
|
5
4
|
export declare const CreateRecipeUpdateTag = "createRecipe";
|