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

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 (534) 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/errors/diagnostic-codes.d.ts +9 -0
  13. package/dist/application-spec/errors/diagnostic-codes.js +1 -1
  14. package/dist/application-spec/errors/diagnostic-messages.d.ts +10 -1
  15. package/dist/application-spec/errors/diagnostic-messages.js +1 -1
  16. package/dist/application-spec/generate-application/code/domain-runtime-files.js +1 -1
  17. package/dist/application-spec/generate-application/code/project-scaffolding.js +2 -2
  18. package/dist/application-spec/generate-application/code/templates/application-types.js +6 -6
  19. package/dist/application-spec/generate-application/code/templates/common/doc-comment.d.ts +2 -0
  20. package/dist/application-spec/generate-application/code/templates/common/doc-comment.js +1 -0
  21. package/dist/application-spec/generate-application/code/templates/configurator-globals.d.ts +2 -1
  22. package/dist/application-spec/generate-application/code/templates/configurator-globals.js +19 -6
  23. package/dist/application-spec/generate-application/code/templates/global-definition/generate-action-types.js +7 -7
  24. package/dist/application-spec/generate-application/code/templates/global-definition/generate-assistant-form-element-types.d.ts +12 -0
  25. package/dist/application-spec/generate-application/code/templates/global-definition/generate-assistant-form-element-types.js +7 -0
  26. package/dist/application-spec/generate-application/code/templates/global-definition/generate-phx-types.js +24 -22
  27. package/dist/application-spec/generate-application/code/templates/global-definition/index.d.ts +1 -0
  28. package/dist/application-spec/generate-application/code/templates/global-definition/index.js +1 -1
  29. package/dist/application-spec/generate-application/code/templates/index.d.ts +2 -6
  30. package/dist/application-spec/generate-application/code/templates/index.js +1 -1
  31. package/dist/application-spec/generate-application/code/templates/skills/phoenix-skill-bundle.d.ts +10 -0
  32. package/dist/application-spec/generate-application/code/templates/skills/phoenix-skill-bundle.js +7 -0
  33. package/dist/application-spec/generate-application/code/templates/skills/phoenix-skill.js +1 -1
  34. package/dist/application-spec/generate-application/code/templates/skills/sdk-content.d.ts +13 -6
  35. package/dist/application-spec/generate-application/code/templates/skills/sdk-content.js +2 -2
  36. package/dist/application-spec/generate-application/implementations/phx-application-types.d.ts +25 -0
  37. package/dist/application-spec/generate-application/implementations/phx-application-types.js +1 -0
  38. package/dist/application-spec/generate-application/implementations/phx-domain.d.ts +36 -0
  39. package/dist/application-spec/generate-application/implementations/phx-domain.js +1 -0
  40. package/dist/application-spec/generate-application/implementations/phx-model.d.ts +24 -0
  41. package/dist/application-spec/generate-application/implementations/phx-model.js +1 -0
  42. package/dist/application-spec/generate-application/implementations/phx.d.ts +22 -0
  43. package/dist/application-spec/generate-application/implementations/phx.js +1 -0
  44. package/dist/application-spec/generate-application/index.d.ts +2 -0
  45. package/dist/application-spec/generate-application/index.js +1 -1
  46. package/dist/application-spec/generate-application/runtime/admin-runtime/admin-model-runtime.d.ts +3 -3
  47. package/dist/application-spec/generate-application/runtime/admin-runtime/admin-runtime.d.ts +7 -4
  48. package/dist/application-spec/generate-application/runtime/admin-runtime/admin-runtime.js +1 -1
  49. package/dist/application-spec/generate-application/runtime/admin-runtime/admin-spec-runtime.d.ts +16 -0
  50. package/dist/application-spec/generate-application/runtime/admin-runtime/admin-spec-runtime.js +1 -0
  51. package/dist/application-spec/generate-application/runtime/application-runtime.d.ts +17 -4
  52. package/dist/application-spec/generate-application/runtime/application-runtime.js +1 -1
  53. package/dist/application-spec/generate-application/runtime/application-spec-slice.d.ts +71 -0
  54. package/dist/application-spec/generate-application/runtime/application-spec-slice.js +1 -0
  55. package/dist/application-spec/generate-application/runtime/configurator-runtime/configurator-model-runtime.d.ts +3 -3
  56. package/dist/application-spec/generate-application/runtime/configurator-runtime/configurator-runtime.d.ts +7 -5
  57. package/dist/application-spec/generate-application/runtime/configurator-runtime/configurator-runtime.js +1 -1
  58. package/dist/application-spec/generate-application/runtime/configurator-runtime/configurator-spec-runtime.d.ts +16 -0
  59. package/dist/application-spec/generate-application/runtime/configurator-runtime/configurator-spec-runtime.js +1 -0
  60. package/dist/application-spec/generate-application/runtime/create-application.d.ts +57 -0
  61. package/dist/application-spec/generate-application/runtime/create-application.js +1 -0
  62. package/dist/application-spec/generate-application/runtime/index.d.ts +8 -0
  63. package/dist/application-spec/generate-application/runtime/index.js +1 -0
  64. package/dist/application-spec/generate-application/runtime/sections/expression-runtime.d.ts +9 -3
  65. package/dist/application-spec/generate-application/runtime/sections/expression-runtime.js +1 -1
  66. package/dist/application-spec/generate-application/runtime/spec-runtime.d.ts +21 -0
  67. package/dist/application-spec/generate-application/runtime/spec-runtime.js +1 -0
  68. package/dist/application-spec/generate-application/runtime-spec/encoded-runtime-spec.d.ts +3 -2
  69. package/dist/application-spec/generate-application/runtime-spec/runtime-spec.d.ts +44 -9
  70. package/dist/application-spec/generate-application/runtime-spec/runtime-spec.js +1 -1
  71. package/dist/application-spec/parse-application-files/raw-spec/raw-assistant.d.ts +33 -3
  72. package/dist/application-spec/parse-application-files/raw-spec/raw-assistant.js +1 -1
  73. package/dist/application-spec/parse-application-files/spec/sections/assistant/assistant-form-elements.d.ts +9 -0
  74. package/dist/application-spec/parse-application-files/spec/sections/assistant/assistant-form-elements.js +1 -0
  75. package/dist/application-spec/parse-application-files/spec/sections/assistant/assistant-schema.d.ts +4 -1
  76. package/dist/application-spec/parse-application-files/spec/sections/assistant/assistant-schema.js +1 -1
  77. package/dist/client/authorized-client.d.ts +3 -1
  78. package/dist/client/authorized-client.js +1 -1
  79. package/dist/client/contract.d.ts +17 -0
  80. package/dist/client/index.d.ts +1 -1
  81. package/dist/client/local-authorized-client.d.ts +3 -1
  82. package/dist/client/local-authorized-client.js +1 -1
  83. package/dist/client/memory-authorized-client.d.ts +4 -1
  84. package/dist/client/memory-authorized-client.js +1 -1
  85. package/dist/client/phoenix-api.d.ts +228 -0
  86. package/dist/configurator/ConfiguratorApp.js +1 -1
  87. package/dist/configurator/app-loader-content/index.d.ts +0 -1
  88. package/dist/configurator/app-loader-content/index.js +1 -1
  89. package/dist/configurator/application-runtime/extensions/selectors.js +1 -1
  90. package/dist/configurator/application-runtime/extensions/systems/assistant-system/assistant-system.d.ts +17 -3
  91. package/dist/configurator/application-runtime/extensions/systems/assistant-system/assistant-system.js +1 -1
  92. package/dist/configurator/application-runtime/extensions/systems/assistant-system/graphql-tools.d.ts +34 -7
  93. package/dist/configurator/application-runtime/extensions/systems/assistant-system/graphql-tools.js +1 -1
  94. package/dist/configurator/application-runtime/extensions/systems/canvas-system.d.ts +8 -0
  95. package/dist/configurator/application-runtime/extensions/systems/canvas-system.js +1 -1
  96. package/dist/configurator/application-runtime/extensions/systems/export-system/export-busy-error.d.ts +8 -0
  97. package/dist/configurator/application-runtime/extensions/systems/export-system/export-busy-error.js +1 -0
  98. package/dist/configurator/application-runtime/extensions/systems/export-system/export-system.d.ts +23 -1
  99. package/dist/configurator/application-runtime/extensions/systems/export-system/export-system.js +1 -1
  100. package/dist/configurator/application-runtime/extensions/systems/graphql-system/entity-meta.d.ts +14 -1
  101. package/dist/configurator/application-runtime/extensions/systems/graphql-system/entity-meta.js +1 -1
  102. package/dist/configurator/application-runtime/extensions/systems/graphql-system/graphql-system.d.ts +51 -4
  103. package/dist/configurator/application-runtime/extensions/systems/graphql-system/graphql-system.js +1 -1
  104. package/dist/configurator/application-runtime/extensions/systems/image-rendering-system/image-rendering-system.d.ts +14 -5
  105. package/dist/configurator/application-runtime/extensions/systems/image-rendering-system/image-rendering-system.js +1 -1
  106. package/dist/configurator/application-runtime/extensions/systems/index.d.ts +1 -1
  107. package/dist/configurator/common/configurator-interface.d.ts +14 -6
  108. package/dist/configurator/common/configurator-interface.js +1 -1
  109. package/dist/configurator/configuration-not-found-page/BuiltInConfigurationNotFoundPage.d.ts +5 -0
  110. package/dist/configurator/configuration-not-found-page/BuiltInConfigurationNotFoundPage.js +1 -0
  111. package/dist/configurator/configuration-not-found-page/ConfigurationNotFoundPageElement.d.ts +0 -6
  112. package/dist/configurator/configuration-not-found-page/ConfigurationNotFoundPageElement.js +1 -1
  113. package/dist/configurator/configuration-not-found-page/index.d.ts +2 -2
  114. package/dist/configurator/configuration-not-found-page/index.js +1 -1
  115. package/dist/configurator/configurator-context/ConfiguratorResponsiveProvider.d.ts +3 -3
  116. package/dist/configurator/configurator-context/ConfiguratorResponsiveProvider.js +1 -1
  117. package/dist/configurator/configurator-context/PreviewContextProvider.js +1 -1
  118. package/dist/configurator/configurator-context/configurator-hooks/layout-hooks.d.ts +4 -0
  119. package/dist/configurator/configurator-context/configurator-routing/ConfiguratorRoutingProvider.js +1 -1
  120. package/dist/configurator/configurator-error-page/BuiltInConfiguratorErrorPage.d.ts +3 -3
  121. package/dist/configurator/configurator-error-page/BuiltInConfiguratorErrorPage.js +1 -1
  122. package/dist/configurator/configurator-error-page/ConfiguratorErrorPageElement.d.ts +0 -5
  123. package/dist/configurator/configurator-error-page/ConfiguratorErrorPageElement.js +1 -1
  124. package/dist/configurator/configurator-error-page/index.d.ts +1 -2
  125. package/dist/configurator/configurator-error-page/index.js +1 -1
  126. package/dist/configurator/index.d.ts +9 -2
  127. package/dist/configurator/index.js +1 -1
  128. package/dist/configurator/pages/default-configurator-elements.js +1 -1
  129. package/dist/configurator/pages/error-boundaries/LoadingErrorBoundary.js +1 -1
  130. package/dist/configurator/toolbar-actions/index.d.ts +1 -0
  131. package/dist/configurator/toolbar-actions/index.js +1 -1
  132. package/dist/configurator/toolbar-actions/use-toolbar-actions.d.ts +100 -0
  133. package/dist/configurator/toolbar-actions/use-toolbar-actions.js +1 -0
  134. package/dist/configurator/toolbar-actions/use-toolbar-help.d.ts +7 -0
  135. package/dist/configurator/toolbar-actions/use-toolbar-help.js +1 -0
  136. package/dist/configurator/ui/assistant/AssistantChips.d.ts +3 -2
  137. package/dist/configurator/ui/assistant/AssistantChips.js +1 -1
  138. package/dist/configurator/ui/assistant/AssistantMarkdown.d.ts +1 -1
  139. package/dist/configurator/ui/assistant/AssistantMarkdown.js +1 -1
  140. package/dist/configurator/ui/assistant/alert/AssistantAlert.d.ts +8 -0
  141. package/dist/configurator/ui/assistant/alert/AssistantAlert.js +1 -0
  142. package/dist/configurator/ui/assistant/alert/index.d.ts +2 -0
  143. package/dist/configurator/ui/assistant/alert/index.js +1 -0
  144. package/dist/configurator/ui/assistant/alert/remark-alerts.d.ts +10 -0
  145. package/dist/configurator/ui/assistant/alert/remark-alerts.js +1 -0
  146. package/dist/configurator/ui/assistant/form/AssistantForm.js +1 -1
  147. package/dist/configurator/ui/assistant/form/compose-answer.d.ts +1 -1
  148. package/dist/configurator/ui/assistant/form/compose-answer.js +1 -1
  149. package/dist/configurator/ui/assistant/form/form-model.d.ts +3 -4
  150. package/dist/configurator/ui/assistant/form/form-state.d.ts +1 -1
  151. package/dist/configurator/ui/assistant/form/index.d.ts +2 -0
  152. package/dist/configurator/ui/assistant/form/index.js +1 -1
  153. package/dist/configurator/ui/assistant/form/parse-form-block.d.ts +3 -2
  154. package/dist/configurator/ui/assistant/form/parse-form-block.js +1 -1
  155. package/dist/configurator/ui/assistant/form/read-form-attributes.d.ts +1 -1
  156. package/dist/configurator/ui/assistant/form/read-form-attributes.js +1 -1
  157. package/dist/configurator/ui/assistant/form/registry/built-in-form-elements.d.ts +3 -0
  158. package/dist/configurator/ui/assistant/form/registry/built-in-form-elements.js +1 -0
  159. package/dist/configurator/ui/assistant/form/registry/create-assistant-form-element.d.ts +31 -0
  160. package/dist/configurator/ui/assistant/form/registry/create-assistant-form-element.js +1 -0
  161. package/dist/configurator/ui/assistant/form/{form-element-definition.d.ts → registry/form-element-definition.d.ts} +3 -1
  162. package/dist/configurator/ui/assistant/form/registry/form-element-definition.js +1 -0
  163. package/dist/configurator/ui/assistant/form/{form-registry.d.ts → registry/form-registry.d.ts} +2 -2
  164. package/dist/configurator/ui/assistant/form/registry/form-registry.js +1 -0
  165. package/dist/configurator/ui/assistant/form/registry/index.d.ts +6 -0
  166. package/dist/configurator/ui/assistant/form/registry/index.js +1 -0
  167. package/dist/configurator/ui/assistant/form/registry/use-form-registry.d.ts +8 -0
  168. package/dist/configurator/ui/assistant/form/registry/use-form-registry.js +1 -0
  169. package/dist/configurator/ui/assistant/form-elements/FormCard.d.ts +9 -0
  170. package/dist/configurator/ui/assistant/form-elements/FormCard.js +1 -0
  171. package/dist/configurator/ui/assistant/form-elements/FormConfirm.d.ts +9 -0
  172. package/dist/configurator/ui/assistant/form-elements/FormConfirm.js +1 -0
  173. package/dist/configurator/ui/assistant/form-elements/FormGroup.d.ts +4 -1
  174. package/dist/configurator/ui/assistant/form-elements/FormNumber.d.ts +9 -0
  175. package/dist/configurator/ui/assistant/form-elements/FormNumber.js +1 -0
  176. package/dist/configurator/ui/assistant/form-elements/FormOptions.d.ts +4 -1
  177. package/dist/configurator/ui/assistant/form-elements/FormReply.d.ts +4 -1
  178. package/dist/configurator/ui/assistant/form-elements/FormReply.js +1 -1
  179. package/dist/configurator/ui/assistant/form-elements/FormSwatch.d.ts +10 -0
  180. package/dist/configurator/ui/assistant/form-elements/FormSwatch.js +1 -0
  181. package/dist/configurator/ui/assistant/form-elements/FormText.d.ts +4 -1
  182. package/dist/configurator/ui/assistant/form-elements/FormText.js +1 -1
  183. package/dist/configurator/ui/assistant/form-elements/clamp-form-number.d.ts +10 -0
  184. package/dist/configurator/ui/assistant/form-elements/clamp-form-number.js +1 -0
  185. package/dist/configurator/ui/assistant/form-elements/form-element-props.d.ts +20 -16
  186. package/dist/configurator/ui/assistant/form-elements/index.d.ts +4 -0
  187. package/dist/configurator/ui/assistant/form-elements/index.js +1 -1
  188. package/dist/configurator/ui/assistant/index.d.ts +3 -0
  189. package/dist/configurator/ui/assistant/index.js +1 -1
  190. package/dist/configurator/ui/assistant/resource-image/index.d.ts +1 -1
  191. package/dist/configurator/ui/assistant/resource-image/index.js +1 -1
  192. package/dist/configurator/ui/assistant/resource-image/resource-path.d.ts +0 -9
  193. package/dist/configurator/ui/assistant/resource-image/resource-path.js +1 -1
  194. package/dist/configurator/ui/assistant/screenshots/ScreenshotThumbnails.d.ts +9 -0
  195. package/dist/configurator/ui/assistant/screenshots/ScreenshotThumbnails.js +1 -0
  196. package/dist/configurator/ui/assistant/screenshots/index.d.ts +2 -0
  197. package/dist/configurator/ui/assistant/screenshots/index.js +1 -0
  198. package/dist/configurator/ui/assistant/screenshots/tool-screenshots.d.ts +22 -0
  199. package/dist/configurator/ui/assistant/screenshots/tool-screenshots.js +1 -0
  200. package/dist/configurator/ui/assistant/screenshots/use-screenshot-src.d.ts +8 -0
  201. package/dist/configurator/ui/assistant/screenshots/use-screenshot-src.js +1 -0
  202. package/dist/configurator/ui/assistant/streamed-markdown.d.ts +2 -2
  203. package/dist/configurator/ui/assistant/streamed-markdown.js +2 -2
  204. package/dist/configurator/ui/assistant/tool-chip.js +1 -1
  205. package/dist/configurator/ui/configurator-layout/slots/canvas/LayoutCanvas.js +1 -1
  206. package/dist/configurator/ui/configurator-layout/slots/canvas/SharedCanvas.js +1 -1
  207. package/dist/configurator/ui/configurator-layout/universal/ExportingOverlay.d.ts +5 -0
  208. package/dist/configurator/ui/configurator-layout/universal/ExportingOverlay.js +1 -0
  209. package/dist/configurator/ui/configurator-layout/universal/Layout.js +1 -1
  210. package/dist/configurator/ui/configurator-layout/universal/use-layout-scene-safe-area.js +1 -1
  211. package/dist/configurator/ui/index.d.ts +1 -0
  212. package/dist/configurator/ui/index.js +1 -1
  213. package/dist/configurator/ui/legacy/layout/common/ReactiveInterfaceLayout.js +1 -1
  214. package/dist/configurator/ui/phoenix-layout-elements/AppLoader.d.ts +0 -7
  215. package/dist/configurator/ui/phoenix-layout-elements/AppLoader.js +2 -2
  216. package/dist/configurator/ui/phoenix-layout-elements/index.d.ts +8 -1
  217. package/dist/configurator/ui/phoenix-layout-elements/index.js +1 -1
  218. package/dist/configurator/ui/preset-layout/PresetUi.d.ts +0 -2
  219. package/dist/configurator/ui/preset-layout/PresetUi.js +1 -1
  220. package/dist/configurator/ui/preset-layout/index.d.ts +6 -1
  221. package/dist/configurator/ui/preset-layout/index.js +1 -1
  222. package/dist/configurator/ui/save-message-snackbars/SaveMessageSnackbars.js +1 -1
  223. package/dist/docs/index.json +95 -1
  224. package/dist/docs/integrations/webcomponent-api/basics.mdx +2 -0
  225. package/dist/docs/layouts/custom-layout.mdx +318 -158
  226. package/dist/docs/layouts/gallery/ardent-compressor.mdx +3516 -0
  227. package/dist/docs/layouts/gallery/corvid-drone.mdx +3428 -0
  228. package/dist/docs/layouts/gallery/fenwick-window.mdx +2803 -0
  229. package/dist/docs/layouts/gallery/ferrule-bar-station.mdx +6567 -0
  230. package/dist/docs/layouts/gallery/kestrel-kettle.mdx +1858 -0
  231. package/dist/docs/layouts/gallery/nightjar-guitar.mdx +3698 -0
  232. package/dist/docs/layouts/gallery/sunfold-solar.mdx +2683 -0
  233. package/dist/docs/layouts/gallery/tidepool-aquascape.mdx +5203 -0
  234. package/dist/docs/other-features/client-side-rendering/declarative.mdx +1 -1
  235. package/dist/docs/phoenix/configurator-interface.mdx +16 -13
  236. package/dist/docs/phoenix/domain-model.mdx +4 -1
  237. package/dist/docs/phoenix/phoenix-cli.mdx +14 -6
  238. package/dist/docs/phoenix/project-structure.mdx +21 -17
  239. package/dist/docs/phoenix/sdk-builder-workflow.mdx +7 -5
  240. package/dist/docs/phoenix/sessions-and-access.mdx +2 -0
  241. package/dist/domain/application/assistant/assistant-manifest.d.ts +16 -1
  242. package/dist/domain/application/assistant/assistant-resolved-manifest.d.ts +8 -1
  243. package/dist/domain/application/assistant/build-assistant-manifest.js +1 -1
  244. package/dist/domain/application/assistant/form/assistant-form-element-name.d.ts +11 -0
  245. package/dist/domain/application/assistant/form/assistant-form-element-name.js +8 -0
  246. package/dist/domain/application/assistant/form/assistant-form-elements.d.ts +174 -0
  247. package/dist/domain/application/assistant/form/assistant-form-elements.js +1 -0
  248. package/dist/domain/application/assistant/form/assistant-resource-path.d.ts +10 -0
  249. package/dist/domain/application/assistant/form/assistant-resource-path.js +1 -0
  250. package/dist/domain/application/assistant/form/index.d.ts +4 -0
  251. package/dist/domain/application/assistant/form/index.js +1 -0
  252. package/dist/domain/application/assistant/generate-assistant-prompt.d.ts +3 -0
  253. package/dist/domain/application/assistant/generate-assistant-prompt.js +1 -1
  254. package/dist/domain/application/assistant/index.d.ts +2 -3
  255. package/dist/domain/application/assistant/index.js +1 -1
  256. package/dist/domain/application/assistant/session-setup/apply-assistant-setup.js +1 -1
  257. package/dist/domain/application/assistant/session-setup/assistant-setup-manifest.d.ts +2 -0
  258. package/dist/domain/application/assistant/session-setup/assistant-setup-manifest.js +1 -1
  259. package/dist/domain/application/configurator-builder.d.ts +7 -1
  260. package/dist/domain/application/configurator-builder.js +1 -1
  261. package/dist/domain/application/index.d.ts +1 -1
  262. package/dist/domain/application/index.js +1 -1
  263. package/dist/domain/application/standard-properties.js +1 -1
  264. package/dist/domain/application/web-component-property.d.ts +3 -1
  265. package/dist/domain/application/web-component-property.js +1 -1
  266. package/dist/domain/available-system-components.d.ts +1 -1
  267. package/dist/domain/available-system-components.js +1 -1
  268. package/dist/domain/domain-builder.d.ts +9 -3
  269. package/dist/domain/domain-builder.js +1 -1
  270. package/dist/domain/domain-context/store-system/store-system.d.ts +5 -0
  271. package/dist/domain/domain-context/store-system/store-system.js +1 -1
  272. package/dist/domain/domain-runtime/application.d.ts +39 -0
  273. package/dist/domain/domain-runtime/application.js +1 -0
  274. package/dist/domain/domain-runtime/domain-context/selectors.d.ts +1 -0
  275. package/dist/domain/domain-runtime/domain-context/selectors.js +1 -1
  276. package/dist/domain/domain-runtime/domain-runtime.d.ts +44 -4
  277. package/dist/domain/domain-runtime/domain-runtime.js +1 -1
  278. package/dist/domain/domain-runtime/environment/initialize.d.ts +1 -1
  279. package/dist/domain/domain-runtime/environment/types.d.ts +1 -1
  280. package/dist/domain/domain-runtime/errors/implementation-error-collector.d.ts +2 -0
  281. package/dist/domain/domain-runtime/errors/implementation-error-collector.js +1 -1
  282. package/dist/domain/domain-runtime/index.d.ts +2 -1
  283. package/dist/domain/domain-runtime/index.js +1 -1
  284. package/dist/domain/domain-runtime/spec/index.d.ts +1 -1
  285. package/dist/domain/domain-runtime/spec/index.js +1 -1
  286. package/dist/domain/domain-runtime/spec/initialize.js +1 -1
  287. package/dist/domain/domain-runtime/spec/module-checks/element-registration.d.ts +15 -1
  288. package/dist/domain/domain-runtime/spec/module-checks/element-registration.js +1 -1
  289. package/dist/domain/domain-runtime/spec/module-checks/find-assistant-form-element-errors.d.ts +12 -0
  290. package/dist/domain/domain-runtime/spec/module-checks/find-assistant-form-element-errors.js +1 -0
  291. package/dist/domain/domain-runtime/spec/module-checks/index.d.ts +3 -1
  292. package/dist/domain/domain-runtime/spec/module-checks/index.js +1 -1
  293. package/dist/domain/domain-runtime/spec/module-checks/merge-expression-modules.d.ts +23 -0
  294. package/dist/domain/domain-runtime/spec/module-checks/merge-expression-modules.js +1 -0
  295. package/dist/domain/domain-runtime/spec/module-checks/resolve-expression-modules.d.ts +3 -4
  296. package/dist/domain/domain-runtime/spec/module-checks/resolve-expression-modules.js +1 -1
  297. package/dist/domain/domain-runtime/spec/selectors.d.ts +3 -1
  298. package/dist/domain/domain-runtime/spec/selectors.js +1 -1
  299. package/dist/domain/domain-runtime/web-component/actions.d.ts +3 -0
  300. package/dist/domain/domain-runtime/web-component/actions.js +1 -1
  301. package/dist/domain/domain-runtime/web-component/initialize.d.ts +1 -0
  302. package/dist/domain/domain-runtime/web-component/initialize.js +1 -1
  303. package/dist/domain/domain-runtime/web-component/selectors.d.ts +2 -0
  304. package/dist/domain/domain-runtime/web-component/selectors.js +1 -1
  305. package/dist/domain/domain-runtime/web-component/types.d.ts +6 -3
  306. package/dist/domain/extensions/export-images/agent-screenshot.d.ts +24 -0
  307. package/dist/domain/extensions/export-images/agent-screenshot.js +1 -0
  308. package/dist/domain/extensions/{client-side-image.d.ts → export-images/client-side-image.d.ts} +2 -2
  309. package/dist/domain/extensions/export-images/client-side-image.js +1 -0
  310. package/dist/domain/extensions/export-images/index.d.ts +3 -0
  311. package/dist/domain/extensions/export-images/index.js +1 -0
  312. package/dist/domain/extensions/{save-template-thumbnail.d.ts → export-images/save-template-thumbnail.d.ts} +2 -2
  313. package/dist/domain/extensions/export-images/save-template-thumbnail.js +1 -0
  314. package/dist/domain/extensions/index.d.ts +1 -2
  315. package/dist/domain/extensions/index.js +1 -1
  316. package/dist/domain/mocks/create-mock-domain-runtime.d.ts +9 -0
  317. package/dist/editor/domain-editors/DomainSpecContext.js +1 -1
  318. package/dist/editor/domain-editors/apply-spec-update.d.ts +10 -2
  319. package/dist/editor/domain-editors/apply-spec-update.js +1 -1
  320. package/dist/editor/domain-editors/use-implementation-files.d.ts +6 -14
  321. package/dist/editor/domain-editors/use-implementation-files.js +1 -1
  322. package/dist/editor/screenshot/ScreenshotHandler.js +1 -1
  323. package/dist/i18n/locales/cs/messages.js +1 -1
  324. package/dist/i18n/locales/da/messages.js +1 -1
  325. package/dist/i18n/locales/de/messages.js +1 -1
  326. package/dist/i18n/locales/de-AT/messages.js +1 -1
  327. package/dist/i18n/locales/en/messages.js +1 -1
  328. package/dist/i18n/locales/en-AU/messages.js +1 -1
  329. package/dist/i18n/locales/en-GB/messages.js +1 -1
  330. package/dist/i18n/locales/es/messages.js +1 -1
  331. package/dist/i18n/locales/fr/messages.js +1 -1
  332. package/dist/i18n/locales/hu/messages.js +1 -1
  333. package/dist/i18n/locales/it/messages.js +1 -1
  334. package/dist/i18n/locales/nl/messages.js +1 -1
  335. package/dist/i18n/locales/pl/messages.js +1 -1
  336. package/dist/i18n/locales/pt/messages.js +1 -1
  337. package/dist/i18n/locales/ro/messages.js +1 -1
  338. package/dist/i18n/locales/sk/messages.js +1 -1
  339. package/dist/i18n/locales/tr/messages.js +1 -1
  340. package/dist/legacy/domain-cli/utils/cache.d.ts +1 -1
  341. package/dist/legacy/domain-cli/utils/cache.js +1 -1
  342. package/dist/legacy/domain-spec/__generated/domain-schema.d.ts +16 -0
  343. package/dist/legacy/domain-spec/spec/domain-spec.js +1 -1
  344. package/dist/legacy/phoenix-cli/project-gen/generators/file-templates/agents/claude-md.d.ts +1 -1
  345. package/dist/legacy/phoenix-cli/project-gen/generators/file-templates/agents/cursor-rules.d.ts +1 -1
  346. package/dist/legacy/phoenix-cli/project-gen/generators/file-templates/agents/shared-sdk-content.d.ts +1 -1
  347. package/dist/legacy/phoenix-cli/project-gen/generators/file-templates/agents/shared-sdk-content.js +11 -5
  348. package/dist/phoenix/application-spec/generate-application-spec-project.js +2 -2
  349. package/dist/phoenix/application-spec/resolve-deployment-data.d.ts +11 -0
  350. package/dist/phoenix/application-spec/resolve-deployment-data.js +2 -2
  351. package/dist/phoenix/cli.js +1 -1
  352. package/dist/phoenix/commands/deploy.js +1 -1
  353. package/dist/phoenix/commands/dev.js +5 -5
  354. package/dist/phoenix/commands/generated-env-markers.d.ts +1 -0
  355. package/dist/phoenix/commands/generated-env-markers.js +1 -1
  356. package/dist/phoenix/commands/index.d.ts +1 -1
  357. package/dist/phoenix/commands/index.js +1 -1
  358. package/dist/phoenix/services/application-spec-project-watcher.d.ts +3 -1
  359. package/dist/phoenix/services/application-spec-project-watcher.js +2 -2
  360. package/dist/phoenix/services/index.d.ts +1 -0
  361. package/dist/phoenix/services/index.js +1 -1
  362. package/dist/phoenix/services/lingui.d.ts +5 -2
  363. package/dist/phoenix/services/lingui.js +1 -1
  364. package/dist/phoenix/services/prepare-development-environment.js +1 -1
  365. package/dist/react-sdk/application-runtime/common-services/analytics/analytics-service.d.ts +1 -1
  366. package/dist/react-sdk/application-runtime/common-services/initialize.d.ts +2 -2
  367. package/dist/react-sdk/application-runtime/hooks/index.d.ts +2 -0
  368. package/dist/react-sdk/application-runtime/hooks/index.js +1 -1
  369. package/dist/react-sdk/application-runtime/hooks/loading/index.d.ts +5 -0
  370. package/dist/react-sdk/application-runtime/hooks/loading/index.js +1 -0
  371. package/dist/react-sdk/application-runtime/hooks/loading/loader-host-context.d.ts +11 -0
  372. package/dist/react-sdk/application-runtime/hooks/loading/loader-host-context.js +1 -0
  373. package/dist/react-sdk/application-runtime/hooks/loading/use-is-awaiting-loading-phase.d.ts +8 -0
  374. package/dist/react-sdk/application-runtime/hooks/loading/use-is-awaiting-loading-phase.js +1 -0
  375. package/dist/react-sdk/application-runtime/hooks/loading/use-is-loader-hosted.d.ts +7 -0
  376. package/dist/react-sdk/application-runtime/hooks/loading/use-is-loader-hosted.js +1 -0
  377. package/dist/react-sdk/application-runtime/hooks/loading/use-loading-actions.d.ts +9 -0
  378. package/dist/react-sdk/application-runtime/hooks/loading/use-loading-actions.js +1 -0
  379. package/dist/react-sdk/application-runtime/hooks/loading/use-loading-application.d.ts +24 -0
  380. package/dist/react-sdk/application-runtime/hooks/loading/use-loading-application.js +1 -0
  381. package/dist/react-sdk/application-runtime/hooks/responsive/index.d.ts +3 -0
  382. package/dist/react-sdk/application-runtime/hooks/responsive/index.js +1 -0
  383. package/dist/react-sdk/application-runtime/hooks/responsive/use-responsive-actions.d.ts +9 -0
  384. package/dist/react-sdk/application-runtime/hooks/responsive/use-responsive-actions.js +1 -0
  385. package/dist/react-sdk/application-runtime/hooks/responsive/use-responsive-application.d.ts +26 -0
  386. package/dist/react-sdk/application-runtime/hooks/responsive/use-responsive-application.js +1 -0
  387. package/dist/react-sdk/application-runtime/hooks/responsive/use-responsive-state.d.ts +10 -0
  388. package/dist/react-sdk/application-runtime/hooks/responsive/use-responsive-state.js +1 -0
  389. package/dist/react-sdk/application-runtime/hooks/responsive/use-responsive-store.d.ts +24 -0
  390. package/dist/react-sdk/application-runtime/hooks/responsive/use-responsive-store.js +1 -0
  391. package/dist/react-sdk/application-runtime/hooks/use-access-service.d.ts +5 -0
  392. package/dist/react-sdk/application-runtime/hooks/use-access-service.js +1 -1
  393. package/dist/react-sdk/application-runtime/hooks/use-phoenix-element-slots.d.ts +2 -1
  394. package/dist/react-sdk/application-runtime/hooks/use-web-component-readonly-sync.d.ts +4 -11
  395. package/dist/react-sdk/application-runtime/hooks/use-web-component-readonly-sync.js +1 -1
  396. package/dist/react-sdk/application-runtime/hooks/use-web-component.d.ts +5 -0
  397. package/dist/react-sdk/application-runtime/hooks/use-web-component.js +1 -1
  398. package/dist/react-sdk/application-runtime/host-properties/actions.d.ts +15 -0
  399. package/dist/react-sdk/application-runtime/host-properties/actions.js +1 -0
  400. package/dist/react-sdk/application-runtime/host-properties/connect-host-properties.d.ts +30 -0
  401. package/dist/react-sdk/application-runtime/host-properties/connect-host-properties.js +1 -0
  402. package/dist/react-sdk/application-runtime/host-properties/domain-host-properties.d.ts +7 -0
  403. package/dist/react-sdk/application-runtime/host-properties/domain-host-properties.js +1 -0
  404. package/dist/react-sdk/application-runtime/host-properties/host-property-descriptors.d.ts +21 -0
  405. package/dist/react-sdk/application-runtime/host-properties/host-property-descriptors.js +1 -0
  406. package/dist/react-sdk/application-runtime/host-properties/host-property-scopes.d.ts +42 -0
  407. package/dist/react-sdk/application-runtime/host-properties/host-property-scopes.js +1 -0
  408. package/dist/react-sdk/application-runtime/host-properties/index.d.ts +8 -0
  409. package/dist/react-sdk/application-runtime/host-properties/index.js +1 -0
  410. package/dist/react-sdk/application-runtime/host-properties/initialize.d.ts +7 -0
  411. package/dist/react-sdk/application-runtime/host-properties/initialize.js +1 -0
  412. package/dist/react-sdk/application-runtime/host-properties/selectors.d.ts +54 -0
  413. package/dist/react-sdk/application-runtime/host-properties/selectors.js +1 -0
  414. package/dist/react-sdk/application-runtime/host-properties/types.d.ts +18 -0
  415. package/dist/react-sdk/application-runtime/index.d.ts +3 -0
  416. package/dist/react-sdk/application-runtime/integration/initialize.d.ts +7 -6
  417. package/dist/react-sdk/application-runtime/integration/initialize.js +1 -1
  418. package/dist/react-sdk/application-runtime/integration/selectors.d.ts +11 -2
  419. package/dist/react-sdk/application-runtime/integration/selectors.js +1 -1
  420. package/dist/react-sdk/application-runtime/integration/types.d.ts +5 -2
  421. package/dist/react-sdk/application-runtime/loading/actions.d.ts +45 -0
  422. package/dist/react-sdk/application-runtime/loading/actions.js +1 -0
  423. package/dist/react-sdk/application-runtime/loading/index.d.ts +4 -0
  424. package/dist/react-sdk/application-runtime/loading/index.js +1 -0
  425. package/dist/react-sdk/application-runtime/loading/initialize.d.ts +3 -0
  426. package/dist/react-sdk/application-runtime/loading/initialize.js +1 -0
  427. package/dist/react-sdk/application-runtime/loading/selectors.d.ts +18 -0
  428. package/dist/react-sdk/application-runtime/loading/selectors.js +1 -0
  429. package/dist/react-sdk/application-runtime/loading/types.d.ts +59 -0
  430. package/dist/react-sdk/application-runtime/mocks/create-mock-application-runtime.js +1 -1
  431. package/dist/react-sdk/application-runtime/provider/ApplicationRuntime.d.ts +6 -0
  432. package/dist/react-sdk/application-runtime/provider/ApplicationRuntime.js +1 -1
  433. package/dist/react-sdk/application-runtime/provider/ApplicationType.d.ts +7 -0
  434. package/dist/react-sdk/application-runtime/provider/ApplicationType.js +1 -1
  435. package/dist/react-sdk/application-runtime/responsive/actions.d.ts +47 -0
  436. package/dist/react-sdk/application-runtime/responsive/actions.js +1 -0
  437. package/dist/react-sdk/application-runtime/responsive/index.d.ts +4 -0
  438. package/dist/react-sdk/application-runtime/responsive/index.js +1 -0
  439. package/dist/react-sdk/application-runtime/responsive/initialize.d.ts +3 -0
  440. package/dist/react-sdk/application-runtime/responsive/initialize.js +1 -0
  441. package/dist/react-sdk/application-runtime/responsive/selectors.d.ts +20 -0
  442. package/dist/react-sdk/application-runtime/responsive/selectors.js +1 -0
  443. package/dist/react-sdk/application-runtime/responsive/types.d.ts +104 -0
  444. package/dist/react-sdk/application-runtime/routing/routing-service.d.ts +34 -2
  445. package/dist/react-sdk/application-runtime/routing/routing-service.js +1 -1
  446. package/dist/react-sdk/application-runtime/runtime/create-application-runtime.d.ts +313 -10
  447. package/dist/react-sdk/application-runtime/runtime/create-application-runtime.js +1 -1
  448. package/dist/react-sdk/domain-application-context/BackendDataProvider.js +1 -1
  449. package/dist/react-sdk/domain-application-context/FrontendDataProvider.js +1 -1
  450. package/dist/react-sdk/domain-application-context/PublishedDataProvider.js +1 -1
  451. package/dist/react-sdk/domain-context/common-hooks/index.d.ts +1 -0
  452. package/dist/react-sdk/domain-context/common-hooks/index.js +1 -1
  453. package/dist/react-sdk/domain-context/common-hooks/use-configuration-save-state.d.ts +23 -0
  454. package/dist/react-sdk/domain-context/common-hooks/use-configuration-save-state.js +1 -0
  455. package/dist/react-sdk/domain-context/common-hooks/use-domain-context.d.ts +1 -0
  456. package/dist/react-sdk/domain-context/index.d.ts +1 -0
  457. package/dist/react-sdk/domain-context/index.js +1 -1
  458. package/dist/react-sdk/domain-context/system-hooks/undo-redo-hooks.js +1 -1
  459. package/dist/react-sdk/elements/index.d.ts +0 -1
  460. package/dist/react-sdk/index.d.ts +1 -1
  461. package/dist/react-sdk/index.js +1 -1
  462. package/dist/react-sdk/loading-state/LoaderHost.d.ts +20 -0
  463. package/dist/react-sdk/loading-state/LoaderHost.js +1 -0
  464. package/dist/react-sdk/loading-state/built-in-loading-phase.d.ts +9 -0
  465. package/dist/react-sdk/loading-state/built-in-loading-phase.js +1 -0
  466. package/dist/react-sdk/loading-state/create-app-loader.d.ts +18 -0
  467. package/dist/react-sdk/loading-state/create-app-loader.js +1 -0
  468. package/dist/react-sdk/loading-state/index.d.ts +4 -2
  469. package/dist/react-sdk/loading-state/index.js +1 -1
  470. package/dist/react-sdk/loading-state/{LoadingStateProvider.d.ts → loading-state-hooks.d.ts} +3 -12
  471. package/dist/react-sdk/loading-state/loading-state-hooks.js +1 -0
  472. package/dist/react-sdk/page-elements/ConfigurationNotFoundPagePropsProvider.d.ts +17 -0
  473. package/dist/react-sdk/page-elements/ConfigurationNotFoundPagePropsProvider.js +1 -0
  474. package/dist/react-sdk/page-elements/ConfiguratorErrorPagePropsProvider.d.ts +17 -0
  475. package/dist/react-sdk/page-elements/ConfiguratorErrorPagePropsProvider.js +1 -0
  476. package/dist/react-sdk/page-elements/configurator-error-page-props.js +1 -0
  477. package/dist/{configurator/configuration-not-found-page → react-sdk/page-elements}/create-configuration-not-found-page.d.ts +7 -1
  478. package/dist/react-sdk/page-elements/create-configuration-not-found-page.js +1 -0
  479. package/dist/{configurator/configurator-error-page → react-sdk/page-elements}/create-configurator-error-page.d.ts +6 -1
  480. package/dist/react-sdk/page-elements/create-configurator-error-page.js +1 -0
  481. package/dist/react-sdk/page-elements/create-preset-ui.d.ts +9 -0
  482. package/dist/react-sdk/page-elements/create-preset-ui.js +1 -0
  483. package/dist/react-sdk/page-elements/index.d.ts +6 -0
  484. package/dist/react-sdk/page-elements/index.js +1 -0
  485. package/dist/react-sdk/session/SessionServiceProvider.js +1 -1
  486. package/dist/react-sdk/web-component/create-web-component.js +1 -1
  487. package/dist/react-sdk/web-component/god-mode/god-mode-registry.d.ts +30 -0
  488. package/dist/react-sdk/web-component/god-mode/god-mode-registry.js +1 -0
  489. package/dist/react-sdk/web-component/god-mode/index.d.ts +1 -0
  490. package/dist/react-sdk/web-component/god-mode/index.js +1 -0
  491. package/dist/ui-sdk/icons/__generated/Lightbulb.d.ts +3 -0
  492. package/dist/ui-sdk/icons/__generated/Lightbulb.js +1 -0
  493. package/dist/ui-sdk/icons/__generated/XCircle.d.ts +3 -0
  494. package/dist/ui-sdk/icons/__generated/XCircle.js +1 -0
  495. package/dist/ui-sdk/icons/__generated/index.d.ts +4 -0
  496. package/dist/ui-sdk/icons/__generated/index.js +1 -1
  497. package/dist/ui-sdk/icons/icons-registry.js +1 -1
  498. package/dist/ui-sdk/responsive-application/ResponsiveApplicationProvider.d.ts +2 -2
  499. package/dist/ui-sdk/responsive-application/responsive-state-store.d.ts +11 -9
  500. package/dist/ui-sdk/responsive-application/use-store-responsive-info.js +1 -1
  501. package/dist/ui-sdk/theme/types.d.ts +5 -1
  502. package/package.json +13 -3
  503. package/schema/domain-spec.json +140 -0
  504. package/dist/configurator/app-loader-content/app-loader-content-name.d.ts +0 -5
  505. package/dist/configurator/app-loader-content/app-loader-content-name.js +0 -1
  506. package/dist/configurator/configuration-not-found-page/create-configuration-not-found-page.js +0 -1
  507. package/dist/configurator/configurator-error-page/create-configurator-error-page.js +0 -1
  508. package/dist/configurator/ui/assistant/form/built-in-form-registry.d.ts +0 -10
  509. package/dist/configurator/ui/assistant/form/built-in-form-registry.js +0 -1
  510. package/dist/configurator/ui/assistant/form/form-registry.js +0 -8
  511. package/dist/domain/application/assistant/assistant-form-elements.d.ts +0 -28
  512. package/dist/domain/application/assistant/assistant-form-elements.js +0 -1
  513. package/dist/domain/extensions/client-side-image.js +0 -1
  514. package/dist/domain/extensions/save-template-thumbnail.js +0 -1
  515. package/dist/react-sdk/application-runtime/runtime/god-mode.d.ts +0 -19
  516. package/dist/react-sdk/application-runtime/runtime/god-mode.js +0 -1
  517. package/dist/react-sdk/loading-state/LoadingStateProvider.js +0 -1
  518. package/dist/react-sdk/loading-state/loading-state-manager.d.ts +0 -37
  519. package/dist/react-sdk/loading-state/loading-state-manager.js +0 -1
  520. package/dist/react-sdk/responsive-state/ResponsiveStateProvider.d.ts +0 -25
  521. package/dist/react-sdk/responsive-state/ResponsiveStateProvider.js +0 -1
  522. package/dist/react-sdk/responsive-state/canvas-padding.d.ts +0 -14
  523. package/dist/react-sdk/responsive-state/index.d.ts +0 -5
  524. package/dist/react-sdk/responsive-state/index.js +0 -1
  525. package/dist/react-sdk/responsive-state/responsive-state-manager.d.ts +0 -111
  526. package/dist/react-sdk/responsive-state/responsive-state-manager.js +0 -1
  527. package/dist/react-sdk/responsive-state/use-responsive-state-manager.d.ts +0 -10
  528. package/dist/react-sdk/responsive-state/use-responsive-state-manager.js +0 -1
  529. package/dist/react-sdk/responsive-state/use-responsive-state.d.ts +0 -11
  530. package/dist/react-sdk/responsive-state/use-responsive-state.js +0 -1
  531. /package/dist/{configurator/ui/assistant/form/form-element-definition.js → react-sdk/application-runtime/host-properties/types.js} +0 -0
  532. /package/dist/react-sdk/{elements/configurator-error-page-props.js → application-runtime/loading/types.js} +0 -0
  533. /package/dist/react-sdk/{responsive-state/canvas-padding.js → application-runtime/responsive/types.js} +0 -0
  534. /package/dist/react-sdk/{elements → page-elements}/configurator-error-page-props.d.ts +0 -0
