alinea 2.0.0-preview.1 → 2.0.0-preview.3

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 (220) hide show
  1. package/dist/.init/content/pages/welcome.json +1 -1
  2. package/dist/LICENSES.md +34 -7
  3. package/dist/adapter/next/DevRemote.d.ts +3 -0
  4. package/dist/adapter/next/DevRemote.js +37 -0
  5. package/dist/adapter/next/ForwardCredentials.d.ts +1 -0
  6. package/dist/adapter/next/ForwardCredentials.js +17 -0
  7. package/dist/adapter/next/cms.js +86 -38
  8. package/dist/adapter/next/context.d.ts +1 -1
  9. package/dist/adapter/next/context.js +11 -3
  10. package/dist/adapter/next/handler.d.ts +2 -0
  11. package/dist/adapter/next/handler.js +23 -16
  12. package/dist/adapter/next/previews.js +3 -1
  13. package/dist/adapter/next/previews.spec.d.ts +1 -0
  14. package/dist/adapter/next/with-alinea.js +18 -16
  15. package/dist/backend/Handler.d.ts +14 -13
  16. package/dist/backend/Handler.js +53 -22
  17. package/dist/backend/resolver/ParsePreview.d.ts +8 -4
  18. package/dist/backend/resolver/ParsePreview.js +40 -43
  19. package/dist/bundled.d.ts +318 -77
  20. package/dist/chunks/{chunk-LUBOGJCG.js → chunk-6V4TAD2N.js} +1 -1
  21. package/dist/chunks/{chunk-TL7ZW6BX.js → chunk-A3XXZBOQ.js} +2535 -2999
  22. package/dist/chunks/chunk-AC5ATYI3.js +1434 -0
  23. package/dist/chunks/{chunk-FRYHNUEK.js → chunk-HFBZMKIN.js} +6 -3
  24. package/dist/chunks/{chunk-7ORQ7BYK.js → chunk-KMLLLZ6X.js} +202 -269
  25. package/dist/chunks/{chunk-IWN3T3FL.js → chunk-O7XWTMCB.js} +1 -1
  26. package/dist/chunks/{chunk-53DZYORR.js → chunk-PAYSVIYI.js} +76 -176
  27. package/dist/chunks/{chunk-YK3OSMDM.js → chunk-S4AU6SRS.js} +188 -158
  28. package/dist/chunks/{chunk-I7X64JTZ.js → chunk-VXZM6V4P.js} +4 -4
  29. package/dist/cli/Generate.js +3 -13
  30. package/dist/cli/Serve.js +7 -3
  31. package/dist/cli/bin.js +8 -5
  32. package/dist/cli/generate/CopyStaticFiles.js +2 -3
  33. package/dist/cli/generate/DevDB.d.ts +1 -1
  34. package/dist/cli/generate/DevDB.js +3 -5
  35. package/dist/cli/serve/CreateLocalServer.d.ts +1 -1
  36. package/dist/cli/serve/CreateLocalServer.js +3 -2
  37. package/dist/cli/serve/DevServer.d.ts +3 -2
  38. package/dist/cli/serve/DevServer.js +60 -3
  39. package/dist/cli/serve/ServeContext.d.ts +1 -0
  40. package/dist/cli/serve/StartServer.d.ts +1 -0
  41. package/dist/cli/serve/StartServer.js +6 -1
  42. package/dist/cli/util/EnsureLibs.js +2 -2
  43. package/dist/cli/util/EnsureNode.js +2 -2
  44. package/dist/cloud/CloudRemote.js +1 -1
  45. package/dist/components/Breadcrumbs.js +6 -6
  46. package/dist/components/Button.js +6 -6
  47. package/dist/components/Calendar.js +13 -13
  48. package/dist/components/Checkbox.js +8 -8
  49. package/dist/components/CheckboxGroup.js +6 -6
  50. package/dist/components/ColorSwatch.js +6 -6
  51. package/dist/components/ColorSwatchPicker.js +6 -6
  52. package/dist/components/ComboBox.js +17 -17
  53. package/dist/components/DateField.js +7 -7
  54. package/dist/components/DatePicker.js +9 -9
  55. package/dist/components/DateRangePicker.js +14 -14
  56. package/dist/components/Dialog.js +6 -6
  57. package/dist/components/Disclosure.js +13 -13
  58. package/dist/components/DropZone.js +6 -6
  59. package/dist/components/Label.js +14 -14
  60. package/dist/components/Link.js +6 -6
  61. package/dist/components/List.js +34 -34
  62. package/dist/components/Menu.js +9 -9
  63. package/dist/components/Modal.js +9 -9
  64. package/dist/components/MultipleSelect.js +28 -28
  65. package/dist/components/NumberField.d.ts +2 -1
  66. package/dist/components/NumberField.js +22 -12
  67. package/dist/components/Popover.js +6 -6
  68. package/dist/components/ProgressCircle.js +9 -9
  69. package/dist/components/RadioGroup.js +6 -6
  70. package/dist/components/SearchField.js +14 -14
  71. package/dist/components/Select.js +16 -16
  72. package/dist/components/Surface.js +2 -2
  73. package/dist/components/Switch.js +8 -8
  74. package/dist/components/Table.js +14 -14
  75. package/dist/components/Tabs.js +9 -9
  76. package/dist/components/TagGroup.js +6 -6
  77. package/dist/components/TextField.js +10 -10
  78. package/dist/components/TimeField.js +8 -8
  79. package/dist/components/Toggle.js +8 -8
  80. package/dist/components/Toolbar.js +8 -8
  81. package/dist/components/Tooltip.js +9 -9
  82. package/dist/components/Tree.d.ts +4 -2
  83. package/dist/components/Tree.js +27 -13
  84. package/dist/core/Client.js +3 -2
  85. package/dist/core/Config.d.ts +4 -0
  86. package/dist/core/Config.js +6 -0
  87. package/dist/core/Connection.d.ts +2 -2
  88. package/dist/core/Connection.js +7 -0
  89. package/dist/core/Graph.d.ts +4 -5
  90. package/dist/core/Infer.d.ts +8 -1
  91. package/dist/core/ListRow.d.ts +2 -0
  92. package/dist/core/OrderBy.d.ts +7 -3
  93. package/dist/core/TextDoc.d.ts +11 -0
  94. package/dist/core/Trace.d.ts +8 -0
  95. package/dist/core/Trace.js +32 -0
  96. package/dist/core/db/CommitRequest.d.ts +0 -3
  97. package/dist/core/db/CommitRequest.js +0 -9
  98. package/dist/core/db/EntryAliases.js +1 -4
  99. package/dist/core/db/EntryDB.js +1 -1
  100. package/dist/core/db/EntryIndex.d.ts +10 -0
  101. package/dist/core/db/EntryIndex.js +117 -9
  102. package/dist/core/db/EntryResolver.js +110 -35
  103. package/dist/core/db/EntryTransaction.d.ts +1 -2
  104. package/dist/core/db/EntryTransaction.js +26 -13
  105. package/dist/core/db/LocalDB.d.ts +2 -3
  106. package/dist/core/db/LocalDB.js +24 -19
  107. package/dist/core/db/Operation.d.ts +2 -2
  108. package/dist/core/db/Operation.js +11 -1
  109. package/dist/core/field/RichTextField.d.ts +30 -3
  110. package/dist/core/field/RichTextField.js +125 -41
  111. package/dist/core/media/MediaAltField.d.ts +1 -0
  112. package/dist/core/media/MediaAltField.js +9 -1
  113. package/dist/core/source/OverlaySource.d.ts +12 -0
  114. package/dist/core/source/OverlaySource.js +50 -0
  115. package/dist/core/source/Source.d.ts +1 -1
  116. package/dist/core/source/Source.js +3 -3
  117. package/dist/dashboard/App.css +158 -0
  118. package/dist/dashboard/App.js +10 -4
  119. package/dist/dashboard/app/AccessDenied.d.ts +16 -1
  120. package/dist/dashboard/app/AccessDenied.js +20 -11
  121. package/dist/dashboard/app/ActivityStatus.js +15 -15
  122. package/dist/dashboard/app/AuthView.js +11 -11
  123. package/dist/dashboard/app/Badge.js +2 -2
  124. package/dist/dashboard/app/CompactField.js +12 -12
  125. package/dist/dashboard/app/DashboardErrorBoundary.js +4 -4
  126. package/dist/dashboard/app/DashboardLayout.js +22 -19
  127. package/dist/dashboard/app/EntryHeader.js +10 -10
  128. package/dist/dashboard/app/EntryReferences.js +10 -10
  129. package/dist/dashboard/app/EntrySidebar.d.ts +1 -1
  130. package/dist/dashboard/app/EntrySidebar.js +16 -15
  131. package/dist/dashboard/app/EntrySidebarPreview.d.ts +1 -1
  132. package/dist/dashboard/app/EntrySidebarPreview.js +60 -29
  133. package/dist/dashboard/app/EntrySidebarPreview.story.d.ts +6 -1
  134. package/dist/dashboard/app/EntryTranslationBanner.js +7 -7
  135. package/dist/dashboard/app/Explorer.d.ts +2 -1
  136. package/dist/dashboard/app/Explorer.js +63 -51
  137. package/dist/dashboard/app/ExplorerCards.js +51 -55
  138. package/dist/dashboard/app/ExplorerFileCard.js +20 -20
  139. package/dist/dashboard/app/ExplorerList.js +14 -14
  140. package/dist/dashboard/app/ExplorerModal.js +1 -1
  141. package/dist/dashboard/app/ExplorerTable.js +59 -59
  142. package/dist/dashboard/app/ExternalLinkPicker.js +15 -4
  143. package/dist/dashboard/app/LinkPicker.js +40 -15
  144. package/dist/dashboard/app/LocaleMenu.js +8 -8
  145. package/dist/dashboard/app/SidebarLayout.d.ts +8 -0
  146. package/dist/dashboard/app/SidebarLayout.js +1169 -0
  147. package/dist/dashboard/app/SidebarTree.js +56 -64
  148. package/dist/dashboard/app/WorkspaceMenu.js +14 -14
  149. package/dist/dashboard/app/WorkspaceRoots.js +24 -24
  150. package/dist/dashboard/app/editor/FileEditor.js +29 -30
  151. package/dist/dashboard/app/editor/FilePreview.js +6 -6
  152. package/dist/dashboard/app/editor/MediaAltField.view.d.ts +1 -1
  153. package/dist/dashboard/app/editor/MediaAltField.view.js +6 -9
  154. package/dist/dashboard/app/modals/CreateEntry.js +5 -5
  155. package/dist/dashboard/app/pages/EntryPage.js +49 -25
  156. package/dist/dashboard/app/pages/UsersPage.js +35 -35
  157. package/dist/dashboard/app/ui/DashboardModal.js +23 -23
  158. package/dist/dashboard/app/ui/Rail.js +3 -3
  159. package/dist/dashboard/app/ui/Sidebar.js +2 -2
  160. package/dist/dashboard/atoms/auth.js +2 -0
  161. package/dist/dashboard/atoms/dashboard.d.ts +9 -0
  162. package/dist/dashboard/atoms/dashboard.js +17 -0
  163. package/dist/dashboard/atoms/editor.d.ts +7 -1
  164. package/dist/dashboard/atoms/editor.js +4 -1
  165. package/dist/dashboard/atoms/entry.d.ts +3 -1
  166. package/dist/dashboard/atoms/entry.js +55 -15
  167. package/dist/dashboard/atoms/explorer.js +3 -8
  168. package/dist/dashboard/atoms/preview.d.ts +3 -0
  169. package/dist/dashboard/atoms/preview.js +18 -1
  170. package/dist/dashboard/hooks.d.ts +4 -2
  171. package/dist/dashboard/hooks.js +9 -5
  172. package/dist/dashboard/icons.d.ts +1 -0
  173. package/dist/dashboard/icons.js +10 -0
  174. package/dist/field/code/CodeField.view.js +13 -13
  175. package/dist/field/date/DateField.view.js +12 -2
  176. package/dist/field/link/EntryLink.d.ts +1 -1
  177. package/dist/field/link/EntryLink.js +1 -0
  178. package/dist/field/link/Link.js +3 -2
  179. package/dist/field/link/LinkField.d.ts +5 -0
  180. package/dist/field/link/LinkField.view.js +115 -87
  181. package/dist/field/list/ListField.view.js +22 -33
  182. package/dist/field/metadata/MetadataField.d.ts +2 -0
  183. package/dist/field/metadata/MetadataField.js +2 -1
  184. package/dist/field/metadata/MetadataField.view.js +18 -18
  185. package/dist/field/number/NumberField.d.ts +2 -0
  186. package/dist/field/number/NumberField.view.js +4 -2
  187. package/dist/field/richtext/PickTextLink.d.ts +7 -0
  188. package/dist/field/richtext/PickTextLink.js +104 -2
  189. package/dist/field/richtext/ReferenceLink.d.ts +4 -1
  190. package/dist/field/richtext/ReferenceLink.js +18 -4
  191. package/dist/field/richtext/RichTextBlock.js +2 -2
  192. package/dist/field/richtext/RichTextDocument.d.ts +7 -2
  193. package/dist/field/richtext/RichTextDocument.js +34 -5
  194. package/dist/field/richtext/RichTextExtensions.d.ts +3 -1
  195. package/dist/field/richtext/RichTextExtensions.js +2701 -7464
  196. package/dist/field/richtext/RichTextField.d.ts +4 -0
  197. package/dist/field/richtext/RichTextField.story.d.ts +4 -0
  198. package/dist/field/richtext/RichTextField.view.js +43 -20
  199. package/dist/field/richtext/RichTextInsertMenu.js +279 -493
  200. package/dist/field/richtext/RichTextToolbar.d.ts +5 -2
  201. package/dist/field/richtext/RichTextToolbar.js +38 -3
  202. package/dist/field/richtext/Toolbar.d.ts +19 -1
  203. package/dist/field/richtext/Toolbar.js +18 -13
  204. package/dist/field/richtext/extensions/Anchor.js +1 -1
  205. package/dist/field/richtext/extensions/Link.js +1 -1
  206. package/dist/field/richtext/extensions/Small.js +1 -1
  207. package/dist/field/select/SelectField.view.js +8 -6
  208. package/dist/index.css +240 -14
  209. package/dist/next.cjs +18 -16
  210. package/dist/next.d.ts +2 -1
  211. package/dist/next.edge.d.ts +2 -1
  212. package/dist/preview/PreviewMessage.d.ts +3 -0
  213. package/dist/preview/PreviewMessage.js +1 -0
  214. package/dist/preview/RegisterPreview.js +29 -9
  215. package/dist/preview/widget.js +6 -12
  216. package/dist/query.d.ts +7 -7
  217. package/dist/ui/RichText.d.ts +1 -0
  218. package/dist/ui/RichText.js +29 -2
  219. package/package.json +6 -3
  220. package/dist/chunks/{chunk-JFROOUG6.js → chunk-NIVGVRDS.js} +17 -17
