@elytracms/studio 0.0.1

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 (558) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +3 -0
  3. package/convex/assets.ts +107 -0
  4. package/convex/auth.config.ts +15 -0
  5. package/convex/auth.ts +50 -0
  6. package/convex/cliTokens.ts +63 -0
  7. package/convex/cms.ts +174 -0
  8. package/convex/content.ts +316 -0
  9. package/convex/delivery.ts +266 -0
  10. package/convex/functions.ts +35 -0
  11. package/convex/graphs.ts +51 -0
  12. package/convex/guard.ts +67 -0
  13. package/convex/http.ts +30 -0
  14. package/convex/members.ts +83 -0
  15. package/convex/publishing.ts +102 -0
  16. package/convex/references.ts +168 -0
  17. package/convex/schema.ts +173 -0
  18. package/convex/sync.ts +322 -0
  19. package/convex/tsconfig.json +12 -0
  20. package/convex/users.ts +23 -0
  21. package/convex/webhooks.ts +85 -0
  22. package/dist/components/assets/asset-library.d.ts +14 -0
  23. package/dist/components/assets/asset-library.js +191 -0
  24. package/dist/components/assets/asset-library.js.map +1 -0
  25. package/dist/components/assets/asset-metadata.d.ts +34 -0
  26. package/dist/components/assets/asset-metadata.js +40 -0
  27. package/dist/components/assets/asset-metadata.js.map +1 -0
  28. package/dist/components/assets/asset-search.d.ts +7 -0
  29. package/dist/components/assets/asset-search.js +12 -0
  30. package/dist/components/assets/asset-search.js.map +1 -0
  31. package/dist/components/assets/asset-selection.d.ts +17 -0
  32. package/dist/components/assets/asset-selection.js +33 -0
  33. package/dist/components/assets/asset-selection.js.map +1 -0
  34. package/dist/components/assets/assets-store.d.ts +51 -0
  35. package/dist/components/assets/assets-store.js +153 -0
  36. package/dist/components/assets/assets-store.js.map +1 -0
  37. package/dist/components/auth-context.d.ts +38 -0
  38. package/dist/components/auth-context.js +88 -0
  39. package/dist/components/auth-context.js.map +1 -0
  40. package/dist/components/backend-gate.d.ts +19 -0
  41. package/dist/components/backend-gate.js +63 -0
  42. package/dist/components/backend-gate.js.map +1 -0
  43. package/dist/components/breadcrumb-context.d.ts +39 -0
  44. package/dist/components/breadcrumb-context.js +38 -0
  45. package/dist/components/breadcrumb-context.js.map +1 -0
  46. package/dist/components/builder/blocks-model.d.ts +80 -0
  47. package/dist/components/builder/blocks-model.js +181 -0
  48. package/dist/components/builder/blocks-model.js.map +1 -0
  49. package/dist/components/builder/blocks-panel.d.ts +44 -0
  50. package/dist/components/builder/blocks-panel.js +147 -0
  51. package/dist/components/builder/blocks-panel.js.map +1 -0
  52. package/dist/components/builder/builder-store.d.ts +69 -0
  53. package/dist/components/builder/builder-store.js +294 -0
  54. package/dist/components/builder/builder-store.js.map +1 -0
  55. package/dist/components/builder/canvas-stylesheet.d.ts +4 -0
  56. package/dist/components/builder/canvas-stylesheet.js +24 -0
  57. package/dist/components/builder/canvas-stylesheet.js.map +1 -0
  58. package/dist/components/builder/canvas.d.ts +8 -0
  59. package/dist/components/builder/canvas.js +723 -0
  60. package/dist/components/builder/canvas.js.map +1 -0
  61. package/dist/components/builder/clipboard-actions.d.ts +93 -0
  62. package/dist/components/builder/clipboard-actions.js +246 -0
  63. package/dist/components/builder/clipboard-actions.js.map +1 -0
  64. package/dist/components/builder/composition-field-editor.d.ts +11 -0
  65. package/dist/components/builder/composition-field-editor.js +150 -0
  66. package/dist/components/builder/composition-field-editor.js.map +1 -0
  67. package/dist/components/builder/composition-scope.d.ts +16 -0
  68. package/dist/components/builder/composition-scope.js +7 -0
  69. package/dist/components/builder/composition-scope.js.map +1 -0
  70. package/dist/components/builder/drag-session.d.ts +41 -0
  71. package/dist/components/builder/drag-session.js +51 -0
  72. package/dist/components/builder/drag-session.js.map +1 -0
  73. package/dist/components/builder/fixture-thumbnail.d.ts +18 -0
  74. package/dist/components/builder/fixture-thumbnail.js +97 -0
  75. package/dist/components/builder/fixture-thumbnail.js.map +1 -0
  76. package/dist/components/builder/inline-edit.d.ts +142 -0
  77. package/dist/components/builder/inline-edit.js +136 -0
  78. package/dist/components/builder/inline-edit.js.map +1 -0
  79. package/dist/components/builder/insert-context.d.ts +14 -0
  80. package/dist/components/builder/insert-context.js +65 -0
  81. package/dist/components/builder/insert-context.js.map +1 -0
  82. package/dist/components/builder/insert-menu.d.ts +9 -0
  83. package/dist/components/builder/insert-menu.js +9 -0
  84. package/dist/components/builder/insert-menu.js.map +1 -0
  85. package/dist/components/builder/layout-inspector.d.ts +14 -0
  86. package/dist/components/builder/layout-inspector.js +84 -0
  87. package/dist/components/builder/layout-inspector.js.map +1 -0
  88. package/dist/components/builder/node-factory.d.ts +17 -0
  89. package/dist/components/builder/node-factory.js +90 -0
  90. package/dist/components/builder/node-factory.js.map +1 -0
  91. package/dist/components/builder/page-tree.d.ts +3 -0
  92. package/dist/components/builder/page-tree.js +207 -0
  93. package/dist/components/builder/page-tree.js.map +1 -0
  94. package/dist/components/builder/property-inspector.d.ts +1 -0
  95. package/dist/components/builder/property-inspector.js +233 -0
  96. package/dist/components/builder/property-inspector.js.map +1 -0
  97. package/dist/components/builder/rich-text-toolbar.d.ts +4 -0
  98. package/dist/components/builder/rich-text-toolbar.js +104 -0
  99. package/dist/components/builder/rich-text-toolbar.js.map +1 -0
  100. package/dist/components/builder/spacing-handles.d.ts +22 -0
  101. package/dist/components/builder/spacing-handles.js +213 -0
  102. package/dist/components/builder/spacing-handles.js.map +1 -0
  103. package/dist/components/cms/asset-picker.d.ts +12 -0
  104. package/dist/components/cms/asset-picker.js +60 -0
  105. package/dist/components/cms/asset-picker.js.map +1 -0
  106. package/dist/components/cms/bulk-actions.d.ts +60 -0
  107. package/dist/components/cms/bulk-actions.js +95 -0
  108. package/dist/components/cms/bulk-actions.js.map +1 -0
  109. package/dist/components/cms/bulk-bar.d.ts +23 -0
  110. package/dist/components/cms/bulk-bar.js +26 -0
  111. package/dist/components/cms/bulk-bar.js.map +1 -0
  112. package/dist/components/cms/cell-edit.d.ts +91 -0
  113. package/dist/components/cms/cell-edit.js +144 -0
  114. package/dist/components/cms/cell-edit.js.map +1 -0
  115. package/dist/components/cms/cell.d.ts +29 -0
  116. package/dist/components/cms/cell.js +127 -0
  117. package/dist/components/cms/cell.js.map +1 -0
  118. package/dist/components/cms/cms-index.d.ts +8 -0
  119. package/dist/components/cms/cms-index.js +23 -0
  120. package/dist/components/cms/cms-index.js.map +1 -0
  121. package/dist/components/cms/cms-store.d.ts +188 -0
  122. package/dist/components/cms/cms-store.js +702 -0
  123. package/dist/components/cms/cms-store.js.map +1 -0
  124. package/dist/components/cms/collection-table.d.ts +6 -0
  125. package/dist/components/cms/collection-table.js +250 -0
  126. package/dist/components/cms/collection-table.js.map +1 -0
  127. package/dist/components/cms/collections-sidebar.d.ts +9 -0
  128. package/dist/components/cms/collections-sidebar.js +25 -0
  129. package/dist/components/cms/collections-sidebar.js.map +1 -0
  130. package/dist/components/cms/detail-editor.d.ts +7 -0
  131. package/dist/components/cms/detail-editor.js +386 -0
  132. package/dist/components/cms/detail-editor.js.map +1 -0
  133. package/dist/components/cms/doc-state.d.ts +13 -0
  134. package/dist/components/cms/doc-state.js +18 -0
  135. package/dist/components/cms/doc-state.js.map +1 -0
  136. package/dist/components/cms/document-editor-context.d.ts +48 -0
  137. package/dist/components/cms/document-editor-context.js +23 -0
  138. package/dist/components/cms/document-editor-context.js.map +1 -0
  139. package/dist/components/cms/editable-cell.d.ts +22 -0
  140. package/dist/components/cms/editable-cell.js +176 -0
  141. package/dist/components/cms/editable-cell.js.map +1 -0
  142. package/dist/components/cms/field-control.d.ts +8 -0
  143. package/dist/components/cms/field-control.js +149 -0
  144. package/dist/components/cms/field-control.js.map +1 -0
  145. package/dist/components/cms/filter-builder.d.ts +12 -0
  146. package/dist/components/cms/filter-builder.js +84 -0
  147. package/dist/components/cms/filter-builder.js.map +1 -0
  148. package/dist/components/cms/import-export.d.ts +6 -0
  149. package/dist/components/cms/import-export.js +33 -0
  150. package/dist/components/cms/import-export.js.map +1 -0
  151. package/dist/components/cms/new-page-dialog.d.ts +22 -0
  152. package/dist/components/cms/new-page-dialog.js +42 -0
  153. package/dist/components/cms/new-page-dialog.js.map +1 -0
  154. package/dist/components/cms/reference-confirm.d.ts +25 -0
  155. package/dist/components/cms/reference-confirm.js +124 -0
  156. package/dist/components/cms/reference-confirm.js.map +1 -0
  157. package/dist/components/cms/relation-picker.d.ts +16 -0
  158. package/dist/components/cms/relation-picker.js +47 -0
  159. package/dist/components/cms/relation-picker.js.map +1 -0
  160. package/dist/components/cms/use-cell-edit.d.ts +33 -0
  161. package/dist/components/cms/use-cell-edit.js +125 -0
  162. package/dist/components/cms/use-cell-edit.js.map +1 -0
  163. package/dist/components/cms/versions-model.d.ts +15 -0
  164. package/dist/components/cms/versions-model.js +23 -0
  165. package/dist/components/cms/versions-model.js.map +1 -0
  166. package/dist/components/cms/versions-pane.d.ts +14 -0
  167. package/dist/components/cms/versions-pane.js +86 -0
  168. package/dist/components/cms/versions-pane.js.map +1 -0
  169. package/dist/components/cms/view-bar.d.ts +11 -0
  170. package/dist/components/cms/view-bar.js +80 -0
  171. package/dist/components/cms/view-bar.js.map +1 -0
  172. package/dist/components/collab/collab-context.d.ts +34 -0
  173. package/dist/components/collab/collab-context.js +52 -0
  174. package/dist/components/collab/collab-context.js.map +1 -0
  175. package/dist/components/collab/collab-seed.d.ts +27 -0
  176. package/dist/components/collab/collab-seed.js +42 -0
  177. package/dist/components/collab/collab-seed.js.map +1 -0
  178. package/dist/components/components/component-detail.d.ts +9 -0
  179. package/dist/components/components/component-detail.js +30 -0
  180. package/dist/components/components/component-detail.js.map +1 -0
  181. package/dist/components/components/component-status.d.ts +10 -0
  182. package/dist/components/components/component-status.js +30 -0
  183. package/dist/components/components/component-status.js.map +1 -0
  184. package/dist/components/components/components-index.d.ts +8 -0
  185. package/dist/components/components/components-index.js +42 -0
  186. package/dist/components/components/components-index.js.map +1 -0
  187. package/dist/components/components/field-inspector.d.ts +9 -0
  188. package/dist/components/components/field-inspector.js +38 -0
  189. package/dist/components/components/field-inspector.js.map +1 -0
  190. package/dist/components/components/fixture-runner.d.ts +10 -0
  191. package/dist/components/components/fixture-runner.js +24 -0
  192. package/dist/components/components/fixture-runner.js.map +1 -0
  193. package/dist/components/components/registry-browser.d.ts +4 -0
  194. package/dist/components/components/registry-browser.js +64 -0
  195. package/dist/components/components/registry-browser.js.map +1 -0
  196. package/dist/components/current-user-menu.d.ts +13 -0
  197. package/dist/components/current-user-menu.js +31 -0
  198. package/dist/components/current-user-menu.js.map +1 -0
  199. package/dist/components/dev-login-badge.d.ts +9 -0
  200. package/dist/components/dev-login-badge.js +18 -0
  201. package/dist/components/dev-login-badge.js.map +1 -0
  202. package/dist/components/extensions/extensions-view.d.ts +7 -0
  203. package/dist/components/extensions/extensions-view.js +126 -0
  204. package/dist/components/extensions/extensions-view.js.map +1 -0
  205. package/dist/components/guards.d.ts +27 -0
  206. package/dist/components/guards.js +46 -0
  207. package/dist/components/guards.js.map +1 -0
  208. package/dist/components/inspector/inspector-sidebar.d.ts +26 -0
  209. package/dist/components/inspector/inspector-sidebar.js +17 -0
  210. package/dist/components/inspector/inspector-sidebar.js.map +1 -0
  211. package/dist/components/operation-error.d.ts +17 -0
  212. package/dist/components/operation-error.js +54 -0
  213. package/dist/components/operation-error.js.map +1 -0
  214. package/dist/components/playground-badge.d.ts +10 -0
  215. package/dist/components/playground-badge.js +19 -0
  216. package/dist/components/playground-badge.js.map +1 -0
  217. package/dist/components/project-list.d.ts +15 -0
  218. package/dist/components/project-list.js +52 -0
  219. package/dist/components/project-list.js.map +1 -0
  220. package/dist/components/project-session.d.ts +46 -0
  221. package/dist/components/project-session.js +107 -0
  222. package/dist/components/project-session.js.map +1 -0
  223. package/dist/components/project-switcher.d.ts +11 -0
  224. package/dist/components/project-switcher.js +44 -0
  225. package/dist/components/project-switcher.js.map +1 -0
  226. package/dist/components/references/builder-deep-link.d.ts +12 -0
  227. package/dist/components/references/builder-deep-link.js +53 -0
  228. package/dist/components/references/builder-deep-link.js.map +1 -0
  229. package/dist/components/references/references-panel.d.ts +17 -0
  230. package/dist/components/references/references-panel.js +66 -0
  231. package/dist/components/references/references-panel.js.map +1 -0
  232. package/dist/components/routes/redirect-chain.d.ts +9 -0
  233. package/dist/components/routes/redirect-chain.js +16 -0
  234. package/dist/components/routes/redirect-chain.js.map +1 -0
  235. package/dist/components/routes/redirect-manager.d.ts +13 -0
  236. package/dist/components/routes/redirect-manager.js +24 -0
  237. package/dist/components/routes/redirect-manager.js.map +1 -0
  238. package/dist/components/routes/route-list.d.ts +35 -0
  239. package/dist/components/routes/route-list.js +69 -0
  240. package/dist/components/routes/route-list.js.map +1 -0
  241. package/dist/components/routes/routes-shell.d.ts +14 -0
  242. package/dist/components/routes/routes-shell.js +68 -0
  243. package/dist/components/routes/routes-shell.js.map +1 -0
  244. package/dist/components/section-nav.d.ts +17 -0
  245. package/dist/components/section-nav.js +33 -0
  246. package/dist/components/section-nav.js.map +1 -0
  247. package/dist/components/section-state.d.ts +24 -0
  248. package/dist/components/section-state.js +78 -0
  249. package/dist/components/section-state.js.map +1 -0
  250. package/dist/components/section-surface.d.ts +31 -0
  251. package/dist/components/section-surface.js +46 -0
  252. package/dist/components/section-surface.js.map +1 -0
  253. package/dist/components/sections.d.ts +38 -0
  254. package/dist/components/sections.js +72 -0
  255. package/dist/components/sections.js.map +1 -0
  256. package/dist/components/settings-form.d.ts +10 -0
  257. package/dist/components/settings-form.js +17 -0
  258. package/dist/components/settings-form.js.map +1 -0
  259. package/dist/components/studio-context.d.ts +22 -0
  260. package/dist/components/studio-context.js +48 -0
  261. package/dist/components/studio-context.js.map +1 -0
  262. package/dist/components/studio-project-screen.d.ts +19 -0
  263. package/dist/components/studio-project-screen.js +195 -0
  264. package/dist/components/studio-project-screen.js.map +1 -0
  265. package/dist/components/studio-shell.d.ts +18 -0
  266. package/dist/components/studio-shell.js +64 -0
  267. package/dist/components/studio-shell.js.map +1 -0
  268. package/dist/components/theme-context.d.ts +17 -0
  269. package/dist/components/theme-context.js +26 -0
  270. package/dist/components/theme-context.js.map +1 -0
  271. package/dist/components/workspace-gate.d.ts +12 -0
  272. package/dist/components/workspace-gate.js +27 -0
  273. package/dist/components/workspace-gate.js.map +1 -0
  274. package/dist/components/workspace-projects.d.ts +13 -0
  275. package/dist/components/workspace-projects.js +18 -0
  276. package/dist/components/workspace-projects.js.map +1 -0
  277. package/dist/lib/assets/delete-asset.d.ts +34 -0
  278. package/dist/lib/assets/delete-asset.js +34 -0
  279. package/dist/lib/assets/delete-asset.js.map +1 -0
  280. package/dist/lib/assets/image-dimensions.d.ts +18 -0
  281. package/dist/lib/assets/image-dimensions.js +26 -0
  282. package/dist/lib/assets/image-dimensions.js.map +1 -0
  283. package/dist/lib/assets/index.d.ts +9 -0
  284. package/dist/lib/assets/index.js +10 -0
  285. package/dist/lib/assets/index.js.map +1 -0
  286. package/dist/lib/assets/upload-state.d.ts +53 -0
  287. package/dist/lib/assets/upload-state.js +59 -0
  288. package/dist/lib/assets/upload-state.js.map +1 -0
  289. package/dist/lib/assets/upload.d.ts +56 -0
  290. package/dist/lib/assets/upload.js +125 -0
  291. package/dist/lib/assets/upload.js.map +1 -0
  292. package/dist/lib/auth/auth-adapter.d.ts +57 -0
  293. package/dist/lib/auth/auth-adapter.js +13 -0
  294. package/dist/lib/auth/auth-adapter.js.map +1 -0
  295. package/dist/lib/auth/convex-auth-adapter.d.ts +39 -0
  296. package/dist/lib/auth/convex-auth-adapter.js +171 -0
  297. package/dist/lib/auth/convex-auth-adapter.js.map +1 -0
  298. package/dist/lib/auth/dev-auto-login-adapter.d.ts +25 -0
  299. package/dist/lib/auth/dev-auto-login-adapter.js +40 -0
  300. package/dist/lib/auth/dev-auto-login-adapter.js.map +1 -0
  301. package/dist/lib/auth/index.d.ts +28 -0
  302. package/dist/lib/auth/index.js +61 -0
  303. package/dist/lib/auth/index.js.map +1 -0
  304. package/dist/lib/auth/local-auth-adapter.d.ts +57 -0
  305. package/dist/lib/auth/local-auth-adapter.js +78 -0
  306. package/dist/lib/auth/local-auth-adapter.js.map +1 -0
  307. package/dist/lib/auth/route-guard.d.ts +33 -0
  308. package/dist/lib/auth/route-guard.js +51 -0
  309. package/dist/lib/auth/route-guard.js.map +1 -0
  310. package/dist/lib/auth-errors.d.ts +42 -0
  311. package/dist/lib/auth-errors.js +74 -0
  312. package/dist/lib/auth-errors.js.map +1 -0
  313. package/dist/lib/bindings/section-bindings.d.ts +24 -0
  314. package/dist/lib/bindings/section-bindings.js +9 -0
  315. package/dist/lib/bindings/section-bindings.js.map +1 -0
  316. package/dist/lib/clipboard/index.d.ts +7 -0
  317. package/dist/lib/clipboard/index.js +8 -0
  318. package/dist/lib/clipboard/index.js.map +1 -0
  319. package/dist/lib/clipboard/os-clipboard.d.ts +46 -0
  320. package/dist/lib/clipboard/os-clipboard.js +105 -0
  321. package/dist/lib/clipboard/os-clipboard.js.map +1 -0
  322. package/dist/lib/clipboard/paste-issues.d.ts +34 -0
  323. package/dist/lib/clipboard/paste-issues.js +67 -0
  324. package/dist/lib/clipboard/paste-issues.js.map +1 -0
  325. package/dist/lib/clipboard/paste-target.d.ts +20 -0
  326. package/dist/lib/clipboard/paste-target.js +28 -0
  327. package/dist/lib/clipboard/paste-target.js.map +1 -0
  328. package/dist/lib/cms/published-documents.d.ts +30 -0
  329. package/dist/lib/cms/published-documents.js +75 -0
  330. package/dist/lib/cms/published-documents.js.map +1 -0
  331. package/dist/lib/cms-views/index.d.ts +9 -0
  332. package/dist/lib/cms-views/index.js +10 -0
  333. package/dist/lib/cms-views/index.js.map +1 -0
  334. package/dist/lib/cms-views/selection.d.ts +29 -0
  335. package/dist/lib/cms-views/selection.js +46 -0
  336. package/dist/lib/cms-views/selection.js.map +1 -0
  337. package/dist/lib/cms-views/view-model.d.ts +192 -0
  338. package/dist/lib/cms-views/view-model.js +353 -0
  339. package/dist/lib/cms-views/view-model.js.map +1 -0
  340. package/dist/lib/cms-views/views-store.d.ts +70 -0
  341. package/dist/lib/cms-views/views-store.js +129 -0
  342. package/dist/lib/cms-views/views-store.js.map +1 -0
  343. package/dist/lib/data/collection-content.d.ts +105 -0
  344. package/dist/lib/data/collection-content.js +196 -0
  345. package/dist/lib/data/collection-content.js.map +1 -0
  346. package/dist/lib/data/data-store.d.ts +97 -0
  347. package/dist/lib/data/data-store.js +205 -0
  348. package/dist/lib/data/data-store.js.map +1 -0
  349. package/dist/lib/data/index.d.ts +4 -0
  350. package/dist/lib/data/index.js +8 -0
  351. package/dist/lib/data/index.js.map +1 -0
  352. package/dist/lib/data/providers.d.ts +143 -0
  353. package/dist/lib/data/providers.js +255 -0
  354. package/dist/lib/data/providers.js.map +1 -0
  355. package/dist/lib/data/sample-capture.d.ts +30 -0
  356. package/dist/lib/data/sample-capture.js +70 -0
  357. package/dist/lib/data/sample-capture.js.map +1 -0
  358. package/dist/lib/data/sources-store.d.ts +42 -0
  359. package/dist/lib/data/sources-store.js +120 -0
  360. package/dist/lib/data/sources-store.js.map +1 -0
  361. package/dist/lib/dnd/drop-rules.d.ts +219 -0
  362. package/dist/lib/dnd/drop-rules.js +257 -0
  363. package/dist/lib/dnd/drop-rules.js.map +1 -0
  364. package/dist/lib/dnd/gap-drag.d.ts +66 -0
  365. package/dist/lib/dnd/gap-drag.js +95 -0
  366. package/dist/lib/dnd/gap-drag.js.map +1 -0
  367. package/dist/lib/locale/binding-fallback.d.ts +28 -0
  368. package/dist/lib/locale/binding-fallback.js +66 -0
  369. package/dist/lib/locale/binding-fallback.js.map +1 -0
  370. package/dist/lib/locale/fallback.d.ts +43 -0
  371. package/dist/lib/locale/fallback.js +52 -0
  372. package/dist/lib/locale/fallback.js.map +1 -0
  373. package/dist/lib/locale/index.d.ts +6 -0
  374. package/dist/lib/locale/index.js +7 -0
  375. package/dist/lib/locale/index.js.map +1 -0
  376. package/dist/lib/locale/locale-store.d.ts +40 -0
  377. package/dist/lib/locale/locale-store.js +61 -0
  378. package/dist/lib/locale/locale-store.js.map +1 -0
  379. package/dist/lib/locale/locale-switcher.d.ts +10 -0
  380. package/dist/lib/locale/locale-switcher.js +24 -0
  381. package/dist/lib/locale/locale-switcher.js.map +1 -0
  382. package/dist/lib/locale/route-variant.d.ts +14 -0
  383. package/dist/lib/locale/route-variant.js +11 -0
  384. package/dist/lib/locale/route-variant.js.map +1 -0
  385. package/dist/lib/locale/use-studio-locale.d.ts +10 -0
  386. package/dist/lib/locale/use-studio-locale.js +8 -0
  387. package/dist/lib/locale/use-studio-locale.js.map +1 -0
  388. package/dist/lib/operations/asset-repository.d.ts +15 -0
  389. package/dist/lib/operations/asset-repository.js +56 -0
  390. package/dist/lib/operations/asset-repository.js.map +1 -0
  391. package/dist/lib/operations/cms-persistence.d.ts +35 -0
  392. package/dist/lib/operations/cms-persistence.js +75 -0
  393. package/dist/lib/operations/cms-persistence.js.map +1 -0
  394. package/dist/lib/operations/graph-commands.d.ts +140 -0
  395. package/dist/lib/operations/graph-commands.js +86 -0
  396. package/dist/lib/operations/graph-commands.js.map +1 -0
  397. package/dist/lib/operations/graph-persistence.d.ts +27 -0
  398. package/dist/lib/operations/graph-persistence.js +35 -0
  399. package/dist/lib/operations/graph-persistence.js.map +1 -0
  400. package/dist/lib/operations/index.d.ts +13 -0
  401. package/dist/lib/operations/index.js +14 -0
  402. package/dist/lib/operations/index.js.map +1 -0
  403. package/dist/lib/operations/operations-package.d.ts +6 -0
  404. package/dist/lib/operations/operations-package.js +7 -0
  405. package/dist/lib/operations/operations-package.js.map +1 -0
  406. package/dist/lib/operations/persist-queue.d.ts +16 -0
  407. package/dist/lib/operations/persist-queue.js +18 -0
  408. package/dist/lib/operations/persist-queue.js.map +1 -0
  409. package/dist/lib/operations/session-hydration.d.ts +84 -0
  410. package/dist/lib/operations/session-hydration.js +112 -0
  411. package/dist/lib/operations/session-hydration.js.map +1 -0
  412. package/dist/lib/operations/studio-operations.d.ts +59 -0
  413. package/dist/lib/operations/studio-operations.js +92 -0
  414. package/dist/lib/operations/studio-operations.js.map +1 -0
  415. package/dist/lib/persistence/backend-mode.d.ts +69 -0
  416. package/dist/lib/persistence/backend-mode.js +120 -0
  417. package/dist/lib/persistence/backend-mode.js.map +1 -0
  418. package/dist/lib/persistence/convex-adapter.d.ts +34 -0
  419. package/dist/lib/persistence/convex-adapter.js +681 -0
  420. package/dist/lib/persistence/convex-adapter.js.map +1 -0
  421. package/dist/lib/persistence/convex-blob-storage.d.ts +57 -0
  422. package/dist/lib/persistence/convex-blob-storage.js +97 -0
  423. package/dist/lib/persistence/convex-blob-storage.js.map +1 -0
  424. package/dist/lib/persistence/convex-client.d.ts +19 -0
  425. package/dist/lib/persistence/convex-client.js +40 -0
  426. package/dist/lib/persistence/convex-client.js.map +1 -0
  427. package/dist/lib/persistence/index.d.ts +30 -0
  428. package/dist/lib/persistence/index.js +60 -0
  429. package/dist/lib/persistence/index.js.map +1 -0
  430. package/dist/lib/persona/labels.d.ts +23 -0
  431. package/dist/lib/persona/labels.js +122 -0
  432. package/dist/lib/persona/labels.js.map +1 -0
  433. package/dist/lib/rail.d.ts +11 -0
  434. package/dist/lib/rail.js +26 -0
  435. package/dist/lib/rail.js.map +1 -0
  436. package/dist/lib/references/impact.d.ts +64 -0
  437. package/dist/lib/references/impact.js +62 -0
  438. package/dist/lib/references/impact.js.map +1 -0
  439. package/dist/lib/references/index.d.ts +7 -0
  440. package/dist/lib/references/index.js +8 -0
  441. package/dist/lib/references/index.js.map +1 -0
  442. package/dist/lib/references/reference-model.d.ts +125 -0
  443. package/dist/lib/references/reference-model.js +242 -0
  444. package/dist/lib/references/reference-model.js.map +1 -0
  445. package/dist/lib/references/references-store.d.ts +65 -0
  446. package/dist/lib/references/references-store.js +221 -0
  447. package/dist/lib/references/references-store.js.map +1 -0
  448. package/dist/lib/registry/index.d.ts +65 -0
  449. package/dist/lib/registry/index.js +114 -0
  450. package/dist/lib/registry/index.js.map +1 -0
  451. package/dist/lib/registry/preview.d.ts +15 -0
  452. package/dist/lib/registry/preview.js +110 -0
  453. package/dist/lib/registry/preview.js.map +1 -0
  454. package/dist/lib/registry/project-components.d.ts +16 -0
  455. package/dist/lib/registry/project-components.js +152 -0
  456. package/dist/lib/registry/project-components.js.map +1 -0
  457. package/dist/lib/routing/index.d.ts +10 -0
  458. package/dist/lib/routing/index.js +11 -0
  459. package/dist/lib/routing/index.js.map +1 -0
  460. package/dist/lib/routing/routing-analysis.d.ts +26 -0
  461. package/dist/lib/routing/routing-analysis.js +37 -0
  462. package/dist/lib/routing/routing-analysis.js.map +1 -0
  463. package/dist/lib/routing/routing-store.d.ts +50 -0
  464. package/dist/lib/routing/routing-store.js +72 -0
  465. package/dist/lib/routing/routing-store.js.map +1 -0
  466. package/dist/lib/starters/kit-session.d.ts +5 -0
  467. package/dist/lib/starters/kit-session.js +17 -0
  468. package/dist/lib/starters/kit-session.js.map +1 -0
  469. package/dist/lib/theme.d.ts +21 -0
  470. package/dist/lib/theme.js +32 -0
  471. package/dist/lib/theme.js.map +1 -0
  472. package/dist/lib/utils.d.ts +11 -0
  473. package/dist/lib/utils.js +28 -0
  474. package/dist/lib/utils.js.map +1 -0
  475. package/dist/lib/webhooks/config.d.ts +15 -0
  476. package/dist/lib/webhooks/config.js +64 -0
  477. package/dist/lib/webhooks/config.js.map +1 -0
  478. package/dist/lib/webhooks/dispatcher.d.ts +67 -0
  479. package/dist/lib/webhooks/dispatcher.js +61 -0
  480. package/dist/lib/webhooks/dispatcher.js.map +1 -0
  481. package/dist/lib/webhooks/index.d.ts +11 -0
  482. package/dist/lib/webhooks/index.js +10 -0
  483. package/dist/lib/webhooks/index.js.map +1 -0
  484. package/dist/lib/webhooks/signing.d.ts +15 -0
  485. package/dist/lib/webhooks/signing.js +24 -0
  486. package/dist/lib/webhooks/signing.js.map +1 -0
  487. package/dist/lib/webhooks/tags.d.ts +25 -0
  488. package/dist/lib/webhooks/tags.js +173 -0
  489. package/dist/lib/webhooks/tags.js.map +1 -0
  490. package/dist/lib/working-graph.d.ts +82 -0
  491. package/dist/lib/working-graph.js +113 -0
  492. package/dist/lib/working-graph.js.map +1 -0
  493. package/dist/lib/workspace/index.d.ts +109 -0
  494. package/dist/lib/workspace/index.js +206 -0
  495. package/dist/lib/workspace/index.js.map +1 -0
  496. package/dist/lib/workspace/switcher-source.d.ts +39 -0
  497. package/dist/lib/workspace/switcher-source.js +23 -0
  498. package/dist/lib/workspace/switcher-source.js.map +1 -0
  499. package/dist/lib/workspace/workspace-source.d.ts +47 -0
  500. package/dist/lib/workspace/workspace-source.js +67 -0
  501. package/dist/lib/workspace/workspace-source.js.map +1 -0
  502. package/dist/router/index.d.ts +32 -0
  503. package/dist/router/index.js +32 -0
  504. package/dist/router/index.js.map +1 -0
  505. package/dist/router/match.d.ts +75 -0
  506. package/dist/router/match.js +87 -0
  507. package/dist/router/match.js.map +1 -0
  508. package/dist/router/search.d.ts +22 -0
  509. package/dist/router/search.js +16 -0
  510. package/dist/router/search.js.map +1 -0
  511. package/dist/ui/avatar.d.ts +17 -0
  512. package/dist/ui/avatar.js +38 -0
  513. package/dist/ui/avatar.js.map +1 -0
  514. package/dist/ui/badge.d.ts +9 -0
  515. package/dist/ui/badge.js +23 -0
  516. package/dist/ui/badge.js.map +1 -0
  517. package/dist/ui/button.d.ts +11 -0
  518. package/dist/ui/button.js +30 -0
  519. package/dist/ui/button.js.map +1 -0
  520. package/dist/ui/card.d.ts +11 -0
  521. package/dist/ui/card.js +23 -0
  522. package/dist/ui/card.js.map +1 -0
  523. package/dist/ui/dialog.d.ts +12 -0
  524. package/dist/ui/dialog.js +27 -0
  525. package/dist/ui/dialog.js.map +1 -0
  526. package/dist/ui/dropdown-menu.d.ts +15 -0
  527. package/dist/ui/dropdown-menu.js +24 -0
  528. package/dist/ui/dropdown-menu.js.map +1 -0
  529. package/dist/ui/field.d.ts +15 -0
  530. package/dist/ui/field.js +14 -0
  531. package/dist/ui/field.js.map +1 -0
  532. package/dist/ui/index.d.ts +14 -0
  533. package/dist/ui/index.js +15 -0
  534. package/dist/ui/index.js.map +1 -0
  535. package/dist/ui/input.d.ts +3 -0
  536. package/dist/ui/input.js +7 -0
  537. package/dist/ui/input.js.map +1 -0
  538. package/dist/ui/inspector.d.ts +18 -0
  539. package/dist/ui/inspector.js +14 -0
  540. package/dist/ui/inspector.js.map +1 -0
  541. package/dist/ui/layout.d.ts +45 -0
  542. package/dist/ui/layout.js +48 -0
  543. package/dist/ui/layout.js.map +1 -0
  544. package/dist/ui/panel.d.ts +12 -0
  545. package/dist/ui/panel.js +20 -0
  546. package/dist/ui/panel.js.map +1 -0
  547. package/dist/ui/separator.d.ts +6 -0
  548. package/dist/ui/separator.js +7 -0
  549. package/dist/ui/separator.js.map +1 -0
  550. package/dist/ui/toolbar.d.ts +9 -0
  551. package/dist/ui/toolbar.js +16 -0
  552. package/dist/ui/toolbar.js.map +1 -0
  553. package/dist/ui/typography.d.ts +50 -0
  554. package/dist/ui/typography.js +43 -0
  555. package/dist/ui/typography.js.map +1 -0
  556. package/package.json +149 -0
  557. package/src/styles/studio.css +101 -0
  558. package/src/styles/tokens.css +63 -0