@@ -1 +1 @@
1
- import{Color as e,HalfFloatType as t,NoToneMapping as r,OrthographicCamera as a,PerspectiveCamera as n,WebGLRenderTarget as o}from"three";import{preloadFont as i}from"troika-three-text";import{match as s}from"ts-pattern";import{clientSideImageComponent as l,dimensionIndicatorComponent as c,domainEntityTypeFromId as m,editableDistanceDimensionIndicatorComponent as g,isDomainEntityId as d,isVirtualEntityId as h,sketchingEditComponent as u}from"#package/domain";import{createCameraControls as f}from"../camera-control-system/create-camera-controls.js";import{createCanvasFreezeFrame as p}from"./canvas-freeze-frame.js";import{ExportCapturePass as w,readTargetToBlob as C,resolveExportBackground as _}from"./export-image-capture.js";export class ImageRenderingSystem{_context;_renderer=null;_effectComposer=null;_generation=null;_debugObjectUrls=new Set;_canvasFreeze=null;constructor(e){this._context=e}_captureGenerationAssertion=()=>{let e=this._generation,t=()=>{if(!e?.active)throw Error("Image rendering generation ended while images were being rendered! The configurator context was reinitialized before the renderer finished, so the results belong to a configuration that is no longer active. Await the render before leaving the configuration, or discard the rejection.")};return t(),t};_captureGenerationGuard=()=>{let e=this._captureGenerationAssertion();return{assertActive:e,waitFor:async t=>{let r=await t;return e(),r},runEffect:t=>(e(),t())}};register(e){return this._renderer=e,()=>{this._renderer===e&&(this._renderer=null)}}registerEffectComposer(e){return this._effectComposer=e,()=>{this._effectComposer===e&&(this._effectComposer=null)}}_openDebugImage=e=>{let t=URL.createObjectURL(e);this._debugObjectUrls.add(t),window.open(t,"_blank")};_getRenderer=async()=>{let e=this._generation,t=Date.now(),r=()=>{if(!e?.active)throw Error("Image rendering generation ended while waiting for the renderer! The configurator context was reinitialized before the renderer arrived, so the render would target a scene that is gone. Await the render before leaving the configuration, or discard the rejection.")};r();let a=this._renderer;for(;null===a;){if(await new Promise(e=>setTimeout(e,50)),r(),Date.now()-t>1e4)throw Error("Renderer could not be retrieved! Reached timeout.");a=this._renderer}return a};generateImageUsingOriginalCanvas=async(e,t,r=!1)=>{let a=this._captureGenerationGuard(),n=await a.waitFor(this._getRenderer());if(r){let{blob:e}=await a.waitFor(a.runEffect(()=>n.renderUsingOriginalCanvas(t)));a.runEffect(()=>this._openDebugImage(e));return}let o=await Promise.all([t].map(async e=>{let{blob:t}=await a.waitFor(a.runEffect(()=>n.renderUsingOriginalCanvas(e)));return{blob:t,name:e.name}})),i=await a.waitFor(a.runEffect(()=>this._context.getAuthorizedClient().generateUploadLinks(this._context.getConfigurationId(),e,[t.name])));await Promise.all(i.map(async e=>{let t=o.find(t=>t.name===e.name);if(null==t)throw Error("Blob not found!");await Promise.all(i.map(async e=>{await a.waitFor(a.runEffect(()=>fetch(e.url,{method:"PUT",body:t.blob,headers:{"Content-Type":"image/png","Content-Length":t.blob.size.toString()}})))}))}))};async generateImagesUsingOriginalCanvas(e,t,r=!1){let a=this._captureGenerationGuard(),n=await a.waitFor(this._getRenderer()),o=Array.isArray(t)?t:[t],i=await o.reduce(async(e,t)=>[...await e,await a.waitFor(a.runEffect(()=>n.renderUsingOriginalCanvas(t)))],Promise.resolve([]));if(r){for(let e of i)a.runEffect(()=>this._openDebugImage(e.blob)),await a.waitFor(new Promise(e=>setTimeout(e,100)));return}let s=o.map(e=>e.name),l=await a.waitFor(a.runEffect(()=>this._context.getAuthorizedClient().generateUploadLinks(this._context.getConfigurationId(),e,s)));await Promise.all(l.map(async e=>{let t=i.find(t=>t.name===e.name);if(null==t)throw Error("Blob not found!");await Promise.all(l.map(async e=>{await a.waitFor(a.runEffect(()=>fetch(e.url,{method:"PUT",body:t.blob,headers:{"Content-Type":"image/png","Content-Length":t.blob.size.toString()}})))}))}))}async generateImages(e,t,r=!1){let a=this._captureGenerationGuard(),n=await a.waitFor(this._getRenderer()),o=t.map(e=>e.name);if(r)return void await Promise.all(t.map(async e=>{let t=await a.waitFor(a.runEffect(()=>n.renderImage(e)));a.runEffect(()=>this._openDebugImage(t))}));let i=await Promise.all(t.map(async e=>({blob:await a.waitFor(a.runEffect(()=>n.renderImage(e))),name:e.name}))),s=await a.waitFor(a.runEffect(()=>this._context.getAuthorizedClient().generateUploadLinks(this._context.getConfigurationId(),e,o)));await Promise.all(s.map(async e=>{let t=i.find(t=>t.name===e.name);if(null==t)throw Error("Blob not found!");await Promise.all(s.map(async e=>{await a.waitFor(a.runEffect(()=>fetch(e.url,{method:"PUT",body:t.blob,headers:{"Content-Type":"image/png","Content-Length":t.blob.size.toString()}})))}))}))}async getGeneratedImages(e,t=!1){let r=this._captureGenerationAssertion(),a=await this._getRenderer();return(r(),t)?(await Promise.all(e.map(async e=>{let t=await a.renderImage(e);r(),this._openDebugImage(t)})),[]):Promise.all(e.map(async e=>{let t=await a.renderImage(e);return r(),{blob:t,name:e.name}}))}_renderCurrentView=e=>{let{gl:t,scene:r,camera:a}=e.get();null!==this._effectComposer?this._effectComposer.render():t.render(r,a)};_freezeCanvas=e=>{this._canvasFreeze?.handle===e?this._canvasFreeze.holders+=1:(this._canvasFreeze?.remove(),this._canvasFreeze={handle:e,remove:p(e.get().gl.domElement,()=>this._renderCurrentView(e)),resumeFrameloop:this._context.configuratorExtensionSelectors.getExportSystem().pauseFrameloop(e),holders:1});let t=this._canvasFreeze,r=!1;return async()=>{if(!r&&(r=!0,t.holders-=1,!(t.holders>0)))try{let r=this._context.configuratorExtensionSelectors.getCanvasSystem();r.r3fHandle$.value===e&&await r.waitForFlush(),r.r3fHandle$.value===e&&0===t.holders&&this._renderCurrentView(e)}catch{}finally{0===t.holders&&(t.remove(),t.resumeFrameloop(),this._canvasFreeze===t&&(this._canvasFreeze=null))}}};async renderImage(a){let n=this._context.configuratorExtensionSelectors.getCanvasSystem().r3fHandle$.value;if(null===n)throw Error("R3F state not ready");let{gl:i,scene:s,camera:l,size:c,advance:m}=n.get(),g=i.getRenderTarget(),d=i.getClearColor(new e),h=i.getClearAlpha(),u=i.autoClearColor,f=e=>new w(a.width,a.height,e,i.outputColorSpace),p={composer:null,pass:null},y=null,b=null,x=e=>{let t=p.pass??f(r);return p.pass=t,p.composer===e&&e.passes.at(-1)===t||(p.composer?.removePass(t),e.addPass(t),p.composer=e),t},v=async()=>{if(await this._context.configuratorExtensionSelectors.getCanvasSystem().waitForFlush(),this._context.configuratorExtensionSelectors.getCanvasSystem().r3fHandle$.value!==n)throw Error("Canvas was remounted while an image was being rendered! The export borrowed a canvas that is gone, so it cannot capture the image. Retry the export once the configurator has settled.")},E=this._freezeCanvas(n);try{n.set({size:{height:a.height,width:a.width,top:0,left:0,updateStyle:!1}}),n.set({camera:a.camera}),await v(),null!==this._effectComposer&&x(this._effectComposer),m(void 0),await v();let r="JPEG"===a.fileFormat?"image/jpeg":"image/png",l=_({sceneBackground:s.background,backgroundColor:a.backgroundColor,fileFormat:a.fileFormat,outputColorSpace:i.outputColorSpace});if(null!==this._effectComposer){i.setRenderTarget(null),"JPEG"===a.fileFormat?i.setClearColor(a.backgroundColor??0xffffff):a.backgroundColor?i.setClearColor(a.backgroundColor):i.setClearAlpha(0),i.autoClearColor=!0;let e=x(this._effectComposer);return this._effectComposer.render(),await C(i,e.renderTarget,l,r)}y=f(i.toneMapping),b=new o(a.width,a.height,{samples:4,type:t,stencilBuffer:i.getContextAttributes().stencil??!1});let c=s.background;c instanceof e&&(s.background=null);try{i.setClearColor(0,0),i.setRenderTarget(b),i.clear(),i.render(s,a.camera)}finally{s.background=c}return y.render(i,b),await C(i,y.renderTarget,l,r)}finally{null!==p.pass&&(p.composer?.removePass(p.pass),p.pass.dispose()),y?.dispose(),b?.dispose(),this._context.configuratorExtensionSelectors.getCanvasSystem().r3fHandle$.value===n&&(i.setClearColor(d,h),i.autoClearColor=u,i.setRenderTarget(g),n.set({camera:l,size:{...c,updateStyle:!1}})),await E()}}async generateAndUploadDeclaredClientSideImages(e,t,r={}){let a=this._captureGenerationGuard(),n=await a.waitFor(this.generateDeclaredClientSideImages(e,r));if(r.debug)return n;let o=new Map((await a.waitFor(a.runEffect(()=>this._context.getAuthorizedClient().generateUploadLinks(this._context.getConfigurationId(),t,n.map(e=>e.name))))).map(e=>[e.name,e.url]));return await Promise.all(n.map(async e=>{let t=o.get(e.name);if(!t)throw Error(`Presigned link for image ${e.name} not found!`);await a.waitFor(a.runEffect(()=>fetch(t,{method:"PUT",body:e.blob})))})),n}generateDeclaredClientSideImages(e,t={}){let r=this._context.domainContextSelectors.getComponentReader().readManyComponents({componentTypes:[l]},e);return this.generateImagesFromComponents(r,e,t)}async generateImagesFromComponents(t,r,o={}){let l=this._captureGenerationGuard(),p=this._context.configuratorExtensionSelectors.getCanvasSystem().r3fHandle$.value;if(null===p)throw Error("R3F state not ready");let w=!1,C=this._context.domainContextSelectors.getExportStates(),_=t.map(t=>{if(!C.includes(t.state.exportState)){let e=d(t.componentInstance.entityId)?m(t.componentInstance.entityId):"unknown entity",r=t.componentInstance.componentType.name,a=t.componentInstance.instanceName;throw Error(`Export state ${t.state.exportState} declared in component ${r}/${a} on ${e} is not a valid export state. Expected one of: ${C.join(", ")}`)}let p=t.componentInstance.entityId;if(h(p))throw Error("Virtual entities cannot be used for export");return this._context.configuratorExtensionSelectors.getExportSystem().createExportJob(r,{exportState:t.state.exportState,exportedEntityId:p,toolState:t.state.toolState,viewState:t.state.viewState,navigationState:t.state.navigationState,selectedEntityId:r.rootEntityId},async r=>{let m=this._context.domainContextSelectors.getComponentReader().readManyComponents({componentTypes:[c,g,u]},r.state);!w&&m.length>0&&(await new Promise(e=>{i({font:void 0,characters:void 0},e)}),w=!0,await this._context.configuratorExtensionSelectors.getCanvasSystem().waitForFlush());let d=this._context.configuratorExtensionSelectors.getCameraSystem().getActiveCameraConfig(r.state);if(null==d)throw Error(`No camera config is attached for export state ${t.state.exportState} and exported entity ${p}. Whenever using a client-side image component, you need to attach a camera configuration to the export state defined on that componentin the domain spec. This camera will be used to render the image.`);let h=s(d.typeSpecificConfig.cameraType).with("perspective",()=>new n(45,t.state.width/t.state.height,1,1e4)).with("orthographic",()=>new a(0,0,1e4,0,1,1e4)).exhaustive(),C=f(h);await this._context.configuratorExtensionSelectors.getCameraSystem().applyConfig(d,C,!1,{width:t.state.width,height:t.state.height,padding:{top:0,right:0,bottom:0,left:0}}),C.update(1e6),await new Promise(e=>setTimeout(e,100));let _=await l.waitFor(l.runEffect(()=>this.renderImage({width:t.state.width,height:t.state.height,fileFormat:t.state.fileFormat,backgroundColor:t.state.backgroundColor?new e(t.state.backgroundColor):void 0,camera:h})));return o.debug&&l.runEffect(()=>this._openDebugImage(_)),{blob:_,imageComponent:t,name:`${t.componentInstance.componentType.name}-${t.componentInstance.entityId}-${t.componentInstance.instanceName}`}})});if(0===_.length)return this._context.configuratorExtensionSelectors.getExportSystem().runExportJobs(_);let y=this._freezeCanvas(p);try{return await this._context.configuratorExtensionSelectors.getExportSystem().runExportJobs(_)}finally{await y()}}initialize=()=>{for(let e of(null!==this._generation&&(this._generation.active=!1),this._debugObjectUrls))URL.revokeObjectURL(e);this._debugObjectUrls.clear(),this._generation={active:!0}}}
1
+ import{Color as e,HalfFloatType as t,NoToneMapping as a,OrthographicCamera as r,PerspectiveCamera as n,WebGLRenderTarget as o}from"three";import{preloadFont as i}from"troika-three-text";import{match as s}from"ts-pattern";import{clientSideImageComponent as l,dimensionIndicatorComponent as c,domainEntityTypeFromId as m,editableDistanceDimensionIndicatorComponent as g,isDomainEntityId as d,isVirtualEntityId as h,sketchingEditComponent as u}from"#package/domain";import{createCameraControls as f}from"../camera-control-system/create-camera-controls.js";import{createCanvasFreezeFrame as p}from"./canvas-freeze-frame.js";import{ExportCapturePass as w,readTargetToBlob as C,resolveExportBackground as _}from"./export-image-capture.js";export class ImageRenderingSystem{_context;_renderer=null;_effectComposer=null;_generation=null;_debugObjectUrls=new Set;_canvasFreeze=null;constructor(e){this._context=e}_captureGenerationAssertion=()=>{let e=this._generation,t=()=>{if(!e?.active)throw Error("Image rendering generation ended while images were being rendered! The configurator context was reinitialized before the renderer finished, so the results belong to a configuration that is no longer active. Await the render before leaving the configuration, or discard the rejection.")};return t(),t};_captureGenerationGuard=()=>{let e=this._captureGenerationAssertion();return{assertActive:e,waitFor:async t=>{let a=await t;return e(),a},runEffect:t=>(e(),t())}};register(e){return this._renderer=e,()=>{this._renderer===e&&(this._renderer=null)}}registerEffectComposer(e){return this._effectComposer=e,()=>{this._effectComposer===e&&(this._effectComposer=null)}}_openDebugImage=e=>{let t=URL.createObjectURL(e);this._debugObjectUrls.add(t),window.open(t,"_blank")};_getRenderer=async()=>{let e=this._generation,t=Date.now(),a=()=>{if(!e?.active)throw Error("Image rendering generation ended while waiting for the renderer! The configurator context was reinitialized before the renderer arrived, so the render would target a scene that is gone. Await the render before leaving the configuration, or discard the rejection.")};a();let r=this._renderer;for(;null===r;){if(await new Promise(e=>setTimeout(e,50)),a(),Date.now()-t>1e4)throw Error("Renderer could not be retrieved! Reached timeout.");r=this._renderer}return r};generateImageUsingOriginalCanvas=async(e,t,a=!1)=>{let r=this._captureGenerationGuard(),n=await r.waitFor(this._getRenderer());if(a){let{blob:e}=await r.waitFor(r.runEffect(()=>n.renderUsingOriginalCanvas(t)));r.runEffect(()=>this._openDebugImage(e));return}let o=await Promise.all([t].map(async e=>{let{blob:t}=await r.waitFor(r.runEffect(()=>n.renderUsingOriginalCanvas(e)));return{blob:t,name:e.name}})),i=await r.waitFor(r.runEffect(()=>this._context.getAuthorizedClient().generateUploadLinks(this._context.getConfigurationId(),e,[t.name])));await Promise.all(i.map(async e=>{let t=o.find(t=>t.name===e.name);if(null==t)throw Error("Blob not found!");await Promise.all(i.map(async e=>{await r.waitFor(r.runEffect(()=>fetch(e.url,{method:"PUT",body:t.blob,headers:{"Content-Type":"image/png","Content-Length":t.blob.size.toString()}})))}))}))};async generateImagesUsingOriginalCanvas(e,t,a=!1){let r=this._captureGenerationGuard(),n=await r.waitFor(this._getRenderer()),o=Array.isArray(t)?t:[t],i=await o.reduce(async(e,t)=>[...await e,await r.waitFor(r.runEffect(()=>n.renderUsingOriginalCanvas(t)))],Promise.resolve([]));if(a){for(let e of i)r.runEffect(()=>this._openDebugImage(e.blob)),await r.waitFor(new Promise(e=>setTimeout(e,100)));return}let s=o.map(e=>e.name),l=await r.waitFor(r.runEffect(()=>this._context.getAuthorizedClient().generateUploadLinks(this._context.getConfigurationId(),e,s)));await Promise.all(l.map(async e=>{let t=i.find(t=>t.name===e.name);if(null==t)throw Error("Blob not found!");await Promise.all(l.map(async e=>{await r.waitFor(r.runEffect(()=>fetch(e.url,{method:"PUT",body:t.blob,headers:{"Content-Type":"image/png","Content-Length":t.blob.size.toString()}})))}))}))}async generateImages(e,t,a=!1){let r=this._captureGenerationGuard(),n=await r.waitFor(this._getRenderer()),o=t.map(e=>e.name);if(a)return void await Promise.all(t.map(async e=>{let t=await r.waitFor(r.runEffect(()=>n.renderImage(e)));r.runEffect(()=>this._openDebugImage(t))}));let i=await Promise.all(t.map(async e=>({blob:await r.waitFor(r.runEffect(()=>n.renderImage(e))),name:e.name}))),s=await r.waitFor(r.runEffect(()=>this._context.getAuthorizedClient().generateUploadLinks(this._context.getConfigurationId(),e,o)));await Promise.all(s.map(async e=>{let t=i.find(t=>t.name===e.name);if(null==t)throw Error("Blob not found!");await Promise.all(s.map(async e=>{await r.waitFor(r.runEffect(()=>fetch(e.url,{method:"PUT",body:t.blob,headers:{"Content-Type":"image/png","Content-Length":t.blob.size.toString()}})))}))}))}async getGeneratedImages(e,t=!1){let a=this._captureGenerationAssertion(),r=await this._getRenderer();return(a(),t)?(await Promise.all(e.map(async e=>{let t=await r.renderImage(e);a(),this._openDebugImage(t)})),[]):Promise.all(e.map(async e=>{let t=await r.renderImage(e);return a(),{blob:t,name:e.name}}))}_renderCurrentView=e=>{let{gl:t,scene:a,camera:r}=e.get();null!==this._effectComposer?this._effectComposer.render():t.render(a,r)};_freezeCanvas=e=>{this._canvasFreeze?.handle===e?this._canvasFreeze.holders+=1:(this._canvasFreeze?.remove(),this._canvasFreeze={handle:e,remove:p(e.get().gl.domElement,()=>this._renderCurrentView(e)),resumeFrameloop:this._context.configuratorExtensionSelectors.getExportSystem().pauseFrameloop(e),holders:1});let t=this._canvasFreeze,a=!1;return async()=>{if(!a&&(a=!0,t.holders-=1,!(t.holders>0)))try{let a=this._context.configuratorExtensionSelectors.getCanvasSystem();a.r3fHandle$.value===e&&await a.waitForFlush(),a.r3fHandle$.value===e&&0===t.holders&&this._renderCurrentView(e)}catch{}finally{0===t.holders&&(t.remove(),t.resumeFrameloop(),this._canvasFreeze===t&&(this._canvasFreeze=null))}}};async renderImage(r){let n=this._context.configuratorExtensionSelectors.getCanvasSystem(),i=n.r3fHandle$.value??await n.waitForCanvas(),{gl:s,scene:l,camera:c,size:m,advance:g}=i.get(),d=s.getRenderTarget(),h=s.getClearColor(new e),u=s.getClearAlpha(),f=s.autoClearColor,p=e=>new w(r.width,r.height,e,s.outputColorSpace),y={composer:null,pass:null},b=null,x=null,v=e=>{let t=y.pass??p(a);return y.pass=t,y.composer===e&&e.passes.at(-1)===t||(y.composer?.removePass(t),e.addPass(t),y.composer=e),t},E=async()=>{if(await this._context.configuratorExtensionSelectors.getCanvasSystem().waitForFlush(),this._context.configuratorExtensionSelectors.getCanvasSystem().r3fHandle$.value!==i)throw Error("Canvas was remounted while an image was being rendered! The export borrowed a canvas that is gone, so it cannot capture the image. Retry the export once the configurator has settled.")},S=this._freezeCanvas(i);try{i.set({size:{height:r.height,width:r.width,top:0,left:0,updateStyle:!1}}),i.set({camera:r.camera}),await E(),null!==this._effectComposer&&v(this._effectComposer),g(void 0),await E();let a="JPEG"===r.fileFormat?"image/jpeg":"image/png",n=_({sceneBackground:l.background,backgroundColor:r.backgroundColor,fileFormat:r.fileFormat,outputColorSpace:s.outputColorSpace});if(null!==this._effectComposer){s.setRenderTarget(null),"JPEG"===r.fileFormat?s.setClearColor(r.backgroundColor??0xffffff):r.backgroundColor?s.setClearColor(r.backgroundColor):s.setClearAlpha(0),s.autoClearColor=!0;let e=v(this._effectComposer);return this._effectComposer.render(),await C(s,e.renderTarget,n,a)}b=p(s.toneMapping),x=new o(r.width,r.height,{samples:4,type:t,stencilBuffer:s.getContextAttributes().stencil??!1});let c=l.background;c instanceof e&&(l.background=null);try{s.setClearColor(0,0),s.setRenderTarget(x),s.clear(),s.render(l,r.camera)}finally{l.background=c}return b.render(s,x),await C(s,b.renderTarget,n,a)}finally{null!==y.pass&&(y.composer?.removePass(y.pass),y.pass.dispose()),b?.dispose(),x?.dispose(),this._context.configuratorExtensionSelectors.getCanvasSystem().r3fHandle$.value===i&&(s.setClearColor(h,u),s.autoClearColor=f,s.setRenderTarget(d),i.set({camera:c,size:{...m,updateStyle:!1}})),await S()}}async generateAndUploadDeclaredClientSideImages(e,t,a={}){let r=this._captureGenerationGuard(),n=await r.waitFor(this.generateDeclaredClientSideImages(e,a));if(a.debug)return n;let o=new Map((await r.waitFor(r.runEffect(()=>this._context.getAuthorizedClient().generateUploadLinks(this._context.getConfigurationId(),t,n.map(e=>e.name))))).map(e=>[e.name,e.url]));return await Promise.all(n.map(async e=>{let t=o.get(e.name);if(!t)throw Error(`Presigned link for image ${e.name} not found!`);await r.waitFor(r.runEffect(()=>fetch(t,{method:"PUT",body:e.blob})))})),n}generateDeclaredClientSideImages(e,t={}){let a=this._context.domainContextSelectors.getComponentReader().readManyComponents({componentTypes:[l]},e);return this.generateImagesFromComponents(a,e,t)}generateImagesFromComponents(e,t,a={},r={}){return this._generateImagesFromComponents(e,t,a,r)}async _generateImagesFromComponents(t,a,o,l){let p=this._captureGenerationGuard(),w=!1,C=this._context.domainContextSelectors.getExportStates(),_=t.map(t=>{if(!C.includes(t.state.exportState)){let e=d(t.componentInstance.entityId)?m(t.componentInstance.entityId):"unknown entity",a=t.componentInstance.componentType.name,r=t.componentInstance.instanceName;throw Error(`Export state ${t.state.exportState} declared in component ${a}/${r} on ${e} is not a valid export state. Expected one of: ${C.join(", ")}`)}let l=t.componentInstance.entityId;if(h(l))throw Error("Virtual entities cannot be used for export");return this._context.configuratorExtensionSelectors.getExportSystem().createExportJob(a,{exportState:t.state.exportState,exportedEntityId:l,toolState:t.state.toolState,viewState:t.state.viewState,navigationState:t.state.navigationState,selectedEntityId:a.rootEntityId},async a=>{let m=this._context.domainContextSelectors.getComponentReader().readManyComponents({componentTypes:[c,g,u]},a.state);!w&&m.length>0&&(await new Promise(e=>{i({font:void 0,characters:void 0},e)}),w=!0,await this._context.configuratorExtensionSelectors.getCanvasSystem().waitForFlush());let d=this._context.configuratorExtensionSelectors.getCameraSystem().getActiveCameraConfig(a.state);if(null==d)throw Error(`No camera config is attached for export state ${t.state.exportState} and exported entity ${l}. Whenever using a client-side image component, you need to attach a camera configuration to the export state defined on that componentin the domain spec. This camera will be used to render the image.`);let h=s(d.typeSpecificConfig.cameraType).with("perspective",()=>new n(45,t.state.width/t.state.height,1,1e4)).with("orthographic",()=>new r(0,0,1e4,0,1,1e4)).exhaustive(),C=f(h);await this._context.configuratorExtensionSelectors.getCameraSystem().applyConfig(d,C,!1,{width:t.state.width,height:t.state.height,padding:{top:0,right:0,bottom:0,left:0}}),C.update(1e6),await new Promise(e=>setTimeout(e,100));let _=await p.waitFor(p.runEffect(()=>this.renderImage({width:t.state.width,height:t.state.height,fileFormat:t.state.fileFormat,backgroundColor:t.state.backgroundColor?new e(t.state.backgroundColor):void 0,camera:h})));return o.debug&&p.runEffect(()=>this._openDebugImage(_)),{blob:_,imageComponent:t,name:`${t.componentInstance.componentType.name}-${t.componentInstance.entityId}-${t.componentInstance.instanceName}`}})});if(0===_.length)return this._context.configuratorExtensionSelectors.getExportSystem().runExportJobs(_,l);let y=this._context.configuratorExtensionSelectors.getCanvasSystem(),b=y.r3fHandle$.value??await p.waitFor(y.waitForCanvas().catch(e=>{throw p.assertActive(),e})),x=this._freezeCanvas(b);try{return await this._context.configuratorExtensionSelectors.getExportSystem().runExportJobs(_,l)}finally{await x()}}initialize=()=>{for(let e of(null!==this._generation&&(this._generation.active=!1),this._debugObjectUrls))URL.revokeObjectURL(e);this._debugObjectUrls.clear(),this._generation={active:!0}}}
@@ -6,7 +6,7 @@ export { createCameraControls } from './camera-control-system/create-camera-cont
6
6
  export { type AnyCanvasSystem, CanvasSystem, type EntityObjectFilter, type FlushToken } from './canvas-system.js';
