@inpageedit/core 0.11.1 → 0.12.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.
Files changed (102) hide show
  1. package/LICENSE +20 -20
  2. package/dist/ActionButton-CRjo_l3y.js +24 -0
  3. package/dist/ActionButton-CRjo_l3y.js.map +1 -0
  4. package/dist/{CheckBox-D3rHnX7I.js → CheckBox-Bc79KBEB.js} +2 -2
  5. package/dist/{CheckBox-D3rHnX7I.js.map → CheckBox-Bc79KBEB.js.map} +1 -1
  6. package/dist/{IconQuickEdit-CAL1HXIb.js → IconQuickEdit-CMCQncyj.js} +2 -2
  7. package/dist/IconQuickEdit-CMCQncyj.js.map +1 -0
  8. package/dist/InPageEdit.d.ts +5 -1
  9. package/dist/{InputBox-BV4m05Xs.js → InputBox-DZAdyZ4B.js} +2 -2
  10. package/dist/InputBox-DZAdyZ4B.js.map +1 -0
  11. package/dist/PluginPrefSync-BPQkNtX8.js +292 -0
  12. package/dist/PluginPrefSync-BPQkNtX8.js.map +1 -0
  13. package/dist/PluginStoreApp-Cxspe6t8.js +158 -0
  14. package/dist/PluginStoreApp-Cxspe6t8.js.map +1 -0
  15. package/dist/Preferences-DS4-CFWe.js.map +1 -1
  16. package/dist/{RadioBox-nJqWsxW2.js → RadioBox-0UuxlcWZ.js} +2 -2
  17. package/dist/{RadioBox-nJqWsxW2.js.map → RadioBox-0UuxlcWZ.js.map} +1 -1
  18. package/dist/_plugin-vue_export-helper-CHgC5LLL.js +10 -0
  19. package/dist/_plugin-vue_export-helper-CHgC5LLL.js.map +1 -0
  20. package/dist/components/index.js +51 -69
  21. package/dist/components/index.js.map +1 -1
  22. package/dist/constants/endpoints.d.ts +2 -1
  23. package/dist/index-B5DtUqkK.js +180 -0
  24. package/dist/index-B5DtUqkK.js.map +1 -0
  25. package/dist/{index-BUI2IX49.js → index-BXaiDKnr.js} +2312 -2315
  26. package/dist/index-BXaiDKnr.js.map +1 -0
  27. package/dist/{index-BNDyaWnI.js → index-Bv7Dw5eO.js} +10 -9
  28. package/dist/index-Bv7Dw5eO.js.map +1 -0
  29. package/dist/{index-MhNAv9Vf.js → index-CB7TltEb.js} +25 -30
  30. package/dist/index-CB7TltEb.js.map +1 -0
  31. package/dist/{index-lZkYoUca.js → index-CG38LlAh.js} +2 -2
  32. package/dist/index-CG38LlAh.js.map +1 -0
  33. package/dist/{index-BQzuJxBO.js → index-CJFePavo.js} +4 -4
  34. package/dist/index-CJFePavo.js.map +1 -0
  35. package/dist/{index-CvhkVj_L.js → index-CM_6yF2v.js} +3 -3
  36. package/dist/{index-CvhkVj_L.js.map → index-CM_6yF2v.js.map} +1 -1
  37. package/dist/{index-U2RPZk8N.js → index-CPoUaSMw.js} +8 -8
  38. package/dist/index-CPoUaSMw.js.map +1 -0
  39. package/dist/{index-CfgnJ51A.js → index-CYc6LH26.js} +53 -43
  40. package/dist/index-CYc6LH26.js.map +1 -0
  41. package/dist/index-CZXxH2-9.js +173 -0
  42. package/dist/index-CZXxH2-9.js.map +1 -0
  43. package/dist/{index-D5J7RU5I.js → index-Ckozkp6W.js} +5 -7
  44. package/dist/index-Ckozkp6W.js.map +1 -0
  45. package/dist/{index-etJXONAj.js → index-D4uwfUZL.js} +6 -6
  46. package/dist/index-D4uwfUZL.js.map +1 -0
  47. package/dist/{index-Bh70Udzi.js → index-DD5CVCfD.js} +2 -2
  48. package/dist/index-DD5CVCfD.js.map +1 -0
  49. package/dist/index-DEav9Ptt.js +365 -0
  50. package/dist/index-DEav9Ptt.js.map +1 -0
  51. package/dist/index-hSl8LzNb.js +1169 -0
  52. package/dist/index-hSl8LzNb.js.map +1 -0
  53. package/dist/index.js +1 -1
  54. package/dist/makeCallable-LDU0xZMJ.js.map +1 -1
  55. package/dist/models/MemoryStorage.d.ts +10 -0
  56. package/dist/models/WikiPage/index.d.ts +14 -0
  57. package/dist/noop-ClDc6zv4.js.map +1 -1
  58. package/dist/plugins/in-article-links/index.d.ts +5 -0
  59. package/dist/plugins/plugin-store/index.d.ts +59 -0
  60. package/dist/plugins/plugin-store/schema.d.ts +41 -0
  61. package/dist/plugins/preferences-ui/PluginPrefSync.d.ts +1 -0
  62. package/dist/plugins/preferences-ui/index.d.ts +34 -5
  63. package/dist/plugins/quick-delete/index.d.ts +3 -0
  64. package/dist/plugins/quick-diff/index.d.ts +3 -0
  65. package/dist/plugins/quick-edit/index.d.ts +8 -0
  66. package/dist/plugins/quick-move/index.d.ts +5 -3
  67. package/dist/plugins/quick-preview/index.d.ts +4 -0
  68. package/dist/plugins/quick-redirect/index.d.ts +11 -4
  69. package/dist/plugins/toolbox/index.d.ts +3 -0
  70. package/dist/services/PreferencesService.d.ts +53 -11
  71. package/dist/services/ResourceLoaderService.d.ts +3 -0
  72. package/dist/services/WikiMetadataService.d.ts +1 -1
  73. package/dist/services/storage/index.d.ts +18 -8
  74. package/dist/services/storage/{IPEStorageManager.d.ts → managers/IDBStorageManager.d.ts} +9 -6
  75. package/dist/services/storage/managers/LocalStorageManager.d.ts +27 -0
  76. package/dist/style.css +1 -1
  77. package/dist/vueHooks-D0uVqbO-.js +4032 -0
  78. package/dist/vueHooks-D0uVqbO-.js.map +1 -0
  79. package/lib/index.umd.js +11 -115
  80. package/lib/index.umd.js.map +1 -1
  81. package/lib/style.css +1 -1
  82. package/package.json +14 -14
  83. package/dist/IconQuickEdit-CAL1HXIb.js.map +0 -1
  84. package/dist/InputBox-BV4m05Xs.js.map +0 -1
  85. package/dist/PluginPrefSync-COidewzp.js +0 -258
  86. package/dist/PluginPrefSync-COidewzp.js.map +0 -1
  87. package/dist/index-BNDyaWnI.js.map +0 -1
  88. package/dist/index-BQzuJxBO.js.map +0 -1
  89. package/dist/index-BUI2IX49.js.map +0 -1
  90. package/dist/index-Bh70Udzi.js.map +0 -1
  91. package/dist/index-CBszdxJJ.js +0 -159
  92. package/dist/index-CBszdxJJ.js.map +0 -1
  93. package/dist/index-CfgnJ51A.js.map +0 -1
  94. package/dist/index-Cx4qgCJK.js +0 -4914
  95. package/dist/index-Cx4qgCJK.js.map +0 -1
  96. package/dist/index-D5J7RU5I.js.map +0 -1
  97. package/dist/index-MhNAv9Vf.js.map +0 -1
  98. package/dist/index-U2RPZk8N.js.map +0 -1
  99. package/dist/index-VnRKIVau.js +0 -167
  100. package/dist/index-VnRKIVau.js.map +0 -1
  101. package/dist/index-etJXONAj.js.map +0 -1
  102. package/dist/index-lZkYoUca.js.map +0 -1
