@salsita-ai/sdk 0.50.0-develop.f6390cb584 → 0.50.0-develop.fbe43b9a2d

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 (293) hide show
  1. package/dist/application-spec/errors/diagnostic-codes.d.ts +9 -0
  2. package/dist/application-spec/errors/diagnostic-codes.js +1 -1
  3. package/dist/application-spec/errors/diagnostic-messages.d.ts +10 -1
  4. package/dist/application-spec/errors/diagnostic-messages.js +1 -1
  5. package/dist/application-spec/generate-application/code/domain-runtime-files.js +1 -1
  6. package/dist/application-spec/generate-application/code/templates/application-types.js +6 -6
  7. package/dist/application-spec/generate-application/code/templates/common/doc-comment.d.ts +2 -0
  8. package/dist/application-spec/generate-application/code/templates/common/doc-comment.js +1 -0
  9. package/dist/application-spec/generate-application/code/templates/configurator-globals.d.ts +2 -1
  10. package/dist/application-spec/generate-application/code/templates/configurator-globals.js +19 -6
  11. package/dist/application-spec/generate-application/code/templates/global-definition/generate-action-types.js +7 -7
  12. package/dist/application-spec/generate-application/code/templates/global-definition/generate-assistant-form-element-types.d.ts +12 -0
  13. package/dist/application-spec/generate-application/code/templates/global-definition/generate-assistant-form-element-types.js +7 -0
  14. package/dist/application-spec/generate-application/code/templates/global-definition/generate-phx-types.js +24 -22
  15. package/dist/application-spec/generate-application/code/templates/global-definition/index.d.ts +1 -0
  16. package/dist/application-spec/generate-application/code/templates/global-definition/index.js +1 -1
  17. package/dist/application-spec/generate-application/code/templates/skills/sdk-content.d.ts +2 -1
  18. package/dist/application-spec/generate-application/code/templates/skills/sdk-content.js +2 -2
  19. package/dist/application-spec/parse-application-files/raw-spec/raw-assistant.d.ts +33 -3
  20. package/dist/application-spec/parse-application-files/raw-spec/raw-assistant.js +1 -1
  21. package/dist/application-spec/parse-application-files/spec/sections/assistant/assistant-form-elements.d.ts +9 -0
  22. package/dist/application-spec/parse-application-files/spec/sections/assistant/assistant-form-elements.js +1 -0
  23. package/dist/application-spec/parse-application-files/spec/sections/assistant/assistant-schema.d.ts +4 -1
  24. package/dist/application-spec/parse-application-files/spec/sections/assistant/assistant-schema.js +1 -1
  25. package/dist/configurator/application-runtime/extensions/selectors.js +1 -1
  26. package/dist/configurator/application-runtime/extensions/systems/assistant-system/assistant-system.js +1 -1
  27. package/dist/configurator/application-runtime/extensions/systems/assistant-system/graphql-tools.d.ts +12 -2
  28. package/dist/configurator/application-runtime/extensions/systems/assistant-system/graphql-tools.js +1 -1
  29. package/dist/configurator/application-runtime/extensions/systems/canvas-system.d.ts +8 -0
  30. package/dist/configurator/application-runtime/extensions/systems/canvas-system.js +1 -1
  31. package/dist/configurator/application-runtime/extensions/systems/export-system/export-busy-error.d.ts +8 -0
  32. package/dist/configurator/application-runtime/extensions/systems/export-system/export-busy-error.js +1 -0
  33. package/dist/configurator/application-runtime/extensions/systems/export-system/export-system.d.ts +23 -1
  34. package/dist/configurator/application-runtime/extensions/systems/export-system/export-system.js +1 -1
  35. package/dist/configurator/application-runtime/extensions/systems/graphql-system/entity-meta.d.ts +14 -1
  36. package/dist/configurator/application-runtime/extensions/systems/graphql-system/entity-meta.js +1 -1
  37. package/dist/configurator/application-runtime/extensions/systems/graphql-system/graphql-system.d.ts +45 -4
  38. package/dist/configurator/application-runtime/extensions/systems/graphql-system/graphql-system.js +1 -1
  39. package/dist/configurator/application-runtime/extensions/systems/image-rendering-system/image-rendering-system.d.ts +14 -5
  40. package/dist/configurator/application-runtime/extensions/systems/image-rendering-system/image-rendering-system.js +1 -1
  41. package/dist/configurator/application-runtime/extensions/systems/index.d.ts +1 -1
  42. package/dist/configurator/common/configurator-interface.d.ts +33 -2
  43. package/dist/configurator/common/configurator-interface.js +1 -1
  44. package/dist/configurator/configurator-context/configurator-hooks/layout-hooks.d.ts +4 -0
  45. package/dist/configurator/configurator-context/configurator-routing/ConfiguratorRoutingProvider.js +1 -1
  46. package/dist/configurator/pages/default-configurator-elements.d.ts +3 -2
  47. package/dist/configurator/pages/default-configurator-elements.js +1 -1
  48. package/dist/configurator/pages/default-elements/index.d.ts +1 -0
  49. package/dist/configurator/pages/default-elements/index.js +1 -1
  50. package/dist/configurator/pages/default-elements/scene-controls/BuiltInAddEntityFab.d.ts +3 -0
  51. package/dist/configurator/pages/default-elements/scene-controls/BuiltInAddEntityFab.js +1 -0
  52. package/dist/configurator/pages/default-elements/scene-controls/BuiltInDeleteEntityFab.d.ts +3 -0
  53. package/dist/configurator/pages/default-elements/scene-controls/BuiltInDeleteEntityFab.js +1 -0
  54. package/dist/configurator/pages/default-elements/scene-controls/BuiltInNavigationHotspot.d.ts +3 -0
  55. package/dist/configurator/pages/default-elements/scene-controls/BuiltInNavigationHotspot.js +1 -0
  56. package/dist/configurator/pages/default-elements/scene-controls/BuiltInSelectionHotspot.d.ts +3 -0
  57. package/dist/configurator/pages/default-elements/scene-controls/BuiltInSelectionHotspot.js +1 -0
  58. package/dist/configurator/pages/default-elements/scene-controls/BuiltInToolMenuFab.d.ts +3 -0
  59. package/dist/configurator/pages/default-elements/scene-controls/BuiltInToolMenuFab.js +1 -0
  60. package/dist/configurator/pages/default-elements/scene-controls/index.d.ts +6 -0
  61. package/dist/configurator/pages/default-elements/scene-controls/index.js +1 -0
  62. package/dist/configurator/pages/default-elements/scene-controls/scene-control-elements.d.ts +6 -0
  63. package/dist/configurator/pages/default-elements/scene-controls/scene-control-elements.js +1 -0
  64. package/dist/configurator/scene/index.d.ts +1 -0
  65. package/dist/configurator/scene/index.js +1 -1
  66. package/dist/configurator/scene/scene-controls/ToolFab.d.ts +4 -0
  67. package/dist/configurator/scene/scene-controls/ToolFab.js +1 -1
  68. package/dist/configurator/scene/scene-controls/use-scene-control-tooltip.d.ts +2 -1
  69. package/dist/configurator/scene/scene-entity/scene-controls/SceneEntityHtmlHotspots.js +1 -1
  70. package/dist/configurator/toolbar-actions/index.d.ts +1 -0
  71. package/dist/configurator/toolbar-actions/index.js +1 -1
  72. package/dist/configurator/toolbar-actions/use-toolbar-actions.d.ts +100 -0
  73. package/dist/configurator/toolbar-actions/use-toolbar-actions.js +1 -0
  74. package/dist/configurator/toolbar-actions/use-toolbar-help.d.ts +7 -0
  75. package/dist/configurator/toolbar-actions/use-toolbar-help.js +1 -0
  76. package/dist/configurator/ui/assistant/AssistantChips.d.ts +3 -2
  77. package/dist/configurator/ui/assistant/AssistantChips.js +1 -1
  78. package/dist/configurator/ui/assistant/AssistantMarkdown.d.ts +1 -1
  79. package/dist/configurator/ui/assistant/AssistantMarkdown.js +1 -1
  80. package/dist/configurator/ui/assistant/alert/AssistantAlert.d.ts +8 -0
  81. package/dist/configurator/ui/assistant/alert/AssistantAlert.js +1 -0
  82. package/dist/configurator/ui/assistant/alert/index.d.ts +2 -0
  83. package/dist/configurator/ui/assistant/alert/index.js +1 -0
  84. package/dist/configurator/ui/assistant/alert/remark-alerts.d.ts +10 -0
  85. package/dist/configurator/ui/assistant/alert/remark-alerts.js +1 -0
  86. package/dist/configurator/ui/assistant/form/AssistantForm.js +1 -1
  87. package/dist/configurator/ui/assistant/form/compose-answer.d.ts +1 -1
  88. package/dist/configurator/ui/assistant/form/compose-answer.js +1 -1
  89. package/dist/configurator/ui/assistant/form/form-model.d.ts +3 -4
  90. package/dist/configurator/ui/assistant/form/form-state.d.ts +1 -1
  91. package/dist/configurator/ui/assistant/form/index.d.ts +2 -0
  92. package/dist/configurator/ui/assistant/form/index.js +1 -1
  93. package/dist/configurator/ui/assistant/form/parse-form-block.d.ts +3 -2
  94. package/dist/configurator/ui/assistant/form/parse-form-block.js +1 -1
  95. package/dist/configurator/ui/assistant/form/read-form-attributes.d.ts +1 -1
  96. package/dist/configurator/ui/assistant/form/read-form-attributes.js +1 -1
  97. package/dist/configurator/ui/assistant/form/registry/built-in-form-elements.d.ts +3 -0
  98. package/dist/configurator/ui/assistant/form/registry/built-in-form-elements.js +1 -0
  99. package/dist/configurator/ui/assistant/form/registry/create-assistant-form-element.d.ts +31 -0
  100. package/dist/configurator/ui/assistant/form/registry/create-assistant-form-element.js +1 -0
  101. package/dist/configurator/ui/assistant/form/{form-element-definition.d.ts → registry/form-element-definition.d.ts} +3 -1
  102. package/dist/configurator/ui/assistant/form/registry/form-element-definition.js +1 -0
  103. package/dist/configurator/ui/assistant/form/{form-registry.d.ts → registry/form-registry.d.ts} +2 -2
  104. package/dist/configurator/ui/assistant/form/registry/form-registry.js +1 -0
  105. package/dist/configurator/ui/assistant/form/registry/index.d.ts +6 -0
  106. package/dist/configurator/ui/assistant/form/registry/index.js +1 -0
  107. package/dist/configurator/ui/assistant/form/registry/use-form-registry.d.ts +8 -0
  108. package/dist/configurator/ui/assistant/form/registry/use-form-registry.js +1 -0
  109. package/dist/configurator/ui/assistant/form-elements/FormCard.d.ts +9 -0
  110. package/dist/configurator/ui/assistant/form-elements/FormCard.js +1 -0
  111. package/dist/configurator/ui/assistant/form-elements/FormConfirm.d.ts +9 -0
  112. package/dist/configurator/ui/assistant/form-elements/FormConfirm.js +1 -0
  113. package/dist/configurator/ui/assistant/form-elements/FormGroup.d.ts +4 -1
  114. package/dist/configurator/ui/assistant/form-elements/FormNumber.d.ts +9 -0
  115. package/dist/configurator/ui/assistant/form-elements/FormNumber.js +1 -0
  116. package/dist/configurator/ui/assistant/form-elements/FormOptions.d.ts +4 -1
  117. package/dist/configurator/ui/assistant/form-elements/FormReply.d.ts +4 -1
  118. package/dist/configurator/ui/assistant/form-elements/FormReply.js +1 -1
  119. package/dist/configurator/ui/assistant/form-elements/FormSwatch.d.ts +10 -0
  120. package/dist/configurator/ui/assistant/form-elements/FormSwatch.js +1 -0
  121. package/dist/configurator/ui/assistant/form-elements/FormText.d.ts +4 -1
  122. package/dist/configurator/ui/assistant/form-elements/FormText.js +1 -1
  123. package/dist/configurator/ui/assistant/form-elements/clamp-form-number.d.ts +10 -0
  124. package/dist/configurator/ui/assistant/form-elements/clamp-form-number.js +1 -0
  125. package/dist/configurator/ui/assistant/form-elements/form-element-props.d.ts +20 -16
  126. package/dist/configurator/ui/assistant/form-elements/index.d.ts +4 -0
  127. package/dist/configurator/ui/assistant/form-elements/index.js +1 -1
  128. package/dist/configurator/ui/assistant/index.d.ts +3 -0
  129. package/dist/configurator/ui/assistant/index.js +1 -1
  130. package/dist/configurator/ui/assistant/resource-image/index.d.ts +1 -1
  131. package/dist/configurator/ui/assistant/resource-image/index.js +1 -1
  132. package/dist/configurator/ui/assistant/resource-image/resource-path.d.ts +0 -9
  133. package/dist/configurator/ui/assistant/resource-image/resource-path.js +1 -1
  134. package/dist/configurator/ui/assistant/screenshots/ScreenshotThumbnails.d.ts +9 -0
  135. package/dist/configurator/ui/assistant/screenshots/ScreenshotThumbnails.js +1 -0
  136. package/dist/configurator/ui/assistant/screenshots/index.d.ts +2 -0
  137. package/dist/configurator/ui/assistant/screenshots/index.js +1 -0
  138. package/dist/configurator/ui/assistant/screenshots/tool-screenshots.d.ts +14 -0
  139. package/dist/configurator/ui/assistant/screenshots/tool-screenshots.js +1 -0
  140. package/dist/configurator/ui/assistant/streamed-markdown.d.ts +2 -2
  141. package/dist/configurator/ui/assistant/streamed-markdown.js +2 -2
  142. package/dist/configurator/ui/assistant/tool-chip.js +1 -1
  143. package/dist/configurator/ui/configurator-layout/universal/ExportingOverlay.d.ts +5 -0
  144. package/dist/configurator/ui/configurator-layout/universal/ExportingOverlay.js +1 -0
  145. package/dist/configurator/ui/configurator-layout/universal/Layout.js +1 -1
  146. package/dist/configurator/ui/index.d.ts +1 -0
  147. package/dist/configurator/ui/index.js +1 -1
  148. package/dist/docs/complex-use-cases/focus-mode.mdx +2 -0
  149. package/dist/docs/fabs/basic.mdx +4 -0
  150. package/dist/docs/index.json +62 -1
  151. package/dist/docs/layouts/custom-layout.mdx +3 -1
  152. package/dist/docs/layouts/gallery/ardent-compressor.mdx +3515 -0
  153. package/dist/docs/layouts/gallery/fenwick-window.mdx +2732 -0
  154. package/dist/docs/layouts/gallery/ferrule-bar-station.mdx +6567 -0
  155. package/dist/docs/layouts/gallery/kestrel-kettle.mdx +1858 -0
  156. package/dist/docs/layouts/gallery/sunfold-solar.mdx +2671 -0
  157. package/dist/docs/other-features/client-side-rendering/declarative.mdx +1 -1
  158. package/dist/docs/other-features/navigation-hotspot.mdx +2 -0
  159. package/dist/docs/phoenix/configurator-interface.mdx +64 -8
  160. package/dist/docs/phoenix/sdk-builder-workflow.mdx +1 -1
  161. package/dist/docs/selection-and-highlight/hotspots.mdx +2 -0
  162. package/dist/domain/application/assistant/assistant-manifest.d.ts +16 -1
  163. package/dist/domain/application/assistant/assistant-resolved-manifest.d.ts +8 -1
  164. package/dist/domain/application/assistant/build-assistant-manifest.js +1 -1
  165. package/dist/domain/application/assistant/form/assistant-form-element-name.d.ts +11 -0
  166. package/dist/domain/application/assistant/form/assistant-form-element-name.js +8 -0
  167. package/dist/domain/application/assistant/form/assistant-form-elements.d.ts +174 -0
  168. package/dist/domain/application/assistant/form/assistant-form-elements.js +1 -0
  169. package/dist/domain/application/assistant/form/assistant-resource-path.d.ts +10 -0
  170. package/dist/domain/application/assistant/form/assistant-resource-path.js +1 -0
  171. package/dist/domain/application/assistant/form/index.d.ts +4 -0
  172. package/dist/domain/application/assistant/form/index.js +1 -0
  173. package/dist/domain/application/assistant/generate-assistant-prompt.d.ts +3 -0
  174. package/dist/domain/application/assistant/generate-assistant-prompt.js +1 -1
  175. package/dist/domain/application/assistant/index.d.ts +2 -3
  176. package/dist/domain/application/assistant/index.js +1 -1
  177. package/dist/domain/application/assistant/session-setup/apply-assistant-setup.js +1 -1
  178. package/dist/domain/application/assistant/session-setup/assistant-setup-manifest.d.ts +2 -0
  179. package/dist/domain/application/assistant/session-setup/assistant-setup-manifest.js +1 -1
  180. package/dist/domain/available-system-components.d.ts +1 -1
  181. package/dist/domain/available-system-components.js +1 -1
  182. package/dist/domain/domain-context/store-system/store-system.d.ts +5 -0
  183. package/dist/domain/domain-context/store-system/store-system.js +1 -1
  184. package/dist/domain/domain-runtime/domain-runtime.d.ts +4 -0
  185. package/dist/domain/domain-runtime/environment/types.d.ts +1 -1
  186. package/dist/domain/domain-runtime/spec/index.d.ts +1 -1
  187. package/dist/domain/domain-runtime/spec/index.js +1 -1
  188. package/dist/domain/domain-runtime/spec/initialize.js +1 -1
  189. package/dist/domain/domain-runtime/spec/module-checks/element-registration.d.ts +15 -1
  190. package/dist/domain/domain-runtime/spec/module-checks/element-registration.js +1 -1
  191. package/dist/domain/domain-runtime/spec/module-checks/find-assistant-form-element-errors.d.ts +12 -0
  192. package/dist/domain/domain-runtime/spec/module-checks/find-assistant-form-element-errors.js +1 -0
  193. package/dist/domain/domain-runtime/spec/module-checks/index.d.ts +2 -1
  194. package/dist/domain/domain-runtime/spec/module-checks/index.js +1 -1
  195. package/dist/domain/domain-runtime/spec/selectors.d.ts +3 -1
  196. package/dist/domain/domain-runtime/spec/selectors.js +1 -1
  197. package/dist/domain/extensions/export-images/agent-screenshot.d.ts +24 -0
  198. package/dist/domain/extensions/export-images/agent-screenshot.js +1 -0
  199. package/dist/domain/extensions/{client-side-image.d.ts → export-images/client-side-image.d.ts} +2 -2
  200. package/dist/domain/extensions/export-images/client-side-image.js +1 -0
  201. package/dist/domain/extensions/export-images/index.d.ts +3 -0
  202. package/dist/domain/extensions/export-images/index.js +1 -0
  203. package/dist/domain/extensions/{save-template-thumbnail.d.ts → export-images/save-template-thumbnail.d.ts} +2 -2
  204. package/dist/domain/extensions/export-images/save-template-thumbnail.js +1 -0
  205. package/dist/domain/extensions/index.d.ts +1 -2
  206. package/dist/domain/extensions/index.js +1 -1
  207. package/dist/domain/mocks/create-mock-domain-runtime.d.ts +2 -0
  208. package/dist/editor/domain-editors/DomainSpecContext.js +1 -1
  209. package/dist/editor/domain-editors/apply-spec-update.d.ts +8 -1
  210. package/dist/editor/domain-editors/apply-spec-update.js +1 -1
  211. package/dist/editor/domain-editors/use-implementation-files.js +1 -1
  212. package/dist/editor/screenshot/ScreenshotHandler.js +1 -1
  213. package/dist/i18n/locales/cs/messages.js +1 -1
  214. package/dist/i18n/locales/da/messages.js +1 -1
  215. package/dist/i18n/locales/de/messages.js +1 -1
  216. package/dist/i18n/locales/de-AT/messages.js +1 -1
  217. package/dist/i18n/locales/en/messages.js +1 -1
  218. package/dist/i18n/locales/en-AU/messages.js +1 -1
  219. package/dist/i18n/locales/en-GB/messages.js +1 -1
  220. package/dist/i18n/locales/es/messages.js +1 -1
  221. package/dist/i18n/locales/fr/messages.js +1 -1
  222. package/dist/i18n/locales/hu/messages.js +1 -1
  223. package/dist/i18n/locales/it/messages.js +1 -1
  224. package/dist/i18n/locales/nl/messages.js +1 -1
  225. package/dist/i18n/locales/pl/messages.js +1 -1
  226. package/dist/i18n/locales/pt/messages.js +1 -1
  227. package/dist/i18n/locales/ro/messages.js +1 -1
  228. package/dist/i18n/locales/sk/messages.js +1 -1
  229. package/dist/i18n/locales/tr/messages.js +1 -1
  230. package/dist/legacy/domain-spec/__generated/domain-schema.d.ts +16 -0
  231. package/dist/legacy/domain-spec/spec/domain-spec.js +1 -1
  232. package/dist/react-sdk/application-runtime/hooks/use-phoenix-element-slots.d.ts +2 -1
  233. package/dist/react-sdk/application-runtime/integration/initialize.d.ts +7 -6
  234. package/dist/react-sdk/application-runtime/integration/initialize.js +1 -1
  235. package/dist/react-sdk/application-runtime/integration/selectors.d.ts +11 -2
  236. package/dist/react-sdk/application-runtime/integration/selectors.js +1 -1
  237. package/dist/react-sdk/application-runtime/integration/types.d.ts +5 -2
  238. package/dist/react-sdk/application-runtime/mocks/create-mock-application-runtime.js +1 -1
  239. package/dist/react-sdk/application-runtime/routing/routing-service.d.ts +34 -2
  240. package/dist/react-sdk/application-runtime/routing/routing-service.js +1 -1
  241. package/dist/react-sdk/application-runtime/runtime/create-application-runtime.d.ts +4 -2
  242. package/dist/react-sdk/application-runtime/runtime/create-application-runtime.js +1 -1
  243. package/dist/react-sdk/domain-context/system-hooks/undo-redo-hooks.js +1 -1
  244. package/dist/react-sdk/index.d.ts +1 -0
  245. package/dist/react-sdk/index.js +1 -1
  246. package/dist/react-sdk/scene-control-elements/AddEntityFabElement.d.ts +36 -0
  247. package/dist/react-sdk/scene-control-elements/AddEntityFabElement.js +1 -0
  248. package/dist/react-sdk/scene-control-elements/DeleteEntityFabElement.d.ts +44 -0
  249. package/dist/react-sdk/scene-control-elements/DeleteEntityFabElement.js +1 -0
  250. package/dist/react-sdk/scene-control-elements/NavigationHotspotElement.d.ts +38 -0
  251. package/dist/react-sdk/scene-control-elements/NavigationHotspotElement.js +1 -0
  252. package/dist/react-sdk/scene-control-elements/SelectionHotspotElement.d.ts +30 -0
  253. package/dist/react-sdk/scene-control-elements/SelectionHotspotElement.js +1 -0
  254. package/dist/react-sdk/scene-control-elements/ToolMenuFabElement.d.ts +30 -0
  255. package/dist/react-sdk/scene-control-elements/ToolMenuFabElement.js +1 -0
  256. package/dist/react-sdk/scene-control-elements/create-add-entity-fab.d.ts +9 -0
  257. package/dist/react-sdk/scene-control-elements/create-add-entity-fab.js +1 -0
  258. package/dist/react-sdk/scene-control-elements/create-delete-entity-fab.d.ts +9 -0
  259. package/dist/react-sdk/scene-control-elements/create-delete-entity-fab.js +1 -0
  260. package/dist/react-sdk/scene-control-elements/create-navigation-hotspot.d.ts +10 -0
  261. package/dist/react-sdk/scene-control-elements/create-navigation-hotspot.js +1 -0
  262. package/dist/react-sdk/scene-control-elements/create-selection-hotspot.d.ts +9 -0
  263. package/dist/react-sdk/scene-control-elements/create-selection-hotspot.js +1 -0
  264. package/dist/react-sdk/scene-control-elements/create-tool-menu-fab.d.ts +9 -0
  265. package/dist/react-sdk/scene-control-elements/create-tool-menu-fab.js +1 -0
  266. package/dist/react-sdk/scene-control-elements/index.d.ts +11 -0
  267. package/dist/react-sdk/scene-control-elements/index.js +1 -0
  268. package/dist/react-sdk/scene-control-elements/scene-control-tooltip-visibility.d.ts +5 -0
  269. package/dist/react-sdk/web-component/create-web-component.js +1 -1
  270. package/dist/react-sdk/web-component/god-mode/god-mode-registry.d.ts +30 -0
  271. package/dist/react-sdk/web-component/god-mode/god-mode-registry.js +1 -0
  272. package/dist/react-sdk/web-component/god-mode/index.d.ts +1 -0
  273. package/dist/react-sdk/web-component/god-mode/index.js +1 -0
  274. package/dist/ui-sdk/icons/__generated/Lightbulb.d.ts +3 -0
  275. package/dist/ui-sdk/icons/__generated/Lightbulb.js +1 -0
  276. package/dist/ui-sdk/icons/__generated/XCircle.d.ts +3 -0
  277. package/dist/ui-sdk/icons/__generated/XCircle.js +1 -0
  278. package/dist/ui-sdk/icons/__generated/index.d.ts +4 -0
  279. package/dist/ui-sdk/icons/__generated/index.js +1 -1
  280. package/dist/ui-sdk/icons/icons-registry.js +1 -1
  281. package/dist/ui-sdk/theme/types.d.ts +5 -1
  282. package/package.json +13 -3
  283. package/schema/domain-spec.json +140 -0
  284. package/dist/configurator/ui/assistant/form/built-in-form-registry.d.ts +0 -10
  285. package/dist/configurator/ui/assistant/form/built-in-form-registry.js +0 -1
  286. package/dist/configurator/ui/assistant/form/form-registry.js +0 -8
  287. package/dist/domain/application/assistant/assistant-form-elements.d.ts +0 -28
  288. package/dist/domain/application/assistant/assistant-form-elements.js +0 -1
  289. package/dist/domain/extensions/client-side-image.js +0 -1
  290. package/dist/domain/extensions/save-template-thumbnail.js +0 -1
  291. package/dist/react-sdk/application-runtime/runtime/god-mode.d.ts +0 -19
  292. package/dist/react-sdk/application-runtime/runtime/god-mode.js +0 -1
  293. /package/dist/{configurator/ui/assistant/form/form-element-definition.js → react-sdk/scene-control-elements/scene-control-tooltip-visibility.js} +0 -0
