@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.
- package/README.md +5 -4
- package/dist/{BarMenu-DC-S5Ggq.js → BarMenu-BG_w4DVo.js} +53 -25
- package/dist/assets/index.css +1 -1
- package/dist/components/Menu/BarMenu.d.ts.map +1 -1
- package/dist/components/Menu/BarMenu.js +1 -1
- package/dist/components/Menu/BubbleMenu.js +2 -2
- package/dist/components/Menu/LinkBubbleMenu.js +13 -13
- package/dist/components/Menu/LinkEditor.js +4 -4
- package/dist/components/Menu/Mobile/ListOptionBar.d.ts.map +1 -1
- package/dist/components/Menu/Mobile/ListOptionBar.js +11 -5
- package/dist/components/Menu/linkBubbleMenuPlugin.js +1 -1
- package/dist/components/Scribe/extension/emoji/EmojiList.d.ts.map +1 -1
- package/dist/components/Scribe/extension/emoji/EmojiList.js +6 -2
- package/dist/components/Scribe/extension/emoji/suggest.js +2 -2
- package/dist/components/Scribe/extension/extension-link.js +1 -1
- package/dist/components/Scribe/extension/extension-markdown-paste.js +14 -6
- package/dist/components/Scribe/extension/extension-selectedText.js +1 -1
- package/dist/components/Scribe/extension/index.js +1 -1
- package/dist/components/Scribe/extension/slashCommand/SlashCommandList.d.ts.map +1 -1
- package/dist/components/Scribe/extension/slashCommand/SlashCommandList.js +948 -943
- package/dist/components/Scribe/extension/slashCommand/index.js +1 -1
- package/dist/components/Scribe/extension/slashCommand/renderItems.js +2 -2
- package/dist/components/Scribe/extension/tableOfContents.js +2 -2
- package/dist/components/Scribe/index.d.ts +2 -0
- package/dist/components/Scribe/index.d.ts.map +1 -1
- package/dist/components/Scribe/index.js +182 -80
- package/dist/{dist-BQjH-i-q.js → dist-BMKyBtRa.js} +112 -105
- package/dist/{dist-DT3iiwSr.js → dist-BgEySLwo.js} +9 -8
- package/dist/{dist-CnXCIcnl.js → dist-FrapLVQu.js} +16 -9
- package/dist/{extension-CZOsheCI.js → extension-BVGWENts.js} +1306 -1300
- package/dist/{extension-link-DZID_SYl.js → extension-link-CMRfHUc5.js} +5 -5
- package/dist/{floating-ui.dom-rih69525.js → floating-ui.dom-CmJ6iBdh.js} +4 -5
- package/dist/{html-to-markdown-CrNOkSye.js → html-to-markdown-Cta7-ssO.js} +3 -2
- package/dist/main.js +2 -2
- package/dist/{markdown-to-html-DEczPfuq.js → markdown-to-html-DwSNqq2i.js} +8 -6
- package/dist/{menus-CrKTaPWU.js → menus-D9OsP28c.js} +8 -8
- package/dist/{purify.es-DF9CW1cl.js → purify.es-CFiLaBu1.js} +1 -1
- package/dist/{slashCommand-B7CRIaKG.js → slashCommand-B6Iz1i0d.js} +5 -8
- package/dist/{tables-CjOC70rm.js → tables-CXpUVKdw.js} +9 -7
- package/dist/{tippy.esm-D9LL2xiE.js → tippy.esm-DOXqN1Qm.js} +2 -7
- package/dist/utils/html-to-markdown.js +1 -1
- package/dist/utils/index.js +4 -4
- package/dist/utils/markdown-to-html.js +1 -1
- 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;
|
|
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-
|
|
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-
|
|
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-
|
|
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-
|
|
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-
|
|
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:
|
|
55
|
+
appendTo: S,
|
|
48
56
|
shouldShow: x,
|
|
49
|
-
options:
|
|
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:
|
|
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,
|
|
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-
|
|
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
|
|
14
|
-
e.preventDefault()
|
|
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:
|
|
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:
|
|
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-
|
|
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,
|
|
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
|
|
9
|
-
if (e.event.key === "ArrowDown") return u.length
|
|
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-
|
|
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-
|
|
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-
|
|
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-
|
|
2
|
-
import { n } from "../../../dist-
|
|
3
|
-
import { n as r, t as i } from "../../../markdown-to-html-
|
|
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 =
|
|
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
|
-
|
|
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 {
|
|
59
|
+
export { m as default };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as e } from "../../../extension-
|
|
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;
|
|
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"}
|