@salsita-ai/sdk 0.50.0-develop.c4848d224b → 0.50.0-develop.ca5894b56c

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 (711) hide show
  1. package/README.md +1 -1
  2. package/dist/application/index.d.ts +1 -0
  3. package/dist/application/index.js +1 -1
  4. package/dist/application/mount-application.d.ts +1 -1
  5. package/dist/application/mount-application.js +1 -1
  6. package/dist/application/mount-configurator.d.ts +19 -0
  7. package/dist/application/mount-configurator.js +1 -0
  8. package/dist/application/mounted-application-runtime.d.ts +4 -0
  9. package/dist/application/mounted-application-runtime.js +1 -0
  10. package/dist/application/register-web-component.d.ts +2 -0
  11. package/dist/application/register-web-component.js +1 -0
  12. package/dist/application-spec/core/enhanced-json-value.d.ts +2 -31
  13. package/dist/application-spec/core/enhanced-json-value.js +1 -1
  14. package/dist/application-spec/core/index.d.ts +1 -3
  15. package/dist/application-spec/core/index.js +1 -1
  16. package/dist/application-spec/core/json-schema.d.ts +2 -52
  17. package/dist/application-spec/core/markers/index.d.ts +1 -1
  18. package/dist/application-spec/core/markers/index.js +1 -1
  19. package/dist/application-spec/core/markers/msg-marker.d.ts +2 -28
  20. package/dist/application-spec/core/markers/msg-marker.js +1 -1
  21. package/dist/application-spec/core/markers/raw-eval-write-marker.d.ts +1 -1
  22. package/dist/application-spec/core/markers/raw-eval-write-marker.js +1 -1
  23. package/dist/application-spec/core/markers/raw-read-write-marker.js +1 -1
  24. package/dist/application-spec/errors/diagnostic-codes.d.ts +10 -0
  25. package/dist/application-spec/errors/diagnostic-codes.js +1 -1
  26. package/dist/application-spec/errors/diagnostic-messages.d.ts +11 -1
  27. package/dist/application-spec/errors/diagnostic-messages.js +1 -1
  28. package/dist/application-spec/generate-application/code/domain-runtime-files.js +1 -1
  29. package/dist/application-spec/generate-application/code/project-scaffolding.js +2 -2
  30. package/dist/application-spec/generate-application/code/templates/application-types.js +6 -6
  31. package/dist/application-spec/generate-application/code/templates/common/doc-comment.d.ts +2 -0
  32. package/dist/application-spec/generate-application/code/templates/common/doc-comment.js +1 -0
  33. package/dist/application-spec/generate-application/code/templates/configurator-globals.d.ts +2 -1
  34. package/dist/application-spec/generate-application/code/templates/configurator-globals.js +19 -6
  35. package/dist/application-spec/generate-application/code/templates/global-definition/generate-action-types.js +7 -7
  36. package/dist/application-spec/generate-application/code/templates/global-definition/generate-assistant-form-element-types.d.ts +12 -0
  37. package/dist/application-spec/generate-application/code/templates/global-definition/generate-assistant-form-element-types.js +7 -0
  38. package/dist/application-spec/generate-application/code/templates/global-definition/generate-phx-types.js +24 -22
  39. package/dist/application-spec/generate-application/code/templates/global-definition/index.d.ts +1 -0
  40. package/dist/application-spec/generate-application/code/templates/global-definition/index.js +1 -1
  41. package/dist/application-spec/generate-application/code/templates/index.d.ts +2 -6
  42. package/dist/application-spec/generate-application/code/templates/index.js +1 -1
  43. package/dist/application-spec/generate-application/code/templates/skills/phoenix-skill-bundle.d.ts +10 -0
  44. package/dist/application-spec/generate-application/code/templates/skills/phoenix-skill-bundle.js +7 -0
  45. package/dist/application-spec/generate-application/code/templates/skills/phoenix-skill.js +1 -1
  46. package/dist/application-spec/generate-application/code/templates/skills/sdk-content.d.ts +14 -7
  47. package/dist/application-spec/generate-application/code/templates/skills/sdk-content.js +2 -2
  48. package/dist/application-spec/generate-application/implementations/phx-application-types.d.ts +25 -0
  49. package/dist/application-spec/generate-application/implementations/phx-application-types.js +1 -0
  50. package/dist/application-spec/generate-application/implementations/phx-domain.d.ts +36 -0
  51. package/dist/application-spec/generate-application/implementations/phx-domain.js +1 -0
  52. package/dist/application-spec/generate-application/implementations/phx-model.d.ts +24 -0
  53. package/dist/application-spec/generate-application/implementations/phx-model.js +1 -0
  54. package/dist/application-spec/generate-application/implementations/phx.d.ts +22 -0
  55. package/dist/application-spec/generate-application/implementations/phx.js +1 -0
  56. package/dist/application-spec/generate-application/index.d.ts +2 -0
  57. package/dist/application-spec/generate-application/index.js +1 -1
  58. package/dist/application-spec/generate-application/runtime/admin-runtime/admin-model-runtime.d.ts +3 -3
  59. package/dist/application-spec/generate-application/runtime/admin-runtime/admin-runtime.d.ts +7 -4
  60. package/dist/application-spec/generate-application/runtime/admin-runtime/admin-runtime.js +1 -1
  61. package/dist/application-spec/generate-application/runtime/admin-runtime/admin-spec-runtime.d.ts +16 -0
  62. package/dist/application-spec/generate-application/runtime/admin-runtime/admin-spec-runtime.js +1 -0
  63. package/dist/application-spec/generate-application/runtime/application-runtime.d.ts +17 -4
  64. package/dist/application-spec/generate-application/runtime/application-runtime.js +1 -1
  65. package/dist/application-spec/generate-application/runtime/application-spec-slice.d.ts +71 -0
  66. package/dist/application-spec/generate-application/runtime/application-spec-slice.js +1 -0
  67. package/dist/application-spec/generate-application/runtime/configurator-runtime/configurator-model-runtime.d.ts +3 -3
  68. package/dist/application-spec/generate-application/runtime/configurator-runtime/configurator-runtime.d.ts +7 -5
  69. package/dist/application-spec/generate-application/runtime/configurator-runtime/configurator-runtime.js +1 -1
  70. package/dist/application-spec/generate-application/runtime/configurator-runtime/configurator-spec-runtime.d.ts +16 -0
  71. package/dist/application-spec/generate-application/runtime/configurator-runtime/configurator-spec-runtime.js +1 -0
  72. package/dist/application-spec/generate-application/runtime/create-application.d.ts +57 -0
  73. package/dist/application-spec/generate-application/runtime/create-application.js +1 -0
  74. package/dist/application-spec/generate-application/runtime/factory-data/factory-data-runtime.d.ts +2 -2
  75. package/dist/application-spec/generate-application/runtime/factory-data/recipe-defaults.d.ts +1 -1
  76. package/dist/application-spec/generate-application/runtime/factory-data/recipe-defaults.js +1 -1
  77. package/dist/application-spec/generate-application/runtime/factory-data/static-violations.d.ts +1 -1
  78. package/dist/application-spec/generate-application/runtime/factory-data/static-violations.js +1 -1
  79. package/dist/application-spec/generate-application/runtime/generate-runtime-instance.d.ts +1 -1
  80. package/dist/application-spec/generate-application/runtime/generate-runtime-instance.js +1 -1
  81. package/dist/application-spec/generate-application/runtime/index.d.ts +8 -0
  82. package/dist/application-spec/generate-application/runtime/index.js +1 -0
  83. package/dist/application-spec/generate-application/runtime/sections/build-sdk-optic.js +1 -1
  84. package/dist/application-spec/generate-application/runtime/sections/expression-runtime.d.ts +9 -3
  85. package/dist/application-spec/generate-application/runtime/sections/expression-runtime.js +1 -1
  86. package/dist/application-spec/generate-application/runtime/sections/generate-memo-eval-plan-runtime.d.ts +1 -1
  87. package/dist/application-spec/generate-application/runtime/sections/generate-memo-eval-plan-runtime.js +1 -1
  88. package/dist/application-spec/generate-application/runtime/sections/preset-runtime.d.ts +2 -3
  89. package/dist/application-spec/generate-application/runtime/sections/reflection-constants-runtime.d.ts +2 -1
  90. package/dist/application-spec/generate-application/runtime/spec-code/resolve-spec-code.d.ts +1 -1
  91. package/dist/application-spec/generate-application/runtime/spec-runtime.d.ts +21 -0
  92. package/dist/application-spec/generate-application/runtime/spec-runtime.js +1 -0
  93. package/dist/application-spec/generate-application/runtime-spec/encoded-runtime-spec.d.ts +3 -2
  94. package/dist/application-spec/generate-application/runtime-spec/runtime-spec.d.ts +44 -9
  95. package/dist/application-spec/generate-application/runtime-spec/runtime-spec.js +1 -1
  96. package/dist/application-spec/parse-application-files/parse-application-files.js +1 -1
  97. package/dist/application-spec/parse-application-files/raw-spec/raw-assistant.d.ts +33 -3
  98. package/dist/application-spec/parse-application-files/raw-spec/raw-assistant.js +1 -1
  99. package/dist/application-spec/parse-application-files/raw-spec/raw-expressions.d.ts +1 -1
  100. package/dist/application-spec/parse-application-files/raw-spec/raw-expressions.js +1 -1
  101. package/dist/application-spec/parse-application-files/spec/model/aliases.d.ts +3 -9
  102. package/dist/application-spec/parse-application-files/spec/model/common-types.d.ts +6 -14
  103. package/dist/application-spec/parse-application-files/spec/model/defaults.d.ts +6 -31
  104. package/dist/application-spec/parse-application-files/spec/model/entity-types.d.ts +3 -8
  105. package/dist/application-spec/parse-application-files/spec/model/model-version-key.d.ts +3 -3
  106. package/dist/application-spec/parse-application-files/spec/model/names/action-name.d.ts +3 -7
  107. package/dist/application-spec/parse-application-files/spec/model/names/alias-name.d.ts +3 -7
  108. package/dist/application-spec/parse-application-files/spec/model/names/entity-or-alias-name.d.ts +3 -8
  109. package/dist/application-spec/parse-application-files/spec/model/names/entity-type-name.d.ts +3 -8
  110. package/dist/application-spec/parse-application-files/spec/model/names/expression-name.d.ts +3 -6
  111. package/dist/application-spec/parse-application-files/spec/model/names/instance-name.d.ts +3 -7
  112. package/dist/application-spec/parse-application-files/spec/model/names/invariant-name.d.ts +3 -3
  113. package/dist/application-spec/parse-application-files/spec/model/names/shape-property-name.d.ts +3 -11
  114. package/dist/application-spec/parse-application-files/spec/model/names/violation-type-name.d.ts +3 -3
  115. package/dist/application-spec/parse-application-files/spec/model/presets.d.ts +6 -29
  116. package/dist/application-spec/parse-application-files/spec/sections/assistant/assistant-form-elements.d.ts +9 -0
  117. package/dist/application-spec/parse-application-files/spec/sections/assistant/assistant-form-elements.js +1 -0
  118. package/dist/application-spec/parse-application-files/spec/sections/assistant/assistant-schema.d.ts +4 -1
  119. package/dist/application-spec/parse-application-files/spec/sections/assistant/assistant-schema.js +1 -1
  120. package/dist/client/authorized-client.d.ts +3 -1
  121. package/dist/client/authorized-client.js +1 -1
  122. package/dist/client/contract.d.ts +17 -0
  123. package/dist/client/index.d.ts +1 -1
  124. package/dist/client/local-authorized-client.d.ts +3 -1
  125. package/dist/client/local-authorized-client.js +1 -1
  126. package/dist/client/memory-authorized-client.d.ts +4 -1
  127. package/dist/client/memory-authorized-client.js +1 -1
  128. package/dist/client/phoenix-api.d.ts +228 -0
  129. package/dist/configurator/ConfiguratorApp.js +1 -1
  130. package/dist/configurator/app-loader-content/index.d.ts +0 -1
  131. package/dist/configurator/app-loader-content/index.js +1 -1
  132. package/dist/configurator/application-runtime/extensions/selectors.js +1 -1
  133. package/dist/configurator/application-runtime/extensions/systems/assistant-system/assistant-system.d.ts +17 -3
  134. package/dist/configurator/application-runtime/extensions/systems/assistant-system/assistant-system.js +1 -1
  135. package/dist/configurator/application-runtime/extensions/systems/assistant-system/graphql-tools.d.ts +34 -7
  136. package/dist/configurator/application-runtime/extensions/systems/assistant-system/graphql-tools.js +1 -1
  137. package/dist/configurator/application-runtime/extensions/systems/canvas-system.d.ts +8 -0
  138. package/dist/configurator/application-runtime/extensions/systems/canvas-system.js +1 -1
  139. package/dist/configurator/application-runtime/extensions/systems/export-system/export-busy-error.d.ts +8 -0
  140. package/dist/configurator/application-runtime/extensions/systems/export-system/export-busy-error.js +1 -0
  141. package/dist/configurator/application-runtime/extensions/systems/export-system/export-system.d.ts +23 -1
  142. package/dist/configurator/application-runtime/extensions/systems/export-system/export-system.js +1 -1
  143. package/dist/configurator/application-runtime/extensions/systems/graphql-system/entity-meta.d.ts +14 -1
  144. package/dist/configurator/application-runtime/extensions/systems/graphql-system/entity-meta.js +1 -1
  145. package/dist/configurator/application-runtime/extensions/systems/graphql-system/graphql-system.d.ts +51 -4
  146. package/dist/configurator/application-runtime/extensions/systems/graphql-system/graphql-system.js +1 -1
  147. package/dist/configurator/application-runtime/extensions/systems/image-rendering-system/image-rendering-system.d.ts +14 -5
  148. package/dist/configurator/application-runtime/extensions/systems/image-rendering-system/image-rendering-system.js +1 -1
  149. package/dist/configurator/application-runtime/extensions/systems/index.d.ts +1 -1
  150. package/dist/configurator/common/configurator-interface.d.ts +15 -7
  151. package/dist/configurator/common/configurator-interface.js +1 -1
  152. package/dist/configurator/configuration-not-found-page/BuiltInConfigurationNotFoundPage.d.ts +5 -0
  153. package/dist/configurator/configuration-not-found-page/BuiltInConfigurationNotFoundPage.js +1 -0
  154. package/dist/configurator/configuration-not-found-page/ConfigurationNotFoundPageElement.d.ts +0 -6
  155. package/dist/configurator/configuration-not-found-page/ConfigurationNotFoundPageElement.js +1 -1
  156. package/dist/configurator/configuration-not-found-page/index.d.ts +2 -2
  157. package/dist/configurator/configuration-not-found-page/index.js +1 -1
  158. package/dist/configurator/configurator-context/ConfiguratorDataProvider.js +1 -1
  159. package/dist/configurator/configurator-context/ConfiguratorResponsiveProvider.d.ts +3 -3
  160. package/dist/configurator/configurator-context/ConfiguratorResponsiveProvider.js +1 -1
  161. package/dist/configurator/configurator-context/PresetSelectionProvider.js +1 -1
  162. package/dist/configurator/configurator-context/PreviewContextProvider.js +1 -1
  163. package/dist/configurator/configurator-context/configurator-hooks/index.d.ts +0 -1
  164. package/dist/configurator/configurator-context/configurator-hooks/index.js +1 -1
  165. package/dist/configurator/configurator-context/configurator-hooks/layout-hooks.d.ts +4 -0
  166. package/dist/configurator/configurator-context/index.d.ts +0 -4
  167. package/dist/configurator/configurator-context/index.js +1 -1
  168. package/dist/configurator/configurator-error-page/BuiltInConfiguratorErrorPage.d.ts +3 -3
  169. package/dist/configurator/configurator-error-page/BuiltInConfiguratorErrorPage.js +1 -1
  170. package/dist/configurator/configurator-error-page/ConfiguratorErrorPageElement.d.ts +0 -5
  171. package/dist/configurator/configurator-error-page/ConfiguratorErrorPageElement.js +1 -1
  172. package/dist/configurator/configurator-error-page/index.d.ts +1 -2
  173. package/dist/configurator/configurator-error-page/index.js +1 -1
  174. package/dist/configurator/index.d.ts +9 -2
  175. package/dist/configurator/index.js +1 -1
  176. package/dist/configurator/pages/ConfiguratorNotFoundPage.js +1 -1
  177. package/dist/configurator/pages/LoadedConfiguratorDetailPage.js +1 -1
  178. package/dist/configurator/pages/default-configurator-elements.js +1 -1
  179. package/dist/configurator/pages/error-boundaries/DevContextFallback.js +1 -1
  180. package/dist/configurator/pages/error-boundaries/DevLoadingFallback.js +1 -1
  181. package/dist/configurator/pages/error-boundaries/LoadingErrorBoundary.js +1 -1
  182. package/dist/configurator/toolbar-actions/index.d.ts +1 -0
  183. package/dist/configurator/toolbar-actions/index.js +1 -1
  184. package/dist/configurator/toolbar-actions/use-toolbar-actions.d.ts +100 -0
  185. package/dist/configurator/toolbar-actions/use-toolbar-actions.js +1 -0
  186. package/dist/configurator/toolbar-actions/use-toolbar-help.d.ts +7 -0
  187. package/dist/configurator/toolbar-actions/use-toolbar-help.js +1 -0
  188. package/dist/configurator/ui/assistant/AssistantChips.d.ts +3 -2
  189. package/dist/configurator/ui/assistant/AssistantChips.js +1 -1
  190. package/dist/configurator/ui/assistant/AssistantMarkdown.d.ts +1 -1
  191. package/dist/configurator/ui/assistant/AssistantMarkdown.js +1 -1
  192. package/dist/configurator/ui/assistant/alert/AssistantAlert.d.ts +8 -0
  193. package/dist/configurator/ui/assistant/alert/AssistantAlert.js +1 -0
  194. package/dist/configurator/ui/assistant/alert/index.d.ts +2 -0
  195. package/dist/configurator/ui/assistant/alert/index.js +1 -0
  196. package/dist/configurator/ui/assistant/alert/remark-alerts.d.ts +10 -0
  197. package/dist/configurator/ui/assistant/alert/remark-alerts.js +1 -0
  198. package/dist/configurator/ui/assistant/form/AssistantForm.js +1 -1
  199. package/dist/configurator/ui/assistant/form/compose-answer.d.ts +1 -1
  200. package/dist/configurator/ui/assistant/form/compose-answer.js +1 -1
  201. package/dist/configurator/ui/assistant/form/form-model.d.ts +3 -4
  202. package/dist/configurator/ui/assistant/form/form-state.d.ts +1 -1
  203. package/dist/configurator/ui/assistant/form/index.d.ts +2 -0
  204. package/dist/configurator/ui/assistant/form/index.js +1 -1
  205. package/dist/configurator/ui/assistant/form/parse-form-block.d.ts +3 -2
  206. package/dist/configurator/ui/assistant/form/parse-form-block.js +1 -1
  207. package/dist/configurator/ui/assistant/form/read-form-attributes.d.ts +1 -1
  208. package/dist/configurator/ui/assistant/form/read-form-attributes.js +1 -1
  209. package/dist/configurator/ui/assistant/form/registry/built-in-form-elements.d.ts +3 -0
  210. package/dist/configurator/ui/assistant/form/registry/built-in-form-elements.js +1 -0
  211. package/dist/configurator/ui/assistant/form/registry/create-assistant-form-element.d.ts +31 -0
  212. package/dist/configurator/ui/assistant/form/registry/create-assistant-form-element.js +1 -0
  213. package/dist/configurator/ui/assistant/form/{form-element-definition.d.ts → registry/form-element-definition.d.ts} +3 -1
  214. package/dist/configurator/ui/assistant/form/registry/form-element-definition.js +1 -0
  215. package/dist/configurator/ui/assistant/form/{form-registry.d.ts → registry/form-registry.d.ts} +2 -2
  216. package/dist/configurator/ui/assistant/form/registry/form-registry.js +1 -0
  217. package/dist/configurator/ui/assistant/form/registry/index.d.ts +6 -0
  218. package/dist/configurator/ui/assistant/form/registry/index.js +1 -0
  219. package/dist/configurator/ui/assistant/form/registry/use-form-registry.d.ts +8 -0
  220. package/dist/configurator/ui/assistant/form/registry/use-form-registry.js +1 -0
  221. package/dist/configurator/ui/assistant/form-elements/FormCard.d.ts +9 -0
  222. package/dist/configurator/ui/assistant/form-elements/FormCard.js +1 -0
  223. package/dist/configurator/ui/assistant/form-elements/FormConfirm.d.ts +9 -0
  224. package/dist/configurator/ui/assistant/form-elements/FormConfirm.js +1 -0
  225. package/dist/configurator/ui/assistant/form-elements/FormGroup.d.ts +4 -1
  226. package/dist/configurator/ui/assistant/form-elements/FormNumber.d.ts +9 -0
  227. package/dist/configurator/ui/assistant/form-elements/FormNumber.js +1 -0
  228. package/dist/configurator/ui/assistant/form-elements/FormOptions.d.ts +4 -1
  229. package/dist/configurator/ui/assistant/form-elements/FormReply.d.ts +4 -1
  230. package/dist/configurator/ui/assistant/form-elements/FormReply.js +1 -1
  231. package/dist/configurator/ui/assistant/form-elements/FormSwatch.d.ts +10 -0
  232. package/dist/configurator/ui/assistant/form-elements/FormSwatch.js +1 -0
  233. package/dist/configurator/ui/assistant/form-elements/FormText.d.ts +4 -1
  234. package/dist/configurator/ui/assistant/form-elements/FormText.js +1 -1
  235. package/dist/configurator/ui/assistant/form-elements/clamp-form-number.d.ts +10 -0
  236. package/dist/configurator/ui/assistant/form-elements/clamp-form-number.js +1 -0
  237. package/dist/configurator/ui/assistant/form-elements/form-element-props.d.ts +20 -16
  238. package/dist/configurator/ui/assistant/form-elements/index.d.ts +4 -0
  239. package/dist/configurator/ui/assistant/form-elements/index.js +1 -1
  240. package/dist/configurator/ui/assistant/index.d.ts +3 -0
  241. package/dist/configurator/ui/assistant/index.js +1 -1
  242. package/dist/configurator/ui/assistant/resource-image/index.d.ts +1 -1
  243. package/dist/configurator/ui/assistant/resource-image/index.js +1 -1
  244. package/dist/configurator/ui/assistant/resource-image/resource-path.d.ts +0 -9
  245. package/dist/configurator/ui/assistant/resource-image/resource-path.js +1 -1
  246. package/dist/configurator/ui/assistant/screenshots/ScreenshotThumbnails.d.ts +9 -0
  247. package/dist/configurator/ui/assistant/screenshots/ScreenshotThumbnails.js +1 -0
  248. package/dist/configurator/ui/assistant/screenshots/index.d.ts +2 -0
  249. package/dist/configurator/ui/assistant/screenshots/index.js +1 -0
  250. package/dist/configurator/ui/assistant/screenshots/tool-screenshots.d.ts +22 -0
  251. package/dist/configurator/ui/assistant/screenshots/tool-screenshots.js +1 -0
  252. package/dist/configurator/ui/assistant/screenshots/use-screenshot-src.d.ts +8 -0
  253. package/dist/configurator/ui/assistant/screenshots/use-screenshot-src.js +1 -0
  254. package/dist/configurator/ui/assistant/streamed-markdown.d.ts +2 -2
  255. package/dist/configurator/ui/assistant/streamed-markdown.js +2 -2
  256. package/dist/configurator/ui/assistant/tool-chip.js +1 -1
  257. package/dist/configurator/ui/configurator-layout/slots/canvas/GPUAccelerationDisabled.js +1 -1
  258. package/dist/configurator/ui/configurator-layout/slots/canvas/LayoutCanvas.js +1 -1
  259. package/dist/configurator/ui/configurator-layout/slots/canvas/SharedCanvas.js +1 -1
  260. package/dist/configurator/ui/configurator-layout/slots/canvas/WebGLNotSupported.js +1 -1
  261. package/dist/configurator/ui/configurator-layout/slots/readonly-banner/CloneToEditDialog.js +1 -1
  262. package/dist/configurator/ui/configurator-layout/universal/ExportingOverlay.d.ts +5 -0
  263. package/dist/configurator/ui/configurator-layout/universal/ExportingOverlay.js +1 -0
  264. package/dist/configurator/ui/configurator-layout/universal/Layout.js +1 -1
  265. package/dist/configurator/ui/configurator-layout/universal/use-layout-scene-safe-area.js +1 -1
  266. package/dist/configurator/ui/index.d.ts +1 -0
  267. package/dist/configurator/ui/index.js +1 -1
  268. package/dist/configurator/ui/legacy/chat/MobileChat.js +1 -1
  269. package/dist/configurator/ui/legacy/layout/common/CommonTopNavigation.js +1 -1
  270. package/dist/configurator/ui/legacy/layout/common/ReactiveInterfaceLayout.js +1 -1
  271. package/dist/configurator/ui/legacy/layout/simple/SimpleSidebar.js +1 -1
  272. package/dist/configurator/ui/legacy/layout/simple/SimpleTopNavigation.js +1 -1
  273. package/dist/configurator/ui/legacy/layout/steps/StepsNavigation.js +1 -1
  274. package/dist/configurator/ui/legacy/layout/steps/StepsOwnerLayout.js +1 -1
  275. package/dist/configurator/ui/legacy/layout/steps/StepsSideBar.js +1 -1
  276. package/dist/configurator/ui/legacy/layout/tabs/TabsSidebar.js +1 -1
  277. package/dist/configurator/ui/phoenix-layout-elements/AppLoader.d.ts +0 -7
  278. package/dist/configurator/ui/phoenix-layout-elements/AppLoader.js +2 -2
  279. package/dist/configurator/ui/phoenix-layout-elements/header/common/back-button/use-go-back-action.js +1 -1
  280. package/dist/configurator/ui/phoenix-layout-elements/header/common/step-navigation/StepsNavigation.js +1 -1
  281. package/dist/configurator/ui/phoenix-layout-elements/index.d.ts +8 -1
  282. package/dist/configurator/ui/phoenix-layout-elements/index.js +1 -1
  283. package/dist/configurator/ui/phoenix-layout-elements/sidebar-footer/common/PreviousStepButton.js +1 -1
  284. package/dist/configurator/ui/preset-layout/PresetUi.d.ts +0 -2
  285. package/dist/configurator/ui/preset-layout/PresetUi.js +1 -1
  286. package/dist/configurator/ui/preset-layout/index.d.ts +6 -1
  287. package/dist/configurator/ui/preset-layout/index.js +1 -1
  288. package/dist/configurator/ui/save-message-snackbars/SaveMessageSnackbars.js +1 -1
  289. package/dist/docs/3d-scene/cameras/custom.mdx +4 -2
  290. package/dist/docs/index.json +95 -1
  291. package/dist/docs/integrations/webcomponent-api/basics.mdx +2 -0
  292. package/dist/docs/layouts/custom-layout.mdx +318 -158
  293. package/dist/docs/layouts/gallery/ardent-compressor.mdx +3516 -0
  294. package/dist/docs/layouts/gallery/corvid-drone.mdx +3428 -0
  295. package/dist/docs/layouts/gallery/fenwick-window.mdx +2803 -0
  296. package/dist/docs/layouts/gallery/ferrule-bar-station.mdx +6567 -0
  297. package/dist/docs/layouts/gallery/kestrel-kettle.mdx +1858 -0
  298. package/dist/docs/layouts/gallery/nightjar-guitar.mdx +3698 -0
  299. package/dist/docs/layouts/gallery/sunfold-solar.mdx +2683 -0
  300. package/dist/docs/layouts/gallery/tidepool-aquascape.mdx +5203 -0
  301. package/dist/docs/other-features/client-side-rendering/declarative.mdx +1 -1
  302. package/dist/docs/phoenix/configurator-interface.mdx +16 -13
  303. package/dist/docs/phoenix/domain-model.mdx +4 -1
  304. package/dist/docs/phoenix/phoenix-cli.mdx +14 -6
  305. package/dist/docs/phoenix/project-structure.mdx +21 -17
  306. package/dist/docs/phoenix/sdk-builder-workflow.mdx +7 -5
  307. package/dist/docs/phoenix/sessions-and-access.mdx +2 -0
  308. package/dist/docs/phoenix/webhooks.mdx +5 -1
  309. package/dist/domain/application/assistant/assistant-manifest.d.ts +16 -1
  310. package/dist/domain/application/assistant/assistant-resolved-manifest.d.ts +8 -1
  311. package/dist/domain/application/assistant/build-assistant-manifest.js +1 -1
  312. package/dist/domain/application/assistant/form/assistant-form-element-name.d.ts +11 -0
  313. package/dist/domain/application/assistant/form/assistant-form-element-name.js +8 -0
  314. package/dist/domain/application/assistant/form/assistant-form-elements.d.ts +174 -0
  315. package/dist/domain/application/assistant/form/assistant-form-elements.js +1 -0
  316. package/dist/domain/application/assistant/form/assistant-resource-path.d.ts +10 -0
  317. package/dist/domain/application/assistant/form/assistant-resource-path.js +1 -0
  318. package/dist/domain/application/assistant/form/index.d.ts +4 -0
  319. package/dist/domain/application/assistant/form/index.js +1 -0
  320. package/dist/domain/application/assistant/generate-assistant-prompt.d.ts +3 -0
  321. package/dist/domain/application/assistant/generate-assistant-prompt.js +1 -1
  322. package/dist/domain/application/assistant/index.d.ts +2 -3
  323. package/dist/domain/application/assistant/index.js +1 -1
  324. package/dist/domain/application/assistant/session-setup/apply-assistant-setup.js +1 -1
  325. package/dist/domain/application/assistant/session-setup/assistant-setup-manifest.d.ts +2 -0
  326. package/dist/domain/application/assistant/session-setup/assistant-setup-manifest.js +1 -1
  327. package/dist/domain/application/configurator-builder.d.ts +7 -1
  328. package/dist/domain/application/configurator-builder.js +1 -1
  329. package/dist/domain/application/index.d.ts +1 -1
  330. package/dist/domain/application/index.js +1 -1
  331. package/dist/domain/application/standard-properties.js +1 -1
  332. package/dist/domain/application/web-component-property.d.ts +3 -1
  333. package/dist/domain/application/web-component-property.js +1 -1
  334. package/dist/domain/available-system-components.d.ts +1 -1
  335. package/dist/domain/available-system-components.js +1 -1
  336. package/dist/domain/domain-builder.d.ts +9 -3
  337. package/dist/domain/domain-builder.js +1 -1
  338. package/dist/domain/domain-context/store-system/store-system.d.ts +5 -0
  339. package/dist/domain/domain-context/store-system/store-system.js +1 -1
  340. package/dist/domain/domain-runtime/application.d.ts +39 -0
  341. package/dist/domain/domain-runtime/application.js +1 -0
  342. package/dist/domain/domain-runtime/domain-context/selectors.d.ts +1 -0
  343. package/dist/domain/domain-runtime/domain-context/selectors.js +1 -1
  344. package/dist/domain/domain-runtime/domain-runtime.d.ts +44 -4
  345. package/dist/domain/domain-runtime/domain-runtime.js +1 -1
  346. package/dist/domain/domain-runtime/environment/initialize.d.ts +1 -1
  347. package/dist/domain/domain-runtime/environment/types.d.ts +1 -1
  348. package/dist/domain/domain-runtime/errors/implementation-error-collector.d.ts +2 -0
  349. package/dist/domain/domain-runtime/errors/implementation-error-collector.js +1 -1
  350. package/dist/domain/domain-runtime/index.d.ts +2 -1
  351. package/dist/domain/domain-runtime/index.js +1 -1
  352. package/dist/domain/domain-runtime/spec/index.d.ts +1 -1
  353. package/dist/domain/domain-runtime/spec/index.js +1 -1
  354. package/dist/domain/domain-runtime/spec/initialize.js +1 -1
  355. package/dist/domain/domain-runtime/spec/module-checks/element-registration.d.ts +15 -1
  356. package/dist/domain/domain-runtime/spec/module-checks/element-registration.js +1 -1
  357. package/dist/domain/domain-runtime/spec/module-checks/find-assistant-form-element-errors.d.ts +12 -0
  358. package/dist/domain/domain-runtime/spec/module-checks/find-assistant-form-element-errors.js +1 -0
  359. package/dist/domain/domain-runtime/spec/module-checks/index.d.ts +3 -1
  360. package/dist/domain/domain-runtime/spec/module-checks/index.js +1 -1
  361. package/dist/domain/domain-runtime/spec/module-checks/merge-expression-modules.d.ts +23 -0
  362. package/dist/domain/domain-runtime/spec/module-checks/merge-expression-modules.js +1 -0
  363. package/dist/domain/domain-runtime/spec/module-checks/resolve-expression-modules.d.ts +3 -4
  364. package/dist/domain/domain-runtime/spec/module-checks/resolve-expression-modules.js +1 -1
  365. package/dist/domain/domain-runtime/spec/selectors.d.ts +3 -1
  366. package/dist/domain/domain-runtime/spec/selectors.js +1 -1
  367. package/dist/domain/domain-runtime/web-component/actions.d.ts +3 -0
  368. package/dist/domain/domain-runtime/web-component/actions.js +1 -1
  369. package/dist/domain/domain-runtime/web-component/initialize.d.ts +1 -0
  370. package/dist/domain/domain-runtime/web-component/initialize.js +1 -1
  371. package/dist/domain/domain-runtime/web-component/selectors.d.ts +2 -0
  372. package/dist/domain/domain-runtime/web-component/selectors.js +1 -1
  373. package/dist/domain/domain-runtime/web-component/types.d.ts +6 -3
  374. package/dist/domain/extensions/export-images/agent-screenshot.d.ts +24 -0
  375. package/dist/domain/extensions/export-images/agent-screenshot.js +1 -0
  376. package/dist/domain/extensions/{client-side-image.d.ts → export-images/client-side-image.d.ts} +2 -2
  377. package/dist/domain/extensions/export-images/client-side-image.js +1 -0
  378. package/dist/domain/extensions/export-images/index.d.ts +3 -0
  379. package/dist/domain/extensions/export-images/index.js +1 -0
  380. package/dist/domain/extensions/{save-template-thumbnail.d.ts → export-images/save-template-thumbnail.d.ts} +2 -2
  381. package/dist/domain/extensions/export-images/save-template-thumbnail.js +1 -0
  382. package/dist/domain/extensions/index.d.ts +1 -2
  383. package/dist/domain/extensions/index.js +1 -1
  384. package/dist/domain/index.d.ts +1 -0
  385. package/dist/domain/index.js +1 -1
  386. package/dist/domain/mocks/create-mock-domain-runtime.d.ts +9 -0
  387. package/dist/domain/spec/application/index.d.ts +1 -0
  388. package/dist/domain/spec/application/index.js +1 -0
  389. package/dist/{application-spec/core → domain/spec}/components/component-filter.d.ts +3 -2
  390. package/dist/domain/spec/enhanced-json-value.d.ts +30 -0
  391. package/dist/domain/spec/enhanced-json-value.js +1 -0
  392. package/dist/domain/spec/index.d.ts +7 -0
  393. package/dist/domain/spec/index.js +1 -0
  394. package/dist/domain/spec/json-schema.d.ts +52 -0
  395. package/dist/domain/spec/markers/index.d.ts +2 -0
  396. package/dist/domain/spec/markers/index.js +1 -0
  397. package/dist/domain/spec/markers/msg-marker.d.ts +28 -0
  398. package/dist/domain/spec/markers/msg-marker.js +1 -0
  399. package/dist/domain/spec/model/aliases.d.ts +9 -0
  400. package/dist/domain/spec/model/common-types.d.ts +15 -0
  401. package/dist/domain/spec/model/defaults.d.ts +33 -0
  402. package/dist/domain/spec/model/defaults.js +1 -0
  403. package/dist/domain/spec/model/entity-types.d.ts +8 -0
  404. package/dist/domain/spec/model/entity-types.js +1 -0
  405. package/dist/domain/spec/model/index.d.ts +7 -0
  406. package/dist/domain/spec/model/index.js +1 -0
  407. package/dist/domain/spec/model/model-version-key.d.ts +3 -0
  408. package/dist/domain/spec/model/model-version-key.js +1 -0
  409. package/dist/domain/spec/model/names/action-name.d.ts +7 -0
  410. package/dist/domain/spec/model/names/action-name.js +1 -0
  411. package/dist/domain/spec/model/names/alias-name.d.ts +7 -0
  412. package/dist/domain/spec/model/names/alias-name.js +1 -0
  413. package/dist/domain/spec/model/names/entity-or-alias-name.d.ts +8 -0
  414. package/dist/domain/spec/model/names/entity-or-alias-name.js +1 -0
  415. package/dist/domain/spec/model/names/entity-type-name.d.ts +8 -0
  416. package/dist/domain/spec/model/names/entity-type-name.js +1 -0
  417. package/dist/domain/spec/model/names/expression-name.d.ts +6 -0
  418. package/dist/domain/spec/model/names/expression-name.js +1 -0
  419. package/dist/domain/spec/model/names/index.d.ts +9 -0
  420. package/dist/domain/spec/model/names/index.js +1 -0
  421. package/dist/domain/spec/model/names/instance-name.d.ts +7 -0
  422. package/dist/domain/spec/model/names/instance-name.js +1 -0
  423. package/dist/domain/spec/model/names/invariant-name.d.ts +3 -0
  424. package/dist/domain/spec/model/names/invariant-name.js +1 -0
  425. package/dist/domain/spec/model/names/shape-property-name.d.ts +11 -0
  426. package/dist/domain/spec/model/names/shape-property-name.js +1 -0
  427. package/dist/domain/spec/model/names/violation-type-name.d.ts +3 -0
  428. package/dist/domain/spec/model/names/violation-type-name.js +1 -0
  429. package/dist/domain/spec/model/presets.d.ts +30 -0
  430. package/dist/domain/spec/model/presets.js +1 -0
  431. package/dist/editor/domain-editors/DomainSpecContext.js +1 -1
  432. package/dist/editor/domain-editors/apply-spec-update.d.ts +10 -2
  433. package/dist/editor/domain-editors/apply-spec-update.js +1 -1
  434. package/dist/editor/domain-editors/use-implementation-files.d.ts +6 -14
  435. package/dist/editor/domain-editors/use-implementation-files.js +1 -1
  436. package/dist/editor/screenshot/ScreenshotHandler.js +1 -1
  437. package/dist/i18n/locales/cs/messages.js +1 -1
  438. package/dist/i18n/locales/da/messages.js +1 -1
  439. package/dist/i18n/locales/de/messages.js +1 -1
  440. package/dist/i18n/locales/de-AT/messages.js +1 -1
  441. package/dist/i18n/locales/en/messages.js +1 -1
  442. package/dist/i18n/locales/en-AU/messages.js +1 -1
  443. package/dist/i18n/locales/en-GB/messages.js +1 -1
  444. package/dist/i18n/locales/es/messages.js +1 -1
  445. package/dist/i18n/locales/fr/messages.js +1 -1
  446. package/dist/i18n/locales/hu/messages.js +1 -1
  447. package/dist/i18n/locales/it/messages.js +1 -1
  448. package/dist/i18n/locales/nl/messages.js +1 -1
  449. package/dist/i18n/locales/pl/messages.js +1 -1
  450. package/dist/i18n/locales/pt/messages.js +1 -1
  451. package/dist/i18n/locales/ro/messages.js +1 -1
  452. package/dist/i18n/locales/sk/messages.js +1 -1
  453. package/dist/i18n/locales/tr/messages.js +1 -1
  454. package/dist/legacy/domain-cli/utils/cache.d.ts +1 -1
  455. package/dist/legacy/domain-cli/utils/cache.js +1 -1
  456. package/dist/legacy/domain-spec/__generated/domain-schema.d.ts +16 -0
  457. package/dist/legacy/domain-spec/spec/domain-spec.js +1 -1
  458. package/dist/legacy/phoenix-cli/project-gen/generators/file-templates/agents/claude-md.d.ts +1 -1
  459. package/dist/legacy/phoenix-cli/project-gen/generators/file-templates/agents/cursor-rules.d.ts +1 -1
  460. package/dist/legacy/phoenix-cli/project-gen/generators/file-templates/agents/shared-sdk-content.d.ts +1 -1
  461. package/dist/legacy/phoenix-cli/project-gen/generators/file-templates/agents/shared-sdk-content.js +11 -5
  462. package/dist/phoenix/application-spec/generate-application-spec-project.d.ts +1 -0
  463. package/dist/phoenix/application-spec/generate-application-spec-project.js +2 -2
  464. package/dist/phoenix/application-spec/generate-project-files.d.ts +1 -0
  465. package/dist/phoenix/application-spec/index.d.ts +1 -0
  466. package/dist/phoenix/application-spec/index.js +1 -1
  467. package/dist/phoenix/application-spec/resolve-deployment-data.d.ts +11 -0
  468. package/dist/phoenix/application-spec/resolve-deployment-data.js +2 -2
  469. package/dist/phoenix/bin.js +1 -1
  470. package/dist/phoenix/cli.js +1 -1
  471. package/dist/phoenix/commands/build.js +1 -1
  472. package/dist/phoenix/commands/clean.js +1 -1
  473. package/dist/phoenix/commands/deploy.js +1 -1
  474. package/dist/phoenix/commands/dev.js +5 -5
  475. package/dist/phoenix/commands/generated-env-markers.d.ts +1 -0
  476. package/dist/phoenix/commands/generated-env-markers.js +1 -1
  477. package/dist/phoenix/commands/index.d.ts +1 -1
  478. package/dist/phoenix/commands/index.js +1 -1
  479. package/dist/phoenix/commands/sync.js +1 -1
  480. package/dist/phoenix/lingui/index.d.ts +1 -0
  481. package/dist/phoenix/lingui/index.js +1 -0
  482. package/dist/phoenix/{services → lingui}/lingui.d.ts +5 -2
  483. package/dist/phoenix/lingui/lingui.js +1 -0
  484. package/dist/phoenix/services/application-spec-project-watcher.d.ts +3 -1
  485. package/dist/phoenix/services/application-spec-project-watcher.js +2 -2
  486. package/dist/phoenix/services/index.d.ts +1 -0
  487. package/dist/phoenix/services/index.js +1 -1
  488. package/dist/phoenix/services/lingui-watcher.js +1 -1
  489. package/dist/phoenix/services/prepare-development-environment.js +1 -1
  490. package/dist/phoenix/services/vite-config.js +1 -1
  491. package/dist/react-sdk/application-runtime/common-services/analytics/analytics-service.d.ts +1 -1
  492. package/dist/react-sdk/application-runtime/common-services/initialize.d.ts +2 -2
  493. package/dist/react-sdk/application-runtime/domain-application-context/chat-system.d.ts +1 -1
  494. package/dist/react-sdk/application-runtime/hooks/index.d.ts +2 -0
  495. package/dist/react-sdk/application-runtime/hooks/index.js +1 -1
  496. package/dist/react-sdk/application-runtime/hooks/loading/index.d.ts +5 -0
  497. package/dist/react-sdk/application-runtime/hooks/loading/index.js +1 -0
  498. package/dist/react-sdk/application-runtime/hooks/loading/loader-host-context.d.ts +11 -0
  499. package/dist/react-sdk/application-runtime/hooks/loading/loader-host-context.js +1 -0
  500. package/dist/react-sdk/application-runtime/hooks/loading/use-is-awaiting-loading-phase.d.ts +8 -0
  501. package/dist/react-sdk/application-runtime/hooks/loading/use-is-awaiting-loading-phase.js +1 -0
  502. package/dist/react-sdk/application-runtime/hooks/loading/use-is-loader-hosted.d.ts +7 -0
  503. package/dist/react-sdk/application-runtime/hooks/loading/use-is-loader-hosted.js +1 -0
  504. package/dist/react-sdk/application-runtime/hooks/loading/use-loading-actions.d.ts +9 -0
  505. package/dist/react-sdk/application-runtime/hooks/loading/use-loading-actions.js +1 -0
  506. package/dist/react-sdk/application-runtime/hooks/loading/use-loading-application.d.ts +24 -0
  507. package/dist/react-sdk/application-runtime/hooks/loading/use-loading-application.js +1 -0
  508. package/dist/react-sdk/application-runtime/hooks/responsive/index.d.ts +3 -0
  509. package/dist/react-sdk/application-runtime/hooks/responsive/index.js +1 -0
  510. package/dist/react-sdk/application-runtime/hooks/responsive/use-responsive-actions.d.ts +9 -0
  511. package/dist/react-sdk/application-runtime/hooks/responsive/use-responsive-actions.js +1 -0
  512. package/dist/react-sdk/application-runtime/hooks/responsive/use-responsive-application.d.ts +26 -0
  513. package/dist/react-sdk/application-runtime/hooks/responsive/use-responsive-application.js +1 -0
  514. package/dist/react-sdk/application-runtime/hooks/responsive/use-responsive-state.d.ts +10 -0
  515. package/dist/react-sdk/application-runtime/hooks/responsive/use-responsive-state.js +1 -0
  516. package/dist/react-sdk/application-runtime/hooks/responsive/use-responsive-store.d.ts +24 -0
  517. package/dist/react-sdk/application-runtime/hooks/responsive/use-responsive-store.js +1 -0
  518. package/dist/react-sdk/application-runtime/hooks/use-access-service.d.ts +5 -0
  519. package/dist/react-sdk/application-runtime/hooks/use-access-service.js +1 -1
  520. package/dist/react-sdk/application-runtime/hooks/use-phoenix-element-slots.d.ts +2 -1
  521. package/dist/react-sdk/application-runtime/hooks/use-web-component-readonly-sync.d.ts +4 -11
  522. package/dist/react-sdk/application-runtime/hooks/use-web-component-readonly-sync.js +1 -1
  523. package/dist/react-sdk/application-runtime/hooks/use-web-component.d.ts +5 -0
  524. package/dist/react-sdk/application-runtime/hooks/use-web-component.js +1 -1
  525. package/dist/react-sdk/application-runtime/host-properties/actions.d.ts +15 -0
  526. package/dist/react-sdk/application-runtime/host-properties/actions.js +1 -0
  527. package/dist/react-sdk/application-runtime/host-properties/connect-host-properties.d.ts +30 -0
  528. package/dist/react-sdk/application-runtime/host-properties/connect-host-properties.js +1 -0
  529. package/dist/react-sdk/application-runtime/host-properties/domain-host-properties.d.ts +7 -0
  530. package/dist/react-sdk/application-runtime/host-properties/domain-host-properties.js +1 -0
  531. package/dist/react-sdk/application-runtime/host-properties/host-property-descriptors.d.ts +21 -0
  532. package/dist/react-sdk/application-runtime/host-properties/host-property-descriptors.js +1 -0
  533. package/dist/react-sdk/application-runtime/host-properties/host-property-scopes.d.ts +42 -0
  534. package/dist/react-sdk/application-runtime/host-properties/host-property-scopes.js +1 -0
  535. package/dist/react-sdk/application-runtime/host-properties/index.d.ts +8 -0
  536. package/dist/react-sdk/application-runtime/host-properties/index.js +1 -0
  537. package/dist/react-sdk/application-runtime/host-properties/initialize.d.ts +7 -0
  538. package/dist/react-sdk/application-runtime/host-properties/initialize.js +1 -0
  539. package/dist/react-sdk/application-runtime/host-properties/selectors.d.ts +54 -0
  540. package/dist/react-sdk/application-runtime/host-properties/selectors.js +1 -0
  541. package/dist/react-sdk/application-runtime/host-properties/types.d.ts +18 -0
  542. package/dist/react-sdk/application-runtime/host-properties/types.js +1 -0
  543. package/dist/react-sdk/application-runtime/index.d.ts +3 -0
  544. package/dist/react-sdk/application-runtime/integration/initialize.d.ts +7 -6
  545. package/dist/react-sdk/application-runtime/integration/initialize.js +1 -1
  546. package/dist/react-sdk/application-runtime/integration/selectors.d.ts +11 -2
  547. package/dist/react-sdk/application-runtime/integration/selectors.js +1 -1
  548. package/dist/react-sdk/application-runtime/integration/types.d.ts +5 -2
  549. package/dist/react-sdk/application-runtime/loading/actions.d.ts +45 -0
  550. package/dist/react-sdk/application-runtime/loading/actions.js +1 -0
  551. package/dist/react-sdk/application-runtime/loading/index.d.ts +4 -0
  552. package/dist/react-sdk/application-runtime/loading/index.js +1 -0
  553. package/dist/react-sdk/application-runtime/loading/initialize.d.ts +3 -0
  554. package/dist/react-sdk/application-runtime/loading/initialize.js +1 -0
  555. package/dist/react-sdk/application-runtime/loading/selectors.d.ts +18 -0
  556. package/dist/react-sdk/application-runtime/loading/selectors.js +1 -0
  557. package/dist/react-sdk/application-runtime/loading/types.d.ts +59 -0
  558. package/dist/react-sdk/application-runtime/loading/types.js +1 -0
  559. package/dist/react-sdk/application-runtime/mocks/create-mock-application-runtime.js +1 -1
  560. package/dist/react-sdk/application-runtime/provider/ApplicationRuntime.d.ts +6 -0
  561. package/dist/react-sdk/application-runtime/provider/ApplicationRuntime.js +1 -1
  562. package/dist/react-sdk/application-runtime/provider/ApplicationType.d.ts +7 -0
  563. package/dist/react-sdk/application-runtime/provider/ApplicationType.js +1 -1
  564. package/dist/react-sdk/application-runtime/responsive/actions.d.ts +47 -0
  565. package/dist/react-sdk/application-runtime/responsive/actions.js +1 -0
  566. package/dist/react-sdk/application-runtime/responsive/index.d.ts +4 -0
  567. package/dist/react-sdk/application-runtime/responsive/index.js +1 -0
  568. package/dist/react-sdk/application-runtime/responsive/initialize.d.ts +3 -0
  569. package/dist/react-sdk/application-runtime/responsive/initialize.js +1 -0
  570. package/dist/react-sdk/application-runtime/responsive/selectors.d.ts +20 -0
  571. package/dist/react-sdk/application-runtime/responsive/selectors.js +1 -0
  572. package/dist/react-sdk/application-runtime/responsive/types.d.ts +104 -0
  573. package/dist/react-sdk/application-runtime/responsive/types.js +1 -0
  574. package/dist/react-sdk/application-runtime/routing/routing-service.d.ts +34 -2
  575. package/dist/react-sdk/application-runtime/routing/routing-service.js +1 -1
  576. package/dist/react-sdk/application-runtime/runtime/create-application-runtime.d.ts +313 -10
  577. package/dist/react-sdk/application-runtime/runtime/create-application-runtime.js +1 -1
  578. package/dist/{configurator/configurator-context → react-sdk}/configurator-routing/ConfiguratorRoutingProvider.d.ts +1 -1
  579. package/dist/react-sdk/configurator-routing/ConfiguratorRoutingProvider.js +1 -0
  580. package/dist/{configurator/configurator-context → react-sdk}/configurator-routing/OnGoToIndexHandler.d.ts +1 -2
  581. package/dist/react-sdk/configurator-routing/OnGoToIndexHandler.js +1 -0
  582. package/dist/react-sdk/configurator-routing/index.d.ts +3 -0
  583. package/dist/{configurator/configurator-context → react-sdk}/configurator-routing/index.js +1 -1
  584. package/dist/{configurator/configurator-context → react-sdk}/configurator-routing/use-power-routing-lifecycle.d.ts +2 -0
  585. package/dist/react-sdk/configurator-routing/use-power-routing-lifecycle.js +1 -0
  586. package/dist/react-sdk/domain-application-context/BackendDataProvider.js +1 -1
  587. package/dist/react-sdk/domain-application-context/FrontendDataProvider.js +1 -1
  588. package/dist/react-sdk/domain-application-context/OnPresetLoadedHandler.js +1 -0
  589. package/dist/react-sdk/domain-application-context/PublishedDataProvider.js +1 -1
  590. package/dist/react-sdk/domain-application-context/chat-hooks.d.ts +4 -0
  591. package/dist/react-sdk/domain-application-context/chat-hooks.js +1 -0
  592. package/dist/react-sdk/domain-application-context/index.d.ts +2 -0
  593. package/dist/react-sdk/domain-application-context/index.js +1 -1
  594. package/dist/react-sdk/domain-context/common-hooks/index.d.ts +1 -0
  595. package/dist/react-sdk/domain-context/common-hooks/index.js +1 -1
  596. package/dist/react-sdk/domain-context/common-hooks/use-configuration-save-state.d.ts +23 -0
  597. package/dist/react-sdk/domain-context/common-hooks/use-configuration-save-state.js +1 -0
  598. package/dist/react-sdk/domain-context/common-hooks/use-domain-context.d.ts +1 -0
  599. package/dist/react-sdk/domain-context/index.d.ts +1 -0
  600. package/dist/react-sdk/domain-context/index.js +1 -1
  601. package/dist/react-sdk/domain-context/system-hooks/undo-redo-hooks.js +1 -1
  602. package/dist/react-sdk/elements/index.d.ts +0 -1
  603. package/dist/react-sdk/index.d.ts +4 -1
  604. package/dist/react-sdk/index.js +1 -1
  605. package/dist/react-sdk/integration/IntegrationSubscription.js +1 -0
  606. package/dist/react-sdk/integration/index.d.ts +1 -0
  607. package/dist/react-sdk/integration/index.js +1 -0
  608. package/dist/react-sdk/lifecycle-providers/LifecycleProviders.js +1 -0
  609. package/dist/react-sdk/lifecycle-providers/index.d.ts +1 -0
  610. package/dist/react-sdk/lifecycle-providers/index.js +1 -0
  611. package/dist/react-sdk/loading-state/LoaderHost.d.ts +20 -0
  612. package/dist/react-sdk/loading-state/LoaderHost.js +1 -0
  613. package/dist/react-sdk/loading-state/built-in-loading-phase.d.ts +9 -0
  614. package/dist/react-sdk/loading-state/built-in-loading-phase.js +1 -0
  615. package/dist/react-sdk/loading-state/create-app-loader.d.ts +18 -0
  616. package/dist/react-sdk/loading-state/create-app-loader.js +1 -0
  617. package/dist/react-sdk/loading-state/index.d.ts +4 -2
  618. package/dist/react-sdk/loading-state/index.js +1 -1
  619. package/dist/react-sdk/loading-state/{LoadingStateProvider.d.ts → loading-state-hooks.d.ts} +3 -12
  620. package/dist/react-sdk/loading-state/loading-state-hooks.js +1 -0
  621. package/dist/react-sdk/page-elements/ConfigurationNotFoundPagePropsProvider.d.ts +17 -0
  622. package/dist/react-sdk/page-elements/ConfigurationNotFoundPagePropsProvider.js +1 -0
  623. package/dist/react-sdk/page-elements/ConfiguratorErrorPagePropsProvider.d.ts +17 -0
  624. package/dist/react-sdk/page-elements/ConfiguratorErrorPagePropsProvider.js +1 -0
  625. package/dist/react-sdk/page-elements/configurator-error-page-props.js +1 -0
  626. package/dist/{configurator/configuration-not-found-page → react-sdk/page-elements}/create-configuration-not-found-page.d.ts +7 -1
  627. package/dist/react-sdk/page-elements/create-configuration-not-found-page.js +1 -0
  628. package/dist/{configurator/configurator-error-page → react-sdk/page-elements}/create-configurator-error-page.d.ts +6 -1
  629. package/dist/react-sdk/page-elements/create-configurator-error-page.js +1 -0
  630. package/dist/react-sdk/page-elements/create-preset-ui.d.ts +9 -0
  631. package/dist/react-sdk/page-elements/create-preset-ui.js +1 -0
  632. package/dist/react-sdk/page-elements/index.d.ts +6 -0
  633. package/dist/react-sdk/page-elements/index.js +1 -0
  634. package/dist/react-sdk/session/SessionServiceProvider.js +1 -1
  635. package/dist/react-sdk/web-component/create-web-component.js +1 -1
  636. package/dist/react-sdk/web-component/god-mode/god-mode-registry.d.ts +30 -0
  637. package/dist/react-sdk/web-component/god-mode/god-mode-registry.js +1 -0
  638. package/dist/react-sdk/web-component/god-mode/index.d.ts +1 -0
  639. package/dist/react-sdk/web-component/god-mode/index.js +1 -0
  640. package/dist/ui-sdk/icons/__generated/Lightbulb.d.ts +3 -0
  641. package/dist/ui-sdk/icons/__generated/Lightbulb.js +1 -0
  642. package/dist/ui-sdk/icons/__generated/XCircle.d.ts +3 -0
  643. package/dist/ui-sdk/icons/__generated/XCircle.js +1 -0
  644. package/dist/ui-sdk/icons/__generated/index.d.ts +4 -0
  645. package/dist/ui-sdk/icons/__generated/index.js +1 -1
  646. package/dist/ui-sdk/icons/icons-registry.js +1 -1
  647. package/dist/ui-sdk/responsive-application/ResponsiveApplicationProvider.d.ts +2 -2
  648. package/dist/ui-sdk/responsive-application/responsive-state-store.d.ts +11 -9
  649. package/dist/ui-sdk/responsive-application/use-store-responsive-info.js +1 -1
  650. package/dist/ui-sdk/theme/types.d.ts +5 -1
  651. package/package.json +13 -3
  652. package/schema/domain-spec.json +140 -0
  653. package/dist/configurator/app-loader-content/app-loader-content-name.d.ts +0 -5
  654. package/dist/configurator/app-loader-content/app-loader-content-name.js +0 -1
  655. package/dist/configurator/configuration-not-found-page/create-configuration-not-found-page.js +0 -1
  656. package/dist/configurator/configurator-context/IntegrationSubscription.js +0 -1
  657. package/dist/configurator/configurator-context/LifecycleProviders.js +0 -1
  658. package/dist/configurator/configurator-context/OnPresetLoadedHandler.js +0 -1
  659. package/dist/configurator/configurator-context/configurator-hooks/chat-hooks.d.ts +0 -1
  660. package/dist/configurator/configurator-context/configurator-hooks/chat-hooks.js +0 -1
  661. package/dist/configurator/configurator-context/configurator-routing/ConfiguratorRoutingProvider.js +0 -1
  662. package/dist/configurator/configurator-context/configurator-routing/OnGoToIndexHandler.js +0 -1
  663. package/dist/configurator/configurator-context/configurator-routing/index.d.ts +0 -2
  664. package/dist/configurator/configurator-context/configurator-routing/use-power-routing-lifecycle.js +0 -1
  665. package/dist/configurator/configurator-error-page/create-configurator-error-page.js +0 -1
  666. package/dist/configurator/ui/assistant/form/built-in-form-registry.d.ts +0 -10
  667. package/dist/configurator/ui/assistant/form/built-in-form-registry.js +0 -1
  668. package/dist/configurator/ui/assistant/form/form-registry.js +0 -8
  669. package/dist/domain/application/assistant/assistant-form-elements.d.ts +0 -28
  670. package/dist/domain/application/assistant/assistant-form-elements.js +0 -1
  671. package/dist/domain/extensions/client-side-image.js +0 -1
  672. package/dist/domain/extensions/save-template-thumbnail.js +0 -1
  673. package/dist/phoenix/services/lingui.js +0 -1
  674. package/dist/react-sdk/application-runtime/runtime/god-mode.d.ts +0 -19
  675. package/dist/react-sdk/application-runtime/runtime/god-mode.js +0 -1
  676. package/dist/react-sdk/loading-state/LoadingStateProvider.js +0 -1
  677. package/dist/react-sdk/loading-state/loading-state-manager.d.ts +0 -37
  678. package/dist/react-sdk/loading-state/loading-state-manager.js +0 -1
  679. package/dist/react-sdk/responsive-state/ResponsiveStateProvider.d.ts +0 -25
  680. package/dist/react-sdk/responsive-state/ResponsiveStateProvider.js +0 -1
  681. package/dist/react-sdk/responsive-state/canvas-padding.d.ts +0 -14
  682. package/dist/react-sdk/responsive-state/index.d.ts +0 -5
  683. package/dist/react-sdk/responsive-state/index.js +0 -1
  684. package/dist/react-sdk/responsive-state/responsive-state-manager.d.ts +0 -111
  685. package/dist/react-sdk/responsive-state/responsive-state-manager.js +0 -1
  686. package/dist/react-sdk/responsive-state/use-responsive-state-manager.d.ts +0 -10
  687. package/dist/react-sdk/responsive-state/use-responsive-state-manager.js +0 -1
  688. package/dist/react-sdk/responsive-state/use-responsive-state.d.ts +0 -11
  689. package/dist/react-sdk/responsive-state/use-responsive-state.js +0 -1
  690. /package/dist/{application-spec/core → domain/spec/application}/application-instance.d.ts +0 -0
  691. /package/dist/{application-spec/core → domain/spec/application}/application-instance.js +0 -0
  692. /package/dist/{application-spec/core → domain/spec}/components/component-filter.js +0 -0
  693. /package/dist/{application-spec/core → domain/spec}/components/index.d.ts +0 -0
  694. /package/dist/{application-spec/core → domain/spec}/components/index.js +0 -0
  695. /package/dist/{application-spec/core → domain/spec}/components/sdk-code-ref.d.ts +0 -0
  696. /package/dist/{application-spec/core → domain/spec}/components/sdk-code-ref.js +0 -0
  697. /package/dist/{application-spec/core → domain/spec}/expressions/index.d.ts +0 -0
  698. /package/dist/{application-spec/core → domain/spec}/expressions/index.js +0 -0
  699. /package/dist/{application-spec/core → domain/spec}/expressions/relation-expression-params.d.ts +0 -0
  700. /package/dist/{application-spec/core → domain/spec}/expressions/relation-expression-params.js +0 -0
  701. /package/dist/{application-spec/core → domain/spec}/expressions/sdk-expression-implementation.d.ts +0 -0
  702. /package/dist/{application-spec/core → domain/spec}/expressions/sdk-expression-implementation.js +0 -0
  703. /package/dist/{configurator/ui/assistant/form/form-element-definition.js → domain/spec/json-schema.js} +0 -0
  704. /package/dist/{application-spec/core → domain/spec}/markers/eval-marker.d.ts +0 -0
  705. /package/dist/{application-spec/core → domain/spec}/markers/eval-marker.js +0 -0
  706. /package/dist/{react-sdk/elements/configurator-error-page-props.js → domain/spec/model/aliases.js} +0 -0
  707. /package/dist/{react-sdk/responsive-state/canvas-padding.js → domain/spec/model/common-types.js} +0 -0
  708. /package/dist/{configurator/configurator-context → react-sdk/domain-application-context}/OnPresetLoadedHandler.d.ts +0 -0
  709. /package/dist/{configurator/configurator-context → react-sdk/integration}/IntegrationSubscription.d.ts +0 -0
  710. /package/dist/{configurator/configurator-context → react-sdk/lifecycle-providers}/LifecycleProviders.d.ts +0 -0
  711. /package/dist/react-sdk/{elements → page-elements}/configurator-error-page-props.d.ts +0 -0
