@clevertask/scribe 0.0.0

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