@clevertask/scribe 0.1.11 → 0.1.13

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 (58) hide show
  1. package/README.md +1 -1
  2. package/dist/{BarMenu-5M9g9Y1j.js → BarMenu-O2IVhHXx.js} +1 -1
  3. package/dist/assets/index.css +1 -1
  4. package/dist/components/Menu/BarMenu.js +1 -1
  5. package/dist/components/Menu/BubbleMenu.js +2 -2
  6. package/dist/components/Menu/CalloutBubbleMenu.d.ts +7 -0
  7. package/dist/components/Menu/CalloutBubbleMenu.d.ts.map +1 -0
  8. package/dist/components/Menu/CalloutBubbleMenu.js +156 -0
  9. package/dist/components/Menu/LinkBubbleMenu.js +2 -2
  10. package/dist/components/Menu/Mobile/ListOptionBar.js +1 -1
  11. package/dist/components/Menu/TableBubbleMenu.d.ts.map +1 -1
  12. package/dist/components/Menu/TableBubbleMenu.js +99 -98
  13. package/dist/components/Menu/calloutBubbleMenuPlugin.d.ts +10 -0
  14. package/dist/components/Menu/calloutBubbleMenuPlugin.d.ts.map +1 -0
  15. package/dist/components/Menu/calloutBubbleMenuPlugin.js +22 -0
  16. package/dist/components/Menu/contextualMenuOwner.d.ts +4 -0
  17. package/dist/components/Menu/contextualMenuOwner.d.ts.map +1 -0
  18. package/dist/components/Menu/contextualMenuOwner.js +9 -0
  19. package/dist/components/Scribe/extension/callout.d.ts +32 -0
  20. package/dist/components/Scribe/extension/callout.d.ts.map +1 -0
  21. package/dist/components/Scribe/extension/callout.js +118 -0
  22. package/dist/components/Scribe/extension/emoji/suggest.js +1 -1
  23. package/dist/components/Scribe/extension/extension-link.js +1 -1
  24. package/dist/components/Scribe/extension/extension-markdown-paste.js +2 -2
  25. package/dist/components/Scribe/extension/extension-selectedText.js +1 -1
  26. package/dist/components/Scribe/extension/index.d.ts +1 -1
  27. package/dist/components/Scribe/extension/index.d.ts.map +1 -1
  28. package/dist/components/Scribe/extension/index.js +1 -1
  29. package/dist/components/Scribe/extension/resizable-table.js +1 -1
  30. package/dist/components/Scribe/extension/slashCommand/index.js +1 -1
  31. package/dist/components/Scribe/extension/slashCommand/items.d.ts.map +1 -1
  32. package/dist/components/Scribe/extension/slashCommand/items.js +48 -28
  33. package/dist/components/Scribe/extension/slashCommand/renderItems.js +1 -1
  34. package/dist/components/Scribe/extension/tableOfContents.js +1 -1
  35. package/dist/components/Scribe/index.d.ts.map +1 -1
  36. package/dist/components/Scribe/index.js +128 -126
  37. package/dist/{dist-Dw4STOPE.js → dist-BoYfa2nz.js} +1 -1
  38. package/dist/{dist-DFua_Xbu.js → dist-W9E-K577.js} +980 -618
  39. package/dist/{extension-Dy6hHSvD.js → extension-D5WIAWhc.js} +1984 -1946
  40. package/dist/{extension-link-CjfUZ90W.js → extension-link-D8Zi7OSa.js} +36 -36
  41. package/dist/{html-to-markdown-B6Uhn7ok.js → html-to-markdown-C920nQtn.js} +101 -60
  42. package/dist/icons/CalloutIcon.d.ts +9 -0
  43. package/dist/icons/CalloutIcon.d.ts.map +1 -0
  44. package/dist/icons/CalloutIcon.js +72 -0
  45. package/dist/main.css +119 -1
  46. package/dist/main.d.ts +1 -0
  47. package/dist/main.d.ts.map +1 -1
  48. package/dist/main.js +9 -8
  49. package/dist/{markdown-to-html-WmeDaJXP.js → markdown-to-html-CW0Nb9Ye.js} +32 -2
  50. package/dist/{menus-_EXlLMjz.js → menus-B1Zz0GjH.js} +17 -17
  51. package/dist/{resizable-table-Ddw3l6DJ.js → resizable-table-Bf-fb9iv.js} +36 -18
  52. package/dist/{slashCommand-CxX07Nbk.js → slashCommand-47omO4ob.js} +2 -2
  53. package/dist/utils/html-to-markdown.d.ts.map +1 -1
  54. package/dist/utils/html-to-markdown.js +1 -1
  55. package/dist/utils/index.js +4 -4
  56. package/dist/utils/markdown-to-html.d.ts.map +1 -1
  57. package/dist/utils/markdown-to-html.js +1 -1
  58. package/package.json +48 -25
package/dist/main.css CHANGED
@@ -120,6 +120,103 @@
120
120
  padding-left: 1rem;
121
121
  }
122
122
 