@@ -39,6 +39,10 @@ export declare const useSidebarContents: () => {
39
39
  };
40
40
  export declare const useSidebarGoBack: () => () => void;
41
41
  export declare const useHasSidebarSummary: () => boolean;
42
+ /**
43
+ * @deprecated Use `useToolbarActions()` instead, or mount `LayoutSlots.DesktopToolbar` to keep project element
44
+ * overrides. This API will be removed in a future version.
45
+ */
42
46
  export declare const useToolbarState: () => import("#package/domain").ToolbarComponentState;
43
47
  export declare const useEmbeddedModeActive: () => boolean;
44
48
  export declare const usePresetEmbeddedModeActive: () => boolean;
@@ -1,9 +1,5 @@
1
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
2
  export { ViewportStateSync } from './ViewportStateSync.js';
5
3
  export { PreviewApplicationProvider } from './PreviewApplicationProvider.js';
6
4
  export { PreviewContextProvider, usePreview } from './PreviewContextProvider.js';
7
- export * from './LifecycleProviders.js';
8
5
  export * from './configurator-hooks/index.js';
9
- export * from './configurator-routing/index.js';
@@ -1 +1 @@
1
- export{usePresetSelection,PresetSelectionProvider}from"./PresetSelectionProvider.js";export{useOnPresetLoadedHandler,createOnPresetLoadedHandler}from"./OnPresetLoadedHandler.js";export{IntegrationSubscription}from"./IntegrationSubscription.js";export{ViewportStateSync}from"./ViewportStateSync.js";export{PreviewApplicationProvider}from"./PreviewApplicationProvider.js";export{PreviewContextProvider,usePreview}from"./PreviewContextProvider.js";export*from"./LifecycleProviders.js";export*from"./configurator-hooks/index.js";export*from"./configurator-routing/index.js";
1
+ export{usePresetSelection,PresetSelectionProvider}from"./PresetSelectionProvider.js";export{ViewportStateSync}from"./ViewportStateSync.js";export{PreviewApplicationProvider}from"./PreviewApplicationProvider.js";export{PreviewContextProvider,usePreview}from"./PreviewContextProvider.js";export*from"./configurator-hooks/index.js";
@@ -1,6 +1,6 @@
1
- import type { ConfiguratorErrorPageProps } from '#package/react-sdk';
2
1
  /**
3
2
  * The configurator's built-in production error page, the default `ConfiguratorErrorPage`
4
- * registration and the page shown when a project's error page throws.
3
+ * registration and the page shown when a project's error page throws. It reads its props from the
4
+ * provider `ConfiguratorErrorPageElement` renders it in.
5
5
  */
