alinea 2.0.0-preview.0 → 2.0.0-preview.10

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 (980) hide show
  1. package/dist/.init/.mcp.json +11 -0
  2. package/dist/.init/AGENTS.md +17 -0
  3. package/dist/.init/CLAUDE.md +1 -0
  4. package/dist/.init/content/pages/welcome.json +1 -1
  5. package/dist/.init/package.json +1 -1
  6. package/dist/.init/src/cms.ts +5 -6
  7. package/dist/.mcp/later/dev.json +1 -0
  8. package/dist/.mcp/lock/dev.json +1 -0
  9. package/dist/.mcp/online/dev.json +1 -0
  10. package/dist/LICENSES.md +2342 -289
  11. package/dist/adapter/next/ForwardCredentials.d.ts +1 -0
  12. package/dist/adapter/next/ForwardCredentials.js +17 -0
  13. package/dist/adapter/next/cms.d.ts +20 -6
  14. package/dist/adapter/next/cms.js +226 -54
  15. package/dist/adapter/next/context.d.ts +1 -1
  16. package/dist/adapter/next/context.js +15 -5
  17. package/dist/adapter/next/devCache.d.ts +16 -0
  18. package/dist/adapter/next/devCache.js +32 -0
  19. package/dist/adapter/next/handler.d.ts +6 -0
  20. package/dist/adapter/next/handler.js +119 -23
  21. package/dist/adapter/next/node.d.ts +5 -0
  22. package/dist/adapter/next/node.js +16 -0
  23. package/dist/adapter/next/previews.d.ts +4 -1
  24. package/dist/adapter/next/previews.js +20 -1
  25. package/dist/adapter/next/renderStats.d.ts +45 -0
  26. package/dist/adapter/next/renderStats.js +142 -0
  27. package/dist/adapter/next/syncCheck.d.ts +18 -0
  28. package/dist/adapter/next/syncCheck.js +53 -0
  29. package/dist/adapter/next/with-alinea.d.ts +0 -8
  30. package/dist/adapter/next/with-alinea.js +65 -46
  31. package/dist/adapter/vite/plugin.js +9 -4
  32. package/dist/backend/HandleAction.d.ts +1 -1
  33. package/dist/backend/HandleAction.js +1 -1
  34. package/dist/backend/Handler.d.ts +15 -14
  35. package/dist/backend/Handler.js +193 -49
  36. package/dist/backend/api/BasicAuth.d.ts +1 -1
  37. package/dist/backend/api/BasicAuth.js +14 -14
  38. package/dist/backend/api/CreateBackend.js +15 -3
  39. package/dist/backend/api/DatabaseApi.js +22 -135
  40. package/dist/backend/api/GithubApi.js +16 -7
  41. package/dist/backend/api/OAuth2.d.ts +3 -3
  42. package/dist/backend/api/OAuth2.js +7 -4
  43. package/dist/backend/api/ProxyMedia.d.ts +2 -0
  44. package/dist/backend/api/ProxyMedia.js +27 -0
  45. package/dist/backend/api/S3Uploads.d.ts +1 -1
  46. package/dist/backend/api/database.js +15 -3
  47. package/dist/backend/resolver/ParsePreview.d.ts +9 -5
  48. package/dist/backend/resolver/ParsePreview.js +40 -43
  49. package/dist/backend/router/NodeHandler.js +2 -0
  50. package/dist/backend/router/Router.d.ts +1 -0
  51. package/dist/backend/router/Router.js +23 -15
  52. package/dist/backend/store/GeneratedDatabase.d.ts +8 -0
  53. package/dist/backend/store/GeneratedDatabase.js +33 -0
  54. package/dist/backend/store/GeneratedDatabaseNode.d.ts +8 -0
  55. package/dist/backend/store/GeneratedDatabaseNode.js +25 -0
  56. package/dist/backend/store/GeneratedRelease.d.ts +1 -1
  57. package/dist/backend/store/GeneratedRelease.js +3 -4
  58. package/dist/backend/util/ORM.js +4 -2
  59. package/dist/backend/util/Syncable.js +1 -1
  60. package/dist/bundled.d.ts +11698 -6082
  61. package/dist/chunks/bun-sqlite-5SHXN3AT.js +18 -0
  62. package/dist/chunks/ccitt-Y7TDCCPM.js +90 -0
  63. package/dist/chunks/chunk-2BJ2IFQM.js +1085 -0
  64. package/dist/chunks/chunk-2PIFHEYR.js +364 -0
  65. package/dist/chunks/chunk-66YZ47TY.js +94 -0
  66. package/dist/chunks/chunk-6UT4N4CO.js +919 -0
  67. package/dist/chunks/chunk-76VMZTLN.js +55 -0
  68. package/dist/chunks/{chunk-TL7ZW6BX.js → chunk-A3XXZBOQ.js} +2535 -2999
  69. package/dist/chunks/chunk-AC5ATYI3.js +1434 -0
  70. package/dist/chunks/chunk-AIU6CMVT.js +495 -0
  71. package/dist/chunks/chunk-ASYKC6IE.js +103 -0
  72. package/dist/chunks/chunk-ATF42T2B.js +35 -0
  73. package/dist/chunks/{chunk-Y7XOMJOC.js → chunk-CFNRVI3Y.js} +220 -247
  74. package/dist/chunks/chunk-D6UJHBJJ.js +183 -0
  75. package/dist/chunks/{chunk-NWQXN4SB.js → chunk-ETBQTP2S.js} +40 -29
  76. package/dist/chunks/chunk-ETWOY4AL.js +100 -0
  77. package/dist/chunks/{chunk-EQ3TDHYD.js → chunk-HXXBAY3B.js} +35 -7
  78. package/dist/chunks/{chunk-I7X64JTZ.js → chunk-JOF663EG.js} +6479 -3715
  79. package/dist/chunks/chunk-K62JP6HR.js +22 -0
  80. package/dist/chunks/chunk-MOWR65LM.js +610 -0
  81. package/dist/chunks/chunk-N47Y62CI.js +396 -0
  82. package/dist/chunks/{chunk-7ORQ7BYK.js → chunk-NP4M2257.js} +203 -269
  83. package/dist/chunks/{chunk-53DZYORR.js → chunk-PAYSVIYI.js} +76 -176
  84. package/dist/chunks/{chunk-IYAQC63Y.js → chunk-PSSMQKAH.js} +1607 -744
  85. package/dist/chunks/chunk-QBPYWU6C.js +24 -0
  86. package/dist/chunks/{chunk-X47OVDF3.js → chunk-QJGGYF6E.js} +356 -1000
  87. package/dist/chunks/chunk-QSN6RH6X.js +94 -0
  88. package/dist/chunks/{chunk-IWN3T3FL.js → chunk-RE523BQ7.js} +21443 -16177
  89. package/dist/chunks/chunk-RE6CDK2M.js +254 -0
  90. package/dist/chunks/chunk-TIJTT5ZI.js +228 -0
  91. package/dist/chunks/{chunk-I4GC3E65.js → chunk-UPY2RUZF.js} +0 -1
  92. package/dist/chunks/chunk-W5AXN7GH.js +219 -0
  93. package/dist/chunks/chunk-XCZXR3C2.js +112 -0
  94. package/dist/chunks/chunk-XTWYBWP2.js +81 -0
  95. package/dist/chunks/dist-UDQZOKRG.js +7499 -0
  96. package/dist/chunks/jpeg-OJTBZV3C.js +292 -0
  97. package/dist/chunks/jpx-4VRYG2JB.js +667 -0
  98. package/dist/chunks/node-sqlite-XVNTNMCY.js +18 -0
  99. package/dist/cli/Generate.d.ts +2 -1
  100. package/dist/cli/Generate.js +91 -79
  101. package/dist/cli/Init.d.ts +43 -2
  102. package/dist/cli/Init.js +144 -28
  103. package/dist/cli/Mcp.d.ts +25 -0
  104. package/dist/cli/Mcp.js +106 -0
  105. package/dist/cli/Serve.d.ts +0 -1
  106. package/dist/cli/Serve.js +15 -5
  107. package/dist/cli/bin.js +44 -14
  108. package/dist/cli/generate/CompileConfig.js +3 -2
  109. package/dist/cli/generate/CopyStaticFiles.d.ts +1 -1
  110. package/dist/cli/generate/CopyStaticFiles.js +39 -24
  111. package/dist/cli/generate/DevDB.d.ts +21 -4
  112. package/dist/cli/generate/DevDB.js +139 -27
  113. package/dist/cli/generate/FillCache.d.ts +1 -1
  114. package/dist/cli/generate/FillCache.js +20 -9
  115. package/dist/cli/generate/GenerateContext.d.ts +3 -0
  116. package/dist/cli/generate/GenerateDashboard.d.ts +1 -1
  117. package/dist/cli/generate/GenerateDashboard.js +3 -1
  118. package/dist/cli/generate/GeneratedPaths.d.ts +21 -0
  119. package/dist/cli/generate/GeneratedPaths.js +33 -0
  120. package/dist/cli/generate/LinkMediaFiles.d.ts +7 -0
  121. package/dist/cli/generate/LinkMediaFiles.js +52 -0
  122. package/dist/cli/serve/CreateLocalServer.d.ts +3 -2
  123. package/dist/cli/serve/CreateLocalServer.js +106 -50
  124. package/dist/cli/serve/DevLock.d.ts +11 -0
  125. package/dist/cli/serve/DevLock.js +42 -0
  126. package/dist/cli/serve/DevServer.d.ts +6 -4
  127. package/dist/cli/serve/DevServer.js +71 -8
  128. package/dist/cli/serve/LiveReload.d.ts +2 -2
  129. package/dist/cli/serve/LiveReload.js +6 -2
  130. package/dist/cli/serve/LocalAuth.js +1 -1
  131. package/dist/cli/serve/ServeContext.d.ts +1 -1
  132. package/dist/cli/serve/StartServer.d.ts +3 -1
  133. package/dist/cli/serve/StartServer.js +10 -3
  134. package/dist/cli/serve/mcp/DevMcp.d.ts +16 -0
  135. package/dist/cli/serve/mcp/DevMcp.js +50 -0
  136. package/dist/cli/serve/mcp/McpGraph.d.ts +35 -0
  137. package/dist/cli/serve/mcp/McpGraph.js +64 -0
  138. package/dist/cli/serve/mcp/McpInput.d.ts +11 -0
  139. package/dist/cli/serve/mcp/McpInput.js +254 -0
  140. package/dist/cli/serve/mcp/McpInstructions.d.ts +1 -0
  141. package/dist/cli/serve/mcp/McpInstructions.js +16 -0
  142. package/dist/cli/serve/mcp/McpSchema.d.ts +31 -0
  143. package/dist/cli/serve/mcp/McpSchema.js +184 -0
  144. package/dist/cli/serve/mcp/McpServer.d.ts +47 -0
  145. package/dist/cli/serve/mcp/McpServer.js +112 -0
  146. package/dist/cli/serve/mcp/McpTools.d.ts +25 -0
  147. package/dist/cli/serve/mcp/McpTools.js +567 -0
  148. package/dist/cli/static/init/agents.md +13 -0
  149. package/dist/cli/static/init/cms.js +5 -6
  150. package/dist/cli/util/ContentType.d.ts +1 -0
  151. package/dist/cli/util/ContentType.js +36 -0
  152. package/dist/cli/util/Emitter.js +1 -1
  153. package/dist/cli/util/EnsureLibs.js +2 -2
  154. package/dist/cli/util/EnsureNode.js +2 -2
  155. package/dist/cli/util/ForwardCommand.js +4 -12
  156. package/dist/cli/util/PublicDefines.d.ts +1 -0
  157. package/dist/cli/util/PublicDefines.js +2 -1
  158. package/dist/cli/util/RunForwarded.d.ts +13 -0
  159. package/dist/cli/util/RunForwarded.js +166 -0
  160. package/dist/cli/util/WarnPublicEnv.js +2 -0
  161. package/dist/cloud/AuthResult.d.ts +2 -0
  162. package/dist/cloud/CloudHandshake.d.ts +13 -0
  163. package/dist/cloud/CloudHandshake.js +121 -0
  164. package/dist/cloud/CloudRemote.d.ts +6 -2
  165. package/dist/cloud/CloudRemote.js +43 -10
  166. package/dist/cms.d.ts +19 -0
  167. package/dist/cms.js +49 -0
  168. package/dist/components/Alert.d.ts +29 -0
  169. package/dist/components/Alert.js +86 -0
  170. package/dist/components/AppShell.d.ts +15 -0
  171. package/dist/components/AppShell.js +38 -0
  172. package/dist/components/Badge.d.ts +11 -0
  173. package/dist/components/Badge.js +51 -0
  174. package/dist/components/Blockquote.d.ts +7 -0
  175. package/dist/components/Blockquote.js +26 -0
  176. package/dist/components/Breadcrumbs.d.ts +39 -3
  177. package/dist/components/Breadcrumbs.js +103 -22
  178. package/dist/components/Button.d.ts +28 -8
  179. package/dist/components/Button.js +63 -22
  180. package/dist/components/Calendar.d.ts +28 -3
  181. package/dist/components/Calendar.js +163 -54
  182. package/dist/components/Checkbox.d.ts +18 -7
  183. package/dist/components/Checkbox.js +85 -39
  184. package/dist/components/CheckboxGroup.d.ts +11 -5
  185. package/dist/components/CheckboxGroup.js +55 -19
  186. package/dist/components/Code.d.ts +10 -0
  187. package/dist/components/Code.js +49 -0
  188. package/dist/components/Collapsible.d.ts +25 -0
  189. package/dist/components/Collapsible.js +146 -0
  190. package/dist/components/ColorSwatch.d.ts +9 -2
  191. package/dist/components/ColorSwatch.js +20 -20
  192. package/dist/components/ColorSwatchPicker.d.ts +18 -3
  193. package/dist/components/ColorSwatchPicker.js +29 -25
  194. package/dist/components/ComboBox.d.ts +27 -9
  195. package/dist/components/ComboBox.js +198 -100
  196. package/dist/components/Command.d.ts +66 -0
  197. package/dist/components/Command.js +236 -0
  198. package/dist/components/ContentCard.d.ts +30 -0
  199. package/dist/components/ContentCard.js +199 -0
  200. package/dist/components/ContentGrid.d.ts +58 -0
  201. package/dist/components/ContentGrid.js +220 -0
  202. package/dist/components/DataList.d.ts +27 -0
  203. package/dist/components/DataList.js +68 -0
  204. package/dist/components/DateField.d.ts +15 -4
  205. package/dist/components/DateField.js +51 -44
  206. package/dist/components/DatePicker.d.ts +17 -4
  207. package/dist/components/DatePicker.js +61 -68
  208. package/dist/components/DateRangePicker.d.ts +19 -4
  209. package/dist/components/DateRangePicker.js +69 -80
  210. package/dist/components/Dialog.d.ts +53 -3
  211. package/dist/components/Dialog.js +188 -20
  212. package/dist/components/DropZone.d.ts +25 -3
  213. package/dist/components/DropZone.js +99 -18
  214. package/dist/components/DropdownMenu.d.ts +78 -0
  215. package/dist/components/DropdownMenu.js +318 -0
  216. package/dist/components/Empty.d.ts +46 -0
  217. package/dist/components/Empty.js +93 -0
  218. package/dist/components/Field.d.ts +34 -0
  219. package/dist/components/Field.js +159 -0
  220. package/dist/components/FileTrigger.d.ts +21 -0
  221. package/dist/components/FileTrigger.js +53 -0
  222. package/dist/components/FoldIcon.js +2 -1
  223. package/dist/components/Heading.d.ts +13 -0
  224. package/dist/components/Heading.js +48 -0
  225. package/dist/components/Icon.d.ts +1 -1
  226. package/dist/components/Icon.js +3 -3
  227. package/dist/components/Kbd.d.ts +8 -0
  228. package/dist/components/Kbd.js +27 -0
  229. package/dist/components/Link.d.ts +14 -4
  230. package/dist/components/Link.js +22 -20
  231. package/dist/components/List.d.ts +20 -63
  232. package/dist/components/List.js +129 -250
  233. package/dist/components/MediaPreview.d.ts +35 -0
  234. package/dist/components/MediaPreview.js +227 -0
  235. package/dist/components/MultipleSelect.d.ts +22 -20
  236. package/dist/components/MultipleSelect.js +234 -216
  237. package/dist/components/NavRail.d.ts +41 -0
  238. package/dist/components/NavRail.js +121 -0
  239. package/dist/components/NumberField.d.ts +19 -4
  240. package/dist/components/NumberField.js +105 -54
  241. package/dist/components/Page.d.ts +57 -0
  242. package/dist/components/Page.js +130 -0
  243. package/dist/components/Popover.d.ts +39 -5
  244. package/dist/components/Popover.js +146 -22
  245. package/dist/components/PreviewFrame.d.ts +46 -0
  246. package/dist/components/PreviewFrame.js +182 -0
  247. package/dist/components/RadioGroup.d.ts +20 -7
  248. package/dist/components/RadioGroup.js +121 -31
  249. package/dist/components/Resizable.d.ts +51 -0
  250. package/dist/components/Resizable.js +1349 -0
  251. package/dist/components/SearchField.d.ts +37 -6
  252. package/dist/components/SearchField.js +115 -56
  253. package/dist/components/Select.d.ts +35 -10
  254. package/dist/components/Select.js +189 -97
  255. package/dist/components/Sidebar.d.ts +56 -0
  256. package/dist/components/Sidebar.js +136 -0
  257. package/dist/components/SortableList.d.ts +80 -0
  258. package/dist/components/SortableList.js +471 -0
  259. package/dist/components/Spinner.d.ts +8 -0
  260. package/dist/components/Spinner.js +86 -0
  261. package/dist/components/Surface.js +13 -3
  262. package/dist/components/Switch.d.ts +15 -4
  263. package/dist/components/Switch.js +32 -20
  264. package/dist/components/Table.d.ts +107 -14
  265. package/dist/components/Table.js +470 -100
  266. package/dist/components/Tabs.d.ts +33 -12
  267. package/dist/components/Tabs.js +68 -51
  268. package/dist/components/TagGroup.d.ts +26 -9
  269. package/dist/components/TagGroup.js +99 -33
  270. package/dist/components/Text.d.ts +16 -0
  271. package/dist/components/Text.js +44 -0
  272. package/dist/components/TextField.d.ts +27 -9
  273. package/dist/components/TextField.js +142 -46
  274. package/dist/components/TimeField.d.ts +20 -4
  275. package/dist/components/TimeField.js +75 -23
  276. package/dist/components/Timestamp.d.ts +17 -0
  277. package/dist/components/Timestamp.js +131 -0
  278. package/dist/components/Toggle.d.ts +15 -7
  279. package/dist/components/Toggle.js +4 -54
  280. package/dist/components/ToggleGroup.d.ts +33 -0
  281. package/dist/components/ToggleGroup.js +90 -0
  282. package/dist/components/Toolbar.d.ts +27 -8
  283. package/dist/components/Toolbar.js +51 -40
  284. package/dist/components/Tooltip.d.ts +22 -4
  285. package/dist/components/Tooltip.js +77 -34
  286. package/dist/components/Tree.d.ts +48 -18
  287. package/dist/components/Tree.js +227 -81
  288. package/dist/components/internal/Accept.d.ts +5 -0
  289. package/dist/components/internal/Accept.js +17 -0
  290. package/dist/components/internal/DateControl.d.ts +18 -0
  291. package/dist/components/internal/DateControl.js +92 -0
  292. package/dist/components/internal/DateValue.d.ts +16 -0
  293. package/dist/components/internal/DateValue.js +40 -0
  294. package/dist/components/internal/ListBoxOption.d.ts +20 -0
  295. package/dist/components/internal/ListBoxOption.js +111 -0
  296. package/dist/components/internal/Locale.d.ts +7 -0
  297. package/dist/components/internal/Locale.js +18 -0
  298. package/dist/components/internal/Placement.d.ts +3 -0
  299. package/dist/components/internal/Placement.js +13 -0
  300. package/dist/components/internal/PopoverSurface.d.ts +21 -0
  301. package/dist/components/internal/PopoverSurface.js +66 -0
  302. package/dist/components/internal/SelectionCheckbox.d.ts +8 -0
  303. package/dist/components/internal/SelectionCheckbox.js +57 -0
  304. package/dist/components/internal/Slot.d.ts +7 -0
  305. package/dist/components/internal/Slot.js +26 -0
  306. package/dist/components/internal/ToggleButton.d.ts +26 -0
  307. package/dist/components/internal/ToggleButton.js +68 -0
  308. package/dist/components/internal/Trigger.d.ts +16 -0
  309. package/dist/components/internal/Trigger.js +34 -0
  310. package/dist/components/internal/useDragDrop.d.ts +22 -0
  311. package/dist/components/internal/useDragDrop.js +110 -0
  312. package/dist/components/types.d.ts +106 -0
  313. package/dist/components/types.js +0 -0
  314. package/dist/components.d.ts +29 -5
  315. package/dist/components.js +28 -5
  316. package/dist/config.d.ts +1 -0
  317. package/dist/config.js +2 -0
  318. package/dist/core/BlobTransport.d.ts +5 -0
  319. package/dist/core/BlobTransport.js +79 -0
  320. package/dist/core/Client.d.ts +3 -5
  321. package/dist/core/Client.js +22 -19
  322. package/dist/core/Config.d.ts +26 -3
  323. package/dist/core/Config.js +24 -2
  324. package/dist/core/Connection.d.ts +29 -10
  325. package/dist/core/Connection.js +17 -0
  326. package/dist/core/Document.d.ts +2 -2
  327. package/dist/core/Document.js +15 -3
  328. package/dist/core/Entry.d.ts +9 -0
  329. package/dist/core/Entry.js +14 -0
  330. package/dist/core/EntryFields.d.ts +5 -0
  331. package/dist/core/EntrySeed.d.ts +23 -0
  332. package/dist/core/EntrySeed.js +135 -0
  333. package/dist/core/Expr.d.ts +11 -0
  334. package/dist/core/Field.d.ts +28 -1
  335. package/dist/core/Field.js +23 -0
  336. package/dist/core/Filter.d.ts +53 -2
  337. package/dist/core/Filter.js +145 -0
  338. package/dist/core/Graph.d.ts +35 -13
  339. package/dist/core/Id.d.ts +1 -0
  340. package/dist/core/Id.js +8 -0
  341. package/dist/core/Infer.d.ts +25 -1
  342. package/dist/core/ListRow.d.ts +3 -0
  343. package/dist/core/ListRow.js +1 -0
  344. package/dist/core/OrderBy.d.ts +7 -3
  345. package/dist/core/Overview.d.ts +242 -0
  346. package/dist/core/Overview.js +47 -0
  347. package/dist/core/Reference.d.ts +1 -0
  348. package/dist/core/Role.d.ts +6 -0
  349. package/dist/core/Role.js +17 -14
  350. package/dist/core/Root.d.ts +18 -2
  351. package/dist/core/Root.js +11 -3
  352. package/dist/core/Scope.d.ts +2 -0
  353. package/dist/core/Scope.js +16 -1
  354. package/dist/core/TextDoc.d.ts +24 -1
  355. package/dist/core/TextDoc.js +1 -0
  356. package/dist/core/Trace.d.ts +8 -0
  357. package/dist/core/Trace.js +32 -0
  358. package/dist/core/Type.d.ts +46 -9
  359. package/dist/core/Type.js +44 -9
  360. package/dist/core/Validation.d.ts +56 -0
  361. package/dist/core/Validation.js +121 -0
  362. package/dist/core/Workspace.d.ts +7 -5
  363. package/dist/core/Workspace.js +5 -1
  364. package/dist/core/db/CommitRequest.d.ts +0 -3
  365. package/dist/core/db/CommitRequest.js +0 -9
  366. package/dist/core/db/EntryAliases.js +2 -15
  367. package/dist/core/db/EntryReference.d.ts +8 -7
  368. package/dist/core/db/EntryUrlConflictError.js +1 -1
  369. package/dist/core/db/EntryValidationError.d.ts +13 -0
  370. package/dist/core/db/EntryValidationError.js +23 -0
  371. package/dist/core/db/IndexEvent.d.ts +2 -1
  372. package/dist/core/db/IndexEvent.js +11 -3
  373. package/dist/core/db/LinkResolver.d.ts +13 -7
  374. package/dist/core/db/LinkResolver.js +0 -30
  375. package/dist/core/db/LocalStore.d.ts +27 -0
  376. package/dist/core/db/LocalStore.js +0 -0
  377. package/dist/core/db/Operation.d.ts +24 -3
  378. package/dist/core/db/Operation.js +119 -26
  379. package/dist/core/db/WriteableGraph.d.ts +5 -0
  380. package/dist/core/field/CreateField.d.ts +1 -1
  381. package/dist/core/field/ListField.js +44 -8
  382. package/dist/core/field/RecordField.js +16 -2
  383. package/dist/core/field/RichTextField.d.ts +30 -3
  384. package/dist/core/field/RichTextField.js +232 -79
  385. package/dist/core/field/ScalarField.d.ts +2 -2
  386. package/dist/core/field/UnionField.js +32 -2
  387. package/dist/core/media/CompressPdf.browser.d.ts +5 -0
  388. package/dist/core/media/CompressPdf.browser.js +13 -0
  389. package/dist/core/media/CompressPdf.d.ts +6 -0
  390. package/dist/core/media/CompressPdf.js +45 -0
  391. package/dist/core/media/CreatePreview.browser.d.ts +5 -1
  392. package/dist/core/media/CreatePreview.browser.js +16 -0
  393. package/dist/core/media/CreatePreview.d.ts +2 -1
  394. package/dist/core/media/CreatePreview.js +2 -0
  395. package/dist/core/media/FileKinds.d.ts +10 -0
  396. package/dist/core/media/FileKinds.js +25 -0
  397. package/dist/core/media/ImageTransform.d.ts +78 -0
  398. package/dist/core/media/ImageTransform.js +108 -0
  399. package/dist/core/media/MediaAltField.d.ts +1 -0
  400. package/dist/core/media/MediaAltField.js +9 -1
  401. package/dist/core/media/MediaLocation.d.ts +11 -14
  402. package/dist/core/media/MediaLocation.js +31 -22
  403. package/dist/core/media/MediaRoot.js +2 -0
  404. package/dist/core/media/MediaTypes.d.ts +14 -10
  405. package/dist/core/media/MediaTypes.js +167 -32
  406. package/dist/core/media/Pdf.d.ts +15 -0
  407. package/dist/core/media/Pdf.js +31 -0
  408. package/dist/core/media/TransformImage.browser.d.ts +7 -0
  409. package/dist/core/media/TransformImage.browser.js +38 -0
  410. package/dist/core/media/TransformImage.d.ts +7 -0
  411. package/dist/core/media/TransformImage.js +38 -0
  412. package/dist/core/source/CombinedSource.d.ts +2 -2
  413. package/dist/core/source/CombinedSource.js +6 -3
  414. package/dist/core/source/FSSource.d.ts +18 -5
  415. package/dist/core/source/FSSource.js +114 -37
  416. package/dist/core/source/GitUtils.d.ts +4 -0
  417. package/dist/core/source/GitUtils.js +9 -10
  418. package/dist/core/source/GithubSource.d.ts +2 -2
  419. package/dist/core/source/GithubSource.js +77 -26
  420. package/dist/core/source/IndexedDBSource.d.ts +3 -2
  421. package/dist/core/source/IndexedDBSource.js +70 -54
  422. package/dist/core/source/MemorySource.d.ts +2 -2
  423. package/dist/core/source/MemorySource.js +8 -4
  424. package/dist/core/source/OverlaySource.d.ts +15 -0
  425. package/dist/core/source/OverlaySource.js +78 -0
  426. package/dist/core/source/Source.d.ts +8 -2
  427. package/dist/core/source/Source.js +18 -5
  428. package/dist/core/source/Tree.d.ts +10 -7
  429. package/dist/core/source/Tree.js +118 -70
  430. package/dist/core/source/Utils.js +6 -3
  431. package/dist/core/text/MarkdownToTextDoc.d.ts +29 -0
  432. package/dist/core/text/MarkdownToTextDoc.js +524 -0
  433. package/dist/core/text/TextDocToMarkdown.d.ts +20 -0
  434. package/dist/core/text/TextDocToMarkdown.js +316 -0
  435. package/dist/core/util/Arrays.d.ts +1 -0
  436. package/dist/core/util/Arrays.js +10 -0
  437. package/dist/core/util/Async.d.ts +15 -2
  438. package/dist/core/util/Async.js +82 -0
  439. package/dist/core/util/Checks.js +1 -1
  440. package/dist/core/util/EntryFilenames.d.ts +24 -3
  441. package/dist/core/util/EntryFilenames.js +59 -5
  442. package/dist/core/util/IndexedDB.d.ts +4 -0
  443. package/dist/core/util/IndexedDB.js +20 -0
  444. package/dist/core/util/Objects.d.ts +2 -0
  445. package/dist/core/util/Objects.js +7 -0
  446. package/dist/core/util/OrderKeys.d.ts +11 -0
  447. package/dist/core/util/OrderKeys.js +64 -0
  448. package/dist/core/util/Paths.js +5 -1
  449. package/dist/core.d.ts +3 -0
  450. package/dist/core.js +8 -1
  451. package/dist/dashboard/App.css +202 -76
  452. package/dist/dashboard/App.d.ts +3 -0
  453. package/dist/dashboard/App.js +55 -31
  454. package/dist/dashboard/StoryProvider.js +2 -2
  455. package/dist/dashboard/ViewKeys.d.ts +2 -0
  456. package/dist/dashboard/ViewKeys.js +2 -0
  457. package/dist/dashboard/app/AccessDenied.d.ts +16 -1
  458. package/dist/dashboard/app/AccessDenied.js +42 -25
  459. package/dist/dashboard/app/ActivityStatus.d.ts +5 -4
  460. package/dist/dashboard/app/ActivityStatus.js +124 -167
  461. package/dist/dashboard/app/AppearanceToggle.d.ts +1 -0
  462. package/dist/dashboard/app/AppearanceToggle.js +62 -0
  463. package/dist/dashboard/app/AuthView.d.ts +1 -1
  464. package/dist/dashboard/app/AuthView.js +78 -68
  465. package/dist/dashboard/app/CompactField.d.ts +19 -6
  466. package/dist/dashboard/app/CompactField.js +174 -48
  467. package/dist/dashboard/app/CroppedImage.d.ts +17 -0
  468. package/dist/dashboard/app/CroppedImage.js +73 -0
  469. package/dist/dashboard/app/DashboardErrorBoundary.js +43 -19
  470. package/dist/dashboard/app/DashboardLayout.d.ts +4 -2
  471. package/dist/dashboard/app/DashboardLayout.js +53 -34
  472. package/dist/dashboard/app/DashboardMeta.d.ts +2 -1
  473. package/dist/dashboard/app/DashboardMeta.js +20 -5
  474. package/dist/dashboard/app/DeleteDialog.d.ts +11 -0
  475. package/dist/dashboard/app/DeleteDialog.js +249 -0
  476. package/dist/dashboard/app/EntryFields.d.ts +12 -10
  477. package/dist/dashboard/app/EntryFields.js +13 -21
  478. package/dist/dashboard/app/EntryHeader.d.ts +2 -2
  479. package/dist/dashboard/app/EntryHeader.js +322 -217
  480. package/dist/dashboard/app/EntryHeaderActions.d.ts +24 -4
  481. package/dist/dashboard/app/EntryHeaderActions.js +46 -29
  482. package/dist/dashboard/app/EntryReferences.d.ts +13 -1
  483. package/dist/dashboard/app/EntryReferences.js +65 -63
  484. package/dist/dashboard/app/EntrySidebar.d.ts +8 -6
  485. package/dist/dashboard/app/EntrySidebar.js +111 -92
  486. package/dist/dashboard/app/EntrySidebarPreview.d.ts +5 -2
  487. package/dist/dashboard/app/EntrySidebarPreview.js +92 -129
  488. package/dist/dashboard/app/EntrySidebarPreview.story.d.ts +6 -1
  489. package/dist/dashboard/app/EntrySidebarToggle.js +5 -6
  490. package/dist/dashboard/app/EntryTranslationBanner.d.ts +3 -1
  491. package/dist/dashboard/app/EntryTranslationBanner.js +40 -45
  492. package/dist/dashboard/app/EntryValidationModal.d.ts +12 -0
  493. package/dist/dashboard/app/EntryValidationModal.js +77 -0
  494. package/dist/dashboard/app/Explorer.d.ts +15 -6
  495. package/dist/dashboard/app/Explorer.js +319 -340
  496. package/dist/dashboard/app/ExplorerBatchActions.d.ts +17 -0
  497. package/dist/dashboard/app/ExplorerBatchActions.js +158 -0
  498. package/dist/dashboard/app/ExplorerCards.d.ts +8 -3
  499. package/dist/dashboard/app/ExplorerCards.js +106 -314
  500. package/dist/dashboard/app/ExplorerControls.d.ts +20 -0
  501. package/dist/dashboard/app/ExplorerControls.js +170 -0
  502. package/dist/dashboard/app/ExplorerList.d.ts +7 -4
  503. package/dist/dashboard/app/ExplorerList.js +165 -101
  504. package/dist/dashboard/app/ExplorerModal.d.ts +2 -5
  505. package/dist/dashboard/app/ExplorerModal.js +6 -18
  506. package/dist/dashboard/app/ExplorerPickerContent.d.ts +19 -3
  507. package/dist/dashboard/app/ExplorerPickerContent.js +74 -6
  508. package/dist/dashboard/app/ExplorerTable.d.ts +8 -4
  509. package/dist/dashboard/app/ExplorerTable.js +175 -372
  510. package/dist/dashboard/app/ExternalLinkPicker.js +49 -48
  511. package/dist/dashboard/app/FileKind.d.ts +8 -0
  512. package/dist/dashboard/app/FileKind.js +40 -0
  513. package/dist/dashboard/app/ImageEditor.d.ts +13 -0
  514. package/dist/dashboard/app/ImageEditor.js +302 -0
  515. package/dist/dashboard/app/ImageEditorCrop.d.ts +19 -0
  516. package/dist/dashboard/app/ImageEditorCrop.js +90 -0
  517. package/dist/dashboard/app/ImagePicker.d.ts +1 -1
  518. package/dist/dashboard/app/ImagePicker.js +36 -86
  519. package/dist/dashboard/app/LinkPicker.d.ts +1 -1
  520. package/dist/dashboard/app/LinkPicker.js +123 -127
  521. package/dist/dashboard/app/LocaleMenu.d.ts +10 -1
  522. package/dist/dashboard/app/LocaleMenu.js +78 -53
  523. package/dist/dashboard/app/MediaPreviewCell.d.ts +8 -0
  524. package/dist/dashboard/app/MediaPreviewCell.js +50 -0
  525. package/dist/dashboard/app/MoveDialog.d.ts +10 -0
  526. package/dist/dashboard/app/MoveDialog.js +161 -0
  527. package/dist/dashboard/app/NodeEditor.d.ts +11 -0
  528. package/dist/dashboard/app/NodeEditor.js +13 -0
  529. package/dist/dashboard/app/OverviewCell.d.ts +15 -0
  530. package/dist/dashboard/app/OverviewCell.js +251 -0
  531. package/dist/dashboard/app/PendingUploadsDialog.d.ts +2 -0
  532. package/dist/dashboard/app/PendingUploadsDialog.js +49 -0
  533. package/dist/dashboard/app/PendingUploadsView.d.ts +19 -0
  534. package/dist/dashboard/app/PendingUploadsView.js +209 -0
  535. package/dist/dashboard/app/ReadOnlyBadge.d.ts +4 -0
  536. package/dist/dashboard/app/ReadOnlyBadge.js +33 -0
  537. package/dist/dashboard/app/SidebarLayout.d.ts +9 -0
  538. package/dist/dashboard/app/SidebarLayout.js +64 -0
  539. package/dist/dashboard/app/SidebarTree.d.ts +14 -11
  540. package/dist/dashboard/app/SidebarTree.js +267 -262
  541. package/dist/dashboard/app/ViewToggle.d.ts +1 -1
  542. package/dist/dashboard/app/ViewToggle.js +17 -10
  543. package/dist/dashboard/app/WorkspaceMenu.d.ts +11 -5
  544. package/dist/dashboard/app/WorkspaceMenu.js +125 -139
  545. package/dist/dashboard/app/WorkspaceRoots.d.ts +1 -1
  546. package/dist/dashboard/app/WorkspaceRoots.js +130 -187
  547. package/dist/dashboard/app/editor/FileEditor.d.ts +3 -3
  548. package/dist/dashboard/app/editor/FileEditor.js +129 -117
  549. package/dist/dashboard/app/editor/FilePreview.d.ts +5 -6
  550. package/dist/dashboard/app/editor/FilePreview.js +14 -139
  551. package/dist/dashboard/app/editor/MediaAltField.view.d.ts +1 -1
  552. package/dist/dashboard/app/editor/MediaAltField.view.js +14 -17
  553. package/dist/dashboard/app/modals/CreateEntry.js +109 -117
  554. package/dist/dashboard/app/pages/EntryPage.js +178 -91
  555. package/dist/dashboard/app/pages/RootPage.js +8 -10
  556. package/dist/dashboard/app/pages/SplashPage.d.ts +22 -0
  557. package/dist/dashboard/app/pages/SplashPage.js +414 -0
  558. package/dist/dashboard/app/pages/UsersPage.d.ts +20 -1
  559. package/dist/dashboard/app/pages/UsersPage.js +187 -260
  560. package/dist/dashboard/app/ui/DashboardModal.d.ts +18 -12
  561. package/dist/dashboard/app/ui/DashboardModal.js +56 -72
  562. package/dist/dashboard/atoms/ReactiveNode.js +59 -20
  563. package/dist/dashboard/atoms/activity.d.ts +0 -2
  564. package/dist/dashboard/atoms/activity.js +6 -13
  565. package/dist/dashboard/atoms/auth.d.ts +2 -0
  566. package/dist/dashboard/atoms/auth.js +10 -4
  567. package/dist/dashboard/atoms/config.d.ts +7 -5
  568. package/dist/dashboard/atoms/config.js +1 -1
  569. package/dist/dashboard/atoms/core.d.ts +16 -2
  570. package/dist/dashboard/atoms/core.js +20 -8
  571. package/dist/dashboard/atoms/create.js +4 -8
  572. package/dist/dashboard/atoms/dashboard.d.ts +14 -0
  573. package/dist/dashboard/atoms/dashboard.js +23 -3
  574. package/dist/dashboard/atoms/delete.d.ts +68 -0
  575. package/dist/dashboard/atoms/delete.js +143 -0
  576. package/dist/dashboard/atoms/editor.d.ts +8 -1
  577. package/dist/dashboard/atoms/editor.js +22 -35
  578. package/dist/dashboard/atoms/entry.d.ts +80 -52
  579. package/dist/dashboard/atoms/entry.js +425 -118
  580. package/dist/dashboard/atoms/entryTable.d.ts +10 -0
  581. package/dist/dashboard/atoms/entryTable.js +41 -0
  582. package/dist/dashboard/atoms/explorer.d.ts +164 -38
  583. package/dist/dashboard/atoms/explorer.js +540 -248
  584. package/dist/dashboard/atoms/graph.d.ts +1 -0
  585. package/dist/dashboard/atoms/graph.js +7 -2
  586. package/dist/dashboard/atoms/link.d.ts +1 -1
  587. package/dist/dashboard/atoms/link.js +41 -57
  588. package/dist/dashboard/atoms/move.d.ts +59 -0
  589. package/dist/dashboard/atoms/move.js +103 -0
  590. package/dist/dashboard/atoms/nav.d.ts +19 -4
  591. package/dist/dashboard/atoms/nav.js +107 -18
  592. package/dist/dashboard/atoms/overview.d.ts +203 -0
  593. package/dist/dashboard/atoms/overview.js +503 -0
  594. package/dist/dashboard/atoms/preview.d.ts +3 -0
  595. package/dist/dashboard/atoms/preview.js +19 -2
  596. package/dist/dashboard/atoms/root.d.ts +41 -22
  597. package/dist/dashboard/atoms/root.js +316 -266
  598. package/dist/dashboard/atoms/upload.d.ts +92 -3
  599. package/dist/dashboard/atoms/upload.js +245 -13
  600. package/dist/dashboard/atoms/user.d.ts +1 -1
  601. package/dist/dashboard/atoms/user.js +8 -6
  602. package/dist/dashboard/atoms/utils.d.ts +12 -4
  603. package/dist/dashboard/atoms/utils.js +36 -3
  604. package/dist/dashboard/boot/ActivityEvent.d.ts +1 -1
  605. package/dist/dashboard/boot/Boot.d.ts +2 -0
  606. package/dist/dashboard/boot/Boot.js +13 -13
  607. package/dist/dashboard/boot/BootDev.js +13 -10
  608. package/dist/dashboard/boot/BootProd.js +1 -0
  609. package/dist/dashboard/boot/DashboardWorker.d.ts +3 -3
  610. package/dist/dashboard/boot/DashboardWorker.js +115 -80
  611. package/dist/dashboard/boot/LoadWorker.js +3 -4
  612. package/dist/dashboard/boot/WorkerDB.d.ts +2 -2
  613. package/dist/dashboard/cms/EntryTable.d.ts +55 -0
  614. package/dist/dashboard/cms/EntryTable.js +265 -0
  615. package/dist/dashboard/cms/FieldChrome.d.ts +21 -0
  616. package/dist/dashboard/cms/FieldChrome.js +26 -0
  617. package/dist/dashboard/cms/ViewProps.d.ts +41 -0
  618. package/dist/dashboard/cms/ViewProps.js +0 -0
  619. package/dist/dashboard/cms/hooks.d.ts +104 -0
  620. package/dist/dashboard/cms/hooks.js +107 -0
  621. package/dist/dashboard/contexts.d.ts +58 -0
  622. package/dist/dashboard/contexts.js +42 -0
  623. package/dist/dashboard/editor/UseField.d.ts +29 -6
  624. package/dist/dashboard/editor/UseField.js +6 -6
  625. package/dist/dashboard/fixture/cms.d.ts +14 -2
  626. package/dist/dashboard/fixture/cms.js +54 -6
  627. package/dist/dashboard/hook/UseEntryEditor.d.ts +3 -0
  628. package/dist/dashboard/hook/UseGraph.d.ts +3 -1
  629. package/dist/dashboard/hook/UseGraph.js +4 -4
  630. package/dist/dashboard/hook/UseLocale.d.ts +3 -1
  631. package/dist/dashboard/hook/UseRoot.d.ts +3 -1
  632. package/dist/dashboard/hook/UseRoot.js +4 -4
  633. package/dist/dashboard/hook/UseSaveShortcut.d.ts +1 -0
  634. package/dist/dashboard/hook/UseSaveShortcut.js +24 -0
  635. package/dist/dashboard/hook/UseSearchShortcut.d.ts +11 -0
  636. package/dist/dashboard/hook/UseSearchShortcut.js +32 -0
  637. package/dist/dashboard/hook/UseWorkspace.d.ts +3 -1
  638. package/dist/dashboard/hooks.d.ts +20 -100
  639. package/dist/dashboard/hooks.js +39 -101
  640. package/dist/dashboard/icons.d.ts +12 -0
  641. package/dist/dashboard/icons.js +140 -0
  642. package/dist/dashboard/plugins/alineaFixturePlugin.js +14 -3
  643. package/dist/dashboard.d.ts +23 -1
  644. package/dist/dashboard.js +5 -2
  645. package/dist/database/BrowserEntryStore.d.ts +47 -0
  646. package/dist/database/BrowserEntryStore.js +190 -0
  647. package/dist/database/DatabaseSource.d.ts +13 -0
  648. package/dist/database/DatabaseSource.js +25 -0
  649. package/dist/database/DatabaseTables.d.ts +38 -0
  650. package/dist/database/DatabaseTables.js +53 -0
  651. package/dist/database/EntryDatabase.d.ts +97 -0
  652. package/dist/database/EntryDatabase.js +532 -0
  653. package/dist/database/EntryStore.d.ts +58 -0
  654. package/dist/database/EntryStore.js +230 -0
  655. package/dist/database/EntryTransaction.d.ts +28 -0
  656. package/dist/database/EntryTransaction.js +1041 -0
  657. package/dist/database/EntryUrlAliases.d.ts +2 -0
  658. package/dist/database/EntryUrlAliases.js +69 -0
  659. package/dist/database/LocalDB.d.ts +39 -0
  660. package/dist/database/LocalDB.js +79 -0
  661. package/dist/database/Version.d.ts +9 -0
  662. package/dist/database/Version.js +13 -0
  663. package/dist/database/driver/DatabaseHandle.d.ts +17 -0
  664. package/dist/database/driver/DatabaseHandle.js +0 -0
  665. package/dist/database/driver/OverlayExtension.browser.d.ts +2 -0
  666. package/dist/database/driver/OverlayExtension.browser.js +9 -0
  667. package/dist/database/driver/OverlayExtension.d.ts +1 -0
  668. package/dist/database/driver/OverlayExtension.js +7 -0
  669. package/dist/database/driver/RuntimeDatabase.d.ts +13 -0
  670. package/dist/database/driver/RuntimeDatabase.js +77 -0
  671. package/dist/database/driver/WasmDatabase.d.ts +29 -0
  672. package/dist/database/driver/WasmDatabase.js +48 -0
  673. package/dist/database/entry/EntryData.d.ts +13 -0
  674. package/dist/database/entry/EntryData.js +51 -0
  675. package/dist/database/entry/EntryTable.d.ts +189 -0
  676. package/dist/database/entry/EntryTable.js +193 -0
  677. package/dist/database/query/Condition.d.ts +13 -0
  678. package/dist/database/query/Condition.js +125 -0
  679. package/dist/database/query/EntryQuery.d.ts +48 -0
  680. package/dist/database/query/EntryQuery.js +446 -0
  681. package/dist/database/query/EntryReferences.d.ts +5 -0
  682. package/dist/database/query/EntryReferences.js +71 -0
  683. package/dist/database/query/Relation.d.ts +11 -0
  684. package/dist/database/query/Relation.js +123 -0
  685. package/dist/database/query/ResolveQuery.d.ts +12 -0
  686. package/dist/database/query/ResolveQuery.js +191 -0
  687. package/dist/database/query/Search.d.ts +41 -0
  688. package/dist/database/query/Search.js +177 -0
  689. package/dist/database/sync/Derive.d.ts +8 -0
  690. package/dist/database/sync/Derive.js +274 -0
  691. package/dist/database/sync/EntryParser.d.ts +8 -0
  692. package/dist/database/sync/EntryParser.js +91 -0
  693. package/dist/database/sync/EntrySyncer.d.ts +25 -0
  694. package/dist/database/sync/EntrySyncer.js +89 -0
  695. package/dist/database/sync/Ingest.d.ts +21 -0
  696. package/dist/database/sync/Ingest.js +146 -0
  697. package/dist/database/sync/SyncQueries.d.ts +161 -0
  698. package/dist/database/sync/SyncQueries.js +216 -0
  699. package/dist/field/check/CheckField.js +3 -1
  700. package/dist/field/check/CheckField.view.js +10 -9
  701. package/dist/field/code/CodeField.d.ts +9 -0
  702. package/dist/field/code/CodeField.view.d.ts +3 -1
  703. package/dist/field/code/CodeField.view.js +28 -19
  704. package/dist/field/code/SimpleCodeEditor.js +0 -18
  705. package/dist/field/date/DateField.view.js +7 -13
  706. package/dist/field/link/EntryLink.d.ts +1 -1
  707. package/dist/field/link/EntryLink.js +1 -0
  708. package/dist/field/link/FileLink.d.ts +5 -2
  709. package/dist/field/link/FileLink.js +3 -7
  710. package/dist/field/link/ImageLink.d.ts +4 -1
  711. package/dist/field/link/ImageLink.js +3 -4
  712. package/dist/field/link/Link.js +3 -2
  713. package/dist/field/link/LinkField.d.ts +10 -5
  714. package/dist/field/link/LinkField.js +25 -0
  715. package/dist/field/link/LinkField.view.js +499 -497
  716. package/dist/field/link/UrlLink.d.ts +1 -0
  717. package/dist/field/link.d.ts +1 -0
  718. package/dist/field/list/ListField.d.ts +10 -4
  719. package/dist/field/list/ListField.js +10 -5
  720. package/dist/field/list/ListField.view.js +377 -548
  721. package/dist/field/localiser/LocalisedField.view.js +19 -19
  722. package/dist/field/localiser/LocalisedFieldTab.d.ts +7 -0
  723. package/dist/field/localiser/LocalisedFieldTab.js +30 -0
  724. package/dist/field/localiser/LocalisedFieldTabs.js +5 -5
  725. package/dist/field/localiser/Localiser.js +25 -7
  726. package/dist/field/localiser/SelectLocale.d.ts +5 -0
  727. package/dist/field/localiser/SelectLocale.js +12 -0
  728. package/dist/field/metadata/MetadataAudit.d.ts +39 -0
  729. package/dist/field/metadata/MetadataAudit.js +124 -0
  730. package/dist/field/metadata/MetadataField.d.ts +30 -23
  731. package/dist/field/metadata/MetadataField.js +48 -104
  732. package/dist/field/metadata/MetadataField.view.d.ts +5 -0
  733. package/dist/field/metadata/MetadataField.view.js +51 -35
  734. package/dist/field/number/NumberField.d.ts +2 -0
  735. package/dist/field/number/NumberField.view.js +10 -9
  736. package/dist/field/object/ObjectField.view.js +15 -19
  737. package/dist/field/path/PathField.view.js +3 -3
  738. package/dist/field/path/SlugField.d.ts +1 -2
  739. package/dist/field/path/SlugField.js +5 -7
  740. package/dist/field/richtext/PickTextAnchor.js +10 -10
  741. package/dist/field/richtext/PickTextLink.d.ts +10 -1
  742. package/dist/field/richtext/PickTextLink.js +125 -22
  743. package/dist/field/richtext/ReferenceLink.d.ts +6 -1
  744. package/dist/field/richtext/ReferenceLink.js +23 -4
  745. package/dist/field/richtext/RichTextBlock.js +51 -46
  746. package/dist/field/richtext/RichTextBlocks.js +1 -1
  747. package/dist/field/richtext/RichTextDocument.d.ts +7 -2
  748. package/dist/field/richtext/RichTextDocument.js +43 -6
  749. package/dist/field/richtext/RichTextExtensions.d.ts +3 -1
  750. package/dist/field/richtext/RichTextExtensions.js +2745 -7498
  751. package/dist/field/richtext/RichTextField.d.ts +7 -0
  752. package/dist/field/richtext/RichTextField.story.d.ts +4 -0
  753. package/dist/field/richtext/RichTextField.view.js +66 -34
  754. package/dist/field/richtext/RichTextInsertMenu.js +304 -525
  755. package/dist/field/richtext/RichTextState.js +1 -1
  756. package/dist/field/richtext/RichTextToolbar.d.ts +5 -2
  757. package/dist/field/richtext/RichTextToolbar.js +95 -37
  758. package/dist/field/richtext/Toolbar.d.ts +19 -1
  759. package/dist/field/richtext/Toolbar.js +18 -13
  760. package/dist/field/richtext/extensions/Anchor.js +1 -1
  761. package/dist/field/richtext/extensions/Link.d.ts +1 -0
  762. package/dist/field/richtext/extensions/Link.js +2 -1
  763. package/dist/field/richtext/extensions/Small.js +1 -1
  764. package/dist/field/richtext.d.ts +2 -0
  765. package/dist/field/richtext.js +2 -0
  766. package/dist/field/select/SelectField.view.js +20 -83
  767. package/dist/field/tabs/Tabs.view.js +8 -8
  768. package/dist/field/text/TextField.view.js +11 -10
  769. package/dist/field/time/TimeField.d.ts +0 -2
  770. package/dist/field/time/TimeField.view.js +10 -18
  771. package/dist/field/views.js +4 -0
  772. package/dist/field.d.ts +1 -1
  773. package/dist/field.js +1 -1
  774. package/dist/index.css +5434 -4984
  775. package/dist/next.cjs +118 -46
  776. package/dist/next.d.ts +4 -2
  777. package/dist/next.edge.d.ts +3 -2
  778. package/dist/next.js +1 -2
  779. package/dist/picker/entry/EntryPicker.d.ts +7 -3
  780. package/dist/picker/entry/EntryPicker.js +18 -45
  781. package/dist/picker/entry/EntryReference.d.ts +2 -0
  782. package/dist/picker/entry/EntryReference.js +1 -0
  783. package/dist/picker/url/UrlPicker.js +1 -0
  784. package/dist/preview/PreviewMessage.d.ts +3 -0
  785. package/dist/preview/PreviewMessage.js +1 -0
  786. package/dist/preview/PreviewPayload.js +35 -250
  787. package/dist/preview/RegisterPreview.d.ts +1 -1
  788. package/dist/preview/RegisterPreview.js +28 -10
  789. package/dist/preview/react.d.ts +5 -1
  790. package/dist/preview/react.js +12 -9
  791. package/dist/preview/widget.d.ts +45 -0
  792. package/dist/preview/widget.js +100 -11
  793. package/dist/query.d.ts +16 -225
  794. package/dist/types.d.ts +6 -3
  795. package/dist/ui/RichText.d.ts +1 -0
  796. package/dist/ui/RichText.js +62 -20
  797. package/docs/ai-agents.md +316 -0
  798. package/docs/ai-setup.md +297 -0
  799. package/docs/cli.md +94 -0
  800. package/docs/components/alert.md +122 -0
  801. package/docs/components/app-shell.md +77 -0
  802. package/docs/components/badge.md +88 -0
  803. package/docs/components/blockquote.md +24 -0
  804. package/docs/components/breadcrumb.md +83 -0
  805. package/docs/components/button.md +141 -0
  806. package/docs/components/calendar.md +32 -0
  807. package/docs/components/checkbox-group.md +38 -0
  808. package/docs/components/checkbox.md +61 -0
  809. package/docs/components/code.md +37 -0
  810. package/docs/components/collapsible.md +53 -0
  811. package/docs/components/color-swatch-picker.md +47 -0
  812. package/docs/components/combo-box.md +57 -0
  813. package/docs/components/command.md +101 -0
  814. package/docs/components/content-card.md +63 -0
  815. package/docs/components/content-grid.md +71 -0
  816. package/docs/components/data-list.md +64 -0
  817. package/docs/components/date-field.md +34 -0
  818. package/docs/components/date-picker.md +35 -0
  819. package/docs/components/date-range-picker.md +34 -0
  820. package/docs/components/dialog.md +182 -0
  821. package/docs/components/drop-zone.md +45 -0
  822. package/docs/components/dropdown-menu.md +223 -0
  823. package/docs/components/empty.md +81 -0
  824. package/docs/components/field.md +66 -0
  825. package/docs/components/file-trigger.md +33 -0
  826. package/docs/components/fold-icon.md +34 -0
  827. package/docs/components/heading.md +33 -0
  828. package/docs/components/icon.md +43 -0
  829. package/docs/components/kbd.md +29 -0
  830. package/docs/components/link.md +35 -0
  831. package/docs/components/list.md +104 -0
  832. package/docs/components/media-preview.md +43 -0
  833. package/docs/components/multiple-select.md +56 -0
  834. package/docs/components/nav-rail.md +79 -0
  835. package/docs/components/number-field.md +49 -0
  836. package/docs/components/page.md +97 -0
  837. package/docs/components/popover.md +71 -0
  838. package/docs/components/preview-frame.md +63 -0
  839. package/docs/components/radio-group.md +47 -0
  840. package/docs/components/resizable-panel-group.md +63 -0
  841. package/docs/components/search-field.md +53 -0
  842. package/docs/components/select.md +138 -0
  843. package/docs/components/sidebar.md +104 -0
  844. package/docs/components/sortable-list.md +125 -0
  845. package/docs/components/spinner.md +29 -0
  846. package/docs/components/surface.md +54 -0
  847. package/docs/components/switch.md +52 -0
  848. package/docs/components/table.md +178 -0
  849. package/docs/components/tabs.md +120 -0
  850. package/docs/components/tag-group.md +56 -0
  851. package/docs/components/text-field.md +134 -0
  852. package/docs/components/text.md +44 -0
  853. package/docs/components/time-field.md +37 -0
  854. package/docs/components/timestamp.md +45 -0
  855. package/docs/components/toggle-group.md +46 -0
  856. package/docs/components/toggle.md +37 -0
  857. package/docs/components/toolbar.md +96 -0
  858. package/docs/components/tooltip.md +78 -0
  859. package/docs/components/tree.md +67 -0
  860. package/docs/components.md +131 -0
  861. package/docs/configuration.md +175 -0
  862. package/docs/content-model.md +87 -0
  863. package/docs/custom-fields.md +231 -0
  864. package/docs/dashboard-ui.md +3 -0
  865. package/docs/deploy/alinea-cloud.md +26 -0
  866. package/docs/deploy/self-host.md +193 -0
  867. package/docs/deploy.md +123 -0
  868. package/docs/editing-content.md +195 -0
  869. package/docs/fields/check.md +40 -0
  870. package/docs/fields/code.md +35 -0
  871. package/docs/fields/date.md +90 -0
  872. package/docs/fields/entry.md +179 -0
  873. package/docs/fields/file.md +60 -0
  874. package/docs/fields/image.md +139 -0
  875. package/docs/fields/link.md +121 -0
  876. package/docs/fields/list.md +126 -0
  877. package/docs/fields/number.md +58 -0
  878. package/docs/fields/object.md +91 -0
  879. package/docs/fields/path.md +105 -0
  880. package/docs/fields/rich-text.md +236 -0
  881. package/docs/fields/select.md +99 -0
  882. package/docs/fields/tabs.md +87 -0
  883. package/docs/fields/text.md +46 -0
  884. package/docs/fields/url.md +51 -0
  885. package/docs/fields.md +231 -0
  886. package/docs/get-started.md +3 -0
  887. package/docs/guides.md +3 -0
  888. package/docs/index.md +138 -0
  889. package/docs/instant-publishing.md +43 -0
  890. package/docs/internationalization.md +201 -0
  891. package/docs/introduction.md +5 -0
  892. package/docs/live-previews.md +151 -0
  893. package/docs/mcp.md +500 -0
  894. package/docs/overviews.md +456 -0
  895. package/docs/query/advanced.md +123 -0
  896. package/docs/query/examples.md +231 -0
  897. package/docs/query/filtering.md +160 -0
  898. package/docs/query/related.md +129 -0
  899. package/docs/query/structural.md +164 -0
  900. package/docs/query.md +139 -0
  901. package/docs/quickstart.md +203 -0
  902. package/docs/reference.md +3 -0
  903. package/docs/roles-permissions.md +234 -0
  904. package/docs/schema/document.md +98 -0
  905. package/docs/schema/type.md +131 -0
  906. package/docs/schema.md +66 -0
  907. package/docs/tutorial/step-1-landing-page.md +244 -0
  908. package/docs/tutorial/step-2-block-list.md +364 -0
  909. package/docs/tutorial/step-3-layout-root.md +200 -0
  910. package/docs/tutorial/step-4-blog.md +384 -0
  911. package/docs/tutorial/step-5-catch-all.md +222 -0
  912. package/docs/tutorial.md +21 -0
  913. package/docs/typescript.md +115 -0
  914. package/docs/upgrading.md +286 -0
  915. package/docs/workspaces/media.md +48 -0
  916. package/docs/workspaces/root.md +127 -0
  917. package/docs/workspaces.md +98 -0
  918. package/llms-full.txt +11973 -3202
  919. package/package.json +35 -7
  920. package/readme.md +136 -55
  921. package/dist/backend/store/GeneratedSource.d.ts +0 -2
  922. package/dist/backend/store/GeneratedSource.js +0 -21
  923. package/dist/chunks/chunk-AC4U3IMS.js +0 -205
  924. package/dist/chunks/chunk-G6E35DMJ.js +0 -1997
  925. package/dist/chunks/chunk-JFROOUG6.js +0 -6363
  926. package/dist/chunks/chunk-LUBOGJCG.js +0 -129
  927. package/dist/chunks/chunk-SJBZFMQ2.js +0 -2966
  928. package/dist/chunks/chunk-STAJCW4Z.js +0 -322
  929. package/dist/chunks/chunk-U4VOHNR2.js +0 -210
  930. package/dist/chunks/chunk-YK3OSMDM.js +0 -5473
  931. package/dist/cli/util/ExternalPlugin.d.ts +0 -2
  932. package/dist/cli/util/ExternalPlugin.js +0 -919
  933. package/dist/components/Disclosure.d.ts +0 -5
  934. package/dist/components/Disclosure.js +0 -106
  935. package/dist/components/Label.d.ts +0 -48
  936. package/dist/components/Label.js +0 -210
  937. package/dist/components/Menu.d.ts +0 -16
  938. package/dist/components/Menu.js +0 -95
  939. package/dist/components/Modal.d.ts +0 -7
  940. package/dist/components/Modal.js +0 -58
  941. package/dist/components/ProgressCircle.d.ts +0 -6
  942. package/dist/components/ProgressCircle.js +0 -96
  943. package/dist/core/db/EntryDB.d.ts +0 -19
  944. package/dist/core/db/EntryDB.js +0 -48
  945. package/dist/core/db/EntryIndex.d.ts +0 -130
  946. package/dist/core/db/EntryIndex.js +0 -2609
  947. package/dist/core/db/EntryReferenceIndex.d.ts +0 -21
  948. package/dist/core/db/EntryReferenceIndex.js +0 -131
  949. package/dist/core/db/EntryResolver.d.ts +0 -56
  950. package/dist/core/db/EntryResolver.js +0 -624
  951. package/dist/core/db/EntryTarget.d.ts +0 -5
  952. package/dist/core/db/EntryTransaction.d.ts +0 -32
  953. package/dist/core/db/EntryTransaction.js +0 -946
  954. package/dist/core/db/LocalDB.d.ts +0 -42
  955. package/dist/core/db/LocalDB.js +0 -112
  956. package/dist/core/db/TestDB.d.ts +0 -19
  957. package/dist/core/db/TestDB.js +0 -50
  958. package/dist/dashboard/app/AppShell.d.ts +0 -4
  959. package/dist/dashboard/app/AppShell.js +0 -29
  960. package/dist/dashboard/app/Badge.d.ts +0 -8
  961. package/dist/dashboard/app/Badge.js +0 -42
  962. package/dist/dashboard/app/EditorBackButton.d.ts +0 -5
  963. package/dist/dashboard/app/EditorBackButton.js +0 -33
  964. package/dist/dashboard/app/EntrySidebarPreview.spec.d.ts +0 -1
  965. package/dist/dashboard/app/ExplorerFileCard.d.ts +0 -10
  966. package/dist/dashboard/app/ExplorerFileCard.js +0 -115
  967. package/dist/dashboard/app/StatusBadge.d.ts +0 -6
  968. package/dist/dashboard/app/StatusBadge.js +0 -26
  969. package/dist/dashboard/app/WorkspaceMenu.spec.d.ts +0 -1
  970. package/dist/dashboard/app/WorkspaceMenu.stories.d.ts +0 -5
  971. package/dist/dashboard/app/ui/Rail.d.ts +0 -18
  972. package/dist/dashboard/app/ui/Rail.js +0 -41
  973. package/dist/dashboard/app/ui/Sidebar.d.ts +0 -15
  974. package/dist/dashboard/app/ui/Sidebar.js +0 -55
  975. package/dist/field/link/LinkField.spec.d.ts +0 -1
  976. package/dist/field/link/LinkField.stories.d.ts +0 -15
  977. package/dist/field/list/ListField.spec.d.ts +0 -1
  978. package/dist/field/list/ListField.stories.d.ts +0 -6
  979. package/dist/field/richtext/RichTextField.spec.d.ts +0 -1
  980. /package/dist/{core/db/EntryTarget.js → .init-pm/bun.lock} +0 -0