123
+ .scribe-content .tiptap [data-type="callout"] {
124
+ --scribe-callout-background: var(--blue-2);
125
+ --scribe-callout-border: var(--blue-6);
126
+ --scribe-callout-icon: var(--blue-11);
127
+ --scribe-callout-label: var(--blue-12);
128
+
129
+ background: var(--scribe-callout-background);
130
+ border: 1px solid var(--scribe-callout-border);
131
+ border-radius: 10px;
132
+ box-sizing: border-box;
133
+ color: var(--gray-12);
134
+ margin: 0 0 1rem;
135
+ padding: 12px 14px;
136
+ }
137
+
138
+ .scribe-content .tiptap [data-type="callout"][data-variant="tip"] {
139
+ --scribe-callout-background: var(--green-2);
140
+ --scribe-callout-border: var(--green-6);
141
+ --scribe-callout-icon: var(--green-11);
142
+ --scribe-callout-label: var(--green-12);
143
+ }
144
+
145
+ .scribe-content .tiptap [data-type="callout"][data-variant="warning"] {
146
+ --scribe-callout-background: var(--amber-2);
147
+ --scribe-callout-border: var(--amber-6);
148
+ --scribe-callout-icon: var(--amber-11);
149
+ --scribe-callout-label: var(--amber-12);
150
+ }
151
+
152
+ .scribe-content .tiptap [data-type="callout"][data-variant="caution"] {
153
+ --scribe-callout-background: var(--red-2);
154
+ --scribe-callout-border: var(--red-6);
155
+ --scribe-callout-icon: var(--red-11);
156
+ --scribe-callout-label: var(--red-12);
157
+ }
158
+
159
+ .scribe-content .tiptap [data-callout-header] {
160
+ align-items: center;
161
+ color: var(--scribe-callout-label);
162
+ display: flex;
163
+ font-size: 0.875rem;
164
+ font-weight: 600;
165
+ gap: 8px;
166
+ line-height: 1.25rem;
167
+ margin-bottom: 6px;
168
+ user-select: none;
169
+ }
170
+
171
+ .scribe-content .tiptap [data-callout-icon] {
172
+ -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='10' cy='10' r='7.25'/%3E%3Cpath d='M10 8.5v5M10 5.65v.05'/%3E%3C/svg%3E");
173
+ -webkit-mask-position: center;
174
+ -webkit-mask-repeat: no-repeat;
175
+ -webkit-mask-size: contain;
176
+ background: var(--scribe-callout-icon);
177
+ display: inline-block;
178
+ flex: 0 0 18px;
179
+ height: 18px;
180
+ mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='10' cy='10' r='7.25'/%3E%3Cpath d='M10 8.5v5M10 5.65v.05'/%3E%3C/svg%3E");
181
+ mask-position: center;
182
+ mask-repeat: no-repeat;
183
+ mask-size: contain;
184
+ width: 18px;
185
+ }
186
+
187
+ .scribe-content .tiptap [data-type="callout"][data-variant="tip"] [data-callout-icon] {
188
+ -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6.5 12.1a5 5 0 1 1 7 0c-.8.75-1.2 1.4-1.2 2.15H7.7c0-.75-.4-1.4-1.2-2.15Z'/%3E%3Cpath d='M7.9 16.6h4.2M8.8 14.25v2.35M11.2 14.25v2.35'/%3E%3C/svg%3E");
189
+ mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6.5 12.1a5 5 0 1 1 7 0c-.8.75-1.2 1.4-1.2 2.15H7.7c0-.75-.4-1.4-1.2-2.15Z'/%3E%3Cpath d='M7.9 16.6h4.2M8.8 14.25v2.35M11.2 14.25v2.35'/%3E%3C/svg%3E");
190
+ }
191
+
192
+ .scribe-content .tiptap [data-type="callout"][data-variant="warning"] [data-callout-icon] {
193
+ -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9.1 3.6 2.3 15.4a1.05 1.05 0 0 0 .9 1.55h13.6a1.05 1.05 0 0 0 .9-1.55L10.9 3.6a1.04 1.04 0 0 0-1.8 0Z'/%3E%3Cpath d='M10 7.6v4.45M10 14.65v.05'/%3E%3C/svg%3E");
194
+ mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9.1 3.6 2.3 15.4a1.05 1.05 0 0 0 .9 1.55h13.6a1.05 1.05 0 0 0 .9-1.55L10.9 3.6a1.04 1.04 0 0 0-1.8 0Z'/%3E%3Cpath d='M10 7.6v4.45M10 14.65v.05'/%3E%3C/svg%3E");
195
+ }
196
+
197
+ .scribe-content .tiptap [data-type="callout"][data-variant="caution"] [data-callout-icon] {
198
+ -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6.45 2.75-3.7 3.7v7.1l3.7 3.7h7.1l3.7-3.7v-7.1l-3.7-3.7h-7.1Z'/%3E%3Cpath d='M10 6.2v5.65M10 14.45v.05'/%3E%3C/svg%3E");
199
+ mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6.45 2.75-3.7 3.7v7.1l3.7 3.7h7.1l3.7-3.7v-7.1l-3.7-3.7h-7.1Z'/%3E%3Cpath d='M10 6.2v5.65M10 14.45v.05'/%3E%3C/svg%3E");
200
+ }
201
+
202
+ .scribe-content .tiptap [data-callout-content] {
203
+ color: var(--gray-12);
204
+ min-width: 0;
205
+ }
206
+
207
+ .scribe-content .tiptap [data-callout-content] > *:first-child {
208
+ margin-top: 0;
209
+ }
210
+
211
+ .scribe-content .tiptap [data-callout-content] > *:last-child {
212
+ margin-bottom: 0;
213
+ }
214
+
215
+ .scribe-content .tiptap [data-type="callout"].ProseMirror-selectednode {
216
+ outline: 2px solid var(--accent-8);
217
+ outline-offset: 2px;
218
+ }
219
+
123
220
  .scribe-content .tiptap code {
124
221
  background: var(--gray-a3);
125
222
  border-radius: 6px;
@@ -224,7 +321,8 @@
224
321
  }