6
- export declare const BuiltInConfiguratorErrorPage: (props: ConfiguratorErrorPageProps) => import("react/jsx-runtime").JSX.Element;
6
+ export declare const BuiltInConfiguratorErrorPage: () => import("react/jsx-runtime").JSX.Element;
@@ -1 +1 @@
1
- import{jsx as e}from"react/jsx-runtime";import{match as t}from"ts-pattern";import{ErrorPage as o}from"#package/ui-sdk";export const BuiltInConfiguratorErrorPage=r=>{let{reason:n,onRetry:i}=r;return t(n).with("presetCreationFailed",()=>e(o,{title:"Whoops, something went wrong!",message:"We couldn't start configuring from this preset. Please reload the page and try again.",buttonLabel:"Reload page",onButtonClick:i})).with("uncaughtError",()=>e(o,{title:"Whoops, something went wrong!",message:"We're experiencing some technical difficulties right now. Please try again in a few minutes. Thank you for your patience!",buttonLabel:"Try Again",onButtonClick:i})).exhaustive()};
1
+ import{jsx as e}from"react/jsx-runtime";import{match as t}from"ts-pattern";import{useConfiguratorErrorPageProps as r}from"#package/react-sdk";import{ErrorPage as o}from"#package/ui-sdk";export const BuiltInConfiguratorErrorPage=()=>{let{reason:a,onRetry:i}=r();return t(a).with("presetCreationFailed",()=>e(o,{title:"Whoops, something went wrong!",message:"We couldn't start configuring from this preset. Please reload the page and try again.",buttonLabel:"Reload page",onButtonClick:i})).with("uncaughtError",()=>e(o,{title:"Whoops, something went wrong!",message:"We're experiencing some technical difficulties right now. Please try again in a few minutes. Thank you for your patience!",buttonLabel:"Try Again",onButtonClick:i})).exhaustive()};
@@ -1,9 +1,4 @@
1
1
  import { type ConfiguratorErrorPageProps } from '#package/react-sdk';
