@clevertask/scribe 0.0.15 → 0.1.0

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 (61) hide show
  1. package/README.md +21 -15
  2. package/dist/BarMenu-BDtEfu-R.js +327 -0
  3. package/dist/assets/index.css +1 -1
  4. package/dist/components/Menu/BarMenu.d.ts +0 -1
  5. package/dist/components/Menu/BarMenu.d.ts.map +1 -1
  6. package/dist/components/Menu/BarMenu.js +8 -140
  7. package/dist/components/Menu/BubbleMenu.d.ts.map +1 -1
  8. package/dist/components/Menu/BubbleMenu.js +2070 -159
  9. package/dist/components/Menu/Mobile/ListOptionBar.d.ts.map +1 -1
  10. package/dist/components/Menu/Mobile/ListOptionBar.js +42 -22
  11. package/dist/components/Scribe/extension/emoji/EmojiList.d.ts +19 -1
  12. package/dist/components/Scribe/extension/emoji/EmojiList.d.ts.map +1 -1
  13. package/dist/components/Scribe/extension/emoji/EmojiList.js +42 -42
  14. package/dist/components/Scribe/extension/emoji/suggest.d.ts +2 -4
  15. package/dist/components/Scribe/extension/emoji/suggest.d.ts.map +1 -1
  16. package/dist/components/Scribe/extension/emoji/suggest.js +20 -15
  17. package/dist/components/Scribe/extension/extension-link.js +2 -984
  18. package/dist/components/Scribe/extension/extension-markdown-paste.js +4 -4
  19. package/dist/components/Scribe/extension/extension-selectedText.js +1 -1
  20. package/dist/components/Scribe/extension/getPopupMountTarget.d.ts +3 -0
  21. package/dist/components/Scribe/extension/getPopupMountTarget.d.ts.map +1 -0
  22. package/dist/components/Scribe/extension/getPopupMountTarget.js +16 -0
  23. package/dist/components/Scribe/extension/index.d.ts +1 -1
  24. package/dist/components/Scribe/extension/index.d.ts.map +1 -1
  25. package/dist/components/Scribe/extension/index.js +37047 -34
  26. package/dist/components/Scribe/extension/slashCommand/SlashCommandList.d.ts +4 -1
  27. package/dist/components/Scribe/extension/slashCommand/SlashCommandList.d.ts.map +1 -1
  28. package/dist/components/Scribe/extension/slashCommand/SlashCommandList.js +3732 -14
  29. package/dist/components/Scribe/extension/slashCommand/index.js +2 -2
  30. package/dist/components/Scribe/extension/slashCommand/renderItems.d.ts +1 -1
  31. package/dist/components/Scribe/extension/slashCommand/renderItems.d.ts.map +1 -1
  32. package/dist/components/Scribe/extension/slashCommand/renderItems.js +21 -16
  33. package/dist/components/Scribe/index.d.ts +0 -1
  34. package/dist/components/Scribe/index.d.ts.map +1 -1
  35. package/dist/components/Scribe/index.js +85 -82
  36. package/dist/extension-link-D3eyOFkn.js +1030 -0
  37. package/dist/icons/ToolbarIcons.d.ts +19 -0
  38. package/dist/icons/ToolbarIcons.d.ts.map +1 -0
  39. package/dist/icons/ToolbarIcons.js +135 -0
  40. package/dist/index-DZylq4Bc.js +232 -0
  41. package/dist/index-FY_iYS6i.js +1410 -0
  42. package/dist/index-PJNQPLn5.js +841 -0
  43. package/dist/{index-BKFDqQPh.js → index-hHvpW2H6.js} +6547 -5418
  44. package/dist/main.css +200 -1123
  45. package/dist/main.js +1 -1
  46. package/dist/markdown-to-html-BwS08CTi.js +1135 -0
  47. package/dist/tippy.esm-DLHdsnfG.js +1711 -0
  48. package/dist/utils/create-scribe-editor.d.ts +2 -2
  49. package/dist/utils/create-scribe-editor.d.ts.map +1 -1
  50. package/dist/utils/create-scribe-editor.js +2 -2
  51. package/dist/utils/html-to-markdown.d.ts.map +1 -1
  52. package/dist/utils/html-to-markdown.js +663 -18
  53. package/dist/utils/index.js +1 -1
  54. package/dist/utils/markdown-to-html.js +1 -1
  55. package/package.json +24 -27
  56. package/dist/clsx-OuTLNxxd.js +0 -16
  57. package/dist/index-CL2WLiGu.js +0 -159
  58. package/dist/index-Cxf4VEm1.js +0 -50957
  59. package/dist/index-PzbCrHp0.js +0 -2349
  60. package/dist/markdown-to-html-__93dwok.js +0 -1557
  61. 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.0.15",
