@inpageedit/core 0.10.0 → 0.11.1

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.
Files changed (63) hide show
  1. package/README.md +9 -2
  2. package/dist/PluginPrefSync-COidewzp.js +258 -0
  3. package/dist/PluginPrefSync-COidewzp.js.map +1 -0
  4. package/dist/__test__/utils/constants.d.ts +3 -2
  5. package/dist/components/index.js +69 -51
  6. package/dist/components/index.js.map +1 -1
  7. package/dist/constants/endpoints.d.ts +1 -1
  8. package/dist/{index-BR6gK_ki.js → index-BNDyaWnI.js} +44 -38
  9. package/dist/index-BNDyaWnI.js.map +1 -0
  10. package/dist/{index-BnAhw94L.js → index-BQzuJxBO.js} +2 -2
  11. package/dist/{index-BnAhw94L.js.map → index-BQzuJxBO.js.map} +1 -1
  12. package/dist/{index-Z-_kjibx.js → index-BUI2IX49.js} +763 -699
  13. package/dist/index-BUI2IX49.js.map +1 -0
  14. package/dist/{index-Cx-YiN1j.js → index-CBszdxJJ.js} +22 -21
  15. package/dist/index-CBszdxJJ.js.map +1 -0
  16. package/dist/index-CfgnJ51A.js +185 -0
  17. package/dist/index-CfgnJ51A.js.map +1 -0
  18. package/dist/index-Cx4qgCJK.js +4914 -0
  19. package/dist/{index-DqJUIV2e.js.map → index-Cx4qgCJK.js.map} +1 -1
  20. package/dist/index-D5J7RU5I.js +211 -0
  21. package/dist/index-D5J7RU5I.js.map +1 -0
  22. package/dist/{index-ByzgI28q.js → index-MhNAv9Vf.js} +6 -2
  23. package/dist/index-MhNAv9Vf.js.map +1 -0
  24. package/dist/{index-ByJfEsN8.js → index-U2RPZk8N.js} +148 -110
  25. package/dist/index-U2RPZk8N.js.map +1 -0
  26. package/dist/{index-CAiGct8U.js → index-VnRKIVau.js} +42 -42
  27. package/dist/index-VnRKIVau.js.map +1 -0
  28. package/dist/{index-eOIVMf9E.js → index-etJXONAj.js} +46 -35
  29. package/dist/index-etJXONAj.js.map +1 -0
  30. package/dist/index.js +1 -1
  31. package/dist/models/WikiTitle/index.d.ts +2 -2
  32. package/dist/plugins/analytics/index.d.ts +41 -0
  33. package/dist/plugins/in-article-links/index.d.ts +14 -0
  34. package/dist/plugins/preferences-ui/PluginPrefSync.d.ts +2 -0
  35. package/dist/plugins/preferences-ui/index.d.ts +3 -1
  36. package/dist/plugins/quick-delete/index.d.ts +3 -0
  37. package/dist/plugins/quick-diff/index.d.ts +17 -0
  38. package/dist/plugins/quick-edit/index.d.ts +8 -0
  39. package/dist/plugins/quick-move/index.d.ts +16 -0
  40. package/dist/plugins/quick-redirect/index.d.ts +15 -0
  41. package/dist/plugins/toolbox/index.d.ts +9 -0
  42. package/dist/services/PreferencesService.d.ts +9 -2
  43. package/dist/services/WikiMetadataService.d.ts +23 -23
  44. package/dist/style.css +1 -1
  45. package/dist/types/WikiMetadata.d.ts +6 -8
  46. package/lib/index.umd.js +24 -24
  47. package/lib/index.umd.js.map +1 -1
  48. package/lib/style.css +1 -1
  49. package/package.json +3 -3
  50. package/dist/ActionButton-BgbTKTg7.js +0 -24
  51. package/dist/ActionButton-BgbTKTg7.js.map +0 -1
  52. package/dist/PluginPrefSync-CNCU2DJU.js +0 -171
  53. package/dist/PluginPrefSync-CNCU2DJU.js.map +0 -1
  54. package/dist/index-2mNdeL-V.js +0 -193
  55. package/dist/index-2mNdeL-V.js.map +0 -1
  56. package/dist/index-BR6gK_ki.js.map +0 -1
  57. package/dist/index-ByJfEsN8.js.map +0 -1
  58. package/dist/index-ByzgI28q.js.map +0 -1
  59. package/dist/index-CAiGct8U.js.map +0 -1
  60. package/dist/index-Cx-YiN1j.js.map +0 -1
  61. package/dist/index-DqJUIV2e.js +0 -4861
  62. package/dist/index-Z-_kjibx.js.map +0 -1
  63. package/dist/index-eOIVMf9E.js.map +0 -1
