@inpageedit/core 0.17.1 → 0.17.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (45) hide show
  1. package/dist/InPageEdit.js +1 -1
  2. package/dist/{PluginImagesUsed-D5O8t694.js → PluginImagesUsed-DWpe6M-r.js} +2 -2
  3. package/dist/{PluginImagesUsed-D5O8t694.js.map → PluginImagesUsed-DWpe6M-r.js.map} +1 -1
  4. package/dist/{PluginPrefSync-C8tb5SJJ.js → PluginPrefSync-CmVHL2wx.js} +2 -2
  5. package/dist/{PluginPrefSync-C8tb5SJJ.js.map → PluginPrefSync-CmVHL2wx.js.map} +1 -1
  6. package/dist/{PluginStoreApp-CeKtXL3p.js → PluginStoreApp-CmLstT3F.js} +2 -2
  7. package/dist/{PluginStoreApp-CeKtXL3p.js.map → PluginStoreApp-CmLstT3F.js.map} +1 -1
  8. package/dist/{PluginTemplatesUsed-DYv_lbHw.js → PluginTemplatesUsed-BjRYFXHz.js} +2 -2
  9. package/dist/{PluginTemplatesUsed-DYv_lbHw.js.map → PluginTemplatesUsed-BjRYFXHz.js.map} +1 -1
  10. package/dist/Promise.withResolvers-C4chhLB1.js.map +1 -1
  11. package/dist/core.js +2 -2
  12. package/dist/{index-h57rl1RH.js → index-BVMm7Dix.js} +2 -2
  13. package/dist/{index-h57rl1RH.js.map → index-BVMm7Dix.js.map} +1 -1
  14. package/dist/{index--IhZKYnh.js → index-BYgh1HkH.js} +2 -2
  15. package/dist/{index--IhZKYnh.js.map → index-BYgh1HkH.js.map} +1 -1
  16. package/dist/{index-DSh05RaI.js → index-BbvMbIgz.js} +3 -3
  17. package/dist/{index-DSh05RaI.js.map → index-BbvMbIgz.js.map} +1 -1
  18. package/dist/{index-Bf6ewNGZ.js → index-BlVSMvH-.js} +2 -2
  19. package/dist/{index-Bf6ewNGZ.js.map → index-BlVSMvH-.js.map} +1 -1
  20. package/dist/{index-qbW7-LUD.js → index-CUDVeUEv.js} +2 -2
  21. package/dist/{index-qbW7-LUD.js.map → index-CUDVeUEv.js.map} +1 -1
  22. package/dist/{index-CxjH0_fO.js → index-Ce-zc5RR.js} +2 -2
  23. package/dist/{index-CxjH0_fO.js.map → index-Ce-zc5RR.js.map} +1 -1
  24. package/dist/{index-Dp_n8QEV.js → index-CkSdNy0U.js} +2 -2
  25. package/dist/{index-Dp_n8QEV.js.map → index-CkSdNy0U.js.map} +1 -1
  26. package/dist/{index-QtXlz9l0.js → index-D-8cyCdX.js} +148 -125
  27. package/dist/index-D-8cyCdX.js.map +1 -0
  28. package/dist/{index-CaTtMzfu.js → index-DTU2DZU6.js} +14 -14
  29. package/dist/{index-CaTtMzfu.js.map → index-DTU2DZU6.js.map} +1 -1
  30. package/dist/{index-BuSA1t5R.js → index-Dfdy54gH.js} +2 -2
  31. package/dist/{index-BuSA1t5R.js.map → index-Dfdy54gH.js.map} +1 -1
  32. package/dist/{index-Mi3qr9J0.js → index-DvFkW8lL.js} +2 -2
  33. package/dist/{index-Mi3qr9J0.js.map → index-DvFkW8lL.js.map} +1 -1
  34. package/dist/{index-_Sydb5MZ.js → index-JvsrhizC.js} +3 -3
  35. package/dist/{index-_Sydb5MZ.js.map → index-JvsrhizC.js.map} +1 -1
  36. package/dist/{index-fa8d4Dv_.js → index-LvMaeDQn.js} +2 -2
  37. package/dist/{index-fa8d4Dv_.js.map → index-LvMaeDQn.js.map} +1 -1
  38. package/dist/index.d.ts +5858 -27237
  39. package/dist/index.js +2 -2
  40. package/dist/plugins/index.js +12 -12
  41. package/dist/services/index.js +1 -1
  42. package/lib/index.umd.js +11 -11
  43. package/lib/index.umd.js.map +1 -1
  44. package/package.json +2 -1
  45. 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 s, E as C, a as j } from "./index-CaTtMzfu.js";
