@inpageedit/core 0.14.4 → 0.14.5
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/dist/{index-DVOc6fB6.js → index-7R2LfhNn.js} +62 -53
- package/dist/index-7R2LfhNn.js.map +1 -0
- package/dist/{index-BdHmr8jw.js → index-DxaqNWv4.js} +3 -3
- package/dist/{index-BdHmr8jw.js.map → index-DxaqNWv4.js.map} +1 -1
- package/dist/index.d.ts +9 -8
- package/dist/index.js +2 -2
- package/dist/plugins/index.js +1 -1
- package/dist/services/index.js +1 -1
- package/dist/style.css +1 -1
- package/lib/index.umd.js +2 -2
- package/lib/index.umd.js.map +1 -1
- package/lib/style.css +1 -1
- package/package.json +1 -1
- package/dist/index-DVOc6fB6.js.map +0 -1
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
import { j as p } from "./index-CM_6yF2v.js";
|
|
2
|
-
import { I as
|
|
3
|
-
import { B as
|
|
4
|
-
import { I as
|
|
5
|
-
var
|
|
2
|
+
import { I as C, R as D, S as m } from "./Preferences-C10tZMl1.js";
|
|
3
|
+
import { B as $ } from "./BasePlugin-DD7l-5Xw.js";
|
|
4
|
+
import { I as P } from "./IconQuickEdit-CMCQncyj.js";
|
|
5
|
+
var R = Object.create, g = Object.defineProperty, j = Object.getOwnPropertyDescriptor, E = (t, e) => (e = Symbol[t]) ? e : Symbol.for("Symbol." + t), y = (t) => {
|
|
6
6
|
throw TypeError(t);
|
|
7
|
-
},
|
|
8
|
-
for (var
|
|
7
|
+
}, N = (t, e, i) => e in t ? g(t, e, { enumerable: !0, configurable: !0, writable: !0, value: i }) : t[e] = i, Q = (t, e) => g(t, "name", { value: e, configurable: !0 }), T = (t) => [, , , R(t?.[E("metadata")] ?? null)], B = ["class", "method", "getter", "setter", "accessor", "field", "value", "get", "set"], I = (t) => t !== void 0 && typeof t != "function" ? y("Function expected") : t, O = (t, e, i, r, n) => ({ kind: B[t], name: e, metadata: r, addInitializer: (o) => i._ ? y("Already initialized") : n.push(I(o || null)) }), W = (t, e) => N(e, E("metadata"), t[3]), z = (t, e, i, r) => {
|
|
8
|
+
for (var n = 0, o = t[e >> 1], s = o && o.length; n < s; n++) o[n].call(i);
|
|
9
9
|
return r;
|
|
10
|
-
}, F = (t, e,
|
|
11
|
-
var s, a, d,
|
|
12
|
-
|
|
10
|
+
}, F = (t, e, i, r, n, o) => {
|
|
11
|
+
var s, a, d, l = e & 7, c = !1, f = 0, u = t[f] || (t[f] = []), h = l && (n = n.prototype, l < 5 && (l > 3 || !c) && j(n, i));
|
|
12
|
+
Q(n, i);
|
|
13
13
|
for (var k = r.length - 1; k >= 0; k--)
|
|
14
|
-
d =
|
|
15
|
-
return
|
|
16
|
-
},
|
|
17
|
-
|
|
14
|
+
d = O(l, i, a = {}, t[3], u), s = (0, r[k])(n, d), a._ = 1, I(s) && (n = s);
|
|
15
|
+
return W(t, n), h && g(n, i, h), c ? l ^ 4 ? o : h : n;
|
|
16
|
+
}, q, _, L;
|
|
17
|
+
q = [C(["wiki", "wikiTitle", "preferences", "$"]), D(
|
|
18
18
|
m.object({
|
|
19
19
|
"inArticleLinks.enable": m.boolean().description("Whether to enable in-article links").default(!0),
|
|
20
20
|
"inArticleLinks.quickDiff.enable": m.boolean().description("Whether to enable in-article links for quick diff").default(!0),
|
|
@@ -22,7 +22,7 @@ y = [D(["wiki", "wikiTitle", "preferences", "$"]), C(
|
|
|
22
22
|
"inArticleLinks.quickEdit.redlinks": m.boolean().description("Whether to show quick edit button for redlinks").default(!0)
|
|
23
23
|
}).description("In-article links preferences").extra("category", "in-article-links")
|
|
24
24
|
)];
|
|
25
|
-
class
|
|
25
|
+
class v extends (L = $) {
|
|
26
26
|
constructor(e) {
|
|
27
27
|
super(
|
|
28
28
|
e,
|
|
@@ -31,11 +31,11 @@ class g extends (L = P) {
|
|
|
31
31
|
},
|
|
32
32
|
"InArticleLinks"
|
|
33
33
|
), this._cachedAnchorInfo = /* @__PURE__ */ new WeakMap(), this.ctx.set("inArticleLinks", this);
|
|
34
|
-
const
|
|
34
|
+
const i = this.ctx.$;
|
|
35
35
|
this.ctx.preferences.defineCategory({
|
|
36
36
|
name: "in-article-links",
|
|
37
|
-
label:
|
|
38
|
-
description:
|
|
37
|
+
label: i`prefs.inArticleLinks.label`,
|
|
38
|
+
description: i`prefs.inArticleLinks.$`,
|
|
39
39
|
index: 9
|
|
40
40
|
});
|
|
41
41
|
}
|
|
@@ -54,21 +54,21 @@ class g extends (L = P) {
|
|
|
54
54
|
parseAnchor(e) {
|
|
55
55
|
if (!(e instanceof HTMLAnchorElement))
|
|
56
56
|
return null;
|
|
57
|
-
const
|
|
58
|
-
if (
|
|
59
|
-
return
|
|
57
|
+
const i = this._cachedAnchorInfo.get(e);
|
|
58
|
+
if (i)
|
|
59
|
+
return i;
|
|
60
60
|
const r = e.getAttribute("href") || "";
|
|
61
61
|
if (!this.ctx.wikiTitle.validateHrefAttr(r))
|
|
62
62
|
return null;
|
|
63
|
-
const
|
|
64
|
-
if (!
|
|
63
|
+
const n = e.href || "", o = this.ctx.wikiTitle.parseWikiLink(n);
|
|
64
|
+
if (!o)
|
|
65
65
|
return null;
|
|
66
66
|
const s = {
|
|
67
67
|
$el: e,
|
|
68
68
|
kind: e.closest('[typeof^="mw:File"]') ? "mw:File" : "normal",
|
|
69
69
|
external: e.classList.contains("external") || !!r.startsWith("http"),
|
|
70
|
-
redlink: e.classList.contains("new") ||
|
|
71
|
-
...
|
|
70
|
+
redlink: e.classList.contains("new") || o.params.has("redlink"),
|
|
71
|
+
...o
|
|
72
72
|
};
|
|
73
73
|
return this._cachedAnchorInfo.set(e, s), this.ctx.emit("in-article-links/anchor-parsed", {
|
|
74
74
|
ctx: this.ctx,
|
|
@@ -76,42 +76,51 @@ class g extends (L = P) {
|
|
|
76
76
|
info: s
|
|
77
77
|
}), s;
|
|
78
78
|
}
|
|
79
|
-
scanAnchors(e,
|
|
79
|
+
scanAnchors(e, i) {
|
|
80
80
|
const r = e.querySelectorAll("a[href]");
|
|
81
|
-
return Array.from(r).map((
|
|
82
|
-
(
|
|
81
|
+
return Array.from(r).map((n) => this.parseAnchor(n)).filter(
|
|
82
|
+
(n) => n !== null && (!i || i(n))
|
|
83
83
|
);
|
|
84
84
|
}
|
|
85
|
+
onContentReady(e) {
|
|
86
|
+
const i = () => {
|
|
87
|
+
if (!window.mw) return;
|
|
88
|
+
window.mw.hook("wikipage.content").add(e);
|
|
89
|
+
const r = window.$?.("#mw-content-text");
|
|
90
|
+
r?.length && e(r);
|
|
91
|
+
};
|
|
92
|
+
window.mw && typeof window.mw.hook == "function" ? i() : (window.RLQ = window.RLQ || [], window.RLQ.push(["mediawiki.base", i]));
|
|
93
|
+
}
|
|
85
94
|
async handleQuickEdit() {
|
|
86
95
|
let e = !1;
|
|
87
|
-
const
|
|
96
|
+
const i = await this.ctx.preferences.get("inArticleLinks.quickEdit.redlinks");
|
|
88
97
|
this.ctx.inject(["quickEdit"], (r) => {
|
|
89
98
|
e = !0, r.on("dispose", () => {
|
|
90
99
|
e = !1;
|
|
91
|
-
}),
|
|
100
|
+
}), this.onContentReady((n) => {
|
|
92
101
|
if (!e)
|
|
93
102
|
return;
|
|
94
|
-
this.scanAnchors(
|
|
95
|
-
const { $el: a, title: d, pageId:
|
|
103
|
+
this.scanAnchors(n.get(0), ({ action: s, title: a, redlink: d }) => i || !d ? ["edit", "create"].includes(s) ? !0 : a?.isSpecial("edit") || a?.isSpecial("newsection") ? a.getMainText().split("/").length >= 2 : !1 : !1).forEach((s) => {
|
|
104
|
+
const { $el: a, title: d, pageId: l, params: c } = s;
|
|
96
105
|
if (a.dataset.ipeEditMounted)
|
|
97
106
|
return;
|
|
98
107
|
if (a.dataset.ipeEditMounted = "1", c.has("preload") || c.has("redo"))
|
|
99
108
|
return this.ctx.logger.debug(a, "Not compatible with quick edit");
|
|
100
|
-
const u = d?.getPrefixedDBKey() || "", h = c.get("section")?.replace(/^T-/, "") || void 0, k = c.get("oldid"),
|
|
101
|
-
let
|
|
102
|
-
h === "new" || d?.isSpecial("newsection") ?
|
|
103
|
-
const S = k ? parseInt(k, 10) : void 0,
|
|
109
|
+
const u = d?.getPrefixedDBKey() || "", h = c.get("section")?.replace(/^T-/, "") || void 0, k = c.get("oldid"), x = c.has("redlink");
|
|
110
|
+
let w;
|
|
111
|
+
h === "new" || d?.isSpecial("newsection") ? w = "new" : h && /^\d+$/.test(h) && (w = parseInt(h, 10));
|
|
112
|
+
const S = k ? parseInt(k, 10) : void 0, b = {
|
|
104
113
|
title: u,
|
|
105
|
-
pageId:
|
|
106
|
-
section:
|
|
114
|
+
pageId: l || void 0,
|
|
115
|
+
section: w,
|
|
107
116
|
revision: S,
|
|
108
|
-
createOnly:
|
|
117
|
+
createOnly: x
|
|
109
118
|
}, M = /* @__PURE__ */ p(
|
|
110
119
|
"a",
|
|
111
120
|
{
|
|
112
121
|
href: "#ipe://quick-edit/",
|
|
113
|
-
dataset:
|
|
114
|
-
className: `${this.config.linkClassName} ipe-quick-edit ${
|
|
122
|
+
dataset: b,
|
|
123
|
+
className: `${this.config.linkClassName} ipe-quick-edit ${x ? "ipe-quick-edit--create-only" : ""}`,
|
|
115
124
|
style: {
|
|
116
125
|
userSelect: "none",
|
|
117
126
|
marginLeft: "0.2em"
|
|
@@ -123,9 +132,9 @@ class g extends (L = P) {
|
|
|
123
132
|
info: s,
|
|
124
133
|
event: A,
|
|
125
134
|
action: "quickEdit"
|
|
126
|
-
}), r.quickEdit.showModal(
|
|
135
|
+
}), r.quickEdit.showModal(b);
|
|
127
136
|
},
|
|
128
|
-
children: /* @__PURE__ */ p(
|
|
137
|
+
children: /* @__PURE__ */ p(P, { className: "ipe-icon" })
|
|
129
138
|
}
|
|
130
139
|
);
|
|
131
140
|
a.insertAdjacentElement("afterend", M);
|
|
@@ -135,23 +144,23 @@ class g extends (L = P) {
|
|
|
135
144
|
}
|
|
136
145
|
handleQuickDiff() {
|
|
137
146
|
let e = !1;
|
|
138
|
-
const
|
|
147
|
+
const i = (r) => ["prev", "next", "cur"].includes(r);
|
|
139
148
|
this.ctx.inject(["quickDiff"], (r) => {
|
|
140
149
|
e = !0, r.on("dispose", () => {
|
|
141
150
|
e = !1;
|
|
142
|
-
}),
|
|
151
|
+
}), this.onContentReady((n) => {
|
|
143
152
|
if (!e)
|
|
144
153
|
return;
|
|
145
|
-
this.scanAnchors(
|
|
146
|
-
const { $el: a, title: d, params:
|
|
154
|
+
this.scanAnchors(n.get(0), ({ params: s, title: a }) => !!(s.has("diff") || a?.isSpecial("diff"))).forEach((s) => {
|
|
155
|
+
const { $el: a, title: d, params: l } = s;
|
|
147
156
|
if (a.dataset.ipeDiffMounted)
|
|
148
157
|
return;
|
|
149
158
|
a.dataset.ipeDiffMounted = "1";
|
|
150
159
|
let c, f;
|
|
151
|
-
if (d?.getNamespaceId() === -1 ? ([, f, c] = d.getMainDBKey().split("/"), c || (c = "prev")) : (c =
|
|
160
|
+
if (d?.getNamespaceId() === -1 ? ([, f, c] = d.getMainDBKey().split("/"), c || (c = "prev")) : (c = l.get("diff"), f = l.get("oldid")), !c || !f)
|
|
152
161
|
return;
|
|
153
162
|
const u = {};
|
|
154
|
-
|
|
163
|
+
i(c) ? (u.fromrev = parseInt(f), u.torelative = c) : (u.fromrev = parseInt(f), u.torev = parseInt(c));
|
|
155
164
|
const h = /* @__PURE__ */ p(
|
|
156
165
|
"a",
|
|
157
166
|
{
|
|
@@ -202,10 +211,10 @@ class g extends (L = P) {
|
|
|
202
211
|
});
|
|
203
212
|
}
|
|
204
213
|
}
|
|
205
|
-
_ =
|
|
206
|
-
|
|
207
|
-
|
|
214
|
+
_ = T(L);
|
|
215
|
+
v = F(_, 0, "PluginInArticleLinks", q, v);
|
|
216
|
+
z(_, 1, v);
|
|
208
217
|
export {
|
|
209
|
-
|
|
218
|
+
v as PluginInArticleLinks
|
|
210
219
|
};
|
|
211
|
-
//# sourceMappingURL=index-
|
|
220
|
+
//# sourceMappingURL=index-7R2LfhNn.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index-7R2LfhNn.js","sources":["../src/plugins/in-article-links/index.tsx"],"sourcesContent":["import { Inject, InPageEdit, Schema } from '@/InPageEdit'\nimport { CompareApiRequestOptions } from '../quick-diff/index.js'\nimport { QuickEditOptions } from '../quick-edit/index.js'\nimport { WikiLinkMetadata } from '@/services/WikiTitleService.js'\n\ndeclare module '@/InPageEdit' {\n interface InPageEdit {\n inArticleLinks: PluginInArticleLinks\n }\n interface Events {\n 'in-article-links/anchor-parsed'(payload: {\n ctx: InPageEdit\n anchor: HTMLAnchorElement\n info: InArticleWikiAnchorMetadata\n }): void\n 'in-article-links/anchor-clicked'(payload: {\n ctx: InPageEdit\n anchor: HTMLAnchorElement\n info: InArticleWikiAnchorMetadata\n event: MouseEvent\n action: 'quickEdit' | 'quickDiff'\n }): void\n }\n interface PreferencesMap {\n 'inArticleLinks.quickEdit.enable': boolean\n 'inArticleLinks.quickDiff.enable': boolean\n 'inArticleLinks.quickEdit.redlinks': boolean\n }\n}\n\nexport interface InArticleWikiAnchorMetadata extends WikiLinkMetadata {\n $el: HTMLAnchorElement\n kind: 'normal' | 'mw:File'\n external: boolean\n redlink: boolean\n}\n\n@Inject(['wiki', 'wikiTitle', 'preferences', '$'])\n@RegisterPreferences(\n Schema.object({\n 'inArticleLinks.enable': Schema.boolean()\n .description('Whether to enable in-article links')\n .default(true),\n 'inArticleLinks.quickDiff.enable': Schema.boolean()\n .description('Whether to enable in-article links for quick diff')\n .default(true),\n 'inArticleLinks.quickEdit.enable': Schema.boolean()\n .description('Whether to enable in-article links for quick edit')\n .default(true),\n 'inArticleLinks.quickEdit.redlinks': Schema.boolean()\n .description('Whether to show quick edit button for redlinks')\n .default(true),\n })\n .description('In-article links preferences')\n .extra('category', 'in-article-links')\n)\nexport class PluginInArticleLinks extends BasePlugin<{\n linkClassName: string\n}> {\n constructor(ctx: InPageEdit) {\n super(\n ctx,\n {\n linkClassName: 'ipe__in-article-link',\n },\n 'InArticleLinks'\n )\n this.ctx.set('inArticleLinks', this)\n const $ = this.ctx.$\n\n this.ctx.preferences.defineCategory({\n name: 'in-article-links',\n label: $`prefs.inArticleLinks.label`,\n description: $`prefs.inArticleLinks.$`,\n index: 9,\n })\n }\n\n protected async start() {\n // TODO: 这些都不应该硬编码,暂时先这样\n if (await this.ctx.preferences.get('inArticleLinks.quickEdit.enable')) {\n this.handleQuickEdit()\n }\n if (await this.ctx.preferences.get('inArticleLinks.quickDiff.enable')) {\n this.handleQuickDiff()\n }\n }\n\n protected async stop() {\n Array.from(\n document.getElementsByClassName(this.config.linkClassName) as HTMLCollectionOf<HTMLElement>\n ).forEach((el) => {\n el.remove()\n })\n document.querySelectorAll<HTMLElement>('[data-ipe-edit-mounted]').forEach((el) => {\n el.dataset.ipeEditMounted = undefined\n })\n }\n\n private _cachedAnchorInfo = new WeakMap<HTMLAnchorElement, InArticleWikiAnchorMetadata>()\n parseAnchor(anchor: HTMLAnchorElement): InArticleWikiAnchorMetadata | null {\n // 不是链接元素\n if (!(anchor instanceof HTMLAnchorElement)) {\n return null\n }\n\n const cached = this._cachedAnchorInfo.get(anchor)\n if (cached) {\n return cached\n }\n\n const attrHref = anchor.getAttribute('href') || ''\n if (!this.ctx.wikiTitle.validateHrefAttr(attrHref)) {\n return null\n }\n const href = anchor.href || ''\n const linkInfo = this.ctx.wikiTitle.parseWikiLink(href)\n if (!linkInfo) {\n return null\n }\n\n const info: InArticleWikiAnchorMetadata = {\n $el: anchor,\n kind: anchor.closest('[typeof^=\"mw:File\"]') ? 'mw:File' : 'normal',\n external: anchor.classList.contains('external') || !!attrHref.startsWith('http'),\n redlink: anchor.classList.contains('new') || linkInfo.params.has('redlink'),\n ...linkInfo,\n }\n this._cachedAnchorInfo.set(anchor, info)\n this.ctx.emit('in-article-links/anchor-parsed', {\n ctx: this.ctx,\n anchor,\n info,\n })\n return info\n }\n\n scanAnchors(\n parent: HTMLElement,\n filter?: (info: InArticleWikiAnchorMetadata) => boolean\n ): InArticleWikiAnchorMetadata[] {\n const anchors = parent.querySelectorAll<HTMLAnchorElement>('a[href]')\n return Array.from(anchors)\n .map((anchor) => this.parseAnchor(anchor))\n .filter(\n (anchor) => anchor !== null && (!filter || filter(anchor))\n ) as InArticleWikiAnchorMetadata[]\n }\n\n private onContentReady(callback: ($content: JQuery<HTMLElement>) => void) {\n const register = () => {\n if (!window.mw) return\n window.mw.hook('wikipage.content').add(callback)\n const $content = (window as any).$?.('#mw-content-text')\n if ($content?.length) callback($content)\n }\n\n if (window.mw && typeof window.mw.hook === 'function') {\n register()\n } else {\n window.RLQ = window.RLQ || ([] as any)\n window.RLQ.push(['mediawiki.base', register])\n }\n }\n\n async handleQuickEdit() {\n let enable = false\n const showButtonOnRedlinks = await this.ctx.preferences.get('inArticleLinks.quickEdit.redlinks')\n\n this.ctx.inject(['quickEdit'], (ctx) => {\n enable = true\n ctx.on('dispose', () => {\n enable = false\n })\n\n this.onContentReady(($content) => {\n if (!enable) {\n return\n }\n const anchors = this.scanAnchors($content.get(0)!, ({ action, title, redlink }) => {\n const enabled = showButtonOnRedlinks || !redlink\n if (!enabled) {\n return false\n }\n const isActionEdit = ['edit', 'create'].includes(action)\n if (isActionEdit) {\n return true\n }\n const isSpecialEdit = title?.isSpecial('edit') || title?.isSpecial('newsection')\n if (isSpecialEdit) {\n return title!.getMainText().split('/').length >= 2\n }\n return false\n })\n anchors.forEach((info) => {\n const { $el, title, pageId, params } = info\n if ($el.dataset.ipeEditMounted) {\n return\n }\n $el.dataset.ipeEditMounted = '1'\n\n const notCompatible = params.has('preload') || params.has('redo')\n if (notCompatible) {\n return this.ctx.logger.debug($el, `Not compatible with quick edit`)\n }\n\n const titleText = title?.getPrefixedDBKey() || ''\n const sectionRaw = params.get('section')?.replace(/^T-/, '') || undefined\n const revisionRaw = params.get('oldid')\n const createOnly = params.has('redlink')\n\n let section: 'new' | number | undefined = undefined\n if (sectionRaw === 'new' || title?.isSpecial('newsection')) {\n section = 'new'\n } else if (sectionRaw && /^\\d+$/.test(sectionRaw)) {\n section = parseInt(sectionRaw, 10)\n }\n\n const revision = revisionRaw ? parseInt(revisionRaw, 10) : undefined\n\n const payload: Partial<QuickEditOptions> = {\n title: titleText,\n pageId: pageId || undefined,\n section,\n revision,\n createOnly,\n }\n\n const link = (\n <a\n href={`#ipe://quick-edit/`}\n dataset={payload as any}\n className={`${this.config.linkClassName} ipe-quick-edit ${createOnly ? 'ipe-quick-edit--create-only' : ''}`}\n style={{\n userSelect: 'none',\n marginLeft: '0.2em',\n }}\n onClick={(e) => {\n e.preventDefault()\n this.ctx.emit('in-article-links/anchor-clicked', {\n ctx: this.ctx,\n anchor: $el,\n info,\n event: e,\n action: 'quickEdit',\n })\n ctx.quickEdit.showModal(payload)\n }}\n >\n <IconQuickEdit className=\"ipe-icon\" />\n </a>\n )\n\n $el.insertAdjacentElement('afterend', link)\n })\n })\n })\n }\n\n handleQuickDiff() {\n let enable = false\n const isRelative = (str: string): str is 'prev' | 'next' | 'cur' =>\n ['prev', 'next', 'cur'].includes(str)\n\n this.ctx.inject(['quickDiff'], (ctx) => {\n enable = true\n ctx.on('dispose', () => {\n enable = false\n })\n\n this.onContentReady(($content) => {\n if (!enable) {\n return\n }\n const anchors = this.scanAnchors($content.get(0)!, ({ params, title }) => {\n return !!(params.has('diff') || title?.isSpecial('diff'))\n })\n anchors.forEach((info) => {\n const { $el, title, params } = info\n if ($el.dataset.ipeDiffMounted) {\n return\n }\n $el.dataset.ipeDiffMounted = '1'\n\n let diff: string | null\n let oldid: string | null\n if (title?.getNamespaceId() === -1) {\n // prettier-ignore\n ;[/** special page name */, oldid, diff] = title.getMainDBKey().split('/')\n if (!diff) {\n diff = 'prev'\n }\n } else {\n diff = params.get('diff')\n oldid = params.get('oldid')\n }\n if (!diff || !oldid) {\n return\n }\n\n const compare: Partial<CompareApiRequestOptions> = {}\n if (isRelative(diff)) {\n compare.fromrev = parseInt(oldid)\n compare.torelative = diff\n } else {\n compare.fromrev = parseInt(oldid)\n compare.torev = parseInt(diff)\n }\n\n const link = (\n <a\n href={`#ipe://quick-diff/`}\n dataset={compare as any}\n className={`${this.config.linkClassName} ipe-quick-diff`}\n style={{\n userSelect: 'none',\n marginLeft: '0.2em',\n }}\n onClick={(e) => {\n e.preventDefault()\n this.ctx.emit('in-article-links/anchor-clicked', {\n ctx: this.ctx,\n anchor: $el,\n info,\n event: e,\n action: 'quickDiff',\n })\n ctx.quickDiff.comparePages(compare)\n }}\n >\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n class=\"icon icon-tabler icons-tabler-outline icon-tabler-file-diff ipe-icon\"\n >\n <path stroke=\"none\" d=\"M0 0h24v24H0z\" fill=\"none\" />\n <path d=\"M14 3v4a1 1 0 0 0 1 1h4\" />\n <path d=\"M17 21h-10a2 2 0 0 1 -2 -2v-14a2 2 0 0 1 2 -2h7l5 5v11a2 2 0 0 1 -2 2z\" />\n <path d=\"M12 10l0 4\" />\n <path d=\"M10 12l4 0\" />\n <path d=\"M10 17l4 0\" />\n </svg>\n </a>\n )\n\n $el.insertAdjacentElement('afterend', link)\n })\n })\n })\n }\n}\n"],"names":["_PluginInArticleLinks_decorators","_init","_a","Inject","RegisterPreferences","Schema","PluginInArticleLinks","BasePlugin","ctx","$","el","anchor","cached","attrHref","href","linkInfo","info","parent","filter","anchors","callback","register","$content","enable","showButtonOnRedlinks","action","title","redlink","$el","pageId","params","titleText","sectionRaw","revisionRaw","createOnly","section","revision","payload","link","jsx","e","IconQuickEdit","isRelative","str","diff","oldid","compare","jsxs","__decoratorStart","__decorateElement","__runInitializers"],"mappings":";;;;;;;;;;;;;;;GAAAA,GAAAC,GAAAC;AAqCAF,IAAA,CAACG,EAAO,CAAC,QAAQ,aAAa,eAAe,GAAG,CAAC,GAChDC;AAAA,EACC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CAAO;AAAA,cACpC;AAAA,cAEA,UAAAC,gBAAAA;AAAAA,gBAAC;AAAA,gBAAA;AAAA,kBACC,OAAM;AAAA,kBACN,OAAM;AAAA,kBACN,QAAO;AAAA,kBACP,SAAQ;AAAA,kBACR,MAAK;AAAA,kBACL,QAAO;AAAA,kBACP,gBAAa;AAAA,kBACb,kBAAe;AAAA,kBACf,mBAAgB;AAAA,kBAChB,OAAM;AAAA,kBAEN,UAAA;AAAA,oBAAA,gBAAAR,EAAC,UAAK,QAAO,QAAO,GAAE,iBAAgB,MAAK,QAAO;AAAA,oBAClD,gBAAAA,EAAC,QAAA,EAAK,GAAE,0BAAA,CAA0B;AAAA,oBAClC,gBAAAA,EAAC,QAAA,EAAK,GAAE,yEAAA,CAAyE;AAAA,oBACjF,gBAAAA,EAAC,QAAA,EAAK,GAAE,aAAA,CAAa;AAAA,oBACrB,gBAAAA,EAAC,QAAA,EAAK,GAAE,aAAA,CAAa;AAAA,oBACrB,gBAAAA,EAAC,QAAA,EAAK,GAAE,aAAA,CAAa;AAAA,kBAAA;AAAA,gBAAA;AAAA,cAAA;AAAA,YACvB;AAAA,UAAA;AAIJ,UAAAX,EAAI,sBAAsB,YAAYU,CAAI;AAAA,QAC5C,CAAC;AAAA,MACH,CAAC;AAAA,IACH,CAAC;AAAA,EACH;AACF;AA7SOrC,IAAA+C,EAAA9C,CAAA;AAAMI,IAAN2C,gCAnBPjD,GAmBaM,CAAA;AAAN4C,EAAAjD,GAAA,GAAMK,CAAA;"}
|
|
@@ -2984,7 +2984,7 @@ class K extends lt {
|
|
|
2984
2984
|
constructor(e) {
|
|
2985
2985
|
super({
|
|
2986
2986
|
name: "InPageEdit"
|
|
2987
|
-
}), this.version = "0.14.
|
|
2987
|
+
}), this.version = "0.14.5", this.Endpoints = ke, this.schema = p, this.config = ct(K.DEFAULT_CONFIG, e), this.logger = gt({
|
|
2988
2988
|
name: "IPE",
|
|
2989
2989
|
color: "#33aaff",
|
|
2990
2990
|
level: this.config.logLevel
|
|
@@ -3035,7 +3035,7 @@ class K extends lt {
|
|
|
3035
3035
|
async #s() {
|
|
3036
3036
|
[
|
|
3037
3037
|
import("./index-BanevHQ2.js").then(({ PluginAnalytics: t }) => t),
|
|
3038
|
-
import("./index-
|
|
3038
|
+
import("./index-7R2LfhNn.js").then(
|
|
3039
3039
|
({ PluginInArticleLinks: t }) => t
|
|
3040
3040
|
),
|
|
3041
3041
|
import("./index-B3jld2sl.js").then(({ PluginPluginStore: t }) => t),
|
|
@@ -3087,4 +3087,4 @@ export {
|
|
|
3087
3087
|
ce as e,
|
|
3088
3088
|
te as m
|
|
3089
3089
|
};
|
|
3090
|
-
//# sourceMappingURL=index-
|
|
3090
|
+
//# sourceMappingURL=index-DxaqNWv4.js.map
|