alinea 2.0.0-preview.13 → 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 (323) 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 +6 -2
  5. package/dist/adapter/next/context.js +1 -4
  6. package/dist/adapter/next/handler.js +12 -1
  7. package/dist/backend/CommitEntries.d.ts +17 -0
  8. package/dist/backend/CommitEntries.js +39 -0
  9. package/dist/backend/Handler.d.ts +9 -0
  10. package/dist/backend/Handler.js +80 -20
  11. package/dist/backend/api/BasicAuth.js +5 -1
  12. package/dist/backend/api/CreateBackend.js +2 -2
  13. package/dist/backend/api/DatabaseApi.js +18 -5
  14. package/dist/backend/api/GithubApi.d.ts +13 -0
  15. package/dist/backend/api/GithubApi.js +170 -30
  16. package/dist/backend/api/database.js +2 -2
  17. package/dist/backend/util/Syncable.d.ts +6 -0
  18. package/dist/backend/util/Syncable.js +3 -1
  19. package/dist/bundled.d.ts +911 -151
  20. package/dist/chunks/{chunk-5H4D5JQL.js → chunk-2PP7WJUJ.js} +1 -11
  21. package/dist/chunks/{chunk-QHHMKJUO.js → chunk-7DDPSWRY.js} +465 -2
  22. package/dist/chunks/{chunk-HOETF6HN.js → chunk-PMGIIYDD.js} +1 -0
  23. package/dist/chunks/{chunk-3QFSGTGF.js → chunk-SCV3TEXM.js} +1 -1
  24. package/dist/chunks/{chunk-UPY2RUZF.js → chunk-TWBREZWC.js} +30 -0
  25. package/dist/cli/Generate.js +20 -7
  26. package/dist/cli/Mcp.js +1 -1
  27. package/dist/cli/Serve.js +1 -1
  28. package/dist/cli/bin.js +1 -1
  29. package/dist/cli/build/BuildEmitter.d.ts +5 -1
  30. package/dist/cli/build/BuildEmitter.js +8 -3
  31. package/dist/cli/generate/CompileConfig.js +10 -6
  32. package/dist/cli/generate/DevDB.d.ts +4 -1
  33. package/dist/cli/generate/DevDB.js +15 -7
  34. package/dist/cli/generate/GenerateDashboard.js +1 -0
  35. package/dist/cli/generate/MediaLocations.d.ts +18 -0
  36. package/dist/cli/generate/MediaLocations.js +69 -0
  37. package/dist/cli/serve/CreateLocalServer.js +1 -0
  38. package/dist/cli/serve/mcp/DevMcp.js +1 -1
  39. package/dist/cloud/CloudRemote.js +21 -7
  40. package/dist/cms.d.ts +4 -2
  41. package/dist/components/Alert.js +2 -2
  42. package/dist/components/AppShell.js +2 -2
  43. package/dist/components/AsyncList.d.ts +52 -0
  44. package/dist/components/AsyncList.js +69 -0
  45. package/dist/components/Breadcrumbs.js +6 -6
  46. package/dist/components/Button.js +4 -4
  47. package/dist/components/Calendar.js +18 -18
  48. package/dist/components/Checkbox.js +10 -10
  49. package/dist/components/CheckboxGroup.js +2 -2
  50. package/dist/components/Collapsible.js +5 -5
  51. package/dist/components/ColorSwatch.js +2 -2
  52. package/dist/components/ColorSwatchPicker.js +4 -4
  53. package/dist/components/ComboBox.d.ts +27 -9
  54. package/dist/components/ComboBox.js +40 -9
  55. package/dist/components/Command.js +13 -13
  56. package/dist/components/ContentCard.js +28 -28
  57. package/dist/components/ContentGrid.js +11 -11
  58. package/dist/components/DataList.js +1 -1
  59. package/dist/components/DateField.d.ts +4 -0
  60. package/dist/components/DateField.js +2 -2
  61. package/dist/components/DatePicker.js +2 -2
  62. package/dist/components/DateRangePicker.js +2 -2
  63. package/dist/components/Dialog.d.ts +14 -3
  64. package/dist/components/Dialog.js +38 -11
  65. package/dist/components/DropZone.js +6 -6
  66. package/dist/components/DropdownMenu.js +8 -8
  67. package/dist/components/Empty.js +4 -4
  68. package/dist/components/Field.d.ts +1 -1
  69. package/dist/components/Field.js +18 -12
  70. package/dist/components/Form.d.ts +23 -0
  71. package/dist/components/Form.js +64 -0
  72. package/dist/components/Link.d.ts +8 -1
  73. package/dist/components/List.js +27 -27
  74. package/dist/components/MediaPreview.js +5 -5
  75. package/dist/components/MultipleSelect.d.ts +13 -8
  76. package/dist/components/MultipleSelect.js +25 -25
  77. package/dist/components/NavRail.js +7 -7
  78. package/dist/components/NumberField.d.ts +5 -1
  79. package/dist/components/NumberField.js +6 -4
  80. package/dist/components/Page.js +6 -6
  81. package/dist/components/Popover.js +2 -2
  82. package/dist/components/PreviewFrame.js +8 -8
  83. package/dist/components/RadioGroup.js +10 -10
  84. package/dist/components/Resizable.js +1 -1
  85. package/dist/components/SearchField.js +8 -8
  86. package/dist/components/Select.d.ts +13 -10
  87. package/dist/components/Select.js +18 -32
  88. package/dist/components/Sheet.js +6 -6
  89. package/dist/components/Sidebar.js +5 -5
  90. package/dist/components/SortableList.js +12 -12
  91. package/dist/components/Spinner.js +4 -4
  92. package/dist/components/Stack.d.ts +20 -0
  93. package/dist/components/Stack.js +45 -0
  94. package/dist/components/Surface.js +1 -1
  95. package/dist/components/Switch.js +5 -5
  96. package/dist/components/Table.d.ts +11 -1
  97. package/dist/components/Table.js +81 -53
  98. package/dist/components/Tabs.js +6 -6
  99. package/dist/components/TagGroup.js +10 -10
  100. package/dist/components/TextField.d.ts +7 -1
  101. package/dist/components/TextField.js +20 -11
  102. package/dist/components/TimeField.d.ts +6 -1
  103. package/dist/components/TimeField.js +51 -26
  104. package/dist/components/Timestamp.js +1 -1
  105. package/dist/components/ToggleGroup.js +2 -2
  106. package/dist/components/Toolbar.js +3 -3
  107. package/dist/components/Tooltip.js +5 -4
  108. package/dist/components/Tree.js +27 -27
  109. package/dist/components/internal/DateControl.js +11 -11
  110. package/dist/components/internal/FormScope.d.ts +2 -0
  111. package/dist/components/internal/FormScope.js +8 -0
  112. package/dist/components/internal/ListBoxGroup.d.ts +12 -0
  113. package/dist/components/internal/ListBoxGroup.js +46 -0
  114. package/dist/components/internal/ListBoxOption.d.ts +2 -2
  115. package/dist/components/internal/ListBoxOption.js +5 -5
  116. package/dist/components/internal/Locale.js +2 -2
  117. package/dist/components/internal/PopoverSurface.js +5 -4
  118. package/dist/components/internal/SelectionCheckbox.js +5 -5
  119. package/dist/components/internal/Slot.js +1 -1
  120. package/dist/components/internal/ToggleButton.js +4 -4
  121. package/dist/components/internal/Trigger.js +2 -2
  122. package/dist/components/internal/useDragDrop.js +2 -2
  123. package/dist/components/types.d.ts +4 -0
  124. package/dist/components.d.ts +3 -0
  125. package/dist/components.js +3 -0
  126. package/dist/core/Client.js +12 -1
  127. package/dist/core/Config.d.ts +6 -0
  128. package/dist/core/Config.js +12 -0
  129. package/dist/core/DashboardEntry.d.ts +19 -0
  130. package/dist/core/DashboardEntry.js +0 -0
  131. package/dist/core/Document.d.ts +2 -2
  132. package/dist/core/Document.js +10 -3
  133. package/dist/core/EntryFields.d.ts +8 -2
  134. package/dist/core/Field.d.ts +5 -0
  135. package/dist/core/Filter.d.ts +19 -2
  136. package/dist/core/Filter.js +5 -0
  137. package/dist/core/Graph.d.ts +10 -2
  138. package/dist/core/Overview.d.ts +74 -5
  139. package/dist/core/Overview.js +1 -0
  140. package/dist/core/Root.js +1 -1
  141. package/dist/core/Scope.d.ts +5 -0
  142. package/dist/core/Scope.js +22 -5
  143. package/dist/core/Type.d.ts +25 -6
  144. package/dist/core/Type.js +25 -7
  145. package/dist/core/db/LocalStore.d.ts +7 -0
  146. package/dist/core/field/CreateField.d.ts +1 -2
  147. package/dist/core/source/Source.d.ts +2 -0
  148. package/dist/core/source/Source.js +11 -0
  149. package/dist/core/util/Async.d.ts +2 -0
  150. package/dist/core/util/Async.js +12 -1
  151. package/dist/core/util/Checks.js +1 -1
  152. package/dist/core/util/Slugs.js +4 -3
  153. package/dist/dashboard/App.css +13 -11
  154. package/dist/dashboard/App.d.ts +1 -0
  155. package/dist/dashboard/App.js +22 -6
  156. package/dist/dashboard/Href.d.ts +37 -0
  157. package/dist/dashboard/Href.js +46 -0
  158. package/dist/dashboard/app/ActivityStatus.js +34 -12
  159. package/dist/dashboard/app/AuthView.js +2 -2
  160. package/dist/dashboard/app/BlockSettings.d.ts +9 -0
  161. package/dist/dashboard/app/BlockSettings.js +16 -0
  162. package/dist/dashboard/app/BlockSheet.js +3 -3
  163. package/dist/dashboard/app/BlockSheetStoryFrame.js +2 -2
  164. package/dist/dashboard/app/CompactField.js +15 -15
  165. package/dist/dashboard/app/CroppedImage.js +2 -2
  166. package/dist/dashboard/app/DashboardLayout.d.ts +1 -1
  167. package/dist/dashboard/app/DashboardLayout.js +12 -0
  168. package/dist/dashboard/app/EntryActions.d.ts +11 -0
  169. package/dist/dashboard/app/EntryActions.js +30 -0
  170. package/dist/dashboard/app/EntryFields.d.ts +15 -2
  171. package/dist/dashboard/app/EntryFields.js +26 -5
  172. package/dist/dashboard/app/EntryHeader.js +17 -7
  173. package/dist/dashboard/app/EntryReferences.js +2 -2
  174. package/dist/dashboard/app/EntrySidebar.js +25 -23
  175. package/dist/dashboard/app/EntrySidebarPreview.js +2 -2
  176. package/dist/dashboard/app/EntryValidationModal.js +3 -3
  177. package/dist/dashboard/app/Explorer.js +84 -45
  178. package/dist/dashboard/app/ExplorerBatchActions.js +4 -4
  179. package/dist/dashboard/app/ExplorerControls.js +5 -5
  180. package/dist/dashboard/app/ExplorerList.js +2 -2
  181. package/dist/dashboard/app/ExplorerModal.js +3 -3
  182. package/dist/dashboard/app/ExplorerOverviewHeader.d.ts +6 -0
  183. package/dist/dashboard/app/ExplorerOverviewHeader.js +28 -0
  184. package/dist/dashboard/app/ExplorerTable.js +7 -7
  185. package/dist/dashboard/app/ExplorerTabs.d.ts +12 -0
  186. package/dist/dashboard/app/ExplorerTabs.js +42 -0
  187. package/dist/dashboard/app/ImageEditor.js +31 -31
  188. package/dist/dashboard/app/LinkPicker.js +3 -3
  189. package/dist/dashboard/app/LocaleMenu.js +9 -9
  190. package/dist/dashboard/app/MediaPreviewCell.js +5 -5
  191. package/dist/dashboard/app/OverviewCell.js +12 -10
  192. package/dist/dashboard/app/RemoveDialog.js +5 -0
  193. package/dist/dashboard/app/SearchBar.js +4 -4
  194. package/dist/dashboard/app/SettingsTab.d.ts +6 -0
  195. package/dist/dashboard/app/SettingsTab.js +27 -0
  196. package/dist/dashboard/app/SidebarTree.js +19 -19
  197. package/dist/dashboard/app/WorkspaceMenu.js +6 -6
  198. package/dist/dashboard/app/WorkspaceRoots.js +102 -98
  199. package/dist/dashboard/app/editor/FileEditor.js +18 -18
  200. package/dist/dashboard/app/pages/EntryPage.js +42 -39
  201. package/dist/dashboard/app/pages/RootPage.js +3 -3
  202. package/dist/dashboard/app/pages/SplashPage.js +94 -79
  203. package/dist/dashboard/app/pages/UsersPage.js +9 -9
  204. package/dist/dashboard/app/ui/DashboardModal.js +14 -14
  205. package/dist/dashboard/atoms/activity.d.ts +1 -0
  206. package/dist/dashboard/atoms/activity.js +8 -5
  207. package/dist/dashboard/atoms/config.d.ts +2 -0
  208. package/dist/dashboard/atoms/dashboard.d.ts +11 -0
  209. package/dist/dashboard/atoms/dashboard.js +8 -0
  210. package/dist/dashboard/atoms/editor.d.ts +7 -1
  211. package/dist/dashboard/atoms/editor.js +14 -2
  212. package/dist/dashboard/atoms/explorer.d.ts +15 -0
  213. package/dist/dashboard/atoms/explorer.js +43 -14
  214. package/dist/dashboard/atoms/graph.d.ts +5 -0
  215. package/dist/dashboard/atoms/graph.js +26 -1
  216. package/dist/dashboard/atoms/nav.d.ts +16 -10
  217. package/dist/dashboard/atoms/nav.js +96 -36
  218. package/dist/dashboard/atoms/overview.d.ts +26 -4
  219. package/dist/dashboard/atoms/overview.js +41 -12
  220. package/dist/dashboard/atoms/root.js +7 -1
  221. package/dist/dashboard/boot/ActivityEvent.d.ts +1 -1
  222. package/dist/dashboard/boot/Boot.js +6 -0
  223. package/dist/dashboard/boot/DashboardWorker.d.ts +6 -0
  224. package/dist/dashboard/boot/DashboardWorker.js +89 -8
  225. package/dist/dashboard/boot/LoadWorker.js +3 -0
  226. package/dist/dashboard/boot/SyncEvent.d.ts +7 -0
  227. package/dist/dashboard/boot/SyncEvent.js +14 -0
  228. package/dist/dashboard/boot/WorkerDB.d.ts +1 -0
  229. package/dist/dashboard/boot/WorkerDB.js +3 -0
  230. package/dist/dashboard/cms/EntryTable.d.ts +4 -3
  231. package/dist/dashboard/cms/EntryTable.js +2 -2
  232. package/dist/dashboard/cms/ViewProps.d.ts +3 -2
  233. package/dist/dashboard/cms/hooks.d.ts +34 -18
  234. package/dist/dashboard/cms/hooks.js +43 -18
  235. package/dist/dashboard/contexts.d.ts +3 -2
  236. package/dist/dashboard/contexts.js +3 -2
  237. package/dist/dashboard/hook/UseEntryEditor.d.ts +1 -1
  238. package/dist/dashboard/hook/UseEntryEditor.js +7 -3
  239. package/dist/dashboard/icons.d.ts +1 -0
  240. package/dist/dashboard/icons.js +15 -0
  241. package/dist/database/BrowserEntryStore.js +35 -13
  242. package/dist/database/DatabaseTables.js +1 -1
  243. package/dist/database/EntryDatabase.d.ts +10 -1
  244. package/dist/database/EntryDatabase.js +31 -10
  245. package/dist/database/EntryStore.js +1 -11
  246. package/dist/database/entry/EntryTable.d.ts +5 -3
  247. package/dist/database/entry/EntryTable.js +25 -8
  248. package/dist/database/query/Condition.d.ts +4 -1
  249. package/dist/database/query/Condition.js +16 -5
  250. package/dist/database/query/EntryQuery.js +59 -7
  251. package/dist/database/query/Relation.d.ts +13 -1
  252. package/dist/database/query/Relation.js +19 -1
  253. package/dist/database/query/Search.d.ts +7 -1
  254. package/dist/database/query/Search.js +54 -9
  255. package/dist/database/sync/EntrySyncer.d.ts +2 -0
  256. package/dist/database/sync/EntrySyncer.js +4 -2
  257. package/dist/database/sync/Ingest.d.ts +2 -1
  258. package/dist/database/sync/Ingest.js +20 -6
  259. package/dist/field/code/CodeField.view.js +12 -12
  260. package/dist/field/link/EntryLink.d.ts +4 -5
  261. package/dist/field/link/FileLink.d.ts +2 -2
  262. package/dist/field/link/ImageLink.d.ts +2 -5
  263. package/dist/field/link/ImageLink.js +0 -1
  264. package/dist/field/link/LinkField.view.js +18 -15
  265. package/dist/field/list/ListField.view.js +50 -35
  266. package/dist/field/metadata/MetadataField.view.js +14 -14
  267. package/dist/field/richtext/RichTextBlock.js +39 -35
  268. package/dist/field/richtext/RichTextExtensions.js +23 -23
  269. package/dist/field/richtext/RichTextField.view.js +6 -6
  270. package/dist/field/richtext/RichTextInsertMenu.js +5 -5
  271. package/dist/field/richtext/RichTextToolbar.js +26 -1
  272. package/dist/field/richtext/Toolbar.d.ts +9 -1
  273. package/dist/field/richtext/Toolbar.js +12 -2
  274. package/dist/field/select/SelectField.view.js +1 -0
  275. package/dist/index.css +174 -23
  276. package/dist/index.d.ts +1 -0
  277. package/dist/index.js +3 -1
  278. package/dist/next.d.ts +2 -0
  279. package/dist/next.edge.d.ts +2 -0
  280. package/dist/picker/entry/EntryPicker.d.ts +3 -1
  281. package/dist/picker/entry/EntryPicker.js +15 -1
  282. package/dist/preview/react.js +3 -0
  283. package/dist/query.d.ts +26 -14
  284. package/dist/query.js +4 -0
  285. package/dist/types.d.ts +8 -5
  286. package/dist/ui/Stack.d.ts +4 -2
  287. package/docs/ai-setup.md +3 -3
  288. package/docs/cli.md +4 -2
  289. package/docs/components/combo-box.md +105 -16
  290. package/docs/components/date-field.md +1 -1
  291. package/docs/components/dialog.md +51 -0
  292. package/docs/components/form.md +67 -0
  293. package/docs/components/link.md +10 -0
  294. package/docs/components/multiple-select.md +9 -17
  295. package/docs/components/number-field.md +5 -1
  296. package/docs/components/select.md +9 -20
  297. package/docs/components/stack.md +42 -0
  298. package/docs/components/table.md +83 -0
  299. package/docs/components/text-field.md +9 -1
  300. package/docs/components/time-field.md +5 -1
  301. package/docs/components.md +39 -1
  302. package/docs/configuration.md +3 -1
  303. package/docs/custom-fields.md +135 -7
  304. package/docs/deploy/self-host.md +2 -0
  305. package/docs/deploy.md +7 -4
  306. package/docs/fields/image.md +0 -1
  307. package/docs/fields/list.md +19 -0
  308. package/docs/fields/object.md +5 -3
  309. package/docs/fields/rich-text.md +31 -0
  310. package/docs/index.md +8 -6
  311. package/docs/instant-publishing.md +23 -2
  312. package/docs/overviews.md +128 -4
  313. package/docs/query/filtering.md +2 -0
  314. package/docs/query/related.md +58 -9
  315. package/docs/query.md +52 -1
  316. package/docs/quickstart.md +5 -5
  317. package/docs/schema/document.md +2 -0
  318. package/docs/schema/type.md +3 -1
  319. package/docs/upgrading.md +100 -19
  320. package/llms-full.txt +1022 -125
  321. package/package.json +1 -1
  322. package/readme.md +2 -2
  323. package/dist/chunks/{chunk-4ZA6KZHS.js → chunk-6FQ5IMNA.js} +3 -3
