@salsita-ai/sdk 0.50.0-develop.fbe43b9a2d → 0.50.0-develop.fda84314a5
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/index.d.ts +1 -0
- package/dist/application/index.js +1 -1
- package/dist/application/mount-application.d.ts +1 -1
- package/dist/application/mount-application.js +1 -1
- package/dist/application/mount-configurator.d.ts +19 -0
- package/dist/application/mount-configurator.js +1 -0
- package/dist/application/mounted-application-runtime.d.ts +4 -0
- package/dist/application/mounted-application-runtime.js +1 -0
- package/dist/application/register-web-component.d.ts +2 -0
- package/dist/application/register-web-component.js +1 -0
- package/dist/application-spec/generate-application/code/templates/skills/sdk-content.d.ts +11 -5
- package/dist/application-spec/generate-application/code/templates/skills/sdk-content.js +1 -1
- package/dist/application-spec/generate-application/implementations/phx-application-types.d.ts +25 -0
- package/dist/application-spec/generate-application/implementations/phx-application-types.js +1 -0
- package/dist/application-spec/generate-application/implementations/phx-domain.d.ts +36 -0
- package/dist/application-spec/generate-application/implementations/phx-domain.js +1 -0
- package/dist/application-spec/generate-application/implementations/phx-model.d.ts +24 -0
- package/dist/application-spec/generate-application/implementations/phx-model.js +1 -0
- package/dist/application-spec/generate-application/implementations/phx.d.ts +22 -0
- package/dist/application-spec/generate-application/implementations/phx.js +1 -0
- package/dist/application-spec/generate-application/index.d.ts +2 -0
- package/dist/application-spec/generate-application/index.js +1 -1
- package/dist/application-spec/generate-application/runtime/admin-runtime/admin-model-runtime.d.ts +3 -3
- package/dist/application-spec/generate-application/runtime/admin-runtime/admin-runtime.d.ts +7 -4
- package/dist/application-spec/generate-application/runtime/admin-runtime/admin-runtime.js +1 -1
- package/dist/application-spec/generate-application/runtime/admin-runtime/admin-spec-runtime.d.ts +16 -0
- package/dist/application-spec/generate-application/runtime/admin-runtime/admin-spec-runtime.js +1 -0
- package/dist/application-spec/generate-application/runtime/application-runtime.d.ts +17 -4
- package/dist/application-spec/generate-application/runtime/application-runtime.js +1 -1
- package/dist/application-spec/generate-application/runtime/application-spec-slice.d.ts +71 -0
- package/dist/application-spec/generate-application/runtime/application-spec-slice.js +1 -0
- package/dist/application-spec/generate-application/runtime/configurator-runtime/configurator-model-runtime.d.ts +3 -3
- package/dist/application-spec/generate-application/runtime/configurator-runtime/configurator-runtime.d.ts +7 -5
- package/dist/application-spec/generate-application/runtime/configurator-runtime/configurator-runtime.js +1 -1
- package/dist/application-spec/generate-application/runtime/configurator-runtime/configurator-spec-runtime.d.ts +16 -0
- package/dist/application-spec/generate-application/runtime/configurator-runtime/configurator-spec-runtime.js +1 -0
- package/dist/application-spec/generate-application/runtime/create-application.d.ts +57 -0
- package/dist/application-spec/generate-application/runtime/create-application.js +1 -0
- package/dist/application-spec/generate-application/runtime/index.d.ts +8 -0
- package/dist/application-spec/generate-application/runtime/index.js +1 -0
- package/dist/application-spec/generate-application/runtime/sections/expression-runtime.d.ts +9 -3
- package/dist/application-spec/generate-application/runtime/sections/expression-runtime.js +1 -1
- package/dist/application-spec/generate-application/runtime/spec-runtime.d.ts +21 -0
- package/dist/application-spec/generate-application/runtime/spec-runtime.js +1 -0
- package/dist/application-spec/generate-application/runtime-spec/encoded-runtime-spec.d.ts +3 -2
- package/dist/application-spec/generate-application/runtime-spec/runtime-spec.d.ts +44 -9
- package/dist/application-spec/generate-application/runtime-spec/runtime-spec.js +1 -1
- package/dist/client/authorized-client.d.ts +3 -1
- package/dist/client/authorized-client.js +1 -1
- package/dist/client/contract.d.ts +17 -0
- package/dist/client/index.d.ts +1 -1
- package/dist/client/local-authorized-client.d.ts +3 -1
- package/dist/client/local-authorized-client.js +1 -1
- package/dist/client/memory-authorized-client.d.ts +4 -1
- package/dist/client/memory-authorized-client.js +1 -1
- package/dist/client/phoenix-api.d.ts +228 -0
- package/dist/configurator/ConfiguratorApp.js +1 -1
- package/dist/configurator/app-loader-content/index.d.ts +0 -1
- package/dist/configurator/app-loader-content/index.js +1 -1
- package/dist/configurator/application-runtime/extensions/selectors.js +1 -1
- package/dist/configurator/application-runtime/extensions/systems/assistant-system/assistant-system.d.ts +17 -3
- package/dist/configurator/application-runtime/extensions/systems/assistant-system/assistant-system.js +1 -1
- package/dist/configurator/application-runtime/extensions/systems/assistant-system/graphql-tools.d.ts +23 -6
- package/dist/configurator/application-runtime/extensions/systems/assistant-system/graphql-tools.js +1 -1
- package/dist/configurator/application-runtime/extensions/systems/graphql-system/graphql-system.d.ts +15 -9
- package/dist/configurator/application-runtime/extensions/systems/graphql-system/graphql-system.js +1 -1
- package/dist/configurator/common/configurator-interface.d.ts +8 -5
- package/dist/configurator/common/configurator-interface.js +1 -1
- package/dist/configurator/configuration-not-found-page/BuiltInConfigurationNotFoundPage.d.ts +5 -0
- package/dist/configurator/configuration-not-found-page/BuiltInConfigurationNotFoundPage.js +1 -0
- package/dist/configurator/configuration-not-found-page/ConfigurationNotFoundPageElement.d.ts +0 -6
- package/dist/configurator/configuration-not-found-page/ConfigurationNotFoundPageElement.js +1 -1
- package/dist/configurator/configuration-not-found-page/index.d.ts +2 -2
- package/dist/configurator/configuration-not-found-page/index.js +1 -1
- package/dist/configurator/configurator-context/ConfiguratorResponsiveProvider.d.ts +3 -3
- package/dist/configurator/configurator-context/ConfiguratorResponsiveProvider.js +1 -1
- package/dist/configurator/configurator-context/PreviewContextProvider.js +1 -1
- package/dist/configurator/configurator-error-page/BuiltInConfiguratorErrorPage.d.ts +3 -3
- package/dist/configurator/configurator-error-page/BuiltInConfiguratorErrorPage.js +1 -1
- package/dist/configurator/configurator-error-page/ConfiguratorErrorPageElement.d.ts +0 -5
- package/dist/configurator/configurator-error-page/ConfiguratorErrorPageElement.js +1 -1
- package/dist/configurator/configurator-error-page/index.d.ts +1 -2
- package/dist/configurator/configurator-error-page/index.js +1 -1
- package/dist/configurator/index.d.ts +9 -2
- package/dist/configurator/index.js +1 -1
- package/dist/configurator/pages/default-configurator-elements.js +1 -1
- package/dist/configurator/pages/error-boundaries/LoadingErrorBoundary.js +1 -1
- package/dist/configurator/ui/assistant/screenshots/ScreenshotThumbnails.d.ts +1 -1
- package/dist/configurator/ui/assistant/screenshots/ScreenshotThumbnails.js +1 -1
- package/dist/configurator/ui/assistant/screenshots/tool-screenshots.d.ts +12 -4
- package/dist/configurator/ui/assistant/screenshots/tool-screenshots.js +1 -1
- package/dist/configurator/ui/assistant/screenshots/use-screenshot-src.d.ts +8 -0
- package/dist/configurator/ui/assistant/screenshots/use-screenshot-src.js +1 -0
- package/dist/configurator/ui/configurator-layout/slots/canvas/LayoutCanvas.js +1 -1
- package/dist/configurator/ui/configurator-layout/slots/canvas/SharedCanvas.js +1 -1
- package/dist/configurator/ui/configurator-layout/universal/use-layout-scene-safe-area.js +1 -1
- package/dist/configurator/ui/legacy/layout/common/ReactiveInterfaceLayout.js +1 -1
- package/dist/configurator/ui/phoenix-layout-elements/AppLoader.d.ts +0 -7
- package/dist/configurator/ui/phoenix-layout-elements/AppLoader.js +2 -2
- package/dist/configurator/ui/phoenix-layout-elements/index.d.ts +8 -1
- package/dist/configurator/ui/phoenix-layout-elements/index.js +1 -1
- package/dist/configurator/ui/preset-layout/PresetUi.d.ts +0 -2
- package/dist/configurator/ui/preset-layout/PresetUi.js +1 -1
- package/dist/configurator/ui/preset-layout/index.d.ts +6 -1
- package/dist/configurator/ui/preset-layout/index.js +1 -1
- package/dist/configurator/ui/save-message-snackbars/SaveMessageSnackbars.js +1 -1
- package/dist/docs/index.json +34 -1
- package/dist/docs/integrations/webcomponent-api/basics.mdx +2 -0
- package/dist/docs/layouts/custom-layout.mdx +318 -158
- package/dist/docs/layouts/gallery/ardent-compressor.mdx +1 -0
- package/dist/docs/layouts/gallery/corvid-drone.mdx +3428 -0
- package/dist/docs/layouts/gallery/fenwick-window.mdx +198 -127
- package/dist/docs/layouts/gallery/nightjar-guitar.mdx +3698 -0
- package/dist/docs/layouts/gallery/sunfold-solar.mdx +16 -4
- package/dist/docs/layouts/gallery/tidepool-aquascape.mdx +5203 -0
- package/dist/docs/phoenix/configurator-interface.mdx +8 -6
- package/dist/docs/phoenix/sdk-builder-workflow.mdx +4 -2
- package/dist/docs/phoenix/sessions-and-access.mdx +2 -0
- package/dist/domain/application/assistant/build-assistant-manifest.js +1 -1
- package/dist/domain/application/assistant/generate-assistant-prompt.js +1 -1
- package/dist/domain/application/configurator-builder.d.ts +7 -1
- package/dist/domain/application/configurator-builder.js +1 -1
- package/dist/domain/application/index.d.ts +1 -1
- package/dist/domain/application/index.js +1 -1
- package/dist/domain/application/standard-properties.js +1 -1
- package/dist/domain/application/web-component-property.d.ts +3 -1
- package/dist/domain/application/web-component-property.js +1 -1
- package/dist/domain/domain-builder.d.ts +9 -3
- package/dist/domain/domain-builder.js +1 -1
- package/dist/domain/domain-runtime/application.d.ts +39 -0
- package/dist/domain/domain-runtime/application.js +1 -0
- package/dist/domain/domain-runtime/domain-context/selectors.d.ts +1 -0
- package/dist/domain/domain-runtime/domain-context/selectors.js +1 -1
- package/dist/domain/domain-runtime/domain-runtime.d.ts +40 -4
- package/dist/domain/domain-runtime/domain-runtime.js +1 -1
- package/dist/domain/domain-runtime/environment/initialize.d.ts +1 -1
- package/dist/domain/domain-runtime/errors/implementation-error-collector.d.ts +2 -0
- package/dist/domain/domain-runtime/errors/implementation-error-collector.js +1 -1
- package/dist/domain/domain-runtime/index.d.ts +2 -1
- package/dist/domain/domain-runtime/index.js +1 -1
- package/dist/domain/domain-runtime/spec/index.d.ts +1 -1
- package/dist/domain/domain-runtime/spec/index.js +1 -1
- package/dist/domain/domain-runtime/spec/module-checks/index.d.ts +1 -0
- package/dist/domain/domain-runtime/spec/module-checks/index.js +1 -1
- package/dist/domain/domain-runtime/spec/module-checks/merge-expression-modules.d.ts +23 -0
- package/dist/domain/domain-runtime/spec/module-checks/merge-expression-modules.js +1 -0
- package/dist/domain/domain-runtime/spec/module-checks/resolve-expression-modules.d.ts +3 -4
- package/dist/domain/domain-runtime/spec/module-checks/resolve-expression-modules.js +1 -1
- package/dist/domain/domain-runtime/web-component/actions.d.ts +3 -0
- package/dist/domain/domain-runtime/web-component/actions.js +1 -1
- package/dist/domain/domain-runtime/web-component/initialize.d.ts +1 -0
- package/dist/domain/domain-runtime/web-component/initialize.js +1 -1
- package/dist/domain/domain-runtime/web-component/selectors.d.ts +2 -0
- package/dist/domain/domain-runtime/web-component/selectors.js +1 -1
- package/dist/domain/domain-runtime/web-component/types.d.ts +6 -3
- package/dist/domain/mocks/create-mock-domain-runtime.d.ts +7 -0
- package/dist/editor/domain-editors/DomainSpecContext.js +1 -1
- package/dist/editor/domain-editors/apply-spec-update.d.ts +2 -1
- package/dist/editor/domain-editors/apply-spec-update.js +1 -1
- package/dist/editor/domain-editors/use-implementation-files.d.ts +6 -14
- package/dist/editor/domain-editors/use-implementation-files.js +1 -1
- package/dist/legacy/domain-cli/utils/cache.d.ts +1 -1
- package/dist/legacy/domain-cli/utils/cache.js +1 -1
- package/dist/legacy/phoenix-cli/project-gen/generators/file-templates/agents/claude-md.d.ts +1 -1
- package/dist/legacy/phoenix-cli/project-gen/generators/file-templates/agents/cursor-rules.d.ts +1 -1
- package/dist/legacy/phoenix-cli/project-gen/generators/file-templates/agents/shared-sdk-content.d.ts +1 -1
- package/dist/legacy/phoenix-cli/project-gen/generators/file-templates/agents/shared-sdk-content.js +11 -5
- package/dist/react-sdk/application-runtime/common-services/analytics/analytics-service.d.ts +1 -1
- package/dist/react-sdk/application-runtime/common-services/initialize.d.ts +2 -2
- package/dist/react-sdk/application-runtime/hooks/index.d.ts +2 -0
- package/dist/react-sdk/application-runtime/hooks/index.js +1 -1
- package/dist/react-sdk/application-runtime/hooks/loading/index.d.ts +5 -0
- package/dist/react-sdk/application-runtime/hooks/loading/index.js +1 -0
- package/dist/react-sdk/application-runtime/hooks/loading/loader-host-context.d.ts +11 -0
- package/dist/react-sdk/application-runtime/hooks/loading/loader-host-context.js +1 -0
- package/dist/react-sdk/application-runtime/hooks/loading/use-is-awaiting-loading-phase.d.ts +8 -0
- package/dist/react-sdk/application-runtime/hooks/loading/use-is-awaiting-loading-phase.js +1 -0
- package/dist/react-sdk/application-runtime/hooks/loading/use-is-loader-hosted.d.ts +7 -0
- package/dist/react-sdk/application-runtime/hooks/loading/use-is-loader-hosted.js +1 -0
- package/dist/react-sdk/application-runtime/hooks/loading/use-loading-actions.d.ts +9 -0
- package/dist/react-sdk/application-runtime/hooks/loading/use-loading-actions.js +1 -0
- package/dist/react-sdk/application-runtime/hooks/loading/use-loading-application.d.ts +24 -0
- package/dist/react-sdk/application-runtime/hooks/loading/use-loading-application.js +1 -0
- package/dist/react-sdk/application-runtime/hooks/responsive/index.d.ts +3 -0
- package/dist/react-sdk/application-runtime/hooks/responsive/index.js +1 -0
- package/dist/react-sdk/application-runtime/hooks/responsive/use-responsive-actions.d.ts +9 -0
- package/dist/react-sdk/application-runtime/hooks/responsive/use-responsive-actions.js +1 -0
- package/dist/react-sdk/application-runtime/hooks/responsive/use-responsive-application.d.ts +26 -0
- package/dist/react-sdk/application-runtime/hooks/responsive/use-responsive-application.js +1 -0
- package/dist/react-sdk/application-runtime/hooks/responsive/use-responsive-state.d.ts +10 -0
- package/dist/react-sdk/application-runtime/hooks/responsive/use-responsive-state.js +1 -0
- package/dist/react-sdk/application-runtime/hooks/responsive/use-responsive-store.d.ts +24 -0
- package/dist/react-sdk/application-runtime/hooks/responsive/use-responsive-store.js +1 -0
- package/dist/react-sdk/application-runtime/hooks/use-access-service.d.ts +5 -0
- package/dist/react-sdk/application-runtime/hooks/use-access-service.js +1 -1
- package/dist/react-sdk/application-runtime/hooks/use-web-component-readonly-sync.d.ts +4 -11
- package/dist/react-sdk/application-runtime/hooks/use-web-component-readonly-sync.js +1 -1
- package/dist/react-sdk/application-runtime/hooks/use-web-component.d.ts +5 -0
- package/dist/react-sdk/application-runtime/hooks/use-web-component.js +1 -1
- package/dist/react-sdk/application-runtime/host-properties/actions.d.ts +15 -0
- package/dist/react-sdk/application-runtime/host-properties/actions.js +1 -0
- package/dist/react-sdk/application-runtime/host-properties/connect-host-properties.d.ts +30 -0
- package/dist/react-sdk/application-runtime/host-properties/connect-host-properties.js +1 -0
- package/dist/react-sdk/application-runtime/host-properties/domain-host-properties.d.ts +7 -0
- package/dist/react-sdk/application-runtime/host-properties/domain-host-properties.js +1 -0
- package/dist/react-sdk/application-runtime/host-properties/host-property-descriptors.d.ts +21 -0
- package/dist/react-sdk/application-runtime/host-properties/host-property-descriptors.js +1 -0
- package/dist/react-sdk/application-runtime/host-properties/host-property-scopes.d.ts +42 -0
- package/dist/react-sdk/application-runtime/host-properties/host-property-scopes.js +1 -0
- package/dist/react-sdk/application-runtime/host-properties/index.d.ts +8 -0
- package/dist/react-sdk/application-runtime/host-properties/index.js +1 -0
- package/dist/react-sdk/application-runtime/host-properties/initialize.d.ts +7 -0
- package/dist/react-sdk/application-runtime/host-properties/initialize.js +1 -0
- package/dist/react-sdk/application-runtime/host-properties/selectors.d.ts +54 -0
- package/dist/react-sdk/application-runtime/host-properties/selectors.js +1 -0
- package/dist/react-sdk/application-runtime/host-properties/types.d.ts +18 -0
- package/dist/react-sdk/application-runtime/index.d.ts +3 -0
- package/dist/react-sdk/application-runtime/loading/actions.d.ts +45 -0
- package/dist/react-sdk/application-runtime/loading/actions.js +1 -0
- package/dist/react-sdk/application-runtime/loading/index.d.ts +4 -0
- package/dist/react-sdk/application-runtime/loading/index.js +1 -0
- package/dist/react-sdk/application-runtime/loading/initialize.d.ts +3 -0
- package/dist/react-sdk/application-runtime/loading/initialize.js +1 -0
- package/dist/react-sdk/application-runtime/loading/selectors.d.ts +18 -0
- package/dist/react-sdk/application-runtime/loading/selectors.js +1 -0
- package/dist/react-sdk/application-runtime/loading/types.d.ts +59 -0
- package/dist/react-sdk/application-runtime/mocks/create-mock-application-runtime.js +1 -1
- package/dist/react-sdk/application-runtime/provider/ApplicationRuntime.d.ts +6 -0
- package/dist/react-sdk/application-runtime/provider/ApplicationRuntime.js +1 -1
- package/dist/react-sdk/application-runtime/provider/ApplicationType.d.ts +7 -0
- package/dist/react-sdk/application-runtime/provider/ApplicationType.js +1 -1
- package/dist/react-sdk/application-runtime/responsive/actions.d.ts +47 -0
- package/dist/react-sdk/application-runtime/responsive/actions.js +1 -0
- package/dist/react-sdk/application-runtime/responsive/index.d.ts +4 -0
- package/dist/react-sdk/application-runtime/responsive/index.js +1 -0
- package/dist/react-sdk/application-runtime/responsive/initialize.d.ts +3 -0
- package/dist/react-sdk/application-runtime/responsive/initialize.js +1 -0
- package/dist/react-sdk/application-runtime/responsive/selectors.d.ts +20 -0
- package/dist/react-sdk/application-runtime/responsive/selectors.js +1 -0
- package/dist/react-sdk/application-runtime/responsive/types.d.ts +104 -0
- package/dist/react-sdk/application-runtime/responsive/types.js +1 -0
- package/dist/react-sdk/application-runtime/runtime/create-application-runtime.d.ts +309 -8
- package/dist/react-sdk/application-runtime/runtime/create-application-runtime.js +1 -1
- package/dist/react-sdk/domain-application-context/BackendDataProvider.js +1 -1
- package/dist/react-sdk/domain-application-context/FrontendDataProvider.js +1 -1
- package/dist/react-sdk/domain-application-context/PublishedDataProvider.js +1 -1
- package/dist/react-sdk/domain-context/common-hooks/index.d.ts +1 -0
- package/dist/react-sdk/domain-context/common-hooks/index.js +1 -1
- package/dist/react-sdk/domain-context/common-hooks/use-configuration-save-state.d.ts +23 -0
- package/dist/react-sdk/domain-context/common-hooks/use-configuration-save-state.js +1 -0
- package/dist/react-sdk/domain-context/common-hooks/use-domain-context.d.ts +1 -0
- package/dist/react-sdk/domain-context/index.d.ts +1 -0
- package/dist/react-sdk/domain-context/index.js +1 -1
- package/dist/react-sdk/elements/index.d.ts +0 -1
- package/dist/react-sdk/index.d.ts +1 -1
- package/dist/react-sdk/index.js +1 -1
- package/dist/react-sdk/loading-state/LoaderHost.d.ts +20 -0
- package/dist/react-sdk/loading-state/LoaderHost.js +1 -0
- package/dist/react-sdk/loading-state/built-in-loading-phase.d.ts +9 -0
- package/dist/react-sdk/loading-state/built-in-loading-phase.js +1 -0
- package/dist/react-sdk/loading-state/create-app-loader.d.ts +18 -0
- package/dist/react-sdk/loading-state/create-app-loader.js +1 -0
- package/dist/react-sdk/loading-state/index.d.ts +4 -2
- package/dist/react-sdk/loading-state/index.js +1 -1
- package/dist/react-sdk/loading-state/{LoadingStateProvider.d.ts → loading-state-hooks.d.ts} +3 -12
- package/dist/react-sdk/loading-state/loading-state-hooks.js +1 -0
- package/dist/react-sdk/page-elements/ConfigurationNotFoundPagePropsProvider.d.ts +17 -0
- package/dist/react-sdk/page-elements/ConfigurationNotFoundPagePropsProvider.js +1 -0
- package/dist/react-sdk/page-elements/ConfiguratorErrorPagePropsProvider.d.ts +17 -0
- package/dist/react-sdk/page-elements/ConfiguratorErrorPagePropsProvider.js +1 -0
- package/dist/react-sdk/page-elements/configurator-error-page-props.js +1 -0
- package/dist/{configurator/configuration-not-found-page → react-sdk/page-elements}/create-configuration-not-found-page.d.ts +7 -1
- package/dist/react-sdk/page-elements/create-configuration-not-found-page.js +1 -0
- package/dist/{configurator/configurator-error-page → react-sdk/page-elements}/create-configurator-error-page.d.ts +6 -1
- package/dist/react-sdk/page-elements/create-configurator-error-page.js +1 -0
- package/dist/react-sdk/page-elements/create-preset-ui.d.ts +9 -0
- package/dist/react-sdk/page-elements/create-preset-ui.js +1 -0
- package/dist/react-sdk/page-elements/index.d.ts +6 -0
- package/dist/react-sdk/page-elements/index.js +1 -0
- package/dist/react-sdk/session/SessionServiceProvider.js +1 -1
- package/dist/react-sdk/web-component/create-web-component.js +1 -1
- package/dist/ui-sdk/responsive-application/ResponsiveApplicationProvider.d.ts +2 -2
- package/dist/ui-sdk/responsive-application/responsive-state-store.d.ts +11 -9
- package/dist/ui-sdk/responsive-application/use-store-responsive-info.js +1 -1
- package/package.json +3 -3
- package/dist/configurator/app-loader-content/app-loader-content-name.d.ts +0 -5
- package/dist/configurator/app-loader-content/app-loader-content-name.js +0 -1
- package/dist/configurator/configuration-not-found-page/create-configuration-not-found-page.js +0 -1
- package/dist/configurator/configurator-error-page/create-configurator-error-page.js +0 -1
- package/dist/react-sdk/loading-state/LoadingStateProvider.js +0 -1
- package/dist/react-sdk/loading-state/loading-state-manager.d.ts +0 -37
- package/dist/react-sdk/loading-state/loading-state-manager.js +0 -1
- package/dist/react-sdk/responsive-state/ResponsiveStateProvider.d.ts +0 -25
- package/dist/react-sdk/responsive-state/ResponsiveStateProvider.js +0 -1
- package/dist/react-sdk/responsive-state/canvas-padding.d.ts +0 -14
- package/dist/react-sdk/responsive-state/index.d.ts +0 -5
- package/dist/react-sdk/responsive-state/index.js +0 -1
- package/dist/react-sdk/responsive-state/responsive-state-manager.d.ts +0 -111
- package/dist/react-sdk/responsive-state/responsive-state-manager.js +0 -1
- package/dist/react-sdk/responsive-state/use-responsive-state-manager.d.ts +0 -10
- package/dist/react-sdk/responsive-state/use-responsive-state-manager.js +0 -1
- package/dist/react-sdk/responsive-state/use-responsive-state.d.ts +0 -11
- package/dist/react-sdk/responsive-state/use-responsive-state.js +0 -1
- /package/dist/react-sdk/{elements/configurator-error-page-props.js → application-runtime/host-properties/types.js} +0 -0
- /package/dist/react-sdk/{responsive-state/canvas-padding.js → application-runtime/loading/types.js} +0 -0
- /package/dist/react-sdk/{elements → page-elements}/configurator-error-page-props.d.ts +0 -0
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { BehaviorSubject } from 'rxjs';
|
|
2
2
|
import type { AnyApplicationConfig } from '../application/index.js';
|
|
3
3
|
import { type ApplicationAccessInfo } from './access/index.js';
|
|
4
|
+
import { type Application } from './application.js';
|
|
4
5
|
import { type ApplicationDomainContextState, type DomainApplicationType, type InitializableSystem } from './domain-context/index.js';
|
|
5
6
|
import { type ApplicationDomainData } from './domain-data/index.js';
|
|
6
7
|
import { type DomainRuntimeServices } from './domain-services/index.js';
|
|
@@ -21,17 +22,30 @@ export interface DomainRuntimeState {
|
|
|
21
22
|
readonly webComponent: ApplicationWebComponentState;
|
|
22
23
|
readonly domainContext: ApplicationDomainContextState;
|
|
23
24
|
}
|
|
24
|
-
|
|
25
|
+
/**
|
|
26
|
+
* What a domain runtime starts from: the spec slice and the environment of an application, or the
|
|
27
|
+
* config of a project built with `ConfiguratorBuilder`, which is converted to them when the runtime
|
|
28
|
+
* initializes.
|
|
29
|
+
*/
|
|
30
|
+
type DomainRuntimeSource = {
|
|
31
|
+
readonly application: Pick<Application, 'spec' | 'environment'>;
|
|
32
|
+
readonly config?: undefined;
|
|
33
|
+
} | {
|
|
25
34
|
readonly config: AnyApplicationConfig;
|
|
35
|
+
readonly application?: undefined;
|
|
36
|
+
};
|
|
37
|
+
type DomainRuntimeProps = DomainRuntimeSource & {
|
|
26
38
|
readonly services: DomainRuntimeServices;
|
|
27
|
-
readonly getSubject: () => BehaviorSubject<State>;
|
|
28
39
|
/**
|
|
29
40
|
* Systems a host layers onto a slot's domain initialization. Webhook and finalize hosts run the
|
|
30
41
|
* domain alone and pass nothing; the application runtime contributes its domain-application
|
|
31
42
|
* systems here.
|
|
32
43
|
*/
|
|
33
44
|
readonly getExtensionSystems?: (applicationType: DomainApplicationType) => readonly InitializableSystem[];
|
|
34
|
-
}
|
|
45
|
+
};
|
|
46
|
+
type Props<State extends DomainRuntimeState> = DomainRuntimeProps & {
|
|
47
|
+
readonly getSubject: () => BehaviorSubject<State>;
|
|
48
|
+
};
|
|
35
49
|
export declare function createDomainRuntimeSlices<State extends DomainRuntimeState>(props: Props<State>): {
|
|
36
50
|
initialize: () => {
|
|
37
51
|
spec: ApplicationSpec;
|
|
@@ -344,6 +358,8 @@ export declare function createDomainRuntimeSlices<State extends DomainRuntimeSta
|
|
|
344
358
|
webComponent: {
|
|
345
359
|
selectReadonly: import("@salsita-ai/common/utils").Selector<import("./index.js").WebComponentSelectorState, boolean>;
|
|
346
360
|
getReadonly: () => boolean;
|
|
361
|
+
selectLocale: import("@salsita-ai/common/utils").Selector<import("./index.js").WebComponentSelectorState, string>;
|
|
362
|
+
getLocale: () => string;
|
|
347
363
|
getWebcomponentGeneration: () => number;
|
|
348
364
|
};
|
|
349
365
|
domainContext: {
|
|
@@ -417,6 +433,7 @@ export declare function createDomainRuntimeSlices<State extends DomainRuntimeSta
|
|
|
417
433
|
getMigrate: () => import("../index.js").MigrateFunction<import("../index.js").DomainEntity<string>>;
|
|
418
434
|
getActiveMode: () => import("../index.js").DomainMode;
|
|
419
435
|
getIsInitialized: () => boolean;
|
|
436
|
+
getIsViewMode: () => boolean;
|
|
420
437
|
getComponentReaderIndexes: () => import("./index.js").ComponentReaderIndexes;
|
|
421
438
|
getStoreRuntimeDependencies: () => {
|
|
422
439
|
componentReaderIndexes: import("./index.js").ComponentReaderIndexes;
|
|
@@ -526,6 +543,7 @@ export declare function createDomainRuntimeSlices<State extends DomainRuntimeSta
|
|
|
526
543
|
getMigrate: () => import("../index.js").MigrateFunction<import("../index.js").DomainEntity<string>>;
|
|
527
544
|
getActiveMode: () => import("../index.js").DomainMode;
|
|
528
545
|
getIsInitialized: () => boolean;
|
|
546
|
+
getIsViewMode: () => boolean;
|
|
529
547
|
getComponentReaderIndexes: () => import("./index.js").ComponentReaderIndexes;
|
|
530
548
|
getStoreRuntimeDependencies: () => {
|
|
531
549
|
componentReaderIndexes: import("./index.js").ComponentReaderIndexes;
|
|
@@ -630,9 +648,16 @@ export declare function createDomainRuntimeSlices<State extends DomainRuntimeSta
|
|
|
630
648
|
};
|
|
631
649
|
};
|
|
632
650
|
};
|
|
651
|
+
/**
|
|
652
|
+
* Writers only the runtime that owns the host-property mirror may call, kept off the public
|
|
653
|
+
* `actions`: the host sets `locale` on the element, and the mirror copies it here.
|
|
654
|
+
*/
|
|
655
|
+
hostMirrorActions: {
|
|
656
|
+
setLocale: (locale: string) => void;
|
|
657
|
+
};
|
|
633
658
|
};
|
|
634
659
|
export type DomainRuntimeSlices = ReturnType<typeof createDomainRuntimeSlices>;
|
|
635
|
-
export declare const createDomainRuntime: (props:
|
|
660
|
+
export declare const createDomainRuntime: (props: DomainRuntimeProps) => {
|
|
636
661
|
initialize: () => {
|
|
637
662
|
spec: ApplicationSpec;
|
|
638
663
|
overrides: ApplicationOverrides;
|
|
@@ -944,6 +969,8 @@ export declare const createDomainRuntime: (props: Omit<Props<DomainRuntimeState>
|
|
|
944
969
|
webComponent: {
|
|
945
970
|
selectReadonly: import("@salsita-ai/common/utils").Selector<import("./index.js").WebComponentSelectorState, boolean>;
|
|
946
971
|
getReadonly: () => boolean;
|
|
972
|
+
selectLocale: import("@salsita-ai/common/utils").Selector<import("./index.js").WebComponentSelectorState, string>;
|
|
973
|
+
getLocale: () => string;
|
|
947
974
|
getWebcomponentGeneration: () => number;
|
|
948
975
|
};
|
|
949
976
|
domainContext: {
|
|
@@ -1017,6 +1044,7 @@ export declare const createDomainRuntime: (props: Omit<Props<DomainRuntimeState>
|
|
|
1017
1044
|
getMigrate: () => import("../index.js").MigrateFunction<import("../index.js").DomainEntity<string>>;
|
|
1018
1045
|
getActiveMode: () => import("../index.js").DomainMode;
|
|
1019
1046
|
getIsInitialized: () => boolean;
|
|
1047
|
+
getIsViewMode: () => boolean;
|
|
1020
1048
|
getComponentReaderIndexes: () => import("./index.js").ComponentReaderIndexes;
|
|
1021
1049
|
getStoreRuntimeDependencies: () => {
|
|
1022
1050
|
componentReaderIndexes: import("./index.js").ComponentReaderIndexes;
|
|
@@ -1126,6 +1154,7 @@ export declare const createDomainRuntime: (props: Omit<Props<DomainRuntimeState>
|
|
|
1126
1154
|
getMigrate: () => import("../index.js").MigrateFunction<import("../index.js").DomainEntity<string>>;
|
|
1127
1155
|
getActiveMode: () => import("../index.js").DomainMode;
|
|
1128
1156
|
getIsInitialized: () => boolean;
|
|
1157
|
+
getIsViewMode: () => boolean;
|
|
1129
1158
|
getComponentReaderIndexes: () => import("./index.js").ComponentReaderIndexes;
|
|
1130
1159
|
getStoreRuntimeDependencies: () => {
|
|
1131
1160
|
componentReaderIndexes: import("./index.js").ComponentReaderIndexes;
|
|
@@ -1230,6 +1259,13 @@ export declare const createDomainRuntime: (props: Omit<Props<DomainRuntimeState>
|
|
|
1230
1259
|
};
|
|
1231
1260
|
};
|
|
1232
1261
|
};
|
|
1262
|
+
/**
|
|
1263
|
+
* Writers only the runtime that owns the host-property mirror may call, kept off the public
|
|
1264
|
+
* `actions`: the host sets `locale` on the element, and the mirror copies it here.
|
|
1265
|
+
*/
|
|
1266
|
+
hostMirrorActions: {
|
|
1267
|
+
setLocale: (locale: string) => void;
|
|
1268
|
+
};
|
|
1233
1269
|
getState: () => DomainRuntimeState;
|
|
1234
1270
|
subscribe: (callback: () => void) => () => void;
|
|
1235
1271
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{BehaviorSubject as e}from"rxjs";import{createAccessInfoActions as t,createAccessInfoSelectors as n,initializeAccessInfo as a}from"./access/index.js";import{createDomainContextActions as
|
|
1
|
+
import{BehaviorSubject as e}from"rxjs";import{createAccessInfoActions as t,createAccessInfoSelectors as n,initializeAccessInfo as a}from"./access/index.js";import{applicationFromConfig as o}from"./application.js";import{createDomainContextActions as i,createDomainContextSelectors as s,initializeDomainContext as r}from"./domain-context/index.js";import{createDomainDataActions as m,createDomainDataSelectors as l,initializeDomainData as c}from"./domain-data/index.js";import{createDomainServicesSelectors as d}from"./domain-services/index.js";import{createEnvironmentActions as u,createEnvironmentSelectors as v,initializeEnvironment as p}from"./environment/index.js";import{createLoadedDataActions as x,createLoadedDataSelectors as S,initializeLoadedData as f}from"./loaded-data/index.js";import{createOverridesActions as g,createOverridesSelectors as C,initializeOverrides as D}from"./overrides/index.js";import{createSessionContextActions as b,createSessionContextSelectors as j,initializeSessionContext as w}from"./session-context/index.js";import{createSpecActions as y,createSpecSelectors as E}from"./spec/index.js";import{createWebComponentActions as z,createWebComponentSelectors as R,initializeWebComponent as h}from"./web-component/index.js";export function createDomainRuntimeSlices(e){let{getSubject:A,services:T,getExtensionSystems:I}=e,L=y({setSpec:e=>{let t=A(),n=e(t.value.spec);t.next({...t.value,spec:n})}}),M=E({getState:()=>A().value}),O=d({services:T,specSelectors:M}),W=g({setOverrides:e=>{let t=A(),n=e(t.value.overrides);t.next({...t.value,overrides:n})}}),k=C({getState:()=>A().value}),q=v({getState:()=>A().value,overridesSelectors:k}),B=u({setEnvironment:e=>{let t=A(),n=e(t.value.environment);t.next({...t.value,environment:n})}}),F=x({setLoadedData:e=>{let t=A(),n=e(t.value.loadedData);t.next({...t.value,loadedData:n})}}),G=S({getState:()=>A().value}),H=m({setDomainDataState:e=>{let t=A(),n=e(t.value.domainData);t.next({...t.value,domainData:n})}}),J=l({getState:()=>A().value,overridesSelectors:k}),K=b({setSessionContextState:e=>{let t=A(),n=e(t.value.sessionContext);t.next({...t.value,sessionContext:n})}}),N=j({getState:()=>A().value,overridesSelectors:k}),P=t({setAccessInfoState:e=>{let t=A(),n=e(t.value.access);t.next({...t.value,access:n})}}),Q=n({getState:()=>A().value,overridesSelectors:k}),{setLocale:U,...V}=z({setWebComponentState:e=>{let t=A(),n=e(t.value.webComponent);t.next({...t.value,webComponent:n})}}),X=R({getState:()=>A().value}),Y=i({setDomainContextState:e=>{let t=A(),n=e(t.value.domainContext);t.next({...t.value,domainContext:n})}}),Z={configurator:s({applicationType:"configurator",getState:()=>A().value,actions:Y.configurator,getExtensionSystems:()=>I?.("configurator")??[],specSelectors:M,accessSelectors:Q,webComponentSelectors:X,domainDataSelectors:J,sessionContextSelectors:N,domainServicesSelectors:O,environmentSelectors:q}),admin:s({applicationType:"admin",getState:()=>A().value,actions:Y.admin,getExtensionSystems:()=>I?.("admin")??[],specSelectors:M,accessSelectors:Q,webComponentSelectors:X,domainDataSelectors:J,sessionContextSelectors:N,domainServicesSelectors:O,environmentSelectors:q})};return{initialize:()=>{let t=e.application??o(e.config);return{spec:t.spec,overrides:D(),environment:p(t.environment),loadedData:f(),domainData:c(),sessionContext:w(),access:a(),webComponent:h(),domainContext:r()}},selectors:{domainServices:O,spec:M,overrides:k,environment:q,loadedData:G,domainData:J,sessionContext:N,access:Q,webComponent:X,domainContext:Z},actions:{spec:L,overrides:W,environment:B,loadedData:F,domainData:H,sessionContext:K,access:P,webComponent:V,domainContext:Y},hostMirrorActions:{setLocale:U}}}export const createDomainRuntime=t=>{let n=null,a=createDomainRuntimeSlices({...t,getSubject:()=>{if(!n)throw Error("Subject not yet initialized!");return n}});return n=new e(a.initialize()),{...a,getState:()=>n.value,subscribe:e=>{let t=n.subscribe(()=>e());return()=>t.unsubscribe()}}};
|
|
@@ -2,4 +2,4 @@ import type { AnyApplicationConfig } from '../../application/index.js';
|
|
|
2
2
|
import type { ApplicationEnvironmentConfig } from './types.js';
|
|
3
3
|
export declare const GOD_MODE_SESSION_STORAGE_KEY = "salsita-god-mode";
|
|
4
4
|
export declare const isNotRegisteredDeploymentId: (deploymentId: string) => boolean;
|
|
5
|
-
export declare const initializeEnvironment: (config: AnyApplicationConfig) => ApplicationEnvironmentConfig;
|
|
5
|
+
export declare const initializeEnvironment: (config: Pick<AnyApplicationConfig, 'defaultEnvs' | 'deploymentId' | 'isDev' | 'persistence'>) => ApplicationEnvironmentConfig;
|
|
@@ -10,6 +10,8 @@ export interface ImplementationErrorCollector {
|
|
|
10
10
|
*/
|
|
11
11
|
readonly attempt: <T>(check: () => T, fallback: T) => T;
|
|
12
12
|
readonly add: (error: ImplementationError) => void;
|
|
13
|
+
/** The errors recorded so far, in the order they were recorded. A host that reports them itself, such as the editor, reads them here instead of throwing them. */
|
|
14
|
+
readonly recorded: () => readonly ImplementationError[];
|
|
13
15
|
/**
|
|
14
16
|
* Throws the recorded errors as one {@link ImplementationErrors}, in the order they were
|
|
15
17
|
* recorded. Does nothing when there are none.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{isImplementationError as r}from"./implementation-error.js";import{ImplementationErrors as t,isImplementationErrors as e}from"./implementation-errors.js";export const createImplementationErrorCollector=()=>{let o=[],n=r=>{o.push(r)};return{add:n,attempt:(t,o)=>{try{return t()}catch(t){if(e(t))return t.errors.forEach(n),o;if(r(t))return n(t),o;throw t}},throwIfAny:()=>{if(o.length>0)throw new t(o)}}};
|
|
1
|
+
import{isImplementationError as r}from"./implementation-error.js";import{ImplementationErrors as t,isImplementationErrors as e}from"./implementation-errors.js";export const createImplementationErrorCollector=()=>{let o=[],n=r=>{o.push(r)};return{add:n,attempt:(t,o)=>{try{return t()}catch(t){if(e(t))return t.errors.forEach(n),o;if(r(t))return n(t),o;throw t}},recorded:()=>[...o],throwIfAny:()=>{if(o.length>0)throw new t(o)}}};
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
export * from './domain-runtime.js';
|
|
2
|
+
export { type Application, applicationFromConfig } from './application.js';
|
|
2
3
|
export * from './domain-context/index.js';
|
|
3
4
|
export * from './domain-services/index.js';
|
|
4
|
-
export { type ImplementationErrorCode, type ImplementationErrorProps, type StartupStage, ImplementationError, ImplementationErrors, isImplementationError, isImplementationErrors, toImplementationErrors, } from './errors/index.js';
|
|
5
|
+
export { type ImplementationErrorCode, type ImplementationErrorCollector, type ImplementationErrorProps, type StartupStage, ImplementationError, ImplementationErrors, createImplementationErrorCollector, isImplementationError, isImplementationErrors, toImplementationErrors, } from './errors/index.js';
|
|
5
6
|
export * from './spec/index.js';
|
|
6
7
|
export * from './environment/index.js';
|
|
7
8
|
export * from './access/index.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export*from"./domain-runtime.js";export*from"./domain-context/index.js";export*from"./domain-services/index.js";export{ImplementationError,ImplementationErrors,isImplementationError,isImplementationErrors,toImplementationErrors}from"./errors/index.js";export*from"./spec/index.js";export*from"./environment/index.js";export*from"./access/index.js";export*from"./overrides/index.js";export*from"./loaded-data/index.js";export*from"./domain-data/index.js";export*from"./session-context/index.js";export*from"./web-component/index.js";
|
|
1
|
+
export*from"./domain-runtime.js";export{applicationFromConfig}from"./application.js";export*from"./domain-context/index.js";export*from"./domain-services/index.js";export{ImplementationError,ImplementationErrors,createImplementationErrorCollector,isImplementationError,isImplementationErrors,toImplementationErrors}from"./errors/index.js";export*from"./spec/index.js";export*from"./environment/index.js";export*from"./access/index.js";export*from"./overrides/index.js";export*from"./loaded-data/index.js";export*from"./domain-data/index.js";export*from"./session-context/index.js";export*from"./web-component/index.js";
|
|
@@ -4,6 +4,6 @@ export * from './actions.js';
|
|
|
4
4
|
export * from './create-violation-expressions.js';
|
|
5
5
|
export * from './initialize.js';
|
|
6
6
|
export * from './memoize-expression.js';
|
|
7
|
-
export { type PhoenixEntityElementProps, type PhoenixEntityElementRegistration, type PhoenixLayoutElementRegistration, type PhoenixIconRegistration, type AssistantFormElementRegistration, type ElementRegistration, type CustomPhoenixEntityElementProps, type PhoenixLayoutElementDefinition, type PhoenixEntityElementDefinition, type CreateCustomPhoenixLayoutElement, type CreateCustomPhoenixEntityElement, createPhoenixLayoutElement, createPhoenixEntityElement, createCustomPhoenixLayoutElement, createCustomPhoenixEntityElement, createAssistantFormElement, findAssistantFormElementErrors, resolveElementModule, resolveElementModules, type PhoenixHandlerDefinition, type SystemPhoenixHandlerDefinition, type PhoenixHandlerRegistration, type SystemPhoenixHandlerRegistration, type SystemPhoenixAsyncHandlerDefinition, type SystemPhoenixAsyncHandlerRegistration, type HandlerRegistration, type CreatePhoenixHandler, createPhoenixHandler, createSystemPhoenixHandler, createSystemPhoenixAsyncHandler, resolveHandlerModule, resolveHandlerModules, type ProjectModule, resolveActionModules, resolveComponentOpticModules, type ExpressionModule, resolveExpressionModules, resolveImportedTransformers, resolveTransformerModule, resolveTransformerModules, resolveInvariantModules, } from './module-checks/index.js';
|
|
7
|
+
export { type PhoenixEntityElementProps, type PhoenixEntityElementRegistration, type PhoenixLayoutElementRegistration, type PhoenixIconRegistration, type AssistantFormElementRegistration, type ElementRegistration, type CustomPhoenixEntityElementProps, type PhoenixLayoutElementDefinition, type PhoenixEntityElementDefinition, type CreateCustomPhoenixLayoutElement, type CreateCustomPhoenixEntityElement, createPhoenixLayoutElement, createPhoenixEntityElement, createCustomPhoenixLayoutElement, createCustomPhoenixEntityElement, createAssistantFormElement, findAssistantFormElementErrors, resolveElementModule, resolveElementModules, type PhoenixHandlerDefinition, type SystemPhoenixHandlerDefinition, type PhoenixHandlerRegistration, type SystemPhoenixHandlerRegistration, type SystemPhoenixAsyncHandlerDefinition, type SystemPhoenixAsyncHandlerRegistration, type HandlerRegistration, type CreatePhoenixHandler, createPhoenixHandler, createSystemPhoenixHandler, createSystemPhoenixAsyncHandler, resolveHandlerModule, resolveHandlerModules, type ProjectModule, resolveActionModules, resolveComponentOpticModules, type ExpressionModule, resolveExpressionModules, type ValuedExpressions, mergeExpressionModules, resolveImportedTransformers, resolveTransformerModule, resolveTransformerModules, resolveInvariantModules, } from './module-checks/index.js';
|
|
8
8
|
export * from './prepare-action-implementations.js';
|
|
9
9
|
export * from './prepare-domain-expressions.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export*from"./selectors.js";export*from"./actions.js";export*from"./create-violation-expressions.js";export*from"./initialize.js";export*from"./memoize-expression.js";export{createPhoenixLayoutElement,createPhoenixEntityElement,createCustomPhoenixLayoutElement,createCustomPhoenixEntityElement,createAssistantFormElement,findAssistantFormElementErrors,resolveElementModule,resolveElementModules,createPhoenixHandler,createSystemPhoenixHandler,createSystemPhoenixAsyncHandler,resolveHandlerModule,resolveHandlerModules,resolveActionModules,resolveComponentOpticModules,resolveExpressionModules,resolveImportedTransformers,resolveTransformerModule,resolveTransformerModules,resolveInvariantModules}from"./module-checks/index.js";export*from"./prepare-action-implementations.js";export*from"./prepare-domain-expressions.js";
|
|
1
|
+
export*from"./selectors.js";export*from"./actions.js";export*from"./create-violation-expressions.js";export*from"./initialize.js";export*from"./memoize-expression.js";export{createPhoenixLayoutElement,createPhoenixEntityElement,createCustomPhoenixLayoutElement,createCustomPhoenixEntityElement,createAssistantFormElement,findAssistantFormElementErrors,resolveElementModule,resolveElementModules,createPhoenixHandler,createSystemPhoenixHandler,createSystemPhoenixAsyncHandler,resolveHandlerModule,resolveHandlerModules,resolveActionModules,resolveComponentOpticModules,resolveExpressionModules,mergeExpressionModules,resolveImportedTransformers,resolveTransformerModule,resolveTransformerModules,resolveInvariantModules}from"./module-checks/index.js";export*from"./prepare-action-implementations.js";export*from"./prepare-domain-expressions.js";
|
|
@@ -4,6 +4,7 @@ export { findAssistantFormElementErrors } from './find-assistant-form-element-er
|
|
|
4
4
|
export { type ProjectModule } from './project-modules.js';
|
|
5
5
|
export { resolveActionModules } from './resolve-action-modules.js';
|
|
6
6
|
export { resolveComponentOpticModules } from './resolve-component-optic-modules.js';
|
|
7
|
+
export { type ValuedExpressions, mergeExpressionModules } from './merge-expression-modules.js';
|
|
7
8
|
export { type ExpressionModule, resolveExpressionModules } from './resolve-expression-modules.js';
|
|
8
9
|
export { resolveImportedTransformers, resolveTransformerModule, resolveTransformerModules, } from './resolve-imported-transformers.js';
|
|
9
10
|
export { type AnyInvariant, resolveInvariantModules } from './resolve-invariant-modules.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{createPhoenixLayoutElement,createPhoenixEntityElement,createCustomPhoenixLayoutElement,createCustomPhoenixEntityElement,createAssistantFormElement,resolveElementModule,resolveElementModules}from"./element-registration.js";export{createPhoenixHandler,createSystemPhoenixHandler,createSystemPhoenixAsyncHandler,resolveHandlerModule,resolveHandlerModules}from"./handler-registration.js";export{findAssistantFormElementErrors}from"./find-assistant-form-element-errors.js";export{resolveActionModules}from"./resolve-action-modules.js";export{resolveComponentOpticModules}from"./resolve-component-optic-modules.js";export{resolveExpressionModules}from"./resolve-expression-modules.js";export{resolveImportedTransformers,resolveTransformerModule,resolveTransformerModules}from"./resolve-imported-transformers.js";export{resolveInvariantModules}from"./resolve-invariant-modules.js";
|
|
1
|
+
export{createPhoenixLayoutElement,createPhoenixEntityElement,createCustomPhoenixLayoutElement,createCustomPhoenixEntityElement,createAssistantFormElement,resolveElementModule,resolveElementModules}from"./element-registration.js";export{createPhoenixHandler,createSystemPhoenixHandler,createSystemPhoenixAsyncHandler,resolveHandlerModule,resolveHandlerModules}from"./handler-registration.js";export{findAssistantFormElementErrors}from"./find-assistant-form-element-errors.js";export{resolveActionModules}from"./resolve-action-modules.js";export{resolveComponentOpticModules}from"./resolve-component-optic-modules.js";export{mergeExpressionModules}from"./merge-expression-modules.js";export{resolveExpressionModules}from"./resolve-expression-modules.js";export{resolveImportedTransformers,resolveTransformerModule,resolveTransformerModules}from"./resolve-imported-transformers.js";export{resolveInvariantModules}from"./resolve-invariant-modules.js";
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { AnonymousExpression, AnyExpressions } from '../../../core/index.js';
|
|
2
|
+
import { type ImplementationErrorCollector } from '../../errors/index.js';
|
|
3
|
+
import { type ProjectModule } from './project-modules.js';
|
|
4
|
+
type AnyAnonymousExpression = AnonymousExpression<any, any, any, any, any, any, unknown>;
|
|
5
|
+
type AliasMap = Readonly<Record<string, readonly string[]>>;
|
|
6
|
+
/** The expression names that already have a value, by entity type, so no project file may define them. */
|
|
7
|
+
export type ValuedExpressions = ReadonlyMap<string, ReadonlySet<string>>;
|
|
8
|
+
/** Whether a file's default export has the shape of the expressions folder contract. */
|
|
9
|
+
export declare const isExpressionExport: (value: unknown) => value is Record<string, Record<string, AnyAnonymousExpression>>;
|
|
10
|
+
/**
|
|
11
|
+
* Merges the `src/expressions/` files (or `src/admin/expressions/`) into the expressions of each
|
|
12
|
+
* entity type. It checks each file against the folder contract, rejects an expression that two
|
|
13
|
+
* files, or two keys of one file, define for one entity type after the aliases of `aliasMap` are
|
|
14
|
+
* expanded, and rejects an expression listed in `valued`, which the application gives a value
|
|
15
|
+
* already. Each accepted expression gets its `origin`: its name and the entity type or alias the
|
|
16
|
+
* file keys it by.
|
|
17
|
+
*
|
|
18
|
+
* Each file is checked on its own: a wrong file is recorded in `errors` with all its conflicts and
|
|
19
|
+
* left out, and the files after it still merge. Without `errors`, everything recorded is thrown at
|
|
20
|
+
* the end as one `ImplementationErrors`.
|
|
21
|
+
*/
|
|
22
|
+
export declare const mergeExpressionModules: (modules: readonly ProjectModule[], aliasMap: AliasMap, errors?: ImplementationErrorCollector, valued?: ValuedExpressions) => AnyExpressions;
|
|
23
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{ImplementationError as e,ImplementationErrors as o,createImplementationErrorCollector as t}from"../../errors/index.js";import{SHARED_FOLDER_HINT as i,createContractError as n,isRecord as r}from"./project-modules.js";let s={expected:"an object of expressions keyed by entity type or alias, then by expression name",fix:`Create it with phx.domain.implementCustomExpressions({ ... }) (phx.domain.admin.implementCustomExpressions({ ... }) under src/admin/), ${i}.`},a=e=>r(e)&&"function"==typeof e.evaluate,p=e=>r(e)&&Object.values(e).every(a);export const isExpressionExport=e=>r(e)&&Object.values(e).every(p);let l=(o,t,i)=>new e({code:"DUPLICATE_DEFINITION",origin:o,problem:`Duplicate expression ${t}`,fix:i}),d=(e,t,i,r)=>{if(!isExpressionExport(e.exports))throw n(e,s,e.exports);let a=[],p=new Map,d=[];for(let[o,n]of Object.entries(e.exports))for(let s of t[o]??[o])for(let[t,f]of Object.entries(n)){let n=`${s}.${t}`,h=p.get(n),m=i.get(n);r.get(s)?.has(t)?d.push(l(e.origin,n,"The application already gives it a value (an $eval, $msg or read in the spec, a relation, the $violations of its invariants, or a built-in expression of the SDK), so this implementation would be ignored. Remove it from the file, or declare the expression in the spec with a type and no value.")):void 0!==h?d.push(l(e.origin,n,`The file defines it on both ${h} and ${o}, so its value would depend on the order the definitions are merged in. Define it once, on the alias or on the entity type.`)):void 0!==m&&d.push(l(e.origin,n,`It is also defined in ${m}, so its value would depend on file order. Keep one definition and remove the other.`)),p.set(n,o),a.push({key:n,entityType:s,typeOrAlias:o,name:t,expression:f})}if(d.length>0)throw new o(d);return a};export const mergeExpressionModules=(e,o,i,n=new Map)=>{let r=i??t(),s=new Map,a={};for(let t of e)for(let{key:e,entityType:i,typeOrAlias:p,name:l,expression:f}of r.attempt(()=>d(t,o,s,n),[]))s.set(e,t.origin),a[i]={...a[i],[l]:{...f,origin:{name:l,typeOrAlias:p}}};return void 0===i&&r.throwIfAny(),a};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { AnonymousExpression } from '../../../core/index.js';
|
|
2
|
-
import {
|
|
2
|
+
import type { ProjectModule } from './project-modules.js';
|
|
3
3
|
/** The expressions of one validated expression file, keyed by entity type or alias, then by expression name. */
|
|
4
4
|
export interface ExpressionModule {
|
|
5
5
|
readonly origin: string;
|
|
@@ -7,9 +7,8 @@ export interface ExpressionModule {
|
|
|
7
7
|
}
|
|
8
8
|
type AnyAnonymousExpression = AnonymousExpression<any, any, any, any, any, any, unknown>;
|
|
9
9
|
/**
|
|
10
|
-
* Validates the `src/expressions/` files
|
|
11
|
-
*
|
|
12
|
-
* aliases at different points; within one file the builder's own duplicate check applies.
|
|
10
|
+
* Validates the `src/expressions/` files with the checks of {@link mergeExpressionModules}, throws
|
|
11
|
+
* everything they find as one `ImplementationErrors`, and returns each file on its own, unmerged.
|
|
13
12
|
*/
|
|
14
13
|
export declare const resolveExpressionModules: (modules: readonly ProjectModule[], aliasMap: Readonly<Record<string, readonly string[]>>) => readonly ExpressionModule[];
|
|
15
14
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{isExpressionExport as e,mergeExpressionModules as o}from"./merge-expression-modules.js";export const resolveExpressionModules=(s,r)=>(o(s,r),s.flatMap(o=>e(o.exports)?[{origin:o.origin,expressions:o.exports}]:[]));
|
|
@@ -4,7 +4,10 @@ interface Context {
|
|
|
4
4
|
}
|
|
5
5
|
export declare const createWebComponentActions: (context: Context) => {
|
|
6
6
|
setReadonly: (readonlyValue: boolean) => void;
|
|
7
|
+
setLocale: (locale: string) => void;
|
|
7
8
|
startNewGeneration: () => void;
|
|
8
9
|
};
|
|
9
10
|
export type WebComponentActions = ReturnType<typeof createWebComponentActions>;
|
|
11
|
+
/** The writers the host-property mirror needs: the public `setReadonly` and the internal `setLocale`. */
|
|
12
|
+
export type WebComponentHostActions = Pick<WebComponentActions, 'setReadonly' | 'setLocale'>;
|
|
10
13
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export const createWebComponentActions=e=>({setReadonly:t=>{e.setWebComponentState(e=>({...e,readonly:t}))},startNewGeneration:()=>{e.setWebComponentState(e=>({...e,webcomponentGeneration:e.webcomponentGeneration+1}))}});
|
|
1
|
+
export const createWebComponentActions=e=>({setReadonly:t=>{e.setWebComponentState(e=>({...e,readonly:t}))},setLocale:t=>{e.setWebComponentState(e=>({...e,locale:t}))},startNewGeneration:()=>{e.setWebComponentState(e=>({...e,webcomponentGeneration:e.webcomponentGeneration+1}))}});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export const initializeWebComponent=()=>({readonly:!1,webcomponentGeneration:0});
|
|
1
|
+
import{DEFAULT_FALLBACK_LOCALE as e}from"#package/i18n";export const initializeWebComponent=()=>({readonly:!1,locale:e,webcomponentGeneration:0});
|
|
@@ -8,6 +8,8 @@ interface Context {
|
|
|
8
8
|
export declare const createWebComponentSelectors: (context: Context) => {
|
|
9
9
|
selectReadonly: import("@salsita-ai/common/utils").Selector<WebComponentSelectorState, boolean>;
|
|
10
10
|
getReadonly: () => boolean;
|
|
11
|
+
selectLocale: import("@salsita-ai/common/utils").Selector<WebComponentSelectorState, string>;
|
|
12
|
+
getLocale: () => string;
|
|
11
13
|
getWebcomponentGeneration: () => number;
|
|
12
14
|
};
|
|
13
15
|
export type WebComponentSelectors = ReturnType<typeof createWebComponentSelectors>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{createSelector as e}from"@salsita-ai/common/utils";export const createWebComponentSelectors=o=>{let{getState:n}=o,t=e.withTypes(),a=t([t.leaf(e=>e.webComponent.readonly)],e=>e),
|
|
1
|
+
import{createSelector as e}from"@salsita-ai/common/utils";export const createWebComponentSelectors=o=>{let{getState:n}=o,t=e.withTypes(),a=t([t.leaf(e=>e.webComponent.readonly)],e=>e),l=t.leaf(e=>e.webComponent.locale),m=t([t.leaf(e=>e.webComponent.webcomponentGeneration)],e=>e);return{selectReadonly:a,getReadonly:()=>a(n()),selectLocale:l,getLocale:()=>l(n()),getWebcomponentGeneration:()=>m(n())}};
|
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Runtime-owned web-component state shared by configurator and admin applications.
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
* `
|
|
6
|
-
*
|
|
4
|
+
* The application runtime mirrors the host properties a domain system reads, `readonly` and
|
|
5
|
+
* `locale`, from the element into this slice, so non-React domain systems read them from runtime
|
|
6
|
+
* selectors. The element's property storage stays their source.
|
|
7
7
|
*/
|
|
8
8
|
export interface ApplicationWebComponentState {
|
|
9
|
+
/** The host's `readonly` property; the effective mode derives from it. */
|
|
9
10
|
readonly readonly: boolean;
|
|
11
|
+
/** The host's `locale` property as set, not resolved against the available locales. */
|
|
12
|
+
readonly locale: string;
|
|
10
13
|
/**
|
|
11
14
|
* Bumped when the host moves the custom element in the DOM and the element is reconnected with
|
|
12
15
|
* its React tree retained. A move resets the CSSOM of every speedy emotion `<style>` tag inside
|
|
@@ -341,6 +341,8 @@ export declare const createMockDomainRuntime: <ENTITIES extends DomainEntity<str
|
|
|
341
341
|
webComponent: {
|
|
342
342
|
selectReadonly: import("@salsita-ai/common/utils").Selector<import("../index.js").WebComponentSelectorState, boolean>;
|
|
343
343
|
getReadonly: () => boolean;
|
|
344
|
+
selectLocale: import("@salsita-ai/common/utils").Selector<import("../index.js").WebComponentSelectorState, string>;
|
|
345
|
+
getLocale: () => string;
|
|
344
346
|
getWebcomponentGeneration: () => number;
|
|
345
347
|
};
|
|
346
348
|
domainContext: {
|
|
@@ -414,6 +416,7 @@ export declare const createMockDomainRuntime: <ENTITIES extends DomainEntity<str
|
|
|
414
416
|
getMigrate: () => import("../index.js").MigrateFunction<DomainEntity<string>>;
|
|
415
417
|
getActiveMode: () => import("../index.js").DomainMode;
|
|
416
418
|
getIsInitialized: () => boolean;
|
|
419
|
+
getIsViewMode: () => boolean;
|
|
417
420
|
getComponentReaderIndexes: () => import("../index.js").ComponentReaderIndexes;
|
|
418
421
|
getStoreRuntimeDependencies: () => {
|
|
419
422
|
componentReaderIndexes: import("../index.js").ComponentReaderIndexes;
|
|
@@ -523,6 +526,7 @@ export declare const createMockDomainRuntime: <ENTITIES extends DomainEntity<str
|
|
|
523
526
|
getMigrate: () => import("../index.js").MigrateFunction<DomainEntity<string>>;
|
|
524
527
|
getActiveMode: () => import("../index.js").DomainMode;
|
|
525
528
|
getIsInitialized: () => boolean;
|
|
529
|
+
getIsViewMode: () => boolean;
|
|
526
530
|
getComponentReaderIndexes: () => import("../index.js").ComponentReaderIndexes;
|
|
527
531
|
getStoreRuntimeDependencies: () => {
|
|
528
532
|
componentReaderIndexes: import("../index.js").ComponentReaderIndexes;
|
|
@@ -627,6 +631,9 @@ export declare const createMockDomainRuntime: <ENTITIES extends DomainEntity<str
|
|
|
627
631
|
};
|
|
628
632
|
};
|
|
629
633
|
};
|
|
634
|
+
hostMirrorActions: {
|
|
635
|
+
setLocale: (locale: string) => void;
|
|
636
|
+
};
|
|
630
637
|
getState: () => import("../index.js").DomainRuntimeState;
|
|
631
638
|
subscribe: (callback: () => void) => () => void;
|
|
632
639
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as e}from"react/jsx-runtime";import r from"lodash-es/debounce.js";import t from"promise-queue";import{createContext as o,useCallback as n,useContext as i,useEffect as s,useMemo as a,useRef as c,useState as
|
|
1
|
+
import{jsx as e}from"react/jsx-runtime";import r from"lodash-es/debounce.js";import t from"promise-queue";import{createContext as o,useCallback as n,useContext as i,useEffect as s,useMemo as a,useRef as c,useState as l}from"react";import{match as m}from"ts-pattern";import{ApplicationRuntime as u,BinaryFile as p,RawProjectFiles as d,RuntimeReferenceStore as g,TextFile as f,buildPhoenixDefinitions as v,isConfiguratorModelSchemaCompatible as S,isTextFile as h,parseApplicationFiles as y}from"#package/application-spec";import{createImplementationErrorCollector as E,findActionImplementationConflicts as x,getAllPhxDefinitions as A}from"#package/domain";import{useApplicationRuntime as C,useMountGuard as D}from"#package/react-sdk";import{useEditorConnection as w}from"../services/EditorConnectionContext.js";import{trpc as N}from"../services/trpc.js";import{applyRuntimeReset as P,applySpecUpdate as R,prepareRuntimeRefresh as _,prepareRuntimeReset as j}from"./apply-spec-update.js";import{useDiagnostics as I}from"./use-diagnostics.js";import{useImplementationFiles as L}from"./use-implementation-files.js";import{getWasmSwcParsers as k}from"./wasm-swc-parsers.js";let b=o(null),M={debug:e=>console.debug(e)},O=e=>e instanceof Error?e.message:String(e);export const DomainSpecProvider=o=>{let{children:i,domainSpec:T,initialRawProjectFiles:$}=o,[F,z]=l(a(()=>T?[{fileName:"domain.yaml",content:T}]:$?$.files.filter(h).map(e=>({fileName:e.name,content:e.content})):[],[T,$])),[H,q]=l(null),U=a(()=>new g,[]),G=a(()=>v(A()),[]),Q=c(null),B=C(),{getImplementationFiles:V}=L(),{diagnostics:Y,unreadDiagnosticCount:Z,setDiagnostics:J,pushDiagnostic:K,clearDiagnostics:W,markDiagnosticsRead:X}=I(),ee=a(()=>new t(1,1/0),[]),er=c(0),et=c(null),{mutateAsync:eo}=N.requestSpecFiles.useMutation(),{mutateAsync:en}=N.save.useMutation(),ei=D(),{localMode:es,connectionStatus:ea}=w(),{data:ec}=N.getEditorConfig.useQuery(void 0,{enabled:!es&&"connected"===ea}),el=es||ec?.specSync===!0,em=F.length>0?F:void 0,eu=a(()=>F.map(e=>e.fileName),[F]),ep=a(()=>r(async e=>{if(!es&&"connected"===ea&&0!==e.length)try{await en(e.map(e=>({fileName:e.fileName,content:e.content})))}catch(e){console.error("[DomainSpecContext] Failed to save files to disk:",e)}},1e3),[es,ea,en]);s(()=>()=>{ep.cancel()},[ep]);let ed=n(()=>{q(null)},[]),eg=n(async(e,r)=>{z(t=>{let o=t.find(r=>r.fileName===e)?t.map(t=>t.fileName===e?{...t,content:r}:t):[...t,{fileName:e,content:r}];return ep(o),o})},[ep]),ef=n(async(e,r)=>{let t,o,n=()=>ei()&&er.current===r;if(!n())return;let i=d(e.rawProjectFiles.files.map(e=>m(e).with({kind:"text"},e=>f(e.name,e.content)).with({kind:"binary"},e=>p(e.name)).exhaustive()));z(i.files.filter(h).map(e=>({fileName:e.name,content:e.content})));try{t=await k()}catch(e){if(!n())return;J([{code:"MODULE_ANALYZER_UNAVAILABLE",message:`The editor's module analyzer failed to load: ${e instanceof Error?e.message:String(e)}`,severity:"error",source:"spec",path:[]}]);return}if(!n())return;let s=y({rawProjectFiles:i,phxDefinitions:G},{analyzer:t.analyzer,evalExpressionParser:t.evalExpressionParser,referenceStore:U,logger:M});if(console.info(`[DomainSpecContext] Spec parsed: ${s.ok?"ok":"error"}, ${s.diagnostics.length} diagnostics`),!s.ok)return void J([...s.errors,...s.diagnostics].map(e=>({...e,source:"spec"})));W();let{applicationSpec:a}=s.value,c=await V({application:s.value,projectRoot:e.projectRoot});if(!n())return;if(c.errors.length>0)return void J(c.errors.map(e=>({code:e.code,message:e.message,severity:"error",source:"reload",path:[]})));let l=x([...a.configurator.actions.values()].map(e=>String(e.name)),c.actionImplementations??B.getState().spec.configurator.actionImplementations);if(l.extra.length>0&&console.error(`[DomainSpecContext] Action implementations without a declaration: ${l.extra.join(", ")}`),l.missing.length>0){let e=`Missing action implementations: ${l.missing.join(", ")}. Add each to a default export of phx.domain.implementActions({ ... }) in src/actions/.`;console.error(`[DomainSpecContext] ${e}`),K({code:"MISSING_ACTION_IMPLEMENTATIONS",message:e,severity:"error",source:"runtime"});return}let g=E(),v=u(a,U,c.expressionModules,c.importedTransformers,c.invariantImplementations,c.adminExpressionModules,void 0,void 0,void 0,g);for(let e of g.recorded())console.error(`[DomainSpecContext] ${e.message}`),K({code:e.code,message:e.message,severity:"error",source:"runtime"});if(!v.ok)return void U.clear();let{runtime:A}=v,C=null===Q.current||S(Q.current.configurator,a.configurator),D=B.selectors.environment.getPersistenceConfig();if(!C){let e;if("server"===D.type)return void K({code:"HOT_RELOAD_MODEL_CHANGE_REQUIRES_RESTART",message:"Domain model changes require an application restart and were not applied.",severity:"error",source:"runtime"});if(!B.selectors.domainContext.configurator.getInitializationState().isCurrent)return void B.selectors.domainServices.getLogger().debug("[DomainSpecContext] Skipping the model reset because no configurator session is initialized; the change applies once a session loads under the new spec.");try{e=j({runtime:A,implementationFiles:c,previousSpec:B.getState().spec})}catch(e){K({code:"HOT_RELOAD_PREPARE_FAILED",message:O(e),severity:"error",source:"runtime"});return}for(let r of(B.selectors.domainServices.getLogger().debug("[DomainSpecContext] Reseeding the reset session directly from the spec preset; onPresetLoadedHandler and ProductSelected analytics are intentionally skipped."),P(B,e,B.selectors.domainApplicationContext.configurator.getConfigurationPersistSystem().revisionId$.value),Q.current=a,e.implementationErrors))K({code:r.code,message:r.message,severity:"error",source:"runtime"});return}try{o=_({runtime:A,implementationFiles:c,previousSpec:B.getState().spec})}catch(e){K({code:"HOT_RELOAD_PREPARE_FAILED",message:O(e),severity:"error",source:"runtime"});return}if(n())for(let e of(R(B,o),Q.current=a,o.implementationErrors))K({code:e.code,message:e.message,severity:"error",source:"runtime"})},[B,V,ei,G,K,U,J,W]),ev=c(null),eS=n(e=>{let r=er.current+1;er.current=r,et.current={data:e,generation:r},ee.add(async()=>{let e=et.current;e&&e.data!==ev.current&&(et.current=null,ev.current=e.data,await ef(e.data,e.generation))})},[ef,ee]);N.onSpecChange.useSubscription(void 0,{enabled:!es&&el,onData:eS}),s(()=>{!es&&el&&eo().catch(()=>{console.warn("[DomainSpecContext] Failed to request spec files")})},[eo,es,el]);let eh=a(()=>({files:em,fileNames:eu,updateFile:eg,parsing:!1,parseError:H,clearParseError:ed,diagnostics:Y,clearDiagnostics:W,unreadDiagnosticCount:Z,markDiagnosticsRead:X}),[em,eu,eg,H,ed,Y,W,Z,X]);return e(b.Provider,{value:eh,children:i})};export const useDomainSpecContext=()=>{let e=i(b);if(null===e)throw Error("useDomainSpecContext must be used within DomainSpecProvider");return e};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type ApplicationRuntime as GeneratedApplicationRuntime } from '#package/application-spec';
|
|
2
2
|
import { type ImplementationError, type ApplicationSpec as RuntimeApplicationSpec } from '#package/domain';
|
|
3
3
|
import type { ApplicationRuntime } from '#package/react-sdk';
|
|
4
4
|
import type { ImplementationFiles } from './use-implementation-files.js';
|
|
@@ -23,6 +23,7 @@ export interface PrepareRuntimeRefreshInput {
|
|
|
23
23
|
readonly implementationFiles: ImplementationFiles;
|
|
24
24
|
readonly previousSpec: RuntimeApplicationSpec;
|
|
25
25
|
}
|
|
26
|
+
/** Refreshes the configurator sections of the live spec while the model's schema stays. */
|
|
26
27
|
export declare const prepareRuntimeRefresh: (input: PrepareRuntimeRefreshInput) => PreparedRuntimeRefresh;
|
|
27
28
|
/** Rebuilds every model-owned configurator field for an incompatible schema replacement. */
|
|
28
29
|
export declare const prepareRuntimeReset: (input: PrepareRuntimeRefreshInput) => PreparedRuntimeReset;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{applicationSpecSlice as e}from"#package/application-spec";import{findAssistantFormElementErrors as t}from"#package/domain";import{getPhoenixThemes as o}from"#package/ui-sdk";let n=e=>({handlers:e.handlers,elements:e.elements,customComponentOptics:e.customComponentOptics,actionImplementations:e.actionImplementations}),r=({configurator:e})=>t(e.assistant?.formElements??[],e.elements);export const prepareRuntimeRefresh=t=>{let i=e({runtime:t.runtime,modules:n(t.implementationFiles),themePresets:o(),previous:t.previousSpec,model:"keep"});return{nextSpec:i,implementationErrors:r(i)}};export const prepareRuntimeReset=t=>{let i=e({runtime:t.runtime,modules:n(t.implementationFiles),themePresets:o(),previous:t.previousSpec,model:"rebuild"}),s=i.configurator.presets[0];if(void 0===s)throw Error("Cannot reset the configurator after a model change because the application spec has no presets.");return{firstPreset:s,nextSpec:i,implementationErrors:r(i)}};let i=(e,t)=>{e.actions.spec.updateSpec(t)};export const applyRuntimeRefresh=(e,t)=>i(e,t.nextSpec);export const applyRuntimeReset=(e,t,o)=>{i(e,t.nextSpec),e.actions.loadedData.completeConfiguratorLoad({initialRevisionId:o,initialEntities:t.firstPreset.initialDomainEntities,modelVersion:t.nextSpec.configurator.modelVersion,rootEntityType:t.firstPreset.rootEntityType,schemaIdentity:t.nextSpec.configurator.factory})};export const applySpecUpdate=(e,t)=>i(e,t.nextSpec);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Application,
|
|
1
|
+
import type { Application, InvariantImplementations } from '#package/application-spec';
|
|
2
2
|
import { type AnyActionImplementations, type DomainComponentOptic, type DomainEntity, type ElementRegistration, type HandlerRegistration, type ImportedTransformer, type ProjectModule, type SystemComponentTypeConstraint } from '#package/domain';
|
|
3
3
|
type RuntimeData = Record<string, unknown>;
|
|
4
4
|
type RuntimeEntity = DomainEntity<string>;
|
|
@@ -21,15 +21,17 @@ export interface ReloadError {
|
|
|
21
21
|
/**
|
|
22
22
|
* The freshly reloaded (or cached) implementation files needed to build an `ApplicationRuntime`.
|
|
23
23
|
*
|
|
24
|
-
* `
|
|
24
|
+
* `expressionModules` and `adminExpressionModules` are the expression files as imported, unchecked:
|
|
25
|
+
* `ApplicationRuntime` checks and merges them with the aliases of the spec being edited.
|
|
26
|
+
* `expressionModules`, `adminExpressionModules`, `invariantImplementations`, `importedTransformers` and `customComponentOptics` always contain the latest
|
|
25
27
|
* successfully loaded values. So does `actionImplementations`, which is `null` only until the first successful load: a round
|
|
26
28
|
* that loaded them may be dropped before it is applied, and the next round must still carry them.
|
|
27
29
|
* `handlers`/`elements` are `null` when their category did not change this round.
|
|
28
30
|
*/
|
|
29
31
|
export interface ImplementationFiles {
|
|
30
|
-
readonly
|
|
32
|
+
readonly expressionModules: readonly ProjectModule[];
|
|
31
33
|
readonly actionImplementations: AnyActionImplementations | null;
|
|
32
|
-
readonly
|
|
34
|
+
readonly adminExpressionModules?: readonly ProjectModule[];
|
|
33
35
|
readonly invariantImplementations: InvariantImplementations;
|
|
34
36
|
readonly importedTransformers: readonly ImportedTransformer[];
|
|
35
37
|
readonly customComponentOptics: readonly ReloadedComponentOptic[] | null;
|
|
@@ -41,17 +43,7 @@ export interface GetImplementationFilesProps {
|
|
|
41
43
|
readonly application: Application;
|
|
42
44
|
readonly projectRoot: string;
|
|
43
45
|
}
|
|
44
|
-
type ResolvedExpressions = ExpressionImplementations;
|
|
45
|
-
/**
|
|
46
|
-
* Validates the expression modules through the resolver the domain builder uses, then expands their
|
|
47
|
-
* aliases. The expansion stays here because the editor rebuilds expressions against the alias map of
|
|
48
|
-
* the spec being edited, where the built app's domain builder holds its own.
|
|
49
|
-
*/
|
|
50
|
-
export declare const mergeExpressionModules: (modules: readonly ProjectModule[], aliasMap: Record<string, readonly string[]>) => ResolvedExpressions;
|
|
51
46
|
export declare const mergeComponentOptics: <ComponentOptic>(generatedComponentOptics: readonly ComponentOptic[], customComponentOptics: readonly ComponentOptic[]) => readonly ComponentOptic[];
|
|
52
|
-
export declare const getCustomComponentOptics: <ComponentOptic extends {
|
|
53
|
-
readonly generated?: boolean;
|
|
54
|
-
}>(componentOptics: readonly ComponentOptic[]) => readonly ComponentOptic[];
|
|
55
47
|
/**
|
|
56
48
|
* Owns the should-reload gating and cross-update caching for project implementation files
|
|
57
49
|
* (expressions, actions, invariants, components, transformers, handlers, elements). Returns `getImplementationFiles`,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{useCallback as e,useRef as n}from"react";import{
|
|
1
|
+
import{useCallback as e,useRef as n}from"react";import{resolveActionModules as t,resolveComponentOpticModules as a,resolveElementModule as r,resolveHandlerModule as o,resolveInvariantModules as i,resolveTransformerModule as s}from"#package/domain";import{importImplementationFile as l}from"./import-implementation-file.js";let m=e=>e instanceof Error?e.message:String(e),c=async(e,n)=>{let t=Date.now();return Promise.all(e.map(async e=>({origin:e,exports:await l(`/@fs/${n}/${e}?t=${t}`)})))},p=async(e,n)=>t(await c(e,n));export const mergeComponentOptics=(e,n)=>e.concat(n);let u=async(e,n)=>a(await c(e,n)),d=async(e,n)=>i(await c(e,n)),f=async(e,n)=>(await c(e,n)).map(s),h=async(e,n)=>(await c(e,n)).map(e=>({filePath:e.origin,registrations:o(e)})),g=async(e,n)=>(await c(e,n)).map(e=>({filePath:e.origin,registrations:r(e)}));export const useImplementationFiles=()=>{let t=n([]),a=n(null),r=n([]),o=n(0),i=n(null),s=n({}),l=n(null),E=n(null),F=n(null),w=n([]),I=n(null),y=n(null),A=n(new Map),R=n(new Map);return{getImplementationFiles:e(async e=>{let{application:n,projectRoot:O}=e,D=++o.current,{applicationSpec:L,categorizedFiles:S}=n,C=[],_=t.current,$=r.current,v=s.current,x=F.current,N=w.current,M=S.expressionsChanged,P=S.actionsChanged,b=S.componentsChanged,H=S.transformersChanged,T=S.handlersChanged,k=S.elementsChanged,j=Object.fromEntries(S.invariants.map(e=>[e.file.name,e.depHash])),J=l.current,X=JSON.stringify(L.configurator.invariants.entries),V=null===J||E.current!==X||Object.keys(J).length!==S.invariants.length||S.invariants.some(e=>J[e.file.name]!==e.depHash);if(console.info(`[useImplementationFiles] Changed: spec=${S.specChanged}, expressions=${S.expressionsChanged}, actions=${S.actionsChanged}, adminExpressions=${S.adminExpressionsChanged}, transformers=${S.transformersChanged}, handlers=${S.handlersChanged}, elements=${S.elementsChanged}`),M){console.info("[useImplementationFiles] Reloading expression implementations");try{t.current=_=await c(S.expressions.map(e=>e.file.name),O)}catch(e){console.warn("[useImplementationFiles] Failed to reload expressions:",e),C.push({code:"RELOAD_EXPRESSIONS_FAILED",message:m(e)})}}let q=a.current;if(P){console.info("[useImplementationFiles] Reloading action implementations");try{a.current=q=await p(S.actions.map(e=>e.file.name),O)}catch(e){console.warn("[useImplementationFiles] Failed to reload actions:",e),C.push({code:"RELOAD_ACTIONS_FAILED",message:m(e)})}}let z=JSON.stringify({projectRoot:O,files:S.adminExpressions.map(e=>[e.file.name,e.depHash])});if(D===o.current&&i.current!==z)try{$=await c(S.adminExpressions.map(e=>e.file.name),O),D===o.current&&(r.current=$,i.current=z)}catch(e){C.push({code:"RELOAD_ADMIN_EXPRESSIONS_FAILED",message:m(e)})}if(b){console.info("[useImplementationFiles] Reloading component optics");try{F.current=x=await u(S.components.map(e=>e.file.name),O)}catch(e){console.warn("[useImplementationFiles] Failed to reload components:",e),C.push({code:"RELOAD_COMPONENTS_FAILED",message:m(e)})}}if(V){console.info("[useImplementationFiles] Reloading invariant implementations");try{s.current=v=await d(S.invariants.map(e=>e.file.name),O),l.current=j,E.current=X}catch(e){console.warn("[useImplementationFiles] Failed to reload invariants:",e),C.push({code:"RELOAD_INVARIANTS_FAILED",message:m(e)})}}if(H){console.info("[useImplementationFiles] Reloading transformer implementations");try{w.current=N=await f(S.transformers.map(e=>e.file.name),O)}catch(e){console.warn("[useImplementationFiles] Failed to reload transformers:",e),C.push({code:"RELOAD_TRANSFORMERS_FAILED",message:m(e)})}}let B=null;if(T){console.info("[useImplementationFiles] Reloading handler implementations");try{let e=Object.fromEntries(S.handlers.map(e=>[e.file.name,e.depHash])),n=I.current,t=t=>null===n||n[t]!==e[t],a=R.current,r=S.handlers.map(e=>e.file.name),o=r.filter(e=>t(e)||!a.has(e)),i=await h(o,O),s=new Map(i.map(e=>[e.filePath,e])),l=r.map(e=>{let n=s.get(e)??a.get(e);if(!n)throw Error(`Handler file "${e}" was neither re-imported nor cached from a previous round. This is a hot-reload bookkeeping bug — reload the editor page to recover.`);return n}),m=l.flatMap(e=>e.registrations),c={};for(let{filePath:n,registrations:a}of l){let r=t(n)?e[n]:void 0;if(r)for(let e of a)c[e.name]=r}console.info(`[useImplementationFiles] Staged handlers for registry (${m.length} total)`),B={handlers:m,nameHashes:c},R.current=new Map(l.map(e=>[e.filePath,e])),I.current=e}catch(e){console.warn("[useImplementationFiles] Failed to reload handlers:",e),C.push({code:"RELOAD_HANDLERS_FAILED",message:m(e)})}}let G=null;if(k){console.info("[useImplementationFiles] Reloading element implementations");try{let e=Object.fromEntries(S.elements.map(e=>[e.file.name,e.depHash])),n=y.current,t=t=>null===n||n[t]!==e[t],a=A.current,r=S.elements.map(e=>e.file.name),o=r.filter(e=>t(e)||!a.has(e)),i=await g(o,O),s=new Map(i.map(e=>[e.filePath,e])),l=r.map(e=>{let n=s.get(e)??a.get(e);if(!n)throw Error(`Element file "${e}" was neither re-imported nor cached from a previous round. This is a hot-reload bookkeeping bug — reload the editor page to recover.`);return n}),m=l.flatMap(e=>e.registrations),c={},p=0;for(let{filePath:n,registrations:a}of l){let r=t(n)?e[n]:void 0;for(let e of a)if("assistantFormElement"!==e.type){if("entity"===e.type||"layout"===e.type){r&&(c[e.name]=r);continue}r&&(c[`icon:${p}`]=r),p+=1}}console.info(`[useImplementationFiles] Staged elements for registry (${m.length} total)`),G={elements:m,nameHashes:c},A.current=new Map(l.map(e=>[e.filePath,e])),y.current=e}catch(e){console.warn("[useImplementationFiles] Failed to reload elements:",e),C.push({code:"RELOAD_ELEMENTS_FAILED",message:m(e)})}}return{expressionModules:_,actionImplementations:q,adminExpressionModules:$,invariantImplementations:v,importedTransformers:N,customComponentOptics:x,handlers:B,elements:G,errors:C}},[])}};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export declare const cacheVersion =
|
|
1
|
+
export declare const cacheVersion = 773;
|
|
2
2
|
export declare const needsRebuild: (fileContents: string[], outputDirectory: string) => Promise<boolean>;
|
|
3
3
|
export declare const writeCacheInfo: (fileContents: string[], outputDirectory: string) => Promise<void>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{createHash as e}from"crypto";import{existsSync as r}from"fs";import{readFile as t}from"fs/promises";import{isEqualArray as o}from"@salsita-ai/common/utils";import{writeFormatted as i}from"../gen/write-formatted.js";export const cacheVersion=
|
|
1
|
+
import{createHash as e}from"crypto";import{existsSync as r}from"fs";import{readFile as t}from"fs/promises";import{isEqualArray as o}from"@salsita-ai/common/utils";import{writeFormatted as i}from"../gen/write-formatted.js";export const cacheVersion=773;let s=r=>({version:773,files:r.map(r=>e("md5").update(r).digest("base64")).sort()});export const needsRebuild=async(e,i)=>{let a=`${i}/cache.json`;if(!r(a))return!0;try{let r=JSON.parse(await t(a,"utf-8")),i=s(e);return 773!==r.version||!o(r.files,i.files)}catch(e){return console.error("Failed to read cache file, forcing rebuild",e),!0}};export const writeCacheInfo=async(e,r)=>{let t=`${r}/cache.json`,o=s(e);await i(t,JSON.stringify(o,null,2))};
|