@salsita-ai/sdk 0.50.0-develop.be40f0cee8 → 0.50.0-develop.d81d7591c5

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 (272) hide show
  1. package/dist/application-spec/generate-application/code/common/index.d.ts +1 -0
  2. package/dist/application-spec/generate-application/code/common/index.js +1 -1
  3. package/dist/application-spec/generate-application/code/common/project-module-list.d.ts +8 -0
  4. package/dist/application-spec/generate-application/code/common/project-module-list.js +3 -0
  5. package/dist/application-spec/generate-application/code/domain-runtime-files.js +1 -1
  6. package/dist/application-spec/generate-application/code/project-scaffolding.js +2 -2
  7. package/dist/application-spec/generate-application/code/templates/admin-domain-code.d.ts +1 -2
  8. package/dist/application-spec/generate-application/code/templates/admin-domain-code.js +6 -14
  9. package/dist/application-spec/generate-application/code/templates/admin-frontend-code.d.ts +1 -2
  10. package/dist/application-spec/generate-application/code/templates/admin-frontend-code.js +4 -4
  11. package/dist/application-spec/generate-application/code/templates/configurator-domain-code.d.ts +1 -2
  12. package/dist/application-spec/generate-application/code/templates/configurator-domain-code.js +7 -16
  13. package/dist/application-spec/generate-application/code/templates/configurator-frontend-code.d.ts +1 -2
  14. package/dist/application-spec/generate-application/code/templates/configurator-frontend-code.js +7 -9
  15. package/dist/application-spec/generate-application/code/templates/domain-spec/generate-assistant.d.ts +2 -2
  16. package/dist/application-spec/generate-application/code/templates/domain-spec/generate-assistant.js +1 -1
  17. package/dist/application-spec/generate-application/code/templates/domain-spec.js +4 -4
  18. package/dist/application-spec/generate-application/code/templates/domain.js +3 -3
  19. package/dist/application-spec/generate-application/code/templates/index.d.ts +1 -0
  20. package/dist/application-spec/generate-application/code/templates/index.js +1 -1
  21. package/dist/application-spec/generate-application/code/templates/skills/agents-md.js +1 -1
  22. package/dist/application-spec/generate-application/code/templates/skills/phoenix-cli-skill.js +1 -1
  23. package/dist/application-spec/generate-application/code/templates/skills/phoenix-create-configurator-skill.js +41 -13
  24. package/dist/application-spec/generate-application/code/templates/skills/phoenix-feedback-skill.js +1 -1
  25. package/dist/application-spec/generate-application/code/templates/skills/phoenix-review-skill.js +2 -2
  26. package/dist/application-spec/generate-application/code/templates/skills/phoenix-skill.js +1 -1
  27. package/dist/application-spec/generate-application/code/templates/skills/phoenix-variants-skill.d.ts +1 -0
  28. package/dist/application-spec/generate-application/code/templates/skills/phoenix-variants-skill.js +6 -0
  29. package/dist/application-spec/generate-application/code/templates/skills/sdk-content.d.ts +30 -3
  30. package/dist/application-spec/generate-application/code/templates/skills/sdk-content.js +19 -5
  31. package/dist/application-spec/generate-application/code/templates/webhook-builders.js +8 -4
  32. package/dist/application-spec/generate-application/runtime/sections/assistant-runtime.d.ts +4 -3
  33. package/dist/application-spec/generate-application/runtime/sections/assistant-runtime.js +1 -1
  34. package/dist/application-spec/parse-application-files/spec/sections/assistant/assistant-field-type.d.ts +3 -8
  35. package/dist/application-spec/parse-application-files/spec/sections/assistant/assistant-field-type.js +1 -1
  36. package/dist/application-spec/parse-application-files/spec/sections/assistant/assistant-schema.d.ts +9 -43
  37. package/dist/application-spec/parse-application-files/spec/sections/assistant/assistant-schema.js +1 -1
  38. package/dist/application-spec/parse-application-files/spec/sections/assistant/assistant-server-settings.d.ts +2 -2
  39. package/dist/application-spec/parse-application-files/spec/sections/assistant/assistant.d.ts +5 -21
  40. package/dist/client/phoenix-api.d.ts +58 -30
  41. package/dist/configurator/application-runtime/extensions/selectors.js +1 -1
  42. package/dist/configurator/application-runtime/extensions/systems/assistant-system/assistant-system.d.ts +158 -13
  43. package/dist/configurator/application-runtime/extensions/systems/assistant-system/assistant-system.js +1 -1
  44. package/dist/configurator/application-runtime/extensions/systems/assistant-system/change-recorder.d.ts +85 -0
  45. package/dist/configurator/application-runtime/extensions/systems/assistant-system/change-recorder.js +1 -0
  46. package/dist/configurator/application-runtime/extensions/systems/assistant-system/graphql-tools.d.ts +8 -3
  47. package/dist/configurator/application-runtime/extensions/systems/assistant-system/graphql-tools.js +1 -1
  48. package/dist/configurator/application-runtime/extensions/systems/graphql-system/entity-meta.d.ts +4 -0
  49. package/dist/configurator/application-runtime/extensions/systems/graphql-system/entity-meta.js +1 -1
  50. package/dist/configurator/application-runtime/extensions/systems/graphql-system/graphql-system.d.ts +16 -1
  51. package/dist/configurator/application-runtime/extensions/systems/graphql-system/graphql-system.js +1 -1
  52. package/dist/configurator/application-runtime/extensions/systems/graphql-system/side-effects.d.ts +9 -0
  53. package/dist/configurator/application-runtime/extensions/systems/graphql-system/side-effects.js +1 -0
  54. package/dist/configurator/application-runtime/extensions/systems/index.d.ts +1 -1
  55. package/dist/configurator/common/frontend-analytics.d.ts +21 -21
  56. package/dist/configurator/index.d.ts +0 -1
  57. package/dist/configurator/index.js +1 -1
  58. package/dist/configurator/pages/LoadedConfiguratorDetailPage.js +1 -1
  59. package/dist/configurator/scene/scene-analytics/scene-analytics.d.ts +2 -2
  60. package/dist/configurator/ui/assistant/AssistantChips.js +1 -1
  61. package/dist/configurator/ui/assistant/AssistantComposer.d.ts +1 -6
  62. package/dist/configurator/ui/assistant/AssistantComposer.js +1 -1
  63. package/dist/configurator/ui/assistant/AssistantPanel.js +1 -1
  64. package/dist/configurator/ui/assistant/AssistantThread.d.ts +1 -6
  65. package/dist/configurator/ui/assistant/AssistantThread.js +1 -1
  66. package/dist/configurator/ui/assistant/index.d.ts +1 -1
  67. package/dist/configurator/ui/assistant/index.js +1 -1
  68. package/dist/configurator/ui/assistant/thread-items.d.ts +1 -1
  69. package/dist/configurator/ui/assistant/tool-chip.d.ts +8 -1
  70. package/dist/configurator/ui/assistant/tool-chip.js +1 -1
  71. package/dist/configurator/ui/assistant/use-is-assistant-panel-open.d.ts +5 -0
  72. package/dist/configurator/ui/assistant/use-is-assistant-panel-open.js +1 -0
  73. package/dist/configurator/ui/configurator-layout/universal/DesktopLayout.js +2 -2
  74. package/dist/configurator/ui/configurator-layout/universal/Layout.js +1 -1
  75. package/dist/configurator/ui/configurator-layout/universal/MobileLayout.js +4 -4
  76. package/dist/configurator/ui/legacy/mobile-controls/MobileControls.d.ts +1 -1
  77. package/dist/configurator/ui/phoenix-layout-elements/AssistantToolbarButton.d.ts +2 -2
  78. package/dist/configurator/ui/phoenix-layout-elements/AssistantToolbarButton.js +1 -1
  79. package/dist/docs/complex-use-cases/filtered-controls-with-fix-dialog.mdx +84 -98
  80. package/dist/docs/complex-use-cases/navigation-reset-selection.mdx +18 -12
  81. package/dist/docs/index.json +1 -1
  82. package/dist/docs/layouts/custom-price.mdx +14 -16
  83. package/dist/docs/layouts/sidebar/tabs.mdx +24 -21
  84. package/dist/docs/layouts/toolbar.mdx +3 -1
  85. package/dist/docs/other-features/domain-actions.mdx +1 -1
  86. package/dist/docs/other-features/side-effects.mdx +68 -34
  87. package/dist/docs/other-features/transformers.mdx +1 -1
  88. package/dist/docs/phoenix/admin.mdx +9 -24
  89. package/dist/docs/phoenix/localization.mdx +3 -22
  90. package/dist/docs/phoenix/phoenix-cli.mdx +81 -2
  91. package/dist/docs/phoenix/project-structure.mdx +9 -2
  92. package/dist/docs/phoenix/sdk-builder-workflow.mdx +4 -3
  93. package/dist/docs/recipes-and-delete/recipe-hierarchy-selection.mdx +15 -13
  94. package/dist/docs/relations/hierarchy.mdx +13 -2
  95. package/dist/domain/actions/action-factory.d.ts +3 -2
  96. package/dist/domain/application/application-config.d.ts +25 -75
  97. package/dist/domain/application/assistant/assistant-manifest.d.ts +61 -0
  98. package/dist/domain/application/assistant/assistant-resolved-manifest.d.ts +95 -0
  99. package/dist/domain/application/assistant/assistant-value-type.d.ts +9 -0
  100. package/dist/domain/application/assistant/assistant-value-type.js +1 -0
  101. package/dist/domain/application/assistant/build-assistant-manifest.d.ts +4 -0
  102. package/dist/domain/application/assistant/build-assistant-manifest.js +1 -0
  103. package/dist/{phoenix/application-spec → domain/application/assistant}/generate-assistant-prompt.d.ts +6 -5
  104. package/dist/domain/application/assistant/generate-assistant-prompt.js +1 -0
  105. package/dist/domain/application/assistant/index.d.ts +4 -0
  106. package/dist/domain/application/assistant/index.js +1 -0
  107. package/dist/domain/application/assistant-field-options.d.ts +1 -1
  108. package/dist/domain/application/assistant-mutations.d.ts +1 -1
  109. package/dist/domain/application/assistant-recipe-groups.d.ts +1 -1
  110. package/dist/domain/application/configurator-builder.d.ts +33 -18
  111. package/dist/domain/application/configurator-builder.js +1 -1
  112. package/dist/domain/application/element-registration.d.ts +5 -0
  113. package/dist/domain/application/element-registration.js +1 -1
  114. package/dist/domain/application/handler-registration.d.ts +5 -0
  115. package/dist/domain/application/handler-registration.js +1 -1
  116. package/dist/domain/application/index.d.ts +5 -4
  117. package/dist/domain/application/index.js +1 -1
  118. package/dist/domain/application/resolve-imported-transformers.d.ts +11 -1
  119. package/dist/domain/application/resolve-imported-transformers.js +1 -1
  120. package/dist/domain/components/domain-component-optic.d.ts +3 -0
  121. package/dist/domain/components/domain-component-optic.js +2 -2
  122. package/dist/domain/components/system-component-builder.js +1 -1
  123. package/dist/domain/components/updates.d.ts +16 -0
  124. package/dist/domain/core/action.d.ts +1 -1
  125. package/dist/domain/core/component.d.ts +1 -1
  126. package/dist/domain/core/decoder/create-decoder.d.ts +6 -0
  127. package/dist/domain/core/decoder/create-decoder.js +1 -0
  128. package/dist/domain/core/decoder/decoder.d.ts +6 -0
  129. package/dist/domain/core/decoder/decoder.js +1 -0
  130. package/dist/domain/core/decoder/index.d.ts +2 -0
  131. package/dist/domain/core/decoder/index.js +1 -0
  132. package/dist/domain/core/domain-factory.js +1 -1
  133. package/dist/domain/core/index.d.ts +1 -3
  134. package/dist/domain/core/index.js +1 -1
  135. package/dist/domain/core/reflection.d.ts +1 -1
  136. package/dist/domain/core/reflection.js +1 -1
  137. package/dist/domain/core/schema/enhanced-json-schema.js +1 -0
  138. package/dist/domain/core/schema/extended-schema-validator.js +1 -0
  139. package/dist/domain/core/schema/index.d.ts +3 -0
  140. package/dist/domain/core/schema/index.js +1 -0
  141. package/dist/domain/core/schema/schema-validator.js +1 -0
  142. package/dist/domain/domain-builder.d.ts +10 -1
  143. package/dist/domain/domain-builder.js +1 -1
  144. package/dist/domain/domain-context/action-system/action-system.js +1 -1
  145. package/dist/domain/domain-context/index.d.ts +1 -1
  146. package/dist/domain/domain-context/store-system/store-system.js +1 -1
  147. package/dist/domain/domain-context/transformers/chain-builder.d.ts +1 -1
  148. package/dist/domain/domain-runtime/domain-runtime.d.ts +4 -4
  149. package/dist/domain/domain-runtime/spec/initialize.js +1 -1
  150. package/dist/domain/domain-runtime/spec/selectors.d.ts +2 -2
  151. package/dist/domain/domain-runtime/spec/selectors.js +1 -1
  152. package/dist/domain/domain-runtime/spec/types.d.ts +3 -3
  153. package/dist/domain/index.d.ts +3 -2
  154. package/dist/domain/index.js +1 -1
  155. package/dist/domain/invariants/invariants.d.ts +9 -0
  156. package/dist/domain/invariants/invariants.js +1 -1
  157. package/dist/domain/mocks/create-mock-domain-runtime.d.ts +3 -3
  158. package/dist/domain/mocks/create-mock-domain-runtime.js +1 -1
  159. package/dist/domain/project-modules/index.d.ts +1 -0
  160. package/dist/domain/project-modules/index.js +1 -0
  161. package/dist/domain/project-modules/project-modules.d.ts +41 -0
  162. package/dist/domain/project-modules/project-modules.js +1 -0
  163. package/dist/domain/system-components/common/dimension-indicator-schema.d.ts +1 -1
  164. package/dist/domain/system-components/common/dimension-indicator-schema.js +1 -1
  165. package/dist/editor/Editor.js +1 -1
  166. package/dist/editor/domain-editors/use-implementation-files.d.ts +7 -6
  167. package/dist/editor/domain-editors/use-implementation-files.js +1 -1
  168. package/dist/editor/graphql/GraphQLPanel.js +1 -1
  169. package/dist/editor/variants/VariantAnswerFooter.d.ts +17 -0
  170. package/dist/editor/variants/VariantAnswerFooter.js +1 -0
  171. package/dist/editor/variants/VariantPreviewHandler.d.ts +6 -0
  172. package/dist/editor/variants/VariantPreviewHandler.js +1 -0
  173. package/dist/editor/variants/variant-preview-styles.d.ts +49 -0
  174. package/dist/editor/variants/variant-preview-styles.js +1 -0
  175. package/dist/i18n/locales/cs/messages.js +1 -1
  176. package/dist/i18n/locales/da/messages.js +1 -1
  177. package/dist/i18n/locales/de/messages.js +1 -1
  178. package/dist/i18n/locales/de-AT/messages.js +1 -1
  179. package/dist/i18n/locales/en/messages.js +1 -1
  180. package/dist/i18n/locales/en-AU/messages.js +1 -1
  181. package/dist/i18n/locales/en-GB/messages.js +1 -1
  182. package/dist/i18n/locales/es/messages.js +1 -1
  183. package/dist/i18n/locales/fr/messages.js +1 -1
  184. package/dist/i18n/locales/hu/messages.js +1 -1
  185. package/dist/i18n/locales/it/messages.js +1 -1
  186. package/dist/i18n/locales/nl/messages.js +1 -1
  187. package/dist/i18n/locales/pl/messages.js +1 -1
  188. package/dist/i18n/locales/pt/messages.js +1 -1
  189. package/dist/i18n/locales/ro/messages.js +1 -1
  190. package/dist/i18n/locales/sk/messages.js +1 -1
  191. package/dist/i18n/locales/tr/messages.js +1 -1
  192. package/dist/legacy/domain-cli/gen/configurator-builder.js +21 -8
  193. package/dist/legacy/domain-cli/utils/cache.d.ts +1 -1
  194. package/dist/legacy/domain-cli/utils/cache.js +1 -1
  195. package/dist/legacy/phoenix-cli/project-gen/generators/file-templates/frontend-admin.js +18 -19
  196. package/dist/legacy/phoenix-cli/project-gen/generators/file-templates/frontend-configurator.js +15 -16
  197. package/dist/legacy/phoenix-cli/project-gen/generators/file-templates/frontend-embedded-admin.js +22 -23
  198. package/dist/legacy/phoenix-cli/project-gen/generators/file-templates/frontend-embedded-configurator.js +15 -16
  199. package/dist/legacy/phoenix-cli/project-gen/generators/file-templates/generator-shared.d.ts +7 -2
  200. package/dist/legacy/phoenix-cli/project-gen/generators/file-templates/generator-shared.js +8 -12
  201. package/dist/legacy/phoenix-cli/project-gen/generators/file-templates/index.d.ts +1 -1
  202. package/dist/legacy/phoenix-cli/project-gen/generators/file-templates/index.js +1 -1
  203. package/dist/legacy/phoenix-cli/project-gen/generators/file-templates/webhook-builders.js +7 -7
  204. package/dist/phoenix/application-spec/application-spec-builder.js +1 -1
  205. package/dist/phoenix/application-spec/resolve-deployment-data.d.ts +4 -3
  206. package/dist/phoenix/application-spec/resolve-deployment-data.js +2 -2
  207. package/dist/phoenix/cli.js +1 -1
  208. package/dist/phoenix/commands/deploy.js +2 -2
  209. package/dist/phoenix/commands/dev.js +5 -5
  210. package/dist/phoenix/commands/index.d.ts +1 -0
  211. package/dist/phoenix/commands/index.js +1 -1
  212. package/dist/phoenix/commands/prepare-deployment-command.js +2 -2
  213. package/dist/phoenix/commands/prepare-local-environment-command.js +1 -1
  214. package/dist/phoenix/commands/story-dev.js +2 -2
  215. package/dist/phoenix/commands/variants.d.ts +35 -0
  216. package/dist/phoenix/commands/variants.js +1 -0
  217. package/dist/phoenix/editor-server/commands-router.d.ts +68 -1
  218. package/dist/phoenix/editor-server/commands-router.js +1 -1
  219. package/dist/phoenix/editor-server/editor-router.d.ts +65 -0
  220. package/dist/phoenix/editor-server/editor-server.d.ts +3 -3
  221. package/dist/phoenix/editor-server/editor-server.js +1 -1
  222. package/dist/phoenix/editor-server/protocol.d.ts +1 -0
  223. package/dist/phoenix/editor-server/spec-router.js +1 -1
  224. package/dist/phoenix/editor-server/trpc.d.ts +3 -0
  225. package/dist/phoenix/services/application-spec-project-watcher.d.ts +13 -2
  226. package/dist/phoenix/services/application-spec-project-watcher.js +3 -3
  227. package/dist/phoenix/services/index.d.ts +4 -0
  228. package/dist/phoenix/services/index.js +1 -1
  229. package/dist/phoenix/services/phoenix-application.d.ts +21 -0
  230. package/dist/phoenix/services/phoenix-application.js +1 -0
  231. package/dist/phoenix/services/phoenix-store.d.ts +48 -0
  232. package/dist/phoenix/services/phoenix-store.js +1 -0
  233. package/dist/phoenix/services/phx-variant-previews-plugin.d.ts +9 -0
  234. package/dist/phoenix/services/phx-variant-previews-plugin.js +1 -0
  235. package/dist/phoenix/services/prepare-development-environment.js +1 -1
  236. package/dist/phoenix/services/variant-file-session.d.ts +36 -0
  237. package/dist/phoenix/services/variant-file-session.js +1 -0
  238. package/dist/phoenix/services/variant-preview-service.d.ts +80 -0
  239. package/dist/phoenix/services/variant-preview-service.js +1 -0
  240. package/dist/phoenix/services/vite-config.js +1 -1
  241. package/dist/react-sdk/application-runtime/common-services/analytics/analytics-service.d.ts +2 -2
  242. package/dist/react-sdk/application-runtime/common-services/analytics/domain-controls-analytics.d.ts +21 -21
  243. package/dist/react-sdk/application-runtime/hooks/data/use-published-data.d.ts +1 -1
  244. package/dist/react-sdk/application-runtime/hooks/use-domain-application-props.d.ts +5 -2
  245. package/dist/react-sdk/application-runtime/hooks/use-spec.d.ts +1 -1
  246. package/dist/react-sdk/application-runtime/mocks/create-mock-application-runtime.d.ts +1 -1
  247. package/dist/react-sdk/application-runtime/mocks/create-mock-application-runtime.js +1 -1
  248. package/dist/react-sdk/application-runtime/runtime/create-application-runtime.d.ts +4 -4
  249. package/dist/ui-sdk/common/use-viewport-size.d.ts +4 -1
  250. package/dist/ui-sdk/common/use-viewport-size.js +1 -1
  251. package/dist/ui-sdk/components/mobile-controls/index.d.ts +1 -1
  252. package/dist/webhook/builders/common.d.ts +3 -0
  253. package/dist/webhook/builders/webhook-builder.d.ts +1 -1
  254. package/dist/webhook/builders/webhook-builder.js +1 -1
  255. package/package.json +4 -4
  256. package/dist/configurator/assistant/index.d.ts +0 -1
  257. package/dist/configurator/assistant/index.js +0 -1
  258. package/dist/configurator/assistant/use-assistant-chat.d.ts +0 -30
  259. package/dist/configurator/assistant/use-assistant-chat.js +0 -1
  260. package/dist/configurator/ui/assistant/AssistantPanelProvider.d.ts +0 -42
  261. package/dist/configurator/ui/assistant/AssistantPanelProvider.js +0 -1
  262. package/dist/domain/core/json-schema.js +0 -1
  263. package/dist/phoenix/application-spec/generate-assistant-prompt.js +0 -1
  264. /package/dist/domain/{core/enhanced-json-schema.js → application/assistant/assistant-manifest.js} +0 -0
  265. /package/dist/domain/{core/schema-validator.js → application/assistant/assistant-resolved-manifest.js} +0 -0
  266. /package/dist/domain/core/{schema-validator-ajv.d.ts → schema/create-ajv-schema-validator.d.ts} +0 -0
  267. /package/dist/domain/core/{schema-validator-ajv.js → schema/create-ajv-schema-validator.js} +0 -0
  268. /package/dist/domain/core/{schema-validator-csp.d.ts → schema/create-csp-schema-validator.d.ts} +0 -0
  269. /package/dist/domain/core/{schema-validator-csp.js → schema/create-csp-schema-validator.js} +0 -0
  270. /package/dist/domain/core/{enhanced-json-schema.d.ts → schema/enhanced-json-schema.d.ts} +0 -0
  271. /package/dist/domain/core/{json-schema.d.ts → schema/extended-schema-validator.d.ts} +0 -0
  272. /package/dist/domain/core/{schema-validator.d.ts → schema/schema-validator.d.ts} +0 -0
