@clevertask/scribe 0.1.9 → 0.1.10

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 (27) hide show
  1. package/README.md +10 -9
  2. package/dist/{BarMenu-BG_w4DVo.js → BarMenu-5S2vKAtc.js} +1 -1
  3. package/dist/components/Menu/BarMenu.js +1 -1
  4. package/dist/components/Menu/BubbleMenu.js +2 -2
  5. package/dist/components/Menu/LinkBubbleMenu.js +2 -2
  6. package/dist/components/Menu/Mobile/ListOptionBar.js +1 -1
  7. package/dist/components/Menu/linkBubbleMenuPlugin.js +1 -1
  8. package/dist/components/Scribe/extension/emoji/suggest.js +1 -1
  9. package/dist/components/Scribe/extension/extension-link.js +1 -1
  10. package/dist/components/Scribe/extension/extension-markdown-paste.js +11 -11
  11. package/dist/components/Scribe/extension/extension-selectedText.js +1 -1
  12. package/dist/components/Scribe/extension/index.js +1 -1
  13. package/dist/components/Scribe/extension/slashCommand/index.js +1 -1
  14. package/dist/components/Scribe/extension/slashCommand/renderItems.js +1 -1
  15. package/dist/components/Scribe/extension/tableOfContents.js +4 -4
  16. package/dist/components/Scribe/index.js +3 -3
  17. package/dist/dist-DErUltkU.js +3245 -0
  18. package/dist/{dist-BgEySLwo.js → dist-wYqYXEOz.js} +1 -1
  19. package/dist/{extension-BVGWENts.js → extension-6I5t1ZxQ.js} +1744 -2294
  20. package/dist/{extension-link-CMRfHUc5.js → extension-link-DJy7XDoj.js} +62 -62
  21. package/dist/{menus-D9OsP28c.js → menus-m_EkiaUN.js} +66 -66
  22. package/dist/{slashCommand-B6Iz1i0d.js → slashCommand-DuSH9sXJ.js} +46 -45
  23. package/dist/utils/index.js +2 -2
  24. package/package.json +3 -2
  25. package/dist/dist-BMKyBtRa.js +0 -7023
  26. package/dist/dist-FrapLVQu.js +0 -3513
  27. package/dist/tables-CXpUVKdw.js +0 -1347
@@ -1,9 +1,10 @@
1
- import { a as e, i as t } from "./dist-FrapLVQu.js";
2
- import { H as n, U as r, d as i, n as a } from "./dist-BMKyBtRa.js";
3
- import { a as o, c as s, i as c, r as l } from "./floating-ui.dom-CmJ6iBdh.js";
1
+ import { d as e, n as t } from "./dist-DErUltkU.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";
4
5
  //#region node_modules/.pnpm/@tiptap+suggestion@3.29.2_@floating-ui+dom@1.8.0_@tiptap+core@3.29.2_@tiptap+pm@3.29.2__@tiptap+pm@3.29.2/node_modules/@tiptap/suggestion/dist/index.js
5
- function u(e) {
6
- let { char: t, allowSpaces: n, allowToIncludeChar: r, allowedPrefixes: a, startOfLine: o, $position: s } = e, c = n && !r, l = i(t), u = RegExp(`\\s${l}$`), d = o ? "^" : "", f = r ? "" : l, p = RegExp(c ? `${d}${l}.*?(?=\\s${f}|$)` : `${d}(?:^)?${l}[^\\s${f}]*`, "gm"), m = s.nodeBefore?.isText && s.nodeBefore.text;
6
+ function u(t) {
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;
7
8
  if (!m) return null;
8
9
  let h = s.pos - m.length, g = Array.from(m.matchAll(p)).pop();
9
10
  if (!g || g.input === void 0 || g.index === void 0) return null;
@@ -15,7 +16,7 @@ function u(e) {
15
16
  from: y,
16
17
  to: b
17
18
  },
18
- query: g[0].slice(t.length),
19
+ query: g[0].slice(n.length),
19
20
  text: g[0]
20
21
  } : null;
21
22
  }
@@ -57,30 +58,30 @@ function h({ view: e, pluginKeyRef: t }) {
57
58
  let n = e.state.tr.setMeta(t, { exit: !0 });
58
59
  e.dispatch(n);
59
60
  }