2
- /**
3
- * The name a project registers a layout element under to replace the configurator's production error
4
- * page. Its default, `BuiltInConfiguratorErrorPage`, is registered in `defaultConfiguratorElements`.
5
- */
6
- export declare const ConfiguratorErrorPageName = "ConfiguratorErrorPage";
7
2
  /**
8
3
  * Renders the `ConfiguratorErrorPage` element. The page is shown after something already failed, so
9
4
  * a registered page that throws in turn falls back to the built-in page instead of taking the
@@ -1 +1 @@
1
- import{jsx as r}from"react/jsx-runtime";import{useCallback as e}from"react";import{ErrorBoundary as o}from"react-error-boundary";import{PhoenixLayoutElement as t,useLogger as a,usePhoenixElementSlots as n}from"#package/react-sdk";import{BuiltInConfiguratorErrorPage as i}from"./BuiltInConfiguratorErrorPage.js";export const ConfiguratorErrorPageName="ConfiguratorErrorPage";export const ConfiguratorErrorPageElement=g=>{let m=a(),{layoutElements:s}=n(),f=e(r=>{m.error("The ConfiguratorErrorPage element threw while rendering, so the built-in error page is shown instead. Fix the error in the registered ConfiguratorErrorPage element.",{},r)},[m]);return r(o,{fallback:r(i,{...g}),onError:f,resetKeys:[s[ConfiguratorErrorPageName]],children:r(t,{name:ConfiguratorErrorPageName,elementProps:{...g}})})};
1
+ import{jsx as r}from"react/jsx-runtime";import{useCallback as e}from"react";import{ErrorBoundary as o}from"react-error-boundary";import{ConfiguratorErrorPageName as t,ConfiguratorErrorPagePropsProvider as n,PhoenixLayoutElement as a,useLogger as i,usePhoenixElementSlots as m}from"#package/react-sdk";import{BuiltInConfiguratorErrorPage as s}from"./BuiltInConfiguratorErrorPage.js";export const ConfiguratorErrorPageElement=l=>{let g=i(),{layoutElements:f}=m(),u=e(r=>{g.error("The ConfiguratorErrorPage element threw while rendering, so the built-in error page is shown instead. Fix the error in the registered ConfiguratorErrorPage element.",{},r)},[g]);return r(n,{value:l,children:r(o,{fallback:r(s,{}),onError:u,resetKeys:[f[t]],children:r(a,{name:t,elementProps:{...l}})})})};
@@ -1,3 +1,2 @@
1
1
  export { BuiltInConfiguratorErrorPage } from './BuiltInConfiguratorErrorPage.js';
2
- export { ConfiguratorErrorPageElement, ConfiguratorErrorPageName } from './ConfiguratorErrorPageElement.js';
3
- export { createConfiguratorErrorPage, type CreateConfiguratorErrorPage } from './create-configurator-error-page.js';
2
+ export { ConfiguratorErrorPageElement } from './ConfiguratorErrorPageElement.js';
@@ -1 +1 @@
1
- export{BuiltInConfiguratorErrorPage}from"./BuiltInConfiguratorErrorPage.js";export{ConfiguratorErrorPageElement,ConfiguratorErrorPageName}from"./ConfiguratorErrorPageElement.js";export{createConfiguratorErrorPage}from"./create-configurator-error-page.js";
1
+ export{BuiltInConfiguratorErrorPage}from"./BuiltInConfiguratorErrorPage.js";export{ConfiguratorErrorPageElement}from"./ConfiguratorErrorPageElement.js";
@@ -1,6 +1,13 @@
1
1
  export { ConfiguratorApp } from './ConfiguratorApp.js';
2
- export { createConfigurationNotFoundPage, type CreateConfigurationNotFoundPage, } from './configuration-not-found-page/index.js';
3
- export { createConfiguratorErrorPage, type CreateConfiguratorErrorPage } from './configurator-error-page/index.js';
2
+ export {
3
+ /** @deprecated Use `createConfigurationNotFoundPage` from `@salsita-ai/sdk/react`. */
4
+ createConfigurationNotFoundPage,
5
+ /** @deprecated Use `CreateConfigurationNotFoundPage` from `@salsita-ai/sdk/react`. */
6
+ type CreateConfigurationNotFoundPage,
7
+ /** @deprecated Use `createConfiguratorErrorPage` from `@salsita-ai/sdk/react`. */
8
+ createConfiguratorErrorPage,
9
+ /** @deprecated Use `CreateConfiguratorErrorPage` from `@salsita-ai/sdk/react`. */
10
+ type CreateConfiguratorErrorPage, } from '#package/react-sdk';
4
11
  export * from './application-runtime/index.js';
