@salsita-ai/sdk 0.50.0-develop.9241bcf09e → 0.50.0-develop.927e2414eb

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 (527) hide show
  1. package/README.md +3 -3
  2. package/dist/admin/common/admin-interface.d.ts +11 -1
  3. package/dist/admin/common/admin-interface.js +1 -1
  4. package/dist/admin/ui/layout/UserProfile.d.ts +1 -1
  5. package/dist/admin/ui/layout/UserProfile.js +1 -1
  6. package/dist/admin/ui/maintenance/ImportPresets.js +1 -1
  7. package/dist/application/mount-application.js +1 -1
  8. package/dist/application/mount-configurator.js +1 -1
  9. package/dist/application/studio-embedding.d.ts +6 -0
  10. package/dist/application/studio-embedding.js +1 -0
  11. package/dist/application-spec/core/enhanced-json-schema.d.ts +5 -6
  12. package/dist/application-spec/core/enhanced-json-schema.js +1 -1
  13. package/dist/application-spec/core/markers/index.d.ts +1 -0
  14. package/dist/application-spec/core/markers/index.js +1 -1
  15. package/dist/application-spec/core/markers/set-in-studio-marker.d.ts +15 -0
  16. package/dist/application-spec/core/markers/set-in-studio-marker.js +1 -0
  17. package/dist/application-spec/errors/diagnostic-codes.d.ts +16 -0
  18. package/dist/application-spec/errors/diagnostic-codes.js +1 -1
  19. package/dist/application-spec/errors/diagnostic-messages.d.ts +16 -0
  20. package/dist/application-spec/errors/diagnostic-messages.js +1 -1
  21. package/dist/application-spec/generate-application/code/domain-runtime-files.d.ts +3 -3
  22. package/dist/application-spec/generate-application/code/domain-runtime-files.js +1 -1
  23. package/dist/application-spec/generate-application/code/standalone-app-files.d.ts +0 -12
  24. package/dist/application-spec/generate-application/code/standalone-app-files.js +1 -1
  25. package/dist/application-spec/generate-application/code/templates/admin-config.d.ts +5 -1
  26. package/dist/application-spec/generate-application/code/templates/admin-config.js +4 -4
  27. package/dist/application-spec/generate-application/code/templates/application-types.js +5 -5
  28. package/dist/application-spec/generate-application/code/templates/configurator-config.js +6 -6
  29. package/dist/application-spec/generate-application/code/templates/domain-spec/generate-phx-globals.d.ts +1 -1
  30. package/dist/application-spec/generate-application/code/templates/domain-spec/generate-phx-globals.js +19 -0
  31. package/dist/application-spec/generate-application/code/templates/domain-spec.js +12 -12
  32. package/dist/application-spec/generate-application/code/templates/frontend-config.js +7 -3
  33. package/dist/application-spec/generate-application/code/templates/global-definition/generate-action-types.d.ts +3 -3
  34. package/dist/application-spec/generate-application/code/templates/global-definition/generate-action-types.js +3 -3
  35. package/dist/application-spec/generate-application/code/templates/global-definition/generate-assistant-form-element-types.d.ts +10 -6
  36. package/dist/application-spec/generate-application/code/templates/global-definition/generate-assistant-form-element-types.js +7 -7
  37. package/dist/application-spec/generate-application/code/templates/global-definition/generate-phx-types.js +12 -12
  38. package/dist/application-spec/generate-application/code/templates/globals.js +21 -12
  39. package/dist/application-spec/generate-application/code/templates/index.d.ts +1 -1
  40. package/dist/application-spec/generate-application/code/templates/index.js +1 -1
  41. package/dist/application-spec/generate-application/code/templates/sign-in-page-options.d.ts +5 -0
  42. package/dist/application-spec/generate-application/code/templates/sign-in-page-options.js +1 -0
  43. package/dist/application-spec/generate-application/code/templates/skills/core/cli.d.ts +2 -1
  44. package/dist/application-spec/generate-application/code/templates/skills/core/cli.js +1 -1
  45. package/dist/application-spec/generate-application/code/templates/skills/core/sdk.js +2 -1
  46. package/dist/application-spec/generate-application/code/templates/skills/features/application-states/presets.js +1 -1
  47. package/dist/application-spec/generate-application/code/templates/skills/features/application-states/views-and-tools.js +1 -1
  48. package/dist/application-spec/generate-application/code/templates/skills/features/assistant/index.d.ts +3 -0
  49. package/dist/application-spec/generate-application/code/templates/skills/features/assistant/index.js +1 -0
  50. package/dist/application-spec/generate-application/code/templates/skills/features/{custom-layout/assistant.d.ts → assistant/panel.d.ts} +1 -1
  51. package/dist/application-spec/generate-application/code/templates/skills/features/assistant/panel.js +42 -0
  52. package/dist/application-spec/generate-application/code/templates/skills/features/assistant/reading-and-changing.d.ts +3 -0
  53. package/dist/application-spec/generate-application/code/templates/skills/features/assistant/reading-and-changing.js +55 -0
  54. package/dist/application-spec/generate-application/code/templates/skills/features/{webhooks/assistant-setup.d.ts → assistant/session-setup.d.ts} +1 -1
  55. package/dist/application-spec/generate-application/code/templates/skills/features/assistant/session-setup.js +16 -0
  56. package/dist/application-spec/generate-application/code/templates/skills/features/custom-layout/custom-layout.js +2 -2
  57. package/dist/application-spec/generate-application/code/templates/skills/features/custom-layout/sign-in.d.ts +3 -0
  58. package/dist/application-spec/generate-application/code/templates/skills/features/custom-layout/sign-in.js +19 -0
  59. package/dist/application-spec/generate-application/code/templates/skills/features/domain-model/actions.js +1 -1
  60. package/dist/application-spec/generate-application/code/templates/skills/features/embedding.d.ts +2 -0
  61. package/dist/application-spec/generate-application/code/templates/skills/features/embedding.js +1 -0
  62. package/dist/application-spec/generate-application/code/templates/skills/features/features.js +1 -1
  63. package/dist/application-spec/generate-application/code/templates/skills/features/webhooks/authentication.d.ts +1 -1
  64. package/dist/application-spec/generate-application/code/templates/skills/features/webhooks/authentication.js +32 -26
  65. package/dist/application-spec/generate-application/code/templates/skills/features/webhooks/entry-and-environment.js +1 -3
  66. package/dist/application-spec/generate-application/code/templates/skills/features/webhooks/publishing.js +1 -1
  67. package/dist/application-spec/generate-application/code/templates/skills/features/webhooks/session-fields.d.ts +3 -0
  68. package/dist/application-spec/generate-application/code/templates/skills/features/webhooks/session-fields.js +1 -0
  69. package/dist/application-spec/generate-application/code/templates/skills/features/webhooks/webhooks.js +1 -1
  70. package/dist/application-spec/generate-application/code/templates/skills/guide.d.ts +1 -1
  71. package/dist/application-spec/generate-application/code/templates/skills/phoenix-skill-bundle.d.ts +1 -1
  72. package/dist/application-spec/generate-application/code/templates/skills/phoenix-skill-bundle.js +3 -3
  73. package/dist/application-spec/generate-application/code/templates/skills/processes/asset-conversion.js +3 -3
  74. package/dist/application-spec/generate-application/code/templates/skills/processes/assistant-configuration.d.ts +3 -0
  75. package/dist/application-spec/generate-application/code/templates/skills/processes/assistant-configuration.js +3 -0
  76. package/dist/application-spec/generate-application/code/templates/skills/processes/feedback/report.js +2 -2
  77. package/dist/application-spec/generate-application/code/templates/skills/processes/first-draft/handoff.js +1 -1
  78. package/dist/application-spec/generate-application/code/templates/skills/processes/index.d.ts +2 -1
  79. package/dist/application-spec/generate-application/code/templates/skills/processes/index.js +1 -1
  80. package/dist/application-spec/generate-application/code/templates/skills/processes/model-migration.js +1 -1
  81. package/dist/application-spec/generate-application/code/templates/skills/processes/review/appearance.js +1 -1
  82. package/dist/application-spec/generate-application/code/templates/skills/processes/review/code.js +1 -1
  83. package/dist/application-spec/generate-application/code/templates/skills/processes/scene-realism.d.ts +2 -0
  84. package/dist/application-spec/generate-application/code/templates/skills/processes/scene-realism.js +29 -0
  85. package/dist/application-spec/generate-application/code/templates/skills/sdk-channel.d.ts +17 -0
  86. package/dist/application-spec/generate-application/code/templates/skills/sdk-channel.js +1 -0
  87. package/dist/application-spec/generate-application/code/templates/skills/sdk-subpath-imports.js +1 -1
  88. package/dist/application-spec/generate-application/code/templates/webhook-builders.js +3 -2
  89. package/dist/application-spec/generate-application/code/templates/webhook-index.d.ts +1 -2
  90. package/dist/application-spec/generate-application/code/templates/webhook-index.js +3 -7
  91. package/dist/application-spec/generate-application/code/webhook-safe-files.d.ts +3 -1
  92. package/dist/application-spec/generate-application/code/webhook-safe-files.js +1 -1
  93. package/dist/application-spec/parse-application-files/access/access-handler-kinds.d.ts +18 -0
  94. package/dist/application-spec/parse-application-files/access/access-handler-kinds.js +1 -0
  95. package/dist/application-spec/parse-application-files/access/analyzed-file.d.ts +7 -0
  96. package/dist/application-spec/parse-application-files/access/analyzed-file.js +1 -0
  97. package/dist/application-spec/parse-application-files/access/check-access-handler-files.d.ts +20 -0
  98. package/dist/application-spec/parse-application-files/access/check-access-handler-files.js +1 -0
  99. package/dist/application-spec/parse-application-files/access/check-auth-hook-files.d.ts +17 -0
  100. package/dist/application-spec/parse-application-files/access/check-auth-hook-files.js +1 -0
  101. package/dist/application-spec/parse-application-files/access/index.d.ts +5 -0
  102. package/dist/application-spec/parse-application-files/access/index.js +1 -0
  103. package/dist/application-spec/parse-application-files/access/sign-in-control.d.ts +7 -0
  104. package/dist/application-spec/parse-application-files/access/sign-in-control.js +1 -0
  105. package/dist/application-spec/parse-application-files/categorize/categorize-files.d.ts +2 -1
  106. package/dist/application-spec/parse-application-files/categorize/categorize-files.js +1 -1
  107. package/dist/application-spec/parse-application-files/categorize/module-analysis.d.ts +30 -4
  108. package/dist/application-spec/parse-application-files/categorize/module-analysis.js +1 -1
  109. package/dist/application-spec/parse-application-files/categorize/webhook-safety.js +1 -1
  110. package/dist/application-spec/parse-application-files/merge/merged-app-metadata.d.ts +16 -1
  111. package/dist/application-spec/parse-application-files/merge/merged-app-metadata.js +1 -1
  112. package/dist/application-spec/parse-application-files/merge/merged-assistant.js +1 -1
  113. package/dist/application-spec/parse-application-files/merge/merged-spec.d.ts +7 -1
  114. package/dist/application-spec/parse-application-files/merge/merged-spec.js +1 -1
  115. package/dist/application-spec/parse-application-files/parse-application-files.js +1 -1
  116. package/dist/application-spec/parse-application-files/parse-common-admin-spec.js +1 -1
  117. package/dist/application-spec/parse-application-files/raw-spec/raw-actions.d.ts +3 -2
  118. package/dist/application-spec/parse-application-files/raw-spec/raw-actions.js +1 -1
  119. package/dist/application-spec/parse-application-files/raw-spec/raw-assistant.d.ts +29 -6
  120. package/dist/application-spec/parse-application-files/raw-spec/raw-assistant.js +1 -1
  121. package/dist/application-spec/parse-application-files/raw-spec/raw-components.js +1 -1
  122. package/dist/application-spec/parse-application-files/raw-spec/raw-spec-file.d.ts +11 -3
  123. package/dist/application-spec/parse-application-files/raw-spec/raw-spec-file.js +1 -1
  124. package/dist/application-spec/parse-application-files/resolve/resolve-import-modules.js +1 -1
  125. package/dist/application-spec/parse-application-files/spec/application/configurator-spec/configurator-spec.d.ts +6 -0
  126. package/dist/application-spec/parse-application-files/spec/application/configurator-spec/configurator-spec.js +1 -1
  127. package/dist/application-spec/parse-application-files/spec/model/index.d.ts +2 -1
  128. package/dist/application-spec/parse-application-files/spec/model/index.js +1 -1
  129. package/dist/application-spec/parse-application-files/spec/model/session-data-schema.d.ts +5 -2
  130. package/dist/application-spec/parse-application-files/spec/model/session-data-schema.js +1 -1
  131. package/dist/application-spec/parse-application-files/spec/model/session-fields/index.d.ts +1 -0
  132. package/dist/application-spec/parse-application-files/spec/model/session-fields/index.js +1 -0
  133. package/dist/application-spec/parse-application-files/spec/model/session-fields/session-fields.d.ts +15 -0
  134. package/dist/application-spec/parse-application-files/spec/model/session-fields/session-fields.js +1 -0
  135. package/dist/application-spec/parse-application-files/spec/relations/relations.js +1 -1
  136. package/dist/application-spec/parse-application-files/spec/sections/actions.js +1 -1
  137. package/dist/application-spec/parse-application-files/spec/sections/app-metadata.js +1 -1
  138. package/dist/application-spec/parse-application-files/spec/sections/assistant/assistant-form-elements.d.ts +14 -2
  139. package/dist/application-spec/parse-application-files/spec/sections/assistant/assistant-form-elements.js +1 -1
  140. package/dist/application-spec/parse-application-files/spec/sections/assistant/assistant-schema.d.ts +6 -9
  141. package/dist/application-spec/parse-application-files/spec/sections/assistant/assistant-schema.js +1 -1
  142. package/dist/application-spec/parse-application-files/spec/sections/assistant/index.d.ts +0 -1
  143. package/dist/client/authenticated-client.d.ts +5 -1
  144. package/dist/client/authenticated-client.js +1 -1
  145. package/dist/client/authorized-client.d.ts +3 -1
  146. package/dist/client/authorized-client.js +1 -1
  147. package/dist/client/base-client.d.ts +15 -1
  148. package/dist/client/base-client.js +1 -1
  149. package/dist/client/cli-client/cli-api-client.d.ts +17 -0
  150. package/dist/client/cli-client/cli-api-client.js +1 -0
  151. package/dist/client/cli-client/index.d.ts +2 -0
  152. package/dist/client/cli-client/index.js +1 -0
  153. package/dist/client/cli-client/unsupported-api-version-error.d.ts +11 -0
  154. package/dist/client/cli-client/unsupported-api-version-error.js +1 -0
  155. package/dist/client/contract.d.ts +39 -4
  156. package/dist/client/contract.js +1 -1
  157. package/dist/client/index.d.ts +3 -1
  158. package/dist/client/index.js +1 -1
  159. package/dist/client/phoenix-api.d.ts +7834 -2378
  160. package/dist/client/unauthenticated-client.d.ts +2 -1
  161. package/dist/client/unauthenticated-client.js +1 -1
  162. package/dist/client/version.d.ts +11 -0
  163. package/dist/client/version.js +1 -1
  164. package/dist/configurator/application-runtime/extensions/selectors.js +1 -1
  165. package/dist/configurator/application-runtime/extensions/systems/action-system/action.d.ts +16 -4
  166. package/dist/configurator/application-runtime/extensions/systems/assistant-system/assistant-system.d.ts +25 -10
  167. package/dist/configurator/application-runtime/extensions/systems/assistant-system/assistant-system.js +1 -1
  168. package/dist/configurator/application-runtime/extensions/systems/assistant-system/graphql-tools.d.ts +15 -5
  169. package/dist/configurator/application-runtime/extensions/systems/assistant-system/webmcp/index.d.ts +1 -0
  170. package/dist/configurator/application-runtime/extensions/systems/assistant-system/webmcp/index.js +1 -1
  171. package/dist/configurator/application-runtime/extensions/systems/assistant-system/webmcp/register-webmcp-tools.d.ts +7 -3
  172. package/dist/configurator/application-runtime/extensions/systems/assistant-system/webmcp/register-webmcp-tools.js +6 -2
  173. package/dist/configurator/application-runtime/extensions/systems/assistant-system/webmcp/share-link.d.ts +14 -0
  174. package/dist/configurator/application-runtime/extensions/systems/assistant-system/webmcp/share-link.js +2 -0
  175. package/dist/configurator/application-runtime/extensions/systems/camera-control-system/camera-control-system.d.ts +41 -35
  176. package/dist/configurator/application-runtime/extensions/systems/camera-control-system/camera-control-system.js +1 -1
  177. package/dist/configurator/application-runtime/extensions/systems/export-system/export-system.d.ts +4 -2
  178. package/dist/configurator/application-runtime/extensions/systems/graphql-system/entity-meta.js +1 -1
  179. package/dist/configurator/application-runtime/extensions/systems/graphql-system/graphql-system.d.ts +9 -3
  180. package/dist/configurator/application-runtime/extensions/systems/graphql-system/graphql-system.js +1 -1
  181. package/dist/configurator/application-runtime/extensions/systems/graphql-system/read-offered-navigation.d.ts +6 -3
  182. package/dist/configurator/application-runtime/extensions/systems/graphql-system/read-offered-navigation.js +1 -1
  183. package/dist/configurator/application-runtime/extensions/systems/image-rendering-system/export-image-capture.d.ts +15 -4
  184. package/dist/configurator/application-runtime/extensions/systems/image-rendering-system/export-image-capture.js +3 -3
  185. package/dist/configurator/application-runtime/extensions/systems/image-rendering-system/image-rendering-system.d.ts +15 -7
  186. package/dist/configurator/application-runtime/extensions/systems/image-rendering-system/image-rendering-system.js +1 -1
  187. package/dist/configurator/common/configurator-interface.d.ts +13 -1
  188. package/dist/configurator/common/configurator-interface.js +1 -1
  189. package/dist/configurator/scene/animations/Animations.js +1 -1
  190. package/dist/configurator/scene/cameras/CameraPadding.d.ts +5 -0
  191. package/dist/configurator/scene/cameras/CameraPadding.js +1 -1
  192. package/dist/configurator/scene/resources/use-phx-gltf.js +1 -1
  193. package/dist/configurator/scene/scene-entity/materials/LocalCreatedMaterial.js +1 -1
  194. package/dist/configurator/scene/scene-entity/materials/RemoteReplacedMaterial.d.ts +5 -0
  195. package/dist/configurator/scene/scene-entity/materials/RemoteReplacedMaterial.js +1 -1
  196. package/dist/configurator/scene/scene-entity/materials/use-dispose-replaced.d.ts +27 -0
  197. package/dist/configurator/scene/scene-entity/materials/use-dispose-replaced.js +1 -0
  198. package/dist/configurator/toolbar-actions/use-toolbar-actions.js +1 -1
  199. package/dist/configurator/ui/assistant/AssistantComposer.js +1 -1
  200. package/dist/configurator/ui/assistant/AssistantPanel.js +1 -1
  201. package/dist/configurator/ui/assistant/annotation/editor/AnnotationComment.d.ts +6 -5
  202. package/dist/configurator/ui/assistant/annotation/editor/AnnotationComment.js +1 -1
  203. package/dist/configurator/ui/assistant/annotation/editor/AnnotationEditor.d.ts +4 -3
  204. package/dist/configurator/ui/assistant/annotation/editor/AnnotationEditor.js +1 -1
  205. package/dist/configurator/ui/assistant/annotation/editor/annotation-pins.d.ts +5 -0
  206. package/dist/configurator/ui/assistant/annotation/editor/annotation-pins.js +1 -1
  207. package/dist/configurator/ui/assistant/disclaimer/AssistantDisclaimerDialog.d.ts +10 -0
  208. package/dist/configurator/ui/assistant/disclaimer/AssistantDisclaimerDialog.js +1 -0
  209. package/dist/configurator/ui/assistant/disclaimer/AssistantDisclaimerLine.d.ts +10 -0
  210. package/dist/configurator/ui/assistant/disclaimer/AssistantDisclaimerLine.js +1 -0
  211. package/dist/configurator/ui/assistant/disclaimer/index.d.ts +2 -0
  212. package/dist/configurator/ui/assistant/disclaimer/index.js +1 -0
  213. package/dist/configurator/ui/assistant/drawing/AssistantDrawing.d.ts +2 -3
  214. package/dist/configurator/ui/assistant/drawing/AssistantDrawing.js +1 -1
  215. package/dist/configurator/ui/assistant/drawing/index.d.ts +1 -1
  216. package/dist/configurator/ui/assistant/drawing/index.js +1 -1
  217. package/dist/configurator/ui/assistant/drawing/use-drawing-url.d.ts +6 -12
  218. package/dist/configurator/ui/assistant/drawing/use-drawing-url.js +1 -1
  219. package/dist/configurator/ui/assistant/form/registry/create-assistant-form-element.d.ts +11 -7
  220. package/dist/configurator/ui/assistant/form-elements/FormTile.js +1 -1
  221. package/dist/configurator/ui/assistant/image-view/ImageView.js +1 -1
  222. package/dist/configurator/ui/assistant/panel/AssistantPanelHeader.js +1 -1
  223. package/dist/configurator/ui/assistant/use-assistant-composer.d.ts +5 -0
  224. package/dist/configurator/ui/assistant/use-assistant-composer.js +2 -2
  225. package/dist/configurator/ui/configurator-layout/index.d.ts +1 -1
  226. package/dist/configurator/ui/configurator-layout/index.js +1 -1
  227. package/dist/configurator/ui/configurator-layout/slots/desktop-sidebar/DesktopSidebar.js +4 -4
  228. package/dist/configurator/ui/configurator-layout/slots/index.d.ts +2 -0
  229. package/dist/configurator/ui/configurator-layout/slots/index.js +1 -1
  230. package/dist/configurator/ui/configurator-layout/slots/view-controls/DesktopViewControls.js +1 -1
  231. package/dist/configurator/ui/configurator-layout/slots/view-controls/MobileViewControls.js +1 -1
  232. package/dist/configurator/ui/configurator-layout/slots/view-controls/NestedViewControls.d.ts +7 -0
  233. package/dist/configurator/ui/configurator-layout/slots/view-controls/NestedViewControls.js +1 -0
  234. package/dist/configurator/ui/configurator-layout/slots/view-controls/use-view-control-items.d.ts +6 -0
  235. package/dist/configurator/ui/configurator-layout/slots/view-controls/use-view-control-items.js +1 -0
  236. package/dist/configurator/ui/configurator-layout/universal/DesktopPreview.js +1 -1
  237. package/dist/configurator/ui/configurator-layout/universal/MobileLayout.js +3 -3
  238. package/dist/configurator/ui/configurator-layout/universal/MobilePreview.js +1 -1
  239. package/dist/configurator/ui/configurator-layout/universal/use-preview-description.d.ts +1 -0
  240. package/dist/configurator/ui/configurator-layout/universal/use-preview-description.js +1 -0
  241. package/dist/configurator/ui/index.d.ts +1 -1
  242. package/dist/configurator/ui/legacy/layout/common/ViewControls.js +1 -1
  243. package/dist/configurator/ui/phoenix-layout-elements/AssistantToolbarButton.js +1 -1
  244. package/dist/docs/index.json +117 -2
  245. package/dist/docs/layouts/nested-view-controls.mdx +223 -0
  246. package/dist/docs/layouts/preview/always.mdx +22 -0
  247. package/dist/docs/layouts/view-controls.mdx +2 -0
  248. package/dist/docs/other-features/domain-actions.mdx +53 -56
  249. package/dist/docs/phoenix/admin.mdx +5 -40
  250. package/dist/docs/phoenix/application-states.mdx +1 -1
  251. package/dist/docs/phoenix/assistant/actions.mdx +183 -0
  252. package/dist/docs/phoenix/assistant/changing-the-configuration.mdx +333 -0
  253. package/dist/docs/phoenix/assistant/instructions-and-ai-settings.mdx +221 -0
  254. package/dist/docs/phoenix/assistant/overview.mdx +137 -0
  255. package/dist/docs/phoenix/assistant/per-session-setup.mdx +166 -0
  256. package/dist/docs/phoenix/assistant/reading-the-configuration.mdx +349 -0
  257. package/dist/docs/phoenix/assistant/screenshots.mdx +135 -0
  258. package/dist/docs/phoenix/assistant/security-and-limits.mdx +151 -0
  259. package/dist/docs/phoenix/assistant/the-panel.mdx +298 -0
  260. package/dist/docs/phoenix/clerk-sign-in.mdx +9 -5
  261. package/dist/docs/phoenix/configurator-interface.mdx +18 -33
  262. package/dist/docs/phoenix/csp.mdx +3 -1
  263. package/dist/docs/phoenix/data-sources.mdx +26 -30
  264. package/dist/docs/phoenix/deployments.mdx +3 -3
  265. package/dist/docs/phoenix/finalization.mdx +0 -1
  266. package/dist/docs/phoenix/integration/authentication-external.mdx +17 -15
  267. package/dist/docs/phoenix/integration/authentication-internal.mdx +1 -1
  268. package/dist/docs/phoenix/integration/finalization-internal.mdx +1 -4
  269. package/dist/docs/phoenix/integration/integration-modes-external.mdx +2 -2
  270. package/dist/docs/phoenix/integration/integration-modes-internal.mdx +9 -0
  271. package/dist/docs/phoenix/layout-slots.mdx +1 -1
  272. package/dist/docs/phoenix/migrations.mdx +1 -1
  273. package/dist/docs/phoenix/phoenix-cli.mdx +90 -57
  274. package/dist/docs/phoenix/project-structure.mdx +30 -15
  275. package/dist/docs/phoenix/publishing.mdx +21 -28
  276. package/dist/docs/phoenix/sdk-builder-workflow.mdx +51 -34
  277. package/dist/docs/phoenix/sessions-and-access.mdx +171 -164
  278. package/dist/docs/phoenix/webhook-membership.mdx +4 -1
  279. package/dist/docs/phoenix/webhooks.mdx +93 -116
  280. package/dist/docs/ux-guidelines/interaction-modes.mdx +2 -2
  281. package/dist/domain/application/access/access-handlers.d.ts +19 -0
  282. package/dist/domain/application/access/access-handlers.js +1 -0
  283. package/dist/domain/application/access/anonymous-handler.d.ts +16 -0
  284. package/dist/domain/application/access/anonymous-handler.js +1 -0
  285. package/dist/domain/application/access/chunk-scopes-handler.d.ts +27 -0
  286. package/dist/domain/application/access/chunk-scopes-handler.js +1 -0
  287. package/dist/domain/application/access/code-handler.d.ts +16 -0
  288. package/dist/domain/application/access/code-handler.js +1 -0
  289. package/dist/domain/application/access/index.d.ts +7 -0
  290. package/dist/domain/application/access/index.js +1 -0
  291. package/dist/domain/application/access/refresh-handler.d.ts +16 -0
  292. package/dist/domain/application/access/refresh-handler.js +1 -0
  293. package/dist/domain/application/access/signed-in-handler.d.ts +44 -0
  294. package/dist/domain/application/access/signed-in-handler.js +1 -0
  295. package/dist/domain/application/access/visitor-handler.d.ts +23 -0
  296. package/dist/domain/application/access/visitor-handler.js +1 -0
  297. package/dist/domain/application/application-config.d.ts +36 -1
  298. package/dist/domain/application/assistant/assistant-exposure.d.ts +22 -0
  299. package/dist/domain/application/assistant/assistant-exposure.js +1 -0
  300. package/dist/domain/application/assistant/build-assistant-lenses.js +3 -3
  301. package/dist/domain/application/assistant/build-assistant-manifest.js +1 -1
  302. package/dist/domain/application/assistant/generate-assistant-prompt.d.ts +6 -2
  303. package/dist/domain/application/assistant/generate-assistant-prompt.js +1 -1
  304. package/dist/domain/application/assistant/index.d.ts +1 -0
  305. package/dist/domain/application/assistant/index.js +1 -1
  306. package/dist/domain/application/assistant/session-setup/apply-assistant-setup.js +1 -1
  307. package/dist/domain/application/assistant/session-setup/assistant-setup-manifest.d.ts +14 -2
  308. package/dist/domain/application/assistant/session-setup/assistant-setup-manifest.js +1 -1
  309. package/dist/domain/application/assistant/session-setup/assistant-takes-images.d.ts +7 -0
  310. package/dist/domain/application/assistant/session-setup/assistant-takes-images.js +1 -0
  311. package/dist/domain/application/assistant/session-setup/index.d.ts +1 -0
  312. package/dist/domain/application/assistant/session-setup/index.js +1 -1
  313. package/dist/domain/application/assistant-mutations.js +1 -1
  314. package/dist/domain/application/assistant-recipe-groups.d.ts +4 -3
  315. package/dist/domain/application/assistant-recipe-groups.js +1 -1
  316. package/dist/domain/application/configurator-builder.d.ts +2 -0
  317. package/dist/domain/application/configurator-builder.js +1 -1
  318. package/dist/domain/application/index.d.ts +2 -1
  319. package/dist/domain/application/index.js +1 -1
  320. package/dist/domain/application/standard-properties.d.ts +1 -1
  321. package/dist/domain/application/standard-properties.js +1 -1
  322. package/dist/domain/available-system-components/available-system-components.js +1 -1
  323. package/dist/domain/core/component/system-component-filter.d.ts +1 -0
  324. package/dist/domain/core/component/system-component-filter.js +1 -1
  325. package/dist/domain/core/component/view-state-component.d.ts +4 -3
  326. package/dist/domain/core/component/view-state-component.js +1 -1
  327. package/dist/domain/core/domain-factory.d.ts +6 -0
  328. package/dist/domain/core/domain-factory.js +1 -1
  329. package/dist/domain/core/fit-session-data.d.ts +16 -0
  330. package/dist/domain/core/fit-session-data.js +1 -0
  331. package/dist/domain/domain-context/navigation-system/navigation-system.d.ts +2 -2
  332. package/dist/domain/domain-context/navigation-system/navigation-system.js +1 -1
  333. package/dist/domain/domain-context/transformers/when-builder.js +1 -1
  334. package/dist/domain/domain-runtime/domain-context/actions.d.ts +4 -0
  335. package/dist/domain/domain-runtime/domain-context/actions.js +1 -1
  336. package/dist/domain/domain-runtime/domain-context/domain-context.d.ts +8 -0
  337. package/dist/domain/domain-runtime/domain-context/domain-context.js +1 -1
  338. package/dist/domain/domain-runtime/domain-context/selectors.d.ts +1 -0
  339. package/dist/domain/domain-runtime/domain-context/selectors.js +1 -1
  340. package/dist/domain/domain-runtime/domain-context/types.d.ts +8 -4
  341. package/dist/domain/domain-runtime/domain-runtime.d.ts +8 -0
  342. package/dist/domain/extensions/export-images/agent-screenshot.d.ts +5 -4
  343. package/dist/domain/extensions/export-images/agent-screenshot.js +1 -1
  344. package/dist/domain/extensions/index.d.ts +0 -1
  345. package/dist/domain/extensions/index.js +1 -1
  346. package/dist/domain/mocks/create-mock-domain-runtime.d.ts +4 -0
  347. package/dist/domain/spec/sections/actions.d.ts +3 -2
  348. package/dist/domain/spec/sections/app-metadata.d.ts +12 -0
  349. package/dist/domain/spec/sections/assistant/assistant-features.d.ts +13 -0
  350. package/dist/domain/spec/sections/assistant/assistant-features.js +1 -0
  351. package/dist/domain/spec/sections/assistant/assistant-manifest.d.ts +17 -6
  352. package/dist/domain/spec/sections/assistant/assistant-resolved-manifest.d.ts +28 -5
  353. package/dist/domain/spec/sections/assistant/index.d.ts +1 -0
  354. package/dist/domain/system-components/index.d.ts +1 -0
  355. package/dist/domain/system-components/index.js +1 -1
  356. package/dist/domain/system-components/navigation/index.d.ts +1 -0
  357. package/dist/domain/system-components/navigation/index.js +1 -0
  358. package/dist/domain/system-components/navigation/view-controls.d.ts +24 -0
  359. package/dist/domain/system-components/navigation/view-controls.js +1 -0
  360. package/dist/editor/domain-editors/use-implementation-files.js +1 -1
  361. package/dist/extras/clerk/index.d.ts +6 -0
  362. package/dist/extras/cognito/AccountAvatar.d.ts +7 -0
  363. package/dist/extras/cognito/AccountAvatar.js +1 -0
  364. package/dist/extras/cognito/AccountControl.d.ts +14 -0
  365. package/dist/extras/cognito/AccountControl.js +1 -0
  366. package/dist/extras/cognito/AdminSignInPage.d.ts +26 -0
  367. package/dist/extras/cognito/AdminSignInPage.js +1 -0
  368. package/dist/extras/cognito/CognitoSignInPage.d.ts +8 -2
  369. package/dist/extras/cognito/CognitoSignInPage.js +1 -1
  370. package/dist/extras/cognito/ConfiguratorSignInPage.d.ts +19 -0
  371. package/dist/extras/cognito/ConfiguratorSignInPage.js +1 -0
  372. package/dist/extras/cognito/SignInFailurePage.d.ts +11 -0
  373. package/dist/extras/cognito/SignInFailurePage.js +1 -0
  374. package/dist/extras/cognito/SignInGateLayout.d.ts +25 -0
  375. package/dist/extras/cognito/SignInGateLayout.js +1 -0
  376. package/dist/extras/cognito/SignInNotice.d.ts +9 -0
  377. package/dist/extras/cognito/SignInNotice.js +1 -0
  378. package/dist/extras/cognito/index.d.ts +4 -0
  379. package/dist/extras/cognito/index.js +1 -1
  380. package/dist/globals/index.d.ts +5 -0
  381. package/dist/i18n/locales/cs/messages.js +1 -1
  382. package/dist/i18n/locales/da/messages.js +1 -1
  383. package/dist/i18n/locales/de/messages.js +1 -1
  384. package/dist/i18n/locales/de-AT/messages.js +1 -1
  385. package/dist/i18n/locales/en/messages.js +1 -1
  386. package/dist/i18n/locales/en-AU/messages.js +1 -1
  387. package/dist/i18n/locales/en-GB/messages.js +1 -1
  388. package/dist/i18n/locales/es/messages.js +1 -1
  389. package/dist/i18n/locales/fr/messages.js +1 -1
  390. package/dist/i18n/locales/hu/messages.js +1 -1
  391. package/dist/i18n/locales/it/messages.js +1 -1
  392. package/dist/i18n/locales/nl/messages.js +1 -1
  393. package/dist/i18n/locales/pl/messages.js +1 -1
  394. package/dist/i18n/locales/pt/messages.js +1 -1
  395. package/dist/i18n/locales/ro/messages.js +1 -1
  396. package/dist/i18n/locales/sk/messages.js +1 -1
  397. package/dist/i18n/locales/tr/messages.js +1 -1
  398. package/dist/legacy/deployment-cli/commands/create-environment.js +1 -1
  399. package/dist/legacy/deployment-cli/commands/list-environments.js +1 -1
  400. package/dist/legacy/deployment-cli/commands/register-deployment.js +1 -1
  401. package/dist/legacy/domain-spec/__generated/domain-schema.d.ts +12 -3
  402. package/dist/legacy/phoenix-cli/commands/prepare-deployment-command.js +1 -1
  403. package/dist/legacy/phoenix-cli/commands/prepare-local-environment-command.js +1 -1
  404. package/dist/legacy/phoenix-cli/services/prepare-development-environment.js +1 -1
  405. package/dist/legacy/phoenix-cli/services/webhook-service/transport.js +1 -1
  406. package/dist/phoenix/application-spec/index.d.ts +1 -1
  407. package/dist/phoenix/application-spec/index.js +1 -1
  408. package/dist/phoenix/application-spec/resolve-deployment-data.d.ts +10 -3
  409. package/dist/phoenix/application-spec/resolve-deployment-data.js +2 -2
  410. package/dist/phoenix/cli.js +1 -1
  411. package/dist/phoenix/commands/account/whoami.d.ts +8 -2
  412. package/dist/phoenix/commands/account/whoami.js +4 -3
  413. package/dist/phoenix/commands/cleanup-environment.js +1 -1
  414. package/dist/phoenix/commands/deploy.d.ts +7 -2
  415. package/dist/phoenix/commands/deploy.js +9 -3
  416. package/dist/phoenix/commands/deployment-build-envs-command.js +1 -1
  417. package/dist/phoenix/commands/deps/deps.js +2 -2
  418. package/dist/phoenix/commands/feedback.d.ts +2 -2
  419. package/dist/phoenix/commands/feedback.js +1 -1
  420. package/dist/phoenix/commands/finish-deployment-command.js +1 -1
  421. package/dist/phoenix/commands/init-starter-spec.js +3 -4
  422. package/dist/phoenix/commands/init.d.ts +2 -2
  423. package/dist/phoenix/commands/init.js +1 -1
  424. package/dist/phoenix/commands/login.d.ts +1 -1
  425. package/dist/phoenix/commands/login.js +2 -2
  426. package/dist/phoenix/commands/logout.js +1 -1
  427. package/dist/phoenix/commands/prepare-deployment-command.js +2 -2
  428. package/dist/phoenix/commands/prepare-local-environment-command.js +1 -1
  429. package/dist/phoenix/services/cli-credentials.d.ts +13 -2
  430. package/dist/phoenix/services/cli-credentials.js +2 -2
  431. package/dist/phoenix/services/cli-server/describe-saved-logins.d.ts +5 -0
  432. package/dist/phoenix/services/cli-server/describe-saved-logins.js +1 -0
  433. package/dist/phoenix/services/cli-server/index.d.ts +2 -0
  434. package/dist/phoenix/services/cli-server/index.js +1 -0
  435. package/dist/phoenix/services/cli-server/resolve-cli-server-url.d.ts +25 -0
  436. package/dist/phoenix/services/cli-server/resolve-cli-server-url.js +1 -0
  437. package/dist/phoenix/services/development-credential.js +1 -1
  438. package/dist/phoenix/services/frontend-config.d.ts +2 -0
  439. package/dist/phoenix/services/index.d.ts +4 -2
  440. package/dist/phoenix/services/index.js +1 -1
  441. package/dist/phoenix/services/phoenix-regions.d.ts +15 -5
  442. package/dist/phoenix/services/phoenix-regions.js +1 -1
  443. package/dist/phoenix/services/prepare-development-environment.js +2 -2
  444. package/dist/phoenix/services/session/phoenix-application.js +1 -1
  445. package/dist/phoenix/services/signed-in-development-environment.d.ts +15 -4
  446. package/dist/phoenix/services/signed-in-development-environment.js +1 -1
  447. package/dist/phoenix/services/spec-project/describe-workspace-projects.d.ts +11 -0
  448. package/dist/phoenix/services/spec-project/describe-workspace-projects.js +1 -0
  449. package/dist/phoenix/services/spec-project/index.d.ts +3 -0
  450. package/dist/phoenix/services/spec-project/index.js +1 -0
  451. package/dist/phoenix/services/spec-project/resolve-deploy-target.d.ts +47 -0
  452. package/dist/phoenix/services/spec-project/resolve-deploy-target.js +1 -0
  453. package/dist/phoenix/services/spec-project/resolve-target-project.d.ts +34 -0
  454. package/dist/phoenix/services/spec-project/resolve-target-project.js +2 -0
  455. package/dist/phoenix/services/spec-project/write-spec-project.d.ts +7 -0
  456. package/dist/phoenix/services/spec-project/write-spec-project.js +1 -0
  457. package/dist/phoenix/services/variant-file-session.js +1 -1
  458. package/dist/phoenix/services/vite-config.js +1 -1
  459. package/dist/phoenix/services/webhook-service/transport.js +1 -1
  460. package/dist/react-sdk/application-runtime/common-services/selectors.js +1 -1
  461. package/dist/react-sdk/application-runtime/domain-application-context/configuration-persist-system.d.ts +6 -0
  462. package/dist/react-sdk/application-runtime/domain-application-context/configuration-persist-system.js +1 -1
  463. package/dist/react-sdk/application-runtime/host-properties/selectors.d.ts +2 -2
  464. package/dist/react-sdk/application-runtime/integration/integration-mode.d.ts +30 -0
  465. package/dist/react-sdk/application-runtime/integration/integration-mode.js +1 -1
  466. package/dist/react-sdk/application-runtime/runtime/create-application-runtime.d.ts +20 -6
  467. package/dist/react-sdk/application-runtime/session/actions.d.ts +2 -1
  468. package/dist/react-sdk/application-runtime/session/actions.js +1 -1
  469. package/dist/react-sdk/application-runtime/session/initialize.js +1 -1
  470. package/dist/react-sdk/application-runtime/session/selectors.d.ts +2 -0
  471. package/dist/react-sdk/application-runtime/session/selectors.js +1 -1
  472. package/dist/react-sdk/application-runtime/session/session-service.d.ts +64 -2
  473. package/dist/react-sdk/application-runtime/session/session-service.js +1 -1
  474. package/dist/react-sdk/application-runtime/session/session-token.d.ts +8 -0
  475. package/dist/react-sdk/application-runtime/session/session-token.js +1 -1
  476. package/dist/react-sdk/application-runtime/session/types.d.ts +6 -1
  477. package/dist/react-sdk/domain-context/common-hooks/use-domain-context.d.ts +1 -0
  478. package/dist/react-sdk/domain-context/index.d.ts +3 -2
  479. package/dist/react-sdk/domain-context/index.js +1 -1
  480. package/dist/react-sdk/domain-context/system-hooks/generate-share-link-hooks.d.ts +1 -5
  481. package/dist/react-sdk/domain-context/system-hooks/generate-share-link-hooks.js +1 -1
  482. package/dist/react-sdk/domain-context/system-hooks/generate-share-link.d.ts +25 -0
  483. package/dist/react-sdk/domain-context/system-hooks/generate-share-link.js +1 -0
  484. package/dist/react-sdk/domain-context/system-hooks/navigation-hooks.d.ts +5 -3
  485. package/dist/react-sdk/domain-context/system-hooks/navigation-hooks.js +1 -1
  486. package/dist/react-sdk/preset-selection/PresetSelectionProvider.js +1 -1
  487. package/dist/react-sdk/session/AccessDeniedAdminPage.d.ts +13 -0
  488. package/dist/react-sdk/session/AccessDeniedAdminPage.js +1 -0
  489. package/dist/react-sdk/session/AccessDeniedPage.d.ts +20 -0
  490. package/dist/react-sdk/session/AccessDeniedPage.js +1 -0
  491. package/dist/react-sdk/session/ConfiguratorUnavailablePage.d.ts +5 -0
  492. package/dist/react-sdk/session/ConfiguratorUnavailablePage.js +1 -0
  493. package/dist/react-sdk/session/SessionServiceProvider.d.ts +5 -0
  494. package/dist/react-sdk/session/SessionServiceProvider.js +1 -1
  495. package/dist/react-sdk/session/index.d.ts +3 -0
  496. package/dist/react-sdk/session/index.js +1 -1
  497. package/dist/react-sdk/session/server-sign-in-support.d.ts +16 -0
  498. package/dist/react-sdk/session/server-sign-in-support.js +1 -0
  499. package/dist/react-sdk/session/sign-in-address.d.ts +18 -0
  500. package/dist/react-sdk/session/sign-in-address.js +1 -0
  501. package/dist/react-sdk/session/studio-frame.d.ts +14 -0
  502. package/dist/react-sdk/session/studio-frame.js +1 -0
  503. package/dist/react-sdk/session/use-sign-in.d.ts +51 -0
  504. package/dist/react-sdk/session/use-sign-in.js +1 -0
  505. package/dist/ui-sdk/components/preview/Preview.d.ts +12 -4
  506. package/dist/ui-sdk/components/preview/Preview.js +2 -2
  507. package/dist/ui-sdk/components/snackbar/Snackbar.d.ts +3 -2
  508. package/dist/ui-sdk/components/snackbar/Snackbar.js +1 -1
  509. package/dist/ui-sdk/components/toolbar/desktop-toolbar/ToolbarPopper.d.ts +2 -0
  510. package/dist/ui-sdk/components/toolbar/desktop-toolbar/ToolbarPopper.js +1 -1
  511. package/dist/ui-sdk/components/view-controls/ViewControlsContext.d.ts +3 -1
  512. package/dist/ui-sdk/components/view-controls/ViewControlsItem.js +1 -1
  513. package/dist/ui-sdk/components/view-controls/ViewControlsRoot.d.ts +6 -1
  514. package/dist/ui-sdk/components/view-controls/ViewControlsRoot.js +1 -1
  515. package/dist/webhook/builders/auth-handler-builder.d.ts +21 -1
  516. package/dist/webhook/builders/auth-handler-builder.js +1 -1
  517. package/dist/webhook/builders/common.d.ts +9 -0
  518. package/dist/webhook/builders/webhook-builder.d.ts +18 -0
  519. package/dist/webhook/builders/webhook-builder.js +1 -1
  520. package/package.json +5 -4
  521. package/schema/domain-spec.json +224 -65
  522. package/dist/application-spec/generate-application/code/templates/skills/features/custom-layout/assistant.js +0 -43
  523. package/dist/application-spec/generate-application/code/templates/skills/features/webhooks/assistant-setup.js +0 -32
  524. package/dist/application-spec/generate-application/code/templates/skills/processes/beta.d.ts +0 -14
  525. package/dist/application-spec/generate-application/code/templates/skills/processes/beta.js +0 -4
  526. package/dist/domain/extensions/view-controls.d.ts +0 -25
  527. package/dist/domain/extensions/view-controls.js +0 -1
