@salsita-ai/sdk 0.50.0-develop.ca5894b56c → 0.50.0-develop.cba048b0d7

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 (238) hide show
  1. package/dist/application-spec/errors/diagnostic-codes.d.ts +7 -1
  2. package/dist/application-spec/errors/diagnostic-codes.js +1 -1
  3. package/dist/application-spec/errors/diagnostic-messages.d.ts +14 -1
  4. package/dist/application-spec/errors/diagnostic-messages.js +1 -1
  5. package/dist/application-spec/generate-application/implementations/phx-model.d.ts +1 -1
  6. package/dist/application-spec/generate-application/runtime/admin-runtime/admin-model-runtime.d.ts +1 -2
  7. package/dist/application-spec/generate-application/runtime/configurator-runtime/configurator-model-runtime.d.ts +1 -2
  8. package/dist/application-spec/generate-application/runtime/factory-data/factory-data-runtime.d.ts +1 -2
  9. package/dist/application-spec/generate-application/runtime/factory-data/static-violations.d.ts +1 -2
  10. package/dist/application-spec/generate-application/runtime/sections/actions-runtime.d.ts +1 -2
  11. package/dist/application-spec/generate-application/runtime/sections/build-sdk-optic.d.ts +1 -1
  12. package/dist/application-spec/generate-application/runtime/sections/build-sdk-optic.js +1 -1
  13. package/dist/application-spec/generate-application/runtime/sections/build-user-bound-optic.d.ts +1 -1
  14. package/dist/application-spec/generate-application/runtime/sections/component-optic.d.ts +1 -2
  15. package/dist/application-spec/generate-application/runtime/sections/expression-runtime.d.ts +1 -2
  16. package/dist/application-spec/generate-application/runtime/sections/generate-memo-eval-plan-runtime.d.ts +1 -2
  17. package/dist/application-spec/generate-application/runtime/sections/reflection-constants-runtime.d.ts +1 -2
  18. package/dist/application-spec/generate-application/runtime-spec/runtime-spec.d.ts +96 -31
  19. package/dist/application-spec/generate-application/runtime-spec/spec-code-id.d.ts +1 -1
  20. package/dist/application-spec/parse-application-files/merge/merged-assistant.d.ts +13 -4
  21. package/dist/application-spec/parse-application-files/merge/merged-assistant.js +1 -1
  22. package/dist/application-spec/parse-application-files/merge/merged-infra.d.ts +4 -11
  23. package/dist/application-spec/parse-application-files/merge/merged-transformers.d.ts +2 -4
  24. package/dist/application-spec/parse-application-files/raw-spec/raw-acl.d.ts +2 -2
  25. package/dist/application-spec/parse-application-files/raw-spec/raw-acl.js +1 -1
  26. package/dist/application-spec/parse-application-files/raw-spec/raw-admin-pages.d.ts +3 -24
  27. package/dist/application-spec/parse-application-files/raw-spec/raw-assistant.d.ts +25 -20
  28. package/dist/application-spec/parse-application-files/raw-spec/raw-assistant.js +1 -1
  29. package/dist/application-spec/parse-application-files/raw-spec/raw-resources.d.ts +19 -64
  30. package/dist/application-spec/parse-application-files/spec/application/admin-spec/admin-pages.d.ts +3 -20
  31. package/dist/application-spec/parse-application-files/spec/application/admin-spec/states.d.ts +3 -5
  32. package/dist/application-spec/parse-application-files/spec/application/configurator-spec/states.d.ts +3 -8
  33. package/dist/application-spec/parse-application-files/spec/components/bindings/read-binding.d.ts +3 -13
  34. package/dist/application-spec/parse-application-files/spec/components/bindings/write-binding.d.ts +4 -32
  35. package/dist/application-spec/parse-application-files/spec/components/component-filter.d.ts +4 -10
  36. package/dist/application-spec/parse-application-files/spec/components/components.d.ts +3 -4
  37. package/dist/application-spec/parse-application-files/spec/components/index.d.ts +1 -2
  38. package/dist/application-spec/parse-application-files/spec/components/index.js +1 -1
  39. package/dist/application-spec/parse-application-files/spec/components/sdk-component-entry.d.ts +1 -1
  40. package/dist/application-spec/parse-application-files/spec/components/user-component-entry.d.ts +2 -3
  41. package/dist/application-spec/parse-application-files/spec/components/user-component-entry.js +1 -1
  42. package/dist/application-spec/parse-application-files/spec/components/user-components.d.ts +2 -3
  43. package/dist/application-spec/parse-application-files/spec/expressions/expression-read-types.d.ts +2 -2
  44. package/dist/application-spec/parse-application-files/spec/expressions/expressions.d.ts +7 -29
  45. package/dist/application-spec/parse-application-files/spec/expressions/index.d.ts +0 -1
  46. package/dist/application-spec/parse-application-files/spec/expressions/memo-eval-plan.d.ts +4 -71
  47. package/dist/application-spec/parse-application-files/spec/expressions/memo-eval-plan.js +1 -1
  48. package/dist/application-spec/parse-application-files/spec/expressions/user-expressions.d.ts +2 -2
  49. package/dist/application-spec/parse-application-files/spec/invariants/invariant.d.ts +5 -21
  50. package/dist/application-spec/parse-application-files/spec/invariants/invariants.d.ts +4 -14
  51. package/dist/application-spec/parse-application-files/spec/sections/actions.d.ts +6 -23
  52. package/dist/application-spec/parse-application-files/spec/sections/app-metadata.d.ts +3 -18
  53. package/dist/application-spec/parse-application-files/spec/sections/application-version.d.ts +3 -7
  54. package/dist/application-spec/parse-application-files/spec/sections/assistant/assistant-schema.js +1 -1
  55. package/dist/application-spec/parse-application-files/spec/sections/assistant/assistant.js +1 -1
  56. package/dist/application-spec/parse-application-files/spec/sections/data-spec/chunks.d.ts +6 -23
  57. package/dist/application-spec/parse-application-files/spec/sections/data-spec/custom-data-spec.d.ts +1 -16
  58. package/dist/application-spec/parse-application-files/spec/sections/data-spec/data-entry-key.d.ts +3 -9
  59. package/dist/application-spec/parse-application-files/spec/sections/data-spec/data-spec.d.ts +1 -10
  60. package/dist/application-spec/parse-application-files/spec/sections/data-spec/swatch-data-spec.d.ts +1 -14
  61. package/dist/application-spec/parse-application-files/spec/sections/state-value.d.ts +3 -7
  62. package/dist/application-spec/parse-application-files/spec/sections/theme.d.ts +3 -10
  63. package/dist/application-spec/parse-application-files/spec/sections/transformers.d.ts +4 -11
  64. package/dist/application-spec/parse-application-files/spec/sections/ui.d.ts +3 -12
  65. package/dist/configurator/ConfiguratorApp.js +1 -1
  66. package/dist/configurator/application-runtime/extensions/systems/assistant-system/assistant-system.js +1 -1
  67. package/dist/configurator/application-runtime/extensions/systems/assistant-system/graphql-tools.d.ts +19 -3
  68. package/dist/configurator/application-runtime/extensions/systems/assistant-system/graphql-tools.js +1 -1
  69. package/dist/configurator/application-runtime/extensions/systems/graphql-system/entity-meta.d.ts +70 -56
  70. package/dist/configurator/application-runtime/extensions/systems/graphql-system/entity-meta.js +1 -1
  71. package/dist/configurator/application-runtime/extensions/systems/graphql-system/graphql-system.d.ts +15 -0
  72. package/dist/configurator/application-runtime/extensions/systems/graphql-system/graphql-system.js +1 -1
  73. package/dist/configurator/application-runtime/extensions/systems/graphql-system/violations.d.ts +40 -0
  74. package/dist/configurator/application-runtime/extensions/systems/graphql-system/violations.js +1 -0
  75. package/dist/configurator/common/configurator-interface.d.ts +2 -2
  76. package/dist/configurator/common/configurator-interface.js +1 -1
  77. package/dist/configurator/configurator-context/configurator-hooks/layout-hooks.js +1 -1
  78. package/dist/configurator/configurator-context/index.d.ts +0 -1
  79. package/dist/configurator/configurator-context/index.js +1 -1
  80. package/dist/configurator/pages/NewConfiguratorPage.js +1 -1
  81. package/dist/configurator/ui/assistant/AssistantChips.js +1 -1
  82. package/dist/configurator/ui/assistant/tool-chip.d.ts +19 -9
  83. package/dist/configurator/ui/assistant/tool-chip.js +1 -1
  84. package/dist/configurator/ui/configurator-layout/universal/DesktopPreview.js +1 -1
  85. package/dist/configurator/ui/configurator-layout/universal/MobilePreview.js +1 -1
  86. package/dist/configurator/ui/legacy/layout/common/CommonTopNavigation.js +1 -1
  87. package/dist/configurator/ui/legacy/layout/simple/SimpleTopNavigation.js +1 -1
  88. package/dist/configurator/ui/legacy/layout/steps/StepsNavigation.js +1 -1
  89. package/dist/configurator/ui/legacy/layout/steps/StepsOwnerLayout.js +1 -1
  90. package/dist/configurator/ui/phoenix-layout-elements/header/common/back-button/use-go-back-action.js +1 -1
  91. package/dist/configurator/ui/phoenix-layout-elements/header/common/step-navigation/StepsNavigation.js +1 -1
  92. package/dist/configurator/ui/phoenix-layout-elements/sidebar-footer/basic/use-basic-sidebar-footer.js +1 -1
  93. package/dist/configurator/ui/preset-layout/CategoryPresetUi.js +1 -1
  94. package/dist/configurator/ui/save-message-snackbars/SaveMessageSnackbars.js +1 -1
  95. package/dist/docs/drag-and-drop/room-planner.mdx +1 -1
  96. package/dist/docs/index.json +1 -1
  97. package/dist/docs/phoenix/configurator-interface.mdx +1 -1
  98. package/dist/docs/phoenix/layout-slots.mdx +21 -0
  99. package/dist/docs/phoenix/phoenix-cli.mdx +1 -0
  100. package/dist/domain/application/application-config.d.ts +6 -24
  101. package/dist/domain/application/assistant/assistant-manifest.d.ts +13 -3
  102. package/dist/domain/application/assistant/assistant-manifest.js +1 -1
  103. package/dist/domain/application/assistant/assistant-resolved-manifest.d.ts +5 -9
  104. package/dist/domain/application/assistant/assistant-resolved-manifest.js +1 -1
  105. package/dist/domain/application/assistant/build-assistant-lenses.js +1 -1
  106. package/dist/domain/application/assistant/build-assistant-manifest.js +1 -1
  107. package/dist/domain/application/assistant/generate-assistant-prompt.js +1 -1
  108. package/dist/domain/application/assistant/index.d.ts +3 -3
  109. package/dist/domain/application/assistant/index.js +1 -1
  110. package/dist/domain/application/assistant/session-setup/apply-assistant-setup.js +1 -1
  111. package/dist/domain/application/assistant/session-setup/assistant-setup-manifest.d.ts +2 -4
  112. package/dist/domain/application/assistant/session-setup/assistant-setup-manifest.js +1 -1
  113. package/dist/domain/application/assistant-mutations.js +1 -1
  114. package/dist/domain/available-system-components/available-system-components.d.ts +11 -0
  115. package/dist/domain/available-system-components/available-system-components.js +1 -0
  116. package/dist/domain/available-system-components/index.d.ts +1 -0
  117. package/dist/domain/available-system-components/index.js +1 -0
  118. package/dist/domain/{domain-builder.d.ts → domain-builder/domain-builder.d.ts} +2 -2
  119. package/dist/domain/domain-builder/domain-builder.js +1 -0
  120. package/dist/domain/domain-builder/index.d.ts +1 -0
  121. package/dist/domain/domain-builder/index.js +1 -0
  122. package/dist/domain/index.d.ts +2 -2
  123. package/dist/domain/index.js +1 -1
  124. package/dist/domain/spec/application/admin-pages-section.d.ts +29 -0
  125. package/dist/domain/spec/application/admin-pages.d.ts +26 -0
  126. package/dist/domain/spec/application/admin-states.d.ts +5 -0
  127. package/dist/domain/spec/application/admin-states.js +1 -0
  128. package/dist/domain/spec/application/configurator-states.d.ts +8 -0
  129. package/dist/domain/spec/application/configurator-states.js +1 -0
  130. package/dist/domain/spec/application/index.d.ts +4 -0
  131. package/dist/domain/spec/components/bindings/index.d.ts +2 -0
  132. package/dist/domain/spec/components/bindings/index.js +1 -0
  133. package/dist/domain/spec/components/bindings/read-binding.d.ts +13 -0
  134. package/dist/domain/spec/components/bindings/read-binding.js +1 -0
  135. package/dist/domain/spec/components/bindings/write-binding.d.ts +32 -0
  136. package/dist/domain/spec/components/bindings/write-binding.js +1 -0
  137. package/dist/{application-spec/parse-application-files → domain}/spec/components/component-entry.d.ts +3 -3
  138. package/dist/domain/spec/components/component-entry.js +1 -0
  139. package/dist/domain/spec/components/component-filters.d.ts +10 -0
  140. package/dist/domain/spec/components/component-filters.js +1 -0
  141. package/dist/domain/spec/components/components.d.ts +4 -0
  142. package/dist/domain/spec/components/components.js +1 -0
  143. package/dist/domain/spec/components/index.d.ts +4 -0
  144. package/dist/domain/spec/{enhanced-json-value.d.ts → enhanced-json/enhanced-json-value.d.ts} +1 -1
  145. package/dist/domain/spec/enhanced-json/index.d.ts +1 -0
  146. package/dist/domain/spec/enhanced-json/index.js +1 -0
  147. package/dist/{application-spec/parse-application-files → domain}/spec/expressions/expression.d.ts +9 -3
  148. package/dist/domain/spec/expressions/expression.js +1 -0
  149. package/dist/domain/spec/expressions/expressions.d.ts +27 -0
  150. package/dist/domain/spec/expressions/expressions.js +1 -0
  151. package/dist/domain/spec/expressions/index.d.ts +3 -0
  152. package/dist/domain/spec/expressions/memo-eval-plan.d.ts +70 -0
  153. package/dist/domain/spec/expressions/memo-eval-plan.js +1 -0
  154. package/dist/domain/spec/index.d.ts +3 -1
  155. package/dist/domain/spec/index.js +1 -1
  156. package/dist/domain/spec/invariants/index.d.ts +2 -0
  157. package/dist/domain/spec/invariants/index.js +1 -0
  158. package/dist/domain/spec/invariants/invariant.d.ts +24 -0
  159. package/dist/domain/spec/invariants/invariant.js +1 -0
  160. package/dist/domain/spec/invariants/invariants.d.ts +14 -0
  161. package/dist/domain/spec/invariants/invariants.js +1 -0
  162. package/dist/domain/spec/markers/index.d.ts +1 -0
  163. package/dist/domain/spec/markers/index.js +1 -1
  164. package/dist/domain/spec/model/defaults.d.ts +1 -1
  165. package/dist/domain/spec/sections/actions.d.ts +23 -0
  166. package/dist/domain/spec/sections/actions.js +1 -0
  167. package/dist/domain/spec/sections/app-metadata.d.ts +18 -0
  168. package/dist/domain/spec/sections/app-metadata.js +1 -0
  169. package/dist/domain/spec/sections/application-version.d.ts +7 -0
  170. package/dist/domain/spec/sections/application-version.js +1 -0
  171. package/dist/domain/spec/sections/data-spec/chunks.d.ts +23 -0
  172. package/dist/domain/spec/sections/data-spec/chunks.js +1 -0
  173. package/dist/domain/spec/sections/data-spec/custom-data-spec-entry.d.ts +16 -0
  174. package/dist/domain/spec/sections/data-spec/custom-data-spec-entry.js +1 -0
  175. package/dist/domain/spec/sections/data-spec/data-entry-key.d.ts +9 -0
  176. package/dist/domain/spec/sections/data-spec/data-entry-key.js +1 -0
  177. package/dist/domain/spec/sections/data-spec/index.d.ts +5 -0
  178. package/dist/domain/spec/sections/data-spec/index.js +1 -0
  179. package/dist/domain/spec/sections/data-spec/parsed-data-spec-entries.d.ts +10 -0
  180. package/dist/domain/spec/sections/data-spec/parsed-data-spec-entries.js +1 -0
  181. package/dist/domain/spec/sections/data-spec/swatch-data-spec-entry.d.ts +14 -0
  182. package/dist/domain/spec/sections/data-spec/swatch-data-spec-entry.js +1 -0
  183. package/dist/domain/spec/sections/index.d.ts +9 -0
  184. package/dist/domain/spec/sections/index.js +1 -0
  185. package/dist/domain/spec/sections/infra/acl.d.ts +12 -0
  186. package/dist/domain/spec/sections/infra/acl.js +1 -0
  187. package/dist/domain/spec/sections/infra/index.d.ts +3 -0
  188. package/dist/domain/spec/sections/infra/index.js +1 -0
  189. package/dist/domain/spec/sections/infra/resource-entry.d.ts +46 -0
  190. package/dist/domain/spec/sections/infra/resource-entry.js +1 -0
  191. package/dist/domain/spec/sections/infra/resources-config.d.ts +10 -0
  192. package/dist/domain/spec/sections/infra/resources-config.js +1 -0
  193. package/dist/domain/spec/sections/state-value.d.ts +7 -0
  194. package/dist/domain/spec/sections/state-value.js +1 -0
  195. package/dist/domain/spec/sections/theme.d.ts +10 -0
  196. package/dist/domain/spec/sections/theme.js +1 -0
  197. package/dist/domain/spec/sections/transformers.d.ts +15 -0
  198. package/dist/domain/spec/sections/transformers.js +1 -0
  199. package/dist/domain/spec/sections/ui.d.ts +12 -0
  200. package/dist/domain/spec/sections/ui.js +1 -0
  201. package/dist/domain/system-definitions.js +1 -1
  202. package/dist/domain/utils/index.d.ts +2 -0
  203. package/dist/domain/utils/index.js +1 -0
  204. package/dist/editor/graphql/GraphQLPanel.js +1 -1
  205. package/dist/phoenix/services/application-spec-project-watcher.js +1 -1
  206. package/dist/react-sdk/domain-application-context/ConfigurationPersistSystemFailureHandler.js +1 -1
  207. package/dist/react-sdk/index.d.ts +2 -0
  208. package/dist/react-sdk/index.js +1 -1
  209. package/dist/react-sdk/lifecycle-providers/ConfiguratorDataProvider.d.ts +8 -0
  210. package/dist/react-sdk/lifecycle-providers/ConfiguratorDataProvider.js +1 -0
  211. package/dist/react-sdk/lifecycle-providers/index.d.ts +1 -0
  212. package/dist/react-sdk/lifecycle-providers/index.js +1 -1
  213. package/dist/react-sdk/notifications/index.d.ts +1 -0
  214. package/dist/react-sdk/notifications/index.js +1 -0
  215. package/dist/react-sdk/notifications/snackbar-action-button.d.ts +30 -0
  216. package/dist/react-sdk/notifications/snackbar-action-button.js +1 -0
  217. package/dist/react-sdk/preset-selection/PresetSelectionProvider.js +1 -0
  218. package/dist/react-sdk/preset-selection/index.d.ts +1 -0
  219. package/dist/react-sdk/preset-selection/index.js +1 -0
  220. package/dist/ui-sdk/components/snackbar/Snackbar.d.ts +24 -3
  221. package/dist/ui-sdk/components/snackbar/Snackbar.js +1 -1
  222. package/dist/watch/glob-matcher.d.ts +4 -4
  223. package/dist/watch/glob-matcher.js +1 -1
  224. package/dist/watch/watch.d.ts +4 -4
  225. package/dist/watch/watch.js +1 -1
  226. package/package.json +3 -3
  227. package/dist/configurator/configurator-context/ConfiguratorDataProvider.d.ts +0 -2
  228. package/dist/configurator/configurator-context/ConfiguratorDataProvider.js +0 -1
  229. package/dist/configurator/configurator-context/PresetSelectionProvider.js +0 -1
  230. package/dist/domain/available-system-components.d.ts +0 -11
  231. package/dist/domain/available-system-components.js +0 -1
  232. package/dist/domain/domain-builder.js +0 -1
  233. /package/dist/{application-spec/parse-application-files/spec/components/component-entry.js → domain/spec/application/admin-pages-section.js} +0 -0
  234. /package/dist/{application-spec/parse-application-files/spec/expressions/expression.js → domain/spec/application/admin-pages.js} +0 -0
  235. /package/dist/domain/spec/{enhanced-json-value.js → enhanced-json/enhanced-json-value.js} +0 -0
  236. /package/dist/{application-spec/parse-application-files/spec/components → domain/spec/markers}/component-prop-target.d.ts +0 -0
  237. /package/dist/{application-spec/parse-application-files/spec/components → domain/spec/markers}/component-prop-target.js +0 -0
  238. /package/dist/{configurator/configurator-context → react-sdk/preset-selection}/PresetSelectionProvider.d.ts +0 -0
