@clevertask/scribe 0.1.9 → 0.1.11

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 (53) hide show
  1. package/README.md +21 -10
  2. package/dist/{BarMenu-BG_w4DVo.js → BarMenu-5M9g9Y1j.js} +7 -5
  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/TableBubbleMenu.d.ts +8 -0
  8. package/dist/components/Menu/TableBubbleMenu.d.ts.map +1 -0
  9. package/dist/components/Menu/TableBubbleMenu.js +305 -0
  10. package/dist/components/Menu/linkBubbleMenuPlugin.js +1 -1
  11. package/dist/components/Menu/tableBubbleMenuPlugin.d.ts +11 -0
  12. package/dist/components/Menu/tableBubbleMenuPlugin.d.ts.map +1 -0
  13. package/dist/components/Menu/tableBubbleMenuPlugin.js +22 -0
  14. package/dist/components/Scribe/extension/emoji/suggest.js +1 -1
  15. package/dist/components/Scribe/extension/extension-link.js +1 -1
  16. package/dist/components/Scribe/extension/extension-markdown-paste.js +11 -11
  17. package/dist/components/Scribe/extension/extension-selectedText.js +1 -1
  18. package/dist/components/Scribe/extension/index.d.ts +1 -1
  19. package/dist/components/Scribe/extension/index.d.ts.map +1 -1
  20. package/dist/components/Scribe/extension/index.js +1 -1
  21. package/dist/components/Scribe/extension/resizable-table.d.ts +8 -0
  22. package/dist/components/Scribe/extension/resizable-table.d.ts.map +1 -0
  23. package/dist/components/Scribe/extension/resizable-table.js +2 -0
  24. package/dist/components/Scribe/extension/slashCommand/SlashCommandList.js +1390 -1390
  25. package/dist/components/Scribe/extension/slashCommand/index.js +1 -1
  26. package/dist/components/Scribe/extension/slashCommand/items.d.ts.map +1 -1
  27. package/dist/components/Scribe/extension/slashCommand/items.js +27 -0
  28. package/dist/components/Scribe/extension/slashCommand/renderItems.js +1 -1
  29. package/dist/components/Scribe/extension/tableOfContents.js +4 -4
  30. package/dist/components/Scribe/index.d.ts +2 -1
  31. package/dist/components/Scribe/index.d.ts.map +1 -1
  32. package/dist/components/Scribe/index.js +133 -128
  33. package/dist/dist-DFua_Xbu.js +3251 -0
  34. package/dist/{dist-BgEySLwo.js → dist-Dw4STOPE.js} +1 -1
  35. package/dist/{extension-BVGWENts.js → extension-Dy6hHSvD.js} +1678 -2687
  36. package/dist/{extension-link-CMRfHUc5.js → extension-link-CjfUZ90W.js} +62 -62
  37. package/dist/{html-to-markdown-Cta7-ssO.js → html-to-markdown-B6Uhn7ok.js} +112 -54
  38. package/dist/main.css +52 -1
  39. package/dist/main.js +2 -2
  40. package/dist/{markdown-to-html-DwSNqq2i.js → markdown-to-html-WmeDaJXP.js} +73 -60
  41. package/dist/{menus-D9OsP28c.js → menus-_EXlLMjz.js} +66 -66
  42. package/dist/{purify.es-CFiLaBu1.js → purify.es-BES4pJF7.js} +267 -260
  43. package/dist/resizable-table-Ddw3l6DJ.js +489 -0
  44. package/dist/{slashCommand-B6Iz1i0d.js → slashCommand-CxX07Nbk.js} +69 -66
  45. package/dist/utils/html-to-markdown.d.ts.map +1 -1
  46. package/dist/utils/html-to-markdown.js +1 -1
  47. package/dist/utils/index.js +4 -4
  48. package/dist/utils/markdown-to-html.d.ts.map +1 -1
  49. package/dist/utils/markdown-to-html.js +1 -1
  50. package/package.json +8 -7
  51. package/dist/dist-BMKyBtRa.js +0 -7023
  52. package/dist/dist-FrapLVQu.js +0 -3513
  53. 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-DFua_Xbu.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
  }
@@ -299,31 +300,33 @@ function S({ editor: e, pluginKey: t, items: n, renderer: r, minQueryLength: i,
299
300
  dismissOnOutsideClick: f,
300
301
  dismiss: () => h(e.view)
301
302
  })
