@clevertask/scribe 0.1.7 → 0.1.8

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 (44) hide show
  1. package/README.md +5 -4
  2. package/dist/{BarMenu-DC-S5Ggq.js → BarMenu-BG_w4DVo.js} +53 -25
  3. package/dist/assets/index.css +1 -1
  4. package/dist/components/Menu/BarMenu.d.ts.map +1 -1
  5. package/dist/components/Menu/BarMenu.js +1 -1
  6. package/dist/components/Menu/BubbleMenu.js +2 -2
  7. package/dist/components/Menu/LinkBubbleMenu.js +13 -13
  8. package/dist/components/Menu/LinkEditor.js +4 -4
  9. package/dist/components/Menu/Mobile/ListOptionBar.d.ts.map +1 -1
  10. package/dist/components/Menu/Mobile/ListOptionBar.js +11 -5
  11. package/dist/components/Menu/linkBubbleMenuPlugin.js +1 -1
  12. package/dist/components/Scribe/extension/emoji/EmojiList.d.ts.map +1 -1
  13. package/dist/components/Scribe/extension/emoji/EmojiList.js +6 -2
  14. package/dist/components/Scribe/extension/emoji/suggest.js +2 -2
  15. package/dist/components/Scribe/extension/extension-link.js +1 -1
  16. package/dist/components/Scribe/extension/extension-markdown-paste.js +14 -6
  17. package/dist/components/Scribe/extension/extension-selectedText.js +1 -1
  18. package/dist/components/Scribe/extension/index.js +1 -1
  19. package/dist/components/Scribe/extension/slashCommand/SlashCommandList.d.ts.map +1 -1
  20. package/dist/components/Scribe/extension/slashCommand/SlashCommandList.js +948 -943
  21. package/dist/components/Scribe/extension/slashCommand/index.js +1 -1
  22. package/dist/components/Scribe/extension/slashCommand/renderItems.js +2 -2
  23. package/dist/components/Scribe/extension/tableOfContents.js +2 -2
  24. package/dist/components/Scribe/index.d.ts +2 -0
  25. package/dist/components/Scribe/index.d.ts.map +1 -1
  26. package/dist/components/Scribe/index.js +182 -80
  27. package/dist/{dist-BQjH-i-q.js → dist-BMKyBtRa.js} +112 -105
  28. package/dist/{dist-DT3iiwSr.js → dist-BgEySLwo.js} +9 -8
  29. package/dist/{dist-CnXCIcnl.js → dist-FrapLVQu.js} +16 -9
  30. package/dist/{extension-CZOsheCI.js → extension-BVGWENts.js} +1306 -1300
  31. package/dist/{extension-link-DZID_SYl.js → extension-link-CMRfHUc5.js} +5 -5
  32. package/dist/{floating-ui.dom-rih69525.js → floating-ui.dom-CmJ6iBdh.js} +4 -5
  33. package/dist/{html-to-markdown-CrNOkSye.js → html-to-markdown-Cta7-ssO.js} +3 -2
  34. package/dist/main.js +2 -2
  35. package/dist/{markdown-to-html-DEczPfuq.js → markdown-to-html-DwSNqq2i.js} +8 -6
  36. package/dist/{menus-CrKTaPWU.js → menus-D9OsP28c.js} +8 -8
  37. package/dist/{purify.es-DF9CW1cl.js → purify.es-CFiLaBu1.js} +1 -1
  38. package/dist/{slashCommand-B7CRIaKG.js → slashCommand-B6Iz1i0d.js} +5 -8
  39. package/dist/{tables-CjOC70rm.js → tables-CXpUVKdw.js} +9 -7
  40. package/dist/{tippy.esm-D9LL2xiE.js → tippy.esm-DOXqN1Qm.js} +2 -7
  41. package/dist/utils/html-to-markdown.js +1 -1
  42. package/dist/utils/index.js +4 -4
  43. package/dist/utils/markdown-to-html.js +1 -1
  44. package/package.json +49 -34