@@ -0,0 +1,9 @@
1
+ export type * from './actions.js';
2
+ export type * from './app-metadata.js';
3
+ export type * from './application-version.js';
4
+ export type * from './data-spec/index.js';
5
+ export * from './infra/index.js';
6
+ export type * from './state-value.js';
7
+ export type * from './theme.js';
8
+ export type * from './transformers.js';
9
+ export type * from './ui.js';
@@ -0,0 +1 @@
1
+ export*from"./infra/index.js";
@@ -0,0 +1,12 @@
1
+ /** The roles of `acl.canCreate`: the users who may create a configuration. */
2
+ export declare const aclRoles: readonly ['anonymous', 'user', 'admin', 'superadmin'];
3
+ /** One role of {@link aclRoles}. */
4
+ export type AclRole = (typeof aclRoles)[number];
5
+ /**
6
+ * The parsed `acl` section of the application spec: the roles that may create a configuration,
7
+ * all four when the spec declares none. Code generation passes it to the generated configurator
8
+ * builder, and the runtime spec carries it to the application.
9
+ */
10
+ export interface Acl {
11
+ readonly canCreate: readonly AclRole[];
12
+ }
@@ -0,0 +1 @@
1
+ export const aclRoles=["anonymous","user","admin","superadmin"];
@@ -0,0 +1,3 @@
1
+ export * from './acl.js';
2
+ export type * from './resource-entry.js';
3
+ export type * from './resources-config.js';
@@ -0,0 +1 @@
1
+ export*from"./acl.js";
@@ -0,0 +1,46 @@
1
+ /** A resource that links to the configuration. */
2
+ export interface ConfigurationLinkResource {
3
+ readonly type: 'ConfigurationLink';
4
+ readonly name: string;
5
+ }
6
+ /** A CSV document of the configuration, generated by the server or stored under `s3Key`. */
7
+ export interface CsvResource {
8
+ readonly type: 'Csv';
9
+ readonly name: string;
10
+ readonly s3Key?: string;
11
+ }
12
+ /** A PDF document of the configuration, generated by the server or stored under `s3Key`. */
13
+ export interface PdfResource {
14
+ readonly type: 'Pdf';
15
+ readonly name: string;
16
+ readonly s3Key?: string;
17
+ }
18
+ /** An image the client renders and uploads under `s3Key`. */
19
+ export interface ClientGeneratedImageResource {
20
+ readonly type: 'Image';
21
+ readonly name: string;
22
+ readonly clientGenerated: true;
23
+ readonly s3Key: string;
24
+ }
25
+ /** An image that already exists at `url`. */
26
+ export interface ExistingImageResource {
27
+ readonly type: 'Image';
28
+ readonly name: string;
29
+ readonly exists: true;
30
+ readonly url: string;
31
+ }
32
+ /** An image the server renders under `s3Key`. */
33
+ export interface GeneratedImageResource {
34
+ readonly type: 'Image';
35
+ readonly name: string;
36
+ readonly s3Key: string;
37
+ }
38
+ /** One of the three kinds of image resource. */
39
+ export type ImageResource = ClientGeneratedImageResource | ExistingImageResource | GeneratedImageResource;
40
+ /**
41
+ * One entry of the `resources` section of the application spec: a generated or linked resource of a
42
+ * configuration. A name identifies one resource, so no two entries share a name. Code generation
43
+ * emits the entries as an array literal, and the union of their names is the type of a resource
44
+ * name in the project's webhook and frontend code.
45
+ */
46
+ export type ResourceEntry = ConfigurationLinkResource | CsvResource | PdfResource | ImageResource;
@@ -0,0 +1 @@
1
+ export{};
@@ -0,0 +1,10 @@
1
+ /**
2
+ * The parsed `resourcesConfig` section of the application spec: the host settings of the
3
+ * resources, such as the base resources URL and the texture URLs to prefetch. `domain` exports a
4
+ * different `ResourcesConfig`, the resources part of an application config.
5
+ */
6
+ export interface SpecResourcesConfig {
7
+ readonly baseResourcesUrl?: string;
8
+ readonly prefetchTextureUrls?: readonly string[];
9
+ readonly deploymentQueryDisabled?: boolean;
10
+ }
@@ -0,0 +1,7 @@
1
+ import type { Branded } from '@salsita-ai/common/utils';
2
+ /**
3
+ * Branded state value — a valid identifier used as a state enum entry
4
+ * (e.g. "Default", "overview", "detailView").
5
+ * Used across navigation, view, tool, and export state dimensions.
6
+ */
7
+ export type StateValue = Branded<'StateValue', string>;
@@ -0,0 +1 @@
1
+ export{};
@@ -0,0 +1,10 @@
1
+ import type { Branded } from '@salsita-ai/common/utils';
2
+ /**
3
+ * Validated theme configuration for the configurator UI.
4
+ * Preset identifies a built-in theme from getPhoenixThemes(),
5
+ * options provides partial overrides passed to the theme factory.
6
+ */
7
+ export type Theme = Branded<'Theme', {
8
+ readonly preset: string;
9
+ readonly options: Readonly<Record<string, unknown>>;
10
+ }>;
@@ -0,0 +1 @@
1
+ export{};
@@ -0,0 +1,15 @@
1
+ import type { Branded } from '@salsita-ai/common/utils';
2
+ /** One declared transformer: the name its implementation is registered under, and its priority. */
3
+ export interface TransformerEntry {
4
+ readonly name: string;
5
+ readonly priority?: number;
6
+ }
7
+ /**
8
+ * Validated transformer declarations. Each transformer is applied during
9
+ * domain state transitions to enforce business rules (e.g. "fixLegsForCircleTop").
10
+ * Every entry's name must match a file basename in `src/transformers/`
11
+ * (modulo case + dashes — kebab-case files and camelCase YAML names are
12
+ * treated as equivalent since runtime matching happens on the `.build('name')`
13
+ * label, not the filename). `application-spec` exports it as `Transformers`.
14
+ */
15
+ export type SpecTransformers = Branded<'Transformers', readonly TransformerEntry[]>;
@@ -0,0 +1 @@
1
+ export{};
@@ -0,0 +1,12 @@
1
+ import type { Branded } from '@salsita-ai/common/utils';
2
+ /**
3
+ * Validated UI configuration for the configurator.
4
+ * Controls preview behavior, expansion mode, and locale settings.
5
+ */
6
+ export type Ui = Branded<'Ui', {
7
+ readonly preview?: 'always' | 'never' | 'auto' | 'hide';
8
+ readonly alwaysExpand?: boolean;
9
+ readonly appLoader?: 'legacy' | 'universal';
10
+ readonly availableLocales: readonly string[];
11
+ readonly textLanguages?: readonly string[];
12
+ }>;
@@ -0,0 +1 @@
1
+ export{};
@@ -1 +1 @@
1
- import{availableSystemComponents as e}from"./available-system-components.js";import{availableDefinitions as t}from"./core/index.js";export const getAllPhxDefinitions=()=>[...t,...e.map(e=>{let{definitions:t,...n}=e.schema;return n}),...e.flatMap(e=>Object.values(e.schema.definitions??{}).map(t=>{if("object"==typeof t&&"tsType"in t)return t;throw Error(`Schema definition in a component ${e.name} is not an extended json schema! Add a tsType to the schema.`)}))].reduce((e,t)=>{if(!t.tsType)throw Error(`Schema definition is not an extended json schema! Add a tsType to the schema. ${JSON.stringify(t)}`);return e[t.tsType]=t,e},{});
1
+ import{availableSystemComponents as e}from"./available-system-components/index.js";import{availableDefinitions as t}from"./core/index.js";export const getAllPhxDefinitions=()=>[...t,...e.map(e=>{let{definitions:t,...n}=e.schema;return n}),...e.flatMap(e=>Object.values(e.schema.definitions??{}).map(t=>{if("object"==typeof t&&"tsType"in t)return t;throw Error(`Schema definition in a component ${e.name} is not an extended json schema! Add a tsType to the schema.`)}))].reduce((e,t)=>{if(!t.tsType)throw Error(`Schema definition is not an extended json schema! Add a tsType to the schema. ${JSON.stringify(t)}`);return e[t.tsType]=t,e},{});
@@ -0,0 +1,2 @@
1
+ export { memoEval } from './memo-eval.js';
2
+ export { withProfilerLabel } from './profiler-label.js';
@@ -0,0 +1 @@
1
+ export{memoEval}from"./memo-eval.js";export{withProfilerLabel}from"./profiler-label.js";
@@ -1 +1 @@
1
- import{jsx as e,jsxs as t}from"react/jsx-runtime";import o from"@monaco-editor/react";import{Box as r,Checkbox as i,FormControlLabel as a,Stack as n,Typography as s}from"@mui/material";import{useState as l}from"react";import{EditorButton as m}from"../common/EditorButton.js";import{jsonEditorOptions as d}from"../common/monaco-config.js";import{useOptionalConfigurator as c,useOptionalDomain as p}from"../hooks/use-optional-runtime.js";import{splitOperations as u}from"./split-operations.js";let h={fontSize:"12px",fontWeight:600,color:"text.secondary"};export const GraphQLPanel=()=>{let f=c()?.graphQLSystem,g=p()?.storeSystem,[x,y]=l("query { root { id type } }"),[b,v]=l(""),[S,k]=l(!1),[j,N]=l(null),[C,w]=l(null),[z,J]=l(!1),O=async()=>{let e=u(x),t=(e=>{if(""===e.trim())return{ok:!0,variables:void 0};try{let t=JSON.parse(e);return"object"!=typeof t||null===t||Array.isArray(t)?{ok:!1,message:"Variables must be a JSON object. Wrap them in {} or clear the field."}:{ok:!0,variables:t}}catch(e){return{ok:!1,message:`Variables are not valid JSON: ${e instanceof Error?e.message:String(e)}. Fix the JSON or clear the field.`}}})(b);if(f){if(w(null),!e.ok)return void N(e.message);if(!t.ok)return void N(t.message);if(S&&!g?.isInitialized)return void N("The configuration is not loaded yet, so there is no state to run against. Run again once the configurator has finished loading.");J(!0);try{let o=e.operations.map(e=>({...e,variables:t.variables})),r=S&&g?await f.prepare(g.stateSlices.committed.value.state,o):void 0,{results:i,committed:a,message:n,sideEffects:s}=r?{results:r.map(({result:e})=>e),committed:!1,message:"Dry run: nothing was committed.",sideEffects:f.readSideEffects(r)}:await f.execute(o),l=i.map((t,o)=>({operationName:e.operations[o]?.operationName??null,...t}));N(JSON.stringify(s.length>0?{results:l,sideEffects:s}:l,null,2)),w(a?"Committed as one undo step.":n??"Nothing was committed.")}finally{J(!1)}}};return t(n,{direction:"column",spacing:1.5,sx:{px:1.5,py:1},children:[e(s,{variant:"subtitle2",sx:h,children:"Query"}),e(r,{component:"div",sx:{height:160,border:"1px solid #dee2e6"},children:e(o,{language:"graphql",value:x,onChange:e=>y(e??""),options:d})}),e(s,{variant:"subtitle2",sx:h,children:"Variables (JSON)"}),e(r,{component:"div",sx:{height:80,border:"1px solid #dee2e6"},children:e(o,{language:"json",value:b,onChange:e=>v(e??""),options:d})}),e(a,{control:e(i,{size:"small",checked:S,onChange:e=>{k(e.target.checked)},sx:{p:.5}}),label:"Dry run",sx:{ml:-.5,mr:0,"& .MuiFormControlLabel-label":{fontSize:"12px",color:"#212529"}}}),e(m,{fullWidth:!0,disabled:!f||z,onClick:()=>void O(),children:f?"Run":"Configurator is not ready"}),null!==C&&e(s,{"data-testid":"graphql-status",sx:{fontSize:"12px",color:"text.secondary"},children:C}),null!==j&&e(r,{component:"pre","data-testid":"graphql-result",sx:{m:0,p:1,fontSize:"12px",backgroundColor:"#f8f9fa",overflow:"auto",whiteSpace:"pre-wrap"},children:j})]})};
1
+ import{jsx as e,jsxs as t}from"react/jsx-runtime";import o from"@monaco-editor/react";import{Box as r,Checkbox as i,FormControlLabel as a,Stack as n,Typography as s}from"@mui/material";import{useState as l}from"react";import{EditorButton as m}from"../common/EditorButton.js";import{jsonEditorOptions as d}from"../common/monaco-config.js";import{useOptionalConfigurator as c,useOptionalDomain as p}from"../hooks/use-optional-runtime.js";import{splitOperations as u}from"./split-operations.js";let h={fontSize:"12px",fontWeight:600,color:"text.secondary"};export const GraphQLPanel=()=>{let g=c()?.graphQLSystem,f=p()?.storeSystem,[x,v]=l("query { root { id type } }"),[y,b]=l(""),[S,k]=l(!1),[j,N]=l(null),[w,C]=l(null),[z,J]=l(!1),O=async()=>{let e=u(x),t=(e=>{if(""===e.trim())return{ok:!0,variables:void 0};try{let t=JSON.parse(e);return"object"!=typeof t||null===t||Array.isArray(t)?{ok:!1,message:"Variables must be a JSON object. Wrap them in {} or clear the field."}:{ok:!0,variables:t}}catch(e){return{ok:!1,message:`Variables are not valid JSON: ${e instanceof Error?e.message:String(e)}. Fix the JSON or clear the field.`}}})(y);if(g){if(C(null),!e.ok)return void N(e.message);if(!t.ok)return void N(t.message);if(S&&!f?.isInitialized)return void N("The configuration is not loaded yet, so there is no state to run against. Run again once the configurator has finished loading.");J(!0);try{let o=e.operations.map(e=>({...e,variables:t.variables})),r=S?f?.stateSlices.committed.value.state:void 0,i=r?await g.prepare(r,o):void 0,{results:a,committed:n,message:s,sideEffects:l,warnings:m}=i&&r?{results:i.map(({result:e})=>e),committed:!1,message:"Dry run: nothing was committed.",sideEffects:g.readSideEffects(i),warnings:g.readWarnings(r,i)}:await g.execute(o),d=a.map((t,o)=>({operationName:e.operations[o]?.operationName??null,...t}));N(JSON.stringify(l.length>0||m.length>0?{results:d,...l.length>0?{sideEffects:l}:{},...m.length>0?{warnings:m}:{}}:d,null,2)),C(n?"Committed as one undo step.":s??"Nothing was committed.")}finally{J(!1)}}};return t(n,{direction:"column",spacing:1.5,sx:{px:1.5,py:1},children:[e(s,{variant:"subtitle2",sx:h,children:"Query"}),e(r,{component:"div",sx:{height:160,border:"1px solid #dee2e6"},children:e(o,{language:"graphql",value:x,onChange:e=>v(e??""),options:d})}),e(s,{variant:"subtitle2",sx:h,children:"Variables (JSON)"}),e(r,{component:"div",sx:{height:80,border:"1px solid #dee2e6"},children:e(o,{language:"json",value:y,onChange:e=>b(e??""),options:d})}),e(a,{control:e(i,{size:"small",checked:S,onChange:e=>{k(e.target.checked)},sx:{p:.5}}),label:"Dry run",sx:{ml:-.5,mr:0,"& .MuiFormControlLabel-label":{fontSize:"12px",color:"#212529"}}}),e(m,{fullWidth:!0,disabled:!g||z,onClick:()=>void O(),children:g?"Run":"Configurator is not ready"}),null!==w&&e(s,{"data-testid":"graphql-status",sx:{fontSize:"12px",color:"text.secondary"},children:w}),null!==j&&e(r,{component:"pre","data-testid":"graphql-result",sx:{m:0,p:1,fontSize:"12px",backgroundColor:"#f8f9fa",overflow:"auto",whiteSpace:"pre-wrap"},children:j})]})};
@@ -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,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 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=["package.json","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,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(`
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
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}let{application:h,changedFiles:d}=a;this.onRebuilt?.(h.applicationSpec);let 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)}}}
@@ -1 +1 @@
1
- import{jsx as r}from"react/jsx-runtime";import{Trans as i}from"@lingui/react";import{Button as e}from"@mui/material";import{useSnackbar as t}from"notistack";import{useCallback as s,useEffect as o,useMemo as n}from"react";import{pairwise as a,startWith as m}from"rxjs";import{P as l,match as p}from"ts-pattern";import{useDomainApplication as u}from"../application-runtime/index.js";import{usePatientObservableValue as c}from"../domain-context/index.js";let d="phx-configuration-persist-system-failure";export const ConfigurationPersistSystemFailureHandler=f=>((f=>{let{disabled:g=!1}=f,{configurationPersistSystem:x}=u(),{enqueueSnackbar:h,closeSnackbar:y}=t(),k=c(n(()=>x.failure$.pipe(a(),m([null,null])),[x.failure$]),[null,null],!g),j=s((t,s)=>{p([t,s]).with([null,null],()=>{}).with([l._,{error:l._}],()=>{h(r(i,{id:"sdk.persist.system.error.message",message:"An error occured when trying to update a configuration"}),{variant:"error",key:d,persist:!0,preventDuplicate:!0,action:t=>r(e,{color:"inherit",size:"small",onClick:()=>{y(t)},children:r(i,{id:"sdk.persist.system.error.dismiss",message:"Dismiss"})})})}).with([{error:l._},null],()=>{y(d),h(r(i,{id:"sdk.persist.system.error.recovered",message:"Configuration updated"}),{variant:"info"})}).exhaustive()},[h,y]),v=s(()=>{y(d)},[y]);o(()=>{g?v():j(k[0],k[1])},[g,k,j,v])})(f),null);
1
+ import{jsx as r}from"react/jsx-runtime";import{Trans as e}from"@lingui/react";import{useSnackbar as i}from"notistack";import{useCallback as t,useEffect as s,useMemo as o}from"react";import{pairwise as n,startWith as a}from"rxjs";import{P as m,match as l}from"ts-pattern";import{useDomainApplication as u}from"../application-runtime/index.js";import{usePatientObservableValue as p}from"../domain-context/index.js";let d="phx-configuration-persist-system-failure";export const ConfigurationPersistSystemFailureHandler=f=>((f=>{let{disabled:c=!1}=f,{configurationPersistSystem:g}=u(),{enqueueSnackbar:x,closeSnackbar:y}=i(),h=p(o(()=>g.failure$.pipe(n(),a([null,null])),[g.failure$]),[null,null],!c),k=t((i,t)=>{l([i,t]).with([null,null],()=>{}).with([m._,{error:m._}],()=>{x(r(e,{id:"sdk.persist.system.error.message",message:"An error occured when trying to update a configuration"}),{variant:"error",key:d,persist:!0,preventDuplicate:!0,actionButton:{label:r(e,{id:"sdk.persist.system.error.dismiss",message:"Dismiss"}),onClick:r=>{y(r)}}})}).with([{error:m._},null],()=>{y(d),x(r(e,{id:"sdk.persist.system.error.recovered",message:"Configuration updated"}),{variant:"info"})}).exhaustive()},[x,y]),j=t(()=>{y(d)},[y]);s(()=>{c?j():k(h[0],h[1])},[c,h,k,j])})(f),null);
@@ -10,9 +10,11 @@ export * from './localizable/index.js';
10
10
  export * from './loading-state/index.js';
