@namroodinc/liquid-editorial 0.14.0 → 0.16.0
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/README.md +283 -12
- package/UPGRADING.md +106 -0
- package/dist/chunks/{Avatar-Dw7EWd_-.cjs → Avatar-BZGFSE6C.cjs} +2 -2
- package/dist/chunks/{Avatar-Dw7EWd_-.cjs.map → Avatar-BZGFSE6C.cjs.map} +1 -1
- package/dist/chunks/{Avatar-BToMaTdL.js → Avatar-C4W-g8nU.js} +2 -2
- package/dist/chunks/{Avatar-BToMaTdL.js.map → Avatar-C4W-g8nU.js.map} +1 -1
- package/dist/chunks/{Board-XeDG9nWP.js → Board-Cbi5FMW-.js} +2 -2
- package/dist/chunks/{Board-XeDG9nWP.js.map → Board-Cbi5FMW-.js.map} +1 -1
- package/dist/chunks/{Board-DeXtaWNO.cjs → Board-_agEjTy8.cjs} +2 -2
- package/dist/chunks/{Board-DeXtaWNO.cjs.map → Board-_agEjTy8.cjs.map} +1 -1
- package/dist/chunks/{CollectionView-Dbg4d_tA.cjs → CollectionView-BfX2Lxre.cjs} +2 -2
- package/dist/chunks/{CollectionView-Dbg4d_tA.cjs.map → CollectionView-BfX2Lxre.cjs.map} +1 -1
- package/dist/chunks/{CollectionView-C0_bTO2v.js → CollectionView-DPJGtSP5.js} +2 -2
- package/dist/chunks/{CollectionView-C0_bTO2v.js.map → CollectionView-DPJGtSP5.js.map} +1 -1
- package/dist/chunks/{ColourField-DAFzOIOq.cjs → ColourField-BVGnW8Wh.cjs} +2 -2
- package/dist/chunks/{ColourField-DAFzOIOq.cjs.map → ColourField-BVGnW8Wh.cjs.map} +1 -1
- package/dist/chunks/{ColourField-Bb8H87fg.js → ColourField-BcuARZY4.js} +6 -6
- package/dist/chunks/{ColourField-Bb8H87fg.js.map → ColourField-BcuARZY4.js.map} +1 -1
- package/dist/chunks/{DatePicker-COm1giw8.js → DatePicker-VQUsbYdo.js} +3 -3
- package/dist/chunks/{DatePicker-COm1giw8.js.map → DatePicker-VQUsbYdo.js.map} +1 -1
- package/dist/chunks/{DatePicker-DOg3iQYy.cjs → DatePicker-zA0bWVBp.cjs} +2 -2
- package/dist/chunks/{DatePicker-DOg3iQYy.cjs.map → DatePicker-zA0bWVBp.cjs.map} +1 -1
- package/dist/chunks/{Drawer-nUTJtwX_.js → Drawer-2cf0SaG4.js} +3 -3
- package/dist/chunks/{Drawer-nUTJtwX_.js.map → Drawer-2cf0SaG4.js.map} +1 -1
- package/dist/chunks/{Drawer-B2dcTh5l.cjs → Drawer-BzvSfkCL.cjs} +2 -2
- package/dist/chunks/{Drawer-B2dcTh5l.cjs.map → Drawer-BzvSfkCL.cjs.map} +1 -1
- package/dist/chunks/EntryPicker-C7EBfpaw.cjs +2 -0
- package/dist/chunks/EntryPicker-C7EBfpaw.cjs.map +1 -0
- package/dist/chunks/{EntryPicker-Ie9T47hA.js → EntryPicker-DBnDsgzi.js} +397 -397
- package/dist/chunks/EntryPicker-DBnDsgzi.js.map +1 -0
- package/dist/chunks/FormEditor-BG8bOXI8.js +35 -0
- package/dist/chunks/FormEditor-BG8bOXI8.js.map +1 -0
- package/dist/chunks/FormEditor-BJN0QuLI.cjs +2 -0
- package/dist/chunks/FormEditor-BJN0QuLI.cjs.map +1 -0
- package/dist/chunks/Icon-QLZH31JA.cjs +2 -0
- package/dist/chunks/Icon-QLZH31JA.cjs.map +1 -0
- package/dist/chunks/Icon-kLLQC54Z.js +107 -0
- package/dist/chunks/Icon-kLLQC54Z.js.map +1 -0
- package/dist/chunks/{Message-VJTPhId7.js → Message-DM6pTq7N.js} +2 -2
- package/dist/chunks/{Message-VJTPhId7.js.map → Message-DM6pTq7N.js.map} +1 -1
- package/dist/chunks/{Message-B0A5bz8V.cjs → Message-yZJDVzb8.cjs} +2 -2
- package/dist/chunks/{Message-B0A5bz8V.cjs.map → Message-yZJDVzb8.cjs.map} +1 -1
- package/dist/chunks/{NumberField-C90eJGny.js → NumberField-CVsK4l9P.js} +13 -13
- package/dist/chunks/{NumberField-C90eJGny.js.map → NumberField-CVsK4l9P.js.map} +1 -1
- package/dist/chunks/{NumberField-BrWFmPkW.cjs → NumberField-Ccjpa_1d.cjs} +2 -2
- package/dist/chunks/{NumberField-BrWFmPkW.cjs.map → NumberField-Ccjpa_1d.cjs.map} +1 -1
- package/dist/chunks/RichTextEditor-D4rNww9d.cjs +2 -0
- package/dist/chunks/RichTextEditor-D4rNww9d.cjs.map +1 -0
- package/dist/chunks/RichTextEditor-DSxiMLVd.js +2832 -0
- package/dist/chunks/RichTextEditor-DSxiMLVd.js.map +1 -0
- package/dist/chunks/dialogLabel-Dx-WEEzI.cjs +2 -0
- package/dist/chunks/dialogLabel-Dx-WEEzI.cjs.map +1 -0
- package/dist/chunks/dialogLabel-nB1gwKz0.js +157 -0
- package/dist/chunks/dialogLabel-nB1gwKz0.js.map +1 -0
- package/dist/chunks/overlayLayer-CPd3zj_u.cjs +2 -0
- package/dist/chunks/overlayLayer-CPd3zj_u.cjs.map +1 -0
- package/dist/chunks/overlayLayer-Dv1vmfaI.js +199 -0
- package/dist/chunks/overlayLayer-Dv1vmfaI.js.map +1 -0
- package/dist/chunks/{useTooltip-Du8PutGX.js → useTooltip-COyAcujL.js} +2 -2
- package/dist/chunks/{useTooltip-Du8PutGX.js.map → useTooltip-COyAcujL.js.map} +1 -1
- package/dist/chunks/{useTooltip-ekdwMJFz.cjs → useTooltip-nEDN0ObI.cjs} +2 -2
- package/dist/chunks/{useTooltip-ekdwMJFz.cjs.map → useTooltip-nEDN0ObI.cjs.map} +1 -1
- package/dist/components/AppShell/index.cjs +1 -1
- package/dist/components/AppShell/index.js +1 -1
- package/dist/components/AssetCard/index.cjs +1 -1
- package/dist/components/AssetCard/index.js +1 -1
- package/dist/components/AssetGrid/index.cjs +1 -1
- package/dist/components/AssetGrid/index.js +1 -1
- package/dist/components/Avatar/index.cjs +1 -1
- package/dist/components/Avatar/index.js +1 -1
- package/dist/components/Banner/index.cjs +1 -1
- package/dist/components/Banner/index.js +1 -1
- package/dist/components/Board/index.cjs +1 -1
- package/dist/components/Board/index.js +1 -1
- package/dist/components/Button/index.cjs +1 -1
- package/dist/components/Button/index.js +1 -1
- package/dist/components/Choice/index.cjs +1 -1
- package/dist/components/Choice/index.cjs.map +1 -1
- package/dist/components/Choice/index.js +5 -5
- package/dist/components/CollectionView/index.cjs +1 -1
- package/dist/components/CollectionView/index.js +1 -1
- package/dist/components/ColourField/index.cjs +1 -1
- package/dist/components/ColourField/index.js +1 -1
- package/dist/components/DatePicker/index.cjs +1 -1
- package/dist/components/DatePicker/index.js +1 -1
- package/dist/components/Drawer/index.cjs +1 -1
- package/dist/components/Drawer/index.js +1 -1
- package/dist/components/EditLayout/index.cjs +1 -1
- package/dist/components/EditLayout/index.cjs.map +1 -1
- package/dist/components/EditLayout/index.js +6 -7
- package/dist/components/EditLayout/index.js.map +1 -1
- package/dist/components/EntryPicker/index.cjs +1 -1
- package/dist/components/EntryPicker/index.js +1 -1
- package/dist/components/EntryPicker/style.css +1 -1
- package/dist/components/FormEditor/README.md +205 -178
- package/dist/components/FormEditor/control.d.cts +4 -4
- package/dist/components/FormEditor/control.d.cts.map +1 -1
- package/dist/components/FormEditor/control.d.ts +4 -4
- package/dist/components/FormEditor/control.d.ts.map +1 -1
- package/dist/components/FormEditor/form.d.cts +3 -3
- package/dist/components/FormEditor/form.d.cts.map +1 -1
- package/dist/components/FormEditor/form.d.ts +3 -3
- package/dist/components/FormEditor/form.d.ts.map +1 -1
- package/dist/components/FormEditor/index.cjs +1 -1
- package/dist/components/FormEditor/index.js +2 -2
- package/dist/components/FormEditor/model.d.cts +2 -0
- package/dist/components/FormEditor/model.d.cts.map +1 -1
- package/dist/components/FormEditor/model.d.ts +2 -0
- package/dist/components/FormEditor/model.d.ts.map +1 -1
- package/dist/components/FormEditor/rich-text-control.d.cts +1 -2
- package/dist/components/FormEditor/rich-text-control.d.cts.map +1 -1
- package/dist/components/FormEditor/rich-text-control.d.ts +1 -2
- package/dist/components/FormEditor/rich-text-control.d.ts.map +1 -1
- package/dist/components/Icon/icons.d.cts +5 -0
- package/dist/components/Icon/icons.d.cts.map +1 -1
- package/dist/components/Icon/icons.d.ts +5 -0
- package/dist/components/Icon/icons.d.ts.map +1 -1
- package/dist/components/Icon/index.cjs +1 -1
- package/dist/components/Icon/index.js +1 -1
- package/dist/components/ImageCropper/index.cjs +1 -1
- package/dist/components/ImageCropper/index.cjs.map +1 -1
- package/dist/components/ImageCropper/index.js +6 -6
- package/dist/components/Menu/index.cjs +1 -1
- package/dist/components/Menu/index.js +9 -9
- package/dist/components/Menu/index.js.map +1 -1
- package/dist/components/Modal/index.cjs +1 -1
- package/dist/components/Modal/index.js +2 -2
- package/dist/components/NumberField/index.cjs +1 -1
- package/dist/components/NumberField/index.js +1 -1
- package/dist/components/Popover/index.cjs +1 -1
- package/dist/components/Popover/index.cjs.map +1 -1
- package/dist/components/Popover/index.d.cts.map +1 -1
- package/dist/components/Popover/index.d.ts.map +1 -1
- package/dist/components/Popover/index.js +67 -64
- package/dist/components/Popover/index.js.map +1 -1
- package/dist/components/RichTextEditor/block-plugins.d.cts +62 -0
- package/dist/components/RichTextEditor/block-plugins.d.cts.map +1 -0
- package/dist/components/RichTextEditor/block-plugins.d.ts +62 -0
- package/dist/components/RichTextEditor/block-plugins.d.ts.map +1 -0
- package/dist/components/RichTextEditor/content-block-frame.d.cts +32 -0
- package/dist/components/RichTextEditor/content-block-frame.d.cts.map +1 -0
- package/dist/components/RichTextEditor/content-block-frame.d.ts +32 -0
- package/dist/components/RichTextEditor/content-block-frame.d.ts.map +1 -0
- package/dist/components/RichTextEditor/content-block-view.d.cts +3 -0
- package/dist/components/RichTextEditor/content-block-view.d.cts.map +1 -0
- package/dist/components/RichTextEditor/content-block-view.d.ts +3 -0
- package/dist/components/RichTextEditor/content-block-view.d.ts.map +1 -0
- package/dist/components/RichTextEditor/content-block.d.cts +10 -0
- package/dist/components/RichTextEditor/content-block.d.cts.map +1 -0
- package/dist/components/RichTextEditor/content-block.d.ts +10 -0
- package/dist/components/RichTextEditor/content-block.d.ts.map +1 -0
- package/dist/components/RichTextEditor/document.d.cts +24 -8
- package/dist/components/RichTextEditor/document.d.cts.map +1 -1
- package/dist/components/RichTextEditor/document.d.ts +24 -8
- package/dist/components/RichTextEditor/document.d.ts.map +1 -1
- package/dist/components/RichTextEditor/index.cjs +1 -1
- package/dist/components/RichTextEditor/index.d.cts +6 -4
- package/dist/components/RichTextEditor/index.d.cts.map +1 -1
- package/dist/components/RichTextEditor/index.d.ts +6 -4
- package/dist/components/RichTextEditor/index.d.ts.map +1 -1
- package/dist/components/RichTextEditor/index.js +1 -1
- package/dist/components/RichTextEditor/picker-block.d.cts +25 -0
- package/dist/components/RichTextEditor/picker-block.d.cts.map +1 -0
- package/dist/components/RichTextEditor/picker-block.d.ts +25 -0
- package/dist/components/RichTextEditor/picker-block.d.ts.map +1 -0
- package/dist/components/RichTextEditor/style.css +126 -49
- package/dist/components/RichTextEditor/table-actions.d.cts +11 -0
- package/dist/components/RichTextEditor/table-actions.d.cts.map +1 -0
- package/dist/components/RichTextEditor/table-actions.d.ts +11 -0
- package/dist/components/RichTextEditor/table-actions.d.ts.map +1 -0
- package/dist/components/RichTextEditor/table-bands.d.cts +19 -0
- package/dist/components/RichTextEditor/table-bands.d.cts.map +1 -0
- package/dist/components/RichTextEditor/table-bands.d.ts +19 -0
- package/dist/components/RichTextEditor/table-bands.d.ts.map +1 -0
- package/dist/components/RichTextEditor/table-view.d.cts +4 -0
- package/dist/components/RichTextEditor/table-view.d.cts.map +1 -0
- package/dist/components/RichTextEditor/table-view.d.ts +4 -0
- package/dist/components/RichTextEditor/table-view.d.ts.map +1 -0
- package/dist/components/RichTextEditor/tables.d.cts.map +1 -1
- package/dist/components/RichTextEditor/tables.d.ts.map +1 -1
- package/dist/components/RichTextEditor/use-blocks.d.cts +19 -0
- package/dist/components/RichTextEditor/use-blocks.d.cts.map +1 -0
- package/dist/components/RichTextEditor/use-blocks.d.ts +19 -0
- package/dist/components/RichTextEditor/use-blocks.d.ts.map +1 -0
- package/dist/components/SearchField/index.cjs +1 -1
- package/dist/components/SearchField/index.js +1 -1
- package/dist/components/Select/index.cjs +1 -1
- package/dist/components/Select/index.js +2 -2
- package/dist/components/SelectionCard/index.cjs +1 -1
- package/dist/components/SelectionCard/index.cjs.map +1 -1
- package/dist/components/SelectionCard/index.js +4 -4
- package/dist/components/SelectionCard/index.js.map +1 -1
- package/dist/components/SideNav/index.cjs +1 -1
- package/dist/components/SideNav/index.js +1 -1
- package/dist/components/SortableList/index.cjs +1 -1
- package/dist/components/SortableList/index.js +1 -1
- package/dist/components/Stepper/index.cjs +1 -1
- package/dist/components/Stepper/index.js +1 -1
- package/dist/components/SubNav/index.cjs +1 -1
- package/dist/components/SubNav/index.js +1 -1
- package/dist/components/Switch/style.css +2 -6
- package/dist/components/Table/index.cjs +1 -1
- package/dist/components/Table/index.js +1 -1
- package/dist/components/Time/index.cjs +1 -1
- package/dist/components/Time/index.js +1 -1
- package/dist/components/Toast/index.cjs +1 -1
- package/dist/components/Toast/index.js +1 -1
- package/dist/components/TopNav/index.cjs +1 -1
- package/dist/components/TopNav/index.js +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +2 -2
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +49 -49
- package/dist/internal/useStableValue.d.cts +8 -0
- package/dist/internal/useStableValue.d.cts.map +1 -0
- package/dist/internal/useStableValue.d.ts +8 -0
- package/dist/internal/useStableValue.d.ts.map +1 -0
- package/dist/rich-text-blocks.cjs +2 -0
- package/dist/rich-text-blocks.cjs.map +1 -0
- package/dist/rich-text-blocks.d.cts +20 -0
- package/dist/rich-text-blocks.d.cts.map +1 -0
- package/dist/rich-text-blocks.d.ts +20 -0
- package/dist/rich-text-blocks.d.ts.map +1 -0
- package/dist/rich-text-blocks.js +36 -0
- package/dist/rich-text-blocks.js.map +1 -0
- package/package.json +14 -1
- package/dist/chunks/EntryPicker-BwEYRtQl.cjs +0 -2
- package/dist/chunks/EntryPicker-BwEYRtQl.cjs.map +0 -1
- package/dist/chunks/EntryPicker-Ie9T47hA.js.map +0 -1
- package/dist/chunks/FormEditor-D1HUnjMI.cjs +0 -2
- package/dist/chunks/FormEditor-D1HUnjMI.cjs.map +0 -1
- package/dist/chunks/FormEditor-DgDV5aeR.js +0 -30
- package/dist/chunks/FormEditor-DgDV5aeR.js.map +0 -1
- package/dist/chunks/Icon-Bxvp1-td.js +0 -102
- package/dist/chunks/Icon-Bxvp1-td.js.map +0 -1
- package/dist/chunks/Icon-CnnTrtNb.cjs +0 -2
- package/dist/chunks/Icon-CnnTrtNb.cjs.map +0 -1
- package/dist/chunks/RichTextEditor-DPhEkDxi.js +0 -2108
- package/dist/chunks/RichTextEditor-DPhEkDxi.js.map +0 -1
- package/dist/chunks/RichTextEditor-DV7NZp_k.cjs +0 -2
- package/dist/chunks/RichTextEditor-DV7NZp_k.cjs.map +0 -1
- package/dist/chunks/dialogLabel-C153NosD.js +0 -176
- package/dist/chunks/dialogLabel-C153NosD.js.map +0 -1
- package/dist/chunks/dialogLabel-CNNQbtob.cjs +0 -2
- package/dist/chunks/dialogLabel-CNNQbtob.cjs.map +0 -1
- package/dist/chunks/overlayLayer-CtOTt1xB.cjs +0 -2
- package/dist/chunks/overlayLayer-CtOTt1xB.cjs.map +0 -1
- package/dist/chunks/overlayLayer-Og07sIyl.js +0 -180
- package/dist/chunks/overlayLayer-Og07sIyl.js.map +0 -1
- package/dist/components/RichTextEditor/embed-context.d.cts +0 -41
- package/dist/components/RichTextEditor/embed-context.d.cts.map +0 -1
- package/dist/components/RichTextEditor/embed-context.d.ts +0 -41
- package/dist/components/RichTextEditor/embed-context.d.ts.map +0 -1
- package/dist/components/RichTextEditor/embed-types.d.cts +0 -29
- package/dist/components/RichTextEditor/embed-types.d.cts.map +0 -1
- package/dist/components/RichTextEditor/embed-types.d.ts +0 -29
- package/dist/components/RichTextEditor/embed-types.d.ts.map +0 -1
- package/dist/components/RichTextEditor/storyblock-view.d.cts +0 -3
- package/dist/components/RichTextEditor/storyblock-view.d.cts.map +0 -1
- package/dist/components/RichTextEditor/storyblock-view.d.ts +0 -3
- package/dist/components/RichTextEditor/storyblock-view.d.ts.map +0 -1
- package/dist/components/RichTextEditor/storyblock.d.cts +0 -19
- package/dist/components/RichTextEditor/storyblock.d.cts.map +0 -1
- package/dist/components/RichTextEditor/storyblock.d.ts +0 -19
- package/dist/components/RichTextEditor/storyblock.d.ts.map +0 -1
- package/dist/components/RichTextEditor/use-embeds.d.cts +0 -31
- package/dist/components/RichTextEditor/use-embeds.d.cts.map +0 -1
- package/dist/components/RichTextEditor/use-embeds.d.ts +0 -31
- package/dist/components/RichTextEditor/use-embeds.d.ts.map +0 -1
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { type ReactNode } from "react";
|
|
2
|
+
import type { BlockData, ContentBlockDefinition } from "../../rich-text-blocks.js";
|
|
3
|
+
import type { IconName } from "../Icon/icons.js";
|
|
4
|
+
import type { SeedCopy } from "../EntryPicker/use-selected-items.js";
|
|
5
|
+
export type ContentBlockMode = "insert" | "edit" | "replace";
|
|
6
|
+
export interface ContentBlockTarget {
|
|
7
|
+
available: () => boolean;
|
|
8
|
+
/** Insert one or more blocks, or update one existing block in place. */
|
|
9
|
+
commit: (data: BlockData | readonly BlockData[]) => boolean;
|
|
10
|
+
close: () => void;
|
|
11
|
+
}
|
|
12
|
+
export interface ContentBlockSession {
|
|
13
|
+
mode: ContentBlockMode;
|
|
14
|
+
data?: BlockData;
|
|
15
|
+
target: ContentBlockTarget;
|
|
16
|
+
isDisabled: boolean;
|
|
17
|
+
fieldLabel: string;
|
|
18
|
+
}
|
|
19
|
+
export interface ContentBlockPreview {
|
|
20
|
+
title?: string;
|
|
21
|
+
body?: ReactNode;
|
|
22
|
+
tone?: "draft" | "removed";
|
|
23
|
+
missing?: boolean;
|
|
24
|
+
/** Open a resource editor without changing the referring block. */
|
|
25
|
+
onEdit?: () => void;
|
|
26
|
+
replaceLabel?: string;
|
|
27
|
+
}
|
|
28
|
+
export interface ContentBlockPlugin {
|
|
29
|
+
definition: ContentBlockDefinition;
|
|
30
|
+
label: string;
|
|
31
|
+
icon: IconName;
|
|
32
|
+
insertLabel?: string;
|
|
33
|
+
editLabel?: string;
|
|
34
|
+
replaceLabel?: string;
|
|
35
|
+
isCreating?: boolean;
|
|
36
|
+
isDialogHidden?: boolean;
|
|
37
|
+
/** Render a component for stateful previews and call frame with its current content. */
|
|
38
|
+
renderPreview?: (data: BlockData, frame: (preview: ContentBlockPreview) => ReactNode) => ReactNode;
|
|
39
|
+
renderEditor?: (session: ContentBlockSession) => ReactNode;
|
|
40
|
+
}
|
|
41
|
+
export declare const noBlockPlugins: readonly ContentBlockPlugin[];
|
|
42
|
+
/**
|
|
43
|
+
* Values a library plug-in's previews read beyond its own fields. Such a
|
|
44
|
+
* plug-in reads its callbacks from the latest registration when it calls them,
|
|
45
|
+
* so blocks need to render again only when one of these values or one of its
|
|
46
|
+
* fields changes. Other plug-ins render again whenever their object changes.
|
|
47
|
+
*/
|
|
48
|
+
export declare const previewDependencies: WeakMap<ContentBlockPlugin, readonly unknown[]>;
|
|
49
|
+
export declare function samePlugins(previous: ReadonlyMap<string, ContentBlockPlugin>, next: ReadonlyMap<string, ContentBlockPlugin>): boolean;
|
|
50
|
+
export declare const BlockContext: import("react").Context<{
|
|
51
|
+
/** The registrations blocks render; it changes only when a block's rendering would. */
|
|
52
|
+
plugins: ReadonlyMap<string, ContentBlockPlugin>;
|
|
53
|
+
/** The latest registration of `kind`, for callbacks: stable, and current once committed. */
|
|
54
|
+
latest: (kind: string) => ContentBlockPlugin | undefined;
|
|
55
|
+
/** Items a picker just committed, by block type and item ID, until their blocks show them. */
|
|
56
|
+
picks: Map<string, SeedCopy>;
|
|
57
|
+
disabled: boolean;
|
|
58
|
+
busy: boolean;
|
|
59
|
+
revision: number;
|
|
60
|
+
open: (kind: string, mode: ContentBlockMode, position?: number) => void;
|
|
61
|
+
}>;
|
|
62
|
+
//# sourceMappingURL=block-plugins.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"block-plugins.d.ts","sourceRoot":"","sources":["../../../src/components/RichTextEditor/block-plugins.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiB,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AACtD,OAAO,KAAK,EAAE,SAAS,EAAE,sBAAsB,EAAE,MAAM,wBAAwB,CAAC;AAChF,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAC9C,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,mCAAmC,CAAC;AAGlE,MAAM,MAAM,gBAAgB,GAAG,QAAQ,GAAG,MAAM,GAAG,SAAS,CAAC;AAE7D,MAAM,WAAW,kBAAkB;IACjC,SAAS,EAAE,MAAM,OAAO,CAAC;IACzB,wEAAwE;IACxE,MAAM,EAAE,CAAC,IAAI,EAAE,SAAS,GAAG,SAAS,SAAS,EAAE,KAAK,OAAO,CAAC;IAC5D,KAAK,EAAE,MAAM,IAAI,CAAC;CACnB;AAED,MAAM,WAAW,mBAAmB;IAClC,IAAI,EAAE,gBAAgB,CAAC;IACvB,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,MAAM,EAAE,kBAAkB,CAAC;IAC3B,UAAU,EAAE,OAAO,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,mBAAmB;IAClC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,IAAI,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAC3B,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,mEAAmE;IACnE,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;IACpB,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED,MAAM,WAAW,kBAAkB;IACjC,UAAU,EAAE,sBAAsB,CAAC;IACnC,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,QAAQ,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,wFAAwF;IACxF,aAAa,CAAC,EAAE,CACd,IAAI,EAAE,SAAS,EACf,KAAK,EAAE,CAAC,OAAO,EAAE,mBAAmB,KAAK,SAAS,KAC/C,SAAS,CAAC;IACf,YAAY,CAAC,EAAE,CAAC,OAAO,EAAE,mBAAmB,KAAK,SAAS,CAAC;CAC5D;AAED,eAAO,MAAM,cAAc,EAAE,SAAS,kBAAkB,EAAO,CAAC;AAEhE;;;;;GAKG;AACH,eAAO,MAAM,mBAAmB,iDAAwD,CAAC;AAoBzF,wBAAgB,WAAW,CACzB,QAAQ,EAAE,WAAW,CAAC,MAAM,EAAE,kBAAkB,CAAC,EACjD,IAAI,EAAE,WAAW,CAAC,MAAM,EAAE,kBAAkB,CAAC,WAe9C;AAED,eAAO,MAAM,YAAY;IACvB,uFAAuF;aAC9E,WAAW,CAAC,MAAM,EAAE,kBAAkB,CAAC;IAChD,4FAA4F;YACpF,CAAC,IAAI,EAAE,MAAM,KAAK,kBAAkB,GAAG,SAAS;IACxD,8FAA8F;WACvF,GAAG,CAAC,MAAM,EAAE,QAAQ,CAAC;cAClB,OAAO;UACX,OAAO;cACH,MAAM;UACV,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,gBAAgB,EAAE,QAAQ,CAAC,EAAE,MAAM,KAAK,IAAI;EASvE,CAAC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { IconName } from "../Icon/icons.cjs";
|
|
2
|
+
export declare const contentBlockFrameClass = "ds-content-block ds-field-surface";
|
|
3
|
+
export interface ContentBlockAction {
|
|
4
|
+
label: string;
|
|
5
|
+
icon: IconName;
|
|
6
|
+
run: () => void;
|
|
7
|
+
disabled?: boolean;
|
|
8
|
+
description?: string;
|
|
9
|
+
tone?: "danger";
|
|
10
|
+
inlineIcon?: boolean;
|
|
11
|
+
checked?: boolean;
|
|
12
|
+
}
|
|
13
|
+
export interface ContentBlockActionGroup {
|
|
14
|
+
label?: string;
|
|
15
|
+
/** Shown under the label and read with the group's disabled actions. */
|
|
16
|
+
description?: string;
|
|
17
|
+
choices?: boolean;
|
|
18
|
+
keepOpen?: boolean;
|
|
19
|
+
separate?: boolean;
|
|
20
|
+
actions: readonly ContentBlockAction[];
|
|
21
|
+
}
|
|
22
|
+
export declare function ContentBlockBar({ kind, meta, isSelected, isDisabled, isLocked, menuLabel, actions, onSelect, }: {
|
|
23
|
+
kind: string;
|
|
24
|
+
meta?: string;
|
|
25
|
+
isSelected: boolean;
|
|
26
|
+
isDisabled: boolean;
|
|
27
|
+
isLocked?: boolean;
|
|
28
|
+
menuLabel: string;
|
|
29
|
+
actions: readonly ContentBlockActionGroup[] | ((rtl: boolean) => readonly ContentBlockActionGroup[]);
|
|
30
|
+
onSelect: () => void;
|
|
31
|
+
}): import("react").JSX.Element;
|
|
32
|
+
//# sourceMappingURL=content-block-frame.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"content-block-frame.d.cts","sourceRoot":"","sources":["../../../src/components/RichTextEditor/content-block-frame.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAG9C,eAAO,MAAM,sBAAsB,sCAAsC,CAAC;AAE1E,MAAM,WAAW,kBAAkB;IACjC,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,QAAQ,CAAC;IACf,GAAG,EAAE,MAAM,IAAI,CAAC;IAChB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,IAAI,CAAC,EAAE,QAAQ,CAAC;IAChB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED,MAAM,WAAW,uBAAuB;IACtC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,wEAAwE;IACxE,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,OAAO,EAAE,SAAS,kBAAkB,EAAE,CAAC;CACxC;AAkJD,wBAAgB,eAAe,CAAC,EAC9B,IAAI,EACJ,IAAI,EACJ,UAAU,EACV,UAAU,EACV,QAAQ,EACR,SAAS,EACT,OAAO,EACP,QAAQ,GACT,EAAE;IACD,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,OAAO,CAAC;IACpB,UAAU,EAAE,OAAO,CAAC;IACpB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EACL,SAAS,uBAAuB,EAAE,GAAG,CAAC,CAAC,GAAG,EAAE,OAAO,KAAK,SAAS,uBAAuB,EAAE,CAAC,CAAC;IAC9F,QAAQ,EAAE,MAAM,IAAI,CAAC;CACtB,+BA0EA"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { IconName } from "../Icon/icons.js";
|
|
2
|
+
export declare const contentBlockFrameClass = "ds-content-block ds-field-surface";
|
|
3
|
+
export interface ContentBlockAction {
|
|
4
|
+
label: string;
|
|
5
|
+
icon: IconName;
|
|
6
|
+
run: () => void;
|
|
7
|
+
disabled?: boolean;
|
|
8
|
+
description?: string;
|
|
9
|
+
tone?: "danger";
|
|
10
|
+
inlineIcon?: boolean;
|
|
11
|
+
checked?: boolean;
|
|
12
|
+
}
|
|
13
|
+
export interface ContentBlockActionGroup {
|
|
14
|
+
label?: string;
|
|
15
|
+
/** Shown under the label and read with the group's disabled actions. */
|
|
16
|
+
description?: string;
|
|
17
|
+
choices?: boolean;
|
|
18
|
+
keepOpen?: boolean;
|
|
19
|
+
separate?: boolean;
|
|
20
|
+
actions: readonly ContentBlockAction[];
|
|
21
|
+
}
|
|
22
|
+
export declare function ContentBlockBar({ kind, meta, isSelected, isDisabled, isLocked, menuLabel, actions, onSelect, }: {
|
|
23
|
+
kind: string;
|
|
24
|
+
meta?: string;
|
|
25
|
+
isSelected: boolean;
|
|
26
|
+
isDisabled: boolean;
|
|
27
|
+
isLocked?: boolean;
|
|
28
|
+
menuLabel: string;
|
|
29
|
+
actions: readonly ContentBlockActionGroup[] | ((rtl: boolean) => readonly ContentBlockActionGroup[]);
|
|
30
|
+
onSelect: () => void;
|
|
31
|
+
}): import("react").JSX.Element;
|
|
32
|
+
//# sourceMappingURL=content-block-frame.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"content-block-frame.d.ts","sourceRoot":"","sources":["../../../src/components/RichTextEditor/content-block-frame.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAG9C,eAAO,MAAM,sBAAsB,sCAAsC,CAAC;AAE1E,MAAM,WAAW,kBAAkB;IACjC,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,QAAQ,CAAC;IACf,GAAG,EAAE,MAAM,IAAI,CAAC;IAChB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,IAAI,CAAC,EAAE,QAAQ,CAAC;IAChB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED,MAAM,WAAW,uBAAuB;IACtC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,wEAAwE;IACxE,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,OAAO,EAAE,SAAS,kBAAkB,EAAE,CAAC;CACxC;AAkJD,wBAAgB,eAAe,CAAC,EAC9B,IAAI,EACJ,IAAI,EACJ,UAAU,EACV,UAAU,EACV,QAAQ,EACR,SAAS,EACT,OAAO,EACP,QAAQ,GACT,EAAE;IACD,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,OAAO,CAAC;IACpB,UAAU,EAAE,OAAO,CAAC;IACpB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EACL,SAAS,uBAAuB,EAAE,GAAG,CAAC,CAAC,GAAG,EAAE,OAAO,KAAK,SAAS,uBAAuB,EAAE,CAAC,CAAC;IAC9F,QAAQ,EAAE,MAAM,IAAI,CAAC;CACtB,+BA0EA"}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { type NodeViewProps } from "@tiptap/react";
|
|
2
|
+
export declare function ContentBlockView({ node, selected, editor, getPos, updateAttributes, }: NodeViewProps): string | number | bigint | boolean | import("react").JSX.Element | Iterable<import("react").ReactNode> | Promise<string | number | bigint | boolean | import("react").ReactPortal | import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>> | Iterable<import("react").ReactNode> | null | undefined> | null | undefined;
|
|
3
|
+
//# sourceMappingURL=content-block-view.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"content-block-view.d.cts","sourceRoot":"","sources":["../../../src/components/RichTextEditor/content-block-view.tsx"],"names":[],"mappings":"AACA,OAAO,EAAmB,KAAK,aAAa,EAAE,MAAM,eAAe,CAAC;AAmBpE,wBAAgB,gBAAgB,CAAC,EAC/B,IAAI,EACJ,QAAQ,EACR,MAAM,EACN,MAAM,EACN,gBAAgB,GACjB,EAAE,aAAa,+VAyHf"}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { type NodeViewProps } from "@tiptap/react";
|
|
2
|
+
export declare function ContentBlockView({ node, selected, editor, getPos, updateAttributes, }: NodeViewProps): string | number | bigint | boolean | import("react").JSX.Element | Iterable<import("react").ReactNode> | Promise<string | number | bigint | boolean | import("react").ReactPortal | import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>> | Iterable<import("react").ReactNode> | null | undefined> | null | undefined;
|
|
3
|
+
//# sourceMappingURL=content-block-view.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"content-block-view.d.ts","sourceRoot":"","sources":["../../../src/components/RichTextEditor/content-block-view.tsx"],"names":[],"mappings":"AACA,OAAO,EAAmB,KAAK,aAAa,EAAE,MAAM,eAAe,CAAC;AAmBpE,wBAAgB,gBAAgB,CAAC,EAC/B,IAAI,EACJ,QAAQ,EACR,MAAM,EACN,MAAM,EACN,gBAAgB,GACjB,EAAE,aAAa,+VAyHf"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Node } from "@tiptap/react";
|
|
2
|
+
/** A stored block element's attributes: only its `data-content-block-*` attributes count. */
|
|
3
|
+
export declare function readBlockElement(element: HTMLElement): {
|
|
4
|
+
type: string | null;
|
|
5
|
+
align: string;
|
|
6
|
+
data: unknown;
|
|
7
|
+
};
|
|
8
|
+
/** The shared schema contains one atomic node for every registered plug-in. */
|
|
9
|
+
export declare const ContentBlock: Node<any, any>;
|
|
10
|
+
//# sourceMappingURL=content-block.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"content-block.d.cts","sourceRoot":"","sources":["../../../src/components/RichTextEditor/content-block.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAmB,MAAM,eAAe,CAAC;AAWtD,6FAA6F;AAC7F,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,WAAW;;;;EAMpD;AAeD,+EAA+E;AAC/E,eAAO,MAAM,YAAY,gBA6BvB,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Node } from "@tiptap/react";
|
|
2
|
+
/** A stored block element's attributes: only its `data-content-block-*` attributes count. */
|
|
3
|
+
export declare function readBlockElement(element: HTMLElement): {
|
|
4
|
+
type: string | null;
|
|
5
|
+
align: string;
|
|
6
|
+
data: unknown;
|
|
7
|
+
};
|
|
8
|
+
/** The shared schema contains one atomic node for every registered plug-in. */
|
|
9
|
+
export declare const ContentBlock: Node<any, any>;
|
|
10
|
+
//# sourceMappingURL=content-block.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"content-block.d.ts","sourceRoot":"","sources":["../../../src/components/RichTextEditor/content-block.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAmB,MAAM,eAAe,CAAC;AAWtD,6FAA6F;AAC7F,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,WAAW;;;;EAMpD;AAeD,+EAA+E;AAC/E,eAAO,MAAM,YAAY,gBA6BvB,CAAC"}
|
|
@@ -1,20 +1,36 @@
|
|
|
1
1
|
import { type JSONContent } from "@tiptap/react";
|
|
2
|
-
import {
|
|
2
|
+
import { type Node } from "@tiptap/pm/model";
|
|
3
|
+
import { ContentBlock } from "./content-block.cjs";
|
|
4
|
+
import { type ContentBlockDefinition } from "../../rich-text-blocks.cjs";
|
|
3
5
|
export type RichTextDocument = JSONContent & {
|
|
4
6
|
type: "doc";
|
|
5
7
|
};
|
|
6
8
|
export declare const emptyDocument: RichTextDocument;
|
|
9
|
+
export declare const documentTable: import("@tiptap/core").Node<import("@tiptap/extension-table").TableOptions, any>;
|
|
7
10
|
export interface RichTextSchemaOptions {
|
|
8
11
|
/** Include table nodes. Defaults to true. */
|
|
9
12
|
tables?: boolean;
|
|
13
|
+
blockDefinitions?: readonly ContentBlockDefinition[];
|
|
10
14
|
}
|
|
11
15
|
/**
|
|
12
|
-
* The shared schema's extensions. The editor passes its node-view
|
|
13
|
-
*
|
|
14
|
-
* keeps the same extension identities across renders.
|
|
16
|
+
* The shared schema's extensions. The editor passes its node-view variants;
|
|
17
|
+
* validation and serialization can use the same schema without editor chrome.
|
|
15
18
|
*/
|
|
16
|
-
export declare function richTextExtensions(
|
|
17
|
-
/**
|
|
18
|
-
|
|
19
|
-
|
|
19
|
+
export declare function richTextExtensions(embedBlock?: typeof ContentBlock, { tables }?: RichTextSchemaOptions, table?: import("@tiptap/core").Node<import("@tiptap/extension-table").TableOptions, any>): (import("@tiptap/core").Node<any, any> | import("@tiptap/core").Extension<import("@tiptap/starter-kit").StarterKitOptions, any> | import("@tiptap/core").Mark<import("@tiptap/extension-link").LinkOptions, any> | import("@tiptap/core").Node<import("@tiptap/extension-table").TableOptions, any> | import("@tiptap/core").Extension<import("@tiptap/extension-table").TableKitOptions, any>)[];
|
|
20
|
+
/**
|
|
21
|
+
* An empty writing surface holds one empty paragraph. Missing, null and empty
|
|
22
|
+
* content are all empty.
|
|
23
|
+
*/
|
|
24
|
+
export declare function normalizeDocument(stored: RichTextDocument): RichTextDocument;
|
|
25
|
+
/** The registry an editor's blocks are checked against, and the nodes it has already passed. */
|
|
26
|
+
export interface BlockCheck {
|
|
27
|
+
definitions: ReadonlyMap<string, ContentBlockDefinition>;
|
|
28
|
+
/** Unchanged subtrees keep their node objects, so each edit rechecks only its path. */
|
|
29
|
+
passed: WeakSet<Node>;
|
|
30
|
+
}
|
|
31
|
+
export declare function blockCheck(definitions: ReadonlyMap<string, ContentBlockDefinition>): BlockCheck;
|
|
32
|
+
/** Whether every content block in `node` is registered and valid. */
|
|
33
|
+
export declare function validBlocks(node: Node, check: BlockCheck): boolean;
|
|
34
|
+
export declare function htmlBlockError(html: string, blockDefinitions: readonly ContentBlockDefinition[]): "Unsupported or invalid rich-text document." | undefined;
|
|
35
|
+
export declare function documentError(value: unknown, { tables, blockDefinitions }?: RichTextSchemaOptions): string | undefined;
|
|
20
36
|
//# sourceMappingURL=document.d.cts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"document.d.cts","sourceRoot":"","sources":["../../../src/components/RichTextEditor/document.ts"],"names":[],"mappings":"AAAA,OAAO,EAA8B,KAAK,WAAW,EAAE,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"document.d.cts","sourceRoot":"","sources":["../../../src/components/RichTextEditor/document.ts"],"names":[],"mappings":"AAAA,OAAO,EAA8B,KAAK,WAAW,EAAE,MAAM,eAAe,CAAC;AAI7E,OAAO,EAAuC,KAAK,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAGlF,OAAO,EAAE,YAAY,EAAoB,MAAM,iBAAiB,CAAC;AACjE,OAAO,EAGL,KAAK,sBAAsB,EAC5B,MAAM,wBAAwB,CAAC;AAEhC,MAAM,MAAM,gBAAgB,GAAG,WAAW,GAAG;IAAE,IAAI,EAAE,KAAK,CAAA;CAAE,CAAC;AAE7D,eAAO,MAAM,aAAa,EAAE,gBAAoE,CAAC;AA0DjG,eAAO,MAAM,aAAa,kFAgBQ,CAAC;AAGnC,MAAM,WAAW,qBAAqB;IACpC,6CAA6C;IAC7C,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,gBAAgB,CAAC,EAAE,SAAS,sBAAsB,EAAE,CAAC;CACtD;AAED;;;GAGG;AACH,wBAAgB,kBAAkB,CAChC,UAAU,GAAE,OAAO,YAA2B,EAC9C,EAAE,MAAa,EAAE,GAAE,qBAA0B,EAC7C,KAAK,mFAAgB,qYAKtB;AAOD;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,gBAAgB,GAAG,gBAAgB,CAI5E;AAID,gGAAgG;AAChG,MAAM,WAAW,UAAU;IACzB,WAAW,EAAE,WAAW,CAAC,MAAM,EAAE,sBAAsB,CAAC,CAAC;IACzD,uFAAuF;IACvF,MAAM,EAAE,OAAO,CAAC,IAAI,CAAC,CAAC;CACvB;AAED,wBAAgB,UAAU,CAAC,WAAW,EAAE,WAAW,CAAC,MAAM,EAAE,sBAAsB,CAAC,GAAG,UAAU,CAE/F;AAED,qEAAqE;AACrE,wBAAgB,WAAW,CAAC,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,UAAU,GAAG,OAAO,CAiBlE;AAED,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,EAAE,gBAAgB,EAAE,SAAS,sBAAsB,EAAE,4DAe/F;AAED,wBAAgB,aAAa,CAC3B,KAAK,EAAE,OAAO,EACd,EAAE,MAAa,EAAE,gBAAqB,EAAE,GAAE,qBAA0B,GACnE,MAAM,GAAG,SAAS,CA+CpB"}
|
|
@@ -1,20 +1,36 @@
|
|
|
1
1
|
import { type JSONContent } from "@tiptap/react";
|
|
2
|
-
import {
|
|
2
|
+
import { type Node } from "@tiptap/pm/model";
|
|
3
|
+
import { ContentBlock } from "./content-block.js";
|
|
4
|
+
import { type ContentBlockDefinition } from "../../rich-text-blocks.js";
|
|
3
5
|
export type RichTextDocument = JSONContent & {
|
|
4
6
|
type: "doc";
|
|
5
7
|
};
|
|
6
8
|
export declare const emptyDocument: RichTextDocument;
|
|
9
|
+
export declare const documentTable: import("@tiptap/core").Node<import("@tiptap/extension-table").TableOptions, any>;
|
|
7
10
|
export interface RichTextSchemaOptions {
|
|
8
11
|
/** Include table nodes. Defaults to true. */
|
|
9
12
|
tables?: boolean;
|
|
13
|
+
blockDefinitions?: readonly ContentBlockDefinition[];
|
|
10
14
|
}
|
|
11
15
|
/**
|
|
12
|
-
* The shared schema's extensions. The editor passes its node-view
|
|
13
|
-
*
|
|
14
|
-
* keeps the same extension identities across renders.
|
|
16
|
+
* The shared schema's extensions. The editor passes its node-view variants;
|
|
17
|
+
* validation and serialization can use the same schema without editor chrome.
|
|
15
18
|
*/
|
|
16
|
-
export declare function richTextExtensions(
|
|
17
|
-
/**
|
|
18
|
-
|
|
19
|
-
|
|
19
|
+
export declare function richTextExtensions(embedBlock?: typeof ContentBlock, { tables }?: RichTextSchemaOptions, table?: import("@tiptap/core").Node<import("@tiptap/extension-table").TableOptions, any>): (import("@tiptap/core").Node<any, any> | import("@tiptap/core").Extension<import("@tiptap/starter-kit").StarterKitOptions, any> | import("@tiptap/core").Mark<import("@tiptap/extension-link").LinkOptions, any> | import("@tiptap/core").Node<import("@tiptap/extension-table").TableOptions, any> | import("@tiptap/core").Extension<import("@tiptap/extension-table").TableKitOptions, any>)[];
|
|
20
|
+
/**
|
|
21
|
+
* An empty writing surface holds one empty paragraph. Missing, null and empty
|
|
22
|
+
* content are all empty.
|
|
23
|
+
*/
|
|
24
|
+
export declare function normalizeDocument(stored: RichTextDocument): RichTextDocument;
|
|
25
|
+
/** The registry an editor's blocks are checked against, and the nodes it has already passed. */
|
|
26
|
+
export interface BlockCheck {
|
|
27
|
+
definitions: ReadonlyMap<string, ContentBlockDefinition>;
|
|
28
|
+
/** Unchanged subtrees keep their node objects, so each edit rechecks only its path. */
|
|
29
|
+
passed: WeakSet<Node>;
|
|
30
|
+
}
|
|
31
|
+
export declare function blockCheck(definitions: ReadonlyMap<string, ContentBlockDefinition>): BlockCheck;
|
|
32
|
+
/** Whether every content block in `node` is registered and valid. */
|
|
33
|
+
export declare function validBlocks(node: Node, check: BlockCheck): boolean;
|
|
34
|
+
export declare function htmlBlockError(html: string, blockDefinitions: readonly ContentBlockDefinition[]): "Unsupported or invalid rich-text document." | undefined;
|
|
35
|
+
export declare function documentError(value: unknown, { tables, blockDefinitions }?: RichTextSchemaOptions): string | undefined;
|
|
20
36
|
//# sourceMappingURL=document.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"document.d.ts","sourceRoot":"","sources":["../../../src/components/RichTextEditor/document.ts"],"names":[],"mappings":"AAAA,OAAO,EAA8B,KAAK,WAAW,EAAE,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"document.d.ts","sourceRoot":"","sources":["../../../src/components/RichTextEditor/document.ts"],"names":[],"mappings":"AAAA,OAAO,EAA8B,KAAK,WAAW,EAAE,MAAM,eAAe,CAAC;AAI7E,OAAO,EAAuC,KAAK,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAGlF,OAAO,EAAE,YAAY,EAAoB,MAAM,iBAAiB,CAAC;AACjE,OAAO,EAGL,KAAK,sBAAsB,EAC5B,MAAM,wBAAwB,CAAC;AAEhC,MAAM,MAAM,gBAAgB,GAAG,WAAW,GAAG;IAAE,IAAI,EAAE,KAAK,CAAA;CAAE,CAAC;AAE7D,eAAO,MAAM,aAAa,EAAE,gBAAoE,CAAC;AA0DjG,eAAO,MAAM,aAAa,kFAgBQ,CAAC;AAGnC,MAAM,WAAW,qBAAqB;IACpC,6CAA6C;IAC7C,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,gBAAgB,CAAC,EAAE,SAAS,sBAAsB,EAAE,CAAC;CACtD;AAED;;;GAGG;AACH,wBAAgB,kBAAkB,CAChC,UAAU,GAAE,OAAO,YAA2B,EAC9C,EAAE,MAAa,EAAE,GAAE,qBAA0B,EAC7C,KAAK,mFAAgB,qYAKtB;AAOD;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,gBAAgB,GAAG,gBAAgB,CAI5E;AAID,gGAAgG;AAChG,MAAM,WAAW,UAAU;IACzB,WAAW,EAAE,WAAW,CAAC,MAAM,EAAE,sBAAsB,CAAC,CAAC;IACzD,uFAAuF;IACvF,MAAM,EAAE,OAAO,CAAC,IAAI,CAAC,CAAC;CACvB;AAED,wBAAgB,UAAU,CAAC,WAAW,EAAE,WAAW,CAAC,MAAM,EAAE,sBAAsB,CAAC,GAAG,UAAU,CAE/F;AAED,qEAAqE;AACrE,wBAAgB,WAAW,CAAC,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,UAAU,GAAG,OAAO,CAiBlE;AAED,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,EAAE,gBAAgB,EAAE,SAAS,sBAAsB,EAAE,4DAe/F;AAED,wBAAgB,aAAa,CAC3B,KAAK,EAAE,OAAO,EACd,EAAE,MAAa,EAAE,gBAAqB,EAAE,GAAE,qBAA0B,GACnE,MAAM,GAAG,SAAS,CA+CpB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../chunks/RichTextEditor-
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../chunks/RichTextEditor-D4rNww9d.cjs");exports.RichTextEditor=e.t,exports.createPickerBlockPlugin=e.n;
|
|
@@ -2,9 +2,11 @@ import { type ReactNode } from "react";
|
|
|
2
2
|
import { type RichTextEditorExpandedWidth } from "./expansion.cjs";
|
|
3
3
|
import { type RichTextDocument } from "./document.cjs";
|
|
4
4
|
import type { FieldBinding } from "../Field/index.cjs";
|
|
5
|
-
import type
|
|
6
|
-
export
|
|
7
|
-
export type {
|
|
5
|
+
import { type ContentBlockPlugin } from "./block-plugins.cjs";
|
|
6
|
+
export { createPickerBlockPlugin } from "./picker-block.cjs";
|
|
7
|
+
export type { PickerBlockOptions, PickerBlockSource, PickerBlockTarget } from "./picker-block.cjs";
|
|
8
|
+
export type { ContentBlockMode, ContentBlockPlugin, ContentBlockPreview, ContentBlockSession, ContentBlockTarget, } from "./block-plugins.cjs";
|
|
9
|
+
export type { BlockData, BlockJson, ContentBlockAlignment, ContentBlockAttributes, ContentBlockDefinition, } from "../../rich-text-blocks.cjs";
|
|
8
10
|
export type RichTextEditorSize = "sm" | "md" | "lg";
|
|
9
11
|
export type { RichTextDocument } from "./document.cjs";
|
|
10
12
|
export type { RichTextEditorExpandedWidth } from "./expansion.cjs";
|
|
@@ -20,7 +22,7 @@ interface RichTextEditorCommonProps extends FieldBinding {
|
|
|
20
22
|
className?: string;
|
|
21
23
|
/** Extra controls appended to the toolbar, e.g. a word count. */
|
|
22
24
|
toolbarExtra?: ReactNode;
|
|
23
|
-
|
|
25
|
+
blockPlugins?: readonly ContentBlockPlugin[];
|
|
24
26
|
/**
|
|
25
27
|
* Offer Insert table and accept table nodes. Defaults to true. With false, a
|
|
26
28
|
* pasted table keeps only its text, and a JSON value with tables is unsupported
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.cts","sourceRoot":"","sources":["../../../src/components/RichTextEditor/index.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.cts","sourceRoot":"","sources":["../../../src/components/RichTextEditor/index.tsx"],"names":[],"mappings":"AAEA,OAAO,EASL,KAAK,SAAS,EAEf,MAAM,OAAO,CAAC;AAuBf,OAAO,EAAsB,KAAK,2BAA2B,EAAE,MAAM,aAAa,CAAC;AACnF,OAAO,EASL,KAAK,gBAAgB,EACtB,MAAM,YAAY,CAAC;AACpB,OAAO,oBAAoB,CAAC;AAC5B,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAC7C,OAAO,aAAa,CAAC;AAGrB,OAAO,EAAgC,KAAK,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAKxF,OAAO,EAAE,uBAAuB,EAAE,MAAM,gBAAgB,CAAC;AACzD,YAAY,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAC/F,YAAY,EACV,gBAAgB,EAChB,kBAAkB,EAClB,mBAAmB,EACnB,mBAAmB,EACnB,kBAAkB,GACnB,MAAM,iBAAiB,CAAC;AACzB,YAAY,EACV,SAAS,EACT,SAAS,EACT,qBAAqB,EACrB,sBAAsB,EACtB,sBAAsB,GACvB,MAAM,wBAAwB,CAAC;AAIhC,MAAM,MAAM,kBAAkB,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;AAEpD,YAAY,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AACnD,YAAY,EAAE,2BAA2B,EAAE,MAAM,aAAa,CAAC;AAE/D,UAAU,yBAA0B,SAAQ,YAAY;IACtD,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,IAAI,CAAC,EAAE,kBAAkB,CAAC;IAC1B,wGAAwG;IACxG,aAAa,CAAC,EAAE,2BAA2B,CAAC;IAC5C,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,+CAA+C;IAC/C,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,iEAAiE;IACjE,YAAY,CAAC,EAAE,SAAS,CAAC;IACzB,YAAY,CAAC,EAAE,SAAS,kBAAkB,EAAE,CAAC;IAC7C;;;;;;OAMG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAED,MAAM,MAAM,mBAAmB,GAAG,yBAAyB,GACzD,CACI;IAAE,MAAM,CAAC,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IAAC,YAAY,CAAC,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAA;CAAE,GAC7F;IACE,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,gBAAgB,CAAC;IACzB,YAAY,CAAC,EAAE,gBAAgB,CAAC;IAChC,QAAQ,CAAC,EAAE,CAAC,QAAQ,EAAE,gBAAgB,KAAK,IAAI,CAAC;CACjD,CACJ,CAAC;AAkgBJ,eAAO,MAAM,cAAc,gHA6U1B,CAAC"}
|
|
@@ -2,9 +2,11 @@ import { type ReactNode } from "react";
|
|
|
2
2
|
import { type RichTextEditorExpandedWidth } from "./expansion.js";
|
|
3
3
|
import { type RichTextDocument } from "./document.js";
|
|
4
4
|
import type { FieldBinding } from "../Field/index.js";
|
|
5
|
-
import type
|
|
6
|
-
export
|
|
7
|
-
export type {
|
|
5
|
+
import { type ContentBlockPlugin } from "./block-plugins.js";
|
|
6
|
+
export { createPickerBlockPlugin } from "./picker-block.js";
|
|
7
|
+
export type { PickerBlockOptions, PickerBlockSource, PickerBlockTarget } from "./picker-block.js";
|
|
8
|
+
export type { ContentBlockMode, ContentBlockPlugin, ContentBlockPreview, ContentBlockSession, ContentBlockTarget, } from "./block-plugins.js";
|
|
9
|
+
export type { BlockData, BlockJson, ContentBlockAlignment, ContentBlockAttributes, ContentBlockDefinition, } from "../../rich-text-blocks.js";
|
|
8
10
|
export type RichTextEditorSize = "sm" | "md" | "lg";
|
|
9
11
|
export type { RichTextDocument } from "./document.js";
|
|
10
12
|
export type { RichTextEditorExpandedWidth } from "./expansion.js";
|
|
@@ -20,7 +22,7 @@ interface RichTextEditorCommonProps extends FieldBinding {
|
|
|
20
22
|
className?: string;
|
|
21
23
|
/** Extra controls appended to the toolbar, e.g. a word count. */
|
|
22
24
|
toolbarExtra?: ReactNode;
|
|
23
|
-
|
|
25
|
+
blockPlugins?: readonly ContentBlockPlugin[];
|
|
24
26
|
/**
|
|
25
27
|
* Offer Insert table and accept table nodes. Defaults to true. With false, a
|
|
26
28
|
* pasted table keeps only its text, and a JSON value with tables is unsupported
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/RichTextEditor/index.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/RichTextEditor/index.tsx"],"names":[],"mappings":"AAEA,OAAO,EASL,KAAK,SAAS,EAEf,MAAM,OAAO,CAAC;AAuBf,OAAO,EAAsB,KAAK,2BAA2B,EAAE,MAAM,aAAa,CAAC;AACnF,OAAO,EASL,KAAK,gBAAgB,EACtB,MAAM,YAAY,CAAC;AACpB,OAAO,oBAAoB,CAAC;AAC5B,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAC7C,OAAO,aAAa,CAAC;AAGrB,OAAO,EAAgC,KAAK,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAKxF,OAAO,EAAE,uBAAuB,EAAE,MAAM,gBAAgB,CAAC;AACzD,YAAY,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAC/F,YAAY,EACV,gBAAgB,EAChB,kBAAkB,EAClB,mBAAmB,EACnB,mBAAmB,EACnB,kBAAkB,GACnB,MAAM,iBAAiB,CAAC;AACzB,YAAY,EACV,SAAS,EACT,SAAS,EACT,qBAAqB,EACrB,sBAAsB,EACtB,sBAAsB,GACvB,MAAM,wBAAwB,CAAC;AAIhC,MAAM,MAAM,kBAAkB,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;AAEpD,YAAY,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AACnD,YAAY,EAAE,2BAA2B,EAAE,MAAM,aAAa,CAAC;AAE/D,UAAU,yBAA0B,SAAQ,YAAY;IACtD,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,IAAI,CAAC,EAAE,kBAAkB,CAAC;IAC1B,wGAAwG;IACxG,aAAa,CAAC,EAAE,2BAA2B,CAAC;IAC5C,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,+CAA+C;IAC/C,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,iEAAiE;IACjE,YAAY,CAAC,EAAE,SAAS,CAAC;IACzB,YAAY,CAAC,EAAE,SAAS,kBAAkB,EAAE,CAAC;IAC7C;;;;;;OAMG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAED,MAAM,MAAM,mBAAmB,GAAG,yBAAyB,GACzD,CACI;IAAE,MAAM,CAAC,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IAAC,YAAY,CAAC,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAA;CAAE,GAC7F;IACE,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,gBAAgB,CAAC;IACzB,YAAY,CAAC,EAAE,gBAAgB,CAAC;IAChC,QAAQ,CAAC,EAAE,CAAC,QAAQ,EAAE,gBAAgB,KAAK,IAAI,CAAC;CACjD,CACJ,CAAC;AAkgBJ,eAAO,MAAM,cAAc,gHA6U1B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { t as RichTextEditor } from "../../chunks/RichTextEditor-
|
|
1
|
+
export { t as RichTextEditor, n as createPickerBlockPlugin } from "../../chunks/RichTextEditor-DSxiMLVd.js";
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { type BlockData, type ContentBlockDefinition } from "../../rich-text-blocks.cjs";
|
|
2
|
+
import type { EntryItem, EntryPickerSource } from "../EntryPicker/index.cjs";
|
|
3
|
+
import type { IconName } from "../Icon/icons.cjs";
|
|
4
|
+
import { type ContentBlockPlugin } from "./block-plugins.cjs";
|
|
5
|
+
export interface PickerBlockTarget {
|
|
6
|
+
available: () => boolean;
|
|
7
|
+
commit: (item: EntryItem) => boolean;
|
|
8
|
+
}
|
|
9
|
+
export interface PickerBlockSource extends Omit<EntryPickerSource, "onCreate" | "mode" | "max"> {
|
|
10
|
+
items?: EntryItem[];
|
|
11
|
+
onCreate?: (target: PickerBlockTarget) => void;
|
|
12
|
+
}
|
|
13
|
+
export interface PickerBlockOptions {
|
|
14
|
+
definition: ContentBlockDefinition;
|
|
15
|
+
itemLabel: string;
|
|
16
|
+
itemsLabel: string;
|
|
17
|
+
icon: IconName;
|
|
18
|
+
source: PickerBlockSource;
|
|
19
|
+
itemId: (data: BlockData) => string;
|
|
20
|
+
toData: (item: EntryItem) => BlockData | undefined;
|
|
21
|
+
invalidItemReason?: (item: EntryItem) => string;
|
|
22
|
+
}
|
|
23
|
+
/** Build a plug-in for any block whose payload is chosen from an EntryPicker. */
|
|
24
|
+
export declare function createPickerBlockPlugin(config: PickerBlockOptions): ContentBlockPlugin;
|
|
25
|
+
//# sourceMappingURL=picker-block.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"picker-block.d.cts","sourceRoot":"","sources":["../../../src/components/RichTextEditor/picker-block.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAe,KAAK,SAAS,EAAE,KAAK,sBAAsB,EAAE,MAAM,wBAAwB,CAAC;AAClG,OAAO,KAAK,EAAE,SAAS,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AACnE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAO9C,OAAO,EAGL,KAAK,kBAAkB,EAGxB,MAAM,iBAAiB,CAAC;AAEzB,MAAM,WAAW,iBAAiB;IAChC,SAAS,EAAE,MAAM,OAAO,CAAC;IACzB,MAAM,EAAE,CAAC,IAAI,EAAE,SAAS,KAAK,OAAO,CAAC;CACtC;AAED,MAAM,WAAW,iBAAkB,SAAQ,IAAI,CAAC,iBAAiB,EAAE,UAAU,GAAG,MAAM,GAAG,KAAK,CAAC;IAC7F,KAAK,CAAC,EAAE,SAAS,EAAE,CAAC;IACpB,QAAQ,CAAC,EAAE,CAAC,MAAM,EAAE,iBAAiB,KAAK,IAAI,CAAC;CAChD;AAED,MAAM,WAAW,kBAAkB;IACjC,UAAU,EAAE,sBAAsB,CAAC;IACnC,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,QAAQ,CAAC;IACf,MAAM,EAAE,iBAAiB,CAAC;IAC1B,MAAM,EAAE,CAAC,IAAI,EAAE,SAAS,KAAK,MAAM,CAAC;IACpC,MAAM,EAAE,CAAC,IAAI,EAAE,SAAS,KAAK,SAAS,GAAG,SAAS,CAAC;IACnD,iBAAiB,CAAC,EAAE,CAAC,IAAI,EAAE,SAAS,KAAK,MAAM,CAAC;CACjD;AAmXD,iFAAiF;AACjF,wBAAgB,uBAAuB,CAAC,MAAM,EAAE,kBAAkB,GAAG,kBAAkB,CAoCtF"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { type BlockData, type ContentBlockDefinition } from "../../rich-text-blocks.js";
|
|
2
|
+
import type { EntryItem, EntryPickerSource } from "../EntryPicker/index.js";
|
|
3
|
+
import type { IconName } from "../Icon/icons.js";
|
|
4
|
+
import { type ContentBlockPlugin } from "./block-plugins.js";
|
|
5
|
+
export interface PickerBlockTarget {
|
|
6
|
+
available: () => boolean;
|
|
7
|
+
commit: (item: EntryItem) => boolean;
|
|
8
|
+
}
|
|
9
|
+
export interface PickerBlockSource extends Omit<EntryPickerSource, "onCreate" | "mode" | "max"> {
|
|
10
|
+
items?: EntryItem[];
|
|
11
|
+
onCreate?: (target: PickerBlockTarget) => void;
|
|
12
|
+
}
|
|
13
|
+
export interface PickerBlockOptions {
|
|
14
|
+
definition: ContentBlockDefinition;
|
|
15
|
+
itemLabel: string;
|
|
16
|
+
itemsLabel: string;
|
|
17
|
+
icon: IconName;
|
|
18
|
+
source: PickerBlockSource;
|
|
19
|
+
itemId: (data: BlockData) => string;
|
|
20
|
+
toData: (item: EntryItem) => BlockData | undefined;
|
|
21
|
+
invalidItemReason?: (item: EntryItem) => string;
|
|
22
|
+
}
|
|
23
|
+
/** Build a plug-in for any block whose payload is chosen from an EntryPicker. */
|
|
24
|
+
export declare function createPickerBlockPlugin(config: PickerBlockOptions): ContentBlockPlugin;
|
|
25
|
+
//# sourceMappingURL=picker-block.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"picker-block.d.ts","sourceRoot":"","sources":["../../../src/components/RichTextEditor/picker-block.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAe,KAAK,SAAS,EAAE,KAAK,sBAAsB,EAAE,MAAM,wBAAwB,CAAC;AAClG,OAAO,KAAK,EAAE,SAAS,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AACnE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAO9C,OAAO,EAGL,KAAK,kBAAkB,EAGxB,MAAM,iBAAiB,CAAC;AAEzB,MAAM,WAAW,iBAAiB;IAChC,SAAS,EAAE,MAAM,OAAO,CAAC;IACzB,MAAM,EAAE,CAAC,IAAI,EAAE,SAAS,KAAK,OAAO,CAAC;CACtC;AAED,MAAM,WAAW,iBAAkB,SAAQ,IAAI,CAAC,iBAAiB,EAAE,UAAU,GAAG,MAAM,GAAG,KAAK,CAAC;IAC7F,KAAK,CAAC,EAAE,SAAS,EAAE,CAAC;IACpB,QAAQ,CAAC,EAAE,CAAC,MAAM,EAAE,iBAAiB,KAAK,IAAI,CAAC;CAChD;AAED,MAAM,WAAW,kBAAkB;IACjC,UAAU,EAAE,sBAAsB,CAAC;IACnC,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,QAAQ,CAAC;IACf,MAAM,EAAE,iBAAiB,CAAC;IAC1B,MAAM,EAAE,CAAC,IAAI,EAAE,SAAS,KAAK,MAAM,CAAC;IACpC,MAAM,EAAE,CAAC,IAAI,EAAE,SAAS,KAAK,SAAS,GAAG,SAAS,CAAC;IACnD,iBAAiB,CAAC,EAAE,CAAC,IAAI,EAAE,SAAS,KAAK,MAAM,CAAC;CACjD;AAmXD,iFAAiF;AACjF,wBAAgB,uBAAuB,CAAC,MAAM,EAAE,kBAAkB,GAAG,kBAAkB,CAoCtF"}
|