@@ -1 +1 @@
1
- {"version":3,"file":"BarMenu.d.ts","sourceRoot":"","sources":["../../../lib/components/Menu/BarMenu.tsx"],"names":[],"mappings":"AAWA,OAAO,EAAE,MAAM,EAAkB,MAAM,eAAe,CAAC;AACvD,OAAO,EAAe,EAAE,EAA+C,MAAM,OAAO,CAAC;AAoBrF,MAAM,WAAW,YAAY;IAC3B,MAAM,EAAE,MAAM,CAAC;CAChB;AAWD,QAAA,MAAM,OAAO,EAAE,EAAE,CAAC,YAAY,CA8T7B,CAAC;eAEa,OAAO"}
1
+ {"version":3,"file":"BarMenu.d.ts","sourceRoot":"","sources":["../../../lib/components/Menu/BarMenu.tsx"],"names":[],"mappings":"AAWA,OAAO,EAAE,MAAM,EAAkB,MAAM,eAAe,CAAC;AACvD,OAAO,EAAe,EAAE,EAA+C,MAAM,OAAO,CAAC;AAoBrF,MAAM,WAAW,YAAY;IAC3B,MAAM,EAAE,MAAM,CAAC;CAChB;AAaD,QAAA,MAAM,OAAO,EAAE,EAAE,CAAC,YAAY,CAkV7B,CAAC;eAEa,OAAO"}
@@ -1,2 +1,2 @@
1
- import { t as e } from "../../BarMenu-DC-S5Ggq.js";
1
+ import { t as e } from "../../BarMenu-BG_w4DVo.js";
2
2
  export { e as default };
@@ -1,6 +1,6 @@
1
- import { a as e } from "../../dist-DT3iiwSr.js";
1
+ import { a as e } from "../../dist-BgEySLwo.js";
2
2
  import { getPopupMountTarget as t } from "../Scribe/extension/getPopupMountTarget.js";
3
- import { t as n } from "../../menus-CrKTaPWU.js";
3
+ import { t as n } from "../../menus-D9OsP28c.js";
4
4
  import { Flex as r, IconButton as i } from "@radix-ui/themes";
5
5
  import { useCallback as a } from "react";
6
6
  import { jsx as o } from "react/jsx-runtime";
@@ -1,8 +1,8 @@
1
- import { a as e } from "../../dist-DT3iiwSr.js";
1
+ import { a as e } from "../../dist-BgEySLwo.js";
2
2
  import { getPopupMountTarget as t } from "../Scribe/extension/getPopupMountTarget.js";
3
3
  import n from "./LinkEditor.js";
4
4
  import { hideLinkBubbleMenu as r, linkBubbleMenuPluginKey as i } from "./linkBubbleMenuPlugin.js";
5
- import { t as a } from "../../menus-CrKTaPWU.js";
5
+ import { t as a } from "../../menus-D9OsP28c.js";
6
6
  import { Box as o } from "@radix-ui/themes";
7
7
  import { useCallback as s, useEffect as c, useMemo as l, useRef as u, useState as d } from "react";
8
8
  import { jsx as f } from "react/jsx-runtime";
