@clevertask/scribe 0.1.10 → 0.1.12
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 +11 -1
- package/dist/{BarMenu-5S2vKAtc.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/CalloutBubbleMenu.d.ts +7 -0
- package/dist/components/Menu/CalloutBubbleMenu.d.ts.map +1 -0
- package/dist/components/Menu/CalloutBubbleMenu.js +156 -0
- 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 +306 -0
- package/dist/components/Menu/calloutBubbleMenuPlugin.d.ts +10 -0
- package/dist/components/Menu/calloutBubbleMenuPlugin.d.ts.map +1 -0
- package/dist/components/Menu/calloutBubbleMenuPlugin.js +22 -0
- package/dist/components/Menu/contextualMenuOwner.d.ts +4 -0
- package/dist/components/Menu/contextualMenuOwner.d.ts.map +1 -0
- package/dist/components/Menu/contextualMenuOwner.js +9 -0
- 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/callout.d.ts +32 -0
- package/dist/components/Scribe/extension/callout.d.ts.map +1 -0
- package/dist/components/Scribe/extension/callout.js +118 -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 +2 -2
- 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 +73 -26
- package/dist/components/Scribe/extension/slashCommand/renderItems.js +1 -1
- package/dist/components/Scribe/extension/tableOfContents.js +1 -1
- 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 +140 -133
- package/dist/{dist-DErUltkU.js → dist-DFua_Xbu.js} +37 -31
- package/dist/{dist-wYqYXEOz.js → dist-Dw4STOPE.js} +1 -1
- package/dist/{extension-6I5t1ZxQ.js → extension-_8uh0Ik9.js} +1323 -1780
- package/dist/{extension-link-DJy7XDoj.js → extension-link-CjfUZ90W.js} +1 -1
- package/dist/{html-to-markdown-Cta7-ssO.js → html-to-markdown-C920nQtn.js} +155 -56
- package/dist/icons/CalloutIcon.d.ts +9 -0
- package/dist/icons/CalloutIcon.d.ts.map +1 -0
- package/dist/icons/CalloutIcon.js +72 -0
- package/dist/main.css +170 -1
- package/dist/main.d.ts +1 -0
- package/dist/main.d.ts.map +1 -1
- package/dist/main.js +9 -8
- package/dist/{markdown-to-html-DwSNqq2i.js → markdown-to-html-CW0Nb9Ye.js} +103 -60
- package/dist/{menus-m_EkiaUN.js → menus-_EXlLMjz.js} +2 -2
- package/dist/{purify.es-CFiLaBu1.js → purify.es-BES4pJF7.js} +267 -260
- package/dist/resizable-table-Ddw3l6DJ.js +489 -0
- package/dist/{slashCommand-DuSH9sXJ.js → slashCommand-CxX07Nbk.js} +24 -22
- 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 +47 -24
package/dist/main.js
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { t } from "./
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
|
|
1
|
+
import { CALLOUT_VARIANTS as e, CALLOUT_VARIANT_LABELS as t, Callout as n, DEFAULT_CALLOUT_VARIANT as r, isCalloutVariant as i } from "./components/Scribe/extension/callout.js";
|
|
2
|
+
import { t as a } from "./html-to-markdown-C920nQtn.js";
|
|
3
|
+
import { t as o } from "./markdown-to-html-CW0Nb9Ye.js";
|
|
4
|
+
import { isInViewport as s } from "./utils/is-in-viewport.js";
|
|
5
|
+
import { convertLegacyMathDelimiters as c } from "./utils/convert-legacy-math-delimiters.js";
|
|
6
|
+
import { SuggestionItemType as l } from "./components/Scribe/extension/slashCommand/items.js";
|
|
7
|
+
import { createScribeEditor as u } from "./utils/index.js";
|
|
8
|
+
import { Scribe as d } from "./components/Scribe/index.js";
|
|
9
|
+
export { e as CALLOUT_VARIANTS, t as CALLOUT_VARIANT_LABELS, n as Callout, r as DEFAULT_CALLOUT_VARIANT, d as Scribe, l as SuggestionItemType, c as convertLegacyMathDelimiters, u as createScribeEditor, a as html2md, i as isCalloutVariant, s as isInViewport, o as md2html };
|
|
@@ -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,45 @@ 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 = /* @__PURE__ */ new Set([
|
|
1472
|
+
"info",
|
|
1473
|
+
"tip",
|
|
1474
|
+
"warning",
|
|
1475
|
+
"caution"
|
|
1476
|
+
]), Ve = [
|
|
1477
|
+
"width",
|
|
1478
|
+
"min-width",
|
|
1479
|
+
"max-width",
|
|
1480
|
+
"text-align"
|
|
1481
|
+
], He = (e) => {
|
|
1482
|
+
let t = e?.trim().toLowerCase();
|
|
1483
|
+
return t && Be.has(t) ? t : "info";
|
|
1484
|
+
}, Ue = (e) => {
|
|
1485
|
+
let t = e.matches("table, col, th, td") ? Ve.map((t) => [t, e.style.getPropertyValue(t)]).filter(([, e]) => !!e) : [];
|
|
1486
|
+
e.removeAttribute("style"), t.forEach(([t, n]) => {
|
|
1487
|
+
e.style.setProperty(t, n);
|
|
1488
|
+
});
|
|
1489
|
+
}, We = (e) => {
|
|
1490
|
+
let t = document.createElement("div");
|
|
1491
|
+
return t.innerHTML = e, t.querySelectorAll("aside[data-type=\"callout\"]").forEach((e) => {
|
|
1492
|
+
let t = He(e.getAttribute("data-variant"));
|
|
1493
|
+
Array.from(e.attributes).forEach((t) => {
|
|
1494
|
+
t.name !== "data-type" && t.name !== "data-variant" && t.name !== "role" && e.removeAttribute(t.name);
|
|
1495
|
+
}), e.setAttribute("data-type", "callout"), e.setAttribute("data-variant", t), e.setAttribute("role", "note"), [e, ...Array.from(e.querySelectorAll("*"))].forEach((e) => {
|
|
1496
|
+
Ue(e), Array.from(e.attributes).forEach((t) => {
|
|
1497
|
+
t.name.toLowerCase().startsWith("on") && e.removeAttribute(t.name);
|
|
1498
|
+
});
|
|
1499
|
+
});
|
|
1500
|
+
}), t.innerHTML;
|
|
1501
|
+
}, Ge = (t) => We(e.sanitize($.parse(t, { async: !1 }), { ADD_ATTR: ["colwidth"] }));
|
|
1459
1502
|
//#endregion
|
|
1460
|
-
export { $ as n,
|
|
1503
|
+
export { $ as n, Ge as t };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { r as e } from "./dist-
|
|
2
|
-
import { A as t, C as n, I as r, S as i, n as a } from "./dist-
|
|
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
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
4
|
import h, { useEffect as g, useLayoutEffect as _, useRef as v, useState as y } from "react";
|
|
5
5
|
import { createPortal as b } from "react-dom";
|