5
12
  export * from './common/index.js';
6
13
  export * from './toolbar-actions/index.js';
@@ -1 +1 @@
1
- export{ConfiguratorApp}from"./ConfiguratorApp.js";export{createConfigurationNotFoundPage}from"./configuration-not-found-page/index.js";export{createConfiguratorErrorPage}from"./configurator-error-page/index.js";export*from"./application-runtime/index.js";export*from"./common/index.js";export*from"./toolbar-actions/index.js";export*from"./configurator-context/index.js";export*from"./pages/index.js";export*from"./scene/index.js";export*from"./ui/index.js";export*from"./integration/index.js";
1
+ export{ConfiguratorApp}from"./ConfiguratorApp.js";export{createConfigurationNotFoundPage,createConfiguratorErrorPage}from"#package/react-sdk";export*from"./application-runtime/index.js";export*from"./common/index.js";export*from"./toolbar-actions/index.js";export*from"./configurator-context/index.js";export*from"./pages/index.js";export*from"./scene/index.js";export*from"./ui/index.js";export*from"./integration/index.js";
@@ -1 +1 @@
1
- import{jsx as o}from"react/jsx-runtime";import{ConfigurationNotFoundPageElement as n}from"../configuration-not-found-page/index.js";import{useConfiguratorRouting as r}from"../configurator-context/index.js";export const ConfiguratorNotFoundPage=()=>o(n,{onBack:r().goToIndex});
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,LoadedDataProvider as m,PhoenixLayoutElement as g,useAccessService as p,useAnalyticsService as v,useAuthorizedClient as I,useConfiguratorDomainFactory as h,useConfiguratorLoadStatus as j,useConfiguratorRawLoadedData as C,useLoadedDataActions as k,useLoadingError as w,useLoadingPhase as y,useLogger as b,useRoutingService as x,useSpecAssistant as M}from"#package/react-sdk";import{useConfigurator as E}from"../application-runtime/index.js";import{IntegrationSubscription as L,OnConfiguratorReadyProvider as D,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}=E(),r=null!=M();t(()=>{if(r)return o.activate()},[o,r])})(),o(f,{children:o(i,{children:r(D,{children:[o(u,{}),o(g,{name:P}),o(q,{onMount:e})]})})})));export const LoadedConfiguratorDetailPage=()=>{let[i,e]=a(!1),t=n(()=>{e(!0)},[]),{configurationId:u,accessInfo:f}=p(),g=I(),M=x(),E=b(),D=v(),{startConfiguratorLoad:P,completeConfiguratorLoad:q,failConfiguratorLoad:G,resetConfiguratorLoad:N}=k(),{isLoading:z,isError:H}=j(),J=C(),K=h(),O=n(()=>f.viewMode&&void 0!==f.revisionId?g.getConfigurationRevision(u,f.revisionId):g.getConfiguration(u),[f.revisionId,f.viewMode,g,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")),E.appendToGlobalContext({configurationId:o.configurationId,revisionId:o.revisionId,mode:f.viewMode}),E.info("Configuration loaded.")},[f.viewMode,D,q,K,E]),W=n(o=>{if(G(o),o instanceof d)return void M.rejectAccessToken(u,f.raw);let r=o instanceof Error?o:Error("Configuration loading failed with an unknown error.",{cause:o});E.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,E,M]),X=n(()=>{N()},[N]);return(S({key:[g,u,f.revisionId,f.viewMode],load:O,onStart:Q,onSuccess:U,onError:W,onCleanup:X}),y({id:l.DataFetch,label:"Loading configuration…"},z||!H&&!i),w(H),H)?o(T,{}):null===J?null:o(m,{value:J,children:o(A,{fallbackRender:r=>o(V,{...r}),children:o(c,{type:"configurator",children:o(A,{FallbackComponent:R,children:r(L,{children:[o(F,{}),o(B,{onLayoutMount:t})]})})})})})};
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{createCustomPhoenixLayoutElement as o}from"#package/domain";import{ConfigurationNotFoundPage as r,createNotAuthenticatedPage as t}from"#package/react-sdk";import{AppLoaderContentName as e,DefaultAppLoaderContent as i}from"../app-loader-content/index.js";import{createConfigurationNotFoundPage as m}from"../configuration-not-found-page/index.js";import{BuiltInConfiguratorErrorPage as a,createConfiguratorErrorPage as f}from"../configurator-error-page/index.js";import{createPresetUi as n}from"../ui/index.js";import{DefaultConfiguratorLayout as p}from"./DefaultConfiguratorLayout.js";import{DefaultNotAuthenticatedPage as u}from"./DefaultNotAuthenticatedPage.js";import{DefaultPresetUi as s}from"./DefaultPresetUi.js";import{ConfiguratorLayoutName as d}from"./configurator-layout-name.js";import{domainControlElements as g,recipePanelElements as c,sceneControlElements as j,sidebarFooterElements as l,toolbarElements as x}from"./default-elements/index.js";export const defaultConfiguratorElements=[o(d,p),m(r),t(u),n(s),f(a),o(e,i),...g,...c,...j,...x,...l];
1
+ import{createCustomPhoenixLayoutElement as o}from"#package/domain";import{AppLoaderContentName as r,ConfigurationNotFoundPageName as t,ConfiguratorErrorPageName as e,createNotAuthenticatedPage as a,createPresetUi as m}from"#package/react-sdk";import{DefaultAppLoaderContent as i}from"../app-loader-content/index.js";import{BuiltInConfigurationNotFoundPage as f}from"../configuration-not-found-page/index.js";import{BuiltInConfiguratorErrorPage as n}from"../configurator-error-page/index.js";import{DefaultConfiguratorLayout as p}from"./DefaultConfiguratorLayout.js";import{DefaultNotAuthenticatedPage as u}from"./DefaultNotAuthenticatedPage.js";import{DefaultPresetUi as s}from"./DefaultPresetUi.js";import{ConfiguratorLayoutName as d}from"./configurator-layout-name.js";import{domainControlElements as g,recipePanelElements as c,sceneControlElements as l,sidebarFooterElements as j,toolbarElements as x}from"./default-elements/index.js";export const defaultConfiguratorElements=[o(d,p),o(t,f),a(u),m(s),o(e,n),o(r,i),...g,...c,...l,...x,...j];
@@ -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,useFrontendData as m,useIsDev as f,useLoadedData as u,useOverridesHash as p,usePublishedData as b,useSessionService as x}from"#package/react-sdk";import{JsonViewer as g,StackTraceViewer as v}from"#package/ui-sdk";import{useConfiguratorRouting as y}from"../../configurator-context/index.js";import{useResetOnEditorHotReload as k}from"./use-reset-on-editor-hot-reload.js";let w=()=>{let r=y();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=u(),a=l(),c=x(),d=b(),f=m(),p=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:f}),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:p}),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=f(),u=p();k(h);let b=d(null);if(c(()=>{if(h){if(null===b.current){b.current=u;return}u!==b.current&&h()}},[u,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(v,{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(v,{stack:x,error:l})]}),t(o,{}),t(S,{})]})})};
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 r}from"react/jsx-runtime";import{useCallback as o}from"react";import{ErrorBoundary as t}from"react-error-boundary";import{useLoadingStateManager as e}from"#package/react-sdk";export const LoadingErrorBoundary=a=>{let{onError:m,onReset:n,...c}=a,p=e(),i=o((r,o)=>{p?.reportError(),m?.(r,o)},[p,m]),s=o(r=>{p?.clearError(),n?.(r)},[p,n]);return r(t,{...c,onError:i,onReset:s})};
1
+ import{jsx as r}from"react/jsx-runtime";import{useCallback as o}from"react";import{ErrorBoundary as t}from"react-error-boundary";import{useLoadingActions as e}from"#package/react-sdk";export const LoadingErrorBoundary=a=>{let{onError:m,onReset:n,...c}=a,p=e(),i=o((r,o)=>{p?.reportError(),m?.(r,o)},[p,m]),s=o(r=>{p?.clearError(),n?.(r)},[p,n]);return r(t,{...c,onError:i,onReset:s})};
@@ -1,2 +1,3 @@
1
1
  export { useMeasurements, type UseMeasurements, type UseMeasurementsOptions, type UseMeasurementsResult, } from './use-measurements.js';
2
2
  export { useAssistantPanel, type UseAssistantPanel, type UseAssistantPanelResult } from './use-assistant-panel.js';
