@salsita-ai/sdk 0.50.0-develop.b5468d6828 → 0.50.0-develop.bb1eefaada

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 (411) hide show
  1. package/README.md +8 -4
  2. package/dist/admin/default-admin-elements.d.ts +9 -0
  3. package/dist/admin/default-admin-elements.js +1 -0
  4. package/dist/admin/default-elements/built-in-entity-element.d.ts +10 -0
  5. package/dist/admin/default-elements/built-in-entity-element.js +1 -0
  6. package/dist/admin/default-elements/built-in-layout-element.d.ts +10 -0
  7. package/dist/admin/default-elements/built-in-layout-element.js +1 -0
  8. package/dist/admin/default-elements/index.d.ts +2 -0
  9. package/dist/admin/default-elements/index.js +1 -0
  10. package/dist/admin/index.d.ts +1 -0
  11. package/dist/admin/index.js +1 -1
  12. package/dist/application-spec/caching/content-diff.js +1 -1
  13. package/dist/application-spec/core/application-file.d.ts +0 -2
  14. package/dist/application-spec/core/application-file.js +1 -1
  15. package/dist/application-spec/errors/diagnostic-codes.d.ts +5 -0
  16. package/dist/application-spec/errors/diagnostic-codes.js +1 -1
  17. package/dist/application-spec/errors/diagnostic-messages.d.ts +5 -0
  18. package/dist/application-spec/errors/diagnostic-messages.js +1 -1
  19. package/dist/application-spec/generate-application/code/common/code-imports.js +1 -1
  20. package/dist/application-spec/generate-application/code/common/env-reader.js +2 -2
  21. package/dist/application-spec/generate-application/code/common/index.d.ts +1 -0
  22. package/dist/application-spec/generate-application/code/common/index.js +1 -1
  23. package/dist/application-spec/generate-application/code/common/single-quoted-string.d.ts +6 -0
  24. package/dist/application-spec/generate-application/code/common/single-quoted-string.js +1 -0
  25. package/dist/application-spec/generate-application/code/domain-runtime-files.js +1 -1
  26. package/dist/application-spec/generate-application/code/project-scaffolding.d.ts +10 -14
  27. package/dist/application-spec/generate-application/code/project-scaffolding.js +2 -2
  28. package/dist/application-spec/generate-application/code/templates/admin-config.js +3 -0
  29. package/dist/application-spec/generate-application/code/templates/common/format-property-key.d.ts +7 -0
  30. package/dist/application-spec/generate-application/code/templates/common/format-property-key.js +1 -0
  31. package/dist/application-spec/generate-application/code/templates/common/schema-to-type-string.js +3 -3
  32. package/dist/application-spec/generate-application/code/templates/domain-spec/generate-component-optics.d.ts +1 -1
  33. package/dist/application-spec/generate-application/code/templates/domain-spec/generate-component-optics.js +6 -6
  34. package/dist/application-spec/generate-application/code/templates/domain-spec/generate-presets.js +1 -1
  35. package/dist/application-spec/generate-application/code/templates/domain-spec/generate-resources.js +13 -13
  36. package/dist/application-spec/generate-application/code/templates/domain-spec/generate-states.d.ts +1 -1
  37. package/dist/application-spec/generate-application/code/templates/domain-spec/generate-states.js +2 -2
  38. package/dist/application-spec/generate-application/code/templates/eslint-config.d.ts +5 -0
  39. package/dist/application-spec/generate-application/code/templates/eslint-config.js +4 -5
  40. package/dist/application-spec/generate-application/code/templates/gitignore.js +1 -3
  41. package/dist/application-spec/generate-application/code/templates/globals.js +7 -4
  42. package/dist/application-spec/generate-application/code/templates/index.d.ts +2 -2
  43. package/dist/application-spec/generate-application/code/templates/index.js +1 -1
  44. package/dist/application-spec/generate-application/code/templates/lingui-rc.d.ts +5 -0
  45. package/dist/application-spec/generate-application/code/templates/lingui-rc.js +4 -4
  46. package/dist/application-spec/generate-application/code/templates/prettier-config.d.ts +5 -0
  47. package/dist/application-spec/generate-application/code/templates/prettier-config.js +4 -5
  48. package/dist/application-spec/generate-application/code/templates/skills/phoenix-cli-skill.js +1 -1
  49. package/dist/application-spec/generate-application/code/templates/skills/phoenix-create-configurator-skill.js +1 -1
  50. package/dist/application-spec/generate-application/code/templates/skills/phoenix-feedback-skill.js +5 -5
  51. package/dist/application-spec/generate-application/code/templates/skills/phoenix-review-skill.js +3 -3
  52. package/dist/application-spec/generate-application/code/templates/skills/phoenix-skill.js +1 -1
  53. package/dist/application-spec/generate-application/code/templates/skills/phoenix-variants-skill.js +2 -2
  54. package/dist/application-spec/generate-application/code/templates/skills/sdk-content.d.ts +13 -2
  55. package/dist/application-spec/generate-application/code/templates/skills/sdk-content.js +2 -2
  56. package/dist/application-spec/generate-application/code/templates/spec-code/collect-spec-code.d.ts +58 -0
  57. package/dist/application-spec/generate-application/code/templates/spec-code/collect-spec-code.js +1 -0
  58. package/dist/application-spec/generate-application/code/templates/spec-code/index.d.ts +2 -0
  59. package/dist/application-spec/generate-application/code/templates/spec-code/index.js +1 -0
  60. package/dist/application-spec/generate-application/code/templates/spec-code/spec-code.d.ts +18 -0
  61. package/dist/application-spec/generate-application/code/templates/spec-code/spec-code.js +41 -0
  62. package/dist/application-spec/generate-application/code/templates/spec-messages/index.d.ts +1 -0
  63. package/dist/application-spec/generate-application/code/templates/spec-messages/index.js +1 -0
  64. package/dist/application-spec/generate-application/code/templates/spec-messages/spec-messages.d.ts +20 -0
  65. package/dist/application-spec/generate-application/code/templates/spec-messages/spec-messages.js +6 -0
  66. package/dist/application-spec/generate-application/runtime/admin-runtime/admin-model-runtime.d.ts +6 -4
  67. package/dist/application-spec/generate-application/runtime/admin-runtime/admin-model-runtime.js +1 -1
  68. package/dist/application-spec/generate-application/runtime/admin-runtime/admin-runtime.d.ts +3 -2
  69. package/dist/application-spec/generate-application/runtime/admin-runtime/admin-runtime.js +1 -1
  70. package/dist/application-spec/generate-application/runtime/admin-runtime/states-runtime.d.ts +2 -2
  71. package/dist/application-spec/generate-application/runtime/application-runtime.d.ts +13 -6
  72. package/dist/application-spec/generate-application/runtime/application-runtime.js +1 -1
  73. package/dist/application-spec/generate-application/runtime/configurator-runtime/configurator-model-runtime.d.ts +6 -4
  74. package/dist/application-spec/generate-application/runtime/configurator-runtime/configurator-model-runtime.js +1 -1
  75. package/dist/application-spec/generate-application/runtime/configurator-runtime/configurator-runtime.d.ts +3 -2
  76. package/dist/application-spec/generate-application/runtime/configurator-runtime/configurator-runtime.js +1 -1
  77. package/dist/application-spec/generate-application/runtime/configurator-runtime/states-runtime.d.ts +2 -2
  78. package/dist/application-spec/generate-application/runtime/migrations/migration-runtime.d.ts +2 -2
  79. package/dist/application-spec/generate-application/runtime/sections/assistant-runtime.d.ts +2 -2
  80. package/dist/application-spec/generate-application/runtime/sections/build-sdk-optic.d.ts +2 -1
  81. package/dist/application-spec/generate-application/runtime/sections/build-sdk-optic.js +1 -1
  82. package/dist/application-spec/generate-application/runtime/sections/build-user-bound-optic.d.ts +2 -1
  83. package/dist/application-spec/generate-application/runtime/sections/build-user-bound-optic.js +1 -1
  84. package/dist/application-spec/generate-application/runtime/sections/component-optic.d.ts +3 -0
  85. package/dist/application-spec/generate-application/runtime/sections/component-optic.js +1 -1
  86. package/dist/application-spec/generate-application/runtime/sections/data-runtime.d.ts +4 -4
  87. package/dist/application-spec/generate-application/runtime/sections/expression-runtime.d.ts +7 -4
  88. package/dist/application-spec/generate-application/runtime/sections/expression-runtime.js +1 -1
  89. package/dist/application-spec/generate-application/runtime/sections/generate-memo-eval-plan-runtime.d.ts +9 -5
  90. package/dist/application-spec/generate-application/runtime/sections/generate-memo-eval-plan-runtime.js +1 -1
  91. package/dist/application-spec/generate-application/runtime/sections/reflection-constants-runtime.d.ts +3 -1
  92. package/dist/application-spec/generate-application/runtime/sections/reflection-constants-runtime.js +1 -1
  93. package/dist/application-spec/generate-application/runtime/sections/theme-runtime.d.ts +2 -2
  94. package/dist/application-spec/generate-application/runtime/sections/transformers-runtime.d.ts +3 -3
  95. package/dist/application-spec/generate-application/runtime/spec-code/index.d.ts +2 -0
  96. package/dist/application-spec/generate-application/runtime/spec-code/index.js +1 -0
  97. package/dist/application-spec/generate-application/runtime/spec-code/resolve-spec-code.d.ts +18 -0
  98. package/dist/application-spec/generate-application/runtime/spec-code/resolve-spec-code.js +1 -0
  99. package/dist/application-spec/generate-application/runtime/spec-code/spec-code-module.d.ts +17 -0
  100. package/dist/application-spec/generate-application/runtime/spec-code/spec-code-module.js +1 -0
  101. package/dist/application-spec/generate-application/runtime-spec/decode-runtime-spec.d.ts +9 -0
  102. package/dist/application-spec/generate-application/runtime-spec/decode-runtime-spec.js +1 -0
  103. package/dist/application-spec/generate-application/runtime-spec/encode-runtime-spec.d.ts +8 -0
  104. package/dist/application-spec/generate-application/runtime-spec/encode-runtime-spec.js +1 -0
  105. package/dist/application-spec/generate-application/runtime-spec/encoded-runtime-spec.d.ts +27 -0
  106. package/dist/application-spec/generate-application/runtime-spec/encoded-runtime-spec.js +1 -0
  107. package/dist/application-spec/generate-application/runtime-spec/index.d.ts +5 -0
  108. package/dist/application-spec/generate-application/runtime-spec/index.js +1 -0
  109. package/dist/application-spec/generate-application/runtime-spec/runtime-spec.d.ts +68 -0
  110. package/dist/application-spec/generate-application/runtime-spec/runtime-spec.js +1 -0
  111. package/dist/application-spec/generate-application/runtime-spec/spec-code-id.d.ts +40 -0
  112. package/dist/application-spec/generate-application/runtime-spec/spec-code-id.js +1 -0
  113. package/dist/application-spec/parse-application-files/categorize/categorize-files.d.ts +18 -0
  114. package/dist/application-spec/parse-application-files/categorize/categorize-files.js +1 -1
  115. package/dist/application-spec/parse-application-files/categorize/earlier-generated-editor-configs.d.ts +16 -0
  116. package/dist/application-spec/parse-application-files/categorize/earlier-generated-editor-configs.js +9 -0
  117. package/dist/application-spec/parse-application-files/raw-spec/parse-yaml-spec-file.js +1 -1
  118. package/dist/application-spec/parse-application-files/spec/application/admin-spec/admin-spec.js +1 -1
  119. package/dist/application-spec/parse-application-files/spec/application/configurator-spec/configurator-spec.js +1 -1
  120. package/dist/application-spec/parse-application-files/spec/common/index.d.ts +1 -0
  121. package/dist/application-spec/parse-application-files/spec/common/index.js +1 -1
  122. package/dist/application-spec/parse-application-files/spec/common/value-type/format-value-type.d.ts +3 -0
  123. package/dist/application-spec/parse-application-files/spec/common/value-type/format-value-type.js +1 -0
  124. package/dist/application-spec/parse-application-files/spec/common/value-type/index.d.ts +5 -0
  125. package/dist/application-spec/parse-application-files/spec/common/value-type/index.js +1 -0
  126. package/dist/application-spec/parse-application-files/spec/common/value-type/intersect-value-types.d.ts +6 -0
  127. package/dist/application-spec/parse-application-files/spec/common/value-type/intersect-value-types.js +1 -0
  128. package/dist/application-spec/parse-application-files/spec/common/value-type/is-assignable-value-type.d.ts +8 -0
  129. package/dist/application-spec/parse-application-files/spec/common/value-type/is-assignable-value-type.js +1 -0
  130. package/dist/application-spec/parse-application-files/spec/common/value-type/value-type-at.d.ts +10 -0
  131. package/dist/application-spec/parse-application-files/spec/common/value-type/value-type-at.js +1 -0
  132. package/dist/application-spec/parse-application-files/spec/common/value-type/value-type.d.ts +98 -0
  133. package/dist/application-spec/parse-application-files/spec/common/value-type/value-type.js +1 -0
  134. package/dist/application-spec/parse-application-files/spec/components/bindings/component-path.d.ts +13 -0
  135. package/dist/application-spec/parse-application-files/spec/components/bindings/component-path.js +1 -0
  136. package/dist/application-spec/parse-application-files/spec/components/bindings/index.d.ts +2 -0
  137. package/dist/application-spec/parse-application-files/spec/components/bindings/index.js +1 -1
  138. package/dist/application-spec/parse-application-files/spec/components/bindings/read-binding-type.d.ts +24 -0
  139. package/dist/application-spec/parse-application-files/spec/components/bindings/read-binding-type.js +1 -0
  140. package/dist/application-spec/parse-application-files/spec/components/component-state-type.d.ts +8 -0
  141. package/dist/application-spec/parse-application-files/spec/components/component-state-type.js +1 -0
  142. package/dist/application-spec/parse-application-files/spec/components/filter-criterion-types.d.ts +13 -0
  143. package/dist/application-spec/parse-application-files/spec/components/filter-criterion-types.js +1 -0
  144. package/dist/application-spec/parse-application-files/spec/components/static-entity-id.d.ts +14 -0
  145. package/dist/application-spec/parse-application-files/spec/components/static-entity-id.js +1 -0
  146. package/dist/application-spec/parse-application-files/spec/components/user-component-entry.d.ts +6 -0
  147. package/dist/application-spec/parse-application-files/spec/components/user-component-entry.js +1 -1
  148. package/dist/application-spec/parse-application-files/spec/components/user-components.d.ts +7 -4
  149. package/dist/application-spec/parse-application-files/spec/components/user-components.js +1 -1
  150. package/dist/application-spec/parse-application-files/spec/expressions/expression-read-types.d.ts +24 -0
  151. package/dist/application-spec/parse-application-files/spec/expressions/expression-read-types.js +1 -0
  152. package/dist/application-spec/parse-application-files/spec/expressions/expression-read.d.ts +13 -0
  153. package/dist/application-spec/parse-application-files/spec/expressions/expression-read.js +1 -0
  154. package/dist/application-spec/parse-application-files/spec/expressions/expression-value-type.d.ts +9 -0
  155. package/dist/application-spec/parse-application-files/spec/expressions/expression-value-type.js +1 -0
  156. package/dist/application-spec/parse-application-files/spec/expressions/expressions.d.ts +6 -2
  157. package/dist/application-spec/parse-application-files/spec/expressions/expressions.js +1 -1
  158. package/dist/application-spec/parse-application-files/spec/expressions/user-expressions.d.ts +3 -1
  159. package/dist/application-spec/parse-application-files/spec/expressions/user-expressions.js +1 -1
  160. package/dist/application-spec/parse-application-files/spec/invariants/invariants.d.ts +2 -2
  161. package/dist/application-spec/parse-application-files/spec/invariants/invariants.js +1 -1
  162. package/dist/application-spec/parse-application-files/spec/model/index.d.ts +1 -0
  163. package/dist/application-spec/parse-application-files/spec/model/index.js +1 -1
  164. package/dist/application-spec/parse-application-files/spec/model/model-type-resolution.d.ts +10 -0
  165. package/dist/application-spec/parse-application-files/spec/model/model-type-resolution.js +1 -0
  166. package/dist/client/phoenix-api.d.ts +367 -0
  167. package/dist/configurator/application-runtime/extensions/systems/assistant-system/assistant-system.d.ts +7 -1
  168. package/dist/configurator/application-runtime/extensions/systems/assistant-system/assistant-system.js +1 -1
  169. package/dist/configurator/application-runtime/extensions/systems/graphql-system/close-unclosed-braces.d.ts +12 -0
  170. package/dist/configurator/application-runtime/extensions/systems/graphql-system/close-unclosed-braces.js +1 -0
  171. package/dist/configurator/application-runtime/extensions/systems/graphql-system/graphql-system.d.ts +1 -1
  172. package/dist/configurator/application-runtime/extensions/systems/graphql-system/graphql-system.js +1 -1
  173. package/dist/configurator/configuration-not-found-page/ConfigurationNotFoundPageElement.d.ts +12 -0
  174. package/dist/configurator/configuration-not-found-page/ConfigurationNotFoundPageElement.js +1 -0
  175. package/dist/configurator/configuration-not-found-page/index.d.ts +1 -0
  176. package/dist/configurator/configuration-not-found-page/index.js +1 -0
  177. package/dist/configurator/pages/ConfiguratorNotFoundPage.js +1 -1
  178. package/dist/configurator/pages/DefaultConfiguratorLayout.d.ts +3 -2
  179. package/dist/configurator/pages/LoadedConfiguratorDetailPage.js +1 -1
  180. package/dist/configurator/pages/RootPage.js +1 -1
  181. package/dist/configurator/pages/default-configurator-elements.d.ts +3 -1
  182. package/dist/configurator/pages/default-configurator-elements.js +1 -1
  183. package/dist/configurator/pages/default-elements/built-in-entity-element.d.ts +10 -0
  184. package/dist/configurator/pages/default-elements/built-in-entity-element.js +1 -0
  185. package/dist/configurator/pages/default-elements/built-in-layout-element.d.ts +10 -0
  186. package/dist/configurator/pages/default-elements/built-in-layout-element.js +1 -0
  187. package/dist/configurator/pages/default-elements/domain-control-elements.d.ts +6 -0
  188. package/dist/configurator/pages/default-elements/domain-control-elements.js +1 -0
  189. package/dist/configurator/pages/default-elements/index.d.ts +4 -0
  190. package/dist/configurator/pages/default-elements/index.js +1 -0
  191. package/dist/configurator/pages/default-elements/recipe-panel-elements.d.ts +3 -0
  192. package/dist/configurator/pages/default-elements/recipe-panel-elements.js +1 -0
  193. package/dist/configurator/pages/default-elements/sidebar-footer-elements.d.ts +7 -0
  194. package/dist/configurator/pages/default-elements/sidebar-footer-elements.js +1 -0
  195. package/dist/configurator/pages/default-elements/toolbar-elements.d.ts +7 -0
  196. package/dist/configurator/pages/default-elements/toolbar-elements.js +1 -0
  197. package/dist/configurator/ui/assistant/AssistantMarkdown.d.ts +7 -2
  198. package/dist/configurator/ui/assistant/AssistantMarkdown.js +1 -1
  199. package/dist/configurator/ui/assistant/AssistantPanel.js +1 -1
  200. package/dist/configurator/ui/assistant/AssistantThread.js +1 -1
  201. package/dist/configurator/ui/assistant/entity-link/AssistantEntityLink.d.ts +1 -1
  202. package/dist/configurator/ui/assistant/entity-link/AssistantEntityLink.js +1 -1
  203. package/dist/configurator/ui/assistant/entity-link/entity-link-state.d.ts +1 -1
  204. package/dist/configurator/ui/assistant/entity-link/index.d.ts +0 -1
  205. package/dist/configurator/ui/assistant/entity-link/index.js +1 -1
  206. package/dist/configurator/ui/assistant/form/AssistantForm.d.ts +19 -0
  207. package/dist/configurator/ui/assistant/form/AssistantForm.js +1 -0
  208. package/dist/configurator/ui/assistant/form/built-in-form-registry.d.ts +10 -0
  209. package/dist/configurator/ui/assistant/form/built-in-form-registry.js +1 -0
  210. package/dist/configurator/ui/assistant/form/compose-answer.d.ts +11 -0
  211. package/dist/configurator/ui/assistant/form/compose-answer.js +1 -0
  212. package/dist/configurator/ui/assistant/form/describe-build-errors.d.ts +6 -0
  213. package/dist/configurator/ui/assistant/form/describe-build-errors.js +1 -0
  214. package/dist/configurator/ui/assistant/form/form-element-definition.d.ts +14 -0
  215. package/dist/configurator/ui/assistant/form/form-element-definition.js +1 -0
  216. package/dist/configurator/ui/assistant/form/form-model.d.ts +38 -0
  217. package/dist/configurator/ui/assistant/form/form-model.js +1 -0
  218. package/dist/configurator/ui/assistant/form/form-registry.d.ts +31 -0
  219. package/dist/configurator/ui/assistant/form/form-registry.js +8 -0
  220. package/dist/configurator/ui/assistant/form/form-state.d.ts +4 -0
  221. package/dist/configurator/ui/assistant/form/form-state.js +1 -0
  222. package/dist/configurator/ui/assistant/form/index.d.ts +2 -0
  223. package/dist/configurator/ui/assistant/form/index.js +1 -0
  224. package/dist/configurator/ui/assistant/form/parse-form-block.d.ts +9 -0
  225. package/dist/configurator/ui/assistant/form/parse-form-block.js +1 -0
  226. package/dist/configurator/ui/assistant/form/read-form-attributes.d.ts +13 -0
  227. package/dist/configurator/ui/assistant/form/read-form-attributes.js +1 -0
  228. package/dist/configurator/ui/assistant/form-elements/FormGroup.d.ts +3 -0
  229. package/dist/configurator/ui/assistant/form-elements/FormGroup.js +1 -0
  230. package/dist/configurator/ui/assistant/form-elements/FormOptions.d.ts +3 -0
  231. package/dist/configurator/ui/assistant/form-elements/FormOptions.js +1 -0
  232. package/dist/configurator/ui/assistant/form-elements/FormReply.d.ts +3 -0
  233. package/dist/configurator/ui/assistant/form-elements/FormReply.js +1 -0
  234. package/dist/configurator/ui/assistant/form-elements/FormText.d.ts +3 -0
  235. package/dist/configurator/ui/assistant/form-elements/FormText.js +1 -0
  236. package/dist/configurator/ui/assistant/form-elements/form-element-props.d.ts +34 -0
  237. package/dist/configurator/ui/assistant/form-elements/form-element-props.js +1 -0
  238. package/dist/configurator/ui/assistant/form-elements/index.d.ts +5 -0
  239. package/dist/configurator/ui/assistant/form-elements/index.js +1 -0
  240. package/dist/configurator/ui/assistant/reference-link/AssistantReferenceLink.d.ts +16 -0
  241. package/dist/configurator/ui/assistant/reference-link/AssistantReferenceLink.js +1 -0
  242. package/dist/configurator/ui/assistant/reference-link/assistant-link-target.d.ts +34 -0
  243. package/dist/configurator/ui/assistant/reference-link/assistant-link-target.js +1 -0
  244. package/dist/configurator/ui/assistant/reference-link/assistant-reference-details.d.ts +25 -0
  245. package/dist/configurator/ui/assistant/reference-link/assistant-reference-details.js +1 -0
  246. package/dist/configurator/ui/assistant/reference-link/index.d.ts +3 -0
  247. package/dist/configurator/ui/assistant/reference-link/index.js +1 -0
  248. package/dist/configurator/ui/assistant/reference-link/reference-styles.d.ts +12 -0
  249. package/dist/configurator/ui/assistant/reference-link/reference-styles.js +1 -0
  250. package/dist/configurator/ui/assistant/reference-link/use-assistant-reference-details.d.ts +8 -0
  251. package/dist/configurator/ui/assistant/reference-link/use-assistant-reference-details.js +1 -0
  252. package/dist/configurator/ui/assistant/resource-image/AssistantImage.d.ts +9 -0
  253. package/dist/configurator/ui/assistant/resource-image/AssistantImage.js +1 -0
  254. package/dist/configurator/ui/assistant/resource-image/index.d.ts +3 -0
  255. package/dist/configurator/ui/assistant/resource-image/index.js +1 -0
  256. package/dist/configurator/ui/assistant/resource-image/resource-path.d.ts +11 -0
  257. package/dist/configurator/ui/assistant/resource-image/resource-path.js +1 -0
  258. package/dist/configurator/ui/assistant/resource-image/use-resource-image-url.d.ts +5 -0
  259. package/dist/configurator/ui/assistant/resource-image/use-resource-image-url.js +1 -0
  260. package/dist/configurator/ui/assistant/streamed-markdown.d.ts +2 -0
  261. package/dist/configurator/ui/assistant/streamed-markdown.js +2 -2
  262. package/dist/configurator/ui/assistant/thread-items.d.ts +8 -1
  263. package/dist/configurator/ui/assistant/thread-items.js +1 -1
  264. package/dist/configurator/ui/assistant/use-follow-stream.js +1 -1
  265. package/dist/configurator/ui/configurator-layout/slots/services/InvariantViolations.js +1 -1
  266. package/dist/configurator/ui/configurator-layout/slots/services/Services.js +1 -1
  267. package/dist/configurator/ui/legacy/layout/common/SummaryReadLayout.js +1 -1
  268. package/dist/configurator/ui/legacy/layout/simple/SimpleOwnerLayout.js +1 -1
  269. package/dist/configurator/ui/legacy/layout/steps/StepsOwnerLayout.js +1 -1
  270. package/dist/configurator/ui/legacy/layout/tabs/TabsOwnerLayout.js +1 -1
  271. package/dist/configurator/ui/phoenix-layout-elements/LayoutCustomOwnerUi.d.ts +1 -0
  272. package/dist/configurator/ui/phoenix-layout-elements/LayoutCustomOwnerUi.js +1 -1
  273. package/dist/configurator/ui/phoenix-layout-elements/LayoutCustomReadUi.d.ts +1 -0
  274. package/dist/configurator/ui/phoenix-layout-elements/LayoutCustomReadUi.js +1 -1
  275. package/dist/configurator/ui/preset-layout/CategoryPresetUi.js +1 -1
  276. package/dist/configurator/ui/save-message-snackbars/SaveMessageSnackbars.d.ts +10 -0
  277. package/dist/configurator/ui/save-message-snackbars/SaveMessageSnackbars.js +1 -0
  278. package/dist/configurator/ui/save-message-snackbars/index.d.ts +1 -0
  279. package/dist/configurator/ui/save-message-snackbars/index.js +1 -0
  280. package/dist/docs/controls/select-child-entity/cardselect.mdx +1 -0
  281. package/dist/docs/fabs/basic.mdx +2 -2
  282. package/dist/docs/index.json +1 -1
  283. package/dist/docs/layouts/custom-layout.mdx +324 -15
  284. package/dist/docs/other-features/not-found-404.mdx +1 -1
  285. package/dist/docs/phoenix/clerk-sign-in.mdx +1 -1
  286. package/dist/docs/phoenix/components.mdx +6 -0
  287. package/dist/docs/phoenix/configurator-interface.mdx +35 -11
  288. package/dist/docs/phoenix/domain-model.mdx +2 -0
  289. package/dist/docs/phoenix/getting-started.mdx +5 -3
  290. package/dist/docs/phoenix/layout-slots.mdx +9 -9
  291. package/dist/docs/phoenix/localization.mdx +6 -2
  292. package/dist/docs/phoenix/migration-guide.mdx +12 -10
  293. package/dist/docs/phoenix/phoenix-cli.mdx +31 -16
  294. package/dist/docs/phoenix/project-structure.mdx +52 -30
  295. package/dist/docs/phoenix/quickstart.mdx +7 -7
  296. package/dist/docs/phoenix/sdk-builder-workflow.mdx +6 -6
  297. package/dist/docs/phoenix/testing.mdx +8 -0
  298. package/dist/domain/application/assistant/assistant-form-elements.d.ts +28 -0
  299. package/dist/domain/application/assistant/assistant-form-elements.js +1 -0
  300. package/dist/domain/application/assistant/generate-assistant-prompt.js +1 -1
  301. package/dist/domain/application/assistant/index.d.ts +2 -0
  302. package/dist/domain/application/assistant/index.js +1 -1
  303. package/dist/domain/application/assistant-recipe-groups.d.ts +3 -1
  304. package/dist/domain/core/schema/extended-schema-validator.js +1 -1
  305. package/dist/domain/domain-runtime/spec/module-checks/element-registration.d.ts +12 -11
  306. package/dist/domain/domain-runtime/spec/module-checks/element-registration.js +1 -1
  307. package/dist/domain/domain-runtime/spec/module-checks/index.d.ts +1 -1
  308. package/dist/domain/domain-runtime/spec/module-checks/index.js +1 -1
  309. package/dist/domain/domain-runtime/spec/selectors.js +1 -1
  310. package/dist/domain/system-components/child-entity-selection.js +1 -1
  311. package/dist/domain/system-components/common/scene-entity-control-schema.d.ts +3 -0
  312. package/dist/domain/system-components/common/scene-entity-control-schema.js +1 -1
  313. package/dist/editor/mocks/CreateMockYaml.js +2 -2
  314. package/dist/i18n/locales/cs/messages.js +1 -1
  315. package/dist/i18n/locales/da/messages.js +1 -1
  316. package/dist/i18n/locales/de/messages.js +1 -1
  317. package/dist/i18n/locales/de-AT/messages.js +1 -1
  318. package/dist/i18n/locales/en/messages.js +1 -1
  319. package/dist/i18n/locales/en-AU/messages.js +1 -1
  320. package/dist/i18n/locales/en-GB/messages.js +1 -1
  321. package/dist/i18n/locales/es/messages.js +1 -1
  322. package/dist/i18n/locales/fr/messages.js +1 -1
  323. package/dist/i18n/locales/hu/messages.js +1 -1
  324. package/dist/i18n/locales/it/messages.js +1 -1
  325. package/dist/i18n/locales/nl/messages.js +1 -1
  326. package/dist/i18n/locales/pl/messages.js +1 -1
  327. package/dist/i18n/locales/pt/messages.js +1 -1
  328. package/dist/i18n/locales/ro/messages.js +1 -1
  329. package/dist/i18n/locales/sk/messages.js +1 -1
  330. package/dist/i18n/locales/tr/messages.js +1 -1
  331. package/dist/legacy/domain-cli/utils/cache.d.ts +1 -1
  332. package/dist/legacy/domain-cli/utils/cache.js +1 -1
  333. package/dist/legacy/domain-spec/__generated/domain-schema.d.ts +79 -80
  334. package/dist/legacy/phoenix-cli/project-gen/generators/file-templates/frontend-admin.js +10 -11
  335. package/dist/legacy/phoenix-cli/project-gen/generators/file-templates/frontend-embedded-admin.js +9 -10
  336. package/dist/phoenix/application-spec/application-spec-builder.d.ts +0 -2
  337. package/dist/phoenix/application-spec/application-spec-builder.js +1 -1
  338. package/dist/phoenix/application-spec/generate-application-spec-project.d.ts +0 -2
  339. package/dist/phoenix/application-spec/generate-application-spec-project.js +2 -2
  340. package/dist/phoenix/application-spec/generate-application-spec-story.js +2 -2
  341. package/dist/phoenix/application-spec/generate-project-files.d.ts +0 -2
  342. package/dist/phoenix/application-spec/project-files.js +1 -1
  343. package/dist/phoenix/bin.d.ts +2 -0
  344. package/dist/phoenix/bin.js +2 -0
  345. package/dist/phoenix/check-configs/built-in-eslint-config.d.ts +9 -0
  346. package/dist/phoenix/check-configs/built-in-eslint-config.js +1 -0
  347. package/dist/phoenix/check-configs/eslint-config.d.ts +10 -0
  348. package/dist/phoenix/check-configs/eslint-config.js +1 -0
  349. package/dist/phoenix/check-configs/index.d.ts +8 -0
  350. package/dist/phoenix/check-configs/index.js +1 -0
  351. package/dist/phoenix/check-configs/typescript-project.d.ts +5 -0
  352. package/dist/phoenix/check-configs/typescript-project.js +1 -0
  353. package/dist/phoenix/cli.d.ts +0 -1
  354. package/dist/phoenix/cli.js +1 -2
  355. package/dist/phoenix/commands/build.js +1 -1
  356. package/dist/phoenix/commands/check.js +1 -1
  357. package/dist/phoenix/commands/clean.js +1 -1
  358. package/dist/phoenix/commands/deploy.js +2 -2
  359. package/dist/phoenix/commands/deps/deps.d.ts +22 -1
  360. package/dist/phoenix/commands/deps/deps.js +2 -2
  361. package/dist/phoenix/commands/deps/index.d.ts +1 -1
  362. package/dist/phoenix/commands/deps/index.js +1 -1
  363. package/dist/phoenix/commands/deps/sdk-manifest.js +1 -1
  364. package/dist/phoenix/commands/dev.js +4 -4
  365. package/dist/phoenix/commands/fix.js +1 -1
  366. package/dist/phoenix/commands/init.d.ts +17 -5
  367. package/dist/phoenix/commands/init.js +1 -1
  368. package/dist/phoenix/commands/link.js +1 -1
  369. package/dist/phoenix/commands/prettier.js +1 -1
  370. package/dist/phoenix/commands/sync.js +1 -1
  371. package/dist/phoenix/commands/unlink.js +1 -1
  372. package/dist/phoenix/services/application-spec-project-watcher.d.ts +0 -2
  373. package/dist/phoenix/services/application-spec-project-watcher.js +2 -2
  374. package/dist/phoenix/services/lingui.d.ts +8 -0
  375. package/dist/phoenix/services/lingui.js +1 -1
  376. package/dist/phoenix/services/swc.js +1 -1
  377. package/dist/phoenix/services/vite-config.js +1 -1
  378. package/dist/phoenix/utils/index.d.ts +3 -2
  379. package/dist/phoenix/utils/index.js +1 -1
  380. package/dist/phoenix/utils/node-version/index.d.ts +1 -0
  381. package/dist/phoenix/utils/node-version/index.js +1 -0
  382. package/dist/phoenix/utils/node-version/supported-node-version.d.ts +12 -0
  383. package/dist/phoenix/utils/node-version/supported-node-version.js +4 -0
  384. package/dist/phoenix/utils/package-info.d.ts +0 -9
  385. package/dist/phoenix/utils/package-info.js +1 -1
  386. package/dist/phoenix/utils/package-manager/index.d.ts +2 -0
  387. package/dist/phoenix/utils/package-manager/index.js +1 -0
  388. package/dist/phoenix/utils/package-manager/package-manager-commands.d.ts +19 -0
  389. package/dist/phoenix/utils/package-manager/package-manager-commands.js +1 -0
  390. package/dist/phoenix/utils/package-manager/pnpm-project.d.ts +9 -0
  391. package/dist/phoenix/utils/package-manager/pnpm-project.js +1 -0
  392. package/dist/phoenix/utils/run-command.d.ts +11 -0
  393. package/dist/phoenix/utils/run-command.js +1 -1
  394. package/dist/phoenix/utils/sdk-tool/index.d.ts +1 -0
  395. package/dist/phoenix/utils/sdk-tool/index.js +1 -0
  396. package/dist/phoenix/utils/sdk-tool/resolve-sdk-tool-bin.d.ts +15 -0
  397. package/dist/phoenix/utils/sdk-tool/resolve-sdk-tool-bin.js +1 -0
  398. package/dist/react-sdk/domain-application-context/DomainLifecycleBoundary.js +1 -1
  399. package/dist/react-sdk/domain-context/common-hooks/use-configurator-messages.d.ts +15 -4
  400. package/dist/react-sdk/domain-context/common-hooks/use-configurator-messages.js +1 -1
  401. package/dist/ui-sdk/theme/types.d.ts +1 -1
  402. package/package.json +16 -9
  403. package/schema/domain-spec.json +86 -8
  404. package/dist/application-spec/generate-application/code/templates/nvmrc.d.ts +0 -1
  405. package/dist/application-spec/generate-application/code/templates/nvmrc.js +0 -2
  406. package/dist/application-spec/generate-application/code/templates/package-json.d.ts +0 -10
  407. package/dist/application-spec/generate-application/code/templates/package-json.js +0 -1
  408. package/dist/configurator/ui/assistant/entity-link/entity-link-target.d.ts +0 -5
  409. package/dist/configurator/ui/assistant/entity-link/entity-link-target.js +0 -1
  410. package/dist/phoenix/commands/generate-project-files.d.ts +0 -6
  411. package/dist/phoenix/commands/generate-project-files.js +0 -1