@@ -1 +1 @@
1
- import{isNonNullish as t}from"@salsita-ai/common/utils";export class ExportSystem{_context;_generation=null;_frameloopPause=null;constructor(t){this._context=t}pauseFrameloop=t=>{if(this._frameloopPause?.handle===t)this._frameloopPause.holders+=1;else{let{frameloop:e,internal:o}=t.get();this._frameloopPause={handle:t,frameloop:e,priority:o.priority,holders:1},t.set(t=>({...t,frameloop:"never",internal:{...t.internal,priority:1/0}}))}let e=this._frameloopPause,o=!1;return()=>{o||(o=!0,e.holders-=1,e.holders>0||this._frameloopPause!==e||(this._frameloopPause=null,this._context.configuratorExtensionSelectors.getCanvasSystem().r3fHandle$.value===t&&t.set(t=>({...t,frameloop:e.frameloop,internal:{...t.internal,priority:e.priority}}))))}};createExportJob=(t,e,o)=>({sourceState:t,exportState:e.exportState,exportedEntityId:e.exportedEntityId,execute:o,toolState:e.toolState,viewState:e.viewState,navigationState:e.navigationState,selectedEntityId:e.selectedEntityId});runExportJobs=async e=>{let o=this._generation,i=()=>{if(!o?.active)throw Error("Export generation ended while jobs were running! The configurator context was reinitialized mid-export, so the remaining jobs would drive a state that is no longer theirs. Await the export before leaving the configuration, or discard the rejection.")};i();let a=this._context.configuratorExtensionSelectors.getCanvasSystem().r3fHandle$.value;if(!a)throw Error("Canvas is not ready");let n=this._context.domainContextSelectors.getStoreSystem().stateSlices.committed.value,r=this.pauseFrameloop(a);try{let o=[];for(let n of e){i();let e=this._context.domainContextSelectors.getStoreSystem().prepareStateEmission([this._context.domainContextSelectors.getNavigationSystem().getExportUpdate(n.exportState,n.exportedEntityId),null!=n.toolState?this._context.domainContextSelectors.getNavigationSystem().getToolUpdate(n.toolState):void 0,null!=n.viewState?this._context.domainContextSelectors.getNavigationSystem().getViewUpdate(n.viewState):void 0,null!=n.navigationState?this._context.domainContextSelectors.getNavigationSystem().getNavigationUpdate(n.navigationState):void 0,null!=n.selectedEntityId?this._context.domainContextSelectors.getNavigationSystem().getSelectUpdate(n.selectedEntityId):void 0,this._context.domainContextSelectors.getNavigationSystem().getHoverOutUpdate()].filter(t),n.sourceState,"staged");if(this._context.domainContextSelectors.getStoreSystem().emit(e),await this._context.configuratorExtensionSelectors.getCanvasSystem().waitForFlush(),i(),!e.validity.valid)throw this._context.domainServicesSelectors.getLogger().error(`Setting an export state to ${n.exportState} for entity ${n.exportedEntityId} resulted in an invalid state! Check if there isn't a transformer corrupting the state as a reaction to setting the export state.`,e),Error("Exported state is invalid!");let r=e.state,s=this._context.domainContextSelectors.getDomain().get$Entity(n.exportedEntityId,r),l=this._context.domainContextSelectors.getDomain().getRoot$Entity(r),c=await n.execute({$entity:s,$root:l,state:r,scene:a.get().scene});i(),o.push(c)}return o}finally{o?.active&&this._context.domainContextSelectors.getStoreSystem().emit(n),r()}};initialize=()=>{null!==this._generation&&(this._generation.active=!1),this._generation={active:!0}}}
1
+ import{BehaviorSubject as t}from"rxjs";import{isNonNullish as e}from"@salsita-ai/common/utils";import{ExportBusyError as o}from"./export-busy-error.js";export class ExportSystem{_context;_generation=null;_frameloopPause=null;_queue=null;_exporting=new t(!1);exporting$=this._exporting;constructor(t){this._context=t}pauseFrameloop=t=>{if(this._frameloopPause?.handle===t)this._frameloopPause.holders+=1;else{let{frameloop:e,internal:o}=t.get();this._frameloopPause={handle:t,frameloop:e,priority:o.priority,holders:1},t.set(t=>({...t,frameloop:"never",internal:{...t.internal,priority:1/0}}))}let e=this._frameloopPause,o=!1;return()=>{o||(o=!0,e.holders-=1,e.holders>0||this._frameloopPause!==e||(this._frameloopPause=null,this._context.configuratorExtensionSelectors.getCanvasSystem().r3fHandle$.value===t&&t.set(t=>({...t,frameloop:e.frameloop,internal:{...t.internal,priority:e.priority}}))))}};createExportJob=(t,e,o)=>({sourceState:t,exportState:e.exportState,exportedEntityId:e.exportedEntityId,execute:o,toolState:e.toolState,viewState:e.viewState,navigationState:e.navigationState,selectedEntityId:e.selectedEntityId});runExportJobs=(t,e={})=>{let o=this._generation,i=(this._queue??Promise.resolve()).then(()=>this._runExportJobs(t,e,o)),a=i.catch(()=>void 0);return this._queue=a,this._exporting.value||this._exporting.next(!0),a.then(()=>{this._queue===a&&(this._queue=null,this._exporting.next(!1))}),i};_awaitSettledState=async t=>{let e=this._context.domainContextSelectors.getStoreSystem(),i=Date.now()+2e3;for(;e.hasStagedUpdates;){if(Date.now()>=i)throw new o;await new Promise(t=>setTimeout(t,200)),t()}};_runExportJobs=async(t,{awaitSettledState:o=!1},i)=>{let a=()=>{if(!i?.active)throw Error("Export generation ended while jobs were running! The configurator context was reinitialized mid-export, so the remaining jobs would drive a state that is no longer theirs. Await the export before leaving the configuration, or discard the rejection.")};a(),o&&await this._awaitSettledState(a);let n=this._context.configuratorExtensionSelectors.getCanvasSystem(),r=n.r3fHandle$.value??await n.waitForCanvas().catch(t=>{throw a(),t});a();let s=this.pauseFrameloop(r);try{let o=[];for(let i of t){a();let t=this._context.domainContextSelectors.getStoreSystem().prepareStateEmission([this._context.domainContextSelectors.getNavigationSystem().getExportUpdate(i.exportState,i.exportedEntityId),null!=i.toolState?this._context.domainContextSelectors.getNavigationSystem().getToolUpdate(i.toolState):void 0,null!=i.viewState?this._context.domainContextSelectors.getNavigationSystem().getViewUpdate(i.viewState):void 0,null!=i.navigationState?this._context.domainContextSelectors.getNavigationSystem().getNavigationUpdate(i.navigationState):void 0,null!=i.selectedEntityId?this._context.domainContextSelectors.getNavigationSystem().getSelectUpdate(i.selectedEntityId):void 0,this._context.domainContextSelectors.getNavigationSystem().getHoverOutUpdate()].filter(e),i.sourceState,"staged");if(this._context.domainContextSelectors.getStoreSystem().emit(t),await this._context.configuratorExtensionSelectors.getCanvasSystem().waitForFlush(),a(),!t.validity.valid)throw this._context.domainServicesSelectors.getLogger().error(`Setting an export state to ${i.exportState} for entity ${i.exportedEntityId} resulted in an invalid state! Check if there isn't a transformer corrupting the state as a reaction to setting the export state.`,t),Error("Exported state is invalid!");let n=t.state,s=this._context.domainContextSelectors.getDomain().get$Entity(i.exportedEntityId,n),l=this._context.domainContextSelectors.getDomain().getRoot$Entity(n),c=await i.execute({$entity:s,$root:l,state:n,scene:r.get().scene});a(),o.push(c)}return o}finally{if(i?.active){let t=this._context.domainContextSelectors.getStoreSystem();t.emit(t.stateSlices.committed.value)}s()}};initialize=()=>{null!==this._generation&&(this._generation.active=!1),this._generation={active:!0},this._queue=null,this._exporting.value&&this._exporting.next(!1)}}
@@ -20,6 +20,13 @@ export interface EntityMetaContext {
20
20
  readonly success: false;
21
21
  readonly errors: readonly string[];
22
22
  };
