@clevertask/scribe 0.0.10 → 0.0.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.
Files changed (39) hide show
  1. package/dist/assets/index.css +1 -1
  2. package/dist/clsx-OuTLNxxd.js +16 -0
  3. package/dist/components/Menu/BarMenu.js +119 -4
  4. package/dist/components/Menu/BubbleMenu.js +1 -1
  5. package/dist/components/Menu/Mobile/ListOptionBar.d.ts +6 -0
  6. package/dist/components/Menu/Mobile/ListOptionBar.js +40 -0
  7. package/dist/components/Scribe/extension/emoji/EmojiList.d.ts +1 -0
  8. package/dist/components/Scribe/extension/emoji/EmojiList.js +35 -0
  9. package/dist/components/Scribe/extension/emoji/suggest.d.ts +16 -0
  10. package/dist/components/Scribe/extension/emoji/suggest.js +40 -0
  11. package/dist/components/Scribe/extension/extension-link.js +221 -217
  12. package/dist/components/Scribe/extension/extension-selectedText.js +1 -1
  13. package/dist/components/Scribe/extension/index.d.ts +1 -1
  14. package/dist/components/Scribe/extension/index.js +33 -28
  15. package/dist/components/Scribe/extension/slashCommand/SlashCommandList.js +8 -6
  16. package/dist/components/Scribe/extension/slashCommand/index.js +4 -153
  17. package/dist/components/Scribe/extension/slashCommand/renderItems.d.ts +1 -1
  18. package/dist/components/Scribe/extension/slashCommand/renderItems.js +14 -14
  19. package/dist/components/Scribe/index.d.ts +1 -0
  20. package/dist/components/Scribe/index.js +85 -61
  21. package/dist/index-B0pieAxt.js +160 -0
  22. package/dist/index-CCS9HOYd.js +51031 -0
  23. package/dist/{index-Gm-3o3nq.js → index-DoNRu1rY.js} +1654 -1553
  24. package/dist/index-VneQGVTd.js +2385 -0
  25. package/dist/main.css +64 -6
  26. package/dist/marked.esm-BS_MmRZC.js +1566 -0
  27. package/dist/purify.es-BGaRrCfO.js +553 -0
  28. package/dist/turndown.browser.es-RmA_HBaI.js +649 -0
  29. package/dist/utils/create-scribe-editor.js +7 -6
  30. package/dist/utils/html-to-markdown.js +7 -6
  31. package/dist/utils/markdown-to-html.js +4 -3
  32. package/package.json +44 -41
  33. package/dist/BarMenu-SiPgB2ow.js +0 -134
  34. package/dist/browser-DEobZXxB.js +0 -2099
  35. package/dist/components/Scribe/extension/math-extension.d.ts +0 -2
  36. package/dist/components/Scribe/extension/math-extension.js +0 -11770
  37. package/dist/index-C3_lI_rP.js +0 -2269
  38. package/dist/index-NRgJVTH-.js +0 -7576
  39. package/dist/turndown.browser.es-BSoGafvq.js +0 -1164
