@clevertask/scribe 0.1.18 → 0.1.19

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 (38) hide show
  1. package/README.md +28 -0
  2. package/dist/components/Menu/BubbleMenu.js +1 -1
  3. package/dist/components/Menu/CalloutBubbleMenu.js +64 -64
  4. package/dist/components/Menu/LinkBubbleMenu.js +16 -16
  5. package/dist/components/Menu/TableBubbleMenu.js +1 -1
  6. package/dist/components/Scribe/extension/callout.js +1 -4
  7. package/dist/components/Scribe/extension/extension-markdown-paste.js +1 -1
  8. package/dist/components/Scribe/extension/external-link-preview/commands.js +37 -37
  9. package/dist/components/Scribe/extension/external-link-preview/index.d.ts +1 -2
  10. package/dist/components/Scribe/extension/external-link-preview/index.d.ts.map +1 -1
  11. package/dist/components/Scribe/extension/external-link-preview/index.js +20 -113
  12. package/dist/components/Scribe/extension/external-link-preview/node-view.js +6 -6
  13. package/dist/components/Scribe/extension/external-link-preview/paste.js +5 -5
  14. package/dist/components/Scribe/extension/external-link-preview/schema.d.ts +8 -0
  15. package/dist/components/Scribe/extension/external-link-preview/schema.d.ts.map +1 -0
  16. package/dist/components/Scribe/extension/external-link-preview/schema.js +100 -0
  17. package/dist/components/Scribe/extension/index.d.ts +2 -2
  18. package/dist/components/Scribe/extension/index.d.ts.map +1 -1
  19. package/dist/components/Scribe/extension/index.js +1 -1
  20. package/dist/components/Scribe/extension/slashCommand/index.js +32 -2
  21. package/dist/components/Scribe/index.js +2 -2
  22. package/dist/{slashCommand-D35jcSNp.js → dist-CzXFZHMF.js} +55 -80
  23. package/dist/extension-CKcvyrIW.js +57 -0
  24. package/dist/{html-to-markdown-CnlA8pb8.js → html-to-markdown-pY8ngCXa.js} +14 -14
  25. package/dist/main.js +6 -6
  26. package/dist/{markdown-to-html-BLzYd3Fu.js → markdown-to-html-COv0iaxr.js} +5 -5
  27. package/dist/{menus-Dy2dj4QT.js → menus-D1cst_3I.js} +104 -104
  28. package/dist/{extension-DOo9QT6U.js → schema-extensions-ChhE6XCo.js} +51918 -51953
  29. package/dist/schema-extensions.d.ts +20 -0
  30. package/dist/schema-extensions.d.ts.map +1 -0
  31. package/dist/schema-extensions.js +2 -0
  32. package/dist/schema.d.ts +17 -0
  33. package/dist/schema.d.ts.map +1 -0
  34. package/dist/schema.js +5 -0
  35. package/dist/utils/html-to-markdown.js +1 -1
  36. package/dist/utils/index.js +3 -3
  37. package/dist/utils/markdown-to-html.js +1 -1
  38. package/package.json +8 -2
@@ -1,9 +1,9 @@
1
- import { f as e, n as t } from "./dist-CkWsQ5Lj.js";
2
- import { a as n, c as r, i, r as a } from "./floating-ui.dom-CmJ6iBdh.js";
3
- import { Plugin as o, PluginKey as s } from "@tiptap/pm/state";
4
- import { Decoration as c, DecorationSet as l } from "@tiptap/pm/view";
1
+ import { f as e } from "./dist-CkWsQ5Lj.js";
2
+ import { a as t, c as n, i as r, r as i } from "./floating-ui.dom-CmJ6iBdh.js";
3
+ import { Plugin as a, PluginKey as o } from "@tiptap/pm/state";
4
+ import { Decoration as s, DecorationSet as c } from "@tiptap/pm/view";
5
5
  //#region node_modules/.pnpm/@tiptap+suggestion@3.30.2_@floating-ui+dom@1.8.0_@tiptap+core@3.30.2_@tiptap+pm@3.30.2__@tiptap+pm@3.30.2/node_modules/@tiptap/suggestion/dist/index.js