23
+ /**
24
+ * Takes a screenshot of the entity from one of its views on the state it was read on and returns
25
+ * the label of the image; `null` when the view does not apply to the entity there.
26
+ */
27
+ readonly takeScreenshot: (source: EntityMetaSource, view: string) => Promise<{
28
+ readonly image: string;
29
+ } | null>;
23
30
  }
24
31
  /** One reason a dry-run reports for a change that cannot be made; a violation can sit on a virtual entity. */
25
32
  interface DryRunError {
@@ -30,7 +37,8 @@ interface DryRunError {
30
37
  /**
31
38
  * The value of an entity's `meta` field: its built-ins, resolved lazily against the state the entity
32
39
  * was read on. `childRecipes` and `replaceRecipes` list the manifest's recipe groups of their kind
33
- * that are active on the entity there; each options edge lists the choices of its field there, or `null` when its component is not active.
40
+ * that are active on the entity there; each options edge lists the choices of its field there, or `null` when its component is not active;
41
+ * `screenshot` renders the entity there.
34
42
  */
35
43
  export declare const createEntityMeta: (source: EntityMetaSource, context: EntityMetaContext) => {
36
44
  childRecipes: () => {
@@ -85,5 +93,10 @@ export declare const createEntityMeta: (source: EntityMetaSource, context: Entit
85
93
  } | null;
86
94
  }[];
87
95
  }[];
96
+ screenshot: ({ view }: {
97
+ readonly view: string;
98
+ }) => Promise<{
99
+ readonly image: string;
100
+ } | null>;
88
101
  };
89
102
  export {};
@@ -1 +1 @@
1
- import{findAssistantFieldOptions as e,findAssistantRecipeGroups as t,modifyEntityUpdateTag as i,prepareAssistantRecipeUpdates as r,readAssistantFieldOptions as n,readAssistantRecipeGroup as o,systemUpdateFactory as s}from"#package/domain";import{readSideEffects as a}from"./side-effects.js";let d=e=>({ok:!1,root:null,changedEntities:[],deletedEntityIds:[],sideEffects:[],errors:e}),l=(e,{state:t},{recipes:i,prepareStateEmission:r,find$Entity:n})=>{let{validity:o,state:s,updates:l}=r(e,t,"committed");if(o.valid){let e=new Map(t.entities.map(e=>[e.id,e])),r=new Set(s.entities.map(e=>e.id));return{ok:!0,root:n(s.rootEntityId,s),changedEntities:s.entities.filter(t=>e.get(t.id)!==t).flatMap(e=>n(e.id,s)??[]),deletedEntityIds:t.entities.map(e=>e.id).filter(e=>!r.has(e)),sideEffects:a(l,i.resolveLocalizable),errors:[]}}return d("uncaught"===o.severity?[{type:"uncaught",entityId:null,message:o.error.message}]:o.entityViolations.filter(({violation:e})=>e.severity===o.severity).map(({entityId:e,violation:t})=>({type:t.type,entityId:e,message:void 0===t.message?null:i.resolveLocalizable(t.message)})))};export const createEntityMeta=(a,u)=>{let c=e=>()=>t(u.manifest,e,a.entity.type).flatMap(t=>{let i=o(e,t,a.entity.id,a.state,u.recipes);return i?[((e,t,i)=>{let{group:n,label:o,description:s,recipes:a}=e,{resolveLocalizable:u}=i.recipes;return{groupId:n.groupId,name:void 0===o?n.instanceName:u(o),description:n.description??(void 0===s?null:u(s)),recipes:a.map(n=>((e,t,i,n)=>{let{key:o,item:s}=e,{resolveLocalizable:a}=n.recipes;return{key:o,name:a(s.title),description:void 0===s.description?null:a(s.description),imageUrl:void 0===s.thumbnailUrl?null:a(s.thumbnailUrl),dryRun:()=>t.group.dryRuns?((e,t,i,n)=>{let{updates:o,error:s}=((e,t,{entity:i,state:n},{recipes:o})=>{try{return{updates:r(e,t,i.id,n,o),error:void 0}}catch(e){if("child"===t.target.kind)throw e;return{updates:void 0,error:e instanceof Error?e.message:String(e)}}})(e,t,i,n);return void 0===o?d([{type:"uncaught",entityId:null,message:s}]):l(o,i,n)})(e,t,i,n):null}})(n,e,t,i))}})(i,a,u)]:[]});return{...Object.fromEntries(e(u.manifest,a.entity.type).map(e=>[e.edgeName,()=>n(e,a.entity.id,a.state,u.recipes)?.map(t=>({...t,dryRun:()=>e.dryRuns?(({field:e},{value:t},r,n)=>{let{entity:o}=r,a=Object.entries(Object.entries(n.manifest.writableFields??{}).find(([e])=>e===o.type)?.[1]??{}).find(([t])=>t===e)?.[1];if(void 0===a)throw Error(`The options of "${e}" on "${o.id}" cannot be dry-run: the schema lists them, but the configurator has no writable field "${e}" on ${o.type}. This is a fault in the configurator, not in your request. Tell the user this is not available.`);let u=r.state.entities.find(e=>e.id===o.id);if(!u)throw Error(`The options of "${e}" on "${o.id}" cannot be dry-run: entity "${o.id}" does not exist. It may have been deleted by an earlier operation or field. Query the current entities and use an id they return.`);let c={[a]:t},p=n.validateEntity({...u,...c});return p.success?l([s.DomainEntityModification({entityId:o.id,stateDelta:c,updateTag:i})],r,n):d([{type:"uncaught",entityId:o.id,message:`Writing ${JSON.stringify(t)} to "${e}" would make "${o.id}" an invalid ${o.type}: ${p.errors.join("; ")}. The option comes from the configurator and cannot be corrected from here, so do not write it.`}])})(e,t,a,u):null}))??null])),childRecipes:c("child"),replaceRecipes:c("replace")}};
1
+ import{findAssistantFieldOptions as e,findAssistantRecipeGroups as t,modifyEntityUpdateTag as i,prepareAssistantRecipeUpdates as r,readAssistantFieldOptions as n,readAssistantRecipeGroup as o,systemUpdateFactory as s}from"#package/domain";import{readSideEffects as a}from"./side-effects.js";let d=e=>({ok:!1,root:null,changedEntities:[],deletedEntityIds:[],sideEffects:[],errors:e}),l=(e,{state:t},{recipes:i,prepareStateEmission:r,find$Entity:n})=>{let{validity:o,state:s,updates:l}=r(e,t,"committed");if(o.valid){let e=new Map(t.entities.map(e=>[e.id,e])),r=new Set(s.entities.map(e=>e.id));return{ok:!0,root:n(s.rootEntityId,s),changedEntities:s.entities.filter(t=>e.get(t.id)!==t).flatMap(e=>n(e.id,s)??[]),deletedEntityIds:t.entities.map(e=>e.id).filter(e=>!r.has(e)),sideEffects:a(l,i.resolveLocalizable),errors:[]}}return d("uncaught"===o.severity?[{type:"uncaught",entityId:null,message:o.error.message}]:o.entityViolations.filter(({violation:e})=>e.severity===o.severity).map(({entityId:e,violation:t})=>({type:t.type,entityId:e,message:void 0===t.message?null:i.resolveLocalizable(t.message)})))};export const createEntityMeta=(a,u)=>{let c=e=>()=>t(u.manifest,e,a.entity.type).flatMap(t=>{let i=o(e,t,a.entity.id,a.state,u.recipes);return i?[((e,t,i)=>{let{group:n,label:o,description:s,recipes:a}=e,{resolveLocalizable:u}=i.recipes;return{groupId:n.groupId,name:void 0===o?n.instanceName:u(o),description:n.description??(void 0===s?null:u(s)),recipes:a.map(n=>((e,t,i,n)=>{let{key:o,item:s}=e,{resolveLocalizable:a}=n.recipes;return{key:o,name:a(s.title),description:void 0===s.description?null:a(s.description),imageUrl:void 0===s.thumbnailUrl?null:a(s.thumbnailUrl),dryRun:()=>t.group.dryRuns?((e,t,i,n)=>{let{updates:o,error:s}=((e,t,{entity:i,state:n},{recipes:o})=>{try{return{updates:r(e,t,i.id,n,o),error:void 0}}catch(e){if("child"===t.target.kind)throw e;return{updates:void 0,error:e instanceof Error?e.message:String(e)}}})(e,t,i,n);return void 0===o?d([{type:"uncaught",entityId:null,message:s}]):l(o,i,n)})(e,t,i,n):null}})(n,e,t,i))}})(i,a,u)]:[]});return{...Object.fromEntries(e(u.manifest,a.entity.type).map(e=>[e.edgeName,()=>n(e,a.entity.id,a.state,u.recipes)?.map(t=>({...t,dryRun:()=>e.dryRuns?(({field:e},{value:t},r,n)=>{let{entity:o}=r,a=Object.entries(Object.entries(n.manifest.writableFields??{}).find(([e])=>e===o.type)?.[1]??{}).find(([t])=>t===e)?.[1];if(void 0===a)throw Error(`The options of "${e}" on "${o.id}" cannot be dry-run: the schema lists them, but the configurator has no writable field "${e}" on ${o.type}. This is a fault in the configurator, not in your request. Tell the user this is not available.`);let u=r.state.entities.find(e=>e.id===o.id);if(!u)throw Error(`The options of "${e}" on "${o.id}" cannot be dry-run: entity "${o.id}" does not exist. It may have been deleted by an earlier operation or field. Query the current entities and use an id they return.`);let c={[a]:t},p=n.validateEntity({...u,...c});return p.success?l([s.DomainEntityModification({entityId:o.id,stateDelta:c,updateTag:i})],r,n):d([{type:"uncaught",entityId:o.id,message:`Writing ${JSON.stringify(t)} to "${e}" would make "${o.id}" an invalid ${o.type}: ${p.errors.join("; ")}. The option comes from the configurator and cannot be corrected from here, so do not write it.`}])})(e,t,a,u):null}))??null])),childRecipes:c("child"),replaceRecipes:c("replace"),screenshot:({view:e})=>u.takeScreenshot(a,e)}};
@@ -1,15 +1,29 @@
1
1
  import { type ExecutionResult } from 'graphql';
2
2
  import { type Localizable } from '@salsita-ai/common/utils';
3
- import { type $DomainEntity, type DomainContextSelectors, type DomainEntity, type DomainServicesSelectors, type DomainState, type SessionAssistantSetup, type SpecSelectors, type StateUpdateEmission } from '#package/domain';
3
+ import { type $DomainEntity, type AgentScreenshotComponent, type ComponentSnapshot, type DomainContextSelectors, type DomainEntity, type DomainServicesSelectors, type DomainState, type InitializationGeneration, type SessionAssistantSetup, type SpecSelectors, type StateUpdateEmission } from '#package/domain';
4
4
  /** One single-operation GraphQL document with its own variables, as executed by {@link GraphQLSystem}. */
5
5
  export interface GraphQLOperation {
6
6
  readonly document: string;
7
7
  readonly variables?: Readonly<Record<string, unknown>>;
8
8
  readonly operationName?: string;
9
9
  }
10
+ /** A screenshot an operation took, under the label its `image` field returned. */
11
+ export interface GraphQLScreenshot {
12
+ readonly entityId: string;
13
+ readonly view: string;
14
+ /** The picture as base64 data. */
15
+ readonly data: string;
16
+ readonly mimeType: 'image/jpeg' | 'image/png';
17
+ }
10
18
  export interface GraphQLSystemContext {
11
19
  /** The assistant the initialized session runs: the operations are validated and executed against its schema. */
12
20
  readonly getAssistantSetup: () => SessionAssistantSetup;
21
+ /**
22
+ * Renders the picture an `agentScreenshot` component of a state declares, behind every export
23
+ * already queued; `null` from an executor that renders no pictures. The only async step of an
24
+ * execution, and the only one that needs a canvas.
25
+ */
26
+ readonly renderScreenshot: (component: ComponentSnapshot<AgentScreenshotComponent>, state: AnyDomainState) => Promise<Blob | null>;
13
27
  readonly specSelectors: SpecSelectors;
14
28
  readonly domainContextSelectors: DomainContextSelectors;
15
29
  readonly domainServicesSelectors: DomainServicesSelectors;
@@ -25,6 +39,8 @@ type AnyStateUpdateEmission = StateUpdateEmission<DomainEntity<string>, Record<s
25
39
  export interface PreparedOperation {
26
40
  readonly result: ExecutionResult;
27
41
  readonly emissions: readonly AnyStateUpdateEmission[];
42
+ /** The screenshots the operation took, by label, in the order they were taken. */
43
+ readonly screenshots: ReadonlyMap<string, GraphQLScreenshot>;
28
44
  }
29
45
  /**
30
46
  * What {@link GraphQLSystem.execute} returns: the results of the operations as prepared from the
@@ -45,6 +61,8 @@ export interface GraphQLExecution {
45
61
  * the undo history by it. It stays in the browser: nothing that leaves it may carry the state.
46
62
  */
47
63
  readonly preparedState?: AnyDomainState;
64
+ /** The screenshots the operations took, by the label their `image` field returned, in the order they were taken. */
65
+ readonly screenshots: ReadonlyMap<string, GraphQLScreenshot>;
48
66
  }
49
67
  /**
50
68
  * Resolves a localizable value, or each item of a list of them, to a string in the current locale.
@@ -77,6 +95,17 @@ export declare class GraphQLSystem {
77
95
  /** Root field resolvers, called by the executor with the field arguments and the operation context. */
78
96
  private readonly _rootValue;
79
97
  private readonly _resolveType;
98
+ private _generation;
99
+ /**
100
+ * The picture of an entity of a state from one `agentScreenshot` view, as base64 of the view's
101
+ * file format; `null` when the view is not attached to the entity there or nothing renders it.
102
+ */
103
+ private readonly _renderScreenshot;
104
+ /**
105
+ * Starts a new generation for a new configuration load. Screenshots wait on renders that take
106
+ * seconds, so an execution can outlive its configuration: one started under the ended generation
107
+ * renders no more screenshots and commits nothing, not even on a conflict retry.
108
+ */
80
109
  initialize: () => void;
81
110
  /**
82
111
  * Runs one mutation field against the working state: its implementation computes updates from the
@@ -87,6 +116,13 @@ export declare class GraphQLSystem {
87
116
  */
88
117
  private readonly _resolveMutation;
89
118
  private readonly _runMutation;
119
+ /**
120
+ * Takes a screenshot once every one asked for before it in the execution has been taken, so they
121
+ * render and spend the budget in document order. A failure nulls only its own field and fails
122
+ * nothing else: the user kept changing the configuration, the image did not fit the budget, or
123
+ * rendering failed. Once the budget is spent, no later screenshot renders.
124
+ */
125
+ private readonly _takeScreenshot;
90
126
  private readonly _setup;
91
127
  /**
92
128
  * Parses, validates and executes one operation document. Validation adds the rule against
@@ -98,21 +134,26 @@ export declare class GraphQLSystem {
98
134
  * Runs the operations in order through one working state that starts at `originalState`: a query
99
135
  * reads the current working state, and each mutation field advances it with its own emission.
100
136
  * The closing braces an operation's document left off are added, then the lenses it spreads are injected into it. Nothing is committed. The first operation that fails stops the list; every later one gets a
101
- * "not run" error instead.
137
+ * "not run" error instead. Screenshots render only while `generation`, the current one by
138
+ * default, is active.
102
139
  */
103
- prepare: (originalState: AnyDomainState, operations: readonly GraphQLOperation[]) => Promise<readonly PreparedOperation[]>;
140
+ prepare: (originalState: AnyDomainState, operations: readonly GraphQLOperation[], generation?: InitializationGeneration) => Promise<readonly PreparedOperation[]>;
104
141
  /**
105
142
  * The side effects of prepared operations: the hints of every update of their emissions, as the
106
143
  * agent is told them, in applied order.
107
144
  */
108
145
  readSideEffects: (prepared: readonly PreparedOperation[]) => readonly string[];
146
+ /** The screenshots of prepared operations, by label, in the order they were taken. */
147
+ readScreenshots: (prepared: readonly PreparedOperation[]) => ReadonlyMap<string, GraphQLScreenshot>;
109
148
  private readonly _prepareAndCommit;
110
149
  /**
111
150
  * Prepares the operations from the committed state and commits their changes as one emission,
112
151
  * synthesized from every field emission of the list: one undo step, `onBeforeCommit` hooks run once. Nothing is committed when an operation fails or
113
152
  * none changes anything. When the committed state changed meanwhile, the operations are prepared
114
153
  * once more from the new committed state; their earlier updates are never replayed, since they
115
- * were computed from a state that is gone.
154
+ * were computed from a state that is gone. When another configuration was loaded meanwhile,
155
+ * nothing is committed or prepared again: the operations were written for the configuration
156
+ * that was left.
116
157
  */
117
158
  execute: (operations: readonly GraphQLOperation[]) => Promise<GraphQLExecution>;
118
159
  }
