alinea 2.0.0-preview.12 → 2.0.0-preview.14

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 (421) hide show
  1. package/dist/.init/content/pages/welcome.json +1 -1
  2. package/dist/.mcp/later/dev.json +1 -1
  3. package/dist/.mcp/online/dev.json +1 -1
  4. package/dist/adapter/next/cms.js +22 -10
  5. package/dist/adapter/next/context.js +1 -4
  6. package/dist/adapter/next/dashboardUrl.d.ts +6 -0
  7. package/dist/adapter/next/dashboardUrl.js +13 -0
  8. package/dist/adapter/next/handler.js +12 -1
  9. package/dist/adapter/next/syncCheck.d.ts +15 -2
  10. package/dist/adapter/next/syncCheck.js +26 -9
  11. package/dist/backend/CommitEntries.d.ts +17 -0
  12. package/dist/backend/CommitEntries.js +39 -0
  13. package/dist/backend/Handler.d.ts +9 -0
  14. package/dist/backend/Handler.js +84 -20
  15. package/dist/backend/api/BasicAuth.js +5 -1
  16. package/dist/backend/api/BlobStore.d.ts +21 -0
  17. package/dist/backend/api/BlobStore.js +63 -0
  18. package/dist/backend/api/CreateBackend.js +10 -8
  19. package/dist/backend/api/DatabaseApi.d.ts +4 -1
  20. package/dist/backend/api/DatabaseApi.js +104 -7
  21. package/dist/backend/api/GithubApi.d.ts +13 -0
  22. package/dist/backend/api/GithubApi.js +213 -50
  23. package/dist/backend/api/database.js +6 -6
  24. package/dist/backend/util/Syncable.d.ts +6 -0
  25. package/dist/backend/util/Syncable.js +3 -1
  26. package/dist/bundled.d.ts +1582 -426
  27. package/dist/chunks/{bun-sqlite-5SHXN3AT.js → bun-sqlite-RI6BYU5S.js} +3 -3
  28. package/dist/chunks/{chunk-ASYKC6IE.js → chunk-2PP7WJUJ.js} +2 -12
  29. package/dist/chunks/{chunk-QJGGYF6E.js → chunk-6FQ5IMNA.js} +7 -7
  30. package/dist/chunks/{chunk-JOF663EG.js → chunk-7DDPSWRY.js} +465 -2
  31. package/dist/chunks/{chunk-ETWOY4AL.js → chunk-A2I6MCCS.js} +1 -1
  32. package/dist/chunks/{chunk-W5AXN7GH.js → chunk-CYVOGRSD.js} +1 -2
  33. package/dist/chunks/{chunk-TIJTT5ZI.js → chunk-G43W7AME.js} +1 -0
  34. package/dist/chunks/{chunk-RE523BQ7.js → chunk-PMGIIYDD.js} +5830 -5830
  35. package/dist/chunks/{chunk-AIU6CMVT.js → chunk-PTYZMV5G.js} +1 -1
  36. package/dist/chunks/{chunk-66YZ47TY.js → chunk-RAR44T5O.js} +1 -1
  37. package/dist/chunks/{chunk-OHGAVV4G.js → chunk-SCV3TEXM.js} +2 -3
  38. package/dist/chunks/{chunk-UPY2RUZF.js → chunk-TWBREZWC.js} +30 -0
  39. package/dist/chunks/{chunk-QSN6RH6X.js → chunk-VA6NC3MI.js} +1 -1
  40. package/dist/chunks/{node-sqlite-XVNTNMCY.js → node-sqlite-C7VJ2NSN.js} +3 -3
  41. package/dist/cli/Generate.js +20 -7
  42. package/dist/cli/Mcp.js +1 -1
  43. package/dist/cli/Serve.js +1 -1
  44. package/dist/cli/bin.js +2 -3
  45. package/dist/cli/build/BuildEmitter.d.ts +5 -1
  46. package/dist/cli/build/BuildEmitter.js +8 -3
  47. package/dist/cli/generate/CompileConfig.js +10 -6
  48. package/dist/cli/generate/DevDB.d.ts +4 -1
  49. package/dist/cli/generate/DevDB.js +15 -7
  50. package/dist/cli/generate/GenerateDashboard.js +1 -0
  51. package/dist/cli/generate/MediaLocations.d.ts +18 -0
  52. package/dist/cli/generate/MediaLocations.js +69 -0
  53. package/dist/cli/serve/CreateLocalServer.js +1 -0
  54. package/dist/cli/serve/mcp/DevMcp.js +1 -1
  55. package/dist/cli/serve/mcp/McpTools.js +29 -1
  56. package/dist/cloud/CloudRemote.js +21 -7
  57. package/dist/cms.d.ts +4 -2
  58. package/dist/components/Alert.js +3 -3
  59. package/dist/components/AsyncList.d.ts +52 -0
  60. package/dist/components/AsyncList.js +69 -0
  61. package/dist/components/Badge.d.ts +3 -1
  62. package/dist/components/Badge.js +5 -3
  63. package/dist/components/Breadcrumbs.js +4 -4
  64. package/dist/components/Button.d.ts +6 -1
  65. package/dist/components/Button.js +14 -5
  66. package/dist/components/Calendar.js +20 -20
  67. package/dist/components/Checkbox.js +10 -10
  68. package/dist/components/CheckboxGroup.js +4 -4
  69. package/dist/components/Code.js +2 -2
  70. package/dist/components/Collapsible.js +3 -3
  71. package/dist/components/ColorSwatch.js +2 -2
  72. package/dist/components/ColorSwatchPicker.js +4 -4
  73. package/dist/components/ComboBox.d.ts +27 -9
  74. package/dist/components/ComboBox.js +42 -11
  75. package/dist/components/Command.js +14 -13
  76. package/dist/components/ContentCard.d.ts +3 -1
  77. package/dist/components/ContentCard.js +46 -24
  78. package/dist/components/ContentGrid.js +17 -17
  79. package/dist/components/DataList.js +3 -3
  80. package/dist/components/DateField.d.ts +4 -0
  81. package/dist/components/DateField.js +2 -2
  82. package/dist/components/DatePicker.js +2 -2
  83. package/dist/components/DateRangePicker.js +2 -2
  84. package/dist/components/Dialog.d.ts +14 -3
  85. package/dist/components/Dialog.js +36 -9
  86. package/dist/components/DropZone.js +5 -5
  87. package/dist/components/DropdownMenu.js +9 -9
  88. package/dist/components/Empty.js +4 -4
  89. package/dist/components/Field.d.ts +1 -1
  90. package/dist/components/Field.js +17 -11
  91. package/dist/components/Form.d.ts +23 -0
  92. package/dist/components/Form.js +64 -0
  93. package/dist/components/Link.d.ts +8 -1
  94. package/dist/components/List.js +24 -24
  95. package/dist/components/MediaPreview.js +7 -7
  96. package/dist/components/MultipleSelect.d.ts +13 -8
  97. package/dist/components/MultipleSelect.js +21 -21
  98. package/dist/components/NavRail.js +6 -6
  99. package/dist/components/NumberField.d.ts +5 -1
  100. package/dist/components/NumberField.js +6 -4
  101. package/dist/components/Page.js +6 -6
  102. package/dist/components/Popover.js +2 -2
  103. package/dist/components/PreviewFrame.js +6 -6
  104. package/dist/components/RadioGroup.js +9 -9
  105. package/dist/components/Resizable.js +4 -4
  106. package/dist/components/SearchField.d.ts +6 -1
  107. package/dist/components/SearchField.js +10 -8
  108. package/dist/components/Select.d.ts +13 -10
  109. package/dist/components/Select.js +16 -30
  110. package/dist/components/Sheet.d.ts +50 -0
  111. package/dist/components/Sheet.js +202 -0
  112. package/dist/components/Sidebar.js +5 -5
  113. package/dist/components/SortableList.d.ts +34 -30
  114. package/dist/components/SortableList.js +160 -263
  115. package/dist/components/Spinner.js +4 -4
  116. package/dist/components/Stack.d.ts +20 -0
  117. package/dist/components/Stack.js +45 -0
  118. package/dist/components/Surface.js +2 -2
  119. package/dist/components/Switch.js +6 -6
  120. package/dist/components/Table.d.ts +14 -2
  121. package/dist/components/Table.js +90 -51
  122. package/dist/components/Tabs.js +4 -4
  123. package/dist/components/TagGroup.js +10 -10
  124. package/dist/components/TextField.d.ts +7 -1
  125. package/dist/components/TextField.js +19 -10
  126. package/dist/components/TimeField.d.ts +6 -1
  127. package/dist/components/TimeField.js +48 -23
  128. package/dist/components/Timestamp.js +1 -1
  129. package/dist/components/ToggleGroup.js +2 -2
  130. package/dist/components/Toolbar.js +3 -3
  131. package/dist/components/Tooltip.js +6 -5
  132. package/dist/components/Tree.js +24 -24
  133. package/dist/components/internal/DateControl.js +9 -9
  134. package/dist/components/internal/FormScope.d.ts +2 -0
  135. package/dist/components/internal/FormScope.js +8 -0
  136. package/dist/components/internal/ListBoxGroup.d.ts +12 -0
  137. package/dist/components/internal/ListBoxGroup.js +46 -0
  138. package/dist/components/internal/ListBoxOption.d.ts +2 -2
  139. package/dist/components/internal/ListBoxOption.js +7 -7
  140. package/dist/components/internal/Locale.js +2 -2
  141. package/dist/components/internal/PopoverSurface.js +3 -2
  142. package/dist/components/internal/SelectionCheckbox.js +6 -6
  143. package/dist/components/internal/Slot.js +1 -1
  144. package/dist/components/internal/ToggleButton.js +4 -4
  145. package/dist/components/internal/Trigger.js +2 -2
  146. package/dist/components/internal/sortableDrag.d.ts +19 -0
  147. package/dist/components/internal/sortableDrag.js +175 -0
  148. package/dist/components/internal/useDragDrop.js +2 -2
  149. package/dist/components/types.d.ts +4 -0
  150. package/dist/components.d.ts +4 -0
  151. package/dist/components.js +4 -0
  152. package/dist/core/Client.js +12 -1
  153. package/dist/core/Config.d.ts +12 -1
  154. package/dist/core/Config.js +12 -0
  155. package/dist/core/DashboardEntry.d.ts +19 -0
  156. package/dist/core/DashboardEntry.js +0 -0
  157. package/dist/core/Document.d.ts +9 -1
  158. package/dist/core/Document.js +40 -8
  159. package/dist/core/EntryFields.d.ts +8 -2
  160. package/dist/core/Field.d.ts +5 -0
  161. package/dist/core/Filter.d.ts +19 -2
  162. package/dist/core/Filter.js +5 -0
  163. package/dist/core/Graph.d.ts +10 -2
  164. package/dist/core/Overview.d.ts +76 -9
  165. package/dist/core/Overview.js +1 -0
  166. package/dist/core/Root.js +1 -1
  167. package/dist/core/Scope.d.ts +5 -0
  168. package/dist/core/Scope.js +22 -5
  169. package/dist/core/TextDoc.d.ts +4 -0
  170. package/dist/core/Type.d.ts +25 -6
  171. package/dist/core/Type.js +25 -7
  172. package/dist/core/Validation.d.ts +0 -1
  173. package/dist/core/Validation.js +0 -6
  174. package/dist/core/db/LocalStore.d.ts +7 -0
  175. package/dist/core/field/CreateField.d.ts +1 -2
  176. package/dist/core/field/RichTextField.js +23 -4
  177. package/dist/core/media/MediaTypes.js +1 -1
  178. package/dist/core/source/GithubSource.d.ts +4 -0
  179. package/dist/core/source/GithubSource.js +127 -25
  180. package/dist/core/source/GithubUsage.d.ts +21 -0
  181. package/dist/core/source/GithubUsage.js +47 -0
  182. package/dist/core/source/Source.d.ts +2 -0
  183. package/dist/core/source/Source.js +11 -0
  184. package/dist/core/util/Async.d.ts +2 -0
  185. package/dist/core/util/Async.js +12 -1
  186. package/dist/core/util/Checks.js +1 -1
  187. package/dist/core/util/Slugs.js +4 -3
  188. package/dist/dashboard/App.css +13 -11
  189. package/dist/dashboard/App.d.ts +3 -2
  190. package/dist/dashboard/App.js +24 -6
  191. package/dist/dashboard/Href.d.ts +37 -0
  192. package/dist/dashboard/Href.js +46 -0
  193. package/dist/dashboard/ViewKeys.d.ts +1 -0
  194. package/dist/dashboard/ViewKeys.js +1 -0
  195. package/dist/dashboard/app/ActivityStatus.js +34 -12
  196. package/dist/dashboard/app/AuthView.js +6 -6
  197. package/dist/dashboard/app/BlockSettings.d.ts +9 -0
  198. package/dist/dashboard/app/BlockSettings.js +16 -0
  199. package/dist/dashboard/app/BlockSheet.d.ts +50 -0
  200. package/dist/dashboard/app/BlockSheet.js +207 -0
  201. package/dist/dashboard/app/BlockSheetStoryFrame.d.ts +6 -0
  202. package/dist/dashboard/app/BlockSheetStoryFrame.js +29 -0
  203. package/dist/dashboard/app/CompactField.js +14 -14
  204. package/dist/dashboard/app/CroppedImage.js +2 -2
  205. package/dist/dashboard/app/DashboardLayout.d.ts +1 -1
  206. package/dist/dashboard/app/DashboardLayout.js +15 -1
  207. package/dist/dashboard/app/EntryActions.d.ts +11 -0
  208. package/dist/dashboard/app/EntryActions.js +30 -0
  209. package/dist/dashboard/app/EntryFields.d.ts +15 -2
  210. package/dist/dashboard/app/EntryFields.js +24 -3
  211. package/dist/dashboard/app/EntryHeader.js +45 -36
  212. package/dist/dashboard/app/EntryReferences.js +5 -5
  213. package/dist/dashboard/app/EntrySidebar.js +24 -22
  214. package/dist/dashboard/app/EntrySidebarPreview.js +2 -2
  215. package/dist/dashboard/app/EntryStatusIcon.d.ts +23 -0
  216. package/dist/dashboard/app/EntryStatusIcon.js +58 -0
  217. package/dist/dashboard/app/EntryValidationModal.d.ts +6 -5
  218. package/dist/dashboard/app/EntryValidationModal.js +17 -17
  219. package/dist/dashboard/app/Explorer.d.ts +3 -1
  220. package/dist/dashboard/app/Explorer.js +90 -47
  221. package/dist/dashboard/app/ExplorerBatchActions.d.ts +3 -1
  222. package/dist/dashboard/app/ExplorerBatchActions.js +70 -45
  223. package/dist/dashboard/app/ExplorerCards.js +7 -1
  224. package/dist/dashboard/app/ExplorerControls.js +4 -4
  225. package/dist/dashboard/app/ExplorerList.js +7 -7
  226. package/dist/dashboard/app/ExplorerModal.js +4 -4
  227. package/dist/dashboard/app/ExplorerOverviewHeader.d.ts +6 -0
  228. package/dist/dashboard/app/ExplorerOverviewHeader.js +28 -0
  229. package/dist/dashboard/app/ExplorerTable.js +11 -8
  230. package/dist/dashboard/app/ExplorerTabs.d.ts +12 -0
  231. package/dist/dashboard/app/ExplorerTabs.js +42 -0
  232. package/dist/dashboard/app/ImageEditor.js +26 -26
  233. package/dist/dashboard/app/ImagePicker.js +3 -13
  234. package/dist/dashboard/app/LinkPicker.js +27 -25
  235. package/dist/dashboard/app/LocaleMenu.js +7 -7
  236. package/dist/dashboard/app/MediaPreviewCell.js +4 -4
  237. package/dist/dashboard/app/MoveConfirmDialog.d.ts +5 -0
  238. package/dist/dashboard/app/MoveConfirmDialog.js +79 -0
  239. package/dist/dashboard/app/OverviewCell.js +11 -14
  240. package/dist/dashboard/app/PendingUploadsView.js +3 -3
  241. package/dist/dashboard/app/ReadOnlyBadge.d.ts +1 -1
  242. package/dist/dashboard/app/RemoveDialog.d.ts +17 -0
  243. package/dist/dashboard/app/{DeleteDialog.js → RemoveDialog.js} +72 -27
  244. package/dist/dashboard/app/RemoveRedirect.d.ts +7 -0
  245. package/dist/dashboard/app/RemoveRedirect.js +123 -0
  246. package/dist/dashboard/app/SearchBar.d.ts +9 -0
  247. package/dist/dashboard/app/SearchBar.js +31 -0
  248. package/dist/dashboard/app/SettingsTab.d.ts +6 -0
  249. package/dist/dashboard/app/SettingsTab.js +27 -0
  250. package/dist/dashboard/app/SidebarTree.js +26 -71
  251. package/dist/dashboard/app/WorkspaceMenu.js +9 -9
  252. package/dist/dashboard/app/WorkspaceRoots.js +108 -104
  253. package/dist/dashboard/app/editor/FileEditor.js +17 -17
  254. package/dist/dashboard/app/modals/CreateEntry.js +3 -3
  255. package/dist/dashboard/app/pages/EntryPage.d.ts +2 -1
  256. package/dist/dashboard/app/pages/EntryPage.js +65 -43
  257. package/dist/dashboard/app/pages/RootPage.js +3 -3
  258. package/dist/dashboard/app/pages/SplashPage.js +91 -76
  259. package/dist/dashboard/app/pages/UsersPage.js +11 -11
  260. package/dist/dashboard/app/ui/DashboardModal.js +14 -13
  261. package/dist/dashboard/atoms/activity.d.ts +1 -0
  262. package/dist/dashboard/atoms/activity.js +8 -5
  263. package/dist/dashboard/atoms/config.d.ts +2 -0
  264. package/dist/dashboard/atoms/dashboard.d.ts +11 -0
  265. package/dist/dashboard/atoms/dashboard.js +9 -1
  266. package/dist/dashboard/atoms/editor.d.ts +7 -1
  267. package/dist/dashboard/atoms/editor.js +14 -2
  268. package/dist/dashboard/atoms/entry.js +1 -14
  269. package/dist/dashboard/atoms/entryTable.js +1 -0
  270. package/dist/dashboard/atoms/explorer.d.ts +19 -0
  271. package/dist/dashboard/atoms/explorer.js +62 -21
  272. package/dist/dashboard/atoms/graph.d.ts +5 -0
  273. package/dist/dashboard/atoms/graph.js +27 -2
  274. package/dist/dashboard/atoms/link.js +5 -2
  275. package/dist/dashboard/atoms/move.d.ts +5 -0
  276. package/dist/dashboard/atoms/move.js +29 -3
  277. package/dist/dashboard/atoms/moveConfirmation.d.ts +34 -0
  278. package/dist/dashboard/atoms/moveConfirmation.js +95 -0
  279. package/dist/dashboard/atoms/nav.d.ts +22 -12
  280. package/dist/dashboard/atoms/nav.js +200 -65
  281. package/dist/dashboard/atoms/overview.d.ts +32 -9
  282. package/dist/dashboard/atoms/overview.js +43 -28
  283. package/dist/dashboard/atoms/remove.d.ts +112 -0
  284. package/dist/dashboard/atoms/remove.js +268 -0
  285. package/dist/dashboard/atoms/root.d.ts +2 -2
  286. package/dist/dashboard/atoms/root.js +48 -27
  287. package/dist/dashboard/atoms/user.js +1 -1
  288. package/dist/dashboard/atoms/utils.js +1 -1
  289. package/dist/dashboard/boot/ActivityEvent.d.ts +1 -1
  290. package/dist/dashboard/boot/Boot.js +31 -17
  291. package/dist/dashboard/boot/DashboardWorker.d.ts +7 -0
  292. package/dist/dashboard/boot/DashboardWorker.js +99 -54
  293. package/dist/dashboard/boot/LoadWorker.js +20 -10
  294. package/dist/dashboard/boot/SyncEvent.d.ts +7 -0
  295. package/dist/dashboard/boot/SyncEvent.js +14 -0
  296. package/dist/dashboard/boot/WorkerDB.d.ts +1 -0
  297. package/dist/dashboard/boot/WorkerDB.js +3 -0
  298. package/dist/dashboard/cms/EntryTable.d.ts +4 -3
  299. package/dist/dashboard/cms/EntryTable.js +6 -3
  300. package/dist/dashboard/cms/ViewProps.d.ts +3 -2
  301. package/dist/dashboard/cms/hooks.d.ts +34 -18
  302. package/dist/dashboard/cms/hooks.js +43 -18
  303. package/dist/dashboard/contexts.d.ts +3 -2
  304. package/dist/dashboard/contexts.js +3 -2
  305. package/dist/dashboard/hook/UseEntryEditor.d.ts +1 -1
  306. package/dist/dashboard/hook/UseEntryEditor.js +7 -3
  307. package/dist/dashboard/icons.d.ts +1 -0
  308. package/dist/dashboard/icons.js +15 -0
  309. package/dist/database/BrowserEntryStore.d.ts +12 -62
  310. package/dist/database/BrowserEntryStore.js +116 -193
  311. package/dist/database/DatabaseTables.js +2 -2
  312. package/dist/database/EntryDatabase.d.ts +10 -1
  313. package/dist/database/EntryDatabase.js +45 -4
  314. package/dist/database/EntryStore.js +1 -11
  315. package/dist/database/EntryTransaction.js +0 -35
  316. package/dist/database/EntryUrlAliases.d.ts +4 -0
  317. package/dist/database/EntryUrlAliases.js +16 -10
  318. package/dist/database/driver/RuntimeDatabase.js +3 -3
  319. package/dist/database/driver/WasmDatabase.d.ts +5 -18
  320. package/dist/database/driver/WasmDatabase.js +15 -16
  321. package/dist/database/entry/EntryTable.d.ts +5 -3
  322. package/dist/database/entry/EntryTable.js +26 -9
  323. package/dist/database/query/Condition.d.ts +4 -1
  324. package/dist/database/query/Condition.js +16 -5
  325. package/dist/database/query/EntryQuery.js +60 -8
  326. package/dist/database/query/Relation.d.ts +13 -1
  327. package/dist/database/query/Relation.js +20 -2
  328. package/dist/database/query/Search.d.ts +7 -1
  329. package/dist/database/query/Search.js +55 -10
  330. package/dist/database/sync/EntrySyncer.d.ts +2 -0
  331. package/dist/database/sync/EntrySyncer.js +4 -2
  332. package/dist/database/sync/Ingest.d.ts +2 -1
  333. package/dist/database/sync/Ingest.js +20 -6
  334. package/dist/field/code/CodeField.view.js +13 -13
  335. package/dist/field/link/EntryLink.d.ts +8 -9
  336. package/dist/field/link/FileLink.d.ts +6 -6
  337. package/dist/field/link/ImageLink.d.ts +6 -9
  338. package/dist/field/link/ImageLink.js +0 -1
  339. package/dist/field/link/Link.d.ts +1 -1
  340. package/dist/field/link/LinkField.d.ts +5 -0
  341. package/dist/field/link/LinkField.view.js +251 -374
  342. package/dist/field/link/UrlLink.d.ts +4 -4
  343. package/dist/field/list/ListField.d.ts +2 -0
  344. package/dist/field/list/ListField.view.d.ts +15 -0
  345. package/dist/field/list/ListField.view.js +356 -299
  346. package/dist/field/metadata/MetadataField.d.ts +17 -7
  347. package/dist/field/metadata/MetadataField.js +14 -3
  348. package/dist/field/metadata/MetadataField.view.d.ts +1 -0
  349. package/dist/field/metadata/MetadataField.view.js +24 -20
  350. package/dist/field/richtext/RichTextBlock.d.ts +3 -1
  351. package/dist/field/richtext/RichTextBlock.js +181 -74
  352. package/dist/field/richtext/RichTextBlockHost.js +1 -1
  353. package/dist/field/richtext/RichTextExtensions.js +28 -28
  354. package/dist/field/richtext/RichTextField.view.js +10 -4
  355. package/dist/field/richtext/RichTextInsertMenu.js +45 -29
  356. package/dist/field/richtext/RichTextToolbar.js +26 -1
  357. package/dist/field/richtext/Toolbar.d.ts +9 -1
  358. package/dist/field/richtext/Toolbar.js +12 -2
  359. package/dist/field/select/SelectField.view.js +1 -0
  360. package/dist/field/views.js +2 -0
  361. package/dist/index.css +664 -332
  362. package/dist/index.d.ts +1 -0
  363. package/dist/index.js +3 -1
  364. package/dist/next.d.ts +2 -0
  365. package/dist/next.edge.d.ts +2 -0
  366. package/dist/picker/entry/EntryPicker.d.ts +3 -1
  367. package/dist/picker/entry/EntryPicker.js +15 -1
  368. package/dist/picker/url/UrlPicker.js +1 -0
  369. package/dist/preview/react.js +3 -0
  370. package/dist/query.d.ts +26 -14
  371. package/dist/query.js +4 -0
  372. package/dist/types.d.ts +8 -5
  373. package/dist/ui/Stack.d.ts +4 -2
  374. package/docs/ai-setup.md +3 -3
  375. package/docs/cli.md +4 -2
  376. package/docs/components/badge.md +1 -0
  377. package/docs/components/button.md +1 -0
  378. package/docs/components/combo-box.md +105 -16
  379. package/docs/components/content-card.md +1 -0
  380. package/docs/components/date-field.md +1 -1
  381. package/docs/components/dialog.md +51 -0
  382. package/docs/components/form.md +67 -0
  383. package/docs/components/link.md +10 -0
  384. package/docs/components/multiple-select.md +9 -17
  385. package/docs/components/number-field.md +5 -1
  386. package/docs/components/search-field.md +1 -0
  387. package/docs/components/select.md +9 -20
  388. package/docs/components/sortable-list.md +5 -20
  389. package/docs/components/stack.md +42 -0
  390. package/docs/components/table.md +84 -0
  391. package/docs/components/text-field.md +9 -1
  392. package/docs/components/time-field.md +5 -1
  393. package/docs/components.md +39 -1
  394. package/docs/configuration.md +4 -2
  395. package/docs/custom-fields.md +135 -7
  396. package/docs/deploy/self-host.md +3 -1
  397. package/docs/deploy.md +9 -5
  398. package/docs/fields/image.md +0 -1
  399. package/docs/fields/list.md +19 -0
  400. package/docs/fields/object.md +5 -3
  401. package/docs/fields/rich-text.md +31 -0
  402. package/docs/fields.md +1 -1
  403. package/docs/index.md +9 -7
  404. package/docs/instant-publishing.md +17 -11
  405. package/docs/overviews.md +131 -8
  406. package/docs/query/filtering.md +2 -0
  407. package/docs/query/related.md +58 -9
  408. package/docs/query.md +52 -1
  409. package/docs/quickstart.md +5 -5
  410. package/docs/schema/document.md +2 -0
  411. package/docs/schema/type.md +3 -1
  412. package/docs/upgrading.md +101 -19
  413. package/llms-full.txt +1036 -163
  414. package/package.json +2 -3
  415. package/readme.md +2 -2
  416. package/dist/core/db/EntryValidationError.d.ts +0 -13
  417. package/dist/core/db/EntryValidationError.js +0 -23
  418. package/dist/dashboard/app/DeleteDialog.d.ts +0 -11
  419. package/dist/dashboard/atoms/delete.d.ts +0 -68
  420. package/dist/dashboard/atoms/delete.js +0 -143
  421. package/dist/chunks/{chunk-MOWR65LM.js → chunk-PYDOMKJZ.js} +71 -71
