@kolkrabbi/design-editor 0.45.1 → 0.47.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.
Files changed (50) hide show
  1. package/dist/{BindDot-DqLgF_zQ.js → BindDot-B85UV79g.js} +9 -8
  2. package/dist/{BufferResource-BfLgK37S.js → BufferResource-Di5teicy.js} +2 -2
  3. package/dist/{CanvasPool-YNSF8hsR.js → CanvasPool-JdLj49b-.js} +1 -1
  4. package/dist/CanvasRenderer-fXDObOOi.js +2 -0
  5. package/dist/{FederatedEventTarget-BJgROaRQ.js → FederatedEventTarget-CH0bzxx1.js} +1 -1
  6. package/dist/{FilterSystem-BUrPNXx-.js → FilterSystem-C-ZoyuTO.js} +3 -3
  7. package/dist/{Geometry-C5s5KpWq.js → Geometry-D4tiuMOr.js} +1 -1
  8. package/dist/KolboxView-n6kEPJtV.js +21615 -0
  9. package/dist/{RenderTargetSystem-oFwWv5IW.js → RenderTargetSystem-Bom_vhlS.js} +1 -1
  10. package/dist/{Timeline-Boo1VuFe.js → Timeline-EbecYeGh.js} +49 -47
  11. package/dist/TreePicker-2RUSyGl4.js +209 -0
  12. package/dist/WebGLRenderer-4hvrGmfW.js +2 -0
  13. package/dist/WebGPURenderer-BjzMV7Pg.js +2 -0
  14. package/dist/__vite-browser-external-y2xWjzgx.js +780 -0
  15. package/dist/browserAll-BFE0MRLW.js +6 -0
  16. package/dist/{canvasUtils-BoNfkAod.js → canvasUtils-DUNsu3ct.js} +1 -1
  17. package/dist/{core-gz2DUq8s.js → core-9UlJPBwX.js} +6331 -6299
  18. package/dist/core.js +6 -5
  19. package/dist/design-editor.css +2 -1
  20. package/dist/design-editor.js +7 -3622
  21. package/dist/{effectCategories-CsCbOfy3.js → effectCategories-CCpYmxS0.js} +8965 -4984
  22. package/dist/effects-DspYFJAM.js +447 -0
  23. package/dist/effects.js +1 -1
  24. package/dist/{generators-BrdP7Omn.js → generators-DY4_ymWh.js} +2394 -2423
  25. package/dist/generators.js +1 -1
  26. package/dist/{getTextureBatchBindGroup-CNWhZRbV.js → getTextureBatchBindGroup-ZMqkwiZS.js} +1 -1
  27. package/dist/{host-BLhWuQ9Y.js → host-0qv2SCjk.js} +1 -1
  28. package/dist/{host-DwC1SsjV.js → host-Bo6itV50.js} +50 -50
  29. package/dist/init-DkGhdexn.js +4 -0
  30. package/dist/{morphStore-Ba--Lk9u.js → morphStore-Bm30Ekce.js} +1 -1
  31. package/dist/{motion-DL5Y98d6.js → motion-BOWE4m3Q.js} +762 -759
  32. package/dist/motion.js +1 -1
  33. package/dist/{pipeline-CMpuPUaX.js → pipeline-hZsOKbHd.js} +12 -12
  34. package/dist/{previewScale-xKmJh3wg.js → previewScale-C6EBx--U.js} +8 -8
  35. package/dist/{rolls-CSOfYXm5.js → rolls-DugKaHUw.js} +10550 -4518
  36. package/dist/src-BlvCHYVY.js +3672 -0
  37. package/dist/{src-BSoHkncc.js → src-D-TQbBo2.js} +1 -2
  38. package/dist/{store-BtEnp5i6.js → store-BMGP1qou.js} +295 -275
  39. package/dist/{useLayerEdit-BCGfD3Cv.js → useLayerEdit-B5nF5I9b.js} +103 -102
  40. package/dist/webworkerAll-0WBQ2FBr.js +2 -0
  41. package/package.json +14 -11
  42. package/dist/CanvasRenderer-Bl0rlqNq.js +0 -2
  43. package/dist/TreePicker-YcrYNUx5.js +0 -166
  44. package/dist/WebGLRenderer-CXxpVIx3.js +0 -2
  45. package/dist/WebGPURenderer-BwLEUYBa.js +0 -2
  46. package/dist/browserAll-CAzdTUbR.js +0 -6
  47. package/dist/chunk-3b4jIN3o.js +0 -13
  48. package/dist/effects-BZ8lWlZa.js +0 -447
  49. package/dist/init-jApIMi04.js +0 -4
  50. package/dist/webworkerAll-DEZhpG90.js +0 -2
