@kolkrabbi/design-editor 0.47.0 → 0.48.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.
@@ -1,5 +1,5 @@
1
1
  import { _ as e, d as t, g as n, m as r, o as i, v as a } from "./__vite-browser-external-y2xWjzgx.js";
2
- import { D as o, Fr as s, J as c, L as l, _ as u, b as ee, f as d, g as te, h as f, m as p, p as m, v as h, x as g, xn as ne, y as re } from "./rolls-DugKaHUw.js";
2
+ import { D as o, J as s, L as c, Mr as l, _ as u, b as ee, f as d, g as te, h as f, m as p, p as m, v as h, x as g, xn as ne, y as re } from "./rolls-Cnu6g8th.js";
3
3
  import { Button as _, ButtonGroup as ie, CloseButton as v, ColorPickerPopover as ae, Dropdown as y, FullscreenOverlay as b, FunctionPlot as x, Input as S, LabeledControl as C, MenuDropdownItem as w, ModalShell as T, Section as E, Slider as D, Stepper as O, Tooltip as k } from "@kolkrabbi/kol-component";
4
4
  import { createContext as oe, useCallback as A, useContext as se, useEffect as j, useMemo as ce, useRef as le, useState as M, useSyncExternalStore as N } from "react";
5
5
  import { Fragment as ue, jsx as P, jsxs as F } from "react/jsx-runtime";
@@ -58,7 +58,7 @@ function pe({ expr: e }) {
58
58
  });
59
59
  }
