@inkandswitch/patchwork-pkg-base 0.0.81 → 0.0.83
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/module-settings-url +1 -1
- package/package.json +1 -1
- package/packages/packages/dist/assets/mount-CgQfKq8z.js +1753 -0
- package/packages/packages/dist/index.js +1 -1
- package/packages/sideboard/dist/chunk-E6Y5RRIY.js +15 -0
- package/packages/sideboard/dist/chunk-E6Y5RRIY.js.map +7 -0
- package/packages/sideboard/dist/{chunk-DS3QVJZT.js → chunk-IBAIF3GD.js} +2 -2
- package/packages/sideboard/dist/chunk-RZPTJTVZ.js +2 -0
- package/packages/sideboard/dist/chunk-RZPTJTVZ.js.map +7 -0
- package/packages/sideboard/dist/chunk-YZ573CYO.js +2 -0
- package/packages/sideboard/dist/chunk-YZ573CYO.js.map +7 -0
- package/packages/sideboard/dist/{create-new-menu-VA4ELRJ6.js → create-new-menu-WF2LPUEV.js} +2 -2
- package/packages/sideboard/dist/document-list-panel-VY4FDLFY.js +2 -0
- package/packages/sideboard/dist/index.css +1 -1
- package/packages/sideboard/dist/index.css.map +2 -2
- package/packages/sideboard/dist/index.js +1 -1
- package/packages/sideboard/dist/item-menu-7ZNKM77G.js +2 -0
- package/packages/sideboard/dist/{item-menu-KCPJAERD.js.map → item-menu-7ZNKM77G.js.map} +1 -1
- package/packages/sideboard/dist/sideboard/sideboard.js +1 -1
- package/packages/threepane/dist/IsolatedDocumentArea-G3V7KYHJ.js +2 -0
- package/packages/threepane/dist/PatchworkFrame-R4CTQ6DV.js +2 -0
- package/packages/threepane/dist/PatchworkFrame-R4CTQ6DV.js.map +7 -0
- package/packages/threepane/dist/chunk-YC5AHP5G.js +841 -0
- package/packages/threepane/dist/chunk-YC5AHP5G.js.map +7 -0
- package/packages/threepane/dist/chunk-YERFWP5I.js +2 -0
- package/packages/threepane/dist/chunk-YERFWP5I.js.map +7 -0
- package/packages/threepane/dist/datatypes-YDAECNBI.js +2 -0
- package/packages/threepane/dist/index.js +1 -1
- package/plugin-registry-url +1 -1
- package/packages/packages/dist/assets/mount-Czkd2ZvO.js +0 -1660
- package/packages/sideboard/dist/chunk-4ROZGNSN.js +0 -15
- package/packages/sideboard/dist/chunk-4ROZGNSN.js.map +0 -7
- package/packages/sideboard/dist/chunk-OHHPMOAE.js +0 -2
- package/packages/sideboard/dist/chunk-OHHPMOAE.js.map +0 -7
- package/packages/sideboard/dist/chunk-ZQBDNEEV.js +0 -2
- package/packages/sideboard/dist/chunk-ZQBDNEEV.js.map +0 -7
- package/packages/sideboard/dist/document-list-panel-X3ZB5ZYJ.js +0 -2
- package/packages/sideboard/dist/item-menu-KCPJAERD.js +0 -2
- package/packages/threepane/dist/IsolatedDocumentArea-TH3ENI3M.js +0 -2
- package/packages/threepane/dist/PatchworkFrame-WMZ3SLEE.js +0 -2
- package/packages/threepane/dist/PatchworkFrame-WMZ3SLEE.js.map +0 -7
- package/packages/threepane/dist/chunk-ESMUVHPH.js +0 -2
- package/packages/threepane/dist/chunk-ESMUVHPH.js.map +0 -7
- package/packages/threepane/dist/chunk-FRVSEOM5.js +0 -969
- package/packages/threepane/dist/chunk-FRVSEOM5.js.map +0 -7
- package/packages/threepane/dist/datatypes-5DFL6VIN.js +0 -2
- /package/packages/sideboard/dist/{chunk-DS3QVJZT.js.map → chunk-IBAIF3GD.js.map} +0 -0
- /package/packages/sideboard/dist/{create-new-menu-VA4ELRJ6.js.map → create-new-menu-WF2LPUEV.js.map} +0 -0
- /package/packages/sideboard/dist/{document-list-panel-X3ZB5ZYJ.js.map → document-list-panel-VY4FDLFY.js.map} +0 -0
- /package/packages/threepane/dist/{IsolatedDocumentArea-TH3ENI3M.js.map → IsolatedDocumentArea-G3V7KYHJ.js.map} +0 -0
- /package/packages/threepane/dist/{datatypes-5DFL6VIN.js.map → datatypes-YDAECNBI.js.map} +0 -0
|
@@ -1,1660 +0,0 @@
|
|
|
1
|
-
import { insert, createComponent, setAttribute, effect, memo, use, template, className, delegateEvents, render } from "solid-js/web";
|
|
2
|
-
import { createSignal, onCleanup, createMemo, createEffect, Show, For } from "solid-js";
|
|
3
|
-
import { getAllRegistries } from "@inkandswitch/patchwork-plugins";
|
|
4
|
-
import * as filesystem from "@inkandswitch/patchwork-filesystem";
|
|
5
|
-
import { getImportableUrlFromAutomergeUrl } from "@inkandswitch/patchwork-filesystem";
|
|
6
|
-
function isAutomergeUrl(url) {
|
|
7
|
-
return typeof url === "string" && url.startsWith("automerge:");
|
|
8
|
-
}
|
|
9
|
-
function documentIdOf(url) {
|
|
10
|
-
if (!isAutomergeUrl(url)) return void 0;
|
|
11
|
-
const rest = url.slice("automerge:".length);
|
|
12
|
-
const match = rest.match(/^[^@?#/]+/);
|
|
13
|
-
return match ? match[0] : void 0;
|
|
14
|
-
}
|
|
15
|
-
function moduleKey(url) {
|
|
16
|
-
if (!url) return void 0;
|
|
17
|
-
return documentIdOf(url) ?? url;
|
|
18
|
-
}
|
|
19
|
-
function bareModuleUrl(url) {
|
|
20
|
-
if (!isAutomergeUrl(url)) return url;
|
|
21
|
-
const id = documentIdOf(url);
|
|
22
|
-
return id ? `automerge:${id}` : url;
|
|
23
|
-
}
|
|
24
|
-
function headsOf(url) {
|
|
25
|
-
if (!isAutomergeUrl(url)) return [];
|
|
26
|
-
const hash = url.indexOf("#");
|
|
27
|
-
if (hash < 0) return [];
|
|
28
|
-
const section = url.slice(hash + 1).replace(/[?].*$/, "");
|
|
29
|
-
return section ? section.split("|") : [];
|
|
30
|
-
}
|
|
31
|
-
function pinnedModuleUrl(importUrl, heads) {
|
|
32
|
-
const id = documentIdOf(importUrl);
|
|
33
|
-
if (!id || heads.length === 0) return void 0;
|
|
34
|
-
return `automerge:${id}#${[...heads].sort().join("|")}`;
|
|
35
|
-
}
|
|
36
|
-
function moduleKeySet(modules) {
|
|
37
|
-
const keys = /* @__PURE__ */ new Set();
|
|
38
|
-
for (const m of modules ?? []) {
|
|
39
|
-
const key = moduleKey(m);
|
|
40
|
-
if (key) keys.add(key);
|
|
41
|
-
}
|
|
42
|
-
return keys;
|
|
43
|
-
}
|
|
44
|
-
function classifyOrigin(importUrl, installedKeys, systemKeys) {
|
|
45
|
-
if (!importUrl) return "unknown";
|
|
46
|
-
const key = moduleKey(importUrl);
|
|
47
|
-
if (installedKeys.has(key)) return "installed";
|
|
48
|
-
if (systemKeys.has(key)) return "core";
|
|
49
|
-
if (!isAutomergeUrl(importUrl)) return "core";
|
|
50
|
-
return "ephemeral";
|
|
51
|
-
}
|
|
52
|
-
const ORIGIN_LABEL = {
|
|
53
|
-
installed: "my package list",
|
|
54
|
-
core: "system package list",
|
|
55
|
-
ephemeral: "ephemeral",
|
|
56
|
-
unknown: "unknown"
|
|
57
|
-
};
|
|
58
|
-
const ORIGIN_HINT = {
|
|
59
|
-
installed: "In the package list you're viewing.",
|
|
60
|
-
core: "From the site's default (system) package list.",
|
|
61
|
-
ephemeral: "Registered this session but not in any package list — install it to keep it after a reload.",
|
|
62
|
-
unknown: "No import URL, so its origin is unknown."
|
|
63
|
-
};
|
|
64
|
-
function originRank(origin) {
|
|
65
|
-
switch (origin) {
|
|
66
|
-
case "installed":
|
|
67
|
-
return 0;
|
|
68
|
-
case "ephemeral":
|
|
69
|
-
return 1;
|
|
70
|
-
case "core":
|
|
71
|
-
return 2;
|
|
72
|
-
default:
|
|
73
|
-
return 3;
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
function safeGetRegistries() {
|
|
77
|
-
try {
|
|
78
|
-
return getAllRegistries();
|
|
79
|
-
} catch {
|
|
80
|
-
return /* @__PURE__ */ new Map();
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
function readRegistrySnapshot() {
|
|
84
|
-
const out = [];
|
|
85
|
-
for (const [registry, reg] of safeGetRegistries()) {
|
|
86
|
-
let entries;
|
|
87
|
-
try {
|
|
88
|
-
entries = reg.all();
|
|
89
|
-
} catch {
|
|
90
|
-
continue;
|
|
91
|
-
}
|
|
92
|
-
for (const p of entries) {
|
|
93
|
-
if (!p || typeof p.id !== "string") continue;
|
|
94
|
-
out.push({
|
|
95
|
-
registry,
|
|
96
|
-
id: p.id,
|
|
97
|
-
type: typeof p.type === "string" ? p.type : registry,
|
|
98
|
-
name: typeof p.name === "string" ? p.name : p.id,
|
|
99
|
-
icon: p.icon,
|
|
100
|
-
importUrl: typeof p.importUrl === "string" ? p.importUrl : void 0,
|
|
101
|
-
supportedDatatypes: p.supportedDatatypes,
|
|
102
|
-
unlisted: p.unlisted === true ? true : void 0,
|
|
103
|
-
loaded: "module" in p
|
|
104
|
-
});
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
return out;
|
|
108
|
-
}
|
|
109
|
-
function deactivateModule(importUrl) {
|
|
110
|
-
const key = moduleKey(importUrl);
|
|
111
|
-
if (!key) return;
|
|
112
|
-
for (const [, reg] of safeGetRegistries()) {
|
|
113
|
-
const registry = reg;
|
|
114
|
-
if (typeof registry.remove !== "function") continue;
|
|
115
|
-
let entries;
|
|
116
|
-
try {
|
|
117
|
-
entries = registry.all();
|
|
118
|
-
} catch {
|
|
119
|
-
continue;
|
|
120
|
-
}
|
|
121
|
-
for (const p of entries) {
|
|
122
|
-
if (!p || typeof p.id !== "string") continue;
|
|
123
|
-
if (moduleKey(p.importUrl) !== key) continue;
|
|
124
|
-
registry.remove(p.id);
|
|
125
|
-
}
|
|
126
|
-
}
|
|
127
|
-
}
|
|
128
|
-
function useLiveRegistries() {
|
|
129
|
-
const [tick, setTick] = createSignal(0);
|
|
130
|
-
const subs = /* @__PURE__ */ new Map();
|
|
131
|
-
const ensureSubscribed = () => {
|
|
132
|
-
for (const [, reg] of safeGetRegistries()) {
|
|
133
|
-
if (subs.has(reg)) continue;
|
|
134
|
-
try {
|
|
135
|
-
subs.set(reg, reg.on("changed", bump));
|
|
136
|
-
} catch {
|
|
137
|
-
}
|
|
138
|
-
}
|
|
139
|
-
};
|
|
140
|
-
function bump() {
|
|
141
|
-
ensureSubscribed();
|
|
142
|
-
setTick((t) => t + 1);
|
|
143
|
-
}
|
|
144
|
-
ensureSubscribed();
|
|
145
|
-
onCleanup(() => {
|
|
146
|
-
for (const off of subs.values()) {
|
|
147
|
-
try {
|
|
148
|
-
off();
|
|
149
|
-
} catch {
|
|
150
|
-
}
|
|
151
|
-
}
|
|
152
|
-
subs.clear();
|
|
153
|
-
});
|
|
154
|
-
const snapshot = createMemo(() => {
|
|
155
|
-
tick();
|
|
156
|
-
return readRegistrySnapshot();
|
|
157
|
-
});
|
|
158
|
-
return { snapshot };
|
|
159
|
-
}
|
|
160
|
-
function moduleWatcher() {
|
|
161
|
-
try {
|
|
162
|
-
return globalThis.window?.patchwork?.packages;
|
|
163
|
-
} catch {
|
|
164
|
-
return void 0;
|
|
165
|
-
}
|
|
166
|
-
}
|
|
167
|
-
function readSettingsSources() {
|
|
168
|
-
const mw = moduleWatcher();
|
|
169
|
-
if (!mw) return [];
|
|
170
|
-
const urls = mw.urls ?? {};
|
|
171
|
-
const out = [];
|
|
172
|
-
for (const name of Object.keys(urls)) {
|
|
173
|
-
const url = urls[name];
|
|
174
|
-
if (typeof url !== "string") continue;
|
|
175
|
-
let modules;
|
|
176
|
-
const handle = mw.handles?.[name];
|
|
177
|
-
if (handle?.doc) {
|
|
178
|
-
try {
|
|
179
|
-
modules = handle.doc()?.modules;
|
|
180
|
-
} catch {
|
|
181
|
-
}
|
|
182
|
-
}
|
|
183
|
-
if (!modules) modules = mw.staticManifests?.[name]?.modules;
|
|
184
|
-
const moduleKeys = /* @__PURE__ */ new Set();
|
|
185
|
-
for (const m of modules ?? []) {
|
|
186
|
-
const key = moduleKey(m);
|
|
187
|
-
if (key) moduleKeys.add(key);
|
|
188
|
-
}
|
|
189
|
-
out.push({ name, url, key: moduleKey(url) ?? url, moduleKeys });
|
|
190
|
-
}
|
|
191
|
-
return out;
|
|
192
|
-
}
|
|
193
|
-
function repo() {
|
|
194
|
-
try {
|
|
195
|
-
return globalThis.window?.repo;
|
|
196
|
-
} catch {
|
|
197
|
-
return void 0;
|
|
198
|
-
}
|
|
199
|
-
}
|
|
200
|
-
function useDocHeadsMap(urls) {
|
|
201
|
-
const [map, setMap] = createSignal({});
|
|
202
|
-
const subs = /* @__PURE__ */ new Map();
|
|
203
|
-
createEffect(() => {
|
|
204
|
-
const r = repo();
|
|
205
|
-
if (!r) return;
|
|
206
|
-
for (const url of urls()) {
|
|
207
|
-
if (!isAutomergeUrl(url)) continue;
|
|
208
|
-
const id = documentIdOf(url);
|
|
209
|
-
if (!id || subs.has(id)) continue;
|
|
210
|
-
subs.set(id, () => {
|
|
211
|
-
});
|
|
212
|
-
void r.find(bareModuleUrl(url)).then((handle) => {
|
|
213
|
-
const update = () => setMap((prev) => ({ ...prev, [id]: [...handle.heads()] }));
|
|
214
|
-
update();
|
|
215
|
-
handle.on("change", update);
|
|
216
|
-
subs.set(id, () => handle.off("change", update));
|
|
217
|
-
}).catch(() => {
|
|
218
|
-
subs.delete(id);
|
|
219
|
-
});
|
|
220
|
-
}
|
|
221
|
-
});
|
|
222
|
-
onCleanup(() => {
|
|
223
|
-
for (const off of subs.values()) {
|
|
224
|
-
try {
|
|
225
|
-
off();
|
|
226
|
-
} catch {
|
|
227
|
-
}
|
|
228
|
-
}
|
|
229
|
-
subs.clear();
|
|
230
|
-
});
|
|
231
|
-
return map;
|
|
232
|
-
}
|
|
233
|
-
let worker;
|
|
234
|
-
let nextRequestId = 1;
|
|
235
|
-
const pending = /* @__PURE__ */ new Map();
|
|
236
|
-
function getWorker() {
|
|
237
|
-
if (worker) return worker;
|
|
238
|
-
const w = new Worker("/module-loader-worker.js", {
|
|
239
|
-
type: "module",
|
|
240
|
-
name: "packages-module-loader"
|
|
241
|
-
});
|
|
242
|
-
w.addEventListener("message", (event) => {
|
|
243
|
-
const data = event.data;
|
|
244
|
-
if (!data || data.type !== "descriptors" && data.type !== "error") return;
|
|
245
|
-
const entry = pending.get(data.id);
|
|
246
|
-
if (!entry) return;
|
|
247
|
-
pending.delete(data.id);
|
|
248
|
-
if (data.type === "descriptors") entry.resolve(data.descriptors);
|
|
249
|
-
else entry.reject(new Error(data.error));
|
|
250
|
-
});
|
|
251
|
-
w.addEventListener("error", (event) => {
|
|
252
|
-
const error = new Error(
|
|
253
|
-
`module-loader worker error: ${event.message ?? "unknown"}`
|
|
254
|
-
);
|
|
255
|
-
for (const [, entry] of pending) entry.reject(error);
|
|
256
|
-
pending.clear();
|
|
257
|
-
worker = void 0;
|
|
258
|
-
});
|
|
259
|
-
worker = w;
|
|
260
|
-
return w;
|
|
261
|
-
}
|
|
262
|
-
function hostImporter() {
|
|
263
|
-
try {
|
|
264
|
-
const watcher = globalThis.window?.patchwork?.packages;
|
|
265
|
-
const importer = watcher?.importAutomergePackage;
|
|
266
|
-
return typeof importer === "function" ? importer.bind(watcher) : void 0;
|
|
267
|
-
} catch {
|
|
268
|
-
return void 0;
|
|
269
|
-
}
|
|
270
|
-
}
|
|
271
|
-
function discoverViaWorker(folderUrl, timeoutMs) {
|
|
272
|
-
const id = nextRequestId++;
|
|
273
|
-
return new Promise((resolve, reject) => {
|
|
274
|
-
const timer = setTimeout(() => {
|
|
275
|
-
if (pending.delete(id)) reject(new Error("Timed out importing the package"));
|
|
276
|
-
}, timeoutMs);
|
|
277
|
-
pending.set(id, {
|
|
278
|
-
resolve: (d) => {
|
|
279
|
-
clearTimeout(timer);
|
|
280
|
-
resolve(d);
|
|
281
|
-
},
|
|
282
|
-
reject: (e) => {
|
|
283
|
-
clearTimeout(timer);
|
|
284
|
-
reject(e);
|
|
285
|
-
}
|
|
286
|
-
});
|
|
287
|
-
try {
|
|
288
|
-
getWorker().postMessage({ type: "discover", id, url: folderUrl });
|
|
289
|
-
} catch (e) {
|
|
290
|
-
clearTimeout(timer);
|
|
291
|
-
pending.delete(id);
|
|
292
|
-
reject(e instanceof Error ? e : new Error(String(e)));
|
|
293
|
-
}
|
|
294
|
-
});
|
|
295
|
-
}
|
|
296
|
-
async function discoverPlugins(folderUrl, timeoutMs = 15e3) {
|
|
297
|
-
const importer = hostImporter();
|
|
298
|
-
if (!importer) return discoverViaWorker(folderUrl, timeoutMs);
|
|
299
|
-
const mod = await withTimeout(
|
|
300
|
-
importer(folderUrl),
|
|
301
|
-
timeoutMs,
|
|
302
|
-
"importing the package"
|
|
303
|
-
);
|
|
304
|
-
return descriptorsOf(mod);
|
|
305
|
-
}
|
|
306
|
-
function descriptorsOf(mod) {
|
|
307
|
-
const plugins = mod?.plugins;
|
|
308
|
-
return Array.isArray(plugins) ? plugins.map(toDescriptor) : [];
|
|
309
|
-
}
|
|
310
|
-
function toDescriptor(plugin) {
|
|
311
|
-
if (!plugin || typeof plugin !== "object") return {};
|
|
312
|
-
const { load, import: _import, module, ...description } = plugin;
|
|
313
|
-
return description;
|
|
314
|
-
}
|
|
315
|
-
function withTimeout(p, ms, what) {
|
|
316
|
-
return new Promise((resolve, reject) => {
|
|
317
|
-
const timer = setTimeout(
|
|
318
|
-
() => reject(new Error(`Timed out ${what}`)),
|
|
319
|
-
ms
|
|
320
|
-
);
|
|
321
|
-
p.then(
|
|
322
|
-
(v) => {
|
|
323
|
-
clearTimeout(timer);
|
|
324
|
-
resolve(v);
|
|
325
|
-
},
|
|
326
|
-
(e) => {
|
|
327
|
-
clearTimeout(timer);
|
|
328
|
-
reject(e);
|
|
329
|
-
}
|
|
330
|
-
);
|
|
331
|
-
});
|
|
332
|
-
}
|
|
333
|
-
async function discoverHttpPlugins(url, timeoutMs = 15e3) {
|
|
334
|
-
const mod = await withTimeout(
|
|
335
|
-
filesystem.importPackageFromHttpUrl(url),
|
|
336
|
-
timeoutMs,
|
|
337
|
-
"importing the package"
|
|
338
|
-
);
|
|
339
|
-
return descriptorsOf(mod);
|
|
340
|
-
}
|
|
341
|
-
function discoverPackagePlugins(url) {
|
|
342
|
-
return isAutomergeUrl(url) ? discoverPlugins(url) : discoverHttpPlugins(url);
|
|
343
|
-
}
|
|
344
|
-
async function fetchJson(url) {
|
|
345
|
-
try {
|
|
346
|
-
const res = await fetch(url);
|
|
347
|
-
if (!res.ok) return void 0;
|
|
348
|
-
return await res.json();
|
|
349
|
-
} catch {
|
|
350
|
-
return void 0;
|
|
351
|
-
}
|
|
352
|
-
}
|
|
353
|
-
function pickMeta(pkg) {
|
|
354
|
-
return {
|
|
355
|
-
name: typeof pkg?.name === "string" ? pkg.name : void 0,
|
|
356
|
-
title: typeof pkg?.title === "string" ? pkg.title : void 0,
|
|
357
|
-
version: typeof pkg?.version === "string" ? pkg.version : void 0
|
|
358
|
-
};
|
|
359
|
-
}
|
|
360
|
-
const BUILD_DIRS = /* @__PURE__ */ new Set([
|
|
361
|
-
"dist",
|
|
362
|
-
"build",
|
|
363
|
-
"lib",
|
|
364
|
-
"out",
|
|
365
|
-
"es",
|
|
366
|
-
"esm",
|
|
367
|
-
"cjs",
|
|
368
|
-
"umd",
|
|
369
|
-
"src",
|
|
370
|
-
"public",
|
|
371
|
-
"www"
|
|
372
|
-
]);
|
|
373
|
-
function dirSegments(url) {
|
|
374
|
-
const parts = url.pathname.split("/").filter(Boolean);
|
|
375
|
-
const last = parts[parts.length - 1] ?? "";
|
|
376
|
-
if (/\.[a-z0-9]+$/i.test(last)) parts.pop();
|
|
377
|
-
return parts;
|
|
378
|
-
}
|
|
379
|
-
function pickPlugins(pkg) {
|
|
380
|
-
const arr = pkg?.plugins;
|
|
381
|
-
if (!Array.isArray(arr)) return null;
|
|
382
|
-
return arr.filter((p) => p && typeof p === "object").map((p) => ({
|
|
383
|
-
id: typeof p.id === "string" ? p.id : void 0,
|
|
384
|
-
name: typeof p.name === "string" ? p.name : void 0,
|
|
385
|
-
type: typeof p.type === "string" ? p.type : void 0,
|
|
386
|
-
supportedDatatypes: p.supportedDatatypes,
|
|
387
|
-
unlisted: p.unlisted === true ? true : void 0
|
|
388
|
-
}));
|
|
389
|
-
}
|
|
390
|
-
async function resolvePackageJson(importUrl) {
|
|
391
|
-
if (isAutomergeUrl(importUrl)) {
|
|
392
|
-
const base = getImportableUrlFromAutomergeUrl(
|
|
393
|
-
importUrl
|
|
394
|
-
);
|
|
395
|
-
const pkgUrl = new URL("package.json", base).href;
|
|
396
|
-
return fetchJson(pkgUrl);
|
|
397
|
-
}
|
|
398
|
-
if (/^https?:/i.test(importUrl)) {
|
|
399
|
-
try {
|
|
400
|
-
const u = new URL(importUrl);
|
|
401
|
-
const dirs = dirSegments(u);
|
|
402
|
-
const candidates = [dirs.join("/")];
|
|
403
|
-
while (dirs.length && BUILD_DIRS.has(dirs[dirs.length - 1].toLowerCase())) {
|
|
404
|
-
dirs.pop();
|
|
405
|
-
candidates.push(dirs.join("/"));
|
|
406
|
-
}
|
|
407
|
-
for (const dir of candidates) {
|
|
408
|
-
const base = `${u.origin}/${dir}${dir ? "/" : ""}`;
|
|
409
|
-
const pkg = await fetchJson(new URL("package.json", base).href);
|
|
410
|
-
if (pkg && (pkg.name || pkg.title || Array.isArray(pkg.plugins)))
|
|
411
|
-
return pkg;
|
|
412
|
-
}
|
|
413
|
-
} catch {
|
|
414
|
-
}
|
|
415
|
-
}
|
|
416
|
-
return void 0;
|
|
417
|
-
}
|
|
418
|
-
async function resolvePackageMeta(importUrl) {
|
|
419
|
-
return pickMeta(await resolvePackageJson(importUrl) ?? {});
|
|
420
|
-
}
|
|
421
|
-
async function resolvePackageInfo(importUrl) {
|
|
422
|
-
const pkg = await resolvePackageJson(importUrl);
|
|
423
|
-
return { meta: pickMeta(pkg ?? {}), plugins: pickPlugins(pkg) };
|
|
424
|
-
}
|
|
425
|
-
function shortenAutomerge(url) {
|
|
426
|
-
const id = url.slice("automerge:".length).replace(/[@?#].*$/, "");
|
|
427
|
-
return id.length > 10 ? `automerge:${id.slice(0, 8)}…` : url;
|
|
428
|
-
}
|
|
429
|
-
function packageDisplayName(importUrl, meta) {
|
|
430
|
-
if (meta?.title) return meta.title;
|
|
431
|
-
if (meta?.name) return meta.name;
|
|
432
|
-
if (!importUrl) return "(unknown source)";
|
|
433
|
-
if (isAutomergeUrl(importUrl)) return shortenAutomerge(importUrl);
|
|
434
|
-
if (/^https?:/i.test(importUrl)) {
|
|
435
|
-
try {
|
|
436
|
-
const u = new URL(importUrl);
|
|
437
|
-
const parts = dirSegments(u);
|
|
438
|
-
while (parts.length && BUILD_DIRS.has(parts[parts.length - 1].toLowerCase())) {
|
|
439
|
-
parts.pop();
|
|
440
|
-
}
|
|
441
|
-
return parts[parts.length - 1] || u.hostname;
|
|
442
|
-
} catch {
|
|
443
|
-
return importUrl;
|
|
444
|
-
}
|
|
445
|
-
}
|
|
446
|
-
return importUrl;
|
|
447
|
-
}
|
|
448
|
-
var _tmpl$ = /* @__PURE__ */ template(`<li class=pw-more><button class=pw-more__btn>`), _tmpl$2 = /* @__PURE__ */ template(`<span class=pw-packages__origin>`), _tmpl$3 = /* @__PURE__ */ template(`<span class=pw-packages__unlisted title="Hidden from new-document menus and pickers">unlisted`), _tmpl$4 = /* @__PURE__ */ template(`<code>`), _tmpl$5 = /* @__PURE__ */ template(`<span class=pw-plugin__supports><span class=pw-plugin__supports-label>supports</span> `), _tmpl$6 = /* @__PURE__ */ template(`<li class=pw-plugin><span class=pw-plugin__dot></span><span class=pw-plugin__name></span><span class=pw-plugin__type>`), _tmpl$7 = /* @__PURE__ */ template(`<div class=pw-source__lines>`), _tmpl$8 = /* @__PURE__ */ template(`<span class=pw-source__none>no import url`), _tmpl$9 = /* @__PURE__ */ template(`<button class=pw-actions__btn>open`), _tmpl$0 = /* @__PURE__ */ template(`<button class="pw-actions__btn pw-actions__btn--danger"title="Remove this module from the settings doc you're viewing">delete`), _tmpl$1 = /* @__PURE__ */ template(`<div class=pw-actions>`), _tmpl$10 = /* @__PURE__ */ template(`<span class=pw-packages__stat-of> / `), _tmpl$11 = /* @__PURE__ */ template(`<div class=pw-package-notice role=status>Using a custom system package list.`), _tmpl$12 = /* @__PURE__ */ template(`<div class=pw-package-notice role=alert>This package list is not being watched by this window.`), _tmpl$13 = /* @__PURE__ */ template(`<div class=pw-package-notices>`), _tmpl$14 = /* @__PURE__ */ template(`<div class=pw-broken>`), _tmpl$15 = /* @__PURE__ */ template(`<ul class=pw-cards>`), _tmpl$16 = /* @__PURE__ */ template(`<div class=pw-registries>`), _tmpl$17 = /* @__PURE__ */ template(`<div class=pw-table-wrap><table class=pw-table><thead><tr><th class="pw-table__th pw-table__th--plain">importUrl</th></tr></thead><tbody>`), _tmpl$18 = /* @__PURE__ */ template(`<div class=pw-install__error>`), _tmpl$19 = /* @__PURE__ */ template(`<div class=pw-install__loading>Reading package…`), _tmpl$20 = /* @__PURE__ */ template(`<span class=pw-install__version>v`), _tmpl$21 = /* @__PURE__ */ template(`<ul class=pw-install__plugins>`), _tmpl$22 = /* @__PURE__ */ template(`<div class=pw-install__card><div class=pw-install__card-head><h3 class=pw-install__pkg>`), _tmpl$23 = /* @__PURE__ */ template(`<div class=pw-install__preview>`), _tmpl$24 = /* @__PURE__ */ template(`<span class=pw-install__already>Already in your package list`), _tmpl$25 = /* @__PURE__ */ template(`<div class=pw-modal role=dialog aria-modal=true><div class=pw-install><header class=pw-install__head><h2 class=pw-install__title>Install a package</h2><button class=pw-install__close title=Close>×</button></header><p class=pw-install__blurb>Paste an <code>automerge:</code> or <code>https://</code> URL to add it to your package list.</p><input class=pw-install__input type=text autocomplete=off placeholder="automerge:… or https://…"><footer class=pw-install__foot><button class=pw-install__cancel>Cancel</button><button class=pw-install__add>Add to my package list`), _tmpl$26 = /* @__PURE__ */ template(`<div class=pw-packages><header class=pw-packages__head><div class=pw-packages__toolbar><input class=pw-packages__search type=text placeholder="Filter… or paste a URL to install"><div class=pw-packages__stats><span><strong></strong> plugins</span><span><strong></strong> packages</span><span><strong></strong> types</span></div></div><div class=pw-packages__tabbar><div class=pw-packages__tabs role=tablist></div><div class=pw-packages__origins>`), _tmpl$27 = /* @__PURE__ */ template(`<button class=pw-packages__tab>`), _tmpl$28 = /* @__PURE__ */ template(`<span class=pw-packages__origin-count>`), _tmpl$29 = /* @__PURE__ */ template(`<button class=pw-packages__origin-chip>`), _tmpl$30 = /* @__PURE__ */ template(`<span class=pw-broken__name>`), _tmpl$31 = /* @__PURE__ */ template(`<span class=pw-card__version>v`), _tmpl$32 = /* @__PURE__ */ template(`<ul class="pw-install__plugins pw-broken__plugins">`), _tmpl$33 = /* @__PURE__ */ template(`<div class=pw-broken__box role=alert><div class=pw-broken__head><span class=pw-broken__label>Failed to import</span><div class=pw-actions><button class="pw-actions__btn pw-actions__btn--danger"title="Delete this module from your package list">delete</button></div></div><pre class=pw-broken__trace>`), _tmpl$34 = /* @__PURE__ */ template(`<span class=pw-plugin__type>`), _tmpl$35 = /* @__PURE__ */ template(`<span class=pw-install__plugin-supports>supports `), _tmpl$36 = /* @__PURE__ */ template(`<li class=pw-install__plugin><span class=pw-install__plugin-name>`), _tmpl$37 = /* @__PURE__ */ template(`<div class=pw-packages__empty>`), _tmpl$38 = /* @__PURE__ */ template(`<div class=pw-card__pkgname>`), _tmpl$39 = /* @__PURE__ */ template(`<footer class=pw-card__foot>`), _tmpl$40 = /* @__PURE__ */ template(`<li class=pw-card><header class=pw-card__head><h2 class=pw-card__name></h2><div class=pw-card__badges><span class=pw-card__count> plugin</span></div></header><div class=pw-card__source></div><ul class=pw-plugins>`), _tmpl$41 = /* @__PURE__ */ template(`<section class=pw-registry><header class=pw-registry__head><h2 class=pw-registry__name></h2><span class=pw-registry__count></span></header><ul class=pw-reglist>`), _tmpl$42 = /* @__PURE__ */ template(`<span class=pw-regitem__supports>supports `), _tmpl$43 = /* @__PURE__ */ template(`<li class=pw-regitem><div class=pw-regitem__main><span class=pw-regitem__name></span></div><div class=pw-regitem__source><span class=pw-regitem__pkg>`), _tmpl$44 = /* @__PURE__ */ template(`<span class=pw-table__arrow>`), _tmpl$45 = /* @__PURE__ */ template(`<th class=pw-table__th>`), _tmpl$46 = /* @__PURE__ */ template(`<span class=pw-table__supports>`), _tmpl$47 = /* @__PURE__ */ template(`<span title="Hidden from new-document menus and pickers">✓`), _tmpl$48 = /* @__PURE__ */ template(`<tr class=pw-table__row><td class=pw-table__name></td><td class=pw-table__reg></td><td></td><td class=pw-table__pkg></td><td></td><td class=pw-table__flag></td><td class=pw-table__url><div class=pw-source>`), _tmpl$49 = /* @__PURE__ */ template(`<div class=pw-install__none>`);
|
|
449
|
-
const VIEW_LABEL = {
|
|
450
|
-
packages: "By package",
|
|
451
|
-
registries: "By type",
|
|
452
|
-
table: "Table"
|
|
453
|
-
};
|
|
454
|
-
async function previewPackage(url) {
|
|
455
|
-
if (isAutomergeUrl(url)) {
|
|
456
|
-
const bare = bareModuleUrl(url);
|
|
457
|
-
const [pluginsResult2, meta] = await Promise.all([discoverPlugins(bare).then((plugins) => ({
|
|
458
|
-
plugins
|
|
459
|
-
}), (e) => ({
|
|
460
|
-
error: e instanceof Error ? e.message : "Couldn't read the package."
|
|
461
|
-
})), resolvePackageMeta(bare).catch(() => ({}))]);
|
|
462
|
-
return {
|
|
463
|
-
meta,
|
|
464
|
-
plugins: "plugins" in pluginsResult2 ? pluginsResult2.plugins : null,
|
|
465
|
-
error: "error" in pluginsResult2 ? pluginsResult2.error : void 0
|
|
466
|
-
};
|
|
467
|
-
}
|
|
468
|
-
const [pluginsResult, info] = await Promise.all([discoverHttpPlugins(url).then((plugins) => ({
|
|
469
|
-
plugins
|
|
470
|
-
}), (e) => ({
|
|
471
|
-
error: e instanceof Error ? e.message : "Couldn't import the package."
|
|
472
|
-
})), resolvePackageInfo(url).catch(() => ({
|
|
473
|
-
meta: {},
|
|
474
|
-
plugins: null
|
|
475
|
-
}))]);
|
|
476
|
-
const imported = "plugins" in pluginsResult ? pluginsResult.plugins : null;
|
|
477
|
-
const declared = info.plugins;
|
|
478
|
-
return {
|
|
479
|
-
meta: info.meta,
|
|
480
|
-
plugins: imported && imported.length ? imported : declared,
|
|
481
|
-
// Only surface the import failure when there are no declared plugins to
|
|
482
|
-
// show in its place.
|
|
483
|
-
error: "error" in pluginsResult && !(declared && declared.length) ? pluginsResult.error : void 0
|
|
484
|
-
};
|
|
485
|
-
}
|
|
486
|
-
function datatypesLabel(dt) {
|
|
487
|
-
if (dt === void 0) return null;
|
|
488
|
-
if (typeof dt === "string") return dt === "*" ? "any" : dt;
|
|
489
|
-
if (dt.includes("*")) return "any";
|
|
490
|
-
if (dt.length === 0) return "none";
|
|
491
|
-
return dt.join(", ");
|
|
492
|
-
}
|
|
493
|
-
function prettyType(type) {
|
|
494
|
-
const [ns, rest] = type.includes(":") ? type.split(/:(.*)/) : ["", type];
|
|
495
|
-
return ns === "patchwork" ? rest : type;
|
|
496
|
-
}
|
|
497
|
-
function Collapsible(props) {
|
|
498
|
-
const [expanded, setExpanded] = createSignal(false);
|
|
499
|
-
const limit = () => props.limit ?? 4;
|
|
500
|
-
const shown = createMemo(() => expanded() ? props.each : props.each.slice(0, limit()));
|
|
501
|
-
const hidden = () => Math.max(0, props.each.length - limit());
|
|
502
|
-
return [createComponent(For, {
|
|
503
|
-
get each() {
|
|
504
|
-
return shown();
|
|
505
|
-
},
|
|
506
|
-
children: (item) => props.render(item)
|
|
507
|
-
}), createComponent(Show, {
|
|
508
|
-
get when() {
|
|
509
|
-
return hidden() > 0;
|
|
510
|
-
},
|
|
511
|
-
get children() {
|
|
512
|
-
var _el$ = _tmpl$(), _el$2 = _el$.firstChild;
|
|
513
|
-
_el$2.$$click = () => setExpanded((v) => !v);
|
|
514
|
-
insert(_el$2, (() => {
|
|
515
|
-
var _c$ = memo(() => !!expanded());
|
|
516
|
-
return () => _c$() ? "show less" : `show ${hidden()} more`;
|
|
517
|
-
})());
|
|
518
|
-
return _el$;
|
|
519
|
-
}
|
|
520
|
-
})];
|
|
521
|
-
}
|
|
522
|
-
function Packages(props) {
|
|
523
|
-
const [doc, setDoc] = createSignal(props.handle.doc());
|
|
524
|
-
const onChange = () => setDoc(props.handle.doc());
|
|
525
|
-
props.handle.on("change", onChange);
|
|
526
|
-
onCleanup(() => props.handle.off("change", onChange));
|
|
527
|
-
const installedKeys = createMemo(() => moduleKeySet(doc()?.modules));
|
|
528
|
-
const {
|
|
529
|
-
snapshot
|
|
530
|
-
} = useLiveRegistries();
|
|
531
|
-
const viewedKey = createMemo(() => moduleKey(props.handle.url));
|
|
532
|
-
const settingsSources = createMemo(() => {
|
|
533
|
-
snapshot();
|
|
534
|
-
return readSettingsSources();
|
|
535
|
-
});
|
|
536
|
-
const systemKeys = createMemo(() => {
|
|
537
|
-
const keys = /* @__PURE__ */ new Set();
|
|
538
|
-
for (const source of settingsSources()) {
|
|
539
|
-
if (source.key === viewedKey()) continue;
|
|
540
|
-
for (const key of source.moduleKeys) keys.add(key);
|
|
541
|
-
}
|
|
542
|
-
return keys;
|
|
543
|
-
});
|
|
544
|
-
const systemPackageListUrl = createMemo(() => settingsSources().find((source) => source.name === "system")?.url);
|
|
545
|
-
const isCustomSystemPackageList = createMemo(() => systemPackageListUrl() !== void 0 && systemPackageListUrl() !== "/modules.json");
|
|
546
|
-
const isWatchedPackageList = createMemo(() => {
|
|
547
|
-
const key = viewedKey();
|
|
548
|
-
return !!key && settingsSources().some((source) => source.key === key);
|
|
549
|
-
});
|
|
550
|
-
const headsByDoc = useDocHeadsMap(() => snapshot().map((e) => e.importUrl));
|
|
551
|
-
const headsFor = (importUrl) => {
|
|
552
|
-
if (!importUrl) return [];
|
|
553
|
-
const embedded = headsOf(importUrl);
|
|
554
|
-
if (embedded.length) return embedded;
|
|
555
|
-
const id = documentIdOf(importUrl);
|
|
556
|
-
return id && headsByDoc()[id] || [];
|
|
557
|
-
};
|
|
558
|
-
const pluginImportKeys = createMemo(() => {
|
|
559
|
-
const keys = /* @__PURE__ */ new Set();
|
|
560
|
-
for (const e of snapshot()) {
|
|
561
|
-
const k = moduleKey(e.importUrl);
|
|
562
|
-
if (k) keys.add(k);
|
|
563
|
-
}
|
|
564
|
-
return keys;
|
|
565
|
-
});
|
|
566
|
-
const orphanModules = createMemo(() => {
|
|
567
|
-
const registered = pluginImportKeys();
|
|
568
|
-
return (doc()?.modules ?? []).filter((m) => {
|
|
569
|
-
const k = moduleKey(m);
|
|
570
|
-
return !!k && !registered.has(k);
|
|
571
|
-
});
|
|
572
|
-
});
|
|
573
|
-
const [probes, setProbes] = createSignal({});
|
|
574
|
-
const probed = /* @__PURE__ */ new Set();
|
|
575
|
-
createEffect(() => {
|
|
576
|
-
for (const url of orphanModules()) {
|
|
577
|
-
const key = moduleKey(url);
|
|
578
|
-
if (!key || probed.has(key)) continue;
|
|
579
|
-
probed.add(key);
|
|
580
|
-
setProbes((p) => ({
|
|
581
|
-
...p,
|
|
582
|
-
[key]: {
|
|
583
|
-
status: "loading"
|
|
584
|
-
}
|
|
585
|
-
}));
|
|
586
|
-
void discoverPackagePlugins(bareModuleUrl(url)).then(() => setProbes((p) => ({
|
|
587
|
-
...p,
|
|
588
|
-
[key]: {
|
|
589
|
-
status: "ok"
|
|
590
|
-
}
|
|
591
|
-
})), (e) => setProbes((p) => ({
|
|
592
|
-
...p,
|
|
593
|
-
// discoverPlugins rejects with the worker's stack as the message.
|
|
594
|
-
[key]: {
|
|
595
|
-
status: "error",
|
|
596
|
-
error: e instanceof Error ? e.message : String(e)
|
|
597
|
-
}
|
|
598
|
-
})));
|
|
599
|
-
}
|
|
600
|
-
});
|
|
601
|
-
const brokenModules = createMemo(() => orphanModules().map((url) => ({
|
|
602
|
-
url,
|
|
603
|
-
probe: probes()[moduleKey(url)]
|
|
604
|
-
})).filter((b) => b.probe?.status === "error").map((b) => ({
|
|
605
|
-
url: b.url,
|
|
606
|
-
error: b.probe.error ?? "Unknown error"
|
|
607
|
-
})));
|
|
608
|
-
const [brokenInfo, setBrokenInfo] = createSignal({});
|
|
609
|
-
const brokenRequested = /* @__PURE__ */ new Set();
|
|
610
|
-
createEffect(() => {
|
|
611
|
-
for (const {
|
|
612
|
-
url
|
|
613
|
-
} of brokenModules()) {
|
|
614
|
-
const key = moduleKey(url);
|
|
615
|
-
if (!key || brokenRequested.has(key)) continue;
|
|
616
|
-
brokenRequested.add(key);
|
|
617
|
-
void resolvePackageInfo(bareModuleUrl(url)).then((info) => setBrokenInfo((prev) => ({
|
|
618
|
-
...prev,
|
|
619
|
-
[key]: info
|
|
620
|
-
})));
|
|
621
|
-
}
|
|
622
|
-
});
|
|
623
|
-
const [pkgMetas, setPkgMetas] = createSignal({});
|
|
624
|
-
const requested = /* @__PURE__ */ new Set();
|
|
625
|
-
createEffect(() => {
|
|
626
|
-
for (const entry of snapshot()) {
|
|
627
|
-
const url = entry.importUrl;
|
|
628
|
-
if (!url || requested.has(url)) continue;
|
|
629
|
-
requested.add(url);
|
|
630
|
-
void resolvePackageMeta(url).then((meta) => setPkgMetas((prev) => ({
|
|
631
|
-
...prev,
|
|
632
|
-
[url]: meta
|
|
633
|
-
})));
|
|
634
|
-
}
|
|
635
|
-
});
|
|
636
|
-
const enriched = createMemo(() => {
|
|
637
|
-
const installed = installedKeys();
|
|
638
|
-
const system = systemKeys();
|
|
639
|
-
const metas = pkgMetas();
|
|
640
|
-
return snapshot().map((entry) => {
|
|
641
|
-
const meta = entry.importUrl ? metas[entry.importUrl] : void 0;
|
|
642
|
-
return {
|
|
643
|
-
...entry,
|
|
644
|
-
origin: classifyOrigin(entry.importUrl, installed, system),
|
|
645
|
-
pkgMeta: meta,
|
|
646
|
-
pkgName: packageDisplayName(entry.importUrl, meta)
|
|
647
|
-
};
|
|
648
|
-
});
|
|
649
|
-
});
|
|
650
|
-
const [view, setView] = createSignal("packages");
|
|
651
|
-
const [search, setSearch] = createSignal("");
|
|
652
|
-
const [originFilter, setOriginFilter] = createSignal("all");
|
|
653
|
-
const [sortKey, setSortKey] = createSignal("name");
|
|
654
|
-
const [sortAsc, setSortAsc] = createSignal(true);
|
|
655
|
-
const originCounts = createMemo(() => {
|
|
656
|
-
const counts = {
|
|
657
|
-
installed: 0,
|
|
658
|
-
ephemeral: 0,
|
|
659
|
-
core: 0,
|
|
660
|
-
unknown: 0
|
|
661
|
-
};
|
|
662
|
-
for (const e of enriched()) counts[e.origin]++;
|
|
663
|
-
return counts;
|
|
664
|
-
});
|
|
665
|
-
const filtered = createMemo(() => {
|
|
666
|
-
const q = search().trim().toLowerCase();
|
|
667
|
-
const of = originFilter();
|
|
668
|
-
return enriched().filter((e) => {
|
|
669
|
-
if (of !== "all" && e.origin !== of) return false;
|
|
670
|
-
if (q) {
|
|
671
|
-
const hay = [e.name, e.id, e.registry, e.type, e.importUrl, e.pkgName, datatypesLabel(e.supportedDatatypes), e.unlisted ? "unlisted" : ""].filter(Boolean).join(" ").toLowerCase();
|
|
672
|
-
if (!hay.includes(q)) return false;
|
|
673
|
-
}
|
|
674
|
-
return true;
|
|
675
|
-
});
|
|
676
|
-
});
|
|
677
|
-
const stats = createMemo(() => {
|
|
678
|
-
const rows = filtered();
|
|
679
|
-
const packages = /* @__PURE__ */ new Set();
|
|
680
|
-
const registries = /* @__PURE__ */ new Set();
|
|
681
|
-
for (const e of rows) {
|
|
682
|
-
packages.add(e.importUrl ?? "∅");
|
|
683
|
-
registries.add(e.registry);
|
|
684
|
-
}
|
|
685
|
-
return {
|
|
686
|
-
plugins: rows.length,
|
|
687
|
-
total: enriched().length,
|
|
688
|
-
packages: packages.size,
|
|
689
|
-
registries: registries.size
|
|
690
|
-
};
|
|
691
|
-
});
|
|
692
|
-
const packageGroups = createMemo(() => {
|
|
693
|
-
const groups = /* @__PURE__ */ new Map();
|
|
694
|
-
for (const e of filtered()) {
|
|
695
|
-
const key = e.importUrl ?? "∅";
|
|
696
|
-
let group = groups.get(key);
|
|
697
|
-
if (!group) {
|
|
698
|
-
group = {
|
|
699
|
-
importUrl: e.importUrl,
|
|
700
|
-
name: e.pkgName,
|
|
701
|
-
meta: e.pkgMeta,
|
|
702
|
-
origin: e.origin,
|
|
703
|
-
plugins: []
|
|
704
|
-
};
|
|
705
|
-
groups.set(key, group);
|
|
706
|
-
}
|
|
707
|
-
group.plugins.push(e);
|
|
708
|
-
}
|
|
709
|
-
const arr = [...groups.values()];
|
|
710
|
-
for (const g of arr) g.plugins.sort((a, b) => a.name.localeCompare(b.name));
|
|
711
|
-
arr.sort((a, b) => originRank(a.origin) - originRank(b.origin) || a.name.localeCompare(b.name));
|
|
712
|
-
return arr;
|
|
713
|
-
});
|
|
714
|
-
const registryGroups = createMemo(() => {
|
|
715
|
-
const groups = /* @__PURE__ */ new Map();
|
|
716
|
-
for (const e of filtered()) {
|
|
717
|
-
const list = groups.get(e.registry);
|
|
718
|
-
if (list) list.push(e);
|
|
719
|
-
else groups.set(e.registry, [e]);
|
|
720
|
-
}
|
|
721
|
-
return [...groups.entries()].map(([registry, plugins]) => ({
|
|
722
|
-
registry,
|
|
723
|
-
plugins: plugins.sort((a, b) => a.name.localeCompare(b.name))
|
|
724
|
-
})).sort((a, b) => a.registry.localeCompare(b.registry));
|
|
725
|
-
});
|
|
726
|
-
const tableRows = createMemo(() => {
|
|
727
|
-
const key = sortKey();
|
|
728
|
-
const dir = sortAsc() ? 1 : -1;
|
|
729
|
-
const value = (e) => {
|
|
730
|
-
switch (key) {
|
|
731
|
-
case "registry":
|
|
732
|
-
return e.registry;
|
|
733
|
-
case "id":
|
|
734
|
-
return e.id;
|
|
735
|
-
case "package":
|
|
736
|
-
return e.pkgName;
|
|
737
|
-
case "origin":
|
|
738
|
-
return String(originRank(e.origin));
|
|
739
|
-
// Ascending groups the unlisted ones first — that's what you sort by
|
|
740
|
-
// this column to find.
|
|
741
|
-
case "unlisted":
|
|
742
|
-
return e.unlisted ? "0" : "1";
|
|
743
|
-
default:
|
|
744
|
-
return e.name;
|
|
745
|
-
}
|
|
746
|
-
};
|
|
747
|
-
return [...filtered()].sort((a, b) => value(a).localeCompare(value(b)) * dir || a.name.localeCompare(b.name));
|
|
748
|
-
});
|
|
749
|
-
const toggleSort = (key) => {
|
|
750
|
-
if (sortKey() === key) setSortAsc((v) => !v);
|
|
751
|
-
else {
|
|
752
|
-
setSortKey(key);
|
|
753
|
-
setSortAsc(true);
|
|
754
|
-
}
|
|
755
|
-
};
|
|
756
|
-
const [copied, setCopied] = createSignal(null);
|
|
757
|
-
let copyTimer;
|
|
758
|
-
const copy = (value) => {
|
|
759
|
-
try {
|
|
760
|
-
void navigator.clipboard?.writeText(value);
|
|
761
|
-
} catch {
|
|
762
|
-
}
|
|
763
|
-
setCopied(value);
|
|
764
|
-
clearTimeout(copyTimer);
|
|
765
|
-
copyTimer = setTimeout(() => setCopied(null), 1200);
|
|
766
|
-
};
|
|
767
|
-
onCleanup(() => clearTimeout(copyTimer));
|
|
768
|
-
const openDoc = (url) => {
|
|
769
|
-
props.element.dispatchEvent(new CustomEvent("patchwork:open-document", {
|
|
770
|
-
detail: {
|
|
771
|
-
url
|
|
772
|
-
},
|
|
773
|
-
bubbles: true,
|
|
774
|
-
composed: true
|
|
775
|
-
}));
|
|
776
|
-
};
|
|
777
|
-
const uninstall = (importUrl) => {
|
|
778
|
-
const key = moduleKey(importUrl);
|
|
779
|
-
if (!key) return;
|
|
780
|
-
props.handle.change((d) => {
|
|
781
|
-
if (!Array.isArray(d.modules)) return;
|
|
782
|
-
const idx = d.modules.findIndex((m) => moduleKey(m) === key);
|
|
783
|
-
if (idx >= 0) d.modules.splice(idx, 1);
|
|
784
|
-
});
|
|
785
|
-
deactivateModule(importUrl);
|
|
786
|
-
};
|
|
787
|
-
const hasActions = (importUrl, origin) => isAutomergeUrl(importUrl) || origin === "installed";
|
|
788
|
-
const [installOpen, setInstallOpen] = createSignal(false);
|
|
789
|
-
const [installUrl, setInstallUrl] = createSignal("");
|
|
790
|
-
const [installBusy, setInstallBusy] = createSignal(false);
|
|
791
|
-
const [installPlugins, setInstallPlugins] = createSignal(null);
|
|
792
|
-
const [installMeta, setInstallMeta] = createSignal(null);
|
|
793
|
-
const [installError, setInstallError] = createSignal(null);
|
|
794
|
-
const installTarget = createMemo(() => installUrl().trim());
|
|
795
|
-
const isInstallableUrl = (url) => {
|
|
796
|
-
if (isAutomergeUrl(url)) {
|
|
797
|
-
const id = documentIdOf(url);
|
|
798
|
-
return !!id && id.length >= 16;
|
|
799
|
-
}
|
|
800
|
-
if (/^https?:/i.test(url)) {
|
|
801
|
-
try {
|
|
802
|
-
new URL(url);
|
|
803
|
-
return true;
|
|
804
|
-
} catch {
|
|
805
|
-
return false;
|
|
806
|
-
}
|
|
807
|
-
}
|
|
808
|
-
return false;
|
|
809
|
-
};
|
|
810
|
-
const installValid = createMemo(() => isInstallableUrl(installTarget()));
|
|
811
|
-
const installKey = createMemo(() => moduleKey(installTarget()));
|
|
812
|
-
const alreadyInstalled = createMemo(() => {
|
|
813
|
-
const key = installKey();
|
|
814
|
-
return !!key && installedKeys().has(key);
|
|
815
|
-
});
|
|
816
|
-
const resetPreview = () => {
|
|
817
|
-
setInstallBusy(false);
|
|
818
|
-
setInstallPlugins(null);
|
|
819
|
-
setInstallMeta(null);
|
|
820
|
-
setInstallError(null);
|
|
821
|
-
};
|
|
822
|
-
let previewToken = 0;
|
|
823
|
-
createEffect(() => {
|
|
824
|
-
if (!installOpen()) return;
|
|
825
|
-
const raw = installTarget();
|
|
826
|
-
resetPreview();
|
|
827
|
-
if (!raw) return;
|
|
828
|
-
if (!installValid()) {
|
|
829
|
-
setInstallError("That doesn't look like an automerge: or https:// URL.");
|
|
830
|
-
return;
|
|
831
|
-
}
|
|
832
|
-
const token = ++previewToken;
|
|
833
|
-
setInstallBusy(true);
|
|
834
|
-
const timer = setTimeout(() => {
|
|
835
|
-
void previewPackage(raw).then((res) => {
|
|
836
|
-
if (token !== previewToken) return;
|
|
837
|
-
setInstallBusy(false);
|
|
838
|
-
setInstallMeta(res.meta);
|
|
839
|
-
setInstallPlugins(res.plugins);
|
|
840
|
-
if (res.error) setInstallError(res.error);
|
|
841
|
-
});
|
|
842
|
-
}, 350);
|
|
843
|
-
onCleanup(() => clearTimeout(timer));
|
|
844
|
-
});
|
|
845
|
-
const closeInstall = () => {
|
|
846
|
-
setInstallOpen(false);
|
|
847
|
-
setInstallUrl("");
|
|
848
|
-
resetPreview();
|
|
849
|
-
};
|
|
850
|
-
const doInstall = () => {
|
|
851
|
-
const raw = installTarget();
|
|
852
|
-
const key = installKey();
|
|
853
|
-
if (!installValid() || !key) return;
|
|
854
|
-
if (!alreadyInstalled()) {
|
|
855
|
-
props.handle.change((d) => {
|
|
856
|
-
if (!Array.isArray(d.modules)) d.modules = [];
|
|
857
|
-
if (!d.modules.some((m) => moduleKey(m) === key)) d.modules.push(raw);
|
|
858
|
-
});
|
|
859
|
-
}
|
|
860
|
-
closeInstall();
|
|
861
|
-
};
|
|
862
|
-
const onSearchInput = (value) => {
|
|
863
|
-
const trimmed = value.trim();
|
|
864
|
-
if (isInstallableUrl(trimmed)) {
|
|
865
|
-
setSearch("");
|
|
866
|
-
setInstallUrl(trimmed);
|
|
867
|
-
setInstallOpen(true);
|
|
868
|
-
return true;
|
|
869
|
-
}
|
|
870
|
-
setSearch(value);
|
|
871
|
-
return false;
|
|
872
|
-
};
|
|
873
|
-
const OriginBadge = (p) => (() => {
|
|
874
|
-
var _el$3 = _tmpl$2();
|
|
875
|
-
insert(_el$3, () => ORIGIN_LABEL[p.origin]);
|
|
876
|
-
effect((_p$) => {
|
|
877
|
-
var _v$ = p.origin, _v$2 = ORIGIN_HINT[p.origin];
|
|
878
|
-
_v$ !== _p$.e && setAttribute(_el$3, "data-origin", _p$.e = _v$);
|
|
879
|
-
_v$2 !== _p$.t && setAttribute(_el$3, "title", _p$.t = _v$2);
|
|
880
|
-
return _p$;
|
|
881
|
-
}, {
|
|
882
|
-
e: void 0,
|
|
883
|
-
t: void 0
|
|
884
|
-
});
|
|
885
|
-
return _el$3;
|
|
886
|
-
})();
|
|
887
|
-
const UnlistedBadge = () => _tmpl$3();
|
|
888
|
-
const Copyable = (p) => (() => {
|
|
889
|
-
var _el$5 = _tmpl$4();
|
|
890
|
-
_el$5.$$click = () => copy(p.value);
|
|
891
|
-
insert(_el$5, (() => {
|
|
892
|
-
var _c$2 = memo(() => copied() === p.value);
|
|
893
|
-
return () => _c$2() ? "copied!" : p.label ?? p.value;
|
|
894
|
-
})());
|
|
895
|
-
effect((_p$) => {
|
|
896
|
-
var _v$3 = `pw-packages__copy ${p.class ?? ""}`, _v$4 = !!(copied() === p.value), _v$5 = p.title ?? "Click to copy";
|
|
897
|
-
_v$3 !== _p$.e && className(_el$5, _p$.e = _v$3);
|
|
898
|
-
_v$4 !== _p$.t && _el$5.classList.toggle("is-copied", _p$.t = _v$4);
|
|
899
|
-
_v$5 !== _p$.a && setAttribute(_el$5, "title", _p$.a = _v$5);
|
|
900
|
-
return _p$;
|
|
901
|
-
}, {
|
|
902
|
-
e: void 0,
|
|
903
|
-
t: void 0,
|
|
904
|
-
a: void 0
|
|
905
|
-
});
|
|
906
|
-
return _el$5;
|
|
907
|
-
})();
|
|
908
|
-
const PluginRow = (p) => {
|
|
909
|
-
const dts = () => datatypesLabel(p.plugin.supportedDatatypes);
|
|
910
|
-
return (() => {
|
|
911
|
-
var _el$6 = _tmpl$6(), _el$7 = _el$6.firstChild, _el$8 = _el$7.nextSibling, _el$9 = _el$8.nextSibling;
|
|
912
|
-
insert(_el$8, () => p.plugin.name);
|
|
913
|
-
insert(_el$9, () => prettyType(p.plugin.type));
|
|
914
|
-
insert(_el$6, createComponent(Show, {
|
|
915
|
-
get when() {
|
|
916
|
-
return p.plugin.unlisted;
|
|
917
|
-
},
|
|
918
|
-
get children() {
|
|
919
|
-
return createComponent(UnlistedBadge, {});
|
|
920
|
-
}
|
|
921
|
-
}), null);
|
|
922
|
-
insert(_el$6, createComponent(Copyable, {
|
|
923
|
-
get value() {
|
|
924
|
-
return p.plugin.id;
|
|
925
|
-
},
|
|
926
|
-
"class": "pw-plugin__id",
|
|
927
|
-
title: "Plugin id — click to copy"
|
|
928
|
-
}), null);
|
|
929
|
-
insert(_el$6, createComponent(Show, {
|
|
930
|
-
get when() {
|
|
931
|
-
return dts();
|
|
932
|
-
},
|
|
933
|
-
get children() {
|
|
934
|
-
var _el$0 = _tmpl$5(), _el$1 = _el$0.firstChild;
|
|
935
|
-
_el$1.nextSibling;
|
|
936
|
-
insert(_el$0, dts, null);
|
|
937
|
-
return _el$0;
|
|
938
|
-
}
|
|
939
|
-
}), null);
|
|
940
|
-
effect((_p$) => {
|
|
941
|
-
var _v$6 = p.plugin.origin, _v$7 = !!p.plugin.unlisted;
|
|
942
|
-
_v$6 !== _p$.e && setAttribute(_el$7, "data-origin", _p$.e = _v$6);
|
|
943
|
-
_v$7 !== _p$.t && _el$8.classList.toggle("is-unlisted", _p$.t = _v$7);
|
|
944
|
-
return _p$;
|
|
945
|
-
}, {
|
|
946
|
-
e: void 0,
|
|
947
|
-
t: void 0
|
|
948
|
-
});
|
|
949
|
-
return _el$6;
|
|
950
|
-
})();
|
|
951
|
-
};
|
|
952
|
-
const SourceLine = (p) => {
|
|
953
|
-
const heads = () => headsFor(p.importUrl);
|
|
954
|
-
const pinned = () => pinnedModuleUrl(p.importUrl, heads());
|
|
955
|
-
return createComponent(Show, {
|
|
956
|
-
get when() {
|
|
957
|
-
return p.importUrl;
|
|
958
|
-
},
|
|
959
|
-
get fallback() {
|
|
960
|
-
return _tmpl$8();
|
|
961
|
-
},
|
|
962
|
-
get children() {
|
|
963
|
-
var _el$11 = _tmpl$7();
|
|
964
|
-
insert(_el$11, createComponent(Copyable, {
|
|
965
|
-
get value() {
|
|
966
|
-
return bareModuleUrl(p.importUrl);
|
|
967
|
-
},
|
|
968
|
-
"class": "pw-source__url",
|
|
969
|
-
title: "importUrl — click to copy"
|
|
970
|
-
}), null);
|
|
971
|
-
insert(_el$11, createComponent(Show, {
|
|
972
|
-
get when() {
|
|
973
|
-
return pinned();
|
|
974
|
-
},
|
|
975
|
-
get children() {
|
|
976
|
-
return createComponent(Copyable, {
|
|
977
|
-
get value() {
|
|
978
|
-
return pinned();
|
|
979
|
-
},
|
|
980
|
-
get label() {
|
|
981
|
-
return `heads ${heads().map((h) => h.slice(0, 7)).join(" ")}`;
|
|
982
|
-
},
|
|
983
|
-
"class": "pw-source__heads",
|
|
984
|
-
title: "Copy URL pinned to these heads"
|
|
985
|
-
});
|
|
986
|
-
}
|
|
987
|
-
}), null);
|
|
988
|
-
return _el$11;
|
|
989
|
-
}
|
|
990
|
-
});
|
|
991
|
-
};
|
|
992
|
-
const SourceActions = (p) => createComponent(Show, {
|
|
993
|
-
get when() {
|
|
994
|
-
return hasActions(p.importUrl, p.origin);
|
|
995
|
-
},
|
|
996
|
-
get children() {
|
|
997
|
-
var _el$13 = _tmpl$1();
|
|
998
|
-
insert(_el$13, createComponent(Show, {
|
|
999
|
-
get when() {
|
|
1000
|
-
return isAutomergeUrl(p.importUrl);
|
|
1001
|
-
},
|
|
1002
|
-
get children() {
|
|
1003
|
-
var _el$14 = _tmpl$9();
|
|
1004
|
-
_el$14.$$click = () => openDoc(p.importUrl);
|
|
1005
|
-
return _el$14;
|
|
1006
|
-
}
|
|
1007
|
-
}), null);
|
|
1008
|
-
insert(_el$13, createComponent(Show, {
|
|
1009
|
-
get when() {
|
|
1010
|
-
return p.origin === "installed";
|
|
1011
|
-
},
|
|
1012
|
-
get children() {
|
|
1013
|
-
var _el$15 = _tmpl$0();
|
|
1014
|
-
_el$15.$$click = () => uninstall(p.importUrl);
|
|
1015
|
-
return _el$15;
|
|
1016
|
-
}
|
|
1017
|
-
}), null);
|
|
1018
|
-
return _el$13;
|
|
1019
|
-
}
|
|
1020
|
-
});
|
|
1021
|
-
return (() => {
|
|
1022
|
-
var _el$16 = _tmpl$26(), _el$17 = _el$16.firstChild, _el$18 = _el$17.firstChild, _el$19 = _el$18.firstChild, _el$20 = _el$19.nextSibling, _el$21 = _el$20.firstChild, _el$22 = _el$21.firstChild, _el$25 = _el$22.nextSibling, _el$26 = _el$21.nextSibling, _el$27 = _el$26.firstChild, _el$28 = _el$26.nextSibling, _el$29 = _el$28.firstChild, _el$30 = _el$18.nextSibling, _el$31 = _el$30.firstChild, _el$32 = _el$31.nextSibling;
|
|
1023
|
-
_el$19.$$input = (e) => {
|
|
1024
|
-
if (onSearchInput(e.currentTarget.value)) e.currentTarget.value = "";
|
|
1025
|
-
};
|
|
1026
|
-
insert(_el$22, () => stats().plugins);
|
|
1027
|
-
insert(_el$21, createComponent(Show, {
|
|
1028
|
-
get when() {
|
|
1029
|
-
return stats().plugins !== stats().total;
|
|
1030
|
-
},
|
|
1031
|
-
get children() {
|
|
1032
|
-
var _el$23 = _tmpl$10();
|
|
1033
|
-
_el$23.firstChild;
|
|
1034
|
-
insert(_el$23, () => stats().total, null);
|
|
1035
|
-
return _el$23;
|
|
1036
|
-
}
|
|
1037
|
-
}), _el$25);
|
|
1038
|
-
insert(_el$27, () => stats().packages);
|
|
1039
|
-
insert(_el$29, () => stats().registries);
|
|
1040
|
-
insert(_el$31, createComponent(For, {
|
|
1041
|
-
each: ["packages", "registries", "table"],
|
|
1042
|
-
children: (v) => (() => {
|
|
1043
|
-
var _el$66 = _tmpl$27();
|
|
1044
|
-
_el$66.$$click = () => setView(v);
|
|
1045
|
-
setAttribute(_el$66, "data-view", v);
|
|
1046
|
-
insert(_el$66, () => VIEW_LABEL[v]);
|
|
1047
|
-
effect(() => setAttribute(_el$66, "data-active", view() === v ? "" : void 0));
|
|
1048
|
-
return _el$66;
|
|
1049
|
-
})()
|
|
1050
|
-
}));
|
|
1051
|
-
insert(_el$32, createComponent(For, {
|
|
1052
|
-
get each() {
|
|
1053
|
-
return [["all", "all"], ["installed", ORIGIN_LABEL.installed], ["core", ORIGIN_LABEL.core], ["ephemeral", ORIGIN_LABEL.ephemeral]];
|
|
1054
|
-
},
|
|
1055
|
-
children: ([key, label]) => (() => {
|
|
1056
|
-
var _el$67 = _tmpl$29();
|
|
1057
|
-
_el$67.$$click = () => setOriginFilter(key);
|
|
1058
|
-
setAttribute(_el$67, "data-origin", key === "all" ? void 0 : key);
|
|
1059
|
-
insert(_el$67, label, null);
|
|
1060
|
-
insert(_el$67, createComponent(Show, {
|
|
1061
|
-
when: key !== "all",
|
|
1062
|
-
get children() {
|
|
1063
|
-
var _el$68 = _tmpl$28();
|
|
1064
|
-
insert(_el$68, () => originCounts()[key]);
|
|
1065
|
-
return _el$68;
|
|
1066
|
-
}
|
|
1067
|
-
}), null);
|
|
1068
|
-
effect((_p$) => {
|
|
1069
|
-
var _v$8 = originFilter() === key ? "" : void 0, _v$9 = key === "all" ? void 0 : ORIGIN_HINT[key];
|
|
1070
|
-
_v$8 !== _p$.e && setAttribute(_el$67, "data-active", _p$.e = _v$8);
|
|
1071
|
-
_v$9 !== _p$.t && setAttribute(_el$67, "title", _p$.t = _v$9);
|
|
1072
|
-
return _p$;
|
|
1073
|
-
}, {
|
|
1074
|
-
e: void 0,
|
|
1075
|
-
t: void 0
|
|
1076
|
-
});
|
|
1077
|
-
return _el$67;
|
|
1078
|
-
})()
|
|
1079
|
-
}));
|
|
1080
|
-
insert(_el$16, createComponent(Show, {
|
|
1081
|
-
get when() {
|
|
1082
|
-
return isCustomSystemPackageList() || !isWatchedPackageList();
|
|
1083
|
-
},
|
|
1084
|
-
get children() {
|
|
1085
|
-
var _el$33 = _tmpl$13();
|
|
1086
|
-
insert(_el$33, createComponent(Show, {
|
|
1087
|
-
get when() {
|
|
1088
|
-
return isCustomSystemPackageList();
|
|
1089
|
-
},
|
|
1090
|
-
get children() {
|
|
1091
|
-
var _el$34 = _tmpl$11();
|
|
1092
|
-
_el$34.firstChild;
|
|
1093
|
-
insert(_el$34, createComponent(Copyable, {
|
|
1094
|
-
get value() {
|
|
1095
|
-
return systemPackageListUrl();
|
|
1096
|
-
},
|
|
1097
|
-
"class": "pw-package-notice__url",
|
|
1098
|
-
title: "System package list URL — click to copy"
|
|
1099
|
-
}), null);
|
|
1100
|
-
return _el$34;
|
|
1101
|
-
}
|
|
1102
|
-
}), null);
|
|
1103
|
-
insert(_el$33, createComponent(Show, {
|
|
1104
|
-
get when() {
|
|
1105
|
-
return !isWatchedPackageList();
|
|
1106
|
-
},
|
|
1107
|
-
get children() {
|
|
1108
|
-
return _tmpl$12();
|
|
1109
|
-
}
|
|
1110
|
-
}), null);
|
|
1111
|
-
return _el$33;
|
|
1112
|
-
}
|
|
1113
|
-
}), null);
|
|
1114
|
-
insert(_el$16, createComponent(Show, {
|
|
1115
|
-
get when() {
|
|
1116
|
-
return memo(() => view() === "packages")() && brokenModules().length > 0;
|
|
1117
|
-
},
|
|
1118
|
-
get children() {
|
|
1119
|
-
var _el$37 = _tmpl$14();
|
|
1120
|
-
insert(_el$37, createComponent(For, {
|
|
1121
|
-
get each() {
|
|
1122
|
-
return brokenModules();
|
|
1123
|
-
},
|
|
1124
|
-
children: (b) => {
|
|
1125
|
-
const info = () => brokenInfo()[moduleKey(b.url)];
|
|
1126
|
-
const meta = () => info()?.meta;
|
|
1127
|
-
const declared = () => info()?.plugins;
|
|
1128
|
-
return (() => {
|
|
1129
|
-
var _el$69 = _tmpl$33(), _el$70 = _el$69.firstChild, _el$71 = _el$70.firstChild, _el$75 = _el$71.nextSibling, _el$77 = _el$75.firstChild, _el$79 = _el$70.nextSibling;
|
|
1130
|
-
insert(_el$70, createComponent(Show, {
|
|
1131
|
-
get when() {
|
|
1132
|
-
return meta()?.title || meta()?.name;
|
|
1133
|
-
},
|
|
1134
|
-
get children() {
|
|
1135
|
-
return [(() => {
|
|
1136
|
-
var _el$72 = _tmpl$30();
|
|
1137
|
-
insert(_el$72, () => meta().title || meta().name);
|
|
1138
|
-
return _el$72;
|
|
1139
|
-
})(), createComponent(Show, {
|
|
1140
|
-
get when() {
|
|
1141
|
-
return meta()?.version;
|
|
1142
|
-
},
|
|
1143
|
-
get children() {
|
|
1144
|
-
var _el$73 = _tmpl$31();
|
|
1145
|
-
_el$73.firstChild;
|
|
1146
|
-
insert(_el$73, () => meta().version, null);
|
|
1147
|
-
return _el$73;
|
|
1148
|
-
}
|
|
1149
|
-
})];
|
|
1150
|
-
}
|
|
1151
|
-
}), _el$75);
|
|
1152
|
-
insert(_el$70, createComponent(Copyable, {
|
|
1153
|
-
get value() {
|
|
1154
|
-
return b.url;
|
|
1155
|
-
},
|
|
1156
|
-
"class": "pw-broken__url",
|
|
1157
|
-
title: "module URL — click to copy"
|
|
1158
|
-
}), _el$75);
|
|
1159
|
-
insert(_el$75, createComponent(Show, {
|
|
1160
|
-
get when() {
|
|
1161
|
-
return isAutomergeUrl(b.url);
|
|
1162
|
-
},
|
|
1163
|
-
get children() {
|
|
1164
|
-
var _el$76 = _tmpl$9();
|
|
1165
|
-
_el$76.$$click = () => openDoc(b.url);
|
|
1166
|
-
return _el$76;
|
|
1167
|
-
}
|
|
1168
|
-
}), _el$77);
|
|
1169
|
-
_el$77.$$click = () => uninstall(b.url);
|
|
1170
|
-
insert(_el$69, createComponent(Show, {
|
|
1171
|
-
get when() {
|
|
1172
|
-
return memo(() => !!declared())() && declared().length > 0;
|
|
1173
|
-
},
|
|
1174
|
-
get children() {
|
|
1175
|
-
var _el$78 = _tmpl$32();
|
|
1176
|
-
insert(_el$78, createComponent(For, {
|
|
1177
|
-
get each() {
|
|
1178
|
-
return declared();
|
|
1179
|
-
},
|
|
1180
|
-
children: (p) => (() => {
|
|
1181
|
-
var _el$80 = _tmpl$36(), _el$81 = _el$80.firstChild;
|
|
1182
|
-
insert(_el$81, () => p.name || p.id);
|
|
1183
|
-
insert(_el$80, createComponent(Show, {
|
|
1184
|
-
get when() {
|
|
1185
|
-
return p.type;
|
|
1186
|
-
},
|
|
1187
|
-
get children() {
|
|
1188
|
-
var _el$82 = _tmpl$34();
|
|
1189
|
-
insert(_el$82, () => prettyType(p.type));
|
|
1190
|
-
return _el$82;
|
|
1191
|
-
}
|
|
1192
|
-
}), null);
|
|
1193
|
-
insert(_el$80, createComponent(Show, {
|
|
1194
|
-
get when() {
|
|
1195
|
-
return p.unlisted;
|
|
1196
|
-
},
|
|
1197
|
-
get children() {
|
|
1198
|
-
return createComponent(UnlistedBadge, {});
|
|
1199
|
-
}
|
|
1200
|
-
}), null);
|
|
1201
|
-
insert(_el$80, createComponent(Show, {
|
|
1202
|
-
get when() {
|
|
1203
|
-
return datatypesLabel(p.supportedDatatypes);
|
|
1204
|
-
},
|
|
1205
|
-
get children() {
|
|
1206
|
-
var _el$83 = _tmpl$35();
|
|
1207
|
-
_el$83.firstChild;
|
|
1208
|
-
insert(_el$83, () => datatypesLabel(p.supportedDatatypes), null);
|
|
1209
|
-
return _el$83;
|
|
1210
|
-
}
|
|
1211
|
-
}), null);
|
|
1212
|
-
effect(() => _el$81.classList.toggle("is-unlisted", !!p.unlisted));
|
|
1213
|
-
return _el$80;
|
|
1214
|
-
})()
|
|
1215
|
-
}));
|
|
1216
|
-
return _el$78;
|
|
1217
|
-
}
|
|
1218
|
-
}), _el$79);
|
|
1219
|
-
insert(_el$79, () => b.error);
|
|
1220
|
-
return _el$69;
|
|
1221
|
-
})();
|
|
1222
|
-
}
|
|
1223
|
-
}));
|
|
1224
|
-
return _el$37;
|
|
1225
|
-
}
|
|
1226
|
-
}), null);
|
|
1227
|
-
insert(_el$16, createComponent(Show, {
|
|
1228
|
-
get when() {
|
|
1229
|
-
return filtered().length > 0;
|
|
1230
|
-
},
|
|
1231
|
-
get fallback() {
|
|
1232
|
-
return (() => {
|
|
1233
|
-
var _el$85 = _tmpl$37();
|
|
1234
|
-
insert(_el$85, createComponent(Show, {
|
|
1235
|
-
get when() {
|
|
1236
|
-
return enriched().length > 0;
|
|
1237
|
-
},
|
|
1238
|
-
get fallback() {
|
|
1239
|
-
return "No plugins are registered yet.";
|
|
1240
|
-
},
|
|
1241
|
-
children: "Nothing matches these filters."
|
|
1242
|
-
}));
|
|
1243
|
-
return _el$85;
|
|
1244
|
-
})();
|
|
1245
|
-
},
|
|
1246
|
-
get children() {
|
|
1247
|
-
return [createComponent(Show, {
|
|
1248
|
-
get when() {
|
|
1249
|
-
return view() === "packages";
|
|
1250
|
-
},
|
|
1251
|
-
get children() {
|
|
1252
|
-
var _el$38 = _tmpl$15();
|
|
1253
|
-
insert(_el$38, createComponent(For, {
|
|
1254
|
-
get each() {
|
|
1255
|
-
return packageGroups();
|
|
1256
|
-
},
|
|
1257
|
-
children: (group) => (() => {
|
|
1258
|
-
var _el$86 = _tmpl$40(), _el$87 = _el$86.firstChild, _el$88 = _el$87.firstChild, _el$89 = _el$88.nextSibling, _el$92 = _el$89.firstChild, _el$93 = _el$92.firstChild, _el$95 = _el$87.nextSibling, _el$96 = _el$95.nextSibling;
|
|
1259
|
-
insert(_el$88, () => group.name);
|
|
1260
|
-
insert(_el$89, createComponent(Show, {
|
|
1261
|
-
get when() {
|
|
1262
|
-
return group.meta?.version;
|
|
1263
|
-
},
|
|
1264
|
-
get children() {
|
|
1265
|
-
var _el$90 = _tmpl$31();
|
|
1266
|
-
_el$90.firstChild;
|
|
1267
|
-
insert(_el$90, () => group.meta.version, null);
|
|
1268
|
-
return _el$90;
|
|
1269
|
-
}
|
|
1270
|
-
}), _el$92);
|
|
1271
|
-
insert(_el$89, createComponent(OriginBadge, {
|
|
1272
|
-
get origin() {
|
|
1273
|
-
return group.origin;
|
|
1274
|
-
}
|
|
1275
|
-
}), _el$92);
|
|
1276
|
-
insert(_el$92, () => group.plugins.length, _el$93);
|
|
1277
|
-
insert(_el$92, () => group.plugins.length === 1 ? "" : "s", null);
|
|
1278
|
-
insert(_el$86, createComponent(Show, {
|
|
1279
|
-
get when() {
|
|
1280
|
-
return memo(() => !!group.meta?.name)() && group.meta?.name !== group.name;
|
|
1281
|
-
},
|
|
1282
|
-
get children() {
|
|
1283
|
-
var _el$94 = _tmpl$38();
|
|
1284
|
-
insert(_el$94, () => group.meta.name);
|
|
1285
|
-
return _el$94;
|
|
1286
|
-
}
|
|
1287
|
-
}), _el$95);
|
|
1288
|
-
insert(_el$95, createComponent(SourceLine, {
|
|
1289
|
-
get importUrl() {
|
|
1290
|
-
return group.importUrl;
|
|
1291
|
-
}
|
|
1292
|
-
}));
|
|
1293
|
-
insert(_el$96, createComponent(Collapsible, {
|
|
1294
|
-
get each() {
|
|
1295
|
-
return group.plugins;
|
|
1296
|
-
},
|
|
1297
|
-
render: (plugin) => createComponent(PluginRow, {
|
|
1298
|
-
plugin
|
|
1299
|
-
})
|
|
1300
|
-
}));
|
|
1301
|
-
insert(_el$86, createComponent(Show, {
|
|
1302
|
-
get when() {
|
|
1303
|
-
return hasActions(group.importUrl, group.origin);
|
|
1304
|
-
},
|
|
1305
|
-
get children() {
|
|
1306
|
-
var _el$97 = _tmpl$39();
|
|
1307
|
-
insert(_el$97, createComponent(SourceActions, {
|
|
1308
|
-
get importUrl() {
|
|
1309
|
-
return group.importUrl;
|
|
1310
|
-
},
|
|
1311
|
-
get origin() {
|
|
1312
|
-
return group.origin;
|
|
1313
|
-
}
|
|
1314
|
-
}));
|
|
1315
|
-
return _el$97;
|
|
1316
|
-
}
|
|
1317
|
-
}), null);
|
|
1318
|
-
effect(() => setAttribute(_el$86, "data-origin", group.origin));
|
|
1319
|
-
return _el$86;
|
|
1320
|
-
})()
|
|
1321
|
-
}));
|
|
1322
|
-
return _el$38;
|
|
1323
|
-
}
|
|
1324
|
-
}), createComponent(Show, {
|
|
1325
|
-
get when() {
|
|
1326
|
-
return view() === "registries";
|
|
1327
|
-
},
|
|
1328
|
-
get children() {
|
|
1329
|
-
var _el$39 = _tmpl$16();
|
|
1330
|
-
insert(_el$39, createComponent(For, {
|
|
1331
|
-
get each() {
|
|
1332
|
-
return registryGroups();
|
|
1333
|
-
},
|
|
1334
|
-
children: (group) => (() => {
|
|
1335
|
-
var _el$98 = _tmpl$41(), _el$99 = _el$98.firstChild, _el$100 = _el$99.firstChild, _el$101 = _el$100.nextSibling, _el$102 = _el$99.nextSibling;
|
|
1336
|
-
insert(_el$100, () => group.registry);
|
|
1337
|
-
insert(_el$101, () => group.plugins.length);
|
|
1338
|
-
insert(_el$102, createComponent(Collapsible, {
|
|
1339
|
-
get each() {
|
|
1340
|
-
return group.plugins;
|
|
1341
|
-
},
|
|
1342
|
-
render: (plugin) => (() => {
|
|
1343
|
-
var _el$103 = _tmpl$43(), _el$104 = _el$103.firstChild, _el$105 = _el$104.firstChild, _el$108 = _el$104.nextSibling, _el$109 = _el$108.firstChild;
|
|
1344
|
-
insert(_el$105, () => plugin.name);
|
|
1345
|
-
insert(_el$104, createComponent(Copyable, {
|
|
1346
|
-
get value() {
|
|
1347
|
-
return plugin.id;
|
|
1348
|
-
},
|
|
1349
|
-
"class": "pw-regitem__id",
|
|
1350
|
-
title: "Plugin id — click to copy"
|
|
1351
|
-
}), null);
|
|
1352
|
-
insert(_el$104, createComponent(OriginBadge, {
|
|
1353
|
-
get origin() {
|
|
1354
|
-
return plugin.origin;
|
|
1355
|
-
}
|
|
1356
|
-
}), null);
|
|
1357
|
-
insert(_el$104, createComponent(Show, {
|
|
1358
|
-
get when() {
|
|
1359
|
-
return plugin.unlisted;
|
|
1360
|
-
},
|
|
1361
|
-
get children() {
|
|
1362
|
-
return createComponent(UnlistedBadge, {});
|
|
1363
|
-
}
|
|
1364
|
-
}), null);
|
|
1365
|
-
insert(_el$104, createComponent(Show, {
|
|
1366
|
-
get when() {
|
|
1367
|
-
return datatypesLabel(plugin.supportedDatatypes);
|
|
1368
|
-
},
|
|
1369
|
-
get children() {
|
|
1370
|
-
var _el$106 = _tmpl$42();
|
|
1371
|
-
_el$106.firstChild;
|
|
1372
|
-
insert(_el$106, () => datatypesLabel(plugin.supportedDatatypes), null);
|
|
1373
|
-
return _el$106;
|
|
1374
|
-
}
|
|
1375
|
-
}), null);
|
|
1376
|
-
insert(_el$109, () => plugin.pkgName);
|
|
1377
|
-
insert(_el$108, createComponent(SourceLine, {
|
|
1378
|
-
get importUrl() {
|
|
1379
|
-
return plugin.importUrl;
|
|
1380
|
-
}
|
|
1381
|
-
}), null);
|
|
1382
|
-
insert(_el$108, createComponent(SourceActions, {
|
|
1383
|
-
get importUrl() {
|
|
1384
|
-
return plugin.importUrl;
|
|
1385
|
-
},
|
|
1386
|
-
get origin() {
|
|
1387
|
-
return plugin.origin;
|
|
1388
|
-
}
|
|
1389
|
-
}), null);
|
|
1390
|
-
effect((_p$) => {
|
|
1391
|
-
var _v$0 = plugin.origin, _v$1 = !!plugin.unlisted;
|
|
1392
|
-
_v$0 !== _p$.e && setAttribute(_el$103, "data-origin", _p$.e = _v$0);
|
|
1393
|
-
_v$1 !== _p$.t && _el$105.classList.toggle("is-unlisted", _p$.t = _v$1);
|
|
1394
|
-
return _p$;
|
|
1395
|
-
}, {
|
|
1396
|
-
e: void 0,
|
|
1397
|
-
t: void 0
|
|
1398
|
-
});
|
|
1399
|
-
return _el$103;
|
|
1400
|
-
})()
|
|
1401
|
-
}));
|
|
1402
|
-
return _el$98;
|
|
1403
|
-
})()
|
|
1404
|
-
}));
|
|
1405
|
-
return _el$39;
|
|
1406
|
-
}
|
|
1407
|
-
}), createComponent(Show, {
|
|
1408
|
-
get when() {
|
|
1409
|
-
return view() === "table";
|
|
1410
|
-
},
|
|
1411
|
-
get children() {
|
|
1412
|
-
var _el$40 = _tmpl$17(), _el$41 = _el$40.firstChild, _el$42 = _el$41.firstChild, _el$43 = _el$42.firstChild, _el$44 = _el$43.firstChild, _el$45 = _el$42.nextSibling;
|
|
1413
|
-
insert(_el$43, createComponent(For, {
|
|
1414
|
-
each: [["name", "Name"], ["registry", "Registry"], ["id", "Id"], ["package", "Package"], ["origin", "Origin"], ["unlisted", "Unlisted"]],
|
|
1415
|
-
children: ([key, label]) => (() => {
|
|
1416
|
-
var _el$110 = _tmpl$45();
|
|
1417
|
-
_el$110.$$click = () => toggleSort(key);
|
|
1418
|
-
insert(_el$110, label, null);
|
|
1419
|
-
insert(_el$110, createComponent(Show, {
|
|
1420
|
-
get when() {
|
|
1421
|
-
return sortKey() === key;
|
|
1422
|
-
},
|
|
1423
|
-
get children() {
|
|
1424
|
-
var _el$111 = _tmpl$44();
|
|
1425
|
-
insert(_el$111, () => sortAsc() ? "▲" : "▼");
|
|
1426
|
-
return _el$111;
|
|
1427
|
-
}
|
|
1428
|
-
}), null);
|
|
1429
|
-
effect(() => setAttribute(_el$110, "data-sorted", sortKey() === key ? "" : void 0));
|
|
1430
|
-
return _el$110;
|
|
1431
|
-
})()
|
|
1432
|
-
}), _el$44);
|
|
1433
|
-
insert(_el$45, createComponent(For, {
|
|
1434
|
-
get each() {
|
|
1435
|
-
return tableRows();
|
|
1436
|
-
},
|
|
1437
|
-
children: (e) => (() => {
|
|
1438
|
-
var _el$112 = _tmpl$48(), _el$113 = _el$112.firstChild, _el$115 = _el$113.nextSibling, _el$116 = _el$115.nextSibling, _el$117 = _el$116.nextSibling, _el$118 = _el$117.nextSibling, _el$119 = _el$118.nextSibling, _el$121 = _el$119.nextSibling, _el$122 = _el$121.firstChild;
|
|
1439
|
-
insert(_el$113, () => e.name, null);
|
|
1440
|
-
insert(_el$113, createComponent(Show, {
|
|
1441
|
-
get when() {
|
|
1442
|
-
return datatypesLabel(e.supportedDatatypes);
|
|
1443
|
-
},
|
|
1444
|
-
get children() {
|
|
1445
|
-
var _el$114 = _tmpl$46();
|
|
1446
|
-
insert(_el$114, () => datatypesLabel(e.supportedDatatypes));
|
|
1447
|
-
return _el$114;
|
|
1448
|
-
}
|
|
1449
|
-
}), null);
|
|
1450
|
-
insert(_el$115, () => e.registry);
|
|
1451
|
-
insert(_el$116, createComponent(Copyable, {
|
|
1452
|
-
get value() {
|
|
1453
|
-
return e.id;
|
|
1454
|
-
},
|
|
1455
|
-
"class": "pw-table__id"
|
|
1456
|
-
}));
|
|
1457
|
-
insert(_el$117, () => e.pkgName);
|
|
1458
|
-
insert(_el$118, createComponent(OriginBadge, {
|
|
1459
|
-
get origin() {
|
|
1460
|
-
return e.origin;
|
|
1461
|
-
}
|
|
1462
|
-
}));
|
|
1463
|
-
insert(_el$119, createComponent(Show, {
|
|
1464
|
-
get when() {
|
|
1465
|
-
return e.unlisted;
|
|
1466
|
-
},
|
|
1467
|
-
get children() {
|
|
1468
|
-
return _tmpl$47();
|
|
1469
|
-
}
|
|
1470
|
-
}));
|
|
1471
|
-
insert(_el$122, createComponent(SourceLine, {
|
|
1472
|
-
get importUrl() {
|
|
1473
|
-
return e.importUrl;
|
|
1474
|
-
}
|
|
1475
|
-
}), null);
|
|
1476
|
-
insert(_el$122, createComponent(SourceActions, {
|
|
1477
|
-
get importUrl() {
|
|
1478
|
-
return e.importUrl;
|
|
1479
|
-
},
|
|
1480
|
-
get origin() {
|
|
1481
|
-
return e.origin;
|
|
1482
|
-
}
|
|
1483
|
-
}), null);
|
|
1484
|
-
effect((_p$) => {
|
|
1485
|
-
var _v$10 = e.origin, _v$11 = !!e.unlisted;
|
|
1486
|
-
_v$10 !== _p$.e && setAttribute(_el$112, "data-origin", _p$.e = _v$10);
|
|
1487
|
-
_v$11 !== _p$.t && _el$113.classList.toggle("is-unlisted", _p$.t = _v$11);
|
|
1488
|
-
return _p$;
|
|
1489
|
-
}, {
|
|
1490
|
-
e: void 0,
|
|
1491
|
-
t: void 0
|
|
1492
|
-
});
|
|
1493
|
-
return _el$112;
|
|
1494
|
-
})()
|
|
1495
|
-
}));
|
|
1496
|
-
return _el$40;
|
|
1497
|
-
}
|
|
1498
|
-
})];
|
|
1499
|
-
}
|
|
1500
|
-
}), null);
|
|
1501
|
-
insert(_el$16, createComponent(Show, {
|
|
1502
|
-
get when() {
|
|
1503
|
-
return installOpen();
|
|
1504
|
-
},
|
|
1505
|
-
get children() {
|
|
1506
|
-
var _el$46 = _tmpl$25(), _el$47 = _el$46.firstChild, _el$48 = _el$47.firstChild, _el$49 = _el$48.firstChild, _el$50 = _el$49.nextSibling, _el$51 = _el$48.nextSibling, _el$52 = _el$51.nextSibling, _el$62 = _el$52.nextSibling, _el$64 = _el$62.firstChild, _el$65 = _el$64.nextSibling;
|
|
1507
|
-
_el$46.$$keydown = (e) => {
|
|
1508
|
-
if (e.key === "Escape") closeInstall();
|
|
1509
|
-
};
|
|
1510
|
-
_el$46.$$click = (e) => {
|
|
1511
|
-
if (e.target === e.currentTarget) closeInstall();
|
|
1512
|
-
};
|
|
1513
|
-
_el$50.$$click = closeInstall;
|
|
1514
|
-
_el$52.$$keydown = (e) => {
|
|
1515
|
-
if (e.key === "Enter" && installValid() && !alreadyInstalled()) {
|
|
1516
|
-
e.preventDefault();
|
|
1517
|
-
doInstall();
|
|
1518
|
-
}
|
|
1519
|
-
};
|
|
1520
|
-
_el$52.$$input = (e) => setInstallUrl(e.currentTarget.value);
|
|
1521
|
-
use((el) => setTimeout(() => el.focus(), 0), _el$52);
|
|
1522
|
-
setAttribute(_el$52, "spellcheck", false);
|
|
1523
|
-
insert(_el$47, createComponent(Show, {
|
|
1524
|
-
get when() {
|
|
1525
|
-
return installTarget();
|
|
1526
|
-
},
|
|
1527
|
-
get children() {
|
|
1528
|
-
var _el$53 = _tmpl$23();
|
|
1529
|
-
insert(_el$53, createComponent(Show, {
|
|
1530
|
-
get when() {
|
|
1531
|
-
return installError();
|
|
1532
|
-
},
|
|
1533
|
-
get children() {
|
|
1534
|
-
var _el$54 = _tmpl$18();
|
|
1535
|
-
insert(_el$54, installError);
|
|
1536
|
-
return _el$54;
|
|
1537
|
-
}
|
|
1538
|
-
}), null);
|
|
1539
|
-
insert(_el$53, createComponent(Show, {
|
|
1540
|
-
get when() {
|
|
1541
|
-
return installBusy();
|
|
1542
|
-
},
|
|
1543
|
-
get children() {
|
|
1544
|
-
return _tmpl$19();
|
|
1545
|
-
}
|
|
1546
|
-
}), null);
|
|
1547
|
-
insert(_el$53, createComponent(Show, {
|
|
1548
|
-
get when() {
|
|
1549
|
-
return memo(() => !!installValid())() && (installMeta() || installPlugins());
|
|
1550
|
-
},
|
|
1551
|
-
get children() {
|
|
1552
|
-
var _el$56 = _tmpl$22(), _el$57 = _el$56.firstChild, _el$58 = _el$57.firstChild;
|
|
1553
|
-
insert(_el$58, () => installMeta()?.title || installMeta()?.name || packageDisplayName(bareModuleUrl(installTarget()), installMeta() ?? void 0));
|
|
1554
|
-
insert(_el$57, createComponent(Show, {
|
|
1555
|
-
get when() {
|
|
1556
|
-
return installMeta()?.version;
|
|
1557
|
-
},
|
|
1558
|
-
get children() {
|
|
1559
|
-
var _el$59 = _tmpl$20();
|
|
1560
|
-
_el$59.firstChild;
|
|
1561
|
-
insert(_el$59, () => installMeta().version, null);
|
|
1562
|
-
return _el$59;
|
|
1563
|
-
}
|
|
1564
|
-
}), null);
|
|
1565
|
-
insert(_el$56, createComponent(Show, {
|
|
1566
|
-
get when() {
|
|
1567
|
-
return memo(() => !!installPlugins())() && installPlugins().length > 0;
|
|
1568
|
-
},
|
|
1569
|
-
get fallback() {
|
|
1570
|
-
return createComponent(Show, {
|
|
1571
|
-
get when() {
|
|
1572
|
-
return memo(() => !!!installBusy())() && !installError();
|
|
1573
|
-
},
|
|
1574
|
-
get children() {
|
|
1575
|
-
var _el$123 = _tmpl$49();
|
|
1576
|
-
insert(_el$123, () => installPlugins() ? "No plugins reported by this package." : "Couldn't read this package's plugin list — you can still install it.");
|
|
1577
|
-
return _el$123;
|
|
1578
|
-
}
|
|
1579
|
-
});
|
|
1580
|
-
},
|
|
1581
|
-
get children() {
|
|
1582
|
-
var _el$61 = _tmpl$21();
|
|
1583
|
-
insert(_el$61, createComponent(For, {
|
|
1584
|
-
get each() {
|
|
1585
|
-
return installPlugins();
|
|
1586
|
-
},
|
|
1587
|
-
children: (p) => (() => {
|
|
1588
|
-
var _el$124 = _tmpl$36(), _el$125 = _el$124.firstChild;
|
|
1589
|
-
insert(_el$125, () => p.name || p.id);
|
|
1590
|
-
insert(_el$124, createComponent(Show, {
|
|
1591
|
-
get when() {
|
|
1592
|
-
return p.type;
|
|
1593
|
-
},
|
|
1594
|
-
get children() {
|
|
1595
|
-
var _el$126 = _tmpl$34();
|
|
1596
|
-
insert(_el$126, () => prettyType(p.type));
|
|
1597
|
-
return _el$126;
|
|
1598
|
-
}
|
|
1599
|
-
}), null);
|
|
1600
|
-
insert(_el$124, createComponent(Show, {
|
|
1601
|
-
get when() {
|
|
1602
|
-
return p.unlisted;
|
|
1603
|
-
},
|
|
1604
|
-
get children() {
|
|
1605
|
-
return createComponent(UnlistedBadge, {});
|
|
1606
|
-
}
|
|
1607
|
-
}), null);
|
|
1608
|
-
insert(_el$124, createComponent(Show, {
|
|
1609
|
-
get when() {
|
|
1610
|
-
return datatypesLabel(p.supportedDatatypes);
|
|
1611
|
-
},
|
|
1612
|
-
get children() {
|
|
1613
|
-
var _el$127 = _tmpl$35();
|
|
1614
|
-
_el$127.firstChild;
|
|
1615
|
-
insert(_el$127, () => datatypesLabel(p.supportedDatatypes), null);
|
|
1616
|
-
return _el$127;
|
|
1617
|
-
}
|
|
1618
|
-
}), null);
|
|
1619
|
-
effect(() => _el$125.classList.toggle("is-unlisted", !!p.unlisted));
|
|
1620
|
-
return _el$124;
|
|
1621
|
-
})()
|
|
1622
|
-
}));
|
|
1623
|
-
return _el$61;
|
|
1624
|
-
}
|
|
1625
|
-
}), null);
|
|
1626
|
-
return _el$56;
|
|
1627
|
-
}
|
|
1628
|
-
}), null);
|
|
1629
|
-
return _el$53;
|
|
1630
|
-
}
|
|
1631
|
-
}), _el$62);
|
|
1632
|
-
insert(_el$62, createComponent(Show, {
|
|
1633
|
-
get when() {
|
|
1634
|
-
return alreadyInstalled();
|
|
1635
|
-
},
|
|
1636
|
-
get children() {
|
|
1637
|
-
return _tmpl$24();
|
|
1638
|
-
}
|
|
1639
|
-
}), _el$64);
|
|
1640
|
-
_el$64.$$click = closeInstall;
|
|
1641
|
-
_el$65.$$click = doInstall;
|
|
1642
|
-
effect(() => _el$65.disabled = !installValid() || alreadyInstalled());
|
|
1643
|
-
effect(() => _el$52.value = installUrl());
|
|
1644
|
-
return _el$46;
|
|
1645
|
-
}
|
|
1646
|
-
}), null);
|
|
1647
|
-
effect(() => _el$19.value = search());
|
|
1648
|
-
return _el$16;
|
|
1649
|
-
})();
|
|
1650
|
-
}
|
|
1651
|
-
delegateEvents(["click", "input", "keydown"]);
|
|
1652
|
-
function mount(handle, element) {
|
|
1653
|
-
return render(() => createComponent(Packages, {
|
|
1654
|
-
handle,
|
|
1655
|
-
element
|
|
1656
|
-
}), element);
|
|
1657
|
-
}
|
|
1658
|
-
export {
|
|
1659
|
-
mount
|
|
1660
|
-
};
|