@@ -22,35 +22,27 @@ export function MultipleSelectExample() {
22
22
  }
23
23
  ```
24
24
 
25
+ ## Values
26
+
27
+ The value is an array of the `value`s of the picked items, strings or numbers. With a `name` the field submits one form entry per value, like a native multiple select: read them with `formData.getAll(name)`.
28
+
25
29
  ## Props
26
30
 
27
31
  `MultipleSelect`
28
32
  A labelled field to pick several values from a searchable list, the selected values are shown as removable tags.
29
33
  | Prop | Type | Default | Description |
30
34
  | --- | --- | --- | --- |
31
- | value | `Array<string>` | | |
32
- | defaultValue | `Array<string>` | | |
33
- | onValueChange | `(value: Array<string>) => void` | | |
35
+ | value | `Array<V>` | | The values of the selected MultipleSelectItems |
36
+ | defaultValue | `Array<V>` | | |
37
+ | onValueChange | `(value: Array<V>) => void` | | |
34
38
  | placeholder | `string` | | |
35
39
  | emptyMessage | `ReactNode` | `'No options'` | Shown in the list when no item matches the search, defaults to "No options" |
36
- | name | `string` | | Name of the hidden form input carrying the values |
37
- | label | `ReactNode` | | |
38
- | description | `ReactNode` | | |
39
- | error | `ReactNode` | | |
40
- | required | `boolean` | | |
41
- | disabled | `boolean` | | |
42
- | readOnly | `boolean` | | |
43
- | icon | `IconType \| ReactElement` | | |
44
- | shared | `boolean` | | Marks the field as shared between translations |
45
- | open | `boolean` | | |
46
- | defaultOpen | `boolean` | | |
47
- | onOpenChange | `(open: boolean) => void` | | |
48
- Also accepts `className` and `style`, `id` and `aria-*` labelling attributes, `data-*` attributes.
40
+ | name | `string` | | Name of the hidden form input carrying the values, it submits one entry per selected value like a native multiple select: read them with `formData.getAll(name)` |
49
41
 
50
42
  `MultipleSelectItem`
51
43
  | Prop | Type | Default | Description |
52
44
  | --- | --- | --- | --- |
53
- | value (required) | `string` | | |
45
+ | value (required) | `Key` | | |
54
46
  | textValue | `string` | | Text used for searching and the tag, defaults to string children |
55
47
  | disabled | `boolean` | | |
56
48
  Also accepts `className` and `style`.
@@ -19,6 +19,10 @@ export function NumberFieldExample() {
19
19
  }
20
20
  ```
