@salsita-ai/sdk 0.50.0-develop.bd84173265 → 0.50.0-develop.bded01bb03
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/README.md +8 -4
- package/dist/admin/default-admin-elements.d.ts +9 -0
- package/dist/admin/default-admin-elements.js +1 -0
- package/dist/admin/default-elements/built-in-entity-element.d.ts +10 -0
- package/dist/admin/default-elements/built-in-entity-element.js +1 -0
- package/dist/admin/default-elements/built-in-layout-element.d.ts +10 -0
- package/dist/admin/default-elements/built-in-layout-element.js +1 -0
- package/dist/admin/default-elements/index.d.ts +2 -0
- package/dist/admin/default-elements/index.js +1 -0
- package/dist/admin/index.d.ts +1 -0
- package/dist/admin/index.js +1 -1
- package/dist/application-spec/errors/diagnostic-codes.d.ts +1 -0
- package/dist/application-spec/errors/diagnostic-codes.js +1 -1
- package/dist/application-spec/errors/diagnostic-messages.d.ts +1 -0
- package/dist/application-spec/errors/diagnostic-messages.js +1 -1
- package/dist/application-spec/generate-application/code/common/code-imports.js +1 -1
- package/dist/application-spec/generate-application/code/common/env-reader.js +2 -2
- package/dist/application-spec/generate-application/code/common/index.d.ts +1 -0
- package/dist/application-spec/generate-application/code/common/index.js +1 -1
- package/dist/application-spec/generate-application/code/common/single-quoted-string.d.ts +6 -0
- package/dist/application-spec/generate-application/code/common/single-quoted-string.js +1 -0
- package/dist/application-spec/generate-application/code/domain-runtime-files.js +1 -1
- package/dist/application-spec/generate-application/code/project-scaffolding.d.ts +5 -7
- package/dist/application-spec/generate-application/code/project-scaffolding.js +2 -2
- package/dist/application-spec/generate-application/code/story-files.js +1 -1
- package/dist/application-spec/generate-application/code/templates/admin-config.js +3 -0
- package/dist/application-spec/generate-application/code/templates/common/format-property-key.d.ts +7 -0
- package/dist/application-spec/generate-application/code/templates/common/format-property-key.js +1 -0
- package/dist/application-spec/generate-application/code/templates/common/schema-to-type-string.js +3 -3
- package/dist/application-spec/generate-application/code/templates/domain-spec/factory-types/domain-factory-types.d.ts +35 -0
- package/dist/application-spec/generate-application/code/templates/domain-spec/factory-types/domain-factory-types.js +5 -0
- package/dist/application-spec/generate-application/code/templates/domain-spec/factory-types/index.d.ts +1 -0
- package/dist/application-spec/generate-application/code/templates/domain-spec/factory-types/index.js +1 -0
- package/dist/application-spec/generate-application/code/templates/domain-spec/generate-component-optics.d.ts +1 -1
- package/dist/application-spec/generate-application/code/templates/domain-spec/generate-component-optics.js +6 -6
- package/dist/application-spec/generate-application/code/templates/domain-spec/generate-domain-block.js +59 -63
- package/dist/application-spec/generate-application/code/templates/domain-spec/generate-invariants.d.ts +8 -0
- package/dist/application-spec/generate-application/code/templates/domain-spec/generate-invariants.js +1 -1
- package/dist/application-spec/generate-application/code/templates/domain-spec/generate-presets.js +1 -1
- package/dist/application-spec/generate-application/code/templates/domain-spec/generate-resources.js +13 -13
- package/dist/application-spec/generate-application/code/templates/domain-spec/generate-states.d.ts +1 -1
- package/dist/application-spec/generate-application/code/templates/domain-spec/generate-states.js +2 -2
- package/dist/application-spec/generate-application/code/templates/domain-spec/index.d.ts +2 -1
- package/dist/application-spec/generate-application/code/templates/domain-spec/index.js +1 -1
- package/dist/application-spec/generate-application/code/templates/global-definition/generate-phx-types.d.ts +43 -0
- package/dist/application-spec/generate-application/code/templates/global-definition/generate-phx-types.js +31 -0
- package/dist/application-spec/generate-application/code/templates/global-definition/index.d.ts +1 -0
- package/dist/application-spec/generate-application/code/templates/global-definition/index.js +1 -1
- package/dist/application-spec/generate-application/code/templates/globals.js +24 -43
- package/dist/application-spec/generate-application/code/templates/index.d.ts +2 -2
- package/dist/application-spec/generate-application/code/templates/index.js +1 -1
- package/dist/application-spec/generate-application/code/templates/skills/phoenix-cli-skill.js +1 -1
- package/dist/application-spec/generate-application/code/templates/skills/phoenix-create-configurator-skill.js +1 -1
- package/dist/application-spec/generate-application/code/templates/skills/phoenix-feedback-skill.js +5 -5
- package/dist/application-spec/generate-application/code/templates/skills/phoenix-review-skill.js +2 -2
- package/dist/application-spec/generate-application/code/templates/skills/phoenix-skill.js +1 -1
- package/dist/application-spec/generate-application/code/templates/skills/phoenix-variants-skill.js +2 -2
- package/dist/application-spec/generate-application/code/templates/skills/sdk-content.d.ts +13 -2
- package/dist/application-spec/generate-application/code/templates/skills/sdk-content.js +2 -2
- package/dist/application-spec/generate-application/code/templates/spec-code/collect-spec-code.d.ts +58 -0
- package/dist/application-spec/generate-application/code/templates/spec-code/collect-spec-code.js +1 -0
- package/dist/application-spec/generate-application/code/templates/spec-code/index.d.ts +2 -0
- package/dist/application-spec/generate-application/code/templates/spec-code/index.js +1 -0
- package/dist/application-spec/generate-application/code/templates/spec-code/spec-code.d.ts +18 -0
- package/dist/application-spec/generate-application/code/templates/spec-code/spec-code.js +41 -0
- package/dist/application-spec/generate-application/code/templates/spec-messages/index.d.ts +1 -0
- package/dist/application-spec/generate-application/code/templates/spec-messages/index.js +1 -0
- package/dist/application-spec/generate-application/code/templates/spec-messages/spec-messages.d.ts +20 -0
- package/dist/application-spec/generate-application/code/templates/spec-messages/spec-messages.js +6 -0
- package/dist/application-spec/generate-application/code/templates/story/phx-module.d.ts +8 -2
- package/dist/application-spec/generate-application/code/templates/story/phx-module.js +15 -3
- package/dist/application-spec/generate-application/code/templates/story/wrapper.d.ts +3 -0
- package/dist/application-spec/generate-application/code/templates/story/wrapper.js +2 -1
- package/dist/application-spec/generate-application/runtime/admin-runtime/admin-model-runtime.d.ts +2 -1
- package/dist/application-spec/generate-application/runtime/admin-runtime/admin-model-runtime.js +1 -1
- package/dist/application-spec/generate-application/runtime/admin-runtime/admin-runtime.d.ts +2 -1
- package/dist/application-spec/generate-application/runtime/admin-runtime/admin-runtime.js +1 -1
- package/dist/application-spec/generate-application/runtime/application-runtime.d.ts +8 -2
- package/dist/application-spec/generate-application/runtime/application-runtime.js +1 -1
- package/dist/application-spec/generate-application/runtime/configurator-runtime/configurator-model-runtime.d.ts +2 -1
- package/dist/application-spec/generate-application/runtime/configurator-runtime/configurator-model-runtime.js +1 -1
- package/dist/application-spec/generate-application/runtime/configurator-runtime/configurator-runtime.d.ts +2 -1
- package/dist/application-spec/generate-application/runtime/configurator-runtime/configurator-runtime.js +1 -1
- package/dist/application-spec/generate-application/runtime/sections/build-sdk-optic.d.ts +2 -1
- package/dist/application-spec/generate-application/runtime/sections/build-sdk-optic.js +1 -1
- package/dist/application-spec/generate-application/runtime/sections/build-user-bound-optic.d.ts +2 -1
- package/dist/application-spec/generate-application/runtime/sections/build-user-bound-optic.js +1 -1
- package/dist/application-spec/generate-application/runtime/sections/component-optic.d.ts +3 -0
- package/dist/application-spec/generate-application/runtime/sections/component-optic.js +1 -1
- package/dist/application-spec/generate-application/runtime/sections/expression-runtime.d.ts +5 -3
- package/dist/application-spec/generate-application/runtime/sections/expression-runtime.js +1 -1
- package/dist/application-spec/generate-application/runtime/sections/generate-memo-eval-plan-runtime.d.ts +9 -5
- package/dist/application-spec/generate-application/runtime/sections/generate-memo-eval-plan-runtime.js +1 -1
- package/dist/application-spec/generate-application/runtime/sections/reflection-constants-runtime.d.ts +3 -1
- package/dist/application-spec/generate-application/runtime/sections/reflection-constants-runtime.js +1 -1
- package/dist/application-spec/generate-application/runtime/spec-code/index.d.ts +2 -0
- package/dist/application-spec/generate-application/runtime/spec-code/index.js +1 -0
- package/dist/application-spec/generate-application/runtime/spec-code/resolve-spec-code.d.ts +18 -0
- package/dist/application-spec/generate-application/runtime/spec-code/resolve-spec-code.js +1 -0
- package/dist/application-spec/generate-application/runtime/spec-code/spec-code-module.d.ts +17 -0
- package/dist/application-spec/generate-application/runtime/spec-code/spec-code-module.js +1 -0
- package/dist/application-spec/generate-application/runtime-spec/index.d.ts +1 -0
- package/dist/application-spec/generate-application/runtime-spec/index.js +1 -1
- package/dist/application-spec/generate-application/runtime-spec/spec-code-id.d.ts +40 -0
- package/dist/application-spec/generate-application/runtime-spec/spec-code-id.js +1 -0
- package/dist/application-spec/parse-application-files/categorize/categorize-files.js +1 -1
- package/dist/application-spec/parse-application-files/spec/expressions/expression-read-types.d.ts +9 -4
- package/dist/application-spec/parse-application-files/spec/expressions/expression-read-types.js +1 -1
- package/dist/application-spec/parse-application-files/spec/expressions/expression-value-type.d.ts +9 -0
- package/dist/application-spec/parse-application-files/spec/expressions/expression-value-type.js +1 -0
- package/dist/application-spec/parse-application-files/spec/expressions/expressions.js +1 -1
- package/dist/application-spec/parse-application-files/spec/expressions/user-expressions.d.ts +3 -1
- package/dist/application-spec/parse-application-files/spec/expressions/user-expressions.js +1 -1
- package/dist/configurator/application-runtime/extensions/systems/graphql-system/close-unclosed-braces.d.ts +12 -0
- package/dist/configurator/application-runtime/extensions/systems/graphql-system/close-unclosed-braces.js +1 -0
- package/dist/configurator/application-runtime/extensions/systems/graphql-system/graphql-system.d.ts +1 -1
- package/dist/configurator/application-runtime/extensions/systems/graphql-system/graphql-system.js +1 -1
- package/dist/configurator/common/configurator-interface.d.ts +11 -2
- package/dist/configurator/common/configurator-interface.js +1 -1
- package/dist/configurator/common/index.d.ts +2 -2
- package/dist/configurator/common/index.js +1 -1
- package/dist/configurator/configuration-not-found-page/ConfigurationNotFoundPageElement.d.ts +12 -0
- package/dist/configurator/configuration-not-found-page/ConfigurationNotFoundPageElement.js +1 -0
- package/dist/configurator/configuration-not-found-page/index.d.ts +1 -0
- package/dist/configurator/configuration-not-found-page/index.js +1 -0
- package/dist/configurator/configurator-context/PresetSelectionProvider.js +1 -1
- package/dist/configurator/pages/ConfiguratorNotFoundPage.js +1 -1
- package/dist/configurator/pages/DefaultNotAuthenticatedPage.d.ts +8 -0
- package/dist/configurator/pages/DefaultNotAuthenticatedPage.js +1 -0
- package/dist/configurator/pages/DefaultPresetUi.d.ts +7 -0
- package/dist/configurator/pages/DefaultPresetUi.js +1 -0
- package/dist/configurator/pages/NewConfiguratorPage.js +1 -1
- package/dist/configurator/pages/RootPage.js +1 -1
- package/dist/configurator/pages/default-configurator-elements.d.ts +4 -1
- package/dist/configurator/pages/default-configurator-elements.js +1 -1
- package/dist/configurator/pages/default-elements/built-in-entity-element.d.ts +1 -1
- package/dist/configurator/pages/default-elements/built-in-layout-element.d.ts +1 -1
- package/dist/configurator/preset-screen-elements/PresetDeviceNotSupportedElement.d.ts +4 -0
- package/dist/configurator/preset-screen-elements/PresetDeviceNotSupportedElement.js +1 -0
- package/dist/configurator/preset-screen-elements/PresetPageActionElement.d.ts +4 -0
- package/dist/configurator/preset-screen-elements/PresetPageActionElement.js +1 -0
- package/dist/configurator/preset-screen-elements/index.d.ts +2 -0
- package/dist/configurator/preset-screen-elements/index.js +1 -0
- package/dist/configurator/scene/scene-controls/DeleteEntityFab.js +1 -1
- package/dist/configurator/scene/scene-controls/SelectionHotspot.js +1 -1
- package/dist/configurator/ui/assistant/AssistantMarkdown.d.ts +1 -1
- package/dist/configurator/ui/assistant/AssistantMarkdown.js +1 -1
- package/dist/configurator/ui/assistant/entity-link/AssistantEntityLink.js +1 -1
- package/dist/configurator/ui/assistant/resource-image/AssistantImage.d.ts +9 -0
- package/dist/configurator/ui/assistant/resource-image/AssistantImage.js +1 -0
- package/dist/configurator/ui/assistant/resource-image/index.d.ts +3 -0
- package/dist/configurator/ui/assistant/resource-image/index.js +1 -0
- package/dist/configurator/ui/assistant/resource-image/resource-path.d.ts +11 -0
- package/dist/configurator/ui/assistant/resource-image/resource-path.js +1 -0
- package/dist/configurator/ui/assistant/resource-image/use-resource-image-url.d.ts +5 -0
- package/dist/configurator/ui/assistant/resource-image/use-resource-image-url.js +1 -0
- package/dist/configurator/ui/assistant/streamed-markdown.js +1 -1
- package/dist/configurator/ui/assistant/use-follow-stream.js +1 -1
- package/dist/configurator/ui/configurator-layout/slots/mobile-tabs/use-mobile-tabs.d.ts +1 -1
- package/dist/configurator/ui/configurator-layout/slots/mobile-tabs/use-mobile-tabs.js +1 -1
- package/dist/configurator/ui/configurator-layout/slots/services/InvariantViolations.js +1 -1
- package/dist/configurator/ui/configurator-layout/slots/services/Services.js +1 -1
- package/dist/configurator/ui/configurator-layout/slots/sidebar-tabs/use-sidebar-tabs.d.ts +1 -1
- package/dist/configurator/ui/configurator-layout/slots/sidebar-tabs/use-sidebar-tabs.js +1 -1
- package/dist/configurator/ui/legacy/layout/common/CommonFinalizeButton.js +1 -1
- package/dist/configurator/ui/legacy/layout/common/CommonSummaryButton.js +1 -1
- package/dist/configurator/ui/legacy/layout/common/CommonTopNavigation.js +1 -1
- package/dist/configurator/ui/legacy/layout/common/ResponsiveFinalizeButton.js +1 -1
- package/dist/configurator/ui/legacy/layout/common/SummaryReadLayout.js +1 -1
- package/dist/configurator/ui/legacy/layout/simple/SimpleOwnerLayout.js +1 -1
- package/dist/configurator/ui/legacy/layout/simple/SimpleTopNavigation.js +1 -1
- package/dist/configurator/ui/legacy/layout/steps/StepsNavigation.js +1 -1
- package/dist/configurator/ui/legacy/layout/steps/StepsOwnerLayout.js +1 -1
- package/dist/configurator/ui/legacy/layout/steps/StepsSidebarFooter.js +1 -1
- package/dist/configurator/ui/legacy/layout/tabs/TabsOwnerLayout.js +1 -1
- package/dist/configurator/ui/legacy/toolbar/common/DimensionUnitSelector.js +1 -1
- package/dist/configurator/ui/legacy/toolbar/common/MeasurementsIndicatorsSwitch.js +1 -1
- package/dist/configurator/ui/legacy/toolbar/desktop-toolbar/FullscreenToolbarAction.js +1 -1
- package/dist/configurator/ui/legacy/toolbar/desktop-toolbar/HelpToolbarAction.js +1 -1
- package/dist/configurator/ui/legacy/toolbar/desktop-toolbar/MeasurementsToolbarAction.js +1 -1
- package/dist/configurator/ui/legacy/toolbar/desktop-toolbar/UndoRedoToolbarGroup.js +1 -1
- package/dist/configurator/ui/phoenix-layout-elements/EnterFullscreenToolbarButton.js +1 -1
- package/dist/configurator/ui/phoenix-layout-elements/ExitFullscreenToolbarButton.js +1 -1
- package/dist/configurator/ui/phoenix-layout-elements/HelpToolbarButton.js +1 -1
- package/dist/configurator/ui/phoenix-layout-elements/LayoutCustomOwnerUi.d.ts +1 -0
- package/dist/configurator/ui/phoenix-layout-elements/LayoutCustomOwnerUi.js +1 -1
- package/dist/configurator/ui/phoenix-layout-elements/LayoutCustomReadUi.d.ts +1 -0
- package/dist/configurator/ui/phoenix-layout-elements/LayoutCustomReadUi.js +1 -1
- package/dist/configurator/ui/phoenix-layout-elements/MeasurementsToolbarButton.js +1 -1
- package/dist/configurator/ui/phoenix-layout-elements/RedoToolbarButton.js +1 -1
- package/dist/configurator/ui/phoenix-layout-elements/UndoToolbarButton.js +1 -1
- package/dist/configurator/ui/phoenix-layout-elements/header/common/back-button/use-go-back-action.js +1 -1
- package/dist/configurator/ui/phoenix-layout-elements/header/common/horizontal-tabs/DesktopHorizontalTabs.js +1 -1
- package/dist/configurator/ui/phoenix-layout-elements/header/common/step-navigation/StepsNavigation.js +1 -1
- package/dist/configurator/ui/phoenix-layout-elements/measurements/DimensionUnitSelector.js +1 -1
- package/dist/configurator/ui/phoenix-layout-elements/measurements/MeasurementsIndicatorsSwitch.js +1 -1
- package/dist/configurator/ui/phoenix-layout-elements/sidebar-footer/basic/BasicFinalizeButton.js +1 -1
- package/dist/configurator/ui/phoenix-layout-elements/sidebar-footer/common/CustomFinalizeButton.js +1 -1
- package/dist/configurator/ui/phoenix-layout-elements/sidebar-footer/common/EnterSummaryButton.js +1 -1
- package/dist/configurator/ui/phoenix-layout-elements/sidebar-footer/common/NextStepButton.js +1 -1
- package/dist/configurator/ui/phoenix-layout-elements/sidebar-footer/common/PreviousStepButton.js +1 -1
- package/dist/configurator/ui/preset-layout/CategoryPresetUi.js +1 -1
- package/dist/configurator/ui/preset-layout/PresetUi.d.ts +4 -0
- package/dist/configurator/ui/preset-layout/PresetUi.js +1 -1
- package/dist/configurator/ui/save-message-snackbars/SaveMessageSnackbars.d.ts +10 -0
- package/dist/configurator/ui/save-message-snackbars/SaveMessageSnackbars.js +1 -0
- package/dist/configurator/ui/save-message-snackbars/index.d.ts +1 -0
- package/dist/configurator/ui/save-message-snackbars/index.js +1 -0
- package/dist/docs/index.json +1 -1
- package/dist/docs/layouts/custom-layout.mdx +8 -7
- package/dist/docs/other-features/not-found-404.mdx +1 -1
- package/dist/docs/phoenix/clerk-sign-in.mdx +1 -1
- package/dist/docs/phoenix/configurator-interface.mdx +51 -22
- package/dist/docs/phoenix/getting-started.mdx +5 -3
- package/dist/docs/phoenix/layout-slots.mdx +19 -19
- package/dist/docs/phoenix/localization.mdx +2 -0
- package/dist/docs/phoenix/migration-guide.mdx +3 -3
- package/dist/docs/phoenix/phoenix-cli.mdx +22 -11
- package/dist/docs/phoenix/project-structure.mdx +45 -27
- package/dist/docs/phoenix/quickstart.mdx +7 -7
- package/dist/docs/phoenix/sdk-builder-workflow.mdx +6 -6
- package/dist/docs/phoenix/testing.mdx +8 -0
- package/dist/domain/application/assistant/generate-assistant-prompt.js +1 -1
- package/dist/domain/domain-runtime/spec/module-checks/element-registration.d.ts +12 -11
- package/dist/domain/domain-runtime/spec/module-checks/element-registration.js +1 -1
- package/dist/domain/domain-runtime/spec/module-checks/index.d.ts +1 -1
- package/dist/domain/domain-runtime/spec/module-checks/index.js +1 -1
- package/dist/domain/domain-runtime/spec/selectors.js +1 -1
- package/dist/editor/Editor.d.ts +7 -0
- package/dist/editor/Editor.js +1 -1
- package/dist/editor/mocks/CreateMockYaml.js +2 -2
- package/dist/editor/mocks/EditorMockContext.d.ts +2 -0
- package/dist/editor/mocks/EditorMockContext.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/frontend-admin.js +10 -11
- package/dist/legacy/phoenix-cli/project-gen/generators/file-templates/frontend-embedded-admin.js +9 -10
- package/dist/phoenix/application-spec/application-spec-builder.d.ts +0 -2
- package/dist/phoenix/application-spec/application-spec-builder.js +1 -1
- package/dist/phoenix/application-spec/generate-application-spec-project.d.ts +0 -2
- package/dist/phoenix/application-spec/generate-application-spec-project.js +2 -2
- package/dist/phoenix/application-spec/generate-project-files.d.ts +0 -2
- package/dist/phoenix/cli.js +1 -1
- package/dist/phoenix/commands/build.js +1 -1
- package/dist/phoenix/commands/clean.js +1 -1
- package/dist/phoenix/commands/deploy.js +2 -2
- package/dist/phoenix/commands/deps/deps.d.ts +22 -1
- package/dist/phoenix/commands/deps/deps.js +2 -2
- package/dist/phoenix/commands/deps/index.d.ts +1 -1
- package/dist/phoenix/commands/deps/index.js +1 -1
- package/dist/phoenix/commands/deps/sdk-manifest.js +1 -1
- package/dist/phoenix/commands/dev.js +4 -4
- package/dist/phoenix/commands/init.d.ts +17 -5
- package/dist/phoenix/commands/init.js +1 -1
- package/dist/phoenix/commands/link.js +1 -1
- package/dist/phoenix/commands/sync.js +1 -1
- package/dist/phoenix/commands/unlink.js +1 -1
- package/dist/phoenix/services/application-spec-project-watcher.d.ts +0 -2
- package/dist/phoenix/services/application-spec-project-watcher.js +2 -2
- package/dist/phoenix/utils/index.d.ts +2 -1
- package/dist/phoenix/utils/index.js +1 -1
- package/dist/phoenix/utils/package-info.d.ts +0 -9
- package/dist/phoenix/utils/package-info.js +1 -1
- package/dist/phoenix/utils/package-manager/index.d.ts +2 -0
- package/dist/phoenix/utils/package-manager/index.js +1 -0
- package/dist/phoenix/utils/package-manager/package-manager-commands.d.ts +19 -0
- package/dist/phoenix/utils/package-manager/package-manager-commands.js +1 -0
- package/dist/phoenix/utils/package-manager/pnpm-project.d.ts +9 -0
- package/dist/phoenix/utils/package-manager/pnpm-project.js +1 -0
- package/dist/react-sdk/application-runtime/common-services/analytics/index.d.ts +1 -0
- package/dist/react-sdk/application-runtime/common-services/analytics/index.js +1 -1
- package/dist/react-sdk/domain-application-context/DomainLifecycleBoundary.js +1 -1
- package/dist/react-sdk/domain-context/common-hooks/use-configurator-messages.d.ts +15 -4
- package/dist/react-sdk/domain-context/common-hooks/use-configurator-messages.js +1 -1
- package/dist/react-sdk/domain-context/index.d.ts +2 -0
- package/dist/react-sdk/domain-context/index.js +1 -1
- package/dist/react-sdk/domain-context/system-hooks/tab-navigation-hooks.d.ts +61 -0
- package/dist/react-sdk/domain-context/system-hooks/tab-navigation-hooks.js +1 -0
- package/dist/react-sdk/domain-context/system-hooks/undo-redo-hooks.d.ts +20 -0
- package/dist/react-sdk/domain-context/system-hooks/undo-redo-hooks.js +1 -0
- package/dist/react-sdk/handlers/index.d.ts +1 -0
- package/dist/react-sdk/handlers/index.js +1 -1
- package/dist/react-sdk/handlers/use-finalize-action.js +1 -0
- package/dist/react-sdk/session/NotAuthenticatedPage.d.ts +4 -0
- package/dist/react-sdk/session/NotAuthenticatedPage.js +1 -1
- package/dist/ui-sdk/theme/types.d.ts +1 -1
- package/package.json +3 -3
- package/dist/application-spec/generate-application/code/templates/nvmrc.d.ts +0 -1
- package/dist/application-spec/generate-application/code/templates/nvmrc.js +0 -2
- package/dist/application-spec/generate-application/code/templates/package-json.d.ts +0 -10
- package/dist/application-spec/generate-application/code/templates/package-json.js +0 -1
- package/dist/configurator/common/use-finalize-action.js +0 -1
- package/dist/phoenix/commands/generate-project-files.d.ts +0 -6
- package/dist/phoenix/commands/generate-project-files.js +0 -1
- /package/dist/{configurator/common → react-sdk/application-runtime/common-services/analytics}/frontend-analytics.d.ts +0 -0
- /package/dist/{configurator/common → react-sdk/application-runtime/common-services/analytics}/frontend-analytics.js +0 -0
- /package/dist/{configurator/common → react-sdk/handlers}/use-finalize-action.d.ts +0 -0
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import type { MemoEvalPlan } from '../../parse-application-files/index.js';
|
|
2
|
+
/**
|
|
3
|
+
* The id under which the generated `.phoenix/spec-code.ts` holds one piece of code written in YAML,
|
|
4
|
+
* and under which the runtime looks it up. Ids are unique within one domain; the configurator and
|
|
5
|
+
* the admin domain each have their own map.
|
|
6
|
+
*
|
|
7
|
+
* An id is computed from what the runtime spec already carries, by the functions of this file, on
|
|
8
|
+
* both sides: the generator that writes the closures and the runtime that reads them. It names the
|
|
9
|
+
* entity or alias that owns the code, the expression or the component instance, the position of the
|
|
10
|
+
* code inside that one value, and a hash of the code's text. So it stays the same when anything
|
|
11
|
+
* else in the spec changes, and it changes whenever the code itself changes: a module generated from
|
|
12
|
+
* another version of the spec does not hold it, and the runtime compiles the text instead of running
|
|
13
|
+
* the wrong closure.
|
|
14
|
+
*/
|
|
15
|
+
export type SpecCodeId = string;
|
|
16
|
+
/**
|
|
17
|
+
* The part of an id that names a value expression: `KitchenRange.$maxWidth`. Its constant, when it
|
|
18
|
+
* is one, shares the plan and so the ids.
|
|
19
|
+
*/
|
|
20
|
+
export declare const specCodeExpressionKey: (typeOrAlias: string, expressionName: string) => string;
|
|
21
|
+
/**
|
|
22
|
+
* The part of an id that names a component instance: `KitchenRange.main:detail`. The component
|
|
23
|
+
* belongs to it because an instance name is unique per component, not per entity: one entity can
|
|
24
|
+
* attach `main` of several components.
|
|
25
|
+
*/
|
|
26
|
+
export declare const specCodeComponentKey: (typeOrAlias: string, instanceName: string, componentName: string) => string;
|
|
27
|
+
/**
|
|
28
|
+
* The id of each dependency of a plan, by dependency index: `<key>#<n>@<hash>` for the `n`-th
|
|
29
|
+
* `$eval` dependency, `undefined` for a read. `key` is the expression or component key of the value
|
|
30
|
+
* the plan builds. The ordinal counts the plan's `$eval` dependencies only, so a `$read` added to
|
|
31
|
+
* the same value does not renumber them.
|
|
32
|
+
*/
|
|
33
|
+
export declare const specCodeEvalIds: (plan: MemoEvalPlan, key: string) => ReadonlyArray<SpecCodeId | undefined>;
|
|
34
|
+
/**
|
|
35
|
+
* Id of the `$eval` of one filter criterion of a component instance:
|
|
36
|
+
* `KitchenRange.label:textValue#filter0.active@<hash>`. `componentKey` comes from
|
|
37
|
+
* {@link specCodeComponentKey}; `branch` is the index of the filter among the `$or` alternatives,
|
|
38
|
+
* 0 when the filter has none; `code` is the criterion's code.
|
|
39
|
+
*/
|
|
40
|
+
export declare const specCodeFilterId: (componentKey: string, branch: number, criterion: string, code: string) => SpecCodeId;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
let e=e=>{let t=e.trim(),o=0x811c9dc5;for(let e=0;e<t.length;e++)o^=t.charCodeAt(e),o=Math.imul(o,0x1000193)>>>0;return o.toString(16).padStart(8,"0")};export const specCodeExpressionKey=(e,t)=>`${e}.${t}`;export const specCodeComponentKey=(e,t,o)=>`${e}.${t}:${o}`;export const specCodeEvalIds=(t,o)=>{let r=0;return t.deps.map(t=>"eval"===t.kind?`${o}#${r++}@${e(t.code)}`:void 0)};export const specCodeFilterId=(t,o,r,d)=>`${t}#filter${o}.${r}@${e(d)}`;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import e from"lodash-es/isEqual.js";import{Branded as n}from"@salsita-ai/common/utils";import{computeFileDepHashes as s}from"../../caching/index.js";import{DiagnosticCode as o,diagnosticMessages as i}from"../../errors/index.js";import{isEarlierGeneratedEslintConfig as t,isEarlierGeneratedPrettierConfig as a}from"./earlier-generated-editor-configs.js";import{isEarlierGeneratedTsconfig as r}from"./earlier-generated-tsconfig.js";import{findWebhookHandlerRegistration as m}from"./module-analysis.js";import{findWebhookSafetyViolation as l}from"./webhook-safety.js";export const buildProjectFileIndex=e=>new Map([...e.spec,...e.expressions,...e.actions,...e.handlers,...e.elements,...e.transformers,...e.components,...e.invariants,...e.migrations,...e.adminMigrations,...e.adminExpressions,...e.adminInvariants,...e.adminComponents,...e.adminElements,...e.webhooks,...e.locales,...e.mockTemplates,...e.projectFiles,...e.customCode].map(e=>[e.file.name,e]));let d=e=>/\/_[^/]+\//.test(e),c=[{path:"spec/",key:"spec"},{path:"src/admin/expressions/",key:"adminExpressions"},{path:"src/admin/invariants/",key:"adminInvariants"},{path:"src/admin/components/",key:"adminComponents"},{path:"src/admin/elements/",key:"adminElements"},{path:"src/admin/migrations/",key:"adminMigrations"},{path:"src/expressions/",key:"expressions"},{path:"src/actions/",key:"actions"},{path:"src/handlers/",key:"handlers"},{path:"src/elements/",key:"elements"},{path:"src/transformers/",key:"transformers"},{path:"src/components/",key:"components"},{path:"src/invariants/",key:"invariants"},{path:"src/migrations/",key:"migrations"},{path:"src/webhooks/",key:"webhooks"},{path:"src/locales/",key:"locales"},{path:"mocks/",key:"mockTemplates"}],p="tsconfig.json",h="eslint.config.js",f="prettier.config.js",g=new Set(["
|
|
1
|
+
import e from"lodash-es/isEqual.js";import{Branded as n}from"@salsita-ai/common/utils";import{computeFileDepHashes as s}from"../../caching/index.js";import{DiagnosticCode as o,diagnosticMessages as i}from"../../errors/index.js";import{isEarlierGeneratedEslintConfig as t,isEarlierGeneratedPrettierConfig as a}from"./earlier-generated-editor-configs.js";import{isEarlierGeneratedTsconfig as r}from"./earlier-generated-tsconfig.js";import{findWebhookHandlerRegistration as m}from"./module-analysis.js";import{findWebhookSafetyViolation as l}from"./webhook-safety.js";export const buildProjectFileIndex=e=>new Map([...e.spec,...e.expressions,...e.actions,...e.handlers,...e.elements,...e.transformers,...e.components,...e.invariants,...e.migrations,...e.adminMigrations,...e.adminExpressions,...e.adminInvariants,...e.adminComponents,...e.adminElements,...e.webhooks,...e.locales,...e.mockTemplates,...e.projectFiles,...e.customCode].map(e=>[e.file.name,e]));let d=e=>/\/_[^/]+\//.test(e),c=[{path:"spec/",key:"spec"},{path:"src/admin/expressions/",key:"adminExpressions"},{path:"src/admin/invariants/",key:"adminInvariants"},{path:"src/admin/components/",key:"adminComponents"},{path:"src/admin/elements/",key:"adminElements"},{path:"src/admin/migrations/",key:"adminMigrations"},{path:"src/expressions/",key:"expressions"},{path:"src/actions/",key:"actions"},{path:"src/handlers/",key:"handlers"},{path:"src/elements/",key:"elements"},{path:"src/transformers/",key:"transformers"},{path:"src/components/",key:"components"},{path:"src/invariants/",key:"invariants"},{path:"src/migrations/",key:"migrations"},{path:"src/webhooks/",key:"webhooks"},{path:"src/locales/",key:"locales"},{path:"mocks/",key:"mockTemplates"}],p="tsconfig.json",h="eslint.config.js",f="prettier.config.js",g=new Set([".gitignore",p,h,f,"CLAUDE.md",".cursor/rules/phoenix.mdc"]),u=new Set(["migrations","adminMigrations"]),k=c.filter(({path:e,key:n})=>e.startsWith("src/")&&u.has(n)),b=(e,n)=>{let s=e.slice(n.length).split("/");return!(s.length<=1)&&s.slice(0,-1).some(e=>!e.startsWith("_"))},C=/\.(ts|tsx|js|jsx)$/,v=(e,n)=>{if("components"===e||"adminComponents"===e)return n.hasUseWebhookDirective?{membership:"pinned",logSuffix:"webhook ('use webhook' directive)"}:{membership:"frontend",logSuffix:"frontend only (no 'use webhook' directive)"};if("handlers"===e){let e=m(n);return void 0!==e?{membership:"named-handler",logSuffix:`webhook (the ${e} registration)`}:n.hasUseWebhookDirective?{membership:"pinned",logSuffix:"webhook ('use webhook' directive)"}:{membership:"frontend",logSuffix:"frontend only (not a named handler or pin)"}}};export const CategorizedFiles=(m,u,x,y)=>{let E={spec:[],expressions:[],actions:[],handlers:[],elements:[],transformers:[],components:[],invariants:[],migrations:[],adminMigrations:[],adminExpressions:[],adminInvariants:[],adminComponents:[],adminElements:[],webhooks:[],locales:[],mockTemplates:[],projectFiles:[],customCode:[]},j=[];for(let e of m.files){if("text"!==e.kind)continue;if(d(e.name)){E.customCode.push({file:e,category:"customCode"});continue}if(g.has(e.name)){E.projectFiles.push({file:e,category:"projectFiles"});continue}let n=!1;for(let{path:s,key:o}of c)if(e.name.startsWith(s)){E[o].push({file:e,category:o}),n=!0;break}n||j.push(e.name)}for(let e of j)e.startsWith("src/")&&x.error(o.UNKNOWN_SRC_PATH,i.UNKNOWN_SRC_PATH(e));for(let{path:e,key:n}of k)for(let s of E[n])b(s.file.name,e)&&x.error(o.INVALID_SUBDIRECTORY,i.INVALID_SUBDIRECTORY(s.file.name,e));let I=E.webhooks.some(e=>"src/webhooks/index.ts"===e.file.name);if(E.webhooks.length>0&&!I&&x.error(o.MISSING_WEBHOOK_INDEX,i.MISSING_WEBHOOK_INDEX()),x.hasErrors)return;let w=E.projectFiles.find(e=>e.file.name===p),S=void 0!==w&&r(w.file.content),F=E.projectFiles.find(e=>e.file.name===h),_=void 0!==F&&t(F.file.content),M=E.projectFiles.find(e=>e.file.name===f),O=void 0!==M&&a(M.file.content),N=[];for(let e of Object.values(E))for(let n of e)N.push(n.file.name);let A=s(m,N),{analyzer:T,logger:D}=y,W=u.createBuilder("categorizedFiles/moduleAnalysis",{build:e=>{try{return{analysis:T(e.name,e.content)}}catch(e){return{error:e instanceof Error?e.message:String(e)}}},getKey:e=>e.name,compare:(e,n)=>e.content===n.content}),U=new Set,H=e=>{if(!C.test(e.name))return;U.add(e.name);let n=W.build({name:e.name,content:e.content}).output;return void 0!==n.error?void x.error(o.MODULE_ANALYSIS_FAILED,i[o.MODULE_ANALYSIS_FAILED](e.name,n.error)):n.analysis},B={},K={};for(let[e,s]of Object.entries(E)){let o=u.createBuilder(`categorizedFiles/${e}`,{build:e=>e,getKey:e=>e.name,compare:(e,n)=>e.depHash===n.depHash}),i=new Set;B[e]=s.map(e=>{let s=A[e.file.name]??{deps:[],hash:""},{changed:t}=o.build({name:e.file.name,depHash:s.hash});i.add(e.file.name);let a=H(e.file),r=void 0===a?void 0:v(e.category,a);return void 0!==r&&D.debug(`Webhook membership: ${e.file.name} -> ${r.logSuffix}`),n({file:e.file,category:e.category,deps:s.deps,depHash:s.hash,changed:t,analysis:a,webhookMembership:r?.membership})}),K[e]=o.cleanup(i)}W.cleanup(U);let L=(e,n)=>n.some(e=>e.changed)||!0===K[e],R=u.createBuilder("categorizedFiles/envs",{build:e=>e.envs,getKey:()=>"singleton",compare:(n,s)=>e(n.envs,s.envs)}).build({envs:m.envs}),P=n({spec:B.spec,specChanged:L("spec",B.spec),expressions:B.expressions,expressionsChanged:L("expressions",B.expressions),actions:B.actions,actionsChanged:L("actions",B.actions),handlers:B.handlers,handlersChanged:L("handlers",B.handlers),elements:B.elements,elementsChanged:L("elements",B.elements),transformers:B.transformers,transformersChanged:L("transformers",B.transformers),components:B.components,componentsChanged:L("components",B.components),invariants:B.invariants,invariantsChanged:L("invariants",B.invariants),migrations:B.migrations,migrationsChanged:L("migrations",B.migrations),adminMigrations:B.adminMigrations,adminMigrationsChanged:L("adminMigrations",B.adminMigrations),adminExpressions:B.adminExpressions,adminExpressionsChanged:L("adminExpressions",B.adminExpressions),adminInvariants:B.adminInvariants,adminInvariantsChanged:L("adminInvariants",B.adminInvariants),adminComponents:B.adminComponents,adminComponentsChanged:L("adminComponents",B.adminComponents),adminElements:B.adminElements,adminElementsChanged:L("adminElements",B.adminElements),webhooks:B.webhooks,webhooksChanged:L("webhooks",B.webhooks),hasWebhookEntry:I,locales:B.locales,localesChanged:L("locales",B.locales),mockTemplates:B.mockTemplates,mockTemplatesChanged:L("mockTemplates",B.mockTemplates),projectFiles:B.projectFiles,projectFilesChanged:L("projectFiles",B.projectFiles),hasEarlierGeneratedTsconfig:S,hasEarlierGeneratedEslintConfig:_,hasEarlierGeneratedPrettierConfig:O,customCode:B.customCode,customCodeChanged:L("customCode",B.customCode),envs:R.output,envsChanged:R.changed}),$=buildProjectFileIndex(P);for(let e of $.values()){if("pinned"!==e.webhookMembership&&"named-handler"!==e.webhookMembership)continue;let n=l(e,$);void 0!==n&&x.error(o.WEBHOOK_UNSAFE_IMPORT,i[o.WEBHOOK_UNSAFE_IMPORT](n.fileName,n.inclusionReason,n.importer,n.specifier))}return P};
|
package/dist/application-spec/parse-application-files/spec/expressions/expression-read-types.d.ts
CHANGED
|
@@ -1,12 +1,17 @@
|
|
|
1
1
|
import type { ParseContext } from '../../../core/index.js';
|
|
2
|
-
import type { ModelTypeResolution } from '../model/index.js';
|
|
2
|
+
import type { EntityOrAliasName, ExpressionName, ModelTypeResolution } from '../model/index.js';
|
|
3
3
|
import type { ExpressionRead } from './expression-read.js';
|
|
4
4
|
import type { Expression } from './expression.js';
|
|
5
|
+
/** Where an expression is declared: the spec section and the entity or alias under it. */
|
|
6
|
+
export interface ExpressionLocation {
|
|
7
|
+
readonly section: string;
|
|
8
|
+
readonly entityKey: EntityOrAliasName;
|
|
9
|
+
}
|
|
5
10
|
interface ExpressionReadTypesInput {
|
|
6
11
|
readonly userExpressions: readonly Expression[];
|
|
7
12
|
readonly expressionReads: readonly ExpressionRead[];
|
|
8
|
-
/**
|
|
9
|
-
readonly
|
|
13
|
+
/** Finds where a read expression is declared, which is where a conflict is reported. */
|
|
14
|
+
readonly locateDeclaration: (entityKey: EntityOrAliasName, name: ExpressionName) => ExpressionLocation;
|
|
10
15
|
}
|
|
11
16
|
/**
|
|
12
17
|
* Reports an expression whose declared type and the types its `$read`s expect have no value in
|
|
@@ -15,5 +20,5 @@ interface ExpressionReadTypesInput {
|
|
|
15
20
|
* A type given as `tsType` text is not read, and never reported. Relation and invariant
|
|
16
21
|
* expressions state their types only as `tsType`, so only a conflict among their reads is reported.
|
|
17
22
|
*/
|
|
18
|
-
export declare const checkExpressionReadTypes: ({ userExpressions, expressionReads,
|
|
23
|
+
export declare const checkExpressionReadTypes: ({ userExpressions, expressionReads, locateDeclaration }: ExpressionReadTypesInput, typeResolution: ModelTypeResolution, ctx: ParseContext) => void;
|
|
19
24
|
export {};
|
package/dist/application-spec/parse-application-files/spec/expressions/expression-read-types.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{DiagnosticCode as e,diagnosticMessages as
|
|
1
|
+
import{DiagnosticCode as e,diagnosticMessages as t}from"../../../errors/index.js";import{ValueType as r,formatValueType as n,intersectValueTypes as o}from"../common/index.js";export const checkExpressionReadTypes=({userExpressions:i,expressionReads:a,locateDeclaration:c},d,l)=>{let s=new Map,m=(e,t)=>{let r=`${String(e)}\0${String(t)}`,n=s.get(r);return n||(n={entityKey:e,name:t,reads:[]},s.set(r,n)),n};for(let e of i)e.declaredSchema&&(m(e.entityKey,e.name).declared=r(e.declaredSchema,{...d,author:"project"}));for(let e of a)m(e.entityKey,e.name).reads.push(e);for(let{entityKey:r,name:i,declared:a,reads:d}of s.values()){let[s,...m]=[...a?[a]:[],...d.map(e=>e.expected)];if(!s||m.reduce(o,s).length>0)continue;let p=c(r,i);l.at(p.section,String(p.entityKey),String(i)).error(e.EXPRESSION_READ_TYPE_CONFLICT,t.EXPRESSION_READ_TYPE_CONFLICT(String(p.entityKey),String(i),a&&n(a),d.map(e=>`${n(e.expected)} at "${e.location}"`)))}};
|
package/dist/application-spec/parse-application-files/spec/expressions/expression-value-type.d.ts
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type EnhancedJsonValue } from '../../../core/index.js';
|
|
2
|
+
import { ValueType } from '../common/index.js';
|
|
3
|
+
import type { ModelTypeResolution } from '../model/index.js';
|
|
4
|
+
/**
|
|
5
|
+
* The type generated code gives the inline value of an expression that declares a schema: a `$msg`
|
|
6
|
+
* compiles to a lingui `MessageDescriptor`. The only other such value is an `$eval`, which is code
|
|
7
|
+
* whose type is not read; constants never declare a schema.
|
|
8
|
+
*/
|
|
9
|
+
export declare const expressionValueType: (value: EnhancedJsonValue, resolution: ModelTypeResolution) => ValueType;
|
package/dist/application-spec/parse-application-files/spec/expressions/expression-value-type.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{isMsgMarker as e}from"../../../core/index.js";import{ValueType as o}from"../common/index.js";let r=[{kind:"unknown"}];export const expressionValueType=(n,s)=>e(n)?o({$ref:"phx:MessageDescriptor"},{...s,author:"sdk"}):r;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Branded as e}from"@salsita-ai/common/utils";import{intersectSchemas as t,isSdkExpressionImplementation as n}from"../../../core/index.js";import{DiagnosticCode as o,diagnosticMessages as i}from"../../../errors/index.js";import{ModelTypeResolution as r}from"../model/index.js";import{checkExpressionReadTypes as s}from"./expression-read-types.js";import{UserExpressions as a}from"./user-expressions.js";let l=(e,t)=>{let n=e.get(t.entityKey);n||(n=new Map,e.set(t.entityKey,n)),n.set(t.name,t)},
|
|
1
|
+
import{Branded as e}from"@salsita-ai/common/utils";import{intersectSchemas as t,isSdkExpressionImplementation as n}from"../../../core/index.js";import{DiagnosticCode as o,diagnosticMessages as i}from"../../../errors/index.js";import{ModelTypeResolution as r}from"../model/index.js";import{checkExpressionReadTypes as s}from"./expression-read-types.js";import{UserExpressions as a}from"./user-expressions.js";let l=(e,t)=>{let n=e.get(t.entityKey);n||(n=new Map,e.set(t.entityKey,n)),n.set(t.name,t)},m=(n,o)=>{let i=n.get(o.entityKey);i||(i=new Map,n.set(o.entityKey,i));let r=i.get(o.name);r?i.set(o.name,e({...r,schema:t(r.schema,o.schema),...r.declaredSchema||!o.declaredSchema?{}:{declaredSchema:o.declaredSchema}})):i.set(o.name,o)},f=e=>"relation"===e.implementation.kind?"relations":"violations"===e.implementation.kind?"invariants":"expressions";export const Expressions=(t,p)=>{let{rawExpressions:c,inferredExpressions:d,expressionReads:y}=t,{latestModel:u,aliases:g,entityTypes:x,evalExpressionParser:h,parsingContext:S}=p,w=r(u,p.phxDefinitions),K=a(c,{latestModel:u,evalExpressionParser:h,typeResolution:w,parsingContext:S});if(void 0===K)return;let M=new Map;for(let e of K)l(M,e);for(let e of d)m(M,e);let E=((e,t)=>{let o=new Map,i=e=>{let t=o.get(e.entityKey);t||(t=new Set,o.set(e.entityKey,t)),t.add(e.name)};for(let t of e)i(t);for(let e of t)n(e.implementation)&&i(e);return o})(K,d);s({userExpressions:K,expressionReads:y,locateDeclaration:(e,t)=>{for(let n of[e,...[...g].filter(([,t])=>t.some(t=>t===e)).map(([e])=>e)]){let e=E.get(n)?.has(t)?M.get(n)?.get(t):void 0;if(e)return{section:f(e),entityKey:n}}return{section:"expressions",entityKey:e}}},w,S);let j=new Map;for(let e of K){let{implementation:t}=e;if("value"!==t.kind||!t.constant||t.plan.usesSelf)continue;let n=j.get(e.entityKey);n||(n=new Map,j.set(e.entityKey,n)),n.set(e.name,t.plan)}let v=new Map;for(let t of x){let n=[],r=new Map,s=e=>{let s=M.get(e);if(!s||0===s.size)return;n.push(e);let a=E.get(e);for(let[n,l]of s){if(!a?.has(n))continue;let s=r.get(n);if(s){S.at(f(l),e,n).error(o.DUPLICATE_EXPRESSION,i.DUPLICATE_EXPRESSION(t,n,s,e));continue}r.set(n,e)}};for(let[e,n]of g)n.includes(t)&&s(e);s(t),v.set(t,e({shapeGroups:n}))}return e({expressions:M,entityExpressions:v,constants:j})};
|
package/dist/application-spec/parse-application-files/spec/expressions/user-expressions.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type EvalExpressionParser, type ParseContext } from '../../../core/index.js';
|
|
2
2
|
import type { MergedExpressions } from '../../merge/index.js';
|
|
3
|
-
import type { ModelVersion } from '../model/index.js';
|
|
3
|
+
import type { ModelTypeResolution, ModelVersion } from '../model/index.js';
|
|
4
4
|
import type { Expression } from './expression.js';
|
|
5
5
|
/**
|
|
6
6
|
* Validates user-declared expressions from merged YAML.
|
|
@@ -15,6 +15,8 @@ import type { Expression } from './expression.js';
|
|
|
15
15
|
interface UserExpressionsContext {
|
|
16
16
|
readonly latestModel: ModelVersion;
|
|
17
17
|
readonly evalExpressionParser: EvalExpressionParser;
|
|
18
|
+
/** Resolves the refs of the declared schemas, for checking an inline value against its schema. */
|
|
19
|
+
readonly typeResolution: ModelTypeResolution;
|
|
18
20
|
readonly parsingContext: ParseContext;
|
|
19
21
|
}
|
|
20
22
|
export declare const UserExpressions: (rawExpressions: MergedExpressions, context: UserExpressionsContext) => readonly Expression[] | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Branded as e}from"@salsita-ai/common/utils";import{schemaFromValue as
|
|
1
|
+
import{Branded as e}from"@salsita-ai/common/utils";import{schemaFromValue as r}from"../../../enhanced-json/index.js";import{DiagnosticCode as t,diagnosticMessages as o}from"../../../errors/index.js";import{ValueType as s,formatValueType as m,isAssignableValueType as a}from"../common/index.js";import{ExpressionName as n}from"../model/index.js";import{expressionValueType as i}from"./expression-value-type.js";import{MemoEvalPlan as l}from"./memo-eval-plan.js";let c=(e,n,c,p,E)=>{if("user"===e.kind)return{schema:e.schema,implementation:{kind:"user"}};let h=l(e.value,n),u={kind:"value",constant:e.constant,value:e.value,plan:h};if(Object.keys(e.schema).length>0){var f,d;let r,l;return f=e.value,d=e.schema,r=i(f,E),a(r,l=s(d,{...E,author:"project"}))||c.error(t.EXPRESSION_VALUE_TYPE_MISMATCH,o.EXPRESSION_VALUE_TYPE_MISMATCH(n,m(r),m(l))),{schema:e.schema,implementation:u}}let N=r(e.value,c,p);if(void 0!==N)return{schema:N,implementation:u}};export const UserExpressions=(r,s)=>{let{latestModel:m,evalExpressionParser:a,typeResolution:i,parsingContext:l}=s,{allNames:p}=m,E=[...p].map(String),h=[];for(let[s,m]of Object.entries(r)){p.has(s)||l.error(t.EXPRESSION_UNKNOWN_ENTITY_KEY,o.EXPRESSION_UNKNOWN_ENTITY_KEY(s,E));let r=e(s);for(let[t,o]of Object.entries(m)){let m=l.at(s),p=n(t,m);if(!p)continue;let E=c(o,`${s}.${t}`,m.at(t),a,i);E&&h.push(e({entityKey:r,name:p,schema:E.schema,declaredSchema:E.schema,implementation:E.implementation}))}}if(!l.hasErrors)return h};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The agent's operation document with the closing braces it left off added at its end. Models
|
|
3
|
+
* often drop the last `}` of a nested selection, and the only error GraphQL gives for it is
|
|
4
|
+
* "Expected Name, found <EOF>", which costs the agent a round trip to fix. At the end of a
|
|
5
|
+
* document, closing braces are the only completion there is, so this cannot change what a valid
|
|
6
|
+
* document means; a brace missing in the middle nests the following fields one level deeper, which
|
|
7
|
+
* validation then rejects. Appending keeps the positions GraphQL reports for the agent's own text.
|
|
8
|
+
* A document with no unclosed brace, which covers every document that parses, or one that still
|
|
9
|
+
* does not parse with them closed is returned as it is, so GraphQL reports the agent's own syntax
|
|
10
|
+
* error and not one of the repair.
|
|
11
|
+
*/
|
|
12
|
+
export declare const closeUnclosedBraces: (document: string) => string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{Lexer as r,Source as e,TokenKind as t,parse as n}from"graphql";export const closeUnclosedBraces=c=>{let a=(n=>{let c=new r(new e(n)),a=0;try{for(let r=c.advance();r.kind!==t.EOF;r=c.advance())r.kind===t.BRACE_L?a+=1:r.kind===t.BRACE_R&&(a-=1)}catch{return 0}return a})(c);if(a<=0)return c;let l=`${c}${" }".repeat(a)}`;return(r=>{try{return n(r),!0}catch{return!1}})(l)?l:c};
|
package/dist/configurator/application-runtime/extensions/systems/graphql-system/graphql-system.d.ts
CHANGED
|
@@ -97,7 +97,7 @@ export declare class GraphQLSystem {
|
|
|
97
97
|
/**
|
|
98
98
|
* Runs the operations in order through one working state that starts at `originalState`: a query
|
|
99
99
|
* reads the current working state, and each mutation field advances it with its own emission.
|
|
100
|
-
* The
|
|
100
|
+
* The closing braces an operation's document left off are added, then the lenses it spreads are injected into it. Nothing is committed. The first operation that fails stops the list; every later one gets a
|
|
101
101
|
* "not run" error instead.
|
|
102
102
|
*/
|
|
103
103
|
prepare: (originalState: AnyDomainState, operations: readonly GraphQLOperation[]) => Promise<readonly PreparedOperation[]>;
|
package/dist/configurator/application-runtime/extensions/systems/graphql-system/graphql-system.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{GraphQLError as e,NoSchemaIntrospectionCustomRule as t,defaultFieldResolver as i,execute as o,getNamedType as n,parse as r,specifiedRules as a,validate as s,validateSchema as l}from"graphql";import{assertExistence as c,createSelector as d,isMessageDescriptor as h,isMultilingualString as u}from"@salsita-ai/common/utils";import{DomainEntityIdSchema as m,createAssistantExecutionSchema as f,findAssistantMutation as p}from"#package/domain";import{
|
|
1
|
+
import{GraphQLError as e,NoSchemaIntrospectionCustomRule as t,defaultFieldResolver as i,execute as o,getNamedType as n,parse as r,specifiedRules as a,validate as s,validateSchema as l}from"graphql";import{assertExistence as c,createSelector as d,isMessageDescriptor as h,isMultilingualString as u}from"@salsita-ai/common/utils";import{DomainEntityIdSchema as m,createAssistantExecutionSchema as f,findAssistantMutation as p}from"#package/domain";import{closeUnclosedBraces as g}from"./close-unclosed-braces.js";import{createEntityMeta as y}from"./entity-meta.js";import{injectAssistantLenses as v}from"./inject-assistant-lenses.js";import{readSideEffects as S}from"./side-effects.js";let _={errors:[new e("The configurator does not provide this request. This is a fault in the configurator, not in your request. Tell the user this is not available.")]},x={errors:[new e("The configuration is not loaded yet, so there is no state to query. Run the query again once the configurator has finished loading.")]},w=new RegExp(m.pattern),E=[...a,t],$=e=>"object"==typeof e&&null!==e&&"type"in e&&"string"==typeof e.type&&"id"in e&&"string"==typeof e.id,b=(e,t)=>"object"==typeof e&&null!==e?Reflect.get(e,t):void 0,T=e=>e instanceof Error?e.message:String(e),C=e=>/[.!?]$/.test(e)?e:`${e}.`,R=e=>"object"==typeof e&&null!==e&&Object.getPrototypeOf(e)===Object.prototype,j=(e,t)=>{let i=R(e)?e._raw:void 0;if($(i))return i;if(!Array.isArray(e)&&!R(e))return e;if(t.has(e))throw Error("The value contains itself.");let o=new Set([...t,e]);return Array.isArray(e)?e.map(e=>j(e,o)):Object.fromEntries(Object.entries(e).map(([e,t])=>[e,j(t,o)]))};export const localize=(e,t)=>Array.isArray(e)?e.map(e=>localize(e,t)):"string"==typeof e||h(e)||u(e)?t(e):e;let A=t=>new e(`The configurator cannot handle this request: ${C(t)} This is a fault in the configurator, not in your request. Tell the user this is not available.`),M=e=>(e.errors?.length??0)>0,z=t=>({errors:[new e(`Not run: operation ${t+1} failed, so the operations after it were skipped and no change of the list takes effect. Fix the failing operation and send the whole list again.`)]});export class GraphQLSystem{_context;_selectSchema=d([d.leaf(e=>e)],e=>{try{let t=f(e),i=l(t);return i.length>0?A(i.map(e=>e.message).join(" ")):t}catch(e){return A(T(e))}});_selectLenses=d([d.leaf(e=>e)],e=>r(e));_selectFieldResolver=d([d.leaf(e=>e)],t=>(o,r,a,s)=>{if(s.parentType===s.schema.getQueryType())return i(o,r,a,s);if(s.parentType===s.schema.getMutationType())return this._resolveMutation(s.fieldName,String(s.path.key),r,a);if(!$(o))return i(o,r,a,s);if("meta"===s.fieldName){let e;return y({entity:o,state:("object"==typeof(e=b(o,"_state"))&&null!==e&&"entities"in e&&"rootEntityId"in e?e:void 0)??a.state},{manifest:a.manifest,recipes:this._recipeContext(),prepareStateEmission:(e,t,i)=>this._context.domainContextSelectors.getStoreSystem().prepareStateEmission(e,t,i),find$Entity:(e,t)=>this._find$Entity(e,t),validateEntity:e=>this._context.domainContextSelectors.getDomain().validateEntity(e)})}let{source:l,localized:c}=t[s.parentType.name]?.[s.fieldName]??{source:s.fieldName},d=((t,i)=>{try{return b(t,i)}catch(o){throw new e(`Expression "${i}" failed on ${$(t)?t.id:"an entity"}: ${C(T(o))} This is a fault in the configurator, not in your request. Tell the user this is not available.`,{originalError:o instanceof Error?o:void 0})}})(o,l);return c?localize(d,this._context.domainServicesSelectors.getResolveLocalizable()):l.startsWith("$")&&"JSON"===n(s.returnType).name?((t,i,o)=>{try{return j(o,new Set)}catch(o){throw new e(`Expression "${i}" returned a value that is not plain serializable data on ${$(t)?t.id:"an entity"}: ${C(T(o))} This is a fault in the configurator, not in your request. Tell the user this is not available.`,{originalError:o instanceof Error?o:void 0})}})(o,l,d):d});constructor(e){this._context=e}_get$Entity=(e,t)=>this._context.domainContextSelectors.getDomain().get$Entity(e,t);_find$Entity=(e,t)=>this._context.domainContextSelectors.getDomain().getEntity(e,t)?this._get$Entity(e,t):null;_recipeContext=()=>({componentReader:this._context.domainContextSelectors.getComponentReader(),recipeCooker:this._context.domainContextSelectors.getRecipeCookerSystem(),resolveLocalizable:this._context.domainServicesSelectors.getResolveLocalizable()});_rootValue={root:(e,{state:t})=>this._get$Entity(t.rootEntityId,t),entities:({ids:t},{state:i})=>{if(null==t)return i.entities.map(e=>this._get$Entity(e.id,i));var o=i.rootEntityId;let n=t.filter(e=>!w.test(e));if(n.length>0)throw new e(`${n.map(e=>`"${e}"`).join(", ")} ${1===n.length?"is not an entity id":"are not entity ids"}. Entity ids have the form "<Type>-<number>", e.g. "${o}". Use ids as returned by the "id" field.`);return t.map(e=>w.test(e)?this._find$Entity(e,i):null)},selectedEntity:(e,{state:t})=>this._find$Entity(this._context.domainContextSelectors.getNavigationSystem().getActiveSelectionState(t),t),navigation:(e,{state:t})=>{let i=this._context.domainContextSelectors.getNavigationSystem();return{navigationState:i.getActiveNavigationState(t),viewState:i.getActiveViewState(t),toolState:i.getActiveToolState(t)}}};_resolveType=e=>$(e)?e.type:void 0;initialize=()=>{};_resolveMutation=(t,i,o,n)=>{if(void 0!==n.failedMutationField)throw new e(`Not run: the earlier field "${n.failedMutationField}" of this operation failed, so "${i}" was skipped and no change of the operation takes effect. Fix the failing field and send the operation again.`);try{return this._runMutation(t,o,n)}catch(e){throw n.failedMutationField=i,e}};_runMutation=(t,i,o)=>{let n=p(t,o.manifest);if(!n)throw new e(`The schema declares the mutation "${t}", but the configurator has no implementation for it. This is a fault in the configurator, not in your request. Tell the user this is not available.`);let r=o.state,a=n.implementation(i,r,{manifest:o.manifest,action:this._context.domainContextSelectors.getActionSystem().createContext(r),resolveLocalizable:this._context.domainServicesSelectors.getResolveLocalizable()});if(a.updates.length>0){let i=this._context.domainContextSelectors.getStoreSystem().prepareStateEmission(a.updates,r,"committed");if(!i.validity.valid)throw new e(`The changes of "${t}" were not applied, because the resulting configuration is invalid: ${(e=>{if("uncaught"===e.severity)return`validating it threw: ${C(T(e.error))}`;let t=[...new Set(e.entityViolations.filter(({violation:t})=>t.severity===e.severity).map(({entityId:e})=>e))];return`it has ${e.severity} violations on ${t.join(", ")}.`})(i.validity)} Change the request so the configuration stays valid.`);o.emissions.push(i),o.state=i.state}return a.readResult({previousState:r,state:o.state})};_setup=()=>{let{manifest:t,error:i}=this._context.getAssistantSetup();if(i)return{ready:!1,result:{errors:[new e(i.message,{originalError:i})]}};if(!t)return{ready:!1,result:_};let o=this._selectSchema(t.sdl);return o instanceof e?{ready:!1,result:{errors:[o]}}:{ready:!0,assistant:t,schema:o,lenses:t.lenses?.definitions?this._selectLenses(t.lenses.definitions):void 0,fieldResolver:this._selectFieldResolver(t.fields)}};_run=(t,i,n,a)=>{let l;try{l=r(t)}catch(t){return{errors:[t instanceof e?t:new e(T(t))]}}let c=s(n.schema,l,E);return c.length>0?{errors:c}:o({schema:n.schema,document:l,rootValue:this._rootValue,contextValue:a,variableValues:i.variables,operationName:i.operationName,fieldResolver:n.fieldResolver,typeResolver:this._resolveType})};prepare=async(t,i)=>{let o,n=this._setup();if(!n.ready)return i.map(()=>({result:n.result,emissions:[]}));let r={manifest:n.assistant,state:t,emissions:[],failedMutationField:void 0},a=[];for(let[t,s]of i.entries())if(void 0===o){let i=r.emissions.length;r.failedMutationField=void 0;let l=g(s.document),c=n.lenses?v(l,n.lenses):l,d=c instanceof e?{errors:[c]}:await this._run(c,s,n,r);a.push({result:d,emissions:r.emissions.slice(i)}),M(d)&&(o=t)}else a.push({result:z(o),emissions:[]});return a};readSideEffects=e=>{let t=this._context.domainServicesSelectors.getResolveLocalizable();return e.flatMap(({emissions:e})=>e.flatMap(e=>S(e.updates,t)))};_prepareAndCommit=async e=>{let t,i,o,n=this._context.domainContextSelectors.getStoreSystem(),r=await this.prepare(n.stateSlices.committed.value.state,e),a=r.map(({result:e})=>e),s=this.readSideEffects(r),l=r.flatMap(e=>e.emissions);if(a.some(M)||0===l.length)return{results:a,sideEffects:s,outcome:"none"};let d=(t=c(l[0]),i=c(l[l.length-1]),o=l.some(e=>void 0!==e.transformationLog),{kind:"committed",previousState:t.previousState,state:i.state,updates:l.flatMap(e=>e.updates),validity:i.validity,transformationLog:o?l.flatMap(e=>e.transformationLog??[]):void 0});return{results:a,sideEffects:s,outcome:n.commitPrepared(d),preparedState:d.state}};execute=async e=>{if(!this._context.domainContextSelectors.getStoreSystem().isInitialized)return{results:e.map(()=>x),committed:!1,sideEffects:[]};let t=await this._prepareAndCommit(e),{results:i,sideEffects:o,outcome:n,preparedState:r}="conflict"===t.outcome?await this._prepareAndCommit(e):t;return"committed"===n?{results:i,committed:!0,sideEffects:o,preparedState:r}:"held"===n?{results:i,committed:!1,message:"The changes wait for the user's approval and are not applied yet. Do not send them again; the next `[changes]` block lists them once approved.",sideEffects:o,preparedState:r}:"conflict"===n?{results:i,committed:!1,message:"The changes were not committed, because the configuration changed while they were being applied. The results describe a state that was discarded. Query the current configuration and send the operations again if they still make sense.",sideEffects:o}:{results:i,committed:!1,sideEffects:o}}}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type $DomainEntity, type ConfiguratorBuilder, type CreateCustomPhoenixEntityElement, type CreateCustomPhoenixLayoutElement, type CreateGetThemeHandler, type CreateGetWebComponentOptionsHandler, type CreatePhoenixHandler, type DomainEntity, type IsCreateRecipeUpdate, type IsReplaceRecipeUpdate, type TransformerBuilder, type TransformerFactory, type UpdateFactory, getIdSequence } from '#package/domain';
|
|
2
|
-
import { type CreateCollectFrontendDataHandler, type CreateFilterPublishedChunksHandler, type CreateNotAuthenticatedPage, type IsAngleDimensionUpdate, type IsAttributeSelectionUpdate, type IsAttributeSwitchUpdate, type IsDeleteEntityUpdate, type IsDistanceDimensionUpdate, type IsGenericDimensionUpdate, type IsSwatchSelectionUpdate, type IsTextValueUpdate, type UseAccessService, type UseActiveNavigationState, type UseActiveToolState, type UseActiveViewState, type UseAnalyticsService, type UseAngleDimension, type UseAttributeSelection, type UseAttributeSwitch, type UseAuthenticatedClient, type UseAuthorizedClient, type UseBackendData, type UseChildEntitySelection, type UseComponent, type UseComponents, type UseComposition, type UseConfigurationId, type UseConfiguratorMessages, type UseControlViolations, type UseCookRecipes, type UseCookReplaceRecipes, type UseCookedRecipes, type UseCookedReplaceRecipes, type UseCreateAuthorizedClient, type UseDeleteEntity, type UseDeletedEntity, type UseDeselect, type UseDistanceDimension, type UseDistanceDimensionSelection, type UseDomainApplicationContext, type UseDomainApplicationProps, type UseDomainContext, type UseDomainEntityState, type UseEntityPrice, type UseEntitySelector, type UseFinalizeViolations, type UseFirstComponent, type UseFirstRootComponent, type UseFrontendData, type UseGenericDimension, type UseGroupedRecipeOptions, type UseHoveredDomainEntityId, type UseHoveredEntity, type UseHoveredEntityId, type UseIntegrationService, type UseIntegrationState, type UseIsFullscreenActive, type UseLoadedData, type UseLoadingState, type UseMapViolationHints, type UseNavigate, type UsePopNavigate, type UsePresetEmbeddedState, type UsePublishedData, type UsePushNavigate, type UseRecipeEmbeddedState, type UseReplaceEntityRecipeOptions, type UseRootComponents, type UseRootEntityId, type UseRootEntityPrice, type UseRootEntitySelector, type UseRootEntityState, type UseSelectEntity, type UseSelectParent, type UseSelectedDomainEntityId, type UseSelectedEntity, type UseSelectedEntityId, type UseSession, type UseSessionRole, type UseSessionService, type UseSetFullscreen, type UseSetViewState, type UseSlice, type UseState, type UseStateValidity, type UseSwatchSelection, type UseSynchronizedSelector, type UseSynchronizedSelector$, type UseTextValue, type UseUpdateControl, type UseUpdatedControl, useLoadingStateValue } from '#package/react-sdk';
|
|
2
|
+
import { type CreateCollectFrontendDataHandler, type CreateFilterPublishedChunksHandler, type CreateNotAuthenticatedPage, type IsAngleDimensionUpdate, type IsAttributeSelectionUpdate, type IsAttributeSwitchUpdate, type IsDeleteEntityUpdate, type IsDistanceDimensionUpdate, type IsGenericDimensionUpdate, type IsSwatchSelectionUpdate, type IsTextValueUpdate, type UseAccessService, type UseActiveNavigationState, type UseActiveToolState, type UseActiveViewState, type UseAnalyticsService, type UseAngleDimension, type UseAttributeSelection, type UseAttributeSwitch, type UseAuthenticatedClient, type UseAuthorizedClient, type UseBackendData, type UseChildEntitySelection, type UseComponent, type UseComponents, type UseComposition, type UseConfigurationId, type UseConfiguratorMessages, type UseControlViolations, type UseCookRecipes, type UseCookReplaceRecipes, type UseCookedRecipes, type UseCookedReplaceRecipes, type UseCreateAuthorizedClient, type UseDeleteEntity, type UseDeletedEntity, type UseDeselect, type UseDistanceDimension, type UseDistanceDimensionSelection, type UseDomainApplicationContext, type UseDomainApplicationProps, type UseDomainContext, type UseDomainEntityState, type UseEntityPrice, type UseEntitySelector, type UseFinalizeAction, type UseFinalizeViolations, type UseFirstComponent, type UseFirstRootComponent, type UseFrontendData, type UseGenericDimension, type UseGroupedRecipeOptions, type UseHoveredDomainEntityId, type UseHoveredEntity, type UseHoveredEntityId, type UseIntegrationService, type UseIntegrationState, type UseIsFullscreenActive, type UseLoadedData, type UseLoadingState, type UseMapViolationHints, type UseNavigate, type UsePopNavigate, type UsePresetEmbeddedState, type UsePublishedData, type UsePushNavigate, type UseRecipeEmbeddedState, type UseReplaceEntityRecipeOptions, type UseRootComponents, type UseRootEntityId, type UseRootEntityPrice, type UseRootEntitySelector, type UseRootEntityState, type UseSelectEntity, type UseSelectParent, type UseSelectedDomainEntityId, type UseSelectedEntity, type UseSelectedEntityId, type UseSession, type UseSessionRole, type UseSessionService, type UseSetFullscreen, type UseSetViewState, type UseSlice, type UseState, type UseStateValidity, type UseSwatchSelection, type UseSynchronizedSelector, type UseSynchronizedSelector$, type UseTabNavigation, type UseTextValue, type UseUndoRedo, type UseUpdateControl, type UseUpdatedControl, useLoadingStateValue } from '#package/react-sdk';
|
|
3
3
|
import { type CreatePhoenixIconSet } from '#package/ui-sdk';
|
|
4
4
|
import { type UseConfiguratorExtensions } from '../application-runtime/index.js';
|
|
5
5
|
import { type CreateOnApplicationStartProvider, type CreateOnBackendDataReadyProvider, type CreateOnConfiguratorReadyProvider, type CreateOnFrontendDataReadyProvider, type CreateOnGoToIndexHandler, type CreateOnPresetLoadedHandler, type CreateOnPublishedDataReadyProvider, type CreateOnRoutingReadyProvider, type CreateOnSessionReadyProvider, type UseConfiguratorRouting, type UsePresetSelection, usePropertyPageStack, usePropertyPageState } from '../configurator-context/index.js';
|
|
@@ -8,7 +8,6 @@ import type { UseUpdateEntityObjectSelection } from '../scene/scene-entity/drag-
|
|
|
8
8
|
import { type CreateAppLoader, type CreateCanvasLoader, type CreateLayoutAdminUi, type CreateLayoutCustomOwnerUi, type CreateLayoutCustomReadUi, type CreateLayoutDialog, type CreateLayoutFooter, type CreateLayoutToolbarDesktop, type CreateLayoutToolbarDesktopFullScreen, type CreateLayoutToolbarReadDesktop, type CreateLayoutToolbarReadDesktopFullScreen, type CreateLayoutUserUi, type CreateToolbarHelp } from '../ui/index.js';
|
|
9
9
|
import { useGenerateShareLink } from '../ui/phoenix-layout-elements/share/use-share.js';
|
|
10
10
|
import { type CreatePresetDeviceNotSupported, type CreatePresetPageAction, type CreatePresetUi } from '../ui/preset-layout/PresetUi.js';
|
|
11
|
-
import { type UseFinalizeAction } from './use-finalize-action.js';
|
|
12
11
|
import { type UseResetCamera } from './use-reset-camera.js';
|
|
13
12
|
export interface ConfiguratorInterface<ENTITIES extends DomainEntity<string>, ALLOWED_ROOT_ENTITIES extends ENTITIES, $MAP extends Record<ENTITIES['type'], $DomainEntity<ENTITIES>>, PUBLISHED_DATA extends Record<string, unknown>, SESSION_DATA extends Record<string, unknown>, FRONTEND_DATA extends Record<string, unknown>, NAVIGATION_STATES extends string, VIEW_STATES extends string, TOOL_STATES extends string, EXPORT_STATES extends string, FINALIZE_DATA extends Record<string, unknown>, FINALIZE_RESULT extends Record<string, unknown>> {
|
|
14
13
|
/**
|
|
@@ -491,6 +490,16 @@ export interface ConfiguratorInterface<ENTITIES extends DomainEntity<string>, AL
|
|
|
491
490
|
* Move the camera back to the framing of the active camera configuration, as the toolbar's reset button does
|
|
492
491
|
*/
|
|
493
492
|
useResetCamera: UseResetCamera;
|
|
493
|
+
/**
|
|
494
|
+
* Undo and redo changes of the configuration, with whether each is possible, as the toolbar's undo and redo
|
|
495
|
+
* buttons do
|
|
496
|
+
*/
|
|
497
|
+
useUndoRedo: UseUndoRedo;
|
|
498
|
+
/**
|
|
499
|
+
* The spec's tabs (`sidebarTabs` or `horizontalTabs`) with the active one, and switching between them, as the
|
|
500
|
+
* built-in tabs do
|
|
501
|
+
*/
|
|
502
|
+
useTabNavigation: UseTabNavigation<NAVIGATION_STATES>;
|
|
494
503
|
/**
|
|
495
504
|
* Returns composition tree of the domain
|
|
496
505
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{createCustomPhoenixEntityElement as e,createCustomPhoenixLayoutElement as r,createGetThemeHandler as t,createGetWebComponentOptionsHandler as o,createPhoenixHandler as i,createTransformer as s,createTransformerBuilder as a,createUpdateFactory as m,getIdSequence as n,isCreateEntityUpdate as p,isReplaceEntityUpdate as u}from"#package/domain";import{createCollectFrontendDataHandler as c,createFilterPublishedChunksHandler as d,createNotAuthenticatedPage as f,isAngleDimensionUpdate as j,isAttributeSelectionUpdate as
|
|
1
|
+
import{createCustomPhoenixEntityElement as e,createCustomPhoenixLayoutElement as r,createGetThemeHandler as t,createGetWebComponentOptionsHandler as o,createPhoenixHandler as i,createTransformer as s,createTransformerBuilder as a,createUpdateFactory as m,getIdSequence as n,isCreateEntityUpdate as p,isReplaceEntityUpdate as u}from"#package/domain";import{createCollectFrontendDataHandler as c,createFilterPublishedChunksHandler as d,createNotAuthenticatedPage as f,isAngleDimensionUpdate as j,isAttributeSelectionUpdate as g,isAttributeSwitchUpdate as l,isDeleteEntityUpdate as x,isDistanceDimensionUpdate as y,isGenericDimensionUpdate as k,isSwatchSelectionUpdate as h,isTextValueUpdate as S,useAccessService as E,useActiveNavigationState as I,useActiveToolState as q,useActiveViewState as A,useAnalyticsService as B,useAngleDimension as C,useAttributeSelection as P,useAttributeSwitch as R,useAuthenticatedClient as U,useAuthorizedClient as b,useBackendData as v,useChildEntitySelection as w,useCommittedSlice as z,useCommittedState as D,useComponent as F,useComponents as G,useComposition as H,useConfigurationId as J,useConfiguratorMessages as K,useControlViolations as L,useCookRecipes as M,useCookReplaceRecipes as N,useCookedRecipes as O,useCookedReplaceRecipes as Q,useCreateAuthorizedClient as T,useDeleteEntity as V,useDeletedEntity as W,useDeselect as X,useDistanceDimension as Y,useDistanceDimensionSelection as Z,useDomain as $,useDomainApplication as _,useDomainApplicationProps as ee,useDomainEntityRenderedState as er,useDomainEntityState as et,useEntityPrice as eo,useEntitySelector as ei,useFinalizeAction as es,useFinalizeViolations as ea,useFirstComponent as em,useFirstRenderedComponent as en,useFirstRootComponent as ep,useFirstRootRenderedComponent as eu,useFrontendData as ec,useGenericDimension as ed,useGroupedRecipeOptions as ef,useHoveredDomainEntityId as ej,useHoveredEntity as eg,useHoveredEntityId as el,useIntegrationService as ex,useIntegrationState as ey,useIsFullscreenActive as ek,useLoadedData as eh,useLoadingState as eS,useLoadingStateValue as eE,useMapViolationHints as eI,useNavigate as eq,usePopNavigate as eA,usePresetEmbeddedState as eB,usePublishedData as eC,usePushNavigate as eP,useRecipeEmbeddedState as eR,useRenderedComponent as eU,useRenderedComponents as eb,useRenderedEntitySelector as ev,useRenderedRootEntitySelector as ew,useRenderedSelector as ez,useRenderedSelector$ as eD,useRenderedSlice as eF,useRenderedState as eG,useReplaceEntityRecipeOptions as eH,useRootComponents as eJ,useRootEntityId as eK,useRootEntityPrice as eL,useRootEntityRenderedId as eM,useRootEntityRenderedState as eN,useRootEntitySelector as eO,useRootEntityState as eQ,useRootRenderedComponents as eT,useSelectEntity as eV,useSelectParent as eW,useSelectedDomainEntityId as eX,useSelectedEntity as eY,useSelectedEntityId as eZ,useSession as e$,useSessionRole as e_,useSessionService as e0,useSetFullscreen as e1,useSetViewState as e2,useStateValidity as e3,useStoreSelector as e4,useStoreSelector$ as e5,useSwatchSelection as e6,useTabNavigation as e7,useTextValue as e8,useUndoRedo as e9,useUpdateControl as re,useUpdatedControl as rr}from"#package/react-sdk";import{createPhoenixIconSet as rt}from"#package/ui-sdk";import{useConfigurator as ro}from"../application-runtime/index.js";import{createOnApplicationStartProvider as ri,createOnBackendDataReadyProvider as rs,createOnConfiguratorReadyProvider as ra,createOnFrontendDataReadyProvider as rm,createOnGoToIndexHandler as rn,createOnPresetLoadedHandler as rp,createOnPublishedDataReadyProvider as ru,createOnRoutingReadyProvider as rc,createOnSessionReadyProvider as rd,useConfiguratorRouting as rf,usePresetSelection as rj,usePropertyPageStack as rg,usePropertyPageState as rl}from"../configurator-context/index.js";import{createGetTextureProcessingMapHandler as rx}from"../scene/index.js";import{useUpdateEntityObjectSelection as ry}from"../scene/scene-entity/drag-and-drop/use-updated-selection.js";import{createAppLoader as rk,createCanvasLoader as rh,createLayoutAdminUi as rS,createLayoutCustomOwnerUi as rE,createLayoutCustomReadUi as rI,createLayoutDialog as rq,createLayoutFooter as rA,createLayoutToolbarDesktop as rB,createLayoutToolbarDesktopFullScreen as rC,createLayoutToolbarReadDesktop as rP,createLayoutToolbarReadDesktopFullScreen as rR,createLayoutUserUi as rU,createToolbarHelp as rb}from"../ui/index.js";import{useGenerateShareLink as rv}from"../ui/phoenix-layout-elements/share/use-share.js";import{createPresetDeviceNotSupported as rw,createPresetPageAction as rz,createPresetUi as rD}from"../ui/preset-layout/PresetUi.js";import{useResetCamera as rF}from"./use-reset-camera.js";export const createConfiguratorInterface=rG=>({updates:m(),getIdSequence:n,createGetWebComponentOptionsHandler:o,createGetThemeHandler:t,createPhoenixHandler:i,createCustomPhoenixEntityElement:e,createCustomPhoenixLayoutElement:r,createPhoenixIconSet:rt,createGetTextureProcessingMapHandler:rx,createCollectFrontendDataHandler:c,createFilterPublishedChunksHandler:d,createOnGoToIndexHandler:rn,createOnApplicationStartProvider:ri,createOnSessionReadyProvider:rd,createOnPublishedDataReadyProvider:ru,createOnFrontendDataReadyProvider:rm,createOnBackendDataReadyProvider:rs,createOnRoutingReadyProvider:rc,createOnConfiguratorReadyProvider:ra,createOnPresetLoadedHandler:rp,createPresetUi:rD,createPresetPageAction:rz,createPresetDeviceNotSupported:rw,createLayoutFooter:rA,createAppLoader:rk,createCanvasLoader:rh,createLayoutDialog:rq,createLayoutToolbarDesktop:rB,createLayoutToolbarDesktopFullScreen:rC,createLayoutToolbarReadDesktop:rP,createLayoutToolbarReadDesktopFullScreen:rR,createLayoutCustomOwnerUi:rE,createLayoutCustomReadUi:rI,createLayoutAdminUi:rS,createLayoutUserUi:rU,createToolbarHelp:rb,createNotAuthenticatedPage:f,createTransformer:s,transformerBuilder:a(),useAnalytics:B,useAuthenticatedClient:U,useAuthorizedClient:b,useCreateAuthorizedClient:T,useAccessService:E,useConfigurationId:J,useSession:e$,useSessionRole:e_,useSessionService:e0,useDomain:$,useDomainApplication:_,useConfigurator:ro,useConfiguratorRouting:rf,usePresetSelection:rj,usePublishedData:eC,useFrontendData:ec,useBackendData:v,useDomainApplicationProps:ee,useLoadedData:eh,useIntegrationService:ex,useIntegrationState:ey,usePresetEmbeddedState:eB,useRecipeEmbeddedState:eR,useCommittedSlice:z,useRenderedSlice:eF,useCommittedState:D,useRenderedState:eG,useStoreSelector:e4,useRenderedSelector:ez,useStoreSelector$:e5,useRenderedSelector$:eD,useEntitySelector:ei,useRenderedEntitySelector:ev,useRootEntitySelector:eO,useRenderedRootEntitySelector:ew,useStateValidity:e3,useMapViolationHints:eI,useNavigate:eq,usePopNavigate:eA,usePushNavigate:eP,useControlViolations:L,useFinalizeViolations:ea,useConfiguratorMessages:K,useFinalizeAction:es,useComponent:F,useRenderedComponent:eU,useComponents:G,useRenderedComponents:eb,useFirstComponent:em,useFirstRenderedComponent:en,useRootComponents:eJ,useRootRenderedComponents:eT,useFirstRootComponent:ep,useFirstRootRenderedComponent:eu,useEntityState:et,useEntityRenderedState:er,useRootEntityState:eQ,useRootEntityRenderedState:eN,useRootEntityId:eK,useRootEntityRenderedId:eM,useEntityPrice:eo,useRootEntityPrice:eL,useSelectedEntity:eY,useSelectedEntityId:eZ,useSelectedDomainEntityId:eX,useSelectEntity:eV,useDeselect:X,useSelectParent:eW,useHoveredEntity:eg,useHoveredEntityId:el,useHoveredDomainEntityId:ej,useActiveNavigationState:I,useActiveViewState:A,useSetViewState:e2,useActiveToolState:q,useIsFullscreenActive:ek,useSetFullscreen:e1,useResetCamera:rF,useUndoRedo:e9,useTabNavigation:e7,useComposition:H,useUpdateControl:re,useUpdatedControl:rr,useCookRecipes:M,useCookedRecipes:O,useCookReplaceRecipes:N,useCookedReplaceRecipes:Q,useDeleteEntity:V,useDeletedEntity:W,useSwatchSelection:e6,useTextValue:e8,useAttributeSelection:P,useAttributeSwitch:R,useDistanceDimension:Y,useDistanceDimensionSelection:Z,useGenericDimension:ed,useAngleDimension:C,useChildEntitySelection:w,useGroupedRecipeOptions:ef,useReplaceEntityRecipeOptions:eH,useUpdateEntityObjectSelection:ry,useGenerateShareLink:rv,useLoadingState:eS,useLoadingStateValue:eE,usePropertyPageStack:rg,usePropertyPageState:rl,isCreateEntityUpdate:p,isReplaceEntityUpdate:u,isDeleteEntityUpdate:x,isAngleDimensionUpdate:j,isDistanceDimensionUpdate:y,isGenericDimensionUpdate:k,isAttributeSelectionUpdate:g,isAttributeSwitchUpdate:l,isTextValueUpdate:S,isSwatchSelectionUpdate:h});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
+
export { FrontendAnalyticsFactory } from '#package/react-sdk';
|
|
1
2
|
export { type ConfiguratorInterface, createConfiguratorInterface } from './configurator-interface.js';
|
|
2
|
-
export {
|
|
3
|
-
export { type UseFinalizeAction, type UseFinalizeActionResult, useFinalizeAction } from './use-finalize-action.js';
|
|
3
|
+
export { type UseFinalizeAction, type UseFinalizeActionResult, useFinalizeAction } from '#package/react-sdk';
|
|
4
4
|
export { type UseResetCamera, useResetCamera } from './use-reset-camera.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{
|
|
1
|
+
export{FrontendAnalyticsFactory,useFinalizeAction}from"#package/react-sdk";export{createConfiguratorInterface}from"./configurator-interface.js";export{useResetCamera}from"./use-reset-camera.js";
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { type ConfigurationNotFoundPageProps } from '#package/react-sdk';
|
|
2
|
+
/**
|
|
3
|
+
* The name a project registers a layout element under to replace the page shown when a configuration
|
|
4
|
+
* cannot be loaded or opened. Its default, the built-in `ConfigurationNotFoundPage`, is registered in
|
|
5
|
+
* `defaultConfiguratorElements`.
|
|
6
|
+
*/
|
|
7
|
+
export declare const ConfigurationNotFoundPageName = "ConfigurationNotFoundPage";
|
|
8
|
+
/**
|
|
9
|
+
* Renders the `ConfigurationNotFoundPage` element. `onBack` is passed only where leaving the page leads
|
|
10
|
+
* somewhere, which is the start of the configurator.
|
|
11
|
+
*/
|
|
12
|
+
export declare const ConfigurationNotFoundPageElement: (props: ConfigurationNotFoundPageProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{jsx as o}from"react/jsx-runtime";import{PhoenixLayoutElement as t}from"#package/react-sdk";export const ConfigurationNotFoundPageName="ConfigurationNotFoundPage";export const ConfigurationNotFoundPageElement=n=>o(t,{name:"ConfigurationNotFoundPage",elementProps:{...n}});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { ConfigurationNotFoundPageElement, ConfigurationNotFoundPageName } from './ConfigurationNotFoundPageElement.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export{ConfigurationNotFoundPageElement,ConfigurationNotFoundPageName}from"./ConfigurationNotFoundPageElement.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as e}from"react/jsx-runtime";import{Button as t}from"@mui/material";import{useMutation as r}from"@tanstack/react-query";import{useSnackbar as i}from"notistack";import{useSubscription as o}from"observable-hooks";import{createContext as s,useCallback as n,useContext as a,useEffect as l,useMemo as m,useState as d}from"react";import{skip as p}from"rxjs";import{match as c}from"ts-pattern";import{AuthorizedClient as g,LocalStorageAuthorizedPhoenixApiClient as u,MemoryAuthorizedPhoenixApiClient as f}from"#package/client";import{SYSTEM_CHUNK_KEY as h,standardWebComponentProperties as y}from"#package/domain";import{ApplicationRoutes as P,
|
|
1
|
+
import{jsx as e}from"react/jsx-runtime";import{Button as t}from"@mui/material";import{useMutation as r}from"@tanstack/react-query";import{useSnackbar as i}from"notistack";import{useSubscription as o}from"observable-hooks";import{createContext as s,useCallback as n,useContext as a,useEffect as l,useMemo as m,useState as d}from"react";import{skip as p}from"rxjs";import{match as c}from"ts-pattern";import{AuthorizedClient as g,LocalStorageAuthorizedPhoenixApiClient as u,MemoryAuthorizedPhoenixApiClient as f}from"#package/client";import{SYSTEM_CHUNK_KEY as h,standardWebComponentProperties as y}from"#package/domain";import{ApplicationRoutes as P,FrontendAnalyticsFactory as v,useAnalyticsService as w,useAuthenticatedClient as x,useConfiguratorDomainFactory as C,useEagerObservableValue as T,useIsDev as k,useLogger as D,usePersistenceConfig as S,usePublishedData as E,useResolveLocalizable as b,useRoutingSelectors as A,useSessionService as I,useSpecPresetSeed as V,useWebComponentProperty$ as j}from"#package/react-sdk";import{useOnPresetLoadedHandler as $}from"./OnPresetLoadedHandler.js";import{useConfiguratorRouting as F}from"./configurator-routing/index.js";let M={id:"sdk.presets.create.error.message",message:"Could not start configuring from this preset. Please try again."},R={id:"sdk.presets.create.error.dismiss.label",message:"Dismiss"},q="phx-preset-creation-error";export const PresetSelectionContext=s(null);export const usePresetSelection=()=>{let e=a(PresetSelectionContext);if(null===e)throw Error("usePresetSelection must be used within a PresetSelectionProvider!");return e};let z=e=>t=>null===e||void 0!==t.tags&&t.tags.some(t=>e.includes(t));export const PresetSelectionProvider=s=>{let{children:a}=s,[H,L]=d(null),[O,U]=d(null),B=V(),G=x(),J=w(),K=S(),N=C(),Q=k(),W=b(),{requestSessionToken:X}=I(),Y=D(),Z=F(),_=A(),ee=E(),{enqueueSnackbar:et,closeSnackbar:er}=i(),ei=j(y.presetTags),eo=T(ei),es=$();o(m(()=>ei.pipe(p(1)),[ei]),()=>{_.getRoutingState().route!==P.Index&&Z.goToIndex()}),l(()=>{U(null),er(q)},[Q,er]);let{mutate:en}=r({mutationFn:n(async e=>{let{getData:t,name:r}=e,{rootEntityType:i,entities:o,modelVersion:s}=await t(),n=N.validateAndMigrateState(o,s);J.push(v.ProductSelected(i,W(r)));let a=es?await es(n):n;return G.createConfiguration({rootEntityType:i,data:a})},[N,J,W,G,es]),onSuccess:e=>{Z.goToConfigurationDetail(e.configurationId,e.accessToken)},onError:(e,t)=>{Y.error("Failed to create a new configuration from a preset!",{name:t.name},e),U(e)},onSettled:()=>{L(null)}}),ea=m(()=>{let e,t=(e=h in ee?ee[h].presetCategories:ee.presetCategories,{publishedPresetCategories:(e??[]).map(e=>({...e,presets:e.presets.filter(z(eo))})).filter(e=>e.presets.length>0),seedPresets:B.filter(z(eo))});return t.publishedPresetCategories.length>0?t.publishedPresetCategories.map(e=>({id:e.id,name:e.name,description:e.description,img:e.img,imgAlt:e.imgAlt,presets:e.presets.map(e=>({id:e.configurationId,name:e.name,description:e.description,img:e?.img,imgAlt:e?.imgAlt,detailTitle:e?.detailTitle,detailDescription:e?.detailDescription,getData:async()=>{let t=c(K).with({type:"server"},t=>new g(t.serverUrl,()=>e.readToken,X)).with({type:"local-storage"},()=>new u(N.modelVersion)).with({type:"memory"},()=>new f(N.modelVersion)).exhaustive(),r=await t.getConfigurationRevision(e.configurationId,e.revisionId);return{entities:r.data,rootEntityType:r.rootEntityType,modelVersion:r.modelVersion}}}))})):t.seedPresets.length>0?[{id:"Default",name:"Default Category",presets:t.seedPresets.map((e,t)=>({id:`${t}`,name:e.name??`${e.rootEntityType} preset - ${t}`,description:e.description??"",img:e.img,imgAlt:e.imgAlt,detailTitle:e.detailTitle,detailDescription:e.detailDescription,getData:async()=>({entities:e.initialDomainEntities,rootEntityType:e.rootEntityType,modelVersion:N.modelVersion})}))}]:[]},[ee,X,K,N,eo,B]),el=m(()=>ea.flatMap(e=>e.presets),[ea]),em=n(r=>{let i=el.find(e=>e.id===r);if(void 0===i)throw Error(`Preset with id ${r} not found!`);let{getData:o,name:s}=i,n=!Q&&el.length>1;U(null),L(r),en({getData:o,name:s},{onError:()=>{n&&(er(q),et(W(M),{variant:"error",key:q,persist:!0,preventDuplicate:!0,action:r=>e(t,{color:"inherit",size:"small",onClick:()=>{U(null),er(r)},children:W(R)})}))}})},[el,Q,en,et,er,W]),ed=el.length>1,ep=m(()=>({hasMultiplePresets:ed,presetCategories:ea,selectPreset:em,selectionError:O,creatingPresetId:H}),[em,ed,ea,O,H]);return e(PresetSelectionContext.Provider,{value:ep,children:a})};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as o}from"react/jsx-runtime";import{
|
|
1
|
+
import{jsx as o}from"react/jsx-runtime";import{ConfigurationNotFoundPageElement as n}from"../configuration-not-found-page/index.js";import{useConfiguratorRouting as r}from"../configurator-context/index.js";export const ConfiguratorNotFoundPage=()=>o(n,{onBack:r().goToIndex});
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The built-in page shown when session authentication fails, or when an anonymous visitor who may not
|
|
3
|
+
* create a configuration opens the start page: the `ConfigurationNotFoundPage` element, so a project's
|
|
4
|
+
* not-found page shows here too. It is registered as the default `NotAuthenticatedPage`
|
|
5
|
+
* in `defaultConfiguratorElements`, so `NotAuthenticatedPage` renders it unless the project registers a
|
|
6
|
+
* layout element of that name.
|
|
7
|
+
*/
|
|
8
|
+
export declare const DefaultNotAuthenticatedPage: () => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{jsx as t}from"react/jsx-runtime";import{ConfigurationNotFoundPageElement as o}from"../configuration-not-found-page/index.js";export const DefaultNotAuthenticatedPage=()=>t(o,{});
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The built-in preset screen: `CategoryPresetUi` with the `PresetPageAction` element as its action and
|
|
3
|
+
* the `PresetDeviceNotSupported` element as its overlay. It is registered as the default `PresetUi` in
|
|
4
|
+
* `defaultConfiguratorElements`, so `PresetUi` renders it unless the project registers a layout element
|
|
5
|
+
* of that name.
|
|
6
|
+
*/
|
|
7
|
+
export declare const DefaultPresetUi: () => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{jsx as e}from"react/jsx-runtime";import{PresetDeviceNotSupportedElement as r,PresetPageActionElement as t}from"../preset-screen-elements/index.js";import{CategoryPresetUi as o}from"../ui/index.js";export const DefaultPresetUi=()=>e(o,{action:e(t,{}),overlay:e(r,{})});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as
|
|
1
|
+
import{jsx as o}from"react/jsx-runtime";import{useEffect as t}from"react";import{assertExistence as e}from"@salsita-ai/common/utils";import{AnalyticsEventFactory as r}from"#package/domain";import{useAnalyticsService as a,useIsDev as i,useLogger as n,useOnMount as d}from"#package/react-sdk";import{usePresetSelection as m}from"../configurator-context/index.js";import{PresetUi as s}from"../ui/index.js";import{PresetCreationErrorPage as l}from"./PresetCreationErrorPage.js";let p=o=>{let{id:t}=o,e=n(),{selectPreset:r}=m();return d(()=>{e.debug("Only single preset available, creating configuration automatically."),r(t)}),null};export const NewConfiguratorPage=()=>{let d=n(),g=a(),f=i(),{presetCategories:u,selectionError:c}=m();t(()=>{g.push(r.DataLoadedEvent({configurationId:"notYetLoaded",revisionId:"notYetLoaded",mode:"notYetLoaded"})),d.appendToGlobalContext({navigationState:"NewConfiguratorPage",revisionId:"notYetLoaded",mode:"notYetLoaded"})},[g,d]);let x=u.flatMap(o=>o.presets),L=1===x.length;return c&&(f||L)?o(l,{error:c}):L?o(p,{id:e(x[0]).id}):o(s,{})};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as o}from"react/jsx-runtime";import{match as t}from"ts-pattern";import{SessionRole as r}from"@salsita-ai/contracts/api";import{ApplicationRoutes as
|
|
1
|
+
import{jsx as o}from"react/jsx-runtime";import{match as t}from"ts-pattern";import{SessionRole as r}from"@salsita-ai/contracts/api";import{ApplicationRoutes as i,NotAuthenticatedPage as n,useRoutingState as e,useSession as a,useSpecCanCreate as s}from"#package/react-sdk";import{ConfigurationNotFoundPageElement as m}from"../configuration-not-found-page/index.js";import{ConfiguratorRoot as u}from"./ConfiguratorRoot.js";import{NewConfiguratorPage as c}from"./NewConfiguratorPage.js";export const RootPage=()=>{let f=s(),p=e(),{sessionPayload:g}=a(),d=g?.role??r.Anonymous,x=f.includes(d);return t(p).with({route:i.Index},()=>x?o(c,{}):d===r.Anonymous?o(n,{}):o(m,{})).with({route:i.Configuration},t=>o(u,{configurationId:t.configurationId,accessToken:t.accessToken})).exhaustive()};
|
|
@@ -2,7 +2,10 @@ import { type ElementRegistration } from '#package/domain';
|
|
|
2
2
|
/**
|
|
3
3
|
* The configurator's default element registrations, passed to `withDefaultElements`. A project
|
|
4
4
|
* element registered under the same name replaces one: `ConfiguratorLayout` is the built-in UI of a
|
|
5
|
-
* loaded configuration,
|
|
5
|
+
* loaded configuration, `ConfigurationNotFoundPage` the page shown when a configuration cannot be
|
|
6
|
+
* loaded or opened, `NotAuthenticatedPage` the page shown when session authentication fails or an
|
|
7
|
+
* anonymous visitor who may not create a configuration opens the start page, `PresetUi` the preset
|
|
8
|
+
* screen, and the others are the built-in controls, toolbar buttons, menu actions and
|
|
6
9
|
* sidebar-footer pieces under the spec kinds that YAML names.
|
|
7
10
|
*/
|
|
8
11
|
export declare const defaultConfiguratorElements: readonly ElementRegistration[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{createCustomPhoenixLayoutElement as o}from"#package/domain";import{
|
|
1
|
+
import{createCustomPhoenixLayoutElement as o}from"#package/domain";import{ConfigurationNotFoundPage as t,createNotAuthenticatedPage as r}from"#package/react-sdk";import{ConfigurationNotFoundPageName as e}from"../configuration-not-found-page/index.js";import{createPresetUi as m}from"../ui/index.js";import{DefaultConfiguratorLayout as a}from"./DefaultConfiguratorLayout.js";import{DefaultNotAuthenticatedPage as i}from"./DefaultNotAuthenticatedPage.js";import{DefaultPresetUi as f}from"./DefaultPresetUi.js";import{ConfiguratorLayoutName as n}from"./configurator-layout-name.js";import{domainControlElements as u,recipePanelElements as p,sidebarFooterElements as s,toolbarElements as d}from"./default-elements/index.js";export const defaultConfiguratorElements=[o(n,a),o(e,t),r(i),m(f),...u,...p,...d,...s];
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { type PhoenixEntityElementDefinition, type PhoenixEntityElementRegistration } from '#package/domain';
|
|
2
2
|
/**
|
|
3
3
|
* Registers a built-in entity element under the `kind` of its schema, with the component that the
|
|
4
|
-
*
|
|
4
|
+
* element's module exports. The schema type argument ties the schema and the
|
|
5
5
|
* component's props together, as in `createPhoenixEntityElement`.
|
|
6
6
|
*/
|
|
7
7
|
export declare const builtInEntityElement: <SCHEMA extends {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { type PhoenixLayoutElementDefinition, type PhoenixLayoutElementRegistration } from '#package/domain';
|
|
2
2
|
/**
|
|
3
3
|
* Registers a built-in layout element under the `kind` of its schema, with the component that the
|
|
4
|
-
*
|
|
4
|
+
* element's module exports. The schema type argument ties the schema and the
|
|
5
5
|
* component's props together, as in `createPhoenixLayoutElement`.
|
|
6
6
|
*/
|
|
7
7
|
export declare const builtInLayoutElement: <SCHEMA extends {
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
/** The name a project registers a layout element under to add an overlay to the preset screen. */
|
|
2
|
+
export declare const PresetDeviceNotSupportedName = "PresetDeviceNotSupported";
|
|
3
|
+
/** Renders the `PresetDeviceNotSupported` element, which the built-in preset screen shows as its overlay. */
|
|
4
|
+
export declare const PresetDeviceNotSupportedElement: () => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{jsx as e}from"react/jsx-runtime";import{PhoenixLayoutElement as t}from"#package/react-sdk";export const PresetDeviceNotSupportedName="PresetDeviceNotSupported";let o=()=>null;export const PresetDeviceNotSupportedElement=()=>e(t,{name:"PresetDeviceNotSupported",elementProps:{},defaultSlot:o});
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
/** The name a project registers a layout element under to add an action below the preset cards. */
|
|
2
|
+
export declare const PresetPageActionName = "PresetPageAction";
|
|
3
|
+
/** Renders the `PresetPageAction` element, which the built-in preset screen shows below its cards. */
|
|
4
|
+
export declare const PresetPageActionElement: () => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{jsx as e}from"react/jsx-runtime";import{PhoenixLayoutElement as t}from"#package/react-sdk";export const PresetPageActionName="PresetPageAction";let o=()=>null;export const PresetPageActionElement=()=>e(t,{name:"PresetPageAction",elementProps:{},defaultSlot:o});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export{PresetDeviceNotSupportedElement,PresetDeviceNotSupportedName}from"./PresetDeviceNotSupportedElement.js";export{PresetPageActionElement,PresetPageActionName}from"./PresetPageActionElement.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as e}from"react/jsx-runtime";import{memo as t,useCallback as o}from"react";import{
|
|
1
|
+
import{jsx as e}from"react/jsx-runtime";import{memo as t,useCallback as o}from"react";import{FrontendAnalyticsFactory as i,LocalizableMessage as r,useDeletedEntity as l}from"#package/react-sdk";import{DeleteEntityFab as a}from"#package/ui-sdk";import{useSceneControlTooltip as s}from"./use-scene-control-tooltip.js";export const DeleteEntityFab=t(t=>{let{entityId:n,fixableViolations:c,label:p,title:d,tooltipVisibility:m="on-hover",...k}=t,{tooltipOpen:b}=s(m),f=o(()=>i.EntityDeleteHotspotClicked(n),[n]),{disabled:u,hints:g,remove:D,trace:h}=l(n,c,f);return e(a,{label:p?e(r,{children:p}):void 0,title:d?e(r,{children:d}):void 0,...k,disabled:u,disabledMessage:g,tooltipOpen:b,onClick:D,onDebugClick:h})});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as
|
|
1
|
+
import{jsx as t}from"react/jsx-runtime";import{useCallback as o}from"react";import{FrontendAnalyticsFactory as e,useSelectEntity as r}from"#package/react-sdk";import{SceneHotspot as i}from"./SceneHotspot.js";export const SelectionHotspot=p=>{let{id:s,title:c,tooltipVisibility:m="on-hover"}=p,n=r(e.SelectionHotspotClicked);return t(i,{onClick:o(t=>{t.stopPropagation(),n(s)},[s,n]),title:c,tooltipVisibility:m})};
|
|
@@ -6,7 +6,7 @@ export interface AssistantMarkdownProps {
|
|
|
6
6
|
readonly forms: AssistantFormsVisibility;
|
|
7
7
|
}
|
|
8
8
|
/**
|
|
9
|
-
* Assistant text of the thread: Markdown with lists, tables, links, entity links, references, code and forms,
|
|
9
|
+
* Assistant text of the thread: Markdown with lists, tables, links, entity links, references, images, code and forms,
|
|
10
10
|
* without a bubble. A form fence the model is still writing shows a placeholder.
|
|
11
11
|
*/
|
|
12
12
|
export declare const AssistantMarkdown: import("react").MemoExoticComponent<({ markdown, isStreaming, forms }: AssistantMarkdownProps) => import("react/jsx-runtime").JSX.Element>;
|