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
@@ -13,7 +13,7 @@ import {
13
13
  import "../chunks/chunk-CQ52GEHY.js";
14
14
 
15
15
  // src/dashboard/App.tsx
16
- import { Page as PageLayout, Spinner } from "alinea/components";
16
+ import { Page as PageLayout, Spinner, Text } from "alinea/components";
17
17
  import {
18
18
  useDeferredValue,
19
19
  useEffect,
@@ -22,10 +22,12 @@ import {
22
22
 
23
23
  // src/dashboard/App.module.css
24
24
  var App_default = {
25
- "AppLoading-progress": "alinea-AppLoading-progress",
26
- "AppLoadingProgress": "alinea-AppLoading-progress",
25
+ "AppLoading-status": "alinea-AppLoading-status",
26
+ "AppLoadingStatus": "alinea-AppLoading-status",
27
27
  "AppLoading-progress-fade-in": "alinea-AppLoading-progress-fade-in",
28
28
  "AppLoadingProgressFadeIn": "alinea-AppLoading-progress-fade-in",
29
+ "AppLoading-progress": "alinea-AppLoading-progress",
30
+ "AppLoadingProgress": "alinea-AppLoading-progress",
29
31
  "AppLoading": "alinea-AppLoading"
30
32
  };
31
33
 
@@ -45,7 +47,7 @@ import { themeAtom } from "./atoms/dashboard.js";
45
47
  import { workspaceAtom, workspacesAtom } from "./atoms/config.js";
46
48
  import { useDashboardStore } from "./atoms/core.js";
47
49
  import { entryAtoms, MissingEntryError } from "./atoms/entry.js";
48
- import { graphReadyAtom } from "./atoms/graph.js";
50
+ import { graphReadyAtom, syncProgressAtom } from "./atoms/graph.js";
49
51
  import { pageAtom } from "./atoms/nav.js";
50
52
  import { rootAtoms } from "./atoms/root.js";
51
53
  import { canManageMembersAtom, userPolicyReadyAtom } from "./atoms/user.js";
@@ -200,16 +202,29 @@ function DashboardApp(props) {
200
202
  const [appPending, app] = useAtomValueRawSync(appAtom);
201
203
  const shown = useDeferredValue(app);
202
204
  const activity = useAtomValueRaw(activityAtom);
205
+ const sync = useAtomValueRaw(syncProgressAtom);
203
206
  const [, setActivityPending] = useAtom(activityPendingAtom);
204
207
  useAtomValueRaw(themeAtom);
205
- const pending = appPending || shown !== app || activity.isMutating;
208
+ const pending = appPending || shown !== app || activity.isMutating || activity.isSyncing || Boolean(sync);
206
209
  useEffect(() => {
207
210
  setActivityPending(pending);
208
211
  }, [pending, setActivityPending]);
209
212
  return shown ?? /* @__PURE__ */ jsx(AppLoading, {});
210
213
  }
214
+ var fileCount = new Intl.NumberFormat();
211
215
  function AppLoading() {
212
- return /* @__PURE__ */ jsx(PageLayout, { className: styles.AppLoading(), children: /* @__PURE__ */ jsx("div", { className: styles.AppLoading.progress(), children: /* @__PURE__ */ jsx(Spinner, { "aria-label": "Loading dashboard" }) }) });
216
+ const sync = useAtomValueRaw(syncProgressAtom);
217
+ const fetching = sync && sync.loaded < sync.total;
218
+ return /* @__PURE__ */ jsx(PageLayout, { className: styles.AppLoading(), children: /* @__PURE__ */ jsxs("div", { className: styles.AppLoading.progress(), children: [
219
+ /* @__PURE__ */ jsx(
220
+ Spinner,
221
+ {
222
+ "aria-label": "Loading dashboard",
223
+ value: fetching ? Math.round(sync.loaded / sync.total * 100) : void 0
224
+ }
225
+ ),
226
+ sync && /* @__PURE__ */ jsx(Text, { size: "sm", color: "muted", className: styles.AppLoading.status(), children: fetching ? `Syncing content \xB7 ${fileCount.format(sync.loaded)} of ${fileCount.format(sync.total)} files` : "Indexing content" })
227
+ ] }) });
213
228
  }
214
229
  async function entryTitle(page, entryId, get) {
215
230
  try {
@@ -225,5 +240,6 @@ function dashboardTitle(workspace, view) {
225
240
  }
226
241
  export {
227
242
  App,
243
+ AppLoading,
228
244
  appAtom
229
245
  };
@@ -0,0 +1,37 @@
1
+ import type { EntryDefaultView } from 'alinea/core/Type';
2
+ /** A place in the dashboard to navigate to */
3
+ export interface DashboardLocation {
4
+ /** Name of the workspace, leave out with `root` to open an entry by id */
5
+ workspace?: string;
6
+ /** Name of the root, leave out with `workspace` to open an entry by id */
7
+ root?: string;
8
+ /** Id of the entry to open, leave out to open the root */
9
+ entryId?: string;
10
+ /** Locale to open, for roots with translations */
11
+ locale?: string | null;
12
+ /**
13
+ * Open the entry's form (`edit`) or the list of its children (`overview`),
14
+ * for entries with both
15
+ */
16
+ view?: EntryDefaultView;
17
+ }
18
+ /** @internal */
19
+ export declare const nav: {
20
+ splash(): string;
21
+ users(): string;
22
+ /** The editor of the entry at `url`, as linked from a page of the site */
23
+ edit(url: string, workspace?: string, root?: string): string;
24
+ /** The editor of an entry by id, its workspace and root are looked up */
25
+ link(entryId: string, locale?: string | null, view?: EntryDefaultView): string;
26
+ entry(workspace?: string, root?: string, entryId?: string, locale?: string | null, view?: EntryDefaultView, sort?: string, tab?: string): string;
27
+ };
28
+ /**
29
+ * The href of a place in the dashboard, relative to the dashboard's page. An
30
+ * entry can be linked by its id alone, its workspace and root are looked up
31
+ * when the link opens. Outside the dashboard, prefix the dashboard's url.
32
+ *
33
+ * @example
34
+ * <a href={href({entryId: post.id})}>{post.title}</a>
35
+ * const url = `${baseUrl}/admin${href({entryId: post.id})}`
36
+ */
37
+ export declare function href(location: DashboardLocation): string;
@@ -0,0 +1,46 @@
1
+ import "../chunks/chunk-CQ52GEHY.js";
2
+
3
+ // src/dashboard/Href.ts
4
+ var nav = {
5
+ splash() {
6
+ return "/";
7
+ },
8
+ users() {
9
+ return "/users";
10
+ },
11
+ /** The editor of the entry at `url`, as linked from a page of the site */
12
+ edit(url, workspace, root) {
13
+ const params = new URLSearchParams({ url });
14
+ if (workspace) params.set("workspace", workspace);
15
+ if (root) params.set("root", root);
16
+ return `/edit?${params}`;
17
+ },
18
+ /** The editor of an entry by id, its workspace and root are looked up */
19
+ link(entryId, locale, view) {
20
+ const params = new URLSearchParams({ id: entryId });
21
+ if (locale) params.set("locale", locale);
22
+ if (view) params.set("view", view);
23
+ return `/edit?${params}`;
24
+ },
25
+ entry(workspace, root, entryId, locale, view, sort, tab) {
26
+ const rootPart = root ? `${root}${locale ? `:${locale}` : ""}` : "";
27
+ const path = `/entry/${[workspace, rootPart, entryId].filter(Boolean).join("/")}`;
28
+ const params = new URLSearchParams();
29
+ if (view) params.set("view", view);
30
+ if (sort) params.set("sort", sort);
31
+ if (tab) params.set("tab", tab);
32
+ const search = params.toString();
33
+ return search ? `${path}?${search}` : path;
34
+ }
35
+ };
36
+ function href(location) {
37
+ const { workspace, root, entryId, view } = location;
38
+ const locale = location.locale ?? void 0;
39
+ if (entryId && !workspace && !root)
40
+ return `#${nav.link(entryId, locale, view)}`;
41
+ return `#${nav.entry(workspace, root, entryId, locale, view)}`;
42
+ }
43
+ export {
44
+ href,
45
+ nav
46
+ };
@@ -44,30 +44,31 @@ import {
44
44
  discardActivityAtom,
45
45
  retryActivityAtom
46
46
  } from "../atoms/activity.js";
47
+ import { syncProgressAtom } from "../atoms/graph.js";
47
48
  import { routeAtom } from "../atoms/nav.js";
48
49
  import { IcRoundCheck, IcRoundHistory, IcRoundWarning } from "../icons.js";
49
50
 
50
51
  // src/dashboard/app/ActivityStatus.module.css
51
52
  var ActivityStatus_default = {
52
- "ActivityStatus": "alinea-ActivityStatus",
53
+ "ActivityStatus-popover-list": "alinea-ActivityStatus-popover-list",
54
+ "ActivityStatusPopoverList": "alinea-ActivityStatus-popover-list",
53
55
  "is-syncing": "alinea-is-syncing",
54
56
  "isSyncing": "alinea-is-syncing",
57
+ "ActivityStatus-label": "alinea-ActivityStatus-label",
58
+ "ActivityStatusLabel": "alinea-ActivityStatus-label",
55
59
  "ActivityStatus-popover-actions": "alinea-ActivityStatus-popover-actions",
56
60
  "ActivityStatusPopoverActions": "alinea-ActivityStatus-popover-actions",
57
61
  "ActivityStatus-icon": "alinea-ActivityStatus-icon",
58
62
  "ActivityStatusIcon": "alinea-ActivityStatus-icon",
59
- "ActivityStatus-popover-list": "alinea-ActivityStatus-popover-list",
60
- "ActivityStatusPopoverList": "alinea-ActivityStatus-popover-list",
61
- "ActivityStatus-label": "alinea-ActivityStatus-label",
62
- "ActivityStatusLabel": "alinea-ActivityStatus-label",
63
63
  "ActivityStatus-popover-header": "alinea-ActivityStatus-popover-header",
64
64
  "ActivityStatusPopoverHeader": "alinea-ActivityStatus-popover-header",
65
- "ActivityStatus-popover-surface": "alinea-ActivityStatus-popover-surface",
66
- "ActivityStatusPopoverSurface": "alinea-ActivityStatus-popover-surface",
67
65
  "ActivityStatus-popover": "alinea-ActivityStatus-popover",
68
66
  "ActivityStatusPopover": "alinea-ActivityStatus-popover",
67
+ "ActivityStatus-popover-surface": "alinea-ActivityStatus-popover-surface",
68
+ "ActivityStatusPopoverSurface": "alinea-ActivityStatus-popover-surface",
69
69
  "is-failed": "alinea-is-failed",
70
- "isFailed": "alinea-is-failed"
70
+ "isFailed": "alinea-is-failed",
71
+ "ActivityStatus": "alinea-ActivityStatus"
71
72
  };
72
73
 
73
74
  // src/dashboard/app/ActivityStatus.tsx
@@ -101,6 +102,7 @@ function ActivityStatus({
101
102
  }) {
102
103
  const [appPending] = useAtomValueRawSync(appAtom);
103
104
  const activity = useAtomValueRaw(activityAtom);
105
+ const sync = useAtomValueRaw(syncProgressAtom);
104
106
  const retry = useSetAtom(retryActivityAtom);
105
107
  const discard = useSetAtom(discardActivityAtom);
106
108
  const [isOpen, setIsOpen] = useState(false);
@@ -111,7 +113,11 @@ function ActivityStatus({
111
113
  );
112
114
  const wasFailed = useRef(false);
113
115
  const lastActivityLabel = useRef("Finishing up");
114
- const activityLabel = getActivityLabel(appPending, activity.isMutating);
116
+ const activityLabel = getActivityLabel(
117
+ appPending,
118
+ activity.isMutating,
119
+ activity.isSyncing || Boolean(sync)
120
+ );
115
121
  const showSpinner = useAtomValueRaw(activityPendingAtom);
116
122
  if (activityLabel !== void 0) lastActivityLabel.current = activityLabel;
117
123
  const visibleActivityLabel = activityLabel ?? (showSpinner ? lastActivityLabel.current : void 0);
@@ -122,7 +128,14 @@ function ActivityStatus({
122
128
  activity.hasFailed,
123
129
  activity.hasBlocked
124
130
  );
125
- const icon = showSpinner ? /* @__PURE__ */ jsx(Spinner, { "aria-label": label, className: styles.ActivityStatus.icon() }) : activity.hasFailed ? /* @__PURE__ */ jsx(
131
+ const icon = showSpinner ? /* @__PURE__ */ jsx(
132
+ Spinner,
133
+ {
134
+ "aria-label": label,
135
+ value: sync && sync.loaded < sync.total ? Math.round(sync.loaded / sync.total * 100) : void 0,
136
+ className: styles.ActivityStatus.icon()
137
+ }
138
+ ) : activity.hasFailed ? /* @__PURE__ */ jsx(
126
139
  IcRoundWarning,
127
140
  {
128
141
  "aria-hidden": "true",
@@ -246,9 +259,10 @@ function ActivityItem({ activity }) {
246
259
  }
247
260
  );
248
261
  }
249
- function getActivityLabel(isNavigating, isMutating) {
262
+ function getActivityLabel(isNavigating, isMutating, isSyncing) {
250
263
  if (isNavigating) return "Loading page";
251
264
  if (isMutating) return "Syncing changes";
265
+ if (isSyncing) return "Syncing content";
252
266
  }
253
267
  function getStatusLabel(activity, hasFailed, hasBlocked) {
254
268
  if (activity) {
@@ -306,6 +320,7 @@ function activityStatusColor(status) {
306
320
  }
307
321
  }
308
322
  function formatActivityTitle(activity) {
323
+ if (activity.type === "sync") return "Content updates";
309
324
  const uploadTitle = formatUploadTitle(activity);
310
325
  if (uploadTitle) return uploadTitle;
311
326
  const titles = [
@@ -319,7 +334,9 @@ function formatActivityTitle(activity) {
319
334
  return "Content changes";
320
335
  }
321
336
  function formatActivityDescription(activity) {
322
- const details = activity.type === "mutation" && isFileActivity(activity) ? fileMutationDescription(activity.status) : activity.operations.map((operation) => formatActivityOperation(operation, activity.status)).join(" \xB7 ");
337
+ const details = activity.type === "sync" ? syncDescription(activity.status) : activity.type === "mutation" && isFileActivity(activity) ? fileMutationDescription(activity.status) : activity.operations.map(
338
+ (operation) => formatActivityOperation(operation, activity.status)
339
+ ).join(" \xB7 ");
323
340
  const time = /* @__PURE__ */ jsx(Timestamp, { date: activity.finishedAt ?? activity.startedAt, format: "time" });
324
341
  if (!details) return time;
325
342
  return /* @__PURE__ */ jsxs(Fragment, { children: [
@@ -344,6 +361,11 @@ function formatUploadTitle(activity) {
344
361
  const extension = dot < 0 ? "" : upload.title.slice(dot);
345
362
  return created.title.endsWith(extension) ? created.title : `${created.title}${extension}`;
346
363
  }
364
+ function syncDescription(status) {
365
+ if (status === "failed") return "Could not fetch updates";
366
+ if (status === "succeeded") return "Up to date";
367
+ return "Fetching updates";
368
+ }
347
369
  function fileMutationDescription(status) {
348
370
  if (status === "pending" || status === "running")
349
371
  return "Saving uploaded file.";
@@ -28,12 +28,12 @@ import { IcRoundArrowForward, IcRoundPublish } from "../icons.js";
28
28
  // src/dashboard/app/AuthView.module.css
29
29
  var AuthView_default = {
30
30
  "AuthView": "alinea-AuthView",
31
- "AuthView-mark": "alinea-AuthView-mark",
32
- "AuthViewMark": "alinea-AuthView-mark",
33
31
  "AuthView-link": "alinea-AuthView-link",
34
32
  "AuthViewLink": "alinea-AuthView-link",
35
33
  "AuthView-loader": "alinea-AuthView-loader",
36
34
  "AuthViewLoader": "alinea-AuthView-loader",
35
+ "AuthView-mark": "alinea-AuthView-mark",
36
+ "AuthViewMark": "alinea-AuthView-mark",
37
37
  "AuthView-panel": "alinea-AuthView-panel",
38
38
  "AuthViewPanel": "alinea-AuthView-panel"
39
39
  };
@@ -0,0 +1,9 @@
1
+ import { Type } from 'alinea/core/Type';
2
+ import type { EditorNode } from '../atoms/editor.js';
3
+ export interface BlockSettingsProps {
4
+ node: EditorNode;
5
+ type: Type;
6
+ readOnly?: boolean;
7
+ }
8
+ /** The settings fields of a block's type, for its settings sheet */
9
+ export declare function BlockSettings({ node, type, readOnly }: BlockSettingsProps): import("react").JSX.Element | null;
@@ -0,0 +1,16 @@
1
+ import "../../chunks/chunk-CQ52GEHY.js";
2
+
3
+ // src/dashboard/app/BlockSettings.tsx
4
+ import { SheetSection } from "alinea/components";
5
+ import { Type } from "alinea/core/Type";
6
+ import { EditFields } from "./EntryFields.js";
7
+ import { NodeEditor } from "./NodeEditor.js";
8
+ import { jsx } from "react/jsx-runtime";
9
+ function BlockSettings({ node, type, readOnly }) {
10
+ const settings = Type.settings(type);
11
+ if (!settings) return null;
12
+ return /* @__PURE__ */ jsx(SheetSection, { title: "Settings", children: /* @__PURE__ */ jsx(NodeEditor, { node, type, readOnly, children: /* @__PURE__ */ jsx(EditFields, { fields: settings }) }) });
13
+ }
14
+ export {
15
+ BlockSettings
16
+ };
@@ -24,13 +24,13 @@ import { createPortal } from "react-dom";
24
24
 
25
25
  // src/dashboard/app/BlockSheet.module.css
26
26
  var BlockSheet_default = {
27
- "BlockSheet": "alinea-BlockSheet",
28
- "BlockSheet-exit": "alinea-BlockSheet-exit",
29
- "BlockSheetExit": "alinea-BlockSheet-exit",
30
27
  "BlockSheetSlot-host": "alinea-BlockSheetSlot-host",
31
28
  "BlockSheetSlotHost": "alinea-BlockSheetSlot-host",
32
29
  "BlockSheet-enter": "alinea-BlockSheet-enter",
33
30
  "BlockSheetEnter": "alinea-BlockSheet-enter",
31
+ "BlockSheet-exit": "alinea-BlockSheet-exit",
32
+ "BlockSheetExit": "alinea-BlockSheet-exit",
33
+ "BlockSheet": "alinea-BlockSheet",
34
34
  "BlockSheetSlot": "alinea-BlockSheetSlot"
35
35
  };
36
36
 
@@ -10,9 +10,9 @@ import { BlockSheetProvider, BlockSheetSlot } from "./BlockSheet.js";
10
10
  var BlockSheetStoryFrame_default = {
11
11
  "BlockSheetStoryFrame-content": "alinea-BlockSheetStoryFrame-content",
12
12
  "BlockSheetStoryFrameContent": "alinea-BlockSheetStoryFrame-content",
13
+ "BlockSheetStoryFrame": "alinea-BlockSheetStoryFrame",
13
14
  "BlockSheetStoryFrame-panel": "alinea-BlockSheetStoryFrame-panel",
14
- "BlockSheetStoryFramePanel": "alinea-BlockSheetStoryFrame-panel",
15
- "BlockSheetStoryFrame": "alinea-BlockSheetStoryFrame"
15
+ "BlockSheetStoryFramePanel": "alinea-BlockSheetStoryFrame-panel"
16
16
  };
17
17
 
18
18
  // src/dashboard/app/BlockSheetStoryFrame.tsx
@@ -22,31 +22,31 @@ import { viewsAtom } from "../atoms/core.js";
22
22
 
23
23
  // src/dashboard/app/CompactField.module.css
24
24
  var CompactField_default = {
25
- "CompactField-link": "alinea-CompactField-link",
26
- "CompactFieldLink": "alinea-CompactField-link",
27
- "CompactField-muted": "alinea-CompactField-muted",
28
- "CompactFieldMuted": "alinea-CompactField-muted",
29
25
  "CompactField-items": "alinea-CompactField-items",
30
26
  "CompactFieldItems": "alinea-CompactField-items",
31
- "CompactField-link-label": "alinea-CompactField-link-label",
32
- "CompactFieldLinkLabel": "alinea-CompactField-link-label",
33
- "CompactField-json": "alinea-CompactField-json",
34
- "CompactFieldJson": "alinea-CompactField-json",
27
+ "CompactField-link": "alinea-CompactField-link",
28
+ "CompactFieldLink": "alinea-CompactField-link",
35
29
  "CompactField-list-count": "alinea-CompactField-list-count",
36
30
  "CompactFieldListCount": "alinea-CompactField-list-count",
37
- "CompactField": "alinea-CompactField",
38
- "CompactField-text": "alinea-CompactField-text",
39
- "CompactFieldText": "alinea-CompactField-text",
40
- "CompactField-record": "alinea-CompactField-record",
41
- "CompactFieldRecord": "alinea-CompactField-record",
42
31
  "CompactField-record-field": "alinea-CompactField-record-field",
43
32
  "CompactFieldRecordField": "alinea-CompactField-record-field",
33
+ "CompactField-json": "alinea-CompactField-json",
34
+ "CompactFieldJson": "alinea-CompactField-json",
35
+ "CompactField-record-label": "alinea-CompactField-record-label",
36
+ "CompactFieldRecordLabel": "alinea-CompactField-record-label",
37
+ "CompactField-link-label": "alinea-CompactField-link-label",
38
+ "CompactFieldLinkLabel": "alinea-CompactField-link-label",
39
+ "CompactField-muted": "alinea-CompactField-muted",
40
+ "CompactFieldMuted": "alinea-CompactField-muted",
41
+ "CompactField-record": "alinea-CompactField-record",
42
+ "CompactFieldRecord": "alinea-CompactField-record",
44
43
  "CompactField-record-value": "alinea-CompactField-record-value",
45
44
  "CompactFieldRecordValue": "alinea-CompactField-record-value",
45
+ "CompactField": "alinea-CompactField",
46
46
  "CompactField-link-preview": "alinea-CompactField-link-preview",
47
47
  "CompactFieldLinkPreview": "alinea-CompactField-link-preview",
48
- "CompactField-record-label": "alinea-CompactField-record-label",
49
- "CompactFieldRecordLabel": "alinea-CompactField-record-label"
48
+ "CompactField-text": "alinea-CompactField-text",
49
+ "CompactFieldText": "alinea-CompactField-text"
50
50
  };
51
51
 
52
52
  // src/dashboard/app/CompactField.tsx
@@ -10,9 +10,9 @@ import { rotatedSize } from "alinea/core/media/ImageTransform";
10
10
  var CroppedImage_default = {
11
11
  "CroppedImage-image": "alinea-CroppedImage-image",
12
12
  "CroppedImageImage": "alinea-CroppedImage-image",
13
+ "CroppedImage": "alinea-CroppedImage",
13
14
  "CroppedImage-frame": "alinea-CroppedImage-frame",
14
- "CroppedImageFrame": "alinea-CroppedImage-frame",
15
- "CroppedImage": "alinea-CroppedImage"
15
+ "CroppedImageFrame": "alinea-CroppedImage-frame"
16
16
  };
17
17
 
18
18
  // src/dashboard/app/CroppedImage.tsx
@@ -1,7 +1,7 @@
1
1
  import type { WorkspaceInternal } from 'alinea/core/Workspace';
2
2
  import type { Page } from 'alinea/dashboard/atoms/nav';
3
3
  import type { RootAtoms, TreeView } from 'alinea/dashboard/atoms/root';
4
- import type { PropsWithChildren } from 'react';
4
+ import { type PropsWithChildren } from 'react';
5
5
  export interface DashboardLayoutProps extends PropsWithChildren {
6
6
  canManageMembers: boolean;
7
7
  page: Page;
@@ -18,6 +18,7 @@ import {
18
18
  SidebarHeader,
19
19
  SidebarInset
20
20
  } from "alinea/components";
21
+ import { useLayoutEffect } from "react";
21
22
  import { DashboardScope, useDashboardContext } from "../hooks.js";
22
23
  import { IcRoundAdd } from "../icons.js";
23
24
  import { SidebarTree } from "./SidebarTree.js";
@@ -49,6 +50,7 @@ function DashboardLayout({
49
50
  workspace
50
51
  }) {
51
52
  return /* @__PURE__ */ jsxs(DashboardScope, { value: { page, root, workspace }, children: [
53
+ /* @__PURE__ */ jsx(WorkspaceColor, { color: workspace.color }),
52
54
  /* @__PURE__ */ jsxs(AppShell, { children: [
53
55
  /* @__PURE__ */ jsx(WorkspaceRoots, { canManageMembers, page }),
54
56
  /* @__PURE__ */ jsx(AppShellContent, { children: /* @__PURE__ */ jsx(
@@ -76,6 +78,16 @@ function DashboardLayout({
76
78
  /* @__PURE__ */ jsx(MoveConfirmDialog, {})
77
79
  ] });
78
80
  }
81
+ function WorkspaceColor({ color }) {
82
+ useLayoutEffect(() => {
83
+ const { style } = document.documentElement;
84
+ style.setProperty("--alinea-workspace-color", color);
85
+ return () => {
86
+ style.removeProperty("--alinea-workspace-color");
87
+ };
88
+ }, [color]);
89
+ return null;
90
+ }
79
91
  function SidebarCreateEntryButton({ root }) {
80
92
  const { page } = useDashboardContext();
81
93
  const canCreate = useAtomValueRaw(root.tree(page.locale).canCreate);
@@ -0,0 +1,11 @@
1
+ import type { Entry } from 'alinea/core/Entry';
2
+ import type { Type } from 'alinea/core/Type';
3
+ import type { EditorNode } from '../atoms/editor.js';
4
+ export interface EntryActionsProps {
5
+ type: Type;
6
+ node: EditorNode;
7
+ entry: Entry;
8
+ locale: string | null;
9
+ }
10
+ /** The actions configured with the `actions` option of a type */
11
+ export declare function EntryActions({ type, node, entry, locale }: EntryActionsProps): import("react").JSX.Element | null;
@@ -0,0 +1,30 @@
1
+ import {
2
+ useAtomValueRaw
3
+ } from "../../chunks/chunk-D6UJHBJJ.js";
4
+ import "../../chunks/chunk-CFNRVI3Y.js";
5
+ import "../../chunks/chunk-CQ52GEHY.js";
6
+
7
+ // src/dashboard/app/EntryActions.tsx
8
+ import { getType } from "alinea/core/Internal";
9
+ import { resolveView } from "alinea/core/View";
10
+ import { useMemo } from "react";
11
+ import { viewsAtom } from "../atoms/core.js";
12
+ import { dashboardEntry } from "../cms/hooks.js";
13
+ import { NodeEditor } from "./NodeEditor.js";
14
+ import { jsx } from "react/jsx-runtime";
15
+ function EntryActions({ type, node, entry, locale }) {
16
+ const views = useAtomValueRaw(viewsAtom);
17
+ const actions = getType(type).actions ?? [];
18
+ const props = useMemo(
19
+ () => ({ entry: dashboardEntry(entry), locale }),
20
+ [entry, locale]
21
+ );
22
+ if (actions.length === 0) return null;
23
+ return /* @__PURE__ */ jsx(NodeEditor, { node, type, children: actions.map((view, index) => {
24
+ const Action = resolveView(views, view);
25
+ return Action ? /* @__PURE__ */ jsx(Action, { ...props }, index) : null;
26
+ }) });
27
+ }
28
+ export {
29
+ EntryActions
30
+ };
@@ -1,16 +1,29 @@
1
1
  import { Field } from 'alinea/core/Field';
2
2
  import { Section } from 'alinea/core/Section';
3
+ import type { ObjectField } from 'alinea/field/object';
3
4
  export declare function FieldsEditor(): import("react").JSX.Element[];
4
5
  export declare function EntryFields(): import("react").JSX.Element[];
5
6
  export interface EditFieldsProps {
7
+ /**
8
+ * An object field to render the fields of, in the scope of its value.
9
+ * Without `fields` all its fields are rendered.
10
+ */
11
+ field?: ObjectField<object>;
6
12
  /** The fields and sections to render, keyed by name */
7
- fields: Record<string, Field | Section>;
13
+ fields?: Record<string, Field | Section>;
8
14
  }
9
15
  /**
10
16
  * Renders a set of fields and sections with their configured views, laid out
11
17
  * like the default entry form (including each field's `width`).
18
+ *
19
+ * @example
20
+ * // Some fields of an object field, in a custom view of that object
21
+ * <EditFields
22
+ * field={Product.dimensions}
23
+ * fields={{width: Product.dimensions.width}}
24
+ * />
12
25
  */
13
- export declare const EditFields: import("react").MemoExoticComponent<({ fields }: EditFieldsProps) => import("react").JSX.Element>;
26
+ export declare const EditFields: import("react").MemoExoticComponent<({ field, fields }: EditFieldsProps) => import("react").JSX.Element | null>;
14
27
  export interface EditFieldProps {
15
28
  /** The field to render, it must belong to the entry, row or object being edited */
16
29
  field: Field;
@@ -14,13 +14,20 @@ import { Section } from "alinea/core/Section";
14
14
  import { HiddenField } from "alinea/field/hidden";
15
15
  import { memo } from "react";
16
16
  import { EntryEditorSection } from "../atoms/editor.js";
17
- import { useEditor, useFieldOptions, useFieldView } from "../hooks.js";
17
+ import {
18
+ EditorScope,
19
+ useEditor,
20
+ useFieldNode,
21
+ useFieldOptions,
22
+ useFieldView,
23
+ useNodeEditor
24
+ } from "../hooks.js";
18
25
 
19
26
  // src/dashboard/app/EntryFields.module.css
20
27
  var EntryFields_default = {
21
- "EditFields": "alinea-EditFields",
22
28
  "EditField-slot": "alinea-EditField-slot",
23
- "EditFieldSlot": "alinea-EditField-slot"
29
+ "EditFieldSlot": "alinea-EditField-slot",
30
+ "EditFields": "alinea-EditFields"
24
31
  };
25
32
 
26
33
  // src/dashboard/app/EntryFields.tsx
@@ -42,11 +49,19 @@ var FormSection = memo(function FormSection2({ section }) {
42
49
  var EntryFormSection = memo(function EntryFormSection2({
43
50
  section
44
51
  }) {
52
+ const visible = useAtomValueRaw(section.visible);
45
53
  const fields = /* @__PURE__ */ jsx(FormSection, { section });
46
54
  if (Section.view(section.section)) return fields;
55
+ if (!visible) return null;
47
56
  return /* @__PURE__ */ jsx(Surface, { children: /* @__PURE__ */ jsx(SurfaceContent, { children: fields }) });
48
57
  });
49
- var EditFields = memo(function EditFields2({ fields }) {
58
+ var EditFields = memo(function EditFields2({
59
+ field,
60
+ fields
61
+ }) {
62
+ const editor = useEditor();
63
+ if (field) return /* @__PURE__ */ jsx(ObjectFields, { field, fields });
64
+ if (!fields) return null;
50
65
  return /* @__PURE__ */ jsx("div", { className: styles.EditFields(), children: Object.entries(fields).map(([name, value]) => {
51
66
  if (Field.isField(value)) return /* @__PURE__ */ jsx(EditField, { field: value }, name);
52
67
  if (!Section.isSection(value)) return null;
@@ -55,12 +70,18 @@ var EditFields = memo(function EditFields2({ fields }) {
55
70
  {
56
71
  className: styles.EditField.slot(),
57
72
  style: { flexBasis: fieldWidth() },
58
- children: /* @__PURE__ */ jsx(FormSection, { section: new EntryEditorSection(value) })
73
+ children: /* @__PURE__ */ jsx(FormSection, { section: new EntryEditorSection(editor, value) })
59
74
  },
60
75
  name
61
76
  );
62
77
  }) });
63
78
  });
79
+ function ObjectFields({ field, fields }) {
80
+ const type = useFieldOptions(field).fields;
81
+ const node = useFieldNode(field);
82
+ const editor = useNodeEditor(node, type);
83
+ return /* @__PURE__ */ jsx(EditorScope, { editor, children: fields ? /* @__PURE__ */ jsx(EditFields, { fields }) : /* @__PURE__ */ jsx(FieldsEditor, {}) });
84
+ }
64
85
  var EditField = memo(function EditField2({ field }) {
65
86
  const options = useFieldOptions(field);
66
87
  const View = useFieldView(field);
@@ -33,6 +33,7 @@ import { assert } from "alinea/core/util/Assert";
33
33
  import { isRecord } from "alinea/core/util/Objects";
34
34
  import { activityAtom } from "../atoms/activity.js";
35
35
  import { configAtom } from "../atoms/core.js";
36
+ import { EntryActions } from "./EntryActions.js";
36
37
  import { loadMoveTargetsAtom } from "../atoms/move.js";
37
38
  import { routeAtom } from "../atoms/nav.js";
38
39
  import {
@@ -65,17 +66,17 @@ import {
65
66
 
66
67
  // src/dashboard/app/EntryHeader.module.css
67
68
  var EntryHeader_default = {
69
+ "EntryHeader-type": "alinea-EntryHeader-type",
70
+ "EntryHeaderType": "alinea-EntryHeader-type",
71
+ "EntryHeader-status": "alinea-EntryHeader-status",
72
+ "EntryHeaderStatus": "alinea-EntryHeader-status",
73
+ "EntryHeader-actions": "alinea-EntryHeader-actions",
74
+ "EntryHeaderActions": "alinea-EntryHeader-actions",
68
75
  "EntryHeader": "alinea-EntryHeader",
69
76
  "is-dirty": "alinea-is-dirty",
70
77
  "isDirty": "alinea-is-dirty",
71
- "EntryHeader-actions": "alinea-EntryHeader-actions",
72
- "EntryHeaderActions": "alinea-EntryHeader-actions",
73
- "EntryHeader-type": "alinea-EntryHeader-type",
74
- "EntryHeaderType": "alinea-EntryHeader-type",
75
78
  "EntryHeader-sidebarToggle": "alinea-EntryHeader-sidebarToggle",
76
- "EntryHeaderSidebarToggle": "alinea-EntryHeader-sidebarToggle",
77
- "EntryHeader-status": "alinea-EntryHeader-status",
78
- "EntryHeaderStatus": "alinea-EntryHeader-status"
79
+ "EntryHeaderSidebarToggle": "alinea-EntryHeader-sidebarToggle"
79
80
  };
80
81
 
81
82
  // src/dashboard/app/EntryHeader.tsx
@@ -513,6 +514,15 @@ function EntryHeader({
513
514
  )
514
515
  ] }),
515
516
  /* @__PURE__ */ jsxs(PageActions, { className: styles.EntryHeader.actions(), children: [
517
+ /* @__PURE__ */ jsx(
518
+ EntryActions,
519
+ {
520
+ type,
521
+ node,
522
+ entry: selectedEntry,
523
+ locale: localeData.requestedLocale
524
+ }
525
+ ),
516
526
  primaryAction,
517
527
  onSidebarOpenChange && !isSidebarOpen && /* @__PURE__ */ jsx(
518
528
  EntrySidebarToggle,