21
21
 
22
+ ## Formatting
23
+
24
+ `formatOptions` takes the options of `Intl.NumberFormat`, such as a currency or a unit, and the number is shown and parsed in the locale of the dashboard. Digits are not grouped by default, since number fields often hold years or ids: pass `formatOptions={{useGrouping: true}}` to show `1,250` rather than `1250`. The value is a number, or `null` when the field is empty.
25
+
22
26
  ## Props
23
27
 
24
28
  `NumberField`
@@ -30,7 +34,7 @@ export function NumberFieldExample() {
30
34
  | min | `number` | | |
31
35
  | max | `number` | | |
32
36
  | step | `number` | | |
33
- | formatOptions | `Intl.NumberFormatOptions` | | |
37
+ | formatOptions | `Intl.NumberFormatOptions` | | How the number is shown and parsed. Digits are not grouped unless `useGrouping` is set: number fields often hold years and ids |
34
38
  | placeholder | `string` | | |
35
39
  | steppers | `boolean` | `true` | Show increment and decrement buttons, defaults to true |
36
40
  | name | `string` | | |
@@ -31,6 +31,7 @@ A text input for search queries with a clear button. The `icon` is shown inside
31
31
  | onClear | `() => void` | | Called when the user clears the field with the clear button or escape |
32
32
  | placeholder | `string` | | |
33
33
  | loading | `boolean` | | Shows a spinner while results are being loaded |
34
+ | variant | `'default' \| 'inline'` | `'default'` | `inline` drops the box so the field reads as the top row of the results it searches, like a command palette. The row draws its own border. |
34
35
  | name | `string` | | |
35
36
  | autoFocus | `boolean` | | |
36
37
  | onBlur | `(event: FocusEvent<HTMLInputElement>) => void` | | |
@@ -1,6 +1,6 @@
1
1
  # Select
2
2
 
3
- Picks a single value from a list of options. The value is the `value` of the chosen SelectItem, and editors can clear it unless the field is required.
3
+ Picks a single value from a list of options. The value is the `value` of the chosen SelectItem, and `onValueChange` receives it, typed like the `value` you pass: values are strings or numbers. Set `clearable` to show a button that clears the value again, `onValueChange` then receives `null`.
4
4
 
5
5
  Example: Select
6
6
  ```tsx
@@ -63,7 +63,7 @@ export function SelectGroupsExample() {
63
63
 
64
64
  ## States
65
65
 
66
- A placeholder shows while nothing is selected. Like the other form controls, a select takes `description`, `error`, `required`, `disabled` and `readOnly`.
66
+ A placeholder shows while nothing is selected, and `clearable` adds a button to clear the selection. Like the other form controls, a select takes `description`, `error`, `required`, `disabled` and `readOnly`.
67
67
 
68
68
  Example: Select: states
69
69
  ```tsx
@@ -72,7 +72,7 @@ import {Select, SelectItem} from 'alinea/components'
72
72
  export function SelectStatesExample() {
73
73
  return (
74
74
  <div style={{display: 'grid', gap: 16, width: 280}}>
75
- <Select label="Category" placeholder="Choose a category">
75
+ <Select label="Category" placeholder="Choose a category" clearable>
76
76
  <SelectItem value="bedroom">Bedroom</SelectItem>
77
77
  <SelectItem value="dining">Dining</SelectItem>
78
78
  </Select>
@@ -92,33 +92,22 @@ export function SelectStatesExample() {
92
92
  ## Props
93
93
 
94
94
  `Select`
95
- A labelled field to pick a single value from a list. The value can be cleared unless the field is required.
95
+ A labelled field to pick a single value from a list. Set `clearable` to let the value be cleared again.
96
96
  | Prop | Type | Default | Description |
97
97
  | --- | --- | --- | --- |
98
- | value | `string \| null` | | |
99
- | defaultValue | `string \| null` | | |
100
- | onValueChange | `(value: string \| null) => void` | | Called with the selected value, or null when the value is cleared |
98
+ | value | `V \| null` | | The value of the selected SelectItem |
99
+ | defaultValue | `V \| null` | | |
100
+ | onValueChange | `(value: V \| null) => void` | | Called with the selected value, or null when the value is cleared |
101
101
  | placeholder | `string` | | |
102
+ | clearable | `boolean` | | Show a button that clears the value |
102
103
  | name | `string` | | Name of the hidden form input carrying the value |
103
104
  | autoFocus | `boolean` | | |
104
105
  | size | `'default' \| 'sm'` | `'default'` | `sm` is as tall as a default Button, defaults to `default` |
105
- | label | `ReactNode` | | |
106
- | description | `ReactNode` | | |
107
- | error | `ReactNode` | | |
108
- | required | `boolean` | | |
109
- | disabled | `boolean` | | |
110
- | readOnly | `boolean` | | |
111
- | icon | `IconType \| ReactElement` | | |
112
- | shared | `boolean` | | Marks the field as shared between translations |
113
- | open | `boolean` | | |
114
- | defaultOpen | `boolean` | | |
115
- | onOpenChange | `(open: boolean) => void` | | |
116
- Also accepts `className` and `style`, `id` and `aria-*` labelling attributes, `data-*` attributes.
117
106
 
118
107
  `SelectItem`
119
108
  | Prop | Type | Default | Description |
120
109
  | --- | --- | --- | --- |
121
- | value (required) | `string` | | |
110
+ | value (required) | `Key` | | |
122
111
  | disabled | `boolean` | | |
123
112
  | icon | `IconType \| ReactElement` | | |
124
113
  | textValue | `string` | | Text used for typeahead and the value, defaults to string children |
@@ -8,7 +8,6 @@ import {
8
8
  Badge,
9
9
  type DragMoveEvent,
10
10
  SortableList,
11
- SortableListHandle,
12
11
  SortableListItem,
13
12
  SortableListItemDescription,
14
13
  SortableListItemHeader,
@@ -40,7 +39,6 @@ export function SortableListExample() {
40
39
  {sections.map(section => (
41
40
  <SortableListItem key={section.id} id={section.id} role="listitem">
42
41
  <SortableListItemHeader>
43
- <SortableListHandle aria-label={`Drag ${section.label}`} />
44
42
  <SortableListItemTitle>
45
43
  <Badge size="sm">{section.type}</Badge>
46
44
  <SortableListItemDescription>
@@ -60,25 +58,20 @@ export function SortableListExample() {
60
58
  `SortableList`
61
59
  | Prop | Type | Default | Description |
62
60
  | --- | --- | --- | --- |
63
- | onReorder | `(event: DragMoveEvent) => void` | | Enables reordering: items with an `id` can be dragged by their `SortableListHandle`, with a pointer or with the keyboard (Enter on the handle, Tab to an item, Enter to drop). Called with the key of the dragged item and the item it was dropped before or after. Items only drop within the list they were dragged from. |
64
- | dragType | `string` | | Mime type the dragged items carry, defaults to `alinea/sortable-list-item` |
65
- Also accepts every prop of `Surface`.
61
+ | onReorder | `(event: DragMoveEvent) => void` | | Enables reordering: items with an `id` follow the pointer when their `SortableListItemHeader` is dragged, the other items move aside as it passes them. With focus in the header, Alt+ArrowUp and Alt+ArrowDown move an item. Called with the key of the moved item and the item it was dropped before or after. Update the order synchronously: the dropped item glides into the place it renders in right after this returns. |
62
+ Also accepts every prop of a `<div>` element.
66
63
 
67
64
  `SortableListItem`
68
65
  | Prop | Type | Default | Description |
69
66
  | --- | --- | --- | --- |
70
67
  | id | `Key` | | Identifies the item within its list. Items with an id can be dragged when the list has `onReorder`. The id is not rendered as a DOM id. |
71
- | dragPreview | `ReactNode` | | Rendered under the pointer while dragging, eg. a `SortableListDragPreview` |
68
+ | current | `boolean` | | Highlights the item, eg. while its settings are open next to the list |
72
69
  Also accepts every prop of a `<div>` element.
73
70
 
74
71
  `SortableListItemHeader`
75
- Top bar of an item, holds its handle, title and actions
72
+ Top bar of an item, holds its title and actions. Drags the item when the list has `onReorder`, a press that does not move still clicks.
76
73
  Accepts every prop of a `<div>` element.
77
74
 
78
- `SortableListHandle`
79
- Drags its `SortableListItem` when the list has `onReorder`. Focusable in that case: press Enter to start a keyboard drag. Place it in the `SortableListItemHeader`, it shows while the header is hovered or focused.
80
- Accepts every prop of a `<span>` element.
81
-
82
75
  `SortableListItemTitle`
83
76
  Row of the toggle, badges and description of an item, fills the header
84
77
  Accepts every prop of a `<div>` element.
@@ -94,7 +87,7 @@ Accepts every prop of a `<div>` element.
94
87
  Folds the content of an item
95
88
  | Prop | Type | Default | Description |
96
89
  | --- | --- | --- | --- |
97
- | expanded (required) | `boolean` | | Whether the item content is shown, rotates the fold icon |
90
+ | expanded (required) | `boolean` | | Whether the item content is shown, picks the unfold icon |
98
91
  Also accepts every prop of `Button`.
99
92
 
100
93
  `SortableListItemContent`
@@ -112,14 +105,6 @@ A group of settings or actions in the popover of an item
112
105
  | variant | `'default' \| 'actions'` | `'default'` | `actions` removes the padding around a group of ghost buttons |
113
106
  Also accepts every prop of a `<div>` element.
114
107
 
115
- `SortableListDragPreview`
116
- Card shown under the pointer while dragging an item
117
- | Prop | Type | Default | Description |
118
- | --- | --- | --- | --- |
119
- | icon | `IconType` | | |
120
- | label (required) | `ReactNode` | | |
121
- Also accepts every prop of a `<div>` element.
122
-
123
108
  `SortableListAdd`
124
109
  Last row of the list holding the buttons that add items
125
110
  Accepts every prop of a `<div>` element.
@@ -0,0 +1,42 @@
1
+ # Stack
2
+
3
+ Lays out its children in a column, or a row with `direction="row"`, with a `gap` between them: a number is in pixels, a string any CSS length. `align` positions the items across the stack (they stretch by default), `justify` along it, and `wrap` lets a row continue on the next line.
4
+
5
+ Example: Stack
6
+ ```tsx
7
+ import {Badge, Button, Stack, TextField} from 'alinea/components'
8
+
9
+ export function StackExample() {
10
+ return (
11
+ <Stack gap={16} style={{width: 320}}>
12
+ <Stack direction="row" align="center" justify="between">
13
+ <strong>About us</strong>
14
+ <Badge status="draft">Draft</Badge>
15
+ </Stack>
16
+ <TextField label="Title" defaultValue="About us" />
17
+ <TextField label="Path" defaultValue="about" />
18
+ <Stack direction="row" gap={8} justify="end" wrap>
19
+ <Button variant="outline">Cancel</Button>
20
+ <Button color="primary">Save</Button>
21
+ </Stack>
22
+ </Stack>
23
+ )
24
+ }
25
+ ```
26
+
27
+ With `asChild` the stack lays out its single child element instead of rendering a div. `Stack` replaces the deprecated `HStack` and `VStack` of `alinea/ui`: `<Stack direction="row">` is an HStack.
28
+
29
+ ## Props
30
+
31
+ `Stack`
32
+ Lays out its children in a row or column with a gap between them
33
+ | Prop | Type | Default | Description |
34
+ | --- | --- | --- | --- |
35
+ | direction | `'row' \| 'column'` | `'column'` | Defaults to `column` |
36
+ | gap | `number \| string` | | Space between the items, a number is in pixels |
37
+ | align | `'start' \| 'center' \| 'end' \| 'stretch' \| 'baseline'` | | Cross axis alignment of the items, they stretch by default |
38
+ | justify | `'start' \| 'center' \| 'end' \| 'between'` | | Main axis distribution of the items |
39
+ | wrap | `boolean` | | Wrap items onto multiple lines |
40
+ | asChild | `boolean` | | Lay out the single child element instead of rendering a div |
41
+ | ref | `Ref<HTMLDivElement>` | | |
42
+ Also accepts `className` and `style`, `id` and `aria-*` labelling attributes, `data-*` attributes.
@@ -112,6 +112,84 @@ export function TableSelectionExample() {
112
112
  }
113
113
  ```
114
114
 
115
+ ## Load more rows
116
+
117
+ `onLoadMore` is called when the rows are scrolled close to the end, to fetch the next page. While `loading` is set, a spinner shows below the rows, or in place of them while there are none. `useAsyncList` keeps the loaded pages: its `load` function receives the `cursor` the previous page returned, and `loadMore` does nothing once a page returns no cursor. Its `items`, `loading`, `loadMore`, `sortDescriptor` and `sort`, and `selectedKeys` and `setSelectedKeys` plug into the props of the table. `update(key, item)`, `remove(...keys)`, `prepend(...items)` and `append(...items)` change the loaded items without loading them again, for example after a dialog saves a row.
118
+
119
+ Example: Table: async
120
+ ```tsx
121
+ import {
122
+ Table,
123
+ TableCell,
124
+ TableRow,
125
+ TableTitle,
126
+ useAsyncList
127
+ } from 'alinea/components'
128
+
129
+ interface Product {
130
+ id: string
131
+ title: string
132
+ price: number
133
+ }
134
+
135
+ const materials = ['Linen', 'Oak', 'Wool', 'Walnut', 'Ceramic']
136
+ const kinds = ['shirt', 'chair', 'throw', 'stool', 'lamp', 'table']
137
+
138
+ // Stands in for a paged API: 20 products per page, 100 in total
139
+ async function fetchProducts(page: number) {
140
+ await new Promise(resolve => setTimeout(resolve, 500))
141
+ const items: Array<Product> = Array.from({length: 20}, (_, i) => {
142
+ const n = page * 20 + i
143
+ const title = `${materials[n % 5]} ${kinds[n % 6]} ${n + 1}`
144
+ return {id: `product-${n}`, title, price: 40 + ((n * 37) % 300)}
145
+ })
146
+ return {items, cursor: page < 4 ? page + 1 : undefined}
147
+ }
148
+
149
+ export function TableAsyncExample() {
150
+ const list = useAsyncList<Product, number>({
151
+ load: ({cursor = 0}) => fetchProducts(cursor)
152
+ })
153
+ return (
154
+ <div style={{width: 420, height: 260}}>
155
+ <Table
156
+ aria-label="Products"
157
+ items={list.items}
158
+ columns={[
159
+ {id: 'title', header: 'Title', width: '1fr'},
160
+ {id: 'price', header: 'Price', width: 100, align: 'end'}
161
+ ]}
162
+ loading={list.loading}
163
+ onLoadMore={list.loadMore}
164
+ >
165
+ {product => (
166
+ <TableRow id={product.id} textValue={product.title}>
167
+ <TableTitle title={product.title} />
168
+ <TableCell align="end">€{product.price}</TableCell>
169
+ </TableRow>
170
+ )}
171
+ </Table>
172
+ </div>
173
+ )
174
+ }
175
+ ```
176
+
177
+ ```tsx
178
+ import {useAsyncList} from 'alinea/components'
179
+
180
+ const list = useAsyncList({
181
+ async load({cursor, filterText, sort, signal}) {
182
+ const res = await fetch(`/api/products?page=${cursor ?? 1}`, {signal})
183
+ const {items, next} = await res.json()
184
+ // Leave out the cursor, or return null, on the last page
185
+ return {items, cursor: next}
186
+ }
187
+ })
188
+ // list.items, list.loading, list.hasMore, list.error,
189
+ // list.loadMore(), list.reload(), list.setFilterText(text), list.sort(sort),
190
+ // list.update(id, item), list.remove(id), list.prepend(item)
191
+ ```
192
+
115
193
  ## Props
116
194
 
117
195
  `Table`
@@ -132,6 +210,8 @@ export function TableSelectionExample() {
132
210
  | onSortChange | `(descriptor: SortDescriptor) => void` | | |
133
211
  | onRowAction | `(key: Key) => void` | | Called when a row is activated (see `selectionBehavior`), rows can override it with their own `onAction` |
134
212
  | renderEmptyState | `() => ReactNode` | | |
213
+ | loading | `boolean` | | Shows a spinner in place of the rows while there are none, below the rows otherwise |
214
+ | onLoadMore | `() => void` | | Called when the rows are scrolled close to the end, to load the next page (see useAsyncList) |
135
215
  | dependencies | `ReadonlyArray<unknown>` | | Rows are cached per item, list the values `children` reads besides the item to render them again when those change |
136
216
  | children (required) | `(item: T) => ReactElement` | | |
137
217
 
@@ -171,8 +251,12 @@ Also accepts `className` and `style`.
171
251
  | icon | `IconType` | | Doubles as the drag handle of the row when rows can be dragged |
172
252
  | title (required) | `ReactNode` | | |
173
253
  | label | `ReactNode` | | A small caption above the title, eg. the parent path |
254
+ | suffix | `ReactNode` | | Shown right after the title, eg. a status icon |
174
255
  Also accepts `className` and `style`.
175
256
 
257
+ `useAsyncList`
258
+ Loads a list of items, with sorting, filtering and paging
259
+
176
260
  ## Accessibility
177
261
 
178
262
  Built on the React Aria grid: the arrow keys move between rows, Space selects a row and Enter runs its action. Sortable column headers announce their sort direction.
@@ -43,7 +43,7 @@ export function TextFieldStatesExample() {
43
43
 
44
44
  ## Multiline
45
45
 
46
- A multiline field starts at `rows` lines and grows as editors type.
46
+ A multiline field starts at `rows` lines and grows as editors type, up to `maxRows` lines when you set it, then it scrolls.
47
47
 
48
48
  Example: TextField: multiline
49
49
  ```tsx
@@ -55,6 +55,7 @@ export function TextFieldMultilineExample() {
55
55
  label="Description"
56
56
  multiline
57
57
  rows={4}
58
+ maxRows={8}
58
59
  defaultValue="A relaxed shirt in washed linen that softens with every wear."
59
60
  style={{width: 300}}
60
61
  />
@@ -95,6 +96,10 @@ export function TextFieldIconsExample() {
95
96
  }
96
97
  ```
97
98
 
99
+ ## Native input attributes
100
+
101
+ `type`, `name`, `autoComplete`, `inputMode`, `pattern`, `minLength` and `maxLength` are passed to the input. `inputMode` picks the virtual keyboard on touch devices, eg. `numeric` for a code, and `pattern` is a regular expression the value must match, checked when the field is in a [Form](form.md).
102
+
98
103
  ## Props
99
104
 
100
105
  `TextField`
@@ -107,6 +112,7 @@ export function TextFieldIconsExample() {
107
112
  | type | `'text' \| 'email' \| 'url' \| 'password' \| 'tel' \| 'search'` | `'text'` | |
108
113
  | multiline | `boolean` | | Render a textarea that grows with its content |
109
114
  | rows | `number` | `1` | Minimum number of rows of a multiline field |
115
+ | maxRows | `number` | | Maximum number of rows a multiline field grows to before it scrolls |
110
116
  | startIcon | `IconType \| ReactElement` | | Icon displayed inside the input, before the text |
111
117
  | endIcon | `IconType \| ReactElement` | | Icon displayed inside the input, after the text |
112
118
  | name | `string` | | |
@@ -114,6 +120,8 @@ export function TextFieldIconsExample() {
114
120
  | autoComplete | `string` | | |
115
121
  | maxLength | `number` | | |
116
122
  | minLength | `number` | | |
123
+ | inputMode | `'none' \| 'text' \| 'tel' \| 'url' \| 'email' \| 'numeric' \| 'decimal' \| 'search'` | | Which virtual keyboard to show, eg. `numeric` for a code |
124
+ | pattern | `string` | | A regular expression the value must match to be valid |
117
125
  | onBlur | `(event: FocusEvent<TextFieldElement>) => void` | | |
118
126
  | onFocus | `(event: FocusEvent<TextFieldElement>) => void` | | |
119
127
  | onKeyDown | `(event: KeyboardEvent<TextFieldElement>) => void` | | |
@@ -18,13 +18,17 @@ export function TimeFieldExample() {
18
18
  }
19
19
  ```
20
20
 
21
+ ## Value
22
+
23
+ The value is an ISO time string: `14:30`, or `14:30:15` with `granularity="second"`. With a `name` the field submits the same string in a form, like a native time input, and an empty string when no time is set. `hourCycle` only changes how the time is shown.
24
+
21
25
  ## Props
22
26
 
23
27
  `TimeField`
24
28
  | Prop | Type | Default | Description |
25
29
  | --- | --- | --- | --- |
26
30
  | locale | `string; /** The time, `HH:mm` or `HH:mm:ss` */ value?: string \| null; defaultValue?: string \| null; /** Receives `HH:mm`, or `HH:mm:ss` when granularity is `second` */ onValueChange?: (value: string \| null) => void; /** The earliest valid time, `HH:mm` or `HH:mm:ss` */ min?: string; /** The latest valid time, `HH:mm` or `HH:mm:ss` */ max?: string; /** The smallest unit that can be edited, defaults to `minute` */ granularity?: 'minute' \| 'second'; /** Defaults to the locale's hour cycle */ hourCycle?: 12 \| 24` | | BCP 47 locale used to format dates, eg. `en-GB`, defaults to the user's locale |
27
- | name | `string` | | |
31
+ | name | `string` | | Name of the hidden form input, which submits the time like a native time input: `HH:mm`, or `HH:mm:ss` when granularity is `second`, and an empty string when no time is set |
28
32
  | autoFocus | `boolean` | | |
29
33
  | label | `ReactNode` | | |
30
34
  | description | `ReactNode` | | |
@@ -34,6 +34,7 @@ Components are the React components the dashboard is built from, import them fro
34
34
  - [ColorSwatchPicker](components/color-swatch-picker.md): Picks a color from a set of swatches.
35
35
  - [DropZone](components/drop-zone.md): A target to drop files or other content on.
36
36
  - [Field](components/field.md): The label, help text and error around your own input.
37
+ - [Form](components/form.md): Submits its fields and shows their validation errors.
37
38
 
38
39
  ### Collections
39
40
  - [Table](components/table.md): Rows and columns with sorting, selection and dragging.
@@ -67,6 +68,7 @@ Components are the React components the dashboard is built from, import them fro
67
68
  - [FoldIcon](components/fold-icon.md): A chevron that turns when its section opens.
68
69
 
69
70
  ### Layout
71
+ - [Stack](components/stack.md): Lays out its children in a row or column with a gap.
70
72
  - [Surface](components/surface.md): A bordered panel for a group of content.
71
73
  - [Collapsible](components/collapsible.md): A section that opens and closes.
72
74
  - [Page](components/page.md): The header, content and footer of a dashboard page.
@@ -111,7 +113,7 @@ export function PriorityView({field}: FieldViewProps<PriorityField>) {
111
113
  }
112
114
  ```
113
115
 
114
- The components are styled by the dashboard's stylesheet and theme, so they are meant for code that runs inside the dashboard.
116
+ The components are styled by the dashboard's stylesheet and theme. They are meant for code that runs inside the dashboard, but work on other pages too (see Theme tokens below).
115
117
 
116
118
  ## Conventions
117
119
 
@@ -129,3 +131,39 @@ The props of every component are typed, so your editor shows what each one accep
129
131
  ## Icons
130
132
 
131
133
  Components with an `icon` prop take an icon component (any component that renders an `<svg>`, such as those from [react-icons](https://react-icons.github.io/react-icons) or copied from [Icones](https://icones.js.org)) or an element. The icons of the dashboard itself are exported from `alinea/dashboard/icons`.
134
+
135
+ ## Theme tokens
136
+
137
+ The components are styled with CSS custom properties. `alinea/css` declares them, and its resets, only on elements with a `data-alinea-theme` attribute, so loading the stylesheet doesn't restyle the rest of a page. The dashboard sets the attribute on `<html>`, and popovers, dialogs and tooltips set it on themselves since they render outside the page. To use the components on a page of your site, import `alinea/css` and render them inside an element with `data-alinea-theme`. Add `data-theme="light"` or `data-theme="dark"` to that element to fix the color scheme, otherwise it follows the page.
138
+
139
+ A theme only sets the inputs, as `light-dark()` pairs where a value differs per color scheme. Every other token is derived from them. Set them on the element with `data-alinea-theme`, for example `<div data-alinea-theme className="brand-theme">`:
140
+
141
+ File: theme.css
142
+ ```css
143
+ .brand-theme {
144
+ --alinea-radius: 6px;
145
+ --alinea-bg: light-dark(#ffffff, #18181b);
146
+ --alinea-fg: light-dark(#27272a, #e4e4e7);
147
+ --alinea-primary: light-dark(#2f6b45, #5fbf82);
148
+ }
149
+ ```
150
+
151
+ Popovers, dialogs and tooltips render outside that element and carry the attribute themselves, so a class on the page doesn't reach them: use `[data-alinea-theme]` as the selector to theme every part of the components on a page.
152
+
153
+ Inputs:
154
+
155
+ - `--alinea-font`, `--alinea-mono-font`, `--alinea-font-size-base` and `--alinea-radius`.
156
+ - `--alinea-backdrop` (behind panels), `--alinea-bg` (panels), `--alinea-fg` (text) and `--alinea-border`.
157
+ - `--alinea-primary`, `--alinea-danger`, `--alinea-warning` and `--alinea-success`, with `--alinea-primary-fg`, `--alinea-danger-fg` and `--alinea-warning-fg` for text on them.
158
+ - `--alinea-ring`: the focus ring.
159
+ - `--alinea-workspace-color`: the `color` option of the current workspace, set by the dashboard. It falls back to `--alinea-primary`.
160
+
161
+ Derived tokens, to read in your own styles:
162
+
163
+ - Text: `--alinea-fg-strong`, `--alinea-fg-muted`, `--alinea-fg-disabled` and `--alinea-field-label`.
164
+ - Surfaces: `--alinea-bg-muted`, `--alinea-muted` (hover backgrounds), `--alinea-input`, `--alinea-overlay`, `--alinea-scrim` (behind dialogs) and `--alinea-border-strong`.
165
+ - Tones: `--alinea-selected` and `--alinea-selected-fg`, and a `-subtle` background with a `-subtle-fg` text color for `primary`, `danger`, `warning` and `success`, eg. `--alinea-danger-subtle`.
166
+ - Entry statuses: `--alinea-status-published`, `--alinea-status-draft` and `--alinea-status-unpublished`, each with a `-fg` color.
167
+ - Shape and motion: `--alinea-radius-sm`, `--alinea-radius-lg`, `--alinea-radius-xl`, `--alinea-shadow-raised`, `--alinea-shadow-muted`, `--alinea-shadow-tooltip`, `--alinea-shadow-modal` and `--alinea-transition`.
168
+
169
+ The color palette the default theme is built from (`--alinea-gray-500`, `--alinea-blue-800`, ...) is not part of this list and can change.
@@ -56,9 +56,11 @@ The URL of the API route that serves the dashboard and media files: the route th
56
56
 
57
57
  The URL of your website, either one string or one per environment: `{development, production}`, picked by `NODE_ENV`. A value without a protocol gets `https://`.
58
58
 
59
- - `alinea build` exits with `No baseUrl was set for the production build` when there is no production URL.
59
+ - It is required for production builds when `handlerUrl` is relative: `alinea build` exits, and queries on your site throw, with `Missing baseUrl in Alinea config: set baseUrl.production to the url of your site, …`. An absolute `handlerUrl` doesn't need it.
60
60
  - In production your site reaches the handler at `handlerUrl` resolved against this URL, to check for new content. That includes `next start` on your machine, which talks to the production URL.
61
61
 
62
+ Server renders have no request to take the origin from (static pages and pages from `generateStaticParams` are rendered without one, and reading the request headers would make every route dynamic), so Alinea doesn't guess it. Set `baseUrl.production`, or make `handlerUrl` absolute.
63
+
62
64
  Most projects read the production URL from an environment variable, see [Environment variables](#environment-variables) below.
63
65
 
64
66
  ## Dashboard options
@@ -96,7 +98,7 @@ Scale down JPEG, PNG and WebP uploads larger than `maxWidth` or `maxHeight` pixe
96
98
 
97
99
  ### `syncInterval`
98
100
 
99
- How your deployed site keeps its content fresh. The site checks the content revision of the repository and syncs right away when it changed; `syncInterval` is the fallback interval in seconds when that revision can't be determined. Defaults to `60`.
101
+ How your deployed site keeps its content fresh. The site checks the content revision of the repository and syncs right away when it changed; `syncInterval` is the fallback interval in seconds when that revision can't be determined. Defaults to `60`. In Next.js a value you set also controls how long renders share the latest revision, which bounds how soon content pushed without the dashboard shows up; without one that is five minutes.
100
102
 
101
103
  - `0` syncs on every query.
102
104
  - `Infinity` never syncs: the site only serves the content it was built with, and new content goes live with the next deploy.