@clevertask/scribe 0.1.9 → 0.1.11
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 +21 -10
- package/dist/{BarMenu-BG_w4DVo.js → BarMenu-5M9g9Y1j.js} +7 -5
- package/dist/components/Menu/BarMenu.js +1 -1
- package/dist/components/Menu/BubbleMenu.js +2 -2
- package/dist/components/Menu/LinkBubbleMenu.js +2 -2
- package/dist/components/Menu/Mobile/ListOptionBar.js +1 -1
- package/dist/components/Menu/TableBubbleMenu.d.ts +8 -0
- package/dist/components/Menu/TableBubbleMenu.d.ts.map +1 -0
- package/dist/components/Menu/TableBubbleMenu.js +305 -0
- package/dist/components/Menu/linkBubbleMenuPlugin.js +1 -1
- package/dist/components/Menu/tableBubbleMenuPlugin.d.ts +11 -0
- package/dist/components/Menu/tableBubbleMenuPlugin.d.ts.map +1 -0
- package/dist/components/Menu/tableBubbleMenuPlugin.js +22 -0
- package/dist/components/Scribe/extension/emoji/suggest.js +1 -1
- package/dist/components/Scribe/extension/extension-link.js +1 -1
- package/dist/components/Scribe/extension/extension-markdown-paste.js +11 -11
- package/dist/components/Scribe/extension/extension-selectedText.js +1 -1
- package/dist/components/Scribe/extension/index.d.ts +1 -1
- package/dist/components/Scribe/extension/index.d.ts.map +1 -1
- package/dist/components/Scribe/extension/index.js +1 -1
- package/dist/components/Scribe/extension/resizable-table.d.ts +8 -0
- package/dist/components/Scribe/extension/resizable-table.d.ts.map +1 -0
- package/dist/components/Scribe/extension/resizable-table.js +2 -0
- package/dist/components/Scribe/extension/slashCommand/SlashCommandList.js +1390 -1390
- package/dist/components/Scribe/extension/slashCommand/index.js +1 -1
- package/dist/components/Scribe/extension/slashCommand/items.d.ts.map +1 -1
- package/dist/components/Scribe/extension/slashCommand/items.js +27 -0
- package/dist/components/Scribe/extension/slashCommand/renderItems.js +1 -1
- package/dist/components/Scribe/extension/tableOfContents.js +4 -4
- package/dist/components/Scribe/index.d.ts +2 -1
- package/dist/components/Scribe/index.d.ts.map +1 -1
- package/dist/components/Scribe/index.js +133 -128
- package/dist/dist-DFua_Xbu.js +3251 -0
- package/dist/{dist-BgEySLwo.js → dist-Dw4STOPE.js} +1 -1
- package/dist/{extension-BVGWENts.js → extension-Dy6hHSvD.js} +1678 -2687
- package/dist/{extension-link-CMRfHUc5.js → extension-link-CjfUZ90W.js} +62 -62
- package/dist/{html-to-markdown-Cta7-ssO.js → html-to-markdown-B6Uhn7ok.js} +112 -54
- package/dist/main.css +52 -1
- package/dist/main.js +2 -2
- package/dist/{markdown-to-html-DwSNqq2i.js → markdown-to-html-WmeDaJXP.js} +73 -60
- package/dist/{menus-D9OsP28c.js → menus-_EXlLMjz.js} +66 -66
- package/dist/{purify.es-CFiLaBu1.js → purify.es-BES4pJF7.js} +267 -260
- package/dist/resizable-table-Ddw3l6DJ.js +489 -0
- package/dist/{slashCommand-B6Iz1i0d.js → slashCommand-CxX07Nbk.js} +69 -66
- package/dist/utils/html-to-markdown.d.ts.map +1 -1
- package/dist/utils/html-to-markdown.js +1 -1
- package/dist/utils/index.js +4 -4
- package/dist/utils/markdown-to-html.d.ts.map +1 -1
- package/dist/utils/markdown-to-html.js +1 -1
- package/package.json +8 -7
- package/dist/dist-BMKyBtRa.js +0 -7023
- package/dist/dist-FrapLVQu.js +0 -3513
- package/dist/tables-CXpUVKdw.js +0 -1347
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { t as e } from "./purify.es-
|
|
2
|
-
//#region node_modules/.pnpm/marked@18.0.
|
|
1
|
+
import { t as e } from "./purify.es-BES4pJF7.js";
|
|
2
|
+
//#region node_modules/.pnpm/marked@18.0.9/node_modules/marked/lib/marked.esm.js
|
|
3
3
|
function t() {
|
|
4
4
|
return {
|
|
5
5
|
async: !1,
|
|
@@ -126,43 +126,46 @@ var s = ((e = "") => {
|
|
|
126
126
|
fences: i,
|
|
127
127
|
lheading: /^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,
|
|
128
128
|
paragraph: o(_).replace("hr", f).replace("heading", " *#{1,6} *[^\n]").replace("lheading", g).replace("|table", "").replace("blockquote", " {0,3}>").replace("|fences", "").replace("|list", "").replace("|html", "").replace("|tag", "").getRegex()
|
|
129
|
-
}, le = /^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/, ue = /^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/, w = /^( {2,}|\\)\n(?!\s*$)/, de = /^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/, T = /[\p{P}\p{S}]/u, E = /[\s\p{P}\p{S}]/u, D = /[^\s\p{P}\p{S}]/u, fe = o(/^((?![*_])punctSpace)/, "u").replace(/punctSpace/g, E).getRegex(), O = /(?!~)[\p{P}\p{S}]/u,
|
|
129
|
+
}, le = /^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/, ue = /^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/, w = /^( {2,}|\\)\n(?!\s*$)/, de = /^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/, T = /[\p{P}\p{S}]/u, E = /[\s\p{P}\p{S}]/u, D = /[^\s\p{P}\p{S}]/u, fe = o(/^((?![*_])punctSpace)/, "u").replace(/punctSpace/g, E).getRegex(), pe = /[\p{Pi}\p{Ps}"']/u, O = /(?!~)[\p{P}\p{S}]/u, me = /(?!~)[\s\p{P}\p{S}]/u, he = /(?:[^\s\p{P}\p{S}]|~)/u, ge = o(/link|precode-code|html/, "g").replace("link", /\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-", s ? "(?<!`)()" : "(^^|[^`])").replace("code", /(?<b>`+)[^`]+\k<b>(?!`)/).replace("html", /<(?! )[^<>]*?>/).getRegex(), k = /^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/, _e = o(k, "u").replace(/punct/g, T).getRegex(), ve = o(k, "u").replace(/punct/g, O).getRegex(), ye = o(/^(?:\*+(?:((?!\*)(?!openQuote)punct)|([^\s*]))?)|^_+(?:((?!_)(?!openQuote)punct)|([^\s_]))?/, "u").replace(/openQuote/g, pe).replace(/punct/g, T).getRegex(), A = "^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)", be = o(A, "gu").replace(/notPunctSpace/g, D).replace(/punctSpace/g, E).replace(/punct/g, T).getRegex(), xe = o(A, "gu").replace(/notPunctSpace/g, he).replace(/punctSpace/g, me).replace(/punct/g, O).getRegex(), Se = o("^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)[\\s](\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|(?:(?!\\*)punct|notPunctSpace)(\\*+)(?!\\*)(?=notPunctSpace)", "gu").replace(/notPunctSpace/g, D).replace(/punctSpace/g, E).replace(/punct/g, T).getRegex(), Ce = o("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)", "gu").replace(/notPunctSpace/g, D).replace(/punctSpace/g, E).replace(/punct/g, T).getRegex(), we = o("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)[\\s](_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)|(?:(?!_)punct|notPunctSpace)(_+)(?!_)(?=notPunctSpace)", "gu").replace(/notPunctSpace/g, D).replace(/punctSpace/g, E).replace(/punct/g, T).getRegex(), Te = o(/^~~?(?:((?!~)punct)|[^\s~])/, "u").replace(/punct/g, T).getRegex(), Ee = o("^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)", "gu").replace(/notPunctSpace/g, D).replace(/punctSpace/g, E).replace(/punct/g, T).getRegex(), De = o(/\\(punct)/, "gu").replace(/punct/g, T).getRegex(), Oe = o(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme", /[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email", /[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(), ke = o(b).replace("(?:-->|$)", "-->").getRegex(), Ae = o("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment", ke).replace("attribute", /\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(), j = /(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/, je = o(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label", j).replace("href", /<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]+|(?=\))/).replace("title", /"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(), M = o(/^!?\[(label)\]\[(ref)\]/).replace("label", j).replace("ref", v).getRegex(), N = o(/^!?\[(ref)\](?:\[\])?/).replace("ref", v).getRegex(), Me = o("reflink|nolink(?!\\()", "g").replace("reflink", M).replace("nolink", N).getRegex(), P = /[hH][tT][tT][pP][sS]?|[fF][tT][pP]/, F = {
|
|
130
130
|
_backpedal: i,
|
|
131
|
-
anyPunctuation:
|
|
132
|
-
autolink:
|
|
133
|
-
blockSkip:
|
|
131
|
+
anyPunctuation: De,
|
|
132
|
+
autolink: Oe,
|
|
133
|
+
blockSkip: ge,
|
|
134
134
|
br: w,
|
|
135
135
|
code: ue,
|
|
136
136
|
del: i,
|
|
137
137
|
delLDelim: i,
|
|
138
138
|
delRDelim: i,
|
|
139
|
-
emStrongLDelim:
|
|
140
|
-
emStrongRDelimAst:
|
|
141
|
-
emStrongRDelimUnd:
|
|
139
|
+
emStrongLDelim: _e,
|
|
140
|
+
emStrongRDelimAst: be,
|
|
141
|
+
emStrongRDelimUnd: Ce,
|
|
142
142
|
escape: le,
|
|
143
|
-
link:
|
|
143
|
+
link: je,
|
|
144
144
|
nolink: N,
|
|
145
145
|
punctuation: fe,
|
|
146
146
|
reflink: M,
|
|
147
|
-
reflinkSearch:
|
|
148
|
-
tag:
|
|
147
|
+
reflinkSearch: Me,
|
|
148
|
+
tag: Ae,
|
|
149
149
|
text: de,
|
|
150
150
|
url: i
|
|
151
|
-
},
|
|
151
|
+
}, Ne = {
|
|
152
152
|
...F,
|
|
153
|
+
emStrongLDelim: ye,
|
|
154
|
+
emStrongRDelimAst: Se,
|
|
155
|
+
emStrongRDelimUnd: we,
|
|
153
156
|
link: o(/^!?\[(label)\]\((.*?)\)/).replace("label", j).getRegex(),
|
|
154
157
|
reflink: o(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label", j).getRegex()
|
|
155
158
|
}, I = {
|
|
156
159
|
...F,
|
|
157
|
-
emStrongRDelimAst:
|
|
158
|
-
emStrongLDelim:
|
|
159
|
-
delLDelim:
|
|
160
|
-
delRDelim:
|
|
160
|
+
emStrongRDelimAst: xe,
|
|
161
|
+
emStrongLDelim: ve,
|
|
162
|
+
delLDelim: Te,
|
|
163
|
+
delRDelim: Ee,
|
|
161
164
|
url: o(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol", P).replace("email", /[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),
|
|
162
165
|
_backpedal: /(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,
|
|
163
166
|
del: /^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,
|
|
164
167
|
text: o(/^(`+|~+|[^`~])(?:(?=[`~])|(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol", P).getRegex()
|
|
165
|
-
},
|
|
168
|
+
}, Pe = {
|
|
166
169
|
...I,
|
|
167
170
|
br: o(w).replace("{2,}", "*").getRegex(),
|
|
168
171
|
text: o(I.text).replace("\\b_", "\\b_| {2,}\\n").replace(/\{2,\}/g, "*").getRegex()
|
|
@@ -173,15 +176,15 @@ var s = ((e = "") => {
|
|
|
173
176
|
}, R = {
|
|
174
177
|
normal: F,
|
|
175
178
|
gfm: I,
|
|
176
|
-
breaks:
|
|
177
|
-
pedantic:
|
|
178
|
-
},
|
|
179
|
+
breaks: Pe,
|
|
180
|
+
pedantic: Ne
|
|
181
|
+
}, Fe = {
|
|
179
182
|
"&": "&",
|
|
180
183
|
"<": "<",
|
|
181
184
|
">": ">",
|
|
182
185
|
"\"": """,
|
|
183
186
|
"'": "'"
|
|
184
|
-
}, z = (e) =>
|
|
187
|
+
}, z = (e) => Fe[e];
|
|
185
188
|
function B(e, t) {
|
|
186
189
|
if (t) {
|
|
187
190
|
if (c.escapeTest.test(e)) return e.replace(c.escapeReplace, z);
|
|
@@ -202,8 +205,10 @@ function H(e, t) {
|
|
|
202
205
|
for (; --i >= 0 && n[i] === "\\";) r = !r;
|
|
203
206
|
return r ? "|" : " |";
|
|
204
207
|
}).split(c.splitPipe), r = 0;
|
|
205
|
-
if (n[0].trim() || n.shift(), n.length > 0 && !n.at(-1)?.trim() && n.pop(), t)
|
|
206
|
-
|
|
208
|
+
if (n[0].trim() || n.shift(), n.length > 0 && !n.at(-1)?.trim() && n.pop(), t) {
|
|
209
|
+
if (n.length > t) n.splice(t);
|
|
210
|
+
else for (; n.length < t;) n.push("");
|
|
211
|
+
}
|
|
207
212
|
for (; r < n.length; r++) n[r] = n[r].trim().replace(c.slashPipe, "|");
|
|
208
213
|
return n;
|
|
209
214
|
}
|
|
@@ -224,7 +229,7 @@ function W(e) {
|
|
|
224
229
|
for (; n >= 0 && c.blankLine.test(t[n]);) n--;
|
|
225
230
|
return t.length - n <= 2 ? e : t.slice(0, n + 1).join("\n");
|
|
226
231
|
}
|
|
227
|
-
function
|
|
232
|
+
function Ie(e, t) {
|
|
228
233
|
if (e.indexOf(t[1]) === -1) return -1;
|
|
229
234
|
let n = 0;
|
|
230
235
|
for (let r = 0; r < e.length; r++) if (e[r] === "\\") r++;
|
|
@@ -232,7 +237,7 @@ function Me(e, t) {
|
|
|
232
237
|
else if (e[r] === t[1] && (n--, n < 0)) return r;
|
|
233
238
|
return n > 0 ? -2 : -1;
|
|
234
239
|
}
|
|
235
|
-
function
|
|
240
|
+
function Le(e, t = 0) {
|
|
236
241
|
let n = t, r = "";
|
|
237
242
|
for (let t of e) if (t === " ") {
|
|
238
243
|
let e = 4 - n % 4;
|
|
@@ -253,7 +258,7 @@ function G(e, t, n, r, i) {
|
|
|
253
258
|
};
|
|
254
259
|
return r.state.inLink = !1, c;
|
|
255
260
|
}
|
|
256
|
-
function
|
|
261
|
+
function Re(e, t, n) {
|
|
257
262
|
let r = e.match(n.other.indentCodeCompensation);
|
|
258
263
|
if (r === null) return t;
|
|
259
264
|
let i = r[1];
|
|
@@ -293,7 +298,7 @@ var K = class {
|
|
|
293
298
|
fences(e) {
|
|
294
299
|
let t = this.rules.block.fences.exec(e);
|
|
295
300
|
if (t) {
|
|
296
|
-
let e = t[0], n =
|
|
301
|
+
let e = t[0], n = Re(e, t[3] || "", this.rules);
|
|
297
302
|
return {
|
|
298
303
|
type: "code",
|
|
299
304
|
raw: e,
|
|
@@ -345,8 +350,9 @@ ${c}` : c;
|
|
|
345
350
|
let u = i.at(-1);
|
|
346
351
|
if (u?.type === "code") break;
|
|
347
352
|
if (u?.type === "blockquote") {
|
|
348
|
-
let t = u, a = t.raw + "\n" +
|
|
349
|
-
i[i.length - 1] =
|
|
353
|
+
let t = u, a = e.join("\n"), o = t.raw + "\n" + a.replace(this.rules.other.blockquoteSetextReplace2, ""), s = this.blockquote(o);
|
|
354
|
+
i[i.length - 1] = s, n = `${n}
|
|
355
|
+
${a}`, r = r.substring(0, r.length - t.text.length) + s.text;
|
|
350
356
|
break;
|
|
351
357
|
}
|
|
352
358
|
if (u?.type === "list") {
|
|
@@ -380,7 +386,7 @@ ${c}` : c;
|
|
|
380
386
|
let n = !1, r = "", s = "";
|
|
381
387
|
if (!(t = a.exec(e)) || this.rules.block.hr.test(e)) break;
|
|
382
388
|
r = t[0], e = e.substring(r.length);
|
|
383
|
-
let c =
|
|
389
|
+
let c = Le(t[2].split("\n", 1)[0], t[1].length), l = e.split("\n", 1)[0], u = !c.trim(), d = 0;
|
|
384
390
|
if (this.options.pedantic ? (d = 2, s = c.trimStart()) : u ? d = t[1].length + 1 : (d = c.search(this.rules.other.nonSpaceChar), d = d > 4 ? 1 : d, s = c.slice(d), d += t[1].length), u && this.rules.other.blankLine.test(l) && (r += l + "\n", e = e.substring(l.length + 1), n = !0), !n) {
|
|
385
391
|
let t = this.rules.other.nextBulletRegex(d), n = this.rules.other.hrRegex(d), i = this.rules.other.fencesBeginRegex(d), a = this.rules.other.headingBeginRegex(d), o = this.rules.other.htmlBeginRegex(d), f = this.rules.other.blockquoteBeginRegex(d);
|
|
386
392
|
for (; e;) {
|
|
@@ -558,7 +564,7 @@ ${c}` : c;
|
|
|
558
564
|
let t = U(e.slice(0, -1), "\\");
|
|
559
565
|
if ((e.length - t.length) % 2 == 0) return;
|
|
560
566
|
} else {
|
|
561
|
-
let e =
|
|
567
|
+
let e = Ie(t[2], "()");
|
|
562
568
|
if (e === -2) return;
|
|
563
569
|
if (e > -1) {
|
|
564
570
|
let n = (t[0].indexOf("!") === 0 ? 5 : 4) + t[1].length + e;
|
|
@@ -594,33 +600,36 @@ ${c}` : c;
|
|
|
594
600
|
emStrong(e, t, n = "") {
|
|
595
601
|
let r = this.rules.inline.emStrongLDelim.exec(e);
|
|
596
602
|
if (!(!r || !r[1] && !r[2] && !r[3] && !r[4] || r[4] && n.match(this.rules.other.unicodeAlphaNumeric)) && (!(r[1] || r[3]) || !n || this.rules.inline.punctuation.exec(n))) {
|
|
597
|
-
let
|
|
598
|
-
for (
|
|
599
|
-
if (
|
|
600
|
-
if (
|
|
601
|
-
|
|
603
|
+
let i = [...r[0]].length - 1, a, o, s = i, c = 0, l = r[0][0], u = n === l, d = l === "*" ? this.rules.inline.emStrongRDelimAst : this.rules.inline.emStrongRDelimUnd;
|
|
604
|
+
for (d.lastIndex = 0, t = t.slice(-1 * e.length + i); (r = d.exec(t)) !== null;) {
|
|
605
|
+
if (a = r[1] || r[2] || r[3] || r[4] || r[5] || r[6], !a) continue;
|
|
606
|
+
if (o = [...a].length, r[3] || r[4]) {
|
|
607
|
+
s += o;
|
|
602
608
|
continue;
|
|
603
609
|
}
|
|
604
|
-
if (
|
|
605
|
-
|
|
606
|
-
|
|
610
|
+
if (r[5] || r[6]) {
|
|
611
|
+
if (i % 3 && !((i + o) % 3)) {
|
|
612
|
+
c += o;
|
|
613
|
+
continue;
|
|
614
|
+
}
|
|
615
|
+
if (u) break;
|
|
607
616
|
}
|
|
608
|
-
if (
|
|
609
|
-
|
|
610
|
-
let t = [...r[0]][0].length,
|
|
611
|
-
if (Math.min(
|
|
612
|
-
let e =
|
|
617
|
+
if (s -= o, s > 0) continue;
|
|
618
|
+
o = Math.min(o, o + s + c);
|
|
619
|
+
let t = [...r[0]][0].length, n = e.slice(0, i + r.index + t + o);
|
|
620
|
+
if (Math.min(i, o) % 2) {
|
|
621
|
+
let e = n.slice(1, -1);
|
|
613
622
|
return {
|
|
614
623
|
type: "em",
|
|
615
|
-
raw:
|
|
624
|
+
raw: n,
|
|
616
625
|
text: e,
|
|
617
626
|
tokens: this.lexer.inlineTokens(e)
|
|
618
627
|
};
|
|
619
628
|
}
|
|
620
|
-
let l =
|
|
629
|
+
let l = n.slice(2, -2);
|
|
621
630
|
return {
|
|
622
631
|
type: "strong",
|
|
623
|
-
raw:
|
|
632
|
+
raw: n,
|
|
624
633
|
text: l,
|
|
625
634
|
tokens: this.lexer.inlineTokens(l)
|
|
626
635
|
};
|
|
@@ -762,7 +771,7 @@ ${c}` : c;
|
|
|
762
771
|
}
|
|
763
772
|
blockTokens(e, t = [], n = !1) {
|
|
764
773
|
this.tokenizer.lexer = this, this.options.pedantic && (e = e.replace(c.tabCharGlobal, " ").replace(c.spaceLine, ""));
|
|
765
|
-
let r =
|
|
774
|
+
let r = 1 / 0;
|
|
766
775
|
for (; e;) {
|
|
767
776
|
if (e.length < r) r = e.length;
|
|
768
777
|
else {
|
|
@@ -826,10 +835,10 @@ ${c}` : c;
|
|
|
826
835
|
}
|
|
827
836
|
let a = e;
|
|
828
837
|
if (this.options.extensions?.startBlock) {
|
|
829
|
-
let t =
|
|
838
|
+
let t = 1 / 0, n = e.slice(1), r;
|
|
830
839
|
this.options.extensions.startBlock.forEach((e) => {
|
|
831
840
|
r = e.call({ lexer: this }, n), typeof r == "number" && r >= 0 && (t = Math.min(t, r));
|
|
832
|
-
}), t <
|
|
841
|
+
}), t < 1 / 0 && t >= 0 && (a = e.substring(0, t + 1));
|
|
833
842
|
}
|
|
834
843
|
if (this.state.top && (i = this.tokenizer.paragraph(a))) {
|
|
835
844
|
let r = t.at(-1);
|
|
@@ -866,7 +875,7 @@ ${c}` : c;
|
|
|
866
875
|
let r = n ? n.length : 0;
|
|
867
876
|
return e.slice(0, r) + "[" + "a".repeat(e.length - r - 2) + "]";
|
|
868
877
|
}), n = this.options.hooks?.emStrongMask?.call({ lexer: this }, n) ?? n;
|
|
869
|
-
let r = !1, i = "", a =
|
|
878
|
+
let r = !1, i = "", a = 1 / 0;
|
|
870
879
|
for (; e;) {
|
|
871
880
|
if (e.length < a) a = e.length;
|
|
872
881
|
else {
|
|
@@ -920,10 +929,10 @@ ${c}` : c;
|
|
|
920
929
|
}
|
|
921
930
|
let s = e;
|
|
922
931
|
if (this.options.extensions?.startInline) {
|
|
923
|
-
let t =
|
|
932
|
+
let t = 1 / 0, n = e.slice(1), r;
|
|
924
933
|
this.options.extensions.startInline.forEach((e) => {
|
|
925
934
|
r = e.call({ lexer: this }, n), typeof r == "number" && r >= 0 && (t = Math.min(t, r));
|
|
926
|
-
}), t <
|
|
935
|
+
}), t < 1 / 0 && t >= 0 && (s = e.substring(0, t + 1));
|
|
927
936
|
}
|
|
928
937
|
if (o = this.tokenizer.inlineText(s)) {
|
|
929
938
|
e = e.substring(o.raw.length), o.raw.slice(-1) !== "_" && (i = o.raw.slice(-1)), r = !0;
|
|
@@ -1109,6 +1118,7 @@ ${e}</tr>
|
|
|
1109
1118
|
"table",
|
|
1110
1119
|
"blockquote",
|
|
1111
1120
|
"list",
|
|
1121
|
+
"checkbox",
|
|
1112
1122
|
"html",
|
|
1113
1123
|
"def",
|
|
1114
1124
|
"paragraph",
|
|
@@ -1177,6 +1187,7 @@ ${e}</tr>
|
|
|
1177
1187
|
"html",
|
|
1178
1188
|
"link",
|
|
1179
1189
|
"image",
|
|
1190
|
+
"checkbox",
|
|
1180
1191
|
"strong",
|
|
1181
1192
|
"em",
|
|
1182
1193
|
"codespan",
|
|
@@ -1298,7 +1309,7 @@ ${e}</tr>
|
|
|
1298
1309
|
default: {
|
|
1299
1310
|
let e = r;
|
|
1300
1311
|
this.defaults.extensions?.childTokens?.[e.type] ? this.defaults.extensions.childTokens[e.type].forEach((r) => {
|
|
1301
|
-
let i = e[r].flat(
|
|
1312
|
+
let i = e[r].flat(1 / 0);
|
|
1302
1313
|
n = n.concat(this.walkTokens(i, t));
|
|
1303
1314
|
}) : e.tokens && (n = n.concat(this.walkTokens(e.tokens, t)));
|
|
1304
1315
|
}
|
|
@@ -1448,13 +1459,15 @@ function $(e, t) {
|
|
|
1448
1459
|
}
|
|
1449
1460
|
$.options = $.setOptions = function(e) {
|
|
1450
1461
|
return Q.setOptions(e), $.defaults = Q.defaults, r($.defaults), $;
|
|
1451
|
-
}, $.getDefaults = t, $.defaults = n
|
|
1462
|
+
}, $.getDefaults = t, $.defaults = n;
|
|
1463
|
+
function ze(...e) {
|
|
1452
1464
|
return Q.use(...e), $.defaults = Q.defaults, r($.defaults), $;
|
|
1453
|
-
}
|
|
1465
|
+
}
|
|
1466
|
+
$.use = ze, $.walkTokens = function(e, t) {
|
|
1454
1467
|
return Q.walkTokens(e, t);
|
|
1455
|
-
}, $.parseInline = Q.parseInline, $.Parser = X, $.parser = X.parse, $.Renderer = J, $.TextRenderer = Y, $.Lexer = q, $.lexer = q.lex, $.Tokenizer = K, $.Hooks = Z, $.parse = $, $.options, $.setOptions, $.
|
|
1468
|
+
}, $.parseInline = Q.parseInline, $.Parser = X, $.parser = X.parse, $.Renderer = J, $.TextRenderer = Y, $.Lexer = q, $.lexer = q.lex, $.Tokenizer = K, $.Hooks = Z, $.parse = $, $.options, $.setOptions, $.walkTokens, $.parseInline, X.parse, q.lex;
|
|
1456
1469
|
//#endregion
|
|
1457
1470
|
//#region lib/utils/markdown-to-html.ts
|
|
1458
|
-
var
|
|
1471
|
+
var Be = (t) => e.sanitize($.parse(t, { async: !1 }), { ADD_ATTR: ["colwidth"] });
|
|
1459
1472
|
//#endregion
|
|
1460
|
-
export { $ as n,
|
|
1473
|
+
export { $ as n, Be as t };
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import { r as e } from "./dist-
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
6
|
-
import
|
|
7
|
-
import {
|
|
1
|
+
import { r as e } from "./dist-Dw4STOPE.js";
|
|
2
|
+
import { A as t, C as n, I as r, S as i, n as a } from "./dist-DFua_Xbu.js";
|
|
3
|
+
import { a as o, c as s, i as c, l, n as u, o as d, s as f, t as p, u as m } from "./floating-ui.dom-CmJ6iBdh.js";
|
|
4
|
+
import h, { useEffect as g, useLayoutEffect as _, useRef as v, useState as y } from "react";
|
|
5
|
+
import { createPortal as b } from "react-dom";
|
|
6
|
+
import { NodeSelection as x, Plugin as S, PluginKey as C } from "@tiptap/pm/state";
|
|
7
|
+
import { CellSelection as w } from "@tiptap/pm/tables";
|
|
8
8
|
//#region node_modules/.pnpm/@tiptap+extension-bubble-menu@3.29.2_@tiptap+core@3.29.2_@tiptap+pm@3.29.2__@tiptap+pm@3.29.2/node_modules/@tiptap/extension-bubble-menu/dist/index.js
|
|
9
9
|
function T(e, t) {
|
|
10
10
|
let n = Math.min(e.top, t.top), r = Math.max(e.bottom, t.bottom), i = Math.min(e.left, t.left), a = Math.max(e.right, t.right) - i, o = r - n;
|
|
11
11
|
return new DOMRect(i, n, a, o);
|
|
12
12
|
}
|
|
13
13
|
var E = class {
|
|
14
|
-
constructor({ editor: e, element:
|
|
14
|
+
constructor({ editor: e, element: n, view: r, pluginKey: i = "bubbleMenu", updateDelay: a = 250, resizeDelay: o = 60, shouldShow: s, appendTo: c, getReferencedVirtualElement: l, options: u }) {
|
|
15
15
|
this.preventHide = !1, this.isVisible = !1, this.scrollTarget = window, this.floatingUIOptions = {
|
|
16
16
|
strategy: "absolute",
|
|
17
17
|
placement: "top",
|
|
@@ -27,8 +27,8 @@ var E = class {
|
|
|
27
27
|
onHide: void 0,
|
|
28
28
|
onUpdate: void 0,
|
|
29
29
|
onDestroy: void 0
|
|
30
|
-
}, this.shouldShow = ({ view: e, state:
|
|
31
|
-
let { doc: a, selection: o } =
|
|
30
|
+
}, this.shouldShow = ({ view: e, state: n, from: r, to: i }) => {
|
|
31
|
+
let { doc: a, selection: o } = n, { empty: s } = o, c = !a.textBetween(r, i).length && t(n.selection), l = this.element.contains(document.activeElement);
|
|
32
32
|
return !(!(e.hasFocus() || l) || s || c || !this.editor.isEditable);
|
|
33
33
|
}, this.mousedownHandler = () => {
|
|
34
34
|
this.preventHide = !0;
|
|
@@ -67,31 +67,31 @@ var E = class {
|
|
|
67
67
|
}, this.transactionHandler = ({ transaction: e }) => {
|
|
68
68
|
let t = e.getMeta(this.pluginKey);
|
|
69
69
|
t === "updatePosition" ? this.updatePosition() : t && typeof t == "object" && t.type === "updateOptions" ? this.updateOptions(t.options) : t === "hide" ? this.hide() : t === "show" && (this.updatePosition(), this.show());
|
|
70
|
-
}, this.editor = e, this.element =
|
|
70
|
+
}, this.editor = e, this.element = n, this.view = r, this.pluginKey = i, this.updateDelay = a, this.resizeDelay = o, this.appendTo = c, this.scrollTarget = u?.scrollTarget ?? window, this.getReferencedVirtualElement = l, this.floatingUIOptions = {
|
|
71
71
|
...this.floatingUIOptions,
|
|
72
72
|
...u
|
|
73
|
-
}, this.element.tabIndex = 0, s && (this.shouldShow = s), this.element.addEventListener("mousedown", this.mousedownHandler, { capture: !0 }), this.view.dom.addEventListener("dragstart", this.dragstartHandler), this.editor.on("focus", this.focusHandler), this.editor.on("blur", this.blurHandler), this.editor.on("transaction", this.transactionHandler), window.addEventListener("resize", this.resizeHandler), this.scrollTarget.addEventListener("scroll", this.resizeHandler), this.update(
|
|
73
|
+
}, this.element.tabIndex = 0, s && (this.shouldShow = s), this.element.addEventListener("mousedown", this.mousedownHandler, { capture: !0 }), this.view.dom.addEventListener("dragstart", this.dragstartHandler), this.editor.on("focus", this.focusHandler), this.editor.on("blur", this.blurHandler), this.editor.on("transaction", this.transactionHandler), window.addEventListener("resize", this.resizeHandler), this.scrollTarget.addEventListener("scroll", this.resizeHandler), this.update(r, r.state), this.getShouldShow() && (this.show(), this.updatePosition());
|
|
74
74
|
}
|
|
75
75
|
get middlewares() {
|
|
76
76
|
let e = [];
|
|
77
|
-
return this.floatingUIOptions.flip && e.push(
|
|
77
|
+
return this.floatingUIOptions.flip && e.push(o(typeof this.floatingUIOptions.flip == "boolean" ? void 0 : this.floatingUIOptions.flip)), this.floatingUIOptions.shift && e.push(l(typeof this.floatingUIOptions.shift == "boolean" ? void 0 : this.floatingUIOptions.shift)), this.floatingUIOptions.offset && e.push(s(typeof this.floatingUIOptions.offset == "boolean" ? void 0 : this.floatingUIOptions.offset)), this.floatingUIOptions.arrow && e.push(p(this.floatingUIOptions.arrow)), this.floatingUIOptions.size && e.push(m(typeof this.floatingUIOptions.size == "boolean" ? void 0 : this.floatingUIOptions.size)), this.floatingUIOptions.autoPlacement && e.push(u(typeof this.floatingUIOptions.autoPlacement == "boolean" ? void 0 : this.floatingUIOptions.autoPlacement)), this.floatingUIOptions.hide && e.push(d(typeof this.floatingUIOptions.hide == "boolean" ? void 0 : this.floatingUIOptions.hide)), this.floatingUIOptions.inline && e.push(f(typeof this.floatingUIOptions.inline == "boolean" ? void 0 : this.floatingUIOptions.inline)), e;
|
|
78
78
|
}
|
|
79
79
|
get virtualElement() {
|
|
80
80
|
let { selection: e } = this.editor.state, t = this.getReferencedVirtualElement?.call(this);
|
|
81
81
|
if (t) return t;
|
|
82
82
|
if (!this.view?.dom?.parentNode) return;
|
|
83
|
-
let n =
|
|
83
|
+
let n = r(this.view, e.from, e.to), i = {
|
|
84
84
|
getBoundingClientRect: () => n,
|
|
85
85
|
getClientRects: () => [n]
|
|
86
86
|
};
|
|
87
|
-
if (e instanceof
|
|
87
|
+
if (e instanceof x) {
|
|
88
88
|
let t = this.view.nodeDOM(e.from), n = t.dataset.nodeViewWrapper ? t : t.querySelector("[data-node-view-wrapper]");
|
|
89
89
|
n && (t = n), t && (i = {
|
|
90
90
|
getBoundingClientRect: () => t.getBoundingClientRect(),
|
|
91
91
|
getClientRects: () => [t.getBoundingClientRect()]
|
|
92
92
|
});
|
|
93
93
|
}
|
|
94
|
-
if (e instanceof
|
|
94
|
+
if (e instanceof w) {
|
|
95
95
|
let { $anchorCell: t, $headCell: n } = e, r = t ? t.pos : n.pos, a = n ? n.pos : t.pos, o = this.view.nodeDOM(r), s = this.view.nodeDOM(a);
|
|
96
96
|
if (!o || !s) return;
|
|
97
97
|
let c = o === s ? o.getBoundingClientRect() : T(o.getBoundingClientRect(), s.getBoundingClientRect());
|
|
@@ -105,7 +105,7 @@ var E = class {
|
|
|
105
105
|
updatePosition() {
|
|
106
106
|
if (!this.isVisible) return;
|
|
107
107
|
let e = this.virtualElement;
|
|
108
|
-
e &&
|
|
108
|
+
e && c(e, this.element, {
|
|
109
109
|
placement: this.floatingUIOptions.placement,
|
|
110
110
|
strategy: this.floatingUIOptions.strategy,
|
|
111
111
|
middleware: this.middlewares
|
|
@@ -159,14 +159,14 @@ var E = class {
|
|
|
159
159
|
destroy() {
|
|
160
160
|
this.hide(), this.element.removeEventListener("mousedown", this.mousedownHandler, { capture: !0 }), this.view.dom.removeEventListener("dragstart", this.dragstartHandler), window.removeEventListener("resize", this.resizeHandler), this.scrollTarget.removeEventListener("scroll", this.resizeHandler), this.editor.off("focus", this.focusHandler), this.editor.off("blur", this.blurHandler), this.editor.off("transaction", this.transactionHandler), this.floatingUIOptions.onDestroy && this.floatingUIOptions.onDestroy();
|
|
161
161
|
}
|
|
162
|
-
}, D = (e) => new
|
|
163
|
-
key: typeof e.pluginKey == "string" ? new
|
|
162
|
+
}, D = (e) => new S({
|
|
163
|
+
key: typeof e.pluginKey == "string" ? new C(e.pluginKey) : e.pluginKey,
|
|
164
164
|
view: (t) => new E({
|
|
165
165
|
view: t,
|
|
166
166
|
...e
|
|
167
167
|
})
|
|
168
168
|
});
|
|
169
|
-
|
|
169
|
+
a.create({
|
|
170
170
|
name: "bubbleMenu",
|
|
171
171
|
addOptions() {
|
|
172
172
|
return {
|
|
@@ -240,11 +240,11 @@ var O = class {
|
|
|
240
240
|
}, this.element.tabIndex = 0, c && (this.shouldShow = c), this.element.addEventListener("mousedown", this.mousedownHandler, { capture: !0 }), this.editor.on("focus", this.focusHandler), this.editor.on("blur", this.blurHandler), this.editor.on("transaction", this.transactionHandler), window.addEventListener("resize", this.resizeHandler), this.scrollTarget.addEventListener("scroll", this.resizeHandler), this.update(n, n.state), this.getShouldShow() && (this.show(), this.updatePosition());
|
|
241
241
|
}
|
|
242
242
|
getTextContent(e) {
|
|
243
|
-
return
|
|
243
|
+
return i(e, { textSerializers: n(this.editor.schema) });
|
|
244
244
|
}
|
|
245
245
|
get middlewares() {
|
|
246
246
|
let e = [];
|
|
247
|
-
return this.floatingUIOptions.flip && e.push(
|
|
247
|
+
return this.floatingUIOptions.flip && e.push(o(typeof this.floatingUIOptions.flip == "boolean" ? void 0 : this.floatingUIOptions.flip)), this.floatingUIOptions.shift && e.push(l(typeof this.floatingUIOptions.shift == "boolean" ? void 0 : this.floatingUIOptions.shift)), this.floatingUIOptions.offset && e.push(s(typeof this.floatingUIOptions.offset == "boolean" ? void 0 : this.floatingUIOptions.offset)), this.floatingUIOptions.arrow && e.push(p(this.floatingUIOptions.arrow)), this.floatingUIOptions.size && e.push(m(typeof this.floatingUIOptions.size == "boolean" ? void 0 : this.floatingUIOptions.size)), this.floatingUIOptions.autoPlacement && e.push(u(typeof this.floatingUIOptions.autoPlacement == "boolean" ? void 0 : this.floatingUIOptions.autoPlacement)), this.floatingUIOptions.hide && e.push(d(typeof this.floatingUIOptions.hide == "boolean" ? void 0 : this.floatingUIOptions.hide)), this.floatingUIOptions.inline && e.push(f(typeof this.floatingUIOptions.inline == "boolean" ? void 0 : this.floatingUIOptions.inline)), e;
|
|
248
248
|
}
|
|
249
249
|
getShouldShow(e) {
|
|
250
250
|
let { state: t } = this.view, { selection: n } = t, { ranges: r } = n, i = Math.min(...r.map((e) => e.$from.pos)), a = Math.max(...r.map((e) => e.$to.pos));
|
|
@@ -268,8 +268,8 @@ var O = class {
|
|
|
268
268
|
}
|
|
269
269
|
updatePosition() {
|
|
270
270
|
if (!this.view?.dom?.parentNode) return;
|
|
271
|
-
let { selection: e } = this.editor.state, t =
|
|
272
|
-
|
|
271
|
+
let { selection: e } = this.editor.state, t = r(this.view, e.from, e.to);
|
|
272
|
+
c({
|
|
273
273
|
getBoundingClientRect: () => t,
|
|
274
274
|
getClientRects: () => [t]
|
|
275
275
|
}, this.element, {
|
|
@@ -298,14 +298,14 @@ var O = class {
|
|
|
298
298
|
destroy() {
|
|
299
299
|
this.hide(), this.element.removeEventListener("mousedown", this.mousedownHandler, { capture: !0 }), window.removeEventListener("resize", this.resizeHandler), this.scrollTarget.removeEventListener("scroll", this.resizeHandler), this.editor.off("focus", this.focusHandler), this.editor.off("blur", this.blurHandler), this.editor.off("transaction", this.transactionHandler), this.floatingUIOptions.onDestroy && this.floatingUIOptions.onDestroy();
|
|
300
300
|
}
|
|
301
|
-
}, k = (e) => new
|
|
302
|
-
key: typeof e.pluginKey == "string" ? new
|
|
301
|
+
}, k = (e) => new S({
|
|
302
|
+
key: typeof e.pluginKey == "string" ? new C(e.pluginKey) : e.pluginKey,
|
|
303
303
|
view: (t) => new O({
|
|
304
304
|
view: t,
|
|
305
305
|
...e
|
|
306
306
|
})
|
|
307
307
|
});
|
|
308
|
-
|
|
308
|
+
a.create({
|
|
309
309
|
name: "floatingMenu",
|
|
310
310
|
addOptions() {
|
|
311
311
|
return {
|
|
@@ -336,10 +336,10 @@ c.create({
|
|
|
336
336
|
});
|
|
337
337
|
//#endregion
|
|
338
338
|
//#region node_modules/.pnpm/@tiptap+react@3.29.2_@floating-ui+dom@1.8.0_@tiptap+core@3.29.2_@tiptap+pm@3.29.2__@tip_6ae02cdf395ababc98513a112803373d/node_modules/@tiptap/react/dist/menus/index.js
|
|
339
|
-
function A(e,
|
|
340
|
-
return e ?? new t
|
|
339
|
+
function A(e, t) {
|
|
340
|
+
return e ?? new C(t);
|
|
341
341
|
}
|
|
342
|
-
var j = typeof window < "u" ?
|
|
342
|
+
var j = typeof window < "u" ? _ : g, M = /* @__PURE__ */ new Set([
|
|
343
343
|
"left",
|
|
344
344
|
"opacity",
|
|
345
345
|
"position",
|
|
@@ -507,7 +507,7 @@ function Q(e, t, n) {
|
|
|
507
507
|
}), r;
|
|
508
508
|
}
|
|
509
509
|
function $(e, t) {
|
|
510
|
-
let n =
|
|
510
|
+
let n = v({}), r = v([]);
|
|
511
511
|
j(() => {
|
|
512
512
|
let i = n.current;
|
|
513
513
|
return X(e, i.className, t.className), Z(e, i.style, t.style), Y(e, i, t), r.current = Q(e, r.current, t), n.current = t, () => {
|
|
@@ -517,10 +517,10 @@ function $(e, t) {
|
|
|
517
517
|
};
|
|
518
518
|
}, [e, t]);
|
|
519
519
|
}
|
|
520
|
-
var te =
|
|
521
|
-
let f =
|
|
520
|
+
var te = h.forwardRef(({ pluginKey: t, editor: n, updateDelay: r, resizeDelay: i, appendTo: a, shouldShow: o = null, getReferencedVirtualElement: s, options: c, children: l, ...u }, d) => {
|
|
521
|
+
let f = v(document.createElement("div")), p = v(A(t, "bubbleMenu")).current;
|
|
522
522
|
$(f.current, u), typeof d == "function" ? d(f.current) : d && (d.current = f.current);
|
|
523
|
-
let { editor: m } = e(), h = n || m,
|
|
523
|
+
let { editor: m } = e(), h = n || m, _ = {
|
|
524
524
|
updateDelay: r,
|
|
525
525
|
resizeDelay: i,
|
|
526
526
|
appendTo: a,
|
|
@@ -528,10 +528,10 @@ var te = y.forwardRef(({ pluginKey: t, editor: n, updateDelay: r, resizeDelay: i
|
|
|
528
528
|
shouldShow: o,
|
|
529
529
|
getReferencedVirtualElement: s,
|
|
530
530
|
options: c
|
|
531
|
-
},
|
|
532
|
-
|
|
533
|
-
let [
|
|
534
|
-
return
|
|
531
|
+
}, x = v(_);
|
|
532
|
+
x.current = _;
|
|
533
|
+
let [S, C] = y(!1), w = v(!0);
|
|
534
|
+
return g(() => {
|
|
535
535
|
if (h?.isDestroyed) return;
|
|
536
536
|
if (!h) {
|
|
537
537
|
console.warn("BubbleMenu component is not rendered inside of an editor component or does not have editor prop.");
|
|
@@ -540,30 +540,30 @@ var te = y.forwardRef(({ pluginKey: t, editor: n, updateDelay: r, resizeDelay: i
|
|
|
540
540
|
let e = f.current;
|
|
541
541
|
e.style.visibility = "hidden", e.style.position = "absolute";
|
|
542
542
|
let t = D({
|
|
543
|
-
...
|
|
543
|
+
...x.current,
|
|
544
544
|
editor: h,
|
|
545
545
|
element: e
|
|
546
546
|
});
|
|
547
547
|
h.registerPlugin(t);
|
|
548
|
-
let n =
|
|
549
|
-
return
|
|
550
|
-
|
|
548
|
+
let n = x.current.pluginKey;
|
|
549
|
+
return w.current = !0, C(!0), () => {
|
|
550
|
+
C(!1), h.unregisterPlugin(n), window.requestAnimationFrame(() => {
|
|
551
551
|
e.parentNode && e.parentNode.removeChild(e);
|
|
552
552
|
});
|
|
553
553
|
};
|
|
554
|
-
}, [h]),
|
|
555
|
-
if (!(!
|
|
556
|
-
if (
|
|
557
|
-
|
|
554
|
+
}, [h]), g(() => {
|
|
555
|
+
if (!(!S || !h || h.isDestroyed)) {
|
|
556
|
+
if (w.current) {
|
|
557
|
+
w.current = !1;
|
|
558
558
|
return;
|
|
559
559
|
}
|
|
560
560
|
h.view.dispatch(h.state.tr.setMeta(p, {
|
|
561
561
|
type: "updateOptions",
|
|
562
|
-
options:
|
|
562
|
+
options: x.current
|
|
563
563
|
}));
|
|
564
564
|
}
|
|
565
565
|
}, [
|
|
566
|
-
|
|
566
|
+
S,
|
|
567
567
|
h,
|
|
568
568
|
r,
|
|
569
569
|
i,
|
|
@@ -572,10 +572,10 @@ var te = y.forwardRef(({ pluginKey: t, editor: n, updateDelay: r, resizeDelay: i
|
|
|
572
572
|
a,
|
|
573
573
|
s,
|
|
574
574
|
p
|
|
575
|
-
]),
|
|
575
|
+
]), b(l, f.current);
|
|
576
576
|
});
|
|
577
|
-
|
|
578
|
-
let d =
|
|
577
|
+
h.forwardRef(({ pluginKey: t, editor: n, updateDelay: r, resizeDelay: i, appendTo: a, shouldShow: o = null, options: s, children: c, ...l }, u) => {
|
|
578
|
+
let d = v(document.createElement("div")), f = v(A(t, "floatingMenu")).current;
|
|
579
579
|
$(d.current, l), typeof u == "function" ? u(d.current) : u && (u.current = d.current);
|
|
580
580
|
let { editor: p } = e(), m = n || p, h = {
|
|
581
581
|
updateDelay: r,
|
|
@@ -584,10 +584,10 @@ y.forwardRef(({ pluginKey: t, editor: n, updateDelay: r, resizeDelay: i, appendT
|
|
|
584
584
|
pluginKey: f,
|
|
585
585
|
shouldShow: o,
|
|
586
586
|
options: s
|
|
587
|
-
},
|
|
588
|
-
|
|
589
|
-
let [
|
|
590
|
-
return
|
|
587
|
+
}, _ = v(h);
|
|
588
|
+
_.current = h;
|
|
589
|
+
let [x, S] = y(!1), C = v(!0);
|
|
590
|
+
return g(() => {
|
|
591
591
|
if (m?.isDestroyed) return;
|
|
592
592
|
if (!m) {
|
|
593
593
|
console.warn("FloatingMenu component is not rendered inside of an editor component or does not have editor prop.");
|
|
@@ -596,30 +596,30 @@ y.forwardRef(({ pluginKey: t, editor: n, updateDelay: r, resizeDelay: i, appendT
|
|
|
596
596
|
let e = d.current;
|
|
597
597
|
e.style.visibility = "hidden", e.style.position = "absolute";
|
|
598
598
|
let t = k({
|
|
599
|
-
...
|
|
599
|
+
..._.current,
|
|
600
600
|
editor: m,
|
|
601
601
|
element: e
|
|
602
602
|
});
|
|
603
603
|
m.registerPlugin(t);
|
|
604
|
-
let n =
|
|
605
|
-
return
|
|
606
|
-
|
|
604
|
+
let n = _.current.pluginKey;
|
|
605
|
+
return C.current = !0, S(!0), () => {
|
|
606
|
+
S(!1), m.unregisterPlugin(n), window.requestAnimationFrame(() => {
|
|
607
607
|
e.parentNode && e.parentNode.removeChild(e);
|
|
608
608
|
});
|
|
609
609
|
};
|
|
610
|
-
}, [m]),
|
|
611
|
-
if (!(!
|
|
612
|
-
if (
|
|
613
|
-
|
|
610
|
+
}, [m]), g(() => {
|
|
611
|
+
if (!(!x || !m || m.isDestroyed)) {
|
|
612
|
+
if (C.current) {
|
|
613
|
+
C.current = !1;
|
|
614
614
|
return;
|
|
615
615
|
}
|
|
616
616
|
m.view.dispatch(m.state.tr.setMeta(f, {
|
|
617
617
|
type: "updateOptions",
|
|
618
|
-
options:
|
|
618
|
+
options: _.current
|
|
619
619
|
}));
|
|
620
620
|
}
|
|
621
621
|
}, [
|
|
622
|
-
|
|
622
|
+
x,
|
|
623
623
|
m,
|
|
624
624
|
r,
|
|
625
625
|
i,
|
|
@@ -627,7 +627,7 @@ y.forwardRef(({ pluginKey: t, editor: n, updateDelay: r, resizeDelay: i, appendT
|
|
|
627
627
|
s,
|
|
628
628
|
a,
|
|
629
629
|
f
|
|
630
|
-
]),
|
|
630
|
+
]), b(c, d.current);
|
|
631
631
|
});
|
|
632
632
|
//#endregion
|
|
633
633
|
export { te as t };
|