alinea 2.0.0-preview.12 → 2.0.0-preview.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/.init/content/pages/welcome.json +1 -1
- package/dist/.mcp/later/dev.json +1 -1
- package/dist/.mcp/online/dev.json +1 -1
- package/dist/adapter/next/cms.js +16 -8
- package/dist/adapter/next/dashboardUrl.d.ts +6 -0
- package/dist/adapter/next/dashboardUrl.js +13 -0
- package/dist/adapter/next/syncCheck.d.ts +15 -2
- package/dist/adapter/next/syncCheck.js +26 -9
- package/dist/backend/Handler.js +5 -1
- package/dist/backend/api/BlobStore.d.ts +21 -0
- package/dist/backend/api/BlobStore.js +63 -0
- package/dist/backend/api/CreateBackend.js +10 -8
- package/dist/backend/api/DatabaseApi.d.ts +4 -1
- package/dist/backend/api/DatabaseApi.js +88 -4
- package/dist/backend/api/GithubApi.js +47 -24
- package/dist/backend/api/database.js +6 -6
- package/dist/bundled.d.ts +676 -280
- package/dist/chunks/{bun-sqlite-5SHXN3AT.js → bun-sqlite-RI6BYU5S.js} +3 -3
- package/dist/chunks/{chunk-OHGAVV4G.js → chunk-3QFSGTGF.js} +2 -3
- package/dist/chunks/{chunk-QJGGYF6E.js → chunk-4ZA6KZHS.js} +5 -5
- package/dist/chunks/{chunk-ASYKC6IE.js → chunk-5H4D5JQL.js} +1 -1
- package/dist/chunks/{chunk-ETWOY4AL.js → chunk-A2I6MCCS.js} +1 -1
- package/dist/chunks/{chunk-W5AXN7GH.js → chunk-CYVOGRSD.js} +1 -2
- package/dist/chunks/{chunk-TIJTT5ZI.js → chunk-G43W7AME.js} +1 -0
- package/dist/chunks/{chunk-RE523BQ7.js → chunk-HOETF6HN.js} +5829 -5830
- package/dist/chunks/{chunk-AIU6CMVT.js → chunk-PTYZMV5G.js} +1 -1
- package/dist/chunks/{chunk-JOF663EG.js → chunk-QHHMKJUO.js} +1 -1
- package/dist/chunks/{chunk-66YZ47TY.js → chunk-RAR44T5O.js} +1 -1
- package/dist/chunks/{chunk-QSN6RH6X.js → chunk-VA6NC3MI.js} +1 -1
- package/dist/chunks/{node-sqlite-XVNTNMCY.js → node-sqlite-C7VJ2NSN.js} +3 -3
- package/dist/cli/Mcp.js +1 -1
- package/dist/cli/Serve.js +1 -1
- package/dist/cli/bin.js +2 -3
- package/dist/cli/serve/mcp/DevMcp.js +1 -1
- package/dist/cli/serve/mcp/McpTools.js +29 -1
- package/dist/cloud/CloudRemote.js +1 -1
- package/dist/components/Alert.js +2 -2
- package/dist/components/AppShell.js +2 -2
- package/dist/components/Badge.d.ts +3 -1
- package/dist/components/Badge.js +5 -3
- package/dist/components/Breadcrumbs.js +7 -7
- package/dist/components/Button.d.ts +6 -1
- package/dist/components/Button.js +16 -7
- package/dist/components/Calendar.js +20 -20
- package/dist/components/Checkbox.js +7 -7
- package/dist/components/CheckboxGroup.js +4 -4
- package/dist/components/Code.js +2 -2
- package/dist/components/Collapsible.js +3 -3
- package/dist/components/ColorSwatch.js +2 -2
- package/dist/components/ColorSwatchPicker.js +2 -2
- package/dist/components/ComboBox.js +7 -7
- package/dist/components/Command.js +14 -13
- package/dist/components/ContentCard.d.ts +3 -1
- package/dist/components/ContentCard.js +46 -24
- package/dist/components/ContentGrid.js +17 -17
- package/dist/components/DataList.js +2 -2
- package/dist/components/DateField.js +2 -2
- package/dist/components/DatePicker.js +2 -2
- package/dist/components/DateRangePicker.js +2 -2
- package/dist/components/Dialog.js +7 -7
- package/dist/components/DropZone.js +6 -6
- package/dist/components/DropdownMenu.js +9 -9
- package/dist/components/Empty.js +5 -5
- package/dist/components/Field.js +8 -8
- package/dist/components/List.js +27 -27
- package/dist/components/MediaPreview.js +5 -5
- package/dist/components/MultipleSelect.js +22 -22
- package/dist/components/NavRail.js +4 -4
- package/dist/components/NumberField.js +4 -4
- package/dist/components/Page.js +3 -3
- package/dist/components/Popover.js +2 -2
- package/dist/components/PreviewFrame.js +9 -9
- package/dist/components/RadioGroup.js +9 -9
- package/dist/components/Resizable.js +4 -4
- package/dist/components/SearchField.d.ts +6 -1
- package/dist/components/SearchField.js +5 -3
- package/dist/components/Select.js +13 -13
- package/dist/components/Sheet.d.ts +50 -0
- package/dist/components/Sheet.js +202 -0
- package/dist/components/Sidebar.js +4 -4
- package/dist/components/SortableList.d.ts +34 -30
- package/dist/components/SortableList.js +161 -264
- package/dist/components/Spinner.js +2 -2
- package/dist/components/Surface.js +2 -2
- package/dist/components/Switch.js +8 -8
- package/dist/components/Table.d.ts +3 -1
- package/dist/components/Table.js +57 -46
- package/dist/components/Tabs.js +5 -5
- package/dist/components/TagGroup.js +8 -8
- package/dist/components/TextField.js +10 -10
- package/dist/components/TimeField.js +6 -6
- package/dist/components/Timestamp.js +1 -1
- package/dist/components/ToggleGroup.js +2 -2
- package/dist/components/Toolbar.js +2 -2
- package/dist/components/Tooltip.js +5 -5
- package/dist/components/Tree.js +24 -24
- package/dist/components/internal/DateControl.js +12 -12
- package/dist/components/internal/ListBoxOption.js +6 -6
- package/dist/components/internal/Locale.js +2 -2
- package/dist/components/internal/PopoverSurface.js +4 -4
- package/dist/components/internal/SelectionCheckbox.js +5 -5
- package/dist/components/internal/Slot.js +1 -1
- package/dist/components/internal/ToggleButton.js +3 -3
- package/dist/components/internal/Trigger.js +2 -2
- package/dist/components/internal/sortableDrag.d.ts +19 -0
- package/dist/components/internal/sortableDrag.js +175 -0
- package/dist/components/internal/useDragDrop.js +2 -2
- package/dist/components.d.ts +1 -0
- package/dist/components.js +1 -0
- package/dist/core/Config.d.ts +6 -1
- package/dist/core/Document.d.ts +9 -1
- package/dist/core/Document.js +31 -6
- package/dist/core/Overview.d.ts +2 -4
- package/dist/core/TextDoc.d.ts +4 -0
- package/dist/core/Validation.d.ts +0 -1
- package/dist/core/Validation.js +0 -6
- package/dist/core/field/RichTextField.js +23 -4
- package/dist/core/media/MediaTypes.js +1 -1
- package/dist/core/source/GithubSource.d.ts +4 -0
- package/dist/core/source/GithubSource.js +127 -25
- package/dist/core/source/GithubUsage.d.ts +21 -0
- package/dist/core/source/GithubUsage.js +47 -0
- package/dist/dashboard/App.d.ts +2 -2
- package/dist/dashboard/App.js +5 -3
- package/dist/dashboard/ViewKeys.d.ts +1 -0
- package/dist/dashboard/ViewKeys.js +1 -0
- package/dist/dashboard/app/ActivityStatus.js +7 -7
- package/dist/dashboard/app/AuthView.js +5 -5
- package/dist/dashboard/app/BlockSheet.d.ts +50 -0
- package/dist/dashboard/app/BlockSheet.js +207 -0
- package/dist/dashboard/app/BlockSheetStoryFrame.d.ts +6 -0
- package/dist/dashboard/app/BlockSheetStoryFrame.js +29 -0
- package/dist/dashboard/app/CompactField.js +16 -16
- package/dist/dashboard/app/DashboardLayout.js +3 -1
- package/dist/dashboard/app/EntryFields.js +2 -2
- package/dist/dashboard/app/EntryHeader.js +33 -34
- package/dist/dashboard/app/EntryReferences.js +7 -7
- package/dist/dashboard/app/EntrySidebar.js +15 -15
- package/dist/dashboard/app/EntrySidebarPreview.js +3 -3
- package/dist/dashboard/app/EntryStatusIcon.d.ts +23 -0
- package/dist/dashboard/app/EntryStatusIcon.js +58 -0
- package/dist/dashboard/app/EntryValidationModal.d.ts +6 -5
- package/dist/dashboard/app/EntryValidationModal.js +20 -20
- package/dist/dashboard/app/Explorer.d.ts +3 -1
- package/dist/dashboard/app/Explorer.js +48 -44
- package/dist/dashboard/app/ExplorerBatchActions.d.ts +3 -1
- package/dist/dashboard/app/ExplorerBatchActions.js +68 -43
- package/dist/dashboard/app/ExplorerCards.js +7 -1
- package/dist/dashboard/app/ExplorerControls.js +6 -6
- package/dist/dashboard/app/ExplorerList.js +5 -5
- package/dist/dashboard/app/ExplorerModal.js +2 -2
- package/dist/dashboard/app/ExplorerTable.js +11 -8
- package/dist/dashboard/app/ImageEditor.js +28 -28
- package/dist/dashboard/app/ImagePicker.js +3 -13
- package/dist/dashboard/app/LinkPicker.js +28 -26
- package/dist/dashboard/app/LocaleMenu.js +4 -4
- package/dist/dashboard/app/MediaPreviewCell.js +1 -1
- package/dist/dashboard/app/MoveConfirmDialog.d.ts +5 -0
- package/dist/dashboard/app/MoveConfirmDialog.js +79 -0
- package/dist/dashboard/app/OverviewCell.js +8 -13
- package/dist/dashboard/app/PendingUploadsView.js +3 -3
- package/dist/dashboard/app/ReadOnlyBadge.d.ts +1 -1
- package/dist/dashboard/app/RemoveDialog.d.ts +17 -0
- package/dist/dashboard/app/{DeleteDialog.js → RemoveDialog.js} +67 -27
- package/dist/dashboard/app/RemoveRedirect.d.ts +7 -0
- package/dist/dashboard/app/RemoveRedirect.js +123 -0
- package/dist/dashboard/app/SearchBar.d.ts +9 -0
- package/dist/dashboard/app/SearchBar.js +31 -0
- package/dist/dashboard/app/SidebarTree.js +27 -72
- package/dist/dashboard/app/WorkspaceMenu.js +7 -7
- package/dist/dashboard/app/WorkspaceRoots.js +12 -12
- package/dist/dashboard/app/editor/FileEditor.js +14 -14
- package/dist/dashboard/app/modals/CreateEntry.js +3 -3
- package/dist/dashboard/app/pages/EntryPage.d.ts +2 -1
- package/dist/dashboard/app/pages/EntryPage.js +34 -15
- package/dist/dashboard/app/pages/SplashPage.js +37 -37
- package/dist/dashboard/app/pages/UsersPage.js +12 -12
- package/dist/dashboard/app/ui/DashboardModal.js +15 -14
- package/dist/dashboard/atoms/dashboard.js +1 -1
- package/dist/dashboard/atoms/entry.js +1 -14
- package/dist/dashboard/atoms/entryTable.js +1 -0
- package/dist/dashboard/atoms/explorer.d.ts +4 -0
- package/dist/dashboard/atoms/explorer.js +19 -7
- package/dist/dashboard/atoms/graph.js +1 -1
- package/dist/dashboard/atoms/link.js +5 -2
- package/dist/dashboard/atoms/move.d.ts +5 -0
- package/dist/dashboard/atoms/move.js +29 -3
- package/dist/dashboard/atoms/moveConfirmation.d.ts +34 -0
- package/dist/dashboard/atoms/moveConfirmation.js +95 -0
- package/dist/dashboard/atoms/nav.d.ts +9 -5
- package/dist/dashboard/atoms/nav.js +120 -45
- package/dist/dashboard/atoms/overview.d.ts +6 -5
- package/dist/dashboard/atoms/overview.js +2 -16
- package/dist/dashboard/atoms/remove.d.ts +112 -0
- package/dist/dashboard/atoms/remove.js +268 -0
- package/dist/dashboard/atoms/root.d.ts +2 -2
- package/dist/dashboard/atoms/root.js +41 -26
- package/dist/dashboard/atoms/user.js +1 -1
- package/dist/dashboard/atoms/utils.js +1 -1
- package/dist/dashboard/boot/Boot.js +25 -17
- package/dist/dashboard/boot/DashboardWorker.d.ts +1 -0
- package/dist/dashboard/boot/DashboardWorker.js +10 -46
- package/dist/dashboard/boot/LoadWorker.js +17 -10
- package/dist/dashboard/cms/EntryTable.js +8 -5
- package/dist/database/BrowserEntryStore.d.ts +12 -62
- package/dist/database/BrowserEntryStore.js +97 -196
- package/dist/database/DatabaseTables.js +2 -2
- package/dist/database/EntryDatabase.js +21 -1
- package/dist/database/EntryTransaction.js +0 -35
- package/dist/database/EntryUrlAliases.d.ts +4 -0
- package/dist/database/EntryUrlAliases.js +16 -10
- package/dist/database/driver/RuntimeDatabase.js +3 -3
- package/dist/database/driver/WasmDatabase.d.ts +5 -18
- package/dist/database/driver/WasmDatabase.js +15 -16
- package/dist/database/entry/EntryTable.js +2 -2
- package/dist/database/query/EntryQuery.js +1 -1
- package/dist/database/query/Relation.js +1 -1
- package/dist/database/query/Search.js +2 -2
- package/dist/field/code/CodeField.view.js +16 -16
- package/dist/field/link/EntryLink.d.ts +4 -4
- package/dist/field/link/FileLink.d.ts +4 -4
- package/dist/field/link/ImageLink.d.ts +4 -4
- package/dist/field/link/Link.d.ts +1 -1
- package/dist/field/link/LinkField.d.ts +5 -0
- package/dist/field/link/LinkField.view.js +244 -370
- package/dist/field/link/UrlLink.d.ts +4 -4
- package/dist/field/list/ListField.d.ts +2 -0
- package/dist/field/list/ListField.view.d.ts +15 -0
- package/dist/field/list/ListField.view.js +343 -301
- package/dist/field/metadata/MetadataField.d.ts +17 -7
- package/dist/field/metadata/MetadataField.js +14 -3
- package/dist/field/metadata/MetadataField.view.d.ts +1 -0
- package/dist/field/metadata/MetadataField.view.js +25 -21
- package/dist/field/richtext/RichTextBlock.d.ts +3 -1
- package/dist/field/richtext/RichTextBlock.js +177 -74
- package/dist/field/richtext/RichTextBlockHost.js +1 -1
- package/dist/field/richtext/RichTextExtensions.js +31 -31
- package/dist/field/richtext/RichTextField.view.js +14 -8
- package/dist/field/richtext/RichTextInsertMenu.js +43 -27
- package/dist/field/views.js +2 -0
- package/dist/index.css +490 -309
- package/dist/picker/url/UrlPicker.js +1 -0
- package/docs/components/badge.md +1 -0
- package/docs/components/button.md +1 -0
- package/docs/components/content-card.md +1 -0
- package/docs/components/search-field.md +1 -0
- package/docs/components/sortable-list.md +5 -20
- package/docs/components/table.md +1 -0
- package/docs/configuration.md +1 -1
- package/docs/deploy/self-host.md +1 -1
- package/docs/deploy.md +5 -4
- package/docs/fields.md +1 -1
- package/docs/index.md +1 -1
- package/docs/instant-publishing.md +7 -22
- package/docs/overviews.md +3 -4
- package/docs/upgrading.md +3 -2
- package/llms-full.txt +31 -55
- package/package.json +2 -3
- package/dist/core/db/EntryValidationError.d.ts +0 -13
- package/dist/core/db/EntryValidationError.js +0 -23
- package/dist/dashboard/app/DeleteDialog.d.ts +0 -11
- package/dist/dashboard/atoms/delete.d.ts +0 -68
- package/dist/dashboard/atoms/delete.js +0 -143
- package/dist/chunks/{chunk-MOWR65LM.js → chunk-PYDOMKJZ.js} +71 -71
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
atomWithStorage
|
|
3
|
-
} from "../../chunks/chunk-
|
|
3
|
+
} from "../../chunks/chunk-G43W7AME.js";
|
|
4
4
|
import {
|
|
5
5
|
useAtomValueRaw,
|
|
6
6
|
useSetAtom
|
|
@@ -25,28 +25,43 @@ import {
|
|
|
25
25
|
SortableList,
|
|
26
26
|
SortableListItemTitle,
|
|
27
27
|
SortableListAdd,
|
|
28
|
-
SortableListDragPreview,
|
|
29
28
|
ListError,
|
|
30
29
|
ListLabel,
|
|
31
30
|
SortableListItemActions,
|
|
32
31
|
SortableListItemContent,
|
|
33
|
-
SortableListHandle,
|
|
34
32
|
SortableListItemToggle,
|
|
35
33
|
SortableListItemHeader,
|
|
36
34
|
SortableListItemDescription,
|
|
37
|
-
|
|
35
|
+
SortableListItemInsert,
|
|
36
|
+
SortableListItemTrigger,
|
|
38
37
|
Popover,
|
|
38
|
+
PopoverAnchor,
|
|
39
39
|
PopoverContent,
|
|
40
40
|
PopoverTrigger,
|
|
41
|
-
|
|
41
|
+
SheetBody,
|
|
42
|
+
SheetClose,
|
|
43
|
+
SheetContent,
|
|
44
|
+
SheetFooter,
|
|
45
|
+
SheetHeader,
|
|
46
|
+
SheetSection,
|
|
47
|
+
SheetTitle,
|
|
48
|
+
TextField,
|
|
49
|
+
Tooltip,
|
|
50
|
+
TooltipContent,
|
|
51
|
+
TooltipTrigger
|
|
42
52
|
} from "alinea/components";
|
|
43
53
|
import { createId } from "alinea/core/Id";
|
|
44
54
|
import { getType } from "alinea/core/Internal";
|
|
45
55
|
import { Type } from "alinea/core/Type";
|
|
46
56
|
import { slugify } from "alinea/core/util/Slugs";
|
|
47
57
|
import { Badge } from "alinea/components";
|
|
58
|
+
import {
|
|
59
|
+
BlockSheet,
|
|
60
|
+
useBlockSheet
|
|
61
|
+
} from "alinea/dashboard/app/BlockSheet";
|
|
48
62
|
import { NodeEditor } from "alinea/dashboard/app/NodeEditor";
|
|
49
63
|
import {
|
|
64
|
+
useEntry,
|
|
50
65
|
useFieldError,
|
|
51
66
|
useFieldNode,
|
|
52
67
|
useFieldOptions,
|
|
@@ -59,46 +74,38 @@ import {
|
|
|
59
74
|
IcRoundArrowDownward,
|
|
60
75
|
IcRoundArrowUpward,
|
|
61
76
|
IcRoundClose,
|
|
77
|
+
IcRoundDelete,
|
|
62
78
|
IcRoundFirstPage,
|
|
63
79
|
IcRoundLastPage,
|
|
80
|
+
IcRoundLink,
|
|
64
81
|
IcRoundMoreHoriz
|
|
65
82
|
} from "alinea/dashboard/icons";
|
|
66
83
|
import { SlugField } from "alinea/field/path/SlugField";
|
|
67
|
-
import {
|
|
68
|
-
createContext,
|
|
69
|
-
memo,
|
|
70
|
-
useCallback,
|
|
71
|
-
useContext,
|
|
72
|
-
useMemo,
|
|
73
|
-
useState
|
|
74
|
-
} from "react";
|
|
84
|
+
import { memo, useCallback, useMemo, useRef, useState } from "react";
|
|
75
85
|
|
|
76
86
|
// src/field/list/ListField.module.css
|
|
77
87
|
var ListField_default = {
|
|
78
|
-
"
|
|
79
|
-
"
|
|
88
|
+
"ListFieldRowSheet-anchor-field": "alinea-ListFieldRowSheet-anchor-field",
|
|
89
|
+
"ListFieldRowSheetAnchorField": "alinea-ListFieldRowSheet-anchor-field",
|
|
90
|
+
"ListFieldRowSheet-anchor": "alinea-ListFieldRowSheet-anchor",
|
|
91
|
+
"ListFieldRowSheetAnchor": "alinea-ListFieldRowSheet-anchor",
|
|
80
92
|
"ListFieldTypePicker-trigger": "alinea-ListFieldTypePicker-trigger",
|
|
81
93
|
"ListFieldTypePickerTrigger": "alinea-ListFieldTypePicker-trigger",
|
|
82
|
-
"ListFieldRowHeader-separator": "alinea-ListFieldRowHeader-separator",
|
|
83
|
-
"ListFieldRowHeaderSeparator": "alinea-ListFieldRowHeader-separator",
|
|
84
94
|
"ListFieldCreateActions": "alinea-ListFieldCreateActions",
|
|
85
|
-
"ListFieldView-insertAction": "alinea-ListFieldView-insertAction",
|
|
86
|
-
"ListFieldViewInsertAction": "alinea-ListFieldView-insertAction",
|
|
87
95
|
"ListFieldCreateActions-button": "alinea-ListFieldCreateActions-button",
|
|
88
|
-
"ListFieldCreateActionsButton": "alinea-ListFieldCreateActions-button"
|
|
96
|
+
"ListFieldCreateActionsButton": "alinea-ListFieldCreateActions-button",
|
|
97
|
+
"ListFieldTypePicker-popover": "alinea-ListFieldTypePicker-popover",
|
|
98
|
+
"ListFieldTypePickerPopover": "alinea-ListFieldTypePicker-popover"
|
|
89
99
|
};
|
|
90
100
|
|
|
91
101
|
// src/field/list/ListField.view.tsx
|
|
92
102
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
93
103
|
var styles = dist_default(ListField_default);
|
|
94
|
-
var ListFieldDepthContext = createContext(0);
|
|
95
104
|
var copyAtom = atomWithStorage(
|
|
96
105
|
"@alinea/copypaste",
|
|
97
106
|
void 0
|
|
98
107
|
);
|
|
99
|
-
var LIST_FIELD_ROW_DRAG_TYPE = "application/x-alinea-list-field-row";
|
|
100
108
|
function ListFieldView({ field }) {
|
|
101
|
-
const depth = useContext(ListFieldDepthContext);
|
|
102
109
|
const options = useFieldOptions(field);
|
|
103
110
|
const error = useFieldError(field);
|
|
104
111
|
const list = useFieldNode(field);
|
|
@@ -121,7 +128,6 @@ function ListFieldView({ field }) {
|
|
|
121
128
|
const readOnly = Boolean(options.readOnly);
|
|
122
129
|
const hasRows = nodes.length > 0;
|
|
123
130
|
const canCreate = options.max === void 0 || nodes.length < options.max;
|
|
124
|
-
const [foldedIds, setFoldedIds] = useState(/* @__PURE__ */ new Set());
|
|
125
131
|
const rowIdsAtom = useMemo(
|
|
126
132
|
() => atom((get) => {
|
|
127
133
|
const nodes2 = get(list.nodes);
|
|
@@ -130,6 +136,9 @@ function ListFieldView({ field }) {
|
|
|
130
136
|
[list]
|
|
131
137
|
);
|
|
132
138
|
const rowIds = useAtomValueRaw(rowIdsAtom);
|
|
139
|
+
const [foldedIds, setFoldedIds] = useState(
|
|
140
|
+
() => new Set(options.collapsed ? rowIds : [])
|
|
141
|
+
);
|
|
133
142
|
const moveRowAtom = useMemo(
|
|
134
143
|
() => atom(null, (get, set, { keys, target }) => {
|
|
135
144
|
const nodes2 = get(list.nodes);
|
|
@@ -158,7 +167,7 @@ function ListFieldView({ field }) {
|
|
|
158
167
|
[list]
|
|
159
168
|
);
|
|
160
169
|
const copyRow = useSetAtom(copyRowAtom);
|
|
161
|
-
const allExpanded = nodes.length > 0 &&
|
|
170
|
+
const allExpanded = nodes.length > 0 && rowIds.every((id) => !foldedIds.has(id));
|
|
162
171
|
function toggleAll() {
|
|
163
172
|
setFoldedIds(allExpanded ? new Set(rowIds) : /* @__PURE__ */ new Set());
|
|
164
173
|
}
|
|
@@ -177,8 +186,6 @@ function ListFieldView({ field }) {
|
|
|
177
186
|
SortableList,
|
|
178
187
|
{
|
|
179
188
|
"aria-label": options.label || "List items",
|
|
180
|
-
"data-depth": depth % 2 === 0 ? "muted" : "base",
|
|
181
|
-
dragType: LIST_FIELD_ROW_DRAG_TYPE,
|
|
182
189
|
onReorder: readOnly ? void 0 : moveRow,
|
|
183
190
|
children: [
|
|
184
191
|
nodes.map((row, index) => /* @__PURE__ */ jsx(
|
|
@@ -212,7 +219,7 @@ function ListFieldView({ field }) {
|
|
|
212
219
|
]
|
|
213
220
|
}
|
|
214
221
|
);
|
|
215
|
-
return /* @__PURE__ */ jsxs(
|
|
222
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
216
223
|
/* @__PURE__ */ jsx(
|
|
217
224
|
ListLabel,
|
|
218
225
|
{
|
|
@@ -304,67 +311,6 @@ function ListFieldCreateActions({
|
|
|
304
311
|
)
|
|
305
312
|
] });
|
|
306
313
|
}
|
|
307
|
-
function ListFieldInsertAction({
|
|
308
|
-
icon,
|
|
309
|
-
isDisabled,
|
|
310
|
-
items,
|
|
311
|
-
label,
|
|
312
|
-
pasted,
|
|
313
|
-
onClose,
|
|
314
|
-
onOpenPicker,
|
|
315
|
-
onSelect
|
|
316
|
-
}) {
|
|
317
|
-
const directAddItem = !pasted && items.length === 1 ? items[0] : void 0;
|
|
318
|
-
if (directAddItem) {
|
|
319
|
-
return /* @__PURE__ */ jsx(
|
|
320
|
-
Button,
|
|
321
|
-
{
|
|
322
|
-
variant: "ghost",
|
|
323
|
-
className: styles.ListFieldView.insertAction(),
|
|
324
|
-
icon,
|
|
325
|
-
disabled: isDisabled,
|
|
326
|
-
onClick: () => {
|
|
327
|
-
onSelect(directAddItem);
|
|
328
|
-
onClose();
|
|
329
|
-
},
|
|
330
|
-
children: label
|
|
331
|
-
}
|
|
332
|
-
);
|
|
333
|
-
}
|
|
334
|
-
return /* @__PURE__ */ jsx(
|
|
335
|
-
Button,
|
|
336
|
-
{
|
|
337
|
-
variant: "ghost",
|
|
338
|
-
className: styles.ListFieldView.insertAction(),
|
|
339
|
-
disabled: isDisabled,
|
|
340
|
-
onClick: () => {
|
|
341
|
-
onOpenPicker();
|
|
342
|
-
},
|
|
343
|
-
icon,
|
|
344
|
-
children: label
|
|
345
|
-
}
|
|
346
|
-
);
|
|
347
|
-
}
|
|
348
|
-
function ListFieldInsertPanel({
|
|
349
|
-
items,
|
|
350
|
-
label,
|
|
351
|
-
pasted,
|
|
352
|
-
pasteLabel,
|
|
353
|
-
onPaste,
|
|
354
|
-
onSelect
|
|
355
|
-
}) {
|
|
356
|
-
return /* @__PURE__ */ jsx(
|
|
357
|
-
ListFieldTypeCommand,
|
|
358
|
-
{
|
|
359
|
-
items,
|
|
360
|
-
label,
|
|
361
|
-
pasted,
|
|
362
|
-
pasteLabel,
|
|
363
|
-
onPaste,
|
|
364
|
-
onSelect
|
|
365
|
-
}
|
|
366
|
-
);
|
|
367
|
-
}
|
|
368
314
|
var ListFieldRow = memo(function ListFieldRow2({
|
|
369
315
|
canCreate,
|
|
370
316
|
index,
|
|
@@ -389,13 +335,11 @@ var ListFieldRow = memo(function ListFieldRow2({
|
|
|
389
335
|
const setAnchor = useSetAtom(row.field("_anchor"));
|
|
390
336
|
const moveListRow = useSetAtom(list.move);
|
|
391
337
|
const removeRow = useSetAtom(list.remove);
|
|
338
|
+
const sheet = useBlockSheet(itemId);
|
|
392
339
|
const type = schema[typeName];
|
|
393
340
|
if (!type) return null;
|
|
394
341
|
const label = Type.label(type);
|
|
395
342
|
const typeIcon = getType(type).icon;
|
|
396
|
-
function moveCurrentRow(direction) {
|
|
397
|
-
moveListRow(index, index + direction);
|
|
398
|
-
}
|
|
399
343
|
function deleteRow() {
|
|
400
344
|
removeRow(index);
|
|
401
345
|
}
|
|
@@ -408,249 +352,346 @@ var ListFieldRow = memo(function ListFieldRow2({
|
|
|
408
352
|
function updateAnchor(nextValue) {
|
|
409
353
|
setAnchor(slugify(nextValue.replace(/^#+/, "")) || void 0);
|
|
410
354
|
}
|
|
411
|
-
return /* @__PURE__ */ jsxs(
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
}
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
355
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
356
|
+
/* @__PURE__ */ jsxs(
|
|
357
|
+
SortableListItem,
|
|
358
|
+
{
|
|
359
|
+
"aria-label": `${label} item ${index + 1}`,
|
|
360
|
+
current: sheet.open,
|
|
361
|
+
id: itemId,
|
|
362
|
+
children: [
|
|
363
|
+
canCreate && !readOnly && /* @__PURE__ */ jsx(
|
|
364
|
+
ListFieldInsertGap,
|
|
365
|
+
{
|
|
366
|
+
items: typeItems,
|
|
367
|
+
label: `Insert before ${label} item ${index + 1}`,
|
|
368
|
+
pasted: pasted && schema[pasted._type] ? pasted : void 0,
|
|
369
|
+
onInsert: (value) => onInsertRow(insertIndex(index, "before"), value)
|
|
370
|
+
}
|
|
371
|
+
),
|
|
372
|
+
/* @__PURE__ */ jsx(
|
|
373
|
+
ListFieldRowHeader,
|
|
374
|
+
{
|
|
375
|
+
expanded,
|
|
376
|
+
label,
|
|
377
|
+
customLabel,
|
|
378
|
+
anchor: anchorValue,
|
|
379
|
+
readOnly,
|
|
380
|
+
sheet,
|
|
381
|
+
typeIcon,
|
|
382
|
+
onDelete: deleteRow,
|
|
383
|
+
onToggle: () => onToggleRow(itemId)
|
|
384
|
+
}
|
|
385
|
+
),
|
|
386
|
+
expanded && /* @__PURE__ */ jsx(SortableListItemContent, { children: /* @__PURE__ */ jsx(NodeEditor, { node: row, type }) })
|
|
387
|
+
]
|
|
388
|
+
}
|
|
389
|
+
),
|
|
390
|
+
/* @__PURE__ */ jsx(BlockSheet, { id: itemId, children: /* @__PURE__ */ jsx(
|
|
391
|
+
ListFieldRowSheet,
|
|
392
|
+
{
|
|
393
|
+
anchor: anchorValue,
|
|
394
|
+
canInsert: canCreate,
|
|
395
|
+
customLabel,
|
|
396
|
+
isFirstRow: index === 0,
|
|
397
|
+
isLastRow: index === rows - 1,
|
|
398
|
+
items: typeItems,
|
|
399
|
+
label,
|
|
400
|
+
pasted: pasted && schema[pasted._type] ? pasted : void 0,
|
|
401
|
+
readOnly,
|
|
402
|
+
typeIcon,
|
|
403
|
+
onAnchorChange: updateAnchor,
|
|
404
|
+
onClose: () => sheet.setOpen(false),
|
|
405
|
+
onCopy: () => onCopyRow(itemId),
|
|
406
|
+
onCustomLabelChange: updateCustomLabel,
|
|
407
|
+
onDelete: deleteRow,
|
|
408
|
+
onInsertAfter: (value) => onInsertRow(insertIndex(index, "after"), value),
|
|
409
|
+
onInsertBefore: (value) => onInsertRow(insertIndex(index, "before"), value),
|
|
410
|
+
onMoveDown: () => moveListRow(index, index + 1),
|
|
411
|
+
onMoveUp: () => moveListRow(index, index - 1)
|
|
412
|
+
}
|
|
413
|
+
) })
|
|
414
|
+
] });
|
|
448
415
|
});
|
|
416
|
+
function ListFieldInsertGap({
|
|
417
|
+
items,
|
|
418
|
+
label,
|
|
419
|
+
pasted,
|
|
420
|
+
onInsert
|
|
421
|
+
}) {
|
|
422
|
+
const ref = useRef(null);
|
|
423
|
+
const [open, setOpen] = useState(false);
|
|
424
|
+
const direct = !pasted && items.length === 1 ? items[0] : void 0;
|
|
425
|
+
function insert(row) {
|
|
426
|
+
onInsert(row);
|
|
427
|
+
setOpen(false);
|
|
428
|
+
}
|
|
429
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
430
|
+
/* @__PURE__ */ jsx(
|
|
431
|
+
SortableListItemInsert,
|
|
432
|
+
{
|
|
433
|
+
ref,
|
|
434
|
+
"aria-label": label,
|
|
435
|
+
"aria-haspopup": direct ? void 0 : "dialog",
|
|
436
|
+
"aria-expanded": direct ? void 0 : open,
|
|
437
|
+
onClick: () => {
|
|
438
|
+
if (direct) onInsert(createRow(direct.id, direct.type));
|
|
439
|
+
else setOpen(true);
|
|
440
|
+
}
|
|
441
|
+
}
|
|
442
|
+
),
|
|
443
|
+
!direct && /* @__PURE__ */ jsxs(Popover, { open, onOpenChange: setOpen, children: [
|
|
444
|
+
/* @__PURE__ */ jsx(PopoverAnchor, { virtualRef: ref }),
|
|
445
|
+
/* @__PURE__ */ jsx(
|
|
446
|
+
PopoverContent,
|
|
447
|
+
{
|
|
448
|
+
"aria-label": label,
|
|
449
|
+
align: "start",
|
|
450
|
+
className: styles.ListFieldTypePicker.popover(),
|
|
451
|
+
children: /* @__PURE__ */ jsx(
|
|
452
|
+
ListFieldTypeCommand,
|
|
453
|
+
{
|
|
454
|
+
items,
|
|
455
|
+
label,
|
|
456
|
+
pasted,
|
|
457
|
+
pasteLabel: pasted ? pasteBlockLabel(pasted, items) : void 0,
|
|
458
|
+
onPaste: (row) => insert(cloneRow(row)),
|
|
459
|
+
onSelect: (item) => insert(createRow(item.id, item.type))
|
|
460
|
+
}
|
|
461
|
+
)
|
|
462
|
+
}
|
|
463
|
+
)
|
|
464
|
+
] })
|
|
465
|
+
] });
|
|
466
|
+
}
|
|
467
|
+
function rowAnchor(customLabel, anchor) {
|
|
468
|
+
return (anchor ?? slugify(customLabel.trim())).trim();
|
|
469
|
+
}
|
|
449
470
|
function ListFieldRowHeader({
|
|
450
|
-
canInsert,
|
|
451
|
-
className,
|
|
452
471
|
expanded,
|
|
453
|
-
isFirstRow,
|
|
454
|
-
isLastRow,
|
|
455
|
-
isPreview,
|
|
456
|
-
insertItems,
|
|
457
472
|
label,
|
|
458
|
-
dragLabel,
|
|
459
473
|
customLabel,
|
|
460
474
|
anchor,
|
|
461
|
-
pasted,
|
|
462
475
|
readOnly,
|
|
476
|
+
sheet,
|
|
463
477
|
typeIcon,
|
|
464
|
-
onAnchorChange,
|
|
465
|
-
onCustomLabelChange,
|
|
466
|
-
onCopy,
|
|
467
478
|
onDelete,
|
|
468
|
-
onInsertBefore,
|
|
469
|
-
onInsertAfter,
|
|
470
|
-
onMoveDown,
|
|
471
|
-
onMoveUp,
|
|
472
479
|
onToggle
|
|
473
480
|
}) {
|
|
474
481
|
const displayLabel = customLabel.trim();
|
|
475
|
-
const displayAnchor = (anchor
|
|
482
|
+
const displayAnchor = rowAnchor(customLabel, anchor);
|
|
476
483
|
const showAnchor = Boolean(displayAnchor && !displayLabel);
|
|
477
|
-
const
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
484
|
+
const title = /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
485
|
+
/* @__PURE__ */ jsx(Badge, { icon: typeIcon, size: "sm", color: "primary", children: label }),
|
|
486
|
+
displayLabel && /* @__PURE__ */ jsx(SortableListItemDescription, { children: displayLabel }),
|
|
487
|
+
showAnchor && /* @__PURE__ */ jsxs(Badge, { size: "sm", children: [
|
|
488
|
+
"#",
|
|
489
|
+
displayAnchor
|
|
490
|
+
] })
|
|
491
|
+
] });
|
|
492
|
+
return /* @__PURE__ */ jsxs(SortableListItemHeader, { children: [
|
|
485
493
|
/* @__PURE__ */ jsxs(SortableListItemTitle, { children: [
|
|
486
494
|
/* @__PURE__ */ jsx(
|
|
487
495
|
SortableListItemToggle,
|
|
488
496
|
{
|
|
489
497
|
"aria-label": expanded ? `Collapse ${label}` : `Expand ${label}`,
|
|
490
498
|
expanded,
|
|
491
|
-
disabled: isPreview,
|
|
492
499
|
onClick: onToggle
|
|
493
500
|
}
|
|
494
501
|
),
|
|
495
|
-
/* @__PURE__ */ jsx(
|
|
496
|
-
|
|
497
|
-
showAnchor && /* @__PURE__ */ jsxs(Badge, { size: "sm", children: [
|
|
498
|
-
"#",
|
|
499
|
-
displayAnchor
|
|
500
|
-
] })
|
|
501
|
-
] }),
|
|
502
|
-
/* @__PURE__ */ jsxs(SortableListItemActions, { children: [
|
|
503
|
-
/* @__PURE__ */ jsxs(
|
|
504
|
-
Popover,
|
|
502
|
+
sheet.available ? /* @__PURE__ */ jsx(
|
|
503
|
+
SortableListItemTrigger,
|
|
505
504
|
{
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
505
|
+
...sheet.triggerProps,
|
|
506
|
+
"aria-label": `${label} settings`,
|
|
507
|
+
"aria-expanded": sheet.open,
|
|
508
|
+
onClick: () => {
|
|
509
|
+
if (!sheet.open && !expanded) onToggle();
|
|
510
|
+
sheet.toggle();
|
|
510
511
|
},
|
|
511
|
-
children:
|
|
512
|
+
children: title
|
|
513
|
+
}
|
|
514
|
+
) : title
|
|
515
|
+
] }),
|
|
516
|
+
/* @__PURE__ */ jsx(SortableListItemActions, { children: /* @__PURE__ */ jsx(
|
|
517
|
+
Button,
|
|
518
|
+
{
|
|
519
|
+
variant: "ghost",
|
|
520
|
+
"aria-label": `Remove ${label}`,
|
|
521
|
+
icon: IcRoundClose,
|
|
522
|
+
disabled: readOnly,
|
|
523
|
+
onClick: onDelete,
|
|
524
|
+
size: "icon-sm"
|
|
525
|
+
}
|
|
526
|
+
) })
|
|
527
|
+
] });
|
|
528
|
+
}
|
|
529
|
+
function ListFieldRowSheet({
|
|
530
|
+
anchor,
|
|
531
|
+
canInsert,
|
|
532
|
+
customLabel,
|
|
533
|
+
isFirstRow,
|
|
534
|
+
isLastRow,
|
|
535
|
+
items,
|
|
536
|
+
label,
|
|
537
|
+
pasted,
|
|
538
|
+
readOnly,
|
|
539
|
+
typeIcon,
|
|
540
|
+
onAnchorChange,
|
|
541
|
+
onClose,
|
|
542
|
+
onCopy,
|
|
543
|
+
onCustomLabelChange,
|
|
544
|
+
onDelete,
|
|
545
|
+
onInsertAfter,
|
|
546
|
+
onInsertBefore,
|
|
547
|
+
onMoveDown,
|
|
548
|
+
onMoveUp
|
|
549
|
+
}) {
|
|
550
|
+
const [insertPosition, setInsertPosition] = useState(
|
|
551
|
+
null
|
|
552
|
+
);
|
|
553
|
+
const entryUrl = useEntry()?.url;
|
|
554
|
+
const displayLabel = customLabel.trim();
|
|
555
|
+
const displayAnchor = rowAnchor(customLabel, anchor);
|
|
556
|
+
const title = displayLabel || displayAnchor && `#${displayAnchor}` || label;
|
|
557
|
+
const link = entryUrl && displayAnchor ? `${entryUrl}#${displayAnchor}` : void 0;
|
|
558
|
+
function insert(position, row) {
|
|
559
|
+
if (position === "after") onInsertAfter(row);
|
|
560
|
+
else onInsertBefore(row);
|
|
561
|
+
onClose();
|
|
562
|
+
}
|
|
563
|
+
function startInsert(position) {
|
|
564
|
+
const only = !pasted && items.length === 1 ? items[0] : void 0;
|
|
565
|
+
if (only) insert(position, createRow(only.id, only.type));
|
|
566
|
+
else setInsertPosition(position);
|
|
567
|
+
}
|
|
568
|
+
function copy() {
|
|
569
|
+
onCopy();
|
|
570
|
+
onClose();
|
|
571
|
+
}
|
|
572
|
+
return /* @__PURE__ */ jsxs(SheetContent, { onClose, children: [
|
|
573
|
+
/* @__PURE__ */ jsxs(SheetHeader, { children: [
|
|
574
|
+
/* @__PURE__ */ jsx(Badge, { icon: typeIcon, size: "sm", color: "primary", children: label }),
|
|
575
|
+
/* @__PURE__ */ jsx(SheetTitle, { children: title }),
|
|
576
|
+
/* @__PURE__ */ jsx(SheetClose, { "aria-label": "Close block settings" })
|
|
577
|
+
] }),
|
|
578
|
+
insertPosition ? /* @__PURE__ */ jsx(SheetBody, { children: /* @__PURE__ */ jsx(
|
|
579
|
+
ListFieldTypeCommand,
|
|
580
|
+
{
|
|
581
|
+
items,
|
|
582
|
+
label: `Insert ${insertPosition}`,
|
|
583
|
+
pasted,
|
|
584
|
+
pasteLabel: pasted ? pasteBlockLabel(pasted, items) : void 0,
|
|
585
|
+
onPaste: (row) => insert(insertPosition, cloneRow(row)),
|
|
586
|
+
onSelect: (item) => insert(insertPosition, createRow(item.id, item.type))
|
|
587
|
+
}
|
|
588
|
+
) }) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
589
|
+
/* @__PURE__ */ jsx(SheetBody, { children: /* @__PURE__ */ jsxs(SheetSection, { children: [
|
|
590
|
+
/* @__PURE__ */ jsx(
|
|
591
|
+
TextField,
|
|
592
|
+
{
|
|
593
|
+
label: "Label",
|
|
594
|
+
disabled: readOnly,
|
|
595
|
+
onValueChange: onCustomLabelChange,
|
|
596
|
+
value: customLabel
|
|
597
|
+
}
|
|
598
|
+
),
|
|
599
|
+
/* @__PURE__ */ jsxs("div", { className: styles.ListFieldRowSheet.anchor(), children: [
|
|
600
|
+
/* @__PURE__ */ jsx("div", { className: styles.ListFieldRowSheet.anchor.field(), children: /* @__PURE__ */ jsx(
|
|
601
|
+
SlugField,
|
|
602
|
+
{
|
|
603
|
+
fieldValue: anchor,
|
|
604
|
+
label: "Anchor",
|
|
605
|
+
isDisabled: readOnly,
|
|
606
|
+
onChange: onAnchorChange,
|
|
607
|
+
source: customLabel
|
|
608
|
+
}
|
|
609
|
+
) }),
|
|
610
|
+
link && /* @__PURE__ */ jsxs(Tooltip, { children: [
|
|
512
611
|
/* @__PURE__ */ jsx(
|
|
513
|
-
|
|
612
|
+
TooltipTrigger,
|
|
514
613
|
{
|
|
515
614
|
variant: "ghost",
|
|
516
|
-
"
|
|
517
|
-
icon:
|
|
518
|
-
|
|
615
|
+
size: "icon",
|
|
616
|
+
icon: IcRoundLink,
|
|
617
|
+
"aria-label": "Copy link to block",
|
|
618
|
+
onClick: () => navigator.clipboard.writeText(link)
|
|
519
619
|
}
|
|
520
620
|
),
|
|
521
|
-
/* @__PURE__ */ jsx(
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
!isFirstRow && /* @__PURE__ */ jsx(
|
|
585
|
-
Button,
|
|
586
|
-
{
|
|
587
|
-
variant: "ghost",
|
|
588
|
-
icon: IcRoundArrowUpward,
|
|
589
|
-
onClick: () => {
|
|
590
|
-
onMoveUp?.();
|
|
591
|
-
closeActions();
|
|
592
|
-
},
|
|
593
|
-
children: "Move up"
|
|
594
|
-
}
|
|
595
|
-
),
|
|
596
|
-
!isLastRow && /* @__PURE__ */ jsx(
|
|
597
|
-
Button,
|
|
598
|
-
{
|
|
599
|
-
variant: "ghost",
|
|
600
|
-
icon: IcRoundArrowDownward,
|
|
601
|
-
onClick: () => {
|
|
602
|
-
onMoveDown?.();
|
|
603
|
-
closeActions();
|
|
604
|
-
},
|
|
605
|
-
children: "Move down"
|
|
606
|
-
}
|
|
607
|
-
),
|
|
608
|
-
canInsert && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
609
|
-
/* @__PURE__ */ jsx(
|
|
610
|
-
ListFieldInsertAction,
|
|
611
|
-
{
|
|
612
|
-
icon: IcRoundFirstPage,
|
|
613
|
-
isDisabled: Boolean(readOnly || isPreview),
|
|
614
|
-
items: insertItems,
|
|
615
|
-
label: "Insert before",
|
|
616
|
-
pasted,
|
|
617
|
-
onClose: closeActions,
|
|
618
|
-
onOpenPicker: () => setInsertPosition("before"),
|
|
619
|
-
onSelect: (item) => onInsertBefore(createRow(item.id, item.type))
|
|
620
|
-
}
|
|
621
|
-
),
|
|
622
|
-
/* @__PURE__ */ jsx(
|
|
623
|
-
ListFieldInsertAction,
|
|
624
|
-
{
|
|
625
|
-
icon: IcRoundLastPage,
|
|
626
|
-
isDisabled: Boolean(readOnly || isPreview),
|
|
627
|
-
items: insertItems,
|
|
628
|
-
label: "Insert after",
|
|
629
|
-
pasted,
|
|
630
|
-
onClose: closeActions,
|
|
631
|
-
onOpenPicker: () => setInsertPosition("after"),
|
|
632
|
-
onSelect: (item) => onInsertAfter(createRow(item.id, item.type))
|
|
633
|
-
}
|
|
634
|
-
)
|
|
635
|
-
] })
|
|
636
|
-
] })
|
|
637
|
-
] })
|
|
638
|
-
}
|
|
639
|
-
)
|
|
640
|
-
]
|
|
641
|
-
}
|
|
642
|
-
),
|
|
643
|
-
/* @__PURE__ */ jsx(
|
|
621
|
+
/* @__PURE__ */ jsx(TooltipContent, { children: "Copy link to block" })
|
|
622
|
+
] })
|
|
623
|
+
] })
|
|
624
|
+
] }) }),
|
|
625
|
+
/* @__PURE__ */ jsxs(SheetFooter, { children: [
|
|
626
|
+
/* @__PURE__ */ jsx(
|
|
627
|
+
Button,
|
|
628
|
+
{
|
|
629
|
+
variant: "ghost",
|
|
630
|
+
size: "sm",
|
|
631
|
+
icon: IcRoundFirstPage,
|
|
632
|
+
disabled: readOnly || !canInsert,
|
|
633
|
+
onClick: () => startInsert("before"),
|
|
634
|
+
children: "Insert before"
|
|
635
|
+
}
|
|
636
|
+
),
|
|
637
|
+
/* @__PURE__ */ jsx(
|
|
638
|
+
Button,
|
|
639
|
+
{
|
|
640
|
+
variant: "ghost",
|
|
641
|
+
size: "sm",
|
|
642
|
+
icon: IcRoundLastPage,
|
|
643
|
+
disabled: readOnly || !canInsert,
|
|
644
|
+
onClick: () => startInsert("after"),
|
|
645
|
+
children: "Insert after"
|
|
646
|
+
}
|
|
647
|
+
)
|
|
648
|
+
] }),
|
|
649
|
+
/* @__PURE__ */ jsxs(SheetFooter, { children: [
|
|
650
|
+
/* @__PURE__ */ jsx(
|
|
651
|
+
Button,
|
|
652
|
+
{
|
|
653
|
+
variant: "ghost",
|
|
654
|
+
size: "sm",
|
|
655
|
+
icon: IcBaselineContentCopy,
|
|
656
|
+
onClick: copy,
|
|
657
|
+
children: "Copy"
|
|
658
|
+
}
|
|
659
|
+
),
|
|
660
|
+
/* @__PURE__ */ jsx(
|
|
661
|
+
Button,
|
|
662
|
+
{
|
|
663
|
+
variant: "ghost",
|
|
664
|
+
size: "sm",
|
|
665
|
+
icon: IcRoundArrowUpward,
|
|
666
|
+
disabled: readOnly || isFirstRow,
|
|
667
|
+
onClick: onMoveUp,
|
|
668
|
+
children: "Move up"
|
|
669
|
+
}
|
|
670
|
+
),
|
|
671
|
+
/* @__PURE__ */ jsx(
|
|
672
|
+
Button,
|
|
673
|
+
{
|
|
674
|
+
variant: "ghost",
|
|
675
|
+
size: "sm",
|
|
676
|
+
icon: IcRoundArrowDownward,
|
|
677
|
+
disabled: readOnly || isLastRow,
|
|
678
|
+
onClick: onMoveDown,
|
|
679
|
+
children: "Move down"
|
|
680
|
+
}
|
|
681
|
+
)
|
|
682
|
+
] }),
|
|
683
|
+
/* @__PURE__ */ jsx(SheetFooter, { children: /* @__PURE__ */ jsx(
|
|
644
684
|
Button,
|
|
645
685
|
{
|
|
646
686
|
variant: "ghost",
|
|
647
|
-
"
|
|
648
|
-
|
|
649
|
-
|
|
687
|
+
size: "sm",
|
|
688
|
+
color: "destructive",
|
|
689
|
+
icon: IcRoundDelete,
|
|
690
|
+
disabled: readOnly,
|
|
650
691
|
onClick: onDelete,
|
|
651
|
-
|
|
692
|
+
children: "Delete"
|
|
652
693
|
}
|
|
653
|
-
)
|
|
694
|
+
) })
|
|
654
695
|
] })
|
|
655
696
|
] });
|
|
656
697
|
}
|
|
@@ -774,6 +815,7 @@ function useListFieldPickerItems(items, pasted, pasteLabel, onPaste) {
|
|
|
774
815
|
}, [items, onPaste, pasteLabel, pasted]);
|
|
775
816
|
}
|
|
776
817
|
export {
|
|
818
|
+
ListFieldTypeCommand,
|
|
777
819
|
ListFieldView,
|
|
778
820
|
insertIndex,
|
|
779
821
|
reorderIndex
|