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
@@ -496,6 +496,7 @@ var ExplorerAtoms = class {
496
496
  const graph = get(graphAtom);
497
497
  const sort = get(this.sort);
498
498
  const filter = get(this.filter);
499
+ const orderField = sort.sortBy === "title" ? Entry.title : sort.sortBy === "path" ? Entry.path : sort.sortBy === "size" ? MediaFile.size : sort.sortBy === "id" ? Entry.id : Entry.index;
499
500
  const entries = await graph.find({
500
501
  workspace: entry.workspace,
501
502
  root: entry.root,
@@ -505,10 +506,7 @@ var ExplorerAtoms = class {
505
506
  type: filter,
506
507
  status: "preferDraft",
507
508
  groupBy: Entry.id,
508
- orderBy: {
509
- [sort.direction]: sort.sortBy === "title" ? Entry.title : sort.sortBy === "path" ? Entry.path : sort.sortBy === "size" ? MediaFile.size : sort.sortBy === "id" ? Entry.id : Entry.index,
510
- caseSensitive: sort.sortBy !== "id"
511
- },
509
+ orderBy: sort.direction === "asc" ? { asc: orderField, caseSensitive: sort.sortBy !== "id" } : { desc: orderField, caseSensitive: sort.sortBy !== "id" },
512
510
  select: {
513
511
  active: Entry.active,
514
512
  createdAt: Entry.createdAt,
@@ -596,10 +594,7 @@ var ExplorerAtoms = class {
596
594
  type: filter,
597
595
  status: "preferDraft",
598
596
  groupBy: Entry.id,
599
- orderBy: search ? void 0 : selectedSort === void 0 && defaultOrderBy !== void 0 ? defaultOrderBy : {
600
- [sort.direction]: orderField,
601
- caseSensitive: sort.sortBy !== "id"
602
- },
597
+ orderBy: search ? void 0 : selectedSort === void 0 && defaultOrderBy !== void 0 ? defaultOrderBy : sort.direction === "asc" ? { asc: orderField, caseSensitive: sort.sortBy !== "id" } : { desc: orderField, caseSensitive: sort.sortBy !== "id" },
603
598
  select: {
604
599
  active: Entry.active,
605
600
  createdAt: Entry.createdAt,
@@ -1,4 +1,7 @@
1
+ import type { LocalConnection } from 'alinea/core/Connection';
1
2
  import type { PreviewMetadata } from 'alinea/core/Preview';
3
+ export declare function getPreviewToken(client: LocalConnection): Promise<string | undefined>;
4
+ export declare function retryPreviewToken(client: LocalConnection): void;
2
5
  export declare const previewMetadataAtom: import("jotai").PrimitiveAtom<PreviewMetadata | undefined> & {
3
6
  init: PreviewMetadata | undefined;
4
7
  };
@@ -4,7 +4,24 @@ import {
4
4
  import "../../chunks/chunk-CQ52GEHY.js";
5
5
 
6
6
  // src/dashboard/atoms/preview.ts
7
+ var previewTokens = /* @__PURE__ */ new WeakMap();
8
+ function getPreviewToken(client) {
9
+ const current = previewTokens.get(client);
10
+ if (current) return current;
11
+ const request = typeof client.previewToken === "function" ? client.previewToken() : Promise.resolve(void 0);
12
+ const token = request.catch((error) => {
13
+ if (previewTokens.get(client) === token) previewTokens.delete(client);
14
+ throw error;
15
+ });
16
+ previewTokens.set(client, token);
17
+ return token;
18
+ }
19
+ function retryPreviewToken(client) {
20
+ previewTokens.delete(client);
21
+ }
7
22
  var previewMetadataAtom = atom(void 0);
8
23
  export {
9
- previewMetadataAtom
24
+ getPreviewToken,
25
+ previewMetadataAtom,
26
+ retryPreviewToken
10
27
  };
@@ -9,7 +9,7 @@ import type { User } from 'alinea/core/User';
9
9
  import type { WorkspaceInternal } from 'alinea/core/Workspace';
10
10
  import { Type } from 'alinea';
11
11
  import type { ComponentType, Dispatch, PropsWithChildren, SetStateAction } from 'react';
12
- import { type EditorModel, type EditorNode, EntryEditor } from './atoms/editor.js';
12
+ import { type EditorModel, type EditorNode, EntryEditor, type ResolvedEditorImage } from './atoms/editor.js';
13
13
  import type { EntryAtoms, EntryLocaleAtoms } from './atoms/entry.js';
14
14
  import type { Page } from './atoms/nav.js';
15
15
  import type { RootAtoms } from './atoms/root.js';
@@ -17,6 +17,7 @@ import type { ReactiveNode } from './atoms/ReactiveNode.js';
17
17
  interface EntryContextValue {
18
18
  entry: EntryAtoms;
19
19
  localeData: EntryLocaleAtoms;
20
+ richTextImages: ReadonlyMap<string, ResolvedEditorImage>;
20
21
  selectedEntry: EntryRecord<Record<string, unknown>>;
21
22
  }
22
23
  export interface DashboardOptions {
@@ -84,9 +85,10 @@ export declare function useDashboardContext(): DashboardContextValue;
84
85
  export interface EntryScopeProps {
85
86
  entry: EntryAtoms;
86
87
  localeData: EntryLocaleAtoms;
88
+ richTextImages: ReadonlyMap<string, ResolvedEditorImage>;
87
89
  selectedEntry: EntryRecord<Record<string, unknown>>;
88
90
  }
89
- export declare function EntryScope({ children, entry, localeData, selectedEntry }: PropsWithChildren<EntryScopeProps>): import("react").FunctionComponentElement<import("react").ProviderProps<EntryContextValue | null>>;
91
+ export declare function EntryScope({ children, entry, localeData, richTextImages, selectedEntry }: PropsWithChildren<EntryScopeProps>): import("react").FunctionComponentElement<import("react").ProviderProps<EntryContextValue | null>>;
90
92
  export declare function useEntryAtoms(): EntryContextValue;
91
93
  export declare function useOptionalEntryAtoms(): EntryContextValue | null;
92
94
  /**
@@ -22,7 +22,9 @@ import {
22
22
  localAtom,
23
23
  viewsAtom
24
24
  } from "./atoms/core.js";
25
- import { EntryEditor } from "./atoms/editor.js";
25
+ import {
26
+ EntryEditor
27
+ } from "./atoms/editor.js";
26
28
  import { previewMetadataAtom } from "./atoms/preview.js";
27
29
  import { policyAtom, userAtom } from "./atoms/user.js";
28
30
  var entryContext = createContext(null);
@@ -99,11 +101,12 @@ function EntryScope({
99
101
  children,
100
102
  entry,
101
103
  localeData,
104
+ richTextImages,
102
105
  selectedEntry
103
106
  }) {
104
107
  const value = useMemo(
105
- () => ({ entry, localeData, selectedEntry }),
106
- [entry, localeData, selectedEntry]
108
+ () => ({ entry, localeData, richTextImages, selectedEntry }),
109
+ [entry, localeData, richTextImages, selectedEntry]
107
110
  );
108
111
  return createElement(entryContext.Provider, { value }, children);
109
112
  }
@@ -137,9 +140,10 @@ function useNodeEditor(node, type) {
137
140
  node,
138
141
  parent instanceof EntryEditor ? parent : void 0,
139
142
  activeVersion ?? void 0,
140
- policy
143
+ policy,
144
+ scope?.richTextImages
141
145
  );
142
- }, [activeVersion, node, parent, policy, type]);
146
+ }, [activeVersion, node, parent, policy, scope?.richTextImages, type]);
143
147
  return editor;
144
148
  }
145
149
  function useFieldNode(field) {
@@ -107,6 +107,7 @@ export declare function IcRoundMoreHoriz(props: SVGProps<SVGSVGElement>): import
107
107
  export declare function IcRoundMoreVert(props: SVGProps<SVGSVGElement>): import("react").JSX.Element;
108
108
  export declare function IcRoundNorthEast(props: SVGProps<SVGSVGElement>): import("react").JSX.Element;
109
109
  export declare function IcRoundNumbers(props: SVGProps<SVGSVGElement>): import("react").JSX.Element;
110
+ export declare function IcRoundOpenInFull(props: SVGProps<SVGSVGElement>): import("react").JSX.Element;
110
111
  export declare function IcRoundOpenInNew(props: SVGProps<SVGSVGElement>): import("react").JSX.Element;
111
112
  export declare function IcRoundPanorama(props: SVGProps<SVGSVGElement>): import("react").JSX.Element;
112
113
  export declare function IcRoundPermMedia(props: SVGProps<SVGSVGElement>): import("react").JSX.Element;
@@ -1631,6 +1631,15 @@ function IcRoundNumbers(props) {
1631
1631
  }
1632
1632
  ) });
1633
1633
  }
1634
+ function IcRoundOpenInFull(props) {
1635
+ return /* @__PURE__ */ jsx("svg", { width: "1em", height: "1em", viewBox: "0 0 24 24", ...props, children: /* @__PURE__ */ jsx(
1636
+ "path",
1637
+ {
1638
+ fill: "currentColor",
1639
+ d: "M21 8.59V4c0-.55-.45-1-1-1h-4.59c-.89 0-1.34 1.08-.71 1.71l1.59 1.59l-10 10l-1.59-1.59c-.62-.63-1.7-.19-1.7.7V20c0 .55.45 1 1 1h4.59c.89 0 1.34-1.08.71-1.71L7.71 17.7l10-10l1.59 1.59c.62.63 1.7.19 1.7-.7"
1640
+ }
1641
+ ) });
1642
+ }
1634
1643
  function IcRoundOpenInNew(props) {
1635
1644
  return /* @__PURE__ */ jsx("svg", { width: "1em", height: "1em", viewBox: "0 0 24 24", ...props, children: /* @__PURE__ */ jsx(
1636
1645
  "path",
@@ -2615,6 +2624,7 @@ export {
2615
2624
  IcRoundNorthEast,
2616
2625
  IcRoundNotes,
2617
2626
  IcRoundNumbers,
2627
+ IcRoundOpenInFull,
2618
2628
  IcRoundOpenInNew,
2619
2629
  IcRoundPanorama,
2620
2630
  IcRoundPermMedia,
@@ -64,27 +64,27 @@ import { Fragment, useId } from "react";
64
64
 
65
65
  // src/field/code/CodeField.module.css
66
66
  var CodeField_default = {
67
- "CodeEditorInput-textarea": "alinea-CodeEditorInput-textarea",
68
- "CodeEditorInputTextarea": "alinea-CodeEditorInput-textarea",
69
- "CodeEditorInput-string": "alinea-CodeEditorInput-string",
70
- "CodeEditorInputString": "alinea-CodeEditorInput-string",
71
67
  "CodeEditorInput-pre": "alinea-CodeEditorInput-pre",
72
68
  "CodeEditorInputPre": "alinea-CodeEditorInput-pre",
73
- "CodeEditorInput-regex": "alinea-CodeEditorInput-regex",
74
- "CodeEditorInputRegex": "alinea-CodeEditorInput-regex",
69
+ "CodeEditorInput-textarea": "alinea-CodeEditorInput-textarea",
70
+ "CodeEditorInputTextarea": "alinea-CodeEditorInput-textarea",
75
71
  "CodeEditorInput-identifier": "alinea-CodeEditorInput-identifier",
76
72
  "CodeEditorInputIdentifier": "alinea-CodeEditorInput-identifier",
77
- "CodeEditorInput": "alinea-CodeEditorInput",
78
- "CodeEditorInput-keyword": "alinea-CodeEditorInput-keyword",
79
- "CodeEditorInputKeyword": "alinea-CodeEditorInput-keyword",
80
- "CodeEditorInput-punctuation": "alinea-CodeEditorInput-punctuation",
81
- "CodeEditorInputPunctuation": "alinea-CodeEditorInput-punctuation",
82
73
  "CodeEditorInput-editor": "alinea-CodeEditorInput-editor",
83
74
  "CodeEditorInputEditor": "alinea-CodeEditorInput-editor",
75
+ "CodeEditorInput-punctuation": "alinea-CodeEditorInput-punctuation",
76
+ "CodeEditorInputPunctuation": "alinea-CodeEditorInput-punctuation",
77
+ "CodeEditorInput-string": "alinea-CodeEditorInput-string",
78
+ "CodeEditorInputString": "alinea-CodeEditorInput-string",
79
+ "CodeEditorInput": "alinea-CodeEditorInput",
80
+ "CodeEditorInput-number": "alinea-CodeEditorInput-number",
81
+ "CodeEditorInputNumber": "alinea-CodeEditorInput-number",
82
+ "CodeEditorInput-regex": "alinea-CodeEditorInput-regex",
83
+ "CodeEditorInputRegex": "alinea-CodeEditorInput-regex",
84
84
  "CodeEditorInput-comment": "alinea-CodeEditorInput-comment",
85
85
  "CodeEditorInputComment": "alinea-CodeEditorInput-comment",
86
- "CodeEditorInput-number": "alinea-CodeEditorInput-number",
87
- "CodeEditorInputNumber": "alinea-CodeEditorInput-number"
86
+ "CodeEditorInput-keyword": "alinea-CodeEditorInput-keyword",
87
+ "CodeEditorInputKeyword": "alinea-CodeEditorInput-keyword"
88
88
  };
89
89
 
90
90
  // src/field/code/CodeField.view.tsx
@@ -1,6 +1,16 @@
1
+ import "../../chunks/chunk-VXZM6V4P.js";
2
+ import "../../chunks/chunk-O7XWTMCB.js";
3
+ import "../../chunks/chunk-RKDPDEF7.js";
4
+ import "../../chunks/chunk-NIVGVRDS.js";
1
5
  import {
2
6
  $58246871e4652552$export$6b862160d295c8e
3
7
  } from "../../chunks/chunk-IYAQC63Y.js";
8
+ import "../../chunks/chunk-SJBZFMQ2.js";
9
+ import "../../chunks/chunk-6V4TAD2N.js";
10
+ import {
11
+ $2eb8e6d23f3d0cb0$export$a54013f0d02a8f82
12
+ } from "../../chunks/chunk-S4AU6SRS.js";
13
+ import "../../chunks/chunk-AC4U3IMS.js";
4
14
  import "../../chunks/chunk-CQ52GEHY.js";
5
15
 
6
16
  // src/field/date/DateField.view.tsx
@@ -16,7 +26,7 @@ function DateFieldView({ field }) {
16
26
  if (!value) return null;
17
27
  return $58246871e4652552$export$6b862160d295c8e(value);
18
28
  }, [value]);
19
- return /* @__PURE__ */ jsx(
29
+ return /* @__PURE__ */ jsx($2eb8e6d23f3d0cb0$export$a54013f0d02a8f82, { locale: "en-GB", children: /* @__PURE__ */ jsx(
20
30
  DatePicker,
21
31
  {
22
32
  description: options.help,
@@ -28,7 +38,7 @@ function DateFieldView({ field }) {
28
38
  onChange: (next) => setValue(next?.toString() || ""),
29
39
  value: parsedValue
30
40
  }
31
- );
41
+ ) });
32
42
  }
33
43
  export {
34
44
  DateFieldView
@@ -30,7 +30,7 @@ export declare namespace entry {
30
30
  type EntryRow<Fields> = EntryLink<Type.Infer<Fields>> & ListRow;
31
31
  interface EntryOptions<Fields> extends LinkFieldOptions<Array<EntryReference & ListRow & InferStoredValue<Fields>>>, Omit<EntryPickerOptions<Fields>, 'label' | 'selection'> {
32
32
  }
33
- export function multiple<Fields = undefined>(label: Label, options?: WithoutLabel<EntryOptions<Fields>>): import("alinea/field/link/LinkField").LinksField<EntryReference & ListRow, EntryRow<Fields>>;
33
+ export function multiple<Fields = undefined>(label: Label, options?: WithoutLabel<EntryOptions<Fields>>): import("alinea/field/link/LinkField").LinksField<EntryReference & ListRow & InferStoredValue<Fields>, EntryRow<Fields>>;
34
34
  export {};
35
35
  }
36
36
  export {};
@@ -33,6 +33,7 @@ function entry(label, options = {}) {
33
33
  ((entry2) => {
34
34
  function multiple(label, options = {}) {
35
35
  return createLinks(label, {
36
+ allowDuplicates: false,
36
37
  ...options,
37
38
  isEntryField: true,
38
39
  pickers: {
@@ -20,13 +20,14 @@ function link(label, options = {}) {
20
20
  selection: EntryLink
21
21
  }),
22
22
  url: urlPicker(options),
23
- file: filePicker(false, options)
23
+ file: filePicker(false, { ...options, location: void 0 })
24
24
  }
25
25
  });
26
26
  }
27
27
  ((link2) => {
28
28
  function multiple(label, options = {}) {
29
29
  return createLinks(label, {
30
+ allowDuplicates: true,
30
31
  ...options,
31
32
  pickers: {
32
33
  entry: entryPicker({
@@ -35,7 +36,7 @@ function link(label, options = {}) {
35
36
  selection: EntryLink
36
37
  }),
37
38
  url: urlPicker(options),
38
- file: filePicker(true, options)
39
+ file: filePicker(true, { ...options, location: void 0 })
39
40
  }
40
41
  });
41
42
  }
@@ -8,6 +8,11 @@ import { ListRow } from 'alinea/core/ListRow';
8
8
  import type { ReactNode } from 'react';
9
9
  /** Optional settings to configure a link field */
10
10
  export interface LinkFieldOptions<Value> extends FieldOptions<Value> {
11
+ /**
12
+ * Allow the same entry to be linked more than once.
13
+ * Defaults to false for entry fields and true for generic link fields.
14
+ */
15
+ allowDuplicates?: boolean;
11
16
  /** Width of the field in the dashboard UI (0-1) */
12
17
  width?: number;
13
18
  /** Add instructional text to a field */
@@ -9,14 +9,14 @@ import {
9
9
  import {
10
10
  atom
11
11
  } from "../../chunks/chunk-Y7XOMJOC.js";
12
- import "../../chunks/chunk-IWN3T3FL.js";
12
+ import "../../chunks/chunk-O7XWTMCB.js";
13
13
  import "../../chunks/chunk-RKDPDEF7.js";
14
14
  import "../../chunks/chunk-SJBZFMQ2.js";
15
15
  import {
16
16
  $5d3a17cc2564e64f$export$905ab40ac2179daa,
17
17
  $74812c42150b3de8$export$7941f8aafa4b6021,
18
18
  $f302ef02e940a6f8$export$ccdee5eaf73cf661
19
- } from "../../chunks/chunk-YK3OSMDM.js";
19
+ } from "../../chunks/chunk-S4AU6SRS.js";
20
20
  import {
21
21
  dist_default
22
22
  } from "../../chunks/chunk-I4OYYAX5.js";
@@ -89,54 +89,56 @@ import { Fragment, useMemo, useRef, useState } from "react";
89
89
 
90
90
  // src/field/link/LinkField.module.css
91
91
  var LinkField_default = {
92
- "LinkFieldView-image": "alinea-LinkFieldView-image",
93
- "LinkFieldViewImage": "alinea-LinkFieldView-image",
92
+ "is-loading": "alinea-is-loading",
93
+ "isLoading": "alinea-is-loading",
94
+ "LinkFieldView-metaLabel": "alinea-LinkFieldView-metaLabel",
95
+ "LinkFieldViewMetaLabel": "alinea-LinkFieldView-metaLabel",
94
96
  "LinkFieldView-previewImage": "alinea-LinkFieldView-previewImage",
95
97
  "LinkFieldViewPreviewImage": "alinea-LinkFieldView-previewImage",
96
- "LinkFieldView-rowAction": "alinea-LinkFieldView-rowAction",
97
- "LinkFieldViewRowAction": "alinea-LinkFieldView-rowAction",
98
- "LinkFieldView-labelText": "alinea-LinkFieldView-labelText",
99
- "LinkFieldViewLabelText": "alinea-LinkFieldView-labelText",
100
- "LinkFieldView-type": "alinea-LinkFieldView-type",
101
- "LinkFieldViewType": "alinea-LinkFieldView-type",
98
+ "LinkFieldView-anchorOption-label": "alinea-LinkFieldView-anchorOption-label",
99
+ "LinkFieldViewAnchorOptionLabel": "alinea-LinkFieldView-anchorOption-label",
100
+ "LinkFieldView-anchorOption-location": "alinea-LinkFieldView-anchorOption-location",
101
+ "LinkFieldViewAnchorOptionLocation": "alinea-LinkFieldView-anchorOption-location",
102
+ "LinkFieldView-label": "alinea-LinkFieldView-label",
103
+ "LinkFieldViewLabel": "alinea-LinkFieldView-label",
104
+ "is-missing": "alinea-is-missing",
105
+ "isMissing": "alinea-is-missing",
102
106
  "is-wide": "alinea-is-wide",
103
107
  "isWide": "alinea-is-wide",
108
+ "LinkFieldView-labelText": "alinea-LinkFieldView-labelText",
109
+ "LinkFieldViewLabelText": "alinea-LinkFieldView-labelText",
110
+ "LinkFieldView-imagePlaceholder": "alinea-LinkFieldView-imagePlaceholder",
111
+ "LinkFieldViewImagePlaceholder": "alinea-LinkFieldView-imagePlaceholder",
112
+ "LinkFieldView-icon": "alinea-LinkFieldView-icon",
113
+ "LinkFieldViewIcon": "alinea-LinkFieldView-icon",
104
114
  "LinkFieldView-title": "alinea-LinkFieldView-title",
105
115
  "LinkFieldViewTitle": "alinea-LinkFieldView-title",
116
+ "LinkFieldView-rowAction": "alinea-LinkFieldView-rowAction",
117
+ "LinkFieldViewRowAction": "alinea-LinkFieldView-rowAction",
118
+ "LinkFieldView-dropIndicator": "alinea-LinkFieldView-dropIndicator",
119
+ "LinkFieldViewDropIndicator": "alinea-LinkFieldView-dropIndicator",
106
120
  "LinkFieldView-create": "alinea-LinkFieldView-create",
107
121
  "LinkFieldViewCreate": "alinea-LinkFieldView-create",
108
- "LinkFieldView-icon": "alinea-LinkFieldView-icon",
109
- "LinkFieldViewIcon": "alinea-LinkFieldView-icon",
110
- "LinkFieldView-skeleton": "alinea-LinkFieldView-skeleton",
111
- "LinkFieldViewSkeleton": "alinea-LinkFieldView-skeleton",
112
- "LinkFieldView-imagePlaceholder": "alinea-LinkFieldView-imagePlaceholder",
113
- "LinkFieldViewImagePlaceholder": "alinea-LinkFieldView-imagePlaceholder",
114
- "LinkFieldView-label": "alinea-LinkFieldView-label",
115
- "LinkFieldViewLabel": "alinea-LinkFieldView-label",
122
+ "LinkFieldView-anchorOption": "alinea-LinkFieldView-anchorOption",
123
+ "LinkFieldViewAnchorOption": "alinea-LinkFieldView-anchorOption",
116
124
  "LinkFieldView-rowDropTarget": "alinea-LinkFieldView-rowDropTarget",
117
125
  "LinkFieldViewRowDropTarget": "alinea-LinkFieldView-rowDropTarget",
118
- "is-missing": "alinea-is-missing",
119
- "isMissing": "alinea-is-missing",
120
- "LinkFieldView-skeleton-pulse": "alinea-LinkFieldView-skeleton-pulse",
121
- "LinkFieldViewSkeletonPulse": "alinea-LinkFieldView-skeleton-pulse",
122
- "LinkFieldView-previewImagePlaceholder": "alinea-LinkFieldView-previewImagePlaceholder",
123
- "LinkFieldViewPreviewImagePlaceholder": "alinea-LinkFieldView-previewImagePlaceholder",
124
- "LinkFieldView-anchorOption-label": "alinea-LinkFieldView-anchorOption-label",
125
- "LinkFieldViewAnchorOptionLabel": "alinea-LinkFieldView-anchorOption-label",
126
- "LinkFieldView-dropIndicator": "alinea-LinkFieldView-dropIndicator",
127
- "LinkFieldViewDropIndicator": "alinea-LinkFieldView-dropIndicator",
128
- "is-loading": "alinea-is-loading",
129
- "isLoading": "alinea-is-loading",
130
- "LinkFieldView-metaLabel": "alinea-LinkFieldView-metaLabel",
131
- "LinkFieldViewMetaLabel": "alinea-LinkFieldView-metaLabel",
132
- "LinkFieldView-anchorOption-location": "alinea-LinkFieldView-anchorOption-location",
133
- "LinkFieldViewAnchorOptionLocation": "alinea-LinkFieldView-anchorOption-location",
134
126
  "LinkFieldView-meta": "alinea-LinkFieldView-meta",
135
127
  "LinkFieldViewMeta": "alinea-LinkFieldView-meta",
136
- "LinkFieldView-anchorOption": "alinea-LinkFieldView-anchorOption",
137
- "LinkFieldViewAnchorOption": "alinea-LinkFieldView-anchorOption",
128
+ "LinkFieldView-type": "alinea-LinkFieldView-type",
129
+ "LinkFieldViewType": "alinea-LinkFieldView-type",
130
+ "LinkFieldView-image": "alinea-LinkFieldView-image",
131
+ "LinkFieldViewImage": "alinea-LinkFieldView-image",
132
+ "LinkFieldView-skeleton": "alinea-LinkFieldView-skeleton",
133
+ "LinkFieldViewSkeleton": "alinea-LinkFieldView-skeleton",
138
134
  "LinkFieldView-createButton": "alinea-LinkFieldView-createButton",
139
- "LinkFieldViewCreateButton": "alinea-LinkFieldView-createButton"
135
+ "LinkFieldViewCreateButton": "alinea-LinkFieldView-createButton",
136
+ "LinkFieldView-inputHeader": "alinea-LinkFieldView-inputHeader",
137
+ "LinkFieldViewInputHeader": "alinea-LinkFieldView-inputHeader",
138
+ "LinkFieldView-previewImagePlaceholder": "alinea-LinkFieldView-previewImagePlaceholder",
139
+ "LinkFieldViewPreviewImagePlaceholder": "alinea-LinkFieldView-previewImagePlaceholder",
140
+ "LinkFieldView-skeleton-pulse": "alinea-LinkFieldView-skeleton-pulse",
141
+ "LinkFieldViewSkeletonPulse": "alinea-LinkFieldView-skeleton-pulse"
140
142
  };
141
143
 
142
144
  // src/field/link/LinkField.view.tsx
@@ -335,6 +337,7 @@ function initialFields(picker) {
335
337
  return Type.initialValue(picker.fields);
336
338
  }
337
339
  function LinkPickerAction({
340
+ allowDuplicates = false,
338
341
  anchorRef,
339
342
  ariaLabel,
340
343
  buttonAppearance = "plain",
@@ -395,8 +398,10 @@ function LinkPickerAction({
395
398
  const location = childLocation ?? resolved.location ?? fallbackLocation;
396
399
  const condition = resolved.condition;
397
400
  const handlesMultiple = Boolean(onPickMany && picker.handlesMultiple);
401
+ const selectsMultiple = handlesMultiple && !allowDuplicates;
398
402
  const pickerProps = {
399
403
  condition,
404
+ enableNavigation: options.enableNavigation,
400
405
  initialView: type === "file" || type === "image" ? "card" : void 0,
401
406
  initialResultMode: entryPickerResultMode(
402
407
  type,
@@ -414,13 +419,14 @@ function LinkPickerAction({
414
419
  limitLocations: options.limitLocations,
415
420
  nestedNavigation: !pickingChildren,
416
421
  pickChildren: pickingChildren,
417
- preselect: false,
418
- selectionMode: handlesMultiple ? "multiple" : "single",
419
- selectionBehavior: handlesMultiple ? "toggle" : "replace",
422
+ preselect: selectsMultiple,
423
+ selectionMode: selectsMultiple ? "multiple" : "single",
424
+ selectionBehavior: selectsMultiple ? "toggle" : "replace",
420
425
  initialSelection: initialSelection(value, selection),
421
- onConfirm(selection2) {
422
- const links = selection2.map(
423
- (entryId) => createEntryLink(type, entryId, picker)
426
+ onConfirm(entryIds) {
427
+ const existing = allowDuplicates ? [] : selection;
428
+ const links = entryIds.map(
429
+ (entryId) => existing?.find((row) => "_entry" in row && row._entry === entryId) ?? createEntryLink(type, entryId, picker)
424
430
  );
425
431
  if (onPickMany) return onPickMany(links);
426
432
  const [link] = links;
@@ -515,6 +521,7 @@ function LinkPickerDialog({
515
521
  const handlesMultiple = Boolean(onPickMany && picker.handlesMultiple);
516
522
  const pickerProps = {
517
523
  condition,
524
+ enableNavigation: options.enableNavigation,
518
525
  initialView: type === "file" || type === "image" ? "card" : void 0,
519
526
  initialResultMode: entryPickerResultMode(
520
527
  type,
@@ -681,13 +688,25 @@ function MultipleLinkCreateActions({ field }) {
681
688
  return /* @__PURE__ */ jsx("div", { className: styles.LinkFieldView.create(), ref: anchorRef, children: Object.entries(options.pickers).map(([type, picker]) => /* @__PURE__ */ jsxs(
682
689
  LinkPickerAction,
683
690
  {
691
+ allowDuplicates: options.allowDuplicates,
684
692
  anchorRef,
685
693
  buttonSize: "small",
686
694
  className: styles.LinkFieldView.createButton(),
687
695
  onPick: (link) => {
688
696
  setValue((links2) => [...links2 ?? [], link]);
689
697
  },
690
- onPickMany: (picked) => setValue((links2) => [...links2 ?? [], ...picked]),
698
+ onPickMany: (picked) => setValue((value2) => {
699
+ const current = value2 ?? [];
700
+ if (options.allowDuplicates) return [...current, ...picked];
701
+ const pickedIds = new Set(picked.map((row) => row._id));
702
+ const currentIds = new Set(current.map((row) => row._id));
703
+ return [
704
+ ...current.filter(
705
+ (row) => row._type !== type || pickedIds.has(row._id)
706
+ ),
707
+ ...picked.filter((row) => !currentIds.has(row._id))
708
+ ];
709
+ }),
691
710
  picker,
692
711
  selection: links.filter((row) => row._type === type),
693
712
  type,
@@ -1072,51 +1091,59 @@ function SingleLinkRow({ field, node, value }) {
1072
1091
  ] });
1073
1092
  return /* @__PURE__ */ jsxs(Fragment2, { children: [
1074
1093
  /* @__PURE__ */ jsxs(ListRow, { "aria-label": "Link item 1", first: true, role: "listitem", children: [
1075
- /* @__PURE__ */ jsxs(ListRowHeader, { first: true, hasFold: false, children: [
1076
- options.readOnly ? rowContent : /* @__PURE__ */ jsx(
1077
- Button,
1078
- {
1079
- "aria-label": "Edit link",
1080
- appearance: "plain",
1081
- className: styles.LinkFieldView.rowAction(),
1082
- onPress: () => setActionsOpen(true),
1083
- children: rowContent
1084
- }
1085
- ),
1086
- !options.readOnly && /* @__PURE__ */ jsxs(ListRowActions, { children: [
1087
- /* @__PURE__ */ jsxs(DialogTrigger, { isOpen: actionsOpen, onOpenChange: setActionsOpen, children: [
1088
- /* @__PURE__ */ jsx(LinkSettingsButton, {}),
1089
- /* @__PURE__ */ jsxs(Popover, { placement: "bottom right", children: [
1090
- /* @__PURE__ */ jsx(ListRowSettings, { actions: true, children: /* @__PURE__ */ jsx(
1091
- LinkRowActions,
1094
+ /* @__PURE__ */ jsxs(
1095
+ ListRowHeader,
1096
+ {
1097
+ first: true,
1098
+ hasFold: false,
1099
+ className: styles.LinkFieldView.inputHeader(),
1100
+ children: [
1101
+ options.readOnly ? rowContent : /* @__PURE__ */ jsx(
1102
+ Button,
1103
+ {
1104
+ "aria-label": "Edit link",
1105
+ appearance: "plain",
1106
+ className: styles.LinkFieldView.rowAction(),
1107
+ onPress: () => setActionsOpen(true),
1108
+ children: rowContent
1109
+ }
1110
+ ),
1111
+ !options.readOnly && /* @__PURE__ */ jsxs(ListRowActions, { children: [
1112
+ /* @__PURE__ */ jsxs(DialogTrigger, { isOpen: actionsOpen, onOpenChange: setActionsOpen, children: [
1113
+ /* @__PURE__ */ jsx(LinkSettingsButton, {}),
1114
+ /* @__PURE__ */ jsxs(Popover, { placement: "bottom right", children: [
1115
+ /* @__PURE__ */ jsx(ListRowSettings, { actions: true, children: /* @__PURE__ */ jsx(
1116
+ LinkRowActions,
1117
+ {
1118
+ closeActions,
1119
+ onEdit: () => setEditOpen(true),
1120
+ picker,
1121
+ type,
1122
+ value
1123
+ }
1124
+ ) }),
1125
+ /* @__PURE__ */ jsx(MenuSeparator, {}),
1126
+ /* @__PURE__ */ jsxs(ListRowSettings, { children: [
1127
+ /* @__PURE__ */ jsx(LinkLabelField, { node, value }),
1128
+ /* @__PURE__ */ jsx(EntryAnchorField, { node, value }),
1129
+ /* @__PURE__ */ jsx(EntryLinkSuffixField, { node, value })
1130
+ ] })
1131
+ ] })
1132
+ ] }),
1133
+ /* @__PURE__ */ jsx(
1134
+ Button,
1092
1135
  {
1093
- closeActions,
1094
- onEdit: () => setEditOpen(true),
1095
- picker,
1096
- type,
1097
- value
1136
+ appearance: "plain",
1137
+ "aria-label": "Remove link",
1138
+ icon: IcRoundClose,
1139
+ onPress: removeLink,
1140
+ size: "icon-small"
1098
1141
  }
1099
- ) }),
1100
- /* @__PURE__ */ jsx(MenuSeparator, {}),
1101
- /* @__PURE__ */ jsxs(ListRowSettings, { children: [
1102
- /* @__PURE__ */ jsx(LinkLabelField, { node, value }),
1103
- /* @__PURE__ */ jsx(EntryAnchorField, { node, value }),
1104
- /* @__PURE__ */ jsx(EntryLinkSuffixField, { node, value })
1105
- ] })
1142
+ )
1106
1143
  ] })
1107
- ] }),
1108
- /* @__PURE__ */ jsx(
1109
- Button,
1110
- {
1111
- appearance: "plain",
1112
- "aria-label": "Remove link",
1113
- icon: IcRoundClose,
1114
- onPress: removeLink,
1115
- size: "icon-small"
1116
- }
1117
- )
1118
- ] })
1119
- ] }),
1144
+ ]
1145
+ }
1146
+ ),
1120
1147
  hasFields && /* @__PURE__ */ jsx(ListRowBody, { children: /* @__PURE__ */ jsx(LinkRowEditor, { node, picker }) })
1121
1148
  ] }),
1122
1149
  picker && /* @__PURE__ */ jsx(
@@ -1380,13 +1407,14 @@ function SingleLinkFieldView({ field }) {
1380
1407
  value: selectedValue
1381
1408
  }
1382
1409
  ),
1383
- isEmpty && !readOnly && /* @__PURE__ */ jsx(ListCreateRow, { empty: true, children: /* @__PURE__ */ jsx(SingleLinkCreateActions, { field }) })
1410
+ isEmpty && !readOnly && /* @__PURE__ */ jsx(ListCreateRow, { empty: true, className: styles.LinkFieldView.inputHeader(), children: /* @__PURE__ */ jsx(SingleLinkCreateActions, { field }) })
1384
1411
  ] });
1385
1412
  return /* @__PURE__ */ jsx(
1386
1413
  Label,
1387
1414
  {
1388
1415
  description: options.help,
1389
1416
  label: options.inline ? void 0 : options.label,
1417
+ isRequired: options.required,
1390
1418
  shared: options.shared,
1391
1419
  children: content
1392
1420
  }