@kolkrabbi/design-editor 0.32.0 → 0.33.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 { D as e, F as t, I as n, J as r, L as i, T as a, bn as o, gt as s, hn as c, ht as l, j as u, mt as d, pt as f } from "./rolls-CEQmdcp3.js";
2
- import { AccordionPanel as p, Dropdown as m, Input as h, LabeledControl as g, LabeledControlSection as _, SegmentedToggle as v, SettingsRow as y, Slider as b, Textarea as x, ToggleSwitch as S, ViewToggle as C } from "@kolkrabbi/kol-component";
2
+ import { AccordionPanel as p, ButtonGroup as m, Dropdown as h, Input as g, LabeledControl as _, LabeledControlSection as v, SettingsRow as y, Slider as b, Textarea as x, ToggleSwitch as S, ViewToggle as C } from "@kolkrabbi/kol-component";
3
3
  import { useCallback as w, useEffect as T, useMemo as E, useRef as D, useState as O } from "react";
4
4
  import { Fragment as k, jsx as A, jsxs as j } from "react/jsx-runtime";
5
5
  //#region src/editor/lib/viewport.js
@@ -207,7 +207,7 @@ function H({ schema: t, layer: n, setProp: r, palette: i, renderAnimate: a, tab:
207
207
  }), e++);
208
208
  }