@@ -104,106 +104,92 @@ All inputs include countersinkNotAvailable, as that is fixable by auto fix dialo
104
104
  And corresponding transformers
105
105
 
106
106
  ```typescript
107
- configuratorBuilder
108
- .withTransformers(() => [
109
- {
110
- priority: 3,
111
- transformer: (updates, currentState) => {
112
- if (updates.length > 1) {
113
- return updates
114
- }
115
-
116
- const materialUpdate = updates.find(
117
- (u): u is ComponentModification<MaterialSwatchComponent> =>
118
- u.kind === 'modifyComponent' && u.updateTag === 'selectSwatch-material'
119
- )
120
-
121
- if (!materialUpdate) {
122
- return updates
123
- }
124
-
125
- const plate = currentState.domainState.entities.find(Plate.is)!
126
- const newMaterial = materialUpdate.writableState.selectedSwatchKey
127
-
128
- const isAvailable = availableMaterials.some(
129
- state =>
130
- state.material === newMaterial && state.finish === plate.finish && state.thickness === plate.thickness
131
- )
132
-
133
- if (isAvailable) {
134
- return updates
135
- }
136
-
137
- const similarMaterial = availableMaterials.find(m => m.material === newMaterial)
138
-
139
- if (!similarMaterial) {
140
- return updates
141
- }
142
-
143
- const fixUpdate = updateFactory.DomainEntityModification({
144
- entityId: plate.id,
145
- stateDelta: {
146
- material: similarMaterial.material,
147
- finish: similarMaterial.finish,
148
- thickness: similarMaterial.thickness,
149
- },
150
- updateTag: 'fix.material',
151
- })
152
-
153
- return [fixUpdate]
107
+ // src/transformers/fix-finish.ts
108
+ import { availableMaterials } from '../_shared/available-materials.js'
109
+
110
+ export default phx.frontend.transformerBuilder.when
111
+ .entity(['Plate'])
112
+ .modified({ atFields: ['finish'] })
113
+ .then.overrideMatchingUpdate(({ update, getOld$Entity }) => {
114
+ const plate = getOld$Entity()
115
+ const newFinish = update.stateDelta.finish
116
+
117
+ const isAvailable = availableMaterials.some(
118
+ state => state.material === plate.material && state.finish === newFinish && state.thickness === plate.thickness
119
+ )
120
+
121
+ if (isAvailable) {
122
+ return [update]
123
+ }
124
+
125
+ const similarMaterial = availableMaterials.find(m => m.finish === newFinish && m.material === plate.material)
126
+
127
+ if (!similarMaterial) {
128
+ return [update]
129
+ }
130
+
131
+ const fixUpdate = phx.frontend.updates.DomainEntityModification({
132
+ entityId: plate.id,
133
+ stateDelta: {
134
+ material: similarMaterial.material,
135
+ finish: similarMaterial.finish,
136
+ thickness: similarMaterial.thickness,
154
137
  },
155
- },
156
- {
157
- priority: 3.1,
158
- transformer: (updates, currentState) => {
159
- if (updates.length > 1) {
160
- return updates
161
- }
162
-
163
- const materialUpdate = updates.find(
164
- (u): u is ComponentModification<AttributeSelectionComponent> =>
165
- u.kind === 'modifyComponent' &&
166
- u.updateTag === 'AttributeSelect.update' &&
167
- (u.componentInstance.instanceName as string) === 'finish'
168
- )
169
-
170
- if (!materialUpdate) {
171
- return updates
172
- }
173
-
174
- const plate = currentState.domainState.entities.find(Plate.is)!
175
- const newFinish = materialUpdate.writableState.value
176
-
177
- const isAvailable = availableMaterials.some(
178
- state =>
179
- state.material === plate.material && state.finish === newFinish && state.thickness === plate.thickness
180
- )
181
-
182
- if (isAvailable) {
183
- return updates
184
- }
185
-
186
- const similarMaterial = availableMaterials.find(m => m.finish === newFinish && m.material === plate.material)
187
-
188
- if (!similarMaterial) {
189
- return updates
190
- }
191
-
192
- const fixUpdate = updateFactory.DomainEntityModification({
193
- entityId: plate.id,
194
- stateDelta: {
195
- material: similarMaterial.material,
196
- finish: similarMaterial.finish,
197
- thickness: similarMaterial.thickness,
198
- },
199
- updateTag: 'fix.brushed',
200
- })
201
-
202
- return [fixUpdate]
138
+ updateTag: 'fix.brushed',
139
+ })
140
+
141
+ return [fixUpdate]
142
+ })
143
+ .build('fix-finish')
144
+ ```
145
+
146
+ ```typescript
147
+ // src/transformers/fix-material.ts
148
+ import { availableMaterials } from '../_shared/available-materials.js'
149
+
150
+ export default phx.frontend.transformerBuilder.when
151
+ .entity(['Plate'])
152
+ .modified({ atFields: ['material'] })
153
+ .then.overrideMatchingUpdate(({ update, getOld$Entity }) => {
154
+ const plate = getOld$Entity()
155
+ const newMaterial = update.stateDelta.material
156
+
157
+ const isAvailable = availableMaterials.some(
158
+ state => state.material === newMaterial && state.finish === plate.finish && state.thickness === plate.thickness
159
+ )
160
+
161
+ if (isAvailable) {
162
+ return [update]
163
+ }
164
+
165
+ const similarMaterial = availableMaterials.find(m => m.material === newMaterial)
166
+
167
+ if (!similarMaterial) {
168
+ return [update]
169
+ }
170
+
171
+ const fixUpdate = phx.frontend.updates.DomainEntityModification({
172
+ entityId: plate.id,
173
+ stateDelta: {
174
+ material: similarMaterial.material,
175
+ finish: similarMaterial.finish,
176
+ thickness: similarMaterial.thickness,
203
177
  },
204
- },
205
- ])
206
- .buildConfig()
178
+ updateTag: 'fix.material',
179
+ })
180
+
181
+ return [fixUpdate]
182
+ })
183
+ .build('fix-material')
184
+ ```
185
+
186
+ Each file in `src/transformers/` default-exports one transformer and is picked up by its location. The `transformers` section of the spec turns it on by name. For a transformer made with `build(name)` that is the name passed to `build(...)`, which must match the file name with case and dashes ignored (`fix-finish.ts` and `fixFinish` match). For a plain-function export it is the file name:
187
+
188
+ ```yaml
189
+ # spec/application.yaml
190
+ transformers:
191
+ - name: fix-finish
192
+ - name: fix-material
207
193
  ```
