@kolkrabbi/design-editor 0.23.0 → 0.24.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,10 +1,10 @@
1
- import { A as e, Ft as t, It as n, Qt as r, S as i, an as a, c as o, cn as s, ct as c, dn as l, dt as u, en as d, f, ft as p, in as m, j as h, l as g, ln as _, lt as v, m as y, mn as b, nn as x, on as S, rn as C, t as ee, ut as te, y as ne, zt as w } from "./rolls-Bg1XHuvJ.js";
1
+ import { A as e, Ft as t, It as n, Qt as r, S as i, an as a, c as o, cn as s, ct as c, dn as l, dt as u, en as d, f, ft as p, in as m, j as h, l as g, ln as _, lt as v, m as y, mn as b, nn as x, on as S, rn as C, t as ee, ut as te, y as w, zt as ne } from "./rolls-Bg1XHuvJ.js";
2
2
  import { r as T } from "./TreePicker-DLmMl0aU.js";
3
3
  import { a as E, c as re, d as D, f as O, i as ie, l as ae, o as k, p as A, r as j, s as oe, t as se, u as ce } from "./labels-B5qkocWy.js";
4
- import { Button as M, Dropdown as le, Input as ue, LabeledControl as N, MenuDropdownItem as de, PopoverPanel as fe, SegmentedToggle as pe, Slider as me, Textarea as he, TimelineDock as ge, ToggleCheckbox as _e, Tooltip as P, ViewToggle as ve, glyphSize as ye, usePopover as F } from "@kolkrabbi/kol-component";
5
- import { Fragment as be, useEffect as xe, useMemo as Se, useRef as Ce, useState as I } from "react";
6
- import { Fragment as we, jsx as L, jsxs as R } from "react/jsx-runtime";
7
- import { Icon as z } from "@kolkrabbi/kol-icons";
4
+ import { Button as M, Dropdown as le, Input as ue, LabeledControl as N, MenuRow as de, PopoverPanel as fe, SegmentedToggle as P, Slider as pe, Textarea as me, TimelineDock as he, ToggleCheckbox as ge, Tooltip as F, ViewToggle as _e, glyphSize as ve, usePopover as I } from "@kolkrabbi/kol-component";
5
+ import { Fragment as ye, useEffect as be, useMemo as xe, useRef as Se, useState as L } from "react";
6
+ import { Fragment as Ce, jsx as R, jsxs as z } from "react/jsx-runtime";
7
+ import { Icon as we } from "@kolkrabbi/kol-icons";
8
8
  //#region src/kinetic/animations.js
9
9
  var B = {
10
10
  dLen: 0,
@@ -437,8 +437,8 @@ var Ie = class {
437
437
  pathLen: s * _,
438
438
  nx: this.w ? h / this.w : .5,
439
439
  ny: this.h ? g / this.h : .5
440
- }, n), y = m + v.dLen / _, b = _ - v.dNormal, ee = d + Math.cos(y) * b, te = f + Math.sin(y) * b, ne = y * 180 / Math.PI + 90 + v.dRot;
441
- p.setAttribute("transform", `translate(${ee.toFixed(2)} ${te.toFixed(2)}) rotate(${ne.toFixed(2)}) scale(${(v.scale * C).toFixed(3)})`), this._styleGlyph(p, e, n, v);
440
+ }, n), y = m + v.dLen / _, b = _ - v.dNormal, ee = d + Math.cos(y) * b, te = f + Math.sin(y) * b, w = y * 180 / Math.PI + 90 + v.dRot;
441
+ p.setAttribute("transform", `translate(${ee.toFixed(2)} ${te.toFixed(2)}) rotate(${w.toFixed(2)}) scale(${(v.scale * C).toFixed(3)})`), this._styleGlyph(p, e, n, v);
442
442
  }
443
443
  }
444
444
  }
@@ -494,9 +494,9 @@ var Ie = class {
494
494
  t.pathEl.setAttribute("d", ""), t.pathEl.style.opacity = 0;
495
495
  return;
496
496
  }
