@kolkrabbi/design-editor 0.19.0 → 0.21.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,2 +1,2 @@
1
- import { t as e } from "./generators-Bk3mvrsm.js";
1
+ import { t as e } from "./generators-B8_StNAy.js";
2
2
  export { e as generators };
@@ -1,7 +1,6 @@
1
- import { Ft as e } from "./rolls-CkmuE-Ya.js";
2
- import { C as t, D as n, E as r, J as i, O as a, S as o, T as s, _ as c, b as l, g as u, h as d, k as f, m as p, v as m, w as h, x as g, y as _ } from "./registry-CSOtIU7o.js";
3
- import { a as v } from "./TreePicker-D5XZT0Zi.js";
4
- import { a as y, i as ee, o as te, r as b } from "./generators-Bk3mvrsm.js";
1
+ import { It as e, Rt as t } from "./rolls-Bg1XHuvJ.js";
2
+ import { A as n, C as r, D as i, E as a, M as o, O as s, S as c, T as l, Z as u, _ as d, b as f, j as p, k as m, v as h, w as g, x as _, y as v } from "./useLayerEdit-ieOjHx6x.js";
3
+ import { a as y, i as ee, o as te, r as b } from "./generators-B8_StNAy.js";
5
4
  import { $ as ne, A as x, B as re, C as ie, D as ae, E as oe, F as se, G as S, H as ce, I as le, J as ue, K as de, L as fe, N as C, O as pe, P as me, Q as he, R as ge, S as _e, T as ve, U as ye, V as be, W as w, X as T, Y as E, Z as xe, _ as Se, a as D, at as O, b as Ce, c as we, ct as k, d as A, et as Te, f as j, g as M, i as N, it as P, k as Ee, l as F, lt as De, m as Oe, n as ke, nt as Ae, o as je, ot as I, p as Me, q as Ne, r as L, rt as Pe, s as Fe, st as Ie, t as R, tt as Le, u as z, v as Re, w as B, x as V, y as H, z as ze } from "./OrbitControls-Cql8Rn2i.js";
6
5
  //#region src/loops/gl/DriftEngine.js
7
6
  var Be = {
@@ -31,7 +30,7 @@ var Be = {
31
30
  antialias: !0,
32
31
  preserveDrawingBuffer: !0
33
32
  }), this.scene = new E(), this.cam = new j();
34
- let t = a[this.family][0];
33
+ let t = p[this.family][0];
35
34
  this.uniforms = {
36
35
  uPhase: { value: 0 },
37
36
  uAspect: { value: 1 },
@@ -81,7 +80,7 @@ var Be = {
81
80
  t.uLight.value.set(Math.cos(n), Math.sin(n));
82
81
  }
83
82
  if (e.period != null && (this.period = e.period), e.speed != null && (this.speed = e.speed), e.style != null && (t.uStyle.value = Be[e.style] ?? 0), e.palette != null) {
84
- let n = f(this.family, e.palette);
83
+ let n = o(this.family, e.palette);
85
84
  t.uColors.value = n.cols.map(U), t.uBase.value = U(n.base);
86
85
  }
87
86
  }
@@ -170,19 +169,19 @@ var Be = {
170
169
  }
