alinea 2.0.0-preview.1 → 2.0.0-preview.11

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 (971) 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 +2276 -250
  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 +121 -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 +18 -14
  35. package/dist/backend/Handler.js +176 -35
  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 +28 -30
  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.js +2 -0
  51. package/dist/backend/store/GeneratedDatabase.d.ts +8 -0
  52. package/dist/backend/store/GeneratedDatabase.js +33 -0
  53. package/dist/backend/store/GeneratedDatabaseNode.d.ts +8 -0
  54. package/dist/backend/store/GeneratedDatabaseNode.js +25 -0
  55. package/dist/backend/store/GeneratedRelease.d.ts +1 -1
  56. package/dist/backend/store/GeneratedRelease.js +3 -4
  57. package/dist/backend/util/JWKS.d.ts +4 -0
  58. package/dist/backend/util/JWKS.js +40 -0
  59. package/dist/backend/util/ORM.js +4 -2
  60. package/dist/backend/util/Syncable.js +1 -1
  61. package/dist/bundled.d.ts +11657 -6061
  62. package/dist/chunks/bun-sqlite-5SHXN3AT.js +18 -0
  63. package/dist/chunks/ccitt-Y7TDCCPM.js +90 -0
  64. package/dist/chunks/chunk-2BJ2IFQM.js +1085 -0
  65. package/dist/chunks/chunk-2PIFHEYR.js +364 -0
  66. package/dist/chunks/chunk-66YZ47TY.js +94 -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-I7X64JTZ.js → chunk-JOF663EG.js} +6479 -3715
  78. package/dist/chunks/chunk-K62JP6HR.js +22 -0
  79. package/dist/chunks/chunk-MOWR65LM.js +610 -0
  80. package/dist/chunks/chunk-N47Y62CI.js +396 -0
  81. package/dist/chunks/{chunk-7ORQ7BYK.js → chunk-NP4M2257.js} +203 -269
  82. package/dist/chunks/{chunk-53DZYORR.js → chunk-PAYSVIYI.js} +76 -176
  83. package/dist/chunks/{chunk-IYAQC63Y.js → chunk-PSSMQKAH.js} +1607 -744
  84. package/dist/chunks/chunk-QBPYWU6C.js +24 -0
  85. package/dist/chunks/{chunk-X47OVDF3.js → chunk-QJGGYF6E.js} +356 -1000
  86. package/dist/chunks/chunk-QSN6RH6X.js +94 -0
  87. package/dist/chunks/{chunk-IWN3T3FL.js → chunk-RE523BQ7.js} +21443 -16177
  88. package/dist/chunks/chunk-RE6CDK2M.js +254 -0
  89. package/dist/chunks/chunk-TIJTT5ZI.js +228 -0
  90. package/dist/chunks/{chunk-I4GC3E65.js → chunk-UPY2RUZF.js} +0 -1
  91. package/dist/chunks/chunk-W5AXN7GH.js +219 -0
  92. package/dist/chunks/chunk-XCZXR3C2.js +112 -0
  93. package/dist/chunks/chunk-XTWYBWP2.js +81 -0
  94. package/dist/chunks/{chunk-FRYHNUEK.js → chunk-YCQR5GRT.js} +35 -7
  95. package/dist/chunks/dist-OU2RRDGP.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 +1 -1
  106. package/dist/cli/Serve.js +19 -6
  107. package/dist/cli/bin.js +45 -14
  108. package/dist/cli/generate/CopyStaticFiles.d.ts +1 -1
  109. package/dist/cli/generate/CopyStaticFiles.js +39 -24
  110. package/dist/cli/generate/DevDB.d.ts +21 -4
  111. package/dist/cli/generate/DevDB.js +139 -27
  112. package/dist/cli/generate/FillCache.d.ts +1 -1
  113. package/dist/cli/generate/FillCache.js +20 -9
  114. package/dist/cli/generate/GenerateContext.d.ts +3 -0
  115. package/dist/cli/generate/GenerateDashboard.d.ts +1 -1
  116. package/dist/cli/generate/GenerateDashboard.js +3 -1
  117. package/dist/cli/generate/GeneratedPaths.d.ts +21 -0
  118. package/dist/cli/generate/GeneratedPaths.js +33 -0
  119. package/dist/cli/generate/LinkMediaFiles.d.ts +7 -0
  120. package/dist/cli/generate/LinkMediaFiles.js +52 -0
  121. package/dist/cli/serve/CreateLocalServer.d.ts +3 -2
  122. package/dist/cli/serve/CreateLocalServer.js +106 -50
  123. package/dist/cli/serve/DevLock.d.ts +11 -0
  124. package/dist/cli/serve/DevLock.js +42 -0
  125. package/dist/cli/serve/DevServer.d.ts +8 -4
  126. package/dist/cli/serve/DevServer.js +85 -10
  127. package/dist/cli/serve/LiveReload.d.ts +2 -2
  128. package/dist/cli/serve/LiveReload.js +6 -2
  129. package/dist/cli/serve/LocalAuth.js +1 -1
  130. package/dist/cli/serve/ServeContext.d.ts +1 -1
  131. package/dist/cli/serve/StartServer.d.ts +3 -1
  132. package/dist/cli/serve/StartServer.js +10 -3
  133. package/dist/cli/serve/mcp/DevMcp.d.ts +16 -0
  134. package/dist/cli/serve/mcp/DevMcp.js +50 -0
  135. package/dist/cli/serve/mcp/McpGraph.d.ts +35 -0
  136. package/dist/cli/serve/mcp/McpGraph.js +64 -0
  137. package/dist/cli/serve/mcp/McpInput.d.ts +11 -0
  138. package/dist/cli/serve/mcp/McpInput.js +254 -0
  139. package/dist/cli/serve/mcp/McpInstructions.d.ts +1 -0
  140. package/dist/cli/serve/mcp/McpInstructions.js +16 -0
  141. package/dist/cli/serve/mcp/McpSchema.d.ts +31 -0
  142. package/dist/cli/serve/mcp/McpSchema.js +184 -0
  143. package/dist/cli/serve/mcp/McpServer.d.ts +47 -0
  144. package/dist/cli/serve/mcp/McpServer.js +112 -0
  145. package/dist/cli/serve/mcp/McpTools.d.ts +25 -0
  146. package/dist/cli/serve/mcp/McpTools.js +567 -0
  147. package/dist/cli/static/init/agents.md +13 -0
  148. package/dist/cli/static/init/cms.js +5 -6
  149. package/dist/cli/util/ContentType.d.ts +1 -0
  150. package/dist/cli/util/ContentType.js +36 -0
  151. package/dist/cli/util/Emitter.js +1 -1
  152. package/dist/cli/util/EnsureLibs.js +2 -2
  153. package/dist/cli/util/EnsureNode.js +2 -2
  154. package/dist/cli/util/ForwardCommand.js +4 -12
  155. package/dist/cli/util/PublicDefines.d.ts +1 -0
  156. package/dist/cli/util/PublicDefines.js +2 -1
  157. package/dist/cli/util/RunForwarded.d.ts +13 -0
  158. package/dist/cli/util/RunForwarded.js +166 -0
  159. package/dist/cli/util/WarnPublicEnv.js +2 -0
  160. package/dist/cloud/AuthResult.d.ts +2 -0
  161. package/dist/cloud/CloudHandshake.d.ts +13 -0
  162. package/dist/cloud/CloudHandshake.js +84 -0
  163. package/dist/cloud/CloudRemote.d.ts +4 -1
  164. package/dist/cloud/CloudRemote.js +41 -9
  165. package/dist/cms.d.ts +19 -0
  166. package/dist/cms.js +49 -0
  167. package/dist/components/Alert.d.ts +29 -0
  168. package/dist/components/Alert.js +86 -0
  169. package/dist/components/AppShell.d.ts +15 -0
  170. package/dist/components/AppShell.js +38 -0
  171. package/dist/components/Badge.d.ts +11 -0
  172. package/dist/components/Badge.js +51 -0
  173. package/dist/components/Blockquote.d.ts +7 -0
  174. package/dist/components/Blockquote.js +26 -0
  175. package/dist/components/Breadcrumbs.d.ts +39 -3
  176. package/dist/components/Breadcrumbs.js +103 -22
  177. package/dist/components/Button.d.ts +28 -8
  178. package/dist/components/Button.js +63 -22
  179. package/dist/components/Calendar.d.ts +28 -3
  180. package/dist/components/Calendar.js +162 -53
  181. package/dist/components/Checkbox.d.ts +18 -7
  182. package/dist/components/Checkbox.js +84 -38
  183. package/dist/components/CheckboxGroup.d.ts +11 -5
  184. package/dist/components/CheckboxGroup.js +55 -19
  185. package/dist/components/Code.d.ts +10 -0
  186. package/dist/components/Code.js +49 -0
  187. package/dist/components/Collapsible.d.ts +25 -0
  188. package/dist/components/Collapsible.js +146 -0
  189. package/dist/components/ColorSwatch.d.ts +9 -2
  190. package/dist/components/ColorSwatch.js +20 -20
  191. package/dist/components/ColorSwatchPicker.d.ts +18 -3
  192. package/dist/components/ColorSwatchPicker.js +29 -25
  193. package/dist/components/ComboBox.d.ts +27 -9
  194. package/dist/components/ComboBox.js +197 -99
  195. package/dist/components/Command.d.ts +66 -0
  196. package/dist/components/Command.js +236 -0
  197. package/dist/components/ContentCard.d.ts +30 -0
  198. package/dist/components/ContentCard.js +199 -0
  199. package/dist/components/ContentGrid.d.ts +58 -0
  200. package/dist/components/ContentGrid.js +220 -0
  201. package/dist/components/DataList.d.ts +27 -0
  202. package/dist/components/DataList.js +68 -0
  203. package/dist/components/DateField.d.ts +15 -4
  204. package/dist/components/DateField.js +51 -44
  205. package/dist/components/DatePicker.d.ts +17 -4
  206. package/dist/components/DatePicker.js +61 -68
  207. package/dist/components/DateRangePicker.d.ts +19 -4
  208. package/dist/components/DateRangePicker.js +69 -80
  209. package/dist/components/Dialog.d.ts +53 -3
  210. package/dist/components/Dialog.js +188 -20
  211. package/dist/components/DropZone.d.ts +25 -3
  212. package/dist/components/DropZone.js +98 -17
  213. package/dist/components/DropdownMenu.d.ts +78 -0
  214. package/dist/components/DropdownMenu.js +318 -0
  215. package/dist/components/Empty.d.ts +46 -0
  216. package/dist/components/Empty.js +93 -0
  217. package/dist/components/Field.d.ts +34 -0
  218. package/dist/components/Field.js +159 -0
  219. package/dist/components/FileTrigger.d.ts +21 -0
  220. package/dist/components/FileTrigger.js +53 -0
  221. package/dist/components/FoldIcon.js +2 -1
  222. package/dist/components/Heading.d.ts +13 -0
  223. package/dist/components/Heading.js +48 -0
  224. package/dist/components/Icon.d.ts +1 -1
  225. package/dist/components/Icon.js +3 -3
  226. package/dist/components/Kbd.d.ts +8 -0
  227. package/dist/components/Kbd.js +27 -0
  228. package/dist/components/Link.d.ts +14 -4
  229. package/dist/components/Link.js +22 -20
  230. package/dist/components/List.d.ts +20 -63
  231. package/dist/components/List.js +126 -247
  232. package/dist/components/MediaPreview.d.ts +35 -0
  233. package/dist/components/MediaPreview.js +227 -0
  234. package/dist/components/MultipleSelect.d.ts +22 -20
  235. package/dist/components/MultipleSelect.js +234 -216
  236. package/dist/components/NavRail.d.ts +41 -0
  237. package/dist/components/NavRail.js +121 -0
  238. package/dist/components/NumberField.d.ts +19 -4
  239. package/dist/components/NumberField.js +105 -54
  240. package/dist/components/Page.d.ts +57 -0
  241. package/dist/components/Page.js +130 -0
  242. package/dist/components/Popover.d.ts +39 -5
  243. package/dist/components/Popover.js +146 -22
  244. package/dist/components/PreviewFrame.d.ts +46 -0
  245. package/dist/components/PreviewFrame.js +182 -0
  246. package/dist/components/RadioGroup.d.ts +20 -7
  247. package/dist/components/RadioGroup.js +122 -32
  248. package/dist/components/Resizable.d.ts +51 -0
  249. package/dist/components/Resizable.js +1349 -0
  250. package/dist/components/SearchField.d.ts +37 -6
  251. package/dist/components/SearchField.js +116 -57
  252. package/dist/components/Select.d.ts +35 -10
  253. package/dist/components/Select.js +189 -97
  254. package/dist/components/Sidebar.d.ts +56 -0
  255. package/dist/components/Sidebar.js +136 -0
  256. package/dist/components/SortableList.d.ts +80 -0
  257. package/dist/components/SortableList.js +471 -0
  258. package/dist/components/Spinner.d.ts +8 -0
  259. package/dist/components/Spinner.js +86 -0
  260. package/dist/components/Surface.js +11 -1
  261. package/dist/components/Switch.d.ts +15 -4
  262. package/dist/components/Switch.js +31 -19
  263. package/dist/components/Table.d.ts +107 -14
  264. package/dist/components/Table.js +470 -100
  265. package/dist/components/Tabs.d.ts +33 -12
  266. package/dist/components/Tabs.js +68 -51
  267. package/dist/components/TagGroup.d.ts +26 -9
  268. package/dist/components/TagGroup.js +98 -32
  269. package/dist/components/Text.d.ts +16 -0
  270. package/dist/components/Text.js +44 -0
  271. package/dist/components/TextField.d.ts +27 -9
  272. package/dist/components/TextField.js +143 -47
  273. package/dist/components/TimeField.d.ts +20 -4
  274. package/dist/components/TimeField.js +76 -24
  275. package/dist/components/Timestamp.d.ts +17 -0
  276. package/dist/components/Timestamp.js +131 -0
  277. package/dist/components/Toggle.d.ts +15 -7
  278. package/dist/components/Toggle.js +4 -54
  279. package/dist/components/ToggleGroup.d.ts +33 -0
  280. package/dist/components/ToggleGroup.js +90 -0
  281. package/dist/components/Toolbar.d.ts +27 -8
  282. package/dist/components/Toolbar.js +50 -39
  283. package/dist/components/Tooltip.d.ts +22 -4
  284. package/dist/components/Tooltip.js +77 -34
  285. package/dist/components/Tree.d.ts +48 -18
  286. package/dist/components/Tree.js +228 -82
  287. package/dist/components/internal/Accept.d.ts +5 -0
  288. package/dist/components/internal/Accept.js +17 -0
  289. package/dist/components/internal/DateControl.d.ts +18 -0
  290. package/dist/components/internal/DateControl.js +92 -0
  291. package/dist/components/internal/DateValue.d.ts +16 -0
  292. package/dist/components/internal/DateValue.js +40 -0
  293. package/dist/components/internal/ListBoxOption.d.ts +20 -0
  294. package/dist/components/internal/ListBoxOption.js +111 -0
  295. package/dist/components/internal/Locale.d.ts +7 -0
  296. package/dist/components/internal/Locale.js +18 -0
  297. package/dist/components/internal/Placement.d.ts +3 -0
  298. package/dist/components/internal/Placement.js +13 -0
  299. package/dist/components/internal/PopoverSurface.d.ts +21 -0
  300. package/dist/components/internal/PopoverSurface.js +66 -0
  301. package/dist/components/internal/SelectionCheckbox.d.ts +8 -0
  302. package/dist/components/internal/SelectionCheckbox.js +57 -0
  303. package/dist/components/internal/Slot.d.ts +7 -0
  304. package/dist/components/internal/Slot.js +26 -0
  305. package/dist/components/internal/ToggleButton.d.ts +26 -0
  306. package/dist/components/internal/ToggleButton.js +68 -0
  307. package/dist/components/internal/Trigger.d.ts +16 -0
  308. package/dist/components/internal/Trigger.js +34 -0
  309. package/dist/components/internal/useDragDrop.d.ts +22 -0
  310. package/dist/components/internal/useDragDrop.js +110 -0
  311. package/dist/components/types.d.ts +106 -0
  312. package/dist/components/types.js +0 -0
  313. package/dist/components.d.ts +29 -5
  314. package/dist/components.js +28 -5
  315. package/dist/config.d.ts +1 -0
  316. package/dist/config.js +2 -0
  317. package/dist/core/Client.d.ts +1 -4
  318. package/dist/core/Client.js +8 -9
  319. package/dist/core/Config.d.ts +26 -3
  320. package/dist/core/Config.js +24 -2
  321. package/dist/core/Connection.d.ts +27 -9
  322. package/dist/core/Connection.js +17 -0
  323. package/dist/core/Document.d.ts +2 -2
  324. package/dist/core/Document.js +15 -3
  325. package/dist/core/Entry.d.ts +9 -0
  326. package/dist/core/Entry.js +14 -0
  327. package/dist/core/EntryFields.d.ts +5 -0
  328. package/dist/core/EntrySeed.d.ts +23 -0
  329. package/dist/core/EntrySeed.js +135 -0
  330. package/dist/core/Expr.d.ts +11 -0
  331. package/dist/core/Field.d.ts +28 -1
  332. package/dist/core/Field.js +23 -0
  333. package/dist/core/Filter.d.ts +53 -2
  334. package/dist/core/Filter.js +145 -0
  335. package/dist/core/Graph.d.ts +35 -13
  336. package/dist/core/Id.d.ts +1 -0
  337. package/dist/core/Id.js +8 -0
  338. package/dist/core/Infer.d.ts +25 -1
  339. package/dist/core/ListRow.d.ts +3 -0
  340. package/dist/core/ListRow.js +1 -0
  341. package/dist/core/OrderBy.d.ts +7 -3
  342. package/dist/core/Overview.d.ts +242 -0
  343. package/dist/core/Overview.js +47 -0
  344. package/dist/core/Reference.d.ts +1 -0
  345. package/dist/core/Role.d.ts +6 -1
  346. package/dist/core/Role.js +69 -65
  347. package/dist/core/Root.d.ts +18 -2
  348. package/dist/core/Root.js +11 -3
  349. package/dist/core/Scope.d.ts +4 -0
  350. package/dist/core/Scope.js +51 -2
  351. package/dist/core/TextDoc.d.ts +24 -1
  352. package/dist/core/TextDoc.js +1 -0
  353. package/dist/core/Trace.d.ts +8 -0
  354. package/dist/core/Trace.js +32 -0
  355. package/dist/core/Type.d.ts +42 -8
  356. package/dist/core/Type.js +48 -9
  357. package/dist/core/Validation.d.ts +56 -0
  358. package/dist/core/Validation.js +121 -0
  359. package/dist/core/Workspace.d.ts +7 -5
  360. package/dist/core/Workspace.js +5 -1
  361. package/dist/core/db/CommitRequest.d.ts +0 -3
  362. package/dist/core/db/CommitRequest.js +0 -9
  363. package/dist/core/db/EntryAliases.js +2 -15
  364. package/dist/core/db/EntryReference.d.ts +8 -7
  365. package/dist/core/db/EntryUrlConflictError.js +1 -1
  366. package/dist/core/db/EntryValidationError.d.ts +13 -0
  367. package/dist/core/db/EntryValidationError.js +23 -0
  368. package/dist/core/db/IndexEvent.d.ts +2 -1
  369. package/dist/core/db/IndexEvent.js +11 -3
  370. package/dist/core/db/LinkResolver.d.ts +13 -7
  371. package/dist/core/db/LinkResolver.js +0 -30
  372. package/dist/core/db/LocalStore.d.ts +27 -0
  373. package/dist/core/db/LocalStore.js +0 -0
  374. package/dist/core/db/Operation.d.ts +24 -3
  375. package/dist/core/db/Operation.js +119 -26
  376. package/dist/core/db/WriteableGraph.d.ts +5 -0
  377. package/dist/core/field/CreateField.d.ts +1 -1
  378. package/dist/core/field/ListField.js +44 -8
  379. package/dist/core/field/RecordField.js +16 -2
  380. package/dist/core/field/RichTextField.d.ts +30 -3
  381. package/dist/core/field/RichTextField.js +233 -64
  382. package/dist/core/field/ScalarField.d.ts +2 -2
  383. package/dist/core/field/UnionField.js +32 -2
  384. package/dist/core/media/CompressPdf.browser.d.ts +5 -0
  385. package/dist/core/media/CompressPdf.browser.js +13 -0
  386. package/dist/core/media/CompressPdf.d.ts +6 -0
  387. package/dist/core/media/CompressPdf.js +45 -0
  388. package/dist/core/media/CreatePreview.browser.d.ts +5 -1
  389. package/dist/core/media/CreatePreview.browser.js +16 -0
  390. package/dist/core/media/CreatePreview.d.ts +2 -1
  391. package/dist/core/media/CreatePreview.js +2 -0
  392. package/dist/core/media/FileKinds.d.ts +10 -0
  393. package/dist/core/media/FileKinds.js +25 -0
  394. package/dist/core/media/ImageTransform.d.ts +78 -0
  395. package/dist/core/media/ImageTransform.js +108 -0
  396. package/dist/core/media/MediaAltField.d.ts +1 -0
  397. package/dist/core/media/MediaAltField.js +9 -1
  398. package/dist/core/media/MediaLocation.d.ts +9 -15
  399. package/dist/core/media/MediaLocation.js +29 -19
  400. package/dist/core/media/MediaRoot.js +2 -0
  401. package/dist/core/media/MediaTypes.d.ts +14 -10
  402. package/dist/core/media/MediaTypes.js +158 -34
  403. package/dist/core/media/Pdf.d.ts +15 -0
  404. package/dist/core/media/Pdf.js +31 -0
  405. package/dist/core/media/TransformImage.browser.d.ts +7 -0
  406. package/dist/core/media/TransformImage.browser.js +38 -0
  407. package/dist/core/media/TransformImage.d.ts +7 -0
  408. package/dist/core/media/TransformImage.js +38 -0
  409. package/dist/core/source/FSSource.d.ts +14 -2
  410. package/dist/core/source/FSSource.js +58 -13
  411. package/dist/core/source/GitUtils.d.ts +4 -0
  412. package/dist/core/source/GitUtils.js +9 -10
  413. package/dist/core/source/GithubSource.js +60 -21
  414. package/dist/core/source/IndexedDBSource.d.ts +2 -1
  415. package/dist/core/source/IndexedDBSource.js +67 -53
  416. package/dist/core/source/MemorySource.js +5 -3
  417. package/dist/core/source/OverlaySource.d.ts +15 -0
  418. package/dist/core/source/OverlaySource.js +78 -0
  419. package/dist/core/source/Source.d.ts +4 -1
  420. package/dist/core/source/Source.js +18 -5
  421. package/dist/core/source/Tree.d.ts +10 -7
  422. package/dist/core/source/Tree.js +118 -70
  423. package/dist/core/source/Utils.js +6 -3
  424. package/dist/core/text/MarkdownToTextDoc.d.ts +29 -0
  425. package/dist/core/text/MarkdownToTextDoc.js +524 -0
  426. package/dist/core/text/TextDocToMarkdown.d.ts +20 -0
  427. package/dist/core/text/TextDocToMarkdown.js +316 -0
  428. package/dist/core/util/Arrays.d.ts +1 -0
  429. package/dist/core/util/Arrays.js +10 -0
  430. package/dist/core/util/Async.d.ts +7 -0
  431. package/dist/core/util/Async.js +15 -0
  432. package/dist/core/util/Checks.js +1 -1
  433. package/dist/core/util/EntryFilenames.d.ts +22 -1
  434. package/dist/core/util/EntryFilenames.js +56 -2
  435. package/dist/core/util/IndexedDB.d.ts +4 -0
  436. package/dist/core/util/IndexedDB.js +20 -0
  437. package/dist/core/util/JWT.d.ts +1 -1
  438. package/dist/core/util/Objects.d.ts +2 -0
  439. package/dist/core/util/Objects.js +7 -0
  440. package/dist/core/util/OrderKeys.d.ts +11 -0
  441. package/dist/core/util/OrderKeys.js +64 -0
  442. package/dist/core/util/Paths.js +5 -1
  443. package/dist/core.d.ts +3 -0
  444. package/dist/core.js +8 -1
  445. package/dist/dashboard/App.css +202 -76
  446. package/dist/dashboard/App.d.ts +3 -0
  447. package/dist/dashboard/App.js +56 -32
  448. package/dist/dashboard/StoryProvider.js +2 -2
  449. package/dist/dashboard/ViewKeys.d.ts +2 -0
  450. package/dist/dashboard/ViewKeys.js +2 -0
  451. package/dist/dashboard/app/AccessDenied.d.ts +16 -1
  452. package/dist/dashboard/app/AccessDenied.js +42 -25
  453. package/dist/dashboard/app/ActivityStatus.d.ts +5 -4
  454. package/dist/dashboard/app/ActivityStatus.js +122 -165
  455. package/dist/dashboard/app/AppearanceToggle.d.ts +1 -0
  456. package/dist/dashboard/app/AppearanceToggle.js +62 -0
  457. package/dist/dashboard/app/AuthView.d.ts +1 -1
  458. package/dist/dashboard/app/AuthView.js +79 -69
  459. package/dist/dashboard/app/CompactField.d.ts +19 -6
  460. package/dist/dashboard/app/CompactField.js +174 -48
  461. package/dist/dashboard/app/CroppedImage.d.ts +17 -0
  462. package/dist/dashboard/app/CroppedImage.js +73 -0
  463. package/dist/dashboard/app/DashboardErrorBoundary.js +44 -20
  464. package/dist/dashboard/app/DashboardLayout.d.ts +4 -2
  465. package/dist/dashboard/app/DashboardLayout.js +53 -34
  466. package/dist/dashboard/app/DashboardMeta.d.ts +2 -1
  467. package/dist/dashboard/app/DashboardMeta.js +20 -5
  468. package/dist/dashboard/app/DeleteDialog.d.ts +11 -0
  469. package/dist/dashboard/app/DeleteDialog.js +249 -0
  470. package/dist/dashboard/app/EntryFields.d.ts +12 -10
  471. package/dist/dashboard/app/EntryFields.js +15 -23
  472. package/dist/dashboard/app/EntryHeader.d.ts +2 -2
  473. package/dist/dashboard/app/EntryHeader.js +319 -214
  474. package/dist/dashboard/app/EntryHeaderActions.d.ts +24 -4
  475. package/dist/dashboard/app/EntryHeaderActions.js +46 -29
  476. package/dist/dashboard/app/EntryReferences.d.ts +13 -1
  477. package/dist/dashboard/app/EntryReferences.js +64 -62
  478. package/dist/dashboard/app/EntrySidebar.d.ts +8 -6
  479. package/dist/dashboard/app/EntrySidebar.js +111 -92
  480. package/dist/dashboard/app/EntrySidebarPreview.d.ts +5 -2
  481. package/dist/dashboard/app/EntrySidebarPreview.js +92 -129
  482. package/dist/dashboard/app/EntrySidebarPreview.story.d.ts +6 -1
  483. package/dist/dashboard/app/EntrySidebarToggle.js +5 -6
  484. package/dist/dashboard/app/EntryTranslationBanner.d.ts +3 -1
  485. package/dist/dashboard/app/EntryTranslationBanner.js +40 -45
  486. package/dist/dashboard/app/EntryValidationModal.d.ts +12 -0
  487. package/dist/dashboard/app/EntryValidationModal.js +77 -0
  488. package/dist/dashboard/app/Explorer.d.ts +15 -6
  489. package/dist/dashboard/app/Explorer.js +318 -354
  490. package/dist/dashboard/app/ExplorerBatchActions.d.ts +17 -0
  491. package/dist/dashboard/app/ExplorerBatchActions.js +158 -0
  492. package/dist/dashboard/app/ExplorerCards.d.ts +8 -3
  493. package/dist/dashboard/app/ExplorerCards.js +106 -314
  494. package/dist/dashboard/app/ExplorerControls.d.ts +20 -0
  495. package/dist/dashboard/app/ExplorerControls.js +170 -0
  496. package/dist/dashboard/app/ExplorerList.d.ts +7 -4
  497. package/dist/dashboard/app/ExplorerList.js +167 -103
  498. package/dist/dashboard/app/ExplorerModal.d.ts +2 -5
  499. package/dist/dashboard/app/ExplorerModal.js +6 -18
  500. package/dist/dashboard/app/ExplorerPickerContent.d.ts +19 -3
  501. package/dist/dashboard/app/ExplorerPickerContent.js +89 -7
  502. package/dist/dashboard/app/ExplorerTable.d.ts +8 -4
  503. package/dist/dashboard/app/ExplorerTable.js +159 -371
  504. package/dist/dashboard/app/ExternalLinkPicker.js +49 -48
  505. package/dist/dashboard/app/FileKind.d.ts +8 -0
  506. package/dist/dashboard/app/FileKind.js +40 -0
  507. package/dist/dashboard/app/ImageEditor.d.ts +13 -0
  508. package/dist/dashboard/app/ImageEditor.js +302 -0
  509. package/dist/dashboard/app/ImageEditorCrop.d.ts +19 -0
  510. package/dist/dashboard/app/ImageEditorCrop.js +90 -0
  511. package/dist/dashboard/app/ImagePicker.d.ts +1 -1
  512. package/dist/dashboard/app/ImagePicker.js +38 -87
  513. package/dist/dashboard/app/LinkPicker.d.ts +1 -1
  514. package/dist/dashboard/app/LinkPicker.js +124 -127
  515. package/dist/dashboard/app/LocaleMenu.d.ts +10 -1
  516. package/dist/dashboard/app/LocaleMenu.js +78 -53
  517. package/dist/dashboard/app/MediaPreviewCell.d.ts +8 -0
  518. package/dist/dashboard/app/MediaPreviewCell.js +50 -0
  519. package/dist/dashboard/app/MoveDialog.d.ts +10 -0
  520. package/dist/dashboard/app/MoveDialog.js +161 -0
  521. package/dist/dashboard/app/NodeEditor.d.ts +11 -0
  522. package/dist/dashboard/app/NodeEditor.js +13 -0
  523. package/dist/dashboard/app/OverviewCell.d.ts +15 -0
  524. package/dist/dashboard/app/OverviewCell.js +251 -0
  525. package/dist/dashboard/app/PendingUploadsDialog.d.ts +2 -0
  526. package/dist/dashboard/app/PendingUploadsDialog.js +49 -0
  527. package/dist/dashboard/app/PendingUploadsView.d.ts +19 -0
  528. package/dist/dashboard/app/PendingUploadsView.js +209 -0
  529. package/dist/dashboard/app/ReadOnlyBadge.d.ts +4 -0
  530. package/dist/dashboard/app/ReadOnlyBadge.js +33 -0
  531. package/dist/dashboard/app/SidebarLayout.d.ts +9 -0
  532. package/dist/dashboard/app/SidebarLayout.js +64 -0
  533. package/dist/dashboard/app/SidebarTree.d.ts +14 -11
  534. package/dist/dashboard/app/SidebarTree.js +268 -265
  535. package/dist/dashboard/app/ViewToggle.d.ts +1 -1
  536. package/dist/dashboard/app/ViewToggle.js +17 -10
  537. package/dist/dashboard/app/WorkspaceMenu.d.ts +11 -5
  538. package/dist/dashboard/app/WorkspaceMenu.js +123 -137
  539. package/dist/dashboard/app/WorkspaceRoots.d.ts +1 -1
  540. package/dist/dashboard/app/WorkspaceRoots.js +131 -188
  541. package/dist/dashboard/app/editor/FileEditor.d.ts +2 -3
  542. package/dist/dashboard/app/editor/FileEditor.js +125 -123
  543. package/dist/dashboard/app/editor/FilePreview.d.ts +5 -6
  544. package/dist/dashboard/app/editor/FilePreview.js +13 -138
  545. package/dist/dashboard/app/editor/MediaAltField.view.d.ts +1 -1
  546. package/dist/dashboard/app/editor/MediaAltField.view.js +14 -17
  547. package/dist/dashboard/app/modals/CreateEntry.js +108 -116
  548. package/dist/dashboard/app/pages/EntryPage.js +176 -91
  549. package/dist/dashboard/app/pages/RootPage.js +8 -10
  550. package/dist/dashboard/app/pages/SplashPage.d.ts +22 -0
  551. package/dist/dashboard/app/pages/SplashPage.js +414 -0
  552. package/dist/dashboard/app/pages/UsersPage.d.ts +20 -1
  553. package/dist/dashboard/app/pages/UsersPage.js +186 -259
  554. package/dist/dashboard/app/ui/DashboardModal.d.ts +18 -12
  555. package/dist/dashboard/app/ui/DashboardModal.js +54 -70
  556. package/dist/dashboard/atoms/ReactiveNode.js +59 -20
  557. package/dist/dashboard/atoms/activity.d.ts +0 -2
  558. package/dist/dashboard/atoms/activity.js +6 -13
  559. package/dist/dashboard/atoms/auth.d.ts +2 -0
  560. package/dist/dashboard/atoms/auth.js +10 -4
  561. package/dist/dashboard/atoms/config.d.ts +7 -5
  562. package/dist/dashboard/atoms/config.js +1 -1
  563. package/dist/dashboard/atoms/core.d.ts +16 -2
  564. package/dist/dashboard/atoms/core.js +20 -8
  565. package/dist/dashboard/atoms/create.js +4 -8
  566. package/dist/dashboard/atoms/dashboard.d.ts +14 -0
  567. package/dist/dashboard/atoms/dashboard.js +23 -3
  568. package/dist/dashboard/atoms/delete.d.ts +68 -0
  569. package/dist/dashboard/atoms/delete.js +143 -0
  570. package/dist/dashboard/atoms/editor.d.ts +8 -1
  571. package/dist/dashboard/atoms/editor.js +22 -35
  572. package/dist/dashboard/atoms/entry.d.ts +46 -55
  573. package/dist/dashboard/atoms/entry.js +364 -205
  574. package/dist/dashboard/atoms/entryTable.d.ts +10 -0
  575. package/dist/dashboard/atoms/entryTable.js +42 -0
  576. package/dist/dashboard/atoms/explorer.d.ts +179 -38
  577. package/dist/dashboard/atoms/explorer.js +564 -250
  578. package/dist/dashboard/atoms/graph.d.ts +1 -0
  579. package/dist/dashboard/atoms/graph.js +7 -2
  580. package/dist/dashboard/atoms/link.d.ts +3 -1
  581. package/dist/dashboard/atoms/link.js +43 -56
  582. package/dist/dashboard/atoms/move.d.ts +59 -0
  583. package/dist/dashboard/atoms/move.js +103 -0
  584. package/dist/dashboard/atoms/nav.d.ts +19 -4
  585. package/dist/dashboard/atoms/nav.js +107 -18
  586. package/dist/dashboard/atoms/overview.d.ts +203 -0
  587. package/dist/dashboard/atoms/overview.js +503 -0
  588. package/dist/dashboard/atoms/preview.d.ts +3 -0
  589. package/dist/dashboard/atoms/preview.js +19 -2
  590. package/dist/dashboard/atoms/root.d.ts +52 -24
  591. package/dist/dashboard/atoms/root.js +350 -180
  592. package/dist/dashboard/atoms/upload.d.ts +92 -3
  593. package/dist/dashboard/atoms/upload.js +245 -13
  594. package/dist/dashboard/atoms/user.d.ts +1 -1
  595. package/dist/dashboard/atoms/user.js +8 -6
  596. package/dist/dashboard/atoms/utils.d.ts +12 -4
  597. package/dist/dashboard/atoms/utils.js +36 -3
  598. package/dist/dashboard/boot/ActivityEvent.d.ts +1 -1
  599. package/dist/dashboard/boot/Boot.d.ts +2 -0
  600. package/dist/dashboard/boot/Boot.js +13 -13
  601. package/dist/dashboard/boot/BootDev.js +13 -10
  602. package/dist/dashboard/boot/BootProd.js +1 -0
  603. package/dist/dashboard/boot/DashboardWorker.d.ts +3 -3
  604. package/dist/dashboard/boot/DashboardWorker.js +115 -80
  605. package/dist/dashboard/boot/LoadWorker.js +3 -4
  606. package/dist/dashboard/boot/WorkerDB.d.ts +2 -2
  607. package/dist/dashboard/cms/EntryTable.d.ts +55 -0
  608. package/dist/dashboard/cms/EntryTable.js +265 -0
  609. package/dist/dashboard/cms/FieldChrome.d.ts +21 -0
  610. package/dist/dashboard/cms/FieldChrome.js +26 -0
  611. package/dist/dashboard/cms/ViewProps.d.ts +41 -0
  612. package/dist/dashboard/cms/ViewProps.js +0 -0
  613. package/dist/dashboard/cms/hooks.d.ts +104 -0
  614. package/dist/dashboard/cms/hooks.js +107 -0
  615. package/dist/dashboard/contexts.d.ts +58 -0
  616. package/dist/dashboard/contexts.js +42 -0
  617. package/dist/dashboard/editor/UseField.d.ts +29 -6
  618. package/dist/dashboard/editor/UseField.js +6 -6
  619. package/dist/dashboard/fixture/cms.d.ts +14 -2
  620. package/dist/dashboard/fixture/cms.js +54 -6
  621. package/dist/dashboard/hook/UseEntryEditor.d.ts +3 -0
  622. package/dist/dashboard/hook/UseGraph.d.ts +3 -1
  623. package/dist/dashboard/hook/UseGraph.js +4 -4
  624. package/dist/dashboard/hook/UseLocale.d.ts +3 -1
  625. package/dist/dashboard/hook/UseRoot.d.ts +3 -1
  626. package/dist/dashboard/hook/UseRoot.js +4 -4
  627. package/dist/dashboard/hook/UseSaveShortcut.d.ts +1 -0
  628. package/dist/dashboard/hook/UseSaveShortcut.js +24 -0
  629. package/dist/dashboard/hook/UseSearchShortcut.d.ts +11 -0
  630. package/dist/dashboard/hook/UseSearchShortcut.js +32 -0
  631. package/dist/dashboard/hook/UseWorkspace.d.ts +3 -1
  632. package/dist/dashboard/hooks.d.ts +20 -100
  633. package/dist/dashboard/hooks.js +39 -101
  634. package/dist/dashboard/icons.d.ts +12 -0
  635. package/dist/dashboard/icons.js +140 -0
  636. package/dist/dashboard/plugins/alineaFixturePlugin.js +14 -3
  637. package/dist/dashboard.d.ts +23 -1
  638. package/dist/dashboard.js +5 -2
  639. package/dist/database/BrowserEntryStore.d.ts +47 -0
  640. package/dist/database/BrowserEntryStore.js +190 -0
  641. package/dist/database/DatabaseSource.d.ts +13 -0
  642. package/dist/database/DatabaseSource.js +25 -0
  643. package/dist/database/DatabaseTables.d.ts +38 -0
  644. package/dist/database/DatabaseTables.js +53 -0
  645. package/dist/database/EntryDatabase.d.ts +97 -0
  646. package/dist/database/EntryDatabase.js +532 -0
  647. package/dist/database/EntryStore.d.ts +58 -0
  648. package/dist/database/EntryStore.js +230 -0
  649. package/dist/database/EntryTransaction.d.ts +28 -0
  650. package/dist/database/EntryTransaction.js +1052 -0
  651. package/dist/database/EntryUrlAliases.d.ts +2 -0
  652. package/dist/database/EntryUrlAliases.js +69 -0
  653. package/dist/database/LocalDB.d.ts +39 -0
  654. package/dist/database/LocalDB.js +79 -0
  655. package/dist/database/Version.d.ts +9 -0
  656. package/dist/database/Version.js +13 -0
  657. package/dist/database/driver/DatabaseHandle.d.ts +17 -0
  658. package/dist/database/driver/DatabaseHandle.js +0 -0
  659. package/dist/database/driver/OverlayExtension.browser.d.ts +2 -0
  660. package/dist/database/driver/OverlayExtension.browser.js +9 -0
  661. package/dist/database/driver/OverlayExtension.d.ts +1 -0
  662. package/dist/database/driver/OverlayExtension.js +7 -0
  663. package/dist/database/driver/RuntimeDatabase.d.ts +13 -0
  664. package/dist/database/driver/RuntimeDatabase.js +77 -0
  665. package/dist/database/driver/WasmDatabase.d.ts +29 -0
  666. package/dist/database/driver/WasmDatabase.js +48 -0
  667. package/dist/database/entry/EntryData.d.ts +13 -0
  668. package/dist/database/entry/EntryData.js +51 -0
  669. package/dist/database/entry/EntryTable.d.ts +189 -0
  670. package/dist/database/entry/EntryTable.js +193 -0
  671. package/dist/database/query/Condition.d.ts +13 -0
  672. package/dist/database/query/Condition.js +125 -0
  673. package/dist/database/query/EntryQuery.d.ts +48 -0
  674. package/dist/database/query/EntryQuery.js +446 -0
  675. package/dist/database/query/EntryReferences.d.ts +5 -0
  676. package/dist/database/query/EntryReferences.js +71 -0
  677. package/dist/database/query/Relation.d.ts +11 -0
  678. package/dist/database/query/Relation.js +123 -0
  679. package/dist/database/query/ResolveQuery.d.ts +12 -0
  680. package/dist/database/query/ResolveQuery.js +191 -0
  681. package/dist/database/query/Search.d.ts +41 -0
  682. package/dist/database/query/Search.js +177 -0
  683. package/dist/database/sync/Derive.d.ts +8 -0
  684. package/dist/database/sync/Derive.js +274 -0
  685. package/dist/database/sync/EntryParser.d.ts +8 -0
  686. package/dist/database/sync/EntryParser.js +91 -0
  687. package/dist/database/sync/EntrySyncer.d.ts +25 -0
  688. package/dist/database/sync/EntrySyncer.js +89 -0
  689. package/dist/database/sync/Ingest.d.ts +21 -0
  690. package/dist/database/sync/Ingest.js +146 -0
  691. package/dist/database/sync/SyncQueries.d.ts +161 -0
  692. package/dist/database/sync/SyncQueries.js +216 -0
  693. package/dist/field/check/CheckField.js +3 -1
  694. package/dist/field/check/CheckField.view.js +10 -9
  695. package/dist/field/code/CodeField.d.ts +9 -0
  696. package/dist/field/code/CodeField.view.d.ts +3 -1
  697. package/dist/field/code/CodeField.view.js +29 -20
  698. package/dist/field/code/SimpleCodeEditor.js +0 -18
  699. package/dist/field/date/DateField.view.js +7 -13
  700. package/dist/field/link/EntryLink.d.ts +1 -1
  701. package/dist/field/link/EntryLink.js +1 -0
  702. package/dist/field/link/FileLink.d.ts +3 -0
  703. package/dist/field/link/FileLink.js +1 -7
  704. package/dist/field/link/ImageLink.d.ts +3 -0
  705. package/dist/field/link/ImageLink.js +2 -3
  706. package/dist/field/link/Link.js +3 -2
  707. package/dist/field/link/LinkField.d.ts +10 -5
  708. package/dist/field/link/LinkField.js +25 -0
  709. package/dist/field/link/LinkField.view.js +493 -506
  710. package/dist/field/link/UrlLink.d.ts +1 -0
  711. package/dist/field/link.d.ts +1 -0
  712. package/dist/field/list/ListField.d.ts +10 -4
  713. package/dist/field/list/ListField.js +10 -5
  714. package/dist/field/list/ListField.view.js +376 -547
  715. package/dist/field/localiser/LocalisedField.view.js +19 -19
  716. package/dist/field/localiser/LocalisedFieldTab.d.ts +7 -0
  717. package/dist/field/localiser/LocalisedFieldTab.js +30 -0
  718. package/dist/field/localiser/LocalisedFieldTabs.js +5 -5
  719. package/dist/field/localiser/Localiser.js +25 -7
  720. package/dist/field/localiser/SelectLocale.d.ts +5 -0
  721. package/dist/field/localiser/SelectLocale.js +12 -0
  722. package/dist/field/metadata/MetadataAudit.d.ts +39 -0
  723. package/dist/field/metadata/MetadataAudit.js +124 -0
  724. package/dist/field/metadata/MetadataField.d.ts +30 -23
  725. package/dist/field/metadata/MetadataField.js +48 -104
  726. package/dist/field/metadata/MetadataField.view.d.ts +5 -0
  727. package/dist/field/metadata/MetadataField.view.js +48 -32
  728. package/dist/field/number/NumberField.d.ts +2 -0
  729. package/dist/field/number/NumberField.view.js +10 -9
  730. package/dist/field/object/ObjectField.view.js +15 -19
  731. package/dist/field/path/PathField.view.js +3 -3
  732. package/dist/field/path/SlugField.d.ts +1 -2
  733. package/dist/field/path/SlugField.js +5 -7
  734. package/dist/field/richtext/PickTextAnchor.js +10 -10
  735. package/dist/field/richtext/PickTextLink.d.ts +10 -1
  736. package/dist/field/richtext/PickTextLink.js +125 -22
  737. package/dist/field/richtext/ReferenceLink.d.ts +6 -1
  738. package/dist/field/richtext/ReferenceLink.js +23 -4
  739. package/dist/field/richtext/RichTextBlock.js +51 -46
  740. package/dist/field/richtext/RichTextBlocks.js +1 -1
  741. package/dist/field/richtext/RichTextDocument.d.ts +7 -2
  742. package/dist/field/richtext/RichTextDocument.js +43 -6
  743. package/dist/field/richtext/RichTextExtensions.d.ts +3 -1
  744. package/dist/field/richtext/RichTextExtensions.js +2722 -7475
  745. package/dist/field/richtext/RichTextField.d.ts +7 -0
  746. package/dist/field/richtext/RichTextField.story.d.ts +4 -0
  747. package/dist/field/richtext/RichTextField.view.js +66 -34
  748. package/dist/field/richtext/RichTextInsertMenu.js +304 -525
  749. package/dist/field/richtext/RichTextState.js +1 -1
  750. package/dist/field/richtext/RichTextToolbar.d.ts +5 -2
  751. package/dist/field/richtext/RichTextToolbar.js +95 -37
  752. package/dist/field/richtext/Toolbar.d.ts +19 -1
  753. package/dist/field/richtext/Toolbar.js +18 -13
  754. package/dist/field/richtext/extensions/Anchor.js +1 -1
  755. package/dist/field/richtext/extensions/Link.d.ts +1 -0
  756. package/dist/field/richtext/extensions/Link.js +2 -1
  757. package/dist/field/richtext/extensions/Small.js +1 -1
  758. package/dist/field/richtext.d.ts +2 -0
  759. package/dist/field/richtext.js +2 -0
  760. package/dist/field/select/SelectField.view.js +20 -83
  761. package/dist/field/tabs/Tabs.view.js +8 -8
  762. package/dist/field/text/TextField.view.js +11 -10
  763. package/dist/field/time/TimeField.d.ts +0 -2
  764. package/dist/field/time/TimeField.view.js +10 -18
  765. package/dist/field/views.js +4 -0
  766. package/dist/field.d.ts +1 -1
  767. package/dist/field.js +1 -1
  768. package/dist/index.css +5412 -4968
  769. package/dist/next.cjs +118 -46
  770. package/dist/next.d.ts +4 -2
  771. package/dist/next.edge.d.ts +3 -2
  772. package/dist/next.js +1 -2
  773. package/dist/picker/entry/EntryPicker.d.ts +7 -3
  774. package/dist/picker/entry/EntryPicker.js +12 -13
  775. package/dist/picker/entry/EntryReference.d.ts +2 -0
  776. package/dist/picker/entry/EntryReference.js +1 -0
  777. package/dist/picker/url/UrlPicker.js +1 -0
  778. package/dist/preview/PreviewMessage.d.ts +3 -0
  779. package/dist/preview/PreviewMessage.js +1 -0
  780. package/dist/preview/RegisterPreview.d.ts +1 -1
  781. package/dist/preview/RegisterPreview.js +28 -10
  782. package/dist/preview/react.d.ts +5 -1
  783. package/dist/preview/react.js +12 -9
  784. package/dist/preview/widget.d.ts +45 -0
  785. package/dist/preview/widget.js +100 -11
  786. package/dist/query.d.ts +16 -225
  787. package/dist/types.d.ts +6 -3
  788. package/dist/ui/RichText.d.ts +1 -0
  789. package/dist/ui/RichText.js +62 -20
  790. package/docs/ai-agents.md +316 -0
  791. package/docs/ai-setup.md +297 -0
  792. package/docs/cli.md +94 -0
  793. package/docs/components/alert.md +122 -0
  794. package/docs/components/app-shell.md +77 -0
  795. package/docs/components/badge.md +88 -0
  796. package/docs/components/blockquote.md +24 -0
  797. package/docs/components/breadcrumb.md +83 -0
  798. package/docs/components/button.md +141 -0
  799. package/docs/components/calendar.md +32 -0
  800. package/docs/components/checkbox-group.md +38 -0
  801. package/docs/components/checkbox.md +61 -0
  802. package/docs/components/code.md +37 -0
  803. package/docs/components/collapsible.md +53 -0
  804. package/docs/components/color-swatch-picker.md +47 -0
  805. package/docs/components/combo-box.md +57 -0
  806. package/docs/components/command.md +101 -0
  807. package/docs/components/content-card.md +63 -0
  808. package/docs/components/content-grid.md +71 -0
  809. package/docs/components/data-list.md +64 -0
  810. package/docs/components/date-field.md +34 -0
  811. package/docs/components/date-picker.md +35 -0
  812. package/docs/components/date-range-picker.md +34 -0
  813. package/docs/components/dialog.md +182 -0
  814. package/docs/components/drop-zone.md +45 -0
  815. package/docs/components/dropdown-menu.md +223 -0
  816. package/docs/components/empty.md +81 -0
  817. package/docs/components/field.md +66 -0
  818. package/docs/components/file-trigger.md +33 -0
  819. package/docs/components/fold-icon.md +34 -0
  820. package/docs/components/heading.md +33 -0
  821. package/docs/components/icon.md +43 -0
  822. package/docs/components/kbd.md +29 -0
  823. package/docs/components/link.md +35 -0
  824. package/docs/components/list.md +104 -0
  825. package/docs/components/media-preview.md +43 -0
  826. package/docs/components/multiple-select.md +56 -0
  827. package/docs/components/nav-rail.md +79 -0
  828. package/docs/components/number-field.md +49 -0
  829. package/docs/components/page.md +97 -0
  830. package/docs/components/popover.md +71 -0
  831. package/docs/components/preview-frame.md +63 -0
  832. package/docs/components/radio-group.md +47 -0
  833. package/docs/components/resizable-panel-group.md +63 -0
  834. package/docs/components/search-field.md +53 -0
  835. package/docs/components/select.md +138 -0
  836. package/docs/components/sidebar.md +104 -0
  837. package/docs/components/sortable-list.md +125 -0
  838. package/docs/components/spinner.md +29 -0
  839. package/docs/components/surface.md +54 -0
  840. package/docs/components/switch.md +52 -0
  841. package/docs/components/table.md +178 -0
  842. package/docs/components/tabs.md +120 -0
  843. package/docs/components/tag-group.md +56 -0
  844. package/docs/components/text-field.md +134 -0
  845. package/docs/components/text.md +44 -0
  846. package/docs/components/time-field.md +37 -0
  847. package/docs/components/timestamp.md +45 -0
  848. package/docs/components/toggle-group.md +46 -0
  849. package/docs/components/toggle.md +37 -0
  850. package/docs/components/toolbar.md +96 -0
  851. package/docs/components/tooltip.md +78 -0
  852. package/docs/components/tree.md +67 -0
  853. package/docs/components.md +131 -0
  854. package/docs/configuration.md +175 -0
  855. package/docs/content-model.md +87 -0
  856. package/docs/custom-fields.md +231 -0
  857. package/docs/dashboard-ui.md +3 -0
  858. package/docs/deploy/alinea-cloud.md +26 -0
  859. package/docs/deploy/self-host.md +193 -0
  860. package/docs/deploy.md +123 -0
  861. package/docs/editing-content.md +195 -0
  862. package/docs/fields/check.md +40 -0
  863. package/docs/fields/code.md +35 -0
  864. package/docs/fields/date.md +90 -0
  865. package/docs/fields/entry.md +179 -0
  866. package/docs/fields/file.md +60 -0
  867. package/docs/fields/image.md +139 -0
  868. package/docs/fields/link.md +121 -0
  869. package/docs/fields/list.md +126 -0
  870. package/docs/fields/number.md +58 -0
  871. package/docs/fields/object.md +91 -0
  872. package/docs/fields/path.md +105 -0
  873. package/docs/fields/rich-text.md +236 -0
  874. package/docs/fields/select.md +99 -0
  875. package/docs/fields/tabs.md +87 -0
  876. package/docs/fields/text.md +46 -0
  877. package/docs/fields/url.md +51 -0
  878. package/docs/fields.md +231 -0
  879. package/docs/get-started.md +3 -0
  880. package/docs/guides.md +3 -0
  881. package/docs/index.md +138 -0
  882. package/docs/instant-publishing.md +43 -0
  883. package/docs/internationalization.md +201 -0
  884. package/docs/introduction.md +5 -0
  885. package/docs/live-previews.md +151 -0
  886. package/docs/mcp.md +500 -0
  887. package/docs/overviews.md +456 -0
  888. package/docs/query/advanced.md +123 -0
  889. package/docs/query/examples.md +231 -0
  890. package/docs/query/filtering.md +160 -0
  891. package/docs/query/related.md +129 -0
  892. package/docs/query/structural.md +164 -0
  893. package/docs/query.md +139 -0
  894. package/docs/quickstart.md +203 -0
  895. package/docs/reference.md +3 -0
  896. package/docs/roles-permissions.md +234 -0
  897. package/docs/schema/document.md +98 -0
  898. package/docs/schema/type.md +131 -0
  899. package/docs/schema.md +66 -0
  900. package/docs/tutorial/step-1-landing-page.md +244 -0
  901. package/docs/tutorial/step-2-block-list.md +364 -0
  902. package/docs/tutorial/step-3-layout-root.md +200 -0
  903. package/docs/tutorial/step-4-blog.md +384 -0
  904. package/docs/tutorial/step-5-catch-all.md +222 -0
  905. package/docs/tutorial.md +21 -0
  906. package/docs/typescript.md +115 -0
  907. package/docs/upgrading.md +286 -0
  908. package/docs/workspaces/media.md +48 -0
  909. package/docs/workspaces/root.md +127 -0
  910. package/docs/workspaces.md +98 -0
  911. package/llms-full.txt +11973 -3202
  912. package/package.json +35 -7
  913. package/readme.md +136 -55
  914. package/dist/backend/store/GeneratedSource.d.ts +0 -2
  915. package/dist/backend/store/GeneratedSource.js +0 -21
  916. package/dist/chunks/chunk-AC4U3IMS.js +0 -205
  917. package/dist/chunks/chunk-G6E35DMJ.js +0 -1997
  918. package/dist/chunks/chunk-JFROOUG6.js +0 -6363
  919. package/dist/chunks/chunk-LUBOGJCG.js +0 -129
  920. package/dist/chunks/chunk-SJBZFMQ2.js +0 -2966
  921. package/dist/chunks/chunk-STAJCW4Z.js +0 -322
  922. package/dist/chunks/chunk-U4VOHNR2.js +0 -210
  923. package/dist/chunks/chunk-YK3OSMDM.js +0 -5473
  924. package/dist/components/Disclosure.d.ts +0 -5
  925. package/dist/components/Disclosure.js +0 -106
  926. package/dist/components/Label.d.ts +0 -48
  927. package/dist/components/Label.js +0 -210
  928. package/dist/components/Menu.d.ts +0 -16
  929. package/dist/components/Menu.js +0 -95
  930. package/dist/components/Modal.d.ts +0 -7
  931. package/dist/components/Modal.js +0 -58
  932. package/dist/components/ProgressCircle.d.ts +0 -6
  933. package/dist/components/ProgressCircle.js +0 -96
  934. package/dist/core/db/EntryDB.d.ts +0 -19
  935. package/dist/core/db/EntryDB.js +0 -48
  936. package/dist/core/db/EntryIndex.d.ts +0 -130
  937. package/dist/core/db/EntryIndex.js +0 -2610
  938. package/dist/core/db/EntryReferenceIndex.d.ts +0 -21
  939. package/dist/core/db/EntryReferenceIndex.js +0 -131
  940. package/dist/core/db/EntryResolver.d.ts +0 -56
  941. package/dist/core/db/EntryResolver.js +0 -624
  942. package/dist/core/db/EntryTarget.d.ts +0 -5
  943. package/dist/core/db/EntryTransaction.d.ts +0 -32
  944. package/dist/core/db/EntryTransaction.js +0 -941
  945. package/dist/core/db/LocalDB.d.ts +0 -43
  946. package/dist/core/db/LocalDB.js +0 -122
  947. package/dist/core/db/TestDB.d.ts +0 -19
  948. package/dist/core/db/TestDB.js +0 -50
  949. package/dist/dashboard/app/AppShell.d.ts +0 -4
  950. package/dist/dashboard/app/AppShell.js +0 -29
  951. package/dist/dashboard/app/Badge.d.ts +0 -8
  952. package/dist/dashboard/app/Badge.js +0 -42
  953. package/dist/dashboard/app/EditorBackButton.d.ts +0 -5
  954. package/dist/dashboard/app/EditorBackButton.js +0 -33
  955. package/dist/dashboard/app/EntrySidebarPreview.spec.d.ts +0 -1
  956. package/dist/dashboard/app/ExplorerFileCard.d.ts +0 -10
  957. package/dist/dashboard/app/ExplorerFileCard.js +0 -115
  958. package/dist/dashboard/app/StatusBadge.d.ts +0 -6
  959. package/dist/dashboard/app/StatusBadge.js +0 -26
  960. package/dist/dashboard/app/WorkspaceMenu.spec.d.ts +0 -1
  961. package/dist/dashboard/app/WorkspaceMenu.stories.d.ts +0 -5
  962. package/dist/dashboard/app/ui/Rail.d.ts +0 -18
  963. package/dist/dashboard/app/ui/Rail.js +0 -41
  964. package/dist/dashboard/app/ui/Sidebar.d.ts +0 -15
  965. package/dist/dashboard/app/ui/Sidebar.js +0 -55
  966. package/dist/field/link/LinkField.spec.d.ts +0 -1
  967. package/dist/field/link/LinkField.stories.d.ts +0 -15
  968. package/dist/field/list/ListField.spec.d.ts +0 -1
  969. package/dist/field/list/ListField.stories.d.ts +0 -6
  970. package/dist/field/richtext/RichTextField.spec.d.ts +0 -1
  971. /package/dist/{core/db/EntryTarget.js → .init-pm/bun.lock} +0 -0
