alinea 2.0.0-preview.11 → 2.0.0-preview.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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 +687 -248
- package/dist/chunks/{bun-sqlite-5SHXN3AT.js → bun-sqlite-RI6BYU5S.js} +3 -3
- package/dist/chunks/{chunk-YCQR5GRT.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/generate/GenerateDashboard.js +17 -5
- package/dist/cli/serve/mcp/DevMcp.js +1 -1
- package/dist/cli/serve/mcp/McpTools.js +29 -1
- package/dist/cli/static/dashboard/entry.js +2 -1
- package/dist/cloud/CloudRemote.js +1 -1
- package/dist/components/Alert.js +3 -3
- 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 +6 -6
- package/dist/components/Button.d.ts +6 -1
- package/dist/components/Button.js +14 -5
- package/dist/components/Calendar.js +20 -20
- package/dist/components/Checkbox.js +9 -9
- package/dist/components/CheckboxGroup.js +4 -4
- 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 +10 -9
- package/dist/components/ContentCard.d.ts +3 -1
- package/dist/components/ContentCard.js +39 -17
- package/dist/components/ContentGrid.js +15 -15
- 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 +6 -6
- package/dist/components/DropZone.js +4 -4
- package/dist/components/DropdownMenu.js +10 -10
- package/dist/components/Empty.js +4 -4
- package/dist/components/Field.js +8 -8
- package/dist/components/List.js +23 -23
- package/dist/components/MediaPreview.js +5 -5
- package/dist/components/MultipleSelect.js +20 -20
- package/dist/components/NavRail.js +4 -4
- package/dist/components/NumberField.js +5 -5
- package/dist/components/Page.js +5 -5
- package/dist/components/Popover.js +2 -2
- package/dist/components/PreviewFrame.js +5 -5
- package/dist/components/RadioGroup.js +6 -6
- package/dist/components/Resizable.js +5 -5
- package/dist/components/SearchField.d.ts +6 -1
- package/dist/components/SearchField.js +7 -5
- package/dist/components/Select.js +14 -14
- 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 +162 -265
- package/dist/components/Spinner.js +1 -1
- package/dist/components/Surface.js +2 -2
- package/dist/components/Switch.js +7 -7
- package/dist/components/Table.d.ts +3 -1
- package/dist/components/Table.js +53 -42
- package/dist/components/Tabs.js +5 -5
- package/dist/components/TagGroup.js +9 -9
- package/dist/components/TextField.js +10 -10
- package/dist/components/TimeField.js +8 -8
- package/dist/components/Timestamp.js +1 -1
- package/dist/components/ToggleGroup.js +2 -2
- package/dist/components/Toolbar.js +4 -4
- package/dist/components/Tooltip.js +5 -5
- package/dist/components/Tree.js +29 -29
- package/dist/components/internal/DateControl.js +10 -10
- package/dist/components/internal/ListBoxOption.js +13 -13
- package/dist/components/internal/Locale.js +2 -2
- package/dist/components/internal/PopoverSurface.js +2 -2
- package/dist/components/internal/SelectionCheckbox.js +6 -6
- 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 +11 -11
- 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 +15 -15
- package/dist/dashboard/app/CroppedImage.js +2 -2
- package/dist/dashboard/app/DashboardErrorBoundary.js +3 -3
- package/dist/dashboard/app/DashboardLayout.js +3 -1
- package/dist/dashboard/app/EntryHeader.js +32 -33
- package/dist/dashboard/app/EntryReferences.js +5 -5
- package/dist/dashboard/app/EntrySidebar.js +8 -8
- package/dist/dashboard/app/EntrySidebarPreview.js +4 -4
- 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 +18 -18
- package/dist/dashboard/app/Explorer.d.ts +3 -1
- package/dist/dashboard/app/Explorer.js +51 -47
- 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 +1 -1
- package/dist/dashboard/app/ExplorerTable.js +14 -11
- package/dist/dashboard/app/ImageEditor.js +25 -25
- package/dist/dashboard/app/ImagePicker.js +3 -13
- package/dist/dashboard/app/LinkPicker.js +29 -27
- package/dist/dashboard/app/LocaleMenu.js +7 -7
- package/dist/dashboard/app/MediaPreviewCell.js +2 -2
- 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/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 +29 -74
- package/dist/dashboard/app/WorkspaceMenu.js +8 -8
- package/dist/dashboard/app/WorkspaceRoots.js +11 -11
- package/dist/dashboard/app/editor/FileEditor.js +16 -16
- package/dist/dashboard/app/modals/CreateEntry.js +5 -5
- package/dist/dashboard/app/pages/EntryPage.d.ts +2 -1
- package/dist/dashboard/app/pages/EntryPage.js +35 -16
- package/dist/dashboard/app/pages/SplashPage.js +35 -35
- package/dist/dashboard/app/pages/UsersPage.js +14 -14
- package/dist/dashboard/app/ui/DashboardModal.js +17 -16
- 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/BootProd.d.ts +6 -1
- package/dist/dashboard/boot/BootProd.js +2 -2
- package/dist/dashboard/boot/DashboardWorker.d.ts +1 -0
- package/dist/dashboard/boot/DashboardWorker.js +18 -18
- package/dist/dashboard/boot/LoadWorker.js +17 -10
- package/dist/dashboard/cms/EntryTable.js +6 -3
- package/dist/database/BrowserEntryStore.d.ts +17 -29
- package/dist/database/BrowserEntryStore.js +116 -144
- 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/check/CheckField.view.js +2 -2
- package/dist/field/code/CodeField.view.js +14 -14
- 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 +246 -372
- 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 +27 -23
- package/dist/field/richtext/RichTextBlock.d.ts +3 -1
- package/dist/field/richtext/RichTextBlock.js +178 -75
- package/dist/field/richtext/RichTextBlockHost.js +1 -1
- package/dist/field/richtext/RichTextExtensions.js +35 -35
- 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,12 +1,3 @@
|
|
|
1
|
-
import "../chunks/chunk-NUFRM6SI.js";
|
|
2
|
-
import {
|
|
3
|
-
$5d3a17cc2564e64f$export$905ab40ac2179daa,
|
|
4
|
-
$74812c42150b3de8$export$7941f8aafa4b6021,
|
|
5
|
-
$bbaa08b3cd72f041$export$9d1611c77c2fe928,
|
|
6
|
-
$f302ef02e940a6f8$export$ccdee5eaf73cf661
|
|
7
|
-
} from "../chunks/chunk-RE523BQ7.js";
|
|
8
|
-
import "../chunks/chunk-RKDPDEF7.js";
|
|
9
|
-
import "../chunks/chunk-PSSMQKAH.js";
|
|
10
1
|
import {
|
|
11
2
|
dist_default
|
|
12
3
|
} from "../chunks/chunk-I4OYYAX5.js";
|
|
@@ -17,314 +8,246 @@ import {
|
|
|
17
8
|
createContext,
|
|
18
9
|
useContext,
|
|
19
10
|
useMemo,
|
|
20
|
-
useRef
|
|
21
|
-
useState
|
|
11
|
+
useRef
|
|
22
12
|
} from "react";
|
|
13
|
+
import { flushSync } from "react-dom";
|
|
14
|
+
import {
|
|
15
|
+
IcRoundAdd,
|
|
16
|
+
IcRoundMoreHoriz,
|
|
17
|
+
IcRoundUnfoldLess,
|
|
18
|
+
IcRoundUnfoldMore
|
|
19
|
+
} from "alinea/dashboard/icons";
|
|
23
20
|
import { Button } from "./Button.js";
|
|
24
|
-
import { FoldIcon } from "./FoldIcon.js";
|
|
25
21
|
import { Icon } from "./Icon.js";
|
|
22
|
+
import { pressSortableItem } from "./internal/sortableDrag.js";
|
|
26
23
|
|
|
27
24
|
// src/components/SortableList.module.css
|
|
28
25
|
var SortableList_default = {
|
|
29
|
-
"
|
|
30
|
-
"
|
|
31
|
-
"
|
|
32
|
-
"
|
|
33
|
-
"
|
|
34
|
-
"
|
|
35
|
-
"SortableListDragPreviewTitle": "alinea-SortableListDragPreview-title",
|
|
36
|
-
"SortableListItem": "alinea-SortableListItem",
|
|
26
|
+
"SortableListAdd-inner": "alinea-SortableListAdd-inner",
|
|
27
|
+
"SortableListAddInner": "alinea-SortableListAdd-inner",
|
|
28
|
+
"SortableListItemContent": "alinea-SortableListItemContent",
|
|
29
|
+
"SortableListItemTrigger": "alinea-SortableListItemTrigger",
|
|
30
|
+
"SortableListItemTrigger-more": "alinea-SortableListItemTrigger-more",
|
|
31
|
+
"SortableListItemTriggerMore": "alinea-SortableListItemTrigger-more",
|
|
37
32
|
"SortableListItemActions": "alinea-SortableListItemActions",
|
|
38
|
-
"SortableListDragPreview": "alinea-SortableListDragPreview",
|
|
39
33
|
"SortableListItemHeader": "alinea-SortableListItemHeader",
|
|
40
|
-
"
|
|
41
|
-
"SortableListDragPreview-icon": "alinea-SortableListDragPreview-icon",
|
|
42
|
-
"SortableListDragPreviewIcon": "alinea-SortableListDragPreview-icon",
|
|
43
|
-
"SortableListItem-dropTarget": "alinea-SortableListItem-dropTarget",
|
|
44
|
-
"SortableListItemDropTarget": "alinea-SortableListItem-dropTarget",
|
|
34
|
+
"SortableListItemSettings": "alinea-SortableListItemSettings",
|
|
45
35
|
"SortableListItemToggle": "alinea-SortableListItemToggle",
|
|
36
|
+
"SortableListItemTitle": "alinea-SortableListItemTitle",
|
|
37
|
+
"SortableListItemInsert-button": "alinea-SortableListItemInsert-button",
|
|
38
|
+
"SortableListItemInsertButton": "alinea-SortableListItemInsert-button",
|
|
39
|
+
"SortableListItemFooter": "alinea-SortableListItemFooter",
|
|
40
|
+
"SortableListItemInsert": "alinea-SortableListItemInsert",
|
|
41
|
+
"SortableListItem": "alinea-SortableListItem",
|
|
46
42
|
"SortableListAdd": "alinea-SortableListAdd",
|
|
47
|
-
"
|
|
48
|
-
"
|
|
49
|
-
"SortableListAdd-inner": "alinea-SortableListAdd-inner",
|
|
50
|
-
"SortableListAddInner": "alinea-SortableListAdd-inner",
|
|
51
|
-
"SortableListItemToggle-icon": "alinea-SortableListItemToggle-icon",
|
|
52
|
-
"SortableListItemToggleIcon": "alinea-SortableListItemToggle-icon",
|
|
53
|
-
"SortableListDragPreview-body": "alinea-SortableListDragPreview-body",
|
|
54
|
-
"SortableListDragPreviewBody": "alinea-SortableListDragPreview-body"
|
|
43
|
+
"SortableListItemDescription": "alinea-SortableListItemDescription",
|
|
44
|
+
"SortableList": "alinea-SortableList"
|
|
55
45
|
};
|
|
56
46
|
|
|
57
47
|
// src/components/SortableList.tsx
|
|
58
|
-
import {
|
|
59
|
-
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
48
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
60
49
|
var styles = dist_default(SortableList_default);
|
|
61
|
-
var DEFAULT_DRAG_TYPE = "alinea/sortable-list-item";
|
|
62
50
|
var SortableListContext = createContext(null);
|
|
63
51
|
var SortableListItemContext = createContext(null);
|
|
64
52
|
function SortableList({
|
|
65
53
|
className,
|
|
66
54
|
role = "list",
|
|
67
55
|
onReorder,
|
|
68
|
-
dragType = DEFAULT_DRAG_TYPE,
|
|
69
56
|
...props
|
|
70
57
|
}) {
|
|
71
|
-
const
|
|
72
|
-
const
|
|
73
|
-
const pointerDrag = useRef(false);
|
|
74
|
-
const source = useRef(null);
|
|
75
|
-
const dragged = useRef(null);
|
|
58
|
+
const ref = useRef(null);
|
|
59
|
+
const keys = useRef(/* @__PURE__ */ new Map());
|
|
76
60
|
const reorderRef = useRef(onReorder);
|
|
77
61
|
reorderRef.current = onReorder;
|
|
78
62
|
const reorderable = Boolean(onReorder);
|
|
79
63
|
const context = useMemo(() => {
|
|
64
|
+
if (!reorderable) return null;
|
|
65
|
+
function items() {
|
|
66
|
+
const list = ref.current;
|
|
67
|
+
if (!list) return [];
|
|
68
|
+
return Array.from(list.children).filter(
|
|
69
|
+
(child) => child instanceof HTMLElement && keys.current.has(child)
|
|
70
|
+
);
|
|
71
|
+
}
|
|
72
|
+
function element(key) {
|
|
73
|
+
for (const [element2, current] of keys.current)
|
|
74
|
+
if (current === key) return element2;
|
|
75
|
+
}
|
|
76
|
+
function move(item, target, position) {
|
|
77
|
+
const key = keys.current.get(item);
|
|
78
|
+
const targetKey = keys.current.get(target);
|
|
79
|
+
if (key === void 0 || targetKey === void 0) return;
|
|
80
|
+
flushSync(
|
|
81
|
+
() => reorderRef.current?.({
|
|
82
|
+
keys: /* @__PURE__ */ new Set([key]),
|
|
83
|
+
target: { key: targetKey, position }
|
|
84
|
+
})
|
|
85
|
+
);
|
|
86
|
+
}
|
|
80
87
|
return {
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
pointerDrag,
|
|
86
|
-
source,
|
|
87
|
-
startDrag(key, item, pointer) {
|
|
88
|
-
dragged.current = key;
|
|
89
|
-
source.current = item;
|
|
90
|
-
pointerDrag.current = pointer;
|
|
91
|
-
setDraggingKey(key);
|
|
92
|
-
},
|
|
93
|
-
endDrag() {
|
|
94
|
-
dragged.current = null;
|
|
95
|
-
source.current = null;
|
|
96
|
-
pointerDrag.current = false;
|
|
97
|
-
setDraggingKey(null);
|
|
98
|
-
setDropTargetState(null);
|
|
88
|
+
register(key, element2) {
|
|
89
|
+
for (const [current, value] of keys.current)
|
|
90
|
+
if (value === key) keys.current.delete(current);
|
|
91
|
+
if (element2) keys.current.set(element2, key);
|
|
99
92
|
},
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
93
|
+
press(key, event) {
|
|
94
|
+
const list = ref.current;
|
|
95
|
+
const item = element(key);
|
|
96
|
+
if (!list || !item) return;
|
|
97
|
+
pressSortableItem({
|
|
98
|
+
event: event.nativeEvent,
|
|
99
|
+
list,
|
|
100
|
+
item,
|
|
101
|
+
items,
|
|
102
|
+
onDrop: move
|
|
104
103
|
});
|
|
105
104
|
},
|
|
106
|
-
|
|
107
|
-
const
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
105
|
+
step(key, direction) {
|
|
106
|
+
const item = element(key);
|
|
107
|
+
if (!item) return false;
|
|
108
|
+
const elements = items();
|
|
109
|
+
const from = elements.indexOf(item);
|
|
110
|
+
const to = from + direction;
|
|
111
|
+
if (from === -1 || to < 0 || to >= elements.length) return false;
|
|
112
|
+
const focused = document.activeElement;
|
|
113
|
+
move(item, elements[to], direction > 0 ? "after" : "before");
|
|
114
|
+
if (focused instanceof HTMLElement && focused !== document.activeElement)
|
|
115
|
+
focused.focus();
|
|
116
|
+
return true;
|
|
111
117
|
}
|
|
112
118
|
};
|
|
113
|
-
}, [reorderable
|
|
119
|
+
}, [reorderable]);
|
|
114
120
|
return /* @__PURE__ */ jsx(SortableListContext.Provider, { value: context, children: /* @__PURE__ */ jsx(
|
|
115
|
-
|
|
121
|
+
"div",
|
|
116
122
|
{
|
|
117
123
|
"data-slot": "sortable-list",
|
|
118
124
|
...props,
|
|
119
|
-
className,
|
|
125
|
+
className: styles.SortableList(dist_default.merge({ className })),
|
|
126
|
+
"data-reorderable": reorderable || void 0,
|
|
127
|
+
ref,
|
|
120
128
|
role
|
|
121
129
|
}
|
|
122
130
|
) });
|
|
123
131
|
}
|
|
124
132
|
function SortableListItem({
|
|
125
133
|
id,
|
|
126
|
-
dragPreview,
|
|
127
|
-
...props
|
|
128
|
-
}) {
|
|
129
|
-
const list = useContext(SortableListContext);
|
|
130
|
-
if (list && id !== void 0)
|
|
131
|
-
return /* @__PURE__ */ jsx(
|
|
132
|
-
ReorderableItem,
|
|
133
|
-
{
|
|
134
|
-
...props,
|
|
135
|
-
dragPreview,
|
|
136
|
-
id,
|
|
137
|
-
list
|
|
138
|
-
}
|
|
139
|
-
);
|
|
140
|
-
return /* @__PURE__ */ jsx(SortableListItemContext.Provider, { value: null, children: /* @__PURE__ */ jsx(SortableListItemElement, { ...props }) });
|
|
141
|
-
}
|
|
142
|
-
function SortableListItemElement({
|
|
143
134
|
className,
|
|
144
|
-
|
|
135
|
+
current,
|
|
145
136
|
...props
|
|
146
137
|
}) {
|
|
147
|
-
|
|
138
|
+
const list = useContext(SortableListContext);
|
|
139
|
+
const key = list && id !== void 0 ? id : null;
|
|
140
|
+
return /* @__PURE__ */ jsx(SortableListItemContext.Provider, { value: key, children: /* @__PURE__ */ jsx(
|
|
148
141
|
"div",
|
|
149
142
|
{
|
|
150
143
|
"data-slot": "sortable-list-item",
|
|
151
144
|
role: "listitem",
|
|
152
145
|
...props,
|
|
146
|
+
"aria-current": current || void 0,
|
|
147
|
+
"aria-keyshortcuts": key === null ? void 0 : "Alt+ArrowUp Alt+ArrowDown",
|
|
153
148
|
className: styles.SortableListItem(dist_default.merge({ className })),
|
|
154
|
-
|
|
149
|
+
ref: key === null ? void 0 : (element) => list?.register(key, element)
|
|
155
150
|
}
|
|
156
|
-
);
|
|
151
|
+
) });
|
|
157
152
|
}
|
|
158
|
-
function
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
153
|
+
function SortableListItemHeader({
|
|
154
|
+
className,
|
|
155
|
+
onPointerDownCapture,
|
|
156
|
+
onKeyDown,
|
|
157
|
+
onDragStart,
|
|
163
158
|
...props
|
|
164
159
|
}) {
|
|
165
|
-
const
|
|
166
|
-
const
|
|
167
|
-
|
|
168
|
-
const nativeDrag = useRef(false);
|
|
169
|
-
const { reorderable, dragType, draggingKey, dropTarget } = list;
|
|
170
|
-
const { dragProps, isDragging } = $74812c42150b3de8$export$7941f8aafa4b6021({
|
|
171
|
-
isDisabled: !reorderable,
|
|
172
|
-
getItems() {
|
|
173
|
-
return [{ "text/plain": String(id), [dragType]: String(id) }];
|
|
174
|
-
},
|
|
175
|
-
getAllowedDropOperations() {
|
|
176
|
-
return ["move"];
|
|
177
|
-
},
|
|
178
|
-
onDragStart() {
|
|
179
|
-
list.startDrag(id, ref.current, nativeDrag.current);
|
|
180
|
-
},
|
|
181
|
-
onDragEnd() {
|
|
182
|
-
const keyboard = !nativeDrag.current;
|
|
183
|
-
nativeDrag.current = false;
|
|
184
|
-
list.endDrag();
|
|
185
|
-
if (keyboard)
|
|
186
|
-
requestAnimationFrame(() => {
|
|
187
|
-
if (handle.current?.isConnected) handle.current.focus();
|
|
188
|
-
});
|
|
189
|
-
},
|
|
190
|
-
preview: dragPreview ? preview : void 0
|
|
191
|
-
});
|
|
192
|
-
const handleDragProps = useMemo(
|
|
193
|
-
() => ({
|
|
194
|
-
...dragProps,
|
|
195
|
-
onDragStart(event) {
|
|
196
|
-
nativeDrag.current = true;
|
|
197
|
-
dragProps.onDragStart?.(event);
|
|
198
|
-
}
|
|
199
|
-
}),
|
|
200
|
-
[dragProps]
|
|
201
|
-
);
|
|
202
|
-
function dropPosition(y) {
|
|
203
|
-
const item = ref.current;
|
|
204
|
-
if (!item) return "after";
|
|
205
|
-
if (!list.pointerDrag.current) {
|
|
206
|
-
const source = list.source.current;
|
|
207
|
-
if (!source || source === item) return "after";
|
|
208
|
-
const sourceFollows = item.compareDocumentPosition(source) & Node.DOCUMENT_POSITION_FOLLOWING;
|
|
209
|
-
return sourceFollows ? "before" : "after";
|
|
210
|
-
}
|
|
211
|
-
return y < item.offsetHeight / 2 ? "before" : "after";
|
|
212
|
-
}
|
|
213
|
-
function acceptDrop(types, allowedOperations) {
|
|
214
|
-
return types.has(dragType) && allowedOperations.includes("move") ? "move" : "cancel";
|
|
215
|
-
}
|
|
216
|
-
const { dropProps } = $f302ef02e940a6f8$export$ccdee5eaf73cf661({
|
|
217
|
-
ref,
|
|
218
|
-
isDisabled: draggingKey === null,
|
|
219
|
-
getDropOperation: acceptDrop,
|
|
220
|
-
getDropOperationForPoint: acceptDrop,
|
|
221
|
-
onDropEnter(event) {
|
|
222
|
-
list.setDropTarget({ key: id, position: dropPosition(event.y) });
|
|
223
|
-
},
|
|
224
|
-
onDropMove(event) {
|
|
225
|
-
list.setDropTarget({ key: id, position: dropPosition(event.y) });
|
|
226
|
-
},
|
|
227
|
-
onDropExit() {
|
|
228
|
-
list.setDropTarget({ key: id, position: "after" }, true);
|
|
229
|
-
},
|
|
230
|
-
onDrop(event) {
|
|
231
|
-
list.drop({ key: id, position: dropPosition(event.y) });
|
|
232
|
-
}
|
|
233
|
-
});
|
|
234
|
-
const active = dropTarget?.key === id ? dropTarget.position : void 0;
|
|
235
|
-
const itemContext = useMemo(
|
|
236
|
-
() => reorderable ? { dragProps: handleDragProps, dragging: isDragging, handle } : null,
|
|
237
|
-
[reorderable, handleDragProps, isDragging]
|
|
238
|
-
);
|
|
239
|
-
return /* @__PURE__ */ jsx(SortableListItemContext.Provider, { value: itemContext, children: /* @__PURE__ */ jsxs(
|
|
160
|
+
const list = useContext(SortableListContext);
|
|
161
|
+
const key = useContext(SortableListItemContext);
|
|
162
|
+
return /* @__PURE__ */ jsx(
|
|
240
163
|
"div",
|
|
241
164
|
{
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
]
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
className: styles.SortableListItem.dropIndicator(),
|
|
267
|
-
"data-active": active === "after" || void 0,
|
|
268
|
-
"data-position": "after",
|
|
269
|
-
"data-slot": "sortable-list-drop-indicator"
|
|
270
|
-
}
|
|
271
|
-
)
|
|
272
|
-
]
|
|
165
|
+
"data-slot": "sortable-list-item-header",
|
|
166
|
+
...props,
|
|
167
|
+
className: styles.SortableListItemHeader(dist_default.merge({ className })),
|
|
168
|
+
"data-reorderable": list !== null && key !== null || void 0,
|
|
169
|
+
onPointerDownCapture: (event) => {
|
|
170
|
+
onPointerDownCapture?.(event);
|
|
171
|
+
if (!list || key === null) return;
|
|
172
|
+
if (event.button !== 0 || event.pointerType === "touch") return;
|
|
173
|
+
const target = event.target;
|
|
174
|
+
if (target.closest('[aria-haspopup="menu"], [aria-haspopup="listbox"]'))
|
|
175
|
+
return;
|
|
176
|
+
list.press(key, event);
|
|
177
|
+
},
|
|
178
|
+
onKeyDown: (event) => {
|
|
179
|
+
onKeyDown?.(event);
|
|
180
|
+
if (!list || key === null || event.defaultPrevented) return;
|
|
181
|
+
if (!event.altKey) return;
|
|
182
|
+
const direction = event.key === "ArrowUp" ? -1 : event.key === "ArrowDown" ? 1 : 0;
|
|
183
|
+
if (direction && list.step(key, direction)) event.preventDefault();
|
|
184
|
+
},
|
|
185
|
+
onDragStart: (event) => {
|
|
186
|
+
onDragStart?.(event);
|
|
187
|
+
if (list && key !== null) event.preventDefault();
|
|
188
|
+
}
|
|
273
189
|
}
|
|
274
|
-
)
|
|
190
|
+
);
|
|
275
191
|
}
|
|
276
|
-
function
|
|
192
|
+
function SortableListItemTitle({
|
|
277
193
|
className,
|
|
278
194
|
...props
|
|
279
195
|
}) {
|
|
280
196
|
return /* @__PURE__ */ jsx(
|
|
281
197
|
"div",
|
|
282
198
|
{
|
|
283
|
-
"data-slot": "sortable-list-item-
|
|
199
|
+
"data-slot": "sortable-list-item-title",
|
|
284
200
|
...props,
|
|
285
|
-
className: styles.
|
|
201
|
+
className: styles.SortableListItemTitle(dist_default.merge({ className }))
|
|
286
202
|
}
|
|
287
203
|
);
|
|
288
204
|
}
|
|
289
|
-
function
|
|
205
|
+
function SortableListItemTrigger({
|
|
290
206
|
className,
|
|
207
|
+
more = true,
|
|
208
|
+
children,
|
|
291
209
|
...props
|
|
292
210
|
}) {
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
return /* @__PURE__ */ jsx(
|
|
296
|
-
"span",
|
|
297
|
-
{
|
|
298
|
-
"data-slot": "sortable-list-handle",
|
|
299
|
-
...props,
|
|
300
|
-
className: styles.SortableListHandle(dist_default.merge({ className }))
|
|
301
|
-
}
|
|
302
|
-
);
|
|
303
|
-
return /* @__PURE__ */ jsx(
|
|
304
|
-
"span",
|
|
211
|
+
return /* @__PURE__ */ jsxs(
|
|
212
|
+
Button,
|
|
305
213
|
{
|
|
306
|
-
"data-slot": "sortable-list-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
214
|
+
"data-slot": "sortable-list-item-trigger",
|
|
215
|
+
...props,
|
|
216
|
+
variant: "ghost",
|
|
217
|
+
className: styles.SortableListItemTrigger(dist_default.merge({ className })),
|
|
218
|
+
children: [
|
|
219
|
+
children,
|
|
220
|
+
more && /* @__PURE__ */ jsx(
|
|
221
|
+
"span",
|
|
222
|
+
{
|
|
223
|
+
"data-slot": "sortable-list-item-more",
|
|
224
|
+
className: styles.SortableListItemTrigger.more(),
|
|
225
|
+
children: /* @__PURE__ */ jsx(Icon, { "aria-hidden": true, icon: IcRoundMoreHoriz })
|
|
226
|
+
}
|
|
227
|
+
)
|
|
228
|
+
]
|
|
313
229
|
}
|
|
314
230
|
);
|
|
315
231
|
}
|
|
316
|
-
function
|
|
232
|
+
function SortableListItemInsert({
|
|
317
233
|
className,
|
|
318
234
|
...props
|
|
319
235
|
}) {
|
|
320
|
-
const item = useContext(SortableListItemContext);
|
|
321
236
|
return /* @__PURE__ */ jsx(
|
|
322
237
|
"div",
|
|
323
238
|
{
|
|
324
|
-
"data-slot": "sortable-list-item-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
239
|
+
"data-slot": "sortable-list-item-insert",
|
|
240
|
+
className: styles.SortableListItemInsert(dist_default.merge({ className })),
|
|
241
|
+
children: /* @__PURE__ */ jsx(
|
|
242
|
+
"button",
|
|
243
|
+
{
|
|
244
|
+
type: "button",
|
|
245
|
+
"data-slot": "sortable-list-item-insert-button",
|
|
246
|
+
...props,
|
|
247
|
+
className: styles.SortableListItemInsert.button(),
|
|
248
|
+
children: /* @__PURE__ */ jsx(Icon, { "aria-hidden": true, icon: IcRoundAdd })
|
|
249
|
+
}
|
|
250
|
+
)
|
|
328
251
|
}
|
|
329
252
|
);
|
|
330
253
|
}
|
|
@@ -368,14 +291,7 @@ function SortableListItemToggle({
|
|
|
368
291
|
variant: "ghost",
|
|
369
292
|
className: styles.SortableListItemToggle(dist_default.merge({ className })),
|
|
370
293
|
size: "icon-sm",
|
|
371
|
-
|
|
372
|
-
FoldIcon,
|
|
373
|
-
{
|
|
374
|
-
"aria-hidden": true,
|
|
375
|
-
className: styles.SortableListItemToggle.icon(),
|
|
376
|
-
expanded
|
|
377
|
-
}
|
|
378
|
-
)
|
|
294
|
+
icon: expanded ? IcRoundUnfoldLess : IcRoundUnfoldMore
|
|
379
295
|
}
|
|
380
296
|
);
|
|
381
297
|
}
|
|
@@ -420,25 +336,6 @@ function SortableListItemSettings({
|
|
|
420
336
|
}
|
|
421
337
|
);
|
|
422
338
|
}
|
|
423
|
-
function SortableListDragPreview({
|
|
424
|
-
className,
|
|
425
|
-
icon,
|
|
426
|
-
label,
|
|
427
|
-
...props
|
|
428
|
-
}) {
|
|
429
|
-
return /* @__PURE__ */ jsxs(
|
|
430
|
-
"div",
|
|
431
|
-
{
|
|
432
|
-
"data-slot": "sortable-list-drag-preview",
|
|
433
|
-
...props,
|
|
434
|
-
className: styles.SortableListDragPreview(dist_default.merge({ className })),
|
|
435
|
-
children: [
|
|
436
|
-
icon && /* @__PURE__ */ jsx("div", { className: styles.SortableListDragPreview.icon(), children: /* @__PURE__ */ jsx(Icon, { "aria-hidden": true, icon }) }),
|
|
437
|
-
/* @__PURE__ */ jsx("div", { className: styles.SortableListDragPreview.body(), children: /* @__PURE__ */ jsx("strong", { className: styles.SortableListDragPreview.title(), children: label }) })
|
|
438
|
-
]
|
|
439
|
-
}
|
|
440
|
-
);
|
|
441
|
-
}
|
|
442
339
|
function SortableListAdd({
|
|
443
340
|
children,
|
|
444
341
|
className,
|
|
@@ -457,15 +354,15 @@ function SortableListAdd({
|
|
|
457
354
|
export {
|
|
458
355
|
SortableList,
|
|
459
356
|
SortableListAdd,
|
|
460
|
-
SortableListDragPreview,
|
|
461
|
-
SortableListHandle,
|
|
462
357
|
SortableListItem,
|
|
463
358
|
SortableListItemActions,
|
|
464
359
|
SortableListItemContent,
|
|
465
360
|
SortableListItemDescription,
|
|
466
361
|
SortableListItemFooter,
|
|
467
362
|
SortableListItemHeader,
|
|
363
|
+
SortableListItemInsert,
|
|
468
364
|
SortableListItemSettings,
|
|
469
365
|
SortableListItemTitle,
|
|
470
|
-
SortableListItemToggle
|
|
366
|
+
SortableListItemToggle,
|
|
367
|
+
SortableListItemTrigger
|
|
471
368
|
};
|
|
@@ -5,11 +5,11 @@ import "../chunks/chunk-CQ52GEHY.js";
|
|
|
5
5
|
|
|
6
6
|
// src/components/Spinner.module.css
|
|
7
7
|
var Spinner_default = {
|
|
8
|
+
"Spinner": "alinea-Spinner",
|
|
8
9
|
"Spinner-indicator": "alinea-Spinner-indicator",
|
|
9
10
|
"SpinnerIndicator": "alinea-Spinner-indicator",
|
|
10
11
|
"Spinner-icon": "alinea-Spinner-icon",
|
|
11
12
|
"SpinnerIcon": "alinea-Spinner-icon",
|
|
12
|
-
"Spinner": "alinea-Spinner",
|
|
13
13
|
"Spinner-spin": "alinea-Spinner-spin",
|
|
14
14
|
"SpinnerSpin": "alinea-Spinner-spin"
|
|
15
15
|
};
|
|
@@ -5,9 +5,9 @@ import "../chunks/chunk-CQ52GEHY.js";
|
|
|
5
5
|
|
|
6
6
|
// src/components/Surface.module.css
|
|
7
7
|
var Surface_default = {
|
|
8
|
-
"Surface": "alinea-Surface",
|
|
9
|
-
"SurfaceRow": "alinea-SurfaceRow",
|
|
10
8
|
"SurfaceContent": "alinea-SurfaceContent",
|
|
9
|
+
"SurfaceRow": "alinea-SurfaceRow",
|
|
10
|
+
"Surface": "alinea-Surface",
|
|
11
11
|
"SurfaceHeader": "alinea-SurfaceHeader"
|
|
12
12
|
};
|
|
13
13
|
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
2
|
$24585aa46d6ffdff$export$b5d5cf8927ab7262
|
|
3
|
-
} from "../chunks/chunk-
|
|
3
|
+
} from "../chunks/chunk-QHHMKJUO.js";
|
|
4
4
|
import "../chunks/chunk-NUFRM6SI.js";
|
|
5
|
-
import "../chunks/chunk-
|
|
5
|
+
import "../chunks/chunk-HOETF6HN.js";
|
|
6
6
|
import "../chunks/chunk-RKDPDEF7.js";
|
|
7
7
|
import "../chunks/chunk-PSSMQKAH.js";
|
|
8
8
|
import {
|
|
@@ -12,15 +12,15 @@ import "../chunks/chunk-CQ52GEHY.js";
|
|
|
12
12
|
|
|
13
13
|
// src/components/Switch.module.css
|
|
14
14
|
var Switch_default = {
|
|
15
|
-
"Switch-label": "alinea-Switch-label",
|
|
16
|
-
"SwitchLabel": "alinea-Switch-label",
|
|
17
15
|
"Switch-track": "alinea-Switch-track",
|
|
18
16
|
"SwitchTrack": "alinea-Switch-track",
|
|
19
|
-
"Switch-thumb": "alinea-Switch-thumb",
|
|
20
|
-
"SwitchThumb": "alinea-Switch-thumb",
|
|
21
17
|
"Switch": "alinea-Switch",
|
|
18
|
+
"Switch-label": "alinea-Switch-label",
|
|
19
|
+
"SwitchLabel": "alinea-Switch-label",
|
|
22
20
|
"is-focusVisible": "alinea-is-focusVisible",
|
|
23
|
-
"isFocusVisible": "alinea-is-focusVisible"
|
|
21
|
+
"isFocusVisible": "alinea-is-focusVisible",
|
|
22
|
+
"Switch-thumb": "alinea-Switch-thumb",
|
|
23
|
+
"SwitchThumb": "alinea-Switch-thumb"
|
|
24
24
|
};
|
|
25
25
|
|
|
26
26
|
// src/components/Switch.tsx
|
|
@@ -103,5 +103,7 @@ export interface TableTitleProps extends StyleProps {
|
|
|
103
103
|
title: ReactNode;
|
|
104
104
|
/** A small caption above the title, eg. the parent path */
|
|
105
105
|
label?: ReactNode;
|
|
106
|
+
/** Shown right after the title, eg. a status icon */
|
|
107
|
+
suffix?: ReactNode;
|
|
106
108
|
}
|
|
107
|
-
export declare function TableTitle({ icon, title, label, className, style }: TableTitleProps): import("react").JSX.Element;
|
|
109
|
+
export declare function TableTitle({ icon, title, label, suffix, className, style }: TableTitleProps): import("react").JSX.Element;
|