@salsita-ai/sdk 0.50.0-develop.a4dde5f252 → 0.50.0-develop.a9ee99dc86

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 (1061) hide show
  1. package/README.md +19 -14
  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/core/components/component-filter.d.ts +53 -0
  16. package/dist/application-spec/core/components/component-filter.js +1 -0
  17. package/dist/application-spec/core/components/index.d.ts +2 -0
  18. package/dist/application-spec/core/components/index.js +1 -0
  19. package/dist/application-spec/core/components/sdk-code-ref.d.ts +9 -0
  20. package/dist/application-spec/core/components/sdk-code-ref.js +1 -0
  21. package/dist/application-spec/core/enhanced-json-value.d.ts +0 -68
  22. package/dist/application-spec/core/enhanced-json-value.js +1 -1
  23. package/dist/application-spec/core/expressions/index.d.ts +2 -0
  24. package/dist/application-spec/core/expressions/index.js +1 -0
  25. package/dist/application-spec/core/expressions/relation-expression-params.d.ts +11 -0
  26. package/dist/application-spec/core/expressions/sdk-expression-implementation.d.ts +24 -0
  27. package/dist/application-spec/core/expressions/sdk-expression-implementation.js +1 -0
  28. package/dist/application-spec/core/index.d.ts +2 -0
  29. package/dist/application-spec/core/index.js +1 -1
  30. package/dist/application-spec/core/json-value.d.ts +1 -1
  31. package/dist/application-spec/{core → enhanced-json}/eval-to-constant.d.ts +1 -1
  32. package/dist/application-spec/enhanced-json/index.d.ts +4 -0
  33. package/dist/application-spec/enhanced-json/index.js +1 -0
  34. package/dist/application-spec/enhanced-json/is-enhanced-json-array.d.ts +2 -0
  35. package/dist/application-spec/enhanced-json/is-enhanced-json-array.js +1 -0
  36. package/dist/application-spec/enhanced-json/resolve-enhanced-json-value.d.ts +18 -0
  37. package/dist/application-spec/enhanced-json/resolve-enhanced-json-value.js +1 -0
  38. package/dist/application-spec/enhanced-json/schema-from-value.d.ts +24 -0
  39. package/dist/application-spec/enhanced-json/schema-from-value.js +1 -0
  40. package/dist/application-spec/enhanced-json/stringify-enhanced-json-value.d.ts +14 -0
  41. package/dist/application-spec/enhanced-json/stringify-enhanced-json-value.js +1 -0
  42. package/dist/application-spec/enhanced-json/validate-enhanced-json-value-caps.d.ts +12 -0
  43. package/dist/application-spec/enhanced-json/validate-enhanced-json-value-caps.js +1 -0
  44. package/dist/application-spec/enhanced-json/validate-no-legacy-code-ref.d.ts +13 -0
  45. package/dist/application-spec/enhanced-json/validate-no-legacy-code-ref.js +1 -0
  46. package/dist/application-spec/errors/diagnostic-codes.d.ts +14 -0
  47. package/dist/application-spec/errors/diagnostic-codes.js +1 -1
  48. package/dist/application-spec/errors/diagnostic-messages.d.ts +17 -0
  49. package/dist/application-spec/errors/diagnostic-messages.js +1 -1
  50. package/dist/application-spec/generate-application/code/common/code-imports.js +1 -1
  51. package/dist/application-spec/generate-application/code/common/env-reader.js +2 -2
  52. package/dist/application-spec/generate-application/code/common/index.d.ts +1 -0
  53. package/dist/application-spec/generate-application/code/common/index.js +1 -1
  54. package/dist/application-spec/generate-application/code/common/single-quoted-string.d.ts +6 -0
  55. package/dist/application-spec/generate-application/code/common/single-quoted-string.js +1 -0
  56. package/dist/application-spec/generate-application/code/domain-runtime-files.js +1 -1
  57. package/dist/application-spec/generate-application/code/generate-application-code.d.ts +3 -2
  58. package/dist/application-spec/generate-application/code/generate-application-code.js +1 -1
  59. package/dist/application-spec/generate-application/code/project-scaffolding.d.ts +22 -14
  60. package/dist/application-spec/generate-application/code/project-scaffolding.js +2 -2
  61. package/dist/application-spec/generate-application/code/standalone-app-files.d.ts +2 -2
  62. package/dist/application-spec/generate-application/code/standalone-app-files.js +1 -1
  63. package/dist/application-spec/generate-application/code/story-files.js +1 -1
  64. package/dist/application-spec/generate-application/code/templates/admin-config.js +3 -0
  65. package/dist/application-spec/generate-application/code/templates/common/format-property-key.d.ts +7 -0
  66. package/dist/application-spec/generate-application/code/templates/common/format-property-key.js +1 -0
  67. package/dist/application-spec/generate-application/code/templates/common/schema-to-type-string.js +3 -3
  68. package/dist/application-spec/generate-application/code/templates/configurator-config.js +6 -4
  69. package/dist/application-spec/generate-application/code/templates/domain-spec/factory-types/domain-factory-types.d.ts +35 -0
  70. package/dist/application-spec/generate-application/code/templates/domain-spec/factory-types/domain-factory-types.js +5 -0
  71. package/dist/application-spec/generate-application/code/templates/domain-spec/factory-types/index.d.ts +1 -0
  72. package/dist/application-spec/generate-application/code/templates/domain-spec/factory-types/index.js +1 -0
  73. package/dist/application-spec/generate-application/code/templates/domain-spec/generate-component-optics.d.ts +1 -1
  74. package/dist/application-spec/generate-application/code/templates/domain-spec/generate-component-optics.js +7 -7
  75. package/dist/application-spec/generate-application/code/templates/domain-spec/generate-defaults.d.ts +4 -2
  76. package/dist/application-spec/generate-application/code/templates/domain-spec/generate-defaults.js +1 -1
  77. package/dist/application-spec/generate-application/code/templates/domain-spec/generate-domain-block.js +69 -73
  78. package/dist/application-spec/generate-application/code/templates/domain-spec/generate-invariants.d.ts +8 -0
  79. package/dist/application-spec/generate-application/code/templates/domain-spec/generate-invariants.js +1 -1
  80. package/dist/application-spec/generate-application/code/templates/domain-spec/generate-phx-globals.js +3 -0
  81. package/dist/application-spec/generate-application/code/templates/domain-spec/generate-presets.js +1 -1
  82. package/dist/application-spec/generate-application/code/templates/domain-spec/generate-relation-expressions.js +1 -1
  83. package/dist/application-spec/generate-application/code/templates/domain-spec/generate-resources.d.ts +6 -8
  84. package/dist/application-spec/generate-application/code/templates/domain-spec/generate-resources.js +21 -21
  85. package/dist/application-spec/generate-application/code/templates/domain-spec/generate-states.d.ts +1 -1
  86. package/dist/application-spec/generate-application/code/templates/domain-spec/generate-states.js +2 -2
  87. package/dist/application-spec/generate-application/code/templates/domain-spec/index.d.ts +3 -2
  88. package/dist/application-spec/generate-application/code/templates/domain-spec/index.js +1 -1
  89. package/dist/application-spec/generate-application/code/templates/domain-spec.js +12 -12
  90. package/dist/application-spec/generate-application/code/templates/domain.js +3 -3
  91. package/dist/application-spec/generate-application/code/templates/eslint-config.d.ts +5 -0
  92. package/dist/application-spec/generate-application/code/templates/eslint-config.js +4 -5
  93. package/dist/application-spec/generate-application/code/templates/frontend-config.js +3 -5
  94. package/dist/application-spec/generate-application/code/templates/gitignore.js +0 -3
  95. package/dist/application-spec/generate-application/code/templates/global-definition/generate-phx-types.d.ts +43 -0
  96. package/dist/application-spec/generate-application/code/templates/global-definition/generate-phx-types.js +31 -0
  97. package/dist/application-spec/generate-application/code/templates/global-definition/index.d.ts +1 -0
  98. package/dist/application-spec/generate-application/code/templates/global-definition/index.js +1 -1
  99. package/dist/application-spec/generate-application/code/templates/globals.js +24 -43
  100. package/dist/application-spec/generate-application/code/templates/index.d.ts +3 -4
  101. package/dist/application-spec/generate-application/code/templates/index.js +1 -1
  102. package/dist/application-spec/generate-application/code/templates/lingui-rc.d.ts +5 -0
  103. package/dist/application-spec/generate-application/code/templates/lingui-rc.js +4 -4
  104. package/dist/application-spec/generate-application/code/templates/prettier-config.d.ts +5 -0
  105. package/dist/application-spec/generate-application/code/templates/prettier-config.js +4 -5
  106. package/dist/application-spec/generate-application/code/templates/root-tsconfig.d.ts +6 -0
  107. package/dist/application-spec/generate-application/code/templates/root-tsconfig.js +2 -0
  108. package/dist/application-spec/generate-application/code/templates/skills/phoenix-cli-skill.js +1 -1
  109. package/dist/application-spec/generate-application/code/templates/skills/phoenix-create-configurator-skill.js +1 -1
  110. package/dist/application-spec/generate-application/code/templates/skills/phoenix-feedback-skill.js +5 -5
  111. package/dist/application-spec/generate-application/code/templates/skills/phoenix-review-skill.js +9 -3
  112. package/dist/application-spec/generate-application/code/templates/skills/phoenix-skill.js +1 -1
  113. package/dist/application-spec/generate-application/code/templates/skills/phoenix-variants-skill.js +2 -2
  114. package/dist/application-spec/generate-application/code/templates/skills/sdk-content.d.ts +26 -7
  115. package/dist/application-spec/generate-application/code/templates/skills/sdk-content.js +2 -2
  116. package/dist/application-spec/generate-application/code/templates/spec-code/collect-spec-code.d.ts +58 -0
  117. package/dist/application-spec/generate-application/code/templates/spec-code/collect-spec-code.js +1 -0
  118. package/dist/application-spec/generate-application/code/templates/spec-code/index.d.ts +2 -0
  119. package/dist/application-spec/generate-application/code/templates/spec-code/index.js +1 -0
  120. package/dist/application-spec/generate-application/code/templates/spec-code/spec-code.d.ts +18 -0
  121. package/dist/application-spec/generate-application/code/templates/spec-code/spec-code.js +41 -0
  122. package/dist/application-spec/generate-application/code/templates/spec-messages/index.d.ts +1 -0
  123. package/dist/application-spec/generate-application/code/templates/spec-messages/index.js +1 -0
  124. package/dist/application-spec/generate-application/code/templates/spec-messages/spec-messages.d.ts +20 -0
  125. package/dist/application-spec/generate-application/code/templates/spec-messages/spec-messages.js +6 -0
  126. package/dist/application-spec/generate-application/code/templates/story/phx-module.d.ts +8 -2
  127. package/dist/application-spec/generate-application/code/templates/story/phx-module.js +15 -3
  128. package/dist/application-spec/generate-application/code/templates/story/wrapper.d.ts +3 -0
  129. package/dist/application-spec/generate-application/code/templates/story/wrapper.js +2 -1
  130. package/dist/application-spec/generate-application/code/templates/tsconfig.d.ts +5 -0
  131. package/dist/application-spec/generate-application/code/templates/tsconfig.js +1 -1
  132. package/dist/application-spec/generate-application/code/templates/webhook-index.d.ts +6 -1
  133. package/dist/application-spec/generate-application/code/templates/webhook-index.js +10 -1
  134. package/dist/application-spec/generate-application/code/templates/webhooks-config.js +2 -3
  135. package/dist/application-spec/generate-application/index.d.ts +2 -0
  136. package/dist/application-spec/generate-application/index.js +1 -1
  137. package/dist/application-spec/generate-application/runtime/admin-runtime/admin-model-runtime.d.ts +6 -4
  138. package/dist/application-spec/generate-application/runtime/admin-runtime/admin-model-runtime.js +1 -1
  139. package/dist/application-spec/generate-application/runtime/admin-runtime/admin-runtime.d.ts +8 -3
  140. package/dist/application-spec/generate-application/runtime/admin-runtime/admin-runtime.js +1 -1
  141. package/dist/application-spec/generate-application/runtime/admin-runtime/states-runtime.d.ts +2 -2
  142. package/dist/application-spec/generate-application/runtime/application-runtime.d.ts +19 -7
  143. package/dist/application-spec/generate-application/runtime/application-runtime.js +1 -1
  144. package/dist/application-spec/generate-application/runtime/configurator-runtime/configurator-model-runtime.d.ts +6 -4
  145. package/dist/application-spec/generate-application/runtime/configurator-runtime/configurator-model-runtime.js +1 -1
  146. package/dist/application-spec/generate-application/runtime/configurator-runtime/configurator-runtime.d.ts +7 -4
  147. package/dist/application-spec/generate-application/runtime/configurator-runtime/configurator-runtime.js +1 -1
  148. package/dist/application-spec/generate-application/runtime/configurator-runtime/states-runtime.d.ts +2 -2
  149. package/dist/application-spec/generate-application/runtime/factory-data/factory-data-runtime.d.ts +43 -0
  150. package/dist/application-spec/generate-application/runtime/factory-data/factory-data-runtime.js +1 -0
  151. package/dist/application-spec/generate-application/runtime/factory-data/index.d.ts +3 -0
  152. package/dist/application-spec/generate-application/runtime/factory-data/index.js +1 -0
  153. package/dist/application-spec/generate-application/runtime/factory-data/recipe-defaults.d.ts +13 -0
  154. package/dist/application-spec/generate-application/runtime/factory-data/recipe-defaults.js +1 -0
  155. package/dist/application-spec/generate-application/runtime/factory-data/static-violations.d.ts +16 -0
  156. package/dist/application-spec/generate-application/runtime/factory-data/static-violations.js +1 -0
  157. package/dist/application-spec/generate-application/runtime/migrations/index.d.ts +1 -0
  158. package/dist/application-spec/generate-application/runtime/migrations/index.js +1 -0
  159. package/dist/application-spec/generate-application/runtime/migrations/migration-runtime.d.ts +53 -0
  160. package/dist/application-spec/generate-application/runtime/migrations/migration-runtime.js +1 -0
  161. package/dist/application-spec/generate-application/runtime/sections/assistant-runtime.d.ts +2 -2
  162. package/dist/application-spec/generate-application/runtime/sections/build-sdk-optic.d.ts +3 -2
  163. package/dist/application-spec/generate-application/runtime/sections/build-sdk-optic.js +1 -1
  164. package/dist/application-spec/generate-application/runtime/sections/build-user-bound-optic.d.ts +2 -1
  165. package/dist/application-spec/generate-application/runtime/sections/build-user-bound-optic.js +1 -1
  166. package/dist/application-spec/generate-application/runtime/sections/component-optic.d.ts +5 -1
  167. package/dist/application-spec/generate-application/runtime/sections/component-optic.js +1 -1
  168. package/dist/application-spec/generate-application/runtime/sections/data-runtime.d.ts +4 -4
  169. package/dist/application-spec/generate-application/runtime/sections/expression-runtime.d.ts +7 -4
  170. package/dist/application-spec/generate-application/runtime/sections/expression-runtime.js +1 -1
  171. package/dist/application-spec/generate-application/runtime/sections/generate-memo-eval-plan-runtime.d.ts +9 -5
  172. package/dist/application-spec/generate-application/runtime/sections/generate-memo-eval-plan-runtime.js +1 -1
  173. package/dist/application-spec/generate-application/runtime/sections/reflection-constants-runtime.d.ts +3 -1
  174. package/dist/application-spec/generate-application/runtime/sections/reflection-constants-runtime.js +1 -1
  175. package/dist/application-spec/generate-application/runtime/sections/theme-runtime.d.ts +2 -2
  176. package/dist/application-spec/generate-application/runtime/sections/transformers-runtime.d.ts +4 -6
  177. package/dist/application-spec/generate-application/runtime/spec-code/index.d.ts +2 -0
  178. package/dist/application-spec/generate-application/runtime/spec-code/index.js +1 -0
  179. package/dist/application-spec/generate-application/runtime/spec-code/resolve-spec-code.d.ts +18 -0
  180. package/dist/application-spec/generate-application/runtime/spec-code/resolve-spec-code.js +1 -0
  181. package/dist/application-spec/generate-application/runtime/spec-code/spec-code-module.d.ts +17 -0
  182. package/dist/application-spec/generate-application/runtime/spec-code/spec-code-module.js +1 -0
  183. package/dist/application-spec/generate-application/runtime-spec/decode-runtime-spec.d.ts +9 -0
  184. package/dist/application-spec/generate-application/runtime-spec/decode-runtime-spec.js +1 -0
  185. package/dist/application-spec/generate-application/runtime-spec/encode-runtime-spec.d.ts +8 -0
  186. package/dist/application-spec/generate-application/runtime-spec/encode-runtime-spec.js +1 -0
  187. package/dist/application-spec/generate-application/runtime-spec/encoded-runtime-spec.d.ts +27 -0
  188. package/dist/application-spec/generate-application/runtime-spec/encoded-runtime-spec.js +1 -0
  189. package/dist/application-spec/generate-application/runtime-spec/index.d.ts +5 -0
  190. package/dist/application-spec/generate-application/runtime-spec/index.js +1 -0
  191. package/dist/application-spec/generate-application/runtime-spec/runtime-spec.d.ts +68 -0
  192. package/dist/application-spec/generate-application/runtime-spec/runtime-spec.js +1 -0
  193. package/dist/application-spec/generate-application/runtime-spec/spec-code-id.d.ts +40 -0
  194. package/dist/application-spec/generate-application/runtime-spec/spec-code-id.js +1 -0
  195. package/dist/application-spec/index.d.ts +1 -0
  196. package/dist/application-spec/index.js +1 -1
  197. package/dist/application-spec/parse-application-files/categorize/categorize-files.d.ts +34 -0
  198. package/dist/application-spec/parse-application-files/categorize/categorize-files.js +1 -1
  199. package/dist/application-spec/parse-application-files/categorize/earlier-generated-editor-configs.d.ts +16 -0
  200. package/dist/application-spec/parse-application-files/categorize/earlier-generated-editor-configs.js +9 -0
  201. package/dist/application-spec/parse-application-files/categorize/earlier-generated-tsconfig.d.ts +9 -0
  202. package/dist/application-spec/parse-application-files/categorize/earlier-generated-tsconfig.js +1 -0
  203. package/dist/application-spec/parse-application-files/categorize/module-analysis.d.ts +1 -1
  204. package/dist/application-spec/parse-application-files/categorize/module-analysis.js +1 -1
  205. package/dist/application-spec/parse-application-files/raw-spec/parse-yaml-spec-file.js +1 -1
  206. package/dist/application-spec/parse-application-files/raw-spec/raw-assistant.d.ts +16 -3
  207. package/dist/application-spec/parse-application-files/raw-spec/raw-assistant.js +1 -1
  208. package/dist/application-spec/parse-application-files/raw-spec/raw-spec-file.js +1 -1
  209. package/dist/application-spec/parse-application-files/spec/application/admin-spec/admin-spec.js +1 -1
  210. package/dist/application-spec/parse-application-files/spec/application/configurator-spec/configurator-spec.js +1 -1
  211. package/dist/application-spec/parse-application-files/spec/common/index.d.ts +1 -0
  212. package/dist/application-spec/parse-application-files/spec/common/index.js +1 -1
  213. package/dist/application-spec/parse-application-files/spec/common/value-type/format-value-type.d.ts +3 -0
  214. package/dist/application-spec/parse-application-files/spec/common/value-type/format-value-type.js +1 -0
  215. package/dist/application-spec/parse-application-files/spec/common/value-type/index.d.ts +5 -0
  216. package/dist/application-spec/parse-application-files/spec/common/value-type/index.js +1 -0
  217. package/dist/application-spec/parse-application-files/spec/common/value-type/intersect-value-types.d.ts +6 -0
  218. package/dist/application-spec/parse-application-files/spec/common/value-type/intersect-value-types.js +1 -0
  219. package/dist/application-spec/parse-application-files/spec/common/value-type/is-assignable-value-type.d.ts +8 -0
  220. package/dist/application-spec/parse-application-files/spec/common/value-type/is-assignable-value-type.js +1 -0
  221. package/dist/application-spec/parse-application-files/spec/common/value-type/value-type-at.d.ts +10 -0
  222. package/dist/application-spec/parse-application-files/spec/common/value-type/value-type-at.js +1 -0
  223. package/dist/application-spec/parse-application-files/spec/common/value-type/value-type.d.ts +98 -0
  224. package/dist/application-spec/parse-application-files/spec/common/value-type/value-type.js +1 -0
  225. package/dist/application-spec/parse-application-files/spec/components/bindings/component-path.d.ts +13 -0
  226. package/dist/application-spec/parse-application-files/spec/components/bindings/component-path.js +1 -0
  227. package/dist/application-spec/parse-application-files/spec/components/bindings/index.d.ts +2 -0
  228. package/dist/application-spec/parse-application-files/spec/components/bindings/index.js +1 -1
  229. package/dist/application-spec/parse-application-files/spec/components/bindings/read-binding-type.d.ts +24 -0
  230. package/dist/application-spec/parse-application-files/spec/components/bindings/read-binding-type.js +1 -0
  231. package/dist/application-spec/parse-application-files/spec/components/component-entry.d.ts +1 -9
  232. package/dist/application-spec/parse-application-files/spec/components/component-entry.js +1 -1
  233. package/dist/application-spec/parse-application-files/spec/components/component-filter.d.ts +1 -54
  234. package/dist/application-spec/parse-application-files/spec/components/component-filter.js +1 -1
  235. package/dist/application-spec/parse-application-files/spec/components/component-state-type.d.ts +8 -0
  236. package/dist/application-spec/parse-application-files/spec/components/component-state-type.js +1 -0
  237. package/dist/application-spec/parse-application-files/spec/components/filter-criterion-types.d.ts +13 -0
  238. package/dist/application-spec/parse-application-files/spec/components/filter-criterion-types.js +1 -0
  239. package/dist/application-spec/parse-application-files/spec/components/index.d.ts +1 -1
  240. package/dist/application-spec/parse-application-files/spec/components/index.js +1 -1
  241. package/dist/application-spec/parse-application-files/spec/components/static-entity-id.d.ts +14 -0
  242. package/dist/application-spec/parse-application-files/spec/components/static-entity-id.js +1 -0
  243. package/dist/application-spec/parse-application-files/spec/components/user-component-entry.d.ts +6 -0
  244. package/dist/application-spec/parse-application-files/spec/components/user-component-entry.js +1 -1
  245. package/dist/application-spec/parse-application-files/spec/components/user-components.d.ts +7 -4
  246. package/dist/application-spec/parse-application-files/spec/components/user-components.js +1 -1
  247. package/dist/application-spec/parse-application-files/spec/expressions/expression-read-types.d.ts +24 -0
  248. package/dist/application-spec/parse-application-files/spec/expressions/expression-read-types.js +1 -0
  249. package/dist/application-spec/parse-application-files/spec/expressions/expression-read.d.ts +13 -0
  250. package/dist/application-spec/parse-application-files/spec/expressions/expression-read.js +1 -0
  251. package/dist/application-spec/parse-application-files/spec/expressions/expression-value-type.d.ts +9 -0
  252. package/dist/application-spec/parse-application-files/spec/expressions/expression-value-type.js +1 -0
  253. package/dist/application-spec/parse-application-files/spec/expressions/expression.d.ts +1 -28
  254. package/dist/application-spec/parse-application-files/spec/expressions/expression.js +1 -1
  255. package/dist/application-spec/parse-application-files/spec/expressions/expressions.d.ts +7 -3
  256. package/dist/application-spec/parse-application-files/spec/expressions/expressions.js +1 -1
  257. package/dist/application-spec/parse-application-files/spec/expressions/index.d.ts +0 -1
  258. package/dist/application-spec/parse-application-files/spec/expressions/index.js +1 -1
  259. package/dist/application-spec/parse-application-files/spec/expressions/memo-eval-plan.js +1 -1
  260. package/dist/application-spec/parse-application-files/spec/expressions/user-expressions.d.ts +3 -1
  261. package/dist/application-spec/parse-application-files/spec/expressions/user-expressions.js +1 -1
  262. package/dist/application-spec/parse-application-files/spec/invariants/invariants.d.ts +2 -2
  263. package/dist/application-spec/parse-application-files/spec/invariants/invariants.js +1 -1
  264. package/dist/application-spec/parse-application-files/spec/model/defaults.d.ts +7 -2
  265. package/dist/application-spec/parse-application-files/spec/model/defaults.js +1 -1
  266. package/dist/application-spec/parse-application-files/spec/model/index.d.ts +1 -0
  267. package/dist/application-spec/parse-application-files/spec/model/index.js +1 -1
  268. package/dist/application-spec/parse-application-files/spec/model/model-type-resolution.d.ts +10 -0
  269. package/dist/application-spec/parse-application-files/spec/model/model-type-resolution.js +1 -0
  270. package/dist/application-spec/parse-application-files/spec/relations/reference-field-type.d.ts +25 -0
  271. package/dist/application-spec/parse-application-files/spec/relations/reference-field-type.js +1 -0
  272. package/dist/application-spec/parse-application-files/spec/relations/relation-field-mismatch.d.ts +46 -0
  273. package/dist/application-spec/parse-application-files/spec/relations/relation-field-mismatch.js +1 -0
  274. package/dist/application-spec/parse-application-files/spec/relations/relations.d.ts +4 -3
  275. package/dist/application-spec/parse-application-files/spec/relations/relations.js +1 -1
  276. package/dist/application-spec/parse-application-files/spec/sections/assistant/assistant-schema.js +1 -1
  277. package/dist/application-spec/parse-application-files/spec/sections/infra.d.ts +2 -0
  278. package/dist/application-spec/parse-application-files/spec/sections/infra.js +1 -1
  279. package/dist/client/phoenix-api.d.ts +463 -0
  280. package/dist/configurator/ConfiguratorApp.js +1 -1
  281. package/dist/configurator/app-loader-content/DefaultAppLoaderContent.d.ts +2 -0
  282. package/dist/configurator/app-loader-content/DefaultAppLoaderContent.js +5 -0
  283. package/dist/configurator/app-loader-content/app-loader-content-name.d.ts +5 -0
  284. package/dist/configurator/app-loader-content/app-loader-content-name.js +1 -0
  285. package/dist/configurator/app-loader-content/index.d.ts +2 -0
  286. package/dist/configurator/app-loader-content/index.js +1 -0
  287. package/dist/configurator/application-runtime/extensions/create-configurator-extensions.js +1 -1
  288. package/dist/configurator/application-runtime/extensions/selectors.d.ts +3 -1
  289. package/dist/configurator/application-runtime/extensions/selectors.js +1 -1
  290. package/dist/configurator/application-runtime/extensions/systems/assistant-system/assistant-system.d.ts +38 -1
  291. package/dist/configurator/application-runtime/extensions/systems/assistant-system/assistant-system.js +1 -1
  292. package/dist/configurator/application-runtime/extensions/systems/assistant-system/graphql-tools.d.ts +7 -1
  293. package/dist/configurator/application-runtime/extensions/systems/assistant-system/graphql-tools.js +1 -1
  294. package/dist/configurator/application-runtime/extensions/systems/camera-control-system/camera-control-system.d.ts +1 -1
  295. package/dist/configurator/application-runtime/extensions/systems/drag-and-drop-system/drag-and-drop-system.d.ts +3 -3
  296. package/dist/configurator/application-runtime/extensions/systems/graphql-system/close-unclosed-braces.d.ts +12 -0
  297. package/dist/configurator/application-runtime/extensions/systems/graphql-system/close-unclosed-braces.js +1 -0
  298. package/dist/configurator/application-runtime/extensions/systems/graphql-system/graphql-system.d.ts +20 -4
  299. package/dist/configurator/application-runtime/extensions/systems/graphql-system/graphql-system.js +1 -1
  300. package/dist/configurator/application-runtime/extensions/systems/graphql-system/inject-assistant-lenses.d.ts +11 -0
  301. package/dist/configurator/application-runtime/extensions/systems/graphql-system/inject-assistant-lenses.js +1 -0
  302. package/dist/configurator/application-runtime/extensions/systems/layout-system/layout-system.d.ts +2 -2
  303. package/dist/configurator/application-runtime/extensions/systems/layout-system/layout-system.js +1 -1
  304. package/dist/configurator/common/configurator-interface.d.ts +136 -4
  305. package/dist/configurator/common/configurator-interface.js +1 -1
  306. package/dist/configurator/common/index.d.ts +3 -1
  307. package/dist/configurator/common/index.js +1 -1
  308. package/dist/configurator/common/use-reset-camera.d.ts +6 -0
  309. package/dist/configurator/common/use-reset-camera.js +1 -0
  310. package/dist/configurator/configuration-not-found-page/ConfigurationNotFoundPageElement.d.ts +12 -0
  311. package/dist/configurator/configuration-not-found-page/ConfigurationNotFoundPageElement.js +1 -0
  312. package/dist/configurator/configuration-not-found-page/create-configuration-not-found-page.d.ts +9 -0
  313. package/dist/configurator/configuration-not-found-page/create-configuration-not-found-page.js +1 -0
  314. package/dist/configurator/configuration-not-found-page/index.d.ts +2 -0
  315. package/dist/configurator/configuration-not-found-page/index.js +1 -0
  316. package/dist/configurator/configurator-context/ConfiguratorResponsiveProvider.d.ts +12 -0
  317. package/dist/configurator/configurator-context/ConfiguratorResponsiveProvider.js +1 -0
  318. package/dist/configurator/configurator-context/PresetSelectionProvider.js +1 -1
  319. package/dist/configurator/configurator-context/PreviewContextProvider.js +1 -1
  320. package/dist/configurator/configurator-context/ViewportStateSync.d.ts +2 -2
  321. package/dist/configurator/configurator-context/ViewportStateSync.js +1 -1
  322. package/dist/configurator/configurator-context/configurator-hooks/layout-hooks.d.ts +7 -1
  323. package/dist/configurator/configurator-error-page/BuiltInConfiguratorErrorPage.d.ts +6 -0
  324. package/dist/configurator/configurator-error-page/BuiltInConfiguratorErrorPage.js +1 -0
  325. package/dist/configurator/configurator-error-page/ConfiguratorErrorPageElement.d.ts +12 -0
  326. package/dist/configurator/configurator-error-page/ConfiguratorErrorPageElement.js +1 -0
  327. package/dist/configurator/configurator-error-page/create-configurator-error-page.d.ts +9 -0
  328. package/dist/configurator/configurator-error-page/create-configurator-error-page.js +1 -0
  329. package/dist/configurator/configurator-error-page/index.d.ts +3 -0
  330. package/dist/configurator/configurator-error-page/index.js +1 -0
  331. package/dist/configurator/index.d.ts +3 -0
  332. package/dist/configurator/index.js +1 -1
  333. package/dist/configurator/pages/ConfiguratorErrorPage.d.ts +0 -1
  334. package/dist/configurator/pages/ConfiguratorErrorPage.js +1 -1
  335. package/dist/configurator/pages/ConfiguratorNotFoundPage.js +1 -1
  336. package/dist/configurator/pages/DefaultConfiguratorLayout.d.ts +3 -2
  337. package/dist/configurator/pages/DefaultNotAuthenticatedPage.d.ts +8 -0
  338. package/dist/configurator/pages/DefaultNotAuthenticatedPage.js +1 -0
  339. package/dist/configurator/pages/DefaultPresetUi.d.ts +7 -0
  340. package/dist/configurator/pages/DefaultPresetUi.js +1 -0
  341. package/dist/configurator/pages/LoadedConfiguratorDetailPage.js +1 -1
  342. package/dist/configurator/pages/NewConfiguratorPage.js +1 -1
  343. package/dist/configurator/pages/PresetCreationErrorPage.d.ts +1 -1
  344. package/dist/configurator/pages/PresetCreationErrorPage.js +1 -1
  345. package/dist/configurator/pages/RootPage.js +1 -1
  346. package/dist/configurator/pages/configurator-layout-name.d.ts +2 -0
  347. package/dist/configurator/pages/configurator-layout-name.js +1 -0
  348. package/dist/configurator/pages/default-configurator-elements.d.ts +13 -0
  349. package/dist/configurator/pages/default-configurator-elements.js +1 -0
  350. package/dist/configurator/pages/default-elements/built-in-entity-element.d.ts +10 -0
  351. package/dist/configurator/pages/default-elements/built-in-entity-element.js +1 -0
  352. package/dist/configurator/pages/default-elements/built-in-layout-element.d.ts +10 -0
  353. package/dist/configurator/pages/default-elements/built-in-layout-element.js +1 -0
  354. package/dist/configurator/pages/default-elements/domain-control-elements.d.ts +6 -0
  355. package/dist/configurator/pages/default-elements/domain-control-elements.js +1 -0
  356. package/dist/configurator/pages/default-elements/index.d.ts +5 -0
  357. package/dist/configurator/pages/default-elements/index.js +1 -0
  358. package/dist/configurator/pages/default-elements/recipe-panel-elements.d.ts +3 -0
  359. package/dist/configurator/pages/default-elements/recipe-panel-elements.js +1 -0
  360. package/dist/configurator/pages/default-elements/scene-controls/BuiltInAddEntityFab.d.ts +3 -0
  361. package/dist/configurator/pages/default-elements/scene-controls/BuiltInAddEntityFab.js +1 -0
  362. package/dist/configurator/pages/default-elements/scene-controls/BuiltInDeleteEntityFab.d.ts +3 -0
  363. package/dist/configurator/pages/default-elements/scene-controls/BuiltInDeleteEntityFab.js +1 -0
  364. package/dist/configurator/pages/default-elements/scene-controls/BuiltInNavigationHotspot.d.ts +3 -0
  365. package/dist/configurator/pages/default-elements/scene-controls/BuiltInNavigationHotspot.js +1 -0
  366. package/dist/configurator/pages/default-elements/scene-controls/BuiltInSelectionHotspot.d.ts +3 -0
  367. package/dist/configurator/pages/default-elements/scene-controls/BuiltInSelectionHotspot.js +1 -0
  368. package/dist/configurator/pages/default-elements/scene-controls/BuiltInToolMenuFab.d.ts +3 -0
  369. package/dist/configurator/pages/default-elements/scene-controls/BuiltInToolMenuFab.js +1 -0
  370. package/dist/configurator/pages/default-elements/scene-controls/index.d.ts +6 -0
  371. package/dist/configurator/pages/default-elements/scene-controls/index.js +1 -0
  372. package/dist/configurator/pages/default-elements/scene-controls/scene-control-elements.d.ts +6 -0
  373. package/dist/configurator/pages/default-elements/scene-controls/scene-control-elements.js +1 -0
  374. package/dist/configurator/pages/default-elements/sidebar-footer-elements.d.ts +7 -0
  375. package/dist/configurator/pages/default-elements/sidebar-footer-elements.js +1 -0
  376. package/dist/configurator/pages/default-elements/toolbar-elements.d.ts +7 -0
  377. package/dist/configurator/pages/default-elements/toolbar-elements.js +1 -0
  378. package/dist/configurator/pages/error-boundaries/GeneralErrorBoundary.js +1 -1
  379. package/dist/configurator/pages/index.d.ts +1 -0
  380. package/dist/configurator/pages/index.js +1 -1
  381. package/dist/configurator/preset-screen-elements/PresetDeviceNotSupportedElement.d.ts +4 -0
  382. package/dist/configurator/preset-screen-elements/PresetDeviceNotSupportedElement.js +1 -0
  383. package/dist/configurator/preset-screen-elements/PresetPageActionElement.d.ts +4 -0
  384. package/dist/configurator/preset-screen-elements/PresetPageActionElement.js +1 -0
  385. package/dist/configurator/preset-screen-elements/index.d.ts +2 -0
  386. package/dist/configurator/preset-screen-elements/index.js +1 -0
  387. package/dist/configurator/scene/index.d.ts +1 -0
  388. package/dist/configurator/scene/index.js +1 -1
  389. package/dist/configurator/scene/scene-controls/DeleteEntityFab.js +1 -1
  390. package/dist/configurator/scene/scene-controls/SelectionHotspot.js +1 -1
  391. package/dist/configurator/scene/scene-controls/ToolFab.d.ts +4 -0
  392. package/dist/configurator/scene/scene-controls/ToolFab.js +1 -1
  393. package/dist/configurator/scene/scene-controls/hotspot-drag-handle/HotspotDragHandle.d.ts +1 -1
  394. package/dist/configurator/scene/scene-controls/hotspot-drag-handle/HotspotDragSceneHandle.d.ts +1 -1
  395. package/dist/configurator/scene/scene-controls/use-scene-control-tooltip.d.ts +2 -1
  396. package/dist/configurator/scene/scene-entity/dimension-indicators/DimensionIndicator.d.ts +1 -1
  397. package/dist/configurator/scene/scene-entity/dimension-indicators/DimensionIndicatorInternal.d.ts +1 -1
  398. package/dist/configurator/scene/scene-entity/drag-and-drop/shared.d.ts +2 -2
  399. package/dist/configurator/scene/scene-entity/drag-and-drop/use-drag-object.d.ts +1 -1
  400. package/dist/configurator/scene/scene-entity/materials/RemoteReplacedMaterial.js +1 -1
  401. package/dist/configurator/scene/scene-entity/objects/SceneEntityObjectTextDecal.d.ts +1 -1
  402. package/dist/configurator/scene/scene-entity/scene-controls/SceneEntityHtmlHotspots.js +1 -1
  403. package/dist/configurator/toolbar-actions/index.d.ts +2 -0
  404. package/dist/configurator/toolbar-actions/index.js +1 -0
  405. package/dist/configurator/toolbar-actions/use-assistant-panel.d.ts +18 -0
  406. package/dist/configurator/toolbar-actions/use-assistant-panel.js +1 -0
  407. package/dist/configurator/toolbar-actions/use-measurements.d.ts +35 -0
  408. package/dist/configurator/toolbar-actions/use-measurements.js +1 -0
  409. package/dist/configurator/ui/assistant/AssistantChips.d.ts +8 -2
  410. package/dist/configurator/ui/assistant/AssistantChips.js +1 -1
  411. package/dist/configurator/ui/assistant/AssistantMarkdown.d.ts +7 -2
  412. package/dist/configurator/ui/assistant/AssistantMarkdown.js +1 -1
  413. package/dist/configurator/ui/assistant/AssistantPanel.js +1 -1
  414. package/dist/configurator/ui/assistant/AssistantThread.js +1 -1
  415. package/dist/configurator/ui/assistant/alert/AssistantAlert.d.ts +8 -0
  416. package/dist/configurator/ui/assistant/alert/AssistantAlert.js +1 -0
  417. package/dist/configurator/ui/assistant/alert/index.d.ts +2 -0
  418. package/dist/configurator/ui/assistant/alert/index.js +1 -0
  419. package/dist/configurator/ui/assistant/alert/remark-alerts.d.ts +10 -0
  420. package/dist/configurator/ui/assistant/alert/remark-alerts.js +1 -0
  421. package/dist/configurator/ui/assistant/entity-link/AssistantEntityLink.d.ts +13 -0
  422. package/dist/configurator/ui/assistant/entity-link/AssistantEntityLink.js +1 -0
  423. package/dist/configurator/ui/assistant/entity-link/entity-link-selection.d.ts +22 -0
  424. package/dist/configurator/ui/assistant/entity-link/entity-link-selection.js +1 -0
  425. package/dist/configurator/ui/assistant/entity-link/entity-link-state.d.ts +27 -0
  426. package/dist/configurator/ui/assistant/entity-link/entity-link-state.js +1 -0
  427. package/dist/configurator/ui/assistant/entity-link/index.d.ts +2 -0
  428. package/dist/configurator/ui/assistant/entity-link/index.js +1 -0
  429. package/dist/configurator/ui/assistant/form/AssistantForm.d.ts +19 -0
  430. package/dist/configurator/ui/assistant/form/AssistantForm.js +1 -0
  431. package/dist/configurator/ui/assistant/form/built-in-form-registry.d.ts +10 -0
  432. package/dist/configurator/ui/assistant/form/built-in-form-registry.js +1 -0
  433. package/dist/configurator/ui/assistant/form/compose-answer.d.ts +12 -0
  434. package/dist/configurator/ui/assistant/form/compose-answer.js +1 -0
  435. package/dist/configurator/ui/assistant/form/describe-build-errors.d.ts +6 -0
  436. package/dist/configurator/ui/assistant/form/describe-build-errors.js +1 -0
  437. package/dist/configurator/ui/assistant/form/form-element-definition.d.ts +14 -0
  438. package/dist/configurator/ui/assistant/form/form-element-definition.js +1 -0
  439. package/dist/configurator/ui/assistant/form/form-model.d.ts +39 -0
  440. package/dist/configurator/ui/assistant/form/form-model.js +1 -0
  441. package/dist/configurator/ui/assistant/form/form-registry.d.ts +31 -0
  442. package/dist/configurator/ui/assistant/form/form-registry.js +8 -0
  443. package/dist/configurator/ui/assistant/form/form-state.d.ts +4 -0
  444. package/dist/configurator/ui/assistant/form/form-state.js +1 -0
  445. package/dist/configurator/ui/assistant/form/index.d.ts +2 -0
  446. package/dist/configurator/ui/assistant/form/index.js +1 -0
  447. package/dist/configurator/ui/assistant/form/parse-form-block.d.ts +10 -0
  448. package/dist/configurator/ui/assistant/form/parse-form-block.js +1 -0
  449. package/dist/configurator/ui/assistant/form/read-form-attributes.d.ts +13 -0
  450. package/dist/configurator/ui/assistant/form/read-form-attributes.js +1 -0
  451. package/dist/configurator/ui/assistant/form-elements/FormCard.d.ts +9 -0
  452. package/dist/configurator/ui/assistant/form-elements/FormCard.js +1 -0
  453. package/dist/configurator/ui/assistant/form-elements/FormConfirm.d.ts +9 -0
  454. package/dist/configurator/ui/assistant/form-elements/FormConfirm.js +1 -0
  455. package/dist/configurator/ui/assistant/form-elements/FormGroup.d.ts +6 -0
  456. package/dist/configurator/ui/assistant/form-elements/FormGroup.js +1 -0
  457. package/dist/configurator/ui/assistant/form-elements/FormNumber.d.ts +9 -0
  458. package/dist/configurator/ui/assistant/form-elements/FormNumber.js +1 -0
  459. package/dist/configurator/ui/assistant/form-elements/FormOptions.d.ts +6 -0
  460. package/dist/configurator/ui/assistant/form-elements/FormOptions.js +1 -0
  461. package/dist/configurator/ui/assistant/form-elements/FormReply.d.ts +6 -0
  462. package/dist/configurator/ui/assistant/form-elements/FormReply.js +1 -0
  463. package/dist/configurator/ui/assistant/form-elements/FormSwatch.d.ts +10 -0
  464. package/dist/configurator/ui/assistant/form-elements/FormSwatch.js +1 -0
  465. package/dist/configurator/ui/assistant/form-elements/FormText.d.ts +6 -0
  466. package/dist/configurator/ui/assistant/form-elements/FormText.js +1 -0
  467. package/dist/configurator/ui/assistant/form-elements/clamp-form-number.d.ts +10 -0
  468. package/dist/configurator/ui/assistant/form-elements/clamp-form-number.js +1 -0
  469. package/dist/configurator/ui/assistant/form-elements/form-element-props.d.ts +38 -0
  470. package/dist/configurator/ui/assistant/form-elements/form-element-props.js +1 -0
  471. package/dist/configurator/ui/assistant/form-elements/index.d.ts +9 -0
  472. package/dist/configurator/ui/assistant/form-elements/index.js +1 -0
  473. package/dist/configurator/ui/assistant/reference-link/AssistantReferenceLink.d.ts +16 -0
  474. package/dist/configurator/ui/assistant/reference-link/AssistantReferenceLink.js +1 -0
  475. package/dist/configurator/ui/assistant/reference-link/assistant-link-target.d.ts +34 -0
  476. package/dist/configurator/ui/assistant/reference-link/assistant-link-target.js +1 -0
  477. package/dist/configurator/ui/assistant/reference-link/assistant-reference-details.d.ts +25 -0
  478. package/dist/configurator/ui/assistant/reference-link/assistant-reference-details.js +1 -0
  479. package/dist/configurator/ui/assistant/reference-link/index.d.ts +3 -0
  480. package/dist/configurator/ui/assistant/reference-link/index.js +1 -0
  481. package/dist/configurator/ui/assistant/reference-link/reference-styles.d.ts +12 -0
  482. package/dist/configurator/ui/assistant/reference-link/reference-styles.js +1 -0
  483. package/dist/configurator/ui/assistant/reference-link/use-assistant-reference-details.d.ts +8 -0
  484. package/dist/configurator/ui/assistant/reference-link/use-assistant-reference-details.js +1 -0
  485. package/dist/configurator/ui/assistant/resource-image/AssistantImage.d.ts +9 -0
  486. package/dist/configurator/ui/assistant/resource-image/AssistantImage.js +1 -0
  487. package/dist/configurator/ui/assistant/resource-image/index.d.ts +3 -0
  488. package/dist/configurator/ui/assistant/resource-image/index.js +1 -0
  489. package/dist/configurator/ui/assistant/resource-image/resource-path.d.ts +2 -0
  490. package/dist/configurator/ui/assistant/resource-image/resource-path.js +1 -0
  491. package/dist/configurator/ui/assistant/resource-image/use-resource-image-url.d.ts +5 -0
  492. package/dist/configurator/ui/assistant/resource-image/use-resource-image-url.js +1 -0
  493. package/dist/configurator/ui/assistant/streamed-markdown.d.ts +4 -2
  494. package/dist/configurator/ui/assistant/streamed-markdown.js +2 -2
  495. package/dist/configurator/ui/assistant/thread-items.d.ts +8 -1
  496. package/dist/configurator/ui/assistant/thread-items.js +1 -1
  497. package/dist/configurator/ui/assistant/use-follow-stream.js +1 -1
  498. package/dist/configurator/ui/configurator-layout/sidebar-keys/index.d.ts +1 -0
  499. package/dist/configurator/ui/configurator-layout/sidebar-keys/index.js +1 -0
  500. package/dist/configurator/ui/configurator-layout/sidebar-keys/sidebar-keys.d.ts +11 -0
  501. package/dist/configurator/ui/configurator-layout/sidebar-keys/sidebar-keys.js +1 -0
  502. package/dist/configurator/ui/configurator-layout/slots/canvas/LayoutCanvas.js +1 -1
  503. package/dist/configurator/ui/configurator-layout/slots/canvas/SharedCanvas.js +1 -1
  504. package/dist/configurator/ui/configurator-layout/slots/desktop-sidebar/DesktopSidebar.d.ts +101 -0
  505. package/dist/configurator/ui/configurator-layout/slots/desktop-sidebar/DesktopSidebar.js +16 -0
  506. package/dist/configurator/ui/configurator-layout/slots/desktop-sidebar/index.d.ts +1 -0
  507. package/dist/configurator/ui/configurator-layout/slots/desktop-sidebar/index.js +1 -0
  508. package/dist/configurator/ui/configurator-layout/slots/mobile-tabs/use-mobile-tabs.d.ts +1 -1
  509. package/dist/configurator/ui/configurator-layout/slots/mobile-tabs/use-mobile-tabs.js +1 -1
  510. package/dist/configurator/ui/configurator-layout/slots/services/InvariantViolations.d.ts +4 -4
  511. package/dist/configurator/ui/configurator-layout/slots/services/InvariantViolations.js +1 -1
  512. package/dist/configurator/ui/configurator-layout/slots/services/Services.js +1 -1
  513. package/dist/configurator/ui/configurator-layout/slots/services/SideEffects.d.ts +3 -6
  514. package/dist/configurator/ui/configurator-layout/slots/services/SideEffects.js +1 -1
  515. package/dist/configurator/ui/configurator-layout/slots/sidebar-tabs/use-sidebar-tabs.d.ts +1 -1
  516. package/dist/configurator/ui/configurator-layout/slots/sidebar-tabs/use-sidebar-tabs.js +1 -1
  517. package/dist/configurator/ui/configurator-layout/slots/slots.d.ts +1 -0
  518. package/dist/configurator/ui/configurator-layout/slots/slots.js +1 -1
  519. package/dist/configurator/ui/configurator-layout/universal/DesktopLayout.d.ts +0 -74
  520. package/dist/configurator/ui/configurator-layout/universal/DesktopLayout.js +5 -20
  521. package/dist/configurator/ui/configurator-layout/universal/DesktopPreview.js +1 -1
  522. package/dist/configurator/ui/configurator-layout/universal/MobileLayout.js +4 -4
  523. package/dist/configurator/ui/configurator-layout/universal/MobilePreview.js +1 -1
  524. package/dist/configurator/ui/configurator-layout/universal/use-layout-scene-safe-area.d.ts +47 -0
  525. package/dist/configurator/ui/configurator-layout/universal/use-layout-scene-safe-area.js +1 -0
  526. package/dist/configurator/ui/configurator-layout/universal/use-scene-safe-area.d.ts +11 -26
  527. package/dist/configurator/ui/configurator-layout/universal/use-scene-safe-area.js +1 -1
  528. package/dist/configurator/ui/legacy/layout/common/CommonFinalizeButton.js +1 -1
  529. package/dist/configurator/ui/legacy/layout/common/CommonSummaryButton.js +1 -1
  530. package/dist/configurator/ui/legacy/layout/common/CommonTopNavigation.js +1 -1
  531. package/dist/configurator/ui/legacy/layout/common/ReactiveInterfaceLayout.js +1 -1
  532. package/dist/configurator/ui/legacy/layout/common/ResponsiveFinalizeButton.js +1 -1
  533. package/dist/configurator/ui/legacy/layout/common/SummaryReadLayout.js +1 -1
  534. package/dist/configurator/ui/legacy/layout/simple/SimpleOwnerLayout.js +1 -1
  535. package/dist/configurator/ui/legacy/layout/simple/SimpleTopNavigation.js +1 -1
  536. package/dist/configurator/ui/legacy/layout/steps/StepsNavigation.d.ts +2 -2
  537. package/dist/configurator/ui/legacy/layout/steps/StepsNavigation.js +1 -1
  538. package/dist/configurator/ui/legacy/layout/steps/StepsOwnerLayout.js +1 -1
  539. package/dist/configurator/ui/legacy/layout/steps/StepsSidebarFooter.js +1 -1
  540. package/dist/configurator/ui/legacy/layout/tabs/TabsOwnerLayout.js +1 -1
  541. package/dist/configurator/ui/legacy/toolbar/common/DimensionUnitSelector.js +1 -1
  542. package/dist/configurator/ui/legacy/toolbar/common/MeasurementsIndicatorsSwitch.js +1 -1
  543. package/dist/configurator/ui/legacy/toolbar/desktop-toolbar/FullscreenToolbarAction.js +1 -1
  544. package/dist/configurator/ui/legacy/toolbar/desktop-toolbar/HelpToolbarAction.js +1 -1
  545. package/dist/configurator/ui/legacy/toolbar/desktop-toolbar/MeasurementsToolbarAction.js +1 -1
  546. package/dist/configurator/ui/legacy/toolbar/desktop-toolbar/UndoRedoToolbarGroup.js +1 -1
  547. package/dist/configurator/ui/phoenix-layout-elements/AppLoader.js +2 -6
  548. package/dist/configurator/ui/phoenix-layout-elements/AssistantToolbarButton.js +1 -1
  549. package/dist/configurator/ui/phoenix-layout-elements/EnterFullscreenToolbarButton.js +1 -1
  550. package/dist/configurator/ui/phoenix-layout-elements/ExitFullscreenToolbarButton.js +1 -1
  551. package/dist/configurator/ui/phoenix-layout-elements/HelpToolbarButton.js +1 -1
  552. package/dist/configurator/ui/phoenix-layout-elements/LanguageMenuAction.js +1 -1
  553. package/dist/configurator/ui/phoenix-layout-elements/LanguageToolbarButton.js +1 -1
  554. package/dist/configurator/ui/phoenix-layout-elements/LayoutCustomOwnerUi.d.ts +1 -0
  555. package/dist/configurator/ui/phoenix-layout-elements/LayoutCustomOwnerUi.js +1 -1
  556. package/dist/configurator/ui/phoenix-layout-elements/LayoutCustomReadUi.d.ts +1 -0
  557. package/dist/configurator/ui/phoenix-layout-elements/LayoutCustomReadUi.js +1 -1
  558. package/dist/configurator/ui/phoenix-layout-elements/MeasurementsMenuAction.js +1 -1
  559. package/dist/configurator/ui/phoenix-layout-elements/MeasurementsToolbarButton.js +1 -1
  560. package/dist/configurator/ui/phoenix-layout-elements/RedoToolbarButton.js +1 -1
  561. package/dist/configurator/ui/phoenix-layout-elements/ShareToolbarButton.js +1 -1
  562. package/dist/configurator/ui/phoenix-layout-elements/UndoToolbarButton.js +1 -1
  563. package/dist/configurator/ui/phoenix-layout-elements/header/common/back-button/use-go-back-action.js +1 -1
  564. package/dist/configurator/ui/phoenix-layout-elements/header/common/horizontal-tabs/DesktopHorizontalTabs.js +1 -1
  565. package/dist/configurator/ui/phoenix-layout-elements/header/common/step-navigation/DesktopNavigationSteps.d.ts +1 -1
  566. package/dist/configurator/ui/phoenix-layout-elements/header/common/step-navigation/DesktopNavigationSteps.js +1 -1
  567. package/dist/configurator/ui/phoenix-layout-elements/header/common/step-navigation/StepsNavigation.d.ts +2 -8
  568. package/dist/configurator/ui/phoenix-layout-elements/header/common/step-navigation/StepsNavigation.js +1 -1
  569. package/dist/configurator/ui/phoenix-layout-elements/measurements/DimensionUnitSelector.js +1 -1
  570. package/dist/configurator/ui/phoenix-layout-elements/measurements/MeasurementsIndicatorsSwitch.js +1 -1
  571. package/dist/configurator/ui/phoenix-layout-elements/share/ShareModal.js +1 -1
  572. package/dist/configurator/ui/phoenix-layout-elements/share/use-share.d.ts +7 -8
  573. package/dist/configurator/ui/phoenix-layout-elements/share/use-share.js +1 -1
  574. package/dist/configurator/ui/phoenix-layout-elements/sidebar-footer/basic/BasicFinalizeButton.js +1 -1
  575. package/dist/configurator/ui/phoenix-layout-elements/sidebar-footer/common/CustomFinalizeButton.js +1 -1
  576. package/dist/configurator/ui/phoenix-layout-elements/sidebar-footer/common/EnterSummaryButton.js +1 -1
  577. package/dist/configurator/ui/phoenix-layout-elements/sidebar-footer/common/FinalizeActions.js +1 -1
  578. package/dist/configurator/ui/phoenix-layout-elements/sidebar-footer/common/NextStepButton.js +1 -1
  579. package/dist/configurator/ui/phoenix-layout-elements/sidebar-footer/common/PreviousStepButton.js +1 -1
  580. package/dist/configurator/ui/preset-layout/CategoryPresetUi.js +1 -1
  581. package/dist/configurator/ui/preset-layout/PresetUi.d.ts +4 -0
  582. package/dist/configurator/ui/preset-layout/PresetUi.js +1 -1
  583. package/dist/configurator/ui/save-message-snackbars/SaveMessageSnackbars.d.ts +10 -0
  584. package/dist/configurator/ui/save-message-snackbars/SaveMessageSnackbars.js +1 -0
  585. package/dist/configurator/ui/save-message-snackbars/index.d.ts +1 -0
  586. package/dist/configurator/ui/save-message-snackbars/index.js +1 -0
  587. package/dist/docs/complex-use-cases/filtered-controls-with-fix-dialog.mdx +16 -19
  588. package/dist/docs/complex-use-cases/focus-mode.mdx +2 -0
  589. package/dist/docs/complex-use-cases/sketching.mdx +0 -38
  590. package/dist/docs/controls/select-attribute/cardselect.mdx +9 -13
  591. package/dist/docs/controls/select-child-entity/cardselect.mdx +1 -0
  592. package/dist/docs/dimensions/3d-scene-integration/dimension-indicators.mdx +2 -2
  593. package/dist/docs/dimensions/3d-scene-integration/editable-angle-indicator.mdx +1 -1
  594. package/dist/docs/dimensions/3d-scene-integration/editable-distance-dimension-indicator.mdx +1 -1
  595. package/dist/docs/dimensions/3d-scene-integration/list-selector-dimension-indicator.mdx +1 -1
  596. package/dist/docs/drag-and-drop/drag-handle.mdx +1 -1
  597. package/dist/docs/drag-and-drop/hotspot-handle.mdx +1 -1
  598. package/dist/docs/drag-and-drop/planes.mdx +1 -1
  599. package/dist/docs/drag-and-drop/rotatable.mdx +2 -2
  600. package/dist/docs/fabs/basic.mdx +6 -2
  601. package/dist/docs/index.json +42 -1
  602. package/dist/docs/layouts/custom-layout.mdx +2437 -0
  603. package/dist/docs/layouts/header/fixed.mdx +2 -2
  604. package/dist/docs/layouts/header/floating.mdx +2 -2
  605. package/dist/docs/layouts/sidebar/in-a-custom-layout.mdx +380 -0
  606. package/dist/docs/layouts/sidebar-footer/basic.mdx +32 -77
  607. package/dist/docs/other-features/client-side-rendering/declarative.mdx +1 -1
  608. package/dist/docs/other-features/error-5xx.mdx +1 -1
  609. package/dist/docs/other-features/navigation-hotspot.mdx +2 -0
  610. package/dist/docs/other-features/not-found-404.mdx +1 -1
  611. package/dist/docs/other-features/side-effects.mdx +8 -11
  612. package/dist/docs/other-features/transformers.mdx +4 -0
  613. package/dist/docs/other-features/violation-messages.mdx +52 -56
  614. package/dist/docs/phoenix/application-states.mdx +9 -7
  615. package/dist/docs/phoenix/clerk-sign-in.mdx +1 -1
  616. package/dist/docs/phoenix/components.mdx +6 -0
  617. package/dist/docs/phoenix/configurator-interface.mdx +374 -83
  618. package/dist/docs/phoenix/deployments.mdx +2 -6
  619. package/dist/docs/phoenix/domain-model.mdx +6 -0
  620. package/dist/docs/phoenix/finalization.mdx +1 -1
  621. package/dist/docs/phoenix/getting-started.mdx +6 -3
  622. package/dist/docs/phoenix/layout-slots.mdx +116 -0
  623. package/dist/docs/phoenix/localization.mdx +10 -6
  624. package/dist/docs/phoenix/migration-guide.mdx +24 -11
  625. package/dist/docs/phoenix/phoenix-cli.mdx +74 -21
  626. package/dist/docs/phoenix/project-structure.mdx +78 -36
  627. package/dist/docs/phoenix/quickstart.mdx +7 -7
  628. package/dist/docs/phoenix/sdk-builder-workflow.mdx +8 -8
  629. package/dist/docs/phoenix/testing.mdx +148 -0
  630. package/dist/docs/phoenix/webhook-membership.mdx +10 -9
  631. package/dist/docs/phoenix/webhooks.mdx +22 -5
  632. package/dist/docs/selection-and-highlight/hotspots.mdx +2 -0
  633. package/dist/domain/admin-domain/implementation/common-admin-expressions.d.ts +26 -11
  634. package/dist/domain/admin-domain/implementation/common-admin-publish.d.ts +1 -2
  635. package/dist/domain/admin-domain/index.js +1 -1
  636. package/dist/domain/application/GetApplicationWrapperHandler.d.ts +1 -1
  637. package/dist/domain/application/application-config.d.ts +7 -3
  638. package/dist/domain/application/assistant/assistant-fields.d.ts +12 -0
  639. package/dist/domain/application/assistant/assistant-fields.js +1 -0
  640. package/dist/domain/application/assistant/assistant-manifest.d.ts +9 -1
  641. package/dist/domain/application/assistant/assistant-resolved-manifest.d.ts +38 -2
  642. package/dist/domain/application/assistant/assistant-resolved-manifest.js +1 -1
  643. package/dist/domain/application/assistant/build-assistant-lenses.d.ts +14 -0
  644. package/dist/domain/application/assistant/build-assistant-lenses.js +5 -0
  645. package/dist/domain/application/assistant/build-assistant-manifest.js +1 -1
  646. package/dist/domain/application/assistant/create-assistant-execution-schema.d.ts +32 -0
  647. package/dist/domain/application/assistant/create-assistant-execution-schema.js +1 -0
  648. package/dist/domain/application/assistant/form/assistant-form-elements.d.ts +163 -0
  649. package/dist/domain/application/assistant/form/assistant-form-elements.js +1 -0
  650. package/dist/domain/application/assistant/form/assistant-resource-path.d.ts +10 -0
  651. package/dist/domain/application/assistant/form/assistant-resource-path.js +1 -0
  652. package/dist/domain/application/assistant/form/get-assistant-form-value-attribute.d.ts +6 -0
  653. package/dist/domain/application/assistant/form/get-assistant-form-value-attribute.js +1 -0
  654. package/dist/domain/application/assistant/form/index.d.ts +4 -0
  655. package/dist/domain/application/assistant/form/index.js +1 -0
  656. package/dist/domain/application/assistant/generate-assistant-prompt.d.ts +3 -0
  657. package/dist/domain/application/assistant/generate-assistant-prompt.js +1 -1
  658. package/dist/domain/application/assistant/index.d.ts +7 -1
  659. package/dist/domain/application/assistant/index.js +1 -1
  660. package/dist/domain/application/assistant/session-setup/AssistantSetupHandler.d.ts +20 -0
  661. package/dist/domain/application/assistant/session-setup/AssistantSetupHandler.js +1 -0
  662. package/dist/domain/application/assistant/session-setup/apply-assistant-setup.d.ts +10 -0
  663. package/dist/domain/application/assistant/session-setup/apply-assistant-setup.js +1 -0
  664. package/dist/domain/application/assistant/session-setup/assistant-setup-manifest.d.ts +48 -0
  665. package/dist/domain/application/assistant/session-setup/assistant-setup-manifest.js +1 -0
  666. package/dist/domain/application/assistant/session-setup/create-session-assistant.d.ts +15 -0
  667. package/dist/domain/application/assistant/session-setup/create-session-assistant.js +1 -0
  668. package/dist/domain/application/assistant/session-setup/index.d.ts +4 -0
  669. package/dist/domain/application/assistant/session-setup/index.js +1 -0
  670. package/dist/domain/application/assistant-recipe-groups.d.ts +3 -1
  671. package/dist/domain/application/configurator-builder.d.ts +5 -2
  672. package/dist/domain/application/configurator-builder.js +1 -1
  673. package/dist/domain/application/create-initial-published-data.d.ts +5 -5
  674. package/dist/domain/application/index.d.ts +0 -1
  675. package/dist/domain/application/index.js +1 -1
  676. package/dist/domain/application/published-data/map-published-chunked-data.d.ts +1 -1
  677. package/dist/domain/application/published-data/map-published-data.d.ts +7 -3
  678. package/dist/domain/core/component/domain-component-optic.d.ts +1 -2
  679. package/dist/domain/core/component/domain-component-optic.js +2 -2
  680. package/dist/domain/core/component/system-component-filter.d.ts +15 -2
  681. package/dist/domain/core/expression/constant-expressions.d.ts +16 -8
  682. package/dist/domain/core/expression/custom-expression.d.ts +16 -3
  683. package/dist/domain/core/invariant/custom-invariants.d.ts +6 -14
  684. package/dist/domain/core/invariant/invariants.d.ts +1 -4
  685. package/dist/domain/core/invariant/violation.d.ts +50 -2
  686. package/dist/domain/core/invariant/violation.js +1 -1
  687. package/dist/domain/core/model/model.d.ts +1 -1
  688. package/dist/domain/core/recipe/recipes.d.ts +18 -50
  689. package/dist/domain/core/recipe/recipes.js +1 -1
  690. package/dist/domain/core/relation/all-of-type-relation.d.ts +8 -21
  691. package/dist/domain/core/relation/all-of-type-relation.js +1 -1
  692. package/dist/domain/core/relation/direct-relation.d.ts +13 -24
  693. package/dist/domain/core/relation/index.d.ts +0 -1
  694. package/dist/domain/core/relation/indirect-relation.d.ts +12 -67
  695. package/dist/domain/core/relation/indirect-relation.js +1 -1
  696. package/dist/domain/core/relation/relation-factory.d.ts +19 -15
  697. package/dist/domain/core/relation/relation-factory.js +1 -1
  698. package/dist/domain/core/schema/extended-schema-validator.js +1 -1
  699. package/dist/domain/core/state/state.d.ts +1 -1
  700. package/dist/domain/domain-context/index.d.ts +1 -1
  701. package/dist/domain/domain-context/undo-system.d.ts +28 -1
  702. package/dist/domain/domain-context/undo-system.js +1 -1
  703. package/dist/domain/domain-runtime/access/selectors.d.ts +9 -0
  704. package/dist/domain/domain-runtime/access/selectors.js +1 -1
  705. package/dist/domain/domain-runtime/access/types.d.ts +2 -0
  706. package/dist/domain/domain-runtime/access/types.js +1 -1
  707. package/dist/domain/domain-runtime/domain-context/selectors.d.ts +14 -13
  708. package/dist/domain/domain-runtime/domain-context/selectors.js +1 -1
  709. package/dist/domain/domain-runtime/domain-context/types.d.ts +4 -1
  710. package/dist/domain/domain-runtime/domain-runtime.d.ts +32 -16
  711. package/dist/domain/domain-runtime/errors/implementation-error-collector.d.ts +19 -0
  712. package/dist/domain/domain-runtime/errors/implementation-error-collector.js +1 -0
  713. package/dist/domain/domain-runtime/errors/implementation-error.d.ts +46 -0
  714. package/dist/domain/domain-runtime/errors/implementation-error.js +1 -0
  715. package/dist/domain/domain-runtime/errors/implementation-errors.d.ts +13 -0
  716. package/dist/domain/domain-runtime/errors/implementation-errors.js +1 -0
  717. package/dist/domain/domain-runtime/errors/index.d.ts +4 -0
  718. package/dist/domain/domain-runtime/errors/index.js +1 -0
  719. package/dist/domain/domain-runtime/errors/to-implementation-errors.d.ts +10 -0
  720. package/dist/domain/domain-runtime/errors/to-implementation-errors.js +1 -0
  721. package/dist/domain/domain-runtime/index.d.ts +1 -0
  722. package/dist/domain/domain-runtime/index.js +1 -1
  723. package/dist/domain/domain-runtime/spec/create-violation-expressions.d.ts +24 -0
  724. package/dist/domain/domain-runtime/spec/create-violation-expressions.js +1 -0
  725. package/dist/domain/domain-runtime/spec/index.d.ts +1 -1
  726. package/dist/domain/domain-runtime/spec/index.js +1 -1
  727. package/dist/domain/domain-runtime/spec/initialize.d.ts +11 -0
  728. package/dist/domain/domain-runtime/spec/initialize.js +1 -1
  729. package/dist/domain/domain-runtime/spec/module-checks/element-registration.d.ts +12 -11
  730. package/dist/domain/domain-runtime/spec/module-checks/element-registration.js +1 -1
  731. package/dist/domain/domain-runtime/spec/module-checks/index.d.ts +2 -2
  732. package/dist/domain/domain-runtime/spec/module-checks/index.js +1 -1
  733. package/dist/domain/domain-runtime/spec/module-checks/project-modules.d.ts +8 -1
  734. package/dist/domain/domain-runtime/spec/module-checks/project-modules.js +1 -1
  735. package/dist/domain/domain-runtime/spec/module-checks/resolve-action-modules.js +1 -1
  736. package/dist/domain/domain-runtime/spec/module-checks/resolve-expression-modules.js +1 -1
  737. package/dist/domain/domain-runtime/spec/module-checks/resolve-imported-transformers.d.ts +7 -7
  738. package/dist/domain/domain-runtime/spec/module-checks/resolve-imported-transformers.js +1 -1
  739. package/dist/domain/domain-runtime/spec/module-checks/resolve-invariant-modules.d.ts +2 -2
  740. package/dist/domain/domain-runtime/spec/module-checks/resolve-invariant-modules.js +1 -1
  741. package/dist/domain/domain-runtime/spec/selectors.js +1 -1
  742. package/dist/domain/domain-runtime/spec/types.d.ts +2 -0
  743. package/dist/domain/extensions/attribute-switch.d.ts +1 -1
  744. package/dist/domain/extensions/attribute-switch.js +1 -1
  745. package/dist/domain/extensions/canvas-config.d.ts +1 -1
  746. package/dist/domain/extensions/client-side-image.d.ts +2 -2
  747. package/dist/domain/extensions/client-side-image.js +1 -1
  748. package/dist/domain/extensions/common/angle-indicator-schema.d.ts +2 -2
  749. package/dist/domain/extensions/common/dimension-indicator-schema.d.ts +2 -2
  750. package/dist/domain/extensions/editable-angle-indicator.d.ts +1 -1
  751. package/dist/domain/extensions/editable-distance-dimension-indicator.d.ts +1 -1
  752. package/dist/domain/extensions/editable-offset-indicator.d.ts +1 -1
  753. package/dist/domain/extensions/editable-offset-indicator.js +1 -1
  754. package/dist/domain/extensions/fit-selection-orthographic-camera-component.js +1 -1
  755. package/dist/domain/extensions/fit-selection-perspective-camera-component.js +1 -1
  756. package/dist/domain/extensions/horizontal-tabs.d.ts +2 -2
  757. package/dist/domain/extensions/list-selector-dimension-indicator.d.ts +1 -1
  758. package/dist/domain/extensions/navigation-steps.d.ts +2 -2
  759. package/dist/domain/extensions/offset-indicator.js +1 -1
  760. package/dist/domain/extensions/rotation-handle.d.ts +2 -2
  761. package/dist/domain/extensions/save-template-thumbnail.d.ts +2 -2
  762. package/dist/domain/extensions/save-template-thumbnail.js +1 -1
  763. package/dist/domain/extensions/scene-entity-animation.js +1 -1
  764. package/dist/domain/mocks/create-mock-domain-context.d.ts +1 -1
  765. package/dist/domain/mocks/create-mock-domain-runtime.d.ts +18 -9
  766. package/dist/domain/mocks/create-mock-domain-runtime.js +1 -1
  767. package/dist/domain/mocks/create-mock-domain.d.ts +1 -1
  768. package/dist/domain/mocks/create-mock-domain.js +1 -1
  769. package/dist/domain/mocks/create-mock-state.d.ts +2 -2
  770. package/dist/domain/mocks/create-test-application-config.d.ts +59 -0
  771. package/dist/domain/mocks/create-test-application-config.js +1 -0
  772. package/dist/domain/mocks/index.d.ts +1 -0
  773. package/dist/domain/mocks/index.js +1 -1
  774. package/dist/domain/projections/blender-projections/camera.d.ts +1 -1
  775. package/dist/domain/system-components/application-config.d.ts +2 -2
  776. package/dist/domain/system-components/child-entity-selection.js +1 -1
  777. package/dist/domain/system-components/collision-box-geometry.d.ts +4 -2
  778. package/dist/domain/system-components/collision-geometry.d.ts +4 -2
  779. package/dist/domain/system-components/collision-point-geometry.d.ts +4 -2
  780. package/dist/domain/system-components/common/material-override-schema.d.ts +2 -2
  781. package/dist/domain/system-components/common/recipes.d.ts +21 -3
  782. package/dist/domain/system-components/common/recipes.js +1 -1
  783. package/dist/domain/system-components/common/scene-entity-control-schema.d.ts +3 -0
  784. package/dist/domain/system-components/common/scene-entity-control-schema.js +1 -1
  785. package/dist/domain/system-components/constraint.d.ts +10 -23
  786. package/dist/domain/system-components/drag-handle.d.ts +1 -1
  787. package/dist/domain/system-components/drag-handle.js +1 -1
  788. package/dist/domain/system-components/fit-entity-orthographic-camera-component.js +1 -1
  789. package/dist/domain/system-components/fit-entity-perspective-camera-component.js +1 -1
  790. package/dist/domain/system-components/fit-root-orthographic-camera-component.js +1 -1
  791. package/dist/domain/system-components/fit-root-perspective-camera-component.js +1 -1
  792. package/dist/domain/system-components/hotspot-drag-handle.d.ts +1 -1
  793. package/dist/domain/system-components/hotspot-drag-handle.js +1 -1
  794. package/dist/domain/system-components/material-swatch.js +1 -1
  795. package/dist/domain/system-components/scene-entity-material-override.d.ts +1 -1
  796. package/dist/domain/system-components/scene-entity-object-material-override.d.ts +1 -1
  797. package/dist/domain/system-components/scene-entity-object-text-decal.d.ts +1 -1
  798. package/dist/domain/system-components/scene-entity-object-transimissive-material-override.d.ts +1 -1
  799. package/dist/domain/system-components/scene-entity-transimissive-material-override.d.ts +1 -1
  800. package/dist/domain/system-components/static-orthographic-camera-component.js +1 -1
  801. package/dist/domain/system-components/static-perspective-camera-component.js +1 -1
  802. package/dist/domain/utils/eval-cache.d.ts +1 -1
  803. package/dist/domain/utils/map-nested-object.d.ts +1 -1
  804. package/dist/editor/Editor.d.ts +7 -0
  805. package/dist/editor/Editor.js +1 -1
  806. package/dist/editor/domain-editors/use-implementation-files.d.ts +1 -2
  807. package/dist/editor/mocks/CreateMockYaml.js +2 -2
  808. package/dist/editor/mocks/EditorMockContext.d.ts +2 -0
  809. package/dist/editor/mocks/EditorMockContext.js +1 -1
  810. package/dist/globals/index.d.ts +2 -0
  811. package/dist/i18n/locales/cs/messages.js +1 -1
  812. package/dist/i18n/locales/da/messages.js +1 -1
  813. package/dist/i18n/locales/de/messages.js +1 -1
  814. package/dist/i18n/locales/de-AT/messages.js +1 -1
  815. package/dist/i18n/locales/en/messages.js +1 -1
  816. package/dist/i18n/locales/en-AU/messages.js +1 -1
  817. package/dist/i18n/locales/en-GB/messages.js +1 -1
  818. package/dist/i18n/locales/es/messages.js +1 -1
  819. package/dist/i18n/locales/fr/messages.js +1 -1
  820. package/dist/i18n/locales/hu/messages.js +1 -1
  821. package/dist/i18n/locales/it/messages.js +1 -1
  822. package/dist/i18n/locales/nl/messages.js +1 -1
  823. package/dist/i18n/locales/pl/messages.js +1 -1
  824. package/dist/i18n/locales/pt/messages.js +1 -1
  825. package/dist/i18n/locales/ro/messages.js +1 -1
  826. package/dist/i18n/locales/sk/messages.js +1 -1
  827. package/dist/i18n/locales/tr/messages.js +1 -1
  828. package/dist/legacy/domain-cli/gen/configurator-builder.js +13 -12
  829. package/dist/legacy/domain-cli/gen/constant-expressions.js +1 -1
  830. package/dist/legacy/domain-cli/gen/defaults.js +1 -7
  831. package/dist/legacy/domain-cli/gen/invariants.js +3 -4
  832. package/dist/legacy/domain-cli/gen/relations.js +1 -1
  833. package/dist/legacy/domain-cli/utils/cache.d.ts +1 -1
  834. package/dist/legacy/domain-cli/utils/cache.js +1 -1
  835. package/dist/legacy/domain-spec/__generated/domain-schema.d.ts +160 -148
  836. package/dist/legacy/phoenix-cli/project-gen/generators/file-templates/agents/claude-md.d.ts +1 -1
  837. package/dist/legacy/phoenix-cli/project-gen/generators/file-templates/agents/cursor-rules.d.ts +1 -1
  838. package/dist/legacy/phoenix-cli/project-gen/generators/file-templates/agents/shared-sdk-content.d.ts +1 -1
  839. package/dist/legacy/phoenix-cli/project-gen/generators/file-templates/agents/shared-sdk-content.js +7 -1
  840. package/dist/legacy/phoenix-cli/project-gen/generators/file-templates/domain-index.js +15 -13
  841. package/dist/legacy/phoenix-cli/project-gen/generators/file-templates/frontend-admin.js +15 -14
  842. package/dist/legacy/phoenix-cli/project-gen/generators/file-templates/frontend-configurator.js +14 -12
  843. package/dist/legacy/phoenix-cli/project-gen/generators/file-templates/frontend-embedded-admin.js +14 -13
  844. package/dist/legacy/phoenix-cli/project-gen/generators/file-templates/frontend-embedded-configurator.js +13 -11
  845. package/dist/phoenix/application-spec/application-spec-builder.d.ts +0 -2
  846. package/dist/phoenix/application-spec/application-spec-builder.js +1 -1
  847. package/dist/phoenix/application-spec/generate-application-spec-project.d.ts +0 -2
  848. package/dist/phoenix/application-spec/generate-application-spec-project.js +2 -2
  849. package/dist/phoenix/application-spec/generate-application-spec-story.js +2 -2
  850. package/dist/phoenix/application-spec/generate-project-files.d.ts +0 -2
  851. package/dist/phoenix/application-spec/project-files.js +1 -1
  852. package/dist/phoenix/bin.d.ts +2 -0
  853. package/dist/phoenix/bin.js +2 -0
  854. package/dist/phoenix/check-configs/built-in-eslint-config.d.ts +9 -0
  855. package/dist/phoenix/check-configs/built-in-eslint-config.js +1 -0
  856. package/dist/phoenix/check-configs/eslint-config.d.ts +10 -0
  857. package/dist/phoenix/check-configs/eslint-config.js +1 -0
  858. package/dist/phoenix/check-configs/index.d.ts +8 -0
  859. package/dist/phoenix/check-configs/index.js +1 -0
  860. package/dist/phoenix/check-configs/typescript-project.d.ts +5 -0
  861. package/dist/phoenix/check-configs/typescript-project.js +1 -0
  862. package/dist/phoenix/cli.d.ts +0 -1
  863. package/dist/phoenix/cli.js +1 -2
  864. package/dist/phoenix/commands/build.js +1 -1
  865. package/dist/phoenix/commands/check.js +1 -1
  866. package/dist/phoenix/commands/clean.js +1 -1
  867. package/dist/phoenix/commands/deploy.js +2 -2
  868. package/dist/phoenix/commands/deps/deps.d.ts +73 -0
  869. package/dist/phoenix/commands/deps/deps.js +3 -0
  870. package/dist/phoenix/commands/deps/index.d.ts +1 -0
  871. package/dist/phoenix/commands/deps/index.js +1 -0
  872. package/dist/phoenix/commands/deps/sdk-manifest.d.ts +12 -0
  873. package/dist/phoenix/commands/deps/sdk-manifest.js +1 -0
  874. package/dist/phoenix/commands/dev.js +5 -5
  875. package/dist/phoenix/commands/fix.js +1 -1
  876. package/dist/phoenix/commands/index.d.ts +1 -0
  877. package/dist/phoenix/commands/index.js +1 -1
  878. package/dist/phoenix/commands/init.d.ts +17 -5
  879. package/dist/phoenix/commands/init.js +1 -1
  880. package/dist/phoenix/commands/link.js +1 -1
  881. package/dist/phoenix/commands/prettier.js +1 -1
  882. package/dist/phoenix/commands/sync.js +1 -1
  883. package/dist/phoenix/commands/unlink.js +1 -1
  884. package/dist/phoenix/services/application-spec-project-watcher.d.ts +2 -2
  885. package/dist/phoenix/services/application-spec-project-watcher.js +3 -3
  886. package/dist/phoenix/services/lingui.d.ts +8 -0
  887. package/dist/phoenix/services/lingui.js +1 -1
  888. package/dist/phoenix/services/source-archive.d.ts +1 -0
  889. package/dist/phoenix/services/source-archive.js +1 -1
  890. package/dist/phoenix/services/swc.js +1 -1
  891. package/dist/phoenix/services/vite-config.js +1 -1
  892. package/dist/phoenix/utils/git/index.d.ts +1 -0
  893. package/dist/phoenix/utils/git/index.js +1 -0
  894. package/dist/phoenix/utils/git/is-inside-git-repository.d.ts +6 -0
  895. package/dist/phoenix/utils/git/is-inside-git-repository.js +1 -0
  896. package/dist/phoenix/utils/index.d.ts +5 -2
  897. package/dist/phoenix/utils/index.js +1 -1
  898. package/dist/phoenix/utils/node-version/index.d.ts +1 -0
  899. package/dist/phoenix/utils/node-version/index.js +1 -0
  900. package/dist/phoenix/utils/node-version/supported-node-version.d.ts +12 -0
  901. package/dist/phoenix/utils/node-version/supported-node-version.js +4 -0
  902. package/dist/phoenix/utils/package-info.d.ts +0 -9
  903. package/dist/phoenix/utils/package-info.js +1 -1
  904. package/dist/phoenix/utils/package-manager/index.d.ts +2 -0
  905. package/dist/phoenix/utils/package-manager/index.js +1 -0
  906. package/dist/phoenix/utils/package-manager/package-manager-commands.d.ts +19 -0
  907. package/dist/phoenix/utils/package-manager/package-manager-commands.js +1 -0
  908. package/dist/phoenix/utils/package-manager/pnpm-project.d.ts +9 -0
  909. package/dist/phoenix/utils/package-manager/pnpm-project.js +1 -0
  910. package/dist/phoenix/utils/run-command.d.ts +11 -0
  911. package/dist/phoenix/utils/run-command.js +1 -1
  912. package/dist/phoenix/utils/sdk-tool/index.d.ts +1 -0
  913. package/dist/phoenix/utils/sdk-tool/index.js +1 -0
  914. package/dist/phoenix/utils/sdk-tool/resolve-sdk-tool-bin.d.ts +15 -0
  915. package/dist/phoenix/utils/sdk-tool/resolve-sdk-tool-bin.js +1 -0
  916. package/dist/{configurator/common → react-sdk/application-runtime/common-services/analytics}/frontend-analytics.d.ts +6 -0
  917. package/dist/react-sdk/application-runtime/common-services/analytics/frontend-analytics.js +1 -0
  918. package/dist/react-sdk/application-runtime/common-services/analytics/index.d.ts +1 -0
  919. package/dist/react-sdk/application-runtime/common-services/analytics/index.js +1 -1
  920. package/dist/react-sdk/application-runtime/hooks/use-access-service.d.ts +2 -0
  921. package/dist/react-sdk/application-runtime/mocks/create-mock-application-runtime.js +1 -1
  922. package/dist/react-sdk/application-runtime/routing/access-service.d.ts +1 -0
  923. package/dist/react-sdk/application-runtime/runtime/create-application-runtime.d.ts +33 -16
  924. package/dist/react-sdk/application-runtime/runtime/create-application-runtime.js +1 -1
  925. package/dist/react-sdk/domain-application-context/DomainLifecycleBoundary.js +1 -1
  926. package/dist/react-sdk/domain-context/common-hooks/index.d.ts +8 -0
  927. package/dist/react-sdk/domain-context/common-hooks/index.js +1 -0
  928. package/dist/react-sdk/domain-context/common-hooks/use-configurator-messages.d.ts +41 -0
  929. package/dist/react-sdk/domain-context/common-hooks/use-configurator-messages.js +1 -0
  930. package/dist/react-sdk/domain-context/common-hooks/use-domain-context.d.ts +4 -4
  931. package/dist/react-sdk/domain-context/component-hooks/index.d.ts +1 -0
  932. package/dist/react-sdk/domain-context/component-hooks/index.js +1 -0
  933. package/dist/react-sdk/domain-context/component-hooks/use-component.js +1 -1
  934. package/dist/react-sdk/domain-context/entity-hooks/use-domain-entity-state.js +1 -1
  935. package/dist/react-sdk/domain-context/entity-hooks/use-entity-price.js +1 -1
  936. package/dist/react-sdk/domain-context/entity-hooks/use-root-entity-id.js +1 -1
  937. package/dist/react-sdk/domain-context/entity-hooks/use-root-entity-state.js +1 -1
  938. package/dist/react-sdk/domain-context/index.d.ts +8 -1
  939. package/dist/react-sdk/domain-context/index.js +1 -1
  940. package/dist/react-sdk/domain-context/system-hooks/composition-hooks.js +1 -1
  941. package/dist/react-sdk/domain-context/system-hooks/dimension-hooks.js +1 -1
  942. package/dist/react-sdk/domain-context/system-hooks/generate-share-link-hooks.d.ts +8 -0
  943. package/dist/react-sdk/domain-context/system-hooks/generate-share-link-hooks.js +1 -0
  944. package/dist/react-sdk/domain-context/system-hooks/hover-hooks.js +1 -1
  945. package/dist/react-sdk/domain-context/system-hooks/locale-switch-hooks.d.ts +24 -0
  946. package/dist/react-sdk/domain-context/system-hooks/locale-switch-hooks.js +1 -0
  947. package/dist/react-sdk/domain-context/system-hooks/navigation-hooks.d.ts +11 -0
  948. package/dist/react-sdk/domain-context/system-hooks/navigation-hooks.js +1 -1
  949. package/dist/react-sdk/domain-context/system-hooks/selection-hooks.js +1 -1
  950. package/dist/react-sdk/domain-context/system-hooks/share-links-hooks.d.ts +32 -0
  951. package/dist/react-sdk/domain-context/system-hooks/share-links-hooks.js +1 -0
  952. package/dist/react-sdk/domain-context/system-hooks/step-navigation-hooks.d.ts +57 -0
  953. package/dist/react-sdk/domain-context/system-hooks/step-navigation-hooks.js +1 -0
  954. package/dist/react-sdk/domain-context/system-hooks/tab-navigation-hooks.d.ts +61 -0
  955. package/dist/react-sdk/domain-context/system-hooks/tab-navigation-hooks.js +1 -0
  956. package/dist/react-sdk/domain-context/system-hooks/undo-redo-hooks.d.ts +20 -0
  957. package/dist/react-sdk/domain-context/system-hooks/undo-redo-hooks.js +1 -0
  958. package/dist/react-sdk/domain-controls/hooks/use-angle-dimension.d.ts +1 -1
  959. package/dist/react-sdk/elements/configurator-error-page-props.d.ts +20 -0
  960. package/dist/react-sdk/elements/configurator-error-page-props.js +1 -0
  961. package/dist/react-sdk/elements/index.d.ts +1 -0
  962. package/dist/react-sdk/handlers/FinalizeActionRunner.d.ts +13 -0
  963. package/dist/react-sdk/handlers/FinalizeActionRunner.js +1 -0
  964. package/dist/react-sdk/handlers/FinalizeActionsHost.d.ts +10 -0
  965. package/dist/react-sdk/handlers/FinalizeActionsHost.js +1 -0
  966. package/dist/react-sdk/handlers/FinalizeActionsProvider.d.ts +11 -0
  967. package/dist/react-sdk/handlers/FinalizeActionsProvider.js +1 -0
  968. package/dist/react-sdk/handlers/finalize-actions-context.d.ts +6 -0
  969. package/dist/react-sdk/handlers/finalize-actions-context.js +1 -0
  970. package/dist/react-sdk/handlers/finalize-actions-store.d.ts +23 -0
  971. package/dist/react-sdk/handlers/finalize-actions-store.js +1 -0
  972. package/dist/react-sdk/handlers/index.d.ts +6 -0
  973. package/dist/react-sdk/handlers/index.js +1 -1
  974. package/dist/react-sdk/handlers/use-finalize-action.d.ts +32 -0
  975. package/dist/react-sdk/handlers/use-finalize-action.js +1 -0
  976. package/dist/react-sdk/handlers/use-finalize-actions.d.ts +53 -0
  977. package/dist/react-sdk/handlers/use-finalize-actions.js +1 -0
  978. package/dist/react-sdk/index.d.ts +2 -0
  979. package/dist/react-sdk/index.js +1 -1
  980. package/dist/react-sdk/loading-state/loading-state-manager.d.ts +5 -0
  981. package/dist/react-sdk/loading-state/loading-state-manager.js +1 -1
  982. package/dist/react-sdk/responsive-state/ResponsiveStateProvider.d.ts +25 -0
  983. package/dist/react-sdk/responsive-state/ResponsiveStateProvider.js +1 -0
  984. package/dist/react-sdk/responsive-state/canvas-padding.d.ts +14 -0
  985. package/dist/react-sdk/responsive-state/canvas-padding.js +1 -0
  986. package/dist/react-sdk/responsive-state/index.d.ts +5 -0
  987. package/dist/react-sdk/responsive-state/index.js +1 -0
  988. package/dist/react-sdk/responsive-state/responsive-state-manager.d.ts +111 -0
  989. package/dist/react-sdk/responsive-state/responsive-state-manager.js +1 -0
  990. package/dist/react-sdk/responsive-state/use-responsive-state-manager.d.ts +10 -0
  991. package/dist/react-sdk/responsive-state/use-responsive-state-manager.js +1 -0
  992. package/dist/react-sdk/responsive-state/use-responsive-state.d.ts +11 -0
  993. package/dist/react-sdk/responsive-state/use-responsive-state.js +1 -0
  994. package/dist/react-sdk/scene-control-elements/AddEntityFabElement.d.ts +36 -0
  995. package/dist/react-sdk/scene-control-elements/AddEntityFabElement.js +1 -0
  996. package/dist/react-sdk/scene-control-elements/DeleteEntityFabElement.d.ts +44 -0
  997. package/dist/react-sdk/scene-control-elements/DeleteEntityFabElement.js +1 -0
  998. package/dist/react-sdk/scene-control-elements/NavigationHotspotElement.d.ts +38 -0
  999. package/dist/react-sdk/scene-control-elements/NavigationHotspotElement.js +1 -0
  1000. package/dist/react-sdk/scene-control-elements/SelectionHotspotElement.d.ts +30 -0
  1001. package/dist/react-sdk/scene-control-elements/SelectionHotspotElement.js +1 -0
  1002. package/dist/react-sdk/scene-control-elements/ToolMenuFabElement.d.ts +30 -0
  1003. package/dist/react-sdk/scene-control-elements/ToolMenuFabElement.js +1 -0
  1004. package/dist/react-sdk/scene-control-elements/create-add-entity-fab.d.ts +9 -0
  1005. package/dist/react-sdk/scene-control-elements/create-add-entity-fab.js +1 -0
  1006. package/dist/react-sdk/scene-control-elements/create-delete-entity-fab.d.ts +9 -0
  1007. package/dist/react-sdk/scene-control-elements/create-delete-entity-fab.js +1 -0
  1008. package/dist/react-sdk/scene-control-elements/create-navigation-hotspot.d.ts +10 -0
  1009. package/dist/react-sdk/scene-control-elements/create-navigation-hotspot.js +1 -0
  1010. package/dist/react-sdk/scene-control-elements/create-selection-hotspot.d.ts +9 -0
  1011. package/dist/react-sdk/scene-control-elements/create-selection-hotspot.js +1 -0
  1012. package/dist/react-sdk/scene-control-elements/create-tool-menu-fab.d.ts +9 -0
  1013. package/dist/react-sdk/scene-control-elements/create-tool-menu-fab.js +1 -0
  1014. package/dist/react-sdk/scene-control-elements/index.d.ts +11 -0
  1015. package/dist/react-sdk/scene-control-elements/index.js +1 -0
  1016. package/dist/react-sdk/scene-control-elements/scene-control-tooltip-visibility.d.ts +5 -0
  1017. package/dist/react-sdk/scene-control-elements/scene-control-tooltip-visibility.js +1 -0
  1018. package/dist/react-sdk/session/NotAuthenticatedPage.d.ts +4 -0
  1019. package/dist/react-sdk/session/NotAuthenticatedPage.js +1 -1
  1020. package/dist/ui-sdk/icons/__generated/Lightbulb.d.ts +3 -0
  1021. package/dist/ui-sdk/icons/__generated/Lightbulb.js +1 -0
  1022. package/dist/ui-sdk/icons/__generated/XCircle.d.ts +3 -0
  1023. package/dist/ui-sdk/icons/__generated/XCircle.js +1 -0
  1024. package/dist/ui-sdk/icons/__generated/index.d.ts +4 -0
  1025. package/dist/ui-sdk/icons/__generated/index.js +1 -1
  1026. package/dist/ui-sdk/icons/icons-registry.js +1 -1
  1027. package/dist/ui-sdk/responsive-application/ResponsiveApplicationProvider.d.ts +9 -0
  1028. package/dist/ui-sdk/responsive-application/ResponsiveApplicationProvider.js +1 -1
  1029. package/dist/ui-sdk/responsive-application/index.d.ts +1 -0
  1030. package/dist/ui-sdk/responsive-application/responsive-state-store.d.ts +57 -0
  1031. package/dist/ui-sdk/responsive-application/responsive-state-store.js +1 -0
  1032. package/dist/ui-sdk/responsive-application/use-store-responsive-info.d.ts +7 -0
  1033. package/dist/ui-sdk/responsive-application/use-store-responsive-info.js +1 -0
  1034. package/dist/ui-sdk/theme/types.d.ts +1 -1
  1035. package/dist/webhook/builders/webhook-builder.js +1 -1
  1036. package/package.json +48 -36
  1037. package/schema/domain-spec.json +1201 -217
  1038. package/dist/application-spec/generate-application/code/templates/nvmrc.d.ts +0 -1
  1039. package/dist/application-spec/generate-application/code/templates/nvmrc.js +0 -2
  1040. package/dist/application-spec/generate-application/code/templates/package-json.d.ts +0 -10
  1041. package/dist/application-spec/generate-application/code/templates/package-json.js +0 -1
  1042. package/dist/application-spec/generate-application/code/templates/prettier-ignore.d.ts +0 -1
  1043. package/dist/application-spec/generate-application/code/templates/prettier-ignore.js +0 -6
  1044. package/dist/application-spec/generate-application/code/templates/webhook-implementation.d.ts +0 -1
  1045. package/dist/application-spec/generate-application/code/templates/webhook-implementation.js +0 -7
  1046. package/dist/configurator/common/frontend-analytics.js +0 -1
  1047. package/dist/configurator/ui/phoenix-layout-elements/language/use-locale-options.d.ts +0 -4
  1048. package/dist/configurator/ui/phoenix-layout-elements/language/use-locale-options.js +0 -1
  1049. package/dist/configurator/ui/phoenix-layout-elements/measurements/use-measurements-visibility.d.ts +0 -4
  1050. package/dist/configurator/ui/phoenix-layout-elements/measurements/use-measurements-visibility.js +0 -1
  1051. package/dist/domain/application/resource-builder.d.ts +0 -13
  1052. package/dist/domain/application/resource-builder.js +0 -1
  1053. package/dist/domain/core/relation/relation-implementation.d.ts +0 -7
  1054. package/dist/domain/domain-runtime/spec/invariant-builder.d.ts +0 -26
  1055. package/dist/domain/domain-runtime/spec/invariant-builder.js +0 -1
  1056. package/dist/phoenix/commands/generate-project-files.d.ts +0 -6
  1057. package/dist/phoenix/commands/generate-project-files.js +0 -1
  1058. /package/dist/{domain/core/relation/relation-implementation.js → application-spec/core/expressions/relation-expression-params.js} +0 -0
  1059. /package/dist/application-spec/{core → enhanced-json}/eval-code-uses-self.d.ts +0 -0
  1060. /package/dist/application-spec/{core → enhanced-json}/eval-code-uses-self.js +0 -0
  1061. /package/dist/application-spec/{core → enhanced-json}/eval-to-constant.js +0 -0