@@ -0,0 +1,21 @@
1
+ import type { FieldSharedProps, StyleProps } from 'alinea/components/types';
2
+ import type { Field } from 'alinea/core/Field';
3
+ import type { ReactNode } from 'react';
4
+ export interface FieldChromeProps extends FieldSharedProps, StyleProps {
5
+ /** The field whose label, help text, validation error and state to show */
6
+ field: Field;
7
+ /** Id of the control the label describes */
8
+ htmlFor?: string;
9
+ children?: ReactNode;
10
+ }
11
+ /**
12
+ * Renders the label, help text, shared badge and validation error of a field
13
+ * around a custom control, like the built-in fields. The values come from the
14
+ * field's options and validation state; pass a prop to override one.
15
+ *
16
+ * @example
17
+ * <FieldChrome field={field} htmlFor={id}>
18
+ * <input id={id} type="range" />
19
+ * </FieldChrome>
20
+ */
21
+ export declare function FieldChrome({ field, children, ...props }: FieldChromeProps): import("react").JSX.Element;
@@ -0,0 +1,26 @@
1
+ import "../../chunks/chunk-CQ52GEHY.js";
2
+
3
+ // src/dashboard/cms/FieldChrome.tsx
4
+ import { Field as FieldFrame } from "alinea/components/Field";
5
+ import { useFieldError, useFieldOptions } from "../hooks.js";
6
+ import { jsx } from "react/jsx-runtime";
7
+ function FieldChrome({ field, children, ...props }) {
8
+ const options = useFieldOptions(field);
9
+ const error = useFieldError(field);
10
+ return /* @__PURE__ */ jsx(
11
+ FieldFrame,
12
+ {
13
+ label: options.label,
14
+ description: options.help,
15
+ error,
16
+ required: options.required,
17
+ readOnly: options.readOnly,
18
+ shared: options.shared,
19
+ ...props,
20
+ children
21
+ }
22
+ );
23
+ }
24
+ export {
25
+ FieldChrome
26
+ };
@@ -0,0 +1,41 @@
1
+ import type { Field } from 'alinea/core/Field';
2
+ import type { RootData } from 'alinea/core/Root';
3
+ import type { Section } from 'alinea/core/Section';
4
+ import type { Type } from 'alinea/core/Type';
5
+ /**
6
+ * Props of the component a field points to with `view`, for example in
7
+ * `Field.create({label, options, view: '@/fields/Range.view'})`.
8
+ *
9
+ * @example
10
+ * export default function RangeView({field}: FieldViewProps<RangeField>) {
11
+ * const [value, setValue] = useField(field)
12
+ * }
13
+ */
14
+ export interface FieldViewProps<F extends Field = Field> {
15
+ /** The field being rendered, pass it to the field hooks */
16
+ field: F;
17
+ }
18
+ /**
19
+ * Props of the component passed to `Field.view(...)`, rendered between the
20
+ * fields of a type.
21
+ */
22
+ export interface SectionViewProps {
23
+ /** The section that holds the view */
24
+ section: Section;
25
+ }
26
+ /**
27
+ * Props of the component a type points to with `view`. It replaces the
28
+ * default entry editor for entries of that type.
29
+ */
30
+ export interface TypeViewProps {
31
+ /** The type of the entry being shown */
32
+ type: Type;
33
+ }
34
+ /**
35
+ * Props of the component a root points to with `view`. It replaces the
36
+ * default root overview.
37
+ */
38
+ export interface RootViewProps {
39
+ /** The configuration of the root, including its `label` */
40
+ root: RootData;
41
+ }
File without changes
@@ -0,0 +1,104 @@
1
+ /**
2
+ * The hooks of custom field and dashboard views, exported from `alinea/cms`.
3
+ * Their types do not expose the internal state of the dashboard.
4
+ */
5
+ import type { WriteableGraph } from 'alinea/core/db/WriteableGraph';
6
+ import type { Entry as EntryRecord } from 'alinea/core/Entry';
7
+ import type { Field } from 'alinea/core/Field';
8
+ import type { PreviewMetadata } from 'alinea/core/Preview';
9
+ import type { Policy } from 'alinea/core/Role';
10
+ import type { User } from 'alinea/core/User';
11
+ import { type Dispatch, type SetStateAction } from 'react';
12
+ /**
13
+ * Returns the permissions of the signed-in user. Check access with
14
+ * `policy.get({workspace, root, id, ...})`, which returns flags such as
15
+ * `read`, `update` and `publish`.
16
+ */
17
+ export declare function usePolicy(): Policy;
18
+ /**
19
+ * Returns the authenticated dashboard user, or null when no user is active.
20
+ */
21
+ export declare function useUser(): User | null;
22
+ /**
23
+ * Returns the dashboard's content graph. Query it with the same API as the
24
+ * `cms` instance, for example `graph.find({type: Article})`. Changes made
25
+ * through it are committed with the permissions of the signed-in user.
26
+ */
27
+ export declare function useGraph(): WriteableGraph;
28
+ /**
29
+ * Returns metadata reported by the active browser preview, when available.
30
+ */
31
+ export declare function usePreviewMetadata(): PreviewMetadata | undefined;
32
+ /**
33
+ * Returns the stored value of a field in the entry, list row or object being
34
+ * edited. Use it in a view that only reads the value.
35
+ */
36
+ export declare function useFieldValue<StoredValue, QueryValue, Mutator, Options>(field: Field<StoredValue, QueryValue, Mutator, Options>): StoredValue;
37
+ /**
38
+ * Returns the stored value of a field and a setter, like `useState`. The
39
+ * setter also accepts an updater function that receives the current value.
40
+ *
41
+ * @example
42
+ * const [value, setValue] = useField(field)
43
+ */
44
+ export declare function useField<StoredValue, QueryValue, Mutator, Options>(field: Field<StoredValue, QueryValue, Mutator, Options>): [StoredValue, Dispatch<SetStateAction<StoredValue>>];
45
+ /**
46
+ * Returns only the setter of a field's stored value, so the component does
47
+ * not re-render when the value changes.
48
+ */
49
+ export declare function useFieldSetter<StoredValue, QueryValue, Mutator, Options>(field: Field<StoredValue, QueryValue, Mutator, Options>): Dispatch<SetStateAction<StoredValue>>;
50
+ /**
51
+ * Returns the key a field is stored under in the entry, list row or object
52
+ * being edited, for example `'title'`.
53
+ */
54
+ export declare function useFieldKey<StoredValue, QueryValue, Mutator, Options>(field: Field<StoredValue, QueryValue, Mutator, Options>): string;
55
+ /**
56
+ * Returns the options of a field with the dashboard state applied: `readOnly`
57
+ * is also `true` when the user may not edit the field or the entry, and
58
+ * `hidden` reflects the user's permissions. Includes the field's `label`.
59
+ */
60
+ export declare function useFieldOptions<StoredValue, QueryValue, Mutator, Options>(field: Field<StoredValue, QueryValue, Mutator, Options>): Options;
61
+ /**
62
+ * Returns the validation message of a field (from `required` or `validate`),
63
+ * or `undefined` while the value is valid.
64
+ */
65
+ export declare function useFieldError<StoredValue, QueryValue, Mutator, Options>(field: Field<StoredValue, QueryValue, Mutator, Options>): string | undefined;
66
+ /**
67
+ * Returns the stored value of another field in the same entry, list row or
68
+ * object, by its key.
69
+ */
70
+ export declare function useSiblingFieldValue(key: string): unknown;
71
+ /**
72
+ * Returns the selected entry version as a plain Entry object.
73
+ *
74
+ * Returns null outside an entry scope, or when the current entry cannot be
75
+ * resolved. The returned value follows locale/status selection and does not
76
+ * expose internal atoms.
77
+ */
78
+ export declare function useEntry(): EntryRecord<Record<string, unknown>> | null;
79
+ /**
80
+ * Returns the current locale of the dashboard: the locale of the entry being
81
+ * edited, or the selected locale of the current root. `null` for content
82
+ * without translations or outside the dashboard layout.
83
+ */
84
+ export declare function useLocale(): string | null;
85
+ /** A place in the dashboard to navigate to */
86
+ export interface DashboardLocation {
87
+ /** Name of the workspace */
88
+ workspace: string;
89
+ /** Name of the root */
90
+ root: string;
91
+ /** Id of the entry to open, leave out to open the root */
92
+ entryId?: string;
93
+ /** Locale to open, for roots with translations */
94
+ locale?: string | null;
95
+ }
96
+ /**
97
+ * Returns a function that navigates the dashboard to an entry or root. The
98
+ * user is asked to confirm first when the current entry has unsaved changes.
99
+ *
100
+ * @example
101
+ * const navigate = useNavigate()
102
+ * navigate({workspace: entry.workspace, root: entry.root, entryId: entry.id})
103
+ */
104
+ export declare function useNavigate(): (location: DashboardLocation) => void;
@@ -0,0 +1,107 @@
1
+ import {
2
+ useAtomValueRaw,
3
+ useSetAtom
4
+ } from "../../chunks/chunk-D6UJHBJJ.js";
5
+ import "../../chunks/chunk-CFNRVI3Y.js";
6
+ import "../../chunks/chunk-CQ52GEHY.js";
7
+
8
+ // src/dashboard/cms/hooks.ts
9
+ import { assert } from "alinea/core/util/Assert";
10
+ import {
11
+ useCallback,
12
+ useContext
13
+ } from "react";
14
+ import { graphAtom } from "../atoms/core.js";
15
+ import { routeAtom } from "../atoms/nav.js";
16
+ import { previewMetadataAtom } from "../atoms/preview.js";
17
+ import { policyAtom, userAtom } from "../atoms/user.js";
18
+ import {
19
+ dashboardContext,
20
+ entryContext,
21
+ useEditor,
22
+ useFieldInfo,
23
+ useFieldNode
24
+ } from "../contexts.js";
25
+ function usePolicy() {
26
+ return useAtomValueRaw(policyAtom);
27
+ }
28
+ function useUser() {
29
+ return useAtomValueRaw(userAtom);
30
+ }
31
+ function useGraph() {
32
+ return useAtomValueRaw(graphAtom);
33
+ }
34
+ function usePreviewMetadata() {
35
+ return useAtomValueRaw(previewMetadataAtom);
36
+ }
37
+ function useFieldValue(field) {
38
+ const node = useFieldNode(field);
39
+ return useAtomValueRaw(node.value);
40
+ }
41
+ function useField(field) {
42
+ const info = useFieldInfo(field);
43
+ const value = useAtomValueRaw(info.value);
44
+ const setValue = useSetAtom(info.value);
45
+ return [value, setValue];
46
+ }
47
+ function useFieldSetter(field) {
48
+ const info = useFieldInfo(field);
49
+ return useSetAtom(info.value);
50
+ }
51
+ function useFieldKey(field) {
52
+ const info = useFieldInfo(field);
53
+ return info.key;
54
+ }
55
+ function useFieldOptions(field) {
56
+ const info = useFieldInfo(field);
57
+ return useAtomValueRaw(info.options);
58
+ }
59
+ function useFieldError(field) {
60
+ const info = useFieldInfo(field);
61
+ return useAtomValueRaw(info.error);
62
+ }
63
+ function useSiblingFieldValue(key) {
64
+ const editor = useEditor();
65
+ const info = editor.field(key);
66
+ assert(info, `Field not found: ${key}`);
67
+ return useAtomValueRaw(info.value);
68
+ }
69
+ function useEntry() {
70
+ const scope = useContext(entryContext);
71
+ return scope?.selectedEntry ?? null;
72
+ }
73
+ function useLocale() {
74
+ const entry = useContext(entryContext);
75
+ const dashboard = useContext(dashboardContext);
76
+ if (entry) return entry.localeData.requestedLocale;
77
+ return dashboard?.page.locale ?? null;
78
+ }
79
+ function useNavigate() {
80
+ const setRoute = useSetAtom(routeAtom);
81
+ return useCallback(
82
+ (location) => setRoute({
83
+ page: "entry",
84
+ workspace: location.workspace,
85
+ root: location.root,
86
+ entry: location.entryId,
87
+ locale: location.locale ?? void 0
88
+ }),
89
+ [setRoute]
90
+ );
91
+ }
92
+ export {
93
+ useEntry,
94
+ useField,
95
+ useFieldError,
96
+ useFieldKey,
97
+ useFieldOptions,
98
+ useFieldSetter,
99
+ useFieldValue,
100
+ useGraph,
101
+ useLocale,
102
+ useNavigate,
103
+ usePolicy,
104
+ usePreviewMetadata,
105
+ useSiblingFieldValue,
106
+ useUser
107
+ };
@@ -0,0 +1,58 @@
1
+ /**
2
+ * The contexts the dashboard hooks read, see `hooks.tsx`
3
+ *
4
+ * @internal
5
+ */
6
+ import type { Config } from 'alinea/core/Config';
7
+ import type { LocalConnection } from 'alinea/core/Connection';
8
+ import type { WriteableGraph } from 'alinea/core/db/WriteableGraph';
9
+ import type { Entry as EntryRecord } from 'alinea/core/Entry';
10
+ import type { Field } from 'alinea/core/Field';
11
+ import type { WorkspaceInternal } from 'alinea/core/Workspace';
12
+ import { type ComponentType } from 'react';
13
+ import type { EditorModel, ResolvedEditorImage } from './atoms/editor.js';
14
+ import type { EntryAtoms, EntryLocaleAtoms } from './atoms/entry.js';
15
+ import type { Page } from './atoms/nav.js';
16
+ import type { ReactiveNode } from './atoms/ReactiveNode.js';
17
+ import type { RootAtoms } from './atoms/root.js';
18
+ export interface EntryContextValue {
19
+ entry: EntryAtoms;
20
+ localeData: EntryLocaleAtoms;
21
+ richTextImages: ReadonlyMap<string, ResolvedEditorImage>;
22
+ selectedEntry: EntryRecord<Record<string, unknown>>;
23
+ }
24
+ export interface DashboardOptions {
25
+ alineaDev?: boolean;
26
+ local?: boolean;
27
+ }
28
+ export interface Dashboard {
29
+ graph: WriteableGraph;
30
+ config: Config;
31
+ events: EventTarget;
32
+ client: LocalConnection;
33
+ views?: Record<string, ComponentType>;
34
+ options?: DashboardOptions;
35
+ }
36
+ export interface DashboardContextValue {
37
+ page: Page;
38
+ workspace: WorkspaceInternal & {
39
+ name: string;
40
+ };
41
+ root: RootAtoms;
42
+ }
43
+ export declare const entryContext: import("react").Context<EntryContextValue | null>;
44
+ export declare const dashboardContext: import("react").Context<DashboardContextValue | null>;
45
+ export declare const dashboardModelContext: import("react").Context<Dashboard | null>;
46
+ export declare const editorContext: import("react").Context<EditorModel | null>;
47
+ /**
48
+ * Returns the active dashboard editor from the nearest editor scope.
49
+ */
50
+ export declare function useEditor(): EditorModel;
51
+ /**
52
+ * Returns the editor metadata for a field in the active editor scope.
53
+ */
54
+ export declare function useFieldInfo(field: Field): import("./atoms/editor.js").EditorField;
55
+ /**
56
+ * Returns the reactive node backing a field in the active editor.
57
+ */
58
+ export declare function useFieldNode<Value>(field: Field): ReactiveNode<Value>;
@@ -0,0 +1,42 @@
1
+ import {
2
+ useAtomValueRaw
3
+ } from "../chunks/chunk-D6UJHBJJ.js";
4
+ import "../chunks/chunk-CFNRVI3Y.js";
5
+ import "../chunks/chunk-CQ52GEHY.js";
6
+
7
+ // src/dashboard/contexts.ts
8
+ import { assert } from "alinea/core/util/Assert";
9
+ import { createContext, useContext } from "react";
10
+ var entryContext = createContext(null);
11
+ var dashboardContext = createContext(
12
+ null
13
+ );
14
+ var dashboardModelContext = createContext(null);
15
+ var editorContext = createContext(null);
16
+ function useEditor() {
17
+ const editor = useContext(editorContext);
18
+ assert(editor, "EntryEditor not found in context");
19
+ return editor;
20
+ }
21
+ function useFieldInfo(field) {
22
+ const editor = useEditor();
23
+ const info = editor.get(field);
24
+ assert(info, "Field info not found in editor");
25
+ return info;
26
+ }
27
+ function useFieldNode(field) {
28
+ const { key } = useFieldInfo(field);
29
+ const editor = useEditor();
30
+ const nodes = useAtomValueRaw(editor.node.nodes);
31
+ assert(nodes[key], `Node not found for field key: ${key}`);
32
+ return nodes[key];
33
+ }
34
+ export {
35
+ dashboardContext,
36
+ dashboardModelContext,
37
+ editorContext,
38
+ entryContext,
39
+ useEditor,
40
+ useFieldInfo,
41
+ useFieldNode
42
+ };
@@ -1,4 +1,9 @@
1
1
  import { Field, type FieldOptions } from 'alinea/core/Field';
