@inpageedit/core 0.2.0 → 0.3.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/README.md +55 -55
- package/dist/ActionButton-ByMKIthQ.js +24 -0
- package/dist/ActionButton-ByMKIthQ.js.map +1 -0
- package/dist/{InputBox-B-BAGjgs.js → InputBox-FIzJ-rPN.js} +2 -2
- package/dist/InputBox-FIzJ-rPN.js.map +1 -0
- package/dist/Preferences-Bg3J5Ur9.js.map +1 -1
- package/dist/{RadioBox-CQ9xz5nk.js → RadioBox-BZFhTEo5.js} +2 -2
- package/dist/RadioBox-BZFhTEo5.js.map +1 -0
- package/dist/components/ActionButton.d.ts +6 -9
- package/dist/components/SchemaForm/index.d.ts +142 -0
- package/dist/components/index.d.ts +7 -7
- package/dist/components/index.js +6 -6
- package/dist/components/index.js.map +1 -1
- package/dist/{index-Do5exwYg.js → index-BByzm2Fz.js} +172 -171
- package/dist/index-BByzm2Fz.js.map +1 -0
- package/dist/{index-wYcxrK6G.js → index-BPsDFq9U.js} +2 -2
- package/dist/index-BPsDFq9U.js.map +1 -0
- package/dist/{index-vjK9PEyV.js → index-BsYzf3Yw.js} +2 -2
- package/dist/index-BsYzf3Yw.js.map +1 -0
- package/dist/{index-B02kaEy5.js → index-CMqk2ovP.js} +13 -14
- package/dist/index-CMqk2ovP.js.map +1 -0
- package/dist/{index-CavCnbOz.js → index-Ch5DJDZZ.js} +4 -4
- package/dist/index-Ch5DJDZZ.js.map +1 -0
- package/dist/index-Cq1Q9Xau.js +4635 -0
- package/dist/index-Cq1Q9Xau.js.map +1 -0
- package/dist/{index-C6PwuH_U.js → index-Cq9xxVsu.js} +13 -24
- package/dist/index-Cq9xxVsu.js.map +1 -0
- package/dist/{index-D3QOS3-Q.js → index-CvhkVj_L.js} +81 -68
- package/dist/index-CvhkVj_L.js.map +1 -0
- package/dist/{index-BIFsoDor.js → index-HyxA2rYz.js} +4 -4
- package/dist/index-HyxA2rYz.js.map +1 -0
- package/dist/{index-D1nQg-aN.js → index-X1X416tZ.js} +36 -35
- package/dist/index-X1X416tZ.js.map +1 -0
- package/dist/index.js +2976 -2909
- package/dist/index.js.map +1 -1
- package/dist/plugins/preferences/{PluginPreferencesUI.d.ts → ui/index.d.ts} +3 -2
- package/dist/sleep-DpyIipK-.js.map +1 -1
- package/dist/style.css +1 -1
- package/dist/{plugins/preferences/components/hooks.d.ts → utils/vueHooks.d.ts} +1 -1
- package/lib/index.umd.js +57 -2620
- package/lib/index.umd.js.map +1 -0
- package/lib/style.css +1 -1
- package/package.json +6 -2
- package/dist/ActionButton-DkQu8dfH.js +0 -33
- package/dist/ActionButton-DkQu8dfH.js.map +0 -1
- package/dist/InputBox-B-BAGjgs.js.map +0 -1
- package/dist/PluginPreferencesUI-CHdAGK8T.js +0 -33922
- package/dist/PluginPreferencesUI-CHdAGK8T.js.map +0 -1
- package/dist/RadioBox-CQ9xz5nk.js.map +0 -1
- package/dist/i18n/languages.json +0 -1527
- package/dist/index-B02kaEy5.js.map +0 -1
- package/dist/index-BIFsoDor.js.map +0 -1
- package/dist/index-C6PwuH_U.js.map +0 -1
- package/dist/index-CavCnbOz.js.map +0 -1
- package/dist/index-D1nQg-aN.js.map +0 -1
- package/dist/index-D3QOS3-Q.js.map +0 -1
- package/dist/index-Do5exwYg.js.map +0 -1
- package/dist/index-vjK9PEyV.js.map +0 -1
- package/dist/index-wYcxrK6G.js.map +0 -1
- package/dist/utils/schemaValidator.d.ts +0 -12
- package/lib/i18n/languages.json +0 -1527
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
import { j as a, P as y } from "./index-
|
|
1
|
+
import { j as a, P as y } from "./index-CvhkVj_L.js";
|
|
2
2
|
import { BasePlugin as S, Inject as j } from "./index.js";
|
|
3
|
-
import { T as F } from "./index-
|
|
4
|
-
import { C as v, I as q } from "./InputBox-
|
|
5
|
-
import { A as E } from "./ActionButton-
|
|
6
|
-
var I = Object.create, h = Object.defineProperty, B = Object.getOwnPropertyDescriptor, _ = (t, e) => (e = Symbol[t]) ? e : Symbol.for("Symbol." + t),
|
|
3
|
+
import { T as F } from "./index-BPsDFq9U.js";
|
|
4
|
+
import { C as v, I as q } from "./InputBox-FIzJ-rPN.js";
|
|
5
|
+
import { A as E } from "./ActionButton-ByMKIthQ.js";
|
|
6
|
+
var I = Object.create, h = Object.defineProperty, B = Object.getOwnPropertyDescriptor, _ = (t, e) => (e = Symbol[t]) ? e : Symbol.for("Symbol." + t), k = (t) => {
|
|
7
7
|
throw TypeError(t);
|
|
8
|
-
}, C = (t, e, o) => e in t ? h(t, e, { enumerable: !0, configurable: !0, writable: !0, value: o }) : t[e] = o, T = (t, e) => h(t, "name", { value: e, configurable: !0 }), z = (t) => [, , , I(t?.[_("metadata")] ?? null)], D = ["class", "method", "getter", "setter", "accessor", "field", "value", "get", "set"],
|
|
8
|
+
}, C = (t, e, o) => e in t ? h(t, e, { enumerable: !0, configurable: !0, writable: !0, value: o }) : t[e] = o, T = (t, e) => h(t, "name", { value: e, configurable: !0 }), z = (t) => [, , , I(t?.[_("metadata")] ?? null)], D = ["class", "method", "getter", "setter", "accessor", "field", "value", "get", "set"], b = (t) => t !== void 0 && typeof t != "function" ? k("Function expected") : t, O = (t, e, o, n, r) => ({ kind: D[t], name: e, metadata: n, addInitializer: (i) => o._ ? k("Already initialized") : r.push(b(i || null)) }), Q = (t, e) => C(e, _("metadata"), t[3]), N = (t, e, o, n) => {
|
|
9
9
|
for (var r = 0, i = t[e >> 1], c = i && i.length; r < c; r++) i[r].call(o);
|
|
10
10
|
return n;
|
|
11
11
|
}, A = (t, e, o, n, r, i) => {
|
|
12
|
-
var c, s, g, l = e & 7, f = !1, w = 0,
|
|
12
|
+
var c, s, g, l = e & 7, f = !1, w = 0, P = t[w] || (t[w] = []), d = l && (r = r.prototype, l < 5 && (l > 3 || !f) && B(r, o));
|
|
13
13
|
T(r, o);
|
|
14
14
|
for (var m = n.length - 1; m >= 0; m--)
|
|
15
|
-
g = O(l, o, s = {}, t[3],
|
|
15
|
+
g = O(l, o, s = {}, t[3], P), c = (0, n[m])(r, g), s._ = 1, b(c) && (r = c);
|
|
16
16
|
return Q(t, r), d && h(r, o, d), f ? l ^ 4 ? i : d : r;
|
|
17
|
-
}, M, p,
|
|
17
|
+
}, M, p, x;
|
|
18
18
|
M = [j(["modal", "sitemeta"])];
|
|
19
|
-
class u extends (
|
|
19
|
+
class u extends (x = S) {
|
|
20
20
|
constructor(e) {
|
|
21
21
|
super(e, {}, "quick-move"), this.ctx = e, e.set("quickMove", this.quickMove.bind(this)), e.set("movePage", this.movePage.bind(this));
|
|
22
22
|
}
|
|
@@ -125,18 +125,7 @@ class u extends (P = S) {
|
|
|
125
125
|
/* @__PURE__ */ a("div", { children: /* @__PURE__ */ a(v, { name: "movesubpages", id: "movesubpages", checked: e?.movesubpages, children: "Move subpage(s) (up to 100)" }) }),
|
|
126
126
|
this.ctx.sitemeta.hasRight("suppressredirect") && /* @__PURE__ */ a("div", { children: /* @__PURE__ */ a(v, { name: "noredirect", id: "noredirect", checked: e?.noredirect, children: "Move without leaving a redirect" }) }),
|
|
127
127
|
/* @__PURE__ */ a(q, { label: "Reason", id: "reason", name: "reason", value: e?.reason }),
|
|
128
|
-
/* @__PURE__ */ a("div", { children: /* @__PURE__ */ a(
|
|
129
|
-
E,
|
|
130
|
-
{
|
|
131
|
-
type: "primary",
|
|
132
|
-
buttonProps: {
|
|
133
|
-
style: {
|
|
134
|
-
width: "100%"
|
|
135
|
-
}
|
|
136
|
-
},
|
|
137
|
-
children: "Move"
|
|
138
|
-
}
|
|
139
|
-
) })
|
|
128
|
+
/* @__PURE__ */ a("div", { children: /* @__PURE__ */ a(E, { type: "primary", style: { width: "100%" }, children: "Move" }) })
|
|
140
129
|
]
|
|
141
130
|
}
|
|
142
131
|
)
|
|
@@ -151,10 +140,10 @@ class u extends (P = S) {
|
|
|
151
140
|
return (await this.ctx.wikiPage.newFromTitle(o)).moveTo(n, r, i);
|
|
152
141
|
}
|
|
153
142
|
}
|
|
154
|
-
p = z(
|
|
143
|
+
p = z(x);
|
|
155
144
|
u = A(p, 0, "PluginQuickMove", M, u);
|
|
156
145
|
N(p, 1, u);
|
|
157
146
|
export {
|
|
158
147
|
u as PluginQuickMove
|
|
159
148
|
};
|
|
160
|
-
//# sourceMappingURL=index-
|
|
149
|
+
//# sourceMappingURL=index-Cq9xxVsu.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index-Cq9xxVsu.js","sources":["../src/plugins/quick-move/index.tsx"],"sourcesContent":["import { Inject, InPageEdit } from '@/InPageEdit'\r\n\r\ndeclare module '@/InPageEdit' {\r\n interface InPageEdit {\r\n quickMove: PluginQuickMove['quickMove']\r\n movePage: PluginQuickMove['movePage']\r\n }\r\n}\r\n\r\nexport interface MovePageOptions {\r\n from: string\r\n to: string\r\n reason?: string\r\n movetalk?: boolean\r\n movesubpages?: boolean\r\n noredirect?: boolean\r\n}\r\nexport interface QuickMoveOptions extends Partial<MovePageOptions> {\r\n lockFromField?: boolean\r\n lockToField?: boolean\r\n}\r\n\r\n@Inject(['modal', 'sitemeta'])\r\nexport class PluginQuickMove extends BasePlugin {\r\n constructor(public ctx: InPageEdit) {\r\n super(ctx, {}, 'quick-move')\r\n ctx.set('quickMove', this.quickMove.bind(this))\r\n ctx.set('movePage', this.movePage.bind(this))\r\n }\r\n\r\n protected start(): Promise<void> | void {\r\n this.ctx.inject(['toolbox'], (ctx) => {\r\n this.injectToolbox(ctx)\r\n })\r\n }\r\n\r\n private injectToolbox(ctx: InPageEdit) {\r\n const curPageName = window.mw?.config.get('wgPageName') || ''\r\n const canEdit = window.mw?.config.get('wgIsProbablyEditable')\r\n ctx.toolbox.addButton({\r\n id: 'quick-move',\r\n icon: (\r\n <svg\r\n xmlns=\"http://www.w3.org/2000/svg\"\r\n width=\"24\"\r\n height=\"24\"\r\n viewBox=\"0 0 24 24\"\r\n fill=\"none\"\r\n stroke=\"currentColor\"\r\n stroke-width=\"2\"\r\n stroke-linecap=\"round\"\r\n stroke-linejoin=\"round\"\r\n class=\"icon icon-tabler icons-tabler-outline icon-tabler-forms\"\r\n >\r\n <path stroke=\"none\" d=\"M0 0h24v24H0z\" fill=\"none\" />\r\n <path d=\"M12 3a3 3 0 0 0 -3 3v12a3 3 0 0 0 3 3\" />\r\n <path d=\"M6 3a3 3 0 0 1 3 3v12a3 3 0 0 1 -3 3\" />\r\n <path d=\"M13 7h7a1 1 0 0 1 1 1v8a1 1 0 0 1 -1 1h-7\" />\r\n <path d=\"M5 7h-1a1 1 0 0 0 -1 1v8a1 1 0 0 0 1 1h1\" />\r\n <path d=\"M17 12h.01\" />\r\n <path d=\"M13 12h.01\" />\r\n </svg>\r\n ),\r\n tooltip: 'Quick Move',\r\n group: 'group2',\r\n onClick: () => {\r\n this.quickMove(\r\n canEdit\r\n ? {\r\n lockFromField: true,\r\n from: curPageName,\r\n }\r\n : {}\r\n )\r\n },\r\n })\r\n }\r\n\r\n quickMove(options?: Partial<QuickMoveOptions>) {\r\n const modal = this.ctx.modal\r\n .createObject({\r\n title: 'Quick Move',\r\n content: (<ProgressBar />) as HTMLElement,\r\n className: 'quick-move',\r\n sizeClass: 'medium',\r\n center: true,\r\n })\r\n .init()\r\n\r\n let formRef: HTMLFormElement | null = null\r\n modal.setContent(\r\n (\r\n <form\r\n ref={(el) => (formRef = el)}\r\n style={{\r\n display: 'flex',\r\n flexDirection: 'column',\r\n gap: '1rem',\r\n }}\r\n onSubmit={(e) => {\r\n e.preventDefault()\r\n const formData = new FormData(formRef!)\r\n const options = {\r\n from: formData.get('from') as string,\r\n to: formData.get('to') as string,\r\n reason: (formData.get('reason') as string) || '',\r\n movetalk: formData.get('movetalk') === 'on',\r\n movesubpages: formData.get('movesubpages') === 'on',\r\n noredirect: formData.get('noredirect') === 'on',\r\n }\r\n modal.setLoadingState(true)\r\n this.movePage(options)\r\n .then(() => {\r\n location.reload()\r\n })\r\n .catch((error) => {\r\n modal.setLoadingState(false)\r\n this.ctx.modal.notify('error', {\r\n title: 'Failed to move',\r\n content: error instanceof Error ? error.message : String(error),\r\n })\r\n })\r\n }}\r\n >\r\n <TwinSwapInput\r\n inputs={[\r\n {\r\n label: 'Move from',\r\n name: 'from',\r\n value: options?.from,\r\n },\r\n {\r\n label: 'Move to',\r\n name: 'to',\r\n value: options?.to,\r\n },\r\n ]}\r\n />\r\n <div>\r\n <CheckBox name=\"movetalk\" id=\"movetalk\" checked={options?.movetalk}>\r\n Move talk page\r\n </CheckBox>\r\n </div>\r\n <div>\r\n <CheckBox name=\"movesubpages\" id=\"movesubpages\" checked={options?.movesubpages}>\r\n Move subpage(s) (up to 100)\r\n </CheckBox>\r\n </div>\r\n {this.ctx.sitemeta.hasRight('suppressredirect') && (\r\n <div>\r\n <CheckBox name=\"noredirect\" id=\"noredirect\" checked={options?.noredirect}>\r\n Move without leaving a redirect\r\n </CheckBox>\r\n </div>\r\n )}\r\n <InputBox label=\"Reason\" id=\"reason\" name=\"reason\" value={options?.reason} />\r\n <div>\r\n <ActionButton type=\"primary\" style={{ width: '100%' }}>\r\n Move\r\n </ActionButton>\r\n </div>\r\n </form>\r\n ) as HTMLElement\r\n )\r\n\r\n return modal.show()\r\n }\r\n\r\n async movePage(options: MovePageOptions) {\r\n const { from, to, reason = '', ...rest } = options\r\n\r\n if (!from || !to) {\r\n throw new Error('From and to titles are required.')\r\n }\r\n if (from === to) {\r\n throw new Error('From and to titles cannot be the same.')\r\n }\r\n\r\n const wikiPage = await this.ctx.wikiPage.newFromTitle(from)\r\n return wikiPage.moveTo(to, reason, rest)\r\n }\r\n}\r\n"],"names":["_PluginQuickMove_decorators","_init","_a","Inject","PluginQuickMove","BasePlugin","ctx","curPageName","canEdit","jsxs","jsx","options","modal","ProgressBar","formRef","el","e","formData","error","TwinSwapInput","CheckBox","InputBox","ActionButton","from","to","reason","rest","__decoratorStart","__decorateElement","__runInitializers"],"mappings":";;;;;;;;;;;;;;;;GAAAA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AA0B;AACvC,UAAM,EAAE,MAAAY,GAAM,IAAAC,GAAI,QAAAC,IAAS,IAAI,GAAGC,MAASf;AAE3C,QAAI,CAACY,KAAQ,CAACC;AACZ,YAAM,IAAI,MAAM,kCAAkC;AAEpD,QAAID,MAASC;AACX,YAAM,IAAI,MAAM,wCAAwC;AAI1D,YADiB,MAAM,KAAK,IAAI,SAAS,aAAaD,CAAI,GAC1C,OAAOC,GAAIC,GAAQC,CAAI;AAAA,EACzC;AACF;AA9JOzB,IAAA0B,EAAAzB,CAAA;AAAME,IAANwB,2BADP5B,GACaI,CAAA;AAANyB,EAAA5B,GAAA,GAAMG,CAAA;"}
|
|
@@ -2,25 +2,25 @@ const u = Object.keys;
|
|
|
2
2
|
function L(e) {
|
|
3
3
|
return typeof e == "boolean";
|
|
4
4
|
}
|
|
5
|
-
function
|
|
5
|
+
function T(e) {
|
|
6
6
|
return e && typeof e.nodeType == "number";
|
|
7
7
|
}
|
|
8
|
-
function
|
|
8
|
+
function p(e) {
|
|
9
9
|
return typeof e == "string";
|
|
10
10
|
}
|
|
11
11
|
function y(e) {
|
|
12
12
|
return typeof e == "number";
|
|
13
13
|
}
|
|
14
14
|
function i(e) {
|
|
15
|
-
return typeof e == "object" ? e !== null :
|
|
15
|
+
return typeof e == "object" ? e !== null : a(e);
|
|
16
16
|
}
|
|
17
|
-
function
|
|
17
|
+
function a(e) {
|
|
18
18
|
return typeof e == "function";
|
|
19
19
|
}
|
|
20
|
-
function
|
|
20
|
+
function N(e) {
|
|
21
21
|
return !!(e && e.isComponent);
|
|
22
22
|
}
|
|
23
|
-
function
|
|
23
|
+
function R(e) {
|
|
24
24
|
return i(e) && typeof e.length == "number" && typeof e.nodeType != "number";
|
|
25
25
|
}
|
|
26
26
|
function d(e, t) {
|
|
@@ -28,10 +28,10 @@ function d(e, t) {
|
|
|
28
28
|
for (const n of u(e))
|
|
29
29
|
t(e[n], n);
|
|
30
30
|
}
|
|
31
|
-
function
|
|
31
|
+
function M(e) {
|
|
32
32
|
return i(e) && "current" in e;
|
|
33
33
|
}
|
|
34
|
-
const
|
|
34
|
+
const h = {
|
|
35
35
|
animationIterationCount: 0,
|
|
36
36
|
borderImageOutset: 0,
|
|
37
37
|
borderImageSlice: 0,
|
|
@@ -76,30 +76,30 @@ const g = {
|
|
|
76
76
|
strokeOpacity: 0,
|
|
77
77
|
strokeWidth: 0
|
|
78
78
|
};
|
|
79
|
-
function
|
|
79
|
+
function P(e, t) {
|
|
80
80
|
return e + t.charAt(0).toUpperCase() + t.substring(1);
|
|
81
81
|
}
|
|
82
|
-
const
|
|
83
|
-
u(
|
|
84
|
-
|
|
85
|
-
|
|
82
|
+
const F = ["Webkit", "ms", "Moz", "O"];
|
|
83
|
+
u(h).forEach((e) => {
|
|
84
|
+
F.forEach((t) => {
|
|
85
|
+
h[P(t, e)] = 0;
|
|
86
86
|
});
|
|
87
87
|
});
|
|
88
|
-
const
|
|
88
|
+
const I = Symbol.for("jsx-dom:type");
|
|
89
89
|
var C = /* @__PURE__ */ function(e) {
|
|
90
90
|
return e.ShadowRoot = "ShadowRoot", e;
|
|
91
91
|
}(C || {});
|
|
92
|
-
function
|
|
93
|
-
return e != null && e[
|
|
92
|
+
function O(e) {
|
|
93
|
+
return e != null && e[I] === C.ShadowRoot;
|
|
94
94
|
}
|
|
95
|
-
const
|
|
95
|
+
const k = "http://www.w3.org/2000/svg", G = "http://www.w3.org/1999/xlink", H = "http://www.w3.org/XML/1998/namespace";
|
|
96
96
|
function S(e) {
|
|
97
97
|
return !L(e) && e != null;
|
|
98
98
|
}
|
|
99
|
-
function
|
|
100
|
-
return Array.isArray(e) ? e.map(
|
|
99
|
+
function w(e) {
|
|
100
|
+
return Array.isArray(e) ? e.map(w).filter(Boolean).join(" ") : i(e) ? Symbol.iterator in e ? w(Array.from(e)) : u(e).filter((t) => e[t]).join(" ") : S(e) ? "" + e : "";
|
|
101
101
|
}
|
|
102
|
-
const
|
|
102
|
+
const U = {
|
|
103
103
|
animate: 0,
|
|
104
104
|
circle: 0,
|
|
105
105
|
clipPath: 0,
|
|
@@ -154,12 +154,12 @@ const H = {
|
|
|
154
154
|
tspan: 0,
|
|
155
155
|
use: 0,
|
|
156
156
|
view: 0
|
|
157
|
-
},
|
|
158
|
-
function
|
|
157
|
+
}, j = /^(a(ll|t|u)|base[FP]|c(al|lipPathU|on)|di|ed|ex|filter[RU]|g(lyphR|r)|ke|l(en|im)|ma(rker[HUW]|s)|n|pat|pr|point[^e]|re[^n]|s[puy]|st[^or]|ta|textL|vi|xC|y|z)/;
|
|
158
|
+
function _(e) {
|
|
159
159
|
const t = document.createDocumentFragment();
|
|
160
|
-
return
|
|
160
|
+
return m(e.children, t), t;
|
|
161
161
|
}
|
|
162
|
-
function
|
|
162
|
+
function B(e, t, n) {
|
|
163
163
|
t = {
|
|
164
164
|
...t,
|
|
165
165
|
children: n
|
|
@@ -167,28 +167,28 @@ function _(e, t, n) {
|
|
|
167
167
|
const r = new e(t), s = r.render();
|
|
168
168
|
return "ref" in t && x(t.ref, r), s;
|
|
169
169
|
}
|
|
170
|
-
function
|
|
170
|
+
function A(e, t) {
|
|
171
171
|
let { children: n, ...r } = t;
|
|
172
|
-
!r.namespaceURI &&
|
|
172
|
+
!r.namespaceURI && U[e] === 0 && (r = {
|
|
173
173
|
...r,
|
|
174
|
-
namespaceURI:
|
|
174
|
+
namespaceURI: k
|
|
175
175
|
});
|
|
176
176
|
let s;
|
|
177
|
-
if (
|
|
178
|
-
if (s = r.namespaceURI ? document.createElementNS(r.namespaceURI, e) : document.createElement(e),
|
|
177
|
+
if (p(e)) {
|
|
178
|
+
if (s = r.namespaceURI ? document.createElementNS(r.namespaceURI, e) : document.createElement(e), W(r, s), m(n, s), s instanceof window.HTMLSelectElement && r.value != null)
|
|
179
179
|
if (r.multiple === !0 && Array.isArray(r.value)) {
|
|
180
|
-
const
|
|
180
|
+
const f = r.value.map((o) => String(o));
|
|
181
181
|
s.querySelectorAll("option").forEach(
|
|
182
|
-
(o) => o.selected =
|
|
182
|
+
(o) => o.selected = f.includes(o.value)
|
|
183
183
|
);
|
|
184
184
|
} else
|
|
185
185
|
s.value = r.value;
|
|
186
186
|
x(r.ref, s);
|
|
187
|
-
} else if (
|
|
187
|
+
} else if (a(e))
|
|
188
188
|
i(e.defaultProps) && (r = {
|
|
189
189
|
...e.defaultProps,
|
|
190
190
|
...r
|
|
191
|
-
}), s =
|
|
191
|
+
}), s = N(e) ? B(e, r, n) : e({
|
|
192
192
|
...r,
|
|
193
193
|
children: n
|
|
194
194
|
});
|
|
@@ -196,40 +196,52 @@ function j(e, t) {
|
|
|
196
196
|
throw new TypeError(`Invalid JSX element type: ${e}`);
|
|
197
197
|
return s;
|
|
198
198
|
}
|
|
199
|
+
function V(e, t) {
|
|
200
|
+
for (var n = arguments.length, r = new Array(n > 2 ? n - 2 : 0), s = 2; s < n; s++)
|
|
201
|
+
r[s - 2] = arguments[s];
|
|
202
|
+
return (p(t) || Array.isArray(t)) && (r.unshift(t), t = {}), t = t || {}, t.children != null && !r.length && ({ children: r, ...t } = t), A(
|
|
203
|
+
e,
|
|
204
|
+
{
|
|
205
|
+
...t,
|
|
206
|
+
children: r
|
|
207
|
+
},
|
|
208
|
+
t.key
|
|
209
|
+
);
|
|
210
|
+
}
|
|
199
211
|
function x(e, t) {
|
|
200
|
-
|
|
212
|
+
M(e) ? e.current = t : a(e) && e(t);
|
|
201
213
|
}
|
|
202
|
-
function
|
|
203
|
-
if (
|
|
204
|
-
|
|
205
|
-
else if (
|
|
206
|
-
|
|
214
|
+
function m(e, t) {
|
|
215
|
+
if (R(e))
|
|
216
|
+
D(e, t);
|
|
217
|
+
else if (p(e) || y(e))
|
|
218
|
+
g(document.createTextNode(e), t);
|
|
207
219
|
else if (e === null)
|
|
208
|
-
|
|
209
|
-
else if (
|
|
210
|
-
|
|
211
|
-
else if (
|
|
220
|
+
g(document.createComment(""), t);
|
|
221
|
+
else if (T(e))
|
|
222
|
+
g(e, t);
|
|
223
|
+
else if (O(e)) {
|
|
212
224
|
const n = t.attachShadow(e.attr);
|
|
213
|
-
|
|
225
|
+
m(e.children, n), x(e.ref, n);
|
|
214
226
|
}
|
|
215
227
|
}
|
|
216
|
-
function
|
|
228
|
+
function D(e, t) {
|
|
217
229
|
for (const n of [...e])
|
|
218
|
-
|
|
230
|
+
m(n, t);
|
|
219
231
|
return t;
|
|
220
232
|
}
|
|
221
|
-
function
|
|
233
|
+
function g(e, t) {
|
|
222
234
|
t instanceof window.HTMLTemplateElement ? t.content.appendChild(e) : t.appendChild(e);
|
|
223
235
|
}
|
|
224
236
|
function l(e, t) {
|
|
225
237
|
return e.replace(/[A-Z]/g, (n) => t + n.toLowerCase());
|
|
226
238
|
}
|
|
227
239
|
function E(e, t) {
|
|
228
|
-
t == null || t === !1 || (Array.isArray(t) ? t.forEach((n) => E(e, n)) :
|
|
229
|
-
r.indexOf("-") === 0 ? e.style.setProperty(r, n) : y(n) &&
|
|
240
|
+
t == null || t === !1 || (Array.isArray(t) ? t.forEach((n) => E(e, n)) : p(t) ? e.setAttribute("style", t) : i(t) && d(t, (n, r) => {
|
|
241
|
+
r.indexOf("-") === 0 ? e.style.setProperty(r, n) : y(n) && h[r] !== 0 ? e.style[r] = n + "px" : e.style[r] = n;
|
|
230
242
|
}));
|
|
231
243
|
}
|
|
232
|
-
function
|
|
244
|
+
function z(e, t, n) {
|
|
233
245
|
switch (e) {
|
|
234
246
|
case "xlinkActuate":
|
|
235
247
|
case "xlinkArcrole":
|
|
@@ -238,7 +250,7 @@ function D(e, t, n) {
|
|
|
238
250
|
case "xlinkShow":
|
|
239
251
|
case "xlinkTitle":
|
|
240
252
|
case "xlinkType":
|
|
241
|
-
b(n,
|
|
253
|
+
b(n, G, l(e, ":"), t);
|
|
242
254
|
return;
|
|
243
255
|
case "xmlnsXlink":
|
|
244
256
|
c(n, l(e, ":"), t);
|
|
@@ -246,7 +258,7 @@ function D(e, t, n) {
|
|
|
246
258
|
case "xmlBase":
|
|
247
259
|
case "xmlLang":
|
|
248
260
|
case "xmlSpace":
|
|
249
|
-
b(n,
|
|
261
|
+
b(n, H, l(e, ":"), t);
|
|
250
262
|
return;
|
|
251
263
|
}
|
|
252
264
|
switch (e) {
|
|
@@ -279,7 +291,7 @@ function D(e, t, n) {
|
|
|
279
291
|
return;
|
|
280
292
|
case "class":
|
|
281
293
|
case "className":
|
|
282
|
-
|
|
294
|
+
a(t) ? t(n) : c(n, "class", w(t));
|
|
283
295
|
return;
|
|
284
296
|
case "ref":
|
|
285
297
|
case "namespaceURI":
|
|
@@ -294,7 +306,7 @@ function D(e, t, n) {
|
|
|
294
306
|
});
|
|
295
307
|
return;
|
|
296
308
|
}
|
|
297
|
-
if (
|
|
309
|
+
if (a(t)) {
|
|
298
310
|
if (e[0] === "o" && e[1] === "n") {
|
|
299
311
|
let r = e.toLowerCase();
|
|
300
312
|
const s = r.endsWith("capture");
|
|
@@ -307,11 +319,11 @@ function D(e, t, n) {
|
|
|
307
319
|
!0
|
|
308
320
|
);
|
|
309
321
|
else {
|
|
310
|
-
let
|
|
311
|
-
r in window ?
|
|
322
|
+
let f;
|
|
323
|
+
r in window ? f = r.substring(2) : f = r[2] + e.slice(3), n.addEventListener(f, t);
|
|
312
324
|
}
|
|
313
325
|
}
|
|
314
|
-
} else i(t) ? n[e] = t : t === !0 ? c(n, e, "") : t !== !1 && t != null && (n instanceof SVGElement && !
|
|
326
|
+
} else i(t) ? n[e] = t : t === !0 ? c(n, e, "") : t !== !1 && t != null && (n instanceof SVGElement && !j.test(e) ? c(n, l(e, "-"), t) : c(n, e, t));
|
|
315
327
|
}
|
|
316
328
|
function c(e, t, n) {
|
|
317
329
|
e.setAttribute(t, n);
|
|
@@ -319,18 +331,18 @@ function c(e, t, n) {
|
|
|
319
331
|
function b(e, t, n, r) {
|
|
320
332
|
e.setAttributeNS(t, n, r);
|
|
321
333
|
}
|
|
322
|
-
function
|
|
334
|
+
function W(e, t) {
|
|
323
335
|
for (const n of u(e))
|
|
324
|
-
|
|
336
|
+
z(n, e[n], t);
|
|
325
337
|
return t;
|
|
326
338
|
}
|
|
327
|
-
const
|
|
328
|
-
ipe_progress:
|
|
329
|
-
},
|
|
330
|
-
const t = e.indeterminate ?? !0, n = /* @__PURE__ */
|
|
339
|
+
const X = "_ipe_progress_so6hn_1", $ = {
|
|
340
|
+
ipe_progress: X
|
|
341
|
+
}, q = (e) => {
|
|
342
|
+
const t = e.indeterminate ?? !0, n = /* @__PURE__ */ A(
|
|
331
343
|
"div",
|
|
332
344
|
{
|
|
333
|
-
class: `${
|
|
345
|
+
class: `${$.ipe_progress}`,
|
|
334
346
|
"data-indeterminate": `${t}`,
|
|
335
347
|
style: { width: "100%", "--progress": e.progress ? `${e.progress}%` : "0%" },
|
|
336
348
|
...e
|
|
@@ -341,8 +353,9 @@ const W = "_ipe_progress_so6hn_1", X = {
|
|
|
341
353
|
}, n;
|
|
342
354
|
};
|
|
343
355
|
export {
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
356
|
+
_ as F,
|
|
357
|
+
q as P,
|
|
358
|
+
V as c,
|
|
359
|
+
A as j
|
|
347
360
|
};
|
|
348
|
-
//# sourceMappingURL=index-
|
|
361
|
+
//# sourceMappingURL=index-CvhkVj_L.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index-CvhkVj_L.js","sources":["../../../node_modules/.pnpm/jsx-dom@8.1.6/node_modules/jsx-dom/index.js","../src/components/ProgressBar/index.tsx"],"sourcesContent":["/* eslint-disable */\nconst keys = Object.keys;\nfunction identity(value) {\n return value;\n}\nfunction isBoolean(val) {\n return typeof val === \"boolean\";\n}\nfunction isElement(val) {\n return val && typeof val.nodeType === \"number\";\n}\nfunction isString(val) {\n return typeof val === \"string\";\n}\nfunction isNumber(val) {\n return typeof val === \"number\";\n}\nfunction isObject(val) {\n return typeof val === \"object\" ? val !== null : isFunction(val);\n}\nfunction isFunction(val) {\n return typeof val === \"function\";\n}\nfunction isComponentClass(Component) {\n return !!(Component && Component.isComponent);\n}\nfunction isArrayLike(obj) {\n return (\n isObject(obj) &&\n typeof obj.length === \"number\" &&\n typeof obj.nodeType !== \"number\"\n );\n}\nfunction forEach(value, fn) {\n if (!value) return;\n for (const key of keys(value)) {\n fn(value[key], key);\n }\n}\n\nfunction createRef() {\n return Object.seal({\n current: null,\n });\n}\nfunction isRef(maybeRef) {\n return isObject(maybeRef) && \"current\" in maybeRef;\n}\n\n/**\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found on\n * https://github.com/facebook/react/blob/b87aabdfe1b7461e7331abb3601d9e6bb27544bc/LICENSE\n */\n\n/**\n * CSS properties which accept numbers but are not in units of \"px\".\n */\nconst isUnitlessNumber = {\n animationIterationCount: 0,\n borderImageOutset: 0,\n borderImageSlice: 0,\n borderImageWidth: 0,\n boxFlex: 0,\n boxFlexGroup: 0,\n boxOrdinalGroup: 0,\n columnCount: 0,\n columns: 0,\n flex: 0,\n flexGrow: 0,\n flexPositive: 0,\n flexShrink: 0,\n flexNegative: 0,\n flexOrder: 0,\n gridArea: 0,\n gridRow: 0,\n gridRowEnd: 0,\n gridRowSpan: 0,\n gridRowStart: 0,\n gridColumn: 0,\n gridColumnEnd: 0,\n gridColumnSpan: 0,\n gridColumnStart: 0,\n fontWeight: 0,\n lineClamp: 0,\n lineHeight: 0,\n opacity: 0,\n order: 0,\n orphans: 0,\n tabSize: 0,\n widows: 0,\n zIndex: 0,\n zoom: 0,\n // SVG-related properties\n fillOpacity: 0,\n floodOpacity: 0,\n stopOpacity: 0,\n strokeDasharray: 0,\n strokeDashoffset: 0,\n strokeMiterlimit: 0,\n strokeOpacity: 0,\n strokeWidth: 0,\n};\n\n/**\n * @param prefix vendor-specific prefix, eg: Webkit\n * @param key style name, eg: transitionDuration\n * @return style name prefixed with `prefix`, properly camelCased, eg:\n * WebkitTransitionDuration\n */\nfunction prefixKey(prefix, key) {\n return prefix + key.charAt(0).toUpperCase() + key.substring(1);\n}\n\n/**\n * Support style names that may come passed in prefixed by adding permutations\n * of vendor prefixes.\n */\nconst prefixes = [\"Webkit\", \"ms\", \"Moz\", \"O\"];\n// Using Object.keys here, or else the vanilla for-in loop makes IE8 go into an\n// infinite loop, because it iterates over the newly added props too.\nkeys(isUnitlessNumber).forEach((prop) => {\n prefixes.forEach((prefix) => {\n isUnitlessNumber[prefixKey(prefix, prop)] = 0; // isUnitlessNumber[prop]\n });\n});\n\nconst jsxDomType = Symbol.for(\"jsx-dom:type\");\nvar JsxDomType = /*#__PURE__*/ (function (JsxDomType) {\n JsxDomType[\"ShadowRoot\"] = \"ShadowRoot\";\n return JsxDomType;\n})(JsxDomType || {});\nfunction ShadowRoot(_ref) {\n let { children, ref, ...attr } = _ref;\n return {\n [jsxDomType]: JsxDomType.ShadowRoot,\n ref,\n attr,\n children,\n };\n}\nfunction isShadowRoot(el) {\n return el != null && el[jsxDomType] === JsxDomType.ShadowRoot;\n}\n\nconst SVGNamespace = \"http://www.w3.org/2000/svg\";\nconst XLinkNamespace = \"http://www.w3.org/1999/xlink\";\nconst XMLNamespace = \"http://www.w3.org/XML/1998/namespace\";\n\n// https://facebook.github.io/react/docs/jsx-in-depth.html#booleans-null-and-undefined-are-ignored\n// Emulate JSX Expression logic to ignore certain type of children or className.\nfunction isVisibleChild(value) {\n return !isBoolean(value) && value != null;\n}\n\n/**\n * Convert a `value` to a className string.\n * `value` can be a string, an array or a `Dictionary<boolean>`.\n */\nfunction className(value) {\n if (Array.isArray(value)) {\n return value.map(className).filter(Boolean).join(\" \");\n } else if (isObject(value)) {\n if (Symbol.iterator in value) {\n return className(Array.from(value));\n }\n return keys(value)\n .filter((k) => value[k])\n .join(\" \");\n } else if (isVisibleChild(value)) {\n return \"\" + value;\n } else {\n return \"\";\n }\n}\nconst svg = {\n animate: 0,\n circle: 0,\n clipPath: 0,\n defs: 0,\n desc: 0,\n ellipse: 0,\n feBlend: 0,\n feColorMatrix: 0,\n feComponentTransfer: 0,\n feComposite: 0,\n feConvolveMatrix: 0,\n feDiffuseLighting: 0,\n feDisplacementMap: 0,\n feDistantLight: 0,\n feFlood: 0,\n feFuncA: 0,\n feFuncB: 0,\n feFuncG: 0,\n feFuncR: 0,\n feGaussianBlur: 0,\n feImage: 0,\n feMerge: 0,\n feMergeNode: 0,\n feMorphology: 0,\n feOffset: 0,\n fePointLight: 0,\n feSpecularLighting: 0,\n feSpotLight: 0,\n feTile: 0,\n feTurbulence: 0,\n filter: 0,\n foreignObject: 0,\n g: 0,\n image: 0,\n line: 0,\n linearGradient: 0,\n marker: 0,\n mask: 0,\n metadata: 0,\n path: 0,\n pattern: 0,\n polygon: 0,\n polyline: 0,\n radialGradient: 0,\n rect: 0,\n stop: 0,\n svg: 0,\n switch: 0,\n symbol: 0,\n text: 0,\n textPath: 0,\n tspan: 0,\n use: 0,\n view: 0,\n};\nconst nonPresentationSVGAttributes =\n /^(a(ll|t|u)|base[FP]|c(al|lipPathU|on)|di|ed|ex|filter[RU]|g(lyphR|r)|ke|l(en|im)|ma(rker[HUW]|s)|n|pat|pr|point[^e]|re[^n]|s[puy]|st[^or]|ta|textL|vi|xC|y|z)/;\nfunction createFactory(tag) {\n return createElement.bind(null, tag);\n}\nfunction Fragment(attr) {\n const fragment = document.createDocumentFragment();\n appendChild(attr.children, fragment);\n return fragment;\n}\nclass Component {\n static isComponent = true;\n constructor(props) {\n this.props = props;\n }\n render() {\n return null;\n }\n}\nfunction initComponentClass(Class, attr, children) {\n attr = {\n ...attr,\n children,\n };\n const instance = new Class(attr);\n const node = instance.render();\n if (\"ref\" in attr) {\n attachRef(attr.ref, instance);\n }\n return node;\n}\n\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nfunction jsx(tag, _ref) {\n let { children, ...attr } = _ref;\n if (!attr.namespaceURI && svg[tag] === 0) {\n attr = {\n ...attr,\n namespaceURI: SVGNamespace,\n };\n }\n let node;\n if (isString(tag)) {\n node = attr.namespaceURI\n ? document.createElementNS(attr.namespaceURI, tag)\n : document.createElement(tag);\n attributes(attr, node);\n appendChild(children, node);\n\n // Select `option` elements in `select`\n if (node instanceof window.HTMLSelectElement && attr.value != null) {\n if (attr.multiple === true && Array.isArray(attr.value)) {\n const values = attr.value.map((value) => String(value));\n node\n .querySelectorAll(\"option\")\n .forEach(\n (option) => (option.selected = values.includes(option.value)),\n );\n } else {\n node.value = attr.value;\n }\n }\n attachRef(attr.ref, node);\n } else if (isFunction(tag)) {\n // Custom elements.\n if (isObject(tag.defaultProps)) {\n attr = {\n ...tag.defaultProps,\n ...attr,\n };\n }\n node = isComponentClass(tag)\n ? initComponentClass(tag, attr, children)\n : tag({\n ...attr,\n children,\n });\n } else {\n throw new TypeError(`Invalid JSX element type: ${tag}`);\n }\n return node;\n}\nfunction createElement(tag, attr) {\n for (\n var _len = arguments.length,\n children = new Array(_len > 2 ? _len - 2 : 0),\n _key2 = 2;\n _key2 < _len;\n _key2++\n ) {\n children[_key2 - 2] = arguments[_key2];\n }\n if (isString(attr) || Array.isArray(attr)) {\n children.unshift(attr);\n attr = {};\n }\n attr = attr || {};\n if (attr.children != null && !children.length) {\n ({ children, ...attr } = attr);\n }\n return jsx(\n tag,\n {\n ...attr,\n children,\n },\n attr.key,\n );\n}\nfunction attachRef(ref, node) {\n if (isRef(ref)) {\n ref.current = node;\n } else if (isFunction(ref)) {\n ref(node);\n }\n}\nfunction appendChild(child, node) {\n if (isArrayLike(child)) {\n appendChildren(child, node);\n } else if (isString(child) || isNumber(child)) {\n appendChildToNode(document.createTextNode(child), node);\n } else if (child === null) {\n appendChildToNode(document.createComment(\"\"), node);\n } else if (isElement(child)) {\n appendChildToNode(child, node);\n } else if (isShadowRoot(child)) {\n const shadowRoot = node.attachShadow(child.attr);\n appendChild(child.children, shadowRoot);\n attachRef(child.ref, shadowRoot);\n }\n}\nfunction appendChildren(children, node) {\n for (const child of [...children]) {\n appendChild(child, node);\n }\n return node;\n}\nfunction appendChildToNode(child, node) {\n if (node instanceof window.HTMLTemplateElement) {\n node.content.appendChild(child);\n } else {\n node.appendChild(child);\n }\n}\nfunction normalizeAttribute(s, separator) {\n return s.replace(/[A-Z]/g, (match) => separator + match.toLowerCase());\n}\nfunction style(node, value) {\n if (value == null || value === false);\n else if (Array.isArray(value)) {\n value.forEach((v) => style(node, v));\n } else if (isString(value)) {\n node.setAttribute(\"style\", value);\n } else if (isObject(value)) {\n forEach(value, (val, key) => {\n if (key.indexOf(\"-\") === 0) {\n // CSS custom properties (variables) start with `-` (e.g. `--my-variable`)\n // and must be assigned via `setProperty`.\n node.style.setProperty(key, val);\n } else if (isNumber(val) && isUnitlessNumber[key] !== 0) {\n node.style[key] = val + \"px\";\n } else {\n node.style[key] = val;\n }\n });\n }\n}\nfunction attribute(key, value, node) {\n switch (key) {\n case \"xlinkActuate\":\n case \"xlinkArcrole\":\n case \"xlinkHref\":\n case \"xlinkRole\":\n case \"xlinkShow\":\n case \"xlinkTitle\":\n case \"xlinkType\":\n attrNS(node, XLinkNamespace, normalizeAttribute(key, \":\"), value);\n return;\n case \"xmlnsXlink\":\n attr(node, normalizeAttribute(key, \":\"), value);\n return;\n case \"xmlBase\":\n case \"xmlLang\":\n case \"xmlSpace\":\n attrNS(node, XMLNamespace, normalizeAttribute(key, \":\"), value);\n return;\n }\n switch (key) {\n case \"htmlFor\":\n attr(node, \"for\", value);\n return;\n case \"dataset\":\n forEach(value, (dataValue, dataKey) => {\n if (dataValue != null) {\n node.dataset[dataKey] = dataValue;\n }\n });\n return;\n case \"innerHTML\":\n case \"innerText\":\n case \"textContent\":\n if (isVisibleChild(value)) {\n node[key] = value;\n }\n return;\n case \"dangerouslySetInnerHTML\":\n if (isObject(value)) {\n node.innerHTML = value[\"__html\"];\n }\n return;\n case \"value\":\n if (value == null || node instanceof window.HTMLSelectElement) {\n // skip nullish values\n // for `<select>` apply value after appending `<option>` elements\n return;\n } else if (node instanceof window.HTMLTextAreaElement) {\n node.value = value;\n return;\n }\n // use attribute for other elements\n break;\n case \"spellCheck\":\n node.spellcheck = value;\n return;\n case \"class\":\n case \"className\":\n if (isFunction(value)) {\n value(node);\n } else {\n attr(node, \"class\", className(value));\n }\n return;\n case \"ref\":\n case \"namespaceURI\":\n return;\n case \"style\":\n style(node, value);\n return;\n case \"on\":\n case \"onCapture\":\n forEach(value, (eventHandler, eventName) => {\n node.addEventListener(eventName, eventHandler, key === \"onCapture\");\n });\n return;\n // fallthrough\n }\n if (isFunction(value)) {\n if (key[0] === \"o\" && key[1] === \"n\") {\n let attribute = key.toLowerCase();\n const useCapture = attribute.endsWith(\"capture\");\n if (attribute === \"ondoubleclick\") {\n attribute = \"ondblclick\";\n } else if (useCapture && attribute === \"ondoubleclickcapture\") {\n attribute = \"ondblclickcapture\";\n }\n if (!useCapture && node[attribute] === null) {\n // use property when possible PR #17\n node[attribute] = value;\n } else if (useCapture) {\n node.addEventListener(\n attribute.substring(2, attribute.length - 7),\n value,\n true,\n );\n } else {\n let eventName;\n if (attribute in window) {\n // standard event\n // the JSX attribute could have been \"onMouseOver\" and the\n // member name \"onmouseover\" is on the window's prototype\n // so let's add the listener \"mouseover\", which is all lowercased\n const standardEventName = attribute.substring(2);\n eventName = standardEventName;\n } else {\n // custom event\n // the JSX attribute could have been \"onMyCustomEvent\"\n // so let's trim off the \"on\" prefix and lowercase the first character\n // and add the listener \"myCustomEvent\"\n // except for the first character, we keep the event name case\n const customEventName = attribute[2] + key.slice(3);\n eventName = customEventName;\n }\n node.addEventListener(eventName, value);\n }\n }\n } else if (isObject(value)) {\n node[key] = value;\n } else if (value === true) {\n attr(node, key, \"\");\n } else if (value !== false && value != null) {\n if (node instanceof SVGElement && !nonPresentationSVGAttributes.test(key)) {\n attr(node, normalizeAttribute(key, \"-\"), value);\n } else {\n attr(node, key, value);\n }\n }\n}\nfunction attr(node, key, value) {\n node.setAttribute(key, value);\n}\nfunction attrNS(node, namespace, key, value) {\n node.setAttributeNS(namespace, key, value);\n}\nfunction attributes(attr, node) {\n for (const key of keys(attr)) {\n attribute(key, attr[key], node);\n }\n return node;\n}\n\nfunction useText(initialValue) {\n const text = new Text();\n Object.defineProperty(text, \"toString\", {\n value() {\n return this.textContent;\n },\n });\n function setText(value) {\n text.textContent = value;\n }\n if (initialValue != null) {\n setText(initialValue);\n }\n return [text, setText];\n}\nfunction useClassList(initialValue) {\n const div = document.createElement(\"div\");\n if (initialValue != null) {\n div.className = className(initialValue);\n }\n let list = div.classList;\n function ClassList(value) {\n value.setAttribute(\"class\", list.value);\n list = value.classList;\n }\n Object.defineProperties(\n ClassList,\n Object.getOwnPropertyDescriptors({\n get size() {\n return list.length;\n },\n get value() {\n return list.value;\n },\n add() {\n list.add(...arguments);\n },\n remove() {\n list.remove(...arguments);\n },\n toggle(token, force) {\n list.toggle(token, force);\n },\n contains(token) {\n return list.contains(token);\n },\n }),\n );\n return ClassList;\n}\n\nfunction useMemo(factory) {\n return factory();\n}\nfunction forwardRef(render) {\n return (_ref) => {\n let { ref, ...props } = _ref;\n return render(props, ref ?? createRef());\n };\n}\nfunction useImperativeHandle(ref, init) {\n attachRef(ref, init());\n}\n\nconst cache = /* @__PURE__ */ new Map();\nconst createStyledComponent = (name) =>\n function (list) {\n for (\n var _len = arguments.length,\n interpolations = new Array(_len > 1 ? _len - 1 : 0),\n _key = 1;\n _key < _len;\n _key++\n ) {\n interpolations[_key - 1] = arguments[_key];\n }\n return (_ref) => {\n let { style, ...props } = _ref;\n const lastIndex = list.length - 1;\n const css =\n list.slice(0, lastIndex).reduce((p, s, i) => {\n const interpolation = interpolations[i];\n const current =\n typeof interpolation === \"function\"\n ? interpolation(props)\n : interpolation;\n return p + s + current;\n }, \"\") + list[lastIndex];\n return createElement(name, {\n style: [css, style],\n ...props,\n });\n };\n };\nconst baseStyled = (customComponent) => createStyledComponent(customComponent);\nconst styled = /* @__PURE__ */ new Proxy(baseStyled, {\n get(_, name) {\n return setIfAbsent(cache, name, () => createStyledComponent(name));\n },\n});\nfunction setIfAbsent(map, key, getValue) {\n if (map.has(key)) {\n return map.get(key);\n } else {\n const value = getValue(key);\n map.set(key, value);\n return value;\n }\n}\n\nvar index = {\n Component,\n PureComponent: Component,\n createElement,\n Fragment,\n ShadowRoot,\n};\nfunction preventDefault(event) {\n event.preventDefault();\n return event;\n}\nfunction stopPropagation(event) {\n event.stopPropagation();\n return event;\n}\n\nexport {\n Component,\n Fragment,\n Component as PureComponent,\n SVGNamespace,\n ShadowRoot,\n Fragment as StrictMode,\n className,\n createElement,\n createFactory,\n createRef,\n index as default,\n forwardRef,\n createElement as h,\n isRef,\n jsx,\n jsx as jsxs,\n identity as memo,\n preventDefault,\n stopPropagation,\n styled,\n identity as useCallback,\n useClassList,\n useImperativeHandle,\n useMemo,\n createRef as useRef,\n useText,\n};\n","import { JSX } from 'vue/jsx-runtime'\r\nimport styles from './styles.module.sass'\r\n\r\nexport const ProgressBar = (\r\n attrs: JSX.IntrinsicElements['div'] & { indeterminate?: boolean; progress?: number }\r\n) => {\r\n const indeterminate = attrs.indeterminate ?? true\r\n const bar = (\r\n <div\r\n class={`${styles.ipe_progress}`}\r\n data-indeterminate={`${indeterminate}`}\r\n // @ts-ignore\r\n style={{ width: '100%', '--progress': attrs.progress ? `${attrs.progress}%` : '0%' }}\r\n {...attrs}\r\n ></div>\r\n ) as HTMLElement & { setProgress: (progress: number) => void }\r\n bar.setProgress = (progress: number | undefined) => {\r\n if (typeof progress === 'number') {\r\n bar.dataset.indeterminate = 'false'\r\n bar.style.setProperty('--progress', `${progress}%`)\r\n } else {\r\n bar.dataset.indeterminate = 'true'\r\n bar.style.setProperty('--progress', '0%')\r\n }\r\n }\r\n return bar\r\n}\r\n"],"names":["keys","isBoolean","val","isElement","isString","isNumber","isObject","isFunction","isComponentClass","Component","isArrayLike","obj","forEach","value","fn","key","isRef","maybeRef","isUnitlessNumber","prefixKey","prefix","prefixes","prop","jsxDomType","JsxDomType","isShadowRoot","el","SVGNamespace","XLinkNamespace","XMLNamespace","isVisibleChild","className","k","svg","nonPresentationSVGAttributes","Fragment","attr","fragment","appendChild","initComponentClass","Class","children","instance","node","attachRef","jsx","tag","_ref","attributes","values","option","createElement","_len","_key2","ref","child","appendChildren","appendChildToNode","shadowRoot","normalizeAttribute","s","separator","match","style","v","attribute","attrNS","dataValue","dataKey","eventHandler","eventName","useCapture","namespace","ProgressBar","attrs","indeterminate","bar","styles","progress"],"mappings":"AACA,MAAMA,IAAO,OAAO;AAIpB,SAASC,EAAUC,GAAK;AACtB,SAAO,OAAOA,KAAQ;AACxB;AACA,SAASC,EAAUD,GAAK;AACtB,SAAOA,KAAO,OAAOA,EAAI,YAAa;AACxC;AACA,SAASE,EAASF,GAAK;AACrB,SAAO,OAAOA,KAAQ;AACxB;AACA,SAASG,EAASH,GAAK;AACrB,SAAO,OAAOA,KAAQ;AACxB;AACA,SAASI,EAASJ,GAAK;AACrB,SAAO,OAAOA,KAAQ,WAAWA,MAAQ,OAAOK,EAAWL,CAAG;AAChE;AACA,SAASK,EAAWL,GAAK;AACvB,SAAO,OAAOA,KAAQ;AACxB;AACA,SAASM,EAAiBC,GAAW;AACnC,SAAO,CAAC,EAAEA,KAAaA,EAAU;AACnC;AACA,SAASC,EAAYC,GAAK;AACxB,SACEL,EAASK,CAAG,KACZ,OAAOA,EAAI,UAAW,YACtB,OAAOA,EAAI,YAAa;AAE5B;AACA,SAASC,EAAQC,GAAOC,GAAI;AAC1B,MAAKD;AACL,eAAWE,KAAOf,EAAKa,CAAK;AAC1B,MAAAC,EAAGD,EAAME,CAAG,GAAGA,CAAG;AAEtB;AAOA,SAASC,EAAMC,GAAU;AACvB,SAAOX,EAASW,CAAQ,KAAK,aAAaA;AAC5C;AAYA,MAAMC,IAAmB;AAAA,EACvB,yBAAyB;AAAA,EACzB,mBAAmB;AAAA,EACnB,kBAAkB;AAAA,EAClB,kBAAkB;AAAA,EAClB,SAAS;AAAA,EACT,cAAc;AAAA,EACd,iBAAiB;AAAA,EACjB,aAAa;AAAA,EACb,SAAS;AAAA,EACT,MAAM;AAAA,EACN,UAAU;AAAA,EACV,cAAc;AAAA,EACd,YAAY;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AAK,eAAe6B,GAAWzD,GAAKF,CAAK;AAC3C;AACA,SAASmC,EAAWZ,GAAMO,GAAM;AAC9B,aAAW5B,KAAOf,EAAKoC,CAAI;AACzB,IAAA6B,EAAUlD,GAAKqB,EAAKrB,CAAG,GAAG4B,CAAI;AAEhC,SAAOA;AACT;;;GCzhBa8B,IAAc,CACzBC,MACG;AACH,QAAMC,IAAgBD,EAAM,iBAAiB,IACvCE,IACJ,gBAAA/B;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,OAAO,GAAGgC,EAAO,YAAY;AAAA,MAC7B,sBAAoB,GAAGF,CAAa;AAAA,MAEpC,OAAO,EAAE,OAAO,QAAQ,cAAcD,EAAM,WAAW,GAAGA,EAAM,QAAQ,MAAM,KAAA;AAAA,MAC7E,GAAGA;AAAA,IAAA;AAAA,EAAA;AAGR,SAAAE,EAAI,cAAc,CAACE,MAAiC;AAClD,IAAI,OAAOA,KAAa,YACtBF,EAAI,QAAQ,gBAAgB,SAC5BA,EAAI,MAAM,YAAY,cAAc,GAAGE,CAAQ,GAAG,MAElDF,EAAI,QAAQ,gBAAgB,QAC5BA,EAAI,MAAM,YAAY,cAAc,IAAI;AAAA,EAE5C,GACOA;AACT;","x_google_ignoreList":[0]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { j as l, P as q } from "./index-
|
|
1
|
+
import { j as l, P as q } from "./index-CvhkVj_L.js";
|
|
2
2
|
import { BasePlugin as j, Inject as E } from "./index.js";
|
|
3
3
|
var y = Object.create, _ = Object.defineProperty, O = Object.getOwnPropertyDescriptor, k = (e, t) => (t = Symbol[e]) ? t : Symbol.for("Symbol." + e), m = (e) => {
|
|
4
4
|
throw TypeError(e);
|
|
@@ -40,9 +40,9 @@ class v extends (b = j) {
|
|
|
40
40
|
]);
|
|
41
41
|
}
|
|
42
42
|
async quickPreview(t, r, a) {
|
|
43
|
-
a
|
|
43
|
+
a ||= this.ctx.wikiPage.newBlankPage({
|
|
44
44
|
title: "API"
|
|
45
|
-
})
|
|
45
|
+
});
|
|
46
46
|
const i = this.ctx.modal.createObject({
|
|
47
47
|
className: "in-page-edit ipe-quickPreview",
|
|
48
48
|
sizeClass: "large"
|
|
@@ -84,4 +84,4 @@ N(p, 1, v);
|
|
|
84
84
|
export {
|
|
85
85
|
v as PluginQuickPreview
|
|
86
86
|
};
|
|
87
|
-
//# sourceMappingURL=index-
|
|
87
|
+
//# sourceMappingURL=index-HyxA2rYz.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index-HyxA2rYz.js","sources":["../src/plugins/quick-preview/index.tsx"],"sourcesContent":["import { Inject, InPageEdit } from '@/InPageEdit'\r\nimport { type QuickEditInitPayload } from '@/plugins/quick-edit'\r\nimport { WikiPage } from '@/models/WikiPage'\r\nimport { MwApiParams } from 'wiki-saikou'\r\nimport { PageParseData } from '@/models/WikiPage/types/PageParseData'\r\n\r\ndeclare module '@/InPageEdit' {\r\n interface InPageEdit {\r\n quickPreview: PluginQuickPreview['quickPreview']\r\n }\r\n interface Events {\r\n 'quickPreview/showModal'(payload: {\r\n ctx: InPageEdit\r\n text: string\r\n modal: SsiModal\r\n wikiPage: WikiPage\r\n }): void\r\n 'quickPreview/loaded'(payload: {\r\n ctx: InPageEdit\r\n modal: SsiModal\r\n wikiPage: WikiPage\r\n text: string\r\n parseData: PageParseData\r\n }): void\r\n }\r\n}\r\n\r\n@Inject(['api', 'wikiPage', 'modal'])\r\nexport class PluginQuickPreview extends BasePlugin {\r\n constructor(public ctx: InPageEdit) {\r\n super(ctx, {}, 'quickPreview')\r\n }\r\n\r\n protected start(): Promise<void> | void {\r\n this.ctx.set('quickPreview', this.quickPreview.bind(this))\r\n this.ctx.on('quickEdit/wikiPage', this.injectQuickEdit.bind(this))\r\n }\r\n\r\n protected stop(): Promise<void> | void {\r\n this.ctx.off('quickEdit/wikiPage', this.injectQuickEdit.bind(this))\r\n }\r\n\r\n private injectQuickEdit({ ctx, modal, wikiPage }: QuickEditInitPayload) {\r\n modal.setButtons([\r\n {\r\n label: 'Preview',\r\n side: 'left',\r\n className: 'btn btn-secondary',\r\n method: () => {\r\n this.quickPreview(\r\n (modal.get$content().find('textarea.editArea').val() as string) || '',\r\n undefined,\r\n wikiPage\r\n )\r\n },\r\n },\r\n ])\r\n }\r\n\r\n async quickPreview(text: string, params?: MwApiParams, wikiPage?: WikiPage) {\r\n wikiPage ||= this.ctx.wikiPage.newBlankPage({\r\n title: 'API',\r\n })\r\n\r\n const modal = this.ctx.modal\r\n .createObject({\r\n className: 'in-page-edit ipe-quickPreview',\r\n sizeClass: 'large',\r\n })\r\n .init()\r\n modal.setTitle('Preview loading...')\r\n modal.setContent(\r\n (\r\n <section>\r\n <ProgressBar />\r\n </section>\r\n ) as HTMLElement\r\n )\r\n modal.show()\r\n this.ctx.emit('quickPreview/showModal', {\r\n ctx: this.ctx,\r\n text,\r\n modal,\r\n wikiPage,\r\n })\r\n\r\n const {\r\n data: { parse },\r\n } = await wikiPage.preview(text, params)\r\n modal.setTitle(`Preview - ${parse.title}`)\r\n let outputRef: HTMLElement | null = null\r\n modal.setContent(\r\n (\r\n <section>\r\n <div\r\n ref={(el) => (outputRef = el)}\r\n className=\"mw-parser-output\"\r\n innerHTML={parse.text}\r\n ></div>\r\n </section>\r\n ) as HTMLElement\r\n )\r\n window.mw?.hook('wikipage.content').fire($(outputRef!))\r\n this.ctx.emit('quickPreview/loaded', {\r\n ctx: this.ctx,\r\n modal,\r\n wikiPage,\r\n text,\r\n parseData: parse,\r\n })\r\n }\r\n}\r\n"],"names":["_PluginQuickPreview_decorators","_init","_a","Inject","PluginQuickPreview","BasePlugin","ctx","modal","wikiPage","text","params","jsx","ProgressBar","parse","outputRef","el","__decoratorStart","__decorateElement","__runInitializers"],"mappings":";;;;;;;;;;;;;GAAAA,GAAAC,GAAAC;AA2BAF,IAAA,CAACG,EAAO,CAAC,OAAO,YAAY,OAAO,CAAC,CAAA;AAC7B,MAAMC,WAA2BF,IAAAG,GAAW;AA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