208
194
 
209
195
  And FilteredControls
@@ -18,7 +18,7 @@ The `createResetSelectionOnNavigationTransformer` automatically deselects entiti
18
18
 
19
19
  ## Guide
20
20
 
21
- The `createResetSelectionOnNavigationTransformer` is added through the `.withTransformers()` method. It automatically injects a deselect update when navigating to specified states.
21
+ The `createResetSelectionOnNavigationTransformer` is added as a file in `src/transformers/`. It automatically injects a deselect update when navigating to specified states.
22
22
 
23
23
  ### Step 1: Import the transformer
24
24
 
@@ -28,19 +28,25 @@ Import the transformer function from the domain package:
28
28
  import { createResetSelectionOnNavigationTransformer } from '@salsita-ai/sdk/domain'
29
29
  ```
30
30
 
31
- ### Step 2: Add the transformer to your config
31
+ ### Step 2: Add the transformer to your project
32
32
 
33
- Use the `.withTransformers()` method on the builder:
33
+ Create the transformer in a file under `src/transformers/`:
34
34
 
35
35
  ```typescript
36
- const config = configuratorBuilder
37
- .withTransformers(ctx => [
38
- {
39
- priority: 32,
40
- transformer: createResetSelectionOnNavigationTransformer([ApplicationTypes.NavigationState.SecondStep], ctx),
41
- },
42
- ])
43
- .buildConfig()
36
+ // src/transformers/reset-selection.ts
37
+ import { createResetSelectionOnNavigationTransformer } from '@salsita-ai/sdk/domain'
38
+
39
+ export default phx.frontend.createTransformer(ctx =>
40
+ createResetSelectionOnNavigationTransformer([phx.applicationTypes.NavigationState.SecondStep], ctx)
41
+ )
42
+ ```
43
+
44
+ Each file in `src/transformers/` default-exports one transformer and is picked up by its location. The `transformers` section of the spec turns it on by name. For a transformer made with `build(name)` that is the name passed to `build(...)`, which must match the file name with case and dashes ignored (`fix-finish.ts` and `fixFinish` match). For a plain-function export it is the file name:
45
+
46
+ ```yaml
47
+ # spec/application.yaml
48
+ transformers:
49
+ - name: reset-selection
44
50
  ```
45
51
 
46
52
  The transformer takes two arguments:
@@ -97,7 +103,7 @@ When the transformer triggers, any selected entity is deselected automatically.
97
103
  *
98
104
  * @param navigationStates - Array of navigation state names that trigger deselection
99
105
  * @param ctx - Domain context providing access to the navigation system
100
- * @returns Update transformer that can be registered in withTransformers
106
+ * @returns Update transformer to return from a transformer file in src/transformers/
101
107
  *
102
108
  * @example
103
109
  * // Deselect when entering the summary step
@@ -1,5 +1,5 @@
1
1
  {
2
- "generatedAt": "2026-10-09T15:12:45.633Z",
2
+ "generatedAt": "2026-10-12T21:55:56.545Z",
3
3
  "categories": [
4
4
  {
5
5
  "name": "Phoenix",
@@ -78,24 +78,22 @@ Your custom component has full access to the Material-UI theme and SDK utilities
78
78
 
79
79
  ### Step 3: Attach the component to your entity
80
80
 
81
- Use the configurator builder to attach your custom price component to the root entity:
81
+ Attach your custom price component to the root entity in a file under `src/components/`. The generated code picks the
82
+ file up by its location and registers its default export:
82
83
 
83
84
  ```typescript
