jaml-ui 0.27.0 → 0.28.1
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 +11 -6
- package/dist/assets/{searchPoolWorker-CejAnH4a.js → searchPoolWorker-BtlROziN.js} +9 -4
- package/dist/assets/searchPoolWorker-BtlROziN.js.map +1 -0
- package/dist/chunks/Layer-BBPJFHfs.js.map +1 -1
- package/dist/chunks/assets-RWUiFSTc.js.map +1 -1
- package/dist/chunks/motelyItemDecoder-BvFrQpaI.js +2061 -0
- package/dist/chunks/motelyItemDecoder-BvFrQpaI.js.map +1 -0
- package/dist/chunks/{searchPoolWorker-CTtPOuxF.js → searchPoolWorker-D1xR43D2.js} +2 -2
- package/dist/chunks/searchPoolWorker-D1xR43D2.js.map +1 -0
- package/dist/chunks/spriteMapper-CFjN0_TV.js.map +1 -1
- package/dist/chunks/tokens-B65Fzble.js.map +1 -1
- package/dist/chunks/ui-BEtq_JNg.js +3229 -0
- package/dist/chunks/ui-BEtq_JNg.js.map +1 -0
- package/dist/components/JamlAestheticSelector.d.ts +2 -3
- package/dist/components/JamlIdeToolbar.d.ts +3 -1
- package/dist/components/JamlSeedInput.d.ts +14 -4
- package/dist/components/JamlSeedSpinner.d.ts +7 -0
- package/dist/components/Jamlyzer.d.ts +5 -1
- package/dist/components/RunConfigModal.d.ts +1 -1
- package/dist/components/jamlSeedUtils.d.ts +1 -0
- package/dist/config.d.ts +5 -4
- package/dist/core.js.map +1 -1
- package/dist/decode/motelyItemFormats.d.ts +3124 -0
- package/dist/hooks/useIntersectionObserver.d.ts +1 -1
- package/dist/hooks/useMotelyRuntime.d.ts +1 -1
- package/dist/hooks/useSearch.d.ts +3 -3
- package/dist/index.d.ts +4 -2
- package/dist/index.js +3297 -3259
- package/dist/index.js.map +1 -1
- package/dist/lib/hooks/useDragScroll.d.ts +1 -1
- package/dist/motely.d.ts +2 -2
- package/dist/motely.js +23 -22
- package/dist/motely.js.map +1 -1
- package/dist/r3f.js.map +1 -1
- package/dist/ui/JimboPanelSpinner.d.ts +15 -0
- package/dist/ui/footer.d.ts +7 -1
- package/dist/ui/hooks.d.ts +2 -2
- package/dist/ui/jimbo.css +1 -1
- package/dist/ui.d.ts +2 -0
- package/dist/ui.js +3 -3
- package/jaml.schema.json +1219 -1165
- package/package.json +20 -22
- package/DESIGN.md +0 -236
- package/dist/assets/searchPoolWorker-CejAnH4a.js.map +0 -1
- package/dist/chunks/motelyItemDecoder-CRhfNIGU.js +0 -219
- package/dist/chunks/motelyItemDecoder-CRhfNIGU.js.map +0 -1
- package/dist/chunks/searchPoolWorker-CTtPOuxF.js.map +0 -1
- package/dist/chunks/ui-BBUfR6RM.js +0 -1386
- package/dist/chunks/ui-BBUfR6RM.js.map +0 -1
- package/dist/motelyBoot.d.ts +0 -15
- package/dist/ui/ide/DeckSprite.d.ts +0 -1
- package/dist/ui/ide/RegexTool.d.ts +0 -3
|
@@ -1,1386 +0,0 @@
|
|
|
1
|
-
import { n as e } from "./assets-RWUiFSTc.js";
|
|
2
|
-
import { n as t, t as n } from "./tokens-B65Fzble.js";
|
|
3
|
-
import { n as r, p as i, r as a, t as o } from "./spriteMapper-CFjN0_TV.js";
|
|
4
|
-
import s, { memo as c, useCallback as l, useEffect as u, useLayoutEffect as d, useRef as f, useState as p } from "react";
|
|
5
|
-
import { Fragment as m, jsx as h, jsxs as g } from "react/jsx-runtime";
|
|
6
|
-
//#region src/ui/hooks.ts
|
|
7
|
-
function _(e) {
|
|
8
|
-
return new Promise((t) => {
|
|
9
|
-
let n = new window.Image();
|
|
10
|
-
n.addEventListener("load", () => t(n)), n.addEventListener("error", () => t(null)), n.src = e;
|
|
11
|
-
});
|
|
12
|
-
}
|
|
13
|
-
function v(e, t, n, r, i) {
|
|
14
|
-
if (!n || !r || !r?.pos) return 0;
|
|
15
|
-
let a = n.width / r.columns, o = n.height / r.rows, s = e.style;
|
|
16
|
-
if (r.order === 0 && (e.width = a, e.height = o, s.width = `${a}px`, s.height = `${o}px`), s.imageRendering = "pixelated", t.imageSmoothingEnabled = !0, t.save(), r.animated && i) {
|
|
17
|
-
let e = i, n = Math.sin(e / 1e3) * 3, r = Math.sin(e / 1500) * 1.5;
|
|
18
|
-
t.globalAlpha = .65 + (Math.sin(e / 2e3) + 1) * .075, t.translate(r, n);
|
|
19
|
-
}
|
|
20
|
-
return t.drawImage(n, r.pos.x * a, r.pos.y * o, a, o, 0, 0, e.width, e.height), t.restore(), a / o;
|
|
21
|
-
}
|
|
22
|
-
function y(e) {
|
|
23
|
-
let t = f(null);
|
|
24
|
-
return u(() => {
|
|
25
|
-
if (!e || !t.current) return;
|
|
26
|
-
let r, i = Date.now(), a = t.current, o = () => {
|
|
27
|
-
let e = (Date.now() - i) % n.SWAY_DURATION / n.SWAY_DURATION * Math.PI * 2;
|
|
28
|
-
a.style.transform = `translate(${Math.sin(e) * n.SWAY_AMOUNT * .3}px, ${Math.sin(e * .8) * n.SWAY_AMOUNT}px)`, r = requestAnimationFrame(o);
|
|
29
|
-
};
|
|
30
|
-
return r = requestAnimationFrame(o), () => {
|
|
31
|
-
cancelAnimationFrame(r), a && (a.style.transform = "");
|
|
32
|
-
};
|
|
33
|
-
}, [e]), t;
|
|
34
|
-
}
|
|
35
|
-
function b() {
|
|
36
|
-
let e = f(null);
|
|
37
|
-
return u(() => {
|
|
38
|
-
let t = e.current;
|
|
39
|
-
if (!t) return;
|
|
40
|
-
let n = t.getContext("webgl");
|
|
41
|
-
if (!n) return;
|
|
42
|
-
let r = (e, t) => {
|
|
43
|
-
let r = n.createShader(e);
|
|
44
|
-
return r ? (n.shaderSource(r, t), n.compileShader(r), n.getShaderParameter(r, n.COMPILE_STATUS) ? r : (console.error("[JimboBackground] shader compile error:", n.getShaderInfoLog(r)), n.deleteShader(r), null)) : null;
|
|
45
|
-
}, i = r(n.VERTEX_SHADER, "\n attribute vec2 position;\n void main() {\n gl_Position = vec4(position, 0.0, 1.0);\n }\n "), a = r(n.FRAGMENT_SHADER, "\n precision mediump float;\n\n uniform float u_time;\n uniform vec2 u_resolution;\n\n const float SPIN_ROTATION = -2.0;\n const float SPIN_SPEED = 4.5;\n const vec4 COLOUR_1 = vec4(1.0, 0.2, 0.2, 1.0);\n const vec4 COLOUR_2 = vec4(0.0, 0.5, 1.0, 1.0);\n const vec4 COLOUR_3 = vec4(0.05, 0.08, 0.1, 1.0);\n const float CONTRAST = 4.5;\n const float LIGTHING = 0.5;\n const float SPIN_AMOUNT = 0.35;\n const float PIXEL_FILTER = 740.0 * 0.33;\n const float PI = 3.14159265359;\n\n void main() {\n vec2 screenSize = u_resolution;\n float pixel_size = length(screenSize.xy) / PIXEL_FILTER;\n vec2 uv = (floor(gl_FragCoord.xy*(1.0/pixel_size))*pixel_size - 0.5*screenSize.xy)/length(screenSize.xy);\n float uv_len = length(uv);\n\n float speed = (SPIN_ROTATION * 0.2) + 302.2;\n float new_pixel_angle = atan(uv.y, uv.x) + speed - 20.0*(1.0*SPIN_AMOUNT*uv_len + (1.0 - 1.0*SPIN_AMOUNT));\n\n vec2 mid = (screenSize.xy/length(screenSize.xy))/2.0;\n uv = (vec2((uv_len * cos(new_pixel_angle) + mid.x), (uv_len * sin(new_pixel_angle) + mid.y)) - mid);\n\n uv *= 30.0;\n speed = u_time * SPIN_SPEED;\n vec2 uv2 = vec2(uv.x, uv.y);\n\n for(int i=0; i < 5; i++) {\n uv2 += sin(max(uv.x, uv.y)) + uv;\n uv += 0.5*vec2(cos(5.1123314 + 0.353*uv2.y + speed*0.131121), sin(uv2.x - 0.113*speed));\n uv -= 1.0*cos(uv.x + uv.y) - 1.0*sin(uv.x*0.711 - uv.y);\n }\n\n float contrast_mod = (0.25*CONTRAST + 0.5*SPIN_AMOUNT + 1.2);\n float paint_res = min(2.0, max(0.0, length(uv)*(0.035)*contrast_mod));\n float c1p = max(0.0, 1.0 - contrast_mod*abs(1.0 - paint_res));\n float c2p = max(0.0, 1.0 - contrast_mod*abs(paint_res));\n float c3p = 1.0 - min(1.0, c1p + c2p);\n float light = (LIGTHING - 0.2)*max(c1p*5.0 - 4.0, 0.0) + LIGTHING*max(c2p*5.0 - 4.0, 0.0);\n\n vec4 finalCol = (0.3/CONTRAST)*COLOUR_1 + (1.0 - 0.3/CONTRAST)*(COLOUR_1*c1p + COLOUR_2*c2p + vec4(c3p*COLOUR_3.rgb, c3p*COLOUR_1.a)) + light;\n\n gl_FragColor = finalCol;\n }\n ");
|
|
46
|
-
if (!i || !a) return;
|
|
47
|
-
let o = n.createProgram();
|
|
48
|
-
if (!o) return;
|
|
49
|
-
if (n.attachShader(o, i), n.attachShader(o, a), n.linkProgram(o), !n.getProgramParameter(o, n.LINK_STATUS)) {
|
|
50
|
-
console.error("[JimboBackground] program link error:", n.getProgramInfoLog(o));
|
|
51
|
-
return;
|
|
52
|
-
}
|
|
53
|
-
n.useProgram(o);
|
|
54
|
-
let s = n.createBuffer();
|
|
55
|
-
n.bindBuffer(n.ARRAY_BUFFER, s), n.bufferData(n.ARRAY_BUFFER, new Float32Array([
|
|
56
|
-
-1,
|
|
57
|
-
-1,
|
|
58
|
-
1,
|
|
59
|
-
-1,
|
|
60
|
-
-1,
|
|
61
|
-
1,
|
|
62
|
-
-1,
|
|
63
|
-
1,
|
|
64
|
-
1,
|
|
65
|
-
-1,
|
|
66
|
-
1,
|
|
67
|
-
1
|
|
68
|
-
]), n.STATIC_DRAW);
|
|
69
|
-
let c = n.getAttribLocation(o, "position");
|
|
70
|
-
n.enableVertexAttribArray(c), n.vertexAttribPointer(c, 2, n.FLOAT, !1, 0, 0);
|
|
71
|
-
let l = n.getUniformLocation(o, "u_time"), u = n.getUniformLocation(o, "u_resolution"), d = Date.now(), f, p = () => {
|
|
72
|
-
let e = t.clientWidth, r = t.clientHeight;
|
|
73
|
-
(t.width !== e || t.height !== r) && (t.width = e, t.height = r, n.viewport(0, 0, n.drawingBufferWidth, n.drawingBufferHeight));
|
|
74
|
-
let i = (Date.now() - d) / 1e3;
|
|
75
|
-
n.uniform1f(l, i), n.uniform2f(u, t.width, t.height), n.drawArrays(n.TRIANGLES, 0, 6), f = requestAnimationFrame(p);
|
|
76
|
-
};
|
|
77
|
-
return p(), () => {
|
|
78
|
-
cancelAnimationFrame(f), n.deleteProgram(o), n.deleteShader(i), n.deleteShader(a), n.deleteBuffer(s);
|
|
79
|
-
};
|
|
80
|
-
}, []), e;
|
|
81
|
-
}
|
|
82
|
-
function x({ mode: e = "snap", placement: t = "auto", delay: n = 80, disabled: r = !1 }) {
|
|
83
|
-
let [i, a] = p(!1), [o, s] = p(null), c = f(null), d = f(null), m = f(null), h = l(() => {
|
|
84
|
-
r || (m.current && clearTimeout(m.current), m.current = setTimeout(() => a(!0), n));
|
|
85
|
-
}, [r, n]), g = l(() => {
|
|
86
|
-
m.current && clearTimeout(m.current), a(!1), s(null);
|
|
87
|
-
}, []), _ = l(() => {
|
|
88
|
-
let e = c.current, n = d.current;
|
|
89
|
-
if (!e || !n) return;
|
|
90
|
-
let r = e.getBoundingClientRect(), i = n.getBoundingClientRect(), a = r.top, o = t === "top" ? "top" : t === "bottom" ? "bottom" : a >= i.height + 12 ? "top" : "bottom", l = r.left + r.width / 2 - i.width / 2, u = o === "top" ? r.top - i.height - 8 : r.bottom + 8;
|
|
91
|
-
s({
|
|
92
|
-
left: Math.max(8, Math.min(window.innerWidth - i.width - 8, l)),
|
|
93
|
-
top: u,
|
|
94
|
-
align: o
|
|
95
|
-
});
|
|
96
|
-
}, [t]);
|
|
97
|
-
return u(() => {
|
|
98
|
-
if (!i || e !== "snap") return;
|
|
99
|
-
let t = requestAnimationFrame(_);
|
|
100
|
-
return window.addEventListener("resize", _), window.addEventListener("scroll", _, !0), () => {
|
|
101
|
-
cancelAnimationFrame(t), window.removeEventListener("resize", _), window.removeEventListener("scroll", _, !0);
|
|
102
|
-
};
|
|
103
|
-
}, [
|
|
104
|
-
i,
|
|
105
|
-
e,
|
|
106
|
-
_
|
|
107
|
-
]), u(() => () => {
|
|
108
|
-
m.current && clearTimeout(m.current);
|
|
109
|
-
}, []), {
|
|
110
|
-
visible: i,
|
|
111
|
-
pos: o,
|
|
112
|
-
targetRef: c,
|
|
113
|
-
tooltipRef: d,
|
|
114
|
-
show: h,
|
|
115
|
-
hide: g,
|
|
116
|
-
handleMouseMove: l((t) => {
|
|
117
|
-
e === "mouse" && s({
|
|
118
|
-
left: t.clientX + 12,
|
|
119
|
-
top: t.clientY + 16,
|
|
120
|
-
align: "bottom"
|
|
121
|
-
});
|
|
122
|
-
}, [e])
|
|
123
|
-
};
|
|
124
|
-
}
|
|
125
|
-
function S({ layers: e, invert: t = !1, hoverTilt: n = !1 }) {
|
|
126
|
-
let r = f(null), a = f(/* @__PURE__ */ new Map()), [o, s] = p(3 / 4), [, c] = p(0), l = f(null), [d, m] = p(0), [h, g] = p(!1), [y, b] = p("none"), x = e?.some((e) => e.animated);
|
|
127
|
-
return u(() => {
|
|
128
|
-
let e = !1, t = a.current;
|
|
129
|
-
return (async () => {
|
|
130
|
-
let n = Array.from(new Set(Object.values(i).map((e) => e.src))), r = await Promise.all(n.map((e) => _(e)));
|
|
131
|
-
e || (r.forEach((e, r) => {
|
|
132
|
-
e && t.set(n[r], e);
|
|
133
|
-
}), c((e) => e + 1));
|
|
134
|
-
})().catch((e) => console.error("[JamlCardRenderer]", e)), () => {
|
|
135
|
-
e = !0, t.clear();
|
|
136
|
-
};
|
|
137
|
-
}, []), u(() => {
|
|
138
|
-
if (!x) return;
|
|
139
|
-
let e, t = (n) => {
|
|
140
|
-
e ||= n;
|
|
141
|
-
let r = n - e;
|
|
142
|
-
(!l.current || n - 100 > l.current) && (l.current = n, m(r)), l.current = requestAnimationFrame(t);
|
|
143
|
-
};
|
|
144
|
-
return l.current = requestAnimationFrame(t), () => {
|
|
145
|
-
l.current && cancelAnimationFrame(l.current);
|
|
146
|
-
};
|
|
147
|
-
}, [x]), u(() => {
|
|
148
|
-
let n = r.current;
|
|
149
|
-
if (!n || !e || e.length === 0) return;
|
|
150
|
-
let i = n.getContext("2d");
|
|
151
|
-
if (!i) return;
|
|
152
|
-
let o = !1;
|
|
153
|
-
return i.clearRect(0, 0, n.width, n.height), [...e].sort((e, t) => e.order - t.order).forEach((e) => {
|
|
154
|
-
if (a.current.has(e.source)) {
|
|
155
|
-
let t = a.current.get(e.source);
|
|
156
|
-
if (!t) return;
|
|
157
|
-
let r = v(n, i, t, e, x ? d : void 0);
|
|
158
|
-
e.order === 0 && s(r);
|
|
159
|
-
return;
|
|
160
|
-
}
|
|
161
|
-
_(e.source).then((t) => {
|
|
162
|
-
if (o || !t) return;
|
|
163
|
-
let r = v(n, i, t, e, x ? d : void 0);
|
|
164
|
-
a.current.set(e.source, t), e.order === 0 && s(r), c((e) => e + 1);
|
|
165
|
-
});
|
|
166
|
-
}), n.style.filter = t ? "invert(0.94)" : "none", () => {
|
|
167
|
-
o = !0;
|
|
168
|
-
};
|
|
169
|
-
}, [
|
|
170
|
-
e,
|
|
171
|
-
d,
|
|
172
|
-
t,
|
|
173
|
-
x
|
|
174
|
-
]), {
|
|
175
|
-
canvasRef: r,
|
|
176
|
-
containerStyle: {
|
|
177
|
-
aspectRatio: String(o),
|
|
178
|
-
width: "100%",
|
|
179
|
-
display: "flex",
|
|
180
|
-
perspective: n ? "1000px" : void 0,
|
|
181
|
-
userSelect: "none",
|
|
182
|
-
WebkitUserSelect: "none"
|
|
183
|
-
},
|
|
184
|
-
canvasStyle: {
|
|
185
|
-
transition: n && !h ? "transform 0.4s ease, box-shadow 0.4s ease-out" : "transform 0.1s ease-out",
|
|
186
|
-
transform: n ? h ? y : "none" : void 0,
|
|
187
|
-
transformStyle: n ? "preserve-3d" : void 0,
|
|
188
|
-
transformOrigin: n ? "center center" : void 0,
|
|
189
|
-
borderRadius: "6px",
|
|
190
|
-
boxShadow: n && h ? "0 2px 12px rgba(0,0,0,0.3)" : "0 2px 8px rgba(0,0,0,0.2)",
|
|
191
|
-
imageRendering: "pixelated",
|
|
192
|
-
pointerEvents: "none"
|
|
193
|
-
},
|
|
194
|
-
handlers: {
|
|
195
|
-
onPointerEnter: n ? (e) => {
|
|
196
|
-
!n || e.pointerType === "touch" || g(!0);
|
|
197
|
-
} : void 0,
|
|
198
|
-
onPointerLeave: n ? () => {
|
|
199
|
-
n && (g(!1), b("none"));
|
|
200
|
-
} : void 0,
|
|
201
|
-
onPointerMove: n ? (e) => {
|
|
202
|
-
if (!n || e.pointerType === "touch") return;
|
|
203
|
-
let t = e.currentTarget.getBoundingClientRect(), r = e.clientX - t.left, i = e.clientY - t.top, a = r / t.width * 12 - 6;
|
|
204
|
-
b(`perspective(1000px) rotateX(${i / t.height * -16 + 8}deg) rotateY(${a}deg) scale(1.05) translateY(-2px)`);
|
|
205
|
-
} : void 0
|
|
206
|
-
}
|
|
207
|
-
};
|
|
208
|
-
}
|
|
209
|
-
function C(e, t = {}) {
|
|
210
|
-
let [n, r] = p(e[0]?.ante ?? 0), [i, a] = p(e[0]?.ante), o = f(null), s = f(/* @__PURE__ */ new Map());
|
|
211
|
-
return e[0]?.ante !== i && (a(e[0]?.ante), e.length > 0 && r(e[0].ante)), u(() => {
|
|
212
|
-
let n = o.current;
|
|
213
|
-
if (!n || e.length === 0) return;
|
|
214
|
-
let i = new IntersectionObserver((e) => {
|
|
215
|
-
let t = e.filter((e) => e.isIntersecting).sort((e, t) => t.intersectionRatio - e.intersectionRatio)[0];
|
|
216
|
-
if (t) {
|
|
217
|
-
let e = Number(t.target.dataset.ante);
|
|
218
|
-
Number.isNaN(e) || r(e);
|
|
219
|
-
}
|
|
220
|
-
}, {
|
|
221
|
-
root: n,
|
|
222
|
-
threshold: t.threshold ?? [
|
|
223
|
-
.4,
|
|
224
|
-
.6,
|
|
225
|
-
.8
|
|
226
|
-
]
|
|
227
|
-
});
|
|
228
|
-
return s.current.forEach((e) => i.observe(e)), () => i.disconnect();
|
|
229
|
-
}, [e, t.threshold]), {
|
|
230
|
-
currentAnte: n,
|
|
231
|
-
scrollRef: o,
|
|
232
|
-
scrollToAnte: l((e) => {
|
|
233
|
-
let t = s.current.get(e);
|
|
234
|
-
t && t.scrollIntoView({
|
|
235
|
-
behavior: "smooth",
|
|
236
|
-
block: "start"
|
|
237
|
-
});
|
|
238
|
-
}, []),
|
|
239
|
-
registerAnteRef: l((e, t) => {
|
|
240
|
-
t ? s.current.set(e, t) : s.current.delete(e);
|
|
241
|
-
}, [])
|
|
242
|
-
};
|
|
243
|
-
}
|
|
244
|
-
function ee(e, t, n) {
|
|
245
|
-
let [r, i] = p(null), [a, o] = p(null), [s, c] = p(null), d = l((e, t, n) => {
|
|
246
|
-
let r = "touches" in e ? e.touches[0] : e, i = e.currentTarget.getBoundingClientRect();
|
|
247
|
-
o({
|
|
248
|
-
clause: t,
|
|
249
|
-
fromZone: n,
|
|
250
|
-
x: r.clientX,
|
|
251
|
-
y: r.clientY,
|
|
252
|
-
offX: r.clientX - i.left,
|
|
253
|
-
offY: r.clientY - i.top
|
|
254
|
-
}), c(null);
|
|
255
|
-
}, []);
|
|
256
|
-
return u(() => {
|
|
257
|
-
if (!a && !r) return;
|
|
258
|
-
let l = (e) => {
|
|
259
|
-
let t = "touches" in e ? e : null, s = t ? t.touches[0] : e;
|
|
260
|
-
if (!s) return;
|
|
261
|
-
let l = r;
|
|
262
|
-
if (!l && a) {
|
|
263
|
-
let e = s.clientX - a.x, t = s.clientY - a.y;
|
|
264
|
-
if (Math.hypot(e, t) < 8) return;
|
|
265
|
-
l = {
|
|
266
|
-
...a,
|
|
267
|
-
x: s.clientX,
|
|
268
|
-
y: s.clientY
|
|
269
|
-
}, o(null), i(l);
|
|
270
|
-
} else l && (l = {
|
|
271
|
-
...l,
|
|
272
|
-
x: s.clientX,
|
|
273
|
-
y: s.clientY
|
|
274
|
-
}, i(l));
|
|
275
|
-
if (!l) return;
|
|
276
|
-
t?.cancelable && t.preventDefault();
|
|
277
|
-
let u = n.current?.querySelectorAll("[data-zone]") ?? [], d = null;
|
|
278
|
-
for (let e of u) {
|
|
279
|
-
let t = e.getBoundingClientRect();
|
|
280
|
-
if (s.clientX >= t.left && s.clientX <= t.right && s.clientY >= t.top && s.clientY <= t.bottom) {
|
|
281
|
-
d = e.getAttribute("data-zone");
|
|
282
|
-
break;
|
|
283
|
-
}
|
|
284
|
-
}
|
|
285
|
-
c(d);
|
|
286
|
-
}, u = () => {
|
|
287
|
-
if (r && s && s !== r.fromZone) {
|
|
288
|
-
let n = s;
|
|
289
|
-
t({
|
|
290
|
-
...e,
|
|
291
|
-
[r.fromZone]: e[r.fromZone].filter((e) => e.id !== r.clause.id),
|
|
292
|
-
[n]: [...e[n], { ...r.clause }]
|
|
293
|
-
});
|
|
294
|
-
}
|
|
295
|
-
o(null), i(null), c(null);
|
|
296
|
-
};
|
|
297
|
-
return window.addEventListener("mousemove", l), window.addEventListener("mouseup", u), window.addEventListener("touchmove", l, { passive: !1 }), window.addEventListener("touchend", u), () => {
|
|
298
|
-
window.removeEventListener("mousemove", l), window.removeEventListener("mouseup", u), window.removeEventListener("touchmove", l), window.removeEventListener("touchend", u);
|
|
299
|
-
};
|
|
300
|
-
}, [
|
|
301
|
-
a,
|
|
302
|
-
r,
|
|
303
|
-
s,
|
|
304
|
-
e,
|
|
305
|
-
t,
|
|
306
|
-
n
|
|
307
|
-
]), {
|
|
308
|
-
drag: r,
|
|
309
|
-
hoverZone: s,
|
|
310
|
-
onDragStart: d
|
|
311
|
-
};
|
|
312
|
-
}
|
|
313
|
-
//#endregion
|
|
314
|
-
//#region src/ui/sprites.tsx
|
|
315
|
-
function w({ name: t, sheet: n, width: i = 40, height: s, style: c }) {
|
|
316
|
-
let l = a(t), u = n ?? l?.type ?? "Jokers", d = o[u], f = r(u), p = l?.pos ?? f.pos, m = i;
|
|
317
|
-
[
|
|
318
|
-
"Jokers",
|
|
319
|
-
"Tarots",
|
|
320
|
-
"Vouchers",
|
|
321
|
-
"Boosters",
|
|
322
|
-
"Decks",
|
|
323
|
-
"Enhancers",
|
|
324
|
-
"Editions"
|
|
325
|
-
].includes(u) && (m = Math.round(i * 95 / 71));
|
|
326
|
-
let g = s ?? m;
|
|
327
|
-
if (!d) return null;
|
|
328
|
-
let _ = i * d.cols, v = g * d.rows, y = -(p.x * i), b = -(p.y * g);
|
|
329
|
-
return /* @__PURE__ */ h("div", { style: {
|
|
330
|
-
width: i,
|
|
331
|
-
height: g,
|
|
332
|
-
flexShrink: 0,
|
|
333
|
-
backgroundImage: `url(${e(d.assetKey)})`,
|
|
334
|
-
backgroundSize: `${_}px ${v}px`,
|
|
335
|
-
backgroundPosition: `${y}px ${b}px`,
|
|
336
|
-
backgroundRepeat: "no-repeat",
|
|
337
|
-
imageRendering: "pixelated",
|
|
338
|
-
...c
|
|
339
|
-
} });
|
|
340
|
-
}
|
|
341
|
-
var te = [
|
|
342
|
-
"White",
|
|
343
|
-
"Red",
|
|
344
|
-
"Green",
|
|
345
|
-
"Black",
|
|
346
|
-
"Blue",
|
|
347
|
-
"Purple",
|
|
348
|
-
"Orange",
|
|
349
|
-
"Gold"
|
|
350
|
-
];
|
|
351
|
-
function ne({ stake: t, width: n = 29, height: r, style: i }) {
|
|
352
|
-
let a = te.indexOf(t.replace(" Stake", "")), o = a >= 0 ? a : 0, s = o % 5, c = Math.floor(o / 5), l = r ?? n, u = n * 5, d = l * 2;
|
|
353
|
-
return /* @__PURE__ */ h("div", { style: {
|
|
354
|
-
width: n,
|
|
355
|
-
height: l,
|
|
356
|
-
flexShrink: 0,
|
|
357
|
-
backgroundImage: `url(${e("stakes")})`,
|
|
358
|
-
backgroundSize: `${u}px ${d}px`,
|
|
359
|
-
backgroundPosition: `-${s * n}px -${c * l}px`,
|
|
360
|
-
backgroundRepeat: "no-repeat",
|
|
361
|
-
imageRendering: "pixelated",
|
|
362
|
-
...i
|
|
363
|
-
} });
|
|
364
|
-
}
|
|
365
|
-
var re = {
|
|
366
|
-
Red: 0,
|
|
367
|
-
Blue: 1,
|
|
368
|
-
Yellow: 2,
|
|
369
|
-
Green: 3,
|
|
370
|
-
Black: 0,
|
|
371
|
-
Magic: 1,
|
|
372
|
-
Nebula: 2,
|
|
373
|
-
Ghost: 3
|
|
374
|
-
};
|
|
375
|
-
function ie({ deck: t, width: n = 71, height: r, style: i }) {
|
|
376
|
-
let a = re[t.replace(" Deck", "")] ?? 0, o = r ?? n * 95 / 71, s = n * 13, c = o * 4;
|
|
377
|
-
return /* @__PURE__ */ h("div", { style: {
|
|
378
|
-
width: n,
|
|
379
|
-
height: o,
|
|
380
|
-
flexShrink: 0,
|
|
381
|
-
backgroundImage: `url(${e("deck")})`,
|
|
382
|
-
backgroundSize: `${s}px ${c}px`,
|
|
383
|
-
backgroundPosition: `-${12 * n}px -${a * o}px`,
|
|
384
|
-
backgroundRepeat: "no-repeat",
|
|
385
|
-
imageRendering: "pixelated",
|
|
386
|
-
...i
|
|
387
|
-
} });
|
|
388
|
-
}
|
|
389
|
-
//#endregion
|
|
390
|
-
//#region src/ui/jimboText.tsx
|
|
391
|
-
function T({ tone: e = "default", size: t = "md", shadow: n = !0, dance: r = !1, letterSpacing: i, as: a = "span", className: o = "", style: s, children: c, ...l }) {
|
|
392
|
-
let u = `j-text--${t}`, d = `j-text--${e}`, f = n ? "" : "j-text--no-shadow", p = r ? "j-text--dance-container" : "", m = {};
|
|
393
|
-
i != null && (m.letterSpacing = i), s && Object.assign(m, s);
|
|
394
|
-
let g = c;
|
|
395
|
-
return r && typeof c == "string" && (g = c.split("").map((e, t) => /* @__PURE__ */ h("span", {
|
|
396
|
-
className: "j-font-dance-char",
|
|
397
|
-
style: { animationDelay: `${t * -.15}s` },
|
|
398
|
-
children: e === " " ? "\xA0" : e
|
|
399
|
-
}, t))), /* @__PURE__ */ h(a, {
|
|
400
|
-
className: `j-text ${u} ${d} ${f} ${p} ${o}`.trim(),
|
|
401
|
-
style: Object.keys(m).length > 0 ? m : void 0,
|
|
402
|
-
...l,
|
|
403
|
-
children: g
|
|
404
|
-
});
|
|
405
|
-
}
|
|
406
|
-
//#endregion
|
|
407
|
-
//#region src/ui/panel.tsx
|
|
408
|
-
var E = c(({ children: e, className: t = "", sway: n = !1, onBack: r, hideBack: i = !1, style: a, ...o }) => /* @__PURE__ */ g("div", {
|
|
409
|
-
ref: y(n),
|
|
410
|
-
className: `j-panel ${t}`,
|
|
411
|
-
style: a,
|
|
412
|
-
...o,
|
|
413
|
-
children: [/* @__PURE__ */ h("div", {
|
|
414
|
-
className: "j-panel__body",
|
|
415
|
-
children: e
|
|
416
|
-
}), r && !i && /* @__PURE__ */ h("div", {
|
|
417
|
-
className: "j-panel__back",
|
|
418
|
-
children: /* @__PURE__ */ h(k, { onClick: r })
|
|
419
|
-
})]
|
|
420
|
-
}));
|
|
421
|
-
E.displayName = "JimboPanel";
|
|
422
|
-
var D = c(({ children: e, className: t = "", style: n, ...r }) => /* @__PURE__ */ h("div", {
|
|
423
|
-
className: `j-inner-panel ${t}`,
|
|
424
|
-
style: n,
|
|
425
|
-
...r,
|
|
426
|
-
children: e
|
|
427
|
-
}));
|
|
428
|
-
D.displayName = "JimboInnerPanel";
|
|
429
|
-
function O({ tone: e = "orange", size: t = "md", fullWidth: n = !1, disabled: r = !1, onClick: i, style: a, className: o = "", children: s }) {
|
|
430
|
-
let c = t === "xs" ? "xs" : t === "sm" ? "sm" : t === "lg" ? "lg" : "md";
|
|
431
|
-
return /* @__PURE__ */ h("button", {
|
|
432
|
-
type: "button",
|
|
433
|
-
className: `j-btn j-btn--${e} j-btn--${t} ${n ? "j-btn--full" : ""} ${r ? "j-btn--disabled" : ""} ${o}`,
|
|
434
|
-
disabled: r,
|
|
435
|
-
onClick: i,
|
|
436
|
-
style: a,
|
|
437
|
-
children: /* @__PURE__ */ h("div", {
|
|
438
|
-
className: "j-btn__face",
|
|
439
|
-
children: /* @__PURE__ */ h(T, {
|
|
440
|
-
size: c,
|
|
441
|
-
children: s
|
|
442
|
-
})
|
|
443
|
-
})
|
|
444
|
-
});
|
|
445
|
-
}
|
|
446
|
-
function k({ onClick: e }) {
|
|
447
|
-
return /* @__PURE__ */ h("div", {
|
|
448
|
-
className: "j-flex j-justify-center j-w-full",
|
|
449
|
-
style: { padding: "4px 0" },
|
|
450
|
-
children: /* @__PURE__ */ h(O, {
|
|
451
|
-
tone: "orange",
|
|
452
|
-
size: "md",
|
|
453
|
-
fullWidth: !0,
|
|
454
|
-
onClick: e,
|
|
455
|
-
className: "j-back-btn",
|
|
456
|
-
children: "Back"
|
|
457
|
-
})
|
|
458
|
-
});
|
|
459
|
-
}
|
|
460
|
-
function A({ children: e, open: t, onClose: n, title: r, className: i, showBack: a = !0 }) {
|
|
461
|
-
return t ? /* @__PURE__ */ h("div", {
|
|
462
|
-
className: "j-modal-overlay",
|
|
463
|
-
children: /* @__PURE__ */ g(E, {
|
|
464
|
-
onBack: a ? n : void 0,
|
|
465
|
-
className: `j-modal ${i ?? ""}`,
|
|
466
|
-
children: [r && /* @__PURE__ */ h(T, {
|
|
467
|
-
as: "h2",
|
|
468
|
-
size: "lg",
|
|
469
|
-
className: "j-modal__title",
|
|
470
|
-
children: r
|
|
471
|
-
}), e]
|
|
472
|
-
})
|
|
473
|
-
}) : null;
|
|
474
|
-
}
|
|
475
|
-
//#endregion
|
|
476
|
-
//#region src/ui/jimboTabs.tsx
|
|
477
|
-
function ae({ tabs: e, activeTab: t, onTabChange: n, className: r = "", style: i }) {
|
|
478
|
-
return /* @__PURE__ */ h("div", {
|
|
479
|
-
className: `j-tabs ${r}`,
|
|
480
|
-
style: i,
|
|
481
|
-
children: e.map((e) => /* @__PURE__ */ h(oe, {
|
|
482
|
-
label: e.label,
|
|
483
|
-
active: t === e.id,
|
|
484
|
-
onClick: () => n(e.id)
|
|
485
|
-
}, e.id))
|
|
486
|
-
});
|
|
487
|
-
}
|
|
488
|
-
function oe({ label: e, active: t, onClick: n }) {
|
|
489
|
-
return /* @__PURE__ */ g("div", {
|
|
490
|
-
className: "j-tab",
|
|
491
|
-
"data-active": t,
|
|
492
|
-
children: [/* @__PURE__ */ h("div", {
|
|
493
|
-
className: "j-tab__indicator",
|
|
494
|
-
"data-active": t,
|
|
495
|
-
"aria-hidden": !0,
|
|
496
|
-
children: /* @__PURE__ */ h("svg", {
|
|
497
|
-
width: 14,
|
|
498
|
-
height: 10,
|
|
499
|
-
viewBox: "0 0 14 10",
|
|
500
|
-
children: /* @__PURE__ */ h("polygon", { points: "7,10 0,0 14,0" })
|
|
501
|
-
})
|
|
502
|
-
}), /* @__PURE__ */ h("button", {
|
|
503
|
-
type: "button",
|
|
504
|
-
className: "j-tab__btn",
|
|
505
|
-
"data-active": t,
|
|
506
|
-
onClick: n,
|
|
507
|
-
children: /* @__PURE__ */ h(T, {
|
|
508
|
-
size: "sm",
|
|
509
|
-
tone: "default",
|
|
510
|
-
children: e
|
|
511
|
-
})
|
|
512
|
-
})]
|
|
513
|
-
});
|
|
514
|
-
}
|
|
515
|
-
function se({ tabs: e, activeTab: t, onTabChange: n, className: r = "", style: i }) {
|
|
516
|
-
return /* @__PURE__ */ h("div", {
|
|
517
|
-
className: `j-vtabs ${r}`,
|
|
518
|
-
style: i,
|
|
519
|
-
children: e.map((e) => {
|
|
520
|
-
let r = t === e.id;
|
|
521
|
-
return /* @__PURE__ */ h("button", {
|
|
522
|
-
type: "button",
|
|
523
|
-
className: "j-vtab",
|
|
524
|
-
"data-active": r,
|
|
525
|
-
onClick: () => n(e.id),
|
|
526
|
-
children: /* @__PURE__ */ h(T, {
|
|
527
|
-
size: "sm",
|
|
528
|
-
tone: r ? "default" : "grey",
|
|
529
|
-
children: e.label
|
|
530
|
-
})
|
|
531
|
-
}, e.id);
|
|
532
|
-
})
|
|
533
|
-
});
|
|
534
|
-
}
|
|
535
|
-
//#endregion
|
|
536
|
-
//#region src/ui/jimboFlankNav.tsx
|
|
537
|
-
function ce({ onPrev: e, onNext: t, canPrev: n = !0, canNext: r = !0, prevLabel: i = "Previous", nextLabel: a = "Next", children: o, className: s = "", style: c }) {
|
|
538
|
-
return /* @__PURE__ */ g("div", {
|
|
539
|
-
className: `j-flank ${s}`,
|
|
540
|
-
style: c,
|
|
541
|
-
children: [
|
|
542
|
-
/* @__PURE__ */ h(j, {
|
|
543
|
-
direction: "left",
|
|
544
|
-
onClick: e,
|
|
545
|
-
disabled: !n,
|
|
546
|
-
"aria-label": i
|
|
547
|
-
}),
|
|
548
|
-
/* @__PURE__ */ h("div", {
|
|
549
|
-
className: "j-flank__content",
|
|
550
|
-
children: o
|
|
551
|
-
}),
|
|
552
|
-
/* @__PURE__ */ h(j, {
|
|
553
|
-
direction: "right",
|
|
554
|
-
onClick: t,
|
|
555
|
-
disabled: !r,
|
|
556
|
-
"aria-label": a
|
|
557
|
-
})
|
|
558
|
-
]
|
|
559
|
-
});
|
|
560
|
-
}
|
|
561
|
-
function j({ direction: e, onClick: t, disabled: n, "aria-label": r }) {
|
|
562
|
-
let [i, a] = s.useState(!1);
|
|
563
|
-
return /* @__PURE__ */ h("button", {
|
|
564
|
-
type: "button",
|
|
565
|
-
className: "j-flank__btn",
|
|
566
|
-
"data-pressed": i && !n,
|
|
567
|
-
onClick: t,
|
|
568
|
-
disabled: n,
|
|
569
|
-
"aria-label": r,
|
|
570
|
-
title: r,
|
|
571
|
-
onMouseDown: () => !n && a(!0),
|
|
572
|
-
onMouseUp: () => a(!1),
|
|
573
|
-
onMouseLeave: () => a(!1),
|
|
574
|
-
onTouchStart: () => !n && a(!0),
|
|
575
|
-
onTouchEnd: () => a(!1),
|
|
576
|
-
children: /* @__PURE__ */ h(le, { direction: e })
|
|
577
|
-
});
|
|
578
|
-
}
|
|
579
|
-
function le({ direction: e }) {
|
|
580
|
-
return /* @__PURE__ */ h("svg", {
|
|
581
|
-
width: 28,
|
|
582
|
-
height: 28,
|
|
583
|
-
viewBox: "0 0 28 28",
|
|
584
|
-
fill: "none",
|
|
585
|
-
stroke: "currentColor",
|
|
586
|
-
strokeWidth: 2,
|
|
587
|
-
strokeLinecap: "round",
|
|
588
|
-
strokeLinejoin: "round",
|
|
589
|
-
"aria-hidden": !0,
|
|
590
|
-
children: /* @__PURE__ */ h("polyline", { points: e === "left" ? "18,4 8,14 18,24" : "10,4 20,14 10,24" })
|
|
591
|
-
});
|
|
592
|
-
}
|
|
593
|
-
//#endregion
|
|
594
|
-
//#region src/ui/JimboFloating.tsx
|
|
595
|
-
function ue({ anchor: e = "top-right", offset: t = 12, zIndex: n = 20, children: r }) {
|
|
596
|
-
let i = {
|
|
597
|
-
position: "absolute",
|
|
598
|
-
zIndex: n
|
|
599
|
-
};
|
|
600
|
-
return e.includes("top") && (i.top = t), e.includes("bottom") && (i.bottom = t), e.includes("left") && (i.left = t), e.includes("right") && (i.right = t), e.includes("center") && (i.left = "50%", i.transform = "translateX(-50%)"), /* @__PURE__ */ h("div", {
|
|
601
|
-
style: i,
|
|
602
|
-
children: r
|
|
603
|
-
});
|
|
604
|
-
}
|
|
605
|
-
//#endregion
|
|
606
|
-
//#region src/ui/JimboToggleList.tsx
|
|
607
|
-
function de({ items: e, onToggle: t, title: n }) {
|
|
608
|
-
return /* @__PURE__ */ h(E, { children: /* @__PURE__ */ g("div", {
|
|
609
|
-
className: "j-toggle-list",
|
|
610
|
-
children: [n && /* @__PURE__ */ h("div", {
|
|
611
|
-
className: "j-toggle-list__title",
|
|
612
|
-
children: n
|
|
613
|
-
}), e.map((e) => /* @__PURE__ */ g("button", {
|
|
614
|
-
type: "button",
|
|
615
|
-
className: "j-toggle-item",
|
|
616
|
-
onClick: () => t(e.id),
|
|
617
|
-
children: [/* @__PURE__ */ h("div", {
|
|
618
|
-
className: "j-toggle-check",
|
|
619
|
-
"data-on": e.on
|
|
620
|
-
}), e.label]
|
|
621
|
-
}, e.id))]
|
|
622
|
-
}) });
|
|
623
|
-
}
|
|
624
|
-
//#endregion
|
|
625
|
-
//#region src/ui/JimboBadge.tsx
|
|
626
|
-
function fe({ size: e = "sm", tone: t = "dark", className: n, children: r }) {
|
|
627
|
-
return /* @__PURE__ */ h("span", {
|
|
628
|
-
className: `j-badge j-badge--${e} j-badge--${t} ${n ?? ""}`,
|
|
629
|
-
children: r
|
|
630
|
-
});
|
|
631
|
-
}
|
|
632
|
-
//#endregion
|
|
633
|
-
//#region src/ui/jimboFilterBar.tsx
|
|
634
|
-
function M({ search: e, onSearchChange: t, searchPlaceholder: n = "Search...", searchLabel: r = "Search", sort: i, onSortChange: a, sortLabel: o = "Sort By", sortOptions: s, className: c = "", style: l }) {
|
|
635
|
-
return /* @__PURE__ */ g("div", {
|
|
636
|
-
className: `j-filter-bar ${c}`,
|
|
637
|
-
style: l,
|
|
638
|
-
children: [t ? /* @__PURE__ */ g("div", {
|
|
639
|
-
className: "j-filter-bar__field",
|
|
640
|
-
children: [/* @__PURE__ */ h("div", {
|
|
641
|
-
className: "j-filter-bar__pill",
|
|
642
|
-
children: /* @__PURE__ */ h(T, {
|
|
643
|
-
size: "xs",
|
|
644
|
-
children: r
|
|
645
|
-
})
|
|
646
|
-
}), /* @__PURE__ */ g("div", {
|
|
647
|
-
className: "j-relative",
|
|
648
|
-
children: [/* @__PURE__ */ h("div", {
|
|
649
|
-
className: "j-filter-bar__search-icon",
|
|
650
|
-
children: /* @__PURE__ */ h(N, {})
|
|
651
|
-
}), /* @__PURE__ */ h("input", {
|
|
652
|
-
type: "text",
|
|
653
|
-
value: e ?? "",
|
|
654
|
-
onChange: (e) => t(e.target.value),
|
|
655
|
-
placeholder: n,
|
|
656
|
-
className: "j-filter-bar__input"
|
|
657
|
-
})]
|
|
658
|
-
})]
|
|
659
|
-
}) : null, s && a ? /* @__PURE__ */ g("div", {
|
|
660
|
-
className: "j-filter-bar__field",
|
|
661
|
-
children: [/* @__PURE__ */ h("div", {
|
|
662
|
-
className: "j-filter-bar__pill",
|
|
663
|
-
children: /* @__PURE__ */ h(T, {
|
|
664
|
-
size: "xs",
|
|
665
|
-
children: o
|
|
666
|
-
})
|
|
667
|
-
}), /* @__PURE__ */ g("div", {
|
|
668
|
-
className: "j-relative",
|
|
669
|
-
children: [/* @__PURE__ */ h("select", {
|
|
670
|
-
value: i ?? s[0]?.value,
|
|
671
|
-
onChange: (e) => a(e.target.value),
|
|
672
|
-
className: "j-filter-bar__select",
|
|
673
|
-
children: s.map((e) => /* @__PURE__ */ h("option", {
|
|
674
|
-
value: e.value,
|
|
675
|
-
children: e.label
|
|
676
|
-
}, e.value))
|
|
677
|
-
}), /* @__PURE__ */ h("div", {
|
|
678
|
-
className: "j-filter-bar__sort-icon",
|
|
679
|
-
children: /* @__PURE__ */ h(P, {})
|
|
680
|
-
})]
|
|
681
|
-
})]
|
|
682
|
-
}) : null]
|
|
683
|
-
});
|
|
684
|
-
}
|
|
685
|
-
function N() {
|
|
686
|
-
return /* @__PURE__ */ g("svg", {
|
|
687
|
-
width: 24,
|
|
688
|
-
height: 24,
|
|
689
|
-
viewBox: "0 0 24 24",
|
|
690
|
-
fill: "none",
|
|
691
|
-
stroke: "currentColor",
|
|
692
|
-
strokeWidth: 3,
|
|
693
|
-
strokeLinecap: "round",
|
|
694
|
-
strokeLinejoin: "round",
|
|
695
|
-
"aria-hidden": !0,
|
|
696
|
-
children: [/* @__PURE__ */ h("circle", {
|
|
697
|
-
cx: 11,
|
|
698
|
-
cy: 11,
|
|
699
|
-
r: 8
|
|
700
|
-
}), /* @__PURE__ */ h("line", {
|
|
701
|
-
x1: 21,
|
|
702
|
-
y1: 21,
|
|
703
|
-
x2: 16.65,
|
|
704
|
-
y2: 16.65
|
|
705
|
-
})]
|
|
706
|
-
});
|
|
707
|
-
}
|
|
708
|
-
function P() {
|
|
709
|
-
return /* @__PURE__ */ g("svg", {
|
|
710
|
-
width: 20,
|
|
711
|
-
height: 20,
|
|
712
|
-
viewBox: "0 0 24 24",
|
|
713
|
-
fill: "none",
|
|
714
|
-
stroke: "currentColor",
|
|
715
|
-
strokeWidth: 2.5,
|
|
716
|
-
strokeLinecap: "round",
|
|
717
|
-
strokeLinejoin: "round",
|
|
718
|
-
"aria-hidden": !0,
|
|
719
|
-
children: [
|
|
720
|
-
/* @__PURE__ */ h("polyline", { points: "7 4 7 20" }),
|
|
721
|
-
/* @__PURE__ */ h("polyline", { points: "3 8 7 4 11 8" }),
|
|
722
|
-
/* @__PURE__ */ h("polyline", { points: "17 20 17 4" }),
|
|
723
|
-
/* @__PURE__ */ h("polyline", { points: "21 16 17 20 13 16" })
|
|
724
|
-
]
|
|
725
|
-
});
|
|
726
|
-
}
|
|
727
|
-
//#endregion
|
|
728
|
-
//#region src/ui/footer.tsx
|
|
729
|
-
var F = [
|
|
730
|
-
{
|
|
731
|
-
char: "♥️",
|
|
732
|
-
kf: "jaml-heart"
|
|
733
|
-
},
|
|
734
|
-
{
|
|
735
|
-
char: "♠️",
|
|
736
|
-
kf: "jaml-spade"
|
|
737
|
-
},
|
|
738
|
-
{
|
|
739
|
-
char: "♦️",
|
|
740
|
-
kf: "jaml-diamond"
|
|
741
|
-
},
|
|
742
|
-
{
|
|
743
|
-
char: "♣️",
|
|
744
|
-
kf: "jaml-club"
|
|
745
|
-
}
|
|
746
|
-
];
|
|
747
|
-
function I({ className: e = "" }) {
|
|
748
|
-
return /* @__PURE__ */ g("div", {
|
|
749
|
-
className: `j-footer ${e}`,
|
|
750
|
-
children: [/* @__PURE__ */ h("div", {
|
|
751
|
-
className: "j-footer__bar",
|
|
752
|
-
children: /* @__PURE__ */ g("p", {
|
|
753
|
-
className: "j-footer__text",
|
|
754
|
-
children: [
|
|
755
|
-
/* @__PURE__ */ g("span", { children: ["Not affiliated with LocalThunk or PlayStack •", " "] }),
|
|
756
|
-
/* @__PURE__ */ h("a", {
|
|
757
|
-
href: "https://store.steampowered.com/app/2379780/Balatro/",
|
|
758
|
-
target: "_blank",
|
|
759
|
-
rel: "noopener noreferrer",
|
|
760
|
-
className: "j-footer__link",
|
|
761
|
-
children: "Buy Balatro"
|
|
762
|
-
}),
|
|
763
|
-
/* @__PURE__ */ g("span", { children: [
|
|
764
|
-
" ",
|
|
765
|
-
"• Created with",
|
|
766
|
-
" "
|
|
767
|
-
] }),
|
|
768
|
-
/* @__PURE__ */ g("span", {
|
|
769
|
-
className: "j-footer__suits",
|
|
770
|
-
children: [
|
|
771
|
-
/* @__PURE__ */ h("span", {
|
|
772
|
-
className: "j-footer__suit-stage",
|
|
773
|
-
children: F.map(({ char: e, kf: t }) => /* @__PURE__ */ h("span", {
|
|
774
|
-
className: "j-footer__suit-char",
|
|
775
|
-
style: { animationName: t },
|
|
776
|
-
children: e
|
|
777
|
-
}, e))
|
|
778
|
-
}),
|
|
779
|
-
" ",
|
|
780
|
-
"for the Balatro community"
|
|
781
|
-
]
|
|
782
|
-
})
|
|
783
|
-
]
|
|
784
|
-
})
|
|
785
|
-
}), /* @__PURE__ */ h("style", { children: "\n @keyframes jaml-heart { 0%{opacity:0;transform:scale(1)} 1%{opacity:1;transform:scale(1.45)} 3.5%{opacity:1;transform:scale(1)} 61.5%{opacity:1;transform:scale(1)} 62%{opacity:0} 100%{opacity:0} }\n @keyframes jaml-spade { 0%,61.5%{opacity:0} 62%{opacity:1;transform:scale(1.45)} 64.5%{opacity:1;transform:scale(1)} 71.5%{opacity:1} 72%{opacity:0} 100%{opacity:0} }\n @keyframes jaml-diamond { 0%,71.5%{opacity:0} 72%{opacity:1;transform:scale(1.45)} 74.5%{opacity:1;transform:scale(1)} 81.5%{opacity:1} 82%{opacity:0} 100%{opacity:0} }\n @keyframes jaml-club { 0%,81.5%{opacity:0} 82%{opacity:1;transform:scale(1.45)} 84.5%{opacity:1;transform:scale(1)} 95%{opacity:1} 96%{opacity:0} 100%{opacity:0} }\n " })]
|
|
786
|
-
});
|
|
787
|
-
}
|
|
788
|
-
//#endregion
|
|
789
|
-
//#region src/ui/jimboBackground.tsx
|
|
790
|
-
function L() {
|
|
791
|
-
return /* @__PURE__ */ g(m, { children: [/* @__PURE__ */ h("canvas", {
|
|
792
|
-
ref: b(),
|
|
793
|
-
"aria-hidden": !0,
|
|
794
|
-
style: {
|
|
795
|
-
position: "fixed",
|
|
796
|
-
inset: 0,
|
|
797
|
-
width: "100%",
|
|
798
|
-
height: "100%",
|
|
799
|
-
zIndex: -10,
|
|
800
|
-
pointerEvents: "none"
|
|
801
|
-
}
|
|
802
|
-
}), /* @__PURE__ */ h(I, {})] });
|
|
803
|
-
}
|
|
804
|
-
//#endregion
|
|
805
|
-
//#region src/ui/jimboTooltip.tsx
|
|
806
|
-
function R(e, t) {
|
|
807
|
-
typeof e == "function" ? e(t) : e && typeof e == "object" && (e.current = t);
|
|
808
|
-
}
|
|
809
|
-
function z({ content: e, children: t, mode: n = "snap", placement: r = "auto", delay: i = 80, maxWidth: a = 280, disabled: o = !1 }) {
|
|
810
|
-
let { visible: c, pos: u, targetRef: d, tooltipRef: f, show: p, hide: _, handleMouseMove: v } = x({
|
|
811
|
-
mode: n,
|
|
812
|
-
placement: r,
|
|
813
|
-
delay: i,
|
|
814
|
-
disabled: o
|
|
815
|
-
}), y = s.Children.only(t), b = y.ref, S = l((e) => {
|
|
816
|
-
d.current = e, R(b, e);
|
|
817
|
-
}, [b, d]);
|
|
818
|
-
return /* @__PURE__ */ g(m, { children: [s.cloneElement(y, {
|
|
819
|
-
ref: S,
|
|
820
|
-
onMouseEnter: (e) => {
|
|
821
|
-
p(), y.props.onMouseEnter?.(e);
|
|
822
|
-
},
|
|
823
|
-
onMouseLeave: (e) => {
|
|
824
|
-
_(), y.props.onMouseLeave?.(e);
|
|
825
|
-
},
|
|
826
|
-
onFocus: (e) => {
|
|
827
|
-
p(), y.props.onFocus?.(e);
|
|
828
|
-
},
|
|
829
|
-
onBlur: (e) => {
|
|
830
|
-
_(), y.props.onBlur?.(e);
|
|
831
|
-
},
|
|
832
|
-
onMouseMove: (e) => {
|
|
833
|
-
v(e), y.props.onMouseMove?.(e);
|
|
834
|
-
}
|
|
835
|
-
}), c ? /* @__PURE__ */ h("div", {
|
|
836
|
-
ref: f,
|
|
837
|
-
role: "tooltip",
|
|
838
|
-
className: "j-tooltip",
|
|
839
|
-
style: {
|
|
840
|
-
left: u?.left ?? -9999,
|
|
841
|
-
top: u?.top ?? -9999,
|
|
842
|
-
maxWidth: a,
|
|
843
|
-
opacity: +!!u
|
|
844
|
-
},
|
|
845
|
-
children: e
|
|
846
|
-
}) : null] });
|
|
847
|
-
}
|
|
848
|
-
//#endregion
|
|
849
|
-
//#region src/ui/codeBlock.tsx
|
|
850
|
-
function B({ code: e, language: t, filename: n, className: r = "" }) {
|
|
851
|
-
let [i, a] = p(!1);
|
|
852
|
-
return /* @__PURE__ */ g("div", {
|
|
853
|
-
className: `j-code-block ${r}`,
|
|
854
|
-
children: [/* @__PURE__ */ g("div", {
|
|
855
|
-
className: "j-code-block__header",
|
|
856
|
-
children: [/* @__PURE__ */ g("div", {
|
|
857
|
-
className: "j-code-block__meta",
|
|
858
|
-
children: [n && /* @__PURE__ */ h("span", {
|
|
859
|
-
className: "j-code-block__filename",
|
|
860
|
-
children: n
|
|
861
|
-
}), t && /* @__PURE__ */ h("span", {
|
|
862
|
-
className: "j-code-block__lang",
|
|
863
|
-
children: t
|
|
864
|
-
})]
|
|
865
|
-
}), /* @__PURE__ */ h("button", {
|
|
866
|
-
onClick: () => {
|
|
867
|
-
navigator.clipboard.writeText(e), a(!0), setTimeout(() => a(!1), 2e3);
|
|
868
|
-
},
|
|
869
|
-
title: "Copy",
|
|
870
|
-
className: "j-code-block__copy",
|
|
871
|
-
"data-copied": i,
|
|
872
|
-
children: i ? /* @__PURE__ */ h("svg", {
|
|
873
|
-
width: "14",
|
|
874
|
-
height: "14",
|
|
875
|
-
viewBox: "0 0 24 24",
|
|
876
|
-
fill: "none",
|
|
877
|
-
stroke: "currentColor",
|
|
878
|
-
strokeWidth: "2.5",
|
|
879
|
-
strokeLinecap: "round",
|
|
880
|
-
strokeLinejoin: "round",
|
|
881
|
-
children: /* @__PURE__ */ h("polyline", { points: "20 6 9 17 4 12" })
|
|
882
|
-
}) : /* @__PURE__ */ g("svg", {
|
|
883
|
-
width: "14",
|
|
884
|
-
height: "14",
|
|
885
|
-
viewBox: "0 0 24 24",
|
|
886
|
-
fill: "none",
|
|
887
|
-
stroke: "currentColor",
|
|
888
|
-
strokeWidth: "2",
|
|
889
|
-
strokeLinecap: "round",
|
|
890
|
-
strokeLinejoin: "round",
|
|
891
|
-
children: [/* @__PURE__ */ h("rect", {
|
|
892
|
-
x: "9",
|
|
893
|
-
y: "9",
|
|
894
|
-
width: "13",
|
|
895
|
-
height: "13",
|
|
896
|
-
rx: "2"
|
|
897
|
-
}), /* @__PURE__ */ h("path", { d: "M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1" })]
|
|
898
|
-
})
|
|
899
|
-
})]
|
|
900
|
-
}), /* @__PURE__ */ h("pre", {
|
|
901
|
-
className: "j-code-block__pre",
|
|
902
|
-
children: /* @__PURE__ */ h("code", { children: e })
|
|
903
|
-
})]
|
|
904
|
-
});
|
|
905
|
-
}
|
|
906
|
-
//#endregion
|
|
907
|
-
//#region src/ui/jimboApp.tsx
|
|
908
|
-
function V({ children: e, fluid: t, className: n = "", ...r }) {
|
|
909
|
-
return /* @__PURE__ */ h("div", {
|
|
910
|
-
className: `j-app${t ? " j-app--fluid" : ""} ${n}`.trim(),
|
|
911
|
-
...r,
|
|
912
|
-
children: e
|
|
913
|
-
});
|
|
914
|
-
}
|
|
915
|
-
function pe({ children: e, className: t = "", ...n }) {
|
|
916
|
-
return /* @__PURE__ */ h("div", {
|
|
917
|
-
className: `j-app__scroll ${t}`,
|
|
918
|
-
...n,
|
|
919
|
-
children: e
|
|
920
|
-
});
|
|
921
|
-
}
|
|
922
|
-
function H({ children: e, className: t = "", ...n }) {
|
|
923
|
-
return /* @__PURE__ */ h("div", {
|
|
924
|
-
className: `j-app__footer ${t}`,
|
|
925
|
-
...n,
|
|
926
|
-
children: e
|
|
927
|
-
});
|
|
928
|
-
}
|
|
929
|
-
//#endregion
|
|
930
|
-
//#region src/ui/jimboSectionHeader.tsx
|
|
931
|
-
function U({ label: e, tone: t = "blue", className: n = "" }) {
|
|
932
|
-
return /* @__PURE__ */ g("div", {
|
|
933
|
-
className: `j-section-header ${n}`,
|
|
934
|
-
children: [/* @__PURE__ */ h("div", {
|
|
935
|
-
className: `j-section-header__tag j-bg--${t}`,
|
|
936
|
-
children: e
|
|
937
|
-
}), /* @__PURE__ */ h("div", { className: `j-section-header__rule j-bg--${t}` })]
|
|
938
|
-
});
|
|
939
|
-
}
|
|
940
|
-
//#endregion
|
|
941
|
-
//#region src/ui/jimboInfoCard.tsx
|
|
942
|
-
function W({ tone: e, children: t, className: n = "", ...r }) {
|
|
943
|
-
return /* @__PURE__ */ h("div", {
|
|
944
|
-
className: `j-info-card ${e ? `j-border--${e}` : ""} ${n}`,
|
|
945
|
-
style: e ? { borderColor: void 0 } : void 0,
|
|
946
|
-
...r,
|
|
947
|
-
children: t
|
|
948
|
-
});
|
|
949
|
-
}
|
|
950
|
-
function G({ children: e, className: t = "" }) {
|
|
951
|
-
return /* @__PURE__ */ h("div", {
|
|
952
|
-
className: `j-info-card__body ${t}`,
|
|
953
|
-
children: e
|
|
954
|
-
});
|
|
955
|
-
}
|
|
956
|
-
function K({ children: e, className: t = "" }) {
|
|
957
|
-
return /* @__PURE__ */ h("div", {
|
|
958
|
-
className: `j-info-card__title ${t}`,
|
|
959
|
-
children: e
|
|
960
|
-
});
|
|
961
|
-
}
|
|
962
|
-
function q({ children: e, className: t = "" }) {
|
|
963
|
-
return /* @__PURE__ */ h("div", {
|
|
964
|
-
className: `j-info-card__sub ${t}`,
|
|
965
|
-
children: e
|
|
966
|
-
});
|
|
967
|
-
}
|
|
968
|
-
function J({ children: e, className: t = "" }) {
|
|
969
|
-
return /* @__PURE__ */ h("div", {
|
|
970
|
-
className: `j-info-card__aside ${t}`,
|
|
971
|
-
children: e
|
|
972
|
-
});
|
|
973
|
-
}
|
|
974
|
-
//#endregion
|
|
975
|
-
//#region src/ui/showcase.tsx
|
|
976
|
-
function me({ title: e = "Balatro", subtitle: t = "Seed Curator", hotFilters: n = [], recentFinds: r = [], mcpInfo: i, onNewSearch: a, onBrowseFilters: o, onFilterClick: s }) {
|
|
977
|
-
return /* @__PURE__ */ g(V, { children: [
|
|
978
|
-
/* @__PURE__ */ g("div", {
|
|
979
|
-
style: {
|
|
980
|
-
padding: "12px 12px 8px",
|
|
981
|
-
display: "flex",
|
|
982
|
-
flexDirection: "column",
|
|
983
|
-
gap: 6
|
|
984
|
-
},
|
|
985
|
-
children: [
|
|
986
|
-
/* @__PURE__ */ g("div", {
|
|
987
|
-
className: "j-text-center",
|
|
988
|
-
children: [/* @__PURE__ */ h(T, {
|
|
989
|
-
size: "lg",
|
|
990
|
-
tone: "gold",
|
|
991
|
-
children: e
|
|
992
|
-
}), /* @__PURE__ */ h(T, {
|
|
993
|
-
size: "micro",
|
|
994
|
-
tone: "grey",
|
|
995
|
-
style: { letterSpacing: 3 },
|
|
996
|
-
children: t
|
|
997
|
-
})]
|
|
998
|
-
}),
|
|
999
|
-
i && /* @__PURE__ */ g("div", {
|
|
1000
|
-
className: "j-flex j-justify-between",
|
|
1001
|
-
style: {
|
|
1002
|
-
padding: "3px 8px",
|
|
1003
|
-
background: "var(--j-dark-grey)",
|
|
1004
|
-
borderRadius: 4,
|
|
1005
|
-
border: "1px solid var(--j-panel-edge)"
|
|
1006
|
-
},
|
|
1007
|
-
children: [/* @__PURE__ */ h(T, {
|
|
1008
|
-
size: "micro",
|
|
1009
|
-
tone: "purple",
|
|
1010
|
-
children: i.engine
|
|
1011
|
-
}), /* @__PURE__ */ h(T, {
|
|
1012
|
-
size: "micro",
|
|
1013
|
-
tone: "grey",
|
|
1014
|
-
children: i.features
|
|
1015
|
-
})]
|
|
1016
|
-
}),
|
|
1017
|
-
n.length > 0 && /* @__PURE__ */ g(m, { children: [/* @__PURE__ */ h(U, {
|
|
1018
|
-
label: "Filters",
|
|
1019
|
-
tone: "blue"
|
|
1020
|
-
}), /* @__PURE__ */ h("div", {
|
|
1021
|
-
className: "j-flex-col",
|
|
1022
|
-
style: { gap: 4 },
|
|
1023
|
-
children: n.slice(0, 4).map((e, t) => /* @__PURE__ */ g(W, {
|
|
1024
|
-
tone: e.tone,
|
|
1025
|
-
onClick: () => s?.(e, t),
|
|
1026
|
-
style: { cursor: s ? "pointer" : void 0 },
|
|
1027
|
-
children: [
|
|
1028
|
-
/* @__PURE__ */ h("div", {
|
|
1029
|
-
className: "j-flex j-gap-xs",
|
|
1030
|
-
children: e.sample.slice(0, 2).map((e, t) => /* @__PURE__ */ h("div", {
|
|
1031
|
-
style: {
|
|
1032
|
-
width: 22,
|
|
1033
|
-
height: 28,
|
|
1034
|
-
display: "flex",
|
|
1035
|
-
alignItems: "center",
|
|
1036
|
-
justifyContent: "center"
|
|
1037
|
-
},
|
|
1038
|
-
children: /* @__PURE__ */ h(w, {
|
|
1039
|
-
name: e,
|
|
1040
|
-
width: 20
|
|
1041
|
-
})
|
|
1042
|
-
}, t))
|
|
1043
|
-
}),
|
|
1044
|
-
/* @__PURE__ */ g(G, { children: [/* @__PURE__ */ h(K, { children: e.name }), /* @__PURE__ */ g(q, { children: ["by ", e.author] })] }),
|
|
1045
|
-
/* @__PURE__ */ h(J, { children: /* @__PURE__ */ h(T, {
|
|
1046
|
-
size: "xs",
|
|
1047
|
-
tone: e.tone === "gold" ? "gold" : e.tone,
|
|
1048
|
-
children: e.hits
|
|
1049
|
-
}) })
|
|
1050
|
-
]
|
|
1051
|
-
}, t))
|
|
1052
|
-
})] }),
|
|
1053
|
-
r.length > 0 && /* @__PURE__ */ g(m, { children: [/* @__PURE__ */ h(U, {
|
|
1054
|
-
label: "Recent",
|
|
1055
|
-
tone: "green"
|
|
1056
|
-
}), /* @__PURE__ */ h("div", {
|
|
1057
|
-
style: { lineHeight: 1.5 },
|
|
1058
|
-
children: r.slice(0, 3).map((e, t) => /* @__PURE__ */ g("div", {
|
|
1059
|
-
className: "j-flex j-gap-sm",
|
|
1060
|
-
children: [
|
|
1061
|
-
/* @__PURE__ */ h(T, {
|
|
1062
|
-
size: "micro",
|
|
1063
|
-
tone: "gold",
|
|
1064
|
-
children: e.seed
|
|
1065
|
-
}),
|
|
1066
|
-
/* @__PURE__ */ h(T, {
|
|
1067
|
-
size: "micro",
|
|
1068
|
-
tone: "grey",
|
|
1069
|
-
children: e.filterName
|
|
1070
|
-
}),
|
|
1071
|
-
e.score > 0 && /* @__PURE__ */ g(T, {
|
|
1072
|
-
size: "micro",
|
|
1073
|
-
tone: "green",
|
|
1074
|
-
children: ["+", e.score]
|
|
1075
|
-
})
|
|
1076
|
-
]
|
|
1077
|
-
}, t))
|
|
1078
|
-
})] })
|
|
1079
|
-
]
|
|
1080
|
-
}),
|
|
1081
|
-
/* @__PURE__ */ g(H, { children: [/* @__PURE__ */ h(O, {
|
|
1082
|
-
tone: "green",
|
|
1083
|
-
fullWidth: !0,
|
|
1084
|
-
size: "lg",
|
|
1085
|
-
onClick: a,
|
|
1086
|
-
children: "New Search"
|
|
1087
|
-
}), /* @__PURE__ */ h(O, {
|
|
1088
|
-
tone: "blue",
|
|
1089
|
-
fullWidth: !0,
|
|
1090
|
-
size: "lg",
|
|
1091
|
-
onClick: o,
|
|
1092
|
-
children: "Browse Filters"
|
|
1093
|
-
})] }),
|
|
1094
|
-
/* @__PURE__ */ h(I, {})
|
|
1095
|
-
] });
|
|
1096
|
-
}
|
|
1097
|
-
//#endregion
|
|
1098
|
-
//#region src/ui/jimboCopyRow.tsx
|
|
1099
|
-
function he({ value: e, label: t }) {
|
|
1100
|
-
let [n, r] = p(!1);
|
|
1101
|
-
function i() {
|
|
1102
|
-
navigator.clipboard.writeText(e).then(() => {
|
|
1103
|
-
r(!0), setTimeout(() => r(!1), 1500);
|
|
1104
|
-
});
|
|
1105
|
-
}
|
|
1106
|
-
return /* @__PURE__ */ g("div", {
|
|
1107
|
-
className: "j-copy-row",
|
|
1108
|
-
children: [t && /* @__PURE__ */ h(T, {
|
|
1109
|
-
size: "xs",
|
|
1110
|
-
tone: "grey",
|
|
1111
|
-
className: "j-copy-row__label",
|
|
1112
|
-
children: t
|
|
1113
|
-
}), /* @__PURE__ */ g("div", {
|
|
1114
|
-
className: "j-copy-row__field",
|
|
1115
|
-
children: [/* @__PURE__ */ h("div", {
|
|
1116
|
-
className: "j-copy-row__value",
|
|
1117
|
-
children: /* @__PURE__ */ h(T, {
|
|
1118
|
-
size: "sm",
|
|
1119
|
-
children: e
|
|
1120
|
-
})
|
|
1121
|
-
}), /* @__PURE__ */ h("button", {
|
|
1122
|
-
type: "button",
|
|
1123
|
-
className: "j-copy-row__btn",
|
|
1124
|
-
"data-copied": n,
|
|
1125
|
-
onClick: i,
|
|
1126
|
-
children: n ? "Copied" : "Copy"
|
|
1127
|
-
})]
|
|
1128
|
-
})]
|
|
1129
|
-
});
|
|
1130
|
-
}
|
|
1131
|
-
//#endregion
|
|
1132
|
-
//#region src/ui/jimboWordmark.tsx
|
|
1133
|
-
function ge({ title: e, subtitle: t, className: n = "" }) {
|
|
1134
|
-
return /* @__PURE__ */ g("div", {
|
|
1135
|
-
className: `j-wordmark ${n}`,
|
|
1136
|
-
children: [/* @__PURE__ */ h("div", {
|
|
1137
|
-
className: "j-wordmark__title",
|
|
1138
|
-
children: e
|
|
1139
|
-
}), t && /* @__PURE__ */ h("div", {
|
|
1140
|
-
className: "j-wordmark__sub",
|
|
1141
|
-
children: t
|
|
1142
|
-
})]
|
|
1143
|
-
});
|
|
1144
|
-
}
|
|
1145
|
-
//#endregion
|
|
1146
|
-
//#region src/ui/jimboStatGrid.tsx
|
|
1147
|
-
function _e({ items: e, className: t = "", ...n }) {
|
|
1148
|
-
return /* @__PURE__ */ h("div", {
|
|
1149
|
-
className: `j-stat-grid ${t}`,
|
|
1150
|
-
...n,
|
|
1151
|
-
children: e.map((e) => /* @__PURE__ */ g("div", { children: [/* @__PURE__ */ h("div", {
|
|
1152
|
-
className: "j-stat-grid__value",
|
|
1153
|
-
children: e.value
|
|
1154
|
-
}), /* @__PURE__ */ h("div", {
|
|
1155
|
-
className: "j-stat-grid__label",
|
|
1156
|
-
children: e.label
|
|
1157
|
-
})] }, e.label))
|
|
1158
|
-
});
|
|
1159
|
-
}
|
|
1160
|
-
//#endregion
|
|
1161
|
-
//#region src/ui/jimboInset.tsx
|
|
1162
|
-
function Y({ children: e, className: t = "", ...n }) {
|
|
1163
|
-
return /* @__PURE__ */ h("div", {
|
|
1164
|
-
className: `j-inset ${t}`,
|
|
1165
|
-
...n,
|
|
1166
|
-
children: e
|
|
1167
|
-
});
|
|
1168
|
-
}
|
|
1169
|
-
//#endregion
|
|
1170
|
-
//#region src/ui/JimboIconButton.tsx
|
|
1171
|
-
var X = t;
|
|
1172
|
-
function ve({ onClick: e, title: t, "aria-label": n, disabled: r = !1, size: i = "md", children: a }) {
|
|
1173
|
-
let [o, s] = p(!1), c = i === "sm" ? 26 : 30;
|
|
1174
|
-
return /* @__PURE__ */ h("button", {
|
|
1175
|
-
"aria-label": n ?? t,
|
|
1176
|
-
disabled: r,
|
|
1177
|
-
onClick: () => !r && e?.(),
|
|
1178
|
-
onMouseEnter: () => s(!0),
|
|
1179
|
-
onMouseLeave: () => s(!1),
|
|
1180
|
-
style: {
|
|
1181
|
-
width: c,
|
|
1182
|
-
height: c,
|
|
1183
|
-
display: "inline-flex",
|
|
1184
|
-
alignItems: "center",
|
|
1185
|
-
justifyContent: "center",
|
|
1186
|
-
background: o && !r ? X.DARK_GREY : X.DARKEST,
|
|
1187
|
-
color: X.WHITE,
|
|
1188
|
-
border: `1px solid ${X.PANEL_EDGE}`,
|
|
1189
|
-
borderRadius: 4,
|
|
1190
|
-
cursor: r ? "not-allowed" : "pointer",
|
|
1191
|
-
opacity: r ? .55 : 1,
|
|
1192
|
-
padding: 0,
|
|
1193
|
-
fontSize: 14,
|
|
1194
|
-
lineHeight: 1,
|
|
1195
|
-
transition: "background 80ms ease"
|
|
1196
|
-
},
|
|
1197
|
-
title: t,
|
|
1198
|
-
type: "button",
|
|
1199
|
-
children: a
|
|
1200
|
-
});
|
|
1201
|
-
}
|
|
1202
|
-
//#endregion
|
|
1203
|
-
//#region src/ui/JimboInputModal.tsx
|
|
1204
|
-
var Z = t;
|
|
1205
|
-
function ye({ open: e, title: t, message: n, placeholder: r, initialValue: i = "", confirmLabel: a = "Confirm", cancelLabel: o = "Cancel", validate: s, onConfirm: c, onCancel: l }) {
|
|
1206
|
-
let [d, m] = p(i), [_, v] = p(null), y = f(null), [b, x] = p(e);
|
|
1207
|
-
e !== b && (x(e), e && (m(i), v(null))), u(() => {
|
|
1208
|
-
if (e) {
|
|
1209
|
-
let e = setTimeout(() => y.current?.focus(), 30);
|
|
1210
|
-
return () => clearTimeout(e);
|
|
1211
|
-
}
|
|
1212
|
-
}, [e]);
|
|
1213
|
-
function S() {
|
|
1214
|
-
let e = s?.(d) ?? null;
|
|
1215
|
-
if (e) {
|
|
1216
|
-
v(e);
|
|
1217
|
-
return;
|
|
1218
|
-
}
|
|
1219
|
-
c(d);
|
|
1220
|
-
}
|
|
1221
|
-
return /* @__PURE__ */ g(A, {
|
|
1222
|
-
onClose: l,
|
|
1223
|
-
open: e,
|
|
1224
|
-
title: t,
|
|
1225
|
-
children: [
|
|
1226
|
-
n && /* @__PURE__ */ h(T, {
|
|
1227
|
-
size: "sm",
|
|
1228
|
-
style: {
|
|
1229
|
-
display: "block",
|
|
1230
|
-
marginBottom: 8
|
|
1231
|
-
},
|
|
1232
|
-
tone: "grey",
|
|
1233
|
-
children: n
|
|
1234
|
-
}),
|
|
1235
|
-
/* @__PURE__ */ h("input", {
|
|
1236
|
-
"aria-invalid": !!_,
|
|
1237
|
-
onChange: (e) => {
|
|
1238
|
-
m(e.target.value), _ && v(null);
|
|
1239
|
-
},
|
|
1240
|
-
onKeyDown: (e) => {
|
|
1241
|
-
e.key === "Enter" && S(), e.key === "Escape" && l();
|
|
1242
|
-
},
|
|
1243
|
-
placeholder: r,
|
|
1244
|
-
ref: y,
|
|
1245
|
-
style: {
|
|
1246
|
-
width: "100%",
|
|
1247
|
-
padding: "8px 10px",
|
|
1248
|
-
background: Z.DARKEST,
|
|
1249
|
-
color: Z.WHITE,
|
|
1250
|
-
border: `1px solid ${_ ? Z.RED : Z.PANEL_EDGE}`,
|
|
1251
|
-
borderRadius: 4,
|
|
1252
|
-
fontSize: 13,
|
|
1253
|
-
fontFamily: "m6x11plus, monospace",
|
|
1254
|
-
letterSpacing: 1,
|
|
1255
|
-
outline: "none",
|
|
1256
|
-
boxSizing: "border-box"
|
|
1257
|
-
},
|
|
1258
|
-
type: "text",
|
|
1259
|
-
value: d
|
|
1260
|
-
}),
|
|
1261
|
-
_ && /* @__PURE__ */ h(T, {
|
|
1262
|
-
size: "sm",
|
|
1263
|
-
style: {
|
|
1264
|
-
display: "block",
|
|
1265
|
-
marginTop: 6
|
|
1266
|
-
},
|
|
1267
|
-
tone: "red",
|
|
1268
|
-
children: _
|
|
1269
|
-
}),
|
|
1270
|
-
/* @__PURE__ */ g("div", {
|
|
1271
|
-
style: {
|
|
1272
|
-
display: "flex",
|
|
1273
|
-
justifyContent: "flex-end",
|
|
1274
|
-
gap: 8,
|
|
1275
|
-
marginTop: 14
|
|
1276
|
-
},
|
|
1277
|
-
children: [/* @__PURE__ */ h(O, {
|
|
1278
|
-
onClick: l,
|
|
1279
|
-
size: "sm",
|
|
1280
|
-
tone: "red",
|
|
1281
|
-
children: o
|
|
1282
|
-
}), /* @__PURE__ */ h(O, {
|
|
1283
|
-
onClick: S,
|
|
1284
|
-
size: "sm",
|
|
1285
|
-
tone: "blue",
|
|
1286
|
-
children: a
|
|
1287
|
-
})]
|
|
1288
|
-
})
|
|
1289
|
-
]
|
|
1290
|
-
});
|
|
1291
|
-
}
|
|
1292
|
-
//#endregion
|
|
1293
|
-
//#region src/ui/JimboSelect.tsx
|
|
1294
|
-
var Q = t;
|
|
1295
|
-
function be({ value: e, options: t, onChange: n, placeholder: r, disabled: i = !1, fullWidth: a = !0, size: o = "md", style: s, "aria-label": c }) {
|
|
1296
|
-
let l;
|
|
1297
|
-
l = t.length === 0 ? [] : typeof t[0] == "string" ? t.map((e) => ({ value: e })) : t;
|
|
1298
|
-
let u = o === "sm" ? "4px 8px" : "6px 10px", d = o === "sm" ? 11 : 12;
|
|
1299
|
-
return /* @__PURE__ */ g("select", {
|
|
1300
|
-
"aria-label": c,
|
|
1301
|
-
disabled: i,
|
|
1302
|
-
onChange: (e) => n(e.target.value),
|
|
1303
|
-
style: {
|
|
1304
|
-
width: a ? "100%" : void 0,
|
|
1305
|
-
padding: u,
|
|
1306
|
-
background: Q.DARKEST,
|
|
1307
|
-
color: Q.WHITE,
|
|
1308
|
-
border: `1px solid ${Q.PANEL_EDGE}`,
|
|
1309
|
-
borderRadius: 4,
|
|
1310
|
-
fontSize: d,
|
|
1311
|
-
fontFamily: "m6x11plus, monospace",
|
|
1312
|
-
cursor: i ? "not-allowed" : "pointer",
|
|
1313
|
-
opacity: i ? .55 : 1,
|
|
1314
|
-
appearance: "none",
|
|
1315
|
-
backgroundImage: "linear-gradient(45deg, transparent 50%, " + Q.GOLD_TEXT + " 50%), linear-gradient(135deg, " + Q.GOLD_TEXT + " 50%, transparent 50%)",
|
|
1316
|
-
backgroundPosition: "calc(100% - 12px) 50%, calc(100% - 7px) 50%",
|
|
1317
|
-
backgroundSize: "5px 5px, 5px 5px",
|
|
1318
|
-
backgroundRepeat: "no-repeat",
|
|
1319
|
-
paddingRight: 22,
|
|
1320
|
-
...s
|
|
1321
|
-
},
|
|
1322
|
-
value: e,
|
|
1323
|
-
children: [r !== void 0 && /* @__PURE__ */ h("option", {
|
|
1324
|
-
disabled: !0,
|
|
1325
|
-
value: "",
|
|
1326
|
-
children: r
|
|
1327
|
-
}), l.map((e) => /* @__PURE__ */ h("option", {
|
|
1328
|
-
disabled: e.disabled,
|
|
1329
|
-
value: e.value,
|
|
1330
|
-
children: e.label ?? e.value
|
|
1331
|
-
}, e.value))]
|
|
1332
|
-
});
|
|
1333
|
-
}
|
|
1334
|
-
//#endregion
|
|
1335
|
-
//#region src/ui/PanelSplitter.tsx
|
|
1336
|
-
var $ = t;
|
|
1337
|
-
function xe({ orientation: e = "vertical", onDrag: t, onKeyAdjust: n, "aria-label": r }) {
|
|
1338
|
-
let i = f(!1), a = f(0), o = f(t);
|
|
1339
|
-
d(() => {
|
|
1340
|
-
o.current = t;
|
|
1341
|
-
});
|
|
1342
|
-
let s = l((t) => {
|
|
1343
|
-
t.preventDefault(), t.target.setPointerCapture(t.pointerId), i.current = !0, a.current = e === "vertical" ? t.clientX : t.clientY;
|
|
1344
|
-
}, [e]);
|
|
1345
|
-
u(() => {
|
|
1346
|
-
function t(t) {
|
|
1347
|
-
if (!i.current) return;
|
|
1348
|
-
let n = e === "vertical" ? t.clientX : t.clientY, r = n - a.current;
|
|
1349
|
-
r !== 0 && (a.current = n, o.current(r));
|
|
1350
|
-
}
|
|
1351
|
-
function n() {
|
|
1352
|
-
i.current = !1;
|
|
1353
|
-
}
|
|
1354
|
-
return window.addEventListener("pointermove", t), window.addEventListener("pointerup", n), window.addEventListener("pointercancel", n), () => {
|
|
1355
|
-
window.removeEventListener("pointermove", t), window.removeEventListener("pointerup", n), window.removeEventListener("pointercancel", n);
|
|
1356
|
-
};
|
|
1357
|
-
}, [e]);
|
|
1358
|
-
let c = e === "vertical";
|
|
1359
|
-
return /* @__PURE__ */ h("button", {
|
|
1360
|
-
"aria-label": r ?? "Resize panel",
|
|
1361
|
-
onKeyDown: (e) => {
|
|
1362
|
-
n && (c && e.key === "ArrowLeft" && n(-16), c && e.key === "ArrowRight" && n(16), !c && e.key === "ArrowUp" && n(-16), !c && e.key === "ArrowDown" && n(16));
|
|
1363
|
-
},
|
|
1364
|
-
onPointerDown: s,
|
|
1365
|
-
style: {
|
|
1366
|
-
all: "unset",
|
|
1367
|
-
display: "block",
|
|
1368
|
-
flex: "0 0 auto",
|
|
1369
|
-
width: c ? 6 : void 0,
|
|
1370
|
-
height: c ? void 0 : 6,
|
|
1371
|
-
cursor: c ? "col-resize" : "row-resize",
|
|
1372
|
-
background: $.PANEL_EDGE,
|
|
1373
|
-
borderLeft: c ? `1px solid ${$.BLACK}` : void 0,
|
|
1374
|
-
borderRight: c ? `1px solid ${$.BLACK}` : void 0,
|
|
1375
|
-
borderTop: c ? void 0 : `1px solid ${$.BLACK}`,
|
|
1376
|
-
borderBottom: c ? void 0 : `1px solid ${$.BLACK}`,
|
|
1377
|
-
touchAction: "none",
|
|
1378
|
-
userSelect: "none"
|
|
1379
|
-
},
|
|
1380
|
-
type: "button"
|
|
1381
|
-
});
|
|
1382
|
-
}
|
|
1383
|
-
//#endregion
|
|
1384
|
-
export { k as A, S as B, M as C, ce as D, ue as E, T as F, ie as I, w as L, D as M, A as N, ae as O, E as P, ne as R, I as S, de as T, ee as V, H as _, Y as a, z as b, he as c, J as d, G as f, V as g, U as h, ve as i, O as j, se as k, me as l, K as m, be as n, _e as o, q as p, ye as r, ge as s, xe as t, W as u, pe as v, fe as w, L as x, B as y, C as z };
|
|
1385
|
-
|
|
1386
|
-
//# sourceMappingURL=ui-BBUfR6RM.js.map
|