@@ -0,0 +1,12 @@
1
+ import { type ConfigurationNotFoundPageProps } from '#package/react-sdk';
2
+ /**
3
+ * The name a project registers a layout element under to replace the page shown when a configuration
4
+ * cannot be loaded or opened. Its default, the built-in `ConfigurationNotFoundPage`, is registered in
5
+ * `defaultConfiguratorElements`.
6
+ */
7
+ export declare const ConfigurationNotFoundPageName = "ConfigurationNotFoundPage";
8
+ /**
9
+ * Renders the `ConfigurationNotFoundPage` element. `onBack` is passed only where leaving the page leads
10
+ * somewhere, which is the start of the configurator.
11
+ */
12
+ export declare const ConfigurationNotFoundPageElement: (props: ConfigurationNotFoundPageProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1 @@
1
+ import{jsx as o}from"react/jsx-runtime";import{PhoenixLayoutElement as t}from"#package/react-sdk";export const ConfigurationNotFoundPageName="ConfigurationNotFoundPage";export const ConfigurationNotFoundPageElement=n=>o(t,{name:"ConfigurationNotFoundPage",elementProps:{...n}});
@@ -0,0 +1 @@
1
+ export { ConfigurationNotFoundPageElement, ConfigurationNotFoundPageName } from './ConfigurationNotFoundPageElement.js';
@@ -0,0 +1 @@
1
+ export{ConfigurationNotFoundPageElement,ConfigurationNotFoundPageName}from"./ConfigurationNotFoundPageElement.js";
@@ -1 +1 @@
1
- import{jsx as o}from"react/jsx-runtime";import{ConfigurationNotFoundPage as r}from"#package/react-sdk";import{useConfiguratorRouting as t}from"../configurator-context/index.js";export const ConfiguratorNotFoundPage=()=>o(r,{onBack:t().goToIndex});
1
+ import{jsx as o}from"react/jsx-runtime";import{ConfigurationNotFoundPageElement as n}from"../configuration-not-found-page/index.js";import{useConfiguratorRouting as r}from"../configurator-context/index.js";export const ConfiguratorNotFoundPage=()=>o(n,{onBack:r().goToIndex});
@@ -1,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. `defaultConfiguratorElements` registers it as `ConfiguratorLayout`, and
4
- * `LoadedConfiguratorDetailPage` renders it when no layout element has that name.
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 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 y,useSpecAssistant as b}from"#package/react-sdk";import{useConfigurator as x}from"../application-runtime/index.js";import{IntegrationSubscription as E,OnConfiguratorReadyProvider as D,ViewportStateSync as L}from"../configurator-context/index.js";import{ConfiguratorNotFoundPage as M}from"./ConfiguratorNotFoundPage.js";import{DefaultConfiguratorLayout as F}from"./DefaultConfiguratorLayout.js";import{ConfiguratorLayoutName as S}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 V=i(()=>((()=>{let{assistantSystem:o}=x(),r=null!=b();t(()=>{if(r)return o.activate()},[o,r])})(),o(e,{children:o(D,{children:o(u,{name:S,defaultSlot:F})})})));export const LoadedConfiguratorDetailPage=()=>{h(d.SceneAssets);let{configurationId:e,accessInfo:i}=f(),t=g(),u=y(),b=w(),x=m(),{startConfiguratorLoad:D,completeConfiguratorLoad:F,failConfiguratorLoad:S,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(()=>{D()},[D]),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(S(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});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,S,b,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(M,{}):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(L,{}),o(V,{})]})})})})})};
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,{})]})})})})})};
@@ -1 +1 @@
1
- import{jsx as o}from"react/jsx-runtime";import{match as t}from"ts-pattern";import{SessionRole as r}from"@salsita-ai/contracts/api";import{ApplicationRoutes as e,ConfigurationNotFoundPage as i,NotAuthenticatedPage as a,useRoutingState as n,useSession as s,useSpecCanCreate as m}from"#package/react-sdk";import{ConfiguratorRoot as c}from"./ConfiguratorRoot.js";import{NewConfiguratorPage as u}from"./NewConfiguratorPage.js";export const RootPage=()=>{let f=m(),p=n(),{sessionPayload:g}=s(),d=g?.role??r.Anonymous,x=f.includes(d);return t(p).with({route:e.Index},()=>x?o(u,{}):d===r.Anonymous?o(a,{}):o(i,{})).with({route:e.Configuration},t=>o(c,{configurationId:t.configurationId,accessToken:t.accessToken})).exhaustive()};
1
+ import{jsx as o}from"react/jsx-runtime";import{match as t}from"ts-pattern";import{SessionRole as r}from"@salsita-ai/contracts/api";import{ApplicationRoutes as i,NotAuthenticatedPage as n,useRoutingState as e,useSession as a,useSpecCanCreate as s}from"#package/react-sdk";import{ConfigurationNotFoundPageElement as m}from"../configuration-not-found-page/index.js";import{ConfiguratorRoot as u}from"./ConfiguratorRoot.js";import{NewConfiguratorPage as c}from"./NewConfiguratorPage.js";export const RootPage=()=>{let f=s(),p=e(),{sessionPayload:g}=a(),d=g?.role??r.Anonymous,x=f.includes(d);return t(p).with({route:i.Index},()=>x?o(c,{}):d===r.Anonymous?o(n,{}):o(m,{})).with({route:i.Configuration},t=>o(u,{configurationId:t.configurationId,accessToken:t.accessToken})).exhaustive()};
@@ -2,6 +2,8 @@ import { type ElementRegistration } from '#package/domain';
2
2
  /**
3
3
  * The configurator's default element registrations, passed to `withDefaultElements`. A project
4
4
  * element registered under the same name replaces one: `ConfiguratorLayout` is the built-in UI of a
5
- * loaded configuration.
5
+ * loaded configuration, `ConfigurationNotFoundPage` the page shown when a configuration cannot be
6
+ * loaded or opened, and the others are the built-in controls, toolbar buttons, menu actions and
7
+ * sidebar-footer pieces under the spec kinds that YAML names.
6
8
  */
