@salsita-ai/sdk 0.50.0-develop.f9cd9b3a12 → 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/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 +13 -0
- 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 +2 -1
- 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 +3 -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-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/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/docs/index.json +34 -1
- package/dist/docs/layouts/gallery/corvid-drone.mdx +3428 -0
- package/dist/docs/layouts/gallery/nightjar-guitar.mdx +3698 -0
- package/dist/docs/layouts/gallery/tidepool-aquascape.mdx +5203 -0
- package/dist/docs/phoenix/configurator-interface.mdx +4 -3
- package/dist/docs/phoenix/sdk-builder-workflow.mdx +4 -2
- 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/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-runtime.d.ts +36 -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 +5 -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/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 +1 -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/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 +2 -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/loading/types.js +1 -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/runtime/create-application-runtime.d.ts +218 -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/elements/index.d.ts +0 -1
- package/dist/react-sdk/index.d.ts +1 -0
- 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/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/{elements/configurator-error-page-props.js → application-runtime/host-properties/types.js} +0 -0
- /package/dist/react-sdk/{elements → page-elements}/configurator-error-page-props.d.ts +0 -0
|
@@ -1,13 +1,17 @@
|
|
|
1
1
|
import { BehaviorSubject } from 'rxjs';
|
|
2
|
-
import { type AnyApplicationConfig, type DomainRuntimeState, type WebComponentOptions } from '#package/domain';
|
|
2
|
+
import { type AnyApplicationConfig, type Application, type DomainRuntimeState, type WebComponentOptions } from '#package/domain';
|
|
3
3
|
import { type AnyApplicationRuntimeExtension, type DomainApplicationContextSelectors } from '../domain-application-context/index.js';
|
|
4
|
+
import { type HostPropertiesState } from '../host-properties/index.js';
|
|
4
5
|
import { type IntegrationState } from '../integration/index.js';
|
|
6
|
+
import { type LoadingRuntimeState } from '../loading/index.js';
|
|
5
7
|
import { type ResponsiveRuntimeState } from '../responsive/index.js';
|
|
6
8
|
import { type RoutingRuntimeState } from '../routing/index.js';
|
|
7
9
|
import { type ApplicationSessionRuntime, SessionService } from '../session/index.js';
|
|
8
10
|
import type { WebComponentApi } from '../web-component/index.js';
|
|
9
11
|
export interface ApplicationRuntimeState extends DomainRuntimeState {
|
|
12
|
+
readonly hostProperties: HostPropertiesState;
|
|
10
13
|
readonly integration: IntegrationState;
|
|
14
|
+
readonly loading: LoadingRuntimeState;
|
|
11
15
|
readonly responsive: ResponsiveRuntimeState;
|
|
12
16
|
readonly routing: RoutingRuntimeState;
|
|
13
17
|
readonly session: ApplicationSessionRuntime;
|
|
@@ -19,8 +23,19 @@ export interface ApplicationRuntimeBootConfig {
|
|
|
19
23
|
readonly webComponentOptions: WebComponentOptions;
|
|
20
24
|
readonly webComponentApi: WebComponentApi;
|
|
21
25
|
}
|
|
22
|
-
|
|
26
|
+
/**
|
|
27
|
+
* What an application runtime starts from: an application, or the config of a project built with
|
|
28
|
+
* `ConfiguratorBuilder`, which the runtime converts with `applicationFromConfig` when it creates its
|
|
29
|
+
* slices.
|
|
30
|
+
*/
|
|
31
|
+
type ApplicationRuntimeSource = {
|
|
32
|
+
readonly application: Application;
|
|
33
|
+
readonly config?: undefined;
|
|
34
|
+
} | {
|
|
23
35
|
readonly config: AnyApplicationConfig;
|
|
36
|
+
readonly application?: undefined;
|
|
37
|
+
};
|
|
38
|
+
type Props<State extends ApplicationRuntimeState, CONFIGURATOR_EXTENSIONS extends readonly AnyApplicationRuntimeExtension[]> = ApplicationRuntimeSource & {
|
|
24
39
|
readonly bootConfig: ApplicationRuntimeBootConfig;
|
|
25
40
|
readonly getSubject: () => BehaviorSubject<State>;
|
|
26
41
|
/**
|
|
@@ -28,10 +43,11 @@ interface Props<State extends ApplicationRuntimeState, CONFIGURATOR_EXTENSIONS e
|
|
|
28
43
|
* breaks the construction cycle while the extension factory receives the base runtime slices.
|
|
29
44
|
*/
|
|
30
45
|
readonly getConfiguratorExtensions: () => CONFIGURATOR_EXTENSIONS | null;
|
|
31
|
-
}
|
|
46
|
+
};
|
|
32
47
|
/**
|
|
33
48
|
* The domain-application layer: the domain runtime plus the browser-application concerns React
|
|
34
|
-
* needs — common services, integration, routing, session — and the
|
|
49
|
+
* needs — common services, host properties, integration, routing, session, loading — and the
|
|
50
|
+
* domain-application system pair.
|
|
35
51
|
*
|
|
36
52
|
* Slices rather than a runtime: the caller owns the `BehaviorSubject`, so a layer above can widen
|
|
37
53
|
* the state type and still have every slice here write into the same subject. Mirrors
|
|
@@ -49,11 +65,19 @@ export declare function createApplicationRuntimeSlices<State extends Application
|
|
|
49
65
|
access: import("#package/domain").ApplicationAccessInfo;
|
|
50
66
|
webComponent: import("#package/domain").ApplicationWebComponentState;
|
|
51
67
|
domainContext: import("#package/domain").ApplicationDomainContextState;
|
|
68
|
+
hostProperties: HostPropertiesState;
|
|
52
69
|
integration: IntegrationState;
|
|
70
|
+
loading: LoadingRuntimeState;
|
|
53
71
|
responsive: ResponsiveRuntimeState;
|
|
54
72
|
routing: RoutingRuntimeState;
|
|
55
73
|
session: ApplicationSessionRuntime;
|
|
56
74
|
};
|
|
75
|
+
/**
|
|
76
|
+
* Starts the runtime-owned subscription that mirrors the element's properties into
|
|
77
|
+
* `hostProperties` and the domain's `webComponent`, each property by its scope. The subject
|
|
78
|
+
* owner calls it once, right after creating the subject from `initialize()`.
|
|
79
|
+
*/
|
|
80
|
+
connectHost: () => () => void;
|
|
57
81
|
selectors: {
|
|
58
82
|
domainServices: {
|
|
59
83
|
getAnalyticsService: () => import("#package/domain").AnalyticsSystem;
|
|
@@ -354,6 +378,8 @@ export declare function createApplicationRuntimeSlices<State extends Application
|
|
|
354
378
|
webComponent: {
|
|
355
379
|
selectReadonly: import("@salsita-ai/common/utils").Selector<import("#package/domain").WebComponentSelectorState, boolean>;
|
|
356
380
|
getReadonly: () => boolean;
|
|
381
|
+
selectLocale: import("@salsita-ai/common/utils").Selector<import("#package/domain").WebComponentSelectorState, string>;
|
|
382
|
+
getLocale: () => string;
|
|
357
383
|
getWebcomponentGeneration: () => number;
|
|
358
384
|
};
|
|
359
385
|
domainContext: {
|
|
@@ -602,6 +628,65 @@ export declare function createApplicationRuntimeSlices<State extends Application
|
|
|
602
628
|
getCreateAdminAuthorizedClient: () => (accessToken: string) => import("../index.js").RuntimeAuthorizedClient;
|
|
603
629
|
getUnauthenticatedClient: () => import("../../../client/contract.js").UnauthenticatedPhoenixApiClient;
|
|
604
630
|
};
|
|
631
|
+
hostProperties: {
|
|
632
|
+
getHostPropertySelector: <NAME extends import("../index.js").HostPropertyName>(name: NAME) => {
|
|
633
|
+
readonly adminSessionToken: import("@salsita-ai/common/utils").Selector<import("../host-properties/selectors.js").HostPropertiesSelectorState, string | undefined>;
|
|
634
|
+
readonly authorizationCode: import("@salsita-ai/common/utils").Selector<import("../host-properties/selectors.js").HostPropertiesSelectorState, string | undefined>;
|
|
635
|
+
readonly expanded: import("@salsita-ai/common/utils").Selector<import("../host-properties/selectors.js").HostPropertiesSelectorState, boolean>;
|
|
636
|
+
readonly integrationMode: import("@salsita-ai/common/utils").Selector<import("../host-properties/selectors.js").HostPropertiesSelectorState, "handoff" | "headless" | "page" | "widget">;
|
|
637
|
+
readonly mode: import("@salsita-ai/common/utils").Selector<import("../host-properties/selectors.js").HostPropertiesSelectorState, "admin" | "configurator" | "standalone-admin">;
|
|
638
|
+
readonly power: import("@salsita-ai/common/utils").Selector<import("../host-properties/selectors.js").HostPropertiesSelectorState, "off" | "on" | "standby">;
|
|
639
|
+
readonly presetTags: import("@salsita-ai/common/utils").Selector<import("../host-properties/selectors.js").HostPropertiesSelectorState, string[] | null>;
|
|
640
|
+
readonly refreshToken: import("@salsita-ai/common/utils").Selector<import("../host-properties/selectors.js").HostPropertiesSelectorState, string | undefined>;
|
|
641
|
+
readonly route: import("@salsita-ai/common/utils").Selector<import("../host-properties/selectors.js").HostPropertiesSelectorState, {
|
|
642
|
+
route: "Index";
|
|
643
|
+
} | {
|
|
644
|
+
route: "Configuration";
|
|
645
|
+
configurationId: string;
|
|
646
|
+
accessToken?: string | undefined;
|
|
647
|
+
} | {
|
|
648
|
+
readonly route: "Index";
|
|
649
|
+
}>;
|
|
650
|
+
readonly sessionToken: import("@salsita-ai/common/utils").Selector<import("../host-properties/selectors.js").HostPropertiesSelectorState, string | undefined>;
|
|
651
|
+
}[NAME];
|
|
652
|
+
selectRoute: import("@salsita-ai/common/utils").Selector<import("../host-properties/selectors.js").HostPropertiesSelectorState, {
|
|
653
|
+
route: "Index";
|
|
654
|
+
} | {
|
|
655
|
+
route: "Configuration";
|
|
656
|
+
configurationId: string;
|
|
657
|
+
accessToken?: string | undefined;
|
|
658
|
+
} | {
|
|
659
|
+
readonly route: "Index";
|
|
660
|
+
}>;
|
|
661
|
+
selectExpanded: import("@salsita-ai/common/utils").Selector<import("../host-properties/selectors.js").HostPropertiesSelectorState, boolean>;
|
|
662
|
+
selectMode: import("@salsita-ai/common/utils").Selector<import("../host-properties/selectors.js").HostPropertiesSelectorState, "admin" | "configurator" | "standalone-admin">;
|
|
663
|
+
selectPower: import("@salsita-ai/common/utils").Selector<import("../host-properties/selectors.js").HostPropertiesSelectorState, "off" | "on" | "standby">;
|
|
664
|
+
selectPresetTags: import("@salsita-ai/common/utils").Selector<import("../host-properties/selectors.js").HostPropertiesSelectorState, string[] | null>;
|
|
665
|
+
selectIntegrationMode: import("@salsita-ai/common/utils").Selector<import("../host-properties/selectors.js").HostPropertiesSelectorState, "handoff" | "headless" | "page" | "widget">;
|
|
666
|
+
selectSessionToken: import("@salsita-ai/common/utils").Selector<import("../host-properties/selectors.js").HostPropertiesSelectorState, string | undefined>;
|
|
667
|
+
selectAdminSessionToken: import("@salsita-ai/common/utils").Selector<import("../host-properties/selectors.js").HostPropertiesSelectorState, string | undefined>;
|
|
668
|
+
selectRefreshToken: import("@salsita-ai/common/utils").Selector<import("../host-properties/selectors.js").HostPropertiesSelectorState, string | undefined>;
|
|
669
|
+
selectAuthorizationCode: import("@salsita-ai/common/utils").Selector<import("../host-properties/selectors.js").HostPropertiesSelectorState, string | undefined>;
|
|
670
|
+
getHostProperty: <NAME extends import("../index.js").HostPropertyName>(name: NAME) => HostPropertiesState[NAME];
|
|
671
|
+
getRoute: () => {
|
|
672
|
+
route: "Index";
|
|
673
|
+
} | {
|
|
674
|
+
route: "Configuration";
|
|
675
|
+
configurationId: string;
|
|
676
|
+
accessToken?: string | undefined;
|
|
677
|
+
} | {
|
|
678
|
+
readonly route: "Index";
|
|
679
|
+
};
|
|
680
|
+
getExpanded: () => boolean;
|
|
681
|
+
getMode: () => "admin" | "configurator" | "standalone-admin";
|
|
682
|
+
getPower: () => "off" | "on" | "standby";
|
|
683
|
+
getPresetTags: () => string[] | null;
|
|
684
|
+
getIntegrationMode: () => "handoff" | "headless" | "page" | "widget";
|
|
685
|
+
getSessionToken: () => string | undefined;
|
|
686
|
+
getAdminSessionToken: () => string | undefined;
|
|
687
|
+
getRefreshToken: () => string | undefined;
|
|
688
|
+
getAuthorizationCode: () => string | undefined;
|
|
689
|
+
};
|
|
605
690
|
integration: {
|
|
606
691
|
selectIntegrationState: import("@salsita-ai/common/utils").Selector<import("../index.js").IntegrationSelectorState, IntegrationState>;
|
|
607
692
|
selectEmbeddedView: import("@salsita-ai/common/utils").Selector<import("../index.js").IntegrationSelectorState, import("../index.js").EmbeddedView>;
|
|
@@ -613,6 +698,18 @@ export declare function createApplicationRuntimeSlices<State extends Application
|
|
|
613
698
|
getPresetEmbeddedState: () => import("../index.js").PresetEmbeddedView | null;
|
|
614
699
|
getRecipeEmbeddedState: () => import("../index.js").RecipeEmbeddedView | null;
|
|
615
700
|
};
|
|
701
|
+
loading: {
|
|
702
|
+
configurator: {
|
|
703
|
+
selectLoadingState: import("@salsita-ai/common/utils").Selector<import("../loading/selectors.js").LoadingSelectorState, import("../index.js").LoadingState>;
|
|
704
|
+
getLoadingState: () => import("../index.js").LoadingState;
|
|
705
|
+
getIsAwaitingPhase: (id: string) => boolean;
|
|
706
|
+
};
|
|
707
|
+
admin: {
|
|
708
|
+
selectLoadingState: import("@salsita-ai/common/utils").Selector<import("../loading/selectors.js").LoadingSelectorState, import("../index.js").LoadingState>;
|
|
709
|
+
getLoadingState: () => import("../index.js").LoadingState;
|
|
710
|
+
getIsAwaitingPhase: (id: string) => boolean;
|
|
711
|
+
};
|
|
712
|
+
};
|
|
616
713
|
responsive: {
|
|
617
714
|
configurator: {
|
|
618
715
|
selectResponsiveState: import("@salsita-ai/common/utils").Selector<import("../responsive/selectors.js").ResponsiveSelectorState, import("../index.js").ResponsiveState>;
|
|
@@ -726,6 +823,26 @@ export declare function createApplicationRuntimeSlices<State extends Application
|
|
|
726
823
|
enterEmbeddedView: (view: import("../index.js").EmbeddedView) => void;
|
|
727
824
|
exitEmbeddedView: () => void;
|
|
728
825
|
};
|
|
826
|
+
loading: {
|
|
827
|
+
configurator: {
|
|
828
|
+
startPhase: (phase: import("../index.js").LoadingPhase) => void;
|
|
829
|
+
endPhase: (id: string) => void;
|
|
830
|
+
reportError: () => void;
|
|
831
|
+
clearError: () => void;
|
|
832
|
+
expectPhase: (id: string) => void;
|
|
833
|
+
dropExpectation: (id: string) => void;
|
|
834
|
+
resetSlot: () => void;
|
|
835
|
+
};
|
|
836
|
+
admin: {
|
|
837
|
+
startPhase: (phase: import("../index.js").LoadingPhase) => void;
|
|
838
|
+
endPhase: (id: string) => void;
|
|
839
|
+
reportError: () => void;
|
|
840
|
+
clearError: () => void;
|
|
841
|
+
expectPhase: (id: string) => void;
|
|
842
|
+
dropExpectation: (id: string) => void;
|
|
843
|
+
resetSlot: () => void;
|
|
844
|
+
};
|
|
845
|
+
};
|
|
729
846
|
responsive: {
|
|
730
847
|
configurator: {
|
|
731
848
|
setViewport: (viewport: import("../index.js").ResponsiveViewport) => void;
|
|
@@ -760,13 +877,13 @@ export declare function createApplicationRuntimeSlices<State extends Application
|
|
|
760
877
|
};
|
|
761
878
|
};
|
|
762
879
|
export type ApplicationRuntimeSlices = ReturnType<typeof createApplicationRuntimeSlices>;
|
|
763
|
-
export type ApplicationRuntimeExtensionContext = Omit<ApplicationRuntimeSlices, 'initialize'>;
|
|
880
|
+
export type ApplicationRuntimeExtensionContext = Omit<ApplicationRuntimeSlices, 'initialize' | 'connectHost'>;
|
|
764
881
|
export type CreateApplicationRuntimeExtensions<EXTENSIONS extends readonly AnyApplicationRuntimeExtension[]> = (runtime: ApplicationRuntimeExtensionContext) => EXTENSIONS;
|
|
765
882
|
/**
|
|
766
883
|
* The application runtime owns the subject and merges a caller-defined system extension into the
|
|
767
884
|
* built-in domain-application systems. Every extension system participates in initialization.
|
|
768
885
|
*/
|
|
769
|
-
declare const createApplicationRuntimeImpl: <EXTENSIONS extends readonly AnyApplicationRuntimeExtension[]>(
|
|
886
|
+
declare const createApplicationRuntimeImpl: <EXTENSIONS extends readonly AnyApplicationRuntimeExtension[]>(source: AnyApplicationConfig | Application, bootConfig: ApplicationRuntimeBootConfig, createExtensions?: CreateApplicationRuntimeExtensions<EXTENSIONS>) => {
|
|
770
887
|
selectors: {
|
|
771
888
|
domainServices: {
|
|
772
889
|
getAnalyticsService: () => import("#package/domain").AnalyticsSystem;
|
|
@@ -1067,6 +1184,8 @@ declare const createApplicationRuntimeImpl: <EXTENSIONS extends readonly AnyAppl
|
|
|
1067
1184
|
webComponent: {
|
|
1068
1185
|
selectReadonly: import("@salsita-ai/common/utils").Selector<import("#package/domain").WebComponentSelectorState, boolean>;
|
|
1069
1186
|
getReadonly: () => boolean;
|
|
1187
|
+
selectLocale: import("@salsita-ai/common/utils").Selector<import("#package/domain").WebComponentSelectorState, string>;
|
|
1188
|
+
getLocale: () => string;
|
|
1070
1189
|
getWebcomponentGeneration: () => number;
|
|
1071
1190
|
};
|
|
1072
1191
|
domainContext: {
|
|
@@ -1315,6 +1434,65 @@ declare const createApplicationRuntimeImpl: <EXTENSIONS extends readonly AnyAppl
|
|
|
1315
1434
|
getCreateAdminAuthorizedClient: () => (accessToken: string) => import("../index.js").RuntimeAuthorizedClient;
|
|
1316
1435
|
getUnauthenticatedClient: () => import("../../../client/contract.js").UnauthenticatedPhoenixApiClient;
|
|
1317
1436
|
};
|
|
1437
|
+
hostProperties: {
|
|
1438
|
+
getHostPropertySelector: <NAME extends import("../index.js").HostPropertyName>(name: NAME) => {
|
|
1439
|
+
readonly adminSessionToken: import("@salsita-ai/common/utils").Selector<import("../host-properties/selectors.js").HostPropertiesSelectorState, string | undefined>;
|
|
1440
|
+
readonly authorizationCode: import("@salsita-ai/common/utils").Selector<import("../host-properties/selectors.js").HostPropertiesSelectorState, string | undefined>;
|
|
1441
|
+
readonly expanded: import("@salsita-ai/common/utils").Selector<import("../host-properties/selectors.js").HostPropertiesSelectorState, boolean>;
|
|
1442
|
+
readonly integrationMode: import("@salsita-ai/common/utils").Selector<import("../host-properties/selectors.js").HostPropertiesSelectorState, "handoff" | "headless" | "page" | "widget">;
|
|
1443
|
+
readonly mode: import("@salsita-ai/common/utils").Selector<import("../host-properties/selectors.js").HostPropertiesSelectorState, "admin" | "configurator" | "standalone-admin">;
|
|
1444
|
+
readonly power: import("@salsita-ai/common/utils").Selector<import("../host-properties/selectors.js").HostPropertiesSelectorState, "off" | "on" | "standby">;
|
|
1445
|
+
readonly presetTags: import("@salsita-ai/common/utils").Selector<import("../host-properties/selectors.js").HostPropertiesSelectorState, string[] | null>;
|
|
1446
|
+
readonly refreshToken: import("@salsita-ai/common/utils").Selector<import("../host-properties/selectors.js").HostPropertiesSelectorState, string | undefined>;
|
|
1447
|
+
readonly route: import("@salsita-ai/common/utils").Selector<import("../host-properties/selectors.js").HostPropertiesSelectorState, {
|
|
1448
|
+
route: "Index";
|
|
1449
|
+
} | {
|
|
1450
|
+
route: "Configuration";
|
|
1451
|
+
configurationId: string;
|
|
1452
|
+
accessToken?: string | undefined;
|
|
1453
|
+
} | {
|
|
1454
|
+
readonly route: "Index";
|
|
1455
|
+
}>;
|
|
1456
|
+
readonly sessionToken: import("@salsita-ai/common/utils").Selector<import("../host-properties/selectors.js").HostPropertiesSelectorState, string | undefined>;
|
|
1457
|
+
}[NAME];
|
|
1458
|
+
selectRoute: import("@salsita-ai/common/utils").Selector<import("../host-properties/selectors.js").HostPropertiesSelectorState, {
|
|
1459
|
+
route: "Index";
|
|
1460
|
+
} | {
|
|
1461
|
+
route: "Configuration";
|
|
1462
|
+
configurationId: string;
|
|
1463
|
+
accessToken?: string | undefined;
|
|
1464
|
+
} | {
|
|
1465
|
+
readonly route: "Index";
|
|
1466
|
+
}>;
|
|
1467
|
+
selectExpanded: import("@salsita-ai/common/utils").Selector<import("../host-properties/selectors.js").HostPropertiesSelectorState, boolean>;
|
|
1468
|
+
selectMode: import("@salsita-ai/common/utils").Selector<import("../host-properties/selectors.js").HostPropertiesSelectorState, "admin" | "configurator" | "standalone-admin">;
|
|
1469
|
+
selectPower: import("@salsita-ai/common/utils").Selector<import("../host-properties/selectors.js").HostPropertiesSelectorState, "off" | "on" | "standby">;
|
|
1470
|
+
selectPresetTags: import("@salsita-ai/common/utils").Selector<import("../host-properties/selectors.js").HostPropertiesSelectorState, string[] | null>;
|
|
1471
|
+
selectIntegrationMode: import("@salsita-ai/common/utils").Selector<import("../host-properties/selectors.js").HostPropertiesSelectorState, "handoff" | "headless" | "page" | "widget">;
|
|
1472
|
+
selectSessionToken: import("@salsita-ai/common/utils").Selector<import("../host-properties/selectors.js").HostPropertiesSelectorState, string | undefined>;
|
|
1473
|
+
selectAdminSessionToken: import("@salsita-ai/common/utils").Selector<import("../host-properties/selectors.js").HostPropertiesSelectorState, string | undefined>;
|
|
1474
|
+
selectRefreshToken: import("@salsita-ai/common/utils").Selector<import("../host-properties/selectors.js").HostPropertiesSelectorState, string | undefined>;
|
|
1475
|
+
selectAuthorizationCode: import("@salsita-ai/common/utils").Selector<import("../host-properties/selectors.js").HostPropertiesSelectorState, string | undefined>;
|
|
1476
|
+
getHostProperty: <NAME extends import("../index.js").HostPropertyName>(name: NAME) => HostPropertiesState[NAME];
|
|
1477
|
+
getRoute: () => {
|
|
1478
|
+
route: "Index";
|
|
1479
|
+
} | {
|
|
1480
|
+
route: "Configuration";
|
|
1481
|
+
configurationId: string;
|
|
1482
|
+
accessToken?: string | undefined;
|
|
1483
|
+
} | {
|
|
1484
|
+
readonly route: "Index";
|
|
1485
|
+
};
|
|
1486
|
+
getExpanded: () => boolean;
|
|
1487
|
+
getMode: () => "admin" | "configurator" | "standalone-admin";
|
|
1488
|
+
getPower: () => "off" | "on" | "standby";
|
|
1489
|
+
getPresetTags: () => string[] | null;
|
|
1490
|
+
getIntegrationMode: () => "handoff" | "headless" | "page" | "widget";
|
|
1491
|
+
getSessionToken: () => string | undefined;
|
|
1492
|
+
getAdminSessionToken: () => string | undefined;
|
|
1493
|
+
getRefreshToken: () => string | undefined;
|
|
1494
|
+
getAuthorizationCode: () => string | undefined;
|
|
1495
|
+
};
|
|
1318
1496
|
integration: {
|
|
1319
1497
|
selectIntegrationState: import("@salsita-ai/common/utils").Selector<import("../index.js").IntegrationSelectorState, IntegrationState>;
|
|
1320
1498
|
selectEmbeddedView: import("@salsita-ai/common/utils").Selector<import("../index.js").IntegrationSelectorState, import("../index.js").EmbeddedView>;
|
|
@@ -1326,6 +1504,18 @@ declare const createApplicationRuntimeImpl: <EXTENSIONS extends readonly AnyAppl
|
|
|
1326
1504
|
getPresetEmbeddedState: () => import("../index.js").PresetEmbeddedView | null;
|
|
1327
1505
|
getRecipeEmbeddedState: () => import("../index.js").RecipeEmbeddedView | null;
|
|
1328
1506
|
};
|
|
1507
|
+
loading: {
|
|
1508
|
+
configurator: {
|
|
1509
|
+
selectLoadingState: import("@salsita-ai/common/utils").Selector<import("../loading/selectors.js").LoadingSelectorState, import("../index.js").LoadingState>;
|
|
1510
|
+
getLoadingState: () => import("../index.js").LoadingState;
|
|
1511
|
+
getIsAwaitingPhase: (id: string) => boolean;
|
|
1512
|
+
};
|
|
1513
|
+
admin: {
|
|
1514
|
+
selectLoadingState: import("@salsita-ai/common/utils").Selector<import("../loading/selectors.js").LoadingSelectorState, import("../index.js").LoadingState>;
|
|
1515
|
+
getLoadingState: () => import("../index.js").LoadingState;
|
|
1516
|
+
getIsAwaitingPhase: (id: string) => boolean;
|
|
1517
|
+
};
|
|
1518
|
+
};
|
|
1329
1519
|
responsive: {
|
|
1330
1520
|
configurator: {
|
|
1331
1521
|
selectResponsiveState: import("@salsita-ai/common/utils").Selector<import("../responsive/selectors.js").ResponsiveSelectorState, import("../index.js").ResponsiveState>;
|
|
@@ -1439,6 +1629,26 @@ declare const createApplicationRuntimeImpl: <EXTENSIONS extends readonly AnyAppl
|
|
|
1439
1629
|
enterEmbeddedView: (view: import("../index.js").EmbeddedView) => void;
|
|
1440
1630
|
exitEmbeddedView: () => void;
|
|
1441
1631
|
};
|
|
1632
|
+
loading: {
|
|
1633
|
+
configurator: {
|
|
1634
|
+
startPhase: (phase: import("../index.js").LoadingPhase) => void;
|
|
1635
|
+
endPhase: (id: string) => void;
|
|
1636
|
+
reportError: () => void;
|
|
1637
|
+
clearError: () => void;
|
|
1638
|
+
expectPhase: (id: string) => void;
|
|
1639
|
+
dropExpectation: (id: string) => void;
|
|
1640
|
+
resetSlot: () => void;
|
|
1641
|
+
};
|
|
1642
|
+
admin: {
|
|
1643
|
+
startPhase: (phase: import("../index.js").LoadingPhase) => void;
|
|
1644
|
+
endPhase: (id: string) => void;
|
|
1645
|
+
reportError: () => void;
|
|
1646
|
+
clearError: () => void;
|
|
1647
|
+
expectPhase: (id: string) => void;
|
|
1648
|
+
dropExpectation: (id: string) => void;
|
|
1649
|
+
resetSlot: () => void;
|
|
1650
|
+
};
|
|
1651
|
+
};
|
|
1442
1652
|
responsive: {
|
|
1443
1653
|
configurator: {
|
|
1444
1654
|
setViewport: (viewport: import("../index.js").ResponsiveViewport) => void;
|
|
@@ -1475,6 +1685,6 @@ declare const createApplicationRuntimeImpl: <EXTENSIONS extends readonly AnyAppl
|
|
|
1475
1685
|
subscribe: (callback: () => void) => () => void;
|
|
1476
1686
|
};
|
|
1477
1687
|
export type CreatedApplicationRuntime<EXTENSIONS extends readonly AnyApplicationRuntimeExtension[]> = ReturnType<typeof createApplicationRuntimeImpl<EXTENSIONS>>;
|
|
1478
|
-
export declare function createApplicationRuntime(
|
|
1479
|
-
export declare function createApplicationRuntime<EXTENSIONS extends readonly AnyApplicationRuntimeExtension[]>(
|
|
1688
|
+
export declare function createApplicationRuntime(source: AnyApplicationConfig | Application, bootConfig: ApplicationRuntimeBootConfig): CreatedApplicationRuntime<readonly []>;
|
|
1689
|
+
export declare function createApplicationRuntime<EXTENSIONS extends readonly AnyApplicationRuntimeExtension[]>(source: AnyApplicationConfig | Application, bootConfig: ApplicationRuntimeBootConfig, createExtensions: CreateApplicationRuntimeExtensions<EXTENSIONS>): CreatedApplicationRuntime<EXTENSIONS>;
|
|
1480
1690
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{BehaviorSubject as e}from"rxjs";import{memoOnce as t}from"@salsita-ai/common/utils";import{ImplementationErrors as i,createDomainRuntimeSlices as n,findAssistantFormElementErrors as
|
|
1
|
+
import{BehaviorSubject as e}from"rxjs";import{memoOnce as t}from"@salsita-ai/common/utils";import{ImplementationErrors as o,applicationFromConfig as i,createDomainRuntimeSlices as n,findAssistantFormElementErrors as s,resolveIsDev as a}from"#package/domain";import{initializeAnalyticsService as r}from"../common-services/analytics/analytics-service.js";import{initializeI18n as c,initializeLogger as l}from"../common-services/initialize.js";import{createCommonServicesSelectors as p}from"../common-services/selectors.js";import{createDomainApplicationContextSelectors as m}from"../domain-application-context/index.js";import{connectHostProperties as u,createHostPropertiesActions as g,createHostPropertiesSelectors as v,initializeHostProperties as d}from"../host-properties/index.js";import{createIntegrationActions as S,createIntegrationSelectors as x,initializeIntegration as f}from"../integration/index.js";import{createLoadingActions as C,createLoadingSelectors as y,initializeLoading as b}from"../loading/index.js";import{createResponsiveActions as A,createResponsiveSelectors as w,initializeResponsive as h}from"../responsive/index.js";import{createRoutingActions as j,createRoutingSelectors as R,initializeRouting as T}from"../routing/index.js";import{SessionService as E,createSessionRuntimeActions as I,createSessionRuntimeSelectors as P,initializeSessionRuntime as L}from"../session/index.js";export function createApplicationRuntimeSlices(e){let{bootConfig:z,getSubject:D,getConfiguratorExtensions:H}=e,O=e.application??i(e.config),U={...O.environment,services:O.services,version:O.spec.version},k=a(U),G=l(U,k),{initialize:$,selectors:q,actions:B,hostMirrorActions:F}=n({application:O,services:{analyticsService:r(U,G,k),i18n:c(U),logger:G},getSubject:D,getExtensionSystems:e=>eu[e].getInitializableSystems()}),J=$(),{assistant:K,elements:M}=J.spec.configurator,N=s(K?.formElements??[],M);if(N.length>0)throw new o(N);let Q=g({setHostProperties:e=>{let t=D(),o=e(t.value.hostProperties);o!==t.value.hostProperties&&t.next({...t.value,hostProperties:o})}}),V=v({getState:()=>D().value}),W=S({setIntegration:e=>{let t=D(),o=e(t.value.integration);t.next({...t.value,integration:o})}}),X=x({getState:()=>D().value,actions:W}),Y=f(),Z=j({setRouting:e=>{let t=D(),o=e(t.value.routing);t.next({...t.value,routing:o})}}),_=R({getState:()=>D().value,actions:Z,accessActions:B.access,loadedDataActions:B.loadedData,domainServicesSelectors:q.domainServices,overridesSelectors:q.overrides}),ee=T(),et=A({setResponsive:e=>{let t=D(),o=e(t.value.responsive);o!==t.value.responsive&&t.next({...t.value,responsive:o})}}),eo={configurator:w({getState:()=>D().value,applicationType:"configurator"}),admin:w({getState:()=>D().value,applicationType:"admin"})},ei=h(),en=C({setLoading:e=>{let t=D(),o=e(t.value.loading);o!==t.value.loading&&t.next({...t.value,loading:o})}}),es={configurator:y({getState:()=>D().value,applicationType:"configurator"}),admin:y({getState:()=>D().value,applicationType:"admin"})},ea=b(),er=p({getState:()=>D().value,environmentSelectors:q.environment,specSelectors:q.spec,accessSelectors:q.access,domainServicesSelectors:q.domainServices,webComponentOptions:z.webComponentOptions,webComponentApi:z.webComponentApi,getSessionService:()=>em(),routingSelectors:_}),ec=I({setSessionRuntime:e=>{let t=D(),o=e(t.value.session);t.next({...t.value,session:o})}}),el=P({getState:()=>D().value,sessionContextSelectors:q.sessionContext}),ep=L(),em=t(()=>new E({getLogger:()=>q.domainServices.getLogger(),getAnalyticsService:()=>q.domainServices.getAnalyticsService(),getUnauthenticatedClient:er.getUnauthenticatedClient,environmentSelectors:q.environment,sessionActions:ec,setSessionContext:B.sessionContext.setSessionContext,sessionSelectors:el,specSelectors:q.spec})),eu={configurator:m({applicationType:"configurator",commonServicesSelectors:er,domainServicesSelectors:q.domainServices,domainContextSelectors:q.domainContext.configurator,getApplicationRuntimeExtensions:H}),admin:m({applicationType:"admin",commonServicesSelectors:er,domainServicesSelectors:q.domainServices,domainContextSelectors:q.domainContext.admin,getApplicationRuntimeExtensions:()=>[]})};return G.info(`Configurator Application loaded with deployment ID: ${U.deploymentId}!`),G.appendToGlobalContext({deploymentId:U.deploymentId}),{getState:()=>D().value,initialize:()=>({...J,hostProperties:d(z.webComponentApi),integration:Y,loading:ea,responsive:ei,routing:ee,session:ep}),connectHost:()=>u({webComponentApi:z.webComponentApi,actions:Q,domainSelectors:q.webComponent,domainActions:{setReadonly:B.webComponent.setReadonly,setLocale:F.setLocale}}),selectors:{...q,commonServices:er,hostProperties:V,integration:X,loading:es,responsive:eo,routing:_,session:el,domainApplicationContext:eu},actions:{...B,integration:W,loading:en,responsive:et,routing:Z,session:ec}}}export function createApplicationRuntime(t,o,i){return((t,o,i)=>{let n=null,s=null,a=()=>{if(!n)throw Error("Subject not yet initialized!");return n},{initialize:r,connectHost:c,...l}=createApplicationRuntimeSlices({..."spec"in t?{application:t}:{config:t},bootConfig:o,getSubject:a,getConfiguratorExtensions:()=>s});return s=i?i(l):[],l.selectors.domainApplicationContext.configurator.getSystems(),n=new e(r()),c(),{...l,getState:()=>a().value,subscribe:e=>{let t=a().subscribe(()=>e());return()=>t.unsubscribe()}}})(t,o,i)}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as a}from"react/jsx-runtime";import{useQuery as e}from"@tanstack/react-query";import{useCallback as r}from"react";import{Loader as t}from"#package/ui-sdk";import{BackendDataValueProvider as n,useProvidedFrontendData as o}from"../application-runtime/hooks/data/index.js";import{useApplicationRuntime as i,useApplicationRuntimeSelector as d,useAuthenticatedClient as c,useConfiguratorDomainFactory as s,useDomainDataActions as l,useFrontendData as u,useLogger as
|
|
1
|
+
import{jsx as a}from"react/jsx-runtime";import{useQuery as e}from"@tanstack/react-query";import{useCallback as r}from"react";import{Loader as t}from"#package/ui-sdk";import{BackendDataValueProvider as n,useProvidedFrontendData as o}from"../application-runtime/hooks/data/index.js";import{useApplicationRuntime as i,useApplicationRuntimeSelector as d,useAuthenticatedClient as c,useConfiguratorDomainFactory as s,useDomainDataActions as l,useFrontendData as k,useIsLoaderHosted as u,useLogger as m}from"../application-runtime/index.js";import{BuiltInLoadingPhase as f,useLoadingPhase as h}from"../loading-state/index.js";let D=e=>a(n,{backendData:d(i().selectors.domainData.getConfiguratorBackendData),children:e.children}),p=n=>{let i=m(),d=s(),p=l(),y=c(),v=k(),{frontendDataLoadKey:w}=o();if(!d)throw Error("DomainFactory is not available in the runtime registry. Ensure replaceDomainRuntime() is called with domainFactory before rendering BackendDataProvider.");if(void 0===w)throw Error("Frontend data load key not found! Render BackendDataProvider inside FrontendDataProvider so data reloads together.");let B=r(async a=>{try{return{success:!0,data:await y.getBackendData(a)}}catch(e){let a=e instanceof Error?e:Error(`Unknown error ${e}`);return i.warn("Failed to fetch backend data:",{},a),{success:!1}}},[y,i]),b=r(async(a,e)=>{if(!d.hasBackendData)return void p.setBackendData(void 0);let r=await B(a);if(e.throwIfAborted(),!r.success)return void p.setBackendData(void 0);try{let a=d.parseBackendData(r.data);return p.setBackendData(a),a}catch(e){let a=e instanceof Error?e:Error(`Unknown error ${e}`);i.error("Failed to parse backend data:",{backendData:r},a),p.setBackendData(void 0);return}},[d,B,i,p]),{data:g,error:F,isFetching:E}=e({queryKey:["get-backend-data",w],queryFn:async({signal:a})=>({backendData:await b(v,a)}),refetchOnMount:"always",refetchOnWindowFocus:!1,refetchOnReconnect:!1}),x=u();if(h({id:f.BackendData,label:"Loading backend data…"},(void 0===g||E)&&!F),F)throw F;return void 0===g||E?x?null:a(t,{}):a(D,{children:n.children},w)};export const BackendDataProvider=e=>a(p,{...e});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as t}from"react/jsx-runtime";import{useQuery as e}from"@tanstack/react-query";import{useCallback as r}from"react";import{Loader as a}from"#package/ui-sdk";import{FrontendDataValueProvider as n,useProvidedPublishedData as o}from"../application-runtime/hooks/data/index.js";import{useApplicationRuntime as d,useApplicationRuntimeSelector as i,useConfiguratorDomainFactory as s,useDomainDataActions as c,
|
|
1
|
+
import{jsx as t}from"react/jsx-runtime";import{useQuery as e}from"@tanstack/react-query";import{useCallback as r}from"react";import{Loader as a}from"#package/ui-sdk";import{FrontendDataValueProvider as n,useProvidedPublishedData as o}from"../application-runtime/hooks/data/index.js";import{useApplicationRuntime as d,useApplicationRuntimeSelector as i,useConfiguratorDomainFactory as s,useDomainDataActions as c,useIsLoaderHosted as l,useLogger as u,usePublishedData as f,useSession as m,useWebComponentApi as h}from"../application-runtime/index.js";import{BuiltInLoadingPhase as D,useLoadingPhase as y}from"../loading-state/index.js";import{CollectFrontendDataHandlerBoundary as p,useCollectFrontendDataHandler as F}from"./CollectFrontendDataHandler.js";let w=e=>t(n,{frontendData:i(d().selectors.domainData.getConfiguratorFrontendData),frontendDataLoadKey:e.frontendDataLoadKey,children:e.children}),g=n=>{let d=u(),i=s(),p=c(),g=m(),v=f(),{publishedDataLoadKey:P}=o(),{getPropertyValue:b}=h(),k=F();if(!i)throw Error("DomainFactory is not available in the runtime registry. Ensure replaceDomainRuntime() is called with domainFactory before rendering FrontendDataProvider.");if(void 0===P)throw Error("Published data load key not found! Render FrontendDataProvider inside PublishedDataProvider so data reloads together.");let E=r(async t=>{if(null==k)return{success:!1};try{return{success:!0,data:await k({sessionData:g.sessionPayload?.data??{},publishedData:t,getWebComponentPropertyValue:b})}}catch(e){let t=e instanceof Error?e:Error(`Unknown error ${e}`);return d.warn("Failed to collect frontend data, the collectFrontendData function threw an error, have you provided collectFrontendData function? Does it return data matching the frontendData spec defined in your domain?",{},t),{success:!1}}},[k,b,d,g.sessionPayload?.data]),j=r(async(t,e)=>{let r=await E(t);if(e.throwIfAborted(),!r.success)return p.setFrontendData({}),{};try{let t=i.parseFrontendData(r.data);return d.debug("Collected frontend data:",t),p.setFrontendData(t),t}catch(e){let t=e instanceof Error?e:Error(`Unknown error ${e}`);return d.error("Failed to parse frontend data:",{frontendData:r},t),p.setFrontendData({}),{}}},[i,E,d,p]),{data:x,error:K,isFetching:L}=e({queryKey:["get-frontend-data",P],queryFn:async({signal:t})=>j(v,t),refetchOnMount:"always",refetchOnWindowFocus:!1,refetchOnReconnect:!1}),q=l();if(y({id:D.FrontendData,label:"Loading frontend data…"},(void 0===x||L)&&!K),K)throw K;return void 0===x||L?q?null:t(a,{}):t(w,{frontendDataLoadKey:P,children:n.children},P)};export const FrontendDataProvider=e=>t(p,{children:t(g,{...e})});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as e}from"react/jsx-runtime";import{useQuery as t}from"@tanstack/react-query";import r from"lodash-es/uniq.js";import{useCallback as a,useMemo as i}from"react";import{SYSTEM_CHUNK_KEY as
|
|
1
|
+
import{jsx as e}from"react/jsx-runtime";import{useQuery as t}from"@tanstack/react-query";import r from"lodash-es/uniq.js";import{useCallback as a,useMemo as i}from"react";import{SYSTEM_CHUNK_KEY as s}from"#package/domain";import{Loader as n}from"#package/ui-sdk";import{PublishedDataValueProvider as o}from"../application-runtime/hooks/data/index.js";import{useApplicationRuntime as l,useApplicationRuntimeSelector as d,useAuthenticatedClient as u,useConfiguratorDomainFactory as h,useDomainDataActions as c,useIsLoaderHosted as p,useLogger as m,usePersistenceConfig as f,useSession as b,useSpecChunks as y,useSpecInitialPublishedData as k,useSpecPublishedDataHash as g}from"../application-runtime/index.js";import{BuiltInLoadingPhase as P,useLoadingPhase as w}from"../loading-state/index.js";import{FilterPublishedChunksHandlerBoundary as D,useFilterPublishedChunksHandler as v}from"./FilterPublishedChunksHandler.js";export const getAccessibleChunkKeys=(e,t)=>{let r=new Set((t??[]).map(String));return Object.keys(e).filter(t=>{if(t===s)return!0;let a=e[t];return null!=a&&r.has(a.scope)})};export const resolveChunkKeysToFetch=e=>{let{chunksSpec:t,chunkScopes:a,filteredChunkKeys:i}=e,n=i??getAccessibleChunkKeys(t,a);if(null!=i){let e=i.filter(e=>e!==s&&null==t[e]);if(e.length>0)throw Error(`createFilterPublishedChunksHandler returned unknown chunk keys: ${e.join(", ")}.`)}return r([...n,s].map(String))};let j=t=>e(o,{publishedData:d(l().selectors.domainData.getConfiguratorPublishedData),publishedDataLoadKey:t.publishedDataLoadKey,children:t.children}),F=r=>{let s=b(),o=m(),l=f(),d=y(),D=g(),F=k(),C=u(),E=h(),x=c();if(!E)throw Error("DomainFactory is not available in the runtime registry. Ensure replaceDomainRuntime() is called with domainFactory before rendering PublishedDataProvider.");let S=v(),K=s.sessionPayload?.chunkScopes,O=i(()=>{if(null==d||0===Object.keys(d).length)return;if(null==D)throw Error("publishedDataHash is required when chunks are defined. Use withPublishedDataHash() in ConfiguratorBuilder.");let e=S?.();return resolveChunkKeysToFetch({chunksSpec:d,chunkScopes:K,filteredChunkKeys:e})},[d,K,S,D]),A=i(()=>JSON.stringify(O??null),[O]),R=i(()=>JSON.stringify(F),[F]),q=a(async e=>{let t=await Promise.all(e.map(async e=>{try{let t=await C.getPublishedChunk(e,D);if(null==t){let t=F[e];if(t&&"object"==typeof t)return{key:e,data:t};return{key:e,data:{}}}return{key:e,data:t}}catch(t){return o.error("Failed to fetch published chunk",{key:e},t instanceof Error?t:Error(String(t))),{key:e,data:{}}}})),r={};for(let e of t)r[e.key]=e.data;return{success:!0,data:r}},[C,o,F,D]),H=a(async()=>{if("memory"===l.type||"local-storage"===l.type)return{success:!0,data:F};if(null!=O)return 0===O.length?{success:!0,data:{}}:q(O);let e=s.sessionPayload?.publishedAdminRevisionPath;if(null==e)return{success:!1};try{let t=await fetch(e);return{success:!0,data:await t.json()}}catch(r){let t=r instanceof Error?r:Error(`Unknown error ${r}`);return o.warn("Failed to fetch published data, the published data endpoint returned an error, have you published data from the admin? Check if the published data is accessible.",{path:e},t),{success:!1}}},[o,l,F,s.sessionPayload?.publishedAdminRevisionPath,O,q]),L=a(async e=>{let t=await H();if(e.throwIfAborted(),!t.success)return x.setPublishedData(F),F;try{let e=E.parsePublishedData(t.data);return o.debug("Fetched published admin revision data:",e),x.setPublishedData(e),e}catch(r){let e=r instanceof Error?r:Error(`Unknown error ${r}`);return o.error("Failed to parse published data, the data structure does not match the expected schema, does the published data match the publishedData schema defined in your domain?",{json:t},e),x.setPublishedData(F),F}},[o,E,H,F,x]),J=i(()=>["get-published-admin-data",s.sessionPayload?.publishedAdminRevisionPath,A,D,R],[A,R,D,s.sessionPayload?.publishedAdminRevisionPath]),N=i(()=>JSON.stringify(J),[J]),{data:U,error:$,isFetching:T}=t({queryKey:J,queryFn:({signal:e})=>L(e),refetchOnMount:"always",refetchOnWindowFocus:!1,refetchOnReconnect:!1}),B=p();if(w({id:P.PublishedData,label:"Loading published data…"},(void 0===U||T)&&!$),$)throw $;return void 0===U||T?B?null:e(n,{}):e(j,{publishedDataLoadKey:N,children:r.children},N)};export const PublishedDataProvider=t=>e(D,{children:e(F,{...t})});
|
|
@@ -1,3 +1,2 @@
|
|
|
1
|
-
export type { ConfiguratorErrorPageProps, ConfiguratorErrorReason } from './configurator-error-page-props.js';
|
|
2
1
|
export { PhoenixEntityElement, PhoenixEntityElements, PhoenixEntityElementWithChildren, type PhoenixEntityElementProps, type PhoenixEntityElementsProps, type PhoenixEntityElementWithChildrenProps, } from './PhoenixEntityElement.js';
|
|
3
2
|
export { PhoenixLayoutElement, PhoenixLayoutElements, PhoenixLayoutElementWithChildren, usePhoenixLayoutElementExists, type PhoenixLayoutElementProps, type PhoenixLayoutElementsProps, type PhoenixLayoutElementWithChildrenProps, } from './PhoenixLayoutElement.js';
|
|
@@ -10,5 +10,6 @@ export * from './localizable/index.js';
|
|
|
10
10
|
export * from './loading-state/index.js';
|
|
11
11
|
export * from './elements/index.js';
|
|
12
12
|
export * from './scene-control-elements/index.js';
|
|
13
|
+
export * from './page-elements/index.js';
|
|
13
14
|
export * from './handlers/index.js';
|
|
14
15
|
export * from './application-runtime/index.js';
|
package/dist/react-sdk/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export*from"./theme/index.js";export*from"./utils/index.js";export*from"./session/index.js";export*from"./domain-context/index.js";export*from"./domain-application-context/index.js";export*from"./domain-controls/index.js";export*from"./invalid-deployment/index.js";export*from"./web-component/index.js";export*from"./localizable/index.js";export*from"./loading-state/index.js";export*from"./elements/index.js";export*from"./scene-control-elements/index.js";export*from"./handlers/index.js";export*from"./application-runtime/index.js";
|
|
1
|
+
export*from"./theme/index.js";export*from"./utils/index.js";export*from"./session/index.js";export*from"./domain-context/index.js";export*from"./domain-application-context/index.js";export*from"./domain-controls/index.js";export*from"./invalid-deployment/index.js";export*from"./web-component/index.js";export*from"./localizable/index.js";export*from"./loading-state/index.js";export*from"./elements/index.js";export*from"./scene-control-elements/index.js";export*from"./page-elements/index.js";export*from"./handlers/index.js";export*from"./application-runtime/index.js";
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Hosts the application's loader: the loading hooks below it report to the runtime's `loading`
|
|
4
|
+
* slice, and the SDK's own UI below it leaves its inline loaders out (`useIsLoaderHosted()`). The
|
|
5
|
+
* configurator mounts the one host, inside its `ApplicationTypeProvider`, while it is powered on.
|
|
6
|
+
*
|
|
7
|
+
* It resets the slice when it mounts and not again while it stays mounted, so the loading state
|
|
8
|
+
* starts over at power-on and on remount, and only there.
|
|
9
|
+
*
|
|
10
|
+
* Its children mount once the reset is done, so their first render and their first phases already
|
|
11
|
+
* see the host, and the reset cannot wipe phases they started. The host resets in a layout effect
|
|
12
|
+
* and then sets local state, which React renders synchronously before the browser paints, whatever
|
|
13
|
+
* the lane of the first render. StrictMode repeats that layout effect before the children mount, so
|
|
14
|
+
* the second reset wipes nothing either.
|
|
15
|
+
*
|
|
16
|
+
* @internal Runtime plumbing for the SDK's own UI.
|
|
17
|
+
*/
|
|
18
|
+
export declare const LoaderHost: ({ children }: {
|
|
19
|
+
readonly children: ReactNode;
|
|
20
|
+
}) => import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{jsx as o}from"react/jsx-runtime";import{useLayoutEffect as r,useState as i}from"react";import{LoaderHostContext as t,useLoadingApplication as e}from"../application-runtime/index.js";export const LoaderHost=({children:n})=>{let a=e(),[p,d]=i(!1);if(null===a)throw Error("LoaderHost has no application whose loader it could host: it is mounted outside an ApplicationRuntimeProvider or an ApplicationTypeProvider. Render LoaderHost inside both an ApplicationRuntimeProvider and an ApplicationTypeProvider, as ConfiguratorApp does.");return(r(()=>{a.actions.resetSlot(),d(!0)},[a]),p)?o(t.Provider,{value:!0,children:n}):null};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/** The ids of the loading phases the SDK reports itself. A project reports its own under other ids. */
|
|
2
|
+
export declare enum BuiltInLoadingPhase {
|
|
3
|
+
SessionAuth = "session-auth",
|
|
4
|
+
PublishedData = "published-data",
|
|
5
|
+
FrontendData = "frontend-data",
|
|
6
|
+
BackendData = "backend-data",
|
|
7
|
+
DataFetch = "data-fetch",
|
|
8
|
+
SceneAssets = "scene-assets"
|
|
9
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var a;export var BuiltInLoadingPhase=((a={}).SessionAuth="session-auth",a.PublishedData="published-data",a.FrontendData="frontend-data",a.BackendData="backend-data",a.DataFetch="data-fetch",a.SceneAssets="scene-assets",a);
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { type PhoenixLayoutElementRegistration } from '#package/domain';
|
|
2
|
+
import type { LoadingPhase } from '../application-runtime/index.js';
|
|
3
|
+
/**
|
|
4
|
+
* The name a project registers a layout element under to replace what the app loader overlay shows.
|
|
5
|
+
* Its default, the built-in loader content, is registered in `defaultConfiguratorElements`.
|
|
6
|
+
*/
|
|
7
|
+
export declare const AppLoaderContentName = "AppLoaderContent";
|
|
8
|
+
/** The props of the content a project registers with `createAppLoader`. */
|
|
9
|
+
export interface AppLoaderContentProps {
|
|
10
|
+
/** The loading phases running now; empty while the loader waits for the scene to start loading. */
|
|
11
|
+
readonly phases: readonly LoadingPhase[];
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Registers a project's app loader content as the `AppLoaderContent` element. The SDK keeps the
|
|
15
|
+
* overlay, its place over the scene's safe area and its fade-in; the component is only what it shows.
|
|
16
|
+
*/
|
|
17
|
+
export declare const createAppLoader: (Element: (props: AppLoaderContentProps) => JSX.Element) => readonly PhoenixLayoutElementRegistration[];
|
|
18
|
+
export type CreateAppLoader = (Element: (props: AppLoaderContentProps) => JSX.Element) => readonly PhoenixLayoutElementRegistration[];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{jsx as o}from"react/jsx-runtime";import{createCustomPhoenixLayoutElement as t}from"#package/domain";import{useLoadingStateValue as e}from"./loading-state-hooks.js";export const AppLoaderContentName="AppLoaderContent";export const createAppLoader=r=>[t("AppLoaderContent",()=>{let{phases:t}=e();return o(r,{phases:t})})];
|
|
@@ -1,2 +1,4 @@
|
|
|
1
|
-
export { BuiltInLoadingPhase
|
|
2
|
-
export {
|
|
1
|
+
export { BuiltInLoadingPhase } from './built-in-loading-phase.js';
|
|
2
|
+
export { LoaderHost } from './LoaderHost.js';
|
|
3
|
+
export { useLoadingState, type UseLoadingState, useLoadingStateValue, useLoadingPhase, useExpectPhase, useLoadingError, } from './loading-state-hooks.js';
|
|
4
|
+
export { AppLoaderContentName, type AppLoaderContentProps, createAppLoader, type CreateAppLoader, } from './create-app-loader.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{BuiltInLoadingPhase
|
|
1
|
+
export{BuiltInLoadingPhase}from"./built-in-loading-phase.js";export{LoaderHost}from"./LoaderHost.js";export{useLoadingState,useLoadingStateValue,useLoadingPhase,useExpectPhase,useLoadingError}from"./loading-state-hooks.js";export{AppLoaderContentName,createAppLoader}from"./create-app-loader.js";
|
|
@@ -1,22 +1,13 @@
|
|
|
1
|
-
import type
|
|
2
|
-
import { type LoadingPhase, type LoadingState, LoadingStateManager } from './loading-state-manager.js';
|
|
3
|
-
export declare const LoadingStateProvider: ({ children }: {
|
|
4
|
-
readonly children: ReactNode;
|
|
5
|
-
}) => import("react/jsx-runtime").JSX.Element;
|
|
6
|
-
/**
|
|
7
|
-
* Returns the loading state manager if available.
|
|
8
|
-
* Returns `null` when used outside of `LoadingStateProvider` (e.g. in admin app).
|
|
9
|
-
*/
|
|
10
|
-
export declare const useLoadingStateManager: () => LoadingStateManager | null;
|
|
1
|
+
import { type LoadingPhase, type LoadingState } from '../application-runtime/index.js';
|
|
11
2
|
/**
|
|
12
3
|
* Subscribe to the current aggregated loading state.
|
|
13
|
-
* Returns the default (not loading) state
|
|
4
|
+
* Returns the default (not loading) state outside the application's loader host.
|
|
14
5
|
*/
|
|
15
6
|
export declare const useLoadingStateValue: () => LoadingState;
|
|
16
7
|
export type UseLoadingState = typeof useLoadingState;
|
|
17
8
|
/**
|
|
18
9
|
* Returns loading phase control functions.
|
|
19
|
-
* Returns `null`
|
|
10
|
+
* Returns `null` outside the application's loader host.
|
|
20
11
|
*/
|
|
21
12
|
export declare const useLoadingState: () => {
|
|
22
13
|
startPhase: (phase: LoadingPhase) => void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{useEffect as e,useMemo as t,useRef as r,useSyncExternalStore as n}from"react";import{useIsLoaderHosted as s,useLoadingActions as a,useLoadingApplication as o,useOptionalApplicationRuntime as u}from"../application-runtime/index.js";let c={isLoading:!1,hasError:!1,phases:[],expectedPhaseIds:new Set},l=()=>c,i=()=>()=>{};export const useLoadingStateValue=()=>{let e=o(),t=s(),r=u(),a=n(r?.subscribe??i,e?.selectors.getLoadingState??l);return t?a:c};export const useLoadingState=()=>{let e=a();return t(()=>e?{startPhase:e.startPhase,endPhase:e.endPhase}:null,[e])};export const useLoadingPhase=(t,n)=>{let s=a(),o=r(t);o.current=t;let u=r(null);e(()=>{if(s)return n?(u.current=o.current.id,s.startPhase(o.current)):null!==u.current&&(s.endPhase(u.current),u.current=null),()=>{null!==u.current&&(s.endPhase(u.current),u.current=null)}},[s,n,t.id])};export const useExpectPhase=t=>{let r=a();e(()=>{if(r)return r.expectPhase(t),()=>{r.dropExpectation(t)}},[r,t])};export const useLoadingError=t=>{let r=a();e(()=>{r&&t&&r.reportError()},[r,t])};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { type PropsWithChildren } from 'react';
|
|
2
|
+
import type { ConfigurationNotFoundPageProps } from '../session/index.js';
|
|
3
|
+
interface ConfigurationNotFoundPagePropsProviderProps extends PropsWithChildren {
|
|
4
|
+
readonly value: ConfigurationNotFoundPageProps;
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* @internal Runtime plumbing behind `createConfigurationNotFoundPage`, for the SDK's own UI. The
|
|
8
|
+
* configurator's renderer of the `ConfigurationNotFoundPage` element provides the page's props through
|
|
9
|
+
* it, because an element slot is typed as taking only `children`.
|
|
10
|
+
*/
|
|
11
|
+
export declare const ConfigurationNotFoundPagePropsProvider: (props: ConfigurationNotFoundPagePropsProviderProps) => import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
/**
|
|
13
|
+
* @internal Exists for the SDK's own UI and for `createConfigurationNotFoundPage`, which read the
|
|
14
|
+
* props of the `ConfigurationNotFoundPage` element through it.
|
|
15
|
+
*/
|
|
16
|
+
export declare const useConfigurationNotFoundPageProps: () => ConfigurationNotFoundPageProps;
|
|
17
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{jsx as o}from"react/jsx-runtime";import{createContext as r,useContext as t}from"react";let e=r({});export const ConfigurationNotFoundPagePropsProvider=r=>{let{value:t,children:n}=r;return o(e.Provider,{value:t,children:n})};export const useConfigurationNotFoundPageProps=()=>t(e);
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { type PropsWithChildren } from 'react';
|
|
2
|
+
import type { ConfiguratorErrorPageProps } from './configurator-error-page-props.js';
|
|
3
|
+
interface ConfiguratorErrorPagePropsProviderProps extends PropsWithChildren {
|
|
4
|
+
readonly value: ConfiguratorErrorPageProps;
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* @internal Runtime plumbing behind `createConfiguratorErrorPage`, for the SDK's own UI. The
|
|
8
|
+
* configurator's renderer of the `ConfiguratorErrorPage` element provides the page's props through it,
|
|
9
|
+
* because an element slot is typed as taking only `children`.
|
|
10
|
+
*/
|
|
11
|
+
export declare const ConfiguratorErrorPagePropsProvider: (props: ConfiguratorErrorPagePropsProviderProps) => import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
/**
|
|
13
|
+
* @internal Exists for the SDK's own UI and for `createConfiguratorErrorPage`, which read the props
|
|
14
|
+
* of the `ConfiguratorErrorPage` element through it.
|
|
15
|
+
*/
|
|
16
|
+
export declare const useConfiguratorErrorPageProps: () => ConfiguratorErrorPageProps;
|
|
17
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{jsx as r}from"react/jsx-runtime";import{createContext as e,useContext as o}from"react";let t=e(void 0);export const ConfiguratorErrorPagePropsProvider=e=>{let{value:o,children:i}=e;return r(t.Provider,{value:o,children:i})};export const useConfiguratorErrorPageProps=()=>{let r=o(t);if(void 0===r)throw Error("The ConfiguratorErrorPage element was rendered without its props. Only the configurator renders this element, inside ConfiguratorErrorPagePropsProvider; render the element through the configurator instead of mounting it directly.");return r};
|