@kolkrabbi/design-editor 0.21.0 → 0.22.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.
@@ -12607,4 +12607,4 @@ function Yd({ mediaProxyBase: e, mediaClient: t, settingsStore: n } = {}) {
12607
12607
  });
12608
12608
  }
12609
12609
  //#endregion
12610
- export { wn as $, Jr as A, rr as B, Ri as C, Zr as D, on as E, or as F, Yn as G, Xn as H, ir as I, Jn as J, Wn as K, ar as L, Lr as M, Ir as N, Xr as O, dr as P, Nn as Q, $n as R, zi as S, Pi as T, zn as U, Vn as V, Kn as W, Tn as X, Cn as Y, Rn as Z, Ho as _, zd as a, ho as b, Fd as c, eu as d, On as et, Sn as f, ts as g, Rl as h, Jd as i, Fr as j, Kr as k, Ad as l, zl as m, Ud as n, An as nt, Bd as o, Vl as p, Gn as q, Kd as r, En as rt, Hd as s, Yd as t, Ln as tt, qu as u, go as v, Vi as w, so as x, vo as y, Qn as z };
12610
+ export { Nn as $, Jr as A, Qn as B, Ri as C, Zr as D, on as E, dr as F, Kn as G, Vn as H, or as I, Gn as J, Yn as K, ir as L, Lr as M, Ar as N, Xr as O, Ir as P, Rn as Q, ar as R, zi as S, Pi as T, Xn as U, rr as V, zn as W, Cn as X, Jn as Y, Tn as Z, Ho as _, zd as a, ho as b, Fd as c, eu as d, wn as et, Sn as f, ts as g, Rl as h, Jd as i, En as it, Fr as j, Kr as k, Ad as l, zl as m, Ud as n, Ln as nt, Bd as o, Vl as p, Wn as q, Kd as r, An as rt, Hd as s, Yd as t, On as tt, qu as u, go as v, Vi as w, so as x, vo as y, $n as z };
package/dist/core.js CHANGED
@@ -1,3 +1,3 @@
1
1
  import { at as e, mn as t } from "./rolls-Bg1XHuvJ.js";
