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

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 (297) hide show
  1. package/README.md +8 -4
  2. package/dist/admin/default-admin-elements.d.ts +9 -0
  3. package/dist/admin/default-admin-elements.js +1 -0
  4. package/dist/admin/default-elements/built-in-entity-element.d.ts +10 -0
  5. package/dist/admin/default-elements/built-in-entity-element.js +1 -0
  6. package/dist/admin/default-elements/built-in-layout-element.d.ts +10 -0
  7. package/dist/admin/default-elements/built-in-layout-element.js +1 -0
  8. package/dist/admin/default-elements/index.d.ts +2 -0
  9. package/dist/admin/default-elements/index.js +1 -0
  10. package/dist/admin/index.d.ts +1 -0
  11. package/dist/admin/index.js +1 -1
  12. package/dist/application-spec/errors/diagnostic-codes.d.ts +1 -0
  13. package/dist/application-spec/errors/diagnostic-codes.js +1 -1
  14. package/dist/application-spec/errors/diagnostic-messages.d.ts +1 -0
  15. package/dist/application-spec/errors/diagnostic-messages.js +1 -1
  16. package/dist/application-spec/generate-application/code/common/code-imports.js +1 -1
  17. package/dist/application-spec/generate-application/code/common/env-reader.js +2 -2
  18. package/dist/application-spec/generate-application/code/common/index.d.ts +1 -0
  19. package/dist/application-spec/generate-application/code/common/index.js +1 -1
  20. package/dist/application-spec/generate-application/code/common/single-quoted-string.d.ts +6 -0
  21. package/dist/application-spec/generate-application/code/common/single-quoted-string.js +1 -0
  22. package/dist/application-spec/generate-application/code/domain-runtime-files.js +1 -1
  23. package/dist/application-spec/generate-application/code/project-scaffolding.d.ts +5 -7
  24. package/dist/application-spec/generate-application/code/project-scaffolding.js +2 -2
  25. package/dist/application-spec/generate-application/code/story-files.js +1 -1
  26. package/dist/application-spec/generate-application/code/templates/admin-config.js +3 -0
  27. package/dist/application-spec/generate-application/code/templates/common/format-property-key.d.ts +7 -0
  28. package/dist/application-spec/generate-application/code/templates/common/format-property-key.js +1 -0
  29. package/dist/application-spec/generate-application/code/templates/common/schema-to-type-string.js +3 -3
  30. package/dist/application-spec/generate-application/code/templates/domain-spec/factory-types/domain-factory-types.d.ts +35 -0
  31. package/dist/application-spec/generate-application/code/templates/domain-spec/factory-types/domain-factory-types.js +5 -0
  32. package/dist/application-spec/generate-application/code/templates/domain-spec/factory-types/index.d.ts +1 -0
  33. package/dist/application-spec/generate-application/code/templates/domain-spec/factory-types/index.js +1 -0
  34. package/dist/application-spec/generate-application/code/templates/domain-spec/generate-component-optics.d.ts +1 -1
  35. package/dist/application-spec/generate-application/code/templates/domain-spec/generate-component-optics.js +6 -6
  36. package/dist/application-spec/generate-application/code/templates/domain-spec/generate-domain-block.js +59 -63
  37. package/dist/application-spec/generate-application/code/templates/domain-spec/generate-invariants.d.ts +8 -0
  38. package/dist/application-spec/generate-application/code/templates/domain-spec/generate-invariants.js +1 -1
  39. package/dist/application-spec/generate-application/code/templates/domain-spec/generate-presets.js +1 -1
  40. package/dist/application-spec/generate-application/code/templates/domain-spec/generate-resources.js +13 -13
  41. package/dist/application-spec/generate-application/code/templates/domain-spec/generate-states.d.ts +1 -1
  42. package/dist/application-spec/generate-application/code/templates/domain-spec/generate-states.js +2 -2
  43. package/dist/application-spec/generate-application/code/templates/domain-spec/index.d.ts +2 -1
  44. package/dist/application-spec/generate-application/code/templates/domain-spec/index.js +1 -1
  45. package/dist/application-spec/generate-application/code/templates/global-definition/generate-phx-types.d.ts +43 -0
  46. package/dist/application-spec/generate-application/code/templates/global-definition/generate-phx-types.js +31 -0
  47. package/dist/application-spec/generate-application/code/templates/global-definition/index.d.ts +1 -0
  48. package/dist/application-spec/generate-application/code/templates/global-definition/index.js +1 -1
  49. package/dist/application-spec/generate-application/code/templates/globals.js +24 -43
  50. package/dist/application-spec/generate-application/code/templates/index.d.ts +2 -2
  51. package/dist/application-spec/generate-application/code/templates/index.js +1 -1
  52. package/dist/application-spec/generate-application/code/templates/skills/phoenix-cli-skill.js +1 -1
  53. package/dist/application-spec/generate-application/code/templates/skills/phoenix-create-configurator-skill.js +1 -1
  54. package/dist/application-spec/generate-application/code/templates/skills/phoenix-feedback-skill.js +5 -5
  55. package/dist/application-spec/generate-application/code/templates/skills/phoenix-review-skill.js +2 -2
  56. package/dist/application-spec/generate-application/code/templates/skills/phoenix-skill.js +1 -1
  57. package/dist/application-spec/generate-application/code/templates/skills/phoenix-variants-skill.js +2 -2
  58. package/dist/application-spec/generate-application/code/templates/skills/sdk-content.d.ts +13 -2
  59. package/dist/application-spec/generate-application/code/templates/skills/sdk-content.js +2 -2
  60. package/dist/application-spec/generate-application/code/templates/spec-code/collect-spec-code.d.ts +58 -0
  61. package/dist/application-spec/generate-application/code/templates/spec-code/collect-spec-code.js +1 -0
  62. package/dist/application-spec/generate-application/code/templates/spec-code/index.d.ts +2 -0
  63. package/dist/application-spec/generate-application/code/templates/spec-code/index.js +1 -0
  64. package/dist/application-spec/generate-application/code/templates/spec-code/spec-code.d.ts +18 -0
  65. package/dist/application-spec/generate-application/code/templates/spec-code/spec-code.js +41 -0
  66. package/dist/application-spec/generate-application/code/templates/spec-messages/index.d.ts +1 -0
  67. package/dist/application-spec/generate-application/code/templates/spec-messages/index.js +1 -0
  68. package/dist/application-spec/generate-application/code/templates/spec-messages/spec-messages.d.ts +20 -0
  69. package/dist/application-spec/generate-application/code/templates/spec-messages/spec-messages.js +6 -0
  70. package/dist/application-spec/generate-application/code/templates/story/phx-module.d.ts +8 -2
  71. package/dist/application-spec/generate-application/code/templates/story/phx-module.js +15 -3
  72. package/dist/application-spec/generate-application/code/templates/story/wrapper.d.ts +3 -0
  73. package/dist/application-spec/generate-application/code/templates/story/wrapper.js +2 -1
  74. package/dist/application-spec/generate-application/runtime/admin-runtime/admin-model-runtime.d.ts +2 -1
  75. package/dist/application-spec/generate-application/runtime/admin-runtime/admin-model-runtime.js +1 -1
  76. package/dist/application-spec/generate-application/runtime/admin-runtime/admin-runtime.d.ts +2 -1
  77. package/dist/application-spec/generate-application/runtime/admin-runtime/admin-runtime.js +1 -1
  78. package/dist/application-spec/generate-application/runtime/application-runtime.d.ts +8 -2
  79. package/dist/application-spec/generate-application/runtime/application-runtime.js +1 -1
  80. package/dist/application-spec/generate-application/runtime/configurator-runtime/configurator-model-runtime.d.ts +2 -1
  81. package/dist/application-spec/generate-application/runtime/configurator-runtime/configurator-model-runtime.js +1 -1
  82. package/dist/application-spec/generate-application/runtime/configurator-runtime/configurator-runtime.d.ts +2 -1
  83. package/dist/application-spec/generate-application/runtime/configurator-runtime/configurator-runtime.js +1 -1
  84. package/dist/application-spec/generate-application/runtime/sections/build-sdk-optic.d.ts +2 -1
  85. package/dist/application-spec/generate-application/runtime/sections/build-sdk-optic.js +1 -1
  86. package/dist/application-spec/generate-application/runtime/sections/build-user-bound-optic.d.ts +2 -1
  87. package/dist/application-spec/generate-application/runtime/sections/build-user-bound-optic.js +1 -1
  88. package/dist/application-spec/generate-application/runtime/sections/component-optic.d.ts +3 -0
  89. package/dist/application-spec/generate-application/runtime/sections/component-optic.js +1 -1
  90. package/dist/application-spec/generate-application/runtime/sections/expression-runtime.d.ts +5 -3
  91. package/dist/application-spec/generate-application/runtime/sections/expression-runtime.js +1 -1
  92. package/dist/application-spec/generate-application/runtime/sections/generate-memo-eval-plan-runtime.d.ts +9 -5
  93. package/dist/application-spec/generate-application/runtime/sections/generate-memo-eval-plan-runtime.js +1 -1
  94. package/dist/application-spec/generate-application/runtime/sections/reflection-constants-runtime.d.ts +3 -1
  95. package/dist/application-spec/generate-application/runtime/sections/reflection-constants-runtime.js +1 -1
  96. package/dist/application-spec/generate-application/runtime/spec-code/index.d.ts +2 -0
  97. package/dist/application-spec/generate-application/runtime/spec-code/index.js +1 -0
  98. package/dist/application-spec/generate-application/runtime/spec-code/resolve-spec-code.d.ts +18 -0
  99. package/dist/application-spec/generate-application/runtime/spec-code/resolve-spec-code.js +1 -0
  100. package/dist/application-spec/generate-application/runtime/spec-code/spec-code-module.d.ts +17 -0
  101. package/dist/application-spec/generate-application/runtime/spec-code/spec-code-module.js +1 -0
  102. package/dist/application-spec/generate-application/runtime-spec/index.d.ts +1 -0
  103. package/dist/application-spec/generate-application/runtime-spec/index.js +1 -1
  104. package/dist/application-spec/generate-application/runtime-spec/spec-code-id.d.ts +40 -0
  105. package/dist/application-spec/generate-application/runtime-spec/spec-code-id.js +1 -0
  106. package/dist/application-spec/parse-application-files/categorize/categorize-files.js +1 -1
  107. package/dist/application-spec/parse-application-files/spec/expressions/expression-read-types.d.ts +9 -4
  108. package/dist/application-spec/parse-application-files/spec/expressions/expression-read-types.js +1 -1
  109. package/dist/application-spec/parse-application-files/spec/expressions/expression-value-type.d.ts +9 -0
  110. package/dist/application-spec/parse-application-files/spec/expressions/expression-value-type.js +1 -0
  111. package/dist/application-spec/parse-application-files/spec/expressions/expressions.js +1 -1
  112. package/dist/application-spec/parse-application-files/spec/expressions/user-expressions.d.ts +3 -1
  113. package/dist/application-spec/parse-application-files/spec/expressions/user-expressions.js +1 -1
  114. package/dist/configurator/application-runtime/extensions/systems/graphql-system/close-unclosed-braces.d.ts +12 -0
  115. package/dist/configurator/application-runtime/extensions/systems/graphql-system/close-unclosed-braces.js +1 -0
  116. package/dist/configurator/application-runtime/extensions/systems/graphql-system/graphql-system.d.ts +1 -1
  117. package/dist/configurator/application-runtime/extensions/systems/graphql-system/graphql-system.js +1 -1
  118. package/dist/configurator/common/configurator-interface.d.ts +11 -2
  119. package/dist/configurator/common/configurator-interface.js +1 -1
  120. package/dist/configurator/common/index.d.ts +2 -2
  121. package/dist/configurator/common/index.js +1 -1
  122. package/dist/configurator/configuration-not-found-page/ConfigurationNotFoundPageElement.d.ts +12 -0
  123. package/dist/configurator/configuration-not-found-page/ConfigurationNotFoundPageElement.js +1 -0
  124. package/dist/configurator/configuration-not-found-page/index.d.ts +1 -0
  125. package/dist/configurator/configuration-not-found-page/index.js +1 -0
  126. package/dist/configurator/configurator-context/PresetSelectionProvider.js +1 -1
  127. package/dist/configurator/pages/ConfiguratorNotFoundPage.js +1 -1
  128. package/dist/configurator/pages/DefaultNotAuthenticatedPage.d.ts +8 -0
  129. package/dist/configurator/pages/DefaultNotAuthenticatedPage.js +1 -0
  130. package/dist/configurator/pages/DefaultPresetUi.d.ts +7 -0
  131. package/dist/configurator/pages/DefaultPresetUi.js +1 -0
  132. package/dist/configurator/pages/NewConfiguratorPage.js +1 -1
  133. package/dist/configurator/pages/RootPage.js +1 -1
  134. package/dist/configurator/pages/default-configurator-elements.d.ts +4 -1
  135. package/dist/configurator/pages/default-configurator-elements.js +1 -1
  136. package/dist/configurator/pages/default-elements/built-in-entity-element.d.ts +1 -1
  137. package/dist/configurator/pages/default-elements/built-in-layout-element.d.ts +1 -1
  138. package/dist/configurator/preset-screen-elements/PresetDeviceNotSupportedElement.d.ts +4 -0
  139. package/dist/configurator/preset-screen-elements/PresetDeviceNotSupportedElement.js +1 -0
  140. package/dist/configurator/preset-screen-elements/PresetPageActionElement.d.ts +4 -0
  141. package/dist/configurator/preset-screen-elements/PresetPageActionElement.js +1 -0
  142. package/dist/configurator/preset-screen-elements/index.d.ts +2 -0
  143. package/dist/configurator/preset-screen-elements/index.js +1 -0
  144. package/dist/configurator/scene/scene-controls/DeleteEntityFab.js +1 -1
  145. package/dist/configurator/scene/scene-controls/SelectionHotspot.js +1 -1
  146. package/dist/configurator/ui/assistant/AssistantMarkdown.d.ts +1 -1
  147. package/dist/configurator/ui/assistant/AssistantMarkdown.js +1 -1
  148. package/dist/configurator/ui/assistant/entity-link/AssistantEntityLink.js +1 -1
  149. package/dist/configurator/ui/assistant/resource-image/AssistantImage.d.ts +9 -0
  150. package/dist/configurator/ui/assistant/resource-image/AssistantImage.js +1 -0
  151. package/dist/configurator/ui/assistant/resource-image/index.d.ts +3 -0
  152. package/dist/configurator/ui/assistant/resource-image/index.js +1 -0
  153. package/dist/configurator/ui/assistant/resource-image/resource-path.d.ts +11 -0
  154. package/dist/configurator/ui/assistant/resource-image/resource-path.js +1 -0
  155. package/dist/configurator/ui/assistant/resource-image/use-resource-image-url.d.ts +5 -0
  156. package/dist/configurator/ui/assistant/resource-image/use-resource-image-url.js +1 -0
  157. package/dist/configurator/ui/assistant/streamed-markdown.js +1 -1
  158. package/dist/configurator/ui/assistant/use-follow-stream.js +1 -1
  159. package/dist/configurator/ui/configurator-layout/slots/mobile-tabs/use-mobile-tabs.d.ts +1 -1
  160. package/dist/configurator/ui/configurator-layout/slots/mobile-tabs/use-mobile-tabs.js +1 -1
  161. package/dist/configurator/ui/configurator-layout/slots/services/InvariantViolations.js +1 -1
  162. package/dist/configurator/ui/configurator-layout/slots/services/Services.js +1 -1
  163. package/dist/configurator/ui/configurator-layout/slots/sidebar-tabs/use-sidebar-tabs.d.ts +1 -1
  164. package/dist/configurator/ui/configurator-layout/slots/sidebar-tabs/use-sidebar-tabs.js +1 -1
  165. package/dist/configurator/ui/legacy/layout/common/CommonFinalizeButton.js +1 -1
  166. package/dist/configurator/ui/legacy/layout/common/CommonSummaryButton.js +1 -1
  167. package/dist/configurator/ui/legacy/layout/common/CommonTopNavigation.js +1 -1
  168. package/dist/configurator/ui/legacy/layout/common/ResponsiveFinalizeButton.js +1 -1
  169. package/dist/configurator/ui/legacy/layout/common/SummaryReadLayout.js +1 -1
  170. package/dist/configurator/ui/legacy/layout/simple/SimpleOwnerLayout.js +1 -1
  171. package/dist/configurator/ui/legacy/layout/simple/SimpleTopNavigation.js +1 -1
  172. package/dist/configurator/ui/legacy/layout/steps/StepsNavigation.js +1 -1
  173. package/dist/configurator/ui/legacy/layout/steps/StepsOwnerLayout.js +1 -1
  174. package/dist/configurator/ui/legacy/layout/steps/StepsSidebarFooter.js +1 -1
  175. package/dist/configurator/ui/legacy/layout/tabs/TabsOwnerLayout.js +1 -1
  176. package/dist/configurator/ui/legacy/toolbar/common/DimensionUnitSelector.js +1 -1
  177. package/dist/configurator/ui/legacy/toolbar/common/MeasurementsIndicatorsSwitch.js +1 -1
  178. package/dist/configurator/ui/legacy/toolbar/desktop-toolbar/FullscreenToolbarAction.js +1 -1
  179. package/dist/configurator/ui/legacy/toolbar/desktop-toolbar/HelpToolbarAction.js +1 -1
  180. package/dist/configurator/ui/legacy/toolbar/desktop-toolbar/MeasurementsToolbarAction.js +1 -1
  181. package/dist/configurator/ui/legacy/toolbar/desktop-toolbar/UndoRedoToolbarGroup.js +1 -1
  182. package/dist/configurator/ui/phoenix-layout-elements/EnterFullscreenToolbarButton.js +1 -1
  183. package/dist/configurator/ui/phoenix-layout-elements/ExitFullscreenToolbarButton.js +1 -1
  184. package/dist/configurator/ui/phoenix-layout-elements/HelpToolbarButton.js +1 -1
  185. package/dist/configurator/ui/phoenix-layout-elements/LayoutCustomOwnerUi.d.ts +1 -0
  186. package/dist/configurator/ui/phoenix-layout-elements/LayoutCustomOwnerUi.js +1 -1
  187. package/dist/configurator/ui/phoenix-layout-elements/LayoutCustomReadUi.d.ts +1 -0
  188. package/dist/configurator/ui/phoenix-layout-elements/LayoutCustomReadUi.js +1 -1
  189. package/dist/configurator/ui/phoenix-layout-elements/MeasurementsToolbarButton.js +1 -1
  190. package/dist/configurator/ui/phoenix-layout-elements/RedoToolbarButton.js +1 -1
  191. package/dist/configurator/ui/phoenix-layout-elements/UndoToolbarButton.js +1 -1
  192. package/dist/configurator/ui/phoenix-layout-elements/header/common/back-button/use-go-back-action.js +1 -1
  193. package/dist/configurator/ui/phoenix-layout-elements/header/common/horizontal-tabs/DesktopHorizontalTabs.js +1 -1
  194. package/dist/configurator/ui/phoenix-layout-elements/header/common/step-navigation/StepsNavigation.js +1 -1
  195. package/dist/configurator/ui/phoenix-layout-elements/measurements/DimensionUnitSelector.js +1 -1
  196. package/dist/configurator/ui/phoenix-layout-elements/measurements/MeasurementsIndicatorsSwitch.js +1 -1
  197. package/dist/configurator/ui/phoenix-layout-elements/sidebar-footer/basic/BasicFinalizeButton.js +1 -1
  198. package/dist/configurator/ui/phoenix-layout-elements/sidebar-footer/common/CustomFinalizeButton.js +1 -1
  199. package/dist/configurator/ui/phoenix-layout-elements/sidebar-footer/common/EnterSummaryButton.js +1 -1
  200. package/dist/configurator/ui/phoenix-layout-elements/sidebar-footer/common/NextStepButton.js +1 -1
  201. package/dist/configurator/ui/phoenix-layout-elements/sidebar-footer/common/PreviousStepButton.js +1 -1
  202. package/dist/configurator/ui/preset-layout/CategoryPresetUi.js +1 -1
  203. package/dist/configurator/ui/preset-layout/PresetUi.d.ts +4 -0
  204. package/dist/configurator/ui/preset-layout/PresetUi.js +1 -1
  205. package/dist/configurator/ui/save-message-snackbars/SaveMessageSnackbars.d.ts +10 -0
  206. package/dist/configurator/ui/save-message-snackbars/SaveMessageSnackbars.js +1 -0
  207. package/dist/configurator/ui/save-message-snackbars/index.d.ts +1 -0
  208. package/dist/configurator/ui/save-message-snackbars/index.js +1 -0
  209. package/dist/docs/index.json +1 -1
  210. package/dist/docs/layouts/custom-layout.mdx +8 -7
  211. package/dist/docs/other-features/not-found-404.mdx +1 -1
  212. package/dist/docs/phoenix/clerk-sign-in.mdx +1 -1
  213. package/dist/docs/phoenix/configurator-interface.mdx +51 -22
  214. package/dist/docs/phoenix/getting-started.mdx +5 -3
  215. package/dist/docs/phoenix/layout-slots.mdx +19 -19
  216. package/dist/docs/phoenix/localization.mdx +2 -0
  217. package/dist/docs/phoenix/migration-guide.mdx +3 -3
  218. package/dist/docs/phoenix/phoenix-cli.mdx +22 -11
  219. package/dist/docs/phoenix/project-structure.mdx +45 -27
  220. package/dist/docs/phoenix/quickstart.mdx +7 -7
  221. package/dist/docs/phoenix/sdk-builder-workflow.mdx +6 -6
  222. package/dist/docs/phoenix/testing.mdx +8 -0
  223. package/dist/domain/application/assistant/generate-assistant-prompt.js +1 -1
  224. package/dist/domain/domain-runtime/spec/module-checks/element-registration.d.ts +12 -11
  225. package/dist/domain/domain-runtime/spec/module-checks/element-registration.js +1 -1
  226. package/dist/domain/domain-runtime/spec/module-checks/index.d.ts +1 -1
  227. package/dist/domain/domain-runtime/spec/module-checks/index.js +1 -1
  228. package/dist/domain/domain-runtime/spec/selectors.js +1 -1
  229. package/dist/editor/Editor.d.ts +7 -0
  230. package/dist/editor/Editor.js +1 -1
  231. package/dist/editor/mocks/CreateMockYaml.js +2 -2
  232. package/dist/editor/mocks/EditorMockContext.d.ts +2 -0
  233. package/dist/editor/mocks/EditorMockContext.js +1 -1
  234. package/dist/legacy/domain-cli/utils/cache.d.ts +1 -1
  235. package/dist/legacy/domain-cli/utils/cache.js +1 -1
  236. package/dist/legacy/phoenix-cli/project-gen/generators/file-templates/frontend-admin.js +10 -11
  237. package/dist/legacy/phoenix-cli/project-gen/generators/file-templates/frontend-embedded-admin.js +9 -10
  238. package/dist/phoenix/application-spec/application-spec-builder.d.ts +0 -2
  239. package/dist/phoenix/application-spec/application-spec-builder.js +1 -1
  240. package/dist/phoenix/application-spec/generate-application-spec-project.d.ts +0 -2
  241. package/dist/phoenix/application-spec/generate-application-spec-project.js +2 -2
  242. package/dist/phoenix/application-spec/generate-project-files.d.ts +0 -2
  243. package/dist/phoenix/cli.js +1 -1
  244. package/dist/phoenix/commands/build.js +1 -1
  245. package/dist/phoenix/commands/clean.js +1 -1
  246. package/dist/phoenix/commands/deploy.js +2 -2
  247. package/dist/phoenix/commands/deps/deps.d.ts +22 -1
  248. package/dist/phoenix/commands/deps/deps.js +2 -2
  249. package/dist/phoenix/commands/deps/index.d.ts +1 -1
  250. package/dist/phoenix/commands/deps/index.js +1 -1
  251. package/dist/phoenix/commands/deps/sdk-manifest.js +1 -1
  252. package/dist/phoenix/commands/dev.js +4 -4
  253. package/dist/phoenix/commands/init.d.ts +17 -5
  254. package/dist/phoenix/commands/init.js +1 -1
  255. package/dist/phoenix/commands/link.js +1 -1
  256. package/dist/phoenix/commands/sync.js +1 -1
  257. package/dist/phoenix/commands/unlink.js +1 -1
  258. package/dist/phoenix/services/application-spec-project-watcher.d.ts +0 -2
  259. package/dist/phoenix/services/application-spec-project-watcher.js +2 -2
  260. package/dist/phoenix/utils/index.d.ts +2 -1
  261. package/dist/phoenix/utils/index.js +1 -1
  262. package/dist/phoenix/utils/package-info.d.ts +0 -9
  263. package/dist/phoenix/utils/package-info.js +1 -1
  264. package/dist/phoenix/utils/package-manager/index.d.ts +2 -0
  265. package/dist/phoenix/utils/package-manager/index.js +1 -0
  266. package/dist/phoenix/utils/package-manager/package-manager-commands.d.ts +19 -0
  267. package/dist/phoenix/utils/package-manager/package-manager-commands.js +1 -0
  268. package/dist/phoenix/utils/package-manager/pnpm-project.d.ts +9 -0
  269. package/dist/phoenix/utils/package-manager/pnpm-project.js +1 -0
  270. package/dist/react-sdk/application-runtime/common-services/analytics/index.d.ts +1 -0
  271. package/dist/react-sdk/application-runtime/common-services/analytics/index.js +1 -1
  272. package/dist/react-sdk/domain-application-context/DomainLifecycleBoundary.js +1 -1
  273. package/dist/react-sdk/domain-context/common-hooks/use-configurator-messages.d.ts +15 -4
  274. package/dist/react-sdk/domain-context/common-hooks/use-configurator-messages.js +1 -1
  275. package/dist/react-sdk/domain-context/index.d.ts +2 -0
  276. package/dist/react-sdk/domain-context/index.js +1 -1
  277. package/dist/react-sdk/domain-context/system-hooks/tab-navigation-hooks.d.ts +61 -0
  278. package/dist/react-sdk/domain-context/system-hooks/tab-navigation-hooks.js +1 -0
  279. package/dist/react-sdk/domain-context/system-hooks/undo-redo-hooks.d.ts +20 -0
  280. package/dist/react-sdk/domain-context/system-hooks/undo-redo-hooks.js +1 -0
  281. package/dist/react-sdk/handlers/index.d.ts +1 -0
  282. package/dist/react-sdk/handlers/index.js +1 -1
  283. package/dist/react-sdk/handlers/use-finalize-action.js +1 -0
  284. package/dist/react-sdk/session/NotAuthenticatedPage.d.ts +4 -0
  285. package/dist/react-sdk/session/NotAuthenticatedPage.js +1 -1
  286. package/dist/ui-sdk/theme/types.d.ts +1 -1
  287. package/package.json +3 -3
  288. package/dist/application-spec/generate-application/code/templates/nvmrc.d.ts +0 -1
  289. package/dist/application-spec/generate-application/code/templates/nvmrc.js +0 -2
  290. package/dist/application-spec/generate-application/code/templates/package-json.d.ts +0 -10
  291. package/dist/application-spec/generate-application/code/templates/package-json.js +0 -1
  292. package/dist/configurator/common/use-finalize-action.js +0 -1
  293. package/dist/phoenix/commands/generate-project-files.d.ts +0 -6
  294. package/dist/phoenix/commands/generate-project-files.js +0 -1
  295. /package/dist/{configurator/common → react-sdk/application-runtime/common-services/analytics}/frontend-analytics.d.ts +0 -0
  296. /package/dist/{configurator/common → react-sdk/application-runtime/common-services/analytics}/frontend-analytics.js +0 -0
  297. /package/dist/{configurator/common → react-sdk/handlers}/use-finalize-action.d.ts +0 -0
