@kolkrabbi/design-editor 0.13.0 → 0.15.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.
@@ -0,0 +1,127 @@
1
+ import { Bt as e, Ft as t, Ut as n, Vt as r, m as i, v as a } from "./rolls-CkmuE-Ya.js";
2
+ import { PopoverPanel as o, Tooltip as s, usePopover as c } from "@kolkrabbi/kol-component";
3
+ import { useEffect as l, useState as u } from "react";
4
+ import { Fragment as d, jsx as f, jsxs as p } from "react/jsx-runtime";
5
+ //#region src/editor/params/dotVisibility.js
6
+ var m = "kol-editor-show-dots", h = !1;
7
+ try {
8
+ h = localStorage.getItem(m) === "1";
9
+ } catch {}
10
+ var g = /* @__PURE__ */ new Set();
11
+ function _() {
12
+ h = !h;
13
+ try {
14
+ localStorage.setItem(m, h ? "1" : "0");
15
+ } catch {}
16
+ g.forEach((e) => e(h));
17
+ }
18
+ function v() {
19
+ let [e, t] = u(h);
20
+ return l(() => {
21
+ let e = (e) => t(e);
22
+ return g.add(e), () => g.delete(e);
23
+ }, []), e;
24
+ }
25
+ //#endregion
26
+ //#region src/editor/params/BindDot.jsx
27
+ function y({ layer: l, param: m, setProp: h }) {
28
+ let [g, _] = u(!1), y = c({
29
+ open: g,
30
+ onOpenChange: _,
31
+ placement: "bottom-end",
32
+ offset: 4,
33
+ role: "menu"
34
+ }), b = v(), x = l[m.key], S = i(x), C = S ? x.bind === "track" ? "track" : x.source : "none";
35
+ if (!b && !S) return null;
36
+ let w = () => a(x, t.getCtx(), l) ?? m.default ?? 0, T = () => m.min != null && m.max != null ? [m.min, m.max] : [0, 1], E = (t) => {
37
+ if (_(!1), t === "none") h(m.key, w());
38
+ else if (t === "track") {
39
+ let e = w();
40
+ h(m.key, {
41
+ bind: "track",
42
+ keys: [{
43
+ t: 0,
44
+ v: e,
45
+ easing: "linear"
46
+ }, {
47
+ t: 1,
48
+ v: e,
49
+ easing: "linear"
50
+ }]
51
+ });
52
+ } else e(t)?.ensure?.().catch(() => {}), h(m.key, {
53
+ bind: "mod",
54
+ source: t,
55
+ transform: { range: T() }
56
+ });
57
+ }, D = m.type === "color" ? [] : r().filter((e) => !e.hidden), O = D.find((e) => n(e.id)), k = [
58
+ {
59
+ value: "none",
60
+ label: "Constant"
61
+ },
62
+ {
63
+ value: "track",
64
+ label: "Keyframes"
65
+ },
66
+ ...D.filter((e) => !n(e.id)).map((e) => ({
67
+ value: e.id,
68
+ label: e.label
69
+ })),
70
+ ...O ? [{
71
+ value: O.id,
72
+ label: "Joystick"
73
+ }] : []
74
+ ];
75
+ return /* @__PURE__ */ p(d, { children: [/* @__PURE__ */ f(s, {
76
+ label: S ? `Modulated (${C}) — shape it in the Animation tab` : "Modulate",
77
+ children: /* @__PURE__ */ f("button", {
78
+ ref: y.refs.setReference,
79
+ ...y.getReferenceProps(),
80
+ type: "button",
81
+ "aria-label": `Modulate ${m.label ?? m.key}`,
82
+ className: "inline-flex items-center justify-center w-5 h-5 rounded shrink-0",
83
+ style: {
84
+ border: "none",
85
+ background: "transparent",
86
+ cursor: "pointer"
87
+ },
88
+ children: /* @__PURE__ */ f("span", {
89
+ "aria-hidden": "true",
90
+ className: "rounded-full",
91
+ style: {
92
+ width: 7,
93
+ height: 7,
94
+ background: S ? "var(--kol-accent-primary)" : "transparent",
95
+ border: `1.5px solid ${S ? "var(--kol-accent-primary)" : "var(--kol-fg-48)"}`
96
+ }
97
+ })
98
+ })
99
+ }), /* @__PURE__ */ f(o, {
100
+ popover: y,
101
+ panel: !1,
102
+ focus: !1,
103
+ className: "z-50 bg-surface-secondary border border-oq-08 rounded shadow-lg",
104
+ style: {
105
+ maxHeight: "50vh",
106
+ overflowY: "auto",
107
+ overscrollBehavior: "contain"
108
+ },
109
+ children: /* @__PURE__ */ f("div", {
110
+ className: "w-[220px]",
111
+ children: k.map((e) => /* @__PURE__ */ p("button", {
112
+ type: "button",
113
+ onClick: () => E(e.value),
114
+ className: "w-full kol-helper-12 px-3 h-8 inline-flex items-center gap-2 text-body hover:text-emphasis text-left",
115
+ children: [/* @__PURE__ */ f("span", {
116
+ className: "flex-1 truncate",
117
+ children: e.label
118
+ }), /* @__PURE__ */ f("span", {
119
+ className: "kol-helper-10 text-emphasis shrink-0",
120
+ children: C === e.value ? "✓" : ""
121
+ })]
122
+ }, e.value))
123
+ })
124
+ })] });
125
+ }
126
+ //#endregion
127
+ export { _ as n, y as t };
@@ -0,0 +1,587 @@
1
+ import { Bt as e, Ft as t, Gt as n, Ht as r, Ut as i, Wt as a, m as o } from "./rolls-CkmuE-Ya.js";
2
+ import { Button as s, Dropdown as c, Input as l, LabeledControl as u, Section as d, Slider as f, Stepper as p, Tooltip as m, ViewToggle as h } from "@kolkrabbi/kol-component";
3
+ import { useEffect as g, useRef as _, useState as v } from "react";
4
+ import { Fragment as y, jsx as b, jsxs as x } from "react/jsx-runtime";
5
+ //#region src/editor/params/ModulationEditor.jsx
6
+ var S = [
7
+ {
8
+ code: "wave(t*2)",
9
+ desc: "Fast sine"
10
+ },
11
+ {
12
+ code: "saw(t)*0.8",
13
+ desc: "Ramp to 80"
14
+ },
15
+ {
16
+ code: "tri(t*0.5)",
17
+ desc: "Slow bounce"
18
+ },
19
+ {
20
+ code: "pulse(t, 0.3)",
21
+ desc: "PWM 30%"
22
+ },
23
+ {
24
+ code: "ease(t*2, 4)",
25
+ desc: "Fast + punchy"
26
+ },
27
+ {
28
+ code: "bell(t)",
29
+ desc: "Bell curve"
30
+ },
31
+ {
32
+ code: "step(t, 4)",
33
+ desc: "4 steps"
34
+ },
35
+ {
36
+ code: "rand()",
37
+ desc: "Noise"
38
+ }
39
+ ], C = 196, w = 64;
40
+ function T({ expr: e }) {
41
+ let n = _(null);
42
+ return g(() => {
43
+ let i = n.current;
44
+ if (!i) return;
45
+ let a = Math.min(2, window.devicePixelRatio || 1);
46
+ i.width = C * a, i.height = w * a;
47
+ let o = i.getContext("2d");
48
+ o.setTransform(a, 0, 0, a, 0, 0);
49
+ let s = 0, c = () => {
50
+ s = requestAnimationFrame(c);
51
+ let n = getComputedStyle(i), a = n.getPropertyValue("--kol-accent-primary").trim() || "#2dd4bf", l = n.color || "rgb(160,160,160)", u = r(e), d = t.getLoopSeconds(), f = t.getCtx().t ?? 0, p = C - 12, m = w - 12;
52
+ o.clearRect(0, 0, C, w);
53
+ let h = p, g = new Float64Array(185), _ = Infinity, v = -Infinity;
54
+ for (let e = 0; e <= h; e++) {
55
+ let t = u.ok ? u.fn(e / h * d) : 0;
56
+ g[e] = t, t < _ && (_ = t), t > v && (v = t);
57
+ }
58
+ let y = (_ + v) / 2, b = Math.min(_, 0), x = Math.max(v, 1) - b || 1, S = (e) => 6 + m * (1 - (e - b) / x), T = (e) => 6 + e / h * p;
59
+ o.strokeStyle = "rgba(231,76,60,0.35)", o.lineWidth = 1, o.setLineDash([4, 4]);
60
+ for (let e of [0, 1]) {
61
+ let t = S(e);
62
+ o.beginPath(), o.moveTo(6, t), o.lineTo(C - 6, t), o.stroke();
63
+ }
64
+ if (o.setLineDash([]), u.ok) {
65
+ o.font = "8px var(--kol-font-family-mono, monospace)", o.strokeStyle = l, o.fillStyle = l;
66
+ for (let e of [
67
+ v,
68
+ y,
69
+ _
70
+ ]) {
71
+ let t = S(e);
72
+ o.globalAlpha = .12, o.beginPath(), o.moveTo(6, t), o.lineTo(C - 6, t), o.stroke(), o.globalAlpha = .5, o.fillText(e.toFixed(2), 8, t - 2);
73
+ }
74
+ o.globalAlpha = 1;
75
+ let e = (e) => {
76
+ o.beginPath();
77
+ for (let t = 0; t <= e; t++) {
78
+ let e = S(g[t]);
79
+ t === 0 ? o.moveTo(T(0), e) : o.lineTo(T(t), e);
80
+ }
81
+ o.stroke();
82
+ };
83
+ o.strokeStyle = a, o.lineWidth = 1, o.globalAlpha = .25, e(h);
84
+ let t = 6 + f * p;
85
+ o.globalAlpha = .4, o.beginPath(), o.moveTo(t, 6), o.lineTo(t, w - 6), o.stroke(), o.globalAlpha = 1, o.lineWidth = 1.5, e(Math.round(f * h)), o.fillStyle = a, o.beginPath(), o.arc(t, S(u.fn(f * d)), 2.5, 0, Math.PI * 2), o.fill();
86
+ }
87
+ };
88
+ return c(), () => cancelAnimationFrame(s);
89
+ }, [e]), /* @__PURE__ */ b("canvas", {
90
+ ref: n,
91
+ "aria-label": "Expression plot over one loop",
92
+ style: {
93
+ width: C,
94
+ height: w,
95
+ display: "block",
96
+ borderRadius: 3,
97
+ background: "var(--kol-fg-04, rgba(128,128,128,0.06))"
98
+ }
99
+ });
100
+ }
101
+ function E({ layer: t, param: r, setProp: s }) {
102
+ let c = t[r.key], [d, p] = v(null), [m, g] = v(!1), [_, C] = v(!1);
103
+ if (!o(c) || c.bind !== "mod") return null;
104
+ let w = c.source, E = c.transform ?? {}, D = w.startsWith("lfo-"), O = w === "midi", k = i(w), A = w === "expr", j = E.expr ?? "wave(t)", M = (e) => s(r.key, {
105
+ ...c,
106
+ transform: {
107
+ ...E,
108
+ ...e
109
+ }
110
+ }), N = (e) => {
111
+ p(null);
112
+ let t = String(e).trim();
113
+ t && t !== j && M({ expr: t });
114
+ }, P = async () => {
115
+ g(!0);
116
+ let e = await n();
117
+ g(!1), e != null && M({ cc: e });
118
+ }, F = async () => {
119
+ C(!0);
120
+ let e = await a();
121
+ C(!1), e && s(r.key, {
122
+ ...c,
123
+ source: e
124
+ });
125
+ }, I = E.range ?? (r.min != null && r.max != null ? [r.min, r.max] : [0, 1]), L = (e, t) => {
126
+ let n = Number(e);
127
+ return Number.isFinite(n) ? n : t;
128
+ };
129
+ return /* @__PURE__ */ x("div", {
130
+ className: "flex flex-col gap-3",
131
+ children: [
132
+ /* @__PURE__ */ b(u, {
133
+ label: "Range",
134
+ children: /* @__PURE__ */ x("div", {
135
+ className: "flex items-center gap-2",
136
+ children: [
137
+ /* @__PURE__ */ b(l, {
138
+ variant: "filled",
139
+ size: "sm",
140
+ type: "number",
141
+ chars: 5,
142
+ value: I[0],
143
+ onChange: (e) => M({ range: [L(e.target.value, I[0]), I[1]] })
144
+ }),
145
+ /* @__PURE__ */ b("span", {
146
+ className: "kol-helper-10 text-meta",
147
+ children: "to"
148
+ }),
149
+ /* @__PURE__ */ b(l, {
150
+ variant: "filled",
151
+ size: "sm",
152
+ type: "number",
153
+ chars: 5,
154
+ value: I[1],
155
+ onChange: (e) => M({ range: [I[0], L(e.target.value, I[1])] })
156
+ })
157
+ ]
158
+ })
159
+ }),
160
+ /* @__PURE__ */ x("div", {
161
+ className: "grid grid-cols-2 gap-2",
162
+ children: [/* @__PURE__ */ b(u, {
163
+ label: "Invert",
164
+ children: /* @__PURE__ */ b(h, {
165
+ options: [{
166
+ value: "off",
167
+ label: "Off"
168
+ }, {
169
+ value: "on",
170
+ label: "On"
171
+ }],
172
+ viewMode: E?.invert ? "on" : "off",
173
+ onViewChange: (e) => M({ invert: e === "on" })
174
+ })
175
+ }), /* @__PURE__ */ b(u, {
176
+ label: "Smooth",
177
+ children: /* @__PURE__ */ b(f, {
178
+ min: 0,
179
+ max: .95,
180
+ step: .05,
181
+ value: E?.smooth ?? 0,
182
+ onChange: (e) => M({ smooth: e })
183
+ })
184
+ })]
185
+ }),
186
+ /* @__PURE__ */ b(u, {
187
+ label: "Curve",
188
+ children: /* @__PURE__ */ b(f, {
189
+ min: .25,
190
+ max: 4,
191
+ step: .05,
192
+ value: E?.curve ?? 1,
193
+ onChange: (e) => M({ curve: e })
194
+ })
195
+ }),
196
+ D && /* @__PURE__ */ x("div", {
197
+ className: "grid grid-cols-2 gap-2",
198
+ children: [/* @__PURE__ */ b(u, {
199
+ label: "Rate · cycles",
200
+ children: /* @__PURE__ */ b(f, {
201
+ min: .25,
202
+ max: 16,
203
+ step: .25,
204
+ value: E?.rate ?? 1,
205
+ onChange: (e) => M({ rate: e })
206
+ })
207
+ }), /* @__PURE__ */ b(u, {
208
+ label: "Phase",
209
+ children: /* @__PURE__ */ b(f, {
210
+ min: 0,
211
+ max: 1,
212
+ step: .01,
213
+ value: E?.phase ?? 0,
214
+ onChange: (e) => M({ phase: e })
215
+ })
216
+ })]
217
+ }),
218
+ A && /* @__PURE__ */ x(y, { children: [
219
+ /* @__PURE__ */ b(u, {
220
+ label: "Expression",
221
+ children: /* @__PURE__ */ b(l, {
222
+ variant: "ghost",
223
+ size: "sm",
224
+ value: d ?? j,
225
+ onChange: (e) => p(e.target.value),
226
+ onBlur: (e) => N(e.target.value),
227
+ onKeyDown: (e) => {
228
+ e.key === "Enter" && e.currentTarget.blur();
229
+ }
230
+ })
231
+ }),
232
+ /* @__PURE__ */ b(T, { expr: j }),
233
+ /* @__PURE__ */ b("div", {
234
+ className: "flex flex-col",
235
+ children: S.map((e) => /* @__PURE__ */ x("button", {
236
+ type: "button",
237
+ onClick: () => M({ expr: e.code }),
238
+ className: "w-full kol-helper-10 h-6 inline-flex items-center gap-2 text-body hover:text-emphasis text-left",
239
+ style: {
240
+ background: "transparent",
241
+ border: "none",
242
+ cursor: "pointer",
243
+ fontVariantLigatures: "none"
244
+ },
245
+ children: [/* @__PURE__ */ b("span", {
246
+ className: "truncate",
247
+ style: { fontFamily: "var(--kol-font-family-mono, monospace)" },
248
+ children: e.code
249
+ }), /* @__PURE__ */ b("span", {
250
+ className: "flex-1 text-right text-meta truncate",
251
+ children: e.desc
252
+ })]
253
+ }, e.code))
254
+ })
255
+ ] }),
256
+ O && /* @__PURE__ */ b(u, {
257
+ label: E?.cc == null ? "MIDI · no CC yet" : `MIDI · CC ${E.cc}`,
258
+ children: /* @__PURE__ */ b("button", {
259
+ type: "button",
260
+ onClick: P,
261
+ className: "kol-helper-12 px-2 py-1 rounded border border-oq-08 text-body hover:text-emphasis",
262
+ style: {
263
+ background: "transparent",
264
+ cursor: "pointer"
265
+ },
266
+ children: m ? "Move a knob…" : "Learn"
267
+ })
268
+ }),
269
+ k && /* @__PURE__ */ b(u, {
270
+ label: e(w)?.label ?? "Gamepad",
271
+ children: /* @__PURE__ */ b("button", {
272
+ type: "button",
273
+ onClick: F,
274
+ className: "kol-helper-12 px-2 py-1 rounded border border-oq-08 text-body hover:text-emphasis",
275
+ style: {
276
+ background: "transparent",
277
+ cursor: "pointer"
278
+ },
279
+ children: _ ? "Move a control…" : "Learn"
280
+ })
281
+ })
282
+ ]
283
+ });
284
+ }
285
+ function D({ layer: t, schema: n, setProp: r }) {
286
+ let i = (n ?? []).filter((e) => {
287
+ let n = t[e.key];
288
+ return o(n) && n.bind === "mod";
289
+ });
290
+ return i.length === 0 ? null : /* @__PURE__ */ x("div", {
291
+ className: "flex flex-col gap-4",
292
+ children: [/* @__PURE__ */ b("span", {
293
+ className: "kol-helper-10 text-meta",
294
+ children: "Modulation"
295
+ }), i.map((n) => {
296
+ let i = e(t[n.key].source);
297
+ return /* @__PURE__ */ x("div", {
298
+ className: "flex flex-col gap-2 pt-3 border-t border-oq-08",
299
+ children: [/* @__PURE__ */ x("div", {
300
+ className: "flex items-center justify-between",
301
+ children: [/* @__PURE__ */ b("span", {
302
+ className: "kol-helper-12 text-emphasis",
303
+ children: n.label ?? n.key
304
+ }), /* @__PURE__ */ b("span", {
305
+ className: "kol-helper-10 text-meta",
306
+ children: i?.label ?? t[n.key].source
307
+ })]
308
+ }), /* @__PURE__ */ b(E, {
309
+ layer: t,
310
+ param: n,
311
+ setProp: r
312
+ })]
313
+ }, n.key);
314
+ })]
315
+ });
316
+ }
317
+ //#endregion
318
+ //#region src/editor/modes/pattern/RuleRow.jsx
319
+ var O = [
320
+ {
321
+ value: "all",
322
+ label: "All cells"
323
+ },
324
+ {
325
+ value: "every-col",
326
+ label: "Every Nth col"
327
+ },
328
+ {
329
+ value: "every-row",
330
+ label: "Every Nth row"
331
+ },
332
+ {
333
+ value: "both",
334
+ label: "Nth col × Nth row"
335
+ },
336
+ {
337
+ value: "every-nth",
338
+ label: "Every Nth (flat)"
339
+ },
340
+ {
341
+ value: "checker",
342
+ label: "Checker"
343
+ },
344
+ {
345
+ value: "expression",
346
+ label: "Expression…"
347
+ }
348
+ ], k = [
349
+ {
350
+ value: 0,
351
+ label: "0°"
352
+ },
353
+ {
354
+ value: 90,
355
+ label: "90°"
356
+ },
357
+ {
358
+ value: 180,
359
+ label: "180°"
360
+ },
361
+ {
362
+ value: 270,
363
+ label: "270°"
364
+ }
365
+ ], A = [
366
+ "every-col",
367
+ "every-row",
368
+ "both",
369
+ "every-nth",
370
+ "checker"
371
+ ], j = [
372
+ 0,
373
+ 90,
374
+ 180,
375
+ 270
376
+ ], M = 1, N = () => `r${M++}`, P = () => ({
377
+ id: N(),
378
+ selectKind: "every-col",
379
+ n: 2,
380
+ offset: 0,
381
+ n2: 2,
382
+ offset2: 0,
383
+ expression: "sin(col * 0.6) + cos(row * 0.6)",
384
+ groupW: 1,
385
+ groupH: 1,
386
+ rotate: 90,
387
+ flipH: !1,
388
+ flipV: !1,
389
+ hide: !1,
390
+ opacity: 1
391
+ }), F = (e) => e[Math.floor(Math.random() * e.length)], I = () => ({
392
+ id: N(),
393
+ selectKind: F(A),
394
+ n: Math.floor(Math.random() * 5) + 2,
395
+ offset: Math.floor(Math.random() * 3),
396
+ n2: Math.floor(Math.random() * 5) + 2,
397
+ offset2: Math.floor(Math.random() * 3),
398
+ expression: "sin(col * 0.6) + cos(row * 0.6)",
399
+ groupW: Math.random() > .6 ? Math.floor(Math.random() * 3) + 1 : 1,
400
+ groupH: Math.random() > .6 ? Math.floor(Math.random() * 3) + 1 : 1,
401
+ rotate: F(j),
402
+ flipH: Math.random() > .6,
403
+ flipV: Math.random() > .6,
404
+ hide: Math.random() > .85,
405
+ opacity: Math.random() > .7 ? .4 + Math.random() * .6 : 1
406
+ });
407
+ function L({ value: e, onChange: t, min: n = 0, max: r = 99 }) {
408
+ return /* @__PURE__ */ b(p, {
409
+ size: "sm",
410
+ value: e,
411
+ min: n,
412
+ max: r,
413
+ onChange: (e) => t(Number(e.target.value)),
414
+ className: "w-full"
415
+ });
416
+ }
417
+ function R({ active: e, onClick: t, children: n, title: r }) {
418
+ return /* @__PURE__ */ b(m, {
419
+ label: r,
420
+ children: /* @__PURE__ */ b(s, {
421
+ "aria-label": r,
422
+ variant: e ? "primary" : "outline",
423
+ size: "sm",
424
+ onClick: t,
425
+ "aria-pressed": e,
426
+ children: n
427
+ })
428
+ });
429
+ }
430
+ function z({ rule: e, onChange: t, onRemove: n, onReroll: r }) {
431
+ let i = (n) => t({
432
+ ...e,
433
+ ...n
434
+ }), a = e.selectKind === "every-col" || e.selectKind === "every-row" || e.selectKind === "every-nth" || e.selectKind === "both", o = e.selectKind === "both", u = e.selectKind === "expression";
435
+ return /* @__PURE__ */ x("div", {
436
+ className: "flex flex-col gap-2 p-2 border border-oq-08 rounded",
437
+ children: [
438
+ /* @__PURE__ */ x("div", {
439
+ className: "flex items-center gap-2",
440
+ children: [
441
+ /* @__PURE__ */ b("div", {
442
+ className: "flex-1 min-w-0",
443
+ children: /* @__PURE__ */ b(c, {
444
+ variant: "subtle",
445
+ size: "sm",
446
+ className: "w-full",
447
+ options: O,
448
+ value: e.selectKind,
449
+ onChange: (e) => i({ selectKind: e })
450
+ })
451
+ }),
452
+ /* @__PURE__ */ b(m, {
453
+ label: "Re-randomize this rule",
454
+ children: /* @__PURE__ */ b(s, {
455
+ variant: "ghost",
456
+ size: "sm",
457
+ iconOnly: "refresh",
458
+ iconSize: 12,
459
+ onClick: r,
460
+ "aria-label": "Re-randomize rule",
461
+ className: "shrink-0",
462
+ style: { padding: 6 }
463
+ })
464
+ }),
465
+ /* @__PURE__ */ b(s, {
466
+ variant: "ghost",
467
+ size: "sm",
468
+ iconOnly: "x",
469
+ iconSize: 12,
470
+ onClick: n,
471
+ "aria-label": "Remove rule",
472
+ className: "shrink-0",
473
+ style: { padding: 6 }
474
+ })
475
+ ]
476
+ }),
477
+ a && /* @__PURE__ */ x("div", {
478
+ className: "grid grid-cols-2 gap-2",
479
+ children: [/* @__PURE__ */ b(d, {
480
+ label: "N",
481
+ children: /* @__PURE__ */ b(L, {
482
+ value: e.n,
483
+ onChange: (e) => i({ n: e }),
484
+ min: 1
485
+ })
486
+ }), /* @__PURE__ */ b(d, {
487
+ label: "Offset",
488
+ children: /* @__PURE__ */ b(L, {
489
+ value: e.offset,
490
+ onChange: (e) => i({ offset: e })
491
+ })
492
+ })]
493
+ }),
494
+ o && /* @__PURE__ */ x("div", {
495
+ className: "grid grid-cols-2 gap-2",
496
+ children: [/* @__PURE__ */ b(d, {
497
+ label: "Row N",
498
+ children: /* @__PURE__ */ b(L, {
499
+ value: e.n2,
500
+ onChange: (e) => i({ n2: e }),
501
+ min: 1
502
+ })
503
+ }), /* @__PURE__ */ b(d, {
504
+ label: "Row offset",
505
+ children: /* @__PURE__ */ b(L, {
506
+ value: e.offset2,
507
+ onChange: (e) => i({ offset2: e })
508
+ })
509
+ })]
510
+ }),
511
+ u && /* @__PURE__ */ x(d, {
512
+ label: "Expression",
513
+ hint: "matches when > 0",
514
+ children: [/* @__PURE__ */ b(l, {
515
+ variant: "filled",
516
+ size: "sm",
517
+ value: e.expression,
518
+ onChange: (e) => i({ expression: e.target.value }),
519
+ placeholder: "sin(col * 0.6) + cos(row * 0.6)"
520
+ }), /* @__PURE__ */ b("span", {
521
+ className: "kol-helper-10 text-subtle mt-1",
522
+ children: "vars: i, col, row, cols, rows · Math.* in scope"
523
+ })]
524
+ }),
525
+ /* @__PURE__ */ x("div", {
526
+ className: "grid grid-cols-2 gap-2",
527
+ children: [/* @__PURE__ */ b(d, {
528
+ label: "Group W",
529
+ children: /* @__PURE__ */ b(L, {
530
+ value: e.groupW,
531
+ onChange: (e) => i({ groupW: Math.max(1, e) }),
532
+ min: 1
533
+ })
534
+ }), /* @__PURE__ */ b(d, {
535
+ label: "Group H",
536
+ children: /* @__PURE__ */ b(L, {
537
+ value: e.groupH,
538
+ onChange: (e) => i({ groupH: Math.max(1, e) }),
539
+ min: 1
540
+ })
541
+ })]
542
+ }),
543
+ /* @__PURE__ */ x("div", {
544
+ className: "flex flex-wrap gap-1",
545
+ children: [
546
+ /* @__PURE__ */ b(c, {
547
+ variant: "subtle",
548
+ size: "sm",
549
+ options: k,
550
+ value: e.rotate,
551
+ onChange: (e) => i({ rotate: Number(e) })
552
+ }),
553
+ /* @__PURE__ */ b(R, {
554
+ active: e.flipH,
555
+ onClick: () => i({ flipH: !e.flipH }),
556
+ title: "Flip horizontal",
557
+ children: "⇋"
558
+ }),
559
+ /* @__PURE__ */ b(R, {
560
+ active: e.flipV,
561
+ onClick: () => i({ flipV: !e.flipV }),
562
+ title: "Flip vertical",
563
+ children: "⇵"
564
+ }),
565
+ /* @__PURE__ */ b(R, {
566
+ active: e.hide,
567
+ onClick: () => i({ hide: !e.hide }),
568
+ title: "Hide cell",
569
+ children: "hide"
570
+ })
571
+ ]
572
+ }),
573
+ /* @__PURE__ */ b(d, {
574
+ label: "Opacity",
575
+ hint: `${Math.round(e.opacity * 100)}%`,
576
+ children: /* @__PURE__ */ b(f, {
577
+ min: 0,
578
+ max: 100,
579
+ value: Math.round(e.opacity * 100),
580
+ onChange: (e) => i({ opacity: e / 100 })
581
+ })
582
+ })
583
+ ]
584
+ });
585
+ }
586
+ //#endregion
587
+ export { D as i, P as n, I as r, z as t };