2
+ /**
3
+ * The result of the deprecated object-returning `useField`.
4
+ *
5
+ * @deprecated Use the tuple `useField` from 'alinea/cms'.
6
+ */
2
7
  export interface UseFieldResult<StoredValue, Mutator, Options> {
3
8
  fieldKey: string;
4
9
  label: string;
@@ -8,26 +13,44 @@ export interface UseFieldResult<StoredValue, Mutator, Options> {
8
13
  error: string | undefined;
9
14
  }
10
15
  /**
11
- * @deprecated Compatibility hook for legacy dashboard extensions.
16
+ * Compatibility hook for dashboard extensions written for Alinea 1.x.
17
+ * Also accepts the field's key instead of the field.
18
+ *
19
+ * @deprecated Use the tuple `useField` from 'alinea/cms' (`const [value, setValue] = useField(field)`) with `useFieldOptions` and `useFieldError`.
12
20
  */
13
21
  export declare function useField<StoredValue, QueryValue, Mutator, Options>(field: Field<StoredValue, QueryValue, Mutator, Options> | string): UseFieldResult<StoredValue, Mutator, Options>;
14
22
  /**
15
- * @deprecated Compatibility hook for legacy dashboard extensions.
23
+ * Compatibility hook for dashboard extensions written for Alinea 1.x.
24
+ * Also accepts the field's key instead of the field.
25
+ *
26
+ * @deprecated Use `useFieldKey` from 'alinea/cms'.
16
27
  */
17
28
  export declare function useFieldKey<StoredValue, QueryValue, Mutator, Options>(field: Field<StoredValue, QueryValue, Mutator, Options> | string): string;
18
29
  /**
19
- * @deprecated Compatibility hook for legacy dashboard extensions.
30
+ * Compatibility hook for dashboard extensions written for Alinea 1.x.
31
+ * Also accepts the field's key instead of the field.
32
+ *
33
+ * @deprecated Use `useFieldOptions` from 'alinea/cms'.
20
34
  */
21
35
  export declare function useFieldOptions<StoredValue, QueryValue, Mutator, Options>(field: Field<StoredValue, QueryValue, Mutator, Options> | string): Options & FieldOptions<StoredValue>;
22
36
  /**
23
- * @deprecated Compatibility hook for legacy dashboard extensions.
37
+ * Compatibility hook for dashboard extensions written for Alinea 1.x.
38
+ * Also accepts the field's key instead of the field.
39
+ *
40
+ * @deprecated Use `useFieldError` from 'alinea/cms'.
24
41
  */
25
42
  export declare function useFieldError<StoredValue, QueryValue, Mutator, Options>(field: Field<StoredValue, QueryValue, Mutator, Options> | string): string | undefined;
26
43
  /**
27
- * @deprecated Compatibility hook for legacy dashboard extensions.
44
+ * Compatibility hook for dashboard extensions written for Alinea 1.x.
45
+ * Also accepts the field's key instead of the field.
46
+ *
47
+ * @deprecated Use `useFieldValue` from 'alinea/cms'.
28
48
  */
29
49
  export declare function useFieldValue<StoredValue, QueryValue, Mutator, Options>(field: Field<StoredValue, QueryValue, Mutator, Options> | string): StoredValue;
30
50
  /**
31
- * @deprecated Compatibility hook for legacy dashboard extensions.
51
+ * Compatibility hook for dashboard extensions written for Alinea 1.x.
52
+ * Also accepts the field's key instead of the field.
53
+ *
54
+ * @deprecated Use `useFieldSetter` from 'alinea/cms'.
32
55
  */
33
56
  export declare function useFieldMutator<StoredValue, QueryValue, Mutator, Options>(field: Field<StoredValue, QueryValue, Mutator, Options> | string): Mutator;
@@ -1,8 +1,8 @@
1
1
  import {
2
- useAtomValue,
2
+ useAtomValueRaw,
3
3
  useSetAtom
4
- } from "../../chunks/chunk-U4VOHNR2.js";
5
- import "../../chunks/chunk-Y7XOMJOC.js";
4
+ } from "../../chunks/chunk-D6UJHBJJ.js";
5
+ import "../../chunks/chunk-CFNRVI3Y.js";
6
6
  import "../../chunks/chunk-CQ52GEHY.js";
