@clevertask/scribe 0.0.14 → 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.
- package/README.md +26 -25
- package/dist/BarMenu-BDtEfu-R.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 -119
- package/dist/components/Menu/BubbleMenu.d.ts.map +1 -1
- package/dist/components/Menu/BubbleMenu.js +2070 -159
- package/dist/components/Menu/Mobile/ListOptionBar.d.ts.map +1 -1
- package/dist/components/Menu/Mobile/ListOptionBar.js +42 -34
- 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 +38 -27
- 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.d.ts.map +1 -1
- package/dist/components/Scribe/extension/extension-link.js +2 -986
- package/dist/components/Scribe/extension/extension-markdown-paste.d.ts +4 -0
- package/dist/components/Scribe/extension/extension-markdown-paste.d.ts.map +1 -0
- package/dist/components/Scribe/extension/extension-markdown-paste.js +46 -0
- 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 +1 -1
- package/dist/components/Scribe/extension/index.d.ts.map +1 -1
- package/dist/components/Scribe/extension/index.js +37047 -32
- 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 +3732 -13
- package/dist/components/Scribe/extension/slashCommand/index.js +2 -2
- package/dist/components/Scribe/extension/slashCommand/items.d.ts.map +1 -1
- 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/index.d.ts +0 -1
- package/dist/components/Scribe/index.d.ts.map +1 -1
- package/dist/components/Scribe/index.js +83 -90
- package/dist/extension-link-D3eyOFkn.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-DZylq4Bc.js +232 -0
- package/dist/index-FY_iYS6i.js +1410 -0
- package/dist/index-PJNQPLn5.js +841 -0
- package/dist/{index-flsxByQS.js → index-hHvpW2H6.js} +6552 -5417
- package/dist/main.css +200 -1120
- package/dist/main.js +1 -1
- package/dist/markdown-to-html-BwS08CTi.js +1135 -0
- package/dist/{purify.es-BRDuGiV2.js → purify.es-BPDBzHtc.js} +1 -1
- package/dist/tippy.esm-DLHdsnfG.js +1711 -0
- package/dist/utils/convert-legacy-math-delimiters.d.ts.map +1 -1
- package/dist/utils/create-scribe-editor.d.ts +3 -3
- package/dist/utils/create-scribe-editor.d.ts.map +1 -1
- package/dist/utils/create-scribe-editor.js +8 -4
- package/dist/utils/html-to-markdown.d.ts.map +1 -1
- package/dist/utils/html-to-markdown.js +663 -18
- package/dist/utils/index.d.ts +1 -1
- package/dist/utils/index.js +3 -3
- package/dist/utils/markdown-to-html.js +3 -4
- package/package.json +59 -62
- package/dist/clsx-OuTLNxxd.js +0 -16
- package/dist/index-BfaHEr44.js +0 -159
- package/dist/index-Bvgjhwaj.js +0 -2349
- package/dist/index-DAuPG8ME.js +0 -50919
- package/dist/marked.esm-H7n4rMcO.js +0 -1554
- package/dist/turndown.browser.es-RmA_HBaI.js +0 -649
package/dist/utils/index.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { html2md as o } from "./html-to-markdown.js";
|
|
2
|
-
import {
|
|
2
|
+
import { m } from "../markdown-to-html-BwS08CTi.js";
|
|
3
3
|
import { isInViewport as p } from "./is-in-viewport.js";
|
|
4
4
|
import { convertLegacyMathDelimiters as x } from "./convert-legacy-math-delimiters.js";
|
|
5
|
-
import { createScribeEditor as
|
|
5
|
+
import { createScribeEditor as c } from "./create-scribe-editor.js";
|
|
6
6
|
export {
|
|
7
7
|
x as convertLegacyMathDelimiters,
|
|
8
|
-
|
|
8
|
+
c as createScribeEditor,
|
|
9
9
|
o as html2md,
|
|
10
10
|
p as isInViewport,
|
|
11
11
|
m as md2html
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { m as
|
|
2
|
-
import
|
|
3
|
-
const p = (m) => a.sanitize(r.parse(m, { async: !1 }));
|
|
1
|
+
import { m as t } from "../markdown-to-html-BwS08CTi.js";
|
|
2
|
+
import "../purify.es-BPDBzHtc.js";
|
|
4
3
|
export {
|
|
5
|
-
|
|
4
|
+
t as md2html
|
|
6
5
|
};
|
package/package.json
CHANGED
|
@@ -1,104 +1,101 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@clevertask/scribe",
|
|
3
|
-
"
|
|
4
|
-
"author": "CleverTask",
|
|
3
|
+
"version": "0.1.0",
|
|
5
4
|
"private": false,
|
|
6
|
-
"
|
|
7
|
-
"type": "module",
|
|
8
|
-
"main": "dist/main.js",
|
|
9
|
-
"types": "dist/main.d.ts",
|
|
10
|
-
"files": [
|
|
11
|
-
"dist"
|
|
12
|
-
],
|
|
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.",
|
|
13
6
|
"keywords": [
|
|
14
|
-
"
|
|
15
|
-
"javascript",
|
|
7
|
+
"block-based",
|
|
16
8
|
"editor",
|
|
17
|
-
"
|
|
9
|
+
"javascript",
|
|
10
|
+
"notion",
|
|
18
11
|
"prosemirror",
|
|
19
|
-
"
|
|
12
|
+
"react",
|
|
20
13
|
"rich-text-editor",
|
|
21
|
-
"
|
|
22
|
-
"
|
|
23
|
-
"
|
|
14
|
+
"tiptap",
|
|
15
|
+
"typescript",
|
|
16
|
+
"wysiwyg"
|
|
24
17
|
],
|
|
25
|
-
"license": "MIT",
|
|
26
18
|
"homepage": "https://github.com/clevertask/scribe#readme",
|
|
27
19
|
"bugs": {
|
|
28
20
|
"url": "https://github.com/clevertask/scribe/issues"
|
|
29
21
|
},
|
|
22
|
+
"license": "MIT",
|
|
23
|
+
"author": "CleverTask",
|
|
30
24
|
"repository": {
|
|
31
25
|
"type": "git",
|
|
32
26
|
"url": "git+https://github.com/clevertask/scribe.git"
|
|
33
27
|
},
|
|
34
|
-
"
|
|
35
|
-
"
|
|
36
|
-
|
|
28
|
+
"files": [
|
|
29
|
+
"dist"
|
|
30
|
+
],
|
|
31
|
+
"type": "module",
|
|
32
|
+
"main": "dist/main.js",
|
|
33
|
+
"types": "dist/main.d.ts",
|
|
34
|
+
"publishConfig": {
|
|
35
|
+
"access": "public",
|
|
36
|
+
"registry": "https://registry.npmjs.org/"
|
|
37
|
+
},
|
|
38
|
+
"dependencies": {
|
|
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
|
+
"@tiptap/extension-mathematics": "^3.21.0",
|
|
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
|
+
"clsx": "^2.1.1",
|
|
59
|
+
"dompurify": "^3.3.3",
|
|
60
|
+
"katex": "^0.16.44",
|
|
61
|
+
"marked": "^17.0.5",
|
|
62
|
+
"tippy.js": "^6.3.7",
|
|
63
|
+
"turndown": "^7.2.2"
|
|
37
64
|
},
|
|
38
65
|
"devDependencies": {
|
|
39
66
|
"@eslint/js": "^9.39.4",
|
|
40
|
-
"@
|
|
67
|
+
"@radix-ui/themes": "^3.3.0",
|
|
41
68
|
"@types/lodash": "^4.17.24",
|
|
42
69
|
"@types/node": "^24.12.0",
|
|
43
70
|
"@types/react": "^19.2.14",
|
|
44
71
|
"@types/react-dom": "^19.2.3",
|
|
45
72
|
"@types/turndown": "^5.0.6",
|
|
46
|
-
"@vitejs/plugin-react": "^5.
|
|
47
|
-
"autoprefixer": "^10.4.27",
|
|
73
|
+
"@vitejs/plugin-react": "^5.2.0",
|
|
48
74
|
"eslint": "^9.39.4",
|
|
49
75
|
"eslint-plugin-react-hooks": "^7.0.1",
|
|
50
76
|
"eslint-plugin-react-refresh": "^0.5.2",
|
|
51
77
|
"glob": "^13.0.6",
|
|
52
78
|
"globals": "^17.4.0",
|
|
53
79
|
"lodash": "^4.17.23",
|
|
54
|
-
"
|
|
55
|
-
"postcss-cli": "^11.0.1",
|
|
56
|
-
"prettier": "3.4.2",
|
|
57
|
-
"tailwindcss": "^3.4.19",
|
|
80
|
+
"oxfmt": "^0.37.0",
|
|
58
81
|
"typescript": "~5.9.3",
|
|
59
|
-
"typescript-eslint": "^8.57.
|
|
82
|
+
"typescript-eslint": "^8.57.2",
|
|
60
83
|
"vite": "^7.3.1",
|
|
61
84
|
"vite-plugin-lib-inject-css": "^2.2.2"
|
|
62
85
|
},
|
|
63
|
-
"
|
|
64
|
-
|
|
65
|
-
"
|
|
66
|
-
"
|
|
67
|
-
},
|
|
68
|
-
"dependencies": {
|
|
69
|
-
"@tiptap/core": "^2.27.2",
|
|
70
|
-
"@tiptap/extension-emoji": "^2.27.2",
|
|
71
|
-
"@tiptap/extension-focus": "^2.27.2",
|
|
72
|
-
"@tiptap/extension-highlight": "^2.27.2",
|
|
73
|
-
"@tiptap/extension-image": "^2.27.2",
|
|
74
|
-
"@tiptap/extension-link": "^2.27.2",
|
|
75
|
-
"@tiptap/extension-mathematics": "^3.20.1",
|
|
76
|
-
"@tiptap/extension-placeholder": "^2.27.2",
|
|
77
|
-
"@tiptap/extension-table": "^2.27.2",
|
|
78
|
-
"@tiptap/extension-table-cell": "^2.27.2",
|
|
79
|
-
"@tiptap/extension-table-header": "^2.27.2",
|
|
80
|
-
"@tiptap/extension-table-row": "^2.27.2",
|
|
81
|
-
"@tiptap/extension-task-item": "^2.27.2",
|
|
82
|
-
"@tiptap/extension-task-list": "^2.27.2",
|
|
83
|
-
"@tiptap/extension-typography": "^2.27.2",
|
|
84
|
-
"@tiptap/pm": "^2.27.2",
|
|
85
|
-
"@tiptap/react": "^2.27.2",
|
|
86
|
-
"@tiptap/starter-kit": "^2.27.2",
|
|
87
|
-
"@tiptap/suggestion": "^2.27.2",
|
|
88
|
-
"clsx": "^2.1.1",
|
|
89
|
-
"dompurify": "^3.3.2",
|
|
90
|
-
"katex": "^0.16.38",
|
|
91
|
-
"marked": "^15.0.12",
|
|
92
|
-
"tippy.js": "^6.3.7",
|
|
93
|
-
"turndown": "^7.2.2"
|
|
86
|
+
"peerDependencies": {
|
|
87
|
+
"@radix-ui/themes": ">=3.3.0",
|
|
88
|
+
"react": ">=18.3.1 <20.0.0",
|
|
89
|
+
"react-dom": ">=18.3.1 <20.0.0"
|
|
94
90
|
},
|
|
91
|
+
"prepublishOnly": "npm run build",
|
|
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
|
-
"
|
|
102
|
-
"
|
|
98
|
+
"fmt": "oxfmt",
|
|
99
|
+
"fmt:check": "oxfmt --check"
|
|
103
100
|
}
|
|
104
101
|
}
|
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-BfaHEr44.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-flsxByQS.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
|
-
};
|