@clevertask/scribe 0.1.28 → 0.1.30
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 +30 -47
- package/dist/BarMenu-Bban-B3t.js +302 -0
- 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/CalloutBubbleMenu.js +2 -2
- package/dist/components/Menu/LinkBubbleMenu.d.ts.map +1 -1
- package/dist/components/Menu/LinkBubbleMenu.js +107 -119
- package/dist/components/Menu/LinkEditor.d.ts +0 -7
- package/dist/components/Menu/LinkEditor.d.ts.map +1 -1
- package/dist/components/Menu/LinkEditor.js +152 -153
- package/dist/components/Menu/Mobile/ListOptionBar.js +1 -1
- package/dist/components/Menu/TableBubbleMenu.js +3 -3
- package/dist/components/Menu/TableHeightSettings.js +1 -1
- package/dist/components/Menu/linkBubbleMenuPlugin.d.ts.map +1 -1
- package/dist/components/Menu/linkBubbleMenuPlugin.js +9 -5
- package/dist/components/Scribe/extension/callout.js +5 -5
- package/dist/components/Scribe/extension/emoji/suggest.js +1 -1
- package/dist/components/Scribe/extension/extension-link.js +1 -1
- package/dist/components/Scribe/extension/extension-markdown-paste.js +1 -1
- package/dist/components/Scribe/extension/extension-selectedText.js +1 -1
- package/dist/components/Scribe/extension/external-link-preview/attributes.d.ts +0 -7
- package/dist/components/Scribe/extension/external-link-preview/attributes.d.ts.map +1 -1
- package/dist/components/Scribe/extension/external-link-preview/attributes.js +26 -51
- package/dist/components/Scribe/extension/external-link-preview/commands.d.ts +5 -12
- package/dist/components/Scribe/extension/external-link-preview/commands.d.ts.map +1 -1
- package/dist/components/Scribe/extension/external-link-preview/commands.js +56 -121
- package/dist/components/Scribe/extension/external-link-preview/index.d.ts +4 -6
- package/dist/components/Scribe/extension/external-link-preview/index.d.ts.map +1 -1
- package/dist/components/Scribe/extension/external-link-preview/index.js +5 -41
- package/dist/components/Scribe/extension/external-link-preview/render-html.d.ts +1 -0
- package/dist/components/Scribe/extension/external-link-preview/render-html.d.ts.map +1 -1
- package/dist/components/Scribe/extension/external-link-preview/render-html.js +17 -60
- package/dist/components/Scribe/extension/external-link-preview/schema.d.ts +2 -2
- package/dist/components/Scribe/extension/external-link-preview/schema.js +1 -1
- package/dist/components/Scribe/extension/external-link-preview/serialization.d.ts.map +1 -1
- package/dist/components/Scribe/extension/external-link-preview/serialization.js +29 -45
- package/dist/components/Scribe/extension/external-link-preview/types.d.ts +14 -17
- package/dist/components/Scribe/extension/external-link-preview/types.d.ts.map +1 -1
- package/dist/components/Scribe/extension/index.js +1 -1
- package/dist/components/Scribe/extension/resizable-table.js +2 -2
- package/dist/components/Scribe/extension/slashCommand/index.js +2 -2
- package/dist/components/Scribe/extension/slashCommand/renderItems.js +1 -1
- package/dist/components/Scribe/extension/table-layout.js +1 -1
- package/dist/components/Scribe/extension/tableOfContents.js +1 -1
- package/dist/components/Scribe/index.d.ts +3 -9
- package/dist/components/Scribe/index.d.ts.map +1 -1
- package/dist/components/Scribe/index.js +3 -3
- package/dist/{dist-xjmWZ-oh.js → dist-DGEcUiqG.js} +650 -686
- package/dist/{dist-Dk0fXvrc.js → dist-TKt66Yz8.js} +2 -2
- package/dist/{dist-BiognBi4.js → dist-ZGDUiMX8.js} +189 -376
- package/dist/document-node-capabilities.js +1 -1
- package/dist/{extension-BU2USLV1.js → extension-I7Ocj_D_.js} +2 -2
- package/dist/extension-link-Cb1UO6hv.js +939 -0
- package/dist/main.css +0 -141
- package/dist/{menus-BDXjZsFU.js → menus-BrQTLTFL.js} +17 -17
- package/dist/{schema-extensions-DyCk1Goa.js → schema-extensions-CzDKrIf8.js} +1616 -1489
- package/dist/schema-extensions.js +1 -1
- package/dist/schema.js +1 -1
- package/dist/{table-layout-BoDS50DR.js → table-layout-Dt7KmVp_.js} +174 -123
- package/dist/utils/create-scribe-editor.d.ts +1 -1
- package/dist/utils/create-scribe-editor.d.ts.map +1 -1
- package/dist/utils/index.js +2 -2
- package/package.json +51 -51
- package/dist/BarMenu-BGWT4Oyk.js +0 -302
- package/dist/components/Menu/ExternalLinkDisplayOptions.d.ts +0 -13
- package/dist/components/Menu/ExternalLinkDisplayOptions.d.ts.map +0 -1
- package/dist/components/Menu/ExternalLinkDisplayOptions.js +0 -90
- package/dist/components/Scribe/extension/external-link-preview/node-view.d.ts +0 -3
- package/dist/components/Scribe/extension/external-link-preview/node-view.d.ts.map +0 -1
- package/dist/components/Scribe/extension/external-link-preview/node-view.js +0 -97
- package/dist/components/Scribe/extension/external-link-preview/normalization.d.ts +0 -7
- package/dist/components/Scribe/extension/external-link-preview/normalization.d.ts.map +0 -1
- package/dist/components/Scribe/extension/external-link-preview/normalization.js +0 -21
- package/dist/components/Scribe/extension/external-link-preview/paste.d.ts +0 -8
- package/dist/components/Scribe/extension/external-link-preview/paste.d.ts.map +0 -1
- package/dist/components/Scribe/extension/external-link-preview/paste.js +0 -53
- package/dist/components/Scribe/extension/external-link-preview/policy.d.ts +0 -7
- package/dist/components/Scribe/extension/external-link-preview/policy.d.ts.map +0 -1
- package/dist/components/Scribe/extension/external-link-preview/policy.js +0 -38
- package/dist/components/Scribe/extension/external-link-preview/resolver.d.ts +0 -23
- package/dist/components/Scribe/extension/external-link-preview/resolver.d.ts.map +0 -1
- package/dist/components/Scribe/extension/external-link-preview/resolver.js +0 -118
- package/dist/extension-link-DmM_EJTn.js +0 -909
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@clevertask/scribe",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.30",
|
|
4
4
|
"private": false,
|
|
5
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": [
|
|
@@ -50,14 +50,14 @@
|
|
|
50
50
|
"registry": "https://registry.npmjs.org/"
|
|
51
51
|
},
|
|
52
52
|
"dependencies": {
|
|
53
|
-
"@tiptap/core": "3.31.
|
|
54
|
-
"@tiptap/extension-bubble-menu": "3.31.
|
|
55
|
-
"@tiptap/extension-floating-menu": "3.31.
|
|
56
|
-
"@tiptap/react": "3.31.
|
|
57
|
-
"@tiptap/suggestion": "3.31.
|
|
53
|
+
"@tiptap/core": "3.31.4",
|
|
54
|
+
"@tiptap/extension-bubble-menu": "3.31.4",
|
|
55
|
+
"@tiptap/extension-floating-menu": "3.31.4",
|
|
56
|
+
"@tiptap/react": "3.31.4",
|
|
57
|
+
"@tiptap/suggestion": "3.31.4",
|
|
58
58
|
"clsx": "^2.1.1",
|
|
59
59
|
"dompurify": "^3.4.16",
|
|
60
|
-
"katex": "^0.
|
|
60
|
+
"katex": "^0.19.0",
|
|
61
61
|
"marked": "^18.0.14",
|
|
62
62
|
"tippy.js": "^6.3.7",
|
|
63
63
|
"turndown": "^7.2.4"
|
|
@@ -68,46 +68,46 @@
|
|
|
68
68
|
"@testing-library/dom": "^10.4.2",
|
|
69
69
|
"@testing-library/jest-dom": "^7.0.1",
|
|
70
70
|
"@testing-library/react": "^16.3.3",
|
|
71
|
-
"@tiptap/extension-blockquote": "3.31.
|
|
72
|
-
"@tiptap/extension-bold": "3.31.
|
|
73
|
-
"@tiptap/extension-bullet-list": "3.31.
|
|
74
|
-
"@tiptap/extension-code": "3.31.
|
|
75
|
-
"@tiptap/extension-code-block": "3.31.
|
|
76
|
-
"@tiptap/extension-document": "3.31.
|
|
77
|
-
"@tiptap/extension-dropcursor": "3.31.
|
|
78
|
-
"@tiptap/extension-emoji": "3.31.
|
|
79
|
-
"@tiptap/extension-focus": "3.31.
|
|
80
|
-
"@tiptap/extension-gapcursor": "3.31.
|
|
81
|
-
"@tiptap/extension-hard-break": "3.31.
|
|
82
|
-
"@tiptap/extension-heading": "3.31.
|
|
83
|
-
"@tiptap/extension-highlight": "3.31.
|
|
84
|
-
"@tiptap/extension-horizontal-rule": "3.31.
|
|
85
|
-
"@tiptap/extension-image": "3.31.
|
|
86
|
-
"@tiptap/extension-italic": "3.31.
|
|
87
|
-
"@tiptap/extension-link": "3.31.
|
|
88
|
-
"@tiptap/extension-list": "3.31.
|
|
89
|
-
"@tiptap/extension-list-item": "3.31.
|
|
90
|
-
"@tiptap/extension-list-keymap": "3.31.
|
|
91
|
-
"@tiptap/extension-mathematics": "3.31.
|
|
92
|
-
"@tiptap/extension-ordered-list": "3.31.
|
|
93
|
-
"@tiptap/extension-paragraph": "3.31.
|
|
94
|
-
"@tiptap/extension-placeholder": "3.31.
|
|
95
|
-
"@tiptap/extension-strike": "3.31.
|
|
96
|
-
"@tiptap/extension-table": "3.31.
|
|
97
|
-
"@tiptap/extension-table-cell": "3.31.
|
|
98
|
-
"@tiptap/extension-table-header": "3.31.
|
|
99
|
-
"@tiptap/extension-table-row": "3.31.
|
|
100
|
-
"@tiptap/extension-task-item": "3.31.
|
|
101
|
-
"@tiptap/extension-task-list": "3.31.
|
|
102
|
-
"@tiptap/extension-text": "3.31.
|
|
103
|
-
"@tiptap/extension-typography": "3.31.
|
|
104
|
-
"@tiptap/extension-underline": "3.31.
|
|
105
|
-
"@tiptap/extensions": "3.31.
|
|
106
|
-
"@tiptap/html": "3.31.
|
|
107
|
-
"@tiptap/pm": "3.31.
|
|
108
|
-
"@tiptap/starter-kit": "3.31.
|
|
71
|
+
"@tiptap/extension-blockquote": "3.31.4",
|
|
72
|
+
"@tiptap/extension-bold": "3.31.4",
|
|
73
|
+
"@tiptap/extension-bullet-list": "3.31.4",
|
|
74
|
+
"@tiptap/extension-code": "3.31.4",
|
|
75
|
+
"@tiptap/extension-code-block": "3.31.4",
|
|
76
|
+
"@tiptap/extension-document": "3.31.4",
|
|
77
|
+
"@tiptap/extension-dropcursor": "3.31.4",
|
|
78
|
+
"@tiptap/extension-emoji": "3.31.4",
|
|
79
|
+
"@tiptap/extension-focus": "3.31.4",
|
|
80
|
+
"@tiptap/extension-gapcursor": "3.31.4",
|
|
81
|
+
"@tiptap/extension-hard-break": "3.31.4",
|
|
82
|
+
"@tiptap/extension-heading": "3.31.4",
|
|
83
|
+
"@tiptap/extension-highlight": "3.31.4",
|
|
84
|
+
"@tiptap/extension-horizontal-rule": "3.31.4",
|
|
85
|
+
"@tiptap/extension-image": "3.31.4",
|
|
86
|
+
"@tiptap/extension-italic": "3.31.4",
|
|
87
|
+
"@tiptap/extension-link": "3.31.4",
|
|
88
|
+
"@tiptap/extension-list": "3.31.4",
|
|
89
|
+
"@tiptap/extension-list-item": "3.31.4",
|
|
90
|
+
"@tiptap/extension-list-keymap": "3.31.4",
|
|
91
|
+
"@tiptap/extension-mathematics": "3.31.4",
|
|
92
|
+
"@tiptap/extension-ordered-list": "3.31.4",
|
|
93
|
+
"@tiptap/extension-paragraph": "3.31.4",
|
|
94
|
+
"@tiptap/extension-placeholder": "3.31.4",
|
|
95
|
+
"@tiptap/extension-strike": "3.31.4",
|
|
96
|
+
"@tiptap/extension-table": "3.31.4",
|
|
97
|
+
"@tiptap/extension-table-cell": "3.31.4",
|
|
98
|
+
"@tiptap/extension-table-header": "3.31.4",
|
|
99
|
+
"@tiptap/extension-table-row": "3.31.4",
|
|
100
|
+
"@tiptap/extension-task-item": "3.31.4",
|
|
101
|
+
"@tiptap/extension-task-list": "3.31.4",
|
|
102
|
+
"@tiptap/extension-text": "3.31.4",
|
|
103
|
+
"@tiptap/extension-typography": "3.31.4",
|
|
104
|
+
"@tiptap/extension-underline": "3.31.4",
|
|
105
|
+
"@tiptap/extensions": "3.31.4",
|
|
106
|
+
"@tiptap/html": "3.31.4",
|
|
107
|
+
"@tiptap/pm": "3.31.4",
|
|
108
|
+
"@tiptap/starter-kit": "3.31.4",
|
|
109
109
|
"@types/lodash": "^4.17.25",
|
|
110
|
-
"@types/node": "^24.19.
|
|
110
|
+
"@types/node": "^24.19.1",
|
|
111
111
|
"@types/react": "^19.3.0",
|
|
112
112
|
"@types/react-dom": "^19.3.0",
|
|
113
113
|
"@types/turndown": "^5.0.6",
|
|
@@ -115,16 +115,16 @@
|
|
|
115
115
|
"glob": "^13.0.6",
|
|
116
116
|
"jsdom": "^30.1.1",
|
|
117
117
|
"lodash": "^4.18.1",
|
|
118
|
-
"oxfmt": "^0.
|
|
119
|
-
"oxlint": "^1.
|
|
118
|
+
"oxfmt": "^0.71.0",
|
|
119
|
+
"oxlint": "^1.86.0",
|
|
120
120
|
"typescript": "~7.0.2",
|
|
121
|
-
"vite": "^8.3.
|
|
121
|
+
"vite": "^8.3.2",
|
|
122
122
|
"vite-plugin-lib-inject-css": "^2.2.2",
|
|
123
|
-
"vitest": "^5.0.
|
|
123
|
+
"vitest": "^5.0.3"
|
|
124
124
|
},
|
|
125
125
|
"peerDependencies": {
|
|
126
126
|
"@radix-ui/themes": ">=3.3.0",
|
|
127
|
-
"@tiptap/pm": "3.31.
|
|
127
|
+
"@tiptap/pm": "3.31.4",
|
|
128
128
|
"react": ">=18.3.1 <20.0.0",
|
|
129
129
|
"react-dom": ">=18.3.1 <20.0.0"
|
|
130
130
|
},
|
package/dist/BarMenu-BGWT4Oyk.js
DELETED
|
@@ -1,302 +0,0 @@
|
|
|
1
|
-
import { s as e } from "./dist-BiognBi4.js";
|
|
2
|
-
import { getPopupMountTarget as t } from "./components/Scribe/extension/getPopupMountTarget.js";
|
|
3
|
-
import n from "./components/Menu/LinkEditor.js";
|
|
4
|
-
import { hideLinkBubbleMenu as r } from "./components/Menu/linkBubbleMenuPlugin.js";
|
|
5
|
-
import { BlockQuoteIcon as i, BoldIcon as a, CodeBlockIcon as o, HighlightIcon as s, HorizontalLineIcon as c, ImageIcon as l, InlineCodeIcon as u, ItalicIcon as d, LinkIcon as f, OrderedListIcon as p, StrikeIcon as m, UnorderedListIcon as h } from "./icons/ToolbarIcons.js";
|
|
6
|
-
import { Box as g, Button as _, Flex as v, IconButton as y, Popover as b, Separator as x, Text as S, TextField as C } from "@radix-ui/themes";
|
|
7
|
-
import { Fragment as w, useCallback as T, useState as E } from "react";
|
|
8
|
-
import { jsx as D, jsxs as O } from "react/jsx-runtime";
|
|
9
|
-
//#region node_modules/.pnpm/clsx@2.1.1/node_modules/clsx/dist/clsx.mjs
|
|
10
|
-
function k(e) {
|
|
11
|
-
var t, n, r = "";
|
|
12
|
-
if (typeof e == "string" || typeof e == "number") r += e;
|
|
13
|
-
else if (typeof e == "object") {
|
|
14
|
-
if (Array.isArray(e)) {
|
|
15
|
-
var i = e.length;
|
|
16
|
-
for (t = 0; t < i; t++) e[t] && (n = k(e[t])) && (r && (r += " "), r += n);
|
|
17
|
-
} else for (n in e) e[n] && (r && (r += " "), r += n);
|
|
18
|
-
}
|
|
19
|
-
return r;
|
|
20
|
-
}
|
|
21
|
-
function A() {
|
|
22
|
-
for (var e, t, n = 0, r = "", i = arguments.length; n < i; n++) (e = arguments[n]) && (t = k(e)) && (r && (r += " "), r += t);
|
|
23
|
-
return r;
|
|
24
|
-
}
|
|
25
|
-
//#endregion
|
|
26
|
-
//#region lib/components/Menu/BarMenu.tsx
|
|
27
|
-
var j = ({ editor: k }) => {
|
|
28
|
-
let [j, M] = E(!1), [N, P] = E(!1), [F, I] = E(""), [L, R] = E(""), z = t(k), B = e({
|
|
29
|
-
editor: k,
|
|
30
|
-
selector: ({ editor: e }) => e ? {
|
|
31
|
-
isBold: e.isActive("bold"),
|
|
32
|
-
isItalic: e.isActive("italic"),
|
|
33
|
-
isStrike: e.isActive("strike"),
|
|
34
|
-
isCode: e.isActive("code"),
|
|
35
|
-
isHighlight: e.isActive("highlight"),
|
|
36
|
-
isBulletList: e.isActive("bulletList"),
|
|
37
|
-
isOrderedList: e.isActive("orderedList"),
|
|
38
|
-
isLink: e.isActive("link"),
|
|
39
|
-
isImage: e.isActive("image"),
|
|
40
|
-
isCodeBlock: e.isActive("codeBlock"),
|
|
41
|
-
isBlockquote: e.isActive("blockquote")
|
|
42
|
-
} : null
|
|
43
|
-
}), V = T((e) => {
|
|
44
|
-
if (e) {
|
|
45
|
-
r(k);
|
|
46
|
-
let e = k.getAttributes("link").href ?? "";
|
|
47
|
-
I(e), P(!1);
|
|
48
|
-
}
|
|
49
|
-
M(e);
|
|
50
|
-
}, [k]), H = T((e) => {
|
|
51
|
-
if (e) {
|
|
52
|
-
r(k);
|
|
53
|
-
let e = k.getAttributes("image").src ?? "";
|
|
54
|
-
R(e), M(!1);
|
|
55
|
-
}
|
|
56
|
-
P(e);
|
|
57
|
-
}, [k]), U = T(() => {
|
|
58
|
-
let e = L.trim();
|
|
59
|
-
e && (k.chain().focus().setImage({ src: e }).run(), P(!1));
|
|
60
|
-
}, [k, L]), W = T((e) => {
|
|
61
|
-
e.preventDefault();
|
|
62
|
-
}, []), G = T(({ target: { value: e } }) => {
|
|
63
|
-
R(e);
|
|
64
|
-
}, []), K = [
|
|
65
|
-
[
|
|
66
|
-
{
|
|
67
|
-
name: "bold",
|
|
68
|
-
icon: a,
|
|
69
|
-
command: () => k.chain().focus().toggleBold().run(),
|
|
70
|
-
isActive: () => !!B?.isBold,
|
|
71
|
-
isToggle: !0,
|
|
72
|
-
label: "Bold"
|
|
73
|
-
},
|
|
74
|
-
{
|
|
75
|
-
name: "italic",
|
|
76
|
-
icon: d,
|
|
77
|
-
command: () => k.chain().focus().toggleItalic().run(),
|
|
78
|
-
isActive: () => !!B?.isItalic,
|
|
79
|
-
isToggle: !0,
|
|
80
|
-
label: "Italic"
|
|
81
|
-
},
|
|
82
|
-
{
|
|
83
|
-
name: "strike",
|
|
84
|
-
icon: m,
|
|
85
|
-
command: () => k.chain().focus().toggleStrike().run(),
|
|
86
|
-
isActive: () => !!B?.isStrike,
|
|
87
|
-
isToggle: !0,
|
|
88
|
-
label: "Strikethrough"
|
|
89
|
-
}
|
|
90
|
-
],
|
|
91
|
-
[{
|
|
92
|
-
name: "inline-code",
|
|
93
|
-
icon: u,
|
|
94
|
-
command: () => k.chain().focus().toggleCode().run(),
|
|
95
|
-
isActive: () => !!B?.isCode,
|
|
96
|
-
isToggle: !0,
|
|
97
|
-
label: "Inline code"
|
|
98
|
-
}, {
|
|
99
|
-
name: "highlight",
|
|
100
|
-
icon: s,
|
|
101
|
-
command: () => k.chain().focus().toggleHighlight().run(),
|
|
102
|
-
isActive: () => !!B?.isHighlight,
|
|
103
|
-
isToggle: !0,
|
|
104
|
-
label: "Highlight"
|
|
105
|
-
}],
|
|
106
|
-
[{
|
|
107
|
-
name: "unordered-list",
|
|
108
|
-
icon: h,
|
|
109
|
-
command: () => k.chain().focus().toggleBulletList().run(),
|
|
110
|
-
isActive: () => !!B?.isBulletList,
|
|
111
|
-
isToggle: !0,
|
|
112
|
-
label: "Bulleted list"
|
|
113
|
-
}, {
|
|
114
|
-
name: "ordered-list",
|
|
115
|
-
icon: p,
|
|
116
|
-
command: () => k.chain().focus().toggleOrderedList().run(),
|
|
117
|
-
isActive: () => !!B?.isOrderedList,
|
|
118
|
-
isToggle: !0,
|
|
119
|
-
label: "Numbered list"
|
|
120
|
-
}],
|
|
121
|
-
[
|
|
122
|
-
{
|
|
123
|
-
name: "link",
|
|
124
|
-
icon: f,
|
|
125
|
-
isActive: () => !!B?.isLink,
|
|
126
|
-
label: "Link",
|
|
127
|
-
popover: "link"
|
|
128
|
-
},
|
|
129
|
-
{
|
|
130
|
-
name: "image",
|
|
131
|
-
icon: l,
|
|
132
|
-
isActive: () => !!B?.isImage,
|
|
133
|
-
disabled: !1,
|
|
134
|
-
label: "Insert image",
|
|
135
|
-
popover: "image"
|
|
136
|
-
},
|
|
137
|
-
{
|
|
138
|
-
name: "code-block",
|
|
139
|
-
icon: o,
|
|
140
|
-
command: () => k.chain().focus().toggleCodeBlock().run(),
|
|
141
|
-
isActive: () => !!B?.isCodeBlock,
|
|
142
|
-
isToggle: !0,
|
|
143
|
-
label: "Code block"
|
|
144
|
-
},
|
|
145
|
-
{
|
|
146
|
-
name: "block-quote",
|
|
147
|
-
icon: i,
|
|
148
|
-
command: () => k.chain().focus().toggleBlockquote().run(),
|
|
149
|
-
isActive: () => !!B?.isBlockquote,
|
|
150
|
-
isToggle: !0,
|
|
151
|
-
label: "Block quote"
|
|
152
|
-
},
|
|
153
|
-
{
|
|
154
|
-
name: "horizontal-line",
|
|
155
|
-
icon: c,
|
|
156
|
-
command: () => k.chain().focus().setHorizontalRule().run(),
|
|
157
|
-
isActive: () => !1,
|
|
158
|
-
label: "Horizontal rule"
|
|
159
|
-
}
|
|
160
|
-
]
|
|
161
|
-
];
|
|
162
|
-
return /* @__PURE__ */ D(g, {
|
|
163
|
-
className: "scribe-toolbar",
|
|
164
|
-
role: "toolbar",
|
|
165
|
-
"aria-label": "Text formatting",
|
|
166
|
-
children: /* @__PURE__ */ D(v, {
|
|
167
|
-
align: "center",
|
|
168
|
-
gap: "3",
|
|
169
|
-
wrap: "wrap",
|
|
170
|
-
children: K.map((e, t) => /* @__PURE__ */ O(w, { children: [/* @__PURE__ */ D(v, {
|
|
171
|
-
align: "center",
|
|
172
|
-
gap: "2",
|
|
173
|
-
wrap: "wrap",
|
|
174
|
-
children: e.map((e, t) => e.popover === "link" ? /* @__PURE__ */ O(b.Root, {
|
|
175
|
-
open: j,
|
|
176
|
-
onOpenChange: V,
|
|
177
|
-
children: [/* @__PURE__ */ D(b.Trigger, { children: /* @__PURE__ */ D(y, {
|
|
178
|
-
type: "button",
|
|
179
|
-
"aria-label": e.label,
|
|
180
|
-
radius: "medium",
|
|
181
|
-
color: "gray",
|
|
182
|
-
variant: e.isActive() ? "soft" : "ghost",
|
|
183
|
-
disabled: e.disabled || !k.isEditable,
|
|
184
|
-
title: e.label,
|
|
185
|
-
onMouseDown: W,
|
|
186
|
-
className: A(e.disabled && "scribe-toolbar-button--disabled"),
|
|
187
|
-
children: /* @__PURE__ */ D(e.icon, { className: "scribe-toolbar-icon" })
|
|
188
|
-
}) }), /* @__PURE__ */ D(b.Content, {
|
|
189
|
-
"aria-label": "Link settings",
|
|
190
|
-
container: z,
|
|
191
|
-
size: "2",
|
|
192
|
-
side: "bottom",
|
|
193
|
-
align: "start",
|
|
194
|
-
style: {
|
|
195
|
-
maxWidth: "calc(100vw - 32px)",
|
|
196
|
-
width: 320
|
|
197
|
-
},
|
|
198
|
-
children: /* @__PURE__ */ D(n, {
|
|
199
|
-
editor: k,
|
|
200
|
-
existingHref: k.getAttributes("link").href ?? "",
|
|
201
|
-
onClose: () => M(!1),
|
|
202
|
-
onValueChange: I,
|
|
203
|
-
selectTextblockEndAfterSave: !0,
|
|
204
|
-
value: F
|
|
205
|
-
})
|
|
206
|
-
})]
|
|
207
|
-
}, `${e.name}-${t}`) : e.popover === "image" ? /* @__PURE__ */ O(b.Root, {
|
|
208
|
-
open: N,
|
|
209
|
-
onOpenChange: H,
|
|
210
|
-
children: [/* @__PURE__ */ D(b.Trigger, { children: /* @__PURE__ */ D(y, {
|
|
211
|
-
type: "button",
|
|
212
|
-
"aria-label": e.label,
|
|
213
|
-
radius: "medium",
|
|
214
|
-
color: "gray",
|
|
215
|
-
variant: e.isActive() ? "soft" : "ghost",
|
|
216
|
-
disabled: e.disabled || !k.isEditable,
|
|
217
|
-
title: e.label,
|
|
218
|
-
onMouseDown: W,
|
|
219
|
-
className: A(e.disabled && "scribe-toolbar-button--disabled"),
|
|
220
|
-
children: /* @__PURE__ */ D(e.icon, { className: "scribe-toolbar-icon" })
|
|
221
|
-
}) }), /* @__PURE__ */ D(b.Content, {
|
|
222
|
-
"aria-label": "Insert image",
|
|
223
|
-
container: z,
|
|
224
|
-
size: "2",
|
|
225
|
-
side: "bottom",
|
|
226
|
-
align: "start",
|
|
227
|
-
style: {
|
|
228
|
-
maxWidth: "calc(100vw - 32px)",
|
|
229
|
-
width: 320
|
|
230
|
-
},
|
|
231
|
-
children: /* @__PURE__ */ O(v, {
|
|
232
|
-
direction: "column",
|
|
233
|
-
gap: "4",
|
|
234
|
-
children: [
|
|
235
|
-
/* @__PURE__ */ O(g, { children: [/* @__PURE__ */ D(S, {
|
|
236
|
-
as: "p",
|
|
237
|
-
size: "3",
|
|
238
|
-
weight: "medium",
|
|
239
|
-
children: "Image"
|
|
240
|
-
}), /* @__PURE__ */ D(S, {
|
|
241
|
-
as: "p",
|
|
242
|
-
size: "2",
|
|
243
|
-
color: "gray",
|
|
244
|
-
children: "Insert an image from a URL."
|
|
245
|
-
})] }),
|
|
246
|
-
/* @__PURE__ */ D("label", { children: /* @__PURE__ */ O(v, {
|
|
247
|
-
direction: "column",
|
|
248
|
-
gap: "2",
|
|
249
|
-
children: [/* @__PURE__ */ D(S, {
|
|
250
|
-
as: "span",
|
|
251
|
-
size: "2",
|
|
252
|
-
weight: "medium",
|
|
253
|
-
children: "Image URL"
|
|
254
|
-
}), /* @__PURE__ */ D(C.Root, {
|
|
255
|
-
autoFocus: !0,
|
|
256
|
-
placeholder: "https://example.com/image.png",
|
|
257
|
-
value: L,
|
|
258
|
-
onChange: G
|
|
259
|
-
})]
|
|
260
|
-
}) }),
|
|
261
|
-
/* @__PURE__ */ O(v, {
|
|
262
|
-
justify: "end",
|
|
263
|
-
gap: "2",
|
|
264
|
-
children: [/* @__PURE__ */ D(b.Close, { children: /* @__PURE__ */ D(_, {
|
|
265
|
-
type: "button",
|
|
266
|
-
variant: "soft",
|
|
267
|
-
color: "gray",
|
|
268
|
-
children: "Cancel"
|
|
269
|
-
}) }), /* @__PURE__ */ D(_, {
|
|
270
|
-
type: "button",
|
|
271
|
-
disabled: L.trim().length === 0,
|
|
272
|
-
onClick: U,
|
|
273
|
-
children: "Save"
|
|
274
|
-
})]
|
|
275
|
-
})
|
|
276
|
-
]
|
|
277
|
-
})
|
|
278
|
-
})]
|
|
279
|
-
}, `${e.name}-${t}`) : /* @__PURE__ */ D(y, {
|
|
280
|
-
type: "button",
|
|
281
|
-
"aria-label": e.label,
|
|
282
|
-
"aria-pressed": e.isToggle ? e.isActive() : void 0,
|
|
283
|
-
radius: "medium",
|
|
284
|
-
color: "gray",
|
|
285
|
-
variant: e.isActive() ? "soft" : "ghost",
|
|
286
|
-
disabled: e.disabled || !k.isEditable,
|
|
287
|
-
title: e.label,
|
|
288
|
-
onMouseDown: W,
|
|
289
|
-
onClick: e.command,
|
|
290
|
-
className: A(e.disabled && "scribe-toolbar-button--disabled"),
|
|
291
|
-
children: /* @__PURE__ */ D(e.icon, { className: "scribe-toolbar-icon" })
|
|
292
|
-
}, `${e.name}-${t}`))
|
|
293
|
-
}), t === K.length - 1 ? null : /* @__PURE__ */ D(x, {
|
|
294
|
-
orientation: "vertical",
|
|
295
|
-
decorative: !0,
|
|
296
|
-
style: { height: 20 }
|
|
297
|
-
})] }, `format-group-${t}`))
|
|
298
|
-
})
|
|
299
|
-
});
|
|
300
|
-
};
|
|
301
|
-
//#endregion
|
|
302
|
-
export { A as n, j as t };
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import type { Editor } from "@tiptap/react";
|
|
2
|
-
import type { ExternalLinkDisplay } from "../Scribe/extension/external-link-preview/types";
|
|
3
|
-
export type { ExternalLinkDisplay } from "../Scribe/extension/external-link-preview/types";
|
|
4
|
-
export interface ExternalLinkDisplayOptionsProps {
|
|
5
|
-
currentDisplay: ExternalLinkDisplay;
|
|
6
|
-
editor: Editor;
|
|
7
|
-
executeDisplayChange?: (display: ExternalLinkDisplay) => boolean;
|
|
8
|
-
onDisplayChange?: (display: ExternalLinkDisplay) => void;
|
|
9
|
-
targetPosition?: number;
|
|
10
|
-
}
|
|
11
|
-
declare const ExternalLinkDisplayOptions: ({ currentDisplay, editor, executeDisplayChange, onDisplayChange, targetPosition, }: ExternalLinkDisplayOptionsProps) => import("react").JSX.Element | null;
|
|
12
|
-
export default ExternalLinkDisplayOptions;
|
|
13
|
-
//# sourceMappingURL=ExternalLinkDisplayOptions.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ExternalLinkDisplayOptions.d.ts","sourceRoot":"","sources":["../../../lib/components/Menu/ExternalLinkDisplayOptions.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAE5C,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,iDAAiD,CAAC;AAE3F,YAAY,EAAE,mBAAmB,EAAE,MAAM,iDAAiD,CAAC;AAE3F,MAAM,WAAW,+BAA+B;IAC9C,cAAc,EAAE,mBAAmB,CAAC;IACpC,MAAM,EAAE,MAAM,CAAC;IACf,oBAAoB,CAAC,EAAE,CAAC,OAAO,EAAE,mBAAmB,KAAK,OAAO,CAAC;IACjE,eAAe,CAAC,EAAE,CAAC,OAAO,EAAE,mBAAmB,KAAK,IAAI,CAAC;IACzD,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAuCD,QAAA,MAAM,0BAA0B,uFAM7B,+BAA+B,uCA4FjC,CAAC;eAEa,0BAA0B"}
|
|
@@ -1,90 +0,0 @@
|
|
|
1
|
-
import { Button as e, Flex as t, Text as n } from "@radix-ui/themes";
|
|
2
|
-
import { useCallback as r, useId as i } from "react";
|
|
3
|
-
import { jsx as a, jsxs as o } from "react/jsx-runtime";
|
|
4
|
-
//#region lib/components/Menu/ExternalLinkDisplayOptions.tsx
|
|
5
|
-
var s = [
|
|
6
|
-
{
|
|
7
|
-
description: "Show a regular text link.",
|
|
8
|
-
display: "plain",
|
|
9
|
-
label: "Plain link"
|
|
10
|
-
},
|
|
11
|
-
{
|
|
12
|
-
description: "Show a concise label without fetching metadata.",
|
|
13
|
-
display: "compact",
|
|
14
|
-
label: "Compact"
|
|
15
|
-
},
|
|
16
|
-
{
|
|
17
|
-
description: "Show an image, title, and description.",
|
|
18
|
-
display: "card",
|
|
19
|
-
label: "Preview card"
|
|
20
|
-
}
|
|
21
|
-
], c = (e) => e.commands, l = (e) => e.can(), u = ({ currentDisplay: u, editor: d, executeDisplayChange: f, onDisplayChange: p, targetPosition: m }) => {
|
|
22
|
-
let h = i(), g = c(d), _ = l(d), v = typeof g.setExternalLinkDisplay == "function", y = (e) => typeof m == "number" ? !!_.setExternalLinkDisplay?.(e, m) : !!_.setExternalLinkDisplay?.(e), b = {
|
|
23
|
-
plain: u === "plain" || y("plain"),
|
|
24
|
-
compact: u === "compact" || y("compact"),
|
|
25
|
-
card: u === "card" || y("card")
|
|
26
|
-
}, x = v && b.compact, S = v && b.card, C = u !== "plain" || x || S, w = r((e) => {
|
|
27
|
-
e !== u && (f?.(e) ?? (typeof m == "number" ? d.chain().focus().setExternalLinkDisplay(e, m).run() : c(d).setExternalLinkDisplay?.(e))) && p?.(e);
|
|
28
|
-
}, [
|
|
29
|
-
u,
|
|
30
|
-
d,
|
|
31
|
-
f,
|
|
32
|
-
p,
|
|
33
|
-
m
|
|
34
|
-
]);
|
|
35
|
-
return !v || !C ? null : /* @__PURE__ */ o(t, {
|
|
36
|
-
direction: "column",
|
|
37
|
-
gap: "2",
|
|
38
|
-
children: [/* @__PURE__ */ a(n, {
|
|
39
|
-
as: "p",
|
|
40
|
-
size: "2",
|
|
41
|
-
weight: "medium",
|
|
42
|
-
children: "Display as"
|
|
43
|
-
}), /* @__PURE__ */ a(t, {
|
|
44
|
-
role: "group",
|
|
45
|
-
"aria-label": "Display as",
|
|
46
|
-
direction: "column",
|
|
47
|
-
gap: "1",
|
|
48
|
-
children: s.map((r) => {
|
|
49
|
-
let i = u === r.display, s = b[r.display], c = `${h}-${r.display}-description`, l = r.display === "card" && !s ? "Preview cards require metadata support and their own line." : r.description;
|
|
50
|
-
return /* @__PURE__ */ a(e, {
|
|
51
|
-
type: "button",
|
|
52
|
-
"aria-describedby": c,
|
|
53
|
-
"aria-label": r.label,
|
|
54
|
-
"aria-pressed": i,
|
|
55
|
-
color: "gray",
|
|
56
|
-
disabled: !s,
|
|
57
|
-
variant: i ? "soft" : "ghost",
|
|
58
|
-
onClick: () => w(r.display),
|
|
59
|
-
style: {
|
|
60
|
-
height: "auto",
|
|
61
|
-
justifyContent: "flex-start",
|
|
62
|
-
paddingBottom: 8,
|
|
63
|
-
paddingTop: 8,
|
|
64
|
-
textAlign: "left",
|
|
65
|
-
width: "100%"
|
|
66
|
-
},
|
|
67
|
-
children: /* @__PURE__ */ o(t, {
|
|
68
|
-
direction: "column",
|
|
69
|
-
gap: "1",
|
|
70
|
-
align: "start",
|
|
71
|
-
children: [/* @__PURE__ */ a(n, {
|
|
72
|
-
as: "span",
|
|
73
|
-
size: "2",
|
|
74
|
-
weight: "medium",
|
|
75
|
-
children: r.label
|
|
76
|
-
}), /* @__PURE__ */ a(n, {
|
|
77
|
-
id: c,
|
|
78
|
-
as: "span",
|
|
79
|
-
size: "1",
|
|
80
|
-
color: "gray",
|
|
81
|
-
children: l
|
|
82
|
-
})]
|
|
83
|
-
})
|
|
84
|
-
}, r.display);
|
|
85
|
-
})
|
|
86
|
-
})]
|
|
87
|
-
});
|
|
88
|
-
};
|
|
89
|
-
//#endregion
|
|
90
|
-
export { u as default };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"node-view.d.ts","sourceRoot":"","sources":["../../../../../lib/components/Scribe/extension/external-link-preview/node-view.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAmB,KAAK,aAAa,EAAkB,MAAM,eAAe,CAAC;AAiCpF,eAAO,MAAM,2BAA2B,6BAA8B,aAAa,gCAgGlF,CAAC"}
|
|
@@ -1,97 +0,0 @@
|
|
|
1
|
-
import { getExternalLinkPreviewHostname as e, getExternalLinkPreviewTitle as t, normalizeExternalLinkPreviewAttributes as n } from "./attributes.js";
|
|
2
|
-
import { n as r, s as i } from "../../../../dist-BiognBi4.js";
|
|
3
|
-
import { showLinkBubbleMenu as a } from "../../../Menu/linkBubbleMenuPlugin.js";
|
|
4
|
-
import { jsx as o, jsxs as s } from "react/jsx-runtime";
|
|
5
|
-
//#region lib/components/Scribe/extension/external-link-preview/node-view.tsx
|
|
6
|
-
var c = (e, t) => {
|
|
7
|
-
let n = e.state.doc.resolve(t), r = e.state.doc.nodeAt(t);
|
|
8
|
-
return !!(r && n.parent.isTextblock && n.parent.childCount === 1 && n.parent.content.size === r.nodeSize);
|
|
9
|
-
}, l = () => /* @__PURE__ */ o("svg", {
|
|
10
|
-
"aria-hidden": "true",
|
|
11
|
-
viewBox: "0 0 24 24",
|
|
12
|
-
width: "16",
|
|
13
|
-
height: "16",
|
|
14
|
-
children: /* @__PURE__ */ o("path", {
|
|
15
|
-
d: "M9.5 14.5l5-5m-7.25 7.25-1 1a3.18 3.18 0 004.5 4.5l3-3a3.18 3.18 0 000-4.5m3-7.5 1-1a3.18 3.18 0 014.5 4.5l-3 3a3.18 3.18 0 01-4.5 0",
|
|
16
|
-
fill: "none",
|
|
17
|
-
stroke: "currentColor",
|
|
18
|
-
strokeLinecap: "round",
|
|
19
|
-
strokeWidth: "1.5"
|
|
20
|
-
})
|
|
21
|
-
}), u = ({ editor: u, getPos: d, node: f }) => {
|
|
22
|
-
let p = n(f.attrs), m = i({
|
|
23
|
-
editor: u,
|
|
24
|
-
selector: ({ editor: e }) => {
|
|
25
|
-
let t = d();
|
|
26
|
-
return typeof t == "number" ? {
|
|
27
|
-
isEditable: e.isEditable,
|
|
28
|
-
isSoleTextblockContent: c(e, t)
|
|
29
|
-
} : {
|
|
30
|
-
isEditable: e.isEditable,
|
|
31
|
-
isSoleTextblockContent: !1
|
|
32
|
-
};
|
|
33
|
-
}
|
|
34
|
-
});
|
|
35
|
-
if (!p) return /* @__PURE__ */ o(r, {
|
|
36
|
-
as: "span",
|
|
37
|
-
className: "scribe-external-link-preview scribe-external-link-preview--invalid",
|
|
38
|
-
"data-type": "external-link-preview",
|
|
39
|
-
children: "Invalid external link"
|
|
40
|
-
});
|
|
41
|
-
let h = p.display === "card" && m.isSoleTextblockContent ? "card" : "compact", g = t(p, h), _ = h === "card" ? p.siteName || e(p.href) : null;
|
|
42
|
-
return /* @__PURE__ */ o(r, {
|
|
43
|
-
as: "span",
|
|
44
|
-
className: `scribe-external-link-preview scribe-external-link-preview--${h}`,
|
|
45
|
-
"data-type": "external-link-preview",
|
|
46
|
-
"data-display": h,
|
|
47
|
-
"data-configured-display": p.display,
|
|
48
|
-
contentEditable: !1,
|
|
49
|
-
children: /* @__PURE__ */ s("a", {
|
|
50
|
-
"data-link-preview-target": "",
|
|
51
|
-
href: p.href,
|
|
52
|
-
target: "_blank",
|
|
53
|
-
rel: "noopener noreferrer",
|
|
54
|
-
"aria-haspopup": m.isEditable ? "dialog" : void 0,
|
|
55
|
-
onClick: (e) => {
|
|
56
|
-
if (!m.isEditable) return;
|
|
57
|
-
e.preventDefault();
|
|
58
|
-
let t = d();
|
|
59
|
-
typeof t == "number" && u.chain().focus().setNodeSelection(t).run() && a(u, "dialog");
|
|
60
|
-
},
|
|
61
|
-
children: [h === "card" && p.imageUrl ? /* @__PURE__ */ o("img", {
|
|
62
|
-
"data-link-preview-image": "",
|
|
63
|
-
src: p.imageUrl,
|
|
64
|
-
alt: ""
|
|
65
|
-
}) : null, /* @__PURE__ */ s("span", {
|
|
66
|
-
"data-link-preview-main": "",
|
|
67
|
-
children: [h === "card" && p.faviconUrl ? /* @__PURE__ */ o("img", {
|
|
68
|
-
"data-link-preview-favicon": "",
|
|
69
|
-
src: p.faviconUrl,
|
|
70
|
-
alt: ""
|
|
71
|
-
}) : /* @__PURE__ */ o("span", {
|
|
72
|
-
"data-link-preview-favicon-fallback": "",
|
|
73
|
-
"aria-hidden": "true",
|
|
74
|
-
children: /* @__PURE__ */ o(l, {})
|
|
75
|
-
}), /* @__PURE__ */ s("span", {
|
|
76
|
-
"data-link-preview-copy": "",
|
|
77
|
-
children: [
|
|
78
|
-
/* @__PURE__ */ o("span", {
|
|
79
|
-
"data-link-preview-title": "",
|
|
80
|
-
children: g
|
|
81
|
-
}),
|
|
82
|
-
_ ? /* @__PURE__ */ o("span", {
|
|
83
|
-
"data-link-preview-site": "",
|
|
84
|
-
children: _
|
|
85
|
-
}) : null,
|
|
86
|
-
h === "card" && p.description ? /* @__PURE__ */ o("span", {
|
|
87
|
-
"data-link-preview-description": "",
|
|
88
|
-
children: p.description
|
|
89
|
-
}) : null
|
|
90
|
-
]
|
|
91
|
-
})]
|
|
92
|
-
})]
|
|
93
|
-
})
|
|
94
|
-
});
|
|
95
|
-
};
|
|
96
|
-
//#endregion
|
|
97
|
-
export { u as ExternalLinkPreviewNodeView };
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { Plugin, PluginKey } from "@tiptap/pm/state";
|
|
2
|
-
import type { EditorState } from "@tiptap/pm/state";
|
|
3
|
-
export declare const externalLinkPreviewNormalizationPluginKey: PluginKey<any>;
|
|
4
|
-
export declare const createExternalLinkPreviewNormalizationTransaction: (state: EditorState) => import("@tiptap/pm/state").Transaction | null;
|
|
5
|
-
/** Keep the persisted display contract aligned with Card's sole-textblock requirement. */
|
|
6
|
-
export declare const createExternalLinkPreviewNormalizationPlugin: () => Plugin<any>;
|
|
7
|
-
//# sourceMappingURL=normalization.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"normalization.d.ts","sourceRoot":"","sources":["../../../../../lib/components/Scribe/extension/external-link-preview/normalization.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAGpD,eAAO,MAAM,yCAAyC,gBAErD,CAAC;AAEF,eAAO,MAAM,iDAAiD,UAAW,WAAW,kDA2BnF,CAAC;AAEF,0FAA0F;AAC1F,eAAO,MAAM,4CAA4C,mBAerD,CAAC"}
|