6
- function u(t) {
6
+ function l(t) {
7
7
  let { char: n, allowSpaces: r, allowToIncludeChar: i, allowedPrefixes: a, startOfLine: o, $position: s } = t, c = r && !i, l = e(n), u = RegExp(`\\s${l}$`), d = o ? "^" : "", f = i ? "" : l, p = RegExp(c ? `${d}${l}.*?(?=\\s${f}|$)` : `${d}(?:^)?${l}[^\\s${f}]*`, "gm"), m = s.nodeBefore?.isText && s.nodeBefore.text;
8
8
  if (!m) return null;
9
9
  let h = s.pos - m.length, g = Array.from(m.matchAll(p)).pop();
@@ -20,7 +20,7 @@ function u(t) {
20
20
  text: g[0]
21
21
  } : null;
22
22
  }
23
- function d(e) {
23
+ function u(e) {
24
24
  return e.docChanged ? e.steps.some((e) => {
25
25
  let t = e.slice;
26
26
  if (!t?.content) return !1;
@@ -28,7 +28,7 @@ function d(e) {
28
28
  return /\s/.test(n);
29
29
  }) : !1;
30
30
  }
31
- function f(e) {
31
+ function d(e) {
32
32
  return () => {
33
33
  let t = e.state.selection.$anchor.pos, { top: n, right: r, bottom: i, left: a } = e.view.coordsAtPos(t);
34
34
  try {
@@ -38,13 +38,13 @@ function f(e) {
38
38
  }
39
39
  };
40
40
  }
41
- function p(e, t, n, r) {
41
+ function f(e, t, n, r) {
42
42
  return n ? () => {
43
43
  let n = r.getState(e.state)?.decorationId;
44
44
  return t.dom.querySelector(`[data-decoration-id="${n}"]`)?.getBoundingClientRect() || null;
45
- } : f(e);
45
+ } : d(e);
46
46
  }
47
- function m({ match: e, dismissedRange: t, state: n, transaction: r, editor: i, shouldResetDismissed: a, effectiveAllowSpaces: o }) {
47
+ function p({ match: e, dismissedRange: t, state: n, transaction: r, editor: i, shouldResetDismissed: a, effectiveAllowSpaces: o }) {
48
48
  return a?.({
49
49
  editor: i,
50
50
  state: n,
@@ -52,13 +52,13 @@ function m({ match: e, dismissedRange: t, state: n, transaction: r, editor: i, s
52
52
  match: e,
53
53
  transaction: r,
54
54
  allowSpaces: o
55
- }) ? !1 : o ? e.range.from === t.from : e.range.from === t.from && !d(r);
55
+ }) ? !1 : o ? e.range.from === t.from : e.range.from === t.from && !u(r);
56
56
  }
57
- function h({ view: e, pluginKeyRef: t }) {
57
+ function m({ view: e, pluginKeyRef: t }) {
58
58
  let n = e.state.tr.setMeta(t, { exit: !0 });
59
59
  e.dispatch(n);
60
60
  }
61
- function g({ pluginKey: e, decorationTag: t, decorationClass: n, decorationContent: r, decorationEmptyClass: i, renderer: a, dispatchExit: o }) {
61
+ function h({ pluginKey: e, decorationTag: t, decorationClass: n, decorationContent: r, decorationEmptyClass: i, renderer: a, dispatchExit: o }) {
62
62
  return {
63
63
  handleKeyDown(t, n) {
64
64
  var r;
@@ -74,10 +74,10 @@ function g({ pluginKey: e, decorationTag: t, decorationClass: n, decorationConte
74
74
  }) || !1 : !1;
75
75
  },
76
76
  decorations(a) {
77
- let { active: o, range: s, decorationId: u, query: d } = e.getState(a);
77
+ let { active: o, range: l, decorationId: u, query: d } = e.getState(a);
78
78
  if (!o) return null;
79
79
  let f = !d?.length, p = [n];
80
- return f && p.push(i), l.create(a.doc, [c.inline(s.from, s.to, {
80
+ return f && p.push(i), c.create(a.doc, [s.inline(l.from, l.to, {
81
81
  nodeName: t,
82
82
  class: p.join(" "),
83
83
  "data-decoration-id": u || void 0,
@@ -86,7 +86,7 @@ function g({ pluginKey: e, decorationTag: t, decorationClass: n, decorationConte
86
86
  }
87
87
  };
88
88
  }
89
- function _({ editor: e, char: t, effectiveAllowSpaces: n, allowToIncludeChar: r, allowedPrefixes: i, startOfLine: a, findSuggestionMatch: o, allow: s, shouldShow: c, shouldKeepDismissed: l, pluginKey: u }) {
89
+ function g({ editor: e, char: t, effectiveAllowSpaces: n, allowToIncludeChar: r, allowedPrefixes: i, startOfLine: a, findSuggestionMatch: o, allow: s, shouldShow: c, shouldKeepDismissed: l, pluginKey: u }) {
90
90
  return {
91
91
  init() {
92
92
  return {
@@ -145,7 +145,7 @@ function _({ editor: e, char: t, effectiveAllowSpaces: n, allowToIncludeChar: r,
145
145
  }
146
146
  };
147
147
  }
148
- function v({ editor: e, items: t }) {
148
+ function _({ editor: e, items: t }) {
149
149
  let n = null, r = null, i = null, a = () => {
150
150
  r !== null && (clearTimeout(r), r = null), i?.(), i = null;
151
151
  }, o = (e) => new Promise((t) => {
@@ -179,18 +179,18 @@ function v({ editor: e, items: t }) {
179
179
  }
180
180
  };
181
181
  }
182
- function y({ placement: e, offset: t, flip: i, floatingUi: a }) {
183
- let o = [r({
184
- mainAxis: t.mainAxis ?? 4,
185
- crossAxis: t.crossAxis ?? 0
182
+ function v({ placement: e, offset: r, flip: i, floatingUi: a }) {
183
+ let o = [n({
184
+ mainAxis: r.mainAxis ?? 4,
185
+ crossAxis: r.crossAxis ?? 0
186
186
  })];
187
- return i && o.push(n()), a?.middleware?.length && o.push(...a.middleware), {
187
+ return i && o.push(t()), a?.middleware?.length && o.push(...a.middleware), {
188
188
  placement: e,
189
189
  strategy: a?.strategy ?? "absolute",
190
190
  middleware: o
191
191
  };
192
192
  }
193
- function b(e) {
193
+ function y(e) {
194
194
  if (e instanceof HTMLElement) return e;
195
195
  if (typeof e == "string") try {
196
196
  let t = document.querySelector(e);
@@ -200,15 +200,15 @@ function b(e) {
200
200
  }
201
201
  return document.body;
202
202
  }
203
- function x({ getReferenceRect: e, contextElement: t, config: n, container: r, dismissOnOutsideClick: o, dismiss: s }) {
203
+ function b({ getReferenceRect: e, contextElement: t, config: n, container: a, dismissOnOutsideClick: o, dismiss: s }) {
204
204
  return (c, l = {}) => {
205
205
  let u = {
206
206
  getBoundingClientRect: () => e() ?? new DOMRect(),
207
207
  contextElement: t
208
208
  }, d = !1, f = !c.isConnected;
209
- f && b(r).appendChild(c), l.onPosition || (c.style.visibility = "hidden", c.style.width = "max-content");
210
- let p = a(u, c, () => {
211
- i(u, c, {
209
+ f && y(a).appendChild(c), l.onPosition || (c.style.visibility = "hidden", c.style.width = "max-content");
210
+ let p = i(u, c, () => {
211
+ r(u, c, {
212
212
  placement: n.placement,
213
213
  strategy: n.strategy,
214
214
  middleware: n.middleware
@@ -237,11 +237,11 @@ function x({ getReferenceRect: e, contextElement: t, config: n, container: r, di
237
237
  };
238
238
  };
239
239
  }
240
- function S({ editor: e, pluginKey: t, items: n, renderer: r, minQueryLength: i, debounce: a, initialItems: o, placement: s, offset: c, container: l, flip: u, floatingUi: d, dismissOnOutsideClick: f, command: p, clientRectFor: m, dispatchExit: h }) {
241
- let g, _ = v({
240
+ function x({ editor: e, pluginKey: t, items: n, renderer: r, minQueryLength: i, debounce: a, initialItems: o, placement: s, offset: c, container: l, flip: u, floatingUi: d, dismissOnOutsideClick: f, command: p, clientRectFor: m, dispatchExit: h }) {
241
+ let g, y = _({
242
242
  editor: e,
243
243
  items: n
244
- }), b = y({
244
+ }), x = v({
245
245
  placement: s,
246
246
  offset: c,
247
247
  flip: u,
@@ -261,7 +261,7 @@ function S({ editor: e, pluginKey: t, items: n, renderer: r, minQueryLength: i,
261
261
  }
262
262
  return {
263
263
  update: async (n, d) => {
264
- var v, y;
264
+ var _, v;
265
265
  let C = t.getState(d), w = t.getState(n.state);
266
266
  if (!C || !w) return;
267
267
  let T = null, E = C.query !== w.query, D = C.text !== w.text, O = C.range.from !== w.range.from || C.range.to !== w.range.to, k = E || D || O;
@@ -291,17 +291,17 @@ function S({ editor: e, pluginKey: t, items: n, renderer: r, minQueryLength: i,
291
291
  },
292
292
  container: l,
293
293
  flip: u,
294
- floatingUi: b,
295
- mount: x({
294
+ floatingUi: x,
295
+ mount: b({
296
296
  getReferenceRect: M,
297
297
  contextElement: n.dom,
298
- config: b,
298
+ config: x,
299
299
  container: l,
300
300
  dismissOnOutsideClick: f,
301
301
  dismiss: () => h(e.view)
302
302
  })
303
- }, T === "started" && ((v = r?.onBeforeStart) == null || v.call(r, g)), T === "updated" && ((y = r?.onBeforeUpdate) == null || y.call(r, g)), T === "started" && S(T, g), T === "started" || T === "updated") {
304
- if (!P) _.abort(), g = {
303
+ }, T === "started" && ((_ = r?.onBeforeStart) == null || _.call(r, g)), T === "updated" && ((v = r?.onBeforeUpdate) == null || v.call(r, g)), T === "started" && S(T, g), T === "started" || T === "updated") {
304
+ if (!P) y.abort(), g = {
305
305
  ...g,
306
306
  items: o ?? [],
307
307
  loading: !1
@@ -312,10 +312,10 @@ function S({ editor: e, pluginKey: t, items: n, renderer: r, minQueryLength: i,
312
312
  items: o ?? [],
313
313
  loading: !0
314
314
  }, T = "updated", S(T, g);
315
- let e = await _.fetch(A.query || "", a);
315
+ let e = await y.fetch(A.query || "", a);
316
316
  if (e.status === "aborted") return;
317
317
  if (!t.getState(n.state)?.active) {
318
- _.abort();
318
+ y.abort();
319
319
  return;
320
320
  }
321
321
  g = e.status === "resolved" ? {
@@ -329,41 +329,41 @@ function S({ editor: e, pluginKey: t, items: n, renderer: r, minQueryLength: i,
329
329
  }
330
330
  }
331
331
  if (T === "stopped") {
332
- _.abort(), S(T, g), g = void 0;
332
+ y.abort(), S(T, g), g = void 0;
333
333
  return;
334
334
  }
335
335
  T === "updated" && S(T, g);
336
336
  },
337
337
  destroy: () => {
338
338
  var e;
339
- _.abort(), g && ((e = r?.onExit) == null || e.call(r, g));
339
+ y.abort(), g && ((e = r?.onExit) == null || e.call(r, g));
340
340
  }
341
341
  };
342
342
  }
343
- var C = new s("suggestion");
344
- function w({ pluginKey: e = C, editor: t, char: n = "@", allowSpaces: r = !1, allowToIncludeChar: i = !1, allowedPrefixes: a = [" "], startOfLine: s = !1, decorationTag: c = "span", decorationClass: l = "suggestion", decorationContent: d = "", decorationEmptyClass: f = "is-empty", command: v = () => null, items: y = () => [], minQueryLength: b = 0, debounce: x = 0, initialItems: w, placement: T = "bottom-start", offset: E = {}, container: D, flip: O = !0, floatingUi: k, dismissOnOutsideClick: A = !0, render: j = () => ({}), allow: M = () => !0, findSuggestionMatch: N = u, shouldShow: P, shouldResetDismissed: F }) {
345
- let I = j?.(), L = r && !i, R = (n, r) => p(t, n, r, e);
343
+ var S = new o("suggestion");
344
+ function C({ pluginKey: e = S, editor: t, char: n = "@", allowSpaces: r = !1, allowToIncludeChar: i = !1, allowedPrefixes: o = [" "], startOfLine: s = !1, decorationTag: c = "span", decorationClass: u = "suggestion", decorationContent: d = "", decorationEmptyClass: _ = "is-empty", command: v = () => null, items: y = () => [], minQueryLength: b = 0, debounce: C = 0, initialItems: w, placement: T = "bottom-start", offset: E = {}, container: D, flip: O = !0, floatingUi: k, dismissOnOutsideClick: A = !0, render: j = () => ({}), allow: M = () => !0, findSuggestionMatch: N = l, shouldShow: P, shouldResetDismissed: F }) {
345
+ let I = j?.(), L = r && !i, R = (n, r) => f(t, n, r, e);
346
346
  function z(e) {
347
- return m({
347
+ return p({
348
348
  ...e,
349
349
  editor: t,
350
350
  shouldResetDismissed: F,
351
351
  effectiveAllowSpaces: L
352
352
  });
353
353
  }
354
- let B = (t) => h({
354
+ let B = (t) => m({
355
355
  view: t,
356
356
  pluginKeyRef: e
357
357
  });
358
- return new o({
358
+ return new a({
359
359
  key: e,
360
- view: () => S({
360
+ view: () => x({
361
361
  editor: t,
362
362
  pluginKey: e,
363
363
  items: y,
364
364
  renderer: I,
365
365
  minQueryLength: b,
366
- debounce: x,
366
+ debounce: C,
367
367
  initialItems: w,
368
368
  placement: T,
369
369
  offset: E,
@@ -375,12 +375,12 @@ function w({ pluginKey: e = C, editor: t, char: n = "@", allowSpaces: r = !1, al
375
375
  clientRectFor: R,
376
376
  dispatchExit: B
377
377
  }),
378
- state: _({
378
+ state: g({
379
379
  editor: t,
380
380
  char: n,
381
381
  effectiveAllowSpaces: L,
382
382
  allowToIncludeChar: i,
383
- allowedPrefixes: a,
383
+ allowedPrefixes: o,
384
384
  startOfLine: s,
385
385
  findSuggestionMatch: N,
386
386
  allow: M,
@@ -388,42 +388,17 @@ function w({ pluginKey: e = C, editor: t, char: n = "@", allowSpaces: r = !1, al
388
388
  shouldKeepDismissed: z,
389
389
  pluginKey: e
390
390
  }),
391
- props: g({
391
+ props: h({
392
392
  pluginKey: e,
393
393
  decorationTag: c,
394
- decorationClass: l,
394
+ decorationClass: u,
395
395
  decorationContent: d,
396
- decorationEmptyClass: f,
396
+ decorationEmptyClass: _,
397
397
  renderer: I,
398
398
  dispatchExit: B
399
399
  })
400
400
  });
401
401
  }
402
- var T = w, E = new s("slashSuggestion"), D = t.create({
403
- name: "slashCommand",
404
- addOptions() {
405
- return {
406
- ...this.parent?.(),
407
- slashSuggestion: {
408
- char: "/",
409
- startOfLine: !0,
410
- command: ({ editor: e, range: t, props: n }) => {
411
- n.command({
412
- editor: e,
413
- range: t,
414
- props: n
415
- });
416
- }
417
- }
418
- };
419
- },
420
- addProseMirrorPlugins() {
421
- return [T({
422
- pluginKey: E,
423
- ...this.options.slashSuggestion,
424
- editor: this.editor
425
- })];
426
- }
427
- });
402
+ var w = C;
428
403
  //#endregion
429
- export { E as n, w as r, D as t };
404
+ export { w as n, C as t };
@@ -0,0 +1,57 @@
1
+ import { n as e, r as t, t as n } from "./schema-extensions-ChhE6XCo.js";
2
+ import r from "./components/Scribe/extension/extension-markdown-paste.js";
3
+ import { SlashCommand as i } from "./components/Scribe/extension/slashCommand/index.js";
4
+ import a from "./components/Scribe/extension/extension-selectedText.js";
5
+ import o from "./components/Scribe/extension/slashCommand/renderItems.js";
6
+ import { getSlashCommandContext as s, getSuggestionItems as c } from "./components/Scribe/extension/slashCommand/items.js";
7
+ import l from "./components/Scribe/extension/emoji/suggest.js";
8
+ import { ScribeTableOfContents as u } from "./components/Scribe/extension/tableOfContents.js";
9
+ import { ExternalLinkPreview as d } from "./components/Scribe/extension/external-link-preview/index.js";
10
+ //#region node_modules/.pnpm/@tiptap+extension-focus@3.30.2_@tiptap+extensions@3.30.2_@tiptap+core@3.30.2_@tiptap+pm@3.30.2__@tiptap+pm@3.30.2_/node_modules/@tiptap/extension-focus/dist/index.js
11
+ var f = e, p = t, m = (e) => {
12
+ let { items: t, render: m, ...h } = e.slashCommand ?? {}, g = n({ enableUndoRedo: e.enableUndoRedo });
13
+ return [
14
+ g.starterKit,
15
+ d.configure(e.externalLinkPreview),
16
+ g.callout,
17
+ g.taskList,
18
+ g.taskItem,
19
+ g.tableKit,
20
+ g.table,
21
+ p.configure({
22
+ showOnlyWhenEditable: !0,
23
+ includeChildren: !0,
24
+ showOnlyCurrent: !1,
25
+ emptyEditorClass: "is-editor-empty",
26
+ emptyNodeClass: "is-node-empty",
27
+ placeholder: ({ editor: t, node: n }) => t.isDestroyed ? "" : n.type.name === "heading" ? `Heading ${n.attrs.level}` : e.placeholderText || "Type \"/\" for commands..."
28
+ }),
29
+ f.configure({
30
+ mode: "deepest",
31
+ className: "has-focus"
32
+ }),
33
+ r,
34
+ i.configure({ slashSuggestion: {
35
+ ...h,
36
+ items: (e) => {
37
+ let n = c(e);
38
+ return t ? t({
39
+ ...e,
40
+ context: s(e.editor),
41
+ defaultItems: n
42
+ }) : n;
43
+ },
44
+ render: m ?? o
45
+ } }),
46
+ g.highlight,
47
+ a,
48
+ g.link,
49
+ g.image,
50
+ g.emoji.configure({ suggestion: l() }),
51
+ g.mathematics,
52
+ g.typography,
53
+ ...e.enableTableOfContents ? [u.configure({ onUpdate: e.onTableOfContentsChange })] : []
54
+ ];
55
+ };
56
+ //#endregion
57
+ export { m as t };
@@ -1,5 +1,5 @@
1
- import { t as e } from "./purify.es-DGv0-Lid.js";
2
- import { normalizeExternalLinkPreviewElement as t, normalizeExternalLinkPreviewsInTree as n } from "./components/Scribe/extension/external-link-preview/serialization.js";
1
+ import { normalizeExternalLinkPreviewElement as e, normalizeExternalLinkPreviewsInTree as t } from "./components/Scribe/extension/external-link-preview/serialization.js";
2
+ import { t as n } from "./purify.es-DGv0-Lid.js";
3
3
  //#region node_modules/.pnpm/turndown@7.2.4/node_modules/turndown/lib/turndown.browser.es.js
4
4
  function r(e) {
5
5
  for (var t = 1; t < arguments.length; t++) {
@@ -525,10 +525,10 @@ var G = "scribe-table-break", K = /* @__PURE__ */ new Set([
525
525
  let i = e.turndown(r.innerHTML).split(G).join("<br>").split("|").join("\\|").trim();
526
526
  return /[\r\n]/.test(i) ? null : i;
527
527
  }, Q = (e) => {
528
- let t = e.cloneNode(!0);
529
- return t.querySelectorAll("span[data-type=\"latex\"]").forEach((e) => {
528
+ let n = e.cloneNode(!0);
529
+ return n.querySelectorAll("span[data-type=\"latex\"]").forEach((e) => {
530
530
  e.textContent === "•" && (e.textContent = "");
531
- }), $(t), n(t), t.outerHTML;
531
+ }), $(n), t(n), n.outerHTML;
532
532
  }, fe = (e) => {
533
533
  let t = e?.trim().toLowerCase();
534
534
  return t && K.has(t) ? t : "info";
@@ -551,13 +551,13 @@ var G = "scribe-table-break", K = /* @__PURE__ */ new Set([
551
551
  }), pe(e);
552
552
  });
553
553
  }, he = (e) => {
554
- let t = e.cloneNode(!0);
555
- return t.querySelectorAll("span[data-type=\"latex\"]").forEach((e) => {
556
- e.textContent === "•" && (e.textContent = "");
557
- }), $(t), n(t), t.outerHTML;
558
- }, ge = (e) => {
559
554
  let n = e.cloneNode(!0);
560
- return t(n) ? n.outerHTML : n.textContent ?? "";
555
+ return n.querySelectorAll("span[data-type=\"latex\"]").forEach((e) => {
556
+ e.textContent === "•" && (e.textContent = "");
557
+ }), $(n), t(n), n.outerHTML;
558
+ }, ge = (t) => {
559
+ let n = t.cloneNode(!0);
560
+ return e(n) ? n.outerHTML : n.textContent ?? "";
561
561
  }, _e = (e) => {
562
562
  e.addRule("scribeExternalLinkPreview", {
563
563
  filter: (e) => e.nodeName === "SPAN" && e.getAttribute("data-type") === "external-link-preview",
@@ -580,7 +580,7 @@ var G = "scribe-table-break", K = /* @__PURE__ */ new Set([
580
580
  return c.splice(1, 0, l), `\n\n${c.join("\n")}\n\n`;
581
581
  }
582
582
  });
583
- }, be = (t) => {
583
+ }, be = (e) => {
584
584
  let r = new z({
585
585
  headingStyle: "atx",
586
586
  hr: "---",
@@ -601,8 +601,8 @@ var G = "scribe-table-break", K = /* @__PURE__ */ new Set([
601
601
  return "~~" + e + "~~";
602
602
  }
603
603
  }), ve(r), ye(r), _e(r);
604
- let i = e.sanitize(((e) => e.replace(/<span([^>]+data-type="latex"[^>]*)><\/span>/g, "<span$1>•</span>"))(t), { ADD_ATTR: ["colwidth"] }), a = document.createElement("div");
605
- return a.innerHTML = i, n(a), r.turndown(a.innerHTML);
604
+ let i = n.sanitize(((e) => e.replace(/<span([^>]+data-type="latex"[^>]*)><\/span>/g, "<span$1>•</span>"))(e), { ADD_ATTR: ["colwidth"] }), a = document.createElement("div");
605
+ return a.innerHTML = i, t(a), r.turndown(a.innerHTML);
606
606
  };
607
607
  //#endregion
608
608
  export { be as t };
package/dist/main.js CHANGED
@@ -1,12 +1,12 @@
1
- import { EXTERNAL_LINK_PREVIEW_DISPLAYS as e } from "./components/Scribe/extension/external-link-preview/types.js";
2
- import { EXTERNAL_LINK_PREVIEW_NODE_NAME as t } from "./components/Scribe/extension/external-link-preview/attributes.js";
3
- import { CALLOUT_VARIANTS as n, CALLOUT_VARIANT_LABELS as r, Callout as i, DEFAULT_CALLOUT_VARIANT as a, isCalloutVariant as o } from "./components/Scribe/extension/callout.js";
4
- import { t as s } from "./html-to-markdown-CnlA8pb8.js";
5
- import { t as c } from "./markdown-to-html-BLzYd3Fu.js";
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 { EXTERNAL_LINK_PREVIEW_DISPLAYS as a } from "./components/Scribe/extension/external-link-preview/types.js";
3
+ import { EXTERNAL_LINK_PREVIEW_NODE_NAME as o } from "./components/Scribe/extension/external-link-preview/attributes.js";
4
+ import { t as s } from "./html-to-markdown-pY8ngCXa.js";
5
+ import { t as c } from "./markdown-to-html-COv0iaxr.js";
6
6
  import { isInViewport as l } from "./utils/is-in-viewport.js";
7
7
  import { convertLegacyMathDelimiters as u } from "./utils/convert-legacy-math-delimiters.js";
8
8
  import { SuggestionItemType as d } from "./components/Scribe/extension/slashCommand/items.js";
9
9
  import { ExternalLinkPreview as f } from "./components/Scribe/extension/external-link-preview/index.js";
10
10
  import { createScribeEditor as p } from "./utils/index.js";
11
11
  import { Scribe as m } from "./components/Scribe/index.js";
12
- export { n as CALLOUT_VARIANTS, r as CALLOUT_VARIANT_LABELS, i as Callout, a as DEFAULT_CALLOUT_VARIANT, e as EXTERNAL_LINK_PREVIEW_DISPLAYS, t as EXTERNAL_LINK_PREVIEW_NODE_NAME, f as ExternalLinkPreview, m as Scribe, d as SuggestionItemType, u as convertLegacyMathDelimiters, p as createScribeEditor, s as html2md, o as isCalloutVariant, l as isInViewport, c as md2html };
12
+ export { e as CALLOUT_VARIANTS, t as CALLOUT_VARIANT_LABELS, n as Callout, r as DEFAULT_CALLOUT_VARIANT, a as EXTERNAL_LINK_PREVIEW_DISPLAYS, o as EXTERNAL_LINK_PREVIEW_NODE_NAME, f as ExternalLinkPreview, m as Scribe, d as SuggestionItemType, u as convertLegacyMathDelimiters, p as createScribeEditor, s as html2md, i as isCalloutVariant, l as isInViewport, c as md2html };
@@ -1,5 +1,5 @@
1
- import { t as e } from "./purify.es-DGv0-Lid.js";
2
- import { normalizeExternalLinkPreviewsInTree as t } from "./components/Scribe/extension/external-link-preview/serialization.js";
1
+ import { normalizeExternalLinkPreviewsInTree as e } from "./components/Scribe/extension/external-link-preview/serialization.js";
2
+ import { t } from "./purify.es-DGv0-Lid.js";
3
3
  //#region node_modules/.pnpm/marked@18.0.10/node_modules/marked/lib/marked.esm.js
4
4
  function n() {
5
5
  return {
@@ -1498,9 +1498,9 @@ var Ve = /* @__PURE__ */ new Set([
1498
1498
  });
1499
1499
  });
1500
1500
  }), t.innerHTML;
1501
- }, Ke = (e) => {
1501
+ }, Ke = (t) => {
1502
1502
  let n = document.createElement("div");
1503
- return n.innerHTML = e, t(n), n.innerHTML;
1504
- }, qe = (t) => Ke(Ge(e.sanitize($.parse(t, { async: !1 }), { ADD_ATTR: ["colwidth"] })));
1503
+ return n.innerHTML = t, e(n), n.innerHTML;
1504
+ }, qe = (e) => Ke(Ge(t.sanitize($.parse(e, { async: !1 }), { ADD_ATTR: ["colwidth"] })));
1505
1505
  //#endregion
1506
1506
  export { $ as n, qe as t };