@salmonui/rich-text 0.0.0-stage → 0.2.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/LICENSE +21 -0
- package/README.md +79 -2
- package/dist/blocks/find.d.ts +4 -0
- package/dist/blocks/find.d.ts.map +1 -0
- package/dist/blocks/find.js +14 -0
- package/dist/blocks/find.js.map +1 -0
- package/dist/blocks/from-html.d.ts +10 -0
- package/dist/blocks/from-html.d.ts.map +1 -0
- package/dist/blocks/from-html.js +459 -0
- package/dist/blocks/from-html.js.map +1 -0
- package/dist/blocks/index.d.ts +5 -0
- package/dist/blocks/index.d.ts.map +1 -0
- package/dist/blocks/index.js +4 -0
- package/dist/blocks/index.js.map +1 -0
- package/dist/blocks/ops.d.ts +27 -0
- package/dist/blocks/ops.d.ts.map +1 -0
- package/dist/blocks/ops.js +172 -0
- package/dist/blocks/ops.js.map +1 -0
- package/dist/blocks/to-html.d.ts +18 -0
- package/dist/blocks/to-html.d.ts.map +1 -0
- package/dist/blocks/to-html.js +207 -0
- package/dist/blocks/to-html.js.map +1 -0
- package/dist/blocks/types.d.ts +76 -0
- package/dist/blocks/types.d.ts.map +1 -0
- package/dist/blocks/types.js +4 -0
- package/dist/blocks/types.js.map +1 -0
- package/dist/collab.d.ts +43 -0
- package/dist/collab.d.ts.map +1 -0
- package/dist/collab.js +45 -0
- package/dist/collab.js.map +1 -0
- package/dist/content/RichTextContent.d.ts +19 -0
- package/dist/content/RichTextContent.d.ts.map +1 -0
- package/dist/content/RichTextContent.js +20 -0
- package/dist/content/RichTextContent.js.map +1 -0
- package/dist/content/index.d.ts +2 -0
- package/dist/content/index.d.ts.map +1 -0
- package/dist/content/index.js +3 -0
- package/dist/content/index.js.map +1 -0
- package/dist/engine/commands.d.ts +19 -0
- package/dist/engine/commands.d.ts.map +1 -0
- package/dist/engine/commands.js +457 -0
- package/dist/engine/commands.js.map +1 -0
- package/dist/engine/core.d.ts +113 -0
- package/dist/engine/core.d.ts.map +1 -0
- package/dist/engine/core.js +444 -0
- package/dist/engine/core.js.map +1 -0
- package/dist/engine/dom-shim.d.ts +47 -0
- package/dist/engine/dom-shim.d.ts.map +1 -0
- package/dist/engine/dom-shim.js +128 -0
- package/dist/engine/dom-shim.js.map +1 -0
- package/dist/engine/html-out.d.ts +12 -0
- package/dist/engine/html-out.d.ts.map +1 -0
- package/dist/engine/html-out.js +24 -0
- package/dist/engine/html-out.js.map +1 -0
- package/dist/engine/index.d.ts +6 -0
- package/dist/engine/index.d.ts.map +1 -0
- package/dist/engine/index.js +5 -0
- package/dist/engine/index.js.map +1 -0
- package/dist/engine/keymap.d.ts +18 -0
- package/dist/engine/keymap.d.ts.map +1 -0
- package/dist/engine/keymap.js +85 -0
- package/dist/engine/keymap.js.map +1 -0
- package/dist/engine/load.d.ts +10 -0
- package/dist/engine/load.d.ts.map +1 -0
- package/dist/engine/load.js +11 -0
- package/dist/engine/load.js.map +1 -0
- package/dist/engine/nodeviews.d.ts +11 -0
- package/dist/engine/nodeviews.d.ts.map +1 -0
- package/dist/engine/nodeviews.js +236 -0
- package/dist/engine/nodeviews.js.map +1 -0
- package/dist/engine/plugins.d.ts +76 -0
- package/dist/engine/plugins.d.ts.map +1 -0
- package/dist/engine/plugins.js +311 -0
- package/dist/engine/plugins.js.map +1 -0
- package/dist/engine/schema.d.ts +11 -0
- package/dist/engine/schema.d.ts.map +1 -0
- package/dist/engine/schema.js +350 -0
- package/dist/engine/schema.js.map +1 -0
- package/dist/engine/serialize.d.ts +13 -0
- package/dist/engine/serialize.d.ts.map +1 -0
- package/dist/engine/serialize.js +119 -0
- package/dist/engine/serialize.js.map +1 -0
- package/dist/engine/snapshot.d.ts +4 -0
- package/dist/engine/snapshot.d.ts.map +1 -0
- package/dist/engine/snapshot.js +62 -0
- package/dist/engine/snapshot.js.map +1 -0
- package/dist/engine/types.d.ts +215 -0
- package/dist/engine/types.d.ts.map +1 -0
- package/dist/engine/types.js +2 -0
- package/dist/engine/types.js.map +1 -0
- package/dist/html/entities.d.ts +7 -0
- package/dist/html/entities.d.ts.map +1 -0
- package/dist/html/entities.js +69 -0
- package/dist/html/entities.js.map +1 -0
- package/dist/html/index.d.ts +7 -0
- package/dist/html/index.d.ts.map +1 -0
- package/dist/html/index.js +9 -0
- package/dist/html/index.js.map +1 -0
- package/dist/html/parse.d.ts +30 -0
- package/dist/html/parse.d.ts.map +1 -0
- package/dist/html/parse.js +394 -0
- package/dist/html/parse.js.map +1 -0
- package/dist/html/paste.d.ts +47 -0
- package/dist/html/paste.d.ts.map +1 -0
- package/dist/html/paste.js +373 -0
- package/dist/html/paste.js.map +1 -0
- package/dist/html/policy.d.ts +56 -0
- package/dist/html/policy.d.ts.map +1 -0
- package/dist/html/policy.js +245 -0
- package/dist/html/policy.js.map +1 -0
- package/dist/html/sanitize.d.ts +60 -0
- package/dist/html/sanitize.d.ts.map +1 -0
- package/dist/html/sanitize.js +699 -0
- package/dist/html/sanitize.js.map +1 -0
- package/dist/html/serialize.d.ts +16 -0
- package/dist/html/serialize.d.ts.map +1 -0
- package/dist/html/serialize.js +68 -0
- package/dist/html/serialize.js.map +1 -0
- package/dist/html/text.d.ts +18 -0
- package/dist/html/text.d.ts.map +1 -0
- package/dist/html/text.js +96 -0
- package/dist/html/text.js.map +1 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +22 -0
- package/dist/index.js.map +1 -0
- package/dist/mention/editable.d.ts +15 -0
- package/dist/mention/editable.d.ts.map +1 -0
- package/dist/mention/editable.js +167 -0
- package/dist/mention/editable.js.map +1 -0
- package/dist/mention/index.d.ts +2 -0
- package/dist/mention/index.d.ts.map +1 -0
- package/dist/mention/index.js +3 -0
- package/dist/mention/index.js.map +1 -0
- package/dist/react/RichTextEditor.d.ts +15 -0
- package/dist/react/RichTextEditor.d.ts.map +1 -0
- package/dist/react/RichTextEditor.js +494 -0
- package/dist/react/RichTextEditor.js.map +1 -0
- package/dist/react/block-editor/BlockEditor.d.ts +5 -0
- package/dist/react/block-editor/BlockEditor.d.ts.map +1 -0
- package/dist/react/block-editor/BlockEditor.js +103 -0
- package/dist/react/block-editor/BlockEditor.js.map +1 -0
- package/dist/react/block-editor/controller.d.ts +91 -0
- package/dist/react/block-editor/controller.d.ts.map +1 -0
- package/dist/react/block-editor/controller.js +757 -0
- package/dist/react/block-editor/controller.js.map +1 -0
- package/dist/react/block-editor/index.d.ts +4 -0
- package/dist/react/block-editor/index.d.ts.map +1 -0
- package/dist/react/block-editor/index.js +5 -0
- package/dist/react/block-editor/index.js.map +1 -0
- package/dist/react/block-editor/locale.d.ts +65 -0
- package/dist/react/block-editor/locale.d.ts.map +1 -0
- package/dist/react/block-editor/locale.js +63 -0
- package/dist/react/block-editor/locale.js.map +1 -0
- package/dist/react/block-editor/transforms.d.ts +26 -0
- package/dist/react/block-editor/transforms.d.ts.map +1 -0
- package/dist/react/block-editor/transforms.js +233 -0
- package/dist/react/block-editor/transforms.js.map +1 -0
- package/dist/react/block-editor/types.d.ts +180 -0
- package/dist/react/block-editor/types.d.ts.map +1 -0
- package/dist/react/block-editor/types.js +2 -0
- package/dist/react/block-editor/types.js.map +1 -0
- package/dist/react/block-editor/ui.d.ts +21 -0
- package/dist/react/block-editor/ui.d.ts.map +1 -0
- package/dist/react/block-editor/ui.js +601 -0
- package/dist/react/block-editor/ui.js.map +1 -0
- package/dist/react/client.d.ts +28 -0
- package/dist/react/client.d.ts.map +1 -0
- package/dist/react/client.js +109 -0
- package/dist/react/client.js.map +1 -0
- package/dist/react/dialogs.d.ts +44 -0
- package/dist/react/dialogs.d.ts.map +1 -0
- package/dist/react/dialogs.js +312 -0
- package/dist/react/dialogs.js.map +1 -0
- package/dist/react/emoji-data.d.ts +3 -0
- package/dist/react/emoji-data.d.ts.map +1 -0
- package/dist/react/emoji-data.js +6 -0
- package/dist/react/emoji-data.js.map +1 -0
- package/dist/react/icons.d.ts +5 -0
- package/dist/react/icons.d.ts.map +1 -0
- package/dist/react/icons.js +69 -0
- package/dist/react/icons.js.map +1 -0
- package/dist/react/index.d.ts +5 -0
- package/dist/react/index.d.ts.map +1 -0
- package/dist/react/index.js +5 -0
- package/dist/react/index.js.map +1 -0
- package/dist/react/items.d.ts +68 -0
- package/dist/react/items.d.ts.map +1 -0
- package/dist/react/items.js +253 -0
- package/dist/react/items.js.map +1 -0
- package/dist/react/locale.d.ts +130 -0
- package/dist/react/locale.d.ts.map +1 -0
- package/dist/react/locale.js +131 -0
- package/dist/react/locale.js.map +1 -0
- package/dist/react/overlay.d.ts +41 -0
- package/dist/react/overlay.d.ts.map +1 -0
- package/dist/react/overlay.js +162 -0
- package/dist/react/overlay.js.map +1 -0
- package/dist/react/store.d.ts +23 -0
- package/dist/react/store.d.ts.map +1 -0
- package/dist/react/store.js +84 -0
- package/dist/react/store.js.map +1 -0
- package/dist/react/types.d.ts +205 -0
- package/dist/react/types.d.ts.map +1 -0
- package/dist/react/types.js +2 -0
- package/dist/react/types.js.map +1 -0
- package/dist/rich-text.css +1555 -0
- package/package.json +61 -4
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
import type { CSSProperties, Ref } from 'react';
|
|
2
|
+
import type { MentionData, MentionItem } from '@salmonui/dropdowns/mention';
|
|
3
|
+
import type { Block, BlockPatch, BlockPosition, BlockType } from '../../blocks/types.js';
|
|
4
|
+
import type { PasteCleanupOptions } from '../../html/paste.js';
|
|
5
|
+
import type { SanitizeHook } from '../../html/sanitize.js';
|
|
6
|
+
import type { HighlightFn } from '../../engine/plugins.js';
|
|
7
|
+
import type { RichTextExtension } from '../../engine/types.js';
|
|
8
|
+
import type { BlockEditorLocaleText } from './locale.js';
|
|
9
|
+
/** Block types a block can be turned into (`'turnInto'`, `transforms`). */
|
|
10
|
+
export type BlockEditorTransformId = 'paragraph' | 'heading1' | 'heading2' | 'heading3' | 'bulletList' | 'numberedList' | 'checklist' | 'quote' | 'callout' | 'code' | 'toggle';
|
|
11
|
+
/** Built-in slash menu entries: the transforms plus inserted blocks. */
|
|
12
|
+
export type BlockEditorSlashItemId = BlockEditorTransformId | 'image' | 'table' | 'divider';
|
|
13
|
+
/** What a custom menu entry receives. */
|
|
14
|
+
export interface BlockEditorItemContext {
|
|
15
|
+
/** The block the menu belongs to (the caret's block for the slash menu and toolbar). */
|
|
16
|
+
readonly block: Block | null;
|
|
17
|
+
readonly actions: BlockEditorActions;
|
|
18
|
+
}
|
|
19
|
+
/** A custom entry of the slash menu, block action menu, context menu or inline toolbar. */
|
|
20
|
+
export interface BlockEditorCustomItem {
|
|
21
|
+
readonly id: string;
|
|
22
|
+
readonly label: string;
|
|
23
|
+
/** Extra search words (slash menu). */
|
|
24
|
+
readonly keywords?: readonly string[];
|
|
25
|
+
/** Group heading in the slash menu (default: the built-in groups). */
|
|
26
|
+
readonly group?: string;
|
|
27
|
+
readonly disabled?: boolean;
|
|
28
|
+
readonly onSelect: (context: BlockEditorItemContext) => void;
|
|
29
|
+
}
|
|
30
|
+
export type BlockEditorSlashItem = BlockEditorSlashItemId | BlockEditorCustomItem;
|
|
31
|
+
/** Inline (selection) toolbar entries. */
|
|
32
|
+
export type BlockEditorInlineToolbarItemId = 'bold' | 'italic' | 'underline' | 'strike' | 'code' | 'link' | 'turnInto';
|
|
33
|
+
export type BlockEditorInlineToolbarItem = BlockEditorInlineToolbarItemId | BlockEditorCustomItem;
|
|
34
|
+
/** Block action menu entries; image and table blocks add their own. */
|
|
35
|
+
export type BlockEditorBlockActionId = 'duplicate' | 'delete' | 'moveUp' | 'moveDown' | 'turnInto';
|
|
36
|
+
export type BlockEditorBlockAction = BlockEditorBlockActionId | BlockEditorCustomItem;
|
|
37
|
+
/** Context menu entries. */
|
|
38
|
+
export type BlockEditorContextMenuItemId = 'cut' | 'copy' | 'duplicate' | 'delete' | 'moveUp' | 'moveDown' | 'turnInto';
|
|
39
|
+
export type BlockEditorContextMenuItem = BlockEditorContextMenuItemId | BlockEditorCustomItem;
|
|
40
|
+
/** Commands `keyBindings` can rebind: the block commands plus every RichTextEditor command id. */
|
|
41
|
+
export type BlockEditorCommandId = 'moveBlockUp' | 'moveBlockDown' | 'duplicateBlock' | 'deleteBlock' | 'blockMenu' | 'contextMenu' | 'print' | (string & {});
|
|
42
|
+
/** Caret position: the block and the character offset in its text. */
|
|
43
|
+
export interface BlockEditorSelection {
|
|
44
|
+
readonly blockId: string;
|
|
45
|
+
readonly offset: number;
|
|
46
|
+
}
|
|
47
|
+
/** `onBlockChange`. */
|
|
48
|
+
export interface BlockEditorBlockChangeEvent {
|
|
49
|
+
readonly type: 'add' | 'update' | 'remove' | 'move';
|
|
50
|
+
readonly block: Block;
|
|
51
|
+
}
|
|
52
|
+
/** Where a block is: parent block id (null at the top level) and index among its siblings. */
|
|
53
|
+
export interface BlockEditorBlockLocation {
|
|
54
|
+
readonly parentId: string | null;
|
|
55
|
+
readonly index: number;
|
|
56
|
+
}
|
|
57
|
+
/** `onBlockMove`. */
|
|
58
|
+
export interface BlockEditorBlockMoveEvent {
|
|
59
|
+
readonly block: Block;
|
|
60
|
+
readonly from: BlockEditorBlockLocation;
|
|
61
|
+
readonly position: BlockPosition;
|
|
62
|
+
readonly source: 'pointer' | 'keyboard' | 'api';
|
|
63
|
+
}
|
|
64
|
+
/** `onBeforeBlockMove`: `preventDefault()` cancels the move. */
|
|
65
|
+
export interface BlockEditorBeforeBlockMoveEvent extends BlockEditorBlockMoveEvent {
|
|
66
|
+
preventDefault(): void;
|
|
67
|
+
readonly defaultPrevented: boolean;
|
|
68
|
+
}
|
|
69
|
+
/** `onBeforePaste`: `preventDefault()` cancels the paste. */
|
|
70
|
+
export interface BlockEditorBeforePasteEvent {
|
|
71
|
+
readonly html: string;
|
|
72
|
+
readonly text: string;
|
|
73
|
+
readonly files: readonly File[];
|
|
74
|
+
preventDefault(): void;
|
|
75
|
+
readonly defaultPrevented: boolean;
|
|
76
|
+
}
|
|
77
|
+
/** `onPaste`: after pasted content was applied. */
|
|
78
|
+
export interface BlockEditorPasteEvent {
|
|
79
|
+
readonly html: string;
|
|
80
|
+
readonly text: string;
|
|
81
|
+
/** The document after the paste. */
|
|
82
|
+
readonly blocks: Block[];
|
|
83
|
+
}
|
|
84
|
+
/** Mentions through the contenteditable `Mention` target. */
|
|
85
|
+
export interface BlockEditorMentions<T = MentionItem> {
|
|
86
|
+
/** Trigger (default `'@'`). */
|
|
87
|
+
readonly trigger?: string;
|
|
88
|
+
readonly items: MentionData<T>;
|
|
89
|
+
}
|
|
90
|
+
/** Labels: inserted as label atoms. An item's `tone` colors the label. */
|
|
91
|
+
export interface BlockEditorLabels<T = MentionItem & {
|
|
92
|
+
readonly tone?: string;
|
|
93
|
+
}> {
|
|
94
|
+
/** Trigger (default `'#'`). */
|
|
95
|
+
readonly trigger?: string;
|
|
96
|
+
readonly items: MentionData<T>;
|
|
97
|
+
}
|
|
98
|
+
/** `actionsRef`. */
|
|
99
|
+
export interface BlockEditorActions {
|
|
100
|
+
/** The current document. */
|
|
101
|
+
getBlocks(): Block[];
|
|
102
|
+
getBlock(id: string): Block | undefined;
|
|
103
|
+
insertBlocks(blocks: readonly Block[], position?: BlockPosition): void;
|
|
104
|
+
removeBlocks(ids: readonly string[]): void;
|
|
105
|
+
updateBlock(id: string, patch: BlockPatch): void;
|
|
106
|
+
/** Returns false when cancelled by `onBeforeBlockMove` or not possible. */
|
|
107
|
+
moveBlock(id: string, position: BlockPosition): boolean;
|
|
108
|
+
turnInto(id: string, type: BlockEditorTransformId): void;
|
|
109
|
+
getSelection(): BlockEditorSelection | null;
|
|
110
|
+
setSelection(selection: BlockEditorSelection): void;
|
|
111
|
+
focus(): void;
|
|
112
|
+
/** Runs a toolbar action or command by id (`bold`, `heading2`, `insertTable`, `undo`, `print`, ...). */
|
|
113
|
+
runCommand(id: string, ...args: unknown[]): boolean;
|
|
114
|
+
getHtml(): string;
|
|
115
|
+
print(): void;
|
|
116
|
+
}
|
|
117
|
+
export interface BlockEditorProps {
|
|
118
|
+
/** Controlled document. Pass back what `onChange` gave to keep the editor in sync. */
|
|
119
|
+
readonly value?: readonly Block[];
|
|
120
|
+
readonly defaultValue?: readonly Block[];
|
|
121
|
+
readonly onChange?: (blocks: Block[]) => void;
|
|
122
|
+
readonly onBlockChange?: (event: BlockEditorBlockChangeEvent) => void;
|
|
123
|
+
readonly onSelectionChange?: (selection: BlockEditorSelection | null) => void;
|
|
124
|
+
readonly onFocus?: () => void;
|
|
125
|
+
readonly onBlur?: () => void;
|
|
126
|
+
readonly readOnly?: boolean;
|
|
127
|
+
/** Shown in an empty document. */
|
|
128
|
+
readonly placeholder?: string;
|
|
129
|
+
/** Slash menu entries (default: every built-in); `false` turns the menu off. */
|
|
130
|
+
readonly slashMenu?: false | readonly BlockEditorSlashItem[];
|
|
131
|
+
/** Selection toolbar entries (default bold, italic, underline, strike, code, link, turnInto); `false` hides it. */
|
|
132
|
+
readonly inlineToolbar?: false | readonly BlockEditorInlineToolbarItem[];
|
|
133
|
+
/** Types offered by `'turnInto'` (default: all). */
|
|
134
|
+
readonly transforms?: readonly BlockEditorTransformId[];
|
|
135
|
+
/** Block action menu entries (default duplicate, delete, moveUp, moveDown, turnInto). */
|
|
136
|
+
readonly blockActions?: readonly BlockEditorBlockAction[];
|
|
137
|
+
/** Context menu entries (default: all built-in); `false` keeps the browser menu. */
|
|
138
|
+
readonly contextMenu?: false | readonly BlockEditorContextMenuItem[];
|
|
139
|
+
/** Drag handles reorder and nest blocks (default true). */
|
|
140
|
+
readonly draggable?: boolean;
|
|
141
|
+
readonly onBeforeBlockMove?: (event: BlockEditorBeforeBlockMoveEvent) => void;
|
|
142
|
+
readonly onBlockMove?: (event: BlockEditorBlockMoveEvent) => void;
|
|
143
|
+
/** Uploads an image, audio or video file; the block is pending until it settles. Default: a blob URL. */
|
|
144
|
+
readonly onUpload?: (file: File) => Promise<{
|
|
145
|
+
readonly src: string;
|
|
146
|
+
readonly alt?: string;
|
|
147
|
+
}>;
|
|
148
|
+
/** Code block languages. */
|
|
149
|
+
readonly codeLanguages?: readonly {
|
|
150
|
+
readonly value: string;
|
|
151
|
+
readonly label: string;
|
|
152
|
+
}[];
|
|
153
|
+
/** Code highlighting hook. */
|
|
154
|
+
readonly highlight?: HighlightFn;
|
|
155
|
+
/** Paste cleanup. Default mode `'clean'`. */
|
|
156
|
+
readonly pasteCleanup?: Omit<PasteCleanupOptions, 'embedHosts' | 'sanitize'>;
|
|
157
|
+
readonly onBeforePaste?: (event: BlockEditorBeforePasteEvent) => void;
|
|
158
|
+
readonly onPaste?: (event: BlockEditorPasteEvent) => void;
|
|
159
|
+
/** Undo steps kept (default 30). */
|
|
160
|
+
readonly undoLimit?: number;
|
|
161
|
+
/** Command id -> key chord (ProseMirror key names, `Mod-` = Ctrl/Cmd); `false` removes the default. */
|
|
162
|
+
readonly keyBindings?: Readonly<Partial<Record<BlockEditorCommandId, string | false>>>;
|
|
163
|
+
readonly mentions?: BlockEditorMentions;
|
|
164
|
+
readonly labels?: BlockEditorLabels;
|
|
165
|
+
/** Engine extensions, for example `createCollaboration()` from `/collab`. Keep the array stable. */
|
|
166
|
+
readonly extensions?: readonly RichTextExtension[];
|
|
167
|
+
/** Hosts whose iframe embeds are kept by the sanitizer. */
|
|
168
|
+
readonly embedHosts?: readonly string[];
|
|
169
|
+
/** Further sanitizer restriction. Keep it stable. */
|
|
170
|
+
readonly sanitize?: SanitizeHook;
|
|
171
|
+
readonly localeText?: Partial<BlockEditorLocaleText>;
|
|
172
|
+
readonly 'aria-label'?: string;
|
|
173
|
+
readonly 'aria-labelledby'?: string;
|
|
174
|
+
readonly id?: string;
|
|
175
|
+
readonly className?: string;
|
|
176
|
+
readonly style?: CSSProperties;
|
|
177
|
+
readonly actionsRef?: Ref<BlockEditorActions | null>;
|
|
178
|
+
}
|
|
179
|
+
export type { Block, BlockPatch, BlockPosition, BlockType };
|
|
180
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/react/block-editor/types.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,CAAC,UAAU,CAAC,EAAE,OAAO,CAAC,qBAAqB,CAAC,CAAC;IACrD,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,CAAC;IAC/B,QAAQ,CAAC,iBAAiB,CAAC,EAAE,MAAM,CAAC;IACpC,QAAQ,CAAC,EAAE,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,KAAK,CAAC,EAAE,aAAa,CAAC;IAC/B,QAAQ,CAAC,UAAU,CAAC,EAAE,GAAG,CAAC,kBAAkB,GAAG,IAAI,CAAC,CAAC;CACtD;AAED,YAAY,EAAE,KAAK,EAAE,UAAU,EAAE,aAAa,EAAE,SAAS,EAAE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/react/block-editor/types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { type ReactElement, type RefObject } from 'react';
|
|
2
|
+
import type { BlockController } from './controller.js';
|
|
3
|
+
import type { BlockEditorLocaleText } from './locale.js';
|
|
4
|
+
import type { BlockEditorActions, BlockEditorProps } from './types.js';
|
|
5
|
+
export interface UiHooks {
|
|
6
|
+
suggestKey: (event: KeyboardEvent) => boolean;
|
|
7
|
+
action: (id: string) => boolean;
|
|
8
|
+
pastePrompt: () => Promise<'keep' | 'clean' | 'plainText' | null>;
|
|
9
|
+
}
|
|
10
|
+
export interface BlockEditorUiProps {
|
|
11
|
+
readonly controller: BlockController;
|
|
12
|
+
readonly rootRef: RefObject<HTMLDivElement | null>;
|
|
13
|
+
readonly contentRef: RefObject<HTMLDivElement | null>;
|
|
14
|
+
readonly locale: BlockEditorLocaleText;
|
|
15
|
+
readonly props: BlockEditorProps;
|
|
16
|
+
readonly hooks: RefObject<UiHooks>;
|
|
17
|
+
readonly actions: BlockEditorActions;
|
|
18
|
+
}
|
|
19
|
+
/** The whole client UI of one BlockEditor. */
|
|
20
|
+
export declare function BlockEditorUi(p: BlockEditorUiProps): ReactElement;
|
|
21
|
+
//# sourceMappingURL=ui.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ui.d.ts","sourceRoot":"","sources":["../../../src/react/block-editor/ui.tsx"],"names":[],"mappings":"AAQA,OAAO,EAAsE,KAAK,YAAY,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAO9H,OAAO,KAAK,EAAE,eAAe,EAAiB,MAAM,iBAAiB,CAAC;AACtE,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAC;AAEzD,OAAO,KAAK,EACV,kBAAkB,EAKlB,gBAAgB,EAIjB,MAAM,YAAY,CAAC;AAEpB,MAAM,WAAW,OAAO;IACtB,UAAU,EAAE,CAAC,KAAK,EAAE,aAAa,KAAK,OAAO,CAAC;IAC9C,MAAM,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,OAAO,CAAC;IAChC,WAAW,EAAE,MAAM,OAAO,CAAC,MAAM,GAAG,OAAO,GAAG,WAAW,GAAG,IAAI,CAAC,CAAC;CACnE;AAED,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,UAAU,EAAE,eAAe,CAAC;IACrC,QAAQ,CAAC,OAAO,EAAE,SAAS,CAAC,cAAc,GAAG,IAAI,CAAC,CAAC;IACnD,QAAQ,CAAC,UAAU,EAAE,SAAS,CAAC,cAAc,GAAG,IAAI,CAAC,CAAC;IACtD,QAAQ,CAAC,MAAM,EAAE,qBAAqB,CAAC;IACvC,QAAQ,CAAC,KAAK,EAAE,gBAAgB,CAAC;IACjC,QAAQ,CAAC,KAAK,EAAE,SAAS,CAAC,OAAO,CAAC,CAAC;IACnC,QAAQ,CAAC,OAAO,EAAE,kBAAkB,CAAC;CACtC;AAwCD,8CAA8C;AAC9C,wBAAgB,aAAa,CAAC,CAAC,EAAE,kBAAkB,GAAG,YAAY,CAyHjE"}
|