3
+ "version": "0.1.0",
4
4
  "private": false,
5
- "description": "A Tiptap-based 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.",
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,42 +36,41 @@
36
36
  "registry": "https://registry.npmjs.org/"
37
37
  },
38
38
  "dependencies": {
39
- "@tiptap/core": "^2.27.2",
40
- "@tiptap/extension-emoji": "^2.27.2",
41
- "@tiptap/extension-focus": "^2.27.2",
42
- "@tiptap/extension-highlight": "^2.27.2",
43
- "@tiptap/extension-image": "^2.27.2",
44
- "@tiptap/extension-link": "^2.27.2",
39
+ "@tiptap/core": "^3.21.0",
40
+ "@tiptap/extension-emoji": "^3.21.0",
41
+ "@tiptap/extension-focus": "^3.21.0",
42
+ "@tiptap/extension-highlight": "^3.21.0",
43
+ "@tiptap/extension-image": "^3.21.0",
44
+ "@tiptap/extension-link": "^3.21.0",
45
45
  "@tiptap/extension-mathematics": "^3.21.0",
46
- "@tiptap/extension-placeholder": "^2.27.2",
47
- "@tiptap/extension-table": "^2.27.2",
48
- "@tiptap/extension-table-cell": "^2.27.2",
49
- "@tiptap/extension-table-header": "^2.27.2",
50
- "@tiptap/extension-table-row": "^2.27.2",
51
- "@tiptap/extension-task-item": "^2.27.2",
52
- "@tiptap/extension-task-list": "^2.27.2",
53
- "@tiptap/extension-typography": "^2.27.2",
54
- "@tiptap/pm": "^2.27.2",
55
- "@tiptap/react": "^2.27.2",
56
- "@tiptap/starter-kit": "^2.27.2",
57
- "@tiptap/suggestion": "^2.27.2",
46
+ "@tiptap/extension-placeholder": "^3.21.0",
47
+ "@tiptap/extension-table": "^3.21.0",
48
+ "@tiptap/extension-table-cell": "^3.21.0",
49
+ "@tiptap/extension-table-header": "^3.21.0",
50
+ "@tiptap/extension-table-row": "^3.21.0",
51
+ "@tiptap/extension-task-item": "^3.21.0",
52
+ "@tiptap/extension-task-list": "^3.21.0",
53
+ "@tiptap/extension-typography": "^3.21.0",
54
+ "@tiptap/pm": "^3.21.0",
55
+ "@tiptap/react": "^3.21.0",
56
+ "@tiptap/starter-kit": "^3.21.0",
57
+ "@tiptap/suggestion": "^3.21.0",
58
58
  "clsx": "^2.1.1",
59
59
  "dompurify": "^3.3.3",
60
60
  "katex": "^0.16.44",
61
- "marked": "^15.0.12",
61
+ "marked": "^17.0.5",
62
62
  "tippy.js": "^6.3.7",
63
63
  "turndown": "^7.2.2"
64
64
  },
65
65
  "devDependencies": {
66
66
  "@eslint/js": "^9.39.4",
67
- "@tailwindcss/typography": "^0.5.19",
67
+ "@radix-ui/themes": "^3.3.0",
68
68
  "@types/lodash": "^4.17.24",
69
69
  "@types/node": "^24.12.0",
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
75
  "eslint-plugin-react-hooks": "^7.0.1",
77
76
  "eslint-plugin-react-refresh": "^0.5.2",
@@ -79,15 +78,13 @@
79
78
  "globals": "^17.4.0",
80
79
  "lodash": "^4.17.23",
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
82
  "typescript-eslint": "^8.57.2",
87
83
  "vite": "^7.3.1",
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": "postcss ./lib/styles/main.css -o ./dist/main.css",
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",
@@ -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
- };
@@ -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
- };