alinea 2.0.0-preview.11 → 2.0.0-preview.13

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 (268) 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 +16 -8
  5. package/dist/adapter/next/dashboardUrl.d.ts +6 -0
  6. package/dist/adapter/next/dashboardUrl.js +13 -0
  7. package/dist/adapter/next/syncCheck.d.ts +15 -2
  8. package/dist/adapter/next/syncCheck.js +26 -9
  9. package/dist/backend/Handler.js +5 -1
  10. package/dist/backend/api/BlobStore.d.ts +21 -0
  11. package/dist/backend/api/BlobStore.js +63 -0
  12. package/dist/backend/api/CreateBackend.js +10 -8
  13. package/dist/backend/api/DatabaseApi.d.ts +4 -1
  14. package/dist/backend/api/DatabaseApi.js +88 -4
  15. package/dist/backend/api/GithubApi.js +47 -24
  16. package/dist/backend/api/database.js +6 -6
  17. package/dist/bundled.d.ts +687 -248
  18. package/dist/chunks/{bun-sqlite-5SHXN3AT.js → bun-sqlite-RI6BYU5S.js} +3 -3
  19. package/dist/chunks/{chunk-YCQR5GRT.js → chunk-3QFSGTGF.js} +2 -3
  20. package/dist/chunks/{chunk-QJGGYF6E.js → chunk-4ZA6KZHS.js} +5 -5
  21. package/dist/chunks/{chunk-ASYKC6IE.js → chunk-5H4D5JQL.js} +1 -1
  22. package/dist/chunks/{chunk-ETWOY4AL.js → chunk-A2I6MCCS.js} +1 -1
  23. package/dist/chunks/{chunk-W5AXN7GH.js → chunk-CYVOGRSD.js} +1 -2
  24. package/dist/chunks/{chunk-TIJTT5ZI.js → chunk-G43W7AME.js} +1 -0
  25. package/dist/chunks/{chunk-RE523BQ7.js → chunk-HOETF6HN.js} +5829 -5830
  26. package/dist/chunks/{chunk-AIU6CMVT.js → chunk-PTYZMV5G.js} +1 -1
  27. package/dist/chunks/{chunk-JOF663EG.js → chunk-QHHMKJUO.js} +1 -1
  28. package/dist/chunks/{chunk-66YZ47TY.js → chunk-RAR44T5O.js} +1 -1
  29. package/dist/chunks/{chunk-QSN6RH6X.js → chunk-VA6NC3MI.js} +1 -1
  30. package/dist/chunks/{node-sqlite-XVNTNMCY.js → node-sqlite-C7VJ2NSN.js} +3 -3
  31. package/dist/cli/Mcp.js +1 -1
  32. package/dist/cli/Serve.js +1 -1
  33. package/dist/cli/bin.js +2 -3
  34. package/dist/cli/generate/GenerateDashboard.js +17 -5
  35. package/dist/cli/serve/mcp/DevMcp.js +1 -1
  36. package/dist/cli/serve/mcp/McpTools.js +29 -1
  37. package/dist/cli/static/dashboard/entry.js +2 -1
  38. package/dist/cloud/CloudRemote.js +1 -1
  39. package/dist/components/Alert.js +3 -3
  40. package/dist/components/AppShell.js +2 -2
  41. package/dist/components/Badge.d.ts +3 -1
  42. package/dist/components/Badge.js +5 -3
  43. package/dist/components/Breadcrumbs.js +6 -6
  44. package/dist/components/Button.d.ts +6 -1
  45. package/dist/components/Button.js +14 -5
  46. package/dist/components/Calendar.js +20 -20
  47. package/dist/components/Checkbox.js +9 -9
  48. package/dist/components/CheckboxGroup.js +4 -4
  49. package/dist/components/Collapsible.js +3 -3
  50. package/dist/components/ColorSwatch.js +2 -2
  51. package/dist/components/ColorSwatchPicker.js +2 -2
  52. package/dist/components/ComboBox.js +7 -7
  53. package/dist/components/Command.js +10 -9
  54. package/dist/components/ContentCard.d.ts +3 -1
  55. package/dist/components/ContentCard.js +39 -17
  56. package/dist/components/ContentGrid.js +15 -15
  57. package/dist/components/DataList.js +2 -2
  58. package/dist/components/DateField.js +2 -2
  59. package/dist/components/DatePicker.js +2 -2
  60. package/dist/components/DateRangePicker.js +2 -2
  61. package/dist/components/Dialog.js +6 -6
  62. package/dist/components/DropZone.js +4 -4
  63. package/dist/components/DropdownMenu.js +10 -10
  64. package/dist/components/Empty.js +4 -4
  65. package/dist/components/Field.js +8 -8
  66. package/dist/components/List.js +23 -23
  67. package/dist/components/MediaPreview.js +5 -5
  68. package/dist/components/MultipleSelect.js +20 -20
  69. package/dist/components/NavRail.js +4 -4
  70. package/dist/components/NumberField.js +5 -5
  71. package/dist/components/Page.js +5 -5
  72. package/dist/components/Popover.js +2 -2
  73. package/dist/components/PreviewFrame.js +5 -5
  74. package/dist/components/RadioGroup.js +6 -6
  75. package/dist/components/Resizable.js +5 -5
  76. package/dist/components/SearchField.d.ts +6 -1
  77. package/dist/components/SearchField.js +7 -5
  78. package/dist/components/Select.js +14 -14
  79. package/dist/components/Sheet.d.ts +50 -0
  80. package/dist/components/Sheet.js +202 -0
  81. package/dist/components/Sidebar.js +4 -4
  82. package/dist/components/SortableList.d.ts +34 -30
  83. package/dist/components/SortableList.js +162 -265
  84. package/dist/components/Spinner.js +1 -1
  85. package/dist/components/Surface.js +2 -2
  86. package/dist/components/Switch.js +7 -7
  87. package/dist/components/Table.d.ts +3 -1
  88. package/dist/components/Table.js +53 -42
  89. package/dist/components/Tabs.js +5 -5
  90. package/dist/components/TagGroup.js +9 -9
  91. package/dist/components/TextField.js +10 -10
  92. package/dist/components/TimeField.js +8 -8
  93. package/dist/components/Timestamp.js +1 -1
  94. package/dist/components/ToggleGroup.js +2 -2
  95. package/dist/components/Toolbar.js +4 -4
  96. package/dist/components/Tooltip.js +5 -5
  97. package/dist/components/Tree.js +29 -29
  98. package/dist/components/internal/DateControl.js +10 -10
  99. package/dist/components/internal/ListBoxOption.js +13 -13
  100. package/dist/components/internal/Locale.js +2 -2
  101. package/dist/components/internal/PopoverSurface.js +2 -2
  102. package/dist/components/internal/SelectionCheckbox.js +6 -6
  103. package/dist/components/internal/Slot.js +1 -1
  104. package/dist/components/internal/ToggleButton.js +3 -3
  105. package/dist/components/internal/Trigger.js +2 -2
  106. package/dist/components/internal/sortableDrag.d.ts +19 -0
  107. package/dist/components/internal/sortableDrag.js +175 -0
  108. package/dist/components/internal/useDragDrop.js +2 -2
  109. package/dist/components.d.ts +1 -0
  110. package/dist/components.js +1 -0
  111. package/dist/core/Config.d.ts +6 -1
  112. package/dist/core/Document.d.ts +9 -1
  113. package/dist/core/Document.js +31 -6
  114. package/dist/core/Overview.d.ts +2 -4
  115. package/dist/core/TextDoc.d.ts +4 -0
  116. package/dist/core/Validation.d.ts +0 -1
  117. package/dist/core/Validation.js +0 -6
  118. package/dist/core/field/RichTextField.js +23 -4
  119. package/dist/core/media/MediaTypes.js +1 -1
  120. package/dist/core/source/GithubSource.d.ts +4 -0
  121. package/dist/core/source/GithubSource.js +127 -25
  122. package/dist/core/source/GithubUsage.d.ts +21 -0
  123. package/dist/core/source/GithubUsage.js +47 -0
  124. package/dist/dashboard/App.d.ts +2 -2
  125. package/dist/dashboard/App.js +5 -3
  126. package/dist/dashboard/ViewKeys.d.ts +1 -0
  127. package/dist/dashboard/ViewKeys.js +1 -0
  128. package/dist/dashboard/app/ActivityStatus.js +11 -11
  129. package/dist/dashboard/app/AuthView.js +5 -5
  130. package/dist/dashboard/app/BlockSheet.d.ts +50 -0
  131. package/dist/dashboard/app/BlockSheet.js +207 -0
  132. package/dist/dashboard/app/BlockSheetStoryFrame.d.ts +6 -0
  133. package/dist/dashboard/app/BlockSheetStoryFrame.js +29 -0
  134. package/dist/dashboard/app/CompactField.js +15 -15
  135. package/dist/dashboard/app/CroppedImage.js +2 -2
  136. package/dist/dashboard/app/DashboardErrorBoundary.js +3 -3
  137. package/dist/dashboard/app/DashboardLayout.js +3 -1
  138. package/dist/dashboard/app/EntryHeader.js +32 -33
  139. package/dist/dashboard/app/EntryReferences.js +5 -5
  140. package/dist/dashboard/app/EntrySidebar.js +8 -8
  141. package/dist/dashboard/app/EntrySidebarPreview.js +4 -4
  142. package/dist/dashboard/app/EntryStatusIcon.d.ts +23 -0
  143. package/dist/dashboard/app/EntryStatusIcon.js +58 -0
  144. package/dist/dashboard/app/EntryValidationModal.d.ts +6 -5
  145. package/dist/dashboard/app/EntryValidationModal.js +18 -18
  146. package/dist/dashboard/app/Explorer.d.ts +3 -1
  147. package/dist/dashboard/app/Explorer.js +51 -47
  148. package/dist/dashboard/app/ExplorerBatchActions.d.ts +3 -1
  149. package/dist/dashboard/app/ExplorerBatchActions.js +68 -43
  150. package/dist/dashboard/app/ExplorerCards.js +7 -1
  151. package/dist/dashboard/app/ExplorerControls.js +6 -6
  152. package/dist/dashboard/app/ExplorerList.js +5 -5
  153. package/dist/dashboard/app/ExplorerModal.js +1 -1
  154. package/dist/dashboard/app/ExplorerTable.js +14 -11
  155. package/dist/dashboard/app/ImageEditor.js +25 -25
  156. package/dist/dashboard/app/ImagePicker.js +3 -13
  157. package/dist/dashboard/app/LinkPicker.js +29 -27
  158. package/dist/dashboard/app/LocaleMenu.js +7 -7
  159. package/dist/dashboard/app/MediaPreviewCell.js +2 -2
  160. package/dist/dashboard/app/MoveConfirmDialog.d.ts +5 -0
  161. package/dist/dashboard/app/MoveConfirmDialog.js +79 -0
  162. package/dist/dashboard/app/OverviewCell.js +8 -13
  163. package/dist/dashboard/app/ReadOnlyBadge.d.ts +1 -1
  164. package/dist/dashboard/app/RemoveDialog.d.ts +17 -0
  165. package/dist/dashboard/app/{DeleteDialog.js → RemoveDialog.js} +67 -27
  166. package/dist/dashboard/app/RemoveRedirect.d.ts +7 -0
  167. package/dist/dashboard/app/RemoveRedirect.js +123 -0
  168. package/dist/dashboard/app/SearchBar.d.ts +9 -0
  169. package/dist/dashboard/app/SearchBar.js +31 -0
  170. package/dist/dashboard/app/SidebarTree.js +29 -74
  171. package/dist/dashboard/app/WorkspaceMenu.js +8 -8
  172. package/dist/dashboard/app/WorkspaceRoots.js +11 -11
  173. package/dist/dashboard/app/editor/FileEditor.js +16 -16
  174. package/dist/dashboard/app/modals/CreateEntry.js +5 -5
  175. package/dist/dashboard/app/pages/EntryPage.d.ts +2 -1
  176. package/dist/dashboard/app/pages/EntryPage.js +35 -16
  177. package/dist/dashboard/app/pages/SplashPage.js +35 -35
  178. package/dist/dashboard/app/pages/UsersPage.js +14 -14
  179. package/dist/dashboard/app/ui/DashboardModal.js +17 -16
  180. package/dist/dashboard/atoms/dashboard.js +1 -1
  181. package/dist/dashboard/atoms/entry.js +1 -14
  182. package/dist/dashboard/atoms/entryTable.js +1 -0
  183. package/dist/dashboard/atoms/explorer.d.ts +4 -0
  184. package/dist/dashboard/atoms/explorer.js +19 -7
  185. package/dist/dashboard/atoms/graph.js +1 -1
  186. package/dist/dashboard/atoms/link.js +5 -2
  187. package/dist/dashboard/atoms/move.d.ts +5 -0
  188. package/dist/dashboard/atoms/move.js +29 -3
  189. package/dist/dashboard/atoms/moveConfirmation.d.ts +34 -0
  190. package/dist/dashboard/atoms/moveConfirmation.js +95 -0
  191. package/dist/dashboard/atoms/nav.d.ts +9 -5
  192. package/dist/dashboard/atoms/nav.js +120 -45
  193. package/dist/dashboard/atoms/overview.d.ts +6 -5
  194. package/dist/dashboard/atoms/overview.js +2 -16
  195. package/dist/dashboard/atoms/remove.d.ts +112 -0
  196. package/dist/dashboard/atoms/remove.js +268 -0
  197. package/dist/dashboard/atoms/root.d.ts +2 -2
  198. package/dist/dashboard/atoms/root.js +41 -26
  199. package/dist/dashboard/atoms/user.js +1 -1
  200. package/dist/dashboard/atoms/utils.js +1 -1
  201. package/dist/dashboard/boot/Boot.js +25 -17
  202. package/dist/dashboard/boot/BootProd.d.ts +6 -1
  203. package/dist/dashboard/boot/BootProd.js +2 -2
  204. package/dist/dashboard/boot/DashboardWorker.d.ts +1 -0
  205. package/dist/dashboard/boot/DashboardWorker.js +18 -18
  206. package/dist/dashboard/boot/LoadWorker.js +17 -10
  207. package/dist/dashboard/cms/EntryTable.js +6 -3
  208. package/dist/database/BrowserEntryStore.d.ts +17 -29
  209. package/dist/database/BrowserEntryStore.js +116 -144
  210. package/dist/database/DatabaseTables.js +2 -2
  211. package/dist/database/EntryDatabase.js +21 -1
  212. package/dist/database/EntryTransaction.js +0 -35
  213. package/dist/database/EntryUrlAliases.d.ts +4 -0
  214. package/dist/database/EntryUrlAliases.js +16 -10
  215. package/dist/database/driver/RuntimeDatabase.js +3 -3
  216. package/dist/database/driver/WasmDatabase.d.ts +5 -18
  217. package/dist/database/driver/WasmDatabase.js +15 -16
  218. package/dist/database/entry/EntryTable.js +2 -2
  219. package/dist/database/query/EntryQuery.js +1 -1
  220. package/dist/database/query/Relation.js +1 -1
  221. package/dist/database/query/Search.js +2 -2
  222. package/dist/field/check/CheckField.view.js +2 -2
  223. package/dist/field/code/CodeField.view.js +14 -14
  224. package/dist/field/link/EntryLink.d.ts +4 -4
  225. package/dist/field/link/FileLink.d.ts +4 -4
  226. package/dist/field/link/ImageLink.d.ts +4 -4
  227. package/dist/field/link/Link.d.ts +1 -1
  228. package/dist/field/link/LinkField.d.ts +5 -0
  229. package/dist/field/link/LinkField.view.js +246 -372
  230. package/dist/field/link/UrlLink.d.ts +4 -4
  231. package/dist/field/list/ListField.d.ts +2 -0
  232. package/dist/field/list/ListField.view.d.ts +15 -0
  233. package/dist/field/list/ListField.view.js +343 -301
  234. package/dist/field/metadata/MetadataField.d.ts +17 -7
  235. package/dist/field/metadata/MetadataField.js +14 -3
  236. package/dist/field/metadata/MetadataField.view.d.ts +1 -0
  237. package/dist/field/metadata/MetadataField.view.js +27 -23
  238. package/dist/field/richtext/RichTextBlock.d.ts +3 -1
  239. package/dist/field/richtext/RichTextBlock.js +178 -75
  240. package/dist/field/richtext/RichTextBlockHost.js +1 -1
  241. package/dist/field/richtext/RichTextExtensions.js +35 -35
  242. package/dist/field/richtext/RichTextField.view.js +14 -8
  243. package/dist/field/richtext/RichTextInsertMenu.js +43 -27
  244. package/dist/field/views.js +2 -0
  245. package/dist/index.css +490 -309
  246. package/dist/picker/url/UrlPicker.js +1 -0
  247. package/docs/components/badge.md +1 -0
  248. package/docs/components/button.md +1 -0
  249. package/docs/components/content-card.md +1 -0
  250. package/docs/components/search-field.md +1 -0
  251. package/docs/components/sortable-list.md +5 -20
  252. package/docs/components/table.md +1 -0
  253. package/docs/configuration.md +1 -1
  254. package/docs/deploy/self-host.md +1 -1
  255. package/docs/deploy.md +5 -4
  256. package/docs/fields.md +1 -1
  257. package/docs/index.md +1 -1
  258. package/docs/instant-publishing.md +7 -22
  259. package/docs/overviews.md +3 -4
  260. package/docs/upgrading.md +3 -2
  261. package/llms-full.txt +31 -55
  262. package/package.json +2 -3
  263. package/dist/core/db/EntryValidationError.d.ts +0 -13
  264. package/dist/core/db/EntryValidationError.js +0 -23
  265. package/dist/dashboard/app/DeleteDialog.d.ts +0 -11
  266. package/dist/dashboard/atoms/delete.d.ts +0 -68
  267. package/dist/dashboard/atoms/delete.js +0 -143
  268. package/dist/chunks/{chunk-MOWR65LM.js → chunk-PYDOMKJZ.js} +71 -71
