@haklex/rich-editor 0.0.81 → 0.0.83

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.
Files changed (66) hide show
  1. package/dist/AlertQuoteEditNode-B2q-1u6S.js +293 -0
  2. package/dist/KaTeXRenderer-BFryJSIS.js +218 -0
  3. package/dist/LinkCardRenderer-QmkOlyXb.js +36 -0
  4. package/dist/MermaidPlugin-BEtIhQHn.js +97 -0
  5. package/dist/PresentDialogContext-D5dHWtzD.js +58 -0
  6. package/dist/RubyRenderer-cm5eDc9q.js +14 -0
  7. package/dist/SubmitShortcutPlugin-o2y6b-8f.js +1650 -0
  8. package/dist/commands-entry.mjs +23 -14
  9. package/dist/components/LinkFavicon.d.ts.map +1 -1
  10. package/dist/components/renderers/FootnoteRenderer.d.ts.map +1 -1
  11. package/dist/components/renderers/FootnoteSectionEditRenderer.d.ts.map +1 -1
  12. package/dist/components/renderers/FootnoteSectionRenderer.d.ts.map +1 -1
  13. package/dist/components/renderers/FootnoteStaticRenderer.d.ts.map +1 -1
  14. package/dist/components/renderers/RubyRenderer.d.ts.map +1 -1
  15. package/dist/components/renderers/TagRenderer.d.ts.map +1 -1
  16. package/dist/config-BP_kyJbW.js +1363 -0
  17. package/dist/config-edit.d.ts.map +1 -1
  18. package/dist/config.d.ts.map +1 -1
  19. package/dist/context/NestedContentRendererContext.d.ts +2 -1
  20. package/dist/context/NestedContentRendererContext.d.ts.map +1 -1
  21. package/dist/favicon-BQgbXF_a.js +43 -0
  22. package/dist/index.mjs +283 -259
  23. package/dist/node-registry-Dzp7X3R4.js +811 -0
  24. package/dist/nodes/AlertQuoteNode.d.ts.map +1 -1
  25. package/dist/nodes/CommentNode.d.ts +21 -0
  26. package/dist/nodes/CommentNode.d.ts.map +1 -0
  27. package/dist/nodes/FootnoteNode.d.ts.map +1 -1
  28. package/dist/nodes/FootnoteSectionNode.d.ts.map +1 -1
  29. package/dist/nodes/RubyNode.d.ts.map +1 -1
  30. package/dist/nodes/SpoilerNode.d.ts.map +1 -1
  31. package/dist/nodes/TagNode.d.ts.map +1 -1
  32. package/dist/nodes-entry.d.ts +2 -0
  33. package/dist/nodes-entry.d.ts.map +1 -1
  34. package/dist/nodes-entry.mjs +50 -7
  35. package/dist/plugins/MarkdownPastePlugin.d.ts.map +1 -1
  36. package/dist/plugins-entry.mjs +27 -10
  37. package/dist/renderers-entry.mjs +61 -40
  38. package/dist/rich-editor.css +1 -2
  39. package/dist/static-entry.d.ts +1 -1
  40. package/dist/static-entry.d.ts.map +1 -1
  41. package/dist/static-entry.mjs +55 -16
  42. package/dist/styles/shared.css.d.ts +164 -0
  43. package/dist/styles/shared.css.d.ts.map +1 -1
  44. package/dist/styles/theme.d.ts.map +1 -1
  45. package/dist/styles-entry.d.ts +2 -2
  46. package/dist/styles-entry.d.ts.map +1 -1
  47. package/dist/styles-entry.mjs +14 -3
  48. package/dist/theme-Cg8JUW_j.js +1034 -0
  49. package/dist/transformers/comment.d.ts +4 -0
  50. package/dist/transformers/comment.d.ts.map +1 -0
  51. package/dist/transformers/index.d.ts +1 -0
  52. package/dist/transformers/index.d.ts.map +1 -1
  53. package/dist/utils-gy2c_HWc.js +24 -0
  54. package/package.json +4 -4
  55. package/dist/AlertQuoteEditNode-BDoonB4u.js +0 -267
  56. package/dist/KaTeXRenderer-BsyRH5_t.js +0 -214
  57. package/dist/LinkCardRenderer-OEMBDUhD.js +0 -45
  58. package/dist/MermaidPlugin-Df2Cm2yX.js +0 -67
  59. package/dist/PresentDialogContext-DQw6MrNh.js +0 -59
  60. package/dist/RubyRenderer-BpDb_amz.js +0 -14
  61. package/dist/SubmitShortcutPlugin-6IvsbZD-.js +0 -1463
  62. package/dist/config-tfg1FWhG.js +0 -1149
  63. package/dist/favicon-DIWusrrw.js +0 -41
  64. package/dist/node-registry-CeVi2y9f.js +0 -666
  65. package/dist/shared.css-wgGgtK_e.js +0 -23
  66. package/dist/theme-DHOUKKSr.js +0 -1034