@@ -0,0 +1,30 @@
1
+ import type { DataSource } from '@elytracms/data-binding';
2
+ import type { JsonValue } from '@elytracms/project-graph';
3
+ import type { CollectionDef } from '@elytracms/cms-core';
4
+ /**
5
+ * Data-source sample capture (EC-083/EC-166/EC-167). The hosted builder is
6
+ * separate from the site it exports: actually performing a REST fetch / external
7
+ * query happens behind the project-owned adapters in the deployed site, NOT here.
8
+ * So the studio captures a sample ONLY when it can do so honestly — it never
9
+ * fabricates data (Oli, 2026-06-19; cf. backend-mode's "never silently swap in
10
+ * in-memory storage", and the v1 "static props, bindings parked" direction):
11
+ *
12
+ * - a provider-backed source runs its registered provider (real project code);
13
+ * - a CMS source replays its stored query over the live content session (Convex
14
+ * mode — EC-177 gap 1), so section/template previews show what delivery serves;
15
+ * - anything else — an external source with no in-studio data path — returns
16
+ * `undefined`. The source then carries no sample, and the binding UI shows an
17
+ * honest "no sample yet" state instead of inventing rows that aren't there.
18
+ */
19
+ export declare function captureSourceSample(source: DataSource): JsonValue | undefined;
20
+ /**
21
+ * A live CMS data source for one config-driven collection (EC-192). The binding
22
+ * and condition pickers enumerate `data.sources`; deriving one source per
23
+ * configured content collection — the same set the CMS uses
24
+ * (`resolveDeploymentCollections`) — means what an editor can bind matches what
25
+ * actually exists. The sample is captured by replaying the collection's list
26
+ * query through the canonical content engine, so when a content session is
27
+ * configured (Convex mode) the inferred field tokens are the collection's real
28
+ * fields; with no session the source is listed but carries no sample.
29
+ */
30
+ export declare function cmsSourceForCollection(collection: CollectionDef): DataSource;
@@ -0,0 +1,70 @@
1
+ import { captureSample } from '@elytracms/data-binding';
2
+ import { humanizeName } from '../utils';
3
+ import { listQueryOfConfig } from '../bindings/section-bindings';
4
+ import { getCollectionDocument, hasContentSession, playgroundCollection, runCollectionListQuery, } from './collection-content';
5
+ import { providerIdOfSource, providerPayload } from './providers';
6
+ /**
7
+ * Data-source sample capture (EC-083/EC-166/EC-167). The hosted builder is
8
+ * separate from the site it exports: actually performing a REST fetch / external
9
+ * query happens behind the project-owned adapters in the deployed site, NOT here.
10
+ * So the studio captures a sample ONLY when it can do so honestly — it never
11
+ * fabricates data (Oli, 2026-06-19; cf. backend-mode's "never silently swap in
12
+ * in-memory storage", and the v1 "static props, bindings parked" direction):
13
+ *
14
+ * - a provider-backed source runs its registered provider (real project code);
15
+ * - a CMS source replays its stored query over the live content session (Convex
16
+ * mode — EC-177 gap 1), so section/template previews show what delivery serves;
17
+ * - anything else — an external source with no in-studio data path — returns
18
+ * `undefined`. The source then carries no sample, and the binding UI shows an
19
+ * honest "no sample yet" state instead of inventing rows that aren't there.
20
+ */
21
+ export function captureSourceSample(source) {
22
+ const providerId = providerIdOfSource(source);
23
+ if (providerId !== undefined) {
24
+ return providerPayload(providerId, source.kind === 'convex' ? source.config.args : undefined);
25
+ }
26
+ if (source.kind === 'cms') {
27
+ return cmsDeliverySample(source.config);
28
+ }
29
+ return undefined;
30
+ }
31
+ /**
32
+ * A live CMS data source for one config-driven collection (EC-192). The binding
33
+ * and condition pickers enumerate `data.sources`; deriving one source per
34
+ * configured content collection — the same set the CMS uses
35
+ * (`resolveDeploymentCollections`) — means what an editor can bind matches what
36
+ * actually exists. The sample is captured by replaying the collection's list
37
+ * query through the canonical content engine, so when a content session is
38
+ * configured (Convex mode) the inferred field tokens are the collection's real
39
+ * fields; with no session the source is listed but carries no sample.
40
+ */
41
+ export function cmsSourceForCollection(collection) {
42
+ const source = {
43
+ kind: 'cms',
44
+ id: `cms.${collection.id}`,
45
+ label: humanizeName(collection.id),
46
+ config: { collectionId: collection.id, filter: {}, limit: 20 },
47
+ };
48
+ const sample = captureSourceSample(source);
49
+ return sample !== undefined ? captureSample(source, sample) : source;
50
+ }
51
+ /**
52
+ * Replay a CMS source's stored query over the configured content session, in
53
+ * delivery shape (EC-166). Returns `undefined` when no session serves the
54
+ * collection (playground / no backend) — the caller then leaves the source
55
+ * sample-less rather than fabricating one. A query the engine rejects — or one
56
+ * matching nothing — yields an empty list / `null`, never a crash.
57
+ */
58
+ function cmsDeliverySample(config) {
59
+ if (!hasContentSession())
60
+ return undefined;
61
+ if (playgroundCollection(config.collectionId) === undefined)
62
+ return undefined;
63
+ if (config.documentId !== undefined) {
64
+ const result = getCollectionDocument(config.collectionId, config.documentId);
65
+ return result.document ?? null;
66
+ }
67
+ const result = runCollectionListQuery(config.collectionId, listQueryOfConfig(config));
68
+ return result.ok ? result.documents : [];
69
+ }
70
+ //# sourceMappingURL=sample-capture.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sample-capture.js","sourceRoot":"","sources":["../../../src/lib/data/sample-capture.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAA;AAIvD,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAA;AACvC,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAA;AAEhE,OAAO,EACL,qBAAqB,EACrB,iBAAiB,EACjB,oBAAoB,EACpB,sBAAsB,GACvB,MAAM,sBAAsB,CAAA;AAC7B,OAAO,EAAE,kBAA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AS,CAAA;IAC7E,IAAI,MAAM,CAAC,UAAU,KAAK,SAAS,EAAE,CAAC;QACpC,MAAM,MAAM,GAAG,qBAAqB,CAAC,MAAM,CAAC,YAAY,EAAE,MAAM,CAAC,UAAU,CAAC,CAAA;QAC5E,OAAQ,MAAM,CAAC,QAAiC,IAAI,IAAI,CAAA;IAC1D,CAAC;IACD,MAAM,MAAM,GAAG,sBAAsB,CAAC,MAAM,CAAC,YAAY,EAAE,iBAAiB,CAAC,MAAM,CAAC,CAAC,CAAA;IACrF,OAAO,MAAM,CAAC,EAAE,CAAC,CAAC,CAAE,MAAM,CAAC,SAAkC,CAAC,CAAC,CAAC,EAAE,CAAA;AACpE,CAAC"}
@@ -0,0 +1,42 @@
1
+ import type { DataSource } from '@elytracms/data-binding';
2
+ import type { CmsDocument, CollectionDef } from '@elytracms/cms-core';
3
+ import type { OperationResult, OperationsClient } from '../operations';
4
+ /**
5
+ * Data-source persistence for the Builder's data layer (LIVE-mode gap fix).
6
+ *
7
+ * EC-166/EC-167 made the builder provision per-section (`cms.section.<nodeId>`)
8
+ * and per-template (`cms.template.<pageId>`) CMS sources, but only as session
9
+ * state — the live delivery chain (`convex/delivery.ts` →
10
+ * `apps/example-site/lib/live-content.ts`) had nothing to carry. Following the
11
+ * EC-170 routing-store / EC-169 views-store pattern, sources persist as
12
+ * documents in ONE system collection, one document per source, and every
13
+ * mutation goes through the *existing* `@elytracms/operations` commands
14
+ * (`schema.upsertCollection`, `documents.upsert`, `documents.delete`) — no new
15
+ * operations surface, no direct repository access.
16
+ *
17
+ * The record round-trips the FULL canonical `DataSource` shape (including the
18
+ * captured `sample` + inferred `schema` envelope and the cms config's `sort`):
19
+ * `@elytracms/data-binding`'s `dataSourceSchema` is the source of truth, applied
20
+ * on both write and read, so a malformed stored record is dropped on load —
21
+ * never a crash, never a half-parsed source.
22
+ */
23
+ export declare const DATA_SOURCES_COLLECTION = "cms-data-sources";
24
+ /** System collection holding one document per persisted {@link DataSource}. */
25
+ export declare const dataSourcesCollectionDef: CollectionDef;
26
+ export declare function sourceToDocument(source: DataSource): CmsDocument;
27
+ export declare function documentToSource(document: CmsDocument): DataSource | undefined;
28
+ /** Load every persisted data source of a project (malformed records dropped). */
29
+ export declare function loadDataSources(operations: OperationsClient, projectId: string): Promise<OperationResult<DataSource[]>>;
30
+ /**
31
+ * Make sure the system collection exists in the project's CMS schema so
32
+ * `documents.upsert` accepts source documents. Idempotent.
33
+ */
34
+ export declare function ensureDataSourcesCollection(_operations: OperationsClient, _projectId: string): Promise<OperationResult<void>>;
35
+ /** Create or update a persisted data source (operations command). */
36
+ export declare function saveDataSource(operations: OperationsClient, projectId: string, source: DataSource): Promise<OperationResult<void>>;
37
+ /**
38
+ * Delete a persisted data source. A source that was never persisted (pure
39
+ * session state, e.g. a seed) deletes as a no-op — `not-found` is success
40
+ * here, since the goal state ("no persisted record") already holds.
41
+ */
42
+ export declare function deleteDataSource(operations: OperationsClient, projectId: string, sourceId: string): Promise<OperationResult<void>>;
@@ -0,0 +1,120 @@
1
+ import { dataSourceSchema } from '@elytracms/data-binding';
2
+ /**
3
+ * Data-source persistence for the Builder's data layer (LIVE-mode gap fix).
4
+ *
5
+ * EC-166/EC-167 made the builder provision per-section (`cms.section.<nodeId>`)
6
+ * and per-template (`cms.template.<pageId>`) CMS sources, but only as session
7
+ * state — the live delivery chain (`convex/delivery.ts` →
8
+ * `apps/example-site/lib/live-content.ts`) had nothing to carry. Following the
9
+ * EC-170 routing-store / EC-169 views-store pattern, sources persist as
10
+ * documents in ONE system collection, one document per source, and every
11
+ * mutation goes through the *existing* `@elytracms/operations` commands
12
+ * (`schema.upsertCollection`, `documents.upsert`, `documents.delete`) — no new
13
+ * operations surface, no direct repository access.
14
+ *
15
+ * The record round-trips the FULL canonical `DataSource` shape (including the
16
+ * captured `sample` + inferred `schema` envelope and the cms config's `sort`):
17
+ * `@elytracms/data-binding`'s `dataSourceSchema` is the source of truth, applied
18
+ * on both write and read, so a malformed stored record is dropped on load —
19
+ * never a crash, never a half-parsed source.
20
+ */
21
+ export const DATA_SOURCES_COLLECTION = 'cms-data-sources';
22
+ /** System collection holding one document per persisted {@link DataSource}. */
23
+ export const dataSourcesCollectionDef = {
24
+ id: DATA_SOURCES_COLLECTION,
25
+ kind: 'document',
26
+ titleField: 'label',
27
+ form: {
28
+ label: 'Data sources',
29
+ labelSingular: 'Data source',
30
+ description: "System collection managed by the Builder's data layer.",
31
+ },
32
+ fields: [
33
+ { name: 'label', type: 'text', validation: { required: true } },
34
+ /** The source kind (`rest` | `cms` | `convex`), denormalized for table views. */
35
+ { name: 'kind', type: 'text', validation: { required: true } },
36
+ /** The FULL canonical DataSource, JSON-serialized (validated by Zod on read). */
37
+ { name: 'config', type: 'text', validation: { required: true } },
38
+ ],
39
+ };
40
+ // ---- Source ⇄ document mapping ----
41
+ export function sourceToDocument(source) {
42
+ const parsed = dataSourceSchema.parse(source);
43
+ return {
44
+ collection: DATA_SOURCES_COLLECTION,
45
+ id: parsed.id,
46
+ values: {
47
+ label: parsed.label,
48
+ kind: parsed.kind,
49
+ config: JSON.stringify(parsed),
50
+ },
51
+ };
52
+ }
53
+ export function documentToSource(document) {
54
+ const raw = document.values.config;
55
+ let value;
56
+ try {
57
+ value = typeof raw === 'string' ? JSON.parse(raw) : undefined;
58
+ }
59
+ catch {
60
+ return undefined;
61
+ }
62
+ const parsed = dataSourceSchema.safeParse(value);
63
+ if (!parsed.success)
64
+ return undefined;
65
+ // The document id is the source id — a record whose payload disagrees with
66
+ // its own key is malformed and never loads.
67
+ return parsed.data.id === document.id ? parsed.data : undefined;
68
+ }
69
+ // ---- Reads & writes through @elytracms/operations ----
70
+ /** Load every persisted data source of a project (malformed records dropped). */
71
+ export async function loadDataSources(operations, projectId) {
72
+ const result = await operations.documents.list({
73
+ projectId,
74
+ collection: DATA_SOURCES_COLLECTION,
75
+ });
76
+ if (!result.ok)
77
+ return result;
78
+ return {
79
+ ok: true,
80
+ value: result.value
81
+ .map((record) => documentToSource(record.document))
82
+ .filter((source) => source !== undefined),
83
+ };
84
+ }
85
+ /**
86
+ * Make sure the system collection exists in the project's CMS schema so
87
+ * `documents.upsert` accepts source documents. Idempotent.
88
+ */
89
+ export async function ensureDataSourcesCollection(_operations, _projectId) {
90
+ // No-op (EC-183, AD-11): the data-sources system collection is config-owned and
91
+ // the backend stores documents without a schema-membership check — nothing to
92
+ // register. `dataSourcesCollectionDef` remains the canonical document shape.
93
+ return { ok: true, value: undefined };
94
+ }
95
+ /** Create or update a persisted data source (operations command). */
96
+ export async function saveDataSource(operations, projectId, source) {
97
+ const ensured = await ensureDataSourcesCollection(operations, projectId);
98
+ if (!ensured.ok)
99
+ return ensured;
100
+ const result = await operations.documents.upsert({
101
+ projectId,
102
+ document: sourceToDocument(source),
103
+ });
104
+ return result.ok ? { ok: true, value: undefined } : result;
105
+ }
106
+ /**
107
+ * Delete a persisted data source. A source that was never persisted (pure
108
+ * session state, e.g. a seed) deletes as a no-op — `not-found` is success
109
+ * here, since the goal state ("no persisted record") already holds.
110
+ */
111
+ export async function deleteDataSource(operations, projectId, sourceId) {
112
+ const result = await operations.documents.delete({
113
+ projectId,
114
+ ref: { collection: DATA_SOURCES_COLLECTION, id: sourceId },
115
+ });
116
+ if (!result.ok && result.error.code === 'not-found')
117
+ return { ok: true, value: undefined };
118
+ return result.ok ? { ok: true, value: undefined } : result;
119
+ }
120
+ //# sourceMappingURL=sources-store.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sources-store.js","sourceRoot":"","sources":["../../../src/lib/data/sources-store.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAA;AAK1D;;;;;;;;;;;;;;;;;;GAkBG;AAEH,MAAM,CAAC,MAAM,uBAAuB,GAAG,kBAAkB,CAAA;AAEzD,+EAA+E;AAC/E,MAAM,CAAC,MAAM,wBAAwB,GAAkB;IACrD,EAAE,EAAE,uBAAuB;IAC3B,IAAI,EAAE,UAAU;IAChB,UAAU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E,OAAO,OAAO,CAAA;IAC/B,MAAM,MAAM,GAAG,MAAM,UAAU,CAAC,SAAS,CAAC,MAAM,CAAC;QAC/C,SAAS;QACT,QAAQ,EAAE,gBAAgB,CAAC,MAAM,CAAC;KACnC,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;;;;GAIG;AACH,MAAM,CAAC,KAAK,UAAU,gBAAgB,CACpC,UAA4B,EAC5B,SAAiB,EACjB,QAAgB;IAEhB,MAAM,MAAM,GAAG,MAAM,UAAU,CAAC,SAAS,CAAC,MAAM,CAAC;QAC/C,SAAS;QACT,GAAG,EAAE,EAAE,UAAU,EAAE,uBAAuB,EAAE,EAAE,EAAE,QAAQ,EAAE;KAC3D,CAAC,CAAA;IACF,IAAI,CAAC,MAAM,CAAC,EAAE,IAAI,MAAM,CAAC,KAAK,CAAC,IAAI,KAAK,WAAW;QAAE,OAAO,EAAE,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,SAAS,EAAE,CAAA;IAC1F,OAAO,MAAM,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,SAAS,EAAE,CAAC,CAAC,CAAC,MAAM,CAAA;AAC5D,CAAC"}
@@ -0,0 +1,219 @@
1
+ import type { ComponentNode, GridContainerOptions, InsertTarget } from '@elytracms/project-graph';
2
+ /**
3
+ * Drag & drop eligibility rules (EC-160 + EC-162, vision §3.1) — pure
4
+ * graph-level functions with **no DOM or UI dependencies**. The canvas and the
5
+ * page tree both resolve drops through `resolveDrop`, so the two surfaces can
6
+ * never disagree about what a manifest slot allow-list permits, which children
7
+ * a component accepts, or whether a move would create a cycle.
8
+ *
9
+ * The drop-zone model is position-based: `into` a slot, `before`/`after` a
10
+ * sibling along the parent's flow axis, and the EC-162 gesture positions
11
+ * `left`/`right` — dropping *beside* an element wraps both in a two-column
12
+ * `Grid` container (see `applyWrap`).
13
+ */
14
+ /**
15
+ * The manifest slice the rules evaluate. Structural (not the full
16
+ * `ComponentManifest`) so tests and future callers can feed minimal lookups.
17
+ */
18
+ export interface SlotRule {
19
+ name: string;
20
+ /** Restrict which component ids may be inserted (omit to allow any). */
21
+ allow?: string[];
22
+ }
23
+ export interface ManifestRules {
24
+ slots: SlotRule[];
25
+ }
26
+ /** Resolve a component id to its manifest slot rules (undefined = unknown component). */
27
+ export type ManifestLookup = (componentId: string) => ManifestRules | undefined;
28
+ /** What is being dragged. */
29
+ export type DragSubject =
30
+ /** An existing node of the current page — a completed drop is a `move`. */
31
+ {
32
+ kind: 'node';
33
+ nodeId: string;
34
+ componentId: string;
35
+ }
36
+ /** A new subtree (blocks-panel tile) — a completed drop is an `insert`. */
37
+ | {
38
+ kind: 'component';
39
+ componentId: string;
40
+ };
41
+ /**
42
+ * Where, relative to a reference node, the drop would land. `into`, `before`
43
+ * and `after` are the EC-160 positions; `left`/`right` are the EC-162 gesture
44
+ * positions — "beside" the reference, wrapping both elements in a two-column
45
+ * `Grid` container.
46
+ */
47
+ export type DropPosition = 'into' | 'before' | 'after' | 'left' | 'right';
48
+ /** The side of the reference an EC-162 wrap gesture drops on. */
49
+ export type WrapSide = 'left' | 'right';
50
+ export interface DropLocation {
51
+ /** The reference node id (the hovered node/row). */
52
+ nodeId: string;
53
+ position: DropPosition;
54
+ }
55
+ export type DropRejectionCode =
56
+ /** The reference node does not exist in the tree. */
57
+ 'missing-target'
58
+ /** `into` on a component that declares no insertable slot. */
59
+ | 'no-slot'
60
+ /** The target slot's manifest allow-list rejects the dragged component. */
61
+ | 'not-allowed'
62
+ /** Moving a node into itself or its own subtree (cycle). */
63
+ | 'own-subtree'
64
+ /** The page root cannot be moved, and nothing can drop beside it. */
65
+ | 'root'
66
+ /** Structurally valid but changes nothing (dropping a node onto its own position). */
67
+ | 'no-op';
68
+ export interface DropRejection {
69
+ eligible: false;
70
+ code: DropRejectionCode;
71
+ reason: string;
72
+ }
73
+ /** An eligible drop: exactly one builder action (move, insert, or wrap) commits it. */
74
+ export type DropPlan = {
75
+ eligible: true;
76
+ kind: 'move';
77
+ nodeId: string;
78
+ target: InsertTarget;
79
+ } | {
80
+ eligible: true;
81
+ kind: 'insert';
82
+ target: InsertTarget;
83
+ }
84
+ /**
85
+ * EC-162 wrap gesture: the reference node and the dragged subject become the
86
+ * two columns of a new `Grid` container, created atomically (`applyWrap`).
87
+ * `nodeId` is present when the subject is an existing node (a move-wrap);
88
+ * absent for blocks-panel components (an insert-wrap via `buildNode`).
89
+ */
90
+ | {
91
+ eligible: true;
92
+ kind: 'wrap';
93
+ referenceId: string;
94
+ side: WrapSide;
95
+ nodeId?: string;
96
+ };
97
+ export type DropResolution = DropPlan | DropRejection;
98
+ /**
99
+ * The slot an `into` drop inserts into: the default `children` slot when
100
+ * declared, else the first authored slot that is not the layout `outlet`.
101
+ * Mirrors the shell's insert-context resolution so click-insert and
102
+ * drag-insert land in the same place.
103
+ */
104
+ export declare function primaryInsertSlot(manifest: ManifestRules | undefined): SlotRule | undefined;
105
+ /** True when a component can receive `into` drops at all (declares an insertable slot). */
106
+ export declare function canNestInto(getManifest: ManifestLookup, componentId: string): boolean;
107
+ /** True when a slot's allow-list (if any) permits the component id. */
108
+ export declare function slotAllows(slot: SlotRule | undefined, componentId: string): boolean;
109
+ /**
110
+ * Resolve a prospective drop into either an executable plan (one `move` or
111
+ * `insert` builder action → one operations command → one undo step) or a
112
+ * structured rejection the UI shows *during* the drag. Pure: same inputs,
113
+ * same answer, on both surfaces.
114
+ */
115
+ export declare function resolveDrop(args: {
116
+ root: ComponentNode;
117
+ getManifest: ManifestLookup;
118
+ subject: DragSubject;
119
+ location: DropLocation;
120
+ }): DropResolution;
121
+ /**
122
+ * The container a "drop beside" gesture creates. Canonical choice (EC-161
123
+ * semantics): a `Grid` with two columns, **not** a horizontal `Stack` —
124
+ * EC-161 gives `Grid` the canonical column vocabulary (`columns` is a
125
+ * validated graph value the contextual inspector refines from 2 → n), while
126
+ * a horizontal Stack expresses flow order, not column tracks. The values
127
+ * mirror the Grid manifest defaults (`columns: 2`, `gap: '4'`), so the
128
+ * gesture's graph is exactly what composing the same layout manually would
129
+ * produce.
130
+ */
131
+ export declare const WRAP_GRID_OPTIONS: GridContainerOptions;
132
+ /** What lands beside the reference: an existing node (moved) or a built subtree (inserted). */
133
+ export type WrapPartner = {
134
+ kind: 'node';
135
+ nodeId: string;
136
+ } | {
137
+ kind: 'subtree';
138
+ node: ComponentNode;
139
+ };
140
+ export interface WrapResult {
141
+ root: ComponentNode;
142
+ /** The id of the created Grid container. */
143
+ containerId: string;
144
+ }
145
+ /**
146
+ * Execute a wrap plan as **one** structural edit: lift the partner out of the
147
+ * tree (when it is an existing node) and replace the reference with
148
+ * `gridContainerNode(containerId, WRAP_GRID_OPTIONS, [left, right])` in a
149
+ * single pass. The caller commits the result as one builder action → one
150
+ * operations command → one undo step; EC-161 normalization then runs on the
151
+ * *committed* tree, so the two-child container can never be observed (or
152
+ * persisted) in a half-built state. Returns `null` for structurally invalid
153
+ * input (missing nodes, root reference, reference inside the partner).
154
+ *
155
+ * Determinism (EC-162): the produced container subtree is exactly the
156
+ * `gridContainerNode` constructor output — identical to manual composition.
157
+ */
158
+ export declare function applyWrap(args: {
159
+ root: ComponentNode;
160
+ referenceId: string;
161
+ side: WrapSide;
162
+ partner: WrapPartner;
163
+ containerId: string;
164
+ }): WrapResult | null;
165
+ /** The axis along which a container lays out its children. */
166
+ export type FlowAxis = 'vertical' | 'horizontal';
167
+ /**
168
+ * The flow axis of a container — the axis its children stack along, and
169
+ * therefore the hit-band axis for drops over those children (EC-162 ledger
170
+ * fix: bands follow the parent's flow direction, on both surfaces). Mirrors
171
+ * the renderer: a horizontal Stack flows horizontally; a Grid flows
172
+ * horizontally when it actually has ≥ 2 column tracks (an absent/invalid
173
+ * `columns` renders one column). Everything else is block flow (vertical).
174
+ */
175
+ export declare function containerFlowAxis(node: ComponentNode | undefined): FlowAxis;
176
+ /**
177
+ * Map a 2D pointer offset within a drop target's box onto a `DropPosition`
178
+ * (EC-162). `flow` is the flow axis of the target's *parent* — before/after
179
+ * bands run along it. On vertically flowing targets, narrow side bands on the
180
+ * cross axis produce `left`/`right` (the wrap-into-columns gesture, when
181
+ * `wrappable`); children of horizontal containers get left/right bands for
182
+ * plain reorder instead, so "beside" already means before/after there.
183
+ */
184
+ export declare function dropPositionForPoint(args: {
185
+ /** Pointer offset across the target's width, 0..1. */
186
+ x: number;
187
+ /** Pointer offset across the target's height, 0..1. */
188
+ y: number;
189
+ /** Flow axis of the target's parent (the axis siblings stack along). */
190
+ flow: FlowAxis;
191
+ nestable: boolean;
192
+ edges: boolean;
193
+ /** Enable the wrap side-bands (the gesture surface opts in). */
194
+ wrappable?: boolean;
195
+ }): DropPosition;
196
+ /**
197
+ * Map a pointer offset within a drop target's box onto a `DropPosition`.
198
+ * `ratio` is the pointer's offset along the target's main axis, 0..1 — the
199
+ * caller picks the axis (the parent's flow axis; see `containerFlowAxis`).
200
+ *
201
+ * - nestable targets with siblings: edge quarters insert before/after, the
202
+ * middle half nests into the slot
203
+ * - leaf targets: top/bottom halves insert before/after
204
+ * - targets without siblings (the root): always `into`
205
+ */
206
+ export declare function dropPositionForPointer(args: {
207
+ ratio: number;
208
+ /** Whether `into` is structurally possible (target declares an insert slot). */
209
+ nestable: boolean;
210
+ /** Whether before/after exist (target has a parent slot). */
211
+ edges: boolean;
212
+ }): DropPosition;
213
+ /**
214
+ * The visual state a surface shows for the current resolution. `blocked` is
215
+ * the explicit rejection state (never a silent failed drop); `null` means show
216
+ * nothing (a no-op drop is inert, not an error).
217
+ */
218
+ export type DropIndicator = DropPosition | 'blocked' | null;
219
+ export declare function dropIndicatorFor(resolution: DropResolution, position: DropPosition): DropIndicator;