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.
- package/dist/.init/content/pages/welcome.json +1 -1
- package/dist/LICENSES.md +34 -7
- package/dist/adapter/next/DevRemote.d.ts +3 -0
- package/dist/adapter/next/DevRemote.js +37 -0
- package/dist/adapter/next/ForwardCredentials.d.ts +1 -0
- package/dist/adapter/next/ForwardCredentials.js +17 -0
- package/dist/adapter/next/cms.js +86 -38
- package/dist/adapter/next/context.d.ts +1 -1
- package/dist/adapter/next/context.js +11 -3
- package/dist/adapter/next/handler.d.ts +2 -0
- package/dist/adapter/next/handler.js +23 -16
- package/dist/adapter/next/previews.js +3 -1
- package/dist/adapter/next/previews.spec.d.ts +1 -0
- package/dist/adapter/next/with-alinea.js +18 -16
- package/dist/backend/Handler.d.ts +14 -13
- package/dist/backend/Handler.js +53 -22
- package/dist/backend/resolver/ParsePreview.d.ts +8 -4
- package/dist/backend/resolver/ParsePreview.js +40 -43
- package/dist/bundled.d.ts +318 -77
- package/dist/chunks/{chunk-LUBOGJCG.js → chunk-6V4TAD2N.js} +1 -1
- package/dist/chunks/{chunk-TL7ZW6BX.js → chunk-A3XXZBOQ.js} +2535 -2999
- package/dist/chunks/chunk-AC5ATYI3.js +1434 -0
- package/dist/chunks/{chunk-FRYHNUEK.js → chunk-HFBZMKIN.js} +6 -3
- package/dist/chunks/{chunk-7ORQ7BYK.js → chunk-KMLLLZ6X.js} +202 -269
- package/dist/chunks/{chunk-IWN3T3FL.js → chunk-O7XWTMCB.js} +1 -1
- package/dist/chunks/{chunk-53DZYORR.js → chunk-PAYSVIYI.js} +76 -176
- package/dist/chunks/{chunk-YK3OSMDM.js → chunk-S4AU6SRS.js} +188 -158
- package/dist/chunks/{chunk-I7X64JTZ.js → chunk-VXZM6V4P.js} +4 -4
- package/dist/cli/Generate.js +3 -13
- package/dist/cli/Serve.js +7 -3
- package/dist/cli/bin.js +8 -5
- package/dist/cli/generate/CopyStaticFiles.js +2 -3
- package/dist/cli/generate/DevDB.d.ts +1 -1
- package/dist/cli/generate/DevDB.js +3 -5
- package/dist/cli/serve/CreateLocalServer.d.ts +1 -1
- package/dist/cli/serve/CreateLocalServer.js +3 -2
- package/dist/cli/serve/DevServer.d.ts +3 -2
- package/dist/cli/serve/DevServer.js +60 -3
- package/dist/cli/serve/ServeContext.d.ts +1 -0
- package/dist/cli/serve/StartServer.d.ts +1 -0
- package/dist/cli/serve/StartServer.js +6 -1
- package/dist/cli/util/EnsureLibs.js +2 -2
- package/dist/cli/util/EnsureNode.js +2 -2
- package/dist/cloud/CloudRemote.js +1 -1
- package/dist/components/Breadcrumbs.js +6 -6
- package/dist/components/Button.js +6 -6
- package/dist/components/Calendar.js +13 -13
- package/dist/components/Checkbox.js +8 -8
- package/dist/components/CheckboxGroup.js +6 -6
- package/dist/components/ColorSwatch.js +6 -6
- package/dist/components/ColorSwatchPicker.js +6 -6
- package/dist/components/ComboBox.js +17 -17
- package/dist/components/DateField.js +7 -7
- package/dist/components/DatePicker.js +9 -9
- package/dist/components/DateRangePicker.js +14 -14
- package/dist/components/Dialog.js +6 -6
- package/dist/components/Disclosure.js +13 -13
- package/dist/components/DropZone.js +6 -6
- package/dist/components/Label.js +14 -14
- package/dist/components/Link.js +6 -6
- package/dist/components/List.js +34 -34
- package/dist/components/Menu.js +9 -9
- package/dist/components/Modal.js +9 -9
- package/dist/components/MultipleSelect.js +28 -28
- package/dist/components/NumberField.d.ts +2 -1
- package/dist/components/NumberField.js +22 -12
- package/dist/components/Popover.js +6 -6
- package/dist/components/ProgressCircle.js +9 -9
- package/dist/components/RadioGroup.js +6 -6
- package/dist/components/SearchField.js +14 -14
- package/dist/components/Select.js +16 -16
- package/dist/components/Surface.js +2 -2
- package/dist/components/Switch.js +8 -8
- package/dist/components/Table.js +14 -14
- package/dist/components/Tabs.js +9 -9
- package/dist/components/TagGroup.js +6 -6
- package/dist/components/TextField.js +10 -10
- package/dist/components/TimeField.js +8 -8
- package/dist/components/Toggle.js +8 -8
- package/dist/components/Toolbar.js +8 -8
- package/dist/components/Tooltip.js +9 -9
- package/dist/components/Tree.d.ts +4 -2
- package/dist/components/Tree.js +27 -13
- package/dist/core/Client.js +3 -2
- package/dist/core/Config.d.ts +4 -0
- package/dist/core/Config.js +6 -0
- package/dist/core/Connection.d.ts +2 -2
- package/dist/core/Connection.js +7 -0
- package/dist/core/Graph.d.ts +4 -5
- package/dist/core/Infer.d.ts +8 -1
- package/dist/core/ListRow.d.ts +2 -0
- package/dist/core/OrderBy.d.ts +7 -3
- package/dist/core/TextDoc.d.ts +11 -0
- package/dist/core/Trace.d.ts +8 -0
- package/dist/core/Trace.js +32 -0
- package/dist/core/db/CommitRequest.d.ts +0 -3
- package/dist/core/db/CommitRequest.js +0 -9
- package/dist/core/db/EntryAliases.js +1 -4
- package/dist/core/db/EntryDB.js +1 -1
- package/dist/core/db/EntryIndex.d.ts +10 -0
- package/dist/core/db/EntryIndex.js +117 -9
- package/dist/core/db/EntryResolver.js +110 -35
- package/dist/core/db/EntryTransaction.d.ts +1 -2
- package/dist/core/db/EntryTransaction.js +26 -13
- package/dist/core/db/LocalDB.d.ts +2 -3
- package/dist/core/db/LocalDB.js +24 -19
- package/dist/core/db/Operation.d.ts +2 -2
- package/dist/core/db/Operation.js +11 -1
- package/dist/core/field/RichTextField.d.ts +30 -3
- package/dist/core/field/RichTextField.js +125 -41
- package/dist/core/media/MediaAltField.d.ts +1 -0
- package/dist/core/media/MediaAltField.js +9 -1
- package/dist/core/source/OverlaySource.d.ts +12 -0
- package/dist/core/source/OverlaySource.js +50 -0
- package/dist/core/source/Source.d.ts +1 -1
- package/dist/core/source/Source.js +3 -3
- package/dist/dashboard/App.css +158 -0
- package/dist/dashboard/App.js +10 -4
- package/dist/dashboard/app/AccessDenied.d.ts +16 -1
- package/dist/dashboard/app/AccessDenied.js +20 -11
- package/dist/dashboard/app/ActivityStatus.js +15 -15
- package/dist/dashboard/app/AuthView.js +11 -11
- package/dist/dashboard/app/Badge.js +2 -2
- package/dist/dashboard/app/CompactField.js +12 -12
- package/dist/dashboard/app/DashboardErrorBoundary.js +4 -4
- package/dist/dashboard/app/DashboardLayout.js +22 -19
- package/dist/dashboard/app/EntryHeader.js +10 -10
- package/dist/dashboard/app/EntryReferences.js +10 -10
- package/dist/dashboard/app/EntrySidebar.d.ts +1 -1
- package/dist/dashboard/app/EntrySidebar.js +16 -15
- package/dist/dashboard/app/EntrySidebarPreview.d.ts +1 -1
- package/dist/dashboard/app/EntrySidebarPreview.js +60 -29
- package/dist/dashboard/app/EntrySidebarPreview.story.d.ts +6 -1
- package/dist/dashboard/app/EntryTranslationBanner.js +7 -7
- package/dist/dashboard/app/Explorer.d.ts +2 -1
- package/dist/dashboard/app/Explorer.js +63 -51
- package/dist/dashboard/app/ExplorerCards.js +51 -55
- package/dist/dashboard/app/ExplorerFileCard.js +20 -20
- package/dist/dashboard/app/ExplorerList.js +14 -14
- package/dist/dashboard/app/ExplorerModal.js +1 -1
- package/dist/dashboard/app/ExplorerTable.js +59 -59
- package/dist/dashboard/app/ExternalLinkPicker.js +15 -4
- package/dist/dashboard/app/LinkPicker.js +40 -15
- package/dist/dashboard/app/LocaleMenu.js +8 -8
- package/dist/dashboard/app/SidebarLayout.d.ts +8 -0
- package/dist/dashboard/app/SidebarLayout.js +1169 -0
- package/dist/dashboard/app/SidebarTree.js +56 -64
- package/dist/dashboard/app/WorkspaceMenu.js +14 -14
- package/dist/dashboard/app/WorkspaceRoots.js +24 -24
- package/dist/dashboard/app/editor/FileEditor.js +29 -30
- package/dist/dashboard/app/editor/FilePreview.js +6 -6
- package/dist/dashboard/app/editor/MediaAltField.view.d.ts +1 -1
- package/dist/dashboard/app/editor/MediaAltField.view.js +6 -9
- package/dist/dashboard/app/modals/CreateEntry.js +5 -5
- package/dist/dashboard/app/pages/EntryPage.js +49 -25
- package/dist/dashboard/app/pages/UsersPage.js +35 -35
- package/dist/dashboard/app/ui/DashboardModal.js +23 -23
- package/dist/dashboard/app/ui/Rail.js +3 -3
- package/dist/dashboard/app/ui/Sidebar.js +2 -2
- package/dist/dashboard/atoms/auth.js +2 -0
- package/dist/dashboard/atoms/dashboard.d.ts +9 -0
- package/dist/dashboard/atoms/dashboard.js +17 -0
- package/dist/dashboard/atoms/editor.d.ts +7 -1
- package/dist/dashboard/atoms/editor.js +4 -1
- package/dist/dashboard/atoms/entry.d.ts +3 -1
- package/dist/dashboard/atoms/entry.js +55 -15
- package/dist/dashboard/atoms/explorer.js +3 -8
- package/dist/dashboard/atoms/preview.d.ts +3 -0
- package/dist/dashboard/atoms/preview.js +18 -1
- package/dist/dashboard/hooks.d.ts +4 -2
- package/dist/dashboard/hooks.js +9 -5
- package/dist/dashboard/icons.d.ts +1 -0
- package/dist/dashboard/icons.js +10 -0
- package/dist/field/code/CodeField.view.js +13 -13
- package/dist/field/date/DateField.view.js +12 -2
- package/dist/field/link/EntryLink.d.ts +1 -1
- package/dist/field/link/EntryLink.js +1 -0
- package/dist/field/link/Link.js +3 -2
- package/dist/field/link/LinkField.d.ts +5 -0
- package/dist/field/link/LinkField.view.js +115 -87
- package/dist/field/list/ListField.view.js +22 -33
- package/dist/field/metadata/MetadataField.d.ts +2 -0
- package/dist/field/metadata/MetadataField.js +2 -1
- package/dist/field/metadata/MetadataField.view.js +18 -18
- package/dist/field/number/NumberField.d.ts +2 -0
- package/dist/field/number/NumberField.view.js +4 -2
- package/dist/field/richtext/PickTextLink.d.ts +7 -0
- package/dist/field/richtext/PickTextLink.js +104 -2
- package/dist/field/richtext/ReferenceLink.d.ts +4 -1
- package/dist/field/richtext/ReferenceLink.js +18 -4
- package/dist/field/richtext/RichTextBlock.js +2 -2
- package/dist/field/richtext/RichTextDocument.d.ts +7 -2
- package/dist/field/richtext/RichTextDocument.js +34 -5
- package/dist/field/richtext/RichTextExtensions.d.ts +3 -1
- package/dist/field/richtext/RichTextExtensions.js +2701 -7464
- package/dist/field/richtext/RichTextField.d.ts +4 -0
- package/dist/field/richtext/RichTextField.story.d.ts +4 -0
- package/dist/field/richtext/RichTextField.view.js +43 -20
- package/dist/field/richtext/RichTextInsertMenu.js +279 -493
- package/dist/field/richtext/RichTextToolbar.d.ts +5 -2
- package/dist/field/richtext/RichTextToolbar.js +38 -3
- package/dist/field/richtext/Toolbar.d.ts +19 -1
- package/dist/field/richtext/Toolbar.js +18 -13
- package/dist/field/richtext/extensions/Anchor.js +1 -1
- package/dist/field/richtext/extensions/Link.js +1 -1
- package/dist/field/richtext/extensions/Small.js +1 -1
- package/dist/field/select/SelectField.view.js +8 -6
- package/dist/index.css +240 -14
- package/dist/next.cjs +18 -16
- package/dist/next.d.ts +2 -1
- package/dist/next.edge.d.ts +2 -1
- package/dist/preview/PreviewMessage.d.ts +3 -0
- package/dist/preview/PreviewMessage.js +1 -0
- package/dist/preview/RegisterPreview.js +29 -9
- package/dist/preview/widget.js +6 -12
- package/dist/query.d.ts +7 -7
- package/dist/ui/RichText.d.ts +1 -0
- package/dist/ui/RichText.js +29 -2
- package/package.json +6 -3
- 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
|
-
|
|
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
|
/**
|
package/dist/dashboard/hooks.js
CHANGED
|
@@ -22,7 +22,9 @@ import {
|
|
|
22
22
|
localAtom,
|
|
23
23
|
viewsAtom
|
|
24
24
|
} from "./atoms/core.js";
|
|
25
|
-
import {
|
|
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;
|
package/dist/dashboard/icons.js
CHANGED
|
@@ -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-
|
|
74
|
-
"
|
|
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-
|
|
87
|
-
"
|
|
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
|
|
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 {};
|
package/dist/field/link/Link.js
CHANGED
|
@@ -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-
|
|
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-
|
|
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
|
-
"
|
|
93
|
-
"
|
|
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-
|
|
97
|
-
"
|
|
98
|
-
"LinkFieldView-
|
|
99
|
-
"
|
|
100
|
-
"LinkFieldView-
|
|
101
|
-
"
|
|
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-
|
|
109
|
-
"
|
|
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-
|
|
137
|
-
"
|
|
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:
|
|
418
|
-
selectionMode:
|
|
419
|
-
selectionBehavior:
|
|
422
|
+
preselect: selectsMultiple,
|
|
423
|
+
selectionMode: selectsMultiple ? "multiple" : "single",
|
|
424
|
+
selectionBehavior: selectsMultiple ? "toggle" : "replace",
|
|
420
425
|
initialSelection: initialSelection(value, selection),
|
|
421
|
-
onConfirm(
|
|
422
|
-
const
|
|
423
|
-
|
|
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((
|
|
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(
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
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
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
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
|
-
|
|
1109
|
-
|
|
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
|
}
|