84
- const config = configuratorBuilder
85
- .withComponentOptics([
86
- attachComponent
87
- .withEntity('Scene')
88
- .withComponent(customPriceFooterComponent, 'default')
89
- .attach(
90
- memoEval(
91
- (s) => [s.$price],
92
- (price) => ({
93
- node: <AppPrice price={price} />,
94
- })
95
- )
96
- ),
97
- ])
98
- .buildConfig()
85
+ // src/components/custom-price.tsx
86
+ export default phx.domain.attachComponent
87
+ .withEntity('Scene')
88
+ .withComponent(customPriceFooterComponent, 'default')
89
+ .attach(
90
+ memoEval(
91
+ (s) => [s.$price],
92
+ (price) => ({
93
+ node: <AppPrice price={price} />,
94
+ })
95
+ )
96
+ )
99
97
  ```
100
98
 
101
99
  The `memoEval` function takes two arguments:
@@ -179,27 +179,30 @@ When a selected entity has no `sidebarTabs`, its property pages replace the root
179
179
  You can use transformers to automatically navigate to specific tabs when entities are selected or deselected:
180
180
 
181
181
  ```typescript
182
- const config = configuratorBuilder
183
- .withTransformers(ctx => {
184
- return [
185
- // Navigate to BuckyBall's first tab when selected
186
- phx.frontend.transformerBuilder.when
187
- .entity(['BuckyBall'])
188
- .selected()
189
- .then.navigateTo('BuckyBallTab1')
190
- .build('Navigate to BuckyBallTab1')
191
- .register(ctx),
192
-
193
- // Return to global tab1 when BuckyBall is deselected
194
- phx.frontend.transformerBuilder.when
195
- .entity(['BuckyBall'])
196
- .deselected()
197
- .then.navigateTo('tab1')
198
- .build('Navigate to Tab1')
199
- .register(ctx),
200
- ]
201
- })
202
- .buildConfig()
182
+ // src/transformers/bucky-ball-tab.ts
183
+ export default phx.frontend.transformerBuilder.when
184
+ .entity(['BuckyBall'])
185
+ .selected()
186
+ .then.navigateTo('BuckyBallTab1')
187
+ .build('buckyBallTab')
188
+ ```
189
+
190
+ ```typescript
191
+ // src/transformers/tab.ts
192
+ export default phx.frontend.transformerBuilder.when
193
+ .entity(['BuckyBall'])
194
+ .deselected()
195
+ .then.navigateTo('tab1')
196
+ .build('tab')
197
+ ```
198
+
199
+ Each file in `src/transformers/` default-exports one transformer and is picked up by its location. The `transformers` section of the spec turns it on by name. For a transformer made with `build(name)` that is the name passed to `build(...)`, which must match the file name with case and dashes ignored (`fix-finish.ts` and `fixFinish` match). For a plain-function export it is the file name:
200
+
201
+ ```yaml
202
+ # spec/application.yaml
203
+ transformers:
204
+ - name: buckyBallTab
205
+ - name: tab
203
206
  ```
204
207
 
205
208
  This creates smooth navigation flows where selecting specific entities automatically switches to their relevant tabs, and deselecting returns to a default tab state.
@@ -84,7 +84,9 @@ Phoenix provides built-in toolbar buttons for common operations:
84
84
  - `assistantToolbarButton` - Open and close the built-in assistant panel. It renders only in a project whose
85
85
  application spec has an `assistant` section. `props.showTitle` defaults to `true`; the label shows on a
86
86
  desktop-sized layout only. The default toolbar includes it, in a group of its own, when the spec has an
87
- `assistant` section.
87
+ `assistant` section. Only the universal layout carries the panel, and the button does not hide itself in a
88
+ layout without it. A custom layout that renders the toolbar therefore defines a `toolbar` component without the
89
+ button, because the default toolbar would add it.
88
90
 
89
91
  ### Mobile Toolbar Configuration
90
92
 
@@ -83,7 +83,7 @@ export default phx.domain.implementActions({
83
83
  })
84
84
  ```