@@ -1,6 +1,6 @@
1
1
  import type { SessionTokenPayload } from '@salsita-ai/contracts/api';
2
2
  import type { AllowedOrigin, ApplicationType, ChunkScope, ConfigurationSchemaId, DeploymentId, EnvironmentId } from '@salsita-ai/contracts/domain';
3
- import type { SessionState } from '#package/domain';
3
+ import type { SessionState, SignInOutcome } from '#package/domain';
4
4
  /**
5
5
  * The decoded configurator session token, as issued by the server. This is the one type that is
6
6
  * meant to track the wire contract — it models the payload rather than what the runtime keeps.
@@ -32,4 +32,9 @@ export interface RuntimeSessionClaims {
32
32
  */
33
33
  export interface ApplicationSessionRuntime {
34
34
  readonly sessionState: SessionState;
35
+ /**
36
+ * Outcome of the latest Studio-account sign-in. It is not derivable from the tokens: a refused or failed sign-in
37
+ * leaves a visitor's session, or none, behind.
38
+ */
39
+ readonly signIn: SignInOutcome;
35
40
  }
@@ -54,6 +54,7 @@ export declare const useDomainContextSelectors: () => {
54
54
  selectActiveSessionData: import("@salsita-ai/common/utils").Selector<import("#package/domain").DomainContextSelectorState, Record<string, unknown>>;
55
55
  selectExpressionContext: import("@salsita-ai/common/utils").Selector<import("#package/domain").DomainContextSelectorState, import("#package/domain").AnyExpressionContext>;
56
56
  getInitializationContext: () => import("#package/domain").DomainContextInitializationContext | null;
57
+ getLatestSessionContext: () => import("#package/domain").DomainSessionContext | null;
57
58
  getInitializationState: () => import("#package/domain").DomainContextInitializationState;
58
59
  getNextInitializationContext: () => import("#package/domain").DomainContextInitializationContext;
59
60
  getLatestLoadedData: () => import("#package/domain").ConfiguratorLoadedData | null;
@@ -9,13 +9,14 @@ export { useCommittedState, useCommittedSlice, useRenderedSlice, useRenderedStat
9
9
  export { useDomainEntityState, useDomainEntityRenderedState, type UseDomainEntityState, } from './entity-hooks/use-domain-entity-state.js';
10
10
  export { useEntityPrice, useRootEntityPrice, type UseEntityPrice, type UseRootEntityPrice, } from './entity-hooks/use-entity-price.js';
11
11
  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';
12
- 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
+ export { useActiveNavigationState, type UseActiveNavigationState, useActiveViewState, type UseActiveViewState, useActiveViewChildState, 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';
13
13
  export { useComposition, type UseComposition } from './system-hooks/composition-hooks.js';
14
14
  export { useUndoRedo, type UseUndoRedo, type UseUndoRedoResult } from './system-hooks/undo-redo-hooks.js';
15
15
  export { useTabNavigation, type TabEntry, type TabSource, type UseTabNavigation, type UseTabNavigationOptions, type UseTabNavigationResult, } from './system-hooks/tab-navigation-hooks.js';
16
16
  export { useStepNavigation, type NavigationStepEntry, type StepStatus, type UseStepNavigation, type UseStepNavigationResult, } from './system-hooks/step-navigation-hooks.js';
17
17
  export { useLocaleSwitch, type UseLocaleSwitch, type UseLocaleSwitchResult, type LocaleOption, } from './system-hooks/locale-switch-hooks.js';
18
- export { useGenerateShareLink, type GenerateShareLinkOptions } from './system-hooks/generate-share-link-hooks.js';
18
+ export { generateShareLink, type GenerateShareLinkContext, type GenerateShareLinkOptions, } from './system-hooks/generate-share-link.js';
19
+ export { useGenerateShareLink } from './system-hooks/generate-share-link-hooks.js';
19
20
  export { useShareLinks, type UseShareLinks, type UseShareLinksOptions, type UseShareLinksResult, } from './system-hooks/share-links-hooks.js';
20
21
  export { useHoveredDomainEntityId, useHoveredEntity, useHoveredEntityId, type UseHoveredDomainEntityId, type UseHoveredEntity, type UseHoveredEntityId, } from './system-hooks/hover-hooks.js';
21
22
  export { type UseRootEntityState, useRootEntityState, useRootEntityRenderedState, } from './entity-hooks/use-root-entity-state.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{useConfigurationSaveState}from"./common-hooks/use-configuration-save-state.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{useStepNavigation}from"./system-hooks/step-navigation-hooks.js";export{useLocaleSwitch}from"./system-hooks/locale-switch-hooks.js";export{useGenerateShareLink}from"./system-hooks/generate-share-link-hooks.js";export{useShareLinks}from"./system-hooks/share-links-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{useConfigurationSaveState}from"./common-hooks/use-configuration-save-state.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,useActiveViewChildState,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{useStepNavigation}from"./system-hooks/step-navigation-hooks.js";export{useLocaleSwitch}from"./system-hooks/locale-switch-hooks.js";export{generateShareLink}from"./system-hooks/generate-share-link.js";export{useGenerateShareLink}from"./system-hooks/generate-share-link-hooks.js";export{useShareLinks}from"./system-hooks/share-links-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,8 +1,4 @@
1
- import type { AccessLevel } from '@salsita-ai/contracts/api';
2
- export interface GenerateShareLinkOptions {
3
- access: AccessLevel;
4
- expiration?: number;
5
- }
1
+ import { type GenerateShareLinkOptions } from './generate-share-link.js';
6
2
  export declare const useGenerateShareLink: () => (options: GenerateShareLinkOptions) => Promise<{
7
3
  readonly link: string;
8
4
  }>;
@@ -1 +1 @@
1
- import{useCallback as e}from"react";import{match as r}from"ts-pattern";import{applicationConfigComponent as t}from"#package/domain";import{useAuthorizedClient as a,useConfigurationId as o,useDomainApplication as i}from"../../application-runtime/index.js";import{useFirstRootComponent as n}from"../component-hooks/index.js";export const useGenerateShareLink=()=>{let s=n(t),m=s?.state.shareStrategy??"deployment-registered",{configurationPersistSystem:c}=i(),d=o(),p=a();return e(async e=>{let t=r(m).with("deployment-registered",()=>void 0).with("current-frontend",()=>{let e=new URL(window.location.href);return e.searchParams.delete("cid"),e.searchParams.delete("ca"),e.toString()}).exhaustive(),a=await c.save();return p.generateShareLink(d,"rr"===e.access?a:void 0,e.expiration,e.access,t)},[m,c,p,d])};
1
+ import{useCallback as e}from"react";import{applicationConfigComponent as r}from"#package/domain";import{useAuthorizedClient as t,useConfigurationId as o,useDomainApplication as a}from"../../application-runtime/index.js";import{useFirstRootComponent as i}from"../component-hooks/index.js";import{generateShareLink as m}from"./generate-share-link.js";export const useGenerateShareLink=()=>{let n=i(r),s=n?.state.shareStrategy??"deployment-registered",{configurationPersistSystem:p}=a(),c=o(),d=t();return e(e=>m({configurationId:c,shareStrategy:s,save:()=>p.save(),apiClient:d},e),[s,p,d,c])};
@@ -0,0 +1,25 @@
1
+ import type { AccessLevel } from '@salsita-ai/contracts/api';
2
+ import type { AuthorizedPhoenixApiClient } from '#package/client';
3
+ import type { ApplicationConfigComponentState } from '#package/domain';
4
+ export interface GenerateShareLinkOptions {
5
+ access: AccessLevel;
6
+ expiration?: number;
7
+ }
8
+ /** @internal What {@link generateShareLink} saves the configuration through and generates the link with. */
9
+ export interface GenerateShareLinkContext {
10
+ readonly configurationId: string;
11
+ /** `applicationConfig.shareStrategy`, `deployment-registered` when it is not set. */
12
+ readonly shareStrategy: NonNullable<ApplicationConfigComponentState['shareStrategy']>;
13
+ /** Saves the configuration and resolves with the id of the saved revision. */
14
+ readonly save: () => Promise<string>;
15
+ readonly apiClient: Pick<AuthorizedPhoenixApiClient<Record<string, unknown>, Record<string, unknown>, Record<string, unknown>>, 'generateShareLink'>;
16
+ }
17
+ /**
18
+ * @internal Generates a link that shares the configuration, as the built-in share dialog does: saves
19
+ * the configuration, then asks the server for a link of the given access, pointing to the saved
20
+ * revision for a read revision link (`rr`). Shared by `useGenerateShareLink` and the
21
+ * configurator's WebMCP tools.
22
+ */
23
+ export declare const generateShareLink: ({ configurationId, shareStrategy, save, apiClient }: GenerateShareLinkContext, options: GenerateShareLinkOptions) => Promise<{
24
+ readonly link: string;
25
+ }>;
@@ -0,0 +1 @@
1
+ import{match as e}from"ts-pattern";export const generateShareLink=async({configurationId:r,shareStrategy:t,save:a,apiClient:n},i)=>{let o=e(t).with("deployment-registered",()=>void 0).with("current-frontend",()=>{let e=new URL(window.location.href);return e.searchParams.delete("cid"),e.searchParams.delete("ca"),e.toString()}).exhaustive(),s=await a();return n.generateShareLink(r,"rr"===i.access?s:void 0,i.expiration,i.access,o)};
@@ -1,4 +1,4 @@
1
- import type { DomainEntityId, Viewport } from '#package/domain';
1
+ import { type DomainEntityId, type Viewport } from '#package/domain';
2
2
  export type UseActiveNavigationState<NAVIGATION_STATE extends string> = () => NAVIGATION_STATE;
3
3
  /**
4
4
  * Get the currently active navigation state
@@ -9,11 +9,13 @@ export type UseActiveViewState<VIEW_STATE extends string> = () => VIEW_STATE;
9
9
  * Get the currently active view state
10
10
  */
11
11
  export declare const useActiveViewState: () => string;
12
- export type UseSetViewState<VIEW_STATE extends string> = () => (state: VIEW_STATE) => void;
12
+ /** The runtime choice within the active view, when one has been selected. */
13
+ export declare const useActiveViewChildState: () => string | undefined;
14
+ export type UseSetViewState<VIEW_STATE extends string> = () => (state: VIEW_STATE, viewChildState?: string) => void;
13
15
  /**
14
16
  * Hook to make the given view state the active one. Setting the state that is already active keeps it
15
17
  */
16
- export declare const useSetViewState: () => (state: string) => void;
18
+ export declare const useSetViewState: () => (state: string, viewChildState?: string) => void;
17
19
  export type UseActiveToolState<TOOL_STATE extends string> = () => TOOL_STATE;
18
20
  /**
19
21
  * Get the currently active tool state
@@ -1 +1 @@
1
- import{useCallback as t}from"react";import{useDomain as e,useStoreSelector as a}from"../common-hooks/index.js";export const useActiveNavigationState=()=>{let{navigationSystem:t}=e();return a(e=>t.getActiveNavigationState(e.state),[t])};export const useActiveViewState=()=>{let{navigationSystem:t}=e();return a(e=>t.getActiveViewState(e.state),[t])};export const useSetViewState=()=>{let{storeSystem:a,navigationSystem:o}=e();return t(t=>{a.stageAndCommit([o.getViewUpdate(t)])},[a,o])};export const useActiveToolState=()=>{let{navigationSystem:t}=e();return a(e=>t.getActiveToolState(e.state),[t])};export const useIsFullscreenActive=()=>{let{navigationSystem:t}=e();return a(e=>t.getActiveFullscreenState(e.state),[t])};export const useSetFullscreen=()=>{let{storeSystem:a,navigationSystem:o}=e();return t(t=>{a.stageAndCommit([o.getFullscreenUpdate(t)])},[a,o])};export const useDraggedDomainEntityId=()=>{let{navigationSystem:t}=e();return a(e=>t.getActiveDragState(e.state),[t])};export const useActiveViewports=()=>{let{navigationSystem:t}=e();return a(e=>t.getActiveViewportState(e.state),[t])};export const useNavigate=()=>{let{storeSystem:a,navigationSystem:o}=e();return t(t=>{a.stageAndCommit([o.getNavigationUpdate(t)])},[a,o])};export const usePushNavigate=()=>{let{storeSystem:a,navigationSystem:o}=e();return t(t=>{a.stageAndCommit([o.getPushNavigationUpdate(t,a.stateSlices.committed.value.state)])},[a,o])};export const usePopNavigate=()=>{let{storeSystem:a,navigationSystem:o}=e();return t(()=>{let t=o.getPopNavigationUpdate(a.stateSlices.committed.value.state);t&&a.stageAndCommit([t])},[a,o])};
1
+ import{useCallback as t}from"react";import{getComponentSystemFilterState as e}from"#package/domain";import{useDomain as a,useStoreSelector as o}from"../common-hooks/index.js";export const useActiveNavigationState=()=>{let{navigationSystem:t}=a();return o(e=>t.getActiveNavigationState(e.state),[t])};export const useActiveViewState=()=>{let{navigationSystem:t}=a();return o(e=>t.getActiveViewState(e.state),[t])};export const useActiveViewChildState=()=>o(t=>e(t.state).viewChildState,[]);export const useSetViewState=()=>{let{storeSystem:e,navigationSystem:o}=a();return t((t,a)=>{e.stageAndCommit([o.getViewUpdate(t,a)])},[e,o])};export const useActiveToolState=()=>{let{navigationSystem:t}=a();return o(e=>t.getActiveToolState(e.state),[t])};export const useIsFullscreenActive=()=>{let{navigationSystem:t}=a();return o(e=>t.getActiveFullscreenState(e.state),[t])};export const useSetFullscreen=()=>{let{storeSystem:e,navigationSystem:o}=a();return t(t=>{e.stageAndCommit([o.getFullscreenUpdate(t)])},[e,o])};export const useDraggedDomainEntityId=()=>{let{navigationSystem:t}=a();return o(e=>t.getActiveDragState(e.state),[t])};export const useActiveViewports=()=>{let{navigationSystem:t}=a();return o(e=>t.getActiveViewportState(e.state),[t])};export const useNavigate=()=>{let{storeSystem:e,navigationSystem:o}=a();return t(t=>{e.stageAndCommit([o.getNavigationUpdate(t)])},[e,o])};export const usePushNavigate=()=>{let{storeSystem:e,navigationSystem:o}=a();return t(t=>{e.stageAndCommit([o.getPushNavigationUpdate(t,e.stateSlices.committed.value.state)])},[e,o])};export const usePopNavigate=()=>{let{storeSystem:e,navigationSystem:o}=a();return t(()=>{let t=o.getPopNavigationUpdate(e.stateSlices.committed.value.state);t&&e.stageAndCommit([t])},[e,o])};
@@ -1 +1 @@
1
- import{jsx as e}from"react/jsx-runtime";import{useMutation as t}from"@tanstack/react-query";import{useSnackbar as r}from"notistack";import{useSubscription as i}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 d}from"rxjs";import{match as p}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 w,useConfiguratorDomainFactory as v,useIsDev as C,useLogger as T,usePersistenceConfig as S,usePublishedData as D,useRoutingSelectors as k,useSessionService as b,useSpecPresetSeed as E,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 R={id:"sdk.presets.create.error.message",message:"Could not start configuring from this preset. Please try again."},F={id:"sdk.presets.create.error.dismiss.label",message:"Dismiss"},M="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=E(),J=w(),K=P(),L=S(),N=v(),O=C(),Q=$(),{requestSessionToken:W}=b(),X=T(),Y=A(),Z=k(),_=D(),{enqueueSnackbar:ee,closeSnackbar:et}=r(),er=j(h.presetTags),ei=V(er),eo=I();i(l(()=>er.pipe(d(1)),[er]),()=>{Z.getRoutingState().route!==y.Index&&Y.goToIndex()}),a(()=>{G(null),et(M)},[O,et]);let{mutateAsync:en}=t({mutationFn:n(async e=>{let{getData:t,name:r}=e,{rootEntityType:i,entities:o,modelVersion:n}=await t(),s=N.validateAndMigrateState(o,n);K.push(x.ProductSelected(i,Q(r)));let a=eo?await eo(s):s;return J.createConfiguration({rootEntityType:i,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(ei))})).filter(e=>e.presets.length>0),seedPresets:H.filter(q(ei))});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=p(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(),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:N.modelVersion})}))}]:[]},[_,W,L,N,ei,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!`);return t},[ea]),em=n(async e=>{let{id:t,getData:r,name:i}=e,o=Z.getRoutingState().route===y.Index,n=!o||!O&&ea.length>1;G(null),B(t);try{let{configurationId:e}=await en({getData:r,name:i});return{configurationId:e}}catch(e){throw n&&(et(M),ee(Q(R),{variant:"error",key:M,persist:!0,preventDuplicate:!0,actionButton:{label:Q(F),onClick:e=>{G(null),et(e)}}})),o||G(null),e}},[ea,O,Z,en,ee,et,Q]),ed=n(async e=>em(el(e)),[em,el]),ep=n(e=>{em(el(e)).catch(()=>{})},[em,el]),ec=ea.length>1,eg=l(()=>({hasMultiplePresets:ec,presetCategories:es,selectPreset:ep,createFromPreset:ed,selectionError:U,creatingPresetId:z}),[ep,ed,ec,es,U,z]);return e(PresetSelectionContext.Provider,{value:eg,children:s})};
1
+ import{jsx as e}from"react/jsx-runtime";import{useMutation as t}from"@tanstack/react-query";import{useSnackbar as r}from"notistack";import{useSubscription as i}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 d}from"rxjs";import{match as p}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 w,useConfiguratorDomainFactory as v,useIsDev as C,useLogger as T,usePersistenceConfig as S,usePublishedData as D,useRoutingSelectors as k,useSessionService as b,useSpecPresetSeed as E,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 R={id:"sdk.presets.create.error.message",message:"Could not start configuring from this preset. Please try again."},F={id:"sdk.presets.create.error.dismiss.label",message:"Dismiss"},M="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=E(),J=w(),K=P(),L=S(),N=v(),O=C(),Q=$(),{requestSessionToken:W,refreshSession:X}=b(),Y=T(),Z=A(),_=k(),ee=D(),{enqueueSnackbar:et,closeSnackbar:er}=r(),ei=j(h.presetTags),eo=V(ei),en=I();i(l(()=>ei.pipe(d(1)),[ei]),()=>{_.getRoutingState().route!==y.Index&&Z.goToIndex()}),a(()=>{G(null),er(M)},[O,er]);let{mutateAsync:es}=t({mutationFn:n(async e=>{let{getData:t,name:r}=e,{rootEntityType:i,entities:o,modelVersion:n}=await t(),s=N.validateAndMigrateState(o,n);K.push(x.ProductSelected(i,Q(r)));let a=en?await en(s):s;return J.createConfiguration({rootEntityType:i,data:a})},[N,K,Q,J,en]),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),G(e)},onSettled:()=>{B(null)}}),ea=l(()=>{let e,t=(e=f in ee?ee[f].presetCategories:ee.presetCategories,{publishedPresetCategories:(e??[]).map(e=>({...e,presets:e.presets.filter(q(eo))})).filter(e=>e.presets.length>0),seedPresets:H.filter(q(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=p(L).with({type:"server"},t=>new c(t.serverUrl,()=>e.readToken,W,X)).with({type:"local-storage"},()=>new g(N.modelVersion)).with({type:"memory"},()=>new u(N.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:N.modelVersion})}))}]:[]},[ee,W,X,L,N,eo,H]),el=l(()=>ea.flatMap(e=>e.presets),[ea]),em=n(e=>{let t=el.find(t=>t.id===e);if(void 0===t)throw Error(`Preset with id ${e} not found!`);return t},[el]),ed=n(async e=>{let{id:t,getData:r,name:i}=e,o=_.getRoutingState().route===y.Index,n=!o||!O&&el.length>1;G(null),B(t);try{let{configurationId:e}=await es({getData:r,name:i});return{configurationId:e}}catch(e){throw n&&(er(M),et(Q(R),{variant:"error",key:M,persist:!0,preventDuplicate:!0,actionButton:{label:Q(F),onClick:e=>{G(null),er(e)}}})),o||G(null),e}},[el,O,_,es,et,er,Q]),ep=n(async e=>ed(em(e)),[ed,em]),ec=n(e=>{ed(em(e)).catch(()=>{})},[ed,em]),eg=el.length>1,eu=l(()=>({hasMultiplePresets:eg,presetCategories:ea,selectPreset:ec,createFromPreset:ep,selectionError:U,creatingPresetId:z}),[ec,ep,eg,ea,U,z]);return e(PresetSelectionContext.Provider,{value:eu,children:s})};
@@ -0,0 +1,13 @@
1
+ import { type PhoenixLayoutElementRegistration } from '#package/domain';
2
+ import type { AccessDeniedPageProps } from './AccessDeniedPage.js';
3
+ /**
4
+ * Registers a project's own access-denied page of the admin, shown to a person signed in to the admin who may not
5
+ * administer the project, or whom the project's signed-in handler refused. `phx.frontend.useSignIn()` tells them
6
+ * apart: `refusedAccount` names a refused account, `person` the one signed in without the Admin role.
7
+ */
8
+ export declare const createAccessDeniedAdminPage: (Element: (props: AccessDeniedPageProps) => JSX.Element) => PhoenixLayoutElementRegistration;
9
+ export type CreateAccessDeniedAdminPage = (Element: (props: AccessDeniedPageProps) => JSX.Element) => PhoenixLayoutElementRegistration;
10
+ /** Renders the `AccessDeniedAdminPage` element: a project element registered under the name, else `defaultPage`. */
11
+ export declare const AccessDeniedAdminPage: (props: AccessDeniedPageProps & {
12
+ readonly defaultPage: (props: AccessDeniedPageProps) => JSX.Element;
13
+ }) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1 @@
1
+ import{jsx as e}from"react/jsx-runtime";import{createCustomPhoenixLayoutElement as t}from"#package/domain";import{PhoenixLayoutElement as n}from"../elements/index.js";let m="AccessDeniedAdminPage";export const createAccessDeniedAdminPage=e=>t(m,e);export const AccessDeniedAdminPage=t=>{let{defaultPage:r,projectName:s}=t;return e(n,{name:m,elementProps:{projectName:s},defaultSlot:r})};
@@ -0,0 +1,20 @@
1
+ import type { ReactNode } from 'react';
2
+ import { type PhoenixLayoutElementRegistration } from '#package/domain';
3
+ export interface AccessDeniedPageProps {
4
+ /** The project's name, when its spec sets a page title. */
5
+ readonly projectName?: string | undefined;
6
+ readonly children?: ReactNode;
7
+ }
8
+ /**
9
+ * Registers a project's own access-denied page, shown when a Studio-account sign-in is refused: the account is not
10
+ * invited, or the project's signed-in handler refused it. `phx.frontend.useSignIn().refusedAccount` names the account.
11
+ */
12
+ export declare const createAccessDeniedPage: (Element: (props: AccessDeniedPageProps) => JSX.Element) => PhoenixLayoutElementRegistration;
13
+ export type CreateAccessDeniedPage = (Element: (props: AccessDeniedPageProps) => JSX.Element) => PhoenixLayoutElementRegistration;
14
+ /**
15
+ * Renders the `AccessDeniedPage` element: a project element registered under the name, else `defaultPage`, the page of
16
+ * the sign-in page that shows it.
17
+ */
18
+ export declare const AccessDeniedPage: (props: AccessDeniedPageProps & {
19
+ readonly defaultPage: (props: AccessDeniedPageProps) => JSX.Element;
20
+ }) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1 @@
1
+ import{jsx as e}from"react/jsx-runtime";import{createCustomPhoenixLayoutElement as t}from"#package/domain";import{PhoenixLayoutElement as r}from"../elements/index.js";let s="AccessDeniedPage";export const createAccessDeniedPage=e=>t(s,e);export const AccessDeniedPage=t=>{let{defaultPage:o,projectName:n}=t;return e(r,{name:s,elementProps:{projectName:n},defaultSlot:o})};
@@ -0,0 +1,5 @@
1
+ /**
2
+ * What a buyer sees when the server starts no session of the configurator now, hosted or embedded alike. It says only
3
+ * that the configurator is temporarily unavailable: why (a frozen workspace, a limit) stays with the workspace.
4
+ */
5
+ export declare const ConfiguratorUnavailablePage: () => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1 @@
1
+ import{jsx as e,jsxs as r}from"react/jsx-runtime";import{Trans as i}from"@lingui/react";import{Typography as o,styled as t}from"@mui/material";let a=t("div")(({theme:{palette:e,spacing:r}})=>({alignItems:"center",backgroundColor:e.background.scene,boxSizing:"border-box",color:e.text.secondary,display:"flex",flexDirection:"column",gap:r(1.5),justifyContent:"center",minBlockSize:"100cqb",padding:r(3),textAlign:"center"})),n=t("svg")(({theme:{palette:e}})=>({color:e.text.disabled}));export const ConfiguratorUnavailablePage=()=>r(a,{role:"status",children:[r(n,{width:"28",height:"28",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5","aria-hidden":!0,children:[e("circle",{cx:"12",cy:"12",r:"9"}),e("path",{d:"M8 12h8",strokeLinecap:"round"})]}),e(o,{variant:"body1",children:e(i,{id:"sdk.messages.error.configuratorUnavailable",message:"This configurator is temporarily unavailable."})})]});
@@ -2,6 +2,11 @@ import type { ComponentType, ReactNode } from 'react';
2
2
  export interface SessionProviderProps {
3
3
  readonly children: ReactNode;
4
4
  readonly notAuthenticatedFallback?: ComponentType;
5
+ /**
6
+ * Shown instead of `notAuthenticatedFallback` when the server starts no session of the configurator now, such as for
7
+ * a frozen workspace. Defaults to a neutral "temporarily unavailable" page that says nothing about why.
8
+ */
9
+ readonly configuratorUnavailableFallback?: ComponentType;
5
10
  /**
6
11
  * Shown while the session authenticates, unless a loader host shows the application's loader; an
7
12
  * application without a loader host passes its loader here. Defaults to rendering nothing.
@@ -1 +1 @@
1
- import{jsx as e}from"react/jsx-runtime";import{useCallback as t,useEffect as o,useMemo as n}from"react";import{distinctUntilChanged as i,filter as a,skip as r}from"rxjs";import{match as s}from"ts-pattern";import{standardWebComponentEvents as l,standardWebComponentProperties as d}from"#package/domain";import{DomainSessionProvider as c,INTEGRATION_MODE_SETTINGS as u,SessionProvider as h,useApplicationRuntime as m,useApplicationRuntimeSelector as g,useDispatchWebComponentEvent as f,useIsLoaderHosted as p,useLogger as S,useRawSession as k,useSessionService as v,useWebComponentProperty$ as x,useWebComponentPropertyValue as w}from"../application-runtime/index.js";import{usePatientObservableValue as T}from"../domain-context/index.js";import{BuiltInLoadingPhase as b,useLoadingPhase as j}from"../loading-state/index.js";import{NotAuthenticatedPage as C}from"./NotAuthenticatedPage.js";let A="code",U=()=>null;export const SessionServiceProvider=E=>{let{children:F,notAuthenticatedFallback:P=C,loadingFallback:z=U}=E,$=m(),q=S(),M=v(),N=k(),R=g($.selectors.session.getSession),y=g($.selectors.sessionContext.getSessionContext),L=w(d.sessionToken),W=w(d.adminSessionToken),B=w(d.refreshToken),D=x(d.integrationMode),G=x(d.authorizationCode),H=t(()=>{if(G.value){let e=D.value;"local-storage"===u[e].authenticationStorage&&q.warn(`authorizationCode WC prop used in '${e}' mode. This is discouraged — tokens stored in localStorage leak across tabs. Use 'handoff' or 'headless' mode instead.`);let t=G.value;return G.next(void 0),t}if(u[D.value].consumeCodeFromUrl){let e=new URL(window.location.href),t=e.searchParams.get(A);return e.searchParams.delete(A),history.replaceState(null,"",e),t??void 0}},[G,D,q]),I=T(n(()=>G.pipe(r(1),a(e=>void 0!==e),i()),[G]),void 0),J=u[w(d.integrationMode)].authenticationStorage,K=f(l.authenticationFailed),O=n(()=>s(J).with("local-storage",()=>localStorage).with("session-storage",()=>sessionStorage).exhaustive(),[J]);o(()=>{M.configure({initialSessionToken:L,initialAdminSessionToken:W,initialRefreshToken:B,retrieveAuthorizationCode:H,dispatchAuthenticationFailed:K,storage:O})},[M,L,W,B,H,K,O]),o(()=>{"loading"===N.authenticated&&M.requestSessionToken().catch(e=>{let t=e instanceof Error?e:Error(`Unknown error ${e}`);q.warn("Session could not be authenticated",{},t)})},[M,N.authenticated,q]),o(()=>{I&&(q.debug("New authorization code received, re-authenticating session"),M.requestSessionToken().catch(e=>{let t=e instanceof Error?e:Error(`Unknown error ${e}`);q.warn("Session could not be authenticated",{},t)}))},[I,M,q]);let Q=p();return(j({id:b.SessionAuth,label:"Authenticating session…"},"loading"===N.authenticated),"loading"===N.authenticated)?Q?null:e(z,{}):"error"===N.authenticated?e(h,{value:N,children:e(P,{})}):null===y?null:e(h,{value:R,children:e(c,{value:y,children:F})})};
1
+ import{jsx as e}from"react/jsx-runtime";import{useCallback as t,useEffect as n,useMemo as r,useRef as o}from"react";import{distinctUntilChanged as i,filter as a,skip as s}from"rxjs";import{match as l}from"ts-pattern";import{CONFIGURATOR_OPENED_FROM_PARAM as d,OPENED_FROM_STUDIO as u}from"@salsita-ai/contracts/api";import{standardWebComponentEvents as c,standardWebComponentProperties as h}from"#package/domain";import{ApplicationType as m,DomainSessionProvider as g,INTEGRATION_MODE_SETTINGS as f,SessionProvider as p,isStudioSignInCredential as S,useApplicationRuntime as v,useApplicationRuntimeSelector as w,useDeploymentId as k,useDispatchWebComponentEvent as C,useIsLoaderHosted as b,useLogger as x,useOptionalApplicationType as U,usePersistenceConfig as j,useRawSession as T,useSessionService as P,useWebComponentProperty$ as I,useWebComponentPropertyValue as A}from"../application-runtime/index.js";import{usePatientObservableValue as E}from"../domain-context/index.js";import{BuiltInLoadingPhase as F,useLoadingPhase as y}from"../loading-state/index.js";import{ConfiguratorUnavailablePage as z}from"./ConfiguratorUnavailablePage.js";import{NotAuthenticatedPage as R}from"./NotAuthenticatedPage.js";import{getServerSignInSupport as V}from"./server-sign-in-support.js";import{signInAddress as $}from"./sign-in-address.js";import{requestStudioCodeVerifier as q,useStudioFrameReport as L}from"./studio-frame.js";let M="code",N=()=>null;export const SessionServiceProvider=H=>{let{children:W,notAuthenticatedFallback:B=R,configuratorUnavailableFallback:D=z,loadingFallback:G=N}=H,J=v(),K=x(),O=P(),Q=T(),X=w(J.selectors.session.getSession),Y=w(J.selectors.sessionContext.getSessionContext),Z=A(h.sessionToken),_=A(h.adminSessionToken),ee=A(h.refreshToken),et=I(h.integrationMode),en=I(h.authorizationCode),er=k(),eo=j(),ei="server"===eo.type?eo.serverUrl:null,ea=U()===m.Admin,es=t(async e=>{let t=await O.startSignIn();window.location.assign($({serverUrl:e,deploymentId:er,pageHref:window.location.href,selectAccount:!1,admin:ea,codeChallenge:t}))},[O,er,ea]),el=o(!1),ed=t(()=>{if(en.value){let e=et.value;"local-storage"===f[e].authenticationStorage&&K.warn(`authorizationCode WC prop used in '${e}' mode. This is discouraged — tokens stored in localStorage leak across tabs. Use 'handoff' or 'headless' mode instead.`);let t=en.value;return en.next(void 0),{code:t}}let e=new URL(window.location.href),t=e.searchParams.get(M),n=!el.current&&O.hasStartedSignIn();el.current=!0;let r=null!==t&&S({code:t}),o=n?O.takeCodeVerifier():null;if(n&&(O.clearStartedSignIn(),r||O.reportUnfinishedSignIn()),null!==t&&r){let r=f[et.value],i=e.searchParams.get(d)===u,a=()=>{let e=new URL(window.location.href);e.searchParams.delete(M),e.searchParams.delete(d),history.replaceState(null,"",e)},s=null===ei?Promise.resolve(!1):V(ei).then(e=>e.bindsSignInCodes);if(r.reportsToStudio)return a(),{code:t,codeVerifier:s.then(e=>e&&null!==ei?q(ei):void 0)};if(n)return a(),null===o?{code:t}:{code:t,codeVerifier:o};if(i&&null!==ei){a(),es(ei).catch(e=>{K.warn("Could not sign in through Studio.",{},e instanceof Error?e:void 0),O.cancelSignIn()});return}return r.consumeCodeFromUrl?(a(),{code:t,codeVerifier:s.then(e=>e?null:void 0)}):void s.then(e=>{e&&(a(),O.reportForeignSignInCode())})}if(null!==t&&f[et.value].consumeCodeFromUrl)return e.searchParams.delete(M),history.replaceState(null,"",e),{code:t}},[en,et,K,O,ei,es]),eu=E(r(()=>en.pipe(s(1),a(e=>void 0!==e),i()),[en]),void 0),ec=A(h.integrationMode),eh=f[ec].authenticationStorage,em=C(c.authenticationFailed),eg=r(()=>l(eh).with("local-storage",()=>localStorage).with("session-storage",()=>sessionStorage).exhaustive(),[eh]),ef=!f[ec].hideSignInElements;n(()=>{O.configure({initialSessionToken:Z,initialAdminSessionToken:_,initialRefreshToken:ee,retrieveAuthorizationCode:ed,dispatchAuthenticationFailed:em,storage:eg,visitorAfterSignInError:ef})},[O,Z,_,ee,ed,em,eg,ef]),n(()=>{"loading"===Q.authenticated&&O.requestSessionToken().catch(e=>{let t=e instanceof Error?e:Error(`Unknown error ${e}`);K.warn("Session could not be authenticated",{},t)})},[O,Q.authenticated,K]),n(()=>{eu&&(K.debug("New authorization code received, re-authenticating session"),O.requestSessionToken().catch(e=>{let t=e instanceof Error?e:Error(`Unknown error ${e}`);K.warn("Session could not be authenticated",{},t)}))},[eu,O,K]);let ep=L(),eS=o(null);n(()=>{let e=l(Q).with({authenticated:"authenticated"},({rawAdminSessionToken:e})=>ea&&null===e?"denied":"ready").with({authenticated:"error"},()=>"ready"===eS.current?"denied":"failed").otherwise(()=>null);null!==e&&e!==eS.current&&ep(e)&&(eS.current=e)},[Q,ep,ea]);let ev=b();return(y({id:F.SessionAuth,label:"Authenticating session…"},"loading"===Q.authenticated),"loading"===Q.authenticated)?ev?null:e(G,{}):"error"===Q.authenticated&&"configurator-unavailable"===Q.authenticationErrorCode?e(p,{value:Q,children:e(D,{})}):"error"===Q.authenticated?e(p,{value:Q,children:e(B,{})}):null===Y?null:e(p,{value:X,children:e(g,{value:Y,children:W})})};
@@ -1,3 +1,6 @@
1
1
  export { SessionServiceProvider } from './SessionServiceProvider.js';
2
2
  export { ConfigurationNotFoundPage, type ConfigurationNotFoundPageProps } from './ConfigurationNotFoundPage.js';
3
3
  export { NotAuthenticatedPage, createNotAuthenticatedPage, type CreateNotAuthenticatedPage, } from './NotAuthenticatedPage.js';
4
+ export { useSignIn, type SignIn, type SignInOptions, type UseSignIn } from './use-sign-in.js';
5
+ export { AccessDeniedPage, createAccessDeniedPage, type AccessDeniedPageProps, type CreateAccessDeniedPage, } from './AccessDeniedPage.js';
6
+ export { AccessDeniedAdminPage, createAccessDeniedAdminPage, type CreateAccessDeniedAdminPage, } from './AccessDeniedAdminPage.js';
@@ -1 +1 @@
1
- export{SessionServiceProvider}from"./SessionServiceProvider.js";export{ConfigurationNotFoundPage}from"./ConfigurationNotFoundPage.js";export{NotAuthenticatedPage,createNotAuthenticatedPage}from"./NotAuthenticatedPage.js";
1
+ export{SessionServiceProvider}from"./SessionServiceProvider.js";export{ConfigurationNotFoundPage}from"./ConfigurationNotFoundPage.js";export{NotAuthenticatedPage,createNotAuthenticatedPage}from"./NotAuthenticatedPage.js";export{useSignIn}from"./use-sign-in.js";export{AccessDeniedPage,createAccessDeniedPage}from"./AccessDeniedPage.js";export{AccessDeniedAdminPage,createAccessDeniedAdminPage}from"./AccessDeniedAdminPage.js";
@@ -0,0 +1,16 @@
1
+ /** What the server tells about the Studio-account sign-in before a sign-in code is redeemed. */
2
+ export interface ServerSignInSupport {
3
+ /** Builder Studio's origin, as the server names it; null when the server has no Studio sign-in. */
4
+ readonly studioOrigin: string | null;
5
+ /**
6
+ * Whether the server binds a sign-in code to the PKCE challenge of the tab that asked for it, which its
7
+ * API version says. Only then does the SDK refuse a Studio code that arrives without its tab's verifier: against a
8
+ * server from before, which neither binds codes nor marks Studio's openings, it redeems codes as it always did.
9
+ */
10
+ readonly bindsSignInCodes: boolean;
11
+ }
12
+ /**
13
+ * The server's Studio sign-in support, from `GET /auth/config` and the API version every answer carries. A lookup that
14
+ * fails knows no Studio origin and counts as binding, so it never lets a code in without a verifier.
15
+ */
16
+ export declare const getServerSignInSupport: (serverUrl: string) => Promise<ServerSignInSupport>;
@@ -0,0 +1 @@
1
+ import{bindsSignInCodes as e,createApiBaseClient as n}from"#package/client";let i=new Map;export const getServerSignInSupport=t=>{let r=i.get(t);if(r)return r;let o=n(t).GET("/auth/config").then(({data:n,response:i})=>({studioOrigin:n?.studioOrigin??null,bindsSignInCodes:e(i.headers.get("x-api-version"))})).catch(()=>({studioOrigin:null,bindsSignInCodes:!0}));return i.set(t,o),o};
@@ -0,0 +1,18 @@
1
+ /** What the Studio sign-in form is opened with. */
2
+ export interface SignInAddressInput {
3
+ readonly serverUrl: string;
4
+ readonly deploymentId: string;
5
+ /** The page's own address, which the form sends the person back to without its used `code`. */
6
+ readonly pageHref: string;
7
+ /** Whether the form asks which account continues: after a sign-out or a refusal, or when the page asks for another account. */
8
+ readonly selectAccount: boolean;
9
+ /** Whether the admin, not the configurator, asks: the workspace's audit log names which one was signed in to. */
10
+ readonly admin: boolean;
11
+ /**
12
+ * The PKCE S256 code challenge of the verifier this tab keeps, which the form binds its code to; null where the page
13
+ * could not make one.
14
+ */
15
+ readonly codeChallenge: string | null;
16
+ }
17
+ /** The address of the Studio sign-in form on the server for a configurator or its admin. */
18
+ export declare const signInAddress: ({ serverUrl, deploymentId, pageHref, selectAccount, admin, codeChallenge, }: SignInAddressInput) => string;
@@ -0,0 +1 @@
1
+ import{CONFIGURATOR_OPENED_FROM_PARAM as e}from"@salsita-ai/contracts/api";export const signInAddress=({serverUrl:a,deploymentId:r,pageHref:s,selectAccount:t,admin:c,codeChallenge:n})=>{let l=new URL(s);l.searchParams.delete("code"),l.searchParams.delete(e);let o=new URL(`/deployments/${r}/auth`,a);return o.searchParams.set("returnUrl",l.href),o.searchParams.set("application",c?"admin":"configurator"),t&&o.searchParams.set("prompt","select_account"),null!==n&&o.searchParams.set("codeChallenge",n),o.href};
@@ -0,0 +1,14 @@
1
+ import { type EmbeddedFrameMessage } from '@salsita-ai/contracts/api';
2
+ /**
3
+ * Reports the frame's state to Builder Studio, which shows this page embedded in its frame. The message goes only to
4
+ * the Studio origin the server names, so a page that frames this one elsewhere learns nothing; outside a frame, or in
5
+ * any integration mode but `embedded`, nothing is sent.
6
+ */
7
+ export declare const useStudioFrameReport: () => (type: EmbeddedFrameMessage['type']) => boolean;
8
+ /**
9
+ * The PKCE code verifier of the sign-in code in the frame's address, which Builder Studio made when it asked for the
10
+ * code and keeps in its own page. The frame asks its parent window at the Studio origin the server names, and takes the
11
+ * answer only from that window at that origin, so the same address opened outside Studio's frame, or framed by another
12
+ * page, gets no verifier. Resolves to null then, and when Studio does not answer in time.
13
+ */
14
+ export declare const requestStudioCodeVerifier: (serverUrl: string) => Promise<string | null>;
@@ -0,0 +1 @@
1
+ import{useCallback as e}from"react";import{EMBEDDED_FRAME_SOURCE as r,EmbeddedFrameCodeVerifier as t}from"@salsita-ai/contracts/api";import{standardWebComponentProperties as o}from"#package/domain";import{INTEGRATION_MODE_SETTINGS as i,usePersistenceConfig as n,useWebComponentPropertyValue as s}from"../application-runtime/index.js";import{getServerSignInSupport as a}from"./server-sign-in-support.js";let u=e=>a(e).then(e=>e.studioOrigin);export const useStudioFrameReport=()=>{let t=s(o.integrationMode),a=n(),d="server"===a.type?a.serverUrl:null,l=i[t].reportsToStudio;return e(e=>!!l&&null!==d&&window.parent!==window&&(u(d).then(t=>{null!==t&&window.parent.postMessage({source:r,type:e},t)}),!0),[l,d])};export const requestStudioCodeVerifier=async e=>{if(window.parent===window)return null;let o=window.parent,i=await u(e);return null===i?null:new Promise(e=>{let n=r=>{window.clearTimeout(a),window.removeEventListener("message",s),e(r)},s=e=>{let r=t.safeParse(e.data);e.origin===i&&e.source===o&&r.success&&n(r.data.codeVerifier)},a=window.setTimeout(()=>n(null),1e4);window.addEventListener("message",s),o.postMessage({source:r,type:"code-verifier-request"},i)})};
@@ -0,0 +1,51 @@
1
+ import { type SignInAccount, type SignInOutcome } from '#package/domain';
2
+ /** How `SignIn.signIn` opens the Studio sign-in form. */
3
+ export interface SignInOptions {
4
+ /**
5
+ * Whether the form asks which account continues even though the person is signed in to Studio, as "Sign in with
6
+ * another account" needs. Without it Studio signs its own account back in without a form.
7
+ */
8
+ readonly anotherAccount?: boolean | undefined;
9
+ }
10
+ export interface SignIn {
11
+ /**
12
+ * Where the latest Studio-account sign-in on this page stands: `idle` (none, or it completed), `signing-in`,
13
+ * `refused` (the account is not invited, or the project's signed-in handler refused it), `failed` (it did not
14
+ * finish, see `failure`) or `ended` (it ended while the page was signed in, by a sign-out elsewhere, removed access
15
+ * or its 30 days, and the page continues as a visitor with what is on screen).
16
+ */
17
+ readonly state: SignInOutcome['state'];
18
+ /** The person signed in now, null for a visitor. `name` is their Studio display name, null when they have none. */
19
+ readonly person: SignInAccount | null;
20
+ /** With `state: 'refused'`, the account that was refused, when the server named it. */
21
+ readonly refusedAccount: SignInAccount | null;
22
+ /**
23
+ * With `state: 'failed'`: `not-completed` when the person came back without being signed in, such as with a code
24
+ * that was already used or expired, or with a code this browser tab did not ask for, which is never used; `unavailable` when the server could not complete the sign-in right now and
25
+ * trying again may help. `message` is the technical detail.
26
+ */
27
+ readonly failure: {
28
+ readonly reason: 'not-completed' | 'unavailable';
29
+ readonly message: string;
30
+ } | null;
31
+ /** Whether the person signed out on this page and has not signed in since; a sign-in page then waits for a click. */
32
+ readonly signedOut: boolean;
33
+ /**
34
+ * Whether sign-in elements stay hidden: in Studio's frame, where Studio shows the account, and where the
35
+ * configurator has no server to sign in with.
36
+ */
37
+ readonly hidden: boolean;
38
+ /**
39
+ * Sends the person to the Studio sign-in form, after saving the configuration's latest change, and back to this
40
+ * address. After a sign-out or a refusal, or with `anotherAccount`, the form asks which account continues.
41
+ */
42
+ readonly signIn: (options?: SignInOptions) => Promise<void>;
43
+ /** Ends this configurator's sign-in; where visitors may use the configurator, the person continues as one. */
44
+ readonly signOut: () => void;
45
+ }
46
+ export type UseSignIn = () => SignIn;
47
+ /**
48
+ * The Studio-account sign-in of the configurator or its admin: its outcome, the person signed in, and the actions a
49
+ * sign-in page or an account control needs.
50
+ */
51
+ export declare const useSignIn: UseSignIn;
@@ -0,0 +1 @@
1
+ import{useCallback as e,useEffect as t,useMemo as n,useRef as s,useState as r}from"react";import{SessionRole as a}from"@salsita-ai/contracts/api";import{standardWebComponentProperties as o}from"#package/domain";import{ApplicationType as i,INTEGRATION_MODE_SETTINGS as l,useApplicationRuntime as u,useApplicationRuntimeSelector as c,useDomainApplicationProps as d,useOptionalApplicationType as m,useRawSession as g,useSessionService as f,useWebComponentPropertyValue as p}from"../application-runtime/index.js";import{signInAddress as w}from"./sign-in-address.js";export const useSignIn=()=>{let y=u(),h=f(),P=g(),S=c(y.selectors.session.getSignIn),{deploymentId:v,persistenceConfig:A}=d(),I=p(o.integrationMode),L=m(),x="server"===A.type?A.serverUrl:null,E=l[I].hideSignInElements||null===x,[j]=r(()=>h.hasLoggedOutFlag()),F=s(!1);t(()=>{let e=e=>{e.persisted&&(F.current=!1,h.cancelSignIn())};return window.addEventListener("pageshow",e),()=>window.removeEventListener("pageshow",e)},[h]);let O=e(async()=>{L!==i.Admin&&await Promise.race([Promise.resolve().then(()=>y.selectors.domainApplicationContext.configurator.getSystems().configurationPersistSystem.flush()).catch(()=>void 0),new Promise(e=>setTimeout(e,5e3))])},[L,y]),T=e(async e=>{if(E||null===x||F.current)return;F.current=!0;let t=e?.anotherAccount===!0||h.hasLoggedOutFlag()||"refused"===S.state;try{let e=await h.startSignIn();await O();let n=w({serverUrl:x,deploymentId:v,pageHref:window.location.href,selectAccount:t,admin:L===i.Admin,codeChallenge:e});window.location.assign(n),setTimeout(()=>{F.current=!1},3e3)}catch(e){throw F.current=!1,e}},[E,x,h,S.state,O,v,L]),k=e(()=>{h.clearSession()},[h]),C=null===P.sessionPayload||P.sessionPayload.role===a.Anonymous;return n(()=>({state:S.state,person:C?null:(e=>{let t=e?.emailAddress;if("string"!=typeof t||""===t)return null;let n=e?.fullName;return{email:t,name:"string"==typeof n&&""!==n?n:null}})(P.sessionPayload?.data),refusedAccount:"refused"===S.state?S.account:null,failure:"failed"===S.state?{reason:S.reason,message:S.message}:null,signedOut:j,hidden:E,signIn:T,signOut:k}),[S,C,P.sessionPayload,j,E,T,k])};
@@ -7,6 +7,7 @@ declare const Slots: {
7
7
  readonly Root: 'root';
8
8
  readonly Body: 'body';
9
9
  readonly Title: 'title';
10
+ readonly Description: 'description';
10
11
  readonly Button: 'button';
11
12
  };
12
13
  type PreviewSlots = ValueOf<typeof Slots>;
@@ -50,8 +51,9 @@ export interface ThemeablePreviewProps extends OwnerState {
50
51
  * Each slot maps to a structural part of the UI:
51
52
  *
52
53
  * - `root` — The outer container (`motion.div`).
53
- * - `body` — The content area with title and start button (`motion.div`).
54
+ * - `body` — The content area for the preview copy and start button (`motion.div`).
54
55
  * - `title` — The heading element (MUI `Typography`).
56
+ * - `description` — The optional paragraph (MUI `Typography`).
55
57
  * - `button` — The start configuring button (MUI `Button`).
56
58
  *
57
59
  * @default {}
@@ -67,6 +69,7 @@ export interface ThemeablePreviewProps extends OwnerState {
67
69
  * animation props (`transition`, `layout`, `initial`, `animate`, etc.) in addition
68
70
  * to standard HTML div attributes.
69
71
  * - `title` — Props for the heading (`TypographyProps`).
72
+ * - `description` — Props for the optional paragraph (`TypographyProps`).
70
73
  * - `button` — Props for the start button (`ButtonProps`).
71
74
  *
72
75
  * @default {}
@@ -75,6 +78,7 @@ export interface ThemeablePreviewProps extends OwnerState {
75
78
  readonly [Slots.Root]: HTMLMotionProps<'div'>;
76
79
  readonly [Slots.Body]: HTMLMotionProps<'div'>;
77
80
  readonly [Slots.Title]: TypographyProps;
81
+ readonly [Slots.Description]: TypographyProps;
78
82
  readonly [Slots.Button]: ButtonProps;
79
83
  }>;
80
84
  }
@@ -83,6 +87,10 @@ export interface PreviewProps extends ThemeablePreviewProps {
83
87
  * The heading shown in the body.
84
88
  */
85
89
  readonly title: string;
90
+ /**
91
+ * Optional paragraph between the heading and the start button. Blank text is omitted.
92
+ */
93
+ readonly description?: string;
86
94
  /**
87
95
  * The label of the start button.
88
96
  */
@@ -113,14 +121,14 @@ export interface PreviewProps extends ThemeablePreviewProps {
113
121
  * when `true` the layout splits into a `scene | body` grid (vertical split on narrow
114
122
  * widths, horizontal above the `compact` breakpoint), letting the configurator scene
115
123
  * loaded behind show through the `scene` cell.
116
- * - Renders a centered title and a "start" button that invokes `onStart`.
117
- * - Exposes `root` / `body` / `title` / `button` slots plus `containerRef` /
124
+ * - Renders a title, an optional description and a "start" button that invokes `onStart`.
125
+ * - Exposes `root` / `body` / `title` / `description` / `button` slots plus `containerRef` /
118
126
  * `safeAreaRef` so smart wrappers can wire up animation and scene-safe-area
119
127
  * measurement.
120
128
  * - Integrates with MUI theming via the `PhxPreview` key.
121
129
  *
122
130
  * Typically wrapped by domain-aware components (`DesktopPreview`, `MobilePreview`) that
123
- * resolve the title/button label, attach refs for scene safe-area measurement, and
131
+ * resolve the preview copy, attach refs for scene safe-area measurement, and
124
132
  * supply variant-specific animation via `slotProps.root`.
125
133
  *
126
134
  * @example
@@ -1,4 +1,4 @@
1
- import{jsx as e,jsxs as t}from"react/jsx-runtime";import{Button as n,Typography as o,styled as r,useThemeProps as a}from"@mui/material";import{motion as i}from"motion/react";let d="PhxPreview",s={Root:r(i.div,{name:d,slot:"root",shouldForwardProp:e=>"ownerState"!==e})(({ownerState:e,theme:{breakpoints:t}})=>({display:"grid",gridTemplateAreas:`
1
+ import{jsx as e,jsxs as t}from"react/jsx-runtime";import{Button as o,Typography as n,styled as r,useThemeProps as i}from"@mui/material";import{motion as a}from"motion/react";let d="PhxPreview",s={Root:r(a.div,{name:d,slot:"root",shouldForwardProp:e=>"ownerState"!==e})(({ownerState:e,theme:{breakpoints:t}})=>({display:"grid",gridTemplateAreas:`
2
2
  'body body'
3
3
  'body body'
4
4
  `,gridTemplateColumns:"repeat(2, 1fr)",gridTemplateRows:"repeat(2, 1fr)",inset:0,position:"absolute",zIndex:1,...e.withScene&&{gridTemplateAreas:`
@@ -7,4 +7,4 @@ import{jsx as e,jsxs as t}from"react/jsx-runtime";import{Button as n,Typography
7
7
  `,[`@container app (width > ${t.values.md}px)`]:{gridTemplateAreas:`
8
8
  'scene body'
9
9
  'scene body'
10
- `}}})),Body:r(i.div,{name:d,slot:"body",shouldForwardProp:e=>"ownerState"!==e})(({ownerState:e,theme:{breakpoints:t,palette:n,spacing:o}})=>({alignContent:"center",alignItems:"center",background:n.background.scene,display:"grid",gap:o(3),gridArea:"body",justifyItems:"center",padding:o(3),textAlign:"center",zIndex:1,"@container app (width >= 560px)":{gap:o(4),paddingInline:o(5)},...e.withScene&&{alignContent:"start",[`@container app (width > ${t.values.md}px)`]:{alignContent:"center",background:"none",gap:o(4),justifyItems:"start",paddingInline:o(5),textAlign:"unset"}}})),Title:r(o,{name:d,slot:"title",shouldForwardProp:e=>"ownerState"!==e})(({theme:{palette:e,typography:t}})=>({...t.h5,color:e.text.primary,textWrap:"balance","@container app (width >= 560px)":{...t.h4}})),Button:r(n,{name:d,slot:"button",shouldForwardProp:e=>"ownerState"!==e})(()=>({}))},l=r("div")({gridArea:"1 / 1 / -1 / -1"}),p=r("div")(({ownerState:e,theme:{palette:t,spacing:n}})=>({gridArea:"1 / 1 / -1 / -1",inset:n(3),"@container app (width >= 560px)":{inset:n(5)},...e.withScene&&{gridArea:"scene",minBlockSize:80,position:"absolute"},"@container style(--inspect: on)":{border:`1px dashed ${t.info.light}`}}));export const Preview=n=>{let{buttonLabel:o,containerRef:r,onStart:i,safeAreaRef:c,slotProps:m={},slots:g={},title:h,withScene:u=!1}=a({props:n,name:d}),w=g.root??s.Root,b=g.body??s.Body,y=g.title??s.Title,x=g.button??s.Button,S={withScene:u};return t(w,{...m.root,layout:!0,ownerState:S,children:[e(l,{ref:r}),e(p,{ref:c,ownerState:S}),t(b,{...m.body,ownerState:S,children:[e(y,{component:"h1",...m.title,ownerState:S,children:h}),e(x,{variant:"contained",size:"large",...m.button,ownerState:S,onClick:i,children:o})]})]})};
10
+ `}}})),Body:r(a.div,{name:d,slot:"body",shouldForwardProp:e=>"ownerState"!==e})(({ownerState:e,theme:{breakpoints:t,palette:o,spacing:n}})=>({alignContent:"center",alignItems:"center",background:o.background.scene,display:"grid",gap:n(3),gridArea:"body",justifyItems:"center",padding:n(3),textAlign:"center",zIndex:1,"@container app (width >= 560px)":{gap:n(4),paddingInline:n(5)},...e.withScene&&{alignContent:"start",[`@container app (width > ${t.values.md}px)`]:{alignContent:"center",background:"none",gap:n(4),justifyItems:"start",paddingInline:n(5),textAlign:"unset"}}})),Title:r(n,{name:d,slot:"title",shouldForwardProp:e=>"ownerState"!==e})(({theme:{palette:e,typography:t}})=>({...t.h5,color:e.text.primary,textWrap:"balance","@container app (width >= 560px)":{...t.h4}})),Description:r(n,{name:d,slot:"description",shouldForwardProp:e=>"ownerState"!==e})(({theme:e})=>({color:e.palette.text.secondary,overflowWrap:"anywhere"})),Button:r(o,{name:d,slot:"button",shouldForwardProp:e=>"ownerState"!==e})(()=>({}))},p=r("div")({gridArea:"1 / 1 / -1 / -1"}),l=r("div")(({ownerState:e,theme:{palette:t,spacing:o}})=>({gridArea:"1 / 1 / -1 / -1",inset:o(3),"@container app (width >= 560px)":{inset:o(5)},...e.withScene&&{gridArea:"scene",minBlockSize:80,position:"absolute"},"@container style(--inspect: on)":{border:`1px dashed ${t.info.light}`}}));export const Preview=o=>{let{buttonLabel:n,containerRef:r,description:a,onStart:c,safeAreaRef:m,slotProps:h={},slots:w={},title:g,withScene:u=!1}=i({props:o,name:d}),y=w.root??s.Root,b=w.body??s.Body,x=w.title??s.Title,S=w.description??s.Description,f=w.button??s.Button,v={withScene:u};return t(y,{...h.root,layout:!0,ownerState:v,children:[e(p,{ref:r}),e(l,{ref:m,ownerState:v}),t(b,{...h.body,ownerState:v,children:[e(x,{component:"h1",...h.title,ownerState:v,children:g}),a?.trim()&&e(S,{component:"p",...h.description,ownerState:v,children:a}),e(f,{variant:"contained",size:"large",...h.button,ownerState:v,onClick:c,children:n})]})]})};
@@ -31,7 +31,7 @@ declare module '@mui/material/styles' {
31
31
  }
32
32
  interface Components {
33
33
  [MuiComponentName]?: {
34
- defaultProps?: ComponentsPropsList[typeof MuiComponentName];
34
+ defaultProps?: Partial<ComponentsPropsList[typeof MuiComponentName]>;
35
35
  styleOverrides?: ComponentsOverrides<Theme>[typeof MuiComponentName];
36
36
  variants?: ComponentsVariants<Theme>[typeof MuiComponentName];
37
37
  };
@@ -89,7 +89,8 @@ export interface SnackbarProps extends Readonly<CustomContentProps> {
89
89
  *
90
90
  * Available slot keys:
91
91
  * - `content` — Props for the snackbar content wrapper.
92
- * - `alert` — Props for the alert component (severity, variant, etc.).
92
+ * - `alert` — Props for the alert component (severity, variant, etc.). Its `iconMapping` and `icon` replace the
93
+ * snackbar's icons, including the success icon, which otherwise wins over the theme's `MuiAlert` `iconMapping`.
93
94
  * - `actionButton` — Props for the button of `actionButton`.
94
95
  *
95
96
  * @default { alert: { variant: 'standard' } }
@@ -1 +1 @@
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})})});
1
+ import{jsx as t,jsxs as n,Fragment as a}from"react/jsx-runtime";import{Alert as r,Button as e,SvgIcon as i,styled as o,useTheme as c,useThemeProps as s}from"@mui/material";import{SnackbarContent as l}from"notistack";import{forwardRef as p,useId as u,useMemo as k}from"react";import{match as m}from"ts-pattern";export const notistackSnackbarClasses={container:"notistack-SnackbarContainer",snackbar:"notistack-Snackbar"};let f="PhxSnackbar",h={Content:o(l,{name:f,slot:"content"})({display:"block"}),Alert:o(r,{name:f,slot:"alert"})({userSelect:"none"}),ActionButton:o(e,{name:f,slot:"actionButton"})({})};export const SnackbarVariant={Default:"default",Info:"info",Success:"success",Warning:"warning",Error:"error"};let d=a=>{let r=`phx-snackbar-success-${u().replace(/[^\w-]/g,"")}`;return n(i,{"data-testid":"PhxSnackbarSuccessIcon",viewBox:"0 0 18 18",...a,children:[n("mask",{id:r,children:[t("rect",{width:"18",height:"18",fill:"white"}),t("path",{d:"m5 12.5 4.5 4.5L19 7.5",fill:"none",stroke:"black",strokeWidth:3,transform:"translate(3.5 3.5) scale(0.458333)"})]}),t("circle",{cx:"9",cy:"9",r:"9",mask:`url(#${r})`})]})};export const Snackbar=p((r,e)=>{let{action:i,actionButton:o,id:l,message:p,slotProps:u={alert:{variant:"standard"}},slots:b={},variant:S="info"}=s({props:r,name:f}),g=c(),x=b.content??h.Content,w=b.alert??h.Alert,B=b.actionButton??h.ActionButton,M=k(()=>{if(i)return"function"==typeof i?i(l):i},[i,l]),A=k(()=>void 0===o?M:n(a,{children:[M,t(B,{color:"inherit",size:"small",...u.actionButton,onClick:()=>{o.onClick(l)},children:o.label})]}),[B,o,l,M,u.actionButton]),C=k(()=>({...g.components?.MuiAlert?.defaultProps?.iconMapping,success:t(d,{fontSize:"inherit"}),...u.alert?.iconMapping}),[u.alert?.iconMapping,g.components?.MuiAlert?.defaultProps?.iconMapping]);return t(x,{...u.content,ref:e,children:t(w,{...u.alert,iconMapping:C,severity:m(S).with(SnackbarVariant.Error,()=>S).with(SnackbarVariant.Info,()=>S).with(SnackbarVariant.Success,()=>S).with(SnackbarVariant.Warning,()=>S).otherwise(()=>SnackbarVariant.Info),action:A,"aria-atomic":"true","aria-live":"polite",children:p})})});
@@ -4,6 +4,8 @@ export interface ToolbarPopperProps {
4
4
  anchorEl: HTMLElement | null;
5
5
  isOpen: boolean;
6
6
  placement: PopperPlacementType;
7
+ /** Limit automatic placement to the space above or below the anchor within this element. */
8
+ verticalBoundary?: HTMLElement | null;
7
9
  children?: ReactNode;
8
10
  onClose: (event: Event) => void;
9
11
  }
@@ -1 +1 @@
1
- import{jsx as o}from"react/jsx-runtime";import{ClickAwayListener as e,Grow as r,Paper as t,Popper as l,styled as n}from"@mui/material";import{useCallback as i,useRef as a,useState as p}from"react";let s=n(l,{name:"PhxDesktopToolbarPopper",slot:"popper"})(()=>({zIndex:1}));export const ToolbarPopper=l=>{let{anchorEl:n,children:i,isOpen:a,onClose:p,placement:m}=l;return o(s,{modifiers:[{name:"offset",options:{offset:[0,16]}}],open:a,disablePortal:!0,transition:!0,anchorEl:n,role:void 0,placement:m,children:({TransitionProps:l,placement:n})=>o(r,{...l,style:{transformOrigin:"bottom"===n?"left top":"left bottom"},children:o(t,{children:o(e,{onClickAway:p,children:o("div",{children:i})})})})})};export const useToolbarPopper=()=>{let[o,e]=p(null),r=a(null);return{handleToggle:i(o=>{e(e=>e===o?null:o)},[]),handleClose:i(o=>{r.current?.contains(o.target)||e(null)},[]),ref:r,openedKey:o}};
1
+ import{jsx as e}from"react/jsx-runtime";import{ClickAwayListener as o,Grow as t,Paper as r,Popper as l,styled as n}from"@mui/material";import{detectOverflow as p}from"@popperjs/core";import{useCallback as a,useRef as i,useState as s}from"react";let m=n(l,{name:"PhxDesktopToolbarPopper",slot:"popper"})(()=>({zIndex:1})),c="--phx-toolbar-popper-available-height";export const ToolbarPopper=l=>{let{anchorEl:n,children:a,isOpen:i,onClose:s,placement:d,verticalBoundary:h}=l;return e(m,{modifiers:[{name:"offset",options:{offset:[0,16]}},...h?[{name:"flip",options:{boundary:h,allowedAutoPlacements:["top","bottom"]}},{name:"preventOverflow",options:{boundary:h}},{name:"availableHeight",enabled:!0,phase:"write",fn:({state:e})=>{let o=e.placement.startsWith("top")?"top":"bottom",t=p(e,{boundary:h}),r=Math.max(0,Math.floor(e.rects.popper.height-t[o]));e.elements.popper.style.setProperty(c,`${r}px`)},effect:({instance:e,state:o})=>{let t=new ResizeObserver(()=>void e.update());return t.observe(h),()=>{t.disconnect(),o.elements.popper.style.removeProperty(c)}}}]:[]],open:i,disablePortal:!0,transition:!0,anchorEl:n,role:void 0,placement:d,children:({TransitionProps:l,placement:n})=>e(t,{...l,style:{transformOrigin:"bottom"===n?"left top":"left bottom"},children:e(r,{children:e(o,{onClickAway:s,children:e("div",{children:a})})})})})};export const useToolbarPopper=()=>{let[e,o]=s(null),t=i(null);return{handleToggle:a(e=>{o(o=>o===e?null:e)},[]),handleClose:a(e=>{t.current?.contains(e.target)||o(null)},[]),ref:t,openedKey:e}};
@@ -1,4 +1,4 @@
1
- import type { MouseEvent, ReactNode } from 'react';
1
+ import type { HTMLAttributes, MouseEvent, ReactNode } from 'react';
2
2
  import type { ValueOf } from '@salsita-ai/common/utils';
3
3
  import type { PhxIconName } from '../../icons/index.js';
4
4
  /**
@@ -52,7 +52,9 @@ export interface ViewControlsItemEntry {
52
52
  */
53
53
  export interface ViewControlsContextValue {
54
54
  readonly variant: ViewControlsVariant;
55
+ readonly sizingLabelsByValue?: ReadonlyMap<string, readonly string[]>;
55
56
  readonly activeValue: string | null;
57
+ readonly compactMenuProps?: Pick<HTMLAttributes<HTMLElement>, 'aria-haspopup' | 'aria-expanded' | 'aria-controls'>;
56
58
  readonly isMenuOpen: boolean;
57
59
  readonly register: (value: string, entry: ViewControlsItemEntry) => () => void;
58
60
  readonly openMenu: (event: MouseEvent<HTMLElement>) => void;