@elytracms/studio 0.0.52 → 0.0.54

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 (321) hide show
  1. package/dist/components/account/account-settings.js +4 -4
  2. package/dist/components/account/credential-panel.js +1 -1
  3. package/dist/components/account/self-account-view-source.js +3 -3
  4. package/dist/components/ai/ai-chat-panel-lazy.js +1 -1
  5. package/dist/components/ai/ai-chat-panel.js +4 -4
  6. package/dist/components/ai/ai-cms-panel.js +1 -1
  7. package/dist/components/ai/proposal-card.js +4 -4
  8. package/dist/components/ai/translate-document-action.js +1 -1
  9. package/dist/components/ai/translate-document-dialog.d.ts +1 -1
  10. package/dist/components/app-views/default-modules.d.ts +3 -3
  11. package/dist/components/app-views/default-modules.js +20 -20
  12. package/dist/components/app-views/sidebar.d.ts +1 -1
  13. package/dist/components/app-views/sidebar.js +2 -2
  14. package/dist/components/app-views/studio-config.d.ts +1 -1
  15. package/dist/components/assets/asset-detail.js +9 -9
  16. package/dist/components/assets/asset-grid.js +7 -7
  17. package/dist/components/assets/asset-thumb.d.ts +1 -1
  18. package/dist/components/assets/asset-thumb.js +2 -2
  19. package/dist/components/assets/assets-collection-view-source.js +3 -3
  20. package/dist/components/assets/assets-module.js +8 -8
  21. package/dist/components/assets/assets-store.d.ts +1 -1
  22. package/dist/components/assets/assets-store.js +1 -1
  23. package/dist/components/builder/blocks-model.js +1 -1
  24. package/dist/components/builder/blocks-panel.d.ts +1 -1
  25. package/dist/components/builder/blocks-panel.js +6 -6
  26. package/dist/components/builder/canvas.js +11 -11
  27. package/dist/components/builder/clipboard-actions.js +2 -2
  28. package/dist/components/builder/composition-field-editor-lazy.d.ts +1 -1
  29. package/dist/components/builder/composition-field-editor-lazy.js +1 -1
  30. package/dist/components/builder/composition-field-editor.d.ts +1 -1
  31. package/dist/components/builder/composition-field-editor.js +9 -9
  32. package/dist/components/builder/insert-context.d.ts +2 -2
  33. package/dist/components/builder/insert-context.js +2 -2
  34. package/dist/components/builder/insert-menu.d.ts +2 -2
  35. package/dist/components/builder/insert-menu.js +1 -1
  36. package/dist/components/builder/layout-inspector.js +1 -1
  37. package/dist/components/builder/page-tree.js +5 -5
  38. package/dist/components/builder/property-inspector.js +3 -3
  39. package/dist/components/builder/reuse-context.d.ts +1 -1
  40. package/dist/components/builder/reuse-context.js +3 -3
  41. package/dist/components/builder/spacing-handles.js +2 -2
  42. package/dist/components/cms/asset-picker.js +4 -4
  43. package/dist/components/cms/bulk-actions.js +1 -1
  44. package/dist/components/cms/bulk-bar.d.ts +1 -1
  45. package/dist/components/cms/bulk-bar.js +3 -3
  46. package/dist/components/cms/cell-edit.js +1 -1
  47. package/dist/components/cms/cell.js +2 -2
  48. package/dist/components/cms/cms-index.js +1 -1
  49. package/dist/components/cms/cms-store.d.ts +2 -2
  50. package/dist/components/cms/cms-store.js +6 -6
  51. package/dist/components/cms/collection-table.js +17 -17
  52. package/dist/components/cms/detail-editor.js +31 -31
  53. package/dist/components/cms/document-diff-view.js +4 -4
  54. package/dist/components/cms/editable-cell.d.ts +1 -1
  55. package/dist/components/cms/editable-cell.js +6 -6
  56. package/dist/components/cms/field-control.js +15 -15
  57. package/dist/components/cms/field-renderer.d.ts +2 -2
  58. package/dist/components/cms/filter-builder.js +3 -3
  59. package/dist/components/cms/import-export.js +1 -1
  60. package/dist/components/cms/issues-pane.js +1 -1
  61. package/dist/components/cms/prop-fields.js +3 -3
  62. package/dist/components/cms/reference-confirm.js +1 -1
  63. package/dist/components/cms/relation-picker.js +1 -1
  64. package/dist/components/cms/rich-text/block-commands.d.ts +1 -1
  65. package/dist/components/cms/rich-text/component-embed.js +2 -2
  66. package/dist/components/cms/rich-text/editor.js +8 -8
  67. package/dist/components/cms/rich-text/embed-inspector.d.ts +1 -1
  68. package/dist/components/cms/rich-text/embed-inspector.js +2 -2
  69. package/dist/components/cms/rich-text/embed-picker.js +1 -1
  70. package/dist/components/cms/rich-text/embed-props.js +1 -1
  71. package/dist/components/cms/rich-text/extensions.d.ts +1 -1
  72. package/dist/components/cms/rich-text/extensions.js +4 -4
  73. package/dist/components/cms/rich-text/index.d.ts +1 -1
  74. package/dist/components/cms/rich-text/index.js +1 -1
  75. package/dist/components/cms/rich-text/insert.d.ts +1 -1
  76. package/dist/components/cms/rich-text/lazy.d.ts +1 -1
  77. package/dist/components/cms/rich-text/lazy.js +1 -1
  78. package/dist/components/cms/rich-text/slash-command.js +1 -1
  79. package/dist/components/cms/rich-text/toolbar.d.ts +1 -1
  80. package/dist/components/cms/rich-text/toolbar.js +4 -4
  81. package/dist/components/cms/use-cell-edit.d.ts +1 -1
  82. package/dist/components/cms/use-cell-edit.js +2 -2
  83. package/dist/components/cms/use-compare-selection.d.ts +1 -1
  84. package/dist/components/cms/use-discard-controller.d.ts +1 -1
  85. package/dist/components/cms/use-discard-controller.js +2 -2
  86. package/dist/components/cms/use-document-versions.d.ts +1 -1
  87. package/dist/components/cms/use-document-versions.js +1 -1
  88. package/dist/components/cms/use-embed-inspector-host.d.ts +1 -1
  89. package/dist/components/cms/use-published-perspective.d.ts +2 -2
  90. package/dist/components/cms/use-published-perspective.js +2 -2
  91. package/dist/components/cms/use-restore-version.js +1 -1
  92. package/dist/components/cms/version-compare-lazy.js +1 -1
  93. package/dist/components/cms/version-compare.js +6 -6
  94. package/dist/components/cms/versions-model.d.ts +1 -1
  95. package/dist/components/cms/versions-pane.js +5 -5
  96. package/dist/components/cms/view-bar.js +2 -2
  97. package/dist/components/collab/collab-context.js +1 -1
  98. package/dist/components/collection-view/cms-collection-view-source.js +2 -2
  99. package/dist/components/components/component-preview.js +3 -3
  100. package/dist/components/components/components-index.js +2 -2
  101. package/dist/components/components/registry-browser.js +2 -2
  102. package/dist/components/components/transfer-dialog.js +5 -5
  103. package/dist/components/components/transfer.js +4 -4
  104. package/dist/components/current-user-menu.js +2 -2
  105. package/dist/components/delivery-health-banner.js +2 -2
  106. package/dist/components/operation-error.js +1 -1
  107. package/dist/components/project-list.js +5 -5
  108. package/dist/components/project-session.js +1 -1
  109. package/dist/components/project-switcher.js +3 -3
  110. package/dist/components/rail-store-status.js +1 -1
  111. package/dist/components/redirects/redirects-collection-view-source.js +3 -3
  112. package/dist/components/redirects/redirects-module.js +6 -6
  113. package/dist/components/section-nav.js +3 -3
  114. package/dist/components/section-surface.js +1 -1
  115. package/dist/components/studio-project-screen.js +7 -7
  116. package/dist/components/studio-shell.js +9 -9
  117. package/dist/components/use-hydration-phase.js +1 -1
  118. package/dist/components/users/users-collection-view-source.js +4 -4
  119. package/dist/components/users/users-module.js +9 -9
  120. package/dist/components/workspace-projects.js +1 -1
  121. package/dist/customization.d.ts +9 -9
  122. package/dist/customization.js +5 -5
  123. package/dist/lib/ai/anthropic-provider.d.ts +1 -1
  124. package/dist/lib/ai/apply-content.d.ts +1 -1
  125. package/dist/lib/ai/apply-content.js +3 -3
  126. package/dist/lib/ai/chat-state.d.ts +2 -2
  127. package/dist/lib/ai/config.d.ts +1 -1
  128. package/dist/lib/ai/convex-session-headers.d.ts +68 -0
  129. package/dist/lib/ai/convex-session-headers.js +79 -0
  130. package/dist/lib/ai/convex-session-headers.js.map +1 -0
  131. package/dist/lib/ai/convex-session.d.ts +82 -0
  132. package/dist/lib/ai/convex-session.js +92 -0
  133. package/dist/lib/ai/convex-session.js.map +1 -0
  134. package/dist/lib/ai/create-flow.d.ts +2 -2
  135. package/dist/lib/ai/create-flow.js +3 -3
  136. package/dist/lib/ai/fake-provider.d.ts +1 -1
  137. package/dist/lib/ai/index.d.ts +27 -16
  138. package/dist/lib/ai/index.js +27 -16
  139. package/dist/lib/ai/index.js.map +1 -1
  140. package/dist/lib/ai/knowledge.d.ts +1 -1
  141. package/dist/lib/ai/node-handler.d.ts +29 -0
  142. package/dist/lib/ai/node-handler.js +48 -0
  143. package/dist/lib/ai/node-handler.js.map +1 -0
  144. package/dist/lib/ai/provenance.d.ts +1 -1
  145. package/dist/lib/ai/route-provider.d.ts +1 -1
  146. package/dist/lib/ai/route.d.ts +1 -1
  147. package/dist/lib/ai/shape.d.ts +1 -1
  148. package/dist/lib/ai/translate-document.d.ts +1 -1
  149. package/dist/lib/ai/translate-document.js +3 -3
  150. package/dist/lib/ai/vite.d.ts +32 -0
  151. package/dist/lib/ai/vite.js +97 -0
  152. package/dist/lib/ai/vite.js.map +1 -0
  153. package/dist/lib/ai-panel.js +1 -1
  154. package/dist/lib/assets/index.d.ts +4 -4
  155. package/dist/lib/assets/index.js +4 -4
  156. package/dist/lib/assets/upload.d.ts +2 -2
  157. package/dist/lib/assets/upload.js +2 -2
  158. package/dist/lib/auth/convex-auth-adapter.d.ts +2 -2
  159. package/dist/lib/auth/convex-auth-adapter.js +1 -1
  160. package/dist/lib/auth/dev-auto-login-adapter.d.ts +1 -1
  161. package/dist/lib/auth/index.d.ts +9 -9
  162. package/dist/lib/auth/index.js +10 -10
  163. package/dist/lib/auth/local-auth-adapter.d.ts +1 -1
  164. package/dist/lib/auth/route-guard.d.ts +1 -1
  165. package/dist/lib/auth-errors.d.ts +1 -1
  166. package/dist/lib/clipboard/index.d.ts +3 -3
  167. package/dist/lib/clipboard/index.js +3 -3
  168. package/dist/lib/cms/published-documents.d.ts +1 -1
  169. package/dist/lib/cms-views/index.d.ts +2 -2
  170. package/dist/lib/cms-views/index.js +2 -2
  171. package/dist/lib/collection-view/collection-view-source.d.ts +4 -4
  172. package/dist/lib/data/collection-content.js +1 -1
  173. package/dist/lib/data/data-store.js +6 -6
  174. package/dist/lib/data/index.d.ts +4 -4
  175. package/dist/lib/data/index.js +4 -4
  176. package/dist/lib/data/sample-capture.js +4 -4
  177. package/dist/lib/data/sources-store.d.ts +1 -1
  178. package/dist/lib/diff-view-preference.js +1 -1
  179. package/dist/lib/dnd/gap-drag.d.ts +1 -1
  180. package/dist/lib/i18n/i18n.d.ts +1 -1
  181. package/dist/lib/i18n/i18n.js +1 -1
  182. package/dist/lib/i18n/index.d.ts +4 -4
  183. package/dist/lib/i18n/index.js +3 -3
  184. package/dist/lib/i18n/messages.en.d.ts +1 -1
  185. package/dist/lib/i18n/messages.en.js +1 -1
  186. package/dist/lib/locale/binding-fallback.d.ts +1 -1
  187. package/dist/lib/locale/binding-fallback.js +2 -2
  188. package/dist/lib/locale/index.d.ts +6 -6
  189. package/dist/lib/locale/index.js +6 -6
  190. package/dist/lib/locale/locale-switcher.js +3 -3
  191. package/dist/lib/locale/use-studio-locale.js +1 -1
  192. package/dist/lib/operations/asset-repository.d.ts +1 -1
  193. package/dist/lib/operations/cms-persistence.d.ts +1 -1
  194. package/dist/lib/operations/cms-persistence.js +1 -1
  195. package/dist/lib/operations/index.d.ts +6 -6
  196. package/dist/lib/operations/index.js +6 -6
  197. package/dist/lib/operations/session-hydration.d.ts +1 -1
  198. package/dist/lib/operations/session-hydration.js +1 -1
  199. package/dist/lib/operations/studio-operations.d.ts +1 -1
  200. package/dist/lib/operations/studio-operations.js +3 -3
  201. package/dist/lib/persistence/convex-adapter.js +2 -2
  202. package/dist/lib/persistence/convex-blob-storage.d.ts +1 -1
  203. package/dist/lib/persistence/convex-blob-storage.js +1 -1
  204. package/dist/lib/persistence/deployment-readiness.d.ts +2 -2
  205. package/dist/lib/persistence/index.d.ts +6 -6
  206. package/dist/lib/persistence/index.js +7 -7
  207. package/dist/lib/persona/labels.js +1 -1
  208. package/dist/lib/query/index.d.ts +2 -2
  209. package/dist/lib/query/index.js +1 -1
  210. package/dist/lib/rail.js +1 -1
  211. package/dist/lib/references/impact.d.ts +1 -1
  212. package/dist/lib/references/impact.js +1 -1
  213. package/dist/lib/references/index.d.ts +3 -3
  214. package/dist/lib/references/index.js +3 -3
  215. package/dist/lib/references/references-store.d.ts +2 -2
  216. package/dist/lib/references/references-store.js +3 -3
  217. package/dist/lib/registry/index.js +2 -2
  218. package/dist/lib/theme.js +1 -1
  219. package/dist/lib/webhooks/config.d.ts +1 -1
  220. package/dist/lib/webhooks/config.js +2 -2
  221. package/dist/lib/webhooks/dispatcher.js +2 -2
  222. package/dist/lib/webhooks/index.d.ts +6 -6
  223. package/dist/lib/webhooks/index.js +4 -4
  224. package/dist/lib/workspace/index.d.ts +7 -7
  225. package/dist/lib/workspace/index.js +3 -3
  226. package/dist/lib/workspace/switcher-source.d.ts +1 -1
  227. package/dist/router/index.d.ts +1 -1
  228. package/dist/router/index.js +1 -1
  229. package/dist/ui/avatar.js +1 -1
  230. package/dist/ui/badge.js +1 -1
  231. package/dist/ui/button.js +1 -1
  232. package/dist/ui/card.js +1 -1
  233. package/dist/ui/collapsible-section.js +2 -2
  234. package/dist/ui/dialog.js +1 -1
  235. package/dist/ui/dropdown-menu.js +1 -1
  236. package/dist/ui/field.js +1 -1
  237. package/dist/ui/index.d.ts +19 -19
  238. package/dist/ui/index.js +19 -19
  239. package/dist/ui/input.js +1 -1
  240. package/dist/ui/inspector.js +1 -1
  241. package/dist/ui/layout.js +1 -1
  242. package/dist/ui/panel.js +2 -2
  243. package/dist/ui/popover.js +1 -1
  244. package/dist/ui/row-item.js +2 -2
  245. package/dist/ui/segmented-control.js +1 -1
  246. package/dist/ui/separator.js +1 -1
  247. package/dist/ui/toolbar.js +2 -2
  248. package/dist/ui/typography.js +1 -1
  249. package/package.json +13 -5
  250. package/dist/components/assets/asset-library.d.ts +0 -14
  251. package/dist/components/assets/asset-library.js +0 -202
  252. package/dist/components/assets/asset-library.js.map +0 -1
  253. package/dist/components/backend-gate.d.ts +0 -19
  254. package/dist/components/backend-gate.js +0 -64
  255. package/dist/components/backend-gate.js.map +0 -1
  256. package/dist/components/builder/composition-scope.d.ts +0 -16
  257. package/dist/components/builder/composition-scope.js +0 -7
  258. package/dist/components/builder/composition-scope.js.map +0 -1
  259. package/dist/components/cms/alias-selector.d.ts +0 -20
  260. package/dist/components/cms/alias-selector.js +0 -34
  261. package/dist/components/cms/alias-selector.js.map +0 -1
  262. package/dist/components/cms/collections-sidebar.d.ts +0 -18
  263. package/dist/components/cms/collections-sidebar.js +0 -36
  264. package/dist/components/cms/collections-sidebar.js.map +0 -1
  265. package/dist/components/cms/new-page-dialog.d.ts +0 -22
  266. package/dist/components/cms/new-page-dialog.js +0 -42
  267. package/dist/components/cms/new-page-dialog.js.map +0 -1
  268. package/dist/components/cms/rich-text/embed-control.d.ts +0 -17
  269. package/dist/components/cms/rich-text/embed-control.js +0 -62
  270. package/dist/components/cms/rich-text/embed-control.js.map +0 -1
  271. package/dist/components/cms/rich-text/image-control.d.ts +0 -16
  272. package/dist/components/cms/rich-text/image-control.js +0 -36
  273. package/dist/components/cms/rich-text/image-control.js.map +0 -1
  274. package/dist/components/components/fixture-runner.d.ts +0 -10
  275. package/dist/components/components/fixture-runner.js +0 -27
  276. package/dist/components/components/fixture-runner.js.map +0 -1
  277. package/dist/components/references/builder-deep-link.d.ts +0 -12
  278. package/dist/components/references/builder-deep-link.js +0 -53
  279. package/dist/components/references/builder-deep-link.js.map +0 -1
  280. package/dist/components/routes/redirect-chain.d.ts +0 -9
  281. package/dist/components/routes/redirect-chain.js +0 -16
  282. package/dist/components/routes/redirect-chain.js.map +0 -1
  283. package/dist/components/routes/redirect-manager.d.ts +0 -13
  284. package/dist/components/routes/redirect-manager.js +0 -24
  285. package/dist/components/routes/redirect-manager.js.map +0 -1
  286. package/dist/components/routes/route-list.d.ts +0 -35
  287. package/dist/components/routes/route-list.js +0 -69
  288. package/dist/components/routes/route-list.js.map +0 -1
  289. package/dist/components/routes/routes-shell.d.ts +0 -14
  290. package/dist/components/routes/routes-shell.js +0 -68
  291. package/dist/components/routes/routes-shell.js.map +0 -1
  292. package/dist/components/sections.d.ts +0 -37
  293. package/dist/components/sections.js +0 -62
  294. package/dist/components/sections.js.map +0 -1
  295. package/dist/components/users/user-search.d.ts +0 -8
  296. package/dist/components/users/user-search.js +0 -13
  297. package/dist/components/users/user-search.js.map +0 -1
  298. package/dist/components/workspace-gate.d.ts +0 -12
  299. package/dist/components/workspace-gate.js +0 -28
  300. package/dist/components/workspace-gate.js.map +0 -1
  301. package/dist/lib/cms-views/views-store.d.ts +0 -70
  302. package/dist/lib/cms-views/views-store.js +0 -129
  303. package/dist/lib/cms-views/views-store.js.map +0 -1
  304. package/dist/lib/operations/graph-commands.d.ts +0 -136
  305. package/dist/lib/operations/graph-commands.js +0 -85
  306. package/dist/lib/operations/graph-commands.js.map +0 -1
  307. package/dist/lib/operations/graph-persistence.d.ts +0 -27
  308. package/dist/lib/operations/graph-persistence.js +0 -35
  309. package/dist/lib/operations/graph-persistence.js.map +0 -1
  310. package/dist/lib/routing/index.d.ts +0 -10
  311. package/dist/lib/routing/index.js +0 -11
  312. package/dist/lib/routing/index.js.map +0 -1
  313. package/dist/lib/routing/routing-analysis.d.ts +0 -26
  314. package/dist/lib/routing/routing-analysis.js +0 -37
  315. package/dist/lib/routing/routing-analysis.js.map +0 -1
  316. package/dist/lib/routing/routing-store.d.ts +0 -50
  317. package/dist/lib/routing/routing-store.js +0 -72
  318. package/dist/lib/routing/routing-store.js.map +0 -1
  319. package/dist/lib/working-graph.d.ts +0 -82
  320. package/dist/lib/working-graph.js +0 -113
  321. package/dist/lib/working-graph.js.map +0 -1
