@salsita-ai/sdk 0.50.0-develop.b335a15889 → 0.50.0-develop.b9eb39baf0
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/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.js +3 -3
- package/dist/application-spec/generate-application/code/templates/skills/phoenix-review-skill.js +1 -1
- package/dist/application-spec/generate-application/code/templates/skills/sdk-content.d.ts +2 -1
- package/dist/application-spec/generate-application/code/templates/skills/sdk-content.js +1 -2
- package/dist/application-spec/generate-application/code/templates/webhook-builders.js +3 -3
- 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/other-features/domain-actions.mdx +1 -1
- package/dist/docs/other-features/side-effects.mdx +42 -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/project-structure.mdx +6 -0
- 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 +23 -13
- package/dist/domain/application/assistant-field-options.d.ts +1 -2
- package/dist/domain/application/assistant-mutations.d.ts +1 -3
- package/dist/domain/application/assistant-mutations.js +1 -1
- package/dist/domain/application/assistant-recipe-groups.d.ts +1 -3
- package/dist/domain/application/configurator-builder.d.ts +30 -16
- 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 +4 -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 -5
- 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 +1 -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 +2 -2
- 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 +1 -2
- package/dist/domain/core/domain-factory.js +1 -1
- package/dist/domain/core/domain.d.ts +1 -2
- package/dist/domain/core/domain.js +1 -1
- package/dist/domain/core/expression.d.ts +1 -2
- package/dist/domain/core/index.d.ts +8 -17
- package/dist/domain/core/index.js +1 -1
- package/dist/domain/core/migrations.d.ts +1 -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/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.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/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 -2
- 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 -2
- 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/spec/initialize.js +1 -1
- package/dist/domain/expressions/constant-expressions.d.ts +1 -3
- package/dist/domain/expressions/custom-expression.d.ts +1 -4
- package/dist/domain/expressions/memoize-expression.d.ts +1 -2
- package/dist/domain/expressions/prepare-domain-expressions.d.ts +1 -1
- package/dist/domain/index.d.ts +3 -2
- 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 -2
- 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 +1 -1
- 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/domain-editors/use-implementation-files.d.ts +7 -6
- package/dist/editor/domain-editors/use-implementation-files.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/scripts/build-admin.js +1 -1
- package/dist/react-sdk/application-runtime/hooks/use-domain-application-props.d.ts +5 -2
- 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/package.json +3 -3
- package/dist/domain/core/json-schema.js +0 -1
- package/dist/domain/core/reflection.js +0 -1
- /package/dist/domain/core/{enhanced-json-schema.js → decoder/decoder.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/{schema-validator.js → schema/enhanced-json-schema.js} +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
|
@@ -1 +1 @@
|
|
|
1
|
-
import{z as e}from"zod";import{systemUpdateFactory as t}from"../components/updates.js";import{DomainEntityIdSchema as i}from"../core/
|
|
1
|
+
import{z as e}from"zod";import{systemUpdateFactory as t}from"../components/updates.js";import{DomainEntityIdSchema as i}from"../core/index.js";import{findAssistantFieldOptions as n,readAssistantFieldOptions as r}from"./assistant-field-options.js";import{assistantAddedEntityIds as o,findAssistantRecipeGroups as a,prepareAssistantRecipeUpdates as s,readAssistantRecipeGroup as d}from"./assistant-recipe-groups.js";export const deleteEntityUpdateTag="deleteEntity";export const modifyEntityUpdateTag="modifyEntity";let l=({action:e,resolveLocalizable:t})=>({componentReader:e.systems.componentReader,recipeCooker:e.systems.recipeCooker,resolveLocalizable:t}),p=e.string().regex(new RegExp(i.pattern),'An entity id is the type name, a dash and a number, e.g. "Root-1". Query the current entities and use an id they return.'),h=e.object({id:p}),c=e.object({id:p,delta:e.record(e.unknown())}),y="modify",u=(e,t)=>Object.entries(e).find(([e])=>e===t)?.[1],f=e=>Array.isArray(e)?e.map(f):"object"!=typeof e||null===e||Array.isArray(e)?e:Object.fromEntries(Object.entries(e).map(([e,t])=>[e,f(t)])),m=e.object({parentId:p,recipeGroupId:e.string(),recipeKey:e.string()}),g=e.object({entityId:p,recipeGroupId:e.string(),recipeKey:e.string()}),$=e=>e.map(e=>`"${e}"`).join(", "),w=[{name:"deleteEntity",implementation:(e,i,{manifest:n})=>{let{id:r}=h.parse(e),o=i.entities.find(e=>e.id===r);if(!o)throw Error(`Entity "${r}" does not exist, so it cannot be deleted. It may have been deleted by an earlier operation or field. Query the current entities and use an id they return.`);let a=n.deletableTypes??[];if(!a.includes(o.type))throw Error(`Entity "${r}" is a ${o.type}, which is not deletable. ${a.length>0?`Only entities of these types can be deleted: ${a.join(", ")}.`:"No entity type is deletable."} Delete an entity of a deletable type instead.`);return{updates:[t.EntityDeletion({entityId:o.id,updateTag:"deleteEntity"})],readResult:({previousState:e,state:t})=>{var i;let n;return[o.id,...(i=o.id,n=new Set(t.entities.map(e=>e.id)),e.entities.map(e=>e.id).filter(e=>e!==i&&!n.has(e)))]}}}},{name:"addChild",implementation:(e,t,i)=>{let{parentId:n,recipeGroupId:r,recipeKey:p}=m.parse(e),h=t.entities.find(e=>e.id===n);if(!h)throw Error(`Entity "${n}" does not exist, so nothing can be added to it. It may have been deleted by an earlier operation or field. Query the current entities and use an id they return.`);let c=a(i.manifest,"child",h.type),y=c.find(e=>e.groupId===r);if(!y)throw Error(`Entity "${n}" is a ${h.type}, which has no recipe group "${r}". ${c.length>0?`Its recipe groups are: ${$(c.map(({groupId:e})=>e))}.`:`Nothing can be added to a ${h.type}.`} Query "meta { childRecipes { groupId } }" on the entity you want to add to and use a groupId it returns.`);let u=l(i),f=d("child",y,h.id,t,u);if(!f)throw Error(`The recipe group "${r}" is not available on "${n}" right now, so nothing can be added from it. The configurator offers a group only in some states of the configuration. Query "meta { childRecipes { groupId } }" on "${n}" to see the groups it offers now.`);let g=f.recipes.find(e=>e.key===p);if(!g)throw Error(`The recipe group "${r}" on "${n}" has no recipe with the key "${p}". Recipes and their keys change with the configuration and with the language. List the recipes of the group again and use a key it returns.`);let w=s(g,f,h.id,t,u);return{updates:w,readResult:e=>o(w,h.id,e).map(t=>i.action.systems.domain.get$Entity(t,e.state))}}},{name:"replaceEntity",implementation:(e,t,i)=>{let{entityId:n,recipeGroupId:r,recipeKey:p}=g.parse(e),h=t.entities.find(e=>e.id===n);if(!h)throw Error(`Entity "${n}" does not exist, so it cannot be replaced. It may have been deleted or replaced by an earlier operation or field; a replaced entity gets a new id. Query the current entities and use an id they return.`);let c=a(i.manifest,"replace",h.type),y=c.find(e=>e.groupId===r);if(!y)throw Error(`Entity "${n}" is a ${h.type}, which has no replace recipe group "${r}". ${c.length>0?`Its replace recipe groups are: ${$(c.map(({groupId:e})=>e))}.`:`A ${h.type} cannot be replaced.`} Query "meta { replaceRecipes { groupId } }" on the entity you want to replace and use a groupId it returns.`);let u=l(i),f=d("replace",y,h.id,t,u);if(!f)throw Error(`The recipe group "${r}" is not available on "${n}" right now, so it cannot be replaced from it. The configurator offers a group only in some states of the configuration. Query "meta { replaceRecipes { groupId } }" on "${n}" to see the groups it offers now.`);let m=f.recipes.find(e=>e.key===p);if(!m)throw Error(`The recipe group "${r}" on "${n}" has no recipe with the key "${p}". Recipes and their keys change with the configuration and with the language. List the recipes of the group again and use a key it returns.`);let w=s(m,f,h.id,t,u);return{updates:w,readResult:e=>o(w,h.id,e).map(t=>i.action.systems.domain.get$Entity(t,e.state))}}}];export const findAssistantMutation=(e,i)=>{let o,a,s=w.find(t=>t.name===e),d=u(i.actions??{},e);if(s)return s;if(void 0!==d)return{name:e,implementation:(e,t,{action:i})=>i.systems.actionSystem.prepareAction(d,f(e),t)};if(!e.startsWith(y))return;let p=e.slice(y.length),h=u(i.writableFields??{},p);return h&&(o=`${y}${p}`,a=Object.keys(h).join(", "),{name:o,implementation:(e,i,s)=>{let{manifest:d}=s,{domain:m}=s.action.systems,{id:g,delta:$}=c.parse(e),w=i.entities.find(e=>e.id===g);if(!w)throw Error(`Entity "${g}" does not exist, so it cannot be modified. It may have been deleted by an earlier operation or field. Query the current entities and use an id they return.`);if(w.type!==p)throw Error(`Entity "${g}" is a ${w.type}, but ${o} modifies only ${p} entities. ${u(d.writableFields??{},w.type)?`Use ${y}${w.type} for it instead.`:`${w.type} has no writable fields, so it cannot be modified; pass the id of a ${p}.`}`);let b=Object.entries($).flatMap(([e,t])=>{let i=u(h,e);return void 0===i?[]:[{field:e,property:i,value:f(t)}]}),E=Object.fromEntries(b.map(({property:e,value:t})=>[e,t]));if(0===Object.keys(E).length)throw Error(`The delta of ${o} is empty, so there is nothing to change on "${g}". Set at least one of its fields: ${a}.`);let j=m.validateEntity({...w,...E});if(!j.success){let e=b.filter(({field:e,property:t})=>e!==t).map(({field:e,property:t})=>`${e} is stored as ${t}`);throw Error(`The delta would make "${g}" an invalid ${p}: ${j.errors.join("; ")}. ${e.length>0?`The messages name stored properties: ${e.join(", ")}. `:""}Nothing was changed. Send values that fit the types and the allowed values the schema describes for these fields.`)}let v=n(d,p);for(let{field:e,value:t}of b){let n=v.find(t=>t.field===e);if(!n?.validate||null===t)continue;let o=r(n,w.id,i,l(s));if(o&&!o.some(e=>e.value===t))throw Error(`${JSON.stringify(t)} is not a value "${e}" of "${g}" can take right now. ${o.length>0?`The configurator offers these values: ${o.map(e=>JSON.stringify(e.value)).join(", ")}.`:"The configurator offers no value for it in this state."} Nothing was changed. Send one of the offered values; "meta { ${n.edgeName} }" on the entity lists them with their names. When the values depend on another field of this delta, change that field in an earlier mutation field of the same operation.`)}return{updates:[t.DomainEntityModification({entityId:w.id,stateDelta:E,updateTag:"modifyEntity"})],readResult:({state:e})=>m.getEntity(w.id,e)?m.get$Entity(w.id,e):null}}})};
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import type { Localizable } from '@salsita-ai/common/utils';
|
|
2
2
|
import type { OneComponentFilter } from '../components/component-reader-types.js';
|
|
3
3
|
import type { DomainEntityCreation, DomainEntityReplacement } from '../components/updates.js';
|
|
4
|
-
import type { ComponentSnapshot } from '../core/
|
|
5
|
-
import type { DomainEntity, DomainEntityId } from '../core/model.js';
|
|
6
|
-
import type { DomainState } from '../core/state.js';
|
|
4
|
+
import type { ComponentSnapshot, DomainEntity, DomainEntityId, DomainState } from '../core/index.js';
|
|
7
5
|
import type { AnyRecipeCookerSystem } from '../domain-context/recipe-system/recipe-cooker-system.js';
|
|
8
6
|
import type { AttributeSelectionComponent } from '../system-components/attribute-selection.js';
|
|
9
7
|
import { type ChildEntityRecipesComponent } from '../system-components/child-entity-recipes.js';
|
|
@@ -2,13 +2,10 @@ import type { I18n } from '@lingui/core';
|
|
|
2
2
|
import type { ThemeOptions } from '@mui/material';
|
|
3
3
|
import type { z } from 'zod';
|
|
4
4
|
import type { FinalizeTaskResource } from '@salsita-ai/contracts/webhook';
|
|
5
|
-
import type
|
|
6
|
-
import type {
|
|
7
|
-
import type {
|
|
8
|
-
import type { AclConfig, ApplicationConfig, DataSpec, DefaultEnvs, ImportedTransformer, ResourcesConfig, SpecTransformer, UserInterfaceConfig } from './application-config.js';
|
|
5
|
+
import { type $DomainEntity, type DomainEntity, type DomainFactory, type EnumLike, type ProductPreset, type SchemaOfObject } from '../core/index.js';
|
|
6
|
+
import type { ProjectModule } from '../project-modules/index.js';
|
|
7
|
+
import type { AclConfig, ApplicationConfig, DataSpec, DefaultEnvs, ResourcesConfig, SpecTransformer, TransformersConfig, UserInterfaceConfig } from './application-config.js';
|
|
9
8
|
import type { AssistantResolvedManifest } from './assistant/index.js';
|
|
10
|
-
import type { ElementRegistration } from './element-registration.js';
|
|
11
|
-
import type { HandlerRegistration } from './handler-registration.js';
|
|
12
9
|
interface ConfiguratorBuilderContext<ENTITIES extends DomainEntity<string> = never, ALLOWED_ROOT_ENTITIES extends ENTITIES = never, $MAP extends Record<ENTITIES['type'], $DomainEntity<ENTITIES>> = never, NAVIGATION_STATES extends string = never, VIEW_STATES extends string = never, TOOL_STATES extends string = never, EXPORT_STATES extends string = never, PUBLISHED_DATA extends Record<string, unknown> = never, SESSION_DATA extends Record<string, unknown> = never, FRONTEND_DATA extends Record<string, unknown> = never, ADMIN_ENTITIES extends DomainEntity<string> = never, ADMIN_ALLOWED_ROOT_ENTITIES extends ADMIN_ENTITIES = never, ADMIN_$MAP extends Record<ADMIN_ENTITIES['type'], $DomainEntity<ADMIN_ENTITIES>> = never, ADMIN_NAVIGATION_STATES extends string = never, ADMIN_VIEW_STATES extends string = never, FINALIZE_DATA extends Record<string, unknown> = never, PREFETCHED_FINALIZE_DATA extends Record<string, unknown> = never, FINALIZE_RESULT extends Record<string, unknown> = never, CALLBACK_DATA extends Record<string, unknown> = never, RESOURCE extends string = never> {
|
|
13
10
|
version?: string;
|
|
14
11
|
textLanguages?: string[];
|
|
@@ -19,13 +16,13 @@ interface ConfiguratorBuilderContext<ENTITIES extends DomainEntity<string> = nev
|
|
|
19
16
|
viewState?: EnumLike<VIEW_STATES>;
|
|
20
17
|
toolState?: EnumLike<TOOL_STATES>;
|
|
21
18
|
exportState?: EnumLike<EXPORT_STATES>;
|
|
22
|
-
componentOptics:
|
|
19
|
+
componentOptics: readonly ProjectModule[];
|
|
23
20
|
i18n?: I18n;
|
|
24
21
|
adminDomainFactory?: DomainFactory<ADMIN_ENTITIES, ADMIN_ALLOWED_ROOT_ENTITIES, ADMIN_$MAP, PUBLISHED_DATA, SESSION_DATA, FRONTEND_DATA>;
|
|
25
22
|
adminPresets?: ReadonlyArray<ProductPreset<ADMIN_ENTITIES, ADMIN_ALLOWED_ROOT_ENTITIES>>;
|
|
26
23
|
adminNavigationState?: EnumLike<ADMIN_NAVIGATION_STATES>;
|
|
27
24
|
adminViewState?: EnumLike<ADMIN_VIEW_STATES>;
|
|
28
|
-
adminComponentOptics:
|
|
25
|
+
adminComponentOptics: readonly ProjectModule[];
|
|
29
26
|
publishedData?: z.ZodType<PUBLISHED_DATA>;
|
|
30
27
|
finalizeData?: SchemaOfObject<FINALIZE_DATA>;
|
|
31
28
|
prefetchedFinalizeData?: SchemaOfObject<PREFETCHED_FINALIZE_DATA>;
|
|
@@ -33,7 +30,7 @@ interface ConfiguratorBuilderContext<ENTITIES extends DomainEntity<string> = nev
|
|
|
33
30
|
callbackData?: SchemaOfObject<CALLBACK_DATA>;
|
|
34
31
|
resources?: ReadonlyArray<FinalizeTaskResource<RESOURCE>>;
|
|
35
32
|
dataSpec?: DataSpec;
|
|
36
|
-
|
|
33
|
+
transformers?: TransformersConfig;
|
|
37
34
|
acl?: AclConfig;
|
|
38
35
|
enableAdminRelease?: boolean;
|
|
39
36
|
ui?: Pick<UserInterfaceConfig, 'appLoader' | 'preview' | 'alwaysExpand'>;
|
|
@@ -45,8 +42,8 @@ interface ConfiguratorBuilderContext<ENTITIES extends DomainEntity<string> = nev
|
|
|
45
42
|
assistant?: AssistantResolvedManifest | null;
|
|
46
43
|
theme?: ThemeOptions;
|
|
47
44
|
tagName?: string;
|
|
48
|
-
handlers?:
|
|
49
|
-
elements?: readonly
|
|
45
|
+
handlers?: readonly ProjectModule[];
|
|
46
|
+
elements?: readonly ProjectModule[];
|
|
50
47
|
}
|
|
51
48
|
export declare class ConfiguratorBuilder<ENTITIES extends DomainEntity<string> = never, ALLOWED_ROOT_ENTITIES extends ENTITIES = never, $MAP extends Record<ENTITIES['type'], $DomainEntity<ENTITIES>> = never, NAVIGATION_STATES extends string = never, VIEW_STATES extends string = never, TOOL_STATES extends string = never, EXPORT_STATES extends string = never, PUBLISHED_DATA extends Record<string, unknown> = never, SESSION_DATA extends Record<string, unknown> = never, FRONTEND_DATA extends Record<string, unknown> = never, ADMIN_ENTITIES extends DomainEntity<string> = never, ADMIN_ALLOWED_ROOT_ENTITIES extends ADMIN_ENTITIES = never, ADMIN_$MAP extends Record<ADMIN_ENTITIES['type'], $DomainEntity<ADMIN_ENTITIES>> = never, ADMIN_NAVIGATION_STATES extends string = never, ADMIN_VIEW_STATES extends string = never, FINALIZE_DATA extends Record<string, unknown> = never, PREFETCHED_FINALIZE_DATA extends Record<string, unknown> = never, FINALIZE_RESULT extends Record<string, unknown> = never, CALLBACK_DATA extends Record<string, unknown> = never, RESOURCE extends string = never> {
|
|
52
49
|
private readonly _context;
|
|
@@ -79,17 +76,34 @@ export declare class ConfiguratorBuilder<ENTITIES extends DomainEntity<string> =
|
|
|
79
76
|
withAdminViewState<NEW_ADMIN_VIEW_STATES extends string>(adminViewState: EnumLike<NEW_ADMIN_VIEW_STATES>): ConfiguratorBuilder<ENTITIES, ALLOWED_ROOT_ENTITIES, $MAP, NAVIGATION_STATES, VIEW_STATES, TOOL_STATES, EXPORT_STATES, PUBLISHED_DATA, SESSION_DATA, FRONTEND_DATA, ADMIN_ENTITIES, ADMIN_ALLOWED_ROOT_ENTITIES, ADMIN_$MAP, ADMIN_NAVIGATION_STATES, NEW_ADMIN_VIEW_STATES, FINALIZE_DATA, PREFETCHED_FINALIZE_DATA, FINALIZE_RESULT, CALLBACK_DATA, RESOURCE>;
|
|
80
77
|
withPresets(presets: ReadonlyArray<ProductPreset<ENTITIES, ALLOWED_ROOT_ENTITIES>>): ConfiguratorBuilder<ENTITIES, ALLOWED_ROOT_ENTITIES, $MAP, NAVIGATION_STATES, VIEW_STATES, TOOL_STATES, EXPORT_STATES, PUBLISHED_DATA, SESSION_DATA, FRONTEND_DATA, ADMIN_ENTITIES, ADMIN_ALLOWED_ROOT_ENTITIES, ADMIN_$MAP, ADMIN_NAVIGATION_STATES, ADMIN_VIEW_STATES, FINALIZE_DATA, PREFETCHED_FINALIZE_DATA, FINALIZE_RESULT, CALLBACK_DATA, RESOURCE>;
|
|
81
78
|
withAdminPresets(adminPresets: ReadonlyArray<ProductPreset<ADMIN_ENTITIES, ADMIN_ALLOWED_ROOT_ENTITIES>>): ConfiguratorBuilder<ENTITIES, ALLOWED_ROOT_ENTITIES, $MAP, NAVIGATION_STATES, VIEW_STATES, TOOL_STATES, EXPORT_STATES, PUBLISHED_DATA, SESSION_DATA, FRONTEND_DATA, ADMIN_ENTITIES, ADMIN_ALLOWED_ROOT_ENTITIES, ADMIN_$MAP, ADMIN_NAVIGATION_STATES, ADMIN_VIEW_STATES, FINALIZE_DATA, PREFETCHED_FINALIZE_DATA, FINALIZE_RESULT, CALLBACK_DATA, RESOURCE>;
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
79
|
+
/** Adds component optics as project modules: the `src/components/` files, or the optics a generated file lists. The runtime spec validates them. */
|
|
80
|
+
withComponentOptics(componentOptics: readonly ProjectModule[]): ConfiguratorBuilder<ENTITIES, ALLOWED_ROOT_ENTITIES, $MAP, NAVIGATION_STATES, VIEW_STATES, TOOL_STATES, EXPORT_STATES, PUBLISHED_DATA, SESSION_DATA, FRONTEND_DATA, ADMIN_ENTITIES, ADMIN_ALLOWED_ROOT_ENTITIES, ADMIN_$MAP, ADMIN_NAVIGATION_STATES, ADMIN_VIEW_STATES, FINALIZE_DATA, PREFETCHED_FINALIZE_DATA, FINALIZE_RESULT, CALLBACK_DATA, RESOURCE>;
|
|
81
|
+
/** Adds admin component optics as project modules: the `src/admin/components/` files, or the optics a generated file lists. The runtime spec validates them. */
|
|
82
|
+
withAdminComponentOptics(componentOptics: readonly ProjectModule[]): ConfiguratorBuilder<ENTITIES, ALLOWED_ROOT_ENTITIES, $MAP, NAVIGATION_STATES, VIEW_STATES, TOOL_STATES, EXPORT_STATES, PUBLISHED_DATA, SESSION_DATA, FRONTEND_DATA, ADMIN_ENTITIES, ADMIN_ALLOWED_ROOT_ENTITIES, ADMIN_$MAP, ADMIN_NAVIGATION_STATES, ADMIN_VIEW_STATES, FINALIZE_DATA, PREFETCHED_FINALIZE_DATA, FINALIZE_RESULT, CALLBACK_DATA, RESOURCE>;
|
|
83
|
+
/**
|
|
84
|
+
* Sets the handlers as project modules, one per `src/handlers/` file. They are stored unread: the
|
|
85
|
+
* runtime spec validates them, and `buildConfig` inspects them only afterwards.
|
|
86
|
+
*/
|
|
87
|
+
withHandlers(handlers: readonly ProjectModule[]): ConfiguratorBuilder<ENTITIES, ALLOWED_ROOT_ENTITIES, $MAP, NAVIGATION_STATES, VIEW_STATES, TOOL_STATES, EXPORT_STATES, PUBLISHED_DATA, SESSION_DATA, FRONTEND_DATA, ADMIN_ENTITIES, ADMIN_ALLOWED_ROOT_ENTITIES, ADMIN_$MAP, ADMIN_NAVIGATION_STATES, ADMIN_VIEW_STATES, FINALIZE_DATA, PREFETCHED_FINALIZE_DATA, FINALIZE_RESULT, CALLBACK_DATA, RESOURCE>;
|
|
88
|
+
/** Sets the elements as project modules, one per `src/elements/` file, for the runtime spec to validate. */
|
|
89
|
+
withElements(elements: readonly ProjectModule[]): ConfiguratorBuilder<ENTITIES, ALLOWED_ROOT_ENTITIES, $MAP, NAVIGATION_STATES, VIEW_STATES, TOOL_STATES, EXPORT_STATES, PUBLISHED_DATA, SESSION_DATA, FRONTEND_DATA, ADMIN_ENTITIES, ADMIN_ALLOWED_ROOT_ENTITIES, ADMIN_$MAP, ADMIN_NAVIGATION_STATES, ADMIN_VIEW_STATES, FINALIZE_DATA, PREFETCHED_FINALIZE_DATA, FINALIZE_RESULT, CALLBACK_DATA, RESOURCE>;
|
|
86
90
|
withResources<NEW_RESOURCE extends string>(resources: ReadonlyArray<FinalizeTaskResource<NEW_RESOURCE>>): ConfiguratorBuilder<ENTITIES, ALLOWED_ROOT_ENTITIES, $MAP, NAVIGATION_STATES, VIEW_STATES, TOOL_STATES, EXPORT_STATES, PUBLISHED_DATA, SESSION_DATA, FRONTEND_DATA, ADMIN_ENTITIES, ADMIN_ALLOWED_ROOT_ENTITIES, ADMIN_$MAP, ADMIN_NAVIGATION_STATES, ADMIN_VIEW_STATES, FINALIZE_DATA, PREFETCHED_FINALIZE_DATA, FINALIZE_RESULT, CALLBACK_DATA, NEW_RESOURCE>;
|
|
87
91
|
withWebComponentTag(tagName: string): ConfiguratorBuilder<ENTITIES, ALLOWED_ROOT_ENTITIES, $MAP, NAVIGATION_STATES, VIEW_STATES, TOOL_STATES, EXPORT_STATES, PUBLISHED_DATA, SESSION_DATA, FRONTEND_DATA, ADMIN_ENTITIES, ADMIN_ALLOWED_ROOT_ENTITIES, ADMIN_$MAP, ADMIN_NAVIGATION_STATES, ADMIN_VIEW_STATES, FINALIZE_DATA, PREFETCHED_FINALIZE_DATA, FINALIZE_RESULT, CALLBACK_DATA, RESOURCE>;
|
|
88
|
-
|
|
92
|
+
/**
|
|
93
|
+
* Sets the transformers: the `src/transformers/` files as project modules, and the spec's `transformers`
|
|
94
|
+
* section that selects and orders them. The runtime spec validates the files and builds the factory.
|
|
95
|
+
*/
|
|
96
|
+
withTransformers(importedTransformers: readonly ProjectModule[], specTransformers: readonly SpecTransformer[]): ConfiguratorBuilder<ENTITIES, ALLOWED_ROOT_ENTITIES, $MAP, NAVIGATION_STATES, VIEW_STATES, TOOL_STATES, EXPORT_STATES, PUBLISHED_DATA, SESSION_DATA, FRONTEND_DATA, ADMIN_ENTITIES, ADMIN_ALLOWED_ROOT_ENTITIES, ADMIN_$MAP, ADMIN_NAVIGATION_STATES, ADMIN_VIEW_STATES, FINALIZE_DATA, PREFETCHED_FINALIZE_DATA, FINALIZE_RESULT, CALLBACK_DATA, RESOURCE>;
|
|
89
97
|
withInterface(_interface: unknown): this;
|
|
90
98
|
withDataSpec: (dataSpec: DataSpec) => ConfiguratorBuilder<ENTITIES, ALLOWED_ROOT_ENTITIES, $MAP, NAVIGATION_STATES, VIEW_STATES, TOOL_STATES, EXPORT_STATES, PUBLISHED_DATA, SESSION_DATA, FRONTEND_DATA, ADMIN_ENTITIES, ADMIN_ALLOWED_ROOT_ENTITIES, ADMIN_$MAP, ADMIN_NAVIGATION_STATES, ADMIN_VIEW_STATES, FINALIZE_DATA, PREFETCHED_FINALIZE_DATA, FINALIZE_RESULT, CALLBACK_DATA, RESOURCE>;
|
|
91
99
|
private _computeInitialPublishedData;
|
|
92
100
|
buildConfig(): ApplicationConfig<ENTITIES, ALLOWED_ROOT_ENTITIES, $MAP, NAVIGATION_STATES, VIEW_STATES, TOOL_STATES, EXPORT_STATES, Record<string, unknown>, PUBLISHED_DATA, SESSION_DATA, FRONTEND_DATA, ADMIN_ENTITIES, ADMIN_ALLOWED_ROOT_ENTITIES, ADMIN_$MAP, ADMIN_NAVIGATION_STATES, ADMIN_VIEW_STATES>;
|
|
101
|
+
/**
|
|
102
|
+
* Builds the config together with the validated handlers. The handlers are read from the bootstrap
|
|
103
|
+
* runtime's spec rather than from the builder context, so nothing here touches a project file's
|
|
104
|
+
* export before the spec has checked it against its folder's contract.
|
|
105
|
+
*/
|
|
106
|
+
private _buildConfigWithHandlers;
|
|
93
107
|
buildWebhookContext(): {
|
|
94
108
|
config: ApplicationConfig<ENTITIES, ALLOWED_ROOT_ENTITIES, $MAP, NAVIGATION_STATES, VIEW_STATES, TOOL_STATES, EXPORT_STATES, Record<string, unknown>, PUBLISHED_DATA, SESSION_DATA, FRONTEND_DATA, ADMIN_ENTITIES, ADMIN_ALLOWED_ROOT_ENTITIES, ADMIN_$MAP, ADMIN_NAVIGATION_STATES, ADMIN_VIEW_STATES>;
|
|
95
109
|
parseFinalizeData: (data: unknown) => FINALIZE_DATA;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{initConsoleLogger as t}from"@salsita-ai/common/utils";import{defaultI18n as e}from"#package/i18n";import{extendedSchemaValidator as i}from"../core/
|
|
1
|
+
import{initConsoleLogger as t}from"@salsita-ai/common/utils";import{defaultI18n as e}from"#package/i18n";import{extendedSchemaValidator as i}from"../core/index.js";import{NoopAnalyticsSystem as r}from"../domain-context/index.js";import{createDomainRuntime as n}from"../domain-runtime/index.js";import{isGetApplicationWrapperHandler as o}from"./GetApplicationWrapperHandler.js";import{isGetWebComponentOptionsHandler as a}from"./GetWebComponentOptions.js";import{createInitialPublishedData as s}from"./create-initial-published-data.js";import{isDataRowValidatorHandler as h}from"./published-data/DataRowValidatorHandler.js";import{isFilterPublishedChunksHandler as l}from"./published-data/FilterPublishedChunksHandler.js";import{isMapPublishedChunkedDataHandler as u}from"./published-data/MapPublishedChunkedDataHandler.js";import{isMapPublishedRevisionDataHandler as d}from"./published-data/MapPublishedRevisionDataHandler.js";import{isSheetValidatorHandler as c}from"./published-data/SheetValidatorHandler.js";export class ConfiguratorBuilder{_context;constructor(t){this._context=t}withDefaultEnvs(t){return new ConfiguratorBuilder({...this._context,defaultEnvs:t})}withVersion(t){return new ConfiguratorBuilder({...this._context,version:t})}withTextLanguages(t){return new ConfiguratorBuilder({...this._context,textLanguages:t})}withAcl(t){return new ConfiguratorBuilder({...this._context,acl:t})}withAdminRelease(t){return new ConfiguratorBuilder({...this._context,enableAdminRelease:t})}withUi(t){return new ConfiguratorBuilder({...this._context,ui:t})}withResourcesConfig(t){return new ConfiguratorBuilder({...this._context,resourcesConfig:t})}withChunks(t){return new ConfiguratorBuilder({...this._context,chunks:t})}withPublishedDataHash(t){return new ConfiguratorBuilder({...this._context,publishedDataHash:t})}withAssistant(t){return new ConfiguratorBuilder({...this._context,assistant:t})}withTheme(t){return new ConfiguratorBuilder({...this._context,theme:t})}withDomainFactory(t){return new ConfiguratorBuilder({...this._context,domainFactory:t})}withAdminDomainFactory(t){return new ConfiguratorBuilder({...this._context,adminDomainFactory:t})}withI18n=t=>new ConfiguratorBuilder({...this._context,i18n:t});withPrefetchedFinalizeData(t){return new ConfiguratorBuilder({...this._context,prefetchedFinalizeData:t})}withFinalizeData(t){return new ConfiguratorBuilder({...this._context,finalizeData:t})}withFinalizeResult(t){return new ConfiguratorBuilder({...this._context,finalizeResult:t})}withCallbackData(t){return new ConfiguratorBuilder({...this._context,callbackData:t})}withNavigationState(t){return new ConfiguratorBuilder({...this._context,navigationState:t})}withViewState(t){return new ConfiguratorBuilder({...this._context,viewState:t})}withToolState(t){return new ConfiguratorBuilder({...this._context,toolState:t})}withExportState(t){return new ConfiguratorBuilder({...this._context,exportState:t})}withAdminNavigationState(t){return new ConfiguratorBuilder({...this._context,adminNavigationState:t})}withAdminViewState(t){return new ConfiguratorBuilder({...this._context,adminViewState:t})}withPresets(t){return new ConfiguratorBuilder({...this._context,presets:t})}withAdminPresets(t){return new ConfiguratorBuilder({...this._context,adminPresets:t})}withComponentOptics(t){return new ConfiguratorBuilder({...this._context,componentOptics:[...this._context.componentOptics,...t]})}withAdminComponentOptics(t){return new ConfiguratorBuilder({...this._context,adminComponentOptics:[...this._context.adminComponentOptics??[],...t]})}withHandlers(t){return new ConfiguratorBuilder({...this._context,handlers:t})}withElements(t){return new ConfiguratorBuilder({...this._context,elements:t})}withResources(t){return new ConfiguratorBuilder({...this._context,resources:t})}withWebComponentTag(t){return new ConfiguratorBuilder({...this._context,tagName:t})}withTransformers(t,e){return new ConfiguratorBuilder({...this._context,transformers:{importedTransformers:t,specTransformers:e}})}withInterface(t){return this}withDataSpec=t=>new ConfiguratorBuilder({...this._context,dataSpec:t});_computeInitialPublishedData(t,e,i){if(!this._context.adminDomainFactory)throw Error("adminDomainFactory is required!");return s({adminDomainFactory:this._context.adminDomainFactory,domainRuntime:e,adminPresets:this._context.adminPresets??[],handlers:i,dataSpec:this._context.dataSpec,chunks:this._context.chunks,logger:t})}buildConfig(){return this._buildConfigWithHandlers().config}_buildConfigWithHandlers(){if(!this._context.domainFactory)throw Error("Can not create application config, domainFactory is required! Is it registered with the ConfiguratorBuilder?");if(!this._context.presets)throw Error("Can not create application config, presets are required! Is it registered with the ConfiguratorBuilder?");if(!this._context.adminDomainFactory)throw Error("Can not create application config, adminDomainFactory is required! Is it registered with the ConfiguratorBuilder?");if(!this._context.adminPresets)throw Error("Can not create application config, adminPresets are required! Is it registered with the ConfiguratorBuilder?");if(!this._context.version)throw Error("Can not create application config, version is required!");let i=this._context.tagName??"salsita-configurator",s={defaultEnvs:this._context.defaultEnvs,services:{i18n:this._context.i18n},version:this._context.version,initialPublishedData:{},domain:{textLanguages:this._context.textLanguages,componentOptics:this._context.componentOptics,presets:this._context.presets,domainFactory:this._context.domainFactory},navigation:{navigationStates:this._context.navigationState?.values(),viewStates:this._context.viewState?.values(),toolStates:this._context.toolState?.values(),exportStates:this._context.exportState?.values()},adminNavigation:{navigationStates:this._context.adminNavigationState?.values(),viewStates:this._context.adminViewState?.values()},adminDomain:{textLanguages:this._context.textLanguages,componentOptics:this._context.adminComponentOptics??[],presets:this._context.adminPresets,domainFactory:this._context.adminDomainFactory},mount:{tag:i,options:{}},handlers:this._context.handlers??[],elements:this._context.elements??[],transformers:this._context.transformers,features:{acl:this._context.acl,enableAdminRelease:this._context.enableAdminRelease},ui:{preview:this._context.ui?.preview,alwaysExpand:this._context.ui?.alwaysExpand,theme:this._context.theme},resources:this._context.resourcesConfig,chunks:this._context.chunks,publishedDataHash:this._context.publishedDataHash,assistant:this._context.assistant,dataSpec:this._context.dataSpec},u=t(),d=n({config:s,services:{analyticsService:new r,i18n:e,logger:u}}),f=d.getState().spec.configurator.handlers;if(f.filter(t=>l(t)).length>1)throw Error("Multiple createFilterPublishedChunksHandler handlers found. Only one handler is allowed.");if(f.filter(t=>h(t)).length>1)throw Error("Multiple createDataRowValidatorHandler handlers found. Only one handler is allowed.");if(f.filter(t=>c(t)).length>1)throw Error("Multiple createSheetValidatorHandler handlers found. Only one handler is allowed.");let m=f.find(o)?.handler().handler,x=f.find(a)?.handler().handler(void 0),w=this._computeInitialPublishedData(u,d,f);return{config:{...s,mount:{tag:i,options:x??{},Application:m},initialPublishedData:w},handlers:f}}buildWebhookContext(){if(!this._context.domainFactory)throw Error("domainFactory is required!");if(!this._context.adminDomainFactory)throw Error("adminDomainFactory is required!");if(!this._context.adminPresets)throw Error("adminPresets are required!");let{config:t,handlers:e}=this._buildConfigWithHandlers(),r=t=>{if(null==this._context.finalizeData)return{};let e=i.compile(this._context.finalizeData);if(!e(t))throw console.error("Finalize data validation errors:",e.errors),Error("Invalid finalize data!");return t},n=t=>{if(null==this._context.finalizeResult)return{};let e=i.compile(this._context.finalizeResult);if(!e(t))throw console.error("Finalize result validation errors:",e.errors),Error("Invalid finalize result!");return t},o=t=>{if(null==this._context.callbackData)return{};let e=i.compile(this._context.callbackData);if(!e(t))throw console.error("Callback data validation errors:",e.errors),Error("Invalid callback data!");return t},a=e.find(d)?.handler().handler,s=e.find(u)?.handler().handler,l=e.find(h)?.handler().handler,f=e.find(c)?.handler().handler;return{config:t,parseFinalizeData:r,parseFinalizeResult:n,resources:this._context.resources??[],parseCallbackData:o,mapPublishedRevisionData:a,mapPublishedChunkedData:s,dataRowValidator:l,sheetValidator:f}}}
|
|
@@ -2,6 +2,7 @@ import type { SvgIconProps } from '@mui/material';
|
|
|
2
2
|
import type { PropsWithChildren, ReactNode } from 'react';
|
|
3
3
|
import type { ExtendedJsonSchema } from '@salsita-ai/common/utils';
|
|
4
4
|
import type { DomainEntityId } from '../core/index.js';
|
|
5
|
+
import { type ProjectModule } from '../project-modules/index.js';
|
|
5
6
|
export interface PhoenixEntityElementProps {
|
|
6
7
|
entityId: DomainEntityId<string>;
|
|
7
8
|
children?: ReactNode;
|
|
@@ -102,4 +103,8 @@ export declare const createPhoenixEntityElement: <SCHEMA extends {
|
|
|
102
103
|
} = never>(element: PhoenixEntityElementDefinition<SCHEMA>) => import("react").FunctionComponent<SCHEMA["props"] & CustomPhoenixEntityElementProps>;
|
|
103
104
|
export declare const createCustomPhoenixEntityElement: (name: string, element: (props: CustomPhoenixEntityElementProps) => JSX.Element) => PhoenixEntityElementRegistration;
|
|
104
105
|
export type CreateCustomPhoenixEntityElement = (name: string, element: (props: CustomPhoenixEntityElementProps) => JSX.Element) => PhoenixEntityElementRegistration;
|
|
106
|
+
/** The element registrations of one `src/elements/` file; the editor keys its per-file reload cache on this. */
|
|
107
|
+
export declare const resolveElementModule: (module: ProjectModule) => readonly ElementRegistration[];
|
|
108
|
+
/** Validates the `src/elements/` files of an application config and flattens their registrations. */
|
|
109
|
+
export declare const resolveElementModules: (modules: readonly ProjectModule[]) => readonly ElementRegistration[];
|
|
105
110
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export const systemElementRegistry={layoutElements:{},entityElements:{}};export const createPhoenixLayoutElement=e=>(systemElementRegistry.layoutElements[e.schema.properties.kind.enum[0]]=e.component,e.component);export const createCustomPhoenixLayoutElement=(e,t)=>({type:"layout",name:e,element:t});export const createPhoenixEntityElement=e=>(systemElementRegistry.entityElements[e.schema.properties.kind.enum[0]]=e.component,e.component);export const createCustomPhoenixEntityElement=(e,t)=>({type:"entity",name:e,element:t});
|
|
1
|
+
import{SHARED_FOLDER_HINT as e,isRecord as t,resolveListModule as n}from"../project-modules/index.js";export const systemElementRegistry={layoutElements:{},entityElements:{}};export const createPhoenixLayoutElement=e=>(systemElementRegistry.layoutElements[e.schema.properties.kind.enum[0]]=e.component,e.component);export const createCustomPhoenixLayoutElement=(e,t)=>({type:"layout",name:e,element:t});export const createPhoenixEntityElement=e=>(systemElementRegistry.entityElements[e.schema.properties.kind.enum[0]]=e.component,e.component);export const createCustomPhoenixEntityElement=(e,t)=>({type:"entity",name:e,element:t});let o={expected:"an element registration, or an array of them",fix:`Create it with phx.frontend.createCustomPhoenixLayoutElement(...) or phx.frontend.createCustomPhoenixEntityElement(...), ${e}.`},r=e=>!!t(e)&&("icon"===e.type?Array.isArray(e.elements):("entity"===e.type||"layout"===e.type)&&"string"==typeof e.name&&"function"==typeof e.element);export const resolveElementModule=e=>n(e,o,r);export const resolveElementModules=e=>e.flatMap(resolveElementModule);
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { type ProjectModule } from '../project-modules/index.js';
|
|
1
2
|
export type PhoenixHandlerDefinition = {
|
|
2
3
|
handler: () => Promise<void>;
|
|
3
4
|
};
|
|
@@ -27,3 +28,7 @@ export declare const createPhoenixHandler: (name: string, handler: () => Phoenix
|
|
|
27
28
|
export type CreatePhoenixHandler = (name: string, handler: () => PhoenixHandlerDefinition) => PhoenixHandlerRegistration;
|
|
28
29
|
export declare const createSystemPhoenixHandler: <P, R>(name: string, handler: () => SystemPhoenixHandlerDefinition<P, R>) => SystemPhoenixHandlerRegistration<P, R>;
|
|
29
30
|
export declare const createSystemPhoenixAsyncHandler: <P, R>(name: string, handler: () => SystemPhoenixAsyncHandlerDefinition<P, R>) => SystemPhoenixAsyncHandlerRegistration<P, R>;
|
|
31
|
+
/** The handler registrations of one `src/handlers/` file; the editor keys its per-file reload cache on this. */
|
|
32
|
+
export declare const resolveHandlerModule: (module: ProjectModule) => ReadonlyArray<HandlerRegistration<any, any>>;
|
|
33
|
+
/** Validates the `src/handlers/` files of an application config and flattens their registrations. */
|
|
34
|
+
export declare const resolveHandlerModules: (modules: readonly ProjectModule[]) => ReadonlyArray<HandlerRegistration<any, any>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export const createPhoenixHandler=(e,t)=>({type:"phoenix",name:e,handler:t});export const createSystemPhoenixHandler=(e,t)=>({type:"system",name:e,handler:t});export const createSystemPhoenixAsyncHandler=(e,t)=>({type:"system-async",name:e,handler:t});
|
|
1
|
+
import{SHARED_FOLDER_HINT as e,isRecord as t,resolveListModule as o}from"../project-modules/index.js";export const createPhoenixHandler=(e,t)=>({type:"phoenix",name:e,handler:t});export const createSystemPhoenixHandler=(e,t)=>({type:"system",name:e,handler:t});export const createSystemPhoenixAsyncHandler=(e,t)=>({type:"system-async",name:e,handler:t});let r={expected:"a handler registration, or an array of them",fix:`Create it with phx.frontend.createPhoenixHandler(...) or one of the other phx.frontend.create…Handler(...) factories, ${e}.`},n=e=>t(e)&&("phoenix"===e.type||"system"===e.type||"system-async"===e.type)&&"string"==typeof e.name&&"function"==typeof e.handler;export const resolveHandlerModule=e=>o(e,r,n);export const resolveHandlerModules=e=>e.flatMap(resolveHandlerModule);
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
export { type DomainConfig, type NavigationConfig, type ISessionService, type Session, type ResourcesConfig, type ApplicationConfig, type UserInterfaceConfig, type MountConfig, type WebComponentOptions, type SessionState, type AuthenticationErrorCode, type DataCellValue, type DataSchema, type DataSchemaArrayField, type DataSchemaField, type DataSchemaFieldObject, type DataSpec, type DataSpecEntry, type SwatchSpecEntry, type ChunksSpec, type ImportedTransformer, type SpecTransformer, type AdminPagesSpec, type AnyApplicationConfig, type DefaultEnvs, } from './application-config.js';
|
|
1
|
+
export { type DomainConfig, type NavigationConfig, type ISessionService, type Session, type ResourcesConfig, type ApplicationConfig, type UserInterfaceConfig, type MountConfig, type WebComponentOptions, type SessionState, type AuthenticationErrorCode, type DataCellValue, type DataSchema, type DataSchemaArrayField, type DataSchemaField, type DataSchemaFieldObject, type DataSpec, type DataSpecEntry, type SwatchSpecEntry, type ChunksSpec, type ImportedTransformer, type SpecTransformer, type TransformersConfig, type AdminPagesSpec, type AnyApplicationConfig, type DefaultEnvs, } from './application-config.js';
|
|
2
2
|
export { type AssistantFieldOption, findAssistantFieldOptions, readAssistantFieldOptions, } from './assistant-field-options.js';
|
|
3
3
|
export { deleteEntityUpdateTag, findAssistantMutation, modifyEntityUpdateTag } from './assistant-mutations.js';
|
|
4
4
|
export { type AssistantRecipe, type AssistantRecipeContext, type AssistantRecipeGroupSnapshot, type AssistantRecipeKind, assistantAddedEntityIds, findAssistantRecipeGroups, prepareAssistantRecipeUpdates, readAssistantRecipeGroup, } from './assistant-recipe-groups.js';
|
|
5
5
|
export { ConfiguratorBuilder } from './configurator-builder.js';
|
|
6
6
|
export * from './admin-page-factories.js';
|
|
7
7
|
export { createInitialPublishedData, type CreateInitialPublishedDataProps } from './create-initial-published-data.js';
|
|
8
|
-
export { resolveImportedTransformers } from './resolve-imported-transformers.js';
|
|
8
|
+
export { resolveImportedTransformers, resolveTransformerModule, resolveTransformerModules, } from './resolve-imported-transformers.js';
|
|
9
9
|
export { webComponentAttributeParsers, createWebComponentPropertyDescriptor, type AttributeParser, type WebComponentPropertyDescriptor, } from './web-component-property.js';
|
|
10
10
|
export { createWebComponentEventDescriptor, type WebComponentEventDescriptor } from './web-component-event.js';
|
|
11
11
|
export { standardWebComponentProperties, type StandardConfiguratorElement } from './standard-properties.js';
|
|
@@ -26,6 +26,6 @@ export { createDataRowValidatorHandler, DataRowValidatorHandlerName, isDataRowVa
|
|
|
26
26
|
export { createSheetValidatorHandler, SheetValidatorHandlerName, isSheetValidatorHandler, type CreateSheetValidatorHandler, type SheetValidatorResult, } from './published-data/SheetValidatorHandler.js';
|
|
27
27
|
export { createMapPublishedRevisionDataHandler, createMapPublishedRevisionDataHandlerFactory, isMapPublishedRevisionDataHandler, type CreateMapPublishedRevisionDataHandler, type TypedCreateMapPublishedRevisionDataHandler, } from './published-data/MapPublishedRevisionDataHandler.js';
|
|
28
28
|
export { createMapPublishedChunkedDataHandler, createMapPublishedChunkedDataHandlerFactory, isMapPublishedChunkedDataHandler, type CreateMapPublishedChunkedDataHandler, type MapPublishedChunkedDataHandlerProps, type MapPublishedChunkedDataResult, type TypedCreateMapPublishedChunkedDataHandler, } from './published-data/MapPublishedChunkedDataHandler.js';
|
|
29
|
-
export { type PhoenixHandlerDefinition, type SystemPhoenixHandlerDefinition, type PhoenixHandlerRegistration, type SystemPhoenixHandlerRegistration, type SystemPhoenixAsyncHandlerDefinition, type SystemPhoenixAsyncHandlerRegistration, type HandlerRegistration, type CreatePhoenixHandler, createPhoenixHandler, createSystemPhoenixHandler, createSystemPhoenixAsyncHandler, } from './handler-registration.js';
|
|
30
|
-
export { type PhoenixEntityElementProps, type PhoenixEntityElementRegistration, type PhoenixLayoutElementRegistration, type PhoenixIconRegistration, type ElementRegistration, type CustomPhoenixEntityElementProps, type PhoenixLayoutElementDefinition, type PhoenixEntityElementDefinition, type CreateCustomPhoenixLayoutElement, type CreateCustomPhoenixEntityElement, createPhoenixLayoutElement, createPhoenixEntityElement, createCustomPhoenixLayoutElement, createCustomPhoenixEntityElement, } from './element-registration.js';
|
|
29
|
+
export { type PhoenixHandlerDefinition, type SystemPhoenixHandlerDefinition, type PhoenixHandlerRegistration, type SystemPhoenixHandlerRegistration, type SystemPhoenixAsyncHandlerDefinition, type SystemPhoenixAsyncHandlerRegistration, type HandlerRegistration, type CreatePhoenixHandler, createPhoenixHandler, createSystemPhoenixHandler, createSystemPhoenixAsyncHandler, resolveHandlerModule, resolveHandlerModules, } from './handler-registration.js';
|
|
30
|
+
export { type PhoenixEntityElementProps, type PhoenixEntityElementRegistration, type PhoenixLayoutElementRegistration, type PhoenixIconRegistration, type ElementRegistration, type CustomPhoenixEntityElementProps, type PhoenixLayoutElementDefinition, type PhoenixEntityElementDefinition, type CreateCustomPhoenixLayoutElement, type CreateCustomPhoenixEntityElement, createPhoenixLayoutElement, createPhoenixEntityElement, createCustomPhoenixLayoutElement, createCustomPhoenixEntityElement, resolveElementModule, resolveElementModules, } from './element-registration.js';
|
|
31
31
|
export * from './assistant/index.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{findAssistantFieldOptions,readAssistantFieldOptions}from"./assistant-field-options.js";export{deleteEntityUpdateTag,findAssistantMutation,modifyEntityUpdateTag}from"./assistant-mutations.js";export{assistantAddedEntityIds,findAssistantRecipeGroups,prepareAssistantRecipeUpdates,readAssistantRecipeGroup}from"./assistant-recipe-groups.js";export{ConfiguratorBuilder}from"./configurator-builder.js";export*from"./admin-page-factories.js";export{createInitialPublishedData}from"./create-initial-published-data.js";export{resolveImportedTransformers}from"./resolve-imported-transformers.js";export{webComponentAttributeParsers,createWebComponentPropertyDescriptor}from"./web-component-property.js";export{createWebComponentEventDescriptor}from"./web-component-event.js";export{standardWebComponentProperties}from"./standard-properties.js";export{standardWebComponentEvents}from"./standard-events.js";export{ResourceBuilder}from"./resource-builder.js";export{createGetApplicationWrapperHandler,isGetApplicationWrapperHandler}from"./GetApplicationWrapperHandler.js";export{createGetThemeHandler,GetThemeHandlerName,isGetThemeHandler}from"./GetThemeHandler.js";export{createGetWebComponentOptionsHandler,isGetWebComponentOptionsHandler}from"./GetWebComponentOptions.js";export{createFinalizeAdminDomain}from"./published-data/create-finalize-admin-domain.js";export{FilterPublishedChunksHandlerName,isFilterPublishedChunksHandler}from"./published-data/FilterPublishedChunksHandler.js";export{mapPublishedData}from"./published-data/map-published-data.js";export{flattenTabData,mapDefaultValuesToRecords,mapPublishedChunkedData,SYSTEM_CHUNK_KEY,SYSTEM_CHUNK_SCOPE,SWATCH_DEFINITION}from"./published-data/map-published-chunked-data.js";export{buildLegendRows}from"./published-data/build-legend-data.js";export{formatFieldType,getFieldDescription}from"./published-data/format-field-type.js";export{mapDataToSheet}from"./published-data/map-data-to-sheet.js";export{validateRows}from"./published-data/validate-sheet-data.js";export{createDataRowValidatorHandler,DataRowValidatorHandlerName,isDataRowValidatorHandler}from"./published-data/DataRowValidatorHandler.js";export{createSheetValidatorHandler,SheetValidatorHandlerName,isSheetValidatorHandler}from"./published-data/SheetValidatorHandler.js";export{createMapPublishedRevisionDataHandler,createMapPublishedRevisionDataHandlerFactory,isMapPublishedRevisionDataHandler}from"./published-data/MapPublishedRevisionDataHandler.js";export{createMapPublishedChunkedDataHandler,createMapPublishedChunkedDataHandlerFactory,isMapPublishedChunkedDataHandler}from"./published-data/MapPublishedChunkedDataHandler.js";export{createPhoenixHandler,createSystemPhoenixHandler,createSystemPhoenixAsyncHandler}from"./handler-registration.js";export{createPhoenixLayoutElement,createPhoenixEntityElement,createCustomPhoenixLayoutElement,createCustomPhoenixEntityElement}from"./element-registration.js";export*from"./assistant/index.js";
|
|
1
|
+
export{findAssistantFieldOptions,readAssistantFieldOptions}from"./assistant-field-options.js";export{deleteEntityUpdateTag,findAssistantMutation,modifyEntityUpdateTag}from"./assistant-mutations.js";export{assistantAddedEntityIds,findAssistantRecipeGroups,prepareAssistantRecipeUpdates,readAssistantRecipeGroup}from"./assistant-recipe-groups.js";export{ConfiguratorBuilder}from"./configurator-builder.js";export*from"./admin-page-factories.js";export{createInitialPublishedData}from"./create-initial-published-data.js";export{resolveImportedTransformers,resolveTransformerModule,resolveTransformerModules}from"./resolve-imported-transformers.js";export{webComponentAttributeParsers,createWebComponentPropertyDescriptor}from"./web-component-property.js";export{createWebComponentEventDescriptor}from"./web-component-event.js";export{standardWebComponentProperties}from"./standard-properties.js";export{standardWebComponentEvents}from"./standard-events.js";export{ResourceBuilder}from"./resource-builder.js";export{createGetApplicationWrapperHandler,isGetApplicationWrapperHandler}from"./GetApplicationWrapperHandler.js";export{createGetThemeHandler,GetThemeHandlerName,isGetThemeHandler}from"./GetThemeHandler.js";export{createGetWebComponentOptionsHandler,isGetWebComponentOptionsHandler}from"./GetWebComponentOptions.js";export{createFinalizeAdminDomain}from"./published-data/create-finalize-admin-domain.js";export{FilterPublishedChunksHandlerName,isFilterPublishedChunksHandler}from"./published-data/FilterPublishedChunksHandler.js";export{mapPublishedData}from"./published-data/map-published-data.js";export{flattenTabData,mapDefaultValuesToRecords,mapPublishedChunkedData,SYSTEM_CHUNK_KEY,SYSTEM_CHUNK_SCOPE,SWATCH_DEFINITION}from"./published-data/map-published-chunked-data.js";export{buildLegendRows}from"./published-data/build-legend-data.js";export{formatFieldType,getFieldDescription}from"./published-data/format-field-type.js";export{mapDataToSheet}from"./published-data/map-data-to-sheet.js";export{validateRows}from"./published-data/validate-sheet-data.js";export{createDataRowValidatorHandler,DataRowValidatorHandlerName,isDataRowValidatorHandler}from"./published-data/DataRowValidatorHandler.js";export{createSheetValidatorHandler,SheetValidatorHandlerName,isSheetValidatorHandler}from"./published-data/SheetValidatorHandler.js";export{createMapPublishedRevisionDataHandler,createMapPublishedRevisionDataHandlerFactory,isMapPublishedRevisionDataHandler}from"./published-data/MapPublishedRevisionDataHandler.js";export{createMapPublishedChunkedDataHandler,createMapPublishedChunkedDataHandlerFactory,isMapPublishedChunkedDataHandler}from"./published-data/MapPublishedChunkedDataHandler.js";export{createPhoenixHandler,createSystemPhoenixHandler,createSystemPhoenixAsyncHandler,resolveHandlerModule,resolveHandlerModules}from"./handler-registration.js";export{createPhoenixLayoutElement,createPhoenixEntityElement,createCustomPhoenixLayoutElement,createCustomPhoenixEntityElement,resolveElementModule,resolveElementModules}from"./element-registration.js";export*from"./assistant/index.js";
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import type { DomainFactory } from '../../core/index.js';
|
|
2
|
-
import type { $DomainEntity, DomainEntity } from '../../core/model.js';
|
|
1
|
+
import type { $DomainEntity, DomainEntity, DomainFactory } from '../../core/index.js';
|
|
3
2
|
import type { DomainRuntime } from '../../domain-runtime/index.js';
|
|
4
3
|
export interface AdminDomainContext<ADMIN_ENTITIES extends DomainEntity<string>, ADMIN_ALLOWED_ROOT_ENTITIES extends ADMIN_ENTITIES, ADMIN_$MAP extends Record<ADMIN_ENTITIES['type'], $DomainEntity<ADMIN_ENTITIES>>, PUBLISHED_DATA extends Record<string, unknown>, SESSION_DATA extends Record<string, unknown>, FRONTEND_DATA extends Record<string, unknown>> {
|
|
5
4
|
readonly adminDomainFactory: DomainFactory<ADMIN_ENTITIES, ADMIN_ALLOWED_ROOT_ENTITIES, ADMIN_$MAP, PUBLISHED_DATA, SESSION_DATA, FRONTEND_DATA>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type SheetTabData } from '@salsita-ai/contracts/webhook';
|
|
2
|
-
import type { DomainEntity } from '../../core/
|
|
2
|
+
import type { DomainEntity } from '../../core/index.js';
|
|
3
3
|
import type { ChunksSpec, DataCellValue, DataSchema, DataSpec } from '../application-config.js';
|
|
4
4
|
import { type DataRowValidator, type SheetDataValidator } from './validate-sheet-data.js';
|
|
5
5
|
export { flattenTabData } from './flatten-tab-data.js';
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import type { DomainFactory } from '../../core/index.js';
|
|
2
|
-
import type { $DomainEntity, DomainEntity } from '../../core/model.js';
|
|
1
|
+
import type { $DomainEntity, DomainEntity, DomainFactory } from '../../core/index.js';
|
|
3
2
|
import type { DomainRuntime } from '../../domain-runtime/index.js';
|
|
4
3
|
import type { MapPublishedRevisionDataHandlerProps, MapPublishedRevisionDataResult } from './MapPublishedRevisionDataHandler.js';
|
|
5
4
|
export declare const mapPublishedData: <ADMIN_ENTITIES extends DomainEntity<string> = never, ADMIN_ALLOWED_ROOT_ENTITIES extends ADMIN_ENTITIES = never, ADMIN_$MAP extends Record<ADMIN_ENTITIES['type'], $DomainEntity<ADMIN_ENTITIES>> = never, PUBLISHED_DATA extends Record<string, unknown> = never, SESSION_DATA extends Record<string, unknown> = never, FRONTEND_DATA extends Record<string, unknown> = never>(adminDomainFactory: DomainFactory<ADMIN_ENTITIES, ADMIN_ALLOWED_ROOT_ENTITIES, ADMIN_$MAP, PUBLISHED_DATA, SESSION_DATA, FRONTEND_DATA>, domainRuntime: DomainRuntime, mapPublishedDataHandler: (props: MapPublishedRevisionDataHandlerProps<ADMIN_ENTITIES, ADMIN_ALLOWED_ROOT_ENTITIES, ADMIN_$MAP>) => MapPublishedRevisionDataResult<PUBLISHED_DATA>, rootEntityType: ADMIN_ALLOWED_ROOT_ENTITIES['type'], entities: readonly ADMIN_ENTITIES[]) => PUBLISHED_DATA;
|
|
@@ -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,7 @@
|
|
|
1
1
|
import type { SessionRole } from '@salsita-ai/contracts/api';
|
|
2
|
-
import type { AliasMap } from '../core/
|
|
3
|
-
import type { StateOfComponent, SystemComponentType, SystemComponentTypeConstraint, WritableStateOfComponent } from '../core/component.js';
|
|
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';
|
|
2
|
+
import type { $DomainEntity, AliasMap, DomainEntity, DomainState, EntityByType, ExpressionContext, StateOfComponent, SystemComponentType, SystemComponentTypeConstraint, WritableStateOfComponent } from '../core/index.js';
|
|
7
3
|
import type { CustomExpression } from '../expressions/custom-expression.js';
|
|
4
|
+
import { type ProjectModule } from '../project-modules/index.js';
|
|
8
5
|
import { type ComponentSystemFilter, type NavigationFilterOptic } from './legacy-filter.js';
|
|
9
6
|
import type { GradualComponentSystemFilter, IdOrWithId } from './system-component-filter.js';
|
|
10
7
|
import type { Viewport } from './viewport-state-component.js';
|
|
@@ -33,6 +30,8 @@ export interface DomainComponentDynamicOptic<ENTITIES extends DomainEntity<strin
|
|
|
33
30
|
}
|
|
34
31
|
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
32
|
export type AnyDomainComponentOptic = DomainComponentOptic<any, any, any, any, any, any, any>;
|
|
33
|
+
/** Validates the `src/components/` files, or the optics a generated file lists, and flattens them. */
|
|
34
|
+
export declare const resolveComponentOpticModules: (modules: readonly ProjectModule[]) => readonly AnyDomainComponentOptic[];
|
|
36
35
|
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
36
|
private readonly aliasMap;
|
|
38
37
|
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"../expressions/custom-expression.js";import{
|
|
1
|
+
import{createCacheToken as t,getStickyCache as e}from"@salsita-ai/common/utils";import{createCustomExpression as i}from"../expressions/custom-expression.js";import{SHARED_FOLDER_HINT as n,isRecord as s,resolveListModule as a}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=>s(t)&&("simple"===t.kind||"dynamic"===t.kind)&&"string"==typeof t.instanceName&&"function"==typeof t.read;export const resolveComponentOpticModules=t=>t.flatMap(t=>a(t,r,d));export class DomainComponentOpticBuilder{aliasMap;entityTypes;componentType;instanceName;navigationFilters;generated;entityTypeOrAliasNames;constructor(t,e,i,n,s=[],a=!1,o=[]){this.aliasMap=t,this.entityTypes=e,this.componentType=i,this.instanceName=n,this.navigationFilters=s,this.generated=a,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(),s=t=>({evaluate:(s,a,o)=>{let r=e(a,n),d=r.get(s);if(!d){if(void 0===(d=i(o.domain.get$Entity(s,a),a)))throw Error(`Dynamic filter on component ${this.componentType?.name}.${this.instanceName} on entity ${s} returned 'undefined'. This is likely a bug in the component definition, check whether you are referencing a correct expression or field!`);r.put(s,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:s("navigationStates"),selectedEntityIds:s("selectedEntityIds"),hoveredEntityIds:s("hoveredEntityIds"),draggedEntityIds:s("draggedEntityIds"),viewStates:s("viewStates"),toolStates:s("toolStates"),modes:s("modes"),roles:s("roles"),active:s("active"),fullscreen:s("fullscreen"),debug:s("debug"),viewports:s("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,
|
|
16
|
+
`),"function"==typeof i){let n=t(),s=t=>({evaluate:(s,a,o)=>{let r=e(a,n),d=r.get(s);if(!d){if(void 0===(d=i(o.domain.get$Entity(s,a),a)))throw Error(`Dynamic filter on component ${this.componentType?.name}.${this.instanceName} on entity ${s} returned 'undefined'. This is likely a bug in the component definition, check whether you are referencing a correct expression or field!`);r.put(s,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:s("navigationStates"),selectedEntityIds:s("selectedEntityIds"),hoveredEntityIds:s("hoveredEntityIds"),draggedEntityIds:s("draggedEntityIds"),viewStates:s("viewStates"),toolStates:s("toolStates"),modes:s("modes"),roles:s("roles"),active:s("active"),fullscreen:s("fullscreen"),debug:s("debug"),viewports:s("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 s,a;let r,d;return this.validate(),s={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},a=this._getProfilerLabel(),r=t(),d=o(a,s.read),{...s,read:(t,i,n)=>{let s=e(i,r),a=s.get(t);if(a)return a;let o=d(t,i,n);return s.put(t,o),o}}};attachMany=i=>{var n,s;let a,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)},s=this._getProfilerLabel(),a=t(),r=o(s,n.read),{...n,read:(t,i,n)=>{let s=e(i,a),o=s.get(t);if(o)return o;let d=r(t,i,n);return s.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);
|