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
|
@@ -38,19 +38,20 @@ export interface MetadataOptions extends FieldOptions<Metadata> {
|
|
|
38
38
|
fields: Type<MetadataFields>;
|
|
39
39
|
seo: Type<MetadataSeoFields>;
|
|
40
40
|
details: Type<MetadataDetailsFields>;
|
|
41
|
-
/** The details are rendered by
|
|
42
|
-
|
|
41
|
+
/** The details and previews are rendered by the separate
|
|
42
|
+
* `metadataDetails` and `metadataPreviews` sections */
|
|
43
|
+
sections?: boolean;
|
|
43
44
|
}
|
|
44
45
|
export interface MetadataConfig {
|
|
45
|
-
/** Leave the details out of the field view, render them
|
|
46
|
-
* `metadataDetails(field)` instead */
|
|
47
|
-
|
|
46
|
+
/** Leave the details and previews out of the field view, render them
|
|
47
|
+
* with `metadataDetails(field)` and `metadataPreviews()` instead */
|
|
48
|
+
sections?: boolean;
|
|
48
49
|
}
|
|
49
50
|
export declare class MetadataField extends RecordField<Metadata, MetadataOptions> {
|
|
50
51
|
}
|
|
51
52
|
export interface MetadataField extends MetadataFields {
|
|
52
53
|
}
|
|
53
|
-
export declare function metadata(label?: string, {
|
|
54
|
+
export declare function metadata(label?: string, { sections }?: MetadataConfig): MetadataField;
|
|
54
55
|
export declare class MetadataDetailsSection implements SectionData {
|
|
55
56
|
field: MetadataField;
|
|
56
57
|
view: string;
|
|
@@ -60,5 +61,14 @@ export declare class MetadataDetailsSection implements SectionData {
|
|
|
60
61
|
constructor(field: MetadataField);
|
|
61
62
|
}
|
|
62
63
|
/** Renders the created/updated details and aliases of a metadata field
|
|
63
|
-
* created with `
|
|
64
|
+
* created with `sections: true` */
|
|
64
65
|
export declare function metadataDetails(field: MetadataField): Section;
|
|
66
|
+
export declare class MetadataPreviewsSection implements SectionData {
|
|
67
|
+
view: string;
|
|
68
|
+
definition: {};
|
|
69
|
+
fields: {};
|
|
70
|
+
sections: never[];
|
|
71
|
+
}
|
|
72
|
+
/** Renders the search and Open Graph previews of the entry, for a metadata
|
|
73
|
+
* field created with `sections: true` */
|
|
74
|
+
export declare function metadataPreviews(): Section;
|
|
@@ -19,7 +19,7 @@ import {
|
|
|
19
19
|
export * from "./MetadataAudit.js";
|
|
20
20
|
var MetadataField = class extends RecordField {
|
|
21
21
|
};
|
|
22
|
-
function metadata(label = "Metadata", {
|
|
22
|
+
function metadata(label = "Metadata", { sections } = {}) {
|
|
23
23
|
const seo = type("SEO", {
|
|
24
24
|
fields: {
|
|
25
25
|
title: text("Title"),
|
|
@@ -62,7 +62,7 @@ function metadata(label = "Metadata", { detailsSection } = {}) {
|
|
|
62
62
|
fields,
|
|
63
63
|
seo,
|
|
64
64
|
details,
|
|
65
|
-
|
|
65
|
+
sections
|
|
66
66
|
},
|
|
67
67
|
defaultValue() {
|
|
68
68
|
return Type.initialValue(fields);
|
|
@@ -87,10 +87,21 @@ var MetadataDetailsSection = class {
|
|
|
87
87
|
function metadataDetails(field) {
|
|
88
88
|
return section(new MetadataDetailsSection(field));
|
|
89
89
|
}
|
|
90
|
+
var MetadataPreviewsSection = class {
|
|
91
|
+
view = viewKeys.MetadataPreviewsView;
|
|
92
|
+
definition = {};
|
|
93
|
+
fields = {};
|
|
94
|
+
sections = [];
|
|
95
|
+
};
|
|
96
|
+
function metadataPreviews() {
|
|
97
|
+
return section(new MetadataPreviewsSection());
|
|
98
|
+
}
|
|
90
99
|
export {
|
|
91
100
|
MetadataDetailsSection,
|
|
92
101
|
MetadataField,
|
|
102
|
+
MetadataPreviewsSection,
|
|
93
103
|
aliases,
|
|
94
104
|
metadata,
|
|
95
|
-
metadataDetails
|
|
105
|
+
metadataDetails,
|
|
106
|
+
metadataPreviews
|
|
96
107
|
};
|
|
@@ -12,6 +12,7 @@ export interface MetadataUserFieldViewProps {
|
|
|
12
12
|
}
|
|
13
13
|
export declare function MetadataUserFieldView({ field }: MetadataUserFieldViewProps): import("react").JSX.Element;
|
|
14
14
|
export declare function MetadataFieldView({ field }: MetadataFieldViewProps): import("react").JSX.Element;
|
|
15
|
+
export declare function MetadataPreviewsView(): import("react").JSX.Element;
|
|
15
16
|
export interface MetadataDetailsViewProps {
|
|
16
17
|
section: Section;
|
|
17
18
|
}
|
|
@@ -18,34 +18,34 @@ import { IcRoundPublic } from "alinea/dashboard/icons";
|
|
|
18
18
|
|
|
19
19
|
// src/field/metadata/MetadataField.module.css
|
|
20
20
|
var MetadataField_default = {
|
|
21
|
-
"
|
|
22
|
-
"
|
|
21
|
+
"OpenGraphPreview-site": "alinea-OpenGraphPreview-site",
|
|
22
|
+
"OpenGraphPreviewSite": "alinea-OpenGraphPreview-site",
|
|
23
|
+
"OpenGraphPreview-title": "alinea-OpenGraphPreview-title",
|
|
24
|
+
"OpenGraphPreviewTitle": "alinea-OpenGraphPreview-title",
|
|
25
|
+
"OpenGraphPreview-content": "alinea-OpenGraphPreview-content",
|
|
26
|
+
"OpenGraphPreviewContent": "alinea-OpenGraphPreview-content",
|
|
27
|
+
"MetadataUserFieldView-contact": "alinea-MetadataUserFieldView-contact",
|
|
28
|
+
"MetadataUserFieldViewContact": "alinea-MetadataUserFieldView-contact",
|
|
29
|
+
"SearchEnginePreview-og-label-small": "alinea-SearchEnginePreview-og-label-small",
|
|
30
|
+
"SearchEnginePreviewOgLabelSmall": "alinea-SearchEnginePreview-og-label-small",
|
|
23
31
|
"OpenGraphPreview-description": "alinea-OpenGraphPreview-description",
|
|
24
32
|
"OpenGraphPreviewDescription": "alinea-OpenGraphPreview-description",
|
|
25
|
-
"
|
|
33
|
+
"SearchEnginePreview-link": "alinea-SearchEnginePreview-link",
|
|
34
|
+
"SearchEnginePreviewLink": "alinea-SearchEnginePreview-link",
|
|
26
35
|
"SearchEnginePreview-og": "alinea-SearchEnginePreview-og",
|
|
27
36
|
"SearchEnginePreviewOg": "alinea-SearchEnginePreview-og",
|
|
37
|
+
"MetadataUserFieldView": "alinea-MetadataUserFieldView",
|
|
38
|
+
"SearchEnginePreview": "alinea-SearchEnginePreview",
|
|
39
|
+
"OpenGraphPreview": "alinea-OpenGraphPreview",
|
|
40
|
+
"MetadataTimestampFieldView": "alinea-MetadataTimestampFieldView",
|
|
28
41
|
"OpenGraphPreview-image": "alinea-OpenGraphPreview-image",
|
|
29
42
|
"OpenGraphPreviewImage": "alinea-OpenGraphPreview-image",
|
|
30
|
-
"MetadataTimestampFieldView": "alinea-MetadataTimestampFieldView",
|
|
31
|
-
"OpenGraphPreview-site": "alinea-OpenGraphPreview-site",
|
|
32
|
-
"OpenGraphPreviewSite": "alinea-OpenGraphPreview-site",
|
|
33
|
-
"SearchEnginePreview-og-label": "alinea-SearchEnginePreview-og-label",
|
|
34
|
-
"SearchEnginePreviewOgLabel": "alinea-SearchEnginePreview-og-label",
|
|
35
|
-
"SearchEnginePreview-link": "alinea-SearchEnginePreview-link",
|
|
36
|
-
"SearchEnginePreviewLink": "alinea-SearchEnginePreview-link",
|
|
37
|
-
"MetadataUserFieldView-contact": "alinea-MetadataUserFieldView-contact",
|
|
38
|
-
"MetadataUserFieldViewContact": "alinea-MetadataUserFieldView-contact",
|
|
39
43
|
"SearchEnginePreview-description": "alinea-SearchEnginePreview-description",
|
|
40
44
|
"SearchEnginePreviewDescription": "alinea-SearchEnginePreview-description",
|
|
41
|
-
"OpenGraphPreview-title": "alinea-OpenGraphPreview-title",
|
|
42
|
-
"OpenGraphPreviewTitle": "alinea-OpenGraphPreview-title",
|
|
43
|
-
"OpenGraphPreview-content": "alinea-OpenGraphPreview-content",
|
|
44
|
-
"OpenGraphPreviewContent": "alinea-OpenGraphPreview-content",
|
|
45
45
|
"MetadataUserFieldView-person": "alinea-MetadataUserFieldView-person",
|
|
46
46
|
"MetadataUserFieldViewPerson": "alinea-MetadataUserFieldView-person",
|
|
47
|
-
"SearchEnginePreview-og-label
|
|
48
|
-
"
|
|
47
|
+
"SearchEnginePreview-og-label": "alinea-SearchEnginePreview-og-label",
|
|
48
|
+
"SearchEnginePreviewOgLabel": "alinea-SearchEnginePreview-og-label"
|
|
49
49
|
};
|
|
50
50
|
|
|
51
51
|
// src/field/metadata/MetadataField.view.tsx
|
|
@@ -78,19 +78,22 @@ function MetadataUserFieldView({ field }) {
|
|
|
78
78
|
function MetadataFieldView({ field }) {
|
|
79
79
|
const options = useFieldOptions(field);
|
|
80
80
|
const node = useFieldNode(field);
|
|
81
|
-
const metadata = usePreviewMetadata();
|
|
82
81
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
83
82
|
/* @__PURE__ */ jsx(
|
|
84
83
|
NodeEditor,
|
|
85
84
|
{
|
|
86
85
|
node,
|
|
87
86
|
readOnly: options.readOnly,
|
|
88
|
-
type: options.
|
|
87
|
+
type: options.sections ? options.seo : options.fields
|
|
89
88
|
}
|
|
90
89
|
),
|
|
91
|
-
/* @__PURE__ */ jsx(
|
|
90
|
+
!options.sections && /* @__PURE__ */ jsx(MetadataPreviewsView, {})
|
|
92
91
|
] });
|
|
93
92
|
}
|
|
93
|
+
function MetadataPreviewsView() {
|
|
94
|
+
const metadata = usePreviewMetadata();
|
|
95
|
+
return /* @__PURE__ */ jsx(MetadataPreview, { metadata, origin });
|
|
96
|
+
}
|
|
94
97
|
function MetadataDetailsView({ section }) {
|
|
95
98
|
const { field } = section[Section.Data];
|
|
96
99
|
const options = useFieldOptions(field);
|
|
@@ -159,6 +162,7 @@ function SearchEnginePreview({ metadata, origin: origin2 }) {
|
|
|
159
162
|
export {
|
|
160
163
|
MetadataDetailsView,
|
|
161
164
|
MetadataFieldView,
|
|
165
|
+
MetadataPreviewsView,
|
|
162
166
|
MetadataTimestampFieldView,
|
|
163
167
|
MetadataUserFieldView
|
|
164
168
|
};
|
|
@@ -7,5 +7,7 @@ export interface RichTextBlockProps {
|
|
|
7
7
|
readOnly: boolean;
|
|
8
8
|
onDelete: () => void;
|
|
9
9
|
onDuplicate: () => void;
|
|
10
|
+
/** Called as the header starts a drag, before the editor handles it */
|
|
11
|
+
onDragStart: () => void;
|
|
10
12
|
}
|
|
11
|
-
export declare const RichTextBlock: import("react").MemoExoticComponent<({ id, node, type, readOnly, onDelete, onDuplicate }: RichTextBlockProps) => import("react").JSX.Element>;
|
|
13
|
+
export declare const RichTextBlock: import("react").MemoExoticComponent<({ id, node, type, readOnly, onDelete, onDuplicate, onDragStart }: RichTextBlockProps) => import("react").JSX.Element>;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
|
-
useAtomValueRaw
|
|
2
|
+
useAtomValueRaw,
|
|
3
|
+
useSetAtom
|
|
3
4
|
} from "../../chunks/chunk-D6UJHBJJ.js";
|
|
4
5
|
import "../../chunks/chunk-CFNRVI3Y.js";
|
|
5
6
|
import {
|
|
@@ -10,39 +11,57 @@ import "../../chunks/chunk-CQ52GEHY.js";
|
|
|
10
11
|
// src/field/richtext/RichTextBlock.tsx
|
|
11
12
|
import {
|
|
12
13
|
Button,
|
|
14
|
+
SheetBody,
|
|
15
|
+
SheetClose,
|
|
16
|
+
SheetContent,
|
|
17
|
+
SheetFooter,
|
|
18
|
+
SheetHeader,
|
|
19
|
+
SheetSection,
|
|
20
|
+
SheetTitle,
|
|
13
21
|
SortableList,
|
|
14
22
|
SortableListItemTitle,
|
|
23
|
+
SortableListItemTrigger,
|
|
15
24
|
SortableListItem,
|
|
16
25
|
SortableListItemActions,
|
|
17
26
|
SortableListItemContent,
|
|
18
|
-
SortableListHandle,
|
|
19
27
|
SortableListItemHeader,
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
28
|
+
SortableListItemDescription,
|
|
29
|
+
SortableListItemToggle,
|
|
30
|
+
TextField,
|
|
31
|
+
Tooltip,
|
|
32
|
+
TooltipContent,
|
|
33
|
+
TooltipTrigger
|
|
24
34
|
} from "alinea/components";
|
|
25
35
|
import { getType } from "alinea/core/Internal";
|
|
26
36
|
import { Type } from "alinea/core/Type";
|
|
37
|
+
import { slugify } from "alinea/core/util/Slugs";
|
|
27
38
|
import { Badge } from "alinea/components";
|
|
39
|
+
import { BlockSheet, useBlockSheet } from "alinea/dashboard/app/BlockSheet";
|
|
28
40
|
import { NodeEditor } from "alinea/dashboard/app/NodeEditor";
|
|
29
41
|
import { ReactiveNode } from "alinea/dashboard/atoms/ReactiveNode";
|
|
42
|
+
import { useEntry } from "alinea/dashboard/hooks";
|
|
30
43
|
import {
|
|
31
44
|
IcBaselineContentCopy,
|
|
32
45
|
IcRoundClose,
|
|
33
|
-
|
|
46
|
+
IcRoundDelete,
|
|
47
|
+
IcRoundLink
|
|
34
48
|
} from "alinea/dashboard/icons";
|
|
49
|
+
import { SlugField } from "alinea/field/path/SlugField";
|
|
35
50
|
import { memo, useMemo, useState } from "react";
|
|
36
51
|
|
|
37
52
|
// src/field/richtext/RichTextBlock.module.css
|
|
38
53
|
var RichTextBlock_default = {
|
|
39
54
|
"RichTextBlock": "alinea-RichTextBlock",
|
|
40
|
-
"RichTextBlock-
|
|
41
|
-
"
|
|
55
|
+
"RichTextBlock-header": "alinea-RichTextBlock-header",
|
|
56
|
+
"RichTextBlockHeader": "alinea-RichTextBlock-header",
|
|
57
|
+
"RichTextBlock-anchor-field": "alinea-RichTextBlock-anchor-field",
|
|
58
|
+
"RichTextBlockAnchorField": "alinea-RichTextBlock-anchor-field",
|
|
59
|
+
"RichTextBlock-anchor": "alinea-RichTextBlock-anchor",
|
|
60
|
+
"RichTextBlockAnchor": "alinea-RichTextBlock-anchor"
|
|
42
61
|
};
|
|
43
62
|
|
|
44
63
|
// src/field/richtext/RichTextBlock.tsx
|
|
45
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
64
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
46
65
|
var styles = dist_default(RichTextBlock_default);
|
|
47
66
|
var RichTextBlock = memo(function RichTextBlock2({
|
|
48
67
|
id,
|
|
@@ -50,90 +69,174 @@ var RichTextBlock = memo(function RichTextBlock2({
|
|
|
50
69
|
type,
|
|
51
70
|
readOnly,
|
|
52
71
|
onDelete,
|
|
53
|
-
onDuplicate
|
|
72
|
+
onDuplicate,
|
|
73
|
+
onDragStart
|
|
54
74
|
}) {
|
|
55
75
|
const label = Type.label(type);
|
|
56
76
|
const typeIcon = getType(type).icon;
|
|
57
|
-
const
|
|
58
|
-
|
|
59
|
-
|
|
77
|
+
const sheet = useBlockSheet(id);
|
|
78
|
+
const [expanded, setExpanded] = useState(true);
|
|
79
|
+
const customLabel = useAtomValueRaw(node.field("_label")) ?? "";
|
|
80
|
+
const setCustomLabel = useSetAtom(node.field("_label"));
|
|
81
|
+
const anchor = useAtomValueRaw(node.field("_anchor"));
|
|
82
|
+
const setAnchor = useSetAtom(node.field("_anchor"));
|
|
83
|
+
const entryUrl = useEntry()?.url;
|
|
84
|
+
const displayLabel = customLabel.trim();
|
|
85
|
+
const displayAnchor = (anchor ?? slugify(displayLabel)).trim();
|
|
86
|
+
const link = entryUrl && displayAnchor ? `${entryUrl}#${displayAnchor}` : void 0;
|
|
87
|
+
function updateCustomLabel(nextValue) {
|
|
88
|
+
setCustomLabel(nextValue || void 0);
|
|
89
|
+
if (anchor === void 0 || anchor === slugify(customLabel))
|
|
90
|
+
setAnchor(slugify(nextValue) || void 0);
|
|
60
91
|
}
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
92
|
+
function updateAnchor(nextValue) {
|
|
93
|
+
setAnchor(slugify(nextValue.replace(/^#+/, "")) || void 0);
|
|
94
|
+
}
|
|
95
|
+
const badge = /* @__PURE__ */ jsx(Badge, { icon: typeIcon, size: "sm", color: "primary", children: label });
|
|
96
|
+
const title = /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
97
|
+
badge,
|
|
98
|
+
displayLabel ? /* @__PURE__ */ jsx(SortableListItemDescription, { children: displayLabel }) : displayAnchor && /* @__PURE__ */ jsxs(Badge, { size: "sm", children: [
|
|
99
|
+
"#",
|
|
100
|
+
displayAnchor
|
|
101
|
+
] })
|
|
102
|
+
] });
|
|
103
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
104
|
+
/* @__PURE__ */ jsx(
|
|
105
|
+
SortableList,
|
|
106
|
+
{
|
|
107
|
+
className: styles.RichTextBlock(),
|
|
108
|
+
"data-read-only": readOnly || void 0,
|
|
109
|
+
"data-richtext-block": "true",
|
|
110
|
+
children: /* @__PURE__ */ jsxs(SortableListItem, { tabIndex: 0, current: sheet.open, children: [
|
|
111
|
+
/* @__PURE__ */ jsxs(
|
|
112
|
+
SortableListItemHeader,
|
|
72
113
|
{
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
"data-richtext-drag-handle": "true",
|
|
76
|
-
draggable:
|
|
114
|
+
className: styles.RichTextBlock.header(),
|
|
115
|
+
"data-richtext-block-header": "true",
|
|
116
|
+
"data-richtext-drag-handle": readOnly ? void 0 : "true",
|
|
117
|
+
draggable: !readOnly,
|
|
118
|
+
onDragStartCapture: onDragStart,
|
|
77
119
|
onDragStart: (event) => {
|
|
78
120
|
event.dataTransfer.effectAllowed = "move";
|
|
79
121
|
event.dataTransfer.setData(
|
|
80
122
|
"application/x-alinea-richtext-block",
|
|
81
123
|
id
|
|
82
124
|
);
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
),
|
|
98
|
-
/* @__PURE__ */ jsx(
|
|
99
|
-
PopoverContent,
|
|
100
|
-
{
|
|
101
|
-
"aria-label": `${label} actions`,
|
|
102
|
-
side: "bottom",
|
|
103
|
-
align: "end",
|
|
104
|
-
children: /* @__PURE__ */ jsx(SortableListItemSettings, { variant: "actions", children: /* @__PURE__ */ jsx(
|
|
105
|
-
Button,
|
|
125
|
+
},
|
|
126
|
+
children: [
|
|
127
|
+
/* @__PURE__ */ jsxs(SortableListItemTitle, { children: [
|
|
128
|
+
/* @__PURE__ */ jsx(
|
|
129
|
+
SortableListItemToggle,
|
|
130
|
+
{
|
|
131
|
+
draggable: !readOnly,
|
|
132
|
+
"aria-label": expanded ? `Collapse ${label}` : `Expand ${label}`,
|
|
133
|
+
expanded,
|
|
134
|
+
onClick: () => setExpanded(!expanded)
|
|
135
|
+
}
|
|
136
|
+
),
|
|
137
|
+
sheet.available ? /* @__PURE__ */ jsx(
|
|
138
|
+
SortableListItemTrigger,
|
|
106
139
|
{
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
140
|
+
...sheet.triggerProps,
|
|
141
|
+
draggable: !readOnly,
|
|
142
|
+
"aria-label": `${label} settings`,
|
|
143
|
+
"aria-expanded": sheet.open,
|
|
110
144
|
onClick: () => {
|
|
111
|
-
|
|
112
|
-
|
|
145
|
+
if (!sheet.open) setExpanded(true);
|
|
146
|
+
sheet.toggle();
|
|
113
147
|
},
|
|
114
|
-
children:
|
|
148
|
+
children: title
|
|
115
149
|
}
|
|
116
|
-
)
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
|
|
150
|
+
) : title
|
|
151
|
+
] }),
|
|
152
|
+
/* @__PURE__ */ jsx(SortableListItemActions, { children: /* @__PURE__ */ jsx(
|
|
153
|
+
Button,
|
|
154
|
+
{
|
|
155
|
+
variant: "ghost",
|
|
156
|
+
"aria-label": `Remove ${label}`,
|
|
157
|
+
icon: IcRoundClose,
|
|
158
|
+
disabled: readOnly,
|
|
159
|
+
onClick: onDelete,
|
|
160
|
+
size: "icon-sm"
|
|
161
|
+
}
|
|
162
|
+
) })
|
|
163
|
+
]
|
|
164
|
+
}
|
|
165
|
+
),
|
|
166
|
+
expanded && /* @__PURE__ */ jsx(SortableListItemContent, { "data-richtext-block-editor": "true", children: readOnly ? /* @__PURE__ */ jsx(ReadOnlyBlockEditor, { node, type }) : /* @__PURE__ */ jsx(NodeEditor, { node, type }) })
|
|
167
|
+
] })
|
|
168
|
+
}
|
|
169
|
+
),
|
|
170
|
+
/* @__PURE__ */ jsx(BlockSheet, { id, children: /* @__PURE__ */ jsxs(SheetContent, { onClose: () => sheet.setOpen(false), children: [
|
|
171
|
+
/* @__PURE__ */ jsxs(SheetHeader, { children: [
|
|
172
|
+
badge,
|
|
173
|
+
/* @__PURE__ */ jsx(SheetTitle, { children: displayLabel || displayAnchor && `#${displayAnchor}` || label }),
|
|
174
|
+
/* @__PURE__ */ jsx(SheetClose, { "aria-label": "Close block settings" })
|
|
175
|
+
] }),
|
|
176
|
+
/* @__PURE__ */ jsx(SheetBody, { children: /* @__PURE__ */ jsxs(SheetSection, { children: [
|
|
177
|
+
/* @__PURE__ */ jsx(
|
|
178
|
+
TextField,
|
|
179
|
+
{
|
|
180
|
+
label: "Label",
|
|
181
|
+
disabled: readOnly,
|
|
182
|
+
onValueChange: updateCustomLabel,
|
|
183
|
+
value: customLabel
|
|
184
|
+
}
|
|
185
|
+
),
|
|
186
|
+
/* @__PURE__ */ jsxs("div", { className: styles.RichTextBlock.anchor(), children: [
|
|
187
|
+
/* @__PURE__ */ jsx("div", { className: styles.RichTextBlock.anchor.field(), children: /* @__PURE__ */ jsx(
|
|
188
|
+
SlugField,
|
|
189
|
+
{
|
|
190
|
+
fieldValue: anchor,
|
|
191
|
+
label: "Anchor",
|
|
192
|
+
isDisabled: readOnly,
|
|
193
|
+
onChange: updateAnchor,
|
|
194
|
+
source: customLabel
|
|
195
|
+
}
|
|
196
|
+
) }),
|
|
197
|
+
link && /* @__PURE__ */ jsxs(Tooltip, { children: [
|
|
120
198
|
/* @__PURE__ */ jsx(
|
|
121
|
-
|
|
199
|
+
TooltipTrigger,
|
|
122
200
|
{
|
|
123
201
|
variant: "ghost",
|
|
124
|
-
"
|
|
125
|
-
icon:
|
|
126
|
-
|
|
127
|
-
onClick:
|
|
128
|
-
size: "icon-sm"
|
|
202
|
+
size: "icon",
|
|
203
|
+
icon: IcRoundLink,
|
|
204
|
+
"aria-label": "Copy link to block",
|
|
205
|
+
onClick: () => navigator.clipboard.writeText(link)
|
|
129
206
|
}
|
|
130
|
-
)
|
|
207
|
+
),
|
|
208
|
+
/* @__PURE__ */ jsx(TooltipContent, { children: "Copy link to block" })
|
|
131
209
|
] })
|
|
132
|
-
] })
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
210
|
+
] })
|
|
211
|
+
] }) }),
|
|
212
|
+
/* @__PURE__ */ jsx(SheetFooter, { children: /* @__PURE__ */ jsx(
|
|
213
|
+
Button,
|
|
214
|
+
{
|
|
215
|
+
variant: "ghost",
|
|
216
|
+
size: "sm",
|
|
217
|
+
icon: IcBaselineContentCopy,
|
|
218
|
+
disabled: readOnly,
|
|
219
|
+
onClick: () => {
|
|
220
|
+
onDuplicate();
|
|
221
|
+
sheet.setOpen(false);
|
|
222
|
+
},
|
|
223
|
+
children: "Duplicate"
|
|
224
|
+
}
|
|
225
|
+
) }),
|
|
226
|
+
/* @__PURE__ */ jsx(SheetFooter, { children: /* @__PURE__ */ jsx(
|
|
227
|
+
Button,
|
|
228
|
+
{
|
|
229
|
+
variant: "ghost",
|
|
230
|
+
size: "sm",
|
|
231
|
+
color: "destructive",
|
|
232
|
+
icon: IcRoundDelete,
|
|
233
|
+
disabled: readOnly,
|
|
234
|
+
onClick: onDelete,
|
|
235
|
+
children: "Delete"
|
|
236
|
+
}
|
|
237
|
+
) })
|
|
238
|
+
] }) })
|
|
239
|
+
] });
|
|
137
240
|
});
|
|
138
241
|
function ReadOnlyBlockEditor({ node, type }) {
|
|
139
242
|
const value = useAtomValueRaw(node.value);
|
|
@@ -34,7 +34,7 @@ var RichTextBlockHosts = class {
|
|
|
34
34
|
},
|
|
35
35
|
stopEvent(event) {
|
|
36
36
|
const target = event.target;
|
|
37
|
-
const dragHandle = target instanceof Element && target.closest("[data-richtext-drag-handle]");
|
|
37
|
+
const dragHandle = target instanceof Element && target.closest("[data-richtext-drag-handle]") && !target.closest('button, a, input, [role="button"]');
|
|
38
38
|
if (event.type.startsWith("drag") || event.type === "drop")
|
|
39
39
|
return false;
|
|
40
40
|
return !dragHandle;
|
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Dropcursor,
|
|
3
|
+
Gapcursor,
|
|
4
|
+
UndoRedo
|
|
5
|
+
} from "../../chunks/chunk-AC5ATYI3.js";
|
|
1
6
|
import {
|
|
2
7
|
CellSelection,
|
|
3
8
|
addColumnAfter,
|
|
@@ -18,11 +23,6 @@ import {
|
|
|
18
23
|
toggleHeader,
|
|
19
24
|
toggleHeaderCell
|
|
20
25
|
} from "../../chunks/chunk-PAYSVIYI.js";
|
|
21
|
-
import {
|
|
22
|
-
Dropcursor,
|
|
23
|
-
Gapcursor,
|
|
24
|
-
UndoRedo
|
|
25
|
-
} from "../../chunks/chunk-AC5ATYI3.js";
|
|
26
26
|
import {
|
|
27
27
|
Extension,
|
|
28
28
|
Fragment,
|
|
@@ -2970,46 +2970,46 @@ import Small from "./extensions/Small.js";
|
|
|
2970
2970
|
|
|
2971
2971
|
// src/field/richtext/RichTextExtensions.module.css
|
|
2972
2972
|
var RichTextExtensions_default = {
|
|
2973
|
-
"RichTextExtensions-heading": "alinea-RichTextExtensions-heading",
|
|
2974
|
-
"RichTextExtensionsHeading": "alinea-RichTextExtensions-heading",
|
|
2975
|
-
"RichTextExtensions-blockquote": "alinea-RichTextExtensions-blockquote",
|
|
2976
|
-
"RichTextExtensionsBlockquote": "alinea-RichTextExtensions-blockquote",
|
|
2977
|
-
"RichTextExtensions-tableCell": "alinea-RichTextExtensions-tableCell",
|
|
2978
|
-
"RichTextExtensionsTableCell": "alinea-RichTextExtensions-tableCell",
|
|
2979
|
-
"RichTextExtensions-paragraph": "alinea-RichTextExtensions-paragraph",
|
|
2980
|
-
"RichTextExtensionsParagraph": "alinea-RichTextExtensions-paragraph",
|
|
2981
2973
|
"RichTextExtensions-bulletList": "alinea-RichTextExtensions-bulletList",
|
|
2982
2974
|
"RichTextExtensionsBulletList": "alinea-RichTextExtensions-bulletList",
|
|
2975
|
+
"RichTextExtensions-image": "alinea-RichTextExtensions-image",
|
|
2976
|
+
"RichTextExtensionsImage": "alinea-RichTextExtensions-image",
|
|
2977
|
+
"is-level6": "alinea-is-level6",
|
|
2978
|
+
"isLevel6": "alinea-is-level6",
|
|
2979
|
+
"is-level2": "alinea-is-level2",
|
|
2980
|
+
"isLevel2": "alinea-is-level2",
|
|
2983
2981
|
"is-level3": "alinea-is-level3",
|
|
2984
2982
|
"isLevel3": "alinea-is-level3",
|
|
2985
|
-
"is-level1": "alinea-is-level1",
|
|
2986
|
-
"isLevel1": "alinea-is-level1",
|
|
2987
2983
|
"RichTextExtensions-link": "alinea-RichTextExtensions-link",
|
|
2988
2984
|
"RichTextExtensionsLink": "alinea-RichTextExtensions-link",
|
|
2989
|
-
"RichTextExtensions-
|
|
2990
|
-
"
|
|
2991
|
-
"is-level6": "alinea-is-level6",
|
|
2992
|
-
"isLevel6": "alinea-is-level6",
|
|
2985
|
+
"RichTextExtensions-blockquote": "alinea-RichTextExtensions-blockquote",
|
|
2986
|
+
"RichTextExtensionsBlockquote": "alinea-RichTextExtensions-blockquote",
|
|
2993
2987
|
"is-level4": "alinea-is-level4",
|
|
2994
2988
|
"isLevel4": "alinea-is-level4",
|
|
2995
|
-
"RichTextExtensions-orderedList": "alinea-RichTextExtensions-orderedList",
|
|
2996
|
-
"RichTextExtensionsOrderedList": "alinea-RichTextExtensions-orderedList",
|
|
2997
|
-
"RichTextExtensions-tableHeader": "alinea-RichTextExtensions-tableHeader",
|
|
2998
|
-
"RichTextExtensionsTableHeader": "alinea-RichTextExtensions-tableHeader",
|
|
2999
|
-
"RichTextExtensions-highlight": "alinea-RichTextExtensions-highlight",
|
|
3000
|
-
"RichTextExtensionsHighlight": "alinea-RichTextExtensions-highlight",
|
|
3001
|
-
"is-level2": "alinea-is-level2",
|
|
3002
|
-
"isLevel2": "alinea-is-level2",
|
|
3003
2989
|
"RichTextExtensions-rule": "alinea-RichTextExtensions-rule",
|
|
3004
2990
|
"RichTextExtensionsRule": "alinea-RichTextExtensions-rule",
|
|
2991
|
+
"is-level5": "alinea-is-level5",
|
|
2992
|
+
"isLevel5": "alinea-is-level5",
|
|
2993
|
+
"RichTextExtensions-orderedList": "alinea-RichTextExtensions-orderedList",
|
|
2994
|
+
"RichTextExtensionsOrderedList": "alinea-RichTextExtensions-orderedList",
|
|
2995
|
+
"is-level1": "alinea-is-level1",
|
|
2996
|
+
"isLevel1": "alinea-is-level1",
|
|
2997
|
+
"RichTextExtensions-tableCell": "alinea-RichTextExtensions-tableCell",
|
|
2998
|
+
"RichTextExtensionsTableCell": "alinea-RichTextExtensions-tableCell",
|
|
2999
|
+
"RichTextExtensions-table": "alinea-RichTextExtensions-table",
|
|
3000
|
+
"RichTextExtensionsTable": "alinea-RichTextExtensions-table",
|
|
3001
|
+
"RichTextExtensions-heading": "alinea-RichTextExtensions-heading",
|
|
3002
|
+
"RichTextExtensionsHeading": "alinea-RichTextExtensions-heading",
|
|
3005
3003
|
"RichTextExtensions-listItem": "alinea-RichTextExtensions-listItem",
|
|
3006
3004
|
"RichTextExtensionsListItem": "alinea-RichTextExtensions-listItem",
|
|
3007
3005
|
"RichTextExtensions-anchor": "alinea-RichTextExtensions-anchor",
|
|
3008
3006
|
"RichTextExtensionsAnchor": "alinea-RichTextExtensions-anchor",
|
|
3009
|
-
"RichTextExtensions-
|
|
3010
|
-
"
|
|
3011
|
-
"
|
|
3012
|
-
"
|
|
3007
|
+
"RichTextExtensions-paragraph": "alinea-RichTextExtensions-paragraph",
|
|
3008
|
+
"RichTextExtensionsParagraph": "alinea-RichTextExtensions-paragraph",
|
|
3009
|
+
"RichTextExtensions-tableHeader": "alinea-RichTextExtensions-tableHeader",
|
|
3010
|
+
"RichTextExtensionsTableHeader": "alinea-RichTextExtensions-tableHeader",
|
|
3011
|
+
"RichTextExtensions-highlight": "alinea-RichTextExtensions-highlight",
|
|
3012
|
+
"RichTextExtensionsHighlight": "alinea-RichTextExtensions-highlight"
|
|
3013
3013
|
};
|
|
3014
3014
|
|
|
3015
3015
|
// src/field/richtext/RichTextExtensions.ts
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Placeholder
|
|
3
|
+
} from "../../chunks/chunk-AC5ATYI3.js";
|
|
1
4
|
import {
|
|
2
5
|
EditorContent,
|
|
3
6
|
useEditor
|
|
4
7
|
} from "../../chunks/chunk-NP4M2257.js";
|
|
5
|
-
import {
|
|
6
|
-
Placeholder
|
|
7
|
-
} from "../../chunks/chunk-AC5ATYI3.js";
|
|
8
8
|
import "../../chunks/chunk-A3XXZBOQ.js";
|
|
9
9
|
import {
|
|
10
10
|
useAtomValueRaw,
|
|
@@ -68,12 +68,12 @@ import {
|
|
|
68
68
|
|
|
69
69
|
// src/field/richtext/RichTextField.module.css
|
|
70
70
|
var RichTextField_default = {
|
|
71
|
-
"
|
|
72
|
-
"RichTextFieldView-unsupportedBlock": "alinea-RichTextFieldView-unsupportedBlock",
|
|
73
|
-
"RichTextFieldViewUnsupportedBlock": "alinea-RichTextFieldView-unsupportedBlock",
|
|
71
|
+
"RichTextFieldCompactView": "alinea-RichTextFieldCompactView",
|
|
74
72
|
"RichTextFieldView-empty": "alinea-RichTextFieldView-empty",
|
|
75
73
|
"RichTextFieldViewEmpty": "alinea-RichTextFieldView-empty",
|
|
76
|
-
"
|
|
74
|
+
"RichTextFieldView": "alinea-RichTextFieldView",
|
|
75
|
+
"RichTextFieldView-unsupportedBlock": "alinea-RichTextFieldView-unsupportedBlock",
|
|
76
|
+
"RichTextFieldViewUnsupportedBlock": "alinea-RichTextFieldView-unsupportedBlock"
|
|
77
77
|
};
|
|
78
78
|
|
|
79
79
|
// src/field/richtext/RichTextField.view.tsx
|
|
@@ -362,6 +362,11 @@ function RichTextBlockPortals({
|
|
|
362
362
|
if (typeof position !== "number") return;
|
|
363
363
|
editor.commands.deleteRange({ from: position, to: position + 1 });
|
|
364
364
|
}
|
|
365
|
+
function select(host) {
|
|
366
|
+
const position = host.getPos();
|
|
367
|
+
if (typeof position !== "number") return;
|
|
368
|
+
editor.commands.setNodeSelection(position);
|
|
369
|
+
}
|
|
365
370
|
function duplicate(host, part) {
|
|
366
371
|
const position = host.getPos();
|
|
367
372
|
if (typeof position !== "number") return;
|
|
@@ -391,7 +396,8 @@ function RichTextBlockPortals({
|
|
|
391
396
|
type,
|
|
392
397
|
readOnly,
|
|
393
398
|
onDelete: () => remove(host),
|
|
394
|
-
onDuplicate: () => duplicate(host, part)
|
|
399
|
+
onDuplicate: () => duplicate(host, part),
|
|
400
|
+
onDragStart: () => select(host)
|
|
395
401
|
}
|
|
396
402
|
)
|
|
397
403
|
] }),
|