497
- let C = D(s), ee = C ? Math.max(1, Math.round(e.path?.rows ?? 2)) : 1, ne = C ? Math.max(1, Math.round(e.path?.cols ?? 3)) : 1, w = C ? ee * ne : 1, T = this._ensureMorphPool(t, S, w, m);
498
- if ((x || T) && this._refreshMorphPaths(t, w, m, y), C) {
499
- t.pathEl.setAttribute("d", ""), t.pathEl.style.opacity = 0, this._placeMorphArray(e, t, a, n, ee, ne);
497
+ let C = D(s), ee = C ? Math.max(1, Math.round(e.path?.rows ?? 2)) : 1, w = C ? Math.max(1, Math.round(e.path?.cols ?? 3)) : 1, ne = C ? ee * w : 1, T = this._ensureMorphPool(t, S, ne, m);
498
+ if ((x || T) && this._refreshMorphPaths(t, ne, m, y), C) {
499
+ t.pathEl.setAttribute("d", ""), t.pathEl.style.opacity = 0, this._placeMorphArray(e, t, a, n, ee, w);
500
500
  return;
501
501
  }
502
502
  let E = ce(s, this.w, this.h, e.path || {});
@@ -1453,23 +1453,23 @@ function it({ layer: r, setProp: a, updateLayer: s, palette: c, renderAnimate: l
1453
1453
  let m = i(), h = r.comp ?? {
1454
1454
  bg: "#0b0d12",
1455
1455
  instances: []
1456
- }, _ = h.instances ?? [], [v, y] = I(0), b = Math.min(v, Math.max(0, _.length - 1)), x = (e) => {
1456
+ }, _ = h.instances ?? [], [v, y] = L(0), b = Math.min(v, Math.max(0, _.length - 1)), x = (e) => {
1457
1457
  y(e), window.dispatchEvent(new CustomEvent("kol:kinetic-element", { detail: {
1458
1458
  id: r.id,
1459
1459
  index: e,
1460
1460
  from: "panel"
1461
1461
  } }));
1462
1462
  };
1463
- xe(() => {
1463
+ be(() => {
1464
1464
  let e = (e) => {
1465
1465
  e.detail?.id === r.id && e.detail.from === "canvas" && y(e.detail.index);
1466
1466
  };
1467
1467
  return window.addEventListener("kol:kinetic-element", e), () => window.removeEventListener("kol:kinetic-element", e);
1468
1468
  }, [r.id]);
1469
- let [S, C] = I([]), te = (e) => C((t) => t.includes(e) ? t.filter((t) => t !== e) : [...t, e]), ne = (e) => {
1469
+ let [S, C] = L([]), te = (e) => C((t) => t.includes(e) ? t.filter((t) => t !== e) : [...t, e]), w = (e) => {
1470
1470
  let t = _[e]?.group;
1471
1471
  return t ? _.reduce((e, n, r) => n.group === t ? [...e, r] : e, []) : [e];
1472
- }, [w, T] = I(0), E = _[b]?.motions ?? [], D = Math.min(w, E.length), O = (e) => ({
1472
+ }, [ne, T] = L(0), E = _[b]?.motions ?? [], D = Math.min(ne, E.length), O = (e) => ({
1473
1473
  ...e,
1474
1474
  instances: (e.instances ?? []).map((e, t) => t === b ? {
1475
1475
  ...e,
@@ -1509,7 +1509,7 @@ function it({ layer: r, setProp: a, updateLayer: s, palette: c, renderAnimate: l
1509
1509
  j(b, { motions: E.map((e, t) => t === D - 1 ? n : e) });
1510
1510
  return;
1511
1511
  }
1512
- let n = ne(b);
1512
+ let n = w(b);
1513
1513
  if (n.length > 1 && tt.has(e.key)) {
1514
1514
  let r = h;
1515
1515
  if (e.key === "fontSize") {
@@ -1540,7 +1540,7 @@ function it({ layer: r, setProp: a, updateLayer: s, palette: c, renderAnimate: l
1540
1540
  comp: n,
1541
1541
  _rollSeed: e
1542
1542
  });
1543
- }, pe = (e, t) => {
1543
+ }, P = (e, t) => {
1544
1544
  let i = n(e, t);
1545
1545
  s(r.id, {
1546
1546
  themeId: e,
@@ -1554,26 +1554,26 @@ function it({ layer: r, setProp: a, updateLayer: s, palette: c, renderAnimate: l
1554
1554
  }))
1555
1555
  }
1556
1556
  });
1557
- }, me = (e) => k({
1557
+ }, pe = (e) => k({
1558
1558
  ...h,
1559
1559
  instances: _.map((t) => ({
1560
1560
  ...t,
1561
1561
  fill: e
1562
1562
  }))
1563
- }), ge = u === "labs-effect" ? "style" : u, _e = Je.filter((e) => e.tab === ge && (!e.when || e.when(ie(e), b))), ye = _.some((e) => e?.morph?.on), F = _[b];
1564
- return /* @__PURE__ */ R(we, { children: [
1565
- p && /* @__PURE__ */ L(at, {
1563
+ }), he = u === "labs-effect" ? "style" : u, ge = Je.filter((e) => e.tab === he && (!e.when || e.when(ie(e), b))), ve = _.some((e) => e?.morph?.on), I = _[b];
1564
+ return /* @__PURE__ */ z(Ce, { children: [
1565
+ p && /* @__PURE__ */ R(at, {
1566
1566
  layer: r,
1567
1567
  onPreset: ae
1568
1568
  }),
1569
- /* @__PURE__ */ R("div", {
1569
+ /* @__PURE__ */ z("div", {
1570
1570
  className: "flex flex-col gap-1",
1571
1571
  children: [
1572
- /* @__PURE__ */ L("span", {
1572
+ /* @__PURE__ */ R("span", {
1573
1573
  className: "kol-helper-10 text-meta",
1574
1574
  children: "Elements"
1575
1575
  }),
1576
- /* @__PURE__ */ L(ot, {
1576
+ /* @__PURE__ */ R(ot, {
1577
1577
  insts: _,
1578
1578
  idx: b,
1579
1579
  onSelect: x,
@@ -1583,9 +1583,9 @@ function it({ layer: r, setProp: a, updateLayer: s, palette: c, renderAnimate: l
1583
1583
  onGroup: oe,
1584
1584
  onUngroup: se
1585
1585
  }),
1586
- /* @__PURE__ */ L(P, {
1586
+ /* @__PURE__ */ R(F, {
1587
1587
  label: "Edit elements on the canvas (click to select, drag to move, corners to scale)",
1588
- children: /* @__PURE__ */ L(M, {
1588
+ children: /* @__PURE__ */ R(M, {
1589
1589
  "aria-label": "Edit elements on the canvas (click to select, drag to move, corners to scale)",
1590
1590
  tone: "primary",
1591
1591
  size: m,
@@ -1600,10 +1600,10 @@ function it({ layer: r, setProp: a, updateLayer: s, palette: c, renderAnimate: l
1600
1600
  ]
1601
1601
  }),
1602
1602
  d,
1603
- (u === "generate" || u === "labs-effect") && /* @__PURE__ */ R(we, { children: [
1604
- /* @__PURE__ */ L(N, {
1603
+ (u === "generate" || u === "labs-effect") && /* @__PURE__ */ z(Ce, { children: [
1604
+ /* @__PURE__ */ R(N, {
1605
1605
  label: "Text",
1606
- children: /* @__PURE__ */ L(he, {
1606
+ children: /* @__PURE__ */ R(me, {
1607
1607
  variant: "filled",
1608
1608
  size: m,
1609
1609
  rows: 2,
@@ -1612,21 +1612,21 @@ function it({ layer: r, setProp: a, updateLayer: s, palette: c, renderAnimate: l
1612
1612
  onChange: (e) => j(b, { text: e.target.value })
1613
1613
  })
1614
1614
  }),
1615
- /* @__PURE__ */ R("div", {
1615
+ /* @__PURE__ */ z("div", {
1616
1616
  className: "grid grid-cols-2 gap-2",
1617
- children: [/* @__PURE__ */ L(N, {
1617
+ children: [/* @__PURE__ */ R(N, {
1618
1618
  label: "Theme",
1619
- children: /* @__PURE__ */ L(le, {
1619
+ children: /* @__PURE__ */ R(le, {
1620
1620
  variant: "subtle",
1621
1621
  size: m,
1622
1622
  className: "w-full",
1623
1623
  options: t,
1624
1624
  value: r.themeId ?? "kol",
1625
- onChange: (e) => pe(e, !!r.themeInvert)
1625
+ onChange: (e) => P(e, !!r.themeInvert)
1626
1626
  })
1627
- }), /* @__PURE__ */ L(N, {
1627
+ }), /* @__PURE__ */ R(N, {
1628
1628
  label: "Invert",
1629
- children: /* @__PURE__ */ L(ve, {
1629
+ children: /* @__PURE__ */ R(_e, {
1630
1630
  options: [{
1631
1631
  value: "off",
1632
1632
  label: "Off"
@@ -1635,33 +1635,33 @@ function it({ layer: r, setProp: a, updateLayer: s, palette: c, renderAnimate: l
1635
1635
  label: "On"
1636
1636
  }],
1637
1637
  viewMode: r.themeInvert ? "on" : "off",
1638
- onViewChange: (e) => pe(r.themeId ?? "kol", e === "on")
1638
+ onViewChange: (e) => P(r.themeId ?? "kol", e === "on")
1639
1639
  })
1640
1640
  })]
1641
1641
  }),
1642
- /* @__PURE__ */ L(f, {
1642
+ /* @__PURE__ */ R(f, {
1643
1643
  label: "Text colour",
1644
1644
  value: _[0]?.fill,
1645
- onChange: (t) => me(e(t, c) ?? t),
1645
+ onChange: (t) => pe(e(t, c) ?? t),
1646
1646
  palette: c
1647
1647
  }),
1648
- /* @__PURE__ */ R("div", {
1648
+ /* @__PURE__ */ z("div", {
1649
1649
  className: "grid grid-cols-2 gap-2",
1650
- children: [/* @__PURE__ */ L(M, {
1650
+ children: [/* @__PURE__ */ R(M, {
1651
1651
  tone: "primary",
1652
1652
  size: m,
1653
1653
  onClick: de,
1654
1654
  children: "Randomise"
1655
- }), /* @__PURE__ */ L(M, {
1655
+ }), /* @__PURE__ */ R(M, {
1656
1656
  tone: "primary",
1657
1657
  size: m,
1658
1658
  onClick: fe,
1659
1659
  children: "All elements"
1660
1660
  })]
1661
1661
  }),
1662
- /* @__PURE__ */ L(ee, { seed: ue })
1662
+ /* @__PURE__ */ R(ee, { seed: ue })
1663
1663
  ] }),
1664
- u === "anim" && /* @__PURE__ */ L(ct, {
1664
+ u === "anim" && /* @__PURE__ */ R(ct, {
1665
1665
  motions: E,
1666
1666
  mIdx: D,
1667
1667
  onSelect: T,
@@ -1678,38 +1678,38 @@ function it({ layer: r, setProp: a, updateLayer: s, palette: c, renderAnimate: l
1678
1678
  } : e)), T(D - 1));
1679
1679
  }
1680
1680
  }),
1681
- u !== "generate" && _e.map((e, t) => /* @__PURE__ */ R(be, { children: [
1682
- e.key === "arrangement" && /* @__PURE__ */ R(we, { children: [/* @__PURE__ */ L("span", {
1681
+ u !== "generate" && ge.map((e, t) => /* @__PURE__ */ z(ye, { children: [
1682
+ e.key === "arrangement" && /* @__PURE__ */ z(Ce, { children: [/* @__PURE__ */ R("span", {
1683
1683
  className: "kol-helper-10 text-meta",
1684
1684
  children: "OpenType"
1685
- }), /* @__PURE__ */ L(lt, {
1686
- value: F?.opentype ?? {},
1685
+ }), /* @__PURE__ */ R(lt, {
1686
+ value: I?.opentype ?? {},
1687
1687
  onToggle: (e, t) => j(b, { opentype: {
1688
- ...F?.opentype ?? {},
1688
+ ...I?.opentype ?? {},
1689
1689
  [e]: t
1690
1690
  } })
1691
1691
  })] }),
1692
- e.section && e.section !== _e[t - 1]?.section && /* @__PURE__ */ L("span", {
1692
+ e.section && e.section !== ge[t - 1]?.section && /* @__PURE__ */ R("span", {
1693
1693
  className: "kol-helper-10 text-meta",
1694
1694
  children: e.section
1695
1695
  }),
1696
- /* @__PURE__ */ L(st, {
1696
+ /* @__PURE__ */ R(st, {
1697
1697
  knob: e,
1698
1698
  comp: ie(e),
1699
1699
  idx: b,
1700
1700
  palette: c,
1701
1701
  onWrite: ce
1702
1702
  }),
1703
- e.key === "showPath" && F?.path?.type === "custom" && /* @__PURE__ */ L(ut, {
1704
- inst: F,
1703
+ e.key === "showPath" && I?.path?.type === "custom" && /* @__PURE__ */ R(ut, {
1704
+ inst: I,
1705
1705
  layer: r,
1706
1706
  onPoints: (e) => j(b, { path: {
1707
- ...F?.path ?? {},
1707
+ ...I?.path ?? {},
1708
1708
  points: e
1709
1709
  } })
1710
1710
  })
1711
1711
  ] }, e.key)),
1712
- u === "anim" && ye && /* @__PURE__ */ L(dt, {
1712
+ u === "anim" && ve && /* @__PURE__ */ R(dt, {
1713
1713
  layer: r,
1714
1714
  setProp: a,
1715
1715
  insts: _,
@@ -1718,7 +1718,7 @@ function it({ layer: r, setProp: a, updateLayer: s, palette: c, renderAnimate: l
1718
1718
  ] });
1719
1719
  }
1720
1720
  function at({ layer: e, onPreset: t }) {
1721
- return /* @__PURE__ */ L(T, {
1721
+ return /* @__PURE__ */ R(T, {
1722
1722
  tree: ie,
1723
1723
  presets: j,
1724
1724
  current: j.find((t) => t.id === e.presetId) ?? j[0],
@@ -1750,39 +1750,39 @@ function ot({ insts: e, idx: t, onSelect: n, onWrite: r, marked: a, onMark: o, o
1750
1750
  let o = [...e], [s] = o.splice(t, 1);
1751
1751
  o.splice(a, 0, s), r(o), n(a);
1752
1752
  }, h = [...new Set(e.map((e) => e.group).filter(Boolean))];
1753
- return /* @__PURE__ */ R(we, { children: [
1754
- /* @__PURE__ */ L("div", {
1753
+ return /* @__PURE__ */ z(Ce, { children: [
1754
+ /* @__PURE__ */ R("div", {
1755
1755
  className: "flex flex-col gap-1",
1756
1756
  children: e.map((r, i) => {
1757
1757
  let s = rt(r.group, h);
1758
- return /* @__PURE__ */ R("div", {
1758
+ return /* @__PURE__ */ z("div", {
1759
1759
  onClick: () => n(i),
1760
1760
  className: `flex items-center gap-2 pl-2 pr-1 py-1 rounded cursor-pointer kol-helper-12 ${i === t ? "bg-[color-mix(in_srgb,var(--kol-accent-primary)_26%,transparent)] text-emphasis" : "text-body hover:bg-oq-04 hover:text-emphasis"}`,
1761
1761
  children: [
1762
- /* @__PURE__ */ L("span", {
1762
+ /* @__PURE__ */ R("span", {
1763
1763
  onClick: (e) => e.stopPropagation(),
1764
1764
  className: "shrink-0",
1765
1765
  style: { lineHeight: 0 },
1766
- children: /* @__PURE__ */ L(_e, {
1766
+ children: /* @__PURE__ */ R(ge, {
1767
1767
  checked: a.includes(r.id),
1768
1768
  onChange: () => o(r.id)
1769
1769
  })
1770
1770
  }),
1771
- /* @__PURE__ */ L("span", {
1771
+ /* @__PURE__ */ R("span", {
1772
1772
  className: "kol-helper-10 text-meta shrink-0",
1773
1773
  children: i + 1
1774
1774
  }),
1775
- /* @__PURE__ */ L("span", {
1775
+ /* @__PURE__ */ R("span", {
1776
1776
  className: "truncate flex-1 min-w-0",
1777
1777
  children: r.text || "—"
1778
1778
  }),
1779
- s && /* @__PURE__ */ R("span", {
1779
+ s && /* @__PURE__ */ z("span", {
1780
1780
  className: "shrink-0 kol-helper-10 text-meta",
1781
1781
  children: ["grp ", s]
1782
1782
  }),
1783
- /* @__PURE__ */ L(P, {
1783
+ /* @__PURE__ */ R(F, {
1784
1784
  label: "Duplicate element",
1785
- children: /* @__PURE__ */ L(M, {
1785
+ children: /* @__PURE__ */ R(M, {
1786
1786
  tone: "ghost",
1787
1787
  size: l,
1788
1788
  quiet: !0,
@@ -1794,9 +1794,9 @@ function ot({ insts: e, idx: t, onSelect: n, onWrite: r, marked: a, onMark: o, o
1794
1794
  }
1795
1795
  })
1796
1796
  }),
1797
- /* @__PURE__ */ L(P, {
1797
+ /* @__PURE__ */ R(F, {
1798
1798
  label: "Remove element",
1799
- children: /* @__PURE__ */ L(M, {
1799
+ children: /* @__PURE__ */ R(M, {
1800
1800
  tone: "ghost",
1801
1801
  size: l,
1802
1802
  quiet: !0,
@@ -1813,15 +1813,15 @@ function ot({ insts: e, idx: t, onSelect: n, onWrite: r, marked: a, onMark: o, o
1813
1813
  }, r.id ?? i);
1814
1814
  })
1815
1815
  }),
1816
- /* @__PURE__ */ R("div", {
1816
+ /* @__PURE__ */ z("div", {
1817
1817
  className: "grid grid-cols-2 gap-1",
1818
- children: [/* @__PURE__ */ L(M, {
1818
+ children: [/* @__PURE__ */ R(M, {
1819
1819
  tone: "primary",
1820
1820
  size: l,
1821
1821
  disabled: a.length < 2,
1822
1822
  onClick: s,
1823
1823
  children: "Group"
1824
- }), /* @__PURE__ */ L(M, {
1824
+ }), /* @__PURE__ */ R(M, {
1825
1825
  tone: "primary",
1826
1826
  size: l,
1827
1827
  disabled: !a.length,
@@ -1829,10 +1829,10 @@ function ot({ insts: e, idx: t, onSelect: n, onWrite: r, marked: a, onMark: o, o
1829
1829
  children: "Ungroup"
1830
1830
  })]
1831
1831
  }),
1832
- /* @__PURE__ */ R("div", {
1832
+ /* @__PURE__ */ z("div", {
1833
1833
  className: "flex items-center gap-1",
1834
1834
  children: [
1835
- /* @__PURE__ */ L(M, {
1835
+ /* @__PURE__ */ R(M, {
1836
1836
  tone: "primary",
1837
1837
  size: l,
1838
1838
  className: "flex-1",
@@ -1841,9 +1841,9 @@ function ot({ insts: e, idx: t, onSelect: n, onWrite: r, marked: a, onMark: o, o
1841
1841
  onClick: d,
1842
1842
  children: "Add element"
1843
1843
  }),
1844
- /* @__PURE__ */ L(P, {
1844
+ /* @__PURE__ */ R(F, {
1845
1845
  label: "Move element up",
1846
- children: /* @__PURE__ */ L(M, {
1846
+ children: /* @__PURE__ */ R(M, {
1847
1847
  tone: "ghost",
1848
1848
  size: l,
1849
1849
  quiet: !0,
@@ -1851,16 +1851,16 @@ function ot({ insts: e, idx: t, onSelect: n, onWrite: r, marked: a, onMark: o, o
1851
1851
  "aria-label": "Move element up",
1852
1852
  disabled: t <= 0,
1853
1853
  onClick: () => m(-1),
1854
- children: /* @__PURE__ */ L(z, {
1854
+ children: /* @__PURE__ */ R(we, {
1855
1855
  name: "chevron-down",
1856
1856
  size: 12,
1857
1857
  style: { transform: "rotate(180deg)" }
1858
1858
  })
1859
1859
  })
1860
1860
  }),
1861
- /* @__PURE__ */ L(P, {
1861
+ /* @__PURE__ */ R(F, {
1862
1862
  label: "Move element down",
1863
- children: /* @__PURE__ */ L(M, {
1863
+ children: /* @__PURE__ */ R(M, {
1864
1864
  tone: "ghost",
1865
1865
  size: l,
1866
1866
  quiet: !0,
@@ -1868,7 +1868,7 @@ function ot({ insts: e, idx: t, onSelect: n, onWrite: r, marked: a, onMark: o, o
1868
1868
  "aria-label": "Move element down",
1869
1869
  disabled: t >= e.length - 1,
1870
1870
  onClick: () => m(1),
1871
- children: /* @__PURE__ */ L(z, {
1871
+ children: /* @__PURE__ */ R(we, {
1872
1872
  name: "chevron-down",
1873
1873
  size: 12
1874
1874
  })
@@ -1880,15 +1880,15 @@ function ot({ insts: e, idx: t, onSelect: n, onWrite: r, marked: a, onMark: o, o
1880
1880
  }
1881
1881
  function st({ knob: t, comp: n, idx: r, palette: a, onWrite: o }) {
1882
1882
  let s = i(), c = t.get(n, r), l = (e) => o(t, e);
1883
- if (t.type === "color") return /* @__PURE__ */ L(f, {
1883
+ if (t.type === "color") return /* @__PURE__ */ R(f, {
1884
1884
  label: t.label,
1885
1885
  value: c,
1886
1886
  onChange: (t) => l(e(t, a) ?? t),
1887
1887
  palette: a
1888
1888
  });
1889
- if (t.type === "select") return /* @__PURE__ */ L(N, {
1889
+ if (t.type === "select") return /* @__PURE__ */ R(N, {
1890
1890
  label: t.label,
1891
- children: /* @__PURE__ */ L(le, {
1891
+ children: /* @__PURE__ */ R(le, {
1892
1892
  variant: "subtle",
1893
1893
  size: s,
1894
1894
  className: "w-full",
@@ -1898,9 +1898,9 @@ function st({ knob: t, comp: n, idx: r, palette: a, onWrite: o }) {
1898
1898
  })
1899
1899
  });
1900
1900
  let { min: u, max: d } = Xe(t, n, r);
1901
- return /* @__PURE__ */ L(N, {
1901
+ return /* @__PURE__ */ R(N, {
1902
1902
  label: t.label,
1903
- children: /* @__PURE__ */ L(me, {
1903
+ children: /* @__PURE__ */ R(pe, {
1904
1904
  min: u,
1905
1905
  max: d,
1906
1906
  step: t.step ?? 1,
@@ -1917,26 +1917,26 @@ function ct({ motions: e, mIdx: t, onSelect: n, onAdd: r, onRemove: a }) {
1917
1917
  value: String(t + 1),
1918
1918
  label: String(t + 2)
1919
1919
  }))];
1920
- return /* @__PURE__ */ R("div", {
1920
+ return /* @__PURE__ */ z("div", {
1921
1921
  className: "flex flex-col gap-1",
1922
- children: [/* @__PURE__ */ L("span", {
1922
+ children: [/* @__PURE__ */ R("span", {
1923
1923
  className: "kol-helper-10 text-meta",
1924
1924
  children: "Motion layers"
1925
- }), /* @__PURE__ */ R("div", {
1925
+ }), /* @__PURE__ */ z("div", {
1926
1926
  className: "flex items-center gap-1",
1927
1927
  children: [
1928
- /* @__PURE__ */ L("div", {
1928
+ /* @__PURE__ */ R("div", {
1929
1929
  className: "flex-1 min-w-0",
1930
- children: /* @__PURE__ */ L(pe, {
1930
+ children: /* @__PURE__ */ R(P, {
1931
1931
  variant: "filled",
1932
1932
  value: String(t),
1933
1933
  onChange: (e) => n(Number(e)),
1934
1934
  options: s
1935
1935
  })
1936
1936
  }),
1937
- /* @__PURE__ */ L(P, {
1937
+ /* @__PURE__ */ R(F, {
1938
1938
  label: "Add motion layer",
1939
- children: /* @__PURE__ */ L(M, {
1939
+ children: /* @__PURE__ */ R(M, {
1940
1940
  tone: "ghost",
1941
1941
  size: o,
1942
1942
  quiet: !0,
@@ -1946,9 +1946,9 @@ function ct({ motions: e, mIdx: t, onSelect: n, onAdd: r, onRemove: a }) {
1946
1946
  onClick: r
1947
1947
  })
1948
1948
  }),
1949
- /* @__PURE__ */ L(P, {
1949
+ /* @__PURE__ */ R(F, {
1950
1950
  label: "Remove motion layer (the primary can only be set to None)",
1951
- children: /* @__PURE__ */ L(M, {
1951
+ children: /* @__PURE__ */ R(M, {
1952
1952
  tone: "ghost",
1953
1953
  size: o,
1954
1954
  quiet: !0,
@@ -1964,7 +1964,7 @@ function ct({ motions: e, mIdx: t, onSelect: n, onAdd: r, onRemove: a }) {
1964
1964
  });
1965
1965
  }
1966
1966
  function lt({ value: e = {}, onToggle: t }) {
1967
- let [n, r] = I(!1), i = F({
1967
+ let [n, r] = L(!1), i = I({
1968
1968
  open: n,
1969
1969
  onOpenChange: r,
1970
1970
  placement: "bottom-start",
@@ -1973,9 +1973,9 @@ function lt({ value: e = {}, onToggle: t }) {
1973
1973
  matchReferenceWidth: !0,
1974
1974
  role: "listbox"
1975
1975
  }), a = je.filter((t) => e[t.tag]).length;
1976
- return /* @__PURE__ */ R("div", {
1976
+ return /* @__PURE__ */ z("div", {
1977
1977
  className: "relative w-full",
1978
- children: [/* @__PURE__ */ R("button", {
1978
+ children: [/* @__PURE__ */ z("button", {
1979
1979
  ref: i.refs.setReference,
1980
1980
  ...i.getReferenceProps(),
1981
1981
  type: "button",
@@ -1990,7 +1990,7 @@ function lt({ value: e = {}, onToggle: t }) {
1990
1990
  },
1991
1991
  "aria-haspopup": "listbox",
1992
1992
  "aria-expanded": n,
1993
- children: [/* @__PURE__ */ L("span", { children: a ? `${a} feature${a > 1 ? "s" : ""}` : "None" }), /* @__PURE__ */ L(z, {
1993
+ children: [/* @__PURE__ */ R("span", { children: a ? `${a} feature${a > 1 ? "s" : ""}` : "None" }), /* @__PURE__ */ R(we, {
1994
1994
  name: "chevron-down",
1995
1995
  size: 10,
1996
1996
  className: "ml-auto",
@@ -1999,7 +1999,7 @@ function lt({ value: e = {}, onToggle: t }) {
1999
1999
  transition: "transform 300ms"
2000
2000
  }
2001
2001
  })]
2002
- }), /* @__PURE__ */ L(fe, {
2002
+ }), /* @__PURE__ */ R(fe, {
2003
2003
  popover: i,
2004
2004
  panel: !1,
2005
2005
  focus: !1,
@@ -2009,15 +2009,12 @@ function lt({ value: e = {}, onToggle: t }) {
2009
2009
  borderRadius: "0 0 4px 4px",
2010
2010
  zIndex: 200
2011
2011
  },
2012
- children: /* @__PURE__ */ L("div", {
2012
+ children: /* @__PURE__ */ R("div", {
2013
2013
  className: "flex max-h-[300px] flex-col items-stretch overflow-y-auto",
2014
2014
  role: "listbox",
2015
- children: je.map((n) => /* @__PURE__ */ L(de, {
2015
+ children: je.map((n) => /* @__PURE__ */ R(de, {
2016
2016
  onClick: () => t(n.tag, !e[n.tag]),
2017
- shortcut: e[n.tag] ? /* @__PURE__ */ L(z, {
2018
- name: "check",
2019
- size: 11
2020
- }) : void 0,
2017
+ indicator: e[n.tag] ? "check" : void 0,
2021
2018
  children: n.label
2022
2019
  }, n.tag))
2023
2020
  })
@@ -2025,7 +2022,7 @@ function lt({ value: e = {}, onToggle: t }) {
2025
2022
  });
2026
2023
  }
2027
2024
  function ut({ inst: e, layer: t, onPoints: n }) {
2028
- let r = i(), a = Ce(null), o = Ce(null), s = e?.path?.points, c = Array.isArray(s) && s.length >= 2 ? s : ae, l = t.w > 0 && t.h > 0 ? t.w / t.h : 1, u = ce("custom", 100, 100, { points: c }).d, d = (e) => (t) => {
2025
+ let r = i(), a = Se(null), o = Se(null), s = e?.path?.points, c = Array.isArray(s) && s.length >= 2 ? s : ae, l = t.w > 0 && t.h > 0 ? t.w / t.h : 1, u = ce("custom", 100, 100, { points: c }).d, d = (e) => (t) => {
2029
2026
  t.preventDefault(), t.stopPropagation(), t.currentTarget.setPointerCapture(t.pointerId), o.current = { i: e };
2030
2027
  }, f = (e) => {
2031
2028
  let t = o.current, r = a.current;
@@ -2040,24 +2037,24 @@ function ut({ inst: e, layer: t, onPoints: n }) {
2040
2037
  e.currentTarget.releasePointerCapture(e.pointerId);
2041
2038
  } catch {}
2042
2039
  };
2043
- return /* @__PURE__ */ R("div", {
2040
+ return /* @__PURE__ */ z("div", {
2044
2041
  className: "flex flex-col gap-2",
2045
- children: [/* @__PURE__ */ R("div", {
2042
+ children: [/* @__PURE__ */ z("div", {
2046
2043
  ref: a,
2047
2044
  className: "relative w-full rounded border border-oq-08 overflow-hidden",
2048
2045
  style: { aspectRatio: `${l}` },
2049
- children: [/* @__PURE__ */ L("svg", {
2046
+ children: [/* @__PURE__ */ R("svg", {
2050
2047
  className: "absolute inset-0 w-full h-full",
2051
2048
  viewBox: "0 0 100 100",
2052
2049
  preserveAspectRatio: "none",
2053
- children: /* @__PURE__ */ L("path", {
2050
+ children: /* @__PURE__ */ R("path", {
2054
2051
  d: u,
2055
2052
  fill: "none",
2056
2053
  stroke: "var(--kol-accent-primary)",
2057
2054
  strokeWidth: 1.5,
2058
2055
  vectorEffect: "non-scaling-stroke"
2059
2056
  })
2060
- }), c.map((e, t) => /* @__PURE__ */ L("div", {
2057
+ }), c.map((e, t) => /* @__PURE__ */ R("div", {
2061
2058
  onPointerDown: d(t),
2062
2059
  onPointerMove: f,
2063
2060
  onPointerUp: p,
@@ -2074,14 +2071,14 @@ function ut({ inst: e, layer: t, onPoints: n }) {
2074
2071
  boxShadow: "0 0 0 1px rgba(0,0,0,0.5)"
2075
2072
  }
2076
2073
  }, t))]
2077
- }), /* @__PURE__ */ R("div", {
2074
+ }), /* @__PURE__ */ z("div", {
2078
2075
  className: "grid grid-cols-2 gap-2",
2079
- children: [/* @__PURE__ */ L(M, {
2076
+ children: [/* @__PURE__ */ R(M, {
2080
2077
  tone: "primary",
2081
2078
  size: r,
2082
2079
  onClick: () => n([...c, [.5, .5]]),
2083
2080
  children: "Add point"
2084
- }), /* @__PURE__ */ L(M, {
2081
+ }), /* @__PURE__ */ R(M, {
2085
2082
  tone: "primary",
2086
2083
  size: r,
2087
2084
  disabled: c.length <= 2,
@@ -2092,21 +2089,21 @@ function ut({ inst: e, layer: t, onPoints: n }) {
2092
2089
  });
2093
2090
  }
2094
2091
  function dt({ layer: e, setProp: t, insts: n, renderAnimate: r }) {
2095
- let i = Qe, a = e[i.key], o = y(a), s = n.find((e) => e?.morph?.on)?.morph?.blend ?? i.default, c = typeof a == "number" ? a : s, l = o ? /* @__PURE__ */ L("div", {
2092
+ let i = Qe, a = e[i.key], o = y(a), s = n.find((e) => e?.morph?.on)?.morph?.blend ?? i.default, c = typeof a == "number" ? a : s, l = o ? /* @__PURE__ */ R("div", {
2096
2093
  className: "kol-helper-12 text-meta italic px-1",
2097
2094
  children: "animated"
2098
- }) : /* @__PURE__ */ L(me, {
2095
+ }) : /* @__PURE__ */ R(pe, {
2099
2096
  min: i.min,
2100
2097
  max: i.max,
2101
2098
  step: i.step,
2102
2099
  value: c,
2103
2100
  onChange: (e) => t(i.key, e)
2104
2101
  });
2105
- return /* @__PURE__ */ L(N, {
2102
+ return /* @__PURE__ */ R(N, {
2106
2103
  label: i.label,
2107
- children: /* @__PURE__ */ R("div", {
2104
+ children: /* @__PURE__ */ z("div", {
2108
2105
  className: "flex items-center gap-2",
2109
- children: [/* @__PURE__ */ L("div", {
2106
+ children: [/* @__PURE__ */ R("div", {
2110
2107
  className: "flex-1 min-w-0",
2111
2108
  children: l
2112
2109
  }), r(i)]
@@ -2132,8 +2129,8 @@ function ft(e, t = []) {
2132
2129
  return t;
2133
2130
  }
2134
2131
  function pt() {
2135
- let { layers: e, updateLayer: t } = h(), { t: n, seek: r } = w(), i = Se(() => ft(e), [e]);
2136
- return /* @__PURE__ */ L(ge, {
2132
+ let { layers: e, updateLayer: t } = h(), { t: n, seek: r } = ne(), i = xe(() => ft(e), [e]);
2133
+ return /* @__PURE__ */ R(he, {
2137
2134
  tracks: i,
2138
2135
  t: n,
2139
2136
  onSeek: r,
@@ -2144,19 +2141,19 @@ function pt() {
2144
2141
  keys: n
2145
2142
  } });
2146
2143
  },
2147
- easingOptions: ne
2144
+ easingOptions: w
2148
2145
  });
2149
2146
  }
2150
2147
  //#endregion
2151
2148
  //#region src/editor/params/TransportBar.jsx
2152
2149
  function mt({ seconds: e, onCommit: t, size: n }) {
2153
- let r = String(e), [i, a] = I(r), [o, s] = I(!1);
2154
- return xe(() => {
2150
+ let r = String(e), [i, a] = L(r), [o, s] = L(!1);
2151
+ return be(() => {
2155
2152
  o || a(r);
2156
- }, [r, o]), /* @__PURE__ */ L(P, {
2153
+ }, [r, o]), /* @__PURE__ */ R(F, {
2157
2154
  label: "Loop length",
2158
2155
  triggerClassName: "flex w-full",
2159
- children: /* @__PURE__ */ L(ue, {
2156
+ children: /* @__PURE__ */ R(ue, {
2160
2157
  type: "text",
2161
2158
  inputMode: "decimal",
2162
2159
  variant: "property",
@@ -2186,20 +2183,20 @@ function mt({ seconds: e, onCommit: t, size: n }) {
2186
2183
  })
2187
2184
  });
2188
2185
  }
2189
- var ht = (e, t) => /* @__PURE__ */ L(z, {
2186
+ var ht = (e, t) => /* @__PURE__ */ R(we, {
2190
2187
  name: e,
2191
- size: ye(t, !0)
2188
+ size: ve(t, !0)
2192
2189
  }), gt = {
2193
2190
  sm: "shrink-0 [&_.kol-seg-cell]:flex-none [&_.kol-seg-cell]:px-0 [&_.kol-seg-cell]:w-[var(--kol-ctl-sm)]",
2194
2191
  md: "shrink-0 [&_.kol-seg-cell]:flex-none [&_.kol-seg-cell]:px-0 [&_.kol-seg-cell]:w-[var(--kol-ctl-md)]",
2195
2192
  lg: "shrink-0 [&_.kol-seg-cell]:flex-none [&_.kol-seg-cell]:px-0 [&_.kol-seg-cell]:w-[var(--kol-ctl-lg)]"
2196
2193
  };
2197
2194
  function _t({ size: e = "sm" }) {
2198
- let { playing: t, loopSeconds: n, play: r, pause: i, stop: a, rewind: o, setLoopSeconds: s } = w();
2199
- return /* @__PURE__ */ R("div", {
2195
+ let { playing: t, loopSeconds: n, play: r, pause: i, stop: a, rewind: o, setLoopSeconds: s } = ne();
2196
+ return /* @__PURE__ */ z("div", {
2200
2197
  className: "flex items-center gap-2",
2201
2198
  children: [
2202
- /* @__PURE__ */ L(pe, {
2199
+ /* @__PURE__ */ R(P, {
2203
2200
  size: e,
2204
2201
  ariaLabel: "Playback",
2205
2202
  value: t ? "play" : "pause",
@@ -2217,15 +2214,15 @@ function _t({ size: e = "sm" }) {
2217
2214
  label: ht("pause", e)
2218
2215
  }]
2219
2216
  }),
2220
- /* @__PURE__ */ L("div", {
2217
+ /* @__PURE__ */ R("div", {
2221
2218
  className: "flex-1 min-w-0",
2222
- children: /* @__PURE__ */ L(mt, {
2219
+ children: /* @__PURE__ */ R(mt, {
2223
2220
  seconds: n,
2224
2221
  onCommit: s,
2225
2222
  size: e
2226
2223
  })
2227
2224
  }),
2228
- /* @__PURE__ */ L(pe, {
2225
+ /* @__PURE__ */ R(P, {
2229
2226
  size: e,
2230
2227
  ariaLabel: "Reset",
2231
2228
  value: null,