@kolkrabbi/design-editor 0.38.0 → 0.40.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,4 +1,4 @@
1
- import { B as e, D as t, Dn as n, F as r, Gn as i, I as a, J as o, Kn as s, L as c, Lt as l, Mn as u, On as d, P as f, Un as p, Wn as m, a as h, bn as g, d as _, dn as v, er as y, f as b, ft as x, gt as S, hn as C, ht as w, i as T, j as E, jn as D, ln as O, mn as k, n as A, nn as j, o as ee, p as M, r as N, tr as te, un as P, vn as F, xn as I } from "./rolls-yFvM7gmE.js";
1
+ import { B as e, D as t, Dn as n, F as r, Gn as i, I as a, J as o, Kn as s, L as c, Lt as l, Mn as u, On as d, P as f, Un as p, Wn as m, a as h, bn as g, d as _, dn as v, er as y, f as b, ft as x, gt as S, hn as C, ht as w, i as T, j as E, jn as D, ln as O, mn as k, n as A, nn as j, o as M, p as ee, r as N, tr as te, un as P, vn as F, xn as I } from "./rolls-yFvM7gmE.js";
2
2
  import { n as L, r as R, t as ne } from "./useLayerEdit-BLjEK2Gv.js";
3
3
  import { C as z, D as B, E as V, _ as H, a as re, c as U, d as ie, f as W, g as ae, i as G, l as oe, m as se, n as ce, r as le, t as ue, u as de, v as fe, w as pe, x as K, y as me } from "./effectCategories-o8c1BoBZ.js";
4
4
  import { r as he } from "./TreePicker-D4vypelv.js";
@@ -9,7 +9,7 @@ import { n as lt, r as ut, t as dt } from "./BindDot-CFTKW7W4.js";
9
9
  import { n as ft, r as pt } from "./effects-fBuIj2Pn.js";
10
10
  import { a as mt, i as ht, n as gt, o as _t, r as vt } from "./motion-BBBfa2mP.js";
11
11
  import { n as yt, r as bt, t as xt } from "./Timeline-ckBCdlTr.js";
12
- import { $ as St, A as Ct, B as wt, C as Tt, D as Et, E as Dt, F as Ot, G as kt, H as At, I as jt, J as Mt, K as Nt, L as Pt, M as Ft, N as It, O as Lt, P as Rt, Q as zt, R as Bt, S as Vt, T as Ht, U as Ut, V as Wt, W as Gt, X as Kt, Y as qt, Z as Jt, _ as Yt, a as Xt, at as Zt, b as Qt, c as $t, ct as en, d as tn, dt as nn, et as rn, f as an, ft as on, g as sn, h as cn, i as ln, it as un, j as dn, k as fn, l as pn, lt as mn, m as hn, mt as gn, n as _n, nt as vn, o as yn, ot as bn, p as xn, pt as Sn, q as Cn, r as wn, rt as Tn, s as En, st as Dn, t as On, tt as kn, u as An, ut as jn, v as Mn, w as Nn, x as Pn, y as Fn, z as In } from "./core-VWNEmGcX.js";
12
+ import { $ as St, A as Ct, B as wt, C as Tt, D as Et, E as Dt, F as Ot, G as kt, H as At, I as jt, J as Mt, K as Nt, L as Pt, M as Ft, N as It, O as Lt, P as Rt, Q as zt, R as Bt, S as Vt, T as Ht, U as Ut, V as Wt, W as Gt, X as Kt, Y as qt, Z as Jt, _ as Yt, a as Xt, at as Zt, b as Qt, c as $t, ct as en, d as tn, dt as nn, et as rn, f as an, ft as on, g as sn, h as cn, i as ln, it as un, j as dn, k as fn, l as pn, lt as mn, m as hn, mt as gn, n as _n, nt as vn, o as yn, ot as bn, p as xn, pt as Sn, q as Cn, r as wn, rt as Tn, s as En, st as Dn, t as On, tt as kn, u as An, ut as jn, v as Mn, w as Nn, x as Pn, y as Fn, z as In } from "./core-BCM3LX5r.js";
13
13
  import { Button as J, ButtonGroup as Ln, Divider as Rn, MultiSelect as zn, NavRail as Bn, StepList as Vn, Tag as Hn, Tooltip as Un, useGrabEdge as Wn, useMediaQuery as Gn, useModal as Kn } from "@kolkrabbi/kol-component";
