@inpageedit/core 0.12.0 → 0.13.0-alpha.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 +64 -0
- package/dist/BasePlugin-Bf2UuIHF.js.map +1 -0
- package/dist/IconQuickEdit-CMCQncyj.js.map +1 -1
- package/dist/InputBox-nQKtiWtZ.js +30 -0
- package/dist/InputBox-nQKtiWtZ.js.map +1 -0
- package/dist/PluginPrefSync-Dn1Xsiqz.js +341 -0
- package/dist/PluginPrefSync-Dn1Xsiqz.js.map +1 -0
- package/dist/PluginStoreApp-CpOLArL7.js +452 -0
- package/dist/PluginStoreApp-CpOLArL7.js.map +1 -0
- package/dist/Preferences-DS4-CFWe.js.map +1 -1
- package/dist/WatchlistAction-BbNAyryN.js +5 -0
- package/dist/WatchlistAction-BbNAyryN.js.map +1 -0
- package/dist/components/index.js +6 -7
- package/dist/components/index.js.map +1 -1
- package/dist/endpoints-DgyuoRZd.js +1507 -0
- package/dist/endpoints-DgyuoRZd.js.map +1 -0
- package/dist/{index-B5DtUqkK.js → index-2RfILgXm.js} +11 -11
- package/dist/{index-B5DtUqkK.js.map → index-2RfILgXm.js.map} +1 -1
- package/dist/{index-hSl8LzNb.js → index-BCdABp0e.js} +24 -24
- package/dist/index-BCdABp0e.js.map +1 -0
- package/dist/{index-Ckozkp6W.js → index-BJ7_Q1mB.js} +8 -7
- package/dist/{index-Ckozkp6W.js.map → index-BJ7_Q1mB.js.map} +1 -1
- package/dist/{index-CJFePavo.js → index-BNh95-x2.js} +37 -49
- package/dist/index-BNh95-x2.js.map +1 -0
- package/dist/{index-CYc6LH26.js → index-BQ-cHWkJ.js} +15 -16
- package/dist/{index-CYc6LH26.js.map → index-BQ-cHWkJ.js.map} +1 -1
- package/dist/index-BwdWyHLe.js +362 -0
- package/dist/index-BwdWyHLe.js.map +1 -0
- package/dist/{index-D4uwfUZL.js → index-CCRMmnwk.js} +10 -9
- package/dist/index-CCRMmnwk.js.map +1 -0
- package/dist/index-CG38LlAh.js.map +1 -1
- package/dist/index-CM_6yF2v.js.map +1 -1
- package/dist/{index-CZXxH2-9.js → index-CnIpUF9x.js} +4 -4
- package/dist/{index-CZXxH2-9.js.map → index-CnIpUF9x.js.map} +1 -1
- package/dist/{index-CPoUaSMw.js → index-CyG7_IYz.js} +14 -13
- package/dist/index-CyG7_IYz.js.map +1 -0
- package/dist/index-DD5CVCfD.js.map +1 -1
- package/dist/index-DdTiZqwt.js +3744 -0
- package/dist/index-DdTiZqwt.js.map +1 -0
- package/dist/{index-Bv7Dw5eO.js → index-eSlbrNqF.js} +6 -6
- package/dist/{index-Bv7Dw5eO.js.map → index-eSlbrNqF.js.map} +1 -1
- package/dist/index.d.ts +1723 -31
- package/dist/index.js +73 -9
- package/dist/index.js.map +1 -1
- package/dist/makeCallable-LDU0xZMJ.js.map +1 -1
- package/dist/models/index.js +486 -0
- package/dist/models/index.js.map +1 -0
- package/dist/noop-ClDc6zv4.js.map +1 -1
- package/dist/plugins/index.js +23 -0
- package/dist/plugins/index.js.map +1 -0
- package/dist/services/index.js +16 -0
- package/dist/services/index.js.map +1 -0
- package/dist/style.css +1 -1
- package/dist/{vueHooks-D0uVqbO-.js → vueHooks-l04s8cIl.js} +1112 -1080
- package/dist/{vueHooks-D0uVqbO-.js.map → vueHooks-l04s8cIl.js.map} +1 -1
- package/lib/index.umd.js +15 -11
- package/lib/index.umd.js.map +1 -1
- package/lib/style.css +1 -1
- package/package.json +22 -25
- package/dist/CheckBox-Bc79KBEB.js +0 -13
- package/dist/CheckBox-Bc79KBEB.js.map +0 -1
- package/dist/InPageEdit.d.ts +0 -42
- package/dist/InputBox-DZAdyZ4B.js +0 -22
- package/dist/InputBox-DZAdyZ4B.js.map +0 -1
- package/dist/PluginPrefSync-BPQkNtX8.js +0 -292
- package/dist/PluginPrefSync-BPQkNtX8.js.map +0 -1
- package/dist/PluginStoreApp-Cxspe6t8.js +0 -158
- package/dist/PluginStoreApp-Cxspe6t8.js.map +0 -1
- package/dist/__test__/utils/constants.d.ts +0 -3
- package/dist/components/ActionButton.d.ts +0 -6
- package/dist/components/CheckBox.d.ts +0 -10
- package/dist/components/Icon/IconEdit.d.ts +0 -2
- package/dist/components/Icon/IconQuickEdit.d.ts +0 -2
- package/dist/components/InputBox.d.ts +0 -11
- package/dist/components/MBox/index.d.ts +0 -14
- package/dist/components/MwUserLinks.d.ts +0 -6
- package/dist/components/ProgressBar/index.d.ts +0 -7
- package/dist/components/RadioBox.d.ts +0 -10
- package/dist/components/TabView/index.d.ts +0 -19
- package/dist/components/TwinSwapInput/index.d.ts +0 -19
- package/dist/components/index.d.ts +0 -8
- package/dist/components/utils.d.ts +0 -4
- package/dist/constants/endpoints.d.ts +0 -8
- package/dist/decorators/Preferences.d.ts +0 -35
- package/dist/index-BXaiDKnr.js +0 -5828
- package/dist/index-BXaiDKnr.js.map +0 -1
- package/dist/index-CB7TltEb.js +0 -297
- package/dist/index-CB7TltEb.js.map +0 -1
- package/dist/index-CJFePavo.js.map +0 -1
- package/dist/index-CPoUaSMw.js.map +0 -1
- package/dist/index-D4uwfUZL.js.map +0 -1
- package/dist/index-DEav9Ptt.js +0 -365
- package/dist/index-DEav9Ptt.js.map +0 -1
- package/dist/index-hSl8LzNb.js.map +0 -1
- package/dist/models/MemoryStorage.d.ts +0 -10
- package/dist/models/WikiPage/index.d.ts +0 -72
- package/dist/models/WikiPage/types/PageInfo.d.ts +0 -58
- package/dist/models/WikiPage/types/PageParseData.d.ts +0 -17
- package/dist/models/WikiPage/types/WatchlistAction.d.ts +0 -6
- package/dist/models/WikiTitle/index.d.ts +0 -89
- package/dist/models/WikiTitle/index.spec.d.ts +0 -1
- package/dist/plugins/BasePlugin.d.ts +0 -25
- package/dist/plugins/_debug/index.d.ts +0 -8
- package/dist/plugins/analytics/index.d.ts +0 -41
- package/dist/plugins/in-article-links/index.d.ts +0 -44
- package/dist/plugins/plugin-store/index.d.ts +0 -59
- package/dist/plugins/plugin-store/schema.d.ts +0 -41
- package/dist/plugins/preferences-ui/PluginPrefSync.d.ts +0 -28
- package/dist/plugins/preferences-ui/index.d.ts +0 -48
- package/dist/plugins/quick-delete/index.d.ts +0 -55
- package/dist/plugins/quick-diff/components/DiffTable.d.ts +0 -23
- package/dist/plugins/quick-diff/index.d.ts +0 -85
- package/dist/plugins/quick-edit/index.d.ts +0 -79
- package/dist/plugins/quick-move/index.d.ts +0 -47
- package/dist/plugins/quick-preview/index.d.ts +0 -37
- package/dist/plugins/quick-redirect/index.d.ts +0 -48
- package/dist/plugins/toolbox/index.d.ts +0 -65
- package/dist/polyfills/Promise.withResolvers.d.ts +0 -5
- package/dist/polyfills/index.d.ts +0 -0
- package/dist/services/ApiService.d.ts +0 -14
- package/dist/services/CurrentPageService.d.ts +0 -28
- package/dist/services/ModalService.d.ts +0 -27
- package/dist/services/PreferencesService.d.ts +0 -94
- package/dist/services/ResourceLoaderService.d.ts +0 -17
- package/dist/services/WikiMetadataService.d.ts +0 -108
- package/dist/services/WikiPageService.d.ts +0 -20
- package/dist/services/WikiTitleService.d.ts +0 -70
- package/dist/services/storage/index.d.ts +0 -40
- package/dist/services/storage/managers/IDBStorageManager.d.ts +0 -28
- package/dist/services/storage/managers/LocalStorageManager.d.ts +0 -27
- package/dist/types/WikiMetadata.d.ts +0 -131
- package/dist/utils/computeable.d.ts +0 -2
- package/dist/utils/defineAsyncPlugin.d.ts +0 -2
- package/dist/utils/interpolate.d.ts +0 -20
- package/dist/utils/interpolate.spec.d.ts +0 -1
- package/dist/utils/makeCallable.d.ts +0 -3
- package/dist/utils/noop.d.ts +0 -1
- package/dist/utils/sleep.d.ts +0 -1
- package/dist/utils/string.d.ts +0 -7
- package/dist/utils/url.d.ts +0 -24
- package/dist/utils/vueHooks.d.ts +0 -6
- package/dist/utils/vueReactivity.d.ts +0 -2
|
@@ -0,0 +1,452 @@
|
|
|
1
|
+
import { a as D, l as P, e as d, h as g, y as w, C as X, k as O, r as R, f as j, q as r, D as S, E as z, G, H as T, I as E, z as y, F as q, x as Y, v as L, g as Z } from "./vueHooks-l04s8cIl.js";
|
|
2
|
+
import { c as N } from "./index-CM_6yF2v.js";
|
|
3
|
+
import { E as ee } from "./endpoints-DgyuoRZd.js";
|
|
4
|
+
import { _ as H } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
5
|
+
const V = /* @__PURE__ */ D({
|
|
6
|
+
__name: "UIBaseButton",
|
|
7
|
+
props: {
|
|
8
|
+
variant: { default: "neutral" },
|
|
9
|
+
active: { type: Boolean, default: !1 }
|
|
10
|
+
},
|
|
11
|
+
setup(I) {
|
|
12
|
+
const t = I, c = P(() => ({
|
|
13
|
+
"is-active": t.active,
|
|
14
|
+
"is-danger": t.variant === "danger",
|
|
15
|
+
"is-primary": t.variant === "primary",
|
|
16
|
+
"is-ghost": t.variant === "ghost",
|
|
17
|
+
"is-accent": t.variant === "accent"
|
|
18
|
+
}));
|
|
19
|
+
return (v, m) => (g(), d("button", {
|
|
20
|
+
class: w(["ipeps-button", c.value])
|
|
21
|
+
}, [
|
|
22
|
+
X(v.$slots, "default")
|
|
23
|
+
], 2));
|
|
24
|
+
}
|
|
25
|
+
}), se = { id: "ipe-registry-manager" }, te = { class: "ipeps-header" }, ie = { class: "ipeps-input-wrapper" }, re = ["disabled"], ne = {
|
|
26
|
+
key: 0,
|
|
27
|
+
class: "ipeps-list"
|
|
28
|
+
}, ae = { class: "registry-info" }, oe = { class: "item-name" }, le = { class: "item-desc" }, ce = { class: "homepage" }, de = ["href"], ge = { class: "url" }, ue = { class: "item-meta" }, ye = { class: "ipeps-actions" }, pe = {
|
|
29
|
+
key: 1,
|
|
30
|
+
class: "ipeps-empty"
|
|
31
|
+
}, ve = { class: "description" }, fe = /* @__PURE__ */ D({
|
|
32
|
+
__name: "RegistryManager",
|
|
33
|
+
setup(I) {
|
|
34
|
+
const t = O(), c = R([]), v = R(""), m = R(!1), h = (o) => {
|
|
35
|
+
try {
|
|
36
|
+
return new URL(o).hostname;
|
|
37
|
+
} catch {
|
|
38
|
+
return o;
|
|
39
|
+
}
|
|
40
|
+
};
|
|
41
|
+
async function _() {
|
|
42
|
+
const o = await t.preferences.get("pluginStore.registries") || [], n = await Promise.allSettled(
|
|
43
|
+
o.map(async (i) => {
|
|
44
|
+
const u = await t.store.getRegistryInfo(i);
|
|
45
|
+
return {
|
|
46
|
+
registryUrl: i,
|
|
47
|
+
label: h(i),
|
|
48
|
+
...u
|
|
49
|
+
};
|
|
50
|
+
})
|
|
51
|
+
);
|
|
52
|
+
c.value = n.filter((i) => i.status === "fulfilled").map((i) => i.value);
|
|
53
|
+
}
|
|
54
|
+
async function x() {
|
|
55
|
+
const o = v.value.trim();
|
|
56
|
+
if (o) {
|
|
57
|
+
if (c.value.some((n) => n.registryUrl === o)) {
|
|
58
|
+
t.modal.notify("info", { content: "Registry already exists." });
|
|
59
|
+
return;
|
|
60
|
+
}
|
|
61
|
+
m.value = !0;
|
|
62
|
+
try {
|
|
63
|
+
const n = await t.store.getRegistryInfo(o, "online_manifest", !0);
|
|
64
|
+
if (!n)
|
|
65
|
+
throw new Error("Invalid registry or unreachable");
|
|
66
|
+
const i = await t.preferences.get("pluginStore.registries") || [];
|
|
67
|
+
i.push(o), await t.preferences.set("pluginStore.registries", i), c.value.push({
|
|
68
|
+
registryUrl: o,
|
|
69
|
+
label: h(o),
|
|
70
|
+
...n
|
|
71
|
+
}), v.value = "", t.modal.notify("success", { content: "Registry added." });
|
|
72
|
+
} catch (n) {
|
|
73
|
+
t.modal.notify("error", {
|
|
74
|
+
content: n instanceof Error ? n.message : String(n)
|
|
75
|
+
});
|
|
76
|
+
} finally {
|
|
77
|
+
m.value = !1;
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
async function f(o) {
|
|
82
|
+
const i = (await t.preferences.get("pluginStore.registries") || []).filter((u) => u !== o);
|
|
83
|
+
await t.preferences.set("pluginStore.registries", i), c.value = c.value.filter((u) => u.registryUrl !== o);
|
|
84
|
+
}
|
|
85
|
+
async function A(o) {
|
|
86
|
+
const i = (await t.preferences.get("pluginStore.plugins") || []).filter((u) => u.registry === o);
|
|
87
|
+
if (i.length === 0) {
|
|
88
|
+
t.modal.confirm(
|
|
89
|
+
{
|
|
90
|
+
title: "Remove registry",
|
|
91
|
+
content: `Remove registry:
|
|
92
|
+
${o}`,
|
|
93
|
+
cancelBtn: {
|
|
94
|
+
label: "Cancel",
|
|
95
|
+
className: "is-ghost"
|
|
96
|
+
},
|
|
97
|
+
okBtn: {
|
|
98
|
+
label: "Remove",
|
|
99
|
+
className: "is-danger"
|
|
100
|
+
}
|
|
101
|
+
},
|
|
102
|
+
async (u) => {
|
|
103
|
+
u && (await f(o), t.modal.notify("success", { content: "Registry removed." }));
|
|
104
|
+
}
|
|
105
|
+
);
|
|
106
|
+
return;
|
|
107
|
+
}
|
|
108
|
+
t.modal.dialog(
|
|
109
|
+
{
|
|
110
|
+
title: "Remove registry",
|
|
111
|
+
// content: `There ${installedOfReg.length === 1 ? 'is' : 'are'} ${installedOfReg.length} installed plugin${installedOfReg.length === 1 ? '' : 's'} from this registry:\n${installedOfReg.map((p) => p.id).join('\n')}`,
|
|
112
|
+
content: N("div", { class: "theme-ipe-prose" }, [
|
|
113
|
+
N(
|
|
114
|
+
"p",
|
|
115
|
+
{},
|
|
116
|
+
`There ${i.length === 1 ? "is" : "are"} ${i.length} installed plugin${i.length === 1 ? "" : "s"} from this registry:`
|
|
117
|
+
),
|
|
118
|
+
N(
|
|
119
|
+
"ul",
|
|
120
|
+
{},
|
|
121
|
+
i.map((u) => N("li", {}, u.id))
|
|
122
|
+
)
|
|
123
|
+
]),
|
|
124
|
+
buttons: [
|
|
125
|
+
{
|
|
126
|
+
label: "Remove only",
|
|
127
|
+
className: "is-danger is-ghost",
|
|
128
|
+
method: async (u, C) => {
|
|
129
|
+
await f(o), t.modal.notify("success", { content: "Registry removed." }), C.close();
|
|
130
|
+
}
|
|
131
|
+
},
|
|
132
|
+
{
|
|
133
|
+
label: "Remove and uninstall plugins",
|
|
134
|
+
className: "is-danger",
|
|
135
|
+
method: async (u, C) => {
|
|
136
|
+
await f(o);
|
|
137
|
+
for (const $ of i)
|
|
138
|
+
try {
|
|
139
|
+
await t.store.uninstallAndRemovePreference($.registry, $.id);
|
|
140
|
+
} catch (M) {
|
|
141
|
+
t.modal.notify("error", {
|
|
142
|
+
content: M instanceof Error ? `Failed to uninstall ${$.id}: ${M.message}` : `Failed to uninstall ${$.id}`
|
|
143
|
+
});
|
|
144
|
+
}
|
|
145
|
+
t.modal.notify("success", {
|
|
146
|
+
content: `Registry removed and ${i.length} ${i.length === 1 ? "plugin" : "plugins"} uninstalled.`
|
|
147
|
+
}), C.close();
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
]
|
|
151
|
+
},
|
|
152
|
+
() => {
|
|
153
|
+
}
|
|
154
|
+
);
|
|
155
|
+
}
|
|
156
|
+
function U(o) {
|
|
157
|
+
const n = o.changes["pluginStore.registries"];
|
|
158
|
+
Array.isArray(n) && _();
|
|
159
|
+
}
|
|
160
|
+
function B() {
|
|
161
|
+
const o = ee.PLUGIN_REGISTRY_URL;
|
|
162
|
+
v.value = o, x();
|
|
163
|
+
}
|
|
164
|
+
return j(() => {
|
|
165
|
+
_(), t.on("preferences/changed", U);
|
|
166
|
+
}), (o, n) => (g(), d("div", se, [
|
|
167
|
+
r("div", te, [
|
|
168
|
+
n[2] || (n[2] = r("div", { class: "ipeps-header-title" }, "Registries", -1)),
|
|
169
|
+
r("div", ie, [
|
|
170
|
+
z(r("input", {
|
|
171
|
+
class: "ipeps-input with-icon",
|
|
172
|
+
"onUpdate:modelValue": n[0] || (n[0] = (i) => v.value = i),
|
|
173
|
+
type: "url",
|
|
174
|
+
placeholder: "Add registry URL (https://...)",
|
|
175
|
+
disabled: m.value
|
|
176
|
+
}, null, 8, re), [
|
|
177
|
+
[
|
|
178
|
+
G,
|
|
179
|
+
v.value,
|
|
180
|
+
void 0,
|
|
181
|
+
{ trim: !0 }
|
|
182
|
+
]
|
|
183
|
+
]),
|
|
184
|
+
n[1] || (n[1] = r("div", { class: "ipeps-input-icon" }, "📦", -1))
|
|
185
|
+
]),
|
|
186
|
+
S(V, {
|
|
187
|
+
onClick: x,
|
|
188
|
+
disabled: m.value || !v.value,
|
|
189
|
+
variant: "primary"
|
|
190
|
+
}, {
|
|
191
|
+
default: T(() => [
|
|
192
|
+
E(y(m.value ? "Adding..." : "Add"), 1)
|
|
193
|
+
]),
|
|
194
|
+
_: 1
|
|
195
|
+
}, 8, ["disabled"])
|
|
196
|
+
]),
|
|
197
|
+
c.value.length ? (g(), d("div", ne, [
|
|
198
|
+
(g(!0), d(q, null, Y(c.value, (i) => (g(), d("div", {
|
|
199
|
+
class: "ipeps-item",
|
|
200
|
+
key: i.registryUrl
|
|
201
|
+
}, [
|
|
202
|
+
r("div", ae, [
|
|
203
|
+
r("div", oe, y(i.label), 1),
|
|
204
|
+
r("div", le, [
|
|
205
|
+
r("div", ce, [
|
|
206
|
+
i.homepage ? (g(), d("a", {
|
|
207
|
+
key: 0,
|
|
208
|
+
href: i.homepage,
|
|
209
|
+
target: "_blank"
|
|
210
|
+
}, y(i.homepage), 9, de)) : L("", !0)
|
|
211
|
+
]),
|
|
212
|
+
r("div", ge, y(i.registryUrl), 1)
|
|
213
|
+
]),
|
|
214
|
+
r("div", ue, y(i.packages.length) + " packages", 1)
|
|
215
|
+
]),
|
|
216
|
+
r("div", ye, [
|
|
217
|
+
S(V, {
|
|
218
|
+
onClick: (u) => A(i.registryUrl),
|
|
219
|
+
variant: "danger"
|
|
220
|
+
}, {
|
|
221
|
+
default: T(() => [...n[3] || (n[3] = [
|
|
222
|
+
E("Remove", -1)
|
|
223
|
+
])]),
|
|
224
|
+
_: 1
|
|
225
|
+
}, 8, ["onClick"])
|
|
226
|
+
])
|
|
227
|
+
]))), 128))
|
|
228
|
+
])) : (g(), d("div", pe, [
|
|
229
|
+
n[5] || (n[5] = r("div", { class: "icon" }, "🗂️", -1)),
|
|
230
|
+
n[6] || (n[6] = r("div", { class: "text" }, "No registries configured", -1)),
|
|
231
|
+
r("div", ve, [
|
|
232
|
+
S(V, {
|
|
233
|
+
onClick: B,
|
|
234
|
+
variant: "primary",
|
|
235
|
+
style: { padding: "0.25rem 0.5rem" }
|
|
236
|
+
}, {
|
|
237
|
+
default: T(() => [...n[4] || (n[4] = [
|
|
238
|
+
E("setup default registry", -1)
|
|
239
|
+
])]),
|
|
240
|
+
_: 1
|
|
241
|
+
})
|
|
242
|
+
])
|
|
243
|
+
]))
|
|
244
|
+
]));
|
|
245
|
+
}
|
|
246
|
+
}), me = /* @__PURE__ */ H(fe, [["__scopeId", "data-v-132e6dc8"]]), he = { id: "ipe-plugin-install-manager" }, _e = { class: "ipeps-header" }, ke = { class: "ipeps-input-wrapper" }, Re = ["disabled"], be = ["disabled"], we = {
|
|
247
|
+
key: 0,
|
|
248
|
+
class: "ipeps-loading"
|
|
249
|
+
}, $e = {
|
|
250
|
+
key: 1,
|
|
251
|
+
class: "ipeps-list"
|
|
252
|
+
}, Se = { class: "plugin-info" }, Ue = { class: "plugin-header" }, Ce = { class: "item-name" }, Pe = { class: "ipeps-tags" }, Le = ["href", "title"], Ie = ["title"], xe = { class: "plugin-meta" }, Ae = {
|
|
253
|
+
key: 0,
|
|
254
|
+
class: "version"
|
|
255
|
+
}, Be = {
|
|
256
|
+
key: 1,
|
|
257
|
+
class: "author"
|
|
258
|
+
}, Me = {
|
|
259
|
+
key: 2,
|
|
260
|
+
class: "license"
|
|
261
|
+
}, Ne = {
|
|
262
|
+
key: 2,
|
|
263
|
+
class: "ipeps-empty"
|
|
264
|
+
}, Te = /* @__PURE__ */ D({
|
|
265
|
+
__name: "PluginInstallManager",
|
|
266
|
+
setup(I) {
|
|
267
|
+
const t = O(), c = R([]), v = R([]), m = R(""), h = R(!1), _ = (s, a) => `${s}
|
|
268
|
+
${a}`, x = P(
|
|
269
|
+
() => new Set(v.value.map((s) => _(s.registry, s.id)))
|
|
270
|
+
), f = (s) => x.value.has(s), A = (s) => {
|
|
271
|
+
try {
|
|
272
|
+
return new URL(s).hostname;
|
|
273
|
+
} catch {
|
|
274
|
+
return s;
|
|
275
|
+
}
|
|
276
|
+
}, U = R(!1), B = P(() => c.value.length > 0), o = P(() => {
|
|
277
|
+
const s = m.value.trim().toLowerCase(), a = c.value.flatMap(
|
|
278
|
+
(l) => (l.packages || []).map((p) => ({
|
|
279
|
+
...p,
|
|
280
|
+
_key: _(l.registryUrl, p.id),
|
|
281
|
+
registry: l.registryUrl,
|
|
282
|
+
registryHomepage: l.homepage,
|
|
283
|
+
registryLabel: A(l.registryUrl),
|
|
284
|
+
isBroken: !1,
|
|
285
|
+
isRegistryMissing: !1
|
|
286
|
+
}))
|
|
287
|
+
), e = new Set(a.map((l) => l._key)), k = new Set(c.value.map((l) => l.registryUrl)), b = v.value.filter((l) => !e.has(_(l.registry, l.id))).map((l) => {
|
|
288
|
+
const p = c.value.find((W) => W.registryUrl === l.registry);
|
|
289
|
+
return {
|
|
290
|
+
id: l.id,
|
|
291
|
+
name: void 0,
|
|
292
|
+
description: void 0,
|
|
293
|
+
version: void 0,
|
|
294
|
+
author: void 0,
|
|
295
|
+
license: void 0,
|
|
296
|
+
_key: _(l.registry, l.id),
|
|
297
|
+
registry: l.registry,
|
|
298
|
+
registryHomepage: p?.homepage,
|
|
299
|
+
registryLabel: A(l.registry),
|
|
300
|
+
isBroken: !0,
|
|
301
|
+
isRegistryMissing: !k.has(l.registry)
|
|
302
|
+
};
|
|
303
|
+
}), F = (l) => s ? l.filter(
|
|
304
|
+
(p) => p.name && p.name.toLowerCase().includes(s) || p.id && p.id.toLowerCase().includes(s) || p.description && p.description.toLowerCase().includes(s) || p.author && p.author.toLowerCase().includes(s) || p.registry && p.registry.toLowerCase().includes(s)
|
|
305
|
+
) : l;
|
|
306
|
+
return [...F(b), ...F(a)];
|
|
307
|
+
}), n = P(() => o.value), i = (s) => s.description ? s.description : s.isBroken ? s.isRegistryMissing ? "[Recommend to uninstall] The registry is unavailable. Try refreshing or re-adding the registry to fix this issue." : "[Recommend to uninstall] This plugin was removed from the registry. Try refreshing the registry to confirm." : "", u = async (s, a) => {
|
|
308
|
+
t.store.installAndSetPreference(s, a);
|
|
309
|
+
}, C = async (s, a) => {
|
|
310
|
+
t.store.uninstallAndRemovePreference(s, a);
|
|
311
|
+
}, $ = (s, a) => f(_(s, a)) ? C(s, a) : u(s, a), M = (s) => $(s.registry, s.id), J = async () => {
|
|
312
|
+
if (h.value) return;
|
|
313
|
+
if (c.value.length === 0) {
|
|
314
|
+
t.modal.notify("info", {
|
|
315
|
+
content: "No registry configured. Please add a registry first."
|
|
316
|
+
});
|
|
317
|
+
return;
|
|
318
|
+
}
|
|
319
|
+
h.value = !0;
|
|
320
|
+
const s = await t.store.refreshAllRegistryCaches(), a = Object.entries(s).filter(([k, b]) => b !== null);
|
|
321
|
+
c.value = a.map(([k, b]) => ({
|
|
322
|
+
...b,
|
|
323
|
+
registryUrl: k
|
|
324
|
+
}));
|
|
325
|
+
const e = Object.entries(s).filter(([k, b]) => b === null).map(([k]) => k);
|
|
326
|
+
h.value = !1, a.length === 0 ? t.modal.notify("error", {
|
|
327
|
+
content: "All registries failed to refresh"
|
|
328
|
+
}) : (t.modal.notify("success", {
|
|
329
|
+
content: `${a.length} ${a.length === 1 ? "registry" : "registries"} refreshed successfully.`
|
|
330
|
+
}), e.length > 0 && t.modal.notify("warning", {
|
|
331
|
+
content: `${e.length} ${e.length === 1 ? "registry" : "registries"} failed to refresh:
|
|
332
|
+
${e.join(`
|
|
333
|
+
`)}`
|
|
334
|
+
}));
|
|
335
|
+
}, K = async () => {
|
|
336
|
+
U.value = !1;
|
|
337
|
+
const s = await t.store.ctx.preferences.get("pluginStore.registries") || [], a = await Promise.allSettled(
|
|
338
|
+
s.map(async (e) => ({
|
|
339
|
+
...await t.store.getRegistryInfo(e),
|
|
340
|
+
registryUrl: e
|
|
341
|
+
}))
|
|
342
|
+
);
|
|
343
|
+
c.value = a.filter((e) => e.status === "fulfilled").map((e) => e.value), v.value = await t.preferences.get("pluginStore.plugins") || [], U.value = !0;
|
|
344
|
+
};
|
|
345
|
+
function Q(s) {
|
|
346
|
+
const a = s.changes["pluginStore.registries"], e = s.changes["pluginStore.plugins"];
|
|
347
|
+
Array.isArray(e) && (v.value = e), Array.isArray(a) && K();
|
|
348
|
+
}
|
|
349
|
+
return j(() => {
|
|
350
|
+
K(), t.on("preferences/changed", Q);
|
|
351
|
+
}), Z(() => {
|
|
352
|
+
}), (s, a) => (g(), d("div", he, [
|
|
353
|
+
r("div", _e, [
|
|
354
|
+
a[2] || (a[2] = r("div", { class: "ipeps-header-title" }, "Plugins", -1)),
|
|
355
|
+
r("div", ke, [
|
|
356
|
+
z(r("input", {
|
|
357
|
+
class: "ipeps-input with-icon",
|
|
358
|
+
"onUpdate:modelValue": a[0] || (a[0] = (e) => m.value = e),
|
|
359
|
+
type: "text",
|
|
360
|
+
placeholder: "Search plugins...",
|
|
361
|
+
disabled: !n.value.length
|
|
362
|
+
}, null, 8, Re), [
|
|
363
|
+
[
|
|
364
|
+
G,
|
|
365
|
+
m.value,
|
|
366
|
+
void 0,
|
|
367
|
+
{ trim: !0 }
|
|
368
|
+
]
|
|
369
|
+
]),
|
|
370
|
+
a[1] || (a[1] = r("div", { class: "ipeps-input-icon" }, "🔍", -1))
|
|
371
|
+
]),
|
|
372
|
+
r("button", {
|
|
373
|
+
class: w(["ipeps-button", { refreshing: h.value }]),
|
|
374
|
+
onClick: J,
|
|
375
|
+
disabled: h.value || !B.value,
|
|
376
|
+
variant: "primary"
|
|
377
|
+
}, y(h.value ? "Refreshing..." : "Refresh"), 11, be)
|
|
378
|
+
]),
|
|
379
|
+
!B.value && !U.value ? (g(), d("div", we, [...a[3] || (a[3] = [
|
|
380
|
+
r("div", { class: "loading-spinner" }, null, -1),
|
|
381
|
+
r("div", { class: "loading-text" }, "Loading...", -1)
|
|
382
|
+
])])) : n.value.length ? (g(), d("div", $e, [
|
|
383
|
+
(g(!0), d(q, null, Y(n.value, (e) => (g(), d("div", {
|
|
384
|
+
class: w(["ipeps-item", { installed: f(e._key), broken: e.isBroken }]),
|
|
385
|
+
key: e._key
|
|
386
|
+
}, [
|
|
387
|
+
r("div", Se, [
|
|
388
|
+
r("div", Ue, [
|
|
389
|
+
r("div", Ce, y(e.name || e.id), 1),
|
|
390
|
+
f(e._key) || e.isBroken ? (g(), d("span", {
|
|
391
|
+
key: 0,
|
|
392
|
+
class: w(["ipeps-badge", { "is-installed": f(e._key), "is-broken": e.isBroken }])
|
|
393
|
+
}, y(e.isBroken ? "⚠️ broken" : "✓"), 3)) : L("", !0)
|
|
394
|
+
]),
|
|
395
|
+
r("div", Pe, [
|
|
396
|
+
e.registryHomepage && !e.isRegistryMissing ? (g(), d("a", {
|
|
397
|
+
key: 0,
|
|
398
|
+
class: "ipeps-tag registry-tag",
|
|
399
|
+
href: e.registryHomepage,
|
|
400
|
+
target: "_blank",
|
|
401
|
+
title: e.registryLabel
|
|
402
|
+
}, y(e.registryLabel), 9, Le)) : (g(), d("span", {
|
|
403
|
+
key: 1,
|
|
404
|
+
class: w(["ipeps-tag registry-tag", { broken: e.isRegistryMissing }]),
|
|
405
|
+
title: e.registryLabel
|
|
406
|
+
}, y(e.registryLabel), 11, Ie)),
|
|
407
|
+
r("div", {
|
|
408
|
+
class: w(["plugin-id ipeps-tag", { broken: e.isBroken && !e.isRegistryMissing }])
|
|
409
|
+
}, y(e.id), 3)
|
|
410
|
+
]),
|
|
411
|
+
r("div", {
|
|
412
|
+
class: w(["plugin-desc", { "broken-desc": e.isBroken }])
|
|
413
|
+
}, y(i(e)), 3),
|
|
414
|
+
r("div", xe, [
|
|
415
|
+
e.version ? (g(), d("span", Ae, "v" + y(e.version), 1)) : L("", !0),
|
|
416
|
+
e.author ? (g(), d("span", Be, "👤 " + y(e.author), 1)) : L("", !0),
|
|
417
|
+
e.license ? (g(), d("span", Me, "📜 " + y(e.license), 1)) : L("", !0)
|
|
418
|
+
])
|
|
419
|
+
]),
|
|
420
|
+
S(V, {
|
|
421
|
+
active: f(e._key),
|
|
422
|
+
variant: f(e._key) ? "danger" : "primary",
|
|
423
|
+
onClick: (k) => M(e)
|
|
424
|
+
}, {
|
|
425
|
+
default: T(() => [
|
|
426
|
+
E(y(f(e._key) ? "Remove" : "Install"), 1)
|
|
427
|
+
]),
|
|
428
|
+
_: 2
|
|
429
|
+
}, 1032, ["active", "variant", "onClick"])
|
|
430
|
+
], 2))), 128))
|
|
431
|
+
])) : (g(), d("div", Ne, [...a[4] || (a[4] = [
|
|
432
|
+
r("div", { class: "plugin-empty-icon" }, "📦", -1),
|
|
433
|
+
r("div", { class: "plugin-empty-text" }, "No matching plugins found", -1)
|
|
434
|
+
])]))
|
|
435
|
+
]));
|
|
436
|
+
}
|
|
437
|
+
}), Ee = /* @__PURE__ */ H(Te, [["__scopeId", "data-v-d61d6310"]]), Ve = { id: "ipe-plugin-store-app" }, De = /* @__PURE__ */ D({
|
|
438
|
+
__name: "PluginStoreApp",
|
|
439
|
+
setup(I) {
|
|
440
|
+
return (t, c) => (g(), d("div", Ve, [
|
|
441
|
+
S(Ee),
|
|
442
|
+
c[0] || (c[0] = r("div", { class: "divider-wrapper" }, [
|
|
443
|
+
r("hr", { class: "divider" })
|
|
444
|
+
], -1)),
|
|
445
|
+
S(me)
|
|
446
|
+
]));
|
|
447
|
+
}
|
|
448
|
+
}), je = /* @__PURE__ */ H(De, [["__scopeId", "data-v-1b3d0d80"]]);
|
|
449
|
+
export {
|
|
450
|
+
je as default
|
|
451
|
+
};
|
|
452
|
+
//# sourceMappingURL=PluginStoreApp-CpOLArL7.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PluginStoreApp-CpOLArL7.js","sources":["../src/plugins/plugin-store/components/ui/UIBaseButton.vue","../src/plugins/plugin-store/components/RegistryManager.vue","../src/plugins/plugin-store/components/PluginInstallManager.vue"],"sourcesContent":["<template lang=\"pug\">\nbutton.ipeps-button(:class='buttonClass')\n slot\n</template>\n\n<script setup lang=\"ts\" vapor>\nimport { computed } from 'vue'\n\nconst props = withDefaults(\n defineProps<{\n variant?: 'neutral' | 'primary' | 'danger' | 'ghost' | 'accent'\n active?: boolean\n }>(),\n {\n variant: 'neutral',\n active: false,\n }\n)\n\nconst buttonClass = computed(() => ({\n 'is-active': props.active,\n 'is-danger': props.variant === 'danger',\n 'is-primary': props.variant === 'primary',\n 'is-ghost': props.variant === 'ghost',\n 'is-accent': props.variant === 'accent',\n}))\n</script>\n","<template lang=\"pug\">\n#ipe-registry-manager\n .ipeps-header\n .ipeps-header-title Registries\n .ipeps-input-wrapper\n input.ipeps-input.with-icon(\n v-model.trim='inputValue',\n type='url',\n placeholder='Add registry URL (https://...)',\n :disabled='isAdding'\n )\n .ipeps-input-icon 📦\n UIBaseButton(@click='onAddRegistry', :disabled='isAdding || !inputValue', variant='primary') {{ isAdding ? 'Adding...' : 'Add' }}\n\n .ipeps-list(v-if='registries.length')\n .ipeps-item(v-for='reg in registries', :key='reg.registryUrl')\n .registry-info\n .item-name {{ reg.label }}\n .item-desc\n .homepage: a(v-if='reg.homepage', :href='reg.homepage', target='_blank') {{ reg.homepage }}\n .url {{ reg.registryUrl }}\n .item-meta {{ reg.packages.length }} packages\n .ipeps-actions\n UIBaseButton(@click='onRemoveRegistry(reg.registryUrl)', variant='danger') Remove\n .ipeps-empty(v-else)\n .icon 🗂️\n .text No registries configured\n .description\n UIBaseButton(\n @click='onAddOfficialRegistry',\n variant='primary',\n style='padding: 0.25rem 0.5rem'\n ) setup default registry\n</template>\n\n<script setup lang=\"ts\" vapor>\nimport { onMounted, ref } from 'vue'\nimport { h as $ } from 'jsx-dom'\nimport type { PluginStoreRegistry } from '../schema.js'\nimport UIBaseButton from './ui/UIBaseButton.vue'\n\nconst ctx = useIPE()\n\ninterface RegistryViewModel extends PluginStoreRegistry {\n registryUrl: string\n label: string\n}\n\nconst registries = ref<RegistryViewModel[]>([])\nconst inputValue = ref('')\nconst isAdding = ref(false)\n\nconst urlToLabel = (u: string) => {\n try {\n return new URL(u).hostname\n } catch {\n return u\n }\n}\n\nasync function loadRegistries() {\n const urls = (await ctx.preferences.get<string[]>('pluginStore.registries')) || []\n const results = await Promise.allSettled(\n urls.map(async (url) => {\n const info = await ctx.store.getRegistryInfo(url)\n return {\n registryUrl: url,\n label: urlToLabel(url),\n ...info,\n } as RegistryViewModel\n })\n )\n registries.value = results\n .filter((r) => r.status === 'fulfilled')\n .map((r) => (r as PromiseFulfilledResult<RegistryViewModel>).value)\n}\n\nasync function onAddRegistry() {\n const url = inputValue.value.trim()\n if (!url) return\n if (registries.value.some((r) => r.registryUrl === url)) {\n ctx.modal.notify('info', { content: 'Registry already exists.' })\n return\n }\n isAdding.value = true\n try {\n // try load immediately\n const info = await ctx.store.getRegistryInfo(url, 'online_manifest', true)\n if (!info) {\n throw new Error('Invalid registry or unreachable')\n }\n const current = (await ctx.preferences.get<string[]>('pluginStore.registries')) || []\n current.push(url)\n await ctx.preferences.set('pluginStore.registries', current)\n registries.value.push({\n registryUrl: url,\n label: urlToLabel(url),\n ...info,\n })\n inputValue.value = ''\n ctx.modal.notify('success', { content: 'Registry added.' })\n } catch (e) {\n ctx.modal.notify('error', {\n content: e instanceof Error ? e.message : String(e),\n })\n } finally {\n isAdding.value = false\n }\n}\n\nasync function removeRegistryUrl(url: string) {\n const current = (await ctx.preferences.get<string[]>('pluginStore.registries')) || []\n const next = current.filter((u) => u !== url)\n await ctx.preferences.set('pluginStore.registries', next)\n registries.value = registries.value.filter((r) => r.registryUrl !== url)\n}\n\nasync function onRemoveRegistry(url: string) {\n const installed =\n (await ctx.preferences.get<{ registry: string; id: string }[]>('pluginStore.plugins')) || []\n const installedOfReg = installed.filter((p) => p.registry === url)\n if (installedOfReg.length === 0) {\n ctx.modal.confirm(\n {\n title: 'Remove registry',\n content: `Remove registry:\\n${url}`,\n cancelBtn: {\n label: 'Cancel',\n className: 'is-ghost',\n },\n okBtn: {\n label: 'Remove',\n className: 'is-danger',\n },\n },\n async (ok) => {\n if (!ok) return\n await removeRegistryUrl(url)\n ctx.modal.notify('success', { content: 'Registry removed.' })\n }\n )\n return\n }\n\n ctx.modal.dialog(\n {\n title: 'Remove registry',\n // content: `There ${installedOfReg.length === 1 ? 'is' : 'are'} ${installedOfReg.length} installed plugin${installedOfReg.length === 1 ? '' : 's'} from this registry:\\n${installedOfReg.map((p) => p.id).join('\\n')}`,\n content: $('div', { class: 'theme-ipe-prose' }, [\n $(\n 'p',\n {},\n `There ${installedOfReg.length === 1 ? 'is' : 'are'} ${installedOfReg.length} installed plugin${installedOfReg.length === 1 ? '' : 's'} from this registry:`\n ),\n $(\n 'ul',\n {},\n installedOfReg.map((p) => $('li', {}, p.id))\n ),\n ]),\n buttons: [\n {\n label: 'Remove only',\n className: 'is-danger is-ghost',\n method: async (_, m) => {\n await removeRegistryUrl(url)\n ctx.modal.notify('success', { content: 'Registry removed.' })\n m.close()\n },\n },\n {\n label: 'Remove and uninstall plugins',\n className: 'is-danger',\n method: async (_, m) => {\n await removeRegistryUrl(url)\n for (const p of installedOfReg) {\n try {\n await ctx.store.uninstallAndRemovePreference(p.registry, p.id)\n } catch (e) {\n // best-effort; notify but continue\n ctx.modal.notify('error', {\n content:\n e instanceof Error\n ? `Failed to uninstall ${p.id}: ${e.message}`\n : `Failed to uninstall ${p.id}`,\n })\n }\n }\n ctx.modal.notify('success', {\n content: `Registry removed and ${installedOfReg.length} ${installedOfReg.length === 1 ? 'plugin' : 'plugins'} uninstalled.`,\n })\n m.close()\n },\n },\n ],\n },\n () => {}\n )\n}\n\nfunction onPreferencesChanged(payload: { changes: Record<string, unknown> }) {\n const regs = payload.changes['pluginStore.registries'] as string[]\n if (Array.isArray(regs)) {\n loadRegistries()\n }\n}\n\nfunction onAddOfficialRegistry() {\n const url = Endpoints.PLUGIN_REGISTRY_URL\n inputValue.value = url\n onAddRegistry()\n}\n\nonMounted(() => {\n loadRegistries()\n ctx.on('preferences/changed', onPreferencesChanged)\n})\n</script>\n\n<style scoped lang=\"scss\">\n@use './style.scss' as *;\n\n.registry-info {\n flex: 1;\n min-width: 0;\n .homepage {\n margin-top: 0.25rem;\n a {\n color: var(--ipe-modal-accent);\n text-decoration: none;\n font-size: 0.8125rem;\n transition: all 0.2s ease;\n &:hover {\n color: color-mix(in srgb, var(--ipe-modal-accent) 80%, var(--ipe-modal-text));\n text-decoration: underline;\n }\n }\n }\n .url {\n font-family: monospace;\n font-size: 0.75rem;\n color: var(--ipe-modal-muted);\n margin-top: 0.125rem;\n word-break: break-all;\n }\n}\n</style>\n","<template lang=\"pug\">\n#ipe-plugin-install-manager\n .ipeps-header\n .ipeps-header-title Plugins\n .ipeps-input-wrapper\n input.ipeps-input.with-icon(\n v-model.trim='searchInput',\n type='text',\n placeholder='Search plugins...',\n :disabled='!allPluginsToDisplay.length'\n )\n .ipeps-input-icon 🔍\n button.ipeps-button(\n @click='refreshRegistries',\n :disabled='isRefreshing || !hasRegistries',\n :class='{ refreshing: isRefreshing }',\n variant='primary'\n ) {{ isRefreshing ? 'Refreshing...' : 'Refresh' }}\n\n .ipeps-loading(v-if='!hasRegistries && !firstInit')\n .loading-spinner\n .loading-text Loading...\n\n .ipeps-list(v-else-if='allPluginsToDisplay.length')\n .ipeps-item(\n v-for='plugin in allPluginsToDisplay',\n :key='plugin._key',\n :class='{ installed: isInstalledKey(plugin._key), broken: plugin.isBroken }'\n )\n .plugin-info\n .plugin-header\n .item-name {{ plugin.name || plugin.id }}\n span.ipeps-badge(\n v-if='isInstalledKey(plugin._key) || plugin.isBroken',\n :class='{ \"is-installed\": isInstalledKey(plugin._key), \"is-broken\": plugin.isBroken }'\n ) {{ plugin.isBroken ? '⚠️ broken' : '✓' }}\n .ipeps-tags\n a.ipeps-tag.registry-tag(\n v-if='plugin.registryHomepage && !plugin.isRegistryMissing',\n :href='plugin.registryHomepage',\n target='_blank',\n :title='plugin.registryLabel'\n ) {{ plugin.registryLabel }}\n span.ipeps-tag.registry-tag(\n v-else,\n :title='plugin.registryLabel',\n :class='{ broken: plugin.isRegistryMissing }'\n ) {{ plugin.registryLabel }}\n .plugin-id.ipeps-tag(:class='{ broken: plugin.isBroken && !plugin.isRegistryMissing }') {{ plugin.id }}\n .plugin-desc(:class='{ \"broken-desc\": plugin.isBroken }') {{ getDesc(plugin) }}\n .plugin-meta\n span.version(v-if='plugin.version') v{{ plugin.version }}\n span.author(v-if='plugin.author') 👤 {{ plugin.author }}\n span.license(v-if='plugin.license') 📜 {{ plugin.license }}\n UIBaseButton(\n :active='isInstalledKey(plugin._key)',\n :variant='isInstalledKey(plugin._key) ? \"danger\" : \"primary\"',\n @click='togglePluginByKey(plugin)'\n ) {{ isInstalledKey(plugin._key) ? 'Remove' : 'Install' }}\n\n .ipeps-empty(v-else)\n .plugin-empty-icon 📦\n .plugin-empty-text No matching plugins found\n</template>\n\n<script setup lang=\"ts\" vapor>\nimport { computed, onBeforeUnmount, onMounted, ref } from 'vue'\nimport type { PluginStoreRegistry } from '../schema.js'\nimport UIBaseButton from './ui/UIBaseButton.vue'\n\ninterface RegistryWithUrl extends PluginStoreRegistry {\n registryUrl: string\n}\ninterface PluginIdentifier {\n registry: string\n id: string\n}\n\n// --- state ---\nconst ctx = useIPE()\nconst registryInfos = ref<RegistryWithUrl[]>([])\nconst installedPlugins = ref<PluginIdentifier[]>([])\nconst searchInput = ref('')\nconst isRefreshing = ref(false)\n\n// helpers\nconst makeKey = (r: string, id: string) => `${r}\\n${id}` // stable + O(1)\n\nconst installedKeySet = computed(\n () => new Set(installedPlugins.value.map((p) => makeKey(p.registry, p.id)))\n)\nconst isInstalledKey = (key: string) => installedKeySet.value.has(key)\n\nconst urlToLabel = (registryUrl: string) => {\n try {\n return new URL(registryUrl).hostname\n } catch {\n return registryUrl\n }\n}\n\nconst firstInit = ref(false)\nconst hasRegistries = computed(() => registryInfos.value.length > 0)\n\n// merge normal + broken, and normalize once here\nconst normalizedPlugins = computed(() => {\n const q = searchInput.value.trim().toLowerCase()\n\n const all: Array<any> = registryInfos.value.flatMap((reg) =>\n (reg.packages || []).map((pkg) => ({\n ...pkg,\n _key: makeKey(reg.registryUrl, pkg.id),\n registry: reg.registryUrl,\n registryHomepage: reg.homepage,\n registryLabel: urlToLabel(reg.registryUrl),\n isBroken: false,\n isRegistryMissing: false,\n }))\n )\n\n // broken installed plugins (installed but not available now)\n const availableKeys = new Set(all.map((p) => p._key))\n const availableRegs = new Set(registryInfos.value.map((r) => r.registryUrl))\n\n const broken = installedPlugins.value\n .filter((p) => !availableKeys.has(makeKey(p.registry, p.id)))\n .map((p) => {\n const regInfo = registryInfos.value.find((r) => r.registryUrl === p.registry)\n return {\n id: p.id,\n name: undefined,\n description: undefined,\n version: undefined,\n author: undefined,\n license: undefined,\n _key: makeKey(p.registry, p.id),\n registry: p.registry,\n registryHomepage: regInfo?.homepage,\n registryLabel: urlToLabel(p.registry),\n isBroken: true,\n isRegistryMissing: !availableRegs.has(p.registry),\n }\n })\n\n const filtered = (list: any[]) => {\n if (!q) return list\n return list.filter(\n (p) =>\n (p.name && p.name.toLowerCase().includes(q)) ||\n (p.id && p.id.toLowerCase().includes(q)) ||\n (p.description && p.description.toLowerCase().includes(q)) ||\n (p.author && p.author.toLowerCase().includes(q)) ||\n (p.registry && p.registry.toLowerCase().includes(q))\n )\n }\n\n // broken on top\n return [...filtered(broken), ...filtered(all)]\n})\n\nconst allPluginsToDisplay = computed(() => normalizedPlugins.value)\n\nconst getDesc = (p: any) => {\n if (p.description) return p.description\n if (!p.isBroken) return ''\n return p.isRegistryMissing\n ? '[Recommend to uninstall] The registry is unavailable. Try refreshing or re-adding the registry to fix this issue.'\n : '[Recommend to uninstall] This plugin was removed from the registry. Try refreshing the registry to confirm.'\n}\n\n// actions\nconst enablePlugin = async (registry: string, id: string) => {\n ctx.store.installAndSetPreference(registry, id)\n}\nconst disablePlugin = async (registry: string, id: string) => {\n ctx.store.uninstallAndRemovePreference(registry, id)\n}\nconst togglePlugin = (registry: string, id: string) =>\n isInstalledKey(makeKey(registry, id)) ? disablePlugin(registry, id) : enablePlugin(registry, id)\nconst togglePluginByKey = (p: any) => togglePlugin(p.registry, p.id)\n\nconst refreshRegistries = async () => {\n if (isRefreshing.value) return\n if (registryInfos.value.length === 0) {\n ctx.modal.notify('info', {\n content: 'No registry configured. Please add a registry first.',\n })\n return\n }\n\n isRefreshing.value = true\n const results = await ctx.store.refreshAllRegistryCaches()\n const okResults = Object.entries(results).filter(([_, r]) => r !== null)\n registryInfos.value = okResults.map(([url, r]) => ({\n ...r!,\n registryUrl: url,\n }))\n const failedUrls = Object.entries(results)\n .filter(([_, r]) => r === null)\n .map(([url]) => url)\n isRefreshing.value = false\n\n if (okResults.length === 0) {\n ctx.modal.notify('error', {\n content: 'All registries failed to refresh',\n })\n } else {\n ctx.modal.notify('success', {\n content: `${okResults.length} ${okResults.length === 1 ? 'registry' : 'registries'} refreshed successfully.`,\n })\n if (failedUrls.length > 0) {\n ctx.modal.notify('warning', {\n content: `${failedUrls.length} ${failedUrls.length === 1 ? 'registry' : 'registries'} failed to refresh:\\n${failedUrls.join('\\n')}`,\n })\n }\n }\n}\n\n// init\nconst init = async () => {\n firstInit.value = false\n const urls = (await ctx.store.ctx.preferences.get('pluginStore.registries')) || []\n const regResults = await Promise.allSettled(\n urls.map(async (url: string) => ({\n ...(await ctx.store.getRegistryInfo(url)),\n registryUrl: url,\n }))\n )\n registryInfos.value = regResults\n .filter((r) => r.status === 'fulfilled')\n .map((r) => (r as PromiseFulfilledResult<RegistryWithUrl>).value)\n\n installedPlugins.value = (await ctx.preferences.get('pluginStore.plugins')) || []\n\n firstInit.value = true\n}\n\nfunction onPreferencesChanged(payload: { changes: Record<string, unknown> }) {\n const regs = payload.changes['pluginStore.registries'] as string[]\n const plugins = payload.changes['pluginStore.plugins'] as PluginIdentifier[]\n if (Array.isArray(plugins)) installedPlugins.value = plugins\n if (Array.isArray(regs)) {\n init()\n }\n}\n\nonMounted(() => {\n init()\n ctx.on('preferences/changed', onPreferencesChanged)\n})\nonBeforeUnmount(() => {})\n</script>\n\n<style scoped lang=\"scss\">\n@use './style.scss' as *;\n\n.plugin-info {\n flex: 1;\n min-width: 0;\n}\n.plugin-header {\n display: flex;\n align-items: center;\n gap: 0.5rem;\n margin-bottom: 0.375rem;\n}\n.registry-tag {\n color: var(--ipe-modal-accent);\n background: color-mix(in srgb, var(--ipe-modal-accent) 8%, transparent);\n border: 1px solid color-mix(in srgb, var(--ipe-modal-accent) 18%, transparent);\n text-decoration: none;\n transition: all 0.2s ease;\n &:hover {\n background: color-mix(in srgb, var(--ipe-modal-accent) 12%, transparent);\n border-color: color-mix(in srgb, var(--ipe-modal-accent) 30%, transparent);\n }\n &.broken {\n text-decoration: line-through;\n opacity: 0.65;\n cursor: not-allowed;\n }\n}\n.plugin-id {\n &.broken {\n opacity: 0.65;\n text-decoration: line-through;\n }\n}\n.plugin-desc {\n font-size: 0.8125rem;\n color: var(--ipe-modal-muted);\n margin-bottom: 0.5rem;\n line-height: 1.6;\n &.broken-desc {\n color: color-mix(in srgb, var(--ipe-modal-warning) 80%, var(--ipe-modal-text));\n font-style: italic;\n }\n}\n.plugin-meta {\n font-size: 0.75rem;\n color: var(--ipe-modal-muted);\n display: flex;\n gap: 1rem;\n align-items: center;\n .version {\n font-family: monospace;\n font-weight: 500;\n color: color-mix(in srgb, var(--ipe-modal-text) 80%, var(--ipe-modal-muted));\n }\n .author {\n display: flex;\n align-items: center;\n gap: 0.25rem;\n }\n .license {\n display: flex;\n align-items: center;\n gap: 0.25rem;\n }\n}\n</style>\n"],"names":["props","__props","buttonClass","computed","ctx","useIPE","registries","ref","inputValue","isAdding","urlToLabel","u","loadRegistries","urls","results","url","info","r","onAddRegistry","current","e","removeRegistryUrl","next","onRemoveRegistry","installedOfReg","p","ok","$","_","m","onPreferencesChanged","payload","regs","onAddOfficialRegistry","Endpoints","onMounted","registryInfos","installedPlugins","searchInput","isRefreshing","makeKey","id","installedKeySet","isInstalledKey","key","registryUrl","firstInit","hasRegistries","normalizedPlugins","q","all","reg","pkg","availableKeys","availableRegs","broken","regInfo","filtered","list","allPluginsToDisplay","getDesc","enablePlugin","registry","disablePlugin","togglePlugin","togglePluginByKey","refreshRegistries","okResults","failedUrls","init","regResults","plugins","onBeforeUnmount"],"mappings":";;;;;;;;;;;AAQA,UAAMA,IAAQC,GAWRC,IAAcC,EAAS,OAAO;AAAA,MAClC,aAAaH,EAAM;AAAA,MACnB,aAAaA,EAAM,YAAY;AAAA,MAC/B,cAAcA,EAAM,YAAY;AAAA,MAChC,YAAYA,EAAM,YAAY;AAAA,MAC9B,aAAaA,EAAM,YAAY;AAAA,IAAA,EAC/B;;;;;;;;;;;;;;;;ACgBF,UAAMI,IAAMC,EAAA,GAONC,IAAaC,EAAyB,EAAE,GACxCC,IAAaD,EAAI,EAAE,GACnBE,IAAWF,EAAI,EAAK,GAEpBG,IAAa,CAACC,MAAc;AAChC,UAAI;AACF,eAAO,IAAI,IAAIA,CAAC,EAAE;AAAA,MACpB,QAAQ;AACN,eAAOA;AAAA,MACT;AAAA,IACF;AAEA,mBAAeC,IAAiB;AAC9B,YAAMC,IAAQ,MAAMT,EAAI,YAAY,IAAc,wBAAwB,KAAM,CAAA,GAC1EU,IAAU,MAAM,QAAQ;AAAA,QAC5BD,EAAK,IAAI,OAAOE,MAAQ;AACtB,gBAAMC,IAAO,MAAMZ,EAAI,MAAM,gBAAgBW,CAAG;AAChD,iBAAO;AAAA,YACL,aAAaA;AAAA,YACb,OAAOL,EAAWK,CAAG;AAAA,YACrB,GAAGC;AAAA,UAAA;AAAA,QAEP,CAAC;AAAA,MAAA;AAEH,MAAAV,EAAW,QAAQQ,EAChB,OAAO,CAACG,MAAMA,EAAE,WAAW,WAAW,EACtC,IAAI,CAACA,MAAOA,EAAgD,KAAK;AAAA,IACtE;AAEA,mBAAeC,IAAgB;AAC7B,YAAMH,IAAMP,EAAW,MAAM,KAAA;AA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,YAAY,IAAI,wBAAwB,KAAM,CAAA,GAC1EkE,IAAa,MAAM,QAAQ;AAAA,QAC/BzD,EAAK,IAAI,OAAOE,OAAiB;AAAA,UAC/B,GAAI,MAAMX,EAAI,MAAM,gBAAgBW,CAAG;AAAA,UACvC,aAAaA;AAAA,QAAA,EACb;AAAA,MAAA;AAEJ,MAAAqB,EAAc,QAAQkC,EACnB,OAAO,CAACrD,MAAMA,EAAE,WAAW,WAAW,EACtC,IAAI,CAACA,MAAOA,EAA8C,KAAK,GAElEoB,EAAiB,QAAS,MAAMjC,EAAI,YAAY,IAAI,qBAAqB,KAAM,CAAA,GAE/E0C,EAAU,QAAQ;AAAA,IACpB;AAEA,aAAShB,EAAqBC,GAA+C;AAC3E,YAAMC,IAAOD,EAAQ,QAAQ,wBAAwB,GAC/CwC,IAAUxC,EAAQ,QAAQ,qBAAqB;AACrD,MAAI,MAAM,QAAQwC,CAAO,QAAoB,QAAQA,IACjD,MAAM,QAAQvC,CAAI,KACpBqC,EAAA;AAAA,IAEJ;AAEA,WAAAlC,EAAU,MAAM;AACd,MAAAkC,EAAA,GACAjE,EAAI,GAAG,uBAAuB0B,CAAoB;AAAA,IACpD,CAAC,GACD0C,EAAgB,MAAM;AAAA,IAAC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Preferences-DS4-CFWe.js","sources":["../src/decorators/Preferences.ts"],"sourcesContent":["import type Schema from 'schemastery'\
|
|
1
|
+
{"version":3,"file":"Preferences-DS4-CFWe.js","sources":["../src/decorators/Preferences.ts"],"sourcesContent":["import type Schema from 'schemastery'\n\ntype AnyConstructor<T = any> = new (...args: any[]) => T\n\nexport type PreferenceAugmented<D, C extends AnyConstructor> = C & {\n PreferencesSchema: Schema<D>\n}\n\n/**\n * Decorator for registering preferences\n *\n * ```ts\n * @RegisterPreferences(\n * Schema.object({\n * foo: Schema.string().description('Foo description'),\n * }),\n * {\n * foo: 'default foo value',\n * }\n * )\n * class Foo {}\n * ```\n *\n * same as:\n *\n * ```ts\n * class Foo {\n * static ConfigSchema = Schema.object({\n * foo: Schema.string().description('Foo description')\n * })\n * static ConfigDefaults = {\n * foo: 'default foo value'\n * }\n * }\n * ```\n */\nexport function RegisterPreferences<D extends Record<string, any>>(schema: Schema<D>) {\n return function <T extends AnyConstructor>(target: T): PreferenceAugmented<D, T> {\n ;(target as any).PreferencesSchema = schema\n return target as PreferenceAugmented<D, T>\n }\n}\n"],"names":["RegisterPreferences","schema","target"],"mappings":"AAoCO,SAASA,EAAmDC,GAAmB;AACpF,SAAO,SAAoCC,GAAsC;AAC7E,WAAAA,EAAe,oBAAoBD,GAC9BC;AAAA,EACT;AACF;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WatchlistAction-BbNAyryN.js","sources":["../src/models/WikiPage/types/WatchlistAction.ts"],"sourcesContent":["export enum WatchlistAction {\n preferences = 'preferences',\n watch = 'watch',\n unwatch = 'unwatch',\n nochange = 'nochange',\n}\n"],"names":["WatchlistAction"],"mappings":"AAAO,IAAKA,sBAAAA,OACVA,EAAA,cAAc,eACdA,EAAA,QAAQ,SACRA,EAAA,UAAU,WACVA,EAAA,WAAW,YAJDA,IAAAA,KAAA,CAAA,CAAA;"}
|
package/dist/components/index.js
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
import { M as
|
|
1
|
+
import { M as y } from "../index-CG38LlAh.js";
|
|
2
2
|
import { j as n } from "../index-CM_6yF2v.js";
|
|
3
3
|
import { P as V } from "../index-CM_6yF2v.js";
|
|
4
4
|
import { T as A } from "../index-DD5CVCfD.js";
|
|
5
5
|
import { A as B } from "../ActionButton-CRjo_l3y.js";
|
|
6
|
-
import { C as T } from "../
|
|
7
|
-
import {
|
|
8
|
-
import { R as k } from "../RadioBox-0UuxlcWZ.js";
|
|
6
|
+
import { C as T, I as z } from "../InputBox-nQKtiWtZ.js";
|
|
7
|
+
import { R as C } from "../RadioBox-0UuxlcWZ.js";
|
|
9
8
|
const r = "_tabview_zlbug_1", _ = "_labels_container_zlbug_4", b = "_label_zlbug_4", d = "_active_zlbug_32", m = "_contents_container_zlbug_35", i = {
|
|
10
9
|
tabview: r,
|
|
11
10
|
labels_container: _,
|
|
@@ -68,10 +67,10 @@ function p({ name: t, children: l }) {
|
|
|
68
67
|
export {
|
|
69
68
|
B as ActionButton,
|
|
70
69
|
T as CheckBox,
|
|
71
|
-
|
|
72
|
-
|
|
70
|
+
z as InputBox,
|
|
71
|
+
y as MBox,
|
|
73
72
|
V as ProgressBar,
|
|
74
|
-
|
|
73
|
+
C as RadioBox,
|
|
75
74
|
p as TabContent,
|
|
76
75
|
f as TabLabel,
|
|
77
76
|
h as TabView,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../src/components/TabView/index.tsx"],"sourcesContent":["import { ReactNode } from 'jsx-dom'\
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../src/components/TabView/index.tsx"],"sourcesContent":["import { ReactNode } from 'jsx-dom'\nimport styles from './styles.module.sass'\n\nexport interface TabViewLabelOptions {\n name: string\n children: ReactNode\n}\n\nconsole.log(styles)\n\nexport function TabView({\n tabs = [],\n defaultActiveIndex = 0,\n}: {\n tabs: (TabViewLabelOptions & { content: ReactNode })[]\n defaultActiveIndex?: number\n}) {\n const el = (\n <div className={`ipe-tabView ${styles.tabview}`}>\n <ul className={`ipe-tabView__labels-container ${styles.labels_container}`}>\n {tabs.map((tab) => (\n <TabLabel key={tab.name} name={tab.name}>\n {tab.children}\n </TabLabel>\n ))}\n </ul>\n <div className={`ipe-tabView__contents ${styles.contents_container}`}>\n {tabs.map((tab) => (\n <TabContent key={tab.name} name={tab.name}>\n {tab.content}\n </TabContent>\n ))}\n </div>\n </div>\n )\n\n const defaultActiveLabel = el.querySelector<HTMLAnchorElement>(\n `.ipe-tabView__labels-container > .ipe-tabView__label:nth-child(${defaultActiveIndex + 1})`\n )\n if (defaultActiveLabel) {\n defaultActiveLabel.click()\n }\n\n return el\n}\n\nexport function TabLabel({ name, children }: { name: string; children: ReactNode }) {\n return (\n <li\n data-tab-name={name}\n className={`ipe-tabView__label ${styles.label}`}\n onClick={function (e) {\n e.preventDefault()\n const container = this.closest('.ipe-tabView')\n if (!container) return\n const labels = Array.from(container.children).find((el) =>\n el.classList.contains('ipe-tabView__labels')\n )?.children\n if (labels) {\n Array.from(labels).forEach((label) => {\n label.classList.remove(styles.active)\n })\n }\n this.classList.add(styles.active)\n const contents = Array.from(container.children).find((el) =>\n el.classList.contains('ipe-tabView__contents')\n )?.children\n if (contents) {\n Array.from(contents).forEach((content) => {\n if (content instanceof HTMLElement) {\n if (content.dataset.tabName === name) {\n content.style.display = ''\n content.classList.add(styles.active)\n } else {\n content.style.display = 'none'\n content.classList.remove(styles.active)\n }\n }\n })\n }\n }}\n >\n <a>{children || name}</a>\n </li>\n )\n}\n\nexport function TabContent({ name, children }: { name: string; children: ReactNode }) {\n return (\n <div\n data-tab-name={name}\n className=\"ipe-tabView__content-body\"\n style={{\n display: 'none',\n }}\n >\n {children}\n </div>\n )\n}\n"],"names":["TabView","tabs","defaultActiveIndex","el","jsxs","styles","jsx","tab","TabLabel","TabContent","defaultActiveLabel","name","children","e","container","labels","label","contents","content"],"mappings":";;;;;;;;;;;;;;AAUO,SAASA,EAAQ;AAAA,EACtB,MAAAC,IAAO,CAAA;AAAA,EACP,oBAAAC,IAAqB;AACvB,GAGG;AACD,QAAMC,IACJC,gBAAAA,EAAC,OAAA,EAAI,WAAW,eAAeC,EAAO,OAAO,IAC3C,UAAA;AAAA,IAAA,gBAAAC,EAAC,MAAA,EAAG,WAAW,iCAAiCD,EAAO,gBAAgB,IACpE,UAAAJ,EAAK,IAAI,CAACM,wBACRC,GAAA,EAAwB,MAAMD,EAAI,MAChC,UAAAA,EAA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