60
60
  function R({ layer: r, param: i, setProp: s }) {
61
- let c = l(), u = r[i.key], [ee, d] = M(null), [te, f] = M(!1), [p, m] = M(!1);
61
+ let l = c(), u = r[i.key], [ee, d] = M(null), [te, f] = M(!1), [p, m] = M(!1);
62
62
  if (!o(u) || u.bind !== "mod") return null;
63
63
  let h = u.source, g = u.transform ?? {}, ne = h.startsWith("lfo-"), re = h === "midi", v = n(h), ae = h === "expr", y = g.expr ?? "wave(t)", b = (e) => s(i.key, {
64
64
  ...u,
@@ -97,7 +97,7 @@ function R({ layer: r, param: i, setProp: s }) {
97
97
  className: "flex-1 min-w-0",
98
98
  children: /* @__PURE__ */ P(S, {
99
99
  variant: "filled",
100
- size: c,
100
+ size: l,
101
101
  type: "number",
102
102
  width: "100%",
103
103
  value: O[0],
@@ -112,7 +112,7 @@ function R({ layer: r, param: i, setProp: s }) {
112
112
  className: "flex-1 min-w-0",
113
113
  children: /* @__PURE__ */ P(S, {
114
114
  variant: "filled",
115
- size: c,
115
+ size: l,
116
116
  type: "number",
117
117
  width: "100%",
118
118
  value: O[1],
@@ -128,7 +128,7 @@ function R({ layer: r, param: i, setProp: s }) {
128
128
  label: "Invert",
129
129
  children: /* @__PURE__ */ P(ie, {
130
130
  layout: "joined",
131
- size: c,
131
+ size: l,
132
132
  className: "w-full",
133
133
  options: [{
134
134
  value: "off",
@@ -188,7 +188,7 @@ function R({ layer: r, param: i, setProp: s }) {
188
188
  label: "Expression",
189
189
  children: /* @__PURE__ */ P(S, {
190
190
  variant: "ghost",
191
- size: c,
191
+ size: l,
192
192
  value: ee ?? y,
193
193
  onChange: (e) => d(e.target.value),
194
194
  onBlur: (e) => x(e.target.value),
@@ -215,7 +215,7 @@ function R({ layer: r, param: i, setProp: s }) {
215
215
  label: g?.cc == null ? "MIDI · no CC yet" : `MIDI · CC ${g.cc}`,
216
216
  children: /* @__PURE__ */ P(_, {
217
217
  tone: "outline",
218
- size: c,
218
+ size: l,
219
219
  onClick: T,
220
220
  children: te ? "Move a knob…" : "Learn"
221
221
  })
@@ -224,7 +224,7 @@ function R({ layer: r, param: i, setProp: s }) {
224
224
  label: t(h)?.label ?? "Gamepad",
225
225
  children: /* @__PURE__ */ P(_, {
226
226
  tone: "outline",
227
- size: c,
227
+ size: l,
228
228
  onClick: E,
229
229
  children: p ? "Move a control…" : "Learn"
230
230
  })
@@ -1177,7 +1177,7 @@ function ht() {
1177
1177
  savePreset: () => null
1178
1178
  };
1179
1179
  }
1180
- var gt = Y, _t = (e) => s("generators")?.loopById(e) ?? null, vt = {
1180
+ var gt = Y, _t = (e) => l("generators")?.loopById(e) ?? null, vt = {
1181
1181
  bg: "Background",
1182
1182
  fg: "Ink",
1183
1183
  accent: "Accent",
@@ -1191,14 +1191,14 @@ var gt = Y, _t = (e) => s("generators")?.loopById(e) ?? null, vt = {
1191
1191
  5: "bg"
1192
1192
  }, bt = (e) => e.slice(0, 7).toLowerCase();
1193
1193
  function xt() {
1194
- let e = l(), { layers: t, selectedId: n, updateLayer: r, setColorAt: i } = c(), { library: a, addItem: o } = ht(), [s, ie] = M("analogous"), [v, b] = M(m), [x, S] = M(() => ee(.62, .14, Math.random() * 360)), [C, w] = M(() => re(d(v), {
1194
+ let e = c(), { layers: t, selectedId: n, updateLayer: r, setColorAt: i } = s(), { library: a, addItem: o } = ht(), [l, ie] = M("analogous"), [v, b] = M(m), [x, S] = M(() => ee(.62, .14, Math.random() * 360)), [C, w] = M(() => re(d(v), {
1195
1195
  base: x,
1196
- relation: s,
1196
+ relation: l,
1197
1197
  count: 5
1198
1198
  }).map((e) => ({
1199
1199
  hex: e,
1200
1200
  locked: !1
1201
- }))), [T, E] = M(null), D = ce(() => te(a), [a]), k = ({ b: e = x, rel: t = s, n = C.length, s: r = v } = {}) => {
1201
+ }))), [T, E] = M(null), D = ce(() => te(a), [a]), k = ({ b: e = x, rel: t = l, n = C.length, s: r = v } = {}) => {
1202
1202
  let i = re(d(r), {
1203
1203
  base: e,
1204
1204
  relation: t,
@@ -1240,9 +1240,9 @@ function xt() {
1240
1240
  name: t.name,
1241
1241
  roles: t.colors.length <= 8 ? t.roles : null
1242
1242
  });
1243
- }, I = C.map((e) => e.hex), L = T?.roles ?? u(I), pe = p.find((e) => e.id === s)?.label ?? "Palette", R = {
1243
+ }, I = C.map((e) => e.hex), L = T?.roles ?? u(I), pe = p.find((e) => e.id === l)?.label ?? "Palette", R = {
1244
1244
  name: T?.name ?? pe,
1245
- relation: s,
1245
+ relation: l,
1246
1246
  colors: I,
1247
1247
  roles: L
1248
1248
  }, me = (e) => f.filter((t) => L[t]?.toLowerCase() === e).map((e) => vt[e]).join(", "), z = n && n !== "canvas" ? ne(t, n) : null, B = z?.type === "loop" ? _t(z.loopId)?.params : null, he = () => {
@@ -1295,7 +1295,7 @@ function xt() {
1295
1295
  value: e.id,
1296
1296
  label: e.label
1297
1297
  })),
1298
- value: s,
1298
+ value: l,
1299
1299
  onChange: se
1300
1300
  }), /* @__PURE__ */ P(_, {
1301
1301
  tone: "grey",
@@ -1,19 +1,19 @@
1
1
  import { c as e, m as t } from "./__vite-browser-external-y2xWjzgx.js";
2
- import { $n as n, $t as r, D as i, F as a, I as o, J as s, Jn as c, Kn as l, L as u, Qn as d, Qt as f, T as p, Wn as m, Xn as h, Yn as g, Zn as _, Zt as v, en as y, er as b, ir as x, j as S, qn as C, tr as w } from "./rolls-DugKaHUw.js";
3
- import { useCallback as T, useEffect as E, useMemo as D, useRef as O, useState as k } from "react";
4
- import { Fragment as A, jsx as j, jsxs as M } from "react/jsx-runtime";
2
+ import { $n as n, $t as r, D as i, F as a, I as o, J as s, Jn as c, Kn as l, L as u, Qn as d, Qt as f, T as p, Wn as m, Xn as h, Yn as g, Zn as _, Zt as v, en as y, er as b, j as x, qn as S, tr as C } from "./rolls-Cnu6g8th.js";
3
+ import { useCallback as w, useEffect as T, useMemo as E, useRef as D, useState as O } from "react";
4
+ import { Fragment as k, jsx as A, jsxs as j } from "react/jsx-runtime";
5
5
  //#region src/editor/lib/viewport.js
6
- var N = Math.PI * 2, P = {
6
+ var M = Math.PI * 2, N = {
7
7
  vpZoom: 1,
8
8
  vpSpin: 0,
9
9
  vpPulse: 0,
10
10
  vpWobble: 0,
11
11
  vpRate: 1
12
- }, F = {
12
+ }, P = {
13
13
  vpTime: "linear",
14
14
  vpSpeed: 1,
15
15
  vpPhase: 0
16
- }, I = [
16
+ }, F = [
17
17
  {
18
18
  key: "vpTime",
19
19
  label: "Time",
@@ -72,12 +72,12 @@ var N = Math.PI * 2, P = {
72
72
  tab: "anim",
73
73
  section: "Form"
74
74
  }
75
- ], L = (e) => e - Math.floor(e);
76
- function R(e, t) {
75
+ ], I = (e) => e - Math.floor(e);
76
+ function L(e, t) {
77
77
  if (!t) return e;
78
78
  let n = t.vpTime || "linear", r = Math.max(1, Math.round(t.vpSpeed || 1)), i = t.vpPhase || 0;
79
79
  if (n === "linear" && r === 1 && !i) return e;
80
- let a = L(e * r);
80
+ let a = I(e * r);
81
81
  switch (n) {
82
82
  case "ease":
83
83
  a = .5 - .5 * Math.cos(a * Math.PI);
@@ -90,17 +90,17 @@ function R(e, t) {
90
90
  break;
91
91
  case "bounce": {
92
92
  let e = Math.abs(Math.sin(a * Math.PI * 2));
93
- a = a < .5 ? e : 1 - e * .5, a = L(a);
93
+ a = a < .5 ? e : 1 - e * .5, a = I(a);
94
94
  break;
95
95
  }
96
96
  case "drift":
97
- a = L(a + .08 * Math.sin(a * N) + .04 * Math.sin(a * N * 3));
97
+ a = I(a + .08 * Math.sin(a * M) + .04 * Math.sin(a * M * 3));
98
98
  break;
99
99
  default: break;
100
100
  }
101
- return L(a + i);
101
+ return I(a + i);
102
102
  }
103
- var z = [
103
+ var R = [
104
104
  {
105
105
  key: "vpSpin",
106
106
  label: "Spin",
@@ -161,30 +161,30 @@ var z = [
161
161
  section: "Form"
162
162
  }
163
163
  ];
164
- function B(e, t, n, r, i) {
164
+ function z(e, t, n, r, i) {
165
165
  let a = Math.round(i.vpSpin || 0), o = i.vpZoom ?? 1, s = i.vpPulse || 0, c = i.vpWobble || 0;
166
166
  if (!a && s === 0 && c === 0 && o === 1) return !1;
167
- let l = t * N * Math.round(i.vpRate || 1), u = t * N * a + c * Math.PI / 180 * Math.sin(l), d = a ? Math.PI / 4 : Math.abs(c * Math.PI / 180), f = Math.cos(d) + Math.sin(d), p = Math.max(o * (1 + s * .5 * Math.sin(l)), f * 1.02);
167
+ let l = t * M * Math.round(i.vpRate || 1), u = t * M * a + c * Math.PI / 180 * Math.sin(l), d = a ? Math.PI / 4 : Math.abs(c * Math.PI / 180), f = Math.cos(d) + Math.sin(d), p = Math.max(o * (1 + s * .5 * Math.sin(l)), f * 1.02);
168
168
  return e.translate(n / 2, r / 2), e.rotate(u), e.scale(p, p), e.translate(-n / 2, -r / 2), !0;
169
169
  }
170
- function V(e, t, n, r, i, a) {
170
+ function B(e, t, n, r, i, a) {
171
171
  if (!t) return;
172
- let o = R(n, a);
173
- e.save(), B(e, o, r, i, a), t.draw(e, o, r, i, a), e.restore();
172
+ let o = L(n, a);
173
+ e.save(), z(e, o, r, i, a), t.draw(e, o, r, i, a), e.restore();
174
174
  }
175
175
  //#endregion
176
176
  //#region src/editor/components/Hint.jsx
177
- function H({ children: e, className: t = "kol-mono-12 text-meta", always: n = !1 }) {
178
- return /* @__PURE__ */ j("p", {
177
+ function V({ children: e, className: t = "kol-mono-12 text-meta", always: n = !1 }) {
178
+ return /* @__PURE__ */ A("p", {
179
179
  className: `${n ? "" : "kol-placeholder "}${t}`,
180
180
  children: e
181
181
  });
182
182
  }
183
183
  //#endregion
184
184
  //#region src/editor/params/AutoControls.jsx
185
- function U({ schema: e, layer: t, setProp: n, palette: a, renderAnimate: o, tab: s, emptyHint: c, inline: l = !0 }) {
185
+ function H({ schema: e, layer: t, setProp: n, palette: a, renderAnimate: o, tab: s, emptyHint: c, inline: l = !0 }) {
186
186
  let u = y(e, t);
187
- if (s && (u = u.filter((e) => r(e) === s)), u.length === 0) return c ? /* @__PURE__ */ j(H, { children: c }) : null;
187
+ if (s && (u = u.filter((e) => r(e) === s)), u.length === 0) return c ? /* @__PURE__ */ A(V, { children: c }) : null;
188
188
  let d = [];
189
189
  for (let e of u) {
190
190
  let t = f(e), n = d[d.length - 1];
@@ -206,13 +206,13 @@ function U({ schema: e, layer: t, setProp: n, palette: a, renderAnimate: o, tab:
206
206
  params: t.params.slice(n)
207
207
  }), e++);
208
208
  }
209
- return /* @__PURE__ */ j(A, { children: d.map((e) => {
210
- let r = Math.max(0, ...e.params.filter((e) => e.type === "range").map(W)), s = e.section && e.params.some((e) => e.collapsed), c = /* @__PURE__ */ j(h, {
209
+ return /* @__PURE__ */ A(k, { children: d.map((e) => {
210
+ let r = Math.max(0, ...e.params.filter((e) => e.type === "range").map(U)), s = e.section && e.params.some((e) => e.collapsed), c = /* @__PURE__ */ A(h, {
211
211
  label: !s && e.section && e.section !== e.params[0].label ? e.section : void 0,
212
212
  divided: !s,
213
213
  children: e.params.map((e) => {
214
214
  let s = i(t[e.key]);
215
- return /* @__PURE__ */ j(J, {
215
+ return /* @__PURE__ */ A(q, {
216
216
  param: e,
217
217
  layer: t,
218
218
  setProp: n,
@@ -224,23 +224,23 @@ function U({ schema: e, layer: t, setProp: n, palette: a, renderAnimate: o, tab:
224
224
  }, e.key);
225
225
  })
226
226
  }, e.params[0].key);
227
- return s ? /* @__PURE__ */ j(m, {
227
+ return s ? /* @__PURE__ */ A(m, {
228
228
  title: e.section,
229
229
  children: c
230
230
  }, e.params[0].key) : c;
231
231
  }) });
232
232
  }
233
- function W(e) {
233
+ function U(e) {
234
234
  let t = e.step && e.step < 1 ? String(e.step).split(".")[1]?.length ?? 2 : 0;
235
235
  return Math.max(2, String(Math.round(e.max ?? 0)).length, String(Math.round(e.min ?? 0)).length) + (t ? t + 1 : 0);
236
236
  }
237
- function G({ param: n, layer: r, setProp: a, chars: o }) {
238
- let s = u(), l = r[n.key], f = i(l), p = f && l.bind === "mod" && l.source === "expr", m = e(f), h = f ? S(l, m, r) : l, g = typeof h == "number" ? h : n.default ?? 0, _ = n.step && n.step < 1 ? String(n.step).split(".")[1]?.length ?? 2 : 0, v = p ? l.transform?.expr ?? "wave(t)" : n.format ? String(n.format(g)) : _ ? g.toFixed(_) : String(Math.round(g)), y = o ?? W(n), [b, C] = k(v), [w, T] = k(!1);
239
- return E(() => {
240
- w || C(v);
241
- }, [v, w]), /* @__PURE__ */ M("div", {
242
- className: `flex items-center gap-3${x() === "float" ? " w-full" : ""}`,
243
- children: [!f && /* @__PURE__ */ j(d, {
237
+ function W({ param: n, layer: r, setProp: a, chars: o }) {
238
+ let s = u(), l = r[n.key], f = i(l), p = f && l.bind === "mod" && l.source === "expr", m = e(f), h = f ? x(l, m, r) : l, g = typeof h == "number" ? h : n.default ?? 0, _ = n.step && n.step < 1 ? String(n.step).split(".")[1]?.length ?? 2 : 0, v = p ? l.transform?.expr ?? "wave(t)" : n.format ? String(n.format(g)) : _ ? g.toFixed(_) : String(Math.round(g)), y = o ?? U(n), [b, S] = O(v), [C, w] = O(!1);
239
+ return T(() => {
240
+ C || S(v);
241
+ }, [v, C]), /* @__PURE__ */ j("div", {
242
+ className: "flex items-center gap-3",
243
+ children: [!f && /* @__PURE__ */ A(d, {
244
244
  min: n.min,
245
245
  max: n.max,
246
246
  step: n.step ?? 1,
@@ -248,7 +248,7 @@ function G({ param: n, layer: r, setProp: a, chars: o }) {
248
248
  onChange: (e) => a(n.key, Number(e)),
249
249
  readout: "none",
250
250
  className: "flex-1"
251
- }), /* @__PURE__ */ j(c, {
251
+ }), /* @__PURE__ */ A(c, {
252
252
  type: "text",
253
253
  variant: "filled",
254
254
  size: s,
@@ -256,14 +256,14 @@ function G({ param: n, layer: r, setProp: a, chars: o }) {
256
256
  value: b,
257
257
  title: "Number sets a constant · an expression like sin(t) binds it",
258
258
  onFocus: (e) => {
259
- T(!0), e.target.select();
259
+ w(!0), e.target.select();
260
260
  },
261
- onChange: (e) => C(e.target.value),
261
+ onChange: (e) => S(e.target.value),
262
262
  onBlur: () => {
263
- T(!1);
263
+ w(!1);
264
264
  let e = b.trim();
265
265
  if (e === "") {
266
- C(v);
266
+ S(v);
267
267
  return;
268
268
  }
269
269
  let r = Number(e);
@@ -272,7 +272,7 @@ function G({ param: n, layer: r, setProp: a, chars: o }) {
272
272
  return;
273
273
  }
274
274
  if (!t(e).ok) {
275
- C(v);
275
+ S(v);
276
276
  return;
277
277
  }
278
278
  let i = f && l.transform?.range || (n.min != null && n.max != null ? [n.min, n.max] : [0, 1]);
@@ -287,65 +287,65 @@ function G({ param: n, layer: r, setProp: a, chars: o }) {
287
287
  });
288
288
  },
289
289
  onKeyDown: (e) => {
290
- e.key === "Enter" && e.currentTarget.blur(), e.key === "Escape" && (C(v), T(!1), e.currentTarget.blur());
290
+ e.key === "Enter" && e.currentTarget.blur(), e.key === "Escape" && (S(v), w(!1), e.currentTarget.blur());
291
291
  },
292
292
  inputClassName: "text-center"
293
293
  })]
294
294
  });
295
295
  }
296
- var K = a, q = {
296
+ var G = a, K = {
297
297
  xs: "h-[var(--kol-ctl-xs)]",
298
298
  sm: "h-[var(--kol-ctl-sm)]",
299
299
  md: "h-[var(--kol-ctl-md)]",
300
300
  lg: "h-[var(--kol-ctl-lg)]"
301
301
  };
302
- function J({ param: e, layer: t, setProp: r, palette: i, bound: a, animate: s, inline: c, chars: d }) {
303
- let f = u(), m = x() === "float", h = t[e.key], v = h === void 0 ? e.default : h;
304
- if (e.type === "color") return /* @__PURE__ */ M("div", {
302
+ function q({ param: e, layer: t, setProp: r, palette: i, bound: a, animate: s, inline: c, chars: d }) {
303
+ let f = u(), m = t[e.key], h = m === void 0 ? e.default : m;
304
+ if (e.type === "color") return /* @__PURE__ */ j("div", {
305
305
  className: "flex items-end gap-2",
306
- children: [/* @__PURE__ */ j("div", {
306
+ children: [/* @__PURE__ */ A("div", {
307
307
  className: "flex-1 min-w-0",
308
- children: /* @__PURE__ */ j(p, {
308
+ children: /* @__PURE__ */ A(p, {
309
309
  label: e.label,
310
- value: v,
310
+ value: h,
311
311
  onChange: (t) => r(e.key, t),
312
312
  palette: i,
313
313
  inline: c
314
314
  })
315
315
  }), s]
316
316
  });
317
- let y = c, S = null;
318
- if (e.type === "range") f !== "sm" && (y = !1), S = /* @__PURE__ */ j(G, {
317
+ let v = c, y = null;
318
+ if (e.type === "range") f !== "sm" && (v = !1), y = /* @__PURE__ */ A(W, {
319
319
  param: e,
320
320
  layer: t,
321
321
  setProp: r,
322
322
  chars: d
323
323
  });
324
- else if (e.type === "select") S = /* @__PURE__ */ j(C, {
324
+ else if (e.type === "select") y = /* @__PURE__ */ A(S, {
325
325
  variant: "subtle",
326
326
  size: f,
327
327
  className: "w-full",
328
328
  options: e.options ?? [],
329
- value: v,
329
+ value: h,
330
330
  onChange: (t) => r(e.key, e.numeric ? Number(t) : t)
331
331
  });
332
- else if (e.type === "segmented") S = c ? /* @__PURE__ */ j(l, {
332
+ else if (e.type === "segmented") y = c ? /* @__PURE__ */ A(l, {
333
333
  layout: "joined",
334
334
  tone: "sunken",
335
335
  size: f,
336
336
  className: `w-full ${o(f) ?? ""}`,
337
337
  options: e.options ?? [],
338
- value: v,
338
+ value: h,
339
339
  onChange: (t) => r(e.key, t)
340
- }) : /* @__PURE__ */ j(w, {
340
+ }) : /* @__PURE__ */ A(C, {
341
341
  size: f,
342
342
  options: e.options ?? [],
343
- viewMode: v,
343
+ viewMode: h,
344
344
  onViewChange: (t) => r(e.key, t)
345
345
  });
346
346
  else if (e.type === "toggle") {
347
347
  let [t, n] = e.labels ?? ["Off", "On"];
348
- e.labels ? c ? S = /* @__PURE__ */ j(l, {
348
+ e.labels ? c ? y = /* @__PURE__ */ A(l, {
349
349
  layout: "joined",
350
350
  tone: "sunken",
351
351
  size: f,
@@ -357,9 +357,9 @@ function J({ param: e, layer: t, setProp: r, palette: i, bound: a, animate: s, i
357
357
  value: "on",
358
358
  label: n
359
359
  }],
360
- value: v ? "on" : "off",
360
+ value: h ? "on" : "off",
361
361
  onChange: (t) => r(e.key, t === "on")
362
- }) : (y = !1, S = /* @__PURE__ */ j(w, {
362
+ }) : (v = !1, y = /* @__PURE__ */ A(C, {
363
363
  size: f,
364
364
  options: [{
365
365
  value: "off",
@@ -368,58 +368,58 @@ function J({ param: e, layer: t, setProp: r, palette: i, bound: a, animate: s, i
368
368
  value: "on",
369
369
  label: n
370
370
  }],
371
- viewMode: v ? "on" : "off",
371
+ viewMode: h ? "on" : "off",
372
372
  onViewChange: (t) => r(e.key, t === "on")
373
- })) : (c || (y = !1), S = /* @__PURE__ */ j(b, {
373
+ })) : (c || (v = !1), y = /* @__PURE__ */ A(b, {
374
374
  size: f,
375
- checked: !!v,
375
+ checked: !!h,
376
376
  onChange: (t) => r(e.key, t)
377
377
  }));
378
- } else if (e.type === "text") y = !1, S = /* @__PURE__ */ j(n, {
378
+ } else if (e.type === "text") v = !1, y = /* @__PURE__ */ A(n, {
379
379
  variant: "filled",
380
380
  size: f,
381
381
  rows: e.rows ?? 2,
382
382
  axis: "y",
383
- value: v ?? "",
383
+ value: h ?? "",
384
384
  onChange: (t) => r(e.key, t.target.value),
385
385
  placeholder: e.placeholder
386
386
  });
387
387
  else return null;
388
- let T = e.type === "range" && e.format && typeof v == "number" && !a ? e.format(v) : void 0, E = s ? /* @__PURE__ */ M("div", {
388
+ let x = e.type === "range" && e.format && typeof h == "number" && !a ? e.format(h) : void 0, w = s ? /* @__PURE__ */ j("div", {
389
389
  className: "flex items-center gap-2",
390
- children: [/* @__PURE__ */ j("div", {
390
+ children: [/* @__PURE__ */ A("div", {
391
391
  className: "flex-1 min-w-0",
392
- children: S
392
+ children: y
393
393
  }), s]
394
- }) : S, D = e.type === "toggle" && !e.labels ? "end" : "fill", O = e.type === "toggle" && !e.labels && !c, k = (e) => m ? e : String(e).toUpperCase();
395
- return y && D === "end" && !T ? /* @__PURE__ */ j(g, {
394
+ }) : y, T = e.type === "toggle" && !e.labels ? "end" : "fill", E = e.type === "toggle" && !e.labels && !c, D = (e) => String(e).toUpperCase();
395
+ return v && T === "end" && !x ? /* @__PURE__ */ A(g, {
396
396
  horizontal: !0,
397
- label: k(e.label),
398
- labelWidth: K,
399
- children: /* @__PURE__ */ j("div", {
400
- className: `flex w-full items-center justify-end ${q[f] ?? ""}`,
401
- children: E
397
+ label: D(e.label),
398
+ labelWidth: G,
399
+ children: /* @__PURE__ */ A("div", {
400
+ className: `flex w-full items-center justify-end ${K[f] ?? ""}`,
401
+ children: w
402
402
  })
403
- }) : y ? /* @__PURE__ */ j(_, {
403
+ }) : v ? /* @__PURE__ */ A(_, {
404
404
  label: e.label,
405
- hint: T,
406
- align: D,
407
- labelWidth: K,
408
- children: E
409
- }) : /* @__PURE__ */ j(g, {
410
- horizontal: O,
411
- label: c ? k(e.label) : e.label,
412
- hint: T,
413
- labelWidth: O ? "auto" : K,
414
- children: E
405
+ hint: x,
406
+ align: T,
407
+ labelWidth: G,
408
+ children: w
409
+ }) : /* @__PURE__ */ A(g, {
410
+ horizontal: E,
411
+ label: c ? D(e.label) : e.label,
412
+ hint: x,
413
+ labelWidth: E ? "auto" : G,
414
+ children: w
415
415
  });
416
416
  }
417
417
  //#endregion
418
418
  //#region src/editor/compose/useLayerEdit.js
419
- function Y(e, { history: t = "discrete", coalesceMs: n = 250 } = {}) {
420
- let { updateLayer: r, beginTransaction: i, commitTransaction: a } = s(), o = O(null), c = T(() => {
419
+ function J(e, { history: t = "discrete", coalesceMs: n = 250 } = {}) {
420
+ let { updateLayer: r, beginTransaction: i, commitTransaction: a } = s(), o = D(null), c = w(() => {
421
421
  o.current !== null && (clearTimeout(o.current), o.current = null, a());
422
- }, [a]), l = T((s) => {
422
+ }, [a]), l = w((s) => {
423
423
  if (e) {
424
424
  if (t === "discrete") {
425
425
  r(e, s);
@@ -440,8 +440,8 @@ function Y(e, { history: t = "discrete", coalesceMs: n = 250 } = {}) {
440
440
  r,
441
441
  i,
442
442
  a
443
- ]), u = T((e, t) => l({ [e]: t }), [l]);
444
- return E(() => () => c(), [c, e]), D(() => ({
443
+ ]), u = w((e, t) => l({ [e]: t }), [l]);
444
+ return T(() => () => c(), [c, e]), E(() => ({
445
445
  patch: l,
446
446
  setProp: u,
447
447
  flush: c
@@ -452,4 +452,4 @@ function Y(e, { history: t = "discrete", coalesceMs: n = 250 } = {}) {
452
452
  ]);
453
453
  }
454
454
  //#endregion
455
- export { I as a, V as c, F as i, R as l, U as n, P as o, H as r, z as s, Y as t };
455
+ export { F as a, B as c, P as i, L as l, H as n, N as o, V as r, R as s, J as t };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kolkrabbi/design-editor",
3
- "version": "0.47.0",
3
+ "version": "0.48.0",
4
4
  "private": false,
5
5
  "description": "The design editor as one component",
6
6
  "license": "MIT",
@@ -23,23 +23,24 @@
23
23
  "./motion": {
24
24
  "import": "./dist/motion.js"
25
25
  },
26
- "./style.css": "./dist/design-editor.css"
26
+ "./style.css": "./dist/design-editor.css",
27
+ "./kolbox.css": "./dist/kolbox.css"
27
28
  },
28
29
  "files": [
29
30
  "dist",
30
31
  "README.md"
31
32
  ],
32
33
  "peerDependencies": {
33
- "@kolkrabbi/kol-component": ">=0.378.0 <1",
34
+ "@kolkrabbi/kol-component": ">=0.380.0 <1",
34
35
  "@kolkrabbi/kol-framework": ">=0.44.0 <1",
35
36
  "@kolkrabbi/kol-hardware": ">=0.10.0 <1",
36
37
  "@kolkrabbi/kol-icons": ">=0.69.0 <1",
37
38
  "@kolkrabbi/kol-media-client": ">=0.4.0 <1",
38
- "@kolkrabbi/kol-shell": ">=0.131.0 <1",
39
+ "@kolkrabbi/kol-shell": ">=0.132.0 <1",
39
40
  "react": "^19.0.0",
40
41
  "react-dom": "^19.0.0",
41
- "@kolkrabbi/kol-theme": ">=0.225.0 <1",
42
- "@kolkrabbi/kol-dashboards": ">=0.13.0 <1",
42
+ "@kolkrabbi/kol-theme": ">=0.227.0 <1",
43
+ "@kolkrabbi/kol-dashboards": ">=0.18.0 <1",
43
44
  "@kolkrabbi/kol-tuner": ">=0.1.0 <1"
44
45
  },
45
46
  "dependencies": {
@@ -62,15 +63,15 @@
62
63
  "tailwindcss": "^4.2.4",
63
64
  "vite": "^8.0.10",
64
65
  "vite-plugin-svgr": "^5.2.0",
66
+ "@kolkrabbi/kol-component": "0.380.0",
65
67
  "@kolkrabbi/kol-framework": "0.74.1",
66
68
  "@kolkrabbi/kol-icons": "0.72.0",
67
- "@kolkrabbi/kol-theme": "0.226.0",
68
- "@kolkrabbi/kol-shell": "0.131.0",
69
+ "@kolkrabbi/kol-theme": "0.227.0",
70
+ "@kolkrabbi/kol-shell": "0.132.0",
71
+ "@kolkrabbi/kol-dashboards": "0.18.0",
72
+ "@kolkrabbi/kol-tuner": "0.1.0",
69
73
  "@kolkrabbi/kol-hardware": "0.11.1",
70
- "@kolkrabbi/kol-media-client": "0.7.0",
71
- "@kolkrabbi/kol-dashboards": "0.17.0",
72
- "@kolkrabbi/kol-component": "0.379.0",
73
- "@kolkrabbi/kol-tuner": "0.1.0"
74
+ "@kolkrabbi/kol-media-client": "0.7.0"
74
75
  },
75
76
  "keywords": [
76
77
  "kol",
@@ -88,9 +89,8 @@
88
89
  "access": "public"
89
90
  },
90
91
  "scripts": {
91
- "build": "vite build --config vite.lib.config.js",
92
+ "build": "vite build --config vite.lib.config.js && vite build --config vite.kolbox.config.js",
92
93
  "check:core": "node scripts/check-core.mjs",
93
- "check:float": "node scripts/check-float-commands.mjs",
94
94
  "check:frames": "node scripts/check-frames.mjs"
95
95
  }
96
96
  }