@@ -1 +1 @@
1
- import{GraphQLError as e,NoSchemaIntrospectionCustomRule as t,defaultFieldResolver as i,execute as o,getNamedType as n,parse as r,specifiedRules as a,validate as s,validateSchema as l}from"graphql";import{assertExistence as c,createSelector as d,isMessageDescriptor as h,isMultilingualString as u}from"@salsita-ai/common/utils";import{DomainEntityIdSchema as m,createAssistantExecutionSchema as f,findAssistantMutation as p}from"#package/domain";import{closeUnclosedBraces as g}from"./close-unclosed-braces.js";import{createEntityMeta as y}from"./entity-meta.js";import{injectAssistantLenses as v}from"./inject-assistant-lenses.js";import{readSideEffects as S}from"./side-effects.js";let _={errors:[new e("The configurator does not provide this request. This is a fault in the configurator, not in your request. Tell the user this is not available.")]},x={errors:[new e("The configuration is not loaded yet, so there is no state to query. Run the query again once the configurator has finished loading.")]},w=new RegExp(m.pattern),E=[...a,t],$=e=>"object"==typeof e&&null!==e&&"type"in e&&"string"==typeof e.type&&"id"in e&&"string"==typeof e.id,b=(e,t)=>"object"==typeof e&&null!==e?Reflect.get(e,t):void 0,T=e=>e instanceof Error?e.message:String(e),C=e=>/[.!?]$/.test(e)?e:`${e}.`,R=e=>"object"==typeof e&&null!==e&&Object.getPrototypeOf(e)===Object.prototype,j=(e,t)=>{let i=R(e)?e._raw:void 0;if($(i))return i;if(!Array.isArray(e)&&!R(e))return e;if(t.has(e))throw Error("The value contains itself.");let o=new Set([...t,e]);return Array.isArray(e)?e.map(e=>j(e,o)):Object.fromEntries(Object.entries(e).map(([e,t])=>[e,j(t,o)]))};export const localize=(e,t)=>Array.isArray(e)?e.map(e=>localize(e,t)):"string"==typeof e||h(e)||u(e)?t(e):e;let A=t=>new e(`The configurator cannot handle this request: ${C(t)} This is a fault in the configurator, not in your request. Tell the user this is not available.`),M=e=>(e.errors?.length??0)>0,z=t=>({errors:[new e(`Not run: operation ${t+1} failed, so the operations after it were skipped and no change of the list takes effect. Fix the failing operation and send the whole list again.`)]});export class GraphQLSystem{_context;_selectSchema=d([d.leaf(e=>e)],e=>{try{let t=f(e),i=l(t);return i.length>0?A(i.map(e=>e.message).join(" ")):t}catch(e){return A(T(e))}});_selectLenses=d([d.leaf(e=>e)],e=>r(e));_selectFieldResolver=d([d.leaf(e=>e)],t=>(o,r,a,s)=>{if(s.parentType===s.schema.getQueryType())return i(o,r,a,s);if(s.parentType===s.schema.getMutationType())return this._resolveMutation(s.fieldName,String(s.path.key),r,a);if(!$(o))return i(o,r,a,s);if("meta"===s.fieldName){let e;return y({entity:o,state:("object"==typeof(e=b(o,"_state"))&&null!==e&&"entities"in e&&"rootEntityId"in e?e:void 0)??a.state},{manifest:a.manifest,recipes:this._recipeContext(),prepareStateEmission:(e,t,i)=>this._context.domainContextSelectors.getStoreSystem().prepareStateEmission(e,t,i),find$Entity:(e,t)=>this._find$Entity(e,t),validateEntity:e=>this._context.domainContextSelectors.getDomain().validateEntity(e)})}let{source:l,localized:c}=t[s.parentType.name]?.[s.fieldName]??{source:s.fieldName},d=((t,i)=>{try{return b(t,i)}catch(o){throw new e(`Expression "${i}" failed on ${$(t)?t.id:"an entity"}: ${C(T(o))} This is a fault in the configurator, not in your request. Tell the user this is not available.`,{originalError:o instanceof Error?o:void 0})}})(o,l);return c?localize(d,this._context.domainServicesSelectors.getResolveLocalizable()):l.startsWith("$")&&"JSON"===n(s.returnType).name?((t,i,o)=>{try{return j(o,new Set)}catch(o){throw new e(`Expression "${i}" returned a value that is not plain serializable data on ${$(t)?t.id:"an entity"}: ${C(T(o))} This is a fault in the configurator, not in your request. Tell the user this is not available.`,{originalError:o instanceof Error?o:void 0})}})(o,l,d):d});constructor(e){this._context=e}_get$Entity=(e,t)=>this._context.domainContextSelectors.getDomain().get$Entity(e,t);_find$Entity=(e,t)=>this._context.domainContextSelectors.getDomain().getEntity(e,t)?this._get$Entity(e,t):null;_recipeContext=()=>({componentReader:this._context.domainContextSelectors.getComponentReader(),recipeCooker:this._context.domainContextSelectors.getRecipeCookerSystem(),resolveLocalizable:this._context.domainServicesSelectors.getResolveLocalizable()});_rootValue={root:(e,{state:t})=>this._get$Entity(t.rootEntityId,t),entities:({ids:t},{state:i})=>{if(null==t)return i.entities.map(e=>this._get$Entity(e.id,i));var o=i.rootEntityId;let n=t.filter(e=>!w.test(e));if(n.length>0)throw new e(`${n.map(e=>`"${e}"`).join(", ")} ${1===n.length?"is not an entity id":"are not entity ids"}. Entity ids have the form "<Type>-<number>", e.g. "${o}". Use ids as returned by the "id" field.`);return t.map(e=>w.test(e)?this._find$Entity(e,i):null)},selectedEntity:(e,{state:t})=>this._find$Entity(this._context.domainContextSelectors.getNavigationSystem().getActiveSelectionState(t),t),navigation:(e,{state:t})=>{let i=this._context.domainContextSelectors.getNavigationSystem();return{navigationState:i.getActiveNavigationState(t),viewState:i.getActiveViewState(t),toolState:i.getActiveToolState(t)}}};_resolveType=e=>$(e)?e.type:void 0;initialize=()=>{};_resolveMutation=(t,i,o,n)=>{if(void 0!==n.failedMutationField)throw new e(`Not run: the earlier field "${n.failedMutationField}" of this operation failed, so "${i}" was skipped and no change of the operation takes effect. Fix the failing field and send the operation again.`);try{return this._runMutation(t,o,n)}catch(e){throw n.failedMutationField=i,e}};_runMutation=(t,i,o)=>{let n=p(t,o.manifest);if(!n)throw new e(`The schema declares the mutation "${t}", but the configurator has no implementation for it. This is a fault in the configurator, not in your request. Tell the user this is not available.`);let r=o.state,a=n.implementation(i,r,{manifest:o.manifest,action:this._context.domainContextSelectors.getActionSystem().createContext(r),resolveLocalizable:this._context.domainServicesSelectors.getResolveLocalizable()});if(a.updates.length>0){let i=this._context.domainContextSelectors.getStoreSystem().prepareStateEmission(a.updates,r,"committed");if(!i.validity.valid)throw new e(`The changes of "${t}" were not applied, because the resulting configuration is invalid: ${(e=>{if("uncaught"===e.severity)return`validating it threw: ${C(T(e.error))}`;let t=[...new Set(e.entityViolations.filter(({violation:t})=>t.severity===e.severity).map(({entityId:e})=>e))];return`it has ${e.severity} violations on ${t.join(", ")}.`})(i.validity)} Change the request so the configuration stays valid.`);o.emissions.push(i),o.state=i.state}return a.readResult({previousState:r,state:o.state})};_setup=()=>{let{manifest:t,error:i}=this._context.getAssistantSetup();if(i)return{ready:!1,result:{errors:[new e(i.message,{originalError:i})]}};if(!t)return{ready:!1,result:_};let o=this._selectSchema(t.sdl);return o instanceof e?{ready:!1,result:{errors:[o]}}:{ready:!0,assistant:t,schema:o,lenses:t.lenses?.definitions?this._selectLenses(t.lenses.definitions):void 0,fieldResolver:this._selectFieldResolver(t.fields)}};_run=(t,i,n,a)=>{let l;try{l=r(t)}catch(t){return{errors:[t instanceof e?t:new e(T(t))]}}let c=s(n.schema,l,E);return c.length>0?{errors:c}:o({schema:n.schema,document:l,rootValue:this._rootValue,contextValue:a,variableValues:i.variables,operationName:i.operationName,fieldResolver:n.fieldResolver,typeResolver:this._resolveType})};prepare=async(t,i)=>{let o,n=this._setup();if(!n.ready)return i.map(()=>({result:n.result,emissions:[]}));let r={manifest:n.assistant,state:t,emissions:[],failedMutationField:void 0},a=[];for(let[t,s]of i.entries())if(void 0===o){let i=r.emissions.length;r.failedMutationField=void 0;let l=g(s.document),c=n.lenses?v(l,n.lenses):l,d=c instanceof e?{errors:[c]}:await this._run(c,s,n,r);a.push({result:d,emissions:r.emissions.slice(i)}),M(d)&&(o=t)}else a.push({result:z(o),emissions:[]});return a};readSideEffects=e=>{let t=this._context.domainServicesSelectors.getResolveLocalizable();return e.flatMap(({emissions:e})=>e.flatMap(e=>S(e.updates,t)))};_prepareAndCommit=async e=>{let t,i,o,n=this._context.domainContextSelectors.getStoreSystem(),r=await this.prepare(n.stateSlices.committed.value.state,e),a=r.map(({result:e})=>e),s=this.readSideEffects(r),l=r.flatMap(e=>e.emissions);if(a.some(M)||0===l.length)return{results:a,sideEffects:s,outcome:"none"};let d=(t=c(l[0]),i=c(l[l.length-1]),o=l.some(e=>void 0!==e.transformationLog),{kind:"committed",previousState:t.previousState,state:i.state,updates:l.flatMap(e=>e.updates),validity:i.validity,transformationLog:o?l.flatMap(e=>e.transformationLog??[]):void 0});return{results:a,sideEffects:s,outcome:n.commitPrepared(d),preparedState:d.state}};execute=async e=>{if(!this._context.domainContextSelectors.getStoreSystem().isInitialized)return{results:e.map(()=>x),committed:!1,sideEffects:[]};let t=await this._prepareAndCommit(e),{results:i,sideEffects:o,outcome:n,preparedState:r}="conflict"===t.outcome?await this._prepareAndCommit(e):t;return"committed"===n?{results:i,committed:!0,sideEffects:o,preparedState:r}:"held"===n?{results:i,committed:!1,message:"The changes wait for the user's approval and are not applied yet. Do not send them again; the next `[changes]` block lists them once approved.",sideEffects:o,preparedState:r}:"conflict"===n?{results:i,committed:!1,message:"The changes were not committed, because the configuration changed while they were being applied. The results describe a state that was discarded. Query the current configuration and send the operations again if they still make sense.",sideEffects:o}:{results:i,committed:!1,sideEffects:o}}}
1
+ import{GraphQLError as e,NoSchemaIntrospectionCustomRule as t,defaultFieldResolver as i,execute as n,getNamedType as r,parse as o,specifiedRules as s,validate as a,validateSchema as l}from"graphql";import{assertExistence as c,createSelector as h,isMessageDescriptor as d,isMultilingualString as u}from"@salsita-ai/common/utils";import{DomainEntityIdSchema as f,agentScreenshotComponent as m,createAssistantExecutionSchema as p,findAssistantMutation as g}from"#package/domain";import{ExportBusyError as y}from"../export-system/export-busy-error.js";import{closeUnclosedBraces as v}from"./close-unclosed-braces.js";import{createEntityMeta as S}from"./entity-meta.js";import{injectAssistantLenses as w}from"./inject-assistant-lenses.js";import{readSideEffects as _}from"./side-effects.js";let x={errors:[new e("The configurator does not provide this request. This is a fault in the configurator, not in your request. Tell the user this is not available.")]},$={errors:[new e("The configuration is not loaded yet, so there is no state to query. Run the query again once the configurator has finished loading.")]},b="Not taken: another configuration was loaded while this request ran. Query the current configuration before asking for screenshots again.",E="Not taken: the screenshots of this tool call have used up its image size budget. Ask for this screenshot in another call, and for fewer in one call.",T=async e=>{let t=new Uint8Array(await e.arrayBuffer()),i="";for(let e=0;e<t.length;e+=32768)i+=String.fromCharCode(...t.subarray(e,e+32768));return btoa(i)},C=new RegExp(f.pattern),M=[...s,t],k=e=>"object"==typeof e&&null!==e&&"type"in e&&"string"==typeof e.type&&"id"in e&&"string"==typeof e.id,j=(e,t)=>"object"==typeof e&&null!==e?Reflect.get(e,t):void 0,R=e=>e instanceof Error?e.message:String(e),A=e=>/[.!?]$/.test(e)?e:`${e}.`,N=e=>"object"==typeof e&&null!==e&&Object.getPrototypeOf(e)===Object.prototype,z=(e,t)=>{let i=N(e)?e._raw:void 0;if(k(i))return i;if(!Array.isArray(e)&&!N(e))return e;if(t.has(e))throw Error("The value contains itself.");let n=new Set([...t,e]);return Array.isArray(e)?e.map(e=>z(e,n)):Object.fromEntries(Object.entries(e).map(([e,t])=>[e,z(t,n)]))};export const localize=(e,t)=>Array.isArray(e)?e.map(e=>localize(e,t)):"string"==typeof e||d(e)||u(e)?t(e):e;let q=t=>new e(`The configurator cannot handle this request: ${A(t)} This is a fault in the configurator, not in your request. Tell the user this is not available.`),L="SCREENSHOT_NOT_TAKEN",F=(t,i)=>new e(t,{originalError:i,extensions:{code:L}}),O=e=>(e.errors??[]).some(e=>e.extensions.code!==L),V=t=>({errors:[new e(`Not run: operation ${t+1} failed, so the operations after it were skipped and no change of the list takes effect. Fix the failing operation and send the whole list again.`)]});export class GraphQLSystem{_context;_selectSchema=h([h.leaf(e=>e)],e=>{try{let t=p(e),i=l(t);return i.length>0?q(i.map(e=>e.message).join(" ")):t}catch(e){return q(R(e))}});_selectLenses=h([h.leaf(e=>e)],e=>o(e));_selectFieldResolver=h([h.leaf(e=>e)],t=>(n,o,s,a)=>{if(a.parentType===a.schema.getQueryType())return i(n,o,s,a);if(a.parentType===a.schema.getMutationType())return this._resolveMutation(a.fieldName,String(a.path.key),o,s);if(!k(n))return i(n,o,s,a);if("meta"===a.fieldName){let e;return S({entity:n,state:("object"==typeof(e=j(n,"_state"))&&null!==e&&"entities"in e&&"rootEntityId"in e?e:void 0)??s.state},{manifest:s.manifest,recipes:this._recipeContext(),prepareStateEmission:(e,t,i)=>this._context.domainContextSelectors.getStoreSystem().prepareStateEmission(e,t,i),find$Entity:(e,t)=>this._find$Entity(e,t),validateEntity:e=>this._context.domainContextSelectors.getDomain().validateEntity(e),takeScreenshot:(e,t)=>this._takeScreenshot(e,t,s)})}let{source:l,localized:c}=t[a.parentType.name]?.[a.fieldName]??{source:a.fieldName},h=((t,i)=>{try{return j(t,i)}catch(n){throw new e(`Expression "${i}" failed on ${k(t)?t.id:"an entity"}: ${A(R(n))} This is a fault in the configurator, not in your request. Tell the user this is not available.`,{originalError:n instanceof Error?n:void 0})}})(n,l);return c?localize(h,this._context.domainServicesSelectors.getResolveLocalizable()):l.startsWith("$")&&"JSON"===r(a.returnType).name?((t,i,n)=>{try{return z(n,new Set)}catch(n){throw new e(`Expression "${i}" returned a value that is not plain serializable data on ${k(t)?t.id:"an entity"}: ${A(R(n))} This is a fault in the configurator, not in your request. Tell the user this is not available.`,{originalError:n instanceof Error?n:void 0})}})(n,l,h):h});constructor(e){this._context=e}_get$Entity=(e,t)=>this._context.domainContextSelectors.getDomain().get$Entity(e,t);_find$Entity=(e,t)=>this._context.domainContextSelectors.getDomain().getEntity(e,t)?this._get$Entity(e,t):null;_recipeContext=()=>({componentReader:this._context.domainContextSelectors.getComponentReader(),recipeCooker:this._context.domainContextSelectors.getRecipeCookerSystem(),resolveLocalizable:this._context.domainServicesSelectors.getResolveLocalizable()});_rootValue={root:(e,{state:t})=>this._get$Entity(t.rootEntityId,t),entities:({ids:t},{state:i})=>{if(null==t)return i.entities.map(e=>this._get$Entity(e.id,i));var n=i.rootEntityId;let r=t.filter(e=>!C.test(e));if(r.length>0)throw new e(`${r.map(e=>`"${e}"`).join(", ")} ${1===r.length?"is not an entity id":"are not entity ids"}. Entity ids have the form "<Type>-<number>", e.g. "${n}". Use ids as returned by the "id" field.`);return t.map(e=>C.test(e)?this._find$Entity(e,i):null)},selectedEntity:(e,{state:t})=>this._find$Entity(this._context.domainContextSelectors.getNavigationSystem().getActiveSelectionState(t),t),navigation:(e,{state:t})=>{let i=this._context.domainContextSelectors.getNavigationSystem();return{navigationState:i.getActiveNavigationState(t),viewState:i.getActiveViewState(t),toolState:i.getActiveToolState(t)}}};_resolveType=e=>k(e)?e.type:void 0;_generation={active:!0};_renderScreenshot=async(e,t,i)=>{let n=this._context.domainContextSelectors.getComponentReader().readOneComponent({entityId:e,componentType:m,instanceName:t},i);if(!n)return null;let r=await this._context.renderScreenshot(n,i);return null===r?null:{data:await T(r),mimeType:"JPEG"===n.state.fileFormat?"image/jpeg":"image/png"}};initialize=()=>{this._generation.active=!1,this._generation={active:!0}};_resolveMutation=(t,i,n,r)=>{if(void 0!==r.failedMutationField)throw new e(`Not run: the earlier field "${r.failedMutationField}" of this operation failed, so "${i}" was skipped and no change of the operation takes effect. Fix the failing field and send the operation again.`);try{return this._runMutation(t,n,r)}catch(e){throw r.failedMutationField=i,e}};_runMutation=(t,i,n)=>{let r=g(t,n.manifest);if(!r)throw new e(`The schema declares the mutation "${t}", but the configurator has no implementation for it. This is a fault in the configurator, not in your request. Tell the user this is not available.`);let o=n.state,s=r.implementation(i,o,{manifest:n.manifest,action:this._context.domainContextSelectors.getActionSystem().createContext(o),resolveLocalizable:this._context.domainServicesSelectors.getResolveLocalizable()});if(s.updates.length>0){let i=this._context.domainContextSelectors.getStoreSystem().prepareStateEmission(s.updates,o,"committed");if(!i.validity.valid)throw new e(`The changes of "${t}" were not applied, because the resulting configuration is invalid: ${(e=>{if("uncaught"===e.severity)return`validating it threw: ${A(R(e.error))}`;let t=[...new Set(e.entityViolations.filter(({violation:t})=>t.severity===e.severity).map(({entityId:e})=>e))];return`it has ${e.severity} violations on ${t.join(", ")}.`})(i.validity)} Change the request so the configuration stays valid.`);n.emissions.push(i),n.state=i.state}return s.readResult({previousState:o,state:n.state})};_takeScreenshot=({entity:t,state:i},n,r)=>{let o=r.manifest.screenshots?.[t.type]?.find(e=>e.view===n);if(!o)return Promise.reject(new e(`The schema declares the screenshot view "${n}" on ${t.type}, but the configurator has no view of that name. This is a fault in the configurator, not in your request. Tell the user this is not available.`));let s=r.lastScreenshot.then(async()=>{if(!r.generation.active)throw F(b);if(r.screenshotBudget<=0)throw F(E);let e=await this._renderScreenshot(t.id,o.instanceName,i).catch(e=>{throw F(e instanceof y?"User made concurrent actions that prevented the screenshot from being taken, try again":`The screenshot of ${t.id} from "${n}" could not be taken: ${A(R(e))} Try again; if it fails again, tell the user the screenshot is not available.`,e instanceof Error?e:void 0)});if(!r.generation.active)throw F(b);if(null===e)return null;if(e.data.length>r.screenshotBudget)throw r.screenshotBudget=0,F(E);r.screenshotBudget-=e.data.length;let s=`${t.id}/${n}`,a=[...r.screenshots.values()].filter(e=>e.entityId===t.id&&e.view===n).length,l=0===a?s:`${s}#${a+1}`;return r.screenshots.set(l,{entityId:t.id,view:n,...e}),{image:l}});return r.lastScreenshot=s.catch(()=>void 0),s};_setup=()=>{let{manifest:t,error:i}=this._context.getAssistantSetup();if(i)return{ready:!1,result:{errors:[new e(i.message,{originalError:i})]}};if(!t)return{ready:!1,result:x};let n=this._selectSchema(t.sdl);return n instanceof e?{ready:!1,result:{errors:[n]}}:{ready:!0,assistant:t,schema:n,lenses:t.lenses?.definitions?this._selectLenses(t.lenses.definitions):void 0,fieldResolver:this._selectFieldResolver(t.fields)}};_run=(t,i,r,s)=>{let l;try{l=o(t)}catch(t){return{errors:[t instanceof e?t:new e(R(t))]}}let c=a(r.schema,l,M);return c.length>0?{errors:c}:n({schema:r.schema,document:l,rootValue:this._rootValue,contextValue:s,variableValues:i.variables,operationName:i.operationName,fieldResolver:r.fieldResolver,typeResolver:this._resolveType})};prepare=async(t,i,n=this._generation)=>{let r,o=this._setup();if(!o.ready)return i.map(()=>({result:o.result,emissions:[],screenshots:new Map}));let s={manifest:o.assistant,state:t,emissions:[],failedMutationField:void 0,screenshots:new Map,screenshotBudget:14e5,lastScreenshot:Promise.resolve(),generation:n},a=[];for(let[t,n]of i.entries())if(void 0===r){let i=s.emissions.length,l=s.screenshots.size;s.failedMutationField=void 0;let c=v(n.document),h=o.lenses?w(c,o.lenses):c,d=h instanceof e?{errors:[h]}:await this._run(h,n,o,s);await s.lastScreenshot,a.push({result:d,emissions:s.emissions.slice(i),screenshots:new Map([...s.screenshots].slice(l))}),O(d)&&(r=t)}else a.push({result:V(r),emissions:[],screenshots:new Map});return a};readSideEffects=e=>{let t=this._context.domainServicesSelectors.getResolveLocalizable();return e.flatMap(({emissions:e})=>e.flatMap(e=>_(e.updates,t)))};readScreenshots=e=>new Map(e.flatMap(({screenshots:e})=>[...e]));_prepareAndCommit=async(e,t)=>{let i,n,r,o=this._context.domainContextSelectors.getStoreSystem(),s=await this.prepare(o.stateSlices.committed.value.state,e,t),a=s.map(({result:e})=>e),l=this.readSideEffects(s),h=this.readScreenshots(s),d=s.flatMap(e=>e.emissions);if(!t.active)return{results:a,sideEffects:l,screenshots:h,outcome:"conflict"};if(a.some(O)||0===d.length)return{results:a,sideEffects:l,screenshots:h,outcome:"none"};let u=(i=c(d[0]),n=c(d[d.length-1]),r=d.some(e=>void 0!==e.transformationLog),{kind:"committed",previousState:i.previousState,state:n.state,updates:d.flatMap(e=>e.updates),validity:n.validity,transformationLog:r?d.flatMap(e=>e.transformationLog??[]):void 0});return{results:a,sideEffects:l,screenshots:h,outcome:o.commitPrepared(u),preparedState:u.state}};execute=async e=>{let t=this._generation;if(!this._context.domainContextSelectors.getStoreSystem().isInitialized)return{results:e.map(()=>$),committed:!1,sideEffects:[],screenshots:new Map};let i=await this._prepareAndCommit(e,t),{results:n,sideEffects:r,screenshots:o,outcome:s,preparedState:a}="conflict"===i.outcome&&t.active?await this._prepareAndCommit(e,t):i;return"committed"===s?{results:n,committed:!0,sideEffects:r,screenshots:o,preparedState:a}:"held"===s?{results:n,committed:!1,message:"The changes wait for the user's approval and are not applied yet. Do not send them again; the next `[changes]` block lists them once approved.",sideEffects:r,screenshots:o,preparedState:a}:"conflict"===s?{results:n,committed:!1,message:"The changes were not committed, because the configuration changed while they were being applied. The results describe a state that was discarded. Query the current configuration and send the operations again if they still make sense.",sideEffects:r,screenshots:o}:{results:n,committed:!1,sideEffects:r,screenshots:o}}}
@@ -1,8 +1,9 @@
1
1
  import type { EffectComposer } from 'postprocessing';
