@salsita-ai/sdk 0.50.0-develop.bc08a38ffe → 0.50.0-develop.bd84173265

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 (348) hide show
  1. package/README.md +14 -13
  2. package/dist/application-spec/caching/content-diff.js +1 -1
  3. package/dist/application-spec/core/application-file.d.ts +0 -2
  4. package/dist/application-spec/core/application-file.js +1 -1
  5. package/dist/application-spec/errors/diagnostic-codes.d.ts +4 -0
  6. package/dist/application-spec/errors/diagnostic-codes.js +1 -1
  7. package/dist/application-spec/errors/diagnostic-messages.d.ts +4 -0
  8. package/dist/application-spec/errors/diagnostic-messages.js +1 -1
  9. package/dist/application-spec/generate-application/code/domain-runtime-files.js +1 -1
  10. package/dist/application-spec/generate-application/code/generate-application-code.d.ts +3 -2
  11. package/dist/application-spec/generate-application/code/generate-application-code.js +1 -1
  12. package/dist/application-spec/generate-application/code/project-scaffolding.d.ts +11 -8
  13. package/dist/application-spec/generate-application/code/project-scaffolding.js +2 -2
  14. package/dist/application-spec/generate-application/code/standalone-app-files.d.ts +2 -2
  15. package/dist/application-spec/generate-application/code/standalone-app-files.js +1 -1
  16. package/dist/application-spec/generate-application/code/templates/configurator-config.js +6 -4
  17. package/dist/application-spec/generate-application/code/templates/eslint-config.d.ts +5 -0
  18. package/dist/application-spec/generate-application/code/templates/eslint-config.js +4 -5
  19. package/dist/application-spec/generate-application/code/templates/frontend-config.js +3 -5
  20. package/dist/application-spec/generate-application/code/templates/gitignore.js +0 -3
  21. package/dist/application-spec/generate-application/code/templates/globals.js +3 -4
  22. package/dist/application-spec/generate-application/code/templates/index.d.ts +1 -1
  23. package/dist/application-spec/generate-application/code/templates/index.js +1 -1
  24. package/dist/application-spec/generate-application/code/templates/lingui-rc.d.ts +5 -0
  25. package/dist/application-spec/generate-application/code/templates/lingui-rc.js +4 -4
  26. package/dist/application-spec/generate-application/code/templates/package-json.js +1 -1
  27. package/dist/application-spec/generate-application/code/templates/prettier-config.d.ts +5 -0
  28. package/dist/application-spec/generate-application/code/templates/prettier-config.js +4 -5
  29. package/dist/application-spec/generate-application/code/templates/root-tsconfig.d.ts +6 -0
  30. package/dist/application-spec/generate-application/code/templates/root-tsconfig.js +2 -0
  31. package/dist/application-spec/generate-application/code/templates/skills/phoenix-cli-skill.js +1 -1
  32. package/dist/application-spec/generate-application/code/templates/skills/phoenix-review-skill.js +1 -1
  33. package/dist/application-spec/generate-application/code/templates/skills/sdk-content.d.ts +13 -7
  34. package/dist/application-spec/generate-application/code/templates/skills/sdk-content.js +2 -2
  35. package/dist/application-spec/generate-application/code/templates/tsconfig.d.ts +5 -0
  36. package/dist/application-spec/generate-application/code/templates/tsconfig.js +1 -1
  37. package/dist/application-spec/generate-application/code/templates/webhook-index.d.ts +6 -1
  38. package/dist/application-spec/generate-application/code/templates/webhook-index.js +10 -1
  39. package/dist/application-spec/generate-application/code/templates/webhooks-config.js +2 -3
  40. package/dist/application-spec/generate-application/index.d.ts +2 -0
  41. package/dist/application-spec/generate-application/index.js +1 -1
  42. package/dist/application-spec/generate-application/runtime/admin-runtime/admin-model-runtime.d.ts +4 -3
  43. package/dist/application-spec/generate-application/runtime/admin-runtime/admin-runtime.d.ts +7 -3
  44. package/dist/application-spec/generate-application/runtime/admin-runtime/admin-runtime.js +1 -1
  45. package/dist/application-spec/generate-application/runtime/admin-runtime/states-runtime.d.ts +2 -2
  46. package/dist/application-spec/generate-application/runtime/application-runtime.d.ts +13 -5
  47. package/dist/application-spec/generate-application/runtime/application-runtime.js +1 -1
  48. package/dist/application-spec/generate-application/runtime/configurator-runtime/configurator-model-runtime.d.ts +4 -3
  49. package/dist/application-spec/generate-application/runtime/configurator-runtime/configurator-runtime.d.ts +6 -2
  50. package/dist/application-spec/generate-application/runtime/configurator-runtime/configurator-runtime.js +1 -1
  51. package/dist/application-spec/generate-application/runtime/configurator-runtime/states-runtime.d.ts +2 -2
  52. package/dist/application-spec/generate-application/runtime/factory-data/factory-data-runtime.d.ts +43 -0
  53. package/dist/application-spec/generate-application/runtime/factory-data/factory-data-runtime.js +1 -0
  54. package/dist/application-spec/generate-application/runtime/factory-data/index.d.ts +3 -0
  55. package/dist/application-spec/generate-application/runtime/factory-data/index.js +1 -0
  56. package/dist/application-spec/generate-application/runtime/factory-data/recipe-defaults.d.ts +13 -0
  57. package/dist/application-spec/generate-application/runtime/factory-data/recipe-defaults.js +1 -0
  58. package/dist/application-spec/generate-application/runtime/factory-data/static-violations.d.ts +16 -0
  59. package/dist/application-spec/generate-application/runtime/factory-data/static-violations.js +1 -0
  60. package/dist/application-spec/generate-application/runtime/migrations/index.d.ts +1 -0
  61. package/dist/application-spec/generate-application/runtime/migrations/index.js +1 -0
  62. package/dist/application-spec/generate-application/runtime/migrations/migration-runtime.d.ts +53 -0
  63. package/dist/application-spec/generate-application/runtime/migrations/migration-runtime.js +1 -0
  64. package/dist/application-spec/generate-application/runtime/sections/assistant-runtime.d.ts +2 -2
  65. package/dist/application-spec/generate-application/runtime/sections/data-runtime.d.ts +4 -4
  66. package/dist/application-spec/generate-application/runtime/sections/expression-runtime.d.ts +3 -2
  67. package/dist/application-spec/generate-application/runtime/sections/theme-runtime.d.ts +2 -2
  68. package/dist/application-spec/generate-application/runtime/sections/transformers-runtime.d.ts +3 -3
  69. package/dist/application-spec/generate-application/runtime-spec/decode-runtime-spec.d.ts +9 -0
  70. package/dist/application-spec/generate-application/runtime-spec/decode-runtime-spec.js +1 -0
  71. package/dist/application-spec/generate-application/runtime-spec/encode-runtime-spec.d.ts +8 -0
  72. package/dist/application-spec/generate-application/runtime-spec/encode-runtime-spec.js +1 -0
  73. package/dist/application-spec/generate-application/runtime-spec/encoded-runtime-spec.d.ts +27 -0
  74. package/dist/application-spec/generate-application/runtime-spec/encoded-runtime-spec.js +1 -0
  75. package/dist/application-spec/generate-application/runtime-spec/index.d.ts +4 -0
  76. package/dist/application-spec/generate-application/runtime-spec/index.js +1 -0
  77. package/dist/application-spec/generate-application/runtime-spec/runtime-spec.d.ts +68 -0
  78. package/dist/application-spec/generate-application/runtime-spec/runtime-spec.js +1 -0
  79. package/dist/application-spec/parse-application-files/categorize/categorize-files.d.ts +34 -0
  80. package/dist/application-spec/parse-application-files/categorize/categorize-files.js +1 -1
  81. package/dist/application-spec/parse-application-files/categorize/earlier-generated-editor-configs.d.ts +16 -0
  82. package/dist/application-spec/parse-application-files/categorize/earlier-generated-editor-configs.js +9 -0
  83. package/dist/application-spec/parse-application-files/categorize/earlier-generated-tsconfig.d.ts +9 -0
  84. package/dist/application-spec/parse-application-files/categorize/earlier-generated-tsconfig.js +1 -0
  85. package/dist/application-spec/parse-application-files/raw-spec/parse-yaml-spec-file.js +1 -1
  86. package/dist/application-spec/parse-application-files/spec/application/admin-spec/admin-spec.js +1 -1
  87. package/dist/application-spec/parse-application-files/spec/application/configurator-spec/configurator-spec.js +1 -1
  88. package/dist/application-spec/parse-application-files/spec/common/index.d.ts +1 -0
  89. package/dist/application-spec/parse-application-files/spec/common/index.js +1 -1
  90. package/dist/application-spec/parse-application-files/spec/common/value-type/format-value-type.d.ts +3 -0
  91. package/dist/application-spec/parse-application-files/spec/common/value-type/format-value-type.js +1 -0
  92. package/dist/application-spec/parse-application-files/spec/common/value-type/index.d.ts +5 -0
  93. package/dist/application-spec/parse-application-files/spec/common/value-type/index.js +1 -0
  94. package/dist/application-spec/parse-application-files/spec/common/value-type/intersect-value-types.d.ts +6 -0
  95. package/dist/application-spec/parse-application-files/spec/common/value-type/intersect-value-types.js +1 -0
  96. package/dist/application-spec/parse-application-files/spec/common/value-type/is-assignable-value-type.d.ts +8 -0
  97. package/dist/application-spec/parse-application-files/spec/common/value-type/is-assignable-value-type.js +1 -0
  98. package/dist/application-spec/parse-application-files/spec/common/value-type/value-type-at.d.ts +10 -0
  99. package/dist/application-spec/parse-application-files/spec/common/value-type/value-type-at.js +1 -0
  100. package/dist/application-spec/parse-application-files/spec/common/value-type/value-type.d.ts +98 -0
  101. package/dist/application-spec/parse-application-files/spec/common/value-type/value-type.js +1 -0
  102. package/dist/application-spec/parse-application-files/spec/components/bindings/component-path.d.ts +13 -0
  103. package/dist/application-spec/parse-application-files/spec/components/bindings/component-path.js +1 -0
  104. package/dist/application-spec/parse-application-files/spec/components/bindings/index.d.ts +2 -0
  105. package/dist/application-spec/parse-application-files/spec/components/bindings/index.js +1 -1
  106. package/dist/application-spec/parse-application-files/spec/components/bindings/read-binding-type.d.ts +24 -0
  107. package/dist/application-spec/parse-application-files/spec/components/bindings/read-binding-type.js +1 -0
  108. package/dist/application-spec/parse-application-files/spec/components/component-state-type.d.ts +8 -0
  109. package/dist/application-spec/parse-application-files/spec/components/component-state-type.js +1 -0
  110. package/dist/application-spec/parse-application-files/spec/components/filter-criterion-types.d.ts +13 -0
  111. package/dist/application-spec/parse-application-files/spec/components/filter-criterion-types.js +1 -0
  112. package/dist/application-spec/parse-application-files/spec/components/static-entity-id.d.ts +14 -0
  113. package/dist/application-spec/parse-application-files/spec/components/static-entity-id.js +1 -0
  114. package/dist/application-spec/parse-application-files/spec/components/user-component-entry.d.ts +6 -0
  115. package/dist/application-spec/parse-application-files/spec/components/user-component-entry.js +1 -1
  116. package/dist/application-spec/parse-application-files/spec/components/user-components.d.ts +7 -4
  117. package/dist/application-spec/parse-application-files/spec/components/user-components.js +1 -1
  118. package/dist/application-spec/parse-application-files/spec/expressions/expression-read-types.d.ts +19 -0
  119. package/dist/application-spec/parse-application-files/spec/expressions/expression-read-types.js +1 -0
  120. package/dist/application-spec/parse-application-files/spec/expressions/expression-read.d.ts +13 -0
  121. package/dist/application-spec/parse-application-files/spec/expressions/expression-read.js +1 -0
  122. package/dist/application-spec/parse-application-files/spec/expressions/expressions.d.ts +6 -2
  123. package/dist/application-spec/parse-application-files/spec/expressions/expressions.js +1 -1
  124. package/dist/application-spec/parse-application-files/spec/invariants/invariants.d.ts +2 -2
  125. package/dist/application-spec/parse-application-files/spec/invariants/invariants.js +1 -1
  126. package/dist/application-spec/parse-application-files/spec/model/index.d.ts +1 -0
  127. package/dist/application-spec/parse-application-files/spec/model/index.js +1 -1
  128. package/dist/application-spec/parse-application-files/spec/model/model-type-resolution.d.ts +10 -0
  129. package/dist/application-spec/parse-application-files/spec/model/model-type-resolution.js +1 -0
  130. package/dist/client/phoenix-api.d.ts +367 -0
  131. package/dist/configurator/application-runtime/extensions/systems/assistant-system/assistant-system.d.ts +36 -1
  132. package/dist/configurator/application-runtime/extensions/systems/assistant-system/assistant-system.js +1 -1
  133. package/dist/configurator/application-runtime/extensions/systems/assistant-system/graphql-tools.d.ts +7 -1
  134. package/dist/configurator/application-runtime/extensions/systems/assistant-system/graphql-tools.js +1 -1
  135. package/dist/configurator/application-runtime/extensions/systems/graphql-system/graphql-system.d.ts +6 -0
  136. package/dist/configurator/application-runtime/extensions/systems/graphql-system/graphql-system.js +1 -1
  137. package/dist/configurator/common/configurator-interface.d.ts +16 -1
  138. package/dist/configurator/common/configurator-interface.js +1 -1
  139. package/dist/configurator/common/index.d.ts +2 -0
  140. package/dist/configurator/common/index.js +1 -1
  141. package/dist/configurator/common/use-finalize-action.d.ts +31 -0
  142. package/dist/configurator/common/use-finalize-action.js +1 -0
  143. package/dist/configurator/common/use-reset-camera.d.ts +6 -0
  144. package/dist/configurator/common/use-reset-camera.js +1 -0
  145. package/dist/configurator/pages/DefaultConfiguratorLayout.d.ts +3 -2
  146. package/dist/configurator/pages/LoadedConfiguratorDetailPage.js +1 -1
  147. package/dist/configurator/pages/configurator-layout-name.d.ts +2 -0
  148. package/dist/configurator/pages/configurator-layout-name.js +1 -0
  149. package/dist/configurator/pages/default-configurator-elements.d.ts +8 -0
  150. package/dist/configurator/pages/default-configurator-elements.js +1 -0
  151. package/dist/configurator/pages/default-elements/built-in-entity-element.d.ts +10 -0
  152. package/dist/configurator/pages/default-elements/built-in-entity-element.js +1 -0
  153. package/dist/configurator/pages/default-elements/built-in-layout-element.d.ts +10 -0
  154. package/dist/configurator/pages/default-elements/built-in-layout-element.js +1 -0
  155. package/dist/configurator/pages/default-elements/domain-control-elements.d.ts +6 -0
  156. package/dist/configurator/pages/default-elements/domain-control-elements.js +1 -0
  157. package/dist/configurator/pages/default-elements/index.d.ts +4 -0
  158. package/dist/configurator/pages/default-elements/index.js +1 -0
  159. package/dist/configurator/pages/default-elements/recipe-panel-elements.d.ts +3 -0
  160. package/dist/configurator/pages/default-elements/recipe-panel-elements.js +1 -0
  161. package/dist/configurator/pages/default-elements/sidebar-footer-elements.d.ts +7 -0
  162. package/dist/configurator/pages/default-elements/sidebar-footer-elements.js +1 -0
  163. package/dist/configurator/pages/default-elements/toolbar-elements.d.ts +7 -0
  164. package/dist/configurator/pages/default-elements/toolbar-elements.js +1 -0
  165. package/dist/configurator/pages/index.d.ts +1 -0
  166. package/dist/configurator/pages/index.js +1 -1
  167. package/dist/configurator/ui/assistant/AssistantChips.d.ts +8 -2
  168. package/dist/configurator/ui/assistant/AssistantChips.js +1 -1
  169. package/dist/configurator/ui/assistant/AssistantMarkdown.d.ts +7 -2
  170. package/dist/configurator/ui/assistant/AssistantMarkdown.js +1 -1
  171. package/dist/configurator/ui/assistant/AssistantPanel.js +1 -1
  172. package/dist/configurator/ui/assistant/AssistantThread.js +1 -1
  173. package/dist/configurator/ui/assistant/entity-link/AssistantEntityLink.d.ts +1 -1
  174. package/dist/configurator/ui/assistant/entity-link/AssistantEntityLink.js +1 -1
  175. package/dist/configurator/ui/assistant/entity-link/entity-link-state.d.ts +1 -1
  176. package/dist/configurator/ui/assistant/entity-link/index.d.ts +0 -1
  177. package/dist/configurator/ui/assistant/entity-link/index.js +1 -1
  178. package/dist/configurator/ui/assistant/form/AssistantForm.d.ts +19 -0
  179. package/dist/configurator/ui/assistant/form/AssistantForm.js +1 -0
  180. package/dist/configurator/ui/assistant/form/built-in-form-registry.d.ts +10 -0
  181. package/dist/configurator/ui/assistant/form/built-in-form-registry.js +1 -0
  182. package/dist/configurator/ui/assistant/form/compose-answer.d.ts +11 -0
  183. package/dist/configurator/ui/assistant/form/compose-answer.js +1 -0
  184. package/dist/configurator/ui/assistant/form/describe-build-errors.d.ts +6 -0
  185. package/dist/configurator/ui/assistant/form/describe-build-errors.js +1 -0
  186. package/dist/configurator/ui/assistant/form/form-element-definition.d.ts +14 -0
  187. package/dist/configurator/ui/assistant/form/form-element-definition.js +1 -0
  188. package/dist/configurator/ui/assistant/form/form-model.d.ts +38 -0
  189. package/dist/configurator/ui/assistant/form/form-model.js +1 -0
  190. package/dist/configurator/ui/assistant/form/form-registry.d.ts +31 -0
  191. package/dist/configurator/ui/assistant/form/form-registry.js +8 -0
  192. package/dist/configurator/ui/assistant/form/form-state.d.ts +4 -0
  193. package/dist/configurator/ui/assistant/form/form-state.js +1 -0
  194. package/dist/configurator/ui/assistant/form/index.d.ts +2 -0
  195. package/dist/configurator/ui/assistant/form/index.js +1 -0
  196. package/dist/configurator/ui/assistant/form/parse-form-block.d.ts +9 -0
  197. package/dist/configurator/ui/assistant/form/parse-form-block.js +1 -0
  198. package/dist/configurator/ui/assistant/form/read-form-attributes.d.ts +13 -0
  199. package/dist/configurator/ui/assistant/form/read-form-attributes.js +1 -0
  200. package/dist/configurator/ui/assistant/form-elements/FormGroup.d.ts +3 -0
  201. package/dist/configurator/ui/assistant/form-elements/FormGroup.js +1 -0
  202. package/dist/configurator/ui/assistant/form-elements/FormOptions.d.ts +3 -0
  203. package/dist/configurator/ui/assistant/form-elements/FormOptions.js +1 -0
  204. package/dist/configurator/ui/assistant/form-elements/FormReply.d.ts +3 -0
  205. package/dist/configurator/ui/assistant/form-elements/FormReply.js +1 -0
  206. package/dist/configurator/ui/assistant/form-elements/FormText.d.ts +3 -0
  207. package/dist/configurator/ui/assistant/form-elements/FormText.js +1 -0
  208. package/dist/configurator/ui/assistant/form-elements/form-element-props.d.ts +34 -0
  209. package/dist/configurator/ui/assistant/form-elements/form-element-props.js +1 -0
  210. package/dist/configurator/ui/assistant/form-elements/index.d.ts +5 -0
  211. package/dist/configurator/ui/assistant/form-elements/index.js +1 -0
  212. package/dist/configurator/ui/assistant/reference-link/AssistantReferenceLink.d.ts +16 -0
  213. package/dist/configurator/ui/assistant/reference-link/AssistantReferenceLink.js +1 -0
  214. package/dist/configurator/ui/assistant/reference-link/assistant-link-target.d.ts +34 -0
  215. package/dist/configurator/ui/assistant/reference-link/assistant-link-target.js +1 -0
  216. package/dist/configurator/ui/assistant/reference-link/assistant-reference-details.d.ts +25 -0
  217. package/dist/configurator/ui/assistant/reference-link/assistant-reference-details.js +1 -0
  218. package/dist/configurator/ui/assistant/reference-link/index.d.ts +3 -0
  219. package/dist/configurator/ui/assistant/reference-link/index.js +1 -0
  220. package/dist/configurator/ui/assistant/reference-link/reference-styles.d.ts +12 -0
  221. package/dist/configurator/ui/assistant/reference-link/reference-styles.js +1 -0
  222. package/dist/configurator/ui/assistant/reference-link/use-assistant-reference-details.d.ts +8 -0
  223. package/dist/configurator/ui/assistant/reference-link/use-assistant-reference-details.js +1 -0
  224. package/dist/configurator/ui/assistant/streamed-markdown.d.ts +2 -0
  225. package/dist/configurator/ui/assistant/streamed-markdown.js +2 -2
  226. package/dist/configurator/ui/assistant/thread-items.d.ts +8 -1
  227. package/dist/configurator/ui/assistant/thread-items.js +1 -1
  228. package/dist/docs/controls/select-child-entity/cardselect.mdx +1 -0
  229. package/dist/docs/fabs/basic.mdx +2 -2
  230. package/dist/docs/index.json +1 -1
  231. package/dist/docs/layouts/custom-layout.mdx +1466 -196
  232. package/dist/docs/phoenix/components.mdx +6 -0
  233. package/dist/docs/phoenix/configurator-interface.mdx +66 -13
  234. package/dist/docs/phoenix/deployments.mdx +2 -6
  235. package/dist/docs/phoenix/domain-model.mdx +2 -0
  236. package/dist/docs/phoenix/finalization.mdx +1 -1
  237. package/dist/docs/phoenix/getting-started.mdx +2 -1
  238. package/dist/docs/phoenix/layout-slots.mdx +4 -2
  239. package/dist/docs/phoenix/localization.mdx +8 -6
  240. package/dist/docs/phoenix/migration-guide.mdx +21 -8
  241. package/dist/docs/phoenix/phoenix-cli.mdx +46 -10
  242. package/dist/docs/phoenix/project-structure.mdx +31 -12
  243. package/dist/docs/phoenix/sdk-builder-workflow.mdx +2 -2
  244. package/dist/docs/phoenix/webhooks.mdx +21 -4
  245. package/dist/domain/application/application-config.d.ts +3 -1
  246. package/dist/domain/application/assistant/assistant-form-elements.d.ts +28 -0
  247. package/dist/domain/application/assistant/assistant-form-elements.js +1 -0
  248. package/dist/domain/application/assistant/generate-assistant-prompt.js +1 -1
  249. package/dist/domain/application/assistant/index.d.ts +2 -0
  250. package/dist/domain/application/assistant/index.js +1 -1
  251. package/dist/domain/application/assistant-recipe-groups.d.ts +3 -1
  252. package/dist/domain/application/configurator-builder.d.ts +4 -1
  253. package/dist/domain/application/configurator-builder.js +1 -1
  254. package/dist/domain/core/schema/extended-schema-validator.js +1 -1
  255. package/dist/domain/domain-context/index.d.ts +1 -1
  256. package/dist/domain/domain-context/undo-system.d.ts +28 -1
  257. package/dist/domain/domain-context/undo-system.js +1 -1
  258. package/dist/domain/domain-runtime/spec/initialize.js +1 -1
  259. package/dist/domain/domain-runtime/spec/selectors.js +1 -1
  260. package/dist/domain/domain-runtime/spec/types.d.ts +2 -0
  261. package/dist/domain/system-components/child-entity-selection.js +1 -1
  262. package/dist/domain/system-components/common/scene-entity-control-schema.d.ts +3 -0
  263. package/dist/domain/system-components/common/scene-entity-control-schema.js +1 -1
  264. package/dist/globals/index.d.ts +2 -0
  265. package/dist/i18n/locales/cs/messages.js +1 -1
  266. package/dist/i18n/locales/da/messages.js +1 -1
  267. package/dist/i18n/locales/de/messages.js +1 -1
  268. package/dist/i18n/locales/de-AT/messages.js +1 -1
  269. package/dist/i18n/locales/en/messages.js +1 -1
  270. package/dist/i18n/locales/en-AU/messages.js +1 -1
  271. package/dist/i18n/locales/en-GB/messages.js +1 -1
  272. package/dist/i18n/locales/es/messages.js +1 -1
  273. package/dist/i18n/locales/fr/messages.js +1 -1
  274. package/dist/i18n/locales/hu/messages.js +1 -1
  275. package/dist/i18n/locales/it/messages.js +1 -1
  276. package/dist/i18n/locales/nl/messages.js +1 -1
  277. package/dist/i18n/locales/pl/messages.js +1 -1
  278. package/dist/i18n/locales/pt/messages.js +1 -1
  279. package/dist/i18n/locales/ro/messages.js +1 -1
  280. package/dist/i18n/locales/sk/messages.js +1 -1
  281. package/dist/i18n/locales/tr/messages.js +1 -1
  282. package/dist/legacy/domain-cli/utils/cache.d.ts +1 -1
  283. package/dist/legacy/domain-cli/utils/cache.js +1 -1
  284. package/dist/legacy/domain-spec/__generated/domain-schema.d.ts +79 -80
  285. package/dist/legacy/phoenix-cli/project-gen/generators/file-templates/agents/claude-md.d.ts +1 -1
  286. package/dist/legacy/phoenix-cli/project-gen/generators/file-templates/agents/cursor-rules.d.ts +1 -1
  287. package/dist/legacy/phoenix-cli/project-gen/generators/file-templates/agents/shared-sdk-content.d.ts +1 -1
  288. package/dist/legacy/phoenix-cli/project-gen/generators/file-templates/agents/shared-sdk-content.js +7 -2
  289. package/dist/legacy/phoenix-cli/project-gen/generators/file-templates/frontend-admin.js +18 -16
  290. package/dist/legacy/phoenix-cli/project-gen/generators/file-templates/frontend-configurator.js +14 -12
  291. package/dist/legacy/phoenix-cli/project-gen/generators/file-templates/frontend-embedded-admin.js +13 -11
  292. package/dist/legacy/phoenix-cli/project-gen/generators/file-templates/frontend-embedded-configurator.js +13 -11
  293. package/dist/phoenix/application-spec/application-spec-builder.js +1 -1
  294. package/dist/phoenix/application-spec/generate-application-spec-story.js +2 -2
  295. package/dist/phoenix/application-spec/project-files.js +1 -1
  296. package/dist/phoenix/bin.d.ts +2 -0
  297. package/dist/phoenix/bin.js +2 -0
  298. package/dist/phoenix/check-configs/built-in-eslint-config.d.ts +9 -0
  299. package/dist/phoenix/check-configs/built-in-eslint-config.js +1 -0
  300. package/dist/phoenix/check-configs/eslint-config.d.ts +10 -0
  301. package/dist/phoenix/check-configs/eslint-config.js +1 -0
  302. package/dist/phoenix/check-configs/index.d.ts +8 -0
  303. package/dist/phoenix/check-configs/index.js +1 -0
  304. package/dist/phoenix/check-configs/typescript-project.d.ts +5 -0
  305. package/dist/phoenix/check-configs/typescript-project.js +1 -0
  306. package/dist/phoenix/cli.d.ts +0 -1
  307. package/dist/phoenix/cli.js +1 -2
  308. package/dist/phoenix/commands/check.js +1 -1
  309. package/dist/phoenix/commands/deps/deps.d.ts +52 -0
  310. package/dist/phoenix/commands/deps/deps.js +3 -0
  311. package/dist/phoenix/commands/deps/index.d.ts +1 -0
  312. package/dist/phoenix/commands/deps/index.js +1 -0
  313. package/dist/phoenix/commands/deps/sdk-manifest.d.ts +12 -0
  314. package/dist/phoenix/commands/deps/sdk-manifest.js +1 -0
  315. package/dist/phoenix/commands/dev.js +5 -5
  316. package/dist/phoenix/commands/fix.js +1 -1
  317. package/dist/phoenix/commands/index.d.ts +1 -0
  318. package/dist/phoenix/commands/index.js +1 -1
  319. package/dist/phoenix/commands/prettier.js +1 -1
  320. package/dist/phoenix/services/application-spec-project-watcher.d.ts +2 -0
  321. package/dist/phoenix/services/application-spec-project-watcher.js +3 -3
  322. package/dist/phoenix/services/lingui.d.ts +8 -0
  323. package/dist/phoenix/services/lingui.js +1 -1
  324. package/dist/phoenix/services/swc.js +1 -1
  325. package/dist/phoenix/services/vite-config.js +1 -1
  326. package/dist/phoenix/utils/index.d.ts +2 -1
  327. package/dist/phoenix/utils/index.js +1 -1
  328. package/dist/phoenix/utils/node-version/index.d.ts +1 -0
  329. package/dist/phoenix/utils/node-version/index.js +1 -0
  330. package/dist/phoenix/utils/node-version/supported-node-version.d.ts +12 -0
  331. package/dist/phoenix/utils/node-version/supported-node-version.js +4 -0
  332. package/dist/phoenix/utils/run-command.d.ts +11 -0
  333. package/dist/phoenix/utils/run-command.js +1 -1
  334. package/dist/phoenix/utils/sdk-tool/index.d.ts +1 -0
  335. package/dist/phoenix/utils/sdk-tool/index.js +1 -0
  336. package/dist/phoenix/utils/sdk-tool/resolve-sdk-tool-bin.d.ts +15 -0
  337. package/dist/phoenix/utils/sdk-tool/resolve-sdk-tool-bin.js +1 -0
  338. package/dist/react-sdk/domain-context/index.d.ts +1 -1
  339. package/dist/react-sdk/domain-context/index.js +1 -1
  340. package/dist/react-sdk/domain-context/system-hooks/navigation-hooks.d.ts +5 -0
  341. package/dist/react-sdk/domain-context/system-hooks/navigation-hooks.js +1 -1
  342. package/dist/ui-sdk/theme/types.d.ts +1 -1
  343. package/package.json +46 -35
  344. package/schema/domain-spec.json +86 -8
  345. package/dist/application-spec/generate-application/code/templates/webhook-implementation.d.ts +0 -1
  346. package/dist/application-spec/generate-application/code/templates/webhook-implementation.js +0 -7
  347. package/dist/configurator/ui/assistant/entity-link/entity-link-target.d.ts +0 -5
  348. package/dist/configurator/ui/assistant/entity-link/entity-link-target.js +0 -1
