elysia-rack 0.2.0 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +37 -15
- package/dist/Dashboard-4wv82gwx.js +212 -0
- package/dist/Dashboard-jkvfzyk2.js +210 -0
- package/dist/Dashboard-zhg2jtq5.js +211 -0
- package/dist/{Panel-fbp3wrsw.js → Panel-1qkzh8t7.js} +355 -311
- package/dist/Panel-7zpqz8gy.js +782 -0
- package/dist/Panel-9mmh3tbh.js +790 -0
- package/dist/Panel-ba0qzknj.js +789 -0
- package/dist/Panel-e6jyf4rc.js +789 -0
- package/dist/index-0dwhzk3j.js +145 -0
- package/dist/index-b8sq8rbd.js +19 -0
- package/dist/index-rg87f3v1.js +174 -0
- package/dist/panel-app.js +27 -11
- package/dist/panel.css +2 -1
- package/dist/rack/dashboard.d.ts +3 -0
- package/dist/rack/index.js +1 -0
- package/dist/rack/types/metadata.d.ts +2 -1
- package/dist/react/donate.d.ts +10 -0
- package/dist/react/index.js +6 -2
- package/dist/react/page/Dashboard.d.ts +2 -0
- package/dist/react/page/Panel.d.ts +2 -0
- package/dist/react/page/components/Icon.d.ts +10 -0
- package/dist/react/page/components/Masthead.d.ts +5 -4
- package/dist/react/types.d.ts +5 -0
- package/package.json +12 -3
- package/dist/Dashboard-2j561p7c.js +0 -225
- package/dist/Dashboard-5mt9hnbw.js +0 -252
- package/dist/Dashboard-s8nfyf7s.js +0 -39
- package/dist/Dashboard-xpstr7fr.js +0 -172
- package/dist/Panel-3yrk3krj.js +0 -914
- package/dist/Panel-b7jhgvnm.js +0 -916
- package/dist/Panel-pkvqf5v8.js +0 -912
- package/dist/index-tgk4jt4d.js +0 -63
- package/dist/index-zc7rgvmm.js +0 -13
package/dist/index-tgk4jt4d.js
DELETED
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
// src/rack/registry.ts
|
|
2
|
-
var registrations = new Map;
|
|
3
|
-
function registerRack(reg) {
|
|
4
|
-
registrations.set(reg.path, reg);
|
|
5
|
-
}
|
|
6
|
-
function listRacks() {
|
|
7
|
-
return [...registrations.values()];
|
|
8
|
-
}
|
|
9
|
-
function getRack(id) {
|
|
10
|
-
for (const r of registrations.values())
|
|
11
|
-
if (r.metadata.id === id)
|
|
12
|
-
return r;
|
|
13
|
-
return;
|
|
14
|
-
}
|
|
15
|
-
function getRackTree() {
|
|
16
|
-
const nodes = new Map;
|
|
17
|
-
for (const r of registrations.values()) {
|
|
18
|
-
nodes.set(r.metadata.id, { ...r, children: [] });
|
|
19
|
-
}
|
|
20
|
-
const roots = [];
|
|
21
|
-
for (const node of nodes.values()) {
|
|
22
|
-
const parentId = node.metadata.parent;
|
|
23
|
-
if (parentId && nodes.has(parentId) && parentId !== node.metadata.id) {
|
|
24
|
-
nodes.get(parentId).children.push(node);
|
|
25
|
-
} else {
|
|
26
|
-
roots.push(node);
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
const sortNodes = (list) => {
|
|
30
|
-
list.sort((a, b) => {
|
|
31
|
-
const orderA = a.metadata.order ?? 0;
|
|
32
|
-
const orderB = b.metadata.order ?? 0;
|
|
33
|
-
if (orderA !== orderB)
|
|
34
|
-
return orderA - orderB;
|
|
35
|
-
const labelA = a.metadata.pluralLabel ?? a.metadata.label ?? a.metadata.id;
|
|
36
|
-
const labelB = b.metadata.pluralLabel ?? b.metadata.label ?? b.metadata.id;
|
|
37
|
-
return labelA.localeCompare(labelB);
|
|
38
|
-
});
|
|
39
|
-
for (const n of list)
|
|
40
|
-
if (n.children.length)
|
|
41
|
-
sortNodes(n.children);
|
|
42
|
-
};
|
|
43
|
-
sortNodes(roots);
|
|
44
|
-
return roots;
|
|
45
|
-
}
|
|
46
|
-
function flatRackTree(tree = getRackTree()) {
|
|
47
|
-
const out = [];
|
|
48
|
-
const walk = (nodes) => {
|
|
49
|
-
for (const n of nodes) {
|
|
50
|
-
const { children, ...rest } = n;
|
|
51
|
-
out.push(rest);
|
|
52
|
-
if (children.length)
|
|
53
|
-
walk(children);
|
|
54
|
-
}
|
|
55
|
-
};
|
|
56
|
-
walk(tree);
|
|
57
|
-
return out;
|
|
58
|
-
}
|
|
59
|
-
function clearRacks() {
|
|
60
|
-
registrations.clear();
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
export { registerRack, listRacks, getRack, getRackTree, flatRackTree, clearRacks };
|
package/dist/index-zc7rgvmm.js
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
// src/rack/registry.ts
|
|
2
|
-
var registrations = new Map;
|
|
3
|
-
function registerRack(reg) {
|
|
4
|
-
registrations.set(reg.path, reg);
|
|
5
|
-
}
|
|
6
|
-
function listRacks() {
|
|
7
|
-
return [...registrations.values()];
|
|
8
|
-
}
|
|
9
|
-
function clearRacks() {
|
|
10
|
-
registrations.clear();
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
export { registerRack, listRacks, clearRacks };
|