11
11
  export * from './configurator-routing/index.js';
12
12
  export * from './integration/index.js';
13
+ export type * from './notifications/index.js';
13
14
  export * from './elements/index.js';
14
15
  export * from './scene-control-elements/index.js';
15
16
  export * from './page-elements/index.js';
16
17
  export * from './lifecycle-providers/index.js';
18
+ export * from './preset-selection/index.js';
17
19
  export * from './handlers/index.js';
18
20
  export * from './application-runtime/index.js';
@@ -1 +1 @@
1
- export*from"./theme/index.js";export*from"./utils/index.js";export*from"./session/index.js";export*from"./domain-context/index.js";export*from"./domain-application-context/index.js";export*from"./domain-controls/index.js";export*from"./invalid-deployment/index.js";export*from"./web-component/index.js";export*from"./localizable/index.js";export*from"./loading-state/index.js";export*from"./configurator-routing/index.js";export*from"./integration/index.js";export*from"./elements/index.js";export*from"./scene-control-elements/index.js";export*from"./page-elements/index.js";export*from"./lifecycle-providers/index.js";export*from"./handlers/index.js";export*from"./application-runtime/index.js";
1
+ export*from"./theme/index.js";export*from"./utils/index.js";export*from"./session/index.js";export*from"./domain-context/index.js";export*from"./domain-application-context/index.js";export*from"./domain-controls/index.js";export*from"./invalid-deployment/index.js";export*from"./web-component/index.js";export*from"./localizable/index.js";export*from"./loading-state/index.js";export*from"./configurator-routing/index.js";export*from"./integration/index.js";export*from"./elements/index.js";export*from"./scene-control-elements/index.js";export*from"./page-elements/index.js";export*from"./lifecycle-providers/index.js";export*from"./preset-selection/index.js";export*from"./handlers/index.js";export*from"./application-runtime/index.js";
@@ -0,0 +1,8 @@
1
+ import type { PropsWithChildren } from 'react';
2
+ /**
3
+ * Runs the configurator's data stages in order, published, frontend and backend data, each
4
+ * followed by its `On*DataReady` provider.
5
+ *
6
+ * @internal Runtime plumbing for the SDK's own configurator application, which runs it at its root.
7
+ */
8
+ export declare const ConfiguratorDataProvider: ({ children }: PropsWithChildren) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1 @@
1
+ import{jsx as r}from"react/jsx-runtime";import{BackendDataProvider as i,FrontendDataProvider as e,PublishedDataProvider as o}from"../domain-application-context/index.js";import{OnBackendDataReadyProvider as n,OnFrontendDataReadyProvider as c,OnPublishedDataReadyProvider as t}from"./LifecycleProviders.js";export const ConfiguratorDataProvider=({children:d})=>r(o,{children:r(t,{children:r(e,{children:r(c,{children:r(i,{children:r(n,{children:d})})})})})});
@@ -1 +1,2 @@
1
1
  export * from './LifecycleProviders.js';