7
7
  export { type AnyDragAndDropSystem, DragAndDropSystem, type DragAndDropSystemContext, type DraggableState, type DraggingState, type RotationDraggingState, } from './drag-and-drop-system/drag-and-drop-system.js';
8
8
  export { type AnyExportSystem, ExportSystem, type ExportSystemContext } from './export-system/export-system.js';
9
- export { type GraphQLExecution, type GraphQLOperation, GraphQLSystem, type GraphQLSystemContext, type PreparedOperation, } from './graphql-system/graphql-system.js';
9
+ export { type GraphQLExecution, type GraphQLScreenshot, type GraphQLOperation, GraphQLSystem, type GraphQLSystemContext, type PreparedOperation, } from './graphql-system/graphql-system.js';
10
10
  export type * from './image-rendering-system/image-renderer.js';
11
11
  export { type AnyImageRenderingSystem, ImageRenderingSystem, type ImageRenderingSystemContext, } from './image-rendering-system/image-rendering-system.js';
12
12
  export { type AnyLayoutSystem, LayoutSystem, type LayoutSystemContext } from './layout-system/layout-system.js';
@@ -1,16 +1,14 @@
1
1
  import { type $DomainEntity, type ConfiguratorBuilder, type CreateCustomPhoenixEntityElement, type CreateCustomPhoenixLayoutElement, type CreateGetThemeHandler, type CreateGetWebComponentOptionsHandler, type CreatePhoenixHandler, type DomainEntity, type IsCreateRecipeUpdate, type IsReplaceRecipeUpdate, type TransformerBuilder, type TransformerFactory, type UpdateFactory, getIdSequence } from '#package/domain';
