laif-ds 0.2.85 → 0.2.87

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 (113) hide show
  1. package/README.md +11 -81
  2. package/dist/CHANGELOG.md +13 -0
  3. package/dist/_virtual/index6.js +2 -2
  4. package/dist/_virtual/index7.js +2 -2
  5. package/dist/agent-docs/adoption-report.json +2 -2
  6. package/dist/agent-docs/manifest.json +3 -3
  7. package/dist/components/editor/editor-hooks/use-update-toolbar.js +6 -6
  8. package/dist/components/editor/editor-ui/content-editable.js +1 -1
  9. package/dist/components/editor/nodes/mention-node.js +2 -2
  10. package/dist/components/editor/plugins/actions/clear-editor-plugin.js +2 -2
  11. package/dist/components/editor/plugins/actions/counter-character-plugin.js +2 -2
  12. package/dist/components/editor/plugins/mention-plugin.js +21 -21
  13. package/dist/components/editor/plugins/toolbar/block-format/format-bulleted-list.js +10 -10
  14. package/dist/components/editor/plugins/toolbar/block-format/format-check-list.js +5 -5
  15. package/dist/components/editor/plugins/toolbar/block-format/format-heading.js +5 -5
  16. package/dist/components/editor/plugins/toolbar/block-format/format-numbered-list.js +5 -5
  17. package/dist/components/editor/plugins/toolbar/block-format/format-paragraph.js +9 -9
  18. package/dist/components/editor/plugins/toolbar/block-format/format-quote.js +3 -3
  19. package/dist/components/editor/plugins/toolbar/block-format-toolbar-plugin.js +13 -13
  20. package/dist/components/editor/plugins/toolbar/font-format-toolbar-plugin.js +2 -2
  21. package/dist/components/editor/plugins/toolbar/history-toolbar-plugin.js +18 -19
  22. package/dist/components/editor/plugins/toolbar/mention-insert-toolbar-plugin.js +1 -1
  23. package/dist/components/editor/plugins/toolbar/toolbar-plugin.js +3 -3
  24. package/dist/components/ui/app-editor.js +51 -51
  25. package/dist/components/ui/markdown-renderer.js +33 -32
  26. package/dist/lib/utils.js +35 -34
  27. package/dist/node_modules/@floating-ui/core/dist/floating-ui.core.js +1 -1
  28. package/dist/node_modules/@floating-ui/{utils → core/node_modules/@floating-ui/utils}/dist/floating-ui.utils.js +33 -39
  29. package/dist/node_modules/@floating-ui/dom/dist/floating-ui.dom.js +20 -19
  30. package/dist/node_modules/@floating-ui/dom/node_modules/@floating-ui/utils/dist/floating-ui.utils.js +12 -0
  31. package/dist/node_modules/@lexical/clipboard/dist/LexicalClipboard.prod.js +354 -0
  32. package/dist/node_modules/@lexical/code-core/dist/LexicalCodeCore.prod.js +298 -0
  33. package/dist/node_modules/@lexical/dragon/dist/LexicalDragon.prod.js +89 -0
  34. package/dist/node_modules/@lexical/extension/dist/LexicalExtension.prod.js +611 -0
  35. package/dist/node_modules/@lexical/history/dist/LexicalHistory.prod.js +96 -0
  36. package/dist/node_modules/@lexical/html/dist/LexicalHtml.prod.js +604 -0
  37. package/dist/node_modules/@lexical/link/dist/LexicalLink.prod.js +201 -0
  38. package/dist/node_modules/@lexical/list/dist/LexicalList.prod.js +843 -0
  39. package/dist/node_modules/@lexical/markdown/dist/LexicalMarkdown.prod.js +555 -0
  40. package/dist/node_modules/@lexical/react/dist/LexicalCheckListPlugin.prod.js +11 -0
  41. package/dist/node_modules/@lexical/react/dist/LexicalClearEditorPlugin.prod.js +13 -0
  42. package/dist/node_modules/@lexical/react/dist/LexicalComposer.prod.js +45 -0
  43. package/dist/node_modules/@lexical/react/{LexicalComposerContext.prod.js → dist/LexicalComposerContext.prod.js} +1 -1
  44. package/dist/node_modules/@lexical/react/dist/LexicalContentEditable.prod.js +53 -0
  45. package/dist/node_modules/@lexical/react/dist/LexicalErrorBoundary.prod.js +21 -0
  46. package/dist/node_modules/@lexical/react/{LexicalHistoryPlugin.prod.js → dist/LexicalHistoryPlugin.prod.js} +3 -3
  47. package/dist/node_modules/@lexical/react/dist/LexicalListPlugin.prod.js +17 -0
  48. package/dist/node_modules/@lexical/react/dist/LexicalOnChangePlugin.prod.js +16 -0
  49. package/dist/node_modules/@lexical/react/dist/LexicalReactProviderExtension.prod.js +6 -0
  50. package/dist/node_modules/@lexical/react/dist/LexicalRichTextPlugin.prod.js +77 -0
  51. package/dist/node_modules/@lexical/react/dist/LexicalTypeaheadMenuPlugin.prod.js +245 -0
  52. package/dist/node_modules/@lexical/react/dist/useLexicalEditable.prod.js +22 -0
  53. package/dist/node_modules/@lexical/rich-text/dist/LexicalRichText.prod.js +567 -0
  54. package/dist/node_modules/@lexical/selection/dist/LexicalSelection.prod.js +123 -0
  55. package/dist/node_modules/@lexical/table/dist/LexicalTable.prod.js +929 -0
  56. package/dist/node_modules/@lexical/text/{LexicalText.prod.js → dist/LexicalText.prod.js} +6 -6
  57. package/dist/node_modules/@lexical/utils/dist/LexicalUtils.prod.js +111 -0
  58. package/dist/node_modules/eventemitter3/index2.js +1 -1
  59. package/dist/node_modules/lexical/dist/Lexical.prod.js +6731 -0
  60. package/dist/node_modules/style-to-object/cjs/index.js +1 -1
  61. package/package.json +17 -15
  62. package/dist/_virtual/prism-cpp.js +0 -3
  63. package/dist/_virtual/prism-cpp2.js +0 -5
  64. package/dist/_virtual/prism-java.js +0 -3
  65. package/dist/_virtual/prism-java2.js +0 -5
  66. package/dist/_virtual/prism-python.js +0 -3
  67. package/dist/_virtual/prism-python2.js +0 -5
  68. package/dist/_virtual/prism-rust.js +0 -3
  69. package/dist/_virtual/prism-rust2.js +0 -5
  70. package/dist/_virtual/prism-typescript.js +0 -3
  71. package/dist/_virtual/prism-typescript2.js +0 -5
  72. package/dist/_virtual/prism.js +0 -3
  73. package/dist/_virtual/prism2.js +0 -5
  74. package/dist/node_modules/@lexical/clipboard/LexicalClipboard.prod.js +0 -159
  75. package/dist/node_modules/@lexical/code/LexicalCode.prod.js +0 -236
  76. package/dist/node_modules/@lexical/dragon/LexicalDragon.prod.js +0 -46
  77. package/dist/node_modules/@lexical/history/LexicalHistory.prod.js +0 -89
  78. package/dist/node_modules/@lexical/html/LexicalHtml.prod.js +0 -108
  79. package/dist/node_modules/@lexical/link/LexicalLink.prod.js +0 -187
  80. package/dist/node_modules/@lexical/list/LexicalList.prod.js +0 -729
  81. package/dist/node_modules/@lexical/markdown/LexicalMarkdown.prod.js +0 -367
  82. package/dist/node_modules/@lexical/react/LexicalCheckListPlugin.prod.js +0 -11
  83. package/dist/node_modules/@lexical/react/LexicalClearEditorPlugin.prod.js +0 -17
  84. package/dist/node_modules/@lexical/react/LexicalComposer.prod.js +0 -45
  85. package/dist/node_modules/@lexical/react/LexicalContentEditable.prod.js +0 -55
  86. package/dist/node_modules/@lexical/react/LexicalErrorBoundary.prod.js +0 -49
  87. package/dist/node_modules/@lexical/react/LexicalListPlugin.prod.js +0 -17
  88. package/dist/node_modules/@lexical/react/LexicalOnChangePlugin.prod.js +0 -16
  89. package/dist/node_modules/@lexical/react/LexicalRichTextPlugin.prod.js +0 -56
  90. package/dist/node_modules/@lexical/react/LexicalTypeaheadMenuPlugin.prod.js +0 -220
  91. package/dist/node_modules/@lexical/react/useLexicalEditable.prod.js +0 -21
  92. package/dist/node_modules/@lexical/rich-text/LexicalRichText.prod.js +0 -376
  93. package/dist/node_modules/@lexical/selection/LexicalSelection.prod.js +0 -107
  94. package/dist/node_modules/@lexical/table/LexicalTable.prod.js +0 -661
  95. package/dist/node_modules/@lexical/utils/LexicalUtils.prod.js +0 -102
  96. package/dist/node_modules/lexical/Lexical.prod.js +0 -4912
  97. package/dist/node_modules/prismjs/components/prism-c.js +0 -77
  98. package/dist/node_modules/prismjs/components/prism-clike.js +0 -32
  99. package/dist/node_modules/prismjs/components/prism-cpp.js +0 -93
  100. package/dist/node_modules/prismjs/components/prism-css.js +0 -56
  101. package/dist/node_modules/prismjs/components/prism-java.js +0 -122
  102. package/dist/node_modules/prismjs/components/prism-javascript.js +0 -138
  103. package/dist/node_modules/prismjs/components/prism-markdown.js +0 -301
  104. package/dist/node_modules/prismjs/components/prism-markup.js +0 -174
  105. package/dist/node_modules/prismjs/components/prism-objectivec.js +0 -11
  106. package/dist/node_modules/prismjs/components/prism-powershell.js +0 -56
  107. package/dist/node_modules/prismjs/components/prism-python.js +0 -69
  108. package/dist/node_modules/prismjs/components/prism-rust.js +0 -124
  109. package/dist/node_modules/prismjs/components/prism-sql.js +0 -34
  110. package/dist/node_modules/prismjs/components/prism-swift.js +0 -114
  111. package/dist/node_modules/prismjs/components/prism-typescript.js +0 -53
  112. package/dist/node_modules/prismjs/prism.js +0 -1165
  113. /package/dist/node_modules/@floating-ui/{utils → dom/node_modules/@floating-ui/utils}/dist/floating-ui.utils.dom.js +0 -0