85
85
 
86
- Throw to reject a call: the message reaches the user through the control's hint and the assistant through the failed mutation, so say what went wrong and what to send instead. An action declared without an implementation, or an implementation of a name the spec does not declare, is a type error. A declared action without an implementation also stops the domain from initializing, and under `phoenix dev` the editor reports it as a `MISSING_ACTION_IMPLEMENTATIONS` diagnostic and does not apply the change; an implementation of an undeclared name is logged.
86
+ Throw to reject a call: the message reaches the user through the control's hint and the assistant through the failed mutation, so say what went wrong and what to send instead. An implementation of a name the spec does not declare is a type error. A declared action without an implementation is not: it stops the domain from initializing, and under `phoenix dev` the editor reports it as a `MISSING_ACTION_IMPLEMENTATIONS` diagnostic and does not apply the change; an implementation of an undeclared name is logged.
87
87
 
88
88
  ## Run it from the UI
89
89
 
@@ -66,42 +66,76 @@ With following control structure. The top input selects the material, the bottom
66
66
  The transformer is used to change the finish if necessary and show the notification.
67
67
 
68
68
  ```typescript
69
- configuratorBuilder
70
- .withTransformers(domainContext => [
71
- phx.frontend.transformerBuilder.when
72
- .entity(['Plate'])
73
- .modified({ atFields: ['material'] })
74
- .causes.self.violation(['finishNotAvailable'])
75
- .then.applySideEffect(({ update, getOld$Entity }) => {
76
- const oldPlate = getOld$Entity()
77
- const newMaterial = update.stateDelta.material
78
-
79
- const validMaterial =
80
- availableMaterials.find(m => m.material === newMaterial && m.finish === oldPlate.finish) ??
81
- availableMaterials.find(m => m.material === newMaterial)
82
-
83
- if (!validMaterial || validMaterial.finish === oldPlate.finish) {
84
- return []
85
- }
86
-
87
- // create an additional update that will fix the material finish
88
- const fixUpdate = phx.frontend.updates.DomainEntityModification({
89
- entityId: oldPlate.id,
90
- stateDelta: {
91
- finish: validMaterial.finish,
92
- },
93
- updateTag: 'fix.finish',
94
- hint: msg`Material finish was adjusted`, // specify a hint for the user (side effect)
95
- })
96
-
97
- return [fixUpdate]
98
- })
99
- .build('Fix material finish')
100
- .register(domainContext),
101
- ])
102
- .buildConfig()
69
+ // src/transformers/fix-finish.ts
70
+ import { msg } from '@lingui/core/macro'
71
+
72
+ import { availableMaterials } from '../_shared/materials.js'
73
+
74
+ export default phx.frontend.transformerBuilder.when
75
+ .entity(['Plate'])
76
+ .modified({ atFields: ['material'] })
77
+ .causes.self.violation(['finishNotAvailable'])
78
+ .then.applySideEffect(({ update, getOld$Entity }) => {
79
+ const oldPlate = getOld$Entity()
80
+ const newMaterial = update.stateDelta.material
81
+
82
+ const validMaterial =
83
+ availableMaterials.find(m => m.material === newMaterial && m.finish === oldPlate.finish) ??
84
+ availableMaterials.find(m => m.material === newMaterial)
85
+
86
+ if (!validMaterial || validMaterial.finish === oldPlate.finish) {
87
+ return []
88
+ }
89
+
90
+ // create an additional update that will fix the material finish
91
+ const fixUpdate = phx.frontend.updates.DomainEntityModification({
92
+ entityId: oldPlate.id,
93
+ stateDelta: {
94
+ finish: validMaterial.finish,
95
+ },
96
+ updateTag: 'fix.finish',
97
+ hint: msg`Material finish was adjusted`, // specify a hint for the user (side effect)
98
+ })
99
+
100
+ return [fixUpdate]
101
+ })
102
+ .build('fix-finish')
103
103
  ```