@@ -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 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 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 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 UseSlice, type UseState, type UseStateValidity, type UseSwatchSelection, type UseSynchronizedSelector, type UseSynchronizedSelector$, type UseTextValue, type UseUpdateControl, type UseUpdatedControl, useLoadingStateValue } from '#package/react-sdk';
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 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 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 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 UseSlice, type UseState, type UseStateValidity, type UseSwatchSelection, type UseSynchronizedSelector, type UseSynchronizedSelector$, type UseTextValue, type UseUpdateControl, type UseUpdatedControl, useLoadingStateValue } 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 CreateOnApplicationStartProvider, type CreateOnBackendDataReadyProvider, type CreateOnConfiguratorReadyProvider, type CreateOnFrontendDataReadyProvider, type CreateOnGoToIndexHandler, type CreateOnPresetLoadedHandler, type CreateOnPublishedDataReadyProvider, type CreateOnRoutingReadyProvider, type CreateOnSessionReadyProvider, type UseConfiguratorRouting, type UsePresetSelection, usePropertyPageStack, usePropertyPageState } from '../configurator-context/index.js';
@@ -8,6 +8,8 @@ import type { UseUpdateEntityObjectSelection } from '../scene/scene-entity/drag-
8
8
  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 } from '../ui/index.js';
9
9
  import { useGenerateShareLink } from '../ui/phoenix-layout-elements/share/use-share.js';
10
10
  import { type CreatePresetDeviceNotSupported, type CreatePresetPageAction, type CreatePresetUi } from '../ui/preset-layout/PresetUi.js';