@@ -1,367 +0,0 @@
1
- "use client";
2
- import { $createLineBreakNode as O, $createTextNode as y, $getRoot as D, $isElementNode as I, $isDecoratorNode as B, $isParagraphNode as k, $isTextNode as N, $getSelection as J, $isLineBreakNode as V, $createParagraphNode as Y } from "../../lexical/Lexical.prod.js";
3
- import { ListNode as w, ListItemNode as P, $isListNode as $, $createListItemNode as Z, $createListNode as tt, $isListItemNode as j } from "../list/LexicalList.prod.js";
4
- import { HeadingNode as et, QuoteNode as nt, $isHeadingNode as ot, $isQuoteNode as L, $createQuoteNode as rt, $createHeadingNode as st } from "../rich-text/LexicalRichText.prod.js";
5
- import { $findMatchingParent as it } from "../utils/LexicalUtils.prod.js";
6
- import { CodeNode as at, $createCodeNode as R, $isCodeNode as lt } from "../code/LexicalCode.prod.js";
7
- import { LinkNode as ct, $createLinkNode as ft, $isLinkNode as ut, $isAutoLinkNode as dt } from "../link/LexicalLink.prod.js";
8
- function gt(t, e) {
9
- const r = {};
10
- for (const s of t) {
11
- const n = e(s);
12
- n && (r[n] ? r[n].push(s) : r[n] = [s]);
13
- }
14
- return r;
15
- }
16
- function H(t) {
17
- const e = gt(t, ((r) => r.type));
18
- return { element: e.element || [], multilineElement: e["multiline-element"] || [], textFormat: e["text-format"] || [], textMatch: e["text-match"] || [] };
19
- }
20
- const v = /[!-/:-@[-`{-~\s]/, pt = /^\s{0,3}$/;
21
- function b(t) {
22
- if (!k(t)) return !1;
23
- const e = t.getFirstChild();
24
- return e == null || t.getChildrenSize() === 1 && N(e) && pt.test(e.getTextContent());
25
- }
26
- function mt(t, e, r, s) {
27
- for (const n of e) {
28
- if (!n.export) continue;
29
- const f = n.export(t, ((o) => C(o, r, s)));
30
- if (f != null) return f;
31
- }
32
- return I(t) ? C(t, r, s) : B(t) ? t.getTextContent() : null;
33
- }
34
- function C(t, e, r, s, n) {
35
- const f = [], o = t.getChildren();
36
- s || (s = []), n || (n = []);
37
- t: for (const a of o) {
38
- for (const u of r) {
39
- if (!u.export) continue;
40
- const c = u.export(a, ((i) => C(i, e, r, s, [...n, ...s])), ((i, g) => F(i, g, e, s, n)));
41
- if (c != null) {
42
- f.push(c);
43
- continue t;
44
- }
45
- }
46
- V(a) ? f.push(`
47
- `) : N(a) ? f.push(F(a, a.getTextContent(), e, s, n)) : I(a) ? f.push(C(a, e, r, s, n)) : B(a) && f.push(a.getTextContent());
48
- }
49
- return f.join("");
50
- }
51
- function F(t, e, r, s, n) {
52
- let f = t.getFormat() === 0 ? e : (function(l) {
53
- return l.replace(/^\s+|\s+$/g, ((d) => [...d].map(((p) => "&#" + p.codePointAt(0) + ";")).join("")));
54
- })(e);
55
- t.hasFormat("code") || (f = f.replace(/([*_`~\\])/g, "\\$1"));
56
- let o = "", a = "", u = "";
57
- const c = M(t, !0), i = M(t, !1), g = /* @__PURE__ */ new Set();
58
- for (const l of r) {
59
- const d = l.format[0], p = l.tag;
60
- S(t, d) && !g.has(d) && (g.add(d), S(c, d) && s.find(((m) => m.tag === p)) || (s.push({ format: d, tag: p }), o += p));
61
- }
62
- for (let l = 0; l < s.length; l++) {
63
- const d = S(t, s[l].format), p = S(i, s[l].format);
64
- if (d && p) continue;
65
- const m = [...s];
66
- for (; m.length > l; ) {
67
- const h = m.pop();
68
- n && h && n.find(((T) => T.tag === h.tag)) || (h && typeof h.tag == "string" && (d ? p || (u += h.tag) : a += h.tag), s.pop());
69
- }
70
- break;
71
- }
72
- return f = o + f + u, a + f;
73
- }
74
- function M(t, e) {
75
- let r = e ? t.getPreviousSibling() : t.getNextSibling();
76
- if (!r) {
77
- const s = t.getParentOrThrow();
78
- s.isInline() && (r = e ? s.getPreviousSibling() : s.getNextSibling());
79
- }
80
- for (; r; ) {
81
- if (I(r)) {
82
- if (!r.isInline()) break;
83
- const s = e ? r.getLastDescendant() : r.getFirstDescendant();
84
- if (N(s)) return s;
85
- r = e ? r.getPreviousSibling() : r.getNextSibling();
86
- }
87
- if (N(r)) return r;
88
- if (!I(r)) return null;
89
- }
90
- return null;
91
- }
92
- function S(t, e) {
93
- return N(t) && t.hasFormat(e);
94
- }
95
- function ht(t, e) {
96
- const r = (function(n, f) {
97
- const o = n.match(f.openTagsRegExp);
98
- if (o == null) return null;
99
- for (const a of o) {
100
- const u = a.replace(/^\s/, ""), c = f.fullMatchRegExpByTag[u];
101
- if (c == null) continue;
102
- const i = n.match(c), g = f.transformersByTag[u];
103
- if (i != null && g != null) {
104
- if (g.intraword !== !1) return i;
105
- const { index: l = 0 } = i, d = n[l - 1], p = n[l + i[0].length];
106
- if ((!d || v.test(d)) && (!p || v.test(p))) return i;
107
- }
108
- }
109
- return null;
110
- })(t.getTextContent(), e);
111
- if (!r) return null;
112
- const s = r.index || 0;
113
- return { endIndex: s + r[0].length, match: r, startIndex: s, transformer: e.transformersByTag[r[1]] };
114
- }
115
- function E(t) {
116
- return N(t) && !t.hasFormat("code");
117
- }
118
- function x(t, e, r) {
119
- let s = ht(t, e), n = (function(o, a) {
120
- const u = o;
121
- let c, i, g, l;
122
- for (const d of a) {
123
- if (!d.replace || !d.importRegExp) continue;
124
- const p = u.getTextContent().match(d.importRegExp);
125
- if (!p) continue;
126
- const m = p.index || 0, h = d.getEndIndex ? d.getEndIndex(u, p) : m + p[0].length;
127
- h !== !1 && (c === void 0 || i === void 0 || m < c && h > i) && (c = m, i = h, g = d, l = p);
128
- }
129
- return c === void 0 || i === void 0 || g === void 0 || l === void 0 ? null : { endIndex: i, match: l, startIndex: c, transformer: g };
130
- })(t, r);
131
- if (s && n && (s.startIndex <= n.startIndex && s.endIndex >= n.endIndex ? n = null : s = null), s) {
132
- const o = (function(a, u, c, i, g) {
133
- const l = a.getTextContent();
134
- let d, p, m;
135
- if (g[0] === l ? d = a : u === 0 ? [d, p] = a.splitText(c) : [m, d, p] = a.splitText(u, c), d.setTextContent(g[2]), i) for (const h of i.format) d.hasFormat(h) || d.toggleFormat(h);
136
- return { nodeAfter: p, nodeBefore: m, transformedNode: d };
137
- })(t, s.startIndex, s.endIndex, s.transformer, s.match);
138
- E(o.nodeAfter) && x(o.nodeAfter, e, r), E(o.nodeBefore) && x(o.nodeBefore, e, r), E(o.transformedNode) && x(o.transformedNode, e, r);
139
- } else if (n) {
140
- const o = (function(a, u, c, i, g) {
141
- let l, d, p;
142
- return u === 0 ? [l, d] = a.splitText(c) : [p, l, d] = a.splitText(u, c), i.replace ? { nodeAfter: d, nodeBefore: p, transformedNode: i.replace(l, g) || void 0 } : null;
143
- })(t, n.startIndex, n.endIndex, n.transformer, n.match);
144
- if (!o) return;
145
- E(o.nodeAfter) && x(o.nodeAfter, e, r), E(o.nodeBefore) && x(o.nodeBefore, e, r), E(o.transformedNode) && x(o.transformedNode, e, r);
146
- }
147
- const f = t.getTextContent().replace(/\\([*_`~\\])/g, "$1").replace(/&#(\d+);/g, ((o, a) => String.fromCodePoint(a)));
148
- t.setTextContent(f);
149
- }
150
- function xt(t, e = !1) {
151
- const r = H(t), s = (function(n) {
152
- const f = {}, o = {}, a = [], u = "(?<![\\\\])";
153
- for (const c of n) {
154
- const { tag: i } = c;
155
- f[i] = c;
156
- const g = i.replace(/(\*|\^|\+)/g, "\\$1");
157
- a.push(g), i.length === 1 ? o[i] = new RegExp(`(?<![\\\\${g}])(${g})((\\\\${g})?.*?[^${g}\\s](\\\\${g})?)((?<!\\\\)|(?<=\\\\\\\\))(${g})(?![\\\\${g}])`) : o[i] = new RegExp(`(?<!\\\\)(${g})((\\\\${g})?.*?[^\\s](\\\\${g})?)((?<!\\\\)|(?<=\\\\\\\\))(${g})(?!\\\\)`);
158
- }
159
- return { fullMatchRegExpByTag: o, openTagsRegExp: new RegExp(`${u}(${a.join("|")})`, "g"), transformersByTag: f };
160
- })(r.textFormat);
161
- return (n, f) => {
162
- const o = n.split(`
163
- `), a = o.length, u = f || D();
164
- u.clear();
165
- for (let i = 0; i < a; i++) {
166
- const g = o[i], [l, d] = $t(o, i, r.multilineElement, u);
167
- l ? i = d : Et(g, u, r.element, s, r.textMatch, e);
168
- }
169
- const c = u.getChildren();
170
- for (const i of c) !e && b(i) && u.getChildrenSize() > 1 && i.remove();
171
- J() !== null && u.selectStart();
172
- };
173
- }
174
- function $t(t, e, r, s) {
175
- for (const n of r) {
176
- const { handleImportAfterStartMatch: f, regExpEnd: o, regExpStart: a, replace: u } = n, c = t[e].match(a);
177
- if (!c) continue;
178
- if (f) {
179
- const p = f({ lines: t, rootNode: s, startLineIndex: e, startMatch: c, transformer: n });
180
- if (p === null) continue;
181
- if (p) return p;
182
- }
183
- const i = typeof o == "object" && "regExp" in o ? o.regExp : o, g = o && typeof o == "object" && "optional" in o ? o.optional : !o;
184
- let l = e;
185
- const d = t.length;
186
- for (; l < d; ) {
187
- const p = i ? t[l].match(i) : null;
188
- if (!p && (!g || g && l < d - 1)) {
189
- l++;
190
- continue;
191
- }
192
- if (p && e === l && p.index === c.index) {
193
- l++;
194
- continue;
195
- }
196
- const m = [];
197
- if (p && e === l) m.push(t[e].slice(c[0].length, -p[0].length));
198
- else for (let h = e; h <= l; h++) if (h === e) {
199
- const T = t[h].slice(c[0].length);
200
- m.push(T);
201
- } else if (h === l && p) {
202
- const T = t[h].slice(0, -p[0].length);
203
- m.push(T);
204
- } else m.push(t[h]);
205
- if (u(s, null, c, p, m, !0) !== !1) return [!0, l];
206
- break;
207
- }
208
- }
209
- return [!1, e];
210
- }
211
- function Et(t, e, r, s, n, f) {
212
- const o = y(t), a = Y();
213
- a.append(o), e.append(a);
214
- for (const { regExp: u, replace: c } of r) {
215
- const i = t.match(u);
216
- if (i && (o.setTextContent(t.slice(i[0].length)), c(a, [o], i, !0) !== !1)) break;
217
- }
218
- if (x(o, s, n), a.isAttached() && t.length > 0) {
219
- const u = a.getPreviousSibling();
220
- if (!f && (k(u) || L(u) || $(u))) {
221
- let c = u;
222
- if ($(u)) {
223
- const i = u.getLastDescendant();
224
- c = i == null ? null : it(i, j);
225
- }
226
- c != null && c.getTextContentSize() > 0 && (c.splice(c.getChildrenSize(), 0, [O(), ...a.getChildren()]), a.remove());
227
- }
228
- }
229
- }
230
- const U = /^(\s*)(\d{1,})\.\s/, z = /^(\s*)[-*+]\s/, Nt = /^(\s*)(?:-\s)?\s?(\[(\s|x)?\])\s/i, _ = /^(#{1,6})\s/, Q = /^>\s/, G = /^[ \t]*```(\w+)?/, K = /[ \t]*```$/, Tt = /^[ \t]*```[^`]+(?:(?:`{1,2}|`{4,})[^`]+)*```(?:[^`]|$)/, Rt = /^(?:\|)(.+)(?:\|)\s?$/, St = /^(\| ?:?-*:? ?)+\|\s?$/, X = (t) => (e, r, s, n) => {
231
- const f = t(s);
232
- f.append(...r), e.replace(f), n || f.select(0, 0);
233
- }, W = (t) => (e, r, s, n) => {
234
- const f = e.getPreviousSibling(), o = e.getNextSibling(), a = Z(t === "check" ? s[3] === "x" : void 0);
235
- if ($(o) && o.getListType() === t) {
236
- const c = o.getFirstChild();
237
- c !== null ? c.insertBefore(a) : o.append(a), e.remove();
238
- } else if ($(f) && f.getListType() === t) f.append(a), e.remove();
239
- else {
240
- const c = tt(t, t === "number" ? Number(s[2]) : void 0);
241
- c.append(a), e.replace(c);
242
- }
243
- a.append(...r), n || a.select(0, 0);
244
- const u = (function(c) {
245
- const i = c.match(/\t/g), g = c.match(/ /g);
246
- let l = 0;
247
- return i && (l += i.length), g && (l += Math.floor(g.length / 4)), l;
248
- })(s[1]);
249
- u && a.setIndent(u);
250
- }, A = (t, e, r) => {
251
- const s = [], n = t.getChildren();
252
- let f = 0;
253
- for (const o of n) if (j(o)) {
254
- if (o.getChildrenSize() === 1) {
255
- const i = o.getFirstChild();
256
- if ($(i)) {
257
- s.push(A(i, e, r + 1));
258
- continue;
259
- }
260
- }
261
- const a = " ".repeat(4 * r), u = t.getListType(), c = u === "number" ? `${t.getStart() + f}. ` : u === "check" ? `- [${o.getChecked() ? "x" : " "}] ` : "- ";
262
- s.push(a + c + e(o)), f++;
263
- }
264
- return s.join(`
265
- `);
266
- }, It = { dependencies: [et], export: (t, e) => {
267
- if (!ot(t)) return null;
268
- const r = Number(t.getTag().slice(1));
269
- return "#".repeat(r) + " " + e(t);
270
- }, regExp: _, replace: X(((t) => {
271
- const e = "h" + t[1].length;
272
- return st(e);
273
- })), type: "element" }, Ct = { dependencies: [nt], export: (t, e) => {
274
- if (!L(t)) return null;
275
- const r = e(t).split(`
276
- `), s = [];
277
- for (const n of r) s.push("> " + n);
278
- return s.join(`
279
- `);
280
- }, regExp: Q, replace: (t, e, r, s) => {
281
- if (s) {
282
- const f = t.getPreviousSibling();
283
- if (L(f)) return f.splice(f.getChildrenSize(), 0, [O(), ...e]), void t.remove();
284
- }
285
- const n = rt();
286
- n.append(...e), t.replace(n), s || n.select(0, 0);
287
- }, type: "element" }, Lt = { dependencies: [at], export: (t) => {
288
- if (!lt(t)) return null;
289
- const e = t.getTextContent();
290
- return "```" + (t.getLanguage() || "") + (e ? `
291
- ` + e : "") + "\n```";
292
- }, regExpEnd: { optional: !0, regExp: K }, regExpStart: G, replace: (t, e, r, s, n, f) => {
293
- let o, a;
294
- if (!e && n) {
295
- if (n.length === 1) s ? (o = R(), a = r[1] + n[0]) : (o = R(r[1]), a = n[0].startsWith(" ") ? n[0].slice(1) : n[0]);
296
- else {
297
- if (o = R(r[1]), n[0].trim().length === 0) for (; n.length > 0 && !n[0].length; ) n.shift();
298
- else n[0] = n[0].startsWith(" ") ? n[0].slice(1) : n[0];
299
- for (; n.length > 0 && !n[n.length - 1].length; ) n.pop();
300
- a = n.join(`
301
- `);
302
- }
303
- const u = y(a);
304
- o.append(u), t.append(o);
305
- } else e && X(((u) => R(u ? u[1] : void 0)))(t, e, r, f);
306
- }, type: "multiline-element" }, bt = { dependencies: [w, P], export: (t, e) => $(t) ? A(t, e, 0) : null, regExp: z, replace: W("bullet"), type: "element" }, _t = { dependencies: [w, P], export: (t, e) => $(t) ? A(t, e, 0) : null, regExp: U, replace: W("number"), type: "element" }, yt = { format: ["code"], tag: "`", type: "text-format" }, At = { format: ["highlight"], tag: "==", type: "text-format" }, vt = { format: ["bold", "italic"], tag: "***", type: "text-format" }, Ft = { format: ["bold", "italic"], intraword: !1, tag: "___", type: "text-format" }, Mt = { format: ["bold"], tag: "**", type: "text-format" }, Ot = { format: ["bold"], intraword: !1, tag: "__", type: "text-format" }, Dt = { format: ["strikethrough"], tag: "~~", type: "text-format" }, Bt = { format: ["italic"], tag: "*", type: "text-format" }, kt = { format: ["italic"], intraword: !1, tag: "_", type: "text-format" }, wt = { dependencies: [ct], export: (t, e, r) => {
307
- if (!ut(t) || dt(t)) return null;
308
- const s = t.getTitle(), n = e(t);
309
- return s ? `[${n}](${t.getURL()} "${s}")` : `[${n}](${t.getURL()})`;
310
- }, importRegExp: /(?:\[([^[]+)\])(?:\((?:([^()\s]+)(?:\s"((?:[^"]*\\")*[^"]*)"\s*)?)\))/, regExp: /(?:\[([^[]+)\])(?:\((?:([^()\s]+)(?:\s"((?:[^"]*\\")*[^"]*)"\s*)?)\))$/, replace: (t, e) => {
311
- const [, r, s, n] = e, f = ft(s, { title: n }), o = y(r);
312
- return o.setFormat(t.getFormat()), f.append(o), t.replace(f), o;
313
- }, trigger: ")", type: "text-match" }, Pt = [It, Ct, bt, _t], jt = [Lt], Ht = [yt, vt, Ft, Mt, Ot, At, Bt, kt, Dt], Ut = [wt], q = [...Pt, ...jt, ...Ht, ...Ut];
314
- function qt(t, e = q, r, s = !1, n = !1) {
315
- const f = s ? t : (function(o, a = !1) {
316
- const u = o.split(`
317
- `);
318
- let c = !1;
319
- const i = [];
320
- for (let g = 0; g < u.length; g++) {
321
- const l = u[g], d = i[i.length - 1];
322
- Tt.test(l) ? i.push(l) : G.test(l) || K.test(l) ? (c = !c, i.push(l)) : c || l === "" || d === "" || !d || _.test(d) || _.test(l) || Q.test(l) || U.test(l) || z.test(l) || Nt.test(l) || Rt.test(l) || St.test(l) || !a ? i.push(l) : i[i.length - 1] = d + l;
323
- }
324
- return i.join(`
325
- `);
326
- })(t, n);
327
- return xt(e, s)(f, r);
328
- }
329
- function Jt(t = q, e, r = !1) {
330
- return (function(n, f = !1) {
331
- const o = H(n), a = [...o.multilineElement, ...o.element], u = !f, c = o.textFormat.filter(((i) => i.format.length === 1)).sort(((i, g) => Number(i.format.includes("code")) - Number(g.format.includes("code"))));
332
- return (i) => {
333
- const g = [], l = (i || D()).getChildren();
334
- for (let d = 0; d < l.length; d++) {
335
- const p = l[d], m = mt(p, a, c, o.textMatch);
336
- m != null && g.push(u && d > 0 && !b(p) && !b(l[d - 1]) ? `
337
- `.concat(m) : m);
338
- }
339
- return g.join(`
340
- `);
341
- };
342
- })(t, r)(e);
343
- }
344
- export {
345
- qt as $convertFromMarkdownString,
346
- Jt as $convertToMarkdownString,
347
- vt as BOLD_ITALIC_STAR,
348
- Ft as BOLD_ITALIC_UNDERSCORE,
349
- Mt as BOLD_STAR,
350
- Ot as BOLD_UNDERSCORE,
351
- Lt as CODE,
352
- Pt as ELEMENT_TRANSFORMERS,
353
- It as HEADING,
354
- At as HIGHLIGHT,
355
- yt as INLINE_CODE,
356
- Bt as ITALIC_STAR,
357
- kt as ITALIC_UNDERSCORE,
358
- wt as LINK,
359
- jt as MULTILINE_ELEMENT_TRANSFORMERS,
360
- _t as ORDERED_LIST,
361
- Ct as QUOTE,
362
- Dt as STRIKETHROUGH,
363
- Ht as TEXT_FORMAT_TRANSFORMERS,
364
- Ut as TEXT_MATCH_TRANSFORMERS,
365
- q as TRANSFORMERS,
366
- bt as UNORDERED_LIST
367
- };
@@ -1,11 +0,0 @@
1
- "use client";
2
- import { registerCheckList as t } from "../list/LexicalList.prod.js";
3
- import { useLexicalComposerContext as o } from "./LexicalComposerContext.prod.js";
4
- import { useEffect as r } from "react";
5
- function n() {
6
- const [e] = o();
7
- return r((() => t(e)), [e]), null;
8
- }
9
- export {
10
- n as CheckListPlugin
11
- };
@@ -1,17 +0,0 @@
1
- "use client";
2
- import { useLexicalComposerContext as r } from "./LexicalComposerContext.prod.js";
3
- import { CLEAR_EDITOR_COMMAND as i, $getRoot as s, $getSelection as l, $createParagraphNode as u, $isRangeSelection as c, COMMAND_PRIORITY_EDITOR as d } from "../../lexical/Lexical.prod.js";
4
- import { useLayoutEffect as m, useEffect as f } from "react";
5
- const p = typeof window < "u" && window.document !== void 0 && window.document.createElement !== void 0 ? m : f;
6
- function w({ onClear: e }) {
7
- const [o] = r();
8
- return p((() => o.registerCommand(i, ((C) => (o.update((() => {
9
- if (e == null) {
10
- const n = s(), t = l(), a = u();
11
- n.clear(), n.append(a), t !== null && a.select(), c(t) && (t.format = 0);
12
- } else e();
13
- })), !0)), d)), [o, e]), null;
14
- }
15
- export {
16
- w as ClearEditorPlugin
17
- };
@@ -1,45 +0,0 @@
1
- "use client";
2
- import { createLexicalComposerContext as v, LexicalComposerContext as w } from "./LexicalComposerContext.prod.js";
3
- import { createEditor as x, $getRoot as m, $createParagraphNode as C, $getSelection as S, HISTORY_MERGE_TAG as y } from "../../lexical/Lexical.prod.js";
4
- import { useMemo as L, useLayoutEffect as R, useEffect as $ } from "react";
5
- import { jsx as P } from "react/jsx-runtime";
6
- const u = typeof window < "u" && window.document !== void 0 && window.document.createElement !== void 0, T = u ? R : $, i = { tag: y };
7
- function N({ initialConfig: r, children: p }) {
8
- const c = L((() => {
9
- const { theme: o, namespace: s, nodes: f, onError: E, editorState: h, html: b } = r, g = v(null, o), a = x({ editable: r.editable, html: b, namespace: s, nodes: f, onError: (e) => E(e, a), theme: o });
10
- return (function(e, t) {
11
- if (t !== null) {
12
- if (t === void 0) e.update((() => {
13
- const n = m();
14
- if (n.isEmpty()) {
15
- const l = C();
16
- n.append(l);
17
- const d = u ? document.activeElement : null;
18
- (S() !== null || d !== null && d === e.getRootElement()) && l.select();
19
- }
20
- }), i);
21
- else if (t !== null) switch (typeof t) {
22
- case "string": {
23
- const n = e.parseEditorState(t);
24
- e.setEditorState(n, i);
25
- break;
26
- }
27
- case "object":
28
- e.setEditorState(t, i);
29
- break;
30
- case "function":
31
- e.update((() => {
32
- m().isEmpty() && t(e);
33
- }), i);
34
- }
35
- }
36
- })(a, h), [a, g];
37
- }), []);
38
- return T((() => {
39
- const o = r.editable, [s] = c;
40
- s.setEditable(o === void 0 || o);
41
- }), []), P(w.Provider, { value: c, children: p });
42
- }
43
- export {
44
- N as LexicalComposer
45
- };
@@ -1,55 +0,0 @@
1
- "use client";
2
- import { useLexicalComposerContext as N } from "./LexicalComposerContext.prod.js";
3
- import { forwardRef as C, useState as p, useLayoutEffect as h, useEffect as F, useCallback as O, useMemo as P } from "react";
4
- import { jsxs as U, Fragment as V, jsx as m } from "react/jsx-runtime";
5
- import { $canShowPlaceholderCurry as $ } from "../text/LexicalText.prod.js";
6
- import { mergeRegister as G } from "../utils/LexicalUtils.prod.js";
7
- const L = typeof window < "u" && window.document !== void 0 && window.document.createElement !== void 0 ? h : F;
8
- function H({ editor: e, ariaActiveDescendant: t, ariaAutoComplete: l, ariaControls: d, ariaDescribedBy: n, ariaErrorMessage: o, ariaExpanded: a, ariaInvalid: u, ariaLabel: f, ariaLabelledBy: s, ariaMultiline: b, ariaOwns: k, ariaRequired: D, autoCapitalize: R, className: j, id: q, role: E = "textbox", spellCheck: z = !0, style: A, tabIndex: I, "data-testid": M, ...S }, v) {
9
- const [r, w] = p(e.isEditable()), x = O(((i) => {
10
- i && i.ownerDocument && i.ownerDocument.defaultView ? e.setRootElement(i) : e.setRootElement(null);
11
- }), [e]), B = P((() => /* @__PURE__ */ (function(...i) {
12
- return (g) => {
13
- i.forEach(((c) => {
14
- typeof c == "function" ? c(g) : c != null && (c.current = g);
15
- }));
16
- };
17
- })(v, x)), [x, v]);
18
- return L((() => (w(e.isEditable()), e.registerEditableListener(((i) => {
19
- w(i);
20
- })))), [e]), m("div", { "aria-activedescendant": r ? t : void 0, "aria-autocomplete": r ? l : "none", "aria-controls": r ? d : void 0, "aria-describedby": n, ...o != null ? { "aria-errormessage": o } : {}, "aria-expanded": r && E === "combobox" ? !!a : void 0, ...u != null ? { "aria-invalid": u } : {}, "aria-label": f, "aria-labelledby": s, "aria-multiline": b, "aria-owns": r ? k : void 0, "aria-readonly": !r || void 0, "aria-required": D, autoCapitalize: R, className: j, contentEditable: r, "data-testid": M, id: q, ref: B, role: r ? E : void 0, spellCheck: z, style: A, tabIndex: I, ...S });
21
- }
22
- const J = C(H);
23
- function y(e) {
24
- return e.getEditorState().read($(e.isComposing()));
25
- }
26
- const _ = C(K);
27
- function K(e, t) {
28
- const { placeholder: l, ...d } = e, [n] = N();
29
- return U(V, { children: [m(J, { editor: n, ...d, ref: t }), l != null && m(Q, { editor: n, content: l })] });
30
- }
31
- function Q({ content: e, editor: t }) {
32
- const l = (function(a) {
33
- const [u, f] = p((() => y(a)));
34
- return L((() => {
35
- function s() {
36
- const b = y(a);
37
- f(b);
38
- }
39
- return s(), G(a.registerUpdateListener((() => {
40
- s();
41
- })), a.registerEditableListener((() => {
42
- s();
43
- })));
44
- }), [a]), u;
45
- })(t), [d, n] = p(t.isEditable());
46
- if (h((() => (n(t.isEditable()), t.registerEditableListener(((a) => {
47
- n(a);
48
- })))), [t]), !l) return null;
49
- let o = null;
50
- return typeof e == "function" ? o = e(d) : e !== null && (o = e), o === null ? null : m("div", { "aria-hidden": !0, children: o });
51
- }
52
- export {
53
- _ as ContentEditable,
54
- J as ContentEditableElement
55
- };
@@ -1,49 +0,0 @@
1
- "use client";
2
- import * as d from "react";
3
- import { jsx as y } from "react/jsx-runtime";
4
- function h(i, s) {
5
- return h = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(c, p) {
6
- return c.__proto__ = p, c;
7
- }, h(i, s);
8
- }
9
- var m = { error: null }, g = (function(i) {
10
- var s, c;
11
- function p() {
12
- for (var r, o = arguments.length, t = new Array(o), e = 0; e < o; e++) t[e] = arguments[e];
13
- return (r = i.call.apply(i, [this].concat(t)) || this).state = m, r.resetErrorBoundary = function() {
14
- for (var n, a = arguments.length, f = new Array(a), l = 0; l < a; l++) f[l] = arguments[l];
15
- r.props.onReset == null || (n = r.props).onReset.apply(n, f), r.reset();
16
- }, r;
17
- }
18
- c = i, (s = p).prototype = Object.create(c.prototype), s.prototype.constructor = s, h(s, c), p.getDerivedStateFromError = function(r) {
19
- return { error: r };
20
- };
21
- var u = p.prototype;
22
- return u.reset = function() {
23
- this.setState(m);
24
- }, u.componentDidCatch = function(r, o) {
25
- var t, e;
26
- (t = (e = this.props).onError) == null || t.call(e, r, o);
27
- }, u.componentDidUpdate = function(r, o) {
28
- var t, e, n, a, f = this.state.error, l = this.props.resetKeys;
29
- f !== null && o.error !== null && ((n = r.resetKeys) === void 0 && (n = []), (a = l) === void 0 && (a = []), n.length !== a.length || n.some((function(b, v) {
30
- return !Object.is(b, a[v]);
31
- }))) && ((t = (e = this.props).onResetKeysChange) == null || t.call(e, r.resetKeys, l), this.reset());
32
- }, u.render = function() {
33
- var r = this.state.error, o = this.props, t = o.fallbackRender, e = o.FallbackComponent, n = o.fallback;
34
- if (r !== null) {
35
- var a = { error: r, resetErrorBoundary: this.resetErrorBoundary };
36
- if (d.isValidElement(n)) return n;
37
- if (typeof t == "function") return t(a);
38
- if (e) return d.createElement(e, a);
39
- throw new Error("react-error-boundary requires either a fallback, fallbackRender, or FallbackComponent prop");
40
- }
41
- return this.props.children;
42
- }, p;
43
- })(d.Component);
44
- function k({ children: i, onError: s }) {
45
- return y(g, { fallback: y("div", { style: { border: "1px solid #f00", color: "#f00", padding: "8px" }, children: "An error was thrown." }), onError: s, children: i });
46
- }
47
- export {
48
- k as LexicalErrorBoundary
49
- };
@@ -1,17 +0,0 @@
1
- "use client";
2
- import { ListNode as o, ListItemNode as i, registerListStrictIndentTransform as n, registerList as a } from "../list/LexicalList.prod.js";
3
- import { useLexicalComposerContext as f } from "./LexicalComposerContext.prod.js";
4
- import { useEffect as e } from "react";
5
- function c({ hasStrictIndent: r = !1 }) {
6
- const [t] = f();
7
- return e((() => {
8
- if (!t.hasNodes([o, i])) throw new Error("ListPlugin: ListNode and/or ListItemNode not registered on editor");
9
- }), [t]), e((() => {
10
- if (r) return n(t);
11
- }), [t, r]), (function(s) {
12
- e((() => a(s)), [s]);
13
- })(t), null;
14
- }
15
- export {
16
- c as ListPlugin
17
- };
@@ -1,16 +0,0 @@
1
- "use client";
2
- import { useLexicalComposerContext as u } from "./LexicalComposerContext.prod.js";
3
- import { HISTORY_MERGE_TAG as f } from "../../lexical/Lexical.prod.js";
4
- import { useLayoutEffect as m, useEffect as g } from "react";
5
- const c = typeof window < "u" && window.document !== void 0 && window.document.createElement !== void 0 ? m : g;
6
- function w({ ignoreHistoryMergeTagChange: o = !0, ignoreSelectionChange: n = !1, onChange: e }) {
7
- const [t] = u();
8
- return c((() => {
9
- if (e) return t.registerUpdateListener((({ editorState: r, dirtyElements: s, dirtyLeaves: a, prevEditorState: d, tags: i }) => {
10
- n && s.size === 0 && a.size === 0 || o && i.has(f) || d.isEmpty() || e(r, t, i);
11
- }));
12
- }), [t, o, n, e]), null;
13
- }
14
- export {
15
- w as OnChangePlugin
16
- };
@@ -1,56 +0,0 @@
1
- "use client";
2
- import { useLexicalComposerContext as E } from "./LexicalComposerContext.prod.js";
3
- import { useLexicalEditable as b } from "./useLexicalEditable.prod.js";
4
- import { $canShowPlaceholderCurry as j } from "../text/LexicalText.prod.js";
5
- import { mergeRegister as y } from "../utils/LexicalUtils.prod.js";
6
- import { useState as w, useMemo as C, useLayoutEffect as D, useEffect as x, Suspense as P } from "react";
7
- import { flushSync as R, createPortal as $ } from "react-dom";
8
- import { jsx as m, jsxs as k, Fragment as v } from "react/jsx-runtime";
9
- import { registerDragonSupport as B } from "../dragon/LexicalDragon.prod.js";
10
- import { registerRichText as M } from "../rich-text/LexicalRichText.prod.js";
11
- const d = typeof window < "u" && window.document !== void 0 && window.document.createElement !== void 0 ? D : x;
12
- function h(r) {
13
- return r.getEditorState().read(j(r.isComposing()));
14
- }
15
- function H({ contentEditable: r, placeholder: u = null, ErrorBoundary: a }) {
16
- const [n] = E(), o = (function(e, i) {
17
- const [t, s] = w((() => e.getDecorators()));
18
- return d((() => e.registerDecoratorListener(((c) => {
19
- R((() => {
20
- s(c);
21
- }));
22
- }))), [e]), x((() => {
23
- s(e.getDecorators());
24
- }), [e]), C((() => {
25
- const c = [], p = Object.keys(t);
26
- for (let l = 0; l < p.length; l++) {
27
- const f = p[l], L = m(i, { onError: (S) => e._onError(S), children: m(P, { fallback: null, children: t[f] }) }), g = e.getElementByKey(f);
28
- g !== null && c.push($(L, g, f));
29
- }
30
- return c;
31
- }), [i, t, e]);
32
- })(n, a);
33
- return (function(e) {
34
- d((() => y(M(e), B(e))), [e]);
35
- })(n), k(v, { children: [r, m(T, { content: u }), o] });
36
- }
37
- function T({ content: r }) {
38
- const [u] = E(), a = (function(o) {
39
- const [e, i] = w((() => h(o)));
40
- return d((() => {
41
- function t() {
42
- const s = h(o);
43
- i(s);
44
- }
45
- return t(), y(o.registerUpdateListener((() => {
46
- t();
47
- })), o.registerEditableListener((() => {
48
- t();
49
- })));
50
- }), [o]), e;
51
- })(u), n = b();
52
- return a ? typeof r == "function" ? r(n) : r : null;
53
- }
54
- export {
55
- H as RichTextPlugin
56
- };