302
- }, 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") if (!P) _.abort(), g = {
303
- ...g,
304
- items: o ?? [],
305
- loading: !1
306
- };
307
- else {
308
- g = {
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 = {
309
305
  ...g,
310
306
  items: o ?? [],
311
- loading: !0
312
- }, T = "updated", S(T, g);
313
- let e = await _.fetch(A.query || "", a);
314
- if (e.status === "aborted") return;
315
- if (!t.getState(n.state)?.active) {
316
- _.abort();
317
- return;
318
- }
319
- g = e.status === "resolved" ? {
320
- ...g,
321
- items: e.items,
322
- loading: !1
323
- } : {
324
- ...g,
325
307
  loading: !1
326
308
  };
309
+ else {
310
+ g = {
311
+ ...g,
312
+ items: o ?? [],
313
+ loading: !0
314
+ }, T = "updated", S(T, g);
315
+ let e = await _.fetch(A.query || "", a);
316
+ if (e.status === "aborted") return;
317
+ if (!t.getState(n.state)?.active) {
318
+ _.abort();
319
+ return;
320
+ }
321
+ g = e.status === "resolved" ? {
322
+ ...g,
323
+ items: e.items,
324
+ loading: !1
325
+ } : {
326
+ ...g,
327
+ loading: !1
328
+ };
329
+ }
327
330
  }
328
331
  if (T === "stopped") {
329
332
  _.abort(), S(T, g), g = void 0;
@@ -337,13 +340,13 @@ function S({ editor: e, pluginKey: t, items: n, renderer: r, minQueryLength: i,
337
340
  }
338
341
  };
339
342
  }
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);
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
346
  function z(e) {
344
347
  return m({
345
348
  ...e,
346
- editor: n,
349
+ editor: t,
347
350
  shouldResetDismissed: F,
348
351
  effectiveAllowSpaces: L
349
352
  });
@@ -352,10 +355,10 @@ function w({ pluginKey: e = C, editor: n, char: r = "@", allowSpaces: i = !1, al
352
355
  view: t,
353
356
  pluginKeyRef: e
354
357
  });
355
- return new t({
358
+ return new o({
356
359
  key: e,
357
360
  view: () => S({
358
- editor: n,
361
+ editor: t,
359
362
  pluginKey: e,
360
363
  items: y,
361
364
  renderer: I,
@@ -373,11 +376,11 @@ function w({ pluginKey: e = C, editor: n, char: r = "@", allowSpaces: i = !1, al
373
376
  dispatchExit: B
374
377
  }),
375
378
  state: _({
376
- editor: n,
377
- char: r,
379
+ editor: t,
380
+ char: n,
378
381
  effectiveAllowSpaces: L,
379
- allowToIncludeChar: a,
380
- allowedPrefixes: o,
382
+ allowToIncludeChar: i,
383
+ allowedPrefixes: a,
381
384
  startOfLine: s,
382
385
  findSuggestionMatch: N,
383
386
  allow: M,
@@ -396,7 +399,7 @@ function w({ pluginKey: e = C, editor: n, char: r = "@", allowSpaces: i = !1, al
396
399
  })
397
400
  });
398
401
  }
399
- var T = w, E = new e("slashSuggestion"), D = a.create({
402
+ var T = w, E = new s("slashSuggestion"), D = t.create({
400
403
  name: "slashCommand",
401
404
  addOptions() {
402
405
  return {
@@ -1 +1 @@
1
- {"version":3,"file":"html-to-markdown.d.ts","sourceRoot":"","sources":["../../lib/utils/html-to-markdown.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,OAAO,SAAU,MAAM,WAiCnC,CAAC"}
1
+ {"version":3,"file":"html-to-markdown.d.ts","sourceRoot":"","sources":["../../lib/utils/html-to-markdown.ts"],"names":[],"mappings":"AAuQA,eAAO,MAAM,OAAO,SAAU,MAAM,WAuCnC,CAAC"}
@@ -1,2 +1,2 @@
1
- import { t as e } from "../html-to-markdown-Cta7-ssO.js";
1
+ import { t as e } from "../html-to-markdown-B6Uhn7ok.js";
2
2
  export { e as html2md };
@@ -1,9 +1,9 @@
1
- import { t as e } from "../dist-BMKyBtRa.js";
2
- import { t } from "../html-to-markdown-Cta7-ssO.js";
3
- import { t as n } from "../markdown-to-html-DwSNqq2i.js";
1
+ import { t as e } from "../dist-DFua_Xbu.js";
2
+ import { t } from "../html-to-markdown-B6Uhn7ok.js";
3
+ import { t as n } from "../markdown-to-html-WmeDaJXP.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-Dy6hHSvD.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({
@@ -1 +1 @@
1
- {"version":3,"file":"markdown-to-html.d.ts","sourceRoot":"","sources":["../../lib/utils/markdown-to-html.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,OAAO,OAAQ,MAAM,WAA2D,CAAC"}
1
+ {"version":3,"file":"markdown-to-html.d.ts","sourceRoot":"","sources":["../../lib/utils/markdown-to-html.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,OAAO,OAAQ,MAAM,WAG9B,CAAC"}
@@ -1,2 +1,2 @@
1
- import { t as e } from "../markdown-to-html-DwSNqq2i.js";
1
+ import { t as e } from "../markdown-to-html-WmeDaJXP.js";
2
2
  export { e as md2html };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@clevertask/scribe",
3
- "version": "0.1.9",
3
+ "version": "0.1.11",
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,14 +60,13 @@
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",
67
66
  "clsx": "^2.1.1",
68
- "dompurify": "^3.4.12",
67
+ "dompurify": "^3.4.13",
69
68
  "katex": "^0.17.0",
70
- "marked": "^18.0.7",
69
+ "marked": "^18.0.9",
71
70
  "tippy.js": "^6.3.7",
72
71
  "turndown": "^7.2.4"
73
72
  },
@@ -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",
@@ -86,15 +86,16 @@
86
86
  "glob": "^13.0.6",
87
87
  "jsdom": "^30.0.1",
88
88
  "lodash": "^4.18.1",
89
- "oxfmt": "^0.61.0",
90
- "oxlint": "^1.76.0",
89
+ "oxfmt": "^0.62.0",
90
+ "oxlint": "^1.77.0",
91
91
  "typescript": "~7.0.2",
92
- "vite": "^8.2.0",
92
+ "vite": "^8.2.1",
93
93
  "vite-plugin-lib-inject-css": "^2.2.2",
94
94
  "vitest": "^4.1.10"
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
  },