@@ -0,0 +1,1363 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
3
+ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
4
+ import { CodeNode } from "@lexical/code";
5
+ import { HorizontalRuleNode } from "@lexical/extension";
6
+ import { LinkNode, AutoLinkNode } from "@lexical/link";
7
+ import { ListNode, ListItemNode } from "@lexical/list";
8
+ import { HeadingNode, QuoteNode } from "@lexical/rich-text";
9
+ import { TableNode, TableCellNode, TableRowNode } from "@lexical/table";
10
+ import { u as useNestedContentRenderer, o as extractTextContent, S as SpoilerNode, M as MentionNode, k as KaTeXInlineNode, K as KaTeXBlockNode, I as ImageNode, s as AlertQuoteNode, F as FootnoteNode, l as MermaidNode, T as TagNode } from "./theme-Cg8JUW_j.js";
11
+ import { DecoratorNode, $insertNodes, TextNode, ElementNode, $createTextNode } from "lexical";
12
+ import { createElement, createContext, use, useState, useRef, useEffect, useCallback } from "react";
13
+ import { jsx, jsxs } from "react/jsx-runtime";
14
+ import { a as RendererWrapper, g as useVariant, c as createRendererDecoration, b as useFootnoteDefinitions } from "./KaTeXRenderer-BFryJSIS.js";
15
+ import { Code, MessageSquareQuote, ChevronRight, Link, Video } from "lucide-react";
16
+ import { s as semanticClassNames, b as sharedStyles, d as clsx } from "./utils-gy2c_HWc.js";
17
+ import { L as LinkCardRenderer } from "./LinkCardRenderer-QmkOlyXb.js";
18
+ const BannerRenderer = ({ type }) => {
19
+ return /* @__PURE__ */ jsx("span", { className: `rich-banner-icon rich-banner-icon-${type}` });
20
+ };
21
+ function BannerStaticDecorator({ bannerType, contentState }) {
22
+ const renderContent = useNestedContentRenderer();
23
+ return /* @__PURE__ */ jsxs("div", { className: "rich-banner-inner", children: [
24
+ /* @__PURE__ */ jsx(
25
+ RendererWrapper,
26
+ {
27
+ defaultRenderer: BannerRenderer,
28
+ props: { type: bannerType },
29
+ rendererKey: "Banner"
30
+ }
31
+ ),
32
+ /* @__PURE__ */ jsx("div", { className: "rich-banner-content", children: renderContent(contentState) })
33
+ ] });
34
+ }
35
+ const LEGACY_TYPE_MAP = {
36
+ info: "note",
37
+ success: "tip",
38
+ error: "caution"
39
+ };
40
+ function normalizeBannerType(type) {
41
+ if (type in LEGACY_TYPE_MAP) return LEGACY_TYPE_MAP[type];
42
+ return type || "note";
43
+ }
44
+ const BANNER_TYPES = [
45
+ "note",
46
+ "tip",
47
+ "important",
48
+ "warning",
49
+ "caution"
50
+ ];
51
+ const BANNER_LABELS = {
52
+ note: "Note",
53
+ tip: "Tip",
54
+ important: "Important",
55
+ warning: "Warning",
56
+ caution: "Caution"
57
+ };
58
+ class BannerNode extends DecoratorNode {
59
+ constructor(bannerType, contentState, key) {
60
+ super(key);
61
+ __publicField(this, "__bannerType");
62
+ __publicField(this, "__contentState");
63
+ this.__bannerType = bannerType;
64
+ this.__contentState = contentState || {
65
+ root: {
66
+ children: [
67
+ {
68
+ type: "paragraph",
69
+ children: [],
70
+ direction: null,
71
+ format: "",
72
+ indent: 0,
73
+ textFormat: 0,
74
+ textStyle: "",
75
+ version: 1
76
+ }
77
+ ],
78
+ direction: null,
79
+ format: "",
80
+ indent: 0,
81
+ type: "root",
82
+ version: 1
83
+ }
84
+ };
85
+ }
86
+ static getType() {
87
+ return "banner";
88
+ }
89
+ static clone(node) {
90
+ return new BannerNode(node.__bannerType, node.__contentState, node.__key);
91
+ }
92
+ createDOM(_config) {
93
+ const div = document.createElement("div");
94
+ div.className = `rich-banner rich-banner-${this.__bannerType}`;
95
+ return div;
96
+ }
97
+ updateDOM(prevNode, dom) {
98
+ if (prevNode.__bannerType !== this.__bannerType) {
99
+ dom.className = `rich-banner rich-banner-${this.__bannerType}`;
100
+ }
101
+ return false;
102
+ }
103
+ isInline() {
104
+ return false;
105
+ }
106
+ getBannerType() {
107
+ return this.__bannerType;
108
+ }
109
+ setBannerType(bannerType) {
110
+ const writable = this.getWritable();
111
+ writable.__bannerType = bannerType;
112
+ }
113
+ getContentState() {
114
+ return this.getLatest().__contentState;
115
+ }
116
+ setContentState(state) {
117
+ const writable = this.getWritable();
118
+ writable.__contentState = state;
119
+ }
120
+ getTextContent() {
121
+ return extractTextContent(this.__contentState);
122
+ }
123
+ static importJSON(serializedNode) {
124
+ const legacy = serializedNode;
125
+ const bannerType = normalizeBannerType(serializedNode.bannerType);
126
+ if (serializedNode.content) {
127
+ return new BannerNode(bannerType, serializedNode.content);
128
+ }
129
+ if (legacy.children) {
130
+ const content = {
131
+ root: {
132
+ children: legacy.children,
133
+ direction: null,
134
+ format: "",
135
+ indent: 0,
136
+ type: "root",
137
+ version: 1
138
+ }
139
+ };
140
+ return new BannerNode(bannerType, content);
141
+ }
142
+ return new BannerNode(bannerType);
143
+ }
144
+ exportJSON() {
145
+ return {
146
+ ...super.exportJSON(),
147
+ type: "banner",
148
+ bannerType: this.__bannerType,
149
+ content: this.__contentState,
150
+ version: 1
151
+ };
152
+ }
153
+ decorate(_editor, _config) {
154
+ return createElement(BannerStaticDecorator, {
155
+ bannerType: this.__bannerType,
156
+ contentState: this.__contentState
157
+ });
158
+ }
159
+ }
160
+ function $isBannerNode(node) {
161
+ return node instanceof BannerNode;
162
+ }
163
+ const ColorSchemeContext = createContext("light");
164
+ function ColorSchemeProvider({
165
+ colorScheme,
166
+ children
167
+ }) {
168
+ return /* @__PURE__ */ jsx(ColorSchemeContext.Provider, { value: colorScheme, children });
169
+ }
170
+ function useColorScheme() {
171
+ return use(ColorSchemeContext);
172
+ }
173
+ let codeToHtmlFn = null;
174
+ let shikiLoadPromise = null;
175
+ function loadCodeToHtml() {
176
+ if (codeToHtmlFn) return Promise.resolve(codeToHtmlFn);
177
+ if (!shikiLoadPromise) {
178
+ shikiLoadPromise = import("shiki/bundle/web").then((mod) => {
179
+ codeToHtmlFn = mod.codeToHtml;
180
+ return mod.codeToHtml;
181
+ }).catch((err) => {
182
+ shikiLoadPromise = null;
183
+ throw err;
184
+ });
185
+ }
186
+ return shikiLoadPromise;
187
+ }
188
+ function CodeBlockRenderer({
189
+ code,
190
+ language,
191
+ showLineNumbers: showLineNumbersProp
192
+ }) {
193
+ const variant = useVariant();
194
+ const showLineNumbers = showLineNumbersProp ?? variant !== "comment";
195
+ const colorScheme = useColorScheme();
196
+ const shikiTheme = colorScheme === "dark" ? "github-dark" : "github-light";
197
+ const [highlightedHtml, setHighlightedHtml] = useState(null);
198
+ const [copied, setCopied] = useState(false);
199
+ const copyTimerRef = useRef(void 0);
200
+ useEffect(() => {
201
+ let cancelled = false;
202
+ setHighlightedHtml(null);
203
+ loadCodeToHtml().then(
204
+ (toHtml) => toHtml(code, {
205
+ lang: language,
206
+ theme: shikiTheme
207
+ })
208
+ ).then((html) => {
209
+ if (!cancelled) {
210
+ setHighlightedHtml(html);
211
+ }
212
+ }).catch(() => {
213
+ if (!cancelled) {
214
+ setHighlightedHtml(null);
215
+ }
216
+ });
217
+ return () => {
218
+ cancelled = true;
219
+ };
220
+ }, [code, language, shikiTheme]);
221
+ useEffect(() => {
222
+ return () => clearTimeout(copyTimerRef.current);
223
+ }, []);
224
+ const handleCopy = useCallback(() => {
225
+ navigator.clipboard.writeText(code).then(() => {
226
+ setCopied(true);
227
+ clearTimeout(copyTimerRef.current);
228
+ copyTimerRef.current = setTimeout(() => setCopied(false), 2e3);
229
+ }).catch(() => {
230
+ });
231
+ }, [code]);
232
+ const header = language ? /* @__PURE__ */ jsxs("div", { className: "rich-code-block-header", children: [
233
+ /* @__PURE__ */ jsx("span", { className: "rich-code-block-lang", children: language }),
234
+ /* @__PURE__ */ jsx(
235
+ "button",
236
+ {
237
+ "aria-label": copied ? "Copied to clipboard" : "Copy code",
238
+ className: "rich-code-block-copy",
239
+ type: "button",
240
+ onClick: handleCopy,
241
+ children: copied ? "Copied" : "Copy"
242
+ }
243
+ )
244
+ ] }) : null;
245
+ const wrapperClass = showLineNumbers ? "rich-code-block rich-code-block-numbered" : "rich-code-block";
246
+ if (highlightedHtml) {
247
+ return /* @__PURE__ */ jsxs("div", { className: wrapperClass, children: [
248
+ header,
249
+ /* @__PURE__ */ jsx("div", { dangerouslySetInnerHTML: { __html: highlightedHtml } })
250
+ ] });
251
+ }
252
+ const lines = code.split("\n");
253
+ return /* @__PURE__ */ jsxs("div", { className: wrapperClass, children: [
254
+ header,
255
+ /* @__PURE__ */ jsx("pre", { children: /* @__PURE__ */ jsx("code", { children: lines.map((line, i) => /* @__PURE__ */ jsxs("span", { className: "line", children: [
256
+ line,
257
+ i < lines.length - 1 ? "\n" : ""
258
+ ] }, i)) }) })
259
+ ] });
260
+ }
261
+ const _CodeBlockNode = class _CodeBlockNode extends DecoratorNode {
262
+ constructor(code, language, key) {
263
+ super(key);
264
+ __publicField(this, "__code");
265
+ __publicField(this, "__language");
266
+ this.__code = code;
267
+ this.__language = language;
268
+ }
269
+ static getType() {
270
+ return "code-block";
271
+ }
272
+ static clone(node) {
273
+ return new _CodeBlockNode(node.__code, node.__language, node.__key);
274
+ }
275
+ createDOM(_config) {
276
+ const div = document.createElement("div");
277
+ div.className = "rich-code-block-wrapper";
278
+ return div;
279
+ }
280
+ updateDOM() {
281
+ return false;
282
+ }
283
+ isInline() {
284
+ return false;
285
+ }
286
+ isKeyboardSelectable() {
287
+ return true;
288
+ }
289
+ static importJSON(serializedNode) {
290
+ return $createCodeBlockNode(serializedNode.code, serializedNode.language);
291
+ }
292
+ exportJSON() {
293
+ return {
294
+ ...super.exportJSON(),
295
+ type: "code-block",
296
+ code: this.__code,
297
+ language: this.__language,
298
+ version: 1
299
+ };
300
+ }
301
+ getCode() {
302
+ return this.__code;
303
+ }
304
+ setCode(code) {
305
+ const writable = this.getWritable();
306
+ writable.__code = code;
307
+ }
308
+ getLanguage() {
309
+ return this.__language;
310
+ }
311
+ setLanguage(language) {
312
+ const writable = this.getWritable();
313
+ writable.__language = language;
314
+ }
315
+ decorate(_editor, _config) {
316
+ return createRendererDecoration("CodeBlock", CodeBlockRenderer, {
317
+ code: this.__code,
318
+ language: this.__language
319
+ });
320
+ }
321
+ };
322
+ __publicField(_CodeBlockNode, "commandItems", [
323
+ {
324
+ title: "Code Block",
325
+ icon: createElement(Code, { size: 20 }),
326
+ description: "Syntax-highlighted code",
327
+ keywords: ["code", "snippet", "codeblock"],
328
+ section: "MEDIA",
329
+ placement: ["slash", "toolbar"],
330
+ group: "insert",
331
+ onSelect: (editor) => {
332
+ editor.update(() => {
333
+ $insertNodes([$createCodeBlockNode("", "text")]);
334
+ });
335
+ }
336
+ }
337
+ ]);
338
+ let CodeBlockNode = _CodeBlockNode;
339
+ function $createCodeBlockNode(code, language) {
340
+ return new CodeBlockNode(code, language);
341
+ }
342
+ function $isCodeBlockNode(node) {
343
+ return node instanceof CodeBlockNode;
344
+ }
345
+ const DEFAULT_COMMENT_TEXT = "comment";
346
+ const _CommentNode = class _CommentNode extends TextNode {
347
+ static getType() {
348
+ return "comment";
349
+ }
350
+ static clone(node) {
351
+ return new _CommentNode(node.__text, node.__key);
352
+ }
353
+ static importDOM() {
354
+ return {
355
+ "#comment": () => ({
356
+ conversion: (domNode) => {
357
+ if (!(domNode instanceof Comment)) return null;
358
+ return {
359
+ node: $createCommentNode(domNode.data)
360
+ };
361
+ },
362
+ priority: 4
363
+ }),
364
+ "span": () => ({
365
+ conversion: (domNode) => {
366
+ if (!(domNode instanceof HTMLElement)) return null;
367
+ if (!domNode.classList.contains(semanticClassNames.comment)) return null;
368
+ return {
369
+ node: $createCommentNode(domNode.dataset.comment ?? domNode.textContent ?? "")
370
+ };
371
+ },
372
+ priority: 2
373
+ })
374
+ };
375
+ }
376
+ constructor(text, key) {
377
+ super(text, key);
378
+ }
379
+ createDOM(config) {
380
+ const element = super.createDOM(config);
381
+ element.classList.add(semanticClassNames.comment, sharedStyles.comment);
382
+ element.dataset.comment = this.__text;
383
+ return element;
384
+ }
385
+ updateDOM(prevNode, dom, config) {
386
+ const updated = super.updateDOM(prevNode, dom, config);
387
+ dom.classList.add(semanticClassNames.comment, sharedStyles.comment);
388
+ if (prevNode.__text !== this.__text) {
389
+ dom.dataset.comment = this.__text;
390
+ }
391
+ return updated;
392
+ }
393
+ exportDOM(_editor) {
394
+ return {
395
+ element: document.createComment(this.getTextContent())
396
+ };
397
+ }
398
+ static importJSON(serializedNode) {
399
+ const node = $createCommentNode(serializedNode.text ?? "");
400
+ node.setFormat(serializedNode.format ?? 0);
401
+ node.setDetail(serializedNode.detail ?? 0);
402
+ node.setMode(serializedNode.mode ?? "normal");
403
+ node.setStyle(serializedNode.style ?? "");
404
+ return node;
405
+ }
406
+ exportJSON() {
407
+ return {
408
+ ...super.exportJSON(),
409
+ type: "comment",
410
+ version: 1
411
+ };
412
+ }
413
+ };
414
+ __publicField(_CommentNode, "commandItems", [
415
+ {
416
+ title: "HTML Comment",
417
+ icon: createElement(MessageSquareQuote, { size: 20 }),
418
+ description: "Insert an HTML comment node",
419
+ keywords: ["comment", "html", "annotation", "hidden", "<!-- -->"],
420
+ section: "INLINE",
421
+ placement: ["slash", "toolbar"],
422
+ group: "insert",
423
+ onSelect: (editor, _queryString) => {
424
+ editor.update(() => {
425
+ const node = $createCommentNode(DEFAULT_COMMENT_TEXT);
426
+ $insertNodes([node]);
427
+ node.select(0, node.getTextContentSize());
428
+ });
429
+ }
430
+ }
431
+ ]);
432
+ let CommentNode = _CommentNode;
433
+ function $createCommentNode(text) {
434
+ return new CommentNode(text);
435
+ }
436
+ function $createCommentPlaceholderNode() {
437
+ return $createCommentNode(DEFAULT_COMMENT_TEXT);
438
+ }
439
+ function $isCommentNode(node) {
440
+ return node instanceof CommentNode;
441
+ }
442
+ const SVG_NS = "http://www.w3.org/2000/svg";
443
+ const DEFAULT_ATTRS = {
444
+ xmlns: SVG_NS,
445
+ width: "24",
446
+ height: "24",
447
+ viewBox: "0 0 24 24",
448
+ fill: "none",
449
+ stroke: "currentColor",
450
+ "stroke-width": "2",
451
+ "stroke-linecap": "round",
452
+ "stroke-linejoin": "round"
453
+ };
454
+ function createLucideSvg(iconNode, attrs = {}) {
455
+ const svg = document.createElementNS(SVG_NS, "svg");
456
+ const merged = { ...DEFAULT_ATTRS, ...attrs };
457
+ for (const [k, v] of Object.entries(merged)) {
458
+ svg.setAttribute(k, v);
459
+ }
460
+ for (const [tag, elAttrs] of iconNode) {
461
+ const el = document.createElementNS(SVG_NS, tag);
462
+ for (const [k, v] of Object.entries(elAttrs)) {
463
+ if (k === "key") continue;
464
+ el.setAttribute(k, v);
465
+ }
466
+ svg.append(el);
467
+ }
468
+ return svg;
469
+ }
470
+ const ChevronRightIconNode = [["path", { d: "M8 6L12 10L8 14" }]];
471
+ const _DetailsNode = class _DetailsNode extends ElementNode {
472
+ constructor(summary, open = false, key) {
473
+ super(key);
474
+ __publicField(this, "__summary");
475
+ __publicField(this, "__open");
476
+ this.__summary = summary;
477
+ this.__open = open;
478
+ }
479
+ static getType() {
480
+ return "details";
481
+ }
482
+ static clone(node) {
483
+ return new _DetailsNode(node.__summary, node.__open, node.__key);
484
+ }
485
+ createDOM(_config) {
486
+ const details = document.createElement("details");
487
+ details.className = "rich-details";
488
+ if (this.__open) {
489
+ details.open = true;
490
+ }
491
+ const summary = document.createElement("summary");
492
+ summary.className = "rich-details-summary";
493
+ const chevron = document.createElement("span");
494
+ chevron.className = "rich-details-chevron";
495
+ chevron.setAttribute("aria-hidden", "true");
496
+ chevron.append(
497
+ createLucideSvg(ChevronRightIconNode, {
498
+ width: "20",
499
+ height: "20",
500
+ viewBox: "0 0 20 20",
501
+ "stroke-width": "1.5"
502
+ })
503
+ );
504
+ summary.append(chevron);
505
+ const label = document.createElement("span");
506
+ label.className = "rich-details-summary-text";
507
+ label.textContent = this.__summary;
508
+ summary.append(label);
509
+ const content = document.createElement("div");
510
+ content.className = "rich-details-content";
511
+ details.append(summary, content);
512
+ return details;
513
+ }
514
+ updateDOM(prevNode, dom) {
515
+ const details = dom;
516
+ if (prevNode.__open !== this.__open) {
517
+ details.open = this.__open;
518
+ }
519
+ if (prevNode.__summary !== this.__summary) {
520
+ const label = dom.querySelector(".rich-details-summary-text");
521
+ if (label) {
522
+ label.textContent = this.__summary;
523
+ }
524
+ }
525
+ return false;
526
+ }
527
+ static importJSON(serializedNode) {
528
+ return $createDetailsNode(serializedNode.summary, serializedNode.open);
529
+ }
530
+ exportJSON() {
531
+ return {
532
+ ...super.exportJSON(),
533
+ type: "details",
534
+ summary: this.__summary,
535
+ open: this.__open,
536
+ version: 1
537
+ };
538
+ }
539
+ getSummary() {
540
+ return this.getLatest().__summary;
541
+ }
542
+ setSummary(summary) {
543
+ const writable = this.getWritable();
544
+ writable.__summary = summary;
545
+ }
546
+ getOpen() {
547
+ return this.getLatest().__open;
548
+ }
549
+ setOpen(open) {
550
+ const writable = this.getWritable();
551
+ writable.__open = open;
552
+ }
553
+ toggleOpen() {
554
+ this.setOpen(!this.getOpen());
555
+ }
556
+ getDOMSlot(element) {
557
+ const content = element.querySelector(
558
+ ".rich-details-content"
559
+ );
560
+ return super.getDOMSlot(element).withElement(content);
561
+ }
562
+ isInline() {
563
+ return false;
564
+ }
565
+ };
566
+ __publicField(_DetailsNode, "slashMenuItems", [
567
+ {
568
+ title: "Details",
569
+ icon: createElement(ChevronRight, { size: 20 }),
570
+ description: "Collapsible content block",
571
+ keywords: ["details", "toggle", "collapse", "accordion"],
572
+ section: "ADVANCED",
573
+ onSelect: (editor) => {
574
+ editor.update(() => {
575
+ $insertNodes([$createDetailsNode("Details")]);
576
+ });
577
+ }
578
+ }
579
+ ]);
580
+ let DetailsNode = _DetailsNode;
581
+ function $createDetailsNode(summary, open = false) {
582
+ return new DetailsNode(summary, open);
583
+ }
584
+ function FootnoteSectionRenderer({ definitions }) {
585
+ const { displayNumberMap } = useFootnoteDefinitions();
586
+ const sortedEntries = Object.entries(definitions).sort(
587
+ ([a], [b]) => (displayNumberMap[a] ?? 0) - (displayNumberMap[b] ?? 0)
588
+ );
589
+ if (sortedEntries.length === 0) return null;
590
+ return /* @__PURE__ */ jsxs(
591
+ "div",
592
+ {
593
+ role: "doc-endnotes",
594
+ className: clsx(
595
+ "rich-footnote-section-content",
596
+ semanticClassNames.footnoteSection,
597
+ sharedStyles.footnoteSection
598
+ ),
599
+ children: [
600
+ /* @__PURE__ */ jsx(
601
+ "hr",
602
+ {
603
+ className: clsx(
604
+ semanticClassNames.footnoteSectionDivider,
605
+ sharedStyles.footnoteSectionDivider
606
+ )
607
+ }
608
+ ),
609
+ /* @__PURE__ */ jsx(
610
+ "ol",
611
+ {
612
+ className: clsx(semanticClassNames.footnoteSectionList, sharedStyles.footnoteSectionList),
613
+ children: sortedEntries.map(([identifier, content]) => {
614
+ const displayNum = displayNumberMap[identifier] ?? identifier;
615
+ return /* @__PURE__ */ jsx(
616
+ FootnoteSectionItem,
617
+ {
618
+ content,
619
+ displayNum,
620
+ identifier
621
+ },
622
+ identifier
623
+ );
624
+ })
625
+ }
626
+ )
627
+ ]
628
+ }
629
+ );
630
+ }
631
+ function FootnoteSectionItem({
632
+ identifier,
633
+ content,
634
+ displayNum
635
+ }) {
636
+ const targetId = `footnote-${identifier}`;
637
+ const refId = `footnote-ref-${identifier}`;
638
+ const handleBackClick = useCallback(
639
+ (e) => {
640
+ e.preventDefault();
641
+ const refElement = document.getElementById(refId);
642
+ if (!refElement) return;
643
+ refElement.scrollIntoView({ behavior: "smooth", block: "center" });
644
+ refElement.classList.add(
645
+ semanticClassNames.footnoteHighlight,
646
+ sharedStyles.footnoteHighlight
647
+ );
648
+ window.setTimeout(() => {
649
+ refElement.classList.remove(
650
+ semanticClassNames.footnoteHighlight,
651
+ sharedStyles.footnoteHighlight
652
+ );
653
+ }, 1200);
654
+ },
655
+ [refId]
656
+ );
657
+ return /* @__PURE__ */ jsxs(
658
+ "li",
659
+ {
660
+ className: clsx(semanticClassNames.footnoteSectionItem, sharedStyles.footnoteSectionItem),
661
+ id: targetId,
662
+ value: typeof displayNum === "number" ? displayNum : void 0,
663
+ children: [
664
+ /* @__PURE__ */ jsx("span", { className: "rich-footnote-section-item-content", children: content }),
665
+ /* @__PURE__ */ jsx(
666
+ "a",
667
+ {
668
+ "aria-label": `Back to reference ${displayNum}`,
669
+ className: clsx(semanticClassNames.footnoteBackRef, sharedStyles.footnoteBackRef),
670
+ href: `#${refId}`,
671
+ role: "doc-backlink",
672
+ onClick: handleBackClick,
673
+ children: "↩"
674
+ }
675
+ )
676
+ ]
677
+ }
678
+ );
679
+ }
680
+ class FootnoteSectionNode extends DecoratorNode {
681
+ constructor(definitions, key) {
682
+ super(key);
683
+ __publicField(this, "__definitions");
684
+ this.__definitions = definitions;
685
+ }
686
+ static getType() {
687
+ return "footnote-section";
688
+ }
689
+ static clone(node) {
690
+ return new FootnoteSectionNode({ ...node.__definitions }, node.__key);
691
+ }
692
+ createDOM(_config) {
693
+ const div = document.createElement("div");
694
+ div.className = `${semanticClassNames.footnoteSection} ${sharedStyles.footnoteSection}`;
695
+ return div;
696
+ }
697
+ updateDOM() {
698
+ return false;
699
+ }
700
+ isInline() {
701
+ return false;
702
+ }
703
+ static importJSON(serializedNode) {
704
+ return $createFootnoteSectionNode(serializedNode.definitions);
705
+ }
706
+ exportJSON() {
707
+ return {
708
+ ...super.exportJSON(),
709
+ type: "footnote-section",
710
+ definitions: this.__definitions,
711
+ version: 1
712
+ };
713
+ }
714
+ getDefinitions() {
715
+ return this.getLatest().__definitions;
716
+ }
717
+ setDefinitions(definitions) {
718
+ const writable = this.getWritable();
719
+ writable.__definitions = definitions;
720
+ }
721
+ getDefinition(identifier) {
722
+ return this.getLatest().__definitions[identifier];
723
+ }
724
+ setDefinition(identifier, content) {
725
+ const writable = this.getWritable();
726
+ writable.__definitions = {
727
+ ...writable.__definitions,
728
+ [identifier]: content
729
+ };
730
+ }
731
+ removeDefinition(identifier) {
732
+ const writable = this.getWritable();
733
+ const { [identifier]: _, ...rest } = writable.__definitions;
734
+ writable.__definitions = rest;
735
+ }
736
+ decorate(_editor, _config) {
737
+ return createRendererDecoration("FootnoteSection", FootnoteSectionRenderer, {
738
+ definitions: this.__definitions,
739
+ nodeKey: this.__key
740
+ });
741
+ }
742
+ }
743
+ function $createFootnoteSectionNode(definitions = {}) {
744
+ return new FootnoteSectionNode(definitions);
745
+ }
746
+ function $isFootnoteSectionNode(node) {
747
+ return node instanceof FootnoteSectionNode;
748
+ }
749
+ function GridStaticDecorator({ cols, gap, cellStates }) {
750
+ const renderContent = useNestedContentRenderer();
751
+ return /* @__PURE__ */ jsx(
752
+ "div",
753
+ {
754
+ className: "rich-grid-inner",
755
+ style: {
756
+ display: "grid",
757
+ gridTemplateColumns: `repeat(${cols}, 1fr)`,
758
+ gap
759
+ },
760
+ children: cellStates.map((state, i) => /* @__PURE__ */ jsx("div", { className: "rich-grid-cell", children: renderContent(state) }, i))
761
+ }
762
+ );
763
+ }
764
+ class GridContainerNode extends DecoratorNode {
765
+ constructor(cols = 2, gap, cellStates, key) {
766
+ super(key);
767
+ __publicField(this, "__cols");
768
+ __publicField(this, "__gap");
769
+ __publicField(this, "__cellStates");
770
+ this.__cols = cols;
771
+ this.__gap = gap || "16px";
772
+ if (cellStates) {
773
+ this.__cellStates = cellStates;
774
+ } else {
775
+ const emptyState = {
776
+ root: {
777
+ children: [
778
+ {
779
+ type: "paragraph",
780
+ children: [],
781
+ direction: null,
782
+ format: "",
783
+ indent: 0,
784
+ textFormat: 0,
785
+ textStyle: "",
786
+ version: 1
787
+ }
788
+ ],
789
+ direction: null,
790
+ format: "",
791
+ indent: 0,
792
+ type: "root",
793
+ version: 1
794
+ }
795
+ };
796
+ this.__cellStates = Array.from({ length: cols }, () => emptyState);
797
+ }
798
+ }
799
+ static getType() {
800
+ return "grid-container";
801
+ }
802
+ static clone(node) {
803
+ return new GridContainerNode(node.__cols, node.__gap, [...node.__cellStates], node.__key);
804
+ }
805
+ createDOM(_config) {
806
+ const div = document.createElement("div");
807
+ div.className = "rich-grid-container";
808
+ return div;
809
+ }
810
+ updateDOM() {
811
+ return false;
812
+ }
813
+ isInline() {
814
+ return false;
815
+ }
816
+ getCols() {
817
+ return this.getLatest().__cols;
818
+ }
819
+ setCols(cols) {
820
+ const writable = this.getWritable();
821
+ const prev = writable.__cellStates.length;
822
+ writable.__cols = cols;
823
+ if (cols > prev) {
824
+ const emptyState = {
825
+ root: {
826
+ children: [
827
+ {
828
+ type: "paragraph",
829
+ children: [],
830
+ direction: null,
831
+ format: "",
832
+ indent: 0,
833
+ textFormat: 0,
834
+ textStyle: "",
835
+ version: 1
836
+ }
837
+ ],
838
+ direction: null,
839
+ format: "",
840
+ indent: 0,
841
+ type: "root",
842
+ version: 1
843
+ }
844
+ };
845
+ for (let i = prev; i < cols; i++) {
846
+ writable.__cellStates.push(emptyState);
847
+ }
848
+ }
849
+ }
850
+ getGap() {
851
+ return this.getLatest().__gap;
852
+ }
853
+ setGap(gap) {
854
+ const writable = this.getWritable();
855
+ writable.__gap = gap;
856
+ }
857
+ getCellStates() {
858
+ return this.getLatest().__cellStates;
859
+ }
860
+ addCells(count) {
861
+ const writable = this.getWritable();
862
+ const emptyState = {
863
+ root: {
864
+ children: [
865
+ {
866
+ type: "paragraph",
867
+ children: [],
868
+ direction: null,
869
+ format: "",
870
+ indent: 0,
871
+ textFormat: 0,
872
+ textStyle: "",
873
+ version: 1
874
+ }
875
+ ],
876
+ direction: null,
877
+ format: "",
878
+ indent: 0,
879
+ type: "root",
880
+ version: 1
881
+ }
882
+ };
883
+ for (let i = 0; i < count; i++) {
884
+ writable.__cellStates.push(emptyState);
885
+ }
886
+ }
887
+ removeCells(count) {
888
+ const writable = this.getWritable();
889
+ const states = writable.__cellStates;
890
+ const toRemove = Math.min(count, states.length);
891
+ for (let i = 0; i < toRemove; i++) {
892
+ const state = states.at(-1);
893
+ if (!state) break;
894
+ const isEmpty = extractTextContent(state).trim() === "";
895
+ if (!isEmpty) break;
896
+ states.pop();
897
+ }
898
+ }
899
+ getTextContent() {
900
+ return this.__cellStates.map((s) => extractTextContent(s)).join("\n");
901
+ }
902
+ static importJSON(serializedNode) {
903
+ const legacy = serializedNode;
904
+ const cols = legacy.cols || 2;
905
+ const rawGap = legacy.gap;
906
+ const gap = typeof rawGap === "number" ? `${rawGap}px` : rawGap;
907
+ if (legacy.cells && legacy.cells.length > 0) {
908
+ return new GridContainerNode(cols, gap, legacy.cells);
909
+ }
910
+ if (legacy.children) {
911
+ const cellStates = legacy.children.map((child) => {
912
+ return {
913
+ root: {
914
+ children: [child],
915
+ direction: null,
916
+ format: "",
917
+ indent: 0,
918
+ type: "root",
919
+ version: 1
920
+ }
921
+ };
922
+ });
923
+ return new GridContainerNode(cols, gap, cellStates);
924
+ }
925
+ return new GridContainerNode(cols, gap);
926
+ }
927
+ exportJSON() {
928
+ return {
929
+ ...super.exportJSON(),
930
+ type: "grid-container",
931
+ cols: this.__cols,
932
+ gap: this.__gap,
933
+ cells: this.__cellStates,
934
+ version: 1
935
+ };
936
+ }
937
+ decorate(_editor, _config) {
938
+ return createElement(GridStaticDecorator, {
939
+ cols: this.__cols,
940
+ gap: this.__gap,
941
+ cellStates: this.__cellStates
942
+ });
943
+ }
944
+ }
945
+ function $createGridContainerNode(cols = 2, gap) {
946
+ return new GridContainerNode(cols, gap);
947
+ }
948
+ function $isGridContainerNode(node) {
949
+ return node instanceof GridContainerNode;
950
+ }
951
+ const _LinkCardNode = class _LinkCardNode extends DecoratorNode {
952
+ constructor(payload, key) {
953
+ super(key);
954
+ __publicField(this, "__url");
955
+ __publicField(this, "__source");
956
+ __publicField(this, "__id");
957
+ __publicField(this, "__title");
958
+ __publicField(this, "__description");
959
+ __publicField(this, "__favicon");
960
+ __publicField(this, "__image");
961
+ this.__url = payload.url;
962
+ this.__source = payload.source;
963
+ this.__id = payload.id;
964
+ this.__title = payload.title;
965
+ this.__description = payload.description;
966
+ this.__favicon = payload.favicon;
967
+ this.__image = payload.image;
968
+ }
969
+ static getType() {
970
+ return "link-card";
971
+ }
972
+ static clone(node) {
973
+ return new _LinkCardNode(
974
+ {
975
+ url: node.__url,
976
+ source: node.__source,
977
+ id: node.__id,
978
+ title: node.__title,
979
+ description: node.__description,
980
+ favicon: node.__favicon,
981
+ image: node.__image
982
+ },
983
+ node.__key
984
+ );
985
+ }
986
+ createDOM(_config) {
987
+ const div = document.createElement("div");
988
+ div.className = "rich-link-card-wrapper";
989
+ return div;
990
+ }
991
+ updateDOM() {
992
+ return false;
993
+ }
994
+ isInline() {
995
+ return false;
996
+ }
997
+ static importJSON(serializedNode) {
998
+ return $createLinkCardNode({
999
+ url: serializedNode.url,
1000
+ source: serializedNode.source,
1001
+ id: serializedNode.id,
1002
+ title: serializedNode.title,
1003
+ description: serializedNode.description,
1004
+ favicon: serializedNode.favicon,
1005
+ image: serializedNode.image
1006
+ });
1007
+ }
1008
+ exportJSON() {
1009
+ return {
1010
+ ...super.exportJSON(),
1011
+ type: "link-card",
1012
+ url: this.__url,
1013
+ source: this.__source,
1014
+ id: this.__id,
1015
+ title: this.__title,
1016
+ description: this.__description,
1017
+ favicon: this.__favicon,
1018
+ image: this.__image,
1019
+ version: 1
1020
+ };
1021
+ }
1022
+ getUrl() {
1023
+ return this.getLatest().__url;
1024
+ }
1025
+ setUrl(url) {
1026
+ const writable = this.getWritable();
1027
+ writable.__url = url;
1028
+ }
1029
+ getSource() {
1030
+ return this.getLatest().__source;
1031
+ }
1032
+ setSource(source) {
1033
+ const writable = this.getWritable();
1034
+ writable.__source = source;
1035
+ }
1036
+ getId() {
1037
+ return this.getLatest().__id;
1038
+ }
1039
+ setId(id) {
1040
+ const writable = this.getWritable();
1041
+ writable.__id = id;
1042
+ }
1043
+ decorate(_editor, _config) {
1044
+ return createRendererDecoration("LinkCard", LinkCardRenderer, {
1045
+ url: this.__url,
1046
+ source: this.__source,
1047
+ id: this.__id,
1048
+ title: this.__title,
1049
+ description: this.__description,
1050
+ favicon: this.__favicon,
1051
+ image: this.__image
1052
+ });
1053
+ }
1054
+ };
1055
+ __publicField(_LinkCardNode, "commandItems", [
1056
+ {
1057
+ title: "Link Card",
1058
+ icon: createElement(Link, { size: 20 }),
1059
+ description: "Link preview card",
1060
+ keywords: ["link", "card", "bookmark", "embed"],
1061
+ section: "MEDIA",
1062
+ placement: ["slash", "toolbar"],
1063
+ group: "insert",
1064
+ onSelect: (editor) => {
1065
+ editor.update(() => {
1066
+ $insertNodes([$createLinkCardNode({ url: "" })]);
1067
+ });
1068
+ }
1069
+ }
1070
+ ]);
1071
+ let LinkCardNode = _LinkCardNode;
1072
+ function $createLinkCardNode(payload) {
1073
+ return new LinkCardNode(payload);
1074
+ }
1075
+ function $isLinkCardNode(node) {
1076
+ return node instanceof LinkCardNode;
1077
+ }
1078
+ function readBaseTextFromRuby(element) {
1079
+ let base = "";
1080
+ for (const child of Array.from(element.childNodes)) {
1081
+ if (child.nodeType === Node.TEXT_NODE) {
1082
+ base += child.textContent ?? "";
1083
+ continue;
1084
+ }
1085
+ if (child.nodeType !== Node.ELEMENT_NODE) continue;
1086
+ const childElement = child;
1087
+ const tag = childElement.tagName.toLowerCase();
1088
+ if (tag === "rt" || tag === "rp") continue;
1089
+ base += childElement.textContent ?? "";
1090
+ }
1091
+ return base;
1092
+ }
1093
+ class RubyNode extends ElementNode {
1094
+ constructor(reading, key) {
1095
+ super(key);
1096
+ __publicField(this, "__reading");
1097
+ this.__reading = reading;
1098
+ }
1099
+ static getType() {
1100
+ return "ruby";
1101
+ }
1102
+ static clone(node) {
1103
+ return new RubyNode(node.__reading, node.__key);
1104
+ }
1105
+ static importJSON(serializedNode) {
1106
+ return $createRubyNode(serializedNode.reading ?? "");
1107
+ }
1108
+ exportJSON() {
1109
+ return {
1110
+ ...super.exportJSON(),
1111
+ type: "ruby",
1112
+ reading: this.__reading,
1113
+ version: 1
1114
+ };
1115
+ }
1116
+ static importDOM() {
1117
+ return {
1118
+ ruby: () => ({
1119
+ conversion: (domNode) => {
1120
+ if (!(domNode instanceof HTMLElement)) return null;
1121
+ const reading = domNode.querySelector("rt")?.textContent ?? "";
1122
+ const baseText = readBaseTextFromRuby(domNode);
1123
+ const node = $createRubyNode(reading);
1124
+ if (baseText) {
1125
+ node.append($createTextNode(baseText));
1126
+ }
1127
+ return { node };
1128
+ },
1129
+ priority: 2
1130
+ })
1131
+ };
1132
+ }
1133
+ exportDOM() {
1134
+ const ruby = document.createElement("ruby");
1135
+ ruby.className = `${semanticClassNames.ruby} ${sharedStyles.ruby}`;
1136
+ const baseText = this.getTextContent();
1137
+ if (baseText) {
1138
+ ruby.append(baseText);
1139
+ }
1140
+ if (this.__reading) {
1141
+ const rt = document.createElement("rt");
1142
+ rt.className = `${semanticClassNames.rubyRt} ${sharedStyles.rubyRt}`;
1143
+ rt.textContent = this.__reading;
1144
+ ruby.append(rt);
1145
+ }
1146
+ return { element: ruby };
1147
+ }
1148
+ createDOM(_config) {
1149
+ const span = document.createElement("span");
1150
+ span.className = `${semanticClassNames.ruby} ${sharedStyles.ruby}`;
1151
+ if (this.__reading) {
1152
+ span.dataset.ruby = this.__reading;
1153
+ }
1154
+ return span;
1155
+ }
1156
+ updateDOM(prevNode, dom) {
1157
+ if (prevNode.__reading !== this.__reading) {
1158
+ if (this.__reading) {
1159
+ dom.dataset.ruby = this.__reading;
1160
+ } else {
1161
+ delete dom.dataset.ruby;
1162
+ }
1163
+ }
1164
+ return false;
1165
+ }
1166
+ canInsertTextBefore() {
1167
+ return true;
1168
+ }
1169
+ canInsertTextAfter() {
1170
+ return true;
1171
+ }
1172
+ isInline() {
1173
+ return true;
1174
+ }
1175
+ getReading() {
1176
+ return this.getLatest().__reading;
1177
+ }
1178
+ setReading(reading) {
1179
+ const writable = this.getWritable();
1180
+ writable.__reading = reading;
1181
+ }
1182
+ }
1183
+ function $createRubyNode(reading) {
1184
+ return new RubyNode(reading);
1185
+ }
1186
+ function $isRubyNode(node) {
1187
+ return node instanceof RubyNode;
1188
+ }
1189
+ function VideoRenderer({ src, poster, width, height }) {
1190
+ return /* @__PURE__ */ jsx("figure", { className: "rich-video", children: /* @__PURE__ */ jsx(
1191
+ "video",
1192
+ {
1193
+ controls: true,
1194
+ height,
1195
+ poster,
1196
+ preload: "metadata",
1197
+ src,
1198
+ style: { maxWidth: "100%", height: "auto" },
1199
+ width
1200
+ }
1201
+ ) });
1202
+ }
1203
+ const _VideoNode = class _VideoNode extends DecoratorNode {
1204
+ constructor(payload, key) {
1205
+ super(key);
1206
+ __publicField(this, "__src");
1207
+ __publicField(this, "__poster");
1208
+ __publicField(this, "__width");
1209
+ __publicField(this, "__height");
1210
+ this.__src = payload.src;
1211
+ this.__poster = payload.poster;
1212
+ this.__width = payload.width;
1213
+ this.__height = payload.height;
1214
+ }
1215
+ static getType() {
1216
+ return "video";
1217
+ }
1218
+ static clone(node) {
1219
+ return new _VideoNode(
1220
+ {
1221
+ src: node.__src,
1222
+ poster: node.__poster,
1223
+ width: node.__width,
1224
+ height: node.__height
1225
+ },
1226
+ node.__key
1227
+ );
1228
+ }
1229
+ createDOM(_config) {
1230
+ const div = document.createElement("div");
1231
+ div.className = "rich-video-wrapper";
1232
+ return div;
1233
+ }
1234
+ updateDOM() {
1235
+ return false;
1236
+ }
1237
+ isInline() {
1238
+ return false;
1239
+ }
1240
+ static importJSON(serializedNode) {
1241
+ return $createVideoNode({
1242
+ src: serializedNode.src,
1243
+ poster: serializedNode.poster,
1244
+ width: serializedNode.width,
1245
+ height: serializedNode.height
1246
+ });
1247
+ }
1248
+ exportJSON() {
1249
+ return {
1250
+ ...super.exportJSON(),
1251
+ type: "video",
1252
+ src: this.__src,
1253
+ poster: this.__poster,
1254
+ width: this.__width,
1255
+ height: this.__height,
1256
+ version: 1
1257
+ };
1258
+ }
1259
+ getSrc() {
1260
+ return this.getLatest().__src;
1261
+ }
1262
+ setSrc(src) {
1263
+ const writable = this.getWritable();
1264
+ writable.__src = src;
1265
+ }
1266
+ decorate(_editor, _config) {
1267
+ return createRendererDecoration("Video", VideoRenderer, {
1268
+ src: this.__src,
1269
+ poster: this.__poster,
1270
+ width: this.__width,
1271
+ height: this.__height
1272
+ });
1273
+ }
1274
+ };
1275
+ __publicField(_VideoNode, "commandItems", [
1276
+ {
1277
+ title: "Video",
1278
+ icon: createElement(Video, { size: 20 }),
1279
+ description: "Embed a video",
1280
+ keywords: ["video", "media", "mp4"],
1281
+ section: "MEDIA",
1282
+ placement: ["slash", "toolbar"],
1283
+ group: "insert",
1284
+ onSelect: (editor) => {
1285
+ editor.update(() => {
1286
+ $insertNodes([$createVideoNode({ src: "" })]);
1287
+ });
1288
+ }
1289
+ }
1290
+ ]);
1291
+ let VideoNode = _VideoNode;
1292
+ function $createVideoNode(payload) {
1293
+ return new VideoNode(payload);
1294
+ }
1295
+ const builtinNodes = [
1296
+ HeadingNode,
1297
+ QuoteNode,
1298
+ ListNode,
1299
+ ListItemNode,
1300
+ LinkNode,
1301
+ AutoLinkNode,
1302
+ HorizontalRuleNode,
1303
+ TableNode,
1304
+ TableCellNode,
1305
+ TableRowNode,
1306
+ CodeNode
1307
+ ];
1308
+ const customNodes = [
1309
+ SpoilerNode,
1310
+ MentionNode,
1311
+ KaTeXInlineNode,
1312
+ KaTeXBlockNode,
1313
+ ImageNode,
1314
+ AlertQuoteNode,
1315
+ CodeBlockNode,
1316
+ FootnoteNode,
1317
+ FootnoteSectionNode,
1318
+ VideoNode,
1319
+ LinkCardNode,
1320
+ CommentNode,
1321
+ DetailsNode,
1322
+ GridContainerNode,
1323
+ BannerNode,
1324
+ MermaidNode,
1325
+ RubyNode,
1326
+ TagNode
1327
+ ];
1328
+ const allNodes = [...builtinNodes, ...customNodes];
1329
+ export {
1330
+ $createCommentNode as $,
1331
+ BANNER_LABELS as B,
1332
+ CommentNode as C,
1333
+ DetailsNode as D,
1334
+ FootnoteSectionNode as F,
1335
+ GridContainerNode as G,
1336
+ LinkCardNode as L,
1337
+ RubyNode as R,
1338
+ VideoNode as V,
1339
+ $createFootnoteSectionNode as a,
1340
+ $createGridContainerNode as b,
1341
+ $createLinkCardNode as c,
1342
+ $createRubyNode as d,
1343
+ $isCommentNode as e,
1344
+ $isFootnoteSectionNode as f,
1345
+ $isGridContainerNode as g,
1346
+ $isLinkCardNode as h,
1347
+ $isRubyNode as i,
1348
+ BANNER_TYPES as j,
1349
+ allNodes as k,
1350
+ builtinNodes as l,
1351
+ customNodes as m,
1352
+ ColorSchemeProvider as n,
1353
+ $isBannerNode as o,
1354
+ BannerRenderer as p,
1355
+ BannerNode as q,
1356
+ normalizeBannerType as r,
1357
+ $isCodeBlockNode as s,
1358
+ CodeBlockRenderer as t,
1359
+ useColorScheme as u,
1360
+ CodeBlockNode as v,
1361
+ $createCommentPlaceholderNode as w,
1362
+ $createDetailsNode as x
1363
+ };