2
+ export { ConfiguratorDataProvider } from './ConfiguratorDataProvider.js';
@@ -1 +1 @@
1
- export*from"./LifecycleProviders.js";
1
+ export*from"./LifecycleProviders.js";export{ConfiguratorDataProvider}from"./ConfiguratorDataProvider.js";
@@ -0,0 +1 @@
1
+ export type { SnackbarActionButton } from './snackbar-action-button.js';
@@ -0,0 +1 @@
1
+ export{};
@@ -0,0 +1,30 @@
1
+ import type { SnackbarKey } from 'notistack';
2
+ import type { ReactNode } from 'react';
3
+ /**
4
+ * A button a snackbar shows after its message, described as data instead of as an element.
5
+ *
6
+ * The code that raises a snackbar passes it as the `actionButton` option of notistack's `enqueueSnackbar`, so it
7
+ * needs no UI component. The themed snackbar of the configurator and the admin renders it in its `actionButton`
8
+ * slot, which the theme styles as `PhxSnackbar`. `onClick` receives the snackbar's key, for example to close the
9
+ * snackbar with `closeSnackbar`.
10
+ */
11
+ export interface SnackbarActionButton {
12
+ /** The button's text. */
13
+ readonly label: ReactNode;
14
+ /** Called with the key of the snackbar whose button was clicked. */
15
+ readonly onClick: (key: SnackbarKey) => void;
16
+ }
17
+ type SnackbarActionButtonOptions = {
18
+ /** A button shown after the message, see `SnackbarActionButton`. */
19
+ readonly actionButton?: SnackbarActionButton;
20
+ };
21
+ declare module 'notistack' {
22
+ interface VariantOverrides {
23
+ default: SnackbarActionButtonOptions;
24
+ info: SnackbarActionButtonOptions;
25
+ success: SnackbarActionButtonOptions;
26
+ warning: SnackbarActionButtonOptions;
27
+ error: SnackbarActionButtonOptions;
28
+ }
29
+ }
30
+ export {};
@@ -0,0 +1 @@
1
+ import{jsx as e}from"react/jsx-runtime";import{useMutation as t}from"@tanstack/react-query";import{useSnackbar as i}from"notistack";import{useSubscription as r}from"observable-hooks";import{createContext as o,useCallback as n,useContext as s,useEffect as a,useMemo as l,useState as m}from"react";import{skip as p}from"rxjs";import{match as d}from"ts-pattern";import{AuthorizedClient as c,LocalStorageAuthorizedPhoenixApiClient as g,MemoryAuthorizedPhoenixApiClient as u}from"#package/client";import{SYSTEM_CHUNK_KEY as f,standardWebComponentProperties as h}from"#package/domain";import{ApplicationRoutes as y,FrontendAnalyticsFactory as x,useAnalyticsService as P,useAuthenticatedClient as v,useConfiguratorDomainFactory as w,useIsDev as C,useLogger as T,usePersistenceConfig as D,usePublishedData as S,useRoutingSelectors as k,useSessionService as E,useSpecPresetSeed as b,useWebComponentProperty$ as j}from"../application-runtime/index.js";import{useConfiguratorRouting as A}from"../configurator-routing/index.js";import{useOnPresetLoadedHandler as I}from"../domain-application-context/index.js";import{useEagerObservableValue as V}from"../domain-context/index.js";import{useResolveLocalizable as $}from"../localizable/index.js";let F={id:"sdk.presets.create.error.message",message:"Could not start configuring from this preset. Please try again."},M={id:"sdk.presets.create.error.dismiss.label",message:"Dismiss"},R="phx-preset-creation-error";export const PresetSelectionContext=o(null);export const usePresetSelection=()=>{let e=s(PresetSelectionContext);if(null===e)throw Error("usePresetSelection must be used within a PresetSelectionProvider!");return e};let q=e=>t=>null===e||void 0!==t.tags&&t.tags.some(t=>e.includes(t));export const PresetSelectionProvider=o=>{let{children:s}=o,[z,B]=m(null),[U,G]=m(null),H=b(),J=v(),K=P(),L=D(),N=w(),O=C(),Q=$(),{requestSessionToken:W}=E(),X=T(),Y=A(),Z=k(),_=S(),{enqueueSnackbar:ee,closeSnackbar:et}=i(),ei=j(h.presetTags),er=V(ei),eo=I();r(l(()=>ei.pipe(p(1)),[ei]),()=>{Z.getRoutingState().route!==y.Index&&Y.goToIndex()}),a(()=>{G(null),et(R)},[O,et]);let{mutate:en}=t({mutationFn:n(async e=>{let{getData:t,name:i}=e,{rootEntityType:r,entities:o,modelVersion:n}=await t(),s=N.validateAndMigrateState(o,n);K.push(x.ProductSelected(r,Q(i)));let a=eo?await eo(s):s;return J.createConfiguration({rootEntityType:r,data:a})},[N,K,Q,J,eo]),onSuccess:e=>{Y.goToConfigurationDetail(e.configurationId,e.accessToken)},onError:(e,t)=>{X.error("Failed to create a new configuration from a preset!",{name:t.name},e),G(e)},onSettled:()=>{B(null)}}),es=l(()=>{let e,t=(e=f in _?_[f].presetCategories:_.presetCategories,{publishedPresetCategories:(e??[]).map(e=>({...e,presets:e.presets.filter(q(er))})).filter(e=>e.presets.length>0),seedPresets:H.filter(q(er))});return t.publishedPresetCategories.length>0?t.publishedPresetCategories.map(e=>({id:e.id,name:e.name,description:e.description,img:e.img,imgAlt:e.imgAlt,presets:e.presets.map(e=>({id:e.configurationId,name:e.name,description:e.description,img:e?.img,imgAlt:e?.imgAlt,detailTitle:e?.detailTitle,detailDescription:e?.detailDescription,getData:async()=>{let t=d(L).with({type:"server"},t=>new c(t.serverUrl,()=>e.readToken,W)).with({type:"local-storage"},()=>new g(N.modelVersion)).with({type:"memory"},()=>new u(N.modelVersion)).exhaustive(),i=await t.getConfigurationRevision(e.configurationId,e.revisionId);return{entities:i.data,rootEntityType:i.rootEntityType,modelVersion:i.modelVersion}}}))})):t.seedPresets.length>0?[{id:"Default",name:"Default Category",presets:t.seedPresets.map((e,t)=>({id:`${t}`,name:e.name??`${e.rootEntityType} preset - ${t}`,description:e.description??"",img:e.img,imgAlt:e.imgAlt,detailTitle:e.detailTitle,detailDescription:e.detailDescription,getData:async()=>({entities:e.initialDomainEntities,rootEntityType:e.rootEntityType,modelVersion:N.modelVersion})}))}]:[]},[_,W,L,N,er,H]),ea=l(()=>es.flatMap(e=>e.presets),[es]),el=n(e=>{let t=ea.find(t=>t.id===e);if(void 0===t)throw Error(`Preset with id ${e} not found!`);let{getData:i,name:r}=t,o=!O&&ea.length>1;G(null),B(e),en({getData:i,name:r},{onError:()=>{o&&(et(R),ee(Q(F),{variant:"error",key:R,persist:!0,preventDuplicate:!0,actionButton:{label:Q(M),onClick:e=>{G(null),et(e)}}}))}})},[ea,O,en,ee,et,Q]),em=ea.length>1,ep=l(()=>({hasMultiplePresets:em,presetCategories:es,selectPreset:el,selectionError:U,creatingPresetId:z}),[el,em,es,U,z]);return e(PresetSelectionContext.Provider,{value:ep,children:s})};
@@ -0,0 +1 @@
1
+ export { usePresetSelection, type UsePresetSelection, PresetSelectionProvider, type PresetSelectionProviderProps, } from './PresetSelectionProvider.js';
@@ -0,0 +1 @@
1
+ export{usePresetSelection,PresetSelectionProvider}from"./PresetSelectionProvider.js";
@@ -1,6 +1,6 @@
1
- import type { AlertProps, ComponentsOverrides, ComponentsVariants } from '@mui/material';
2
- import type { CustomContentProps, SnackbarContentProps } from 'notistack';
3
- import type { ElementType } from 'react';
1
+ import type { AlertProps, ButtonProps, ComponentsOverrides, ComponentsVariants } from '@mui/material';
2
+ import type { CustomContentProps, SnackbarContentProps, SnackbarKey } from 'notistack';
3
+ import type { ElementType, ReactNode } from 'react';
4
4
  import type { ValueOf } from '@salsita-ai/common/utils';
