@salsita-ai/sdk 0.50.0-develop.be40f0cee8 → 0.50.0-develop.d6ed5efd42
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/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/configurator-domain-code.d.ts +1 -2
- package/dist/application-spec/generate-application/code/templates/configurator-domain-code.js +7 -16
- 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.js +4 -4
- package/dist/application-spec/generate-application/code/templates/domain.js +3 -3
- package/dist/application-spec/generate-application/code/templates/index.d.ts +1 -0
- package/dist/application-spec/generate-application/code/templates/index.js +1 -1
- package/dist/application-spec/generate-application/code/templates/skills/agents-md.js +1 -1
- package/dist/application-spec/generate-application/code/templates/skills/phoenix-cli-skill.js +1 -1
- package/dist/application-spec/generate-application/code/templates/skills/phoenix-create-configurator-skill.js +41 -13
- package/dist/application-spec/generate-application/code/templates/skills/phoenix-feedback-skill.js +1 -1
- package/dist/application-spec/generate-application/code/templates/skills/phoenix-review-skill.js +2 -2
- package/dist/application-spec/generate-application/code/templates/skills/phoenix-skill.js +1 -1
- package/dist/application-spec/generate-application/code/templates/skills/phoenix-variants-skill.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/skills/sdk-content.d.ts +30 -3
- package/dist/application-spec/generate-application/code/templates/skills/sdk-content.js +19 -5
- package/dist/application-spec/generate-application/code/templates/webhook-builders.js +8 -4
- 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/parse-application-files/spec/sections/assistant/assistant-field-type.d.ts +3 -8
- 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 +9 -43
- 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 -21
- package/dist/client/phoenix-api.d.ts +58 -30
- package/dist/configurator/application-runtime/extensions/selectors.js +1 -1
- package/dist/configurator/application-runtime/extensions/systems/assistant-system/assistant-system.d.ts +158 -13
- package/dist/configurator/application-runtime/extensions/systems/assistant-system/assistant-system.js +1 -1
- 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/application-runtime/extensions/systems/assistant-system/graphql-tools.d.ts +8 -3
- package/dist/configurator/application-runtime/extensions/systems/assistant-system/graphql-tools.js +1 -1
- 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 -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.js +1 -1
- package/dist/configurator/ui/assistant/AssistantComposer.d.ts +1 -6
- package/dist/configurator/ui/assistant/AssistantComposer.js +1 -1
- package/dist/configurator/ui/assistant/AssistantPanel.js +1 -1
- package/dist/configurator/ui/assistant/AssistantThread.d.ts +1 -6
- package/dist/configurator/ui/assistant/AssistantThread.js +1 -1
- package/dist/configurator/ui/assistant/index.d.ts +1 -1
- package/dist/configurator/ui/assistant/index.js +1 -1
- package/dist/configurator/ui/assistant/thread-items.d.ts +1 -1
- package/dist/configurator/ui/assistant/tool-chip.d.ts +8 -1
- package/dist/configurator/ui/assistant/tool-chip.js +1 -1
- 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 +2 -2
- package/dist/configurator/ui/configurator-layout/universal/Layout.js +1 -1
- 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 +2 -2
- package/dist/configurator/ui/phoenix-layout-elements/AssistantToolbarButton.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 +1 -1
- package/dist/docs/layouts/custom-price.mdx +14 -16
- package/dist/docs/layouts/sidebar/tabs.mdx +24 -21
- package/dist/docs/layouts/toolbar.mdx +3 -1
- package/dist/docs/other-features/domain-actions.mdx +1 -1
- 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 +9 -24
- package/dist/docs/phoenix/localization.mdx +3 -22
- package/dist/docs/phoenix/phoenix-cli.mdx +81 -2
- package/dist/docs/phoenix/project-structure.mdx +9 -2
- package/dist/docs/phoenix/sdk-builder-workflow.mdx +4 -3
- package/dist/docs/recipes-and-delete/recipe-hierarchy-selection.mdx +15 -13
- package/dist/docs/relations/hierarchy.mdx +13 -2
- package/dist/domain/actions/action-factory.d.ts +4 -4
- package/dist/domain/admin-domain/__generated/enhanced-model.d.ts +1 -1
- 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 -3
- package/dist/domain/admin-domain/implementation/common-admin-migrations.d.ts +1 -1
- package/dist/domain/admin-domain/index.d.ts +1 -1
- package/dist/domain/application/admin-page-factories.d.ts +1 -1
- package/dist/domain/application/application-config.d.ts +25 -75
- package/dist/domain/application/assistant/assistant-manifest.d.ts +61 -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/{phoenix/application-spec → domain/application/assistant}/generate-assistant-prompt.d.ts +6 -5
- 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 +2 -4
- package/dist/domain/application/assistant-mutations.js +1 -1
- package/dist/domain/application/assistant-recipe-groups.d.ts +2 -4
- package/dist/domain/application/configurator-builder.d.ts +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/components/component-reader-types.d.ts +1 -2
- package/dist/domain/components/debug-state-component.d.ts +1 -1
- package/dist/domain/components/debug-state-component.js +1 -1
- package/dist/domain/components/domain-component-optic.d.ts +4 -6
- package/dist/domain/components/domain-component-optic.js +2 -2
- package/dist/domain/components/drag-state-component.d.ts +1 -1
- package/dist/domain/components/drag-state-component.js +1 -1
- package/dist/domain/components/export-state-component.d.ts +1 -1
- package/dist/domain/components/export-state-component.js +1 -1
- package/dist/domain/components/fullscreen-state-component.d.ts +1 -1
- package/dist/domain/components/fullscreen-state-component.js +1 -1
- package/dist/domain/components/group-components-by-entity-id-and-name.d.ts +1 -2
- package/dist/domain/components/group-components-by-entity-id-and-name.js +1 -1
- package/dist/domain/components/hover-state-component.d.ts +1 -1
- package/dist/domain/components/hover-state-component.js +1 -1
- package/dist/domain/components/legacy-filter.d.ts +1 -2
- package/dist/domain/components/navigation-state-component.d.ts +1 -1
- package/dist/domain/components/navigation-state-component.js +1 -1
- package/dist/domain/components/selection-state-component.d.ts +1 -1
- package/dist/domain/components/selection-state-component.js +1 -1
- package/dist/domain/components/system-component-builder.d.ts +1 -2
- package/dist/domain/components/system-component-builder.js +1 -1
- package/dist/domain/components/system-component-filter.d.ts +1 -3
- package/dist/domain/components/system-virtual-entity.js +1 -1
- package/dist/domain/components/tool-state-component.d.ts +1 -1
- package/dist/domain/components/tool-state-component.js +1 -1
- package/dist/domain/components/updates.d.ts +17 -2
- package/dist/domain/components/view-state-component.d.ts +1 -1
- package/dist/domain/components/view-state-component.js +1 -1
- package/dist/domain/components/viewport-state-component.d.ts +1 -1
- package/dist/domain/components/viewport-state-component.js +1 -1
- package/dist/domain/core/action.d.ts +4 -5
- 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/index.d.ts +2 -0
- package/dist/domain/core/decoder/index.js +1 -0
- package/dist/domain/core/domain-factory.d.ts +3 -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 +7 -17
- package/dist/domain/core/index.js +1 -1
- 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 +11 -8
- package/dist/domain/domain-builder.js +1 -1
- package/dist/domain/domain-context/action-system/action-system.d.ts +1 -3
- package/dist/domain/domain-context/action-system/action-system.js +1 -1
- package/dist/domain/domain-context/create-transformer.d.ts +1 -1
- package/dist/domain/domain-context/domain-context-systems.d.ts +1 -3
- package/dist/domain/domain-context/index.d.ts +2 -2
- package/dist/domain/domain-context/navigation-system/navigation-system.d.ts +1 -2
- package/dist/domain/domain-context/navigation-system/navigation-updates.d.ts +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/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/create-entity-refs.d.ts +1 -1
- package/dist/domain/domain-context/relation-transformers/replace-refs.d.ts +1 -1
- package/dist/domain/domain-context/store-system/apply-updates.d.ts +1 -2
- 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 -12
- 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 -1
- package/dist/domain/domain-context/store-system/store-system.d.ts +1 -3
- package/dist/domain/domain-context/store-system/store-system.js +1 -1
- package/dist/domain/domain-context/store-system/system-state.d.ts +1 -3
- package/dist/domain/domain-context/transformers/actions-builder.d.ts +1 -1
- package/dist/domain/domain-context/transformers/actions-builder.js +1 -1
- package/dist/domain/domain-context/transformers/auto-snap-transformer.d.ts +1 -2
- package/dist/domain/domain-context/transformers/chain-builder.d.ts +2 -2
- package/dist/domain/domain-context/transformers/context.d.ts +1 -3
- package/dist/domain/domain-context/transformers/entity-builder.d.ts +1 -1
- package/dist/domain/domain-context/transformers/entity-builder.js +1 -1
- package/dist/domain/domain-context/transformers/then-builder.d.ts +1 -1
- package/dist/domain/domain-context/transformers/then-builder.js +1 -1
- package/dist/domain/domain-context/transformers/when-builder.d.ts +1 -2
- 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 -3
- package/dist/domain/domain-runtime/domain-context/component-reader.js +1 -1
- package/dist/domain/domain-runtime/domain-context/selectors.d.ts +1 -2
- package/dist/domain/domain-runtime/domain-context/selectors.js +1 -1
- package/dist/domain/domain-runtime/domain-runtime.d.ts +4 -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 +3 -3
- package/dist/domain/index.d.ts +3 -4
- package/dist/domain/index.js +1 -1
- package/dist/domain/invariants/builtin-invariant.d.ts +1 -2
- package/dist/domain/invariants/custom-invariants.d.ts +1 -3
- package/dist/domain/invariants/invariants.d.ts +10 -4
- package/dist/domain/invariants/invariants.js +1 -1
- package/dist/domain/invariants/violation.d.ts +1 -1
- package/dist/domain/mocks/create-mock-domain-runtime.d.ts +3 -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/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/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 +1 -2
- 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-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/autorotate-camera-component.d.ts +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-sphere-component.d.ts +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-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-selection.d.ts +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-geometries.d.ts +1 -1
- package/dist/domain/system-components/collision-geometry.d.ts +1 -1
- package/dist/domain/system-components/collision-point-geometry.d.ts +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/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-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/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/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/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-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 -1
- 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-swatch.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/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/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-delete-fab.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-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-remote-material-override.js +1 -1
- package/dist/domain/system-components/scene-entity-object-transimissive-material-override.js +1 -1
- package/dist/domain/system-components/scene-entity-remote-material-override.js +1 -1
- package/dist/domain/system-components/scene-entity-select-hotspot.js +1 -1
- package/dist/domain/system-components/scene-entity-transimissive-material-override.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/summary-component.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/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/use-implementation-files.d.ts +7 -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/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/deploy.js +2 -2
- package/dist/phoenix/commands/dev.js +5 -5
- package/dist/phoenix/commands/index.d.ts +1 -0
- package/dist/phoenix/commands/index.js +1 -1
- 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 +4 -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-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.js +1 -1
- 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 +4 -4
- 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/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 +4 -4
- 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 -30
- package/dist/configurator/assistant/use-assistant-chat.js +0 -1
- package/dist/configurator/ui/assistant/AssistantPanelProvider.d.ts +0 -42
- package/dist/configurator/ui/assistant/AssistantPanelProvider.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/phoenix/application-spec/generate-assistant-prompt.js +0 -1
- /package/dist/domain/{core/enhanced-json-schema.js → application/assistant/assistant-manifest.js} +0 -0
- /package/dist/domain/{core/expression.js → application/assistant/assistant-resolved-manifest.js} +0 -0
- /package/dist/domain/core/{schema-validator.js → decoder/decoder.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/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,13 +1,23 @@
|
|
|
1
|
-
import type { $DomainEntity, DomainEntity } from '../core/
|
|
1
|
+
import type { $DomainEntity, DomainEntity } from '../core/index.js';
|
|
2
2
|
import type { DomainContextSystems } from '../domain-context/domain-context-systems.js';
|
|
3
3
|
import type { Transformers } from '../domain-context/store-system/store-system.js';
|
|
4
|
+
import { type ProjectModule } from '../project-modules/index.js';
|
|
4
5
|
import type { ImportedTransformer, SpecTransformer } from './application-config.js';
|
|
6
|
+
type AnyImportedTransformer = ImportedTransformer<any, any, any, any, any, any, any>;
|
|
7
|
+
/**
|
|
8
|
+
* The transformer of one `src/transformers/` file, named after the file. The spec's `transformers` section
|
|
9
|
+
* selects a plain-function export by that name; a transformer made with `build(name)` registers under its own.
|
|
10
|
+
*/
|
|
11
|
+
export declare const resolveTransformerModule: (module: ProjectModule) => AnyImportedTransformer;
|
|
12
|
+
/** Validates the `src/transformers/` files of an application config and names each after its file. */
|
|
13
|
+
export declare const resolveTransformerModules: (modules: readonly ProjectModule[]) => readonly AnyImportedTransformer[];
|
|
5
14
|
/**
|
|
6
15
|
* Resolves imported transformer modules against spec transformer declarations.
|
|
7
16
|
* Each imported transformer is registered/executed with the domain context,
|
|
8
17
|
* then matched by name against spec entries to apply priority ordering.
|
|
9
18
|
*
|
|
10
|
-
* Used both
|
|
19
|
+
* Used both when the runtime spec is initialized from the application config and at hot-reload time
|
|
11
20
|
* (via domain-context subscription to registry changes).
|
|
12
21
|
*/
|
|
13
22
|
export declare const resolveImportedTransformers: <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>(importedTransformers: ReadonlyArray<ImportedTransformer<ENTITIES, ALLOWED_ROOT_ENTITIES, $MAP, NAVIGATION_STATES, VIEW_STATES, TOOL_STATES, EXPORT_STATES>>, specTransformers: readonly SpecTransformer[], ctx: DomainContextSystems<ENTITIES, ALLOWED_ROOT_ENTITIES, $MAP, NAVIGATION_STATES, VIEW_STATES, TOOL_STATES, EXPORT_STATES>) => Transformers<ENTITIES>;
|
|
23
|
+
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export const resolveImportedTransformers=(r,e,t)=>{let o=r.flatMap(({name:r,transformer:e})=>{if(Array.isArray(e))return e.map((e,o)=>{if("register"in e)return e.register(t);if("function"==typeof e)return{priority:1/0,transformer:e(t),name:`${r}[${o}]`};throw Error(`Transformer '${r}[${o}]' must be either a RegistrableTransformer (with register method) or a TransformerFactory (function)`)});if("register"in e)return e.register(t);if("function"==typeof e)return{priority:1/0,transformer:e(t),name:r};throw Error(`Transformer '${r}' must be either a RegistrableTransformer (with register method) or a TransformerFactory (function)`)}),n=[];for(let r of e){let e=o.find(e=>e.name===r.name);if(!e){let e=o.map(r=>r.name).filter(Boolean).join(", ");throw Error(`Transformer '${r.name}' not found in imported transformer files. Available transformers: ${e||"none"}`)}n.push({priority:r.priority??1/0,transformer:e.transformer,name:r.name})}return n};
|
|
1
|
+
import{SHARED_FOLDER_HINT as r,createContractError as e,isRecord as t}from"../project-modules/index.js";let o={expected:"a transformer (a function of the domain context, or an object with a register method), or an array of them",fix:`Create it with phx.frontend.transformerBuilder, ${r}.`},n=r=>"function"==typeof r||t(r)&&"function"==typeof r.register;export const resolveTransformerModule=r=>{let t;if(!(Array.isArray(t=r.exports)?t.every(n):n(t)))throw e(r.origin,o,r.exports);return{name:r.origin.replace(/^.*\//,"").replace(/\.tsx?$/,""),transformer:r.exports}};export const resolveTransformerModules=r=>r.map(resolveTransformerModule);export const resolveImportedTransformers=(r,e,t)=>{let o=r.flatMap(({name:r,transformer:e})=>{if(Array.isArray(e))return e.map((e,o)=>{if("register"in e)return e.register(t);if("function"==typeof e)return{priority:1/0,transformer:e(t),name:`${r}[${o}]`};throw Error(`Transformer '${r}[${o}]' must be either a RegistrableTransformer (with register method) or a TransformerFactory (function)`)});if("register"in e)return e.register(t);if("function"==typeof e)return{priority:1/0,transformer:e(t),name:r};throw Error(`Transformer '${r}' must be either a RegistrableTransformer (with register method) or a TransformerFactory (function)`)}),n=[];for(let r of e){let e=o.find(e=>e.name===r.name);if(!e){let e=o.map(r=>r.name).filter(Boolean).join(", ");throw Error(`Transformer '${r.name}' not found in imported transformer files. Available transformers: ${e||"none"}`)}n.push({priority:r.priority??1/0,transformer:e.transformer,name:r.name})}return n};
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import type { ComponentInstance, SystemComponentTypeConstraint } from '../core/
|
|
2
|
-
import type { EntityId } from '../core/model.js';
|
|
1
|
+
import type { ComponentInstance, EntityId, SystemComponentTypeConstraint } from '../core/index.js';
|
|
3
2
|
import type { ComponentSystemFilterState, FilterMismatchReason } from './system-component-filter.js';
|
|
4
3
|
/**
|
|
5
4
|
* Filter for reading a single attachment of a component on one entity.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{isSnapshotInstance as e}from"../core/
|
|
1
|
+
import{isSnapshotInstance as e}from"../core/index.js";import{SystemComponentBuilder as t}from"./system-component-builder.js";import{systemVirtualEntityId as o}from"./system-virtual-entity.js";export const debugStateComponent=t.component("debugState").withState({type:"object",properties:{enabled:{type:"boolean"}},required:["enabled"],additionalProperties:!1}).withWritableKeys(["enabled"]).build();export const isDebugStateComponentSnapshot=t=>e(t,"singleton",debugStateComponent);export const isSystemDebugStateComponentSnapshot=e(o,"singleton",debugStateComponent);
|
|
@@ -1,10 +1,6 @@
|
|
|
1
1
|
import type { SessionRole } from '@salsita-ai/contracts/api';
|
|
2
|
-
import type
|
|
3
|
-
import
|
|
4
|
-
import type { ExpressionContext } from '../core/expression.js';
|
|
5
|
-
import type { $DomainEntity, DomainEntity, EntityByType } from '../core/model.js';
|
|
6
|
-
import type { DomainState } from '../core/state.js';
|
|
7
|
-
import type { CustomExpression } from '../expressions/custom-expression.js';
|
|
2
|
+
import { type $DomainEntity, type AliasMap, type CustomExpression, type DomainEntity, type DomainState, type EntityByType, type ExpressionContext, type StateOfComponent, type SystemComponentType, type SystemComponentTypeConstraint, type WritableStateOfComponent } from '../core/index.js';
|
|
3
|
+
import { type ProjectModule } from '../project-modules/index.js';
|
|
8
4
|
import { type ComponentSystemFilter, type NavigationFilterOptic } from './legacy-filter.js';
|
|
9
5
|
import type { GradualComponentSystemFilter, IdOrWithId } from './system-component-filter.js';
|
|
10
6
|
import type { Viewport } from './viewport-state-component.js';
|
|
@@ -33,6 +29,8 @@ export interface DomainComponentDynamicOptic<ENTITIES extends DomainEntity<strin
|
|
|
33
29
|
}
|
|
34
30
|
export type DomainComponentOptic<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, COMPONENT_TYPE extends SystemComponentTypeConstraint> = DomainComponentSimpleOptic<ENTITIES, ALLOWED_ROOT_ENTITIES, PUBLISHED_DATA, SESSION_DATA, FRONTEND_DATA, ENTITY, COMPONENT_TYPE> | DomainComponentDynamicOptic<ENTITIES, ALLOWED_ROOT_ENTITIES, PUBLISHED_DATA, SESSION_DATA, FRONTEND_DATA, COMPONENT_TYPE>;
|
|
35
31
|
export type AnyDomainComponentOptic = DomainComponentOptic<any, any, any, any, any, any, any>;
|
|
32
|
+
/** Validates the `src/components/` files, or the optics a generated file lists, and flattens them. */
|
|
33
|
+
export declare const resolveComponentOpticModules: (modules: readonly ProjectModule[]) => readonly AnyDomainComponentOptic[];
|
|
36
34
|
export declare class DomainComponentOpticBuilder<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>, ENTITY extends ENTITIES, $ENTITY extends $DomainEntity<ENTITIES>, COMPONENT_TYPE extends SystemComponentTypeConstraint> {
|
|
37
35
|
private readonly aliasMap;
|
|
38
36
|
private readonly entityTypes;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{createCacheToken as t,getStickyCache as e}from"@salsita-ai/common/utils";import{createCustomExpression as i}from"../
|
|
1
|
+
import{createCacheToken as t,getStickyCache as e}from"@salsita-ai/common/utils";import{createCustomExpression as i}from"../core/index.js";import{SHARED_FOLDER_HINT as n,isRecord as a,resolveListModule as s}from"../project-modules/index.js";import{withProfilerLabel as o}from"../utils/profiler-label.js";let r={expected:"an attached component, or an array of them",fix:`Create it with phx.domain.attachComponent(...) (phx.domain.admin.attachComponent(...) under src/admin/), ${n}.`},d=t=>a(t)&&("simple"===t.kind||"dynamic"===t.kind)&&"string"==typeof t.instanceName&&"function"==typeof t.read;export const resolveComponentOpticModules=t=>t.flatMap(t=>s(t,r,d));export class DomainComponentOpticBuilder{aliasMap;entityTypes;componentType;instanceName;navigationFilters;generated;entityTypeOrAliasNames;constructor(t,e,i,n,a=[],s=!1,o=[]){this.aliasMap=t,this.entityTypes=e,this.componentType=i,this.instanceName=n,this.navigationFilters=a,this.generated=s,this.entityTypeOrAliasNames=o}static from(t){return new DomainComponentOpticBuilder(t,[])}withEntity(t){return new DomainComponentOpticBuilder(this.aliasMap,[...this.entityTypes,t],this.componentType,this.instanceName,this.navigationFilters,this.generated,[...this.entityTypeOrAliasNames,t])}withAlias(t){return new DomainComponentOpticBuilder(this.aliasMap,[...this.entityTypes,...this.aliasMap[t]],this.componentType,this.instanceName,this.navigationFilters,this.generated,[...this.entityTypeOrAliasNames,String(t)])}withComponent(t,e,i=!1){return new DomainComponentOpticBuilder(this.aliasMap,this.entityTypes,t,e,this.navigationFilters,i,this.entityTypeOrAliasNames)}withFilter(i){if(console.warn(`Component ${this.componentType?.name}#${this.instanceName} on entity ${this.entityTypes.join(", ")} uses a legacy filter with full filter evaluation. This is a suboptimal variant and is deprecated in favor of per-criterion evaluation.
|
|
2
2
|
|
|
3
3
|
In your TS files, replace
|
|
4
4
|
withFilter()
|
|
@@ -13,4 +13,4 @@ import{createCacheToken as t,getStickyCache as e}from"@salsita-ai/common/utils";
|
|
|
13
13
|
active:
|
|
14
14
|
$read: $trueOrFalseExpression
|
|
15
15
|
# ... other eventual criteria
|
|
16
|
-
`),"function"==typeof i){let n=t(),
|
|
16
|
+
`),"function"==typeof i){let n=t(),a=t=>({evaluate:(a,s,o)=>{let r=e(s,n),d=r.get(a);if(!d){if(void 0===(d=i(o.domain.get$Entity(a,s),s)))throw Error(`Dynamic filter on component ${this.componentType?.name}.${this.instanceName} on entity ${a} returned 'undefined'. This is likely a bug in the component definition, check whether you are referencing a correct expression or field!`);r.put(a,d)}return"boolean"==typeof d?"active"===t?d:void 0:d[t]},meta:{}});return new DomainComponentOpticBuilder(this.aliasMap,this.entityTypes,this.componentType,this.instanceName,[...this.navigationFilters,{navigationStates:a("navigationStates"),selectedEntityIds:a("selectedEntityIds"),hoveredEntityIds:a("hoveredEntityIds"),draggedEntityIds:a("draggedEntityIds"),viewStates:a("viewStates"),toolStates:a("toolStates"),modes:a("modes"),roles:a("roles"),active:a("active"),fullscreen:a("fullscreen"),debug:a("debug"),viewports:a("viewports"),exportedEntityIds:void 0,exportStates:void 0}],this.generated,this.entityTypeOrAliasNames)}return"boolean"==typeof i?new DomainComponentOpticBuilder(this.aliasMap,this.entityTypes,this.componentType,this.instanceName,[...this.navigationFilters,{active:i,navigationStates:void 0,selectedEntityIds:void 0,hoveredEntityIds:void 0,draggedEntityIds:void 0,viewStates:void 0,toolStates:void 0,modes:void 0,roles:void 0,fullscreen:void 0,debug:void 0,viewports:void 0,exportedEntityIds:void 0,exportStates:void 0}],this.generated,this.entityTypeOrAliasNames):new DomainComponentOpticBuilder(this.aliasMap,this.entityTypes,this.componentType,this.instanceName,[...this.navigationFilters,{navigationStates:void 0,selectedEntityIds:void 0,hoveredEntityIds:void 0,draggedEntityIds:void 0,viewStates:void 0,toolStates:void 0,modes:void 0,roles:void 0,active:void 0,fullscreen:void 0,debug:void 0,viewports:void 0,exportedEntityIds:void 0,exportStates:void 0,...i}],this.generated,this.entityTypeOrAliasNames)}withGradualFilter(t){let e=t=>"function"==typeof t?i(t,{}):t,n={navigationStates:e(t.navigationStates),selectedEntityIds:e(t.selectedEntityIds),hoveredEntityIds:e(t.hoveredEntityIds),draggedEntityIds:e(t.draggedEntityIds),exportedEntityIds:e(t.exportedEntityIds),viewStates:e(t.viewStates),toolStates:e(t.toolStates),exportStates:e(t.exportStates),modes:e(t.modes),roles:e(t.roles),active:e(t.active),fullscreen:e(t.fullscreen),debug:e(t.debug),viewports:e(t.viewports)};return new DomainComponentOpticBuilder(this.aliasMap,this.entityTypes,this.componentType,this.instanceName,[...this.navigationFilters,n],this.generated,this.entityTypeOrAliasNames)}validate(){if(!this.componentType||!this.instanceName)throw Error("Use withComponent before attaching");if(!this.entityTypes.length)throw Error("Use withEntity and/or withAlias before attaching")}_getProfilerLabel(){return[...this.entityTypeOrAliasNames,this.componentType.name,this.instanceName].join("_")}attach=(i,n)=>{var a,s;let r,d;return this.validate(),a={kind:"simple",entityTypes:new Set(this.entityTypes),componentType:this.componentType,instanceName:this.instanceName,navigationFilters:this.navigationFilters,read:(t,e,n)=>i(n.domain.get$Entity(t,e),e,n),write:n??(()=>({})),generated:this.generated},s=this._getProfilerLabel(),r=t(),d=o(s,a.read),{...a,read:(t,i,n)=>{let a=e(i,r),s=a.get(t);if(s)return s;let o=d(t,i,n);return a.put(t,o),o}}};attachMany=i=>{var n,a;let s,r;return this.validate(),n={kind:"dynamic",entityTypes:new Set(this.entityTypes),componentType:this.componentType,instanceName:this.instanceName,navigationFilters:this.navigationFilters,read:(t,e,n)=>i(n.domain.get$Entity(t,e),e,n)},a=this._getProfilerLabel(),s=t(),r=o(a,n.read),{...n,read:(t,i,n)=>{let a=e(i,s),o=a.get(t);if(o)return o;let d=r(t,i,n);return a.put(t,d),d}}}}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type DomainEntityId, type EntityId } from '../core/index.js';
|
|
2
2
|
export type DragStateComponentState = {
|
|
3
3
|
/** The entity currently being dragged in the scene, or `null` while nothing is dragged. */
|
|
4
4
|
readonly draggedEntityId: DomainEntityId<string> | null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{isSnapshotInstance as t}from"../core/
|
|
1
|
+
import{isSnapshotInstance as t}from"../core/index.js";import{SystemComponentBuilder as e}from"./system-component-builder.js";import{systemVirtualEntityId as o}from"./system-virtual-entity.js";export const dragStateComponent=e.component("dragState").withState({type:"object",properties:{draggedEntityId:{oneOf:[{type:"string"},{type:"null"}]}},required:["draggedEntityId"],additionalProperties:!1,tsType:"DragStateComponentState",import:[{module:"@salsita-ai/sdk/domain",member:"DragStateComponentState"}]}).withWritableKeys(["draggedEntityId"]).build();export const isDragStateComponentSnapshot=e=>t(e,"singleton",dragStateComponent);export const isSystemDragStateComponentSnapshot=t(o,"singleton",dragStateComponent);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{isSnapshotInstance as t}from"../core/
|
|
1
|
+
import{isSnapshotInstance as t}from"../core/index.js";import{SystemComponentBuilder as e}from"./system-component-builder.js";import{systemVirtualEntityId as o}from"./system-virtual-entity.js";export const exportStateComponent=e.component("exportState").withState({type:"object",properties:{activeState:{type:"string"},exportedEntityId:{oneOf:[{type:"string"},{type:"null"}]}},required:["activeState","exportedEntityId"],additionalProperties:!1}).withWritableKeys(["activeState","exportedEntityId"]).build();export const isExportStateComponentSnapshot=e=>t(e,"singleton",exportStateComponent);export const isSystemExportStateComponentSnapshot=t(o,"singleton",exportStateComponent);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{isSnapshotInstance as e}from"../core/
|
|
1
|
+
import{isSnapshotInstance as e}from"../core/index.js";import{SystemComponentBuilder as t}from"./system-component-builder.js";import{systemVirtualEntityId as o}from"./system-virtual-entity.js";export const fullscreenStateComponent=t.component("fullscreenState").withState({type:"object",properties:{enabled:{type:"boolean"}},required:["enabled"],additionalProperties:!1}).withWritableKeys(["enabled"]).build();export const isFullscreenStateComponentSnapshot=t=>e(t,"singleton",fullscreenStateComponent);export const isSystemFullscreenStateComponentSnapshot=e(o,"singleton",fullscreenStateComponent);
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { type ComponentSnapshot, type SystemComponentTypeConstraint } from '../core/
|
|
2
|
-
import type { EntityId } from '../core/model.js';
|
|
1
|
+
import { type ComponentSnapshot, type EntityId, type SystemComponentTypeConstraint } from '../core/index.js';
|
|
3
2
|
export type GroupedComponentSnapshots<COMPONENT_TYPE extends SystemComponentTypeConstraint> = {
|
|
4
3
|
[NAME in COMPONENT_TYPE['name']]: ReadonlyArray<ComponentSnapshot<Extract<COMPONENT_TYPE, {
|
|
5
4
|
name: NAME;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{isArray as o,isShallowEqual as t}from"@salsita-ai/common/utils";import{areEqualComponentSnapshots as n,isEqualComponentSnapshot as e}from"../core/
|
|
1
|
+
import{isArray as o,isShallowEqual as t}from"@salsita-ai/common/utils";import{areEqualComponentSnapshots as n,isEqualComponentSnapshot as e}from"../core/index.js";export const isEqualGroupedComponentSnapshots=(p,s)=>t(p,s,(t,p)=>t===p||void 0!==t&&void 0!==p&&(o(t)&&o(p)?n(t,p):!(o(t)||o(p))&&e(t,p)));export const groupComponentsByEntityIdAndName=o=>{let t=new Map;return o.forEach(o=>{let n=o.componentInstance.entityId,e=o.componentInstance.componentType.name,p=t.get(n);p||(p={},t.set(n,p));let s=p[e]??[];p[e]=s,s.push(o)}),t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{isSnapshotInstance as t}from"../core/
|
|
1
|
+
import{isSnapshotInstance as t}from"../core/index.js";import{SystemComponentBuilder as e}from"./system-component-builder.js";import{systemVirtualEntityId as o}from"./system-virtual-entity.js";export const hoverStateComponent=e.component("hoverState").withState({type:"object",properties:{hoveredEntityId:{oneOf:[{type:"string"},{type:"null"}]}},required:["hoveredEntityId"],additionalProperties:!1,tsType:"HoverStateComponentState",import:[{module:"@salsita-ai/sdk/domain",member:"HoverStateComponentState"}]}).withWritableKeys(["hoveredEntityId"]).build();export const isHoverStateComponentSnapshot=e=>t(e,"singleton",hoverStateComponent);export const isSystemHoverStateComponentSnapshot=t(o,"singleton",hoverStateComponent);
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import type { SessionRole } from '@salsita-ai/contracts/api';
|
|
2
|
-
import type { $DomainEntity, DomainEntity } from '../core/
|
|
3
|
-
import type { DomainState } from '../core/state.js';
|
|
2
|
+
import type { $DomainEntity, DomainEntity, DomainState } from '../core/index.js';
|
|
4
3
|
import { type IdOrWithId } from './system-component-filter.js';
|
|
5
4
|
import type { Viewport } from './viewport-state-component.js';
|
|
6
5
|
export type DeclarativeComponentSystemFilter = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{isSnapshotInstance as t}from"../core/
|
|
1
|
+
import{isSnapshotInstance as t}from"../core/index.js";import{SystemComponentBuilder as e}from"./system-component-builder.js";import{systemVirtualEntityId as o}from"./system-virtual-entity.js";export const navigationStateComponent=e.component("navigationState").withState({type:"object",properties:{activeState:{type:"string"},historyStack:{type:"array",items:{type:"string"}}},required:["activeState"],additionalProperties:!1}).withWritableKeys(["activeState","historyStack"]).build();export const isNavigationComponentSnapshot=e=>t(e,"singleton",navigationStateComponent);export const isSystemNavigationComponentSnapshot=t(o,"singleton",navigationStateComponent);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{isSnapshotInstance as t}from"../core/
|
|
1
|
+
import{isSnapshotInstance as t}from"../core/index.js";import{SystemComponentBuilder as e}from"./system-component-builder.js";import{systemVirtualEntityId as o}from"./system-virtual-entity.js";export const selectionStateComponent=e.component("selectionState").withState({type:"object",properties:{selectedEntityId:{type:"string"}},required:["selectedEntityId"],additionalProperties:!1,tsType:"SelectionStateComponentState",import:[{module:"@salsita-ai/sdk/domain",member:"SelectionStateComponentState"}]}).withWritableKeys(["selectedEntityId"]).build();export const isSelectionComponentSnapshot=e=>t(e,"singleton",selectionStateComponent);export const isSystemSelectionComponentSnapshot=t(o,"singleton",selectionStateComponent);
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import type
|
|
2
|
-
import type { SchemaOfObject } from '../core/reflection.js';
|
|
1
|
+
import { type SchemaOfObject, type SystemComponentType } from '../core/index.js';
|
|
3
2
|
export declare class SystemComponentBuilder<NAME extends string, COMPONENT_STATE extends Record<string, unknown>, WRITABLE_KEYS extends keyof COMPONENT_STATE> {
|
|
4
3
|
private readonly name;
|
|
5
4
|
private readonly writableKeys;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import e from"lodash-es/pick.js";import{
|
|
1
|
+
import e from"lodash-es/pick.js";import{extendedSchemaValidator as t,getCommonPhxDefinitions as i}from"../core/index.js";export class SystemComponentBuilder{name;writableKeys;jsonSchema;constructor(e,t,i){this.name=e,this.writableKeys=t,this.jsonSchema=i}static component(e){return new SystemComponentBuilder(e,[],{type:"object",properties:{},required:[],additionalProperties:!1})}withState(e){return new SystemComponentBuilder(this.name,[],e)}withWritableKeys(e){return new SystemComponentBuilder(this.name,e,this.jsonSchema)}build(){let s=i(),r={...this.jsonSchema,definitions:{...s,...this.jsonSchema.definitions}};return{name:this.name,writableKeys:this.writableKeys,schema:this.jsonSchema,validateState:t.compile(r),validateWritableState:t.compile({...r,properties:e(this.jsonSchema.properties,this.writableKeys),required:this.jsonSchema.required?.filter(e=>this.writableKeys.includes(e))})}}}
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import type { SessionRole } from '@salsita-ai/contracts/api';
|
|
2
|
-
import type { AnonymousExpression, ExpressionContext } from '../core/
|
|
3
|
-
import type { DomainEntity, DomainEntityId } from '../core/model.js';
|
|
4
|
-
import type { DomainState } from '../core/state.js';
|
|
2
|
+
import type { AnonymousExpression, DomainEntity, DomainEntityId, DomainState, ExpressionContext } from '../core/index.js';
|
|
5
3
|
import { type Viewport } from './viewport-state-component.js';
|
|
6
4
|
export interface ComponentSystemFilterState {
|
|
7
5
|
navigationState: string | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{createVirtualEntityId as t}from"../core/
|
|
1
|
+
import{createVirtualEntityId as t}from"../core/index.js";export const systemVirtualEntityId=t("system");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{isSnapshotInstance as t}from"../core/
|
|
1
|
+
import{isSnapshotInstance as t}from"../core/index.js";import{SystemComponentBuilder as o}from"./system-component-builder.js";import{systemVirtualEntityId as e}from"./system-virtual-entity.js";export const toolStateComponent=o.component("toolState").withState({type:"object",properties:{activeState:{type:"string"}},required:["activeState"],additionalProperties:!1}).withWritableKeys(["activeState"]).build();export const isToolStateComponentSnapshot=o=>t(o,"singleton",toolStateComponent);export const isSystemToolStateComponentSnapshot=t(e,"singleton",toolStateComponent);
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import type { Localizable } from '@salsita-ai/common/utils';
|
|
2
|
-
import type { ComponentInstance, StateOfComponent, SystemComponentType, SystemComponentTypeConstraint, WritableStateOfComponent } from '../core/
|
|
3
|
-
import type { DomainEntity, EntityByType, EntityId } from '../core/model.js';
|
|
2
|
+
import type { ComponentInstance, DomainEntity, EntityByType, EntityId, StateOfComponent, SystemComponentType, SystemComponentTypeConstraint, WritableStateOfComponent } from '../core/index.js';
|
|
4
3
|
import type { OneComponentFilter } from './component-reader-types.js';
|
|
5
4
|
export interface ComponentModification<COMPONENT_TYPE extends SystemComponentTypeConstraint> {
|
|
6
5
|
kind: 'modifyComponent';
|
|
7
6
|
entityId: EntityId;
|
|
8
7
|
updateTag: string;
|
|
9
8
|
hint?: Localizable;
|
|
9
|
+
/** What the assistant agent is told about this update instead of `hint`; `null` keeps the wording from it, and its change record then explains the change by `updateTag`. Never shown to the user. */
|
|
10
|
+
agentHint?: string | null;
|
|
10
11
|
componentInstance: ComponentInstance<COMPONENT_TYPE>;
|
|
11
12
|
writableState: WritableStateOfComponent<COMPONENT_TYPE>;
|
|
12
13
|
metadata?: Record<string, unknown>;
|
|
@@ -17,6 +18,8 @@ export interface EphemeralRecordModification<COMPONENT_TYPE extends SystemCompon
|
|
|
17
18
|
entityId: EntityId;
|
|
18
19
|
updateTag: string;
|
|
19
20
|
hint?: Localizable;
|
|
21
|
+
/** What the assistant agent is told about this update instead of `hint`; `null` keeps the wording from it, and its change record then explains the change by `updateTag`. Never shown to the user. */
|
|
22
|
+
agentHint?: string | null;
|
|
20
23
|
componentInstance: ComponentInstance<COMPONENT_TYPE>;
|
|
21
24
|
writableState: WritableStateOfComponent<COMPONENT_TYPE>;
|
|
22
25
|
}
|
|
@@ -25,6 +28,8 @@ export interface EphemeralRecordCreation<COMPONENT_TYPE extends SystemComponentT
|
|
|
25
28
|
entityId: EntityId;
|
|
26
29
|
updateTag: string;
|
|
27
30
|
hint?: Localizable;
|
|
31
|
+
/** What the assistant agent is told about this update instead of `hint`; `null` keeps the wording from it, and its change record then explains the change by `updateTag`. Never shown to the user. */
|
|
32
|
+
agentHint?: string | null;
|
|
28
33
|
componentInstance: ComponentInstance<COMPONENT_TYPE>;
|
|
29
34
|
initialState: StateOfComponent<COMPONENT_TYPE>;
|
|
30
35
|
}
|
|
@@ -34,6 +39,8 @@ export interface EphemeralRecordDeletion<COMPONENT_TYPE extends SystemComponentT
|
|
|
34
39
|
componentInstance: ComponentInstance<COMPONENT_TYPE>;
|
|
35
40
|
updateTag: string;
|
|
36
41
|
hint?: Localizable;
|
|
42
|
+
/** What the assistant agent is told about this update instead of `hint`; `null` keeps the wording from it, and its change record then explains the change by `updateTag`. Never shown to the user. */
|
|
43
|
+
agentHint?: string | null;
|
|
37
44
|
}
|
|
38
45
|
export type DomainEntityStateDelta<ENTITY extends DomainEntity<string>> = Partial<Omit<ENTITY, 'id' | 'type'>>;
|
|
39
46
|
export interface DomainEntityModification<ENTITY extends DomainEntity<string> = DomainEntity<string>> {
|
|
@@ -41,6 +48,8 @@ export interface DomainEntityModification<ENTITY extends DomainEntity<string> =
|
|
|
41
48
|
entityId: ENTITY['id'];
|
|
42
49
|
updateTag: string;
|
|
43
50
|
hint?: Localizable;
|
|
51
|
+
/** What the assistant agent is told about this update instead of `hint`; `null` keeps the wording from it, and its change record then explains the change by `updateTag`. Never shown to the user. */
|
|
52
|
+
agentHint?: string | null;
|
|
44
53
|
stateDelta: DomainEntityStateDelta<ENTITY>;
|
|
45
54
|
origin?: ComponentModification<SystemComponentTypeConstraint>;
|
|
46
55
|
}
|
|
@@ -55,6 +64,8 @@ export interface DomainEntityCreation<ENTITY extends DomainEntity<string>, PAREN
|
|
|
55
64
|
collection?: string;
|
|
56
65
|
parentId: PARENT['id'];
|
|
57
66
|
hint?: Localizable;
|
|
67
|
+
/** What the assistant agent is told about this update instead of `hint`; `null` keeps the wording from it, and its change record then explains the change by `updateTag`. Never shown to the user. */
|
|
68
|
+
agentHint?: string | null;
|
|
58
69
|
}
|
|
59
70
|
export interface DomainEntityReplacement<ENTITY extends DomainEntity<string>> {
|
|
60
71
|
kind: 'replaceDomainEntity';
|
|
@@ -63,12 +74,16 @@ export interface DomainEntityReplacement<ENTITY extends DomainEntity<string>> {
|
|
|
63
74
|
updateTag: string;
|
|
64
75
|
keepChildren: boolean;
|
|
65
76
|
hint?: Localizable;
|
|
77
|
+
/** What the assistant agent is told about this update instead of `hint`; `null` keeps the wording from it, and its change record then explains the change by `updateTag`. Never shown to the user. */
|
|
78
|
+
agentHint?: string | null;
|
|
66
79
|
}
|
|
67
80
|
export interface EntityDeletion<ENTITY extends DomainEntity<string>> {
|
|
68
81
|
kind: 'deleteEntity';
|
|
69
82
|
entityId: EntityId<ENTITY>;
|
|
70
83
|
updateTag: string;
|
|
71
84
|
hint?: Localizable;
|
|
85
|
+
/** What the assistant agent is told about this update instead of `hint`; `null` keeps the wording from it, and its change record then explains the change by `updateTag`. Never shown to the user. */
|
|
86
|
+
agentHint?: string | null;
|
|
72
87
|
}
|
|
73
88
|
export type DataUpdate<ENTITY extends DomainEntity<string>, PARENT extends DomainEntity<string>> = EphemeralRecordModification | EphemeralRecordCreation | EphemeralRecordDeletion | DomainEntityModification<ENTITY> | DomainEntityCreation<ENTITY, PARENT> | DomainEntityReplacement<ENTITY> | EntityDeletion<ENTITY>;
|
|
74
89
|
export type StateUpdate<ENTITY extends DomainEntity<string>, PARENT extends DomainEntity<string>> = ComponentModification<SystemComponentTypeConstraint> | DataUpdate<ENTITY, PARENT>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{isSnapshotInstance as t}from"../core/
|
|
1
|
+
import{isSnapshotInstance as t}from"../core/index.js";import{SystemComponentBuilder as e}from"./system-component-builder.js";import{systemVirtualEntityId as o}from"./system-virtual-entity.js";export const viewStateComponent=e.component("viewState").withState({type:"object",properties:{activeState:{type:"string"}},required:["activeState"],additionalProperties:!1}).withWritableKeys(["activeState"]).build();export const isViewComponentSnapshot=e=>t(e,"singleton",viewStateComponent);export const isSystemViewComponentSnapshot=t(o,"singleton",viewStateComponent);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type EntityId } from '../core/index.js';
|
|
2
2
|
/**
|
|
3
3
|
* A responsive class the configurator container currently satisfies. The values mirror the
|
|
4
4
|
* responsive flags computed by the UI layer from the theme breakpoints (`isPhone`, `isMobile`,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{isSnapshotInstance as t}from"../core/
|
|
1
|
+
import{isSnapshotInstance as t}from"../core/index.js";import{SystemComponentBuilder as e}from"./system-component-builder.js";import{systemVirtualEntityId as o}from"./system-virtual-entity.js";export const VIEWPORTS=["phone","mobile","tablet","desktop","landscape","portrait"];export const viewportStateComponent=e.component("viewportState").withState({type:"object",properties:{active:{oneOf:[{type:"array",items:{type:"string",enum:[...VIEWPORTS]}},{type:"null"}]}},required:["active"],additionalProperties:!1,tsType:"ViewportStateComponentState",import:[{module:"@salsita-ai/sdk/domain",member:"ViewportStateComponentState"}]}).withWritableKeys(["active"]).build();export const isViewportStateComponentSnapshot=e=>t(e,"singleton",viewportStateComponent);export const isSystemViewportStateComponentSnapshot=t(o,"singleton",viewportStateComponent);
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import type { ExtendedJsonSchema } from '@salsita-ai/common/utils';
|
|
2
2
|
import type { StateUpdate, UpdateFactory } from '../components/updates.js';
|
|
3
3
|
import type { DomainContextSystems } from '../domain-context/domain-context-systems.js';
|
|
4
|
-
import type {
|
|
5
|
-
import type {
|
|
6
|
-
import type {
|
|
7
|
-
import type { DomainState } from './state.js';
|
|
4
|
+
import type { ExpressionContext } from './expression/index.js';
|
|
5
|
+
import type { $DomainEntity, DomainEntity } from './model/index.js';
|
|
6
|
+
import type { DomainState, IdSequence } from './state/index.js';
|
|
8
7
|
/**
|
|
9
8
|
* The parameter and result types of the actions an application declares under `actions`, keyed by
|
|
10
9
|
* action name. Codegen derives it from the spec; `ActionSystem.prepareAction` and the
|
|
@@ -59,7 +58,7 @@ export type AnyActionContext = ActionContext<any, any, any, any, any, any, any,
|
|
|
59
58
|
*/
|
|
60
59
|
export type ActionImplementation<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, PARAMS, RESULT> = (params: PARAMS, state: DomainState<ENTITIES>, context: ActionContext<ENTITIES, ALLOWED_ROOT_ENTITIES, $MAP, PUBLISHED_DATA, SESSION_DATA, FRONTEND_DATA, NAVIGATION_STATES, VIEW_STATES, TOOL_STATES, EXPORT_STATES>) => PreparedAction<ENTITIES, RESULT>;
|
|
61
60
|
export type AnyActionImplementation = ActionImplementation<any, any, any, any, any, any, any, any, any, any, any, unknown>;
|
|
62
|
-
/** The implementations of every declared action by name, as
|
|
61
|
+
/** The implementations of every declared action by name, as `DomainBuilder.withActionModules` merges them from `src/actions/`. */
|
|
63
62
|
export type ActionImplementations<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> = {
|
|
64
63
|
readonly [NAME in keyof ACTION_TYPES]: ActionImplementation<ENTITIES, ALLOWED_ROOT_ENTITIES, $MAP, PUBLISHED_DATA, SESSION_DATA, FRONTEND_DATA, NAVIGATION_STATES, VIEW_STATES, TOOL_STATES, EXPORT_STATES, ACTION_TYPES[NAME]['params'], ACTION_TYPES[NAME]['result']>;
|
|
65
64
|
};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { Decoder } from './decoder.js';
|
|
2
|
+
/**
|
|
3
|
+
* Creates the decoder of data that must match a JSON schema. `subject` is what the data is, as the
|
|
4
|
+
* error names it, for example `Session data`.
|
|
5
|
+
*/
|
|
6
|
+
export declare const createDecoder: <DATA>(schema: object, subject: string) => Decoder<DATA>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{extendedSchemaValidator as r}from"../schema/index.js";export const createDecoder=(e,o)=>t=>{let i=r.compile(e);if(!i(t))throw Error(`${o} is not valid: ${r.errorsText(i.errors)}`);return t};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Turns data of unknown shape into data of a known type, and throws when the data does not match.
|
|
3
|
+
* Everything that enters a domain from outside goes through one: published, session, frontend and
|
|
4
|
+
* backend data.
|
|
5
|
+
*/
|
|
6
|
+
export type Decoder<DATA> = (data: unknown) => DATA;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export{createDecoder}from"./create-decoder.js";
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import type { ExtendedJsonSchema } from '@salsita-ai/common/utils';
|
|
2
2
|
import type { ActionDefinitions, AnyActionImplementations } from './action.js';
|
|
3
|
-
import type { Expression } from './expression.js';
|
|
4
|
-
import type {
|
|
5
|
-
import type {
|
|
6
|
-
import type { $DomainEntityReflection, EntityReflections, SchemaOfObject } from './reflection.js';
|
|
3
|
+
import type { Expression } from './expression/index.js';
|
|
4
|
+
import type { $DomainEntity, $DomainEntityReflection, DomainEntity, EntityByType, EntityReflections, SchemaOfObject } from './model/index.js';
|
|
5
|
+
import type { MigrateFunction } from './state/index.js';
|
|
7
6
|
type $EntityReflections<ENTITIES extends DomainEntity<string>> = {
|
|
8
7
|
[TYPE in ENTITIES['type']]: $DomainEntityReflection<$DomainEntity<EntityByType<ENTITIES, TYPE>>>;
|
|
9
8
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{migrateCommonAdminDomain as t}from"../admin-domain/implementation/common-admin-migrations.js";import{
|
|
1
|
+
import{migrateCommonAdminDomain as t}from"../admin-domain/implementation/common-admin-migrations.js";import{createDecoder as a}from"./decoder/index.js";export class DomainFactory{context;modelVersion;hasBackendData;constructor(t){this.context=t,this.modelVersion=t.modelVersion,this.hasBackendData=void 0!==t.backendData}parsePublishedData=t=>a(this.context.publishedData,"Admin data")(t);parseSessionData=t=>a(this.context.sessionData,"Session data")(t);parseFrontendData=t=>a(this.context.frontendData,"Frontend data")(t);parseBackendData=t=>{if(void 0===this.context.backendData)throw Error("Backend data is not supported for this domain");return a(this.context.backendData,"Backend data")(t)};validateAndMigrateState=(a,e)=>{let n=this.context.isAdminDomain?t(a):a;return this.context.migrate({state:n,version:e},{trimExtraProperties:!1})}}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import type { AnyExpressions, ExpressionContext } from './expression.js';
|
|
2
|
-
import { type $DomainEntity, type DomainEntity, type DomainEntityId, type EntityByType } from './model.js';
|
|
3
|
-
import type {
|
|
4
|
-
import type { DomainState } from './state.js';
|
|
1
|
+
import type { AnyExpressions, ExpressionContext } from './expression/index.js';
|
|
2
|
+
import { type $DomainEntity, type AnyEntityReflections, type DomainEntity, type DomainEntityId, type EntityByType } from './model/index.js';
|
|
3
|
+
import type { DomainState } from './state/index.js';
|
|
5
4
|
export type AllowedRootEntityTypes<ALLOWED_ROOT_ENTITIES extends DomainEntity<string>> = ReadonlyArray<ALLOWED_ROOT_ENTITIES['type']>;
|
|
6
5
|
export type AnyAllowedRootEntityTypes = AllowedRootEntityTypes<DomainEntity<string>>;
|
|
7
6
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{createCacheToken as t,getStickyCache as e}from"@salsita-ai/common/utils";import{domainEntityTypeFromId as i}from"./model.js";let r=t(),o=t();export class Domain{_context;constructor(t){this._context=t}getEntity=(t,i)=>{let r=e(i,o),n=r.get("entityMap");if(n)return n.get(t);let s=(t=>{let e=new Map;for(let i of t){if(e.has(i.id))throw Error(`Error while creating a UniqueEntityMap for caching of domain queries. Duplicate entity id ${i.id} encountered!`);e.set(i.id,i)}return e})(i.entities);return r.put("entityMap",s),s.get(t)};get$Entity=(t,i)=>{let o=e(i,r),n=o.get(t);if(n)return n;let s=this.getEntity(t,i);if(!s)throw Error(`Entity ${t} does not exist`);let a={...s},l=this._context.selectors.getDomainExpressions()[s.type];return l&&Object.entries(l).forEach(([t,e])=>{Object.defineProperty(a,t,{enumerable:!0,get:()=>e.evaluate(s.id,i,this._context.selectors.getExpressionContext())})}),Object.defineProperty(a,"_raw",{enumerable:!0,writable:!1,value:s}),Object.defineProperty(a,"_state",{enumerable:!0,writable:!1,value:i}),o.put(t,a),a};get$Entities=(t,e)=>t.map(t=>this.get$Entity(t,e));getRoot$Entity=t=>this.get$Entity(t.rootEntityId,t);validateExpressions=t=>{if(!this._context.selectors.getAllowedRootEntityTypes().includes(t.rootEntityType))throw Error(`Entity type ${t.rootEntityType} is not allowed as root entity`);if(!this.getEntity(t.rootEntityId,t))throw Error(`Root entity ${t.rootEntityId} was not found!`);t.entities.forEach(e=>{let i=this._context.selectors.getDomainExpressions()[e.type];void 0!==i&&Object.values(i).forEach(i=>{!0===i.meta.alwaysEvaluate&&i.evaluate(e.id,t,this._context.selectors.getExpressionContext())})})};validateEntity=t=>{let e=this._context.selectors.getEntityReflections()[t.type];if(!e)throw Error(`Unknown entity type ${t.type}`);return e._meta.validator(t)?{success:!0}:{success:!1,errors:e._meta.validator.errors?.map(t=>`${t.instancePath} ${t.message}`.trim())??[]}};getWritableEntityKeys=(t,e)=>{let r=i(t),o=this._context.selectors.getDomainExpressions()[r];return e.filter(t=>"id"!==t&&"type"!==t&&"_raw"!==t&&o?.[t]===void 0)}}
|
|
1
|
+
import{createCacheToken as t,getStickyCache as e}from"@salsita-ai/common/utils";import{domainEntityTypeFromId as i}from"./model/index.js";let r=t(),o=t();export class Domain{_context;constructor(t){this._context=t}getEntity=(t,i)=>{let r=e(i,o),n=r.get("entityMap");if(n)return n.get(t);let s=(t=>{let e=new Map;for(let i of t){if(e.has(i.id))throw Error(`Error while creating a UniqueEntityMap for caching of domain queries. Duplicate entity id ${i.id} encountered!`);e.set(i.id,i)}return e})(i.entities);return r.put("entityMap",s),s.get(t)};get$Entity=(t,i)=>{let o=e(i,r),n=o.get(t);if(n)return n;let s=this.getEntity(t,i);if(!s)throw Error(`Entity ${t} does not exist`);let a={...s},l=this._context.selectors.getDomainExpressions()[s.type];return l&&Object.entries(l).forEach(([t,e])=>{Object.defineProperty(a,t,{enumerable:!0,get:()=>e.evaluate(s.id,i,this._context.selectors.getExpressionContext())})}),Object.defineProperty(a,"_raw",{enumerable:!0,writable:!1,value:s}),Object.defineProperty(a,"_state",{enumerable:!0,writable:!1,value:i}),o.put(t,a),a};get$Entities=(t,e)=>t.map(t=>this.get$Entity(t,e));getRoot$Entity=t=>this.get$Entity(t.rootEntityId,t);validateExpressions=t=>{if(!this._context.selectors.getAllowedRootEntityTypes().includes(t.rootEntityType))throw Error(`Entity type ${t.rootEntityType} is not allowed as root entity`);if(!this.getEntity(t.rootEntityId,t))throw Error(`Root entity ${t.rootEntityId} was not found!`);t.entities.forEach(e=>{let i=this._context.selectors.getDomainExpressions()[e.type];void 0!==i&&Object.values(i).forEach(i=>{!0===i.meta.alwaysEvaluate&&i.evaluate(e.id,t,this._context.selectors.getExpressionContext())})})};validateEntity=t=>{let e=this._context.selectors.getEntityReflections()[t.type];if(!e)throw Error(`Unknown entity type ${t.type}`);return e._meta.validator(t)?{success:!0}:{success:!1,errors:e._meta.validator.errors?.map(t=>`${t.instancePath} ${t.message}`.trim())??[]}};getWritableEntityKeys=(t,e)=>{let r=i(t),o=this._context.selectors.getDomainExpressions()[r];return e.filter(t=>"id"!==t&&"type"!==t&&"_raw"!==t&&o?.[t]===void 0)}}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import type { ExpandAlias, TypeOrAlias } from '../
|
|
2
|
-
import type { AnonymousExpression, ExpressionMetas } from '
|
|
3
|
-
import type { DomainEntity } from '../core/model.js';
|
|
1
|
+
import type { DomainEntity, ExpandAlias, TypeOrAlias } from '../model/index.js';
|
|
2
|
+
import type { AnonymousExpression, ExpressionMetas } from './expression.js';
|
|
4
3
|
export type ConstantExpressions<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>, CONSTANTS extends Partial<Record<TypeOrAlias<ENTITIES, ALIASES>, Record<string, unknown>>>> = {
|
|
5
4
|
readonly [TYPE_OR_ALIAS in keyof CONSTANTS & string]: {
|
|
6
5
|
readonly [NAME in keyof CONSTANTS[TYPE_OR_ALIAS]]: AnonymousExpression<ENTITIES, ALLOWED_ROOT_ENTITIES, PUBLISHED_DATA, SESSION_DATA, FRONTEND_DATA, ExpandAlias<ENTITIES, ALIASES, TYPE_OR_ALIAS>, CONSTANTS[TYPE_OR_ALIAS][NAME]>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{mapNestedObject as t}from"../../utils/map-nested-object.js";export const createConstantExpressionFactory=e=>o=>t()(o,([t,o,a])=>[[t,o,{meta:e[t]?.[o]??{},evaluate:()=>a}]]);
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type {
|
|
3
|
-
import type {
|
|
4
|
-
import type {
|
|
5
|
-
import type { AliasedExpressions } from '../domain-builder.js';
|
|
1
|
+
import type { AliasedExpressions } from '../../domain-builder.js';
|
|
2
|
+
import type { $DomainEntity, DomainEntity, EntityByType, TypeOrAlias } from '../model/index.js';
|
|
3
|
+
import type { DomainState } from '../state/index.js';
|
|
4
|
+
import type { AnonymousExpression, ExpressionContext, ExpressionMeta, ExpressionMetas } from './expression.js';
|
|
6
5
|
export type CustomExpression<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>, SELF extends $DomainEntity<ENTITIES>, T> = (self: SELF, state: DomainState<ENTITIES>, ctx: ExpressionContext<ENTITIES, ALLOWED_ROOT_ENTITIES, PUBLISHED_DATA, SESSION_DATA, FRONTEND_DATA>) => T;
|
|
7
6
|
export type PotentialCustomExpressions<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>> = {
|
|
8
7
|
[TYPE_OR_ALIAS in keyof $MAP]?: {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{mapNestedObject as e}from"../../utils/map-nested-object.js";export const createCustomExpressionFactory=t=>o=>e()(o,([e,o,r])=>{if(!r)throw Error(`Custom expression for ${e}.${o} is of type undefined`);return[[e,o,createCustomExpression(r,t[e]?.[o]??{})]]});export const createCustomExpression=(e,t)=>({evaluate:(t,o,r)=>e(r.domain.get$Entity(t,o),o,r),meta:t});
|
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
import type { SessionRole } from '@salsita-ai/contracts/api';
|
|
2
|
-
import type { ComponentReader } from '
|
|
3
|
-
import type { CollisionProjections, ConstraintProjections, PositionProjections, ProjectedEntitiesProjections, SnappingProjections } from '
|
|
4
|
-
import type { SketchingProjections } from '
|
|
5
|
-
import type {
|
|
6
|
-
import type {
|
|
7
|
-
import type { MigrateFunction } from '
|
|
8
|
-
import type { $DomainEntity, DomainEntity } from './model.js';
|
|
9
|
-
import type { DomainState } from './state.js';
|
|
2
|
+
import type { ComponentReader } from '../../domain-runtime/domain-context/index.js';
|
|
3
|
+
import type { CollisionProjections, ConstraintProjections, PositionProjections, ProjectedEntitiesProjections, SnappingProjections } from '../../projections/index.js';
|
|
4
|
+
import type { SketchingProjections } from '../../sketching/index.js';
|
|
5
|
+
import type { Domain } from '../domain.js';
|
|
6
|
+
import type { $DomainEntity, DomainEntity, TypeOrAlias } from '../model/index.js';
|
|
7
|
+
import type { DomainState, MigrateFunction } from '../state/index.js';
|
|
10
8
|
export interface ExpressionContext<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>> {
|
|
11
9
|
readonly mode: 'owner' | 'read' | 'finalize';
|
|
12
10
|
readonly role: SessionRole;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export{};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export*from"./constant-expressions.js";export*from"./custom-expression.js";export*from"./memoize-expression.js";export*from"./prepare-domain-expressions.js";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type {
|
|
1
|
+
import type { DomainEntity, DomainEntityId } from '../model/index.js';
|
|
2
|
+
import type { Expression, ExpressionOrigin } from './expression.js';
|
|
3
3
|
export interface ExpressionTrace {
|
|
4
4
|
origin: ExpressionOrigin;
|
|
5
5
|
entityId: DomainEntityId<string>;
|