@@ -30,7 +30,7 @@ import { MediaFile, MediaLibrary } from "alinea/core/media/MediaTypes";
30
30
  import { assert } from "alinea/core/util/Assert";
31
31
  import { typeAtoms } from "alinea/dashboard/atoms/config";
32
32
  import { configAtom } from "alinea/dashboard/atoms/core";
33
- import { entrySidebarOpenAtom } from "alinea/dashboard/atoms/dashboard";
33
+ import { entrySidebarOpen } from "alinea/dashboard/atoms/dashboard";
34
34
  import {
35
35
  entryAtoms,
36
36
  MissingEntryError
@@ -56,6 +56,7 @@ import { FileEditor } from "./../editor/FileEditor.js";
56
56
  import { CreateEntryButton } from "./../DashboardLayout.js";
57
57
  import { EntryFields } from "./../EntryFields.js";
58
58
  import { NodeEditor } from "./../NodeEditor.js";
59
+ import { withSettingsTab } from "../SettingsTab.js";
59
60
  import { EntryHeader } from "./../EntryHeader.js";
60
61
  import { entryDirtyActions } from "./../EntryHeaderActions.js";
61
62
  import {
@@ -79,23 +80,28 @@ import {
79
80
 
80
81
  // src/dashboard/app/pages/EntryPage.module.css
81
82
  var EntryPage_default = {
82
- "EntryEditor-body": "alinea-EntryEditor-body",
83
- "EntryEditorBody": "alinea-EntryEditor-body",
84
- "MissingEntry-media": "alinea-MissingEntry-media",
85
- "MissingEntryMedia": "alinea-MissingEntry-media",
83
+ "EntryEditor": "alinea-EntryEditor",
84
+ "EntryEditor-banner": "alinea-EntryEditor-banner",
85
+ "EntryEditorBanner": "alinea-EntryEditor-banner",
86
+ "EntryOverview-mobileActions": "alinea-EntryOverview-mobileActions",
87
+ "EntryOverviewMobileActions": "alinea-EntryOverview-mobileActions",
88
+ "EntryEditor-fields": "alinea-EntryEditor-fields",
89
+ "EntryEditorFields": "alinea-EntryEditor-fields",
90
+ "EntryEditor-view": "alinea-EntryEditor-view",
91
+ "EntryEditorView": "alinea-EntryEditor-view",
86
92
  "EntryEditorLayout-sidebar": "alinea-EntryEditorLayout-sidebar",
87
93
  "EntryEditorLayoutSidebar": "alinea-EntryEditorLayout-sidebar",
88
- "EntryEditor-toolbar": "alinea-EntryEditor-toolbar",
89
- "EntryEditorToolbar": "alinea-EntryEditor-toolbar",
90
94
  "EntryEditorContent-navigationActions": "alinea-EntryEditorContent-navigationActions",
91
95
  "EntryEditorContentNavigationActions": "alinea-EntryEditorContent-navigationActions",
92
- "EntryEditor-fields": "alinea-EntryEditor-fields",
93
- "EntryEditorFields": "alinea-EntryEditor-fields",
94
- "EntryEditor-banner": "alinea-EntryEditor-banner",
95
- "EntryEditorBanner": "alinea-EntryEditor-banner",
96
96
  "MissingEntry": "alinea-MissingEntry",
97
- "EntryOverview-mobileActions": "alinea-EntryOverview-mobileActions",
98
- "EntryOverviewMobileActions": "alinea-EntryOverview-mobileActions"
97
+ "MissingEntry-media": "alinea-MissingEntry-media",
98
+ "MissingEntryMedia": "alinea-MissingEntry-media",
99
+ "EntryEditor-body": "alinea-EntryEditor-body",
100
+ "EntryEditorBody": "alinea-EntryEditor-body",
101
+ "EntryEditor-viewBanner": "alinea-EntryEditor-viewBanner",
102
+ "EntryEditorViewBanner": "alinea-EntryEditor-viewBanner",
103
+ "EntryEditor-toolbar": "alinea-EntryEditor-toolbar",
104
+ "EntryEditorToolbar": "alinea-EntryEditor-toolbar"
99
105
  };
100
106
 
101
107
  // src/dashboard/app/pages/EntryPage.tsx
@@ -125,10 +131,10 @@ var entryPage = page(async (page2, get) => {
125
131
  }
126
132
  const selectedNode = await get(localeData.selectedNode);
127
133
  const richTextImages = await get(localeData.richTextImages);
128
- const parentNeedsTranslation = type.customView ? false : await get(localeData.parentNeedsTranslation);
134
+ const parentNeedsTranslation = await get(localeData.parentNeedsTranslation);
129
135
  const sourceLocale = get(localeData.translationSourceLocale);
130
136
  const copyTranslationSource = get(localeData.copyTranslationSource);
131
- const isSidebarOpen = get(entrySidebarOpenAtom);
137
+ const isSidebarOpen = get(entrySidebarOpen(Boolean(get(entry.preview))));
132
138
  const sidebar = await entrySidebar(get, entry, localeData, isSidebarOpen);
133
139
  return /* @__PURE__ */ jsx(
134
140
  EntryEditorContent,
@@ -288,7 +294,9 @@ function EntryEditorContent({
288
294
  const reset = useSetAtom(node.reset);
289
295
  const [routeBlock, setRouteBlock] = useAtom(routeBlockAtom);
290
296
  const setRouteGuard = useSetAtom(routeGuardAtom);
291
- const setSidebarOpen = useSetAtom(entrySidebarOpenAtom);
297
+ const setSidebarOpen = useSetAtom(
298
+ entrySidebarOpen(Boolean(useAtomValueRaw(entry.preview)))
299
+ );
292
300
  const editorBodyRef = useRef(null);
293
301
  const isMediaFile = type.type === MediaFile;
294
302
  const isMediaLibrary = type.type === MediaLibrary;
@@ -324,6 +332,17 @@ function EntryEditorContent({
324
332
  useLayoutEffect(() => {
325
333
  if (editorBodyRef.current) editorBodyRef.current.scrollTop = 0;
326
334
  }, [entry.id]);
335
+ const translationBanner = isUntranslated && /* @__PURE__ */ jsx(
336
+ EntryTranslationBanner,
337
+ {
338
+ copyFromSource: copyTranslationSource,
339
+ parentNeedsTranslation,
340
+ sourceLocale,
341
+ sourceLocales,
342
+ onCopyFromSourceChange: setCopyTranslationSource,
343
+ onSourceLocaleChange: setSourceLocale
344
+ }
345
+ );
327
346
  let editorBody = /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(
328
347
  PageContent,
329
348
  {
@@ -331,18 +350,8 @@ function EntryEditorContent({
331
350
  contained: true,
332
351
  className: styles.EntryEditor.body(),
333
352
  children: /* @__PURE__ */ jsxs("div", { className: styles.EntryEditor.fields(), children: [
334
- isUntranslated && /* @__PURE__ */ jsx("div", { className: styles.EntryEditor.banner(), children: /* @__PURE__ */ jsx(
335
- EntryTranslationBanner,
336
- {
337
- copyFromSource: copyTranslationSource,
338
- parentNeedsTranslation,
339
- sourceLocale,
340
- sourceLocales,
341
- onCopyFromSourceChange: setCopyTranslationSource,
342
- onSourceLocaleChange: setSourceLocale
343
- }
344
- ) }),
345
- /* @__PURE__ */ jsx(NodeEditor, { node, type: type.type, children: /* @__PURE__ */ jsx(EntryFields, {}) })
353
+ translationBanner && /* @__PURE__ */ jsx("div", { className: styles.EntryEditor.banner(), children: translationBanner }),
354
+ /* @__PURE__ */ jsx(NodeEditor, { node, type: withSettingsTab(type.type), children: /* @__PURE__ */ jsx(EntryFields, {}) })
346
355
  ] })
347
356
  }
348
357
  ) });
@@ -356,18 +365,12 @@ function EntryEditorContent({
356
365
  ) }) }) });
357
366
  }
358
367
  if (View) {
359
- return /* @__PURE__ */ jsx(
360
- EntryScope,
361
- {
362
- entry,
363
- localeData,
364
- richTextImages,
365
- selectedEntry,
366
- children: /* @__PURE__ */ jsx(View, { type: type.type })
367
- }
368
- );
368
+ editorBody = /* @__PURE__ */ jsxs(Fragment, { children: [
369
+ translationBanner && /* @__PURE__ */ jsx("div", { className: styles.EntryEditor.viewBanner(), children: translationBanner }),
370
+ /* @__PURE__ */ jsx(PageContent, { ref: editorBodyRef, className: styles.EntryEditor.view(), children: /* @__PURE__ */ jsx(NodeEditor, { node, type: withSettingsTab(type.type), children: /* @__PURE__ */ jsx(View, { type: type.type }) }) })
371
+ ] });
369
372
  }
370
- const mainEditor = /* @__PURE__ */ jsxs(PageLayout, { children: [
373
+ const mainEditor = /* @__PURE__ */ jsxs(PageLayout, { className: styles.EntryEditor(), children: [
371
374
  /* @__PURE__ */ jsx(
372
375
  EntryHeader,
373
376
  {
@@ -19,10 +19,10 @@ import { NotFoundPanel } from "./EntryPage.js";
19
19
 
20
20
  // src/dashboard/app/pages/RootPage.module.css
21
21
  var RootPage_default = {
22
- "RootPage-customView": "alinea-RootPage-customView",
23
- "RootPageCustomView": "alinea-RootPage-customView",
24
22
  "RootPage-mobileActions": "alinea-RootPage-mobileActions",
25
- "RootPageMobileActions": "alinea-RootPage-mobileActions"
23
+ "RootPageMobileActions": "alinea-RootPage-mobileActions",
24
+ "RootPage-customView": "alinea-RootPage-customView",
25
+ "RootPageCustomView": "alinea-RootPage-customView"
26
26
  };
27
27
 
28
28
  // src/dashboard/app/pages/RootPage.tsx
@@ -1,7 +1,9 @@
1
1
  import {
2
2
  useSetAtom
3
3
  } from "../../../chunks/chunk-D6UJHBJJ.js";
4
- import "../../../chunks/chunk-CFNRVI3Y.js";
4
+ import {
5
+ atom
6
+ } from "../../../chunks/chunk-CFNRVI3Y.js";
5
7
  import {
6
8
  styler
7
9
  } from "../../../chunks/chunk-I4OYYAX5.js";
@@ -30,6 +32,7 @@ import { routeAtom } from "alinea/dashboard/atoms/nav";
30
32
  import { rootAtoms } from "alinea/dashboard/atoms/root";
31
33
  import { workspaceAtom, workspacesAtom } from "alinea/dashboard/atoms/config";
32
34
  import { canManageMembersAtom, policyAtom } from "alinea/dashboard/atoms/user";
35
+ import { dispense } from "alinea/dashboard/atoms/utils";
33
36
  import { useUser } from "alinea/dashboard/hooks";
34
37
  import {
35
38
  IcBaselineAccountCircle,
@@ -44,70 +47,117 @@ import { GlobalSearch, WorkspaceAvatar } from "../WorkspaceMenu.js";
44
47
 
45
48
  // src/dashboard/app/pages/SplashPage.module.css
46
49
  var SplashPage_default = {
47
- "SplashPage-content": "alinea-SplashPage-content",
48
- "SplashPageContent": "alinea-SplashPage-content",
49
- "SplashPage-card-header-content": "alinea-SplashPage-card-header-content",
50
- "SplashPageCardHeaderContent": "alinea-SplashPage-card-header-content",
51
- "SplashPage-card-footer": "alinea-SplashPage-card-footer",
52
- "SplashPageCardFooter": "alinea-SplashPage-card-footer",
53
- "SplashPage-card-header-label": "alinea-SplashPage-card-header-label",
54
- "SplashPageCardHeaderLabel": "alinea-SplashPage-card-header-label",
55
- "SplashPage-sidebar-content": "alinea-SplashPage-sidebar-content",
56
- "SplashPageSidebarContent": "alinea-SplashPage-sidebar-content",
57
- "SplashPage-entry": "alinea-SplashPage-entry",
58
- "SplashPageEntry": "alinea-SplashPage-entry",
59
- "SplashPage-entry-user": "alinea-SplashPage-entry-user",
60
- "SplashPageEntryUser": "alinea-SplashPage-entry-user",
50
+ "SplashPage-entry-visual": "alinea-SplashPage-entry-visual",
51
+ "SplashPageEntryVisual": "alinea-SplashPage-entry-visual",
52
+ "SplashPage-grid": "alinea-SplashPage-grid",
53
+ "SplashPageGrid": "alinea-SplashPage-grid",
54
+ "SplashPage-entry-visual-icon": "alinea-SplashPage-entry-visual-icon",
55
+ "SplashPageEntryVisualIcon": "alinea-SplashPage-entry-visual-icon",
56
+ "SplashPage-root": "alinea-SplashPage-root",
57
+ "SplashPageRoot": "alinea-SplashPage-root",
61
58
  "SplashPage-entry-content": "alinea-SplashPage-entry-content",
62
59
  "SplashPageEntryContent": "alinea-SplashPage-entry-content",
60
+ "SplashPage-action": "alinea-SplashPage-action",
61
+ "SplashPageAction": "alinea-SplashPage-action",
63
62
  "SplashPage-entry-primary": "alinea-SplashPage-entry-primary",
64
63
  "SplashPageEntryPrimary": "alinea-SplashPage-entry-primary",
65
- "SplashPage-grid": "alinea-SplashPage-grid",
66
- "SplashPageGrid": "alinea-SplashPage-grid",
67
- "SplashPage-card-header-button": "alinea-SplashPage-card-header-button",
68
- "SplashPageCardHeaderButton": "alinea-SplashPage-card-header-button",
69
- "SplashPage-sidebar": "alinea-SplashPage-sidebar",
70
- "SplashPageSidebar": "alinea-SplashPage-sidebar",
64
+ "SplashPage": "alinea-SplashPage",
65
+ "SplashPage-entry-title": "alinea-SplashPage-entry-title",
66
+ "SplashPageEntryTitle": "alinea-SplashPage-entry-title",
71
67
  "SplashPage-entry-meta": "alinea-SplashPage-entry-meta",
72
68
  "SplashPageEntryMeta": "alinea-SplashPage-entry-meta",
73
- "SplashPage-actionIcon": "alinea-SplashPage-actionIcon",
74
- "SplashPageActionIcon": "alinea-SplashPage-actionIcon",
75
- "SplashPage-entry-visual": "alinea-SplashPage-entry-visual",
76
- "SplashPageEntryVisual": "alinea-SplashPage-entry-visual",
77
69
  "SplashPage-entries": "alinea-SplashPage-entries",
78
70
  "SplashPageEntries": "alinea-SplashPage-entries",
79
- "SplashPage-entry-visual-icon": "alinea-SplashPage-entry-visual-icon",
80
- "SplashPageEntryVisualIcon": "alinea-SplashPage-entry-visual-icon",
81
- "SplashPage-user": "alinea-SplashPage-user",
82
- "SplashPageUser": "alinea-SplashPage-user",
83
- "SplashPage-action": "alinea-SplashPage-action",
84
- "SplashPageAction": "alinea-SplashPage-action",
71
+ "SplashPage-card-header-button": "alinea-SplashPage-card-header-button",
72
+ "SplashPageCardHeaderButton": "alinea-SplashPage-card-header-button",
73
+ "SplashPage-card-header": "alinea-SplashPage-card-header",
74
+ "SplashPageCardHeader": "alinea-SplashPage-card-header",
75
+ "SplashPage-actionIcon": "alinea-SplashPage-actionIcon",
76
+ "SplashPageActionIcon": "alinea-SplashPage-actionIcon",
77
+ "SplashPage-entry": "alinea-SplashPage-entry",
78
+ "SplashPageEntry": "alinea-SplashPage-entry",
79
+ "SplashPage-card-footer": "alinea-SplashPage-card-footer",
80
+ "SplashPageCardFooter": "alinea-SplashPage-card-footer",
81
+ "SplashPage-card-header-content": "alinea-SplashPage-card-header-content",
82
+ "SplashPageCardHeaderContent": "alinea-SplashPage-card-header-content",
83
+ "SplashPage-entry-user": "alinea-SplashPage-entry-user",
84
+ "SplashPageEntryUser": "alinea-SplashPage-entry-user",
85
+ "SplashPage-card": "alinea-SplashPage-card",
86
+ "SplashPageCard": "alinea-SplashPage-card",
85
87
  "SplashPage-card-header-title": "alinea-SplashPage-card-header-title",
86
88
  "SplashPageCardHeaderTitle": "alinea-SplashPage-card-header-title",
87
- "SplashPage-entry-title": "alinea-SplashPage-entry-title",
88
- "SplashPageEntryTitle": "alinea-SplashPage-entry-title",
89
- "SplashPage-root": "alinea-SplashPage-root",
90
- "SplashPageRoot": "alinea-SplashPage-root",
89
+ "SplashPage-sidebar": "alinea-SplashPage-sidebar",
90
+ "SplashPageSidebar": "alinea-SplashPage-sidebar",
91
+ "SplashPage-content": "alinea-SplashPage-content",
92
+ "SplashPageContent": "alinea-SplashPage-content",
93
+ "SplashPage-sidebar-content": "alinea-SplashPage-sidebar-content",
94
+ "SplashPageSidebarContent": "alinea-SplashPage-sidebar-content",
95
+ "SplashPage-card-header-label": "alinea-SplashPage-card-header-label",
96
+ "SplashPageCardHeaderLabel": "alinea-SplashPage-card-header-label",
91
97
  "SplashPage-appearance": "alinea-SplashPage-appearance",
92
98
  "SplashPageAppearance": "alinea-SplashPage-appearance",
93
- "SplashPage-card": "alinea-SplashPage-card",
94
- "SplashPageCard": "alinea-SplashPage-card",
95
- "SplashPage": "alinea-SplashPage",
96
- "SplashPage-card-header": "alinea-SplashPage-card-header",
97
- "SplashPageCardHeader": "alinea-SplashPage-card-header"
99
+ "SplashPage-user": "alinea-SplashPage-user",
100
+ "SplashPageUser": "alinea-SplashPage-user"
98
101
  };
99
102
 
100
103
  // src/dashboard/app/pages/SplashPage.tsx
101
104
  import { jsx, jsxs } from "react/jsx-runtime";
102
105
  var styles = styler(SplashPage_default);
103
106
  var recentEntryCount = 3;
104
- var recentCandidateWindowSize = recentEntryCount;
105
107
  var visibleRootCount = 2;
106
108
  var futureTimestampTolerance = 24 * 60 * 60 * 1e3;
109
+ var recentEntriesAtom = dispense(
110
+ (key) => atom(async (get) => {
111
+ await get(shaAtom);
112
+ const graph = get(graphAtom);
113
+ const policy = get(policyAtom);
114
+ const workspace = get(workspaceAtom(key));
115
+ const readableRoots = Object.keys(workspace.roots).filter(
116
+ (root) => policy.canRead({ workspace: key, root })
117
+ );
118
+ if (!readableRoots.length) return [];
119
+ const everyRoot = readableRoots.length === Object.keys(workspace.roots).length;
120
+ const locales = Math.max(
121
+ 1,
122
+ ...readableRoots.map(
123
+ (root) => getRoot(workspace.roots[root]).i18n?.locales.length ?? 1
124
+ )
125
+ );
126
+ const candidates = await Promise.all(
127
+ [
128
+ { orderBy: { desc: Entry.updatedAt } },
129
+ { orderBy: { desc: Entry.id }, filter: { _updatedAt: null } }
130
+ ].map(
131
+ (order) => graph.find({
132
+ ...order,
133
+ workspace: key,
134
+ root: everyRoot ? void 0 : { in: readableRoots },
135
+ status: "preferDraft",
136
+ take: recentEntryCount * locales,
137
+ select: recentEntrySelection
138
+ })
139
+ )
140
+ );
141
+ const readable = candidates.flat().filter((entry) => policy.canRead(entry));
142
+ const now = Date.now();
143
+ const trustsIdTimestamps = readable.every((entry) => {
144
+ const timestamp = timestampFromId(entry.id);
145
+ return timestamp === void 0 || timestamp <= now + futureTimestampTolerance;
146
+ });
147
+ const latest = /* @__PURE__ */ new Map();
148
+ for (const row of readable) {
149
+ const entry = toRecentEntry(row, trustsIdTimestamps, now);
150
+ if (!entry) continue;
151
+ const seen = latest.get(entry.id);
152
+ if (!seen || entry.changedAt > seen.changedAt) latest.set(entry.id, entry);
153
+ }
154
+ return Array.from(latest.values()).sort(
155
+ (a, b) => b.changedAt - a.changedAt || (a.id < b.id ? 1 : a.id > b.id ? -1 : 0)
156
+ ).slice(0, recentEntryCount);
157
+ })
158
+ );
107
159
  async function splashPage(get) {
108
160
  const canManageMembers = await get(canManageMembersAtom);
109
- await get(shaAtom);
110
- const graph = get(graphAtom);
111
161
  const config = get(configAtom);
112
162
  const policy = get(policyAtom);
113
163
  const summaries = await Promise.all(
@@ -121,42 +171,7 @@ async function splashPage(get) {
121
171
  return [{ icon, key: rootKey, label }];
122
172
  }
123
173
  );
124
- const candidates = await Promise.all(
125
- roots.flatMap(({ key: root }) => [
126
- graph.find({
127
- workspace: key,
128
- root,
129
- status: "preferDraft",
130
- groupBy: Entry.id,
131
- orderBy: { desc: Entry.updatedAt },
132
- take: recentCandidateWindowSize,
133
- select: recentEntrySelection
134
- }),
135
- graph.find({
136
- workspace: key,
137
- root,
138
- status: "preferDraft",
139
- groupBy: Entry.id,
140
- orderBy: { desc: Entry.id },
141
- take: recentCandidateWindowSize,
142
- select: recentEntrySelection
143
- })
144
- ])
145
- );
146
- const readableCandidates = candidates.flat().filter((entry) => policy.canRead(entry));
147
- const now = Date.now();
148
- const trustsIdTimestamps = readableCandidates.every((entry) => {
149
- const timestamp = timestampFromId(entry.id);
150
- return timestamp === void 0 || timestamp <= now + futureTimestampTolerance;
151
- });
152
- const recentEntries = Array.from(
153
- new Map(
154
- readableCandidates.map((entry) => [
155
- entry.id,
156
- toRecentEntry(entry, trustsIdTimestamps, now)
157
- ])
158
- ).values()
159
- ).filter((entry) => Boolean(entry)).sort((a, b) => b.changedAt - a.changedAt).slice(0, recentEntryCount);
174
+ const recentEntries = await get(recentEntriesAtom(key));
160
175
  const entries = recentEntries.map((entry) => {
161
176
  const type = config.schema[entry.type];
162
177
  return {
@@ -61,23 +61,23 @@ import {
61
61
 
62
62
  // src/dashboard/app/pages/UsersPage.module.css
63
63
  var UsersPage_default = {
64
- "UsersPage-roles": "alinea-UsersPage-roles",
65
- "UsersPageRoles": "alinea-UsersPage-roles",
66
- "UsersPage-identity": "alinea-UsersPage-identity",
67
- "UsersPageIdentity": "alinea-UsersPage-identity",
68
- "UsersPage": "alinea-UsersPage",
69
64
  "UsersPage-header": "alinea-UsersPage-header",
70
65
  "UsersPageHeader": "alinea-UsersPage-header",
71
- "UsersPage-table": "alinea-UsersPage-table",
72
- "UsersPageTable": "alinea-UsersPage-table",
66
+ "UsersPage-status": "alinea-UsersPage-status",
67
+ "UsersPageStatus": "alinea-UsersPage-status",
68
+ "UsersPage-identity": "alinea-UsersPage-identity",
69
+ "UsersPageIdentity": "alinea-UsersPage-identity",
70
+ "UsersPage-roles": "alinea-UsersPage-roles",
71
+ "UsersPageRoles": "alinea-UsersPage-roles",
73
72
  "UsersPage-search": "alinea-UsersPage-search",
74
73
  "UsersPageSearch": "alinea-UsersPage-search",
74
+ "UsersPage-table": "alinea-UsersPage-table",
75
+ "UsersPageTable": "alinea-UsersPage-table",
76
+ "UsersPage": "alinea-UsersPage",
75
77
  "UsersPage-createButton": "alinea-UsersPage-createButton",
76
78
  "UsersPageCreateButton": "alinea-UsersPage-createButton",
77
79
  "UsersPage-content": "alinea-UsersPage-content",
78
80
  "UsersPageContent": "alinea-UsersPage-content",
79
- "UsersPage-status": "alinea-UsersPage-status",
80
- "UsersPageStatus": "alinea-UsersPage-status",
81
81
  "UsersPage-form-fields": "alinea-UsersPage-form-fields",
82
82
  "UsersPageFormFields": "alinea-UsersPage-form-fields"
83
83
  };
@@ -25,28 +25,28 @@ import { BlockSheetBoundary } from "../BlockSheet.js";
25
25
 
26
26
  // src/dashboard/app/ui/DashboardModal.module.css
27
27
  var DashboardModal_default = {
28
- "DashboardModalFormBody": "alinea-DashboardModalFormBody",
29
- "DashboardModalDialog-loader": "alinea-DashboardModalDialog-loader",
30
- "DashboardModalDialogLoader": "alinea-DashboardModalDialog-loader",
31
- "DashboardModalFormHeader": "alinea-DashboardModalFormHeader",
32
- "is-loading": "alinea-is-loading",
33
- "isLoading": "alinea-is-loading",
34
- "DashboardModalCloseButton": "alinea-DashboardModalCloseButton",
35
- "DashboardModalContent": "alinea-DashboardModalContent",
36
- "DashboardModalTitle": "alinea-DashboardModalTitle",
37
- "DashboardModalFormFooter": "alinea-DashboardModalFormFooter",
38
- "DashboardModalDialog": "alinea-DashboardModalDialog",
39
28
  "DashboardModalFooter": "alinea-DashboardModalFooter",
40
29
  "DashboardModal": "alinea-DashboardModal",
41
- "DashboardModalForm": "alinea-DashboardModalForm",
42
30
  "DashboardModalDialog-header": "alinea-DashboardModalDialog-header",
43
31
  "DashboardModalDialogHeader": "alinea-DashboardModalDialog-header",
32
+ "DashboardModal-surface": "alinea-DashboardModal-surface",
33
+ "DashboardModalSurface": "alinea-DashboardModal-surface",
44
34
  "DashboardModal-enter": "alinea-DashboardModal-enter",
45
35
  "DashboardModalEnter": "alinea-DashboardModal-enter",
36
+ "DashboardModalDialog-loader": "alinea-DashboardModalDialog-loader",
37
+ "DashboardModalDialogLoader": "alinea-DashboardModalDialog-loader",
38
+ "DashboardModalContent": "alinea-DashboardModalContent",
46
39
  "DashboardModalDialog-controls": "alinea-DashboardModalDialog-controls",
47
40
  "DashboardModalDialogControls": "alinea-DashboardModalDialog-controls",
48
- "DashboardModal-surface": "alinea-DashboardModal-surface",
49
- "DashboardModalSurface": "alinea-DashboardModal-surface"
41
+ "DashboardModalTitle": "alinea-DashboardModalTitle",
42
+ "DashboardModalFormHeader": "alinea-DashboardModalFormHeader",
43
+ "is-loading": "alinea-is-loading",
44
+ "isLoading": "alinea-is-loading",
45
+ "DashboardModalFormBody": "alinea-DashboardModalFormBody",
46
+ "DashboardModalCloseButton": "alinea-DashboardModalCloseButton",
47
+ "DashboardModalDialog": "alinea-DashboardModalDialog",
48
+ "DashboardModalFormFooter": "alinea-DashboardModalFormFooter",
49
+ "DashboardModalForm": "alinea-DashboardModalForm"
50
50
  };
51
51
 
52
52
  // src/dashboard/app/ui/DashboardModal.tsx
@@ -3,6 +3,7 @@ import { type Activity } from '../boot/ActivityEvent.js';
3
3
  export interface DashboardActivity {
4
4
  items: Array<Activity>;
5
5
  isMutating: boolean;
6
+ isSyncing: boolean;
6
7
  hasFailed: boolean;
7
8
  hasBlocked: boolean;
8
9
  canRetry: boolean;
@@ -152,8 +152,8 @@ var uploadProgressAtom = atom(
152
152
  }
153
153
  );
154
154
  function activityState(items) {
155
- const hasFailedMutations = items.some(
156
- (activity) => activity.type === "mutation" && activity.status === "failed"
155
+ const hasFailedRetryable = items.some(
156
+ (activity) => activity.type !== "upload" && activity.status === "failed"
157
157
  );
158
158
  const hasFailedUploads = items.some(
159
159
  (activity) => activity.type === "upload" && activity.status === "failed"
@@ -161,11 +161,14 @@ function activityState(items) {
161
161
  return {
162
162
  items,
163
163
  isMutating: items.some(
164
- (activity) => activity.status === "pending" || activity.status === "running"
164
+ (activity) => activity.type !== "sync" && (activity.status === "pending" || activity.status === "running")
165
165
  ),
166
- hasFailed: hasFailedMutations || hasFailedUploads,
166
+ isSyncing: items.some(
167
+ (activity) => activity.type === "sync" && activity.status === "running"
168
+ ),
169
+ hasFailed: hasFailedRetryable || hasFailedUploads,
167
170
  hasBlocked: items.some((activity) => activity.status === "blocked"),
168
- canRetry: hasFailedMutations,
171
+ canRetry: hasFailedRetryable,
169
172
  canDiscard: hasFailedUploads
170
173
  };
171
174
  }
@@ -4,8 +4,10 @@ export declare const workspaceAtom: (workspaceKey: string) => import("jotai").At
4
4
  export declare const viewAtoms: (key: string) => import("jotai").Atom<ComponentType | undefined>;
5
5
  export declare const typeAtoms: (typeName: string) => import("jotai").Atom<{
6
6
  fields: import("../../core/Type.js").FieldsDefinition;
7
+ settings?: import("../../core/Type.js").FieldsDefinition | undefined;
7
8
  contains?: Array<string | import("../../types.js").Type>;
8
9
  overview?: import("../../types.js").OverviewOptions;
10
+ actions?: Array<import("../../core/View.js").View<import("../../types.js").EntryActionProps>>;
9
11
  orderChildrenBy?: import("../../core/OrderBy.js").OrderBy | Array<import("../../core/OrderBy.js").OrderBy>;
10
12
  hidden?: true;
11
13
  collapsed?: boolean;
@@ -17,6 +17,17 @@ export declare const entrySidebarTabAtom: import("jotai").PrimitiveAtom<EntrySid
17
17
  export declare const entrySidebarOpenAtom: import("jotai").PrimitiveAtom<boolean> & {
18
18
  init: boolean;
19
19
  };
20
+ /**
21
+ * Entries without a preview only have history and references in the sidebar,
22
+ * so it starts closed for them (like the 1.x preview pane) and remembers its
23
+ * own state, leaving the room to the form and wide custom views
24
+ */
25
+ export declare const entrySidebarOpenWithoutPreviewAtom: import("jotai").PrimitiveAtom<boolean> & {
26
+ init: boolean;
27
+ };
28
+ export declare function entrySidebarOpen(hasPreview: boolean): import("jotai").PrimitiveAtom<boolean> & {
29
+ init: boolean;
30
+ };
20
31
  export declare const themeAtom: import("jotai").WritableAtom<DashboardTheme, [update: SetStateAction<DashboardTheme>], void> & {
21
32
  onMount(setTheme: (update: SetStateAction<DashboardTheme>) => void): void;
22
33
  };
@@ -34,6 +34,10 @@ var entrySidebarTabAtom = atom("preview");
34
34
  var entrySidebarOpenAtom = atom(
35
35
  typeof window === "undefined" || !window.matchMedia?.("(max-width: 768px)").matches
36
36
  );
37
+ var entrySidebarOpenWithoutPreviewAtom = atom(false);
38
+ function entrySidebarOpen(hasPreview) {
39
+ return hasPreview ? entrySidebarOpenAtom : entrySidebarOpenWithoutPreviewAtom;
40
+ }
37
41
  var themeAtom = Object.assign(
38
42
  atom(
39
43
  (get) => get(themeStorageAtom),
@@ -76,13 +80,17 @@ function applyDashboardTheme(theme) {
76
80
  });
77
81
  });
78
82
  }
83
+ if (!documentElement.hasAttribute("data-alinea-theme"))
84
+ documentElement.setAttribute("data-alinea-theme", "");
79
85
  if (theme === "system") documentElement.removeAttribute("data-theme");
80
86
  else documentElement.dataset.theme = theme;
81
87
  }
82
88
  export {
83
89
  canLogoutAtom,
84
90
  dashboardMobileAtom,
91
+ entrySidebarOpen,
85
92
  entrySidebarOpenAtom,
93
+ entrySidebarOpenWithoutPreviewAtom,
86
94
  entrySidebarTabAtom,
87
95
  entrySidebarWidthAtom,
88
96
  logoutAtom,
@@ -32,8 +32,12 @@ export interface EditorSection {
32
32
  }> | ((props: {
33
33
  section: Section;
34
34
  }) => ReactNode) | undefined>;
35
+ /** The section has a view or at least one field that is not hidden */
36
+ visible: Atom<boolean>;
35
37
  }
36
38
  export interface EditorField {
39
+ /** The editor of the entry, row or object the field belongs to */
40
+ editor: EditorModel;
37
41
  key: string;
38
42
  value: WritableAtom<unknown, [unknown], void>;
39
43
  options: Atom<FieldOptions<unknown>>;
@@ -61,13 +65,15 @@ export declare class EntryEditor implements EditorModel {
61
65
  }
62
66
  export declare function rootEditor(editor: EditorModel): EditorModel;
63
67
  export declare class EntryEditorSection implements EditorSection {
68
+ editor: EditorModel;
64
69
  section: Section;
65
- constructor(section: Section);
70
+ constructor(editor: EditorModel, section: Section);
66
71
  view: Atom<((props: {
67
72
  section: Section;
68
73
  }) => ReactNode) | ComponentType<{
69
74
  section: Section;
70
75
  }> | undefined>;
76
+ visible: Atom<boolean>;
71
77
  }
72
78
  declare class EntryEditorField implements EditorField {
73
79
  #private;
@@ -8,6 +8,7 @@ import { Field } from "alinea/core/Field";
8
8
  import { Section } from "alinea/core/Section";
9
9
  import { Type } from "alinea/core/Type";
10
10
  import { assert } from "alinea/core/util/Assert";
11
+ import { HiddenField } from "alinea/field/hidden";
11
12
  import {
12
13
  fieldError,
13
14
  policyFieldOptions,
@@ -32,7 +33,7 @@ var EntryEditor = class {
32
33
  (get) => Type.anchors(type, get(node.value))
33
34
  );
34
35
  this.sections = Type.sections(type).map(
35
- (section) => new EntryEditorSection(section)
36
+ (section) => new EntryEditorSection(this, section)
36
37
  );
37
38
  }
38
39
  type;
@@ -62,9 +63,11 @@ function rootEditor(editor) {
62
63
  return editor;
63
64
  }
64
65
  var EntryEditorSection = class {
65
- constructor(section) {
66
+ constructor(editor, section) {
67
+ this.editor = editor;
66
68
  this.section = section;
67
69
  }
70
+ editor;
68
71
  section;
69
72
  view = atom((get) => {
70
73
  const view = Section.view(this.section);
@@ -72,6 +75,15 @@ var EntryEditorSection = class {
72
75
  return get(viewsAtom)[view];
73
76
  return view;
74
77
  });
78
+ visible = atom((get) => {
79
+ if (Section.view(this.section)) return true;
80
+ return Object.values(Section.definition(this.section)).some((value) => {
81
+ if (!Field.isField(value)) return true;
82
+ if (value instanceof HiddenField) return false;
83
+ const info = this.editor.get(value);
84
+ return !info || !get(info.options).hidden;
85
+ });
86
+ });
75
87
  };
76
88
  var EntryEditorField = class {
77
89
  constructor(editor, key, field) {