3
+ export { useToolbarActions, type UseToolbarActions, type UseToolbarActionsResult, type ToolbarAction, type ToolbarPlacement, } from './use-toolbar-actions.js';
@@ -1 +1 @@
1
- export{useMeasurements}from"./use-measurements.js";export{useAssistantPanel}from"./use-assistant-panel.js";
1
+ export{useMeasurements}from"./use-measurements.js";export{useAssistantPanel}from"./use-assistant-panel.js";export{useToolbarActions}from"./use-toolbar-actions.js";
@@ -0,0 +1,100 @@
1
+ import { type ComponentType } from 'react';
2
+ import type { DimensionUnit } from '#package/domain';
3
+ import { type UseLocaleSwitchResult } from '#package/react-sdk';
4
+ import { type UseAssistantPanelResult } from './use-assistant-panel.js';
5
+ import { type UseMeasurementsResult } from './use-measurements.js';
6
+ /** Which of the spec's toolbar lists to read: `toolbar.desktop`, `toolbar.mobile` or `toolbar.mobileMenu`. */
7
+ export type ToolbarPlacement = 'desktop' | 'mobile' | 'mobileMenu';
8
+ interface ToolbarEntryBase {
9
+ /** Stable for the entry's placement, group and position, to key the rendered list */
10
+ readonly key: string;
11
+ /** The element's `icon` prop, when its kind has one and the spec sets it */
12
+ readonly icon: string | undefined;
13
+ /**
14
+ * The element's `showTitle` prop, else the built-in button's default: `true` for the assistant, else `false`. The
15
+ * built-in assistant button also hides its title on a phone or tablet-sized layout; the layout decides that here.
16
+ */
17
+ readonly showTitle: boolean;
18
+ /** The built-in button's title in the current language, such as "Undo" or "Share"; a custom entry's `name` */
19
+ readonly label: string;
20
+ }
21
+ /**
22
+ * One entry of the toolbar, by `kind`:
23
+ * - `undo`, `redo`: `run` undoes or redoes as `useUndoRedo` does; `disabled` while there is nothing to undo or redo.
24
+ * - `fullscreen`: `active` is the fullscreen flag, `run` toggles it and pushes the built-in button's analytics event.
25
+ * - `resetCamera`: `run` resets the camera as `useResetCamera` does.
26
+ * - `share`: the layout opens its own share dialog, which calls `useShareLinks`.
27
+ * - `measurements`: the layout opens its own settings over `measurements`, the result of `useMeasurements` with the
28
+ * element's `showIndicatorSwitch` applied; `icons` is the element's icon per unit, when the spec sets it.
29
+ * - `language`: the layout opens its own language list over `language`, the result of `useLocaleSwitch`.
30
+ * - `help`: `Content` renders the help, the element's children or else the help registered with
31
+ * `createToolbarHelp`, for the layout's own dialog. The built-in menu action falls back to nothing instead.
32
+ * - `assistant`: `run` opens or closes the assistant panel; `assistant` is the result of `useAssistantPanel`.
33
+ * - `custom`: `Element` renders the project element the spec's `customLayoutElement` names.
34
+ */
35
+ export type ToolbarAction = (ToolbarEntryBase & {
36
+ readonly kind: 'undo';
37
+ readonly disabled: boolean;
38
+ readonly run: () => void;
39
+ }) | (ToolbarEntryBase & {
40
+ readonly kind: 'redo';
41
+ readonly disabled: boolean;
42
+ readonly run: () => void;
43
+ }) | (ToolbarEntryBase & {
44
+ readonly kind: 'fullscreen';
45
+ readonly active: boolean;
46
+ readonly run: () => void;
47
+ }) | (ToolbarEntryBase & {
48
+ readonly kind: 'resetCamera';
49
+ readonly run: () => void;
50
+ }) | (ToolbarEntryBase & {
51
+ readonly kind: 'share';
52
+ }) | (ToolbarEntryBase & {
53
+ readonly kind: 'measurements';
54
+ readonly measurements: UseMeasurementsResult;
55
+ readonly icons: Partial<Record<DimensionUnit, string>> | undefined;
56
+ }) | (ToolbarEntryBase & {
57
+ readonly kind: 'language';
58
+ readonly language: UseLocaleSwitchResult;
59
+ }) | (ToolbarEntryBase & {
60
+ readonly kind: 'help';
61
+ readonly Content: ComponentType;
62
+ }) | (ToolbarEntryBase & {
63
+ readonly kind: 'assistant';
64
+ readonly assistant: UseAssistantPanelResult;
65
+ readonly run: () => void;
66
+ }) | (ToolbarEntryBase & {
67
+ readonly kind: 'custom';
68
+ readonly name: string;
69
+ readonly Element: ComponentType;
70
+ });
71
+ export interface UseToolbarActionsResult {
72
+ /**
73
+ * The spec's groups (`toolbarButtonGroup`), each a list of entries; an entry outside a group is a group of one, and
74
+ * a group nested in a group is flattened into it, where the built-in toolbar nests it
75
+ */
76
+ readonly groups: readonly (readonly ToolbarAction[])[];
77
+ /** The same entries, flattened */
78
+ readonly actions: readonly ToolbarAction[];
79
+ }
80
+ export type UseToolbarActions = (placement?: ToolbarPlacement) => UseToolbarActionsResult;
81
+ /**
82
+ * Hook to build a project layout's toolbar from the spec's `toolbar`, as the built-in `LayoutSlots.DesktopToolbar`,
83
+ * `LayoutSlots.MobileToolbar` and `LayoutSlots.MobileHamburgerMenu` do, as runnable entries instead of buttons.
84
+ * - It reads the first active root `toolbar` component's list for `placement` (`'desktop'` by default). Without
85
+ * one, it reads the default toolbar, which follows fullscreen and, for a viewer, leaves out share, undo and redo.
86
+ * - It leaves out an entry with nothing to offer: share when sharing is disabled, measurements or language with
87
+ * nothing to choose, help without content, the assistant without one in the spec. It leaves out an element that is
88
+ * not a toolbar entry, with a warning in development.
89
+ * - A project element registered under a built-in kind, such as `undoToolbarButton`, replaces that button in the
90
+ * built-in toolbar but not here: the entry stays the built-in action.
91
+ * - It differs from the built-in toolbar in four ways: the entries keep the spec's order for every placement, where
92
+ * `LayoutSlots.MobileToolbar` renders the `mobile` list reversed; a group nested in a group is flattened into it;
93
+ * the assistant's `showTitle` is the spec's, where the built-in button also hides its title on a phone or
94
+ * tablet-sized layout; and a `helpMenuAction` without children shows the registered help.
95
+ *
96
+ * The actions push the analytics events of the built-in buttons. Opening and closing the layout's own dialogs and
97
+ * popovers push none; the layout pushes its own through `useAnalytics`.
98
+ */
99
+ export declare const useToolbarActions: UseToolbarActions;
100
+ export {};
@@ -0,0 +1 @@
1
+ import{jsx as e}from"react/jsx-runtime";import{useCallback as t,useEffect as n,useMemo as a,useRef as o}from"react";import{P as r,match as s}from"ts-pattern";import{FrontendAnalyticsFactory as l,PhoenixLayoutElementWithChildren as i,PhoenixLayoutElements as u,useAnalyticsService as d,useIsDev as m,useIsFullscreenActive as p,useLocaleSwitch as b,useResolveLocalizable as c,useSetFullscreen as g,useShareLinks as h,useStoreSelector as k,useUndoRedo as T}from"#package/react-sdk";import{useConfigurator as B}from"../application-runtime/index.js";import{useAssistantPanel as f}from"./use-assistant-panel.js";import{useMeasurements as w}from"./use-measurements.js";import{useToolbarHelp as A}from"./use-toolbar-help.js";let v={undo:{id:"sdk.toolbar.undoRedo.undo.label",message:"Undo"},redo:{id:"sdk.toolbar.undoRedo.redo.label",message:"Redo"},enterFullscreen:{id:"sdk.toolbar.fullscreen.enter.label",message:"Open fullscreen"},exitFullscreen:{id:"sdk.toolbar.fullscreen.exit.label",message:"Exit fullscreen"},resetCamera:{id:"sdk.toolbar.camera.reset.label",message:"Reset camera"},shareToolbarButton:{id:"sdk.toolbar.share.open.label",message:"Share"},shareMenuAction:{id:"sdk.layout.menu.hamburger.share.label",message:"Share configuration"},measurementsToolbarButton:{id:"sdk.measurements",message:"Change measure"},measurementsMenuAction:{id:"sdk.layout.menu.measurements.label",message:"Change measure"},languageToolbarButton:{id:"sdk.toolbar.language.title",message:"Switch language"},languageMenuAction:{id:"sdk.layout.hamburgerMenu.language.label",message:"Change Language"},helpToolbarButton:{id:"sdk.toolbar.help.label",message:"Help"},helpMenuAction:{id:"sdk.layout.menu.hamburger.help.label",message:"Show help"},assistant:{id:"sdk.assistant.toolbarButton.label",message:"Assistant"}},C=(e,t,n=!1)=>({key:e,icon:t?.icon,showTitle:t?.showTitle??n});export const useToolbarActions=(M="desktop")=>{let{layoutSystem:P,cameraControlSystem:x}=B(),S=k(e=>P.getToolbarState(e.state),[P])[M],y=d(),$=c(),F=m(),R=T(),j=p(),L=g(),E=h({enabled:!1}),G=w(),D=b(),I=f(),O=A(),U=t(()=>{y.push(l.FullScreenModeToggled()),L(!j)},[y,L,j]),H=t(()=>{x.resetCamera()},[x]),W=t(()=>{I.setOpen(!I.open)},[I]),q=o(new WeakMap),z=t((e,t)=>{let n=q.current.get(e);if(n)return n;let a=()=>t();return q.current.set(e,a),a},[]),J=a(()=>{let t=[],n=(n,a)=>s(n).returnType().with({kind:"undoToolbarButton"},e=>({...C(a,e.props),kind:"undo",label:$(v.undo),disabled:!R.canUndo,run:R.undo})).with({kind:"redoToolbarButton"},e=>({...C(a,e.props),kind:"redo",label:$(v.redo),disabled:!R.canRedo,run:R.redo})).with({kind:r.union("enterFullscreenToolbarButton","exitFullscreenToolbarButton")},e=>({...C(a,e.props),kind:"fullscreen",label:$(j?v.exitFullscreen:v.enterFullscreen),active:j,run:U})).with({kind:"resetCameraToolbarButton"},e=>({...C(a,e.props),kind:"resetCamera",label:$(v.resetCamera),run:H})).with({kind:r.union("shareToolbarButton","shareMenuAction")},e=>E.available?{...C(a,e.props),kind:"share",label:$(v[e.kind])}:null).with({kind:r.union("measurementsToolbarButton","measurementsMenuAction")},e=>{let t=e.props?.showIndicatorSwitch??G.hasIndicatorSwitch,n=G.units.length>1||t;return n?{...C(a,void 0),kind:"measurements",label:$(v[e.kind]),measurements:{...G,hasIndicatorSwitch:t,available:n},icons:e.props?.icons}:null}).with({kind:r.union("languageToolbarButton","languageMenuAction")},e=>D.available?{...C(a,void 0),kind:"language",label:$(v[e.kind]),language:D}:null).with({kind:r.union("helpToolbarButton","helpMenuAction")},t=>{let{children:n}=t,o=void 0!==n?z(t,()=>e(u,{elements:n})):O;return o?{...C(a,t.props),kind:"help",label:$(v[t.kind]),Content:o}:null}).with({kind:"assistantToolbarButton"},e=>I.available?{...C(a,e.props,!0),kind:"assistant",label:$(v.assistant),assistant:I,run:W}:null).with({kind:"customLayoutElement"},t=>({...C(a,void 0),kind:"custom",label:t.props.name,name:t.props.name,Element:z(t,()=>e(i,{kind:t.kind,elementProps:t.props,children:t.children}))})).with({kind:r.union("toolbarButtonGroup","adminConnectedResourcePage","adminDataTableActions","adminDataTablePage","adminPresetActions","adminPresetCategoryActions","adminPresetCategoryPage","adminPresetListPage","adminRecipeActions","adminRecipeCollectionPage","enterSummaryButton","footerPrice","mainFooterActions","nextStepButton","otherActions","previousStepButton","saveTemplateButton","stepLabel","stepProgress")},e=>(t.push(e.kind),null)).exhaustive(),a=(e,t)=>{if("toolbarButtonGroup"!==e.kind){let a=n(e,`${t}-0`);return a?[a]:[]}return(e.children??[]).flatMap((e,o)=>"toolbarButtonGroup"===e.kind?a(e,`${t}-${o}`):n(e,`${t}-${o}`)??[])},o=(S??[]).map((e,t)=>a(e,`${M}-${t}`)).filter(e=>e.length>0);return{groups:o,actions:o.flat(),unsupported:t}},[S,M,$,R,j,U,H,E.available,G,D,I,W,O,z]),K=J.unsupported.join(", ");return n(()=>{F&&K&&console.warn(`useToolbarActions('${M}') leaves out elements that are not toolbar entries: ${K}.`)},[F,M,K]),a(()=>({groups:J.groups,actions:J.actions}),[J])};
@@ -0,0 +1,7 @@
1
+ import type { ComponentType } from 'react';
2
+ export type UseToolbarHelp = () => ComponentType | null;
3
+ /**
4
+ * Internal to `useToolbarActions`, not public: the help the project registers with the deprecated
5
+ * `createToolbarHelp`, which the default toolbar's help button shows, as a component, or `null` without one.
6
+ */
7
+ export declare const useToolbarHelp: UseToolbarHelp;
@@ -0,0 +1 @@
1
+ import{jsx as e}from"react/jsx-runtime";import{PhoenixLayoutElement as t,usePhoenixLayoutElementExists as o}from"#package/react-sdk";import{toolbarHelpElementName as r}from"../application-runtime/index.js";let l=()=>e(t,{name:r,elementProps:{},defaultSlot:()=>null});export const useToolbarHelp=()=>o(r)?l:null;
@@ -9,8 +9,9 @@ export interface AssistantToolChipsProps {
9
9
  readonly onUndo: (toolCallIds: ReadonlySet<string>) => void;
10
10
  }
11
11
  /**
12
- * A row of notes on what the assistant did in a reply, one per tool call. A click on a note logs
13
- * the input and the result of its call to the console. While one of the row's changes is the step
12
+ * A row of notes on what the assistant did in a reply, one per tool call, and one for the
13
+ * screenshots of a call that took any. A click on a call's note logs the input and the result of
14
+ * its call to the console. While one of the row's changes is the step
14
15
  * of the undo history the configuration is at, an Undo after the notes takes the row's changes
15
16
  * back, up to a change the user made in between.
16
17
  */
