@floegence/floe-webapp-core 0.1.2 → 0.1.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/file-browser/Breadcrumb.d.ts +7 -0
- package/dist/components/file-browser/DirectoryTree.d.ts +7 -0
- package/dist/components/file-browser/FileBrowser.d.ts +35 -0
- package/dist/components/file-browser/FileBrowserContext.d.ts +18 -0
- package/dist/components/file-browser/FileBrowserToolbar.d.ts +8 -0
- package/dist/components/file-browser/FileContextMenu.d.ts +15 -0
- package/dist/components/file-browser/FileGridView.d.ts +7 -0
- package/dist/components/file-browser/FileIcons.d.ts +14 -0
- package/dist/components/file-browser/FileListView.d.ts +7 -0
- package/dist/components/file-browser/index.d.ts +10 -0
- package/dist/components/file-browser/types.d.ts +104 -0
- package/dist/components/index.d.ts +1 -0
- package/dist/components/layout/Sidebar.d.ts +18 -0
- package/dist/components/layout/index.d.ts +1 -1
- package/dist/components/layout/mobileTabs.d.ts +30 -0
- package/dist/context/ComponentRegistry.d.ts +3 -2
- package/dist/index.js +249 -220
- package/dist/index10.js +2 -2
- package/dist/index11.js +4 -4
- package/dist/index12.js +2 -2
- package/dist/index13.js +4 -4
- package/dist/index14.js +4 -4
- package/dist/index15.js +4 -4
- package/dist/index16.js +3 -3
- package/dist/index17.js +5 -5
- package/dist/index18.js +2 -2
- package/dist/index19.js +1 -1
- package/dist/index2.js +89 -70
- package/dist/index20.js +1 -1
- package/dist/index21.js +3 -3
- package/dist/index22.js +2 -2
- package/dist/index23.js +2 -2
- package/dist/index24.js +1 -1
- package/dist/index25.js +4 -4
- package/dist/index26.js +1 -1
- package/dist/index27.js +1 -1
- package/dist/index28.js +1 -1
- package/dist/index29.js +1 -1
- package/dist/index3.js +1 -1
- package/dist/index36.js +138 -42
- package/dist/index37.js +102 -32
- package/dist/index38.js +90 -23
- package/dist/index39.js +107 -170
- package/dist/index4.js +48 -34
- package/dist/index40.js +86 -40
- package/dist/index41.js +176 -64
- package/dist/index42.js +64 -94
- package/dist/index43.js +64 -110
- package/dist/index44.js +39 -138
- package/dist/index45.js +44 -35
- package/dist/index46.js +34 -379
- package/dist/index47.js +25 -13
- package/dist/index48.js +173 -10
- package/dist/index49.js +40 -16
- package/dist/index5.js +3 -3
- package/dist/index50.js +65 -9
- package/dist/index51.js +96 -8
- package/dist/index52.js +113 -52
- package/dist/index53.js +138 -5
- package/dist/index54.js +39 -3
- package/dist/index55.js +382 -44
- package/dist/index56.js +13 -26
- package/dist/index57.js +10 -32
- package/dist/index58.js +17 -92
- package/dist/index59.js +10 -22
- package/dist/index6.js +2 -2
- package/dist/index60.js +8 -46
- package/dist/index61.js +56 -14
- package/dist/index62.js +5 -35
- package/dist/index63.js +3 -64
- package/dist/index64.js +45 -84
- package/dist/index65.js +25 -13
- package/dist/index66.js +27 -2258
- package/dist/index67.js +94 -0
- package/dist/index68.js +25 -0
- package/dist/index69.js +49 -0
- package/dist/index7.js +1 -1
- package/dist/index70.js +17 -0
- package/dist/index71.js +38 -0
- package/dist/index72.js +67 -0
- package/dist/index73.js +87 -0
- package/dist/index74.js +17 -0
- package/dist/index75.js +2266 -0
- package/dist/index76.js +10 -0
- package/dist/index8.js +2 -2
- package/dist/index9.js +1 -1
- package/dist/styles.css +1 -1
- package/package.json +1 -1
package/dist/index60.js
CHANGED
|
@@ -1,49 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
col: Math.max(0, Math.min(l - 1, i)),
|
|
9
|
-
row: Math.max(0, e)
|
|
10
|
-
};
|
|
11
|
-
}
|
|
12
|
-
function p(t, n = 4, o = 24) {
|
|
13
|
-
const c = n * (o - 1);
|
|
14
|
-
return { cellWidth: (t.width - c) / o, cellHeight: 40 };
|
|
15
|
-
}
|
|
16
|
-
function x(t, n, o, c) {
|
|
17
|
-
return {
|
|
18
|
-
colDelta: Math.round(t / o),
|
|
19
|
-
rowDelta: Math.round(n / c)
|
|
20
|
-
};
|
|
21
|
-
}
|
|
22
|
-
function m(t, n, o, c = 24) {
|
|
23
|
-
const a = Math.max(0, Math.min(c - t.colSpan, t.col + n)), l = Math.max(0, t.row + o);
|
|
24
|
-
return {
|
|
25
|
-
...t,
|
|
26
|
-
col: a,
|
|
27
|
-
row: l
|
|
28
|
-
};
|
|
29
|
-
}
|
|
30
|
-
function S(t, n, o, c, a = 4, l = 4, i = 24) {
|
|
31
|
-
let { col: e, row: u, colSpan: r, rowSpan: h } = t;
|
|
32
|
-
if (n.includes("e") && (r = Math.max(a, Math.min(i - e, r + o))), n.includes("w")) {
|
|
33
|
-
const s = Math.max(0, e + o), M = e - s, w = r + M;
|
|
34
|
-
w >= a && (e = s, r = w);
|
|
35
|
-
}
|
|
36
|
-
if (n.includes("s") && (h = Math.max(l, h + c)), n.includes("n")) {
|
|
37
|
-
const s = Math.max(0, u + c), M = u - s, w = h + M;
|
|
38
|
-
w >= l && (u = s, h = w);
|
|
39
|
-
}
|
|
40
|
-
return { col: e, row: u, colSpan: r, rowSpan: h };
|
|
1
|
+
import { createSignal as n, createEffect as a } from "solid-js";
|
|
2
|
+
import { useResolvedFloeConfig as c } from "./index48.js";
|
|
3
|
+
function u(e, s) {
|
|
4
|
+
const t = c(), r = t.persist.load(e, s), [o, i] = n(r);
|
|
5
|
+
return a(() => {
|
|
6
|
+
t.persist.debouncedSave(e, o());
|
|
7
|
+
}), [o, i];
|
|
41
8
|
}
|
|
42
9
|
export {
|
|
43
|
-
|
|
44
|
-
S as applyResizeDelta,
|
|
45
|
-
p as getGridCellSize,
|
|
46
|
-
x as pixelDeltaToGridDelta,
|
|
47
|
-
d as positionToGridArea,
|
|
48
|
-
f as snapToGrid
|
|
10
|
+
u as usePersisted
|
|
49
11
|
};
|
package/dist/index61.js
CHANGED
|
@@ -1,17 +1,59 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
1
|
+
import { createEffect as M, onCleanup as q } from "solid-js";
|
|
2
|
+
import { useDeck as x } from "./index55.js";
|
|
3
|
+
import { applyDragDelta as H } from "./index69.js";
|
|
4
|
+
import { DECK_GRID_CONFIG as R } from "./index10.js";
|
|
5
|
+
import { lockBodyStyle as S } from "./index66.js";
|
|
6
|
+
function N() {
|
|
7
|
+
const l = x();
|
|
8
|
+
let r = null, d = 0, s = 0, m = 0, f = 0, o = null, u = null, a = null, e = null;
|
|
9
|
+
const h = (t) => {
|
|
10
|
+
if (!t) {
|
|
11
|
+
e == null || e(), e = null;
|
|
12
|
+
return;
|
|
13
|
+
}
|
|
14
|
+
e == null || e(), e = S({ cursor: "grabbing", "user-select": "none" });
|
|
15
|
+
}, E = () => {
|
|
16
|
+
r !== null && (o !== null && typeof cancelAnimationFrame < "u" && (cancelAnimationFrame(o), o = null), r = null, u = null, a = null, h(!1), l.endDrag(!0));
|
|
17
|
+
}, w = (t) => {
|
|
18
|
+
const c = t.target;
|
|
19
|
+
if (c.closest('button, input, select, textarea, [role="button"], a')) return;
|
|
20
|
+
const i = c.closest("[data-widget-drag-handle]");
|
|
21
|
+
if (!i || t.pointerType === "mouse" && t.button !== 0) return;
|
|
22
|
+
const n = i.dataset.widgetDragHandle;
|
|
23
|
+
n && (t.preventDefault(), t.stopPropagation(), r = t.pointerId, d = t.clientX, s = t.clientY, m = d, f = s, u = n, a = i, h(!0), l.startDrag(n, d, s), i.setPointerCapture(t.pointerId));
|
|
24
|
+
}, I = (t) => {
|
|
25
|
+
if (!(r !== t.pointerId || !u) && (m = t.clientX, f = t.clientY, o === null)) {
|
|
26
|
+
if (typeof requestAnimationFrame > "u") {
|
|
27
|
+
P();
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
30
|
+
o = requestAnimationFrame(() => {
|
|
31
|
+
o = null, r !== null && P();
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
}, P = () => {
|
|
35
|
+
if (!u) return;
|
|
36
|
+
const t = m - d, c = f - s, g = document.querySelector(".deck-grid");
|
|
37
|
+
if (!g) return;
|
|
38
|
+
const i = g.getBoundingClientRect(), { cols: n, rowHeight: L, gap: v } = R, C = v * (n - 1), b = (i.width - C - v * 2) / n, F = L + v, X = Math.round(t / b), Y = Math.round(c / F), D = l.activeLayout(), y = D == null ? void 0 : D.widgets.find((G) => G.id === u);
|
|
39
|
+
if (!y) return;
|
|
40
|
+
const A = H(y.position, X, Y, n);
|
|
41
|
+
l.updateDrag(A, { x: t, y: c });
|
|
42
|
+
}, p = (t) => {
|
|
43
|
+
if (r === t.pointerId) {
|
|
44
|
+
try {
|
|
45
|
+
a == null || a.releasePointerCapture(t.pointerId);
|
|
46
|
+
} catch {
|
|
47
|
+
}
|
|
48
|
+
E();
|
|
49
|
+
}
|
|
50
|
+
};
|
|
51
|
+
M(() => {
|
|
52
|
+
l.editMode() && (typeof document > "u" || (document.addEventListener("pointerdown", w, !0), document.addEventListener("pointermove", I, !0), document.addEventListener("pointerup", p, !0), document.addEventListener("pointercancel", p, !0), q(() => {
|
|
53
|
+
E(), document.removeEventListener("pointerdown", w, !0), document.removeEventListener("pointermove", I, !0), document.removeEventListener("pointerup", p, !0), document.removeEventListener("pointercancel", p, !0);
|
|
54
|
+
})));
|
|
55
|
+
});
|
|
12
56
|
}
|
|
13
57
|
export {
|
|
14
|
-
|
|
15
|
-
d as builtInThemes,
|
|
16
|
-
o as getSystemTheme
|
|
58
|
+
N as useDeckDrag
|
|
17
59
|
};
|
package/dist/index62.js
CHANGED
|
@@ -1,38 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
function S(s) {
|
|
6
|
-
return (() => {
|
|
7
|
-
var e = m(), t = e.firstChild;
|
|
8
|
-
return t.firstChild, r(t, () => s.widgetId, null), n(() => o(e, d("h-full overflow-auto", s.isEditMode && "pointer-events-none"))), e;
|
|
9
|
-
})();
|
|
1
|
+
import { clsx as o } from "./index74.js";
|
|
2
|
+
import { twMerge as t } from "./index75.js";
|
|
3
|
+
function n(...r) {
|
|
4
|
+
return t(o(r));
|
|
10
5
|
}
|
|
11
|
-
const b = (s) => (() => {
|
|
12
|
-
var e = h(), t = e.firstChild, l = t.firstChild;
|
|
13
|
-
return r(t, a(c, {
|
|
14
|
-
class: "w-8 h-8 mb-2"
|
|
15
|
-
}), l), n(() => o(e, d("h-full", s.isEditMode && "pointer-events-none"))), e;
|
|
16
|
-
})(), w = (s) => (() => {
|
|
17
|
-
var e = p(), t = e.firstChild, l = t.firstChild;
|
|
18
|
-
return r(t, a(f, {
|
|
19
|
-
class: "w-8 h-8 mb-2"
|
|
20
|
-
}), l), n(() => o(e, d("h-full", s.isEditMode && "pointer-events-none"))), e;
|
|
21
|
-
})(), W = (s) => (() => {
|
|
22
|
-
var e = g(), t = e.firstChild, l = t.firstChild;
|
|
23
|
-
return r(t, a(u, {
|
|
24
|
-
class: "w-8 h-8 mb-2"
|
|
25
|
-
}), l), n(() => o(e, d("h-full", s.isEditMode && "pointer-events-none"))), e;
|
|
26
|
-
})(), E = (s) => (() => {
|
|
27
|
-
var e = v(), t = e.firstChild, l = t.firstChild;
|
|
28
|
-
return r(t, a(x, {
|
|
29
|
-
class: "w-8 h-8 mb-2"
|
|
30
|
-
}), l), n(() => o(e, d("h-full", s.isEditMode && "pointer-events-none"))), e;
|
|
31
|
-
})();
|
|
32
6
|
export {
|
|
33
|
-
|
|
34
|
-
w as SearchSidebarWidget,
|
|
35
|
-
W as SettingsSidebarWidget,
|
|
36
|
-
E as ShowcaseSidebarWidget,
|
|
37
|
-
S as SidebarWidget
|
|
7
|
+
n as cn
|
|
38
8
|
};
|
package/dist/index63.js
CHANGED
|
@@ -1,67 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
import { cn as v } from "./index53.js";
|
|
4
|
-
var _ = /* @__PURE__ */ x('<div><div class="grid grid-cols-2 gap-3 h-full">'), $ = /* @__PURE__ */ x('<div class="bg-muted/30 rounded-md p-2 flex flex-col justify-center"><div class="text-xs text-muted-foreground mb-1"></div><div class="flex items-baseline gap-1"><span></span><span class="text-xs text-muted-foreground">');
|
|
5
|
-
function N(t) {
|
|
6
|
-
const [l, o] = u(Math.random() * 100), [i, a] = u(Math.random() * 100), [m, h] = u(Math.random() * 1e3), [C, b] = u(Math.random() * 500);
|
|
7
|
-
let c;
|
|
8
|
-
p(() => {
|
|
9
|
-
t.isEditMode || (c = window.setInterval(() => {
|
|
10
|
-
o((e) => Math.max(0, Math.min(100, e + (Math.random() - 0.5) * 10))), a((e) => Math.max(0, Math.min(100, e + (Math.random() - 0.5) * 5))), h(Math.random() * 1e3), b(Math.random() * 500);
|
|
11
|
-
}, 2e3));
|
|
12
|
-
}), w(() => {
|
|
13
|
-
c && clearInterval(c);
|
|
14
|
-
});
|
|
15
|
-
const g = (e, n) => e >= n.danger ? "text-destructive" : e >= n.warning ? "text-yellow-500" : "text-green-500";
|
|
16
|
-
return (() => {
|
|
17
|
-
var e = _(), n = e.firstChild;
|
|
18
|
-
return r(n, s(d, {
|
|
19
|
-
label: "CPU",
|
|
20
|
-
get value() {
|
|
21
|
-
return l().toFixed(1);
|
|
22
|
-
},
|
|
23
|
-
unit: "%",
|
|
24
|
-
get colorClass() {
|
|
25
|
-
return g(l(), {
|
|
26
|
-
warning: 60,
|
|
27
|
-
danger: 80
|
|
28
|
-
});
|
|
29
|
-
}
|
|
30
|
-
}), null), r(n, s(d, {
|
|
31
|
-
label: "Memory",
|
|
32
|
-
get value() {
|
|
33
|
-
return i().toFixed(1);
|
|
34
|
-
},
|
|
35
|
-
unit: "%",
|
|
36
|
-
get colorClass() {
|
|
37
|
-
return g(i(), {
|
|
38
|
-
warning: 70,
|
|
39
|
-
danger: 90
|
|
40
|
-
});
|
|
41
|
-
}
|
|
42
|
-
}), null), r(n, s(d, {
|
|
43
|
-
label: "Network In",
|
|
44
|
-
get value() {
|
|
45
|
-
return m().toFixed(0);
|
|
46
|
-
},
|
|
47
|
-
unit: "KB/s",
|
|
48
|
-
colorClass: "text-blue-500"
|
|
49
|
-
}), null), r(n, s(d, {
|
|
50
|
-
label: "Network Out",
|
|
51
|
-
get value() {
|
|
52
|
-
return C().toFixed(0);
|
|
53
|
-
},
|
|
54
|
-
unit: "KB/s",
|
|
55
|
-
colorClass: "text-purple-500"
|
|
56
|
-
}), null), f(() => M(e, v("h-full p-3", t.isEditMode && "pointer-events-none"))), e;
|
|
57
|
-
})();
|
|
58
|
-
}
|
|
59
|
-
function d(t) {
|
|
60
|
-
return (() => {
|
|
61
|
-
var l = $(), o = l.firstChild, i = o.nextSibling, a = i.firstChild, m = a.nextSibling;
|
|
62
|
-
return r(o, () => t.label), r(a, () => t.value), r(m, () => t.unit), f(() => M(a, v("text-lg font-semibold tabular-nums", t.colorClass))), l;
|
|
63
|
-
})();
|
|
1
|
+
function n(e, o = 0) {
|
|
2
|
+
setTimeout(e, o);
|
|
64
3
|
}
|
|
65
4
|
export {
|
|
66
|
-
|
|
5
|
+
n as deferNonBlocking
|
|
67
6
|
};
|
package/dist/index64.js
CHANGED
|
@@ -1,87 +1,48 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
return;
|
|
42
|
-
} else e === "date" ? n.push({
|
|
43
|
-
id: i++,
|
|
44
|
-
type: "output",
|
|
45
|
-
content: (/* @__PURE__ */ new Date()).toString()
|
|
46
|
-
}) : e.startsWith("echo ") ? n.push({
|
|
47
|
-
id: i++,
|
|
48
|
-
type: "output",
|
|
49
|
-
content: e.slice(5)
|
|
50
|
-
}) : n.push({
|
|
51
|
-
id: i++,
|
|
52
|
-
type: "error",
|
|
53
|
-
content: `Command not found: ${e}`
|
|
54
|
-
});
|
|
55
|
-
n.push({
|
|
56
|
-
id: i++,
|
|
57
|
-
type: "input",
|
|
58
|
-
content: "$ "
|
|
59
|
-
}), d((a) => [...a.slice(0, -1), ...n]), c("");
|
|
60
|
-
}, C = () => {
|
|
61
|
-
r == null || r.focus();
|
|
62
|
-
};
|
|
63
|
-
return (() => {
|
|
64
|
-
var l = z(), e = l.firstChild, n = e.firstChild, a = n.firstChild, m = a.nextSibling, s = m.firstChild;
|
|
65
|
-
l.$$click = C, $(e, S(k, {
|
|
66
|
-
get each() {
|
|
67
|
-
return _().slice(0, -1);
|
|
68
|
-
},
|
|
69
|
-
children: (t) => (() => {
|
|
70
|
-
var o = I();
|
|
71
|
-
return $(o, () => t.content), u(() => x(o, g("whitespace-pre-wrap break-all", t.type === "error" && "text-red-400", t.type === "input" && "text-green-400"))), o;
|
|
72
|
-
})()
|
|
73
|
-
}), n), m.addEventListener("submit", w), s.$$input = (t) => c(t.currentTarget.value);
|
|
74
|
-
var v = r;
|
|
75
|
-
return typeof v == "function" ? T(v, s) : r = s, u((t) => {
|
|
76
|
-
var o = g("h-full bg-zinc-900 text-zinc-100 font-mono text-xs overflow-hidden flex flex-col", p.isEditMode && "pointer-events-none"), h = p.isEditMode;
|
|
77
|
-
return o !== t.e && x(l, t.e = o), h !== t.t && (s.disabled = t.t = h), t;
|
|
78
|
-
}, {
|
|
79
|
-
e: void 0,
|
|
80
|
-
t: void 0
|
|
81
|
-
}), u(() => s.value = f()), l;
|
|
82
|
-
})();
|
|
1
|
+
const r = "floe-", i = /* @__PURE__ */ new Map();
|
|
2
|
+
function f(o, e, n = 300) {
|
|
3
|
+
if (typeof window > "u") return;
|
|
4
|
+
const t = r + o, c = i.get(t);
|
|
5
|
+
c && clearTimeout(c), i.set(
|
|
6
|
+
t,
|
|
7
|
+
setTimeout(() => {
|
|
8
|
+
try {
|
|
9
|
+
localStorage.setItem(t, JSON.stringify(e)), i.delete(t);
|
|
10
|
+
} catch (s) {
|
|
11
|
+
console.warn(`Failed to save ${t}:`, s);
|
|
12
|
+
}
|
|
13
|
+
}, n)
|
|
14
|
+
);
|
|
15
|
+
}
|
|
16
|
+
function l(o, e) {
|
|
17
|
+
if (typeof window > "u") return e;
|
|
18
|
+
const n = r + o;
|
|
19
|
+
try {
|
|
20
|
+
const t = localStorage.getItem(n);
|
|
21
|
+
return t === null ? e : JSON.parse(t);
|
|
22
|
+
} catch {
|
|
23
|
+
return e;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
function a(o, e) {
|
|
27
|
+
if (typeof window > "u") return;
|
|
28
|
+
const n = r + o;
|
|
29
|
+
try {
|
|
30
|
+
localStorage.setItem(n, JSON.stringify(e));
|
|
31
|
+
} catch (t) {
|
|
32
|
+
console.warn(`Failed to save ${n}:`, t);
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
function u(o) {
|
|
36
|
+
typeof window > "u" || localStorage.removeItem(r + o);
|
|
37
|
+
}
|
|
38
|
+
function d() {
|
|
39
|
+
if (typeof window > "u") return;
|
|
40
|
+
Object.keys(localStorage).filter((e) => e.startsWith(r)).forEach((e) => localStorage.removeItem(e));
|
|
83
41
|
}
|
|
84
|
-
E(["click", "input"]);
|
|
85
42
|
export {
|
|
86
|
-
|
|
43
|
+
d as clearAll,
|
|
44
|
+
f as debouncedSave,
|
|
45
|
+
l as load,
|
|
46
|
+
u as remove,
|
|
47
|
+
a as save
|
|
87
48
|
};
|
package/dist/index65.js
CHANGED
|
@@ -1,17 +1,29 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
const r = typeof navigator < "u" && /Mac|iPhone|iPad|iPod/.test(navigator.userAgent);
|
|
2
|
+
function o(s) {
|
|
3
|
+
const t = s.toLowerCase().split("+"), e = t.pop() || "";
|
|
4
|
+
return {
|
|
5
|
+
mod: t.includes("mod"),
|
|
6
|
+
ctrl: t.includes("ctrl"),
|
|
7
|
+
alt: t.includes("alt"),
|
|
8
|
+
shift: t.includes("shift"),
|
|
9
|
+
key: e
|
|
10
|
+
};
|
|
9
11
|
}
|
|
10
|
-
function
|
|
11
|
-
|
|
12
|
-
return
|
|
12
|
+
function c(s, t) {
|
|
13
|
+
const e = typeof t == "string" ? o(t) : t, i = r ? s.metaKey : s.ctrlKey, n = s.key.toLowerCase();
|
|
14
|
+
return e.mod && !i || !e.mod && e.ctrl && !s.ctrlKey || e.alt && !s.altKey || e.shift && !s.shiftKey ? !1 : n === e.key;
|
|
15
|
+
}
|
|
16
|
+
function l(s) {
|
|
17
|
+
const t = o(s), e = [];
|
|
18
|
+
t.mod && e.push(r ? "⌘" : "Ctrl"), t.ctrl && !t.mod && e.push(r ? "⌃" : "Ctrl"), t.alt && e.push(r ? "⌥" : "Alt"), t.shift && e.push(r ? "⇧" : "Shift");
|
|
19
|
+
const i = t.key.length === 1 ? t.key.toUpperCase() : a(t.key);
|
|
20
|
+
return e.push(i), e.join(r ? "" : "+");
|
|
21
|
+
}
|
|
22
|
+
function a(s) {
|
|
23
|
+
return s.charAt(0).toUpperCase() + s.slice(1);
|
|
13
24
|
}
|
|
14
25
|
export {
|
|
15
|
-
|
|
16
|
-
|
|
26
|
+
l as formatKeybind,
|
|
27
|
+
c as matchKeybind,
|
|
28
|
+
o as parseKeybind
|
|
17
29
|
};
|