2
- import { type CreateAddEntityFab, type CreateCollectFrontendDataHandler, type CreateDeleteEntityFab, type CreateFilterPublishedChunksHandler, type CreateNavigationHotspot, type CreateNotAuthenticatedPage, type CreateSelectionHotspot, type CreateToolMenuFab, type IsAngleDimensionUpdate, type IsAttributeSelectionUpdate, type IsAttributeSwitchUpdate, type IsDeleteEntityUpdate, type IsDistanceDimensionUpdate, type IsGenericDimensionUpdate, type IsSwatchSelectionUpdate, type IsTextValueUpdate, type UseAccessService, type UseActiveNavigationState, type UseActiveToolState, type UseActiveViewState, type UseActiveViewports, type UseAnalyticsService, type UseAngleDimension, type UseAttributeSelection, type UseAttributeSwitch, type UseAuthenticatedClient, type UseAuthorizedClient, type UseBackendData, type UseChildEntitySelection, type UseComponent, type UseComponents, type UseComposition, type UseConfigurationId, type UseConfiguratorMessages, type UseControlViolations, type UseCookRecipes, type UseCookReplaceRecipes, type UseCookedRecipes, type UseCookedReplaceRecipes, type UseCreateAuthorizedClient, type UseDeleteEntity, type UseDeletedEntity, type UseDeselect, type UseDistanceDimension, type UseDistanceDimensionSelection, type UseDomainApplicationContext, type UseDomainApplicationProps, type UseDomainContext, type UseDomainEntityState, type UseEntityPrice, type UseEntitySelector, type UseFinalizeAction, type UseFinalizeActions, type UseFinalizeViolations, type UseFirstComponent, type UseFirstRootComponent, type UseFrontendData, type UseGenericDimension, type UseGroupedRecipeOptions, type UseHoveredDomainEntityId, type UseHoveredEntity, type UseHoveredEntityId, type UseIntegrationService, type UseIntegrationState, type UseIsFullscreenActive, type UseLoadedData, type UseLoadingState, type UseLocaleSwitch, type UseMapViolationHints, type UseNavigate, type UsePopNavigate, type UsePresetEmbeddedState, type UsePublishedData, type UsePushNavigate, type UseRecipeEmbeddedState, type UseReplaceEntityRecipeOptions, type UseRootComponents, type UseRootEntityId, type UseRootEntityPrice, type UseRootEntitySelector, type UseRootEntityState, type UseSelectEntity, type UseSelectParent, type UseSelectedDomainEntityId, type UseSelectedEntity, type UseSelectedEntityId, type UseSession, type UseSessionRole, type UseSessionService, type UseSetFullscreen, type UseSetViewState, type UseShareLinks, type UseSlice, type UseState, type UseStateValidity, type UseStepNavigation, type UseSwatchSelection, type UseSynchronizedSelector, type UseSynchronizedSelector$, type UseTabNavigation, type UseTextValue, type UseUndoRedo, type UseUpdateControl, type UseUpdatedControl, useGenerateShareLink, useLoadingStateValue, useLocalizable, useResolveLocalizable } from '#package/react-sdk';
2
+ import { type CreateAddEntityFab, type CreateAppLoader, type CreateCollectFrontendDataHandler, type CreateConfigurationNotFoundPage, type CreateConfiguratorErrorPage, type CreateDeleteEntityFab, type CreateFilterPublishedChunksHandler, type CreateNavigationHotspot, type CreateNotAuthenticatedPage, type CreatePresetUi, type CreateSelectionHotspot, type CreateToolMenuFab, type IsAngleDimensionUpdate, type IsAttributeSelectionUpdate, type IsAttributeSwitchUpdate, type IsDeleteEntityUpdate, type IsDistanceDimensionUpdate, type IsGenericDimensionUpdate, type IsSwatchSelectionUpdate, type IsTextValueUpdate, type UseAccessService, type UseActiveNavigationState, type UseActiveToolState, type UseActiveViewState, type UseActiveViewports, type UseAnalyticsService, type UseAngleDimension, type UseAttributeSelection, type UseAttributeSwitch, type UseAuthenticatedClient, type UseAuthorizedClient, type UseBackendData, type UseChildEntitySelection, type UseComponent, type UseComponents, type UseComposition, type UseConfigurationId, type UseConfigurationSaveState, type UseConfiguratorMessages, type UseControlViolations, type UseCookRecipes, type UseCookReplaceRecipes, type UseCookedRecipes, type UseCookedReplaceRecipes, type UseCreateAuthorizedClient, type UseDeleteEntity, type UseDeletedEntity, type UseDeselect, type UseDistanceDimension, type UseDistanceDimensionSelection, type UseDomainApplicationContext, type UseDomainApplicationProps, type UseDomainContext, type UseDomainEntityState, type UseEntityPrice, type UseEntitySelector, type UseFinalizeAction, type UseFinalizeActions, type UseFinalizeViolations, type UseFirstComponent, type UseFirstRootComponent, type UseFrontendData, type UseGenericDimension, type UseGroupedRecipeOptions, type UseHoveredDomainEntityId, type UseHoveredEntity, type UseHoveredEntityId, type UseIntegrationService, type UseIntegrationState, type UseIsFullscreenActive, type UseLoadedData, type UseLoadingState, type UseLocaleSwitch, type UseMapViolationHints, type UseNavigate, type UsePopNavigate, type UsePresetEmbeddedState, type UsePublishedData, type UsePushNavigate, type UseRecipeEmbeddedState, type UseReplaceEntityRecipeOptions, type UseRootComponents, type UseRootEntityId, type UseRootEntityPrice, type UseRootEntitySelector, type UseRootEntityState, type UseSelectEntity, type UseSelectParent, type UseSelectedDomainEntityId, type UseSelectedEntity, type UseSelectedEntityId, type UseSession, type UseSessionRole, type UseSessionService, type UseSetFullscreen, type UseSetViewState, type UseShareLinks, type UseSlice, type UseState, type UseStateValidity, type UseStepNavigation, type UseSwatchSelection, type UseSynchronizedSelector, type UseSynchronizedSelector$, type UseTabNavigation, type UseTextValue, type UseUndoRedo, type UseUpdateControl, type UseUpdatedControl, useGenerateShareLink, useLoadingStateValue, useLocalizable, useResolveLocalizable } from '#package/react-sdk';
3
3
  import { type CreatePhoenixIconSet } from '#package/ui-sdk';
