@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
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@clevertask/scribe",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.1.1",
|
|
4
4
|
"private": false,
|
|
5
|
-
"description": "A
|
|
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": [
|
|
7
7
|
"block-based",
|
|
8
8
|
"editor",
|
|
@@ -36,58 +36,55 @@
|
|
|
36
36
|
"registry": "https://registry.npmjs.org/"
|
|
37
37
|
},
|
|
38
38
|
"dependencies": {
|
|
39
|
-
"@tiptap/core": "^
|
|
40
|
-
"@tiptap/extension-emoji": "^
|
|
41
|
-
"@tiptap/extension-focus": "^
|
|
42
|
-
"@tiptap/extension-highlight": "^
|
|
43
|
-
"@tiptap/extension-image": "^
|
|
44
|
-
"@tiptap/extension-link": "^
|
|
45
|
-
"@tiptap/extension-mathematics": "^3.
|
|
46
|
-
"@tiptap/extension-placeholder": "^
|
|
47
|
-
"@tiptap/extension-table": "^
|
|
48
|
-
"@tiptap/extension-table-cell": "^
|
|
49
|
-
"@tiptap/extension-table-header": "^
|
|
50
|
-
"@tiptap/extension-table-row": "^
|
|
51
|
-
"@tiptap/extension-task-item": "^
|
|
52
|
-
"@tiptap/extension-task-list": "^
|
|
53
|
-
"@tiptap/extension-typography": "^
|
|
54
|
-
"@tiptap/pm": "^
|
|
55
|
-
"@tiptap/react": "^
|
|
56
|
-
"@tiptap/starter-kit": "^
|
|
57
|
-
"@tiptap/suggestion": "^
|
|
39
|
+
"@tiptap/core": "^3.22.5",
|
|
40
|
+
"@tiptap/extension-emoji": "^3.22.5",
|
|
41
|
+
"@tiptap/extension-focus": "^3.22.5",
|
|
42
|
+
"@tiptap/extension-highlight": "^3.22.5",
|
|
43
|
+
"@tiptap/extension-image": "^3.22.5",
|
|
44
|
+
"@tiptap/extension-link": "^3.22.5",
|
|
45
|
+
"@tiptap/extension-mathematics": "^3.22.5",
|
|
46
|
+
"@tiptap/extension-placeholder": "^3.22.5",
|
|
47
|
+
"@tiptap/extension-table": "^3.22.5",
|
|
48
|
+
"@tiptap/extension-table-cell": "^3.22.5",
|
|
49
|
+
"@tiptap/extension-table-header": "^3.22.5",
|
|
50
|
+
"@tiptap/extension-table-row": "^3.22.5",
|
|
51
|
+
"@tiptap/extension-task-item": "^3.22.5",
|
|
52
|
+
"@tiptap/extension-task-list": "^3.22.5",
|
|
53
|
+
"@tiptap/extension-typography": "^3.22.5",
|
|
54
|
+
"@tiptap/pm": "^3.22.5",
|
|
55
|
+
"@tiptap/react": "^3.22.5",
|
|
56
|
+
"@tiptap/starter-kit": "^3.22.5",
|
|
57
|
+
"@tiptap/suggestion": "^3.22.5",
|
|
58
58
|
"clsx": "^2.1.1",
|
|
59
|
-
"dompurify": "^3.
|
|
60
|
-
"katex": "^0.16.
|
|
61
|
-
"marked": "^
|
|
59
|
+
"dompurify": "^3.4.1",
|
|
60
|
+
"katex": "^0.16.45",
|
|
61
|
+
"marked": "^17.0.6",
|
|
62
62
|
"tippy.js": "^6.3.7",
|
|
63
|
-
"turndown": "^7.2.
|
|
63
|
+
"turndown": "^7.2.4"
|
|
64
64
|
},
|
|
65
65
|
"devDependencies": {
|
|
66
66
|
"@eslint/js": "^9.39.4",
|
|
67
|
-
"@
|
|
67
|
+
"@radix-ui/themes": "^3.3.0",
|
|
68
68
|
"@types/lodash": "^4.17.24",
|
|
69
|
-
"@types/node": "^24.12.
|
|
69
|
+
"@types/node": "^24.12.2",
|
|
70
70
|
"@types/react": "^19.2.14",
|
|
71
71
|
"@types/react-dom": "^19.2.3",
|
|
72
72
|
"@types/turndown": "^5.0.6",
|
|
73
73
|
"@vitejs/plugin-react": "^5.2.0",
|
|
74
|
-
"autoprefixer": "^10.4.27",
|
|
75
74
|
"eslint": "^9.39.4",
|
|
76
|
-
"eslint-plugin-react-hooks": "^7.
|
|
75
|
+
"eslint-plugin-react-hooks": "^7.1.1",
|
|
77
76
|
"eslint-plugin-react-refresh": "^0.5.2",
|
|
78
77
|
"glob": "^13.0.6",
|
|
79
|
-
"globals": "^17.
|
|
80
|
-
"lodash": "^4.
|
|
78
|
+
"globals": "^17.5.0",
|
|
79
|
+
"lodash": "^4.18.1",
|
|
81
80
|
"oxfmt": "^0.37.0",
|
|
82
|
-
"postcss": "^8.5.8",
|
|
83
|
-
"postcss-cli": "^11.0.1",
|
|
84
|
-
"tailwindcss": "^3.4.19",
|
|
85
81
|
"typescript": "~5.9.3",
|
|
86
|
-
"typescript-eslint": "^8.
|
|
87
|
-
"vite": "^7.3.
|
|
82
|
+
"typescript-eslint": "^8.59.1",
|
|
83
|
+
"vite": "^7.3.2",
|
|
88
84
|
"vite-plugin-lib-inject-css": "^2.2.2"
|
|
89
85
|
},
|
|
90
86
|
"peerDependencies": {
|
|
87
|
+
"@radix-ui/themes": ">=3.3.0",
|
|
91
88
|
"react": ">=18.3.1 <20.0.0",
|
|
92
89
|
"react-dom": ">=18.3.1 <20.0.0"
|
|
93
90
|
},
|
|
@@ -95,7 +92,7 @@
|
|
|
95
92
|
"scripts": {
|
|
96
93
|
"dev": "vite",
|
|
97
94
|
"build": "vite build && npm run build:style && tsc -p tsconfig.types.json --noCheck",
|
|
98
|
-
"build:style": "
|
|
95
|
+
"build:style": "mkdir -p ./dist && cp ./lib/styles/main.css ./dist/main.css",
|
|
99
96
|
"lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
|
|
100
97
|
"preview": "vite preview",
|
|
101
98
|
"fmt": "oxfmt",
|
package/dist/clsx-OuTLNxxd.js
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
function a(r) {
|
|
2
|
-
var f, n, t = "";
|
|
3
|
-
if (typeof r == "string" || typeof r == "number") t += r;
|
|
4
|
-
else if (typeof r == "object") if (Array.isArray(r)) {
|
|
5
|
-
var o = r.length;
|
|
6
|
-
for (f = 0; f < o; f++) r[f] && (n = a(r[f])) && (t && (t += " "), t += n);
|
|
7
|
-
} else for (n in r) r[n] && (t && (t += " "), t += n);
|
|
8
|
-
return t;
|
|
9
|
-
}
|
|
10
|
-
function i() {
|
|
11
|
-
for (var r, f, n = 0, t = "", o = arguments.length; n < o; n++) (r = arguments[n]) && (f = a(r)) && (t && (t += " "), t += f);
|
|
12
|
-
return t;
|
|
13
|
-
}
|
|
14
|
-
export {
|
|
15
|
-
i as c
|
|
16
|
-
};
|
package/dist/index-CL2WLiGu.js
DELETED
|
@@ -1,159 +0,0 @@
|
|
|
1
|
-
import { P as L, b as U, D as z, c as G, e as H, a as J } from "./index-BKFDqQPh.js";
|
|
2
|
-
function Q(y) {
|
|
3
|
-
var i;
|
|
4
|
-
const { char: f, allowSpaces: D, allowToIncludeChar: I, allowedPrefixes: v, startOfLine: K, $position: g } = y, P = D && !I, m = H(f), B = new RegExp(`\\s${m}$`), C = K ? "^" : "", M = I ? "" : m, S = P ? new RegExp(`${C}${m}.*?(?=\\s${M}|$)`, "gm") : new RegExp(`${C}(?:^)?${m}[^\\s${M}]*`, "gm"), p = ((i = g.nodeBefore) === null || i === void 0 ? void 0 : i.isText) && g.nodeBefore.text;
|
|
5
|
-
if (!p)
|
|
6
|
-
return null;
|
|
7
|
-
const k = g.pos - p.length, n = Array.from(p.matchAll(S)).pop();
|
|
8
|
-
if (!n || n.input === void 0 || n.index === void 0)
|
|
9
|
-
return null;
|
|
10
|
-
const e = n.input.slice(Math.max(0, n.index - 1), n.index), $ = new RegExp(`^[${v?.join("")}\0]?$`).test(e);
|
|
11
|
-
if (v !== null && !$)
|
|
12
|
-
return null;
|
|
13
|
-
const o = k + n.index;
|
|
14
|
-
let a = o + n[0].length;
|
|
15
|
-
return P && B.test(p.slice(a - 1, a + 1)) && (n[0] += " ", a += 1), o < g.pos && a >= g.pos ? {
|
|
16
|
-
range: {
|
|
17
|
-
from: o,
|
|
18
|
-
to: a
|
|
19
|
-
},
|
|
20
|
-
query: n[0].slice(f.length),
|
|
21
|
-
text: n[0]
|
|
22
|
-
} : null;
|
|
23
|
-
}
|
|
24
|
-
const V = new L("suggestion");
|
|
25
|
-
function W({ pluginKey: y = V, editor: i, char: f = "@", allowSpaces: D = !1, allowToIncludeChar: I = !1, allowedPrefixes: v = [" "], startOfLine: K = !1, decorationTag: g = "span", decorationClass: P = "suggestion", decorationContent: m = "", decorationEmptyClass: B = "is-empty", command: C = () => null, items: M = () => [], render: S = () => ({}), allow: p = () => !0, findSuggestionMatch: k = Q }) {
|
|
26
|
-
let n;
|
|
27
|
-
const e = S?.(), $ = new U({
|
|
28
|
-
key: y,
|
|
29
|
-
view() {
|
|
30
|
-
return {
|
|
31
|
-
update: async (o, a) => {
|
|
32
|
-
var l, c, r, u, d, w, h;
|
|
33
|
-
const t = (l = this.key) === null || l === void 0 ? void 0 : l.getState(a), s = (c = this.key) === null || c === void 0 ? void 0 : c.getState(o.state), q = t.active && s.active && t.range.from !== s.range.from, b = !t.active && s.active, j = t.active && !s.active, A = !b && !j && t.query !== s.query, _ = b || q && A, R = A || q, N = j || q && A;
|
|
34
|
-
if (!_ && !R && !N)
|
|
35
|
-
return;
|
|
36
|
-
const x = N && !_ ? t : s, F = o.dom.querySelector(`[data-decoration-id="${x.decorationId}"]`);
|
|
37
|
-
n = {
|
|
38
|
-
editor: i,
|
|
39
|
-
range: x.range,
|
|
40
|
-
query: x.query,
|
|
41
|
-
text: x.text,
|
|
42
|
-
items: [],
|
|
43
|
-
command: (E) => C({
|
|
44
|
-
editor: i,
|
|
45
|
-
range: x.range,
|
|
46
|
-
props: E
|
|
47
|
-
}),
|
|
48
|
-
decorationNode: F,
|
|
49
|
-
// virtual node for popper.js or tippy.js
|
|
50
|
-
// this can be used for building popups without a DOM node
|
|
51
|
-
clientRect: F ? () => {
|
|
52
|
-
var E;
|
|
53
|
-
const { decorationId: T } = (E = this.key) === null || E === void 0 ? void 0 : E.getState(i.state), O = o.dom.querySelector(`[data-decoration-id="${T}"]`);
|
|
54
|
-
return O?.getBoundingClientRect() || null;
|
|
55
|
-
} : null
|
|
56
|
-
}, _ && ((r = e?.onBeforeStart) === null || r === void 0 || r.call(e, n)), R && ((u = e?.onBeforeUpdate) === null || u === void 0 || u.call(e, n)), (R || _) && (n.items = await M({
|
|
57
|
-
editor: i,
|
|
58
|
-
query: x.query
|
|
59
|
-
})), N && ((d = e?.onExit) === null || d === void 0 || d.call(e, n)), R && ((w = e?.onUpdate) === null || w === void 0 || w.call(e, n)), _ && ((h = e?.onStart) === null || h === void 0 || h.call(e, n));
|
|
60
|
-
},
|
|
61
|
-
destroy: () => {
|
|
62
|
-
var o;
|
|
63
|
-
n && ((o = e?.onExit) === null || o === void 0 || o.call(e, n));
|
|
64
|
-
}
|
|
65
|
-
};
|
|
66
|
-
},
|
|
67
|
-
state: {
|
|
68
|
-
// Initialize the plugin's internal state.
|
|
69
|
-
init() {
|
|
70
|
-
return {
|
|
71
|
-
active: !1,
|
|
72
|
-
range: {
|
|
73
|
-
from: 0,
|
|
74
|
-
to: 0
|
|
75
|
-
},
|
|
76
|
-
query: null,
|
|
77
|
-
text: null,
|
|
78
|
-
composing: !1
|
|
79
|
-
};
|
|
80
|
-
},
|
|
81
|
-
// Apply changes to the plugin state from a view transaction.
|
|
82
|
-
apply(o, a, l, c) {
|
|
83
|
-
const { isEditable: r } = i, { composing: u } = i.view, { selection: d } = o, { empty: w, from: h } = d, t = { ...a };
|
|
84
|
-
if (t.composing = u, r && (w || i.view.composing)) {
|
|
85
|
-
(h < a.range.from || h > a.range.to) && !u && !a.composing && (t.active = !1);
|
|
86
|
-
const s = k({
|
|
87
|
-
char: f,
|
|
88
|
-
allowSpaces: D,
|
|
89
|
-
allowToIncludeChar: I,
|
|
90
|
-
allowedPrefixes: v,
|
|
91
|
-
startOfLine: K,
|
|
92
|
-
$position: d.$from
|
|
93
|
-
}), q = `id_${Math.floor(Math.random() * 4294967295)}`;
|
|
94
|
-
s && p({
|
|
95
|
-
editor: i,
|
|
96
|
-
state: c,
|
|
97
|
-
range: s.range,
|
|
98
|
-
isActive: a.active
|
|
99
|
-
}) ? (t.active = !0, t.decorationId = a.decorationId ? a.decorationId : q, t.range = s.range, t.query = s.query, t.text = s.text) : t.active = !1;
|
|
100
|
-
} else
|
|
101
|
-
t.active = !1;
|
|
102
|
-
return t.active || (t.decorationId = null, t.range = { from: 0, to: 0 }, t.query = null, t.text = null), t;
|
|
103
|
-
}
|
|
104
|
-
},
|
|
105
|
-
props: {
|
|
106
|
-
// Call the keydown hook if suggestion is active.
|
|
107
|
-
handleKeyDown(o, a) {
|
|
108
|
-
var l;
|
|
109
|
-
const { active: c, range: r } = $.getState(o.state);
|
|
110
|
-
return c && ((l = e?.onKeyDown) === null || l === void 0 ? void 0 : l.call(e, { view: o, event: a, range: r })) || !1;
|
|
111
|
-
},
|
|
112
|
-
// Setup decorator on the currently active suggestion.
|
|
113
|
-
decorations(o) {
|
|
114
|
-
const { active: a, range: l, decorationId: c, query: r } = $.getState(o);
|
|
115
|
-
if (!a)
|
|
116
|
-
return null;
|
|
117
|
-
const u = !r?.length, d = [P];
|
|
118
|
-
return u && d.push(B), z.create(o.doc, [
|
|
119
|
-
G.inline(l.from, l.to, {
|
|
120
|
-
nodeName: g,
|
|
121
|
-
class: d.join(" "),
|
|
122
|
-
"data-decoration-id": c,
|
|
123
|
-
"data-decoration-content": m
|
|
124
|
-
})
|
|
125
|
-
]);
|
|
126
|
-
}
|
|
127
|
-
}
|
|
128
|
-
});
|
|
129
|
-
return $;
|
|
130
|
-
}
|
|
131
|
-
const X = new L("slashSuggestion"), Z = J.create({
|
|
132
|
-
name: "slashCommand",
|
|
133
|
-
addOptions() {
|
|
134
|
-
return {
|
|
135
|
-
...this.parent?.(),
|
|
136
|
-
slashSuggestion: {
|
|
137
|
-
char: "/",
|
|
138
|
-
startOfLine: !0,
|
|
139
|
-
command: ({ editor: y, range: i, props: f }) => {
|
|
140
|
-
f.command({ editor: y, range: i, props: f });
|
|
141
|
-
}
|
|
142
|
-
}
|
|
143
|
-
};
|
|
144
|
-
},
|
|
145
|
-
addProseMirrorPlugins() {
|
|
146
|
-
return [
|
|
147
|
-
W({
|
|
148
|
-
pluginKey: X,
|
|
149
|
-
...this.options.slashSuggestion,
|
|
150
|
-
editor: this.editor
|
|
151
|
-
})
|
|
152
|
-
];
|
|
153
|
-
}
|
|
154
|
-
});
|
|
155
|
-
export {
|
|
156
|
-
Z as S,
|
|
157
|
-
W as a,
|
|
158
|
-
X as s
|
|
159
|
-
};
|