@@ -1,40 +1,47 @@
1
- import { j as t, F as b, P as O } from "./index-CvhkVj_L.js";
2
- import { B as D, W as h, I as j, S as u } from "./index-Z-_kjibx.js";
3
- import { m as L } from "./makeCallable-LDU0xZMJ.js";
4
- import { R } from "./Preferences-DS4-CFWe.js";
5
- import { M as y } from "./index-lZkYoUca.js";
1
+ import { j as t, F as _, P as L } from "./index-CvhkVj_L.js";
2
+ import { B as j, W as h, I as R, S as l } from "./index-BUI2IX49.js";
3
+ import { m as U } from "./makeCallable-LDU0xZMJ.js";
4
+ import { R as Q } from "./Preferences-DS4-CFWe.js";
5
+ import { M as N } from "./index-lZkYoUca.js";
6
6
  import { I as q } from "./InputBox-BV4m05Xs.js";
7
- import { R as U } from "./RadioBox-nJqWsxW2.js";
8
- import { C as N } from "./CheckBox-D3rHnX7I.js";
9
- import { n as C } from "./noop-ClDc6zv4.js";
10
- const W = (i = 0) => new Promise((e) => setTimeout(e, i));
11
- var z = Object.create, _ = Object.defineProperty, Q = Object.getOwnPropertyDescriptor, I = (i, e) => (e = Symbol[i]) ? e : Symbol.for("Symbol." + i), T = (i) => {
7
+ import { R as W } from "./RadioBox-nJqWsxW2.js";
8
+ import { C as I } from "./CheckBox-D3rHnX7I.js";
9
+ import { n as T } from "./noop-ClDc6zv4.js";
10
+ const z = (i = 0) => new Promise((e) => setTimeout(e, i));
11
+ var $ = Object.create, E = Object.defineProperty, K = Object.getOwnPropertyDescriptor, C = (i, e) => (e = Symbol[i]) ? e : Symbol.for("Symbol." + i), F = (i) => {
12
12
  throw TypeError(i);
13
- }, K = (i, e, c) => e in i ? _(i, e, { enumerable: !0, configurable: !0, writable: !0, value: c }) : i[e] = c, Y = (i, e) => _(i, "name", { value: e, configurable: !0 }), $ = (i) => [, , , z(i?.[I("metadata")] ?? null)], G = ["class", "method", "getter", "setter", "accessor", "field", "value", "get", "set"], M = (i) => i !== void 0 && typeof i != "function" ? T("Function expected") : i, H = (i, e, c, l, n) => ({ kind: G[i], name: e, metadata: l, addInitializer: (d) => c._ ? T("Already initialized") : n.push(M(d || null)) }), X = (i, e) => K(e, I("metadata"), i[3]), J = (i, e, c, l) => {
14
- for (var n = 0, d = i[e >> 1], s = d && d.length; n < s; n++) d[n].call(c);
15
- return l;
16
- }, V = (i, e, c, l, n, d) => {
17
- var s, r, a, g = e & 7, f = !1, w = 0, x = i[w] || (i[w] = []), p = g && (n = n.prototype, g < 5 && (g > 3 || !f) && Q(n, c));
18
- Y(n, c);
19
- for (var m = l.length - 1; m >= 0; m--)
20
- a = H(g, c, r = {}, i[3], x), s = (0, l[m])(n, a), r._ = 1, M(s) && (n = s);
21
- return X(i, n), p && _(n, c, p), f ? g ^ 4 ? d : p : n;
22
- }, B, E, A;
23
- B = [j(["api", "wikiPage", "wikiTitle", "currentPage", "wiki", "modal", "preferences"]), R(
24
- u.object({
25
- "quickEdit.editSummary": u.string().description("Default edit summary for quick edits").default("[IPE-NEXT] Quick edit"),
26
- "quickEdit.editMinor": u.boolean().description("Whether to mark the edit as minor").default(!1),
27
- "quickEdit.outSideClose": u.boolean().description("Whether to close the modal outside").default(!0),
28
- "quickEdit.watchList": u.union([
29
- u.const(h.preferences).description("Follow my preferences"),
30
- u.const(h.nochange).description("Keep the current watchlist status"),
31
- u.const(h.watch).description("Add the page to watchlist"),
32
- u.const(h.unwatch).description("Remove the page from watchlist")
13
+ }, 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) => {
14
+ for (var n = 0, u = i[e >> 1], m = u && u.length; n < m; n++) u[n].call(r);
15
+ return d;
16
+ }, ee = (i, e, r, d, n, u) => {
17
+ 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));
18
+ G(n, r);
19
+ for (var g = d.length - 1; g >= 0; g--)
20
+ s = J(a, r, c = {}, i[3], x), m = (0, d[g])(n, s), c._ = 1, O(m) && (n = m);
21
+ return V(i, n), p && E(n, r, p), v ? a ^ 4 ? u : p : n;
22
+ }, M, y, B;
23
+ M = [R(["api", "wikiPage", "wikiTitle", "currentPage", "wiki", "modal", "preferences"]), Q(
24
+ l.object({
25
+ "quickEdit.editSummary": l.string().description("Default edit summary for quick edits").default("[IPE-NEXT] Quick edit"),
26
+ "quickEdit.editMinor": l.boolean().description('Default to checking "minor edit" option').default(!1),
27
+ "quickEdit.outSideClose": l.boolean().description("Close editor modal by clicking outside").default(!0),
28
+ "quickEdit.watchList": l.union([
29
+ l.const(h.preferences).description("Follow MW preferences"),
30
+ l.const(h.nochange).description("Keep the current watchlist status"),
31
+ l.const(h.watch).description("Add the page to watchlist"),
32
+ l.const(h.unwatch).description("Remove the page from watchlist")
33
33
  ]).description("Watchlist options").default(h.preferences),
34
- "quickEdit.keyshortcut.save": u.string().default("ctrl-s").description("save button key shortcut (blank to disable)")
34
+ "quickEdit.keyshortcut.save": l.string().default("ctrl-s").description("save button key shortcut (blank to disable)"),
35
+ "quickEdit.editFont": l.union([
36
+ l.const("preferences").description("Follow MW preferences"),
37
+ l.const("monospace").description("Monospace"),
38
+ l.const("sans-serif").description("Sans-serif"),
39
+ l.const("serif").description("Serif"),
40
+ l.string().description("Custom font (same as CSS `font-family` property)").default("")
41
+ ]).description("Font to use in quick edit's textarea").default("preferences")
35
42
  }).description("Quick edit options").extra("category", "edit")
36
43
  )];
37
- class S extends (A = D) {
44
+ let S = class A extends (B = j) {
38
45
  constructor(e) {
39
46
  super(e, {}, "quick-edit"), this.ctx = e, this.DEFAULT_OPTIONS = {
40
47
  title: "",
@@ -45,7 +52,7 @@ class S extends (A = D) {
45
52
  editSummary: "",
46
53
  createOnly: !1,
47
54
  reloadAfterSave: !0
48
- }, this.ctx.root.set("quickEdit", L(this, "showModal"));
55
+ }, this.ctx.root.set("quickEdit", U(this, "showModal"));
49
56
  }
50
57
  start() {
51
58
  this.ctx.inject(["toolbox"], (e) => {
@@ -59,10 +66,10 @@ class S extends (A = D) {
59
66
  title: e
60
67
  }), e?.page && (e.title = e.page, delete e.page), !e.title && !e.pageId && !e.revision) {
61
68
  this.logger.warn("None of the title, pageId or revision provided. Using defaults.");
62
- const o = new URLSearchParams(window.location.search), v = this.ctx.currentPage.wikiTitle;
69
+ const o = new URLSearchParams(window.location.search), w = this.ctx.currentPage.wikiTitle;
63
70
  e = {
64
71
  ...e,
65
- title: v?.getPrefixedDBKey(),
72
+ title: w?.getPrefixedDBKey(),
66
73
  revision: o.has("oldid") ? Number(o.get("oldid")) : void 0,
67
74
  pageId: o.has("curid") ? Number(o.get("curid")) : void 0
68
75
  };
@@ -71,27 +78,27 @@ class S extends (A = D) {
71
78
  const o = this.ctx.wikiTitle.resolveSpecialPageTarget(e.title);
72
79
  o && o.title.getNamespaceId() >= 0 && (e.title = o.title.getPrefixedDBKey(), e.section ??= o.section);
73
80
  }
74
- const c = await this.ctx.preferences.get("quickEdit.outSideClose"), l = await this.ctx.preferences.get("quickEdit.watchList"), n = typeof e.editSummary == "string" ? e.editSummary : await this.ctx.preferences.get("quickEdit.editSummary"), d = typeof e.editMinor == "boolean" ? e.editMinor : await this.ctx.preferences.get("quickEdit.editMinor"), s = {
81
+ 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 = {
75
82
  ...this.DEFAULT_OPTIONS,
76
83
  editSummary: n,
77
- editMinor: d,
84
+ editMinor: u,
78
85
  ...e
79
86
  };
80
- s.editSummary || (s.editSummary = await this.ctx.preferences.get("quickEdit.editSummary") || ""), this.ctx.emit("quick-edit/init-options", { ctx: this.ctx, options: s });
81
- const r = this.ctx.modal.createObject({
87
+ c.editSummary || (c.editSummary = await this.ctx.preferences.get("quickEdit.editSummary") || ""), this.ctx.emit("quick-edit/init-options", { ctx: this.ctx, options: c });
88
+ const s = this.ctx.modal.createObject({
82
89
  className: "ipe-quickEdit",
83
90
  sizeClass: "large",
84
91
  // backdrop: false,
85
92
  // draggable: true,
86
93
  center: !1,
87
- outSideClose: c
94
+ outSideClose: r
88
95
  }).init();
89
- r.setTitle(
90
- /* @__PURE__ */ t(b, { children: [
96
+ s.setTitle(
97
+ /* @__PURE__ */ t(_, { children: [
91
98
  "Loading: ",
92
- /* @__PURE__ */ t("u", { children: s.title })
99
+ /* @__PURE__ */ t("u", { children: c.title })
93
100
  ] })
94
- ), r.setContent(
101
+ ), s.setContent(
95
102
  /* @__PURE__ */ t(
96
103
  "section",
97
104
  {
@@ -103,63 +110,63 @@ class S extends (A = D) {
103
110
  justifyContent: "center",
104
111
  alignItems: "center"
105
112
  },
106
- children: /* @__PURE__ */ t(O, {})
113
+ children: /* @__PURE__ */ t(L, {})
107
114
  }
108
115
  )
109
- ), r.addButton({
116
+ ), s.addButton({
110
117
  side: "right",
111
118
  type: "button",
112
119
  className: "is-danger is-ghost",
113
120
  label: "Cancel",
114
121
  method() {
115
- r.close();
122
+ s.close();
116
123
  }
117
- }), r.show(), this.ctx.emit("quick-edit/show-modal", { ctx: this.ctx, modal: r, options: s });
124
+ }), s.show(), this.ctx.emit("quick-edit/show-modal", { ctx: this.ctx, modal: s, options: c });
118
125
  let a;
119
126
  try {
120
- if (a = await this.getWikiPageFromPayload(s), a.pageInfo.special)
127
+ if (a = await this.getWikiPageFromPayload(c), a.pageInfo.special)
121
128
  throw new Error("Special page is not editable");
122
129
  } catch (o) {
123
- r.off(r.Event.Close), r.close(), this.ctx.modal.notify("error", {
130
+ s.off(s.Event.Close), s.close(), this.ctx.modal.notify("error", {
124
131
  content: o instanceof Error ? o.message : String(o)
125
132
  });
126
133
  return;
127
134
  }
128
- const g = s.section === "new" ? "" : a.revisions[0]?.content || "", f = a.revisions[0]?.revid, w = f && f !== a.lastrevid, x = s.section === "new", p = a.pageid === 0;
129
- r.setTitle(
130
- /* @__PURE__ */ t(b, { children: [
131
- x ? "New section" : `Quick ${p ? "Create" : "Edit"}`,
135
+ 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;
136
+ s.setTitle(
137
+ /* @__PURE__ */ t(_, { children: [
138
+ p ? "New section" : `Quick ${g ? "Create" : "Edit"}`,
132
139
  ":",
133
140
  " ",
134
141
  /* @__PURE__ */ t("u", { children: a.pageInfo.title }),
135
- w ? ` (Revision ${f})` : ""
142
+ x ? ` (Revision ${f})` : ""
136
143
  ] })
137
144
  );
138
- const m = [];
139
- p && m.push(
140
- /* @__PURE__ */ t(y, { title: "Attention", type: "important", children: /* @__PURE__ */ t("p", { children: "This page does not exist." }) })
141
- ), w && m.push(
142
- /* @__PURE__ */ t(y, { title: "Attention", type: "warning", children: /* @__PURE__ */ t("p", { children: [
145
+ const k = [];
146
+ g && k.push(
147
+ /* @__PURE__ */ t(N, { title: "Attention", type: "important", children: /* @__PURE__ */ t("p", { children: "This page does not exist." }) })
148
+ ), x && k.push(
149
+ /* @__PURE__ */ t(N, { title: "Attention", type: "warning", children: /* @__PURE__ */ t("p", { children: [
143
150
  "You are editing a ",
144
151
  /* @__PURE__ */ t("em", { children: "historical version" }),
145
152
  "; the content is not the latest!"
146
153
  ] }) })
147
154
  ), this.ctx.emit("quick-edit/edit-notice", {
148
155
  ctx: this.ctx,
149
- options: s,
150
- modal: r,
156
+ options: c,
157
+ modal: s,
151
158
  wikiPage: a,
152
- editNotices: m
159
+ editNotices: k
153
160
  });
154
- const k = /* @__PURE__ */ t("form", { className: "ipe-quickEdit__form", children: [
155
- /* @__PURE__ */ t("div", { className: "ipe-quickEdit__notices", children: m }),
161
+ const b = /* @__PURE__ */ t("form", { className: "ipe-quickEdit__form", children: [
162
+ /* @__PURE__ */ t("div", { className: "ipe-quickEdit__notices", children: k }),
156
163
  /* @__PURE__ */ t(
157
164
  "div",
158
165
  {
159
166
  className: "ipe-quickEdit__content",
160
167
  style: { display: "flex", flexDirection: "column", gap: "1rem" },
161
168
  children: [
162
- s.section === "new" && /* @__PURE__ */ t(b, { children: /* @__PURE__ */ t(
169
+ c.section === "new" && /* @__PURE__ */ t(_, { children: /* @__PURE__ */ t(
163
170
  q,
164
171
  {
165
172
  label: "Section title",
@@ -169,7 +176,16 @@ class S extends (A = D) {
169
176
  inputProps: { placeholder: "Topic for new section, this will be the h2 heading" }
170
177
  }
171
178
  ) }),
172
- /* @__PURE__ */ t("textarea", { className: "ipe-quickEdit__textarea", name: "text", id: "wpTextbox1", children: g })
179
+ /* @__PURE__ */ t(
180
+ "textarea",
181
+ {
182
+ className: `ipe-quickEdit__textarea ${m.className}`,
183
+ style: { fontFamily: m.fontFamily },
184
+ name: "text",
185
+ id: "wpTextbox1",
186
+ children: v
187
+ }
188
+ )
173
189
  ]
174
190
  }
175
191
  ),
@@ -184,7 +200,7 @@ class S extends (A = D) {
184
200
  marginTop: "1rem"
185
201
  },
186
202
  children: [
187
- !x && /* @__PURE__ */ t(q, { label: "Summary", id: "summary", name: "summary", value: s.editSummary }),
203
+ !p && /* @__PURE__ */ t(q, { label: "Summary", id: "summary", name: "summary", value: c.editSummary }),
188
204
  /* @__PURE__ */ t("div", { className: "ipe-input-box", children: [
189
205
  /* @__PURE__ */ t("label", { htmlFor: "watchlist", style: { display: "block" }, children: "Watchlist" }),
190
206
  /* @__PURE__ */ t("div", { style: { display: "flex", gap: "1rem" }, children: [
@@ -193,61 +209,61 @@ class S extends (A = D) {
193
209
  h.watch,
194
210
  h.unwatch
195
211
  ].map((o) => /* @__PURE__ */ t(
196
- U,
212
+ W,
197
213
  {
198
214
  name: "watchlist",
199
215
  value: o,
200
- inputProps: { checked: l === o },
216
+ inputProps: { checked: d === o },
201
217
  children: o
202
218
  },
203
219
  o
204
220
  )) })
205
221
  ] }),
206
222
  /* @__PURE__ */ t("div", { style: { display: "flex", gap: "1rem" }, children: [
207
- /* @__PURE__ */ t(N, { name: "minor", id: "minor", checked: s.editMinor, children: "Minor edit" }),
208
- /* @__PURE__ */ t(N, { name: "reloadAfterSave", id: "reloadAfterSave", checked: s.reloadAfterSave, children: "Reload after save" })
223
+ /* @__PURE__ */ t(I, { name: "minor", id: "minor", checked: c.editMinor, children: "Minor edit" }),
224
+ /* @__PURE__ */ t(I, { name: "reloadAfterSave", id: "reloadAfterSave", checked: c.reloadAfterSave, children: "Reload after save" })
209
225
  ] })
210
226
  ]
211
227
  }
212
228
  ),
213
229
  !1
214
230
  ] });
215
- r.setContent(k), r.addButton(
231
+ s.setContent(b), s.addButton(
216
232
  {
217
233
  side: "left",
218
234
  className: "is-primary submit-btn",
219
235
  label: "Submit",
220
236
  keyPress: await this.ctx.preferences.get("quickEdit.keyshortcut.save") || void 0,
221
237
  method: () => {
222
- const o = new FormData(k);
223
- r.setLoadingState(!0), this.handleSubmit({
238
+ const o = new FormData(b);
239
+ s.setLoadingState(!0), this.handleSubmit({
224
240
  wikiPage: a,
225
241
  text: o.get("text"),
226
242
  summary: o.get("summary"),
227
243
  minor: o.get("minor") === "on",
228
- section: s.section,
244
+ section: c.section,
229
245
  createonly: a.pageid === 0,
230
- watchlist: l
246
+ watchlist: d
231
247
  }).then(async () => {
232
- r.setOptions({
233
- beforeClose: C
234
- }), r.close(), this.ctx.modal.notify("success", {
248
+ s.setOptions({
249
+ beforeClose: T
250
+ }), s.close(), this.ctx.modal.notify("success", {
235
251
  title: "Submission Successful",
236
252
  content: "Your changes have been saved."
237
- }), o.get("reloadAfterSave") && (await W(500), location.reload());
238
- }).catch((v) => {
253
+ }), o.get("reloadAfterSave") && (await z(500), location.reload());
254
+ }).catch((w) => {
239
255
  this.ctx.modal.notify("error", {
240
256
  title: "Submission Error",
241
- content: v instanceof Error ? v.message : String(v)
242
- }), r.setLoadingState(!1);
257
+ content: w instanceof Error ? w.message : String(w)
258
+ }), s.setLoadingState(!1);
243
259
  });
244
260
  }
245
261
  },
246
262
  0
247
- ), r.setOptions({
263
+ ), s.setOptions({
248
264
  beforeClose: () => {
249
265
  const o = a.revisions[0]?.content || "";
250
- return (k.querySelector("textarea")?.value || "") === o ? !0 : (this.ctx.modal.confirm(
266
+ return (b.querySelector("textarea")?.value || "") === o ? !0 : (this.ctx.modal.confirm(
251
267
  {
252
268
  className: "is-primary",
253
269
  title: "Unsaved Changes",
@@ -262,37 +278,58 @@ class S extends (A = D) {
262
278
  className: "is-primary is-ghost"
263
279
  }
264
280
  },
265
- (F) => (F && (r.setOptions({
266
- beforeClose: C
267
- }), r.close()), !0)
281
+ (D) => (D && (s.setOptions({
282
+ beforeClose: T
283
+ }), s.close()), !0)
268
284
  ), !1);
269
285
  }
270
286
  }), this.ctx.emit("quick-edit/wiki-page", {
271
287
  ctx: this.ctx,
272
- options: s,
273
- modal: r,
288
+ options: c,
289
+ modal: s,
274
290
  wikiPage: a
275
291
  });
276
- const P = (o) => k.querySelector("textarea")?.value === a.revisions[0]?.content ? !0 : (o.preventDefault(), "You have unsaved changes. Are you sure you want to leave?");
277
- window.addEventListener("beforeunload", P), r.on(r.Event.Close, () => {
292
+ const P = (o) => b.querySelector("textarea")?.value === v ? !0 : (o.preventDefault(), "You have unsaved changes. Are you sure you want to leave?");
293
+ window.addEventListener("beforeunload", P), s.on(s.Event.Close, () => {
278
294
  window.removeEventListener("beforeunload", P);
279
295
  });
280
296
  }
281
297
  async handleSubmit(e) {
282
- const c = e.wikiPage, l = e.summary || "", n = e.text || "", d = e.minor, s = e.createonly, r = e.watchlist, a = e.section;
283
- return c.edit(
298
+ const r = e.wikiPage, d = e.summary || "", n = e.text || "", u = e.minor, m = e.createonly, c = e.watchlist, s = e.section;
299
+ return this.ctx.emit("quick-edit/submit", {
300
+ ctx: this.ctx,
301
+ wikiPage: r,
302
+ summary: d,
303
+ text: n,
304
+ minor: u,
305
+ createonly: m,
306
+ watchlist: c
307
+ }), r.edit(
284
308
  {
285
- summary: l,
309
+ summary: d,
286
310
  text: n,
287
- watchlist: r,
288
- section: a
311
+ watchlist: c,
312
+ section: s
289
313
  },
290
314
  {
291
- minor: d,
292
- createonly: s
315
+ minor: u,
316
+ createonly: m
293
317
  }
294
318
  );
295
319
  }
320
+ static {
321
+ this.BUILT_IN_FONT_OPTIONS = ["preferences", "monospace", "sans-serif", "serif"];
322
+ }
323
+ async getEditFontOptions() {
324
+ const e = await this.ctx.preferences.get("quickEdit.editFont");
325
+ return A.BUILT_IN_FONT_OPTIONS.includes(e) ? {
326
+ className: `mw-editfont-${e === "preferences" ? this.ctx.wiki.userOptions?.editfont || "monospace" : e}`,
327
+ fontFamily: ""
328
+ } : {
329
+ className: "mw-editfont-custom",
330
+ fontFamily: e
331
+ };
332
+ }
296
333
  async getWikiPageFromPayload(e) {
297
334
  if (e.revision)
298
335
  return this.ctx.wikiPage.newFromRevision(e.revision, e.section);
@@ -303,7 +340,7 @@ class S extends (A = D) {
303
340
  throw new Error("Invalid payload");
304
341
  }
305
342
  async injectToolbox(e) {
306
- const c = this.ctx.currentPage.wikiTitle, l = this.ctx.wiki.hasRight("edit") && c && c.getNamespaceId() >= 0;
343
+ const r = this.ctx.currentPage.wikiTitle, d = this.ctx.wiki.hasRight("edit") && r && r.getNamespaceId() >= 0;
307
344
  e.toolbox.addButton({
308
345
  id: "quick-edit",
309
346
  group: "group1",
@@ -330,13 +367,13 @@ class S extends (A = D) {
330
367
  }
331
368
  ),
332
369
  buttonProps: {
333
- disabled: !l
370
+ disabled: !d
334
371
  },
335
- tooltip: l ? "Quick Edit" : "Not editable",
372
+ tooltip: d ? "Quick Edit" : "Not editable",
336
373
  onClick: () => {
337
374
  const n = new URLSearchParams(window.location.search).get("oldid");
338
375
  this.showModal({
339
- title: c?.getPrefixedText(),
376
+ title: r?.getPrefixedText(),
340
377
  revision: n ? Number(n) : void 0
341
378
  });
342
379
  }
@@ -345,11 +382,12 @@ class S extends (A = D) {
345
382
  removeToolbox(e) {
346
383
  e.toolbox.removeButton("quick-edit");
347
384
  }
348
- }
349
- E = $(A);
350
- S = V(E, 0, "PluginQuickEdit", B, S);
351
- J(E, 1, S);
385
+ };
386
+ y = H(B);
387
+ S = ee(y, 0, "PluginQuickEdit", M, S);
388
+ Z(y, 1, S);
389
+ let de = S;
352
390
  export {
353
- S as PluginQuickEdit
391
+ de as PluginQuickEdit
354
392
  };
355
- //# sourceMappingURL=index-ByJfEsN8.js.map
393
+ //# sourceMappingURL=index-U2RPZk8N.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index-U2RPZk8N.js","sources":["../src/utils/sleep.ts","../src/plugins/quick-edit/index.tsx"],"sourcesContent":["export const sleep = (ms: number = 0) =>\n new Promise((resolve) => setTimeout(resolve, ms))\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}\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', 'edit')\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<boolean>('quickEdit.outSideClose'))!\n const watchList = (await this.ctx.preferences.get<WatchlistAction>('quickEdit.watchList'))!\n const editSummary =\n typeof payload.editSummary === 'string'\n ? payload.editSummary\n : (await this.ctx.preferences.get<string>('quickEdit.editSummary'))!\n const editMinor =\n typeof payload.editMinor === 'boolean'\n ? payload.editMinor\n : (await this.ctx.preferences.get<boolean>('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<string>('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:\n (await this.ctx.preferences.get<string>('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<string>('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,MAAY,WAAWA,GAASD,CAAE,CAAC;;;;;;;;;;;;GCDlDE,GAAAC,GAAAC;AAuDAF,IAAA,CAACG,EAAO,CAAC,OAAO,YAAY,aAAa,eAAe,QAAQ,SAAS,aAAa,CAAC,GACtFC;AAAA,EACCC,EAAO,OAAO;AAAA,IACZ,yBAAyBA,EAAO,OAAA,EAC7B,YAAY,sCAAsC,EAClD,QAAQ,uBAAuB;AAAA,IAClC,uBAAuBA,EAAO,QAAA,EAC3B,YAAY,yCAAyC,EACrD,QAAQ,EAAK;AAAA,IAChB,0BAA0BA,EAAO,QAAA,EAC9B,YAAY,wCAAwC,EACpD,QAAQ,EAAI;AAAA,IACf,uBAAuBA,EAAO,MAAM;AAAA,MAClCA,EAAO,MAAMC,EAAgB,WAAW,EAAE,YAAY,uBAAuB;AAAA,MAC7ED,EAAO,MAAMC,EAAgB,QAAQ,EAAE,YAAY,mCAAmC;AAAA,MACtFD,EAAO,MAAMC,EAAgB,KAAK,EAAE,YAAY,2BAA2B;AAAA,MAC3ED,EAAO,MAAMC,EAAgB,OAAO,EAAE,YAAY,gCAAgC;AAAA,IAAA,CACnF,EACE,YAAY,mBAAmB,EAC/B,QAAQA,EAAgB,WAAW;AAAA,IACtC,8BAA8BD,EAAO,OAAA,EAClC,QAAQ,QAAQ,EAChB,YAAY,6CAA6C;AAAA,IAC5D,sBAAsBA,EAAO,MAAM;AAAA,MACjCA,EAAO,MAAM,aAAa,EAAE,YAAY,uBAAuB;AAAA,MAC/DA,EAAO,MAAM,WAAW,EAAE,YAAY,WAAW;AAAA,MACjDA,EAAO,MAAM,YAAY,EAAE,YAAY,YAAY;AAAA,MACnDA,EAAO,MAAM,OAAO,EAAE,YAAY,OAAO;AAAA,MACzCA,EAAO,OAAA,EAA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