alinea 2.0.0-preview.13 → 2.0.0-preview.14
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 +6 -2
- package/dist/adapter/next/context.js +1 -4
- package/dist/adapter/next/handler.js +12 -1
- package/dist/backend/CommitEntries.d.ts +17 -0
- package/dist/backend/CommitEntries.js +39 -0
- package/dist/backend/Handler.d.ts +9 -0
- package/dist/backend/Handler.js +80 -20
- package/dist/backend/api/BasicAuth.js +5 -1
- package/dist/backend/api/CreateBackend.js +2 -2
- package/dist/backend/api/DatabaseApi.js +18 -5
- package/dist/backend/api/GithubApi.d.ts +13 -0
- package/dist/backend/api/GithubApi.js +170 -30
- package/dist/backend/api/database.js +2 -2
- package/dist/backend/util/Syncable.d.ts +6 -0
- package/dist/backend/util/Syncable.js +3 -1
- package/dist/bundled.d.ts +911 -151
- package/dist/chunks/{chunk-5H4D5JQL.js → chunk-2PP7WJUJ.js} +1 -11
- package/dist/chunks/{chunk-QHHMKJUO.js → chunk-7DDPSWRY.js} +465 -2
- package/dist/chunks/{chunk-HOETF6HN.js → chunk-PMGIIYDD.js} +1 -0
- package/dist/chunks/{chunk-3QFSGTGF.js → chunk-SCV3TEXM.js} +1 -1
- package/dist/chunks/{chunk-UPY2RUZF.js → chunk-TWBREZWC.js} +30 -0
- package/dist/cli/Generate.js +20 -7
- package/dist/cli/Mcp.js +1 -1
- package/dist/cli/Serve.js +1 -1
- package/dist/cli/bin.js +1 -1
- package/dist/cli/build/BuildEmitter.d.ts +5 -1
- package/dist/cli/build/BuildEmitter.js +8 -3
- package/dist/cli/generate/CompileConfig.js +10 -6
- package/dist/cli/generate/DevDB.d.ts +4 -1
- package/dist/cli/generate/DevDB.js +15 -7
- package/dist/cli/generate/GenerateDashboard.js +1 -0
- package/dist/cli/generate/MediaLocations.d.ts +18 -0
- package/dist/cli/generate/MediaLocations.js +69 -0
- package/dist/cli/serve/CreateLocalServer.js +1 -0
- package/dist/cli/serve/mcp/DevMcp.js +1 -1
- package/dist/cloud/CloudRemote.js +21 -7
- package/dist/cms.d.ts +4 -2
- package/dist/components/Alert.js +2 -2
- package/dist/components/AppShell.js +2 -2
- package/dist/components/AsyncList.d.ts +52 -0
- package/dist/components/AsyncList.js +69 -0
- package/dist/components/Breadcrumbs.js +6 -6
- package/dist/components/Button.js +4 -4
- package/dist/components/Calendar.js +18 -18
- package/dist/components/Checkbox.js +10 -10
- package/dist/components/CheckboxGroup.js +2 -2
- package/dist/components/Collapsible.js +5 -5
- package/dist/components/ColorSwatch.js +2 -2
- package/dist/components/ColorSwatchPicker.js +4 -4
- package/dist/components/ComboBox.d.ts +27 -9
- package/dist/components/ComboBox.js +40 -9
- package/dist/components/Command.js +13 -13
- package/dist/components/ContentCard.js +28 -28
- package/dist/components/ContentGrid.js +11 -11
- package/dist/components/DataList.js +1 -1
- package/dist/components/DateField.d.ts +4 -0
- 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.d.ts +14 -3
- package/dist/components/Dialog.js +38 -11
- package/dist/components/DropZone.js +6 -6
- package/dist/components/DropdownMenu.js +8 -8
- package/dist/components/Empty.js +4 -4
- package/dist/components/Field.d.ts +1 -1
- package/dist/components/Field.js +18 -12
- package/dist/components/Form.d.ts +23 -0
- package/dist/components/Form.js +64 -0
- package/dist/components/Link.d.ts +8 -1
- package/dist/components/List.js +27 -27
- package/dist/components/MediaPreview.js +5 -5
- package/dist/components/MultipleSelect.d.ts +13 -8
- package/dist/components/MultipleSelect.js +25 -25
- package/dist/components/NavRail.js +7 -7
- package/dist/components/NumberField.d.ts +5 -1
- package/dist/components/NumberField.js +6 -4
- package/dist/components/Page.js +6 -6
- package/dist/components/Popover.js +2 -2
- package/dist/components/PreviewFrame.js +8 -8
- package/dist/components/RadioGroup.js +10 -10
- package/dist/components/Resizable.js +1 -1
- package/dist/components/SearchField.js +8 -8
- package/dist/components/Select.d.ts +13 -10
- package/dist/components/Select.js +18 -32
- package/dist/components/Sheet.js +6 -6
- package/dist/components/Sidebar.js +5 -5
- package/dist/components/SortableList.js +12 -12
- package/dist/components/Spinner.js +4 -4
- package/dist/components/Stack.d.ts +20 -0
- package/dist/components/Stack.js +45 -0
- package/dist/components/Surface.js +1 -1
- package/dist/components/Switch.js +5 -5
- package/dist/components/Table.d.ts +11 -1
- package/dist/components/Table.js +81 -53
- package/dist/components/Tabs.js +6 -6
- package/dist/components/TagGroup.js +10 -10
- package/dist/components/TextField.d.ts +7 -1
- package/dist/components/TextField.js +20 -11
- package/dist/components/TimeField.d.ts +6 -1
- package/dist/components/TimeField.js +51 -26
- package/dist/components/Timestamp.js +1 -1
- package/dist/components/ToggleGroup.js +2 -2
- package/dist/components/Toolbar.js +3 -3
- package/dist/components/Tooltip.js +5 -4
- package/dist/components/Tree.js +27 -27
- package/dist/components/internal/DateControl.js +11 -11
- package/dist/components/internal/FormScope.d.ts +2 -0
- package/dist/components/internal/FormScope.js +8 -0
- package/dist/components/internal/ListBoxGroup.d.ts +12 -0
- package/dist/components/internal/ListBoxGroup.js +46 -0
- package/dist/components/internal/ListBoxOption.d.ts +2 -2
- package/dist/components/internal/ListBoxOption.js +5 -5
- package/dist/components/internal/Locale.js +2 -2
- package/dist/components/internal/PopoverSurface.js +5 -4
- package/dist/components/internal/SelectionCheckbox.js +5 -5
- package/dist/components/internal/Slot.js +1 -1
- package/dist/components/internal/ToggleButton.js +4 -4
- package/dist/components/internal/Trigger.js +2 -2
- package/dist/components/internal/useDragDrop.js +2 -2
- package/dist/components/types.d.ts +4 -0
- package/dist/components.d.ts +3 -0
- package/dist/components.js +3 -0
- package/dist/core/Client.js +12 -1
- package/dist/core/Config.d.ts +6 -0
- package/dist/core/Config.js +12 -0
- package/dist/core/DashboardEntry.d.ts +19 -0
- package/dist/core/DashboardEntry.js +0 -0
- package/dist/core/Document.d.ts +2 -2
- package/dist/core/Document.js +10 -3
- package/dist/core/EntryFields.d.ts +8 -2
- package/dist/core/Field.d.ts +5 -0
- package/dist/core/Filter.d.ts +19 -2
- package/dist/core/Filter.js +5 -0
- package/dist/core/Graph.d.ts +10 -2
- package/dist/core/Overview.d.ts +74 -5
- package/dist/core/Overview.js +1 -0
- package/dist/core/Root.js +1 -1
- package/dist/core/Scope.d.ts +5 -0
- package/dist/core/Scope.js +22 -5
- package/dist/core/Type.d.ts +25 -6
- package/dist/core/Type.js +25 -7
- package/dist/core/db/LocalStore.d.ts +7 -0
- package/dist/core/field/CreateField.d.ts +1 -2
- package/dist/core/source/Source.d.ts +2 -0
- package/dist/core/source/Source.js +11 -0
- package/dist/core/util/Async.d.ts +2 -0
- package/dist/core/util/Async.js +12 -1
- package/dist/core/util/Checks.js +1 -1
- package/dist/core/util/Slugs.js +4 -3
- package/dist/dashboard/App.css +13 -11
- package/dist/dashboard/App.d.ts +1 -0
- package/dist/dashboard/App.js +22 -6
- package/dist/dashboard/Href.d.ts +37 -0
- package/dist/dashboard/Href.js +46 -0
- package/dist/dashboard/app/ActivityStatus.js +34 -12
- package/dist/dashboard/app/AuthView.js +2 -2
- package/dist/dashboard/app/BlockSettings.d.ts +9 -0
- package/dist/dashboard/app/BlockSettings.js +16 -0
- package/dist/dashboard/app/BlockSheet.js +3 -3
- package/dist/dashboard/app/BlockSheetStoryFrame.js +2 -2
- package/dist/dashboard/app/CompactField.js +15 -15
- package/dist/dashboard/app/CroppedImage.js +2 -2
- package/dist/dashboard/app/DashboardLayout.d.ts +1 -1
- package/dist/dashboard/app/DashboardLayout.js +12 -0
- package/dist/dashboard/app/EntryActions.d.ts +11 -0
- package/dist/dashboard/app/EntryActions.js +30 -0
- package/dist/dashboard/app/EntryFields.d.ts +15 -2
- package/dist/dashboard/app/EntryFields.js +26 -5
- package/dist/dashboard/app/EntryHeader.js +17 -7
- package/dist/dashboard/app/EntryReferences.js +2 -2
- package/dist/dashboard/app/EntrySidebar.js +25 -23
- package/dist/dashboard/app/EntrySidebarPreview.js +2 -2
- package/dist/dashboard/app/EntryValidationModal.js +3 -3
- package/dist/dashboard/app/Explorer.js +84 -45
- package/dist/dashboard/app/ExplorerBatchActions.js +4 -4
- package/dist/dashboard/app/ExplorerControls.js +5 -5
- package/dist/dashboard/app/ExplorerList.js +2 -2
- package/dist/dashboard/app/ExplorerModal.js +3 -3
- package/dist/dashboard/app/ExplorerOverviewHeader.d.ts +6 -0
- package/dist/dashboard/app/ExplorerOverviewHeader.js +28 -0
- package/dist/dashboard/app/ExplorerTable.js +7 -7
- package/dist/dashboard/app/ExplorerTabs.d.ts +12 -0
- package/dist/dashboard/app/ExplorerTabs.js +42 -0
- package/dist/dashboard/app/ImageEditor.js +31 -31
- package/dist/dashboard/app/LinkPicker.js +3 -3
- package/dist/dashboard/app/LocaleMenu.js +9 -9
- package/dist/dashboard/app/MediaPreviewCell.js +5 -5
- package/dist/dashboard/app/OverviewCell.js +12 -10
- package/dist/dashboard/app/RemoveDialog.js +5 -0
- package/dist/dashboard/app/SearchBar.js +4 -4
- package/dist/dashboard/app/SettingsTab.d.ts +6 -0
- package/dist/dashboard/app/SettingsTab.js +27 -0
- package/dist/dashboard/app/SidebarTree.js +19 -19
- package/dist/dashboard/app/WorkspaceMenu.js +6 -6
- package/dist/dashboard/app/WorkspaceRoots.js +102 -98
- package/dist/dashboard/app/editor/FileEditor.js +18 -18
- package/dist/dashboard/app/pages/EntryPage.js +42 -39
- package/dist/dashboard/app/pages/RootPage.js +3 -3
- package/dist/dashboard/app/pages/SplashPage.js +94 -79
- package/dist/dashboard/app/pages/UsersPage.js +9 -9
- package/dist/dashboard/app/ui/DashboardModal.js +14 -14
- package/dist/dashboard/atoms/activity.d.ts +1 -0
- package/dist/dashboard/atoms/activity.js +8 -5
- package/dist/dashboard/atoms/config.d.ts +2 -0
- package/dist/dashboard/atoms/dashboard.d.ts +11 -0
- package/dist/dashboard/atoms/dashboard.js +8 -0
- package/dist/dashboard/atoms/editor.d.ts +7 -1
- package/dist/dashboard/atoms/editor.js +14 -2
- package/dist/dashboard/atoms/explorer.d.ts +15 -0
- package/dist/dashboard/atoms/explorer.js +43 -14
- package/dist/dashboard/atoms/graph.d.ts +5 -0
- package/dist/dashboard/atoms/graph.js +26 -1
- package/dist/dashboard/atoms/nav.d.ts +16 -10
- package/dist/dashboard/atoms/nav.js +96 -36
- package/dist/dashboard/atoms/overview.d.ts +26 -4
- package/dist/dashboard/atoms/overview.js +41 -12
- package/dist/dashboard/atoms/root.js +7 -1
- package/dist/dashboard/boot/ActivityEvent.d.ts +1 -1
- package/dist/dashboard/boot/Boot.js +6 -0
- package/dist/dashboard/boot/DashboardWorker.d.ts +6 -0
- package/dist/dashboard/boot/DashboardWorker.js +89 -8
- package/dist/dashboard/boot/LoadWorker.js +3 -0
- package/dist/dashboard/boot/SyncEvent.d.ts +7 -0
- package/dist/dashboard/boot/SyncEvent.js +14 -0
- package/dist/dashboard/boot/WorkerDB.d.ts +1 -0
- package/dist/dashboard/boot/WorkerDB.js +3 -0
- package/dist/dashboard/cms/EntryTable.d.ts +4 -3
- package/dist/dashboard/cms/EntryTable.js +2 -2
- package/dist/dashboard/cms/ViewProps.d.ts +3 -2
- package/dist/dashboard/cms/hooks.d.ts +34 -18
- package/dist/dashboard/cms/hooks.js +43 -18
- package/dist/dashboard/contexts.d.ts +3 -2
- package/dist/dashboard/contexts.js +3 -2
- package/dist/dashboard/hook/UseEntryEditor.d.ts +1 -1
- package/dist/dashboard/hook/UseEntryEditor.js +7 -3
- package/dist/dashboard/icons.d.ts +1 -0
- package/dist/dashboard/icons.js +15 -0
- package/dist/database/BrowserEntryStore.js +35 -13
- package/dist/database/DatabaseTables.js +1 -1
- package/dist/database/EntryDatabase.d.ts +10 -1
- package/dist/database/EntryDatabase.js +31 -10
- package/dist/database/EntryStore.js +1 -11
- package/dist/database/entry/EntryTable.d.ts +5 -3
- package/dist/database/entry/EntryTable.js +25 -8
- package/dist/database/query/Condition.d.ts +4 -1
- package/dist/database/query/Condition.js +16 -5
- package/dist/database/query/EntryQuery.js +59 -7
- package/dist/database/query/Relation.d.ts +13 -1
- package/dist/database/query/Relation.js +19 -1
- package/dist/database/query/Search.d.ts +7 -1
- package/dist/database/query/Search.js +54 -9
- package/dist/database/sync/EntrySyncer.d.ts +2 -0
- package/dist/database/sync/EntrySyncer.js +4 -2
- package/dist/database/sync/Ingest.d.ts +2 -1
- package/dist/database/sync/Ingest.js +20 -6
- package/dist/field/code/CodeField.view.js +12 -12
- package/dist/field/link/EntryLink.d.ts +4 -5
- package/dist/field/link/FileLink.d.ts +2 -2
- package/dist/field/link/ImageLink.d.ts +2 -5
- package/dist/field/link/ImageLink.js +0 -1
- package/dist/field/link/LinkField.view.js +18 -15
- package/dist/field/list/ListField.view.js +50 -35
- package/dist/field/metadata/MetadataField.view.js +14 -14
- package/dist/field/richtext/RichTextBlock.js +39 -35
- package/dist/field/richtext/RichTextExtensions.js +23 -23
- package/dist/field/richtext/RichTextField.view.js +6 -6
- package/dist/field/richtext/RichTextInsertMenu.js +5 -5
- package/dist/field/richtext/RichTextToolbar.js +26 -1
- package/dist/field/richtext/Toolbar.d.ts +9 -1
- package/dist/field/richtext/Toolbar.js +12 -2
- package/dist/field/select/SelectField.view.js +1 -0
- package/dist/index.css +174 -23
- package/dist/index.d.ts +1 -0
- package/dist/index.js +3 -1
- package/dist/next.d.ts +2 -0
- package/dist/next.edge.d.ts +2 -0
- package/dist/picker/entry/EntryPicker.d.ts +3 -1
- package/dist/picker/entry/EntryPicker.js +15 -1
- package/dist/preview/react.js +3 -0
- package/dist/query.d.ts +26 -14
- package/dist/query.js +4 -0
- package/dist/types.d.ts +8 -5
- package/dist/ui/Stack.d.ts +4 -2
- package/docs/ai-setup.md +3 -3
- package/docs/cli.md +4 -2
- package/docs/components/combo-box.md +105 -16
- package/docs/components/date-field.md +1 -1
- package/docs/components/dialog.md +51 -0
- package/docs/components/form.md +67 -0
- package/docs/components/link.md +10 -0
- package/docs/components/multiple-select.md +9 -17
- package/docs/components/number-field.md +5 -1
- package/docs/components/select.md +9 -20
- package/docs/components/stack.md +42 -0
- package/docs/components/table.md +83 -0
- package/docs/components/text-field.md +9 -1
- package/docs/components/time-field.md +5 -1
- package/docs/components.md +39 -1
- package/docs/configuration.md +3 -1
- package/docs/custom-fields.md +135 -7
- package/docs/deploy/self-host.md +2 -0
- package/docs/deploy.md +7 -4
- package/docs/fields/image.md +0 -1
- package/docs/fields/list.md +19 -0
- package/docs/fields/object.md +5 -3
- package/docs/fields/rich-text.md +31 -0
- package/docs/index.md +8 -6
- package/docs/instant-publishing.md +23 -2
- package/docs/overviews.md +128 -4
- package/docs/query/filtering.md +2 -0
- package/docs/query/related.md +58 -9
- package/docs/query.md +52 -1
- package/docs/quickstart.md +5 -5
- package/docs/schema/document.md +2 -0
- package/docs/schema/type.md +3 -1
- package/docs/upgrading.md +100 -19
- package/llms-full.txt +1022 -125
- package/package.json +1 -1
- package/readme.md +2 -2
- package/dist/chunks/{chunk-4ZA6KZHS.js → chunk-6FQ5IMNA.js} +3 -3
|
@@ -36,6 +36,7 @@ import { getType } from "alinea/core/Internal";
|
|
|
36
36
|
import { Type } from "alinea/core/Type";
|
|
37
37
|
import { slugify } from "alinea/core/util/Slugs";
|
|
38
38
|
import { Badge } from "alinea/components";
|
|
39
|
+
import { BlockSettings } from "alinea/dashboard/app/BlockSettings";
|
|
39
40
|
import { BlockSheet, useBlockSheet } from "alinea/dashboard/app/BlockSheet";
|
|
40
41
|
import { NodeEditor } from "alinea/dashboard/app/NodeEditor";
|
|
41
42
|
import { ReactiveNode } from "alinea/dashboard/atoms/ReactiveNode";
|
|
@@ -51,13 +52,13 @@ import { memo, useMemo, useState } from "react";
|
|
|
51
52
|
|
|
52
53
|
// src/field/richtext/RichTextBlock.module.css
|
|
53
54
|
var RichTextBlock_default = {
|
|
55
|
+
"RichTextBlock-anchor": "alinea-RichTextBlock-anchor",
|
|
56
|
+
"RichTextBlockAnchor": "alinea-RichTextBlock-anchor",
|
|
54
57
|
"RichTextBlock": "alinea-RichTextBlock",
|
|
55
|
-
"RichTextBlock-header": "alinea-RichTextBlock-header",
|
|
56
|
-
"RichTextBlockHeader": "alinea-RichTextBlock-header",
|
|
57
58
|
"RichTextBlock-anchor-field": "alinea-RichTextBlock-anchor-field",
|
|
58
59
|
"RichTextBlockAnchorField": "alinea-RichTextBlock-anchor-field",
|
|
59
|
-
"RichTextBlock-
|
|
60
|
-
"
|
|
60
|
+
"RichTextBlock-header": "alinea-RichTextBlock-header",
|
|
61
|
+
"RichTextBlockHeader": "alinea-RichTextBlock-header"
|
|
61
62
|
};
|
|
62
63
|
|
|
63
64
|
// src/field/richtext/RichTextBlock.tsx
|
|
@@ -173,42 +174,45 @@ var RichTextBlock = memo(function RichTextBlock2({
|
|
|
173
174
|
/* @__PURE__ */ jsx(SheetTitle, { children: displayLabel || displayAnchor && `#${displayAnchor}` || label }),
|
|
174
175
|
/* @__PURE__ */ jsx(SheetClose, { "aria-label": "Close block settings" })
|
|
175
176
|
] }),
|
|
176
|
-
/* @__PURE__ */
|
|
177
|
-
/* @__PURE__ */
|
|
178
|
-
|
|
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,
|
|
177
|
+
/* @__PURE__ */ jsxs(SheetBody, { children: [
|
|
178
|
+
/* @__PURE__ */ jsxs(SheetSection, { children: [
|
|
179
|
+
/* @__PURE__ */ jsx(
|
|
180
|
+
TextField,
|
|
189
181
|
{
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
source: customLabel
|
|
182
|
+
label: "Label",
|
|
183
|
+
disabled: readOnly,
|
|
184
|
+
onValueChange: updateCustomLabel,
|
|
185
|
+
value: customLabel
|
|
195
186
|
}
|
|
196
|
-
)
|
|
197
|
-
|
|
198
|
-
/* @__PURE__ */ jsx(
|
|
199
|
-
|
|
187
|
+
),
|
|
188
|
+
/* @__PURE__ */ jsxs("div", { className: styles.RichTextBlock.anchor(), children: [
|
|
189
|
+
/* @__PURE__ */ jsx("div", { className: styles.RichTextBlock.anchor.field(), children: /* @__PURE__ */ jsx(
|
|
190
|
+
SlugField,
|
|
200
191
|
{
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
192
|
+
fieldValue: anchor,
|
|
193
|
+
label: "Anchor",
|
|
194
|
+
isDisabled: readOnly,
|
|
195
|
+
onChange: updateAnchor,
|
|
196
|
+
source: customLabel
|
|
206
197
|
}
|
|
207
|
-
),
|
|
208
|
-
/* @__PURE__ */
|
|
198
|
+
) }),
|
|
199
|
+
link && /* @__PURE__ */ jsxs(Tooltip, { children: [
|
|
200
|
+
/* @__PURE__ */ jsx(
|
|
201
|
+
TooltipTrigger,
|
|
202
|
+
{
|
|
203
|
+
variant: "ghost",
|
|
204
|
+
size: "icon",
|
|
205
|
+
icon: IcRoundLink,
|
|
206
|
+
"aria-label": "Copy link to block",
|
|
207
|
+
onClick: () => navigator.clipboard.writeText(link)
|
|
208
|
+
}
|
|
209
|
+
),
|
|
210
|
+
/* @__PURE__ */ jsx(TooltipContent, { children: "Copy link to block" })
|
|
211
|
+
] })
|
|
209
212
|
] })
|
|
210
|
-
] })
|
|
211
|
-
|
|
213
|
+
] }),
|
|
214
|
+
/* @__PURE__ */ jsx(BlockSettings, { node, type, readOnly })
|
|
215
|
+
] }),
|
|
212
216
|
/* @__PURE__ */ jsx(SheetFooter, { children: /* @__PURE__ */ jsx(
|
|
213
217
|
Button,
|
|
214
218
|
{
|
|
@@ -2972,44 +2972,44 @@ import Small from "./extensions/Small.js";
|
|
|
2972
2972
|
var RichTextExtensions_default = {
|
|
2973
2973
|
"RichTextExtensions-bulletList": "alinea-RichTextExtensions-bulletList",
|
|
2974
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",
|
|
2981
2975
|
"is-level3": "alinea-is-level3",
|
|
2982
2976
|
"isLevel3": "alinea-is-level3",
|
|
2983
|
-
"
|
|
2984
|
-
"
|
|
2985
|
-
"
|
|
2986
|
-
"
|
|
2977
|
+
"is-level1": "alinea-is-level1",
|
|
2978
|
+
"isLevel1": "alinea-is-level1",
|
|
2979
|
+
"is-level6": "alinea-is-level6",
|
|
2980
|
+
"isLevel6": "alinea-is-level6",
|
|
2981
|
+
"RichTextExtensions-tableHeader": "alinea-RichTextExtensions-tableHeader",
|
|
2982
|
+
"RichTextExtensionsTableHeader": "alinea-RichTextExtensions-tableHeader",
|
|
2987
2983
|
"is-level4": "alinea-is-level4",
|
|
2988
2984
|
"isLevel4": "alinea-is-level4",
|
|
2989
|
-
"RichTextExtensions-rule": "alinea-RichTextExtensions-rule",
|
|
2990
|
-
"RichTextExtensionsRule": "alinea-RichTextExtensions-rule",
|
|
2991
2985
|
"is-level5": "alinea-is-level5",
|
|
2992
2986
|
"isLevel5": "alinea-is-level5",
|
|
2987
|
+
"RichTextExtensions-paragraph": "alinea-RichTextExtensions-paragraph",
|
|
2988
|
+
"RichTextExtensionsParagraph": "alinea-RichTextExtensions-paragraph",
|
|
2993
2989
|
"RichTextExtensions-orderedList": "alinea-RichTextExtensions-orderedList",
|
|
2994
2990
|
"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
2991
|
"RichTextExtensions-heading": "alinea-RichTextExtensions-heading",
|
|
3002
2992
|
"RichTextExtensionsHeading": "alinea-RichTextExtensions-heading",
|
|
2993
|
+
"RichTextExtensions-tableCell": "alinea-RichTextExtensions-tableCell",
|
|
2994
|
+
"RichTextExtensionsTableCell": "alinea-RichTextExtensions-tableCell",
|
|
2995
|
+
"RichTextExtensions-blockquote": "alinea-RichTextExtensions-blockquote",
|
|
2996
|
+
"RichTextExtensionsBlockquote": "alinea-RichTextExtensions-blockquote",
|
|
3003
2997
|
"RichTextExtensions-listItem": "alinea-RichTextExtensions-listItem",
|
|
3004
2998
|
"RichTextExtensionsListItem": "alinea-RichTextExtensions-listItem",
|
|
3005
2999
|
"RichTextExtensions-anchor": "alinea-RichTextExtensions-anchor",
|
|
3006
3000
|
"RichTextExtensionsAnchor": "alinea-RichTextExtensions-anchor",
|
|
3007
|
-
"RichTextExtensions-
|
|
3008
|
-
"
|
|
3009
|
-
"RichTextExtensions-
|
|
3010
|
-
"
|
|
3001
|
+
"RichTextExtensions-rule": "alinea-RichTextExtensions-rule",
|
|
3002
|
+
"RichTextExtensionsRule": "alinea-RichTextExtensions-rule",
|
|
3003
|
+
"RichTextExtensions-table": "alinea-RichTextExtensions-table",
|
|
3004
|
+
"RichTextExtensionsTable": "alinea-RichTextExtensions-table",
|
|
3005
|
+
"is-level2": "alinea-is-level2",
|
|
3006
|
+
"isLevel2": "alinea-is-level2",
|
|
3011
3007
|
"RichTextExtensions-highlight": "alinea-RichTextExtensions-highlight",
|
|
3012
|
-
"RichTextExtensionsHighlight": "alinea-RichTextExtensions-highlight"
|
|
3008
|
+
"RichTextExtensionsHighlight": "alinea-RichTextExtensions-highlight",
|
|
3009
|
+
"RichTextExtensions-link": "alinea-RichTextExtensions-link",
|
|
3010
|
+
"RichTextExtensionsLink": "alinea-RichTextExtensions-link",
|
|
3011
|
+
"RichTextExtensions-image": "alinea-RichTextExtensions-image",
|
|
3012
|
+
"RichTextExtensionsImage": "alinea-RichTextExtensions-image"
|
|
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";
|
|
4
1
|
import {
|
|
5
2
|
EditorContent,
|
|
6
3
|
useEditor
|
|
7
4
|
} 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
|
-
"RichTextFieldCompactView": "alinea-RichTextFieldCompactView",
|
|
72
71
|
"RichTextFieldView-empty": "alinea-RichTextFieldView-empty",
|
|
73
72
|
"RichTextFieldViewEmpty": "alinea-RichTextFieldView-empty",
|
|
74
|
-
"RichTextFieldView": "alinea-RichTextFieldView",
|
|
75
73
|
"RichTextFieldView-unsupportedBlock": "alinea-RichTextFieldView-unsupportedBlock",
|
|
76
|
-
"RichTextFieldViewUnsupportedBlock": "alinea-RichTextFieldView-unsupportedBlock"
|
|
74
|
+
"RichTextFieldViewUnsupportedBlock": "alinea-RichTextFieldView-unsupportedBlock",
|
|
75
|
+
"RichTextFieldView": "alinea-RichTextFieldView",
|
|
76
|
+
"RichTextFieldCompactView": "alinea-RichTextFieldCompactView"
|
|
77
77
|
};
|
|
78
78
|
|
|
79
79
|
// src/field/richtext/RichTextField.view.tsx
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import {
|
|
2
|
+
useCurrentEditor
|
|
3
|
+
} from "../../chunks/chunk-NP4M2257.js";
|
|
1
4
|
import {
|
|
2
5
|
CellSelection,
|
|
3
6
|
FloatingMenuPlugin,
|
|
@@ -11,9 +14,6 @@ import {
|
|
|
11
14
|
shift,
|
|
12
15
|
size
|
|
13
16
|
} from "../../chunks/chunk-PAYSVIYI.js";
|
|
14
|
-
import {
|
|
15
|
-
useCurrentEditor
|
|
16
|
-
} from "../../chunks/chunk-NP4M2257.js";
|
|
17
17
|
import {
|
|
18
18
|
Extension,
|
|
19
19
|
NodeSelection,
|
|
@@ -744,9 +744,9 @@ import { useMemo, useState as useState2 } from "react";
|
|
|
744
744
|
|
|
745
745
|
// src/field/richtext/RichTextInsertMenu.module.css
|
|
746
746
|
var RichTextInsertMenu_default = {
|
|
747
|
+
"RichTextInsertMenu": "alinea-RichTextInsertMenu",
|
|
747
748
|
"RichTextInsertMenu-popover": "alinea-RichTextInsertMenu-popover",
|
|
748
|
-
"RichTextInsertMenuPopover": "alinea-RichTextInsertMenu-popover"
|
|
749
|
-
"RichTextInsertMenu": "alinea-RichTextInsertMenu"
|
|
749
|
+
"RichTextInsertMenuPopover": "alinea-RichTextInsertMenu-popover"
|
|
750
750
|
};
|
|
751
751
|
|
|
752
752
|
// src/field/richtext/RichTextInsertMenu.tsx
|
|
@@ -11,6 +11,7 @@ import "../../chunks/chunk-CQ52GEHY.js";
|
|
|
11
11
|
// src/field/richtext/RichTextToolbar.tsx
|
|
12
12
|
import {
|
|
13
13
|
DropdownMenu,
|
|
14
|
+
DropdownMenuCheckboxItem,
|
|
14
15
|
DropdownMenuContent,
|
|
15
16
|
DropdownMenuItem,
|
|
16
17
|
DropdownMenuSeparator,
|
|
@@ -159,7 +160,16 @@ function renderEntry(name, entry, context, menu, ownerId) {
|
|
|
159
160
|
)
|
|
160
161
|
] }, name);
|
|
161
162
|
return /* @__PURE__ */ jsxs(DropdownMenu, { children: [
|
|
162
|
-
/* @__PURE__ */ jsx(
|
|
163
|
+
/* @__PURE__ */ jsx(
|
|
164
|
+
DropdownMenuTrigger,
|
|
165
|
+
{
|
|
166
|
+
variant: "ghost",
|
|
167
|
+
icon,
|
|
168
|
+
"aria-label": label2 ? void 0 : ariaLabel,
|
|
169
|
+
active: entry.active?.(context),
|
|
170
|
+
children: label2
|
|
171
|
+
}
|
|
172
|
+
),
|
|
163
173
|
/* @__PURE__ */ jsx(
|
|
164
174
|
DropdownMenuContent,
|
|
165
175
|
{
|
|
@@ -179,6 +189,21 @@ function renderEntry(name, entry, context, menu, ownerId) {
|
|
|
179
189
|
}
|
|
180
190
|
const label = resolve(entry.label, context);
|
|
181
191
|
const title = entry.title ?? text(label) ?? humanize(name);
|
|
192
|
+
if (menu && entry.active) {
|
|
193
|
+
return /* @__PURE__ */ jsx(
|
|
194
|
+
DropdownMenuCheckboxItem,
|
|
195
|
+
{
|
|
196
|
+
icon: entry.icon?.(context),
|
|
197
|
+
textValue: title,
|
|
198
|
+
disabled: entry.disabled?.(context),
|
|
199
|
+
checked: entry.active(context),
|
|
200
|
+
onCheckedChange: () => entry.onSelect(context),
|
|
201
|
+
closeOnSelect: true,
|
|
202
|
+
children: label ?? title
|
|
203
|
+
},
|
|
204
|
+
name
|
|
205
|
+
);
|
|
206
|
+
}
|
|
182
207
|
if (menu) {
|
|
183
208
|
return /* @__PURE__ */ jsx(
|
|
184
209
|
DropdownMenuItem,
|
|
@@ -17,6 +17,8 @@ export interface ToolbarButton {
|
|
|
17
17
|
export interface ToolbarMenu {
|
|
18
18
|
icon?: (ctx: RichTextToolbarContext) => IconType;
|
|
19
19
|
label?: ReactNode | ((ctx: RichTextToolbarContext) => ReactNode);
|
|
20
|
+
/** Marks the menu trigger, eg. while a value other than the default applies */
|
|
21
|
+
active?: (ctx: RichTextToolbarContext) => boolean;
|
|
20
22
|
items: ToolbarConfig | ((ctx: RichTextToolbarContext) => ToolbarConfig);
|
|
21
23
|
}
|
|
22
24
|
export interface ToolbarGroup {
|
|
@@ -41,6 +43,7 @@ export interface RichTextToolbarContext {
|
|
|
41
43
|
export declare const headings: {
|
|
42
44
|
icon: () => import("react").JSX.Element;
|
|
43
45
|
label({ editor }: RichTextToolbarContext): string;
|
|
46
|
+
active: ({ editor }: RichTextToolbarContext) => boolean;
|
|
44
47
|
items: {
|
|
45
48
|
styles: {
|
|
46
49
|
group: {
|
|
@@ -50,22 +53,27 @@ export declare const headings: {
|
|
|
50
53
|
};
|
|
51
54
|
h1: {
|
|
52
55
|
label: () => import("react").JSX.Element;
|
|
56
|
+
active: ({ editor }: RichTextToolbarContext) => boolean;
|
|
53
57
|
onSelect: ({ exec }: RichTextToolbarContext) => boolean;
|
|
54
58
|
};
|
|
55
59
|
h2: {
|
|
56
60
|
label: () => import("react").JSX.Element;
|
|
61
|
+
active: ({ editor }: RichTextToolbarContext) => boolean;
|
|
57
62
|
onSelect: ({ exec }: RichTextToolbarContext) => boolean;
|
|
58
63
|
};
|
|
59
64
|
h3: {
|
|
60
65
|
label: () => import("react").JSX.Element;
|
|
66
|
+
active: ({ editor }: RichTextToolbarContext) => boolean;
|
|
61
67
|
onSelect: ({ exec }: RichTextToolbarContext) => boolean;
|
|
62
68
|
};
|
|
63
69
|
h4: {
|
|
64
70
|
label: () => import("react").JSX.Element;
|
|
71
|
+
active: ({ editor }: RichTextToolbarContext) => boolean;
|
|
65
72
|
onSelect: ({ exec }: RichTextToolbarContext) => boolean;
|
|
66
73
|
};
|
|
67
74
|
h5: {
|
|
68
75
|
label: () => import("react").JSX.Element;
|
|
76
|
+
active: ({ editor }: RichTextToolbarContext) => boolean;
|
|
69
77
|
onSelect: ({ exec }: RichTextToolbarContext) => boolean;
|
|
70
78
|
};
|
|
71
79
|
};
|
|
@@ -130,11 +138,11 @@ export declare const formatting: {
|
|
|
130
138
|
};
|
|
131
139
|
export declare const alignment: {
|
|
132
140
|
icon({ editor }: RichTextToolbarContext): import("react").JSX.Element;
|
|
141
|
+
active: ({ editor }: RichTextToolbarContext) => boolean;
|
|
133
142
|
items: {
|
|
134
143
|
left: {
|
|
135
144
|
icon: () => import("react").JSX.Element;
|
|
136
145
|
label: string;
|
|
137
|
-
active: ({ editor }: RichTextToolbarContext) => boolean;
|
|
138
146
|
onSelect: ({ exec }: RichTextToolbarContext) => boolean;
|
|
139
147
|
};
|
|
140
148
|
center: {
|
|
@@ -45,14 +45,16 @@ var styleLabels = {
|
|
|
45
45
|
h4: "Heading 4",
|
|
46
46
|
h5: "Heading 5"
|
|
47
47
|
};
|
|
48
|
+
var headingLevels = [1, 2, 3, 4, 5];
|
|
48
49
|
var headings = {
|
|
49
50
|
icon: () => /* @__PURE__ */ jsx(IcRoundUnfoldMore, {}),
|
|
50
51
|
label({ editor }) {
|
|
51
|
-
const level =
|
|
52
|
+
const level = headingLevels.find(
|
|
52
53
|
(level2) => editor.isActive("heading", { level: level2 })
|
|
53
54
|
);
|
|
54
55
|
return level ? styleLabels[`h${level}`] : styleLabels.paragraph;
|
|
55
56
|
},
|
|
57
|
+
active: ({ editor }) => editor.isActive("heading"),
|
|
56
58
|
items: {
|
|
57
59
|
styles: {
|
|
58
60
|
group: {
|
|
@@ -62,22 +64,27 @@ var headings = {
|
|
|
62
64
|
},
|
|
63
65
|
h1: {
|
|
64
66
|
label: () => /* @__PURE__ */ jsx("h1", { children: "Heading 1" }),
|
|
67
|
+
active: ({ editor }) => editor.isActive("heading", { level: 1 }),
|
|
65
68
|
onSelect: ({ exec }) => exec().setHeading({ level: 1 }).run()
|
|
66
69
|
},
|
|
67
70
|
h2: {
|
|
68
71
|
label: () => /* @__PURE__ */ jsx("h2", { children: "Heading 2" }),
|
|
72
|
+
active: ({ editor }) => editor.isActive("heading", { level: 2 }),
|
|
69
73
|
onSelect: ({ exec }) => exec().setHeading({ level: 2 }).run()
|
|
70
74
|
},
|
|
71
75
|
h3: {
|
|
72
76
|
label: () => /* @__PURE__ */ jsx("h3", { children: "Heading 3" }),
|
|
77
|
+
active: ({ editor }) => editor.isActive("heading", { level: 3 }),
|
|
73
78
|
onSelect: ({ exec }) => exec().setHeading({ level: 3 }).run()
|
|
74
79
|
},
|
|
75
80
|
h4: {
|
|
76
81
|
label: () => /* @__PURE__ */ jsx("h4", { children: "Heading 4" }),
|
|
82
|
+
active: ({ editor }) => editor.isActive("heading", { level: 4 }),
|
|
77
83
|
onSelect: ({ exec }) => exec().setHeading({ level: 4 }).run()
|
|
78
84
|
},
|
|
79
85
|
h5: {
|
|
80
86
|
label: () => /* @__PURE__ */ jsx("h5", { children: "Heading 5" }),
|
|
87
|
+
active: ({ editor }) => editor.isActive("heading", { level: 5 }),
|
|
81
88
|
onSelect: ({ exec }) => exec().setHeading({ level: 5 }).run()
|
|
82
89
|
}
|
|
83
90
|
}
|
|
@@ -233,11 +240,14 @@ var alignment = {
|
|
|
233
240
|
if (editor.isActive({ textAlign: "justify" })) return /* @__PURE__ */ jsx(IcAlignJustify, {});
|
|
234
241
|
return /* @__PURE__ */ jsx(IcAlignLeft, {});
|
|
235
242
|
},
|
|
243
|
+
// Left is the default alignment, it needs no active state
|
|
244
|
+
active: ({ editor }) => ["center", "right", "justify"].some(
|
|
245
|
+
(textAlign) => editor.isActive({ textAlign })
|
|
246
|
+
),
|
|
236
247
|
items: {
|
|
237
248
|
left: {
|
|
238
249
|
icon: () => /* @__PURE__ */ jsx(IcAlignLeft, {}),
|
|
239
250
|
label: "Left",
|
|
240
|
-
active: ({ editor }) => editor.isActive({ textAlign: "left" }),
|
|
241
251
|
onSelect: ({ exec }) => exec().setTextAlign("left").run()
|
|
242
252
|
},
|
|
243
253
|
center: {
|
|
@@ -20,6 +20,7 @@ function SelectFieldView({ field }) {
|
|
|
20
20
|
error,
|
|
21
21
|
disabled: options.readOnly,
|
|
22
22
|
required: options.required,
|
|
23
|
+
clearable: !options.required,
|
|
23
24
|
"aria-label": options.inline ? options.label : void 0,
|
|
24
25
|
label: options.inline ? void 0 : options.label,
|
|
25
26
|
shared: options.shared,
|