104
104
 
105
+ Each file in `src/transformers/` default-exports one transformer and is picked up by its location. The `transformers` section of the spec turns it on by name. For a transformer made with `build(name)` that is the name passed to `build(...)`, which must match the file name with case and dashes ignored (`fix-finish.ts` and `fixFinish` match). For a plain-function export it is the file name:
106
+
107
+ ```yaml
108
+ # spec/application.yaml
109
+ transformers:
110
+ - name: fix-finish
111
+ ```
112
+
113
+ ### Hints and the AI assistant
114
+
115
+ In a configurator with the AI assistant, the assistant is told the same hints: they arrive as
116
+ `sideEffects` with the result of its changes and in the dry-runs of recipes and options, so it can
117
+ tell the user what else happened. The hints also explain what the user changed between two messages:
118
+ every message carries a change record of the configuration, and each of its lines ends with the hint
119
+ of the last update that touched it, or with the `updateTag` when the update has none. Set `agentHint`
120
+ beside `hint` when the assistant needs different wording, for example with ids or values a snackbar
121
+ would not show:
122
+
123
+ ```ts
124
+ phx.frontend.updates.DomainEntityModification({
125
+ entityId: oldPlate.id,
126
+ stateDelta: { finish: validMaterial.finish },
127
+ updateTag: 'fix.finish',
128
+ hint: msg`Material finish was adjusted`,
129
+ agentHint: `The finish of ${oldPlate.id} was changed to ${validMaterial.finish}, the only one this material comes in.`,
130
+ })
131
+ ```
132
+
133
+ - `agentHint` is a plain string, never shown to the user and not localized.
134
+ - `agentHint: null` keeps the wording from the assistant while the user still gets the `hint`: the
135
+ update is left out of `sideEffects`, and the change record explains its line by the `updateTag`. It
136
+ does not hide the change itself, which the assistant can always read from the configuration.
137
+ - `agentHint` without a `hint` tells only the assistant.
138
+
105
139
  ## Example