@@ -0,0 +1,21 @@
1
+ /**
2
+ * Counts the GitHub requests a source makes against its REST and GraphQL
3
+ * budgets, and logs what each operation spent and what is left, so the logs
4
+ * show where a rate limit goes. Answers of 304 are free and not counted.
5
+ */
6
+ export declare class GithubUsage {
7
+ #private;
8
+ rest: number;
9
+ graphql: number;
10
+ record(response: Response): void;
11
+ /** The requests counted so far, to log what an operation adds. */
12
+ count(): {
13
+ rest: number;
14
+ graphql: number;
15
+ };
16
+ /** Log what `operation` spent since `before`, if anything. */
17
+ log(operation: string, before: {
18
+ rest: number;
19
+ graphql: number;
20
+ }): void;
21
+ }
@@ -0,0 +1,47 @@
1
+ import "../../chunks/chunk-CQ52GEHY.js";
2
+
3
+ // src/core/source/GithubUsage.ts
4
+ var lowBudget = 0.1;
5
+ var GithubUsage = class {
6
+ rest = 0;
7
+ graphql = 0;
8
+ #budgets = /* @__PURE__ */ new Map();
9
+ record(response) {
10
+ if (response.status === 304) return;
11
+ const resource = response.headers.get("x-ratelimit-resource");
12
+ if (resource === "graphql") this.graphql += 1;
13
+ else this.rest += 1;
14
+ const remaining = Number(response.headers.get("x-ratelimit-remaining"));
15
+ const limit = Number(response.headers.get("x-ratelimit-limit"));
16
+ const reset = Number(response.headers.get("x-ratelimit-reset"));
17
+ if (resource && limit > 0 && Number.isFinite(remaining))
18
+ this.#budgets.set(resource, { remaining, limit, reset });
19
+ }
20
+ /** The requests counted so far, to log what an operation adds. */
21
+ count() {
22
+ return { rest: this.rest, graphql: this.graphql };
23
+ }
24
+ /** Log what `operation` spent since `before`, if anything. */
25
+ log(operation, before) {
26
+ const rest = this.rest - before.rest;
27
+ const graphql = this.graphql - before.graphql;
28
+ if (rest === 0 && graphql === 0) return;
29
+ const budgets = [...this.#budgets].map(
30
+ ([resource, { remaining, limit }]) => `${resource === "core" ? "REST" : resource} ${remaining}/${limit} left`
31
+ );
32
+ const reset = Math.min(
33
+ ...[...this.#budgets.values()].map((budget) => budget.reset)
34
+ );
35
+ const resets = Number.isFinite(reset) ? `, resets ${new Date(reset * 1e3).toISOString().slice(11, 16)} UTC` : "";
36
+ const left = budgets.length > 0 ? `; ${budgets.join(", ")}${resets}` : "";
37
+ const message = `Alinea GitHub ${operation}: ${rest} REST, ${graphql} GraphQL requests${left}`;
38
+ const low = [...this.#budgets.values()].some(
39
+ (budget) => budget.remaining < budget.limit * lowBudget
40
+ );
41
+ if (low) console.warn(message);
42
+ else console.info(message);
43
+ }
44
+ };
45
+ export {
46
+ GithubUsage
47
+ };
@@ -2,7 +2,7 @@ import type { Config } from 'alinea/core/Config';
2
2
  import type { LocalConnection } from 'alinea/core/Connection';
3
3
  import type { WriteableGraph } from 'alinea/core/db/WriteableGraph';
4
4
  import type { User } from 'alinea/core/User';
5
- import { type ComponentType } from 'react';
5
+ import { type ComponentType, type ReactNode } from 'react';
6
6
  import './global.css';
7
7
  export interface AppProps {
8
8
  graph: WriteableGraph;
@@ -15,5 +15,5 @@ export interface AppProps {
15
15
  /** The user shown as signed in when the dashboard runs locally */
16
16
  user?: User;
17
17
  }
18
- export declare const appAtom: import("jotai").Atom<readonly [false, import("react").JSX.Element] | readonly [true, import("react").JSX.Element | undefined]>;
18
+ export declare const appAtom: import("jotai").Atom<readonly [false, string | number | bigint | boolean | import("react").JSX.Element | Iterable<ReactNode> | null | undefined] | readonly [true, string | number | bigint | boolean | import("react").JSX.Element | Iterable<ReactNode> | null | undefined]>;
19
19
  export declare function App(props: AppProps): import("react").JSX.Element;
@@ -22,11 +22,11 @@ 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
27
  "AppLoading-progress-fade-in": "alinea-AppLoading-progress-fade-in",
26
28
  "AppLoadingProgressFadeIn": "alinea-AppLoading-progress-fade-in",
27
- "AppLoading": "alinea-AppLoading",
28
- "AppLoading-progress": "alinea-AppLoading-progress",
29
- "AppLoadingProgress": "alinea-AppLoading-progress"
29
+ "AppLoading": "alinea-AppLoading"
30
30
  };
31
31
 
32
32
  // src/dashboard/App.tsx
@@ -76,6 +76,8 @@ var authenticatedAtom = atom(async (get) => {
76
76
  title: dashboardTitle(workspaceData?.label ?? "Alinea", label)
77
77
  }
78
78
  );
79
+ if (page.type === "edit") return new Promise(() => {
80
+ });
79
81
  if (page.type === "users") {
80
82
  if (!canManageMembers) {
81
83
  return /* @__PURE__ */ jsxs(Fragment, { children: [
@@ -15,6 +15,7 @@ export declare const viewKeys: {
15
15
  MetadataUserInput: string;
16
16
  MetadataInput: string;
17
17
  MetadataDetailsView: string;
18
+ MetadataPreviewsView: string;
18
19
  NumberInput: string;
19
20
  ObjectInput: string;
20
21
  PathInput: string;
@@ -18,6 +18,7 @@ var viewKeys = {
18
18
  MetadataUserInput: "alinea/field/metadata/MetadataField.view#MetadataUserFieldView",
19
19
  MetadataInput: "alinea/field/metadata/MetadataField.view#MetadataFieldView",
20
20
  MetadataDetailsView: "alinea/field/metadata/MetadataField.view#MetadataDetailsView",
21
+ MetadataPreviewsView: "alinea/field/metadata/MetadataField.view#MetadataPreviewsView",
21
22
  NumberInput: "alinea/field/number/NumberField.view#NumberFieldView",
22
23
  ObjectInput: "alinea/field/object/ObjectField.view#ObjectFieldView",
23
24
  PathInput: "alinea/field/path/PathField.view#PathFieldView",
@@ -49,25 +49,25 @@ import { IcRoundCheck, IcRoundHistory, IcRoundWarning } from "../icons.js";
49
49
 
50
50
  // src/dashboard/app/ActivityStatus.module.css
51
51
  var ActivityStatus_default = {
52
- "ActivityStatus-popover-surface": "alinea-ActivityStatus-popover-surface",
53
- "ActivityStatusPopoverSurface": "alinea-ActivityStatus-popover-surface",
52
+ "ActivityStatus": "alinea-ActivityStatus",
53
+ "is-syncing": "alinea-is-syncing",
54
+ "isSyncing": "alinea-is-syncing",
54
55
  "ActivityStatus-popover-actions": "alinea-ActivityStatus-popover-actions",
55
56
  "ActivityStatusPopoverActions": "alinea-ActivityStatus-popover-actions",
56
57
  "ActivityStatus-icon": "alinea-ActivityStatus-icon",
57
58
  "ActivityStatusIcon": "alinea-ActivityStatus-icon",
58
- "ActivityStatus-popover": "alinea-ActivityStatus-popover",
59
- "ActivityStatusPopover": "alinea-ActivityStatus-popover",
59
+ "ActivityStatus-popover-list": "alinea-ActivityStatus-popover-list",
60
+ "ActivityStatusPopoverList": "alinea-ActivityStatus-popover-list",
60
61
  "ActivityStatus-label": "alinea-ActivityStatus-label",
61
62
  "ActivityStatusLabel": "alinea-ActivityStatus-label",
62
- "is-failed": "alinea-is-failed",
63
- "isFailed": "alinea-is-failed",
64
63
  "ActivityStatus-popover-header": "alinea-ActivityStatus-popover-header",
65
64
  "ActivityStatusPopoverHeader": "alinea-ActivityStatus-popover-header",
66
- "ActivityStatus": "alinea-ActivityStatus",
67
- "is-syncing": "alinea-is-syncing",
68
- "isSyncing": "alinea-is-syncing",
69
- "ActivityStatus-popover-list": "alinea-ActivityStatus-popover-list",
70
- "ActivityStatusPopoverList": "alinea-ActivityStatus-popover-list"
65
+ "ActivityStatus-popover-surface": "alinea-ActivityStatus-popover-surface",
66
+ "ActivityStatusPopoverSurface": "alinea-ActivityStatus-popover-surface",
67
+ "ActivityStatus-popover": "alinea-ActivityStatus-popover",
68
+ "ActivityStatusPopover": "alinea-ActivityStatus-popover",
69
+ "is-failed": "alinea-is-failed",
70
+ "isFailed": "alinea-is-failed"
71
71
  };
72
72
 
73
73
  // src/dashboard/app/ActivityStatus.tsx
@@ -27,15 +27,15 @@ import { IcRoundArrowForward, IcRoundPublish } from "../icons.js";
27
27
 
28
28
  // src/dashboard/app/AuthView.module.css
29
29
  var AuthView_default = {
30
- "AuthView-panel": "alinea-AuthView-panel",
31
- "AuthViewPanel": "alinea-AuthView-panel",
30
+ "AuthView": "alinea-AuthView",
32
31
  "AuthView-mark": "alinea-AuthView-mark",
33
32
  "AuthViewMark": "alinea-AuthView-mark",
34
- "AuthView-loader": "alinea-AuthView-loader",
35
- "AuthViewLoader": "alinea-AuthView-loader",
36
33
  "AuthView-link": "alinea-AuthView-link",
37
34
  "AuthViewLink": "alinea-AuthView-link",
38
- "AuthView": "alinea-AuthView"
35
+ "AuthView-loader": "alinea-AuthView-loader",
36
+ "AuthViewLoader": "alinea-AuthView-loader",
37
+ "AuthView-panel": "alinea-AuthView-panel",
38
+ "AuthViewPanel": "alinea-AuthView-panel"
39
39
  };
40
40
 
41
41
  // src/dashboard/app/AuthView.tsx
@@ -0,0 +1,50 @@
1
+ import type { StyleProps } from 'alinea/components';
2
+ import { type ReactNode } from 'react';
3
+ declare const triggerAttribute = "data-block-sheet-trigger";
4
+ export interface BlockSheetProviderProps {
5
+ children: ReactNode;
6
+ }
7
+ /** Holds the block settings sheet of an entry editor, one open at a time */
8
+ export declare function BlockSheetProvider({ children }: BlockSheetProviderProps): import("react").JSX.Element;
9
+ export interface BlockSheetBoundaryProps {
10
+ children: ReactNode;
11
+ }
12
+ /**
13
+ * Fields inside have no block settings sheet, eg. in a modal that covers the
14
+ * sidebar the sheet would open in
15
+ */
16
+ export declare function BlockSheetBoundary({ children }: BlockSheetBoundaryProps): import("react").JSX.Element;
17
+ export interface BlockSheetSlotProps extends StyleProps {
18
+ }
19
+ /** Where the open sheet renders, covers its positioned container */
20
+ export declare function BlockSheetSlot({ className, style }: BlockSheetSlotProps): import("react").JSX.Element;
21
+ export interface BlockSheetTriggerProps {
22
+ [triggerAttribute]: string;
23
+ }
24
+ export interface BlockSheetState {
25
+ /** False outside an entry editor, where there is no sidebar to cover */
26
+ available: boolean;
27
+ open: boolean;
28
+ /**
29
+ * Spread on the button that toggles the sheet, so moving focus to it
30
+ * doesn't close the sheet before the toggle
31
+ */
32
+ triggerProps: BlockSheetTriggerProps;
33
+ setOpen(open: boolean): void;
34
+ toggle(): void;
35
+ }
36
+ /** Open state of the sheet of block `id`, closed outside an entry editor */
37
+ export declare function useBlockSheet(id: string): BlockSheetState;
38
+ /** Whether any block sheet is open or still animating out */
39
+ export declare function useBlockSheetOpen(): boolean;
40
+ export interface BlockSheetProps {
41
+ id: string;
42
+ children: ReactNode;
43
+ }
44
+ /**
45
+ * Renders the sheet of block `id` in the slot while it is open. A portal
46
+ * keeps the sheet owned by its block, so its fields keep the block's node,
47
+ * editor context, local state and callbacks.
48
+ */
49
+ export declare function BlockSheet({ id, children }: BlockSheetProps): import("react").ReactPortal | null;
50
+ export {};
@@ -0,0 +1,207 @@
1
+ import {
2
+ useAtomValueRaw,
3
+ useStore
4
+ } from "../../chunks/chunk-D6UJHBJJ.js";
5
+ import {
6
+ atom
7
+ } from "../../chunks/chunk-CFNRVI3Y.js";
8
+ import {
9
+ styler
10
+ } from "../../chunks/chunk-I4OYYAX5.js";
11
+ import "../../chunks/chunk-CQ52GEHY.js";
12
+
13
+ // src/dashboard/app/BlockSheet.tsx
14
+ import {
15
+ createContext,
16
+ useCallback,
17
+ useContext,
18
+ useEffect,
19
+ useMemo,
20
+ useRef,
21
+ useState
22
+ } from "react";
23
+ import { createPortal } from "react-dom";
24
+
25
+ // src/dashboard/app/BlockSheet.module.css
26
+ var BlockSheet_default = {
27
+ "BlockSheet": "alinea-BlockSheet",
28
+ "BlockSheet-exit": "alinea-BlockSheet-exit",
29
+ "BlockSheetExit": "alinea-BlockSheet-exit",
30
+ "BlockSheetSlot-host": "alinea-BlockSheetSlot-host",
31
+ "BlockSheetSlotHost": "alinea-BlockSheetSlot-host",
32
+ "BlockSheet-enter": "alinea-BlockSheet-enter",
33
+ "BlockSheetEnter": "alinea-BlockSheet-enter",
34
+ "BlockSheetSlot": "alinea-BlockSheetSlot"
35
+ };
36
+
37
+ // src/dashboard/app/BlockSheet.tsx
38
+ import { jsx } from "react/jsx-runtime";
39
+ var styles = styler(BlockSheet_default);
40
+ var BlockSheetContext = createContext(null);
41
+ var closed = atom(false);
42
+ var none = atom(null);
43
+ var exit = 180;
44
+ var triggerAttribute = "data-block-sheet-trigger";
45
+ function blockSheetContext() {
46
+ const current = atom(null);
47
+ const leaving = atom(null);
48
+ const open = atom(
49
+ (get) => get(current),
50
+ (get, set, next) => {
51
+ const previous = get(current);
52
+ const id = typeof next === "function" ? next(previous) : next;
53
+ set(current, id);
54
+ const left = id === null ? previous : null;
55
+ set(leaving, left);
56
+ if (left)
57
+ setTimeout(() => set(leaving, (now) => now === left ? null : now), exit);
58
+ }
59
+ );
60
+ return { open, leaving, host: atom(null) };
61
+ }
62
+ function BlockSheetProvider({ children }) {
63
+ const [context] = useState(blockSheetContext);
64
+ return /* @__PURE__ */ jsx(BlockSheetContext.Provider, { value: context, children });
65
+ }
66
+ function BlockSheetBoundary({ children }) {
67
+ return /* @__PURE__ */ jsx(BlockSheetContext.Provider, { value: null, children });
68
+ }
69
+ function BlockSheetSlot({ className, style }) {
70
+ const context = useContext(BlockSheetContext);
71
+ const store = useStore();
72
+ const ref = useCallback(
73
+ (element) => {
74
+ if (context) store.set(context.host, element);
75
+ },
76
+ [context, store]
77
+ );
78
+ return /* @__PURE__ */ jsx(
79
+ "div",
80
+ {
81
+ className: styles.BlockSheetSlot(styler.merge({ className })),
82
+ style,
83
+ children: /* @__PURE__ */ jsx("div", { ref, className: styles.BlockSheetSlot.host() })
84
+ }
85
+ );
86
+ }
87
+ function useBlockSheet(id) {
88
+ const context = useContext(BlockSheetContext);
89
+ const store = useStore();
90
+ const open = useAtomValueRaw(
91
+ useMemo(
92
+ () => context ? atom((get) => get(context.open) === id) : closed,
93
+ [context, id]
94
+ )
95
+ );
96
+ useEffect(() => {
97
+ if (!context) return;
98
+ return () => {
99
+ store.set(context.open, (current) => current === id ? null : current);
100
+ };
101
+ }, [context, store, id]);
102
+ return {
103
+ available: Boolean(context),
104
+ open,
105
+ triggerProps: { [triggerAttribute]: id },
106
+ setOpen(open2) {
107
+ if (!context) return;
108
+ store.set(
109
+ context.open,
110
+ (current) => open2 ? id : current === id ? null : current
111
+ );
112
+ },
113
+ toggle() {
114
+ if (!context) return;
115
+ store.set(context.open, (current) => current === id ? null : id);
116
+ }
117
+ };
118
+ }
119
+ function useBlockSheetOpen() {
120
+ const context = useContext(BlockSheetContext);
121
+ return useAtomValueRaw(
122
+ useMemo(
123
+ () => context ? atom(
124
+ (get) => get(context.open) !== null || get(context.leaving) !== null
125
+ ) : closed,
126
+ [context]
127
+ )
128
+ );
129
+ }
130
+ function BlockSheet({ id, children }) {
131
+ const context = useContext(BlockSheetContext);
132
+ const store = useStore();
133
+ const state = useAtomValueRaw(
134
+ useMemo(
135
+ () => context ? atom(
136
+ (get) => get(context.open) === id ? "open" : get(context.leaving) === id ? "closing" : null
137
+ ) : none,
138
+ [context, id]
139
+ )
140
+ );
141
+ const host = useAtomValueRaw(
142
+ useMemo(
143
+ () => context ? atom(
144
+ (get) => get(context.open) === id || get(context.leaving) === id ? get(context.host) : null
145
+ ) : none,
146
+ [context, id]
147
+ )
148
+ );
149
+ const open = state === "open";
150
+ const focusInside = useRef(null);
151
+ useEffect(() => {
152
+ if (!context || !open) return;
153
+ const close = () => store.set(context.open, (current) => current === id ? null : current);
154
+ const onFocusIn = (event) => {
155
+ if (focusInside.current === event) return;
156
+ const target = event.target;
157
+ if (target instanceof Element && target.closest(`[${triggerAttribute}]`))
158
+ return;
159
+ close();
160
+ };
161
+ document.addEventListener("focusin", onFocusIn);
162
+ return () => document.removeEventListener("focusin", onFocusIn);
163
+ }, [context, store, open, id]);
164
+ function onBlur(event) {
165
+ if (!context || !open || event.relatedTarget) return;
166
+ setTimeout(() => {
167
+ const active = document.activeElement;
168
+ if (!document.hasFocus() || active && active !== document.body) return;
169
+ store.set(context.open, (current) => current === id ? null : current);
170
+ });
171
+ }
172
+ useEffect(() => {
173
+ if (!context || !open) return;
174
+ const onKeyDown = (event) => {
175
+ if (event.key !== "Escape" || event.defaultPrevented) return;
176
+ if (host?.closest('[inert], [aria-hidden="true"]')) return;
177
+ store.set(context.open, (current) => current === id ? null : current);
178
+ };
179
+ document.addEventListener("keydown", onKeyDown);
180
+ return () => document.removeEventListener("keydown", onKeyDown);
181
+ }, [context, store, host, open, id]);
182
+ if (!host || !state) return null;
183
+ return createPortal(
184
+ /* @__PURE__ */ jsx(
185
+ "div",
186
+ {
187
+ className: styles.BlockSheet(),
188
+ "data-closing": !open || void 0,
189
+ inert: !open,
190
+ onFocusCapture: (event) => {
191
+ focusInside.current = event.nativeEvent;
192
+ },
193
+ onBlur,
194
+ children
195
+ }
196
+ ),
197
+ host
198
+ );
199
+ }
200
+ export {
201
+ BlockSheet,
202
+ BlockSheetBoundary,
203
+ BlockSheetProvider,
204
+ BlockSheetSlot,
205
+ useBlockSheet,
206
+ useBlockSheetOpen
207
+ };
@@ -0,0 +1,6 @@
1
+ import type { ReactNode } from 'react';
2
+ export interface BlockSheetStoryFrameProps {
3
+ children: ReactNode;
4
+ }
5
+ /** Shows field stories next to a panel that hosts their block sheets */
6
+ export declare function BlockSheetStoryFrame({ children }: BlockSheetStoryFrameProps): import("react").JSX.Element;
@@ -0,0 +1,29 @@
1
+ import {
2
+ styler
3
+ } from "../../chunks/chunk-I4OYYAX5.js";
4
+ import "../../chunks/chunk-CQ52GEHY.js";
5
+
6
+ // src/dashboard/app/BlockSheetStoryFrame.tsx
7
+ import { BlockSheetProvider, BlockSheetSlot } from "./BlockSheet.js";
8
+
9
+ // src/dashboard/app/BlockSheetStoryFrame.module.css
10
+ var BlockSheetStoryFrame_default = {
11
+ "BlockSheetStoryFrame-content": "alinea-BlockSheetStoryFrame-content",
12
+ "BlockSheetStoryFrameContent": "alinea-BlockSheetStoryFrame-content",
13
+ "BlockSheetStoryFrame-panel": "alinea-BlockSheetStoryFrame-panel",
14
+ "BlockSheetStoryFramePanel": "alinea-BlockSheetStoryFrame-panel",
15
+ "BlockSheetStoryFrame": "alinea-BlockSheetStoryFrame"
16
+ };
17
+
18
+ // src/dashboard/app/BlockSheetStoryFrame.tsx
19
+ import { jsx, jsxs } from "react/jsx-runtime";
20
+ var styles = styler(BlockSheetStoryFrame_default);
21
+ function BlockSheetStoryFrame({ children }) {
22
+ return /* @__PURE__ */ jsx(BlockSheetProvider, { children: /* @__PURE__ */ jsxs("div", { className: styles.BlockSheetStoryFrame(), children: [
23
+ /* @__PURE__ */ jsx("div", { className: styles.BlockSheetStoryFrame.content(), children }),
24
+ /* @__PURE__ */ jsx("div", { className: styles.BlockSheetStoryFrame.panel(), children: /* @__PURE__ */ jsx(BlockSheetSlot, {}) })
25
+ ] }) });
26
+ }
27
+ export {
28
+ BlockSheetStoryFrame
29
+ };
@@ -24,29 +24,29 @@ import { viewsAtom } from "../atoms/core.js";
24
24
  var CompactField_default = {
25
25
  "CompactField-link": "alinea-CompactField-link",
26
26
  "CompactFieldLink": "alinea-CompactField-link",
27
- "CompactField-record-value": "alinea-CompactField-record-value",
28
- "CompactFieldRecordValue": "alinea-CompactField-record-value",
29
- "CompactField-link-preview": "alinea-CompactField-link-preview",
30
- "CompactFieldLinkPreview": "alinea-CompactField-link-preview",
31
- "CompactField-link-label": "alinea-CompactField-link-label",
32
- "CompactFieldLinkLabel": "alinea-CompactField-link-label",
33
- "CompactField": "alinea-CompactField",
34
27
  "CompactField-muted": "alinea-CompactField-muted",
35
28
  "CompactFieldMuted": "alinea-CompactField-muted",
36
- "CompactField-list-count": "alinea-CompactField-list-count",
37
- "CompactFieldListCount": "alinea-CompactField-list-count",
38
29
  "CompactField-items": "alinea-CompactField-items",
39
30
  "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",
35
+ "CompactField-list-count": "alinea-CompactField-list-count",
36
+ "CompactFieldListCount": "alinea-CompactField-list-count",
37
+ "CompactField": "alinea-CompactField",
38
+ "CompactField-text": "alinea-CompactField-text",
39
+ "CompactFieldText": "alinea-CompactField-text",
40
40
  "CompactField-record": "alinea-CompactField-record",
41
41
  "CompactFieldRecord": "alinea-CompactField-record",
42
- "CompactField-record-label": "alinea-CompactField-record-label",
43
- "CompactFieldRecordLabel": "alinea-CompactField-record-label",
44
42
  "CompactField-record-field": "alinea-CompactField-record-field",
45
43
  "CompactFieldRecordField": "alinea-CompactField-record-field",
46
- "CompactField-json": "alinea-CompactField-json",
47
- "CompactFieldJson": "alinea-CompactField-json",
48
- "CompactField-text": "alinea-CompactField-text",
49
- "CompactFieldText": "alinea-CompactField-text"
44
+ "CompactField-record-value": "alinea-CompactField-record-value",
45
+ "CompactFieldRecordValue": "alinea-CompactField-record-value",
46
+ "CompactField-link-preview": "alinea-CompactField-link-preview",
47
+ "CompactFieldLinkPreview": "alinea-CompactField-link-preview",
48
+ "CompactField-record-label": "alinea-CompactField-record-label",
49
+ "CompactFieldRecordLabel": "alinea-CompactField-record-label"
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",
14
13
  "CroppedImage-frame": "alinea-CroppedImage-frame",
15
- "CroppedImageFrame": "alinea-CroppedImage-frame"
14
+ "CroppedImageFrame": "alinea-CroppedImage-frame",
15
+ "CroppedImage": "alinea-CroppedImage"
16
16
  };
17
17
 
18
18
  // src/dashboard/app/CroppedImage.tsx
@@ -74,11 +74,11 @@ import { IcRoundWarning } from "../icons.js";
74
74
 
75
75
  // src/dashboard/app/DashboardErrorBoundary.module.css
76
76
  var DashboardErrorBoundary_default = {
77
- "DashboardErrorBoundary-message": "alinea-DashboardErrorBoundary-message",
78
- "DashboardErrorBoundaryMessage": "alinea-DashboardErrorBoundary-message",
79
77
  "DashboardErrorBoundary": "alinea-DashboardErrorBoundary",
80
78
  "DashboardErrorBoundary-media": "alinea-DashboardErrorBoundary-media",
81
- "DashboardErrorBoundaryMedia": "alinea-DashboardErrorBoundary-media"
79
+ "DashboardErrorBoundaryMedia": "alinea-DashboardErrorBoundary-media",
80
+ "DashboardErrorBoundary-message": "alinea-DashboardErrorBoundary-message",
81
+ "DashboardErrorBoundaryMessage": "alinea-DashboardErrorBoundary-message"
82
82
  };
83
83
 
84
84
  // src/dashboard/app/DashboardErrorBoundary.tsx
@@ -25,6 +25,7 @@ import { SidebarLayout } from "./SidebarLayout.js";
25
25
  import { WorkspaceMenu } from "./WorkspaceMenu.js";
26
26
  import { WorkspaceRoots } from "./WorkspaceRoots.js";
27
27
  import { CreateEntry } from "./modals/CreateEntry.js";
28
+ import { MoveConfirmDialog } from "./MoveConfirmDialog.js";
28
29
  import { PendingUploadsDialog } from "./PendingUploadsDialog.js";
29
30
  import { DashboardModal } from "./ui/DashboardModal.js";
30
31
 
@@ -71,7 +72,8 @@ function DashboardLayout({
71
72
  }
72
73
  ) })
73
74
  ] }),
74
- /* @__PURE__ */ jsx(PendingUploadsDialog, {})
75
+ /* @__PURE__ */ jsx(PendingUploadsDialog, {}),
76
+ /* @__PURE__ */ jsx(MoveConfirmDialog, {})
75
77
  ] });
76
78
  }
77
79
  function SidebarCreateEntryButton({ root }) {