@@ -0,0 +1,649 @@
1
+ function x(e) {
2
+ for (var r = 1; r < arguments.length; r++) {
3
+ var t = arguments[r];
4
+ for (var n in t)
5
+ t.hasOwnProperty(n) && (e[n] = t[n]);
6
+ }
7
+ return e;
8
+ }
9
+ function g(e, r) {
10
+ return Array(r + 1).join(e);
11
+ }
12
+ function k(e) {
13
+ return e.replace(/^\n*/, "");
14
+ }
15
+ function C(e) {
16
+ for (var r = e.length; r > 0 && e[r - 1] === `
17
+ `; ) r--;
18
+ return e.substring(0, r);
19
+ }
20
+ function R(e) {
21
+ return C(k(e));
22
+ }
23
+ var M = [
24
+ "ADDRESS",
25
+ "ARTICLE",
26
+ "ASIDE",
27
+ "AUDIO",
28
+ "BLOCKQUOTE",
29
+ "BODY",
30
+ "CANVAS",
31
+ "CENTER",
32
+ "DD",
33
+ "DIR",
34
+ "DIV",
35
+ "DL",
36
+ "DT",
37
+ "FIELDSET",
38
+ "FIGCAPTION",
39
+ "FIGURE",
40
+ "FOOTER",
41
+ "FORM",
42
+ "FRAMESET",
43
+ "H1",
44
+ "H2",
45
+ "H3",
46
+ "H4",
47
+ "H5",
48
+ "H6",
49
+ "HEADER",
50
+ "HGROUP",
51
+ "HR",
52
+ "HTML",
53
+ "ISINDEX",
54
+ "LI",
55
+ "MAIN",
56
+ "MENU",
57
+ "NAV",
58
+ "NOFRAMES",
59
+ "NOSCRIPT",
60
+ "OL",
61
+ "OUTPUT",
62
+ "P",
63
+ "PRE",
64
+ "SECTION",
65
+ "TABLE",
66
+ "TBODY",
67
+ "TD",
68
+ "TFOOT",
69
+ "TH",
70
+ "THEAD",
71
+ "TR",
72
+ "UL"
73
+ ];
74
+ function A(e) {
75
+ return N(e, M);
76
+ }
77
+ var b = [
78
+ "AREA",
79
+ "BASE",
80
+ "BR",
81
+ "COL",
82
+ "COMMAND",
83
+ "EMBED",
84
+ "HR",
85
+ "IMG",
86
+ "INPUT",
87
+ "KEYGEN",
88
+ "LINK",
89
+ "META",
90
+ "PARAM",
91
+ "SOURCE",
92
+ "TRACK",
93
+ "WBR"
94
+ ];
95
+ function S(e) {
96
+ return N(e, b);
97
+ }
98
+ function I(e) {
99
+ return w(e, b);
100
+ }
101
+ var O = [
102
+ "A",
103
+ "TABLE",
104
+ "THEAD",
105
+ "TBODY",
106
+ "TFOOT",
107
+ "TH",
108
+ "TD",
109
+ "IFRAME",
110
+ "SCRIPT",
111
+ "AUDIO",
112
+ "VIDEO"
113
+ ];
114
+ function H(e) {
115
+ return N(e, O);
116
+ }
117
+ function F(e) {
118
+ return w(e, O);
119
+ }
120
+ function N(e, r) {
121
+ return r.indexOf(e.nodeName) >= 0;
122
+ }
123
+ function w(e, r) {
124
+ return e.getElementsByTagName && r.some(function(t) {
125
+ return e.getElementsByTagName(t).length;
126
+ });
127
+ }
128
+ var s = {};
129
+ s.paragraph = {
130
+ filter: "p",
131
+ replacement: function(e) {
132
+ return `
133
+
134
+ ` + e + `
135
+
136
+ `;
137
+ }
138
+ };
139
+ s.lineBreak = {
140
+ filter: "br",
141
+ replacement: function(e, r, t) {
142
+ return t.br + `
143
+ `;
144
+ }
145
+ };
146
+ s.heading = {
147
+ filter: ["h1", "h2", "h3", "h4", "h5", "h6"],
148
+ replacement: function(e, r, t) {
149
+ var n = Number(r.nodeName.charAt(1));
150
+ if (t.headingStyle === "setext" && n < 3) {
151
+ var i = g(n === 1 ? "=" : "-", e.length);
152
+ return `
153
+
154
+ ` + e + `
155
+ ` + i + `
156
+
157
+ `;
158
+ } else
159
+ return `
160
+
161
+ ` + g("#", n) + " " + e + `
162
+
163
+ `;
164
+ }
165
+ };
166
+ s.blockquote = {
167
+ filter: "blockquote",
168
+ replacement: function(e) {
169
+ return e = R(e).replace(/^/gm, "> "), `
170
+
171
+ ` + e + `
172
+
173
+ `;
174
+ }
175
+ };
176
+ s.list = {
177
+ filter: ["ul", "ol"],
178
+ replacement: function(e, r) {
179
+ var t = r.parentNode;
180
+ return t.nodeName === "LI" && t.lastElementChild === r ? `
181
+ ` + e : `
182
+
183
+ ` + e + `
184
+
185
+ `;
186
+ }
187
+ };
188
+ s.listItem = {
189
+ filter: "li",
190
+ replacement: function(e, r, t) {
191
+ var n = t.bulletListMarker + " ", i = r.parentNode;
192
+ if (i.nodeName === "OL") {
193
+ var a = i.getAttribute("start"), f = Array.prototype.indexOf.call(i.children, r);
194
+ n = (a ? Number(a) + f : f + 1) + ". ";
195
+ }
196
+ var u = /\n$/.test(e);
197
+ return e = R(e) + (u ? `
198
+ ` : ""), e = e.replace(/\n/gm, `
199
+ ` + " ".repeat(n.length)), n + e + (r.nextSibling ? `
200
+ ` : "");
201
+ }
202
+ };
203
+ s.indentedCodeBlock = {
204
+ filter: function(e, r) {
205
+ return r.codeBlockStyle === "indented" && e.nodeName === "PRE" && e.firstChild && e.firstChild.nodeName === "CODE";
206
+ },
207
+ replacement: function(e, r, t) {
208
+ return `
209
+
210
+ ` + r.firstChild.textContent.replace(/\n/g, `
211
+ `) + `
212
+
213
+ `;
214
+ }
215
+ };
216
+ s.fencedCodeBlock = {
217
+ filter: function(e, r) {
218
+ return r.codeBlockStyle === "fenced" && e.nodeName === "PRE" && e.firstChild && e.firstChild.nodeName === "CODE";
219
+ },
220
+ replacement: function(e, r, t) {
221
+ for (var n = r.firstChild.getAttribute("class") || "", i = (n.match(/language-(\S+)/) || [null, ""])[1], a = r.firstChild.textContent, f = t.fence.charAt(0), u = 3, l = new RegExp("^" + f + "{3,}", "gm"), o; o = l.exec(a); )
222
+ o[0].length >= u && (u = o[0].length + 1);
223
+ var c = g(f, u);
224
+ return `
225
+
226
+ ` + c + i + `
227
+ ` + a.replace(/\n$/, "") + `
228
+ ` + c + `
229
+
230
+ `;
231
+ }
232
+ };
233
+ s.horizontalRule = {
234
+ filter: "hr",
235
+ replacement: function(e, r, t) {
236
+ return `
237
+
238
+ ` + t.hr + `
239
+
240
+ `;
241
+ }
242
+ };
243
+ s.inlineLink = {
244
+ filter: function(e, r) {
245
+ return r.linkStyle === "inlined" && e.nodeName === "A" && e.getAttribute("href");
246
+ },
247
+ replacement: function(e, r) {
248
+ var t = r.getAttribute("href");
249
+ t && (t = t.replace(/([()])/g, "\\$1"));
250
+ var n = h(r.getAttribute("title"));
251
+ return n && (n = ' "' + n.replace(/"/g, '\\"') + '"'), "[" + e + "](" + t + n + ")";
252
+ }
253
+ };
254
+ s.referenceLink = {
255
+ filter: function(e, r) {
256
+ return r.linkStyle === "referenced" && e.nodeName === "A" && e.getAttribute("href");
257
+ },
258
+ replacement: function(e, r, t) {
259
+ var n = r.getAttribute("href"), i = h(r.getAttribute("title"));
260
+ i && (i = ' "' + i + '"');
261
+ var a, f;
262
+ switch (t.linkReferenceStyle) {
263
+ case "collapsed":
264
+ a = "[" + e + "][]", f = "[" + e + "]: " + n + i;
265
+ break;
266
+ case "shortcut":
267
+ a = "[" + e + "]", f = "[" + e + "]: " + n + i;
268
+ break;
269
+ default:
270
+ var u = this.references.length + 1;
271
+ a = "[" + e + "][" + u + "]", f = "[" + u + "]: " + n + i;
272
+ }
273
+ return this.references.push(f), a;
274
+ },
275
+ references: [],
276
+ append: function(e) {
277
+ var r = "";
278
+ return this.references.length && (r = `
279
+
280
+ ` + this.references.join(`
281
+ `) + `
282
+
283
+ `, this.references = []), r;
284
+ }
285
+ };
286
+ s.emphasis = {
287
+ filter: ["em", "i"],
288
+ replacement: function(e, r, t) {
289
+ return e.trim() ? t.emDelimiter + e + t.emDelimiter : "";
290
+ }
291
+ };
292
+ s.strong = {
293
+ filter: ["strong", "b"],
294
+ replacement: function(e, r, t) {
295
+ return e.trim() ? t.strongDelimiter + e + t.strongDelimiter : "";
296
+ }
297
+ };
298
+ s.code = {
299
+ filter: function(e) {
300
+ var r = e.previousSibling || e.nextSibling, t = e.parentNode.nodeName === "PRE" && !r;
301
+ return e.nodeName === "CODE" && !t;
302
+ },
303
+ replacement: function(e) {
304
+ if (!e) return "";
305
+ e = e.replace(/\r?\n|\r/g, " ");
306
+ for (var r = /^`|^ .*?[^ ].* $|`$/.test(e) ? " " : "", t = "`", n = e.match(/`+/gm) || []; n.indexOf(t) !== -1; ) t = t + "`";
307
+ return t + r + e + r + t;
308
+ }
309
+ };
310
+ s.image = {
311
+ filter: "img",
312
+ replacement: function(e, r) {
313
+ var t = h(r.getAttribute("alt")), n = r.getAttribute("src") || "", i = h(r.getAttribute("title")), a = i ? ' "' + i + '"' : "";
314
+ return n ? "![" + t + "](" + n + a + ")" : "";
315
+ }
316
+ };
317
+ function h(e) {
318
+ return e ? e.replace(/(\n+\s*)+/g, `
319
+ `) : "";
320
+ }
321
+ function D(e) {
322
+ this.options = e, this._keep = [], this._remove = [], this.blankRule = {
323
+ replacement: e.blankReplacement
324
+ }, this.keepReplacement = e.keepReplacement, this.defaultRule = {
325
+ replacement: e.defaultReplacement
326
+ }, this.array = [];
327
+ for (var r in e.rules) this.array.push(e.rules[r]);
328
+ }
329
+ D.prototype = {
330
+ add: function(e, r) {
331
+ this.array.unshift(r);
332
+ },
333
+ keep: function(e) {
334
+ this._keep.unshift({
335
+ filter: e,
336
+ replacement: this.keepReplacement
337
+ });
338
+ },
339
+ remove: function(e) {
340
+ this._remove.unshift({
341
+ filter: e,
342
+ replacement: function() {
343
+ return "";
344
+ }
345
+ });
346
+ },
347
+ forNode: function(e) {
348
+ if (e.isBlank) return this.blankRule;
349
+ var r;
350
+ return (r = p(this.array, e, this.options)) || (r = p(this._keep, e, this.options)) || (r = p(this._remove, e, this.options)) ? r : this.defaultRule;
351
+ },
352
+ forEach: function(e) {
353
+ for (var r = 0; r < this.array.length; r++) e(this.array[r], r);
354
+ }
355
+ };
356
+ function p(e, r, t) {
357
+ for (var n = 0; n < e.length; n++) {
358
+ var i = e[n];
359
+ if ($(i, r, t)) return i;
360
+ }
361
+ }
362
+ function $(e, r, t) {
363
+ var n = e.filter;
364
+ if (typeof n == "string") {
365
+ if (n === r.nodeName.toLowerCase()) return !0;
366
+ } else if (Array.isArray(n)) {
367
+ if (n.indexOf(r.nodeName.toLowerCase()) > -1) return !0;
368
+ } else if (typeof n == "function") {
369
+ if (n.call(e, r, t)) return !0;
370
+ } else
371
+ throw new TypeError("`filter` needs to be a string, array, or function");
372
+ }
373
+ function V(e) {
374
+ var r = e.element, t = e.isBlock, n = e.isVoid, i = e.isPre || function(L) {
375
+ return L.nodeName === "PRE";
376
+ };
377
+ if (!(!r.firstChild || i(r))) {
378
+ for (var a = null, f = !1, u = null, l = E(u, r, i); l !== r; ) {
379
+ if (l.nodeType === 3 || l.nodeType === 4) {
380
+ var o = l.data.replace(/[ \r\n\t]+/g, " ");
381
+ if ((!a || / $/.test(a.data)) && !f && o[0] === " " && (o = o.substr(1)), !o) {
382
+ l = m(l);
383
+ continue;
384
+ }
385
+ l.data = o, a = l;
386
+ } else if (l.nodeType === 1)
387
+ t(l) || l.nodeName === "BR" ? (a && (a.data = a.data.replace(/ $/, "")), a = null, f = !1) : n(l) || i(l) ? (a = null, f = !0) : a && (f = !1);
388
+ else {
389
+ l = m(l);
390
+ continue;
391
+ }
392
+ var c = E(u, l, i);
393
+ u = l, l = c;
394
+ }
395
+ a && (a.data = a.data.replace(/ $/, ""), a.data || m(a));
396
+ }
397
+ }
398
+ function m(e) {
399
+ var r = e.nextSibling || e.parentNode;
400
+ return e.parentNode.removeChild(e), r;
401
+ }
402
+ function E(e, r, t) {
403
+ return e && e.parentNode === r || t(r) ? r.nextSibling || r.parentNode : r.firstChild || r.nextSibling || r.parentNode;
404
+ }
405
+ var y = typeof window < "u" ? window : {};
406
+ function U() {
407
+ var e = y.DOMParser, r = !1;
408
+ try {
409
+ new e().parseFromString("", "text/html") && (r = !0);
410
+ } catch {
411
+ }
412
+ return r;
413
+ }
414
+ function W() {
415
+ var e = function() {
416
+ };
417
+ return _() ? e.prototype.parseFromString = function(r) {
418
+ var t = new window.ActiveXObject("htmlfile");
419
+ return t.designMode = "on", t.open(), t.write(r), t.close(), t;
420
+ } : e.prototype.parseFromString = function(r) {
421
+ var t = document.implementation.createHTMLDocument("");
422
+ return t.open(), t.write(r), t.close(), t;
423
+ }, e;
424
+ }
425
+ function _() {
426
+ var e = !1;
427
+ try {
428
+ document.implementation.createHTMLDocument("").open();
429
+ } catch {
430
+ y.ActiveXObject && (e = !0);
431
+ }
432
+ return e;
433
+ }
434
+ var j = U() ? y.DOMParser : W();
435
+ function G(e, r) {
436
+ var t;
437
+ if (typeof e == "string") {
438
+ var n = X().parseFromString(
439
+ // DOM parsers arrange elements in the <head> and <body>.
440
+ // Wrapping in a custom element ensures elements are reliably arranged in
441
+ // a single element.
442
+ '<x-turndown id="turndown-root">' + e + "</x-turndown>",
443
+ "text/html"
444
+ );
445
+ t = n.getElementById("turndown-root");
446
+ } else
447
+ t = e.cloneNode(!0);
448
+ return V({
449
+ element: t,
450
+ isBlock: A,
451
+ isVoid: S,
452
+ isPre: r.preformattedCode ? K : null
453
+ }), t;
454
+ }
455
+ var d;
456
+ function X() {
457
+ return d = d || new j(), d;
458
+ }
459
+ function K(e) {
460
+ return e.nodeName === "PRE" || e.nodeName === "CODE";
461
+ }
462
+ function Y(e, r) {
463
+ return e.isBlock = A(e), e.isCode = e.nodeName === "CODE" || e.parentNode.isCode, e.isBlank = q(e), e.flankingWhitespace = z(e, r), e;
464
+ }
465
+ function q(e) {
466
+ return !S(e) && !H(e) && /^\s*$/i.test(e.textContent) && !I(e) && !F(e);
467
+ }
468
+ function z(e, r) {
469
+ if (e.isBlock || r.preformattedCode && e.isCode)
470
+ return { leading: "", trailing: "" };
471
+ var t = Q(e.textContent);
472
+ return t.leadingAscii && T("left", e, r) && (t.leading = t.leadingNonAscii), t.trailingAscii && T("right", e, r) && (t.trailing = t.trailingNonAscii), { leading: t.leading, trailing: t.trailing };
473
+ }
474
+ function Q(e) {
475
+ var r = e.match(/^(([ \t\r\n]*)(\s*))(?:(?=\S)[\s\S]*\S)?((\s*?)([ \t\r\n]*))$/);
476
+ return {
477
+ leading: r[1],
478
+ // whole string for whitespace-only strings
479
+ leadingAscii: r[2],
480
+ leadingNonAscii: r[3],
481
+ trailing: r[4],
482
+ // empty for whitespace-only strings
483
+ trailingNonAscii: r[5],
484
+ trailingAscii: r[6]
485
+ };
486
+ }
487
+ function T(e, r, t) {
488
+ var n, i, a;
489
+ return e === "left" ? (n = r.previousSibling, i = / $/) : (n = r.nextSibling, i = /^ /), n && (n.nodeType === 3 ? a = i.test(n.nodeValue) : t.preformattedCode && n.nodeName === "CODE" ? a = !1 : n.nodeType === 1 && !A(n) && (a = i.test(n.textContent))), a;
490
+ }
491
+ var J = Array.prototype.reduce, Z = [
492
+ [/\\/g, "\\\\"],
493
+ [/\*/g, "\\*"],
494
+ [/^-/g, "\\-"],
495
+ [/^\+ /g, "\\+ "],
496
+ [/^(=+)/g, "\\$1"],
497
+ [/^(#{1,6}) /g, "\\$1 "],
498
+ [/`/g, "\\`"],
499
+ [/^~~~/g, "\\~~~"],
500
+ [/\[/g, "\\["],
501
+ [/\]/g, "\\]"],
502
+ [/^>/g, "\\>"],
503
+ [/_/g, "\\_"],
504
+ [/^(\d+)\. /g, "$1\\. "]
505
+ ];
506
+ function v(e) {
507
+ if (!(this instanceof v)) return new v(e);
508
+ var r = {
509
+ rules: s,
510
+ headingStyle: "setext",
511
+ hr: "* * *",
512
+ bulletListMarker: "*",
513
+ codeBlockStyle: "indented",
514
+ fence: "```",
515
+ emDelimiter: "_",
516
+ strongDelimiter: "**",
517
+ linkStyle: "inlined",
518
+ linkReferenceStyle: "full",
519
+ br: " ",
520
+ preformattedCode: !1,
521
+ blankReplacement: function(t, n) {
522
+ return n.isBlock ? `
523
+
524
+ ` : "";
525
+ },
526
+ keepReplacement: function(t, n) {
527
+ return n.isBlock ? `
528
+
529
+ ` + n.outerHTML + `
530
+
531
+ ` : n.outerHTML;
532
+ },
533
+ defaultReplacement: function(t, n) {
534
+ return n.isBlock ? `
535
+
536
+ ` + t + `
537
+
538
+ ` : t;
539
+ }
540
+ };
541
+ this.options = x({}, r, e), this.rules = new D(this.options);
542
+ }
543
+ v.prototype = {
544
+ /**
545
+ * The entry point for converting a string or DOM node to Markdown
546
+ * @public
547
+ * @param {String|HTMLElement} input The string or DOM node to convert
548
+ * @returns A Markdown representation of the input
549
+ * @type String
550
+ */
551
+ turndown: function(e) {
552
+ if (!te(e))
553
+ throw new TypeError(
554
+ e + " is not a string, or an element/document/fragment node."
555
+ );
556
+ if (e === "") return "";
557
+ var r = B.call(this, new G(e, this.options));
558
+ return ee.call(this, r);
559
+ },
560
+ /**
561
+ * Add one or more plugins
562
+ * @public
563
+ * @param {Function|Array} plugin The plugin or array of plugins to add
564
+ * @returns The Turndown instance for chaining
565
+ * @type Object
566
+ */
567
+ use: function(e) {
568
+ if (Array.isArray(e))
569
+ for (var r = 0; r < e.length; r++) this.use(e[r]);
570
+ else if (typeof e == "function")
571
+ e(this);
572
+ else
573
+ throw new TypeError("plugin must be a Function or an Array of Functions");
574
+ return this;
575
+ },
576
+ /**
577
+ * Adds a rule
578
+ * @public
579
+ * @param {String} key The unique key of the rule
580
+ * @param {Object} rule The rule
581
+ * @returns The Turndown instance for chaining
582
+ * @type Object
583
+ */
584
+ addRule: function(e, r) {
585
+ return this.rules.add(e, r), this;
586
+ },
587
+ /**
588
+ * Keep a node (as HTML) that matches the filter
589
+ * @public
590
+ * @param {String|Array|Function} filter The unique key of the rule
591
+ * @returns The Turndown instance for chaining
592
+ * @type Object
593
+ */
594
+ keep: function(e) {
595
+ return this.rules.keep(e), this;
596
+ },
597
+ /**
598
+ * Remove a node that matches the filter
599
+ * @public
600
+ * @param {String|Array|Function} filter The unique key of the rule
601
+ * @returns The Turndown instance for chaining
602
+ * @type Object
603
+ */
604
+ remove: function(e) {
605
+ return this.rules.remove(e), this;
606
+ },
607
+ /**
608
+ * Escapes Markdown syntax
609
+ * @public
610
+ * @param {String} string The string to escape
611
+ * @returns A string with Markdown syntax escaped
612
+ * @type String
613
+ */
614
+ escape: function(e) {
615
+ return Z.reduce(function(r, t) {
616
+ return r.replace(t[0], t[1]);
617
+ }, e);
618
+ }
619
+ };
620
+ function B(e) {
621
+ var r = this;
622
+ return J.call(e.childNodes, function(t, n) {
623
+ n = new Y(n, r.options);
624
+ var i = "";
625
+ return n.nodeType === 3 ? i = n.isCode ? n.nodeValue : r.escape(n.nodeValue) : n.nodeType === 1 && (i = re.call(r, n)), P(t, i);
626
+ }, "");
627
+ }
628
+ function ee(e) {
629
+ var r = this;
630
+ return this.rules.forEach(function(t) {
631
+ typeof t.append == "function" && (e = P(e, t.append(r.options)));
632
+ }), e.replace(/^[\t\r\n]+/, "").replace(/[\t\r\n\s]+$/, "");
633
+ }
634
+ function re(e) {
635
+ var r = this.rules.forNode(e), t = B.call(this, e), n = e.flankingWhitespace;
636
+ return (n.leading || n.trailing) && (t = t.trim()), n.leading + r.replacement(t, e, this.options) + n.trailing;
637
+ }
638
+ function P(e, r) {
639
+ var t = C(e), n = k(r), i = Math.max(e.length - t.length, r.length - n.length), a = `
640
+
641
+ `.substring(0, i);
642
+ return t + a + n;
643
+ }
644
+ function te(e) {
645
+ return e != null && (typeof e == "string" || e.nodeType && (e.nodeType === 1 || e.nodeType === 9 || e.nodeType === 11));
646
+ }
647
+ export {
648
+ v as T
649
+ };
@@ -1,8 +1,9 @@
1
- import { E as i } from "../index-Gm-3o3nq.js";
1
+ import { E as i } from "../index-DoNRu1rY.js";
2
2
  import { initExtensions as n } from "../components/Scribe/extension/index.js";
3
- import { html2md as s } from "./html-to-markdown.js";
4
- import "../browser-DEobZXxB.js";
5
- function c({ content: r = "", editable: e = !1, onContentChange: o }) {
3
+ import { html2md as m } from "./html-to-markdown.js";
4
+ import "../marked.esm-BS_MmRZC.js";
5
+ import "../purify.es-BGaRrCfO.js";
6
+ function d({ content: r = "", editable: e = !1, onContentChange: o }) {
6
7
  return new i({
7
8
  content: r,
8
9
  editable: e,
@@ -11,7 +12,7 @@ function c({ content: r = "", editable: e = !1, onContentChange: o }) {
11
12
  o && o({
12
13
  htmlContent: t.getHTML(),
13
14
  jsonContent: t.getJSON(),
14
- markdownContent: s(t.getHTML())
15
+ markdownContent: m(t.getHTML())
15
16
  });
16
17
  },
17
18
  editorProps: {
@@ -22,5 +23,5 @@ function c({ content: r = "", editable: e = !1, onContentChange: o }) {
22
23
  });
23
24
  }
24
25
  export {
25
- c as createScribeEditor
26
+ d as createScribeEditor
26
27
  };
@@ -1,6 +1,7 @@
1
- import { T as o, p as i } from "../turndown.browser.es-BSoGafvq.js";
2
- const u = (a) => {
3
- const e = new o({
1
+ import { p as c } from "../purify.es-BGaRrCfO.js";
2
+ import { T as i } from "../turndown.browser.es-RmA_HBaI.js";
3
+ const p = (a) => {
4
+ const e = new i({
4
5
  headingStyle: "atx",
5
6
  hr: "---",
6
7
  bulletListMarker: "-",
@@ -26,9 +27,9 @@ $$
26
27
  return "~~" + t + "~~";
27
28
  }
28
29
  });
29
- const c = (t) => t.replace(/<span([^>]+data-type="latex"[^>]*)><\/span>/g, "<span$1>•</span>");
30
- return e.turndown(i.sanitize(c(a)));
30
+ const o = (t) => t.replace(/<span([^>]+data-type="latex"[^>]*)><\/span>/g, "<span$1>•</span>");
31
+ return e.turndown(c.sanitize(o(a)));
31
32
  };
32
33
  export {
33
- u as html2md
34
+ p as html2md
34
35
  };
@@ -1,5 +1,6 @@
1
- import { D as s, m } from "../browser-DEobZXxB.js";
2
- const e = (a) => s.sanitize(m.parse(a, { async: !1 }));
1
+ import { m as r } from "../marked.esm-BS_MmRZC.js";
2
+ import { p as a } from "../purify.es-BGaRrCfO.js";
3
+ const p = (m) => a.sanitize(r.parse(m, { async: !1 }));
3
4
  export {
4
- e as md2html
5
+ p as md2html
5
6
  };