@salsita-ai/sdk 0.50.0-develop.78a839cc7b → 0.50.0-develop.7c472a27fe

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.
Files changed (371) hide show
  1. package/dist/application-spec/errors/diagnostic-codes.d.ts +9 -0
  2. package/dist/application-spec/errors/diagnostic-codes.js +1 -1
  3. package/dist/application-spec/errors/diagnostic-messages.d.ts +10 -1
  4. package/dist/application-spec/errors/diagnostic-messages.js +1 -1
  5. package/dist/application-spec/generate-application/code/domain-runtime-files.js +1 -1
  6. package/dist/application-spec/generate-application/code/templates/application-types.js +6 -6
  7. package/dist/application-spec/generate-application/code/templates/common/doc-comment.d.ts +2 -0
  8. package/dist/application-spec/generate-application/code/templates/common/doc-comment.js +1 -0
  9. package/dist/application-spec/generate-application/code/templates/configurator-globals.d.ts +2 -1
  10. package/dist/application-spec/generate-application/code/templates/configurator-globals.js +19 -6
  11. package/dist/application-spec/generate-application/code/templates/global-definition/generate-action-types.js +7 -7
  12. package/dist/application-spec/generate-application/code/templates/global-definition/generate-assistant-form-element-types.d.ts +12 -0
  13. package/dist/application-spec/generate-application/code/templates/global-definition/generate-assistant-form-element-types.js +7 -0
  14. package/dist/application-spec/generate-application/code/templates/global-definition/generate-phx-types.js +24 -22
  15. package/dist/application-spec/generate-application/code/templates/global-definition/index.d.ts +1 -0
  16. package/dist/application-spec/generate-application/code/templates/global-definition/index.js +1 -1
  17. package/dist/application-spec/generate-application/code/templates/skills/sdk-content.d.ts +13 -6
  18. package/dist/application-spec/generate-application/code/templates/skills/sdk-content.js +2 -2
  19. package/dist/application-spec/generate-application/runtime/admin-runtime/admin-runtime.d.ts +3 -2
  20. package/dist/application-spec/generate-application/runtime/admin-runtime/admin-runtime.js +1 -1
  21. package/dist/application-spec/generate-application/runtime/application-runtime.d.ts +12 -4
  22. package/dist/application-spec/generate-application/runtime/application-runtime.js +1 -1
  23. package/dist/application-spec/generate-application/runtime/configurator-runtime/configurator-runtime.d.ts +3 -3
  24. package/dist/application-spec/generate-application/runtime/configurator-runtime/configurator-runtime.js +1 -1
  25. package/dist/application-spec/generate-application/runtime/sections/expression-runtime.d.ts +9 -3
  26. package/dist/application-spec/generate-application/runtime/sections/expression-runtime.js +1 -1
  27. package/dist/application-spec/parse-application-files/raw-spec/raw-assistant.d.ts +33 -3
  28. package/dist/application-spec/parse-application-files/raw-spec/raw-assistant.js +1 -1
  29. package/dist/application-spec/parse-application-files/spec/sections/assistant/assistant-form-elements.d.ts +9 -0
  30. package/dist/application-spec/parse-application-files/spec/sections/assistant/assistant-form-elements.js +1 -0
  31. package/dist/application-spec/parse-application-files/spec/sections/assistant/assistant-schema.d.ts +4 -1
  32. package/dist/application-spec/parse-application-files/spec/sections/assistant/assistant-schema.js +1 -1
  33. package/dist/configurator/ConfiguratorApp.js +1 -1
  34. package/dist/configurator/application-runtime/extensions/selectors.js +1 -1
  35. package/dist/configurator/application-runtime/extensions/systems/assistant-system/assistant-system.d.ts +4 -3
  36. package/dist/configurator/application-runtime/extensions/systems/assistant-system/assistant-system.js +1 -1
  37. package/dist/configurator/application-runtime/extensions/systems/assistant-system/graphql-tools.d.ts +33 -7
  38. package/dist/configurator/application-runtime/extensions/systems/assistant-system/graphql-tools.js +1 -1
  39. package/dist/configurator/application-runtime/extensions/systems/canvas-system.d.ts +8 -0
  40. package/dist/configurator/application-runtime/extensions/systems/canvas-system.js +1 -1
  41. package/dist/configurator/application-runtime/extensions/systems/export-system/export-busy-error.d.ts +8 -0
  42. package/dist/configurator/application-runtime/extensions/systems/export-system/export-busy-error.js +1 -0
  43. package/dist/configurator/application-runtime/extensions/systems/export-system/export-system.d.ts +23 -1
  44. package/dist/configurator/application-runtime/extensions/systems/export-system/export-system.js +1 -1
  45. package/dist/configurator/application-runtime/extensions/systems/graphql-system/entity-meta.d.ts +14 -1
  46. package/dist/configurator/application-runtime/extensions/systems/graphql-system/entity-meta.js +1 -1
  47. package/dist/configurator/application-runtime/extensions/systems/graphql-system/graphql-system.d.ts +45 -4
  48. package/dist/configurator/application-runtime/extensions/systems/graphql-system/graphql-system.js +1 -1
  49. package/dist/configurator/application-runtime/extensions/systems/image-rendering-system/image-rendering-system.d.ts +14 -5
  50. package/dist/configurator/application-runtime/extensions/systems/image-rendering-system/image-rendering-system.js +1 -1
  51. package/dist/configurator/application-runtime/extensions/systems/index.d.ts +1 -1
  52. package/dist/configurator/common/configurator-interface.d.ts +12 -2
  53. package/dist/configurator/common/configurator-interface.js +1 -1
  54. package/dist/configurator/configurator-context/ConfiguratorResponsiveProvider.d.ts +3 -3
  55. package/dist/configurator/configurator-context/ConfiguratorResponsiveProvider.js +1 -1
  56. package/dist/configurator/configurator-context/PreviewContextProvider.js +1 -1
  57. package/dist/configurator/configurator-context/configurator-hooks/layout-hooks.d.ts +4 -0
  58. package/dist/configurator/configurator-context/configurator-routing/ConfiguratorRoutingProvider.js +1 -1
  59. package/dist/configurator/pages/error-boundaries/LoadingErrorBoundary.js +1 -1
  60. package/dist/configurator/toolbar-actions/index.d.ts +1 -0
  61. package/dist/configurator/toolbar-actions/index.js +1 -1
  62. package/dist/configurator/toolbar-actions/use-toolbar-actions.d.ts +100 -0
  63. package/dist/configurator/toolbar-actions/use-toolbar-actions.js +1 -0
  64. package/dist/configurator/toolbar-actions/use-toolbar-help.d.ts +7 -0
  65. package/dist/configurator/toolbar-actions/use-toolbar-help.js +1 -0
  66. package/dist/configurator/ui/assistant/AssistantChips.d.ts +3 -2
  67. package/dist/configurator/ui/assistant/AssistantChips.js +1 -1
  68. package/dist/configurator/ui/assistant/AssistantMarkdown.d.ts +1 -1
  69. package/dist/configurator/ui/assistant/AssistantMarkdown.js +1 -1
  70. package/dist/configurator/ui/assistant/alert/AssistantAlert.d.ts +8 -0
  71. package/dist/configurator/ui/assistant/alert/AssistantAlert.js +1 -0
  72. package/dist/configurator/ui/assistant/alert/index.d.ts +2 -0
  73. package/dist/configurator/ui/assistant/alert/index.js +1 -0
  74. package/dist/configurator/ui/assistant/alert/remark-alerts.d.ts +10 -0
  75. package/dist/configurator/ui/assistant/alert/remark-alerts.js +1 -0
  76. package/dist/configurator/ui/assistant/form/AssistantForm.js +1 -1
  77. package/dist/configurator/ui/assistant/form/compose-answer.d.ts +1 -1
  78. package/dist/configurator/ui/assistant/form/compose-answer.js +1 -1
  79. package/dist/configurator/ui/assistant/form/form-model.d.ts +3 -4
  80. package/dist/configurator/ui/assistant/form/form-state.d.ts +1 -1
  81. package/dist/configurator/ui/assistant/form/index.d.ts +2 -0
  82. package/dist/configurator/ui/assistant/form/index.js +1 -1
  83. package/dist/configurator/ui/assistant/form/parse-form-block.d.ts +3 -2
  84. package/dist/configurator/ui/assistant/form/parse-form-block.js +1 -1
  85. package/dist/configurator/ui/assistant/form/read-form-attributes.d.ts +1 -1
  86. package/dist/configurator/ui/assistant/form/read-form-attributes.js +1 -1
  87. package/dist/configurator/ui/assistant/form/registry/built-in-form-elements.d.ts +3 -0
  88. package/dist/configurator/ui/assistant/form/registry/built-in-form-elements.js +1 -0
  89. package/dist/configurator/ui/assistant/form/registry/create-assistant-form-element.d.ts +31 -0
  90. package/dist/configurator/ui/assistant/form/registry/create-assistant-form-element.js +1 -0
  91. package/dist/configurator/ui/assistant/form/{form-element-definition.d.ts → registry/form-element-definition.d.ts} +3 -1
  92. package/dist/configurator/ui/assistant/form/registry/form-element-definition.js +1 -0
  93. package/dist/configurator/ui/assistant/form/{form-registry.d.ts → registry/form-registry.d.ts} +2 -2
  94. package/dist/configurator/ui/assistant/form/registry/form-registry.js +1 -0
  95. package/dist/configurator/ui/assistant/form/registry/index.d.ts +6 -0
  96. package/dist/configurator/ui/assistant/form/registry/index.js +1 -0
  97. package/dist/configurator/ui/assistant/form/registry/use-form-registry.d.ts +8 -0
  98. package/dist/configurator/ui/assistant/form/registry/use-form-registry.js +1 -0
  99. package/dist/configurator/ui/assistant/form-elements/FormCard.d.ts +9 -0
  100. package/dist/configurator/ui/assistant/form-elements/FormCard.js +1 -0
  101. package/dist/configurator/ui/assistant/form-elements/FormConfirm.d.ts +9 -0
  102. package/dist/configurator/ui/assistant/form-elements/FormConfirm.js +1 -0
  103. package/dist/configurator/ui/assistant/form-elements/FormGroup.d.ts +4 -1
  104. package/dist/configurator/ui/assistant/form-elements/FormNumber.d.ts +9 -0
  105. package/dist/configurator/ui/assistant/form-elements/FormNumber.js +1 -0
  106. package/dist/configurator/ui/assistant/form-elements/FormOptions.d.ts +4 -1
  107. package/dist/configurator/ui/assistant/form-elements/FormReply.d.ts +4 -1
  108. package/dist/configurator/ui/assistant/form-elements/FormReply.js +1 -1
  109. package/dist/configurator/ui/assistant/form-elements/FormSwatch.d.ts +10 -0
  110. package/dist/configurator/ui/assistant/form-elements/FormSwatch.js +1 -0
  111. package/dist/configurator/ui/assistant/form-elements/FormText.d.ts +4 -1
  112. package/dist/configurator/ui/assistant/form-elements/FormText.js +1 -1
  113. package/dist/configurator/ui/assistant/form-elements/clamp-form-number.d.ts +10 -0
  114. package/dist/configurator/ui/assistant/form-elements/clamp-form-number.js +1 -0
  115. package/dist/configurator/ui/assistant/form-elements/form-element-props.d.ts +20 -16
  116. package/dist/configurator/ui/assistant/form-elements/index.d.ts +4 -0
  117. package/dist/configurator/ui/assistant/form-elements/index.js +1 -1
  118. package/dist/configurator/ui/assistant/index.d.ts +3 -0
  119. package/dist/configurator/ui/assistant/index.js +1 -1
  120. package/dist/configurator/ui/assistant/resource-image/index.d.ts +1 -1
  121. package/dist/configurator/ui/assistant/resource-image/index.js +1 -1
  122. package/dist/configurator/ui/assistant/resource-image/resource-path.d.ts +0 -9
  123. package/dist/configurator/ui/assistant/resource-image/resource-path.js +1 -1
  124. package/dist/configurator/ui/assistant/screenshots/ScreenshotThumbnails.d.ts +9 -0
  125. package/dist/configurator/ui/assistant/screenshots/ScreenshotThumbnails.js +1 -0
  126. package/dist/configurator/ui/assistant/screenshots/index.d.ts +2 -0
  127. package/dist/configurator/ui/assistant/screenshots/index.js +1 -0
  128. package/dist/configurator/ui/assistant/screenshots/tool-screenshots.d.ts +14 -0
  129. package/dist/configurator/ui/assistant/screenshots/tool-screenshots.js +1 -0
  130. package/dist/configurator/ui/assistant/streamed-markdown.d.ts +2 -2
  131. package/dist/configurator/ui/assistant/streamed-markdown.js +2 -2
  132. package/dist/configurator/ui/assistant/tool-chip.js +1 -1
  133. package/dist/configurator/ui/configurator-layout/slots/canvas/LayoutCanvas.js +1 -1
  134. package/dist/configurator/ui/configurator-layout/slots/canvas/SharedCanvas.js +1 -1
  135. package/dist/configurator/ui/configurator-layout/universal/ExportingOverlay.d.ts +5 -0
  136. package/dist/configurator/ui/configurator-layout/universal/ExportingOverlay.js +1 -0
  137. package/dist/configurator/ui/configurator-layout/universal/Layout.js +1 -1
  138. package/dist/configurator/ui/configurator-layout/universal/use-layout-scene-safe-area.js +1 -1
  139. package/dist/configurator/ui/index.d.ts +1 -0
  140. package/dist/configurator/ui/index.js +1 -1
  141. package/dist/configurator/ui/legacy/layout/common/ReactiveInterfaceLayout.js +1 -1
  142. package/dist/configurator/ui/phoenix-layout-elements/AppLoader.js +2 -2
  143. package/dist/configurator/ui/save-message-snackbars/SaveMessageSnackbars.js +1 -1
  144. package/dist/docs/index.json +62 -1
  145. package/dist/docs/integrations/webcomponent-api/basics.mdx +2 -0
  146. package/dist/docs/layouts/custom-layout.mdx +318 -158
  147. package/dist/docs/layouts/gallery/ardent-compressor.mdx +3516 -0
  148. package/dist/docs/layouts/gallery/fenwick-window.mdx +2803 -0
  149. package/dist/docs/layouts/gallery/ferrule-bar-station.mdx +6567 -0
  150. package/dist/docs/layouts/gallery/kestrel-kettle.mdx +1858 -0
  151. package/dist/docs/layouts/gallery/sunfold-solar.mdx +2683 -0
  152. package/dist/docs/other-features/client-side-rendering/declarative.mdx +1 -1
  153. package/dist/docs/phoenix/configurator-interface.mdx +12 -10
  154. package/dist/docs/phoenix/sdk-builder-workflow.mdx +1 -1
  155. package/dist/docs/phoenix/sessions-and-access.mdx +2 -0
  156. package/dist/domain/application/assistant/assistant-manifest.d.ts +16 -1
  157. package/dist/domain/application/assistant/assistant-resolved-manifest.d.ts +8 -1
  158. package/dist/domain/application/assistant/build-assistant-manifest.js +1 -1
  159. package/dist/domain/application/assistant/form/assistant-form-element-name.d.ts +11 -0
  160. package/dist/domain/application/assistant/form/assistant-form-element-name.js +8 -0
  161. package/dist/domain/application/assistant/form/assistant-form-elements.d.ts +174 -0
  162. package/dist/domain/application/assistant/form/assistant-form-elements.js +1 -0
  163. package/dist/domain/application/assistant/form/assistant-resource-path.d.ts +10 -0
  164. package/dist/domain/application/assistant/form/assistant-resource-path.js +1 -0
  165. package/dist/domain/application/assistant/form/index.d.ts +4 -0
  166. package/dist/domain/application/assistant/form/index.js +1 -0
  167. package/dist/domain/application/assistant/generate-assistant-prompt.d.ts +3 -0
  168. package/dist/domain/application/assistant/generate-assistant-prompt.js +1 -1
  169. package/dist/domain/application/assistant/index.d.ts +2 -3
  170. package/dist/domain/application/assistant/index.js +1 -1
  171. package/dist/domain/application/assistant/session-setup/apply-assistant-setup.js +1 -1
  172. package/dist/domain/application/assistant/session-setup/assistant-setup-manifest.d.ts +2 -0
  173. package/dist/domain/application/assistant/session-setup/assistant-setup-manifest.js +1 -1
  174. package/dist/domain/application/web-component-property.d.ts +3 -1
  175. package/dist/domain/application/web-component-property.js +1 -1
  176. package/dist/domain/available-system-components.d.ts +1 -1
  177. package/dist/domain/available-system-components.js +1 -1
  178. package/dist/domain/domain-builder.d.ts +9 -3
  179. package/dist/domain/domain-builder.js +1 -1
  180. package/dist/domain/domain-context/store-system/store-system.d.ts +5 -0
  181. package/dist/domain/domain-context/store-system/store-system.js +1 -1
  182. package/dist/domain/domain-runtime/domain-context/selectors.d.ts +1 -0
  183. package/dist/domain/domain-runtime/domain-context/selectors.js +1 -1
  184. package/dist/domain/domain-runtime/domain-runtime.d.ts +8 -0
  185. package/dist/domain/domain-runtime/environment/types.d.ts +1 -1
  186. package/dist/domain/domain-runtime/errors/implementation-error-collector.d.ts +2 -0
  187. package/dist/domain/domain-runtime/errors/implementation-error-collector.js +1 -1
  188. package/dist/domain/domain-runtime/index.d.ts +1 -1
  189. package/dist/domain/domain-runtime/index.js +1 -1
  190. package/dist/domain/domain-runtime/spec/index.d.ts +1 -1
  191. package/dist/domain/domain-runtime/spec/index.js +1 -1
  192. package/dist/domain/domain-runtime/spec/initialize.js +1 -1
  193. package/dist/domain/domain-runtime/spec/module-checks/element-registration.d.ts +15 -1
  194. package/dist/domain/domain-runtime/spec/module-checks/element-registration.js +1 -1
  195. package/dist/domain/domain-runtime/spec/module-checks/find-assistant-form-element-errors.d.ts +12 -0
  196. package/dist/domain/domain-runtime/spec/module-checks/find-assistant-form-element-errors.js +1 -0
  197. package/dist/domain/domain-runtime/spec/module-checks/index.d.ts +3 -1
  198. package/dist/domain/domain-runtime/spec/module-checks/index.js +1 -1
  199. package/dist/domain/domain-runtime/spec/module-checks/merge-expression-modules.d.ts +23 -0
  200. package/dist/domain/domain-runtime/spec/module-checks/merge-expression-modules.js +1 -0
  201. package/dist/domain/domain-runtime/spec/module-checks/resolve-expression-modules.d.ts +3 -4
  202. package/dist/domain/domain-runtime/spec/module-checks/resolve-expression-modules.js +1 -1
  203. package/dist/domain/domain-runtime/spec/selectors.d.ts +3 -1
  204. package/dist/domain/domain-runtime/spec/selectors.js +1 -1
  205. package/dist/domain/extensions/export-images/agent-screenshot.d.ts +24 -0
  206. package/dist/domain/extensions/export-images/agent-screenshot.js +1 -0
  207. package/dist/domain/extensions/{client-side-image.d.ts → export-images/client-side-image.d.ts} +2 -2
  208. package/dist/domain/extensions/export-images/client-side-image.js +1 -0
  209. package/dist/domain/extensions/export-images/index.d.ts +3 -0
  210. package/dist/domain/extensions/export-images/index.js +1 -0
  211. package/dist/domain/extensions/{save-template-thumbnail.d.ts → export-images/save-template-thumbnail.d.ts} +2 -2
  212. package/dist/domain/extensions/export-images/save-template-thumbnail.js +1 -0
  213. package/dist/domain/extensions/index.d.ts +1 -2
  214. package/dist/domain/extensions/index.js +1 -1
  215. package/dist/domain/mocks/create-mock-domain-runtime.d.ts +4 -0
  216. package/dist/editor/domain-editors/DomainSpecContext.js +1 -1
  217. package/dist/editor/domain-editors/apply-spec-update.d.ts +8 -1
  218. package/dist/editor/domain-editors/apply-spec-update.js +1 -1
  219. package/dist/editor/domain-editors/use-implementation-files.d.ts +6 -11
  220. package/dist/editor/domain-editors/use-implementation-files.js +1 -1
  221. package/dist/editor/screenshot/ScreenshotHandler.js +1 -1
  222. package/dist/i18n/locales/cs/messages.js +1 -1
  223. package/dist/i18n/locales/da/messages.js +1 -1
  224. package/dist/i18n/locales/de/messages.js +1 -1
  225. package/dist/i18n/locales/de-AT/messages.js +1 -1
  226. package/dist/i18n/locales/en/messages.js +1 -1
  227. package/dist/i18n/locales/en-AU/messages.js +1 -1
  228. package/dist/i18n/locales/en-GB/messages.js +1 -1
  229. package/dist/i18n/locales/es/messages.js +1 -1
  230. package/dist/i18n/locales/fr/messages.js +1 -1
  231. package/dist/i18n/locales/hu/messages.js +1 -1
  232. package/dist/i18n/locales/it/messages.js +1 -1
  233. package/dist/i18n/locales/nl/messages.js +1 -1
  234. package/dist/i18n/locales/pl/messages.js +1 -1
  235. package/dist/i18n/locales/pt/messages.js +1 -1
  236. package/dist/i18n/locales/ro/messages.js +1 -1
  237. package/dist/i18n/locales/sk/messages.js +1 -1
  238. package/dist/i18n/locales/tr/messages.js +1 -1
  239. package/dist/legacy/domain-cli/utils/cache.d.ts +1 -1
  240. package/dist/legacy/domain-cli/utils/cache.js +1 -1
  241. package/dist/legacy/domain-spec/__generated/domain-schema.d.ts +16 -0
  242. package/dist/legacy/domain-spec/spec/domain-spec.js +1 -1
  243. package/dist/legacy/phoenix-cli/project-gen/generators/file-templates/agents/claude-md.d.ts +1 -1
  244. package/dist/legacy/phoenix-cli/project-gen/generators/file-templates/agents/cursor-rules.d.ts +1 -1
  245. package/dist/legacy/phoenix-cli/project-gen/generators/file-templates/agents/shared-sdk-content.d.ts +1 -1
  246. package/dist/legacy/phoenix-cli/project-gen/generators/file-templates/agents/shared-sdk-content.js +11 -5
  247. package/dist/react-sdk/application-runtime/hooks/index.d.ts +2 -0
  248. package/dist/react-sdk/application-runtime/hooks/index.js +1 -1
  249. package/dist/react-sdk/application-runtime/hooks/loading/index.d.ts +5 -0
  250. package/dist/react-sdk/application-runtime/hooks/loading/index.js +1 -0
  251. package/dist/react-sdk/application-runtime/hooks/loading/loader-host-context.d.ts +11 -0
  252. package/dist/react-sdk/application-runtime/hooks/loading/loader-host-context.js +1 -0
  253. package/dist/react-sdk/application-runtime/hooks/loading/use-is-awaiting-loading-phase.d.ts +8 -0
  254. package/dist/react-sdk/application-runtime/hooks/loading/use-is-awaiting-loading-phase.js +1 -0
  255. package/dist/react-sdk/application-runtime/hooks/loading/use-is-loader-hosted.d.ts +7 -0
  256. package/dist/react-sdk/application-runtime/hooks/loading/use-is-loader-hosted.js +1 -0
  257. package/dist/react-sdk/application-runtime/hooks/loading/use-loading-actions.d.ts +9 -0
  258. package/dist/react-sdk/application-runtime/hooks/loading/use-loading-actions.js +1 -0
  259. package/dist/react-sdk/application-runtime/hooks/loading/use-loading-application.d.ts +24 -0
  260. package/dist/react-sdk/application-runtime/hooks/loading/use-loading-application.js +1 -0
  261. package/dist/react-sdk/application-runtime/hooks/responsive/index.d.ts +3 -0
  262. package/dist/react-sdk/application-runtime/hooks/responsive/index.js +1 -0
  263. package/dist/react-sdk/application-runtime/hooks/responsive/use-responsive-actions.d.ts +9 -0
  264. package/dist/react-sdk/application-runtime/hooks/responsive/use-responsive-actions.js +1 -0
  265. package/dist/react-sdk/application-runtime/hooks/responsive/use-responsive-application.d.ts +26 -0
  266. package/dist/react-sdk/application-runtime/hooks/responsive/use-responsive-application.js +1 -0
  267. package/dist/react-sdk/application-runtime/hooks/responsive/use-responsive-state.d.ts +10 -0
  268. package/dist/react-sdk/application-runtime/hooks/responsive/use-responsive-state.js +1 -0
  269. package/dist/react-sdk/application-runtime/hooks/responsive/use-responsive-store.d.ts +24 -0
  270. package/dist/react-sdk/application-runtime/hooks/responsive/use-responsive-store.js +1 -0
  271. package/dist/react-sdk/application-runtime/hooks/use-access-service.d.ts +5 -0
  272. package/dist/react-sdk/application-runtime/hooks/use-access-service.js +1 -1
  273. package/dist/react-sdk/application-runtime/hooks/use-phoenix-element-slots.d.ts +2 -1
  274. package/dist/react-sdk/application-runtime/index.d.ts +2 -0
  275. package/dist/react-sdk/application-runtime/integration/initialize.d.ts +7 -6
  276. package/dist/react-sdk/application-runtime/integration/initialize.js +1 -1
  277. package/dist/react-sdk/application-runtime/integration/selectors.d.ts +11 -2
  278. package/dist/react-sdk/application-runtime/integration/selectors.js +1 -1
  279. package/dist/react-sdk/application-runtime/integration/types.d.ts +5 -2
  280. package/dist/react-sdk/application-runtime/loading/actions.d.ts +45 -0
  281. package/dist/react-sdk/application-runtime/loading/actions.js +1 -0
  282. package/dist/react-sdk/application-runtime/loading/index.d.ts +4 -0
  283. package/dist/react-sdk/application-runtime/loading/index.js +1 -0
  284. package/dist/react-sdk/application-runtime/loading/initialize.d.ts +3 -0
  285. package/dist/react-sdk/application-runtime/loading/initialize.js +1 -0
  286. package/dist/react-sdk/application-runtime/loading/selectors.d.ts +18 -0
  287. package/dist/react-sdk/application-runtime/loading/selectors.js +1 -0
  288. package/dist/react-sdk/application-runtime/loading/types.d.ts +59 -0
  289. package/dist/react-sdk/application-runtime/mocks/create-mock-application-runtime.js +1 -1
  290. package/dist/react-sdk/application-runtime/provider/ApplicationRuntime.d.ts +6 -0
  291. package/dist/react-sdk/application-runtime/provider/ApplicationRuntime.js +1 -1
  292. package/dist/react-sdk/application-runtime/provider/ApplicationType.d.ts +7 -0
  293. package/dist/react-sdk/application-runtime/provider/ApplicationType.js +1 -1
  294. package/dist/react-sdk/application-runtime/responsive/actions.d.ts +47 -0
  295. package/dist/react-sdk/application-runtime/responsive/actions.js +1 -0
  296. package/dist/react-sdk/application-runtime/responsive/index.d.ts +4 -0
  297. package/dist/react-sdk/application-runtime/responsive/index.js +1 -0
  298. package/dist/react-sdk/application-runtime/responsive/initialize.d.ts +3 -0
  299. package/dist/react-sdk/application-runtime/responsive/initialize.js +1 -0
  300. package/dist/react-sdk/application-runtime/responsive/selectors.d.ts +20 -0
  301. package/dist/react-sdk/application-runtime/responsive/selectors.js +1 -0
  302. package/dist/react-sdk/application-runtime/responsive/types.d.ts +104 -0
  303. package/dist/react-sdk/application-runtime/routing/routing-service.d.ts +34 -2
  304. package/dist/react-sdk/application-runtime/routing/routing-service.js +1 -1
  305. package/dist/react-sdk/application-runtime/runtime/create-application-runtime.d.ts +164 -3
  306. package/dist/react-sdk/application-runtime/runtime/create-application-runtime.js +1 -1
  307. package/dist/react-sdk/domain-application-context/BackendDataProvider.js +1 -1
  308. package/dist/react-sdk/domain-application-context/FrontendDataProvider.js +1 -1
  309. package/dist/react-sdk/domain-application-context/PublishedDataProvider.js +1 -1
  310. package/dist/react-sdk/domain-context/common-hooks/index.d.ts +1 -0
  311. package/dist/react-sdk/domain-context/common-hooks/index.js +1 -1
  312. package/dist/react-sdk/domain-context/common-hooks/use-configuration-save-state.d.ts +23 -0
  313. package/dist/react-sdk/domain-context/common-hooks/use-configuration-save-state.js +1 -0
  314. package/dist/react-sdk/domain-context/common-hooks/use-domain-context.d.ts +1 -0
  315. package/dist/react-sdk/domain-context/index.d.ts +1 -0
  316. package/dist/react-sdk/domain-context/index.js +1 -1
  317. package/dist/react-sdk/domain-context/system-hooks/undo-redo-hooks.js +1 -1
  318. package/dist/react-sdk/index.d.ts +0 -1
  319. package/dist/react-sdk/index.js +1 -1
  320. package/dist/react-sdk/loading-state/LoaderHost.d.ts +20 -0
  321. package/dist/react-sdk/loading-state/LoaderHost.js +1 -0
  322. package/dist/react-sdk/loading-state/built-in-loading-phase.d.ts +9 -0
  323. package/dist/react-sdk/loading-state/built-in-loading-phase.js +1 -0
  324. package/dist/react-sdk/loading-state/index.d.ts +3 -2
  325. package/dist/react-sdk/loading-state/index.js +1 -1
  326. package/dist/react-sdk/loading-state/{LoadingStateProvider.d.ts → loading-state-hooks.d.ts} +3 -12
  327. package/dist/react-sdk/loading-state/loading-state-hooks.js +1 -0
  328. package/dist/react-sdk/session/SessionServiceProvider.js +1 -1
  329. package/dist/react-sdk/web-component/create-web-component.js +1 -1
  330. package/dist/react-sdk/web-component/god-mode/god-mode-registry.d.ts +30 -0
  331. package/dist/react-sdk/web-component/god-mode/god-mode-registry.js +1 -0
  332. package/dist/react-sdk/web-component/god-mode/index.d.ts +1 -0
  333. package/dist/react-sdk/web-component/god-mode/index.js +1 -0
  334. package/dist/ui-sdk/icons/__generated/Lightbulb.d.ts +3 -0
  335. package/dist/ui-sdk/icons/__generated/Lightbulb.js +1 -0
  336. package/dist/ui-sdk/icons/__generated/XCircle.d.ts +3 -0
  337. package/dist/ui-sdk/icons/__generated/XCircle.js +1 -0
  338. package/dist/ui-sdk/icons/__generated/index.d.ts +4 -0
  339. package/dist/ui-sdk/icons/__generated/index.js +1 -1
  340. package/dist/ui-sdk/icons/icons-registry.js +1 -1
  341. package/dist/ui-sdk/responsive-application/ResponsiveApplicationProvider.d.ts +2 -2
  342. package/dist/ui-sdk/responsive-application/responsive-state-store.d.ts +11 -9
  343. package/dist/ui-sdk/responsive-application/use-store-responsive-info.js +1 -1
  344. package/dist/ui-sdk/theme/types.d.ts +5 -1
  345. package/package.json +13 -3
  346. package/schema/domain-spec.json +140 -0
  347. package/dist/configurator/ui/assistant/form/built-in-form-registry.d.ts +0 -10
  348. package/dist/configurator/ui/assistant/form/built-in-form-registry.js +0 -1
  349. package/dist/configurator/ui/assistant/form/form-registry.js +0 -8
  350. package/dist/domain/application/assistant/assistant-form-elements.d.ts +0 -28
  351. package/dist/domain/application/assistant/assistant-form-elements.js +0 -1
  352. package/dist/domain/extensions/client-side-image.js +0 -1
  353. package/dist/domain/extensions/save-template-thumbnail.js +0 -1
  354. package/dist/react-sdk/application-runtime/runtime/god-mode.d.ts +0 -19
  355. package/dist/react-sdk/application-runtime/runtime/god-mode.js +0 -1
  356. package/dist/react-sdk/loading-state/LoadingStateProvider.js +0 -1
  357. package/dist/react-sdk/loading-state/loading-state-manager.d.ts +0 -37
  358. package/dist/react-sdk/loading-state/loading-state-manager.js +0 -1
  359. package/dist/react-sdk/responsive-state/ResponsiveStateProvider.d.ts +0 -25
  360. package/dist/react-sdk/responsive-state/ResponsiveStateProvider.js +0 -1
  361. package/dist/react-sdk/responsive-state/canvas-padding.d.ts +0 -14
  362. package/dist/react-sdk/responsive-state/index.d.ts +0 -5
  363. package/dist/react-sdk/responsive-state/index.js +0 -1
  364. package/dist/react-sdk/responsive-state/responsive-state-manager.d.ts +0 -111
  365. package/dist/react-sdk/responsive-state/responsive-state-manager.js +0 -1
  366. package/dist/react-sdk/responsive-state/use-responsive-state-manager.d.ts +0 -10
  367. package/dist/react-sdk/responsive-state/use-responsive-state-manager.js +0 -1
  368. package/dist/react-sdk/responsive-state/use-responsive-state.d.ts +0 -11
  369. package/dist/react-sdk/responsive-state/use-responsive-state.js +0 -1
  370. /package/dist/{configurator/ui/assistant/form/form-element-definition.js → react-sdk/application-runtime/loading/types.js} +0 -0
  371. /package/dist/react-sdk/{responsive-state/canvas-padding.js → application-runtime/responsive/types.js} +0 -0
