@salsita-ai/sdk 0.50.0-develop.c33986dc44 → 0.50.0-develop.c402728d10
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 +5 -1
- package/dist/admin/AdminShell.js +1 -1
- package/dist/admin/legacy-admin/Application.js +1 -1
- package/dist/application-spec/core/enhanced-json-value.d.ts +2 -31
- package/dist/application-spec/core/enhanced-json-value.js +1 -1
- package/dist/application-spec/core/index.d.ts +1 -3
- package/dist/application-spec/core/index.js +1 -1
- package/dist/application-spec/core/json-schema.d.ts +2 -52
- package/dist/application-spec/core/markers/index.d.ts +1 -1
- package/dist/application-spec/core/markers/index.js +1 -1
- package/dist/application-spec/core/markers/msg-marker.d.ts +2 -28
- package/dist/application-spec/core/markers/msg-marker.js +1 -1
- package/dist/application-spec/core/markers/raw-eval-write-marker.d.ts +1 -1
- package/dist/application-spec/core/markers/raw-eval-write-marker.js +1 -1
- package/dist/application-spec/core/markers/raw-read-write-marker.js +1 -1
- package/dist/application-spec/errors/diagnostic-codes.d.ts +8 -1
- package/dist/application-spec/errors/diagnostic-codes.js +1 -1
- package/dist/application-spec/errors/diagnostic-messages.d.ts +15 -1
- package/dist/application-spec/errors/diagnostic-messages.js +1 -1
- package/dist/application-spec/generate-application/code/project-scaffolding.js +2 -2
- package/dist/application-spec/generate-application/code/templates/index.d.ts +2 -6
- package/dist/application-spec/generate-application/code/templates/index.js +1 -1
- package/dist/application-spec/generate-application/code/templates/skills/phoenix-skill-bundle.d.ts +10 -0
- package/dist/application-spec/generate-application/code/templates/skills/phoenix-skill-bundle.js +7 -0
- package/dist/application-spec/generate-application/code/templates/skills/phoenix-skill.js +1 -1
- package/dist/application-spec/generate-application/code/templates/skills/sdk-content.d.ts +1 -1
- package/dist/application-spec/generate-application/code/templates/skills/sdk-content.js +1 -1
- package/dist/application-spec/generate-application/code/templates/story/wrapper.js +2 -4
- package/dist/application-spec/generate-application/implementations/phx-model.d.ts +1 -1
- package/dist/application-spec/generate-application/runtime/admin-runtime/admin-model-runtime.d.ts +1 -2
- package/dist/application-spec/generate-application/runtime/configurator-runtime/configurator-model-runtime.d.ts +1 -2
- package/dist/application-spec/generate-application/runtime/factory-data/factory-data-runtime.d.ts +1 -2
- package/dist/application-spec/generate-application/runtime/factory-data/recipe-defaults.d.ts +1 -1
- package/dist/application-spec/generate-application/runtime/factory-data/recipe-defaults.js +1 -1
- package/dist/application-spec/generate-application/runtime/factory-data/static-violations.d.ts +1 -2
- package/dist/application-spec/generate-application/runtime/factory-data/static-violations.js +1 -1
- package/dist/application-spec/generate-application/runtime/generate-runtime-instance.d.ts +1 -1
- package/dist/application-spec/generate-application/runtime/generate-runtime-instance.js +1 -1
- package/dist/application-spec/generate-application/runtime/sections/actions-runtime.d.ts +1 -2
- package/dist/application-spec/generate-application/runtime/sections/build-sdk-optic.d.ts +1 -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 +1 -1
- package/dist/application-spec/generate-application/runtime/sections/component-optic.d.ts +1 -2
- package/dist/application-spec/generate-application/runtime/sections/expression-runtime.d.ts +1 -2
- 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 +1 -2
- package/dist/application-spec/generate-application/runtime/sections/generate-memo-eval-plan-runtime.js +1 -1
- package/dist/application-spec/generate-application/runtime/sections/preset-runtime.d.ts +2 -3
- package/dist/application-spec/generate-application/runtime/sections/reflection-constants-runtime.d.ts +1 -1
- package/dist/application-spec/generate-application/runtime/spec-code/resolve-spec-code.d.ts +1 -1
- package/dist/application-spec/generate-application/runtime-spec/runtime-spec.d.ts +96 -31
- package/dist/application-spec/generate-application/runtime-spec/spec-code-id.d.ts +1 -1
- package/dist/application-spec/parse-application-files/merge/merged-assistant.d.ts +13 -4
- package/dist/application-spec/parse-application-files/merge/merged-assistant.js +1 -1
- package/dist/application-spec/parse-application-files/merge/merged-infra.d.ts +4 -11
- package/dist/application-spec/parse-application-files/merge/merged-transformers.d.ts +2 -4
- package/dist/application-spec/parse-application-files/parse-application-files.js +1 -1
- package/dist/application-spec/parse-application-files/raw-spec/raw-acl.d.ts +2 -2
- package/dist/application-spec/parse-application-files/raw-spec/raw-acl.js +1 -1
- package/dist/application-spec/parse-application-files/raw-spec/raw-admin-pages.d.ts +3 -24
- package/dist/application-spec/parse-application-files/raw-spec/raw-assistant.d.ts +25 -20
- package/dist/application-spec/parse-application-files/raw-spec/raw-assistant.js +1 -1
- package/dist/application-spec/parse-application-files/raw-spec/raw-expressions.d.ts +1 -1
- package/dist/application-spec/parse-application-files/raw-spec/raw-expressions.js +1 -1
- package/dist/application-spec/parse-application-files/raw-spec/raw-resources.d.ts +19 -64
- package/dist/application-spec/parse-application-files/spec/application/admin-spec/admin-pages.d.ts +3 -20
- package/dist/application-spec/parse-application-files/spec/application/admin-spec/states.d.ts +3 -5
- package/dist/application-spec/parse-application-files/spec/application/configurator-spec/states.d.ts +3 -8
- package/dist/application-spec/parse-application-files/spec/components/bindings/read-binding.d.ts +3 -13
- package/dist/application-spec/parse-application-files/spec/components/bindings/write-binding.d.ts +4 -32
- package/dist/application-spec/parse-application-files/spec/components/component-filter.d.ts +4 -10
- package/dist/application-spec/parse-application-files/spec/components/components.d.ts +3 -4
- package/dist/application-spec/parse-application-files/spec/components/index.d.ts +1 -2
- package/dist/application-spec/parse-application-files/spec/components/index.js +1 -1
- package/dist/application-spec/parse-application-files/spec/components/sdk-component-entry.d.ts +1 -1
- package/dist/application-spec/parse-application-files/spec/components/user-component-entry.d.ts +2 -3
- package/dist/application-spec/parse-application-files/spec/components/user-component-entry.js +1 -1
- package/dist/application-spec/parse-application-files/spec/components/user-components.d.ts +2 -3
- package/dist/application-spec/parse-application-files/spec/expressions/expression-read-types.d.ts +2 -2
- package/dist/application-spec/parse-application-files/spec/expressions/expressions.d.ts +7 -29
- package/dist/application-spec/parse-application-files/spec/expressions/index.d.ts +0 -1
- package/dist/application-spec/parse-application-files/spec/expressions/memo-eval-plan.d.ts +4 -71
- package/dist/application-spec/parse-application-files/spec/expressions/memo-eval-plan.js +1 -1
- package/dist/application-spec/parse-application-files/spec/expressions/user-expressions.d.ts +2 -2
- package/dist/application-spec/parse-application-files/spec/invariants/invariant.d.ts +5 -21
- package/dist/application-spec/parse-application-files/spec/invariants/invariants.d.ts +4 -14
- package/dist/application-spec/parse-application-files/spec/model/aliases.d.ts +3 -9
- package/dist/application-spec/parse-application-files/spec/model/common-types.d.ts +6 -14
- package/dist/application-spec/parse-application-files/spec/model/defaults.d.ts +6 -31
- package/dist/application-spec/parse-application-files/spec/model/entity-types.d.ts +3 -8
- package/dist/application-spec/parse-application-files/spec/model/model-version-key.d.ts +3 -3
- package/dist/application-spec/parse-application-files/spec/model/names/action-name.d.ts +3 -7
- package/dist/application-spec/parse-application-files/spec/model/names/alias-name.d.ts +3 -7
- package/dist/application-spec/parse-application-files/spec/model/names/entity-or-alias-name.d.ts +3 -8
- package/dist/application-spec/parse-application-files/spec/model/names/entity-type-name.d.ts +3 -8
- package/dist/application-spec/parse-application-files/spec/model/names/expression-name.d.ts +3 -6
- package/dist/application-spec/parse-application-files/spec/model/names/instance-name.d.ts +3 -7
- package/dist/application-spec/parse-application-files/spec/model/names/invariant-name.d.ts +3 -3
- package/dist/application-spec/parse-application-files/spec/model/names/shape-property-name.d.ts +3 -11
- package/dist/application-spec/parse-application-files/spec/model/names/violation-type-name.d.ts +3 -3
- package/dist/application-spec/parse-application-files/spec/model/presets.d.ts +6 -29
- package/dist/application-spec/parse-application-files/spec/sections/actions.d.ts +6 -23
- package/dist/application-spec/parse-application-files/spec/sections/app-metadata.d.ts +3 -18
- package/dist/application-spec/parse-application-files/spec/sections/application-version.d.ts +3 -7
- package/dist/application-spec/parse-application-files/spec/sections/assistant/assistant-schema.js +1 -1
- package/dist/application-spec/parse-application-files/spec/sections/assistant/assistant.js +1 -1
- package/dist/application-spec/parse-application-files/spec/sections/data-spec/chunks.d.ts +6 -23
- package/dist/application-spec/parse-application-files/spec/sections/data-spec/custom-data-spec.d.ts +1 -16
- package/dist/application-spec/parse-application-files/spec/sections/data-spec/data-entry-key.d.ts +3 -9
- package/dist/application-spec/parse-application-files/spec/sections/data-spec/data-spec.d.ts +1 -10
- package/dist/application-spec/parse-application-files/spec/sections/data-spec/swatch-data-spec.d.ts +1 -14
- package/dist/application-spec/parse-application-files/spec/sections/state-value.d.ts +3 -7
- package/dist/application-spec/parse-application-files/spec/sections/theme.d.ts +3 -10
- package/dist/application-spec/parse-application-files/spec/sections/transformers.d.ts +4 -11
- package/dist/application-spec/parse-application-files/spec/sections/ui.d.ts +3 -12
- package/dist/client/authorized-client.d.ts +3 -1
- package/dist/client/authorized-client.js +1 -1
- package/dist/client/contract.d.ts +30 -1
- package/dist/client/contract.js +1 -1
- package/dist/client/index.d.ts +1 -1
- package/dist/client/local-authorized-client.d.ts +3 -1
- package/dist/client/local-authorized-client.js +1 -1
- package/dist/client/memory-authorized-client.d.ts +4 -1
- package/dist/client/memory-authorized-client.js +1 -1
- package/dist/client/phoenix-api.d.ts +259 -1
- package/dist/configurator/ConfiguratorApp.js +1 -1
- package/dist/configurator/application-runtime/extensions/selectors.js +1 -1
- package/dist/configurator/application-runtime/extensions/systems/assistant-system/assistant-system.d.ts +64 -6
- package/dist/configurator/application-runtime/extensions/systems/assistant-system/assistant-system.js +1 -1
- package/dist/configurator/application-runtime/extensions/systems/assistant-system/graphql-tools.d.ts +21 -4
- package/dist/configurator/application-runtime/extensions/systems/assistant-system/graphql-tools.js +1 -1
- package/dist/configurator/application-runtime/extensions/systems/graphql-system/entity-meta.d.ts +70 -56
- package/dist/configurator/application-runtime/extensions/systems/graphql-system/entity-meta.js +1 -1
- package/dist/configurator/application-runtime/extensions/systems/graphql-system/graphql-system.d.ts +30 -9
- package/dist/configurator/application-runtime/extensions/systems/graphql-system/graphql-system.js +1 -1
- package/dist/configurator/application-runtime/extensions/systems/graphql-system/violations.d.ts +40 -0
- package/dist/configurator/application-runtime/extensions/systems/graphql-system/violations.js +1 -0
- package/dist/configurator/common/configurator-interface.d.ts +2 -2
- package/dist/configurator/common/configurator-interface.js +1 -1
- package/dist/configurator/configurator-context/configurator-hooks/index.d.ts +0 -1
- package/dist/configurator/configurator-context/configurator-hooks/index.js +1 -1
- package/dist/configurator/configurator-context/configurator-hooks/layout-hooks.js +1 -1
- package/dist/configurator/configurator-context/index.d.ts +0 -5
- package/dist/configurator/configurator-context/index.js +1 -1
- package/dist/configurator/pages/ConfiguratorNotFoundPage.js +1 -1
- package/dist/configurator/pages/LoadedConfiguratorDetailPage.js +1 -1
- package/dist/configurator/pages/NewConfiguratorPage.js +1 -1
- package/dist/configurator/pages/error-boundaries/DevContextFallback.js +1 -1
- package/dist/configurator/pages/error-boundaries/DevLoadingFallback.js +1 -1
- package/dist/configurator/ui/assistant/AssistantChips.js +1 -1
- package/dist/configurator/ui/assistant/AssistantComposer.d.ts +6 -0
- package/dist/configurator/ui/assistant/AssistantComposer.js +2 -1
- package/dist/configurator/ui/assistant/AssistantThread.js +1 -1
- package/dist/configurator/ui/assistant/attachments/MessageImages.d.ts +11 -0
- package/dist/configurator/ui/assistant/attachments/MessageImages.js +1 -0
- package/dist/configurator/ui/assistant/attachments/index.d.ts +2 -0
- package/dist/configurator/ui/assistant/attachments/index.js +1 -0
- package/dist/configurator/ui/assistant/attachments/prepare-image.d.ts +19 -0
- package/dist/configurator/ui/assistant/attachments/prepare-image.js +1 -0
- package/dist/configurator/ui/assistant/screenshots/ScreenshotThumbnails.d.ts +1 -1
- package/dist/configurator/ui/assistant/screenshots/ScreenshotThumbnails.js +1 -1
- package/dist/configurator/ui/assistant/screenshots/index.d.ts +1 -0
- package/dist/configurator/ui/assistant/screenshots/index.js +1 -1
- package/dist/configurator/ui/assistant/screenshots/tool-screenshots.d.ts +12 -4
- package/dist/configurator/ui/assistant/screenshots/tool-screenshots.js +1 -1
- package/dist/configurator/ui/assistant/screenshots/use-screenshot-src.d.ts +8 -0
- package/dist/configurator/ui/assistant/screenshots/use-screenshot-src.js +1 -0
- package/dist/configurator/ui/assistant/thread-items.d.ts +2 -0
- package/dist/configurator/ui/assistant/thread-items.js +1 -1
- package/dist/configurator/ui/assistant/tool-chip.d.ts +19 -9
- package/dist/configurator/ui/assistant/tool-chip.js +1 -1
- package/dist/configurator/ui/configurator-layout/slots/canvas/GPUAccelerationDisabled.js +1 -1
- package/dist/configurator/ui/configurator-layout/slots/canvas/WebGLNotSupported.js +1 -1
- package/dist/configurator/ui/configurator-layout/slots/readonly-banner/CloneToEditDialog.js +1 -1
- package/dist/configurator/ui/configurator-layout/universal/DesktopPreview.js +1 -1
- package/dist/configurator/ui/configurator-layout/universal/MobilePreview.js +1 -1
- package/dist/configurator/ui/legacy/chat/MobileChat.js +1 -1
- package/dist/configurator/ui/legacy/layout/common/CommonTopNavigation.js +1 -1
- package/dist/configurator/ui/legacy/layout/simple/SimpleSidebar.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/StepsSideBar.js +1 -1
- package/dist/configurator/ui/legacy/layout/tabs/TabsSidebar.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/step-navigation/StepsNavigation.js +1 -1
- package/dist/configurator/ui/phoenix-layout-elements/sidebar-footer/basic/use-basic-sidebar-footer.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/save-message-snackbars/SaveMessageSnackbars.js +1 -1
- package/dist/docs/3d-scene/cameras/custom.mdx +4 -2
- package/dist/docs/drag-and-drop/room-planner.mdx +1 -1
- package/dist/docs/index.json +1 -1
- package/dist/docs/phoenix/configurator-interface.mdx +1 -1
- package/dist/docs/phoenix/domain-model.mdx +4 -1
- package/dist/docs/phoenix/layout-slots.mdx +21 -0
- package/dist/docs/phoenix/migration-guide.mdx +3 -3
- package/dist/docs/phoenix/phoenix-cli.mdx +40 -7
- package/dist/docs/phoenix/project-structure.mdx +23 -19
- package/dist/docs/phoenix/sdk-builder-workflow.mdx +2 -2
- package/dist/docs/phoenix/webhooks.mdx +9 -1
- package/dist/domain/application/application-config.d.ts +6 -24
- package/dist/domain/application/assistant/assistant-manifest.d.ts +13 -3
- package/dist/domain/application/assistant/assistant-manifest.js +1 -1
- package/dist/domain/application/assistant/assistant-resolved-manifest.d.ts +5 -9
- package/dist/domain/application/assistant/assistant-resolved-manifest.js +1 -1
- package/dist/domain/application/assistant/build-assistant-lenses.js +1 -1
- package/dist/domain/application/assistant/build-assistant-manifest.js +1 -1
- package/dist/domain/application/assistant/generate-assistant-prompt.js +1 -1
- package/dist/domain/application/assistant/index.d.ts +3 -3
- package/dist/domain/application/assistant/index.js +1 -1
- package/dist/domain/application/assistant/session-setup/apply-assistant-setup.js +1 -1
- package/dist/domain/application/assistant/session-setup/assistant-setup-manifest.d.ts +2 -4
- package/dist/domain/application/assistant/session-setup/assistant-setup-manifest.js +1 -1
- package/dist/domain/application/assistant-mutations.js +1 -1
- package/dist/domain/available-system-components/available-system-components.d.ts +11 -0
- package/dist/domain/available-system-components/available-system-components.js +1 -0
- package/dist/domain/available-system-components/index.d.ts +1 -0
- package/dist/domain/available-system-components/index.js +1 -0
- package/dist/domain/{domain-builder.d.ts → domain-builder/domain-builder.d.ts} +2 -2
- package/dist/domain/domain-builder/domain-builder.js +1 -0
- package/dist/domain/domain-builder/index.d.ts +1 -0
- package/dist/domain/domain-builder/index.js +1 -0
- package/dist/domain/extensions/export-images/agent-screenshot.d.ts +6 -0
- package/dist/domain/extensions/export-images/agent-screenshot.js +1 -1
- package/dist/domain/extensions/export-images/index.d.ts +1 -1
- package/dist/domain/extensions/export-images/index.js +1 -1
- package/dist/domain/extensions/index.d.ts +1 -1
- package/dist/domain/extensions/index.js +1 -1
- package/dist/domain/index.d.ts +3 -2
- package/dist/domain/index.js +1 -1
- package/dist/domain/spec/application/admin-pages-section.d.ts +29 -0
- package/dist/domain/spec/application/admin-pages.d.ts +26 -0
- package/dist/domain/spec/application/admin-states.d.ts +5 -0
- package/dist/domain/spec/application/configurator-states.d.ts +8 -0
- package/dist/domain/spec/application/configurator-states.js +1 -0
- package/dist/domain/spec/application/index.d.ts +5 -0
- package/dist/domain/spec/application/index.js +1 -0
- package/dist/domain/spec/components/bindings/index.d.ts +2 -0
- package/dist/domain/spec/components/bindings/index.js +1 -0
- package/dist/domain/spec/components/bindings/read-binding.d.ts +13 -0
- package/dist/domain/spec/components/bindings/read-binding.js +1 -0
- package/dist/domain/spec/components/bindings/write-binding.d.ts +32 -0
- package/dist/domain/spec/components/bindings/write-binding.js +1 -0
- package/dist/{application-spec/parse-application-files → domain}/spec/components/component-entry.d.ts +3 -3
- package/dist/domain/spec/components/component-entry.js +1 -0
- package/dist/{application-spec/core → domain/spec}/components/component-filter.d.ts +3 -2
- package/dist/domain/spec/components/component-filters.d.ts +10 -0
- package/dist/domain/spec/components/component-filters.js +1 -0
- package/dist/domain/spec/components/components.d.ts +4 -0
- package/dist/domain/spec/components/components.js +1 -0
- package/dist/domain/spec/components/index.d.ts +6 -0
- package/dist/domain/spec/enhanced-json/enhanced-json-value.d.ts +30 -0
- package/dist/domain/spec/enhanced-json/enhanced-json-value.js +1 -0
- package/dist/domain/spec/enhanced-json/index.d.ts +1 -0
- package/dist/domain/spec/enhanced-json/index.js +1 -0
- package/dist/{application-spec/parse-application-files → domain}/spec/expressions/expression.d.ts +9 -3
- package/dist/domain/spec/expressions/expression.js +1 -0
- package/dist/domain/spec/expressions/expressions.d.ts +27 -0
- package/dist/domain/spec/expressions/expressions.js +1 -0
- package/dist/domain/spec/expressions/index.d.ts +5 -0
- package/dist/domain/spec/expressions/memo-eval-plan.d.ts +70 -0
- package/dist/domain/spec/expressions/memo-eval-plan.js +1 -0
- package/dist/domain/spec/expressions/relation-expression-params.js +1 -0
- package/dist/domain/spec/index.d.ts +9 -0
- package/dist/domain/spec/index.js +1 -0
- package/dist/domain/spec/invariants/index.d.ts +2 -0
- package/dist/domain/spec/invariants/index.js +1 -0
- package/dist/domain/spec/invariants/invariant.d.ts +24 -0
- package/dist/domain/spec/invariants/invariant.js +1 -0
- package/dist/domain/spec/invariants/invariants.d.ts +14 -0
- package/dist/domain/spec/invariants/invariants.js +1 -0
- package/dist/domain/spec/json-schema.d.ts +52 -0
- package/dist/domain/spec/json-schema.js +1 -0
- package/dist/domain/spec/markers/index.d.ts +3 -0
- package/dist/domain/spec/markers/index.js +1 -0
- package/dist/domain/spec/markers/msg-marker.d.ts +28 -0
- package/dist/domain/spec/markers/msg-marker.js +1 -0
- package/dist/domain/spec/model/aliases.d.ts +9 -0
- package/dist/domain/spec/model/aliases.js +1 -0
- package/dist/domain/spec/model/common-types.d.ts +15 -0
- package/dist/domain/spec/model/common-types.js +1 -0
- package/dist/domain/spec/model/defaults.d.ts +33 -0
- package/dist/domain/spec/model/defaults.js +1 -0
- package/dist/domain/spec/model/entity-types.d.ts +8 -0
- package/dist/domain/spec/model/entity-types.js +1 -0
- package/dist/domain/spec/model/index.d.ts +7 -0
- package/dist/domain/spec/model/index.js +1 -0
- package/dist/domain/spec/model/model-version-key.d.ts +3 -0
- package/dist/domain/spec/model/model-version-key.js +1 -0
- package/dist/domain/spec/model/names/action-name.d.ts +7 -0
- package/dist/domain/spec/model/names/action-name.js +1 -0
- package/dist/domain/spec/model/names/alias-name.d.ts +7 -0
- package/dist/domain/spec/model/names/alias-name.js +1 -0
- package/dist/domain/spec/model/names/entity-or-alias-name.d.ts +8 -0
- package/dist/domain/spec/model/names/entity-or-alias-name.js +1 -0
- package/dist/domain/spec/model/names/entity-type-name.d.ts +8 -0
- package/dist/domain/spec/model/names/entity-type-name.js +1 -0
- package/dist/domain/spec/model/names/expression-name.d.ts +6 -0
- package/dist/domain/spec/model/names/expression-name.js +1 -0
- package/dist/domain/spec/model/names/index.d.ts +9 -0
- package/dist/domain/spec/model/names/index.js +1 -0
- package/dist/domain/spec/model/names/instance-name.d.ts +7 -0
- package/dist/domain/spec/model/names/instance-name.js +1 -0
- package/dist/domain/spec/model/names/invariant-name.d.ts +3 -0
- package/dist/domain/spec/model/names/invariant-name.js +1 -0
- package/dist/domain/spec/model/names/shape-property-name.d.ts +11 -0
- package/dist/domain/spec/model/names/shape-property-name.js +1 -0
- package/dist/domain/spec/model/names/violation-type-name.d.ts +3 -0
- package/dist/domain/spec/model/names/violation-type-name.js +1 -0
- package/dist/domain/spec/model/presets.d.ts +30 -0
- package/dist/domain/spec/model/presets.js +1 -0
- package/dist/domain/spec/sections/actions.d.ts +23 -0
- package/dist/domain/spec/sections/actions.js +1 -0
- package/dist/domain/spec/sections/app-metadata.d.ts +18 -0
- package/dist/domain/spec/sections/app-metadata.js +1 -0
- package/dist/domain/spec/sections/application-version.d.ts +7 -0
- package/dist/domain/spec/sections/application-version.js +1 -0
- package/dist/domain/spec/sections/data-spec/chunks.d.ts +23 -0
- package/dist/domain/spec/sections/data-spec/chunks.js +1 -0
- package/dist/domain/spec/sections/data-spec/custom-data-spec-entry.d.ts +16 -0
- package/dist/domain/spec/sections/data-spec/custom-data-spec-entry.js +1 -0
- package/dist/domain/spec/sections/data-spec/data-entry-key.d.ts +9 -0
- package/dist/domain/spec/sections/data-spec/data-entry-key.js +1 -0
- package/dist/domain/spec/sections/data-spec/index.d.ts +5 -0
- package/dist/domain/spec/sections/data-spec/index.js +1 -0
- package/dist/domain/spec/sections/data-spec/parsed-data-spec-entries.d.ts +10 -0
- package/dist/domain/spec/sections/data-spec/parsed-data-spec-entries.js +1 -0
- package/dist/domain/spec/sections/data-spec/swatch-data-spec-entry.d.ts +14 -0
- package/dist/domain/spec/sections/data-spec/swatch-data-spec-entry.js +1 -0
- package/dist/domain/spec/sections/index.d.ts +9 -0
- package/dist/domain/spec/sections/index.js +1 -0
- package/dist/domain/spec/sections/infra/acl.d.ts +12 -0
- package/dist/domain/spec/sections/infra/acl.js +1 -0
- package/dist/domain/spec/sections/infra/index.d.ts +3 -0
- package/dist/domain/spec/sections/infra/index.js +1 -0
- package/dist/domain/spec/sections/infra/resource-entry.d.ts +46 -0
- package/dist/domain/spec/sections/infra/resource-entry.js +1 -0
- package/dist/domain/spec/sections/infra/resources-config.d.ts +10 -0
- package/dist/domain/spec/sections/infra/resources-config.js +1 -0
- package/dist/domain/spec/sections/state-value.d.ts +7 -0
- package/dist/domain/spec/sections/state-value.js +1 -0
- package/dist/domain/spec/sections/theme.d.ts +10 -0
- package/dist/domain/spec/sections/theme.js +1 -0
- package/dist/domain/spec/sections/transformers.d.ts +15 -0
- package/dist/domain/spec/sections/transformers.js +1 -0
- package/dist/domain/spec/sections/ui.d.ts +12 -0
- package/dist/domain/spec/sections/ui.js +1 -0
- package/dist/domain/system-definitions.js +1 -1
- package/dist/domain/utils/index.d.ts +2 -0
- package/dist/domain/utils/index.js +1 -0
- package/dist/editor/graphql/GraphQLPanel.js +1 -1
- package/dist/i18n/locales/cs/messages.js +1 -1
- package/dist/i18n/locales/da/messages.js +1 -1
- package/dist/i18n/locales/de/messages.js +1 -1
- package/dist/i18n/locales/de-AT/messages.js +1 -1
- package/dist/i18n/locales/en/messages.js +1 -1
- package/dist/i18n/locales/en-AU/messages.js +1 -1
- package/dist/i18n/locales/en-GB/messages.js +1 -1
- package/dist/i18n/locales/es/messages.js +1 -1
- package/dist/i18n/locales/fr/messages.js +1 -1
- package/dist/i18n/locales/hu/messages.js +1 -1
- package/dist/i18n/locales/it/messages.js +1 -1
- package/dist/i18n/locales/nl/messages.js +1 -1
- package/dist/i18n/locales/pl/messages.js +1 -1
- package/dist/i18n/locales/pt/messages.js +1 -1
- package/dist/i18n/locales/ro/messages.js +1 -1
- package/dist/i18n/locales/sk/messages.js +1 -1
- package/dist/i18n/locales/tr/messages.js +1 -1
- package/dist/legacy/domain-spec/__generated/domain-schema.d.ts +2 -2
- package/dist/legacy/phoenix-cli/services/webhook-service/transport.js +1 -1
- package/dist/legacy/phoenix-cli/services/webhook-service/tunnel.d.ts +1 -0
- package/dist/legacy/phoenix-cli/services/webhook-service/tunnel.js +1 -1
- package/dist/legacy/webhook-cli/lambda-local/index.js +1 -1
- package/dist/phoenix/application-spec/generate-application-spec-project.d.ts +1 -0
- package/dist/phoenix/application-spec/generate-application-spec-project.js +2 -2
- package/dist/phoenix/application-spec/generate-project-files.d.ts +1 -0
- package/dist/phoenix/application-spec/index.d.ts +1 -0
- package/dist/phoenix/application-spec/index.js +1 -1
- package/dist/phoenix/application-spec/resolve-deployment-data.d.ts +11 -0
- package/dist/phoenix/application-spec/resolve-deployment-data.js +2 -2
- package/dist/phoenix/bin.js +1 -1
- package/dist/phoenix/cli.js +1 -1
- package/dist/phoenix/commands/activate-deployment.js +1 -1
- package/dist/phoenix/commands/build.js +1 -1
- package/dist/phoenix/commands/changelog.js +1 -1
- package/dist/phoenix/commands/check.js +1 -1
- package/dist/phoenix/commands/clean.js +1 -1
- package/dist/phoenix/commands/cleanup-environment.js +2 -2
- package/dist/phoenix/commands/create-environment.js +1 -1
- package/dist/phoenix/commands/data.js +1 -1
- package/dist/phoenix/commands/deploy.js +1 -1
- package/dist/phoenix/commands/deployment-build-envs-command.js +1 -1
- package/dist/phoenix/commands/dev.js +4 -5
- package/dist/phoenix/commands/docs.js +1 -1
- package/dist/phoenix/commands/finish-deployment-command.js +1 -1
- package/dist/phoenix/commands/fix.js +1 -1
- package/dist/phoenix/commands/index.d.ts +1 -1
- package/dist/phoenix/commands/index.js +1 -1
- package/dist/phoenix/commands/inspect-assets.js +1 -1
- package/dist/phoenix/commands/list-environments.js +1 -1
- package/dist/phoenix/commands/login.d.ts +4 -1
- package/dist/phoenix/commands/login.js +2 -2
- package/dist/phoenix/commands/prepare-deployment-command.js +2 -2
- package/dist/phoenix/commands/register-deployment.js +1 -1
- package/dist/phoenix/commands/scene.js +1 -1
- package/dist/phoenix/commands/screenshot.js +1 -1
- package/dist/phoenix/commands/state.js +1 -1
- package/dist/phoenix/commands/story-build.js +3 -3
- package/dist/phoenix/commands/story-create.js +1 -1
- package/dist/phoenix/commands/story-dev.js +2 -2
- package/dist/phoenix/commands/sync.js +1 -1
- package/dist/phoenix/commands/variants.js +1 -1
- package/dist/phoenix/editor-server/commands-router.js +1 -1
- package/dist/phoenix/editor-server/editor-server.d.ts +2 -13
- package/dist/phoenix/editor-server/editor-server.js +1 -1
- package/dist/phoenix/editor-server/spec-router.js +1 -1
- package/dist/phoenix/editor-server/trpc.d.ts +2 -12
- package/dist/phoenix/lingui/index.d.ts +1 -0
- package/dist/phoenix/lingui/index.js +1 -0
- package/dist/phoenix/lingui/lingui.d.ts +18 -0
- package/dist/phoenix/lingui/lingui.js +1 -0
- package/dist/phoenix/services/application-spec-project-watcher.d.ts +11 -6
- package/dist/phoenix/services/application-spec-project-watcher.js +2 -2
- package/dist/phoenix/services/cli-credentials.d.ts +3 -0
- package/dist/phoenix/services/cli-credentials.js +1 -1
- package/dist/phoenix/services/cli-exit.d.ts +5 -0
- package/dist/phoenix/services/cli-exit.js +1 -0
- package/dist/phoenix/services/deployment/deployment-preparation-service.d.ts +28 -0
- package/dist/phoenix/services/deployment/deployment-preparation-service.js +1 -0
- package/dist/phoenix/{commands → services/deployment}/generated-env-markers.d.ts +1 -0
- package/dist/phoenix/services/deployment/generated-env-markers.js +1 -0
- package/dist/phoenix/services/deployment/index.d.ts +2 -0
- package/dist/phoenix/services/deployment/index.js +1 -0
- package/dist/phoenix/services/index.d.ts +5 -1
- package/dist/phoenix/services/index.js +1 -1
- package/dist/phoenix/services/lingui-watcher.js +1 -1
- package/dist/phoenix/services/phoenix-store.d.ts +3 -0
- package/dist/phoenix/services/phoenix-store.js +1 -1
- package/dist/phoenix/services/prepare-development-environment.js +1 -1
- package/dist/phoenix/services/session/editor-server-handle.d.ts +5 -0
- package/dist/phoenix/services/session/editor-server-handle.js +1 -0
- package/dist/phoenix/services/session/index.d.ts +2 -0
- package/dist/phoenix/services/session/index.js +1 -0
- package/dist/phoenix/services/session/phoenix-application.d.ts +82 -0
- package/dist/phoenix/services/session/phoenix-application.js +2 -0
- package/dist/phoenix/services/telemetry/amplitude-telemetry-transport.d.ts +9 -0
- package/dist/phoenix/services/telemetry/amplitude-telemetry-transport.js +1 -0
- package/dist/phoenix/services/telemetry/index.d.ts +3 -0
- package/dist/phoenix/services/telemetry/index.js +1 -0
- package/dist/phoenix/services/telemetry/telemetry-client.d.ts +25 -0
- package/dist/phoenix/services/telemetry/telemetry-client.js +1 -0
- package/dist/phoenix/services/telemetry/telemetry-command.d.ts +2 -0
- package/dist/phoenix/services/telemetry/telemetry-command.js +1 -0
- package/dist/phoenix/services/telemetry/telemetry-event.d.ts +44 -0
- package/dist/phoenix/services/telemetry/telemetry-event.js +1 -0
- package/dist/phoenix/services/telemetry/telemetry-state.d.ts +25 -0
- package/dist/phoenix/services/telemetry/telemetry-state.js +2 -0
- package/dist/phoenix/services/vite-config.js +1 -1
- package/dist/phoenix/services/webhook-service/transport.js +1 -1
- package/dist/phoenix/services/webhook-service/tunnel.d.ts +1 -0
- package/dist/phoenix/services/webhook-service/tunnel.js +1 -1
- package/dist/react-sdk/application-runtime/domain-application-context/chat-system.d.ts +1 -1
- package/dist/{configurator/configurator-context → react-sdk}/configurator-routing/ConfiguratorRoutingProvider.d.ts +1 -1
- package/dist/react-sdk/configurator-routing/ConfiguratorRoutingProvider.js +1 -0
- package/dist/{configurator/configurator-context → react-sdk}/configurator-routing/OnGoToIndexHandler.d.ts +1 -2
- package/dist/react-sdk/configurator-routing/OnGoToIndexHandler.js +1 -0
- package/dist/react-sdk/configurator-routing/index.d.ts +3 -0
- package/dist/{configurator/configurator-context → react-sdk}/configurator-routing/index.js +1 -1
- package/dist/{configurator/configurator-context → react-sdk}/configurator-routing/use-power-routing-lifecycle.d.ts +2 -0
- package/dist/react-sdk/configurator-routing/use-power-routing-lifecycle.js +1 -0
- package/dist/react-sdk/domain-application-context/BackendDataProvider.js +1 -1
- package/dist/react-sdk/domain-application-context/ConfigurationPersistSystemFailureHandler.js +1 -1
- package/dist/react-sdk/domain-application-context/FrontendDataProvider.js +1 -1
- package/dist/react-sdk/domain-application-context/OnPresetLoadedHandler.js +1 -0
- package/dist/react-sdk/domain-application-context/PublishedDataProvider.js +1 -1
- package/dist/react-sdk/domain-application-context/chat-hooks.d.ts +4 -0
- package/dist/react-sdk/domain-application-context/chat-hooks.js +1 -0
- package/dist/react-sdk/domain-application-context/index.d.ts +2 -0
- package/dist/react-sdk/domain-application-context/index.js +1 -1
- package/dist/react-sdk/elements/PhoenixEntityElement.js +1 -1
- package/dist/react-sdk/elements/PhoenixLayoutElement.js +1 -1
- package/dist/react-sdk/index.d.ts +5 -0
- package/dist/react-sdk/index.js +1 -1
- package/dist/react-sdk/integration/IntegrationSubscription.js +1 -0
- package/dist/react-sdk/integration/index.d.ts +1 -0
- package/dist/react-sdk/integration/index.js +1 -0
- package/dist/react-sdk/lifecycle-providers/ConfiguratorDataProvider.d.ts +8 -0
- package/dist/react-sdk/lifecycle-providers/ConfiguratorDataProvider.js +1 -0
- package/dist/react-sdk/lifecycle-providers/LifecycleProviders.js +1 -0
- package/dist/react-sdk/lifecycle-providers/index.d.ts +2 -0
- package/dist/react-sdk/lifecycle-providers/index.js +1 -0
- package/dist/react-sdk/notifications/index.d.ts +1 -0
- package/dist/react-sdk/notifications/index.js +1 -0
- package/dist/react-sdk/notifications/snackbar-action-button.d.ts +30 -0
- package/dist/react-sdk/notifications/snackbar-action-button.js +1 -0
- package/dist/react-sdk/preset-selection/PresetSelectionProvider.js +1 -0
- package/dist/react-sdk/preset-selection/index.d.ts +1 -0
- package/dist/react-sdk/preset-selection/index.js +1 -0
- package/dist/react-sdk/session/SessionServiceProvider.d.ts +5 -0
- package/dist/react-sdk/session/SessionServiceProvider.js +1 -1
- package/dist/ui-sdk/components/snackbar/Snackbar.d.ts +24 -3
- package/dist/ui-sdk/components/snackbar/Snackbar.js +1 -1
- package/dist/ui-sdk/icons/__generated/Paperclip.d.ts +3 -0
- package/dist/ui-sdk/icons/__generated/Paperclip.js +1 -0
- package/dist/ui-sdk/icons/__generated/index.d.ts +2 -0
- package/dist/ui-sdk/icons/__generated/index.js +1 -1
- package/dist/ui-sdk/icons/icons-registry.js +1 -1
- package/dist/ui-sdk/theme/types.d.ts +1 -1
- package/dist/watch/glob-matcher.d.ts +4 -4
- package/dist/watch/glob-matcher.js +1 -1
- package/dist/watch/watch.d.ts +4 -4
- package/dist/watch/watch.js +1 -1
- package/package.json +3 -3
- package/schema/domain-spec.json +22 -4
- package/dist/application-spec/core/components/index.d.ts +0 -2
- package/dist/application-spec/core/expressions/index.d.ts +0 -2
- package/dist/configurator/configurator-context/ConfiguratorDataProvider.d.ts +0 -2
- package/dist/configurator/configurator-context/ConfiguratorDataProvider.js +0 -1
- package/dist/configurator/configurator-context/IntegrationSubscription.js +0 -1
- package/dist/configurator/configurator-context/LifecycleProviders.js +0 -1
- package/dist/configurator/configurator-context/OnPresetLoadedHandler.js +0 -1
- package/dist/configurator/configurator-context/PresetSelectionProvider.js +0 -1
- package/dist/configurator/configurator-context/configurator-hooks/chat-hooks.d.ts +0 -1
- package/dist/configurator/configurator-context/configurator-hooks/chat-hooks.js +0 -1
- package/dist/configurator/configurator-context/configurator-routing/ConfiguratorRoutingProvider.js +0 -1
- package/dist/configurator/configurator-context/configurator-routing/OnGoToIndexHandler.js +0 -1
- package/dist/configurator/configurator-context/configurator-routing/index.d.ts +0 -2
- package/dist/configurator/configurator-context/configurator-routing/use-power-routing-lifecycle.js +0 -1
- package/dist/domain/available-system-components.d.ts +0 -11
- package/dist/domain/available-system-components.js +0 -1
- package/dist/domain/domain-builder.js +0 -1
- package/dist/phoenix/commands/generated-env-markers.js +0 -1
- package/dist/phoenix/services/lingui.d.ts +0 -15
- package/dist/phoenix/services/lingui.js +0 -1
- package/dist/phoenix/services/phoenix-application.d.ts +0 -21
- package/dist/phoenix/services/phoenix-application.js +0 -1
- /package/dist/{application-spec/core/expressions/relation-expression-params.js → domain/spec/application/admin-pages-section.js} +0 -0
- /package/dist/{application-spec/parse-application-files/spec/components/component-entry.js → domain/spec/application/admin-pages.js} +0 -0
- /package/dist/{application-spec/parse-application-files/spec/expressions/expression.js → domain/spec/application/admin-states.js} +0 -0
- /package/dist/{application-spec/core → domain/spec/application}/application-instance.d.ts +0 -0
- /package/dist/{application-spec/core → domain/spec/application}/application-instance.js +0 -0
- /package/dist/{application-spec/core → domain/spec}/components/component-filter.js +0 -0
- /package/dist/{application-spec/core → domain/spec}/components/index.js +0 -0
- /package/dist/{application-spec/core → domain/spec}/components/sdk-code-ref.d.ts +0 -0
- /package/dist/{application-spec/core → domain/spec}/components/sdk-code-ref.js +0 -0
- /package/dist/{application-spec/core → domain/spec}/expressions/index.js +0 -0
- /package/dist/{application-spec/core → domain/spec}/expressions/relation-expression-params.d.ts +0 -0
- /package/dist/{application-spec/core → domain/spec}/expressions/sdk-expression-implementation.d.ts +0 -0
- /package/dist/{application-spec/core → domain/spec}/expressions/sdk-expression-implementation.js +0 -0
- /package/dist/{application-spec/parse-application-files/spec/components → domain/spec/markers}/component-prop-target.d.ts +0 -0
- /package/dist/{application-spec/parse-application-files/spec/components → domain/spec/markers}/component-prop-target.js +0 -0
- /package/dist/{application-spec/core → domain/spec}/markers/eval-marker.d.ts +0 -0
- /package/dist/{application-spec/core → domain/spec}/markers/eval-marker.js +0 -0
- /package/dist/{configurator/configurator-context → react-sdk/domain-application-context}/OnPresetLoadedHandler.d.ts +0 -0
- /package/dist/{configurator/configurator-context → react-sdk/integration}/IntegrationSubscription.d.ts +0 -0
- /package/dist/{configurator/configurator-context → react-sdk/lifecycle-providers}/LifecycleProviders.d.ts +0 -0
- /package/dist/{configurator/configurator-context → react-sdk/preset-selection}/PresetSelectionProvider.d.ts +0 -0
package/dist/configurator/application-runtime/extensions/systems/graphql-system/violations.d.ts
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import type { Localizable } from '@salsita-ai/common/utils';
|
|
2
|
+
import type { DomainEntity, EntityId, StateValidationResult } from '#package/domain';
|
|
3
|
+
type AnyStateValidationResult = StateValidationResult<DomainEntity<string>, string>;
|
|
4
|
+
/** One violation that makes a change fail, as the agent reads it; a violation can sit on a virtual entity. */
|
|
5
|
+
export interface ViolationEntry {
|
|
6
|
+
readonly type: string;
|
|
7
|
+
readonly entityId: EntityId | null;
|
|
8
|
+
readonly message: string | null;
|
|
9
|
+
}
|
|
10
|
+
/** One warning or notice, which never makes a change fail. */
|
|
11
|
+
export interface AssistantWarning {
|
|
12
|
+
readonly type: string;
|
|
13
|
+
readonly severity: 'warning' | 'notice';
|
|
14
|
+
readonly entityId: EntityId | null;
|
|
15
|
+
readonly message: string | null;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Thrown by a mutation field whose changes would leave the configuration invalid. graphql-js reports
|
|
19
|
+
* one error per failed field, so the field throws this one error and the executor's caller replaces
|
|
20
|
+
* it with one GraphQL error per violation.
|
|
21
|
+
*/
|
|
22
|
+
export declare class ViolationsError extends Error {
|
|
23
|
+
readonly entries: readonly ViolationEntry[];
|
|
24
|
+
constructor(message: string, entries: readonly ViolationEntry[]);
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* The violations an invalid validity fails on: those of its failing severity, or the one error that
|
|
28
|
+
* validation threw.
|
|
29
|
+
*/
|
|
30
|
+
export declare const readViolationEntries: (validity: Extract<AnyStateValidationResult, {
|
|
31
|
+
readonly valid: false;
|
|
32
|
+
}>, resolveLocalizable: (message: Localizable) => string) => readonly ViolationEntry[];
|
|
33
|
+
/**
|
|
34
|
+
* The warnings and notices of `after` that `before` did not have, in the order of `after`; every one
|
|
35
|
+
* of `after` when there is no `before`.
|
|
36
|
+
*/
|
|
37
|
+
export declare const readStateWarnings: (after: AnyStateValidationResult, before: AnyStateValidationResult | undefined, resolveLocalizable: (message: Localizable) => string) => readonly AssistantWarning[];
|
|
38
|
+
/** The warnings and notices of a validity that are on one entity, in the order of the validity. */
|
|
39
|
+
export declare const readEntityWarnings: (entityId: EntityId, validity: AnyStateValidationResult, resolveLocalizable: (message: Localizable) => string) => readonly AssistantWarning[];
|
|
40
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export class ViolationsError extends Error{entries;constructor(e,t){super(e),this.entries=t}}let e=(e,t)=>void 0===e?null:t(e);export const readViolationEntries=(t,r)=>"uncaught"===t.severity?[{type:"uncaught",entityId:null,message:t.error.message}]:t.entityViolations.filter(({violation:e})=>e.severity===t.severity).map(({entityId:t,violation:i})=>({type:i.type,entityId:t,message:e(i.message,r)}));let t=e=>null===e.severity||"uncaught"===e.severity?[]:e.entityViolations.filter(({violation:e})=>{let t;return"warning"===(t=e.severity)||"notice"===t}),r=({entityId:e,violation:{type:t,severity:r}})=>JSON.stringify([e,t,r]),i=(t,r,i)=>({type:r.type,severity:"notice"===r.severity?"notice":"warning",entityId:t,message:e(r.message,i)});export const readStateWarnings=(e,n,s)=>{let a=new Set(void 0===n?[]:t(n).map(r));return t(e).filter(e=>!a.has(r(e))).map(({entityId:e,violation:t})=>i(e,t,s))};export const readEntityWarnings=(e,r,n)=>t(r).filter(t=>t.entityId===e).map(({violation:t})=>i(e,t,n));
|
|
@@ -1,8 +1,8 @@
|
|
|
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 CreateAddEntityFab, type CreateAppLoader, type CreateCollectFrontendDataHandler, type CreateConfigurationNotFoundPage, type CreateConfiguratorErrorPage, type CreateDeleteEntityFab, type CreateFilterPublishedChunksHandler, type CreateNavigationHotspot, type CreateNotAuthenticatedPage, type CreatePresetUi, type CreateSelectionHotspot, type CreateToolMenuFab, 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 UseActiveViewports, 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 UseConfigurationSaveState, 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 UseFinalizeActions, 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 UseLocaleSwitch, 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 UseShareLinks, type UseSlice, type UseState, type UseStateValidity, type UseStepNavigation, type UseSwatchSelection, type UseSynchronizedSelector, type UseSynchronizedSelector$, type UseTabNavigation, type UseTextValue, type UseUndoRedo, type UseUpdateControl, type UseUpdatedControl, useGenerateShareLink, useLoadingStateValue, useLocalizable, useResolveLocalizable } from '#package/react-sdk';
|
|
2
|
+
import { type CreateAddEntityFab, type CreateAppLoader, type CreateCollectFrontendDataHandler, type CreateConfigurationNotFoundPage, type CreateConfiguratorErrorPage, type CreateDeleteEntityFab, type CreateFilterPublishedChunksHandler, type CreateNavigationHotspot, type CreateNotAuthenticatedPage, type CreateOnApplicationStartProvider, type CreateOnBackendDataReadyProvider, type CreateOnConfiguratorReadyProvider, type CreateOnFrontendDataReadyProvider, type CreateOnGoToIndexHandler, type CreateOnPresetLoadedHandler, type CreateOnPublishedDataReadyProvider, type CreateOnRoutingReadyProvider, type CreateOnSessionReadyProvider, type CreatePresetUi, type CreateSelectionHotspot, type CreateToolMenuFab, 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 UseActiveViewports, 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 UseConfigurationSaveState, type UseConfiguratorMessages, type UseConfiguratorRouting, 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 UseFinalizeActions, 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 UseLocaleSwitch, type UseMapViolationHints, type UseNavigate, type UsePopNavigate, type UsePresetEmbeddedState, type UsePresetSelection, 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 UseShareLinks, type UseSlice, type UseState, type UseStateValidity, type UseStepNavigation, type UseSwatchSelection, type UseSynchronizedSelector, type UseSynchronizedSelector$, type UseTabNavigation, type UseTextValue, type UseUndoRedo, type UseUpdateControl, type UseUpdatedControl, useGenerateShareLink, useLoadingStateValue, useLocalizable, useResolveLocalizable } from '#package/react-sdk';
|
|
3
3
|
import { type CreatePhoenixIconSet } from '#package/ui-sdk';
|
|
4
4
|
import { type UseConfiguratorExtensions } from '../application-runtime/index.js';
|
|
5
|
-
import {
|
|
5
|
+
import { usePreview, usePropertyPageStack, usePropertyPageState } from '../configurator-context/index.js';
|
|
6
6
|
import { useCloseAction } from '../integration/index.js';
|
|
7
7
|
import { type CreateGetTextureProcessingMapHandler } from '../scene/index.js';
|
|
8
8
|
import type { UseUpdateEntityObjectSelection } from '../scene/scene-entity/drag-and-drop/use-updated-selection.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{createCustomPhoenixEntityElement as e,createCustomPhoenixLayoutElement as t,createGetThemeHandler as r,createGetWebComponentOptionsHandler as o,createPhoenixHandler as i,createTransformer as n,createTransformerBuilder as s,createUpdateFactory as a,getIdSequence as m,isCreateEntityUpdate as p,isReplaceEntityUpdate as d}from"#package/domain";import{createAddEntityFab as c,createAppLoader as u,createCollectFrontendDataHandler as f,createConfigurationNotFoundPage as l,createConfiguratorErrorPage as g,createDeleteEntityFab as j,createFilterPublishedChunksHandler as x,createNavigationHotspot as k,createNotAuthenticatedPage as y,
|
|
1
|
+
import{createCustomPhoenixEntityElement as e,createCustomPhoenixLayoutElement as t,createGetThemeHandler as r,createGetWebComponentOptionsHandler as o,createPhoenixHandler as i,createTransformer as n,createTransformerBuilder as s,createUpdateFactory as a,getIdSequence as m,isCreateEntityUpdate as p,isReplaceEntityUpdate as d}from"#package/domain";import{createAddEntityFab as c,createAppLoader as u,createCollectFrontendDataHandler as f,createConfigurationNotFoundPage as l,createConfiguratorErrorPage as g,createDeleteEntityFab as j,createFilterPublishedChunksHandler as x,createNavigationHotspot as k,createNotAuthenticatedPage as y,createOnApplicationStartProvider as I,createOnBackendDataReadyProvider as A,createOnConfiguratorReadyProvider as C,createOnFrontendDataReadyProvider as S,createOnGoToIndexHandler as w,createOnPresetLoadedHandler as E,createOnPublishedDataReadyProvider as b,createOnRoutingReadyProvider as q,createOnSessionReadyProvider as B,createPresetUi as P,createSelectionHotspot as R,createToolMenuFab as U,isAngleDimensionUpdate as h,isAttributeSelectionUpdate as v,isAttributeSwitchUpdate as z,isDeleteEntityUpdate as D,isDistanceDimensionUpdate as F,isGenericDimensionUpdate as G,isSwatchSelectionUpdate as H,isTextValueUpdate as J,useAccessService as K,useActiveNavigationState as L,useActiveToolState as M,useActiveViewState as N,useActiveViewports as O,useAnalyticsService as Q,useAngleDimension as T,useAttributeSelection as V,useAttributeSwitch as W,useAuthenticatedClient as X,useAuthorizedClient as Y,useBackendData as Z,useChildEntitySelection as $,useCommittedSlice as _,useCommittedState as ee,useComponent as et,useComponents as er,useComposition as eo,useConfigurationId as ei,useConfigurationSaveState as en,useConfiguratorMessages as es,useConfiguratorRouting as ea,useControlViolations as em,useCookRecipes as ep,useCookReplaceRecipes as ed,useCookedRecipes as ec,useCookedReplaceRecipes as eu,useCreateAuthorizedClient as ef,useDeleteEntity as el,useDeletedEntity as eg,useDeselect as ej,useDistanceDimension as ex,useDistanceDimensionSelection as ek,useDomain as ey,useDomainApplication as eI,useDomainApplicationProps as eA,useDomainEntityRenderedState as eC,useDomainEntityState as eS,useEntityPrice as ew,useEntitySelector as eE,useFinalizeAction as eb,useFinalizeActions as eq,useFinalizeViolations as eB,useFirstComponent as eP,useFirstRenderedComponent as eR,useFirstRootComponent as eU,useFirstRootRenderedComponent as eh,useFrontendData as ev,useGenerateShareLink as ez,useGenericDimension as eD,useGroupedRecipeOptions as eF,useHoveredDomainEntityId as eG,useHoveredEntity as eH,useHoveredEntityId as eJ,useIntegrationService as eK,useIntegrationState as eL,useIsFullscreenActive as eM,useLoadedData as eN,useLoadingState as eO,useLoadingStateValue as eQ,useLocaleSwitch as eT,useLocalizable as eV,useMapViolationHints as eW,useNavigate as eX,usePopNavigate as eY,usePresetEmbeddedState as eZ,usePresetSelection as e$,usePublishedData as e_,usePushNavigate as e0,useRecipeEmbeddedState as e1,useRenderedComponent as e2,useRenderedComponents as e3,useRenderedEntitySelector as e4,useRenderedRootEntitySelector as e5,useRenderedSelector as e6,useRenderedSelector$ as e7,useRenderedSlice as e8,useRenderedState as e9,useReplaceEntityRecipeOptions as te,useResolveLocalizable as tt,useRootComponents as tr,useRootEntityId as to,useRootEntityPrice as ti,useRootEntityRenderedId as tn,useRootEntityRenderedState as ts,useRootEntitySelector as ta,useRootEntityState as tm,useRootRenderedComponents as tp,useSelectEntity as td,useSelectParent as tc,useSelectedDomainEntityId as tu,useSelectedEntity as tf,useSelectedEntityId as tl,useSession as tg,useSessionRole as tj,useSessionService as tx,useSetFullscreen as tk,useSetViewState as ty,useShareLinks as tI,useStateValidity as tA,useStepNavigation as tC,useStoreSelector as tS,useStoreSelector$ as tw,useSwatchSelection as tE,useTabNavigation as tb,useTextValue as tq,useUndoRedo as tB,useUpdateControl as tP,useUpdatedControl as tR}from"#package/react-sdk";import{createPhoenixIconSet as tU}from"#package/ui-sdk";import{useConfigurator as th}from"../application-runtime/index.js";import{usePreview as tv,usePropertyPageStack as tz,usePropertyPageState as tD}from"../configurator-context/index.js";import{useCloseAction as tF}from"../integration/index.js";import{createGetTextureProcessingMapHandler as tG}from"../scene/index.js";import{useUpdateEntityObjectSelection as tH}from"../scene/scene-entity/drag-and-drop/use-updated-selection.js";import{useAssistantPanel as tJ,useMeasurements as tK,useToolbarActions as tL}from"../toolbar-actions/index.js";import{LayoutSlots as tM,createCanvasLoader as tN,createLayoutAdminUi as tO,createLayoutCustomOwnerUi as tQ,createLayoutCustomReadUi as tT,createLayoutDialog as tV,createLayoutFooter as tW,createLayoutToolbarDesktop as tX,createLayoutToolbarDesktopFullScreen as tY,createLayoutToolbarReadDesktop as tZ,createLayoutToolbarReadDesktopFullScreen as t$,createLayoutUserUi as t_,createToolbarHelp as t0,useSceneSafeArea as t1}from"../ui/index.js";import{createPresetDeviceNotSupported as t2,createPresetPageAction as t3}from"../ui/preset-layout/PresetUi.js";import{useResetCamera as t4}from"./use-reset-camera.js";export const createConfiguratorInterface=t5=>({updates:a(),getIdSequence:m,createGetWebComponentOptionsHandler:o,createGetThemeHandler:r,createPhoenixHandler:i,createCustomPhoenixEntityElement:e,createCustomPhoenixLayoutElement:t,createPhoenixIconSet:tU,createGetTextureProcessingMapHandler:tG,createCollectFrontendDataHandler:f,createFilterPublishedChunksHandler:x,createOnGoToIndexHandler:w,createOnApplicationStartProvider:I,createOnSessionReadyProvider:B,createOnPublishedDataReadyProvider:b,createOnFrontendDataReadyProvider:S,createOnBackendDataReadyProvider:A,createOnRoutingReadyProvider:q,createOnConfiguratorReadyProvider:C,createOnPresetLoadedHandler:E,createPresetUi:P,createPresetPageAction:t3,createPresetDeviceNotSupported:t2,createLayoutFooter:tW,createAppLoader:u,createCanvasLoader:tN,createLayoutDialog:tV,createLayoutToolbarDesktop:tX,createLayoutToolbarDesktopFullScreen:tY,createLayoutToolbarReadDesktop:tZ,createLayoutToolbarReadDesktopFullScreen:t$,createLayoutCustomOwnerUi:tQ,createLayoutCustomReadUi:tT,createLayoutAdminUi:tO,createLayoutUserUi:t_,createToolbarHelp:t0,createNotAuthenticatedPage:y,createConfigurationNotFoundPage:l,createConfiguratorErrorPage:g,createAddEntityFab:c,createDeleteEntityFab:j,createSelectionHotspot:R,createNavigationHotspot:k,createToolMenuFab:U,createTransformer:n,transformerBuilder:s(),useAnalytics:Q,useAuthenticatedClient:X,useAuthorizedClient:Y,useCreateAuthorizedClient:ef,useAccessService:K,useConfigurationId:ei,useSession:tg,useSessionRole:tj,useSessionService:tx,useDomain:ey,useDomainApplication:eI,useConfigurator:th,useConfiguratorRouting:ea,usePresetSelection:e$,usePublishedData:e_,useFrontendData:ev,useBackendData:Z,useDomainApplicationProps:eA,useLoadedData:eN,useIntegrationService:eK,useIntegrationState:eL,usePresetEmbeddedState:eZ,useRecipeEmbeddedState:e1,useCommittedSlice:_,useRenderedSlice:e8,useCommittedState:ee,useRenderedState:e9,useStoreSelector:tS,useRenderedSelector:e6,useStoreSelector$:tw,useRenderedSelector$:e7,useEntitySelector:eE,useRenderedEntitySelector:e4,useRootEntitySelector:ta,useRenderedRootEntitySelector:e5,useStateValidity:tA,useMapViolationHints:eW,useNavigate:eX,usePopNavigate:eY,usePushNavigate:e0,useControlViolations:em,useFinalizeViolations:eB,useConfiguratorMessages:es,useConfigurationSaveState:en,useFinalizeAction:eb,useFinalizeActions:eq,useComponent:et,useRenderedComponent:e2,useComponents:er,useRenderedComponents:e3,useFirstComponent:eP,useFirstRenderedComponent:eR,useRootComponents:tr,useRootRenderedComponents:tp,useFirstRootComponent:eU,useFirstRootRenderedComponent:eh,useEntityState:eS,useEntityRenderedState:eC,useRootEntityState:tm,useRootEntityRenderedState:ts,useRootEntityId:to,useRootEntityRenderedId:tn,useEntityPrice:ew,useRootEntityPrice:ti,useSelectedEntity:tf,useSelectedEntityId:tl,useSelectedDomainEntityId:tu,useSelectEntity:td,useDeselect:ej,useSelectParent:tc,useHoveredEntity:eH,useHoveredEntityId:eJ,useHoveredDomainEntityId:eG,useActiveNavigationState:L,useActiveViewState:N,useSetViewState:ty,useActiveToolState:M,useIsFullscreenActive:eM,useSetFullscreen:tk,useResetCamera:t4,useUndoRedo:tB,useTabNavigation:tb,useStepNavigation:tC,useSceneSafeArea:t1,useActiveViewports:O,usePreview:tv,useCloseAction:tF,useIsCloningAllowed:tM.useIsCloningAllowed,useResolveLocalizable:tt,useLocalizable:eV,useToolbarActions:tL,useMeasurements:tK,useLocaleSwitch:eT,useShareLinks:tI,useAssistantPanel:tJ,useComposition:eo,useUpdateControl:tP,useUpdatedControl:tR,useCookRecipes:ep,useCookedRecipes:ec,useCookReplaceRecipes:ed,useCookedReplaceRecipes:eu,useDeleteEntity:el,useDeletedEntity:eg,useSwatchSelection:tE,useTextValue:tq,useAttributeSelection:V,useAttributeSwitch:W,useDistanceDimension:ex,useDistanceDimensionSelection:ek,useGenericDimension:eD,useAngleDimension:T,useChildEntitySelection:$,useGroupedRecipeOptions:eF,useReplaceEntityRecipeOptions:te,useUpdateEntityObjectSelection:tH,useGenerateShareLink:ez,useLoadingState:eO,useLoadingStateValue:eQ,usePropertyPageStack:tz,usePropertyPageState:tD,isCreateEntityUpdate:p,isReplaceEntityUpdate:d,isDeleteEntityUpdate:D,isAngleDimensionUpdate:h,isDistanceDimensionUpdate:F,isGenericDimensionUpdate:G,isAttributeSelectionUpdate:v,isAttributeSwitchUpdate:z,isTextValueUpdate:J,isSwatchSelectionUpdate:H});
|
|
@@ -1,4 +1,3 @@
|
|
|
1
1
|
export { useLayoutSystemConfig, useEnterSidebarSummary, useLeaveSidebarSummary, useIsSidebarSummaryActive, useSidebarSummary, useSidebarContents, useSidebarGoBack, useHasSidebarSummary, useToolbarState, useSteps, useBackToPresetEnabled, useEmbeddedModeActive, usePresetEmbeddedModeActive, useHasSteps, useHeaderStyle, } from './layout-hooks.js';
|
|
2
2
|
export { usePropertyPageState, usePropertyPageStack } from './property-page/property-page-hooks.js';
|
|
3
3
|
export { PropertyStateProvider } from './property-page/PropertyStateProvider.js';
|
|
4
|
-
export { useChatEnabled } from './chat-hooks.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{useLayoutSystemConfig,useEnterSidebarSummary,useLeaveSidebarSummary,useIsSidebarSummaryActive,useSidebarSummary,useSidebarContents,useSidebarGoBack,useHasSidebarSummary,useToolbarState,useSteps,useBackToPresetEnabled,useEmbeddedModeActive,usePresetEmbeddedModeActive,useHasSteps,useHeaderStyle}from"./layout-hooks.js";export{usePropertyPageState,usePropertyPageStack}from"./property-page/property-page-hooks.js";export{PropertyStateProvider}from"./property-page/PropertyStateProvider.js";
|
|
1
|
+
export{useLayoutSystemConfig,useEnterSidebarSummary,useLeaveSidebarSummary,useIsSidebarSummaryActive,useSidebarSummary,useSidebarContents,useSidebarGoBack,useHasSidebarSummary,useToolbarState,useSteps,useBackToPresetEnabled,useEmbeddedModeActive,usePresetEmbeddedModeActive,useHasSteps,useHeaderStyle}from"./layout-hooks.js";export{usePropertyPageState,usePropertyPageStack}from"./property-page/property-page-hooks.js";export{PropertyStateProvider}from"./property-page/PropertyStateProvider.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{useCallback as e,useMemo as t}from"react";import{fixedHeaderComponent as r,floatingHeaderComponent as
|
|
1
|
+
import{useCallback as e,useMemo as t}from"react";import{fixedHeaderComponent as r,floatingHeaderComponent as a,isFixedHeaderSnapshot as s,isFloatingHeaderSnapshot as n,navigationStepsComponent as o}from"#package/domain";import{useActiveNavigationState as i,useDomain as u,useFirstComponent as m,usePresetEmbeddedState as d,usePresetSelection as l,useStoreSelector as p}from"#package/react-sdk";import{useConfigurator as c}from"../../application-runtime/index.js";export const useLayoutSystemConfig=()=>{let{layoutSystem:e}=c();return p(t=>e.getLayoutConfig(t.state),[e])};export const useEnterSidebarSummary=()=>{let{storeSystem:t}=u(),{layoutSystem:r}=c();return e(()=>{let e=r.getEnterSidebarSummaryUpdates(t.stateSlices.committed.value.state);t.stageAndCommit(e)},[r,t])};export const useLeaveSidebarSummary=()=>{let{storeSystem:t}=u(),{layoutSystem:r}=c();return e(()=>{let e=r.getLeaveSidebarSummaryUpdates(t.stateSlices.committed.value.state);t.stageAndCommit(e)},[r,t])};export const useIsSidebarSummaryActive=()=>{let{layoutSystem:e}=c();return p(t=>e.getSidebarSummaryPage(t.state).isSummaryActive,[e])};export const useSidebarSummary=()=>{let{layoutSystem:e}=c();return p(t=>e.getSidebarSummaryPage(t.state),[e])};export const useSidebarContents=()=>{let{layoutSystem:e}=c();return p(t=>e.getSidebarContent(t.state),[e])};export const useSidebarGoBack=()=>{let{layoutSystem:t}=c(),{storeSystem:r}=u();return e(()=>{let e=t.getSidebarBackUpdates(r.stateSlices.committed.value.state);r.stageAndCommit(e)},[t,r])};export const useHasSidebarSummary=()=>{let{page:e}=useSidebarSummary();return null!==e};export const useToolbarState=()=>{let{layoutSystem:e}=c();return p(t=>e.getToolbarState(t.state),[e])};export const useEmbeddedModeActive=()=>!!d();export const usePresetEmbeddedModeActive=()=>d()?.type==="preset";export const useBackToPresetEnabled=()=>{let{hasMultiplePresets:e}=l();return!d()&&e};export const useSteps=()=>{let e=m({componentTypes:[o]}),r=i(),{hasMultiplePresets:a}=l(),s=!!d(),n=t(()=>e?.state.steps??[],[e]),u=t(()=>n.findIndex(e=>e.navigationStates.includes(r)),[n,r]),p=t(()=>n.length>1&&0===u,[u,n.length]),c=t(()=>n.length>1&&u===n.length-1,[u,n.length]),S=t(()=>(u+1)/(n.length+1)*100,[u,n.length]);return{currentStep:t(()=>n.find(e=>e.navigationStates.includes(r)),[n,r]),progress:S,hasSteps:n.length>1,isFirstStep:p,isLastStep:c,previousStepDisabled:p&&!(!s&&a)}};export const useHasSteps=()=>{let{componentReader:e}=u();return p(t=>{let r=e.readFirstComponent({componentTypes:[o],entityIds:[t.state.rootEntityId]},t.state);return r&&r.state.steps.length>0},[e])};export const useHeaderStyle=()=>{let e=m({componentTypes:[a,r]});return t(()=>e?n(e)?"floating":s(e)?"fixed":"none":"none",[e])};
|
|
@@ -1,9 +1,4 @@
|
|
|
1
|
-
export { usePresetSelection, type UsePresetSelection, PresetSelectionProvider, type PresetSelectionProviderProps, } from './PresetSelectionProvider.js';
|
|
2
|
-
export { useOnPresetLoadedHandler, createOnPresetLoadedHandler, type CreateOnPresetLoadedHandler, } from './OnPresetLoadedHandler.js';
|
|
3
|
-
export { IntegrationSubscription, type IntegrationSubscriptionProps } from './IntegrationSubscription.js';
|
|
4
1
|
export { ViewportStateSync } from './ViewportStateSync.js';
|
|
5
2
|
export { PreviewApplicationProvider } from './PreviewApplicationProvider.js';
|
|
6
3
|
export { PreviewContextProvider, usePreview } from './PreviewContextProvider.js';
|
|
7
|
-
export * from './LifecycleProviders.js';
|
|
8
4
|
export * from './configurator-hooks/index.js';
|
|
9
|
-
export * from './configurator-routing/index.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{
|
|
1
|
+
export{ViewportStateSync}from"./ViewportStateSync.js";export{PreviewApplicationProvider}from"./PreviewApplicationProvider.js";export{PreviewContextProvider,usePreview}from"./PreviewContextProvider.js";export*from"./configurator-hooks/index.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as o}from"react/jsx-runtime";import{
|
|
1
|
+
import{jsx as o}from"react/jsx-runtime";import{useConfiguratorRouting as r}from"#package/react-sdk";import{ConfigurationNotFoundPageElement as t}from"../configuration-not-found-page/index.js";export const ConfiguratorNotFoundPage=()=>o(t,{onBack:r().goToIndex});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as o,jsxs as r}from"react/jsx-runtime";import i from"mui-modal-provider";import{memo as e,useCallback as n,useEffect as t,useState as a}from"react";import{InvalidAccessKeyError as d}from"#package/client";import{BuiltInLoadingPhase as l,CommonAnalyticsFactory as s,DomainLifecycleBoundary as c,FinalizeActionsHost as u,FinalizeActionsProvider as f,
|
|
1
|
+
import{jsx as o,jsxs as r}from"react/jsx-runtime";import i from"mui-modal-provider";import{memo as e,useCallback as n,useEffect as t,useState as a}from"react";import{InvalidAccessKeyError as d}from"#package/client";import{BuiltInLoadingPhase as l,CommonAnalyticsFactory as s,DomainLifecycleBoundary as c,FinalizeActionsHost as u,FinalizeActionsProvider as f,IntegrationSubscription as m,LoadedDataProvider as g,OnConfiguratorReadyProvider as p,PhoenixLayoutElement as v,useAccessService as I,useAnalyticsService as h,useAuthorizedClient as j,useConfiguratorDomainFactory as C,useConfiguratorLoadStatus as k,useConfiguratorRawLoadedData as w,useLoadedDataActions as y,useLoadingError as b,useLoadingPhase as x,useLogger as M,useRoutingService as E,useSpecAssistant as L}from"#package/react-sdk";import{useConfigurator as D}from"../application-runtime/index.js";import{ViewportStateSync as F}from"../configurator-context/index.js";import{ConfiguratorNotFoundPage as T}from"./ConfiguratorNotFoundPage.js";import{ConfiguratorLayoutName as P}from"./configurator-layout-name.js";import{DevContextFallback as R}from"./error-boundaries/DevContextFallback.js";import{DevLoadingFallback as V}from"./error-boundaries/DevLoadingFallback.js";import{LoadingErrorBoundary as A}from"./error-boundaries/LoadingErrorBoundary.js";import{useLoad as S}from"./use-load.js";let q=({onMount:o})=>(t(()=>{o()},[o]),null),B=e(({onLayoutMount:e})=>((()=>{let{assistantSystem:o}=D(),r=null!=L();t(()=>{if(r)return o.activate()},[o,r])})(),o(f,{children:o(i,{children:r(p,{children:[o(u,{}),o(v,{name:P}),o(q,{onMount:e})]})})})));export const LoadedConfiguratorDetailPage=()=>{let[i,e]=a(!1),t=n(()=>{e(!0)},[]),{configurationId:u,accessInfo:f}=I(),p=j(),v=E(),L=M(),D=h(),{startConfiguratorLoad:P,completeConfiguratorLoad:q,failConfiguratorLoad:G,resetConfiguratorLoad:N}=y(),{isLoading:z,isError:H}=k(),J=w(),K=C(),O=n(()=>f.viewMode&&void 0!==f.revisionId?p.getConfigurationRevision(u,f.revisionId):p.getConfiguration(u),[f.revisionId,f.viewMode,p,u]),Q=n(()=>{P()},[P]),U=n(o=>{q({initialRevisionId:o.revisionId,initialEntities:o.data,modelVersion:o.modelVersion,rootEntityType:o.rootEntityType,schemaIdentity:K}),D.push(s.ConfigurationLoaded(o.configurationId,o.revisionId,f.viewMode?"read":"owner")),L.appendToGlobalContext({configurationId:o.configurationId,revisionId:o.revisionId,mode:f.viewMode}),L.info("Configuration loaded.")},[f.viewMode,D,q,K,L]),W=n(o=>{if(G(o),o instanceof d)return void v.rejectAccessToken(u,f.raw);let r=o instanceof Error?o:Error("Configuration loading failed with an unknown error.",{cause:o});L.error("Configuration loading failed because the API request did not succeed. Verify the configuration ID and access token.",{configurationId:u},r)},[f.raw,u,G,L,v]),X=n(()=>{N()},[N]);return(S({key:[p,u,f.revisionId,f.viewMode],load:O,onStart:Q,onSuccess:U,onError:W,onCleanup:X}),x({id:l.DataFetch,label:"Loading configuration…"},z||!H&&!i),b(H),H)?o(T,{}):null===J?null:o(g,{value:J,children:o(A,{fallbackRender:r=>o(V,{...r}),children:o(c,{type:"configurator",children:o(A,{FallbackComponent:R,children:r(m,{children:[o(F,{}),o(B,{onLayoutMount:t})]})})})})})};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as
|
|
1
|
+
import{jsx as e}from"react/jsx-runtime";import{useEffect as t}from"react";import{assertExistence as o}from"@salsita-ai/common/utils";import{AnalyticsEventFactory as a}from"#package/domain";import{useAnalyticsService as r,useIsDev as i,useLogger as n,useOnMount as d,usePresetSelection as m}from"#package/react-sdk";import{PresetUi as l}from"../ui/index.js";import{PresetCreationErrorPage as s}from"./PresetCreationErrorPage.js";let p=e=>{let{id:t}=e,o=n(),{selectPreset:a}=m();return d(()=>{o.debug("Only single preset available, creating configuration automatically."),a(t)}),null};export const NewConfiguratorPage=()=>{let d=n(),g=r(),u=i(),{presetCategories:f,selectionError:c}=m();t(()=>{g.push(a.DataLoadedEvent({configurationId:"notYetLoaded",revisionId:"notYetLoaded",mode:"notYetLoaded"})),d.appendToGlobalContext({navigationState:"NewConfiguratorPage",revisionId:"notYetLoaded",mode:"notYetLoaded"})},[g,d]);let L=f.flatMap(e=>e.presets),v=1===L.length;return c&&(u||v)?e(s,{error:c}):v?e(p,{id:o(L[0]).id}):e(l,{})};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as t,jsxs as e,Fragment as i}from"react/jsx-runtime";import{Box as n,Button as r,Divider as o,Typography as a}from"@mui/material";import{Stack as d}from"@mui/system";import{useMemo as s}from"react";import{domainEntityTypeFromId as c}from"#package/domain";import{ControlAttachmentError as l,useAccessService as h,useBackendData as m,useCommittedState as p,useDomain as f,useFrontendData as b,useIsDev as u,useLoadedData as v,usePublishedData as y,useRenderedState as x,useSessionService as g}from"#package/react-sdk";import{JsonViewer as S,StackTraceViewer as k}from"#package/ui-sdk";import{useConfiguratorRouting as w}from"../../configurator-context/index.js";import{useResetOnEditorHotReload as C}from"./use-reset-on-editor-hot-reload.js";let W=()=>{let i=w();return e(d,{direction:"row",spacing:2,sx:{mb:2},children:[t(r,{variant:"outlined",size:"small",onClick:()=>{i.goToIndex()},children:"Reset state"}),t(r,{variant:"outlined",size:"small",onClick:()=>{window.location.reload()},children:"Reload Page"})]})},T=()=>{let{compositionProjections:r,componentReader:c,storeSystem:l}=f(),u=p(),k=x(),w=v(),C=h(),W=g(),T=y(),I=b(),z=m(),L=s(()=>{try{return r.getTree(u)}catch(t){return null}},[u,r]),D=s(()=>c.readManyComponents({},u),[u,c]),R=s(()=>{try{return r.getTree(k)}catch(t){return null}},[k,r]),A=s(()=>c.readManyComponents({},k),[k,c]),U=l.stateSlices.committed.value,E=l.stateSlices.potentiallyInvalid.value,j=E.validity.valid||"uncaught"===E.validity.severity?[]:E.validity.entityViolations,M=j.length>0,N="reset"!==U.kind;return e(n,{component:"div",children:[t(a,{variant:"h5",sx:{mb:2,mt:4,fontWeight:600},children:"Debug Data"}),e(n,{component:"div",sx:{p:2,mb:4,backgroundColor:"#e3f2fd",borderRadius:1,borderLeft:"4px solid #2196f3"},children:[t(a,{variant:"subtitle2",sx:{fontWeight:600,mb:1,color:"primary.main"},children:"\uD83D\uDD0D How to Debug This Issue"}),t(a,{variant:"body2",component:"div",children:e("ul",{style:{margin:"8px 0",paddingLeft:"20px"},children:[e("li",{children:[t("strong",{children:"Start with Last Emission:"})," Check if there are invariant violations - these often indicate the root cause"]}),e("li",{children:[t("strong",{children:"Review Last Updates:"})," See which state changes were applied right before the error occurred"]}),e("li",{children:[t("strong",{children:"Check Committed vs Rendered State:"})," Compare these to identify inconsistencies or timing issues"]}),e("li",{children:[t("strong",{children:"Inspect Composition Tree:"})," Verify that all entities are composed correctly"]}),e("li",{children:[t("strong",{children:"Review Data Sources:"})," Ensure all required data is loaded and in the expected format"]}),t("li",{children:'Use the "Reset state" button to navigate back to the index page without reloading'}),t("li",{children:'Use the "Reload Page" button to perform a full page refresh if state is corrupted'})]})})]}),(M||N)&&e(i,{children:[e(a,{variant:"h6",sx:{mb:1,mt:3,fontWeight:600,color:M?"error.main":"primary.main"},children:["Last Emission ",M&&"(Has Violations!)"]}),e(a,{variant:"body2",sx:{mb:2,color:"text.secondary",fontStyle:"italic"},children:["The most recent state update that was applied."," ",M?"Contains invariant violations that prevented the state from being committed.":"Shows what changed in the application state."]}),M&&t(i,{children:e(n,{component:"div",sx:{p:2,backgroundColor:"#ffebee",borderRadius:1,borderLeft:"4px solid #f44336",mb:2},children:[t(a,{variant:"subtitle2",sx:{color:"error.main",mb:1},children:"⚠️ Invariant Violations:"}),t(d,{component:"div",spacing:1,children:j.map((i,r)=>e(n,{component:"div",sx:{pl:2},children:[e(a,{variant:"body2",sx:{fontWeight:600},children:["Entity: ",String(i.entityId)]}),t(a,{variant:"caption",sx:{color:"text.secondary",display:"block",fontFamily:"monospace",fontSize:"0.75rem"},children:JSON.stringify(i.violation)})]},r))})]})}),N&&e(n,{component:"div",sx:{mb:3},children:[t(a,{variant:"body1",sx:{mb:2,fontWeight:600,fontSize:"1.1rem"},children:"Last Updates"}),t(S,{data:U.updates})]}),U.transformationLog&&e(n,{component:"div",sx:{mb:3},children:[t(a,{variant:"body1",sx:{mb:2,fontWeight:600,fontSize:"1.1rem"},children:"Transformation Log"}),t(S,{data:U.transformationLog})]}),t(a,{variant:"body1",sx:{mb:2,fontWeight:600,fontSize:"1.1rem"},children:"Validity"}),t(S,{data:E.validity}),t(o,{sx:{my:4}})]}),t(a,{variant:"h6",sx:{mb:1,mt:3,fontWeight:600,color:"primary.main"},children:"Committed Slice"}),t(a,{variant:"body2",sx:{mb:2,color:"text.secondary",fontStyle:"italic"},children:'The last valid state that was successfully committed. This is the "source of truth" for the application state and passes all invariant checks.'}),e(n,{component:"div",sx:{mb:3},children:[t(a,{variant:"body1",sx:{mb:2,fontWeight:600,fontSize:"1.1rem"},children:"State"}),t(S,{data:u})]}),e(n,{component:"div",sx:{mb:3},children:[t(a,{variant:"body1",sx:{mb:2,fontWeight:600,fontSize:"1.1rem"},children:"Active components"}),t(S,{data:D})]}),e(n,{component:"div",sx:{mb:3},children:[t(a,{variant:"body1",sx:{mb:2,fontWeight:600,fontSize:"1.1rem"},children:"Composition Tree"}),L&&t(S,{data:L})]}),t(o,{sx:{my:4}}),t(a,{variant:"h6",sx:{mb:1,mt:3,fontWeight:600,color:"primary.main"},children:"Rendered Slice"}),t(a,{variant:"body2",sx:{mb:2,color:"text.secondary",fontStyle:"italic"},children:"The state that's currently being used to render the UI. This may differ from committed state during animations or transitions."}),e(n,{component:"div",sx:{mb:3},children:[t(a,{variant:"body1",sx:{mb:2,fontWeight:600,fontSize:"1.1rem"},children:"State"}),t(S,{data:k})]}),e(n,{component:"div",sx:{mb:3},children:[t(a,{variant:"body1",sx:{mb:2,fontWeight:600,fontSize:"1.1rem"},children:"Active components"}),t(S,{data:A})]}),e(n,{component:"div",sx:{mb:3},children:[t(a,{variant:"body1",sx:{mb:2,fontWeight:600,fontSize:"1.1rem"},children:"Composition Tree"}),R&&t(S,{data:R})]}),t(o,{sx:{my:4}}),t(a,{variant:"h6",sx:{mb:1,mt:3,fontWeight:600,color:"primary.main"},children:"Published Data"}),t(a,{variant:"body2",sx:{mb:2,color:"text.secondary",fontStyle:"italic"},children:"Configuration data published to S3. This is the main source of truth for domain entities, components, and rules. Loaded from the backend at application startup."}),t(S,{data:T}),t(o,{sx:{my:4}}),t(a,{variant:"h6",sx:{mb:1,mt:3,fontWeight:600,color:"primary.main"},children:"Frontend Data"}),t(a,{variant:"body2",sx:{mb:2,color:"text.secondary",fontStyle:"italic"},children:"Data collected and processed on the frontend. Contains UI state, user selections, and client-side computed values."}),t(S,{data:I}),t(o,{sx:{my:4}}),t(a,{variant:"h6",sx:{mb:1,mt:3,fontWeight:600,color:"primary.main"},children:"Backend Data"}),t(a,{variant:"body2",sx:{mb:2,color:"text.secondary",fontStyle:"italic"},children:"Optional data fetched from backend APIs. May include pricing, availability, or other dynamic server-side data."}),t(S,{data:z}),t(o,{sx:{my:4}}),t(a,{variant:"h6",sx:{mb:1,mt:3,fontWeight:600,color:"primary.main"},children:"Session Service"}),t(a,{variant:"body2",sx:{mb:2,color:"text.secondary",fontStyle:"italic"},children:"Authentication and session information. Contains user identity, permissions, and session tokens."}),t(S,{data:W}),t(o,{sx:{my:4}}),t(a,{variant:"h6",sx:{mb:1,mt:3,fontWeight:600,color:"primary.main"},children:"Loaded Data"}),t(a,{variant:"body2",sx:{mb:2,color:"text.secondary",fontStyle:"italic"},children:"The initial data of the configuration used to start the configurator. This is the starting state and context provided when the configurator was initialized."}),t(S,{data:w}),t(o,{sx:{my:4}}),t(a,{variant:"h6",sx:{mb:1,mt:3,fontWeight:600,color:"primary.main"},children:"Access Data"}),t(a,{variant:"body2",sx:{mb:2,color:"text.secondary",fontStyle:"italic"},children:"Access control and permissions service. Determines what actions the current user can perform and what data they can view."}),t(S,{data:C}),t(o,{sx:{my:4}}),t(a,{variant:"h6",sx:{mb:1,mt:3,fontWeight:600,color:"primary.main"},children:"Configurator Props"}),t(a,{variant:"body2",sx:{mb:2,color:"text.secondary",fontStyle:"italic"},children:"Configurator-specific properties and settings. Contains routing information, UI configuration, and configurator context settings."})]})};export const DevContextFallback=r=>{let{error:s,resetErrorBoundary:h}=r,m=u();if(C(h),!m)throw s;if(s instanceof l)return t(n,{component:"div",sx:{height:"100vh",overflow:"auto"},children:e(d,{sx:{p:5,boxSizing:"border-box"},spacing:3,children:[t(a,{variant:"h4",sx:{mb:2,mt:2},color:"error",children:"Can not render a control input!"}),e(n,{component:"div",sx:{p:2,mb:2,backgroundColor:"#fff3cd",borderRadius:1,borderLeft:"4px solid #ffc107"},children:[t(a,{variant:"subtitle2",sx:{fontWeight:600,mb:1},children:"⚠️ When does this error occur?"}),e(a,{variant:"body2",children:["This error occurred ",t("strong",{children:"while the configurator was running"}),", during the rendering of UI controls. Most likely causes:"]}),e(a,{variant:"body2",component:"ul",sx:{mt:1,mb:0},children:[t("li",{children:"A control input component is referenced but not defined in the domain"}),t("li",{children:"The instanceName has a typo or doesn't match the actual component name"}),t("li",{children:"The entity type doesn't support the requested control input"})]})]}),t(W,{}),t(o,{}),t(a,{variant:"body1",children:s.message}),t(o,{}),e(d,{spacing:2,direction:"row",children:[e(d,{children:[t(a,{variant:"subtitle2",children:"Instance Name: "}),t(a,{variant:"subtitle2",children:"Entity Id: "})]}),e(d,{children:[t(a,{variant:"body1",children:s.instanceName}),t(a,{variant:"body1",children:s.entityId})]})]}),t(o,{}),s.stack&&e(i,{children:[t(k,{stack:s.stack,error:s}),t(o,{})]}),e(d,{children:[t(a,{variant:"subtitle2",children:"To debug: "}),e("ul",{children:[t("li",{children:t(a,{variant:"body1",children:"Check that input component exists"})}),t("li",{children:e(a,{variant:"body1",children:["Check it exists on an entity of type ",t("strong",{children:c(s.entityId)})]})}),t("li",{children:e(a,{variant:"body1",children:["Check that the ",t("strong",{children:"instanceName"})," is correct and there is no typo"]})})]})]}),t(o,{}),t(T,{})]})});let p=s instanceof Error?s.stack:null;return t(n,{component:"div",sx:{height:"100vh",overflow:"auto"},children:e(d,{sx:{p:5,boxSizing:"border-box"},spacing:3,children:[t(a,{variant:"h4",sx:{mb:2,mt:2},color:"error",children:"There was an unknown error in the configurator context!"}),e(n,{component:"div",sx:{p:2,mb:2,backgroundColor:"#fff3cd",borderRadius:1,borderLeft:"4px solid #ffc107"},children:[t(a,{variant:"subtitle2",sx:{fontWeight:600,mb:1},children:"⚠️ When does this error occur?"}),e(a,{variant:"body2",children:["This error occurred ",t("strong",{children:"while the configurator was running"}),", after data was successfully loaded. Most likely causes:"]}),e(a,{variant:"body2",component:"ul",sx:{mt:1,mb:0},children:[t("li",{children:"A state update caused an invariant violation"}),t("li",{children:"Component rendering failed due to invalid state"}),t("li",{children:"Business rules or transformations threw an unexpected error"}),t("li",{children:"Invalid data was introduced through user interactions or computed values"})]})]}),t(a,{variant:"body2",sx:{mb:2},children:"This should not happen, please report it so we can improve the platform!"}),t(W,{}),t(a,{variant:"subtitle2",children:"Error: "}),t(a,{variant:"body2",children:`${s}`}),p&&e(i,{children:[t(o,{}),t(k,{stack:p,error:s})]}),t(o,{}),t(T,{})]})})};
|
|
1
|
+
import{jsx as t,jsxs as e,Fragment as i}from"react/jsx-runtime";import{Box as n,Button as r,Divider as o,Typography as a}from"@mui/material";import{Stack as d}from"@mui/system";import{useMemo as s}from"react";import{domainEntityTypeFromId as c}from"#package/domain";import{ControlAttachmentError as l,useAccessService as h,useBackendData as m,useCommittedState as p,useConfiguratorRouting as f,useDomain as b,useFrontendData as u,useIsDev as v,useLoadedData as y,usePublishedData as x,useRenderedState as g,useSessionService as S}from"#package/react-sdk";import{JsonViewer as k,StackTraceViewer as w}from"#package/ui-sdk";import{useResetOnEditorHotReload as C}from"./use-reset-on-editor-hot-reload.js";let W=()=>{let i=f();return e(d,{direction:"row",spacing:2,sx:{mb:2},children:[t(r,{variant:"outlined",size:"small",onClick:()=>{i.goToIndex()},children:"Reset state"}),t(r,{variant:"outlined",size:"small",onClick:()=>{window.location.reload()},children:"Reload Page"})]})},T=()=>{let{compositionProjections:r,componentReader:c,storeSystem:l}=b(),f=p(),v=g(),w=y(),C=h(),W=S(),T=x(),I=u(),z=m(),L=s(()=>{try{return r.getTree(f)}catch(t){return null}},[f,r]),D=s(()=>c.readManyComponents({},f),[f,c]),R=s(()=>{try{return r.getTree(v)}catch(t){return null}},[v,r]),A=s(()=>c.readManyComponents({},v),[v,c]),U=l.stateSlices.committed.value,E=l.stateSlices.potentiallyInvalid.value,M=E.validity.valid||"uncaught"===E.validity.severity?[]:E.validity.entityViolations,N=M.length>0,P="reset"!==U.kind;return e(n,{component:"div",children:[t(a,{variant:"h5",sx:{mb:2,mt:4,fontWeight:600},children:"Debug Data"}),e(n,{component:"div",sx:{p:2,mb:4,backgroundColor:"#e3f2fd",borderRadius:1,borderLeft:"4px solid #2196f3"},children:[t(a,{variant:"subtitle2",sx:{fontWeight:600,mb:1,color:"primary.main"},children:"\uD83D\uDD0D How to Debug This Issue"}),t(a,{variant:"body2",component:"div",children:e("ul",{style:{margin:"8px 0",paddingLeft:"20px"},children:[e("li",{children:[t("strong",{children:"Start with Last Emission:"})," Check if there are invariant violations - these often indicate the root cause"]}),e("li",{children:[t("strong",{children:"Review Last Updates:"})," See which state changes were applied right before the error occurred"]}),e("li",{children:[t("strong",{children:"Check Committed vs Rendered State:"})," Compare these to identify inconsistencies or timing issues"]}),e("li",{children:[t("strong",{children:"Inspect Composition Tree:"})," Verify that all entities are composed correctly"]}),e("li",{children:[t("strong",{children:"Review Data Sources:"})," Ensure all required data is loaded and in the expected format"]}),t("li",{children:'Use the "Reset state" button to navigate back to the index page without reloading'}),t("li",{children:'Use the "Reload Page" button to perform a full page refresh if state is corrupted'})]})})]}),(N||P)&&e(i,{children:[e(a,{variant:"h6",sx:{mb:1,mt:3,fontWeight:600,color:N?"error.main":"primary.main"},children:["Last Emission ",N&&"(Has Violations!)"]}),e(a,{variant:"body2",sx:{mb:2,color:"text.secondary",fontStyle:"italic"},children:["The most recent state update that was applied."," ",N?"Contains invariant violations that prevented the state from being committed.":"Shows what changed in the application state."]}),N&&t(i,{children:e(n,{component:"div",sx:{p:2,backgroundColor:"#ffebee",borderRadius:1,borderLeft:"4px solid #f44336",mb:2},children:[t(a,{variant:"subtitle2",sx:{color:"error.main",mb:1},children:"⚠️ Invariant Violations:"}),t(d,{component:"div",spacing:1,children:M.map((i,r)=>e(n,{component:"div",sx:{pl:2},children:[e(a,{variant:"body2",sx:{fontWeight:600},children:["Entity: ",String(i.entityId)]}),t(a,{variant:"caption",sx:{color:"text.secondary",display:"block",fontFamily:"monospace",fontSize:"0.75rem"},children:JSON.stringify(i.violation)})]},r))})]})}),P&&e(n,{component:"div",sx:{mb:3},children:[t(a,{variant:"body1",sx:{mb:2,fontWeight:600,fontSize:"1.1rem"},children:"Last Updates"}),t(k,{data:U.updates})]}),U.transformationLog&&e(n,{component:"div",sx:{mb:3},children:[t(a,{variant:"body1",sx:{mb:2,fontWeight:600,fontSize:"1.1rem"},children:"Transformation Log"}),t(k,{data:U.transformationLog})]}),t(a,{variant:"body1",sx:{mb:2,fontWeight:600,fontSize:"1.1rem"},children:"Validity"}),t(k,{data:E.validity}),t(o,{sx:{my:4}})]}),t(a,{variant:"h6",sx:{mb:1,mt:3,fontWeight:600,color:"primary.main"},children:"Committed Slice"}),t(a,{variant:"body2",sx:{mb:2,color:"text.secondary",fontStyle:"italic"},children:'The last valid state that was successfully committed. This is the "source of truth" for the application state and passes all invariant checks.'}),e(n,{component:"div",sx:{mb:3},children:[t(a,{variant:"body1",sx:{mb:2,fontWeight:600,fontSize:"1.1rem"},children:"State"}),t(k,{data:f})]}),e(n,{component:"div",sx:{mb:3},children:[t(a,{variant:"body1",sx:{mb:2,fontWeight:600,fontSize:"1.1rem"},children:"Active components"}),t(k,{data:D})]}),e(n,{component:"div",sx:{mb:3},children:[t(a,{variant:"body1",sx:{mb:2,fontWeight:600,fontSize:"1.1rem"},children:"Composition Tree"}),L&&t(k,{data:L})]}),t(o,{sx:{my:4}}),t(a,{variant:"h6",sx:{mb:1,mt:3,fontWeight:600,color:"primary.main"},children:"Rendered Slice"}),t(a,{variant:"body2",sx:{mb:2,color:"text.secondary",fontStyle:"italic"},children:"The state that's currently being used to render the UI. This may differ from committed state during animations or transitions."}),e(n,{component:"div",sx:{mb:3},children:[t(a,{variant:"body1",sx:{mb:2,fontWeight:600,fontSize:"1.1rem"},children:"State"}),t(k,{data:v})]}),e(n,{component:"div",sx:{mb:3},children:[t(a,{variant:"body1",sx:{mb:2,fontWeight:600,fontSize:"1.1rem"},children:"Active components"}),t(k,{data:A})]}),e(n,{component:"div",sx:{mb:3},children:[t(a,{variant:"body1",sx:{mb:2,fontWeight:600,fontSize:"1.1rem"},children:"Composition Tree"}),R&&t(k,{data:R})]}),t(o,{sx:{my:4}}),t(a,{variant:"h6",sx:{mb:1,mt:3,fontWeight:600,color:"primary.main"},children:"Published Data"}),t(a,{variant:"body2",sx:{mb:2,color:"text.secondary",fontStyle:"italic"},children:"Configuration data published to S3. This is the main source of truth for domain entities, components, and rules. Loaded from the backend at application startup."}),t(k,{data:T}),t(o,{sx:{my:4}}),t(a,{variant:"h6",sx:{mb:1,mt:3,fontWeight:600,color:"primary.main"},children:"Frontend Data"}),t(a,{variant:"body2",sx:{mb:2,color:"text.secondary",fontStyle:"italic"},children:"Data collected and processed on the frontend. Contains UI state, user selections, and client-side computed values."}),t(k,{data:I}),t(o,{sx:{my:4}}),t(a,{variant:"h6",sx:{mb:1,mt:3,fontWeight:600,color:"primary.main"},children:"Backend Data"}),t(a,{variant:"body2",sx:{mb:2,color:"text.secondary",fontStyle:"italic"},children:"Optional data fetched from backend APIs. May include pricing, availability, or other dynamic server-side data."}),t(k,{data:z}),t(o,{sx:{my:4}}),t(a,{variant:"h6",sx:{mb:1,mt:3,fontWeight:600,color:"primary.main"},children:"Session Service"}),t(a,{variant:"body2",sx:{mb:2,color:"text.secondary",fontStyle:"italic"},children:"Authentication and session information. Contains user identity, permissions, and session tokens."}),t(k,{data:W}),t(o,{sx:{my:4}}),t(a,{variant:"h6",sx:{mb:1,mt:3,fontWeight:600,color:"primary.main"},children:"Loaded Data"}),t(a,{variant:"body2",sx:{mb:2,color:"text.secondary",fontStyle:"italic"},children:"The initial data of the configuration used to start the configurator. This is the starting state and context provided when the configurator was initialized."}),t(k,{data:w}),t(o,{sx:{my:4}}),t(a,{variant:"h6",sx:{mb:1,mt:3,fontWeight:600,color:"primary.main"},children:"Access Data"}),t(a,{variant:"body2",sx:{mb:2,color:"text.secondary",fontStyle:"italic"},children:"Access control and permissions service. Determines what actions the current user can perform and what data they can view."}),t(k,{data:C}),t(o,{sx:{my:4}}),t(a,{variant:"h6",sx:{mb:1,mt:3,fontWeight:600,color:"primary.main"},children:"Configurator Props"}),t(a,{variant:"body2",sx:{mb:2,color:"text.secondary",fontStyle:"italic"},children:"Configurator-specific properties and settings. Contains routing information, UI configuration, and configurator context settings."})]})};export const DevContextFallback=r=>{let{error:s,resetErrorBoundary:h}=r,m=v();if(C(h),!m)throw s;if(s instanceof l)return t(n,{component:"div",sx:{height:"100vh",overflow:"auto"},children:e(d,{sx:{p:5,boxSizing:"border-box"},spacing:3,children:[t(a,{variant:"h4",sx:{mb:2,mt:2},color:"error",children:"Can not render a control input!"}),e(n,{component:"div",sx:{p:2,mb:2,backgroundColor:"#fff3cd",borderRadius:1,borderLeft:"4px solid #ffc107"},children:[t(a,{variant:"subtitle2",sx:{fontWeight:600,mb:1},children:"⚠️ When does this error occur?"}),e(a,{variant:"body2",children:["This error occurred ",t("strong",{children:"while the configurator was running"}),", during the rendering of UI controls. Most likely causes:"]}),e(a,{variant:"body2",component:"ul",sx:{mt:1,mb:0},children:[t("li",{children:"A control input component is referenced but not defined in the domain"}),t("li",{children:"The instanceName has a typo or doesn't match the actual component name"}),t("li",{children:"The entity type doesn't support the requested control input"})]})]}),t(W,{}),t(o,{}),t(a,{variant:"body1",children:s.message}),t(o,{}),e(d,{spacing:2,direction:"row",children:[e(d,{children:[t(a,{variant:"subtitle2",children:"Instance Name: "}),t(a,{variant:"subtitle2",children:"Entity Id: "})]}),e(d,{children:[t(a,{variant:"body1",children:s.instanceName}),t(a,{variant:"body1",children:s.entityId})]})]}),t(o,{}),s.stack&&e(i,{children:[t(w,{stack:s.stack,error:s}),t(o,{})]}),e(d,{children:[t(a,{variant:"subtitle2",children:"To debug: "}),e("ul",{children:[t("li",{children:t(a,{variant:"body1",children:"Check that input component exists"})}),t("li",{children:e(a,{variant:"body1",children:["Check it exists on an entity of type ",t("strong",{children:c(s.entityId)})]})}),t("li",{children:e(a,{variant:"body1",children:["Check that the ",t("strong",{children:"instanceName"})," is correct and there is no typo"]})})]})]}),t(o,{}),t(T,{})]})});let p=s instanceof Error?s.stack:null;return t(n,{component:"div",sx:{height:"100vh",overflow:"auto"},children:e(d,{sx:{p:5,boxSizing:"border-box"},spacing:3,children:[t(a,{variant:"h4",sx:{mb:2,mt:2},color:"error",children:"There was an unknown error in the configurator context!"}),e(n,{component:"div",sx:{p:2,mb:2,backgroundColor:"#fff3cd",borderRadius:1,borderLeft:"4px solid #ffc107"},children:[t(a,{variant:"subtitle2",sx:{fontWeight:600,mb:1},children:"⚠️ When does this error occur?"}),e(a,{variant:"body2",children:["This error occurred ",t("strong",{children:"while the configurator was running"}),", after data was successfully loaded. Most likely causes:"]}),e(a,{variant:"body2",component:"ul",sx:{mt:1,mb:0},children:[t("li",{children:"A state update caused an invariant violation"}),t("li",{children:"Component rendering failed due to invalid state"}),t("li",{children:"Business rules or transformations threw an unexpected error"}),t("li",{children:"Invalid data was introduced through user interactions or computed values"})]})]}),t(a,{variant:"body2",sx:{mb:2},children:"This should not happen, please report it so we can improve the platform!"}),t(W,{}),t(a,{variant:"subtitle2",children:"Error: "}),t(a,{variant:"body2",children:`${s}`}),p&&e(i,{children:[t(o,{}),t(w,{stack:p,error:s})]}),t(o,{}),t(T,{})]})})};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as t,jsxs as e,Fragment as r}from"react/jsx-runtime";import{Box as i,Button as n,Divider as o,Stack as a,Typography as s}from"@mui/material";import{useEffect as c,useRef as d}from"react";import{useAccessService as l,useBackendData as h,
|
|
1
|
+
import{jsx as t,jsxs as e,Fragment as r}from"react/jsx-runtime";import{Box as i,Button as n,Divider as o,Stack as a,Typography as s}from"@mui/material";import{useEffect as c,useRef as d}from"react";import{useAccessService as l,useBackendData as h,useConfiguratorRouting as m,useFrontendData as f,useIsDev as u,useLoadedData as p,useOverridesHash as b,usePublishedData as x,useSessionService as v}from"#package/react-sdk";import{JsonViewer as g,StackTraceViewer as y}from"#package/ui-sdk";import{useResetOnEditorHotReload as k}from"./use-reset-on-editor-hot-reload.js";let w=()=>{let r=m();return e(a,{direction:"row",spacing:2,sx:{mb:2},children:[t(n,{variant:"outlined",size:"small",onClick:()=>{r.goToIndex()},children:"Reset state"}),t(n,{variant:"outlined",size:"small",onClick:()=>{window.location.reload()},children:"Reload Page"})]})},S=()=>{let n=p(),a=l(),c=v(),d=x(),m=f(),u=h();return e(r,{children:[t(s,{variant:"h5",sx:{mb:2,mt:4,fontWeight:600},children:"Debug Data"}),e(i,{component:"div",sx:{p:2,mb:4,backgroundColor:"#e3f2fd",borderRadius:1,borderLeft:"4px solid #2196f3"},children:[t(s,{variant:"subtitle2",sx:{fontWeight:600,mb:1,color:"primary.main"},children:"\uD83D\uDD0D How to Debug This Issue"}),t(s,{variant:"body2",component:"div",children:e("ul",{style:{margin:"8px 0",paddingLeft:"20px"},children:[t("li",{children:"Check the error message and stack trace above for the exact location of the issue"}),t("li",{children:"Review the data sections below to understand the current application state"}),t("li",{children:"Look for missing or unexpected values in Published, Frontend, or Backend Data"}),t("li",{children:"Verify that all required data sources are loaded correctly"}),t("li",{children:"Check Session Service for authentication issues"}),t("li",{children:'Use the "Reset state" button to return to the index page'}),t("li",{children:'Use the "Reload Page" button to start fresh if the issue persists'})]})})]}),t(s,{variant:"h6",sx:{mb:1,mt:3,fontWeight:600,color:"primary.main"},children:"Published Data"}),t(s,{variant:"body2",sx:{mb:2,color:"text.secondary",fontStyle:"italic"},children:"Configuration data published to S3. This is the main source of truth for domain entities, components, and rules. Loaded from the backend at application startup."}),t(g,{data:d}),t(o,{sx:{my:4}}),t(s,{variant:"h6",sx:{mb:1,mt:3,fontWeight:600,color:"primary.main"},children:"Frontend Data"}),t(s,{variant:"body2",sx:{mb:2,color:"text.secondary",fontStyle:"italic"},children:"Data collected and processed on the frontend. Contains UI state, user selections, and client-side computed values."}),t(g,{data:m}),t(o,{sx:{my:4}}),t(s,{variant:"h6",sx:{mb:1,mt:3,fontWeight:600,color:"primary.main"},children:"Backend Data"}),t(s,{variant:"body2",sx:{mb:2,color:"text.secondary",fontStyle:"italic"},children:"Optional data fetched from backend APIs. May include pricing, availability, or other dynamic server-side data."}),t(g,{data:u}),t(o,{sx:{my:4}}),t(s,{variant:"h6",sx:{mb:1,mt:3,fontWeight:600,color:"primary.main"},children:"Session Service"}),t(s,{variant:"body2",sx:{mb:2,color:"text.secondary",fontStyle:"italic"},children:"Authentication and session information. Contains user identity, permissions, and session tokens."}),t(g,{data:c}),t(o,{sx:{my:4}}),t(s,{variant:"h6",sx:{mb:1,mt:3,fontWeight:600,color:"primary.main"},children:"Loaded Data"}),t(s,{variant:"body2",sx:{mb:2,color:"text.secondary",fontStyle:"italic"},children:"The initial data of the configuration used to start the configurator. This is the starting state and context provided when the configurator was initialized."}),t(g,{data:n}),t(o,{sx:{my:4}}),t(s,{variant:"h6",sx:{mb:1,mt:3,fontWeight:600,color:"primary.main"},children:"Access Data"}),t(s,{variant:"body2",sx:{mb:2,color:"text.secondary",fontStyle:"italic"},children:"Access control and permissions service. Determines what actions the current user can perform and what data they can view."}),t(g,{data:a}),t(o,{sx:{my:4}}),t(s,{variant:"h6",sx:{mb:1,mt:3,fontWeight:600,color:"primary.main"},children:"Configurator Props"}),t(s,{variant:"body2",sx:{mb:2,color:"text.secondary",fontStyle:"italic"},children:"Configurator-specific properties and settings. Contains routing information, UI configuration, and configurator context settings."})]})};export const DevLoadingFallback=n=>{let{error:l,resetErrorBoundary:h}=n,m=u(),f=b();k(h);let p=d(null);if(c(()=>{if(h){if(null===p.current){p.current=f;return}f!==p.current&&h()}},[f,h]),!m)throw l;if(l instanceof Error)return t(i,{component:"div",sx:{height:"100vh",overflow:"auto"},children:e(a,{component:"div",spacing:3,sx:{p:5,boxSizing:"border-box"},alignItems:"flex-start",children:[t(s,{variant:"h6",sx:{mb:2,mt:2},color:"error",children:"Loading of the context failed for an unknown reason!"}),e(i,{component:"div",sx:{p:2,mb:2,backgroundColor:"#fff3cd",borderRadius:1,borderLeft:"4px solid #ffc107"},children:[t(s,{variant:"subtitle2",sx:{fontWeight:600,mb:1},children:"⚠️ When does this error occur?"}),e(s,{variant:"body2",children:["This error happened ",t("strong",{children:"during the initial loading of data"})," before the configurator could start. Most likely causes:"]}),e(s,{variant:"body2",component:"ul",sx:{mt:1,mb:0},children:[t("li",{children:"Migration scripts failed to transform the data correctly"}),t("li",{children:"State initialization encountered invalid or corrupted data"})]})]}),t(s,{variant:"body2",sx:{mb:2},children:"This should not happen, please report it so we can improve the platform!"}),t(w,{}),t(s,{variant:"subtitle2",children:"Error: "}),t(s,{variant:"body2",children:l.message}),l.stack&&e(r,{children:[t(o,{}),t(y,{stack:l.stack,error:l})]}),t(o,{}),t(S,{})]})});let x=l instanceof Error?l.stack:null;return t(i,{component:"div",sx:{height:"100vh",overflow:"auto"},children:e(a,{component:"div",spacing:3,sx:{p:5,boxSizing:"border-box"},children:[t(s,{variant:"h6",sx:{mb:2,mt:2},color:"error",children:"Loading of the context failed for an unknown reason!"}),t(s,{variant:"body2",children:"This should not happen, please report it so we can improve the platform!"}),t(w,{}),t(s,{variant:"subtitle2",children:"Error: "}),t(s,{variant:"body2",children:`${l}`}),x&&e(r,{children:[t(o,{}),t(y,{stack:x,error:l})]}),t(o,{}),t(S,{})]})})};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as e,jsxs as t,Fragment as n}from"react/jsx-runtime";import{ButtonBase as
|
|
1
|
+
import{jsx as e,jsxs as t,Fragment as n}from"react/jsx-runtime";import{ButtonBase as i,ClickAwayListener as o,Tooltip as s,styled as a}from"@mui/material";import{memo as r,useCallback as l,useMemo as d,useRef as c,useState as m}from"react";import{match as p}from"ts-pattern";import{useLocalizable as h}from"#package/react-sdk";import{PhxIcon as u}from"#package/ui-sdk";import{assistantReferenceStyles as f}from"./reference-link/index.js";import{ScreenshotThumbnails as g,readToolScreenshots as k}from"./screenshots/index.js";import{AssistantPanelName as x}from"./theme.js";let y={id:"sdk.assistant.tool.updateDesign.label",message:"Update design"},b={id:"sdk.assistant.tool.readDesign.label",message:"Read design"},w={id:"sdk.assistant.tool.mistake.hint",message:"The assistant made a mistake."},v={id:"sdk.assistant.tool.cancelled.hint",message:"Stopped before it finished."},C={id:"sdk.assistant.tool.noResult.hint",message:"The result of this step was lost. It may or may not have been done."},I={id:"sdk.assistant.tool.toolBudget.hint",message:"Not done: the assistant reached its limit of steps for one message."},S={id:"sdk.assistant.tool.undo.label",message:"Undo"},D={id:"sdk.assistant.tool.screenshots.label",message:"{count, plural, one {# screenshot} other {# screenshots}}"},j=a("div",{name:x,slot:"chips"})(({theme:{palette:e,spacing:t,typography:n}})=>({...n.caption,alignItems:"start",color:e.text.secondary,display:"grid",gap:t(.75),gridTemplateColumns:"min-content minmax(0, 1fr)"})),z=a("span",{name:x,slot:"activity"})(({theme:{typography:e}})=>({blockSize:`calc(${e.caption.lineHeight} * 1em)`,display:"grid",placeItems:"center"})),A=a(u,{name:x,slot:"activityIcon"})({fontSize:14,'[data-chips="active"] &':{animation:"phx-assistant-turn 2.4s linear infinite","@media (prefers-reduced-motion: reduce)":{animation:"none"}},"@keyframes phx-assistant-turn":{to:{rotate:"360deg"}}}),T=a("span",{name:x,slot:"chip"})(({theme:{palette:e,spacing:t}})=>({cursor:"default",display:"inline-flex",maxInlineSize:"100%",verticalAlign:"top",whiteSpace:"nowrap","&:not(:last-of-type)::after":{color:e.text.secondary,content:'"\xb7"',flexShrink:0,marginInline:t(.75)}})),E=a("span",{name:x,slot:"screenshotsLink"})(f),L=a(i,{name:x,slot:"undoButton"})(({theme:{palette:e,shape:t,spacing:n}})=>({alignItems:"center",animation:"phx-assistant-undo-in 150ms ease-out",borderRadius:t.borderRadius,color:e.primary.main,display:"inline-flex",font:"inherit",gap:n(.5),marginInlineStart:n(1),verticalAlign:"top","&:hover":{textDecoration:"underline"},"@media (prefers-reduced-motion: reduce)":{animation:"none"},"@keyframes phx-assistant-undo-in":{from:{opacity:0}}})),R=a("span",{name:x,slot:"chipLabel"})(({theme:{palette:e}})=>({minInlineSize:0,overflow:"hidden",textOverflow:"ellipsis",'[data-chip="failed"] > &':{textDecoration:"line-through",textDecorationColor:e.error.main}})),P=a("span",{name:x,slot:"violation"})({display:"block"}),B=a("span",{name:x,slot:"fullLabel"})({display:"block"}),O=r(({tool:i})=>{let{chip:o,input:a,result:r}=i,d=h(y),u=h(b),f=h(w),g=h(v),k=h(C),x=h(I),S=c(null),[D,j]=m(!1),z=p(o.label).with({kind:"text"},({text:e})=>e).with({kind:"updateDesign"},()=>d).with({kind:"readDesign"},()=>u).exhaustive(),A=l(()=>{console.info(`Assistant tool call "${z}"`,{input:a,result:r})},[a,z,r]),E=l(()=>{let e=S.current;j(null!=e&&e.scrollWidth>e.clientWidth)},[]),L=p(o).with({errorCode:"cancelled"},()=>g).with({errorCode:"no_result"},()=>k).with({errorCode:"tool_budget"},()=>x).when(({violations:e})=>e.length>0,({violations:t})=>t.map((t,n)=>e(P,{children:t},n))).with({state:"failed"},()=>f).otherwise(()=>""),O=D?t(n,{children:[e(B,{children:z}),L]}):L;return e(s,{title:O,placement:"top-start",children:e(T,{onClick:A,onPointerEnter:E,"data-chip":o.state,children:e(R,{ref:S,children:z})})})}),U=r(({screenshots:t})=>{let n=h({...D,values:{count:t.length}}),[i,a]=m(!1),r=l(()=>a(!0),[]),d=l(()=>a(!1),[]),p=c(null),u=l(e=>{p.current=e},[]),f=l(()=>{p.current?.update()},[]),k=l(e=>{("Enter"===e.key||" "===e.key)&&(e.preventDefault(),a(!0))},[]);return e(T,{"data-chip":"screenshots",children:e(o,{onClickAway:d,mouseEvent:!!i&&"onClick",touchEvent:!!i&&"onTouchEnd",children:e(s,{open:i,onOpen:r,onClose:d,title:e(g,{screenshots:t,onImageLoad:f}),placement:"top-start",describeChild:!0,disableTouchListener:!0,PopperProps:{popperRef:u},slotProps:{tooltip:{sx:{background:"none",maxInlineSize:"none",padding:0}}},children:e(E,{role:"button",tabIndex:0,"aria-expanded":i,onClick:r,onKeyDown:k,children:n})})})})}),W=({tool:i})=>{let o=d(()=>k(i.result),[i.result]);return t(n,{children:[e(O,{tool:i}),o.length>0&&e(U,{screenshots:o})]})};export const AssistantToolChips=r(({tools:n,isActive:i,canUndo:o,onUndo:s})=>{let a=h(S),r=l(()=>{s(new Set(n.map(({id:e})=>e)))},[s,n]);return t(j,{"data-chips":i?"active":"done","aria-busy":i,children:[e(z,{children:e(A,{name:"Gear"})}),t("div",{children:[n.map(t=>e(W,{tool:t},t.id)),o&&t(L,{onClick:r,children:[e(u,{name:"ArrowCounterClockwise",fontSize:"inherit"}),a]})]})]})});
|
|
@@ -3,5 +3,11 @@
|
|
|
3
3
|
* send control is a Stop control and the input stays editable, so the next message can be written.
|
|
4
4
|
* A thread this session may not continue takes a message like any other: it is resumed first, with
|
|
5
5
|
* the input read-only meanwhile, and the message stays in the input when that fails.
|
|
6
|
+
*
|
|
7
|
+
* Images are attached with the attach control, by pasting or by dropping files onto the composer,
|
|
8
|
+
* up to {@link MAX_MESSAGE_IMAGES} per message. Each is prepared at once (see `prepareImage`) and
|
|
9
|
+
* shown as a thumbnail that can be removed; one that cannot be prepared, or one too many, is not
|
|
10
|
+
* added, and a notice says why. The message keeps its text and images until it is sent, also when
|
|
11
|
+
* the upload of its images fails, and gets it back when the chat gives it back (see `onUnsent`).
|
|
6
12
|
*/
|
|
7
13
|
export declare const AssistantComposer: () => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
import{jsx as e,jsxs as
|
|
1
|
+
import{jsx as e,jsxs as t}from"react/jsx-runtime";import{Trans as a}from"@lingui/react";import{IconButton as r,InputBase as i,Tooltip as n,styled as o}from"@mui/material";import{useCallback as l,useEffect as s,useRef as d,useState as c}from"react";import{useEagerObservableSelector as m,useLocalizable as p}from"#package/react-sdk";import{PhxIcon as u,useResponsive as g}from"#package/ui-sdk";import{useConfigurator as h}from"../../application-runtime/index.js";import{prepareImage as b}from"./attachments/index.js";import{AssistantPanelName as f}from"./theme.js";let k={id:"sdk.assistant.composer.placeholder",message:"Ask or tell me what to change…"},v={id:"sdk.assistant.composer.send.label",message:"Send"},y={id:"sdk.assistant.composer.stop.label",message:"Stop"},x={id:"sdk.assistant.composer.attach.label",message:"Attach images"},R={id:"sdk.assistant.composer.attachment.remove",message:"Remove image"},S={id:"sdk.assistant.composer.attachment.unreadable",message:"Unsupported image format."},w={id:"sdk.assistant.composer.attachment.limit",message:"You can attach up to {max} images."},z=o("form",{name:f,slot:"composer"})(({theme:{palette:e,spacing:t}})=>({borderBlockStart:`1px solid ${e.divider}`,display:"grid",gap:t(.75),paddingBlock:t(1.25),paddingInline:`var(--phx-sidebar-padding, ${t(2)})`})),U=o("div",{name:f,slot:"inputFrame"})(({theme:{palette:e,spacing:t}})=>({alignItems:"end",border:`1px solid ${e.divider}`,borderRadius:12,columnGap:t(1),display:"grid",gridTemplateColumns:"auto minmax(0, 1fr) auto",padding:t(.5),'&:focus-within, &[data-dragging="true"]':{borderColor:e.primary.main}})),C=o("div",{name:f,slot:"attachments"})(({theme:{spacing:e}})=>({display:"flex",flexWrap:"wrap",gap:e(1),gridColumn:"1 / -1",paddingBlockStart:e(.75)})),j=o(r,{name:f,slot:"attachButton"})(({theme:{palette:e}})=>({background:"transparent",border:"none",borderRadius:8,boxShadow:"none",color:e.text.secondary,"&:hover":{background:e.action.hover,color:e.text.primary},"&.Mui-disabled":{background:"transparent",color:e.action.disabled}})),B=o("div",{name:f,slot:"attachment"})(({theme:{palette:e,shape:t}})=>({blockSize:56,border:`1px solid ${e.divider}`,borderRadius:t.borderRadius,inlineSize:56,overflow:"hidden",position:"relative"})),D=o("img")({blockSize:"100%",display:"block",inlineSize:"100%",objectFit:"cover"}),L=o(r,{name:f,slot:"removeAttachment"})(({theme:{palette:e}})=>({background:e.background.paper,insetBlockStart:2,insetInlineEnd:2,padding:2,position:"absolute","&:hover":{background:e.background.paper}})),T=o("div")({alignSelf:"stretch",display:"grid",minInlineSize:0}),$=o(i,{name:f,slot:"input"})(({theme:{spacing:e,typography:t}})=>({...t.body2,flex:1,paddingBlock:e(.75)})),I=o(r,{name:f,slot:"sendButton"})(({theme:{palette:e}})=>({background:e.primary.main,borderRadius:8,color:e.primary.contrastText,"&:hover":{background:e.primary.dark},"&.Mui-disabled":{background:e.action.disabledBackground,color:e.action.disabled}})),F=o(r,{name:f,slot:"stopButton"})(({theme:{palette:e}})=>({background:e.text.primary,borderRadius:8,color:e.background.paper,"&:hover":{background:e.text.secondary}})),O=o("span")({background:"currentColor",blockSize:10,borderRadius:2,inlineSize:10,margin:5}),P=o("div",{name:f,slot:"hint"})(({theme:{palette:e,typography:t}})=>({...t.caption,color:e.text.secondary})),A=o("div",{name:f,slot:"attachmentNotice"})(({theme:{palette:e,typography:t}})=>({...t.caption,color:e.error.main})),E=o("input")({display:"none"}),M=0,K=e=>{for(let{previewUrl:t}of e)URL.revokeObjectURL(t)};export const AssistantComposer=()=>{let{assistantSystem:r}=h(),[i,o]=c(""),[f,N]=c([]),[W,G]=c(0),[X,Y]=c(),[q,H]=c(!1),[J,Q]=c(!1),V=d(null),Z=d(null),_=d(0),ee=d(f),{isDesktop:et}=g();ee.current=f;let ea=p(k),er=p(v),ei=p(y),en=p(x),eo=p(R),el=p(S),es=p({...w,values:{max:4}}),ed=d(!0);s(()=>(ed.current=!0,()=>{ed.current=!1,K(ee.current)}),[]);let{isReplying:ec,isResuming:em}=m(r.chat$,e=>({isReplying:e.isLoading,isResuming:e.isResuming}),[]),ep=i.trim(),eu=em||q,eg=!ec&&!eu&&0===W&&(ep.length>0||f.length>0),eh=l(async e=>{if(0===e.length)return;let t=e.slice(0,Math.max(0,4-_.current));Y(t.length<e.length?"limit":void 0),0!==t.length&&(_.current+=t.length,G(e=>e+t.length),await Promise.all(t.map(async e=>{try{let t=await b(e);if(!ed.current)return;let a={id:`attachment-${++M}`,blob:t,previewUrl:URL.createObjectURL(t)};N(e=>[...e,a])}catch{_.current-=1,Y("unreadable")}finally{G(e=>e-1)}})))},[]),eb=l(e=>{URL.revokeObjectURL(e.previewUrl),_.current-=1,N(t=>t.filter(({id:t})=>t!==e.id)),Y(void 0)},[]),ef=l(async()=>{if(eg){et||V.current?.blur(),H(!0);try{await r.send(ep,f.map(({blob:e})=>e),{onSent:()=>{o(""),N(e=>e.filter(e=>!f.includes(e))),K(f),_.current-=f.length,Y(void 0),H(!1)},onUnsent:()=>{if(!ed.current)return;let e=f.slice(0,Math.max(0,4-_.current)),t=e.map(e=>({...e,previewUrl:URL.createObjectURL(e.blob)}));o(e=>e.trim()?`${e}
|
|
2
|
+
${i}`:i),N(e=>[...t,...e]),_.current+=t.length,Y(e.length<f.length?"limit":void 0)}})}finally{H(!1)}}},[r,f,eg,ep,i,et]),ek=l(e=>{e.preventDefault(),ef()},[ef]),ev=l(e=>{"Enter"!==e.key||e.shiftKey||e.nativeEvent.isComposing||(e.preventDefault(),ef())},[ef]),ey=l(()=>{r.stop()},[r]),ex=l(e=>{let t=[...e.target.files??[]];e.target.value="",eh(t)},[eh]),eR=l(e=>{let t=[...e.clipboardData.files].filter(e=>e.type.startsWith("image/"));0!==t.length&&(e.preventDefault(),eh(t))},[eh]);return t(z,{onSubmit:ek,onDragOver:l(e=>{e.dataTransfer.types.includes("Files")&&(e.preventDefault(),e.dataTransfer.dropEffect="copy",Q(!0))},[]),onDragLeave:l(e=>{e.relatedTarget instanceof Node&&e.currentTarget.contains(e.relatedTarget)||Q(!1)},[]),onDrop:l(e=>{0!==e.dataTransfer.files.length&&(e.preventDefault(),Q(!1),eh([...e.dataTransfer.files]))},[eh]),children:[t(U,{"data-dragging":J,children:[f.length>0&&e(C,{children:f.map(a=>t(B,{children:[e(D,{src:a.previewUrl,alt:""}),e(L,{size:"small","aria-label":eo,disabled:eu,onClick:()=>eb(a),children:e(u,{name:"X",sx:{fontSize:12}})})]},a.id))}),e(n,{title:en,placement:"top",children:e("span",{children:e(j,{size:"small","aria-label":en,disabled:eu,onClick:()=>Z.current?.click(),children:e(u,{name:"Paperclip",fontSize:"small"})})})}),e(E,{ref:Z,type:"file",accept:"image/*",multiple:!0,onChange:ex}),e(T,{children:e($,{multiline:!0,maxRows:6,placeholder:ea,value:i,readOnly:eu,inputRef:V,onChange:e=>o(e.target.value),onKeyDown:ev,onPaste:eR,onFocus:()=>r.setInputFocused(!0),onBlur:()=>r.setInputFocused(!1),inputProps:{"aria-label":ea}})}),ec?e(n,{title:ei,placement:"top",children:e(F,{size:"small","aria-label":ei,onClick:ey,children:e(O,{})})}):e(n,{title:er,placement:"top",children:e("span",{children:e(I,{type:"submit",size:"small","aria-label":er,disabled:!eg,children:e(u,{name:"PaperPlaneRightBold",fontSize:"small"})})})})]}),X?e(A,{role:"status",children:"limit"===X?es:el}):e(P,{children:e(a,{id:"sdk.assistant.composer.disclaimer",message:"AI can be wrong. Check the result."})})]})};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as e,jsxs as a}from"react/jsx-runtime";import{Trans as i}from"@lingui/react";import{Button as t,styled as s}from"@mui/material";import{useCallback as r,useMemo as n}from"react";import{match as o}from"ts-pattern";import{useEagerObservableValue as l}from"#package/react-sdk";import{PhxIcon as d}from"#package/ui-sdk";import{useConfigurator as m}from"../../application-runtime/index.js";import{AssistantToolChips as c}from"./AssistantChips.js";import{AssistantMarkdown as h}from"./AssistantMarkdown.js";import{describeAssistantFailure as p}from"./assistant-failure.js";import{EntityLinkSelectionProvider as
|
|
1
|
+
import{jsx as e,jsxs as a}from"react/jsx-runtime";import{Trans as i}from"@lingui/react";import{Button as t,styled as s}from"@mui/material";import{useCallback as r,useMemo as n}from"react";import{match as o}from"ts-pattern";import{useEagerObservableValue as l}from"#package/react-sdk";import{PhxIcon as d}from"#package/ui-sdk";import{useConfigurator as m}from"../../application-runtime/index.js";import{AssistantToolChips as c}from"./AssistantChips.js";import{AssistantMarkdown as h}from"./AssistantMarkdown.js";import{describeAssistantFailure as p}from"./assistant-failure.js";import{MessageImages as g}from"./attachments/index.js";import{EntityLinkSelectionProvider as u,useCreateEntityLinkSelection as f}from"./entity-link/index.js";import{AssistantPanelName as k}from"./theme.js";import{buildEarlierThreadItems as v,buildThreadView as b}from"./thread-items.js";import{useFollowStream as w}from"./use-follow-stream.js";let x=s("div",{name:k,slot:"thread"})({display:"grid",position:"relative"}),y=s("div",{name:k,slot:"messages"})(({theme:{spacing:e,typography:a}})=>({...a.body2,display:"flex",flexDirection:"column",gap:e(1.5),overflowY:"auto",overscrollBehavior:"contain",paddingBlock:e(2),paddingInline:`var(--phx-sidebar-padding, ${e(2)})`,"& > :first-child":{marginBlockStart:"auto"}})),T=s("div",{name:k,slot:"userMessage"})(({theme:{palette:e,spacing:a}})=>({alignSelf:"flex-end",background:`hsl(from ${e.primary.main} h s l / 12%)`,borderRadius:"14px 14px 4px 14px",display:"grid",gap:a(1),maxInlineSize:"85%",overflowWrap:"anywhere",paddingBlock:a(1),paddingInline:a(1.5),whiteSpace:"pre-wrap"})),j=s("div",{name:k,slot:"greeting"})({}),C=s("div",{name:k,slot:"status"})(({theme:{palette:e,typography:a}})=>({...a.caption,color:e.text.secondary})),I=s("div",{name:k,slot:"separator"})(({theme:{palette:e,spacing:a,typography:i}})=>({...i.caption,alignItems:"center",color:e.text.secondary,display:"flex",gap:a(1),"&::before, &::after":{borderBlockStart:`1px solid ${e.divider}`,content:'""',flex:1}})),S=s(t,{name:k,slot:"earlierButton"})({alignSelf:"center"}),B=s("div",{name:k,slot:"notice"})(({theme:{palette:e,shape:a,spacing:i}})=>({alignItems:"center",background:e.action.hover,borderRadius:a.borderRadius,display:"flex",flexWrap:"wrap",gap:i(1),justifyContent:"space-between",paddingBlock:i(1),paddingInline:i(1.5)})),E=s(t,{name:k,slot:"newReplyButton"})(({theme:{palette:e,spacing:a}})=>({background:e.text.primary,borderRadius:"calc(infinity * 1px)",color:e.background.paper,insetBlockEnd:a(1),insetInlineStart:"50%",position:"absolute",translate:"-50% 0","&:hover":{background:e.text.secondary}})),A=({item:t,isActive:s,undoableToolCallId:r,onUndo:n})=>o(t).with({kind:"user"},({text:i,imageIds:t})=>a(T,{children:[t.length>0&&e(g,{imageIds:t}),i]})).with({kind:"text"},({markdown:a,isStreaming:i,forms:t})=>e(h,{markdown:a,isStreaming:i,forms:t})).with({kind:"tools"},({tools:a})=>e(c,{tools:a,isActive:s,canUndo:a.some(({id:e})=>e===r),onUndo:n})).with({kind:"separator"},()=>e(I,{role:"separator",children:e(i,{id:"sdk.assistant.thread.earlierSummarized",message:"Earlier conversation summarized"})})).exhaustive();export const AssistantThread=()=>{let{assistantSystem:s}=m(),c=l(s.chat$),{messages:h,isLoading:g,isResuming:k,earlierThreads:T}=c,I=l(s.undoTipToolCallId$),R=g?void 0:I,{items:L,isThinking:z}=n(()=>b(h,g,k),[h,g,k]),$=n(()=>v(T),[T]),U=n(()=>L.filter(({kind:e})=>"user"===e).length,[L]),D=c.error?p(c.failedStatus):void 0,{scrollerRef:M,hasUnseenContent:W,handleScroll:q,scrollToEnd:H}=w(n(()=>({messages:h,isThinking:z,isResuming:k,failure:D?.kind}),[h,z,k,D?.kind]),U),N=f(),Y=r(e=>{e.target instanceof Element&&e.target.closest('a, button, input, label, select, textarea, [role="button"], [role="tooltip"]')||window.getSelection()?.isCollapsed!==!1&&N.release()},[N]),F=!c.isLoaded&&0===$.length&&!k&&!D;return a(x,{children:[e(u,{selection:N,children:a(y,{ref:M,onScroll:q,onClick:Y,role:"log","aria-live":"polite",children:[c.isLoaded&&0===L.length&&0===$.length&&!g&&!k&&!D&&e(j,{children:e(i,{id:"sdk.assistant.thread.greeting",message:"Hi. I can answer questions about this design and change it with you. Tell me what you need."})}),F&&e(C,{children:e(i,{id:"sdk.assistant.thread.loading",message:"Loading the conversation…"})}),c.isLoadingEarlierThread&&e(C,{children:e(i,{id:"sdk.assistant.thread.loadingEarlier",message:"Loading the earlier conversation…"})}),c.hasEarlierThread&&!c.isLoadingEarlierThread&&e(S,{size:"small",color:"inherit",onClick:s.loadEarlierThread,children:e(i,{id:"sdk.assistant.thread.showEarlier.label",message:"Show earlier conversation"})}),$.map(a=>e(A,{item:a,isActive:!1,undoableToolCallId:R,onUndo:s.undoToolCalls},a.id)),L.map(a=>e(A,{item:a,isActive:g&&a===L.at(-1),undoableToolCallId:R,onUndo:s.undoToolCalls},a.id)),k&&e(C,{children:e(i,{id:"sdk.assistant.thread.resuming",message:"Resuming the conversation…"})}),z&&e(C,{children:e(i,{id:"sdk.assistant.thread.thinking",message:"Thinking…"})}),D&&a(B,{role:"alert",children:[e("span",{children:o(D.kind).with("notAvailable",()=>e(i,{id:"sdk.assistant.failure.notAvailable",message:"The assistant is not available here."})).with("busy",()=>e(i,{id:"sdk.assistant.failure.busy",message:"The assistant is still working on an earlier message."})).with("unavailable",()=>e(i,{id:"sdk.assistant.failure.unavailable",message:"The assistant is unavailable right now."})).exhaustive()}),D.canRetry&&e(t,{size:"small",variant:"outlined",color:"inherit",onClick:s.reloadThread,children:e(i,{id:"sdk.assistant.failure.retry.label",message:"Try again"})})]})]})}),W&&e(E,{size:"small",onClick:H,endIcon:e(d,{name:"CaretDown"}),children:e(i,{id:"sdk.assistant.thread.newReply.label",message:"New reply"})})]})};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
interface MessageImagesProps {
|
|
2
|
+
/** The images the user attached to the message, by the ids it references them by. */
|
|
3
|
+
readonly imageIds: readonly string[];
|
|
4
|
+
}
|
|
5
|
+
/**
|
|
6
|
+
* The images a user attached to a message, as thumbnails above its text. They are read from the
|
|
7
|
+
* server as soon as the bubble shows, through the same per-configuration cache as the screenshots;
|
|
8
|
+
* a click shows one larger in a popover.
|
|
9
|
+
*/
|
|
10
|
+
export declare const MessageImages: ({ imageIds }: MessageImagesProps) => import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{jsx as e,jsxs as r}from"react/jsx-runtime";import{ButtonBase as i,Popover as o,styled as a}from"@mui/material";import{useCallback as t,useMemo as s,useState as n}from"react";import{useLocalizable as m}from"#package/react-sdk";import{useScreenshotSrc as l}from"../screenshots/index.js";import{AssistantPanelName as d}from"../theme.js";let c={id:"sdk.assistant.message.image.open",message:"Show the attached image larger"},p=a("div",{name:d,slot:"messageImages"})(({theme:{spacing:e}})=>({display:"flex",flexWrap:"wrap",gap:e(.75),justifyContent:"flex-end"})),g=a(i,{name:d,slot:"messageImage"})(({theme:{palette:e,shape:r}})=>({background:e.action.hover,blockSize:64,borderRadius:r.borderRadius,inlineSize:64,overflow:"hidden"})),h=a("img")({blockSize:"100%",display:"block",inlineSize:"100%",objectFit:"cover"}),b=a("img")(({theme:{shape:e}})=>({borderRadius:e.borderRadius,display:"block",maxBlockSize:"70vh",maxInlineSize:"min(80vw, 640px)"})),v=({imageId:r,onOpen:i})=>{let o=l(s(()=>({kind:"stored",imageId:r}),[r]));return e(g,{"aria-label":m(c),disabled:void 0===o,onClick:e=>void 0!==o&&i(e,o),children:void 0!==o&&e(h,{src:o,alt:""})})};export const MessageImages=({imageIds:i})=>{let[a,s]=n(),m=t((e,r)=>{s({anchor:e.currentTarget,src:r})},[]),l=t(()=>s(void 0),[]);return r(p,{children:[i.map(r=>e(v,{imageId:r,onOpen:m},r)),e(o,{open:void 0!==a,anchorEl:a?.anchor,onClose:l,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},slotProps:{paper:{sx:{padding:1}}},children:a&&e(b,{src:a.src,alt:""})})]})};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export{MessageImages}from"./MessageImages.js";export{ASSISTANT_IMAGE_MAX_SIDE,fitWithin,prepareImage}from"./prepare-image.js";
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The longest side, in pixels, of an image the user attaches: the provider fits every image within
|
|
3
|
+
* 2048 × 2048 before the model reads it, so more would only cost upload time and storage.
|
|
4
|
+
*/
|
|
5
|
+
export declare const ASSISTANT_IMAGE_MAX_SIDE = 2048;
|
|
6
|
+
interface Size {
|
|
7
|
+
readonly width: number;
|
|
8
|
+
readonly height: number;
|
|
9
|
+
}
|
|
10
|
+
/** The size that fits within `max` × `max`, keeping the aspect ratio and never enlarging. */
|
|
11
|
+
export declare const fitWithin: ({ width, height }: Size, max: number) => Size;
|
|
12
|
+
/**
|
|
13
|
+
* Turns an image file the user attaches into what is uploaded: decoded, fitted within
|
|
14
|
+
* {@link ASSISTANT_IMAGE_MAX_SIDE} on each side and re-encoded as JPEG. Re-encoding drops the
|
|
15
|
+
* file's metadata, its location included, and fills a transparent background white. Rejects for a
|
|
16
|
+
* file the browser cannot decode.
|
|
17
|
+
*/
|
|
18
|
+
export declare const prepareImage: (file: Blob) => Promise<Blob>;
|
|
19
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export const ASSISTANT_IMAGE_MAX_SIDE=2048;export const fitWithin=({width:e,height:t},a)=>{let r=Math.min(1,a/e,a/t);return{width:Math.max(1,Math.round(e*r)),height:Math.max(1,Math.round(t*r))}};let e=async e=>{let t=URL.createObjectURL(e),a=new Image;a.src=t;try{return await a.decode(),a}finally{URL.revokeObjectURL(t)}};export const prepareImage=async t=>{let a=await e(t),{width:r,height:n}=fitWithin({width:a.naturalWidth,height:a.naturalHeight},2048),o=document.createElement("canvas");o.width=r,o.height=n;let h=o.getContext("2d");if(!h)throw Error("The browser gave no 2D canvas to prepare the attached image on.");return h.fillStyle="#fff",h.fillRect(0,0,r,n),h.drawImage(a,0,0,r,n),new Promise((e,t)=>{o.toBlob(a=>a?e(a):t(Error("The browser could not encode the attached image as JPEG.")),"image/jpeg",.85)})};
|
|
@@ -4,6 +4,6 @@ interface ScreenshotThumbnailsProps {
|
|
|
4
4
|
/** Called once a picture has loaded, which changes the size of the popover. */
|
|
5
5
|
readonly onImageLoad: () => void;
|
|
6
6
|
}
|
|
7
|
-
/** The pictures of a tool call's screenshots
|
|
7
|
+
/** The pictures of a tool call's screenshots. */
|
|
8
8
|
export declare const ScreenshotThumbnails: ({ screenshots, onImageLoad }: ScreenshotThumbnailsProps) => import("react/jsx-runtime").JSX.Element;
|
|
9
9
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as e
|
|
1
|
+
import{jsx as e}from"react/jsx-runtime";import{styled as o}from"@mui/material";import{AssistantPanelName as r}from"../theme.js";import{useScreenshotSrc as a}from"./use-screenshot-src.js";let i=o("span",{name:r,slot:"screenshots",shouldForwardProp:e=>"columns"!==e})(({columns:e,theme:{palette:o,shape:r,shadows:a,spacing:i}})=>({background:o.background.paper,borderRadius:r.borderRadius,boxShadow:a[4],display:"grid",gap:i(1.5),gridTemplateColumns:`repeat(${e}, minmax(0, 200px))`,maxInlineSize:"80vw",padding:i(1.5)})),s=o("img")(({theme:{palette:e,shape:o}})=>({blockSize:"auto",borderRadius:o.borderRadius/2,boxShadow:`inset 0 0 0 1px ${e.divider}`,display:"block",inlineSize:"100%"})),d=o("span")(({theme:{palette:e,shape:o}})=>({aspectRatio:"4 / 3",background:e.action.hover,borderRadius:o.borderRadius/2,display:"block"})),t=({picture:o,onImageLoad:r})=>{let i=a(o);return void 0===i?e(d,{}):e(s,{src:i,alt:"",onLoad:r})};export const ScreenshotThumbnails=({screenshots:o,onImageLoad:r})=>e(i,{columns:Math.min(o.length,2),children:o.map(({label:o,picture:a})=>e(t,{picture:a,onImageLoad:r},o))});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{ScreenshotThumbnails}from"./ScreenshotThumbnails.js";export{readToolScreenshots}from"./tool-screenshots.js";
|
|
1
|
+
export{ScreenshotThumbnails}from"./ScreenshotThumbnails.js";export{readToolScreenshots}from"./tool-screenshots.js";export{useScreenshotSrc}from"./use-screenshot-src.js";
|
|
@@ -1,11 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Where the panel gets a screenshot's picture from: the server, by the id the browser uploaded it
|
|
3
|
+
* under, or the data URL of a picture a thread from before the upload carries inline.
|
|
4
|
+
*/
|
|
5
|
+
export type AssistantScreenshotPicture = {
|
|
6
|
+
readonly kind: 'stored';
|
|
7
|
+
readonly imageId: string;
|
|
8
|
+
} | {
|
|
9
|
+
readonly kind: 'inline';
|
|
10
|
+
readonly src: string;
|
|
11
|
+
};
|
|
1
12
|
/** A screenshot a `query` or `apply` call took, as the panel shows it. */
|
|
2
13
|
export interface AssistantToolScreenshot {
|
|
3
14
|
/** The label the call's `image` field returned, such as `Cabinet-2/doorLayout#2`. */
|
|
4
15
|
readonly label: string;
|
|
5
|
-
readonly
|
|
6
|
-
readonly view: string;
|
|
7
|
-
/** The picture as a data URL. */
|
|
8
|
-
readonly src: string;
|
|
16
|
+
readonly picture: AssistantScreenshotPicture;
|
|
9
17
|
}
|
|
10
18
|
/**
|
|
11
19
|
* The screenshots of a tool result: the image parts that follow the result's JSON, each after the
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{z as
|
|
1
|
+
import{z as t}from"zod";import{readAssistantImageReference as e}from"@salsita-ai/contracts/assistant";let a=t.object({type:t.literal("text"),content:t.string()}),r=t.object({type:t.literal("image"),source:t.discriminatedUnion("type",[t.object({type:t.literal("url"),value:t.string()}),t.object({type:t.literal("data"),value:t.string(),mimeType:t.string()})])}),s=/^[^/]+\/[^#]+(?:#\d+)?$/;export const readToolScreenshots=t=>Array.isArray(t)?t.slice(1).flatMap((t,l,i)=>{let n=r.safeParse(t),o=a.safeParse(i[l-1]),c=n.success?(({source:t})=>{if("data"===t.type)return{kind:"inline",src:`data:${t.mimeType};base64,${t.value}`};let a=e(t.value);return null===a?null:{kind:"stored",imageId:a}})(n.data):null;return c&&o.success&&s.test(o.data.content)?[{label:o.data.content,picture:c}]:[]}):[];
|