14
14
  import { createContext as qn, useContext as Jn, useEffect as Y, useRef as X, useState as Z, useSyncExternalStore as Yn } from "react";
15
15
  import { Fragment as Xn, jsx as Q, jsxs as $ } from "react/jsx-runtime";
@@ -478,7 +478,7 @@ var Dr = (e, t) => JSON.stringify(e) === JSON.stringify(t), Or = [
478
478
  }
479
479
  ];
480
480
  function kr({ layer: e, readOnly: t = !1, editTabs: r = null }) {
481
- let i = c(), s = ct(), { steps: l, curve: u, cycle: d, mode: f, resolution: p, editing: m, fileId: h, editRequest: g } = s, { updateLayer: _, removeLayer: v, setCurrentPresetId: y, setCurrentPresetName: b, palette: x } = o(), { setOnly: S } = _e(), { buildSavedSpec: C } = Gt(), { addItem: w, updateItem: T } = Je(), E = Kn(), A = D(), j = ne(e?.id ?? null, { history: "coalesce" }), [ee, M] = Z("generate"), N = l[0], te = l.every((e) => e.loopId === N?.loopId), F = l.filter((e) => !Nt(K(e.loopId)) || !kt(K(e.loopId))), I = F.length === 0, R = {
481
+ let i = c(), s = ct(), { steps: l, curve: u, cycle: d, mode: f, resolution: p, editing: m, fileId: h, editRequest: g } = s, { updateLayer: _, removeLayer: v, setCurrentPresetId: y, setCurrentPresetName: b, palette: x } = o(), { setOnly: S } = _e(), { buildSavedSpec: C } = Gt(), { addItem: w, updateItem: T } = Je(), E = Kn(), A = D(), j = ne(e?.id ?? null, { history: "coalesce" }), [M, ee] = Z("generate"), N = l[0], te = l.every((e) => e.loopId === N?.loopId), F = l.filter((e) => !Nt(K(e.loopId)) || !kt(K(e.loopId))), I = F.length === 0, R = {
482
482
  blend: te ? null : "Blend tweens one generator — these steps are different generators",
483
483
  shape: I ? null : `No outline to morph: ${F.map((e) => Qe(e, l.indexOf(e))).join(", ")} (GL)`,
484
484
  crossfade: I ? null : `Cannot fade: ${F.map((e) => Qe(e, l.indexOf(e))).join(", ")} (GL)`
@@ -683,8 +683,8 @@ function kr({ layer: e, readOnly: t = !1, editTabs: r = null }) {
683
683
  /* @__PURE__ */ Q(P, {
684
684
  layout: "joined",
685
685
  tone: "sunken",
686
- value: ee,
687
- onChange: M,
686
+ value: M,
687
+ onChange: ee,
688
688
  options: r,
689
689
  size: i,
690
690
  className: a(i)
@@ -695,7 +695,7 @@ function kr({ layer: e, readOnly: t = !1, editTabs: r = null }) {
695
695
  patch: j.patch,
696
696
  updateLayer: _,
697
697
  palette: x,
698
- tab: ee,
698
+ tab: M,
699
699
  tabStrip: null,
700
700
  inline: !0,
701
701
  picker: !1
@@ -1121,7 +1121,7 @@ function Yr({ layer: e, showMod: t }) {
1121
1121
  let e = () => u("effect");
1122
1122
  return window.addEventListener("kol:open-effects", e), () => window.removeEventListener("kol:open-effects", e);
1123
1123
  }, []);
1124
- let { addFilter: d, replaceFilter: f, removeFilter: p, toggleFilter: g, updateLayer: _, palette: y } = o(), S = ne(e.id, { history: "coalesce" }), T = x(e), E = T.findIndex((e) => !e.def?.first), D = E < 0 ? T.length : E, j = E < 0 ? null : T[E], ee = le(W).find((e) => e.id === ce(j?.id)), N = ee?.id === "halftone", te = N ? (ee?.filters ?? []).map((e) => ({
1124
+ let { addFilter: d, replaceFilter: f, removeFilter: p, toggleFilter: g, updateLayer: _, palette: y } = o(), S = ne(e.id, { history: "coalesce" }), T = x(e), E = T.findIndex((e) => !e.def?.first), D = E < 0 ? T.length : E, j = E < 0 ? null : T[E], M = le(W).find((e) => e.id === ce(j?.id)), N = M?.id === "halftone", te = N ? (M?.filters ?? []).map((e) => ({
1125
1125
  value: e.id,
1126
1126
  label: e.label
1127
1127
  })) : null, F = !N && j ? j.def.label : null, I = (t) => {
@@ -1163,7 +1163,7 @@ function Yr({ layer: e, showMod: t }) {
1163
1163
  params: {}
1164
1164
  } : e) });
1165
1165
  }, () => {
1166
- j && U(h(B, A(j.def.params, B), M()));
1166
+ j && U(h(B, A(j.def.params, B), ee()));
1167
1167
  });
1168
1168
  let ae = e.fxGroup ? ue.find((t) => t.id === e.fxGroup) : null;
1169
1169
  if (ae) {
@@ -1319,7 +1319,7 @@ function Yr({ layer: e, showMod: t }) {
1319
1319
  className: "flex-1 min-w-0",
1320
1320
  "aria-label": `Randomize ${n.toLowerCase()}`,
1321
1321
  onClick: () => {
1322
- let n = b(M() >>> 0);
1322
+ let n = b(ee() >>> 0);
1323
1323
  if (t === "preset") {
1324
1324
  let e = ge(j.def, B, n);
1325
1325
  e != null && U(de(j.def, e));
@@ -1336,7 +1336,7 @@ function Yr({ layer: e, showMod: t }) {
1336
1336
  className: "flex-1 min-w-0",
1337
1337
  "aria-label": "Randomize settings",
1338
1338
  onClick: () => {
1339
- U(xe(B, A(j.def.params.filter((e) => w(e) !== "anim"), B), b(M() >>> 0)));
1339
+ U(xe(B, A(j.def.params.filter((e) => w(e) !== "anim"), B), b(ee() >>> 0)));
1340
1340
  },
1341
1341
  children: "Settings"
1342
1342
  }),
@@ -1587,7 +1587,7 @@ function ti({ layer: e, showMod: t, tree: n }) {
1587
1587
  };
1588
1588
  return Hr(S, () => {
1589
1589
  let t = K(e.loopId)?.params ?? [];
1590
- l(e.id, h(e, A(t, e), M(), { withFilters: !0 }));
1590
+ l(e.id, h(e, A(t, e), ee(), { withFilters: !0 }));
1591
1591
  }), /* @__PURE__ */ $(Jr, {
1592
1592
  title: v,
1593
1593
  chips: b,
@@ -1656,7 +1656,7 @@ function ni({ layer: e, showMod: t }) {
1656
1656
  comp: _t(f)
1657
1657
  });
1658
1658
  }, () => {
1659
- let t = M(), n = b(t >>> 0), r = e.comp ?? { instances: [] };
1659
+ let t = ee(), n = b(t >>> 0), r = e.comp ?? { instances: [] };
1660
1660
  (r.instances ?? []).forEach((e, t) => {
1661
1661
  r = vt(r, t, n);
1662
1662
  }), s(e.id, {
@@ -2527,13 +2527,13 @@ function Ni() {
2527
2527
  }, [i]);
2528
2528
  let { tool: O, setTool: k } = Mt(), A = X(O);
2529
2529
  A.current = O;
2530
- let { updateLayer: j, undo: ee, redo: M } = o(), N = X({
2531
- undo: ee,
2532
- redo: M
2530
+ let { updateLayer: j, undo: M, redo: ee } = o(), N = X({
2531
+ undo: M,
2532
+ redo: ee
2533
2533
  });
2534
2534
  N.current = {
2535
- undo: ee,
2536
- redo: M
2535
+ undo: M,
2536
+ redo: ee
2537
2537
  };
2538
2538
  let te = !!s().grab;
2539
2539
  Y(() => {
@@ -2796,7 +2796,7 @@ var Ji = [
2796
2796
  }
2797
2797
  ];
2798
2798
  function Xi({ layer: e, onSwitchCategory: t, onInsert: r, onRestart: i, aspectValue: a, onAspect: s, openEffects: c = !1, rail: l = !1, onRail: u, onSheet: d }) {
2799
- let f = ct(), { updateLayer: p, addFilter: m, removeFilter: g } = o(), { onExportPng: v } = Gt(), [b, S] = Z(!1), [C, w] = Z(!0), [E, D] = Z(!1), [O, k] = Z(!1), [j, M] = Z("generate"), [te, P] = Z(!1), [F, I] = Z(!1), { aspect: L } = o(), [R, ne] = Z(null), z = _(e);
2799
+ let f = ct(), { updateLayer: p, addFilter: m, removeFilter: g } = o(), { onExportPng: v } = Gt(), [b, S] = Z(!1), [C, w] = Z(!0), [E, D] = Z(!1), [O, k] = Z(!1), [j, ee] = Z("generate"), [te, P] = Z(!1), [F, I] = Z(!1), { aspect: L } = o(), [R, ne] = Z(null), z = _(e);
2800
2800
  Y(() => {
2801
2801
  c && (w(!0), k(!0));
2802
2802
  }, [c]);
@@ -2816,7 +2816,7 @@ function Xi({ layer: e, onSwitchCategory: t, onInsert: r, onRestart: i, aspectVa
2816
2816
  className: "fixed inset-y-0 right-0 left-[var(--fxr-rail,0px)] z-20",
2817
2817
  onClick: () => S(!1)
2818
2818
  });
2819
- let W = e.type === "loop", ae = W ? `${H(e.loopGroup).label} · ${e.presetLabel}` : "Media", oe = W ? K(e.loopId)?.params ?? [] : [], se = W ? ee(oe, e) : [], ce = () => p(e.id, h(e, A(oe, e), z.take(), { withFilters: !0 })), le = (t) => p(e.id, h(e, t.params, z.take(), { stripNoRandom: !!t.motion })), ue = () => {
2819
+ let W = e.type === "loop", ae = W ? `${H(e.loopGroup).label} · ${e.presetLabel}` : "Media", oe = W ? K(e.loopId)?.params ?? [] : [], se = W ? M(oe, e) : [], ce = () => p(e.id, h(e, A(oe, e), z.take(), { withFilters: !0 })), le = (t) => p(e.id, h(e, t.params, z.take(), { stripNoRandom: !!t.motion })), ue = () => {
2820
2820
  let t = T(e, z.take());
2821
2821
  t && p(e.id, t);
2822
2822
  }, de = x(e), { effectable: fe } = G(e), me = () => {
@@ -2942,7 +2942,7 @@ function Xi({ layer: e, onSwitchCategory: t, onInsert: r, onRestart: i, aspectVa
2942
2942
  /* @__PURE__ */ Q(Ln, {
2943
2943
  layout: "joined",
2944
2944
  value: ge,
2945
- onChange: M,
2945
+ onChange: ee,
2946
2946
  options: he,
2947
2947
  size: B,
2948
2948
  className: l ? Bi : "[&_.kol-seg-cell]:min-w-0 [&_.kol-seg-cell]:px-2 [&_.kol-seg-cell]:overflow-hidden"
@@ -3042,7 +3042,7 @@ function Xi({ layer: e, onSwitchCategory: t, onInsert: r, onRestart: i, aspectVa
3042
3042
  ...e,
3043
3043
  ...t.params,
3044
3044
  id: e.id
3045
- }, i = t.def ? ee(t.def.params, r) : [], a = (t) => {
3045
+ }, i = t.def ? M(t.def.params, r) : [], a = (t) => {
3046
3046
  let i = h(r, t.params, z.take(), { stripNoRandom: !!t.motion }), a = de.map(({ def: e, ...t }) => t);
3047
3047
  p(e.id, { filters: a.map((e, t) => t === n ? {
3048
3048
  ...e,
@@ -3226,7 +3226,7 @@ function Qi() {
3226
3226
  x: 0,
3227
3227
  y: 0
3228
3228
  }
3229
- }), ee = X(null), M = () => {
3229
+ }), M = X(null), ee = () => {
3230
3230
  let [e, t] = [...A.current.pts.values()];
3231
3231
  return {
3232
3232
  d: Math.hypot(e.x - t.x, e.y - t.y),
@@ -3237,13 +3237,13 @@ function Qi() {
3237
3237
  if (A.current.pts.set(e.pointerId, {
3238
3238
  x: e.clientX,
3239
3239
  y: e.clientY
3240
- }), ee.current = A.current.pts.size === 1 ? {
3240
+ }), M.current = A.current.pts.size === 1 ? {
3241
3241
  id: e.pointerId,
3242
3242
  x: e.clientX,
3243
3243
  y: e.clientY,
3244
3244
  t: performance.now()
3245
3245
  } : null, A.current.pts.size === 2) {
3246
- let t = k.current?.getBoundingClientRect(), r = M(), i = (t?.left ?? 0) - D.x, a = (t?.top ?? 0) - D.y;
3246
+ let t = k.current?.getBoundingClientRect(), r = ee(), i = (t?.left ?? 0) - D.x, a = (t?.top ?? 0) - D.y;
3247
3247
  A.current.start = {
3248
3248
  ...r,
3249
3249
  ox: i,
@@ -3260,7 +3260,7 @@ function Qi() {
3260
3260
  y: e.clientY
3261
3261
  }), t.pts.size >= 2 && t.start)) {
3262
3262
  e.stopPropagation();
3263
- let n = M(), r = t.start, i = Math.min(4, Math.max(.5, r.v.s * (n.d / r.d)));
3263
+ let n = ee(), r = t.start, i = Math.min(4, Math.max(.5, r.v.s * (n.d / r.d)));
3264
3264
  t.live = {
3265
3265
  s: i,
3266
3266
  x: n.mx - r.ox - i * r.px,
@@ -3268,8 +3268,8 @@ function Qi() {
3268
3268
  }, k.current && (k.current.style.transform = N(t.live));
3269
3269
  }
3270
3270
  }, F = (e) => {
3271
- let t = ee.current;
3272
- t && t.id === e.pointerId && e.type === "pointerup" && h === "live" && performance.now() - t.t < 350 && Math.hypot(e.clientX - t.x, e.clientY - t.y) < 12 && (I?.type === "loop" ? K(I.loopId) : null)?.group !== "penrose" && n.toggle(), t?.id === e.pointerId && (ee.current = null), A.current.pts.delete(e.pointerId), A.current.pts.size < 2 && A.current.start && (A.current.start = null, O(A.current.live));
3271
+ let t = M.current;
3272
+ t && t.id === e.pointerId && e.type === "pointerup" && h === "live" && performance.now() - t.t < 350 && Math.hypot(e.clientX - t.x, e.clientY - t.y) < 12 && (I?.type === "loop" ? K(I.loopId) : null)?.group !== "penrose" && n.toggle(), t?.id === e.pointerId && (M.current = null), A.current.pts.delete(e.pointerId), A.current.pts.size < 2 && A.current.start && (A.current.start = null, O(A.current.live));
3273
3273
  };
3274
3274
  nr(), Y(() => (on("randomiser"), () => on(null)), []), Y(() => {
3275
3275
  u("4:5"), d("orbit");
@@ -3531,7 +3531,7 @@ function aa() {
3531
3531
  n,
3532
3532
  r
3533
3533
  ]);
3534
- let i = ra(), a = t ? _i(t).title : "Labs", s = i.items.filter((e) => e.sub?.length).map((e) => e.path), [c, l] = Z(e), [u, d] = Z(e), [f, p] = Z(!1);
3534
+ let i = ra(), a = t ? _i(t).title : "Labs", s = i.items.filter((e) => e.sub?.length).map((e) => e.path), [c, l] = Z(e), [u, d] = Z(e), [f, p] = Z(!1), [m, h] = Z(!1);
3535
3535
  return /* @__PURE__ */ $("div", {
3536
3536
  className: "kol-float-labs kol-editor-shell relative h-dvh overflow-hidden",
3537
3537
  "data-editor-keep-selection": !0,
@@ -3556,11 +3556,14 @@ function aa() {
3556
3556
  collapsed: c,
3557
3557
  onCollapsedChange: l,
3558
3558
  onHide: () => d(!0),
3559
+ foldable: !0,
3560
+ folded: m,
3561
+ onFold: h,
3559
3562
  footer: c ? void 0 : /* @__PURE__ */ Q($n, {
3560
3563
  onCollapse: () => l(!0),
3561
3564
  onHide: () => d(!0)
3562
3565
  }),
3563
- className: "absolute inset-y-6 left-6 z-[var(--kol-z-sticky)] !h-auto"
3566
+ className: `absolute left-6 top-6 z-[var(--kol-z-sticky)] ${m && !c ? "" : "bottom-6 !h-auto"}`
3564
3567
  }),
3565
3568
  !e && /* @__PURE__ */ Q(na, {
3566
3569
  id: "labs-transport",
@@ -3581,7 +3584,7 @@ function aa() {
3581
3584
  surface: "solid",
3582
3585
  foldable: !0,
3583
3586
  defaultFolded: e,
3584
- className: "max-h-full min-h-0 overflow-y-auto [scrollbar-width:none] [&_.kol-compose-inspector-body]:!p-0",
3587
+ className: "max-h-full min-h-0 [&_.kol-compose-inspector-body]:!p-0",
3585
3588
  sections: [{
3586
3589
  id: "labs-params",
3587
3590
  label: "Parameters",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kolkrabbi/design-editor",
3
- "version": "0.38.0",
3
+ "version": "0.40.0",
4
4
  "private": false,
5
5
  "description": "The design editor as one component",
6
6
  "license": "MIT",
@@ -30,15 +30,15 @@
30
30
  "README.md"
31
31
  ],
32
32
  "peerDependencies": {
33
- "@kolkrabbi/kol-component": ">=0.363.0 <1",
33
+ "@kolkrabbi/kol-component": ">=0.365.0 <1",
34
34
  "@kolkrabbi/kol-framework": ">=0.44.0 <1",
35
35
  "@kolkrabbi/kol-hardware": ">=0.10.0 <1",
36
36
  "@kolkrabbi/kol-icons": ">=0.69.0 <1",
37
37
  "@kolkrabbi/kol-media-client": ">=0.4.0 <1",
38
- "@kolkrabbi/kol-shell": ">=0.121.0 <1",
38
+ "@kolkrabbi/kol-shell": ">=0.123.0 <1",
39
39
  "react": "^19.0.0",
40
40
  "react-dom": "^19.0.0",
41
- "@kolkrabbi/kol-theme": ">=0.219.0 <1",
41
+ "@kolkrabbi/kol-theme": ">=0.220.0 <1",
42
42
  "@kolkrabbi/kol-dashboards": ">=0.13.0 <1"
43
43
  },
44
44
  "dependencies": {
@@ -62,13 +62,13 @@
62
62
  "vite": "^8.0.10",
63
63
  "vite-plugin-svgr": "^5.2.0",
64
64
  "@kolkrabbi/kol-framework": "0.74.1",
65
+ "@kolkrabbi/kol-component": "0.365.0",
66
+ "@kolkrabbi/kol-hardware": "0.11.1",
67
+ "@kolkrabbi/kol-theme": "0.220.0",
65
68
  "@kolkrabbi/kol-icons": "0.70.1",
66
- "@kolkrabbi/kol-theme": "0.219.0",
67
- "@kolkrabbi/kol-component": "0.363.0",
68
- "@kolkrabbi/kol-shell": "0.121.0",
69
+ "@kolkrabbi/kol-shell": "0.123.0",
69
70
  "@kolkrabbi/kol-media-client": "0.7.0",
70
- "@kolkrabbi/kol-hardware": "0.11.1",
71
- "@kolkrabbi/kol-dashboards": "0.15.0"
71
+ "@kolkrabbi/kol-dashboards": "0.16.0"
72
72
  },
73
73
  "keywords": [
74
74
  "kol",