106
140
 
107
141
  Here you can see the live example!
@@ -102,7 +102,7 @@ export const removeExtraneousBranchesAndLeavesWhenShortened = phx.frontend.trans
102
102
  - With `overrideMatchinUpdates(ctx => /* side effect updates */)` the updates returned by the provided callback will replace the original **matched update**. This will be triggered for every matching update. Note that this action is not available in events which are not bound to a specific update - such as a violation check without a defined cause.
103
103
  - With `overrideAllUpdates(ctx => /* side effect updates */)` the updates returned by the provided callback will replace all original updates. This will be triggered only once for a single run of the transformer. This allows for implementation of transformers that behave similarly as the raw `UpdateTransformer`
104
104
  - High-level actions: `select`, `deselect`, `navigate`, `changeView` - more on these in the other examples.
105
- - `build(name)` is the final step to create the transformer. Assign a descriptive name (no restrictions) to easily identify the transformer while tracing. Note that this returns a `RegistrableTransformer` which needs to be registered using the `register(domainContext)` method. This is usually done in the `.withTransformers()` method of the configurator builder.
105
+ - `build(name)` is the final step to create the transformer. The name identifies the transformer while tracing, and it is the name the `transformers` section of the spec refers to, so it must match the file name with case and dashes ignored (`fix-finish.ts` and `fixFinish` match). Note that this returns a `RegistrableTransformer`. Default-export it from a file in `src/transformers/` and list the name passed to `build(...)` in the `transformers` section of the spec; the generated code registers it. The shorter snippets on this page use descriptive names for readability; the complete implementation below uses names that match its files.
106
106
 