package/dist/bundled.d.ts CHANGED
@@ -75,7 +75,21 @@ declare module 'alinea/adapter/next/context' {
75
75
 
76
76
  import { Config } from 'alinea/core/Config';
77
77
  import type { RequestContext } from 'alinea/core/Connection';
78
- export function requestContext(config: Config): Promise<RequestContext>;
78
+ export function requestContext(config: Config, request?: Request): Promise<RequestContext>;
79
+
80
+ }
81
+
82
+ declare module 'alinea/adapter/next/DevRemote' {
83
+
84
+ import type { RemoteConnection, RequestContext } from 'alinea/core/Connection';
85
+ import type { Config } from 'alinea/core/Config';
86
+ export function createDevRemote(context: RequestContext, config: Config): RemoteConnection;
87
+
88
+ }
89
+
90
+ declare module 'alinea/adapter/next/ForwardCredentials' {
91
+
92
+ export function forwardDevelopmentCredentials(request: Request | undefined, apiKey: string, init?: RequestInit): RequestInit;
79
93
 
80
94
  }
81
95
 
@@ -83,6 +97,7 @@ declare module 'alinea/adapter/next/handler' {
83
97
 
84
98
  import { type BackendFactory, type BackendOptions } from 'alinea/backend/api/CreateBackend';
85
99
  import { type HandlerHooks } from 'alinea/backend/Handler';
100
+ import { Config } from 'alinea/core/Config';
86
101
  import { NextCMS } from 'alinea/adapter/next/cms';
87
102
  type Handler = (request: Request) => Promise<Response>;
88
103
  export interface NextHandlerOptions extends HandlerHooks {
@@ -90,6 +105,7 @@ declare module 'alinea/adapter/next/handler' {
90
105
  backend?: BackendFactory | BackendOptions;
91
106
  }
92
107
  export function createHandler(input: NextCMS | NextHandlerOptions): Handler;
108
+ export function handlerPathname(config: Config, requestUrl: URL): string;
93
109
  export {};
94
110
 
95
111
  }
@@ -111,6 +127,12 @@ declare module 'alinea/adapter/next/previews' {
111
127
 
112
128
  }
113
129
 
130
+ declare module 'alinea/adapter/next/previews.spec' {
131
+
132
+ export {};
133
+
134
+ }
135
+
114
136
  declare module 'alinea/adapter/next/with-alinea' {
115
137
 
116
138
  import type { NextConfig } from 'next/dist/types.js';
@@ -465,30 +487,31 @@ declare module 'alinea/backend/HandleAction' {
465
487
 
466
488
  declare module 'alinea/backend/Handler' {
467
489
 
468
- import type { Entry } from 'alinea/core';
469
490
  import type { CMS } from 'alinea/core/CMS';
470
- import type { RemoteConnection, RequestContext } from 'alinea/core/Connection';
471
- import type { LocalDB } from 'alinea/core/db/LocalDB';
491
+ import type { AuthedContext, RemoteConnection, RequestContext } from 'alinea/core/Connection';
492
+ import { LocalDB } from 'alinea/core/db/LocalDB';
493
+ import type { Mutation } from 'alinea/core/db/Mutation';
472
494
  export interface Handler {
473
495
  (request: Request, context: RequestContext): Promise<Response>;
474
496
  }
475
- export type HookResponse<T = void> = void | T | Promise<T> | Promise<void>;
497
+ export type HookResponse<T = void> = void | T | Promise<void | T>;
498
+ export interface BeforeCommitContext {
499
+ mutations: ReadonlyArray<Mutation>;
500
+ }
501
+ export interface AfterCommitContext extends BeforeCommitContext {
502
+ sha: string;
503
+ }
476
504
  export interface HandlerHooks {
477
- beforeCreate?(entry: Entry): HookResponse<Entry>;
478
- afterCreate?(entry: Entry): HookResponse;
479
- beforeUpdate?(entry: Entry): HookResponse<Entry>;
480
- afterUpdate?(entry: Entry): HookResponse;
481
- beforeArchive?(entryId: string): HookResponse;
482
- afterArchive?(entryId: string): HookResponse;
483
- beforeRemove?(entryId: string): HookResponse;
484
- afterRemove?(entryId: string): HookResponse;
505
+ beforeCommit?(context: BeforeCommitContext): HookResponse<ReadonlyArray<Mutation>>;
506
+ afterCommit?(context: AfterCommitContext): HookResponse;
485
507
  }
486
508
  export interface HandlerOptions extends HandlerHooks {
487
509
  cms: CMS;
488
510
  db: LocalDB | Promise<LocalDB>;
489
511
  remote?: (context: RequestContext) => RemoteConnection;
512
+ forwardMutations?(request: Request, context: AuthedContext): Promise<Response | undefined>;
490
513
  }
491
- export function createHandler({ cms, remote, db, ...hooks }: HandlerOptions): Handler;
514
+ export function createHandler({ cms, remote, db, forwardMutations, ...hooks }: HandlerOptions): Handler;
492
515
 
493
516
  }
494
517
 
@@ -523,10 +546,14 @@ declare module 'alinea/backend/Previews' {
523
546
  declare module 'alinea/backend/resolver/ParsePreview' {
524
547
 
525
548
  import type { LocalDB } from 'alinea/core/db/LocalDB';
526
- import type { PreviewRequest } from 'alinea/core/Preview';
527
- export function createPreviewParser(local: LocalDB): {
528
- parse(preview: PreviewRequest, sync: () => Promise<unknown>): Promise<PreviewRequest | undefined>;
529
- };
549
+ import { Entry } from 'alinea/core/Entry';
550
+ import type { PreviewRequest, PreviewUpdate } from 'alinea/core/Preview';
551
+ export interface DecodedEntryPreview {
552
+ entry: Entry;
553
+ }
554
+ export type DecodedPreviewRequest = PreviewUpdate | DecodedEntryPreview;
555
+ export function decodePreviewRequest(preview: PreviewRequest): Promise<DecodedPreviewRequest>;
556
+ export function applyPreview(local: LocalDB, preview: DecodedPreviewRequest): Promise<PreviewRequest | undefined>;
530
557
 
531
558
  }
532
559
 
@@ -828,7 +855,7 @@ declare module 'alinea/cli/generate/DevDB' {
828
855
 
829
856
  import { Config } from 'alinea/core/Config';
830
857
  import type { UploadResponse } from 'alinea/core/Connection';
831
- import { type CommitRequest } from 'alinea/core/db/CommitRequest';
858
+ import type { CommitRequest } from 'alinea/core/db/CommitRequest';
832
859
  import { LocalDB } from 'alinea/core/db/LocalDB';
833
860
  import { CachedFSSource } from 'alinea/core/source/FSSource';
834
861
  export interface DevDBOptions {
@@ -932,7 +959,7 @@ declare module 'alinea/cli/serve/CreateLocalServer' {
932
959
  import type { User } from 'alinea/core/User';
933
960
  import { type Request, Response } from '@alinea/iso';
934
961
  import type { ServeContext } from 'alinea/cli/serve/ServeContext';
935
- export function createLocalServer({ cmd, configLocation, rootDir, staticDir, alineaDev, buildOptions, production, liveReload, buildId }: ServeContext, cms: CMS, handleApi: Handler, user: User): {
962
+ export function createLocalServer({ cmd, configLocation, rootDir, staticDir, alineaDev, buildOptions, production, liveReload, buildId, apiKey }: ServeContext, cms: CMS, handleApi: Handler, user: User): {
936
963
  close(): void;
937
964
  handle(input: Request): Promise<Response>;
938
965
  };
@@ -941,8 +968,8 @@ declare module 'alinea/cli/serve/CreateLocalServer' {
941
968
 
942
969
  declare module 'alinea/cli/serve/DevServer' {
943
970
 
944
- import type { Request, Response } from '@alinea/iso';
945
- import type { Config } from 'alinea/core/Config';
971
+ import { Config } from 'alinea/core/Config';
972
+ import { Request, type Response } from '@alinea/iso';
946
973
  import type { BuildOptions } from 'esbuild';
947
974
  export interface CreateDevServerOptions {
948
975
  cmd: 'dev' | 'build';
@@ -952,6 +979,7 @@ declare module 'alinea/cli/serve/DevServer' {
952
979
  buildOptions?: BuildOptions;
953
980
  alineaDev?: boolean;
954
981
  production?: boolean;
982
+ apiKey?: string;
955
983
  dashboardUrl: Promise<string>;
956
984
  onAfterGenerate?: (message: string, config: Config) => void;
957
985
  }
@@ -1033,6 +1061,7 @@ declare module 'alinea/cli/serve/ServeContext' {
1033
1061
  production: boolean;
1034
1062
  liveReload: LiveReload;
1035
1063
  buildId: string;
1064
+ apiKey: string;
1036
1065
  }
1037
1066
 
1038
1067
  }
@@ -1045,6 +1074,7 @@ declare module 'alinea/cli/serve/StartServer' {
1045
1074
  respondWith(response: Response): Promise<void>;
1046
1075
  }
1047
1076
  export interface Server {
1077
+ hostname: string;
1048
1078
  port: number;
1049
1079
  serve(abortController?: AbortController): AsyncIterable<RequestEvent>;
1050
1080
  close(): void;
@@ -1729,8 +1759,9 @@ declare module 'alinea/components/NumberField' {
1729
1759
  import { type LabelSharedProps } from 'alinea/components/Label';
1730
1760
  export interface NumberFieldProps extends Omit<NumberFieldPrimitiveProps, 'children'>, LabelSharedProps {
1731
1761
  steppers?: boolean;
1762
+ placeholder?: string;
1732
1763
  }
1733
- export function NumberField({ steppers, ...props }: NumberFieldProps): import("react").JSX.Element;
1764
+ export function NumberField({ steppers, placeholder, ...props }: NumberFieldProps): import("react").JSX.Element;
1734
1765
 
1735
1766
  }
1736
1767
 
@@ -1961,18 +1992,20 @@ declare module 'alinea/components/Tree' {
1961
1992
  children?: ReactNode;
1962
1993
  disableDragging?: boolean;
1963
1994
  icon?: IconProps['icon'];
1995
+ iconHref?: string;
1964
1996
  suffix?: ReactNode;
1965
1997
  }
1966
- export const TreeItemContent: import("react").MemoExoticComponent<({ disableDragging, icon, suffix, children }: TreeItemContentProps) => import("react").JSX.Element>;
1998
+ export const TreeItemContent: import("react").MemoExoticComponent<({ disableDragging, icon, iconHref, suffix, children }: TreeItemContentProps) => import("react").JSX.Element>;
1967
1999
  export interface TreeItemProps extends Partial<Omit<AriaTreeItemProps, 'className'>> {
1968
2000
  className?: string;
1969
2001
  disableDragging?: boolean;
1970
2002
  title: string;
1971
2003
  icon?: IconProps['icon'];
2004
+ iconHref?: string;
1972
2005
  label?: ReactNode;
1973
2006
  suffix?: ReactNode;
1974
2007
  }
1975
- export function TreeItem({ disableDragging, title, icon, label, suffix, children, className, hasChildItems, ...rest }: TreeItemProps): import("react").JSX.Element;
2008
+ export function TreeItem({ disableDragging, title, icon, iconHref, label, suffix, children, className, hasChildItems, ...rest }: TreeItemProps): import("react").JSX.Element;
1976
2009
 
1977
2010
  }
1978
2011
 
@@ -2107,6 +2140,7 @@ declare module 'alinea/core/Config' {
2107
2140
  import { type Role } from 'alinea/core/Role';
2108
2141
  import { Root } from 'alinea/core/Root';
2109
2142
  import { Schema } from 'alinea/core/Schema';
2143
+ import type { Tracer } from 'alinea/core/Trace';
2110
2144
  import { Type } from 'alinea/core/Type';
2111
2145
  import { Workspace, type WorkspaceInternal } from 'alinea/core/Workspace';
2112
2146
  /** Configuration options */
@@ -2136,10 +2170,13 @@ declare module 'alinea/core/Config' {
2136
2170
  publicDir?: string;
2137
2171
  /** Filename of the generated dashboard, defaults to admin.html */
2138
2172
  dashboardFile?: string;
2173
+ /** Optional application-owned instrumentation for Alinea operations. */
2174
+ tracer?: Tracer;
2139
2175
  auth?: Auth.View;
2140
2176
  }
2141
2177
  export namespace Config {
2142
2178
  function baseUrl(config: Config, env?: string): string | undefined;
2179
+ function handlerUrl(config: Config): string;
2143
2180
  function adminPath(config: Config): string;
2144
2181
  function mainWorkspace(config: Config): WorkspaceInternal;
2145
2182
  function type(config: Config, name: string): Type | undefined;
@@ -2230,9 +2267,9 @@ declare module 'alinea/core/Connection' {
2230
2267
  isDev: boolean;
2231
2268
  handlerUrl: URL;
2232
2269
  apiKey: string;
2233
- user?: User;
2234
- token?: string;
2270
+ applyAuth?(init?: RequestInit): RequestInit;
2235
2271
  }
2272
+ export const developmentKeyHeader = "x-alinea-dev-key";
2236
2273
  export interface AuthedContext extends RequestContext {
2237
2274
  user: User;
2238
2275
  token: string;
@@ -2272,7 +2309,6 @@ declare module 'alinea/core/Connection' {
2272
2309
  declare module 'alinea/core/db/CommitRequest' {
2273
2310
 
2274
2311
  import type { Change, ChangeFile, ChangesBatch } from 'alinea/core/source/Change';
2275
- import type { ReadonlyTree } from 'alinea/core/source/Tree';
2276
2312
  import type { User } from 'alinea/core/User';
2277
2313
  import type { RemoveFileMutation, UploadFileMutation } from 'alinea/core/db/Mutation';
2278
2314
  export interface AddContent extends ChangeFile {
@@ -2290,10 +2326,8 @@ declare module 'alinea/core/db/CommitRequest' {
2290
2326
  user?: User;
2291
2327
  fromSha: string;
2292
2328
  intoSha: string;
2293
- checks: Array<[path: string, sha: string]>;
2294
2329
  changes: Array<CommitChange>;
2295
2330
  }
2296
- export function checkCommit(tree: ReadonlyTree, request: CommitRequest): void;
2297
2331
 
2298
2332
  }
2299
2333
 
@@ -2351,6 +2385,14 @@ declare module 'alinea/core/db/EntryIndex' {
2351
2385
  language?(language: EntryLanguageNode): boolean;
2352
2386
  entry?(entry: Entry): boolean;
2353
2387
  }
2388
+ interface EntryNodeQuery {
2389
+ ids?: ReadonlyArray<string>;
2390
+ parentIds?: ReadonlyArray<string | null>;
2391
+ urls?: ReadonlyArray<string>;
2392
+ workspaces?: ReadonlyArray<string>;
2393
+ roots?: ReadonlyArray<string>;
2394
+ types?: ReadonlyArray<string>;
2395
+ }
2354
2396
  export function combineConditions(a: EntryCondition, b: EntryCondition): EntryCondition;
2355
2397
  interface EntryVersionData {
2356
2398
  id: string;
@@ -2424,6 +2466,7 @@ declare module 'alinea/core/db/EntryIndex' {
2424
2466
  nodes: Array<EntryNode>;
2425
2467
  constructor(config: Config, versionData: Map<string, EntryVersionData>, seeds: Map<string, Seed>);
2426
2468
  byId(id: string): EntryNode | undefined;
2469
+ candidateNodes(query: EntryNodeQuery): Array<EntryNode> | undefined;
2427
2470
  get config(): Config;
2428
2471
  byDir(dir: string): EntryNode | undefined;
2429
2472
  entryByFilePath(filePath: string): Entry | undefined;
@@ -2436,6 +2479,7 @@ declare module 'alinea/core/db/EntryIndex' {
2436
2479
  initialSync: ReadonlyTree | undefined;
2437
2480
  graph: EntryGraph;
2438
2481
  constructor(config: Config);
2482
+ clone(): EntryIndex;
2439
2483
  get sha(): string;
2440
2484
  filter(filter: EntryCondition): Iterable<Entry>;
2441
2485
  findFirst<T extends Record<string, unknown>>(filter: (entry: Entry) => boolean): Entry<T> | undefined;
@@ -2633,12 +2677,11 @@ declare module 'alinea/core/db/EntryTransaction' {
2633
2677
  removeFile(mutation: Op<RemoveFileMutation>): this;
2634
2678
  uploadFile(mutation: Op<UploadFileMutation>): this;
2635
2679
  description(): string;
2636
- apply(mutations: Array<Mutation>): void;
2680
+ apply(mutations: ReadonlyArray<Mutation>): Promise<void>;
2637
2681
  toRequest(): Promise<{
2638
2682
  fromSha: string;
2639
2683
  intoSha: string;
2640
2684
  description: string;
2641
- checks: [path: string, sha: string][];
2642
2685
  changes: CommitChange[];
2643
2686
  }>;
2644
2687
  }
@@ -2721,7 +2764,7 @@ declare module 'alinea/core/db/LocalDB' {
2721
2764
  config: Config;
2722
2765
  index: EntryIndex;
2723
2766
  source: Source;
2724
- constructor(config: Config, source?: Source);
2767
+ constructor(config: Config, source?: Source, index?: EntryIndex);
2725
2768
  resolve<Query extends GraphQuery>(query: Query): Promise<AnyQueryResult<Query>>;
2726
2769
  referencesTo(query: EntryReferenceQuery): Promise<EntryReferenceResult>;
2727
2770
  get sha(): string;
@@ -2732,11 +2775,10 @@ declare module 'alinea/core/db/LocalDB' {
2732
2775
  sync(): Promise<string>;
2733
2776
  syncWith(remote: SyncApi): Promise<string>;
2734
2777
  logEntries(): Promise<void>;
2735
- request(mutations: Array<Mutation>, policy?: Policy): Promise<{
2778
+ request(mutations: ReadonlyArray<Mutation>, policy?: Policy): Promise<{
2736
2779
  fromSha: string;
2737
2780
  intoSha: string;
2738
2781
  description: string;
2739
- checks: [path: string, sha: string][];
2740
2782
  changes: import("alinea/core/db/CommitRequest").CommitChange[];
2741
2783
  }>;
2742
2784
  mutate(mutations: Array<Mutation>): Promise<{
@@ -2818,7 +2860,7 @@ declare module 'alinea/core/db/Mutation' {
2818
2860
 
2819
2861
  declare module 'alinea/core/db/Operation' {
2820
2862
 
2821
- import type { StoredRow } from 'alinea/core/Infer';
2863
+ import type { CreateInputRow, StoredRow } from 'alinea/core/Infer';
2822
2864
  import type { ImagePreviewDetails } from 'alinea/core/media/CreatePreview';
2823
2865
  import { Type } from 'alinea/core/Type';
2824
2866
  import type { Mutation } from 'alinea/core/db/Mutation';
@@ -2837,7 +2879,7 @@ declare module 'alinea/core/db/Operation' {
2837
2879
  parentId?: string | null;
2838
2880
  locale?: string | null;
2839
2881
  status?: 'draft' | 'published' | 'archived';
2840
- set: Partial<StoredRow<Fields>>;
2882
+ set: Partial<CreateInputRow<Fields>>;
2841
2883
  insertOrder?: 'first' | 'last';
2842
2884
  overwrite?: boolean;
2843
2885
  }
@@ -3414,7 +3456,7 @@ declare module 'alinea/core/field/RichTextField' {
3414
3456
  import { Field, type FieldMeta, type FieldOptions } from 'alinea/core/Field';
3415
3457
  import type { InferStoredValue } from 'alinea/core/Infer';
3416
3458
  import { Schema } from 'alinea/core/Schema';
3417
- import { type TextDoc } from 'alinea/core/TextDoc';
3459
+ import { Mark, type ElementNode, type TextDoc } from 'alinea/core/TextDoc';
3418
3460
  export type RichTextMutator<R> = {
3419
3461
  insert: (id: string, block: string) => void;
3420
3462
  };
@@ -3428,10 +3470,37 @@ declare module 'alinea/core/field/RichTextField' {
3428
3470
  private doc;
3429
3471
  constructor(doc?: TextDoc<Blocks>);
3430
3472
  add<Key extends keyof Blocks>(type: Key, block: RichTextBlockInput<Blocks, Key>): this;
3431
- addHtml(html: string): this;
3473
+ addHtml(html: string, options?: ParseHTMLSyncOptions): this;
3474
+ addHtmlAsync(html: string, options?: ParseHTMLAsyncOptions): Promise<this>;
3432
3475
  value(): TextDoc<Blocks>;
3433
3476
  }
3434
- export function parseHTML(html: string): TextDoc<any>;
3477
+ export interface ParseHTMLTagHandler {
3478
+ (attributes: Record<string, string>): ElementNode | undefined;
3479
+ }
3480
+ export interface ParseHTMLMarkHandler {
3481
+ (attributes: Record<string, string>): Mark | undefined;
3482
+ }
3483
+ export interface ParseHTMLAsyncTagHandler {
3484
+ (attributes: Record<string, string>): ElementNode | undefined | PromiseLike<ElementNode | undefined>;
3485
+ }
3486
+ export interface ParseHTMLAsyncMarkHandler {
3487
+ (attributes: Record<string, string>): Mark | undefined | PromiseLike<Mark | undefined>;
3488
+ }
3489
+ export interface ParseHTMLSyncOptions {
3490
+ tags?: Record<string, ParseHTMLTagHandler>;
3491
+ marks?: Record<string, ParseHTMLMarkHandler>;
3492
+ }
3493
+ export interface ParseHTMLAsyncOptions {
3494
+ tags?: Record<string, ParseHTMLAsyncTagHandler>;
3495
+ marks?: Record<string, ParseHTMLAsyncMarkHandler>;
3496
+ }
3497
+ /**
3498
+ * Parse HTML using handlers that may perform asynchronous work, such as
3499
+ * importing remote images into a media directory.
3500
+ */
3501
+ export function parseHTMLAsync(html: string, options?: ParseHTMLAsyncOptions): Promise<TextDoc>;
3502
+ /** Parse HTML synchronously. Async handlers are only supported by parseHTMLAsync. */
3503
+ export function parseHTML(html: string, options?: ParseHTMLSyncOptions): TextDoc;
3435
3504
 
3436
3505
  }
3437
3506
 
@@ -3502,6 +3571,7 @@ declare module 'alinea/core/Graph' {
3502
3571
  import type { Condition, Filter } from 'alinea/core/Filter';
3503
3572
  import type { Infer, StoredRow } from 'alinea/core/Infer';
3504
3573
  import type { HasField } from 'alinea/core/Internal';
3574
+ import type { OrderBy } from 'alinea/core/OrderBy';
3505
3575
  import type { Page } from 'alinea/core/Page';
3506
3576
  import type { PreviewRequest } from 'alinea/core/Preview';
3507
3577
  import type { Type } from 'alinea/core/Type';
@@ -3549,11 +3619,9 @@ declare module 'alinea/core/Graph' {
3549
3619
  }
3550
3620
  export type Projection = SelectContent | SelectObject;
3551
3621
  export type InferProjection<Selection> = InferSelection<Selection>;
3552
- export interface Order {
3553
- asc?: Expr<any>;
3554
- desc?: Expr<any>;
3622
+ export type Order = OrderBy & {
3555
3623
  caseSensitive?: boolean;
3556
- }
3624
+ };
3557
3625
  type InferSelection<Selection> = Selection extends GraphQuery & Edge ? Expand<AnyQueryResult<Selection>> : Selection extends Expr<infer V> ? V : {
3558
3626
  [K in keyof Selection]: Selection[K] extends Type<infer V> ? Type.Infer<V> : InferSelection<Selection[K]>;
3559
3627
  };
@@ -3604,7 +3672,7 @@ declare module 'alinea/core/Graph' {
3604
3672
  /** Filter by url */
3605
3673
  url?: Condition<string>;
3606
3674
  /** Filter by a metadata URL alias */
3607
- alias?: string;
3675
+ alias?: Condition<string>;
3608
3676
  /** Filter by metadata created timestamp */
3609
3677
  createdAt?: Condition<number | null>;
3610
3678
  /** Filter by metadata updated timestamp */
@@ -3730,6 +3798,7 @@ declare module 'alinea/core/Infer' {
3730
3798
  import type { InferProjection } from 'alinea/core/Graph';
3731
3799
  import type { ListRow } from 'alinea/core/ListRow';
3732
3800
  import type { Type } from 'alinea/core/Type';
3801
+ import type { RecordField } from 'alinea/core/field/RecordField';
3733
3802
  type QueryList<T> = Expand<UnionOfValues<{
3734
3803
  [K in keyof T]: {
3735
3804
  _type: K;
@@ -3744,9 +3813,15 @@ declare module 'alinea/core/Infer' {
3744
3813
  export type StoredRow<Definition> = {
3745
3814
  [K in keyof Definition as Definition[K] extends Field<any> ? K : never]: Definition[K] extends Field<infer T> ? T : never;
3746
3815
  };
3747
- export type InferStoredValue<T> = T extends Type<infer Fields> ? StoredRow<Fields> : T extends Field<infer StoredValue> ? StoredValue : T extends Record<string, Type> ? StoredList<T> : {};
3816
+ type CreateInputValue<T> = T extends RecordField<infer Row, infer _Options> ? Partial<Row> : T extends Field<infer StoredValue> ? StoredValue : never;
3817
+ export type CreateInputRow<Definition> = {
3818
+ [K in keyof Definition as Definition[K] extends Field ? K : never]: CreateInputValue<Definition[K]>;
3819
+ };
3820
+ export type InferStoredValue<T> = T extends Type<infer Fields> ? StoredRow<Fields> : T extends Field<infer StoredValue> ? StoredValue : T extends Record<string, Type> ? StoredList<T> : T extends object ? StoredRow<T> : {};
3748
3821
  export type Infer<T> = InferQueryValue<T>;
3749
3822
  export namespace Infer {
3823
+ /** Stored content for creation and editing, before links are resolved. */
3824
+ type Stored<T> = InferStoredValue<T>;
3750
3825
  type Entry<T extends Type, TypeName extends string = string> = InferQueryValue<T> & Omit<EntryFields, '_type'> & {
3751
3826
  _type: TypeName;
3752
3827
  };
@@ -3815,6 +3890,8 @@ declare module 'alinea/core/ListRow' {
3815
3890
  _id: string;
3816
3891
  _type: string;
3817
3892
  _index: string;
3893
+ _anchor?: string;
3894
+ _label?: string;
3818
3895
  }
3819
3896
  export namespace ListRow {
3820
3897
  const id = "_id";
@@ -3867,6 +3944,7 @@ declare module 'alinea/core/media/MediaAltField' {
3867
3944
  export class MediaAltField extends ScalarField<MediaAltValue, MediaAltOptions> {
3868
3945
  }
3869
3946
  export function mediaAlt(label: string, options?: WithoutLabel<MediaAltOptions>): MediaAltField;
3947
+ export function mediaAltText(value: MediaAltValue, locale?: string): string;
3870
3948
 
3871
3949
  }
3872
3950
 
@@ -4035,11 +4113,15 @@ declare module 'alinea/core/media/UploadLimits' {
4035
4113
  declare module 'alinea/core/OrderBy' {
4036
4114
 
4037
4115
  import type { Expr } from 'alinea/core/Expr';
4038
- export type OrderBy = {
4116
+ export interface AscendingOrder {
4039
4117
  asc: Expr<any>;
4040
- } | {
4118
+ desc?: never;
4119
+ }
4120
+ export interface DescendingOrder {
4121
+ asc?: never;
4041
4122
  desc: Expr<any>;
4042
- };
4123
+ }
4124
+ export type OrderBy = AscendingOrder | DescendingOrder;
4043
4125
 
4044
4126
  }
4045
4127
 
@@ -4694,6 +4776,23 @@ declare module 'alinea/core/source/MemorySource' {
4694
4776
 
4695
4777
  }
4696
4778
 
4779
+ declare module 'alinea/core/source/OverlaySource' {
4780
+
4781
+ import type { ChangesBatch } from 'alinea/core/source/Change';
4782
+ import type { GetBlobsOptions, Source } from 'alinea/core/source/Source';
4783
+ import type { ReadonlyTree } from 'alinea/core/source/Tree';
4784
+ export class OverlaySource implements Source {
4785
+ #private;
4786
+ constructor(source: Source, tree: ReadonlyTree);
4787
+ static create(source: Source): Promise<OverlaySource>;
4788
+ getTree(): Promise<ReadonlyTree>;
4789
+ getTreeIfDifferent(sha: string): Promise<ReadonlyTree | undefined>;
4790
+ getBlobs(shas: ReadonlyArray<string>, options?: GetBlobsOptions): AsyncGenerator<[sha: string, blob: Uint8Array]>;
4791
+ applyChanges(batch: ChangesBatch): Promise<void>;
4792
+ }
4793
+
4794
+ }
4795
+
4697
4796
  declare module 'alinea/core/source/ShaMismatchError' {
4698
4797
 
4699
4798
  import { HttpError } from 'alinea/core/HttpError';
@@ -4730,7 +4829,7 @@ declare module 'alinea/core/source/Source' {
4730
4829
  add(path: string, contents: Uint8Array): this;
4731
4830
  remove(path: string): this;
4732
4831
  rename(from: string, to: string): this;
4733
- compile(): Promise<{
4832
+ compile(previous?: ReadonlyTree): Promise<{
4734
4833
  from: ReadonlyTree;
4735
4834
  into: ReadonlyTree;
4736
4835
  changes: (import("alinea/core/source/Change").DeleteChange | {
@@ -4925,6 +5024,17 @@ declare module 'alinea/core/TextDoc' {
4925
5024
  export namespace ElementNode {
4926
5025
  const content = "content";
4927
5026
  }
5027
+ export interface ImageNode extends ElementNode {
5028
+ _type: 'image';
5029
+ _id?: string;
5030
+ _link?: 'image';
5031
+ _entry?: string;
5032
+ src?: string;
5033
+ alt?: string;
5034
+ title?: string;
5035
+ width?: number | string;
5036
+ height?: number | string;
5037
+ }
4928
5038
  export interface BlockNode {
4929
5039
  _id: string;
4930
5040
  _type: string;
@@ -4935,6 +5045,19 @@ declare module 'alinea/core/TextDoc' {
4935
5045
 
4936
5046
  }
4937
5047
 
5048
+ declare module 'alinea/core/Trace' {
5049
+
5050
+ import type { Config } from 'alinea/core/Config';
5051
+ export interface Tracer {
5052
+ <Result>(name: string, run: () => Promise<Result>): Promise<Result>;
5053
+ }
5054
+ export interface TraceSpan {
5055
+ <Result>(operation: () => Promise<Result>): Promise<Result>;
5056
+ }
5057
+ export function trace(config: Config, name: string): TraceSpan;
5058
+
5059
+ }
5060
+
4938
5061
  declare module 'alinea/core/Tracker' {
4939
5062
 
4940
5063
  import { Field, type FieldOptions } from 'alinea/core/Field';
@@ -5784,11 +5907,26 @@ declare module 'alinea/dashboard/App' {
5784
5907
 
5785
5908
  declare module 'alinea/dashboard/app/AccessDenied' {
5786
5909
 
5910
+ const copy: {
5911
+ root: {
5912
+ title: string;
5913
+ message: string;
5914
+ };
5915
+ users: {
5916
+ title: string;
5917
+ message: string;
5918
+ };
5919
+ workspace: {
5920
+ title: string;
5921
+ message: string;
5922
+ };
5923
+ };
5787
5924
  export interface AccessDeniedProps {
5788
5925
  canManageMembers: boolean;
5789
- scope: 'root' | 'workspace';
5926
+ scope: keyof typeof copy;
5790
5927
  }
5791
5928
  export function AccessDenied({ canManageMembers, scope }: AccessDeniedProps): import("react").JSX.Element;
5929
+ export {};
5792
5930
 
5793
5931
  }
5794
5932
 
@@ -5943,7 +6081,7 @@ declare module 'alinea/dashboard/app/editor/FilePreview' {
5943
6081
 
5944
6082
  declare module 'alinea/dashboard/app/editor/MediaAltField.view' {
5945
6083
 
5946
- import type { MediaAltField } from 'alinea/core/media/MediaAltField';
6084
+ import { type MediaAltField } from 'alinea/core/media/MediaAltField';
5947
6085
  export interface MediaAltFieldViewProps {
5948
6086
  field: MediaAltField;
5949
6087
  }
@@ -6074,7 +6212,7 @@ declare module 'alinea/dashboard/app/EntrySidebar' {
6074
6212
  onOpenChange?: (isOpen: boolean) => void;
6075
6213
  }
6076
6214
  export type EntrySidebarTab = 'preview' | 'history' | 'references';
6077
- export function entrySidebar(get: Getter, entry: EntryAtoms, localeData: EntryLocaleAtoms): Promise<EntrySidebarProps | undefined>;
6215
+ export function entrySidebar(get: Getter, entry: EntryAtoms, localeData: EntryLocaleAtoms, isOpen?: boolean): Promise<EntrySidebarProps | undefined>;
6078
6216
  export function EntrySidebar({ entry, localeData, selectedTab, previousVersionsOpen, onOpenChange }: EntrySidebarProps): import("react").JSX.Element;
6079
6217
  export type EntrySidebarVersionStatus = EntryStatus | 'unpublished' | 'none';
6080
6218
  export interface EntrySidebarVersionRowProps {
@@ -6099,7 +6237,7 @@ declare module 'alinea/dashboard/app/EntrySidebarPreview' {
6099
6237
  }
6100
6238
  export function EntrySidebarPreview({ entry, localeData }: EntrySidebarPreviewProps): import("react").JSX.Element;
6101
6239
  export interface EntrySidebarBrowserPreviewProps {
6102
- localeData: Pick<EntryLocaleAtoms, 'previewUrl' | 'retryPreviewUrl'> & Partial<Pick<EntryLocaleAtoms, 'previewPayloadSignal' | 'updatePreviewPayload'>>;
6240
+ localeData: Pick<EntryLocaleAtoms, 'previewUrlState' | 'retryPreviewUrl'> & Partial<Pick<EntryLocaleAtoms, 'previewPayloadSignal' | 'updatePreviewPayload'>>;
6103
6241
  }
6104
6242
  export function EntrySidebarBrowserPreview({ localeData }: EntrySidebarBrowserPreviewProps): import("react").JSX.Element;
6105
6243
 
@@ -6113,7 +6251,12 @@ declare module 'alinea/dashboard/app/EntrySidebarPreview.spec' {
6113
6251
 
6114
6252
  declare module 'alinea/dashboard/app/EntrySidebarPreview.story' {
6115
6253
 
6116
- export function EntrySidebarPreviewStory(): import("react").JSX.Element;
6254
+ interface EntrySidebarPreviewStoryProps {
6255
+ previewUrl?: string;
6256
+ entryId?: string;
6257
+ }
6258
+ export function EntrySidebarPreviewStory({ previewUrl, entryId }: EntrySidebarPreviewStoryProps): import("react").JSX.Element;
6259
+ export {};
6117
6260
 
6118
6261
  }
6119
6262
 
@@ -6158,6 +6301,7 @@ declare module 'alinea/dashboard/app/Explorer' {
6158
6301
  onBack(): void;
6159
6302
  }
6160
6303
  export interface ExplorerHeaderProps {
6304
+ canBrowse?: boolean;
6161
6305
  autoFocusSearch?: boolean;
6162
6306
  controls?: ReactNode;
6163
6307
  explorer: DashboardExplorer;
@@ -6179,7 +6323,7 @@ declare module 'alinea/dashboard/app/Explorer' {
6179
6323
  page: ExplorerReadyPage;
6180
6324
  }
6181
6325
  export function ExplorerSearch({ autoFocus, explorer, onEntryAction, page }: ExplorerSearchProps): import("react").JSX.Element;
6182
- export function ExplorerHeader({ autoFocusSearch, controls, explorer, headerEntry, navigate, page, titleControls }: ExplorerHeaderProps): import("react").JSX.Element;
6326
+ export function ExplorerHeader({ canBrowse, autoFocusSearch, controls, explorer, headerEntry, navigate, page, titleControls }: ExplorerHeaderProps): import("react").JSX.Element;
6183
6327
  export function ExplorerBody({ compactTable, explorer, onSelectionChange, page }: ExplorerBodyProps): import("react").JSX.Element;
6184
6328
  export function Explorer({ controls, explorer, headerEntry, page: loadedPage, titleControls }: ExplorerProps): import("react").JSX.Element;
6185
6329
  export {};
@@ -6406,6 +6550,19 @@ declare module 'alinea/dashboard/app/pages/UsersPage' {
6406
6550
 
6407
6551
  }
6408
6552
 
6553
+ declare module 'alinea/dashboard/app/SidebarLayout' {
6554
+
6555
+ import { type ReactNode } from 'react';
6556
+ export interface SidebarLayoutProps {
6557
+ children: ReactNode;
6558
+ sidebar: ReactNode;
6559
+ side: 'left' | 'right';
6560
+ visible?: boolean;
6561
+ }
6562
+ export function SidebarLayout({ children, sidebar, side, visible }: SidebarLayoutProps): import("react").JSX.Element;
6563
+
6564
+ }
6565
+
6409
6566
  declare module 'alinea/dashboard/app/SidebarTree' {
6410
6567
 
6411
6568
  import { type Page } from 'alinea/dashboard/atoms/nav';
@@ -6779,6 +6936,15 @@ declare module 'alinea/dashboard/atoms/dashboard' {
6779
6936
 
6780
6937
  import type { SetStateAction } from 'react';
6781
6938
  export type DashboardTheme = 'system' | 'light' | 'dark';
6939
+ export const dashboardMobileAtom: import("jotai").PrimitiveAtom<boolean> & {
6940
+ init: boolean;
6941
+ };
6942
+ export const navigationSidebarWidthAtom: import("jotai").PrimitiveAtom<number> & {
6943
+ init: number;
6944
+ };
6945
+ export const entrySidebarWidthAtom: import("jotai").PrimitiveAtom<number> & {
6946
+ init: number;
6947
+ };
6782
6948
  export const entrySidebarOpenAtom: import("jotai").PrimitiveAtom<boolean> & {
6783
6949
  init: boolean;
6784
6950
  };
@@ -6801,6 +6967,10 @@ declare module 'alinea/dashboard/atoms/editor' {
6801
6967
  import { Type } from 'alinea/core/Type';
6802
6968
  import type { Atom, WritableAtom } from 'jotai';
6803
6969
  import type { ComponentType, ReactNode } from 'react';
6970
+ export interface ResolvedEditorImage {
6971
+ src: string;
6972
+ alt: string;
6973
+ }
6804
6974
  export interface EditorNode {
6805
6975
  readOnly: boolean;
6806
6976
  nodes: WritableAtom<unknown, [unknown], void>;
@@ -6811,6 +6981,7 @@ declare module 'alinea/dashboard/atoms/editor' {
6811
6981
  anchors: Atom<Array<EntryAnchorTarget>>;
6812
6982
  node: EditorNode;
6813
6983
  parent?: EditorModel;
6984
+ resolvedImages: ReadonlyMap<string, ResolvedEditorImage>;
6814
6985
  sections: Array<EditorSection>;
6815
6986
  type: Type;
6816
6987
  field(key: string): EditorField | undefined;
@@ -6841,10 +7012,11 @@ declare module 'alinea/dashboard/atoms/editor' {
6841
7012
  parent?: EntryEditor | undefined;
6842
7013
  resource?: Resource | undefined;
6843
7014
  policy?: Policy | undefined;
7015
+ resolvedImages: ReadonlyMap<string, ResolvedEditorImage>;
6844
7016
  anchors: Atom<Array<EntryAnchorTarget>>;
6845
7017
  value: Atom<object>;
6846
7018
  sections: Array<EntryEditorSection>;
6847
- constructor(type: Type, node: EditorNode, parent?: EntryEditor | undefined, resource?: Resource | undefined, policy?: Policy | undefined);
7019
+ constructor(type: Type, node: EditorNode, parent?: EntryEditor | undefined, resource?: Resource | undefined, policy?: Policy | undefined, resolvedImages?: ReadonlyMap<string, ResolvedEditorImage>);
6848
7020
  field: (key: string) => EntryEditorField | undefined;
6849
7021
  get(field: Field): EntryEditorField | undefined;
6850
7022
  }
@@ -6884,6 +7056,7 @@ declare module 'alinea/dashboard/atoms/entry' {
6884
7056
  import type { Order } from 'alinea/core/Graph';
6885
7057
  import { type EntryDefaultView } from 'alinea/core/Type';
6886
7058
  import { Atom, Getter } from 'jotai';
7059
+ import type { ResolvedEditorImage } from 'alinea/dashboard/atoms/editor';
6887
7060
  import { ReactiveNode } from 'alinea/dashboard/atoms/ReactiveNode';
6888
7061
  interface EntryData {
6889
7062
  id: string;
@@ -6949,6 +7122,7 @@ declare module 'alinea/dashboard/atoms/entry' {
6949
7122
  historyReady: Atom<Promise<import("alinea/core/Connection").Revision[]>>;
6950
7123
  history: Atom<import("alinea/core/Connection").Revision[]>;
6951
7124
  selectedNode: Atom<Promise<ReactiveNode<object>>>;
7125
+ richTextImages: Atom<Promise<Map<string, ResolvedEditorImage>>>;
6952
7126
  anchors: Atom<Promise<import("alinea/core/Field").EntryAnchorTarget[]>>;
6953
7127
  retryPreviewUrl: import("jotai").WritableAtom<null, [], void> & {
6954
7128
  init: null;
@@ -7004,7 +7178,7 @@ declare module 'alinea/dashboard/atoms/entry' {
7004
7178
  searchableText: string;
7005
7179
  } | undefined>;
7006
7180
  previewUrlReady: Atom<Promise<string | undefined>>;
7007
- previewUrl: Atom<string | undefined>;
7181
+ previewUrlState: Atom<readonly [false, string | undefined] | readonly [true, string | undefined]>;
7008
7182
  previewPayloadSignal: Atom<(object | null | undefined)[]>;
7009
7183
  updatePreviewPayload: import("jotai").WritableAtom<null, [], Promise<string | undefined>> & {
7010
7184
  init: null;
@@ -7504,7 +7678,10 @@ declare module 'alinea/dashboard/atoms/nav' {
7504
7678
 
7505
7679
  declare module 'alinea/dashboard/atoms/preview' {
7506
7680
 
7681
+ import type { LocalConnection } from 'alinea/core/Connection';
7507
7682
  import type { PreviewMetadata } from 'alinea/core/Preview';
7683
+ export function getPreviewToken(client: LocalConnection): Promise<string | undefined>;
7684
+ export function retryPreviewToken(client: LocalConnection): void;
7508
7685
  export const previewMetadataAtom: import("jotai").PrimitiveAtom<PreviewMetadata | undefined> & {
7509
7686
  init: PreviewMetadata | undefined;
7510
7687
  };
@@ -8096,7 +8273,7 @@ declare module 'alinea/dashboard/hooks' {
8096
8273
  import type { WorkspaceInternal } from 'alinea/core/Workspace';
8097
8274
  import { Type } from 'alinea';
8098
8275
  import type { ComponentType, Dispatch, PropsWithChildren, SetStateAction } from 'react';
8099
- import { type EditorModel, type EditorNode, EntryEditor } from 'alinea/dashboard/atoms/editor';
8276
+ import { type EditorModel, type EditorNode, EntryEditor, type ResolvedEditorImage } from 'alinea/dashboard/atoms/editor';
8100
8277
  import type { EntryAtoms, EntryLocaleAtoms } from 'alinea/dashboard/atoms/entry';
8101
8278
  import type { Page } from 'alinea/dashboard/atoms/nav';
8102
8279
  import type { RootAtoms } from 'alinea/dashboard/atoms/root';
@@ -8104,6 +8281,7 @@ declare module 'alinea/dashboard/hooks' {
8104
8281
  interface EntryContextValue {
8105
8282
  entry: EntryAtoms;
8106
8283
  localeData: EntryLocaleAtoms;
8284
+ richTextImages: ReadonlyMap<string, ResolvedEditorImage>;
8107
8285
  selectedEntry: EntryRecord<Record<string, unknown>>;
8108
8286
  }
8109
8287
  export interface DashboardOptions {
@@ -8171,9 +8349,10 @@ declare module 'alinea/dashboard/hooks' {
8171
8349
  export interface EntryScopeProps {
8172
8350
  entry: EntryAtoms;
8173
8351
  localeData: EntryLocaleAtoms;
8352
+ richTextImages: ReadonlyMap<string, ResolvedEditorImage>;
8174
8353
  selectedEntry: EntryRecord<Record<string, unknown>>;
8175
8354
  }
8176
- export function EntryScope({ children, entry, localeData, selectedEntry }: PropsWithChildren<EntryScopeProps>): import("react").FunctionComponentElement<import("react").ProviderProps<EntryContextValue | null>>;
8355
+ export function EntryScope({ children, entry, localeData, richTextImages, selectedEntry }: PropsWithChildren<EntryScopeProps>): import("react").FunctionComponentElement<import("react").ProviderProps<EntryContextValue | null>>;
8177
8356
  export function useEntryAtoms(): EntryContextValue;
8178
8357
  export function useOptionalEntryAtoms(): EntryContextValue | null;
8179
8358
  /**
@@ -8356,6 +8535,7 @@ declare module 'alinea/dashboard/icons' {
8356
8535
  export function IcRoundMoreVert(props: SVGProps<SVGSVGElement>): import("react").JSX.Element;
8357
8536
  export function IcRoundNorthEast(props: SVGProps<SVGSVGElement>): import("react").JSX.Element;
8358
8537
  export function IcRoundNumbers(props: SVGProps<SVGSVGElement>): import("react").JSX.Element;
8538
+ export function IcRoundOpenInFull(props: SVGProps<SVGSVGElement>): import("react").JSX.Element;
8359
8539
  export function IcRoundOpenInNew(props: SVGProps<SVGSVGElement>): import("react").JSX.Element;
8360
8540
  export function IcRoundPanorama(props: SVGProps<SVGSVGElement>): import("react").JSX.Element;
8361
8541
  export function IcRoundPermMedia(props: SVGProps<SVGSVGElement>): import("react").JSX.Element;
@@ -8816,7 +8996,7 @@ declare module 'alinea/field/link/EntryLink' {
8816
8996
  type EntryRow<Fields> = EntryLink<Type.Infer<Fields>> & ListRow;
8817
8997
  interface EntryOptions<Fields> extends LinkFieldOptions<Array<EntryReference & ListRow & InferStoredValue<Fields>>>, Omit<EntryPickerOptions<Fields>, 'label' | 'selection'> {
8818
8998
  }
8819
- export function multiple<Fields = undefined>(label: Label, options?: WithoutLabel<EntryOptions<Fields>>): import("alinea/field/link/LinkField").LinksField<EntryReference & ListRow, EntryRow<Fields>>;
8999
+ export function multiple<Fields = undefined>(label: Label, options?: WithoutLabel<EntryOptions<Fields>>): import("alinea/field/link/LinkField").LinksField<EntryReference & ListRow & InferStoredValue<Fields>, EntryRow<Fields>>;
8820
9000
  export {};
8821
9001
  }
8822
9002
  export {};
@@ -8985,6 +9165,11 @@ declare module 'alinea/field/link/LinkField' {
8985
9165
  import type { ReactNode } from 'react';
8986
9166
  /** Optional settings to configure a link field */
8987
9167
  export interface LinkFieldOptions<Value> extends FieldOptions<Value> {
9168
+ /**
9169
+ * Allow the same entry to be linked more than once.
9170
+ * Defaults to false for entry fields and true for generic link fields.
9171
+ */
9172
+ allowDuplicates?: boolean;
8988
9173
  /** Width of the field in the dashboard UI (0-1) */
8989
9174
  width?: number;
8990
9175
  /** Add instructional text to a field */
@@ -9308,6 +9493,8 @@ declare module 'alinea/field/metadata/MetadataField' {
9308
9493
  fields: Type<MetadataFields>;
9309
9494
  }> {
9310
9495
  }
9496
+ export interface MetadataField extends MetadataFields {
9497
+ }
9311
9498
  export class MetadataTimestampField extends ScalarField<number | null, MetadataTimestampOptions> {
9312
9499
  }
9313
9500
  export class MetadataUserField extends ScalarField<MetadataAuditUser, MetadataUserOptions> {
@@ -9352,6 +9539,8 @@ declare module 'alinea/field/number/NumberField' {
9352
9539
  help?: ReactNode;
9353
9540
  /** Display a minimal version */
9354
9541
  inline?: boolean;
9542
+ /** Text displayed when the field is empty */
9543
+ placeholder?: string;
9355
9544
  /** A minimum value */
9356
9545
  minValue?: number;
9357
9546
  /** A maximum value */
@@ -9584,7 +9773,9 @@ declare module 'alinea/field/richtext/PickTextLink' {
9584
9773
  import { Reference } from 'alinea/core/Reference';
9585
9774
  export interface PickerValue {
9586
9775
  link?: Reference;
9776
+ alt?: string;
9587
9777
  description?: string;
9778
+ src?: string;
9588
9779
  title?: string;
9589
9780
  blank?: boolean;
9590
9781
  }
@@ -9595,9 +9786,14 @@ declare module 'alinea/field/richtext/PickTextLink' {
9595
9786
  export interface PickTextLinkFunc {
9596
9787
  (options: Partial<PickerOptions>): Promise<PickerValue | undefined>;
9597
9788
  }
9789
+ export interface PickRichTextImageFunc {
9790
+ (options: Partial<PickerOptions>): Promise<PickerValue | undefined>;
9791
+ }
9598
9792
  export interface PickTextLinkState {
9599
9793
  isOpen: boolean;
9794
+ kind: 'image' | 'link';
9600
9795
  options: Partial<PickerOptions>;
9796
+ pickImage: PickRichTextImageFunc;
9601
9797
  pickLink: PickTextLinkFunc;
9602
9798
  cancel: () => void;
9603
9799
  confirm: (value: PickerValue | undefined) => void;
@@ -9615,10 +9811,13 @@ declare module 'alinea/field/richtext/ReferenceLink' {
9615
9811
  import { Reference } from 'alinea/core/Reference';
9616
9812
  import type { HTMLProps } from 'react';
9617
9813
  interface Anchor extends HTMLProps<HTMLAnchorElement> {
9814
+ _id?: string;
9815
+ _entry?: string;
9816
+ _link?: 'entry' | 'file' | 'image' | 'url';
9618
9817
  'data-id'?: string;
9619
9818
  'data-entry'?: string;
9620
9819
  'data-anchor'?: string;
9621
- 'data-link'?: 'entry' | 'file' | 'url';
9820
+ 'data-link'?: 'entry' | 'file' | 'image' | 'url';
9622
9821
  'data-suffix'?: string;
9623
9822
  }
9624
9823
  export function referenceToAttributes(reference: Reference): Anchor;
@@ -9695,8 +9894,13 @@ declare module 'alinea/field/richtext/RichTextBlockValue' {
9695
9894
  declare module 'alinea/field/richtext/RichTextDocument' {
9696
9895
 
9697
9896
  import { BlockNode, type TextDoc } from 'alinea/core/TextDoc';
9698
- import type { JSONContent } from '@tiptap/core';
9699
- export function editorContent(nodes: TextDoc): JSONContent;
9897
+ import { type Editor, type JSONContent } from '@tiptap/core';
9898
+ /** Include data attributes produced by custom extensions in the stored document. */
9899
+ export function editorDocument(editor: Editor): JSONContent;
9900
+ export function editorContent(nodes: TextDoc, images?: ReadonlyMap<string, {
9901
+ src: string;
9902
+ alt: string;
9903
+ }>): JSONContent;
9700
9904
  export function editorNodes(content: JSONContent, resolveBlock?: (id: string, typeName: string, snapshot: BlockNode | undefined) => BlockNode | undefined): TextDoc;
9701
9905
 
9702
9906
  }
@@ -9718,6 +9922,7 @@ declare module 'alinea/field/richtext/RichTextExtensions' {
9718
9922
  Italic: import("@tiptap/core").Mark<import("@tiptap/extension-italic").ItalicOptions, any>;
9719
9923
  Strike: import("@tiptap/core").Mark<import("@tiptap/extension-strike").StrikeOptions, any>;
9720
9924
  HorizontalRule: TipTapNode<import("@tiptap/extension-horizontal-rule").HorizontalRuleOptions, any>;
9925
+ Image: TipTapNode<import("@tiptap/extension-image").ImageOptions, any>;
9721
9926
  BulletList: TipTapNode<import("@tiptap/extension-list").BulletListOptions, any>;
9722
9927
  OrderedList: TipTapNode<import("@tiptap/extension-list").OrderedListOptions, any>;
9723
9928
  ListItem: TipTapNode<import("@tiptap/extension-list").ListItemOptions, any>;
@@ -9738,7 +9943,7 @@ declare module 'alinea/field/richtext/RichTextExtensions' {
9738
9943
  Highlight: import("@tiptap/core").Mark<import("@tiptap/extension-highlight").HighlightOptions, any>;
9739
9944
  UndoRedo: Extension<import("@tiptap/extensions").UndoRedoOptions, any>;
9740
9945
  };
9741
- export function defaultExtensionConfig(getEntryAnchors?: () => Iterable<string>): {
9946
+ export function defaultExtensionConfig(getEntryAnchors?: () => Iterable<string>, enableImageResize?: boolean): {
9742
9947
  Document: TipTapNode<any, any>;
9743
9948
  Text: TipTapNode<any, any>;
9744
9949
  Paragraph: TipTapNode<import("@tiptap/extension-paragraph").ParagraphOptions, any>;
@@ -9748,6 +9953,7 @@ declare module 'alinea/field/richtext/RichTextExtensions' {
9748
9953
  Italic: import("@tiptap/core").Mark<import("@tiptap/extension-italic").ItalicOptions, any>;
9749
9954
  Strike: import("@tiptap/core").Mark<import("@tiptap/extension-strike").StrikeOptions, any>;
9750
9955
  HorizontalRule: TipTapNode<import("@tiptap/extension-horizontal-rule").HorizontalRuleOptions, any>;
9956
+ Image: TipTapNode<import("@tiptap/extension-image").ImageOptions, any>;
9751
9957
  BulletList: TipTapNode<import("@tiptap/extension-list").BulletListOptions, any>;
9752
9958
  OrderedList: TipTapNode<import("@tiptap/extension-list").OrderedListOptions, any>;
9753
9959
  ListItem: TipTapNode<import("@tiptap/extension-list").ListItemOptions, any>;
@@ -9799,10 +10005,14 @@ declare module 'alinea/field/richtext/RichTextField' {
9799
10005
  help?: ReactNode;
9800
10006
  /** Display a minimal version */
9801
10007
  inline?: boolean;
10008
+ /** Text shown when the editor is empty */
10009
+ placeholder?: string;
9802
10010
  /** Index the text value of this field */
9803
10011
  searchable?: boolean;
9804
10012
  /** Enable inserting and editing tables */
9805
10013
  enableTables?: boolean;
10014
+ /** Enable inserting and editing images */
10015
+ enableImages?: boolean;
9806
10016
  /** Configure the toolbar layout and items */
9807
10017
  toolbar?: ToolbarConfig;
9808
10018
  /** Configure tiptap extensions */
@@ -9823,12 +10033,16 @@ declare module 'alinea/field/richtext/RichTextField.story' {
9823
10033
 
9824
10034
  export function RichTextStory(): import("react").JSX.Element;
9825
10035
  export function RichTextPlainStory(): import("react").JSX.Element;
10036
+ export function RichTextImageStory(): import("react").JSX.Element;
10037
+ export function RichTextImageDisabledStory(): import("react").JSX.Element;
10038
+ export function RichTextReadOnlyImageStory(): import("react").JSX.Element;
9826
10039
  export function RichTextLargeStory(): import("react").JSX.Element;
9827
10040
  export function RichTextImportedListStory(): import("react").JSX.Element;
9828
10041
  export function RichTextCustomToolbarStory(): import("react").JSX.Element;
9829
10042
  export function RichTextEmptyStory(): import("react").JSX.Element;
9830
10043
  export function RichTextLegacyEmptyStory(): import("react").JSX.Element;
9831
10044
  export function RichTextReadOnlyStory(): import("react").JSX.Element;
10045
+ export function RichTextInlineStory(): import("react").JSX.Element;
9832
10046
 
9833
10047
  }
9834
10048
 
@@ -9878,20 +10092,23 @@ declare module 'alinea/field/richtext/RichTextState' {
9878
10092
  declare module 'alinea/field/richtext/RichTextToolbar' {
9879
10093
 
9880
10094
  import type { Editor } from '@tiptap/core';
9881
- import type { PickTextLinkFunc } from 'alinea/field/richtext/PickTextLink';
10095
+ import type { PickRichTextImageFunc, PickTextLinkFunc } from 'alinea/field/richtext/PickTextLink';
9882
10096
  import { type ToolbarConfig } from 'alinea/field/richtext/Toolbar';
9883
10097
  import type { PickTextAnchorFunc } from 'alinea/field/richtext/PickTextAnchor';
9884
10098
  export interface RichTextToolbarProps {
9885
10099
  editor: Editor;
10100
+ enableImages?: boolean;
9886
10101
  enableTables?: boolean;
9887
10102
  ownerId: string;
10103
+ pickImage?: PickRichTextImageFunc;
9888
10104
  pickLink?: PickTextLinkFunc;
9889
10105
  pickAnchor?: PickTextAnchorFunc;
9890
10106
  getEntryAnchors: () => Array<string>;
9891
10107
  toolbar?: ToolbarConfig;
9892
10108
  onFocusChange: (focused: boolean, nextTarget?: EventTarget | null) => void;
9893
10109
  }
9894
- export function RichTextToolbar({ editor, enableTables, ownerId, pickLink, pickAnchor, getEntryAnchors, toolbar, onFocusChange }: RichTextToolbarProps): import("react").JSX.Element;
10110
+ export function RichTextToolbar({ editor, enableImages, enableTables, ownerId, pickImage, pickLink, pickAnchor, getEntryAnchors, toolbar, onFocusChange }: RichTextToolbarProps): import("react").JSX.Element;
10111
+ export function createImageHandler(editor: Editor, pickImage: PickRichTextImageFunc | undefined, exec: () => ReturnType<Editor['chain']>): () => void;
9895
10112
 
9896
10113
  }
9897
10114
 
@@ -9900,6 +10117,7 @@ declare module 'alinea/field/richtext/Toolbar' {
9900
10117
  import type { Editor } from '@tiptap/react';
9901
10118
  import type { ComponentType, ReactElement, ReactNode } from 'react';
9902
10119
  import type { PickTextLinkFunc } from 'alinea/field/richtext/PickTextLink';
10120
+ import type { PickRichTextImageFunc } from 'alinea/field/richtext/PickTextLink';
9903
10121
  export interface RichTextCommand {
9904
10122
  (): ReturnType<Editor['chain']>;
9905
10123
  }
@@ -9926,9 +10144,12 @@ declare module 'alinea/field/richtext/Toolbar' {
9926
10144
  export interface RichTextToolbarContext {
9927
10145
  editor: Editor;
9928
10146
  focusToggle: (target: EventTarget | null) => void;
10147
+ pickImage: PickRichTextImageFunc;
9929
10148
  pickLink: PickTextLinkFunc;
10149
+ enableImages?: boolean;
9930
10150
  enableTables?: boolean;
9931
10151
  exec: RichTextCommand;
10152
+ handleImage: () => void;
9932
10153
  handleLink: () => void;
9933
10154
  handleAnchor: () => void;
9934
10155
  toolbar: ToolbarConfig;
@@ -10078,6 +10299,16 @@ declare module 'alinea/field/richtext/Toolbar' {
10078
10299
  };
10079
10300
  };
10080
10301
  };
10302
+ export const images: {
10303
+ group: {
10304
+ image: {
10305
+ icon: () => import("react").JSX.Element;
10306
+ title: string;
10307
+ active: ({ editor }: RichTextToolbarContext) => boolean;
10308
+ onSelect: ({ handleImage }: RichTextToolbarContext) => void;
10309
+ };
10310
+ };
10311
+ };
10081
10312
  export const anchors: {
10082
10313
  group: {
10083
10314
  anchor: {
@@ -10099,7 +10330,11 @@ declare module 'alinea/field/richtext/Toolbar' {
10099
10330
  title: string;
10100
10331
  onSelect: ({ exec }: RichTextToolbarContext) => boolean;
10101
10332
  };
10102
- export function defaultToolbar(enableTables: boolean): ToolbarConfig;
10333
+ export interface DefaultToolbarOptions {
10334
+ enableImages?: boolean;
10335
+ enableTables?: boolean;
10336
+ }
10337
+ export function defaultToolbar({ enableImages, enableTables }?: DefaultToolbarOptions): ToolbarConfig;
10103
10338
  export {};
10104
10339
 
10105
10340
  }
@@ -10352,7 +10587,8 @@ declare module 'alinea' {
10352
10587
  declare module 'alinea/next' {
10353
10588
 
10354
10589
  export { createCMS } from 'alinea/adapter/next/cms';
10355
- export { createHandler } from 'alinea/adapter/next/handler';
10590
+ export { createHandler, type NextHandlerOptions } from 'alinea/adapter/next/handler';
10591
+ export type { AfterCommitContext, BeforeCommitContext } from 'alinea/backend/Handler';
10356
10592
  export { withAlinea } from 'alinea/adapter/next/with-alinea';
10357
10593
 
10358
10594
  }
@@ -10360,7 +10596,8 @@ declare module 'alinea/next' {
10360
10596
  declare module 'alinea/next.edge' {
10361
10597
 
10362
10598
  export { createCMS } from 'alinea/adapter/next/cms';
10363
- export { createHandler } from 'alinea/adapter/next/handler';
10599
+ export { createHandler, type NextHandlerOptions } from 'alinea/adapter/next/handler';
10600
+ export type { AfterCommitContext, BeforeCommitContext } from 'alinea/backend/Handler';
10364
10601
 
10365
10602
  }
10366
10603
 
@@ -10504,6 +10741,7 @@ declare module 'alinea/preview/PreviewMessage' {
10504
10741
  export enum PreviewAction {
10505
10742
  Ping = "[alinea-ping]",
10506
10743
  Pong = "[alinea-pong]",
10744
+ Disconnect = "[alinea-disconnect]",
10507
10745
  Reload = "[alinea-reload]",
10508
10746
  Refetch = "[alinea-refetch]",
10509
10747
  Previous = "[alinea-previous]",
@@ -10515,6 +10753,8 @@ declare module 'alinea/preview/PreviewMessage' {
10515
10753
  action: PreviewAction.Ping;
10516
10754
  } | {
10517
10755
  action: PreviewAction.Pong;
10756
+ } | {
10757
+ action: PreviewAction.Disconnect;
10518
10758
  } | {
10519
10759
  action: PreviewAction.Reload;
10520
10760
  } | {
@@ -10605,7 +10845,7 @@ declare module 'alinea/query' {
10605
10845
  parentId?: import("alinea/core/Filter").Condition<string | null>;
10606
10846
  path?: import("alinea/core/Filter").Condition<string>;
10607
10847
  url?: import("alinea/core/Filter").Condition<string>;
10608
- alias?: string;
10848
+ alias?: import("alinea/core/Filter").Condition<string>;
10609
10849
  createdAt?: import("alinea/core/Filter").Condition<number | null>;
10610
10850
  updatedAt?: import("alinea/core/Filter").Condition<number | null>;
10611
10851
  workspace?: import("alinea/core/Filter").Condition<string> | import("alinea/types").Workspace;
@@ -10640,7 +10880,7 @@ declare module 'alinea/query' {
10640
10880
  parentId?: import("alinea/core/Filter").Condition<string | null>;
10641
10881
  path?: import("alinea/core/Filter").Condition<string>;
10642
10882
  url?: import("alinea/core/Filter").Condition<string>;
10643
- alias?: string;
10883
+ alias?: import("alinea/core/Filter").Condition<string>;
10644
10884
  createdAt?: import("alinea/core/Filter").Condition<number | null>;
10645
10885
  updatedAt?: import("alinea/core/Filter").Condition<number | null>;
10646
10886
  workspace?: import("alinea/core/Filter").Condition<string> | import("alinea/types").Workspace;
@@ -10675,7 +10915,7 @@ declare module 'alinea/query' {
10675
10915
  parentId?: import("alinea/core/Filter").Condition<string | null>;
10676
10916
  path?: import("alinea/core/Filter").Condition<string>;
10677
10917
  url?: import("alinea/core/Filter").Condition<string>;
10678
- alias?: string;
10918
+ alias?: import("alinea/core/Filter").Condition<string>;
10679
10919
  createdAt?: import("alinea/core/Filter").Condition<number | null>;
10680
10920
  updatedAt?: import("alinea/core/Filter").Condition<number | null>;
10681
10921
  workspace?: import("alinea/core/Filter").Condition<string> | import("alinea/types").Workspace;
@@ -10710,7 +10950,7 @@ declare module 'alinea/query' {
10710
10950
  parentId?: import("alinea/core/Filter").Condition<string | null>;
10711
10951
  path?: import("alinea/core/Filter").Condition<string>;
10712
10952
  url?: import("alinea/core/Filter").Condition<string>;
10713
- alias?: string;
10953
+ alias?: import("alinea/core/Filter").Condition<string>;
10714
10954
  createdAt?: import("alinea/core/Filter").Condition<number | null>;
10715
10955
  updatedAt?: import("alinea/core/Filter").Condition<number | null>;
10716
10956
  workspace?: import("alinea/core/Filter").Condition<string> | import("alinea/types").Workspace;
@@ -10743,7 +10983,7 @@ declare module 'alinea/query' {
10743
10983
  parentId?: import("alinea/core/Filter").Condition<string | null>;
10744
10984
  path?: import("alinea/core/Filter").Condition<string>;
10745
10985
  url?: import("alinea/core/Filter").Condition<string>;
10746
- alias?: string;
10986
+ alias?: import("alinea/core/Filter").Condition<string>;
10747
10987
  createdAt?: import("alinea/core/Filter").Condition<number | null>;
10748
10988
  updatedAt?: import("alinea/core/Filter").Condition<number | null>;
10749
10989
  workspace?: import("alinea/core/Filter").Condition<string> | import("alinea/types").Workspace;
@@ -10775,7 +11015,7 @@ declare module 'alinea/query' {
10775
11015
  parentId?: import("alinea/core/Filter").Condition<string | null>;
10776
11016
  path?: import("alinea/core/Filter").Condition<string>;
10777
11017
  url?: import("alinea/core/Filter").Condition<string>;
10778
- alias?: string;
11018
+ alias?: import("alinea/core/Filter").Condition<string>;
10779
11019
  createdAt?: import("alinea/core/Filter").Condition<number | null>;
10780
11020
  updatedAt?: import("alinea/core/Filter").Condition<number | null>;
10781
11021
  workspace?: import("alinea/core/Filter").Condition<string> | import("alinea/types").Workspace;
@@ -10807,7 +11047,7 @@ declare module 'alinea/query' {
10807
11047
  parentId?: import("alinea/core/Filter").Condition<string | null>;
10808
11048
  path?: import("alinea/core/Filter").Condition<string>;
10809
11049
  url?: import("alinea/core/Filter").Condition<string>;
10810
- alias?: string;
11050
+ alias?: import("alinea/core/Filter").Condition<string>;
10811
11051
  createdAt?: import("alinea/core/Filter").Condition<number | null>;
10812
11052
  updatedAt?: import("alinea/core/Filter").Condition<number | null>;
10813
11053
  workspace?: import("alinea/core/Filter").Condition<string> | import("alinea/types").Workspace;
@@ -11083,6 +11323,7 @@ declare module 'alinea/ui/RichText' {
11083
11323
  li?: ComponentType<JSX.IntrinsicElements['li']> | ReactElement;
11084
11324
  blockquote?: ComponentType<JSX.IntrinsicElements['blockquote']> | ReactElement;
11085
11325
  hr?: ComponentType<JSX.IntrinsicElements['hr']> | ReactElement;
11326
+ img?: ComponentType<JSX.IntrinsicElements['img']> | ReactElement;
11086
11327
  br?: ComponentType<JSX.IntrinsicElements['br']> | ReactElement;
11087
11328
  small?: ComponentType<JSX.IntrinsicElements['small']> | ReactElement;
11088
11329
  sub?: ComponentType<JSX.IntrinsicElements['sub']> | ReactElement;