@@ -1,941 +0,0 @@
1
- import "../../chunks/chunk-CQ52GEHY.js";
2
-
3
- // src/core/db/EntryTransaction.ts
4
- import { Config } from "alinea/core/Config";
5
- import { createRecord } from "alinea/core/EntryRecord";
6
- import { Field } from "alinea/core/Field";
7
- import { createId } from "alinea/core/Id";
8
- import { getRoot } from "alinea/core/Internal";
9
- import { ListRow } from "alinea/core/ListRow";
10
- import { Type } from "alinea/core/Type";
11
- import { ListEditor } from "alinea/core/field/ListField";
12
- import { MediaLocation } from "alinea/core/media/MediaLocation";
13
- import { entryUrl, pathSuffix } from "alinea/core/util/EntryFilenames";
14
- import {
15
- generateKeyBetween,
16
- generateNKeysBetween,
17
- isValidOrderKey
18
- } from "alinea/core/util/FractionalIndexing";
19
- import { entries, fromEntries, isRecord, keys } from "alinea/core/util/Objects";
20
- import * as paths from "alinea/core/util/Paths";
21
- import { slugify } from "alinea/core/util/Slugs";
22
- import { unreachable } from "alinea/core/util/Types";
23
- import { Permission, Policy } from "../Role.js";
24
- import { ShaMismatchError } from "../source/ShaMismatchError.js";
25
- import { SourceTransaction } from "../source/Source.js";
26
- import { assert } from "../util/Assert.js";
27
- import { commitChanges } from "./CommitRequest.js";
28
- import { aliasesFromData, aliasUrl } from "./EntryAliases.js";
29
- import { EntryUrlConflictError } from "./EntryUrlConflictError.js";
30
- var EntryTransaction = class {
31
- #checks = [];
32
- #messages = [];
33
- #config;
34
- #index;
35
- #tx;
36
- #fileChanges = [];
37
- #policy;
38
- #urlClaims;
39
- constructor(config, index, source, from, policy = Policy.ALLOW_ALL) {
40
- if (index.sha !== from.sha) throw new ShaMismatchError(index.sha, from.sha);
41
- this.#config = config;
42
- this.#index = index;
43
- this.#tx = new SourceTransaction(source, from);
44
- this.#policy = policy;
45
- }
46
- get empty() {
47
- return this.#messages.length === 0;
48
- }
49
- create({
50
- locale,
51
- type,
52
- data,
53
- root,
54
- workspace,
55
- fromSeed,
56
- parentId = null,
57
- id = createId(),
58
- insertOrder = "last",
59
- status = "published",
60
- overwrite = false
61
- }) {
62
- const config = this.#config;
63
- const index = this.#index;
64
- const existing = index.byId(id);
65
- if (existing) {
66
- parentId = existing.parentId;
67
- if (!workspace) workspace = existing.workspace;
68
- if (!root) root = existing.root;
69
- assert(
70
- existing.workspace === workspace,
71
- `Cannot create entry with id ${id} in workspace ${workspace}, already exists in ${existing.workspace}`
72
- );
73
- assert(
74
- existing.root === root,
75
- `Cannot create entry with id ${id} in root ${root}, already exists in ${existing.root}`
76
- );
77
- }
78
- const workspaces = keys(config.workspaces);
79
- if (!workspace) workspace = workspaces[0];
80
- assert(
81
- workspace in config.workspaces,
82
- `Workspace "${workspace}" not found in config`
83
- );
84
- const roots = keys(config.workspaces[workspace]);
85
- if (!root) root = roots[0];
86
- assert(
87
- root in config.workspaces[workspace],
88
- `Root "${root}" not found in workspace "${workspace}"`
89
- );
90
- const rootConfig = this.#config.workspaces[workspace][root];
91
- assert(rootConfig, "Invalid root");
92
- this.#policy.assert(Permission.Create, {
93
- workspace,
94
- root,
95
- type
96
- });
97
- const i18n = getRoot(rootConfig).i18n;
98
- if (i18n) assert(i18n.locales.includes(locale), "Invalid locale");
99
- else assert(locale === null, "Invalid locale");
100
- let parent;
101
- if (parentId) {
102
- parent = index.findFirst((entry) => {
103
- return entry.id === parentId && entry.locale === locale && entry.main;
104
- });
105
- assert(parent, `Parent not found: ${parentId}`);
106
- this.#checks.push([parent.filePath, parent.fileHash]);
107
- this.#policy.assert(Permission.Create, parent);
108
- }
109
- const siblings = Array.from(
110
- index.findMany((entry) => {
111
- return entry.root === root && entry.workspace === workspace && entry.parentId === parentId;
112
- })
113
- );
114
- assert(typeof data === "object", "Invalid data");
115
- const title = data.title ?? data.path;
116
- assert(typeof title === "string", "Missing title");
117
- let path = slugify(typeof data.path === "string" ? data.path : title);
118
- assert(path.length > 0, "Invalid path");
119
- const existingPath = existing?.get(locale)?.path;
120
- const hasSamePath = existingPath === path;
121
- if (!hasSamePath)
122
- path = this.#getAvailablePath({
123
- id,
124
- path,
125
- parentId,
126
- root,
127
- workspace,
128
- locale
129
- });
130
- if (status !== "published" && existingPath) path = existingPath;
131
- if (existingPath && !hasSamePath && status === "published") {
132
- this.#rename(existing.id, locale, path);
133
- }
134
- if (overwrite && existing?.type === "MediaFile") {
135
- const prev = existing.get(null)?.main;
136
- assert(prev, "Previous entry not found");
137
- const prevLocation = prev.data.location;
138
- if (prevLocation !== data.location)
139
- this.removeFile({
140
- location: MediaLocation.storagePath(
141
- this.#config,
142
- prev.workspace,
143
- prev.data.location
144
- )
145
- });
146
- }
147
- const parentDir = parent ? parent.childrenDir : Config.filePath(this.#config, workspace, root, locale);
148
- const filePath = paths.join(
149
- parentDir,
150
- `${path}${status === "published" ? "" : `.${status}`}.json`
151
- );
152
- const hasSameVersion = existing?.get(locale)?.has(status);
153
- const warnDuplicate = !overwrite && hasSameVersion;
154
- assert(!warnDuplicate, `Cannot create duplicate entry with id ${id}`);
155
- let newIndex;
156
- if (existing) {
157
- newIndex = existing.index;
158
- if (status === "published") {
159
- const versions = index.byId(id)?.get(locale);
160
- if (versions)
161
- for (const [status2, version] of versions) {
162
- this.#tx.remove(version.filePath);
163
- }
164
- }
165
- } else {
166
- const previous = insertOrder === "first" ? null : siblings.at(-1) ?? null;
167
- const next = insertOrder === "last" ? null : siblings.at(0) ?? null;
168
- newIndex = generateKeyBetween(
169
- previous?.index ?? null,
170
- next?.index ?? null
171
- );
172
- }
173
- if (locale !== null && status === "published") {
174
- const from = index.findFirst((entry) => {
175
- return entry.id === id && entry.locale !== locale && entry.status === "published";
176
- });
177
- if (from) {
178
- const typeInstance = this.#config.schema[type];
179
- assert(typeInstance, `Type not found: ${type}`);
180
- const shared = Type.sharedData(typeInstance, from.data);
181
- data = { ...shared, ...data };
182
- }
183
- }
184
- if (status === "published") {
185
- const urlCandidate = {
186
- id,
187
- type,
188
- path,
189
- parentId,
190
- workspace,
191
- root,
192
- locale,
193
- data
194
- };
195
- data = this.#dataWithPreviousUrlAlias(
196
- urlCandidate,
197
- this.#publishedEntry(id, locale)
198
- );
199
- if (locale !== null) this.#persistSharedFields(id, locale, type, data);
200
- this.#assertUniqueUrls({ ...urlCandidate, data });
201
- }
202
- const seeds = existing?.get(locale);
203
- const seeded = fromSeed ?? seeds?.seeded ?? null;
204
- const record = createRecord(
205
- { id, type, index: newIndex, path, seeded, data, title },
206
- status
207
- );
208
- const contents = new TextEncoder().encode(JSON.stringify(record, null, 2));
209
- this.#tx.add(filePath, contents);
210
- this.#messages.push(this.#reportOp("create", title));
211
- return this;
212
- }
213
- #rename(entryId, locale, path) {
214
- const index = this.#index;
215
- const versions = index.findMany((entry) => {
216
- return entry.id === entryId && entry.locale === locale;
217
- });
218
- for (const version of versions) {
219
- const name = version.status === "published" ? path : `${path}.${version.status}`;
220
- const filePath = paths.join(version.parentDir, `${name}.json`);
221
- this.#tx.rename(version.filePath, filePath);
222
- const childrenDir = paths.join(version.parentDir, path);
223
- this.#tx.rename(version.childrenDir, childrenDir);
224
- }
225
- }
226
- update({ id, locale, status, set }) {
227
- const index = this.#index;
228
- const entry = index.findFirst((entry2) => {
229
- return entry2.id === id && entry2.locale === locale && entry2.status === status;
230
- });
231
- assert(entry, `Entry not found: ${id}`);
232
- this.#policy.assert(Permission.Update, entry);
233
- for (const key of keys(set)) {
234
- this.#policy.assert(Permission.Update, {
235
- workspace: entry.workspace,
236
- root: entry.root,
237
- type: entry.type,
238
- id: entry.id,
239
- parents: entry.parents,
240
- locale: entry.locale,
241
- field: key
242
- });
243
- }
244
- const fieldUpdates = fromEntries(
245
- entries(set).map(([key, value]) => {
246
- return [key, value ?? null];
247
- })
248
- );
249
- let data = { ...entry.data, ...fieldUpdates };
250
- const desiredPath = slugify(
251
- data.path ?? entry.data.path ?? entry.path
252
- );
253
- const lockPath = entry.status !== "published" && !entry.main;
254
- const path = lockPath ? entry.path : this.#getAvailablePath({
255
- id,
256
- path: desiredPath,
257
- parentId: entry.parentId,
258
- root: entry.root,
259
- workspace: entry.workspace,
260
- locale
261
- });
262
- this.#checks.push([entry.filePath, entry.fileHash]);
263
- const childrenDir = paths.join(entry.parentDir, path);
264
- const filePath = `${childrenDir}${entry.status === "published" ? "" : `.${entry.status}`}.json`;
265
- if (entry.status === "published") {
266
- this.#policy.assert(Permission.Publish, entry);
267
- if (filePath !== entry.filePath) this.#rename(id, locale, path);
268
- const urlCandidate = {
269
- id,
270
- type: entry.type,
271
- path,
272
- parentId: entry.parentId,
273
- root: entry.root,
274
- workspace: entry.workspace,
275
- locale,
276
- data
277
- };
278
- data = this.#dataWithPreviousUrlAlias(urlCandidate, entry);
279
- if (locale !== null)
280
- this.#persistSharedFields(id, locale, entry.type, data);
281
- this.#assertUniqueUrls({ ...urlCandidate, data });
282
- }
283
- const record = createRecord(
284
- {
285
- id,
286
- type: entry.type,
287
- index: entry.index,
288
- path: entry.path,
289
- seeded: entry.seeded,
290
- data
291
- },
292
- status
293
- );
294
- if (entry.status !== "published" && path !== entry.path) record.path = path;
295
- const contents = new TextEncoder().encode(JSON.stringify(record, null, 2));
296
- this.#tx.add(filePath, contents);
297
- this.#messages.push(this.#reportOp("update", entry.title));
298
- return this;
299
- }
300
- #getAvailablePath(target) {
301
- const conflictingPaths = Array.from(
302
- this.#index.findMany((entry) => {
303
- return entry.id !== target.id && entry.parentId === target.parentId && entry.workspace === target.workspace && entry.root === target.root && entry.locale === target.locale && (entry.path === target.path || entry.path.startsWith(`${target.path}-`));
304
- })
305
- ).map((entry) => entry.path);
306
- const suffix = pathSuffix(target.path, conflictingPaths);
307
- if (suffix !== void 0) return `${target.path}-${suffix}`;
308
- return target.path;
309
- }
310
- #assertUniqueUrls(candidate) {
311
- const claims = this.#getUrlClaims();
312
- const urls = this.#candidateUrls(candidate);
313
- for (const url of urls) {
314
- const key = this.#urlClaimKey(candidate.workspace, candidate.root, url);
315
- const existing = claims.get(key);
316
- if (existing && existing.id !== candidate.id) {
317
- throw new EntryUrlConflictError({
318
- url,
319
- entryId: existing.id,
320
- workspace: candidate.workspace,
321
- root: candidate.root
322
- });
323
- }
324
- }
325
- for (const [key, claim] of claims) {
326
- if (claim.id === candidate.id) claims.delete(key);
327
- }
328
- for (const url of urls) {
329
- claims.set(this.#urlClaimKey(candidate.workspace, candidate.root, url), {
330
- id: candidate.id,
331
- url
332
- });
333
- }
334
- }
335
- #candidateUrls(candidate) {
336
- return [this.#resolvedUrl(candidate), ...aliasUrlsFromData(candidate.data)];
337
- }
338
- #resolvedUrl(candidate) {
339
- const type = this.#config.schema[candidate.type];
340
- assert(type, `Type not found: ${candidate.type}`);
341
- if (candidate.url !== void 0) return candidate.url;
342
- return entryUrl(type, {
343
- config: this.#config,
344
- path: candidate.path,
345
- parentPaths: candidate.parentPaths ?? this.#parentPaths(candidate.parentId, candidate.locale),
346
- locale: candidate.locale,
347
- status: "published",
348
- workspace: candidate.workspace,
349
- root: candidate.root,
350
- data: candidate.data
351
- });
352
- }
353
- #dataWithPreviousUrlAlias(candidate, previousEntry) {
354
- if (!previousEntry) return candidate.data;
355
- const previousUrl = this.#resolvedUrl(previousEntry);
356
- const currentUrl = this.#resolvedUrl(candidate);
357
- if (previousUrl === currentUrl) return candidate.data;
358
- const type = this.#config.schema[candidate.type];
359
- assert(type, `Type not found: ${candidate.type}`);
360
- return dataWithUrlAlias(type, candidate.data, previousUrl, currentUrl);
361
- }
362
- #publishedEntry(id, locale) {
363
- return this.#index.findFirst((entry) => {
364
- return entry.id === id && entry.locale === locale && entry.status === "published";
365
- });
366
- }
367
- #parentPaths(parentId, locale) {
368
- const result = Array();
369
- let current = parentId ? this.#index.byId(parentId) : void 0;
370
- while (current) {
371
- const language = current.get(locale);
372
- assert(language, `Missing parent language node`);
373
- result.unshift(language.main.path);
374
- current = current.parent ?? void 0;
375
- }
376
- return result;
377
- }
378
- #getUrlClaims() {
379
- if (this.#urlClaims) return this.#urlClaims;
380
- const claims = /* @__PURE__ */ new Map();
381
- for (const entry of this.#index.findMany((entry2) => {
382
- return entry2.status === "published";
383
- })) {
384
- for (const url of [
385
- this.#resolvedUrl(entry),
386
- ...aliasUrlsFromData(entry.data)
387
- ]) {
388
- claims.set(this.#urlClaimKey(entry.workspace, entry.root, url), {
389
- id: entry.id,
390
- url
391
- });
392
- }
393
- }
394
- this.#urlClaims = claims;
395
- return claims;
396
- }
397
- #urlClaimKey(workspace, root, url) {
398
- return `${workspace}\0${root}\0${url}`;
399
- }
400
- #persistSharedFields(id, locale, type, data) {
401
- const index = this.#index;
402
- const typeInstance = this.#config.schema[type];
403
- assert(type, `Type not found: ${type}`);
404
- const shared = Type.sharedData(typeInstance, data);
405
- if (shared) {
406
- const translations = index.findMany((entry) => {
407
- return entry.id === id && entry.locale !== locale;
408
- });
409
- for (const translation of translations) {
410
- this.#checks.push([translation.filePath, translation.fileHash]);
411
- const record = createRecord(
412
- {
413
- id,
414
- type: translation.type,
415
- index: translation.index,
416
- path: translation.path,
417
- seeded: translation.seeded,
418
- data: {
419
- ...translation.data,
420
- ...shared
421
- }
422
- },
423
- translation.status
424
- );
425
- const contents = new TextEncoder().encode(
426
- JSON.stringify(record, null, 2)
427
- );
428
- this.#tx.add(translation.filePath, contents);
429
- }
430
- }
431
- }
432
- #moveUrlAliasUpdates(target) {
433
- const updates = Array();
434
- for (const entry of this.#index.findMany((entry2) => {
435
- return entry2.status === "published" && (entry2.id === target.id || entry2.parents.includes(target.id));
436
- })) {
437
- const parentPaths = this.#movedParentPaths(entry, target);
438
- const candidate = {
439
- id: entry.id,
440
- type: entry.type,
441
- path: entry.path,
442
- parentId: entry.id === target.id ? target.parentId : entry.parentId,
443
- parentPaths,
444
- workspace: target.workspace,
445
- root: target.root,
446
- locale: entry.locale,
447
- data: entry.data
448
- };
449
- const data = this.#dataWithPreviousUrlAlias(candidate, entry);
450
- this.#assertUniqueUrls({ ...candidate, data });
451
- updates.push({
452
- entry,
453
- data,
454
- filePath: this.#movedFilePath(entry, target)
455
- });
456
- }
457
- return updates;
458
- }
459
- #movedParentPaths(entry, target) {
460
- const moved = this.#index.byId(target.id);
461
- assert(moved, `Entry not found: ${target.id}`);
462
- const movedLanguage = moved.get(entry.locale);
463
- assert(movedLanguage, `Missing moved entry language node`);
464
- const newParentPaths = this.#parentPaths(target.parentId, entry.locale);
465
- if (entry.id === target.id) return newParentPaths;
466
- const currentParentPaths = this.#parentPaths(entry.parentId, entry.locale);
467
- const oldPrefix = this.#parentPaths(moved.parentId, entry.locale).concat(
468
- movedLanguage.main.path
469
- );
470
- const newPrefix = newParentPaths.concat(movedLanguage.main.path);
471
- assert(
472
- startsWithSegments(currentParentPaths, oldPrefix),
473
- `Moved child is outside moved entry path`
474
- );
475
- return newPrefix.concat(currentParentPaths.slice(oldPrefix.length));
476
- }
477
- #movedFilePath(entry, target) {
478
- const moved = this.#index.byId(target.id);
479
- assert(moved, `Entry not found: ${target.id}`);
480
- const movedLanguage = moved.get(entry.locale);
481
- assert(movedLanguage, `Missing moved entry language node`);
482
- const parent = target.parentId ? this.#index.findFirst((parentEntry) => {
483
- return parentEntry.id === target.parentId && parentEntry.locale === entry.locale;
484
- }) : void 0;
485
- const parentDir = parent ? parent.childrenDir : Config.filePath(
486
- this.#config,
487
- target.workspace,
488
- target.root,
489
- entry.locale
490
- );
491
- const nextPrefix = paths.join(parentDir, movedLanguage.main.path);
492
- if (entry.id === target.id) {
493
- return `${nextPrefix}${entry.status === "published" ? "" : `.${entry.status}`}.json`;
494
- }
495
- const previousPrefix = movedLanguage.main.childrenDir;
496
- assert(
497
- entry.filePath === previousPrefix || entry.filePath.startsWith(`${previousPrefix}/`),
498
- `Moved child file is outside moved entry directory`
499
- );
500
- const suffix = entry.filePath.slice(previousPrefix.length).replace(/^\//, "");
501
- return paths.join(nextPrefix, suffix);
502
- }
503
- publish({ id, locale, status }) {
504
- const index = this.#index;
505
- const entry = index.findFirst((entry2) => {
506
- return entry2.id === id && entry2.locale === locale && entry2.status === status;
507
- });
508
- assert(entry, `Entry not found: ${id}`);
509
- this.#policy.assert(Permission.Publish, entry);
510
- const pathChange = entry.data.path && entry.data.path !== entry.path;
511
- let path = slugify(entry.data.path ?? entry.path);
512
- let data = entry.data;
513
- path = this.#getAvailablePath({
514
- id,
515
- path,
516
- parentId: entry.parentId,
517
- root: entry.root,
518
- workspace: entry.workspace,
519
- locale
520
- });
521
- const childrenDir = paths.join(entry.parentDir, path);
522
- const urlCandidate = {
523
- id,
524
- type: entry.type,
525
- path,
526
- parentId: entry.parentId,
527
- root: entry.root,
528
- workspace: entry.workspace,
529
- locale,
530
- data
531
- };
532
- data = this.#dataWithPreviousUrlAlias(
533
- urlCandidate,
534
- this.#publishedEntry(id, locale)
535
- );
536
- if (entry.locale !== null)
537
- this.#persistSharedFields(id, entry.locale, entry.type, data);
538
- this.#assertUniqueUrls({ ...urlCandidate, data });
539
- const versions = index.byId(id)?.get(locale);
540
- if (versions)
541
- for (const [_, version] of versions) {
542
- this.#tx.remove(version.filePath);
543
- }
544
- this.#checks.push([entry.filePath, entry.fileHash]);
545
- this.#tx.remove(entry.filePath);
546
- const record = createRecord({ ...entry, path, data }, "published");
547
- const contents = new TextEncoder().encode(JSON.stringify(record, null, 2));
548
- if (pathChange) {
549
- this.#tx.remove(`${entry.parentDir}/${entry.path}.json`);
550
- this.#tx.rename(entry.childrenDir, childrenDir);
551
- }
552
- this.#tx.add(`${childrenDir}.json`, contents);
553
- this.#messages.push(this.#reportOp("publish", entry.title));
554
- return this;
555
- }
556
- unpublish({ id, locale }) {
557
- const index = this.#index;
558
- const versions = index.byId(id)?.get(locale);
559
- const mainEntry = versions?.main;
560
- assert(mainEntry, `Entry not found: ${id}`);
561
- this.#policy.assert(Permission.Publish, mainEntry);
562
- for (const [_, version] of versions) {
563
- if (version === mainEntry) continue;
564
- this.#tx.remove(version.filePath);
565
- }
566
- this.#checks.push([mainEntry.filePath, mainEntry.fileHash]);
567
- this.#tx.rename(mainEntry.filePath, `${mainEntry.childrenDir}.draft.json`);
568
- this.#messages.push(this.#reportOp("unpublish", mainEntry.title));
569
- return this;
570
- }
571
- archive({ id, locale }) {
572
- const index = this.#index;
573
- const versions = index.byId(id)?.get(locale);
574
- const mainEntry = versions?.main;
575
- assert(mainEntry, `Entry not found: ${id}`);
576
- this.#policy.assert(Permission.Archive, mainEntry);
577
- for (const [_, version] of versions) {
578
- if (version === mainEntry) continue;
579
- this.#tx.remove(version.filePath);
580
- }
581
- this.#checks.push([mainEntry.filePath, mainEntry.fileHash]);
582
- this.#tx.rename(
583
- mainEntry.filePath,
584
- `${mainEntry.childrenDir}.archived.json`
585
- );
586
- this.#messages.push(this.#reportOp("archive", mainEntry.title));
587
- return this;
588
- }
589
- move({ id, target, dropPosition, targetType }) {
590
- const index = this.#index;
591
- targetType ??= "entry";
592
- const entries2 = Array.from(index.findMany((entry) => entry.id === id));
593
- assert(entries2.length > 0, `Entry not found: ${id}`);
594
- const targetEntry = targetType === "root" ? void 0 : index.findFirst((entry) => {
595
- return entry.id === target;
596
- });
597
- assert(targetType === "root" || targetEntry, `Target not found: ${target}`);
598
- assert(
599
- targetType === "entry" || dropPosition === "on",
600
- `Cannot move ${dropPosition} root ${target}`
601
- );
602
- const parentId = targetType === "root" ? null : dropPosition === "on" ? target : targetEntry?.parentId ?? null;
603
- const root = targetType === "root" ? target : targetEntry?.root ?? entries2[0].root;
604
- const workspace = targetEntry?.workspace ?? entries2[0].workspace;
605
- const action = parentId !== entries2[0].parentId || root !== entries2[0].root ? Permission.Move : Permission.Reorder;
606
- for (const entry of entries2) this.#policy.assert(action, entry);
607
- if (action === Permission.Move && parentId === null) {
608
- this.#policy.assert(Permission.Move, { workspace, root });
609
- }
610
- const siblingList = Array.from(
611
- index.findMany((entry) => {
612
- return entry.workspace === workspace && entry.root === root && entry.parentId === parentId && entry.id !== id;
613
- })
614
- );
615
- let insertIndex = siblingList.length;
616
- if (targetType !== "root") {
617
- const targetIndex = siblingList.findIndex((entry) => entry.id === target);
618
- if (dropPosition === "before") {
619
- assert(targetIndex >= 0, `Sibling not found: ${target}`);
620
- insertIndex = targetIndex;
621
- } else if (dropPosition === "after") {
622
- assert(targetIndex >= 0, `Sibling not found: ${target}`);
623
- insertIndex = targetIndex + 1;
624
- }
625
- }
626
- const previous = siblingList[insertIndex - 1] ?? null;
627
- const next = siblingList[insertIndex] ?? null;
628
- const seen = /* @__PURE__ */ new Set();
629
- const hasDuplicates = siblingList.some((entry) => {
630
- const wasSeen = seen.has(entry.index);
631
- if (wasSeen) return true;
632
- seen.add(entry.index);
633
- return false;
634
- });
635
- let newIndex;
636
- if (hasDuplicates) {
637
- const self = index.findFirst((entry) => entry.id === id);
638
- assert(self, `Entry not found: ${id}`);
639
- siblingList.splice(insertIndex, 0, self);
640
- for (const sibling of siblingList) {
641
- this.#policy.assert(Permission.Reorder, sibling);
642
- }
643
- const newKeys = generateNKeysBetween(null, null, siblingList.length);
644
- for (const [i, key] of newKeys.entries()) {
645
- const id2 = siblingList[i].id;
646
- const node = index.byId(id2);
647
- assert(node);
648
- for (const locale of node.keys()) {
649
- for (const [_, version] of node.get(locale)) {
650
- const record = createRecord(
651
- {
652
- id: id2,
653
- type: version.type,
654
- index: key,
655
- path: version.path,
656
- seeded: version.seeded,
657
- data: version.data
658
- },
659
- version.status
660
- );
661
- const contents = new TextEncoder().encode(
662
- JSON.stringify(record, null, 2)
663
- );
664
- this.#tx.add(version.filePath, contents);
665
- }
666
- }
667
- }
668
- newIndex = newKeys[insertIndex];
669
- } else {
670
- newIndex = generateKeyBetween(
671
- previous?.index ?? null,
672
- next?.index ?? null
673
- );
674
- }
675
- const moveUrlAliasUpdates = action === Permission.Move ? this.#moveUrlAliasUpdates({ id, parentId, workspace, root }) : [];
676
- const moveUrlAliasData = new Map(
677
- moveUrlAliasUpdates.map((update) => [update.entry.filePath, update.data])
678
- );
679
- let info;
680
- for (const entry of entries2) {
681
- info = entry;
682
- const parent = parentId ? index.findFirst((e) => {
683
- return e.id === parentId && e.locale === entry.locale;
684
- }) : void 0;
685
- if (action === Permission.Move && parentId) {
686
- assert(!entry.seeded, `Cannot move seeded entry ${entry.filePath}`);
687
- assert(parent, `Parent not found: ${parentId}`);
688
- this.#policy.assert(Permission.Move, parent);
689
- assert(
690
- !parent?.childrenDir.startsWith(entry.childrenDir),
691
- "Cannot move entry into its own children"
692
- );
693
- const parentType = this.#config.schema[parent.type];
694
- const childType = this.#config.schema[entry.type];
695
- const allowed = Config.typeContains(this.#config, parentType, childType);
696
- assert(
697
- allowed,
698
- `Parent of type ${parent.type} does not allow children of type ${entry.type}`
699
- );
700
- }
701
- const parentDir = parent ? parent.childrenDir : Config.filePath(this.#config, workspace, root, entry.locale);
702
- const childrenDir = paths.join(parentDir, entry.path);
703
- const filePath = `${childrenDir}${entry.status === "published" ? "" : `.${entry.status}`}.json`;
704
- const data = moveUrlAliasData.get(entry.filePath) ?? entry.data;
705
- const record = createRecord(
706
- {
707
- id,
708
- type: entry.type,
709
- index: newIndex,
710
- path: entry.path,
711
- seeded: entry.seeded,
712
- root,
713
- workspace,
714
- parentId,
715
- data
716
- },
717
- entry.status
718
- );
719
- const contents = new TextEncoder().encode(JSON.stringify(record, null, 2));
720
- if (action === Permission.Move) {
721
- this.#tx.remove(entry.filePath);
722
- this.#tx.rename(entry.childrenDir, childrenDir);
723
- }
724
- this.#tx.add(filePath, contents);
725
- }
726
- for (const update of moveUrlAliasUpdates) {
727
- const entry = update.entry;
728
- if (entry.id === id || update.data === entry.data) continue;
729
- const record = createRecord(
730
- {
731
- ...entry,
732
- root,
733
- workspace,
734
- data: update.data
735
- },
736
- entry.status
737
- );
738
- const contents = new TextEncoder().encode(JSON.stringify(record, null, 2));
739
- this.#tx.add(update.filePath, contents);
740
- }
741
- this.#messages.push(this.#reportOp("move", info.title));
742
- return this;
743
- }
744
- remove({ id, locale, status }) {
745
- const index = this.#index;
746
- const entries2 = index.findMany((entry) => {
747
- const matchesStatus = status === void 0 || entry.status === status;
748
- const matchesLocale = locale === void 0 || entry.locale === locale;
749
- return entry.id === id && matchesLocale && matchesStatus;
750
- });
751
- let info;
752
- for (const entry of entries2) {
753
- if (entry.status === "published")
754
- assert(!entry.seeded, `Cannot remove seeded entry ${entry.filePath}`);
755
- info = entry;
756
- this.#checks.push([entry.filePath, entry.fileHash]);
757
- this.#tx.remove(entry.filePath);
758
- if (entry.status !== "draft") {
759
- this.#tx.remove(entry.childrenDir);
760
- }
761
- if (entry.type === "MediaLibrary") {
762
- const files = index.findMany((f) => {
763
- return f.workspace === entry.workspace && f.root === entry.root && f.filePath.startsWith(entry.childrenDir) && f.type === "MediaFile";
764
- });
765
- for (const file of files) {
766
- this.removeFile({
767
- location: MediaLocation.storagePath(
768
- this.#config,
769
- entry.workspace,
770
- file.data.location
771
- )
772
- });
773
- }
774
- }
775
- if (entry.type === "MediaFile") {
776
- this.removeFile({
777
- location: MediaLocation.storagePath(
778
- this.#config,
779
- entry.workspace,
780
- entry.data.location
781
- )
782
- });
783
- }
784
- }
785
- if (info) {
786
- this.#policy.assert(Permission.Delete, info);
787
- this.#messages.unshift(this.#reportOp("remove", info.title));
788
- }
789
- return this;
790
- }
791
- removeFile(mutation) {
792
- this.#policy.assert(Permission.Delete);
793
- assert(mutation.location, "Missing location");
794
- this.#messages.push(this.#reportOp("remove", mutation.location));
795
- this.#fileChanges.push({ op: "removeFile", ...mutation });
796
- return this;
797
- }
798
- uploadFile(mutation) {
799
- this.#policy.assert(Permission.Upload);
800
- this.#fileChanges.push({ op: "uploadFile", ...mutation });
801
- return this;
802
- }
803
- description() {
804
- return this.#messages.map((message, index, all) => {
805
- if (index > 0) return message;
806
- const suffix = all.length > 1 ? ` (and ${all.length - 1} other edits)` : "";
807
- return `${message + suffix}`;
808
- }).join("\n");
809
- }
810
- #reportOp(op, title) {
811
- return `(${op}) ${title}`;
812
- }
813
- apply(mutations) {
814
- for (const mutation of mutations) {
815
- switch (mutation.op) {
816
- case "create":
817
- this.create(mutation);
818
- break;
819
- case "update":
820
- this.update(mutation);
821
- break;
822
- case "publish":
823
- this.publish(mutation);
824
- break;
825
- case "unpublish":
826
- this.unpublish(mutation);
827
- break;
828
- case "archive":
829
- this.archive(mutation);
830
- break;
831
- case "move":
832
- this.move(mutation);
833
- break;
834
- case "remove":
835
- this.remove(mutation);
836
- break;
837
- case "removeFile":
838
- this.removeFile(mutation);
839
- break;
840
- case "uploadFile":
841
- this.uploadFile(mutation);
842
- break;
843
- default:
844
- unreachable(mutation);
845
- }
846
- }
847
- }
848
- async toRequest() {
849
- const { from, into, changes } = await this.#tx.compile();
850
- return {
851
- fromSha: from.sha,
852
- intoSha: into.sha,
853
- description: this.description(),
854
- checks: this.#checks,
855
- changes: this.#fileChanges.concat(commitChanges(changes))
856
- };
857
- }
858
- };
859
- function aliasUrlsFromData(data) {
860
- const result = /* @__PURE__ */ new Set();
861
- for (const alias of aliasesFromData(data) ?? []) {
862
- const url = aliasUrl(alias);
863
- if (url) result.add(url);
864
- }
865
- return Array.from(result);
866
- }
867
- function dataWithUrlAlias(type, data, previousUrl, currentUrl) {
868
- const target = typeAliasTarget(type);
869
- if (!target) return data;
870
- const aliasUrls = aliasUrlsFromData(data);
871
- if (aliasUrls.includes(previousUrl)) return data;
872
- const nextData = aliasUrls.includes(currentUrl) ? dataWithoutUrlAlias(data, currentUrl) : data;
873
- const metadata = isRecord(nextData.metadata) ? nextData.metadata : {};
874
- const aliases = target === "metadata" ? Array.isArray(metadata.aliases) ? metadata.aliases : [] : Array.isArray(nextData.aliases) ? nextData.aliases : [];
875
- return dataWithAliases(
876
- nextData,
877
- target,
878
- metadata,
879
- aliases.concat(createUrlAliasRow(previousUrl, aliases))
880
- );
881
- }
882
- function dataWithoutUrlAlias(data, url) {
883
- let result = data;
884
- if (Array.isArray(data.aliases)) {
885
- result = {
886
- ...result,
887
- aliases: data.aliases.filter((alias) => aliasUrl(alias) !== url)
888
- };
889
- }
890
- const metadata = data.metadata;
891
- if (isRecord(metadata) && Array.isArray(metadata.aliases)) {
892
- result = {
893
- ...result,
894
- metadata: {
895
- ...metadata,
896
- aliases: metadata.aliases.filter((alias) => aliasUrl(alias) !== url)
897
- }
898
- };
899
- }
900
- return result;
901
- }
902
- function dataWithAliases(data, target, metadata, aliases) {
903
- if (target === "aliases") return { ...data, aliases };
904
- return {
905
- ...data,
906
- metadata: {
907
- ...metadata,
908
- aliases
909
- }
910
- };
911
- }
912
- function typeAliasTarget(type) {
913
- if (Type.field(type, "aliases")) return "aliases";
914
- const metadata = Type.field(type, "metadata");
915
- if (!metadata) return void 0;
916
- const options = Field.options(metadata);
917
- const fields = options.fields;
918
- if (!Type.isType(fields)) return void 0;
919
- return Type.field(fields, "aliases") ? "metadata" : void 0;
920
- }
921
- function createUrlAliasRow(url, aliases) {
922
- const orderedAliases = aliases.filter(isOrderedUrlAliasRow);
923
- const editor = new ListEditor(orderedAliases);
924
- const created = editor.add("alias", { url }).value().at(-1);
925
- assert(created);
926
- return created;
927
- }
928
- function isOrderedUrlAliasRow(value) {
929
- if (!isRecord(value)) return false;
930
- const id = value[ListRow.id];
931
- const index = value[ListRow.index];
932
- const type = value[ListRow.type];
933
- const url = value.url;
934
- return typeof id === "string" && typeof index === "string" && isValidOrderKey(index) && type === "alias" && typeof url === "string";
935
- }
936
- function startsWithSegments(value, prefix) {
937
- return prefix.every((segment, index) => value[index] === segment);
938
- }
939
- export {
940
- EntryTransaction
941
- };