@clevertask/scribe 0.1.29 → 0.1.31
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 +39 -53
- package/dist/BarMenu-Bm5IfWVV.js +302 -0
- package/dist/components/Menu/BarMenu.d.ts.map +1 -1
- package/dist/components/Menu/BarMenu.js +1 -2
- 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 +113 -103
- 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 +148 -157
- package/dist/components/Menu/Mobile/ListOptionBar.js +1 -1
- package/dist/components/Menu/TableBubbleMenu.js +3 -3
- package/dist/components/Menu/TableHeightSettings.js +3 -11
- package/dist/components/Menu/TableLayoutOptions.js +1 -5
- 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 +7 -7
- package/dist/components/Scribe/extension/emoji/suggest.js +2 -2
- package/dist/components/Scribe/extension/extension-link.js +1 -2
- package/dist/components/Scribe/extension/extension-markdown-paste.js +2 -2
- 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 -51
- 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 -2
- package/dist/components/Scribe/extension/resizable-table.js +2 -2
- package/dist/components/Scribe/extension/slashCommand/SlashCommandList.js +10 -14
- package/dist/components/Scribe/extension/slashCommand/index.js +2 -2
- package/dist/components/Scribe/extension/slashCommand/renderItems.js +2 -2
- package/dist/components/Scribe/extension/table-layout.js +1 -2
- 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 +7 -21
- package/dist/{dist-DnVcys79.js → dist-BoAzo5MN.js} +491 -598
- package/dist/{dist-CDJRm4fL.js → dist-BqlzKS-_.js} +9 -17
- package/dist/{dist-B0xwy1Q5.js → dist-SM4NoN4h.js} +174 -385
- package/dist/document-node-capabilities.js +1 -1
- package/dist/{extension-BPeoqfHR.js → extension-dz0CIf3r.js} +1 -1
- package/dist/extension-link-DxIXGCtV.js +931 -0
- package/dist/{html-to-markdown-DF93it73.js → html-to-markdown-DeRG9OPm.js} +1 -1
- package/dist/main.css +1 -141
- package/dist/main.js +2 -2
- package/dist/{markdown-to-html-BoK5O_j-.js → markdown-to-html-tCPjQ5u6.js} +23 -70
- package/dist/{menus-scgppp2C.js → menus-BKxcTUsl.js} +36 -118
- package/dist/{purify.es-q6CUdJQi.js → purify.es-CSWcs7f1.js} +1 -23
- package/dist/{schema-extensions-ITR9LEgX.js → schema-extensions-B9hR1VrD.js} +1335 -1360
- package/dist/schema-extensions.js +1 -2
- package/dist/schema.js +1 -1
- package/dist/{table-layout-iVolql5p.js → table-layout-ClqaGg1E.js} +36 -36
- package/dist/{tippy.esm-MjWnmeEn.js → tippy.esm-C8V6GlaF.js} +5 -17
- package/dist/utils/create-scribe-editor.d.ts +1 -1
- package/dist/utils/create-scribe-editor.d.ts.map +1 -1
- package/dist/utils/create-scribe-editor.js +1 -2
- package/dist/utils/html-to-markdown.js +1 -2
- package/dist/utils/index.js +4 -4
- package/dist/utils/markdown-to-html.js +1 -2
- package/package.json +10 -10
- package/dist/BarMenu-BC8XoC6e.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-RvaqaDqr.js +0 -934
|
@@ -1,188 +1,179 @@
|
|
|
1
|
-
import e from "./
|
|
1
|
+
import { getSelectionLinkContext as e } from "./linkBubbleMenuPlugin.js";
|
|
2
2
|
import { normalizeLinkUrl as t } from "./linkUrl.js";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
3
|
+
import { TextSelection as n } from "@tiptap/pm/state";
|
|
4
|
+
import { closeHistory as r } from "@tiptap/pm/history";
|
|
5
|
+
import { Button as i, Flex as a, Text as o, TextField as s } from "@radix-ui/themes";
|
|
6
|
+
import { useCallback as c, useEffect as l, useId as u, useRef as d, useState as f } from "react";
|
|
7
|
+
import { jsx as p, jsxs as m } from "react/jsx-runtime";
|
|
6
8
|
//#region lib/components/Menu/LinkEditor.tsx
|
|
7
|
-
var
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
let
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
let
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
9
|
+
var h = (e, t, n) => {
|
|
10
|
+
if (t < 0 || t > n || n > e.content.size) return !1;
|
|
11
|
+
let r = e.resolve(t), i = e.resolve(n), a = r.sameParent(i) && r.parent.isTextblock;
|
|
12
|
+
return e.nodesBetween(t, n, (e) => {
|
|
13
|
+
e.isInline && !e.isText && (a = !1);
|
|
14
|
+
}), a;
|
|
15
|
+
}, g = (t) => {
|
|
16
|
+
let { doc: n, selection: r } = t.state, i = e(t.state), a = i?.from ?? r.from, o = i?.to ?? r.to;
|
|
17
|
+
return i?.kind === "preview" ? {
|
|
18
|
+
from: a,
|
|
19
|
+
to: o,
|
|
20
|
+
text: i.attributes.linkText,
|
|
21
|
+
editableText: !0,
|
|
22
|
+
preview: !0
|
|
23
|
+
} : {
|
|
24
|
+
from: a,
|
|
25
|
+
to: o,
|
|
26
|
+
text: n.textBetween(a, o, "\n", ""),
|
|
27
|
+
editableText: h(n, a, o),
|
|
28
|
+
preview: !1
|
|
29
|
+
};
|
|
30
|
+
}, _ = ({ editor: e, existingHref: _, inputRef: v, onClose: y, onValueChange: b, resetToken: x, selectTextblockEndAfterSave: S = !1, targetPosition: C, value: w }) => {
|
|
31
|
+
let T = g(e), E = d(T), [D, O] = f(T.text), [k, A] = f(T.editableText), [j, M] = f(null), N = u();
|
|
32
|
+
l(() => {
|
|
33
|
+
let t = g(e);
|
|
34
|
+
E.current = t, O(t.text), A(t.editableText), M(null);
|
|
35
|
+
let n = ({ transaction: e }) => {
|
|
36
|
+
E.current = {
|
|
37
|
+
...E.current,
|
|
38
|
+
from: e.mapping.map(E.current.from, 1),
|
|
39
|
+
to: e.mapping.map(E.current.to, E.current.from === E.current.to ? 1 : -1)
|
|
40
|
+
};
|
|
41
|
+
};
|
|
42
|
+
return e.on("transaction", n), () => {
|
|
43
|
+
e.off("transaction", n);
|
|
44
|
+
};
|
|
37
45
|
}, [
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
]),
|
|
46
|
-
|
|
47
|
-
|
|
46
|
+
e,
|
|
47
|
+
_,
|
|
48
|
+
x,
|
|
49
|
+
C
|
|
50
|
+
]);
|
|
51
|
+
let P = c(() => {
|
|
52
|
+
M(null), y();
|
|
53
|
+
}, [y]), F = c((i) => {
|
|
54
|
+
i.preventDefault();
|
|
55
|
+
let a = t(w);
|
|
56
|
+
if (!a) {
|
|
57
|
+
M("Enter a valid web address or root-relative path.");
|
|
48
58
|
return;
|
|
49
59
|
}
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
60
|
+
let o = E.current, s = D.trim() ? D : a, c = !1;
|
|
61
|
+
c = o.preview && a.startsWith("/") ? e.chain().focus().command(({ tr: e, state: t }) => {
|
|
62
|
+
let i = t.schema.marks.link, c = e.doc.nodeAt(o.from);
|
|
63
|
+
if (!i || c?.type.name !== "externalLinkPreview" || !e.doc.resolve(o.from).parent.type.allowsMarkType(i)) return !1;
|
|
64
|
+
r(e), e.setMeta("preventAutolink", !0);
|
|
65
|
+
let l = [...c.marks.filter((e) => e.type !== i), i.create({ href: a })];
|
|
66
|
+
return e.replaceWith(o.from, o.from + c.nodeSize, t.schema.text(s, l)), e.setSelection(n.create(e.doc, o.from + s.length)), !0;
|
|
67
|
+
}).run() : o.preview ? e.can().updateExternalLinkPreview({
|
|
68
|
+
href: a,
|
|
69
|
+
linkText: s
|
|
70
|
+
}, o.from) && e.chain().focus().command(({ tr: e }) => (r(e), !0)).updateExternalLinkPreview({
|
|
71
|
+
href: a,
|
|
72
|
+
linkText: s
|
|
73
|
+
}, o.from).run() : e.chain().focus().command(({ tr: e, state: t }) => {
|
|
74
|
+
let i = t.schema.marks.link, { from: c, to: l } = o;
|
|
75
|
+
if (!i || c > l || l > e.doc.content.size) return !1;
|
|
76
|
+
if (r(e), e.setMeta("preventAutolink", !0), c === l || D !== o.text) {
|
|
77
|
+
if (!h(e.doc, c, l) || !e.doc.resolve(c).parent.type.allowsMarkType(i)) return !1;
|
|
78
|
+
let r = c === l ? t.storedMarks ?? e.doc.resolve(c).marks() : e.doc.nodeAt(c)?.marks ?? [], o = r.find((e) => e.type === i), u = [...r.filter((e) => e.type !== i), i.create({
|
|
79
|
+
...o?.attrs,
|
|
80
|
+
href: a
|
|
81
|
+
})];
|
|
82
|
+
e.replaceWith(c, l, t.schema.text(s, u)), e.setSelection(n.create(e.doc, c + s.length));
|
|
83
|
+
} else {
|
|
84
|
+
let t = !1;
|
|
85
|
+
if (e.doc.nodesBetween(c, l, (n, r, o) => {
|
|
86
|
+
if (!n.isText || !o?.type.allowsMarkType(i)) return;
|
|
87
|
+
let s = n.marks.find((e) => e.type === i);
|
|
88
|
+
e.addMark(Math.max(c, r), Math.min(l, r + n.nodeSize), i.create({
|
|
89
|
+
...s?.attrs,
|
|
90
|
+
href: a
|
|
91
|
+
})), t = !0;
|
|
92
|
+
}), !t) return !1;
|
|
93
|
+
e.setSelection(n.create(e.doc, l));
|
|
94
|
+
}
|
|
95
|
+
return !0;
|
|
96
|
+
}).run(), c ? (S && e.commands.selectTextblockEnd(), P()) : M("Scribe could not save this link.");
|
|
58
97
|
}, [
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
98
|
+
e,
|
|
99
|
+
P,
|
|
100
|
+
S,
|
|
101
|
+
D,
|
|
102
|
+
w
|
|
103
|
+
]), I = c(() => {
|
|
104
|
+
let t = E.current;
|
|
105
|
+
e.chain().focus().command(({ tr: e, state: i }) => {
|
|
106
|
+
let a = i.schema.marks.link;
|
|
107
|
+
return !a || t.from > t.to || t.to > e.doc.content.size ? !1 : (r(e), e.setMeta("preventAutolink", !0), t.preview ? (e.replaceWith(t.from, t.to, i.schema.text(t.text)), e.setSelection(n.create(e.doc, t.from + t.text.length))) : (e.removeMark(t.from, t.to, a), e.setSelection(n.create(e.doc, t.to))), !0);
|
|
108
|
+
}).run() ? P() : M("Scribe could not remove this link.");
|
|
109
|
+
}, [e, P]), L = c((e) => {
|
|
110
|
+
e.key === "Escape" && (e.preventDefault(), e.stopPropagation(), P());
|
|
111
|
+
}, [P]);
|
|
112
|
+
return /* @__PURE__ */ p("form", {
|
|
113
|
+
onKeyDown: L,
|
|
114
|
+
onSubmit: F,
|
|
115
|
+
children: /* @__PURE__ */ m(a, {
|
|
70
116
|
direction: "column",
|
|
71
117
|
gap: "4",
|
|
72
118
|
children: [
|
|
73
|
-
/* @__PURE__ */
|
|
74
|
-
as: "p",
|
|
75
|
-
size: "3",
|
|
76
|
-
weight: "medium",
|
|
77
|
-
children: "Link"
|
|
78
|
-
}), /* @__PURE__ */ d(a, {
|
|
79
|
-
as: "p",
|
|
80
|
-
size: "2",
|
|
81
|
-
color: "gray",
|
|
82
|
-
children: "Add or update a link for the current selection."
|
|
83
|
-
})] }),
|
|
84
|
-
/* @__PURE__ */ d("label", { children: /* @__PURE__ */ f(i, {
|
|
119
|
+
/* @__PURE__ */ p("label", { children: /* @__PURE__ */ m(a, {
|
|
85
120
|
direction: "column",
|
|
86
121
|
gap: "2",
|
|
87
|
-
children: [/* @__PURE__ */
|
|
122
|
+
children: [/* @__PURE__ */ p(o, {
|
|
123
|
+
as: "span",
|
|
124
|
+
size: "2",
|
|
125
|
+
weight: "medium",
|
|
126
|
+
children: "Text to display"
|
|
127
|
+
}), /* @__PURE__ */ p(s.Root, {
|
|
128
|
+
value: D,
|
|
129
|
+
disabled: !k,
|
|
130
|
+
onChange: (e) => {
|
|
131
|
+
M(null), O(e.target.value);
|
|
132
|
+
}
|
|
133
|
+
})]
|
|
134
|
+
}) }),
|
|
135
|
+
/* @__PURE__ */ p("label", { children: /* @__PURE__ */ m(a, {
|
|
136
|
+
direction: "column",
|
|
137
|
+
gap: "2",
|
|
138
|
+
children: [/* @__PURE__ */ p(o, {
|
|
88
139
|
as: "span",
|
|
89
140
|
size: "2",
|
|
90
141
|
weight: "medium",
|
|
91
142
|
children: "URL"
|
|
92
|
-
}), /* @__PURE__ */
|
|
93
|
-
ref:
|
|
94
|
-
"aria-describedby":
|
|
95
|
-
"aria-invalid": !!
|
|
96
|
-
autoFocus: !
|
|
143
|
+
}), /* @__PURE__ */ p(s.Root, {
|
|
144
|
+
ref: v,
|
|
145
|
+
"aria-describedby": j ? N : void 0,
|
|
146
|
+
"aria-invalid": !!j,
|
|
147
|
+
autoFocus: !v,
|
|
97
148
|
placeholder: "https://example.com",
|
|
98
|
-
value:
|
|
99
|
-
onChange: (e) =>
|
|
149
|
+
value: w,
|
|
150
|
+
onChange: (e) => {
|
|
151
|
+
M(null), b(e.target.value);
|
|
152
|
+
}
|
|
100
153
|
})]
|
|
101
154
|
}) }),
|
|
102
|
-
|
|
103
|
-
id:
|
|
155
|
+
j ? /* @__PURE__ */ p(o, {
|
|
156
|
+
id: N,
|
|
104
157
|
as: "p",
|
|
105
158
|
role: "alert",
|
|
106
159
|
size: "2",
|
|
107
160
|
color: "red",
|
|
108
|
-
children:
|
|
161
|
+
children: j
|
|
109
162
|
}) : null,
|
|
110
|
-
/* @__PURE__ */
|
|
111
|
-
currentDisplay: m,
|
|
112
|
-
editor: h,
|
|
113
|
-
executeDisplayChange: F ? R : void 0,
|
|
114
|
-
onDisplayChange: j,
|
|
115
|
-
targetPosition: T
|
|
116
|
-
}),
|
|
117
|
-
m === "plain" ? null : /* @__PURE__ */ f(i, {
|
|
118
|
-
align: "center",
|
|
119
|
-
justify: "between",
|
|
120
|
-
gap: "2",
|
|
121
|
-
wrap: "wrap",
|
|
122
|
-
children: [/* @__PURE__ */ d(a, {
|
|
123
|
-
as: "span",
|
|
124
|
-
role: "status",
|
|
125
|
-
"aria-live": "polite",
|
|
126
|
-
size: "1",
|
|
127
|
-
color: x === "error" ? "red" : "gray",
|
|
128
|
-
children: x === "loading" ? "Loading preview…" : x === "error" ? "Preview unavailable" : S
|
|
129
|
-
}), p && y ? /* @__PURE__ */ d(r, {
|
|
130
|
-
type: "button",
|
|
131
|
-
color: "gray",
|
|
132
|
-
variant: "soft",
|
|
133
|
-
"aria-disabled": I,
|
|
134
|
-
"data-disabled": I ? "" : void 0,
|
|
135
|
-
onClick: L,
|
|
136
|
-
children: "Refresh preview"
|
|
137
|
-
}) : null]
|
|
138
|
-
}),
|
|
139
|
-
/* @__PURE__ */ f(i, {
|
|
163
|
+
/* @__PURE__ */ m(a, {
|
|
140
164
|
justify: "between",
|
|
141
165
|
gap: "3",
|
|
142
|
-
|
|
143
|
-
children: [m === "plain" ? /* @__PURE__ */ d(r, {
|
|
166
|
+
children: [/* @__PURE__ */ p(i, {
|
|
144
167
|
type: "button",
|
|
145
168
|
color: "red",
|
|
146
169
|
variant: "soft",
|
|
147
|
-
disabled: !
|
|
148
|
-
onClick:
|
|
170
|
+
disabled: !_,
|
|
171
|
+
onClick: I,
|
|
149
172
|
children: "Remove link"
|
|
150
|
-
})
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
wrap: "wrap",
|
|
155
|
-
children: [
|
|
156
|
-
A ? /* @__PURE__ */ d(r, {
|
|
157
|
-
asChild: !0,
|
|
158
|
-
variant: "soft",
|
|
159
|
-
color: "gray",
|
|
160
|
-
children: /* @__PURE__ */ d("a", {
|
|
161
|
-
href: A,
|
|
162
|
-
target: "_blank",
|
|
163
|
-
rel: "noopener noreferrer",
|
|
164
|
-
children: "Open link"
|
|
165
|
-
})
|
|
166
|
-
}) : /* @__PURE__ */ d(r, {
|
|
167
|
-
type: "button",
|
|
168
|
-
variant: "soft",
|
|
169
|
-
color: "gray",
|
|
170
|
-
disabled: !0,
|
|
171
|
-
children: "Open link"
|
|
172
|
-
}),
|
|
173
|
-
/* @__PURE__ */ d(r, {
|
|
174
|
-
type: "button",
|
|
175
|
-
variant: "soft",
|
|
176
|
-
color: "gray",
|
|
177
|
-
onClick: j,
|
|
178
|
-
children: "Cancel"
|
|
179
|
-
}),
|
|
180
|
-
/* @__PURE__ */ d(r, {
|
|
181
|
-
type: "submit",
|
|
182
|
-
disabled: E.trim().length === 0,
|
|
183
|
-
children: "Save"
|
|
184
|
-
})
|
|
185
|
-
]
|
|
173
|
+
}), /* @__PURE__ */ p(i, {
|
|
174
|
+
type: "submit",
|
|
175
|
+
disabled: w.trim().length === 0,
|
|
176
|
+
children: "Apply"
|
|
186
177
|
})]
|
|
187
178
|
})
|
|
188
179
|
]
|
|
@@ -190,4 +181,4 @@ var p = ({ canRefreshPreview: p = !1, currentDisplay: m = "plain", editor: h, ex
|
|
|
190
181
|
});
|
|
191
182
|
};
|
|
192
183
|
//#endregion
|
|
193
|
-
export {
|
|
184
|
+
export { _ as default };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { c as e, u as t } from "../../table-layout-
|
|
2
|
-
import {
|
|
1
|
+
import { c as e, u as t } from "../../table-layout-ClqaGg1E.js";
|
|
2
|
+
import { a as n } from "../../dist-SM4NoN4h.js";
|
|
3
3
|
import { getPopupMountTarget as r } from "../Scribe/extension/getPopupMountTarget.js";
|
|
4
|
-
import { t as i } from "../../menus-
|
|
4
|
+
import { t as i } from "../../menus-BKxcTUsl.js";
|
|
5
5
|
import { getSelectionTableContext as a, tableBubbleMenuPluginKey as o } from "./tableBubbleMenuPlugin.js";
|
|
6
6
|
import { getSelectionContextualMenuOwner as s } from "./contextualMenuOwner.js";
|
|
7
7
|
import c from "./TableLayoutOptions.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { c as e, n as t } from "../../table-layout-
|
|
1
|
+
import { c as e, n as t } from "../../table-layout-ClqaGg1E.js";
|
|
2
2
|
import { getPopupMountTarget as n } from "../Scribe/extension/getPopupMountTarget.js";
|
|
3
3
|
import { getSelectionTableContext as r } from "./tableBubbleMenuPlugin.js";
|
|
4
4
|
import { NodeSelection as i } from "@tiptap/pm/state";
|
|
@@ -28,11 +28,7 @@ var _ = ({ editor: _, maxHeight: v, canSetMaxHeight: y, onClose: b }) => {
|
|
|
28
28
|
};
|
|
29
29
|
}, [_, b]);
|
|
30
30
|
let R = (e) => {
|
|
31
|
-
|
|
32
|
-
N.current = !1, b();
|
|
33
|
-
return;
|
|
34
|
-
}
|
|
35
|
-
y && _.commands.setTableMaxHeight(e) && (D.current = _.state.selection.getBookmark(), N.current = !0, b());
|
|
31
|
+
L() ? y && _.commands.setTableMaxHeight(e) && (D.current = _.state.selection.getBookmark(), N.current = !0, b()) : (N.current = !1, b());
|
|
36
32
|
};
|
|
37
33
|
return /* @__PURE__ */ h(o.Root, {
|
|
38
34
|
open: !0,
|
|
@@ -69,11 +65,7 @@ var _ = ({ editor: _, maxHeight: v, canSetMaxHeight: y, onClose: b }) => {
|
|
|
69
65
|
return;
|
|
70
66
|
}
|
|
71
67
|
let r = e(x.trim());
|
|
72
|
-
|
|
73
|
-
w(`Enter a whole number from 120 to ${t}.`), T.current?.focus();
|
|
74
|
-
return;
|
|
75
|
-
}
|
|
76
|
-
R(r);
|
|
68
|
+
r === null ? (w(`Enter a whole number from 120 to ${t}.`), T.current?.focus()) : R(r);
|
|
77
69
|
},
|
|
78
70
|
children: [/* @__PURE__ */ g(s, {
|
|
79
71
|
direction: "column",
|
|
@@ -59,11 +59,7 @@ var l = [
|
|
|
59
59
|
e.stopPropagation(), E.current = !0;
|
|
60
60
|
},
|
|
61
61
|
onCloseAutoFocus: (e) => {
|
|
62
|
-
|
|
63
|
-
e.preventDefault(), D.current = !1;
|
|
64
|
-
return;
|
|
65
|
-
}
|
|
66
|
-
E.current && !u.isDestroyed && (e.preventDefault(), u.chain().focus().run());
|
|
62
|
+
D.current ? (e.preventDefault(), D.current = !1) : E.current && !u.isDestroyed && (e.preventDefault(), u.chain().focus().run());
|
|
67
63
|
},
|
|
68
64
|
children: [
|
|
69
65
|
/* @__PURE__ */ s(n.Label, { children: "Width" }),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"linkBubbleMenuPlugin.d.ts","sourceRoot":"","sources":["../../../lib/components/Menu/linkBubbleMenuPlugin.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,EAAiB,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC5D,OAAO,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAKvC,OAAO,KAAK,EACV,6BAA6B,EAC7B,0BAA0B,EAC3B,MAAM,iDAAiD,CAAC;AAEzD,MAAM,MAAM,yBAAyB,GAAG,QAAQ,GAAG,KAAK,CAAC;AAEzD,MAAM,MAAM,qBAAqB,GAC7B;IACE,OAAO,EAAE,OAAO,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,OAAO,CAAC;IACd,EAAE,EAAE,MAAM,CAAC;CACZ,GACD;IACE,UAAU,EAAE,6BAA6B,CAAC;IAC1C,OAAO,EAAE,0BAA0B,CAAC;IACpC,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,SAAS,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;IACjB,EAAE,EAAE,MAAM,CAAC;CACZ,CAAC;AAEN,eAAO,MAAM,uBAAuB,gBAAwC,CAAC;AAG7E,eAAO,MAAM,6BAA6B,UACjC,WAAW,YACR,MAAM,KACf,OAAO,CAAC,qBAAqB,EAAE;IAAE,IAAI,EAAE,OAAO,CAAA;CAAE,CAAC,GAAG,
|
|
1
|
+
{"version":3,"file":"linkBubbleMenuPlugin.d.ts","sourceRoot":"","sources":["../../../lib/components/Menu/linkBubbleMenuPlugin.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,EAAiB,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC5D,OAAO,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAKvC,OAAO,KAAK,EACV,6BAA6B,EAC7B,0BAA0B,EAC3B,MAAM,iDAAiD,CAAC;AAEzD,MAAM,MAAM,yBAAyB,GAAG,QAAQ,GAAG,KAAK,CAAC;AAEzD,MAAM,MAAM,qBAAqB,GAC7B;IACE,OAAO,EAAE,OAAO,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,OAAO,CAAC;IACd,EAAE,EAAE,MAAM,CAAC;CACZ,GACD;IACE,UAAU,EAAE,6BAA6B,CAAC;IAC1C,OAAO,EAAE,0BAA0B,CAAC;IACpC,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,SAAS,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;IACjB,EAAE,EAAE,MAAM,CAAC;CACZ,CAAC;AAEN,eAAO,MAAM,uBAAuB,gBAAwC,CAAC;AAG7E,eAAO,MAAM,6BAA6B,UACjC,WAAW,YACR,MAAM,KACf,OAAO,CAAC,qBAAqB,EAAE;IAAE,IAAI,EAAE,OAAO,CAAA;CAAE,CAAC,GAAG,IA+CtD,CAAC;AAEF,eAAO,MAAM,uBAAuB,UAAW,WAAW,KAAG,qBAAqB,GAAG,IAiCpF,CAAC;AAEF,eAAO,MAAM,gCAAgC,WAAY,MAAM,8BAM9D,CAAC;AAEF,eAAO,MAAM,kBAAkB,WACrB,MAAM,gBACD,yBAAyB,SAevC,CAAC;AAEF,eAAO,MAAM,kBAAkB,WAAY,MAAM,SAMhD,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { v as e } from "../../dist-
|
|
1
|
+
import { v as e } from "../../dist-BoAzo5MN.js";
|
|
2
2
|
import { normalizeExternalLinkPreviewAttributes as t } from "../Scribe/extension/external-link-preview/attributes.js";
|
|
3
3
|
import { NodeSelection as n, PluginKey as r } from "@tiptap/pm/state";
|
|
4
4
|
//#region lib/components/Menu/linkBubbleMenuPlugin.ts
|
|
@@ -9,11 +9,15 @@ var i = new r("scribeLinkBubbleMenu"), a = /* @__PURE__ */ new WeakMap(), o = (t
|
|
|
9
9
|
if (!i.parent.isTextblock) return null;
|
|
10
10
|
let a = e(i, r);
|
|
11
11
|
if (!a) return null;
|
|
12
|
-
let o =
|
|
13
|
-
|
|
12
|
+
let o = !1;
|
|
13
|
+
if (t.doc.nodesBetween(a.from, a.to, (e) => {
|
|
14
|
+
e.isInline && !e.isText && (o = !0);
|
|
15
|
+
}), o) return null;
|
|
16
|
+
let s = t.doc.nodeAt(a.from)?.marks.find((e) => e.type === r), c = typeof s?.attrs.href == "string" ? s.attrs.href : "";
|
|
17
|
+
return c ? {
|
|
14
18
|
display: "plain",
|
|
15
19
|
from: a.from,
|
|
16
|
-
href:
|
|
20
|
+
href: c,
|
|
17
21
|
kind: "plain",
|
|
18
22
|
to: a.to
|
|
19
23
|
} : null;
|
|
@@ -31,7 +35,7 @@ var i = new r("scribeLinkBubbleMenu"), a = /* @__PURE__ */ new WeakMap(), o = (t
|
|
|
31
35
|
to: r.to
|
|
32
36
|
} : null;
|
|
33
37
|
}
|
|
34
|
-
if (!r.$from.sameParent(r.$to)) return null;
|
|
38
|
+
if (r instanceof n || !r.$from.sameParent(r.$to)) return null;
|
|
35
39
|
let i = o(e, r.from);
|
|
36
40
|
return !i || r.from < i.from || r.to > i.to ? null : i;
|
|
37
41
|
}, c = (e) => {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { B as e, M as t, a as n } from "../../../dist-BoAzo5MN.js";
|
|
2
2
|
import { TextSelection as r } from "@tiptap/pm/state";
|
|
3
3
|
//#region lib/components/Scribe/extension/callout.ts
|
|
4
4
|
var i = [
|
|
@@ -42,7 +42,7 @@ var i = [
|
|
|
42
42
|
if (p?.type !== o || p.content.size) return !1;
|
|
43
43
|
let m = a.after(s) + 1;
|
|
44
44
|
return i.delete(a.before(), a.after()), i.setSelection(r.create(i.doc, i.mapping.map(m))), e.view.dispatch(i.scrollIntoView()), !0;
|
|
45
|
-
}, f =
|
|
45
|
+
}, f = n.create({
|
|
46
46
|
name: "callout",
|
|
47
47
|
group: "block",
|
|
48
48
|
content: "block+",
|
|
@@ -64,13 +64,13 @@ var i = [
|
|
|
64
64
|
contentElement: (e) => Array.from(e.children).find((e) => e.hasAttribute("data-callout-content")) ?? e
|
|
65
65
|
}];
|
|
66
66
|
},
|
|
67
|
-
renderHTML({ HTMLAttributes:
|
|
68
|
-
let
|
|
67
|
+
renderHTML({ HTMLAttributes: t }) {
|
|
68
|
+
let n = c(t["data-variant"]);
|
|
69
69
|
return [
|
|
70
70
|
"aside",
|
|
71
|
-
|
|
71
|
+
e(this.options.HTMLAttributes, t, {
|
|
72
72
|
"data-type": this.name,
|
|
73
|
-
"data-variant":
|
|
73
|
+
"data-variant": n,
|
|
74
74
|
role: "note"
|
|
75
75
|
}),
|
|
76
76
|
[
|
|
@@ -86,7 +86,7 @@ var i = [
|
|
|
86
86
|
[
|
|
87
87
|
"span",
|
|
88
88
|
{ "data-callout-label": "" },
|
|
89
|
-
o[
|
|
89
|
+
o[n]
|
|
90
90
|
]
|
|
91
91
|
],
|
|
92
92
|
[
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { n as e } from "../../../../dist-SM4NoN4h.js";
|
|
2
2
|
import { getPopupMountTarget as t } from "../getPopupMountTarget.js";
|
|
3
|
-
import { t as n } from "../../../../tippy.esm-
|
|
3
|
+
import { t as n } from "../../../../tippy.esm-C8V6GlaF.js";
|
|
4
4
|
import { EmojiList as r } from "./EmojiList.js";
|
|
5
5
|
//#region lib/components/Scribe/extension/emoji/suggest.ts
|
|
6
6
|
var i = () => ({
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export { e as default };
|
|
1
|
+
export { t as default } from "../../../extension-link-DxIXGCtV.js";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { n as e } from "../../../dist-
|
|
2
|
-
import { n as t, t as n } from "../../../markdown-to-html-
|
|
1
|
+
import { n as e } from "../../../dist-BoAzo5MN.js";
|
|
2
|
+
import { n as t, t as n } from "../../../markdown-to-html-tCPjQ5u6.js";
|
|
3
3
|
import { Plugin as r, PluginKey as i } from "@tiptap/pm/state";
|
|
4
4
|
//#region lib/components/Scribe/extension/extension-markdown-paste.ts
|
|
5
5
|
var a = new i("markdownPaste"), o = /* @__PURE__ */ new Set([
|
|
@@ -10,12 +10,5 @@ export declare const normalizeExternalLinkPreviewHref: (value: unknown) => strin
|
|
|
10
10
|
/** Preview media may be proxied by a consumer through a strict root-relative path. */
|
|
11
11
|
export declare const normalizeExternalLinkPreviewMediaUrl: (value: unknown) => string | null;
|
|
12
12
|
export declare const normalizeExternalLinkPreviewMetadata: (metadata: ExternalLinkPreviewMetadata | Record<string, unknown> | null | undefined) => Required<ExternalLinkPreviewMetadata>;
|
|
13
|
-
/** Normalize only metadata fields that a resolver deliberately returned. */
|
|
14
|
-
export declare const normalizeExternalLinkPreviewMetadataPatch: (metadata: ExternalLinkPreviewMetadata) => Partial<Required<ExternalLinkPreviewMetadata>>;
|
|
15
13
|
export declare const normalizeExternalLinkPreviewAttributes: (input: Partial<Record<keyof ExternalLinkPreviewAttributes, unknown>>) => ExternalLinkPreviewAttributes | null;
|
|
16
|
-
export declare const getExternalLinkPreviewHostname: (href: string) => string;
|
|
17
|
-
/** Build a concise, presentation-only label without changing the authored destination. */
|
|
18
|
-
export declare const getExternalLinkPreviewReadableLabel: (href: string) => string;
|
|
19
|
-
export declare const getExternalLinkPreviewTitle: (attributes: Pick<ExternalLinkPreviewAttributes, "href" | "linkText" | "pageTitle" | "siteName">, display: ExternalLinkPreviewDisplay) => string;
|
|
20
|
-
export declare const hasExternalLinkPreviewMetadata: (attributes: Pick<ExternalLinkPreviewAttributes, "pageTitle" | "description" | "siteName" | "faviconUrl" | "imageUrl">) => boolean;
|
|
21
14
|
//# sourceMappingURL=attributes.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"attributes.d.ts","sourceRoot":"","sources":["../../../../../lib/components/Scribe/extension/external-link-preview/attributes.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,6BAA6B,EAClC,KAAK,0BAA0B,EAC/B,KAAK,2BAA2B,EACjC,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"attributes.d.ts","sourceRoot":"","sources":["../../../../../lib/components/Scribe/extension/external-link-preview/attributes.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,6BAA6B,EAClC,KAAK,0BAA0B,EAC/B,KAAK,2BAA2B,EACjC,MAAM,SAAS,CAAC;AAsCjB,8EAA8E;AAC9E,eAAO,MAAM,+BAA+B,wBAAwB,CAAC;AACrE,eAAO,MAAM,8BAA8B,8CAA4C,CAAC;AACxF,eAAO,MAAM,qCAAqC,gCAAgC,CAAC;AAEnF,eAAO,MAAM,4BAA4B,UAAW,OAAO,KAAG,KAAK,IAAI,0BAC2B,CAAC;AAwBnG,eAAO,MAAM,oCAAoC,UAAW,OAAO,KAAG,MAAM,GAAG,IACE,CAAC;AAElF,oGAAoG;AACpG,eAAO,MAAM,gCAAgC,UAAW,OAAO,KAAG,MAAM,GAAG,IAuB1E,CAAC;AAEF,sFAAsF;AACtF,eAAO,MAAM,oCAAoC,UAAW,OAAO,KAAG,MAAM,GAAG,IAwB9E,CAAC;AAcF,eAAO,MAAM,oCAAoC,aACrC,2BAA2B,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,GAAG,SAAS,KACjF,QAAQ,CAAC,2BAA2B,CAOrC,CAAC;AAEH,eAAO,MAAM,sCAAsC,UAC1C,OAAO,CAAC,MAAM,CAAC,MAAM,6BAA6B,EAAE,OAAO,CAAC,CAAC,KACnE,6BAA6B,GAAG,IAgBlC,CAAC"}
|