@@ -22,12 +22,18 @@ Declarative 3D product configurator built with Phoenix SDK. Domain model defined
22
22
  - \`src/components/\` — ECS system components (\`phx.domain.attachComponent.withEntity()\`)
23
23
  - \`src/elements/\` — Page-level React components (\`phx.frontend.createCustomPhoenixLayoutElement()\`)
24
24
  - \`ConfiguratorLayout\`: a layout element with this name replaces everything the built-in layout renders for a loaded configuration, in owner and read mode, finalization included. Prefer arranging the spec's layout components; write one for shell-level changes, such as moving the sidebar or adding an area the built-in layout has no place for
25
- - Mount \`LayoutSlots.SharedCanvas\` (from \`@salsita-ai/sdk/configurator\`) in a positioned root covering the page, or the app loader stays on screen; put the UI above it, positioned and after it in the markup. Call \`useSceneSafeArea()\` (same import) and put \`containerRef\` on the element covering the whole canvas and \`safeAreaRef\` on the region the UI leaves free, with \`pointerEvents: 'none'\`, so the camera frames the scene there
25
+ - Mount \`LayoutSlots.SharedCanvas\` (from \`@salsita-ai/sdk/configurator\`) in a positioned root covering the page; put the UI above it, positioned and after it in the markup. With the canvas mounted the app loader waits until the scene has loaded; a layout without a canvas is not held by the loader. Call \`phx.frontend.useSceneSafeArea()\` and put \`containerRef\` on the element covering the whole canvas and \`safeAreaRef\` on the region the UI leaves free, with \`pointerEvents: 'none'\`, so the camera frames the scene there
26
26
  - Sidebar moved, contents as the spec configures them: mount \`LayoutSlots.DesktopSidebar\` in a positioned container that sets its size, with \`side="start"\` on the left; \`docs/layouts/sidebar/in-a-custom-layout.mdx\` is the whole layout
27
- - Your own UI: "Hooks for a Project Layout" in \`docs/phoenix/configurator-interface.mdx\` lists the hooks with what each returns (\`pnpm phoenix docs -r docs/phoenix/configurator-interface.mdx\`), \`docs/phoenix/layout-slots.mdx\` the built-in pieces you can still mount, and \`docs/layouts/custom-layout.mdx\` is a worked example
28
- - Messages: mount \`LayoutSlots.Services\` for the built-in snackbars, or show violations, side-effect hints and errors yourself with \`phx.frontend.useConfiguratorMessages(onMessage)\`, not both. Either way mount a snackbar root (\`LayoutSlots.DesktopSnackbarsRoot\` or \`LayoutSlots.MobileSnackbarsRoot\`): save and built-in action errors are always snackbars
29
- - Finalize over the spec's \`finalizeAction\` components, each naming a handler registered with \`phx.frontend.createPhoenixHandler\`: run each with \`phx.frontend.useFinalizeAction(handler)\` in a component of its own wrapped in \`PhoenixHandlerBoundary\` (from \`@salsita-ai/sdk/react\`), or mount \`FinalizeActions\` (from \`@salsita-ai/sdk/configurator\`) for the built-in buttons. \`finalizePage\` and \`finalizeButton\` are legacy
30
- - Read mode and fullscreen are the layout's job, no hook enforces them: hide what a viewer must not change while \`phx.frontend.useAccessService().accessInfo.viewMode\` is \`true\`, and remove panels while \`phx.frontend.useIsFullscreenActive()\` is set; \`phx.frontend.useSetFullscreen()\` returns its setter
27
+ - Your own UI: "Hooks for a Project Layout" in \`docs/phoenix/configurator-interface.mdx\` lists the hooks with what each returns (\`pnpm phoenix docs -r docs/phoenix/configurator-interface.mdx\`), \`docs/phoenix/layout-slots.mdx\` the built-in pieces you can still mount, and \`docs/layouts/custom-layout.mdx\` is a worked example. Call the hooks as \`phx.frontend.useX()\`; besides those below, these are often needed: \`usePreview()\` (\`isPreview\` while the preview start screen shows), \`useCloseAction()\` (the host's close action or \`null\`), \`useActiveViewports()\` (the container's breakpoints, \`null\` until measured, \`desktop\` above 768 px: the desktop/phone switch), \`useResolveLocalizable()\` and \`useLocalizable(text)\` (spec texts to strings), \`useIsCloningAllowed()\` (a read-mode "edit a copy" action with \`LayoutSlots.CloneToEditDialog\`)
28
+ - Undo and redo: \`phx.frontend.useUndoRedo()\` returns \`{ canUndo, canRedo, undo, redo }\`; disable each button from \`canUndo\`/\`canRedo\`
29
+ - Tabs: \`phx.frontend.useTabNavigation()\` returns \`{ source, tabs, activeTab, select }\` for the spec's \`sidebarTabs\` (of the selected entity) or \`horizontalTabs\`; render \`tabs\` (each \`{ index, label, icon, state, isActive }\`, \`icon\` a PhxIcon name) and call \`select(tab.index)\` on click. Pass \`{ source: 'sidebarTabs' }\` or \`{ source: 'horizontalTabs' }\` when the layout shows one kind only. Not \`LayoutSlots.useSidebarTabs()\`: it serves the built-in sidebar and returns no tabs while its summary shows
30
+ - Steps: \`phx.frontend.useStepNavigation()\` returns \`{ steps, activeStep, activeIndex, isFirst, isLast, canGoNext, canGoPrevious, next, previous, goTo }\` for the spec's \`navigationSteps\`; render \`steps\` (each \`{ index, label, state, status }\`, \`status\` \`'complete' | 'active' | 'upcoming'\`), call \`next()\`/\`previous()\` for Back and Next and \`goTo(step.index)\` from a stepper. It enforces no order and no validity: enable only \`'complete'\` steps for an "earlier steps only" stepper, and to block moving on while the configuration has a problem, require \`phx.frontend.useStateValidity().severity !== 'warning'\` besides \`canGoNext\`: a change with a \`fixable\` or \`fatal\` violation is rejected, so the configuration is never invalid, and a \`warning\` is the problem that stays (it blocks finalizing too). \`useSteps\` and \`useHasSteps\` from \`@salsita-ai/sdk/configurator\` are deprecated
31
+ - Messages: mount \`LayoutSlots.Services\` for the built-in snackbars, or show violations, side-effect hints, errors and failed saves yourself with \`phx.frontend.useConfiguratorMessages(onMessage)\`, not both. A failed save arrives as \`saveError\`, the next successful save as \`saveRecovery\`; a layout that mounts neither shows no sign of a failed save. Either way mount a snackbar root (\`LayoutSlots.DesktopSnackbarsRoot\` or \`LayoutSlots.MobileSnackbarsRoot\`): errors of the built-in actions are always snackbars
32
+ - Finalize over the spec's \`finalizeAction\` components, each naming a handler registered with \`phx.frontend.createPhoenixHandler\`: \`phx.frontend.useFinalizeActions()\` returns \`{ actions, primary, secondary, disabled, hints }\`; render \`primary\` (and \`secondary\` in a menu or list) in a loop, each action \`{ key, label, title, icon, run, isPending, error, disabled }\`, and call \`action.run()\` on click (its promise never rejects; show \`action.error\` on failure). The configurator runs the handlers itself, outside the layout, so a handler must not rely on a provider the layout adds. For one known handler, \`phx.frontend.useFinalizeAction(handler)\` in a component wrapped in \`PhoenixHandlerBoundary\` (from \`@salsita-ai/sdk/react\`) works too; \`FinalizeActions\` (from \`@salsita-ai/sdk/configurator\`) mounts the built-in buttons. \`finalizePage\` and \`finalizeButton\` are legacy
33
+ - Read mode and fullscreen are the layout's job, no hook enforces them (\`useUndoRedo\`, \`useFinalizeActions\` and \`useStepNavigation\` included): hide undo, redo, finalization and whatever else a viewer must not change while \`phx.frontend.useAccessService().accessInfo.viewMode\` is \`true\` (tabs are navigation, so a viewer may switch them), and remove panels while \`phx.frontend.useIsFullscreenActive()\` is set; \`phx.frontend.useSetFullscreen()\` returns its setter
34
+ - \`ConfigurationNotFoundPage\`: \`phx.frontend.createConfigurationNotFoundPage(({ onBack }) => …)\` replaces the "configuration not accessible" page; show a way back only when the optional \`onBack\` is set. The not-authenticated page's default renders it too; only the admin's not-authorized page keeps the built-in page
35
+ - \`ConfiguratorErrorPage\`: \`phx.frontend.createConfiguratorErrorPage(({ reason, onRetry }) => …)\` replaces the production error page; \`reason\` is \`uncaughtError\` or \`presetCreationFailed\`. A page that throws falls back to the built-in one, and development keeps the detailed error pages, so the project page shows only in a production build. Register both pages with these helpers: \`createCustomPhoenixLayoutElement\` with the name works too, but types the component as taking only \`children\`, so the typed props do not compile there in a strict project
36
+ - \`AppLoaderContent\`: \`phx.frontend.createAppLoader(({ phases }) => …)\` replaces what the loading overlay shows (each phase \`{ id, label?, progress? }\`, the list possibly empty); Phoenix keeps the overlay itself
31
37
  - \`src/handlers/\` — Event & lifecycle handlers
32
38
  - \`src/webhooks/\` — Server-side webhook handlers (\`phx.webhooks.*Builder\`)
33
39
  - \`src/migrations/\` — Schema version migrations (v*.ts)
@@ -22,3 +22,5 @@ export * from './use-domain-application.js';
22
22
  export * from './use-web-component.js';
23
23
  export * from './use-web-component-readonly-sync.js';
24
24
  export * from './data/index.js';
25
+ export * from './loading/index.js';
26
+ export * from './responsive/index.js';
@@ -1 +1 @@
1
- export*from"./use-application-runtime-selector.js";export{AccessServiceProvider,useAccessInfoActions,useAccessService,useAdminRawAccessService,useAdminRawAccessInfo,useConfigurationId,useConfiguratorRawAccessService,useConfiguratorRawAccessInfo,useProvidedAccessService}from"./use-access-service.js";export*from"./use-logger.js";export*from"./use-analytics-service.js";export*from"./use-application-query-client.js";export*from"./use-i18n.js";export*from"./use-spec.js";export*from"./use-environment.js";export*from"./use-overrides.js";export*from"./use-domain-application-props.js";export*from"./use-resource-url.js";export*from"./use-integration.js";export*from"./use-routing.js";export*from"./use-loaded-data.js";export*from"./use-domain-data.js";export*from"./use-session.js";export*from"./use-authorized-client.js";export*from"./use-authenticated-client.js";export*from"./use-phoenix-element-slots.js";export*from"./use-phoenix-handler-slots.js";export*from"./use-domain-application.js";export*from"./use-web-component.js";export*from"./use-web-component-readonly-sync.js";export*from"./data/index.js";
1
+ export*from"./use-application-runtime-selector.js";export{AccessServiceProvider,useAccessInfoActions,useAccessService,useAdminRawAccessService,useAdminRawAccessInfo,useConfigurationId,useConfiguratorRawAccessService,useConfiguratorRawAccessInfo,useProvidedAccessService}from"./use-access-service.js";export*from"./use-logger.js";export*from"./use-analytics-service.js";export*from"./use-application-query-client.js";export*from"./use-i18n.js";export*from"./use-spec.js";export*from"./use-environment.js";export*from"./use-overrides.js";export*from"./use-domain-application-props.js";export*from"./use-resource-url.js";export*from"./use-integration.js";export*from"./use-routing.js";export*from"./use-loaded-data.js";export*from"./use-domain-data.js";export*from"./use-session.js";export*from"./use-authorized-client.js";export*from"./use-authenticated-client.js";export*from"./use-phoenix-element-slots.js";export*from"./use-phoenix-handler-slots.js";export*from"./use-domain-application.js";export*from"./use-web-component.js";export*from"./use-web-component-readonly-sync.js";export*from"./data/index.js";export*from"./loading/index.js";export*from"./responsive/index.js";
@@ -0,0 +1,5 @@
1
+ export { LoaderHostContext } from './loader-host-context.js';
2
+ export { useIsAwaitingLoadingPhase } from './use-is-awaiting-loading-phase.js';
3
+ export { useIsLoaderHosted } from './use-is-loader-hosted.js';
4
+ export { useLoadingActions } from './use-loading-actions.js';
5
+ export { useLoadingApplication } from './use-loading-application.js';
@@ -0,0 +1 @@
1
+ export{LoaderHostContext}from"./loader-host-context.js";export{useIsAwaitingLoadingPhase}from"./use-is-awaiting-loading-phase.js";export{useIsLoaderHosted}from"./use-is-loader-hosted.js";export{useLoadingActions}from"./use-loading-actions.js";export{useLoadingApplication}from"./use-loading-application.js";
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Whether a component is mounted below the application's `LoaderHost`, which provides `true`. It is
3
+ * `false` everywhere else, as in the admin, which hosts no loader.
4
+ *
5
+ * It is a fact about the React tree, so it is a context and not part of the runtime's `loading`
6
+ * slice. It lives beside the hooks that read it rather than beside `LoaderHost`, because
7
+ * `loading-state/` imports from this folder and never the other way.
8
+ *
9
+ * @internal Runtime plumbing for the SDK's own UI.
10
+ */
11
+ export declare const LoaderHostContext: import("react").Context<boolean>;
@@ -0,0 +1 @@
1
+ import{createContext as o}from"react";export const LoaderHostContext=o(!1);
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Whether the application this component is mounted in expects the loading phase `id` and that
3
+ * phase has not started since its loader host mounted. The loader stays up across that gap.
4
+ * `false` outside a loader host.
5
+ *
6
+ * @internal Runtime plumbing for the SDK's own UI.
7
+ */
8
+ export declare const useIsAwaitingLoadingPhase: (id: string) => boolean;
@@ -0,0 +1 @@
1
+ import{useCallback as e}from"react";import{useApplicationRuntimeSelector as o}from"../use-application-runtime-selector.js";import{useIsLoaderHosted as t}from"./use-is-loader-hosted.js";import{useLoadingApplication as s}from"./use-loading-application.js";export const useIsAwaitingLoadingPhase=i=>{let r=s(),a=t(),m=o(e(()=>r?.selectors.getIsAwaitingPhase(i)??!1,[r,i]));return a&&m};
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Whether this component is mounted below the application's `LoaderHost`. Without one, the SDK's
3
+ * own UI shows its inline loaders, as the admin does.
4
+ *
5
+ * @internal Runtime plumbing for the SDK's own UI.
6
+ */
7
+ export declare const useIsLoaderHosted: () => boolean;
@@ -0,0 +1 @@
1
+ import{useContext as o}from"react";import{LoaderHostContext as t}from"./loader-host-context.js";export const useIsLoaderHosted=()=>o(t);
@@ -0,0 +1,9 @@
1
+ import type { LoadingActions } from '../../loading/index.js';
2
+ /**
3
+ * The loading actions of the application this component is mounted in, or `null` outside its
4
+ * loader host, so that nothing reports phases no loader shows. Stable while the host stays mounted.
5
+ *
6
+ * @internal Runtime plumbing for the SDK's own UI. A project reports a phase with
7
+ * `phx.frontend.useLoadingState()`.
8
+ */
9
+ export declare const useLoadingActions: () => LoadingActions | null;
@@ -0,0 +1 @@
1
+ import{useIsLoaderHosted as o}from"./use-is-loader-hosted.js";import{useLoadingApplication as s}from"./use-loading-application.js";export const useLoadingActions=()=>{let t=s(),i=o();return null!==t&&i?t.actions:null};
@@ -0,0 +1,24 @@
1
+ /**
2
+ * The selectors and actions of the loading state of the application this component is mounted in,
3
+ * chosen by its `ApplicationTypeProvider` as the domain context hooks choose theirs. `null` outside
4
+ * an `ApplicationRuntimeProvider` or an `ApplicationTypeProvider`: the session and data providers also run in trees without one, where
5
+ * no loader is hosted.
6
+ *
7
+ * @internal Runtime plumbing for the SDK's own UI.
8
+ */
9
+ export declare const useLoadingApplication: () => {
10
+ selectors: {
11
+ selectLoadingState: import("@salsita-ai/common/utils").Selector<import("../../loading/selectors.js").LoadingSelectorState, import("../../index.js").LoadingState>;
12
+ getLoadingState: () => import("../../index.js").LoadingState;
13
+ getIsAwaitingPhase: (id: string) => boolean;
14
+ };
15
+ actions: {
16
+ startPhase: (phase: import("../../index.js").LoadingPhase) => void;
17
+ endPhase: (id: string) => void;
18
+ reportError: () => void;
19
+ clearError: () => void;
20
+ expectPhase: (id: string) => void;
21
+ dropExpectation: (id: string) => void;
22
+ resetSlot: () => void;
23
+ };
24
+ } | null;
@@ -0,0 +1 @@
1
+ import{useMemo as o}from"react";import{useOptionalApplicationRuntime as i,useOptionalApplicationType as n}from"../../provider/index.js";import{ApplicationType as r}from"../../runtime/index.js";export const useLoadingApplication=()=>{let t=i(),e=n();return o(()=>null===t||null===e?null:e===r.Admin?{selectors:t.selectors.loading.admin,actions:t.actions.loading.admin}:{selectors:t.selectors.loading.configurator,actions:t.actions.loading.configurator},[t,e])};
@@ -0,0 +1,3 @@
1
+ export { useResponsiveActions } from './use-responsive-actions.js';
2
+ export { useResponsiveState } from './use-responsive-state.js';
3
+ export { type ResponsiveStore, useResponsiveStore } from './use-responsive-store.js';
@@ -0,0 +1 @@
1
+ export{useResponsiveActions}from"./use-responsive-actions.js";export{useResponsiveState}from"./use-responsive-state.js";export{useResponsiveStore}from"./use-responsive-store.js";
@@ -0,0 +1,9 @@
1
+ import type { ResponsiveActions } from '../../responsive/index.js';
2
+ /**
3
+ * The actions of the responsive state of the application this component is mounted in: set the canvas padding, expand, collapse, hide or
4
+ * show the root container. Stable for the runtime's lifetime.
5
+ *
6
+ * @internal Runtime plumbing for the SDK's own UI. A project layout uses `useActiveViewports()`
7
+ * from `@salsita-ai/sdk/react` and `useSceneSafeArea()` from `@salsita-ai/sdk/configurator`.
8
+ */
9
+ export declare const useResponsiveActions: () => ResponsiveActions;
@@ -0,0 +1 @@
1
+ import{useResponsiveApplication as e}from"./use-responsive-application.js";export const useResponsiveActions=()=>{let{actions:s}=e();return s};
@@ -0,0 +1,26 @@
1
+ /**
2
+ * The selectors and actions of the responsive state of the application this component is mounted
3
+ * in, chosen by its `ApplicationTypeProvider` as the domain context hooks choose theirs.
4
+ */
5
+ export declare const useResponsiveApplication: () => {
6
+ runtime: import("../../index.js").ApplicationRuntime;
7
+ selectors: {
8
+ selectResponsiveState: import("@salsita-ai/common/utils").Selector<import("../../responsive/selectors.js").ResponsiveSelectorState, import("../../index.js").ResponsiveState>;
9
+ selectViewportSize: import("@salsita-ai/common/utils").Selector<import("../../responsive/selectors.js").ResponsiveSelectorState, import("../../index.js").ResponsiveViewportSize>;
10
+ selectCanvasPadding: import("@salsita-ai/common/utils").Selector<import("../../responsive/selectors.js").ResponsiveSelectorState, import("../../index.js").CanvasPadding>;
11
+ getResponsiveState: () => import("../../index.js").ResponsiveState;
12
+ getViewportSize: () => import("../../index.js").ResponsiveViewportSize;
13
+ getCanvasPadding: () => import("../../index.js").CanvasPadding;
14
+ };
15
+ actions: {
16
+ setViewport: (viewport: import("../../index.js").ResponsiveViewport) => void;
17
+ setBreakpoints: (breakpoints: import("../../index.js").ResponsiveBreakpoints) => void;
18
+ setCanvasPadding: (canvasPadding: import("../../index.js").CanvasPadding) => void;
19
+ expand: () => void;
20
+ collapse: () => void;
21
+ hide: () => void;
22
+ show: () => void;
23
+ setAnimating: (isAnimating: boolean) => void;
24
+ reset: () => void;
25
+ };
26
+ };
@@ -0,0 +1 @@
1
+ import{useApplicationRuntime as e,useApplicationType as s}from"../../provider/index.js";import{ApplicationType as o}from"../../runtime/index.js";export const useResponsiveApplication=()=>{let i=e();return s()===o.Admin?{runtime:i,selectors:i.selectors.responsive.admin,actions:i.actions.responsive.admin}:{runtime:i,selectors:i.selectors.responsive.configurator,actions:i.actions.responsive.configurator}};
@@ -0,0 +1,10 @@
1
+ import type { ResponsiveState } from '../../responsive/index.js';
2
+ /**
3
+ * The responsive state of the application this component is mounted in: the size classes of its root container, the
4
+ * canvas padding, and whether the container is expanded, hidden or animating. Re-renders when any
5
+ * of them changes, not on a resize within one size class.
6
+ *
7
+ * @internal Runtime plumbing for the SDK's own UI. A project layout uses `useActiveViewports()`
8
+ * from `@salsita-ai/sdk/react` and `useSceneSafeArea()` from `@salsita-ai/sdk/configurator`.
9
+ */
10
+ export declare const useResponsiveState: () => ResponsiveState;
@@ -0,0 +1 @@
1
+ import{useApplicationRuntimeSelector as e}from"../use-application-runtime-selector.js";import{useResponsiveApplication as t}from"./use-responsive-application.js";export const useResponsiveState=()=>{let{selectors:s}=t();return e(s.getResponsiveState)};
@@ -0,0 +1,24 @@
1
+ import type { CanvasPadding, ResponsiveActions, ResponsiveState, ResponsiveViewportSize } from '../../responsive/index.js';
2
+ /**
3
+ * The runtime's responsive state in the shape `ResponsiveApplicationProvider` of
4
+ * `@salsita-ai/sdk/ui` takes as its `store`, which that package declares by shape because it imports
5
+ * no other SDK package.
6
+ *
7
+ * @internal Runtime plumbing for the SDK's own UI. A project layout uses `useActiveViewports()`
8
+ * from `@salsita-ai/sdk/react` and `useSceneSafeArea()` from `@salsita-ai/sdk/configurator`.
9
+ */
10
+ export interface ResponsiveStore extends Omit<ResponsiveActions, 'reset'> {
11
+ /** Calls `onChange` after every change of the runtime; returns the unsubscribe. */
12
+ readonly subscribe: (onChange: () => void) => () => void;
13
+ readonly getState: () => ResponsiveState;
14
+ readonly getViewportSize: () => ResponsiveViewportSize;
15
+ readonly getCanvasPadding: () => CanvasPadding;
16
+ }
17
+ /**
18
+ * The responsive state of the application this component is mounted in, as the store its root
19
+ * container measures into and `useResponsive()` reads from. Stable for the runtime's lifetime.
20
+ *
21
+ * @internal Runtime plumbing for the SDK's own UI. A project layout uses `useActiveViewports()`
22
+ * from `@salsita-ai/sdk/react` and `useSceneSafeArea()` from `@salsita-ai/sdk/configurator`.
23
+ */
24
+ export declare const useResponsiveStore: () => ResponsiveStore;
@@ -0,0 +1 @@
1
+ import{useMemo as e}from"react";import{useResponsiveApplication as t}from"./use-responsive-application.js";export const useResponsiveStore=()=>{let{runtime:s,selectors:i,actions:a}=t();return e(()=>({setViewport:a.setViewport,setBreakpoints:a.setBreakpoints,setCanvasPadding:a.setCanvasPadding,expand:a.expand,collapse:a.collapse,hide:a.hide,show:a.show,setAnimating:a.setAnimating,subscribe:s.subscribe,getState:i.getResponsiveState,getViewportSize:i.getViewportSize,getCanvasPadding:i.getCanvasPadding}),[s,i,a])};
@@ -6,6 +6,11 @@ interface AccessServiceProviderProps {
6
6
  }
7
7
  export declare const AccessServiceProvider: (props: AccessServiceProviderProps) => import("react/jsx-runtime").JSX.Element;
8
8
  export declare const useProvidedAccessService: () => AccessService;
9
+ /**
10
+ * The provided access service with `accessInfo.viewMode` set by the application's read-only rule,
11
+ * the domain-context selector `getIsViewMode`: the access opens the configuration for viewing only,
12
+ * or the host element is `readonly`. The assistant's `apply` follows the same selector.
13
+ */
9
14
  export declare const useAccessService: () => AccessService;
10
15
  export declare const useConfigurationId: () => string;
11
16
  export declare const useConfiguratorRawAccessService: () => AccessService | null;
@@ -1 +1 @@
1
- import{jsx as e}from"react/jsx-runtime";import{createContext as s,useContext as c,useMemo as o}from"react";import{standardWebComponentProperties as r}from"#package/domain";import{useApplicationRuntime as t}from"../provider/index.js";import{useApplicationRuntimeSelector as i}from"./use-application-runtime-selector.js";import{useWebComponentPropertyValue as n}from"./use-web-component.js";let a=s(null);export const AccessServiceProvider=s=>e(a.Provider,{value:s.value,children:s.children});export const useProvidedAccessService=()=>{let e=c(a);if(null===e)throw Error("Access service not found! Render access-dependent hooks inside AccessServiceProvider.");return e};export const useAccessService=()=>{let e=n(r.readonly),s=useProvidedAccessService();return o(()=>({...s,accessInfo:{...s.accessInfo,viewMode:s.accessInfo.viewMode||e}}),[s,e])};export const useConfigurationId=()=>useProvidedAccessService().configurationId;export const useConfiguratorRawAccessService=()=>i(t().selectors.access.getConfiguratorRawAccessService);export const useAdminRawAccessService=()=>i(t().selectors.access.getAdminRawAccessService);export const useConfiguratorRawAccessInfo=()=>i(t().selectors.access.getConfiguratorRawAccessInfo);export const useAdminRawAccessInfo=()=>i(t().selectors.access.getAdminRawAccessInfo);export const useAccessInfoActions=()=>t().actions.access;
1
+ import{jsx as e}from"react/jsx-runtime";import{createContext as s,useContext as c,useMemo as o}from"react";import{standardWebComponentProperties as r}from"#package/domain";import{useApplicationRuntime as t,useApplicationType as i}from"../provider/index.js";import{ApplicationType as n}from"../runtime/index.js";import{useApplicationRuntimeSelector as a}from"./use-application-runtime-selector.js";import{useWebComponentPropertyValue as d}from"./use-web-component.js";let u=s(null);export const AccessServiceProvider=s=>e(u.Provider,{value:s.value,children:s.children});export const useProvidedAccessService=()=>{let e=c(u);if(null===e)throw Error("Access service not found! Render access-dependent hooks inside AccessServiceProvider.");return e};export const useAccessService=()=>{let e=i(),s=t(),c=useProvidedAccessService(),u=e===n.Admin,m=a(u?s.selectors.domainContext.admin.getIsViewMode:s.selectors.domainContext.configurator.getIsViewMode),f=d(r.readonly),p=m||u&&f;return o(()=>({...c,accessInfo:{...c.accessInfo,viewMode:p}}),[c,p])};export const useConfigurationId=()=>useProvidedAccessService().configurationId;export const useConfiguratorRawAccessService=()=>a(t().selectors.access.getConfiguratorRawAccessService);export const useAdminRawAccessService=()=>a(t().selectors.access.getAdminRawAccessService);export const useConfiguratorRawAccessInfo=()=>a(t().selectors.access.getConfiguratorRawAccessInfo);export const useAdminRawAccessInfo=()=>a(t().selectors.access.getAdminRawAccessInfo);export const useAccessInfoActions=()=>t().actions.access;
@@ -1,8 +1,9 @@
1
- import type { PropsWithChildren } from 'react';
1
+ import type { ComponentType, PropsWithChildren } from 'react';
2
2
  import type { CustomPhoenixEntityElementProps } from '#package/domain';
3
3
  export interface PhoenixElementSlots {
4
4
  readonly entityElements: Record<string, (props: CustomPhoenixEntityElementProps) => JSX.Element>;
5
5
  readonly layoutElements: Record<string, (props: PropsWithChildren) => JSX.Element>;
6
+ readonly assistantFormElements: Record<string, ComponentType<never>>;
6
7
  readonly hashes: Record<string, string>;
7
8
  }
8
9
  export declare const usePhoenixElementSlots: () => PhoenixElementSlots;
@@ -5,6 +5,8 @@ export * from './web-component/index.js';
5
5
  export * from './common-services/index.js';
6
6
  export * from './domain-application-context/index.js';
7
7
  export * from './integration/index.js';
8
+ export { type LoadingActions, type LoadingApplicationState, type LoadingPhase, type LoadingRuntimeState, type LoadingState, } from './loading/index.js';
9
+ export { type CanvasPadding, type ResponsiveApplicationState, type ResponsiveBreakpoints, type ResponsiveRuntimeState, type ResponsiveState, type ResponsiveViewport, type ResponsiveViewportSize, } from './responsive/index.js';
8
10
  export * from './routing/index.js';
9
11
  export * from './session/index.js';
10
12
  export * from './mocks/index.js';
@@ -1,7 +1,8 @@
1
- import type { IntegrationActions } from './actions.js';
2
1
  import type { IntegrationState } from './types.js';
3
- interface Context {
4
- readonly actions: IntegrationActions;
5
- }
6
- export declare const initializeIntegration: (context: Context) => IntegrationState;
7
- export {};
2
+ /**
3
+ * The integration slice's initial state. The admin integration service is not part of it: the
4
+ * integration selectors own it.
5
+ *
6
+ * @internal Runtime plumbing for the SDK's own UI.
7
+ */
8
+ export declare const initializeIntegration: () => IntegrationState;
@@ -1 +1 @@
1
- import{AdminIntegrationService as e}from"./admin-integration-service.js";export const initializeIntegration=i=>{let{actions:n}=i;return{adminIntegrationService:new e({actions:n}),embeddedView:null}};
1
+ export const initializeIntegration=()=>({embeddedView:null});
@@ -1,17 +1,26 @@
1
+ import type { IntegrationActions } from './actions.js';
2
+ import { AdminIntegrationService } from './admin-integration-service.js';
1
3
  import type { IntegrationState } from './types.js';
2
4
  export interface IntegrationSelectorState {
3
5
  readonly integration: IntegrationState;
4
6
  }
5
7
  interface Context {
6
8
  readonly getState: () => IntegrationSelectorState;
9
+ /** The actions the selector-owned admin integration service calls. */
10
+ readonly actions: IntegrationActions;
7
11
  }
12
+ /**
13
+ * The integration selectors. They own the runtime's admin integration service, built from the
14
+ * given actions.
15
+ *
16
+ * @internal Runtime plumbing for the SDK's own UI.
17
+ */
8
18
  export declare const createIntegrationSelectors: (context: Context) => {
9
- selectAdminIntegrationService: import("@salsita-ai/common/utils").Selector<IntegrationSelectorState, import("./admin-integration-service.js").AdminIntegrationService>;
10
19
  selectIntegrationState: import("@salsita-ai/common/utils").Selector<IntegrationSelectorState, IntegrationState>;
11
20
  selectEmbeddedView: import("@salsita-ai/common/utils").Selector<IntegrationSelectorState, import("./types.js").EmbeddedView>;
12
21
  selectPresetEmbeddedState: import("@salsita-ai/common/utils").Selector<IntegrationSelectorState, import("./types.js").PresetEmbeddedView | null>;
13
22
  selectRecipeEmbeddedState: import("@salsita-ai/common/utils").Selector<IntegrationSelectorState, import("./types.js").RecipeEmbeddedView | null>;
14
- getAdminIntegrationService: () => import("./admin-integration-service.js").AdminIntegrationService;
23
+ getAdminIntegrationService: () => AdminIntegrationService;
15
24
  getIntegrationState: () => IntegrationState;
16
25
  getEmbeddedView: () => import("./types.js").EmbeddedView;
17
26
  getPresetEmbeddedState: () => import("./types.js").PresetEmbeddedView | null;
@@ -1 +1 @@
1
- import{createSelector as e}from"@salsita-ai/common/utils";export const createIntegrationSelectors=t=>{let{getState:i}=t,n=e.withTypes(),r=n.leaf(e=>e.integration.adminIntegrationService),a=n.leaf(e=>e.integration),d=n.leaf(e=>e.integration.embeddedView),o=n([d],e=>e?.type==="recipe"?e:null),g=n([d],e=>e?.type==="preset"?e:null);return{selectAdminIntegrationService:r,selectIntegrationState:a,selectEmbeddedView:d,selectPresetEmbeddedState:g,selectRecipeEmbeddedState:o,getAdminIntegrationService:()=>r(i()),getIntegrationState:()=>a(i()),getEmbeddedView:()=>d(i()),getPresetEmbeddedState:()=>g(i()),getRecipeEmbeddedState:()=>o(i())}};
1
+ import{createSelector as e}from"@salsita-ai/common/utils";import{AdminIntegrationService as t}from"./admin-integration-service.js";export const createIntegrationSelectors=i=>{let{getState:n,actions:r}=i,a=e.withTypes(),o=new t({actions:r}),d=a.leaf(e=>e.integration),m=a.leaf(e=>e.integration.embeddedView),g=a([m],e=>e?.type==="recipe"?e:null),l=a([m],e=>e?.type==="preset"?e:null);return{selectIntegrationState:d,selectEmbeddedView:m,selectPresetEmbeddedState:l,selectRecipeEmbeddedState:g,getAdminIntegrationService:()=>o,getIntegrationState:()=>d(n()),getEmbeddedView:()=>m(n()),getPresetEmbeddedState:()=>l(n()),getRecipeEmbeddedState:()=>g(n())}};
@@ -1,5 +1,4 @@
1
1
  import type { DomainEntityId, Preset, Recipe } from '#package/domain';
2
- import type { AdminIntegrationService } from './admin-integration-service.js';
3
2
  export interface PresetEmbeddedView {
4
3
  readonly type: 'preset';
5
4
  readonly presetId: Preset['id'];
@@ -11,7 +10,11 @@ export interface RecipeEmbeddedView {
11
10
  readonly rootRecipeId?: DomainEntityId<string>;
12
11
  }
13
12
  export type EmbeddedView = PresetEmbeddedView | RecipeEmbeddedView | null;
13
+ /**
14
+ * The integration slice's state, as the runtime state and `useIntegrationState()` hold it. The admin
15
+ * integration service is not part of it: the integration selectors own it, and
16
+ * `getAdminIntegrationService()` returns it.
17
+ */
14
18
  export interface IntegrationState {
15
- readonly adminIntegrationService: AdminIntegrationService;
16
19
  readonly embeddedView: EmbeddedView;
17
20
  }
@@ -0,0 +1,45 @@
1
+ import type { DomainApplicationType } from '#package/domain';
2
+ import type { LoadingPhase, LoadingRuntimeState } from './types.js';
3
+ interface Context {
4
+ readonly setLoading: (fn: (state: LoadingRuntimeState) => LoadingRuntimeState) => void;
5
+ }
6
+ /**
7
+ * Every action returns the slice unchanged when the value is already set, so the runtime publishes
8
+ * nothing and no subscriber recomputes.
9
+ */
10
+ declare const createApplicationActions: (context: Context, applicationType: DomainApplicationType) => {
11
+ startPhase: (phase: LoadingPhase) => void;
12
+ endPhase: (id: string) => void;
13
+ reportError: () => void;
14
+ clearError: () => void;
15
+ expectPhase: (id: string) => void;
16
+ dropExpectation: (id: string) => void;
17
+ resetSlot: () => void;
18
+ };
19
+ /** One set of actions per application, as the domain context keys its own. */
20
+ export declare const createLoadingActions: (context: Context) => {
21
+ configurator: {
22
+ startPhase: (phase: LoadingPhase) => void;
23
+ endPhase: (id: string) => void;
24
+ reportError: () => void;
25
+ clearError: () => void;
26
+ expectPhase: (id: string) => void;
27
+ dropExpectation: (id: string) => void;
28
+ resetSlot: () => void;
29
+ };
30
+ admin: {
31
+ startPhase: (phase: LoadingPhase) => void;
32
+ endPhase: (id: string) => void;
33
+ reportError: () => void;
34
+ clearError: () => void;
35
+ expectPhase: (id: string) => void;
36
+ dropExpectation: (id: string) => void;
37
+ resetSlot: () => void;
38
+ };
39
+ };
40
+ /**
41
+ * @internal Runtime plumbing for the SDK's own UI. A project reports a phase with
42
+ * `phx.frontend.useLoadingState()`.
43
+ */
44
+ export type LoadingActions = ReturnType<typeof createApplicationActions>;
45
+ export {};
@@ -0,0 +1 @@
1
+ import{initializeLoadingApplication as e}from"./initialize.js";let t=(e,t)=>e.has(t)?e:new Set([...e,t]),s=(s,r)=>{let a=e=>{s.setLoading(t=>{let s=t[r],a=e(s);return a===s?t:{...t,[r]:a}})},n=e=>{a(t=>t.hasError===e?t:{...t,hasError:e})};return{startPhase:e=>{a(s=>{let r=((e,t)=>{let s=e.findIndex(e=>e.id===t.id);if(-1===s)return[...e,t];let r=e[s];return void 0!==r&&r.id===t.id&&r.progress===t.progress&&r.label===t.label?e:e.map(e=>e.id===t.id?t:e)})(s.phases,e),a=t(s.seenPhaseIds,e.id);return r===s.phases&&a===s.seenPhaseIds?s:{...s,phases:r,seenPhaseIds:a}})},endPhase:e=>{a(t=>t.phases.some(t=>t.id===e)?{...t,phases:t.phases.filter(t=>t.id!==e)}:t)},reportError:()=>{n(!0)},clearError:()=>{n(!1)},expectPhase:e=>{a(s=>{let r=s.expectationCounts.get(e)??0,a=new Map(s.expectationCounts).set(e,r+1);return{...s,expectationCounts:a,expectedPhaseIds:t(s.expectedPhaseIds,e)}})},dropExpectation:e=>{a(t=>{let s=t.expectationCounts.get(e);if(void 0===s)return t;let r=new Map(t.expectationCounts);return s>1?(r.set(e,s-1),{...t,expectationCounts:r}):(r.delete(e),{...t,expectationCounts:r,expectedPhaseIds:((e,t)=>{if(!e.has(t))return e;let s=new Set(e);return s.delete(t),s})(t.expectedPhaseIds,e)})})},resetSlot:()=>{a(t=>0!==t.phases.length||t.hasError||0!==t.expectedPhaseIds.size||0!==t.seenPhaseIds.size?e():t)}}};export const createLoadingActions=e=>({configurator:s(e,"configurator"),admin:s(e,"admin")});
@@ -0,0 +1,4 @@
1
+ export * from './actions.js';
2
+ export * from './initialize.js';
3
+ export * from './selectors.js';
4
+ export type * from './types.js';
@@ -0,0 +1 @@
1
+ export*from"./actions.js";export*from"./initialize.js";export*from"./selectors.js";
@@ -0,0 +1,3 @@
1
+ import type { LoadingApplicationState, LoadingRuntimeState } from './types.js';
2
+ export declare const initializeLoadingApplication: () => LoadingApplicationState;
3
+ export declare const initializeLoading: () => LoadingRuntimeState;
@@ -0,0 +1 @@
1
+ export const initializeLoadingApplication=()=>({phases:[],hasError:!1,expectedPhaseIds:new Set,expectationCounts:new Map,seenPhaseIds:new Set});export const initializeLoading=()=>({configurator:initializeLoadingApplication(),admin:initializeLoadingApplication()});
@@ -0,0 +1,18 @@
1
+ import type { DomainApplicationType } from '#package/domain';
2
+ import type { LoadingRuntimeState, LoadingState } from './types.js';
3
+ export interface LoadingSelectorState {
4
+ readonly loading: LoadingRuntimeState;
5
+ }
6
+ interface Context {
7
+ readonly getState: () => LoadingSelectorState;
8
+ readonly applicationType: DomainApplicationType;
9
+ }
10
+ /** The selectors of one application's loading state; the runtime creates one set per application. */
11
+ export declare const createLoadingSelectors: (context: Context) => {
12
+ selectLoadingState: import("@salsita-ai/common/utils").Selector<LoadingSelectorState, LoadingState>;
13
+ getLoadingState: () => LoadingState;
14
+ /** Whether the phase `id` is expected and has not started since the last reset. */
15
+ getIsAwaitingPhase: (id: string) => boolean;
16
+ };
17
+ export type LoadingSelectors = ReturnType<typeof createLoadingSelectors>;
18
+ export {};
@@ -0,0 +1 @@
1
+ import{createSelector as e}from"@salsita-ai/common/utils";export const createLoadingSelectors=a=>{let{getState:s,applicationType:t}=a,i=e.withTypes(),o=i.leaf(e=>e.loading[t].phases),l=i.leaf(e=>e.loading[t].hasError),n=i.leaf(e=>e.loading[t].expectedPhaseIds),r=i.leaf(e=>e.loading[t].seenPhaseIds),g=i([o,l,n],(e,a,s)=>({isLoading:e.length>0,hasError:a,phases:e,expectedPhaseIds:s}));return{selectLoadingState:g,getLoadingState:()=>g(s()),getIsAwaitingPhase:e=>{let a=s();return n(a).has(e)&&!r(a).has(e)}}};
@@ -0,0 +1,59 @@
1
+ /**
2
+ * One step of an application's load that the loader shows while it runs: authenticating the
3
+ * session, fetching data, loading the 3D scene, or a step a project reports itself.
4
+ */
5
+ export interface LoadingPhase {
6
+ readonly id: string;
7
+ /** From 0 to 1, when the step can tell how far it is. */
8
+ readonly progress?: number;
9
+ readonly label?: string;
10
+ }
11
+ /**
12
+ * The aggregated loading state the loader renders: the running phases in the order they started,
13
+ * and whether the load failed.
14
+ */
15
+ export interface LoadingState {
16
+ /** `true` while at least one phase runs. */
17
+ readonly isLoading: boolean;
18
+ readonly hasError: boolean;
19
+ readonly phases: readonly LoadingPhase[];
20
+ /** The phases the loader waits for before they start, so it does not flash off in between. */
21
+ readonly expectedPhaseIds: ReadonlySet<string>;
22
+ }
23
+ /**
24
+ * The loading state of one application.
25
+ *
26
+ * The loader host resets it when it mounts, which happens when the configurator is powered on or
27
+ * remounted; phases written before that are not shown. Whether a component is below the loader
28
+ * host is not part of it: that is a fact about the React tree, read with `useIsLoaderHosted()`.
29
+ *
30
+ * @internal Runtime plumbing for the SDK's own UI. A project reads the loading state with
31
+ * `phx.frontend.useLoadingStateValue()` and reports a phase with `phx.frontend.useLoadingState()`.
32
+ */
33
+ export interface LoadingApplicationState {
34
+ /** The running phases, in the order they started. Restarting a phase keeps its position. */
35
+ readonly phases: readonly LoadingPhase[];
36
+ readonly hasError: boolean;
37
+ readonly expectedPhaseIds: ReadonlySet<string>;
38
+ /**
39
+ * How many callers expect each phase of `expectedPhaseIds`: the components that mount the canvas
40
+ * nest, and an inner one unmounting must not drop the phase an outer one still expects.
41
+ */
42
+ readonly expectationCounts: ReadonlyMap<string, number>;
43
+ /**
44
+ * Every phase that started since the last reset. An expected phase that was seen once is no
45
+ * longer waited for, so a second configuration does not wait for the scene again.
46
+ */
47
+ readonly seenPhaseIds: ReadonlySet<string>;
48
+ }
49
+ /**
50
+ * The `loading` slice, one entry per application: an admin that embeds a configurator runs both in
51
+ * one runtime, and only the configurator hosts a loader.
52
+ *
53
+ * @internal Runtime plumbing for the SDK's own UI. A project reads the loading state with
54
+ * `phx.frontend.useLoadingStateValue()` and reports a phase with `phx.frontend.useLoadingState()`.
55
+ */
56
+ export interface LoadingRuntimeState {
57
+ readonly configurator: LoadingApplicationState;
58
+ readonly admin: LoadingApplicationState;
59
+ }
@@ -1 +1 @@
1
- import{memoOnce as e}from"@salsita-ai/common/utils";import{AccessLevel as t}from"@salsita-ai/contracts/api";import{createDomainRuntime as o,createMockDomainRuntimeServices as n,createMockSessionContext as s}from"#package/domain";import{createCommonServicesSelectors as i}from"../common-services/index.js";import{createDomainApplicationContextSelectors as a}from"../domain-application-context/index.js";import{createIntegrationActions as r,createIntegrationSelectors as c,initializeIntegration as m}from"../integration/index.js";import{createRoutingActions as d,createRoutingSelectors as p,initializeRouting as l}from"../routing/index.js";import{SessionService as S,createSessionRuntimeActions as g,createSessionRuntimeSelectors as v,initializeSessionRuntime as u}from"../session/index.js";import{createMockWebComponentApi as f}from"../web-component/index.js";export const createMockApplicationRuntime=(C,x)=>{var b;let w,y,A,D,k,E,I,R,h,j,O,T,L,F,M,{sessionData:U,mode:V,role:z}=x,q=n(),B=(b={webComponentOptions:x.webComponentOptions??C.mount.options,webComponentApi:x.webComponentApi??f()},A=u(),D=o({config:C,services:q,getExtensionSystems:e=>M[e].getInitializableSystems()}),k=new Set,E=()=>{k.forEach(e=>{e()})},w=m({actions:I=r({setIntegration:e=>{w=e(w),E()}})}),R=c({getState:()=>({integration:w})}),h=d({setRouting:e=>{y=e(y),E()}}),y=l(),j=p({getState:()=>({...D.getState(),routing:y}),actions:h,accessActions:D.actions.access,loadedDataActions:D.actions.loadedData,domainServicesSelectors:D.selectors.domainServices,overridesSelectors:D.selectors.overrides}),O=i({getState:()=>({...D.getState(),session:A}),environmentSelectors:D.selectors.environment,specSelectors:D.selectors.spec,accessSelectors:D.selectors.access,domainServicesSelectors:D.selectors.domainServices,webComponentOptions:b.webComponentOptions,webComponentApi:b.webComponentApi,getSessionService:()=>F(),routingSelectors:j}),T=g({setSessionRuntime:e=>{A=e(A),E()}}),L=v({getState:()=>({...D.getState(),session:A}),sessionContextSelectors:D.selectors.sessionContext}),F=e(()=>new S({getLogger:()=>D.selectors.domainServices.getLogger(),getAnalyticsService:()=>D.selectors.domainServices.getAnalyticsService(),getUnauthenticatedClient:O.getUnauthenticatedClient,environmentSelectors:D.selectors.environment,sessionActions:T,setSessionContext:D.actions.sessionContext.setSessionContext,sessionSelectors:L,specSelectors:D.selectors.spec})),M={configurator:a({applicationType:"configurator",commonServicesSelectors:O,domainServicesSelectors:D.selectors.domainServices,domainContextSelectors:D.selectors.domainContext.configurator,getApplicationRuntimeExtensions:()=>[]}),admin:a({applicationType:"admin",commonServicesSelectors:O,domainServicesSelectors:D.selectors.domainServices,domainContextSelectors:D.selectors.domainContext.admin,getApplicationRuntimeExtensions:()=>[]})},{subscribe:e=>{k.add(e);let t=D.subscribe(e);return()=>{k.delete(e),t()}},getState:()=>({...D.getState(),integration:w,routing:y,session:A}),selectors:{...D.selectors,commonServices:O,integration:R,routing:j,session:L,domainApplicationContext:M},actions:{...D.actions,integration:I,routing:h,session:T}}),G=B.getState().spec;return B.actions.spec.updateSpec({...G,configurator:{...G.configurator,createTransformers:e=>x.transformers.map(t=>t.transformer.register(e,t.priority??1/0))}}),B.actions.sessionContext.setSessionContext(s(z,U)),B.actions.access.setConfiguratorAccessInfo({raw:"mock-access-token",access:"read"===V?t.Read:t.Owner,viewMode:"read"===V,revisionId:void 0,configurationId:"mock"}),B.actions.domainData.setDomainData({publishedData:x.publishedData,frontendData:x.frontendData,backendData:x.backendData}),B.actions.loadedData.completeConfiguratorLoad({initialRevisionId:"mock-revision",initialEntities:x.entities,modelVersion:C.domain.domainFactory.modelVersion,rootEntityType:x.rootEntityType,schemaIdentity:C.domain.domainFactory}),B};
1
+ import{memoOnce as e}from"@salsita-ai/common/utils";import{AccessLevel as t}from"@salsita-ai/contracts/api";import{createDomainRuntime as o,createMockDomainRuntimeServices as i,createMockSessionContext as n}from"#package/domain";import{createCommonServicesSelectors as s}from"../common-services/index.js";import{createDomainApplicationContextSelectors as a}from"../domain-application-context/index.js";import{createIntegrationActions as r,createIntegrationSelectors as c,initializeIntegration as m}from"../integration/index.js";import{createLoadingActions as p,createLoadingSelectors as d,initializeLoading as l}from"../loading/index.js";import{createResponsiveActions as g,createResponsiveSelectors as S,initializeResponsive as v}from"../responsive/index.js";import{createRoutingActions as f,createRoutingSelectors as u,initializeRouting as x}from"../routing/index.js";import{SessionService as C,createSessionRuntimeActions as b,createSessionRuntimeSelectors as y,initializeSessionRuntime as w}from"../session/index.js";import{createMockWebComponentApi as A}from"../web-component/index.js";export const createMockApplicationRuntime=(D,T)=>{var j;let k,R,E,I,h,O,L,F,M,U,V,z,q,B,G,H,J,K,N,P,Q,{sessionData:W,mode:X,role:Y}=T,Z=i(),$=(j={webComponentOptions:T.webComponentOptions??D.mount.options,webComponentApi:T.webComponentApi??A()},E=w(),I=o({config:D,services:Z,getExtensionSystems:e=>Q[e].getInitializableSystems()}),h=new Set,O=()=>{h.forEach(e=>{e()})},L=r({setIntegration:e=>{k=e(k),O()}}),k=m(),F=c({getState:()=>({integration:k}),actions:L}),M=f({setRouting:e=>{R=e(R),O()}}),R=x(),U=u({getState:()=>({...I.getState(),routing:R}),actions:M,accessActions:I.actions.access,loadedDataActions:I.actions.loadedData,domainServicesSelectors:I.selectors.domainServices,overridesSelectors:I.selectors.overrides}),V=v(),z=g({setResponsive:e=>{let t=e(V);t!==V&&(V=t,O())}}),q={configurator:S({getState:()=>({responsive:V}),applicationType:"configurator"}),admin:S({getState:()=>({responsive:V}),applicationType:"admin"})},B=l(),G=p({setLoading:e=>{let t=e(B);t!==B&&(B=t,O())}}),H={configurator:d({getState:()=>({loading:B}),applicationType:"configurator"}),admin:d({getState:()=>({loading:B}),applicationType:"admin"})},J=s({getState:()=>({...I.getState(),session:E}),environmentSelectors:I.selectors.environment,specSelectors:I.selectors.spec,accessSelectors:I.selectors.access,domainServicesSelectors:I.selectors.domainServices,webComponentOptions:j.webComponentOptions,webComponentApi:j.webComponentApi,getSessionService:()=>P(),routingSelectors:U}),K=b({setSessionRuntime:e=>{E=e(E),O()}}),N=y({getState:()=>({...I.getState(),session:E}),sessionContextSelectors:I.selectors.sessionContext}),P=e(()=>new C({getLogger:()=>I.selectors.domainServices.getLogger(),getAnalyticsService:()=>I.selectors.domainServices.getAnalyticsService(),getUnauthenticatedClient:J.getUnauthenticatedClient,environmentSelectors:I.selectors.environment,sessionActions:K,setSessionContext:I.actions.sessionContext.setSessionContext,sessionSelectors:N,specSelectors:I.selectors.spec})),Q={configurator:a({applicationType:"configurator",commonServicesSelectors:J,domainServicesSelectors:I.selectors.domainServices,domainContextSelectors:I.selectors.domainContext.configurator,getApplicationRuntimeExtensions:()=>[]}),admin:a({applicationType:"admin",commonServicesSelectors:J,domainServicesSelectors:I.selectors.domainServices,domainContextSelectors:I.selectors.domainContext.admin,getApplicationRuntimeExtensions:()=>[]})},{subscribe:e=>{h.add(e);let t=I.subscribe(e);return()=>{h.delete(e),t()}},getState:()=>({...I.getState(),integration:k,loading:B,responsive:V,routing:R,session:E}),selectors:{...I.selectors,commonServices:J,integration:F,loading:H,responsive:q,routing:U,session:N,domainApplicationContext:Q},actions:{...I.actions,integration:L,loading:G,responsive:z,routing:M,session:K}}),_=$.getState().spec;return $.actions.spec.updateSpec({..._,configurator:{..._.configurator,createTransformers:e=>T.transformers.map(t=>t.transformer.register(e,t.priority??1/0))}}),$.actions.sessionContext.setSessionContext(n(Y,W)),$.actions.access.setConfiguratorAccessInfo({raw:"mock-access-token",access:"read"===X?t.Read:t.Owner,viewMode:"read"===X,revisionId:void 0,configurationId:"mock"}),$.actions.domainData.setDomainData({publishedData:T.publishedData,frontendData:T.frontendData,backendData:T.backendData}),$.actions.loadedData.completeConfiguratorLoad({initialRevisionId:"mock-revision",initialEntities:T.entities,modelVersion:D.domain.domainFactory.modelVersion,rootEntityType:T.rootEntityType,schemaIdentity:D.domain.domainFactory}),$};
@@ -5,5 +5,11 @@ interface ApplicationRuntimeProviderProps {
5
5
  readonly runtime: ApplicationRuntime;
6
6
  }
7
7
  export declare const ApplicationRuntimeProvider: (props: ApplicationRuntimeProviderProps) => import("react/jsx-runtime").JSX.Element;
8
+ /**
9
+ * The runtime, or `null` outside an `ApplicationRuntimeProvider`, for hooks that must work without one.
10
+ *
11
+ * @internal Runtime plumbing for the SDK's own UI.
12
+ */
13
+ export declare const useOptionalApplicationRuntime: () => ApplicationRuntime | null;
8
14
  export declare const useApplicationRuntime: () => ApplicationRuntime;
9
15
  export {};
@@ -1 +1 @@
1
- import{jsx as t}from"react/jsx-runtime";import{createContext as e,useContext as i}from"react";let r=e(null);export const ApplicationRuntimeProvider=e=>{let{children:i,runtime:o}=e;return t(r.Provider,{value:o,children:i})};export const useApplicationRuntime=()=>{let t=i(r);if(!t)throw Error("ApplicationRuntime context not found! useApplicationRuntime() must be used within an ApplicationRuntimeProvider. Use the hook appropriately.");return t};
1
+ import{jsx as t}from"react/jsx-runtime";import{createContext as e,useContext as i}from"react";let o=e(null);export const ApplicationRuntimeProvider=e=>{let{children:i,runtime:r}=e;return t(o.Provider,{value:r,children:i})};export const useOptionalApplicationRuntime=()=>i(o);export const useApplicationRuntime=()=>{let t=i(o);if(!t)throw Error("ApplicationRuntime context not found! useApplicationRuntime() must be used within an ApplicationRuntimeProvider. Use the hook appropriately.");return t};
@@ -6,4 +6,11 @@ interface ApplicationTypeProviderProps {
6
6
  }
7
7
  export declare const ApplicationTypeProvider: (props: ApplicationTypeProviderProps) => import("react/jsx-runtime").JSX.Element;
8
8
  export declare const useApplicationType: () => ApplicationType;
9
+ /**
10
+ * The application type of the nearest `ApplicationTypeProvider`, or `null` outside one, for the
11
+ * hooks that some application-agnostic providers call and that have nothing to do there.
12
+ *
13
+ * @internal Runtime plumbing for the SDK's own UI.
14
+ */
15
+ export declare const useOptionalApplicationType: () => ApplicationType | null;
9
16
  export {};