2
- import { A as n, C as r, D as i, G as a, J as o, M as s, N as c, S as l, T as u, U as d, X as f, Y as p, Z as m, a as h, b as g, c as _, et as v, h as y, i as b, j as x, k as S, m as C, n as w, nt as T, o as E, r as D, rt as O, s as k, t as A, v as j, w as M, y as N } from "./core-B2bfXyS5.js";
3
- export { j as AppSettingsSections, i as BRAND, A as DesignEditor, A as default, N as DisplaySettingsDrawer, _ as EditorProviders, u as FilesDialog, x as GeneratorLibraryProvider, s as LIBRARY_SLOT_KEYS, p as MODES, h as OutputCanvas, E as OutputStage, k as OutputView, w as RAIL_EXTRA_PREFIX, f as VIEW_PATHS, l as closeFiles, S as comboLabel, m as currentView, d as isMobileDevice, r as openFiles, t as registerPack, C as setMediaClient, y as setMediaProxyBase, v as setMode, T as setNavigator, D as setRailExtras, e as setSettingsStore, a as setWantsDesktop, n as shortcutsBySection, M as useFilesDialog, c as useGeneratorLibrary, b as useRailExtras, g as useSettingsSections, o as wantsDesktop, O as withView };
2
+ import { A as n, C as r, D as i, K as a, M as o, N as s, P as c, Q as l, S as u, T as d, W as f, X as p, Y as m, Z as h, a as g, b as _, c as v, h as y, i as b, it as x, j as S, k as C, m as w, n as T, o as E, r as D, rt as O, s as k, t as A, tt as j, v as M, w as N, y as P } from "./core-G5e-pSOt.js";
3
+ export { M as AppSettingsSections, i as BRAND, A as DesignEditor, A as default, P as DisplaySettingsDrawer, v as EditorProviders, d as FilesDialog, S as GeneratorLibraryProvider, o as LIBRARY_SLOT_KEYS, p as MODES, g as OutputCanvas, E as OutputStage, k as OutputView, T as RAIL_EXTRA_PREFIX, h as VIEW_PATHS, u as closeFiles, C as comboLabel, l as currentView, f as isMobileDevice, s as loadLibrary, r as openFiles, t as registerPack, w as setMediaClient, y as setMediaProxyBase, j as setMode, O as setNavigator, D as setRailExtras, e as setSettingsStore, a as setWantsDesktop, n as shortcutsBySection, N as useFilesDialog, c as useGeneratorLibrary, b as useRailExtras, _ as useSettingsSections, m as wantsDesktop, x as withView };
@@ -6,15 +6,15 @@ import { a as F, f as I, i as L, l as ie, n as R, o as ae, r as z, s as oe, t as
6
6
  import { n as ce, r as V } from "./effects-pCd8YTdQ.js";
7
7
  import { c as le, i as H, r as ue } from "./labels-B5qkocWy.js";
8
8
  import { i as U, n as de, r as fe } from "./motion-DFnAar_2.js";
9
- import { $ as pe, A as me, B as he, C as ge, D as _e, E as ve, F as ye, G as be, H as xe, I as W, J as Se, K as Ce, L as we, M as Te, N as Ee, O as De, P as Oe, Q as ke, R as G, S as Ae, T as je, U as Me, V as Ne, W as Pe, X as Fe, Y as Ie, Z as Le, _ as Re, a as ze, b as Be, c as Ve, d as He, et as Ue, f as We, g as Ge, h as Ke, i as qe, j as Je, k as Ye, l as Xe, m as Ze, n as Qe, nt as $e, o as et, p as tt, q as nt, r as rt, rt as it, s as at, t as ot, tt as st, u as ct, v as lt, w as ut, x as dt, y as ft, z as pt } from "./core-B2bfXyS5.js";
10
- import { Button as K, Divider as mt, Dropdown as ht, LabeledControlSection as gt, SegmentedToggle as q, ToggleSwitch as _t, Tooltip as vt } from "@kolkrabbi/kol-component";
11
- import { createContext as yt, useCallback as bt, useContext as xt, useEffect as J, useRef as Y, useState as X } from "react";
12
- import { Fragment as St, jsx as Z, jsxs as Q } from "react/jsx-runtime";
13
- import { Icon as Ct } from "@kolkrabbi/kol-icons";
14
- import { useDragResize as wt, useTheme as Tt } from "@kolkrabbi/kol-framework";
9
+ import { $ as pe, A as me, B as he, C as ge, D as _e, E as ve, F as ye, G as be, H as xe, I as Se, J as Ce, K as we, L as W, M as Te, N as Ee, O as De, P as Oe, Q as ke, R as Ae, S as je, T as Me, U as Ne, V as Pe, W as Fe, X as Ie, Y as Le, Z as Re, _ as ze, a as Be, b as Ve, c as He, d as Ue, et as We, f as Ge, g as Ke, h as qe, i as Je, it as Ye, j as Xe, k as Ze, l as Qe, m as $e, n as et, nt as tt, o as nt, p as rt, q as it, r as at, rt as ot, s as st, t as ct, tt as lt, u as ut, v as dt, w as ft, x as pt, y as mt, z as G } from "./core-G5e-pSOt.js";
10
+ import { Button as K, Divider as ht, Dropdown as gt, LabeledControlSection as _t, SegmentedToggle as q, ToggleSwitch as vt, Tooltip as yt } from "@kolkrabbi/kol-component";
11
+ import { createContext as bt, useCallback as xt, useContext as St, useEffect as J, useRef as Y, useState as X } from "react";
12
+ import { Fragment as Ct, jsx as Z, jsxs as Q } from "react/jsx-runtime";
13
+ import { Icon as wt } from "@kolkrabbi/kol-icons";
14
+ import { useDragResize as Tt, useTheme as Et } from "@kolkrabbi/kol-framework";
15
15
  //#region src/editor/labs/useLabsLayer.js
16
16
  function $() {
17
- let { layers: e, addLayer: t, removeLayer: n, updateLayer: r, select: i, beginTransaction: a, commitTransaction: o } = u(), s = bt((s, c) => {
17
+ let { layers: e, addLayer: t, removeLayer: n, updateLayer: r, select: i, beginTransaction: a, commitTransaction: o } = u(), s = xt((s, c) => {
18
18
  let [l, ...u] = e;
19
19
  a();
20
20
  for (let e of u) n(e.id);
@@ -36,7 +36,7 @@ function $() {
36
36
  }
37
37
  //#endregion
38
38
  //#region src/editor/labs/LabsNav.jsx
39
- function Et() {
39
+ function Dt() {
40
40
  let { addFilter: e, patchFilter: t } = u(), { layer: r, setOnly: i } = $(), a = Y(null);
41
41
  J(() => {
42
42
  r?.type === "photo" && r.src && (a.current = {
@@ -50,7 +50,7 @@ function Et() {
50
50
  r?.srcType,
51
51
  r?.fit
52
52
  ]);
53
- let o = he({
53
+ let o = Pe({
54
54
  layer: r,
55
55
  setOnly: i,
56
56
  addFilter: e,
@@ -67,14 +67,14 @@ function Et() {
67
67
  if (n.id.startsWith("sec:")) {
68
68
  let e = n.id.slice(4);
69
69
  t.push({
70
- icon: pt[e] ?? "square",
71
- path: `${Qe}${n.id}`,
70
+ icon: he[e] ?? "square",
71
+ path: `${et}${n.id}`,
72
72
  label: n.label,
73
73
  sub: []
74
74
  });
75
75
  return;
76
76
  }
77
- let r = `${Qe}${n.id}`, i = n.pages ?? [], a = n.onSelect ?? i[0]?.onSelect ?? i[0]?.children?.[0]?.onSelect;
77
+ let r = `${et}${n.id}`, i = n.pages ?? [], a = n.onSelect ?? i[0]?.onSelect ?? i[0]?.children?.[0]?.onSelect;
78
78
  a && e.set(r, a);
79
79
  let o = t[t.length - 1], s = {
80
80
  icon: n.icon,
@@ -83,19 +83,19 @@ function Et() {
83
83
  };
84
84
  o?.sub ? o.sub.push(s) : t.push(s);
85
85
  });
86
- let r = Me() && !Se();
87
- return rt({
86
+ let r = Fe() && !Le();
87
+ return at({
88
88
  items: t,
89
89
  dispatch: (t) => {
90
90
  let i = e.get(t);
91
91
  return i ? (i(), r && n.play(), !0) : !1;
92
92
  }
93
- }), () => rt(null);
93
+ }), () => at(null);
94
94
  }), null;
95
95
  }
96
96
  //#endregion
97
97
  //#region src/editor/labs/LabsParams.jsx
98
- function Dt(e, t) {
98
+ function Ot(e, t) {
99
99
  J(() => {
100
100
  let n = (n) => {
101
101
  if (n.key !== "r" && n.key !== "R" || n.metaKey || n.ctrlKey || n.altKey) return;
@@ -105,13 +105,13 @@ function Dt(e, t) {
105
105
  return window.addEventListener("keydown", n), () => window.removeEventListener("keydown", n);
106
106
  });
107
107
  }
108
- var Ot = [{
108
+ var kt = [{
109
109
  value: "effect",
110
110
  label: "Effect"
111
111
  }, {
112
112
  value: "anim",
113
113
  label: "Motion"
114
- }], kt = [
114
+ }], At = [
115
115
  {
116
116
  value: "generate",
117
117
  label: "Generate"
@@ -124,7 +124,7 @@ var Ot = [{
124
124
  value: "anim",
125
125
  label: "Animation"
126
126
  }
127
- ], At = [
127
+ ], jt = [
128
128
  {
129
129
  value: "generate",
130
130
  label: "Gen"
@@ -138,7 +138,7 @@ var Ot = [{
138
138
  label: "Anim"
139
139
  }
140
140
  ];
141
- function jt({ options: e, active: t, onPick: n, spread: i = !1, pills: a = !1 }) {
141
+ function Mt({ options: e, active: t, onPick: n, spread: i = !1, pills: a = !1 }) {
142
142
  let o = r();
143
143
  return e?.length ? a ? /* @__PURE__ */ Z("div", {
144
144
  className: "flex items-center gap-1 flex-wrap",
@@ -157,7 +157,7 @@ function jt({ options: e, active: t, onPick: n, spread: i = !1, pills: a = !1 })
157
157
  className: S(o)
158
158
  }) : null;
159
159
  }
160
- function Mt({ chips: e, active: t, onPick: n, spread: i, pills: a, title: o, tabStrip: s, preStrip: c, fx: l = !1, children: u }) {
160
+ function Nt({ chips: e, active: t, onPick: n, spread: i, pills: a, title: o, tabStrip: s, preStrip: c, fx: l = !1, children: u }) {
161
161
  let d = r() === "sm";
162
162
  return /* @__PURE__ */ Q("div", {
163
163
  className: `flex flex-col gap-5${l ? " kol-labs-fx" : ""}`,
@@ -166,7 +166,7 @@ function Mt({ chips: e, active: t, onPick: n, spread: i, pills: a, title: o, tab
166
166
  className: "kol-eyebrow text-fg-96",
167
167
  children: o
168
168
  }),
169
- e && /* @__PURE__ */ Z(jt, {
169
+ e && /* @__PURE__ */ Z(Mt, {
170
170
  options: e,
171
171
  active: t,
172
172
  onPick: n,
@@ -179,7 +179,7 @@ function Mt({ chips: e, active: t, onPick: n, spread: i, pills: a, title: o, tab
179
179
  ]
180
180
  });
181
181
  }
182
- function Nt({ layer: n, showMod: a }) {
182
+ function Pt({ layer: n, showMod: a }) {
183
183
  let o = r(), [s, c] = X("effect");
184
184
  J(() => {
185
185
  let e = () => c("effect");
@@ -221,7 +221,7 @@ function Nt({ layer: n, showMod: a }) {
221
221
  } : t);
222
222
  h(n.id, { filters: t });
223
223
  };
224
- Dt(() => {
224
+ Ot(() => {
225
225
  y && h(n.id, { filters: w.map((e, t) => t === 0 ? {
226
226
  ...e,
227
227
  params: {}
@@ -247,33 +247,33 @@ function Nt({ layer: n, showMod: a }) {
247
247
  value: e.id,
248
248
  label: `${e.label ?? e.id}${e.kind === "pixi" ? " · GPU" : ""}`
249
249
  }))];
250
- return /* @__PURE__ */ Q(Mt, {
250
+ return /* @__PURE__ */ Q(Nt, {
251
251
  title: "Effects",
252
252
  fx: !0,
253
253
  tabStrip: /* @__PURE__ */ Z(q, {
254
254
  value: s,
255
255
  onChange: c,
256
- options: Ot,
256
+ options: kt,
257
257
  size: o,
258
258
  className: S(o)
259
259
  }),
260
- children: [s === "effect" && /* @__PURE__ */ Q(St, { children: [
261
- /* @__PURE__ */ Q(gt, {
260
+ children: [s === "effect" && /* @__PURE__ */ Q(Ct, { children: [
261
+ /* @__PURE__ */ Q(_t, {
262
262
  label: "Effect Stack",
263
263
  divided: !0,
264
264
  children: [v.length === 0 && /* @__PURE__ */ Z(j, {
265
265
  className: "kol-mono-10 text-meta",
266
266
  children: "No effects yet — add one below."
267
- }), /* @__PURE__ */ Z(Pt, {
267
+ }), /* @__PURE__ */ Z(Ft, {
268
268
  ...e,
269
269
  from: 0
270
270
  })]
271
271
  }),
272
- /* @__PURE__ */ Z(mt, {}),
273
- /* @__PURE__ */ Z(gt, {
272
+ /* @__PURE__ */ Z(ht, {}),
273
+ /* @__PURE__ */ Z(_t, {
274
274
  label: A.label,
275
275
  divided: !0,
276
- children: /* @__PURE__ */ Z(ht, {
276
+ children: /* @__PURE__ */ Z(gt, {
277
277
  variant: "subtle",
278
278
  size: o,
279
279
  className: "w-full",
@@ -292,7 +292,7 @@ function Nt({ layer: n, showMod: a }) {
292
292
  })]
293
293
  });
294
294
  }
295
- if (!y) return /* @__PURE__ */ Z(Mt, {
295
+ if (!y) return /* @__PURE__ */ Z(Nt, {
296
296
  chips: C,
297
297
  active: null,
298
298
  onPick: ne,
@@ -301,12 +301,12 @@ function Nt({ layer: n, showMod: a }) {
301
301
  tabStrip: /* @__PURE__ */ Z(q, {
302
302
  value: s,
303
303
  onChange: c,
304
- options: Ot,
304
+ options: kt,
305
305
  size: o,
306
306
  className: S(o)
307
307
  }),
308
308
  children: /* @__PURE__ */ Z(k, {
309
- schema: ct,
309
+ schema: ut,
310
310
  layer: n,
311
311
  setProp: _.setProp,
312
312
  palette: g,
@@ -335,7 +335,7 @@ function Nt({ layer: n, showMod: a }) {
335
335
  renderAnimate: re,
336
336
  inline: !0
337
337
  };
338
- return /* @__PURE__ */ Q(Mt, {
338
+ return /* @__PURE__ */ Q(Nt, {
339
339
  chips: C,
340
340
  active: y.id,
341
341
  onPick: ne,
@@ -345,16 +345,16 @@ function Nt({ layer: n, showMod: a }) {
345
345
  tabStrip: /* @__PURE__ */ Z(q, {
346
346
  value: s,
347
347
  onChange: c,
348
- options: Ot,
348
+ options: kt,
349
349
  size: o,
350
350
  className: S(o)
351
351
  }),
352
- children: [s === "effect" && /* @__PURE__ */ Q(St, { children: [
352
+ children: [s === "effect" && /* @__PURE__ */ Q(Ct, { children: [
353
353
  ae.length > 0 && /* @__PURE__ */ Z(k, {
354
354
  schema: ae,
355
355
  ...H
356
356
  }),
357
- /* @__PURE__ */ Q(gt, {
357
+ /* @__PURE__ */ Q(_t, {
358
358
  divided: !0,
359
359
  children: [/* @__PURE__ */ Z(k, {
360
360
  schema: le,
@@ -367,12 +367,12 @@ function Nt({ layer: n, showMod: a }) {
367
367
  onPatch: O
368
368
  })]
369
369
  }),
370
- /* @__PURE__ */ Z(mt, {}),
371
- L < N.length && /* @__PURE__ */ Q(St, { children: [/* @__PURE__ */ Z(k, {
370
+ /* @__PURE__ */ Z(ht, {}),
371
+ L < N.length && /* @__PURE__ */ Q(Ct, { children: [/* @__PURE__ */ Z(k, {
372
372
  schema: N.slice(L),
373
373
  ...H
374
- }), /* @__PURE__ */ Z(mt, {})] }),
375
- /* @__PURE__ */ Z(Ft, {
374
+ }), /* @__PURE__ */ Z(ht, {})] }),
375
+ /* @__PURE__ */ Z(It, {
376
376
  chain: v,
377
377
  layer: n,
378
378
  hostView: T,
@@ -383,7 +383,7 @@ function Nt({ layer: n, showMod: a }) {
383
383
  palette: g,
384
384
  showMod: a
385
385
  })
386
- ] }), s === "anim" && /* @__PURE__ */ Q(St, { children: [
386
+ ] }), s === "anim" && /* @__PURE__ */ Q(Ct, { children: [
387
387
  /* @__PURE__ */ Z(k, {
388
388
  schema: y.def.params,
389
389
  ...H,
@@ -404,7 +404,7 @@ function Nt({ layer: n, showMod: a }) {
404
404
  ] })]
405
405
  });
406
406
  }
407
- function Pt({ chain: t, from: n = 0, layer: i, hostView: a, toggleFilter: o, removeFilter: s, setStagePropAt: c, palette: l, showMod: u }) {
407
+ function Ft({ chain: t, from: n = 0, layer: i, hostView: a, toggleFilter: o, removeFilter: s, setStagePropAt: c, palette: l, showMod: u }) {
408
408
  let d = r();
409
409
  return t.slice(n).map((t, r) => {
410
410
  let f = r + n, p = t.enabled !== !1, m = {
@@ -416,12 +416,12 @@ function Pt({ chain: t, from: n = 0, layer: i, hostView: a, toggleFilter: o, rem
416
416
  className: "flex flex-col gap-2 p-2 rounded bg-oq-04",
417
417
  children: [/* @__PURE__ */ Q("div", {
418
418
  className: "flex items-center gap-2",
419
- children: [/* @__PURE__ */ Z(_t, {
419
+ children: [/* @__PURE__ */ Z(vt, {
420
420
  size: d,
421
421
  checked: p,
422
422
  onChange: () => o(i.id, f),
423
423
  label: t.def?.label ?? t.id
424
- }), /* @__PURE__ */ Z(vt, {
424
+ }), /* @__PURE__ */ Z(yt, {
425
425
  asChild: !0,
426
426
  label: "Remove effect",
427
427
  children: /* @__PURE__ */ Z("button", {
@@ -433,7 +433,7 @@ function Pt({ chain: t, from: n = 0, layer: i, hostView: a, toggleFilter: o, rem
433
433
  border: "none",
434
434
  background: "transparent"
435
435
  },
436
- children: /* @__PURE__ */ Z(Ct, {
436
+ children: /* @__PURE__ */ Z(wt, {
437
437
  name: "x",
438
438
  size: 12
439
439
  })
@@ -454,7 +454,7 @@ function Pt({ chain: t, from: n = 0, layer: i, hostView: a, toggleFilter: o, rem
454
454
  }, t.key ?? f);
455
455
  });
456
456
  }
457
- function Ft({ chain: e, layer: t, hostView: n, addFilter: i, removeFilter: a, toggleFilter: o, setStagePropAt: s, palette: c, showMod: l }) {
457
+ function It({ chain: e, layer: t, hostView: n, addFilter: i, removeFilter: a, toggleFilter: o, setStagePropAt: s, palette: c, showMod: l }) {
458
458
  let u = r(), d = [{
459
459
  value: "",
460
460
  label: "Add FX..."
@@ -462,10 +462,10 @@ function Ft({ chain: e, layer: t, hostView: n, addFilter: i, removeFilter: a, to
462
462
  value: e.id,
463
463
  label: e.label ?? e.id
464
464
  }))];
465
- return /* @__PURE__ */ Q(gt, {
465
+ return /* @__PURE__ */ Q(_t, {
466
466
  label: "Post-Processing",
467
467
  divided: !0,
468
- children: [/* @__PURE__ */ Z(Pt, {
468
+ children: [/* @__PURE__ */ Z(Ft, {
469
469
  chain: e,
470
470
  from: 1,
471
471
  layer: t,
@@ -475,7 +475,7 @@ function Ft({ chain: e, layer: t, hostView: n, addFilter: i, removeFilter: a, to
475
475
  setStagePropAt: s,
476
476
  palette: c,
477
477
  showMod: l
478
- }), /* @__PURE__ */ Z(ht, {
478
+ }), /* @__PURE__ */ Z(gt, {
479
479
  variant: "subtle",
480
480
  size: u,
481
481
  className: "w-full",
@@ -488,17 +488,17 @@ function Ft({ chain: e, layer: t, hostView: n, addFilter: i, removeFilter: a, to
488
488
  })]
489
489
  });
490
490
  }
491
- function It({ layer: e, showMod: t, tree: n }) {
491
+ function Lt({ layer: e, showMod: t, tree: n }) {
492
492
  let a = r(), [o, s] = X("generate"), { updateLayer: c, palette: l } = u(), { setOnly: d } = $(), f = M(e.id, { history: "coalesce" }), m = O(e.loopGroup).find((t) => t.id === e.presetId), h = te(e.loopGroup)?.label ?? "", g = e.loopGroup === "paratype" && m?.sub === "Glyphs" ? E("paratype", "Glyphs") : null, _ = g ? g.map((e) => ({
493
493
  value: e.id,
494
494
  label: e.label
495
495
  })) : null;
496
- return Dt(() => {
496
+ return Ot(() => {
497
497
  m && d(e.type, w(m, e.loopGroup));
498
498
  }, () => {
499
499
  let t = re(e.loopId)?.params ?? [];
500
500
  c(e.id, i(e, p(t, e), b(), { withFilters: !0 }));
501
- }), /* @__PURE__ */ Z(Mt, {
501
+ }), /* @__PURE__ */ Z(Nt, {
502
502
  title: h,
503
503
  chips: _,
504
504
  active: e.presetId,
@@ -510,7 +510,7 @@ function It({ layer: e, showMod: t, tree: n }) {
510
510
  tabStrip: /* @__PURE__ */ Z(q, {
511
511
  value: o,
512
512
  onChange: s,
513
- options: a === "sm" ? kt : At,
513
+ options: a === "sm" ? At : jt,
514
514
  size: a,
515
515
  className: S(a)
516
516
  }),
@@ -532,9 +532,9 @@ function It({ layer: e, showMod: t, tree: n }) {
532
532
  })
533
533
  });
534
534
  }
535
- function Lt({ layer: e, showMod: t }) {
535
+ function Rt({ layer: e, showMod: t }) {
536
536
  let n = r(), [i, a] = X("generate"), { updateLayer: o, palette: s } = u(), { setOnly: c } = $(), l = M(e.id, { history: "coalesce" }), f = ue.find((t) => t.id === e.presetId), p = H.find((e) => e.subs.includes(f?.sub))?.label ?? "Kinetic";
537
- return Dt(() => {
537
+ return Ot(() => {
538
538
  f && c("kinetic", {
539
539
  presetId: f.id,
540
540
  presetLabel: f.label,
@@ -548,12 +548,12 @@ function Lt({ layer: e, showMod: t }) {
548
548
  comp: r,
549
549
  _rollSeed: t
550
550
  });
551
- }), /* @__PURE__ */ Z(Mt, {
551
+ }), /* @__PURE__ */ Z(Nt, {
552
552
  title: p,
553
553
  tabStrip: /* @__PURE__ */ Z(q, {
554
554
  value: i,
555
555
  onChange: a,
556
- options: n === "sm" ? kt : At,
556
+ options: n === "sm" ? At : jt,
557
557
  size: n,
558
558
  className: S(n)
559
559
  }),
@@ -572,7 +572,7 @@ function Lt({ layer: e, showMod: t }) {
572
572
  })
573
573
  });
574
574
  }
575
- function Rt() {
575
+ function zt() {
576
576
  let { layer: e } = $(), t = !!h().labsModDots;
577
577
  return J(() => {
578
578
  let e = (e) => {
@@ -581,27 +581,27 @@ function Rt() {
581
581
  t?.tagName === "INPUT" || t?.tagName === "TEXTAREA" || t?.isContentEditable || l("labsModDots", !v().labsModDots);
582
582
  };
583
583
  return window.addEventListener("keydown", e), () => window.removeEventListener("keydown", e);
584
- }, []), e ? e.type === "photo" ? /* @__PURE__ */ Z(Nt, {
584
+ }, []), e ? e.type === "photo" ? /* @__PURE__ */ Z(Pt, {
585
585
  layer: e,
586
586
  showMod: t
587
- }, e.id) : e.type === "loop" ? /* @__PURE__ */ Z(It, {
587
+ }, e.id) : e.type === "loop" ? /* @__PURE__ */ Z(Lt, {
588
588
  layer: e,
589
589
  showMod: t
590
- }, e.id) : e.type === "misc" ? /* @__PURE__ */ Z(It, {
590
+ }, e.id) : e.type === "misc" ? /* @__PURE__ */ Z(Lt, {
591
591
  layer: e,
592
592
  showMod: t,
593
593
  tree: N
594
- }, e.id) : e.type === "kinetic" ? /* @__PURE__ */ Z(Lt, {
594
+ }, e.id) : e.type === "kinetic" ? /* @__PURE__ */ Z(Rt, {
595
595
  layer: e,
596
596
  showMod: t
597
597
  }, e.id) : /* @__PURE__ */ Z(j, { children: "This layer has no labs surface." }) : /* @__PURE__ */ Z(j, { children: "Pick an effect or generator from the nav." });
598
598
  }
599
599
  //#endregion
600
600
  //#region src/editor/labs/LabsSourcePicker.jsx
601
- function zt(e) {
601
+ function Bt(e) {
602
602
  let { patch: t } = M(e.id), n = Y(null), [r, i] = X(!1), a = e.type === "loop" && e.loopGroup === "distress";
603
603
  return {
604
- nodes: /* @__PURE__ */ Q(St, { children: [/* @__PURE__ */ Z("input", {
604
+ nodes: /* @__PURE__ */ Q(Ct, { children: [/* @__PURE__ */ Z("input", {
605
605
  ref: n,
606
606
  type: "file",
607
607
  accept: a ? ".svg,image/svg+xml" : "image/*,video/*",
@@ -627,17 +627,17 @@ function zt(e) {
627
627
  srcType: "image"
628
628
  }), i.readAsDataURL(r);
629
629
  }
630
- }), /* @__PURE__ */ Z(He, {
630
+ }), /* @__PURE__ */ Z(Ue, {
631
631
  open: r,
632
632
  onClose: () => i(!1),
633
633
  onPick: (e, { contentType: n } = {}) => {
634
634
  if (a) {
635
- t({ svgSrc: tt(e) });
635
+ t({ svgSrc: rt(e) });
636
636
  return;
637
637
  }
638
638
  t({
639
- src: tt(e),
640
- srcType: We(n) ? "video" : "image"
639
+ src: rt(e),
640
+ srcType: Ge(n) ? "video" : "image"
641
641
  });
642
642
  },
643
643
  accept: a ? "svg" : "all"
@@ -646,7 +646,7 @@ function zt(e) {
646
646
  openLibrary: () => i(!0),
647
647
  openUpload: () => n.current?.click(),
648
648
  openCamera: () => {
649
- Ge(e.id).then(() => t({
649
+ Ke(e.id).then(() => t({
650
650
  src: null,
651
651
  srcType: "webcam"
652
652
  })).catch(() => {});
@@ -667,8 +667,8 @@ function zt(e) {
667
667
  label: "Camera"
668
668
  }
669
669
  ].slice(0, 2);
670
- function Bt({ layer: e }) {
671
- let t = zt(e);
670
+ function Vt({ layer: e }) {
671
+ let t = Bt(e);
672
672
  return /* @__PURE__ */ Q("div", {
673
673
  className: "flex flex-col gap-2",
674
674
  children: [
@@ -703,8 +703,8 @@ function Bt({ layer: e }) {
703
703
  ]
704
704
  });
705
705
  }
706
- function Vt({ layer: e, title: t, onBack: n }) {
707
- return we(n), /* @__PURE__ */ Z("div", {
706
+ function Ht({ layer: e, title: t, onBack: n }) {
707
+ return Ae(n), /* @__PURE__ */ Z("div", {
708
708
  className: "fixed inset-y-0 right-0 left-[var(--fxr-rail,0px)] kol-overlay-scrim flex flex-col items-center overflow-y-auto p-6",
709
709
  style: { zIndex: "var(--kol-z-modal)" },
710
710
  children: /* @__PURE__ */ Q("div", {
@@ -721,7 +721,7 @@ function Vt({ layer: e, title: t, onBack: n }) {
721
721
  children: "Pick the media it works on."
722
722
  })]
723
723
  }),
724
- /* @__PURE__ */ Z(Bt, { layer: e }),
724
+ /* @__PURE__ */ Z(Vt, { layer: e }),
725
725
  /* @__PURE__ */ Z(K, {
726
726
  tone: "grey",
727
727
  size: "lg",
@@ -737,13 +737,13 @@ function Vt({ layer: e, title: t, onBack: n }) {
737
737
  }
738
738
  //#endregion
739
739
  //#region src/editor/components/PanelHeader.jsx
740
- function Ht({ title: e, onCollapse: t, action: n, className: r = "px-3" }) {
740
+ function Ut({ title: e, onCollapse: t, action: n, className: r = "px-3" }) {
741
741
  return /* @__PURE__ */ Q("div", {
742
742
  className: `flex w-full shrink-0 items-center ${r}`,
743
743
  children: [/* @__PURE__ */ Q("button", {
744
744
  className: "kol-helper-12 text-meta flex flex-1 items-center gap-2 py-2.5",
745
745
  onClick: t,
746
- children: [/* @__PURE__ */ Z("span", { children: e }), /* @__PURE__ */ Z(Ct, {
746
+ children: [/* @__PURE__ */ Z("span", { children: e }), /* @__PURE__ */ Z(wt, {
747
747
  name: "chevron-down",
748
748
  size: 16,
749
749
  className: "text-oq-48"
@@ -751,7 +751,7 @@ function Ht({ title: e, onCollapse: t, action: n, className: r = "px-3" }) {
751
751
  }), n]
752
752
  });
753
753
  }
754
- function Ut({ label: e, onOpen: t, size: n = "lg", tone: r = "primary", children: i }) {
754
+ function Wt({ label: e, onOpen: t, size: n = "lg", tone: r = "primary", children: i }) {
755
755
  return /* @__PURE__ */ Q("div", {
756
756
  className: "pointer-events-none fixed bottom-[max(0.75rem,env(safe-area-inset-bottom))] left-[var(--fxr-rail,0px)] right-0 z-10 flex flex-wrap-reverse gap-2 px-3 [&>*]:pointer-events-auto",
757
757
  children: [/* @__PURE__ */ Z(K, {
@@ -760,7 +760,7 @@ function Ut({ label: e, onOpen: t, size: n = "lg", tone: r = "primary", children
760
760
  onClick: t,
761
761
  children: /* @__PURE__ */ Q("span", {
762
762
  className: "flex items-center gap-2",
763
- children: [e, /* @__PURE__ */ Z(Ct, {
763
+ children: [e, /* @__PURE__ */ Z(wt, {
764
764
  name: "chevron-down",
765
765
  size: 16,
766
766
  className: "rotate-180"
@@ -769,11 +769,11 @@ function Ut({ label: e, onOpen: t, size: n = "lg", tone: r = "primary", children
769
769
  }), i]
770
770
  });
771
771
  }
772
- var Wt = {
772
+ var Gt = {
773
773
  half: "50dvh",
774
774
  tall: "85dvh"
775
775
  };
776
- function Gt({ tall: e, onToggle: t, onDrag: n }) {
776
+ function Kt({ tall: e, onToggle: t, onDrag: n }) {
777
777
  let r = Y({
778
778
  y: null,
779
779
  moved: !1,
@@ -810,9 +810,9 @@ function Gt({ tall: e, onToggle: t, onDrag: n }) {
810
810
  }
811
811
  //#endregion
812
812
  //#region src/editor/labs/LabsCatalogCard.jsx
813
- function Kt({ onPicked: e, onClose: t }) {
814
- let { items: n, dispatch: r } = qe(), [i, a] = X(null);
815
- we(t);
813
+ function qt({ onPicked: e, onClose: t }) {
814
+ let { items: n, dispatch: r } = Je(), [i, a] = X(null);
815
+ Ae(t);
816
816
  let o = n.filter((e) => e.path !== "#rail/sec:modulation"), s = o.find((e) => e.path === i) ?? null, c = s ? s.sub : o;
817
817
  return /* @__PURE__ */ Z("div", {
818
818
  className: "fixed inset-y-0 right-0 left-[var(--fxr-rail,0px)] kol-overlay-scrim flex flex-col items-center overflow-y-auto p-6",
@@ -854,7 +854,7 @@ function Kt({ onPicked: e, onClose: t }) {
854
854
  }
855
855
  //#endregion
856
856
  //#region src/editor/labs/sheetLabels.js
857
- function qt(e) {
857
+ function Jt(e) {
858
858
  if (!e) return {
859
859
  title: "Labs",
860
860
  pill: "Labs"
@@ -878,15 +878,15 @@ function qt(e) {
878
878
  }
879
879
  //#endregion
880
880
  //#region src/editor/labs/LabsView.jsx
881
- var Jt = .85, Yt = .3, Xt = 2.5, Zt = {
881
+ var Yt = .85, Xt = .3, Zt = 2.5, Qt = {
882
882
  0: 1,
883
883
  1: .5,
884
884
  2: 1,
885
885
  3: 1.5,
886
886
  4: 2
887
- }, Qt = "px-2 py-1 rounded border border-oq-08 bg-surface-secondary kol-mono-12 text-emphasis tabular-nums";
888
- function $t() {
889
- let { layer: e } = $(), { removeLayer: t } = u(), n = e?.type === "photo" && !e.src && e.srcType !== "webcam", [r, i] = X(1), [a, o] = X(!1), s = ve(a), c = Y(null), l = (e) => Math.min(Xt, Math.max(Yt, e)), d = (e) => i((t) => l(t * (e > 0 ? 1.25 : .8))), { tool: f } = Oe(), p = f === "orbit", m = Y(p);
887
+ }, $t = "px-2 py-1 rounded border border-oq-08 bg-surface-secondary kol-mono-12 text-emphasis tabular-nums";
888
+ function en() {
889
+ let { layer: e } = $(), { removeLayer: t } = u(), n = e?.type === "photo" && !e.src && e.srcType !== "webcam", [r, i] = X(1), [a, o] = X(!1), s = ve(a), c = Y(null), l = (e) => Math.min(Zt, Math.max(Xt, e)), d = (e) => i((t) => l(t * (e > 0 ? 1.25 : .8))), { tool: f } = ye(), p = f === "orbit", m = Y(p);
890
890
  return m.current = p, J(() => {
891
891
  let e = c.current;
892
892
  if (!e) return;
@@ -911,7 +911,7 @@ function $t() {
911
911
  d(1);
912
912
  return;
913
913
  }
914
- Zt[e.key] !== void 0 && i(Zt[e.key]);
914
+ Qt[e.key] !== void 0 && i(Qt[e.key]);
915
915
  }
916
916
  };
917
917
  return window.addEventListener("keydown", e), () => window.removeEventListener("keydown", e);
@@ -923,22 +923,22 @@ function $t() {
923
923
  children: [
924
924
  /* @__PURE__ */ Z("div", {
925
925
  style: {
926
- width: `${r * Jt * 100}%`,
927
- height: `${r * Jt * 100}%`
926
+ width: `${r * Yt * 100}%`,
927
+ height: `${r * Yt * 100}%`
928
928
  },
929
- children: /* @__PURE__ */ Z(ze, {})
929
+ children: /* @__PURE__ */ Z(Be, {})
930
930
  }),
931
- n && /* @__PURE__ */ Z(Vt, {
931
+ n && /* @__PURE__ */ Z(Ht, {
932
932
  layer: e,
933
- title: qt(e).title,
933
+ title: Jt(e).title,
934
934
  onBack: () => t(e.id)
935
935
  }),
936
936
  a && /* @__PURE__ */ Z("div", {
937
937
  className: "absolute bottom-3 right-3 z-[3] flex items-center gap-2 [@media(pointer:coarse)]:bottom-1",
938
- children: /* @__PURE__ */ Z(vt, {
938
+ children: /* @__PURE__ */ Z(yt, {
939
939
  label: "Framerate — press F to hide",
940
940
  children: /* @__PURE__ */ Q("span", {
941
- className: Qt,
941
+ className: $t,
942
942
  children: [s, " fps"]
943
943
  })
944
944
  })
@@ -946,8 +946,8 @@ function $t() {
946
946
  ]
947
947
  });
948
948
  }
949
- function en() {
950
- let e = Y(null), { grabProps: t } = wt(e, {
949
+ function tn() {
950
+ let e = Y(null), { grabProps: t } = Tt(e, {
951
951
  token: "kol-rail",
952
952
  side: "right"
953
953
  });
@@ -993,28 +993,28 @@ function en() {
993
993
  className: "kol-compose-rail kol-compose-rail--inspector",
994
994
  children: [/* @__PURE__ */ Z("div", { ...t }), /* @__PURE__ */ Z("div", {
995
995
  className: "kol-compose-inspector-body",
996
- children: /* @__PURE__ */ Z(Rt, {})
996
+ children: /* @__PURE__ */ Z(zt, {})
997
997
  })]
998
998
  });
999
999
  }
1000
- var tn = yt(null);
1001
- function nn() {
1002
- let { collapseParams: e, catalog: t, toggleCatalog: n } = xt(tn), { layer: r } = $(), i = /* @__PURE__ */ Z("button", {
1000
+ var nn = bt(null);
1001
+ function rn() {
1002
+ let { collapseParams: e, catalog: t, toggleCatalog: n } = St(nn), { layer: r } = $(), i = /* @__PURE__ */ Z("button", {
1003
1003
  className: "kol-helper-12 text-meta py-2.5",
1004
1004
  "aria-pressed": t,
1005
1005
  onClick: n,
1006
1006
  children: "Catalog"
1007
1007
  });
1008
- return /* @__PURE__ */ Z(Ht, {
1009
- title: qt(r).title,
1008
+ return /* @__PURE__ */ Z(Ut, {
1009
+ title: Jt(r).title,
1010
1010
  onCollapse: e,
1011
1011
  className: "px-4",
1012
1012
  action: i
1013
1013
  });
1014
1014
  }
1015
- function rn() {
1016
- let { tall: e, setTall: t, collapseParams: n } = xt(tn);
1017
- return /* @__PURE__ */ Z(Gt, {
1015
+ function an() {
1016
+ let { tall: e, setTall: t, collapseParams: n } = St(nn);
1017
+ return /* @__PURE__ */ Z(Kt, {
1018
1018
  tall: e,
1019
1019
  onToggle: () => t((e) => !e),
1020
1020
  onDrag: (r) => {
@@ -1022,18 +1022,18 @@ function rn() {
1022
1022
  }
1023
1023
  });
1024
1024
  }
1025
- function an() {
1025
+ function on() {
1026
1026
  return /* @__PURE__ */ Z("div", {
1027
1027
  className: "kol-compose-rail kol-compose-rail--inspector",
1028
1028
  children: /* @__PURE__ */ Z("div", {
1029
1029
  className: "kol-compose-inspector-body",
1030
- children: /* @__PURE__ */ Z(Rt, {})
1030
+ children: /* @__PURE__ */ Z(zt, {})
1031
1031
  })
1032
1032
  });
1033
1033
  }
1034
- var on = {
1034
+ var sn = {
1035
1035
  topbar: () => null,
1036
- canvas: $t,
1036
+ canvas: en,
1037
1037
  panels: [
1038
1038
  {
1039
1039
  slot: "canvas.footer",
@@ -1043,35 +1043,35 @@ var on = {
1043
1043
  {
1044
1044
  slot: "right.body",
1045
1045
  order: 0,
1046
- Component: en
1046
+ Component: tn
1047
1047
  },
1048
1048
  {
1049
1049
  slot: "right.footer",
1050
1050
  order: 0,
1051
- Component: Xe
1051
+ Component: Qe
1052
1052
  }
1053
1053
  ]
1054
- }, sn = {
1055
- ...on,
1054
+ }, cn = {
1055
+ ...sn,
1056
1056
  panels: [
1057
1057
  {
1058
1058
  slot: "right.header",
1059
1059
  order: 0,
1060
- Component: rn
1060
+ Component: an
1061
1061
  },
1062
1062
  {
1063
1063
  slot: "right.header",
1064
1064
  order: 1,
1065
- Component: nn
1065
+ Component: rn
1066
1066
  },
1067
- ...on.panels.map((e) => e.Component === en ? {
1067
+ ...sn.panels.map((e) => e.Component === tn ? {
1068
1068
  ...e,
1069
- Component: an
1069
+ Component: on
1070
1070
  } : e)
1071
1071
  ]
1072
1072
  };
1073
- function cn() {
1074
- let { setAspect: e, selectedId: t, select: r } = u(), { layer: i, setOnly: a } = $(), s = Y(!1), c = Ce(Ne), l = Me() && !Se() || c;
1073
+ function ln() {
1074
+ let { setAspect: e, selectedId: t, select: r } = u(), { layer: i, setOnly: a } = $(), s = Y(!1), c = it(xe), l = Fe() && !Le() || c;
1075
1075
  J(() => {
1076
1076
  l && document.documentElement.removeAttribute("data-rail");
1077
1077
  }, [l]);
@@ -1086,7 +1086,7 @@ function cn() {
1086
1086
  return window.addEventListener("kol:open-params", e), window.addEventListener("kol:open-effects", e), () => {
1087
1087
  window.removeEventListener("kol:open-params", e), window.removeEventListener("kol:open-effects", e);
1088
1088
  };
1089
- }, [l]), De(), J(() => (st("labs"), () => st(null)), []), J(() => {
1089
+ }, [l]), De(), J(() => (tt("labs"), () => tt(null)), []), J(() => {
1090
1090
  if (s.current) return;
1091
1091
  s.current = !0;
1092
1092
  let t = v();
@@ -1099,7 +1099,7 @@ function cn() {
1099
1099
  let e = new URLSearchParams(window.location.search).get("preset"), t = e ? A(e) : null;
1100
1100
  t && a("loop", w(ne(e), t));
1101
1101
  }, [a]);
1102
- let { tool: y, setTool: b } = Oe(), x = Y(y);
1102
+ let { tool: y, setTool: b } = ye(), x = Y(y);
1103
1103
  return x.current = y, J(() => {
1104
1104
  let e = (e) => {
1105
1105
  let t = e.target;
@@ -1131,10 +1131,10 @@ function cn() {
1131
1131
  "data-touch": l || void 0,
1132
1132
  "data-params": d ? "open" : void 0,
1133
1133
  "data-empty": i ? void 0 : "",
1134
- style: p ? { "--kol-sheet-h": Wt.tall } : void 0,
1134
+ style: p ? { "--kol-sheet-h": Gt.tall } : void 0,
1135
1135
  children: [
1136
- /* @__PURE__ */ Z(Et, {}),
1137
- l ? /* @__PURE__ */ Q(tn.Provider, {
1136
+ /* @__PURE__ */ Z(Dt, {}),
1137
+ l ? /* @__PURE__ */ Q(nn.Provider, {
1138
1138
  value: {
1139
1139
  collapseParams: () => f(!1),
1140
1140
  tall: p,
@@ -1144,32 +1144,32 @@ function cn() {
1144
1144
  },
1145
1145
  children: [/* @__PURE__ */ Z(o.Provider, {
1146
1146
  value: "md",
1147
- children: /* @__PURE__ */ Z(Re, { registry: sn })
1148
- }), !d && /* @__PURE__ */ Z(Ut, {
1147
+ children: /* @__PURE__ */ Z(ze, { registry: cn })
1148
+ }), !d && /* @__PURE__ */ Z(Wt, {
1149
1149
  tone: "grey",
1150
- label: qt(i).pill,
1150
+ label: Jt(i).pill,
1151
1151
  onOpen: () => f(!0)
1152
1152
  })]
1153
- }) : /* @__PURE__ */ Z(Re, { registry: on }),
1154
- h && /* @__PURE__ */ Z(Kt, {
1153
+ }) : /* @__PURE__ */ Z(ze, { registry: sn }),
1154
+ h && /* @__PURE__ */ Z(qt, {
1155
1155
  onPicked: () => g(!1),
1156
1156
  onClose: () => g(!1)
1157
1157
  })
1158
1158
  ]
1159
1159
  });
1160
1160
  }
1161
- var ln = "kol.editor.labs-draft";
1162
- function un() {
1163
- return /* @__PURE__ */ Z(Ve, {
1164
- draftKey: ln,
1165
- children: /* @__PURE__ */ Z(cn, {})
1161
+ var un = "kol.editor.labs-draft";
1162
+ function dn() {
1163
+ return /* @__PURE__ */ Z(He, {
1164
+ draftKey: un,
1165
+ children: /* @__PURE__ */ Z(ln, {})
1166
1166
  });
1167
1167
  }
1168
1168
  //#endregion
1169
1169
  //#region src/editor/mobile/EffectScreen.jsx
1170
- function dn({ layer: e, chain: t, onPick: n, onBack: r }) {
1170
+ function fn({ layer: e, chain: t, onPick: n, onBack: r }) {
1171
1171
  let [i, a] = X(null);
1172
- we(r);
1172
+ Ae(r);
1173
1173
  let { engineHost: o } = L(e), s = o && !t.some((e) => e.def?.kind === "engine"), c = F(I.filter((e) => e.kind !== "engine" || s)), l = c.find((e) => e.id === i) ?? null;
1174
1174
  return /* @__PURE__ */ Z("div", {
1175
1175
  className: "fixed inset-y-0 right-0 left-[var(--fxr-rail,0px)] kol-overlay-scrim flex flex-col items-center overflow-y-auto p-6",
@@ -1209,7 +1209,7 @@ function dn({ layer: e, chain: t, onPick: n, onBack: r }) {
1209
1209
  }
1210
1210
  //#endregion
1211
1211
  //#region src/editor/mobile/MobileOverlay.jsx
1212
- var fn = { background: "var(--kol-surface-primary)" }, pn = [
1212
+ var pn = { background: "var(--kol-surface-primary)" }, mn = [
1213
1213
  {
1214
1214
  value: "generate",
1215
1215
  label: "Generate"
@@ -1226,29 +1226,29 @@ var fn = { background: "var(--kol-surface-primary)" }, pn = [
1226
1226
  value: "output",
1227
1227
  label: "Output"
1228
1228
  }
1229
- ], mn = pn.filter((e) => e.value !== "generate"), hn = "[&_.kol-seg-cell]:min-w-0 [&_.kol-seg-cell]:px-1 [&_.kol-seg-cell]:overflow-hidden [@media(hover:none)]:[&_.kol-seg-cell:hover]:text-[var(--kol-oq-48)]", gn = {
1229
+ ], hn = mn.filter((e) => e.value !== "generate"), gn = "[&_.kol-seg-cell]:min-w-0 [&_.kol-seg-cell]:px-1 [&_.kol-seg-cell]:overflow-hidden [@media(hover:none)]:[&_.kol-seg-cell:hover]:text-[var(--kol-oq-48)]", _n = {
1230
1230
  lg: 9.6,
1231
1231
  sm: 7.2
1232
- }, _n = 10, vn = 232;
1233
- function yn(e, t) {
1234
- let n = t === "sm" ? vn : Math.min(window.innerWidth, 480) - 24, r = [], i = [], a = 0;
1232
+ }, vn = 10, yn = 232;
1233
+ function bn(e, t) {
1234
+ let n = t === "sm" ? yn : Math.min(window.innerWidth, 480) - 24, r = [], i = [], a = 0;
1235
1235
  for (let o of e) {
1236
- let e = o.label.length * gn[t] + _n, s = Math.max(a, e);
1236
+ let e = o.label.length * _n[t] + vn, s = Math.max(a, e);
1237
1237
  i.length && (i.length + 1) * s > n ? (r.push(i), i = [o], a = e) : (i.push(o), a = s);
1238
1238
  }
1239
1239
  return i.length && r.push(i), r;
1240
1240
  }
1241
- function bn({ cells: e, size: t }) {
1242
- return yn(e, t).map((e, n) => /* @__PURE__ */ Z(q, {
1241
+ function xn({ cells: e, size: t }) {
1242
+ return bn(e, t).map((e, n) => /* @__PURE__ */ Z(q, {
1243
1243
  value: null,
1244
1244
  onChange: (t) => e.find((e) => e.value === t)?.run(),
1245
1245
  options: e,
1246
1246
  size: t,
1247
1247
  ariaLabel: "Randomize scope",
1248
- className: hn
1248
+ className: gn
1249
1249
  }, n));
1250
1250
  }
1251
- var xn = [
1251
+ var Sn = [
1252
1252
  2,
1253
1253
  4,
1254
1254
  8,
@@ -1257,17 +1257,17 @@ var xn = [
1257
1257
  value: String(e),
1258
1258
  label: `${e}s`
1259
1259
  }));
1260
- function Sn({ size: e }) {
1260
+ function Cn({ size: e }) {
1261
1261
  let { loopSeconds: t, setLoopSeconds: n } = C();
1262
1262
  return /* @__PURE__ */ Z(q, {
1263
1263
  value: String(t),
1264
1264
  onChange: (e) => n(Number(e)),
1265
- options: xn,
1265
+ options: Sn,
1266
1266
  size: e,
1267
1267
  ariaLabel: "Loop length"
1268
1268
  });
1269
1269
  }
1270
- var Cn = [
1270
+ var wn = [
1271
1271
  {
1272
1272
  value: "9:16",
1273
1273
  label: "9:16"
@@ -1284,7 +1284,7 @@ var Cn = [
1284
1284
  value: "1:1",
1285
1285
  label: "1:1"
1286
1286
  }
1287
- ], wn = [
1287
+ ], Tn = [
1288
1288
  {
1289
1289
  value: "5:4",
1290
1290
  label: "5:4"
@@ -1302,14 +1302,14 @@ var Cn = [
1302
1302
  label: "Fill"
1303
1303
  }
1304
1304
  ];
1305
- function Tn({ layer: e, onSwitchCategory: r, onInsert: a, onRestart: o, aspectValue: l, onAspect: d, openEffects: f = !1, rail: h = !1, onRail: v, onSheet: y }) {
1306
- let { updateLayer: b, addFilter: x, removeFilter: ee } = u(), { onExportPng: S } = dt(), [C, ne] = X(!1), [w, T] = X(!0), [E, D] = X(!1), [O, k] = X(!1), [A, j] = X("generate"), [M, N] = X(!1), P = s(e);
1305
+ function En({ layer: e, onSwitchCategory: r, onInsert: a, onRestart: o, aspectValue: l, onAspect: d, openEffects: f = !1, rail: h = !1, onRail: v, onSheet: y }) {
1306
+ let { updateLayer: b, addFilter: x, removeFilter: ee } = u(), { onExportPng: S } = pt(), [C, ne] = X(!1), [w, T] = X(!0), [E, D] = X(!1), [O, k] = X(!1), [A, j] = X("generate"), [M, N] = X(!1), P = s(e);
1307
1307
  J(() => {
1308
1308
  f && (T(!0), k(!0));
1309
1309
  }, [f]);
1310
1310
  let F = h ? "sm" : "lg", I = h && !!e && w && !C;
1311
1311
  J(() => (v?.(I), () => v?.(!1)), [I]);
1312
- let ie = !h && e && w && !C ? M ? Wt.tall : Wt.half : null;
1312
+ let ie = !h && e && w && !C ? M ? Gt.tall : Gt.half : null;
1313
1313
  if (J(() => (y?.(ie), () => y?.(null)), [ie]), !e) return null;
1314
1314
  if (C) return /* @__PURE__ */ Z("button", {
1315
1315
  "aria-label": "Show controls",
@@ -1323,7 +1323,7 @@ function Tn({ layer: e, onSwitchCategory: r, onInsert: a, onRestart: o, aspectVa
1323
1323
  let t = _(e, P.take());
1324
1324
  t && b(e.id, { filters: t });
1325
1325
  };
1326
- if (!w) return /* @__PURE__ */ Q(Ut, {
1326
+ if (!w) return /* @__PURE__ */ Q(Wt, {
1327
1327
  label: R ? e.presetLabel : "Media",
1328
1328
  onOpen: () => T(!0),
1329
1329
  size: F,
@@ -1339,9 +1339,9 @@ function Tn({ layer: e, onSwitchCategory: r, onInsert: a, onRestart: o, aspectVa
1339
1339
  children: "Download"
1340
1340
  })]
1341
1341
  });
1342
- let ue = (R ? pn : mn).filter((e) => (e.value !== "effects" || le) && (e.value !== "transport" || g("motion"))), U = ue.some((e) => e.value === A) ? A : ue[0].value;
1343
- return /* @__PURE__ */ Q(St, { children: [
1344
- E && /* @__PURE__ */ Z(ye, {
1342
+ let ue = (R ? mn : hn).filter((e) => (e.value !== "effects" || le) && (e.value !== "transport" || g("motion"))), U = ue.some((e) => e.value === A) ? A : ue[0].value;
1343
+ return /* @__PURE__ */ Q(Ct, { children: [
1344
+ E && /* @__PURE__ */ Z(Se, {
1345
1345
  onPick: (e) => {
1346
1346
  r(e), D(!1);
1347
1347
  },
@@ -1353,7 +1353,7 @@ function Tn({ layer: e, onSwitchCategory: r, onInsert: a, onRestart: o, aspectVa
1353
1353
  },
1354
1354
  onDismiss: () => D(!1)
1355
1355
  }),
1356
- O && /* @__PURE__ */ Z(dn, {
1356
+ O && /* @__PURE__ */ Z(fn, {
1357
1357
  layer: e,
1358
1358
  chain: V,
1359
1359
  onPick: (t) => {
@@ -1363,19 +1363,19 @@ function Tn({ layer: e, onSwitchCategory: r, onInsert: a, onRestart: o, aspectVa
1363
1363
  }),
1364
1364
  /* @__PURE__ */ Q("div", {
1365
1365
  className: h ? "fixed top-0 right-0 bottom-0 z-10 flex w-[var(--kol-sidenav-w,320px)] flex-col overflow-y-auto border-l border-oq-08" : "fixed right-0 left-[var(--fxr-rail,0px)] bottom-0 z-10 flex flex-col pb-[env(safe-area-inset-bottom)]",
1366
- style: h ? fn : {
1367
- ...fn,
1368
- top: `calc(100dvh - ${ie ?? Wt.half})`
1366
+ style: h ? pn : {
1367
+ ...pn,
1368
+ top: `calc(100dvh - ${ie ?? Gt.half})`
1369
1369
  },
1370
1370
  children: [
1371
- !h && /* @__PURE__ */ Z(Gt, {
1371
+ !h && /* @__PURE__ */ Z(Kt, {
1372
1372
  tall: M,
1373
1373
  onToggle: () => N((e) => !e),
1374
1374
  onDrag: (e) => {
1375
1375
  e < 0 ? N(!0) : M ? N(!1) : T(!1);
1376
1376
  }
1377
1377
  }),
1378
- /* @__PURE__ */ Z(Ht, {
1378
+ /* @__PURE__ */ Z(Ut, {
1379
1379
  title: ae,
1380
1380
  onCollapse: () => T(!1),
1381
1381
  className: h ? "px-4 pt-2.5 pb-1.5" : "px-3",
@@ -1393,7 +1393,7 @@ function Tn({ layer: e, onSwitchCategory: r, onInsert: a, onRestart: o, aspectVa
1393
1393
  onChange: j,
1394
1394
  options: ue,
1395
1395
  size: F,
1396
- className: h ? hn : "[&_.kol-seg-cell]:min-w-0 [&_.kol-seg-cell]:px-2 [&_.kol-seg-cell]:overflow-hidden"
1396
+ className: h ? gn : "[&_.kol-seg-cell]:min-w-0 [&_.kol-seg-cell]:px-2 [&_.kol-seg-cell]:overflow-hidden"
1397
1397
  }),
1398
1398
  U === "generate" && R && /* @__PURE__ */ Q("div", {
1399
1399
  className: "flex flex-col gap-2 pt-3",
@@ -1420,7 +1420,7 @@ function Tn({ layer: e, onSwitchCategory: r, onInsert: a, onRestart: o, aspectVa
1420
1420
  onClick: se,
1421
1421
  children: "Randomize all"
1422
1422
  }),
1423
- oe.length > 0 && /* @__PURE__ */ Z(bn, {
1423
+ oe.length > 0 && /* @__PURE__ */ Z(xn, {
1424
1424
  size: F,
1425
1425
  cells: [...oe.map((e) => ({
1426
1426
  value: e.id,
@@ -1475,7 +1475,7 @@ function Tn({ layer: e, onSwitchCategory: r, onInsert: a, onRestart: o, aspectVa
1475
1475
  iconRight: "trash",
1476
1476
  onClick: () => ee(e.id, n),
1477
1477
  children: `${n + 1}. ${t.def?.label ?? t.id}`
1478
- }), a.length > 0 && /* @__PURE__ */ Z(bn, {
1478
+ }), a.length > 0 && /* @__PURE__ */ Z(xn, {
1479
1479
  size: F,
1480
1480
  cells: a.map((e) => ({
1481
1481
  value: e.id,
@@ -1491,7 +1491,7 @@ function Tn({ layer: e, onSwitchCategory: r, onInsert: a, onRestart: o, aspectVa
1491
1491
  children: [(() => {
1492
1492
  let e = g("motion").TransportBar;
1493
1493
  return /* @__PURE__ */ Z(e, { size: F });
1494
- })(), /* @__PURE__ */ Z(Sn, { size: F })]
1494
+ })(), /* @__PURE__ */ Z(Cn, { size: F })]
1495
1495
  }),
1496
1496
  U === "output" && /* @__PURE__ */ Q("div", {
1497
1497
  className: "flex flex-col gap-2 pt-3",
@@ -1499,14 +1499,14 @@ function Tn({ layer: e, onSwitchCategory: r, onInsert: a, onRestart: o, aspectVa
1499
1499
  /* @__PURE__ */ Z(q, {
1500
1500
  value: l,
1501
1501
  onChange: d,
1502
- options: Cn,
1502
+ options: wn,
1503
1503
  size: F,
1504
1504
  ariaLabel: "Aspect"
1505
1505
  }),
1506
1506
  /* @__PURE__ */ Z(q, {
1507
1507
  value: l,
1508
1508
  onChange: d,
1509
- options: wn,
1509
+ options: Tn,
1510
1510
  size: F,
1511
1511
  ariaLabel: "Aspect (landscape) and fill"
1512
1512
  }),
@@ -1543,7 +1543,7 @@ function Tn({ layer: e, onSwitchCategory: r, onInsert: a, onRestart: o, aspectVa
1543
1543
  }
1544
1544
  //#endregion
1545
1545
  //#region src/editor/mobile/MobileView.jsx
1546
- function En({ onGenerate: e, onEffects: t, chromes: n }) {
1546
+ function Dn({ onGenerate: e, onEffects: t, chromes: n }) {
1547
1547
  return /* @__PURE__ */ Z("div", {
1548
1548
  className: "fixed inset-y-0 right-0 left-[var(--fxr-rail,0px)] kol-overlay-scrim flex flex-col items-center justify-center p-6",
1549
1549
  style: { zIndex: "var(--kol-z-modal)" },
@@ -1561,7 +1561,7 @@ function En({ onGenerate: e, onEffects: t, chromes: n }) {
1561
1561
  })]
1562
1562
  }) : /* @__PURE__ */ Z("span", {
1563
1563
  className: "kol-eyebrow text-body",
1564
- children: pe("randomiser").label
1564
+ children: We("randomiser").label
1565
1565
  }), /* @__PURE__ */ Q("div", {
1566
1566
  className: "flex flex-col gap-2",
1567
1567
  children: [
@@ -1583,14 +1583,14 @@ function En({ onGenerate: e, onEffects: t, chromes: n }) {
1583
1583
  onClick: t,
1584
1584
  children: "Effects"
1585
1585
  }),
1586
- n && Pe() && /* @__PURE__ */ Z(K, {
1586
+ n && be() && /* @__PURE__ */ Z(K, {
1587
1587
  tone: "primary",
1588
1588
  size: "lg",
1589
1589
  className: "w-full [&>span]:w-full [&>span]:justify-between",
1590
1590
  iconLeft: G.editor,
1591
1591
  iconRight: G.editor,
1592
- onClick: xe,
1593
- children: pe("editor").label
1592
+ onClick: Ne,
1593
+ children: We("editor").label
1594
1594
  }),
1595
1595
  n && /* @__PURE__ */ Z(K, {
1596
1596
  tone: "primary",
@@ -1598,16 +1598,16 @@ function En({ onGenerate: e, onEffects: t, chromes: n }) {
1598
1598
  className: "w-full [&>span]:w-full [&>span]:justify-between",
1599
1599
  iconLeft: G.labs,
1600
1600
  iconRight: G.labs,
1601
- onClick: ke,
1602
- children: pe("labs").label
1601
+ onClick: pe,
1602
+ children: We("labs").label
1603
1603
  })
1604
1604
  ]
1605
1605
  })]
1606
1606
  })
1607
1607
  });
1608
1608
  }
1609
- function Dn() {
1610
- let { layers: e, addLayer: t, removeLayer: r, updateLayer: i, canvasW: a, canvasH: o, aspect: s, setAspect: c } = u(), { setTool: l } = Oe(), d = Me() && !Se(), f = nt(), p = () => "entry", [m, h] = X(p), [g, _] = X(!1), [v, y] = X(null), [b, S] = X("contain"), [C, te] = X(!1), [ne, w] = X(null), [E, O] = X(1), k = Y({
1609
+ function On() {
1610
+ let { layers: e, addLayer: t, removeLayer: r, updateLayer: i, canvasW: a, canvasH: o, aspect: s, setAspect: c } = u(), { setTool: l } = ye(), d = Fe() && !Le(), f = Ce(), p = () => "entry", [m, h] = X(p), [g, _] = X(!1), [v, y] = X(null), [b, S] = X("contain"), [C, te] = X(!1), [ne, w] = X(null), [E, O] = X(1), k = Y({
1611
1611
  pts: /* @__PURE__ */ new Map(),
1612
1612
  startDist: 0,
1613
1613
  startScale: 1
@@ -1638,7 +1638,7 @@ function Dn() {
1638
1638
  }
1639
1639
  t?.id === e.pointerId && (A.current = null), k.current.pts.delete(e.pointerId), k.current.pts.size < 2 && (k.current.startDist = 0);
1640
1640
  };
1641
- Tt(), J(() => (st("randomiser"), () => st(null)), []), J(() => {
1641
+ Et(), J(() => (tt("randomiser"), () => tt(null)), []), J(() => {
1642
1642
  c("4:5"), l("orbit");
1643
1643
  }, []);
1644
1644
  let F = e.find((e) => e.id === v) ?? (e.length === 1 ? e[0] : null), I = m === "live" && F?.type === "photo" && !F.src && F.srcType !== "webcam";
@@ -1701,21 +1701,21 @@ function Dn() {
1701
1701
  onPointerUpCapture: P,
1702
1702
  onPointerCancelCapture: P,
1703
1703
  onPointerLeave: P,
1704
- children: /* @__PURE__ */ Z(et, { fit: b })
1704
+ children: /* @__PURE__ */ Z(nt, { fit: b })
1705
1705
  }),
1706
- m === "entry" && /* @__PURE__ */ Z(En, {
1706
+ m === "entry" && /* @__PURE__ */ Z(Dn, {
1707
1707
  chromes: d,
1708
1708
  onGenerate: () => h("category"),
1709
1709
  onEffects: () => {
1710
1710
  _(!0), R();
1711
1711
  }
1712
1712
  }),
1713
- m === "category" && /* @__PURE__ */ Z(ye, {
1713
+ m === "category" && /* @__PURE__ */ Z(Se, {
1714
1714
  onPick: L,
1715
1715
  onInsert: R,
1716
1716
  onBack: () => h("entry")
1717
1717
  }),
1718
- m === "live" && !I && /* @__PURE__ */ Z(Tn, {
1718
+ m === "live" && !I && /* @__PURE__ */ Z(En, {
1719
1719
  layer: F,
1720
1720
  onSwitchCategory: ie,
1721
1721
  onInsert: () => {
@@ -1734,7 +1734,7 @@ function Dn() {
1734
1734
  style: { zIndex: "var(--kol-z-modal)" },
1735
1735
  children: [/* @__PURE__ */ Z("div", {
1736
1736
  className: "flex-1 min-h-0",
1737
- children: /* @__PURE__ */ Z(Bt, { layer: F })
1737
+ children: /* @__PURE__ */ Z(Vt, { layer: F })
1738
1738
  }), /* @__PURE__ */ Z("div", {
1739
1739
  className: "flex justify-center pb-[max(0.75rem,env(safe-area-inset-bottom))]",
1740
1740
  children: /* @__PURE__ */ Z(K, {
@@ -1748,11 +1748,11 @@ function Dn() {
1748
1748
  ]
1749
1749
  });
1750
1750
  }
1751
- function On() {
1752
- return /* @__PURE__ */ Z(Ve, {
1751
+ function kn() {
1752
+ return /* @__PURE__ */ Z(He, {
1753
1753
  persistDraft: !1,
1754
- children: /* @__PURE__ */ Z(Dn, {})
1754
+ children: /* @__PURE__ */ Z(On, {})
1755
1755
  });
1756
1756
  }
1757
1757
  //#endregion
1758
- export { lt as AppSettingsSections, _e as BRAND, ot as DesignEditor, ot as default, ft as DisplaySettingsDrawer, Ve as EditorProviders, je as FilesDialog, Je as GeneratorLibraryProvider, ln as LABS_DRAFT_KEY, Te as LIBRARY_SLOT_KEYS, un as LabsView, Ie as MODES, On as MobileView, ze as OutputCanvas, et as OutputStage, at as OutputView, Qe as RAIL_EXTRA_PREFIX, Fe as VIEW_PATHS, Ae as closeFiles, Ye as comboLabel, Le as currentView, Me as isMobileDevice, ge as openFiles, f as registerPack, Ze as setMediaClient, Ke as setMediaProxyBase, Ue as setMode, $e as setNavigator, rt as setRailExtras, a as setSettingsStore, be as setWantsDesktop, me as shortcutsBySection, ut as useFilesDialog, Ee as useGeneratorLibrary, qe as useRailExtras, Be as useSettingsSections, Se as wantsDesktop, it as withView };
1758
+ export { dt as AppSettingsSections, _e as BRAND, ct as DesignEditor, ct as default, mt as DisplaySettingsDrawer, He as EditorProviders, Me as FilesDialog, Xe as GeneratorLibraryProvider, un as LABS_DRAFT_KEY, Te as LIBRARY_SLOT_KEYS, dn as LabsView, Ie as MODES, kn as MobileView, Be as OutputCanvas, nt as OutputStage, st as OutputView, et as RAIL_EXTRA_PREFIX, Re as VIEW_PATHS, je as closeFiles, Ze as comboLabel, ke as currentView, Fe as isMobileDevice, Ee as loadLibrary, ge as openFiles, f as registerPack, $e as setMediaClient, qe as setMediaProxyBase, lt as setMode, ot as setNavigator, at as setRailExtras, a as setSettingsStore, we as setWantsDesktop, me as shortcutsBySection, ft as useFilesDialog, Oe as useGeneratorLibrary, Je as useRailExtras, Ve as useSettingsSections, Le as wantsDesktop, Ye as withView };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kolkrabbi/design-editor",
3
- "version": "0.21.0",
3
+ "version": "0.22.0",
4
4
  "private": false,
5
5
  "description": "The design editor as one component",
6
6
  "license": "MIT",
@@ -59,12 +59,12 @@
59
59
  "tailwindcss": "^4.2.4",
60
60
  "vite": "^8.0.10",
61
61
  "vite-plugin-svgr": "^5.2.0",
62
- "@kolkrabbi/kol-component": "0.240.0",
63
62
  "@kolkrabbi/kol-framework": "0.49.0",
64
- "@kolkrabbi/kol-media-client": "0.4.1",
65
63
  "@kolkrabbi/kol-shell": "0.62.0",
66
64
  "@kolkrabbi/kol-theme": "0.166.0",
67
- "@kolkrabbi/kol-icons": "0.33.1"
65
+ "@kolkrabbi/kol-media-client": "0.4.1",
66
+ "@kolkrabbi/kol-icons": "0.33.1",
67
+ "@kolkrabbi/kol-component": "0.240.0"
68
68
  },
69
69
  "keywords": [
70
70
  "kol",