107
107
  ### Side-Effect on Update Causing Another Entity's Violation
108
108
 
@@ -427,43 +427,28 @@ For technical details about data transformation and storage, see [Data Sources -
427
427
 
428
428
  ## Web Component Integration
429
429
 
430
- Admin functionality integrates through the configurator builder rather than requiring separate web component setup.
430
+ Admin functionality is part of the same application as the configurator and needs no separate web component setup.
431
431
 
432
- ### Configurator Builder Setup
432
+ ### Registering Admin Components
433
433
 
434
- In phx-cli projects, frontend entry is auto-generated in `.phoenix/`. Admin components are registered through `src/admin/components/`:
434
+ The frontend entry is generated into `.phoenix/`, so a project never calls the configurator builder itself. Every file
435
+ in `src/admin/components/` is picked up by its location and its default export is registered as admin components:
435
436
 
436
437
  ```typescript
437
438
  // src/admin/components/admin-components.tsx
438
- import { configuratorBuilder } from '.phoenix/frontend.js'
439
- import { customAdminOptics } from './optics.js'
440
- import { NotAuthenticatedPage } from '../pages/NotAuthenticatedPage.js'
441
-
442
- const config = configuratorBuilder
443
- .withComponentOptics(customConfiguratorComponents)
444
- .withAdminComponentOptics(customAdminOptics) // Register admin components
445
- .buildConfig({
446
- deploymentId: phx.runtimeConfig.DEPLOYMENT_ID,
447
- persistence: {
448
- type: 'server',
449
- serverUrl: phx.runtimeConfig.SERVER_URL,
450
- },
451
- ui: {
452
- notAuthenticatedPage: <NotAuthenticatedPage />, // Show when user not authenticated
453
- },
454
- // ... other config
455
- })
439
+ // ... customAdminOptics as defined in the example above
456
440
 
457
- phx.frontend.mountApplication(config)
441
+ export default customAdminOptics
458
442
  ```
459
443
 
460
- Admin component files go in `src/admin/components/` and are automatically discovered by phx-cli.
444
+ The page shown to a user who is not authenticated is an element. Create it with
445
+ `phx.frontend.createNotAuthenticatedPage(...)` in a file under `src/elements/`.
461
446
 
462
447
  ### Built-in Admin Integration
463
448
 
464
449
  Phoenix automatically provides admin functionality when:
465
450
 
466
- 1. Admin components are registered via `withAdminComponentOptics()`
451
+ 1. Admin components are default-exported from files in `src/admin/components/`
467
452
  2. Admin configuration exists in `phoenix.config.ts`
468
453
  3. User has admin session token
469
454
 
@@ -116,28 +116,9 @@ After running `pnpm lingui:compile`, your custom translations will override the
116
116
  - Adapt translations for your target audience
117
117
  - Maintain consistency with your existing product language
118
118
 
119
- **Frontend integration**:
120
-
121
- ```typescript
122
- import { configuratorBuilder } from 'project-domain'
123
- import { createI18n } from 'project-i18n'
124
-
125
- const i18n = createI18n()
126
-
127
- export const config = configuratorBuilder
128
- .withComponentOptics(customComponents)
129
- .withPresets(presets)
130
- .withI18n(i18n) // Register i18n service with configurator
131
- .buildConfig({
132
- features: {
133
- availableLocales: ['en', 'de', 'cs'],
134
- },
135
- services: {
136
- logger,
137
- },
138
- // ... other configuration
139
- })
140
- ```
119
+ **Frontend integration**: the generated `.phoenix` code creates the i18n service from `.phoenix/i18n.ts` and registers
120
+ it with the application, so there is nothing to wire by hand. The languages come from `availableLocales` in
121
+ `spec/application.yaml`.
141
122
 
142
123
  ## Working with YAML Domain Specifications
143
124