5
5
  /**
6
6
  * Centralized registry of CSS class names for notistack's Snackbar components.
@@ -40,6 +40,7 @@ declare module '@mui/material/styles' {
40
40
  declare const Slots: {
41
41
  readonly Content: 'content';
42
42
  readonly Alert: 'alert';
43
+ readonly ActionButton: 'actionButton';
43
44
  };
44
45
  type PhxSnackbarSlots = ValueOf<typeof Slots>;
45
46
  export declare const SnackbarVariant: {
@@ -49,7 +50,24 @@ export declare const SnackbarVariant: {
49
50
  readonly Warning: 'warning';
50
51
  readonly Error: 'error';
51
52
  };
53
+ /**
54
+ * A button the snackbar shows after its message, described as data by the code that raises the snackbar.
55
+ *
56
+ * It arrives as the `actionButton` option of notistack's `enqueueSnackbar`, which `SnackbarActionButton` of
57
+ * `@salsita-ai/sdk/react` types, and renders in the `actionButton` slot, so the raising code needs no UI component and
58
+ * the theme decides the button's look.
59
+ */
60
+ interface SnackbarActionButtonDescription {
61
+ /** The button's text. */
62
+ readonly label: ReactNode;
63
+ /** Called with the key of the snackbar whose button was clicked. */
64
+ readonly onClick: (key: SnackbarKey) => void;
65
+ }
52
66
  export interface SnackbarProps extends Readonly<CustomContentProps> {
67
+ /**
68
+ * A button shown after the message and after `action`, rendered in the `actionButton` slot.
69
+ */
70
+ readonly actionButton?: SnackbarActionButtonDescription;
53
71
  /**
54
72
  * The components used for each slot inside the `Snackbar`.
55
73
  *
@@ -58,6 +76,7 @@ export interface SnackbarProps extends Readonly<CustomContentProps> {
58
76
  *
59
77
  * - `content` — The outer snackbar container (notistack's `SnackbarContent`).
60
78
  * - `alert` — The inner alert component displaying the message (`MuiAlert`).
79
+ * - `actionButton` — The button of `actionButton` (`MuiButton`, `color="inherit"`, `size="small"`).
61
80
  *
62
81
  * @default {}
63
82
  */
@@ -71,12 +90,14 @@ export interface SnackbarProps extends Readonly<CustomContentProps> {
71
90
  * Available slot keys:
72
91
  * - `content` — Props for the snackbar content wrapper.
73
92
  * - `alert` — Props for the alert component (severity, variant, etc.).
93
+ * - `actionButton` — Props for the button of `actionButton`.
74
94
  *
75
95
  * @default { alert: { variant: 'standard' } }
76
96
  */
77
97
  readonly slotProps?: Partial<{
78
98
  readonly [Slots.Content]: SnackbarContentProps;
79
99
  readonly [Slots.Alert]: AlertProps;
100
+ readonly [Slots.ActionButton]: ButtonProps;
80
101
  }>;
81
102
  }
82
103
  /**
@@ -1 +1 @@
1
- import{jsx as t}from"react/jsx-runtime";import{Alert as a,styled as r,useThemeProps as n}from"@mui/material";import{SnackbarContent as e}from"notistack";import{forwardRef as o,useMemo as i}from"react";import{match as c}from"ts-pattern";export const notistackSnackbarClasses={container:"notistack-SnackbarContainer",snackbar:"notistack-Snackbar"};let s="PhxSnackbar",l={Content:r(e,{name:s,slot:"content"})({display:"block"}),Alert:r(a,{name:s,slot:"alert"})({userSelect:"none"})};export const SnackbarVariant={Default:"default",Info:"info",Success:"success",Warning:"warning",Error:"error"};export const Snackbar=o((a,r)=>{let{action:e,id:o,message:k,slotProps:m={alert:{variant:"standard"}},slots:f={},variant:p="info"}=n({props:a,name:s}),S=f.content??l.Content,b=f.alert??l.Alert,u=i(()=>{if(e)return"function"==typeof e?e(o):e},[e,o]);return t(S,{...m.content,ref:r,children:t(b,{...m.alert,severity:c(p).with(SnackbarVariant.Error,()=>p).with(SnackbarVariant.Info,()=>p).with(SnackbarVariant.Success,()=>p).with(SnackbarVariant.Warning,()=>p).otherwise(()=>SnackbarVariant.Info),action:u,"aria-atomic":"true","aria-live":"polite",children:k})})});
1
+ import{jsx as t,jsxs as n,Fragment as a}from"react/jsx-runtime";import{Alert as r,Button as o,styled as i,useThemeProps as e}from"@mui/material";import{SnackbarContent as c}from"notistack";import{forwardRef as s,useMemo as l}from"react";import{match as m}from"ts-pattern";export const notistackSnackbarClasses={container:"notistack-SnackbarContainer",snackbar:"notistack-Snackbar"};let k="PhxSnackbar",u={Content:i(c,{name:k,slot:"content"})({display:"block"}),Alert:i(r,{name:k,slot:"alert"})({userSelect:"none"}),ActionButton:i(o,{name:k,slot:"actionButton"})({})};export const SnackbarVariant={Default:"default",Info:"info",Success:"success",Warning:"warning",Error:"error"};export const Snackbar=s((r,o)=>{let{action:i,actionButton:c,id:s,message:f,slotProps:b={alert:{variant:"standard"}},slots:p={},variant:S="info"}=e({props:r,name:k}),h=p.content??u.Content,d=p.alert??u.Alert,x=p.actionButton??u.ActionButton,w=l(()=>{if(i)return"function"==typeof i?i(s):i},[i,s]),B=l(()=>void 0===c?w:n(a,{children:[w,t(x,{color:"inherit",size:"small",...b.actionButton,onClick:()=>{c.onClick(s)},children:c.label})]}),[x,c,s,w,b.actionButton]);return t(h,{...b.content,ref:o,children:t(d,{...b.alert,severity:m(S).with(SnackbarVariant.Error,()=>S).with(SnackbarVariant.Info,()=>S).with(SnackbarVariant.Success,()=>S).with(SnackbarVariant.Warning,()=>S).otherwise(()=>SnackbarVariant.Info),action:B,"aria-atomic":"true","aria-live":"polite",children:f})})});
@@ -4,7 +4,7 @@ interface PathOperations {
4
4
  readonly sep: string;
5
5
  }
6
6
  /**
7
- * Build a chokidar v4 `ignored` callback from include + exclude glob arrays.
7
+ * Build a chokidar `ignored` callback from include + exclude glob arrays.
8
8
  *
9
9
  * Internal helper for {@link watch | the watch shim} in `./watch.ts`. Not part of the
10
10
  * public surface — consumers pass glob strings to `watch(...)` and this conversion
@@ -14,15 +14,15 @@ interface PathOperations {
14
14
  * - excludes are checked first against every path (file or directory). Patterns ending in
15
15
  * `/**` are auto-expanded to also match the bare directory form so chokidar prunes the
16
16
  * subtree instead of walking it.
17
- * - for directories, includes are not applied — chokidar must descend to find matching files.
18
- * - for files (or when stats is unavailable), includes are required when non-empty.
17
+ * - directories descend only towards an included literal file or within an included glob's prefix.
18
+ * - files require an include match when non-empty; discovery without stats remains permissive.
19
19
  */
20
20
  export declare const createWatchIgnoreMatcher: (params: {
21
21
  readonly includes?: readonly string[];
22
22
  readonly excludes?: readonly string[];
23
23
  /**
24
24
  * If set, absolute paths passed to the predicate are converted to paths relative to
25
- * this directory before being matched. Chokidar v4 passes absolute paths to `ignored`
25
+ * this directory before being matched. Chokidar passes absolute paths to `ignored`
26
26
  * even when `cwd` is set, but the include/exclude globs in this codebase are written
27
27
  * relative to the project root — this option bridges that.
28
28
  */
@@ -1 +1 @@
1
- import*as t from"node:path";import e from"picomatch";export const createWatchIgnoreMatcher=o=>{let{includes:r=[],excludes:n=[],cwd:l,pathOperations:s=t}=o,i=r.length>0?e([...r]):null,c=n.length>0?e((t=>{let e=[];for(let o of t)e.push(o),o.endsWith("/**")&&e.push(o.slice(0,-3));return e})(n)):null;return(t,e)=>{let o,r=(""===(o=l?s.relative(l,t):t)?".":o).split(s.sep).join("/");return!!c?.(r)||!!e&&!!e.isFile()&&!(!i||i(r))}};export const deriveWatchRoot=t=>{let e=t.split("/"),o=e.findIndex(t=>/[*?[{]/.test(t));return -1===o?t:0===o?".":e.slice(0,o).join("/")};let o=/[*?[{]/;export const containsGlob=t=>o.test(t);export const isRecursiveGlob=t=>t.includes("**");
1
+ import*as e from"node:path";import t from"picomatch";export const createWatchIgnoreMatcher=o=>{let{includes:s=[],excludes:r=[],cwd:i,pathOperations:l=e}=o,n="\\"===l.sep?e.win32.isAbsolute:e.posix.isAbsolute,p=e=>{let t=i?l.relative(i,e):e;return(""===t?".":t).split(l.sep).join("/")},c=s.map(e=>(i&&n(e)?p(e):e.split(l.sep).join("/")).replace(/^\.\/+/,"")),a=c.length>0?t(c):null,h=r.length>0?t((e=>{let t=[];for(let o of e)t.push(o),o.endsWith("/**")&&t.push(o.slice(0,-3));return t})(r)):null,u=c.map(e=>({path:deriveWatchRoot(e),isGlob:containsGlob(e)})),m=(e,t)=>{let o=l.relative(t,e);return""!==o&&".."!==o&&!o.startsWith(`..${l.sep}`)&&!n(o)};return(e,t)=>{let o=p(e);return!!h?.(o)||(t?.isDirectory()&&u.length>0?!u.some(({path:e,isGlob:t})=>m(e,o)||t&&(""===l.relative(e,o)||m(o,e))):!!t&&!!t.isFile()&&!(!a||a(o)))}};export const deriveWatchRoot=e=>{let t=e.split("/"),o=t.findIndex(e=>/[*?[{]/.test(e));return -1===o?e:0===o?".":t.slice(0,o).join("/")};let o=/[*?[{]/;export const containsGlob=e=>o.test(e);export const isRecursiveGlob=e=>e.includes("**");
@@ -16,10 +16,11 @@ export interface WatchOptions {
16
16
  * Watch files/directories with the chokidar v3 calling convention — accepts glob
17
17
  * strings for both `paths` and `ignored`.
18
18
  *
19
- * Backed by chokidar v4 internally (v4 dropped glob support; this shim restores it).
19
+ * Backed by chokidar's current concrete-path API; this shim supplies the glob filters.
20
20
  * Each input glob is classified:
21
21
  *
22
- * - **Concrete path** (no glob chars): added to watch roots as-is.
22
+ * - **Concrete path** (no glob chars): added as-is; with active glob filters an existing file's parent
23
+ * is watched instead, while the file's exact path stays in the include filter.
23
24
  * - **Recursive glob** (contains `**`): the prefix is used as the watch root, the full
24
25
  * pattern stays as an include filter so new files matching the glob still trigger events.
25
26
  * Example: `spec/**\/*.{yaml,yml}` → watches `spec/`, filters to `*.yaml`/`*.yml`.
@@ -27,8 +28,7 @@ export interface WatchOptions {
27
28
  * root, the full pattern stays as an include filter so new files matching the glob
28
29
  * still trigger events.
29
30
  *
30
- * Watch roots that don't exist at call time are dropped silently (chokidar v4 emits
31
- * `error` events for missing paths otherwise).
31
+ * Native roots missing at call time are dropped; other explicit inputs may still cover later files.
32
32
  *
33
33
  * Returns chokidar's `FSWatcher` — the `.on()` / `.close()` event API is unchanged.
34
34
  */
@@ -1 +1 @@
1
- import{watch as e}from"chokidar";import{statSync as t}from"node:fs";import{resolve as r}from"node:path";import{containsGlob as o,createWatchIgnoreMatcher as n,deriveWatchRoot as i,isRecursiveGlob as l}from"./glob-matcher.js";export const watch=(d,f)=>{let a=f?.cwd??process.cwd(),h=f?.ignored==null?[]:"string"==typeof f.ignored?[f.ignored]:f.ignored,p=[],g=[],c=new Set;for(let e of"string"==typeof d?[d]:d){if(!o(e)){t(r(a,e),{throwIfNoEntry:!1})&&(c.add(e),g.push(e));continue}if(!l(e)){p.push(e);let o=i(e);t(r(a,o),{throwIfNoEntry:!1})&&c.add(o);continue}p.push(e);let n=i(e);t(r(a,n),{throwIfNoEntry:!1})&&c.add(n)}if(p.length>0)for(let e of g){let o=t(r(a,e),{throwIfNoEntry:!1});p.push(o?.isDirectory()?`${e}/**/*`:e)}let u=[...c];return 0===u.length?s():e(u,{cwd:a,persistent:f?.persistent,ignoreInitial:f?.ignoreInitial,usePolling:f?.usePolling,interval:f?.interval,ignored:n({includes:p.length>0?p:void 0,excludes:h,cwd:a})})};let s=()=>{let t=e([],{persistent:!1});return setImmediate(()=>t.emit("ready")),t};
1
+ import{watch as e}from"chokidar";import{statSync as t}from"node:fs";import{dirname as r,resolve as o}from"node:path";import{containsGlob as i,createWatchIgnoreMatcher as n,deriveWatchRoot as l,isRecursiveGlob as s}from"./glob-matcher.js";export const watch=(a,f)=>{let p=f?.cwd??process.cwd(),g=f?.ignored==null?[]:"string"==typeof f.ignored?[f.ignored]:f.ignored,h=[],c=new Map,m=new Set;for(let e of"string"==typeof a?[a]:a){if(!i(e)){let r=t(o(p,e),{throwIfNoEntry:!1});r&&(m.add(e),c.set(e,r));continue}if(!s(e)){let r=l(e);t(o(p,r),{throwIfNoEntry:!1})&&(m.add(r),h.push(e));continue}let r=l(e);t(o(p,r),{throwIfNoEntry:!1})&&(m.add(r),h.push(e))}if(h.length>0)for(let[e,t]of c)h.push(t.isDirectory()?`${e}/**/*`:e),t.isFile()&&(m.delete(e),m.add(r(e)));let u=[...m];return 0===u.length?d():e(u,{cwd:p,persistent:f?.persistent,ignoreInitial:f?.ignoreInitial,usePolling:f?.usePolling,interval:f?.interval,ignored:n({includes:h.length>0?h:void 0,excludes:g,cwd:p})})};let d=()=>{let t=e([],{persistent:!1});return setImmediate(()=>t.emit("ready")),t};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@salsita-ai/sdk",
3
- "version": "0.50.0-develop.ca5894b56c",
3
+ "version": "0.50.0-develop.cba048b0d7",
4
4
  "description": "TypeScript SDK and CLI for building, running, and deploying Phoenix configurator applications.",
5
5
  "keywords": [
6
6
  "salsita",
@@ -308,8 +308,8 @@
308
308
  "yaml": "2.9.0",
309
309
  "yargs": "17.7.2",
310
310
  "zod": "3.25.76",
311
- "@salsita-ai/common": "0.50.0-develop.ca5894b56c",
312
- "@salsita-ai/contracts": "0.50.0-develop.ca5894b56c"
311
+ "@salsita-ai/common": "0.50.0-develop.cba048b0d7",
312
+ "@salsita-ai/contracts": "0.50.0-develop.cba048b0d7"
313
313
  },
314
314
  "devDependencies": {
315
315
  "@clerk/clerk-react": "5.61.8",
@@ -1,2 +0,0 @@
1
- import type { PropsWithChildren } from 'react';
2
- export declare const ConfiguratorDataProvider: ({ children }: PropsWithChildren) => import("react/jsx-runtime").JSX.Element;
@@ -1 +0,0 @@
1
- import{jsx as r}from"react/jsx-runtime";import{BackendDataProvider as e,FrontendDataProvider as i,OnBackendDataReadyProvider as c,OnFrontendDataReadyProvider as n,OnPublishedDataReadyProvider as o,PublishedDataProvider as t}from"#package/react-sdk";export const ConfiguratorDataProvider=({children:a})=>r(t,{children:r(o,{children:r(i,{children:r(n,{children:r(e,{children:r(c,{children:a})})})})})});
@@ -1 +0,0 @@
1
- import{jsx as e}from"react/jsx-runtime";import{Button as t}from"@mui/material";import{useMutation as r}from"@tanstack/react-query";import{useSnackbar as i}from"notistack";import{useSubscription as o}from"observable-hooks";import{createContext as s,useCallback as n,useContext as a,useEffect as l,useMemo as m,useState as d}from"react";import{skip as p}from"rxjs";import{match as c}from"ts-pattern";import{AuthorizedClient as g,LocalStorageAuthorizedPhoenixApiClient as u,MemoryAuthorizedPhoenixApiClient as f}from"#package/client";import{SYSTEM_CHUNK_KEY as h,standardWebComponentProperties as y}from"#package/domain";import{ApplicationRoutes as P,FrontendAnalyticsFactory as v,useAnalyticsService as w,useAuthenticatedClient as C,useConfiguratorDomainFactory as T,useConfiguratorRouting as k,useEagerObservableValue as x,useIsDev as D,useLogger as S,useOnPresetLoadedHandler as E,usePersistenceConfig as b,usePublishedData as A,useResolveLocalizable as I,useRoutingSelectors as V,useSessionService as $,useSpecPresetSeed as j,useWebComponentProperty$ as F}from"#package/react-sdk";let M={id:"sdk.presets.create.error.message",message:"Could not start configuring from this preset. Please try again."},R={id:"sdk.presets.create.error.dismiss.label",message:"Dismiss"},q="phx-preset-creation-error";export const PresetSelectionContext=s(null);export const usePresetSelection=()=>{let e=a(PresetSelectionContext);if(null===e)throw Error("usePresetSelection must be used within a PresetSelectionProvider!");return e};let z=e=>t=>null===e||void 0!==t.tags&&t.tags.some(t=>e.includes(t));export const PresetSelectionProvider=s=>{let{children:a}=s,[U,B]=d(null),[G,H]=d(null),J=j(),K=C(),L=w(),N=b(),O=T(),Q=D(),W=I(),{requestSessionToken:X}=$(),Y=S(),Z=k(),_=V(),ee=A(),{enqueueSnackbar:et,closeSnackbar:er}=i(),ei=F(y.presetTags),eo=x(ei),es=E();o(m(()=>ei.pipe(p(1)),[ei]),()=>{_.getRoutingState().route!==P.Index&&Z.goToIndex()}),l(()=>{H(null),er(q)},[Q,er]);let{mutate:en}=r({mutationFn:n(async e=>{let{getData:t,name:r}=e,{rootEntityType:i,entities:o,modelVersion:s}=await t(),n=O.validateAndMigrateState(o,s);L.push(v.ProductSelected(i,W(r)));let a=es?await es(n):n;return K.createConfiguration({rootEntityType:i,data:a})},[O,L,W,K,es]),onSuccess:e=>{Z.goToConfigurationDetail(e.configurationId,e.accessToken)},onError:(e,t)=>{Y.error("Failed to create a new configuration from a preset!",{name:t.name},e),H(e)},onSettled:()=>{B(null)}}),ea=m(()=>{let e,t=(e=h in ee?ee[h].presetCategories:ee.presetCategories,{publishedPresetCategories:(e??[]).map(e=>({...e,presets:e.presets.filter(z(eo))})).filter(e=>e.presets.length>0),seedPresets:J.filter(z(eo))});return t.publishedPresetCategories.length>0?t.publishedPresetCategories.map(e=>({id:e.id,name:e.name,description:e.description,img:e.img,imgAlt:e.imgAlt,presets:e.presets.map(e=>({id:e.configurationId,name:e.name,description:e.description,img:e?.img,imgAlt:e?.imgAlt,detailTitle:e?.detailTitle,detailDescription:e?.detailDescription,getData:async()=>{let t=c(N).with({type:"server"},t=>new g(t.serverUrl,()=>e.readToken,X)).with({type:"local-storage"},()=>new u(O.modelVersion)).with({type:"memory"},()=>new f(O.modelVersion)).exhaustive(),r=await t.getConfigurationRevision(e.configurationId,e.revisionId);return{entities:r.data,rootEntityType:r.rootEntityType,modelVersion:r.modelVersion}}}))})):t.seedPresets.length>0?[{id:"Default",name:"Default Category",presets:t.seedPresets.map((e,t)=>({id:`${t}`,name:e.name??`${e.rootEntityType} preset - ${t}`,description:e.description??"",img:e.img,imgAlt:e.imgAlt,detailTitle:e.detailTitle,detailDescription:e.detailDescription,getData:async()=>({entities:e.initialDomainEntities,rootEntityType:e.rootEntityType,modelVersion:O.modelVersion})}))}]:[]},[ee,X,N,O,eo,J]),el=m(()=>ea.flatMap(e=>e.presets),[ea]),em=n(r=>{let i=el.find(e=>e.id===r);if(void 0===i)throw Error(`Preset with id ${r} not found!`);let{getData:o,name:s}=i,n=!Q&&el.length>1;H(null),B(r),en({getData:o,name:s},{onError:()=>{n&&(er(q),et(W(M),{variant:"error",key:q,persist:!0,preventDuplicate:!0,action:r=>e(t,{color:"inherit",size:"small",onClick:()=>{H(null),er(r)},children:W(R)})}))}})},[el,Q,en,et,er,W]),ed=el.length>1,ep=m(()=>({hasMultiplePresets:ed,presetCategories:ea,selectPreset:em,selectionError:G,creatingPresetId:U}),[em,ed,ea,G,U]);return e(PresetSelectionContext.Provider,{value:ep,children:a})};
@@ -1,11 +0,0 @@
1
- import { type SystemComponentTypeConstraint } from './core/index.js';
2
- /**
3
- * All components that are available in the domain spec and can be defined in yaml.
4
- *
5
- * To add a new component the domain spec, add it to this array
6
- */
7
- export declare const availableSystemComponents: [import("./index.js").SystemComponentType<"applicationConfig", import("./index.js").ApplicationConfigComponentState, never>, import("./index.js").SystemComponentType<"price", import("./index.js").PriceComponentState, never>, import("./index.js").SystemComponentType<"detail", import("./index.js").DetailComponentState, never>, import("./index.js").SystemComponentType<"canvasConfig", import("./index.js").CanvasConfigComponentState, never>, import("./index.js").SystemComponentType<"canvasCustomEnvironment", import("./index.js").CanvasCustomEnvironmentComponentState, never>, import("./index.js").SystemComponentType<"canvasPresetEnvironment", import("./index.js").CanvasPresetEnvironmentComponentState, never>, import("./index.js").SystemComponentType<"dimensionIndicator", import("./index.js").DimensionIndicatorComponentState, never>, import("./index.js").SystemComponentType<"angleIndicator", import("./index.js").AngleIndicatorComponentState, never>, import("./index.js").SystemComponentType<"dragHandle", import("./index.js").DragHandleComponentState, "draggableRotationY" | "draggableX" | "draggableY" | "draggableZ">, import("./index.js").SystemComponentType<"rotationHandle", import("./index.js").RotationHandleComponentState, never>, import("./index.js").SystemComponentType<"rotatable", import("./index.js").RotatableComponentState, "rotation">, import("./index.js").SystemComponentType<"sketching", import("./index.js").SketchingComponentState, never>, import("./index.js").SystemComponentType<"sketchingDraw", import("./index.js").SketchingDrawComponentState, never>, import("./index.js").SystemComponentType<"sketchingEdit", import("./index.js").SketchingEditComponentState, never>, import("./index.js").SystemComponentType<"sketchingLine", import("./index.js").SketchingLineComponentState, "angle" | "length" | "x" | "y">, import("./index.js").SystemComponentType<"sketchingRectangle", import("./index.js").SketchingRectangleComponentState, "angle" | "depth" | "width" | "x" | "y">, import("./index.js").SystemComponentType<"sceneEntityRemoteObject", import("./index.js").SceneEntityRemoteObjectComponentState, never>, import("./index.js").SystemComponentType<"sceneEntityObject", import("./index.js").SceneEntityObjectComponentState, never>, import("./index.js").SystemComponentType<"customSceneEntity", import("./index.js").CustomSceneEntityComponentState, never>, import("./index.js").SystemComponentType<"sceneEntityWallObject", import("./index.js").SceneEntityWallObjectComponentState, never>, import("./index.js").SystemComponentType<"sceneEntityFloorObject", import("./index.js").SceneEntityFloorObjectComponentState, never>, import("./index.js").SystemComponentType<"sceneEntityBoxObject", import("./index.js").SceneEntityBoxObjectComponentState, never>, import("./index.js").SystemComponentType<"sceneEntityAmbientLight", import("./index.js").SceneEntityAmbientLightComponentState, never>, import("./index.js").SystemComponentType<"sceneEntityDirectionalLight", import("./index.js").SceneEntityDirectionalLightComponentState, never>, import("./index.js").SystemComponentType<"sceneEntityPointLight", import("./index.js").SceneEntityPointLightComponentState, never>, import("./index.js").SystemComponentType<"sceneEntityRectAreaLight", import("./index.js").SceneEntityRectAreaLightComponentState, never>, import("./index.js").SystemComponentType<"sceneEntitySpotLight", import("./index.js").SceneEntitySpotLightComponentState, never>, import("./index.js").SystemComponentType<"sceneEntityProperties", import("./index.js").SceneEntityPropertiesComponentState, never>, import("./index.js").SystemComponentType<"sceneEntityObjectProperties", import("./index.js").SceneEntityObjectPropertiesComponentState, never>, import("./index.js").SystemComponentType<"sceneEntityObjectGroup", import("./index.js").SceneEntityObjectGroupComponentState, never>, import("./index.js").SystemComponentType<"hiddenEntity", import("./index.js").HiddenEntityComponentState, never>, import("./index.js").SystemComponentType<"cameraBasedHiddenEntity", import("./index.js").CameraBasedHiddenEntityComponentState, never>, import("./index.js").SystemComponentType<"cameraBasedHiddenEntityObject", import("./index.js").CameraBasedHiddenEntityObjectComponentState, never>, import("./index.js").SystemComponentType<"sceneEntityRemoteMaterialOverride", import("./index.js").SceneEntityRemoteMaterialOverrideComponentState, never>, import("./index.js").SystemComponentType<"sceneEntityLocalMaterialOverride", import("./index.js").SceneEntityLocalMaterialOverrideComponentState, never>, import("./index.js").SystemComponentType<"sceneEntityObjectRemoteMaterialOverride", import("./index.js").SceneEntityObjectRemoteMaterialOverrideComponentState, never>, import("./index.js").SystemComponentType<"sceneEntityObjectLocalMaterialOverride", import("./index.js").SceneEntityObjectLocalMaterialOverrideComponentState, never>, import("./index.js").SystemComponentType<"sceneEntityObjectTransmissiveMaterialOverride", import("./index.js").SceneEntityObjectTransmissiveMaterialOverrideComponentState, never>, import("./index.js").SystemComponentType<"sceneEntityTransmissiveMaterialOverride", import("./index.js").SceneEntityTransmissiveMaterialOverrideComponentState, never>, import("./index.js").SystemComponentType<"materialOverridePropertyTransition", import("./index.js").MaterialOverridePropertyTransitionComponentState, never>, import("./index.js").SystemComponentType<"sceneEntityAnimation", import("./index.js").SceneEntityAnimationComponentState, never>, import("./index.js").SystemComponentType<"sceneEntityObjectClip", import("./index.js").SceneEntityObjectClipComponentState, never>, import("./index.js").SystemComponentType<"sceneEntityObjectTextDecal", import("./index.js").SceneEntityObjectTextDecalComponentState, never>, import("./index.js").SystemComponentType<"fitRootPerspectiveCamera", import("./index.js").FitRootPerspectiveCameraComponentState, never>, import("./index.js").SystemComponentType<"fitRootOrthographicCamera", import("./index.js").FitRootOrthographicCameraComponentState, never>, import("./index.js").SystemComponentType<"fitEntityPerspectiveCamera", import("./index.js").FitEntityPerspectiveCameraComponentState, never>, import("./index.js").SystemComponentType<"fitEntityOrthographicCamera", import("./index.js").FitEntityOrthographicCameraComponentState, never>, import("./index.js").SystemComponentType<"fitSelectionPerspectiveCamera", import("./index.js").FitSelectionPerspectiveCameraComponentState, never>, import("./index.js").SystemComponentType<"fitSelectionOrthographicCamera", import("./index.js").FitSelectionOrthographicCameraComponentState, never>, import("./index.js").SystemComponentType<"staticPerspectiveCamera", import("./index.js").StaticPerspectiveCameraComponentState, never>, import("./index.js").SystemComponentType<"staticOrthographicCamera", import("./index.js").StaticOrthographicCameraComponentState, never>, import("./index.js").SystemComponentType<"autorotateCamera", import("./index.js").AutorotateCameraComponentState, never>, import("./index.js").SystemComponentType<"boundingBox", import("./index.js").BoundingBoxComponentState, never>, import("./index.js").SystemComponentType<"boundingSphere", import("./index.js").BoundingSphereComponentState, never>, import("./index.js").SystemComponentType<"pivotPoint", import("./index.js").PivotPointComponentState, never>, import("./index.js").SystemComponentType<"snapPoint", import("./index.js").SnapPointComponentState, never>, import("./index.js").SystemComponentType<"snapEdge", import("./index.js").SnapEdgeComponentState, never>, import("./index.js").SystemComponentType<"snapPlane", import("./index.js").SnapPlaneComponentState, never>, import("./index.js").SystemComponentType<"snapAxis", import("./index.js").SnapAxisComponentState, never>, import("./index.js").SystemComponentType<"collisionBoxGeometry", import("./index.js").CollisionBoxGeometryComponentState, never>, import("./index.js").SystemComponentType<"collisionGeometry", import("./index.js").CollisionGeometryComponentState, never>, import("./index.js").SystemComponentType<"collisionPointGeometry", import("./index.js").CollisionPointGeometryComponentState, never>, import("./index.js").SystemComponentType<"constraint", import("./index.js").ConstraintComponentState, never>, import("./index.js").SystemComponentType<"selectable", import("./index.js").SelectableComponentState, never>, import("./index.js").SystemComponentType<"htmlHotspot", import("./index.js").HtmlHotspotComponentState, never>, import("./index.js").SystemComponentType<"sceneEntityObjectHtmlHotspot", import("./index.js").SceneEntityObjectHtmlHotspotComponentState, never>, import("./index.js").SystemComponentType<"sceneEntityControl", import("./index.js").SceneEntityControlComponentState, never>, import("./index.js").SystemComponentType<"sceneEntityAddFab", import("./index.js").SceneEntityAddFabComponentState, never>, import("./index.js").SystemComponentType<"sceneEntityDeleteFab", import("./index.js").SceneEntityDeleteFabComponentState, never>, import("./index.js").SystemComponentType<"sceneEntitySelectHotspot", import("./index.js").SceneEntitySelectHotspotComponentState, never>, import("./index.js").SystemComponentType<"sceneEntityNavigationHotspot", import("./index.js").SceneEntityNavigationHotspotComponentState, never>, import("./index.js").SystemComponentType<"toolMenuFab", import("./index.js").ToolMenuFabComponentState, never>, import("./index.js").SystemComponentType<"exitToolModeFab", import("./index.js").ExitToolModeFabComponentState, never>, import("./index.js").SystemComponentType<"entityHeader", import("./index.js").EntityHeaderComponentState, never>, import("./index.js").SystemComponentType<"propertyPage", import("./index.js").PropertyPageComponentState, never>, import("./index.js").SystemComponentType<"toolbar", import("./index.js").ToolbarComponentState, never>, import("./index.js").SystemComponentType<"viewControls", import("./index.js").ViewControlsComponentState, never>, import("./index.js").SystemComponentType<"toolControls", import("./index.js").ToolControlsComponentState, never>, import("./index.js").SystemComponentType<"sidebarTabs", import("./index.js").SidebarTabsComponentState, never>, import("./index.js").SystemComponentType<"horizontalTabs", import("./index.js").HorizontalTabsComponentState, never>, import("./index.js").SystemComponentType<"navigationSteps", import("./index.js").NavigationStepsComponentState, never>, import("./index.js").SystemComponentType<"finalizeAction", import("./index.js").FinalizeActionComponentState, never>, import("./index.js").SystemComponentType<"otherAction", import("./index.js").OtherActionComponentState, never>, import("./index.js").SystemComponentType<"basicSidebarFooter", import("./index.js").BasicSidebarFooterComponentState, never>, import("./index.js").SystemComponentType<"universalSidebarFooter", import("./index.js").UniversalSidebarFooterComponentState, never>, import("./index.js").SystemComponentType<"readSidebarFooter", import("./index.js").ReadSidebarFooterComponentState, never>, import("./index.js").SystemComponentType<"customSidebarFooter", import("./index.js").CustomSidebarFooterComponentState, never>, import("./index.js").SystemComponentType<"hiddenSidebarFooter", import("./index.js").HiddenSidebarFooterComponentState, never>, import("./index.js").SystemComponentType<"canvasPadding", import("./index.js").CanvasPaddingComponentState, never>, import("./index.js").SystemComponentType<"floatingHeader", import("./index.js").FloatingHeaderComponentState, never>, import("./index.js").SystemComponentType<"customHeader", import("./index.js").CustomHeaderComponentState, never>, import("./index.js").SystemComponentType<"fixedHeader", import("./index.js").FixedHeaderComponentState, never>, import("./index.js").SystemComponentType<"hiddenHeader", import("./index.js").HiddenHeaderComponentState, never>, import("./index.js").SystemComponentType<"replaceEntityRecipes", import("./index.js").ReplaceEntityRecipesComponentState, never>, import("./index.js").SystemComponentType<"replaceEntityRecipeHierarchy", import("./index.js").ReplaceEntityRecipeHierarchyComponentState, never>, import("./index.js").SystemComponentType<"childEntityRecipes", import("./index.js").ChildEntityRecipesComponentState, never>, import("./index.js").SystemComponentType<"childEntityRecipeHierarchy", import("./index.js").ChildEntityRecipeHierarchyComponentState, never>, import("./index.js").SystemComponentType<"materialSwatch", import("./index.js").MaterialSwatchComponentState, "selectedSwatchKey">, import("./index.js").SystemComponentType<"offsetAnchors", import("./index.js").OffsetAnchorsComponentState, never>, import("./index.js").SystemComponentType<"offsetIndicator", import("./index.js").OffsetIndicatorComponentState, never>, import("./index.js").SystemComponentType<"distanceDimension", import("./index.js").DistanceDimensionComponentState, "value">, import("./index.js").SystemComponentType<"angleDimension", import("./index.js").AngleValue, "value">, import("./index.js").SystemComponentType<"genericDimension", import("./index.js").GenericValue, "value">, import("./index.js").SystemComponentType<"distanceDimensionSelect", import("./index.js").DistanceDimensionSelectComponentState, "value">, import("./index.js").SystemComponentType<"colorValue", import("./index.js").ColorValueComponentState, "value">, import("./index.js").SystemComponentType<"textValue", import("./index.js").TextValueComponentState, "value">, import("./index.js").SystemComponentType<"multilingualTextValue", import("./index.js").MultilingualTextValueComponentState, "value">, import("./index.js").SystemComponentType<"attributeSelection", import("./index.js").AttributeSelectionComponentState, "value">, import("./index.js").SystemComponentType<"attributeSwitch", import("./index.js").AttributeSwitchComponentState, "value">, import("./index.js").SystemComponentType<"childEntitySelection", import("./index.js").ChildEntitySelectionComponentState, never>, import("./index.js").SystemComponentType<"size", import("./index.js").SizeComponentState, "sizeX" | "sizeY" | "sizeZ">, import("./index.js").SystemComponentType<"offset", import("./index.js").OffsetComponentState, "offsetX" | "offsetY" | "offsetZ">, import("./index.js").SystemComponentType<"editableAngleIndicator", import("./index.js").EditableAngleIndicatorComponentState, never>, import("./index.js").SystemComponentType<"editableDistanceDimensionIndicator", import("./index.js").EditableDistanceDimensionIndicatorComponentState, never>, import("./index.js").SystemComponentType<"editableOffsetIndicator", import("./index.js").EditableOffsetIndicatorComponentState, never>, import("./index.js").SystemComponentType<"editableSizeIndicator", import("./index.js").EditableSizeIndicatorComponentState, never>, import("./index.js").SystemComponentType<"listSelectorDimensionIndicator", import("./index.js").ListSelectorDimensionIndicatorComponentState, never>, import("./index.js").SystemComponentType<"hotspotDragHandle", import("./index.js").HotspotDragHandleComponentState, "draggableX" | "draggableY" | "draggableZ">, import("./index.js").SystemComponentType<"simpleSummary", import("./index.js").SimpleSummaryComponentState, never>, import("./index.js").SystemComponentType<"clientSideImage", import("./index.js").ClientSideImageComponentState, never>, import("./index.js").SystemComponentType<"saveTemplateThumbnail", import("./index.js").SaveTemplateThumbnailComponentState, never>, import("./index.js").SystemComponentType<"agentScreenshot", import("./index.js").AgentScreenshotComponentState, never>, import("./index.js").SystemComponentType<"projectedEntities", import("./index.js").ProjectedEntitiesComponentState, never>, import("./index.js").SystemComponentType<"violations", import("./index.js").ViolationComponentState, never>];
8
- /**
9
- * Get component by name from all domain spec available components
10
- */
11
- export declare const componentsByName: Map<string, SystemComponentTypeConstraint>;