@@ -1,4 +1,4 @@
1
- import { A as e, C as t, D as n, E as r, F as i, H as a, J as o, K as s, L as c, Q as l, T as u, U as d, W as f, X as p, Y as m, _ as h, at as g, c as _, d as v, et as y, f as b, h as ee, i as te, it as ne, j as re, m as ie, n as ae, o as oe, ot as x, q as se, r as S, rt as C, s as ce, t as le, tt as ue, u as w, v as de, w as fe, x as pe, y as me, z as he } from "./Geometry-C5s5KpWq.js";
1
+ import { A as e, C as t, D as n, E as r, F as i, H as a, J as o, K as s, L as c, Q as l, T as u, U as d, W as f, X as p, Y as m, _ as h, at as g, c as _, d as v, et as y, f as b, h as ee, i as te, it as ne, j as re, m as ie, n as ae, o as oe, ot as x, q as se, r as S, rt as C, s as ce, t as le, tt as ue, u as w, v as de, w as fe, x as pe, y as me, z as he } from "./Geometry-D4tiuMOr.js";
2
2
  //#region ../../node_modules/.pnpm/pixi.js@8.20.1/node_modules/pixi.js/lib/scene/container/CustomRenderPipe.mjs
3
3
  var ge = class {
4
4
  constructor(e) {
@@ -1,5 +1,6 @@
1
- import { D as e, Dn as t, Hn as n, J as r, M as i, N as a, On as o } from "./rolls-CSOfYXm5.js";
2
- import { m as s, s as c, u as l } from "./morphStore-Ba--Lk9u.js";
1
+ import { S as e, o as t, s as n } from "./__vite-browser-external-y2xWjzgx.js";
2
+ import { D as r, J as i, M as a, N as o } from "./rolls-DugKaHUw.js";
3
+ import { m as s, s as c, u as l } from "./morphStore-Bm30Ekce.js";
3
4
  import { Button as u, Dropdown as d, Input as f, Tooltip as p, floatSurfaceClass as m, useGrabEdge as h } from "@kolkrabbi/kol-component";
4
5
  import { Fragment as g, useEffect as _, useMemo as v, useRef as y, useState as b } from "react";
5
6
  import { Fragment as x, jsx as S, jsxs as C } from "react/jsx-runtime";
@@ -16,7 +17,8 @@ var T = {
16
17
  path: "Path",
17
18
  loop: "Loop",
18
19
  kinetic: "Kinetic type",
19
- misc: "Misc"
20
+ misc: "Misc",
21
+ frame: "Frame"
20
22
  }, E = {
21
23
  unite: "Unite",
22
24
  subtract: "Subtract",
@@ -65,8 +67,8 @@ var P = 268, F = 14, I = 25, L = [
65
67
  1,
66
68
  2,
67
69
  4
68
- ], R = 96;
69
- function ee(e, t) {
70
+ ], ee = 96;
71
+ function R(e, t) {
70
72
  if (e.length === 0) return 0;
71
73
  if (t <= e[0].t) return e[0].v;
72
74
  let n = e[e.length - 1];
@@ -78,44 +80,44 @@ function ee(e, t) {
78
80
  let o = a.t - i.t || 1;
79
81
  return i.v + (a.v - i.v) * ((t - i.t) / o);
80
82
  }
81
- function z(t, n = []) {
82
- for (let r of t) {
83
- let t = Array.isArray(r.morph?.steps) ? r.morph.steps : null;
84
- if (t?.length) {
85
- let i = r.morph.name || "Morph", a = (e) => e.map((e) => t[(Math.round(e.v) % t.length + t.length) % t.length]?.label ?? ""), o = e(r.morphT) && r.morphT.bind === "track" ? r.morphT : null, c = o ? o.keys : s(t.map((e, t) => t), r.morph.cycle ?? "loop", r.morph.curve ?? "in-out");
86
- n.push({
87
- id: `${r.id}:morph`,
88
- layerId: r.id,
83
+ function z(e, t = []) {
84
+ for (let n of e) {
85
+ let e = Array.isArray(n.morph?.steps) ? n.morph.steps : null;
86
+ if (e?.length) {
87
+ let i = n.morph.name || "Morph", a = (t) => t.map((t) => e[(Math.round(t.v) % e.length + e.length) % e.length]?.label ?? ""), o = r(n.morphT) && n.morphT.bind === "track" ? n.morphT : null, c = o ? o.keys : s(e.map((e, t) => t), n.morph.cycle ?? "loop", n.morph.curve ?? "in-out");
88
+ t.push({
89
+ id: `${n.id}:morph`,
90
+ layerId: n.id,
89
91
  key: "morphT",
90
92
  label: i,
91
93
  keys: c,
92
94
  header: !0,
93
95
  readOnly: !o,
94
96
  names: a(c),
95
- steps: t.length
97
+ steps: e.length
96
98
  });
97
99
  }
98
- for (let i in r) {
99
- if (i === "morphT" && t?.length) continue;
100
- let a = r[i];
101
- e(a) && a.bind === "track" && n.push({
102
- id: `${r.id}:${i}`,
103
- layerId: r.id,
100
+ for (let i in n) {
101
+ if (i === "morphT" && e?.length) continue;
102
+ let a = n[i];
103
+ r(a) && a.bind === "track" && t.push({
104
+ id: `${n.id}:${i}`,
105
+ layerId: n.id,
104
106
  key: i,
105
- label: `${O(r)} · ${i}`,
107
+ label: `${O(n)} · ${i}`,
106
108
  keys: a.keys,
107
- under: t?.length ? `${r.id}:morph` : null
109
+ under: e?.length ? `${n.id}:morph` : null
108
110
  });
109
111
  }
110
- Array.isArray(r.children) && z(r.children, n);
112
+ Array.isArray(n.children) && z(n.children, t);
111
113
  }
112
- return n;
114
+ return t;
113
115
  }
114
116
  function te(e, t = []) {
115
117
  for (let n of e) t.push(n), Array.isArray(n.children) && te(n.children, t);
116
118
  return t;
117
119
  }
118
- var ne = (t) => Object.values(t).some((t) => e(t) && t.bind === "mod" && String(t.source).startsWith("audio")), B = {
120
+ var ne = (e) => Object.values(e).some((e) => r(e) && e.bind === "mod" && String(e.source).startsWith("audio")), B = {
119
121
  background: "square",
120
122
  pattern: "ptrn-dot",
121
123
  photo: "image",
@@ -149,7 +151,7 @@ function U({ name: e, label: t, on: n = !0, toggle: r = !1, size: i = 14, onClic
149
151
  function ie({ track: e, view: t, selected: n, setSelected: r, writeKeys: i, lit: a }) {
150
152
  let o = y(null), s = y(null), [, l] = b(0), u = !!e.header, d = !!e.readOnly, { X: f, fracFromEvent: m } = t, h = (t) => n && n.trackId === e.id && n.index === t, g = (t) => {
151
153
  if (t.target.closest("[data-diamond]") || t.target.closest("[data-name]") || d) return;
152
- let n = m(t, o.current), a = ee(e.keys, n), s = [...e.keys, {
154
+ let n = m(t, o.current), a = R(e.keys, n), s = [...e.keys, {
153
155
  t: n,
154
156
  v: a,
155
157
  easing: "linear"
@@ -280,7 +282,7 @@ function G({ view: e, lit: t, label: n, wave: r }) {
280
282
  children: r.map((e, t) => /* @__PURE__ */ S("span", {
281
283
  className: "absolute top-1/2 -translate-y-1/2 w-0.5 bg-oq-40",
282
284
  style: {
283
- left: `${t / R * 100}%`,
285
+ left: `${t / ee * 100}%`,
284
286
  height: 2 + Math.round(e * 10)
285
287
  }
286
288
  }, t))
@@ -399,11 +401,11 @@ function q({ view: e, now: t }) {
399
401
  })]
400
402
  });
401
403
  }
402
- var J = (e) => Array.isArray(e) ? e : i[e] ?? null, Y = 132, X = 14;
404
+ var J = (e) => Array.isArray(e) ? e : a[e] ?? null, Y = 132, X = 14;
403
405
  function se({ track: e, writeKeys: t, selected: n, setSelected: r }) {
404
- let a = y(null), [o, s] = b(0), [c, l] = b(null), u = y(null);
406
+ let i = y(null), [o, s] = b(0), [c, l] = b(null), u = y(null);
405
407
  _(() => {
406
- let e = a.current;
408
+ let e = i.current;
407
409
  if (!e) return;
408
410
  let t = new ResizeObserver(([e]) => s(e.contentRect.width));
409
411
  return t.observe(e), () => t.disconnect();
@@ -411,7 +413,7 @@ function se({ track: e, writeKeys: t, selected: n, setSelected: r }) {
411
413
  let d = c ?? e.keys, f = d.map((e) => e.v), p = Math.min(...f), m = Math.max(...f);
412
414
  u.current?.range && ([p, m] = u.current.range), m - p < 1e-9 && (--p, m += 1);
413
415
  let h = (e) => e * o, g = (e) => X + (1 - (e - p) / (m - p)) * (Y - 2 * X), v = (e) => {
414
- let t = a.current.getBoundingClientRect();
416
+ let t = i.current.getBoundingClientRect();
415
417
  return {
416
418
  t: Math.min(1, Math.max(0, (e.clientX - t.left) / t.width)),
417
419
  v: p + (1 - (e.clientY - t.top - X) / (Y - 2 * X)) * (m - p)
@@ -420,7 +422,7 @@ function se({ track: e, writeKeys: t, selected: n, setSelected: r }) {
420
422
  i: t,
421
423
  a: e,
422
424
  b: d[t + 1],
423
- bez: e.easing === "hold" ? null : J(e.easing ?? "linear") ?? i.linear
425
+ bez: e.easing === "hold" ? null : J(e.easing ?? "linear") ?? a.linear
424
426
  })), w = (t, n) => (i) => {
425
427
  i.stopPropagation(), i.currentTarget.setPointerCapture(i.pointerId), u.current = {
426
428
  kind: t,
@@ -440,7 +442,7 @@ function se({ track: e, writeKeys: t, selected: n, setSelected: r }) {
440
442
  let e = r[t.i - 1]?.t ?? 0, i = r[t.i + 1]?.t ?? 1;
441
443
  r[t.i].t = Math.min(i, Math.max(e, n.t)), r[t.i].v = n.v;
442
444
  } else {
443
- let e = r[t.i], a = r[t.i + 1], o = a.t - e.t || 1e-6, s = Math.abs(a.v - e.v) > 1e-9 ? a.v - e.v : m - p, c = Math.min(1, Math.max(0, (n.t - e.t) / o)), l = (n.v - e.v) / s, u = [...J(e.easing ?? "linear") ?? i.linear];
445
+ let e = r[t.i], i = r[t.i + 1], o = i.t - e.t || 1e-6, s = Math.abs(i.v - e.v) > 1e-9 ? i.v - e.v : m - p, c = Math.min(1, Math.max(0, (n.t - e.t) / o)), l = (n.v - e.v) / s, u = [...J(e.easing ?? "linear") ?? a.linear];
444
446
  t.kind === "out" ? (u[0] = c, u[1] = l) : (u[2] = c, u[3] = l), e.easing = u.map((e) => Math.round(e * 1e3) / 1e3);
445
447
  }
446
448
  l(r);
@@ -482,7 +484,7 @@ function se({ track: e, writeKeys: t, selected: n, setSelected: r }) {
482
484
  style: { width: P },
483
485
  children: [/* @__PURE__ */ S("span", { children: Math.round(m * 100) / 100 }), /* @__PURE__ */ S("span", { children: Math.round(p * 100) / 100 })]
484
486
  }), /* @__PURE__ */ S("div", {
485
- ref: a,
487
+ ref: i,
486
488
  className: "relative flex-1 rounded-[5px] bg-[var(--kol-float-well)]",
487
489
  style: {
488
490
  height: Y,
@@ -528,11 +530,11 @@ function se({ track: e, writeKeys: t, selected: n, setSelected: r }) {
528
530
  })]
529
531
  });
530
532
  }
531
- var ce = [...a, {
533
+ var ce = [...o, {
532
534
  value: "custom",
533
535
  label: "Custom"
534
536
  }];
535
- function le({ tracks: e, selected: t, setSelected: n, writeKeys: r, len: a }) {
537
+ function le({ tracks: e, selected: t, setSelected: n, writeKeys: r, len: i }) {
536
538
  if (!t) return null;
537
539
  let o = e.find((e) => e.id === t.trackId), s = o?.keys[t.index];
538
540
  if (!s || o.readOnly) return null;
@@ -551,7 +553,7 @@ function le({ tracks: e, selected: t, setSelected: n, writeKeys: r, len: a }) {
551
553
  className: "kol-float-label text-meta shrink-0",
552
554
  children: [
553
555
  "key @ ",
554
- H(s.t, a),
556
+ H(s.t, i),
555
557
  " s"
556
558
  ]
557
559
  }),
@@ -568,7 +570,7 @@ function le({ tracks: e, selected: t, setSelected: n, writeKeys: r, len: a }) {
568
570
  size: "sm",
569
571
  options: ce,
570
572
  value: p,
571
- onChange: (e) => c({ easing: e === "custom" ? [...J(s.easing) ?? i["in-out"]] : e })
573
+ onChange: (e) => c({ easing: e === "custom" ? [...J(s.easing) ?? a["in-out"]] : e })
572
574
  }),
573
575
  /* @__PURE__ */ S(u, {
574
576
  variant: "float",
@@ -623,11 +625,11 @@ function fe({ onDrag: e, onEnd: t, onReset: n }) {
623
625
  });
624
626
  }
625
627
  function pe() {
626
- let { layers: e } = r(), t = l(), n = N();
628
+ let { layers: e } = i(), t = l(), n = N();
627
629
  return v(() => z(e).length > 0, [e]) || !!t.active || n;
628
630
  }
629
- function me({ surface: e = "solid" }) {
630
- let { layers: i, updateLayer: a, selectedIds: s, select: c, toggleLayer: u, toggleLayerLock: d, currentPresetName: f } = r(), { t: p, loopSeconds: m, seek: h } = o(), g = l(), x = N(), w = v(() => z(i), [i]), T = v(() => g.active && !w.some((e) => e.header) ? [{
631
+ function me({ surface: r = "solid" }) {
632
+ let { layers: a, updateLayer: o, selectedIds: s, select: c, toggleLayer: u, toggleLayerLock: d, currentPresetName: f } = i(), { t: p, loopSeconds: m, seek: h } = n(), g = l(), x = N(), w = v(() => z(a), [a]), T = v(() => g.active && !w.some((e) => e.header) ? [{
631
633
  id: "morph:empty",
632
634
  layerId: null,
633
635
  key: "morphT",
@@ -647,11 +649,11 @@ function me({ surface: e = "solid" }) {
647
649
  P ? localStorage.setItem(Z, String(P)) : localStorage.removeItem(Z);
648
650
  } catch {}
649
651
  }, [P]);
650
- let B = y(Array(R).fill(0)), V = v(() => te(i), [i]);
651
- if (V.some(ne) && (B.current.push(n().level), B.current.shift()), T.length === 0 && !x) return null;
652
+ let B = y(Array(ee).fill(0)), V = v(() => te(a), [a]);
653
+ if (V.some(ne) && (B.current.push(e().level), B.current.shift()), T.length === 0 && !x) return null;
652
654
  let H = p * m, re = he(m, j, H), U = (e, t) => {
653
655
  let n = [...t].sort((e, t) => e.t - t.t);
654
- a(e.layerId, { [e.key]: {
656
+ o(e.layerId, { [e.key]: {
655
657
  bind: "track",
656
658
  keys: n
657
659
  } });
@@ -662,7 +664,7 @@ function me({ surface: e = "solid" }) {
662
664
  if (!W) return;
663
665
  let e = [...W.keys, {
664
666
  t: p,
665
- v: ee(W.keys, p),
667
+ v: R(W.keys, p),
666
668
  easing: "linear"
667
669
  }].sort((e, t) => e.t - t.t);
668
670
  U(W, e), D({
@@ -726,7 +728,7 @@ function me({ surface: e = "solid" }) {
726
728
  },
727
729
  onReset: () => F(null)
728
730
  }), /* @__PURE__ */ S(ge, {
729
- surface: e,
731
+ surface: r,
730
732
  className: "h-full min-h-0",
731
733
  title: f || "Untitled",
732
734
  count: V.length,
@@ -907,4 +909,4 @@ function ge({ surface: e = "solid", title: t, count: n = 0, onAdd: r, mode: i =
907
909
  });
908
910
  }
909
911
  //#endregion
910
- export { M as a, T as c, pe as i, O as l, ge as n, N as o, he as r, E as s, me as t };
912
+ export { pe as a, E as c, he as i, T as l, ge as n, M as o, R as r, N as s, me as t, O as u };
@@ -0,0 +1,209 @@
1
+ import { Cr as e, F as t, L as n, Tr as r, Yn as i, Zn as a, qn as o, xr as s, yr as c } from "./rolls-DugKaHUw.js";
2
+ import { embedFontFace as l } from "@kolkrabbi/kol-component";
3
+ import { Fragment as u, jsx as d, jsxs as f } from "react/jsx-runtime";
4
+ //#region src/kinetic/fonts.js
5
+ var p = (t, n) => {
6
+ let r = e[t];
7
+ return {
8
+ key: t,
9
+ label: r.label,
10
+ family: r.css,
11
+ url: r.roman,
12
+ italicUrl: r.italic,
13
+ slnt: r.slnt,
14
+ outline: !0,
15
+ italicStyle: r.slnt == null ? "italic" : `oblique ${-r.slnt}deg`,
16
+ axes: [{
17
+ tag: "wght",
18
+ min: r.min,
19
+ max: r.max,
20
+ def: n
21
+ }]
22
+ };
23
+ }, m = {
24
+ key: "rot",
25
+ label: "Rot",
26
+ family: "TG Rot",
27
+ url: "/fonts/TG/TGRotVF.ttf",
28
+ italicUrl: "/fonts/TG/TGRotItalicVF.ttf",
29
+ axes: [{
30
+ tag: "wdth",
31
+ min: 64,
32
+ max: 172,
33
+ def: 100
34
+ }, {
35
+ tag: "wght",
36
+ min: 100,
37
+ max: 900,
38
+ def: 400
39
+ }]
40
+ }, h = {
41
+ key: "gullhamrar",
42
+ label: "Gullhamrar",
43
+ family: "TG Gullhamrar",
44
+ url: "/fonts/TG/TGGullhamrarVF.ttf",
45
+ axes: [{
46
+ tag: "wght",
47
+ min: 300,
48
+ max: 900,
49
+ def: 400
50
+ }]
51
+ }, g = [
52
+ p(c, 400),
53
+ p(s, 400),
54
+ m,
55
+ h
56
+ ], _ = [
57
+ m,
58
+ g[1],
59
+ h
60
+ ], v = g.map((e) => ({
61
+ value: e.key,
62
+ label: e.label
63
+ })), y = {
64
+ wght: "Weight",
65
+ wdth: "Width",
66
+ ital: "Italic",
67
+ slnt: "Slant",
68
+ opsz: "Optical size"
69
+ }, b = (e) => g.find((t) => t.key === e) || g[0];
70
+ function x(e) {
71
+ let t = {};
72
+ for (let n of e.axes) t[n.tag] = n.def;
73
+ return t;
74
+ }
75
+ function S(e) {
76
+ let t = Object.entries(e || {}).map(([e, t]) => `'${e}' ${Math.round(t * 100) / 100}`);
77
+ return t.length ? t.join(", ") : "normal";
78
+ }
79
+ var C = !1;
80
+ async function w() {
81
+ if (!(C || typeof FontFace > "u")) {
82
+ C = !0;
83
+ for (let e of g) e.outline && r(e.key);
84
+ for (let e of g) {
85
+ if (e.outline) continue;
86
+ let t = {}, n = e.axes.find((e) => e.tag === "wght"), r = e.axes.find((e) => e.tag === "wdth");
87
+ n && (t.weight = `${n.min} ${n.max}`), r && (t.stretch = `${r.min}% ${r.max}%`);
88
+ for (let [n, r] of [[e.url, "normal"], ...e.italicUrl ? [[e.italicUrl, "italic"]] : []]) try {
89
+ let i = new FontFace(e.family, `url(${n})`, {
90
+ ...t,
91
+ style: r
92
+ });
93
+ document.fonts.add(i), i.load().catch(() => {});
94
+ } catch {}
95
+ }
96
+ try {
97
+ await document.fonts.ready;
98
+ } catch {}
99
+ }
100
+ }
101
+ var T = g.flatMap((e) => e.slnt == null ? e.italicUrl ? [{
102
+ font: e,
103
+ url: e.url,
104
+ style: "normal",
105
+ italic: !1
106
+ }, {
107
+ font: e,
108
+ url: e.italicUrl,
109
+ style: "italic",
110
+ italic: !0
111
+ }] : [{
112
+ font: e,
113
+ url: e.url,
114
+ style: "normal",
115
+ italic: null
116
+ }] : [{
117
+ font: e,
118
+ url: e.url,
119
+ style: `oblique 0deg ${-e.slnt}deg`,
120
+ italic: null
121
+ }]), E = (e) => `${e.url}|${e.style}`, D = /* @__PURE__ */ new Map(), O = null;
122
+ function k() {
123
+ return O || (O = Promise.all(T.map(async (e) => {
124
+ if (!D.has(E(e))) try {
125
+ let t = e.font.axes.find((e) => e.tag === "wght"), n = await l({
126
+ family: e.font.family,
127
+ url: e.url,
128
+ weight: `${t.min} ${t.max}`
129
+ });
130
+ D.set(E(e), n.replace(/}$/, `font-style:${e.style};}`));
131
+ } catch (t) {
132
+ console.warn(`[design-editor] font not embedded, export will fall back for ${e.font.family}:`, t);
133
+ }
134
+ })), O);
135
+ }
136
+ function A(e) {
137
+ let t = /* @__PURE__ */ new Set();
138
+ for (let n of e?.instances ?? []) {
139
+ let e = b(n.font);
140
+ for (let r of T) r.font === e && (r.italic === null || r.italic === !!n.italic) && t.add(E(r));
141
+ }
142
+ return [...t].map((e) => D.get(e)).filter(Boolean).join("\n");
143
+ }
144
+ //#endregion
145
+ //#region src/editor/compose/inspectors/TreePicker.jsx
146
+ function j(e) {
147
+ return /* @__PURE__ */ d(o, {
148
+ variant: "subtle",
149
+ size: n(),
150
+ className: "w-full",
151
+ ...e
152
+ });
153
+ }
154
+ function M({ label: e, options: n, value: r, onChange: o, children: s, inline: c = !0 }) {
155
+ let l = s ?? /* @__PURE__ */ d(j, {
156
+ options: n,
157
+ value: r,
158
+ onChange: o
159
+ });
160
+ return c ? /* @__PURE__ */ d(a, {
161
+ label: e,
162
+ align: "fill",
163
+ labelWidth: t,
164
+ children: l
165
+ }) : /* @__PURE__ */ d(i, {
166
+ label: e,
167
+ children: l
168
+ });
169
+ }
170
+ function N({ tree: e, presets: t, current: n, onPick: r, inline: i = !0, subLabel: a = (e) => e }) {
171
+ let o = e.find((e) => e.label === n.typeLabel) ?? e.find((e) => e.subs.includes(n.sub)) ?? e[0], s = t.filter((e) => e.sub === n.sub), c = (e) => t.find((t) => t.sub === e);
172
+ return /* @__PURE__ */ f(u, { children: [
173
+ /* @__PURE__ */ d(M, {
174
+ inline: i,
175
+ label: "Type",
176
+ options: e.map((e) => ({
177
+ value: e.label,
178
+ label: e.label
179
+ })),
180
+ value: o.label,
181
+ onChange: (t) => {
182
+ let n = e.find((e) => e.label === t);
183
+ n && r(c(n.subs[0]));
184
+ }
185
+ }),
186
+ /* @__PURE__ */ d(M, {
187
+ inline: i,
188
+ label: "Category",
189
+ options: o.subs.map((e) => ({
190
+ value: e,
191
+ label: a(e)
192
+ })),
193
+ value: n.sub,
194
+ onChange: (e) => r(c(e))
195
+ }),
196
+ /* @__PURE__ */ d(M, {
197
+ inline: i,
198
+ label: "Preset",
199
+ options: s.map((e) => ({
200
+ value: e.id,
201
+ label: e.label
202
+ })),
203
+ value: n.id,
204
+ onChange: (e) => r(t.find((t) => t.id === e))
205
+ })
206
+ ] });
207
+ }
208
+ //#endregion
209
+ export { v as a, b as c, S as d, k as f, y as i, A as l, M as n, _ as o, N as r, x as s, j as t, w as u };
@@ -0,0 +1,2 @@
1
+ import { n as e } from "./pipeline-hZsOKbHd.js";
2
+ export { e as WebGLRenderer };
@@ -0,0 +1,2 @@
1
+ import { t as e } from "./pipeline-hZsOKbHd.js";
2
+ export { e as WebGPURenderer };