@@ -1 +0,0 @@
1
- {"version":3,"file":"workspace-gate.js","sourceRoot":"","sources":["../../src/components/workspace-gate.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,UAAU,EAAE,SAAS,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAA;AAClG,OAAO,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAA;AAEnE,OAAO,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAA;AAEtD;;;;;;;GAOG;AACH,MAAM,UAAU,aAAa,CAAC,EAAE,QAAQ,EAA2B;IACjE,MAAM,SAAS,GAAG,iBAAiB,EAAE,CAAA;IACrC,IAAI,SAAS,CAAC,IAAI,KAAK,SAAS;QAAE,OAAO,KAAC,0BAA0B,IAAC,SAAS,EAAE,SAAS,GAAI,CAAA;IAC7F,OAAO,4BAAG,QAAQ,GAAI,CAAA;AACxB,C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CAAC,CAAC,EAAE,IACrC,EACP,KAAC,IAAI,IAAC,IAAI,EAAC,IAAI,YAAE,OAAO,GAAQ,IAC5B,CACP,CAAA;AACH,CAAC;AAED,SAAS,eAAe,CAAC,IAAoC;IAC3D,OAAO,IAAI,CAAC,MAAM,CAChB,CAAC,GAAG,EAAE,IAAI,EAAE,EAAE,CAAC,CAAC,OAAO,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAC,GAAG,GAAG,IAAI,IAAI,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,GAAG,IAAI,IAAI,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,EAC7F,EAAE,CACH,CAAA;AACH,CAAC","sourcesContent":["import type { ReactNode } from 'react'\nimport { Card, CardContent, CardHeader, CardTitle, Code, Stack, Text } from '@elytracms/studio/ui'\nimport { getWorkspaceState } from '@elytracms/studio/lib/workspace'\nimport type { WorkspaceState } from '@elytracms/studio/lib/workspace'\nimport { translate } from '@elytracms/studio/lib/i18n'\n\n/**\n * Workspace-config boot gate (EC-154) — sibling of the EC-153 `BackendGate`.\n * The workspace config is static boot input (bundled `elytra.config.ts` or\n * env-injected JSON), so an *invalid* config is a deterministic boot-error\n * state rendered before auth and the studio store: structured, file-located\n * issues — never a silent fall-back to unconfigured behavior. No config and a\n * valid config render children untouched.\n */\nexport function WorkspaceGate({ children }: { children: ReactNode }) {\n const workspace = getWorkspaceState()\n if (workspace.kind === 'invalid') return <WorkspaceConfigErrorScreen workspace={workspace} />\n return <>{children}</>\n}\n\nfunction WorkspaceConfigErrorScreen({\n workspace,\n}: {\n workspace: Extract<WorkspaceState, { kind: 'invalid' }>\n}) {\n return (\n <div className=\"grid min-h-dvh place-items-center bg-background p-6\">\n <Card className=\"max-w-2xl border-destructive/40\">\n <CardHeader>\n <CardTitle>{translate('shell.workspaceGate.title')}</CardTitle>\n </CardHeader>\n <CardContent>\n <Stack gap=\"3\">\n <Text size=\"sm\" tone=\"muted\">\n The studio loaded a workspace config from <Code>{workspace.source}</Code>, but it\n failed validation. Fix the issues below and reload — the studio never falls back to\n unconfigured behavior while a config is present.\n </Text>\n <Stack gap=\"2\" role=\"list\" aria-label={translate('shell.workspaceGate.issuesLabel')}>\n {workspace.issues.map((issue, index) => (\n <WorkspaceIssueLine\n key={`${issue.code}-${index}`}\n code={issue.code}\n message={issue.message}\n location={formatIssuePath(issue.path)}\n />\n ))}\n </Stack>\n <Text size=\"xs\" tone=\"muted\">\n Validate locally with <Code>builder init --project &lt;slug&gt;</Code> — the CLI runs\n the same schema and reports the same issues.\n </Text>\n </Stack>\n </CardContent>\n </Card>\n </div>\n )\n}\n\nfunction WorkspaceIssueLine({\n code,\n message,\n location,\n}: {\n code: string\n message: string\n location: string\n}) {\n return (\n <div role=\"listitem\" className=\"rounded-md border border-destructive/30 bg-destructive/5 p-2\">\n <Text size=\"xs\" mono className=\"text-destructive\">\n [{code}]{location ? ` at ${location}` : ''}\n </Text>\n <Text size=\"sm\">{message}</Text>\n </div>\n )\n}\n\nfunction formatIssuePath(path: ReadonlyArray<string | number>): string {\n return path.reduce<string>(\n (acc, part) => (typeof part === 'number' ? `${acc}[${part}]` : acc ? `${acc}.${part}` : part),\n '',\n )\n}\n"]}
@@ -1,70 +0,0 @@
1
- import { z } from 'zod';
2
- import type { CmsDocument, CollectionDef } from '@elytracms/core/cms-core';
3
- import type { OperationResult, OperationsClient } from '../operations';
4
- /**
5
- * Saved-view persistence for the CMS collection table (EC-169).
6
- *
7
- * Views are project-scoped (shared by every editor on the project) and follow
8
- * the EC-170 routing-store pattern: one system collection holds one document
9
- * per saved view, and every mutation goes through the *existing*
10
- * `@elytracms/core/operations` commands (`schema.upsertCollection`,
11
- * `documents.upsert`, `documents.delete`). The settings domain was the other
12
- * candidate, but `settings.update` patches the closed `projectSettingsSchema`
13
- * (locales/environments/export target) — saved views don't fit it without a
14
- * studio-core schema change, while the system collection needs no new
15
- * operations surface at all.
16
- *
17
- * Deleting a saved view is exactly one `documents.delete` against THIS
18
- * collection — it can never touch content documents.
19
- */
20
- export declare const VIEWS_COLLECTION = "cms-saved-views";
21
- /** System collection holding one document per {@link SavedViewRecord}. */
22
- export declare const viewsCollectionDef: CollectionDef;
23
- /** A persisted saved view: identity + the table state it restores. */
24
- export declare const savedViewRecordSchema: z.ZodObject<{
25
- id: z.ZodString;
26
- name: z.ZodString;
27
- collection: z.ZodString;
28
- state: z.ZodObject<{
29
- filters: z.ZodArray<z.ZodObject<{
30
- field: z.ZodString;
31
- op: z.ZodEnum<{
32
- in: "in";
33
- eq: "eq";
34
- gt: "gt";
35
- gte: "gte";
36
- lt: "lt";
37
- lte: "lte";
38
- }>;
39
- value: z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>, z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>]>;
40
- }, z.core.$strip>>;
41
- sort: z.ZodNullable<z.ZodObject<{
42
- field: z.ZodString;
43
- dir: z.ZodEnum<{
44
- desc: "desc";
45
- asc: "asc";
46
- }>;
47
- }, z.core.$strip>>;
48
- columns: z.ZodArray<z.ZodString>;
49
- hidden: z.ZodDefault<z.ZodArray<z.ZodString>>;
50
- }, z.core.$strip>;
51
- }, z.core.$strip>;
52
- export type SavedViewRecord = z.infer<typeof savedViewRecordSchema>;
53
- export declare function viewToDocument(record: SavedViewRecord): CmsDocument;
54
- export declare function documentToView(document: CmsDocument): SavedViewRecord | undefined;
55
- /** Load every persisted saved view of a project (malformed records dropped). */
56
- export declare function loadSavedViews(operations: OperationsClient, projectId: string): Promise<OperationResult<SavedViewRecord[]>>;
57
- /** Group loaded records by their content collection (for per-collection lookup). */
58
- export declare function groupSavedViews(records: readonly SavedViewRecord[]): Record<string, SavedViewRecord[]>;
59
- /**
60
- * Make sure the system collection exists in the project's CMS schema so
61
- * `documents.upsert` accepts view documents. Idempotent. Callers that share a
62
- * project with the CMS session must run the session's persisted baseline
63
- * FIRST — creating this collection on a schema-less project would otherwise
64
- * make the baseline think the content schema is already persisted.
65
- */
66
- export declare function ensureViewsCollection(_operations: OperationsClient, _projectId: string): Promise<OperationResult<void>>;
67
- /** Create or update a saved view (operations command). */
68
- export declare function saveSavedView(operations: OperationsClient, projectId: string, record: SavedViewRecord): Promise<OperationResult<void>>;
69
- /** Delete a saved view — a view-only operation on the system collection. */
70
- export declare function deleteSavedView(operations: OperationsClient, projectId: string, viewId: string): Promise<OperationResult<void>>;
@@ -1,129 +0,0 @@
1
- import { z } from 'zod';
2
- import { tableViewStateSchema } from './view-model';
3
- /**
4
- * Saved-view persistence for the CMS collection table (EC-169).
5
- *
6
- * Views are project-scoped (shared by every editor on the project) and follow
7
- * the EC-170 routing-store pattern: one system collection holds one document
8
- * per saved view, and every mutation goes through the *existing*
9
- * `@elytracms/core/operations` commands (`schema.upsertCollection`,
10
- * `documents.upsert`, `documents.delete`). The settings domain was the other
11
- * candidate, but `settings.update` patches the closed `projectSettingsSchema`
12
- * (locales/environments/export target) — saved views don't fit it without a
13
- * studio-core schema change, while the system collection needs no new
14
- * operations surface at all.
15
- *
16
- * Deleting a saved view is exactly one `documents.delete` against THIS
17
- * collection — it can never touch content documents.
18
- */
19
- export const VIEWS_COLLECTION = 'cms-saved-views';
20
- /** System collection holding one document per {@link SavedViewRecord}. */
21
- export const viewsCollectionDef = {
22
- id: VIEWS_COLLECTION,
23
- kind: 'document',
24
- titleField: 'name',
25
- form: {
26
- label: 'Saved views',
27
- labelSingular: 'Saved view',
28
- description: 'System collection managed by the CMS collection table.',
29
- },
30
- fields: [
31
- { name: 'name', type: 'text', validation: { required: true } },
32
- { name: 'collection', type: 'text', validation: { required: true } },
33
- /** The view's filter/sort/column state, JSON-serialized (validated by Zod on read). */
34
- { name: 'config', type: 'text', validation: { required: true } },
35
- ],
36
- };
37
- /** A persisted saved view: identity + the table state it restores. */
38
- export const savedViewRecordSchema = z.object({
39
- id: z.string().min(1),
40
- name: z.string().min(1),
41
- /** The content collection the view belongs to. */
42
- collection: z.string().min(1),
43
- state: tableViewStateSchema,
44
- });
45
- // ---- Record ⇄ document mapping ----
46
- export function viewToDocument(record) {
47
- const parsed = savedViewRecordSchema.parse(record);
48
- return {
49
- collection: VIEWS_COLLECTION,
50
- id: parsed.id,
51
- values: {
52
- name: parsed.name,
53
- collection: parsed.collection,
54
- config: JSON.stringify(parsed.state),
55
- },
56
- };
57
- }
58
- export function documentToView(document) {
59
- const values = document.values;
60
- let state;
61
- try {
62
- state = typeof values.config === 'string' ? JSON.parse(values.config) : undefined;
63
- }
64
- catch {
65
- return undefined;
66
- }
67
- const parsed = savedViewRecordSchema.safeParse({
68
- id: document.id,
69
- name: values.name,
70
- collection: values.collection,
71
- state,
72
- });
73
- return parsed.success ? parsed.data : undefined;
74
- }
75
- // ---- Reads & writes through @elytracms/operations ----
76
- /** Load every persisted saved view of a project (malformed records dropped). */
77
- export async function loadSavedViews(operations, projectId) {
78
- const result = await operations.documents.list({ projectId, collection: VIEWS_COLLECTION });
79
- if (!result.ok)
80
- return result;
81
- return {
82
- ok: true,
83
- value: result.value
84
- .map((record) => documentToView(record.document))
85
- .filter((view) => view !== undefined),
86
- };
87
- }
88
- /** Group loaded records by their content collection (for per-collection lookup). */
89
- export function groupSavedViews(records) {
90
- const grouped = {};
91
- for (const record of records) {
92
- ;
93
- (grouped[record.collection] ??= []).push(record);
94
- }
95
- return grouped;
96
- }
97
- /**
98
- * Make sure the system collection exists in the project's CMS schema so
99
- * `documents.upsert` accepts view documents. Idempotent. Callers that share a
100
- * project with the CMS session must run the session's persisted baseline
101
- * FIRST — creating this collection on a schema-less project would otherwise
102
- * make the baseline think the content schema is already persisted.
103
- */
104
- export async function ensureViewsCollection(_operations, _projectId) {
105
- // No-op (EC-183, AD-11): the saved-views system collection is config-owned and
106
- // the backend stores documents without a schema-membership check — nothing to
107
- // register. `viewsCollectionDef` remains the canonical document shape.
108
- return { ok: true, value: undefined };
109
- }
110
- /** Create or update a saved view (operations command). */
111
- export async function saveSavedView(operations, projectId, record) {
112
- const ensured = await ensureViewsCollection(operations, projectId);
113
- if (!ensured.ok)
114
- return ensured;
115
- const result = await operations.documents.upsert({
116
- projectId,
117
- document: viewToDocument(record),
118
- });
119
- return result.ok ? { ok: true, value: undefined } : result;
120
- }
121
- /** Delete a saved view — a view-only operation on the system collection. */
122
- export async function deleteSavedView(operations, projectId, viewId) {
123
- const result = await operations.documents.delete({
124
- projectId,
125
- ref: { collection: VIEWS_COLLECTION, id: viewId },
126
- });
127
- return result.ok ? { ok: true, value: undefined } : result;
128
- }
129
- //# sourceMappingURL=views-store.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"views-store.js","sourceRoot":"","sources":["../../../src/lib/cms-views/views-store.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAGvB,OAAO,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAA;AAEnD;;;;;;;;;;;;;;;GAeG;AAEH,MAAM,CAAC,MAAM,gBAAgB,GAAG,iBAAiB,CAAA;AAEjD,0EAA0E;AAC1E,MAAM,CAAC,MAAM,kBAAkB,GAAkB;IAC/C,EAAE,EAAE,gBAAgB;IACpB,IAAI,EAAE,UAAU;IAChB,UAAU,EAAE,MAAM;IAClB,IAAI,EAAE;QACJ,KAAK,EAAE,aAAa;QACpB,aAAa,EAAE,YAAY;QAC3B,WAAW,EAAE,wDAAwD;KACtE;IACD,MAAM,EAAE;QACN,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,UAAU,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,EAAE;QAC9D,EAAE,IAAI,EAAE,YAAY,EAAE,IAAI,EAAE,MAAM,EAAE,UAAU,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,EAAE;QACpE,uFAAuF;QACvF,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,EAAE,UAAU,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE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1D,MAAM,CAAC,KAAK,UAAU,aAAa,CACjC,UAA4B,EAC5B,SAAiB,EACjB,MAAuB;IAEvB,MAAM,OAAO,GAAG,MAAM,qBAAqB,CAAC,UAAU,EAAE,SAAS,CAAC,CAAA;IAClE,IAAI,CAAC,OAAO,CAAC,EAAE;QAAE,OAAO,OAAO,CAAA;IAC/B,MAAM,MAAM,GAAG,MAAM,UAAU,CAAC,SAAS,CAAC,MAAM,CAAC;QAC/C,SAAS;QACT,QAAQ,EAAE,cAAc,CAAC,MAAM,CAAC;KACjC,CAAC,CAAA;IACF,OAAO,MAAM,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,SAAS,EAAE,CAAC,CAAC,CAAC,MAAM,CAAA;AAC5D,CAAC;AAED,4EAA4E;AAC5E,MAAM,CAAC,KAAK,UAAU,eAAe,CACnC,UAA4B,EAC5B,SAAiB,EACjB,MAAc;IAEd,MAAM,MAAM,GAAG,MAAM,UAAU,CAAC,SAAS,CAAC,MAAM,CAAC;QAC/C,SAAS;QACT,GAAG,EAAE,EAAE,UAAU,EAAE,gBAAgB,EAAE,EAAE,EAAE,MAAM,EAAE;KAClD,CAAC,CAAA;IACF,OAAO,MAAM,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,SAAS,EAAE,CAAC,CAAC,CAAC,MAAM,CAAA;AAC5D,CAAC","sourcesContent":["import { z } from 'zod'\nimport type { CmsDocument, CollectionDef } from '@elytracms/core/cms-core'\nimport type { OperationResult, OperationsClient } from '../operations'\nimport { tableViewStateSchema } from './view-model'\n\n/**\n * Saved-view persistence for the CMS collection table (EC-169).\n *\n * Views are project-scoped (shared by every editor on the project) and follow\n * the EC-170 routing-store pattern: one system collection holds one document\n * per saved view, and every mutation goes through the *existing*\n * `@elytracms/core/operations` commands (`schema.upsertCollection`,\n * `documents.upsert`, `documents.delete`). The settings domain was the other\n * candidate, but `settings.update` patches the closed `projectSettingsSchema`\n * (locales/environments/export target) — saved views don't fit it without a\n * studio-core schema change, while the system collection needs no new\n * operations surface at all.\n *\n * Deleting a saved view is exactly one `documents.delete` against THIS\n * collection — it can never touch content documents.\n */\n\nexport const VIEWS_COLLECTION = 'cms-saved-views'\n\n/** System collection holding one document per {@link SavedViewRecord}. */\nexport const viewsCollectionDef: CollectionDef = {\n id: VIEWS_COLLECTION,\n kind: 'document',\n titleField: 'name',\n form: {\n label: 'Saved views',\n labelSingular: 'Saved view',\n description: 'System collection managed by the CMS collection table.',\n },\n fields: [\n { name: 'name', type: 'text', validation: { required: true } },\n { name: 'collection', type: 'text', validation: { required: true } },\n /** The view's filter/sort/column state, JSON-serialized (validated by Zod on read). */\n { name: 'config', type: 'text', validation: { required: true } },\n ],\n}\n\n/** A persisted saved view: identity + the table state it restores. */\nexport const savedViewRecordSchema = z.object({\n id: z.string().min(1),\n name: z.string().min(1),\n /** The content collection the view belongs to. */\n collection: z.string().min(1),\n state: tableViewStateSchema,\n})\nexport type SavedViewRecord = z.infer<typeof savedViewRecordSchema>\n\n// ---- Record ⇄ document mapping ----\n\nexport function viewToDocument(record: SavedViewRecord): CmsDocument {\n const parsed = savedViewRecordSchema.parse(record)\n return {\n collection: VIEWS_COLLECTION,\n id: parsed.id,\n values: {\n name: parsed.name,\n collection: parsed.collection,\n config: JSON.stringify(parsed.state),\n },\n }\n}\n\nexport function documentToView(document: CmsDocument): SavedViewRecord | undefined {\n const values = document.values\n let state: unknown\n try {\n state = typeof values.config === 'string' ? JSON.parse(values.config) : undefined\n } catch {\n return undefined\n }\n const parsed = savedViewRecordSchema.safeParse({\n id: document.id,\n name: values.name,\n collection: values.collection,\n state,\n })\n return parsed.success ? parsed.data : undefined\n}\n\n// ---- Reads & writes through @elytracms/operations ----\n\n/** Load every persisted saved view of a project (malformed records dropped). */\nexport async function loadSavedViews(\n operations: OperationsClient,\n projectId: string,\n): Promise<OperationResult<SavedViewRecord[]>> {\n const result = await operations.documents.list({ projectId, collection: VIEWS_COLLECTION })\n if (!result.ok) return result\n return {\n ok: true,\n value: result.value\n .map((record) => documentToView(record.document))\n .filter((view): view is SavedViewRecord => view !== undefined),\n }\n}\n\n/** Group loaded records by their content collection (for per-collection lookup). */\nexport function groupSavedViews(\n records: readonly SavedViewRecord[],\n): Record<string, SavedViewRecord[]> {\n const grouped: Record<string, SavedViewRecord[]> = {}\n for (const record of records) {\n ;(grouped[record.collection] ??= []).push(record)\n }\n return grouped\n}\n\n/**\n * Make sure the system collection exists in the project's CMS schema so\n * `documents.upsert` accepts view documents. Idempotent. Callers that share a\n * project with the CMS session must run the session's persisted baseline\n * FIRST — creating this collection on a schema-less project would otherwise\n * make the baseline think the content schema is already persisted.\n */\nexport async function ensureViewsCollection(\n _operations: OperationsClient,\n _projectId: string,\n): Promise<OperationResult<void>> {\n // No-op (EC-183, AD-11): the saved-views system collection is config-owned and\n // the backend stores documents without a schema-membership check — nothing to\n // register. `viewsCollectionDef` remains the canonical document shape.\n return { ok: true, value: undefined }\n}\n\n/** Create or update a saved view (operations command). */\nexport async function saveSavedView(\n operations: OperationsClient,\n projectId: string,\n record: SavedViewRecord,\n): Promise<OperationResult<void>> {\n const ensured = await ensureViewsCollection(operations, projectId)\n if (!ensured.ok) return ensured\n const result = await operations.documents.upsert({\n projectId,\n document: viewToDocument(record),\n })\n return result.ok ? { ok: true, value: undefined } : result\n}\n\n/** Delete a saved view — a view-only operation on the system collection. */\nexport async function deleteSavedView(\n operations: OperationsClient,\n projectId: string,\n viewId: string,\n): Promise<OperationResult<void>> {\n const result = await operations.documents.delete({\n projectId,\n ref: { collection: VIEWS_COLLECTION, id: viewId },\n })\n return result.ok ? { ok: true, value: undefined } : result\n}\n"]}
@@ -1,136 +0,0 @@
1
- import type { ComponentNode, InsertTarget, ProjectGraph, PropValue } from '@elytracms/core/project-graph';
2
- import type { WorkingGraph, WorkingPageSeo } from '../working-graph';
3
- import type { OperationResult, OperationsClient } from './operations-package';
4
- /**
5
- * Builder action → graph operation mapping (EC-141, reshaped by EC-187).
6
- *
7
- * The canonical `ProjectGraph` is now LAYOUTS-ONLY, and the page-node graph
8
- * commands (`graph.insertNode`/`removeNode`/`duplicateNode`/`moveNode`/
9
- * `reorderNode`/`setNodeProp`/`removeNodeProp`/`setNodeCondition`) were DELETED
10
- * from the operations layer — a page is a CMS document now, edited through the
11
- * composition-field path, not mirrored as node ops. So every page-tree edit
12
- * here returns `null`: the legacy `/builder` page editor is in-memory-only for
13
- * page edits (it is retired in a later slice).
14
- *
15
- * What still persists: `loadGraph` (restoring a saved revision), `undo`, and
16
- * `redo` each save the whole graph via `graph.save` — but a `graph.save`
17
- * persists a CANONICAL layouts-only `ProjectGraph`, so the WorkingGraph
18
- * `present` is converted via `toProjectGraph` before it is sent.
19
- */
20
- /** The builder store's action union (owned here so the mapping stays React-free). */
21
- export type BuilderAction =
22
- /** `pageId` additionally switches the active page (reference deep links, EC-172). */
23
- {
24
- type: 'select';
25
- id: string | null;
26
- pageId?: string;
27
- } | {
28
- type: 'hover';
29
- id: string | null;
30
- } | {
31
- type: 'viewport';
32
- viewport: 'desktop' | 'tablet' | 'mobile';
33
- } | {
34
- type: 'undo';
35
- } | {
36
- type: 'redo';
37
- } | {
38
- type: 'insert';
39
- target: InsertTarget;
40
- node: ComponentNode;
41
- select?: boolean;
42
- } | {
43
- type: 'remove';
44
- id: string;
45
- } | {
46
- type: 'duplicate';
47
- id: string;
48
- } | {
49
- type: 'reorder';
50
- id: string;
51
- delta: -1 | 1;
52
- } | {
53
- type: 'move';
54
- id: string;
55
- target: InsertTarget;
56
- }
57
- /**
58
- * EC-162 layout gesture: wrap the reference node and the dragged subject in
59
- * a two-column Grid container as ONE atomic structural edit (one undo step).
60
- */
61
- | {
62
- type: 'wrap';
63
- referenceId: string;
64
- side: 'left' | 'right';
65
- subject: {
66
- kind: 'node';
67
- nodeId: string;
68
- } | {
69
- kind: 'component';
70
- node: ComponentNode;
71
- };
72
- } | {
73
- type: 'setProp';
74
- id: string;
75
- name: string;
76
- value: PropValue;
77
- coalesceKey?: string;
78
- } | {
79
- type: 'removeProp';
80
- id: string;
81
- name: string;
82
- }
83
- /**
84
- * EC-171 legacy page SEO (in-memory only): set a working page's `seo` block.
85
- * Page SEO persists via the `page` CMS document now, never as a node op — so
86
- * this action does not mirror to a `graph.*` command.
87
- */
88
- | {
89
- type: 'setPageSeo';
90
- pageId: string;
91
- seo: WorkingPageSeo | undefined;
92
- } | {
93
- type: 'loadGraph';
94
- graph: ProjectGraph;
95
- };
96
- /** The slice of builder state the mapping needs (pre-dispatch snapshot). */
97
- export interface BuilderSnapshot {
98
- present: WorkingGraph;
99
- pageId: string;
100
- nodeSeq: number;
101
- }
102
- /** A graph operation invocation, dispatchable via `operations.execute`. */
103
- export interface GraphInvocation {
104
- operation: string;
105
- input: unknown;
106
- }
107
- /**
108
- * Map a dispatched builder action onto the `graph.*` command that persists it.
109
- *
110
- * After EC-187 only the whole-graph operations survive: `loadGraph`/`undo`/
111
- * `redo` persist a layouts-only `ProjectGraph` via `graph.save`. Every
112
- * page-tree edit (insert/remove/duplicate/move/reorder/wrap/setProp/
113
- * removeProp) returns `null` — page-node graph commands are gone;
114
- * those edits stay in-memory until the page is saved as a CMS document.
115
- */
116
- export declare function graphInvocationFor(projectId: string, action: BuilderAction, prev: BuilderSnapshot, next: {
117
- present: WorkingGraph;
118
- }): GraphInvocation | null;
119
- /**
120
- * Make the persisted latest revision equal `graph` (the session's working
121
- * graph) so node-level `graph.*` commands apply onto identical state. Saves a
122
- * baseline revision when the project has no revision yet or the persisted
123
- * latest diverged from the session (the builder session is the source of
124
- * truth for the draft timeline — see the builder-store design note).
125
- */
126
- export declare function ensureGraphBaseline(operations: OperationsClient, projectId: string, graph: ProjectGraph | WorkingGraph): Promise<OperationResult<unknown>>;
127
- /**
128
- * Persist "publish the session's latest state" (EC-141): ensure the working
129
- * graph is the persisted latest revision (as the canonical layouts-only
130
- * graph), then pin it live via `publishing.publish`. Single-environment
131
- * (EC-179): a deployment IS one environment, so there is no target environment
132
- * and no promote.
133
- */
134
- export declare function persistPublish(operations: OperationsClient, projectId: string, workingGraph: ProjectGraph | WorkingGraph): Promise<OperationResult<unknown>>;
135
- /** Persist an unpublish: revert the deployment to draft. */
136
- export declare function persistUnpublish(operations: OperationsClient, projectId: string): Promise<OperationResult<unknown>>;
@@ -1,85 +0,0 @@
1
- import { toProjectGraph } from '../working-graph';
2
- /**
3
- * Map a dispatched builder action onto the `graph.*` command that persists it.
4
- *
5
- * After EC-187 only the whole-graph operations survive: `loadGraph`/`undo`/
6
- * `redo` persist a layouts-only `ProjectGraph` via `graph.save`. Every
7
- * page-tree edit (insert/remove/duplicate/move/reorder/wrap/setProp/
8
- * removeProp) returns `null` — page-node graph commands are gone;
9
- * those edits stay in-memory until the page is saved as a CMS document.
10
- */
11
- export function graphInvocationFor(projectId, action, prev, next) {
12
- switch (action.type) {
13
- case 'undo':
14
- case 'redo': {
15
- if (prev.present === next.present)
16
- return null;
17
- return {
18
- operation: 'graph.save',
19
- input: {
20
- projectId,
21
- // graph.save persists the canonical layouts-only graph.
22
- graph: toProjectGraph(next.present),
23
- message: action.type === 'undo' ? 'Undo' : 'Redo',
24
- },
25
- };
26
- }
27
- case 'loadGraph':
28
- return {
29
- operation: 'graph.save',
30
- // `loadGraph` carries a canonical (layouts-only) ProjectGraph restore.
31
- input: { projectId, graph: action.graph, message: 'Load graph' },
32
- };
33
- // Page-tree edits no longer mirror to node-level graph commands (those
34
- // operations were deleted) — the page editor is in-memory-only now.
35
- case 'select':
36
- case 'hover':
37
- case 'viewport':
38
- case 'insert':
39
- case 'remove':
40
- case 'duplicate':
41
- case 'reorder':
42
- case 'move':
43
- case 'wrap':
44
- case 'setProp':
45
- case 'removeProp':
46
- case 'setPageSeo':
47
- return null;
48
- default:
49
- return null;
50
- }
51
- }
52
- /**
53
- * Make the persisted latest revision equal `graph` (the session's working
54
- * graph) so node-level `graph.*` commands apply onto identical state. Saves a
55
- * baseline revision when the project has no revision yet or the persisted
56
- * latest diverged from the session (the builder session is the source of
57
- * truth for the draft timeline — see the builder-store design note).
58
- */
59
- export async function ensureGraphBaseline(operations, projectId, graph) {
60
- // A working graph (the live session) is persisted as the canonical
61
- // layouts-only graph; a canonical graph passes through unchanged.
62
- const canonical = 'pages' in graph ? toProjectGraph(graph) : graph;
63
- const latest = await operations.graph.getLatest({ projectId });
64
- if (latest.ok && JSON.stringify(latest.value.graph) === JSON.stringify(canonical))
65
- return latest;
66
- return operations.graph.save({ projectId, graph: canonical, message: 'Builder session baseline' });
67
- }
68
- /**
69
- * Persist "publish the session's latest state" (EC-141): ensure the working
70
- * graph is the persisted latest revision (as the canonical layouts-only
71
- * graph), then pin it live via `publishing.publish`. Single-environment
72
- * (EC-179): a deployment IS one environment, so there is no target environment
73
- * and no promote.
74
- */
75
- export async function persistPublish(operations, projectId, workingGraph) {
76
- const baseline = await ensureGraphBaseline(operations, projectId, workingGraph);
77
- if (!baseline.ok)
78
- return baseline;
79
- return operations.publishing.publish({ projectId });
80
- }
81
- /** Persist an unpublish: revert the deployment to draft. */
82
- export async function persistUnpublish(operations, projectId) {
83
- return operations.publishing.unpublish({ projectId });
84
- }
85
- //# sourceMappingURL=graph-commands.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"graph-commands.js","sourceRoot":"","sources":["../../../src/lib/operations/graph-commands.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAA;AAmEjD;;;;;;;;GAQG;AACH,MAAM,UAAU,kBAAkB,CAChC,SAAiB,EACjB,MAAqB,EACrB,IAAqB,EACrB,IAA+B;IAE/B,QAAQ,MAAM,CAAC,IAAI,EAAE,CAAC;QACpB,KAAK,MAAM,CAAC;QACZ,KAAK,MAAM,CAAC,CAAC,CAAC;YACZ,IAAI,IAAI,CAAC,OAAO,KAAK,IAAI,CAAC,OAAO;gBAAE,OAAO,IAAI,CAAA;YAC9C,OAAO;gBACL,SAAS,EAAE,YAAY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AAC,SAAS,CAAC,SAAS,CAAC;QAAE,OAAO,MAAM,CAAA;IAChG,OAAO,UAAU,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,SAAS,EAAE,OAAO,EAAE,0BAA0B,EAAE,CAAC,CAAA;AACpG,CAAC;AAED;;;;;;GAMG;AACH,MAAM,CAAC,KAAK,UAAU,cAAc,CAClC,UAA4B,EAC5B,SAAiB,EACjB,YAAyC;IAEzC,MAAM,QAAQ,GAAG,MAAM,mBAAmB,CAAC,UAAU,EAAE,SAAS,EAAE,YAAY,CAAC,CAAA;IAC/E,IAAI,CAAC,QAAQ,CAAC,EAAE;QAAE,OAAO,QAAQ,CAAA;IACjC,OAAO,UAAU,CAAC,UAAU,CAAC,OAAO,CAAC,EAAE,SAAS,EAAE,CAAC,CAAA;AACrD,CAAC;AAED,4DAA4D;AAC5D,MAAM,CAAC,KAAK,UAAU,gBAAgB,CACpC,UAA4B,EAC5B,SAAiB;IAEjB,OAAO,UAAU,CAAC,UAAU,CAAC,SAAS,CAAC,EAAE,SAAS,EAAE,CAAC,CAAA;AACvD,CAAC","sourcesContent":["import type {\n ComponentNode,\n InsertTarget,\n ProjectGraph,\n PropValue,\n} from '@elytracms/core/project-graph'\nimport { toProjectGraph } from '../working-graph'\nimport type { WorkingGraph, WorkingPageSeo } from '../working-graph'\nimport type { OperationResult, OperationsClient } from './operations-package'\n\n/**\n * Builder action → graph operation mapping (EC-141, reshaped by EC-187).\n *\n * The canonical `ProjectGraph` is now LAYOUTS-ONLY, and the page-node graph\n * commands (`graph.insertNode`/`removeNode`/`duplicateNode`/`moveNode`/\n * `reorderNode`/`setNodeProp`/`removeNodeProp`/`setNodeCondition`) were DELETED\n * from the operations layer — a page is a CMS document now, edited through the\n * composition-field path, not mirrored as node ops. So every page-tree edit\n * here returns `null`: the legacy `/builder` page editor is in-memory-only for\n * page edits (it is retired in a later slice).\n *\n * What still persists: `loadGraph` (restoring a saved revision), `undo`, and\n * `redo` each save the whole graph via `graph.save` — but a `graph.save`\n * persists a CANONICAL layouts-only `ProjectGraph`, so the WorkingGraph\n * `present` is converted via `toProjectGraph` before it is sent.\n */\n\n/** The builder store's action union (owned here so the mapping stays React-free). */\nexport type BuilderAction =\n /** `pageId` additionally switches the active page (reference deep links, EC-172). */\n | { type: 'select'; id: string | null; pageId?: string }\n | { type: 'hover'; id: string | null }\n | { type: 'viewport'; viewport: 'desktop' | 'tablet' | 'mobile' }\n | { type: 'undo' }\n | { type: 'redo' }\n | { type: 'insert'; target: InsertTarget; node: ComponentNode; select?: boolean }\n | { type: 'remove'; id: string }\n | { type: 'duplicate'; id: string }\n | { type: 'reorder'; id: string; delta: -1 | 1 }\n | { type: 'move'; id: string; target: InsertTarget }\n /**\n * EC-162 layout gesture: wrap the reference node and the dragged subject in\n * a two-column Grid container as ONE atomic structural edit (one undo step).\n */\n | {\n type: 'wrap'\n referenceId: string\n side: 'left' | 'right'\n subject: { kind: 'node'; nodeId: string } | { kind: 'component'; node: ComponentNode }\n }\n | { type: 'setProp'; id: string; name: string; value: PropValue; coalesceKey?: string }\n | { type: 'removeProp'; id: string; name: string }\n /**\n * EC-171 legacy page SEO (in-memory only): set a working page's `seo` block.\n * Page SEO persists via the `page` CMS document now, never as a node op — so\n * this action does not mirror to a `graph.*` command.\n */\n | { type: 'setPageSeo'; pageId: string; seo: WorkingPageSeo | undefined }\n | { type: 'loadGraph'; graph: ProjectGraph }\n\n/** The slice of builder state the mapping needs (pre-dispatch snapshot). */\nexport interface BuilderSnapshot {\n present: WorkingGraph\n pageId: string\n nodeSeq: number\n}\n\n/** A graph operation invocation, dispatchable via `operations.execute`. */\nexport interface GraphInvocation {\n operation: string\n input: unknown\n}\n\n/**\n * Map a dispatched builder action onto the `graph.*` command that persists it.\n *\n * After EC-187 only the whole-graph operations survive: `loadGraph`/`undo`/\n * `redo` persist a layouts-only `ProjectGraph` via `graph.save`. Every\n * page-tree edit (insert/remove/duplicate/move/reorder/wrap/setProp/\n * removeProp) returns `null` — page-node graph commands are gone;\n * those edits stay in-memory until the page is saved as a CMS document.\n */\nexport function graphInvocationFor(\n projectId: string,\n action: BuilderAction,\n prev: BuilderSnapshot,\n next: { present: WorkingGraph },\n): GraphInvocation | null {\n switch (action.type) {\n case 'undo':\n case 'redo': {\n if (prev.present === next.present) return null\n return {\n operation: 'graph.save',\n input: {\n projectId,\n // graph.save persists the canonical layouts-only graph.\n graph: toProjectGraph(next.present),\n message: action.type === 'undo' ? 'Undo' : 'Redo',\n },\n }\n }\n\n case 'loadGraph':\n return {\n operation: 'graph.save',\n // `loadGraph` carries a canonical (layouts-only) ProjectGraph restore.\n input: { projectId, graph: action.graph, message: 'Load graph' },\n }\n\n // Page-tree edits no longer mirror to node-level graph commands (those\n // operations were deleted) — the page editor is in-memory-only now.\n case 'select':\n case 'hover':\n case 'viewport':\n case 'insert':\n case 'remove':\n case 'duplicate':\n case 'reorder':\n case 'move':\n case 'wrap':\n case 'setProp':\n case 'removeProp':\n case 'setPageSeo':\n return null\n\n default:\n return null\n }\n}\n\n/**\n * Make the persisted latest revision equal `graph` (the session's working\n * graph) so node-level `graph.*` commands apply onto identical state. Saves a\n * baseline revision when the project has no revision yet or the persisted\n * latest diverged from the session (the builder session is the source of\n * truth for the draft timeline — see the builder-store design note).\n */\nexport async function ensureGraphBaseline(\n operations: OperationsClient,\n projectId: string,\n graph: ProjectGraph | WorkingGraph,\n): Promise<OperationResult<unknown>> {\n // A working graph (the live session) is persisted as the canonical\n // layouts-only graph; a canonical graph passes through unchanged.\n const canonical = 'pages' in graph ? toProjectGraph(graph) : graph\n const latest = await operations.graph.getLatest({ projectId })\n if (latest.ok && JSON.stringify(latest.value.graph) === JSON.stringify(canonical)) return latest\n return operations.graph.save({ projectId, graph: canonical, message: 'Builder session baseline' })\n}\n\n/**\n * Persist \"publish the session's latest state\" (EC-141): ensure the working\n * graph is the persisted latest revision (as the canonical layouts-only\n * graph), then pin it live via `publishing.publish`. Single-environment\n * (EC-179): a deployment IS one environment, so there is no target environment\n * and no promote.\n */\nexport async function persistPublish(\n operations: OperationsClient,\n projectId: string,\n workingGraph: ProjectGraph | WorkingGraph,\n): Promise<OperationResult<unknown>> {\n const baseline = await ensureGraphBaseline(operations, projectId, workingGraph)\n if (!baseline.ok) return baseline\n return operations.publishing.publish({ projectId })\n}\n\n/** Persist an unpublish: revert the deployment to draft. */\nexport async function persistUnpublish(\n operations: OperationsClient,\n projectId: string,\n): Promise<OperationResult<unknown>> {\n return operations.publishing.unpublish({ projectId })\n}\n"]}
@@ -1,27 +0,0 @@
1
- import type { BuilderAction, BuilderSnapshot } from './graph-commands';
2
- import type { WorkingGraph } from '../working-graph';
3
- import type { OperationError, OperationsClient } from './operations-package';
4
- /**
5
- * Builder → operations persistence (EC-141). Mirrors every committed builder
6
- * mutation onto the operations layer as the matching `graph.*` command, in
7
- * dispatch order, against a guaranteed-identical baseline revision.
8
- *
9
- * Failures are *surfaced, never silent, and never block local editing*: a
10
- * rejected/denied/failed command reaches `onError` (the store renders it) and
11
- * invalidates the baseline, so the next mutation re-syncs — which re-surfaces
12
- * a standing denial instead of silently dropping edits.
13
- */
14
- export interface GraphPersister {
15
- /** Queue the command mirroring a dispatched action (no-op for pure-UI actions). */
16
- enqueue(action: BuilderAction, prev: BuilderSnapshot, next: {
17
- present: WorkingGraph;
18
- }): void;
19
- /** Await every queued command (test/publish synchronization point). */
20
- flush(): Promise<void>;
21
- }
22
- export interface GraphPersisterOptions {
23
- projectId: string;
24
- getOperations: () => Promise<OperationsClient>;
25
- onError: (error: OperationError) => void;
26
- }
27
- export declare function createGraphPersister(options: GraphPersisterOptions): GraphPersister;
@@ -1,35 +0,0 @@
1
- import { ensureGraphBaseline, graphInvocationFor } from './graph-commands';
2
- import { createPersistQueue } from './persist-queue';
3
- export function createGraphPersister(options) {
4
- const queue = createPersistQueue();
5
- let baselineReady = false;
6
- return {
7
- enqueue(action, prev, next) {
8
- const invocation = graphInvocationFor(options.projectId, action, prev, next);
9
- if (!invocation)
10
- return;
11
- queue.push(async () => {
12
- const operations = await options.getOperations();
13
- // graph.save replaces the whole graph, so it *is* a baseline; the
14
- // node-level commands need the persisted latest to equal the
15
- // session's pre-edit graph first.
16
- if (!baselineReady && invocation.operation !== 'graph.save') {
17
- const baseline = await ensureGraphBaseline(operations, options.projectId, prev.present);
18
- if (!baseline.ok) {
19
- options.onError(baseline.error);
20
- return;
21
- }
22
- }
23
- const result = await operations.execute(invocation.operation, invocation.input);
24
- if (!result.ok) {
25
- baselineReady = false;
26
- options.onError(result.error);
27
- return;
28
- }
29
- baselineReady = true;
30
- });
31
- },
32
- flush: () => queue.flush(),
33
- };
34
- }
35
- //# sourceMappingURL=graph-persistence.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"graph-persistence.js","sourceRoot":"","sources":["../../../src/lib/operations/graph-persistence.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAA;AAI1E,OAAO,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAA;AAyBpD,MAAM,UAAU,oBAAoB,CAAC,OAA8B;IACjE,MAAM,KAAK,GAAG,kBAAkB,EAAE,CAAA;IAClC,IAAI,aAAa,GAAG,KAAK,CAAA;IAEzB,OAAO;QACL,OAAO,CAAC,MAAM,EAAE,IAAI,EAAE,IAAI;YACxB,MAAM,UAAU,GAAG,kBAAkB,CAAC,OAAO,CAAC,SAAS,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,CAAC,CAAA;YAC5E,IAAI,CAAC,UAAU;gBAAE,OAAM;YACvB,KAAK,CAAC,IAAI,CAAC,KAAK,IAAI,EAAE;gBACpB,MAAM,UAAU,GAAG,MAAM,OAAO,CAAC,aAAa,EAAE,CAAA;gBAChD,kEAAkE;gBAClE,6DAA6D;gBAC7D,kCAAkC;gBAClC,IAAI,CAAC,aAAa,IAAI,UAAU,CAAC,SAAS,KAAK,YAAY,EAAE,CAAC;oBAC5D,MAAM,QAAQ,GAAG,MAAM,mBAAmB,CAAC,UAAU,EAAE,OAAO,CAAC,SAAS,EAAE,IAAI,CAAC,OAAO,CAAC,CAAA;oBACvF,IAAI,CAAC,QAAQ,CAAC,EAAE,EAAE,CAAC;wBACjB,OAAO,CAAC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAA;wBAC/B,OAAM;oBACR,CAAC;gBACH,CAAC;gBACD,MAAM,MAAM,GAAG,MAAM,UAAU,CAAC,OAAO,CAAC,UAAU,CAAC,SAAS,EAAE,UAAU,CAAC,KAAK,CAAC,CAAA;gBAC/E,IAAI,CAAC,MAAM,CAAC,EAAE,EAAE,CAAC;oBACf,aAAa,GAAG,KAAK,CAAA;oBACrB,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,CAAA;oBAC7B,OAAM;gBACR,CAAC;gBACD,aAAa,GAAG,IAAI,CAAA;YACtB,CAAC,CAAC,CAAA;QACJ,CAAC;QACD,KAAK,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC,KAAK,EAAE;KAC3B,CAAA;AACH,CAAC","sourcesContent":["import { ensureGraphBaseline, graphInvocationFor } from './graph-commands'\nimport type { BuilderAction, BuilderSnapshot } from './graph-commands'\nimport type { WorkingGraph } from '../working-graph'\nimport type { OperationError, OperationsClient } from './operations-package'\nimport { createPersistQueue } from './persist-queue'\n\n/**\n * Builder → operations persistence (EC-141). Mirrors every committed builder\n * mutation onto the operations layer as the matching `graph.*` command, in\n * dispatch order, against a guaranteed-identical baseline revision.\n *\n * Failures are *surfaced, never silent, and never block local editing*: a\n * rejected/denied/failed command reaches `onError` (the store renders it) and\n * invalidates the baseline, so the next mutation re-syncs — which re-surfaces\n * a standing denial instead of silently dropping edits.\n */\nexport interface GraphPersister {\n /** Queue the command mirroring a dispatched action (no-op for pure-UI actions). */\n enqueue(action: BuilderAction, prev: BuilderSnapshot, next: { present: WorkingGraph }): void\n /** Await every queued command (test/publish synchronization point). */\n flush(): Promise<void>\n}\n\nexport interface GraphPersisterOptions {\n projectId: string\n getOperations: () => Promise<OperationsClient>\n onError: (error: OperationError) => void\n}\n\nexport function createGraphPersister(options: GraphPersisterOptions): GraphPersister {\n const queue = createPersistQueue()\n let baselineReady = false\n\n return {\n enqueue(action, prev, next) {\n const invocation = graphInvocationFor(options.projectId, action, prev, next)\n if (!invocation) return\n queue.push(async () => {\n const operations = await options.getOperations()\n // graph.save replaces the whole graph, so it *is* a baseline; the\n // node-level commands need the persisted latest to equal the\n // session's pre-edit graph first.\n if (!baselineReady && invocation.operation !== 'graph.save') {\n const baseline = await ensureGraphBaseline(operations, options.projectId, prev.present)\n if (!baseline.ok) {\n options.onError(baseline.error)\n return\n }\n }\n const result = await operations.execute(invocation.operation, invocation.input)\n if (!result.ok) {\n baselineReady = false\n options.onError(result.error)\n return\n }\n baselineReady = true\n })\n },\n flush: () => queue.flush(),\n }\n}\n"]}
@@ -1,10 +0,0 @@
1
- /**
2
- * Route & redirect surface support (EC-170; made read-only by EC-207 "routes as
3
- * code"). Routes & redirects are config-sourced — authored in `elytra.config.ts`
4
- * and read through `resolveDeploymentRoutes`/`resolveDeploymentRedirects`, never
5
- * the backend. `routing-store.ts` holds the pure template-route helpers;
6
- * `routing-analysis.ts` holds the engine-derived view models from the
7
- * `@elytracms/core/cms-core` router.
8
- */
9
- export * from './routing-store';
10
- export * from './routing-analysis';
@@ -1,11 +0,0 @@
1
- /**
2
- * Route & redirect surface support (EC-170; made read-only by EC-207 "routes as
3
- * code"). Routes & redirects are config-sourced — authored in `elytra.config.ts`
4
- * and read through `resolveDeploymentRoutes`/`resolveDeploymentRedirects`, never
5
- * the backend. `routing-store.ts` holds the pure template-route helpers;
6
- * `routing-analysis.ts` holds the engine-derived view models from the
7
- * `@elytracms/core/cms-core` router.
8
- */
9
- export * from './routing-store';
10
- export * from './routing-analysis';
11
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/lib/routing/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,cAAc,iBAAiB,CAAA;AAC/B,cAAc,oBAAoB,CAAA","sourcesContent":["/**\n * Route & redirect surface support (EC-170; made read-only by EC-207 \"routes as\n * code\"). Routes & redirects are config-sourced — authored in `elytra.config.ts`\n * and read through `resolveDeploymentRoutes`/`resolveDeploymentRedirects`, never\n * the backend. `routing-store.ts` holds the pure template-route helpers;\n * `routing-analysis.ts` holds the engine-derived view models from the\n * `@elytracms/core/cms-core` router.\n */\nexport * from './routing-store'\nexport * from './routing-analysis'\n"]}
@@ -1,26 +0,0 @@
1
- import type { CmsValidationIssue, RedirectRecord } from '@elytracms/core/cms-core';
2
- /**
3
- * Engine-derived view models for the Routes section (EC-170). Everything here
4
- * is a thin projection over the existing `@elytracms/core/cms-core` router — the UI
5
- * never reimplements pattern matching, conflict detection, or loop detection.
6
- */
7
- export interface RouteConflict {
8
- /** The structured `route-conflict` issue from `createRouter`. */
9
- issue: CmsValidationIssue;
10
- /** The id of the *other* route in the conflicting pair. */
11
- otherRouteId: string;
12
- }
13
- /**
14
- * Index the router's `route-conflict` issues by route id, attributing each
15
- * conflict to BOTH routes in the pair so each affected row can render it
16
- * inline with a deep link to its counterpart.
17
- */
18
- export declare function conflictsByRoute(issues: readonly CmsValidationIssue[]): Map<string, RouteConflict[]>;
19
- /** 301/302 label for a redirect record. */
20
- export declare function statusCodeOf(redirect: Pick<RedirectRecord, 'permanent'>): '301' | '302';
21
- /** Split a route pattern into segments, flagging `:param` segments. */
22
- export interface PatternSegmentView {
23
- text: string;
24
- param: boolean;
25
- }
26
- export declare function patternSegments(pattern: string): PatternSegmentView[];
@@ -1,37 +0,0 @@
1
- /**
2
- * Index the router's `route-conflict` issues by route id, attributing each
3
- * conflict to BOTH routes in the pair so each affected row can render it
4
- * inline with a deep link to its counterpart.
5
- */
6
- export function conflictsByRoute(issues) {
7
- const map = new Map();
8
- const add = (routeId, conflict) => {
9
- const list = map.get(routeId) ?? [];
10
- list.push(conflict);
11
- map.set(routeId, list);
12
- };
13
- for (const issue of issues) {
14
- if (issue.code !== 'route-conflict')
15
- continue;
16
- // The engine attaches the issue at path ['routes', <routeId>] and names
17
- // the partner in meta.conflictsWith.
18
- const routeId = typeof issue.path[1] === 'string' ? issue.path[1] : undefined;
19
- const other = typeof issue.meta?.conflictsWith === 'string' ? issue.meta.conflictsWith : undefined;
20
- if (routeId)
21
- add(routeId, { issue, otherRouteId: other ?? '' });
22
- if (other && routeId)
23
- add(other, { issue, otherRouteId: routeId });
24
- }
25
- return map;
26
- }
27
- /** 301/302 label for a redirect record. */
28
- export function statusCodeOf(redirect) {
29
- return redirect.permanent ? '301' : '302';
30
- }
31
- export function patternSegments(pattern) {
32
- return pattern
33
- .split('/')
34
- .filter((segment) => segment.length > 0)
35
- .map((segment) => segment.startsWith(':') ? { text: segment, param: true } : { text: segment, param: false });
36
- }
37
- //# sourceMappingURL=routing-analysis.js.map