@inpageedit/core 0.13.0 → 0.14.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +20 -20
- package/dist/{BasePlugin-Bf2UuIHF.js → BasePlugin-CU8beLYu.js} +17 -26
- package/dist/BasePlugin-CU8beLYu.js.map +1 -0
- package/dist/IconQuickEdit-CMCQncyj.js.map +1 -1
- package/dist/InputBox-nQKtiWtZ.js.map +1 -1
- package/dist/{PluginPrefSync-Dn1Xsiqz.js → PluginPrefSync-B-gPsC2n.js} +124 -128
- package/dist/PluginPrefSync-B-gPsC2n.js.map +1 -0
- package/dist/PluginStoreApp-CDteVCBG.js +453 -0
- package/dist/PluginStoreApp-CDteVCBG.js.map +1 -0
- package/dist/{endpoints-DgyuoRZd.js → Preferences-85Q9FAmb.js} +589 -565
- package/dist/Preferences-85Q9FAmb.js.map +1 -0
- package/dist/WatchlistAction-BbNAyryN.js.map +1 -1
- package/dist/components/index.js.map +1 -1
- package/dist/{index-BuYNq7f3.js → index-19CgGBI0.js} +1419 -921
- package/dist/index-19CgGBI0.js.map +1 -0
- package/dist/{index-B7c6jL9x.js → index-BKIf3i0I.js} +146 -137
- package/dist/index-BKIf3i0I.js.map +1 -0
- package/dist/{index-CCRMmnwk.js → index-BrtFJ-M0.js} +67 -66
- package/dist/index-BrtFJ-M0.js.map +1 -0
- package/dist/index-CG38LlAh.js.map +1 -1
- package/dist/index-CM_6yF2v.js.map +1 -1
- package/dist/index-CQr1DJ8n.js +173 -0
- package/dist/index-CQr1DJ8n.js.map +1 -0
- package/dist/{index-BQ-cHWkJ.js → index-CVTBg5O9.js} +66 -48
- package/dist/index-CVTBg5O9.js.map +1 -0
- package/dist/index-Ci82vLXg.js +179 -0
- package/dist/index-Ci82vLXg.js.map +1 -0
- package/dist/{index-BwdWyHLe.js → index-D3iZhRMJ.js} +93 -93
- package/dist/index-D3iZhRMJ.js.map +1 -0
- package/dist/index-DD5CVCfD.js.map +1 -1
- package/dist/{index-BJ7_Q1mB.js → index-DGtq21uW.js} +17 -16
- package/dist/index-DGtq21uW.js.map +1 -0
- package/dist/index-DXL7teb0.js +394 -0
- package/dist/index-DXL7teb0.js.map +1 -0
- package/dist/index-DjPpAyfE.js +116 -0
- package/dist/index-DjPpAyfE.js.map +1 -0
- package/dist/{index-eSlbrNqF.js → index-rpiO9fpc.js} +4 -5
- package/dist/{index-eSlbrNqF.js.map → index-rpiO9fpc.js.map} +1 -1
- package/dist/index.d.ts +327 -26
- package/dist/index.js +32 -26
- package/dist/index.js.map +1 -1
- package/dist/makeCallable-LDU0xZMJ.js.map +1 -1
- package/dist/models/index.js +174 -154
- package/dist/models/index.js.map +1 -1
- package/dist/noop-ClDc6zv4.js.map +1 -1
- package/dist/plugins/index.js +10 -10
- package/dist/services/index.js +1 -1
- package/dist/style.css +1 -1
- package/dist/vueHooks-l04s8cIl.js.map +1 -1
- package/lib/index.umd.js +20 -12
- package/lib/index.umd.js.map +1 -1
- package/lib/style.css +1 -1
- package/package.json +4 -4
- package/dist/BasePlugin-Bf2UuIHF.js.map +0 -1
- package/dist/PluginPrefSync-Dn1Xsiqz.js.map +0 -1
- package/dist/PluginStoreApp-CpOLArL7.js +0 -452
- package/dist/PluginStoreApp-CpOLArL7.js.map +0 -1
- package/dist/Preferences-DS4-CFWe.js +0 -9
- package/dist/Preferences-DS4-CFWe.js.map +0 -1
- package/dist/endpoints-DgyuoRZd.js.map +0 -1
- package/dist/index-2RfILgXm.js +0 -180
- package/dist/index-2RfILgXm.js.map +0 -1
- package/dist/index-B7c6jL9x.js.map +0 -1
- package/dist/index-BJ7_Q1mB.js.map +0 -1
- package/dist/index-BNh95-x2.js +0 -115
- package/dist/index-BNh95-x2.js.map +0 -1
- package/dist/index-BQ-cHWkJ.js.map +0 -1
- package/dist/index-BuYNq7f3.js.map +0 -1
- package/dist/index-BwdWyHLe.js.map +0 -1
- package/dist/index-CCRMmnwk.js.map +0 -1
- package/dist/index-CnIpUF9x.js +0 -173
- package/dist/index-CnIpUF9x.js.map +0 -1
- package/dist/index-CyG7_IYz.js +0 -394
- package/dist/index-CyG7_IYz.js.map +0 -1
package/dist/index-CyG7_IYz.js
DELETED
|
@@ -1,394 +0,0 @@
|
|
|
1
|
-
import { j as t, F as _, P as L } from "./index-CM_6yF2v.js";
|
|
2
|
-
import { W as h } from "./WatchlistAction-BbNAyryN.js";
|
|
3
|
-
import { m as j } from "./makeCallable-LDU0xZMJ.js";
|
|
4
|
-
import { R } from "./Preferences-DS4-CFWe.js";
|
|
5
|
-
import { B as U } from "./BasePlugin-Bf2UuIHF.js";
|
|
6
|
-
import { M as N } from "./index-CG38LlAh.js";
|
|
7
|
-
import { I as q, C as I } from "./InputBox-nQKtiWtZ.js";
|
|
8
|
-
import { R as Q } from "./RadioBox-0UuxlcWZ.js";
|
|
9
|
-
import { n as T } from "./noop-ClDc6zv4.js";
|
|
10
|
-
import { I as W, S as l } from "./endpoints-DgyuoRZd.js";
|
|
11
|
-
const z = (i = 0) => new Promise((e) => setTimeout(e, i));
|
|
12
|
-
var $ = Object.create, E = Object.defineProperty, K = Object.getOwnPropertyDescriptor, C = (i, e) => (e = Symbol[i]) ? e : Symbol.for("Symbol." + i), F = (i) => {
|
|
13
|
-
throw TypeError(i);
|
|
14
|
-
}, Y = (i, e, r) => e in i ? E(i, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : i[e] = r, G = (i, e) => E(i, "name", { value: e, configurable: !0 }), H = (i) => [, , , $(i?.[C("metadata")] ?? null)], X = ["class", "method", "getter", "setter", "accessor", "field", "value", "get", "set"], O = (i) => i !== void 0 && typeof i != "function" ? F("Function expected") : i, J = (i, e, r, d, n) => ({ kind: X[i], name: e, metadata: d, addInitializer: (u) => r._ ? F("Already initialized") : n.push(O(u || null)) }), V = (i, e) => Y(e, C("metadata"), i[3]), Z = (i, e, r, d) => {
|
|
15
|
-
for (var n = 0, u = i[e >> 1], m = u && u.length; n < m; n++) u[n].call(r);
|
|
16
|
-
return d;
|
|
17
|
-
}, ee = (i, e, r, d, n, u) => {
|
|
18
|
-
var m, c, s, a = e & 7, v = !1, f = 0, x = i[f] || (i[f] = []), p = a && (n = n.prototype, a < 5 && (a > 3 || !v) && K(n, r));
|
|
19
|
-
G(n, r);
|
|
20
|
-
for (var g = d.length - 1; g >= 0; g--)
|
|
21
|
-
s = J(a, r, c = {}, i[3], x), m = (0, d[g])(n, s), c._ = 1, O(m) && (n = m);
|
|
22
|
-
return V(i, n), p && E(n, r, p), v ? a ^ 4 ? u : p : n;
|
|
23
|
-
}, M, y, B;
|
|
24
|
-
M = [W(["api", "wikiPage", "wikiTitle", "currentPage", "wiki", "modal", "preferences"]), R(
|
|
25
|
-
l.object({
|
|
26
|
-
"quickEdit.editSummary": l.string().description("Default edit summary for quick edits").default("[IPE-NEXT] Quick edit"),
|
|
27
|
-
"quickEdit.editMinor": l.boolean().description('Default to checking "minor edit" option').default(!1),
|
|
28
|
-
"quickEdit.outSideClose": l.boolean().description("Close editor modal by clicking outside").default(!0),
|
|
29
|
-
"quickEdit.watchList": l.union([
|
|
30
|
-
l.const(h.preferences).description("Follow MW preferences"),
|
|
31
|
-
l.const(h.nochange).description("Keep the current watchlist status"),
|
|
32
|
-
l.const(h.watch).description("Add the page to watchlist"),
|
|
33
|
-
l.const(h.unwatch).description("Remove the page from watchlist")
|
|
34
|
-
]).description("Watchlist options").default(h.preferences),
|
|
35
|
-
"quickEdit.keyshortcut.save": l.string().default("ctrl-s").description("save button key shortcut (blank to disable)"),
|
|
36
|
-
"quickEdit.editFont": l.union([
|
|
37
|
-
l.const("preferences").description("Follow MW preferences"),
|
|
38
|
-
l.const("monospace").description("Monospace"),
|
|
39
|
-
l.const("sans-serif").description("Sans-serif"),
|
|
40
|
-
l.const("serif").description("Serif"),
|
|
41
|
-
l.string().description("Custom font (same as CSS `font-family` property)").default("")
|
|
42
|
-
]).description("Font to use in quick edit's textarea").default("preferences")
|
|
43
|
-
}).description("Quick edit options").extra("category", "editor")
|
|
44
|
-
)];
|
|
45
|
-
let S = class A extends (B = U) {
|
|
46
|
-
constructor(e) {
|
|
47
|
-
super(e, {}, "quick-edit"), this.ctx = e, this.DEFAULT_OPTIONS = {
|
|
48
|
-
title: "",
|
|
49
|
-
pageId: 0,
|
|
50
|
-
revision: 0,
|
|
51
|
-
section: void 0,
|
|
52
|
-
editMinor: !1,
|
|
53
|
-
editSummary: "",
|
|
54
|
-
createOnly: !1,
|
|
55
|
-
reloadAfterSave: !0
|
|
56
|
-
}, this.ctx.root.set("quickEdit", j(this, "showModal"));
|
|
57
|
-
}
|
|
58
|
-
start() {
|
|
59
|
-
this.ctx.inject(["toolbox"], (e) => {
|
|
60
|
-
this.injectToolbox(e), e.on("dispose", () => {
|
|
61
|
-
this.removeToolbox(e);
|
|
62
|
-
});
|
|
63
|
-
});
|
|
64
|
-
}
|
|
65
|
-
async showModal(e) {
|
|
66
|
-
if (typeof e > "u" ? e = {} : typeof e == "string" && (e = {
|
|
67
|
-
title: e
|
|
68
|
-
}), e?.page && (e.title = e.page, delete e.page), !e.title && !e.pageId && !e.revision) {
|
|
69
|
-
this.logger.warn("None of the title, pageId or revision provided. Using defaults.");
|
|
70
|
-
const o = new URLSearchParams(window.location.search), w = this.ctx.currentPage.wikiTitle;
|
|
71
|
-
e = {
|
|
72
|
-
...e,
|
|
73
|
-
title: w?.getPrefixedDBKey(),
|
|
74
|
-
revision: o.has("oldid") ? Number(o.get("oldid")) : void 0,
|
|
75
|
-
pageId: o.has("curid") ? Number(o.get("curid")) : void 0
|
|
76
|
-
};
|
|
77
|
-
}
|
|
78
|
-
if (!e.revision && !e.pageId && e.title) {
|
|
79
|
-
const o = this.ctx.wikiTitle.resolveSpecialPageTarget(e.title);
|
|
80
|
-
o && o.title.getNamespaceId() >= 0 && (e.title = o.title.getPrefixedDBKey(), e.section ??= o.section);
|
|
81
|
-
}
|
|
82
|
-
const r = await this.ctx.preferences.get("quickEdit.outSideClose"), d = await this.ctx.preferences.get("quickEdit.watchList"), n = typeof e.editSummary == "string" ? e.editSummary : await this.ctx.preferences.get("quickEdit.editSummary"), u = typeof e.editMinor == "boolean" ? e.editMinor : await this.ctx.preferences.get("quickEdit.editMinor"), m = await this.getEditFontOptions(), c = {
|
|
83
|
-
...this.DEFAULT_OPTIONS,
|
|
84
|
-
editSummary: n,
|
|
85
|
-
editMinor: u,
|
|
86
|
-
...e
|
|
87
|
-
};
|
|
88
|
-
c.editSummary || (c.editSummary = await this.ctx.preferences.get("quickEdit.editSummary") || ""), this.ctx.emit("quick-edit/init-options", { ctx: this.ctx, options: c });
|
|
89
|
-
const s = this.ctx.modal.createObject({
|
|
90
|
-
className: "ipe-quickEdit",
|
|
91
|
-
sizeClass: "large",
|
|
92
|
-
// backdrop: false,
|
|
93
|
-
// draggable: true,
|
|
94
|
-
center: !1,
|
|
95
|
-
outSideClose: r
|
|
96
|
-
}).init();
|
|
97
|
-
s.setTitle(
|
|
98
|
-
/* @__PURE__ */ t(_, { children: [
|
|
99
|
-
"Loading: ",
|
|
100
|
-
/* @__PURE__ */ t("u", { children: c.title })
|
|
101
|
-
] })
|
|
102
|
-
), s.setContent(
|
|
103
|
-
/* @__PURE__ */ t(
|
|
104
|
-
"section",
|
|
105
|
-
{
|
|
106
|
-
className: "ipe-quickEdit-loading",
|
|
107
|
-
style: {
|
|
108
|
-
height: "70vh",
|
|
109
|
-
display: "flex",
|
|
110
|
-
flexDirection: "column",
|
|
111
|
-
justifyContent: "center",
|
|
112
|
-
alignItems: "center"
|
|
113
|
-
},
|
|
114
|
-
children: /* @__PURE__ */ t(L, {})
|
|
115
|
-
}
|
|
116
|
-
)
|
|
117
|
-
), s.addButton({
|
|
118
|
-
side: "right",
|
|
119
|
-
type: "button",
|
|
120
|
-
className: "is-danger is-ghost",
|
|
121
|
-
label: "Cancel",
|
|
122
|
-
method() {
|
|
123
|
-
s.close();
|
|
124
|
-
}
|
|
125
|
-
}), s.show(), this.ctx.emit("quick-edit/show-modal", { ctx: this.ctx, modal: s, options: c });
|
|
126
|
-
let a;
|
|
127
|
-
try {
|
|
128
|
-
if (a = await this.getWikiPageFromPayload(c), a.pageInfo.special)
|
|
129
|
-
throw new Error("Special page is not editable");
|
|
130
|
-
} catch (o) {
|
|
131
|
-
s.off(s.Event.Close), s.close(), this.ctx.modal.notify("error", {
|
|
132
|
-
content: o instanceof Error ? o.message : String(o)
|
|
133
|
-
});
|
|
134
|
-
return;
|
|
135
|
-
}
|
|
136
|
-
const v = c.section === "new" ? "" : a.revisions[0]?.content || "", f = a.revisions[0]?.revid, x = f && f !== a.lastrevid, p = c.section === "new", g = a.pageid === 0;
|
|
137
|
-
s.setTitle(
|
|
138
|
-
/* @__PURE__ */ t(_, { children: [
|
|
139
|
-
p ? "New section" : `Quick ${g ? "Create" : "Edit"}`,
|
|
140
|
-
":",
|
|
141
|
-
" ",
|
|
142
|
-
/* @__PURE__ */ t("u", { children: a.pageInfo.title }),
|
|
143
|
-
x ? ` (Revision ${f})` : ""
|
|
144
|
-
] })
|
|
145
|
-
);
|
|
146
|
-
const k = [];
|
|
147
|
-
g && k.push(
|
|
148
|
-
/* @__PURE__ */ t(N, { title: "Attention", type: "important", children: /* @__PURE__ */ t("p", { children: "This page does not exist." }) })
|
|
149
|
-
), x && k.push(
|
|
150
|
-
/* @__PURE__ */ t(N, { title: "Attention", type: "warning", children: /* @__PURE__ */ t("p", { children: [
|
|
151
|
-
"You are editing a ",
|
|
152
|
-
/* @__PURE__ */ t("em", { children: "historical version" }),
|
|
153
|
-
"; the content is not the latest!"
|
|
154
|
-
] }) })
|
|
155
|
-
), this.ctx.emit("quick-edit/edit-notice", {
|
|
156
|
-
ctx: this.ctx,
|
|
157
|
-
options: c,
|
|
158
|
-
modal: s,
|
|
159
|
-
wikiPage: a,
|
|
160
|
-
editNotices: k
|
|
161
|
-
});
|
|
162
|
-
const b = /* @__PURE__ */ t("form", { className: "ipe-quickEdit__form", children: [
|
|
163
|
-
/* @__PURE__ */ t("div", { className: "ipe-quickEdit__notices", children: k }),
|
|
164
|
-
/* @__PURE__ */ t(
|
|
165
|
-
"div",
|
|
166
|
-
{
|
|
167
|
-
className: "ipe-quickEdit__content",
|
|
168
|
-
style: { display: "flex", flexDirection: "column", gap: "1rem" },
|
|
169
|
-
children: [
|
|
170
|
-
c.section === "new" && /* @__PURE__ */ t(_, { children: /* @__PURE__ */ t(
|
|
171
|
-
q,
|
|
172
|
-
{
|
|
173
|
-
label: "Section title",
|
|
174
|
-
id: "summary",
|
|
175
|
-
name: "summary",
|
|
176
|
-
value: "",
|
|
177
|
-
inputProps: { placeholder: "Topic for new section, this will be the h2 heading" }
|
|
178
|
-
}
|
|
179
|
-
) }),
|
|
180
|
-
/* @__PURE__ */ t(
|
|
181
|
-
"textarea",
|
|
182
|
-
{
|
|
183
|
-
className: `ipe-quickEdit__textarea ${m.className}`,
|
|
184
|
-
style: { fontFamily: m.fontFamily },
|
|
185
|
-
name: "text",
|
|
186
|
-
id: "wpTextbox1",
|
|
187
|
-
children: v
|
|
188
|
-
}
|
|
189
|
-
)
|
|
190
|
-
]
|
|
191
|
-
}
|
|
192
|
-
),
|
|
193
|
-
/* @__PURE__ */ t(
|
|
194
|
-
"div",
|
|
195
|
-
{
|
|
196
|
-
class: "ipe-quickEdit__options",
|
|
197
|
-
style: {
|
|
198
|
-
display: "flex",
|
|
199
|
-
flexDirection: "column",
|
|
200
|
-
gap: "1rem",
|
|
201
|
-
marginTop: "1rem"
|
|
202
|
-
},
|
|
203
|
-
children: [
|
|
204
|
-
!p && /* @__PURE__ */ t(q, { label: "Summary", id: "summary", name: "summary", value: c.editSummary }),
|
|
205
|
-
/* @__PURE__ */ t("div", { className: "ipe-input-box", children: [
|
|
206
|
-
/* @__PURE__ */ t("label", { htmlFor: "watchlist", style: { display: "block" }, children: "Watchlist" }),
|
|
207
|
-
/* @__PURE__ */ t("div", { style: { display: "flex", gap: "1rem" }, children: [
|
|
208
|
-
h.preferences,
|
|
209
|
-
h.nochange,
|
|
210
|
-
h.watch,
|
|
211
|
-
h.unwatch
|
|
212
|
-
].map((o) => /* @__PURE__ */ t(
|
|
213
|
-
Q,
|
|
214
|
-
{
|
|
215
|
-
name: "watchlist",
|
|
216
|
-
value: o,
|
|
217
|
-
inputProps: { checked: d === o },
|
|
218
|
-
children: o
|
|
219
|
-
},
|
|
220
|
-
o
|
|
221
|
-
)) })
|
|
222
|
-
] }),
|
|
223
|
-
/* @__PURE__ */ t("div", { style: { display: "flex", gap: "1rem" }, children: [
|
|
224
|
-
/* @__PURE__ */ t(I, { name: "minor", id: "minor", checked: c.editMinor, children: "Minor edit" }),
|
|
225
|
-
/* @__PURE__ */ t(I, { name: "reloadAfterSave", id: "reloadAfterSave", checked: c.reloadAfterSave, children: "Reload after save" })
|
|
226
|
-
] })
|
|
227
|
-
]
|
|
228
|
-
}
|
|
229
|
-
),
|
|
230
|
-
!1
|
|
231
|
-
] });
|
|
232
|
-
s.setContent(b), s.addButton(
|
|
233
|
-
{
|
|
234
|
-
side: "left",
|
|
235
|
-
className: "is-primary submit-btn",
|
|
236
|
-
label: "Submit",
|
|
237
|
-
keyPress: await this.ctx.preferences.get("quickEdit.keyshortcut.save") || void 0,
|
|
238
|
-
method: () => {
|
|
239
|
-
const o = new FormData(b);
|
|
240
|
-
s.setLoadingState(!0), this.handleSubmit({
|
|
241
|
-
wikiPage: a,
|
|
242
|
-
text: o.get("text"),
|
|
243
|
-
summary: o.get("summary"),
|
|
244
|
-
minor: o.get("minor") === "on",
|
|
245
|
-
section: c.section,
|
|
246
|
-
createonly: a.pageid === 0,
|
|
247
|
-
watchlist: d
|
|
248
|
-
}).then(async () => {
|
|
249
|
-
s.setOptions({
|
|
250
|
-
beforeClose: T
|
|
251
|
-
}), s.close(), this.ctx.modal.notify("success", {
|
|
252
|
-
title: "Submission Successful",
|
|
253
|
-
content: "Your changes have been saved."
|
|
254
|
-
}), o.get("reloadAfterSave") && (await z(500), location.reload());
|
|
255
|
-
}).catch((w) => {
|
|
256
|
-
this.ctx.modal.notify("error", {
|
|
257
|
-
title: "Submission Error",
|
|
258
|
-
content: w instanceof Error ? w.message : String(w)
|
|
259
|
-
}), s.setLoadingState(!1);
|
|
260
|
-
});
|
|
261
|
-
}
|
|
262
|
-
},
|
|
263
|
-
0
|
|
264
|
-
), s.setOptions({
|
|
265
|
-
beforeClose: () => {
|
|
266
|
-
const o = a.revisions[0]?.content || "";
|
|
267
|
-
return (b.querySelector("textarea")?.value || "") === o ? !0 : (this.ctx.modal.confirm(
|
|
268
|
-
{
|
|
269
|
-
className: "is-primary",
|
|
270
|
-
title: "Unsaved Changes",
|
|
271
|
-
content: "All edit contents will be lost after closing the modal. Are you sure you want to close?",
|
|
272
|
-
center: !0,
|
|
273
|
-
okBtn: {
|
|
274
|
-
label: "Give Up",
|
|
275
|
-
className: "is-danger is-ghost"
|
|
276
|
-
},
|
|
277
|
-
cancelBtn: {
|
|
278
|
-
label: "Continue Editing",
|
|
279
|
-
className: "is-primary is-ghost"
|
|
280
|
-
}
|
|
281
|
-
},
|
|
282
|
-
(D) => (D && (s.setOptions({
|
|
283
|
-
beforeClose: T
|
|
284
|
-
}), s.close()), !0)
|
|
285
|
-
), !1);
|
|
286
|
-
}
|
|
287
|
-
}), this.ctx.emit("quick-edit/wiki-page", {
|
|
288
|
-
ctx: this.ctx,
|
|
289
|
-
options: c,
|
|
290
|
-
modal: s,
|
|
291
|
-
wikiPage: a
|
|
292
|
-
});
|
|
293
|
-
const P = (o) => b.querySelector("textarea")?.value === v ? !0 : (o.preventDefault(), "You have unsaved changes. Are you sure you want to leave?");
|
|
294
|
-
window.addEventListener("beforeunload", P), s.on(s.Event.Close, () => {
|
|
295
|
-
window.removeEventListener("beforeunload", P);
|
|
296
|
-
});
|
|
297
|
-
}
|
|
298
|
-
async handleSubmit(e) {
|
|
299
|
-
const r = e.wikiPage, d = e.summary || "", n = e.text || "", u = e.minor, m = e.createonly, c = e.watchlist, s = e.section;
|
|
300
|
-
return this.ctx.emit("quick-edit/submit", {
|
|
301
|
-
ctx: this.ctx,
|
|
302
|
-
wikiPage: r,
|
|
303
|
-
summary: d,
|
|
304
|
-
text: n,
|
|
305
|
-
minor: u,
|
|
306
|
-
createonly: m,
|
|
307
|
-
watchlist: c
|
|
308
|
-
}), r.edit(
|
|
309
|
-
{
|
|
310
|
-
summary: d,
|
|
311
|
-
text: n,
|
|
312
|
-
watchlist: c,
|
|
313
|
-
section: s
|
|
314
|
-
},
|
|
315
|
-
{
|
|
316
|
-
minor: u,
|
|
317
|
-
createonly: m
|
|
318
|
-
}
|
|
319
|
-
);
|
|
320
|
-
}
|
|
321
|
-
static {
|
|
322
|
-
this.BUILT_IN_FONT_OPTIONS = ["preferences", "monospace", "sans-serif", "serif"];
|
|
323
|
-
}
|
|
324
|
-
async getEditFontOptions() {
|
|
325
|
-
const e = await this.ctx.preferences.get("quickEdit.editFont");
|
|
326
|
-
return A.BUILT_IN_FONT_OPTIONS.includes(e) ? {
|
|
327
|
-
className: `mw-editfont-${e === "preferences" ? this.ctx.wiki.userOptions?.editfont || "monospace" : e}`,
|
|
328
|
-
fontFamily: ""
|
|
329
|
-
} : {
|
|
330
|
-
className: "mw-editfont-custom",
|
|
331
|
-
fontFamily: e
|
|
332
|
-
};
|
|
333
|
-
}
|
|
334
|
-
async getWikiPageFromPayload(e) {
|
|
335
|
-
if (e.revision)
|
|
336
|
-
return this.ctx.wikiPage.newFromRevision(e.revision, e.section);
|
|
337
|
-
if (e.pageId)
|
|
338
|
-
return this.ctx.wikiPage.newFromPageId(e.pageId, e.section);
|
|
339
|
-
if (e.title)
|
|
340
|
-
return this.ctx.wikiPage.newFromTitle(e.title, !1, e.section);
|
|
341
|
-
throw new Error("Invalid payload");
|
|
342
|
-
}
|
|
343
|
-
async injectToolbox(e) {
|
|
344
|
-
const r = this.ctx.currentPage.wikiTitle, d = this.ctx.wiki.hasRight("edit") && r && r.getNamespaceId() >= 0;
|
|
345
|
-
e.toolbox.addButton({
|
|
346
|
-
id: "quick-edit",
|
|
347
|
-
group: "group1",
|
|
348
|
-
index: 0,
|
|
349
|
-
icon: /* @__PURE__ */ t(
|
|
350
|
-
"svg",
|
|
351
|
-
{
|
|
352
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
353
|
-
width: "24",
|
|
354
|
-
height: "24",
|
|
355
|
-
viewBox: "0 0 24 24",
|
|
356
|
-
fill: "none",
|
|
357
|
-
stroke: "currentColor",
|
|
358
|
-
"stroke-width": "2",
|
|
359
|
-
"stroke-linecap": "round",
|
|
360
|
-
"stroke-linejoin": "round",
|
|
361
|
-
class: "icon icon-tabler icons-tabler-outline icon-tabler-edit",
|
|
362
|
-
children: [
|
|
363
|
-
/* @__PURE__ */ t("path", { stroke: "none", d: "M0 0h24v24H0z", fill: "none" }),
|
|
364
|
-
/* @__PURE__ */ t("path", { d: "M7 7h-1a2 2 0 0 0 -2 2v9a2 2 0 0 0 2 2h9a2 2 0 0 0 2 -2v-1" }),
|
|
365
|
-
/* @__PURE__ */ t("path", { d: "M20.385 6.585a2.1 2.1 0 0 0 -2.97 -2.97l-8.415 8.385v3h3l8.385 -8.415z" }),
|
|
366
|
-
/* @__PURE__ */ t("path", { d: "M16 5l3 3" })
|
|
367
|
-
]
|
|
368
|
-
}
|
|
369
|
-
),
|
|
370
|
-
buttonProps: {
|
|
371
|
-
disabled: !d
|
|
372
|
-
},
|
|
373
|
-
tooltip: d ? "Quick Edit" : "Not editable",
|
|
374
|
-
onClick: () => {
|
|
375
|
-
const n = new URLSearchParams(window.location.search).get("oldid");
|
|
376
|
-
this.showModal({
|
|
377
|
-
title: r?.getPrefixedText(),
|
|
378
|
-
revision: n ? Number(n) : void 0
|
|
379
|
-
});
|
|
380
|
-
}
|
|
381
|
-
});
|
|
382
|
-
}
|
|
383
|
-
removeToolbox(e) {
|
|
384
|
-
e.toolbox.removeButton("quick-edit");
|
|
385
|
-
}
|
|
386
|
-
};
|
|
387
|
-
y = H(B);
|
|
388
|
-
S = ee(y, 0, "PluginQuickEdit", M, S);
|
|
389
|
-
Z(y, 1, S);
|
|
390
|
-
let ue = S;
|
|
391
|
-
export {
|
|
392
|
-
ue as PluginQuickEdit
|
|
393
|
-
};
|
|
394
|
-
//# sourceMappingURL=index-CyG7_IYz.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index-CyG7_IYz.js","sources":["../src/utils/sleep.ts","../src/plugins/quick-edit/index.tsx"],"sourcesContent":["export const sleep = (ms: number = 0) =>\r\n new Promise((resolve) => setTimeout(resolve, ms))\r\n","import { Inject, InPageEdit, Schema } from '@/InPageEdit'\nimport { IWikiPage } from '@/models/WikiPage'\nimport { WatchlistAction } from '@/models/WikiPage/types/WatchlistAction'\nimport { IPEModal } from '@inpageedit/modal'\nimport { ReactNode } from 'jsx-dom'\nimport { makeCallable } from '@/utils/makeCallable.js'\n\ndeclare module '@/InPageEdit' {\n interface InPageEdit {\n quickEdit: PluginQuickEdit & {\n (...args: Parameters<PluginQuickEdit['showModal']>): ReturnType<PluginQuickEdit['showModal']>\n }\n }\n interface Events {\n 'quick-edit/init-options'(payload: Omit<QuickEditEventPayload, 'modal' | 'wikiPage'>): void\n 'quick-edit/show-modal'(payload: Omit<QuickEditEventPayload, 'wikiPage'>): void\n 'quick-edit/wiki-page'(payload: QuickEditEventPayload): void\n 'quick-edit/edit-notice'(payload: QuickEditEventPayload & { editNotices: ReactNode[] }): void\n 'quick-edit/submit'(payload: QuickEditSubmitPayload & { ctx: InPageEdit }): void\n }\n interface PreferencesMap {\n 'quickEdit.editSummary': string\n 'quickEdit.editMinor': boolean\n 'quickEdit.outSideClose': boolean\n 'quickEdit.watchList': WatchlistAction\n 'quickEdit.keyshortcut.save': string\n 'quickEdit.editFont': string\n }\n}\n\nexport interface QuickEditOptions {\n title: string\n pageId: number\n revision: number\n /**\n * - `undefined` for full article edit\n * - `0` for the first section\n * - `\"new\"` for a new section\n */\n section: number | 'new' | undefined\n editMinor: boolean\n editSummary: string\n createOnly: boolean\n reloadAfterSave: boolean\n}\n\nexport interface QuickEditEventPayload {\n ctx: InPageEdit\n options: QuickEditOptions\n modal: IPEModal\n wikiPage: IWikiPage\n}\n\nexport interface QuickEditSubmitPayload {\n wikiPage: IWikiPage\n text?: string\n summary?: string\n section?: number | 'new' | undefined\n minor?: boolean\n createonly?: boolean\n watchlist?: WatchlistAction\n}\n\n@Inject(['api', 'wikiPage', 'wikiTitle', 'currentPage', 'wiki', 'modal', 'preferences'])\n@RegisterPreferences(\n Schema.object({\n 'quickEdit.editSummary': Schema.string()\n .description('Default edit summary for quick edits')\n .default('[IPE-NEXT] Quick edit'),\n 'quickEdit.editMinor': Schema.boolean()\n .description('Default to checking \"minor edit\" option')\n .default(false),\n 'quickEdit.outSideClose': Schema.boolean()\n .description('Close editor modal by clicking outside')\n .default(true),\n 'quickEdit.watchList': Schema.union([\n Schema.const(WatchlistAction.preferences).description('Follow MW preferences'),\n Schema.const(WatchlistAction.nochange).description('Keep the current watchlist status'),\n Schema.const(WatchlistAction.watch).description('Add the page to watchlist'),\n Schema.const(WatchlistAction.unwatch).description('Remove the page from watchlist'),\n ])\n .description('Watchlist options')\n .default(WatchlistAction.preferences),\n 'quickEdit.keyshortcut.save': Schema.string()\n .default('ctrl-s')\n .description('save button key shortcut (blank to disable)'),\n 'quickEdit.editFont': Schema.union([\n Schema.const('preferences').description('Follow MW preferences'),\n Schema.const('monospace').description('Monospace'),\n Schema.const('sans-serif').description('Sans-serif'),\n Schema.const('serif').description('Serif'),\n Schema.string().description('Custom font (same as CSS `font-family` property)').default(''),\n ])\n .description(\"Font to use in quick edit's textarea\")\n .default('preferences'),\n })\n .description('Quick edit options')\n .extra('category', 'editor')\n)\nexport class PluginQuickEdit extends BasePlugin {\n private readonly DEFAULT_OPTIONS: QuickEditOptions = {\n title: '',\n pageId: 0,\n revision: 0,\n section: undefined,\n editMinor: false,\n editSummary: '',\n createOnly: false,\n reloadAfterSave: true,\n }\n\n constructor(public ctx: InPageEdit) {\n super(ctx, {}, 'quick-edit')\n this.ctx.root.set('quickEdit', makeCallable(this, 'showModal'))\n }\n\n protected start(): Promise<void> | void {\n this.ctx.inject(['toolbox'], (ctx) => {\n this.injectToolbox(ctx)\n ctx.on('dispose', () => {\n this.removeToolbox(ctx)\n })\n })\n }\n\n async showModal(payload?: string | Partial<QuickEditOptions>) {\n if (typeof payload === 'undefined') {\n payload = {}\n } else if (typeof payload === 'string') {\n payload = {\n title: payload,\n } as Partial<QuickEditOptions>\n }\n\n // @ts-expect-error legacy `page` option\n if (payload?.page) {\n // @ts-expect-error\n payload.title = payload.page\n // @ts-expect-error\n delete payload.page\n }\n\n if (!payload.title && !payload.pageId && !payload.revision) {\n this.logger.warn('None of the title, pageId or revision provided. Using defaults.')\n const searchParams = new URLSearchParams(window.location.search)\n const title = this.ctx.currentPage.wikiTitle\n payload = {\n ...payload,\n title: title?.getPrefixedDBKey(),\n revision: searchParams.has('oldid') ? Number(searchParams.get('oldid')) : undefined,\n pageId: searchParams.has('curid') ? Number(searchParams.get('curid')) : undefined,\n }\n }\n\n if (!payload.revision && !payload.pageId && payload.title) {\n const realTarget = this.ctx.wikiTitle.resolveSpecialPageTarget(payload.title)\n if (realTarget && realTarget.title.getNamespaceId() >= 0) {\n payload.title = realTarget.title.getPrefixedDBKey()\n payload.section ??= realTarget.section\n }\n }\n\n const outSideClose = (await this.ctx.preferences.get('quickEdit.outSideClose'))!\n const watchList = (await this.ctx.preferences.get('quickEdit.watchList'))!\n const editSummary =\n typeof payload.editSummary === 'string'\n ? payload.editSummary\n : (await this.ctx.preferences.get('quickEdit.editSummary'))!\n const editMinor =\n typeof payload.editMinor === 'boolean'\n ? payload.editMinor\n : (await this.ctx.preferences.get('quickEdit.editMinor'))!\n const fontOptions = await this.getEditFontOptions()\n\n const options: QuickEditOptions = {\n ...this.DEFAULT_OPTIONS,\n editSummary,\n editMinor,\n ...payload,\n }\n if (!options.editSummary) {\n options.editSummary = (await this.ctx.preferences.get('quickEdit.editSummary')) || ''\n }\n this.ctx.emit('quick-edit/init-options', { ctx: this.ctx, options })\n\n const modal = this.ctx.modal\n .createObject({\n className: 'ipe-quickEdit',\n sizeClass: 'large',\n // backdrop: false,\n // draggable: true,\n center: false,\n outSideClose,\n })\n .init()\n modal.setTitle(\n (\n <>\n Loading: <u>{options.title}</u>\n </>\n ) as HTMLElement\n )\n modal.setContent(\n (\n <section\n className=\"ipe-quickEdit-loading\"\n style={{\n height: '70vh',\n display: 'flex',\n flexDirection: 'column',\n justifyContent: 'center',\n alignItems: 'center',\n }}\n >\n <ProgressBar />\n </section>\n ) as HTMLElement\n )\n modal.addButton({\n side: 'right',\n type: 'button',\n className: 'is-danger is-ghost',\n label: 'Cancel',\n method() {\n modal.close()\n },\n })\n modal.show()\n this.ctx.emit('quick-edit/show-modal', { ctx: this.ctx, modal, options })\n\n let wikiPage: IWikiPage\n try {\n wikiPage = await this.getWikiPageFromPayload(options)\n if (wikiPage.pageInfo.special) {\n throw new Error('Special page is not editable')\n }\n } catch (e) {\n modal.off(modal.Event.Close)\n modal.close()\n this.ctx.modal.notify('error', {\n content: e instanceof Error ? e.message : String(e),\n })\n return\n }\n\n const edittingContent = options.section === 'new' ? '' : wikiPage.revisions[0]?.content || ''\n const edittingRevId = wikiPage.revisions[0]?.revid\n const isEdittingOld = edittingRevId && edittingRevId !== wikiPage.lastrevid\n const isCreatingNewSection = options.section === 'new'\n const isCreatingNewPage = wikiPage.pageid === 0\n\n modal.setTitle(\n (\n <>\n {isCreatingNewSection ? 'New section' : `Quick ${isCreatingNewPage ? 'Create' : 'Edit'}`}:{' '}\n <u>{wikiPage.pageInfo.title}</u>\n {isEdittingOld ? ` (Revision ${edittingRevId})` : ''}\n </>\n ) as HTMLElement\n )\n\n const editNotices = [] as ReactNode[]\n // Page not exists\n if (isCreatingNewPage) {\n editNotices.push(\n <MBox title=\"Attention\" type=\"important\">\n <p>This page does not exist.</p>\n </MBox>\n )\n }\n // Edit based on old revision\n if (isEdittingOld) {\n editNotices.push(\n <MBox title=\"Attention\" type=\"warning\">\n <p>\n You are editing a <em>historical version</em>; the content is not the latest!\n </p>\n </MBox>\n )\n }\n this.ctx.emit('quick-edit/edit-notice', {\n ctx: this.ctx,\n options,\n modal,\n wikiPage,\n editNotices,\n })\n\n const editForm = (\n <form className=\"ipe-quickEdit__form\">\n <div className=\"ipe-quickEdit__notices\">{editNotices}</div>\n <div\n className=\"ipe-quickEdit__content\"\n style={{ display: 'flex', flexDirection: 'column', gap: '1rem' }}\n >\n {options.section === 'new' && (\n <>\n <InputBox\n label=\"Section title\"\n id=\"summary\"\n name=\"summary\"\n value={''}\n inputProps={{ placeholder: 'Topic for new section, this will be the h2 heading' }}\n />\n </>\n )}\n <textarea\n className={`ipe-quickEdit__textarea ${fontOptions.className}`}\n style={{ fontFamily: fontOptions.fontFamily }}\n name=\"text\"\n id=\"wpTextbox1\"\n >\n {edittingContent}\n </textarea>\n </div>\n <div\n class=\"ipe-quickEdit__options\"\n style={{\n display: 'flex',\n flexDirection: 'column',\n gap: '1rem',\n marginTop: '1rem',\n }}\n >\n {!isCreatingNewSection && (\n <InputBox label=\"Summary\" id=\"summary\" name=\"summary\" value={options.editSummary} />\n )}\n <div className=\"ipe-input-box\">\n <label htmlFor=\"watchlist\" style={{ display: 'block' }}>\n Watchlist\n </label>\n <div style={{ display: 'flex', gap: '1rem' }}>\n {[\n WatchlistAction.preferences,\n WatchlistAction.nochange,\n WatchlistAction.watch,\n WatchlistAction.unwatch,\n ].map((action) => (\n <RadioBox\n key={action}\n name=\"watchlist\"\n value={action}\n inputProps={{ checked: watchList === action }}\n >\n {action}\n </RadioBox>\n ))}\n </div>\n </div>\n <div style={{ display: 'flex', gap: '1rem' }}>\n <CheckBox name=\"minor\" id=\"minor\" checked={options.editMinor}>\n Minor edit\n </CheckBox>\n <CheckBox name=\"reloadAfterSave\" id=\"reloadAfterSave\" checked={options.reloadAfterSave}>\n Reload after save\n </CheckBox>\n </div>\n </div>\n {/* Debug Info */}\n {import.meta.env.DEV && (\n <div className=\"debug\" style={{ marginTop: '1rem' }}>\n <details>\n <pre>{JSON.stringify(wikiPage.pageInfo, null, 2)}</pre>\n </details>\n </div>\n )}\n </form>\n ) as HTMLFormElement\n modal.setContent(editForm)\n // shamefully fix: make sure the submit button is always the first\n modal.addButton(\n {\n side: 'left',\n className: 'is-primary submit-btn',\n label: 'Submit',\n keyPress: (await this.ctx.preferences.get('quickEdit.keyshortcut.save')) || undefined,\n method: () => {\n const formData = new FormData(editForm)\n console.info(wikiPage, editForm, {\n text: formData.get('text') as string,\n summary: formData.get('summary') as string,\n minor: formData.get('minor') === 'on',\n })\n modal.setLoadingState(true)\n this.handleSubmit({\n wikiPage,\n text: formData.get('text') as string,\n summary: formData.get('summary') as string,\n minor: formData.get('minor') === 'on',\n section: options.section,\n createonly: wikiPage.pageid === 0,\n watchlist: watchList,\n })\n .then(async () => {\n modal.setOptions({\n beforeClose: noop,\n })\n modal.close()\n this.ctx.modal.notify('success', {\n title: 'Submission Successful',\n content: 'Your changes have been saved.',\n })\n if (formData.get('reloadAfterSave')) {\n await sleep(500)\n location.reload()\n }\n })\n .catch((error) => {\n this.ctx.modal.notify('error', {\n title: 'Submission Error',\n content: error instanceof Error ? error.message : String(error),\n })\n modal.setLoadingState(false)\n })\n },\n },\n 0\n )\n modal.setOptions({\n beforeClose: () => {\n const oldStr = wikiPage.revisions[0]?.content || ''\n const newStr = editForm.querySelector('textarea')?.value || ''\n if (newStr === oldStr) {\n return true\n } else {\n this.ctx.modal.confirm(\n {\n className: 'is-primary',\n title: 'Unsaved Changes',\n content:\n 'All edit contents will be lost after closing the modal. Are you sure you want to close?',\n center: true,\n okBtn: {\n label: 'Give Up',\n className: 'is-danger is-ghost',\n },\n cancelBtn: {\n label: 'Continue Editing',\n className: 'is-primary is-ghost',\n },\n },\n (confirmed) => {\n if (confirmed) {\n modal.setOptions({\n beforeClose: noop,\n })\n modal.close()\n }\n return true\n }\n )\n return false\n }\n },\n })\n this.ctx.emit('quick-edit/wiki-page', {\n ctx: this.ctx,\n options,\n modal,\n wikiPage,\n })\n\n const beforeUnload = (e: BeforeUnloadEvent) => {\n if (editForm.querySelector('textarea')?.value === edittingContent) {\n return true\n }\n e.preventDefault()\n return 'You have unsaved changes. Are you sure you want to leave?'\n }\n window.addEventListener('beforeunload', beforeUnload)\n modal.on(modal.Event.Close, () => {\n window.removeEventListener('beforeunload', beforeUnload)\n })\n }\n\n async handleSubmit(payload: QuickEditSubmitPayload) {\n const wikiPage = payload.wikiPage\n const summary = payload.summary || ''\n const text = payload.text || ''\n const minor = payload.minor\n const createonly = payload.createonly\n const watchlist = payload.watchlist\n const section = payload.section\n\n this.ctx.emit('quick-edit/submit', {\n ctx: this.ctx,\n wikiPage,\n summary,\n text,\n minor,\n createonly,\n watchlist,\n })\n\n return wikiPage.edit(\n {\n summary,\n text,\n watchlist,\n section,\n },\n {\n minor,\n createonly,\n }\n )\n }\n\n static readonly BUILT_IN_FONT_OPTIONS = ['preferences', 'monospace', 'sans-serif', 'serif']\n async getEditFontOptions() {\n const prefEditFont = (await this.ctx.preferences.get('quickEdit.editFont'))!\n if (PluginQuickEdit.BUILT_IN_FONT_OPTIONS.includes(prefEditFont)) {\n const editfont =\n prefEditFont === 'preferences'\n ? this.ctx.wiki.userOptions?.editfont || 'monospace'\n : prefEditFont\n return {\n className: `mw-editfont-${editfont}`,\n fontFamily: '',\n }\n } else {\n return {\n className: 'mw-editfont-custom',\n fontFamily: prefEditFont,\n }\n }\n }\n\n async getWikiPageFromPayload(payload: Partial<QuickEditOptions>) {\n if (payload.revision) {\n return this.ctx.wikiPage.newFromRevision(payload.revision, payload.section)\n } else if (payload.pageId) {\n return this.ctx.wikiPage.newFromPageId(payload.pageId, payload.section)\n } else if (payload.title) {\n return this.ctx.wikiPage.newFromTitle(payload.title, false, payload.section)\n }\n throw new Error('Invalid payload')\n }\n\n private async injectToolbox(ctx: InPageEdit) {\n const title = this.ctx.currentPage.wikiTitle\n const canEdit = this.ctx.wiki.hasRight('edit') && title && title.getNamespaceId() >= 0\n ctx.toolbox.addButton({\n id: 'quick-edit',\n group: 'group1',\n index: 0,\n icon: (\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-edit\"\n >\n <path stroke=\"none\" d=\"M0 0h24v24H0z\" fill=\"none\" />\n <path d=\"M7 7h-1a2 2 0 0 0 -2 2v9a2 2 0 0 0 2 2h9a2 2 0 0 0 2 -2v-1\" />\n <path d=\"M20.385 6.585a2.1 2.1 0 0 0 -2.97 -2.97l-8.415 8.385v3h3l8.385 -8.415z\" />\n <path d=\"M16 5l3 3\" />\n </svg>\n ) as HTMLElement,\n buttonProps: {\n disabled: !canEdit,\n },\n tooltip: canEdit ? 'Quick Edit' : 'Not editable',\n onClick: () => {\n const revision = new URLSearchParams(window.location.search).get('oldid')\n this.showModal({\n title: title?.getPrefixedText(),\n revision: revision ? Number(revision) : undefined,\n })\n },\n })\n }\n\n protected removeToolbox(ctx: InPageEdit) {\n ctx.toolbox.removeButton('quick-edit')\n }\n}\n"],"names":["sleep","ms","resolve","_PluginQuickEdit_decorators","_init","_a","Inject","RegisterPreferences","Schema","WatchlistAction","_PluginQuickEdit","BasePlugin","ctx","makeCallable","payload","searchParams","title","realTarget","outSideClose","watchList","editSummary","editMinor","fontOptions","options","modal","jsxs","Fragment","jsx","ProgressBar","wikiPage","e","edittingContent","edittingRevId","isEdittingOld","isCreatingNewSection","isCreatingNewPage","editNotices","MBox","editForm","InputBox","action","RadioBox","CheckBox","formData","noop","error","oldStr","confirmed","beforeUnload","summary","text","minor","createonly","watchlist","section","prefEditFont","canEdit","revision","__decoratorStart","__decorateElement","__runInitializers","PluginQuickEdit"],"mappings":";;;;;;;;;;AAAO,MAAMA,IAAQ,CAACC,IAAa,MACjC,IAAI,QAAQ,CAACC,M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