@@ -1,4 +1,4 @@
1
- import{mkdirSync as e}from"fs";import{resolve as t}from"path";import i from"promise-queue";import{Subject as s,buffer as r,debounceTime as o}from"rxjs";import{createServer as n,normalizePath as l}from"vite";import{watch as a}from"#package/watch";import{ApplicationSpecBuilder as h}from"../application-spec/application-spec-builder.js";import{logDiagnostics as c}from"../application-spec/metrics/index.js";import{syncTemplateFiles as u}from"../application-spec/template-files.js";import{buildWebhooks as p}from"../webhooks/index.js";import{getViteDevConfig as g}from"./vite-config.js";export const WATCH_PATTERNS=["spec/**/*.{yaml,yml}","src/**/*.{ts,tsx,yaml,yml,json,html,css}","templates/*.html",".env",".env.generated",".phoenix/.env.generated"];export const IGNORED_PATTERNS=["src/locales/**/*.{ts,tsx}",".phoenix/!(.env.generated)/**"];export class ApplicationSpecProjectWatcher{watcher=null;subscription=null;rebuildQueue=new i(1,1/0);changeSubject$=new s;viteServer=null;pubsub;logger;onRebuilt;onViteServerChange;builder;useServer;isShuttingDown=!1;suspended=!1;heldChanges=new Set;constructor(e){this.pubsub=e.pubsub,this.logger=e.logger,this.onRebuilt=e.onRebuilt,this.onViteServerChange=e.onViteServerChange,this.builder=new h({logger:e.logger,sdkVersion:e.sdkVersion,projectSlug:e.projectSlug,environmentSlug:e.environmentSlug,cliUseWorkspace:e.cliUseWorkspace,name:e.name,description:e.description,enableEditor:e.enableEditor,inlineTemplates:e.inlineTemplates}),this.useServer=e.useServer}start(e){this.viteServer=e,this.setupFileWatcher(),this.setupRebuildSubscription()}applyVariantFiles(e){this.rebuildQueue.add(async()=>{this.isShuttingDown||await this.rebuild(new Set(e.map(e=>e.fileName)),!1,!0)})}suspend(){this.suspended=!0}resume(){for(let e of(this.suspended=!1,this.heldChanges))this.changeSubject$.next(e);this.heldChanges.clear()}async close(){this.isShuttingDown=!0,this.watcher&&(await this.watcher.close(),this.watcher=null),this.subscription?.unsubscribe(),this.changeSubject$.complete()}setupFileWatcher(){e(t(process.cwd(),"src"),{recursive:!0}),this.watcher=a(WATCH_PATTERNS,{ignored:IGNORED_PATTERNS,cwd:process.cwd(),persistent:!0,ignoreInitial:!1}),this.watcher.on("all",(e,t)=>{if("change"===e||"add"===e||"unlink"===e){if(this.suspended)return void this.heldChanges.add(t);this.logger.info(`
1
+ import{mkdirSync as e}from"fs";import{resolve as t}from"path";import i from"promise-queue";import{Subject as s,buffer as r,debounceTime as o}from"rxjs";import{createServer as n,normalizePath as l}from"vite";import{watch as h}from"#package/watch";import{ApplicationSpecBuilder as a}from"../application-spec/application-spec-builder.js";import{logDiagnostics as c}from"../application-spec/metrics/index.js";import{syncTemplateFiles as u}from"../application-spec/template-files.js";import{buildWebhooks as p}from"../webhooks/index.js";import{getViteDevConfig as g}from"./vite-config.js";export const WATCH_PATTERNS=["spec/**/*.{yaml,yml}","src/**/*.{ts,tsx,yaml,yml,json,html,css}","templates/*.html",".env",".env.generated",".phoenix/.env.generated"];export const IGNORED_PATTERNS=["src/locales/**/*.{ts,tsx}",".phoenix/!(.env.generated)/**"];export class ApplicationSpecProjectWatcher{watcher=null;subscription=null;rebuildQueue=new i(1,1/0);changeSubject$=new s;viteServer=null;pubsub;logger;onRebuilt;onViteServerChange;builder;useServer;isShuttingDown=!1;suspended=!1;heldChanges=new Set;constructor(e){this.pubsub=e.pubsub,this.logger=e.logger,this.onRebuilt=e.onRebuilt,this.onViteServerChange=e.onViteServerChange,this.builder=new a({logger:e.logger,sdkVersion:e.sdkVersion,projectSlug:e.projectSlug,environmentSlug:e.environmentSlug,cliUseWorkspace:e.cliUseWorkspace,enableEditor:e.enableEditor,inlineTemplates:e.inlineTemplates}),this.useServer=e.useServer}start(e){this.viteServer=e,this.setupFileWatcher(),this.setupRebuildSubscription()}applyVariantFiles(e){this.rebuildQueue.add(async()=>{this.isShuttingDown||await this.rebuild(new Set(e.map(e=>e.fileName)),!1,!0)})}suspend(){this.suspended=!0}resume(){for(let e of(this.suspended=!1,this.heldChanges))this.changeSubject$.next(e);this.heldChanges.clear()}async close(){this.isShuttingDown=!0,this.watcher&&(await this.watcher.close(),this.watcher=null),this.subscription?.unsubscribe(),this.changeSubject$.complete()}setupFileWatcher(){e(t(process.cwd(),"src"),{recursive:!0}),this.watcher=h(WATCH_PATTERNS,{ignored:IGNORED_PATTERNS,cwd:process.cwd(),persistent:!0,ignoreInitial:!1}),this.watcher.on("all",(e,t)=>{if("change"===e||"add"===e||"unlink"===e){if(this.suspended)return void this.heldChanges.add(t);this.logger.info(`
2
2
  📝 Detected ${e}: ${t}`),this.changeSubject$.next(t)}})}setupRebuildSubscription(){let e=this.changeSubject$.pipe(o(10));this.subscription=this.changeSubject$.pipe(r(e)).subscribe(e=>{let t=new Set(e),i=t.has(".env");this.rebuildQueue.add(async()=>{this.isShuttingDown||(this.logger.info(`
3
3
  🔨 Rebuilding spec files...
4
- `),await this.rebuild(t,i,!1))})})}async rebuild(e,i,s){try{let r=this.viteServer;if(!r)throw Error("Cannot rebuild the project: the watcher has no Vite server yet, because it was not started. Start the watcher before applying files");let o=await u();if(this.isShuttingDown)return;let a=await this.builder.build({compile:!s});if(this.isShuttingDown)return;if(c(a.diagnostics,this.logger),!a.ok){for(let e of a.errors)this.logger.error(`[${e.code}] ${e.message}${e.file?` (${e.file})`:""}`);this.pubsub.specFile$.next({rawProjectFiles:a.rawProjectFiles,projectRoot:process.cwd()});return}this.onRebuilt?.();let{application:h,changedFiles:d}=a,w=r.moduleGraph,b=Date.now(),f=new Set,S=process.cwd(),m=e=>{let t=w.getModulesByFile(l(e));if(t)for(let e of t)w.invalidateModule(e,f,b,!0)};for(let i of e)m(t(S,i));for(let e of d)m(t(S,`.phoenix/${e.path}`));if(this.pubsub.specFile$.next({rawProjectFiles:h.rawProjectFiles,projectRoot:process.cwd(),configurationSchemaHash:h.applicationSpec.configurator.configurationSchema.hash}),this.isShuttingDown)return;if(i){if(await r.close(),this.isShuttingDown)return;let e=await g({templateFiles:o});if(this.isShuttingDown)return;let t=await n(e);if(this.isShuttingDown||(await t.listen(),this.isShuttingDown))return void await t.close();this.viteServer=t,this.onViteServerChange?.(t),this.logger.success("Vite server restarted (env changed)")}if(this.useServer&&!s){if(this.logger.step("Building webhooks"),await p({experimental:!0,skipNodeEnvOverride:!0,webhookEntryPoint:"./.phoenix/.swc/.phoenix/webhook.js",preserveExistingOutput:!0}),this.isShuttingDown)return;this.logger.success("Webhooks rebuilt successfully")}this.logger.success("Project files rebuilt successfully")}catch(e){this.logger.error(`Build failed: ${e instanceof Error?e.message:String(e)}`,e)}}}
4
+ `),await this.rebuild(t,i,!1))})})}async rebuild(e,i,s){try{let r=this.viteServer;if(!r)throw Error("Cannot rebuild the project: the watcher has no Vite server yet, because it was not started. Start the watcher before applying files");let o=await u();if(this.isShuttingDown)return;let h=await this.builder.build({compile:!s});if(this.isShuttingDown)return;if(c(h.diagnostics,this.logger),!h.ok){for(let e of h.errors)this.logger.error(`[${e.code}] ${e.message}${e.file?` (${e.file})`:""}`);this.pubsub.specFile$.next({rawProjectFiles:h.rawProjectFiles,projectRoot:process.cwd()});return}this.onRebuilt?.();let{application:a,changedFiles:d}=h,w=r.moduleGraph,b=Date.now(),f=new Set,S=process.cwd(),m=e=>{let t=w.getModulesByFile(l(e));if(t)for(let e of t)w.invalidateModule(e,f,b,!0)};for(let i of e)m(t(S,i));for(let e of d)m(t(S,`.phoenix/${e.path}`));if(this.pubsub.specFile$.next({rawProjectFiles:a.rawProjectFiles,projectRoot:process.cwd(),configurationSchemaHash:a.applicationSpec.configurator.configurationSchema.hash}),this.isShuttingDown)return;if(i){if(await r.close(),this.isShuttingDown)return;let e=await g({templateFiles:o});if(this.isShuttingDown)return;let t=await n(e);if(this.isShuttingDown||(await t.listen(),this.isShuttingDown))return void await t.close();this.viteServer=t,this.onViteServerChange?.(t),this.logger.success("Vite server restarted (env changed)")}if(this.useServer&&!s){if(this.logger.step("Building webhooks"),await p({experimental:!0,skipNodeEnvOverride:!0,webhookEntryPoint:"./.phoenix/.swc/.phoenix/webhook.js",preserveExistingOutput:!0}),this.isShuttingDown)return;this.logger.success("Webhooks rebuilt successfully")}this.logger.success("Project files rebuilt successfully")}catch(e){this.logger.error(`Build failed: ${e instanceof Error?e.message:String(e)}`,e)}}}
@@ -6,8 +6,9 @@ export { createDirectoryFromYaml, exists, scanFolderForFiles, syncChangedFiles,
6
6
  export { FileLogger } from './file-logger.js';
7
7
  export { isInsideGitRepository } from './git/index.js';
8
8
  export { type Logger, type CreateLoggerOptions, createLogger } from './logger.js';
9
- export { addWorkspaceOverrides, ensureWorkspaceInstallSettings, getLocalOverrides, getSdkPackages, getWorkspaceDir, hasLocalOverrides, readPackageJson, removeWorkspaceOverrides, } from './package-info.js';
9
+ export { addWorkspaceOverrides, getLocalOverrides, getSdkPackages, getWorkspaceDir, hasLocalOverrides, readPackageJson, removeWorkspaceOverrides, } from './package-info.js';
10
10
  export { naturalCompare } from './natural-compare.js';
11
+ export { type PackageManagerCommands, assertPnpmProject, findPackageManagerCommands } from './package-manager/index.js';
11
12
  export { toPascalCase } from './pascal-case.js';
12
13
  export { readGitCommit } from './read-git-commit.js';
13
14
  export { type RunCommandProps, type RunSdkToolProps, runCommand, runSdkTool } from './run-command.js';
@@ -1 +1 @@
1
- export{askQuestion}from"./ask-question.js";export{checkBundleSizeBudgets}from"./check-bundle-size-budgets.js";export{formatEnvContent,formatEnvLine}from"./env-file.js";export{parseChangelog,getLatestVersion,getVersion,paginateVersions,getVersionNumbers}from"./changelog-parser.js";export{createDirectoryFromYaml,exists,scanFolderForFiles,syncChangedFiles,syncExistingFolders,validateFolders,writeFileIfNotExists,writeFilesIfNotExists,writeRawFiles}from"./file-system.js";export{FileLogger}from"./file-logger.js";export{isInsideGitRepository}from"./git/index.js";export{createLogger}from"./logger.js";export{addWorkspaceOverrides,ensureWorkspaceInstallSettings,getLocalOverrides,getSdkPackages,getWorkspaceDir,hasLocalOverrides,readPackageJson,removeWorkspaceOverrides}from"./package-info.js";export{naturalCompare}from"./natural-compare.js";export{toPascalCase}from"./pascal-case.js";export{readGitCommit}from"./read-git-commit.js";export{runCommand,runSdkTool}from"./run-command.js";export{uploadFilesWithPresignedUrls,readUploadLinks}from"./upload-utils.js";
1
+ export{askQuestion}from"./ask-question.js";export{checkBundleSizeBudgets}from"./check-bundle-size-budgets.js";export{formatEnvContent,formatEnvLine}from"./env-file.js";export{parseChangelog,getLatestVersion,getVersion,paginateVersions,getVersionNumbers}from"./changelog-parser.js";export{createDirectoryFromYaml,exists,scanFolderForFiles,syncChangedFiles,syncExistingFolders,validateFolders,writeFileIfNotExists,writeFilesIfNotExists,writeRawFiles}from"./file-system.js";export{FileLogger}from"./file-logger.js";export{isInsideGitRepository}from"./git/index.js";export{createLogger}from"./logger.js";export{addWorkspaceOverrides,getLocalOverrides,getSdkPackages,getWorkspaceDir,hasLocalOverrides,readPackageJson,removeWorkspaceOverrides}from"./package-info.js";export{naturalCompare}from"./natural-compare.js";export{assertPnpmProject,findPackageManagerCommands}from"./package-manager/index.js";export{toPascalCase}from"./pascal-case.js";export{readGitCommit}from"./read-git-commit.js";export{runCommand,runSdkTool}from"./run-command.js";export{uploadFilesWithPresignedUrls,readUploadLinks}from"./upload-utils.js";
@@ -10,15 +10,6 @@ export declare const readPackageJson: (path?: string) => PackageJson;
10
10
  export declare const getWorkspaceDir: () => string;
11
11
  export declare const addWorkspaceOverrides: (entries: Record<string, string>) => void;
12
12
  export declare const removeWorkspaceOverrides: (names: readonly string[]) => void;
13
- /**
14
- * Makes a standalone project installable with pnpm 11: its `pnpm-workspace.yaml` decides the build scripts of the
15
- * SDK's dependencies and exempts the SDK's own packages from the minimum release age. Only missing answers are
16
- * added, so a value the project set stays, and the file travels with a deploy so the server-side install follows it.
17
- *
18
- * A project inside a monorepo is left alone: the workspace root owns these settings, and a file in the project
19
- * folder would turn it into a workspace root of its own.
20
- */
21
- export declare const ensureWorkspaceInstallSettings: (projectRoot: string) => void;
22
13
  export declare const hasLocalOverrides: () => boolean;
23
14
  export declare const getLocalOverrides: () => string[];
24
15
  export declare const hasLocalSymlinks: () => boolean;
@@ -1 +1 @@
1
- import{existsSync as e,lstatSync as t,readFileSync as r,readdirSync as s,writeFileSync as o}from"fs";import{dirname as a,join as i,resolve as l}from"path";import{isMap as n,isScalar as c,isSeq as d,parse as p,parseDocument as m}from"yaml";let u="pnpm-workspace.yaml",f="@salsita-ai/";export const readPackageJson=(t=".")=>{let s=l(t,"package.json");if(!e(s))throw Error(`package.json not found at ${s}`);return JSON.parse(r(s,"utf8"))};let g=(t=process.cwd())=>{let r=l(t);for(;;){let t=i(r,u);if(e(t))return t;let s=a(r);if(s===r)return;r=s}},k=()=>g()??i(process.cwd(),u),h=()=>{try{let e=g();if(!e)return{};let t=p(r(e,"utf8"));return t?.overrides??{}}catch{return{}}};export const getWorkspaceDir=()=>a(k());export const addWorkspaceOverrides=t=>{let s=k(),a=m(e(s)?r(s,"utf8"):"");Object.entries(t).forEach(([e,t])=>{a.setIn(["overrides",e],t)}),a.setIn(["optimisticRepeatInstall"],!1),o(s,a.toString())};export const removeWorkspaceOverrides=e=>{let t=g();if(!t)return;let s=m(r(t,"utf8"));e.forEach(e=>{s.deleteIn(["overrides",e])});let a=s.getIn(["overrides"]);n(a)&&0===a.items.length&&s.delete("overrides"),s.delete("optimisticRepeatInstall"),o(t,s.toString())};let x={"@swc/core":!0,esbuild:!0,"es5-ext":!1},y=`${f}*`;export const ensureWorkspaceInstallSettings=t=>{let s=i(t,u);if(!e(s)&&g(t))return;let a=e(s)?r(s,"utf8"):"",l=m(a);n(l.get("allowBuilds"))||l.set("allowBuilds",l.createNode({})),Object.entries(x).forEach(([e,t])=>{"boolean"!=typeof l.getIn(["allowBuilds",e])&&l.setIn(["allowBuilds",e],t)});let p=l.getIn(["minimumReleaseAgeExclude"]);d(p)?p.items.some(e=>c(e)&&e.value===y)||p.add(y):l.setIn(["minimumReleaseAgeExclude"],l.createNode([y]));let f=l.toString();f!==a&&o(s,f)};export const hasLocalOverrides=()=>Object.keys(h()).some(e=>e.startsWith(f));export const getLocalOverrides=()=>Object.keys(h()).filter(e=>e.startsWith(f));let v=["@salsita-ai/common","@salsita-ai/contracts","@salsita-ai/sdk"];export const hasLocalSymlinks=()=>v.some(e=>{let r=l("node_modules",e);try{return t(r).isSymbolicLink()}catch{return!1}});export const isUsingLocalSdk=()=>hasLocalOverrides()||hasLocalSymlinks();export const getSdkPackages=t=>{let r=l(t,"packages/libs");if(!e(r))throw Error(`SDK libs directory not found at ${r}`);return s(r,{withFileTypes:!0}).filter(e=>e.isDirectory()).map(e=>e.name).map(e=>{let t=i(r,e),s=readPackageJson(t);if(!s.name)throw Error(`Package at ${t} has no name in package.json`);return{name:s.name,path:t}})};
1
+ import{existsSync as e,lstatSync as t,readFileSync as r,readdirSync as s,writeFileSync as o}from"fs";import{dirname as a,join as i,resolve as n}from"path";import{isMap as c,parse as l,parseDocument as p}from"yaml";let m="pnpm-workspace.yaml",d="@salsita-ai/";export const readPackageJson=(t=".")=>{let s=n(t,"package.json");if(!e(s))throw Error(`package.json not found at ${s}`);return JSON.parse(r(s,"utf8"))};let f=(t=process.cwd())=>{let r=n(t);for(;;){let t=i(r,m);if(e(t))return t;let s=a(r);if(s===r)return;r=s}},k=()=>f()??i(process.cwd(),m),h=()=>{try{let e=f();if(!e)return{};let t=l(r(e,"utf8"));return t?.overrides??{}}catch{return{}}};export const getWorkspaceDir=()=>a(k());export const addWorkspaceOverrides=t=>{let s=k(),a=p(e(s)?r(s,"utf8"):"");Object.entries(t).forEach(([e,t])=>{a.setIn(["overrides",e],t)}),a.setIn(["optimisticRepeatInstall"],!1),o(s,a.toString())};export const removeWorkspaceOverrides=e=>{let t=f();if(!t)return;let s=p(r(t,"utf8"));e.forEach(e=>{s.deleteIn(["overrides",e])});let a=s.getIn(["overrides"]);c(a)&&0===a.items.length&&s.delete("overrides"),s.delete("optimisticRepeatInstall"),o(t,s.toString())};export const hasLocalOverrides=()=>Object.keys(h()).some(e=>e.startsWith(d));export const getLocalOverrides=()=>Object.keys(h()).filter(e=>e.startsWith(d));let u=["@salsita-ai/common","@salsita-ai/contracts","@salsita-ai/sdk"];export const hasLocalSymlinks=()=>u.some(e=>{let r=n("node_modules",e);try{return t(r).isSymbolicLink()}catch{return!1}});export const isUsingLocalSdk=()=>hasLocalOverrides()||hasLocalSymlinks();export const getSdkPackages=t=>{let r=n(t,"packages/libs");if(!e(r))throw Error(`SDK libs directory not found at ${r}`);return s(r,{withFileTypes:!0}).filter(e=>e.isDirectory()).map(e=>e.name).map(e=>{let t=i(r,e),s=readPackageJson(t);if(!s.name)throw Error(`Package at ${t} has no name in package.json`);return{name:s.name,path:t}})};
@@ -0,0 +1,2 @@
1
+ export { type PackageManagerCommands, findPackageManagerCommands } from './package-manager-commands.js';
2
+ export { assertPnpmProject } from './pnpm-project.js';
@@ -0,0 +1 @@
1
+ export{findPackageManagerCommands}from"./package-manager-commands.js";export{assertPnpmProject}from"./pnpm-project.js";
@@ -0,0 +1,19 @@
1
+ /**
2
+ * The commands of a package manager the CLI names in the next steps it prints, so a developer can copy the one for
3
+ * the package manager they use. Phoenix works with any package manager; these only phrase the hints.
4
+ */
5
+ export interface PackageManagerCommands {
6
+ /** Installs the project's dependencies, such as `npm install`. */
7
+ readonly install: string;
8
+ /** Adds a package to the project's dependencies, such as `npm install @salsita-ai/sdk`. */
9
+ readonly add: (packageName: string) => string;
10
+ /** Runs a `phoenix` command from the project's install, such as `npx phoenix sync`. */
11
+ readonly phoenix: (args: string) => string;
12
+ }
13
+ /**
14
+ * The commands of the package manager that started the CLI, read from the `npm_config_user_agent` value npm, pnpm,
15
+ * Yarn and Bun set for the binaries they run (`pnpm/11.1.3 npm/? node/v22.13.0 linux x64`). `undefined` when the CLI
16
+ * was started some other way, such as straight from `node_modules/.bin`, or by a package manager it does not know;
17
+ * the hint then names no package manager.
18
+ */
19
+ export declare const findPackageManagerCommands: (userAgent: string | undefined) => PackageManagerCommands | undefined;
@@ -0,0 +1 @@
1
+ let n=new Map([["pnpm",{install:"pnpm install",add:n=>`pnpm add ${n}`,phoenix:n=>`pnpm phoenix ${n}`}],["npm",{install:"npm install",add:n=>`npm install ${n}`,phoenix:n=>`npx phoenix ${n}`}],["yarn",{install:"yarn install",add:n=>`yarn add ${n}`,phoenix:n=>`yarn phoenix ${n}`}],["bun",{install:"bun install",add:n=>`bun add ${n}`,phoenix:n=>`bunx phoenix ${n}`}]]);export const findPackageManagerCommands=a=>{let p=a?.split("/")[0]?.trim();return void 0===p?void 0:n.get(p)};
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Stops a pnpm-only command in a project that clearly installs with another package manager: one with another
3
+ * package manager's lockfile and no `pnpm-lock.yaml`. A project without any lockfile is let through, as it has not
4
+ * installed yet. Only the project folder is looked at.
5
+ */
6
+ export declare const assertPnpmProject: (props: {
7
+ readonly projectRoot: string;
8
+ readonly command: string;
9
+ }) => void;
@@ -0,0 +1 @@
1
+ import{existsSync as o}from"fs";import{join as t}from"path";let n=["package-lock.json","npm-shrinkwrap.json","yarn.lock","bun.lock","bun.lockb"];export const assertPnpmProject=r=>{if(o(t(r.projectRoot,"pnpm-lock.yaml")))return;let a=n.find(n=>o(t(r.projectRoot,n)));if(void 0!==a)throw Error(`phoenix ${r.command} works with pnpm only, and this project installs with another package manager: it has ${a} and no pnpm-lock.yaml. It is an internal tool for linking a local SDK checkout through the overrides in pnpm-workspace.yaml. Use it in a project that installs with pnpm.`)};
@@ -1,2 +1,3 @@
1
1
  export * from './analytics-service.js';
2
2
  export * from './domain-controls-analytics.js';
3
+ export * from './frontend-analytics.js';
@@ -1 +1 @@
1
- export*from"./analytics-service.js";export*from"./domain-controls-analytics.js";
1
+ export*from"./analytics-service.js";export*from"./domain-controls-analytics.js";export*from"./frontend-analytics.js";
@@ -1 +1 @@
1
- import{jsx as i,jsxs as t,Fragment as e}from"react/jsx-runtime";import{useEffect as n,useRef as a}from"react";import{useApplicationRuntime as r,useApplicationRuntimeSelector as o,useLogger as s}from"../application-runtime/index.js";import{ConfigurationPersistSystemFailureHandler as d}from"./ConfigurationPersistSystemFailureHandler.js";import{IsUndoableRegistration as l}from"./IsUndoableHandler.js";export const DomainLifecycleBoundary=m=>{let u,c,f,g,p,y,h,{children:b,type:x}=m,j=(f=(c=(u=r()).selectors.domainContext[x]).getDomainContext(),g=s(),p=o(c.getInitializationState),y=o(c.getSchemaCoherence),h=a(null),n(()=>{"schema-mismatch"===y&&g.debug("Loaded domain data belongs to a different schema identity, so initialization is paused."),"missing-stamp"===y&&g.debug("Loaded domain data has no schema identity, so initialization is paused.")},[g,y]),n(()=>{if(null===p.identity)return;if(h.current!==p.identity){let i=c.getInitializationState().identity;null!==i&&h.current!==i&&(f.initialize(),h.current=i)}let i=u.subscribe(f.reconcile);return()=>{i()}},[u,f,c,p.identity]),p);return j.isCurrent?t(e,{children:["configurator"===x&&i(l,{}),i(d,{disabled:j.isViewMode}),b]}):null};
1
+ import{jsx as i,jsxs as t,Fragment as e}from"react/jsx-runtime";import{useEffect as n,useRef as a}from"react";import{useApplicationRuntime as r,useApplicationRuntimeSelector as o,useLogger as s}from"../application-runtime/index.js";import{ConfigurationPersistSystemFailureHandler as d}from"./ConfigurationPersistSystemFailureHandler.js";import{IsUndoableRegistration as m}from"./IsUndoableHandler.js";export const DomainLifecycleBoundary=l=>{let u,c,f,g,p,y,h,{children:b,type:x}=l,j=(f=(c=(u=r()).selectors.domainContext[x]).getDomainContext(),g=s(),p=o(c.getInitializationState),y=o(c.getSchemaCoherence),h=a(null),n(()=>{"schema-mismatch"===y&&g.debug("Loaded domain data belongs to a different schema identity, so initialization is paused."),"missing-stamp"===y&&g.debug("Loaded domain data has no schema identity, so initialization is paused.")},[g,y]),n(()=>{if(null===p.identity)return;if(h.current!==p.identity){let i=c.getInitializationState().identity;null!==i&&h.current!==i&&(f.initialize(),h.current=i)}let i=u.subscribe(f.reconcile);return()=>{i()}},[u,f,c,p.identity]),p);return j.isCurrent?t(e,{children:["configurator"===x&&i(m,{}),"admin"===x&&i(d,{disabled:j.isViewMode}),b]}):null};
@@ -7,6 +7,9 @@ import type { $DomainEntity, DomainEntity, EntityViolation, ViolationTypesOf$Ent
7
7
  * apart. `text` is the violation's message, or its type when it has none; `entityId` names the entity.
8
8
  * - `sideEffect`: a committed change carried a hint, for example from a transformer that adjusted another field.
9
9
  * - `error`: an error was thrown while the changed state was validated; `text` is a generic message for the user.
10
+ * - `saveError`: saving the configuration failed; `error` is what the save rejected with, `text` a generic message
11
+ * for the user. The configurator keeps saving later changes.
12
+ * - `saveRecovery`: a save succeeded after a `saveError`; `text` says the configuration was updated.
10
13
  */
11
14
  export type ConfiguratorMessage<ENTITIES extends DomainEntity<string> = DomainEntity<string>, VIOLATION_TYPE extends string = string> = ({
12
15
  readonly kind: 'violation';
@@ -18,13 +21,21 @@ export type ConfiguratorMessage<ENTITIES extends DomainEntity<string> = DomainEn
18
21
  readonly kind: 'error';
19
22
  readonly error: Error;
20
23
  readonly text: string;
24
+ } | {
25
+ readonly kind: 'saveError';
26
+ readonly error: unknown;
27
+ readonly text: string;
28
+ } | {
29
+ readonly kind: 'saveRecovery';
30
+ readonly text: string;
21
31
  };
22
32
  export type UseConfiguratorMessages<ENTITIES extends DomainEntity<string> = DomainEntity<string>, $MAP extends Record<ENTITIES['type'], $DomainEntity<ENTITIES>> = Record<ENTITIES['type'], $DomainEntity<ENTITIES>>> = (onMessage: (message: ConfiguratorMessage<ENTITIES, ViolationTypesOf$Entity<$MAP[ENTITIES['type']]>>) => void) => void;
23
33
  /**
24
- * Calls `onMessage` once for every violation, side-effect hint and validation error: the violations of a rejected
25
- * change, the hints of a committed change and an error thrown while a change was validated. Hints committed before the
26
- * component mounted are not delivered; when the most recent change was rejected or threw, its messages are
27
- * delivered again on mount, because the store keeps that emission. `onMessage` may be a new function on every
34
+ * Calls `onMessage` once for every violation, side-effect hint, validation error and save failure: the violations of a
35
+ * rejected change, the hints of a committed change, an error thrown while a change was validated, a failed save and the
36
+ * first successful save after it. Hints committed before the component mounted are not delivered, nor is a save that
37
+ * failed before it mounted; when the most recent change was rejected or threw, its messages are delivered again on
38
+ * mount, because the store keeps that emission. `onMessage` may be a new function on every
28
39
  * render; the latest one is called.
29
40
  */
30
41
  export declare const useConfiguratorMessages: (onMessage: (message: ConfiguratorMessage) => void) => void;
@@ -1 +1 @@
1
- import{useSubscription as e}from"observable-hooks";import{useMemo as t}from"react";import{distinctUntilChanged as i,map as o,skip as r}from"rxjs";import{useResolveLocalizable as s}from"../../localizable/index.js";import{useDomain as a}from"./use-domain-context.js";let n={id:"sdk.messages.validation.uncaughtError.message",message:"Oops, something went wrong"};export const useConfiguratorMessages=m=>{let{storeSystem:l}=a(),d=s(),p=t(()=>l.stateSlices.potentiallyInvalid.pipe(o(e=>e.validity)),[l]),f=t(()=>l.stateSlices.committed.pipe(r(1),i(),o(e=>"updates"in e?e.updates.flatMap(e=>e.hint?[e.hint]:[]):[])),[l]);e(p,e=>{if(!e.valid){if("uncaught"===e.severity)return void m({kind:"error",error:e.error,text:d(n)});e.entityViolations.forEach(({entityId:e,violation:t})=>{m({kind:"violation",entityId:e,violation:t,text:d(t.message??t.type)})})}}),e(f,e=>{e.forEach(e=>{m({kind:"sideEffect",text:d(e)})})})};
1
+ import{useSubscription as e}from"observable-hooks";import{useMemo as r}from"react";import{distinctUntilChanged as t,map as i,pairwise as o,skip as s}from"rxjs";import{useDomainApplication as a}from"../../application-runtime/index.js";import{useResolveLocalizable as n}from"../../localizable/index.js";import{useDomain as d}from"./use-domain-context.js";let m={id:"sdk.messages.validation.uncaughtError.message",message:"Oops, something went wrong"},p={id:"sdk.persist.system.error.message",message:"An error occured when trying to update a configuration"},l={id:"sdk.persist.system.error.recovered",message:"Configuration updated"};export const useConfiguratorMessages=u=>{let{storeSystem:c}=d(),{configurationPersistSystem:f}=a(),g=n(),v=r(()=>c.stateSlices.potentiallyInvalid.pipe(i(e=>e.validity)),[c]),x=r(()=>c.stateSlices.committed.pipe(s(1),t(),i(e=>"updates"in e?e.updates.flatMap(e=>e.hint?[e.hint]:[]):[])),[c]),h=r(()=>f.failure$.pipe(o()),[f]);e(v,e=>{if(!e.valid){if("uncaught"===e.severity)return void u({kind:"error",error:e.error,text:g(m)});e.entityViolations.forEach(({entityId:e,violation:r})=>{u({kind:"violation",entityId:e,violation:r,text:g(r.message??r.type)})})}}),e(x,e=>{e.forEach(e=>{u({kind:"sideEffect",text:g(e)})})}),e(h,([e,r])=>{null!==r?u({kind:"saveError",error:r.error,text:g(p)}):null!==e&&u({kind:"saveRecovery",text:g(l)})})};
@@ -10,6 +10,8 @@ export { useEntityPrice, useRootEntityPrice, type UseEntityPrice, type UseRootEn
10
10
  export { useSelectEntity, type UseSelectEntity, useSelectedEntity, type UseSelectedEntity, useSelectedEntityId, type UseSelectedEntityId, useSelectedDomainEntityId, type UseSelectedDomainEntityId, useDeselect, type UseDeselect, useSelectParent, type UseSelectParent, } from './system-hooks/selection-hooks.js';
11
11
  export { useActiveNavigationState, type UseActiveNavigationState, useActiveViewState, type UseActiveViewState, useSetViewState, type UseSetViewState, useActiveToolState, type UseActiveToolState, useIsFullscreenActive, type UseIsFullscreenActive, useSetFullscreen, type UseSetFullscreen, useActiveViewports, type UseActiveViewports, useDraggedDomainEntityId, type UseDraggedDomainEntityId, useNavigate, type UseNavigate, usePushNavigate, type UsePushNavigate, usePopNavigate, type UsePopNavigate, } from './system-hooks/navigation-hooks.js';
12
12
  export { useComposition, type UseComposition } from './system-hooks/composition-hooks.js';
13
+ export { useUndoRedo, type UseUndoRedo, type UseUndoRedoResult } from './system-hooks/undo-redo-hooks.js';
14
+ export { useTabNavigation, type TabEntry, type TabSource, type UseTabNavigation, type UseTabNavigationOptions, type UseTabNavigationResult, } from './system-hooks/tab-navigation-hooks.js';
13
15
  export { useHoveredDomainEntityId, useHoveredEntity, useHoveredEntityId, type UseHoveredDomainEntityId, type UseHoveredEntity, type UseHoveredEntityId, } from './system-hooks/hover-hooks.js';
14
16
  export { type UseRootEntityState, useRootEntityState, useRootEntityRenderedState, } from './entity-hooks/use-root-entity-state.js';
15
17
  export { type UseRootEntityId, useRootEntityId, useRootEntityRenderedId } from './entity-hooks/use-root-entity-id.js';
@@ -1 +1 @@
1
- export{useDomain}from"./common-hooks/use-domain-context.js";export{useStoreSelector,useRenderedSelector,useRenderedSelector$,useStoreSelector$}from"./common-hooks/use-store-selector.js";export{useEagerObservableSelector,usePatientObservableSelector,usePatientObservableValue,useEagerObservableValue}from"./common-hooks/use-observable-selector.js";export{useStateValidity,useMapViolationHints,useControlViolations,useFinalizeViolations}from"./common-hooks/use-state-validity.js";export{useConfiguratorMessages}from"./common-hooks/use-configurator-messages.js";export{useComponent,useRenderedComponent,useComponents,useDynamicComponents,useRenderedComponents,useRootComponents,useRootRenderedComponents,useFirstComponent,useFirstRenderedComponent,useFirstRootComponent,useFirstRootRenderedComponent}from"./component-hooks/use-component.js";export{useCommittedState,useCommittedSlice,useRenderedSlice,useRenderedState}from"./common-hooks/use-slices.js";export{useDomainEntityState,useDomainEntityRenderedState}from"./entity-hooks/use-domain-entity-state.js";export{useEntityPrice,useRootEntityPrice}from"./entity-hooks/use-entity-price.js";export{useSelectEntity,useSelectedEntity,useSelectedEntityId,useSelectedDomainEntityId,useDeselect,useSelectParent}from"./system-hooks/selection-hooks.js";export{useActiveNavigationState,useActiveViewState,useSetViewState,useActiveToolState,useIsFullscreenActive,useSetFullscreen,useActiveViewports,useDraggedDomainEntityId,useNavigate,usePushNavigate,usePopNavigate}from"./system-hooks/navigation-hooks.js";export{useComposition}from"./system-hooks/composition-hooks.js";export{useHoveredDomainEntityId,useHoveredEntity,useHoveredEntityId}from"./system-hooks/hover-hooks.js";export{useRootEntityState,useRootEntityRenderedState}from"./entity-hooks/use-root-entity-state.js";export{useRootEntityId,useRootEntityRenderedId}from"./entity-hooks/use-root-entity-id.js";export{useEntitySelector,useRootEntitySelector,useRenderedEntitySelector,useRenderedRootEntitySelector}from"./common-hooks/use-entity-selector.js";export{useDimensionState,useDimensions,useDimensionConfig}from"./system-hooks/dimension-hooks.js";
1
+ export{useDomain}from"./common-hooks/use-domain-context.js";export{useStoreSelector,useRenderedSelector,useRenderedSelector$,useStoreSelector$}from"./common-hooks/use-store-selector.js";export{useEagerObservableSelector,usePatientObservableSelector,usePatientObservableValue,useEagerObservableValue}from"./common-hooks/use-observable-selector.js";export{useStateValidity,useMapViolationHints,useControlViolations,useFinalizeViolations}from"./common-hooks/use-state-validity.js";export{useConfiguratorMessages}from"./common-hooks/use-configurator-messages.js";export{useComponent,useRenderedComponent,useComponents,useDynamicComponents,useRenderedComponents,useRootComponents,useRootRenderedComponents,useFirstComponent,useFirstRenderedComponent,useFirstRootComponent,useFirstRootRenderedComponent}from"./component-hooks/use-component.js";export{useCommittedState,useCommittedSlice,useRenderedSlice,useRenderedState}from"./common-hooks/use-slices.js";export{useDomainEntityState,useDomainEntityRenderedState}from"./entity-hooks/use-domain-entity-state.js";export{useEntityPrice,useRootEntityPrice}from"./entity-hooks/use-entity-price.js";export{useSelectEntity,useSelectedEntity,useSelectedEntityId,useSelectedDomainEntityId,useDeselect,useSelectParent}from"./system-hooks/selection-hooks.js";export{useActiveNavigationState,useActiveViewState,useSetViewState,useActiveToolState,useIsFullscreenActive,useSetFullscreen,useActiveViewports,useDraggedDomainEntityId,useNavigate,usePushNavigate,usePopNavigate}from"./system-hooks/navigation-hooks.js";export{useComposition}from"./system-hooks/composition-hooks.js";export{useUndoRedo}from"./system-hooks/undo-redo-hooks.js";export{useTabNavigation}from"./system-hooks/tab-navigation-hooks.js";export{useHoveredDomainEntityId,useHoveredEntity,useHoveredEntityId}from"./system-hooks/hover-hooks.js";export{useRootEntityState,useRootEntityRenderedState}from"./entity-hooks/use-root-entity-state.js";export{useRootEntityId,useRootEntityRenderedId}from"./entity-hooks/use-root-entity-id.js";export{useEntitySelector,useRootEntitySelector,useRenderedEntitySelector,useRenderedRootEntitySelector}from"./common-hooks/use-entity-selector.js";export{useDimensionState,useDimensions,useDimensionConfig}from"./system-hooks/dimension-hooks.js";
@@ -0,0 +1,61 @@
1
+ import { type ReactNode } from 'react';
2
+ import { type DomainEntityId } from '#package/domain';
3
+ /**
4
+ * The spec component a layout's tabs come from: the `sidebarTabs` of an entity, or the configurator's
5
+ * `horizontalTabs`.
6
+ */
7
+ export type TabSource = 'sidebarTabs' | 'horizontalTabs';
8
+ /**
9
+ * One tab of the spec, ready to render.
10
+ */
11
+ export interface TabEntry<NAVIGATION_STATE extends string = string> {
12
+ /** Position of the tab in `tabs`; what `select` takes */
13
+ readonly index: number;
14
+ /** The tab's label, resolved for the active locale */
15
+ readonly label: string;
16
+ /** A PhxIcon name, when the spec gives the icon as a string */
17
+ readonly icon: string | undefined;
18
+ /** A React node, when TypeScript spec code gives the icon as one (`sidebarTabs` only) */
19
+ readonly iconNode: ReactNode | undefined;
20
+ /** The tab's navigation states; the tab is active while one of them is */
21
+ readonly navigationStates: readonly NAVIGATION_STATE[];
22
+ /** `navigationStates[0]`, the state `select` enters */
23
+ readonly state: NAVIGATION_STATE;
24
+ readonly isActive: boolean;
25
+ }
26
+ /**
27
+ * Which tabs `useTabNavigation` reads.
28
+ * - `source`: `'auto'` (default) reads the entity's `sidebarTabs` and, without any, the `horizontalTabs`.
29
+ * - `entityId`: whose `sidebarTabs` are read; the selected entity by default (the root while nothing is selected).
30
+ */
31
+ export interface UseTabNavigationOptions {
32
+ readonly source?: 'auto' | TabSource;
33
+ readonly entityId?: DomainEntityId<string>;
34
+ }
35
+ /**
36
+ * The tabs of the spec and the means to switch between them.
37
+ * - `source`: the component the tabs come from, or `null` when no active instance of it exists.
38
+ * - `tabs`: the tabs in spec order. `activeTab`: the first tab whose navigation states include the active one.
39
+ * - `select`: enters a tab, given by its index or by any of its navigation states; an unknown tab does nothing.
40
+ */
41
+ export interface UseTabNavigationResult<NAVIGATION_STATE extends string = string> {
42
+ readonly source: TabSource | null;
43
+ readonly tabs: readonly TabEntry<NAVIGATION_STATE>[];
44
+ readonly activeTab: TabEntry<NAVIGATION_STATE> | null;
45
+ readonly select: (tab: number | NAVIGATION_STATE) => void;
46
+ }
47
+ export type UseTabNavigation<NAVIGATION_STATE extends string> = (options?: UseTabNavigationOptions) => UseTabNavigationResult<NAVIGATION_STATE>;
48
+ /**
49
+ * Hook to read the tabs the spec declares, `sidebarTabs` or `horizontalTabs`, and to switch between them, as the
50
+ * built-in tabs do.
51
+ * - `sidebarTabs`: every active instance on the entity, flattened in spec order. `horizontalTabs`: the first active
52
+ * instance, on any entity.
53
+ * - With `source: 'auto'` and both kinds active, `sidebarTabs` win; several active `horizontalTabs` use the first.
54
+ * Both log a warning in development and never throw.
55
+ * - A tab without navigation states cannot be entered and is left out, with a warning in development.
56
+ * - `select` enters the tab's first navigation state. For `horizontalTabs` it pushes the analytics event the
57
+ * built-in horizontal tabs push; for `sidebarTabs` none, as the built-in sidebar tabs.
58
+ *
59
+ * It does not check read mode: switching tabs is navigation, not editing.
60
+ */
61
+ export declare const useTabNavigation: (options?: UseTabNavigationOptions) => UseTabNavigationResult;
@@ -0,0 +1 @@
1
+ import{useCallback as t,useEffect as o,useMemo as a}from"react";import{horizontalTabsComponent as e,sidebarTabsComponent as i}from"#package/domain";import{FrontendAnalyticsFactory as n,useAnalyticsService as s,useIsDev as r}from"../../application-runtime/index.js";import{useResolveLocalizable as l}from"../../localizable/index.js";import{useDomain as m}from"../common-hooks/use-domain-context.js";import{useComponents as c}from"../component-hooks/use-component.js";import{useActiveNavigationState as p}from"./navigation-hooks.js";import{useSelectedDomainEntityId as b}from"./selection-hooks.js";let h=(t,a)=>{let e=r();o(()=>{e&&t&&console.warn(a)},[e,t,a])};export const useTabNavigation=(o={})=>{let{source:r="auto",entityId:v}=o,g=p(),d=b(),f=l(),u=s(),{navigationSystem:T,storeSystem:z}=m(),S=c({componentTypes:[i],entityIds:[v??d]}),j=c({componentTypes:[e]}),N="horizontalTabs"!==r&&S.length>0,k="sidebarTabs"!==r&&j.length>0,y=N?"sidebarTabs":k?"horizontalTabs":null;h(N&&k,"Both sidebarTabs and horizontalTabs are active, so useTabNavigation shows the sidebarTabs. Remove one of them from the spec, or pass `source` to choose."),h("horizontalTabs"===y&&j.length>1,"Several horizontalTabs are active, so useTabNavigation shows the first one. Keep one active, for example with $filter.");let x=a(()=>"sidebarTabs"===y?S.flatMap(t=>t.state.tabs):"horizontalTabs"===y?j[0]?.state.tabs??[]:[],[y,S,j]),w=x.filter(t=>0===t.navigationStates.length);h(w.length>0,`The ${y} tabs ${w.map(t=>`"${f(t.label)}"`).join(", ")} have no navigation states, so useTabNavigation leaves them out. Give each tab at least one navigation state.`);let $=a(()=>x.flatMap(t=>{let o=t.navigationStates[0];return void 0===o?[]:[{tab:t,state:o}]}).map(({tab:t,state:o},a)=>({index:a,label:f(t.label),icon:"string"==typeof t.icon?t.icon:void 0,iconNode:"string"==typeof t.icon||null===t.icon?void 0:t.icon,navigationStates:t.navigationStates,state:o,isActive:t.navigationStates.includes(g)})),[x,g,f]),A=$.find(t=>t.isActive)??null,C=t(t=>{let o="number"==typeof t?$[t]:$.find(o=>o.navigationStates.includes(t));o&&("horizontalTabs"===y&&u.push(n.TopNavigationStepClicked(o.state)),z.stageAndCommit([T.getNavigationUpdate(o.state)]))},[$,y,u,z,T]);return{source:y,tabs:$,activeTab:A,select:C}};
@@ -0,0 +1,20 @@
1
+ /**
2
+ * What a project layout needs to offer undo and redo.
3
+ * - `canUndo` and `canRedo`: whether the undo history has a step to go back or forward to; they follow every change.
4
+ * - `undo`: returns to the previous step and pushes the undo-button analytics event; does nothing while `canUndo`
5
+ * is false.
6
+ * - `redo`: returns to the next step and pushes the redo-button analytics event; does nothing while `canRedo` is
7
+ * false.
8
+ */
9
+ export interface UseUndoRedoResult {
10
+ readonly canUndo: boolean;
11
+ readonly canRedo: boolean;
12
+ readonly undo: () => void;
13
+ readonly redo: () => void;
14
+ }
15
+ export type UseUndoRedo = () => UseUndoRedoResult;
16
+ /**
17
+ * Hook to undo and redo changes of the configuration, as the built-in toolbar's undo and redo buttons do. It does
18
+ * not check read mode; a layout hides undo and redo for a viewer.
19
+ */
20
+ export declare const useUndoRedo: UseUndoRedo;
@@ -0,0 +1 @@
1
+ import{useCallback as o}from"react";import{FrontendAnalyticsFactory as e,useAnalyticsService as n}from"../../application-runtime/index.js";import{useDomain as t}from"../common-hooks/use-domain-context.js";import{useEagerObservableValue as r}from"../common-hooks/use-observable-selector.js";export const useUndoRedo=()=>{let d=n(),{undoSystem:m}=t(),{canUndo:s,canRedo:c}=r(m.can$);return{canUndo:s,canRedo:c,undo:o(()=>{m.canUndo()&&(d.push(e.UndoButtonClicked()),m.undo())},[d,m]),redo:o(()=>{m.canRedo()&&(d.push(e.RedoButtonClicked()),m.redo())},[d,m])}};
@@ -1,2 +1,3 @@
1
1
  export { usePhoenixHandler, useSystemPhoenixHandler, useSystemPhoenixAsyncHandler } from './PhoenixHandler.js';
2
2
  export { PhoenixHandlerBoundary } from './PhoenixHandlerBoundary.js';
3
+ export { type UseFinalizeAction, type UseFinalizeActionResult, useFinalizeAction } from './use-finalize-action.js';
@@ -1 +1 @@
1
- export{usePhoenixHandler,useSystemPhoenixHandler,useSystemPhoenixAsyncHandler}from"./PhoenixHandler.js";export{PhoenixHandlerBoundary}from"./PhoenixHandlerBoundary.js";
1
+ export{usePhoenixHandler,useSystemPhoenixHandler,useSystemPhoenixAsyncHandler}from"./PhoenixHandler.js";export{PhoenixHandlerBoundary}from"./PhoenixHandlerBoundary.js";export{useFinalizeAction}from"./use-finalize-action.js";
@@ -0,0 +1 @@
1
+ import{useMutation as r}from"@tanstack/react-query";import{useCallback as e,useRef as n}from"react";import{FrontendAnalyticsFactory as t,useAnalyticsService as o,useLogger as i}from"../application-runtime/index.js";import{useFinalizeViolations as a}from"../domain-context/index.js";import{usePhoenixHandler as c}from"./PhoenixHandler.js";export const useFinalizeAction=l=>{let{handler:m}=c(l),s=o(),u=i(),{disabled:f,hints:d}=a(),p=n(!1),{mutate:h,isPending:x,error:y}=r({mutationFn:async()=>{try{await m()}catch(r){throw r instanceof Error?r:Error(null==r?"The finalize handler failed without a reason.":String(r),{cause:r})}finally{p.current=!1}},onError:r=>{u.error("Failed to finalize",{error:r.message})}});return{run:e(()=>{f||p.current||(p.current=!0,s.push(t.FinalizeButtonClicked()),h())},[s,f,h]),isPending:x,error:y,disabled:f,hints:d}};
@@ -1,4 +1,8 @@
1
1
  import { type PhoenixLayoutElementRegistration } from '#package/domain';
2
2
  export declare const createNotAuthenticatedPage: (Element: () => JSX.Element) => PhoenixLayoutElementRegistration;
3
3
  export type CreateNotAuthenticatedPage = (Element: () => JSX.Element) => PhoenixLayoutElementRegistration;
4
+ /**
5
+ * Renders the `NotAuthenticatedPage` element. Its default, the configurator's built-in page, comes from
6
+ * `defaultConfiguratorElements`; a project element registered under the name replaces it.
7
+ */
4
8
  export declare const NotAuthenticatedPage: () => import("react/jsx-runtime").JSX.Element;
@@ -1 +1 @@
1
- import{jsx as t}from"react/jsx-runtime";import{createCustomPhoenixLayoutElement as e}from"#package/domain";import{PhoenixLayoutElement as o}from"../elements/index.js";import{ConfigurationNotFoundPage as a}from"./ConfigurationNotFoundPage.js";let r="NotAuthenticatedPage";export const createNotAuthenticatedPage=t=>e(r,t);let n=()=>t(a,{});export const NotAuthenticatedPage=()=>t(o,{name:r,elementProps:{},defaultSlot:n});
1
+ import{jsx as e}from"react/jsx-runtime";import{createCustomPhoenixLayoutElement as t}from"#package/domain";import{PhoenixLayoutElement as o}from"../elements/index.js";let a="NotAuthenticatedPage";export const createNotAuthenticatedPage=e=>t(a,e);export const NotAuthenticatedPage=()=>e(o,{name:a,elementProps:{}});
@@ -44,7 +44,7 @@ declare module '@mui/material/styles' {
44
44
  PhxChat: 'root';
45
45
  PhxChatFooter: 'root' | 'formLayout' | 'input';
46
46
  PhxChatMessage: 'base' | 'assistant' | 'user' | 'widget' | 'error' | 'helper';
47
- PhxAssistantPanel: 'root' | 'header' | 'title' | 'closeButton' | 'thread' | 'greeting' | 'messages' | 'userMessage' | 'assistantMessage' | 'entityLink' | 'referenceLink' | 'referenceDetails' | 'form' | 'formGroup' | 'formGroupLabel' | 'formOptions' | 'formOptionsLabel' | 'formOptionsRow' | 'formReply' | 'formText' | 'formTextInput' | 'formSubmit' | 'formNote' | 'chips' | 'activity' | 'activityIcon' | 'chip' | 'undoButton' | 'status' | 'separator' | 'earlierButton' | 'notice' | 'newReplyButton' | 'composer' | 'inputFrame' | 'input' | 'sendButton' | 'stopButton' | 'hint';
47
+ PhxAssistantPanel: 'root' | 'header' | 'title' | 'closeButton' | 'thread' | 'greeting' | 'messages' | 'userMessage' | 'assistantMessage' | 'entityLink' | 'referenceLink' | 'referenceDetails' | 'image' | 'form' | 'formGroup' | 'formGroupLabel' | 'formOptions' | 'formOptionsLabel' | 'formOptionsRow' | 'formReply' | 'formText' | 'formTextInput' | 'formSubmit' | 'formNote' | 'chips' | 'activity' | 'activityIcon' | 'chip' | 'undoButton' | 'status' | 'separator' | 'earlierButton' | 'notice' | 'newReplyButton' | 'composer' | 'inputFrame' | 'input' | 'sendButton' | 'stopButton' | 'hint';
48
48
  PhxTopNavigation: 'root' | 'stepper' | 'step';
49
49
  PhxListSelector: 'root';
50
50
  PhxListSelectorItem: 'root' | 'radio' | 'title' | 'description' | 'formControlLabel';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@salsita-ai/sdk",
3
- "version": "0.50.0-develop.bd84173265",
3
+ "version": "0.50.0-develop.bded01bb03",
4
4
  "description": "TypeScript SDK and CLI for building, running, and deploying Phoenix configurator applications.",
5
5
  "keywords": [
6
6
  "salsita",
@@ -298,8 +298,8 @@
298
298
  "yaml": "2.9.0",
299
299
  "yargs": "17.7.2",
300
300
  "zod": "3.25.76",
301
- "@salsita-ai/common": "0.50.0-develop.bd84173265",
302
- "@salsita-ai/contracts": "0.50.0-develop.bd84173265"
301
+ "@salsita-ai/common": "0.50.0-develop.bded01bb03",
302
+ "@salsita-ai/contracts": "0.50.0-develop.bded01bb03"
303
303
  },
304
304
  "devDependencies": {
305
305
  "@clerk/clerk-react": "5.61.8",
@@ -1 +0,0 @@
1
- export declare const generateApplicationSpecNvmrc: () => string;
@@ -1,2 +0,0 @@
1
- export const generateApplicationSpecNvmrc=()=>`v24.14.1
2
- `;
@@ -1,10 +0,0 @@
1
- interface GenerateApplicationSpecPackageJsonProps {
2
- readonly sdkVersion: string;
3
- readonly useWorkspace: boolean;
4
- readonly useClerk?: boolean;
5
- readonly name?: string;
6
- readonly description?: string;
7
- readonly existingContent?: string;
8
- }
9
- export declare const generateApplicationSpecPackageJson: (props: GenerateApplicationSpecPackageJsonProps) => string;
10
- export {};
@@ -1 +0,0 @@
1
- let e=["@salsita-ai/platform-project-sdk","@salsita-ai/platform-common","@salsita-ai/platform-contracts","@salsita-ai/common","@salsita-ai/contracts"],t={private:!0,type:"module",packageManager:"pnpm@11.1.3",engines:{node:"24.14.1",pnpm:"11.1.3"}},r={"babel-plugin-macros":"3.1.0",vite:"6.4.3","@vitejs/plugin-react":"5.2.0","@swc/cli":"0.8.1","@swc/core":"1.15.40",typescript:"npm:@typescript/typescript6@6.0.2","@lingui/cli":"5.9.5","@types/lodash-es":"4.17.12","@lingui/macro":"5.9.5","@lingui/swc-plugin":"5.11.0","@types/node":"24.12.2","@types/react":"18.3.8","@types/react-dom":"18.3.0","@types/three":"0.160.0","@typescript/native":"npm:typescript@7.0.2",envalid:"8.1.1",eslint:"9.39.4",prettier:"3.8.3",vitest:"4.1.11"},i=e=>"object"==typeof e&&null!==e&&!Array.isArray(e),s=e=>{if(!i(e))return;let t=[];for(let[r,i]of Object.entries(e)){if("string"!=typeof i)return;t.push([r,i])}return Object.fromEntries(t)},a=e=>e.replace(/^[\^~]/,""),n=(t,r)=>{let i={};for(let[e,r]of Object.entries(t))i[e]=a(r);if(r)for(let[e,t]of Object.entries(r))e in i||(i[e]=a(t));return Object.fromEntries(Object.entries(i).filter(([t])=>!e.includes(t)).sort(([e],[t])=>e>t?1:e<t?-1:0))};export const generateApplicationSpecPackageJson=e=>{let{sdkVersion:a,useWorkspace:c,useClerk:o=!1,name:p,description:l,existingContent:m}=e,u=(e=>{if(!e)return{};try{let t=JSON.parse(e);if(i(t))return t}catch{}return{}})(m),f=n({...o?{"@clerk/clerk-react":"5.61.8"}:{},"camera-controls":"2.4.2","lodash-es":"4.18.1",react:"18.3.1","react-dom":"18.3.1","@emotion/react":"11.11.3","@emotion/styled":"11.11.0","@mui/material":"5.15.5","@mui/system":"5.16.7","@lingui/core":"5.9.5","@lingui/react":"5.9.5",three:"0.160.1","@react-three/fiber":"8.15.16","@react-three/drei":"9.97.6","@react-three/postprocessing":"2.16.3",postprocessing:"6.36.3",motion:"12.34.0","@tanstack/react-query":"5.100.14",rxjs:"7.8.2",uuid:"14.0.0","ts-pattern":"5.9.0","@salsita-ai/sdk":c?"workspace:^":a,zod:"3.25.76"},s(u.dependencies)),d=n(r,s(u.devDependencies)),y=u.name,g=p?p.toLowerCase().replace(/[^a-z0-9-]/g,"-"):"string"==typeof y?y:"project-name",j={...u,name:g,...t,dependencies:f,devDependencies:d};return void 0!==l&&(j.description=l),JSON.stringify(j,null,2)+"\n"};
@@ -1 +0,0 @@
1
- import{useMutation as r}from"@tanstack/react-query";import{useCallback as t,useRef as e}from"react";import{useAnalyticsService as a,useFinalizeViolations as n,useLogger as o,usePhoenixHandler as i}from"#package/react-sdk";import{FrontendAnalyticsFactory as c}from"./frontend-analytics.js";export const useFinalizeAction=l=>{let{handler:s}=i(l),u=a(),f=o(),{disabled:m,hints:d}=n(),h=e(!1),{mutate:p,isPending:y,error:k}=r({mutationFn:async()=>{try{await s()}catch(r){throw r instanceof Error?r:Error(null==r?"The finalize handler failed without a reason.":String(r),{cause:r})}finally{h.current=!1}},onError:r=>{f.error("Failed to finalize",{error:r.message})}});return{run:t(()=>{m||h.current||(h.current=!0,u.push(c.FinalizeButtonClicked()),p())},[u,m,p]),isPending:y,error:k,disabled:m,hints:d}};
@@ -1,6 +0,0 @@
1
- import { generateProjectFiles } from '../application-spec/index.js';
2
- import type { CommandContext } from './types.js';
3
- export declare const generateProjectFilesAndInstallDependencies: (props: Parameters<typeof generateProjectFiles>[0], context: CommandContext) => Promise<{
4
- templateFiles: readonly string[];
5
- applicationSpec: import("../../application-spec/index.js").ApplicationSpec;
6
- }>;
@@ -1 +0,0 @@
1
- import{readFile as a}from"fs/promises";import{generateProjectFiles as e}from"../application-spec/index.js";import{runCommand as t}from"../utils/index.js";export const generateProjectFilesAndInstallDependencies=async(i,n)=>{let s=await a("package.json","utf-8"),o=await e(i,n);return s!==await a("package.json","utf-8")&&await t({command:"pnpm",args:["install"],description:"Reinstalling packages",quiet:!0},n),o};