209
209
  return /* @__PURE__ */ A(k, { children: h.map((t) => {
210
- let o = Math.max(0, ...t.params.filter((e) => e.type === "range").map(U)), s = t.section && t.params.some((e) => e.collapsed), c = /* @__PURE__ */ A(_, {
210
+ let o = Math.max(0, ...t.params.filter((e) => e.type === "range").map(U)), s = t.section && t.params.some((e) => e.collapsed), c = /* @__PURE__ */ A(v, {
211
211
  label: !s && t.section && t.section !== t.params[0].label ? t.section : void 0,
212
212
  divided: !s,
213
213
  children: t.params.map((t) => {
@@ -235,7 +235,7 @@ function U(e) {
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
237
  function W({ param: t, layer: n, setProp: r, chars: a }) {
238
- let s = i(), l = n[t.key], d = e(l), f = d && l.bind === "mod" && l.source === "expr", p = c(d), m = d ? u(l, p, n) : l, g = typeof m == "number" ? m : t.default ?? 0, _ = t.step && t.step < 1 ? String(t.step).split(".")[1]?.length ?? 2 : 0, v = f ? l.transform?.expr ?? "wave(t)" : t.format ? String(t.format(g)) : _ ? g.toFixed(_) : String(Math.round(g)), y = a ?? U(t), [x, S] = O(v), [C, w] = O(!1);
238
+ let s = i(), l = n[t.key], d = e(l), f = d && l.bind === "mod" && l.source === "expr", p = c(d), m = d ? u(l, p, n) : l, h = typeof m == "number" ? m : t.default ?? 0, _ = t.step && t.step < 1 ? String(t.step).split(".")[1]?.length ?? 2 : 0, v = f ? l.transform?.expr ?? "wave(t)" : t.format ? String(t.format(h)) : _ ? h.toFixed(_) : String(Math.round(h)), y = a ?? U(t), [x, S] = O(v), [C, w] = O(!1);
239
239
  return T(() => {
240
240
  C || S(v);
241
241
  }, [v, C]), /* @__PURE__ */ j("div", {
@@ -244,11 +244,11 @@ function W({ param: t, layer: n, setProp: r, chars: a }) {
244
244
  min: t.min,
245
245
  max: t.max,
246
246
  step: t.step ?? 1,
247
- value: g,
247
+ value: h,
248
248
  onChange: (e) => r(t.key, Number(e)),
249
249
  readout: "none",
250
250
  className: "flex-1"
251
- }), /* @__PURE__ */ A(h, {
251
+ }), /* @__PURE__ */ A(g, {
252
252
  type: "text",
253
253
  variant: "filled",
254
254
  size: s,
@@ -314,14 +314,14 @@ function q({ param: e, layer: t, setProp: r, palette: o, bound: s, animate: c, i
314
314
  })
315
315
  }), c]
316
316
  });
317
- let h = l, _ = null;
318
- if (e.type === "range") d !== "sm" && (h = !1), _ = /* @__PURE__ */ A(W, {
317
+ let g = l, v = null;
318
+ if (e.type === "range") d !== "sm" && (g = !1), v = /* @__PURE__ */ A(W, {
319
319
  param: e,
320
320
  layer: t,
321
321
  setProp: r,
322
322
  chars: u
323
323
  });
324
- else if (e.type === "select") _ = /* @__PURE__ */ A(m, {
324
+ else if (e.type === "select") v = /* @__PURE__ */ A(h, {
325
325
  variant: "subtle",
326
326
  size: d,
327
327
  className: "w-full",
@@ -329,7 +329,8 @@ function q({ param: e, layer: t, setProp: r, palette: o, bound: s, animate: c, i
329
329
  value: p,
330
330
  onChange: (t) => r(e.key, e.numeric ? Number(t) : t)
331
331
  });
332
- else if (e.type === "segmented") _ = l ? /* @__PURE__ */ A(v, {
332
+ else if (e.type === "segmented") v = l ? /* @__PURE__ */ A(m, {
333
+ layout: "joined",
333
334
  tone: "sunken",
334
335
  size: d,
335
336
  className: `w-full ${n(d) ?? ""}`,
@@ -344,7 +345,8 @@ function q({ param: e, layer: t, setProp: r, palette: o, bound: s, animate: c, i
344
345
  });
345
346
  else if (e.type === "toggle") {
346
347
  let [t, i] = e.labels ?? ["Off", "On"];
347
- e.labels ? l ? _ = /* @__PURE__ */ A(v, {
348
+ e.labels ? l ? v = /* @__PURE__ */ A(m, {
349
+ layout: "joined",
348
350
  tone: "sunken",
349
351
  size: d,
350
352
  className: `w-full ${n(d) ?? ""}`,
@@ -357,7 +359,7 @@ function q({ param: e, layer: t, setProp: r, palette: o, bound: s, animate: c, i
357
359
  }],
358
360
  value: p ? "on" : "off",
359
361
  onChange: (t) => r(e.key, t === "on")
360
- }) : (h = !1, _ = /* @__PURE__ */ A(C, {
362
+ }) : (g = !1, v = /* @__PURE__ */ A(C, {
361
363
  size: d,
362
364
  options: [{
363
365
  value: "off",
@@ -368,12 +370,12 @@ function q({ param: e, layer: t, setProp: r, palette: o, bound: s, animate: c, i
368
370
  }],
369
371
  viewMode: p ? "on" : "off",
370
372
  onViewChange: (t) => r(e.key, t === "on")
371
- })) : (l || (h = !1), _ = /* @__PURE__ */ A(S, {
373
+ })) : (l || (g = !1), v = /* @__PURE__ */ A(S, {
372
374
  size: d,
373
375
  checked: !!p,
374
376
  onChange: (t) => r(e.key, t)
375
377
  }));
376
- } else if (e.type === "text") h = !1, _ = /* @__PURE__ */ A(x, {
378
+ } else if (e.type === "text") g = !1, v = /* @__PURE__ */ A(x, {
377
379
  variant: "filled",
378
380
  size: d,
379
381
  rows: e.rows ?? 2,
@@ -387,10 +389,10 @@ function q({ param: e, layer: t, setProp: r, palette: o, bound: s, animate: c, i
387
389
  className: "flex items-center gap-2",
388
390
  children: [/* @__PURE__ */ A("div", {
389
391
  className: "flex-1 min-w-0",
390
- children: _
392
+ children: v
391
393
  }), c]
392
- }) : _, T = e.type === "toggle" && !e.labels ? "end" : "fill", E = e.type === "toggle" && !e.labels && !l;
393
- return h && T === "end" && !b ? /* @__PURE__ */ A(g, {
394
+ }) : v, T = e.type === "toggle" && !e.labels ? "end" : "fill", E = e.type === "toggle" && !e.labels && !l;
395
+ return g && T === "end" && !b ? /* @__PURE__ */ A(_, {
394
396
  inline: !0,
395
397
  label: String(e.label).toUpperCase(),
396
398
  labelWidth: G,
@@ -398,13 +400,13 @@ function q({ param: e, layer: t, setProp: r, palette: o, bound: s, animate: c, i
398
400
  className: `flex w-full items-center justify-end ${K[d] ?? ""}`,
399
401
  children: w
400
402
  })
401
- }) : h ? /* @__PURE__ */ A(y, {
403
+ }) : g ? /* @__PURE__ */ A(y, {
402
404
  label: e.label,
403
405
  hint: b,
404
406
  align: T,
405
407
  labelWidth: G,
406
408
  children: w
407
- }) : /* @__PURE__ */ A(g, {
409
+ }) : /* @__PURE__ */ A(_, {
408
410
  inline: E,
409
411
  label: l ? String(e.label).toUpperCase() : e.label,
410
412
  hint: b,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kolkrabbi/design-editor",
3
- "version": "0.32.0",
3
+ "version": "0.33.0",
4
4
  "private": false,
5
5
  "description": "The design editor as one component",
6
6
  "license": "MIT",
@@ -33,7 +33,7 @@
33
33
  "@kolkrabbi/kol-component": ">=0.343.0 <1",
34
34
  "@kolkrabbi/kol-framework": ">=0.44.0 <1",
35
35
  "@kolkrabbi/kol-hardware": ">=0.10.0 <1",
36
- "@kolkrabbi/kol-icons": ">=0.29.0 <1",
36
+ "@kolkrabbi/kol-icons": ">=0.68.0 <1",
37
37
  "@kolkrabbi/kol-media-client": ">=0.4.0 <1",
38
38
  "@kolkrabbi/kol-shell": ">=0.114.0 <1",
39
39
  "react": "^19.0.0",
@@ -61,14 +61,14 @@
61
61
  "tailwindcss": "^4.2.4",
62
62
  "vite": "^8.0.10",
63
63
  "vite-plugin-svgr": "^5.2.0",
64
- "@kolkrabbi/kol-framework": "0.70.0",
65
- "@kolkrabbi/kol-icons": "0.66.0",
66
- "@kolkrabbi/kol-theme": "0.214.0",
67
- "@kolkrabbi/kol-component": "0.344.0",
68
- "@kolkrabbi/kol-shell": "0.114.0",
69
- "@kolkrabbi/kol-dashboards": "0.13.0",
70
- "@kolkrabbi/kol-hardware": "0.10.0",
71
- "@kolkrabbi/kol-media-client": "0.7.0"
64
+ "@kolkrabbi/kol-component": "0.355.0",
65
+ "@kolkrabbi/kol-icons": "0.68.0",
66
+ "@kolkrabbi/kol-framework": "0.74.0",
67
+ "@kolkrabbi/kol-shell": "0.118.0",
68
+ "@kolkrabbi/kol-theme": "0.216.1",
69
+ "@kolkrabbi/kol-dashboards": "0.14.0",
70
+ "@kolkrabbi/kol-media-client": "0.7.0",
71
+ "@kolkrabbi/kol-hardware": "0.11.0"
72
72
  },
73
73
  "keywords": [
74
74
  "kol",