2
2
  import { Color, OrthographicCamera, PerspectiveCamera } from 'three';
3
3
  import type { AuthorizedPhoenixApiClient } from '#package/client';
4
- import type { ClientSideImageComponent, ComponentSnapshot, DomainContextSelectors, DomainEntity, DomainServicesSelectors, DomainState, SaveTemplateThumbnailComponent } from '#package/domain';
4
+ import type { AgentScreenshotComponent, ClientSideImageComponent, ComponentSnapshot, DomainContextSelectors, DomainEntity, DomainServicesSelectors, DomainState, SaveTemplateThumbnailComponent } from '#package/domain';
5
5
  import type { ConfiguratorExtensionSelectors } from '../../selectors.js';
6
+ import type { ExportRunOptions } from '../export-system/export-system.js';
6
7
  import type { ImageRenderConfig, ImageRenderer, RenderConfig } from './image-renderer.js';
7
8
  /**
8
9
  * Constructor context of an `ImageRenderingSystem`. Same-layer configurator peers are reached
@@ -20,6 +21,8 @@ export interface ClientSideImageRenderingOptions {
20
21
  /** Opens rendered images in new browser tabs instead of uploading them. */
21
22
  readonly debug?: boolean;
22
23
  }
24
+ /** A component that declares an image the export renders: its state says how, its entity what. */
25
+ type ImageComponentSnapshot = ComponentSnapshot<ClientSideImageComponent> | ComponentSnapshot<SaveTemplateThumbnailComponent> | ComponentSnapshot<AgentScreenshotComponent>;
23
26
  /** ImageRenderingSystem with its entity types erased — how the runtime selectors expose the instance. */