3
- import { BasePlugin as L } from "./core.js";
4
- import { c as O, d as F } from "./vueHooks-Bs93iP61.js";
5
- const G = 1;
2
+ import { S as a, E as P, a as L } from "./index-DTU2DZU6.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
- ((n) => {
8
- n.PackageLoader = new s(
9
- s.object({
10
- kind: s.union(["autoload", "module", "umd", "styles"]).required().default("autoload"),
11
- entry: s.string(),
12
- styles: s.array(s.string()),
13
- main_export: s.string()
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
- ), n.Package = new s(
16
- s.object({
17
- id: s.string().required(),
18
- name: s.string().required(),
19
- version: s.string().required(),
20
- description: s.string(),
21
- author: s.string(),
22
- license: s.string(),
23
- loader: n.PackageLoader.required()
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
- ), n.RegistryMaintainer = new s(
26
- s.object({
27
- name: s.string().required(),
28
- email: s.string()
25
+ ), i.RegistryMaintainer = new a(
26
+ a.object({
27
+ name: a.string().required(),
28
+ email: a.string()
29
29
  })
30
- ), n.RegistryRepository = new s(
31
- s.object({
32
- type: s.string().required(),
33
- url: s.string().required()
30
+ ), i.RegistryRepository = new a(
31
+ a.object({
32
+ type: a.string().required(),
33
+ url: a.string().required()
34
34
  })
35
- ), n.Registry = new s(
36
- s.object({
37
- manifest_version: s.number().min(G).required(),
38
- name: s.string().required(),
39
- base_url: s.string().required(),
40
- homepage: s.string(),
41
- maintainers: s.array(n.RegistryMaintainer),
42
- repository: n.RegistryRepository,
43
- packages: s.array(n.Package).required()
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, q = Object.getOwnPropertyDescriptor, S = (n, e) => (e = Symbol[n]) ? e : /* @__PURE__ */ Symbol.for("Symbol." + n), b = (n) => {
48
- throw TypeError(n);
49
- }, B = (n, e, t) => e in n ? v(n, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[e] = t, N = (n, e) => v(n, "name", { value: e, configurable: !0 }), D = (n) => [, , , M(n?.[S("metadata")] ?? null)], U = ["class", "method", "getter", "setter", "accessor", "field", "value", "get", "set"], k = (n) => n !== void 0 && typeof n != "function" ? b("Function expected") : n, Y = (n, e, t, r, i) => ({ kind: U[n], name: e, metadata: r, addInitializer: (a) => t._ ? b("Already initialized") : i.push(k(a || null)) }), z = (n, e) => B(e, S("metadata"), n[3]), Q = (n, e, t, r) => {
50
- for (var i = 0, a = n[e >> 1], o = a && a.length; i < o; i++) a[i].call(t);
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 = (n, e, t, r, i, a) => {
53
- var o, d, c, p = e & 7, f = !1, u = 0, y = n[u] || (n[u] = []), h = p && (i = i.prototype, p < 5 && (p > 3 || !f) && q(i, t));
54
- N(i, t);
52
+ }, H = (i, e, t, r, n, s) => {
53
+ var o, d, 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, d = {}, n[3], y), o = (0, r[l])(i, c), d._ = 1, k(o) && (i = o);
57
- return z(n, i), h && v(i, t, h), f ? p ^ 4 ? a : h : i;
58
- }, A, I, T;
59
- const P = (n) => {
60
- if (!n) return null;
56
+ c = Y(p, t, d = {}, i[3], y), o = (0, r[l])(n, c), d._ = 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 n.split(".").reduce((e, t) => e == null ? e : e[t], globalThis);
62
+ return i.split(".").reduce((e, t) => e == null ? e : e[t], globalThis);
63
63
  } catch {
64
64
  return null;
65
65
  }
66
- }, E = (n, e, t) => {
67
- if (/^https?:\/\//i.test(n)) return n;
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(n, o).href;
71
+ return new URL(i, o).href;
72
72
  }
73
- const i = (() => {
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
- })(), a = new URL(r(e), i).href;
80
- return new URL(n, a).href;
79
+ })(), s = new URL(r(e), n).href;
80
+ return new URL(i, s).href;
81
81
  };
82
- A = [j(["storage", "preferences", "resourceLoader", "$"])];
83
- let w = class x extends (T = L) {
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,29 @@ 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
+ await this.installAndSetPreference(
121
+ n,
122
+ s,
123
+ "online_manifest",
124
+ "new-added"
125
+ ) ? this.logger.info(`🎉 April Fool! Auto-installing ${s}`) : this.logger.debug("No april fool plugin found in the official registry");
126
+ } catch {
127
+ }
106
128
  }
107
129
  async _installUserPlugins() {
108
130
  const e = await this.ctx.preferences.get("pluginStore.plugins", []);
@@ -111,8 +133,8 @@ let w = class x extends (T = L) {
111
133
  this.install(t.registry, t.id, t.source, "user-preference");
112
134
  }
113
135
  async _createManagementApp() {
114
- const e = await this.ctx.withInject(["store"]), t = F(() => import("./PluginStoreApp-CeKtXL3p.js"));
115
- return O(e, t);
136
+ const e = await this.ctx.withInject(["store"]), t = G(() => import("./PluginStoreApp-CmLstT3F.js"));
137
+ return j(e, t);
116
138
  }
117
139
  async _injectPreferenceUI() {
118
140
  const e = this.ctx, t = e.$;
@@ -123,23 +145,23 @@ let w = class x extends (T = L) {
123
145
  index: 90,
124
146
  autoGenerateForm: !1,
125
147
  customRenderer: async ({ onUnmount: r }) => {
126
- const i = /* @__PURE__ */ R("div", { id: "ipe-plugin-store-preferences-vue" }), a = await this._createManagementApp();
127
- return a.mount(i), r(() => {
128
- a.unmount(), this.ctx.logger.debug("Plugin Store preferences app unmounted");
129
- }), /* @__PURE__ */ R("section", { children: i });
148
+ const n = /* @__PURE__ */ R("div", { id: "ipe-plugin-store-preferences-vue" }), s = await this._createManagementApp();
149
+ return s.mount(n), r(() => {
150
+ s.unmount(), this.ctx.logger.debug("Plugin Store preferences app unmounted");
151
+ }), /* @__PURE__ */ R("section", { children: n });
130
152
  }
131
153
  }), e.preferences.registerCustomConfig(
132
154
  "plugin-store",
133
- s.object({
134
- "pluginStore.registries": s.array(s.string()).default([
135
- C.PLUGIN_REGISTRY_URL
155
+ a.object({
156
+ "pluginStore.registries": a.array(a.string()).default([
157
+ P.PLUGIN_REGISTRY_URL
136
158
  ]).description(t`Registry URLs`).hidden(),
137
- "pluginStore.cdnForNpm": s.string().description(t`CDN to install packages from npm`).default('https://cdn.jsdelivr.net/npm/{{ package }}{{ version ? "@" + version : "" }}').hidden(),
138
- "pluginStore.plugins": s.array(
139
- s.object({
140
- source: s.union(["online_manifest", "npm"]).default("online_manifest"),
141
- registry: s.string().required(),
142
- id: s.string().required()
159
+ "pluginStore.cdnForNpm": a.string().description(t`CDN to install packages from npm`).default('https://cdn.jsdelivr.net/npm/{{ package }}{{ version ? "@" + version : "" }}').hidden(),
160
+ "pluginStore.plugins": a.array(
161
+ a.object({
162
+ source: a.union(["online_manifest", "npm"]).default("online_manifest"),
163
+ registry: a.string().required(),
164
+ id: a.string().required()
143
165
  })
144
166
  ).description(t`Installed plugins`).default([]).hidden()
145
167
  }),
@@ -157,21 +179,21 @@ let w = class x extends (T = L) {
157
179
  r.unmount();
158
180
  }), e;
159
181
  }
160
- async install(e, t, r = "online_manifest", i = "new-added") {
161
- const a = await this.getRegistryInfo(e, r);
162
- if (!a)
182
+ async install(e, t, r = "online_manifest", n = "new-added") {
183
+ const s = await this.getRegistryInfo(e, r);
184
+ if (!s)
163
185
  return this.ctx.logger.warn(`Registry ${e} not found`), null;
164
186
  const o = `${e}#${t}`;
165
187
  if (this._installedPlugins.has(o))
166
188
  return await this._installedPlugins.get(o) ?? null;
167
- const d = this._installOneByRegistryInfo(e, a, t);
189
+ const d = this._installOneByRegistryInfo(e, s, t);
168
190
  this._installedPlugins.set(o, d);
169
191
  const c = await d;
170
192
  return c && this.ctx.emit("plugin-store/plugin-installed", {
171
193
  ctx: this.ctx,
172
- registry: a,
194
+ registry: s,
173
195
  id: t,
174
- by: i
196
+ by: n
175
197
  }), c;
176
198
  }
177
199
  async uninstall(e, t) {
@@ -179,9 +201,9 @@ let w = class x extends (T = L) {
179
201
  if (r === void 0)
180
202
  return !0;
181
203
  this._installedPlugins.delete(`${e}#${t}`);
182
- const i = await r;
183
- if (i) {
184
- const a = i.dispose?.() ?? !0;
204
+ const n = await r;
205
+ if (n) {
206
+ const s = n.dispose?.() ?? !0;
185
207
  try {
186
208
  const o = await this.getRegistryCache(e) || await this.getRegistryInfo(e).catch(() => null);
187
209
  o && this.ctx.emit("plugin-store/plugin-uninstalled", {
@@ -191,39 +213,40 @@ let w = class x extends (T = L) {
191
213
  });
192
214
  } catch {
193
215
  }
194
- return a;
216
+ return s;
195
217
  }
196
218
  return !0;
197
219
  }
198
220
  async addToPreferences(e, t) {
199
221
  let r = await this.ctx.preferences.get("pluginStore.plugins") || [];
200
- return r.some((a) => a.registry === e && a.id === t) || (r.push({ registry: e, id: t }), await this.ctx.preferences.set("pluginStore.plugins", r)), !0;
222
+ 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
223
  }
202
224
  async removeFromPreferences(e, t) {
203
225
  let r = await this.ctx.preferences.get("pluginStore.plugins") || [];
204
- return r = r.filter((i) => i.registry !== e || i.id !== t), await this.ctx.preferences.set("pluginStore.plugins", r), !0;
226
+ return r = r.filter((n) => n.registry !== e || n.id !== t), await this.ctx.preferences.set("pluginStore.plugins", r), !0;
205
227
  }
206
- async installAndSetPreference(e, t) {
207
- return await this.addToPreferences(e, t), this.install(e, t, "online_manifest", "new-added");
228
+ async installAndSetPreference(e, t, r = "online_manifest", n = "new-added") {
229
+ const s = await this.install(e, t, r, n);
230
+ return s && await this.addToPreferences(e, t), s;
208
231
  }
209
232
  async uninstallAndRemovePreference(e, t) {
210
233
  return await this.removeFromPreferences(e, t), this.uninstall(e, t);
211
234
  }
212
235
  // 3) 增加 registryUrl 参数
213
236
  async _installOneByRegistryInfo(e, t, r) {
214
- const i = t.base_url, a = t.packages.find((l) => l.id === r);
215
- if (!a)
237
+ const n = t.base_url, s = t.packages.find((l) => l.id === r);
238
+ if (!s)
216
239
  return this.ctx.logger.warn(`Package ${r} not found in registry ${e}`), null;
217
- const o = a.loader, { kind: d, entry: c = "index.js", styles: p = [], main_export: f = null } = o;
240
+ const o = s.loader, { kind: d, entry: c = "index.js", styles: p = [], main_export: h = null } = o;
218
241
  let u = null;
219
242
  if (d !== "styles") {
220
243
  if (!c)
221
244
  return this.ctx.logger.warn(`Entry url missing for ${r}`, o), null;
222
245
  try {
223
- u = E(c, i, e);
246
+ u = E(c, n, e);
224
247
  } catch (l) {
225
248
  return this.ctx.logger.warn(
226
- `Failed to resolve entry "${c}" with base "${i}" and registry "${e}"`,
249
+ `Failed to resolve entry "${c}" with base "${n}" and registry "${e}"`,
227
250
  l
228
251
  ), null;
229
252
  }
@@ -232,10 +255,10 @@ let w = class x extends (T = L) {
232
255
  "data-plugin-registry": e,
233
256
  "data-plugin-id": r
234
257
  };
235
- let h = null;
258
+ let f = null;
236
259
  switch (d) {
237
260
  case "autoload": {
238
- h = this.ctx.plugin({
261
+ f = this.ctx.plugin({
239
262
  inject: ["resourceLoader"],
240
263
  name: `plugin-store-${e}-${r}`,
241
264
  apply: (l) => {
@@ -251,37 +274,37 @@ let w = class x extends (T = L) {
251
274
  /* @vite-ignore */
252
275
  u
253
276
  ).then(
254
- (g) => (f ? g[f] : g.default) ?? g
277
+ (g) => (h ? g[h] : g.default) ?? g
255
278
  );
256
279
  if (!l)
257
- return this.ctx.logger.warn(`Main export ${f} not found in module ${u}`), null;
258
- h = this.ctx.plugin(l);
280
+ return this.ctx.logger.warn(`Main export ${h} not found in module ${u}`), null;
281
+ f = this.ctx.plugin(l);
259
282
  break;
260
283
  }
261
284
  case "umd": {
262
- let l = P(f);
285
+ let l = S(h);
263
286
  if (!l) {
264
287
  if (!u)
265
288
  return this.ctx.logger.warn(`Entry url missing for umd kind, package ${r}`), null;
266
- await this.ctx.resourceLoader.loadScript(u, { ...y }), l = P(f);
289
+ await this.ctx.resourceLoader.loadScript(u, { ...y }), l = S(h);
267
290
  }
268
291
  if (!l)
269
292
  return this.ctx.logger.warn(
270
- `Main export ${f} not found on globalThis after loading ${u}`
293
+ `Main export ${h} not found on globalThis after loading ${u}`
271
294
  ), null;
272
- h = this.ctx.plugin(l);
295
+ f = this.ctx.plugin(l);
273
296
  break;
274
297
  }
275
298
  }
276
299
  if (p && p.length > 0) {
277
300
  let l = [];
278
301
  try {
279
- l = p.map((g) => E(g, i, e)).filter(Boolean);
302
+ l = p.map((g) => E(g, n, e)).filter(Boolean);
280
303
  } catch (g) {
281
304
  this.ctx.logger.warn(`Failed to resolve styles for ${r}`, p, g);
282
305
  }
283
- h ||= this.ctx.plugin({ name: `plugin-store-${e}-${r}`, apply() {
284
- } }), h.ctx.plugin({
306
+ f ||= this.ctx.plugin({ name: `plugin-store-${e}-${r}`, apply() {
307
+ } }), f.ctx.plugin({
285
308
  inject: ["resourceLoader"],
286
309
  name: `plugin-store-${e}-${r}-styles`,
287
310
  apply: (g) => {
@@ -294,45 +317,45 @@ let w = class x extends (T = L) {
294
317
  }
295
318
  });
296
319
  }
297
- return h;
320
+ return f;
298
321
  }
299
322
  validateRegistry(e) {
300
323
  return m.Registry(e);
301
324
  }
302
325
  async getRegistryInfo(e, t = "online_manifest", r = !1) {
303
326
  try {
304
- let a;
327
+ let s;
305
328
  if (t === "online_manifest")
306
- a = await this._fetchOnlineRegistryInfo(e, r), this.logger.debug("Fetched registry info from online manifest", a), this.setRegistryCache(e, a);
329
+ s = await this._fetchOnlineRegistryInfo(e, r), this.logger.debug("Fetched registry info from online manifest", s), this.setRegistryCache(e, s);
307
330
  else
308
331
  throw new Error(`Unsupported registry source: ${t}`);
309
- return a;
310
- } catch (a) {
311
- this.ctx.logger.warn("Failed to fetch registry info", a);
332
+ return s;
333
+ } catch (s) {
334
+ this.ctx.logger.warn("Failed to fetch registry info", s);
312
335
  }
313
- const i = await this.getRegistryCache(e);
314
- if (!i)
336
+ const n = await this.getRegistryCache(e);
337
+ if (!n)
315
338
  throw this.ctx.emit("plugin-store/registry-not-found", {
316
339
  ctx: this.ctx,
317
340
  registryUrl: e
318
341
  }), new Error(`Failed to fetch registry info: ${e}`);
319
- return i;
342
+ return n;
320
343
  }
321
344
  async _fetchOnlineRegistryInfo(e, t = !1) {
322
345
  if (!t && this._onlineRegistryQueries.has(e))
323
346
  return await this._onlineRegistryQueries.get(e);
324
- const i = (async () => {
325
- const a = {
347
+ const n = (async () => {
348
+ const s = {
326
349
  method: "GET"
327
350
  };
328
- t && (a.cache = "no-store");
329
- const d = await (await fetch(e, a)).json(), c = this.validateRegistry(d);
351
+ t && (s.cache = "no-store");
352
+ const d = await (await fetch(e, s)).json(), c = this.validateRegistry(d);
330
353
  return this.ctx.emit("plugin-store/registry-fetched", {
331
354
  ctx: this.ctx,
332
355
  registry: c
333
356
  }), c;
334
357
  })();
335
- return this._onlineRegistryQueries.set(e, i), await i;
358
+ return this._onlineRegistryQueries.set(e, n), await n;
336
359
  }
337
360
  async getRegistryCache(e) {
338
361
  const t = await this.regInfoDB.get(e);
@@ -370,18 +393,18 @@ let w = class x extends (T = L) {
370
393
  */
371
394
  async refreshAllRegistryCaches() {
372
395
  const e = await this.ctx.preferences.get("pluginStore.registries") || [], t = await Promise.allSettled(
373
- e.map((i) => this.refreshRegistryCache(i))
396
+ e.map((n) => this.refreshRegistryCache(n))
374
397
  ), r = {};
375
- for (const [i, a] of t.entries())
376
- a.status === "fulfilled" ? r[e[i]] = a.value : r[e[i]] = null;
398
+ for (const [n, s] of t.entries())
399
+ s.status === "fulfilled" ? r[e[n]] = s.value : r[e[n]] = null;
377
400
  return r;
378
401
  }
379
402
  };
380
- I = D(T);
381
- w = H(I, 0, "PluginPluginStore", A, w);
403
+ I = D(C);
404
+ w = H(I, 0, "PluginPluginStore", T, w);
382
405
  Q(I, 1, w);
383
406
  let X = w;
384
407
  export {
385
408
  X as PluginPluginStore
386
409
  };
387
- //# sourceMappingURL=index-QtXlz9l0.js.map
410
+ //# sourceMappingURL=index-D-8cyCdX.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index-D-8cyCdX.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 fork = await this.installAndSetPreference(\n officialRegistry,\n pluginId,\n 'online_manifest',\n 'new-added'\n )\n\n if (fork) {\n this.logger.info(`🎉 April Fool! Auto-installing ${pluginId}`)\n } else {\n this.logger.debug('No april fool plugin found in the official registry')\n }\n } catch (e) {\n // Silent fail — not critical\n console.error('Failed to auto-install april fool plugin', e)\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(\n registry: string,\n id: string,\n source: PluginStoreRegistrySource = 'online_manifest',\n by: 'new-added' | 'user-preference' = 'new-added'\n ) {\n const fork = await this.install(registry, id, source, by)\n if (fork) {\n await this.addToPreferences(registry, id)\n }\n return fork\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","prefs","pref","PluginStoreApp","defineAsyncComponent","createVueAppWithIPE","$","onUnmount","container","jsx","app","modal","registry","id","source","_by","registryInfo","scope","fork","promise","disposed","p","by","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,MAC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AM,qBAAqBA,GAAgD;AACzE,UAAMuB,IAAO,MAAM,KAAK,gBAAgBvB,GAAU,mBAAmB,EAAI;AACzE,QAAI,CAACuB;AACH,YAAM,IAAI,MAAM,qCAAqCvB,CAAQ,EAAE;AAEjE,gBAAK,IAAI,OAAO,MAAM,6BAA6BA,CAAQ,GACpDuB;AAAA,EACT;AAAA;AAAA;AAAA;AAAA,EAKA,MAAM,2BAAgF;AACpF,UAAMK,IAAgB,MAAM,KAAK,IAAI,YAAY,IAAI,wBAAwB,KAAM,CAAA,GAC7EC,IAAY,MAAM,QAAQ;AAAA,MAC9BD,EAAa,IAAI,CAACE,MAAQ,KAAK,qBAAqBA,CAAG,CAAC;AAAA,IAAA,GAEpDC,IAAsD,CAAA;AAC5D,eAAW,CAACC,GAAOC,CAAQ,KAAKJ,EAAU;AACxC,MAAII,EAAS,WAAW,cACtBF,EAAQH,EAAaI,CAAK,CAAC,IAAIC,EAAS,QAExCF,EAAQH,EAAaI,CAAK,CAAC,IAAI;AAGnC,WAAOD;AAAA,EACT;AACF;AAzfOnE,IAAAsE,EAAArE,CAAA;AAAMe,IAANuD,6BADPxE,GACaiB,CAAA;AAANwD,EAAAxE,GAAA,GAAMgB,CAAA;AAAN,IAAMyD,IAANzD;"}
@@ -4894,7 +4894,7 @@ class ve extends M {
4894
4894
  constructor(e) {
4895
4895
  super({
4896
4896
  name: "InPageEdit"
4897
- }), this.version = "0.17.1", this.Endpoints = rt, this.schema = $, this.config = Ci(ve.DEFAULT_CONFIG, e), this.logger = lr({
4897
+ }), this.version = "0.17.3", this.Endpoints = rt, this.schema = $, this.config = Ci(ve.DEFAULT_CONFIG, e), this.logger = lr({
4898
4898
  name: "IPE",
4899
4899
  color: "#33aaff",
4900
4900
  level: this.config.logLevel
@@ -4945,26 +4945,26 @@ class ve extends M {
4945
4945
  // TODO: 这里不应该硬编码,暂时先这样
4946
4946
  async #e() {
4947
4947
  [
4948
- import("./index-Dp_n8QEV.js").then(({ PluginAnalytics: t }) => t),
4949
- import("./index-CxjH0_fO.js").then(
4948
+ import("./index-CkSdNy0U.js").then(({ PluginAnalytics: t }) => t),
4949
+ import("./index-Ce-zc5RR.js").then(
4950
4950
  ({ PluginInArticleLinks: t }) => t
4951
4951
  ),
4952
- import("./index-QtXlz9l0.js").then(({ PluginPluginStore: t }) => t),
4953
- import("./index-_Sydb5MZ.js").then(
4952
+ import("./index-D-8cyCdX.js").then(({ PluginPluginStore: t }) => t),
4953
+ import("./index-JvsrhizC.js").then(
4954
4954
  ({ PluginPreferencesUI: t }) => t
4955
4955
  ),
4956
- import("./index-h57rl1RH.js").then(({ PluginQuickEdit: t }) => t),
4957
- import("./index-fa8d4Dv_.js").then(({ PluginQuickMove: t }) => t),
4958
- import("./index-qbW7-LUD.js").then(
4956
+ import("./index-BVMm7Dix.js").then(({ PluginQuickEdit: t }) => t),
4957
+ import("./index-LvMaeDQn.js").then(({ PluginQuickMove: t }) => t),
4958
+ import("./index-CUDVeUEv.js").then(
4959
4959
  ({ PluginQuickPreview: t }) => t
4960
4960
  ),
4961
- import("./index--IhZKYnh.js").then(({ PluginQuickDiff: t }) => t),
4962
- import("./index-BuSA1t5R.js").then(
4961
+ import("./index-BYgh1HkH.js").then(({ PluginQuickDiff: t }) => t),
4962
+ import("./index-Dfdy54gH.js").then(
4963
4963
  ({ PluginQuickRedirect: t }) => t
4964
4964
  ),
4965
- import("./index-Bf6ewNGZ.js").then(({ PluginQuickUpload: t }) => t),
4966
- import("./index-DSh05RaI.js").then(({ PluginQuickUsage: t }) => t),
4967
- import("./index-Mi3qr9J0.js").then(({ PluginToolbox: t }) => t)
4965
+ import("./index-BlVSMvH-.js").then(({ PluginQuickUpload: t }) => t),
4966
+ import("./index-BbvMbIgz.js").then(({ PluginQuickUsage: t }) => t),
4967
+ import("./index-DvFkW8lL.js").then(({ PluginToolbox: t }) => t)
4968
4968
  ].forEach(async (t) => {
4969
4969
  this.plugin(await t);
4970
4970
  });
@@ -5021,4 +5021,4 @@ export {
5021
5021
  Sn as v,
5022
5022
  et as w
5023
5023
  };
5024
- //# sourceMappingURL=index-CaTtMzfu.js.map
5024
+ //# sourceMappingURL=index-DTU2DZU6.js.map