@inpageedit/core 0.17.1 → 0.17.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/InPageEdit.js +1 -1
- package/dist/{PluginImagesUsed-D5O8t694.js → PluginImagesUsed-bCsiMdd5.js} +2 -2
- package/dist/{PluginImagesUsed-D5O8t694.js.map → PluginImagesUsed-bCsiMdd5.js.map} +1 -1
- package/dist/{PluginPrefSync-C8tb5SJJ.js → PluginPrefSync-CjVsY-Ei.js} +2 -2
- package/dist/{PluginPrefSync-C8tb5SJJ.js.map → PluginPrefSync-CjVsY-Ei.js.map} +1 -1
- package/dist/{PluginStoreApp-CeKtXL3p.js → PluginStoreApp-DKxtArs5.js} +2 -2
- package/dist/{PluginStoreApp-CeKtXL3p.js.map → PluginStoreApp-DKxtArs5.js.map} +1 -1
- package/dist/{PluginTemplatesUsed-DYv_lbHw.js → PluginTemplatesUsed-CSrc0hi5.js} +2 -2
- package/dist/{PluginTemplatesUsed-DYv_lbHw.js.map → PluginTemplatesUsed-CSrc0hi5.js.map} +1 -1
- package/dist/Promise.withResolvers-C4chhLB1.js.map +1 -1
- package/dist/core.js +2 -2
- package/dist/{index-DSh05RaI.js → index-0iItkJyW.js} +3 -3
- package/dist/{index-DSh05RaI.js.map → index-0iItkJyW.js.map} +1 -1
- package/dist/{index-Bf6ewNGZ.js → index-67KKEC1h.js} +2 -2
- package/dist/{index-Bf6ewNGZ.js.map → index-67KKEC1h.js.map} +1 -1
- package/dist/{index-QtXlz9l0.js → index-BGSq0cLS.js} +150 -132
- package/dist/index-BGSq0cLS.js.map +1 -0
- package/dist/{index-Dp_n8QEV.js → index-BPZDprsy.js} +2 -2
- package/dist/{index-Dp_n8QEV.js.map → index-BPZDprsy.js.map} +1 -1
- package/dist/{index-Mi3qr9J0.js → index-Bf9sWKqX.js} +2 -2
- package/dist/{index-Mi3qr9J0.js.map → index-Bf9sWKqX.js.map} +1 -1
- package/dist/{index-CxjH0_fO.js → index-BonYcMRR.js} +2 -2
- package/dist/{index-CxjH0_fO.js.map → index-BonYcMRR.js.map} +1 -1
- package/dist/{index-BuSA1t5R.js → index-CFwPBIwv.js} +2 -2
- package/dist/{index-BuSA1t5R.js.map → index-CFwPBIwv.js.map} +1 -1
- package/dist/{index-h57rl1RH.js → index-CkKY3iId.js} +2 -2
- package/dist/{index-h57rl1RH.js.map → index-CkKY3iId.js.map} +1 -1
- package/dist/{index-CaTtMzfu.js → index-CxckcdDI.js} +14 -14
- package/dist/{index-CaTtMzfu.js.map → index-CxckcdDI.js.map} +1 -1
- package/dist/{index--IhZKYnh.js → index-D78nVTYO.js} +2 -2
- package/dist/{index--IhZKYnh.js.map → index-D78nVTYO.js.map} +1 -1
- package/dist/{index-qbW7-LUD.js → index-DRpv1zoB.js} +2 -2
- package/dist/{index-qbW7-LUD.js.map → index-DRpv1zoB.js.map} +1 -1
- package/dist/{index-fa8d4Dv_.js → index-DtXCZneF.js} +2 -2
- package/dist/{index-fa8d4Dv_.js.map → index-DtXCZneF.js.map} +1 -1
- package/dist/{index-_Sydb5MZ.js → index-wpZvFBVX.js} +3 -3
- package/dist/{index-_Sydb5MZ.js.map → index-wpZvFBVX.js.map} +1 -1
- package/dist/index.d.ts +5857 -27236
- package/dist/index.js +2 -2
- package/dist/plugins/index.js +12 -12
- package/dist/services/index.js +1 -1
- package/lib/index.umd.js +11 -11
- package/lib/index.umd.js.map +1 -1
- package/package.json +4 -3
- package/dist/index-QtXlz9l0.js.map +0 -1
|
@@ -1,86 +1,86 @@
|
|
|
1
1
|
import { j as R } from "./Promise.withResolvers-C4chhLB1.js";
|
|
2
|
-
import { S as
|
|
3
|
-
import { BasePlugin as
|
|
4
|
-
import { c as
|
|
5
|
-
const
|
|
2
|
+
import { S as a, E as P, a as L } from "./index-CxckcdDI.js";
|
|
3
|
+
import { BasePlugin as F } from "./core.js";
|
|
4
|
+
import { c as j, d as G } from "./vueHooks-Bs93iP61.js";
|
|
5
|
+
const O = 1;
|
|
6
6
|
var m;
|
|
7
|
-
((
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
kind:
|
|
11
|
-
entry:
|
|
12
|
-
styles:
|
|
13
|
-
main_export:
|
|
7
|
+
((i) => {
|
|
8
|
+
i.PackageLoader = new a(
|
|
9
|
+
a.object({
|
|
10
|
+
kind: a.union(["autoload", "module", "umd", "styles"]).required().default("autoload"),
|
|
11
|
+
entry: a.string(),
|
|
12
|
+
styles: a.array(a.string()),
|
|
13
|
+
main_export: a.string()
|
|
14
14
|
})
|
|
15
|
-
),
|
|
16
|
-
|
|
17
|
-
id:
|
|
18
|
-
name:
|
|
19
|
-
version:
|
|
20
|
-
description:
|
|
21
|
-
author:
|
|
22
|
-
license:
|
|
23
|
-
loader:
|
|
15
|
+
), i.Package = new a(
|
|
16
|
+
a.object({
|
|
17
|
+
id: a.string().required(),
|
|
18
|
+
name: a.string().required(),
|
|
19
|
+
version: a.string().required(),
|
|
20
|
+
description: a.string(),
|
|
21
|
+
author: a.string(),
|
|
22
|
+
license: a.string(),
|
|
23
|
+
loader: i.PackageLoader.required()
|
|
24
24
|
})
|
|
25
|
-
),
|
|
26
|
-
|
|
27
|
-
name:
|
|
28
|
-
email:
|
|
25
|
+
), i.RegistryMaintainer = new a(
|
|
26
|
+
a.object({
|
|
27
|
+
name: a.string().required(),
|
|
28
|
+
email: a.string()
|
|
29
29
|
})
|
|
30
|
-
),
|
|
31
|
-
|
|
32
|
-
type:
|
|
33
|
-
url:
|
|
30
|
+
), i.RegistryRepository = new a(
|
|
31
|
+
a.object({
|
|
32
|
+
type: a.string().required(),
|
|
33
|
+
url: a.string().required()
|
|
34
34
|
})
|
|
35
|
-
),
|
|
36
|
-
|
|
37
|
-
manifest_version:
|
|
38
|
-
name:
|
|
39
|
-
base_url:
|
|
40
|
-
homepage:
|
|
41
|
-
maintainers:
|
|
42
|
-
repository:
|
|
43
|
-
packages:
|
|
35
|
+
), i.Registry = new a(
|
|
36
|
+
a.object({
|
|
37
|
+
manifest_version: a.number().min(O).required(),
|
|
38
|
+
name: a.string().required(),
|
|
39
|
+
base_url: a.string().required(),
|
|
40
|
+
homepage: a.string(),
|
|
41
|
+
maintainers: a.array(i.RegistryMaintainer),
|
|
42
|
+
repository: i.RegistryRepository,
|
|
43
|
+
packages: a.array(i.Package).required()
|
|
44
44
|
})
|
|
45
45
|
);
|
|
46
46
|
})(m || (m = {}));
|
|
47
|
-
var M = Object.create, v = Object.defineProperty,
|
|
48
|
-
throw TypeError(
|
|
49
|
-
},
|
|
50
|
-
for (var
|
|
47
|
+
var M = Object.create, v = Object.defineProperty, N = Object.getOwnPropertyDescriptor, b = (i, e) => (e = Symbol[i]) ? e : /* @__PURE__ */ Symbol.for("Symbol." + i), k = (i) => {
|
|
48
|
+
throw TypeError(i);
|
|
49
|
+
}, q = (i, e, t) => e in i ? v(i, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : i[e] = t, B = (i, e) => v(i, "name", { value: e, configurable: !0 }), D = (i) => [, , , M(i?.[b("metadata")] ?? null)], U = ["class", "method", "getter", "setter", "accessor", "field", "value", "get", "set"], A = (i) => i !== void 0 && typeof i != "function" ? k("Function expected") : i, Y = (i, e, t, r, n) => ({ kind: U[i], name: e, metadata: r, addInitializer: (s) => t._ ? k("Already initialized") : n.push(A(s || null)) }), z = (i, e) => q(e, b("metadata"), i[3]), Q = (i, e, t, r) => {
|
|
50
|
+
for (var n = 0, s = i[e >> 1], o = s && s.length; n < o; n++) s[n].call(t);
|
|
51
51
|
return r;
|
|
52
|
-
}, H = (
|
|
53
|
-
var o,
|
|
54
|
-
|
|
52
|
+
}, H = (i, e, t, r, n, s) => {
|
|
53
|
+
var o, g, c, p = e & 7, h = !1, u = 0, y = i[u] || (i[u] = []), f = p && (n = n.prototype, p < 5 && (p > 3 || !h) && N(n, t));
|
|
54
|
+
B(n, t);
|
|
55
55
|
for (var l = r.length - 1; l >= 0; l--)
|
|
56
|
-
c = Y(p, t,
|
|
57
|
-
return z(
|
|
58
|
-
},
|
|
59
|
-
const
|
|
60
|
-
if (!
|
|
56
|
+
c = Y(p, t, g = {}, i[3], y), o = (0, r[l])(n, c), g._ = 1, A(o) && (n = o);
|
|
57
|
+
return z(i, n), f && v(n, t, f), h ? p ^ 4 ? s : f : n;
|
|
58
|
+
}, T, I, C;
|
|
59
|
+
const S = (i) => {
|
|
60
|
+
if (!i) return null;
|
|
61
61
|
try {
|
|
62
|
-
return
|
|
62
|
+
return i.split(".").reduce((e, t) => e == null ? e : e[t], globalThis);
|
|
63
63
|
} catch {
|
|
64
64
|
return null;
|
|
65
65
|
}
|
|
66
|
-
}, E = (
|
|
67
|
-
if (/^https?:\/\//i.test(
|
|
66
|
+
}, E = (i, e, t) => {
|
|
67
|
+
if (/^https?:\/\//i.test(i)) return i;
|
|
68
68
|
const r = (o) => o.endsWith("/") ? o : o + "/";
|
|
69
69
|
if (/^https?:\/\//i.test(e)) {
|
|
70
70
|
const o = r(e);
|
|
71
|
-
return new URL(
|
|
71
|
+
return new URL(i, o).href;
|
|
72
72
|
}
|
|
73
|
-
const
|
|
73
|
+
const n = (() => {
|
|
74
74
|
try {
|
|
75
75
|
return new URL(t).href;
|
|
76
76
|
} catch {
|
|
77
77
|
return new URL(t, location.origin).href;
|
|
78
78
|
}
|
|
79
|
-
})(),
|
|
80
|
-
return new URL(
|
|
79
|
+
})(), s = new URL(r(e), n).href;
|
|
80
|
+
return new URL(i, s).href;
|
|
81
81
|
};
|
|
82
|
-
|
|
83
|
-
let w = class x extends (
|
|
82
|
+
T = [L(["storage", "preferences", "resourceLoader", "$"])];
|
|
83
|
+
let w = class x extends (C = F) {
|
|
84
84
|
constructor(e) {
|
|
85
85
|
super(e, {}, "plugin-store"), this.ctx = e, this.regInfoDB = void 0, this._installedPlugins = /* @__PURE__ */ new Map(), this._onlineRegistryQueries = /* @__PURE__ */ new Map(), e.set("store", this), this.regInfoDB = e.storage.createDatabase(
|
|
86
86
|
x.REGISTRY_INFO_STORAGE_NAME,
|
|
@@ -102,7 +102,25 @@ let w = class x extends (T = L) {
|
|
|
102
102
|
this.REGISTRY_ETAG_STORAGE_NAME = "psreg-etag";
|
|
103
103
|
}
|
|
104
104
|
async start() {
|
|
105
|
-
this._installUserPlugins(), this._injectPreferenceUI();
|
|
105
|
+
this._installUserPlugins(), this._checkAprilFool(), this._injectPreferenceUI();
|
|
106
|
+
}
|
|
107
|
+
/**
|
|
108
|
+
* On April 1st each year, auto-install the official April Fool plugin
|
|
109
|
+
* named `april-fool-{year}` if it exists in the official registry.
|
|
110
|
+
* Only triggers once per year, only from the official registry.
|
|
111
|
+
*/
|
|
112
|
+
async _checkAprilFool() {
|
|
113
|
+
const e = /* @__PURE__ */ new Date();
|
|
114
|
+
if (e.getMonth() !== 3 || e.getDate() !== 1) return;
|
|
115
|
+
const t = e.getFullYear(), r = `april-fool-auto-installed-${t}`;
|
|
116
|
+
if (localStorage.getItem(r)) return;
|
|
117
|
+
localStorage.setItem(r, "1");
|
|
118
|
+
const n = P.PLUGIN_REGISTRY_URL, s = `april-fool-${t}`;
|
|
119
|
+
try {
|
|
120
|
+
if (!(await this.getRegistryInfo(n)).packages?.find((c) => c.id === s)) return;
|
|
121
|
+
this.logger.info(`🎉 April Fool! Auto-installing ${s}`), this.install(n, s, "online_manifest", "new-added");
|
|
122
|
+
} catch {
|
|
123
|
+
}
|
|
106
124
|
}
|
|
107
125
|
async _installUserPlugins() {
|
|
108
126
|
const e = await this.ctx.preferences.get("pluginStore.plugins", []);
|
|
@@ -111,8 +129,8 @@ let w = class x extends (T = L) {
|
|
|
111
129
|
this.install(t.registry, t.id, t.source, "user-preference");
|
|
112
130
|
}
|
|
113
131
|
async _createManagementApp() {
|
|
114
|
-
const e = await this.ctx.withInject(["store"]), t =
|
|
115
|
-
return
|
|
132
|
+
const e = await this.ctx.withInject(["store"]), t = G(() => import("./PluginStoreApp-DKxtArs5.js"));
|
|
133
|
+
return j(e, t);
|
|
116
134
|
}
|
|
117
135
|
async _injectPreferenceUI() {
|
|
118
136
|
const e = this.ctx, t = e.$;
|
|
@@ -123,23 +141,23 @@ let w = class x extends (T = L) {
|
|
|
123
141
|
index: 90,
|
|
124
142
|
autoGenerateForm: !1,
|
|
125
143
|
customRenderer: async ({ onUnmount: r }) => {
|
|
126
|
-
const
|
|
127
|
-
return
|
|
128
|
-
|
|
129
|
-
}), /* @__PURE__ */ R("section", { children:
|
|
144
|
+
const n = /* @__PURE__ */ R("div", { id: "ipe-plugin-store-preferences-vue" }), s = await this._createManagementApp();
|
|
145
|
+
return s.mount(n), r(() => {
|
|
146
|
+
s.unmount(), this.ctx.logger.debug("Plugin Store preferences app unmounted");
|
|
147
|
+
}), /* @__PURE__ */ R("section", { children: n });
|
|
130
148
|
}
|
|
131
149
|
}), e.preferences.registerCustomConfig(
|
|
132
150
|
"plugin-store",
|
|
133
|
-
|
|
134
|
-
"pluginStore.registries":
|
|
135
|
-
|
|
151
|
+
a.object({
|
|
152
|
+
"pluginStore.registries": a.array(a.string()).default([
|
|
153
|
+
P.PLUGIN_REGISTRY_URL
|
|
136
154
|
]).description(t`Registry URLs`).hidden(),
|
|
137
|
-
"pluginStore.cdnForNpm":
|
|
138
|
-
"pluginStore.plugins":
|
|
139
|
-
|
|
140
|
-
source:
|
|
141
|
-
registry:
|
|
142
|
-
id:
|
|
155
|
+
"pluginStore.cdnForNpm": a.string().description(t`CDN to install packages from npm`).default('https://cdn.jsdelivr.net/npm/{{ package }}{{ version ? "@" + version : "" }}').hidden(),
|
|
156
|
+
"pluginStore.plugins": a.array(
|
|
157
|
+
a.object({
|
|
158
|
+
source: a.union(["online_manifest", "npm"]).default("online_manifest"),
|
|
159
|
+
registry: a.string().required(),
|
|
160
|
+
id: a.string().required()
|
|
143
161
|
})
|
|
144
162
|
).description(t`Installed plugins`).default([]).hidden()
|
|
145
163
|
}),
|
|
@@ -157,21 +175,21 @@ let w = class x extends (T = L) {
|
|
|
157
175
|
r.unmount();
|
|
158
176
|
}), e;
|
|
159
177
|
}
|
|
160
|
-
async install(e, t, r = "online_manifest",
|
|
161
|
-
const
|
|
162
|
-
if (!
|
|
178
|
+
async install(e, t, r = "online_manifest", n = "new-added") {
|
|
179
|
+
const s = await this.getRegistryInfo(e, r);
|
|
180
|
+
if (!s)
|
|
163
181
|
return this.ctx.logger.warn(`Registry ${e} not found`), null;
|
|
164
182
|
const o = `${e}#${t}`;
|
|
165
183
|
if (this._installedPlugins.has(o))
|
|
166
184
|
return await this._installedPlugins.get(o) ?? null;
|
|
167
|
-
const
|
|
168
|
-
this._installedPlugins.set(o,
|
|
169
|
-
const c = await
|
|
185
|
+
const g = this._installOneByRegistryInfo(e, s, t);
|
|
186
|
+
this._installedPlugins.set(o, g);
|
|
187
|
+
const c = await g;
|
|
170
188
|
return c && this.ctx.emit("plugin-store/plugin-installed", {
|
|
171
189
|
ctx: this.ctx,
|
|
172
|
-
registry:
|
|
190
|
+
registry: s,
|
|
173
191
|
id: t,
|
|
174
|
-
by:
|
|
192
|
+
by: n
|
|
175
193
|
}), c;
|
|
176
194
|
}
|
|
177
195
|
async uninstall(e, t) {
|
|
@@ -179,9 +197,9 @@ let w = class x extends (T = L) {
|
|
|
179
197
|
if (r === void 0)
|
|
180
198
|
return !0;
|
|
181
199
|
this._installedPlugins.delete(`${e}#${t}`);
|
|
182
|
-
const
|
|
183
|
-
if (
|
|
184
|
-
const
|
|
200
|
+
const n = await r;
|
|
201
|
+
if (n) {
|
|
202
|
+
const s = n.dispose?.() ?? !0;
|
|
185
203
|
try {
|
|
186
204
|
const o = await this.getRegistryCache(e) || await this.getRegistryInfo(e).catch(() => null);
|
|
187
205
|
o && this.ctx.emit("plugin-store/plugin-uninstalled", {
|
|
@@ -191,17 +209,17 @@ let w = class x extends (T = L) {
|
|
|
191
209
|
});
|
|
192
210
|
} catch {
|
|
193
211
|
}
|
|
194
|
-
return
|
|
212
|
+
return s;
|
|
195
213
|
}
|
|
196
214
|
return !0;
|
|
197
215
|
}
|
|
198
216
|
async addToPreferences(e, t) {
|
|
199
217
|
let r = await this.ctx.preferences.get("pluginStore.plugins") || [];
|
|
200
|
-
return r.some((
|
|
218
|
+
return r.some((s) => s.registry === e && s.id === t) || (r.push({ registry: e, id: t }), await this.ctx.preferences.set("pluginStore.plugins", r)), !0;
|
|
201
219
|
}
|
|
202
220
|
async removeFromPreferences(e, t) {
|
|
203
221
|
let r = await this.ctx.preferences.get("pluginStore.plugins") || [];
|
|
204
|
-
return r = r.filter((
|
|
222
|
+
return r = r.filter((n) => n.registry !== e || n.id !== t), await this.ctx.preferences.set("pluginStore.plugins", r), !0;
|
|
205
223
|
}
|
|
206
224
|
async installAndSetPreference(e, t) {
|
|
207
225
|
return await this.addToPreferences(e, t), this.install(e, t, "online_manifest", "new-added");
|
|
@@ -211,19 +229,19 @@ let w = class x extends (T = L) {
|
|
|
211
229
|
}
|
|
212
230
|
// 3) 增加 registryUrl 参数
|
|
213
231
|
async _installOneByRegistryInfo(e, t, r) {
|
|
214
|
-
const
|
|
215
|
-
if (!
|
|
232
|
+
const n = t.base_url, s = t.packages.find((l) => l.id === r);
|
|
233
|
+
if (!s)
|
|
216
234
|
return this.ctx.logger.warn(`Package ${r} not found in registry ${e}`), null;
|
|
217
|
-
const o =
|
|
235
|
+
const o = s.loader, { kind: g, entry: c = "index.js", styles: p = [], main_export: h = null } = o;
|
|
218
236
|
let u = null;
|
|
219
|
-
if (
|
|
237
|
+
if (g !== "styles") {
|
|
220
238
|
if (!c)
|
|
221
239
|
return this.ctx.logger.warn(`Entry url missing for ${r}`, o), null;
|
|
222
240
|
try {
|
|
223
|
-
u = E(c,
|
|
241
|
+
u = E(c, n, e);
|
|
224
242
|
} catch (l) {
|
|
225
243
|
return this.ctx.logger.warn(
|
|
226
|
-
`Failed to resolve entry "${c}" with base "${
|
|
244
|
+
`Failed to resolve entry "${c}" with base "${n}" and registry "${e}"`,
|
|
227
245
|
l
|
|
228
246
|
), null;
|
|
229
247
|
}
|
|
@@ -232,10 +250,10 @@ let w = class x extends (T = L) {
|
|
|
232
250
|
"data-plugin-registry": e,
|
|
233
251
|
"data-plugin-id": r
|
|
234
252
|
};
|
|
235
|
-
let
|
|
236
|
-
switch (
|
|
253
|
+
let f = null;
|
|
254
|
+
switch (g) {
|
|
237
255
|
case "autoload": {
|
|
238
|
-
|
|
256
|
+
f = this.ctx.plugin({
|
|
239
257
|
inject: ["resourceLoader"],
|
|
240
258
|
name: `plugin-store-${e}-${r}`,
|
|
241
259
|
apply: (l) => {
|
|
@@ -251,88 +269,88 @@ let w = class x extends (T = L) {
|
|
|
251
269
|
/* @vite-ignore */
|
|
252
270
|
u
|
|
253
271
|
).then(
|
|
254
|
-
(
|
|
272
|
+
(d) => (h ? d[h] : d.default) ?? d
|
|
255
273
|
);
|
|
256
274
|
if (!l)
|
|
257
|
-
return this.ctx.logger.warn(`Main export ${
|
|
258
|
-
|
|
275
|
+
return this.ctx.logger.warn(`Main export ${h} not found in module ${u}`), null;
|
|
276
|
+
f = this.ctx.plugin(l);
|
|
259
277
|
break;
|
|
260
278
|
}
|
|
261
279
|
case "umd": {
|
|
262
|
-
let l =
|
|
280
|
+
let l = S(h);
|
|
263
281
|
if (!l) {
|
|
264
282
|
if (!u)
|
|
265
283
|
return this.ctx.logger.warn(`Entry url missing for umd kind, package ${r}`), null;
|
|
266
|
-
await this.ctx.resourceLoader.loadScript(u, { ...y }), l =
|
|
284
|
+
await this.ctx.resourceLoader.loadScript(u, { ...y }), l = S(h);
|
|
267
285
|
}
|
|
268
286
|
if (!l)
|
|
269
287
|
return this.ctx.logger.warn(
|
|
270
|
-
`Main export ${
|
|
288
|
+
`Main export ${h} not found on globalThis after loading ${u}`
|
|
271
289
|
), null;
|
|
272
|
-
|
|
290
|
+
f = this.ctx.plugin(l);
|
|
273
291
|
break;
|
|
274
292
|
}
|
|
275
293
|
}
|
|
276
294
|
if (p && p.length > 0) {
|
|
277
295
|
let l = [];
|
|
278
296
|
try {
|
|
279
|
-
l = p.map((
|
|
280
|
-
} catch (
|
|
281
|
-
this.ctx.logger.warn(`Failed to resolve styles for ${r}`, p,
|
|
297
|
+
l = p.map((d) => E(d, n, e)).filter(Boolean);
|
|
298
|
+
} catch (d) {
|
|
299
|
+
this.ctx.logger.warn(`Failed to resolve styles for ${r}`, p, d);
|
|
282
300
|
}
|
|
283
|
-
|
|
284
|
-
} }),
|
|
301
|
+
f ||= this.ctx.plugin({ name: `plugin-store-${e}-${r}`, apply() {
|
|
302
|
+
} }), f.ctx.plugin({
|
|
285
303
|
inject: ["resourceLoader"],
|
|
286
304
|
name: `plugin-store-${e}-${r}-styles`,
|
|
287
|
-
apply: (
|
|
288
|
-
l.forEach((_) =>
|
|
305
|
+
apply: (d) => {
|
|
306
|
+
l.forEach((_) => d.resourceLoader.loadStyle(_, { ...y })), d.on("dispose", () => {
|
|
289
307
|
try {
|
|
290
|
-
l.forEach((_) =>
|
|
308
|
+
l.forEach((_) => d.resourceLoader.removeStyle(_));
|
|
291
309
|
} catch {
|
|
292
310
|
}
|
|
293
311
|
});
|
|
294
312
|
}
|
|
295
313
|
});
|
|
296
314
|
}
|
|
297
|
-
return
|
|
315
|
+
return f;
|
|
298
316
|
}
|
|
299
317
|
validateRegistry(e) {
|
|
300
318
|
return m.Registry(e);
|
|
301
319
|
}
|
|
302
320
|
async getRegistryInfo(e, t = "online_manifest", r = !1) {
|
|
303
321
|
try {
|
|
304
|
-
let
|
|
322
|
+
let s;
|
|
305
323
|
if (t === "online_manifest")
|
|
306
|
-
|
|
324
|
+
s = await this._fetchOnlineRegistryInfo(e, r), this.logger.debug("Fetched registry info from online manifest", s), this.setRegistryCache(e, s);
|
|
307
325
|
else
|
|
308
326
|
throw new Error(`Unsupported registry source: ${t}`);
|
|
309
|
-
return
|
|
310
|
-
} catch (
|
|
311
|
-
this.ctx.logger.warn("Failed to fetch registry info",
|
|
327
|
+
return s;
|
|
328
|
+
} catch (s) {
|
|
329
|
+
this.ctx.logger.warn("Failed to fetch registry info", s);
|
|
312
330
|
}
|
|
313
|
-
const
|
|
314
|
-
if (!
|
|
331
|
+
const n = await this.getRegistryCache(e);
|
|
332
|
+
if (!n)
|
|
315
333
|
throw this.ctx.emit("plugin-store/registry-not-found", {
|
|
316
334
|
ctx: this.ctx,
|
|
317
335
|
registryUrl: e
|
|
318
336
|
}), new Error(`Failed to fetch registry info: ${e}`);
|
|
319
|
-
return
|
|
337
|
+
return n;
|
|
320
338
|
}
|
|
321
339
|
async _fetchOnlineRegistryInfo(e, t = !1) {
|
|
322
340
|
if (!t && this._onlineRegistryQueries.has(e))
|
|
323
341
|
return await this._onlineRegistryQueries.get(e);
|
|
324
|
-
const
|
|
325
|
-
const
|
|
342
|
+
const n = (async () => {
|
|
343
|
+
const s = {
|
|
326
344
|
method: "GET"
|
|
327
345
|
};
|
|
328
|
-
t && (
|
|
329
|
-
const
|
|
346
|
+
t && (s.cache = "no-store");
|
|
347
|
+
const g = await (await fetch(e, s)).json(), c = this.validateRegistry(g);
|
|
330
348
|
return this.ctx.emit("plugin-store/registry-fetched", {
|
|
331
349
|
ctx: this.ctx,
|
|
332
350
|
registry: c
|
|
333
351
|
}), c;
|
|
334
352
|
})();
|
|
335
|
-
return this._onlineRegistryQueries.set(e,
|
|
353
|
+
return this._onlineRegistryQueries.set(e, n), await n;
|
|
336
354
|
}
|
|
337
355
|
async getRegistryCache(e) {
|
|
338
356
|
const t = await this.regInfoDB.get(e);
|
|
@@ -370,18 +388,18 @@ let w = class x extends (T = L) {
|
|
|
370
388
|
*/
|
|
371
389
|
async refreshAllRegistryCaches() {
|
|
372
390
|
const e = await this.ctx.preferences.get("pluginStore.registries") || [], t = await Promise.allSettled(
|
|
373
|
-
e.map((
|
|
391
|
+
e.map((n) => this.refreshRegistryCache(n))
|
|
374
392
|
), r = {};
|
|
375
|
-
for (const [
|
|
376
|
-
|
|
393
|
+
for (const [n, s] of t.entries())
|
|
394
|
+
s.status === "fulfilled" ? r[e[n]] = s.value : r[e[n]] = null;
|
|
377
395
|
return r;
|
|
378
396
|
}
|
|
379
397
|
};
|
|
380
|
-
I = D(
|
|
381
|
-
w = H(I, 0, "PluginPluginStore",
|
|
398
|
+
I = D(C);
|
|
399
|
+
w = H(I, 0, "PluginPluginStore", T, w);
|
|
382
400
|
Q(I, 1, w);
|
|
383
401
|
let X = w;
|
|
384
402
|
export {
|
|
385
403
|
X as PluginPluginStore
|
|
386
404
|
};
|
|
387
|
-
//# sourceMappingURL=index-
|
|
405
|
+
//# sourceMappingURL=index-BGSq0cLS.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index-BGSq0cLS.js","sources":["../src/plugins/plugin-store/schema.ts","../src/plugins/plugin-store/index.tsx"],"sourcesContent":["import Schema from 'schemastery'\n\nexport const PLUGIN_STORE_REGISTRY_MANIFEST_VERSION = 1\n\nexport interface PluginStoreRegistry {\n manifest_version: number\n name: string\n base_url: string\n homepage?: string\n maintainers?: PluginStoreRegistryMaintainer[]\n repository?: PluginStoreRegistryRepository\n packages: PluginStorePackage[]\n}\n\nexport interface PluginStoreRegistryMaintainer {\n name: string\n email?: string\n}\n\nexport interface PluginStoreRegistryRepository {\n type: string\n url: string\n}\n\nexport interface PluginStorePackage {\n id: string\n name: string\n version: string\n description?: string\n author?: string\n license?: string\n loader: PluginStorePackageLoader\n}\n\nexport interface PluginStorePackageLoader {\n kind: 'autoload' | 'module' | 'umd' | 'styles'\n entry?: string\n styles?: string[]\n main_export?: string\n}\n\nexport namespace PluginStoreSchemas {\n export const PackageLoader = new Schema<PluginStorePackageLoader>(\n Schema.object({\n kind: Schema.union(['autoload', 'module', 'umd', 'styles']).required().default('autoload'),\n entry: Schema.string(),\n styles: Schema.array(Schema.string()),\n main_export: Schema.string(),\n })\n )\n\n export const Package = new Schema<PluginStorePackage>(\n Schema.object({\n id: Schema.string().required(),\n name: Schema.string().required(),\n version: Schema.string().required(),\n description: Schema.string(),\n author: Schema.string(),\n license: Schema.string(),\n loader: PackageLoader.required(),\n })\n )\n\n export const RegistryMaintainer = new Schema<PluginStoreRegistryMaintainer>(\n Schema.object({\n name: Schema.string().required(),\n email: Schema.string(),\n })\n )\n\n export const RegistryRepository = new Schema<PluginStoreRegistryRepository>(\n Schema.object({\n type: Schema.string().required(),\n url: Schema.string().required(),\n })\n )\n\n export const Registry = new Schema<PluginStoreRegistry>(\n Schema.object({\n manifest_version: Schema.number().min(PLUGIN_STORE_REGISTRY_MANIFEST_VERSION).required(),\n name: Schema.string().required(),\n base_url: Schema.string().required(),\n homepage: Schema.string(),\n maintainers: Schema.array(RegistryMaintainer),\n repository: RegistryRepository,\n packages: Schema.array(Package).required(),\n })\n )\n}\n","import { InPageEdit, Schema } from '@/InPageEdit'\nimport { ForkScope, Inject } from '@cordisjs/core'\nimport { defineAsyncComponent, type App as VueApp } from 'vue'\nimport { PluginStoreRegistry, PluginStoreSchemas } from './schema'\nimport { AbstractIPEStorageManager } from '@/services/storage/index.js'\n\ndeclare module '@/InPageEdit' {\n interface InPageEdit {\n store: PluginPluginStore\n }\n interface PreferencesMap {\n 'pluginStore.registries': string[]\n 'pluginStore.plugins': { source?: 'online_manifest' | 'npm'; registry: string; id: string }[]\n 'pluginStore.cdnForNpm': string\n }\n interface Events {\n 'plugin-store/registry-fetched'(payload: {\n ctx: InPageEdit\n registry: PluginStoreRegistry\n }): void\n 'plugin-store/registry-not-found'(payload: { ctx: InPageEdit; registryUrl: string }): void\n 'plugin-store/registry-removed'(payload: { ctx: InPageEdit; registryUrl: string }): void\n 'plugin-store/plugin-installed'(payload: {\n ctx: InPageEdit\n registry: PluginStoreRegistry\n id: string\n // 新安装 or 通过用户配置加载\n by: 'new-added' | 'user-preference'\n }): void\n 'plugin-store/plugin-uninstalled'(payload: {\n ctx: InPageEdit\n registry: PluginStoreRegistry\n id: string\n }): void\n }\n}\n\nexport type PluginStoreRegistrySource = 'online_manifest' | 'npm'\n\nconst tryGetGlobalPlugin = (main_export: string) => {\n if (!main_export) return null\n try {\n return main_export\n .split('.')\n .reduce<any>((acc, key) => (acc == null ? acc : acc[key]), globalThis as any)\n } catch {\n return null\n }\n}\n\n/**\n * 解析资源URL\n * @param resourcePath - entry或style路径,可能是相对路径或完整URL\n * @param baseUrl - registry中的base_url,可能是完整URL或相对路径\n * @param registryUrl - registry的URL(必须是绝对URL,作为相对baseUrl时的基准)\n * @returns 解析后的完整URL\n */\nconst resolveResourceUrl = (resourcePath: string, baseUrl: string, registryUrl: string): string => {\n // 完整URL:直接返回\n if (/^https?:\\/\\//i.test(resourcePath)) return resourcePath\n\n // 兜底:规范化一个“带尾斜杠”的 helper\n const ensureSlash = (s: string) => (s.endsWith('/') ? s : s + '/')\n\n // 如果 baseUrl 是完整URL:直接用它当基准(并确保目录语义)\n if (/^https?:\\/\\//i.test(baseUrl)) {\n const normalizedBase = ensureSlash(baseUrl)\n return new URL(resourcePath, normalizedBase).href\n }\n\n // baseUrl 是相对路径(如 './' 或 '/plugins')\n // 先把 baseUrl 相对于 registryUrl 解析成绝对URL\n // 注意:当 baseUrl 是 '/plugins' 这种根相对路径时,new URL 会以 registryUrl 的 origin 作为根。\n const registryAbs = (() => {\n try {\n return new URL(registryUrl).href\n } catch {\n // 极端情况(开发环境传了相对 registry),用页面 origin 兜底\n return new URL(registryUrl, location.origin).href\n }\n })()\n\n const resolvedBaseUrl = new URL(ensureSlash(baseUrl), registryAbs).href\n return new URL(resourcePath, resolvedBaseUrl).href\n}\n\n@Inject(['storage', 'preferences', 'resourceLoader', '$'])\nexport class PluginPluginStore extends BasePlugin {\n // re-export for external usage\n static readonly PluginStoreSchemas = PluginStoreSchemas\n static REGISTRY_INFO_CACHE_TTL = 1000 * 60 * 60 * 24 // 1 day\n static REGISTRY_INFO_STORAGE_NAME = 'plugin-store-registry'\n static REGISTRY_ETAG_STORAGE_NAME = 'psreg-etag'\n private regInfoDB: AbstractIPEStorageManager<PluginStoreRegistry>\n\n constructor(public ctx: InPageEdit) {\n super(ctx, {}, 'plugin-store')\n ctx.set('store', this)\n this.regInfoDB = ctx.storage.createDatabase<PluginStoreRegistry>(\n PluginPluginStore.REGISTRY_INFO_STORAGE_NAME,\n PluginPluginStore.REGISTRY_INFO_CACHE_TTL,\n 1,\n 'indexedDB'\n )\n }\n\n protected async start() {\n this._installUserPlugins()\n this._checkAprilFool()\n this._injectPreferenceUI()\n }\n\n /**\n * On April 1st each year, auto-install the official April Fool plugin\n * named `april-fool-{year}` if it exists in the official registry.\n * Only triggers once per year, only from the official registry.\n */\n private async _checkAprilFool() {\n const now = new Date()\n if (now.getMonth() !== 3 || now.getDate() !== 1) return\n\n const year = now.getFullYear()\n const storageKey = `april-fool-auto-installed-${year}`\n if (localStorage.getItem(storageKey)) return\n\n // Mark immediately to prevent repeated attempts on the same day\n localStorage.setItem(storageKey, '1')\n\n const officialRegistry = Endpoints.PLUGIN_REGISTRY_URL\n const pluginId = `april-fool-${year}`\n\n try {\n const registryInfo = await this.getRegistryInfo(officialRegistry)\n const pkg = registryInfo.packages?.find((p) => p.id === pluginId)\n if (!pkg) return\n\n this.logger.info(`🎉 April Fool! Auto-installing ${pluginId}`)\n this.install(officialRegistry, pluginId, 'online_manifest', 'new-added')\n } catch {\n // Silent fail — not critical\n }\n }\n\n private async _installUserPlugins() {\n const prefs = await this.ctx.preferences.get('pluginStore.plugins', [])\n if (!prefs?.length) {\n return\n }\n for (const pref of prefs) {\n this.install(pref.registry, pref.id, pref.source, 'user-preference')\n }\n }\n\n private async _createManagementApp() {\n const ctx = await this.ctx.withInject(['store'])\n const PluginStoreApp = defineAsyncComponent(() => import('./components/PluginStoreApp.vue'))\n const app = createVueAppWithIPE(ctx, PluginStoreApp)\n return app\n }\n\n private async _injectPreferenceUI() {\n const ctx = this.ctx\n const $ = ctx.$\n\n ctx.preferences.defineCategory({\n name: 'plugin-store',\n label: $`Plugin Store`,\n description: $`Plugin Store`,\n index: 90,\n autoGenerateForm: false,\n customRenderer: async ({ onUnmount }) => {\n const container = <div id=\"ipe-plugin-store-preferences-vue\"></div>\n const app = await this._createManagementApp()\n app.mount(container)\n\n onUnmount(() => {\n app.unmount()\n this.ctx.logger.debug('Plugin Store preferences app unmounted')\n })\n\n return (\n <section>\n {container}\n {/* <div className=\"theme-ipe-prose\">\n <hr />\n <div style={{ textAlign: 'center', marginBottom: '1em', fontSize: '0.8em' }}>\n 🚫 DO NOT edit fields below manually 🚫\n </div>\n </div> */}\n </section>\n )\n },\n })\n\n ctx.preferences.registerCustomConfig(\n 'plugin-store',\n Schema.object({\n 'pluginStore.registries': Schema.array(Schema.string())\n .default([\n import.meta.env.PROD\n ? Endpoints.PLUGIN_REGISTRY_URL\n : import.meta.resolve('/src/__mock__/plugin-registry/index.json'),\n ])\n .description($`Registry URLs`)\n .hidden(),\n 'pluginStore.cdnForNpm': Schema.string()\n .description($`CDN to install packages from npm`)\n .default('https://cdn.jsdelivr.net/npm/{{ package }}{{ version ? \"@\" + version : \"\" }}')\n .hidden(),\n 'pluginStore.plugins': Schema.array(\n Schema.object({\n source: Schema.union(['online_manifest', 'npm']).default('online_manifest'),\n registry: Schema.string().required(),\n id: Schema.string().required(),\n })\n )\n .description($`Installed plugins`)\n .default([])\n .hidden(),\n }),\n 'plugin-store'\n )\n }\n\n async showModal() {\n const modal = this.ctx.modal.show({\n title: $`Plugin Store`,\n sizeClass: 'small',\n })\n const container = <section id=\"ipe-plugin-store-vue\"></section>\n modal.setContent(container)\n const app = await this._createManagementApp()\n app.mount(container)\n modal.on(modal.Event.Close, () => {\n app.unmount()\n })\n return modal\n }\n\n private _installedPlugins = new Map<string, Promise<ForkScope<InPageEdit> | null>>()\n async install(\n registry: string,\n id: string,\n source: PluginStoreRegistrySource = 'online_manifest',\n _by: 'new-added' | 'user-preference' = 'new-added'\n ): Promise<ForkScope<InPageEdit> | null> {\n const registryInfo = await this.getRegistryInfo(registry, source)\n if (!registryInfo) {\n this.ctx.logger.warn(`Registry ${registry} not found`)\n return null\n }\n const key = `${registry}#${id}`\n if (this._installedPlugins.has(key)) {\n return (await this._installedPlugins.get(key)) ?? null\n }\n // 2) 把 registry 原始 URL 传进去,供 URL 解析使用\n const scope = this._installOneByRegistryInfo(registry, registryInfo, id)\n this._installedPlugins.set(key, scope)\n const fork = await scope\n if (fork) {\n this.ctx.emit('plugin-store/plugin-installed', {\n ctx: this.ctx,\n registry: registryInfo,\n id,\n by: _by,\n })\n }\n return fork\n }\n async uninstall(registry: string, id: string): Promise<boolean> {\n const promise = this._installedPlugins.get(`${registry}#${id}`)\n if (promise === void 0) {\n return true // not installed or already uninstalled\n }\n this._installedPlugins.delete(`${registry}#${id}`)\n const scope = await promise\n if (scope) {\n const disposed = scope.dispose?.() ?? true // disposed successfully\n try {\n const registryInfo =\n (await this.getRegistryCache(registry)) ||\n (await this.getRegistryInfo(registry).catch(() => null))\n if (registryInfo) {\n this.ctx.emit('plugin-store/plugin-uninstalled', {\n ctx: this.ctx,\n registry: registryInfo,\n id,\n })\n }\n } catch {}\n return disposed\n }\n return true // not a plugin, just removed from the list\n }\n\n async addToPreferences(registry: string, id: string) {\n let prefs =\n (await this.ctx.preferences.get<{ registry: string; id: string }[]>('pluginStore.plugins')) ||\n []\n const existed = prefs.some((p) => p.registry === registry && p.id === id)\n if (existed) {\n return true\n }\n prefs.push({ registry, id })\n await this.ctx.preferences.set('pluginStore.plugins', prefs)\n return true\n }\n async removeFromPreferences(registry: string, id: string) {\n let prefs =\n (await this.ctx.preferences.get<{ registry: string; id: string }[]>('pluginStore.plugins')) ||\n []\n prefs = prefs.filter((p) => p.registry !== registry || p.id !== id)\n await this.ctx.preferences.set('pluginStore.plugins', prefs)\n return true\n }\n\n async installAndSetPreference(registry: string, id: string) {\n await this.addToPreferences(registry, id)\n return this.install(registry, id, 'online_manifest', 'new-added')\n }\n async uninstallAndRemovePreference(registry: string, id: string) {\n await this.removeFromPreferences(registry, id)\n return this.uninstall(registry, id)\n }\n\n // 3) 增加 registryUrl 参数\n private async _installOneByRegistryInfo(\n registryUrl: string,\n registryInfo: PluginStoreRegistry,\n id: string\n ): Promise<ForkScope<InPageEdit> | null> {\n const baseUrl = registryInfo.base_url\n const pkg = registryInfo.packages.find((p) => p.id === id)\n if (!pkg) {\n this.ctx.logger.warn(`Package ${id} not found in registry ${registryUrl}`)\n return null\n }\n\n const loader = pkg.loader\n const { kind, entry = 'index.js', styles = [], main_export = null } = loader\n\n // 4) 统一用 resolveResourceUrl 解析入口\n let entryUrl: string | null = null\n if (kind !== 'styles') {\n if (!entry) {\n this.ctx.logger.warn(`Entry url missing for ${id}`, loader)\n return null\n }\n try {\n entryUrl = resolveResourceUrl(entry, baseUrl, registryUrl)\n } catch (e) {\n this.ctx.logger.warn(\n `Failed to resolve entry \"${entry}\" with base \"${baseUrl}\" and registry \"${registryUrl}\"`,\n e\n )\n return null\n }\n }\n\n const datasets = {\n 'data-plugin-registry': registryUrl,\n 'data-plugin-id': id,\n }\n\n let fork: ForkScope<InPageEdit> | null = null\n\n switch (kind) {\n case 'autoload': {\n fork = this.ctx.plugin({\n inject: ['resourceLoader'],\n name: `plugin-store-${registryUrl}-${id}`,\n apply: (ctx) => {\n if (!entryUrl) return\n ctx.resourceLoader.loadScript(entryUrl, { ...datasets })\n },\n })\n break\n }\n case 'module': {\n if (!entryUrl) {\n this.ctx.logger.warn(`Entry url missing for module kind, package ${id}`)\n return null\n }\n const apply = await import(/* @vite-ignore */ entryUrl).then(\n (m) => (main_export ? m[main_export] : m.default) ?? m\n )\n if (!apply) {\n this.ctx.logger.warn(`Main export ${main_export} not found in module ${entryUrl}`)\n return null\n }\n fork = this.ctx.plugin(apply)\n break\n }\n case 'umd': {\n let apply = tryGetGlobalPlugin(main_export!)\n if (!apply) {\n if (!entryUrl) {\n this.ctx.logger.warn(`Entry url missing for umd kind, package ${id}`)\n return null\n }\n await this.ctx.resourceLoader.loadScript(entryUrl, { ...datasets })\n apply = tryGetGlobalPlugin(main_export!)\n }\n if (!apply) {\n this.ctx.logger.warn(\n `Main export ${main_export} not found on globalThis after loading ${entryUrl}`\n )\n return null\n }\n fork = this.ctx.plugin(apply)\n break\n }\n case 'styles': {\n // 没有脚本,仅样式。下面统一样式注入逻辑会覆盖\n break\n }\n }\n\n // 5) 统一解析并注入样式(兼容绝对URL与相对 + base_url 的组合)\n if (styles && styles.length > 0) {\n let urls: string[] = []\n try {\n urls = styles.map((u) => resolveResourceUrl(u, baseUrl, registryUrl)).filter(Boolean)\n } catch (e) {\n this.ctx.logger.warn(`Failed to resolve styles for ${id}`, styles, e)\n }\n\n // 确保存在父 fork\n fork ||= this.ctx.plugin({ name: `plugin-store-${registryUrl}-${id}`, apply() {} })\n\n // 在子插件里加载样式,并在卸载时清理\n fork.ctx.plugin({\n inject: ['resourceLoader'],\n name: `plugin-store-${registryUrl}-${id}-styles`,\n apply: (ctx) => {\n urls.forEach((u) => ctx.resourceLoader.loadStyle(u, { ...datasets }))\n ctx.on('dispose', () => {\n try {\n urls.forEach((u) => ctx.resourceLoader.removeStyle(u))\n } catch (e) {\n console.info('styles cleanup failed', e)\n }\n })\n },\n })\n }\n\n return fork\n }\n\n validateRegistry(data: any): PluginStoreRegistry {\n return PluginStoreSchemas.Registry(data)\n }\n\n async getRegistryInfo(\n registry: string,\n source: PluginStoreRegistrySource = 'online_manifest',\n noCache = false\n ): Promise<PluginStoreRegistry> {\n try {\n let info: PluginStoreRegistry\n switch (source) {\n case 'online_manifest': {\n info = await this._fetchOnlineRegistryInfo(registry, noCache)\n this.logger.debug('Fetched registry info from online manifest', info)\n this.setRegistryCache(registry, info)\n break\n }\n default: {\n throw new Error(`Unsupported registry source: ${source}`)\n }\n }\n\n return info\n } catch (e) {\n this.ctx.logger.warn('Failed to fetch registry info', e)\n }\n\n const info = await this.getRegistryCache(registry)\n if (!info) {\n this.ctx.emit('plugin-store/registry-not-found', {\n ctx: this.ctx,\n registryUrl: registry,\n })\n throw new Error(`Failed to fetch registry info: ${registry}`)\n }\n return info\n }\n\n private _onlineRegistryQueries = new Map<string, Promise<PluginStoreRegistry>>()\n private async _fetchOnlineRegistryInfo(\n registry: string,\n noCache = false\n ): Promise<PluginStoreRegistry> {\n if (!noCache && this._onlineRegistryQueries.has(registry)) {\n return await this._onlineRegistryQueries.get(registry)!\n }\n const task = async () => {\n const payload: RequestInit = {\n method: 'GET',\n }\n if (noCache) {\n payload.cache = 'no-store'\n }\n const response = await fetch(registry, payload)\n const data = await response.json()\n const validated = this.validateRegistry(data)\n // 成功在线获取并校验后触发事件\n this.ctx.emit('plugin-store/registry-fetched', {\n ctx: this.ctx,\n registry: validated,\n })\n return validated\n }\n const promise = task()\n this._onlineRegistryQueries.set(registry, promise)\n return await promise\n }\n\n private async getRegistryCache(registry: string) {\n const data = await this.regInfoDB.get(registry)\n if (data) {\n try {\n const validated = this.validateRegistry(data)\n return validated\n } catch (e) {\n this.ctx.logger.warn('Invalid cached registry', e, data)\n this.regInfoDB.delete(registry)\n }\n }\n return null\n }\n private async setRegistryCache(registry: string, data: PluginStoreRegistry) {\n return this.regInfoDB.set(registry, data)\n }\n private async deleteRegistryCache(registry: string) {\n await this.regInfoDB.delete(registry)\n this.ctx.emit('plugin-store/registry-removed', {\n ctx: this.ctx,\n registryUrl: registry,\n })\n }\n async clearAllRegistryCaches() {\n await this.regInfoDB.clear()\n this.ctx.logger.debug('All registry caches cleared')\n }\n\n /**\n * 刷新指定 registry 的缓存(重新从网络获取)\n */\n async refreshRegistryCache(registry: string): Promise<PluginStoreRegistry> {\n const data = await this.getRegistryInfo(registry, 'online_manifest', true)\n if (!data) {\n throw new Error(`Failed to refresh registry cache: ${registry}`)\n }\n this.ctx.logger.debug('Registry cache refreshed:', registry)\n return data\n }\n\n /**\n * 刷新所有已配置的 registry 缓存\n */\n async refreshAllRegistryCaches(): Promise<Record<string, PluginStoreRegistry | null>> {\n const registryUrls = (await this.ctx.preferences.get('pluginStore.registries')) || []\n const responses = await Promise.allSettled(\n registryUrls.map((url) => this.refreshRegistryCache(url))\n )\n const results: Record<string, PluginStoreRegistry | null> = {}\n for (const [index, response] of responses.entries()) {\n if (response.status === 'fulfilled') {\n results[registryUrls[index]] = response.value\n } else {\n results[registryUrls[index]] = null\n }\n }\n return results\n }\n}\n"],"names":["PLUGIN_STORE_REGISTRY_MANIFEST_VERSION","PluginStoreSchemas","Schema","_PluginPluginStore_decorators","_init","_a","tryGetGlobalPlugin","main_export","acc","key","resolveResourceUrl","resourcePath","baseUrl","registryUrl","ensureSlash","s","normalizedBase","registryAbs","resolvedBaseUrl","Inject","_PluginPluginStore","BasePlugin","ctx","now","year","storageKey","officialRegistry","Endpoints","pluginId","p","prefs","pref","PluginStoreApp","defineAsyncComponent","createVueAppWithIPE","$","onUnmount","container","jsx","app","modal","registry","id","source","_by","registryInfo","scope","fork","promise","disposed","pkg","loader","kind","entry","styles","entryUrl","e","datasets","apply","m","urls","u","data","noCache","info","payload","validated","registryUrls","responses","url","results","index","response","__decoratorStart","__decorateElement","__runInitializers","PluginPluginStore"],"mappings":";;;;AAEO,MAAMA,IAAyC;AAuC/C,IAAUC;AAAA,CAAV,CAAUA,MAAV;AACQA,EAAAA,EAAA,gBAAgB,IAAIC;AAAA,IAC/BA,EAAO,OAAO;AAAA,MACZ,MAAMA,EAAO,MAAM,CAAC,YAAY,UAAU,OAAO,QAAQ,CAAC,EAAE,WAAW,QAAQ,UAAU;AAAA,MACzF,OAAOA,EAAO,OAAA;AAAA,MACd,QAAQA,EAAO,MAAMA,EAAO,QAAQ;AAAA,MACpC,aAAaA,EAAO,OAAA;AAAA,IAAO,CAC5B;AAAA,EAAA,GAGUD,EAAA,UAAU,IAAIC;AAAA,IACzBA,EAAO,OAAO;AAAA,MACZ,IAAIA,EAAO,OAAA,EAAS,SAAA;AAAA,MACpB,MAAMA,EAAO,OAAA,EAAS,SAAA;AAAA,MACtB,SAASA,EAAO,OAAA,EAAS,SAAA;AAAA,MACzB,aAAaA,EAAO,OAAA;AAAA,MACpB,QAAQA,EAAO,OAAA;AAAA,MACf,SAASA,EAAO,OAAA;AAAA,MAChB,QAAQD,EAAA,cAAc,SAAA;AAAA,IAAS,CAChC;AAAA,EAAA,GAGUA,EAAA,qBAAqB,IAAIC;A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,WAAW,cACtBF,EAAQH,EAAaI,CAAK,CAAC,IAAIC,EAAS,QAExCF,EAAQH,EAAaI,CAAK,CAAC,IAAI;AAGnC,WAAOD;AAAA,EACT;AACF;AA1eOlE,IAAAqE,EAAApE,CAAA;AAAMe,IAANsD,6BADPvE,GACaiB,CAAA;AAANuD,EAAAvE,GAAA,GAAMgB,CAAA;AAAN,IAAMwD,IAANxD;"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { j as n, p as I } from "./Promise.withResolvers-C4chhLB1.js";
|
|
2
|
-
import { S as p, E as v, p as x, a as P } from "./index-
|
|
2
|
+
import { S as p, E as v, p as x, a as P } from "./index-CxckcdDI.js";
|
|
3
3
|
import { BasePlugin as U } from "./core.js";
|
|
4
4
|
var q = Object.create, f = Object.defineProperty, B = Object.getOwnPropertyDescriptor, b = (i, t) => (t = Symbol[i]) ? t : /* @__PURE__ */ Symbol.for("Symbol." + i), w = (i) => {
|
|
5
5
|
throw TypeError(i);
|
|
@@ -216,4 +216,4 @@ j(_, 1, m);
|
|
|
216
216
|
export {
|
|
217
217
|
m as PluginAnalytics
|
|
218
218
|
};
|
|
219
|
-
//# sourceMappingURL=index-
|
|
219
|
+
//# sourceMappingURL=index-BPZDprsy.js.map
|