60
- function g({ pluginKey: e, decorationTag: t, decorationClass: i, decorationContent: a, decorationEmptyClass: o, renderer: s, dispatchExit: c }) {
61
+ function g({ pluginKey: e, decorationTag: t, decorationClass: n, decorationContent: r, decorationEmptyClass: i, renderer: a, dispatchExit: o }) {
61
62
  return {
62
63
  handleKeyDown(t, n) {
63
64
  var r;
64
65
  let i = e.getState(t.state);
65
- return i.active ? n.key === "Escape" || n.key === "Esc" ? ((r = s?.onKeyDown) == null || r.call(s, {
66
+ return i.active ? n.key === "Escape" || n.key === "Esc" ? ((r = a?.onKeyDown) == null || r.call(a, {
66
67
  view: t,
67
68
  event: n,
68
69
  range: i.range
69
- }), c(t), !0) : (s?.onKeyDown)?.call(s, {
70
+ }), o(t), !0) : (a?.onKeyDown)?.call(a, {
70
71
  view: t,
71
72
  event: n,
72
73
  range: i.range
73
74
  }) || !1 : !1;
74
75
  },
75
- decorations(s) {
76
- let { active: c, range: l, decorationId: u, query: d } = e.getState(s);
77
- if (!c) return null;
78
- let f = !d?.length, p = [i];
79
- return f && p.push(o), r.create(s.doc, [n.inline(l.from, l.to, {
76
+ decorations(a) {
77
+ let { active: o, range: s, decorationId: u, query: d } = e.getState(a);
78
+ if (!o) return null;
79
+ let f = !d?.length, p = [n];
80
+ return f && p.push(i), l.create(a.doc, [c.inline(s.from, s.to, {
80
81
  nodeName: t,
81
82
  class: p.join(" "),
82
83
  "data-decoration-id": u || void 0,
83
- "data-decoration-content": a
84
+ "data-decoration-content": r
84
85
  })]);
85
86
  }
86
87
  };
@@ -178,15 +179,15 @@ function v({ editor: e, items: t }) {
178
179
  }
179
180
  };
180
181
  }
181
- function y({ placement: e, offset: t, flip: n, floatingUi: r }) {
182
- let i = [s({
182
+ function y({ placement: e, offset: t, flip: i, floatingUi: a }) {
183
+ let o = [r({
183
184
  mainAxis: t.mainAxis ?? 4,
184
185
  crossAxis: t.crossAxis ?? 0
185
186
  })];
186
- return n && i.push(o()), r?.middleware?.length && i.push(...r.middleware), {
187
+ return i && o.push(n()), a?.middleware?.length && o.push(...a.middleware), {
187
188
  placement: e,
188
- strategy: r?.strategy ?? "absolute",
189
- middleware: i
189
+ strategy: a?.strategy ?? "absolute",
190
+ middleware: o
190
191
  };
191
192
  }
192
193
  function b(e) {
@@ -199,21 +200,21 @@ function b(e) {
199
200
  }
200
201
  return document.body;
201
202
  }
202
- function x({ getReferenceRect: e, contextElement: t, config: n, container: r, dismissOnOutsideClick: i, dismiss: a }) {
203
- return (o, s = {}) => {
203
+ function x({ getReferenceRect: e, contextElement: t, config: n, container: r, dismissOnOutsideClick: o, dismiss: s }) {
204
+ return (c, l = {}) => {
204
205
  let u = {
205
206
  getBoundingClientRect: () => e() ?? new DOMRect(),
206
207
  contextElement: t
207
- }, d = !1, f = !o.isConnected;
208
- f && b(r).appendChild(o), s.onPosition || (o.style.visibility = "hidden", o.style.width = "max-content");
209
- let p = l(u, o, () => {
210
- c(u, o, {
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, {
211
212
  placement: n.placement,
212
213
  strategy: n.strategy,
213
214
  middleware: n.middleware
214
215
  }).then(({ x: e, y: t, placement: n, strategy: r }) => {
215
- if (s.onPosition) {
216
- s.onPosition({
216
+ if (l.onPosition) {
217
+ l.onPosition({
217
218
  x: e,
218
219
  y: t,
219
220
  placement: n,
@@ -221,18 +222,18 @@ function x({ getReferenceRect: e, contextElement: t, config: n, container: r, di
221
222
  });
222
223
  return;
223
224
  }
224
- Object.assign(o.style, {
225
+ Object.assign(c.style, {
225
226
  position: r,
226
227
  left: `${e}px`,
227
228
  top: `${t}px`
228
- }), d || (d = !0, o.style.visibility = "");
229
+ }), d || (d = !0, c.style.visibility = "");
229
230
  });
230
- }, s.autoUpdate), m;
231
- return i && (m = (e) => {
231
+ }, l.autoUpdate), m;
232
+ return o && (m = (e) => {
232
233
  let n = e.target;
233
- !(n instanceof Node) || o.contains(n) || t.contains(n) || a();
234
+ !(n instanceof Node) || c.contains(n) || t.contains(n) || s();
234
235
  }, document.addEventListener("pointerdown", m, !0)), () => {
235
- p(), m && document.removeEventListener("pointerdown", m, !0), f && o.remove();
236
+ p(), m && document.removeEventListener("pointerdown", m, !0), f && c.remove();
236
237
  };
237
238
  };
238
239
  }
@@ -337,13 +338,13 @@ function S({ editor: e, pluginKey: t, items: n, renderer: r, minQueryLength: i,
337
338
  }
338
339
  };
339
340
  }
340
- var C = new e("suggestion");
341
- function w({ pluginKey: e = C, editor: n, char: r = "@", allowSpaces: i = !1, allowToIncludeChar: a = !1, allowedPrefixes: o = [" "], 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 }) {
342
- let I = j?.(), L = i && !a, R = (t, r) => p(n, t, r, e);
341
+ var C = new s("suggestion");
342
+ 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 }) {
343
+ let I = j?.(), L = r && !i, R = (n, r) => p(t, n, r, e);
343
344
  function z(e) {
344
345
  return m({
345
346
  ...e,
346
- editor: n,
347
+ editor: t,
347
348
  shouldResetDismissed: F,
348
349
  effectiveAllowSpaces: L
349
350
  });
@@ -352,10 +353,10 @@ function w({ pluginKey: e = C, editor: n, char: r = "@", allowSpaces: i = !1, al
352
353
  view: t,
353
354
  pluginKeyRef: e
354
355
  });
355
- return new t({
356
+ return new o({
356
357
  key: e,
357
358
  view: () => S({
358
- editor: n,
359
+ editor: t,
359
360
  pluginKey: e,
360
361
  items: y,
361
362
  renderer: I,
@@ -373,11 +374,11 @@ function w({ pluginKey: e = C, editor: n, char: r = "@", allowSpaces: i = !1, al
373
374
  dispatchExit: B
374
375
  }),
375
376
  state: _({
376
- editor: n,
377
- char: r,
377
+ editor: t,
378
+ char: n,
378
379
  effectiveAllowSpaces: L,
379
- allowToIncludeChar: a,
380
- allowedPrefixes: o,
380
+ allowToIncludeChar: i,
381
+ allowedPrefixes: a,
381
382
  startOfLine: s,
382
383
  findSuggestionMatch: N,
383
384
  allow: M,
@@ -396,7 +397,7 @@ function w({ pluginKey: e = C, editor: n, char: r = "@", allowSpaces: i = !1, al
396
397
  })
397
398
  });
398
399
  }
399
- var T = w, E = new e("slashSuggestion"), D = a.create({
400
+ var T = w, E = new s("slashSuggestion"), D = t.create({
400
401
  name: "slashCommand",
401
402
  addOptions() {
402
403
  return {
@@ -1,9 +1,9 @@
1
- import { t as e } from "../dist-BMKyBtRa.js";
1
+ import { t as e } from "../dist-DErUltkU.js";
2
2
  import { t } from "../html-to-markdown-Cta7-ssO.js";
3
3
  import { t as n } from "../markdown-to-html-DwSNqq2i.js";
4
4
  import { isInViewport as r } from "./is-in-viewport.js";
5
5
  import { convertLegacyMathDelimiters as i } from "./convert-legacy-math-delimiters.js";
6
- import { t as a } from "../extension-BVGWENts.js";
6
+ import { t as a } from "../extension-6I5t1ZxQ.js";
7
7
  //#region lib/utils/create-scribe-editor.ts
8
8
  function o({ content: n = "", editable: r = !1, onContentChange: i }) {
9
9
  return new e({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@clevertask/scribe",
3
- "version": "0.1.9",
3
+ "version": "0.1.10",
4
4
  "private": false,
5
5
  "description": "A Radix-based Tiptap rich text editor with a Notion-style block interface for viewing and creating content. Perfect for diverse needs like notes, documents, AI chat, Markdown parsing, and comments.",
6
6
  "keywords": [
@@ -60,7 +60,6 @@
60
60
  "@tiptap/extension-task-item": "^3.29.2",
61
61
  "@tiptap/extension-task-list": "^3.29.2",
62
62
  "@tiptap/extension-typography": "^3.29.2",
63
- "@tiptap/pm": "^3.29.2",
64
63
  "@tiptap/react": "^3.29.2",
65
64
  "@tiptap/starter-kit": "^3.29.2",
66
65
  "@tiptap/suggestion": "^3.29.2",
@@ -77,6 +76,7 @@
77
76
  "@testing-library/dom": "^10.4.1",
78
77
  "@testing-library/jest-dom": "^7.0.0",
79
78
  "@testing-library/react": "^16.3.2",
79
+ "@tiptap/pm": "3.29.2",
80
80
  "@types/lodash": "^4.17.25",
81
81
  "@types/node": "^24.13.3",
82
82
  "@types/react": "^19.2.18",
@@ -95,6 +95,7 @@
95
95
  },
96
96
  "peerDependencies": {
97
97
  "@radix-ui/themes": ">=3.3.0",
98
+ "@tiptap/pm": "3.29.2",
98
99
  "react": ">=18.3.1 <20.0.0",
99
100
  "react-dom": ">=18.3.1 <20.0.0"
100
101
  },