24
27
  export type AnyImageRenderingSystem = ImageRenderingSystem<any>;
25
28
  export declare class ImageRenderingSystem<ENTITIES extends DomainEntity<string>> {
@@ -94,7 +97,7 @@ export declare class ImageRenderingSystem<ENTITIES extends DomainEntity<string>>
94
97
  generateAndUploadDeclaredClientSideImages(state: DomainState<ENTITIES>, finalizationUuid: string, options?: ClientSideImageRenderingOptions): Promise<readonly {
95
98
  name: string;
96
99
  blob: Blob;
97
- imageComponent: ComponentSnapshot<ClientSideImageComponent> | ComponentSnapshot<SaveTemplateThumbnailComponent>;
100
+ imageComponent: ImageComponentSnapshot;
98
101
  }[]>;
99
102
  /**
100
103
  * Generates client side images from declarative clientSideImage components without uploading them.
@@ -102,12 +105,18 @@ export declare class ImageRenderingSystem<ENTITIES extends DomainEntity<string>>
102
105
  generateDeclaredClientSideImages(state: DomainState<ENTITIES>, options?: ClientSideImageRenderingOptions): Promise<readonly {
103
106
  name: string;
104
107
  blob: Blob;
105
- imageComponent: ComponentSnapshot<ClientSideImageComponent> | ComponentSnapshot<SaveTemplateThumbnailComponent>;
108
+ imageComponent: ImageComponentSnapshot;
106
109
  }[]>;
107
- generateImagesFromComponents(imageComponents: ReadonlyArray<ComponentSnapshot<ClientSideImageComponent> | ComponentSnapshot<SaveTemplateThumbnailComponent>>, sourceState: DomainState<ENTITIES>, options?: ClientSideImageRenderingOptions): Promise<ReadonlyArray<{
110
+ /**
111
+ * Renders the image components from the given state in one export run. With `awaitSettledState`,
112
+ * the run waits until the user is not in the middle of a change, as the assistant's screenshots do.
113
+ */
114
+ generateImagesFromComponents(imageComponents: ReadonlyArray<ImageComponentSnapshot>, sourceState: DomainState<ENTITIES>, options?: ClientSideImageRenderingOptions, runOptions?: ExportRunOptions): Promise<ReadonlyArray<{
108
115
  name: string;
109
116
  blob: Blob;
110
- imageComponent: ComponentSnapshot<ClientSideImageComponent> | ComponentSnapshot<SaveTemplateThumbnailComponent>;
117
+ imageComponent: ImageComponentSnapshot;
111
118
  }>>;
119
+ private _generateImagesFromComponents;
112
120
  initialize: () => void;
113
121
  }