11
+ import { type UseFinalizeAction } from './use-finalize-action.js';
12
+ import { type UseResetCamera } from './use-reset-camera.js';
11
13
  export interface ConfiguratorInterface<ENTITIES extends DomainEntity<string>, ALLOWED_ROOT_ENTITIES extends ENTITIES, $MAP extends Record<ENTITIES['type'], $DomainEntity<ENTITIES>>, PUBLISHED_DATA extends Record<string, unknown>, SESSION_DATA extends Record<string, unknown>, FRONTEND_DATA extends Record<string, unknown>, NAVIGATION_STATES extends string, VIEW_STATES extends string, TOOL_STATES extends string, EXPORT_STATES extends string, FINALIZE_DATA extends Record<string, unknown>, FINALIZE_RESULT extends Record<string, unknown>> {
12
14
  /**
13
15
  * Factory for creating update functions for entities.
@@ -347,6 +349,11 @@ export interface ConfiguratorInterface<ENTITIES extends DomainEntity<string>, AL
347
349
  * text resolved
348
350
  */
349
351
  useConfiguratorMessages: UseConfiguratorMessages<ENTITIES, $MAP>;
352
+ /**
353
+ * Runs the project handler a `finalizeAction` component names, with its pending state, its error and the
354
+ * finalize violations; call it once per component, wrapped in `PhoenixHandlerBoundary`
355
+ */
356
+ useFinalizeAction: UseFinalizeAction;
350
357
  /**
351
358
  * Returns component based on a filter specified
352
359
  */
@@ -464,6 +471,10 @@ export interface ConfiguratorInterface<ENTITIES extends DomainEntity<string>, AL
464
471
  * Get the currently active view state
465
472
  */
466
473
  useActiveViewState: UseActiveViewState<VIEW_STATES>;
474
+ /**
475
+ * Make the given view state the active one
476
+ */
477
+ useSetViewState: UseSetViewState<VIEW_STATES>;
467
478
  /**
468
479
  * Get the currently active tool state
469
480
  */
@@ -476,6 +487,10 @@ export interface ConfiguratorInterface<ENTITIES extends DomainEntity<string>, AL
476
487
  * Turn the fullscreen state on or off. The state is a flag the layout reads with `useIsFullscreenActive`
477
488
  */
478
489
  useSetFullscreen: UseSetFullscreen;
490
+ /**
491
+ * Move the camera back to the framing of the active camera configuration, as the toolbar's reset button does
492
+ */
493
+ useResetCamera: UseResetCamera;
479
494
  /**
480
495
  * Returns composition tree of the domain
481
496
  */
@@ -1 +1 @@
1
- import{createCustomPhoenixEntityElement as e,createCustomPhoenixLayoutElement as t,createGetThemeHandler as r,createGetWebComponentOptionsHandler as o,createPhoenixHandler as i,createTransformer as s,createTransformerBuilder as a,createUpdateFactory as n,getIdSequence as m,isCreateEntityUpdate as p,isReplaceEntityUpdate as u}from"#package/domain";import{createCollectFrontendDataHandler as d,createFilterPublishedChunksHandler as c,createNotAuthenticatedPage as f,isAngleDimensionUpdate as g,isAttributeSelectionUpdate as j,isAttributeSwitchUpdate as l,isDeleteEntityUpdate as x,isDistanceDimensionUpdate as y,isGenericDimensionUpdate as k,isSwatchSelectionUpdate as h,isTextValueUpdate as S,useAccessService as E,useActiveNavigationState as I,useActiveToolState as q,useActiveViewState as A,useAnalyticsService as B,useAngleDimension as C,useAttributeSelection as P,useAttributeSwitch as R,useAuthenticatedClient as U,useAuthorizedClient as b,useBackendData as v,useChildEntitySelection as w,useCommittedSlice as z,useCommittedState as D,useComponent as F,useComponents as G,useComposition as H,useConfigurationId as J,useConfiguratorMessages as K,useControlViolations as L,useCookRecipes as M,useCookReplaceRecipes as N,useCookedRecipes as O,useCookedReplaceRecipes as Q,useCreateAuthorizedClient as T,useDeleteEntity as V,useDeletedEntity as W,useDeselect as X,useDistanceDimension as Y,useDistanceDimensionSelection as Z,useDomain as $,useDomainApplication as _,useDomainApplicationProps as ee,useDomainEntityRenderedState as et,useDomainEntityState as er,useEntityPrice as eo,useEntitySelector as ei,useFinalizeViolations as es,useFirstComponent as ea,useFirstRenderedComponent as en,useFirstRootComponent as em,useFirstRootRenderedComponent as ep,useFrontendData as eu,useGenericDimension as ed,useGroupedRecipeOptions as ec,useHoveredDomainEntityId as ef,useHoveredEntity as eg,useHoveredEntityId as ej,useIntegrationService as el,useIntegrationState as ex,useIsFullscreenActive as ey,useLoadedData as ek,useLoadingState as eh,useLoadingStateValue as eS,useMapViolationHints as eE,useNavigate as eI,usePopNavigate as eq,usePresetEmbeddedState as eA,usePublishedData as eB,usePushNavigate as eC,useRecipeEmbeddedState as eP,useRenderedComponent as eR,useRenderedComponents as eU,useRenderedEntitySelector as eb,useRenderedRootEntitySelector as ev,useRenderedSelector as ew,useRenderedSelector$ as ez,useRenderedSlice as eD,useRenderedState as eF,useReplaceEntityRecipeOptions as eG,useRootComponents as eH,useRootEntityId as eJ,useRootEntityPrice as eK,useRootEntityRenderedId as eL,useRootEntityRenderedState as eM,useRootEntitySelector as eN,useRootEntityState as eO,useRootRenderedComponents as eQ,useSelectEntity as eT,useSelectParent as eV,useSelectedDomainEntityId as eW,useSelectedEntity as eX,useSelectedEntityId as eY,useSession as eZ,useSessionRole as e$,useSessionService as e_,useSetFullscreen as e0,useStateValidity as e1,useStoreSelector as e2,useStoreSelector$ as e3,useSwatchSelection as e4,useTextValue as e5,useUpdateControl as e6,useUpdatedControl as e7}from"#package/react-sdk";import{createPhoenixIconSet as e8}from"#package/ui-sdk";import{useConfigurator as e9}from"../application-runtime/index.js";import{createOnApplicationStartProvider as te,createOnBackendDataReadyProvider as tt,createOnConfiguratorReadyProvider as tr,createOnFrontendDataReadyProvider as to,createOnGoToIndexHandler as ti,createOnPresetLoadedHandler as ts,createOnPublishedDataReadyProvider as ta,createOnRoutingReadyProvider as tn,createOnSessionReadyProvider as tm,useConfiguratorRouting as tp,usePresetSelection as tu,usePropertyPageStack as td,usePropertyPageState as tc}from"../configurator-context/index.js";import{createGetTextureProcessingMapHandler as tf}from"../scene/index.js";import{useUpdateEntityObjectSelection as tg}from"../scene/scene-entity/drag-and-drop/use-updated-selection.js";import{createAppLoader as tj,createCanvasLoader as tl,createLayoutAdminUi as tx,createLayoutCustomOwnerUi as ty,createLayoutCustomReadUi as tk,createLayoutDialog as th,createLayoutFooter as tS,createLayoutToolbarDesktop as tE,createLayoutToolbarDesktopFullScreen as tI,createLayoutToolbarReadDesktop as tq,createLayoutToolbarReadDesktopFullScreen as tA,createLayoutUserUi as tB,createToolbarHelp as tC}from"../ui/index.js";import{useGenerateShareLink as tP}from"../ui/phoenix-layout-elements/share/use-share.js";import{createPresetDeviceNotSupported as tR,createPresetPageAction as tU,createPresetUi as tb}from"../ui/preset-layout/PresetUi.js";export const createConfiguratorInterface=tv=>({updates:n(),getIdSequence:m,createGetWebComponentOptionsHandler:o,createGetThemeHandler:r,createPhoenixHandler:i,createCustomPhoenixEntityElement:e,createCustomPhoenixLayoutElement:t,createPhoenixIconSet:e8,createGetTextureProcessingMapHandler:tf,createCollectFrontendDataHandler:d,createFilterPublishedChunksHandler:c,createOnGoToIndexHandler:ti,createOnApplicationStartProvider:te,createOnSessionReadyProvider:tm,createOnPublishedDataReadyProvider:ta,createOnFrontendDataReadyProvider:to,createOnBackendDataReadyProvider:tt,createOnRoutingReadyProvider:tn,createOnConfiguratorReadyProvider:tr,createOnPresetLoadedHandler:ts,createPresetUi:tb,createPresetPageAction:tU,createPresetDeviceNotSupported:tR,createLayoutFooter:tS,createAppLoader:tj,createCanvasLoader:tl,createLayoutDialog:th,createLayoutToolbarDesktop:tE,createLayoutToolbarDesktopFullScreen:tI,createLayoutToolbarReadDesktop:tq,createLayoutToolbarReadDesktopFullScreen:tA,createLayoutCustomOwnerUi:ty,createLayoutCustomReadUi:tk,createLayoutAdminUi:tx,createLayoutUserUi:tB,createToolbarHelp:tC,createNotAuthenticatedPage:f,createTransformer:s,transformerBuilder:a(),useAnalytics:B,useAuthenticatedClient:U,useAuthorizedClient:b,useCreateAuthorizedClient:T,useAccessService:E,useConfigurationId:J,useSession:eZ,useSessionRole:e$,useSessionService:e_,useDomain:$,useDomainApplication:_,useConfigurator:e9,useConfiguratorRouting:tp,usePresetSelection:tu,usePublishedData:eB,useFrontendData:eu,useBackendData:v,useDomainApplicationProps:ee,useLoadedData:ek,useIntegrationService:el,useIntegrationState:ex,usePresetEmbeddedState:eA,useRecipeEmbeddedState:eP,useCommittedSlice:z,useRenderedSlice:eD,useCommittedState:D,useRenderedState:eF,useStoreSelector:e2,useRenderedSelector:ew,useStoreSelector$:e3,useRenderedSelector$:ez,useEntitySelector:ei,useRenderedEntitySelector:eb,useRootEntitySelector:eN,useRenderedRootEntitySelector:ev,useStateValidity:e1,useMapViolationHints:eE,useNavigate:eI,usePopNavigate:eq,usePushNavigate:eC,useControlViolations:L,useFinalizeViolations:es,useConfiguratorMessages:K,useComponent:F,useRenderedComponent:eR,useComponents:G,useRenderedComponents:eU,useFirstComponent:ea,useFirstRenderedComponent:en,useRootComponents:eH,useRootRenderedComponents:eQ,useFirstRootComponent:em,useFirstRootRenderedComponent:ep,useEntityState:er,useEntityRenderedState:et,useRootEntityState:eO,useRootEntityRenderedState:eM,useRootEntityId:eJ,useRootEntityRenderedId:eL,useEntityPrice:eo,useRootEntityPrice:eK,useSelectedEntity:eX,useSelectedEntityId:eY,useSelectedDomainEntityId:eW,useSelectEntity:eT,useDeselect:X,useSelectParent:eV,useHoveredEntity:eg,useHoveredEntityId:ej,useHoveredDomainEntityId:ef,useActiveNavigationState:I,useActiveViewState:A,useActiveToolState:q,useIsFullscreenActive:ey,useSetFullscreen:e0,useComposition:H,useUpdateControl:e6,useUpdatedControl:e7,useCookRecipes:M,useCookedRecipes:O,useCookReplaceRecipes:N,useCookedReplaceRecipes:Q,useDeleteEntity:V,useDeletedEntity:W,useSwatchSelection:e4,useTextValue:e5,useAttributeSelection:P,useAttributeSwitch:R,useDistanceDimension:Y,useDistanceDimensionSelection:Z,useGenericDimension:ed,useAngleDimension:C,useChildEntitySelection:w,useGroupedRecipeOptions:ec,useReplaceEntityRecipeOptions:eG,useUpdateEntityObjectSelection:tg,useGenerateShareLink:tP,useLoadingState:eh,useLoadingStateValue:eS,usePropertyPageStack:td,usePropertyPageState:tc,isCreateEntityUpdate:p,isReplaceEntityUpdate:u,isDeleteEntityUpdate:x,isAngleDimensionUpdate:g,isDistanceDimensionUpdate:y,isGenericDimensionUpdate:k,isAttributeSelectionUpdate:j,isAttributeSwitchUpdate:l,isTextValueUpdate:S,isSwatchSelectionUpdate:h});
1
+ import{createCustomPhoenixEntityElement as e,createCustomPhoenixLayoutElement as r,createGetThemeHandler as t,createGetWebComponentOptionsHandler as o,createPhoenixHandler as i,createTransformer as s,createTransformerBuilder as a,createUpdateFactory as m,getIdSequence as n,isCreateEntityUpdate as p,isReplaceEntityUpdate as u}from"#package/domain";import{createCollectFrontendDataHandler as c,createFilterPublishedChunksHandler as d,createNotAuthenticatedPage as f,isAngleDimensionUpdate as j,isAttributeSelectionUpdate as l,isAttributeSwitchUpdate as g,isDeleteEntityUpdate as x,isDistanceDimensionUpdate as y,isGenericDimensionUpdate as k,isSwatchSelectionUpdate as h,isTextValueUpdate as S,useAccessService as E,useActiveNavigationState as I,useActiveToolState as q,useActiveViewState as z,useAnalyticsService as A,useAngleDimension as B,useAttributeSelection as C,useAttributeSwitch as P,useAuthenticatedClient as R,useAuthorizedClient as U,useBackendData as b,useChildEntitySelection as v,useCommittedSlice as w,useCommittedState as D,useComponent as F,useComponents as G,useComposition as H,useConfigurationId as J,useConfiguratorMessages as K,useControlViolations as L,useCookRecipes as M,useCookReplaceRecipes as N,useCookedRecipes as O,useCookedReplaceRecipes as Q,useCreateAuthorizedClient as T,useDeleteEntity as V,useDeletedEntity as W,useDeselect as X,useDistanceDimension as Y,useDistanceDimensionSelection as Z,useDomain as $,useDomainApplication as _,useDomainApplicationProps as ee,useDomainEntityRenderedState as er,useDomainEntityState as et,useEntityPrice as eo,useEntitySelector as ei,useFinalizeViolations as es,useFirstComponent as ea,useFirstRenderedComponent as em,useFirstRootComponent as en,useFirstRootRenderedComponent as ep,useFrontendData as eu,useGenericDimension as ec,useGroupedRecipeOptions as ed,useHoveredDomainEntityId as ef,useHoveredEntity as ej,useHoveredEntityId as el,useIntegrationService as eg,useIntegrationState as ex,useIsFullscreenActive as ey,useLoadedData as ek,useLoadingState as eh,useLoadingStateValue as eS,useMapViolationHints as eE,useNavigate as eI,usePopNavigate as eq,usePresetEmbeddedState as ez,usePublishedData as eA,usePushNavigate as eB,useRecipeEmbeddedState as eC,useRenderedComponent as eP,useRenderedComponents as eR,useRenderedEntitySelector as eU,useRenderedRootEntitySelector as eb,useRenderedSelector as ev,useRenderedSelector$ as ew,useRenderedSlice as eD,useRenderedState as eF,useReplaceEntityRecipeOptions as eG,useRootComponents as eH,useRootEntityId as eJ,useRootEntityPrice as eK,useRootEntityRenderedId as eL,useRootEntityRenderedState as eM,useRootEntitySelector as eN,useRootEntityState as eO,useRootRenderedComponents as eQ,useSelectEntity as eT,useSelectParent as eV,useSelectedDomainEntityId as eW,useSelectedEntity as eX,useSelectedEntityId as eY,useSession as eZ,useSessionRole as e$,useSessionService as e_,useSetFullscreen as e0,useSetViewState as e1,useStateValidity as e2,useStoreSelector as e3,useStoreSelector$ as e4,useSwatchSelection as e5,useTextValue as e6,useUpdateControl as e7,useUpdatedControl as e8}from"#package/react-sdk";import{createPhoenixIconSet as e9}from"#package/ui-sdk";import{useConfigurator as re}from"../application-runtime/index.js";import{createOnApplicationStartProvider as rr,createOnBackendDataReadyProvider as rt,createOnConfiguratorReadyProvider as ro,createOnFrontendDataReadyProvider as ri,createOnGoToIndexHandler as rs,createOnPresetLoadedHandler as ra,createOnPublishedDataReadyProvider as rm,createOnRoutingReadyProvider as rn,createOnSessionReadyProvider as rp,useConfiguratorRouting as ru,usePresetSelection as rc,usePropertyPageStack as rd,usePropertyPageState as rf}from"../configurator-context/index.js";import{createGetTextureProcessingMapHandler as rj}from"../scene/index.js";import{useUpdateEntityObjectSelection as rl}from"../scene/scene-entity/drag-and-drop/use-updated-selection.js";import{createAppLoader as rg,createCanvasLoader as rx,createLayoutAdminUi as ry,createLayoutCustomOwnerUi as rk,createLayoutCustomReadUi as rh,createLayoutDialog as rS,createLayoutFooter as rE,createLayoutToolbarDesktop as rI,createLayoutToolbarDesktopFullScreen as rq,createLayoutToolbarReadDesktop as rz,createLayoutToolbarReadDesktopFullScreen as rA,createLayoutUserUi as rB,createToolbarHelp as rC}from"../ui/index.js";import{useGenerateShareLink as rP}from"../ui/phoenix-layout-elements/share/use-share.js";import{createPresetDeviceNotSupported as rR,createPresetPageAction as rU,createPresetUi as rb}from"../ui/preset-layout/PresetUi.js";import{useFinalizeAction as rv}from"./use-finalize-action.js";import{useResetCamera as rw}from"./use-reset-camera.js";export const createConfiguratorInterface=rD=>({updates:m(),getIdSequence:n,createGetWebComponentOptionsHandler:o,createGetThemeHandler:t,createPhoenixHandler:i,createCustomPhoenixEntityElement:e,createCustomPhoenixLayoutElement:r,createPhoenixIconSet:e9,createGetTextureProcessingMapHandler:rj,createCollectFrontendDataHandler:c,createFilterPublishedChunksHandler:d,createOnGoToIndexHandler:rs,createOnApplicationStartProvider:rr,createOnSessionReadyProvider:rp,createOnPublishedDataReadyProvider:rm,createOnFrontendDataReadyProvider:ri,createOnBackendDataReadyProvider:rt,createOnRoutingReadyProvider:rn,createOnConfiguratorReadyProvider:ro,createOnPresetLoadedHandler:ra,createPresetUi:rb,createPresetPageAction:rU,createPresetDeviceNotSupported:rR,createLayoutFooter:rE,createAppLoader:rg,createCanvasLoader:rx,createLayoutDialog:rS,createLayoutToolbarDesktop:rI,createLayoutToolbarDesktopFullScreen:rq,createLayoutToolbarReadDesktop:rz,createLayoutToolbarReadDesktopFullScreen:rA,createLayoutCustomOwnerUi:rk,createLayoutCustomReadUi:rh,createLayoutAdminUi:ry,createLayoutUserUi:rB,createToolbarHelp:rC,createNotAuthenticatedPage:f,createTransformer:s,transformerBuilder:a(),useAnalytics:A,useAuthenticatedClient:R,useAuthorizedClient:U,useCreateAuthorizedClient:T,useAccessService:E,useConfigurationId:J,useSession:eZ,useSessionRole:e$,useSessionService:e_,useDomain:$,useDomainApplication:_,useConfigurator:re,useConfiguratorRouting:ru,usePresetSelection:rc,usePublishedData:eA,useFrontendData:eu,useBackendData:b,useDomainApplicationProps:ee,useLoadedData:ek,useIntegrationService:eg,useIntegrationState:ex,usePresetEmbeddedState:ez,useRecipeEmbeddedState:eC,useCommittedSlice:w,useRenderedSlice:eD,useCommittedState:D,useRenderedState:eF,useStoreSelector:e3,useRenderedSelector:ev,useStoreSelector$:e4,useRenderedSelector$:ew,useEntitySelector:ei,useRenderedEntitySelector:eU,useRootEntitySelector:eN,useRenderedRootEntitySelector:eb,useStateValidity:e2,useMapViolationHints:eE,useNavigate:eI,usePopNavigate:eq,usePushNavigate:eB,useControlViolations:L,useFinalizeViolations:es,useConfiguratorMessages:K,useFinalizeAction:rv,useComponent:F,useRenderedComponent:eP,useComponents:G,useRenderedComponents:eR,useFirstComponent:ea,useFirstRenderedComponent:em,useRootComponents:eH,useRootRenderedComponents:eQ,useFirstRootComponent:en,useFirstRootRenderedComponent:ep,useEntityState:et,useEntityRenderedState:er,useRootEntityState:eO,useRootEntityRenderedState:eM,useRootEntityId:eJ,useRootEntityRenderedId:eL,useEntityPrice:eo,useRootEntityPrice:eK,useSelectedEntity:eX,useSelectedEntityId:eY,useSelectedDomainEntityId:eW,useSelectEntity:eT,useDeselect:X,useSelectParent:eV,useHoveredEntity:ej,useHoveredEntityId:el,useHoveredDomainEntityId:ef,useActiveNavigationState:I,useActiveViewState:z,useSetViewState:e1,useActiveToolState:q,useIsFullscreenActive:ey,useSetFullscreen:e0,useResetCamera:rw,useComposition:H,useUpdateControl:e7,useUpdatedControl:e8,useCookRecipes:M,useCookedRecipes:O,useCookReplaceRecipes:N,useCookedReplaceRecipes:Q,useDeleteEntity:V,useDeletedEntity:W,useSwatchSelection:e5,useTextValue:e6,useAttributeSelection:C,useAttributeSwitch:P,useDistanceDimension:Y,useDistanceDimensionSelection:Z,useGenericDimension:ec,useAngleDimension:B,useChildEntitySelection:v,useGroupedRecipeOptions:ed,useReplaceEntityRecipeOptions:eG,useUpdateEntityObjectSelection:rl,useGenerateShareLink:rP,useLoadingState:eh,useLoadingStateValue:eS,usePropertyPageStack:rd,usePropertyPageState:rf,isCreateEntityUpdate:p,isReplaceEntityUpdate:u,isDeleteEntityUpdate:x,isAngleDimensionUpdate:j,isDistanceDimensionUpdate:y,isGenericDimensionUpdate:k,isAttributeSelectionUpdate:l,isAttributeSwitchUpdate:g,isTextValueUpdate:S,isSwatchSelectionUpdate:h});
@@ -1,2 +1,4 @@
1
1
  export { type ConfiguratorInterface, createConfiguratorInterface } from './configurator-interface.js';
2
2
  export { FrontendAnalyticsFactory } from './frontend-analytics.js';
3
+ export { type UseFinalizeAction, type UseFinalizeActionResult, useFinalizeAction } from './use-finalize-action.js';
4
+ export { type UseResetCamera, useResetCamera } from './use-reset-camera.js';
@@ -1 +1 @@
1
- export{createConfiguratorInterface}from"./configurator-interface.js";export{FrontendAnalyticsFactory}from"./frontend-analytics.js";
1
+ export{createConfiguratorInterface}from"./configurator-interface.js";export{FrontendAnalyticsFactory}from"./frontend-analytics.js";export{useFinalizeAction}from"./use-finalize-action.js";export{useResetCamera}from"./use-reset-camera.js";
@@ -0,0 +1,31 @@
1
+ /**
2
+ * What a project layout needs to show and run one `finalizeAction` of the spec.
3
+ * - `run`: pushes the finalize-button analytics event, then runs the action's handler. Does nothing while
4
+ * `disabled` or `isPending`.
5
+ * - `isPending`: the handler is running.
6
+ * - `error`: what the handler's last run rejected with, `null` after a run that resolved and while a new run is
7
+ * pending. A rejection that is not an `Error` is wrapped in one, with the rejected value as its `cause`. No snackbar
8
+ * is raised; the layout shows it its own way.
9
+ * - `disabled` and `hints`: from `useFinalizeViolations()`; the configuration cannot be finalized while it has
10
+ * a `warning` or worse, or while it is out of sync with the server, and `hints` says why.
11
+ *
12
+ * `isPending` and `error` belong to the mounted component: when it unmounts during a run, the handler keeps
13
+ * running, and a component mounted afterwards starts with `isPending` false and no `error`.
14
+ */
15
+ export interface UseFinalizeActionResult {
16
+ readonly run: () => void;
17
+ readonly isPending: boolean;
18
+ readonly error: Error | null;
19
+ readonly disabled: boolean;
20
+ readonly hints: string | undefined;
21
+ }
22
+ export type UseFinalizeAction = (handler: string) => UseFinalizeActionResult;
23
+ /**
24
+ * Runs the project handler a `finalizeAction` component names, with the state a finalize button shows.
25
+ *
26
+ * It calls `usePhoenixHandler(handler)`, which calls the project's handler factory and the hooks inside it, so:
27
+ * call it once per component, never in a loop or conditionally, render one component per action, and wrap that
28
+ * component in `<PhoenixHandlerBoundary name={handler}>` from `@salsita-ai/sdk/react`, so an edited handler takes
29
+ * effect without a reload. It does not check read mode; a layout hides finalization for a viewer.
30
+ */
31
+ export declare const useFinalizeAction: UseFinalizeAction;
@@ -0,0 +1 @@
1
+ import{useMutation as r}from"@tanstack/react-query";import{useCallback as t,useRef as e}from"react";import{useAnalyticsService as a,useFinalizeViolations as n,useLogger as o,usePhoenixHandler as i}from"#package/react-sdk";import{FrontendAnalyticsFactory as c}from"./frontend-analytics.js";export const useFinalizeAction=l=>{let{handler:s}=i(l),u=a(),f=o(),{disabled:m,hints:d}=n(),h=e(!1),{mutate:p,isPending:y,error:k}=r({mutationFn:async()=>{try{await s()}catch(r){throw r instanceof Error?r:Error(null==r?"The finalize handler failed without a reason.":String(r),{cause:r})}finally{h.current=!1}},onError:r=>{f.error("Failed to finalize",{error:r.message})}});return{run:t(()=>{m||h.current||(h.current=!0,u.push(c.FinalizeButtonClicked()),p())},[u,m,p]),isPending:y,error:k,disabled:m,hints:d}};
@@ -0,0 +1,6 @@
1
+ export type UseResetCamera = () => () => void;
2
+ /**
3
+ * Hook to move the camera back to the framing of the active camera configuration, undoing what the user orbited,
4
+ * panned or zoomed. It does what the built-in toolbar's reset button does
5
+ */
6
+ export declare const useResetCamera: UseResetCamera;
@@ -0,0 +1 @@
1
+ import{useCallback as e}from"react";import{useConfigurator as r}from"../application-runtime/index.js";export const useResetCamera=()=>{let{cameraControlSystem:t}=r();return e(()=>{t.resetCamera()},[t])};
@@ -1,6 +1,7 @@
1
1
  /**
2
2
  * The built-in UI of a loaded configuration: the layout the spec's `layout` selects, in owner or
3
- * read mode. `LoadedConfiguratorDetailPage` renders it when the project registers no layout element
4
- * named `ConfiguratorLayout`.
3
+ * read mode. It is registered as the default `ConfiguratorLayout` in `defaultConfiguratorElements`,
4
+ * so `LoadedConfiguratorDetailPage` renders it unless the project registers a layout element of that
5
+ * name.
5
6
  */
6
7
  export declare const DefaultConfiguratorLayout: () => import("react/jsx-runtime").JSX.Element;
@@ -1 +1 @@
1
- import{jsx as o,jsxs as r}from"react/jsx-runtime";import e from"mui-modal-provider";import{memo as i,useCallback as n,useEffect as t}from"react";import{InvalidAccessKeyError as a}from"#package/client";import{BuiltInLoadingPhase as d,CommonAnalyticsFactory as s,DomainLifecycleBoundary as l,LoadedDataProvider as u,PhoenixLayoutElement as c,useAccessService as f,useAnalyticsService as m,useAuthorizedClient as g,useConfiguratorDomainFactory as p,useConfiguratorLoadStatus as v,useConfiguratorRawLoadedData as I,useExpectPhase as C,useLoadedDataActions as h,useLoadingError as j,useLoadingPhase as k,useLogger as w,useRoutingService as y,useSpecAssistant as b}from"#package/react-sdk";import{useConfigurator as x}from"../application-runtime/index.js";import{IntegrationSubscription as E,OnConfiguratorReadyProvider as L,ViewportStateSync as D}from"../configurator-context/index.js";import{ConfiguratorNotFoundPage as M}from"./ConfiguratorNotFoundPage.js";import{DefaultConfiguratorLayout as F}from"./DefaultConfiguratorLayout.js";import{DevContextFallback as S}from"./error-boundaries/DevContextFallback.js";import{DevLoadingFallback as T}from"./error-boundaries/DevLoadingFallback.js";import{LoadingErrorBoundary as A}from"./error-boundaries/LoadingErrorBoundary.js";import{useLoad as P}from"./use-load.js";let R=i(()=>((()=>{let{assistantSystem:o}=x(),r=null!=b();t(()=>{if(r)return o.activate()},[o,r])})(),o(e,{children:o(L,{children:o(c,{name:"ConfiguratorLayout",defaultSlot:F})})})));export const LoadedConfiguratorDetailPage=()=>{C(d.SceneAssets);let{configurationId:e,accessInfo:i}=f(),t=g(),c=y(),b=w(),x=m(),{startConfiguratorLoad:L,completeConfiguratorLoad:F,failConfiguratorLoad:V,resetConfiguratorLoad:q}=h(),{isLoading:B,isError:G}=v(),N=I(),z=p(),H=n(()=>i.viewMode&&void 0!==i.revisionId?t.getConfigurationRevision(e,i.revisionId):t.getConfiguration(e),[i.revisionId,i.viewMode,t,e]),J=n(()=>{L()},[L]),K=n(o=>{F({initialRevisionId:o.revisionId,initialEntities:o.data,modelVersion:o.modelVersion,rootEntityType:o.rootEntityType,schemaIdentity:z}),x.push(s.ConfigurationLoaded(o.configurationId,o.revisionId,i.viewMode?"read":"owner")),b.appendToGlobalContext({configurationId:o.configurationId,revisionId:o.revisionId,mode:i.viewMode}),b.info("Configuration loaded.")},[i.viewMode,x,F,z,b]),O=n(o=>{if(V(o),o instanceof a)return void c.rejectAccessToken(e,i.raw);let r=o instanceof Error?o:Error("Configuration loading failed with an unknown error.",{cause:o});b.error("Configuration loading failed because the API request did not succeed. Verify the configuration ID and access token.",{configurationId:e},r)},[i.raw,e,V,b,c]),Q=n(()=>{q()},[q]);return(P({key:[t,e,i.revisionId,i.viewMode],load:H,onStart:J,onSuccess:K,onError:O,onCleanup:Q}),k({id:d.DataFetch,label:"Loading configuration…"},B),j(G),G)?o(M,{}):null===N?null:o(u,{value:N,children:o(A,{fallbackRender:r=>o(T,{...r}),children:o(l,{type:"configurator",children:o(A,{FallbackComponent:S,children:r(E,{children:[o(D,{}),o(R,{})]})})})})})};
1
+ import{jsx as o,jsxs as r}from"react/jsx-runtime";import e from"mui-modal-provider";import{memo as i,useCallback as n,useEffect as t}from"react";import{InvalidAccessKeyError as a}from"#package/client";import{BuiltInLoadingPhase as d,CommonAnalyticsFactory as s,DomainLifecycleBoundary as l,LoadedDataProvider as c,PhoenixLayoutElement as u,useAccessService as f,useAnalyticsService as m,useAuthorizedClient as g,useConfiguratorDomainFactory as p,useConfiguratorLoadStatus as v,useConfiguratorRawLoadedData as I,useExpectPhase as h,useLoadedDataActions as j,useLoadingError as C,useLoadingPhase as k,useLogger as w,useRoutingService as b,useSpecAssistant as y}from"#package/react-sdk";import{useConfigurator as x}from"../application-runtime/index.js";import{IntegrationSubscription as E,OnConfiguratorReadyProvider as M,ViewportStateSync as D}from"../configurator-context/index.js";import{ConfiguratorNotFoundPage as F}from"./ConfiguratorNotFoundPage.js";import{ConfiguratorLayoutName as L}from"./configurator-layout-name.js";import{DevContextFallback as T}from"./error-boundaries/DevContextFallback.js";import{DevLoadingFallback as A}from"./error-boundaries/DevLoadingFallback.js";import{LoadingErrorBoundary as P}from"./error-boundaries/LoadingErrorBoundary.js";import{useLoad as R}from"./use-load.js";let S=i(()=>((()=>{let{assistantSystem:o}=x(),r=null!=y();t(()=>{if(r)return o.activate()},[o,r])})(),o(e,{children:o(M,{children:o(u,{name:L})})})));export const LoadedConfiguratorDetailPage=()=>{h(d.SceneAssets);let{configurationId:e,accessInfo:i}=f(),t=g(),u=b(),y=w(),x=m(),{startConfiguratorLoad:M,completeConfiguratorLoad:L,failConfiguratorLoad:V,resetConfiguratorLoad:q}=j(),{isLoading:B,isError:G}=v(),N=I(),z=p(),H=n(()=>i.viewMode&&void 0!==i.revisionId?t.getConfigurationRevision(e,i.revisionId):t.getConfiguration(e),[i.revisionId,i.viewMode,t,e]),J=n(()=>{M()},[M]),K=n(o=>{L({initialRevisionId:o.revisionId,initialEntities:o.data,modelVersion:o.modelVersion,rootEntityType:o.rootEntityType,schemaIdentity:z}),x.push(s.ConfigurationLoaded(o.configurationId,o.revisionId,i.viewMode?"read":"owner")),y.appendToGlobalContext({configurationId:o.configurationId,revisionId:o.revisionId,mode:i.viewMode}),y.info("Configuration loaded.")},[i.viewMode,x,L,z,y]),O=n(o=>{if(V(o),o instanceof a)return void u.rejectAccessToken(e,i.raw);let r=o instanceof Error?o:Error("Configuration loading failed with an unknown error.",{cause:o});y.error("Configuration loading failed because the API request did not succeed. Verify the configuration ID and access token.",{configurationId:e},r)},[i.raw,e,V,y,u]),Q=n(()=>{q()},[q]);return(R({key:[t,e,i.revisionId,i.viewMode],load:H,onStart:J,onSuccess:K,onError:O,onCleanup:Q}),k({id:d.DataFetch,label:"Loading configuration…"},B),C(G),G)?o(F,{}):null===N?null:o(c,{value:N,children:o(P,{fallbackRender:r=>o(A,{...r}),children:o(l,{type:"configurator",children:o(P,{FallbackComponent:T,children:r(E,{children:[o(D,{}),o(S,{})]})})})})})};
@@ -0,0 +1,2 @@
1
+ /** The name a project registers a layout element under to replace the UI of a loaded configuration. */
2
+ export declare const ConfiguratorLayoutName = "ConfiguratorLayout";
@@ -0,0 +1 @@
1
+ export const ConfiguratorLayoutName="ConfiguratorLayout";
@@ -0,0 +1,8 @@
1
+ import { type ElementRegistration } from '#package/domain';
2
+ /**
3
+ * The configurator's default element registrations, passed to `withDefaultElements`. A project
4
+ * element registered under the same name replaces one: `ConfiguratorLayout` is the built-in UI of a
5
+ * loaded configuration, and the others are the built-in controls, toolbar buttons, menu actions and
6
+ * sidebar-footer pieces under the spec kinds that YAML names.
7
+ */
8
+ export declare const defaultConfiguratorElements: readonly ElementRegistration[];
@@ -0,0 +1 @@
1
+ import{createCustomPhoenixLayoutElement as o}from"#package/domain";import{DefaultConfiguratorLayout as t}from"./DefaultConfiguratorLayout.js";import{ConfiguratorLayoutName as r}from"./configurator-layout-name.js";import{domainControlElements as a,recipePanelElements as e,sidebarFooterElements as m,toolbarElements as f}from"./default-elements/index.js";export const defaultConfiguratorElements=[o(r,t),...a,...e,...f,...m];
@@ -0,0 +1,10 @@
1
+ import { type PhoenixEntityElementDefinition, type PhoenixEntityElementRegistration } from '#package/domain';
2
+ /**
3
+ * Registers a built-in entity element under the `kind` of its schema, with the component that the
4
+ * import-time registry holds for that kind. The schema type argument ties the schema and the
5
+ * component's props together, as in `createPhoenixEntityElement`.
6
+ */
7
+ export declare const builtInEntityElement: <SCHEMA extends {
8
+ kind: string;
9
+ props?: Record<string, unknown>;
10
+ } = never>(schema: PhoenixEntityElementDefinition<SCHEMA>['schema'], component: PhoenixEntityElementDefinition<SCHEMA>['component']) => PhoenixEntityElementRegistration;
@@ -0,0 +1 @@
1
+ import{createCustomPhoenixEntityElement as t}from"#package/domain";export const builtInEntityElement=(e,n)=>t(e.properties.kind.enum[0],n);
@@ -0,0 +1,10 @@
1
+ import { type PhoenixLayoutElementDefinition, type PhoenixLayoutElementRegistration } from '#package/domain';
2
+ /**
3
+ * Registers a built-in layout element under the `kind` of its schema, with the component that the
4
+ * import-time registry holds for that kind. The schema type argument ties the schema and the
5
+ * component's props together, as in `createPhoenixLayoutElement`.
6
+ */
7
+ export declare const builtInLayoutElement: <SCHEMA extends {
8
+ kind: string;
9
+ props?: Record<string, unknown>;
10
+ } = never>(schema: PhoenixLayoutElementDefinition<SCHEMA>['schema'], component: PhoenixLayoutElementDefinition<SCHEMA>['component']) => PhoenixLayoutElementRegistration;
@@ -0,0 +1 @@
1
+ import{createCustomPhoenixLayoutElement as e}from"#package/domain";export const builtInLayoutElement=(o,t)=>e(o.properties.kind.enum[0],t);
@@ -0,0 +1,6 @@
1
+ import { type ElementRegistration } from '#package/domain';
2
+ /**
3
+ * The property-page controls of `react-sdk` and the two adapters that forward to a project element,
4
+ * registered under their spec kinds.
5
+ */
6
+ export declare const domainControlElements: readonly ElementRegistration[];
@@ -0,0 +1 @@
1
+ import{attributeCardSelectorSchema as t,attributeListSelectorSchema as o,attributeSelectSchema as e,attributeSwitchSelectorSchema as m,attributeToggleSelectorSchema as i,childEntityCardSelectorSchema as r,childEntityListSelectorSchema as n,childEntityToggleSelectorSchema as a,colorPickerInputSchema as l,customElementSchema as p,customLayoutElementSchema as s,deleteEntityButtonSchema as c,dimensionListSelectorSchema as f,dimensionToggleSelectorSchema as d,distanceDimensionInputSchema as k,distanceDimensionSliderSchema as u,entityChildActionDeleteSchema as b,entityChildActionSelectSchema as g,entityChildrenListSchema as j,genericDimensionInputSchema as y,genericDimensionSliderSchema as x,horizontalGroupRecipePanelSchema as C,materialSwatchSelectorSchema as E,propertyContainerGroupSchema as h,propertyContainerItemSchema as q,replaceEntityDropdownSchema as v,simpleRecipePanelSchema as w,verticalGroupRecipePanelSchema as z}from"#package/domain";import{AttributeCardSelector as A,AttributeListSelector as B,AttributeSelect as D,AttributeSwitchSelector as F,AttributeToggleSelector as G,ChildEntityCardSelector as H,ChildEntityListSelector as I,ChildEntityToggleSelector as J,ColorPickerInput as K,CustomElement as L,CustomLayoutElement as M,DeleteEntityButton as N,DimensionListSelector as O,DimensionToggleSelector as P,DistanceDimensionInput as Q,DistanceDimensionSlider as R,EntityChildActionDelete as S,EntityChildActionSelect as T,GenericDimensionInput as U,GenericDimensionSlider as V,HorizontalGroupRecipePanel as W,MaterialSwatchSelector as X,PropertyContainerGroup as Y,PropertyContainerItem as Z,PropertyPageEntityChildrenList as $,ReplaceEntityDropdown as _,SimpleRecipePanel as tt,VerticalGroupRecipePanel as to}from"#package/react-sdk";import{builtInEntityElement as te}from"./built-in-entity-element.js";import{builtInLayoutElement as tm}from"./built-in-layout-element.js";export const domainControlElements=[te(t,A),te(o,B),te(e,D),te(m,F),te(i,G),te(r,H),te(n,I),te(a,J),te(l,K),te(p,L),tm(s,M),te(c,N),te(f,O),te(d,P),te(k,Q),te(u,R),te(b,S),te(g,T),te(j,$),te(y,U),te(x,V),te(C,W),te(E,X),te(h,Y),te(q,Z),te(v,_),te(w,tt),te(z,to)];
@@ -0,0 +1,4 @@
1
+ export { domainControlElements } from './domain-control-elements.js';
2
+ export { recipePanelElements } from './recipe-panel-elements.js';
3
+ export { sidebarFooterElements } from './sidebar-footer-elements.js';
4
+ export { toolbarElements } from './toolbar-elements.js';
@@ -0,0 +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";
@@ -0,0 +1,3 @@
1
+ import { type ElementRegistration } from '#package/domain';
2
+ /** The configurator's recipe panels and the buttons that open them, registered under their spec kinds. */
3
+ export declare const recipePanelElements: readonly ElementRegistration[];
@@ -0,0 +1 @@
1
+ import{groupedRecipeButtonSchema as e,groupedRecipePanelSchema as i,replaceEntityPanelButtonSchema as t,replaceEntityPanelSchema as m}from"#package/domain";import{GroupedRecipeButton as o,GroupedRecipePanel as n,ReplaceEntityPanel as r,ReplaceEntityPanelButton as p}from"../../ui/index.js";import{builtInEntityElement as a}from"./built-in-entity-element.js";export const recipePanelElements=[a(e,o),a(i,n),a(m,r),a(t,p)];
@@ -0,0 +1,7 @@
1
+ import { type ElementRegistration } from '#package/domain';
2
+ /**
3
+ * The pieces of the configurator's sidebar footer, registered under their spec kinds. The built-in
4
+ * footers render these components directly, so a project element of the same name reaches only a
5
+ * `customSidebarFooter`.
6
+ */
7
+ export declare const sidebarFooterElements: readonly ElementRegistration[];
@@ -0,0 +1 @@
1
+ import{enterSummaryButtonSchema as o,footerPriceSchema as e,mainFooterActionsSchema as t,nextStepButtonSchema as i,otherActionsSchema as m,previousStepButtonSchema as r,saveTemplateButtonSchema as n,stepLabelSchema as a,stepProgressSchema as p}from"#package/domain";import{EnterSummaryButton as s,FooterPrice as l,MainFooterActions as d,NextStepButton as f,OtherActions as u,PreviousStepButton as b,SaveTemplateButton as c,StepLabel as j,StepProgress as x}from"../../ui/index.js";import{builtInLayoutElement as g}from"./built-in-layout-element.js";export const sidebarFooterElements=[g(o,s),g(e,l),g(t,d),g(i,f),g(m,u),g(r,b),g(n,c),g(a,j),g(p,x)];
@@ -0,0 +1,7 @@
1
+ import { type ElementRegistration } from '#package/domain';
2
+ /**
3
+ * The configurator's toolbar buttons and mobile menu actions, registered under their spec kinds.
4
+ * `ToolbarHelp` is not among them: the toolbar shows its help button only when a project registers
5
+ * that name.
6
+ */
7
+ export declare const toolbarElements: readonly ElementRegistration[];
@@ -0,0 +1 @@
1
+ import{assistantToolbarButtonSchema as o,enterFullscreenToolbarButtonSchema as t,exitFullscreenToolbarButtonSchema as m,helpMenuActionSchema as e,helpToolbarButtonSchema as i,languageMenuActionSchema as r,languageToolbarButtonSchema as n,measurementsMenuActionSchema as a,measurementsToolbarButtonSchema as l,redoToolbarButtonSchema as p,resetCameraToolbarButtonSchema as s,shareMenuActionSchema as f,shareToolbarButtonSchema as u,toolbarButtonGroupSchema as b,undoToolbarButtonSchema as c}from"#package/domain";import{AssistantToolbarButton as d,EnterFullscreenToolbarButton as j,ExitFullscreenToolbarButton as x,HelpMenuAction as g,HelpToolbarButton as k,LanguageMenuAction as y,LanguageToolbarButton as E,MeasurementsMenuAction as h,MeasurementsToolbarButton as q,RedoToolbarButton as v,ResetCameraToolbarButton as w,ShareMenuAction as z,ShareToolbarButton as A,ToolbarButtonGroup as B,UndoToolbarButton as C}from"../../ui/index.js";import{builtInLayoutElement as D}from"./built-in-layout-element.js";export const toolbarElements=[D(o,d),D(t,j),D(m,x),D(e,g),D(i,k),D(r,y),D(n,E),D(a,h),D(l,q),D(p,v),D(s,w),D(f,z),D(u,A),D(b,B),D(c,C)];
@@ -4,6 +4,7 @@ export { RootPage } from './RootPage.js';
4
4
  export { NewConfiguratorPage } from './NewConfiguratorPage.js';
5
5
  export { ConfiguratorRootErrorPage } from './ConfiguratorErrorPage.js';
6
6
  export { ConfiguratorNotFoundPage } from './ConfiguratorNotFoundPage.js';
7
+ export { defaultConfiguratorElements } from './default-configurator-elements.js';
7
8
  export { DevContextFallback } from './error-boundaries/DevContextFallback.js';
8
9
  export { DevLoadingFallback } from './error-boundaries/DevLoadingFallback.js';
9
10
  export { GeneralErrorFallback, DevGeneralErrorFallback, ProdGeneralErrorFallback } from './error-boundaries/index.js';
@@ -1 +1 @@
1
- export{ConfiguratorRoot}from"./ConfiguratorRoot.js";export{LoadedConfiguratorDetailPage}from"./LoadedConfiguratorDetailPage.js";export{RootPage}from"./RootPage.js";export{NewConfiguratorPage}from"./NewConfiguratorPage.js";export{ConfiguratorRootErrorPage}from"./ConfiguratorErrorPage.js";export{ConfiguratorNotFoundPage}from"./ConfiguratorNotFoundPage.js";export{DevContextFallback}from"./error-boundaries/DevContextFallback.js";export{DevLoadingFallback}from"./error-boundaries/DevLoadingFallback.js";export{GeneralErrorFallback,DevGeneralErrorFallback,ProdGeneralErrorFallback}from"./error-boundaries/index.js";export{LoadingErrorBoundary}from"./error-boundaries/LoadingErrorBoundary.js";
1
+ export{ConfiguratorRoot}from"./ConfiguratorRoot.js";export{LoadedConfiguratorDetailPage}from"./LoadedConfiguratorDetailPage.js";export{RootPage}from"./RootPage.js";export{NewConfiguratorPage}from"./NewConfiguratorPage.js";export{ConfiguratorRootErrorPage}from"./ConfiguratorErrorPage.js";export{ConfiguratorNotFoundPage}from"./ConfiguratorNotFoundPage.js";export{defaultConfiguratorElements}from"./default-configurator-elements.js";export{DevContextFallback}from"./error-boundaries/DevContextFallback.js";export{DevLoadingFallback}from"./error-boundaries/DevLoadingFallback.js";export{GeneralErrorFallback,DevGeneralErrorFallback,ProdGeneralErrorFallback}from"./error-boundaries/index.js";export{LoadingErrorBoundary}from"./error-boundaries/LoadingErrorBoundary.js";
@@ -3,9 +3,15 @@ export interface AssistantToolChipsProps {
3
3
  readonly tools: readonly AssistantToolItem[];
4
4
  /** True while the reply runs and this row is its newest block: the assistant is at work on it. */
5
5
  readonly isActive: boolean;
6
+ /** True when the row offers Undo: no reply runs, and the step of the undo history the configuration is at is one of its changes. */
7
+ readonly canUndo: boolean;
8
+ /** Undoes the changes of the given tool calls while one of them is the step the configuration is at. */
9
+ readonly onUndo: (toolCallIds: ReadonlySet<string>) => void;
6
10
  }
7
11
  /**
8
12
  * A row of notes on what the assistant did in a reply, one per tool call. A click on a note logs
9
- * the input and the result of its call to the console.
13
+ * the input and the result of its call to the console. While one of the row's changes is the step
14
+ * of the undo history the configuration is at, an Undo after the notes takes the row's changes
15
+ * back, up to a change the user made in between.
10
16
  */
11
- export declare const AssistantToolChips: import("react").MemoExoticComponent<({ tools, isActive }: AssistantToolChipsProps) => import("react/jsx-runtime").JSX.Element>;
17
+ export declare const AssistantToolChips: import("react").MemoExoticComponent<({ tools, isActive, canUndo, onUndo }: AssistantToolChipsProps) => import("react/jsx-runtime").JSX.Element>;
@@ -1 +1 @@
1
- import{jsx as t,jsxs as e}from"react/jsx-runtime";import{Tooltip as a,styled as i}from"@mui/material";import{memo as s,useCallback as o}from"react";import{match as n}from"ts-pattern";import{useLocalizable as r}from"#package/react-sdk";import{PhxIcon as l}from"#package/ui-sdk";import{AssistantPanelName as d}from"./theme.js";let m={id:"sdk.assistant.tool.updateDesign.label",message:"Update design"},c={id:"sdk.assistant.tool.readDesign.label",message:"Read design"},p={id:"sdk.assistant.tool.mistake.hint",message:"The assistant made a mistake."},h={id:"sdk.assistant.tool.cancelled.hint",message:"Stopped before it finished."},g={id:"sdk.assistant.tool.noResult.hint",message:"The result of this step was lost. It may or may not have been done."},f={id:"sdk.assistant.tool.toolBudget.hint",message:"Not done: the assistant reached its limit of steps for one message."},u=i("div",{name:d,slot:"chips"})(({theme:{palette:t,spacing:e,typography:a}})=>({...a.caption,alignItems:"start",color:t.text.secondary,display:"grid",gap:e(.75),gridTemplateColumns:"min-content minmax(0, 1fr)"})),k=i("span",{name:d,slot:"activity"})(({theme:{typography:t}})=>({blockSize:`calc(${t.caption.lineHeight} * 1em)`,display:"grid",placeItems:"center"})),x=i(l,{name:d,slot:"activityIcon"})({fontSize:14,'[data-chips="active"] &':{animation:"phx-assistant-turn 2.4s linear infinite","@media (prefers-reduced-motion: reduce)":{animation:"none"}},"@keyframes phx-assistant-turn":{to:{rotate:"360deg"}}}),w=i("span",{name:d,slot:"chip"})(({theme:{palette:t,spacing:e}})=>({cursor:"default",display:"inline-block",whiteSpace:"nowrap","&:not(:last-child)::after":{color:t.text.secondary,content:'"\xb7"',display:"inline-block",marginInline:e(.75),textDecoration:"none"},'&[data-chip="failed"]':{color:t.error.main},'&[data-chip="flawed"]':{textDecoration:"line-through",textDecorationColor:t.error.main}})),y=s(({tool:e})=>{let{chip:i,input:s,result:l}=e,d=r(m),u=r(c),k=r(p),x=r(h),y=r(g),b=r(f),v=n(i.label).with({kind:"text"},({text:t})=>t).with({kind:"updateDesign"},()=>d).with({kind:"readDesign"},()=>u).exhaustive(),C=o(()=>{console.info(`Assistant tool call "${v}"`,{input:s,result:l})},[s,v,l]);return t(a,{title:n(i).with({errorCode:"cancelled"},()=>x).with({errorCode:"no_result"},()=>y).with({errorCode:"tool_budget"},()=>b).with({state:"failed"},{state:"flawed"},()=>k).otherwise(()=>""),placement:"top-start",children:t(w,{onClick:C,"data-chip":i.state,children:v})})});export const AssistantToolChips=s(({tools:a,isActive:i})=>e(u,{"data-chips":i?"active":"done","aria-busy":i,children:[t(k,{children:t(x,{name:"Gear"})}),t("div",{children:a.map(e=>t(y,{tool:e},e.id))})]}));
1
+ import{jsx as e,jsxs as t}from"react/jsx-runtime";import{ButtonBase as i,Tooltip as a,styled as n}from"@mui/material";import{memo as o,useCallback as s}from"react";import{match as r}from"ts-pattern";import{useLocalizable as d}from"#package/react-sdk";import{PhxIcon as l}from"#package/ui-sdk";import{AssistantPanelName as m}from"./theme.js";let c={id:"sdk.assistant.tool.updateDesign.label",message:"Update design"},p={id:"sdk.assistant.tool.readDesign.label",message:"Read design"},h={id:"sdk.assistant.tool.mistake.hint",message:"The assistant made a mistake."},u={id:"sdk.assistant.tool.cancelled.hint",message:"Stopped before it finished."},f={id:"sdk.assistant.tool.noResult.hint",message:"The result of this step was lost. It may or may not have been done."},g={id:"sdk.assistant.tool.toolBudget.hint",message:"Not done: the assistant reached its limit of steps for one message."},k={id:"sdk.assistant.tool.undo.label",message:"Undo"},x=n("div",{name:m,slot:"chips"})(({theme:{palette:e,spacing:t,typography:i}})=>({...i.caption,alignItems:"start",color:e.text.secondary,display:"grid",gap:t(.75),gridTemplateColumns:"min-content minmax(0, 1fr)"})),y=n("span",{name:m,slot:"activity"})(({theme:{typography:e}})=>({blockSize:`calc(${e.caption.lineHeight} * 1em)`,display:"grid",placeItems:"center"})),w=n(l,{name:m,slot:"activityIcon"})({fontSize:14,'[data-chips="active"] &':{animation:"phx-assistant-turn 2.4s linear infinite","@media (prefers-reduced-motion: reduce)":{animation:"none"}},"@keyframes phx-assistant-turn":{to:{rotate:"360deg"}}}),b=n("span",{name:m,slot:"chip"})(({theme:{palette:e,spacing:t}})=>({cursor:"default",display:"inline-block",whiteSpace:"nowrap","&:not(:last-of-type)::after":{color:e.text.secondary,content:'"\xb7"',display:"inline-block",marginInline:t(.75),textDecoration:"none"},'&[data-chip="failed"]':{color:e.error.main},'&[data-chip="flawed"]':{textDecoration:"line-through",textDecorationColor:e.error.main}})),v=n(i,{name:m,slot:"undoButton"})(({theme:{palette:e,shape:t,spacing:i}})=>({alignItems:"center",animation:"phx-assistant-undo-in 150ms ease-out",borderRadius:t.borderRadius,color:e.primary.main,display:"inline-flex",font:"inherit",gap:i(.5),marginInlineStart:i(1),verticalAlign:"top","&:hover":{textDecoration:"underline"},"@media (prefers-reduced-motion: reduce)":{animation:"none"},"@keyframes phx-assistant-undo-in":{from:{opacity:0}}})),C=o(({tool:t})=>{let{chip:i,input:n,result:o}=t,l=d(c),m=d(p),k=d(h),x=d(u),y=d(f),w=d(g),v=r(i.label).with({kind:"text"},({text:e})=>e).with({kind:"updateDesign"},()=>l).with({kind:"readDesign"},()=>m).exhaustive(),C=s(()=>{console.info(`Assistant tool call "${v}"`,{input:n,result:o})},[n,v,o]);return e(a,{title:r(i).with({errorCode:"cancelled"},()=>x).with({errorCode:"no_result"},()=>y).with({errorCode:"tool_budget"},()=>w).with({state:"failed"},{state:"flawed"},()=>k).otherwise(()=>""),placement:"top-start",children:e(b,{onClick:C,"data-chip":i.state,children:v})})});export const AssistantToolChips=o(({tools:i,isActive:a,canUndo:n,onUndo:o})=>{let r=d(k),m=s(()=>{o(new Set(i.map(({id:e})=>e)))},[o,i]);return t(x,{"data-chips":a?"active":"done","aria-busy":a,children:[e(y,{children:e(w,{name:"Gear"})}),t("div",{children:[i.map(t=>e(C,{tool:t},t.id)),n&&t(v,{onClick:m,children:[e(l,{name:"ArrowCounterClockwise",fontSize:"inherit"}),r]})]})]})});
@@ -1,7 +1,12 @@
1
+ import type { AssistantFormsVisibility } from './thread-items.js';
1
2
  export interface AssistantMarkdownProps {
2
3
  readonly markdown: string;
3
4
  /** True while the text is still arriving, so markup the model has not finished is completed. */
4
5
  readonly isStreaming: boolean;
6
+ readonly forms: AssistantFormsVisibility;
5
7
  }
6
- /** Assistant text of the thread: Markdown with lists, tables, links, entity links and code, without a bubble. */
7
- export declare const AssistantMarkdown: import("react").MemoExoticComponent<({ markdown, isStreaming }: AssistantMarkdownProps) => import("react/jsx-runtime").JSX.Element>;
8
+ /**
9
+ * Assistant text of the thread: Markdown with lists, tables, links, entity links, references, code and forms,
10
+ * without a bubble. A form fence the model is still writing shows a placeholder.
11
+ */
12
+ export declare const AssistantMarkdown: import("react").MemoExoticComponent<({ markdown, isStreaming, forms }: AssistantMarkdownProps) => import("react/jsx-runtime").JSX.Element>;
@@ -1 +1 @@
1
- import{jsx as r,Fragment as e}from"react/jsx-runtime";import{styled as o}from"@mui/material";import{memo as n}from"react";import i,{defaultUrlTransform as a}from"react-markdown";import t from"remark-gfm";import{AssistantEntityLink as l,isEntityLinkHref as d,parseEntityLinkTarget as m}from"./entity-link/index.js";import{completeStreamedMarkdown as s}from"./streamed-markdown.js";import{AssistantPanelName as c}from"./theme.js";let p=o("div",{name:c,slot:"assistantMessage"})(({theme:{palette:r,shape:e,spacing:o,typography:n}})=>({overflowWrap:"anywhere","& > :first-child":{marginBlockStart:0},"& > :last-child":{marginBlockEnd:0},"p, ul, ol, pre, blockquote":{marginBlock:o(1)},"h1, h2, h3, h4, h5, h6":{...n.subtitle2,marginBlock:o(1.5,.5)},"ul, ol":{paddingInlineStart:o(2.5)},a:{color:r.primary.main},code:{background:r.action.hover,borderRadius:e.borderRadius/2,fontFamily:"ui-monospace, Menlo, monospace",fontSize:"0.9em",paddingInline:o(.5)},pre:{background:r.action.hover,borderRadius:e.borderRadius,overflowX:"auto",padding:o(1),code:{background:"none",padding:0}},blockquote:{borderInlineStart:`2px solid ${r.divider}`,color:r.text.secondary,marginInline:0,paddingInlineStart:o(1.5)},"th, td":{borderBlockEnd:`1px solid ${r.divider}`,padding:o(.5,1),textAlign:"start",verticalAlign:"top"}})),u=o("div")({overflowX:"auto",table:{borderCollapse:"collapse",inlineSize:"100%"}}),g={a:({node:o,children:n,href:i,...a})=>{if(null==i||!d(i))return r("a",{...a,href:i,target:"_blank",rel:"noopener noreferrer",children:n});let t=m(i);return null==t?r(e,{children:n}):r(l,{id:t,children:n})},table:({node:e,children:o,...n})=>r(u,{children:r("table",{...n,children:o})})},h=[t],f=r=>d(r)?r:a(r),b=["img"];export const AssistantMarkdown=n(({markdown:e,isStreaming:o})=>r(p,{children:r(i,{components:g,remarkPlugins:h,disallowedElements:b,urlTransform:f,children:o?s(e):e})}));
1
+ import{jsx as e,Fragment as r}from"react/jsx-runtime";import{styled as n}from"@mui/material";import{createContext as i,memo as o,useContext as t,useMemo as l}from"react";import a,{defaultUrlTransform as d}from"react-markdown";import m from"remark-gfm";import{AssistantEntityLink as s}from"./entity-link/index.js";import{AssistantForm as c}from"./form/index.js";import{AssistantReferenceLink as u,isAssistantLinkHref as p,parseAssistantLinkTarget as g}from"./reference-link/index.js";import{completeStreamedMarkdown as h,hasOpenFence as f}from"./streamed-markdown.js";import{AssistantPanelName as k}from"./theme.js";let b=n("div",{name:k,slot:"assistantMessage"})(({theme:{palette:e,shape:r,spacing:n,typography:i}})=>({overflowWrap:"anywhere","& > :first-child":{marginBlockStart:0},"& > :last-child":{marginBlockEnd:0},"p, ul, ol, pre, blockquote":{marginBlock:n(1)},"h1, h2, h3, h4, h5, h6":{...i.subtitle2,marginBlock:n(1.5,.5)},"ul, ol":{paddingInlineStart:n(2.5)},a:{color:e.primary.main},code:{background:e.action.hover,borderRadius:r.borderRadius/2,fontFamily:"ui-monospace, Menlo, monospace",fontSize:"0.9em",paddingInline:n(.5)},pre:{background:e.action.hover,borderRadius:r.borderRadius,overflowX:"auto",padding:n(1),code:{background:"none",padding:0}},blockquote:{borderInlineStart:`2px solid ${e.divider}`,color:e.text.secondary,marginInline:0,paddingInlineStart:n(1.5)},"th, td":{borderBlockEnd:`1px solid ${e.divider}`,padding:n(.5,1),textAlign:"start",verticalAlign:"top"}})),v=n("div")({overflowX:"auto",table:{borderCollapse:"collapse",inlineSize:"100%"}}),x=i({forms:"hidden",openFenceEnd:void 0,isStreaming:!1}),y=({source:r,end:n})=>{let{forms:i,openFenceEnd:o,isStreaming:l}=t(x);return"hidden"===i?null:null!=n&&n===o?l?e(c,{source:r,status:"writing"}):null:e(c,{source:r,status:"disabled"===i?"waiting":"ready"})},w={a:({node:n,children:i,href:o,...t})=>{if(null==o||!p(o))return e("a",{...t,href:o,target:"_blank",rel:"noopener noreferrer",children:i});let l=g(o);return null==l?e(r,{children:i}):"entity"===l.kind?e(s,{id:l.id,children:i}):e(u,{target:l,children:i})},pre:({node:r,children:n,...i})=>{let o=(e=>{let[r]=e?.children??[];if(r?.type!=="element"||"code"!==r.tagName)return;let{className:n}=r.properties;if(Array.isArray(n)&&n.includes("language-form"))return r.children.map(e=>"text"===e.type?e.value:"").join("")})(r);return null==o?e("pre",{...i,children:n}):e(y,{source:o,end:r?.position?.end.offset})},table:({node:r,children:n,...i})=>e(v,{children:e("table",{...i,children:n})})},j=[m],S=e=>p(e)?e:d(e),A=["img"];export const AssistantMarkdown=o(({markdown:r,isStreaming:n,forms:i})=>{let o=n?h(r):r,t=f(r)?o.length:void 0,d=l(()=>({forms:i,openFenceEnd:t,isStreaming:n}),[i,t,n]);return e(b,{children:e(x.Provider,{value:d,children:e(a,{components:w,remarkPlugins:j,disallowedElements:A,urlTransform:S,children:o})})})});
@@ -1 +1 @@
1
- import{jsx as e,jsxs as t}from"react/jsx-runtime";import{IconButton as s,Tooltip as a,Typography as i,styled as n}from"@mui/material";import{useCallback as r}from"react";import{useLocalizable as o}from"#package/react-sdk";import{PhxIcon as l}from"#package/ui-sdk";import{useConfigurator as m}from"../../application-runtime/index.js";import{AssistantComposer as d}from"./AssistantComposer.js";import{AssistantThread as p}from"./AssistantThread.js";import{AssistantPanelName as c}from"./theme.js";import{useIsAssistantPanelOpen as u}from"./use-is-assistant-panel-open.js";let b={id:"sdk.assistant.panel.title",message:"Assistant"},f={id:"sdk.assistant.panel.close.label",message:"Close assistant"};export const ASSISTANT_PANEL_SLOT="slot[assistant]";let g=n("section",{name:c,slot:"root"})(({theme:{palette:e}})=>({background:`var(--phx-sidebar-background, ${e.background.paper})`,border:"var(--phx-sidebar-border, 0)",borderRadius:"inherit",display:"grid",gridTemplateColumns:"minmax(0, 1fr)",gridTemplateRows:"min-content minmax(0, 1fr) min-content",inset:0,overflow:"hidden",position:"absolute",zIndex:1})),h=n("header",{name:c,slot:"header"})(({theme:{palette:e,spacing:t}})=>({alignItems:"center",borderBlockEnd:`1px solid ${e.divider}`,display:"flex",gap:t(1),justifyContent:"space-between",paddingBlock:t(1),paddingInline:`var(--phx-sidebar-padding, ${t(2)}) ${t(1)}`})),x=n(i,{name:c,slot:"title"})({fontWeight:600}),k=n(s,{name:c,slot:"closeButton"})({}),j=e=>{e.target instanceof Element&&e.target.closest("button")&&e.preventDefault()};export const AssistantPanel=()=>{let{assistantSystem:s}=m(),i=u(),n=o(b),c=o(f),v=r(()=>{s.setOpen(!1)},[s]);return i?t(g,{"data-sidebar":"slot[assistant]","aria-label":n,onMouseDown:j,children:[t(h,{children:[e(x,{variant:"subtitle1",component:"h2",children:n}),e(a,{title:c,placement:"top",children:e(k,{size:"small","aria-label":c,onClick:v,children:e(l,{name:"X"})})})]}),e(p,{}),e(d,{})]}):null};
1
+ import{jsx as e,jsxs as t}from"react/jsx-runtime";import{IconButton as s,Tooltip as a,Typography as n,styled as i}from"@mui/material";import{useCallback as r}from"react";import{useLocalizable as o}from"#package/react-sdk";import{PhxIcon as l}from"#package/ui-sdk";import{useConfigurator as m}from"../../application-runtime/index.js";import{AssistantComposer as d}from"./AssistantComposer.js";import{AssistantThread as p}from"./AssistantThread.js";import{AssistantPanelName as c}from"./theme.js";import{useIsAssistantPanelOpen as u}from"./use-is-assistant-panel-open.js";let b={id:"sdk.assistant.panel.title",message:"Assistant"},f={id:"sdk.assistant.panel.close.label",message:"Close assistant"};export const ASSISTANT_PANEL_SLOT="slot[assistant]";let g=i("section",{name:c,slot:"root"})(({theme:{palette:e}})=>({background:`var(--phx-sidebar-background, ${e.background.paper})`,border:"var(--phx-sidebar-border, 0)",borderRadius:"inherit",display:"grid",gridTemplateColumns:"minmax(0, 1fr)",gridTemplateRows:"min-content minmax(0, 1fr) min-content",inset:0,overflow:"hidden",position:"absolute",zIndex:1})),h=i("header",{name:c,slot:"header"})(({theme:{palette:e,spacing:t}})=>({alignItems:"center",borderBlockEnd:`1px solid ${e.divider}`,display:"flex",gap:t(1),justifyContent:"space-between",paddingBlock:t(1),paddingInline:`var(--phx-sidebar-padding, ${t(2)}) ${t(1)}`})),x=i(n,{name:c,slot:"title"})({fontWeight:600}),k=i(s,{name:c,slot:"closeButton"})({}),j=e=>{e.target instanceof Element&&e.target.closest('button, [role="button"]')&&e.preventDefault()};export const AssistantPanel=()=>{let{assistantSystem:s}=m(),n=u(),i=o(b),c=o(f),v=r(()=>{s.setOpen(!1)},[s]);return n?t(g,{"data-sidebar":"slot[assistant]","aria-label":i,onMouseDown:j,children:[t(h,{children:[e(x,{variant:"subtitle1",component:"h2",children:i}),e(a,{title:c,placement:"top",children:e(k,{size:"small","aria-label":c,onClick:v,children:e(l,{name:"X"})})})]}),e(p,{}),e(d,{})]}):null};
@@ -1 +1 @@
1
- import{jsx as e,jsxs as a}from"react/jsx-runtime";import{Trans as i}from"@lingui/react";import{Button as t,styled as s}from"@mui/material";import{useCallback as r,useMemo as n}from"react";import{match as o}from"ts-pattern";import{useEagerObservableValue as l}from"#package/react-sdk";import{PhxIcon as d}from"#package/ui-sdk";import{useConfigurator as m}from"../../application-runtime/index.js";import{AssistantToolChips as c}from"./AssistantChips.js";import{AssistantMarkdown as h}from"./AssistantMarkdown.js";import{describeAssistantFailure as p}from"./assistant-failure.js";import{EntityLinkSelectionProvider as g,useCreateEntityLinkSelection as u}from"./entity-link/index.js";import{AssistantPanelName as k}from"./theme.js";import{buildEarlierThreadItems as f,buildThreadView as v}from"./thread-items.js";import{useFollowStream as w}from"./use-follow-stream.js";let b=s("div",{name:k,slot:"thread"})({display:"grid",position:"relative"}),x=s("div",{name:k,slot:"messages"})(({theme:{spacing:e,typography:a}})=>({...a.body2,display:"flex",flexDirection:"column",gap:e(1.5),overflowY:"auto",overscrollBehavior:"contain",paddingBlock:e(2),paddingInline:`var(--phx-sidebar-padding, ${e(2)})`,"& > :first-child":{marginBlockStart:"auto"}})),y=s("div",{name:k,slot:"userMessage"})(({theme:{palette:e,spacing:a}})=>({alignSelf:"flex-end",background:`hsl(from ${e.primary.main} h s l / 12%)`,borderRadius:"14px 14px 4px 14px",maxInlineSize:"85%",overflowWrap:"anywhere",paddingBlock:a(1),paddingInline:a(1.5),whiteSpace:"pre-wrap"})),S=s("div",{name:k,slot:"greeting"})({}),T=s("div",{name:k,slot:"status"})(({theme:{palette:e,typography:a}})=>({...a.caption,color:e.text.secondary})),j=s("div",{name:k,slot:"separator"})(({theme:{palette:e,spacing:a,typography:i}})=>({...i.caption,alignItems:"center",color:e.text.secondary,display:"flex",gap:a(1),"&::before, &::after":{borderBlockStart:`1px solid ${e.divider}`,content:'""',flex:1}})),B=s(t,{name:k,slot:"earlierButton"})({alignSelf:"center"}),E=s("div",{name:k,slot:"notice"})(({theme:{palette:e,shape:a,spacing:i}})=>({alignItems:"center",background:e.action.hover,borderRadius:a.borderRadius,display:"flex",flexWrap:"wrap",gap:i(1),justifyContent:"space-between",paddingBlock:i(1),paddingInline:i(1.5)})),I=s(t,{name:k,slot:"newReplyButton"})(({theme:{palette:e,spacing:a}})=>({background:e.text.primary,borderRadius:"calc(infinity * 1px)",color:e.background.paper,insetBlockEnd:a(1),insetInlineStart:"50%",position:"absolute",translate:"-50% 0","&:hover":{background:e.text.secondary}})),A=({item:a,isActive:t})=>o(a).with({kind:"user"},({text:a})=>e(y,{children:a})).with({kind:"text"},({markdown:a,isStreaming:i})=>e(h,{markdown:a,isStreaming:i})).with({kind:"tools"},({tools:a})=>e(c,{tools:a,isActive:t})).with({kind:"separator"},()=>e(j,{role:"separator",children:e(i,{id:"sdk.assistant.thread.earlierSummarized",message:"Earlier conversation summarized"})})).exhaustive();export const AssistantThread=()=>{let{assistantSystem:s}=m(),c=l(s.chat$),{messages:h,isLoading:k,isResuming:y,earlierThreads:j}=c,{items:C,isThinking:R}=n(()=>v(h,k),[h,k]),L=n(()=>f(j),[j]),z=n(()=>C.filter(({kind:e})=>"user"===e).length,[C]),$=c.error?p(c.failedStatus):void 0,{scrollerRef:D,hasUnseenContent:M,handleScroll:W,scrollToEnd:q}=w(n(()=>({messages:h,isThinking:R,isResuming:y,failure:$?.kind}),[h,R,y,$?.kind]),z),H=u(),N=r(e=>{e.target instanceof Element&&e.target.closest('a, button, input, select, textarea, [role="button"]')||window.getSelection()?.isCollapsed!==!1&&H.release()},[H]),Y=!c.isLoaded&&0===L.length&&!y&&!$;return a(b,{children:[e(g,{selection:H,children:a(x,{ref:D,onScroll:W,onClick:N,role:"log","aria-live":"polite",children:[c.isLoaded&&0===C.length&&0===L.length&&!k&&!y&&!$&&e(S,{children:e(i,{id:"sdk.assistant.thread.greeting",message:"Hi. I can answer questions about this design and change it with you. Tell me what you need."})}),Y&&e(T,{children:e(i,{id:"sdk.assistant.thread.loading",message:"Loading the conversation…"})}),c.isLoadingEarlierThread&&e(T,{children:e(i,{id:"sdk.assistant.thread.loadingEarlier",message:"Loading the earlier conversation…"})}),c.hasEarlierThread&&!c.isLoadingEarlierThread&&e(B,{size:"small",color:"inherit",onClick:s.loadEarlierThread,children:e(i,{id:"sdk.assistant.thread.showEarlier.label",message:"Show earlier conversation"})}),L.map(a=>e(A,{item:a,isActive:!1},a.id)),C.map(a=>e(A,{item:a,isActive:k&&a===C.at(-1)},a.id)),y&&e(T,{children:e(i,{id:"sdk.assistant.thread.resuming",message:"Resuming the conversation…"})}),R&&e(T,{children:e(i,{id:"sdk.assistant.thread.thinking",message:"Thinking…"})}),$&&a(E,{role:"alert",children:[e("span",{children:o($.kind).with("notAvailable",()=>e(i,{id:"sdk.assistant.failure.notAvailable",message:"The assistant is not available here."})).with("busy",()=>e(i,{id:"sdk.assistant.failure.busy",message:"The assistant is still working on an earlier message."})).with("unavailable",()=>e(i,{id:"sdk.assistant.failure.unavailable",message:"The assistant is unavailable right now."})).exhaustive()}),$.canRetry&&e(t,{size:"small",variant:"outlined",color:"inherit",onClick:s.reloadThread,children:e(i,{id:"sdk.assistant.failure.retry.label",message:"Try again"})})]})]})}),M&&e(I,{size:"small",onClick:q,endIcon:e(d,{name:"CaretDown"}),children:e(i,{id:"sdk.assistant.thread.newReply.label",message:"New reply"})})]})};
1
+ import{jsx as e,jsxs as a}from"react/jsx-runtime";import{Trans as i}from"@lingui/react";import{Button as t,styled as s}from"@mui/material";import{useCallback as r,useMemo as n}from"react";import{match as o}from"ts-pattern";import{useEagerObservableValue as l}from"#package/react-sdk";import{PhxIcon as d}from"#package/ui-sdk";import{useConfigurator as m}from"../../application-runtime/index.js";import{AssistantToolChips as c}from"./AssistantChips.js";import{AssistantMarkdown as h}from"./AssistantMarkdown.js";import{describeAssistantFailure as p}from"./assistant-failure.js";import{EntityLinkSelectionProvider as g,useCreateEntityLinkSelection as u}from"./entity-link/index.js";import{AssistantPanelName as f}from"./theme.js";import{buildEarlierThreadItems as k,buildThreadView as v}from"./thread-items.js";import{useFollowStream as b}from"./use-follow-stream.js";let w=s("div",{name:f,slot:"thread"})({display:"grid",position:"relative"}),x=s("div",{name:f,slot:"messages"})(({theme:{spacing:e,typography:a}})=>({...a.body2,display:"flex",flexDirection:"column",gap:e(1.5),overflowY:"auto",overscrollBehavior:"contain",paddingBlock:e(2),paddingInline:`var(--phx-sidebar-padding, ${e(2)})`,"& > :first-child":{marginBlockStart:"auto"}})),y=s("div",{name:f,slot:"userMessage"})(({theme:{palette:e,spacing:a}})=>({alignSelf:"flex-end",background:`hsl(from ${e.primary.main} h s l / 12%)`,borderRadius:"14px 14px 4px 14px",maxInlineSize:"85%",overflowWrap:"anywhere",paddingBlock:a(1),paddingInline:a(1.5),whiteSpace:"pre-wrap"})),T=s("div",{name:f,slot:"greeting"})({}),C=s("div",{name:f,slot:"status"})(({theme:{palette:e,typography:a}})=>({...a.caption,color:e.text.secondary})),S=s("div",{name:f,slot:"separator"})(({theme:{palette:e,spacing:a,typography:i}})=>({...i.caption,alignItems:"center",color:e.text.secondary,display:"flex",gap:a(1),"&::before, &::after":{borderBlockStart:`1px solid ${e.divider}`,content:'""',flex:1}})),j=s(t,{name:f,slot:"earlierButton"})({alignSelf:"center"}),I=s("div",{name:f,slot:"notice"})(({theme:{palette:e,shape:a,spacing:i}})=>({alignItems:"center",background:e.action.hover,borderRadius:a.borderRadius,display:"flex",flexWrap:"wrap",gap:i(1),justifyContent:"space-between",paddingBlock:i(1),paddingInline:i(1.5)})),B=s(t,{name:f,slot:"newReplyButton"})(({theme:{palette:e,spacing:a}})=>({background:e.text.primary,borderRadius:"calc(infinity * 1px)",color:e.background.paper,insetBlockEnd:a(1),insetInlineStart:"50%",position:"absolute",translate:"-50% 0","&:hover":{background:e.text.secondary}})),E=({item:a,isActive:t,undoableToolCallId:s,onUndo:r})=>o(a).with({kind:"user"},({text:a})=>e(y,{children:a})).with({kind:"text"},({markdown:a,isStreaming:i,forms:t})=>e(h,{markdown:a,isStreaming:i,forms:t})).with({kind:"tools"},({tools:a})=>e(c,{tools:a,isActive:t,canUndo:a.some(({id:e})=>e===s),onUndo:r})).with({kind:"separator"},()=>e(S,{role:"separator",children:e(i,{id:"sdk.assistant.thread.earlierSummarized",message:"Earlier conversation summarized"})})).exhaustive();export const AssistantThread=()=>{let{assistantSystem:s}=m(),c=l(s.chat$),{messages:h,isLoading:f,isResuming:y,earlierThreads:S}=c,A=l(s.undoTipToolCallId$),R=f?void 0:A,{items:L,isThinking:z}=n(()=>v(h,f,y),[h,f,y]),$=n(()=>k(S),[S]),U=n(()=>L.filter(({kind:e})=>"user"===e).length,[L]),D=c.error?p(c.failedStatus):void 0,{scrollerRef:M,hasUnseenContent:W,handleScroll:q,scrollToEnd:H}=b(n(()=>({messages:h,isThinking:z,isResuming:y,failure:D?.kind}),[h,z,y,D?.kind]),U),N=u(),Y=r(e=>{e.target instanceof Element&&e.target.closest('a, button, input, label, select, textarea, [role="button"], [role="tooltip"]')||window.getSelection()?.isCollapsed!==!1&&N.release()},[N]),F=!c.isLoaded&&0===$.length&&!y&&!D;return a(w,{children:[e(g,{selection:N,children:a(x,{ref:M,onScroll:q,onClick:Y,role:"log","aria-live":"polite",children:[c.isLoaded&&0===L.length&&0===$.length&&!f&&!y&&!D&&e(T,{children:e(i,{id:"sdk.assistant.thread.greeting",message:"Hi. I can answer questions about this design and change it with you. Tell me what you need."})}),F&&e(C,{children:e(i,{id:"sdk.assistant.thread.loading",message:"Loading the conversation…"})}),c.isLoadingEarlierThread&&e(C,{children:e(i,{id:"sdk.assistant.thread.loadingEarlier",message:"Loading the earlier conversation…"})}),c.hasEarlierThread&&!c.isLoadingEarlierThread&&e(j,{size:"small",color:"inherit",onClick:s.loadEarlierThread,children:e(i,{id:"sdk.assistant.thread.showEarlier.label",message:"Show earlier conversation"})}),$.map(a=>e(E,{item:a,isActive:!1,undoableToolCallId:R,onUndo:s.undoToolCalls},a.id)),L.map(a=>e(E,{item:a,isActive:f&&a===L.at(-1),undoableToolCallId:R,onUndo:s.undoToolCalls},a.id)),y&&e(C,{children:e(i,{id:"sdk.assistant.thread.resuming",message:"Resuming the conversation…"})}),z&&e(C,{children:e(i,{id:"sdk.assistant.thread.thinking",message:"Thinking…"})}),D&&a(I,{role:"alert",children:[e("span",{children:o(D.kind).with("notAvailable",()=>e(i,{id:"sdk.assistant.failure.notAvailable",message:"The assistant is not available here."})).with("busy",()=>e(i,{id:"sdk.assistant.failure.busy",message:"The assistant is still working on an earlier message."})).with("unavailable",()=>e(i,{id:"sdk.assistant.failure.unavailable",message:"The assistant is unavailable right now."})).exhaustive()}),D.canRetry&&e(t,{size:"small",variant:"outlined",color:"inherit",onClick:s.reloadThread,children:e(i,{id:"sdk.assistant.failure.retry.label",message:"Try again"})})]})]})}),W&&e(B,{size:"small",onClick:H,endIcon:e(d,{name:"CaretDown"}),children:e(i,{id:"sdk.assistant.thread.newReply.label",message:"New reply"})})]})};
@@ -8,6 +8,6 @@ export interface AssistantEntityLinkProps {
8
8
  /**
9
9
  * An entity the assistant named in a reply, shown as its label. It follows the configurator live:
10
10
  * a click selects the entity when the scene can select it, the link shows when the entity is
11
- * selected or hovered in the scene, and it is struck out once the entity is gone.
11
+ * selected or hovered in the scene, and it is muted once the entity is gone.
12
12
  */
13
13
  export declare const AssistantEntityLink: import("react").MemoExoticComponent<({ id, children }: AssistantEntityLinkProps) => import("react/jsx-runtime").JSX.Element>;
@@ -1 +1 @@
1
- import{jsx as e}from"react/jsx-runtime";import{alpha as t,styled as i}from"@mui/material";import{memo as n,useCallback as r,useEffect as o,useRef as a}from"react";import{sceneEntitySelectHotspotComponent as l,selectableComponent as c}from"#package/domain";import{useDomain as d,useFirstRenderedComponent as s,useHoveredDomainEntityId as m,useRenderedSelector as u,useSelectEntity as p,useSelectedDomainEntityId as k,useStoreSelector as y}from"#package/react-sdk";import{FrontendAnalyticsFactory as h}from"../../../common/index.js";import{AssistantPanelName as b}from"../theme.js";import{useEntityLinkSelection as g}from"./entity-link-selection.js";import{resolveEntityLinkState as f}from"./entity-link-state.js";let v=({theme:{palette:e,shape:i,spacing:n}})=>({background:e.action.hover,border:"none",borderRadius:i.borderRadius/2,boxDecorationBreak:"clone",color:"inherit",font:"inherit",margin:0,paddingBlock:0,paddingInline:n(.5),textAlign:"inherit",WebkitBoxDecorationBreak:"clone",'&[data-entity-link="interactive"]':{background:t(e.primary.main,e.action.hoverOpacity),color:e.primary.main,cursor:"pointer",'&:hover, &:focus-visible, &[data-hovered="true"]':{background:t(e.primary.main,e.action.focusOpacity)},"&:focus-visible":{outline:`2px solid ${e.primary.main}`,outlineOffset:1}},'&[data-entity-link="missing"]':{background:"none",color:e.text.disabled,paddingInline:0,textDecoration:"line-through"},'&[data-selected="true"]':{boxShadow:`inset 0 0 0 1px ${e.primary.main}`}}),x=i("span",{name:b,slot:"entityLink"})(v),S=i("button",{name:b,slot:"entityLink"})(v),j=({kind:t,isSelected:i,children:n})=>e(x,{"data-entity-link":t,"data-selected":i,children:n}),T=({id:t,isSelected:i,children:n})=>{let{navigationSystem:u}=d(),k=s({entityIds:[t],componentTypes:[c]}),y=s({entityIds:[t],componentTypes:[l]}),{kind:b,canHover:v}=f({isSelectable:null!=k,isHoverDisabled:k?.state.hoverable===!1,hasSelectHotspot:null!=y}),x=m()===t,T=p(h.AssistantEntityLinkClicked),B=g(),E=r(()=>{B?.remember(t),T(t)},[t,B,T]),L=a(!1),D=r(()=>{v&&(L.current=!0,u.debouncedToggleHover(t))},[v,t,u]),H=r(()=>{L.current&&(L.current=!1,u.debouncedToggleHover(null))},[u]),I=r(e=>{"touch"!==e.pointerType&&D()},[D]),A=r(e=>{e.currentTarget.matches(":focus-visible")&&D()},[D]);return(o(()=>H,[v,H,t]),"interactive"!==b)?e(j,{kind:b,isSelected:i,children:n}):e(S,{type:"button","data-entity-link":b,"data-selected":i,"data-hovered":v&&x,"aria-current":i?"true":void 0,onClick:E,onPointerEnter:I,onPointerLeave:H,onFocus:A,onBlur:H,children:n})};export const AssistantEntityLink=n(({id:t,children:i})=>{let{domain:n}=d(),r=y(e=>null!=n.getEntity(t,e.state),[n,t]),o=u(e=>null!=n.getEntity(t,e.state),[n,t]),a=k()===t;return r?o?e(T,{id:t,isSelected:a,children:i}):e(j,{kind:"plain",isSelected:a,children:i}):e(j,{kind:"missing",isSelected:!1,children:i})});
1
+ import{jsx as e}from"react/jsx-runtime";import{styled as t}from"@mui/material";import{memo as n,useCallback as i,useEffect as r,useRef as o}from"react";import{sceneEntitySelectHotspotComponent as a,selectableComponent as l}from"#package/domain";import{useDomain as s,useFirstRenderedComponent as c,useHoveredDomainEntityId as d,useRenderedSelector as m,useSelectEntity as u,useSelectedDomainEntityId as p,useStoreSelector as k}from"#package/react-sdk";import{FrontendAnalyticsFactory as y}from"../../../common/index.js";import{assistantReferenceStyles as f}from"../reference-link/index.js";import{AssistantPanelName as g}from"../theme.js";import{useEntityLinkSelection as h}from"./entity-link-selection.js";import{resolveEntityLinkState as v}from"./entity-link-state.js";let b=t("span",{name:g,slot:"entityLink"})(e=>({...f(e),'&[data-entity-link="plain"], &[data-entity-link="missing"]':{cursor:"auto","&:hover":{background:"none"}},'&[data-selected="true"]':{textDecorationStyle:"solid"}})),j={interactive:void 0,plain:"plain",missing:"muted"},x=({kind:t,isSelected:n,children:i})=>e(b,{"data-entity-link":t,"data-reference":j[t],"data-selected":n,children:i}),S=({id:t,isSelected:n,children:m})=>{let{navigationSystem:p}=s(),k=c({entityIds:[t],componentTypes:[l]}),f=c({entityIds:[t],componentTypes:[a]}),{kind:g,canHover:j}=v({isSelectable:null!=k,isHoverDisabled:k?.state.hoverable===!1,hasSelectHotspot:null!=f}),S=d()===t,E=u(y.AssistantEntityLinkClicked),T=h(),D=i(()=>{T?.remember(t),E(t)},[t,T,E]),H=o(!1),L=i(()=>{j&&(H.current=!0,p.debouncedToggleHover(t))},[j,t,p]),I=i(()=>{H.current&&(H.current=!1,p.debouncedToggleHover(null))},[p]),A=i(e=>{"touch"!==e.pointerType&&L()},[L]),C=i(e=>{e.currentTarget.matches(":focus-visible")&&L()},[L]),P=i(e=>{("Enter"===e.key||" "===e.key)&&(e.preventDefault(),D())},[D]);return(r(()=>I,[j,I,t]),"interactive"!==g)?e(x,{kind:g,isSelected:n,children:m}):e(b,{role:"button",tabIndex:0,"data-entity-link":g,"data-selected":n,"data-hovered":j&&S,"aria-current":n?"true":void 0,onClick:D,onKeyDown:P,onPointerEnter:A,onPointerLeave:I,onFocus:C,onBlur:I,children:m})};export const AssistantEntityLink=n(({id:t,children:n})=>{let{domain:i}=s(),r=k(e=>null!=i.getEntity(t,e.state),[i,t]),o=m(e=>null!=i.getEntity(t,e.state),[i,t]),a=p()===t;return r?o?e(S,{id:t,isSelected:a,children:n}):e(x,{kind:"plain",isSelected:a,children:n}):e(x,{kind:"missing",isSelected:!1,children:n})});
@@ -10,7 +10,7 @@ export interface EntityLinkFacts {
10
10
  /**
11
11
  * How an entity link shows and behaves:
12
12
  *
13
- * - `missing`: the entity is gone, the link is struck out;
13
+ * - `missing`: the entity is gone, the link is muted;
14
14
  * - `plain`: the entity exists but nothing in the scene selects it, so the link is only a label;
15
15
  * - `interactive`: a click selects the entity, as a click on it or on its hotspot in the scene does.
16
16
  */
@@ -1,3 +1,2 @@
1
1
  export { AssistantEntityLink } from './AssistantEntityLink.js';
2
2
  export { EntityLinkSelectionProvider, useCreateEntityLinkSelection } from './entity-link-selection.js';
3
- export { isEntityLinkHref, parseEntityLinkTarget } from './entity-link-target.js';
@@ -1 +1 @@
1
- export{AssistantEntityLink}from"./AssistantEntityLink.js";export{EntityLinkSelectionProvider,useCreateEntityLinkSelection}from"./entity-link-selection.js";export{isEntityLinkHref,parseEntityLinkTarget}from"./entity-link-target.js";
1
+ export{AssistantEntityLink}from"./AssistantEntityLink.js";export{EntityLinkSelectionProvider,useCreateEntityLinkSelection}from"./entity-link-selection.js";
@@ -0,0 +1,19 @@
1
+ /**
2
+ * Where a form stands in its reply: still being written, written while the reply goes on, or ready
3
+ * for the user once the reply has ended.
4
+ */
5
+ export type AssistantFormStatus = 'writing' | 'waiting' | 'ready';
6
+ export interface AssistantFormProps {
7
+ /** The markup inside the ```` ```form ```` fence. */
8
+ readonly source: string;
9
+ readonly status: AssistantFormStatus;
10
+ }
11
+ /**
12
+ * A form the assistant wrote to ask the user something. What the user picks or enters is sent as
13
+ * their next message; a form that asks one question sends on the first pick, any other has a submit
14
+ * button. A form that cannot be built offers to send the assistant its errors instead.
15
+ *
16
+ * The state lives here, so unfinished input is lost when the form unmounts: accepted, because a
17
+ * form is shown only in the last reply of the thread.
18
+ */
19
+ export declare const AssistantForm: import("react").MemoExoticComponent<({ source, status }: AssistantFormProps) => import("react/jsx-runtime").JSX.Element | null>;
@@ -0,0 +1 @@
1
+ import{jsx as e,jsxs as i}from"react/jsx-runtime";import{Trans as r}from"@lingui/react";import{Button as t,styled as o}from"@mui/material";import{memo as n,useCallback as a,useEffect as s,useMemo as l,useState as d}from"react";import{match as m}from"ts-pattern";import{useConfigurator as c}from"../../../application-runtime/index.js";import{AssistantPanelName as p}from"../theme.js";import{getBuiltInFormRegistry as u}from"./built-in-form-registry.js";import{composeAnswer as b}from"./compose-answer.js";import{describeBuildErrors as f}from"./describe-build-errors.js";import{parseFormBlock as g}from"./parse-form-block.js";let h=o("form",{name:p,slot:"form"})(({theme:{spacing:e}})=>({display:"flex",flexDirection:"column",gap:e(1.5),marginBlock:e(1)})),k=o(t,{name:p,slot:"formSubmit"})(({theme:{palette:e,spacing:i,typography:r}})=>({...r.body2,alignSelf:"end",background:e.primary.main,border:"none",borderRadius:8,color:e.primary.contrastText,fontWeight:r.fontWeightMedium,letterSpacing:"normal",minBlockSize:0,minInlineSize:0,paddingBlock:i(.5),paddingInline:i(2),textTransform:"none","&:hover":{background:e.primary.dark,border:"none"},"&.Mui-disabled":{background:e.action.disabledBackground,border:"none",color:e.action.disabled}})),w=o("div",{name:p,slot:"formNote"})(({theme:{palette:e,shape:i,spacing:r,typography:t}})=>({...t.caption,alignItems:"center",background:e.action.hover,borderRadius:i.borderRadius,color:e.text.secondary,display:"flex",flexWrap:"wrap",gap:r(1),justifyContent:"space-between",marginBlock:r(1),paddingBlock:r(1),paddingInline:r(1.5)})),x=({model:t,disabled:o,send:n})=>{let[a,s]=d(()=>new Map),[l,c]=d(()=>new Map),p=(i,r)=>{let{id:d,definition:u,label:f,value:g,attributes:h}=i;return m(u).with({role:"option"},({component:m})=>e(m,{attributes:h,label:f,disabled:o,selected:!0===a.get(d),onSelect:()=>{t.isQuick?n(b(t,new Map([[i.id,!0]]),l)):s(e=>{let t=new Map(e);if("choice"===r.definition.role){for(let e of r.children)t.delete(e.id);t.set(i.id,!0)}else t.set(i.id,!0!==e.get(i.id));return t})}},d)).with({role:"input"},({component:r})=>e(r,{attributes:h,label:f,value:g,disabled:o,state:a.get(d),onChange:(e,r)=>{s(r=>new Map(r).set(i.id,e)),c(e=>new Map(e).set(i.id,r))}},d)).with({role:"group"},{role:"choice"},{role:"choices"},({component:r})=>e(r,{attributes:h,label:f,disabled:o,children:i.children.map(e=>p(e,i))},d)).exhaustive()};return i(h,{onSubmit:e=>{e.preventDefault(),o||t.isQuick||n(b(t,a,l))},children:[t.root.children.map(e=>p(e,t.root)),!t.isQuick&&e(k,{type:"submit",variant:"contained",disabled:o,disableElevation:!0,children:e(r,{id:"sdk.assistant.form.submit.label",message:"Submit"})})]})};export const AssistantForm=n(({source:o,status:n})=>{let{assistantSystem:m}=c(),[p,b]=d(!1),h="writing"===n,k=l(()=>h?void 0:g(o,u()),[o,h]),y="ready"!==n||p,j=a(e=>{b(!0),m.send(e).finally(()=>b(!1))},[m]);return(s(()=>{k?.ok===!1&&console.warn("The assistant wrote a form that could not be built.",k.errors)},[k]),k)?k.ok?0===k.root.children.length?null:e(x,{model:k,disabled:y,send:j}):i(w,{role:"alert",children:[e("span",{children:e(r,{id:"sdk.assistant.form.failure",message:"The assistant couldn't build this form."})}),e(t,{size:"small",variant:"outlined",color:"inherit",disabled:y,onClick:()=>j(f(k.errors)),children:e(r,{id:"sdk.assistant.form.fix.label",message:"Fix it"})})]}):e(w,{children:e(r,{id:"sdk.assistant.form.writing",message:"Preparing a form…"})})});
@@ -0,0 +1,10 @@
1
+ import type { FormElementDefinition } from './form-element-definition.js';
2
+ import { type FormRegistry } from './form-registry.js';
3
+ /** The elements of every assistant form: the built-ins the SDK prompt lists, with their components. */
4
+ export declare const BUILT_IN_FORM_ELEMENTS: readonly FormElementDefinition[];
5
+ /**
6
+ * The registry of the built-in elements, built on the first form rather than when the module loads:
7
+ * compiling validators while the bundle evaluates would break a configurator on a page whose CSP
8
+ * forbids eval, even one without an assistant.
9
+ */
10
+ export declare const getBuiltInFormRegistry: () => FormRegistry;
@@ -0,0 +1 @@
1
+ let o;import{match as t}from"ts-pattern";import{ASSISTANT_BUILT_IN_FORM_ELEMENTS as e,extendedSchemaValidator as r}from"#package/domain";import{FormGroup as i,FormOptions as m,FormReply as n,FormText as p}from"../form-elements/index.js";import{createFormRegistry as c}from"./form-registry.js";export const BUILT_IN_FORM_ELEMENTS=e.map(o=>t(o.role).with("group",t=>({...o,role:t,component:i})).with("choice","choices",t=>({...o,role:t,component:m})).with("option",t=>({...o,role:t,component:n})).with("input",t=>({...o,role:t,component:p})).exhaustive());export const getBuiltInFormRegistry=()=>o??=c(BUILT_IN_FORM_ELEMENTS,{schemaValidator:r});