@@ -39,22 +39,22 @@ var p = ({ editor: p }) => {
39
39
  }, []), x = s(({ editor: e, element: t, from: n, to: r, view: i }) => {
40
40
  let a = t.contains(t.ownerDocument.activeElement);
41
41
  return e.isEditable && n !== r && e.isActive("link") && (i.hasFocus() || a);
42
- }, []);
42
+ }, []), S = s(() => t(p), [p]), C = l(() => ({
43
+ strategy: "fixed",
44
+ placement: "bottom",
45
+ offset: 8,
46
+ flip: {},
47
+ shift: { padding: 8 },
48
+ inline: !0,
49
+ onShow: b
50
+ }), [b]);
43
51
  return /* @__PURE__ */ f(a, {
44
52
  editor: p,
45
53
  pluginKey: i,
46
54
  updateDelay: 0,
47
- appendTo: s(() => t(p), [p]),
55
+ appendTo: S,
48
56
  shouldShow: x,
49
- options: l(() => ({
50
- strategy: "fixed",
51
- placement: "bottom",
52
- offset: 8,
53
- flip: {},
54
- shift: { padding: 8 },
55
- inline: !0,
56
- onShow: b
57
- }), [b]),
57
+ options: C,
58
58
  children: /* @__PURE__ */ f(o, {
59
59
  className: "scribe-link-popover",
60
60
  role: "dialog",
@@ -36,11 +36,11 @@ var f = ({ editor: f, existingHref: p, inputRef: m, onClose: h, onValueChange: g
36
36
  return;
37
37
  }
38
38
  C();
39
- }, [f, C]);
39
+ }, [f, C]), D = o((e) => {
40
+ e.key === "Escape" && (e.preventDefault(), e.stopPropagation(), C());
41
+ }, [C]);
40
42
  return /* @__PURE__ */ u("form", {
41
- onKeyDown: o((e) => {
42
- e.key === "Escape" && (e.preventDefault(), e.stopPropagation(), C());
43
- }, [C]),
43
+ onKeyDown: D,
44
44
  onSubmit: T,
45
45
  children: /* @__PURE__ */ d(r, {
46
46
  direction: "column",
@@ -1 +1 @@
1
- {"version":3,"file":"ListOptionBar.d.ts","sourceRoot":"","sources":["../../../../lib/components/Menu/Mobile/ListOptionBar.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAItC,KAAK,kBAAkB,GAAG;IACxB,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,eAAO,MAAM,aAAa,eAAgB,kBAAkB,uCAiD3D,CAAC"}
1
+ {"version":3,"file":"ListOptionBar.d.ts","sourceRoot":"","sources":["../../../../lib/components/Menu/Mobile/ListOptionBar.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAItC,KAAK,kBAAkB,GAAG;IACxB,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,eAAO,MAAM,aAAa,eAAgB,kBAAkB,uCAoD3D,CAAC"}
@@ -1,4 +1,4 @@
1
- import { a as e } from "../../../dist-DT3iiwSr.js";
1
+ import { a as e } from "../../../dist-BgEySLwo.js";
2
2
  import { Button as t, Flex as n } from "@radix-ui/themes";
3
3
  import { useCallback as r } from "react";
4
4
  import { jsx as i, jsxs as a } from "react/jsx-runtime";
@@ -10,27 +10,33 @@ var o = ({ editor: o }) => {
10
10
  isInsideList: e.isActive("bulletList") || e.isActive("orderedList"),
11
11
  isEditable: e.isEditable
12
12
  } : null
13
- }), c = r((e, t) => {
14
- e.preventDefault(), t();
13
+ }), c = r((e) => {
14
+ e.preventDefault();
15
15
  }, []);
16
16
  return !s?.isInsideList || !s.isEditable ? null : /* @__PURE__ */ a(n, {
17
17
  align: "center",
18
18
  justify: "between",
19
19
  className: "scribe-list-toolbar",
20
20
  gap: "3",
21
+ role: "group",
22
+ "aria-label": "List indentation",
21
23
  children: [/* @__PURE__ */ i(t, {
22
24
  type: "button",
25
+ "aria-label": "Outdent list item",
23
26
  size: "1",
24
27
  variant: "soft",
25
28
  color: "gray",
26
- onMouseDown: (e) => c(e, () => o.chain().focus().liftListItem("listItem").run()),
29
+ onMouseDown: c,
30
+ onClick: () => o.chain().focus().liftListItem("listItem").run(),
27
31
  children: "← Outdent"
28
32
  }), /* @__PURE__ */ i(t, {
29
33
  type: "button",
34
+ "aria-label": "Indent list item",
30
35
  size: "1",
31
36
  variant: "soft",
32
37
  color: "gray",
33
- onMouseDown: (e) => c(e, () => o.chain().focus().sinkListItem("listItem").run()),
38
+ onMouseDown: c,
39
+ onClick: () => o.chain().focus().sinkListItem("listItem").run(),
34
40
  children: "Indent →"
35
41
  })]
36
42
  });
@@ -1,4 +1,4 @@
1
- import { a as e } from "../../dist-CnXCIcnl.js";
1
+ import { a as e } from "../../dist-FrapLVQu.js";
2
2
  //#region lib/components/Menu/linkBubbleMenuPlugin.ts
3
3
  var t = new e("scribeLinkBubbleMenu"), n = (e) => {
4
4
  e.isDestroyed || e.view.dispatch(e.state.tr.setMeta(t, "hide"));
@@ -1 +1 @@
1
- {"version":3,"file":"EmojiList.d.ts","sourceRoot":"","sources":["../../../../../lib/components/Scribe/extension/emoji/EmojiList.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AACvC,OAAO,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AAG5D,UAAU,mBAAmB;IAC3B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,IAAI,EAAE,MAAM,CAAC;CACd;AAED,UAAU,cAAc;IACtB,OAAO,EAAE,CAAC,OAAO,EAAE;QAAE,IAAI,EAAE,MAAM,CAAA;KAAE,KAAK,IAAI,CAAC;IAC7C,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,mBAAmB,EAAE,CAAC;CAC9B;AAED,MAAM,WAAW,YAAY;IAC3B,SAAS,EAAE,CAAC,KAAK,EAAE,sBAAsB,KAAK,OAAO,CAAC;CACvD;AAED,eAAO,MAAM,SAAS,yGA+EpB,CAAC"}
1
+ {"version":3,"file":"EmojiList.d.ts","sourceRoot":"","sources":["../../../../../lib/components/Scribe/extension/emoji/EmojiList.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AACvC,OAAO,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AAG5D,UAAU,mBAAmB;IAC3B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,IAAI,EAAE,MAAM,CAAC;CACd;AAED,UAAU,cAAc;IACtB,OAAO,EAAE,CAAC,OAAO,EAAE;QAAE,IAAI,EAAE,MAAM,CAAA;KAAE,KAAK,IAAI,CAAC;IAC7C,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,mBAAmB,EAAE,CAAC;CAC9B;AAED,MAAM,WAAW,YAAY;IAC3B,SAAS,EAAE,CAAC,KAAK,EAAE,sBAAsB,KAAK,OAAO,CAAC;CACvD;AAED,eAAO,MAAM,SAAS,yGAiFpB,CAAC"}
@@ -5,8 +5,8 @@ import { jsx as o, jsxs as s } from "react/jsx-runtime";
5
5
  var c = r((r, c) => {
6
6
  let { command: l, items: u } = r, [d, f] = a(0), p = u.length === 0 ? 0 : Math.min(d, u.length - 1);
7
7
  return i(c, () => ({ onKeyDown: (e) => {
8
- if (e.event.key === "ArrowUp") return u.length === 0 ? !1 : (f((e) => (e + u.length - 1) % u.length), !0);
9
- if (e.event.key === "ArrowDown") return u.length === 0 ? !1 : (f((e) => (e + 1) % u.length), !0);
8
+ if (e.event.key === "ArrowUp") return u.length !== 0 && (f((e) => (e + u.length - 1) % u.length), !0);
9
+ if (e.event.key === "ArrowDown") return u.length !== 0 && (f((e) => (e + 1) % u.length), !0);
10
10
  if (e.event.key === "Enter") {
11
11
  let e = u[p];
12
12
  return e && l({ name: e.name }), !0;
@@ -25,8 +25,12 @@ var c = r((r, c) => {
25
25
  style: { maxHeight: 240 },
26
26
  children: /* @__PURE__ */ o("div", {
27
27
  className: "scribe-popup-list",
28
+ role: "group",
29
+ "aria-label": "Emoji suggestions",
28
30
  children: u.map((e, t) => /* @__PURE__ */ s("button", {
29
31
  type: "button",
32
+ "aria-current": t === p ? "true" : void 0,
33
+ "aria-label": `Insert ${e.name} emoji`,
30
34
  className: "scribe-popup-item",
31
35
  "data-selected": t === p,
32
36
  onClick: () => l({ name: e.name }),
@@ -1,6 +1,6 @@
1
- import { n as e } from "../../../../dist-DT3iiwSr.js";
1
+ import { n as e } from "../../../../dist-BgEySLwo.js";
2
2
  import { getPopupMountTarget as t } from "../getPopupMountTarget.js";
3
- import { t as n } from "../../../../tippy.esm-D9LL2xiE.js";
3
+ import { t as n } from "../../../../tippy.esm-DOXqN1Qm.js";
4
4
  import { EmojiList as r } from "./EmojiList.js";
5
5
  //#region lib/components/Scribe/extension/emoji/suggest.ts
6
6
  var i = () => ({
@@ -1,2 +1,2 @@
1
- import { t as e } from "../../../extension-link-DZID_SYl.js";
1
+ import { t as e } from "../../../extension-link-CMRfHUc5.js";
2
2
  export { e as default };
@@ -1,6 +1,6 @@
1
- import { a as e, i as t } from "../../../dist-CnXCIcnl.js";
2
- import { n } from "../../../dist-BQjH-i-q.js";
3
- import { n as r, t as i } from "../../../markdown-to-html-DEczPfuq.js";
1
+ import { a as e, i as t } from "../../../dist-FrapLVQu.js";
2
+ import { n } from "../../../dist-BMKyBtRa.js";
3
+ import { n as r, t as i } from "../../../markdown-to-html-DwSNqq2i.js";
4
4
  //#region lib/components/Scribe/extension/extension-markdown-paste.ts
5
5
  var a = new e("markdownPaste"), o = /* @__PURE__ */ new Set([
6
6
  "blockquote",
@@ -35,17 +35,25 @@ var a = new e("markdownPaste"), o = /* @__PURE__ */ new Set([
35
35
  }));
36
36
  }
37
37
  return t.innerHTML;
38
- }, p = n.create({
38
+ }, p = (e, t) => {
39
+ let n = t;
40
+ return e.someProp("transformPastedHTML", (t) => {
41
+ n = t(n, e);
42
+ }), n;
43
+ }, m = n.create({
39
44
  name: "markdownPaste",
40
45
  addProseMirrorPlugins() {
41
46
  return [new t({
42
47
  key: a,
43
48
  props: { handlePaste: (e, t) => {
44
49
  let n = t.clipboardData?.getData("text/html"), r = t.clipboardData?.getData("text/plain");
45
- return !r || n || !u(r) ? !1 : (t.preventDefault(), this.editor.chain().focus().insertContent(f(i(r))).run(), !0);
50
+ if (!r || n || !u(r)) return !1;
51
+ t.preventDefault();
52
+ let a = f(i(r));
53
+ return this.editor.chain().focus().insertContent(p(e, a)).run(), !0;
46
54
  } }
47
55
  })];
48
56
  }
49
57
  });
50
58
  //#endregion
51
- export { p as default };
59
+ export { m as default };
@@ -1,4 +1,4 @@
1
- import { n as e } from "../../../dist-BQjH-i-q.js";
1
+ import { n as e } from "../../../dist-BMKyBtRa.js";
2
2
  //#region lib/components/Scribe/extension/extension-selectedText.ts
3
3
  var t = e.create({
4
4
  name: "SelectedText",
@@ -1,2 +1,2 @@
1
- import { t as e } from "../../../extension-CZOsheCI.js";
1
+ import { t as e } from "../../../extension-BVGWENts.js";
2
2
  export { e as initExtensions };
@@ -1 +1 @@
1
- {"version":3,"file":"SlashCommandList.d.ts","sourceRoot":"","sources":["../../../../../lib/components/Scribe/extension/slashCommand/SlashCommandList.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAI7E,OAAO,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAEzC,MAAM,WAAW,eAAe;IAC9B,SAAS,EAAE,CAAC,KAAK,EAAE,sBAAsB,KAAK,OAAO,CAAC;CACvD;AAID,eAAO,MAAM,gBAAgB;WAF2B,cAAc,EAAE;mDAoHtE,CAAC"}
1
+ {"version":3,"file":"SlashCommandList.d.ts","sourceRoot":"","sources":["../../../../../lib/components/Scribe/extension/slashCommand/SlashCommandList.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAI7E,OAAO,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAEzC,MAAM,WAAW,eAAe;IAC9B,SAAS,EAAE,CAAC,KAAK,EAAE,sBAAsB,KAAK,OAAO,CAAC;CACvD;AAID,eAAO,MAAM,gBAAgB;WAF2B,cAAc,EAAE;mDA0HtE,CAAC"}