122
+ export {};
@@ -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,5 +1,5 @@
1
1
  import { type $DomainEntity, type ConfiguratorBuilder, type CreateCustomPhoenixEntityElement, type CreateCustomPhoenixLayoutElement, type CreateGetThemeHandler, type CreateGetWebComponentOptionsHandler, type CreatePhoenixHandler, type DomainEntity, type IsCreateRecipeUpdate, type IsReplaceRecipeUpdate, type TransformerBuilder, type TransformerFactory, type UpdateFactory, getIdSequence } from '#package/domain';
2
- import { type CreateCollectFrontendDataHandler, type CreateFilterPublishedChunksHandler, type CreateNotAuthenticatedPage, type IsAngleDimensionUpdate, type IsAttributeSelectionUpdate, type IsAttributeSwitchUpdate, type IsDeleteEntityUpdate, type IsDistanceDimensionUpdate, type IsGenericDimensionUpdate, type IsSwatchSelectionUpdate, type IsTextValueUpdate, type UseAccessService, type UseActiveNavigationState, type UseActiveToolState, type UseActiveViewState, type 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 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';
3
3
  import { type CreatePhoenixIconSet } from '#package/ui-sdk';
4
4
  import { type UseConfiguratorExtensions } from '../application-runtime/index.js';
5
5
  import { type CreateConfigurationNotFoundPage } from '../configuration-not-found-page/index.js';
@@ -8,7 +8,7 @@ import { type CreateConfiguratorErrorPage } from '../configurator-error-page/ind
8
8
  import { useCloseAction } from '../integration/index.js';
9
9
  import { type CreateGetTextureProcessingMapHandler } from '../scene/index.js';
10
10
  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';
11
+ import { type UseAssistantPanel, type UseMeasurements, type UseToolbarActions } from '../toolbar-actions/index.js';
12
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
13
  import { type CreatePresetDeviceNotSupported, type CreatePresetPageAction, type CreatePresetUi } from '../ui/preset-layout/PresetUi.js';
14
14
  import { type UseResetCamera } from './use-reset-camera.js';
@@ -193,6 +193,32 @@ export interface ConfiguratorInterface<ENTITIES extends DomainEntity<string>, AL
193
193
  * `ConfiguratorErrorPage`.
194
194
  */
195
195
  createConfiguratorErrorPage: CreateConfiguratorErrorPage;
196
+ /**
197
+ * Creates the in-scene FAB that adds child entities (`sceneEntityAddFab`), replacing the built-in
198
+ * `AddEntityFab` element. It receives the component's settings and reads the recipes it offers
199
+ * with `useGroupedRecipeOptions(entityId, instanceNames, fixableViolations)`.
200
+ */
201
+ createAddEntityFab: CreateAddEntityFab;
202
+ /**
203
+ * Creates the in-scene FAB that deletes an entity (`sceneEntityDeleteFab`), replacing the built-in
204
+ * `DeleteEntityFab` element. It receives `onDelete`, `disabled` and `disabledHint`.
205
+ */
206
+ createDeleteEntityFab: CreateDeleteEntityFab;
207
+ /**
208
+ * Creates the in-scene hotspot that selects an entity (`sceneEntitySelectHotspot`), replacing the
209
+ * built-in `SelectionHotspot` element. It receives `onSelect`.
210
+ */
211
+ createSelectionHotspot: CreateSelectionHotspot;
212
+ /**
213
+ * Creates the in-scene hotspot that goes to a navigation state (`sceneEntityNavigationHotspot`),
214
+ * replacing the built-in `NavigationHotspot` element. It receives `onNavigate`.
215
+ */
216
+ createNavigationHotspot: CreateNavigationHotspot;
217
+ /**
218
+ * Creates the in-scene FAB that switches tools (`toolMenuFab`), replacing the built-in `ToolMenuFab`
219
+ * element. It receives the tool `options` and `onSelectTool`.
220
+ */
221
+ createToolMenuFab: CreateToolMenuFab;
196
222
  /**
197
223
  * Factory for creating transformers for entities.
198
224
  * @deprecated Use {@link #transformerBuilder} instead.
@@ -553,6 +579,11 @@ export interface ConfiguratorInterface<ENTITIES extends DomainEntity<string>, AL
553
579
  * Turn one localizable text of the spec into a string in the current language
554
580
  */
555
581
  useLocalizable: typeof useLocalizable;
582
+ /**
583
+ * The spec's toolbar for a placement as runnable entries, grouped as the spec groups them, for a layout's own
584
+ * toolbar
585
+ */
586
+ useToolbarActions: UseToolbarActions;
556
587
  /**
557
588
  * The unit of dimensions and the dimension indicators, with functions that change them, as the toolbar's
558
589
  * 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{createCollectFrontendDataHandler as f,createFilterPublishedChunksHandler as u,createNotAuthenticatedPage as c,isAngleDimensionUpdate as g,isAttributeSelectionUpdate as l,isAttributeSwitchUpdate as j,isDeleteEntityUpdate as x,isDistanceDimensionUpdate as k,isGenericDimensionUpdate as y,isSwatchSelectionUpdate as I,isTextValueUpdate as A,useAccessService as C,useActiveNavigationState as S,useActiveToolState as w,useActiveViewState as E,useActiveViewports as b,useAnalyticsService as q,useAngleDimension as B,useAttributeSelection as P,useAttributeSwitch as R,useAuthenticatedClient as U,useAuthorizedClient as h,useBackendData as v,useChildEntitySelection as z,useCommittedSlice as D,useCommittedState as F,useComponent as G,useComponents as H,useComposition as J,useConfigurationId as K,useConfiguratorMessages as L,useControlViolations as M,useCookRecipes as N,useCookReplaceRecipes as O,useCookedRecipes as Q,useCookedReplaceRecipes as T,useCreateAuthorizedClient as V,useDeleteEntity as W,useDeletedEntity as X,useDeselect as Y,useDistanceDimension as Z,useDistanceDimensionSelection as $,useDomain as _,useDomainApplication as ee,useDomainApplicationProps as eo,useDomainEntityRenderedState as er,useDomainEntityState as et,useEntityPrice as ei,useEntitySelector as en,useFinalizeAction as es,useFinalizeActions as ea,useFinalizeViolations as em,useFirstComponent as ep,useFirstRenderedComponent as ed,useFirstRootComponent as ef,useFirstRootRenderedComponent as eu,useFrontendData as ec,useGenerateShareLink as eg,useGenericDimension as el,useGroupedRecipeOptions as ej,useHoveredDomainEntityId as ex,useHoveredEntity as ek,useHoveredEntityId as ey,useIntegrationService as eI,useIntegrationState as eA,useIsFullscreenActive as eC,useLoadedData as eS,useLoadingState as ew,useLoadingStateValue as eE,useLocaleSwitch as eb,useLocalizable as eq,useMapViolationHints as eB,useNavigate as eP,usePopNavigate as eR,usePresetEmbeddedState as eU,usePublishedData as eh,usePushNavigate as ev,useRecipeEmbeddedState as ez,useRenderedComponent as eD,useRenderedComponents as eF,useRenderedEntitySelector as eG,useRenderedRootEntitySelector as eH,useRenderedSelector as eJ,useRenderedSelector$ as eK,useRenderedSlice as eL,useRenderedState as eM,useReplaceEntityRecipeOptions as eN,useResolveLocalizable as eO,useRootComponents as eQ,useRootEntityId as eT,useRootEntityPrice as eV,useRootEntityRenderedId as eW,useRootEntityRenderedState as eX,useRootEntitySelector as eY,useRootEntityState as eZ,useRootRenderedComponents as e$,useSelectEntity as e_,useSelectParent as e0,useSelectedDomainEntityId as e1,useSelectedEntity as e2,useSelectedEntityId as e3,useSession as e4,useSessionRole as e5,useSessionService as e6,useSetFullscreen as e7,useSetViewState as e8,useShareLinks as e9,useStateValidity as oe,useStepNavigation as oo,useStoreSelector as or,useStoreSelector$ as ot,useSwatchSelection as oi,useTabNavigation as on,useTextValue as os,useUndoRedo as oa,useUpdateControl as om,useUpdatedControl as op}from"#package/react-sdk";import{createPhoenixIconSet as od}from"#package/ui-sdk";import{useConfigurator as of}from"../application-runtime/index.js";import{createConfigurationNotFoundPage as ou}from"../configuration-not-found-page/index.js";import{createOnApplicationStartProvider as oc,createOnBackendDataReadyProvider as og,createOnConfiguratorReadyProvider as ol,createOnFrontendDataReadyProvider as oj,createOnGoToIndexHandler as ox,createOnPresetLoadedHandler as ok,createOnPublishedDataReadyProvider as oy,createOnRoutingReadyProvider as oI,createOnSessionReadyProvider as oA,useConfiguratorRouting as oC,usePresetSelection as oS,usePreview as ow,usePropertyPageStack as oE,usePropertyPageState as ob}from"../configurator-context/index.js";import{createConfiguratorErrorPage as oq}from"../configurator-error-page/index.js";import{useCloseAction as oB}from"../integration/index.js";import{createGetTextureProcessingMapHandler as oP}from"../scene/index.js";import{useUpdateEntityObjectSelection as oR}from"../scene/scene-entity/drag-and-drop/use-updated-selection.js";import{useAssistantPanel as oU,useMeasurements as oh}from"../toolbar-actions/index.js";import{LayoutSlots as ov,createAppLoader as oz,createCanvasLoader as oD,createLayoutAdminUi as oF,createLayoutCustomOwnerUi as oG,createLayoutCustomReadUi as oH,createLayoutDialog as oJ,createLayoutFooter as oK,createLayoutToolbarDesktop as oL,createLayoutToolbarDesktopFullScreen as oM,createLayoutToolbarReadDesktop as oN,createLayoutToolbarReadDesktopFullScreen as oO,createLayoutUserUi as oQ,createToolbarHelp as oT,useSceneSafeArea as oV}from"../ui/index.js";import{createPresetDeviceNotSupported as oW,createPresetPageAction as oX,createPresetUi as oY}from"../ui/preset-layout/PresetUi.js";import{useResetCamera as oZ}from"./use-reset-camera.js";export const createConfiguratorInterface=o$=>({updates:a(),getIdSequence:m,createGetWebComponentOptionsHandler:t,createGetThemeHandler:r,createPhoenixHandler:i,createCustomPhoenixEntityElement:e,createCustomPhoenixLayoutElement:o,createPhoenixIconSet:od,createGetTextureProcessingMapHandler:oP,createCollectFrontendDataHandler:f,createFilterPublishedChunksHandler:u,createOnGoToIndexHandler:ox,createOnApplicationStartProvider:oc,createOnSessionReadyProvider:oA,createOnPublishedDataReadyProvider:oy,createOnFrontendDataReadyProvider:oj,createOnBackendDataReadyProvider:og,createOnRoutingReadyProvider:oI,createOnConfiguratorReadyProvider:ol,createOnPresetLoadedHandler:ok,createPresetUi:oY,createPresetPageAction:oX,createPresetDeviceNotSupported:oW,createLayoutFooter:oK,createAppLoader:oz,createCanvasLoader:oD,createLayoutDialog:oJ,createLayoutToolbarDesktop:oL,createLayoutToolbarDesktopFullScreen:oM,createLayoutToolbarReadDesktop:oN,createLayoutToolbarReadDesktopFullScreen:oO,createLayoutCustomOwnerUi:oG,createLayoutCustomReadUi:oH,createLayoutAdminUi:oF,createLayoutUserUi:oQ,createToolbarHelp:oT,createNotAuthenticatedPage:c,createConfigurationNotFoundPage:ou,createConfiguratorErrorPage:oq,createTransformer:n,transformerBuilder:s(),useAnalytics:q,useAuthenticatedClient:U,useAuthorizedClient:h,useCreateAuthorizedClient:V,useAccessService:C,useConfigurationId:K,useSession:e4,useSessionRole:e5,useSessionService:e6,useDomain:_,useDomainApplication:ee,useConfigurator:of,useConfiguratorRouting:oC,usePresetSelection:oS,usePublishedData:eh,useFrontendData:ec,useBackendData:v,useDomainApplicationProps:eo,useLoadedData:eS,useIntegrationService:eI,useIntegrationState:eA,usePresetEmbeddedState:eU,useRecipeEmbeddedState:ez,useCommittedSlice:D,useRenderedSlice:eL,useCommittedState:F,useRenderedState:eM,useStoreSelector:or,useRenderedSelector:eJ,useStoreSelector$:ot,useRenderedSelector$:eK,useEntitySelector:en,useRenderedEntitySelector:eG,useRootEntitySelector:eY,useRenderedRootEntitySelector:eH,useStateValidity:oe,useMapViolationHints:eB,useNavigate:eP,usePopNavigate:eR,usePushNavigate:ev,useControlViolations:M,useFinalizeViolations:em,useConfiguratorMessages:L,useFinalizeAction:es,useFinalizeActions:ea,useComponent:G,useRenderedComponent:eD,useComponents:H,useRenderedComponents:eF,useFirstComponent:ep,useFirstRenderedComponent:ed,useRootComponents:eQ,useRootRenderedComponents:e$,useFirstRootComponent:ef,useFirstRootRenderedComponent:eu,useEntityState:et,useEntityRenderedState:er,useRootEntityState:eZ,useRootEntityRenderedState:eX,useRootEntityId:eT,useRootEntityRenderedId:eW,useEntityPrice:ei,useRootEntityPrice:eV,useSelectedEntity:e2,useSelectedEntityId:e3,useSelectedDomainEntityId:e1,useSelectEntity:e_,useDeselect:Y,useSelectParent:e0,useHoveredEntity:ek,useHoveredEntityId:ey,useHoveredDomainEntityId:ex,useActiveNavigationState:S,useActiveViewState:E,useSetViewState:e8,useActiveToolState:w,useIsFullscreenActive:eC,useSetFullscreen:e7,useResetCamera:oZ,useUndoRedo:oa,useTabNavigation:on,useStepNavigation:oo,useSceneSafeArea:oV,useActiveViewports:b,usePreview:ow,useCloseAction:oB,useIsCloningAllowed:ov.useIsCloningAllowed,useResolveLocalizable:eO,useLocalizable:eq,useMeasurements:oh,useLocaleSwitch:eb,useShareLinks:e9,useAssistantPanel:oU,useComposition:J,useUpdateControl:om,useUpdatedControl:op,useCookRecipes:N,useCookedRecipes:Q,useCookReplaceRecipes:O,useCookedReplaceRecipes:T,useDeleteEntity:W,useDeletedEntity:X,useSwatchSelection:oi,useTextValue:os,useAttributeSelection:P,useAttributeSwitch:R,useDistanceDimension:Z,useDistanceDimensionSelection:$,useGenericDimension:el,useAngleDimension:B,useChildEntitySelection:z,useGroupedRecipeOptions:ej,useReplaceEntityRecipeOptions:eN,useUpdateEntityObjectSelection:oR,useGenerateShareLink:eg,useLoadingState:ew,useLoadingStateValue:eE,usePropertyPageStack:oE,usePropertyPageState:ob,isCreateEntityUpdate:p,isReplaceEntityUpdate:d,isDeleteEntityUpdate:x,isAngleDimensionUpdate:g,isDistanceDimensionUpdate:k,isGenericDimensionUpdate:y,isAttributeSelectionUpdate:l,isAttributeSwitchUpdate:j,isTextValueUpdate:A,isSwatchSelectionUpdate:I});
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,useToolbarActions as oH}from"../toolbar-actions/index.js";import{LayoutSlots as oJ,createAppLoader as oK,createCanvasLoader as oL,createLayoutAdminUi as oM,createLayoutCustomOwnerUi as oN,createLayoutCustomReadUi as oO,createLayoutDialog as oQ,createLayoutFooter as oT,createLayoutToolbarDesktop as oV,createLayoutToolbarDesktopFullScreen as oW,createLayoutToolbarReadDesktop as oX,createLayoutToolbarReadDesktopFullScreen as oY,createLayoutUserUi as oZ,createToolbarHelp as o$,useSceneSafeArea as o_}from"../ui/index.js";import{createPresetDeviceNotSupported as o0,createPresetPageAction as o1,createPresetUi as o2}from"../ui/preset-layout/PresetUi.js";import{useResetCamera as o3}from"./use-reset-camera.js";export const createConfiguratorInterface=o4=>({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:o2,createPresetPageAction:o1,createPresetDeviceNotSupported:o0,createLayoutFooter:oT,createAppLoader:oK,createCanvasLoader:oL,createLayoutDialog:oQ,createLayoutToolbarDesktop:oV,createLayoutToolbarDesktopFullScreen:oW,createLayoutToolbarReadDesktop:oX,createLayoutToolbarReadDesktopFullScreen:oY,createLayoutCustomOwnerUi:oN,createLayoutCustomReadUi:oO,createLayoutAdminUi:oM,createLayoutUserUi:oZ,createToolbarHelp:o$,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:o3,useUndoRedo:ou,useTabNavigation:od,useStepNavigation:os,useSceneSafeArea:o_,useActiveViewports:U,usePreview:oP,useCloseAction:ov,useIsCloningAllowed:oJ.useIsCloningAllowed,useResolveLocalizable:eX,useLocalizable:eh,useToolbarActions:oH,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});
@@ -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};
@@ -6,7 +6,8 @@ import { type ElementRegistration } from '#package/domain';
6
6
  * loaded or opened, `NotAuthenticatedPage` the page shown when session authentication fails or an
7
7
  * anonymous visitor who may not create a configuration opens the start page, `PresetUi` the preset
8
8
  * screen, `ConfiguratorErrorPage` the production error page, `AppLoaderContent` what the app loader
9
- * overlay shows, and the others are the built-in controls, toolbar buttons, menu actions and
10
- * sidebar-footer pieces under the spec kinds that YAML names.
9
+ * overlay shows, `AddEntityFab`, `DeleteEntityFab`, `SelectionHotspot`, `NavigationHotspot` and
10
+ * `ToolMenuFab` the in-scene entity controls, and the others are the built-in controls, toolbar
11
+ * buttons, menu actions and sidebar-footer pieces under the spec kinds that YAML names.
11
12
  */
12
13
  export declare const defaultConfiguratorElements: readonly ElementRegistration[];
@@ -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,sidebarFooterElements as j,toolbarElements as l}from"./default-elements/index.js";export const defaultConfiguratorElements=[o(d,p),m(r),t(u),n(s),f(a),o(e,i),...g,...c,...l,...j];
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];
@@ -2,3 +2,4 @@ export { domainControlElements } from './domain-control-elements.js';
2
2
  export { recipePanelElements } from './recipe-panel-elements.js';
