@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
|
@@ -4,13 +4,13 @@ import type { ExternalLinkDisplay, ExternalLinkPreviewAttributes, InsertExternal
|
|
|
4
4
|
declare module "@tiptap/core" {
|
|
5
5
|
interface Commands<ReturnType> {
|
|
6
6
|
externalLinkPreview: {
|
|
7
|
-
/** Insert an
|
|
7
|
+
/** @deprecated Insert a legacy node rendered as an ordinary link; no metadata is fetched. */
|
|
8
8
|
insertExternalLinkPreview: (options: InsertExternalLinkPreviewOptions) => ReturnType;
|
|
9
|
-
/**
|
|
9
|
+
/** @deprecated Only explicit conversion to plain is supported; compact/card return false. */
|
|
10
10
|
setExternalLinkDisplay: (display: ExternalLinkDisplay, targetPosition?: number) => ReturnType;
|
|
11
11
|
/** Atomically convert a preview to a Plain link while applying its edited destination. */
|
|
12
12
|
convertExternalLinkPreviewToPlain: (href: string, targetPosition?: number) => ReturnType;
|
|
13
|
-
/**
|
|
13
|
+
/** @deprecated Metadata fetching is retired; this command returns false. */
|
|
14
14
|
refreshExternalLinkPreview: (targetPosition?: number) => ReturnType;
|
|
15
15
|
/** Safely update the selected preview's destination, fallback text, or metadata. */
|
|
16
16
|
updateExternalLinkPreview: (options: UpdateExternalLinkPreviewOptions, targetPosition?: number) => ReturnType;
|
|
@@ -21,13 +21,9 @@ interface PreviewContext {
|
|
|
21
21
|
attributes: ExternalLinkPreviewAttributes;
|
|
22
22
|
node: ProseMirrorNode;
|
|
23
23
|
position: number;
|
|
24
|
-
isSoleTextblockContent: boolean;
|
|
25
24
|
}
|
|
26
25
|
export declare const getSelectedExternalLinkPreview: (transaction: Transaction, targetPosition?: number) => PreviewContext | null;
|
|
27
|
-
export declare const createExternalLinkPreviewCommands: (
|
|
28
|
-
resolveMetadata: boolean;
|
|
29
|
-
shouldPreview?: (href: string) => boolean;
|
|
30
|
-
}) => {
|
|
26
|
+
export declare const createExternalLinkPreviewCommands: () => {
|
|
31
27
|
insertExternalLinkPreview: (options: InsertExternalLinkPreviewOptions) => ({ dispatch, tr }: {
|
|
32
28
|
dispatch?: (args?: unknown) => unknown;
|
|
33
29
|
tr: Transaction;
|
|
@@ -40,10 +36,7 @@ export declare const createExternalLinkPreviewCommands: ({ resolveMetadata, shou
|
|
|
40
36
|
dispatch?: (args?: unknown) => unknown;
|
|
41
37
|
tr: Transaction;
|
|
42
38
|
}) => boolean;
|
|
43
|
-
refreshExternalLinkPreview: (
|
|
44
|
-
dispatch?: (args?: unknown) => unknown;
|
|
45
|
-
tr: Transaction;
|
|
46
|
-
}) => boolean;
|
|
39
|
+
refreshExternalLinkPreview: (_targetPosition?: number) => () => boolean;
|
|
47
40
|
updateExternalLinkPreview: (options: UpdateExternalLinkPreviewOptions, targetPosition?: number) => ({ dispatch, tr }: {
|
|
48
41
|
dispatch?: (args?: unknown) => unknown;
|
|
49
42
|
tr: Transaction;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"commands.d.ts","sourceRoot":"","sources":["../../../../../lib/components/Scribe/extension/external-link-preview/commands.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"commands.d.ts","sourceRoot":"","sources":["../../../../../lib/components/Scribe/extension/external-link-preview/commands.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,IAAI,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAChE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAQpD,OAAO,KAAK,EACV,mBAAmB,EACnB,6BAA6B,EAC7B,gCAAgC,EAChC,gCAAgC,EACjC,MAAM,SAAS,CAAC;AAEjB,OAAO,QAAQ,cAAc,CAAC;IAC5B,UAAU,QAAQ,CAAC,UAAU;QAC3B,mBAAmB,EAAE;YACnB,6FAA6F;YAC7F,yBAAyB,EAAE,CAAC,OAAO,EAAE,gCAAgC,KAAK,UAAU,CAAC;YACrF,6FAA6F;YAC7F,sBAAsB,EAAE,CAAC,OAAO,EAAE,mBAAmB,EAAE,cAAc,CAAC,EAAE,MAAM,KAAK,UAAU,CAAC;YAC9F,0FAA0F;YAC1F,iCAAiC,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,cAAc,CAAC,EAAE,MAAM,KAAK,UAAU,CAAC;YACzF,4EAA4E;YAC5E,0BAA0B,EAAE,CAAC,cAAc,CAAC,EAAE,MAAM,KAAK,UAAU,CAAC;YACpE,oFAAoF;YACpF,yBAAyB,EAAE,CACzB,OAAO,EAAE,gCAAgC,EACzC,cAAc,CAAC,EAAE,MAAM,KACpB,UAAU,CAAC;SACjB,CAAC;KACH;CACF;AAED,UAAU,cAAc;IACtB,UAAU,EAAE,6BAA6B,CAAC;IAC1C,IAAI,EAAE,eAAe,CAAC;IACtB,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,eAAO,MAAM,8BAA8B,gBAC5B,WAAW,mBACP,MAAM,KACtB,cAAc,GAAG,IA+BnB,CAAC;AA6BF,eAAO,MAAM,iCAAiC;IAC5C,yBAAyB,YACb,gCAAgC,wBACvB;QAAE,QAAQ,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,OAAO,KAAK,OAAO,CAAC;QAAC,EAAE,EAAE,WAAW,CAAA;KAAE;IA0BhF,sBAAsB,YACV,mBAAmB,mBAAmB,MAAM,wBACnC;QAAE,QAAQ,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,OAAO,KAAK,OAAO,CAAC;QAAC,EAAE,EAAE,WAAW,CAAA;KAAE;IAoBhF,iCAAiC,kBACf,MAAM,mBAAmB,MAAM,wBAC5B;QAAE,QAAQ,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,OAAO,KAAK,OAAO,CAAC;QAAC,EAAE,EAAE,WAAW,CAAA;KAAE;IAmBhF,0BAA0B,qBAAqB,MAAM;IACrD,yBAAyB,YACb,gCAAgC,mBAAmB,MAAM,wBAChD;QAAE,QAAQ,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,OAAO,KAAK,OAAO,CAAC;QAAC,EAAE,EAAE,WAAW,CAAA;KAAE;CAuDhF,CAAC"}
|
|
@@ -1,135 +1,70 @@
|
|
|
1
|
-
import { v as e } from "../../../../dist-
|
|
2
|
-
import { EXTERNAL_LINK_PREVIEW_NODE_NAME as t,
|
|
3
|
-
import { normalizeLinkUrl as
|
|
4
|
-
import {
|
|
5
|
-
import { NodeSelection as s, TextSelection as c } from "@tiptap/pm/state";
|
|
1
|
+
import { v as e } from "../../../../dist-DGEcUiqG.js";
|
|
2
|
+
import { EXTERNAL_LINK_PREVIEW_NODE_NAME as t, normalizeExternalLinkPreviewAttributes as n, normalizeExternalLinkPreviewHref as r } from "./attributes.js";
|
|
3
|
+
import { normalizeLinkUrl as i } from "../../../Menu/linkUrl.js";
|
|
4
|
+
import { NodeSelection as a, TextSelection as o } from "@tiptap/pm/state";
|
|
6
5
|
//#region lib/components/Scribe/extension/external-link-preview/commands.ts
|
|
7
|
-
var
|
|
8
|
-
let { selection:
|
|
6
|
+
var s = (e, t) => {
|
|
7
|
+
let { selection: r } = e, i = typeof t == "number";
|
|
9
8
|
if (i && (!Number.isInteger(t) || t < 0 || t >= e.doc.content.size)) return null;
|
|
10
|
-
let
|
|
11
|
-
if (!
|
|
12
|
-
let c =
|
|
13
|
-
|
|
14
|
-
let l = e.doc.resolve(a);
|
|
15
|
-
return {
|
|
9
|
+
let o = i ? t : r.from, s = i ? e.doc.nodeAt(o) : r instanceof a ? r.node : null;
|
|
10
|
+
if (!s || s.type.name !== "externalLinkPreview") return null;
|
|
11
|
+
let c = n(s.attrs);
|
|
12
|
+
return c ? {
|
|
16
13
|
attributes: c,
|
|
17
|
-
node:
|
|
18
|
-
position:
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
if (!n) return null;
|
|
24
|
-
let { selection: r } = t;
|
|
25
|
-
if (!r.$from.sameParent(r.$to) || !r.$from.parent.isTextblock) return null;
|
|
26
|
-
let a = e(r.$from, n), o = r.$from.start(), s = r.$from.parent;
|
|
27
|
-
if (!a) return null;
|
|
28
|
-
let c, l = !0, u = "";
|
|
29
|
-
t.doc.nodesBetween(a.from, a.to, (e, t) => {
|
|
30
|
-
if (!e.isText) {
|
|
31
|
-
e.isInline && (l = !1);
|
|
32
|
-
return;
|
|
33
|
-
}
|
|
34
|
-
let r = e.marks.find((e) => e.type === n), i = Math.max(a.from, t), o = Math.min(a.to, t + e.nodeSize);
|
|
35
|
-
if (!r || e.marks.some((e) => e.type !== n) || c && r.attrs.href !== c.attrs.href) {
|
|
36
|
-
l = !1;
|
|
37
|
-
return;
|
|
38
|
-
}
|
|
39
|
-
c = r, u += e.text?.slice(i - t, o - t) ?? "";
|
|
40
|
-
});
|
|
41
|
-
let d = i(c?.attrs.href);
|
|
42
|
-
return !l || !c || !d ? null : {
|
|
43
|
-
href: d,
|
|
44
|
-
linkText: u || d,
|
|
45
|
-
mark: c,
|
|
46
|
-
from: a.from,
|
|
47
|
-
to: a.to,
|
|
48
|
-
isSoleTextblockContent: a.from === o && a.to === o + s.content.size
|
|
49
|
-
};
|
|
50
|
-
}, d = (e, t) => {
|
|
51
|
-
if (!t) return !0;
|
|
52
|
-
try {
|
|
53
|
-
return t(e);
|
|
54
|
-
} catch {
|
|
55
|
-
return !1;
|
|
56
|
-
}
|
|
57
|
-
}, f = (e, t) => {
|
|
58
|
-
e.setSelection(s.create(e.doc, t));
|
|
59
|
-
}, p = (e, t) => e.doc.type.schema.nodes.externalLinkPreview?.create(t) ?? null, m = (e, t, n = t.attributes.href, r = t.attributes.linkText) => {
|
|
14
|
+
node: s,
|
|
15
|
+
position: o
|
|
16
|
+
} : null;
|
|
17
|
+
}, c = (e, t) => {
|
|
18
|
+
e.setSelection(a.create(e.doc, t));
|
|
19
|
+
}, l = (e, t, n = t.attributes.href, r = t.attributes.linkText) => {
|
|
60
20
|
let i = e.doc.type.schema.marks.link, a = e.doc.resolve(t.position).parent;
|
|
61
21
|
if (!i || !a.type.allowsMarkType(i)) return !1;
|
|
62
|
-
let
|
|
63
|
-
return e.replaceWith(t.position, t.position + t.node.nodeSize,
|
|
64
|
-
},
|
|
65
|
-
insertExternalLinkPreview: (
|
|
66
|
-
let
|
|
67
|
-
...
|
|
68
|
-
linkText:
|
|
69
|
-
display:
|
|
70
|
-
}),
|
|
71
|
-
if (!
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
return
|
|
22
|
+
let s = e.doc.type.schema.text(r, [i.create({ href: n })]);
|
|
23
|
+
return e.replaceWith(t.position, t.position + t.node.nodeSize, s), e.setSelection(o.create(e.doc, t.position, t.position + s.nodeSize)), !0;
|
|
24
|
+
}, u = () => ({
|
|
25
|
+
insertExternalLinkPreview: (e) => ({ dispatch: r, tr: i }) => {
|
|
26
|
+
let a = n({
|
|
27
|
+
...e,
|
|
28
|
+
linkText: e.linkText ?? e.href,
|
|
29
|
+
display: e.display ?? "compact"
|
|
30
|
+
}), o = i.doc.type.schema.nodes[t], { selection: s } = i;
|
|
31
|
+
if (!a || !o || !s.$from.sameParent(s.$to) || !s.$from.parent.isTextblock || !s.$from.parent.canReplaceWith(s.$from.index(), s.$to.index(), o)) return !1;
|
|
32
|
+
if (r) {
|
|
33
|
+
let e = s.from;
|
|
34
|
+
i.replaceRangeWith(s.from, s.to, o.create(a)), c(i, e);
|
|
35
|
+
}
|
|
36
|
+
return !0;
|
|
77
37
|
},
|
|
78
|
-
setExternalLinkDisplay: (t,
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
let e = c.doc.type.schema.marks.link, t = c.doc.resolve(g.position).parent;
|
|
85
|
-
return !e || !t.type.allowsMarkType(e) ? h() : !a || m(c, g);
|
|
86
|
-
}
|
|
87
|
-
return t !== "compact" && t !== "card" || r && !e ? h() : !a || g.attributes.display === t || (c.setNodeMarkup(g.position, void 0, {
|
|
88
|
-
...g.attributes,
|
|
89
|
-
display: t
|
|
90
|
-
}), f(c, g.position), r && o(c, g.position, g.attributes.href), !0);
|
|
38
|
+
setExternalLinkDisplay: (t, n) => ({ dispatch: r, tr: i }) => {
|
|
39
|
+
if (t !== "plain") return i.setMeta("preventDispatch", !0), !1;
|
|
40
|
+
let a = s(i, n);
|
|
41
|
+
if (a) {
|
|
42
|
+
let e = i.doc.type.schema.marks.link, t = i.doc.resolve(a.position).parent;
|
|
43
|
+
return !!(e && t.type.allowsMarkType(e)) && (!r || l(i, a));
|
|
91
44
|
}
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
if (!_ || t === "plain" || t === "card" && !e || t === "card" && !_.isSoleTextblockContent || !d(_.href, s)) return t === "plain" && _ ? !0 : h();
|
|
95
|
-
let v = r({
|
|
96
|
-
href: _.href,
|
|
97
|
-
linkText: _.linkText,
|
|
98
|
-
display: t
|
|
99
|
-
}), y = v ? p(c, v) : null;
|
|
100
|
-
return !v || !y ? h() : !a || (c.replaceWith(_.from, _.to, y), f(c, _.from), t === "card" && o(c, _.from, v.href), !0);
|
|
45
|
+
let o = i.doc.type.schema.marks.link;
|
|
46
|
+
return typeof n != "number" && !!(o && e(i.selection.$from, o));
|
|
101
47
|
},
|
|
102
48
|
convertExternalLinkPreviewToPlain: (e, t) => ({ dispatch: n, tr: r }) => {
|
|
103
|
-
let
|
|
104
|
-
if (!o || !
|
|
105
|
-
let
|
|
106
|
-
return !
|
|
107
|
-
},
|
|
108
|
-
refreshExternalLinkPreview: (t) => ({ dispatch: n, tr: r }) => {
|
|
109
|
-
let i = l(r, t);
|
|
110
|
-
return !i || i.attributes.display !== "card" || !e || !d(i.attributes.href, s) ? !1 : (n && (typeof t == "number" && f(r, i.position), o(r, i.position, i.attributes.href), r.setMeta("addToHistory", !1)), !0);
|
|
49
|
+
let a = s(r, t), o = i(e), c = r.doc.type.schema.marks.link;
|
|
50
|
+
if (!a || !o || !c || !r.doc.resolve(a.position).parent.type.allowsMarkType(c)) return r.setMeta("preventDispatch", !0), !1;
|
|
51
|
+
let u = a.attributes.linkText === a.attributes.href ? o : a.attributes.linkText;
|
|
52
|
+
return !n || l(r, a, o, u);
|
|
111
53
|
},
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
fetchedAt: null
|
|
124
|
-
} : {}, y = r({
|
|
125
|
-
...p.attributes,
|
|
126
|
-
...v,
|
|
127
|
-
..._,
|
|
128
|
-
href: h,
|
|
129
|
-
linkText: t.linkText ?? (g && p.attributes.linkText === p.attributes.href ? h : p.attributes.linkText)
|
|
54
|
+
refreshExternalLinkPreview: (e) => () => !1,
|
|
55
|
+
updateExternalLinkPreview: (e, t) => ({ dispatch: i, tr: a }) => {
|
|
56
|
+
let o = () => (a.setMeta("preventDispatch", !0), !1), l = s(a, t);
|
|
57
|
+
if (!l) return o();
|
|
58
|
+
let u = e.href ?? l.attributes.href, d = r(u), f = d !== l.attributes.href;
|
|
59
|
+
if (!d) return o();
|
|
60
|
+
let p = Object.fromEntries(Object.entries(e).filter(([, e]) => e !== void 0)), m = n({
|
|
61
|
+
...l.attributes,
|
|
62
|
+
...p,
|
|
63
|
+
href: d,
|
|
64
|
+
linkText: e.linkText ?? (f && l.attributes.linkText === l.attributes.href ? d : l.attributes.linkText)
|
|
130
65
|
});
|
|
131
|
-
return
|
|
66
|
+
return m ? !Object.entries(m).some(([e, t]) => l.attributes[e] !== t) || !i || (a.setNodeMarkup(l.position, void 0, m), c(a, l.position), !0) : o();
|
|
132
67
|
}
|
|
133
68
|
});
|
|
134
69
|
//#endregion
|
|
135
|
-
export {
|
|
70
|
+
export { u as createExternalLinkPreviewCommands, s as getSelectedExternalLinkPreview };
|
|
@@ -1,11 +1,9 @@
|
|
|
1
|
-
import type { ExternalLinkPreviewOptions } from "./types";
|
|
2
1
|
/**
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
* @experimental The link-preview API and built-in UI may change while this feature is tested.
|
|
2
|
+
* @deprecated Compatibility reader for saved external-link previews.
|
|
3
|
+
* Legacy attributes are retained, but links render as ordinary authored text.
|
|
4
|
+
* No metadata requests, preview creation UI, or automatic document conversions run.
|
|
7
5
|
*/
|
|
8
|
-
export declare const ExternalLinkPreview: import("@tiptap/core").Node<ExternalLinkPreviewOptions, any>;
|
|
6
|
+
export declare const ExternalLinkPreview: import("@tiptap/core").Node<import("./types").ExternalLinkPreviewOptions, any>;
|
|
9
7
|
export { EXTERNAL_LINK_PREVIEW_NODE_NAME } from "./attributes";
|
|
10
8
|
export { EXTERNAL_LINK_PREVIEW_DISPLAYS } from "./types";
|
|
11
9
|
export type { ExternalLinkDisplay, ExternalLinkPreviewAttributes, ExternalLinkPreviewDisplay, ExternalLinkPreviewMetadata, ExternalLinkPreviewOptions, ExternalLinkPreviewResolutionStatus, ExternalLinkPreviewResolver, ExternalLinkPreviewResolverContext, InsertExternalLinkPreviewOptions, UpdateExternalLinkPreviewOptions, } from "./types";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../lib/components/Scribe/extension/external-link-preview/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../lib/components/Scribe/extension/external-link-preview/index.ts"],"names":[],"mappings":"AAGA;;;;GAIG;AACH,eAAO,MAAM,mBAAmB,gFAI9B,CAAC;AAEH,OAAO,EAAE,+BAA+B,EAAE,MAAM,cAAc,CAAC;AAC/D,OAAO,EAAE,8BAA8B,EAAE,MAAM,SAAS,CAAC;AACzD,YAAY,EACV,mBAAmB,EACnB,6BAA6B,EAC7B,0BAA0B,EAC1B,2BAA2B,EAC3B,0BAA0B,EAC1B,mCAAmC,EACnC,2BAA2B,EAC3B,kCAAkC,EAClC,gCAAgC,EAChC,gCAAgC,GACjC,MAAM,SAAS,CAAC"}
|
|
@@ -1,46 +1,10 @@
|
|
|
1
1
|
import { EXTERNAL_LINK_PREVIEW_DISPLAYS as e } from "./types.js";
|
|
2
2
|
import { EXTERNAL_LINK_PREVIEW_NODE_NAME as t } from "./attributes.js";
|
|
3
3
|
import { ExternalLinkPreviewSchema as n } from "./schema.js";
|
|
4
|
-
import { r } from "
|
|
5
|
-
import { createExternalLinkPreviewResolverPlugin as i } from "./resolver.js";
|
|
6
|
-
import { createExternalLinkPreviewCommands as a } from "./commands.js";
|
|
7
|
-
import { ExternalLinkPreviewNodeView as o } from "./node-view.js";
|
|
8
|
-
import { createExternalLinkPreviewNormalizationPlugin as s, createExternalLinkPreviewNormalizationTransaction as c } from "./normalization.js";
|
|
9
|
-
import { createExternalLinkPreviewPastePlugin as l } from "./paste.js";
|
|
10
|
-
import { createExternalLinkPreviewPolicyPlugin as u, createExternalLinkPreviewPolicyTransaction as d } from "./policy.js";
|
|
4
|
+
import { createExternalLinkPreviewCommands as r } from "./commands.js";
|
|
11
5
|
//#region lib/components/Scribe/extension/external-link-preview/index.ts
|
|
12
|
-
var
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
resolveMetadata: !!this.options.resolve,
|
|
16
|
-
shouldPreview: this.options.shouldPreview
|
|
17
|
-
});
|
|
18
|
-
},
|
|
19
|
-
addNodeView() {
|
|
20
|
-
return r(o, { trackNodeViewPosition: !0 });
|
|
21
|
-
},
|
|
22
|
-
onCreate() {
|
|
23
|
-
if (this.editor.isDestroyed) return;
|
|
24
|
-
let e = c(this.editor.state);
|
|
25
|
-
e && this.editor.view.dispatch(e.setMeta("addToHistory", !1));
|
|
26
|
-
let t = d(this.editor.state, this.options.shouldPreview);
|
|
27
|
-
t && this.editor.view.dispatch(t);
|
|
28
|
-
},
|
|
29
|
-
addProseMirrorPlugins() {
|
|
30
|
-
return [
|
|
31
|
-
l({
|
|
32
|
-
previewType: this.type,
|
|
33
|
-
autoPreviewOnPaste: this.options.autoPreviewOnPaste === !0,
|
|
34
|
-
shouldPreview: this.options.shouldPreview
|
|
35
|
-
}),
|
|
36
|
-
u(this.options.shouldPreview),
|
|
37
|
-
s(),
|
|
38
|
-
i({
|
|
39
|
-
editor: this.editor,
|
|
40
|
-
resolve: this.options.resolve
|
|
41
|
-
})
|
|
42
|
-
];
|
|
43
|
-
}
|
|
44
|
-
});
|
|
6
|
+
var i = n.extend({ addCommands() {
|
|
7
|
+
return r();
|
|
8
|
+
} });
|
|
45
9
|
//#endregion
|
|
46
|
-
export { e as EXTERNAL_LINK_PREVIEW_DISPLAYS, t as EXTERNAL_LINK_PREVIEW_NODE_NAME,
|
|
10
|
+
export { e as EXTERNAL_LINK_PREVIEW_DISPLAYS, t as EXTERNAL_LINK_PREVIEW_NODE_NAME, i as ExternalLinkPreview };
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { DOMOutputSpec } from "@tiptap/pm/model";
|
|
2
2
|
import type { ExternalLinkPreviewAttributes } from "./types";
|
|
3
|
+
/** Preserve the legacy wrapper and attributes while displaying only its authored link. */
|
|
3
4
|
export declare const renderExternalLinkPreviewHTML: ({ attributes, HTMLAttributes, }: {
|
|
4
5
|
attributes: ExternalLinkPreviewAttributes;
|
|
5
6
|
HTMLAttributes?: Record<string, unknown>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"render-html.d.ts","sourceRoot":"","sources":["../../../../../lib/components/Scribe/extension/external-link-preview/render-html.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"render-html.d.ts","sourceRoot":"","sources":["../../../../../lib/components/Scribe/extension/external-link-preview/render-html.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEtD,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,SAAS,CAAC;AAE7D,0FAA0F;AAC1F,eAAO,MAAM,6BAA6B,oCAGvC;IACD,UAAU,EAAE,6BAA6B,CAAC;IAC1C,cAAc,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAC1C,KAAG,aAaH,CAAC"}
|
|
@@ -1,62 +1,19 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { getExternalLinkPreviewDataAttributes as r } from "./serialization.js";
|
|
1
|
+
import { B as e } from "../../../../dist-DGEcUiqG.js";
|
|
2
|
+
import { getExternalLinkPreviewDataAttributes as t } from "./serialization.js";
|
|
4
3
|
//#region lib/components/Scribe/extension/external-link-preview/render-html.ts
|
|
5
|
-
var
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
]), [
|
|
20
|
-
"span",
|
|
21
|
-
{ "data-link-preview-main": "" },
|
|
22
|
-
e.display === "card" && e.faviconUrl ? ["img", {
|
|
23
|
-
"data-link-preview-favicon": "",
|
|
24
|
-
src: e.faviconUrl,
|
|
25
|
-
alt: ""
|
|
26
|
-
}] : [
|
|
27
|
-
"span",
|
|
28
|
-
{
|
|
29
|
-
"data-link-preview-favicon-fallback": "",
|
|
30
|
-
"aria-hidden": "true"
|
|
31
|
-
},
|
|
32
|
-
"↗"
|
|
33
|
-
],
|
|
34
|
-
[
|
|
35
|
-
"span",
|
|
36
|
-
{ "data-link-preview-copy": "" },
|
|
37
|
-
...r
|
|
38
|
-
]
|
|
39
|
-
];
|
|
40
|
-
}, a = ({ attributes: t, HTMLAttributes: n }) => {
|
|
41
|
-
let a = [];
|
|
42
|
-
return t.display === "card" && t.imageUrl && a.push(["img", {
|
|
43
|
-
"data-link-preview-image": "",
|
|
44
|
-
src: t.imageUrl,
|
|
45
|
-
alt: ""
|
|
46
|
-
}]), a.push(i(t)), [
|
|
47
|
-
"span",
|
|
48
|
-
e(n ?? {}, r(t), { class: `scribe-external-link-preview scribe-external-link-preview--${t.display}` }),
|
|
49
|
-
[
|
|
50
|
-
"a",
|
|
51
|
-
{
|
|
52
|
-
"data-link-preview-target": "",
|
|
53
|
-
href: t.href,
|
|
54
|
-
target: "_blank",
|
|
55
|
-
rel: "noopener noreferrer"
|
|
56
|
-
},
|
|
57
|
-
...a
|
|
58
|
-
]
|
|
59
|
-
];
|
|
60
|
-
};
|
|
4
|
+
var n = ({ attributes: n, HTMLAttributes: r }) => [
|
|
5
|
+
"span",
|
|
6
|
+
e(r ?? {}, t(n)),
|
|
7
|
+
[
|
|
8
|
+
"a",
|
|
9
|
+
{
|
|
10
|
+
"data-link-preview-target": "",
|
|
11
|
+
href: n.href,
|
|
12
|
+
target: "_blank",
|
|
13
|
+
rel: "noopener noreferrer"
|
|
14
|
+
},
|
|
15
|
+
n.linkText
|
|
16
|
+
]
|
|
17
|
+
];
|
|
61
18
|
//#endregion
|
|
62
|
-
export {
|
|
19
|
+
export { n as renderExternalLinkPreviewHTML };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Node } from "@tiptap/core";
|
|
2
2
|
import type { ExternalLinkPreviewOptions } from "./types";
|
|
3
3
|
/**
|
|
4
|
-
*
|
|
5
|
-
*
|
|
4
|
+
* Compatibility schema for saved external-link previews. Attributes survive
|
|
5
|
+
* round trips while both editor and headless output render ordinary authored links.
|
|
6
6
|
*/
|
|
7
7
|
export declare const ExternalLinkPreviewSchema: Node<ExternalLinkPreviewOptions, any>;
|
|
8
8
|
//# sourceMappingURL=schema.d.ts.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as e } from "../../../../dist-
|
|
1
|
+
import { a as e } from "../../../../dist-DGEcUiqG.js";
|
|
2
2
|
import { EXTERNAL_LINK_PREVIEW_NODE_NAME as t, isExternalLinkPreviewDisplay as n, normalizeExternalLinkPreviewAttributes as r, normalizeExternalLinkPreviewHref as i, normalizeExternalLinkPreviewLinkText as a, normalizeExternalLinkPreviewMediaUrl as o, normalizeExternalLinkPreviewMetadata as s } from "./attributes.js";
|
|
3
3
|
import { getExternalLinkPreviewAttributesFromElement as c } from "./serialization.js";
|
|
4
4
|
import { renderExternalLinkPreviewHTML as l } from "./render-html.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"serialization.d.ts","sourceRoot":"","sources":["../../../../../lib/components/Scribe/extension/external-link-preview/serialization.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"serialization.d.ts","sourceRoot":"","sources":["../../../../../lib/components/Scribe/extension/external-link-preview/serialization.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,SAAS,CAAC;AAc7D,eAAO,MAAM,2CAA2C,YAC7C,OAAO,KACf,6BAA6B,GAAG,IAiBlC,CAAC;AAEF,eAAO,MAAM,oCAAoC,eAAgB,6BAA6B,2BAgB7F,CAAC;AAEF,eAAO,MAAM,iCAAiC,YACnC,OAAO,cACJ,6BAA6B,SAe1C,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,mCAAmC,YAAa,OAAO,KAAG,OAUtE,CAAC;AAEF,eAAO,MAAM,mCAAmC,SAAU,OAAO,KAAG,IAwBnE,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { EXTERNAL_LINK_PREVIEW_SELECTOR as e, EXTERNAL_LINK_PREVIEW_TARGET_SELECTOR as t,
|
|
1
|
+
import { EXTERNAL_LINK_PREVIEW_SELECTOR as e, EXTERNAL_LINK_PREVIEW_TARGET_SELECTOR as t, normalizeExternalLinkPreviewAttributes as n } from "./attributes.js";
|
|
2
2
|
//#region lib/components/Scribe/extension/external-link-preview/serialization.ts
|
|
3
|
-
var
|
|
3
|
+
var r = {
|
|
4
4
|
href: "data-href",
|
|
5
5
|
linkText: "data-link-text",
|
|
6
6
|
display: "data-display",
|
|
@@ -10,53 +10,37 @@ var a = {
|
|
|
10
10
|
faviconUrl: "data-favicon-url",
|
|
11
11
|
imageUrl: "data-image-url",
|
|
12
12
|
fetchedAt: "data-fetched-at"
|
|
13
|
-
},
|
|
14
|
-
let
|
|
15
|
-
return
|
|
16
|
-
href:
|
|
17
|
-
linkText: e.getAttribute(
|
|
18
|
-
display: e.getAttribute(
|
|
19
|
-
pageTitle: e.getAttribute(
|
|
20
|
-
description: e.getAttribute(
|
|
21
|
-
siteName: e.getAttribute(
|
|
22
|
-
faviconUrl: e.getAttribute(
|
|
23
|
-
imageUrl: e.getAttribute(
|
|
24
|
-
fetchedAt: e.getAttribute(
|
|
13
|
+
}, i = (e) => {
|
|
14
|
+
let i = Array.from(e.children).find((e) => e.matches(t)), a = e.getAttribute(r.href) ?? i?.getAttribute("href");
|
|
15
|
+
return n({
|
|
16
|
+
href: a,
|
|
17
|
+
linkText: e.getAttribute(r.linkText) ?? a,
|
|
18
|
+
display: e.getAttribute(r.display),
|
|
19
|
+
pageTitle: e.getAttribute(r.pageTitle),
|
|
20
|
+
description: e.getAttribute(r.description),
|
|
21
|
+
siteName: e.getAttribute(r.siteName),
|
|
22
|
+
faviconUrl: e.getAttribute(r.faviconUrl),
|
|
23
|
+
imageUrl: e.getAttribute(r.imageUrl),
|
|
24
|
+
fetchedAt: e.getAttribute(r.fetchedAt)
|
|
25
25
|
});
|
|
26
|
-
},
|
|
26
|
+
}, a = (e) => {
|
|
27
27
|
let t = { "data-type": "external-link-preview" };
|
|
28
|
-
return Object.keys(
|
|
29
|
-
let
|
|
30
|
-
|
|
28
|
+
return Object.keys(r).forEach((n) => {
|
|
29
|
+
let i = e[n];
|
|
30
|
+
i !== null && (t[r[n]] = i);
|
|
31
31
|
}), t;
|
|
32
|
-
},
|
|
33
|
-
let
|
|
34
|
-
|
|
35
|
-
}, l = (e, t) => {
|
|
36
|
-
let i = e.ownerDocument, a = i.createElement("a"), o = i.createElement("span"), l = i.createElement("span");
|
|
37
|
-
if (Array.from(e.attributes).forEach((t) => e.removeAttribute(t.name)), Object.entries(s(t)).forEach(([t, n]) => {
|
|
32
|
+
}, o = (e, t) => {
|
|
33
|
+
let n = e.ownerDocument.createElement("a");
|
|
34
|
+
Array.from(e.attributes).forEach((t) => e.removeAttribute(t.name)), Object.entries(a(t)).forEach(([t, n]) => {
|
|
38
35
|
e.setAttribute(t, n);
|
|
39
|
-
}),
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
let e = i.createElement("img");
|
|
45
|
-
e.setAttribute("data-link-preview-favicon", ""), e.setAttribute("src", t.faviconUrl), e.setAttribute("alt", ""), o.append(e);
|
|
46
|
-
} else {
|
|
47
|
-
let e = c(i, "data-link-preview-favicon-fallback", "↗");
|
|
48
|
-
e.setAttribute("aria-hidden", "true"), o.append(e);
|
|
49
|
-
}
|
|
50
|
-
l.setAttribute("data-link-preview-copy", ""), l.append(c(i, "data-link-preview-title", r(t, t.display)));
|
|
51
|
-
let u = t.display === "card" ? t.siteName || n(t.href) : null;
|
|
52
|
-
u && l.append(c(i, "data-link-preview-site", u)), t.display === "card" && t.description && l.append(c(i, "data-link-preview-description", t.description)), o.append(l), a.append(o), e.replaceChildren(a);
|
|
53
|
-
}, u = (e) => {
|
|
54
|
-
let t = o(e);
|
|
55
|
-
return t ? (l(e, t), !0) : !1;
|
|
56
|
-
}, d = (t) => {
|
|
36
|
+
}), n.setAttribute("data-link-preview-target", ""), n.setAttribute("href", t.href), n.setAttribute("target", "_blank"), n.setAttribute("rel", "noopener noreferrer"), n.textContent = t.linkText, e.replaceChildren(n);
|
|
37
|
+
}, s = (e) => {
|
|
38
|
+
let t = i(e);
|
|
39
|
+
return t ? (o(e, t), !0) : !1;
|
|
40
|
+
}, c = (t) => {
|
|
57
41
|
[...t.matches("span[data-type=\"external-link-preview\"]") ? [t] : [], ...Array.from(t.querySelectorAll(e))].forEach((e) => {
|
|
58
|
-
let n = e.getAttribute(
|
|
59
|
-
if (!
|
|
42
|
+
let n = e.getAttribute(r.linkText) ?? e.textContent ?? "";
|
|
43
|
+
if (!s(e)) {
|
|
60
44
|
if (e === t) {
|
|
61
45
|
Array.from(e.attributes).forEach((t) => e.removeAttribute(t.name)), e.replaceChildren(e.ownerDocument.createTextNode(n));
|
|
62
46
|
return;
|
|
@@ -66,4 +50,4 @@ var a = {
|
|
|
66
50
|
});
|
|
67
51
|
};
|
|
68
52
|
//#endregion
|
|
69
|
-
export {
|
|
53
|
+
export { i as getExternalLinkPreviewAttributesFromElement, a as getExternalLinkPreviewDataAttributes, s as normalizeExternalLinkPreviewElement, c as normalizeExternalLinkPreviewsInTree, o as rebuildExternalLinkPreviewElement };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
/** @
|
|
1
|
+
/** @deprecated Retained for saved external-link-preview compatibility. */
|
|
2
2
|
export declare const EXTERNAL_LINK_PREVIEW_DISPLAYS: readonly ["compact", "card"];
|
|
3
|
-
/** @
|
|
3
|
+
/** @deprecated Retained for saved external-link-preview compatibility. */
|
|
4
4
|
export type ExternalLinkPreviewDisplay = (typeof EXTERNAL_LINK_PREVIEW_DISPLAYS)[number];
|
|
5
|
-
/** @
|
|
5
|
+
/** @deprecated Retained for saved external-link-preview compatibility. */
|
|
6
6
|
export interface ExternalLinkPreviewMetadata {
|
|
7
7
|
pageTitle?: string | null;
|
|
8
8
|
description?: string | null;
|
|
@@ -11,7 +11,7 @@ export interface ExternalLinkPreviewMetadata {
|
|
|
11
11
|
imageUrl?: string | null;
|
|
12
12
|
fetchedAt?: string | null;
|
|
13
13
|
}
|
|
14
|
-
/** @
|
|
14
|
+
/** @deprecated Retained for saved external-link-preview compatibility. */
|
|
15
15
|
export interface ExternalLinkPreviewAttributes {
|
|
16
16
|
href: string;
|
|
17
17
|
linkText: string;
|
|
@@ -23,38 +23,35 @@ export interface ExternalLinkPreviewAttributes {
|
|
|
23
23
|
imageUrl: string | null;
|
|
24
24
|
fetchedAt: string | null;
|
|
25
25
|
}
|
|
26
|
-
/** @
|
|
26
|
+
/** @deprecated Retained for saved external-link-preview compatibility. */
|
|
27
27
|
export interface ExternalLinkPreviewResolverContext {
|
|
28
28
|
signal: AbortSignal;
|
|
29
29
|
}
|
|
30
|
-
/** @
|
|
30
|
+
/** @deprecated Retained for saved external-link-preview compatibility. */
|
|
31
31
|
export type ExternalLinkPreviewResolver = (href: string, context: ExternalLinkPreviewResolverContext) => Promise<ExternalLinkPreviewMetadata | null>;
|
|
32
|
-
/** @
|
|
32
|
+
/** @deprecated Retained for saved external-link-preview compatibility. */
|
|
33
33
|
export interface ExternalLinkPreviewOptions {
|
|
34
34
|
HTMLAttributes?: Record<string, unknown>;
|
|
35
|
-
/**
|
|
36
|
-
* Automatically turn a standalone pasted URL into a local Compact preview.
|
|
37
|
-
* This does not request metadata.
|
|
38
|
-
* @default false
|
|
39
|
-
*/
|
|
35
|
+
/** @deprecated Ignored. Paste uses native Tiptap Link behavior. */
|
|
40
36
|
autoPreviewOnPaste?: boolean;
|
|
41
|
-
/**
|
|
37
|
+
/** @deprecated Ignored. Scribe no longer fetches preview metadata. */
|
|
42
38
|
resolve?: ExternalLinkPreviewResolver;
|
|
39
|
+
/** @deprecated Ignored. Saved nodes are never converted by a preview policy. */
|
|
43
40
|
shouldPreview?: (href: string) => boolean;
|
|
44
41
|
}
|
|
45
|
-
/** @
|
|
42
|
+
/** @deprecated Retained for saved external-link-preview compatibility. */
|
|
46
43
|
export interface InsertExternalLinkPreviewOptions extends ExternalLinkPreviewMetadata {
|
|
47
44
|
href: string;
|
|
48
45
|
linkText?: string;
|
|
49
46
|
display?: ExternalLinkPreviewDisplay;
|
|
50
47
|
}
|
|
51
|
-
/** @
|
|
48
|
+
/** @deprecated Retained for saved external-link-preview compatibility. */
|
|
52
49
|
export interface UpdateExternalLinkPreviewOptions extends ExternalLinkPreviewMetadata {
|
|
53
50
|
href?: string;
|
|
54
51
|
linkText?: string;
|
|
55
52
|
}
|
|
56
|
-
/** @
|
|
53
|
+
/** @deprecated Retained for saved external-link-preview compatibility. */
|
|
57
54
|
export type ExternalLinkDisplay = "plain" | ExternalLinkPreviewDisplay;
|
|
58
|
-
/** @
|
|
55
|
+
/** @deprecated Retained for saved external-link-preview compatibility. */
|
|
59
56
|
export type ExternalLinkPreviewResolutionStatus = "idle" | "loading" | "error";
|
|
60
57
|
//# sourceMappingURL=types.d.ts.map
|