4
4
  import { type UseConfiguratorExtensions } from '../application-runtime/index.js';
5
- import { type CreateConfigurationNotFoundPage } from '../configuration-not-found-page/index.js';
6
5
  import { type CreateOnApplicationStartProvider, type CreateOnBackendDataReadyProvider, type CreateOnConfiguratorReadyProvider, type CreateOnFrontendDataReadyProvider, type CreateOnGoToIndexHandler, type CreateOnPresetLoadedHandler, type CreateOnPublishedDataReadyProvider, type CreateOnRoutingReadyProvider, type CreateOnSessionReadyProvider, type UseConfiguratorRouting, type UsePresetSelection, usePreview, usePropertyPageStack, usePropertyPageState } from '../configurator-context/index.js';
7
- import { type CreateConfiguratorErrorPage } from '../configurator-error-page/index.js';
8
6
  import { useCloseAction } from '../integration/index.js';
9
7
  import { type CreateGetTextureProcessingMapHandler } from '../scene/index.js';
10
8
  import type { UseUpdateEntityObjectSelection } from '../scene/scene-entity/drag-and-drop/use-updated-selection.js';
11
- import { type UseAssistantPanel, type UseMeasurements } from '../toolbar-actions/index.js';
12
- import { type CreateAppLoader, type CreateCanvasLoader, type CreateLayoutAdminUi, type CreateLayoutCustomOwnerUi, type CreateLayoutCustomReadUi, type CreateLayoutDialog, type CreateLayoutFooter, type CreateLayoutToolbarDesktop, type CreateLayoutToolbarDesktopFullScreen, type CreateLayoutToolbarReadDesktop, type CreateLayoutToolbarReadDesktopFullScreen, type CreateLayoutUserUi, type CreateToolbarHelp, LayoutSlots, useSceneSafeArea } from '../ui/index.js';
13
- import { type CreatePresetDeviceNotSupported, type CreatePresetPageAction, type CreatePresetUi } from '../ui/preset-layout/PresetUi.js';
9
+ import { type UseAssistantPanel, type UseMeasurements, type UseToolbarActions } from '../toolbar-actions/index.js';
10
+ import { type CreateCanvasLoader, type CreateLayoutAdminUi, type CreateLayoutCustomOwnerUi, type CreateLayoutCustomReadUi, type CreateLayoutDialog, type CreateLayoutFooter, type CreateLayoutToolbarDesktop, type CreateLayoutToolbarDesktopFullScreen, type CreateLayoutToolbarReadDesktop, type CreateLayoutToolbarReadDesktopFullScreen, type CreateLayoutUserUi, type CreateToolbarHelp, LayoutSlots, useSceneSafeArea } from '../ui/index.js';
11
+ import { type CreatePresetDeviceNotSupported, type CreatePresetPageAction } from '../ui/preset-layout/PresetUi.js';
14
12
  import { type UseResetCamera } from './use-reset-camera.js';