7
9
  export declare const defaultConfiguratorElements: readonly ElementRegistration[];
@@ -1 +1 @@
1
- import{createCustomPhoenixLayoutElement as o}from"#package/domain";import{DefaultConfiguratorLayout as r}from"./DefaultConfiguratorLayout.js";import{ConfiguratorLayoutName as t}from"./configurator-layout-name.js";export const defaultConfiguratorElements=[o(t,r)];
1
+ import{createCustomPhoenixLayoutElement as o}from"#package/domain";import{ConfigurationNotFoundPage as r}from"#package/react-sdk";import{ConfigurationNotFoundPageName as t}from"../configuration-not-found-page/index.js";import{DefaultConfiguratorLayout as a}from"./DefaultConfiguratorLayout.js";import{ConfiguratorLayoutName as e}from"./configurator-layout-name.js";import{domainControlElements as m,recipePanelElements as f,sidebarFooterElements as i,toolbarElements as n}from"./default-elements/index.js";export const defaultConfiguratorElements=[o(e,a),o(t,r),...m,...f,...n,...i];
@@ -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
+ * element's module exports. 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
+ * element's module exports. 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)];
@@ -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, images, 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{AssistantImage as f}from"./resource-image/index.js";import{completeStreamedMarkdown as h,hasOpenFence as k}from"./streamed-markdown.js";import{AssistantPanelName as b}from"./theme.js";let v=n("div",{name:b,slot:"assistantMessage"})(({theme:{palette:e,shape:r,spacing:n,typography:i}})=>({overflowWrap:"anywhere","& > :first-child":{marginBlockStart:0},"& > :last-child":{marginBlockEnd:0},"p, ul, ol, pre, blockquote":{marginBlock:n(1)},"h1, h2, h3, h4, h5, h6":{...i.subtitle2,marginBlock:n(1.5,.5)},"ul, ol":{paddingInlineStart:n(2.5)},a:{color:e.primary.main},code:{background:e.action.hover,borderRadius:r.borderRadius/2,fontFamily:"ui-monospace, Menlo, monospace",fontSize:"0.9em",paddingInline:n(.5)},pre:{background:e.action.hover,borderRadius:r.borderRadius,overflowX:"auto",padding:n(1),code:{background:"none",padding:0}},blockquote:{borderInlineStart:`2px solid ${e.divider}`,color:e.text.secondary,marginInline:0,paddingInlineStart:n(1.5)},"th, td":{borderBlockEnd:`1px solid ${e.divider}`,padding:n(.5,1),textAlign:"start",verticalAlign:"top"}})),x=n("div")({overflowX:"auto",table:{borderCollapse:"collapse",inlineSize:"100%"}}),y=i({forms:"hidden",openFenceEnd:void 0,isStreaming:!1}),j=({source:r,end:n})=>{let{forms:i,openFenceEnd:o,isStreaming:l}=t(y);return"hidden"===i?null:null!=n&&n===o?l?e(c,{source:r,status:"writing"}):null:e(c,{source:r,status:"disabled"===i?"waiting":"ready"})},w={a:({node:n,children:i,href:o,...t})=>{if(null==o||!p(o))return e("a",{...t,href:o,target:"_blank",rel:"noopener noreferrer",children:i});let l=g(o);return null==l?e(r,{children:i}):"entity"===l.kind?e(s,{id:l.id,children:i}):e(u,{target:l,children:i})},img:({src:r,alt:n})=>e(f,{src:r,alt:n}),pre:({node:r,children:n,...i})=>{let o=(e=>{let[r]=e?.children??[];if(r?.type!=="element"||"code"!==r.tagName)return;let{className:n}=r.properties;if(Array.isArray(n)&&n.includes("language-form"))return r.children.map(e=>"text"===e.type?e.value:"").join("")})(r);return null==o?e("pre",{...i,children:n}):e(j,{source:o,end:r?.position?.end.offset})},table:({node:r,children:n,...i})=>e(x,{children:e("table",{...i,children:n})})},S=[m],A=e=>p(e)?e:d(e);export const AssistantMarkdown=o(({markdown:r,isStreaming:n,forms:i})=>{let o=n?h(r):r,t=k(r)?o.length:void 0,d=l(()=>({forms:i,openFenceEnd:t,isStreaming:n}),[i,t,n]);return e(v,{children:e(y.Provider,{value:d,children:e(a,{components:w,remarkPlugins:S,urlTransform:A,children:o})})})});
@@ -1 +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 b}from"./use-follow-stream.js";let w=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"})),T=s("div",{name:k,slot:"greeting"})({}),C=s("div",{name:k,slot:"status"})(({theme:{palette:e,typography:a}})=>({...a.caption,color:e.text.secondary})),S=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}})),j=s(t,{name:k,slot:"earlierButton"})({alignSelf:"center"}),I=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)})),B=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}})),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})=>e(h,{markdown:a,isStreaming:i})).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:k,isResuming:y,earlierThreads:S}=c,A=l(s.undoTipToolCallId$),R=k?void 0:A,{items:L,isThinking:z}=n(()=>v(h,k),[h,k]),$=n(()=>f(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, select, textarea, [role="button"]')||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&&!k&&!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:k&&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"})})]})};
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});
@@ -0,0 +1,11 @@
1
+ import type { BuiltFormModel } from './form-model.js';
2
+ import type { FormAnswers, FormState } from './form-state.js';
3
+ /** Stands for anything left unanswered, so every question keeps its line. */
4
+ export declare const FORM_PLACEHOLDER = "\u2014";
5
+ /**
6
+ * The user's answer to a form, sent as their message: one line per labelled container or input as
7
+ * `Label: value`, a bare line for an unlabelled one, two spaces of indentation per labelled
8
+ * container, and the placeholder for anything unanswered. Unlabelled groups are flattened into
9
+ * their parent, and a picked option answers with its value, or its label without one.
10
+ */
11
+ export declare const composeAnswer: (model: BuiltFormModel, state: FormState, answers: FormAnswers) => string;
@@ -0,0 +1 @@
1
+ import{match as t}from"ts-pattern";export const FORM_PLACEHOLDER="—";let e=(t,e)=>`${" ".repeat(t)}${e}`,n=(t,e)=>null==t?e:`${t}: ${e}`,r=({value:t,label:e})=>t??e??"",i=({children:t},{state:e})=>t.filter(({id:t})=>!0===e.get(t)).map(r),o=(r,l,p)=>{let{label:h}=r;return t(r.definition.role).with("group",()=>{if(null==h)return r.children.flatMap(t=>o(t,l,p));let t=r.children.flatMap(t=>o(t,l+1,p));return t.length>0?[e(l,`${h}:`),...t]:[e(l,`${h}: —`)]}).with("choice",()=>[e(l,n(h,i(r,p)[0]??"—"))]).with("choices",()=>{let t=i(r,p);return 0===t.length?[e(l,n(h,"—"))]:null==h?t.map(t=>e(l,t)):[e(l,`${h}:`),...t.map(t=>e(l+1,t))]}).with("input",()=>[e(l,n(h,(({id:t,value:e},{answers:n})=>n.has(t)?n.get(t):""===e?void 0:e)(r,p)??"—"))]).with("option",()=>[]).exhaustive()};export const composeAnswer=(t,e,n)=>o(t.root,0,{state:e,answers:n}).join("\n");
@@ -0,0 +1,6 @@
1
+ import type { FormBuildError } from './form-model.js';
2
+ /**
3
+ * The message Fix it sends for a form that could not be built: every error, with the element named
4
+ * by its tag and its label or its position, then the request to write the form again.
5
+ */
6
+ export declare const describeBuildErrors: (errors: readonly FormBuildError[]) => string;
@@ -0,0 +1 @@
1
+ export const describeBuildErrors=e=>["Your form could not be built:",...e.map(e=>`- ${(({element:e,label:l,position:n})=>null==l?`<${e}> (element ${n})`:`<${e} label="${l}">`)(e)}: ${e.message}.`),"Send it again."].join("\n");
@@ -0,0 +1,14 @@
1
+ import type { ComponentType } from 'react';
2
+ import type { AssistantFormElementDescriptor } from '#package/domain';
3
+ import type { FormContainerProps, FormInputProps, FormOptionProps } from '../form-elements/index.js';
4
+ /** An element a form can render: what the prompt knows of it, and the component that renders it for its role. */
5
+ export type FormElementDefinition = (AssistantFormElementDescriptor & {
6
+ readonly role: 'group' | 'choice' | 'choices';
7
+ readonly component: ComponentType<FormContainerProps>;
8
+ }) | (AssistantFormElementDescriptor & {
9
+ readonly role: 'option';
10
+ readonly component: ComponentType<FormOptionProps>;
11
+ }) | (AssistantFormElementDescriptor & {
12
+ readonly role: 'input';
13
+ readonly component: ComponentType<FormInputProps>;
14
+ });
@@ -0,0 +1,38 @@
1
+ import type { FormElementDefinition } from './form-element-definition.js';
2
+ /**
3
+ * An element of a parsed form. Options outside a `choice` or `choices` are already wrapped in an
4
+ * implicit container, and the top level of the block is an implicit group without a label.
5
+ */
6
+ export interface FormNode {
7
+ /** Unique within its block: the element's position in the markup, or what an implicit container wraps. */
8
+ readonly id: string;
9
+ readonly definition: FormElementDefinition;
10
+ readonly label?: string;
11
+ readonly value?: string;
12
+ readonly attributes: Readonly<Record<string, unknown>>;
13
+ readonly children: readonly FormNode[];
14
+ }
15
+ /** Why an element made its block unbuildable, named by its tag and its label or its position in the block. */
16
+ export interface FormBuildError {
17
+ readonly element: string;
18
+ readonly label?: string;
19
+ /** The element's place in the block, counting elements in document order from 1. */
20
+ readonly position: number;
21
+ readonly message: string;
22
+ }
23
+ /**
24
+ * A form fence as the panel renders it, or every reason it cannot. A quick form asks one question:
25
+ * the first pick sends it, and it has no submit button.
26
+ */
27
+ export type FormModel = {
28
+ readonly ok: true;
29
+ readonly root: FormNode;
30
+ readonly isQuick: boolean;
31
+ } | {
32
+ readonly ok: false;
33
+ readonly errors: readonly FormBuildError[];
34
+ };
35
+ /** A form that could be built. */
36
+ export type BuiltFormModel = Extract<FormModel, {
37
+ readonly ok: true;
38
+ }>;
@@ -0,0 +1 @@
1
+ export{};
@@ -0,0 +1,31 @@
1
+ import type { AssistantFormAttribute, PhxValidateFunction, SchemaValidator } from '#package/domain';
2
+ import type { FormElementDefinition } from './form-element-definition.js';
3
+ /** A declared attribute of a form element with the validator of its coerced value. */
4
+ export interface RegisteredFormAttribute {
5
+ readonly attribute: AssistantFormAttribute;
6
+ readonly validate: PhxValidateFunction;
7
+ }
8
+ /** A form element with its declared attributes, the built-in `label` and `value` included. */
9
+ export interface RegisteredFormElement {
10
+ readonly definition: FormElementDefinition;
11
+ readonly attributes: ReadonlyMap<string, RegisteredFormAttribute>;
12
+ }
13
+ /** The elements forms can use, and the containers a form puts around what the model left implicit. */
14
+ export interface FormRegistry {
15
+ /** The container of a block's top level. */
16
+ readonly group: RegisteredFormElement;
17
+ /** The container of options that are a block's only content. */
18
+ readonly choice: RegisteredFormElement;
19
+ /** The container of a run of options outside any choice. */
20
+ readonly choices: RegisteredFormElement;
21
+ get(name: string): RegisteredFormElement | undefined;
22
+ }
23
+ /** What a registry is built with: the shared validator, which follows the project's CSP switch. */
24
+ export interface FormRegistryContext {
25
+ readonly schemaValidator: SchemaValidator;
26
+ }
27
+ /**
28
+ * Compiles a validator for every declared attribute of the given elements, each its own small
29
+ * schema, so every failing attribute is reported whichever validator the project uses.
30
+ */
31
+ export declare const createFormRegistry: (definitions: readonly FormElementDefinition[], { schemaValidator }: FormRegistryContext) => FormRegistry;
@@ -0,0 +1,8 @@
1
+ let e=new Set(`a abbr acronym address applet area article aside audio b base basefont bdi bdo big blink blockquote body br
2
+ button canvas caption center cite code col colgroup data datalist dd del details dfn dialog dir div dl dt em
3
+ embed fieldset figcaption figure font footer form frame frameset h1 h2 h3 h4 h5 h6 head header hgroup hr html
4
+ i iframe image img input ins kbd keygen label legend li link main map mark marquee math menu menuitem meta
5
+ meter nav nobr noembed noframes noscript object ol optgroup option output p param picture plaintext pre
6
+ progress q rb rp rt rtc ruby s samp script search section select slot small source span strike strong style
7
+ sub summary sup svg table tbody td template textarea tfoot th thead time title tr track tt u ul var video wbr
8
+ xmp`.split(/\s+/)),t=/^[a-z][a-z0-9-]*$/,r={type:"string"},a=({role:e,attributes:t})=>Object.entries({label:r,..."option"===e||"input"===e?{value:r}:{},...t}),o=(e,t)=>{let r=e.get(t);if(r?.definition.role!==t)throw Error(`The form registry has no "${t}" element with the role "${t}". Forms wrap implicit content in it. Register the built-in "${t}".`);return r};export const createFormRegistry=(r,{schemaValidator:n})=>{let i=new Map;for(let o of r){if(!t.test(o.name)||e.has(o.name))throw Error(`The form element "${o.name}" cannot be registered: its name must be lowercase and must not be an HTML element name, so form markup is never read as HTML. Rename the element.`);if(i.has(o.name))throw Error(`The form element "${o.name}" is registered twice. Each tag names one element. Remove or rename one of them.`);let r=new Map(a(o).map(([e,t])=>[e,{attribute:t,validate:n.compile({type:t.type,...t.enum?{enum:t.enum}:{}})}]));i.set(o.name,{definition:o,attributes:r})}return{group:o(i,"group"),choice:o(i,"choice"),choices:o(i,"choices"),get:e=>i.get(e)}};
@@ -0,0 +1,4 @@
1
+ /** What the user did in a form, by node id: `true` for a picked option, the input's own state for an input. */
2
+ export type FormState = ReadonlyMap<string, unknown>;
3
+ /** The answer text each input reported, by node id; an input that never reported is missing. */
4
+ export type FormAnswers = ReadonlyMap<string, string | undefined>;
@@ -0,0 +1 @@
1
+ export{};
@@ -0,0 +1,2 @@
1
+ export { AssistantForm } from './AssistantForm.js';
2
+ export type { AssistantFormStatus } from './AssistantForm.js';
@@ -0,0 +1 @@
1
+ export{AssistantForm}from"./AssistantForm.js";
@@ -0,0 +1,9 @@
1
+ import type { FormModel } from './form-model.js';
2
+ import type { FormRegistry } from './form-registry.js';
3
+ /**
4
+ * Builds a form from the markup of a ```` ```form ```` fence. A block whose only content is loose
5
+ * options asks one question, so they form an implicit `choice`; elsewhere loose options form an
6
+ * implicit `choices`. A block with any unknown element, invalid attribute or misplaced element is
7
+ * not built at all, and every such error is returned.
8
+ */
9
+ export declare const parseFormBlock: (source: string, registry: FormRegistry) => FormModel;
@@ -0,0 +1 @@
1
+ import{Parser as e}from"htmlparser2";import{readFormAttributes as o}from"./read-form-attributes.js";let r=({name:e,attributes:o,position:r})=>({element:e,label:o.label,position:r}),t=({definition:e},o,r)=>({id:o,definition:e,attributes:{},children:r}),i=(e,o)=>{let r=[],i=[],n=()=>{i.length>0&&(r.push(t(o.registry.choices,`choices-${i[0]?.id}`,i)),i=[])};for(let o of e)"option"===o.definition.role?i.push(o):(n(),r.push(o));return n(),r},n=(e,t,l)=>e.flatMap(e=>((e,t,l)=>{var s;let a=l.registry.get(e.name);if(!a){l.errors.push({...r(e),message:"not a form element"}),n(e.children,void 0,l);return}let{definition:h}=a,p=(s=h.role,t?.role==="option"||t?.role==="input"?`cannot be inside <${t.name}>, which holds no elements`:(t?.role==="choice"||t?.role==="choices")&&"option"!==s?`cannot be inside <${t.name}>, which holds only options`:void 0);p&&l.errors.push({...r(e),message:p});let{attributes:c,errors:u}=o(a,e.attributes);for(let o of u)l.errors.push({...r(e),message:o});let{label:d,value:g,...m}=c,f=n(e.children,{name:e.name,role:h.role},l);return{id:String(e.position),definition:h,label:"string"==typeof d?d:void 0,value:"string"==typeof g?g:void 0,attributes:m,children:"group"===h.role?i(f,l):f}})(e,t,l)??[]),l=e=>{if("choice"===e.definition.role)return!0;let[o,...r]=e.children;return"group"===e.definition.role&&null!=o&&0===r.length&&l(o)};export const parseFormBlock=(o,r)=>{let s,a,h,p,c={registry:r,errors:[]},u={name:r.group.definition.name,role:"group"},d=n((a=[s=[]],h=0,(p=new e({onopentag:(e,o)=>{let r={name:e,attributes:o,position:h+=1,children:[]};a.at(-1)?.push(r),a.push(r.children)},onclosetag:()=>{a.length>1&&a.pop()}},{xmlMode:!0,lowerCaseTags:!0,lowerCaseAttributeNames:!0,recognizeSelfClosing:!0})).write(o),p.end(),s),u,c);if(c.errors.length>0)return{ok:!1,errors:c.errors};let g=d.length>0&&d.every(e=>"option"===e.definition.role)?[t(r.choice,"choice",d)]:i(d,c),m=t(r.group,"root",g);return{ok:!0,root:m,isQuick:l(m)}};
@@ -0,0 +1,13 @@
1
+ import type { RegisteredFormElement } from './form-registry.js';
2
+ /** The attributes of an element converted to their declared types, and what was wrong with them. */
3
+ export interface FormAttributesReading {
4
+ readonly attributes: Readonly<Record<string, unknown>>;
5
+ /** Each problem worded to follow the element's tag, e.g. `the attribute "step" must be an integer`. */
6
+ readonly errors: readonly string[];
7
+ }
8
+ /**
9
+ * Reads the attributes of an element against its declarations. Undeclared and missing required
10
+ * attributes are found by name; each declared one is coerced and checked by its own validator, and
11
+ * the error is worded from the declaration, never from the validator, whose errors differ by mode.
12
+ */
13
+ export declare const readFormAttributes: ({ definition, attributes: declared }: RegisteredFormElement, markup: Readonly<Record<string, string>>) => FormAttributesReading;
@@ -0,0 +1 @@
1
+ import{match as t}from"ts-pattern";let e=t=>{if(""===t.trim())return;let e=Number(t);return Number.isFinite(e)?e:void 0},r=(r,{type:i})=>t(i).with("string",()=>r).with("number",()=>e(r)??r).with("integer",()=>{let t=e(r);return null!=t&&Number.isInteger(t)?t:r}).with("boolean",()=>""===r||"true"===r||"false"!==r&&r).exhaustive(),i={string:"a string",number:"a number",integer:"an integer",boolean:"true or false"},u=(t,{type:e,enum:r})=>r?`the attribute "${t}" must be one of ${r.map(t=>`"${t}"`).join(", ")}`:`the attribute "${t}" must be ${i[e]}`;export const readFormAttributes=({definition:t,attributes:e},i)=>{let n={},a=[];for(let[t,o]of Object.entries(i)){let i=e.get(t);if(!i){a.push(`the attribute "${t}" is not declared`);continue}let s=r(o,i.attribute);i.validate(s)?n[t]=s:a.push(u(t,i.attribute))}for(let e of t.required??[])e in i||a.push(`the attribute "${e}" is required`);return{attributes:n,errors:a}};
@@ -0,0 +1,3 @@
1
+ import type { FormContainerProps } from './form-element-props.js';
2
+ /** A `group`: its children stacked under its label, which heads them. */
3
+ export declare const FormGroup: ({ label, children }: FormContainerProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1 @@
1
+ import{jsx as r,jsxs as e}from"react/jsx-runtime";import{styled as o}from"@mui/material";import{AssistantPanelName as m}from"../theme.js";let t=o("div",{name:m,slot:"formGroup"})(({theme:{spacing:r}})=>({display:"flex",flexDirection:"column",gap:r(1.5)})),i=o("div",{name:m,slot:"formGroupLabel"})(({theme:{palette:r,typography:e}})=>({...e.subtitle2,color:r.text.primary}));export const FormGroup=({label:o,children:m})=>e(t,{role:"group","aria-label":o,children:[null!=o&&r(i,{"aria-hidden":!0,children:o}),m]});
@@ -0,0 +1,3 @@
1
+ import type { FormContainerProps } from './form-element-props.js';
2
+ /** A `choice` or `choices`: its options in a wrapping row under its label. */
3
+ export declare const FormOptions: ({ label, children }: FormContainerProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1 @@
1
+ import{jsx as e,jsxs as o}from"react/jsx-runtime";import{styled as r}from"@mui/material";import{AssistantPanelName as i}from"../theme.js";let t=r("div",{name:i,slot:"formOptions"})(({theme:{spacing:e}})=>({display:"grid",gap:e(.75)})),a=r("div",{name:i,slot:"formOptionsLabel"})(({theme:{palette:e,typography:o}})=>({...o.caption,color:e.text.secondary})),m=r("div",{name:i,slot:"formOptionsRow"})(({theme:{spacing:e}})=>({display:"flex",flexWrap:"wrap",gap:e(.75)}));export const FormOptions=({label:r,children:i})=>o(t,{role:"group","aria-label":r,children:[null!=r&&e(a,{"aria-hidden":!0,children:r}),e(m,{children:i})]});