@@ -1 +1 @@
1
- import{jsx as e,jsxs as t}from"react/jsx-runtime";import{ButtonBase as i,Tooltip as a,styled as n}from"@mui/material";import{memo as o,useCallback as s}from"react";import{match as r}from"ts-pattern";import{useLocalizable as d}from"#package/react-sdk";import{PhxIcon as l}from"#package/ui-sdk";import{AssistantPanelName as m}from"./theme.js";let c={id:"sdk.assistant.tool.updateDesign.label",message:"Update design"},p={id:"sdk.assistant.tool.readDesign.label",message:"Read design"},h={id:"sdk.assistant.tool.mistake.hint",message:"The assistant made a mistake."},u={id:"sdk.assistant.tool.cancelled.hint",message:"Stopped before it finished."},f={id:"sdk.assistant.tool.noResult.hint",message:"The result of this step was lost. It may or may not have been done."},g={id:"sdk.assistant.tool.toolBudget.hint",message:"Not done: the assistant reached its limit of steps for one message."},k={id:"sdk.assistant.tool.undo.label",message:"Undo"},x=n("div",{name:m,slot:"chips"})(({theme:{palette:e,spacing:t,typography:i}})=>({...i.caption,alignItems:"start",color:e.text.secondary,display:"grid",gap:t(.75),gridTemplateColumns:"min-content minmax(0, 1fr)"})),y=n("span",{name:m,slot:"activity"})(({theme:{typography:e}})=>({blockSize:`calc(${e.caption.lineHeight} * 1em)`,display:"grid",placeItems:"center"})),w=n(l,{name:m,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"}}}),b=n("span",{name:m,slot:"chip"})(({theme:{palette:e,spacing:t}})=>({cursor:"default",display:"inline-block",whiteSpace:"nowrap","&:not(:last-of-type)::after":{color:e.text.secondary,content:'"\xb7"',display:"inline-block",marginInline:t(.75),textDecoration:"none"},'&[data-chip="failed"]':{color:e.error.main},'&[data-chip="flawed"]':{textDecoration:"line-through",textDecorationColor:e.error.main}})),v=n(i,{name:m,slot:"undoButton"})(({theme:{palette:e,shape:t,spacing:i}})=>({alignItems:"center",animation:"phx-assistant-undo-in 150ms ease-out",borderRadius:t.borderRadius,color:e.primary.main,display:"inline-flex",font:"inherit",gap:i(.5),marginInlineStart:i(1),verticalAlign:"top","&:hover":{textDecoration:"underline"},"@media (prefers-reduced-motion: reduce)":{animation:"none"},"@keyframes phx-assistant-undo-in":{from:{opacity:0}}})),C=o(({tool:t})=>{let{chip:i,input:n,result:o}=t,l=d(c),m=d(p),k=d(h),x=d(u),y=d(f),w=d(g),v=r(i.label).with({kind:"text"},({text:e})=>e).with({kind:"updateDesign"},()=>l).with({kind:"readDesign"},()=>m).exhaustive(),C=s(()=>{console.info(`Assistant tool call "${v}"`,{input:n,result:o})},[n,v,o]);return e(a,{title:r(i).with({errorCode:"cancelled"},()=>x).with({errorCode:"no_result"},()=>y).with({errorCode:"tool_budget"},()=>w).with({state:"failed"},{state:"flawed"},()=>k).otherwise(()=>""),placement:"top-start",children:e(b,{onClick:C,"data-chip":i.state,children:v})})});export const AssistantToolChips=o(({tools:i,isActive:a,canUndo:n,onUndo:o})=>{let r=d(k),m=s(()=>{o(new Set(i.map(({id:e})=>e)))},[o,i]);return t(x,{"data-chips":a?"active":"done","aria-busy":a,children:[e(y,{children:e(w,{name:"Gear"})}),t("div",{children:[i.map(t=>e(C,{tool:t},t.id)),n&&t(v,{onClick:m,children:[e(l,{name:"ArrowCounterClockwise",fontSize:"inherit"}),r]})]})]})});
1
+ import{jsx as e,jsxs as t,Fragment as n}from"react/jsx-runtime";import{ButtonBase as o,ClickAwayListener as i,Tooltip as a,styled as s}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 g}from"./reference-link/index.js";import{ScreenshotThumbnails as f,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."},C={id:"sdk.assistant.tool.cancelled.hint",message:"Stopped before it finished."},v={id:"sdk.assistant.tool.noResult.hint",message:"The result of this step was lost. It may or may not have been done."},D={id:"sdk.assistant.tool.toolBudget.hint",message:"Not done: the assistant reached its limit of steps for one message."},I={id:"sdk.assistant.tool.undo.label",message:"Undo"},S={id:"sdk.assistant.tool.screenshots.label",message:"{count, plural, one {# screenshot} other {# screenshots}}"},j=s("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)"})),T=s("span",{name:x,slot:"activity"})(({theme:{typography:e}})=>({blockSize:`calc(${e.caption.lineHeight} * 1em)`,display:"grid",placeItems:"center"})),A=s(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"}}}),R=s("span",{name:x,slot:"chip"})(({theme:{palette:e,spacing:t}})=>({cursor:"default",display:"inline-block",whiteSpace:"nowrap","&:not(:last-of-type)::after":{color:e.text.secondary,content:'"\xb7"',display:"inline-block",marginInline:t(.75),textDecoration:"none"},'&[data-chip="failed"]':{color:e.error.main},'&[data-chip="flawed"]':{textDecoration:"line-through",textDecorationColor:e.error.main}})),z=s("span",{name:x,slot:"screenshotsLink"})(g),E=s(o,{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}}})),L=r(({tool:t})=>{let{chip:n,input:o,result:i}=t,s=h(y),r=h(b),d=h(w),c=h(C),m=h(v),u=h(D),g=p(n.label).with({kind:"text"},({text:e})=>e).with({kind:"updateDesign"},()=>s).with({kind:"readDesign"},()=>r).exhaustive(),f=l(()=>{console.info(`Assistant tool call "${g}"`,{input:o,result:i})},[o,g,i]);return e(a,{title:p(n).with({errorCode:"cancelled"},()=>c).with({errorCode:"no_result"},()=>m).with({errorCode:"tool_budget"},()=>u).with({state:"failed"},{state:"flawed"},()=>d).otherwise(()=>""),placement:"top-start",children:e(R,{onClick:f,"data-chip":n.state,children:g})})}),P=r(({screenshots:t})=>{let n=h({...S,values:{count:t.length}}),[o,s]=m(!1),r=l(()=>s(!0),[]),d=l(()=>s(!1),[]),p=c(null),u=l(e=>{p.current=e},[]),g=l(()=>{p.current?.update()},[]),k=l(e=>{("Enter"===e.key||" "===e.key)&&(e.preventDefault(),s(!0))},[]);return e(R,{"data-chip":"screenshots",children:e(i,{onClickAway:d,mouseEvent:!!o&&"onClick",touchEvent:!!o&&"onTouchEnd",children:e(a,{open:o,onOpen:r,onClose:d,title:e(f,{screenshots:t,onImageLoad:g}),placement:"top-start",describeChild:!0,disableTouchListener:!0,PopperProps:{popperRef:u},slotProps:{tooltip:{sx:{background:"none",maxInlineSize:"none",padding:0}}},children:e(z,{role:"button",tabIndex:0,"aria-expanded":o,onClick:r,onKeyDown:k,children:n})})})})}),B=({tool:o})=>{let i=d(()=>k(o.result),[o.result]);return t(n,{children:[e(L,{tool:o}),i.length>0&&e(P,{screenshots:i})]})};export const AssistantToolChips=r(({tools:n,isActive:o,canUndo:i,onUndo:a})=>{let s=h(I),r=l(()=>{a(new Set(n.map(({id:e})=>e)))},[a,n]);return t(j,{"data-chips":o?"active":"done","aria-busy":o,children:[e(T,{children:e(A,{name:"Gear"})}),t("div",{children:[n.map(t=>e(B,{tool:t},t.id)),i&&t(E,{onClick:r,children:[e(u,{name:"ArrowCounterClockwise",fontSize:"inherit"}),s]})]})]})});
@@ -6,7 +6,7 @@ export interface AssistantMarkdownProps {
6
6
  readonly forms: AssistantFormsVisibility;
7
7
  }
8
8
  /**
9
- * Assistant text of the thread: Markdown with lists, tables, links, entity links, references, images, code and forms,
9
+ * Assistant text of the thread: Markdown with lists, tables, alerts, links, entity links, references, images, code and forms,
10
10
  * without a bubble. A form fence the model is still writing shows a placeholder.
11
11
  */
12
12
  export declare const AssistantMarkdown: import("react").MemoExoticComponent<({ markdown, isStreaming, forms }: AssistantMarkdownProps) => import("react/jsx-runtime").JSX.Element>;
@@ -1 +1 @@
1
- import{jsx as e,Fragment as r}from"react/jsx-runtime";import{styled as n}from"@mui/material";import{createContext as i,memo as o,useContext as t,useMemo as l}from"react";import a,{defaultUrlTransform as d}from"react-markdown";import m from"remark-gfm";import{AssistantEntityLink as s}from"./entity-link/index.js";import{AssistantForm as c}from"./form/index.js";import{AssistantReferenceLink as u,isAssistantLinkHref as p,parseAssistantLinkTarget as g}from"./reference-link/index.js";import{AssistantImage as f}from"./resource-image/index.js";import{completeStreamedMarkdown as h,hasOpenFence as k}from"./streamed-markdown.js";import{AssistantPanelName as b}from"./theme.js";let v=n("div",{name:b,slot:"assistantMessage"})(({theme:{palette:e,shape:r,spacing:n,typography:i}})=>({overflowWrap:"anywhere","& > :first-child":{marginBlockStart:0},"& > :last-child":{marginBlockEnd:0},"p, ul, ol, pre, blockquote":{marginBlock:n(1)},"h1, h2, h3, h4, h5, h6":{...i.subtitle2,marginBlock:n(1.5,.5)},"ul, ol":{paddingInlineStart:n(2.5)},a:{color:e.primary.main},code:{background:e.action.hover,borderRadius:r.borderRadius/2,fontFamily:"ui-monospace, Menlo, monospace",fontSize:"0.9em",paddingInline:n(.5)},pre:{background:e.action.hover,borderRadius:r.borderRadius,overflowX:"auto",padding:n(1),code:{background:"none",padding:0}},blockquote:{borderInlineStart:`2px solid ${e.divider}`,color:e.text.secondary,marginInline:0,paddingInlineStart:n(1.5)},"th, td":{borderBlockEnd:`1px solid ${e.divider}`,padding:n(.5,1),textAlign:"start",verticalAlign:"top"}})),x=n("div")({overflowX:"auto",table:{borderCollapse:"collapse",inlineSize:"100%"}}),y=i({forms:"hidden",openFenceEnd:void 0,isStreaming:!1}),j=({source:r,end:n})=>{let{forms:i,openFenceEnd:o,isStreaming:l}=t(y);return"hidden"===i?null:null!=n&&n===o?l?e(c,{source:r,status:"writing"}):null:e(c,{source:r,status:"disabled"===i?"waiting":"ready"})},w={a:({node:n,children:i,href:o,...t})=>{if(null==o||!p(o))return e("a",{...t,href:o,target:"_blank",rel:"noopener noreferrer",children:i});let l=g(o);return null==l?e(r,{children:i}):"entity"===l.kind?e(s,{id:l.id,children:i}):e(u,{target:l,children:i})},img:({src:r,alt:n})=>e(f,{src:r,alt:n}),pre:({node:r,children:n,...i})=>{let o=(e=>{let[r]=e?.children??[];if(r?.type!=="element"||"code"!==r.tagName)return;let{className:n}=r.properties;if(Array.isArray(n)&&n.includes("language-form"))return r.children.map(e=>"text"===e.type?e.value:"").join("")})(r);return null==o?e("pre",{...i,children:n}):e(j,{source:o,end:r?.position?.end.offset})},table:({node:r,children:n,...i})=>e(x,{children:e("table",{...i,children:n})})},S=[m],A=e=>p(e)?e:d(e);export const AssistantMarkdown=o(({markdown:r,isStreaming:n,forms:i})=>{let o=n?h(r):r,t=k(r)?o.length:void 0,d=l(()=>({forms:i,openFenceEnd:t,isStreaming:n}),[i,t,n]);return e(v,{children:e(y.Provider,{value:d,children:e(a,{components:w,remarkPlugins:S,urlTransform:A,children:o})})})});
1
+ import{jsx as e,Fragment as r}from"react/jsx-runtime";import{styled as n}from"@mui/material";import{createContext as i,memo as o,useContext as t,useMemo as l}from"react";import a,{defaultUrlTransform as d}from"react-markdown";import m from"remark-gfm";import{AssistantAlert as s,isAlertKind as c,remarkAlerts as u}from"./alert/index.js";import{AssistantEntityLink as p}from"./entity-link/index.js";import{AssistantForm as h}from"./form/index.js";import{AssistantReferenceLink as f,isAssistantLinkHref as g,parseAssistantLinkTarget as k}from"./reference-link/index.js";import{AssistantImage as b}from"./resource-image/index.js";import{completeStreamedMarkdown as v,hasOpenFence as x}from"./streamed-markdown.js";import{AssistantPanelName as y}from"./theme.js";let j=n("div",{name:y,slot:"assistantMessage"})(({theme:{palette:e,shape:r,spacing:n,typography:i}})=>({overflowWrap:"anywhere","& > :first-child":{marginBlockStart:0},"& > :last-child":{marginBlockEnd:0},"p, ul, ol, pre, blockquote":{marginBlock:n(1)},"h1, h2, h3, h4, h5, h6":{...i.subtitle2,marginBlock:n(1.5,.5)},"ul, ol":{paddingInlineStart:n(2.5)},a:{color:e.primary.main},code:{background:e.action.hover,borderRadius:r.borderRadius/2,fontFamily:"ui-monospace, Menlo, monospace",fontSize:"0.9em",paddingInline:n(.5)},pre:{background:e.action.hover,borderRadius:r.borderRadius,overflowX:"auto",padding:n(1),code:{background:"none",padding:0}},blockquote:{borderInlineStart:`2px solid ${e.divider}`,color:e.text.secondary,marginInline:0,paddingInlineStart:n(1.5)},"th, td":{borderBlockEnd:`1px solid ${e.divider}`,padding:n(.5,1),textAlign:"start",verticalAlign:"top"}})),w=n("div")({overflowX:"auto",table:{borderCollapse:"collapse",inlineSize:"100%"}}),S=i({forms:"hidden",openFenceEnd:void 0,isStreaming:!1}),A=({source:r,end:n})=>{let{forms:i,openFenceEnd:o,isStreaming:l}=t(S);return"hidden"===i?null:null!=n&&n===o?l?e(h,{source:r,status:"writing"}):null:e(h,{source:r,status:"disabled"===i?"waiting":"ready"})},B={a:({node:n,children:i,href:o,...t})=>{if(null==o||!g(o))return e("a",{...t,href:o,target:"_blank",rel:"noopener noreferrer",children:i});let l=k(o);return null==l?e(r,{children:i}):"entity"===l.kind?e(p,{id:l.id,children:i}):e(f,{target:l,children:i})},blockquote:({node:r,children:n,...i})=>{let o=r?.properties.dataAlert;return c(o)?e(s,{kind:o,children:n}):e("blockquote",{...i,children:n})},img:({src:r,alt:n})=>e(b,{src:r,alt:n}),pre:({node:r,children:n,...i})=>{let o=(e=>{let[r]=e?.children??[];if(r?.type!=="element"||"code"!==r.tagName)return;let{className:n}=r.properties;if(Array.isArray(n)&&n.includes("language-form"))return r.children.map(e=>"text"===e.type?e.value:"").join("")})(r);return null==o?e("pre",{...i,children:n}):e(A,{source:o,end:r?.position?.end.offset})},table:({node:r,children:n,...i})=>e(w,{children:e("table",{...i,children:n})})},I=[m,u],q=e=>g(e)?e:d(e);export const AssistantMarkdown=o(({markdown:r,isStreaming:n,forms:i})=>{let o=n?v(r):r,t=x(r)?o.length:void 0,d=l(()=>({forms:i,openFenceEnd:t,isStreaming:n}),[i,t,n]);return e(j,{children:e(S.Provider,{value:d,children:e(a,{components:B,remarkPlugins:I,urlTransform:q,children:o})})})});
@@ -0,0 +1,8 @@
1
+ import { type ReactNode } from 'react';
2
+ import type { AlertKind } from './remark-alerts.js';
3
+ export interface AssistantAlertProps {
4
+ readonly kind: AlertKind;
5
+ readonly children: ReactNode;
6
+ }
7
+ /** A GitHub alert in a reply: its content as Markdown, marked by the colour and icon of its kind. */
8
+ export declare const AssistantAlert: import("react").MemoExoticComponent<({ kind, children }: AssistantAlertProps) => import("react/jsx-runtime").JSX.Element>;
@@ -0,0 +1 @@
1
+ import{jsx as r,jsxs as i}from"react/jsx-runtime";import{alpha as o,styled as t}from"@mui/material";import{memo as n}from"react";import{PhxIcon as a}from"#package/ui-sdk";import{AssistantPanelName as e}from"../theme.js";let l={note:{color:"info",icon:"Info"},tip:{color:"success",icon:"Lightbulb"},important:{color:"primary",icon:"WarningCircle"},warning:{color:"warning",icon:"Warning"},caution:{color:"error",icon:"XCircle"}},c=t("div",{name:e,slot:"alert"})(({theme:{palette:r,shape:i,spacing:t,typography:n}})=>({borderInlineStart:"3px solid",borderRadius:i.borderRadius,display:"grid",gap:t(1),gridTemplateColumns:"min-content minmax(0, 1fr)",marginBlock:t(1),padding:t(1,1.5),...Object.fromEntries(Object.entries(l).map(([i,{color:t}])=>[`&[data-alert="${i}"]`,{background:o(r[t].main,.08),borderInlineStartColor:r[t].main,"& > :first-child":{color:r[t].main}}])),"& > :last-child > :first-child":{marginBlockStart:0},"& > :last-child > :last-child":{marginBlockEnd:0},"& > :first-child":{blockSize:`calc(${n.body2.lineHeight} * 1em)`,display:"grid",placeItems:"center"}}));export const AssistantAlert=n(({kind:o,children:t})=>i(c,{role:"note","data-alert":o,children:[r("span",{children:r(a,{name:l[o].icon})}),r("div",{children:t})]}));
@@ -0,0 +1,2 @@
1
+ export { AssistantAlert } from './AssistantAlert.js';
2
+ export { isAlertKind, remarkAlerts } from './remark-alerts.js';
@@ -0,0 +1 @@
1
+ export{AssistantAlert}from"./AssistantAlert.js";export{isAlertKind,remarkAlerts}from"./remark-alerts.js";
@@ -0,0 +1,10 @@
1
+ import type { Root } from 'mdast';
2
+ /** The kinds of GitHub alerts a reply can write, each with its own colour and icon. */
3
+ export type AlertKind = 'note' | 'tip' | 'important' | 'warning' | 'caution';
4
+ export declare const isAlertKind: (value: unknown) => value is AlertKind;
5
+ /**
6
+ * Remark plugin for GitHub alerts: a blockquote whose first line is a marker such as `[!WARNING]`
7
+ * loses the marker and carries its kind as the `dataAlert` property (`data-alert` in the page), for the `blockquote` override to render as a
8
+ * callout. A blockquote with an unknown marker stays as it is.
9
+ */
10
+ export declare const remarkAlerts: () => (tree: Root) => void;
@@ -0,0 +1 @@
1
+ let e=["note","tip","important","warning","caution"],t=/^\[!([a-z]+)\][ \t]*(?:\n|$)/i;export const isAlertKind=t=>"string"==typeof t&&e.some(e=>e===t);let r=e=>{let[r]=e.children;if(r?.type!=="paragraph")return;let[n,l]=r.children;if(n?.type!=="text")return;let i=t.exec(n.value),a=i?.[1]?.toLowerCase();if(null==i||!isAlertKind(a))return;let o=n.value.slice(i[0].length),c=!i[0].endsWith("\n")&&l?.type==="break";if(i[0].endsWith("\n")||null==l||c)return""===o?r.children.splice(0,c?2:1):n.value=o,0===r.children.length&&e.children.shift(),a},n=e=>{for(let t of e){if("blockquote"===t.type){let e=r(t);if(null!=e){t.data={...t.data,hProperties:{...t.data?.hProperties,dataAlert:e}};continue}}"children"in t&&n(t.children)}};export const remarkAlerts=()=>e=>{n(e.children)};
@@ -1 +1 @@
1
- import{jsx as e,jsxs as i}from"react/jsx-runtime";import{Trans as r}from"@lingui/react";import{Button as t,styled as o}from"@mui/material";import{memo as n,useCallback as a,useEffect as s,useMemo as l,useState as d}from"react";import{match as m}from"ts-pattern";import{useConfigurator as c}from"../../../application-runtime/index.js";import{AssistantPanelName as p}from"../theme.js";import{getBuiltInFormRegistry as u}from"./built-in-form-registry.js";import{composeAnswer as b}from"./compose-answer.js";import{describeBuildErrors as f}from"./describe-build-errors.js";import{parseFormBlock as g}from"./parse-form-block.js";let h=o("form",{name:p,slot:"form"})(({theme:{spacing:e}})=>({display:"flex",flexDirection:"column",gap:e(1.5),marginBlock:e(1)})),k=o(t,{name:p,slot:"formSubmit"})(({theme:{palette:e,spacing:i,typography:r}})=>({...r.body2,alignSelf:"end",background:e.primary.main,border:"none",borderRadius:8,color:e.primary.contrastText,fontWeight:r.fontWeightMedium,letterSpacing:"normal",minBlockSize:0,minInlineSize:0,paddingBlock:i(.5),paddingInline:i(2),textTransform:"none","&:hover":{background:e.primary.dark,border:"none"},"&.Mui-disabled":{background:e.action.disabledBackground,border:"none",color:e.action.disabled}})),w=o("div",{name:p,slot:"formNote"})(({theme:{palette:e,shape:i,spacing:r,typography:t}})=>({...t.caption,alignItems:"center",background:e.action.hover,borderRadius:i.borderRadius,color:e.text.secondary,display:"flex",flexWrap:"wrap",gap:r(1),justifyContent:"space-between",marginBlock:r(1),paddingBlock:r(1),paddingInline:r(1.5)})),x=({model:t,disabled:o,send:n})=>{let[a,s]=d(()=>new Map),[l,c]=d(()=>new Map),p=(i,r)=>{let{id:d,definition:u,label:f,value:g,attributes:h}=i;return m(u).with({role:"option"},({component:m})=>e(m,{attributes:h,label:f,disabled:o,selected:!0===a.get(d),onSelect:()=>{t.isQuick?n(b(t,new Map([[i.id,!0]]),l)):s(e=>{let t=new Map(e);if("choice"===r.definition.role){for(let e of r.children)t.delete(e.id);t.set(i.id,!0)}else t.set(i.id,!0!==e.get(i.id));return t})}},d)).with({role:"input"},({component:r})=>e(r,{attributes:h,label:f,value:g,disabled:o,state:a.get(d),onChange:(e,r)=>{s(r=>new Map(r).set(i.id,e)),c(e=>new Map(e).set(i.id,r))}},d)).with({role:"group"},{role:"choice"},{role:"choices"},({component:r})=>e(r,{attributes:h,label:f,disabled:o,children:i.children.map(e=>p(e,i))},d)).exhaustive()};return i(h,{onSubmit:e=>{e.preventDefault(),o||t.isQuick||n(b(t,a,l))},children:[t.root.children.map(e=>p(e,t.root)),!t.isQuick&&e(k,{type:"submit",variant:"contained",disabled:o,disableElevation:!0,children:e(r,{id:"sdk.assistant.form.submit.label",message:"Submit"})})]})};export const AssistantForm=n(({source:o,status:n})=>{let{assistantSystem:m}=c(),[p,b]=d(!1),h="writing"===n,k=l(()=>h?void 0:g(o,u()),[o,h]),y="ready"!==n||p,j=a(e=>{b(!0),m.send(e).finally(()=>b(!1))},[m]);return(s(()=>{k?.ok===!1&&console.warn("The assistant wrote a form that could not be built.",k.errors)},[k]),k)?k.ok?0===k.root.children.length?null:e(x,{model:k,disabled:y,send:j}):i(w,{role:"alert",children:[e("span",{children:e(r,{id:"sdk.assistant.form.failure",message:"The assistant couldn't build this form."})}),e(t,{size:"small",variant:"outlined",color:"inherit",disabled:y,onClick:()=>j(f(k.errors)),children:e(r,{id:"sdk.assistant.form.fix.label",message:"Fix it"})})]}):e(w,{children:e(r,{id:"sdk.assistant.form.writing",message:"Preparing a form…"})})});
1
+ import{jsx as e,jsxs as i}from"react/jsx-runtime";import{Trans as r}from"@lingui/react";import{Button as o,styled as t}from"@mui/material";import{memo as n,useCallback as a,useEffect as s,useMemo as l,useState as d}from"react";import{match as m}from"ts-pattern";import{useConfigurator as c}from"../../../application-runtime/index.js";import{AssistantPanelName as p}from"../theme.js";import{composeAnswer as u}from"./compose-answer.js";import{describeBuildErrors as b}from"./describe-build-errors.js";import{parseFormBlock as f}from"./parse-form-block.js";import{useFormRegistry as g}from"./registry/index.js";let h=t("div",{name:p,slot:"form"})(({theme:{spacing:e}})=>({display:"flex",flexDirection:"column",gap:e(1.5),marginBlock:e(1)})),k=t(o,{name:p,slot:"formSubmit"})(({theme:{palette:e,spacing:i,typography:r}})=>({...r.body2,alignSelf:"end",background:e.primary.main,border:"none",borderRadius:8,color:e.primary.contrastText,fontWeight:r.fontWeightMedium,letterSpacing:"normal",minBlockSize:0,minInlineSize:0,paddingBlock:i(.5),paddingInline:i(2),textTransform:"none","&:hover":{background:e.primary.dark,border:"none"},"&.Mui-disabled":{background:e.action.disabledBackground,border:"none",color:e.action.disabled}})),w=t("div",{name:p,slot:"formNote"})(({theme:{palette:e,shape:i,spacing:r,typography:o}})=>({...o.caption,alignItems:"center",background:e.action.hover,borderRadius:i.borderRadius,color:e.text.secondary,display:"flex",flexWrap:"wrap",gap:r(1),justifyContent:"space-between",marginBlock:r(1),paddingBlock:r(1),paddingInline:r(1.5)})),x=({model:o,disabled:t,send:n})=>{let[a,s]=d(()=>new Map),[l,c]=d(()=>new Map),p=(i,r)=>{let{id:l,definition:d,label:b,attributes:f}=i;return m(d).with({role:"option"},({component:d})=>e(d,{attributes:f,label:b,disabled:t,selected:!0===a.get(l),onSelect:e=>{o.isQuick?n(u(o,new Map([[i.id,!0]]),new Map([[i.id,e]]))):(c(r=>new Map(r).set(i.id,e)),s(e=>{let o=new Map(e);if("choice"===r.definition.role){for(let e of r.children)o.delete(e.id);o.set(i.id,!0)}else o.set(i.id,!0!==e.get(i.id));return o}))}},l)).with({role:"input"},({component:r})=>e(r,{attributes:f,label:b,disabled:t,state:a.get(l),onChange:(e,r)=>{o.isQuick?n(u(o,new Map([[i.id,e]]),new Map([[i.id,r]]))):(s(r=>new Map(r).set(i.id,e)),c(e=>new Map(e).set(i.id,r)))}},l)).with({role:"group"},{role:"choice"},{role:"choices"},({component:r})=>e(r,{attributes:f,label:b,disabled:t,children:i.children.map(e=>p(e,i))},l)).exhaustive()};return i(h,{children:[o.root.children.map(e=>p(e,o.root)),!o.isQuick&&e(k,{variant:"contained",disabled:t,disableElevation:!0,onClick:()=>{t||o.isQuick||n(u(o,a,l))},children:e(r,{id:"sdk.assistant.form.submit.label",message:"Submit"})})]})};export const AssistantForm=n(({source:t,status:n})=>{let{assistantSystem:m}=c(),[p,u]=d(!1),h="writing"===n,k=g(),M=l(()=>h?void 0:f(t,k),[t,h,k]),y="ready"!==n||p,j=a(e=>{u(!0),m.send(e).finally(()=>u(!1))},[m]);return(s(()=>{M?.ok===!1&&console.warn("The assistant wrote a form that could not be built.",M.errors)},[M]),M)?M.ok?0===M.root.children.length?null:e(x,{model:M,disabled:y,send:j}):i(w,{role:"alert",children:[e("span",{children:e(r,{id:"sdk.assistant.form.failure",message:"The assistant couldn't build this form."})}),e(o,{size:"small",variant:"outlined",color:"inherit",disabled:y,onClick:()=>j(b(M.errors)),children:e(r,{id:"sdk.assistant.form.fix.label",message:"Fix it"})})]}):e(w,{children:e(r,{id:"sdk.assistant.form.writing",message:"Preparing a form…"})})});
@@ -6,6 +6,6 @@ export declare const FORM_PLACEHOLDER = "\u2014";
6
6
  * The user's answer to a form, sent as their message: one line per labelled container or input as
7
7
  * `Label: value`, a bare line for an unlabelled one, two spaces of indentation per labelled
8
8
  * container, and the placeholder for anything unanswered. Unlabelled groups are flattened into
9
- * their parent, and a picked option answers with its value, or its label without one.
9
+ * their parent, and a picked option, as an input, answers with what it reported.
10
10
  */
11
11
  export declare const composeAnswer: (model: BuiltFormModel, state: FormState, answers: FormAnswers) => string;
@@ -1 +1 @@
1
- import{match as t}from"ts-pattern";export const FORM_PLACEHOLDER="—";let e=(t,e)=>`${" ".repeat(t)}${e}`,n=(t,e)=>null==t?e:`${t}: ${e}`,r=({value:t,label:e})=>t??e??"",i=({children:t},{state:e})=>t.filter(({id:t})=>!0===e.get(t)).map(r),o=(r,l,p)=>{let{label:h}=r;return t(r.definition.role).with("group",()=>{if(null==h)return r.children.flatMap(t=>o(t,l,p));let t=r.children.flatMap(t=>o(t,l+1,p));return t.length>0?[e(l,`${h}:`),...t]:[e(l,`${h}: —`)]}).with("choice",()=>[e(l,n(h,i(r,p)[0]??"—"))]).with("choices",()=>{let t=i(r,p);return 0===t.length?[e(l,n(h,"—"))]:null==h?t.map(t=>e(l,t)):[e(l,`${h}:`),...t.map(t=>e(l+1,t))]}).with("input",()=>[e(l,n(h,(({id:t,value:e},{answers:n})=>n.has(t)?n.get(t):""===e?void 0:e)(r,p)??"—"))]).with("option",()=>[]).exhaustive()};export const composeAnswer=(t,e,n)=>o(t.root,0,{state:e,answers:n}).join("\n");
1
+ import{match as t}from"ts-pattern";export const FORM_PLACEHOLDER="—";let e=(t,e)=>`${" ".repeat(t)}${e}`,n=(t,e)=>null==t?e:`${t}: ${e}`,r=({children:t},{state:e,answers:n})=>t.flatMap(({id:t})=>{let r=n.get(t);return!0===e.get(t)&&null!=r&&""!==r?[r]:[]}),l=(i,o,p)=>{let{label:a}=i;return t(i.definition.role).with("group",()=>{if(null==a)return i.children.flatMap(t=>l(t,o,p));let t=i.children.flatMap(t=>l(t,o+1,p));return t.length>0?[e(o,`${a}:`),...t]:[e(o,`${a}: —`)]}).with("choice",()=>[e(o,n(a,r(i,p)[0]??"—"))]).with("choices",()=>{let t=r(i,p);return 0===t.length?[e(o,n(a,"—"))]:null==a?t.map(t=>e(o,t)):[e(o,`${a}:`),...t.map(t=>e(o+1,t))]}).with("input",()=>[e(o,n(a,p.answers.get(i.id)??"—"))]).with("option",()=>[]).exhaustive()};export const composeAnswer=(t,e,n)=>l(t.root,0,{state:e,answers:n}).join("\n");
@@ -1,4 +1,4 @@
1
- import type { FormElementDefinition } from './form-element-definition.js';
1
+ import type { FormElementDefinition } from './registry/index.js';
2
2
  /**
3
3
  * An element of a parsed form. Options outside a `choice` or `choices` are already wrapped in an
4
4
  * implicit container, and the top level of the block is an implicit group without a label.
@@ -8,7 +8,6 @@ export interface FormNode {
8
8
  readonly id: string;
9
9
  readonly definition: FormElementDefinition;
10
10
  readonly label?: string;
11
- readonly value?: string;
12
11
  readonly attributes: Readonly<Record<string, unknown>>;
13
12
  readonly children: readonly FormNode[];
14
13
  }
@@ -21,8 +20,8 @@ export interface FormBuildError {
21
20
  readonly message: string;
22
21
  }
23
22
  /**
24
- * A form fence as the panel renders it, or every reason it cannot. A quick form asks one question:
25
- * the first pick sends it, and it has no submit button.
23
+ * A form fence as the panel renders it, or every reason it cannot. A quick form asks one question,
24
+ * a choice or a quick input: the first pick or action sends it, and it has no submit button.
26
25
  */
27
26
  export type FormModel = {
28
27
  readonly ok: true;