@@ -0,0 +1,158 @@
1
+ import { a as R, k as $, r as h, f as y, l as L, g as I, e as a, h as n, q as r, C as U, D as A, y as _, z as i, F as B, x as D, v as u } from "./vueHooks-D0uVqbO-.js";
2
+ import { _ as F } from "./_plugin-vue_export-helper-CHgC5LLL.js";
3
+ const M = { id: "ipe-plugin-store-app" }, N = { class: "sotre-header" }, V = { class: "store-search-wrapper" }, q = ["disabled"], z = ["disabled"], E = { class: "refresh-text" }, H = {
4
+ key: 0,
5
+ class: "store-loading"
6
+ }, T = {
7
+ key: 1,
8
+ class: "store-plugins"
9
+ }, j = { class: "plugin-info" }, G = { class: "plugin-header" }, J = { class: "name" }, K = {
10
+ key: 0,
11
+ class: "status-badge"
12
+ }, O = ["href"], Q = { class: "plugin-id" }, W = {
13
+ key: 0,
14
+ class: "plugin-desc"
15
+ }, X = { class: "plugin-meta" }, Y = {
16
+ key: 0,
17
+ class: "version"
18
+ }, Z = {
19
+ key: 1,
20
+ class: "author"
21
+ }, ee = {
22
+ key: 2,
23
+ class: "license"
24
+ }, se = ["onClick"], te = {
25
+ key: 2,
26
+ class: "plugin-empty"
27
+ }, re = /* @__PURE__ */ R({
28
+ __name: "PluginStoreApp",
29
+ setup(ae) {
30
+ const o = $(), c = h([]), v = h([]), f = h(""), l = h(!1);
31
+ y(async () => {
32
+ await m();
33
+ });
34
+ const m = async () => {
35
+ const t = await o.store.ctx.preferences.get("pluginStore.registries") || [], s = await Promise.allSettled(
36
+ t.map(async (e) => ({ ...await o.store.getRegistryInfo(e), registryUrl: e }))
37
+ );
38
+ c.value = s.filter((e) => e.status === "fulfilled").map((e) => e.value);
39
+ }, d = (t, s) => v.value.includes(`${t}:${s}`), k = (t) => {
40
+ try {
41
+ return new URL(t).hostname;
42
+ } catch {
43
+ return t;
44
+ }
45
+ }, p = L(() => {
46
+ const t = c.value.flatMap(
47
+ (e) => (e.packages || []).map((g) => ({
48
+ ...g,
49
+ registry: e.registryUrl,
50
+ // 使用完整的 registry URL (index.json 地址)
51
+ registryHomepage: e.homepage
52
+ }))
53
+ );
54
+ if (!f.value.trim()) return t;
55
+ const s = f.value.toLowerCase();
56
+ return t.filter((e) => e.name?.toLowerCase().includes(s) || e.id?.toLowerCase().includes(s) || e.description?.toLowerCase().includes(s) || e.author?.toLowerCase().includes(s));
57
+ }), w = async (t, s) => {
58
+ o.store.installAndSetPreference(t, s);
59
+ }, C = async (t, s) => {
60
+ o.store.uninstallAndRemovePreference(t, s);
61
+ }, P = (t, s) => {
62
+ d(t, s) ? C(t, s) : w(t, s);
63
+ }, x = async () => {
64
+ if (!l.value) {
65
+ l.value = !0;
66
+ try {
67
+ const t = await o.store.ctx.preferences.get("pluginStore.registries") || [], s = await Promise.allSettled(
68
+ t.map(async (e) => ({ ...await o.store.refreshRegistryCache(e), registryUrl: e }))
69
+ );
70
+ c.value = s.filter((e) => e.status === "fulfilled").map((e) => e.value), o.modal.notify("success", {
71
+ content: `${t.length} registries refreshed successfully`
72
+ });
73
+ } catch {
74
+ o.modal.notify("error", {
75
+ content: "Failed to refresh registries"
76
+ });
77
+ } finally {
78
+ setTimeout(() => {
79
+ l.value = !1;
80
+ }, 3e3);
81
+ }
82
+ }
83
+ }, b = async () => {
84
+ const t = await o.store.ctx.preferences.get("pluginStore.plugins") || [];
85
+ v.value = t.map((s) => `${s.registry}:${s.id}`);
86
+ };
87
+ function S(t) {
88
+ const s = t.changes["pluginStore.plugins"];
89
+ s && Array.isArray(s) && (v.value = s.map((e) => `${e.registry}:${e.id}`));
90
+ }
91
+ return y(() => {
92
+ b(), o.on("preferences/changed", S);
93
+ }), y(() => {
94
+ }), I(() => {
95
+ }), (t, s) => (n(), a("div", M, [
96
+ r("div", N, [
97
+ r("div", V, [
98
+ U(r("input", {
99
+ class: "store-search-input",
100
+ "onUpdate:modelValue": s[0] || (s[0] = (e) => f.value = e),
101
+ type: "text",
102
+ placeholder: "Search plugins...",
103
+ disabled: c.value.length === 0
104
+ }, null, 8, q), [
105
+ [A, f.value]
106
+ ]),
107
+ s[1] || (s[1] = r("div", { class: "store-search-icon" }, "🔍", -1))
108
+ ]),
109
+ r("button", {
110
+ class: _(["store-refresh-btn", { refreshing: l.value }]),
111
+ onClick: x,
112
+ disabled: l.value
113
+ }, [
114
+ r("span", E, i(l.value ? "Refreshing..." : "Refresh"), 1)
115
+ ], 10, z)
116
+ ]),
117
+ c.value.length === 0 ? (n(), a("div", H, [...s[2] || (s[2] = [
118
+ r("div", { class: "loading-spinner" }, null, -1),
119
+ r("div", { class: "loading-text" }, "Loading...", -1)
120
+ ])])) : p.value.length > 0 ? (n(), a("div", T, [
121
+ (n(!0), a(B, null, D(p.value, (e) => (n(), a("div", {
122
+ class: _(["plugin-item", { installed: d(e.registry, e.id) }]),
123
+ key: `${e.registry}:${e.id}`
124
+ }, [
125
+ r("div", j, [
126
+ r("div", G, [
127
+ r("div", J, i(e.name), 1),
128
+ d(e.registry, e.id) ? (n(), a("div", K, "✓")) : u("", !0)
129
+ ]),
130
+ r("a", {
131
+ class: "registry-tag",
132
+ href: e.registryHomepage,
133
+ target: "_blank"
134
+ }, i(k(e.registry)), 9, O),
135
+ r("div", Q, i(e.id), 1),
136
+ e.description ? (n(), a("div", W, i(e.description), 1)) : u("", !0),
137
+ r("div", X, [
138
+ e.version ? (n(), a("span", Y, "v" + i(e.version), 1)) : u("", !0),
139
+ e.author ? (n(), a("span", Z, "👤 " + i(e.author), 1)) : u("", !0),
140
+ e.license ? (n(), a("span", ee, "📜 " + i(e.license), 1)) : u("", !0)
141
+ ])
142
+ ]),
143
+ r("button", {
144
+ class: _({ active: d(e.registry, e.id) }),
145
+ onClick: (g) => P(e.registry, e.id)
146
+ }, i(d(e.registry, e.id) ? "Remove" : "Install"), 11, se)
147
+ ], 2))), 128))
148
+ ])) : (n(), a("div", te, [...s[3] || (s[3] = [
149
+ r("div", { class: "plugin-empty-icon" }, "📦", -1),
150
+ r("div", { class: "plugin-empty-text" }, "No matching plugins found", -1)
151
+ ])]))
152
+ ]));
153
+ }
154
+ }), ie = /* @__PURE__ */ F(re, [["__scopeId", "data-v-6fcc9e77"]]);
155
+ export {
156
+ ie as default
157
+ };
158
+ //# sourceMappingURL=PluginStoreApp-Cxspe6t8.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PluginStoreApp-Cxspe6t8.js","sources":["../src/plugins/plugin-store/components/PluginStoreApp.vue"],"sourcesContent":["<template lang=\"pug\">\n#ipe-plugin-store-app\n .sotre-header\n .store-search-wrapper\n input.store-search-input(\n v-model='searchInput',\n type='text',\n placeholder='Search plugins...',\n :disabled='registryInfos.length === 0'\n )\n .store-search-icon 🔍\n button.store-refresh-btn(\n @click='refreshRegistries',\n :disabled='isRefreshing',\n :class='{ refreshing: isRefreshing }'\n )\n span.refresh-text {{ isRefreshing ? 'Refreshing...' : 'Refresh' }}\n\n .store-loading(v-if='registryInfos.length === 0')\n .loading-spinner\n .loading-text Loading...\n\n .store-plugins(v-else-if='filteredPlugins.length > 0')\n .plugin-item(\n v-for='plugin in filteredPlugins',\n :key='`${plugin.registry}:${plugin.id}`',\n :class='{ installed: isInstalled(plugin.registry, plugin.id) }'\n )\n .plugin-info\n .plugin-header\n .name {{ plugin.name }}\n .status-badge(v-if='isInstalled(plugin.registry, plugin.id)') ✓\n a.registry-tag(:href='plugin.registryHomepage', target='_blank') {{ getRegistryLabel(plugin.registry) }}\n .plugin-id {{ plugin.id }}\n .plugin-desc(v-if='plugin.description') {{ plugin.description }}\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 button(\n :class='{ active: isInstalled(plugin.registry, plugin.id) }',\n @click='togglePlugin(plugin.registry, plugin.id)'\n ) {{ isInstalled(plugin.registry, plugin.id) ? 'Remove' : 'Install' }}\n\n .plugin-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'\n\ninterface RegistryWithUrl extends PluginStoreRegistry {\n registryUrl: string\n}\n\nconst ctx = useIPE()\nconst registryInfos = ref<RegistryWithUrl[]>([])\nconst installedPlugins = ref<string[]>([])\nconst searchInput = ref('')\nconst isRefreshing = ref(false)\n\nonMounted(async () => {\n await initRegistries()\n})\n\nconst initRegistries = async () => {\n const registryUrls = (await ctx.store.ctx.preferences.get('pluginStore.registries')) || []\n\n const results = await Promise.allSettled(\n registryUrls.map(async (url) => {\n const info = await ctx.store.getRegistryInfo(url)\n return { ...info, registryUrl: url }\n })\n )\n\n registryInfos.value = results\n .filter((r) => r.status === 'fulfilled')\n .map((r) => (r as PromiseFulfilledResult<RegistryWithUrl>).value)\n}\n\nconst isInstalled = (registry: string, id: string) => {\n return installedPlugins.value.includes(`${registry}:${id}`)\n}\n\n// 获取仓库标签显示名称\nconst getRegistryLabel = (registryUrl: string) => {\n try {\n const url = new URL(registryUrl)\n return url.hostname\n } catch {\n return registryUrl\n }\n}\n\n// 搜索过滤 - 合并所有仓库的插件\nconst filteredPlugins = computed(() => {\n // 合并所有仓库的packages,并添加registry信息(使用完整的registryUrl)\n const allPlugins = registryInfos.value.flatMap((registry) =>\n (registry.packages || []).map((pkg) => ({\n ...pkg,\n registry: registry.registryUrl, // 使用完整的 registry URL (index.json 地址)\n registryHomepage: registry.homepage,\n }))\n )\n\n if (!searchInput.value.trim()) return allPlugins\n\n const query = searchInput.value.toLowerCase()\n return allPlugins.filter((plugin) => {\n return (\n plugin.name?.toLowerCase().includes(query) ||\n plugin.id?.toLowerCase().includes(query) ||\n plugin.description?.toLowerCase().includes(query) ||\n plugin.author?.toLowerCase().includes(query)\n )\n })\n})\n\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}\n\n// 切换插件状态\nconst togglePlugin = (registry: string, id: string) => {\n if (isInstalled(registry, id)) {\n disablePlugin(registry, id)\n } else {\n enablePlugin(registry, id)\n }\n}\n\n// 刷新所有 registry 缓存\nconst refreshRegistries = async () => {\n if (isRefreshing.value) return\n\n isRefreshing.value = true\n try {\n const registryUrls = (await ctx.store.ctx.preferences.get('pluginStore.registries')) || []\n\n const results = await Promise.allSettled(\n registryUrls.map(async (url) => {\n const info = await ctx.store.refreshRegistryCache(url)\n return { ...info, registryUrl: url }\n })\n )\n\n registryInfos.value = results\n .filter((r) => r.status === 'fulfilled')\n .map((r) => (r as PromiseFulfilledResult<RegistryWithUrl>).value)\n\n ctx.modal.notify('success', {\n content: `${registryUrls.length} registries refreshed successfully`,\n })\n } catch (error) {\n ctx.modal.notify('error', {\n content: 'Failed to refresh registries',\n })\n } finally {\n setTimeout(() => {\n isRefreshing.value = false\n }, 3000)\n }\n}\n\n// init plugin states\nconst initInstalStatus = async () => {\n const prefs = (await ctx.store.ctx.preferences.get('pluginStore.plugins')) || []\n installedPlugins.value = prefs.map((p) => `${p.registry}:${p.id}`)\n}\nfunction onPreferencesChanged(payload: { changes: Record<string, unknown> }) {\n const plugins = payload.changes['pluginStore.plugins'] as {\n registry: string\n id: string\n }[]\n if (plugins && Array.isArray(plugins)) {\n installedPlugins.value = plugins.map((p) => `${p.registry}:${p.id}`)\n }\n}\nonMounted(() => {\n initInstalStatus()\n ctx.on('preferences/changed', onPreferencesChanged)\n})\n\nonMounted(() => {\n console.info('mount plugin store app', ctx)\n})\nonBeforeUnmount(() => {\n console.info('unmount plugin store app', ctx)\n})\n</script>\n\n<style scoped lang=\"scss\">\n#ipe-plugin-store-app {\n padding: var(--ipe-modal-spacing);\n font-size: 0.875rem;\n color: var(--ipe-modal-text);\n}\n\n.sotre-header {\n margin-bottom: 1.25rem;\n display: flex;\n align-items: center;\n gap: var(--ipe-modal-spacing);\n\n h2 {\n margin: 0;\n font-size: 1.125rem;\n font-weight: 600;\n color: var(--ipe-modal-text);\n }\n\n .store-search-wrapper {\n flex: 1;\n position: relative;\n\n .store-search-input {\n width: 100%;\n height: 2.5rem;\n padding: 0 0.875rem 0 2.5rem;\n border: 1.5px solid var(--ipe-modal-border-color);\n border-radius: var(--ipe-modal-button-radius);\n font-size: 0.875rem;\n outline: none;\n background: var(--ipe-modal-bg);\n color: var(--ipe-modal-text);\n transition: all 0.2s ease;\n line-height: 1.5;\n\n &:focus {\n border-color: var(--ipe-modal-accent);\n box-shadow: 0 0 0 3px color-mix(in srgb, var(--ipe-modal-accent) 10%, transparent);\n }\n\n &::placeholder {\n color: var(--ipe-modal-muted);\n }\n }\n\n .store-search-icon {\n position: absolute;\n left: 0.75rem;\n top: 50%;\n transform: translateY(-50%);\n pointer-events: none;\n opacity: 0.5;\n }\n }\n\n .store-refresh-btn {\n height: 2.5rem;\n padding: 0 1rem;\n border: 1.5px solid var(--ipe-modal-border-color);\n border-radius: var(--ipe-modal-button-radius);\n background: var(--ipe-modal-bg);\n color: var(--ipe-modal-text);\n cursor: pointer;\n font-size: 0.875rem;\n font-weight: 500;\n white-space: nowrap;\n transition: all 0.2s ease;\n display: flex;\n align-items: center;\n gap: 0.375rem;\n\n &:hover:not(:disabled) {\n background: var(--ipe-modal-secondary-bg);\n border-color: var(--ipe-modal-accent);\n transform: translateY(-1px);\n box-shadow: 0 2px 6px color-mix(in srgb, var(--ipe-modal-text) 10%, transparent);\n }\n\n &:active:not(:disabled) {\n transform: translateY(0);\n }\n\n &:disabled {\n opacity: 0.6;\n cursor: not-allowed;\n }\n }\n}\n\n.store-loading {\n padding: 10rem 1.25rem;\n text-align: center;\n display: flex;\n flex-direction: column;\n align-items: center;\n gap: 0.75rem;\n\n .loading-spinner {\n width: 2rem;\n height: 2rem;\n border: 3px solid var(--ipe-modal-border-color);\n border-top-color: var(--ipe-modal-accent);\n border-radius: 50%;\n animation: spin 0.8s linear infinite;\n }\n\n .loading-text {\n color: var(--ipe-modal-muted);\n font-size: 0.875rem;\n }\n}\n\n@keyframes spin {\n to {\n transform: rotate(360deg);\n }\n}\n\n.store-plugins {\n display: flex;\n flex-direction: column;\n gap: 0.75rem;\n}\n\n.plugin-item {\n display: flex;\n align-items: center;\n gap: 1rem;\n padding: 0.875rem;\n border: 1.5px solid var(--ipe-modal-border-color);\n border-radius: calc(var(--ipe-modal-button-radius) + 2px);\n background: var(--ipe-modal-secondary-bg);\n position: relative;\n transition: all 0.2s ease;\n\n &:hover {\n background: var(--ipe-modal-divider-color);\n border-color: color-mix(in srgb, var(--ipe-modal-accent) 30%, var(--ipe-modal-border-color));\n box-shadow: 0 2px 8px color-mix(in srgb, var(--ipe-modal-text) 5%, transparent);\n }\n\n &.installed {\n background: color-mix(in srgb, var(--ipe-modal-success) 5%, var(--ipe-modal-secondary-bg));\n border-color: color-mix(in srgb, var(--ipe-modal-success) 50%, var(--ipe-modal-border-color));\n\n &:hover {\n background: color-mix(in srgb, var(--ipe-modal-success) 8%, var(--ipe-modal-secondary-bg));\n border-color: var(--ipe-modal-success);\n box-shadow: 0 2px 8px color-mix(in srgb, var(--ipe-modal-success) 15%, transparent);\n }\n }\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.25rem;\n\n .name {\n font-weight: 600;\n font-size: 1rem;\n color: var(--ipe-modal-text);\n line-height: 1.2;\n }\n\n .status-badge {\n font-size: 0.6875rem;\n color: var(--ipe-modal-success);\n font-weight: 600;\n background: color-mix(in srgb, var(--ipe-modal-success) 15%, transparent);\n padding: 0.125rem 0.375rem;\n border-radius: calc(var(--ipe-modal-button-radius) - 2px);\n line-height: 1;\n }\n }\n\n .plugin-id {\n font-size: 0.75rem;\n color: var(--ipe-modal-muted);\n font-family: monospace;\n margin-bottom: 0.375rem;\n background: color-mix(in srgb, var(--ipe-modal-muted) 5%, transparent);\n padding: 0.125rem 0.375rem;\n border-radius: 3px;\n display: inline-block;\n margin-left: 0.375rem;\n }\n\n .registry-tag {\n font-size: 0.6875rem;\n color: var(--ipe-modal-accent);\n font-family: monospace;\n margin-bottom: 0.375rem;\n background: color-mix(in srgb, var(--ipe-modal-accent) 10%, transparent);\n padding: 0.125rem 0.375rem;\n border-radius: 3px;\n display: inline-block;\n border: 1px solid color-mix(in srgb, var(--ipe-modal-accent) 20%, transparent);\n }\n\n .plugin-desc {\n font-size: 0.8125rem;\n color: var(--ipe-modal-muted);\n margin-bottom: 0.375rem;\n line-height: 1.5;\n }\n\n .plugin-meta {\n font-size: 0.75rem;\n color: var(--ipe-modal-muted);\n display: flex;\n gap: 1rem;\n\n .version {\n font-family: monospace;\n font-weight: 500;\n }\n\n .author {\n display: flex;\n align-items: center;\n gap: 0.25rem;\n }\n }\n }\n\n button {\n padding: 0.5rem 1.25rem;\n border: 1.5px solid var(--ipe-modal-accent);\n border-radius: var(--ipe-modal-button-radius);\n background: var(--ipe-modal-bg);\n color: var(--ipe-modal-accent);\n cursor: pointer;\n font-size: 0.8125rem;\n font-weight: 500;\n white-space: nowrap;\n transition: all 0.2s ease;\n\n &:hover {\n background: var(--ipe-modal-accent);\n color: var(--ipe-modal-bg);\n transform: translateY(-1px);\n box-shadow: 0 2px 6px color-mix(in srgb, var(--ipe-modal-accent) 25%, transparent);\n }\n\n &:active {\n transform: translateY(0);\n }\n\n &.active {\n border-color: var(--ipe-modal-danger);\n color: var(--ipe-modal-danger);\n\n &:hover {\n background: var(--ipe-modal-danger);\n color: var(--ipe-modal-bg);\n box-shadow: 0 2px 6px color-mix(in srgb, var(--ipe-modal-danger) 25%, transparent);\n }\n }\n }\n}\n\n.plugin-empty {\n padding: 3rem 1.25rem;\n text-align: center;\n display: flex;\n flex-direction: column;\n align-items: center;\n gap: 0.75rem;\n\n .plugin-empty-icon {\n font-size: 3rem;\n opacity: 0.3;\n }\n\n .plugin-empty-text {\n color: var(--ipe-modal-muted);\n font-size: 0.9375rem;\n }\n}\n</style>\n"],"names":["ctx","useIPE","registryInfos","ref","installedPlugins","searchInput","isRefreshing","onMounted","initRegistries","registryUrls","results","url","r","isInstalled","registry","id","getRegistryLabel","registryUrl","filteredPlugins","computed","allPlugins","pkg","query","plugin","enablePlugin","disablePlugin","togglePlugin","refreshRegistries","initInstalStatus","prefs","p","onPreferencesChanged","payload","plugins","onBeforeUnmount"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAyDA,UAAMA,IAAMC,EAAA,GACNC,IAAgBC,EAAuB,EAAE,GACzCC,IAAmBD,EAAc,EAAE,GACnCE,IAAcF,EAAI,EAAE,GACpBG,IAAeH,EAAI,EAAK;AAE9B,IAAAI,EAAU,YAAY;AACpB,YAAMC,EAAA;AAAA,IACR,CAAC;AAED,UAAMA,IAAiB,YAAY;AACjC,YAAMC,IAAgB,MAAMT,EAAI,MAAM,IAAI,YAAY,IAAI,wBAAwB,KAAM,CAAA,GAElFU,IAAU,MAAM,QAAQ;AAAA,QAC5BD,EAAa,IAAI,OAAOE,OAEf,EAAE,GADI,MAAMX,EAAI,MAAM,gBAAgBW,CAAG,GAC9B,aAAaA,EAAA,EAChC;AAAA,MAAA;AAGH,MAAAT,EAAc,QAAQQ,EACnB,OAAO,CAACE,MAAMA,EAAE,WAAW,WAAW,EACtC,IAAI,CAACA,MAAOA,EAA8C,KAAK;AAAA,IACpE,GAEMC,IAAc,CAACC,GAAkBC,MAC9BX,EAAiB,MAAM,SAAS,GAAGU,CAAQ,IAAIC,CAAE,EAAE,GAItDC,IAAmB,CAACC,MAAwB;AAChD,UAAI;AAEF,eADY,IAAI,IAAIA,CAAW,EACpB;A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,EAAA,EAChC;AAAA,UAAA;AAGH,UAAAT,EAAc,QAAQQ,EACnB,OAAO,CAACE,MAAMA,EAAE,WAAW,WAAW,EACtC,IAAI,CAACA,MAAOA,EAA8C,KAAK,GAElEZ,EAAI,MAAM,OAAO,WAAW;AAAA,YAC1B,SAAS,GAAGS,EAAa,MAAM;AAAA,UAAA,CAChC;AAAA,QACH,QAAgB;AACd,UAAAT,EAAI,MAAM,OAAO,SAAS;AAAA,YACxB,SAAS;AAAA,UAAA,CACV;AAAA,QACH,UAAA;AACE,qBAAW,MAAM;AACf,YAAAM,EAAa,QAAQ;AAAA,UACvB,GAAG,GAAI;AAAA,QACT;AAAA;AAAA,IACF,GAGMsB,IAAmB,YAAY;AACnC,YAAMC,IAAS,MAAM7B,EAAI,MAAM,IAAI,YAAY,IAAI,qBAAqB,KAAM,CAAA;AAC9E,MAAAI,EAAiB,QAAQyB,EAAM,IAAI,CAACC,MAAM,GAAGA,EAAE,QAAQ,IAAIA,EAAE,EAAE,EAAE;AAAA,IACnE;AACA,aAASC,EAAqBC,GAA+C;AAC3E,YAAMC,IAAUD,EAAQ,QAAQ,qBAAqB;AAIrD,MAAIC,KAAW,MAAM,QAAQA,CAAO,MAClC7B,EAAiB,QAAQ6B,EAAQ,IAAI,CAACH,MAAM,GAAGA,EAAE,QAAQ,IAAIA,EAAE,EAAE,EAAE;AAAA,IAEvE;AACA,WAAAvB,EAAU,MAAM;AACd,MAAAqB,EAAA,GACA5B,EAAI,GAAG,uBAAuB+B,CAAoB;AAAA,IACpD,CAAC,GAEDxB,EAAU,MAAM;AAAA,IAEhB,CAAC,GACD2B,EAAgB,MAAM;AAAA,IAEtB,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -1 +1 @@
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;"}
1
+ {"version":3,"file":"Preferences-DS4-CFWe.js","sources":["../src/decorators/Preferences.ts"],"sourcesContent":["import type Schema from 'schemastery'\r\n\r\ntype AnyConstructor<T = any> = new (...args: any[]) => T\r\n\r\nexport type PreferenceAugmented<D, C extends AnyConstructor> = C & {\r\n PreferencesSchema: Schema<D>\r\n}\r\n\r\n/**\r\n * Decorator for registering preferences\r\n *\r\n * ```ts\r\n * @RegisterPreferences(\r\n * Schema.object({\r\n * foo: Schema.string().description('Foo description'),\r\n * }),\r\n * {\r\n * foo: 'default foo value',\r\n * }\r\n * )\r\n * class Foo {}\r\n * ```\r\n *\r\n * same as:\r\n *\r\n * ```ts\r\n * class Foo {\r\n * static ConfigSchema = Schema.object({\r\n * foo: Schema.string().description('Foo description')\r\n * })\r\n * static ConfigDefaults = {\r\n * foo: 'default foo value'\r\n * }\r\n * }\r\n * ```\r\n */\r\nexport function RegisterPreferences<D extends Record<string, any>>(schema: Schema<D>) {\r\n return function <T extends AnyConstructor>(target: T): PreferenceAugmented<D, T> {\r\n ;(target as any).PreferencesSchema = schema\r\n return target as PreferenceAugmented<D, T>\r\n }\r\n}\r\n"],"names":["RegisterPreferences","schema","target"],"mappings":"AAoCO,SAASA,EAAmDC,GAAmB;AACpF,SAAO,SAAoCC,GAAsC;AAC7E,WAAAA,EAAe,oBAAoBD,GAC9BC;AAAA,EACT;AACF;"}
@@ -1,4 +1,4 @@
1
- import { j as e } from "./index-CvhkVj_L.js";
1
+ import { j as e } from "./index-CM_6yF2v.js";
2
2
  const d = (a) => {
3
3
  const { id: o, name: s, value: i, label: r, inputProps: l, labelProps: p, children: n, ...t } = a;
4
4
  return /* @__PURE__ */ e("label", { className: "theme-ipe ipe-radio-box", ...t, children: [
@@ -10,4 +10,4 @@ const d = (a) => {
10
10
  export {
11
11
  d as R
12
12
  };
13
- //# sourceMappingURL=RadioBox-nJqWsxW2.js.map
13
+ //# sourceMappingURL=RadioBox-0UuxlcWZ.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"RadioBox-nJqWsxW2.js","sources":["../src/components/RadioBox.tsx"],"sourcesContent":["import { JSX } from 'jsx-dom'\n\nexport type RadioBoxProps = {\n id?: string\n name: string\n value: string\n label?: string | HTMLElement\n inputProps?: JSX.IntrinsicElements['input']\n labelProps?: JSX.IntrinsicElements['span']\n} & JSX.IntrinsicElements['label']\n\nexport const RadioBox = (props: RadioBoxProps) => {\n const { id, name, value, label, inputProps, labelProps, children, ...rest } = props\n return (\n <label className=\"theme-ipe ipe-radio-box\" {...rest}>\n <input type=\"radio\" id={id} name={name} value={value} {...inputProps} />\n <span className=\"ipe-checkbox-box\"></span>\n <span {...labelProps}>{label || children}</span>\n </label>\n )\n}\n"],"names":["RadioBox","props","id","name","value","label","inputProps","labelProps","children","rest","jsxs","jsx"],"mappings":";AAWO,MAAMA,IAAW,CAACC,MAAyB;AAChD,QAAM,EAAE,IAAAC,GAAI,MAAAC,GAAM,OAAAC,GAAO,OAAAC,GAAO,YAAAC,GAAY,YAAAC,GAAY,UAAAC,GAAU,GAAGC,EAAA,IAASR;AAC9E,SACES,gBAAAA,EAAC,SAAA,EAAM,WAAU,2BAA2B,GAAGD,GAC7C,UAAA;AAAA,IAAA,gBAAAE,EAAC,WAAM,MAAK,SAAQ,IAAAT,GAAQ,MAAAC,GAAY,OAAAC,GAAe,GAAGE,GAAY;AAAA,IACtE,gBAAAK,EAAC,QAAA,EAAK,WAAU,mBAAA,CAAmB;AAAA,IACnC,gBAAAA,EAAC,QAAA,EAAM,GAAGJ,GAAa,eAASC,EAAA,CAAS;AAAA,EAAA,GAC3C;AAEJ;"}
1
+ {"version":3,"file":"RadioBox-0UuxlcWZ.js","sources":["../src/components/RadioBox.tsx"],"sourcesContent":["import { JSX } from 'jsx-dom'\n\nexport type RadioBoxProps = {\n id?: string\n name: string\n value: string\n label?: string | HTMLElement\n inputProps?: JSX.IntrinsicElements['input']\n labelProps?: JSX.IntrinsicElements['span']\n} & JSX.IntrinsicElements['label']\n\nexport const RadioBox = (props: RadioBoxProps) => {\n const { id, name, value, label, inputProps, labelProps, children, ...rest } = props\n return (\n <label className=\"theme-ipe ipe-radio-box\" {...rest}>\n <input type=\"radio\" id={id} name={name} value={value} {...inputProps} />\n <span className=\"ipe-checkbox-box\"></span>\n <span {...labelProps}>{label || children}</span>\n </label>\n )\n}\n"],"names":["RadioBox","props","id","name","value","label","inputProps","labelProps","children","rest","jsxs","jsx"],"mappings":";AAWO,MAAMA,IAAW,CAACC,MAAyB;AAChD,QAAM,EAAE,IAAAC,GAAI,MAAAC,GAAM,OAAAC,GAAO,OAAAC,GAAO,YAAAC,GAAY,YAAAC,GAAY,UAAAC,GAAU,GAAGC,EAAA,IAASR;AAC9E,SACES,gBAAAA,EAAC,SAAA,EAAM,WAAU,2BAA2B,GAAGD,GAC7C,UAAA;AAAA,IAAA,gBAAAE,EAAC,WAAM,MAAK,SAAQ,IAAAT,GAAQ,MAAAC,GAAY,OAAAC,GAAe,GAAGE,GAAY;AAAA,IACtE,gBAAAK,EAAC,QAAA,EAAK,WAAU,mBAAA,CAAmB;AAAA,IACnC,gBAAAA,EAAC,QAAA,EAAM,GAAGJ,GAAa,eAASC,EAAA,CAAS;AAAA,EAAA,GAC3C;AAEJ;"}
@@ -0,0 +1,10 @@
1
+ const s = (t, r) => {
2
+ const o = t.__vccOpts || t;
3
+ for (const [c, e] of r)
4
+ o[c] = e;
5
+ return o;
6
+ };
7
+ export {
8
+ s as _
9
+ };
10
+ //# sourceMappingURL=_plugin-vue_export-helper-CHgC5LLL.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"_plugin-vue_export-helper-CHgC5LLL.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;"}
@@ -1,98 +1,80 @@
1
- import { M as L } from "../index-lZkYoUca.js";
2
- import { j as o, c as r } from "../index-CvhkVj_L.js";
3
- import { P as A } from "../index-CvhkVj_L.js";
4
- import { T } from "../index-Bh70Udzi.js";
5
- import { C as z } from "../CheckBox-D3rHnX7I.js";
6
- import { I as C } from "../InputBox-BV4m05Xs.js";
7
- import { R as I } from "../RadioBox-nJqWsxW2.js";
8
- const b = "_tabview_zlbug_1", d = "_labels_container_zlbug_4", _ = "_label_zlbug_4", m = "_active_zlbug_32", p = "_contents_container_zlbug_35", l = {
9
- tabview: b,
10
- labels_container: d,
11
- label: _,
12
- active: m,
13
- contents_container: p
1
+ import { M as x } from "../index-CG38LlAh.js";
2
+ import { j as n } from "../index-CM_6yF2v.js";
3
+ import { P as V } from "../index-CM_6yF2v.js";
4
+ import { T as A } from "../index-DD5CVCfD.js";
5
+ import { A as B } from "../ActionButton-CRjo_l3y.js";
6
+ import { C as T } from "../CheckBox-Bc79KBEB.js";
7
+ import { I as $ } from "../InputBox-DZAdyZ4B.js";
8
+ import { R as k } from "../RadioBox-0UuxlcWZ.js";
9
+ const r = "_tabview_zlbug_1", _ = "_labels_container_zlbug_4", b = "_label_zlbug_4", d = "_active_zlbug_32", m = "_contents_container_zlbug_35", i = {
10
+ tabview: r,
11
+ labels_container: _,
12
+ label: b,
13
+ active: d,
14
+ contents_container: m
14
15
  };
15
- function w({
16
- tabs: n = [],
17
- defaultActiveIndex: e = 0
16
+ function h({
17
+ tabs: t = [],
18
+ defaultActiveIndex: l = 0
18
19
  }) {
19
- const i = /* @__PURE__ */ o("div", { className: `ipe-tabView ${l.tabview}`, children: [
20
- /* @__PURE__ */ o("ul", { className: `ipe-tabView__labels-container ${l.labels_container}`, children: n.map((a) => /* @__PURE__ */ o(f, { name: a.name, children: a.children }, a.name)) }),
21
- /* @__PURE__ */ o("div", { className: `ipe-tabView__contents ${l.contents_container}`, children: n.map((a) => /* @__PURE__ */ o(u, { name: a.name, children: a.content }, a.name)) })
22
- ] }), s = i.querySelector(
23
- `.ipe-tabView__labels-container > .ipe-tabView__label:nth-child(${e + 1})`
20
+ const c = /* @__PURE__ */ n("div", { className: `ipe-tabView ${i.tabview}`, children: [
21
+ /* @__PURE__ */ n("ul", { className: `ipe-tabView__labels-container ${i.labels_container}`, children: t.map((a) => /* @__PURE__ */ n(f, { name: a.name, children: a.children }, a.name)) }),
22
+ /* @__PURE__ */ n("div", { className: `ipe-tabView__contents ${i.contents_container}`, children: t.map((a) => /* @__PURE__ */ n(p, { name: a.name, children: a.content }, a.name)) })
23
+ ] }), s = c.querySelector(
24
+ `.ipe-tabView__labels-container > .ipe-tabView__label:nth-child(${l + 1})`
24
25
  );
25
- return s && s.click(), i;
26
+ return s && s.click(), c;
26
27
  }
27
- function f({ name: n, children: e }) {
28
- return /* @__PURE__ */ o(
28
+ function f({ name: t, children: l }) {
29
+ return /* @__PURE__ */ n(
29
30
  "li",
30
31
  {
31
- "data-tab-name": n,
32
- className: `ipe-tabView__label ${l.label}`,
33
- onClick: function(i) {
34
- i.preventDefault();
32
+ "data-tab-name": t,
33
+ className: `ipe-tabView__label ${i.label}`,
34
+ onClick: function(c) {
35
+ c.preventDefault();
35
36
  const s = this.closest(".ipe-tabView");
36
37
  if (!s) return;
37
38
  const a = Array.from(s.children).find(
38
- (t) => t.classList.contains("ipe-tabView__labels")
39
+ (e) => e.classList.contains("ipe-tabView__labels")
39
40
  )?.children;
40
- a && Array.from(a).forEach((t) => {
41
- t.classList.remove(l.active);
42
- }), this.classList.add(l.active);
43
- const c = Array.from(s.children).find(
44
- (t) => t.classList.contains("ipe-tabView__contents")
41
+ a && Array.from(a).forEach((e) => {
42
+ e.classList.remove(i.active);
43
+ }), this.classList.add(i.active);
44
+ const o = Array.from(s.children).find(
45
+ (e) => e.classList.contains("ipe-tabView__contents")
45
46
  )?.children;
46
- c && Array.from(c).forEach((t) => {
47
- t instanceof HTMLElement && (t.dataset.tabName === n ? (t.style.display = "", t.classList.add(l.active)) : (t.style.display = "none", t.classList.remove(l.active)));
47
+ o && Array.from(o).forEach((e) => {
48
+ e instanceof HTMLElement && (e.dataset.tabName === t ? (e.style.display = "", e.classList.add(i.active)) : (e.style.display = "none", e.classList.remove(i.active)));
48
49
  });
49
50
  },
50
- children: /* @__PURE__ */ o("a", { children: e || n })
51
+ children: /* @__PURE__ */ n("a", { children: l || t })
51
52
  }
52
53
  );
53
54
  }
54
- function u({ name: n, children: e }) {
55
- return /* @__PURE__ */ o(
55
+ function p({ name: t, children: l }) {
56
+ return /* @__PURE__ */ n(
56
57
  "div",
57
58
  {
58
- "data-tab-name": n,
59
+ "data-tab-name": t,
59
60
  className: "ipe-tabView__content-body",
60
61
  style: {
61
62
  display: "none"
62
63
  },
63
- children: e
64
+ children: l
64
65
  }
65
66
  );
66
67
  }
67
- const v = window?.location?.origin, y = ({
68
- type: n,
69
- tag: e,
70
- href: i,
71
- target: s,
72
- children: a,
73
- ...c
74
- }) => (e = e || (i ? "a" : "button"), typeof s > "u" && i && i.startsWith("http") && !i.startsWith(v) && (s = "_blank"), r(
75
- e,
76
- {
77
- className: `theme-ipe ipe-action-button ipe-modal-btn is-${n || "default"}`,
78
- // @ts-ignore
79
- href: e === "a" ? i : void 0,
80
- target: e === "a" ? s : void 0,
81
- "data-href": e !== "a" ? i : void 0,
82
- ...c
83
- },
84
- a
85
- ));
86
68
  export {
87
- y as ActionButton,
88
- z as CheckBox,
89
- C as InputBox,
90
- L as MBox,
91
- A as ProgressBar,
92
- I as RadioBox,
93
- u as TabContent,
69
+ B as ActionButton,
70
+ T as CheckBox,
71
+ $ as InputBox,
72
+ x as MBox,
73
+ V as ProgressBar,
74
+ k as RadioBox,
75
+ p as TabContent,
94
76
  f as TabLabel,
95
- w as TabView,
96
- T as TwinSwapInput
77
+ h as TabView,
78
+ A as TwinSwapInput
97
79
  };
98
80
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../src/components/TabView/index.tsx","../../src/components/ActionButton.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","import { h, JSX } from 'jsx-dom'\n\nexport interface ActionButtonProps {\n type?: 'primary' | 'secondary' | 'danger' | 'default'\n tag?: 'a' | 'button' | 'div'\n}\n\nconst origin = window?.location?.origin\n\nexport const ActionButton = ({\n type,\n tag,\n href,\n target,\n children,\n ...rest\n}: ActionButtonProps &\n Omit<JSX.IntrinsicElements['button'], 'type'> &\n JSX.IntrinsicElements['a']) => {\n tag = tag || (href ? 'a' : 'button')\n if (\n typeof target === 'undefined' &&\n href &&\n href.startsWith('http') &&\n !href.startsWith(origin)\n ) {\n target = '_blank'\n }\n return h(\n tag,\n {\n className: `theme-ipe ipe-action-button ipe-modal-btn is-${type || 'default'}`,\n // @ts-ignore\n href: tag === 'a' ? href : undefined,\n target: tag === 'a' ? target : undefined,\n 'data-href': tag !== 'a' ? href : undefined,\n ...rest,\n },\n children\n )\n}\n"],"names":["TabView","tabs","defaultActiveIndex","el","jsxs","styles","jsx","tab","TabLabel","TabContent","defaultActiveLabel","name","children","e","container","labels","label","contents","content","origin","ActionButton","type","tag","href","target","rest","h"],"mappings":";;;;;;;;;;;;;;AAUO,SAAS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,IAClC,GAAGE;AAAA,EAAA;AAAA,EAELb;AAAA;"}
1
+ {"version":3,"file":"index.js","sources":["../../src/components/TabView/index.tsx"],"sourcesContent":["import { ReactNode } from 'jsx-dom'\r\nimport styles from './styles.module.sass'\r\n\r\nexport interface TabViewLabelOptions {\r\n name: string\r\n children: ReactNode\r\n}\r\n\r\nconsole.log(styles)\r\n\r\nexport function TabView({\r\n tabs = [],\r\n defaultActiveIndex = 0,\r\n}: {\r\n tabs: (TabViewLabelOptions & { content: ReactNode })[]\r\n defaultActiveIndex?: number\r\n}) {\r\n const el = (\r\n <div className={`ipe-tabView ${styles.tabview}`}>\r\n <ul className={`ipe-tabView__labels-container ${styles.labels_container}`}>\r\n {tabs.map((tab) => (\r\n <TabLabel key={tab.name} name={tab.name}>\r\n {tab.children}\r\n </TabLabel>\r\n ))}\r\n </ul>\r\n <div className={`ipe-tabView__contents ${styles.contents_container}`}>\r\n {tabs.map((tab) => (\r\n <TabContent key={tab.name} name={tab.name}>\r\n {tab.content}\r\n </TabContent>\r\n ))}\r\n </div>\r\n </div>\r\n )\r\n\r\n const defaultActiveLabel = el.querySelector<HTMLAnchorElement>(\r\n `.ipe-tabView__labels-container > .ipe-tabView__label:nth-child(${defaultActiveIndex + 1})`\r\n )\r\n if (defaultActiveLabel) {\r\n defaultActiveLabel.click()\r\n }\r\n\r\n return el\r\n}\r\n\r\nexport function TabLabel({ name, children }: { name: string; children: ReactNode }) {\r\n return (\r\n <li\r\n data-tab-name={name}\r\n className={`ipe-tabView__label ${styles.label}`}\r\n onClick={function (e) {\r\n e.preventDefault()\r\n const container = this.closest('.ipe-tabView')\r\n if (!container) return\r\n const labels = Array.from(container.children).find((el) =>\r\n el.classList.contains('ipe-tabView__labels')\r\n )?.children\r\n if (labels) {\r\n Array.from(labels).forEach((label) => {\r\n label.classList.remove(styles.active)\r\n })\r\n }\r\n this.classList.add(styles.active)\r\n const contents = Array.from(container.children).find((el) =>\r\n el.classList.contains('ipe-tabView__contents')\r\n )?.children\r\n if (contents) {\r\n Array.from(contents).forEach((content) => {\r\n if (content instanceof HTMLElement) {\r\n if (content.dataset.tabName === name) {\r\n content.style.display = ''\r\n content.classList.add(styles.active)\r\n } else {\r\n content.style.display = 'none'\r\n content.classList.remove(styles.active)\r\n }\r\n }\r\n })\r\n }\r\n }}\r\n >\r\n <a>{children || name}</a>\r\n </li>\r\n )\r\n}\r\n\r\nexport function TabContent({ name, children }: { name: string; children: ReactNode }) {\r\n return (\r\n <div\r\n data-tab-name={name}\r\n className=\"ipe-tabView__content-body\"\r\n style={{\r\n display: 'none',\r\n }}\r\n >\r\n {children}\r\n </div>\r\n )\r\n}\r\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,EAAI,YADQA,EAAI,IAEnB,CACD,EAAA,CACH;AAAA,IACA,gBAAAD,EAAC,SAAI,WAAW,yBAAyBD,EAAO,kBAAkB,IAC/D,YAAK,IAAI,CAACE,MACT,gBAAAD,EAACG,GAAA,EAA0B,MAAMF,EAAI,MAClC,YAAI,QAAA,GADUA,EAAI,IAErB,CACD,EAAA,CACH;AAAA,EAAA,GACF,GAGIG,IAAqBP,EAAG;AAAA,IAC5B,kEAAkED,IAAqB,CAAC;AAAA,EAAA;AAE1F,SAAIQ,KACFA,EAAmB,MAAA,GAGdP;AACT;AAEO,SAASK,EAAS,EAAE,M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;AAAA,IAAA;AAAA,EAAA;AAGP;"}
@@ -3,5 +3,6 @@ export declare enum Endpoints {
3
3
  ANALYTICS_DASH_URL = "https://analytics.ipe.wiki",
4
4
  GITHUB_URL = "https://github.com/inpageedit/inpageedit-next",
5
5
  HOME_URL = "https://www.ipe.wiki/",
6
- UPDATE_LOGS_URL = "https://www.ipe.wiki/changelogs/"
6
+ UPDATE_LOGS_URL = "https://www.ipe.wiki/changelogs/",
7
+ PLUGIN_REGISTRY_URL = "https://registry.ipe.wiki/registry.v1.json"
7
8
  }
@@ -0,0 +1,180 @@
1
+ import { j as i, P as S } from "./index-CM_6yF2v.js";
2
+ import { B as E, I as j, S as k } from "./index-BXaiDKnr.js";
3
+ import { R as q } from "./Preferences-DS4-CFWe.js";
4
+ import { T as F } from "./index-DD5CVCfD.js";
5
+ import { C as v } from "./CheckBox-Bc79KBEB.js";
6
+ import { I } from "./InputBox-DZAdyZ4B.js";
7
+ var T = Object.create, p = Object.defineProperty, B = Object.getOwnPropertyDescriptor, b = (t, e) => (e = Symbol[t]) ? e : Symbol.for("Symbol." + t), _ = (t) => {
8
+ throw TypeError(t);
9
+ }, C = (t, e, r) => e in t ? p(t, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[e] = r, Q = (t, e) => p(t, "name", { value: e, configurable: !0 }), z = (t) => [, , , T(t?.[b("metadata")] ?? null)], D = ["class", "method", "getter", "setter", "accessor", "field", "value", "get", "set"], x = (t) => t !== void 0 && typeof t != "function" ? _("Function expected") : t, N = (t, e, r, a, o) => ({ kind: D[t], name: e, metadata: a, addInitializer: (n) => r._ ? _("Already initialized") : o.push(x(n || null)) }), O = (t, e) => C(e, b("metadata"), t[3]), R = (t, e, r, a) => {
10
+ for (var o = 0, n = t[e >> 1], s = n && n.length; o < s; o++) n[o].call(r);
11
+ return a;
12
+ }, L = (t, e, r, a, o, n) => {
13
+ var s, c, l, d = e & 7, f = !1, w = 0, y = t[w] || (t[w] = []), m = d && (o = o.prototype, d < 5 && (d > 3 || !f) && B(o, r));
14
+ Q(o, r);
15
+ for (var u = a.length - 1; u >= 0; u--)
16
+ l = N(d, r, c = {}, t[3], y), s = (0, a[u])(o, l), c._ = 1, x(s) && (o = s);
17
+ return O(t, o), m && p(o, r, m), f ? d ^ 4 ? n : m : o;
18
+ }, M, g, P;
19
+ M = [q(
20
+ k.object({
21
+ "quickMove.reason": k.string().default("[IPE-NEXT] Quick move")
22
+ }).description("Quick move options").extra("category", "editor")
23
+ ), j(["modal", "wiki"])];
24
+ class h extends (P = E) {
25
+ constructor(e) {
26
+ super(e, {}, "quick-move"), this.ctx = e, e.set("quickMove", this);
27
+ }
28
+ start() {
29
+ this.ctx.inject(["toolbox"], (e) => {
30
+ this.injectToolbox(e);
31
+ });
32
+ }
33
+ injectToolbox(e) {
34
+ const r = window.mw?.config.get("wgPageName") || "", a = window.mw?.config.get("wgIsProbablyEditable");
35
+ e.toolbox.addButton({
36
+ id: "quick-move",
37
+ icon: /* @__PURE__ */ i(
38
+ "svg",
39
+ {
40
+ xmlns: "http://www.w3.org/2000/svg",
41
+ width: "24",
42
+ height: "24",
43
+ viewBox: "0 0 24 24",
44
+ fill: "none",
45
+ stroke: "currentColor",
46
+ "stroke-width": "2",
47
+ "stroke-linecap": "round",
48
+ "stroke-linejoin": "round",
49
+ class: "icon icon-tabler icons-tabler-outline icon-tabler-forms",
50
+ children: [
51
+ /* @__PURE__ */ i("path", { stroke: "none", d: "M0 0h24v24H0z", fill: "none" }),
52
+ /* @__PURE__ */ i("path", { d: "M12 3a3 3 0 0 0 -3 3v12a3 3 0 0 0 3 3" }),
53
+ /* @__PURE__ */ i("path", { d: "M6 3a3 3 0 0 1 3 3v12a3 3 0 0 1 -3 3" }),
54
+ /* @__PURE__ */ i("path", { d: "M13 7h7a1 1 0 0 1 1 1v8a1 1 0 0 1 -1 1h-7" }),
55
+ /* @__PURE__ */ i("path", { d: "M5 7h-1a1 1 0 0 0 -1 1v8a1 1 0 0 0 1 1h1" }),
56
+ /* @__PURE__ */ i("path", { d: "M17 12h.01" }),
57
+ /* @__PURE__ */ i("path", { d: "M13 12h.01" })
58
+ ]
59
+ }
60
+ ),
61
+ tooltip: "Quick Move",
62
+ group: "group1",
63
+ index: 1,
64
+ onClick: () => {
65
+ this.showModal(
66
+ a ? {
67
+ lockFromField: !0,
68
+ from: r
69
+ } : {}
70
+ );
71
+ }
72
+ });
73
+ }
74
+ async showModal(e) {
75
+ const r = await this.ctx.preferences.get("quickMove.reason"), a = this.ctx.modal.createObject({
76
+ title: "Quick Move",
77
+ content: /* @__PURE__ */ i(S, {}),
78
+ className: "quick-move compact-buttons",
79
+ sizeClass: "smallToMedium",
80
+ center: !0
81
+ }).init();
82
+ let o = null;
83
+ return a.setContent(
84
+ /* @__PURE__ */ i(
85
+ "form",
86
+ {
87
+ ref: (n) => o = n,
88
+ style: {
89
+ display: "flex",
90
+ flexDirection: "column",
91
+ gap: "1rem"
92
+ },
93
+ onSubmit: (n) => {
94
+ if (n.preventDefault(), o?.checkValidity(), !o?.reportValidity())
95
+ return;
96
+ const s = new FormData(o), c = {
97
+ from: s.get("from")?.toString().trim(),
98
+ to: s.get("to")?.toString().trim(),
99
+ reason: s.get("reason") || "",
100
+ movetalk: s.get("movetalk") === "on",
101
+ movesubpages: s.get("movesubpages") === "on",
102
+ noredirect: s.get("noredirect") === "on"
103
+ };
104
+ if (!c.from || !c.to) {
105
+ this.ctx.modal.notify("error", {
106
+ title: "Failed to move",
107
+ content: "From and to are required."
108
+ });
109
+ return;
110
+ }
111
+ this.ctx.emit("quick-move/submit", { ctx: this.ctx, modal: a, payload: c }), a.setLoadingState(!0), this.movePage(c).then(() => {
112
+ location.reload();
113
+ }).catch((l) => {
114
+ a.setLoadingState(!1), this.ctx.modal.notify("error", {
115
+ title: "Failed to move",
116
+ content: l instanceof Error ? l.message : String(l)
117
+ });
118
+ });
119
+ },
120
+ children: [
121
+ /* @__PURE__ */ i(
122
+ F,
123
+ {
124
+ inputs: [
125
+ {
126
+ label: "Move from",
127
+ name: "from",
128
+ value: e?.from,
129
+ required: !0
130
+ },
131
+ {
132
+ label: "Move to",
133
+ name: "to",
134
+ value: e?.to,
135
+ required: !0
136
+ }
137
+ ]
138
+ }
139
+ ),
140
+ /* @__PURE__ */ i("div", { children: /* @__PURE__ */ i(v, { name: "movetalk", id: "movetalk", checked: e?.movetalk, children: "Move talk page" }) }),
141
+ /* @__PURE__ */ i("div", { children: /* @__PURE__ */ i(v, { name: "movesubpages", id: "movesubpages", checked: e?.movesubpages, children: "Move subpage(s) (up to 100)" }) }),
142
+ this.ctx.wiki.hasRight("suppressredirect") && /* @__PURE__ */ i("div", { children: /* @__PURE__ */ i(v, { name: "noredirect", id: "noredirect", checked: e?.noredirect, children: "Move without leaving a redirect" }) }),
143
+ /* @__PURE__ */ i(
144
+ I,
145
+ {
146
+ label: "Reason",
147
+ id: "reason",
148
+ name: "reason",
149
+ value: e?.reason ?? r ?? ""
150
+ }
151
+ )
152
+ ]
153
+ }
154
+ )
155
+ ), a.setButtons([
156
+ {
157
+ label: "Move",
158
+ className: "is-primary is-ghost",
159
+ method: () => {
160
+ o?.dispatchEvent(new Event("submit"));
161
+ }
162
+ }
163
+ ]), a.show();
164
+ }
165
+ async movePage(e) {
166
+ const { from: r, to: a, reason: o = "", ...n } = e;
167
+ if (!r || !a)
168
+ throw new Error("From and to titles are required.");
169
+ if (r === a)
170
+ throw new Error("From and to titles cannot be the same.");
171
+ return (await this.ctx.wikiPage.newFromTitle(r)).moveTo(a, o, n);
172
+ }
173
+ }
174
+ g = z(P);
175
+ h = L(g, 0, "PluginQuickMove", M, h);
176
+ R(g, 1, h);
177
+ export {
178
+ h as PluginQuickMove
179
+ };
180
+ //# sourceMappingURL=index-B5DtUqkK.js.map