7
7
 
8
8
  // src/dashboard/editor/UseField.ts
@@ -36,15 +36,15 @@ function useFieldKey(field) {
36
36
  }
37
37
  function useFieldOptions(field) {
38
38
  const info = useFieldInfo(field);
39
- return useAtomValue(info.options);
39
+ return useAtomValueRaw(info.options);
40
40
  }
41
41
  function useFieldError(field) {
42
42
  const info = useFieldInfo(field);
43
- return useAtomValue(info.error);
43
+ return useAtomValueRaw(info.error);
44
44
  }
45
45
  function useFieldValue(field) {
46
46
  const info = useFieldInfo(field);
47
- return useAtomValue(info.value);
47
+ return useAtomValueRaw(info.value);
48
48
  }
49
49
  function useFieldMutator(field) {
50
50
  const info = useFieldInfo(field);
@@ -73,12 +73,12 @@ export declare const cms: import("../../adapter/core/cms.js").CoreCMS<{
73
73
  heading: string;
74
74
  text: string;
75
75
  snippet: string;
76
- } & import("../../core/ListRow.js").ListRow, {
76
+ } & import("alinea").ListRow, {
77
77
  _type: "callout";
78
78
  heading: string;
79
79
  text: string;
80
80
  snippet: string;
81
- } & import("../../core/ListRow.js").ListRow, import("../../field/list.js").ListOptions<{
81
+ } & import("alinea").ListRow, import("../../field/list.js").ListOptions<{
82
82
  callout: import("alinea").Type<{
83
83
  heading: import("../../field/text.js").TextField;
84
84
  text: import("../../field/text.js").TextField;
@@ -112,5 +112,17 @@ export declare const cms: import("../../adapter/core/cms.js").CoreCMS<{
112
112
  pages: import("alinea").Root<import("../../core/Root.js").ChildrenDefinition>;
113
113
  media: import("../../core/media/MediaRoot.js").MediaRoot<import("../../core/Root.js").ChildrenDefinition>;
114
114
  }>;
115
+ manyRoots: import("alinea").Workspace<{
116
+ pages: import("alinea").Root<import("../../core/Root.js").ChildrenDefinition>;
117
+ articles: import("alinea").Root<import("../../core/Root.js").ChildrenDefinition>;
118
+ documentation: import("alinea").Root<import("../../core/Root.js").ChildrenDefinition>;
119
+ campaigns: import("alinea").Root<import("../../core/Root.js").ChildrenDefinition>;
120
+ translations: import("alinea").Root<import("../../core/Root.js").ChildrenDefinition>;
121
+ archive: import("alinea").Root<import("../../core/Root.js").ChildrenDefinition>;
122
+ settings: import("alinea").Root<import("../../core/Root.js").ChildrenDefinition>;
123
+ brandAssets: import("alinea").Root<import("../../core/Root.js").ChildrenDefinition>;
124
+ nestedContent: import("alinea").Root<import("../../core/Root.js").ChildrenDefinition>;
125
+ media: import("../../core/media/MediaRoot.js").MediaRoot<import("../../core/Root.js").ChildrenDefinition>;
126
+ }>;
115
127
  };
116
128
  }>;
@@ -4,10 +4,17 @@ import "../../chunks/chunk-CQ52GEHY.js";
4
4
  import { createCMS } from "alinea/core";
5
5
  import { Config, Field } from "alinea/index";
6
6
  import {
7
+ IcOutlineFolder,
7
8
  IcOutlineGridView,
9
+ IcOutlineSettings,
10
+ IcRoundDescription,
8
11
  IcRoundHistory,
12
+ IcRoundImage,
13
+ IcRoundLanguage,
14
+ IcRoundPublic,
9
15
  IcRoundTranslate,
10
- MiLayers
16
+ MiLayers,
17
+ LucideFolder
11
18
  } from "../icons.js";
12
19
  var Page = Config.document("Page", {
13
20
  contains: ["Page", "Folder"],
@@ -116,10 +123,7 @@ var Page = Config.document("Page", {
116
123
  publishDate: Field.date("Publish date", {
117
124
  width: 1 / 3
118
125
  }),
119
- publishTime: Field.time("Publish time", {
120
- width: 1 / 3,
121
- step: 900
122
- }),
126
+ publishTime: Field.time("Publish time", { width: 1 / 3 }),
123
127
  relatedLink: Field.link("Related link"),
124
128
  resources: Field.link.multiple("Resources"),
125
129
  inner: Field.object("Testje", {
@@ -214,6 +218,49 @@ var statuses = Config.workspace("Statuses", {
214
218
  media: Config.media()
215
219
  }
216
220
  });
221
+ var manyRoots = Config.workspace("Many roots", {
222
+ source: "content/manyRoots",
223
+ icon: LucideFolder,
224
+ roots: {
225
+ pages: Config.root("Pages", {
226
+ contains: ["Page", "Folder"],
227
+ openByDefault: true
228
+ }),
229
+ articles: Config.root("Articles", {
230
+ contains: ["Page", "Folder"],
231
+ icon: IcRoundDescription
232
+ }),
233
+ documentation: Config.root("Documentation", {
234
+ contains: ["Page", "Folder"],
235
+ icon: IcOutlineFolder
236
+ }),
237
+ campaigns: Config.root("Campaigns", {
238
+ contains: ["Page", "Folder"],
239
+ icon: IcRoundPublic
240
+ }),
241
+ translations: Config.root("Translations", {
242
+ contains: ["Page", "Folder"],
243
+ icon: IcRoundLanguage
244
+ }),
245
+ archive: Config.root("Archive", {
246
+ contains: ["Page", "Folder"],
247
+ icon: IcRoundHistory
248
+ }),
249
+ settings: Config.root("Settings", {
250
+ contains: ["Page", "Folder"],
251
+ icon: IcOutlineSettings
252
+ }),
253
+ brandAssets: Config.root("Brand assets", {
254
+ contains: ["Page", "Folder"],
255
+ icon: IcRoundImage
256
+ }),
257
+ nestedContent: Config.root("Nested content", {
258
+ contains: ["Page", "Folder"],
259
+ icon: MiLayers
260
+ }),
261
+ media: Config.media()
262
+ }
263
+ });
217
264
  var cms = createCMS({
218
265
  enableDrafts: true,
219
266
  schema: { Page, Folder },
@@ -222,7 +269,8 @@ var cms = createCMS({
222
269
  nested,
223
270
  many,
224
271
  i18n,
225
- statuses
272
+ statuses,
273
+ manyRoots
226
274
  }
227
275
  });
228
276
  export {
@@ -22,5 +22,8 @@ export interface EntryEditor {
22
22
  /**
23
23
  * Returns the consumer-facing entry editor shape. Only the fields declared by
24
24
  * EntryEditor are supported; dashboard atoms remain an internal detail.
25
+ *
26
+ * @deprecated Use `useEntry` from 'alinea/cms': it returns the entry being
27
+ * edited with its `id`, `locale`, `path`, `title`, `type` and `status`.
25
28
  */
26
29
  export declare function useEntryEditor(): EntryEditor | undefined;
@@ -1,5 +1,7 @@
1
1
  import type { Graph } from 'alinea/core/Graph';
2
2
  /**
3
- * @deprecated Compatibility hook for legacy dashboard extensions.
3
+ * Compatibility hook for dashboard extensions written for Alinea 1.x.
4
+ *
5
+ * @deprecated Use `useGraph` from 'alinea/cms'.
4
6
  */
5
7
  export declare function useGraph(): Graph;
@@ -1,13 +1,13 @@
1
1
  import {
2
- useAtomValue
3
- } from "../../chunks/chunk-U4VOHNR2.js";
4
- import "../../chunks/chunk-Y7XOMJOC.js";
2
+ useAtomValueRaw
3
+ } from "../../chunks/chunk-D6UJHBJJ.js";
4
+ import "../../chunks/chunk-CFNRVI3Y.js";
5
5
  import "../../chunks/chunk-CQ52GEHY.js";
6
6
 
7
7
  // src/dashboard/hook/UseGraph.ts
8
8
  import { graphAtom } from "../atoms/core.js";
9
9
  function useGraph() {
10
- return useAtomValue(graphAtom);
10
+ return useAtomValueRaw(graphAtom);
11
11
  }
12
12
  export {
13
13
  useGraph
@@ -1,4 +1,6 @@
1
1
  /**
2
- * @deprecated Compatibility hook for legacy dashboard extensions.
2
+ * Compatibility hook for dashboard extensions written for Alinea 1.x.
3
+ *
4
+ * @deprecated Use `useLocale` from 'alinea/cms'.
3
5
  */
4
6
  export declare function useLocale(): string | null;