@@ -0,0 +1,2437 @@
1
+ # Custom Layout
2
+
3
+ Make the configurator look like the brand's own product page. A furniture shop wants its table configurator to read like the rest of its site: a floating panel on the left with the product's name, the edge finishes as picture cards, the price in large type and one clear call to action, and the table in the space beside it. On a phone the panel becomes a sheet at the bottom, and a button on the table's edge offers the finishes right where they apply, and the layout's own buttons switch between the whole table and a close-up of its edge. The project writes that page as one React component. Phoenix supplies the 3D scene, the product's state and a few hooks; every pixel around the scene is the project's own.
4
+
5
+ - [Choose this approach](#choose-this-approach)
6
+ - [Register the layout](#register-the-layout)
7
+ - [What the layout has to do](#what-the-layout-has-to-do)
8
+ - [Read and change the product](#read-and-change-the-product)
9
+ - [Draw the choices](#draw-the-choices)
10
+ - [Offer fullscreen](#offer-fullscreen)
11
+ - [Show messages](#show-messages)
12
+ - [Request a quote](#request-a-quote)
13
+ - [Serve read mode](#serve-read-mode)
14
+ - [Fit a phone](#fit-a-phone)
15
+ - [Put a control on the product](#put-a-control-on-the-product)
16
+ - [Control the scene](#control-the-scene)
17
+ - [The spec the layout reads](#the-spec-the-layout-reads)
18
+ - [Try the example](#try-the-example)
19
+ - [Test cases](#test-cases)
20
+ - [Known gaps](#known-gaps)
21
+ - [Related pages](#related-pages)
22
+ - [Complete Implementation](#complete-implementation)
23
+
24
+ ## Choose this approach
25
+
26
+ Write your own layout when the configurator has to follow a design the built-in layout cannot take on: the brand's typography, controls and spacing, a panel on the left, a top bar with the price, an area the built-in layout has no place for.
27
+
28
+ Stay with the built-in layout when its structure fits and only its parts change. [Universal](?path=/docs/layouts-universal--docs) demonstrates that layout, and the pages of its parts describe what the spec configures: [Header](?path=/docs/layouts-header-floating--docs), [Sidebar](?path=/docs/layouts-sidebar-general--docs), [Sidebar Footer](?path=/docs/layouts-sidebar-footer-basic--docs), [Toolbar](?path=/docs/layouts-toolbar--docs) and [View Controls](?path=/docs/layouts-view-controls--docs).
29
+
30
+ A project layout replaces all of that. None of the built-in sidebar, footer, toolbar or property pages is rendered for it, so the layout builds every control the user needs. This example uses no SDK component that draws UI: only the scene, the safe-area hook and hooks that read and change the product's state. A layout may also mount the SDK's own pieces where it wants them, see [Configurator Interface → Loaded Configuration UI](?path=/docs/phoenix-configurator-interface--docs#loaded-configuration-ui).
31
+
32
+ ## Register the layout
33
+
34
+ Create `src/elements/ConfiguratorLayout.tsx` with a default export made by `phx.frontend.createCustomPhoenixLayoutElement`. The name `ConfiguratorLayout` is what makes it the layout: Phoenix renders the element registered under that name for every loaded configuration, in owner and in read mode, whatever `layout` the spec sets. Nothing in the YAML refers to it.
35
+
36
+ ```tsx
37
+ import { Box } from '@mui/material'
38
+ import { useState } from 'react'
39
+
40
+ import { LayoutSlots, useSceneSafeArea } from '@salsita-ai/sdk/configurator'
41
+ import { useActiveViewports } from '@salsita-ai/sdk/react'
42
+
43
+ import { phx } from '../../.phoenix/phx.js'
44
+ import { BottomSheet } from '../_shared/BottomSheet.js'
45
+ import { FullscreenToggle } from '../_shared/FullscreenToggle.js'
46
+ import { MessageToast } from '../_shared/MessageToast.js'
47
+ import { ProductPanel } from '../_shared/ProductPanel.js'
48
+ import { SceneControls } from '../_shared/SceneControls.js'
49
+
50
+ const GUTTER = 24
51
+ const PANEL_WIDTH = 380
52
+ const PHONE_GUTTER = 16
53
+ const TOUCH_TARGET = 44
54
+
55
+ const ConfiguratorLayout = () => {
56
+ const { containerRef, safeAreaRef } = useSceneSafeArea()
57
+ const isFullscreen = phx.frontend.useIsFullscreenActive()
58
+ // `null` until the container has been measured; the layout shows only the scene until then
59
+ const viewports = useActiveViewports()
60
+ const [isSheetOpen, setSheetOpen] = useState(false)
61
+
62
+ const isDesktop = viewports?.includes('desktop') ?? false
63
+ const gutter = isDesktop ? GUTTER : PHONE_GUTTER
64
+
65
+ return (
66
+ <Box
67
+ component="div"
68
+ ref={containerRef}
69
+ // `clip`, not `hidden`: what overflows, such as the sheet's fill below its edge, can never be scrolled into view,
70
+ // not even by the browser when the focus moves
71
+ sx={{ position: 'absolute', inset: 0, display: 'flex', flexDirection: 'column', overflow: 'clip' }}
72
+ >
73
+ <LayoutSlots.SharedCanvas />
74
+
75
+ {viewports !== null && isDesktop && !isFullscreen && (
76
+ <Box
77
+ component="aside"
78
+ sx={{
79
+ position: 'absolute',
80
+ insetBlockStart: GUTTER,
81
+ insetInlineStart: GUTTER,
82
+ inlineSize: PANEL_WIDTH,
83
+ maxBlockSize: `calc(100% - ${2 * GUTTER}px)`,
84
+ display: 'flex',
85
+ flexDirection: 'column',
86
+ borderRadius: 5,
87
+ bgcolor: 'background.paper',
88
+ boxShadow: '0 12px 40px rgba(0, 0, 0, 0.12)',
89
+ // A very short container, such as a phone held sideways, scrolls the panel instead of clipping its footer
90
+ overflowX: 'hidden',
91
+ overflowY: 'auto',
92
+ overscrollBehavior: 'contain',
93
+ }}
94
+ >
95
+ <ProductPanel />
96
+ </Box>
97
+ )}
98
+
99
+ {viewports !== null && (
100
+ <Box
101
+ component="div"
102
+ ref={safeAreaRef}
103
+ sx={{
104
+ // Desktop: right of the panel. Phone: above the sheet, whose height the column gives the rest.
105
+ ...(isDesktop
106
+ ? {
107
+ position: 'absolute',
108
+ insetBlock: 0,
109
+ insetInlineStart: isFullscreen ? 0 : PANEL_WIDTH + 2 * GUTTER,
110
+ insetInlineEnd: 0,
111
+ }
112
+ : { position: 'relative', flex: '1 1 0', minBlockSize: 0 }),
113
+ pointerEvents: 'none',
114
+ }}
115
+ >
116
+ <Box
117
+ component="div"
118
+ sx={{ position: 'absolute', insetBlockStart: gutter, insetInlineEnd: gutter, pointerEvents: 'auto' }}
119
+ >
120
+ <FullscreenToggle compact={!isDesktop} />
121
+ </Box>
122
+ <Box
123
+ component="div"
124
+ sx={{
125
+ position: 'absolute',
126
+ pointerEvents: 'auto',
127
+ // Desktop: bottom left, above the row of view controls. Phone: at the top beside the fullscreen button,
128
+ // clear of the sheet's handle and the view controls.
129
+ ...(isDesktop
130
+ ? { insetBlockEnd: 2 * GUTTER + TOUCH_TARGET, insetInlineStart: GUTTER }
131
+ : { insetBlockStart: gutter, insetInline: `${gutter}px ${2 * gutter + TOUCH_TARGET}px` }),
132
+ }}
133
+ >
134
+ <MessageToast />
135
+ </Box>
136
+ {/* A phone in fullscreen keeps only the reset, as the built-in layout does. Below 1024 pixels (`tablet`) the
137
+ free area beside the panel is narrow, so the reset shows only its icon there too. */}
138
+ <Box
139
+ component="div"
140
+ sx={{ position: 'absolute', insetBlockEnd: gutter, insetInlineEnd: gutter, pointerEvents: 'auto' }}
141
+ >
142
+ <SceneControls
143
+ compact={!isDesktop || (viewports?.includes('tablet') ?? false)}
144
+ resetOnly={!isDesktop && isFullscreen}
145
+ />
146
+ </Box>
147
+ </Box>
148
+ )}
149
+
150
+ {viewports !== null && !isDesktop && !isFullscreen && (
151
+ <BottomSheet open={isSheetOpen} onOpenChange={setSheetOpen} label="Product details">
152
+ <ProductPanel collapsed={!isSheetOpen} inSheet />
153
+ </BottomSheet>
154
+ )}
155
+ </Box>
156
+ )
157
+ }
158
+
159
+ export default phx.frontend.createCustomPhoenixLayoutElement('ConfiguratorLayout', ConfiguratorLayout)
160
+ ```
161
+
162
+ The components it uses live in `src/_shared/`, which Phoenix does not import by convention, so the layout imports them itself. Application projects receive `phx` as a global. Storybook examples cannot rely on that project environment, so these files import it from `../../.phoenix/phx.js`; leave that import out in a project.
163
+
164
+ ## What the layout has to do
165
+
166
+ - **Position the root and cover the page.** `LayoutSlots.SharedCanvas` is absolutely positioned and fills its nearest positioned ancestor. The root here is `position: absolute; inset: 0`.
167
+ - **Mount the shared canvas.** It renders the scene, and the app loader stays on screen until the scene has loaded. A layout without a canvas is not held by the loader: it leaves once the configuration is up.
168
+ - **Put the UI above the canvas.** The canvas is opaque. Content that is positioned and comes after it in the markup is painted above it; unpositioned content is painted under it and cannot be seen.
169
+ - **Tell the camera where the free area is.** `useSceneSafeArea()` returns two refs. `containerRef` goes on the element that covers the whole canvas, `safeAreaRef` on the region the product should stay visible in, here everything right of the panel, or above the sheet on a phone. The camera then frames the product in that region. The hook measures again whenever either of the two elements resizes; for a change no resize reports, such as a `transform` on an ancestor settling at the end of an animation, it also returns `update` to call. Without the two refs the product is centred in the whole canvas and sits against the panel.
170
+ - **Let the pointer through.** The safe-area element lies over the canvas, so it sets `pointerEvents: 'none'`; otherwise the scene cannot be orbited. The fullscreen button inside it switches pointer events back on.
171
+ - **Honour fullscreen.** Fullscreen is a flag in the product's state, not a browser feature. The layout reads it with `phx.frontend.useIsFullscreenActive()`, removes the panel or the sheet and lets the safe area cover the canvas, so the camera frames the product in the whole canvas.
172
+ - **Fit the width it is given.** The configurator can be embedded in a narrow column or opened on a phone. The layout reads the container's width class with `useActiveViewports()` and renders a desktop or a phone arrangement, see [Fit a phone](#fit-a-phone).
173
+ - **Serve read mode.** The same element renders a configuration shared for viewing, and the layout decides what a viewer sees.
174
+
175
+ ## Read and change the product
176
+
177
+ The panel reads everything it shows from hooks and writes the customer's choice back through one of them. The table lists the hooks the whole layout uses:
178
+
179
+ ```tsx
180
+ import { Box, Button, Typography } from '@mui/material'
181
+
182
+ import { detailComponent, finalizeActionComponent } from '@salsita-ai/sdk/domain'
183
+ import { PhoenixHandlerBoundary, useResolveLocalizable } from '@salsita-ai/sdk/react'
184
+
185
+ import { phx } from '../../.phoenix/phx.js'
186
+ import { EdgeFinishCards } from './EdgeFinishCards.js'
187
+ import { ReviewActions } from './ReviewActions.js'
188
+
189
+ const BUTTON_SX = { minBlockSize: 48, borderRadius: 999, textTransform: 'none', fontWeight: 600 } as const
190
+
191
+ interface ProductPanelProps {
192
+ // Only the name, the price and the action, for a collapsed bottom sheet
193
+ readonly collapsed?: boolean
194
+ // In a bottom sheet the cards region keeps the top of the cards in view, and the sheet scrolls when that does not fit
195
+ readonly inSheet?: boolean
196
+ }
197
+
198
+ export const ProductPanel = ({ collapsed = false, inSheet = false }: ProductPanelProps) => {
199
+ const resolve = useResolveLocalizable()
200
+ const detail = phx.frontend.useFirstRootComponent(detailComponent)
201
+ const price = phx.frontend.useRootEntityPrice()
202
+ const tableId = phx.frontend.useRootEntityId()
203
+ const edgeFinish = phx.frontend.useAttributeSelection(tableId, 'edgeFinish')
204
+ const { accessInfo } = phx.frontend.useAccessService()
205
+ const navigationState = phx.frontend.useActiveNavigationState()
206
+ const pushNavigate = phx.frontend.usePushNavigate()
207
+ const popNavigate = phx.frontend.usePopNavigate()
208
+ const navigate = phx.frontend.useNavigate()
209
+ const finalizeActions = phx.frontend.useComponents({ componentTypes: [finalizeActionComponent] }) ?? []
210
+
211
+ const isReadMode = accessInfo.viewMode
212
+ const isReview = isReadMode || navigationState !== 'configure'
213
+ // The spec's primary finalize action, or its first one
214
+ const quoteAction = finalizeActions.find(action => action.state.variant === 'primary') ?? finalizeActions[0]
215
+ const chosenEdge = edgeFinish.options.find(option => option.value === edgeFinish.value)
216
+
217
+ return (
218
+ <>
219
+ <Box component="header" sx={{ display: 'grid', gap: 1, padding: 3, paddingBlockEnd: 2 }}>
220
+ {isReadMode ? (
221
+ <Typography
222
+ variant="overline"
223
+ sx={{ justifySelf: 'start', paddingInline: 1.5, borderRadius: 999, bgcolor: 'action.selected' }}
224
+ >
225
+ View only
226
+ </Typography>
227
+ ) : (
228
+ <Typography variant="overline" color="text.secondary">
229
+ {resolve(detail?.state.subtitle)}
230
+ </Typography>
231
+ )}
232
+ <Typography variant="h5" component="h2" fontWeight={700}>
233
+ {resolve(detail?.state.title)}
234
+ </Typography>
235
+ {!collapsed && (
236
+ <Typography variant="body2" color="text.secondary">
237
+ {resolve(detail?.state.description)}
238
+ </Typography>
239
+ )}
240
+ </Box>
241
+
242
+ {!collapsed && (
243
+ <Box
244
+ component="div"
245
+ sx={{
246
+ display: 'grid',
247
+ gap: 1.5,
248
+ paddingInline: 3,
249
+ paddingBlockEnd: 3,
250
+ // In a short container the region shrinks and scrolls; a scroll past its end moves its container on
251
+ minBlockSize: inSheet ? 120 : 0,
252
+ overflowY: 'auto',
253
+ }}
254
+ >
255
+ <Typography variant="subtitle2" component="h3">
256
+ Edge finish
257
+ </Typography>
258
+ {isReview ? (
259
+ <Box component="div" sx={{ padding: 2, borderRadius: 3, bgcolor: 'action.hover' }}>
260
+ <Typography variant="body2" fontWeight={600}>
261
+ {resolve(chosenEdge?.title)}
262
+ </Typography>
263
+ <Typography variant="caption" color="text.secondary">
264
+ {resolve(chosenEdge?.description)}
265
+ </Typography>
266
+ </Box>
267
+ ) : (
268
+ <EdgeFinishCards selection={edgeFinish} />
269
+ )}
270
+ </Box>
271
+ )}
272
+
273
+ <Box component="footer" sx={{ display: 'grid', gap: 2, padding: 3, borderTop: 1, borderColor: 'divider' }}>
274
+ <Box component="div" sx={{ display: 'flex', alignItems: 'baseline', justifyContent: 'space-between' }}>
275
+ <Typography variant="body2" color="text.secondary">
276
+ Total price
277
+ </Typography>
278
+ <Typography variant="h5" component="p" fontWeight={700}>
279
+ {price}
280
+ </Typography>
281
+ </Box>
282
+ {!isReadMode && navigationState === 'configure' && (
283
+ <Button size="large" variant="contained" onClick={() => pushNavigate('checkout')} sx={BUTTON_SX}>
284
+ Review and request a quote
285
+ </Button>
286
+ )}
287
+ {!isReadMode && navigationState === 'checkout' && (
288
+ <>
289
+ <Typography variant="body2" color="text.secondary">
290
+ Your table is ready for a quote. A real shop collects the contact details here.
291
+ </Typography>
292
+ {quoteAction ? (
293
+ <PhoenixHandlerBoundary name={quoteAction.state.handler}>
294
+ <ReviewActions
295
+ handler={quoteAction.state.handler}
296
+ label={resolve(quoteAction.state.label)}
297
+ onBack={popNavigate}
298
+ />
299
+ </PhoenixHandlerBoundary>
300
+ ) : (
301
+ <Button size="large" variant="outlined" onClick={popNavigate} sx={BUTTON_SX}>
302
+ Back to the configuration
303
+ </Button>
304
+ )}
305
+ </>
306
+ )}
307
+ {!isReadMode && navigationState === 'requested' && (
308
+ <>
309
+ <Typography variant="body2" role="status">
310
+ Thank you. Your quote request is on its way, and the shop replies within two working days.
311
+ </Typography>
312
+ <Button size="large" variant="outlined" onClick={() => navigate('configure')} sx={BUTTON_SX}>
313
+ Back to the configuration
314
+ </Button>
315
+ </>
316
+ )}
317
+ </Box>
318
+ </>
319
+ )
320
+ }
321
+ ```
322
+
323
+ | Hook | What the layout uses it for |
324
+ | ---------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
325
+ | `phx.frontend.useFirstRootComponent(detailComponent)` | The `detail` component of the root entity: name, subtitle and description. `detailComponent` comes from `@salsita-ai/sdk/domain`; the hook returns `null` without one. |
326
+ | `phx.frontend.useRootEntityId()` | The id of the table, which the control hooks take. |
327
+ | `phx.frontend.useAttributeSelection(entityId, instanceName)` | The `attributeSelection` component named `edgeFinish`: the current `value` and the `options`, each with `title`, `description`, `value`, `disabled` and `onSelect`. |
328
+ | `phx.frontend.useRootEntityPrice()` | The root entity's `price` component, formatted for the current locale and currency, or `null` without one. |
329
+ | `phx.frontend.useAccessService()` | `accessInfo.viewMode` is `true` while a configuration shared for viewing is open, and also while the host sets the `readonly` property. |
330
+ | `phx.frontend.useActiveNavigationState()` | The active navigation state; the panel shows its review step while it is `checkout`. |
331
+ | `phx.frontend.usePushNavigate()` and `phx.frontend.usePopNavigate()` | Enter the review step and leave it again. |
332
+ | `phx.frontend.useNavigate()` | Return from the confirmation to the configuration, forgetting the review step. |
333
+ | `phx.frontend.useComponents({ componentTypes: [finalizeActionComponent] })` | The spec's `finalizeAction` components; the panel offers the primary one in its review step. `finalizeActionComponent` comes from `@salsita-ai/sdk/domain`. |
334
+ | `phx.frontend.useFinalizeAction(handler)` | Run the finalize action's handler, with its pending state, its error and whether finalizing is possible; see [Request a quote](#request-a-quote). |
335
+ | `phx.frontend.useIsFullscreenActive()` and `phx.frontend.useSetFullscreen()` | Read the fullscreen flag, and set it from the layout's own button. |
336
+ | `phx.frontend.useActiveViewState()` and `phx.frontend.useSetViewState()` | Read the active view state, one of the spec's `viewStates`, to mark the active view button, and make another one active; see [Control the scene](#control-the-scene). |
337
+ | `phx.frontend.useResetCamera()` | Move the camera back to the framing of the active camera, undoing the customer's orbit, pan and zoom. |
338
+ | `phx.frontend.useUndoRedo()` | Not used here: whether there is a change to undo or redo, and `undo` and `redo`, for a layout's own undo and redo buttons; see [Known gaps](#known-gaps). |
339
+ | `useActiveViewports()` from `@salsita-ai/sdk/react` | The width classes of the configurator's container, or `null` before it is measured; the layout renders its phone arrangement unless it includes `desktop`, see [Fit a phone](#fit-a-phone). |
340
+ | `phx.frontend.useConfiguratorMessages(onMessage)` | Receive violations, side-effect hints and errors one by one, with their text resolved, for the layout's own toast; see [Show messages](#show-messages). |
341
+ | `useResolveLocalizable()` from `@salsita-ai/sdk/react` | Turns the localizable texts of the spec into strings in the current language. [Localization](?path=/docs/phoenix-localization--docs) describes it and `LocalizableMessage`. |
342
+ | `PhoenixHandlerBoundary` from `@salsita-ai/sdk/react` | Wraps the review step's buttons, so an edited handler takes effect without a reload. |
343
+
344
+ Calling an option's `onSelect` is the whole write: it changes `edgeFinish` on the table, the scene morphs the edge and the price expression recalculates. The option fields are named for display: the spec's `label` arrives as `title`, its `img` as `imageSrc`.
345
+
346
+ The review step is the layout's own: the button pushes the `checkout` navigation state, and the panel shows a summary instead of the cards. There **Request a quote** runs the spec's finalize action, whose handler moves the panel on to the `requested` state and its confirmation; see [Request a quote](#request-a-quote). A real shop collects the contact details in the review step before it sends the request.
347
+
348
+ ## Draw the choices
349
+
350
+ The edge finish is a visual choice, so the panel shows it as cards with a drawing of each profile, as [Choosing a Control](?path=/docs/ux-guidelines-choosing-a-control--docs) recommends for shapes. The selected card has a border in the theme's primary colour, a tinted background and a check mark, so the state does not depend on colour alone. The cards form a radio group: the group has `role="radiogroup"` and a label, each card `role="radio"` and `aria-checked`, only the selected card is in the tab order, and the arrow keys move the selection, skipping disabled options, as in a native radio group. Each card is at least 44 pixels high and shows a focus ring for keyboard users.
351
+
352
+ ```tsx
353
+ import { Box, ButtonBase, type SxProps, type Theme, Typography } from '@mui/material'
354
+ import type { KeyboardEvent } from 'react'
355
+
356
+ import { type UseAttributeSelection, useResolveLocalizable } from '@salsita-ai/sdk/react'
357
+
358
+ // Cross-sections of the tabletop's edge, keyed by the option values of the spec.
359
+ const EDGE_PROFILES: Readonly<Record<string, string>> = {
360
+ None: 'M0 4H32V20H0Z',
361
+ Facet: 'M0 4H26L32 10V14L26 20H0Z',
362
+ Round: 'M0 4H24A8 8 0 0 1 24 20H0Z',
363
+ TreeTrunk: 'M0 4H27C33 5 28 9 34 11C29 13 34 17 27 20H0Z',
364
+ }
365
+
366
+ const CHECK_BADGE: SxProps<Theme> = {
367
+ position: 'absolute',
368
+ insetBlockStart: 10,
369
+ insetInlineEnd: 10,
370
+ display: 'grid',
371
+ placeItems: 'center',
372
+ inlineSize: 22,
373
+ blockSize: 22,
374
+ borderRadius: '50%',
375
+ bgcolor: 'primary.main',
376
+ color: 'primary.contrastText',
377
+ fontSize: 13,
378
+ }
379
+
380
+ // Arrow keys move the selection between the cards, as in a native radio group.
381
+ const ARROW_STEPS: Readonly<Record<string, number | undefined>> = {
382
+ ArrowRight: 1,
383
+ ArrowDown: 1,
384
+ ArrowLeft: -1,
385
+ ArrowUp: -1,
386
+ }
387
+
388
+ interface EdgeFinishCardsProps {
389
+ readonly selection: ReturnType<UseAttributeSelection>
390
+ }
391
+
392
+ export const EdgeFinishCards = ({ selection }: EdgeFinishCardsProps) => {
393
+ const resolve = useResolveLocalizable()
394
+ const { options } = selection
395
+ // The card in the tab order: the selected one, or the first enabled one. Disabled cards are never in it.
396
+ const selectedIndex = options.findIndex(option => option.value === selection.value && !option.disabled)
397
+ const focusIndex = selectedIndex >= 0 ? selectedIndex : options.findIndex(option => !option.disabled)
398
+
399
+ const handleKeyDown = (event: KeyboardEvent<HTMLElement>, index: number) => {
400
+ const step = ARROW_STEPS[event.key]
401
+
402
+ if (step === undefined) {
403
+ return
404
+ }
405
+
406
+ event.preventDefault()
407
+ // The next enabled option in the arrow's direction, wrapping around; disabled options are skipped.
408
+ const count = options.length
409
+ const next = Array.from(
410
+ { length: count - 1 },
411
+ (_, offset) => (((index + step * (offset + 1)) % count) + count) % count
412
+ ).find(candidate => !options[candidate]?.disabled)
413
+
414
+ if (next === undefined) {
415
+ return
416
+ }
417
+
418
+ options[next]?.onSelect()
419
+ event.currentTarget.parentElement?.querySelectorAll<HTMLElement>('[role="radio"]')[next]?.focus()
420
+ }
421
+
422
+ return (
423
+ <Box
424
+ component="div"
425
+ role="radiogroup"
426
+ aria-label="Edge finish"
427
+ sx={{ display: 'grid', gridTemplateColumns: '1fr 1fr', gap: 1.5 }}
428
+ >
429
+ {options.map((option, index) => {
430
+ const isSelected = option.value === selection.value
431
+
432
+ return (
433
+ <ButtonBase
434
+ key={String(option.value)}
435
+ role="radio"
436
+ aria-checked={isSelected}
437
+ tabIndex={index === focusIndex ? 0 : -1}
438
+ disabled={option.disabled}
439
+ onClick={option.onSelect}
440
+ onKeyDown={event => handleKeyDown(event, index)}
441
+ sx={{
442
+ position: 'relative',
443
+ display: 'grid',
444
+ justifyItems: 'start',
445
+ gap: 0.5,
446
+ padding: 2,
447
+ borderRadius: 3,
448
+ border: 2,
449
+ borderColor: isSelected ? 'primary.main' : 'divider',
450
+ bgcolor: isSelected ? 'action.hover' : 'transparent',
451
+ textAlign: 'start',
452
+ transition: 'border-color 150ms, background-color 150ms',
453
+ '&:hover': { borderColor: isSelected ? 'primary.main' : 'text.disabled' },
454
+ '&.Mui-focusVisible': { outline: 2, outlineColor: 'primary.main', outlineOffset: 2 },
455
+ '&.Mui-disabled': { opacity: 0.4 },
456
+ }}
457
+ >
458
+ {isSelected && (
459
+ <Box component="span" aria-hidden sx={CHECK_BADGE}>
460
+ ✓
461
+ </Box>
462
+ )}
463
+ <Box
464
+ component="svg"
465
+ viewBox="0 0 36 24"
466
+ aria-hidden
467
+ sx={{ inlineSize: 60, blockSize: 40, color: '#b98b5e' }}
468
+ >
469
+ <path d={EDGE_PROFILES[String(option.value)]} fill="currentColor" />
470
+ </Box>
471
+ <Typography variant="body2" fontWeight={600}>
472
+ {resolve(option.title)}
473
+ </Typography>
474
+ <Typography variant="caption" color="text.secondary">
475
+ {resolve(option.description)}
476
+ </Typography>
477
+ </ButtonBase>
478
+ )
479
+ })}
480
+ </Box>
481
+ )
482
+ }
483
+ ```
484
+
485
+ The drawings are keyed by the option values of the spec. A spec can carry a picture per option instead, as `img`, which the hook returns as `imageSrc`; [CardSelect](?path=/docs/controls-select-attribute-cardselect--docs) shows the SDK's own card control.
486
+
487
+ ## Offer fullscreen
488
+
489
+ Fullscreen is a flag in the configurator's state, not the browser's fullscreen mode. `phx.frontend.useIsFullscreenActive()` reads it and `phx.frontend.useSetFullscreen()` returns a function that sets it: `setFullscreen(true)` turns it on, `setFullscreen(false)` off. The layout's own button flips it, and the layout decides what to hide.
490
+
491
+ ```tsx
492
+ import { Button, Tooltip } from '@mui/material'
493
+
494
+ import { phx } from '../../.phoenix/phx.js'
495
+
496
+ const ENTER_ICON = 'M4 9V4h5M15 4h5v5M20 15v5h-5M9 20H4v-5'
497
+ const EXIT_ICON = 'M9 4v5H4M15 4v5h5M15 20v-5h5M9 20v-5H4'
498
+
499
+ interface FullscreenToggleProps {
500
+ // Only the icon, with the label as its accessible name and tooltip, where a label would cover the product
501
+ readonly compact?: boolean
502
+ }
503
+
504
+ export const FullscreenToggle = ({ compact = false }: FullscreenToggleProps) => {
505
+ const isFullscreen = phx.frontend.useIsFullscreenActive()
506
+ const setFullscreen = phx.frontend.useSetFullscreen()
507
+ const label = isFullscreen ? 'Exit fullscreen' : 'Fullscreen'
508
+ const icon = (
509
+ <svg viewBox="0 0 24 24" width={20} height={20} fill="none" stroke="currentColor" strokeWidth={2}>
510
+ <path d={isFullscreen ? EXIT_ICON : ENTER_ICON} />
511
+ </svg>
512
+ )
513
+
514
+ return (
515
+ <Tooltip title={compact ? label : ''}>
516
+ <Button
517
+ onClick={() => setFullscreen(!isFullscreen)}
518
+ aria-label={compact ? label : undefined}
519
+ startIcon={compact ? undefined : icon}
520
+ sx={{
521
+ minBlockSize: 44,
522
+ minInlineSize: 44,
523
+ paddingInline: compact ? 0 : 2.5,
524
+ borderRadius: 999,
525
+ bgcolor: 'background.paper',
526
+ color: 'text.primary',
527
+ boxShadow: '0 4px 16px rgba(0, 0, 0, 0.12)',
528
+ textTransform: 'none',
529
+ fontWeight: 600,
530
+ '&:hover': { bgcolor: 'background.paper', boxShadow: '0 6px 20px rgba(0, 0, 0, 0.18)' },
531
+ }}
532
+ >
533
+ {compact ? icon : label}
534
+ </Button>
535
+ </Tooltip>
536
+ )
537
+ }
538
+ ```
539
+
540
+ The button stays in the free area in both states, so the way back is always where the user left it. [Interaction Modes](?path=/docs/ux-guidelines-interaction-modes--docs#full-screen-preview) describes what fullscreen hides.
541
+
542
+ ## Show messages
543
+
544
+ When a change is rejected because it breaks an invariant, when a committed change carries a hint, when an error is thrown while a change is validated, or when saving the configuration fails and later succeeds again, the configurator has a message for the customer. `phx.frontend.useConfiguratorMessages(onMessage)` calls `onMessage` once for each, with the text already in the customer's language, and the layout shows it its own way. Here a toast shows a message for six seconds, colored by its severity, at the bottom left of the free area above the view controls on a desktop, and at its top on a phone:
545
+
546
+ ```tsx
547
+ import { Alert } from '@mui/material'
548
+ import { useEffect, useState } from 'react'
549
+
550
+ import type { ConfiguratorMessage } from '@salsita-ai/sdk/react'
551
+
552
+ import { phx } from '../../.phoenix/phx.js'
553
+
554
+ const VIOLATION_SEVERITY = { fatal: 'error', fixable: 'error', warning: 'warning', notice: 'info' } as const
555
+ const RANK = { info: 0, warning: 1, error: 2 } as const
556
+ const VISIBLE_MS = 6000
557
+
558
+ const severityOf = (message: ConfiguratorMessage) => {
559
+ if (message.kind === 'violation') {
560
+ return VIOLATION_SEVERITY[message.violation.severity]
561
+ }
562
+
563
+ return message.kind === 'error' || message.kind === 'saveError' ? 'error' : 'info'
564
+ }
565
+
566
+ export const MessageToast = () => {
567
+ const [message, setMessage] = useState<ConfiguratorMessage | null>(null)
568
+
569
+ // A rejected change also reports the notices already present; keep the worst message while it is shown
570
+ phx.frontend.useConfiguratorMessages(next => {
571
+ setMessage(shown => (shown !== null && RANK[severityOf(next)] < RANK[severityOf(shown)] ? shown : next))
572
+ })
573
+
574
+ useEffect(() => {
575
+ if (message === null) {
576
+ return
577
+ }
578
+
579
+ const timeout = setTimeout(() => setMessage(null), VISIBLE_MS)
580
+
581
+ return () => clearTimeout(timeout)
582
+ }, [message])
583
+
584
+ if (message === null) {
585
+ return null
586
+ }
587
+
588
+ return (
589
+ <Alert
590
+ severity={severityOf(message)}
591
+ onClose={() => setMessage(null)}
592
+ sx={{ maxInlineSize: 420, borderRadius: 3, boxShadow: '0 12px 40px rgba(0, 0, 0, 0.12)' }}
593
+ >
594
+ {message.text}
595
+ </Alert>
596
+ )
597
+ }
598
+ ```
599
+
600
+ The hook takes a new function on every render without missing a message, so passing the state setter, or an inline function, is fine. `message.kind` is `'violation'`, `'sideEffect'`, `'error'`, `'saveError'` or `'saveRecovery'`; the toast shows an error and a failed save as errors, a hint and the save that succeeded again as information. A violation also carries `entityId` and the `violation` itself, with its `severity`. A rejected change brings one message for each violation of the rejected state, including notices and warnings that were already present, so the toast keeps the most severe message while it is shown instead of letting a later notice replace the reason for the rejection. The layout mounts the toast in the safe-area element, which sets `pointerEvents: 'none'`, so the toast's wrapper switches pointer events back on for the close button.
601
+
602
+ To give the toast something to show, the spec registers one transformer. Choosing **Tree trunk** keeps the change and adds a hint to it, which arrives as a `sideEffect` message:
603
+
604
+ ```ts
605
+ import { msg } from '@lingui/core/macro'
606
+
607
+ import { phx } from '../../.phoenix/phx.js'
608
+
609
+ // A tree-trunk edge is cut by hand; choosing it carries a hint, which reaches the layout as a side-effect message
610
+ export default phx.frontend.transformerBuilder.when
611
+ .entity(['Table'])
612
+ .modified({ atFields: ['edgeFinish'] })
613
+ .then.overrideMatchingUpdate(({ update }) => {
614
+ if (update.stateDelta.edgeFinish !== 'TreeTrunk') {
615
+ return [update]
616
+ }
617
+
618
+ return [{ ...update, hint: msg`Tree trunk edges are cut by hand, so delivery takes three weeks longer.` }]
619
+ })
620
+ .build('tree-trunk-delivery')
621
+ ```
622
+
623
+ [Configurator Interface → Loaded Configuration UI](?path=/docs/phoenix-configurator-interface--docs#loaded-configuration-ui) lists the messages the hook does not deliver: errors of the built-in finalize and other actions stay snackbars, and a failure to start from a preset is raised on the preset screen.
624
+
625
+ ## Request a quote
626
+
627
+ The spec declares what finalizing means for this product as a `finalizeAction` component, and the project registers the handler it names:
628
+
629
+ ```yaml
630
+ components:
631
+ Table:
632
+ finalizeAction:
633
+ quote:
634
+ variant: primary
635
+ label: Request a quote
636
+ title: Send the configuration to the shop for a quote
637
+ icon: PaperPlaneTilt
638
+ handler: requestQuote
639
+ ```
640
+
641
+ ```ts
642
+ import { useCallback } from 'react'
643
+
644
+ import { phx } from '../../.phoenix/phx.js'
645
+
646
+ // Stands in for the shop's quote service: the request takes a moment, then the panel shows the confirmation
647
+ export default phx.frontend.createPhoenixHandler('requestQuote', () => {
648
+ const navigate = phx.frontend.useNavigate()
649
+
650
+ return {
651
+ handler: useCallback(async () => {
652
+ await new Promise(resolve => setTimeout(resolve, 1500))
653
+ navigate('requested')
654
+ }, [navigate]),
655
+ }
656
+ })
657
+ ```
658
+
659
+ The handler stands in for the shop's quote service: it waits a moment, as a request would, and then enters the `requested` navigation state, in which the panel thanks the customer. A handler is a hook factory, so it can use any hook, here `phx.frontend.useNavigate()`.
660
+
661
+ The panel lists the finalize actions with `phx.frontend.useComponents({ componentTypes: [finalizeActionComponent] })` and offers the primary one, or the first when none is primary, in its review step. It renders the review step's buttons in a component of their own inside `<PhoenixHandlerBoundary name={handler}>`, because `phx.frontend.useFinalizeAction(handler)` runs the project's handler factory: it is called once per component, never in a loop, and the boundary remounts the buttons when the handler is edited. **Back to the configuration** lives in the same component, so it can be disabled while the request is pending.
662
+
663
+ ```tsx
664
+ import { Alert, Box, Button, CircularProgress, Typography } from '@mui/material'
665
+
666
+ import { phx } from '../../.phoenix/phx.js'
667
+
668
+ const BUTTON_SX = { minBlockSize: 48, borderRadius: 999, textTransform: 'none', fontWeight: 600 } as const
669
+
670
+ interface ReviewActionsProps {
671
+ readonly handler: string
672
+ readonly label: string
673
+ readonly onBack: () => void
674
+ }
675
+
676
+ // The review step's buttons: one finalize action and the way back. `useFinalizeAction` runs the action's handler,
677
+ // so this component calls it exactly once and is rendered inside a `PhoenixHandlerBoundary` for that handler.
678
+ // Back is disabled while the request is pending, so the customer cannot change the configuration while it is sent.
679
+ // The pending state belongs to this component: when the panel unmounts, as in fullscreen, the request goes on and
680
+ // the remounted buttons are enabled again.
681
+ export const ReviewActions = ({ handler, label, onBack }: ReviewActionsProps) => {
682
+ const { run, isPending, error, disabled, hints } = phx.frontend.useFinalizeAction(handler)
683
+
684
+ return (
685
+ <Box component="div" sx={{ display: 'grid', gap: 2 }}>
686
+ <Box component="div" sx={{ display: 'grid', gap: 1 }}>
687
+ <Button
688
+ size="large"
689
+ variant="contained"
690
+ disabled={disabled || isPending}
691
+ onClick={run}
692
+ startIcon={isPending ? <CircularProgress size={18} color="inherit" /> : undefined}
693
+ sx={BUTTON_SX}
694
+ >
695
+ {isPending ? 'Sending the request…' : label}
696
+ </Button>
697
+ {disabled && hints && (
698
+ <Typography variant="caption" color="text.secondary">
699
+ {hints}
700
+ </Typography>
701
+ )}
702
+ {error && <Alert severity="error">The request could not be sent: {error.message}</Alert>}
703
+ </Box>
704
+ <Button size="large" variant="outlined" disabled={isPending} onClick={onBack} sx={BUTTON_SX}>
705
+ Back to the configuration
706
+ </Button>
707
+ </Box>
708
+ )
709
+ }
710
+ ```
711
+
712
+ - `run()` records the finalize-button click for analytics and runs the handler; it does nothing while `disabled` or `isPending`.
713
+ - While `isPending` the button shows a spinner and cannot be clicked again, and **Back to the configuration** is disabled, so the customer cannot change the configuration while it is sent. `isPending` and `error` belong to the mounted component: entering fullscreen unmounts the panel, the request goes on, and the panel shown after fullscreen starts with both buttons enabled. A layout that must rule that out keeps the review step mounted, or hides its fullscreen button while a request runs.
714
+ - `error` is what the handler rejected with. The layout shows it under the button; no snackbar is raised. It is cleared when the customer tries again.
715
+ - `disabled` and `hints` come from the configuration's violations: while a `warning` or worse holds, or the configuration failed to save, finalizing is not possible and `hints` says why.
716
+
717
+ The review step stays: a quote request is a commitment, so the customer sees the summary first, and a real shop collects the contact details there. A product that finalizes without a review offers the button in place of **Review and request a quote**. [Configurator Interface → Hooks for a Project Layout](?path=/docs/phoenix-configurator-interface--docs#hooks-for-a-project-layout) describes the hook, and [Finalization](?path=/docs/phoenix-finalization--docs) what a real flow does on the server.
718
+
719
+ ## Serve read mode
720
+
721
+ While `accessInfo.viewMode` is `true` the panel marks the view as view only, replaces the cards with the chosen finish and shows the price without an action; the finalize action is not offered, since `useFinalizeAction` does not check read mode itself. The hooks do not hide or disable anything in read mode: what a viewer can change is decided by what the layout renders. Rotating and zooming the scene, and fullscreen, stay available, as [Interaction Modes](?path=/docs/ux-guidelines-interaction-modes--docs#view-only-mode) recommends. The button on the table's edge is hidden for viewers by the spec, see [Put a control on the product](#put-a-control-on-the-product).
722
+
723
+ ## Fit a phone
724
+
725
+ A panel 380 pixels wide beside the scene leaves nothing of the table on a phone. Below a desktop width the layout puts the panel into a sheet at the bottom and lets the camera frame the table in the area above it. The layout above shows both arrangements.
726
+
727
+ **The switch.** `useActiveViewports()` from `@salsita-ai/sdk/react` returns the width classes the configurator's container satisfies. The container decides, not the window, so a configurator embedded in a narrow column of a wide page gets the phone arrangement too. The built-in layout switches on `desktop` as well.
728
+
729
+ | Value | When it is active |
730
+ | ----------- | ---------------------------------------------------------------------------------- |
731
+ | `phone` | The container is narrower than 480 pixels. |
732
+ | `mobile` | The container is at most 768 pixels wide. |
733
+ | `tablet` | The container is wider than 480 and narrower than 1024 pixels. |
734
+ | `desktop` | The container is wider than 768 pixels; `mobile` and `desktop` exclude each other. |
735
+ | `landscape` | The browser window, not the container, is wider than it is high. |
736
+ | `portrait` | The browser window, not the container, is higher than it is wide. |
737
+
738
+ The hook returns `null` until the container has been measured, and the layout renders only the scene until then, so a phone never shows the desktop panel for a frame.
739
+
740
+ **The sheet.** On a phone the layout is a column: the safe-area element takes the height the sheet leaves, and the sheet sits below it. The sheet has two positions. Collapsed, it shows the name, the price and the action; open, it shows the description and the cards too. The `collapsed` prop of the panel hides the description and the cards, and nothing else, and `inSheet` keeps the top of the cards in view. The sheet scrolls what does not fit, so the price, the review step, **Request a quote** and the thank-you message are reachable in both positions.
741
+
742
+ ```tsx
743
+ import { Box, ButtonBase } from '@mui/material'
744
+ import { type MouseEvent, type PointerEvent, type ReactNode, useRef } from 'react'
745
+
746
+ // A drag shorter than this is a tap, and the handle's click toggles the sheet
747
+ const TAP_DISTANCE = 6
748
+ // A drag that ends this far from where it started snaps to the other position
749
+ const SNAP_DISTANCE = 48
750
+ // A drag faster than this, in pixels per millisecond, snaps in its direction even when it is short
751
+ const SNAP_VELOCITY = 0.5
752
+ // How far the sheet follows the finger towards the position it is already in
753
+ const OVERDRAG = 0.25
754
+
755
+ interface BottomSheetProps {
756
+ readonly open: boolean
757
+ readonly onOpenChange: (open: boolean) => void
758
+ readonly label: string
759
+ readonly children: ReactNode
760
+ }
761
+
762
+ interface Drag {
763
+ readonly startY: number
764
+ readonly startTime: number
765
+ delta: number
766
+ }
767
+
768
+ // A persistent sheet at the bottom of the layout with two positions, open and collapsed. It is not a modal: the scene
769
+ // above it stays interactive. Its height comes from its content, so the layout's safe area ends where the sheet
770
+ // starts and changes only when the sheet snaps. While the handle is dragged the sheet follows the finger with a
771
+ // transform, which the safe area does not see, so the camera refits once per snap and not on every move.
772
+ export const BottomSheet = ({ open, onOpenChange, label, children }: BottomSheetProps) => {
773
+ const sheetRef = useRef<HTMLElement>(null)
774
+ const dragRef = useRef<Drag | null>(null)
775
+ const draggedRef = useRef(false)
776
+
777
+ const moveSheet = (offset: number, animate: boolean) => {
778
+ if (sheetRef.current) {
779
+ sheetRef.current.style.transition = animate ? 'transform 200ms ease-out' : 'none'
780
+ sheetRef.current.style.transform = offset === 0 ? '' : `translateY(${offset}px)`
781
+ }
782
+ }
783
+
784
+ const handlePointerDown = (event: PointerEvent<HTMLButtonElement>) => {
785
+ event.currentTarget.setPointerCapture(event.pointerId)
786
+ dragRef.current = { startY: event.clientY, startTime: event.timeStamp, delta: 0 }
787
+ draggedRef.current = false
788
+ }
789
+
790
+ const handlePointerMove = (event: PointerEvent<HTMLButtonElement>) => {
791
+ const drag = dragRef.current
792
+
793
+ if (drag === null) {
794
+ return
795
+ }
796
+
797
+ drag.delta = event.clientY - drag.startY
798
+ // Down closes an open sheet and up opens a collapsed one; the other direction only gives a little
799
+ const towardsOther = open ? drag.delta > 0 : drag.delta < 0
800
+ moveSheet(towardsOther ? drag.delta : drag.delta * OVERDRAG, false)
801
+ }
802
+
803
+ const handlePointerEnd = (event: PointerEvent<HTMLButtonElement>) => {
804
+ const drag = dragRef.current
805
+ dragRef.current = null
806
+
807
+ if (drag === null) {
808
+ return
809
+ }
810
+
811
+ moveSheet(0, true)
812
+
813
+ if (Math.abs(drag.delta) < TAP_DISTANCE) {
814
+ return
815
+ }
816
+
817
+ draggedRef.current = true
818
+ const velocity = drag.delta / Math.max(event.timeStamp - drag.startTime, 1)
819
+ const flicked = Math.abs(drag.delta) >= SNAP_DISTANCE || Math.abs(velocity) >= SNAP_VELOCITY
820
+
821
+ if (flicked && (open ? drag.delta > 0 : drag.delta < 0)) {
822
+ onOpenChange(!open)
823
+ }
824
+ }
825
+
826
+ // A tap, Enter or Space toggles the sheet. The pointer click that ends a drag has already been handled; a keyboard
827
+ // click (`detail` 0) always toggles, also after a touch drag that was followed by no click.
828
+ const handleClick = (event: MouseEvent<HTMLButtonElement>) => {
829
+ const dragged = draggedRef.current
830
+ draggedRef.current = false
831
+
832
+ if (dragged && event.detail !== 0) {
833
+ return
834
+ }
835
+
836
+ onOpenChange(!open)
837
+ }
838
+
839
+ return (
840
+ <Box
841
+ component="section"
842
+ ref={sheetRef}
843
+ aria-label={label}
844
+ sx={{
845
+ position: 'relative',
846
+ flexShrink: 0,
847
+ display: 'flex',
848
+ flexDirection: 'column',
849
+ maxBlockSize: '55%',
850
+ paddingBlockEnd: 'env(safe-area-inset-bottom)',
851
+ borderStartStartRadius: 20,
852
+ borderStartEndRadius: 20,
853
+ bgcolor: 'background.paper',
854
+ boxShadow: '0 -8px 32px rgba(0, 0, 0, 0.12)',
855
+ // Fills the gap below the sheet while it is dragged up
856
+ '&::after': {
857
+ content: '""',
858
+ position: 'absolute',
859
+ insetInline: 0,
860
+ insetBlockStart: '100%',
861
+ blockSize: '100vh',
862
+ bgcolor: 'background.paper',
863
+ },
864
+ }}
865
+ >
866
+ <ButtonBase
867
+ aria-expanded={open}
868
+ disableRipple
869
+ aria-label={open ? `Collapse ${label.toLowerCase()}` : `Expand ${label.toLowerCase()}`}
870
+ onClick={handleClick}
871
+ onPointerDown={handlePointerDown}
872
+ onPointerMove={handlePointerMove}
873
+ onPointerUp={handlePointerEnd}
874
+ onPointerCancel={handlePointerEnd}
875
+ sx={{
876
+ flexShrink: 0,
877
+ blockSize: 36,
878
+ touchAction: 'none',
879
+ '&.Mui-focusVisible': { outline: 2, outlineColor: 'primary.main', outlineOffset: -4, borderRadius: 3 },
880
+ }}
881
+ >
882
+ <Box component="span" sx={{ inlineSize: 40, blockSize: 4, borderRadius: 2, bgcolor: 'text.disabled' }} />
883
+ </ButtonBase>
884
+ {/* A column, so the panel's cards region shrinks first and the price and action stay in view; below the cards
885
+ region's minimum height the content scrolls as a whole, as the review step does on a short phone */}
886
+ <Box
887
+ component="div"
888
+ sx={{
889
+ display: 'flex',
890
+ flexDirection: 'column',
891
+ flex: '1 1 auto',
892
+ minBlockSize: 0,
893
+ overflowY: 'auto',
894
+ overscrollBehavior: 'contain',
895
+ }}
896
+ >
897
+ {children}
898
+ </Box>
899
+ </Box>
900
+ )
901
+ }
902
+ ```
903
+
904
+ - The handle is a real button with `aria-expanded`. A tap, Enter or Space toggles the sheet, and dragging it up or down snaps the sheet to the other position when the drag is long or fast enough. `touchAction: 'none'` is set on the handle only, so the cards still scroll by touch.
905
+ - The sheet's height comes from its content and is at most 55% of the configurator; when the content does not fit, the cards region shrinks until only the top of the cards shows and scrolls, and below that the sheet's content scrolls as a whole. On a phone with room for the header, the top of the cards and the footer, the price and the action stay in view with the sheet open; on a shorter one the customer scrolls the sheet to them, and the review step's buttons are reached the same way in both positions. A scroll on the cards that reaches their end moves the sheet on. Because the safe-area element is its neighbour in the column, the free area ends where the sheet starts without anything being measured by the layout.
906
+ - While the handle is dragged the sheet follows the finger with a `transform`. `useSceneSafeArea()` does not see a transform, so the free area changes once, when the sheet snaps, and the camera refits once. A safe area that followed the finger would refit the camera on every move and reset an orbit the customer made.
907
+ - The sheet is not a modal: no backdrop covers the scene, so the table can be orbited with one finger and zoomed with two while the sheet is open. MUI's temporary `Drawer` and `SwipeableDrawer` are modals and would block the scene; their persistent and permanent variants have no backdrop, but no drag handle with two positions either.
908
+
909
+ **What else moves.** The toast sits at the top of the free area, so it does not cover the sheet's handle, and the fullscreen button shows only its icon, with its label as tooltip and accessible name, so the toast has room beside it. Fullscreen removes the sheet as it removes the panel on a desktop. The sheet keeps its position while fullscreen is on.
910
+
911
+ **A camera for the phone.** The desktop camera is close enough to fill a wide free area, and on a narrow one it cuts off the ends of the table. So each camera has a filter on the viewport: the desktop camera `main` applies while `desktop` is active, and a second camera, `phone`, with a larger distance frames the whole table while `mobile` is. The filters exclude each other once the container is measured. Before that, for example when an image of the configuration is rendered, no viewport is known and a viewport filter matches, so both cameras apply and the higher priority of `main` decides:
912
+
913
+ ```yaml
914
+ components:
915
+ Table:
916
+ fitRootPerspectiveCamera:
917
+ main:
918
+ priority: 2
919
+ fov: 35
920
+ near: 100
921
+ far: 10000
922
+ minDistance: 1000
923
+ maxDistance: 9000
924
+ distance: 5000
925
+ azimuthAngle: 1.5
926
+ polarAngle: 1.1
927
+ fitMeshChanges: true
928
+ $filter:
929
+ viewports: [desktop]
930
+ phone:
931
+ priority: 1
932
+ fov: 35
933
+ near: 100
934
+ far: 10000
935
+ minDistance: 1000
936
+ maxDistance: 12000
937
+ distance: 8000
938
+ azimuthAngle: 1.5
939
+ polarAngle: 1.1
940
+ fitMeshChanges: true
941
+ $filter:
942
+ viewports: [mobile]
943
+ ```
944
+
945
+ ## Put a control on the product
946
+
947
+ The edge finish is a detail of the tabletop, so the layout also offers it on the table itself: a round button on the middle of the long edge opens the four finishes next to the edge. On a phone it is a way to change the edge without opening the sheet.
948
+
949
+ A control in the scene is a spec component that names an element of the project. `htmlHotspot` places an HTML element at an offset from the entity's origin, in the model's units, here millimetres: half the table's depth towards the camera and just below the top's surface. Its `$filter` shows it only to the owner and only while the `configure` navigation state is active, so a viewer and the review step do not get it, and the element does not check either itself:
950
+
951
+ ```yaml
952
+ components:
953
+ Table:
954
+ htmlHotspot:
955
+ edgeFinish:
956
+ name: EdgeFinishHotspot
957
+ offsetX: 500
958
+ offsetY: 800
959
+ offsetZ: 0
960
+ $filter:
961
+ modes: [owner]
962
+ navigationStates: [configure]
963
+ ```
964
+
965
+ The element is registered with `phx.frontend.createCustomPhoenixEntityElement` under the name the spec gives. It receives the id of the entity the hotspot belongs to, and reads the same `attributeSelection` the panel reads:
966
+
967
+ ```tsx
968
+ import { Box, ButtonBase, Popover, Tooltip } from '@mui/material'
969
+ import { useState } from 'react'
970
+
971
+ import { phx } from '../../.phoenix/phx.js'
972
+ import { EdgeFinishCards } from '../_shared/EdgeFinishCards.js'
973
+
974
+ // The edge profile the button shows, the square edge of the cards' drawings
975
+ const EDGE_ICON = 'M3 7H17L21 11V13L17 17H3Z'
976
+
977
+ // Rendered by the spec's `htmlHotspot` on the table's edge: a button on the product that opens the edge finishes
978
+ // next to the edge, with the same cards as the panel. The spec's `$filter` decides when it is shown.
979
+ export default phx.frontend.createCustomPhoenixEntityElement('EdgeFinishHotspot', ({ entityId }) => {
980
+ const edgeFinish = phx.frontend.useAttributeSelection(entityId, 'edgeFinish')
981
+ const [anchor, setAnchor] = useState<HTMLElement | null>(null)
982
+
983
+ return (
984
+ <>
985
+ <Tooltip title="Edge finish">
986
+ <ButtonBase
987
+ aria-label="Edge finish"
988
+ aria-haspopup="dialog"
989
+ aria-expanded={anchor !== null}
990
+ onClick={event => setAnchor(event.currentTarget)}
991
+ sx={{
992
+ display: 'grid',
993
+ placeItems: 'center',
994
+ inlineSize: 44,
995
+ blockSize: 44,
996
+ borderRadius: '50%',
997
+ bgcolor: 'background.paper',
998
+ color: 'primary.main',
999
+ boxShadow: '0 4px 16px rgba(0, 0, 0, 0.2)',
1000
+ '&.Mui-focusVisible': { outline: 2, outlineColor: 'primary.main', outlineOffset: 2 },
1001
+ }}
1002
+ >
1003
+ <svg viewBox="0 0 24 24" width={22} height={22} aria-hidden>
1004
+ <path d={EDGE_ICON} fill="currentColor" />
1005
+ </svg>
1006
+ </ButtonBase>
1007
+ </Tooltip>
1008
+ <Popover
1009
+ open={anchor !== null}
1010
+ anchorEl={anchor}
1011
+ onClose={() => setAnchor(null)}
1012
+ anchorOrigin={{ vertical: 'top', horizontal: 'center' }}
1013
+ transformOrigin={{ vertical: 'bottom', horizontal: 'center' }}
1014
+ slotProps={{
1015
+ paper: { role: 'dialog', 'aria-label': 'Edge finish', sx: { borderRadius: 4, marginBlockStart: -1 } },
1016
+ }}
1017
+ >
1018
+ <Box component="div" sx={{ inlineSize: 340, maxInlineSize: 'calc(100vw - 32px)', padding: 2 }}>
1019
+ <EdgeFinishCards selection={edgeFinish} />
1020
+ </Box>
1021
+ </Popover>
1022
+ </>
1023
+ )
1024
+ })
1025
+ ```
1026
+
1027
+ - The hotspot is rendered inside the scene, but it has the theme and every `phx.frontend` hook, like the layout. MUI's `Popover` and `Tooltip` render into the configurator's own modal root, so they are styled and work inside its shadow root.
1028
+ - The cards in the popover are the panel's `EdgeFinishCards`, used a second time. A choice changes the edge, the price and the panel's cards at once, and the popover stays open so the customer can compare the finishes on the table.
1029
+ - Keyboard: the button is in the tab order, Enter and Space open the popover and move the focus into it, the arrow keys change the finish, and Escape closes it and returns the focus to the button.
1030
+ - `controlHotspot: true` would hide the hotspot while a change is being applied, which would also unmount the open popover on every choice, so this hotspot does not set it.
1031
+ - The scene's HTML is painted inside the canvas's stacking context, under the layout's panel and sheet. A hotspot that a panel covers cannot be clicked there.
1032
+
1033
+ [Html Hotspots](?path=/docs/controls-scene-html-hotspots--docs) describes the component and its other properties.
1034
+
1035
+ The SDK's own controls on the product, such as `sceneEntityAddFab` and `sceneEntitySelectHotspot`, keep the SDK's look in a project layout too. Each is rendered through an entity element of its own name, so a project gives it the brand's look by registering that name, for example with `phx.frontend.createAddEntityFab`; see [Configurator Interface → In-Scene Controls](?path=/docs/phoenix-configurator-interface--docs#in-scene-controls). `htmlHotspot` is for a control the SDK has none of, like this one.
1036
+
1037
+ ## Control the scene
1038
+
1039
+ The four finishes differ by a few millimetres on a table two metres long, so from the default distance the difference is hard to judge. The layout offers two views, **Whole table** and **Edge close-up**, a close and low look at a corner of the top, and a **Reset view** button that brings back the framing after the customer has orbited, panned or zoomed.
1040
+
1041
+ **Views are view states.** The spec lists them, and each camera says by its `$filter` in which view states and at which widths it applies. The two close-up cameras have the highest priorities and apply only in the `edge` view state, the desktop one with `desktop` and the phone one with `mobile`, a little farther away. In the `overview` view state, the first in the list and so the initial one, only the two whole-table cameras of [Fit a phone](#fit-a-phone) apply. A camera always looks at the middle of the table, so the close-up shows the near corner, where the edge profile is seen on both sides:
1042
+
1043
+ ```yaml
1044
+ viewStates:
1045
+ - overview
1046
+ - edge
1047
+
1048
+ components:
1049
+ Table:
1050
+ fitRootPerspectiveCamera:
1051
+ edge:
1052
+ priority: 4
1053
+ fov: 35
1054
+ near: 100
1055
+ far: 10000
1056
+ minDistance: 800
1057
+ maxDistance: 9000
1058
+ distance: 2000
1059
+ azimuthAngle: 0.5
1060
+ polarAngle: 1.15
1061
+ fitMeshChanges: true
1062
+ $filter:
1063
+ viewports: [desktop]
1064
+ viewStates: [edge]
1065
+ edgePhone:
1066
+ priority: 3
1067
+ fov: 35
1068
+ near: 100
1069
+ far: 10000
1070
+ minDistance: 800
1071
+ maxDistance: 12000
1072
+ distance: 3000
1073
+ azimuthAngle: 0.5
1074
+ polarAngle: 1.15
1075
+ fitMeshChanges: true
1076
+ $filter:
1077
+ viewports: [mobile]
1078
+ viewStates: [edge]
1079
+ ```
1080
+
1081
+ **The buttons.** `phx.frontend.useActiveViewState()` returns the active view state and `phx.frontend.useSetViewState()` a function that makes another one active; the camera then moves to the camera of that view state. `phx.frontend.useResetCamera()` returns a function that moves the camera back to the framing of the active camera, the whole table or the close-up:
1082
+
1083
+ ```tsx
1084
+ import { Box, Button, Tooltip } from '@mui/material'
1085
+
1086
+ import { phx } from '../../.phoenix/phx.js'
1087
+
1088
+ // The spec's view states, each with the label of the button that shows it
1089
+ const VIEWS = [
1090
+ { state: 'overview', label: 'Whole table' },
1091
+ { state: 'edge', label: 'Edge close-up' },
1092
+ ] as const
1093
+
1094
+ const RESET_ICON = 'M4 12a8 8 0 1 0 2.4-5.7M4 4v4h4'
1095
+
1096
+ const SURFACE_SX = {
1097
+ borderRadius: 999,
1098
+ bgcolor: 'background.paper',
1099
+ boxShadow: '0 4px 16px rgba(0, 0, 0, 0.12)',
1100
+ } as const
1101
+
1102
+ const BUTTON_SX = {
1103
+ minBlockSize: 44,
1104
+ minInlineSize: 44,
1105
+ borderRadius: 999,
1106
+ textTransform: 'none',
1107
+ fontWeight: 600,
1108
+ whiteSpace: 'nowrap',
1109
+ } as const
1110
+
1111
+ interface SceneControlsProps {
1112
+ // The reset button shows only its icon, with its label as tooltip and accessible name
1113
+ readonly compact?: boolean
1114
+ // Only the reset button, without the view buttons
1115
+ readonly resetOnly?: boolean
1116
+ }
1117
+
1118
+ // The layout's own camera controls: one button per view state of the spec, and a reset that undoes an orbit
1119
+ export const SceneControls = ({ compact = false, resetOnly = false }: SceneControlsProps) => {
1120
+ const activeView = phx.frontend.useActiveViewState()
1121
+ const setViewState = phx.frontend.useSetViewState()
1122
+ const resetCamera = phx.frontend.useResetCamera()
1123
+ const resetIcon = (
1124
+ <svg viewBox="0 0 24 24" width={20} height={20} fill="none" stroke="currentColor" strokeWidth={2}>
1125
+ <path d={RESET_ICON} />
1126
+ </svg>
1127
+ )
1128
+
1129
+ return (
1130
+ <Box component="div" sx={{ display: 'flex', gap: 1 }}>
1131
+ {!resetOnly && (
1132
+ <Box component="div" role="group" aria-label="View" sx={{ ...SURFACE_SX, display: 'flex' }}>
1133
+ {VIEWS.map(view => {
1134
+ const isActive = activeView === view.state
1135
+
1136
+ return (
1137
+ <Button
1138
+ key={view.state}
1139
+ aria-pressed={isActive}
1140
+ onClick={() => setViewState(view.state)}
1141
+ sx={{
1142
+ ...BUTTON_SX,
1143
+ paddingInline: 2,
1144
+ bgcolor: isActive ? 'text.primary' : 'transparent',
1145
+ color: isActive ? 'background.paper' : 'text.primary',
1146
+ '&:hover': { bgcolor: isActive ? 'text.primary' : 'action.hover' },
1147
+ }}
1148
+ >
1149
+ {view.label}
1150
+ </Button>
1151
+ )
1152
+ })}
1153
+ </Box>
1154
+ )}
1155
+ <Tooltip title={compact ? 'Reset view' : ''}>
1156
+ <Button
1157
+ onClick={resetCamera}
1158
+ aria-label={compact ? 'Reset view' : undefined}
1159
+ startIcon={compact ? undefined : resetIcon}
1160
+ sx={{
1161
+ ...SURFACE_SX,
1162
+ ...BUTTON_SX,
1163
+ paddingInline: compact ? 0 : 2,
1164
+ color: 'text.primary',
1165
+ '&:hover': { bgcolor: 'background.paper', boxShadow: '0 6px 20px rgba(0, 0, 0, 0.18)' },
1166
+ }}
1167
+ >
1168
+ {compact ? resetIcon : 'Reset view'}
1169
+ </Button>
1170
+ </Tooltip>
1171
+ </Box>
1172
+ )
1173
+ }
1174
+ ```
1175
+
1176
+ - The view buttons are a group with `aria-pressed`, so a screen reader announces which view is active, and the active one is drawn dark, not only in another colour.
1177
+ - On a desktop the controls sit at the bottom right of the free area and the toast above its bottom left; on a phone they sit at the bottom of the free area, just above the sheet. On a phone, and on a desktop arrangement below 1024 pixels, where `tablet` is also active and the free area beside the panel is narrow, **Reset view** shows only its icon, with its label as tooltip and accessible name.
1178
+ - In fullscreen the controls stay on a desktop. On a phone the view buttons are hidden and **Reset view** stays, as [Interaction Modes](?path=/docs/ux-guidelines-interaction-modes--docs#full-screen-preview) describes for the built-in layout: on a phone the canvas is small and the product comes first, and the way back to the framed product is still needed after an orbit.
1179
+ - The controls stay in the review step and in read mode: changing the view changes nothing in the configuration, and a viewer may look at the product as closely as the customer.
1180
+ - The hooks need no `viewControls` component. That component configures the built-in layout's view controls and has no effect here.
1181
+
1182
+ ## The spec the layout reads
1183
+
1184
+ The layout reads four components of the root entity and its navigation and view states; the scene components are in the complete implementation below. `SceneControls` names the view states `overview` and `edge` in its code, so they must match the spec's `viewStates`.
1185
+
1186
+ ```yaml
1187
+ navigationStates:
1188
+ - configure
1189
+ - checkout
1190
+ - requested
1191
+
1192
+ viewStates:
1193
+ - overview
1194
+ - edge
1195
+
1196
+ components:
1197
+ Table:
1198
+ detail:
1199
+ main:
1200
+ title: Linden dining table
1201
+ subtitle: Solid oak, seats six
1202
+ description: A solid oak top on slender steel legs, finished with the edge profile of your choice.
1203
+ price:
1204
+ main:
1205
+ price:
1206
+ $read: $price
1207
+ attributeSelection:
1208
+ edgeFinish:
1209
+ value:
1210
+ $bind: edgeFinish
1211
+ options:
1212
+ - label: Square
1213
+ description: Crisp and modern
1214
+ value: None
1215
+ - label: Facet
1216
+ description: A light bevel
1217
+ value: Facet
1218
+ - label: Round
1219
+ description: Soft to the touch
1220
+ value: Round
1221
+ - label: Tree trunk
1222
+ description: The natural edge
1223
+ value: TreeTrunk
1224
+ finalizeAction:
1225
+ quote:
1226
+ variant: primary
1227
+ label: Request a quote
1228
+ title: Send the configuration to the shop for a quote
1229
+ icon: PaperPlaneTilt
1230
+ handler: requestQuote
1231
+
1232
+ transformers:
1233
+ - name: tree-trunk-delivery
1234
+ ```
1235
+
1236
+ `$price` is a custom expression in `src/expressions/table.ts` that adds a surcharge per finish, and `tree-trunk-delivery` is the transformer in `src/transformers/tree-trunk-delivery.ts` that adds the hint shown in [Show messages](#show-messages), and `requestQuote` is the handler in `src/handlers/request-quote.ts`. The example sets no `applicationConfig` and no layout components: `layout`, the header, the sidebar footer, the toolbar, `viewControls` and property pages configure the built-in layout and have no effect on this one. The `finalizeAction` is not one of them: it describes the product's own finalizing, which this layout offers itself.
1237
+
1238
+ ## Try the example
1239
+
1240
+ To see read mode, open **Mocks** in the editor rail on the left and apply the **Read User** template.
1241
+
1242
+ The same layout in a frame 390 pixels wide, as on a phone. Opened on its own from the sidebar, the **Phone** story sets Storybook's viewport to 390 × 844.
1243
+
1244
+ ## Test cases
1245
+
1246
+ - The panel is on the left and the table is centred in the area to the right of it, not in the whole canvas.
1247
+ - Choosing **Tree trunk** moves the check mark to that card, changes the edge of the tabletop and raises the price from $1,290.00 to $1,630.00.
1248
+ - Choosing **Tree trunk** also shows "Tree trunk edges are cut by hand, so delivery takes three weeks longer." at the bottom left of the free area, above the view controls, until its close button is clicked or six seconds pass. Choosing another finish shows nothing.
1249
+ - Tab reaches the selected card, and the arrow keys move the selection to the next or previous card.
1250
+ - Dragging in the area to the right of the panel orbits the camera.
1251
+ - **Review and request a quote** replaces the cards with the chosen finish and offers **Request a quote**; **Back to the configuration** brings the cards back.
1252
+ - **Request a quote** shows a spinner and "Sending the request…" for about a second and a half, with **Back to the configuration** disabled, then "Thank you. Your quote request is on its way, and the shop replies within two working days."; **Back to the configuration** then returns to the cards.
1253
+ - **Fullscreen** removes the panel and the table moves to the centre of the canvas; **Exit fullscreen** brings both back.
1254
+ - With the **Read User** mock the panel says **View only**, shows the chosen finish and the price, and has no button, so no quote can be requested.
1255
+ - A round button sits on the middle of the table's long edge. Clicking it opens the four finishes next to it; choosing **Round** there moves the check mark in the popover and in the panel, rounds the edge and raises the price to $1,410.00. Escape closes the popover.
1256
+ - Tab reaches the button on the edge, and Enter or Space opens the popover.
1257
+ - The button on the edge is gone in the review step, in the confirmation and with the **Read User** mock, and stays in fullscreen.
1258
+ - In the **Phone** story the panel is a sheet at the bottom showing the name, the price and **Review and request a quote**, and the whole table is visible above it.
1259
+ - Tapping the sheet's handle, or dragging it up, opens the sheet with the cards; the table moves up once the sheet has snapped and stays fully visible. Dragging the handle down, or tapping it again, collapses the sheet.
1260
+ - On the phone, the review step, **Request a quote** and the thank-you message work with the sheet collapsed and open.
1261
+ - On the phone, choosing **Tree trunk** shows the hint at the top of the free area, beside the fullscreen button.
1262
+ - On the phone, the fullscreen button removes the sheet and the table moves to the centre of the canvas; pressing it again brings the sheet back in the position it had.
1263
+ - **Edge close-up** moves the camera close to the near corner of the top, where the edge profile shows; the button is drawn dark and the other light. **Whole table** returns to the whole table.
1264
+ - After dragging in the free area to orbit the table, **Reset view** returns to the framing of the active view, the whole table or the close-up.
1265
+ - The view buttons and **Reset view** sit at the bottom right of the free area on a desktop and just above the sheet on a phone, and overlap neither the panel, the sheet, the button on the edge nor the toast.
1266
+ - In fullscreen the view controls stay on a desktop. On a phone the view buttons are hidden and **Reset view** stays; after an orbit it restores the framing.
1267
+
1268
+ ## Known gaps
1269
+
1270
+ A project layout has only what it renders. This one leaves out the following, each of which a product may need. [Layout Slots](?path=/docs/phoenix-layout-slots--docs) describes every `LayoutSlots` member named here.
1271
+
1272
+ - **Messages that stay snackbars.** The toast shows violations, side effects, errors and failed saves, and the finalize button shows its own error. Two kinds of message stay snackbars. An error of a built-in action, such as one from `LayoutSlots.DesktopToolbar`, renders into `LayoutSlots.DesktopSnackbarsRoot`; this layout mounts neither, and a layout that mounts such an action mounts the root too, or the snackbar appears outside the configurator. A failure to start from a preset appears on the preset screen, before this layout mounts; a project replaces that screen with `phx.frontend.createPresetUi`, see [Configurator Interface → Preset UI](?path=/docs/phoenix-configurator-interface--docs#preset-ui).
1273
+ - **Toolbar actions.** Undo and redo, measurements, sharing and language switching are not offered. A layout can mount `LayoutSlots.DesktopToolbar` for the toolbar the spec configures, or build its own buttons: `phx.frontend.useUndoRedo()`, `useMeasurements()`, `useShareLinks()` and `useLocaleSwitch()` serve single actions, pushing the same analytics events as the built-in buttons; see [Configurator Interface → Hooks for a Project Layout](?path=/docs/phoenix-configurator-interface--docs#hooks-for-a-project-layout).
1274
+ - **The spec's view controls, tool controls and leaving a tool mode.** A spec can configure view controls and tool controls, and a tool mode has a button that leaves it. The built-in layout places them with `LayoutSlots.DesktopViewControls`, `LayoutSlots.DesktopToolControls` and `LayoutSlots.DesktopCallToAction`; this layout mounts none of them, so the spec's `viewControls` and `toolControls` do not appear. Its views come from its own buttons instead, see [Control the scene](#control-the-scene), and it has no tool modes.
1275
+ - **A project's layout dialog.** A dialog the project registers with `phx.frontend.createLayoutDialog` is shown by `LayoutDialog`, which the built-in layout mounts. This layout does not; a layout that needs the dialog mounts `LayoutDialog` from `@salsita-ai/sdk/configurator`.
1276
+ - **Selection.** The table has no parts to select. A product with selectable parts reads `phx.frontend.useSelectedDomainEntityId()` and shows the controls of the selected part.
1277
+ - **Clone to edit in read mode.** With `shareCloneToEdit` set, the built-in layout's `LayoutSlots.DesktopReadonlyBanner` offers **Edit configuration** to a viewer; this layout's "View only" label offers nothing. A layout mounts the banner, or builds its own action with `LayoutSlots.useIsCloningAllowed()` and `LayoutSlots.CloneToEditDialog`.
1278
+ - **Back and close.** The built-in header's back button returns to the product choice, runs the host's close action or leaves the expanded view, whichever applies. This layout has none of them. `useCloseAction()` from `@salsita-ai/sdk/configurator` returns the host's close action, or `null` when there is none; the hook that chooses among the three is not exported.
1279
+ - **Analytics.** The finalize button records `FinalizeButtonClicked` through `useFinalizeAction`. The built-in fullscreen button records `FullScreenModeToggled`; this layout's fullscreen and other buttons record nothing. A layout that wants the events pushes `FrontendAnalyticsFactory.FullScreenModeToggled()` and the like, from `@salsita-ai/sdk/configurator`, with `phx.frontend.useAnalytics().push(...)`.
1280
+ - **Preview start screen.** The built-in layout shows a preview while `usePreview().isPreview` is set, which `preview: auto` does on phones without the project opting in. This layout ignores it and always renders the interface.
1281
+ - **Assistant panel.** A project layout gets it only with `LayoutSlots.DesktopSidebar`, the built-in sidebar as one piece, see [Sidebar in a Custom Layout](?path=/docs/layouts-sidebar-in-a-custom-layout--docs); this layout does not use it.
1282
+ - **"Powered by Salsita" mark.** The built-in layout shows it; a project layout decides whether to mount `LayoutSlots.DesktopPoweredBy`, and this one does not.
1283
+
1284
+ ## Related pages
1285
+
1286
+ - [Configurator Interface → Loaded Configuration UI](?path=/docs/phoenix-configurator-interface--docs#loaded-configuration-ui) is the reference for the element name, the minimal layout, the SDK pieces a layout can mount and the hooks it reads.
1287
+ - [Universal](?path=/docs/layouts-universal--docs) is the built-in layout this one replaces.
1288
+ - [Header / Custom](?path=/docs/layouts-header-custom--docs) replaces only the header, with the price from `useRootEntityPrice()`.
1289
+ - [Canvas Padding](?path=/docs/layouts-canvas-padding--docs) scales the gaps `useSceneSafeArea()` measures.
1290
+ - [Presets / Custom](?path=/docs/layouts-presets-custom--docs) replaces the preset screen the same way.
1291
+
1292
+ ## Complete Implementation
1293
+
1294
+ {/* AUTO-GENERATED SECTION: This section is automatically updated by 'phoenix story build' */}
1295
+
1296
+ <details>
1297
+ <summary>Click to view the complete implementation files</summary>
1298
+
1299
+ ### ./spec/domain.yaml
1300
+
1301
+ ```yaml
1302
+ model:
1303
+ latest:
1304
+ entityTypes:
1305
+ - Table
1306
+ aliases:
1307
+ RootEntity:
1308
+ - Table
1309
+ commonTypes:
1310
+ EdgeFinish:
1311
+ enum:
1312
+ - None
1313
+ - Facet
1314
+ - Round
1315
+ - TreeTrunk
1316
+ shapes:
1317
+ Table:
1318
+ edgeFinish:
1319
+ $ref: '#/model/latest/commonTypes/EdgeFinish'
1320
+
1321
+ presets:
1322
+ - rootEntityType: Table
1323
+ initialDomainEntities:
1324
+ - id: Table-1
1325
+ type: Table
1326
+ edgeFinish: None
1327
+
1328
+ navigationStates:
1329
+ - configure
1330
+ - checkout
1331
+ - requested
1332
+
1333
+ viewStates:
1334
+ - overview
1335
+ - edge
1336
+
1337
+ components:
1338
+ Table:
1339
+ detail:
1340
+ main:
1341
+ title: Linden dining table
1342
+ subtitle: Solid oak, seats six
1343
+ description: A solid oak top on slender steel legs, finished with the edge profile of your choice.
1344
+ price:
1345
+ main:
1346
+ price:
1347
+ $read: $price
1348
+ attributeSelection:
1349
+ edgeFinish:
1350
+ value:
1351
+ $bind: edgeFinish
1352
+ options:
1353
+ - label: Square
1354
+ description: Crisp and modern
1355
+ value: None
1356
+ - label: Facet
1357
+ description: A light bevel
1358
+ value: Facet
1359
+ - label: Round
1360
+ description: Soft to the touch
1361
+ value: Round
1362
+ - label: Tree trunk
1363
+ description: The natural edge
1364
+ value: TreeTrunk
1365
+ finalizeAction:
1366
+ quote:
1367
+ variant: primary
1368
+ label: Request a quote
1369
+ title: Send the configuration to the shop for a quote
1370
+ icon: PaperPlaneTilt
1371
+ handler: requestQuote
1372
+ htmlHotspot:
1373
+ edgeFinish:
1374
+ name: EdgeFinishHotspot
1375
+ offsetX: 500
1376
+ offsetY: 800
1377
+ offsetZ: 0
1378
+ $filter:
1379
+ modes: [owner]
1380
+ navigationStates: [configure]
1381
+ fitRootPerspectiveCamera:
1382
+ main:
1383
+ priority: 2
1384
+ fov: 35
1385
+ near: 100
1386
+ far: 10000
1387
+ minDistance: 1000
1388
+ maxDistance: 9000
1389
+ distance: 5000
1390
+ azimuthAngle: 1.5
1391
+ polarAngle: 1.1
1392
+ fitMeshChanges: true
1393
+ $filter:
1394
+ viewports: [desktop]
1395
+ phone:
1396
+ priority: 1
1397
+ fov: 35
1398
+ near: 100
1399
+ far: 10000
1400
+ minDistance: 1000
1401
+ maxDistance: 12000
1402
+ distance: 8000
1403
+ azimuthAngle: 1.5
1404
+ polarAngle: 1.1
1405
+ fitMeshChanges: true
1406
+ $filter:
1407
+ viewports: [mobile]
1408
+ edge:
1409
+ priority: 4
1410
+ fov: 35
1411
+ near: 100
1412
+ far: 10000
1413
+ minDistance: 800
1414
+ maxDistance: 9000
1415
+ distance: 2000
1416
+ azimuthAngle: 0.5
1417
+ polarAngle: 1.15
1418
+ fitMeshChanges: true
1419
+ $filter:
1420
+ viewports: [desktop]
1421
+ viewStates: [edge]
1422
+ edgePhone:
1423
+ priority: 3
1424
+ fov: 35
1425
+ near: 100
1426
+ far: 10000
1427
+ minDistance: 800
1428
+ maxDistance: 12000
1429
+ distance: 3000
1430
+ azimuthAngle: 0.5
1431
+ polarAngle: 1.15
1432
+ fitMeshChanges: true
1433
+ $filter:
1434
+ viewports: [mobile]
1435
+ viewStates: [edge]
1436
+ sceneEntityRemoteObject:
1437
+ top:
1438
+ fileUrl: /models/tables.gltf
1439
+ objectName: RECHTHOEK_RECTANGLE
1440
+ dimensionUnit: m
1441
+ leg:
1442
+ fileUrl: /models/tables.gltf
1443
+ objectName: AXL_LEG
1444
+ dimensionUnit: m
1445
+ sceneEntityObjectProperties:
1446
+ top:
1447
+ offsetY: 820
1448
+ morphTargetInfluences:
1449
+ Facet:
1450
+ value:
1451
+ $read: $edgeFinishFacet
1452
+ scaleOne: 1
1453
+ scaleZero: 0
1454
+ Bol:
1455
+ value:
1456
+ $read: $edgeFinishRound
1457
+ scaleOne: 1
1458
+ scaleZero: 0
1459
+ Boomstamrand:
1460
+ value:
1461
+ $read: $edgeFinishTreeTrunk
1462
+ scaleOne: 1
1463
+ scaleZero: 0
1464
+ leg:
1465
+ morphTargetInfluences:
1466
+ Length:
1467
+ value: 1000
1468
+ scaleOne: 3000
1469
+ scaleZero: 1400
1470
+ Width:
1471
+ value: 700
1472
+ scaleOne: 1300
1473
+ scaleZero: 600
1474
+ Height:
1475
+ value: 780
1476
+ scaleOne: 780
1477
+ scaleZero: 740
1478
+
1479
+ transformers:
1480
+ - name: tree-trunk-delivery
1481
+ ```
1482
+
1483
+ ### ./src/\_shared/BottomSheet.tsx
1484
+
1485
+ ```tsx
1486
+ import { Box, ButtonBase } from '@mui/material'
1487
+ import { type MouseEvent, type PointerEvent, type ReactNode, useRef } from 'react'
1488
+
1489
+ // A drag shorter than this is a tap, and the handle's click toggles the sheet
1490
+ const TAP_DISTANCE = 6
1491
+ // A drag that ends this far from where it started snaps to the other position
1492
+ const SNAP_DISTANCE = 48
1493
+ // A drag faster than this, in pixels per millisecond, snaps in its direction even when it is short
1494
+ const SNAP_VELOCITY = 0.5
1495
+ // How far the sheet follows the finger towards the position it is already in
1496
+ const OVERDRAG = 0.25
1497
+
1498
+ interface BottomSheetProps {
1499
+ readonly open: boolean
1500
+ readonly onOpenChange: (open: boolean) => void
1501
+ readonly label: string
1502
+ readonly children: ReactNode
1503
+ }
1504
+
1505
+ interface Drag {
1506
+ readonly startY: number
1507
+ readonly startTime: number
1508
+ delta: number
1509
+ }
1510
+
1511
+ // A persistent sheet at the bottom of the layout with two positions, open and collapsed. It is not a modal: the scene
1512
+ // above it stays interactive. Its height comes from its content, so the layout's safe area ends where the sheet
1513
+ // starts and changes only when the sheet snaps. While the handle is dragged the sheet follows the finger with a
1514
+ // transform, which the safe area does not see, so the camera refits once per snap and not on every move.
1515
+ export const BottomSheet = ({ open, onOpenChange, label, children }: BottomSheetProps) => {
1516
+ const sheetRef = useRef<HTMLElement>(null)
1517
+ const dragRef = useRef<Drag | null>(null)
1518
+ const draggedRef = useRef(false)
1519
+
1520
+ const moveSheet = (offset: number, animate: boolean) => {
1521
+ if (sheetRef.current) {
1522
+ sheetRef.current.style.transition = animate ? 'transform 200ms ease-out' : 'none'
1523
+ sheetRef.current.style.transform = offset === 0 ? '' : `translateY(${offset}px)`
1524
+ }
1525
+ }
1526
+
1527
+ const handlePointerDown = (event: PointerEvent<HTMLButtonElement>) => {
1528
+ event.currentTarget.setPointerCapture(event.pointerId)
1529
+ dragRef.current = { startY: event.clientY, startTime: event.timeStamp, delta: 0 }
1530
+ draggedRef.current = false
1531
+ }
1532
+
1533
+ const handlePointerMove = (event: PointerEvent<HTMLButtonElement>) => {
1534
+ const drag = dragRef.current
1535
+
1536
+ if (drag === null) {
1537
+ return
1538
+ }
1539
+
1540
+ drag.delta = event.clientY - drag.startY
1541
+ // Down closes an open sheet and up opens a collapsed one; the other direction only gives a little
1542
+ const towardsOther = open ? drag.delta > 0 : drag.delta < 0
1543
+ moveSheet(towardsOther ? drag.delta : drag.delta * OVERDRAG, false)
1544
+ }
1545
+
1546
+ const handlePointerEnd = (event: PointerEvent<HTMLButtonElement>) => {
1547
+ const drag = dragRef.current
1548
+ dragRef.current = null
1549
+
1550
+ if (drag === null) {
1551
+ return
1552
+ }
1553
+
1554
+ moveSheet(0, true)
1555
+
1556
+ if (Math.abs(drag.delta) < TAP_DISTANCE) {
1557
+ return
1558
+ }
1559
+
1560
+ draggedRef.current = true
1561
+ const velocity = drag.delta / Math.max(event.timeStamp - drag.startTime, 1)
1562
+ const flicked = Math.abs(drag.delta) >= SNAP_DISTANCE || Math.abs(velocity) >= SNAP_VELOCITY
1563
+
1564
+ if (flicked && (open ? drag.delta > 0 : drag.delta < 0)) {
1565
+ onOpenChange(!open)
1566
+ }
1567
+ }
1568
+
1569
+ // A tap, Enter or Space toggles the sheet. The pointer click that ends a drag has already been handled; a keyboard
1570
+ // click (`detail` 0) always toggles, also after a touch drag that was followed by no click.
1571
+ const handleClick = (event: MouseEvent<HTMLButtonElement>) => {
1572
+ const dragged = draggedRef.current
1573
+ draggedRef.current = false
1574
+
1575
+ if (dragged && event.detail !== 0) {
1576
+ return
1577
+ }
1578
+
1579
+ onOpenChange(!open)
1580
+ }
1581
+
1582
+ return (
1583
+ <Box
1584
+ component="section"
1585
+ ref={sheetRef}
1586
+ aria-label={label}
1587
+ sx={{
1588
+ position: 'relative',
1589
+ flexShrink: 0,
1590
+ display: 'flex',
1591
+ flexDirection: 'column',
1592
+ maxBlockSize: '55%',
1593
+ paddingBlockEnd: 'env(safe-area-inset-bottom)',
1594
+ borderStartStartRadius: 20,
1595
+ borderStartEndRadius: 20,
1596
+ bgcolor: 'background.paper',
1597
+ boxShadow: '0 -8px 32px rgba(0, 0, 0, 0.12)',
1598
+ // Fills the gap below the sheet while it is dragged up
1599
+ '&::after': {
1600
+ content: '""',
1601
+ position: 'absolute',
1602
+ insetInline: 0,
1603
+ insetBlockStart: '100%',
1604
+ blockSize: '100vh',
1605
+ bgcolor: 'background.paper',
1606
+ },
1607
+ }}
1608
+ >
1609
+ <ButtonBase
1610
+ aria-expanded={open}
1611
+ disableRipple
1612
+ aria-label={open ? `Collapse ${label.toLowerCase()}` : `Expand ${label.toLowerCase()}`}
1613
+ onClick={handleClick}
1614
+ onPointerDown={handlePointerDown}
1615
+ onPointerMove={handlePointerMove}
1616
+ onPointerUp={handlePointerEnd}
1617
+ onPointerCancel={handlePointerEnd}
1618
+ sx={{
1619
+ flexShrink: 0,
1620
+ blockSize: 36,
1621
+ touchAction: 'none',
1622
+ '&.Mui-focusVisible': { outline: 2, outlineColor: 'primary.main', outlineOffset: -4, borderRadius: 3 },
1623
+ }}
1624
+ >
1625
+ <Box component="span" sx={{ inlineSize: 40, blockSize: 4, borderRadius: 2, bgcolor: 'text.disabled' }} />
1626
+ </ButtonBase>
1627
+ {/* A column, so the panel's cards region shrinks first and the price and action stay in view; below the cards
1628
+ region's minimum height the content scrolls as a whole, as the review step does on a short phone */}
1629
+ <Box
1630
+ component="div"
1631
+ sx={{
1632
+ display: 'flex',
1633
+ flexDirection: 'column',
1634
+ flex: '1 1 auto',
1635
+ minBlockSize: 0,
1636
+ overflowY: 'auto',
1637
+ overscrollBehavior: 'contain',
1638
+ }}
1639
+ >
1640
+ {children}
1641
+ </Box>
1642
+ </Box>
1643
+ )
1644
+ }
1645
+ ```
1646
+
1647
+ ### ./src/\_shared/EdgeFinishCards.tsx
1648
+
1649
+ ```tsx
1650
+ import { Box, ButtonBase, type SxProps, type Theme, Typography } from '@mui/material'
1651
+ import type { KeyboardEvent } from 'react'
1652
+
1653
+ import { type UseAttributeSelection, useResolveLocalizable } from '@salsita-ai/sdk/react'
1654
+
1655
+ // Cross-sections of the tabletop's edge, keyed by the option values of the spec.
1656
+ const EDGE_PROFILES: Readonly<Record<string, string>> = {
1657
+ None: 'M0 4H32V20H0Z',
1658
+ Facet: 'M0 4H26L32 10V14L26 20H0Z',
1659
+ Round: 'M0 4H24A8 8 0 0 1 24 20H0Z',
1660
+ TreeTrunk: 'M0 4H27C33 5 28 9 34 11C29 13 34 17 27 20H0Z',
1661
+ }
1662
+
1663
+ const CHECK_BADGE: SxProps<Theme> = {
1664
+ position: 'absolute',
1665
+ insetBlockStart: 10,
1666
+ insetInlineEnd: 10,
1667
+ display: 'grid',
1668
+ placeItems: 'center',
1669
+ inlineSize: 22,
1670
+ blockSize: 22,
1671
+ borderRadius: '50%',
1672
+ bgcolor: 'primary.main',
1673
+ color: 'primary.contrastText',
1674
+ fontSize: 13,
1675
+ }
1676
+
1677
+ // Arrow keys move the selection between the cards, as in a native radio group.
1678
+ const ARROW_STEPS: Readonly<Record<string, number | undefined>> = {
1679
+ ArrowRight: 1,
1680
+ ArrowDown: 1,
1681
+ ArrowLeft: -1,
1682
+ ArrowUp: -1,
1683
+ }
1684
+
1685
+ interface EdgeFinishCardsProps {
1686
+ readonly selection: ReturnType<UseAttributeSelection>
1687
+ }
1688
+
1689
+ export const EdgeFinishCards = ({ selection }: EdgeFinishCardsProps) => {
1690
+ const resolve = useResolveLocalizable()
1691
+ const { options } = selection
1692
+ // The card in the tab order: the selected one, or the first enabled one. Disabled cards are never in it.
1693
+ const selectedIndex = options.findIndex(option => option.value === selection.value && !option.disabled)
1694
+ const focusIndex = selectedIndex >= 0 ? selectedIndex : options.findIndex(option => !option.disabled)
1695
+
1696
+ const handleKeyDown = (event: KeyboardEvent<HTMLElement>, index: number) => {
1697
+ const step = ARROW_STEPS[event.key]
1698
+
1699
+ if (step === undefined) {
1700
+ return
1701
+ }
1702
+
1703
+ event.preventDefault()
1704
+ // The next enabled option in the arrow's direction, wrapping around; disabled options are skipped.
1705
+ const count = options.length
1706
+ const next = Array.from(
1707
+ { length: count - 1 },
1708
+ (_, offset) => (((index + step * (offset + 1)) % count) + count) % count
1709
+ ).find(candidate => !options[candidate]?.disabled)
1710
+
1711
+ if (next === undefined) {
1712
+ return
1713
+ }
1714
+
1715
+ options[next]?.onSelect()
1716
+ event.currentTarget.parentElement?.querySelectorAll<HTMLElement>('[role="radio"]')[next]?.focus()
1717
+ }
1718
+
1719
+ return (
1720
+ <Box
1721
+ component="div"
1722
+ role="radiogroup"
1723
+ aria-label="Edge finish"
1724
+ sx={{ display: 'grid', gridTemplateColumns: '1fr 1fr', gap: 1.5 }}
1725
+ >
1726
+ {options.map((option, index) => {
1727
+ const isSelected = option.value === selection.value
1728
+
1729
+ return (
1730
+ <ButtonBase
1731
+ key={String(option.value)}
1732
+ role="radio"
1733
+ aria-checked={isSelected}
1734
+ tabIndex={index === focusIndex ? 0 : -1}
1735
+ disabled={option.disabled}
1736
+ onClick={option.onSelect}
1737
+ onKeyDown={event => handleKeyDown(event, index)}
1738
+ sx={{
1739
+ position: 'relative',
1740
+ display: 'grid',
1741
+ justifyItems: 'start',
1742
+ gap: 0.5,
1743
+ padding: 2,
1744
+ borderRadius: 3,
1745
+ border: 2,
1746
+ borderColor: isSelected ? 'primary.main' : 'divider',
1747
+ bgcolor: isSelected ? 'action.hover' : 'transparent',
1748
+ textAlign: 'start',
1749
+ transition: 'border-color 150ms, background-color 150ms',
1750
+ '&:hover': { borderColor: isSelected ? 'primary.main' : 'text.disabled' },
1751
+ '&.Mui-focusVisible': { outline: 2, outlineColor: 'primary.main', outlineOffset: 2 },
1752
+ '&.Mui-disabled': { opacity: 0.4 },
1753
+ }}
1754
+ >
1755
+ {isSelected && (
1756
+ <Box component="span" aria-hidden sx={CHECK_BADGE}>
1757
+ ✓
1758
+ </Box>
1759
+ )}
1760
+ <Box
1761
+ component="svg"
1762
+ viewBox="0 0 36 24"
1763
+ aria-hidden
1764
+ sx={{ inlineSize: 60, blockSize: 40, color: '#b98b5e' }}
1765
+ >
1766
+ <path d={EDGE_PROFILES[String(option.value)]} fill="currentColor" />
1767
+ </Box>
1768
+ <Typography variant="body2" fontWeight={600}>
1769
+ {resolve(option.title)}
1770
+ </Typography>
1771
+ <Typography variant="caption" color="text.secondary">
1772
+ {resolve(option.description)}
1773
+ </Typography>
1774
+ </ButtonBase>
1775
+ )
1776
+ })}
1777
+ </Box>
1778
+ )
1779
+ }
1780
+ ```
1781
+
1782
+ ### ./src/\_shared/FullscreenToggle.tsx
1783
+
1784
+ ```tsx
1785
+ import { Button, Tooltip } from '@mui/material'
1786
+
1787
+ import { phx } from '../../.phoenix/phx.js'
1788
+
1789
+ const ENTER_ICON = 'M4 9V4h5M15 4h5v5M20 15v5h-5M9 20H4v-5'
1790
+ const EXIT_ICON = 'M9 4v5H4M15 4v5h5M15 20v-5h5M9 20v-5H4'
1791
+
1792
+ interface FullscreenToggleProps {
1793
+ // Only the icon, with the label as its accessible name and tooltip, where a label would cover the product
1794
+ readonly compact?: boolean
1795
+ }
1796
+
1797
+ export const FullscreenToggle = ({ compact = false }: FullscreenToggleProps) => {
1798
+ const isFullscreen = phx.frontend.useIsFullscreenActive()
1799
+ const setFullscreen = phx.frontend.useSetFullscreen()
1800
+ const label = isFullscreen ? 'Exit fullscreen' : 'Fullscreen'
1801
+ const icon = (
1802
+ <svg viewBox="0 0 24 24" width={20} height={20} fill="none" stroke="currentColor" strokeWidth={2}>
1803
+ <path d={isFullscreen ? EXIT_ICON : ENTER_ICON} />
1804
+ </svg>
1805
+ )
1806
+
1807
+ return (
1808
+ <Tooltip title={compact ? label : ''}>
1809
+ <Button
1810
+ onClick={() => setFullscreen(!isFullscreen)}
1811
+ aria-label={compact ? label : undefined}
1812
+ startIcon={compact ? undefined : icon}
1813
+ sx={{
1814
+ minBlockSize: 44,
1815
+ minInlineSize: 44,
1816
+ paddingInline: compact ? 0 : 2.5,
1817
+ borderRadius: 999,
1818
+ bgcolor: 'background.paper',
1819
+ color: 'text.primary',
1820
+ boxShadow: '0 4px 16px rgba(0, 0, 0, 0.12)',
1821
+ textTransform: 'none',
1822
+ fontWeight: 600,
1823
+ '&:hover': { bgcolor: 'background.paper', boxShadow: '0 6px 20px rgba(0, 0, 0, 0.18)' },
1824
+ }}
1825
+ >
1826
+ {compact ? icon : label}
1827
+ </Button>
1828
+ </Tooltip>
1829
+ )
1830
+ }
1831
+ ```
1832
+
1833
+ ### ./src/\_shared/MessageToast.tsx
1834
+
1835
+ ```tsx
1836
+ import { Alert } from '@mui/material'
1837
+ import { useEffect, useState } from 'react'
1838
+
1839
+ import type { ConfiguratorMessage } from '@salsita-ai/sdk/react'
1840
+
1841
+ import { phx } from '../../.phoenix/phx.js'
1842
+
1843
+ const VIOLATION_SEVERITY = { fatal: 'error', fixable: 'error', warning: 'warning', notice: 'info' } as const
1844
+ const RANK = { info: 0, warning: 1, error: 2 } as const
1845
+ const VISIBLE_MS = 6000
1846
+
1847
+ const severityOf = (message: ConfiguratorMessage) => {
1848
+ if (message.kind === 'violation') {
1849
+ return VIOLATION_SEVERITY[message.violation.severity]
1850
+ }
1851
+
1852
+ return message.kind === 'error' || message.kind === 'saveError' ? 'error' : 'info'
1853
+ }
1854
+
1855
+ export const MessageToast = () => {
1856
+ const [message, setMessage] = useState<ConfiguratorMessage | null>(null)
1857
+
1858
+ // A rejected change also reports the notices already present; keep the worst message while it is shown
1859
+ phx.frontend.useConfiguratorMessages(next => {
1860
+ setMessage(shown => (shown !== null && RANK[severityOf(next)] < RANK[severityOf(shown)] ? shown : next))
1861
+ })
1862
+
1863
+ useEffect(() => {
1864
+ if (message === null) {
1865
+ return
1866
+ }
1867
+
1868
+ const timeout = setTimeout(() => setMessage(null), VISIBLE_MS)
1869
+
1870
+ return () => clearTimeout(timeout)
1871
+ }, [message])
1872
+
1873
+ if (message === null) {
1874
+ return null
1875
+ }
1876
+
1877
+ return (
1878
+ <Alert
1879
+ severity={severityOf(message)}
1880
+ onClose={() => setMessage(null)}
1881
+ sx={{ maxInlineSize: 420, borderRadius: 3, boxShadow: '0 12px 40px rgba(0, 0, 0, 0.12)' }}
1882
+ >
1883
+ {message.text}
1884
+ </Alert>
1885
+ )
1886
+ }
1887
+ ```
1888
+
1889
+ ### ./src/\_shared/ProductPanel.tsx
1890
+
1891
+ ```tsx
1892
+ import { Box, Button, Typography } from '@mui/material'
1893
+
1894
+ import { detailComponent, finalizeActionComponent } from '@salsita-ai/sdk/domain'
1895
+ import { PhoenixHandlerBoundary, useResolveLocalizable } from '@salsita-ai/sdk/react'
1896
+
1897
+ import { phx } from '../../.phoenix/phx.js'
1898
+ import { EdgeFinishCards } from './EdgeFinishCards.js'
1899
+ import { ReviewActions } from './ReviewActions.js'
1900
+
1901
+ const BUTTON_SX = { minBlockSize: 48, borderRadius: 999, textTransform: 'none', fontWeight: 600 } as const
1902
+
1903
+ interface ProductPanelProps {
1904
+ // Only the name, the price and the action, for a collapsed bottom sheet
1905
+ readonly collapsed?: boolean
1906
+ // In a bottom sheet the cards region keeps the top of the cards in view, and the sheet scrolls when that does not fit
1907
+ readonly inSheet?: boolean
1908
+ }
1909
+
1910
+ export const ProductPanel = ({ collapsed = false, inSheet = false }: ProductPanelProps) => {
1911
+ const resolve = useResolveLocalizable()
1912
+ const detail = phx.frontend.useFirstRootComponent(detailComponent)
1913
+ const price = phx.frontend.useRootEntityPrice()
1914
+ const tableId = phx.frontend.useRootEntityId()
1915
+ const edgeFinish = phx.frontend.useAttributeSelection(tableId, 'edgeFinish')
1916
+ const { accessInfo } = phx.frontend.useAccessService()
1917
+ const navigationState = phx.frontend.useActiveNavigationState()
1918
+ const pushNavigate = phx.frontend.usePushNavigate()
1919
+ const popNavigate = phx.frontend.usePopNavigate()
1920
+ const navigate = phx.frontend.useNavigate()
1921
+ const finalizeActions = phx.frontend.useComponents({ componentTypes: [finalizeActionComponent] }) ?? []
1922
+
1923
+ const isReadMode = accessInfo.viewMode
1924
+ const isReview = isReadMode || navigationState !== 'configure'
1925
+ // The spec's primary finalize action, or its first one
1926
+ const quoteAction = finalizeActions.find(action => action.state.variant === 'primary') ?? finalizeActions[0]
1927
+ const chosenEdge = edgeFinish.options.find(option => option.value === edgeFinish.value)
1928
+
1929
+ return (
1930
+ <>
1931
+ <Box component="header" sx={{ display: 'grid', gap: 1, padding: 3, paddingBlockEnd: 2 }}>
1932
+ {isReadMode ? (
1933
+ <Typography
1934
+ variant="overline"
1935
+ sx={{ justifySelf: 'start', paddingInline: 1.5, borderRadius: 999, bgcolor: 'action.selected' }}
1936
+ >
1937
+ View only
1938
+ </Typography>
1939
+ ) : (
1940
+ <Typography variant="overline" color="text.secondary">
1941
+ {resolve(detail?.state.subtitle)}
1942
+ </Typography>
1943
+ )}
1944
+ <Typography variant="h5" component="h2" fontWeight={700}>
1945
+ {resolve(detail?.state.title)}
1946
+ </Typography>
1947
+ {!collapsed && (
1948
+ <Typography variant="body2" color="text.secondary">
1949
+ {resolve(detail?.state.description)}
1950
+ </Typography>
1951
+ )}
1952
+ </Box>
1953
+
1954
+ {!collapsed && (
1955
+ <Box
1956
+ component="div"
1957
+ sx={{
1958
+ display: 'grid',
1959
+ gap: 1.5,
1960
+ paddingInline: 3,
1961
+ paddingBlockEnd: 3,
1962
+ // In a short container the region shrinks and scrolls; a scroll past its end moves its container on
1963
+ minBlockSize: inSheet ? 120 : 0,
1964
+ overflowY: 'auto',
1965
+ }}
1966
+ >
1967
+ <Typography variant="subtitle2" component="h3">
1968
+ Edge finish
1969
+ </Typography>
1970
+ {isReview ? (
1971
+ <Box component="div" sx={{ padding: 2, borderRadius: 3, bgcolor: 'action.hover' }}>
1972
+ <Typography variant="body2" fontWeight={600}>
1973
+ {resolve(chosenEdge?.title)}
1974
+ </Typography>
1975
+ <Typography variant="caption" color="text.secondary">
1976
+ {resolve(chosenEdge?.description)}
1977
+ </Typography>
1978
+ </Box>
1979
+ ) : (
1980
+ <EdgeFinishCards selection={edgeFinish} />
1981
+ )}
1982
+ </Box>
1983
+ )}
1984
+
1985
+ <Box component="footer" sx={{ display: 'grid', gap: 2, padding: 3, borderTop: 1, borderColor: 'divider' }}>
1986
+ <Box component="div" sx={{ display: 'flex', alignItems: 'baseline', justifyContent: 'space-between' }}>
1987
+ <Typography variant="body2" color="text.secondary">
1988
+ Total price
1989
+ </Typography>
1990
+ <Typography variant="h5" component="p" fontWeight={700}>
1991
+ {price}
1992
+ </Typography>
1993
+ </Box>
1994
+ {!isReadMode && navigationState === 'configure' && (
1995
+ <Button size="large" variant="contained" onClick={() => pushNavigate('checkout')} sx={BUTTON_SX}>
1996
+ Review and request a quote
1997
+ </Button>
1998
+ )}
1999
+ {!isReadMode && navigationState === 'checkout' && (
2000
+ <>
2001
+ <Typography variant="body2" color="text.secondary">
2002
+ Your table is ready for a quote. A real shop collects the contact details here.
2003
+ </Typography>
2004
+ {quoteAction ? (
2005
+ <PhoenixHandlerBoundary name={quoteAction.state.handler}>
2006
+ <ReviewActions
2007
+ handler={quoteAction.state.handler}
2008
+ label={resolve(quoteAction.state.label)}
2009
+ onBack={popNavigate}
2010
+ />
2011
+ </PhoenixHandlerBoundary>
2012
+ ) : (
2013
+ <Button size="large" variant="outlined" onClick={popNavigate} sx={BUTTON_SX}>
2014
+ Back to the configuration
2015
+ </Button>
2016
+ )}
2017
+ </>
2018
+ )}
2019
+ {!isReadMode && navigationState === 'requested' && (
2020
+ <>
2021
+ <Typography variant="body2" role="status">
2022
+ Thank you. Your quote request is on its way, and the shop replies within two working days.
2023
+ </Typography>
2024
+ <Button size="large" variant="outlined" onClick={() => navigate('configure')} sx={BUTTON_SX}>
2025
+ Back to the configuration
2026
+ </Button>
2027
+ </>
2028
+ )}
2029
+ </Box>
2030
+ </>
2031
+ )
2032
+ }
2033
+ ```
2034
+
2035
+ ### ./src/\_shared/ReviewActions.tsx
2036
+
2037
+ ```tsx
2038
+ import { Alert, Box, Button, CircularProgress, Typography } from '@mui/material'
2039
+
2040
+ import { phx } from '../../.phoenix/phx.js'
2041
+
2042
+ const BUTTON_SX = { minBlockSize: 48, borderRadius: 999, textTransform: 'none', fontWeight: 600 } as const
2043
+
2044
+ interface ReviewActionsProps {
2045
+ readonly handler: string
2046
+ readonly label: string
2047
+ readonly onBack: () => void
2048
+ }
2049
+
2050
+ // The review step's buttons: one finalize action and the way back. `useFinalizeAction` runs the action's handler,
2051
+ // so this component calls it exactly once and is rendered inside a `PhoenixHandlerBoundary` for that handler.
2052
+ // Back is disabled while the request is pending, so the customer cannot change the configuration while it is sent.
2053
+ // The pending state belongs to this component: when the panel unmounts, as in fullscreen, the request goes on and
2054
+ // the remounted buttons are enabled again.
2055
+ export const ReviewActions = ({ handler, label, onBack }: ReviewActionsProps) => {
2056
+ const { run, isPending, error, disabled, hints } = phx.frontend.useFinalizeAction(handler)
2057
+
2058
+ return (
2059
+ <Box component="div" sx={{ display: 'grid', gap: 2 }}>
2060
+ <Box component="div" sx={{ display: 'grid', gap: 1 }}>
2061
+ <Button
2062
+ size="large"
2063
+ variant="contained"
2064
+ disabled={disabled || isPending}
2065
+ onClick={run}
2066
+ startIcon={isPending ? <CircularProgress size={18} color="inherit" /> : undefined}
2067
+ sx={BUTTON_SX}
2068
+ >
2069
+ {isPending ? 'Sending the request…' : label}
2070
+ </Button>
2071
+ {disabled && hints && (
2072
+ <Typography variant="caption" color="text.secondary">
2073
+ {hints}
2074
+ </Typography>
2075
+ )}
2076
+ {error && <Alert severity="error">The request could not be sent: {error.message}</Alert>}
2077
+ </Box>
2078
+ <Button size="large" variant="outlined" disabled={isPending} onClick={onBack} sx={BUTTON_SX}>
2079
+ Back to the configuration
2080
+ </Button>
2081
+ </Box>
2082
+ )
2083
+ }
2084
+ ```
2085
+
2086
+ ### ./src/\_shared/SceneControls.tsx
2087
+
2088
+ ```tsx
2089
+ import { Box, Button, Tooltip } from '@mui/material'
2090
+
2091
+ import { phx } from '../../.phoenix/phx.js'
2092
+
2093
+ // The spec's view states, each with the label of the button that shows it
2094
+ const VIEWS = [
2095
+ { state: 'overview', label: 'Whole table' },
2096
+ { state: 'edge', label: 'Edge close-up' },
2097
+ ] as const
2098
+
2099
+ const RESET_ICON = 'M4 12a8 8 0 1 0 2.4-5.7M4 4v4h4'
2100
+
2101
+ const SURFACE_SX = {
2102
+ borderRadius: 999,
2103
+ bgcolor: 'background.paper',
2104
+ boxShadow: '0 4px 16px rgba(0, 0, 0, 0.12)',
2105
+ } as const
2106
+
2107
+ const BUTTON_SX = {
2108
+ minBlockSize: 44,
2109
+ minInlineSize: 44,
2110
+ borderRadius: 999,
2111
+ textTransform: 'none',
2112
+ fontWeight: 600,
2113
+ whiteSpace: 'nowrap',
2114
+ } as const
2115
+
2116
+ interface SceneControlsProps {
2117
+ // The reset button shows only its icon, with its label as tooltip and accessible name
2118
+ readonly compact?: boolean
2119
+ // Only the reset button, without the view buttons
2120
+ readonly resetOnly?: boolean
2121
+ }
2122
+
2123
+ // The layout's own camera controls: one button per view state of the spec, and a reset that undoes an orbit
2124
+ export const SceneControls = ({ compact = false, resetOnly = false }: SceneControlsProps) => {
2125
+ const activeView = phx.frontend.useActiveViewState()
2126
+ const setViewState = phx.frontend.useSetViewState()
2127
+ const resetCamera = phx.frontend.useResetCamera()
2128
+ const resetIcon = (
2129
+ <svg viewBox="0 0 24 24" width={20} height={20} fill="none" stroke="currentColor" strokeWidth={2}>
2130
+ <path d={RESET_ICON} />
2131
+ </svg>
2132
+ )
2133
+
2134
+ return (
2135
+ <Box component="div" sx={{ display: 'flex', gap: 1 }}>
2136
+ {!resetOnly && (
2137
+ <Box component="div" role="group" aria-label="View" sx={{ ...SURFACE_SX, display: 'flex' }}>
2138
+ {VIEWS.map(view => {
2139
+ const isActive = activeView === view.state
2140
+
2141
+ return (
2142
+ <Button
2143
+ key={view.state}
2144
+ aria-pressed={isActive}
2145
+ onClick={() => setViewState(view.state)}
2146
+ sx={{
2147
+ ...BUTTON_SX,
2148
+ paddingInline: 2,
2149
+ bgcolor: isActive ? 'text.primary' : 'transparent',
2150
+ color: isActive ? 'background.paper' : 'text.primary',
2151
+ '&:hover': { bgcolor: isActive ? 'text.primary' : 'action.hover' },
2152
+ }}
2153
+ >
2154
+ {view.label}
2155
+ </Button>
2156
+ )
2157
+ })}
2158
+ </Box>
2159
+ )}
2160
+ <Tooltip title={compact ? 'Reset view' : ''}>
2161
+ <Button
2162
+ onClick={resetCamera}
2163
+ aria-label={compact ? 'Reset view' : undefined}
2164
+ startIcon={compact ? undefined : resetIcon}
2165
+ sx={{
2166
+ ...SURFACE_SX,
2167
+ ...BUTTON_SX,
2168
+ paddingInline: compact ? 0 : 2,
2169
+ color: 'text.primary',
2170
+ '&:hover': { bgcolor: 'background.paper', boxShadow: '0 6px 20px rgba(0, 0, 0, 0.18)' },
2171
+ }}
2172
+ >
2173
+ {compact ? resetIcon : 'Reset view'}
2174
+ </Button>
2175
+ </Tooltip>
2176
+ </Box>
2177
+ )
2178
+ }
2179
+ ```
2180
+
2181
+ ### ./src/elements/ConfiguratorLayout.tsx
2182
+
2183
+ ```tsx
2184
+ import { Box } from '@mui/material'
2185
+ import { useState } from 'react'
2186
+
2187
+ import { LayoutSlots, useSceneSafeArea } from '@salsita-ai/sdk/configurator'
2188
+ import { useActiveViewports } from '@salsita-ai/sdk/react'
2189
+
2190
+ import { phx } from '../../.phoenix/phx.js'
2191
+ import { BottomSheet } from '../_shared/BottomSheet.js'
2192
+ import { FullscreenToggle } from '../_shared/FullscreenToggle.js'
2193
+ import { MessageToast } from '../_shared/MessageToast.js'
2194
+ import { ProductPanel } from '../_shared/ProductPanel.js'
2195
+ import { SceneControls } from '../_shared/SceneControls.js'
2196
+
2197
+ const GUTTER = 24
2198
+ const PANEL_WIDTH = 380
2199
+ const PHONE_GUTTER = 16
2200
+ const TOUCH_TARGET = 44
2201
+
2202
+ const ConfiguratorLayout = () => {
2203
+ const { containerRef, safeAreaRef } = useSceneSafeArea()
2204
+ const isFullscreen = phx.frontend.useIsFullscreenActive()
2205
+ // `null` until the container has been measured; the layout shows only the scene until then
2206
+ const viewports = useActiveViewports()
2207
+ const [isSheetOpen, setSheetOpen] = useState(false)
2208
+
2209
+ const isDesktop = viewports?.includes('desktop') ?? false
2210
+ const gutter = isDesktop ? GUTTER : PHONE_GUTTER
2211
+
2212
+ return (
2213
+ <Box
2214
+ component="div"
2215
+ ref={containerRef}
2216
+ // `clip`, not `hidden`: what overflows, such as the sheet's fill below its edge, can never be scrolled into view,
2217
+ // not even by the browser when the focus moves
2218
+ sx={{ position: 'absolute', inset: 0, display: 'flex', flexDirection: 'column', overflow: 'clip' }}
2219
+ >
2220
+ <LayoutSlots.SharedCanvas />
2221
+
2222
+ {viewports !== null && isDesktop && !isFullscreen && (
2223
+ <Box
2224
+ component="aside"
2225
+ sx={{
2226
+ position: 'absolute',
2227
+ insetBlockStart: GUTTER,
2228
+ insetInlineStart: GUTTER,
2229
+ inlineSize: PANEL_WIDTH,
2230
+ maxBlockSize: `calc(100% - ${2 * GUTTER}px)`,
2231
+ display: 'flex',
2232
+ flexDirection: 'column',
2233
+ borderRadius: 5,
2234
+ bgcolor: 'background.paper',
2235
+ boxShadow: '0 12px 40px rgba(0, 0, 0, 0.12)',
2236
+ // A very short container, such as a phone held sideways, scrolls the panel instead of clipping its footer
2237
+ overflowX: 'hidden',
2238
+ overflowY: 'auto',
2239
+ overscrollBehavior: 'contain',
2240
+ }}
2241
+ >
2242
+ <ProductPanel />
2243
+ </Box>
2244
+ )}
2245
+
2246
+ {viewports !== null && (
2247
+ <Box
2248
+ component="div"
2249
+ ref={safeAreaRef}
2250
+ sx={{
2251
+ // Desktop: right of the panel. Phone: above the sheet, whose height the column gives the rest.
2252
+ ...(isDesktop
2253
+ ? {
2254
+ position: 'absolute',
2255
+ insetBlock: 0,
2256
+ insetInlineStart: isFullscreen ? 0 : PANEL_WIDTH + 2 * GUTTER,
2257
+ insetInlineEnd: 0,
2258
+ }
2259
+ : { position: 'relative', flex: '1 1 0', minBlockSize: 0 }),
2260
+ pointerEvents: 'none',
2261
+ }}
2262
+ >
2263
+ <Box
2264
+ component="div"
2265
+ sx={{ position: 'absolute', insetBlockStart: gutter, insetInlineEnd: gutter, pointerEvents: 'auto' }}
2266
+ >
2267
+ <FullscreenToggle compact={!isDesktop} />
2268
+ </Box>
2269
+ <Box
2270
+ component="div"
2271
+ sx={{
2272
+ position: 'absolute',
2273
+ pointerEvents: 'auto',
2274
+ // Desktop: bottom left, above the row of view controls. Phone: at the top beside the fullscreen button,
2275
+ // clear of the sheet's handle and the view controls.
2276
+ ...(isDesktop
2277
+ ? { insetBlockEnd: 2 * GUTTER + TOUCH_TARGET, insetInlineStart: GUTTER }
2278
+ : { insetBlockStart: gutter, insetInline: `${gutter}px ${2 * gutter + TOUCH_TARGET}px` }),
2279
+ }}
2280
+ >
2281
+ <MessageToast />
2282
+ </Box>
2283
+ {/* A phone in fullscreen keeps only the reset, as the built-in layout does. Below 1024 pixels (`tablet`) the
2284
+ free area beside the panel is narrow, so the reset shows only its icon there too. */}
2285
+ <Box
2286
+ component="div"
2287
+ sx={{ position: 'absolute', insetBlockEnd: gutter, insetInlineEnd: gutter, pointerEvents: 'auto' }}
2288
+ >
2289
+ <SceneControls
2290
+ compact={!isDesktop || (viewports?.includes('tablet') ?? false)}
2291
+ resetOnly={!isDesktop && isFullscreen}
2292
+ />
2293
+ </Box>
2294
+ </Box>
2295
+ )}
2296
+
2297
+ {viewports !== null && !isDesktop && !isFullscreen && (
2298
+ <BottomSheet open={isSheetOpen} onOpenChange={setSheetOpen} label="Product details">
2299
+ <ProductPanel collapsed={!isSheetOpen} inSheet />
2300
+ </BottomSheet>
2301
+ )}
2302
+ </Box>
2303
+ )
2304
+ }
2305
+
2306
+ export default phx.frontend.createCustomPhoenixLayoutElement('ConfiguratorLayout', ConfiguratorLayout)
2307
+ ```
2308
+
2309
+ ### ./src/elements/EdgeFinishHotspot.tsx
2310
+
2311
+ ```tsx
2312
+ import { Box, ButtonBase, Popover, Tooltip } from '@mui/material'
2313
+ import { useState } from 'react'
2314
+
2315
+ import { phx } from '../../.phoenix/phx.js'
2316
+ import { EdgeFinishCards } from '../_shared/EdgeFinishCards.js'
2317
+
2318
+ // The edge profile the button shows, the square edge of the cards' drawings
2319
+ const EDGE_ICON = 'M3 7H17L21 11V13L17 17H3Z'
2320
+
2321
+ // Rendered by the spec's `htmlHotspot` on the table's edge: a button on the product that opens the edge finishes
2322
+ // next to the edge, with the same cards as the panel. The spec's `$filter` decides when it is shown.
2323
+ export default phx.frontend.createCustomPhoenixEntityElement('EdgeFinishHotspot', ({ entityId }) => {
2324
+ const edgeFinish = phx.frontend.useAttributeSelection(entityId, 'edgeFinish')
2325
+ const [anchor, setAnchor] = useState<HTMLElement | null>(null)
2326
+
2327
+ return (
2328
+ <>
2329
+ <Tooltip title="Edge finish">
2330
+ <ButtonBase
2331
+ aria-label="Edge finish"
2332
+ aria-haspopup="dialog"
2333
+ aria-expanded={anchor !== null}
2334
+ onClick={event => setAnchor(event.currentTarget)}
2335
+ sx={{
2336
+ display: 'grid',
2337
+ placeItems: 'center',
2338
+ inlineSize: 44,
2339
+ blockSize: 44,
2340
+ borderRadius: '50%',
2341
+ bgcolor: 'background.paper',
2342
+ color: 'primary.main',
2343
+ boxShadow: '0 4px 16px rgba(0, 0, 0, 0.2)',
2344
+ '&.Mui-focusVisible': { outline: 2, outlineColor: 'primary.main', outlineOffset: 2 },
2345
+ }}
2346
+ >
2347
+ <svg viewBox="0 0 24 24" width={22} height={22} aria-hidden>
2348
+ <path d={EDGE_ICON} fill="currentColor" />
2349
+ </svg>
2350
+ </ButtonBase>
2351
+ </Tooltip>
2352
+ <Popover
2353
+ open={anchor !== null}
2354
+ anchorEl={anchor}
2355
+ onClose={() => setAnchor(null)}
2356
+ anchorOrigin={{ vertical: 'top', horizontal: 'center' }}
2357
+ transformOrigin={{ vertical: 'bottom', horizontal: 'center' }}
2358
+ slotProps={{
2359
+ paper: { role: 'dialog', 'aria-label': 'Edge finish', sx: { borderRadius: 4, marginBlockStart: -1 } },
2360
+ }}
2361
+ >
2362
+ <Box component="div" sx={{ inlineSize: 340, maxInlineSize: 'calc(100vw - 32px)', padding: 2 }}>
2363
+ <EdgeFinishCards selection={edgeFinish} />
2364
+ </Box>
2365
+ </Popover>
2366
+ </>
2367
+ )
2368
+ })
2369
+ ```
2370
+
2371
+ ### ./src/expressions/table.ts
2372
+
2373
+ ```ts
2374
+ import { phx } from '../../.phoenix/phx.js'
2375
+
2376
+ const EDGE_FINISH_SURCHARGE = { None: 0, Facet: 90, Round: 120, TreeTrunk: 340 }
2377
+
2378
+ export default phx.domain.implementCustomExpressions({
2379
+ Table: {
2380
+ $price: s => {
2381
+ return 1290 + EDGE_FINISH_SURCHARGE[s.edgeFinish]
2382
+ },
2383
+ $edgeFinishFacet: s => {
2384
+ return s.edgeFinish === 'Facet' ? 1 : 0
2385
+ },
2386
+ $edgeFinishRound: s => {
2387
+ return s.edgeFinish === 'Round' ? 1 : 0
2388
+ },
2389
+ $edgeFinishTreeTrunk: s => {
2390
+ return s.edgeFinish === 'TreeTrunk' ? 1 : 0
2391
+ },
2392
+ },
2393
+ })
2394
+ ```
2395
+
2396
+ ### ./src/handlers/request-quote.ts
2397
+
2398
+ ```ts
2399
+ import { useCallback } from 'react'
2400
+
2401
+ import { phx } from '../../.phoenix/phx.js'
2402
+
2403
+ // Stands in for the shop's quote service: the request takes a moment, then the panel shows the confirmation
2404
+ export default phx.frontend.createPhoenixHandler('requestQuote', () => {
2405
+ const navigate = phx.frontend.useNavigate()
2406
+
2407
+ return {
2408
+ handler: useCallback(async () => {
2409
+ await new Promise(resolve => setTimeout(resolve, 1500))
2410
+ navigate('requested')
2411
+ }, [navigate]),
2412
+ }
2413
+ })
2414
+ ```
2415
+
2416
+ ### ./src/transformers/tree-trunk-delivery.ts
2417
+
2418
+ ```ts
2419
+ import { msg } from '@lingui/core/macro'
2420
+
2421
+ import { phx } from '../../.phoenix/phx.js'
2422
+
2423
+ // A tree-trunk edge is cut by hand; choosing it carries a hint, which reaches the layout as a side-effect message
2424
+ export default phx.frontend.transformerBuilder.when
2425
+ .entity(['Table'])
2426
+ .modified({ atFields: ['edgeFinish'] })
2427
+ .then.overrideMatchingUpdate(({ update }) => {
2428
+ if (update.stateDelta.edgeFinish !== 'TreeTrunk') {
2429
+ return [update]
2430
+ }
2431
+
2432
+ return [{ ...update, hint: msg`Tree trunk edges are cut by hand, so delivery takes three weeks longer.` }]
2433
+ })
2434
+ .build('tree-trunk-delivery')
2435
+ ```
2436
+
2437
+ </details>