@clevertask/scribe 0.0.15 → 0.1.1
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 +77 -27
- package/dist/BarMenu-DaKIz3zZ.js +327 -0
- package/dist/assets/index.css +1 -1
- package/dist/components/Menu/BarMenu.d.ts +0 -1
- package/dist/components/Menu/BarMenu.d.ts.map +1 -1
- package/dist/components/Menu/BarMenu.js +8 -140
- package/dist/components/Menu/BubbleMenu.d.ts.map +1 -1
- package/dist/components/Menu/BubbleMenu.js +2074 -159
- package/dist/components/Menu/Mobile/ListOptionBar.d.ts.map +1 -1
- package/dist/components/Menu/Mobile/ListOptionBar.js +42 -22
- package/dist/components/Scribe/extension/emoji/EmojiList.d.ts +19 -1
- package/dist/components/Scribe/extension/emoji/EmojiList.d.ts.map +1 -1
- package/dist/components/Scribe/extension/emoji/EmojiList.js +42 -42
- package/dist/components/Scribe/extension/emoji/suggest.d.ts +2 -4
- package/dist/components/Scribe/extension/emoji/suggest.d.ts.map +1 -1
- package/dist/components/Scribe/extension/emoji/suggest.js +20 -15
- package/dist/components/Scribe/extension/extension-link.js +2 -984
- package/dist/components/Scribe/extension/extension-markdown-paste.js +4 -4
- package/dist/components/Scribe/extension/extension-selectedText.js +1 -1
- package/dist/components/Scribe/extension/getPopupMountTarget.d.ts +3 -0
- package/dist/components/Scribe/extension/getPopupMountTarget.d.ts.map +1 -0
- package/dist/components/Scribe/extension/getPopupMountTarget.js +16 -0
- package/dist/components/Scribe/extension/index.d.ts +16 -2
- package/dist/components/Scribe/extension/index.d.ts.map +1 -1
- package/dist/components/Scribe/extension/index.js +37122 -34
- package/dist/components/Scribe/extension/slashCommand/SlashCommandList.d.ts +4 -1
- package/dist/components/Scribe/extension/slashCommand/SlashCommandList.d.ts.map +1 -1
- package/dist/components/Scribe/extension/slashCommand/SlashCommandList.js +3730 -14
- package/dist/components/Scribe/extension/slashCommand/index.js +2 -2
- package/dist/components/Scribe/extension/slashCommand/renderItems.d.ts +1 -1
- package/dist/components/Scribe/extension/slashCommand/renderItems.d.ts.map +1 -1
- package/dist/components/Scribe/extension/slashCommand/renderItems.js +21 -16
- package/dist/components/Scribe/extension/tableOfContents.d.ts +48 -0
- package/dist/components/Scribe/extension/tableOfContents.d.ts.map +1 -0
- package/dist/components/Scribe/extension/tableOfContents.js +180 -0
- package/dist/components/Scribe/index.d.ts +12 -1
- package/dist/components/Scribe/index.d.ts.map +1 -1
- package/dist/components/Scribe/index.js +133 -87
- package/dist/extension-link-Ch_T7WWG.js +1030 -0
- package/dist/icons/ToolbarIcons.d.ts +19 -0
- package/dist/icons/ToolbarIcons.d.ts.map +1 -0
- package/dist/icons/ToolbarIcons.js +135 -0
- package/dist/{index-BKFDqQPh.js → index-BiBV5TQx.js} +6598 -5432
- package/dist/index-CqzMmrnw.js +1410 -0
- package/dist/index-DxF-1P4n.js +834 -0
- package/dist/index-V-gN11Y9.js +249 -0
- package/dist/main.css +200 -1123
- package/dist/main.js +1 -1
- package/dist/markdown-to-html-pL7ckd-m.js +1135 -0
- package/dist/purify.es-exIQuqhb.js +595 -0
- package/dist/tippy.esm-DLHdsnfG.js +1711 -0
- package/dist/utils/create-scribe-editor.d.ts +2 -2
- package/dist/utils/create-scribe-editor.d.ts.map +1 -1
- package/dist/utils/create-scribe-editor.js +3 -3
- package/dist/utils/html-to-markdown.d.ts.map +1 -1
- package/dist/utils/html-to-markdown.js +583 -18
- package/dist/utils/index.js +1 -1
- package/dist/utils/markdown-to-html.js +2 -2
- package/package.json +34 -37
- package/dist/clsx-OuTLNxxd.js +0 -16
- package/dist/index-CL2WLiGu.js +0 -159
- package/dist/index-Cxf4VEm1.js +0 -50957
- package/dist/index-PzbCrHp0.js +0 -2349
- package/dist/markdown-to-html-__93dwok.js +0 -1557
- package/dist/purify.es-BPDBzHtc.js +0 -552
- package/dist/turndown.browser.es-RmA_HBaI.js +0 -649
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ListOptionBar.d.ts","sourceRoot":"","sources":["../../../../lib/components/Menu/Mobile/ListOptionBar.tsx"],"names":[],"mappings":"
|
|
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,GAAI,YAAY,kBAAkB,mDAiD3D,CAAC"}
|
|
@@ -1,25 +1,45 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
})
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
paddingTop: "0rem"
|
|
1
|
+
import { jsxs as l, jsx as n } from "react/jsx-runtime";
|
|
2
|
+
import { Flex as a, Button as r } from "@radix-ui/themes";
|
|
3
|
+
import { u } from "../../../index-DxF-1P4n.js";
|
|
4
|
+
import { useCallback as c } from "react";
|
|
5
|
+
const p = ({ editor: e }) => {
|
|
6
|
+
const i = u({
|
|
7
|
+
editor: e,
|
|
8
|
+
selector: ({ editor: t }) => t ? {
|
|
9
|
+
isInsideList: t.isActive("bulletList") || t.isActive("orderedList"),
|
|
10
|
+
isEditable: t.isEditable
|
|
11
|
+
} : null
|
|
12
|
+
}), s = c(
|
|
13
|
+
(t, o) => {
|
|
14
|
+
t.preventDefault(), o();
|
|
16
15
|
},
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
16
|
+
[]
|
|
17
|
+
);
|
|
18
|
+
return !i?.isInsideList || !i.isEditable ? null : /* @__PURE__ */ l(a, { align: "center", justify: "between", className: "scribe-list-toolbar", gap: "3", children: [
|
|
19
|
+
/* @__PURE__ */ n(
|
|
20
|
+
r,
|
|
21
|
+
{
|
|
22
|
+
type: "button",
|
|
23
|
+
size: "1",
|
|
24
|
+
variant: "soft",
|
|
25
|
+
color: "gray",
|
|
26
|
+
onMouseDown: (t) => s(t, () => e.chain().focus().liftListItem("listItem").run()),
|
|
27
|
+
children: "← Outdent"
|
|
28
|
+
}
|
|
29
|
+
),
|
|
30
|
+
/* @__PURE__ */ n(
|
|
31
|
+
r,
|
|
32
|
+
{
|
|
33
|
+
type: "button",
|
|
34
|
+
size: "1",
|
|
35
|
+
variant: "soft",
|
|
36
|
+
color: "gray",
|
|
37
|
+
onMouseDown: (t) => s(t, () => e.chain().focus().sinkListItem("listItem").run()),
|
|
38
|
+
children: "Indent →"
|
|
39
|
+
}
|
|
40
|
+
)
|
|
41
|
+
] });
|
|
42
|
+
};
|
|
23
43
|
export {
|
|
24
|
-
|
|
44
|
+
p as ListOptionBar
|
|
25
45
|
};
|
|
@@ -1,2 +1,20 @@
|
|
|
1
|
-
|
|
1
|
+
import { Editor } from "@tiptap/react";
|
|
2
|
+
import { SuggestionKeyDownProps } from "@tiptap/suggestion";
|
|
3
|
+
interface EmojiSuggestionItem {
|
|
4
|
+
emoji?: string;
|
|
5
|
+
fallbackImage?: string;
|
|
6
|
+
name: string;
|
|
7
|
+
}
|
|
8
|
+
interface EmojiListProps {
|
|
9
|
+
command: (payload: {
|
|
10
|
+
name: string;
|
|
11
|
+
}) => void;
|
|
12
|
+
editor: Editor;
|
|
13
|
+
items: EmojiSuggestionItem[];
|
|
14
|
+
}
|
|
15
|
+
export interface EmojiListRef {
|
|
16
|
+
onKeyDown: (props: SuggestionKeyDownProps) => boolean;
|
|
17
|
+
}
|
|
18
|
+
export declare const EmojiList: import("react").ForwardRefExoticComponent<EmojiListProps & import("react").RefAttributes<EmojiListRef>>;
|
|
19
|
+
export {};
|
|
2
20
|
//# sourceMappingURL=EmojiList.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EmojiList.d.ts","sourceRoot":"","sources":["../../../../../lib/components/Scribe/extension/emoji/EmojiList.tsx"],"names":[],"mappings":"
|
|
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,46 +1,46 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import {
|
|
3
|
-
import { forwardRef as
|
|
4
|
-
const
|
|
5
|
-
const [
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
}), [l, s, d]), /* @__PURE__ */ c(
|
|
18
|
-
"div",
|
|
19
|
-
{
|
|
20
|
-
className: i(
|
|
21
|
-
t.darkMode ? "dark:bg-gray-800" : "bg-white",
|
|
22
|
-
"p-3",
|
|
23
|
-
"rounded-md",
|
|
24
|
-
"shadow-md"
|
|
25
|
-
),
|
|
26
|
-
children: t.items.map((e, r) => /* @__PURE__ */ f(
|
|
27
|
-
"button",
|
|
28
|
-
{
|
|
29
|
-
className: r === n ? i(t.darkMode ? "dark:bg-gray-700" : "bg-gray-200", "w-full", "p-1") : "",
|
|
30
|
-
style: { display: "flex", alignItems: "center", gap: ".5rem" },
|
|
31
|
-
onClick: () => m(r),
|
|
32
|
-
children: [
|
|
33
|
-
e.fallbackImage ? /* @__PURE__ */ c("img", { style: { width: "1rem", height: "1rem" }, src: e.fallbackImage }) : e.emoji,
|
|
34
|
-
":",
|
|
35
|
-
e.name,
|
|
36
|
-
":"
|
|
37
|
-
]
|
|
38
|
-
},
|
|
39
|
-
r
|
|
40
|
-
))
|
|
1
|
+
import { jsx as n, jsxs as i } from "react/jsx-runtime";
|
|
2
|
+
import { Box as d, ScrollArea as u, Text as h } from "@radix-ui/themes";
|
|
3
|
+
import { forwardRef as p, useState as f, useImperativeHandle as g } from "react";
|
|
4
|
+
const w = p((o, c) => {
|
|
5
|
+
const { command: l, items: e } = o, [m, s] = f(0), a = e.length === 0 ? 0 : Math.min(m, e.length - 1);
|
|
6
|
+
return g(c, () => ({
|
|
7
|
+
onKeyDown: (t) => {
|
|
8
|
+
if (t.event.key === "ArrowUp")
|
|
9
|
+
return e.length === 0 ? !1 : (s((r) => (r + e.length - 1) % e.length), !0);
|
|
10
|
+
if (t.event.key === "ArrowDown")
|
|
11
|
+
return e.length === 0 ? !1 : (s((r) => (r + 1) % e.length), !0);
|
|
12
|
+
if (t.event.key === "Enter") {
|
|
13
|
+
const r = e[a];
|
|
14
|
+
return r && l({ name: r.name }), !0;
|
|
15
|
+
}
|
|
16
|
+
return !1;
|
|
41
17
|
}
|
|
42
|
-
)
|
|
18
|
+
}), [l, e, a]), e.length === 0 ? null : /* @__PURE__ */ n(d, { className: "scribe-popup", style: { width: 240 }, children: /* @__PURE__ */ n(u, { type: "auto", scrollbars: "vertical", style: { maxHeight: 240 }, children: /* @__PURE__ */ n("div", { className: "scribe-popup-list", children: e.map((t, r) => /* @__PURE__ */ i(
|
|
19
|
+
"button",
|
|
20
|
+
{
|
|
21
|
+
type: "button",
|
|
22
|
+
className: "scribe-popup-item",
|
|
23
|
+
"data-selected": r === a,
|
|
24
|
+
onClick: () => l({ name: t.name }),
|
|
25
|
+
children: [
|
|
26
|
+
/* @__PURE__ */ n("span", { className: "scribe-emoji-preview", "aria-hidden": "true", children: t.fallbackImage ? /* @__PURE__ */ n(
|
|
27
|
+
"img",
|
|
28
|
+
{
|
|
29
|
+
alt: "",
|
|
30
|
+
src: t.fallbackImage,
|
|
31
|
+
style: { display: "block", height: 18, width: 18 }
|
|
32
|
+
}
|
|
33
|
+
) : t.emoji }),
|
|
34
|
+
/* @__PURE__ */ i(h, { size: "2", children: [
|
|
35
|
+
":",
|
|
36
|
+
t.name,
|
|
37
|
+
":"
|
|
38
|
+
] })
|
|
39
|
+
]
|
|
40
|
+
},
|
|
41
|
+
t.name
|
|
42
|
+
)) }) }) });
|
|
43
43
|
});
|
|
44
44
|
export {
|
|
45
|
-
|
|
45
|
+
w as EmojiList
|
|
46
46
|
};
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
declare const _default: (
|
|
2
|
-
darkMode: any;
|
|
3
|
-
}) => {
|
|
1
|
+
declare const _default: () => {
|
|
4
2
|
items: ({ editor, query }: {
|
|
5
3
|
editor: any;
|
|
6
4
|
query: any;
|
|
@@ -9,7 +7,7 @@ declare const _default: ({ darkMode }: {
|
|
|
9
7
|
render: () => {
|
|
10
8
|
onStart: (props: any) => void;
|
|
11
9
|
onUpdate(props: any): void;
|
|
12
|
-
onKeyDown(props: any):
|
|
10
|
+
onKeyDown(props: any): boolean;
|
|
13
11
|
onExit(): void;
|
|
14
12
|
};
|
|
15
13
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"suggest.d.ts","sourceRoot":"","sources":["../../../../../lib/components/Scribe/extension/emoji/suggest.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"suggest.d.ts","sourceRoot":"","sources":["../../../../../lib/components/Scribe/extension/emoji/suggest.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAMA,wBAuEG"}
|
|
@@ -1,39 +1,44 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { t as i } from "../../../../tippy.esm-DLHdsnfG.js";
|
|
2
|
+
import { R as a } from "../../../../index-DxF-1P4n.js";
|
|
3
|
+
import { getPopupMountTarget as s } from "../getPopupMountTarget.js";
|
|
2
4
|
import { EmojiList as c } from "./EmojiList.js";
|
|
3
|
-
const
|
|
4
|
-
items: ({ editor:
|
|
5
|
+
const u = () => ({
|
|
6
|
+
items: ({ editor: r, query: t }) => r.storage.emoji.emojis.filter(({ shortcodes: e, tags: o }) => e.find((n) => n.startsWith(t.toLowerCase())) || o.find((n) => n.startsWith(t.toLowerCase()))).slice(0, 5),
|
|
5
7
|
allowSpaces: !1,
|
|
6
8
|
render: () => {
|
|
7
|
-
let
|
|
9
|
+
let r, t = null;
|
|
8
10
|
return {
|
|
9
11
|
onStart: (e) => {
|
|
10
|
-
|
|
11
|
-
props:
|
|
12
|
+
e.clientRect && (r = new a(c, {
|
|
13
|
+
props: e,
|
|
12
14
|
editor: e.editor
|
|
13
|
-
}),
|
|
15
|
+
}), t = i(e.editor.view.dom, {
|
|
14
16
|
getReferenceClientRect: e.clientRect,
|
|
15
|
-
appendTo: ()
|
|
16
|
-
content:
|
|
17
|
+
appendTo: s(e.editor),
|
|
18
|
+
content: r.element,
|
|
19
|
+
popperOptions: {
|
|
20
|
+
strategy: "fixed"
|
|
21
|
+
},
|
|
17
22
|
showOnCreate: !0,
|
|
18
23
|
interactive: !0,
|
|
19
24
|
trigger: "manual",
|
|
20
25
|
placement: "bottom-start"
|
|
21
|
-
});
|
|
26
|
+
}));
|
|
22
27
|
},
|
|
23
28
|
onUpdate(e) {
|
|
24
|
-
t.updateProps(e),
|
|
29
|
+
!r || !t || !e.clientRect || (r.updateProps(e), t.setProps({
|
|
25
30
|
getReferenceClientRect: e.clientRect
|
|
26
|
-
});
|
|
31
|
+
}));
|
|
27
32
|
},
|
|
28
33
|
onKeyDown(e) {
|
|
29
|
-
return e.event.key === "Escape" ? (
|
|
34
|
+
return e.event.key === "Escape" && t ? (t.hide(), !0) : r?.ref?.onKeyDown(e) ?? !1;
|
|
30
35
|
},
|
|
31
36
|
onExit() {
|
|
32
|
-
|
|
37
|
+
t?.destroy(), r?.destroy();
|
|
33
38
|
}
|
|
34
39
|
};
|
|
35
40
|
}
|
|
36
41
|
});
|
|
37
42
|
export {
|
|
38
|
-
|
|
43
|
+
u as default
|
|
39
44
|
};
|