225
322
 
226
323
  .scribe-bubble-menu,
227
- .scribe-table-bubble-menu {
324
+ .scribe-table-bubble-menu,
325
+ .scribe-callout-bubble-menu {
228
326
  background: var(--color-panel-solid);
229
327
  border: 1px solid var(--gray-6);
230
328
  border-radius: 12px;
@@ -239,6 +337,26 @@
239
337
  overflow-x: auto;
240
338
  }
241
339
 
340
+ .scribe-callout-bubble-menu {
341
+ max-width: calc(100vw - 16px);
342
+ width: max-content;
343
+ }
344
+
345
+ .scribe-callout-type-button {
346
+ flex-shrink: 0;
347
+ white-space: nowrap;
348
+ }
349
+
350
+ .scribe-callout-menu-separator {
351
+ height: 20px;
352
+ margin: 0 2px;
353
+ }
354
+
355
+ .scribe-callout-icon {
356
+ display: block;
357
+ flex: 0 0 auto;
358
+ }
359
+
242
360
  .scribe-table-bubble-menu > * {
243
361
  flex-shrink: 0;
244
362
  }
package/dist/main.d.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  export * from "./components/Scribe";
2
+ export * from "./components/Scribe/extension/callout";
2
3
  export * from "./utils";
3
4
  export type { Content } from "@tiptap/react";
4
5
  //# sourceMappingURL=main.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../lib/main.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC;AACpC,cAAc,SAAS,CAAC;AACxB,YAAY,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC"}
1
+ {"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../lib/main.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC;AACpC,cAAc,uCAAuC,CAAC;AACtD,cAAc,SAAS,CAAC;AACxB,YAAY,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC"}
package/dist/main.js CHANGED
@@ -1,8 +1,9 @@
1
- import { t as e } from "./html-to-markdown-B6Uhn7ok.js";
2
- import { t } from "./markdown-to-html-WmeDaJXP.js";
3
- import { isInViewport as n } from "./utils/is-in-viewport.js";
4
- import { convertLegacyMathDelimiters as r } from "./utils/convert-legacy-math-delimiters.js";
5
- import { SuggestionItemType as i } from "./components/Scribe/extension/slashCommand/items.js";
6
- import { createScribeEditor as a } from "./utils/index.js";
7
- import { Scribe as o } from "./components/Scribe/index.js";
8
- export { o as Scribe, i as SuggestionItemType, r as convertLegacyMathDelimiters, a as createScribeEditor, e as html2md, n as isInViewport, t as md2html };
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 { t as a } from "./html-to-markdown-C920nQtn.js";
3
+ import { t as o } from "./markdown-to-html-CW0Nb9Ye.js";
4
+ import { isInViewport as s } from "./utils/is-in-viewport.js";
5
+ import { convertLegacyMathDelimiters as c } from "./utils/convert-legacy-math-delimiters.js";
6
+ import { SuggestionItemType as l } from "./components/Scribe/extension/slashCommand/items.js";
7
+ import { createScribeEditor as u } from "./utils/index.js";
8
+ import { Scribe as d } from "./components/Scribe/index.js";
9
+ export { e as CALLOUT_VARIANTS, t as CALLOUT_VARIANT_LABELS, n as Callout, r as DEFAULT_CALLOUT_VARIANT, d as Scribe, l as SuggestionItemType, c as convertLegacyMathDelimiters, u as createScribeEditor, a as html2md, i as isCalloutVariant, s as isInViewport, o as md2html };
@@ -1468,6 +1468,36 @@ $.use = ze, $.walkTokens = function(e, t) {
1468
1468
  }, $.parseInline = Q.parseInline, $.Parser = X, $.parser = X.parse, $.Renderer = J, $.TextRenderer = Y, $.Lexer = q, $.lexer = q.lex, $.Tokenizer = K, $.Hooks = Z, $.parse = $, $.options, $.setOptions, $.walkTokens, $.parseInline, X.parse, q.lex;
1469
1469
  //#endregion
1470
1470
  //#region lib/utils/markdown-to-html.ts
1471
- var Be = (t) => e.sanitize($.parse(t, { async: !1 }), { ADD_ATTR: ["colwidth"] });
1471
+ var Be = /* @__PURE__ */ new Set([
1472
+ "info",
1473
+ "tip",
1474
+ "warning",
1475
+ "caution"
1476
+ ]), Ve = [
1477
+ "width",
1478
+ "min-width",
1479
+ "max-width",
1480
+ "text-align"
1481
+ ], He = (e) => {
1482
+ let t = e?.trim().toLowerCase();
1483
+ return t && Be.has(t) ? t : "info";
1484
+ }, Ue = (e) => {
1485
+ let t = e.matches("table, col, th, td") ? Ve.map((t) => [t, e.style.getPropertyValue(t)]).filter(([, e]) => !!e) : [];
1486
+ e.removeAttribute("style"), t.forEach(([t, n]) => {
1487
+ e.style.setProperty(t, n);
1488
+ });
1489
+ }, We = (e) => {
1490
+ let t = document.createElement("div");
1491
+ return t.innerHTML = e, t.querySelectorAll("aside[data-type=\"callout\"]").forEach((e) => {
1492
+ let t = He(e.getAttribute("data-variant"));
1493
+ Array.from(e.attributes).forEach((t) => {
1494
+ t.name !== "data-type" && t.name !== "data-variant" && t.name !== "role" && e.removeAttribute(t.name);
1495
+ }), e.setAttribute("data-type", "callout"), e.setAttribute("data-variant", t), e.setAttribute("role", "note"), [e, ...Array.from(e.querySelectorAll("*"))].forEach((e) => {
1496
+ Ue(e), Array.from(e.attributes).forEach((t) => {
1497
+ t.name.toLowerCase().startsWith("on") && e.removeAttribute(t.name);
1498
+ });
1499
+ });
1500
+ }), t.innerHTML;
1501
+ }, Ge = (t) => We(e.sanitize($.parse(t, { async: !1 }), { ADD_ATTR: ["colwidth"] }));
1472
1502
  //#endregion
1473
- export { $ as n, Be as t };
1503
+ export { $ as n, Ge as t };
@@ -1,17 +1,17 @@
1
- import { r as e } from "./dist-Dw4STOPE.js";
2
- import { A as t, C as n, I as r, S as i, n as a } from "./dist-DFua_Xbu.js";
1
+ import { r as e } from "./dist-BoYfa2nz.js";
2
+ import { C as t, L as n, j as r, n as i, w as a } from "./dist-W9E-K577.js";
3
3
  import { a as o, c as s, i as c, l, n as u, o as d, s as f, t as p, u as m } from "./floating-ui.dom-CmJ6iBdh.js";
4
4
  import h, { useEffect as g, useLayoutEffect as _, useRef as v, useState as y } from "react";
5
5
  import { createPortal as b } from "react-dom";
6
6
  import { NodeSelection as x, Plugin as S, PluginKey as C } from "@tiptap/pm/state";
7
7
  import { CellSelection as w } from "@tiptap/pm/tables";
8
- //#region node_modules/.pnpm/@tiptap+extension-bubble-menu@3.29.2_@tiptap+core@3.29.2_@tiptap+pm@3.29.2__@tiptap+pm@3.29.2/node_modules/@tiptap/extension-bubble-menu/dist/index.js
8
+ //#region node_modules/.pnpm/@tiptap+extension-bubble-menu@3.30.1_@tiptap+core@3.30.1_@tiptap+pm@3.30.1__@tiptap+pm@3.30.1/node_modules/@tiptap/extension-bubble-menu/dist/index.js
9
9
  function T(e, t) {
10
10
  let n = Math.min(e.top, t.top), r = Math.max(e.bottom, t.bottom), i = Math.min(e.left, t.left), a = Math.max(e.right, t.right) - i, o = r - n;
11
11
  return new DOMRect(i, n, a, o);
12
12
  }
13
13
  var E = class {
14
- constructor({ editor: e, element: n, view: r, pluginKey: i = "bubbleMenu", updateDelay: a = 250, resizeDelay: o = 60, shouldShow: s, appendTo: c, getReferencedVirtualElement: l, options: u }) {
14
+ constructor({ editor: e, element: t, view: n, pluginKey: i = "bubbleMenu", updateDelay: a = 250, resizeDelay: o = 60, shouldShow: s, appendTo: c, getReferencedVirtualElement: l, options: u }) {
15
15
  this.preventHide = !1, this.isVisible = !1, this.scrollTarget = window, this.floatingUIOptions = {
16
16
  strategy: "absolute",
17
17
  placement: "top",
@@ -27,8 +27,8 @@ var E = class {
27
27
  onHide: void 0,
28
28
  onUpdate: void 0,
29
29
  onDestroy: void 0
30
- }, this.shouldShow = ({ view: e, state: n, from: r, to: i }) => {
31
- let { doc: a, selection: o } = n, { empty: s } = o, c = !a.textBetween(r, i).length && t(n.selection), l = this.element.contains(document.activeElement);
30
+ }, this.shouldShow = ({ view: e, state: t, from: n, to: i }) => {
31
+ let { doc: a, selection: o } = t, { empty: s } = o, c = !a.textBetween(n, i).length && r(t.selection), l = this.element.contains(document.activeElement);
32
32
  return !(!(e.hasFocus() || l) || s || c || !this.editor.isEditable);
33
33
  }, this.mousedownHandler = () => {
34
34
  this.preventHide = !0;
@@ -67,10 +67,10 @@ var E = class {
67
67
  }, this.transactionHandler = ({ transaction: e }) => {
68
68
  let t = e.getMeta(this.pluginKey);
69
69
  t === "updatePosition" ? this.updatePosition() : t && typeof t == "object" && t.type === "updateOptions" ? this.updateOptions(t.options) : t === "hide" ? this.hide() : t === "show" && (this.updatePosition(), this.show());
70
- }, this.editor = e, this.element = n, this.view = r, this.pluginKey = i, this.updateDelay = a, this.resizeDelay = o, this.appendTo = c, this.scrollTarget = u?.scrollTarget ?? window, this.getReferencedVirtualElement = l, this.floatingUIOptions = {
70
+ }, this.editor = e, this.element = t, this.view = n, this.pluginKey = i, this.updateDelay = a, this.resizeDelay = o, this.appendTo = c, this.scrollTarget = u?.scrollTarget ?? window, this.getReferencedVirtualElement = l, this.floatingUIOptions = {
71
71
  ...this.floatingUIOptions,
72
72
  ...u
73
- }, this.element.tabIndex = 0, s && (this.shouldShow = s), this.element.addEventListener("mousedown", this.mousedownHandler, { capture: !0 }), this.view.dom.addEventListener("dragstart", this.dragstartHandler), this.editor.on("focus", this.focusHandler), this.editor.on("blur", this.blurHandler), this.editor.on("transaction", this.transactionHandler), window.addEventListener("resize", this.resizeHandler), this.scrollTarget.addEventListener("scroll", this.resizeHandler), this.update(r, r.state), this.getShouldShow() && (this.show(), this.updatePosition());
73
+ }, this.element.tabIndex = 0, s && (this.shouldShow = s), this.element.addEventListener("mousedown", this.mousedownHandler, { capture: !0 }), this.view.dom.addEventListener("dragstart", this.dragstartHandler), this.editor.on("focus", this.focusHandler), this.editor.on("blur", this.blurHandler), this.editor.on("transaction", this.transactionHandler), window.addEventListener("resize", this.resizeHandler), this.scrollTarget.addEventListener("scroll", this.resizeHandler), this.update(n, n.state), this.getShouldShow() && (this.show(), this.updatePosition());
74
74
  }
75
75
  get middlewares() {
76
76
  let e = [];
@@ -80,9 +80,9 @@ var E = class {
80
80
  let { selection: e } = this.editor.state, t = this.getReferencedVirtualElement?.call(this);
81
81
  if (t) return t;
82
82
  if (!this.view?.dom?.parentNode) return;
83
- let n = r(this.view, e.from, e.to), i = {
84
- getBoundingClientRect: () => n,
85
- getClientRects: () => [n]
83
+ let r = n(this.view, e.from, e.to), i = {
84
+ getBoundingClientRect: () => r,
85
+ getClientRects: () => [r]
86
86
  };
87
87
  if (e instanceof x) {
88
88
  let t = this.view.nodeDOM(e.from), n = t.dataset.nodeViewWrapper ? t : t.querySelector("[data-node-view-wrapper]");
@@ -166,7 +166,7 @@ var E = class {
166
166
  ...e
167
167
  })
168
168
  });
169
- a.create({
169
+ i.create({
170
170
  name: "bubbleMenu",
171
171
  addOptions() {
172
172
  return {
@@ -191,7 +191,7 @@ a.create({
191
191
  }
192
192
  });
193
193
  //#endregion
194
- //#region node_modules/.pnpm/@tiptap+extension-floating-menu@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/extension-floating-menu/dist/index.js
194
+ //#region node_modules/.pnpm/@tiptap+extension-floating-menu@3.30.1_@floating-ui+dom@1.8.0_@tiptap+core@3.30.1_@tiptap+pm@3.30.1__@tiptap+pm@3.30.1/node_modules/@tiptap/extension-floating-menu/dist/index.js
195
195
  var O = class {
196
196
  constructor({ editor: e, element: t, view: n, pluginKey: r = "floatingMenu", updateDelay: i = 250, resizeDelay: a = 60, options: o, appendTo: s, shouldShow: c }) {
197
197
  this.preventHide = !1, this.isVisible = !1, this.scrollTarget = window, this.shouldShow = ({ view: e, state: t }) => {
@@ -240,7 +240,7 @@ var O = class {
240
240
  }, this.element.tabIndex = 0, c && (this.shouldShow = c), this.element.addEventListener("mousedown", this.mousedownHandler, { capture: !0 }), this.editor.on("focus", this.focusHandler), this.editor.on("blur", this.blurHandler), this.editor.on("transaction", this.transactionHandler), window.addEventListener("resize", this.resizeHandler), this.scrollTarget.addEventListener("scroll", this.resizeHandler), this.update(n, n.state), this.getShouldShow() && (this.show(), this.updatePosition());
241
241
  }
242
242
  getTextContent(e) {
243
- return i(e, { textSerializers: n(this.editor.schema) });
243
+ return t(e, { textSerializers: a(this.editor.schema) });
244
244
  }
245
245
  get middlewares() {
246
246
  let e = [];
@@ -268,7 +268,7 @@ var O = class {
268
268
  }
269
269
  updatePosition() {
270
270
  if (!this.view?.dom?.parentNode) return;
271
- let { selection: e } = this.editor.state, t = r(this.view, e.from, e.to);
271
+ let { selection: e } = this.editor.state, t = n(this.view, e.from, e.to);
272
272
  c({
273
273
  getBoundingClientRect: () => t,
274
274
  getClientRects: () => [t]
@@ -305,7 +305,7 @@ var O = class {
305
305
  ...e
306
306
  })
307
307
  });
308
- a.create({
308
+ i.create({
309
309
  name: "floatingMenu",
310
310
  addOptions() {
311
311
  return {
@@ -335,7 +335,7 @@ a.create({
335
335
  }
336
336
  });
337
337
  //#endregion
338
- //#region node_modules/.pnpm/@tiptap+react@3.29.2_@floating-ui+dom@1.8.0_@tiptap+core@3.29.2_@tiptap+pm@3.29.2__@tip_6ae02cdf395ababc98513a112803373d/node_modules/@tiptap/react/dist/menus/index.js
338
+ //#region node_modules/.pnpm/@tiptap+react@3.30.1_@floating-ui+dom@1.8.0_@tiptap+core@3.30.1_@tiptap+pm@3.30.1__@tip_11778a9e3ce7f1a067932c0c4f0a2645/node_modules/@tiptap/react/dist/menus/index.js
339
339
  function A(e, t) {
340
340
  return e ?? new C(t);
341
341
  }
@@ -1,7 +1,7 @@
1
- import { N as e, a as t, c as n, g as r, n as i, p as a } from "./dist-DFua_Xbu.js";
1
+ import { P as e, a as t, c as n, g as r, n as i, p as a } from "./dist-W9E-K577.js";
2
2
  import { TextSelection as o } from "@tiptap/pm/state";
3
3
  import { CellSelection as s, addColumnAfter as c, addColumnBefore as l, addRowAfter as u, addRowBefore as d, columnResizing as f, columnResizingPluginKey as p, deleteColumn as m, deleteRow as h, deleteTable as g, fixTables as _, goToNextCell as v, mergeCells as y, setCellAttr as b, splitCell as x, tableEditing as S, toggleHeader as C, toggleHeaderCell as w } from "@tiptap/pm/tables";
4
- //#region node_modules/.pnpm/@tiptap+extension-table@3.29.2_@tiptap+core@3.29.2_@tiptap+pm@3.29.2__@tiptap+pm@3.29.2/node_modules/@tiptap/extension-table/dist/index.js
4
+ //#region node_modules/.pnpm/@tiptap+extension-table@3.30.1_@tiptap+core@3.30.1_@tiptap+pm@3.30.1__@tiptap+pm@3.30.1/node_modules/@tiptap/extension-table/dist/index.js
5
5
  function T(e) {
6
6
  return e === "left" || e === "right" || e === "center" ? e : null;
7
7
  }
@@ -224,7 +224,15 @@ var G = ({ editor: e }) => {
224
224
  ["tableCell", "tableHeader"].includes(e.type.name) && (n += 1);
225
225
  }), n === t.ranges.length && (e.commands.deleteTable(), !0);
226
226
  };
227
- function K(e) {
227
+ function K(e, t) {
228
+ let n = e.mapping.map(t);
229
+ if (a(e.selection.$from, (e) => e.type.name === "table")?.pos === n) return;
230
+ let r = e.doc.nodeAt(n);
231
+ if (!r) return;
232
+ let i = n + r.nodeSize - 1;
233
+ e.setSelection(o.near(e.doc.resolve(i), -1));
234
+ }
235
+ function q(e) {
228
236
  let t = "", n = 0;
229
237
  for (; n < e.length;) {
230
238
  if (e[n] === "\\" && n + 1 < e.length) {
@@ -247,7 +255,7 @@ function K(e) {
247
255
  for (; i + o < e.length && e[i + o] === "`";) o += 1;
248
256
  if (o === r) {
249
257
  let o = e.slice(n + r, i);
250
- t += e.slice(n, n + r) + o.replace(/(?<!\\)\|/g, "\\|") + e.slice(i, i + r), n = i + r, a = !0;
258
+ t += e.slice(n, n + r) + o.replace(/\\\||\|/g, (e) => e === "|" ? "\\|" : e) + e.slice(i, i + r), n = i + r, a = !0;
251
259
  break;
252
260
  }
253
261
  i += o;
@@ -256,13 +264,13 @@ function K(e) {
256
264
  }
257
265
  return t;
258
266
  }
259
- function q(e) {
260
- return e.split("\n").map((e) => !e.includes("|") || !e.includes("`") ? e : K(e)).join("\n");
261
- }
262
267
  function J(e) {
268
+ return e.split("\n").map((e) => !e.includes("|") || !e.includes("`") ? e : q(e)).join("\n");
269
+ }
270
+ function Y(e) {
263
271
  return (e || "").replace(/\s+/g, " ").trim();
264
272
  }
265
- function Y(e, t, n = {}) {
273
+ function X(e, t, n = {}) {
266
274
  let r = n.cellLineSeparator ?? "";
267
275
  if (!e || !e.content || e.content.length === 0) return "";
268
276
  let i = [];
@@ -271,7 +279,7 @@ function Y(e, t, n = {}) {
271
279
  e.content && e.content.forEach((e) => {
272
280
  let i = "";
273
281
  i = e.content && Array.isArray(e.content) && e.content.length > 1 ? e.content.map((e) => t.renderChildren(e)).join(r) : e.content ? t.renderChildren(e.content) : "";
274
- let a = J(i.split(r).join("\n").replace(/[ \t]*\r?\n[ \t]*/g, "<br>")), o = e.type === "tableHeader", s = D(e.attrs);
282
+ let a = Y(i.split(r).join("\n").replace(/[ \t]*\r?\n[ \t]*/g, "<br>")), o = e.type === "tableHeader", s = D(e.attrs);
275
283
  n.push({
276
284
  text: a,
277
285
  isHeader: o,
@@ -303,7 +311,7 @@ function Y(e, t, n = {}) {
303
311
  `;
304
312
  }), d;
305
313
  }
306
- var X = Y, Z = t.create({
314
+ var Z = X, Q = t.create({
307
315
  name: "table",
308
316
  addOptions() {
309
317
  return {
@@ -364,7 +372,7 @@ var X = Y, Z = t.create({
364
372
  }), n.push(t.createNode("tableRow", {}, i));
365
373
  }), t.createNode("table", void 0, n);
366
374
  },
367
- renderMarkdown: (e, t) => X(e, t),
375
+ renderMarkdown: (e, t) => Z(e, t),
368
376
  markdownTokenizer: {
369
377
  name: "table",
370
378
  level: "block",
@@ -379,7 +387,7 @@ var X = Y, Z = t.create({
379
387
  if (a.length < 2) return;
380
388
  let o = a[1];
381
389
  if (!/^[ \t|:]*-[ \t|:-]*$/.test(o) || !o.includes("|")) return;
382
- let s = q(i);
390
+ let s = J(i);
383
391
  if (s === i) return;
384
392
  let c = n.blockTokens(s)[0];
385
393
  if (c?.type !== "table" || !c.raw) return;
@@ -402,10 +410,20 @@ var X = Y, Z = t.create({
402
410
  },
403
411
  addColumnBefore: () => ({ state: e, dispatch: t }) => l(e, t),
404
412
  addColumnAfter: () => ({ state: e, dispatch: t }) => c(e, t),
405
- deleteColumn: () => ({ state: e, dispatch: t }) => m(e, t),
413
+ deleteColumn: () => ({ state: e, dispatch: t }) => {
414
+ let n = a(e.selection.$from, (e) => e.type.name === "table");
415
+ return m(e, t && ((e) => {
416
+ n && K(e, n.pos), t(e);
417
+ }));
418
+ },
406
419
  addRowBefore: () => ({ state: e, dispatch: t }) => d(e, t),
407
420
  addRowAfter: () => ({ state: e, dispatch: t }) => u(e, t),
408
- deleteRow: () => ({ state: e, dispatch: t }) => h(e, t),
421
+ deleteRow: () => ({ state: e, dispatch: t }) => {
422
+ let n = a(e.selection.$from, (e) => e.type.name === "table");
423
+ return h(e, t && ((e) => {
424
+ n && K(e, n.pos), t(e);
425
+ }));
426
+ },
409
427
  deleteTable: () => ({ state: e, dispatch: t }) => g(e, t),
410
428
  mergeCells: () => ({ state: e, dispatch: t }) => y(e, t),
411
429
  splitCell: () => ({ state: e, dispatch: t }) => x(e, t),
@@ -460,13 +478,13 @@ var X = Y, Z = t.create({
460
478
  };
461
479
  return { tableRole: n(r(e, "tableRole", t)) };
462
480
  }
463
- }), Q = i.create({
481
+ }), $ = i.create({
464
482
  name: "tableKit",
465
483
  addExtensions() {
466
484
  let e = [];
467
- return this.options.table !== !1 && e.push(Z.configure(this.options.table)), this.options.tableCell !== !1 && e.push(P.configure(this.options.tableCell)), this.options.tableHeader !== !1 && e.push(F.configure(this.options.tableHeader)), this.options.tableRow !== !1 && e.push(I.configure(this.options.tableRow)), e;
485
+ return this.options.table !== !1 && e.push(Q.configure(this.options.table)), this.options.tableCell !== !1 && e.push(P.configure(this.options.tableCell)), this.options.tableHeader !== !1 && e.push(F.configure(this.options.tableHeader)), this.options.tableRow !== !1 && e.push(I.configure(this.options.tableRow)), e;
468
486
  }
469
- }), $ = Z.extend({
487
+ }), ee = Q.extend({
470
488
  onUpdate() {
471
489
  if (this.editor.isEditable) return;
472
490
  let e = p.getState(this.editor.state);
@@ -486,4 +504,4 @@ var X = Y, Z = t.create({
486
504
  }
487
505
  }).configure({ resizable: !0 });
488
506
  //#endregion
489
- export { Q as n, $ as t };
507
+ export { $ as n, ee as t };
@@ -1,8 +1,8 @@
1
- import { d as e, n as t } from "./dist-DFua_Xbu.js";
1
+ import { d as e, n as t } from "./dist-W9E-K577.js";
2
2
  import { a as n, c as r, i, r as a } from "./floating-ui.dom-CmJ6iBdh.js";
3
3
  import { Plugin as o, PluginKey as s } from "@tiptap/pm/state";
4
4
  import { Decoration as c, DecorationSet as l } from "@tiptap/pm/view";
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
+ //#region node_modules/.pnpm/@tiptap+suggestion@3.30.1_@floating-ui+dom@1.8.0_@tiptap+core@3.30.1_@tiptap+pm@3.30.1__@tiptap+pm@3.30.1/node_modules/@tiptap/suggestion/dist/index.js
6
6
  function u(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;
@@ -1 +1 @@
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
+ {"version":3,"file":"html-to-markdown.d.ts","sourceRoot":"","sources":["../../lib/utils/html-to-markdown.ts"],"names":[],"mappings":"AA4VA,eAAO,MAAM,OAAO,SAAU,MAAM,WAwCnC,CAAC"}
@@ -1,2 +1,2 @@
1
- import { t as e } from "../html-to-markdown-B6Uhn7ok.js";
1
+ import { t as e } from "../html-to-markdown-C920nQtn.js";
2
2
  export { e as html2md };
@@ -1,9 +1,9 @@
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";
1
+ import { t as e } from "../dist-W9E-K577.js";
2
+ import { t } from "../html-to-markdown-C920nQtn.js";
3
+ import { t as n } from "../markdown-to-html-CW0Nb9Ye.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-Dy6hHSvD.js";
6
+ import { t as a } from "../extension-D5WIAWhc.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,WAG9B,CAAC"}
1
+ {"version":3,"file":"markdown-to-html.d.ts","sourceRoot":"","sources":["../../lib/utils/markdown-to-html.ts"],"names":[],"mappings":"AA8DA,eAAO,MAAM,OAAO,OAAQ,MAAM,WAMjC,CAAC"}
@@ -1,2 +1,2 @@
1
- import { t as e } from "../markdown-to-html-WmeDaJXP.js";
1
+ import { t as e } from "../markdown-to-html-CW0Nb9Ye.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.11",
3
+ "version": "0.1.13",
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": [
@@ -45,27 +45,14 @@
45
45
  "registry": "https://registry.npmjs.org/"
46
46
  },
47
47
  "dependencies": {
48
- "@tiptap/core": "^3.29.2",
49
- "@tiptap/extension-emoji": "^3.29.2",
50
- "@tiptap/extension-focus": "^3.29.2",
51
- "@tiptap/extension-highlight": "^3.29.2",
52
- "@tiptap/extension-image": "^3.29.2",
53
- "@tiptap/extension-link": "^3.29.2",
54
- "@tiptap/extension-mathematics": "^3.29.2",
55
- "@tiptap/extension-placeholder": "^3.29.2",
56
- "@tiptap/extension-table": "^3.29.2",
57
- "@tiptap/extension-table-cell": "^3.29.2",
58
- "@tiptap/extension-table-header": "^3.29.2",
59
- "@tiptap/extension-table-row": "^3.29.2",
60
- "@tiptap/extension-task-item": "^3.29.2",
61
- "@tiptap/extension-task-list": "^3.29.2",
62
- "@tiptap/extension-typography": "^3.29.2",
63
- "@tiptap/react": "^3.29.2",
64
- "@tiptap/starter-kit": "^3.29.2",
65
- "@tiptap/suggestion": "^3.29.2",
48
+ "@tiptap/core": "3.30.1",
49
+ "@tiptap/extension-bubble-menu": "3.30.1",
50
+ "@tiptap/extension-floating-menu": "3.30.1",
51
+ "@tiptap/react": "3.30.1",
52
+ "@tiptap/suggestion": "3.30.1",
66
53
  "clsx": "^2.1.1",
67
54
  "dompurify": "^3.4.13",
68
- "katex": "^0.17.0",
55
+ "katex": "^0.18.4",
69
56
  "marked": "^18.0.9",
70
57
  "tippy.js": "^6.3.7",
71
58
  "turndown": "^7.2.4"
@@ -74,9 +61,45 @@
74
61
  "@playwright/test": "^1.62.1",
75
62
  "@radix-ui/themes": "^3.3.0",
76
63
  "@testing-library/dom": "^10.4.1",
77
- "@testing-library/jest-dom": "^7.0.0",
64
+ "@testing-library/jest-dom": "^7.0.1",
78
65
  "@testing-library/react": "^16.3.2",
79
- "@tiptap/pm": "3.29.2",
66
+ "@tiptap/extension-blockquote": "3.30.1",
67
+ "@tiptap/extension-bold": "3.30.1",
68
+ "@tiptap/extension-bullet-list": "3.30.1",
69
+ "@tiptap/extension-code": "3.30.1",
70
+ "@tiptap/extension-code-block": "3.30.1",
71
+ "@tiptap/extension-document": "3.30.1",
72
+ "@tiptap/extension-dropcursor": "3.30.1",
73
+ "@tiptap/extension-emoji": "3.30.1",
74
+ "@tiptap/extension-focus": "3.30.1",
75
+ "@tiptap/extension-gapcursor": "3.30.1",
76
+ "@tiptap/extension-hard-break": "3.30.1",
77
+ "@tiptap/extension-heading": "3.30.1",
78
+ "@tiptap/extension-highlight": "3.30.1",
79
+ "@tiptap/extension-horizontal-rule": "3.30.1",
80
+ "@tiptap/extension-image": "3.30.1",
81
+ "@tiptap/extension-italic": "3.30.1",
82
+ "@tiptap/extension-link": "3.30.1",
83
+ "@tiptap/extension-list": "3.30.1",
84
+ "@tiptap/extension-list-item": "3.30.1",
85
+ "@tiptap/extension-list-keymap": "3.30.1",
86
+ "@tiptap/extension-mathematics": "3.30.1",
87
+ "@tiptap/extension-ordered-list": "3.30.1",
88
+ "@tiptap/extension-paragraph": "3.30.1",
89
+ "@tiptap/extension-placeholder": "3.30.1",
90
+ "@tiptap/extension-strike": "3.30.1",
91
+ "@tiptap/extension-table": "3.30.1",
92
+ "@tiptap/extension-table-cell": "3.30.1",
93
+ "@tiptap/extension-table-header": "3.30.1",
94
+ "@tiptap/extension-table-row": "3.30.1",
95
+ "@tiptap/extension-task-item": "3.30.1",
96
+ "@tiptap/extension-task-list": "3.30.1",
97
+ "@tiptap/extension-text": "3.30.1",
98
+ "@tiptap/extension-typography": "3.30.1",
99
+ "@tiptap/extension-underline": "3.30.1",
100
+ "@tiptap/extensions": "3.30.1",
101
+ "@tiptap/pm": "3.30.1",
102
+ "@tiptap/starter-kit": "3.30.1",
80
103
  "@types/lodash": "^4.17.25",
81
104
  "@types/node": "^24.13.3",
82
105
  "@types/react": "^19.2.18",
@@ -86,8 +109,8 @@
86
109
  "glob": "^13.0.6",
87
110
  "jsdom": "^30.0.1",
88
111
  "lodash": "^4.18.1",
89
- "oxfmt": "^0.62.0",
90
- "oxlint": "^1.77.0",
112
+ "oxfmt": "^0.63.0",
113
+ "oxlint": "^1.78.0",
91
114
  "typescript": "~7.0.2",
92
115
  "vite": "^8.2.1",
93
116
  "vite-plugin-lib-inject-css": "^2.2.2",
@@ -95,7 +118,7 @@
95
118
  },
96
119
  "peerDependencies": {
97
120
  "@radix-ui/themes": ">=3.3.0",
98
- "@tiptap/pm": "3.29.2",
121
+ "@tiptap/pm": "3.30.1",
99
122
  "react": ">=18.3.1 <20.0.0",
100
123
  "react-dom": ">=18.3.1 <20.0.0"
101
124
  },