15
13
  export interface ConfiguratorInterface<ENTITIES extends DomainEntity<string>, ALLOWED_ROOT_ENTITIES extends ENTITIES, $MAP extends Record<ENTITIES['type'], $DomainEntity<ENTITIES>>, PUBLISHED_DATA extends Record<string, unknown>, SESSION_DATA extends Record<string, unknown>, FRONTEND_DATA extends Record<string, unknown>, NAVIGATION_STATES extends string, VIEW_STATES extends string, TOOL_STATES extends string, EXPORT_STATES extends string, FINALIZE_DATA extends Record<string, unknown>, FINALIZE_RESULT extends Record<string, unknown>> {
16
14
  /**
@@ -387,6 +385,11 @@ export interface ConfiguratorInterface<ENTITIES extends DomainEntity<string>, AL
387
385
  * text resolved
388
386
  */
389
387
  useConfiguratorMessages: UseConfiguratorMessages<ENTITIES, $MAP>;
388
+ /**
389
+ * The save status of the configuration: `{ revisionId, isSaving, failure }`, where `failure` is the latest save's
390
+ * `{ error, timestamp }` until a later save succeeds
391
+ */
392
+ useConfigurationSaveState: UseConfigurationSaveState;
390
393
  /**
391
394
  * Runs the project handler a `finalizeAction` component names, with its pending state, its error and the
392
395
  * finalize violations; call it once per component, wrapped in `PhoenixHandlerBoundary`
@@ -579,6 +582,11 @@ export interface ConfiguratorInterface<ENTITIES extends DomainEntity<string>, AL
579
582
  * Turn one localizable text of the spec into a string in the current language
580
583
  */
581
584
  useLocalizable: typeof useLocalizable;
585
+ /**
586
+ * The spec's toolbar for a placement as runnable entries, grouped as the spec groups them, for a layout's own
587
+ * toolbar
588
+ */
589
+ useToolbarActions: UseToolbarActions;
582
590
  /**
583
591
  * The unit of dimensions and the dimension indicators, with functions that change them, as the toolbar's
584
592
  * measurements button does
@@ -1 +1 @@
1
- import{createCustomPhoenixEntityElement as e,createCustomPhoenixLayoutElement as o,createGetThemeHandler as r,createGetWebComponentOptionsHandler as t,createPhoenixHandler as i,createTransformer as n,createTransformerBuilder as s,createUpdateFactory as a,getIdSequence as m,isCreateEntityUpdate as p,isReplaceEntityUpdate as d}from"#package/domain";import{createAddEntityFab as f,createCollectFrontendDataHandler as u,createDeleteEntityFab as c,createFilterPublishedChunksHandler as g,createNavigationHotspot as l,createNotAuthenticatedPage as j,createSelectionHotspot as x,createToolMenuFab as k,isAngleDimensionUpdate as y,isAttributeSelectionUpdate as I,isAttributeSwitchUpdate as A,isDeleteEntityUpdate as C,isDistanceDimensionUpdate as S,isGenericDimensionUpdate as w,isSwatchSelectionUpdate as E,isTextValueUpdate as b,useAccessService as q,useActiveNavigationState as B,useActiveToolState as P,useActiveViewState as R,useActiveViewports as U,useAnalyticsService as h,useAngleDimension as v,useAttributeSelection as z,useAttributeSwitch as D,useAuthenticatedClient as F,useAuthorizedClient as G,useBackendData as H,useChildEntitySelection as J,useCommittedSlice as K,useCommittedState as L,useComponent as M,useComponents as N,useComposition as O,useConfigurationId as Q,useConfiguratorMessages as T,useControlViolations as V,useCookRecipes as W,useCookReplaceRecipes as X,useCookedRecipes as Y,useCookedReplaceRecipes as Z,useCreateAuthorizedClient as $,useDeleteEntity as _,useDeletedEntity as ee,useDeselect as eo,useDistanceDimension as er,useDistanceDimensionSelection as et,useDomain as ei,useDomainApplication as en,useDomainApplicationProps as es,useDomainEntityRenderedState as ea,useDomainEntityState as em,useEntityPrice as ep,useEntitySelector as ed,useFinalizeAction as ef,useFinalizeActions as eu,useFinalizeViolations as ec,useFirstComponent as eg,useFirstRenderedComponent as el,useFirstRootComponent as ej,useFirstRootRenderedComponent as ex,useFrontendData as ek,useGenerateShareLink as ey,useGenericDimension as eI,useGroupedRecipeOptions as eA,useHoveredDomainEntityId as eC,useHoveredEntity as eS,useHoveredEntityId as ew,useIntegrationService as eE,useIntegrationState as eb,useIsFullscreenActive as eq,useLoadedData as eB,useLoadingState as eP,useLoadingStateValue as eR,useLocaleSwitch as eU,useLocalizable as eh,useMapViolationHints as ev,useNavigate as ez,usePopNavigate as eD,usePresetEmbeddedState as eF,usePublishedData as eG,usePushNavigate as eH,useRecipeEmbeddedState as eJ,useRenderedComponent as eK,useRenderedComponents as eL,useRenderedEntitySelector as eM,useRenderedRootEntitySelector as eN,useRenderedSelector as eO,useRenderedSelector$ as eQ,useRenderedSlice as eT,useRenderedState as eV,useReplaceEntityRecipeOptions as eW,useResolveLocalizable as eX,useRootComponents as eY,useRootEntityId as eZ,useRootEntityPrice as e$,useRootEntityRenderedId as e_,useRootEntityRenderedState as e0,useRootEntitySelector as e1,useRootEntityState as e2,useRootRenderedComponents as e3,useSelectEntity as e4,useSelectParent as e5,useSelectedDomainEntityId as e6,useSelectedEntity as e7,useSelectedEntityId as e8,useSession as e9,useSessionRole as oe,useSessionService as oo,useSetFullscreen as or,useSetViewState as ot,useShareLinks as oi,useStateValidity as on,useStepNavigation as os,useStoreSelector as oa,useStoreSelector$ as om,useSwatchSelection as op,useTabNavigation as od,useTextValue as of,useUndoRedo as ou,useUpdateControl as oc,useUpdatedControl as og}from"#package/react-sdk";import{createPhoenixIconSet as ol}from"#package/ui-sdk";import{useConfigurator as oj}from"../application-runtime/index.js";import{createConfigurationNotFoundPage as ox}from"../configuration-not-found-page/index.js";import{createOnApplicationStartProvider as ok,createOnBackendDataReadyProvider as oy,createOnConfiguratorReadyProvider as oI,createOnFrontendDataReadyProvider as oA,createOnGoToIndexHandler as oC,createOnPresetLoadedHandler as oS,createOnPublishedDataReadyProvider as ow,createOnRoutingReadyProvider as oE,createOnSessionReadyProvider as ob,useConfiguratorRouting as oq,usePresetSelection as oB,usePreview as oP,usePropertyPageStack as oR,usePropertyPageState as oU}from"../configurator-context/index.js";import{createConfiguratorErrorPage as oh}from"../configurator-error-page/index.js";import{useCloseAction as ov}from"../integration/index.js";import{createGetTextureProcessingMapHandler as oz}from"../scene/index.js";import{useUpdateEntityObjectSelection as oD}from"../scene/scene-entity/drag-and-drop/use-updated-selection.js";import{useAssistantPanel as oF,useMeasurements as oG}from"../toolbar-actions/index.js";import{LayoutSlots as oH,createAppLoader as oJ,createCanvasLoader as oK,createLayoutAdminUi as oL,createLayoutCustomOwnerUi as oM,createLayoutCustomReadUi as oN,createLayoutDialog as oO,createLayoutFooter as oQ,createLayoutToolbarDesktop as oT,createLayoutToolbarDesktopFullScreen as oV,createLayoutToolbarReadDesktop as oW,createLayoutToolbarReadDesktopFullScreen as oX,createLayoutUserUi as oY,createToolbarHelp as oZ,useSceneSafeArea as o$}from"../ui/index.js";import{createPresetDeviceNotSupported as o_,createPresetPageAction as o0,createPresetUi as o1}from"../ui/preset-layout/PresetUi.js";import{useResetCamera as o2}from"./use-reset-camera.js";export const createConfiguratorInterface=o3=>({updates:a(),getIdSequence:m,createGetWebComponentOptionsHandler:t,createGetThemeHandler:r,createPhoenixHandler:i,createCustomPhoenixEntityElement:e,createCustomPhoenixLayoutElement:o,createPhoenixIconSet:ol,createGetTextureProcessingMapHandler:oz,createCollectFrontendDataHandler:u,createFilterPublishedChunksHandler:g,createOnGoToIndexHandler:oC,createOnApplicationStartProvider:ok,createOnSessionReadyProvider:ob,createOnPublishedDataReadyProvider:ow,createOnFrontendDataReadyProvider:oA,createOnBackendDataReadyProvider:oy,createOnRoutingReadyProvider:oE,createOnConfiguratorReadyProvider:oI,createOnPresetLoadedHandler:oS,createPresetUi:o1,createPresetPageAction:o0,createPresetDeviceNotSupported:o_,createLayoutFooter:oQ,createAppLoader:oJ,createCanvasLoader:oK,createLayoutDialog:oO,createLayoutToolbarDesktop:oT,createLayoutToolbarDesktopFullScreen:oV,createLayoutToolbarReadDesktop:oW,createLayoutToolbarReadDesktopFullScreen:oX,createLayoutCustomOwnerUi:oM,createLayoutCustomReadUi:oN,createLayoutAdminUi:oL,createLayoutUserUi:oY,createToolbarHelp:oZ,createNotAuthenticatedPage:j,createConfigurationNotFoundPage:ox,createConfiguratorErrorPage:oh,createAddEntityFab:f,createDeleteEntityFab:c,createSelectionHotspot:x,createNavigationHotspot:l,createToolMenuFab:k,createTransformer:n,transformerBuilder:s(),useAnalytics:h,useAuthenticatedClient:F,useAuthorizedClient:G,useCreateAuthorizedClient:$,useAccessService:q,useConfigurationId:Q,useSession:e9,useSessionRole:oe,useSessionService:oo,useDomain:ei,useDomainApplication:en,useConfigurator:oj,useConfiguratorRouting:oq,usePresetSelection:oB,usePublishedData:eG,useFrontendData:ek,useBackendData:H,useDomainApplicationProps:es,useLoadedData:eB,useIntegrationService:eE,useIntegrationState:eb,usePresetEmbeddedState:eF,useRecipeEmbeddedState:eJ,useCommittedSlice:K,useRenderedSlice:eT,useCommittedState:L,useRenderedState:eV,useStoreSelector:oa,useRenderedSelector:eO,useStoreSelector$:om,useRenderedSelector$:eQ,useEntitySelector:ed,useRenderedEntitySelector:eM,useRootEntitySelector:e1,useRenderedRootEntitySelector:eN,useStateValidity:on,useMapViolationHints:ev,useNavigate:ez,usePopNavigate:eD,usePushNavigate:eH,useControlViolations:V,useFinalizeViolations:ec,useConfiguratorMessages:T,useFinalizeAction:ef,useFinalizeActions:eu,useComponent:M,useRenderedComponent:eK,useComponents:N,useRenderedComponents:eL,useFirstComponent:eg,useFirstRenderedComponent:el,useRootComponents:eY,useRootRenderedComponents:e3,useFirstRootComponent:ej,useFirstRootRenderedComponent:ex,useEntityState:em,useEntityRenderedState:ea,useRootEntityState:e2,useRootEntityRenderedState:e0,useRootEntityId:eZ,useRootEntityRenderedId:e_,useEntityPrice:ep,useRootEntityPrice:e$,useSelectedEntity:e7,useSelectedEntityId:e8,useSelectedDomainEntityId:e6,useSelectEntity:e4,useDeselect:eo,useSelectParent:e5,useHoveredEntity:eS,useHoveredEntityId:ew,useHoveredDomainEntityId:eC,useActiveNavigationState:B,useActiveViewState:R,useSetViewState:ot,useActiveToolState:P,useIsFullscreenActive:eq,useSetFullscreen:or,useResetCamera:o2,useUndoRedo:ou,useTabNavigation:od,useStepNavigation:os,useSceneSafeArea:o$,useActiveViewports:U,usePreview:oP,useCloseAction:ov,useIsCloningAllowed:oH.useIsCloningAllowed,useResolveLocalizable:eX,useLocalizable:eh,useMeasurements:oG,useLocaleSwitch:eU,useShareLinks:oi,useAssistantPanel:oF,useComposition:O,useUpdateControl:oc,useUpdatedControl:og,useCookRecipes:W,useCookedRecipes:Y,useCookReplaceRecipes:X,useCookedReplaceRecipes:Z,useDeleteEntity:_,useDeletedEntity:ee,useSwatchSelection:op,useTextValue:of,useAttributeSelection:z,useAttributeSwitch:D,useDistanceDimension:er,useDistanceDimensionSelection:et,useGenericDimension:eI,useAngleDimension:v,useChildEntitySelection:J,useGroupedRecipeOptions:eA,useReplaceEntityRecipeOptions:eW,useUpdateEntityObjectSelection:oD,useGenerateShareLink:ey,useLoadingState:eP,useLoadingStateValue:eR,usePropertyPageStack:oR,usePropertyPageState:oU,isCreateEntityUpdate:p,isReplaceEntityUpdate:d,isDeleteEntityUpdate:C,isAngleDimensionUpdate:y,isDistanceDimensionUpdate:S,isGenericDimensionUpdate:w,isAttributeSelectionUpdate:I,isAttributeSwitchUpdate:A,isTextValueUpdate:b,isSwatchSelectionUpdate:E});
1
+ import{createCustomPhoenixEntityElement as e,createCustomPhoenixLayoutElement as t,createGetThemeHandler as r,createGetWebComponentOptionsHandler as o,createPhoenixHandler as i,createTransformer as n,createTransformerBuilder as s,createUpdateFactory as a,getIdSequence as m,isCreateEntityUpdate as p,isReplaceEntityUpdate as d}from"#package/domain";import{createAddEntityFab as c,createAppLoader as u,createCollectFrontendDataHandler as f,createConfigurationNotFoundPage as l,createConfiguratorErrorPage as g,createDeleteEntityFab as j,createFilterPublishedChunksHandler as x,createNavigationHotspot as k,createNotAuthenticatedPage as y,createPresetUi as I,createSelectionHotspot as A,createToolMenuFab as C,isAngleDimensionUpdate as S,isAttributeSelectionUpdate as w,isAttributeSwitchUpdate as E,isDeleteEntityUpdate as b,isDistanceDimensionUpdate as q,isGenericDimensionUpdate as B,isSwatchSelectionUpdate as P,isTextValueUpdate as R,useAccessService as U,useActiveNavigationState as h,useActiveToolState as v,useActiveViewState as z,useActiveViewports as D,useAnalyticsService as F,useAngleDimension as G,useAttributeSelection as H,useAttributeSwitch as J,useAuthenticatedClient as K,useAuthorizedClient as L,useBackendData as M,useChildEntitySelection as N,useCommittedSlice as O,useCommittedState as Q,useComponent as T,useComponents as V,useComposition as W,useConfigurationId as X,useConfigurationSaveState as Y,useConfiguratorMessages as Z,useControlViolations as $,useCookRecipes as _,useCookReplaceRecipes as ee,useCookedRecipes as et,useCookedReplaceRecipes as er,useCreateAuthorizedClient as eo,useDeleteEntity as ei,useDeletedEntity as en,useDeselect as es,useDistanceDimension as ea,useDistanceDimensionSelection as em,useDomain as ep,useDomainApplication as ed,useDomainApplicationProps as ec,useDomainEntityRenderedState as eu,useDomainEntityState as ef,useEntityPrice as el,useEntitySelector as eg,useFinalizeAction as ej,useFinalizeActions as ex,useFinalizeViolations as ek,useFirstComponent as ey,useFirstRenderedComponent as eI,useFirstRootComponent as eA,useFirstRootRenderedComponent as eC,useFrontendData as eS,useGenerateShareLink as ew,useGenericDimension as eE,useGroupedRecipeOptions as eb,useHoveredDomainEntityId as eq,useHoveredEntity as eB,useHoveredEntityId as eP,useIntegrationService as eR,useIntegrationState as eU,useIsFullscreenActive as eh,useLoadedData as ev,useLoadingState as ez,useLoadingStateValue as eD,useLocaleSwitch as eF,useLocalizable as eG,useMapViolationHints as eH,useNavigate as eJ,usePopNavigate as eK,usePresetEmbeddedState as eL,usePublishedData as eM,usePushNavigate as eN,useRecipeEmbeddedState as eO,useRenderedComponent as eQ,useRenderedComponents as eT,useRenderedEntitySelector as eV,useRenderedRootEntitySelector as eW,useRenderedSelector as eX,useRenderedSelector$ as eY,useRenderedSlice as eZ,useRenderedState as e$,useReplaceEntityRecipeOptions as e_,useResolveLocalizable as e0,useRootComponents as e1,useRootEntityId as e2,useRootEntityPrice as e3,useRootEntityRenderedId as e4,useRootEntityRenderedState as e5,useRootEntitySelector as e6,useRootEntityState as e7,useRootRenderedComponents as e8,useSelectEntity as e9,useSelectParent as te,useSelectedDomainEntityId as tt,useSelectedEntity as tr,useSelectedEntityId as to,useSession as ti,useSessionRole as tn,useSessionService as ts,useSetFullscreen as ta,useSetViewState as tm,useShareLinks as tp,useStateValidity as td,useStepNavigation as tc,useStoreSelector as tu,useStoreSelector$ as tf,useSwatchSelection as tl,useTabNavigation as tg,useTextValue as tj,useUndoRedo as tx,useUpdateControl as tk,useUpdatedControl as ty}from"#package/react-sdk";import{createPhoenixIconSet as tI}from"#package/ui-sdk";import{useConfigurator as tA}from"../application-runtime/index.js";import{createOnApplicationStartProvider as tC,createOnBackendDataReadyProvider as tS,createOnConfiguratorReadyProvider as tw,createOnFrontendDataReadyProvider as tE,createOnGoToIndexHandler as tb,createOnPresetLoadedHandler as tq,createOnPublishedDataReadyProvider as tB,createOnRoutingReadyProvider as tP,createOnSessionReadyProvider as tR,useConfiguratorRouting as tU,usePresetSelection as th,usePreview as tv,usePropertyPageStack as tz,usePropertyPageState as tD}from"../configurator-context/index.js";import{useCloseAction as tF}from"../integration/index.js";import{createGetTextureProcessingMapHandler as tG}from"../scene/index.js";import{useUpdateEntityObjectSelection as tH}from"../scene/scene-entity/drag-and-drop/use-updated-selection.js";import{useAssistantPanel as tJ,useMeasurements as tK,useToolbarActions as tL}from"../toolbar-actions/index.js";import{LayoutSlots as tM,createCanvasLoader as tN,createLayoutAdminUi as tO,createLayoutCustomOwnerUi as tQ,createLayoutCustomReadUi as tT,createLayoutDialog as tV,createLayoutFooter as tW,createLayoutToolbarDesktop as tX,createLayoutToolbarDesktopFullScreen as tY,createLayoutToolbarReadDesktop as tZ,createLayoutToolbarReadDesktopFullScreen as t$,createLayoutUserUi as t_,createToolbarHelp as t0,useSceneSafeArea as t1}from"../ui/index.js";import{createPresetDeviceNotSupported as t2,createPresetPageAction as t3}from"../ui/preset-layout/PresetUi.js";import{useResetCamera as t4}from"./use-reset-camera.js";export const createConfiguratorInterface=t5=>({updates:a(),getIdSequence:m,createGetWebComponentOptionsHandler:o,createGetThemeHandler:r,createPhoenixHandler:i,createCustomPhoenixEntityElement:e,createCustomPhoenixLayoutElement:t,createPhoenixIconSet:tI,createGetTextureProcessingMapHandler:tG,createCollectFrontendDataHandler:f,createFilterPublishedChunksHandler:x,createOnGoToIndexHandler:tb,createOnApplicationStartProvider:tC,createOnSessionReadyProvider:tR,createOnPublishedDataReadyProvider:tB,createOnFrontendDataReadyProvider:tE,createOnBackendDataReadyProvider:tS,createOnRoutingReadyProvider:tP,createOnConfiguratorReadyProvider:tw,createOnPresetLoadedHandler:tq,createPresetUi:I,createPresetPageAction:t3,createPresetDeviceNotSupported:t2,createLayoutFooter:tW,createAppLoader:u,createCanvasLoader:tN,createLayoutDialog:tV,createLayoutToolbarDesktop:tX,createLayoutToolbarDesktopFullScreen:tY,createLayoutToolbarReadDesktop:tZ,createLayoutToolbarReadDesktopFullScreen:t$,createLayoutCustomOwnerUi:tQ,createLayoutCustomReadUi:tT,createLayoutAdminUi:tO,createLayoutUserUi:t_,createToolbarHelp:t0,createNotAuthenticatedPage:y,createConfigurationNotFoundPage:l,createConfiguratorErrorPage:g,createAddEntityFab:c,createDeleteEntityFab:j,createSelectionHotspot:A,createNavigationHotspot:k,createToolMenuFab:C,createTransformer:n,transformerBuilder:s(),useAnalytics:F,useAuthenticatedClient:K,useAuthorizedClient:L,useCreateAuthorizedClient:eo,useAccessService:U,useConfigurationId:X,useSession:ti,useSessionRole:tn,useSessionService:ts,useDomain:ep,useDomainApplication:ed,useConfigurator:tA,useConfiguratorRouting:tU,usePresetSelection:th,usePublishedData:eM,useFrontendData:eS,useBackendData:M,useDomainApplicationProps:ec,useLoadedData:ev,useIntegrationService:eR,useIntegrationState:eU,usePresetEmbeddedState:eL,useRecipeEmbeddedState:eO,useCommittedSlice:O,useRenderedSlice:eZ,useCommittedState:Q,useRenderedState:e$,useStoreSelector:tu,useRenderedSelector:eX,useStoreSelector$:tf,useRenderedSelector$:eY,useEntitySelector:eg,useRenderedEntitySelector:eV,useRootEntitySelector:e6,useRenderedRootEntitySelector:eW,useStateValidity:td,useMapViolationHints:eH,useNavigate:eJ,usePopNavigate:eK,usePushNavigate:eN,useControlViolations:$,useFinalizeViolations:ek,useConfiguratorMessages:Z,useConfigurationSaveState:Y,useFinalizeAction:ej,useFinalizeActions:ex,useComponent:T,useRenderedComponent:eQ,useComponents:V,useRenderedComponents:eT,useFirstComponent:ey,useFirstRenderedComponent:eI,useRootComponents:e1,useRootRenderedComponents:e8,useFirstRootComponent:eA,useFirstRootRenderedComponent:eC,useEntityState:ef,useEntityRenderedState:eu,useRootEntityState:e7,useRootEntityRenderedState:e5,useRootEntityId:e2,useRootEntityRenderedId:e4,useEntityPrice:el,useRootEntityPrice:e3,useSelectedEntity:tr,useSelectedEntityId:to,useSelectedDomainEntityId:tt,useSelectEntity:e9,useDeselect:es,useSelectParent:te,useHoveredEntity:eB,useHoveredEntityId:eP,useHoveredDomainEntityId:eq,useActiveNavigationState:h,useActiveViewState:z,useSetViewState:tm,useActiveToolState:v,useIsFullscreenActive:eh,useSetFullscreen:ta,useResetCamera:t4,useUndoRedo:tx,useTabNavigation:tg,useStepNavigation:tc,useSceneSafeArea:t1,useActiveViewports:D,usePreview:tv,useCloseAction:tF,useIsCloningAllowed:tM.useIsCloningAllowed,useResolveLocalizable:e0,useLocalizable:eG,useToolbarActions:tL,useMeasurements:tK,useLocaleSwitch:eF,useShareLinks:tp,useAssistantPanel:tJ,useComposition:W,useUpdateControl:tk,useUpdatedControl:ty,useCookRecipes:_,useCookedRecipes:et,useCookReplaceRecipes:ee,useCookedReplaceRecipes:er,useDeleteEntity:ei,useDeletedEntity:en,useSwatchSelection:tl,useTextValue:tj,useAttributeSelection:H,useAttributeSwitch:J,useDistanceDimension:ea,useDistanceDimensionSelection:em,useGenericDimension:eE,useAngleDimension:G,useChildEntitySelection:N,useGroupedRecipeOptions:eb,useReplaceEntityRecipeOptions:e_,useUpdateEntityObjectSelection:tH,useGenerateShareLink:ew,useLoadingState:ez,useLoadingStateValue:eD,usePropertyPageStack:tz,usePropertyPageState:tD,isCreateEntityUpdate:p,isReplaceEntityUpdate:d,isDeleteEntityUpdate:b,isAngleDimensionUpdate:S,isDistanceDimensionUpdate:q,isGenericDimensionUpdate:B,isAttributeSelectionUpdate:w,isAttributeSwitchUpdate:E,isTextValueUpdate:R,isSwatchSelectionUpdate:P});
@@ -0,0 +1,5 @@
1
+ /**
2
+ * The default `ConfigurationNotFoundPage` registration: the built-in `ConfigurationNotFoundPage`,
3
+ * with the props the configurator renders the element with.
4
+ */
5
+ export declare const BuiltInConfigurationNotFoundPage: () => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1 @@
1
+ import{jsx as o}from"react/jsx-runtime";import{ConfigurationNotFoundPage as t,useConfigurationNotFoundPageProps as r}from"#package/react-sdk";export const BuiltInConfigurationNotFoundPage=()=>o(t,{...r()});
@@ -1,10 +1,4 @@
1
1
  import { type ConfigurationNotFoundPageProps } from '#package/react-sdk';
2
- /**
3
- * The name a project registers a layout element under to replace the page shown when a configuration
4
- * cannot be loaded or opened. Its default, the built-in `ConfigurationNotFoundPage`, is registered in
5
- * `defaultConfiguratorElements`.
6
- */
7
- export declare const ConfigurationNotFoundPageName = "ConfigurationNotFoundPage";
8
2
  /**
9
3
  * Renders the `ConfigurationNotFoundPage` element. `onBack` is passed only where leaving the page leads
10
4
  * somewhere, which is the start of the configurator.
@@ -1 +1 @@
1
- import{jsx as o}from"react/jsx-runtime";import{PhoenixLayoutElement as t}from"#package/react-sdk";export const ConfigurationNotFoundPageName="ConfigurationNotFoundPage";export const ConfigurationNotFoundPageElement=n=>o(t,{name:"ConfigurationNotFoundPage",elementProps:{...n}});
1
+ import{jsx as e}from"react/jsx-runtime";import{ConfigurationNotFoundPageName as o,ConfigurationNotFoundPagePropsProvider as r,PhoenixLayoutElement as t}from"#package/react-sdk";export const ConfigurationNotFoundPageElement=a=>e(r,{value:a,children:e(t,{name:o,elementProps:{...a}})});
@@ -1,2 +1,2 @@
1
- export { ConfigurationNotFoundPageElement, ConfigurationNotFoundPageName } from './ConfigurationNotFoundPageElement.js';
2
- export { createConfigurationNotFoundPage, type CreateConfigurationNotFoundPage, } from './create-configuration-not-found-page.js';
1
+ export { BuiltInConfigurationNotFoundPage } from './BuiltInConfigurationNotFoundPage.js';
2
+ export { ConfigurationNotFoundPageElement } from './ConfigurationNotFoundPageElement.js';
@@ -1 +1 @@
1
- export{ConfigurationNotFoundPageElement,ConfigurationNotFoundPageName}from"./ConfigurationNotFoundPageElement.js";export{createConfigurationNotFoundPage}from"./create-configuration-not-found-page.js";
1
+ export{BuiltInConfigurationNotFoundPage}from"./BuiltInConfigurationNotFoundPage.js";export{ConfigurationNotFoundPageElement}from"./ConfigurationNotFoundPageElement.js";
@@ -4,9 +4,9 @@ interface ConfiguratorResponsiveProviderProps {
4
4
  readonly containerZIndex: number;
5
5
  }
6
6
  /**
7
- * Gives the configurator its responsive state for as long as it is mounted, and renders the root
8
- * container that measures itself into that state. The lifecycle reads the state from the runtime
9
- * provider, the UI through `useResponsive()`.
7
+ * Renders the configurator's root container, which measures itself into the application runtime's
8
+ * responsive state. The lifecycle reads that state from the runtime, the UI through
9
+ * `useResponsive()`. The state belongs to this mount: it is reset when the container unmounts.
10
10
  */
11
11
  export declare const ConfiguratorResponsiveProvider: (props: ConfiguratorResponsiveProviderProps) => import("react/jsx-runtime").JSX.Element;
12
12
  export {};
@@ -1 +1 @@
1
- import{jsx as r}from"react/jsx-runtime";import{useState as e}from"react";import{ResponsiveStateManager as o,ResponsiveStateProvider as t}from"#package/react-sdk";import{ResponsiveApplicationProvider as a}from"#package/ui-sdk";export const ConfiguratorResponsiveProvider=i=>{let{children:n,containerZIndex:m}=i,[c]=e(()=>new o);return r(t,{manager:c,children:r(a,{containerZIndex:m,store:c,children:n})})};
1
+ import{jsx as r}from"react/jsx-runtime";import{useLayoutEffect as e}from"react";import{useResponsiveActions as o,useResponsiveStore as t}from"#package/react-sdk";import{ResponsiveApplicationProvider as i}from"#package/ui-sdk";export const ConfiguratorResponsiveProvider=a=>{let{children:m,containerZIndex:n}=a,s=t(),{reset:c}=o();return e(()=>()=>{c()},[c]),r(i,{containerZIndex:n,store:s,children:m})};
@@ -1 +1 @@
1
- import{jsx as e}from"react/jsx-runtime";import{createContext as r,useCallback as t,useContext as o,useEffect as i,useMemo as a,useState as n}from"react";import{match as s}from"ts-pattern";import{standardWebComponentProperties as d}from"#package/domain";import{useResponsiveState as m,useResponsiveStateManager as p,useWebComponentPropertyState as u,useWebComponentPropertyValue as w}from"#package/react-sdk";let h=r(null);export const PreviewContextProvider=r=>{let{children:o,preview:v,alwaysExpand:c}=r,[f,x]=n(!0),[l,P]=u(d.expanded),g=w(d.mode),k=w(d.power),{isMobile:C}=m(),{expand:b,collapse:j,show:y,hide:E}=p(),q=t(()=>{x(!1),(c||C)&&P(!0)},[C,c,P]),z=t(()=>{x(!0),P(!1)},[P]),A=a(()=>!!l||"configurator"===g&&s(v).with("hide",()=>!1).with("never",()=>!1).with("always",()=>!0).with("auto",()=>C).exhaustive(),[v,l,C,g]),B=!l&&A&&f,D="hide"===v&&!l&&"configurator"===g,F=a(()=>({isPreview:B,isExpanded:l,enter:q,leave:z,isPreviewEnabled:A,isHidden:D}),[B,l,q,z,A,D]),G=s(k).with("on",()=>!0).with("standby","off",()=>!1).exhaustive();return i(()=>{l&&G?b():j()},[l,b,j,G]),i(()=>{D?E():y()},[D,E,y]),e(h.Provider,{value:F,children:o})};export const usePreview=()=>{let e=o(h);if(!e)throw Error("Context was not provided - usePreview must be used inside PreviewContext provider");return e};
1
+ import{jsx as e}from"react/jsx-runtime";import{createContext as r,useCallback as t,useContext as o,useEffect as i,useMemo as a,useState as n}from"react";import{match as s}from"ts-pattern";import{standardWebComponentProperties as d}from"#package/domain";import{useResponsiveActions as m,useResponsiveState as p,useWebComponentPropertyState as u,useWebComponentPropertyValue as w}from"#package/react-sdk";let h=r(null);export const PreviewContextProvider=r=>{let{children:o,preview:v,alwaysExpand:c}=r,[f,x]=n(!0),[l,P]=u(d.expanded),g=w(d.mode),k=w(d.power),{isMobile:C}=p(),{expand:b,collapse:j,show:y,hide:E}=m(),q=t(()=>{x(!1),(c||C)&&P(!0)},[C,c,P]),z=t(()=>{x(!0),P(!1)},[P]),A=a(()=>!!l||"configurator"===g&&s(v).with("hide",()=>!1).with("never",()=>!1).with("always",()=>!0).with("auto",()=>C).exhaustive(),[v,l,C,g]),B=!l&&A&&f,D="hide"===v&&!l&&"configurator"===g,F=a(()=>({isPreview:B,isExpanded:l,enter:q,leave:z,isPreviewEnabled:A,isHidden:D}),[B,l,q,z,A,D]),G=s(k).with("on",()=>!0).with("standby","off",()=>!1).exhaustive();return i(()=>{l&&G?b():j()},[l,b,j,G]),i(()=>{D?E():y()},[D,E,y]),e(h.Provider,{value:F,children:o})};export const usePreview=()=>{let e=o(h);if(!e)throw Error("Context was not provided - usePreview must be used inside PreviewContext provider");return e};
@@ -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 +1 @@
1
- import{jsx as t,Fragment as e}from"react/jsx-runtime";import{useCallback as o,useEffect as r,useLayoutEffect as n,useState as a}from"react";import{standardWebComponentEvents as i,standardWebComponentProperties as u}from"#package/domain";import{ApplicationRoutes as l,INTEGRATION_MODE_SETTINGS as s,setConfigurationIdQuery as d,useDispatchWebComponentEvent as g,useRoutingSelectors as m,useRoutingService as c,useWebComponentProperty$ as f,useWebComponentPropertyValue as p}from"#package/react-sdk";import{useOnGoToIndexHandler as x}from"./OnGoToIndexHandler.js";export const useConfiguratorRouting=()=>c();export const ConfiguratorRoutingProvider=T=>{let{children:v}=T,O=c(),b=m(),C=x(),I=p(u.integrationMode),h=f(u.route),j=g(i.navigated),k=o(t=>{h.next(t),s[I].writeCidToUrl&&(t.route===l.Configuration?d(t.configurationId):d(null)),j(t)},[j,I,h]),[G,R]=a(!1);return(r(()=>(O.setOnGoToIndex(C?.handler??null),()=>{O.setOnGoToIndex(null)}),[O,C?.handler]),r(()=>(O.setOnNavigated(k),()=>{O.setOnNavigated(null)}),[O,k]),n(()=>{O.routeTo(h.value),R(!0)},[O,h,I]),r(()=>{let t=h.subscribe(t=>{b.getRoutingState()!==t&&O.routeTo(t)});return()=>{t.unsubscribe()}},[O,b,h]),G)?t(e,{children:v}):null};
1
+ import{jsx as r,Fragment as t}from"react/jsx-runtime";import{useCallback as e,useEffect as o,useLayoutEffect as n,useState as i}from"react";import{standardWebComponentEvents as a,standardWebComponentProperties as u}from"#package/domain";import{ApplicationRoutes as g,INTEGRATION_MODE_SETTINGS as s,setConfigurationIdQuery as d,useDispatchWebComponentEvent as m,useRoutingSelectors as c,useRoutingService as l,useWebComponentProperty$ as f,useWebComponentPropertyValue as p}from"#package/react-sdk";import{useOnGoToIndexHandler as x}from"./OnGoToIndexHandler.js";export const useConfiguratorRouting=()=>l();export const ConfiguratorRoutingProvider=T=>{let{children:b}=T,v=l(),C=c(),j=x(),k=p(u.integrationMode),I=f(u.route),O=m(a.navigated),R=e(r=>{I.next(r),s[k].writeCidToUrl&&(r.route===g.Configuration?d(r.configurationId):d(null)),O(r)},[O,k,I]),[h,G]=i(!1),w=j?.handler;return(o(()=>{if(w)return v.registerOnGoToIndex(w)},[v,w]),o(()=>v.registerOnNavigated(R),[v,R]),n(()=>{v.routeTo(I.value),G(!0)},[v,I,k]),o(()=>{let r=I.subscribe(r=>{C.getRoutingState()!==r&&v.routeTo(r)});return()=>{r.unsubscribe()}},[v,C,I]),h)?r(t,{children:b}):null};
@@ -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{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 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>;