3
3
  export { sidebarFooterElements } from './sidebar-footer-elements.js';
4
4
  export { toolbarElements } from './toolbar-elements.js';
5
+ export { BuiltInAddEntityFab, BuiltInDeleteEntityFab, BuiltInNavigationHotspot, BuiltInSelectionHotspot, BuiltInToolMenuFab, sceneControlElements, } from './scene-controls/index.js';
@@ -1 +1 @@
1
- export{domainControlElements}from"./domain-control-elements.js";export{recipePanelElements}from"./recipe-panel-elements.js";export{sidebarFooterElements}from"./sidebar-footer-elements.js";export{toolbarElements}from"./toolbar-elements.js";
1
+ export{domainControlElements}from"./domain-control-elements.js";export{recipePanelElements}from"./recipe-panel-elements.js";export{sidebarFooterElements}from"./sidebar-footer-elements.js";export{toolbarElements}from"./toolbar-elements.js";export{BuiltInAddEntityFab,BuiltInDeleteEntityFab,BuiltInNavigationHotspot,BuiltInSelectionHotspot,BuiltInToolMenuFab,sceneControlElements}from"./scene-controls/index.js";
@@ -0,0 +1,3 @@
1
+ import type { AddEntityFabElementProps } from '#package/react-sdk';
2
+ /** The default of the `AddEntityFab` element: the SDK's add-entity FAB with its recipe menu. */
3
+ export declare const BuiltInAddEntityFab: (props: AddEntityFabElementProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1 @@
1
+ import{jsx as i}from"react/jsx-runtime";import{PhxIcon as e}from"#package/ui-sdk";import{AddEntityFab as t}from"../../../scene/index.js";export const BuiltInAddEntityFab=n=>{let{entityId:o,instanceNames:a,fixableViolations:r,icon:s,label:l,title:m,tooltipVisibility:p,skipMenuWhenOnlyOne:d,hideWhenNone:c}=n;return i(t,{parentEntityId:o,instanceNames:a,fixableViolations:r,icon:s?i(e,{name:s}):void 0,title:m,tooltipVisibility:p,label:l,skipMenuWhenOnlyOne:d,hideWhenNone:c})};
@@ -0,0 +1,3 @@
1
+ import { type DeleteEntityFabElementProps } from '#package/react-sdk';
2
+ /** The default of the `DeleteEntityFab` element: the SDK's delete-entity FAB. */
3
+ export declare const BuiltInDeleteEntityFab: (props: DeleteEntityFabElementProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1 @@
1
+ import{jsx as e}from"react/jsx-runtime";import{LocalizableMessage as i}from"#package/react-sdk";import{PhxIcon as t,DeleteEntityFab as o}from"#package/ui-sdk";import{useSceneControlTooltip as r}from"../../../scene/index.js";export const BuiltInDeleteEntityFab=a=>{let{icon:n,label:l,title:s,tooltipVisibility:d,onDelete:c,disabled:m,disabledHint:p,trace:b}=a,{tooltipOpen:k}=r(d);return e(o,{label:l?e(i,{children:l}):void 0,title:s?e(i,{children:s}):void 0,icon:n?e(t,{name:n}):void 0,disabled:m,disabledMessage:p,tooltipOpen:k,onClick:c,onDebugClick:b})};
@@ -0,0 +1,3 @@
1
+ import type { NavigationHotspotElementProps } from '#package/react-sdk';
2
+ /** The default of the `NavigationHotspot` element: the SDK's hotspot dot. */
3
+ export declare const BuiltInNavigationHotspot: (props: NavigationHotspotElementProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1 @@
1
+ import{jsx as t}from"react/jsx-runtime";import{SceneHotspot as i}from"../../../scene/index.js";export const BuiltInNavigationHotspot=o=>{let{title:e,tooltipVisibility:r,onNavigate:n}=o;return t(i,{onClick:n,title:e,tooltipVisibility:r})};
@@ -0,0 +1,3 @@
1
+ import type { SelectionHotspotElementProps } from '#package/react-sdk';
2
+ /** The default of the `SelectionHotspot` element: the SDK's hotspot dot. */
3
+ export declare const BuiltInSelectionHotspot: (props: SelectionHotspotElementProps) => import("react/jsx-runtime").JSX.Element;