@haklex/rich-editor 0.58.0 → 0.59.1
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 +35 -0
- package/dist/{AlertQuoteEditNode-DQt5pIZ8.js → AlertQuoteEditNode-Ck4v29Wg.js} +9 -20
- package/dist/BlockIdPlugin-Cwv8aV9g.js +106 -0
- package/dist/{ColorSchemeContext-RLg0uDRt.js → ColorSchemeContext-Dc_HebHd.js} +5 -4
- package/dist/ContentEditable.css--lQ6ekTS.js +7 -0
- package/dist/EditorBlockContext-DytAx9Tg.js +9 -0
- package/dist/{ExtraNodesContext-DdU7MZwS.js → ExtraNodesContext-xQ2RNsqH.js} +1 -1
- package/dist/{MermaidPlugin-BpoGXa9D.js → MermaidPlugin-BCoGsdi3.js} +3 -3
- package/dist/NestedEditorPluginsContext-D78UZkmx.js +16 -0
- package/dist/{RubyRenderer-CnTFvt0b.js → RubyRenderer-8HMSMaZz.js} +1 -1
- package/dist/VirtualizationPlugin-C8TJ4HJN.js +178 -0
- package/dist/{SubmitShortcutPlugin-BuRxU6WD.js → VirtualizationPlugin-Crc0cLUx.js} +969 -532
- package/dist/VirtualizedEditor-CIGYcIfr.js +818 -0
- package/dist/command-registry-entry.d.ts +3 -0
- package/dist/command-registry-entry.d.ts.map +1 -0
- package/dist/command-registry-entry.mjs +343 -0
- package/dist/commands/registry.d.ts +24 -0
- package/dist/commands/registry.d.ts.map +1 -0
- package/dist/commands-entry.mjs +2 -2
- package/dist/components/EditorSurfaceHost.d.ts +3 -0
- package/dist/components/EditorSurfaceHost.d.ts.map +1 -0
- package/dist/components/RichEditor.d.ts.map +1 -1
- package/dist/components/RichEditorShell.d.ts +3 -1
- package/dist/components/RichEditorShell.d.ts.map +1 -1
- package/dist/components/VirtualizationFromProps.d.ts +6 -0
- package/dist/components/VirtualizationFromProps.d.ts.map +1 -0
- package/dist/components/decorators/GridEditDecorator.d.ts.map +1 -1
- package/dist/components/renderers/ImageRenderer.d.ts +1 -0
- package/dist/components/renderers/ImageRenderer.d.ts.map +1 -1
- package/dist/context/EditorBlockContext.d.ts +12 -0
- package/dist/context/EditorBlockContext.d.ts.map +1 -0
- package/dist/context/EditorSurfaceContext.d.ts +42 -0
- package/dist/context/EditorSurfaceContext.d.ts.map +1 -0
- package/dist/defineProperty-BYhxpJwd.js +39 -0
- package/dist/{grid.css-CUb_icKZ.js → grid.css-DJWKdYpz.js} +2 -1
- package/dist/index.d.ts +5 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.mjs +95 -43
- package/dist/{katex.css-9tq8FN8h.js → katex.css-9crOcnIa.js} +2 -1
- package/dist/{node-registry-CH2oHfO4.js → node-registry-jRE4LqH-.js} +37 -21
- package/dist/nodes/ImageNode.d.ts +7 -1
- package/dist/nodes/ImageNode.d.ts.map +1 -1
- package/dist/nodes/RichQuoteNode.d.ts +4 -1
- package/dist/nodes/RichQuoteNode.d.ts.map +1 -1
- package/dist/nodes-entry.mjs +4 -4
- package/dist/plugins/FileUploadPlugin.d.ts.map +1 -1
- package/dist/plugins/ImageDialog.d.ts +13 -0
- package/dist/plugins/ImageDialog.d.ts.map +1 -0
- package/dist/plugins/ImageDialogReview.d.ts +13 -0
- package/dist/plugins/ImageDialogReview.d.ts.map +1 -0
- package/dist/plugins/ImageDialogSource.d.ts +12 -0
- package/dist/plugins/ImageDialogSource.d.ts.map +1 -0
- package/dist/plugins/ImagePlugin.d.ts.map +1 -1
- package/dist/plugins/ImageUploadPlugin.d.ts +1 -1
- package/dist/plugins/ImageUploadPlugin.d.ts.map +1 -1
- package/dist/plugins/VideoUploadPlugin.d.ts +1 -1
- package/dist/plugins/VideoUploadPlugin.d.ts.map +1 -1
- package/dist/plugins/VirtualizationPlugin.d.ts +2 -0
- package/dist/plugins/VirtualizationPlugin.d.ts.map +1 -0
- package/dist/plugins/image-dialog-model.d.ts +65 -0
- package/dist/plugins/image-dialog-model.d.ts.map +1 -0
- package/dist/plugins/image-dialog.css.d.ts +30 -0
- package/dist/plugins/image-dialog.css.d.ts.map +1 -0
- package/dist/plugins/image-upload-toast.d.ts +2 -0
- package/dist/plugins/image-upload-toast.d.ts.map +1 -0
- package/dist/plugins/image-upload.css.d.ts +0 -23
- package/dist/plugins/image-upload.css.d.ts.map +1 -1
- package/dist/plugins/insertion-cursor.d.ts +20 -0
- package/dist/plugins/insertion-cursor.d.ts.map +1 -0
- package/dist/plugins/present-image-dialog.d.ts +14 -0
- package/dist/plugins/present-image-dialog.d.ts.map +1 -0
- package/dist/plugins-entry.d.ts +5 -0
- package/dist/plugins-entry.d.ts.map +1 -1
- package/dist/plugins-entry.mjs +7 -5
- package/dist/recycler-entry.d.ts +8 -0
- package/dist/recycler-entry.d.ts.map +1 -0
- package/dist/recycler-entry.mjs +3 -0
- package/dist/renderers-entry.mjs +4 -4
- package/dist/rich-editor.css +1 -1
- package/dist/static-entry.d.ts +1 -0
- package/dist/static-entry.d.ts.map +1 -1
- package/dist/static-entry.mjs +10 -9
- package/dist/styles/grid.css.d.ts.map +1 -1
- package/dist/styles/shared.css.d.ts.map +1 -1
- package/dist/styles-entry.mjs +3 -3
- package/dist/{theme-Blq1EG_t.js → theme-DH4xzxU-.js} +63 -48
- package/dist/{thumbhash-DHHqtr0c.js → thumbhash-GjK8OYAb.js} +1 -1
- package/dist/types.d.ts +3 -0
- package/dist/types.d.ts.map +1 -1
- package/dist/{utils-CdxPji5z.js → utils-E6qVk-NR.js} +1 -0
- package/dist/viewport-BvO92tse.js +210 -0
- package/dist/virtualization/VirtualizationPlugin.d.ts +5 -0
- package/dist/virtualization/VirtualizationPlugin.d.ts.map +1 -0
- package/dist/virtualization/VirtualizedEditor.d.ts +6 -0
- package/dist/virtualization/VirtualizedEditor.d.ts.map +1 -0
- package/dist/virtualization/controller.d.ts +73 -0
- package/dist/virtualization/controller.d.ts.map +1 -0
- package/dist/virtualization/document.d.ts +26 -0
- package/dist/virtualization/document.d.ts.map +1 -0
- package/dist/virtualization/layout.d.ts +42 -0
- package/dist/virtualization/layout.d.ts.map +1 -0
- package/dist/virtualization/preserve.d.ts +21 -0
- package/dist/virtualization/preserve.d.ts.map +1 -0
- package/dist/virtualization/style.css.d.ts +4 -0
- package/dist/virtualization/style.css.d.ts.map +1 -0
- package/dist/virtualization/sync.d.ts +4 -0
- package/dist/virtualization/sync.d.ts.map +1 -0
- package/dist/virtualization/types.d.ts +13 -0
- package/dist/virtualization/types.d.ts.map +1 -0
- package/dist/virtualization/viewport.d.ts +3 -0
- package/dist/virtualization/viewport.d.ts.map +1 -0
- package/dist/virtualization-entry.d.ts +3 -0
- package/dist/virtualization-entry.d.ts.map +1 -0
- package/dist/virtualization-entry.mjs +1 -0
- package/package.json +17 -5
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export type { CommandGroup, CommandGroupId, CommandMeta } from './commands/registry';
|
|
2
|
+
export { COMMAND_GROUPS, COMMAND_REGISTRY, getCommandGroupLabel, getCommandMeta, normalizeCommandItems, TURN_INTO_COMMAND_IDS, } from './commands/registry';
|
|
3
|
+
//# sourceMappingURL=command-registry-entry.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"command-registry-entry.d.ts","sourceRoot":"","sources":["../src/command-registry-entry.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,YAAY,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AACrF,OAAO,EACL,cAAc,EACd,gBAAgB,EAChB,oBAAoB,EACpB,cAAc,EACd,qBAAqB,EACrB,qBAAqB,GACtB,MAAM,qBAAqB,CAAC"}
|
|
@@ -0,0 +1,343 @@
|
|
|
1
|
+
import { createElement } from "react";
|
|
2
|
+
import { AppWindow, AtSign, Boxes, ChartColumnBig, ChevronRight, Code, FileCode, FileText, Flag, Footprints, Heading1, Heading2, Heading3, Image, Images, Info, LayoutGrid, Lightbulb, Link, List, ListChecks, ListOrdered, MessageSquare, MessageSquareCode, Minus, Paperclip, PenTool, Sigma, Table, Tag, TextQuote, TriangleAlert, Type, Video, Vote, Workflow } from "lucide-react";
|
|
3
|
+
//#region src/commands/registry.ts
|
|
4
|
+
var COMMAND_GROUPS = [
|
|
5
|
+
{
|
|
6
|
+
id: "basic",
|
|
7
|
+
label: "Basic blocks"
|
|
8
|
+
},
|
|
9
|
+
{
|
|
10
|
+
id: "lists",
|
|
11
|
+
label: "Lists"
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
id: "media",
|
|
15
|
+
label: "Media"
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
id: "rich",
|
|
19
|
+
label: "Rich blocks"
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
id: "layout",
|
|
23
|
+
label: "Layout"
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
id: "embed",
|
|
27
|
+
label: "Embed"
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
id: "inline",
|
|
31
|
+
label: "Inline"
|
|
32
|
+
}
|
|
33
|
+
];
|
|
34
|
+
var COMMAND_REGISTRY = [
|
|
35
|
+
{
|
|
36
|
+
id: "paragraph",
|
|
37
|
+
title: "Text",
|
|
38
|
+
icon: Type,
|
|
39
|
+
group: "basic",
|
|
40
|
+
description: "Plain text block"
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
id: "h1",
|
|
44
|
+
title: "Heading 1",
|
|
45
|
+
icon: Heading1,
|
|
46
|
+
group: "basic",
|
|
47
|
+
description: "Large section heading"
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
id: "h2",
|
|
51
|
+
title: "Heading 2",
|
|
52
|
+
icon: Heading2,
|
|
53
|
+
group: "basic",
|
|
54
|
+
description: "Medium section heading"
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
id: "h3",
|
|
58
|
+
title: "Heading 3",
|
|
59
|
+
icon: Heading3,
|
|
60
|
+
group: "basic",
|
|
61
|
+
description: "Small section heading"
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
id: "quote",
|
|
65
|
+
title: "Quote",
|
|
66
|
+
icon: TextQuote,
|
|
67
|
+
group: "basic",
|
|
68
|
+
description: "Capture a quote"
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
id: "callout",
|
|
72
|
+
title: "Callout",
|
|
73
|
+
icon: Info,
|
|
74
|
+
group: "basic"
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
id: "tip",
|
|
78
|
+
title: "Tip",
|
|
79
|
+
icon: Lightbulb,
|
|
80
|
+
group: "basic"
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
id: "warning",
|
|
84
|
+
title: "Warning",
|
|
85
|
+
icon: TriangleAlert,
|
|
86
|
+
group: "basic"
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
id: "divider",
|
|
90
|
+
title: "Divider",
|
|
91
|
+
icon: Minus,
|
|
92
|
+
group: "basic",
|
|
93
|
+
description: "Visual separator"
|
|
94
|
+
},
|
|
95
|
+
{
|
|
96
|
+
id: "bullet",
|
|
97
|
+
title: "Bulleted list",
|
|
98
|
+
icon: List,
|
|
99
|
+
group: "lists",
|
|
100
|
+
aliases: ["bullet list"],
|
|
101
|
+
description: "Unordered list"
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
id: "number",
|
|
105
|
+
title: "Numbered list",
|
|
106
|
+
icon: ListOrdered,
|
|
107
|
+
group: "lists",
|
|
108
|
+
aliases: ["numbered"],
|
|
109
|
+
description: "Ordered list with numbers"
|
|
110
|
+
},
|
|
111
|
+
{
|
|
112
|
+
id: "check",
|
|
113
|
+
title: "To-do list",
|
|
114
|
+
icon: ListChecks,
|
|
115
|
+
group: "lists",
|
|
116
|
+
aliases: [
|
|
117
|
+
"to-do",
|
|
118
|
+
"todo",
|
|
119
|
+
"checklist"
|
|
120
|
+
],
|
|
121
|
+
description: "Track tasks with checkboxes"
|
|
122
|
+
},
|
|
123
|
+
{
|
|
124
|
+
id: "image",
|
|
125
|
+
title: "Image",
|
|
126
|
+
icon: Image,
|
|
127
|
+
group: "media"
|
|
128
|
+
},
|
|
129
|
+
{
|
|
130
|
+
id: "video",
|
|
131
|
+
title: "Video",
|
|
132
|
+
icon: Video,
|
|
133
|
+
group: "media"
|
|
134
|
+
},
|
|
135
|
+
{
|
|
136
|
+
id: "file",
|
|
137
|
+
title: "File",
|
|
138
|
+
icon: Paperclip,
|
|
139
|
+
group: "media"
|
|
140
|
+
},
|
|
141
|
+
{
|
|
142
|
+
id: "gallery",
|
|
143
|
+
title: "Gallery",
|
|
144
|
+
icon: Images,
|
|
145
|
+
group: "media"
|
|
146
|
+
},
|
|
147
|
+
{
|
|
148
|
+
id: "whiteboard",
|
|
149
|
+
title: "Whiteboard",
|
|
150
|
+
icon: PenTool,
|
|
151
|
+
group: "media"
|
|
152
|
+
},
|
|
153
|
+
{
|
|
154
|
+
id: "code",
|
|
155
|
+
title: "Code block",
|
|
156
|
+
icon: Code,
|
|
157
|
+
group: "rich",
|
|
158
|
+
description: "Syntax-highlighted code"
|
|
159
|
+
},
|
|
160
|
+
{
|
|
161
|
+
id: "math",
|
|
162
|
+
title: "Math block",
|
|
163
|
+
icon: Sigma,
|
|
164
|
+
group: "rich",
|
|
165
|
+
aliases: ["math equation"]
|
|
166
|
+
},
|
|
167
|
+
{
|
|
168
|
+
id: "mermaid",
|
|
169
|
+
title: "Mermaid diagram",
|
|
170
|
+
icon: Workflow,
|
|
171
|
+
group: "rich"
|
|
172
|
+
},
|
|
173
|
+
{
|
|
174
|
+
id: "code-snippet",
|
|
175
|
+
title: "Code snippet",
|
|
176
|
+
icon: FileCode,
|
|
177
|
+
group: "rich"
|
|
178
|
+
},
|
|
179
|
+
{
|
|
180
|
+
id: "chart",
|
|
181
|
+
title: "Chart",
|
|
182
|
+
icon: ChartColumnBig,
|
|
183
|
+
group: "rich"
|
|
184
|
+
},
|
|
185
|
+
{
|
|
186
|
+
id: "poll",
|
|
187
|
+
title: "Poll",
|
|
188
|
+
icon: Vote,
|
|
189
|
+
group: "rich"
|
|
190
|
+
},
|
|
191
|
+
{
|
|
192
|
+
id: "chat",
|
|
193
|
+
title: "Chat",
|
|
194
|
+
icon: MessageSquare,
|
|
195
|
+
group: "rich"
|
|
196
|
+
},
|
|
197
|
+
{
|
|
198
|
+
id: "dynamic",
|
|
199
|
+
title: "Dynamic component",
|
|
200
|
+
icon: Boxes,
|
|
201
|
+
group: "rich"
|
|
202
|
+
},
|
|
203
|
+
{
|
|
204
|
+
id: "nested-doc",
|
|
205
|
+
title: "Nested document",
|
|
206
|
+
icon: FileText,
|
|
207
|
+
group: "rich"
|
|
208
|
+
},
|
|
209
|
+
{
|
|
210
|
+
id: "banner",
|
|
211
|
+
title: "Banner",
|
|
212
|
+
icon: Flag,
|
|
213
|
+
group: "rich"
|
|
214
|
+
},
|
|
215
|
+
{
|
|
216
|
+
id: "details",
|
|
217
|
+
title: "Details",
|
|
218
|
+
icon: ChevronRight,
|
|
219
|
+
group: "rich"
|
|
220
|
+
},
|
|
221
|
+
{
|
|
222
|
+
id: "table",
|
|
223
|
+
title: "Table",
|
|
224
|
+
icon: Table,
|
|
225
|
+
group: "layout",
|
|
226
|
+
description: "Add a table"
|
|
227
|
+
},
|
|
228
|
+
{
|
|
229
|
+
id: "grid",
|
|
230
|
+
title: "Grid",
|
|
231
|
+
icon: LayoutGrid,
|
|
232
|
+
group: "layout"
|
|
233
|
+
},
|
|
234
|
+
{
|
|
235
|
+
id: "steps",
|
|
236
|
+
title: "Steps",
|
|
237
|
+
icon: Footprints,
|
|
238
|
+
group: "layout"
|
|
239
|
+
},
|
|
240
|
+
{
|
|
241
|
+
id: "embed",
|
|
242
|
+
title: "Embed",
|
|
243
|
+
icon: AppWindow,
|
|
244
|
+
group: "embed"
|
|
245
|
+
},
|
|
246
|
+
{
|
|
247
|
+
id: "link-card",
|
|
248
|
+
title: "Link card",
|
|
249
|
+
icon: Link,
|
|
250
|
+
group: "embed"
|
|
251
|
+
},
|
|
252
|
+
{
|
|
253
|
+
id: "mention",
|
|
254
|
+
title: "Mention",
|
|
255
|
+
icon: AtSign,
|
|
256
|
+
group: "inline"
|
|
257
|
+
},
|
|
258
|
+
{
|
|
259
|
+
id: "tag",
|
|
260
|
+
title: "Tag",
|
|
261
|
+
icon: Tag,
|
|
262
|
+
group: "inline"
|
|
263
|
+
},
|
|
264
|
+
{
|
|
265
|
+
id: "comment",
|
|
266
|
+
title: "HTML comment",
|
|
267
|
+
icon: MessageSquareCode,
|
|
268
|
+
group: "inline"
|
|
269
|
+
}
|
|
270
|
+
];
|
|
271
|
+
var TURN_INTO_COMMAND_IDS = [
|
|
272
|
+
"paragraph",
|
|
273
|
+
"h1",
|
|
274
|
+
"h2",
|
|
275
|
+
"h3",
|
|
276
|
+
"bullet",
|
|
277
|
+
"number",
|
|
278
|
+
"check",
|
|
279
|
+
"quote",
|
|
280
|
+
"code"
|
|
281
|
+
];
|
|
282
|
+
var LEGACY_SECTIONS = {
|
|
283
|
+
"basic blocks": "basic",
|
|
284
|
+
"basic": "basic",
|
|
285
|
+
"lists": "lists",
|
|
286
|
+
"list": "lists",
|
|
287
|
+
"media": "media",
|
|
288
|
+
"advanced": "rich",
|
|
289
|
+
"rich blocks": "rich",
|
|
290
|
+
"layout": "layout",
|
|
291
|
+
"embed": "embed",
|
|
292
|
+
"inline": "inline"
|
|
293
|
+
};
|
|
294
|
+
var lookupKey = (value) => value.trim().toLowerCase();
|
|
295
|
+
var metaByKey = /* @__PURE__ */ new Map();
|
|
296
|
+
for (const meta of COMMAND_REGISTRY) for (const key of [
|
|
297
|
+
meta.id,
|
|
298
|
+
meta.title,
|
|
299
|
+
...meta.aliases ?? []
|
|
300
|
+
]) metaByKey.set(lookupKey(key), meta);
|
|
301
|
+
var groupById = new Map(COMMAND_GROUPS.map((group) => [group.id, group]));
|
|
302
|
+
function getCommandMeta(idOrTitle) {
|
|
303
|
+
return metaByKey.get(lookupKey(idOrTitle));
|
|
304
|
+
}
|
|
305
|
+
function getCommandGroupLabel(section) {
|
|
306
|
+
if (!section) return COMMAND_GROUPS[0].label;
|
|
307
|
+
const key = lookupKey(section);
|
|
308
|
+
const groupId = LEGACY_SECTIONS[key] ?? (groupById.has(key) ? key : null);
|
|
309
|
+
if (groupId) return groupById.get(groupId).label;
|
|
310
|
+
if (section === section.toUpperCase()) return section.charAt(0) + section.slice(1).toLowerCase();
|
|
311
|
+
return section;
|
|
312
|
+
}
|
|
313
|
+
function groupRank(label) {
|
|
314
|
+
const index = COMMAND_GROUPS.findIndex((group) => group.label === label);
|
|
315
|
+
return index === -1 ? COMMAND_GROUPS.length : index;
|
|
316
|
+
}
|
|
317
|
+
function normalizeCommandItems(items, options = {}) {
|
|
318
|
+
const iconSize = options.iconSize ?? 20;
|
|
319
|
+
const seen = /* @__PURE__ */ new Set();
|
|
320
|
+
const ranked = [];
|
|
321
|
+
items.forEach((item, position) => {
|
|
322
|
+
const meta = getCommandMeta(item.title);
|
|
323
|
+
const title = meta?.title ?? item.title;
|
|
324
|
+
if (seen.has(title)) return;
|
|
325
|
+
seen.add(title);
|
|
326
|
+
const section = meta ? groupById.get(meta.group).label : getCommandGroupLabel(item.section);
|
|
327
|
+
ranked.push({
|
|
328
|
+
item: {
|
|
329
|
+
...item,
|
|
330
|
+
title,
|
|
331
|
+
section,
|
|
332
|
+
description: item.description ?? meta?.description,
|
|
333
|
+
icon: meta ? createElement(meta.icon, { size: iconSize }) : item.icon
|
|
334
|
+
},
|
|
335
|
+
rank: groupRank(section),
|
|
336
|
+
order: meta ? COMMAND_REGISTRY.indexOf(meta) : COMMAND_REGISTRY.length,
|
|
337
|
+
position
|
|
338
|
+
});
|
|
339
|
+
});
|
|
340
|
+
return ranked.sort((a, b) => a.rank - b.rank || a.order - b.order || a.position - b.position).map((entry) => entry.item);
|
|
341
|
+
}
|
|
342
|
+
//#endregion
|
|
343
|
+
export { COMMAND_GROUPS, COMMAND_REGISTRY, TURN_INTO_COMMAND_IDS, getCommandGroupLabel, getCommandMeta, normalizeCommandItems };
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { LucideIcon } from 'lucide-react';
|
|
2
|
+
import { CommandItemConfig } from '../types/slash-menu';
|
|
3
|
+
export type CommandGroupId = 'basic' | 'lists' | 'media' | 'rich' | 'layout' | 'embed' | 'inline';
|
|
4
|
+
export interface CommandGroup {
|
|
5
|
+
id: CommandGroupId;
|
|
6
|
+
label: string;
|
|
7
|
+
}
|
|
8
|
+
export interface CommandMeta {
|
|
9
|
+
aliases?: readonly string[];
|
|
10
|
+
description?: string;
|
|
11
|
+
group: CommandGroupId;
|
|
12
|
+
icon: LucideIcon;
|
|
13
|
+
id: string;
|
|
14
|
+
title: string;
|
|
15
|
+
}
|
|
16
|
+
export declare const COMMAND_GROUPS: readonly CommandGroup[];
|
|
17
|
+
export declare const COMMAND_REGISTRY: readonly CommandMeta[];
|
|
18
|
+
export declare const TURN_INTO_COMMAND_IDS: readonly string[];
|
|
19
|
+
export declare function getCommandMeta(idOrTitle: string): CommandMeta | undefined;
|
|
20
|
+
export declare function getCommandGroupLabel(section: string | undefined): string;
|
|
21
|
+
export declare function normalizeCommandItems<T extends CommandItemConfig>(items: readonly T[], options?: {
|
|
22
|
+
iconSize?: number;
|
|
23
|
+
}): T[];
|
|
24
|
+
//# sourceMappingURL=registry.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../src/commands/registry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAyC/C,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAE7D,MAAM,MAAM,cAAc,GAAG,OAAO,GAAG,OAAO,GAAG,OAAO,GAAG,MAAM,GAAG,QAAQ,GAAG,OAAO,GAAG,QAAQ,CAAC;AAElG,MAAM,WAAW,YAAY;IAC3B,EAAE,EAAE,cAAc,CAAC;IACnB,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,WAAW;IAC1B,OAAO,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAC5B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,KAAK,EAAE,cAAc,CAAC;IACtB,IAAI,EAAE,UAAU,CAAC;IACjB,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;CACf;AAED,eAAO,MAAM,cAAc,EAAE,SAAS,YAAY,EAQjD,CAAC;AAEF,eAAO,MAAM,gBAAgB,EAAE,SAAS,WAAW,EAwFlD,CAAC;AAEF,eAAO,MAAM,qBAAqB,EAAE,SAAS,MAAM,EAUlD,CAAC;AA0BF,wBAAgB,cAAc,CAAC,SAAS,EAAE,MAAM,GAAG,WAAW,GAAG,SAAS,CAEzE;AAED,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,CAOxE;AAOD,wBAAgB,qBAAqB,CAAC,CAAC,SAAS,iBAAiB,EAC/D,KAAK,EAAE,SAAS,CAAC,EAAE,EACnB,OAAO,GAAE;IAAE,QAAQ,CAAC,EAAE,MAAM,CAAA;CAAO,GAClC,CAAC,EAAE,CA4BL"}
|
package/dist/commands-entry.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { V as OPEN_FILE_PICKER_COMMAND, k as OPEN_IMAGE_UPLOAD_DIALOG_COMMAND, o as $createSpoilerNode,
|
|
2
|
-
import { i as INSERT_KATEX_INLINE_COMMAND, l as INSERT_ALERT_COMMAND, o as INSERT_IMAGE_COMMAND, r as INSERT_KATEX_BLOCK_COMMAND, t as INSERT_MERMAID_COMMAND } from "./MermaidPlugin-
|
|
1
|
+
import { K as extractTextContent, V as OPEN_FILE_PICKER_COMMAND, k as OPEN_IMAGE_UPLOAD_DIALOG_COMMAND, o as $createSpoilerNode, s as $isSpoilerNode } from "./theme-DH4xzxU-.js";
|
|
2
|
+
import { i as INSERT_KATEX_INLINE_COMMAND, l as INSERT_ALERT_COMMAND, o as INSERT_IMAGE_COMMAND, r as INSERT_KATEX_BLOCK_COMMAND, t as INSERT_MERMAID_COMMAND } from "./MermaidPlugin-BCoGsdi3.js";
|
|
3
3
|
import { $createTextNode, $getSelection, $isRangeSelection } from "lexical";
|
|
4
4
|
//#region src/utils/collect-command-items.ts
|
|
5
5
|
function collectCommandItems(editor) {
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { EditorSurfaceProps } from '../context/EditorSurfaceContext';
|
|
2
|
+
export declare function EditorSurfaceHost(props: Omit<EditorSurfaceProps, 'plugins' | 'onActiveEditorChange' | 'retainSurface'>): import('react').JSX.Element | null;
|
|
3
|
+
//# sourceMappingURL=EditorSurfaceHost.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EditorSurfaceHost.d.ts","sourceRoot":"","sources":["../../src/components/EditorSurfaceHost.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,iCAAiC,CAAC;AA+B1E,wBAAgB,iBAAiB,CAC/B,KAAK,EAAE,IAAI,CAAC,kBAAkB,EAAE,SAAS,GAAG,sBAAsB,GAAG,eAAe,CAAC,sCAwBtF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RichEditor.d.ts","sourceRoot":"","sources":["../../src/components/RichEditor.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"RichEditor.d.ts","sourceRoot":"","sources":["../../src/components/RichEditor.tsx"],"names":[],"mappings":"AAiBA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAIhD,wBAAgB,UAAU,CAAC,EACzB,UAAU,EACV,WAAW,EACX,WAAW,EACX,UAAU,EACV,QAAQ,EACR,GAAG,UAAU,EACd,EAAE,eAAe,+BAgCjB"}
|
|
@@ -3,6 +3,7 @@ import { ReactNode } from 'react';
|
|
|
3
3
|
import { ColorScheme } from '../context/ColorSchemeContext';
|
|
4
4
|
import { RichEditorVariant } from '../types';
|
|
5
5
|
import { RendererConfig } from '../types/renderer-config';
|
|
6
|
+
import { EditorVirtualization } from '../virtualization/types';
|
|
6
7
|
export interface RichEditorShellProps {
|
|
7
8
|
actions?: ReactNode;
|
|
8
9
|
autoFocus?: boolean;
|
|
@@ -21,6 +22,7 @@ export interface RichEditorShellProps {
|
|
|
21
22
|
style?: React.CSSProperties;
|
|
22
23
|
theme?: ColorScheme;
|
|
23
24
|
variant?: RichEditorVariant;
|
|
25
|
+
virtualization?: EditorVirtualization;
|
|
24
26
|
}
|
|
25
|
-
export declare function RichEditorShell({ nodes, initialValue, onChange, variant, theme, placeholder, onSubmit, autoFocus, className, contentClassName, style, actions, header, onEditorReady, rendererConfig, debounceMs, children, }: RichEditorShellProps): import('react').JSX.Element;
|
|
27
|
+
export declare function RichEditorShell({ nodes, initialValue, onChange, variant, theme, placeholder, onSubmit, autoFocus, className, contentClassName, style, actions, header, onEditorReady, rendererConfig, debounceMs, children, virtualization, }: RichEditorShellProps): import('react').JSX.Element;
|
|
26
28
|
//# sourceMappingURL=RichEditorShell.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RichEditorShell.d.ts","sourceRoot":"","sources":["../../src/components/RichEditorShell.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"RichEditorShell.d.ts","sourceRoot":"","sources":["../../src/components/RichEditorShell.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EACV,KAAK,EACL,aAAa,EACb,WAAW,EACX,sBAAsB,EACtB,qBAAqB,EACtB,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,KAAK,SAAS,EAAW,MAAM,OAAO,CAAC;AAEhD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAC;AAejE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAClD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAE/D,OAAO,KA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Convenience adapter. The core surface host never inspects virtualization options. */
|
|
3
|
+
export declare function VirtualizationFromProps({ value }: {
|
|
4
|
+
value?: EditorVirtualization;
|
|
5
|
+
}): import('react').JSX.Element | null;
|
|
6
|
+
//# sourceMappingURL=VirtualizationFromProps.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"VirtualizationFromProps.d.ts","sourceRoot":"","sources":["../../src/components/VirtualizationFromProps.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;AAGpE,wFAAwF;AACxF,wBAAgB,uBAAuB,CAAC,EAAE,KAAK,EAAE,EAAE;IAAE,KAAK,CAAC,EAAE,oBAAoB,CAAA;CAAE,sCAOlF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GridEditDecorator.d.ts","sourceRoot":"","sources":["../../../src/components/decorators/GridEditDecorator.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"GridEditDecorator.d.ts","sourceRoot":"","sources":["../../../src/components/decorators/GridEditDecorator.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAc7C,UAAU,sBAAsB;IAC9B,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,WAAW,EAAE,aAAa,EAAE,CAAC;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,MAAM,CAAC;IACZ,OAAO,EAAE,MAAM,CAAC;CACjB;AAqCD,wBAAgB,iBAAiB,CAAC,EAChC,OAAO,EACP,gBAAgB,EAChB,IAAI,EAAE,WAAW,EACjB,GAAG,EACH,WAAW,GACZ,EAAE,sBAAsB,+BA+IxB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ImageRenderer.d.ts","sourceRoot":"","sources":["../../../src/components/renderers/ImageRenderer.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAQzD,MAAM,WAAW,kBAAkB;IACjC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB,GAAG,EAAE,MAAM,CAAC;IACZ,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,wBAAgB,aAAa,CAAC,EAC5B,GAAG,EACH,OAAO,EACP,KAAK,EACL,MAAM,EACN,OAAO,EACP,SAAS,EACT,MAAM,EACN,YAAY,EACZ,UAAU,EACV,WAAW,EACX,MAAM,GACP,EAAE,kBAAkB,+BA+GpB"}
|
|
1
|
+
{"version":3,"file":"ImageRenderer.d.ts","sourceRoot":"","sources":["../../../src/components/renderers/ImageRenderer.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAQzD,MAAM,WAAW,kBAAkB;IACjC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB,GAAG,EAAE,MAAM,CAAC;IACZ,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,wBAAgB,aAAa,CAAC,EAC5B,GAAG,EACH,OAAO,EACP,KAAK,EACL,MAAM,EACN,OAAO,EACP,SAAS,EACT,MAAM,EACN,YAAY,EACZ,UAAU,EACV,WAAW,EACX,MAAM,GACP,EAAE,kBAAkB,+BA+GpB"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { LexicalEditor, NodeKey } from 'lexical';
|
|
2
|
+
export interface EditorBlockBinding {
|
|
3
|
+
active: boolean;
|
|
4
|
+
blockId: string;
|
|
5
|
+
editor: LexicalEditor;
|
|
6
|
+
nodeState: (key?: NodeKey) => Map<string, unknown>;
|
|
7
|
+
retain: () => () => void;
|
|
8
|
+
}
|
|
9
|
+
export declare const EditorBlockContext: import('react').Context<EditorBlockBinding | null>;
|
|
10
|
+
/** Optional logical block identity/state for views that rebind editing instances. */
|
|
11
|
+
export declare function useEditorBlock(): EditorBlockBinding | null;
|
|
12
|
+
//# sourceMappingURL=EditorBlockContext.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EditorBlockContext.d.ts","sourceRoot":"","sources":["../../src/context/EditorBlockContext.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAGtD,MAAM,WAAW,kBAAkB;IACjC,MAAM,EAAE,OAAO,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,aAAa,CAAC;IACtB,SAAS,EAAE,CAAC,GAAG,CAAC,EAAE,OAAO,KAAK,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACnD,MAAM,EAAE,MAAM,MAAM,IAAI,CAAC;CAC1B;AACD,eAAO,MAAM,kBAAkB,oDAAiD,CAAC;AACjF,qFAAqF;AACrF,wBAAgB,cAAc,8BAE7B"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { LexicalEditor } from 'lexical';
|
|
2
|
+
import { ComponentType, ReactNode } from 'react';
|
|
3
|
+
export interface EditorSurfaceProps {
|
|
4
|
+
autoFocus?: boolean;
|
|
5
|
+
className?: string;
|
|
6
|
+
hasHeader?: boolean;
|
|
7
|
+
onActiveEditorChange: (editor: LexicalEditor | null) => void;
|
|
8
|
+
placeholder?: string;
|
|
9
|
+
plugins?: ReactNode;
|
|
10
|
+
/** Keep the current surface alive until a UI operation or async edit has finished. */
|
|
11
|
+
retainSurface: () => () => void;
|
|
12
|
+
}
|
|
13
|
+
type Surface = ComponentType<EditorSurfaceProps>;
|
|
14
|
+
interface SurfaceContext {
|
|
15
|
+
activeEditor: LexicalEditor | null;
|
|
16
|
+
plugins: ReactNode;
|
|
17
|
+
registerPlugins: (key: string, plugins: ReactNode) => () => void;
|
|
18
|
+
registerSurface: (key: string, surface: Surface | null, priority: number) => () => void;
|
|
19
|
+
retainSurface: () => () => void;
|
|
20
|
+
setActiveEditor: (editor: LexicalEditor | null) => void;
|
|
21
|
+
surface: Surface | null;
|
|
22
|
+
}
|
|
23
|
+
export declare function EditorSurfaceProvider({ children }: {
|
|
24
|
+
children: ReactNode;
|
|
25
|
+
}): import('react').JSX.Element;
|
|
26
|
+
export declare function useEditorSurface(): SurfaceContext;
|
|
27
|
+
/** Register an editing surface; null explicitly selects the standard surface. */
|
|
28
|
+
export declare function EditorSurfacePlugin({ surface, priority, }: {
|
|
29
|
+
surface: Surface | null;
|
|
30
|
+
priority?: number;
|
|
31
|
+
}): null;
|
|
32
|
+
/** Mount DOM/selection plugins inside whichever editing surface is installed. */
|
|
33
|
+
export declare function EditorSurfacePlugins({ children }: {
|
|
34
|
+
children: ReactNode;
|
|
35
|
+
}): null;
|
|
36
|
+
export declare function useActiveEditor(): LexicalEditor | null;
|
|
37
|
+
/** Keep document-level history/save outside this scope; toolbar actions belong inside it. */
|
|
38
|
+
export declare function ActiveEditorScope({ children }: {
|
|
39
|
+
children: ReactNode;
|
|
40
|
+
}): import('react').JSX.Element;
|
|
41
|
+
export {};
|
|
42
|
+
//# sourceMappingURL=EditorSurfaceContext.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EditorSurfaceContext.d.ts","sourceRoot":"","sources":["../../src/context/EditorSurfaceContext.tsx"],"names":[],"mappings":"AAIA,OAAO,EAIL,KAAK,aAAa,EACnB,MAAM,SAAS,CAAC;AACjB,OAAO,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AActD,MAAM,WAAW,kBAAkB;IACjC,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,oBAAoB,EAAE,CAAC,MAAM,EAAE,aAAa,GAAG,IAAI,KAAK,IAAI,CAAC;IAC7D,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,OAAO,CAAC,EAAE,SAAS,CAAC;IACpB,sFAAsF;IACtF,aAAa,EAAE,MAAM,MAAM,IAAI,CAAC;CACjC;AACD,KAAK,OAAO,GAAG,aAAa,CAAC,kBAAkB,CAAC,CAAC;AAKjD,UAAU,cAAc;IACtB,YAAY,EAAE,aAAa,GAAG,IAAI,CAAC;IACnC,OAAO,EAAE,SAAS,CAAC;IACnB,eAAe,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,EAAE,SAAS,KAAK,MAAM,IAAI,CAAC;IACjE,eAAe,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,GAAG,IAAI,EAAE,QAAQ,EAAE,MAAM,KAAK,MAAM,IAAI,CAAC;IACxF,aAAa,EAAE,MAAM,MAAM,IAAI,CAAC;IAChC,eAAe,EAAE,CAAC,MAAM,EAAE,aAAa,GAAG,IAAI,KAAK,IAAI,CAAC;IACxD,OAAO,EAAE,OAAO,GAAG,IAAI,CAAC;CACzB;AAGD,wBAAgB,qBAAqB,CAAC,EAAE,QAAQ,EAAE,EAAE;IAAE,QAAQ,EAAE,SAAS,CAAA;CAAE,+BA2F1E;AACD,wBAAgB,gBAAgB,mBAI/B;AACD,iFAAiF;AACjF,wBAAgB,mBAAmB,CAAC,EAClC,OAAO,EACP,QAAY,GACb,EAAE;IACD,OAAO,EAAE,OAAO,GAAG,IAAI,CAAC;IACxB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB,QAQA;AACD,iFAAiF;AACjF,wBAAgB,oBAAoB,CAAC,EAAE,QAAQ,EAAE,EAAE;IAAE,QAAQ,EAAE,SAAS,CAAA;CAAE,QAKzE;AACD,wBAAgB,eAAe,yBAE9B;AACD,6FAA6F;AAC7F,wBAAgB,iBAAiB,CAAC,EAAE,QAAQ,EAAE,EAAE;IAAE,QAAQ,EAAE,SAAS,CAAA;CAAE,+BAQtE"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
//#region \0@oxc-project+runtime@0.154.0/helpers/esm/typeof.js
|
|
2
|
+
function _typeof(o) {
|
|
3
|
+
"@babel/helpers - typeof";
|
|
4
|
+
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o) {
|
|
5
|
+
return typeof o;
|
|
6
|
+
} : function(o) {
|
|
7
|
+
return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
|
|
8
|
+
}, _typeof(o);
|
|
9
|
+
}
|
|
10
|
+
//#endregion
|
|
11
|
+
//#region \0@oxc-project+runtime@0.154.0/helpers/esm/toPrimitive.js
|
|
12
|
+
function toPrimitive(t, r) {
|
|
13
|
+
if ("object" != _typeof(t) || !t) return t;
|
|
14
|
+
var e = t[Symbol.toPrimitive];
|
|
15
|
+
if (void 0 !== e) {
|
|
16
|
+
var i = e.call(t, r || "default");
|
|
17
|
+
if ("object" != _typeof(i)) return i;
|
|
18
|
+
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
19
|
+
}
|
|
20
|
+
return ("string" === r ? String : Number)(t);
|
|
21
|
+
}
|
|
22
|
+
//#endregion
|
|
23
|
+
//#region \0@oxc-project+runtime@0.154.0/helpers/esm/toPropertyKey.js
|
|
24
|
+
function toPropertyKey(t) {
|
|
25
|
+
var i = toPrimitive(t, "string");
|
|
26
|
+
return "symbol" == _typeof(i) ? i : i + "";
|
|
27
|
+
}
|
|
28
|
+
//#endregion
|
|
29
|
+
//#region \0@oxc-project+runtime@0.154.0/helpers/esm/defineProperty.js
|
|
30
|
+
function _defineProperty(e, r, t) {
|
|
31
|
+
return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
|
|
32
|
+
value: t,
|
|
33
|
+
enumerable: !0,
|
|
34
|
+
configurable: !0,
|
|
35
|
+
writable: !0
|
|
36
|
+
}) : e[r] = t, e;
|
|
37
|
+
}
|
|
38
|
+
//#endregion
|
|
39
|
+
export { _defineProperty as t };
|
package/dist/index.d.ts
CHANGED
|
@@ -9,6 +9,9 @@ export { RichEditorShell } from './components/RichEditorShell';
|
|
|
9
9
|
export { getVariantClass } from './components/utils';
|
|
10
10
|
export type { ColorScheme } from './context/ColorSchemeContext';
|
|
11
11
|
export { ColorSchemeProvider, useColorScheme } from './context/ColorSchemeContext';
|
|
12
|
+
export { useEditorBlock, useEditorBlock as useVirtualizedBlock, } from './context/EditorBlockContext';
|
|
13
|
+
export type { EditorSurfaceProps } from './context/EditorSurfaceContext';
|
|
14
|
+
export { ActiveEditorScope, EditorSurfacePlugin, EditorSurfacePlugins, useActiveEditor, } from './context/EditorSurfaceContext';
|
|
12
15
|
export { ExtraNodesProvider, useExtraNodes } from './context/ExtraNodesContext';
|
|
13
16
|
export type { FootnoteDefinitionsContextValue } from './context/FootnoteDefinitionsContext';
|
|
14
17
|
export { FootnoteDefinitionsProvider, useFootnoteContent, useFootnoteDefinitions, useFootnoteDisplayNumber, } from './context/FootnoteDefinitionsContext';
|
|
@@ -22,6 +25,7 @@ export type { TextSelectionStore, TextSelectionStoreState } from './context/Text
|
|
|
22
25
|
export { createTextSelectionStore, TextSelectionStoreProvider, useTextSelectionSnapshot, useTextSelectionStore, } from './context/TextSelectionContext';
|
|
23
26
|
export { createNestedEditor, NESTED_EDITOR_NODES } from './nodes/shared';
|
|
24
27
|
export { blockIdState } from './plugins/BlockIdPlugin';
|
|
28
|
+
export { VirtualizationPlugin } from './plugins/VirtualizationPlugin';
|
|
25
29
|
export * from './styles';
|
|
26
30
|
export type { RichEditorProps, RichEditorVariant } from './types';
|
|
27
31
|
export type { RendererConfig } from './types/renderer-config';
|
|
@@ -32,4 +36,5 @@ export { registerNestedEditorSync } from './utils/nested-editor-sync';
|
|
|
32
36
|
export type { DOMSelectionTarget, TextSelectionSnapshot } from './utils/text-selection';
|
|
33
37
|
export { $captureTextSelection, $captureTextSelectionFromRangeSelection, $restoreTextSelection, createDOMRangeFromTextSelection, findDOMPointByTextOffset, getBlockElementById, getDOMRectFromTextSelection, getTextOffsetFromDOMPoint, } from './utils/text-selection';
|
|
34
38
|
export { TEXT_SELECTION_HIGHLIGHT_NAME } from './utils/text-selection-constants';
|
|
39
|
+
export type { EditorVirtualization, EditorVirtualizationOptions } from './virtualization/types';
|
|
35
40
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACvD,OAAO,EAAE,uBAAuB,EAAE,MAAM,iDAAiD,CAAC;AAC1F,OAAO,EAAE,mBAAmB,EAAE,MAAM,6CAA6C,CAAC;AAClF,YAAY,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AACjE,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACvD,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AACrD,YAAY,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAC;AACzE,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAC/D,OAAO,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