171
170
  setParams(e) {
172
171
  if (!this.uniforms) return;
173
- let n = e.look ? h.find((t) => t.value === e.look) : null;
174
- n?.p && (e = {
172
+ let t = e.look ? i.find((t) => t.value === e.look) : null;
173
+ t?.p && (e = {
175
174
  ...e,
176
- ...n.p
175
+ ...t.p
177
176
  });
178
- let r = this.uniforms;
179
- if (e.cat != null && (r.uCat.value = Math.round(e.cat)), e.form != null && (r.uType.value = Math.round(e.form)), e.count != null && (r.uCount.value = Math.max(1, Math.min(6, Math.round(e.count)))), e.size != null && (r.uSize.value = e.size), e.spread != null && (r.uSpread.value = e.spread), e.irid != null && (r.uIrid.value = e.irid), e.hue != null && (r.uHue.value = e.hue), e.sheen != null && (r.uSheen.value = e.sheen), e.gloss != null && (r.uGloss.value = e.gloss), r.uRelief.value = e.relief ?? .9, e.warp != null && (r.uWarp.value = e.warp), e.grain != null && (r.uGrain.value = e.grain), e.spectral != null && (r.uSpectral.value = +!!e.spectral), e.angle != null && (r.uAngle.value = e.angle), r.uFreq.value = e.freq ?? 2, e.winds != null && (r.uWinds.value = e.winds), e.pitch != null && (r.uPitch.value = e.pitch), e.petals != null && (r.uPetals.value = e.petals), r.uSpin.value = e.spin ?? 1, e.mouth != null && (r.uMouth.value = e.mouth), e.speed != null && (this.speed = e.speed), e.palette != null) {
177
+ let n = this.uniforms;
178
+ if (e.cat != null && (n.uCat.value = Math.round(e.cat)), e.form != null && (n.uType.value = Math.round(e.form)), e.count != null && (n.uCount.value = Math.max(1, Math.min(6, Math.round(e.count)))), e.size != null && (n.uSize.value = e.size), e.spread != null && (n.uSpread.value = e.spread), e.irid != null && (n.uIrid.value = e.irid), e.hue != null && (n.uHue.value = e.hue), e.sheen != null && (n.uSheen.value = e.sheen), e.gloss != null && (n.uGloss.value = e.gloss), n.uRelief.value = e.relief ?? .9, e.warp != null && (n.uWarp.value = e.warp), e.grain != null && (n.uGrain.value = e.grain), e.spectral != null && (n.uSpectral.value = +!!e.spectral), e.angle != null && (n.uAngle.value = e.angle), n.uFreq.value = e.freq ?? 2, e.winds != null && (n.uWinds.value = e.winds), e.pitch != null && (n.uPitch.value = e.pitch), e.petals != null && (n.uPetals.value = e.petals), n.uSpin.value = e.spin ?? 1, e.mouth != null && (n.uMouth.value = e.mouth), e.speed != null && (this.speed = e.speed), e.palette != null) {
180
179
  let t = s.find((t) => t.value === e.palette) || s[0];
181
- r.uColors.value = t.cols.map(W);
180
+ n.uColors.value = t.cols.map(W);
182
181
  }
183
182
  if (e.backdrop != null) {
184
- let n = t.find((t) => t.value === e.backdrop) || t[0];
185
- r.uBg.value = W(n.col);
183
+ let t = a.find((t) => t.value === e.backdrop) || a[0];
184
+ n.uBg.value = W(t.col);
186
185
  }
187
186
  }
188
187
  setPlaying(e) {
@@ -281,7 +280,7 @@ var Be = {
281
280
  }
282
281
  setParams(e) {
283
282
  if (!this.uniforms) return;
284
- let n = this.uniforms, r = {
283
+ let t = this.uniforms, n = {
285
284
  hue: "uHue",
286
285
  irid: "uIrid",
287
286
  sheen: "uSheen",
@@ -295,18 +294,18 @@ var Be = {
295
294
  grain: "uGrain",
296
295
  edge: "uEdge"
297
296
  };
298
- for (let t in r) e[t] != null && (n[r[t]].value = e[t]);
299
- if (n.uBulge.value = e.bulge ?? .55, e.spectral != null && (n.uSpectral.value = +!!e.spectral), e.sweep != null) {
300
- let t = e.sweep * Math.PI / 180;
301
- n.uDir.value.set(Math.sin(t), Math.cos(t));
297
+ for (let r in n) e[r] != null && (t[n[r]].value = e[r]);
298
+ if (t.uBulge.value = e.bulge ?? .55, e.spectral != null && (t.uSpectral.value = +!!e.spectral), e.sweep != null) {
299
+ let n = e.sweep * Math.PI / 180;
300
+ t.uDir.value.set(Math.sin(n), Math.cos(n));
302
301
  }
303
302
  if (e.speed != null && (this.speed = e.speed), e.forms && this.setForms(e.forms), e.palette != null) {
304
- let t = s.find((t) => t.value === e.palette) || s[0];
305
- n.uColors.value = t.cols.map(Qe);
303
+ let n = s.find((t) => t.value === e.palette) || s[0];
304
+ t.uColors.value = n.cols.map(Qe);
306
305
  }
307
306
  if (e.backdrop != null) {
308
- let r = t.find((t) => t.value === e.backdrop) || t[0];
309
- n.uBg.value = Qe(r.col);
307
+ let n = a.find((t) => t.value === e.backdrop) || a[0];
308
+ t.uBg.value = Qe(n.col);
310
309
  }
311
310
  }
312
311
  setPlaying(e) {
@@ -405,7 +404,7 @@ var Be = {
405
404
  }
406
405
  setParams(e) {
407
406
  if (!this.uniforms) return;
408
- let n = this.uniforms, r = {
407
+ let t = this.uniforms, n = {
409
408
  hue: "uHue",
410
409
  irid: "uIrid",
411
410
  sheen: "uSheen",
@@ -417,18 +416,18 @@ var Be = {
417
416
  motion: "uMotion",
418
417
  grain: "uGrain"
419
418
  };
420
- for (let t in r) e[t] != null && (n[r[t]].value = e[t]);
421
- if (e.spectral != null && (n.uSpectral.value = +!!e.spectral), e.metaball != null && (n.uMetaball.value = +!!e.metaball), e.sweep != null) {
422
- let t = e.sweep * Math.PI / 180;
423
- n.uDir.value.set(Math.sin(t), Math.cos(t));
419
+ for (let r in n) e[r] != null && (t[n[r]].value = e[r]);
420
+ if (e.spectral != null && (t.uSpectral.value = +!!e.spectral), e.metaball != null && (t.uMetaball.value = +!!e.metaball), e.sweep != null) {
421
+ let n = e.sweep * Math.PI / 180;
422
+ t.uDir.value.set(Math.sin(n), Math.cos(n));
424
423
  }
425
424
  if (e.speed != null && (this.speed = e.speed), e.forms && this.setForms(e.forms), e.palette != null) {
426
- let t = s.find((t) => t.value === e.palette) || s[0];
427
- n.uColors.value = t.cols.map(rt);
425
+ let n = s.find((t) => t.value === e.palette) || s[0];
426
+ t.uColors.value = n.cols.map(rt);
428
427
  }
429
428
  if (e.backdrop != null) {
430
- let r = t.find((t) => t.value === e.backdrop) || t[0];
431
- n.uBg.value = rt(r.col);
429
+ let n = a.find((t) => t.value === e.backdrop) || a[0];
430
+ t.uBg.value = rt(n.col);
432
431
  }
433
432
  }
434
433
  setPlaying(e) {
@@ -905,17 +904,17 @@ var gt = "#0b0b0e", _t = .004, vt = 24, yt = class {
905
904
  return this.envTex ||= this.pmrem.fromScene(new ht(), .04).texture, this.envTex;
906
905
  }
907
906
  update({ globals: e, primitive: t, params: n } = {}) {
908
- let i = !1;
909
- if (t && t !== this.primId && (this.primId = t, i = !0), n && (this.params = {
907
+ let r = !1;
908
+ if (t && t !== this.primId && (this.primId = t, r = !0), n && (this.params = {
910
909
  ...this.params,
911
910
  ...n
912
- }, i = !0), e) {
911
+ }, r = !0), e) {
913
912
  this.globals = e, this.color = e.color || this.color, this.roughness = e.roughness ?? this.roughness, this.metalness = e.metalness ?? this.metalness, this.flat = !!e.flatShading, this.setMaterialType(e.materialType || "standard"), this.applyMaterialProps();
914
913
  let t = !!e.wireframe;
915
914
  for (let e of this.items) e.mesh.visible = !t, e.wire.visible = t;
916
- this.lineMat.linewidth = (e.strokeWidth ?? 3) * _t, e.rounding != null && e.rounding !== this.rounding && (this.rounding = e.rounding, this.primId === "box" && (i = !0)), this.setCount(e.count ?? 1), this.layoutPos = r(e.arrangement || "single", e.count ?? 1, e.spread ?? 2.2), e.duration && (this.dur = e.duration), e.fov != null && e.fov !== this.camera.fov && (this.camera.fov = e.fov, this.camera.updateProjectionMatrix()), this.scene.environment = e.environment ? this.ensureEnv() : null, this.axes.visible = !!e.showAxis, this.axes.scale.setScalar(e.axisLength ?? 1.5), this.axes.material.opacity = e.axisOpacity ?? .7;
915
+ this.lineMat.linewidth = (e.strokeWidth ?? 3) * _t, e.rounding != null && e.rounding !== this.rounding && (this.rounding = e.rounding, this.primId === "box" && (r = !0)), this.setCount(e.count ?? 1), this.layoutPos = m(e.arrangement || "single", e.count ?? 1, e.spread ?? 2.2), e.duration && (this.dur = e.duration), e.fov != null && e.fov !== this.camera.fov && (this.camera.fov = e.fov, this.camera.updateProjectionMatrix()), this.scene.environment = e.environment ? this.ensureEnv() : null, this.axes.visible = !!e.showAxis, this.axes.scale.setScalar(e.axisLength ?? 1.5), this.axes.material.opacity = e.axisOpacity ?? .7;
917
916
  }
918
- i && this.rebuildGeometry();
917
+ r && this.rebuildGeometry();
919
918
  }
920
919
  resize(e, t) {
921
920
  this.renderer.setSize(e, t, !1), this.camera.aspect = e / t, this.camera.updateProjectionMatrix(), this.lineMat.resolution.set(e, t), this.w = e, this.h = t;
@@ -1049,7 +1048,7 @@ var Ct = class {
1049
1048
  }, this.onProgress = null, this.autoLoop && (this.raf = requestAnimationFrame(this.loop));
1050
1049
  }
1051
1050
  _rebuild() {
1052
- this.count = l(this.form, this.samples), this.posArr = new Float32Array(this.count * 3), this.colArr = new Float32Array(this.count * 3), this.vparArr = new Float32Array(this.count), o(this.form, this.samples, this.vparArr);
1051
+ this.count = r(this.form, this.samples), this.posArr = new Float32Array(this.count * 3), this.colArr = new Float32Array(this.count * 3), this.vparArr = new Float32Array(this.count), l(this.form, this.samples, this.vparArr);
1053
1052
  let e = new A();
1054
1053
  e.setAttribute("position", new z(this.posArr, 3)), e.setAttribute("color", new z(this.colArr, 3));
1055
1054
  let t = this.geometry;
@@ -1208,9 +1207,9 @@ var Ct = class {
1208
1207
  }
1209
1208
  _rebuild() {
1210
1209
  let e = this.samples * this.samples;
1211
- this.posArr = new Float32Array(e * 3), this.colArr = new Float32Array(e * 3), this.vparArr = new Float32Array(e), _(this.env, this.samples, this.vparArr);
1210
+ this.posArr = new Float32Array(e * 3), this.colArr = new Float32Array(e * 3), this.vparArr = new Float32Array(e), c(this.env, this.samples, this.vparArr);
1212
1211
  let t = new A();
1213
- t.setAttribute("position", new z(this.posArr, 3)), t.setAttribute("color", new z(this.colArr, 3)), t.setIndex(new z(u(this.env, this.samples), 1));
1212
+ t.setAttribute("position", new z(this.posArr, 3)), t.setAttribute("color", new z(this.colArr, 3)), t.setIndex(new z(v(this.env, this.samples), 1));
1214
1213
  let n = this.geometry;
1215
1214
  this.geometry = t, this.mesh.geometry = t, n.dispose(), this._recolor();
1216
1215
  }
@@ -1259,7 +1258,7 @@ var Ct = class {
1259
1258
  dur: this.dur
1260
1259
  });
1261
1260
  let r = (this.dur > 0 ? n / this.dur : 0) * wt * (t.cycles ?? 2);
1262
- if (m(this.env, this.samples, r, { amp: t.amp ?? .5 }, this.posArr), this.geometry.attributes.position.needsUpdate = !0, this.geometry.computeVertexNormals(), this.controls.autoRotate = !this.recording && !!t.spin && !t.paused && !c(this.env), this.controls.autoRotateSpeed = 2 * (t.spinSpeed ?? 1), this.controls.update(), this.w && this.h && this.renderer.render(this.scene, this.camera), this.recording && this.accum >= this.dur && this._recStop) {
1261
+ if (_(this.env, this.samples, r, { amp: t.amp ?? .5 }, this.posArr), this.geometry.attributes.position.needsUpdate = !0, this.geometry.computeVertexNormals(), this.controls.autoRotate = !this.recording && !!t.spin && !t.paused && !f(this.env), this.controls.autoRotateSpeed = 2 * (t.spinSpeed ?? 1), this.controls.update(), this.w && this.h && this.renderer.render(this.scene, this.camera), this.recording && this.accum >= this.dur && this._recStop) {
1263
1262
  let e = this._recStop;
1264
1263
  this._recStop = null, e();
1265
1264
  }
@@ -1607,26 +1606,26 @@ function zt(e, t, n, r) {
1607
1606
  }
1608
1607
  return o;
1609
1608
  }
1610
- function Bt({ seed: e = 1, loops: t = 3, height: n = 2.2, gap: r = .92, depth: a = .35, curl: o = 1 } = {}) {
1611
- let s = i(e >>> 0 || 1), c = (e) => (s() - .5) * 2 * e, l = Math.max(1, Math.round(t)), u = -((l - 1) * r) / 2, d = n, f = [], p = 0, m = (t, n) => {
1612
- f.push(new I(t, n, Math.sin(p * 1.7 + e) * a)), p += 1;
1609
+ function Bt({ seed: e = 1, loops: t = 3, height: n = 2.2, gap: r = .92, depth: i = .35, curl: a = 1 } = {}) {
1610
+ let o = u(e >>> 0 || 1), s = (e) => (o() - .5) * 2 * e, c = Math.max(1, Math.round(t)), l = -((c - 1) * r) / 2, d = n, f = [], p = 0, m = (t, n) => {
1611
+ f.push(new I(t, n, Math.sin(p * 1.7 + e) * i)), p += 1;
1613
1612
  };
1614
- for (let e = 0; e < l; e++) {
1615
- let t = u + e * r + c(r * .06), n = e % 2 == 0, i = n ? -d / 2 : d / 2, a = n ? d / 2 : -d / 2;
1613
+ for (let e = 0; e < c; e++) {
1614
+ let t = l + e * r + s(r * .06), n = e % 2 == 0, i = n ? -d / 2 : d / 2, a = n ? d / 2 : -d / 2;
1616
1615
  for (let e = 0; e < 10; e++) m(t, i + (a - i) * e / 10);
1617
- if (e < l - 1) {
1618
- let i = u + (e + 1) * r, o = (t + i) / 2, s = (i - t) / 2, c = n ? 1 : -1;
1616
+ if (e < c - 1) {
1617
+ let i = l + (e + 1) * r, o = (t + i) / 2, s = (i - t) / 2, c = n ? 1 : -1;
1619
1618
  for (let e = 0; e <= 24; e++) {
1620
1619
  let t = e / 24 * Math.PI;
1621
1620
  m(o - Math.cos(t) * s, a + c * Math.sin(t) * s);
1622
1621
  }
1623
1622
  }
1624
1623
  }
1625
- if (o > 0 && f.length >= 2) {
1626
- let t = f[f.length - 1], n = f[f.length - 2], i = t.clone().sub(n).setZ(0).normalize(), s = new I(-i.y, i.x, 0).normalize(), c = r * .5, l = t.clone().add(s.clone().multiplyScalar(c)), u = Math.atan2(t.y - l.y, t.x - l.x), d = 1.1 * o;
1624
+ if (a > 0 && f.length >= 2) {
1625
+ let t = f[f.length - 1], n = f[f.length - 2], o = t.clone().sub(n).setZ(0).normalize(), s = new I(-o.y, o.x, 0).normalize(), c = r * .5, l = t.clone().add(s.clone().multiplyScalar(c)), u = Math.atan2(t.y - l.y, t.x - l.x), d = 1.1 * a;
1627
1626
  for (let n = 1; n <= 44; n++) {
1628
- let r = n / 44, i = u - d * Math.PI * 2 * r, o = c * (1 - .7 * r);
1629
- f.push(new I(l.x + Math.cos(i) * o, l.y + Math.sin(i) * o, t.z + Math.sin(r * 3 + e) * a * .4));
1627
+ let r = n / 44, a = u - d * Math.PI * 2 * r, o = c * (1 - .7 * r);
1628
+ f.push(new I(l.x + Math.cos(a) * o, l.y + Math.sin(a) * o, t.z + Math.sin(r * 3 + e) * i * .4));
1630
1629
  }
1631
1630
  }
1632
1631
  return new Oe(f, !1, "centripetal");
@@ -2159,184 +2158,184 @@ var on = {
2159
2158
  paused: !1,
2160
2159
  speed: 0
2161
2160
  };
2162
- function sn(t, n, r) {
2163
- if (cn(t, n, r), typeof n.setPointer == "function") {
2164
- let t = e.getCtx().stage, i = r.w ?? 0, a = r.h ?? 0, o = null;
2165
- if (t && i > 0 && a > 0) {
2166
- let e = (t.x - (r.x ?? 0)) / i, n = (t.y - (r.y ?? 0)) / a;
2167
- e >= 0 && e <= 1 && n >= 0 && n <= 1 && (o = {
2168
- x: e,
2161
+ function sn(e, n, r) {
2162
+ if (cn(e, n, r), typeof n.setPointer == "function") {
2163
+ let e = t.getCtx().stage, i = r.w ?? 0, a = r.h ?? 0, o = null;
2164
+ if (e && i > 0 && a > 0) {
2165
+ let t = (e.x - (r.x ?? 0)) / i, n = (e.y - (r.y ?? 0)) / a;
2166
+ t >= 0 && t <= 1 && n >= 0 && n <= 1 && (o = {
2167
+ x: t,
2169
2168
  y: n,
2170
- down: !!t.down
2169
+ down: !!e.down
2171
2170
  });
2172
2171
  }
2173
2172
  n.setPointer(o);
2174
2173
  }
2175
- t.bgToggle && n.renderer?.setClearAlpha(r.bgOn === !1 ? 0 : 1);
2174
+ e.bgToggle && n.renderer?.setClearAlpha(r.bgOn === !1 ? 0 : 1);
2176
2175
  }
2177
- function cn(e, t, n) {
2178
- switch (e.engine) {
2176
+ function cn(t, n, r) {
2177
+ switch (t.engine) {
2179
2178
  case "scene": {
2180
- $t.set(t, n.duration ?? 8);
2179
+ $t.set(n, r.duration ?? 8);
2181
2180
  let e = {
2182
- tube: n.tube ?? .32,
2183
- p: n.pWinds ?? 2,
2184
- q: n.qWinds ?? 3,
2185
- detail: n.detail ?? 0
2186
- }, r = `${e.tube}|${e.p}|${e.q}|${e.detail}`, i = en.get(t) !== r;
2187
- i && en.set(t, r), t.update({
2188
- primitive: n.primitive,
2181
+ tube: r.tube ?? .32,
2182
+ p: r.pWinds ?? 2,
2183
+ q: r.qWinds ?? 3,
2184
+ detail: r.detail ?? 0
2185
+ }, t = `${e.tube}|${e.p}|${e.q}|${e.detail}`, i = en.get(n) !== t;
2186
+ i && en.set(n, t), n.update({
2187
+ primitive: r.primitive,
2189
2188
  ...i ? { params: e } : {},
2190
2189
  globals: {
2191
- preset: n.pose,
2192
- animMode: n.animMode === "keyframes" || n.animMode === "keyframe" ? "keyframe" : "preset",
2193
- keyframes: Array.isArray(n.keyframes) && n.keyframes.length ? n.keyframes : y,
2190
+ preset: r.pose,
2191
+ animMode: r.animMode === "keyframes" || r.animMode === "keyframe" ? "keyframe" : "preset",
2192
+ keyframes: Array.isArray(r.keyframes) && r.keyframes.length ? r.keyframes : y,
2194
2193
  loop: !0,
2195
2194
  paused: !1,
2196
2195
  speed: 0,
2197
- duration: n.duration ?? 8,
2198
- count: n.count,
2199
- arrangement: n.arrangement,
2200
- spread: n.spread,
2201
- objectSize: n.objectSize,
2202
- stagger: n.stagger,
2203
- cameraMotion: n.cameraMotion,
2204
- orbitSpeed: n.orbitSpeed,
2205
- fov: n.fov,
2206
- wireframe: n.wireframe,
2207
- strokeWidth: n.strokeWidth,
2208
- materialType: n.materialType,
2209
- environment: n.environment,
2210
- roughness: n.roughness,
2211
- metalness: n.metalness,
2212
- color: n.sceneColor,
2213
- flatShading: !!n.flatShading,
2214
- rounding: n.rounding,
2215
- showAxis: !!n.showAxis,
2216
- axisLength: n.axisLength,
2217
- axisOpacity: n.axisOpacity
2196
+ duration: r.duration ?? 8,
2197
+ count: r.count,
2198
+ arrangement: r.arrangement,
2199
+ spread: r.spread,
2200
+ objectSize: r.objectSize,
2201
+ stagger: r.stagger,
2202
+ cameraMotion: r.cameraMotion,
2203
+ orbitSpeed: r.orbitSpeed,
2204
+ fov: r.fov,
2205
+ wireframe: r.wireframe,
2206
+ strokeWidth: r.strokeWidth,
2207
+ materialType: r.materialType,
2208
+ environment: r.environment,
2209
+ roughness: r.roughness,
2210
+ metalness: r.metalness,
2211
+ color: r.sceneColor,
2212
+ flatShading: !!r.flatShading,
2213
+ rounding: r.rounding,
2214
+ showAxis: !!r.showAxis,
2215
+ axisLength: r.axisLength,
2216
+ axisOpacity: r.axisOpacity
2218
2217
  }
2219
2218
  });
2220
2219
  return;
2221
2220
  }
2222
2221
  case "softforms3d":
2223
- t.setParams(n), n.camTheta != null && t.setCamera({
2224
- theta: n.camTheta,
2225
- phi: n.camPhi ?? .35,
2226
- dist: n.camDist ?? 3
2222
+ n.setParams(r), r.camTheta != null && n.setCamera({
2223
+ theta: r.camTheta,
2224
+ phi: r.camPhi ?? .35,
2225
+ dist: r.camDist ?? 3
2227
2226
  });
2228
2227
  return;
2229
2228
  case "forms":
2230
- t.update({
2231
- form: n.form,
2229
+ n.update({
2230
+ form: r.form,
2232
2231
  globals: {
2233
2232
  ...on,
2234
2233
  duration: 8,
2235
- samples: n.samples,
2236
- cycles: n.cycles,
2237
- amp: n.amp,
2238
- pointSize: n.pointSize,
2239
- turns: n.turns,
2240
- radius: n.radius,
2241
- height: n.height,
2242
- spin: n.spin,
2243
- spinSpeed: n.spinSpeed,
2244
- fov: n.fov,
2245
- color: n.formColor,
2246
- accent: n.accent
2234
+ samples: r.samples,
2235
+ cycles: r.cycles,
2236
+ amp: r.amp,
2237
+ pointSize: r.pointSize,
2238
+ turns: r.turns,
2239
+ radius: r.radius,
2240
+ height: r.height,
2241
+ spin: r.spin,
2242
+ spinSpeed: r.spinSpeed,
2243
+ fov: r.fov,
2244
+ color: r.formColor,
2245
+ accent: r.accent
2247
2246
  }
2248
2247
  });
2249
2248
  return;
2250
2249
  case "environment":
2251
- t.update({
2252
- env: n.env,
2250
+ n.update({
2251
+ env: r.env,
2253
2252
  globals: {
2254
2253
  ...on,
2255
2254
  duration: 8,
2256
- samples: n.samples,
2257
- cycles: n.cycles,
2258
- amp: n.amp,
2259
- spin: n.spin,
2260
- spinSpeed: n.spinSpeed,
2261
- fov: n.fov,
2262
- color: n.formColor,
2263
- accent: n.accent
2255
+ samples: r.samples,
2256
+ cycles: r.cycles,
2257
+ amp: r.amp,
2258
+ spin: r.spin,
2259
+ spinSpeed: r.spinSpeed,
2260
+ fov: r.fov,
2261
+ color: r.formColor,
2262
+ accent: r.accent
2264
2263
  }
2265
2264
  });
2266
2265
  return;
2267
2266
  case "ribbon":
2268
- $t.set(t, n.duration ?? 12), t.update({
2267
+ $t.set(n, r.duration ?? 12), n.update({
2269
2268
  geom: {
2270
- seed: n.seed,
2271
- loops: n.loops,
2272
- height: n.height,
2273
- gap: n.gap,
2274
- depth: n.depth,
2275
- curl: n.curl,
2276
- width: n.width,
2277
- ribbonThickness: n.ribbonThickness ?? .12,
2278
- corner: n.corner ?? .045
2269
+ seed: r.seed,
2270
+ loops: r.loops,
2271
+ height: r.height,
2272
+ gap: r.gap,
2273
+ depth: r.depth,
2274
+ curl: r.curl,
2275
+ width: r.width,
2276
+ ribbonThickness: r.ribbonThickness ?? .12,
2277
+ corner: r.corner ?? .045
2279
2278
  },
2280
2279
  globals: {
2281
2280
  ...on,
2282
- duration: n.duration ?? 12,
2283
- flow: n.flow,
2284
- cameraOrbit: n.cameraOrbit,
2285
- orbitSpeed: n.orbitSpeed,
2286
- fov: n.fov,
2287
- materialType: n.materialType,
2288
- color: n.ribbonColor,
2289
- roughness: n.roughness,
2290
- metalness: n.metalness,
2291
- ior: n.ior,
2292
- dispersion: n.dispersion,
2293
- wireframe: !!n.wireframe,
2294
- strokeWidth: n.wireStroke ?? 2.5,
2295
- aberration: n.aberration,
2296
- bloom: n.bloom,
2297
- vignette: n.vignette,
2298
- grain: n.grain
2281
+ duration: r.duration ?? 12,
2282
+ flow: r.flow,
2283
+ cameraOrbit: r.cameraOrbit,
2284
+ orbitSpeed: r.orbitSpeed,
2285
+ fov: r.fov,
2286
+ materialType: r.materialType,
2287
+ color: r.ribbonColor,
2288
+ roughness: r.roughness,
2289
+ metalness: r.metalness,
2290
+ ior: r.ior,
2291
+ dispersion: r.dispersion,
2292
+ wireframe: !!r.wireframe,
2293
+ strokeWidth: r.wireStroke ?? 2.5,
2294
+ aberration: r.aberration,
2295
+ bloom: r.bloom,
2296
+ vignette: r.vignette,
2297
+ grain: r.grain
2299
2298
  }
2300
- }), n.background != null && t.setBackground(n.background);
2299
+ }), r.background != null && n.setBackground(r.background);
2301
2300
  return;
2302
2301
  case "mesh": {
2303
- let e = n.mode === "grid" ? "grid" : "single", r = n.seed ?? 7, i = e === "grid" ? Array.from({ length: 9 }, (e, t) => r + t * 7919) : [r];
2304
- t.update({
2305
- mode: e,
2302
+ let t = r.mode === "grid" ? "grid" : "single", i = r.seed ?? 7, a = t === "grid" ? Array.from({ length: 9 }, (e, t) => i + t * 7919) : [i];
2303
+ n.update({
2304
+ mode: t,
2306
2305
  idx: 0,
2307
- specs: i.map((e) => ln(e, n)),
2306
+ specs: a.map((e) => ln(e, r)),
2308
2307
  globals: {
2309
- glow: n.glow,
2310
- grain: n.grain,
2311
- speed: n.speed,
2308
+ glow: r.glow,
2309
+ grain: r.grain,
2310
+ speed: r.speed,
2312
2311
  paused: !1,
2313
- bg: n.bgAmount ?? .85,
2314
- bgStyle: n.bgStyle ?? 0
2312
+ bg: r.bgAmount ?? .85,
2313
+ bgStyle: r.bgStyle ?? 0
2315
2314
  }
2316
- }), t.setBackground(v(n.themeId ?? "kol", !!n.themeInvert).bg);
2315
+ }), n.setBackground(e(r.themeId ?? "kol", !!r.themeInvert).bg);
2317
2316
  return;
2318
2317
  }
2319
- default: t.setParams(n);
2318
+ default: n.setParams(r);
2320
2319
  }
2321
2320
  }
2322
2321
  function ln(e, t) {
2323
- let n = i(e);
2322
+ let n = u(e);
2324
2323
  n(), n(), n();
2325
- let r = n(), a = .12 + n() * .3, o = n() * Math.PI * 2, s = p.find((e) => e.id === t.palette) || p[0];
2324
+ let r = n(), i = .12 + n() * .3, a = n() * Math.PI * 2, o = d.find((e) => e.id === t.palette) || d[0];
2326
2325
  return {
2327
2326
  seed: e,
2328
2327
  shape: t.shape || "sphere",
2329
- colors: s.colors.map((e) => d(e, t.hueShift || 0)),
2328
+ colors: o.colors.map((e) => h(e, t.hueShift || 0)),
2330
2329
  driver: t.driver ?? 0,
2331
2330
  distort: (t.distort ?? .5) * (.6 + r * .5),
2332
- rotSpeed: a,
2333
- phase: o
2331
+ rotSpeed: i,
2332
+ phase: a
2334
2333
  };
2335
2334
  }
2336
- function un(t, n, { u: r, dt: i }) {
2337
- if (t.drive === "phase") n.renderAtPhase(r);
2338
- else if (t.drive === "seek") {
2339
- let t = $t.get(n), i = t ? ee(r, b(t, e.getLoopSeconds())) : r;
2335
+ function un(e, n, { u: r, dt: i }) {
2336
+ if (e.drive === "phase") n.renderAtPhase(r);
2337
+ else if (e.drive === "seek") {
2338
+ let e = $t.get(n), i = e ? ee(r, b(e, t.getLoopSeconds())) : r;
2340
2339
  n.seek(i), n.frame(0);
2341
2340
  } else n.frame(i);
2342
2341
  }