@kolkrabbi/design-editor 0.47.0 → 0.48.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.
- package/dist/{BindDot-B85UV79g.js → BindDot-Cx-M0iQt.js} +1 -1
- package/dist/{KolboxView-n6kEPJtV.js → KolboxView-BjYfn_tl.js} +934 -934
- package/dist/{Timeline-EbecYeGh.js → Timeline-CRr43b4B.js} +3 -9
- package/dist/{TreePicker-2RUSyGl4.js → TreePicker-DXsAlHK6.js} +24 -24
- package/dist/{core-9UlJPBwX.js → core-BbKj9Svq.js} +3652 -6014
- package/dist/core.js +5 -5
- package/dist/design-editor.css +1 -1
- package/dist/design-editor.js +6 -6
- package/dist/{effectCategories-CCpYmxS0.js → effectCategories-wHY9ih8L.js} +32 -32
- package/dist/{effects-DspYFJAM.js → effects-D7J0e5xl.js} +40 -40
- package/dist/effects.js +1 -1
- package/dist/{generators-DY4_ymWh.js → generators-BtRZ3Stj.js} +608 -643
- package/dist/generators.js +1 -1
- package/dist/{host-Bo6itV50.js → host-II9SeVCH.js} +2 -2
- package/dist/kolbox-sheet.js +0 -0
- package/dist/kolbox.css +3 -0
- package/dist/{morphStore-Bm30Ekce.js → morphStore-s-rjCe-y.js} +1 -1
- package/dist/{motion-BOWE4m3Q.js → motion-CKtZAccJ.js} +28 -28
- package/dist/motion.js +1 -1
- package/dist/{rolls-DugKaHUw.js → rolls-Cnu6g8th.js} +2897 -3068
- package/dist/{src-BlvCHYVY.js → src-3UkpFoNW.js} +727 -969
- package/dist/{store-BMGP1qou.js → store-YIW6P2zN.js} +15 -15
- package/dist/{useLayerEdit-B5nF5I9b.js → useLayerEdit-W_Tf3adq.js} +91 -91
- package/package.json +14 -14
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { E as e, O as t, i as n, j as r, o as i, r as a, w as o } from "./__vite-browser-external-y2xWjzgx.js";
|
|
2
|
-
import { B as s, Bt as c, C as l, D as u, F as d,
|
|
3
|
-
import { c as
|
|
4
|
-
import { C as
|
|
5
|
-
import { n as
|
|
6
|
-
import { B as
|
|
7
|
-
import { h as
|
|
8
|
-
import { BezierPathEditor as
|
|
2
|
+
import { B as s, Bt as c, C as l, D as u, F as d, Ft as f, Gn as p, Ht as m, I as h, It as g, J as _, Kn as v, L as y, Lt as b, Mr as x, Nr as S, Nt as C, Pt as w, Qt as T, Rt as E, S as D, Ut as O, Vt as k, Wt as ee, X as te, Xn as ne, Yn as re, Zn as ie, a as ae, an as oe, at as se, c as ce, d as le, en as ue, f as A, hn as de, hr as fe, l as j, m as pe, n as me, o as he, p as ge, q as _e, qn as ve, s as ye, t as be, tr as xe, u as Se, x as Ce, xn as M, zt as we } from "./rolls-Cnu6g8th.js";
|
|
3
|
+
import { c as Te, n as Ee, t as De } from "./useLayerEdit-W_Tf3adq.js";
|
|
4
|
+
import { C as Oe, Ct as ke, D as Ae, E as je, F as Me, I as Ne, L as Pe, M as Fe, O as Ie, P as Le, S as Re, St as ze, T as Be, _ as Ve, _t as He, b as Ue, bt as We, d as Ge, dt as Ke, f as qe, ft as Je, gt as Ye, h as Xe, ht as Ze, l as Qe, m as $e, mt as et, n as tt, pt as nt, r as rt, t as it, ut as at, v as ot, vt as st, w as ct, wt as lt, x as ut, xt as dt, y as ft } from "./effectCategories-wHY9ih8L.js";
|
|
5
|
+
import { n as pt, t as mt } from "./TreePicker-DXsAlHK6.js";
|
|
6
|
+
import { B as ht, I as gt, a as _t, c as vt, g as yt, i as bt, o as xt, r as St, s as Ct, u as wt } from "./store-YIW6P2zN.js";
|
|
7
|
+
import { h as Tt, r as Et, s as Dt, t as Ot, u as kt } from "./morphStore-s-rjCe-y.js";
|
|
8
|
+
import { BezierPathEditor as At, Button as N, ButtonGroup as jt, CurveEditor as Mt, Divider as Nt, Dropdown as Pt, FullscreenOverlay as Ft, Input as It, KeyframeEditor as Lt, LabeledControl as Rt, LabeledControlSection as zt, ModalDialog as Bt, ModalShell as Vt, SettingsDisclosure as Ht, SettingsFieldMap as Ut, SettingsGrid as Wt, SettingsLights as Gt, SettingsPoint as Kt, SettingsRamp as qt, SettingsRampHead as Jt, SettingsRow as Yt, ShellSearchOverlay as Xt, Slider as Zt, StepList as Qt, TabsRow as $t, ToggleSwitch as en, Tooltip as tn, XYPad as nn } from "@kolkrabbi/kol-component";
|
|
9
9
|
import { Fragment as rn, useCallback as an, useEffect as on, useId as sn, useMemo as cn, useRef as ln, useState as un } from "react";
|
|
10
10
|
import { Fragment as dn, jsx as P, jsxs as F } from "react/jsx-runtime";
|
|
11
11
|
import { PropertyRail as fn } from "@kolkrabbi/kol-shell";
|
|
@@ -83,7 +83,7 @@ var pn = [
|
|
|
83
83
|
paratype: "Para Type · Misc",
|
|
84
84
|
distress: "Distressor · Vector",
|
|
85
85
|
modulator: "Modulator · Vector"
|
|
86
|
-
}, _n = Object.fromEntries(
|
|
86
|
+
}, _n = Object.fromEntries(at.params.map((e) => [e.key, e.default]));
|
|
87
87
|
function vn(e) {
|
|
88
88
|
let t = { ..._n };
|
|
89
89
|
for (let n of Object.keys(_n)) {
|
|
@@ -99,7 +99,7 @@ function yn(e, t) {
|
|
|
99
99
|
var bn = (e) => Number(e.toFixed(2));
|
|
100
100
|
function xn(e, t, n) {
|
|
101
101
|
if (!e || e.loopId !== "paratype-glyph") return null;
|
|
102
|
-
let r = Math.max(1, e.w ?? 480), i = Math.max(1, e.h ?? 480), a = vn(e), o =
|
|
102
|
+
let r = Math.max(1, e.w ?? 480), i = Math.max(1, e.h ?? 480), a = vn(e), o = Ke(a, r, i);
|
|
103
103
|
if (!o.length) return null;
|
|
104
104
|
let s = [];
|
|
105
105
|
t.bg && s.push({
|
|
@@ -157,12 +157,12 @@ function Sn(e, t) {
|
|
|
157
157
|
_framePreset: "custom",
|
|
158
158
|
_formPreset: "custom",
|
|
159
159
|
_lookPreset: "custom",
|
|
160
|
-
...
|
|
160
|
+
...Be(e)
|
|
161
161
|
};
|
|
162
162
|
}
|
|
163
163
|
function Cn(e, t, n = "preset") {
|
|
164
164
|
if (!e?.loopGroup) return null;
|
|
165
|
-
let r = e.loopGroup, i =
|
|
165
|
+
let r = e.loopGroup, i = je(r);
|
|
166
166
|
if (!i.length) return null;
|
|
167
167
|
let a = i.find((t) => t.id === e.presetId) ?? i[0], o = (e, t) => (e % t + t) % t;
|
|
168
168
|
if (n === "category") {
|
|
@@ -187,13 +187,13 @@ var wn = {
|
|
|
187
187
|
function Tn(e, t, n) {
|
|
188
188
|
let r = e?.loopGroup;
|
|
189
189
|
if (!r) return !1;
|
|
190
|
-
let i =
|
|
191
|
-
return t === "type" ? n.some((e) => e !== r &&
|
|
190
|
+
let i = je(r).filter((e) => !ft(e)), a = i.find((t) => t.id === e.presetId) ?? i[0];
|
|
191
|
+
return t === "type" ? n.some((e) => e !== r && je(e).some((e) => !ft(e))) : t === "category" ? new Set(i.map((e) => e.sub).filter((e) => e && e !== a?.sub)).size > 0 : i.some((e) => e.id !== a?.id && (!a?.sub || e.sub === a.sub));
|
|
192
192
|
}
|
|
193
193
|
function En(e, t, n, r) {
|
|
194
194
|
let i = e?.loopGroup;
|
|
195
195
|
if (!i) return null;
|
|
196
|
-
let a = (e) => e[Math.floor(n() * e.length)], o = (e) =>
|
|
196
|
+
let a = (e) => e[Math.floor(n() * e.length)], o = (e) => je(e).filter((e) => !ft(e));
|
|
197
197
|
if (t === "type") {
|
|
198
198
|
let e = r.filter((e) => e !== i && o(e).length);
|
|
199
199
|
if (!e.length) return null;
|
|
@@ -221,15 +221,15 @@ function Dn(e, t, n) {
|
|
|
221
221
|
}
|
|
222
222
|
return r;
|
|
223
223
|
}
|
|
224
|
-
var On = null, kn = () => On ??= [...
|
|
224
|
+
var On = null, kn = () => On ??= [...rt(qe).filter((e) => !e.rack).map((e) => ({
|
|
225
225
|
id: e.id,
|
|
226
226
|
filters: e.filters
|
|
227
|
-
})), ...
|
|
227
|
+
})), ...it.map((e) => ({
|
|
228
228
|
id: e.id,
|
|
229
|
-
filters:
|
|
229
|
+
filters: Ge(e, qe)
|
|
230
230
|
}))].filter((e) => e.filters.length);
|
|
231
231
|
function An(e, t, n) {
|
|
232
|
-
let r = (e) => e[Math.floor(n() * e.length)], i =
|
|
232
|
+
let r = (e) => e[Math.floor(n() * e.length)], i = tt(e);
|
|
233
233
|
if (t === "type") {
|
|
234
234
|
let e = kn().filter((e) => e.id !== i);
|
|
235
235
|
return e.length ? r(r(e).filters).id : null;
|
|
@@ -238,16 +238,16 @@ function An(e, t, n) {
|
|
|
238
238
|
return a.length ? r(a).id : null;
|
|
239
239
|
}
|
|
240
240
|
function jn(e, t, n) {
|
|
241
|
-
let r =
|
|
241
|
+
let r = Qe(e?.id), i = (e?.params.find((e) => e.key === r)?.options ?? []).map((e) => typeof e == "object" ? e.value : e).filter((e) => e !== t[r]);
|
|
242
242
|
return i.length ? i[Math.floor(n() * i.length)] : null;
|
|
243
243
|
}
|
|
244
244
|
function Mn(e, t) {
|
|
245
|
-
return e ? t === "type" ? kn().length > 1 : t === "category" ? (kn().find((t) => t.id ===
|
|
245
|
+
return e ? t === "type" ? kn().length > 1 : t === "category" ? (kn().find((t) => t.id === tt(e.id))?.filters.length ?? 0) > 1 : t === "preset" ? !!Qe(e.id) : !0 : !1;
|
|
246
246
|
}
|
|
247
247
|
//#endregion
|
|
248
248
|
//#region src/editor/compose/inspectors/LoopPicker.jsx
|
|
249
249
|
function Nn({ layer: e, tree: t = hn, inline: n = !0, about: r = null }) {
|
|
250
|
-
let { updateLayer: i } =
|
|
250
|
+
let { updateLayer: i } = _(), a = y(), o = e.loopGroup ?? "shape", s = t.find((e) => e.groups.includes(o)) ?? null, c = je(o), l = c.find((t) => t.id === e.presetId), u = [...new Set(c.map((e) => e.sub).filter(Boolean))], d = l?.sub ?? u[0], f = u.length ? c.filter((e) => e.sub === d) : c, m = (t, n = o) => {
|
|
251
251
|
t && i(e.id, {
|
|
252
252
|
loopGroup: n,
|
|
253
253
|
presetId: t.id,
|
|
@@ -256,16 +256,16 @@ function Nn({ layer: e, tree: t = hn, inline: n = !0, about: r = null }) {
|
|
|
256
256
|
_framePreset: "custom",
|
|
257
257
|
_formPreset: "custom",
|
|
258
258
|
_lookPreset: "custom",
|
|
259
|
-
...
|
|
259
|
+
...Be(t)
|
|
260
260
|
});
|
|
261
261
|
};
|
|
262
262
|
return /* @__PURE__ */ F(dn, { children: [
|
|
263
|
-
t.length > 1 || !s ? /* @__PURE__ */ P(
|
|
263
|
+
t.length > 1 || !s ? /* @__PURE__ */ P(pt, {
|
|
264
264
|
label: "Type",
|
|
265
265
|
inline: n,
|
|
266
266
|
children: /* @__PURE__ */ F("div", {
|
|
267
267
|
className: "flex flex-col gap-1 w-full",
|
|
268
|
-
children: [s ? /* @__PURE__ */ P(
|
|
268
|
+
children: [s ? /* @__PURE__ */ P(mt, {
|
|
269
269
|
options: t.map((e) => ({
|
|
270
270
|
value: e.label,
|
|
271
271
|
label: e.label
|
|
@@ -273,22 +273,22 @@ function Nn({ layer: e, tree: t = hn, inline: n = !0, about: r = null }) {
|
|
|
273
273
|
value: s.label,
|
|
274
274
|
onChange: (e) => {
|
|
275
275
|
let n = t.find((t) => t.label === e);
|
|
276
|
-
n &&
|
|
276
|
+
n && m(je(n.groups[0])[0], n.groups[0]);
|
|
277
277
|
}
|
|
278
278
|
}) : /* @__PURE__ */ P("span", {
|
|
279
279
|
className: "kol-helper-12 text-meta px-1",
|
|
280
|
-
children: gn[o] ??
|
|
281
|
-
}), s && s.groups.length > 1 && /* @__PURE__ */ P(
|
|
280
|
+
children: gn[o] ?? Ve(o).label
|
|
281
|
+
}), s && s.groups.length > 1 && /* @__PURE__ */ P(mt, {
|
|
282
282
|
options: s.groups.map((e) => ({
|
|
283
283
|
value: e,
|
|
284
|
-
label: s.labels?.[e] ??
|
|
284
|
+
label: s.labels?.[e] ?? Ve(e).label
|
|
285
285
|
})),
|
|
286
286
|
value: o,
|
|
287
|
-
onChange: (e) =>
|
|
287
|
+
onChange: (e) => m(je(e)[0], e)
|
|
288
288
|
})]
|
|
289
289
|
})
|
|
290
290
|
}) : null,
|
|
291
|
-
u.length > 1 && /* @__PURE__ */ P(
|
|
291
|
+
u.length > 1 && /* @__PURE__ */ P(pt, {
|
|
292
292
|
inline: n,
|
|
293
293
|
label: "Category",
|
|
294
294
|
options: u.map((e) => ({
|
|
@@ -296,15 +296,15 @@ function Nn({ layer: e, tree: t = hn, inline: n = !0, about: r = null }) {
|
|
|
296
296
|
label: e
|
|
297
297
|
})),
|
|
298
298
|
value: d,
|
|
299
|
-
onChange: (e) =>
|
|
299
|
+
onChange: (e) => m(c.find((t) => t.sub === e))
|
|
300
300
|
}),
|
|
301
|
-
/* @__PURE__ */ P(
|
|
301
|
+
/* @__PURE__ */ P(pt, {
|
|
302
302
|
inline: n,
|
|
303
303
|
label: "Preset",
|
|
304
304
|
children: /* @__PURE__ */ F("div", {
|
|
305
305
|
className: "flex w-full gap-1",
|
|
306
306
|
children: [
|
|
307
|
-
f.length > 1 && /* @__PURE__ */ P(
|
|
307
|
+
f.length > 1 && /* @__PURE__ */ P(p, {
|
|
308
308
|
size: a,
|
|
309
309
|
iconOnly: "chevron-left",
|
|
310
310
|
"aria-label": "Previous preset (H)",
|
|
@@ -313,16 +313,16 @@ function Nn({ layer: e, tree: t = hn, inline: n = !0, about: r = null }) {
|
|
|
313
313
|
t && i(e.id, t);
|
|
314
314
|
}
|
|
315
315
|
}),
|
|
316
|
-
/* @__PURE__ */ P(
|
|
316
|
+
/* @__PURE__ */ P(mt, {
|
|
317
317
|
className: "flex-1 min-w-0",
|
|
318
318
|
options: f.map((e) => ({
|
|
319
319
|
value: e.id,
|
|
320
320
|
label: e.label
|
|
321
321
|
})),
|
|
322
322
|
value: e.presetId,
|
|
323
|
-
onChange: (e) =>
|
|
323
|
+
onChange: (e) => m(c.find((t) => t.id === e))
|
|
324
324
|
}),
|
|
325
|
-
f.length > 1 && /* @__PURE__ */ P(
|
|
325
|
+
f.length > 1 && /* @__PURE__ */ P(p, {
|
|
326
326
|
size: a,
|
|
327
327
|
iconOnly: "chevron-right",
|
|
328
328
|
"aria-label": "Next preset (L)",
|
|
@@ -341,8 +341,8 @@ function Nn({ layer: e, tree: t = hn, inline: n = !0, about: r = null }) {
|
|
|
341
341
|
//#region src/editor/params/RollScopesDialog.jsx
|
|
342
342
|
function Pn({ open: t, onClose: n, schema: r, layer: i, size: a = "md" }) {
|
|
343
343
|
if (e(), !t) return null;
|
|
344
|
-
let s =
|
|
345
|
-
return /* @__PURE__ */ P(
|
|
344
|
+
let s = he(r ?? [], i);
|
|
345
|
+
return /* @__PURE__ */ P(Ft, {
|
|
346
346
|
open: !0,
|
|
347
347
|
scrim: !0,
|
|
348
348
|
onClose: n,
|
|
@@ -361,7 +361,7 @@ function Pn({ open: t, onClose: n, schema: r, layer: i, size: a = "md" }) {
|
|
|
361
361
|
label: e.label,
|
|
362
362
|
children: /* @__PURE__ */ P(en, {
|
|
363
363
|
checked: ce(e.id),
|
|
364
|
-
onChange: (t) =>
|
|
364
|
+
onChange: (t) => j(e.id, t),
|
|
365
365
|
"aria-label": e.label
|
|
366
366
|
})
|
|
367
367
|
}, e.id)), /* @__PURE__ */ P(Yt, {
|
|
@@ -377,7 +377,7 @@ function Pn({ open: t, onClose: n, schema: r, layer: i, size: a = "md" }) {
|
|
|
377
377
|
className: "kol-mono-12 text-meta",
|
|
378
378
|
children: "A scope switched off still rolls from its own button."
|
|
379
379
|
}),
|
|
380
|
-
/* @__PURE__ */ P(
|
|
380
|
+
/* @__PURE__ */ P(N, {
|
|
381
381
|
tone: "primary",
|
|
382
382
|
size: a,
|
|
383
383
|
className: "w-full",
|
|
@@ -390,7 +390,7 @@ function Pn({ open: t, onClose: n, schema: r, layer: i, size: a = "md" }) {
|
|
|
390
390
|
}
|
|
391
391
|
//#endregion
|
|
392
392
|
//#region src/editor/params/motionPresets.js
|
|
393
|
-
var Fn = (e) =>
|
|
393
|
+
var Fn = (e) => x("generators")?.loopById(e) ?? null, In = {
|
|
394
394
|
frame: [
|
|
395
395
|
{
|
|
396
396
|
id: "static",
|
|
@@ -1493,7 +1493,7 @@ function sr(e, t) {
|
|
|
1493
1493
|
//#region src/editor/compose/inspectors/KeyframeEditor.jsx
|
|
1494
1494
|
function cr({ layer: e, patch: t, defaultDuration: n = 8 }) {
|
|
1495
1495
|
let r = () => or(e.duration ?? n, i.getLoopSeconds());
|
|
1496
|
-
return /* @__PURE__ */ P(
|
|
1496
|
+
return /* @__PURE__ */ P(Lt, {
|
|
1497
1497
|
keyframes: e.keyframes,
|
|
1498
1498
|
onChange: (e) => t({ keyframes: e }),
|
|
1499
1499
|
t: () => i.getT() * r() % 1,
|
|
@@ -1506,7 +1506,7 @@ function cr({ layer: e, patch: t, defaultDuration: n = 8 }) {
|
|
|
1506
1506
|
//#endregion
|
|
1507
1507
|
//#region src/editor/compose/inspectors/CameraPoseSlots.jsx
|
|
1508
1508
|
function lr({ layer: e, patch: t, camParams: n, isEngine: r, showHeader: i = !1 }) {
|
|
1509
|
-
let a =
|
|
1509
|
+
let a = y(), o = Array.isArray(e._camSlots) ? e._camSlots : [], s = [
|
|
1510
1510
|
o[0] ?? null,
|
|
1511
1511
|
o[1] ?? null,
|
|
1512
1512
|
o[2] ?? null
|
|
@@ -1525,21 +1525,21 @@ function lr({ layer: e, patch: t, camParams: n, isEngine: r, showHeader: i = !1
|
|
|
1525
1525
|
className: "flex items-center gap-1",
|
|
1526
1526
|
children: [n.length > 0 && s.map((e, t) => /* @__PURE__ */ P(tn, {
|
|
1527
1527
|
label: e ? "Recall pose (shift-click = overwrite)" : "Save pose",
|
|
1528
|
-
children: /* @__PURE__ */ P(
|
|
1528
|
+
children: /* @__PURE__ */ P(N, {
|
|
1529
1529
|
"aria-label": e ? "Recall pose (shift-click = overwrite)" : "Save pose",
|
|
1530
1530
|
tone: e ? "inverted" : "ghost",
|
|
1531
1531
|
size: a,
|
|
1532
1532
|
onClick: (n) => n.shiftKey || !e ? c(t) : l(t),
|
|
1533
1533
|
children: t + 1
|
|
1534
1534
|
})
|
|
1535
|
-
}, t)), /* @__PURE__ */ P(
|
|
1535
|
+
}, t)), /* @__PURE__ */ P(N, {
|
|
1536
1536
|
tone: "primary",
|
|
1537
1537
|
size: a,
|
|
1538
1538
|
className: "ml-auto",
|
|
1539
1539
|
onClick: () => {
|
|
1540
1540
|
let i = {};
|
|
1541
1541
|
for (let e of n) i[e.key] = e.default;
|
|
1542
|
-
t(i), r && import("./host-
|
|
1542
|
+
t(i), r && import("./host-II9SeVCH.js").then((t) => t.hostAction?.(e.id, "resetCamera")).catch(() => {});
|
|
1543
1543
|
},
|
|
1544
1544
|
children: "Reset"
|
|
1545
1545
|
})]
|
|
@@ -1548,39 +1548,39 @@ function lr({ layer: e, patch: t, camParams: n, isEngine: r, showHeader: i = !1
|
|
|
1548
1548
|
//#endregion
|
|
1549
1549
|
//#region src/editor/compose/inspectors/RulesEditor.jsx
|
|
1550
1550
|
function ur({ layer: e, patch: t, seed: n }) {
|
|
1551
|
-
let r =
|
|
1551
|
+
let r = y(), i = e.rules ?? [], a = (e, n) => t({
|
|
1552
1552
|
rules: e,
|
|
1553
1553
|
...n
|
|
1554
|
-
}), o = () => a([...i,
|
|
1555
|
-
let t = n.take(), r =
|
|
1554
|
+
}), o = () => a([...i, ke()]), s = (e, t) => a(i.map((n, r) => r === e ? t : n)), c = (e) => a(i.filter((t, n) => n !== e)), l = (e) => {
|
|
1555
|
+
let t = n.take(), r = A(t >>> 0);
|
|
1556
1556
|
a(i.map((t, n) => n === e ? {
|
|
1557
|
-
...
|
|
1557
|
+
...lt(r),
|
|
1558
1558
|
id: t.id
|
|
1559
1559
|
} : t), { _rollSeed: t });
|
|
1560
1560
|
};
|
|
1561
|
-
return /* @__PURE__ */ P(
|
|
1561
|
+
return /* @__PURE__ */ P(Rt, {
|
|
1562
1562
|
label: `Rules · ${i.length}`,
|
|
1563
1563
|
children: /* @__PURE__ */ F("div", {
|
|
1564
1564
|
className: "flex flex-col gap-2",
|
|
1565
|
-
children: [i.map((e, t) => /* @__PURE__ */ P(
|
|
1565
|
+
children: [i.map((e, t) => /* @__PURE__ */ P(gt, {
|
|
1566
1566
|
rule: e,
|
|
1567
1567
|
onChange: (e) => s(t, e),
|
|
1568
1568
|
onRemove: () => c(t),
|
|
1569
1569
|
onReroll: () => l(t)
|
|
1570
1570
|
}, e.id ?? t)), /* @__PURE__ */ F("div", {
|
|
1571
1571
|
className: "grid grid-cols-2 gap-2",
|
|
1572
|
-
children: [/* @__PURE__ */ P(
|
|
1572
|
+
children: [/* @__PURE__ */ P(N, {
|
|
1573
1573
|
tone: "primary",
|
|
1574
1574
|
size: r,
|
|
1575
1575
|
iconLeft: "plus",
|
|
1576
1576
|
onClick: o,
|
|
1577
1577
|
children: "Add rule"
|
|
1578
|
-
}), /* @__PURE__ */ P(
|
|
1578
|
+
}), /* @__PURE__ */ P(N, {
|
|
1579
1579
|
tone: "primary",
|
|
1580
1580
|
size: r,
|
|
1581
1581
|
onClick: () => {
|
|
1582
|
-
let e = n.take(), t =
|
|
1583
|
-
a(Array.from({ length: r }, () =>
|
|
1582
|
+
let e = n.take(), t = A(e >>> 0), r = 1 + Math.floor(t() * 3);
|
|
1583
|
+
a(Array.from({ length: r }, () => lt(t)), { _rollSeed: e });
|
|
1584
1584
|
},
|
|
1585
1585
|
children: "Randomize"
|
|
1586
1586
|
})]
|
|
@@ -1610,8 +1610,8 @@ var dr = (e) => e.map((e) => ({
|
|
|
1610
1610
|
hry: -2 * (e.hr?.y ?? 0)
|
|
1611
1611
|
}));
|
|
1612
1612
|
function pr({ value: e, onChange: n }) {
|
|
1613
|
-
let r = Array.isArray(e) && e.length > 1 ? e :
|
|
1614
|
-
return /* @__PURE__ */ P(
|
|
1613
|
+
let r = Array.isArray(e) && e.length > 1 ? e : ze, i = y();
|
|
1614
|
+
return /* @__PURE__ */ P(At, {
|
|
1615
1615
|
value: dr(r),
|
|
1616
1616
|
onChange: (e) => {
|
|
1617
1617
|
let i = fr(e);
|
|
@@ -1629,10 +1629,10 @@ function pr({ value: e, onChange: n }) {
|
|
|
1629
1629
|
});
|
|
1630
1630
|
}
|
|
1631
1631
|
function mr({ layer: e, patch: t }) {
|
|
1632
|
-
return e.render !== "field" || e.field !== "organic" || e.waveProfile !== "custom" ? null : /* @__PURE__ */ P(
|
|
1632
|
+
return e.render !== "field" || e.field !== "organic" || e.waveProfile !== "custom" ? null : /* @__PURE__ */ P(Rt, {
|
|
1633
1633
|
label: "Profile curve",
|
|
1634
1634
|
children: /* @__PURE__ */ P(pr, {
|
|
1635
|
-
value: Array.isArray(e.waveCurve) && e.waveCurve.length > 1 ? e.waveCurve :
|
|
1635
|
+
value: Array.isArray(e.waveCurve) && e.waveCurve.length > 1 ? e.waveCurve : ze,
|
|
1636
1636
|
onChange: (e) => t({ waveCurve: e })
|
|
1637
1637
|
})
|
|
1638
1638
|
});
|
|
@@ -1640,24 +1640,24 @@ function mr({ layer: e, patch: t }) {
|
|
|
1640
1640
|
//#endregion
|
|
1641
1641
|
//#region src/editor/compose/inspectors/CurveEditor.jsx
|
|
1642
1642
|
function hr({ layer: e, patch: t }) {
|
|
1643
|
-
let n = e.clip === "custom", r = n ? null :
|
|
1644
|
-
label: (
|
|
1643
|
+
let n = e.clip === "custom", r = n ? null : Ze(e.clip), i = n ? null : {
|
|
1644
|
+
label: (Je.find((t) => t.id === e.clip) || Je[0]).label,
|
|
1645
1645
|
copies: r.copies,
|
|
1646
1646
|
spiral: r.spiral,
|
|
1647
1647
|
layerCopies: e.copies,
|
|
1648
1648
|
layerSpiral: e.spiral
|
|
1649
1649
|
};
|
|
1650
|
-
return /* @__PURE__ */ P(
|
|
1651
|
-
value: n ? e.custom ??
|
|
1650
|
+
return /* @__PURE__ */ P(Mt, {
|
|
1651
|
+
value: n ? e.custom ?? et("polar") : r.def,
|
|
1652
1652
|
stock: i,
|
|
1653
1653
|
onChange: (e, { extras: n }) => t({
|
|
1654
1654
|
clip: "custom",
|
|
1655
1655
|
...n,
|
|
1656
1656
|
custom: e
|
|
1657
1657
|
}),
|
|
1658
|
-
validate:
|
|
1659
|
-
kinds:
|
|
1660
|
-
defaultFor:
|
|
1658
|
+
validate: Ye,
|
|
1659
|
+
kinds: nt,
|
|
1660
|
+
defaultFor: et
|
|
1661
1661
|
});
|
|
1662
1662
|
}
|
|
1663
1663
|
//#endregion
|
|
@@ -1670,10 +1670,10 @@ function gr({ layer: e, patch: t, tab: n, renderAnimate: r }) {
|
|
|
1670
1670
|
}) : null : null;
|
|
1671
1671
|
}
|
|
1672
1672
|
function _r({ layer: e }) {
|
|
1673
|
-
let t =
|
|
1673
|
+
let t = y(), { flattenParatype: n } = _();
|
|
1674
1674
|
return n ? /* @__PURE__ */ P(tn, {
|
|
1675
1675
|
label: "Flatten the glyph(s) to vector shape layers (one-way)",
|
|
1676
|
-
children: /* @__PURE__ */ P(
|
|
1676
|
+
children: /* @__PURE__ */ P(N, {
|
|
1677
1677
|
"aria-label": "Flatten the glyph(s) to vector shape layers (one-way)",
|
|
1678
1678
|
tone: "primary",
|
|
1679
1679
|
size: t,
|
|
@@ -1684,7 +1684,7 @@ function _r({ layer: e }) {
|
|
|
1684
1684
|
}) : null;
|
|
1685
1685
|
}
|
|
1686
1686
|
function vr({ layer: e, patch: t, renderAnimate: n }) {
|
|
1687
|
-
let r =
|
|
1687
|
+
let r = y(), i = ue(ut(e.loopId)?.params ?? [], e).filter((e) => e.type === "range");
|
|
1688
1688
|
if (i.length < 2) return null;
|
|
1689
1689
|
let a = (e, t) => i.some((t) => t.key === e) && e !== t ? e : i.find((e) => e.key !== t)?.key, o = a(e._xyX ?? "stemWidth", null), s = a(e._xyY ?? "oWidth", o), c = i.find((e) => e.key === o), l = i.find((e) => e.key === s);
|
|
1690
1690
|
if (!c || !l) return null;
|
|
@@ -1702,11 +1702,11 @@ function vr({ layer: e, patch: t, renderAnimate: n }) {
|
|
|
1702
1702
|
}),
|
|
1703
1703
|
/* @__PURE__ */ F("div", {
|
|
1704
1704
|
className: "grid grid-cols-2 gap-2",
|
|
1705
|
-
children: [/* @__PURE__ */ P(
|
|
1705
|
+
children: [/* @__PURE__ */ P(Rt, {
|
|
1706
1706
|
label: "X axis",
|
|
1707
1707
|
children: /* @__PURE__ */ F("div", {
|
|
1708
1708
|
className: "flex items-center gap-2",
|
|
1709
|
-
children: [/* @__PURE__ */ P(
|
|
1709
|
+
children: [/* @__PURE__ */ P(Pt, {
|
|
1710
1710
|
variant: "subtle",
|
|
1711
1711
|
size: r,
|
|
1712
1712
|
className: "w-full min-w-0",
|
|
@@ -1715,11 +1715,11 @@ function vr({ layer: e, patch: t, renderAnimate: n }) {
|
|
|
1715
1715
|
onChange: (e) => t({ _xyX: e })
|
|
1716
1716
|
}), n?.(c)]
|
|
1717
1717
|
})
|
|
1718
|
-
}), /* @__PURE__ */ P(
|
|
1718
|
+
}), /* @__PURE__ */ P(Rt, {
|
|
1719
1719
|
label: "Y axis",
|
|
1720
1720
|
children: /* @__PURE__ */ F("div", {
|
|
1721
1721
|
className: "flex items-center gap-2",
|
|
1722
|
-
children: [/* @__PURE__ */ P(
|
|
1722
|
+
children: [/* @__PURE__ */ P(Pt, {
|
|
1723
1723
|
variant: "subtle",
|
|
1724
1724
|
size: r,
|
|
1725
1725
|
className: "w-full min-w-0",
|
|
@@ -1944,7 +1944,7 @@ var yr = 5, br = [
|
|
|
1944
1944
|
}));
|
|
1945
1945
|
}, kr = (e, t) => e.find((e) => e.value === t)?.label ?? t;
|
|
1946
1946
|
function Ar({ layer: e }) {
|
|
1947
|
-
let n =
|
|
1947
|
+
let n = y(), { updateLayer: r } = _(), i = De(e.id, { history: "coalesce" }), a = e.loopId === "softforms3d", o = a && !!e.metaball, s = a ? xr : br, c = a ? Cr : Sr, l = o ? 2 : 1, u = Array.isArray(e.forms) ? e.forms : [], [d, f] = un(-1), p = d >= 0 && d < u.length ? u[d] : null, m = (t) => {
|
|
1948
1948
|
f(t), window.dispatchEvent(new CustomEvent("kol:softform-select", { detail: {
|
|
1949
1949
|
id: e.id,
|
|
1950
1950
|
index: t,
|
|
@@ -1960,7 +1960,7 @@ function Ar({ layer: e }) {
|
|
|
1960
1960
|
let h = (t) => r(e.id, { forms: t }), g = (e, t) => i.patch({ forms: u.map((n, r) => r === d ? {
|
|
1961
1961
|
...n,
|
|
1962
1962
|
[e]: t
|
|
1963
|
-
} : n) }),
|
|
1963
|
+
} : n) }), v = () => {
|
|
1964
1964
|
if (u.length >= yr) return;
|
|
1965
1965
|
let e = a ? {
|
|
1966
1966
|
t: "sphere",
|
|
@@ -1982,7 +1982,7 @@ function Ar({ layer: e }) {
|
|
|
1982
1982
|
hue: I(Math.random())
|
|
1983
1983
|
};
|
|
1984
1984
|
h([...u, e]), m(u.length);
|
|
1985
|
-
},
|
|
1985
|
+
}, b = (e) => {
|
|
1986
1986
|
if (u.length >= yr) return;
|
|
1987
1987
|
let n = {
|
|
1988
1988
|
...u[e],
|
|
@@ -1994,7 +1994,7 @@ function Ar({ layer: e }) {
|
|
|
1994
1994
|
n,
|
|
1995
1995
|
...u.slice(e + 1)
|
|
1996
1996
|
]), m(e + 1);
|
|
1997
|
-
},
|
|
1997
|
+
}, x = (e) => {
|
|
1998
1998
|
u.length <= l || (h(u.filter((t, n) => n !== e)), m(-1));
|
|
1999
1999
|
}, S = (e, t) => {
|
|
2000
2000
|
if (t < 0 || t >= u.length) return;
|
|
@@ -2021,30 +2021,30 @@ function Ar({ layer: e }) {
|
|
|
2021
2021
|
icon: "copy",
|
|
2022
2022
|
label: "Duplicate form",
|
|
2023
2023
|
hidden: u.length >= yr,
|
|
2024
|
-
onClick: () =>
|
|
2024
|
+
onClick: () => b(n)
|
|
2025
2025
|
}, {
|
|
2026
2026
|
icon: "trash",
|
|
2027
2027
|
label: "Delete form",
|
|
2028
2028
|
hidden: u.length <= l,
|
|
2029
|
-
onClick: () =>
|
|
2029
|
+
onClick: () => x(n)
|
|
2030
2030
|
}]
|
|
2031
2031
|
};
|
|
2032
2032
|
}),
|
|
2033
2033
|
onSelect: (e) => m(u.length - 1 - e),
|
|
2034
2034
|
onMove: (e, t) => S(u.length - 1 - e, u.length - 1 - t)
|
|
2035
2035
|
}),
|
|
2036
|
-
u.length < yr && /* @__PURE__ */ P(
|
|
2036
|
+
u.length < yr && /* @__PURE__ */ P(N, {
|
|
2037
2037
|
tone: "primary",
|
|
2038
2038
|
size: n,
|
|
2039
2039
|
className: "w-full",
|
|
2040
2040
|
iconLeft: "plus",
|
|
2041
2041
|
iconSize: 12,
|
|
2042
|
-
onClick:
|
|
2042
|
+
onClick: v,
|
|
2043
2043
|
children: "Add form"
|
|
2044
2044
|
}),
|
|
2045
2045
|
!a && /* @__PURE__ */ P(tn, {
|
|
2046
2046
|
label: "Edit forms on the canvas (click to select, drag to move, corners to scale, knob to rotate)",
|
|
2047
|
-
children: /* @__PURE__ */ P(
|
|
2047
|
+
children: /* @__PURE__ */ P(N, {
|
|
2048
2048
|
"aria-label": "Edit forms on the canvas (click to select, drag to move, corners to scale, knob to rotate)",
|
|
2049
2049
|
tone: "primary",
|
|
2050
2050
|
size: n,
|
|
@@ -2063,9 +2063,9 @@ function Ar({ layer: e }) {
|
|
|
2063
2063
|
className: "kol-eyebrow text-fg-80",
|
|
2064
2064
|
children: "Selected form"
|
|
2065
2065
|
}),
|
|
2066
|
-
/* @__PURE__ */ P(
|
|
2066
|
+
/* @__PURE__ */ P(Rt, {
|
|
2067
2067
|
label: "Type",
|
|
2068
|
-
children: /* @__PURE__ */ P(
|
|
2068
|
+
children: /* @__PURE__ */ P(Pt, {
|
|
2069
2069
|
variant: "subtle",
|
|
2070
2070
|
size: n,
|
|
2071
2071
|
className: "w-full",
|
|
@@ -2079,7 +2079,7 @@ function Ar({ layer: e }) {
|
|
|
2079
2079
|
}),
|
|
2080
2080
|
c.map((e) => {
|
|
2081
2081
|
let t = p[e.k] ?? (e.fallback ? p[e.fallback] : void 0), n = typeof t == "number" ? t : e.def;
|
|
2082
|
-
return /* @__PURE__ */ P(
|
|
2082
|
+
return /* @__PURE__ */ P(Rt, {
|
|
2083
2083
|
label: e.label,
|
|
2084
2084
|
children: /* @__PURE__ */ P(Zt, {
|
|
2085
2085
|
min: e.min,
|
|
@@ -2099,11 +2099,11 @@ function Ar({ layer: e }) {
|
|
|
2099
2099
|
/* @__PURE__ */ F("div", {
|
|
2100
2100
|
className: "grid grid-cols-2 gap-2",
|
|
2101
2101
|
children: [
|
|
2102
|
-
/* @__PURE__ */ P(
|
|
2102
|
+
/* @__PURE__ */ P(N, {
|
|
2103
2103
|
tone: "primary",
|
|
2104
2104
|
size: n,
|
|
2105
2105
|
onClick: () => {
|
|
2106
|
-
let e =
|
|
2106
|
+
let e = A(ge());
|
|
2107
2107
|
h(u.map((t) => ({
|
|
2108
2108
|
...t,
|
|
2109
2109
|
hue: I(e())
|
|
@@ -2111,11 +2111,11 @@ function Ar({ layer: e }) {
|
|
|
2111
2111
|
},
|
|
2112
2112
|
children: "Color"
|
|
2113
2113
|
}),
|
|
2114
|
-
/* @__PURE__ */ P(
|
|
2114
|
+
/* @__PURE__ */ P(N, {
|
|
2115
2115
|
tone: "primary",
|
|
2116
2116
|
size: n,
|
|
2117
2117
|
onClick: () => {
|
|
2118
|
-
let e =
|
|
2118
|
+
let e = A(ge());
|
|
2119
2119
|
h(u.map((t) => a ? {
|
|
2120
2120
|
...t,
|
|
2121
2121
|
x: I(L(e, -.7, .7)),
|
|
@@ -2131,11 +2131,11 @@ function Ar({ layer: e }) {
|
|
|
2131
2131
|
},
|
|
2132
2132
|
children: "Transform"
|
|
2133
2133
|
}),
|
|
2134
|
-
/* @__PURE__ */ P(
|
|
2134
|
+
/* @__PURE__ */ P(N, {
|
|
2135
2135
|
tone: "primary",
|
|
2136
2136
|
size: n,
|
|
2137
2137
|
onClick: () => {
|
|
2138
|
-
let e =
|
|
2138
|
+
let e = A(ge());
|
|
2139
2139
|
h(u.map((t) => {
|
|
2140
2140
|
let n = I(L(e, .35, .95)), r = I(L(e, .35, .95));
|
|
2141
2141
|
return a ? {
|
|
@@ -2152,11 +2152,11 @@ function Ar({ layer: e }) {
|
|
|
2152
2152
|
},
|
|
2153
2153
|
children: "Scale"
|
|
2154
2154
|
}),
|
|
2155
|
-
/* @__PURE__ */ P(
|
|
2155
|
+
/* @__PURE__ */ P(N, {
|
|
2156
2156
|
tone: "primary",
|
|
2157
2157
|
size: n,
|
|
2158
2158
|
onClick: () => {
|
|
2159
|
-
let t =
|
|
2159
|
+
let t = A(ge());
|
|
2160
2160
|
r(e.id, {
|
|
2161
2161
|
motion: I(L(t, 0, 1.1)),
|
|
2162
2162
|
sweep: Math.round(L(t, 0, 360))
|
|
@@ -2166,12 +2166,12 @@ function Ar({ layer: e }) {
|
|
|
2166
2166
|
})
|
|
2167
2167
|
]
|
|
2168
2168
|
}),
|
|
2169
|
-
/* @__PURE__ */ P(
|
|
2169
|
+
/* @__PURE__ */ P(N, {
|
|
2170
2170
|
tone: "primary",
|
|
2171
2171
|
size: n,
|
|
2172
2172
|
className: "w-full",
|
|
2173
2173
|
onClick: () => {
|
|
2174
|
-
let e =
|
|
2174
|
+
let e = A(ge());
|
|
2175
2175
|
if (a) {
|
|
2176
2176
|
if (o) {
|
|
2177
2177
|
let t = 2 + Math.floor(e() * 4), n = L(e, .45, .9);
|
|
@@ -2249,9 +2249,9 @@ var jr = [
|
|
|
2249
2249
|
warm: 1
|
|
2250
2250
|
};
|
|
2251
2251
|
function Nr({ layer: e, setProp: t, patch: n }) {
|
|
2252
|
-
let r =
|
|
2253
|
-
|
|
2254
|
-
let i =
|
|
2252
|
+
let r = y();
|
|
2253
|
+
dt();
|
|
2254
|
+
let i = We(e.loopId), a = jr.filter((e) => i?.has(e.role));
|
|
2255
2255
|
if (!a.length) return null;
|
|
2256
2256
|
let o = e._layerPrev ?? {};
|
|
2257
2257
|
return /* @__PURE__ */ P(zt, {
|
|
@@ -2460,8 +2460,8 @@ function Rr(e, t = !1) {
|
|
|
2460
2460
|
//#endregion
|
|
2461
2461
|
//#region src/editor/compose/inspectors/AboutLine.jsx
|
|
2462
2462
|
function zr({ def: e, isFilter: t = !1 }) {
|
|
2463
|
-
let n = sn(), r =
|
|
2464
|
-
return i ? /* @__PURE__ */ F(dn, { children: [/* @__PURE__ */ P(
|
|
2463
|
+
let n = sn(), r = y(), i = Rr(e, t);
|
|
2464
|
+
return i ? /* @__PURE__ */ F(dn, { children: [/* @__PURE__ */ P(N, {
|
|
2465
2465
|
size: r,
|
|
2466
2466
|
iconOnly: "info",
|
|
2467
2467
|
"aria-label": "About this preset",
|
|
@@ -2488,7 +2488,7 @@ function zr({ def: e, isFilter: t = !1 }) {
|
|
|
2488
2488
|
//#endregion
|
|
2489
2489
|
//#region src/loops/theme.js
|
|
2490
2490
|
function Br(e, t, r, i) {
|
|
2491
|
-
return
|
|
2491
|
+
return Ce(e, t, l(n(r, i)));
|
|
2492
2492
|
}
|
|
2493
2493
|
//#endregion
|
|
2494
2494
|
//#region src/editor/compose/inspectors/LoopFields.jsx
|
|
@@ -2521,11 +2521,11 @@ var Ur = [{
|
|
|
2521
2521
|
label: "On"
|
|
2522
2522
|
}];
|
|
2523
2523
|
function Wr({ inline: e, cs: t, on: n, onChange: r }) {
|
|
2524
|
-
return e ? /* @__PURE__ */ P(
|
|
2524
|
+
return e ? /* @__PURE__ */ P(v, {
|
|
2525
2525
|
layout: "joined",
|
|
2526
2526
|
tone: "sunken",
|
|
2527
2527
|
size: t,
|
|
2528
|
-
className: `w-full ${
|
|
2528
|
+
className: `w-full ${h(t) ?? ""}`,
|
|
2529
2529
|
options: Ur,
|
|
2530
2530
|
value: n ? "on" : "off",
|
|
2531
2531
|
onChange: (e) => r(e === "on")
|
|
@@ -2536,9 +2536,9 @@ function Wr({ inline: e, cs: t, on: n, onChange: r }) {
|
|
|
2536
2536
|
onViewChange: (e) => r(e === "on")
|
|
2537
2537
|
});
|
|
2538
2538
|
}
|
|
2539
|
-
function Gr({ layer: t, setProp: n, patch: r, updateLayer: i, palette: s, renderAnimate: c, tab: l, tabStrip: u, tree: d, picker: f = !0, inline:
|
|
2540
|
-
let _ =
|
|
2541
|
-
|
|
2539
|
+
function Gr({ layer: t, setProp: n, patch: r, updateLayer: i, palette: s, renderAnimate: c, tab: l, tabStrip: u, tree: d, picker: f = !0, inline: m = !1, showSeed: h = !m, onReset: g }) {
|
|
2540
|
+
let _ = y(), v = ut(t.loopId), b = e(), x = (v?.params ?? []).some((e) => e.key === "orbit"), S = (e) => {
|
|
2541
|
+
De("orbit", e), e && !b.grab && o("grab", !0);
|
|
2542
2542
|
}, C = v?.params ?? [], w = t.themeId ?? "kol", E = !!t.themeInvert, O = (e) => i(t.id, {
|
|
2543
2543
|
...Br(t, v?.params, e, E),
|
|
2544
2544
|
themeId: e
|
|
@@ -2546,7 +2546,7 @@ function Gr({ layer: t, setProp: n, patch: r, updateLayer: i, palette: s, render
|
|
|
2546
2546
|
...Br(t, v?.params, w, e),
|
|
2547
2547
|
themeInvert: e
|
|
2548
2548
|
}), ee = t._paletteRelation ?? "analogous", te = (v?.params ?? []).filter((e) => e.type === "color"), re = new Set(t._rollKeep ?? []), ie = (e = ee, n = {}) => {
|
|
2549
|
-
let r = D(
|
|
2549
|
+
let r = D(A(ge()), e), a = Ce(t, v?.params, r, { rotate: !0 });
|
|
2550
2550
|
i(t.id, {
|
|
2551
2551
|
...n,
|
|
2552
2552
|
...Object.fromEntries(te.filter((e) => !re.has(e.key)).map((e) => [e.key, a[e.key]]))
|
|
@@ -2554,47 +2554,47 @@ function Gr({ layer: t, setProp: n, patch: r, updateLayer: i, palette: s, render
|
|
|
2554
2554
|
}, oe = (e) => n("_rollKeep", re.has(e) ? [...re].filter((t) => t !== e) : [...re, e]), se = Zn(t.loopId), ce = se ? Object.keys(se).map((e) => ({
|
|
2555
2555
|
id: e,
|
|
2556
2556
|
label: e
|
|
2557
|
-
})) : null, ue = se ? new Set(Object.values(se).flatMap((e) => Object.keys(e))) : null,
|
|
2558
|
-
let a = ae(t, e,
|
|
2557
|
+
})) : null, ue = se ? new Set(Object.values(se).flatMap((e) => Object.keys(e))) : null, de = le(t), fe = Se(he(C, t), me(C, t)), j = Jn(t.loopId, t), [_e, ye] = un(!1), xe = (e, n, r) => {
|
|
2558
|
+
let a = ae(t, e, de.take(), {
|
|
2559
2559
|
stripNoRandom: !!n?.motion,
|
|
2560
2560
|
...r
|
|
2561
2561
|
});
|
|
2562
|
-
|
|
2563
|
-
},
|
|
2564
|
-
let n =
|
|
2562
|
+
j && n?.motion && (n.id !== "Form" && (a._framePreset = "custom"), n.id !== "Frame" && (a._formPreset = "custom")), ue && Object.keys(a).some((e) => ue.has(e)) && (a._lookPreset = "custom"), i(t.id, a);
|
|
2563
|
+
}, M = (e) => {
|
|
2564
|
+
let n = je(t.loopGroup).find((e) => e.id === t.presetId)?.params ?? {}, r = {};
|
|
2565
2565
|
for (let t of e) {
|
|
2566
2566
|
let e = n[t.key] === void 0 ? t.default : n[t.key];
|
|
2567
2567
|
e !== void 0 && (r[t.key] = e);
|
|
2568
2568
|
}
|
|
2569
2569
|
i(t.id, r);
|
|
2570
|
-
},
|
|
2570
|
+
}, we = j ? Yn(j.frame) : null, Te = j ? Yn(j.form) : null, De = (e, t) => {
|
|
2571
2571
|
let n = {};
|
|
2572
|
-
|
|
2572
|
+
we?.has(e) && (n._framePreset = "custom"), Te?.has(e) && (n._formPreset = "custom"), ue?.has(e) && (n._lookPreset = "custom"), r({
|
|
2573
2573
|
[e]: t,
|
|
2574
2574
|
...n
|
|
2575
2575
|
});
|
|
2576
|
-
},
|
|
2576
|
+
}, Oe = (e, t) => (n) => {
|
|
2577
2577
|
let i = t.find((e) => e.id === n);
|
|
2578
2578
|
r({
|
|
2579
2579
|
[e]: n,
|
|
2580
2580
|
...i?.params ?? {}
|
|
2581
2581
|
});
|
|
2582
|
-
},
|
|
2582
|
+
}, ke = (e) => r({
|
|
2583
2583
|
_lookPreset: e,
|
|
2584
2584
|
...se?.[e] ?? {}
|
|
2585
|
-
}),
|
|
2585
|
+
}), Ae = v?.camera ? v.camera.map((e) => ({
|
|
2586
2586
|
...e,
|
|
2587
2587
|
section: "Camera"
|
|
2588
|
-
})) : null,
|
|
2588
|
+
})) : null, Me = [...v?.camera ?? [], ...C.filter((e) => T(e) === "Camera")], Ne = v?.kind === "engine", Pe = Me.length > 0 || Ne && v?.orbit, Fe = v?.engine === "scene" && (t.animMode === "keyframes" || t.animMode === "keyframe"), Le = v?.orbit ? {
|
|
2589
2589
|
yaw: 1,
|
|
2590
2590
|
dist: 1
|
|
2591
|
-
} :
|
|
2592
|
-
className: `kol-mono-10 text-meta${
|
|
2593
|
-
children: v?.orbit ? "Press C, then drag to orbit the camera and scroll to zoom." :
|
|
2591
|
+
} : Ie(v), Re = Le ? /* @__PURE__ */ P("p", {
|
|
2592
|
+
className: `kol-mono-10 text-meta${m ? "" : " col-span-2"}`,
|
|
2593
|
+
children: v?.orbit ? "Press C, then drag to orbit the camera and scroll to zoom." : Le.yaw ? "Press C, then drag to rotate and scroll to zoom." : "Press C, then scroll to zoom."
|
|
2594
2594
|
}) : null;
|
|
2595
2595
|
return /* @__PURE__ */ F(dn, { children: [
|
|
2596
2596
|
u,
|
|
2597
|
-
f && (
|
|
2597
|
+
f && (m ? l === "generate" && /* @__PURE__ */ P(ne, {
|
|
2598
2598
|
divided: !0,
|
|
2599
2599
|
children: /* @__PURE__ */ P(Nn, {
|
|
2600
2600
|
layer: t,
|
|
@@ -2609,8 +2609,8 @@ function Gr({ layer: t, setProp: n, patch: r, updateLayer: i, palette: s, render
|
|
|
2609
2609
|
})),
|
|
2610
2610
|
(l === "generate" || l === "labs-effect") && /* @__PURE__ */ F(dn, { children: [
|
|
2611
2611
|
(t.loopId === "softforms" || t.loopId === "softforms3d") && /* @__PURE__ */ P(Ar, { layer: t }),
|
|
2612
|
-
se && !
|
|
2613
|
-
inline:
|
|
2612
|
+
se && !m && /* @__PURE__ */ P(R, {
|
|
2613
|
+
inline: m,
|
|
2614
2614
|
label: "Look",
|
|
2615
2615
|
children: /* @__PURE__ */ P(ve, {
|
|
2616
2616
|
variant: "subtle",
|
|
@@ -2618,10 +2618,10 @@ function Gr({ layer: t, setProp: n, patch: r, updateLayer: i, palette: s, render
|
|
|
2618
2618
|
className: "w-full",
|
|
2619
2619
|
options: Hr(ce, t._lookPreset),
|
|
2620
2620
|
value: t._lookPreset ?? "custom",
|
|
2621
|
-
onChange:
|
|
2621
|
+
onChange: ke
|
|
2622
2622
|
})
|
|
2623
2623
|
}),
|
|
2624
|
-
|
|
2624
|
+
m && /* @__PURE__ */ F(ne, {
|
|
2625
2625
|
divided: !0,
|
|
2626
2626
|
children: [
|
|
2627
2627
|
se && /* @__PURE__ */ P(R, {
|
|
@@ -2633,7 +2633,7 @@ function Gr({ layer: t, setProp: n, patch: r, updateLayer: i, palette: s, render
|
|
|
2633
2633
|
className: "w-full",
|
|
2634
2634
|
options: Hr(ce, t._lookPreset),
|
|
2635
2635
|
value: t._lookPreset ?? "custom",
|
|
2636
|
-
onChange:
|
|
2636
|
+
onChange: ke
|
|
2637
2637
|
})
|
|
2638
2638
|
}),
|
|
2639
2639
|
/* @__PURE__ */ P(R, {
|
|
@@ -2668,14 +2668,14 @@ function Gr({ layer: t, setProp: n, patch: r, updateLayer: i, palette: s, render
|
|
|
2668
2668
|
variant: "subtle",
|
|
2669
2669
|
size: _,
|
|
2670
2670
|
className: "flex-1 min-w-0",
|
|
2671
|
-
options:
|
|
2671
|
+
options: pe.map((e) => ({
|
|
2672
2672
|
value: e.id,
|
|
2673
2673
|
label: e.label
|
|
2674
2674
|
})),
|
|
2675
2675
|
value: ee,
|
|
2676
2676
|
onChange: (e) => ie(e, { _paletteRelation: e })
|
|
2677
2677
|
}),
|
|
2678
|
-
/* @__PURE__ */ P(
|
|
2678
|
+
/* @__PURE__ */ P(p, {
|
|
2679
2679
|
tone: "primary",
|
|
2680
2680
|
size: _,
|
|
2681
2681
|
onClick: () => ie(),
|
|
@@ -2683,12 +2683,12 @@ function Gr({ layer: t, setProp: n, patch: r, updateLayer: i, palette: s, render
|
|
|
2683
2683
|
}),
|
|
2684
2684
|
/* @__PURE__ */ P(tn, {
|
|
2685
2685
|
label: "Edit in Color Modes",
|
|
2686
|
-
children: /* @__PURE__ */ P(
|
|
2686
|
+
children: /* @__PURE__ */ P(p, {
|
|
2687
2687
|
tone: "primary",
|
|
2688
2688
|
size: _,
|
|
2689
2689
|
iconOnly: "clr-tri",
|
|
2690
2690
|
"aria-label": "Edit in Color Modes",
|
|
2691
|
-
onClick:
|
|
2691
|
+
onClick: wt
|
|
2692
2692
|
})
|
|
2693
2693
|
})
|
|
2694
2694
|
]
|
|
@@ -2699,7 +2699,7 @@ function Gr({ layer: t, setProp: n, patch: r, updateLayer: i, palette: s, render
|
|
|
2699
2699
|
label: "Rolls",
|
|
2700
2700
|
children: /* @__PURE__ */ P("div", {
|
|
2701
2701
|
className: "flex w-full flex-wrap gap-1",
|
|
2702
|
-
children: te.map((e) => /* @__PURE__ */ P(
|
|
2702
|
+
children: te.map((e) => /* @__PURE__ */ P(p, {
|
|
2703
2703
|
size: _,
|
|
2704
2704
|
tone: re.has(e.key) ? "ghost" : "primary",
|
|
2705
2705
|
pressed: !re.has(e.key),
|
|
@@ -2709,7 +2709,7 @@ function Gr({ layer: t, setProp: n, patch: r, updateLayer: i, palette: s, render
|
|
|
2709
2709
|
}, e.key))
|
|
2710
2710
|
})
|
|
2711
2711
|
}),
|
|
2712
|
-
|
|
2712
|
+
Ue(v) && /* @__PURE__ */ P(R, {
|
|
2713
2713
|
inline: !0,
|
|
2714
2714
|
label: "Background",
|
|
2715
2715
|
children: /* @__PURE__ */ P(Wr, {
|
|
@@ -2719,10 +2719,10 @@ function Gr({ layer: t, setProp: n, patch: r, updateLayer: i, palette: s, render
|
|
|
2719
2719
|
onChange: (e) => n("bgOn", e)
|
|
2720
2720
|
})
|
|
2721
2721
|
}),
|
|
2722
|
-
|
|
2722
|
+
Re
|
|
2723
2723
|
]
|
|
2724
2724
|
}),
|
|
2725
|
-
!
|
|
2725
|
+
!m && /* @__PURE__ */ F("div", {
|
|
2726
2726
|
className: "grid grid-cols-2 gap-2",
|
|
2727
2727
|
children: [
|
|
2728
2728
|
/* @__PURE__ */ P(R, {
|
|
@@ -2747,7 +2747,7 @@ function Gr({ layer: t, setProp: n, patch: r, updateLayer: i, palette: s, render
|
|
|
2747
2747
|
onChange: k
|
|
2748
2748
|
})
|
|
2749
2749
|
}),
|
|
2750
|
-
|
|
2750
|
+
Ue(v) && /* @__PURE__ */ P(R, {
|
|
2751
2751
|
inline: !1,
|
|
2752
2752
|
label: "Background",
|
|
2753
2753
|
children: /* @__PURE__ */ P(Wr, {
|
|
@@ -2757,19 +2757,19 @@ function Gr({ layer: t, setProp: n, patch: r, updateLayer: i, palette: s, render
|
|
|
2757
2757
|
onChange: (e) => n("bgOn", e)
|
|
2758
2758
|
})
|
|
2759
2759
|
}),
|
|
2760
|
-
|
|
2760
|
+
Re
|
|
2761
2761
|
]
|
|
2762
2762
|
}),
|
|
2763
|
-
/* @__PURE__ */ P(
|
|
2763
|
+
/* @__PURE__ */ P(Ee, {
|
|
2764
2764
|
schema: C,
|
|
2765
2765
|
layer: t,
|
|
2766
|
-
setProp:
|
|
2766
|
+
setProp: De,
|
|
2767
2767
|
palette: s,
|
|
2768
2768
|
renderAnimate: c,
|
|
2769
2769
|
tab: "generate",
|
|
2770
|
-
inline:
|
|
2770
|
+
inline: m
|
|
2771
2771
|
}),
|
|
2772
|
-
|
|
2772
|
+
m && /* @__PURE__ */ P(Nt, {}),
|
|
2773
2773
|
/* @__PURE__ */ F("div", {
|
|
2774
2774
|
className: "flex gap-2",
|
|
2775
2775
|
children: [
|
|
@@ -2777,13 +2777,13 @@ function Gr({ layer: t, setProp: n, patch: r, updateLayer: i, palette: s, render
|
|
|
2777
2777
|
["type", "Type"],
|
|
2778
2778
|
["category", "Category"],
|
|
2779
2779
|
["preset", "Preset"]
|
|
2780
|
-
].filter(([e]) => Tn(t, e, Vr)).map(([e, n]) => /* @__PURE__ */ P(
|
|
2780
|
+
].filter(([e]) => Tn(t, e, Vr)).map(([e, n]) => /* @__PURE__ */ P(p, {
|
|
2781
2781
|
tone: "primary",
|
|
2782
2782
|
size: _,
|
|
2783
2783
|
className: "flex-1 min-w-0",
|
|
2784
2784
|
"aria-label": `Randomize ${n.toLowerCase()}`,
|
|
2785
2785
|
onClick: () => {
|
|
2786
|
-
let n =
|
|
2786
|
+
let n = de.take(), r = En(t, e, A(n >>> 0), Vr);
|
|
2787
2787
|
r && i(t.id, {
|
|
2788
2788
|
...r,
|
|
2789
2789
|
_rollSeed: n
|
|
@@ -2791,94 +2791,94 @@ function Gr({ layer: t, setProp: n, patch: r, updateLayer: i, palette: s, render
|
|
|
2791
2791
|
},
|
|
2792
2792
|
children: n
|
|
2793
2793
|
}, e)),
|
|
2794
|
-
/* @__PURE__ */ P(
|
|
2794
|
+
/* @__PURE__ */ P(p, {
|
|
2795
2795
|
tone: "primary",
|
|
2796
2796
|
size: _,
|
|
2797
2797
|
className: "flex-1 min-w-0",
|
|
2798
2798
|
"aria-label": "Randomize settings",
|
|
2799
2799
|
onClick: (e) => {
|
|
2800
|
-
if (e.altKey) return
|
|
2801
|
-
let n =
|
|
2800
|
+
if (e.altKey) return M(me(C, t));
|
|
2801
|
+
let n = de.take();
|
|
2802
2802
|
i(t.id, {
|
|
2803
|
-
...Dn(t,
|
|
2803
|
+
...Dn(t, me(C, t), A(n >>> 0)),
|
|
2804
2804
|
_rollSeed: n
|
|
2805
2805
|
});
|
|
2806
2806
|
},
|
|
2807
2807
|
children: "Settings"
|
|
2808
2808
|
}),
|
|
2809
|
-
/* @__PURE__ */ P(
|
|
2809
|
+
/* @__PURE__ */ P(p, {
|
|
2810
2810
|
tone: "primary",
|
|
2811
2811
|
size: _,
|
|
2812
2812
|
iconOnly: "nav-settings",
|
|
2813
2813
|
"aria-label": "What Settings rolls",
|
|
2814
|
-
onClick: () =>
|
|
2814
|
+
onClick: () => ye(!0),
|
|
2815
2815
|
className: "shrink-0"
|
|
2816
2816
|
}),
|
|
2817
2817
|
/* @__PURE__ */ P(tn, {
|
|
2818
2818
|
label: "Reset to defaults",
|
|
2819
2819
|
shortcut: "R",
|
|
2820
|
-
children: /* @__PURE__ */ P(
|
|
2820
|
+
children: /* @__PURE__ */ P(p, {
|
|
2821
2821
|
tone: "primary",
|
|
2822
2822
|
size: _,
|
|
2823
2823
|
iconOnly: "refresh",
|
|
2824
2824
|
"aria-label": "Reset to defaults",
|
|
2825
|
-
onClick: g ?? (() =>
|
|
2825
|
+
onClick: g ?? (() => M(me(C, t))),
|
|
2826
2826
|
className: "shrink-0"
|
|
2827
2827
|
})
|
|
2828
2828
|
})
|
|
2829
2829
|
]
|
|
2830
2830
|
}),
|
|
2831
2831
|
/* @__PURE__ */ P(Pn, {
|
|
2832
|
-
open:
|
|
2833
|
-
onClose: () =>
|
|
2832
|
+
open: _e,
|
|
2833
|
+
onClose: () => ye(!1),
|
|
2834
2834
|
schema: C,
|
|
2835
2835
|
layer: t,
|
|
2836
2836
|
size: _
|
|
2837
2837
|
}),
|
|
2838
|
-
|
|
2839
|
-
className: `grid ${
|
|
2840
|
-
children: [
|
|
2838
|
+
fe.length > 0 && /* @__PURE__ */ F("div", {
|
|
2839
|
+
className: `grid ${m ? "grid-cols-3" : "grid-cols-2"} gap-2`,
|
|
2840
|
+
children: [fe.map((e) => /* @__PURE__ */ P(p, {
|
|
2841
2841
|
tone: "primary",
|
|
2842
2842
|
size: _,
|
|
2843
|
-
onClick: (t) => t.altKey ?
|
|
2843
|
+
onClick: (t) => t.altKey ? M(e.params) : xe(e.params, e),
|
|
2844
2844
|
children: e.label
|
|
2845
|
-
}, e.id)), t.loopId === "math-expression" && /* @__PURE__ */ P(
|
|
2845
|
+
}, e.id)), t.loopId === "math-expression" && /* @__PURE__ */ P(p, {
|
|
2846
2846
|
tone: "primary",
|
|
2847
2847
|
size: _,
|
|
2848
2848
|
onClick: (e) => {
|
|
2849
|
-
if (e.altKey) return
|
|
2850
|
-
let n =
|
|
2849
|
+
if (e.altKey) return M(fe.find((e) => e.id === "Expression")?.params ?? []);
|
|
2850
|
+
let n = de.take();
|
|
2851
2851
|
i(t.id, {
|
|
2852
|
-
expr:
|
|
2852
|
+
expr: st(A(n >>> 0)),
|
|
2853
2853
|
_rollSeed: n
|
|
2854
2854
|
});
|
|
2855
2855
|
},
|
|
2856
2856
|
children: "Wild"
|
|
2857
2857
|
})]
|
|
2858
2858
|
}),
|
|
2859
|
-
h &&
|
|
2860
|
-
seed:
|
|
2861
|
-
inline:
|
|
2859
|
+
h && me(C, t).length >= 5 && /* @__PURE__ */ P(be, {
|
|
2860
|
+
seed: de,
|
|
2861
|
+
inline: m
|
|
2862
2862
|
}),
|
|
2863
2863
|
t.loopId === "pattern-rules" && (t.render ?? "tiles") === "tiles" && /* @__PURE__ */ P(ur, {
|
|
2864
2864
|
layer: t,
|
|
2865
2865
|
patch: r,
|
|
2866
|
-
seed:
|
|
2866
|
+
seed: de
|
|
2867
2867
|
})
|
|
2868
2868
|
] }),
|
|
2869
2869
|
(l === "style" || l === "labs-effect") && /* @__PURE__ */ F(dn, { children: [
|
|
2870
|
-
/* @__PURE__ */ P(
|
|
2870
|
+
/* @__PURE__ */ P(Ee, {
|
|
2871
2871
|
schema: C,
|
|
2872
2872
|
layer: t,
|
|
2873
|
-
setProp:
|
|
2873
|
+
setProp: De,
|
|
2874
2874
|
palette: s,
|
|
2875
2875
|
renderAnimate: c,
|
|
2876
2876
|
tab: "style",
|
|
2877
|
-
inline:
|
|
2877
|
+
inline: m
|
|
2878
2878
|
}),
|
|
2879
2879
|
v?.group === "penrose" && t.loopId?.startsWith("penrose-") && /* @__PURE__ */ P(Nr, {
|
|
2880
2880
|
layer: t,
|
|
2881
|
-
setProp:
|
|
2881
|
+
setProp: De,
|
|
2882
2882
|
patch: r
|
|
2883
2883
|
}),
|
|
2884
2884
|
t.loopId === "pattern-rules" && /* @__PURE__ */ P(mr, {
|
|
@@ -2891,62 +2891,62 @@ function Gr({ layer: t, setProp: n, patch: r, updateLayer: i, palette: s, render
|
|
|
2891
2891
|
}),
|
|
2892
2892
|
t.loopId === "math-expression" && /* @__PURE__ */ F("div", {
|
|
2893
2893
|
className: "grid grid-cols-2 gap-2",
|
|
2894
|
-
children: [/* @__PURE__ */ P(
|
|
2894
|
+
children: [/* @__PURE__ */ P(p, {
|
|
2895
2895
|
tone: "primary",
|
|
2896
2896
|
size: _,
|
|
2897
|
-
onClick: () => i(t.id,
|
|
2897
|
+
onClick: () => i(t.id, He(t)),
|
|
2898
2898
|
children: "Fit"
|
|
2899
|
-
}), /* @__PURE__ */ P(
|
|
2899
|
+
}), /* @__PURE__ */ P(p, {
|
|
2900
2900
|
tone: "primary",
|
|
2901
2901
|
size: _,
|
|
2902
|
-
onClick: () =>
|
|
2902
|
+
onClick: () => M(fe.find((e) => e.id === "View")?.params ?? []),
|
|
2903
2903
|
children: "Reset"
|
|
2904
2904
|
})]
|
|
2905
2905
|
})
|
|
2906
2906
|
] }),
|
|
2907
2907
|
l === "anim" && /* @__PURE__ */ F(dn, { children: [
|
|
2908
|
-
|
|
2908
|
+
j && /* @__PURE__ */ F(ne, {
|
|
2909
2909
|
label: "Motion",
|
|
2910
2910
|
divided: !0,
|
|
2911
2911
|
children: [/* @__PURE__ */ P(R, {
|
|
2912
|
-
inline:
|
|
2912
|
+
inline: m,
|
|
2913
2913
|
label: "Frame",
|
|
2914
2914
|
children: /* @__PURE__ */ P(ve, {
|
|
2915
2915
|
variant: "subtle",
|
|
2916
2916
|
size: _,
|
|
2917
2917
|
className: "w-full",
|
|
2918
|
-
options: Hr(
|
|
2918
|
+
options: Hr(j.frame, t._framePreset),
|
|
2919
2919
|
value: t._framePreset ?? "custom",
|
|
2920
|
-
onChange:
|
|
2920
|
+
onChange: Oe("_framePreset", j.frame)
|
|
2921
2921
|
})
|
|
2922
2922
|
}), /* @__PURE__ */ P(R, {
|
|
2923
|
-
inline:
|
|
2923
|
+
inline: m,
|
|
2924
2924
|
label: "Form",
|
|
2925
2925
|
children: /* @__PURE__ */ P(ve, {
|
|
2926
2926
|
variant: "subtle",
|
|
2927
2927
|
size: _,
|
|
2928
2928
|
className: "w-full",
|
|
2929
|
-
options: Hr(
|
|
2929
|
+
options: Hr(j.form, t._formPreset),
|
|
2930
2930
|
value: t._formPreset ?? "custom",
|
|
2931
|
-
onChange:
|
|
2931
|
+
onChange: Oe("_formPreset", j.form)
|
|
2932
2932
|
})
|
|
2933
2933
|
})]
|
|
2934
2934
|
}),
|
|
2935
|
-
/* @__PURE__ */ P(
|
|
2935
|
+
/* @__PURE__ */ P(ht, {
|
|
2936
2936
|
layer: t,
|
|
2937
2937
|
schema: C,
|
|
2938
|
-
setProp:
|
|
2938
|
+
setProp: De
|
|
2939
2939
|
}),
|
|
2940
|
-
|
|
2940
|
+
x && !v?.is3D && /* @__PURE__ */ P(ne, {
|
|
2941
2941
|
label: "Interaction",
|
|
2942
2942
|
divided: !0,
|
|
2943
2943
|
children: /* @__PURE__ */ P(R, {
|
|
2944
|
-
inline:
|
|
2944
|
+
inline: m,
|
|
2945
2945
|
label: "Drag (C)",
|
|
2946
2946
|
children: /* @__PURE__ */ P(Wr, {
|
|
2947
|
-
inline:
|
|
2947
|
+
inline: m,
|
|
2948
2948
|
cs: _,
|
|
2949
|
-
on: !!
|
|
2949
|
+
on: !!b.grab && t.orbit !== !1,
|
|
2950
2950
|
onChange: S
|
|
2951
2951
|
})
|
|
2952
2952
|
})
|
|
@@ -2955,52 +2955,52 @@ function Gr({ layer: t, setProp: n, patch: r, updateLayer: i, palette: s, render
|
|
|
2955
2955
|
label: "3D",
|
|
2956
2956
|
divided: !0,
|
|
2957
2957
|
children: [/* @__PURE__ */ P(R, {
|
|
2958
|
-
inline:
|
|
2958
|
+
inline: m,
|
|
2959
2959
|
label: "Orbit (C)",
|
|
2960
2960
|
children: /* @__PURE__ */ P(Wr, {
|
|
2961
|
-
inline:
|
|
2961
|
+
inline: m,
|
|
2962
2962
|
cs: _,
|
|
2963
|
-
on: !!
|
|
2963
|
+
on: !!b.grab && t.orbit !== !1,
|
|
2964
2964
|
onChange: S
|
|
2965
2965
|
})
|
|
2966
|
-
}), v.zoom3dKey && /* @__PURE__ */ P(
|
|
2966
|
+
}), v.zoom3dKey && /* @__PURE__ */ P(Ee, {
|
|
2967
2967
|
schema: C.filter((e) => e.key === v.zoom3dKey).map(({ section: e, ...t }) => t),
|
|
2968
2968
|
layer: t,
|
|
2969
|
-
setProp:
|
|
2969
|
+
setProp: De,
|
|
2970
2970
|
palette: s,
|
|
2971
2971
|
renderAnimate: c,
|
|
2972
2972
|
tab: "anim",
|
|
2973
|
-
inline:
|
|
2973
|
+
inline: m
|
|
2974
2974
|
})]
|
|
2975
2975
|
}),
|
|
2976
|
-
/* @__PURE__ */ P(
|
|
2976
|
+
/* @__PURE__ */ P(Ee, {
|
|
2977
2977
|
schema: v?.is3D && v.zoom3dKey ? C.filter((e) => e.key !== v.zoom3dKey) : C,
|
|
2978
2978
|
layer: t,
|
|
2979
|
-
setProp:
|
|
2979
|
+
setProp: De,
|
|
2980
2980
|
palette: s,
|
|
2981
2981
|
renderAnimate: c,
|
|
2982
2982
|
tab: "anim",
|
|
2983
|
-
inline:
|
|
2983
|
+
inline: m
|
|
2984
2984
|
}),
|
|
2985
|
-
|
|
2985
|
+
Fe && /* @__PURE__ */ P(cr, {
|
|
2986
2986
|
layer: t,
|
|
2987
2987
|
patch: r,
|
|
2988
2988
|
defaultDuration: v?.duration ?? 8
|
|
2989
2989
|
}),
|
|
2990
|
-
|
|
2991
|
-
schema:
|
|
2990
|
+
Ae && /* @__PURE__ */ P(Ee, {
|
|
2991
|
+
schema: Ae,
|
|
2992
2992
|
layer: t,
|
|
2993
2993
|
setProp: n,
|
|
2994
2994
|
palette: s,
|
|
2995
2995
|
renderAnimate: c,
|
|
2996
|
-
inline:
|
|
2996
|
+
inline: m
|
|
2997
2997
|
}),
|
|
2998
|
-
|
|
2998
|
+
Pe && /* @__PURE__ */ P(lr, {
|
|
2999
2999
|
layer: t,
|
|
3000
3000
|
patch: r,
|
|
3001
|
-
camParams:
|
|
3002
|
-
isEngine:
|
|
3003
|
-
showHeader: !
|
|
3001
|
+
camParams: Me,
|
|
3002
|
+
isEngine: Ne,
|
|
3003
|
+
showHeader: !Ae
|
|
3004
3004
|
})
|
|
3005
3005
|
] }),
|
|
3006
3006
|
/* @__PURE__ */ P(gr, {
|
|
@@ -3014,7 +3014,7 @@ function Gr({ layer: t, setProp: n, patch: r, updateLayer: i, palette: s, render
|
|
|
3014
3014
|
//#endregion
|
|
3015
3015
|
//#region src/editor/labs/useLabsLayer.js
|
|
3016
3016
|
function Kr() {
|
|
3017
|
-
let { layers: e, addLayer: t, removeLayer: n, updateLayer: r, select: i, beginTransaction: a, commitTransaction: o } =
|
|
3017
|
+
let { layers: e, addLayer: t, removeLayer: n, updateLayer: r, select: i, beginTransaction: a, commitTransaction: o } = _(), s = an((s, c) => {
|
|
3018
3018
|
let [l, ...u] = e;
|
|
3019
3019
|
a();
|
|
3020
3020
|
for (let e of u) n(e.id);
|
|
@@ -3037,13 +3037,13 @@ function Kr() {
|
|
|
3037
3037
|
//#endregion
|
|
3038
3038
|
//#region src/editor/morph/StepPicker.jsx
|
|
3039
3039
|
function qr(e) {
|
|
3040
|
-
let t =
|
|
3040
|
+
let t = ot(e.id), n = ut(e.loop)?.params ?? [];
|
|
3041
3041
|
return {
|
|
3042
3042
|
loopId: e.loop,
|
|
3043
3043
|
loopGroup: t,
|
|
3044
3044
|
presetId: e.id,
|
|
3045
3045
|
presetLabel: e.label,
|
|
3046
|
-
params:
|
|
3046
|
+
params: Et(Be(e), n),
|
|
3047
3047
|
source: {
|
|
3048
3048
|
kind: "preset",
|
|
3049
3049
|
id: e.id,
|
|
@@ -3052,15 +3052,15 @@ function qr(e) {
|
|
|
3052
3052
|
};
|
|
3053
3053
|
}
|
|
3054
3054
|
function Jr(e, t) {
|
|
3055
|
-
let n = t ?
|
|
3055
|
+
let n = t ? Tt(e, t) : (e.layers ?? []).find((e) => e?.type === "loop");
|
|
3056
3056
|
if (!n) return null;
|
|
3057
|
-
let r =
|
|
3057
|
+
let r = ut(n.loopId)?.params ?? [];
|
|
3058
3058
|
return {
|
|
3059
3059
|
loopId: n.loopId,
|
|
3060
3060
|
loopGroup: n.loopGroup,
|
|
3061
3061
|
presetId: n.presetId,
|
|
3062
3062
|
presetLabel: n.presetLabel,
|
|
3063
|
-
params:
|
|
3063
|
+
params: Et(n, r),
|
|
3064
3064
|
source: {
|
|
3065
3065
|
kind: "file",
|
|
3066
3066
|
id: e.id,
|
|
@@ -3069,13 +3069,13 @@ function Jr(e, t) {
|
|
|
3069
3069
|
};
|
|
3070
3070
|
}
|
|
3071
3071
|
function Yr(e) {
|
|
3072
|
-
let t =
|
|
3072
|
+
let t = ut(e.loopId)?.params ?? [];
|
|
3073
3073
|
return {
|
|
3074
3074
|
loopId: e.loopId,
|
|
3075
3075
|
loopGroup: e.loopGroup,
|
|
3076
3076
|
presetId: e.presetId,
|
|
3077
3077
|
presetLabel: e.presetLabel,
|
|
3078
|
-
params:
|
|
3078
|
+
params: Et(e, t),
|
|
3079
3079
|
source: {
|
|
3080
3080
|
kind: "stage",
|
|
3081
3081
|
label: e.presetLabel || "Stage"
|
|
@@ -3083,7 +3083,7 @@ function Yr(e) {
|
|
|
3083
3083
|
};
|
|
3084
3084
|
}
|
|
3085
3085
|
function Xr() {
|
|
3086
|
-
let e =
|
|
3086
|
+
let e = kt(), { layer: t, setOnly: n } = Kr(), r = !!e.picker, i = e.mode === "blend" ? e.loopId : null, [a, o] = un(""), s = t?.type === "loop" && (e.steps.length < 2 || e.editing != null), { rows: c, make: l } = cn(() => {
|
|
3087
3087
|
let e = [], n = /* @__PURE__ */ new Map();
|
|
3088
3088
|
if (!r) return {
|
|
3089
3089
|
rows: e,
|
|
@@ -3093,10 +3093,10 @@ function Xr() {
|
|
|
3093
3093
|
id: "stage",
|
|
3094
3094
|
label: t.presetLabel || "Current stage",
|
|
3095
3095
|
group: "Current stage",
|
|
3096
|
-
hint:
|
|
3096
|
+
hint: Ve(t.loopGroup)?.label
|
|
3097
3097
|
}), n.set("stage", () => Yr(t)));
|
|
3098
|
-
for (let t of (
|
|
3099
|
-
if (t.mode === "morph" || !(i ?
|
|
3098
|
+
for (let t of (yt().preset ?? []).filter((e) => !e.shipped)) {
|
|
3099
|
+
if (t.mode === "morph" || !(i ? Tt(t, i) : (t.layers ?? []).some((e) => e?.type === "loop"))) continue;
|
|
3100
3100
|
let r = `file:${t.id}`;
|
|
3101
3101
|
e.push({
|
|
3102
3102
|
id: r,
|
|
@@ -3104,13 +3104,13 @@ function Xr() {
|
|
|
3104
3104
|
group: "My files"
|
|
3105
3105
|
}), n.set(r, () => Jr(t, i));
|
|
3106
3106
|
}
|
|
3107
|
-
for (let t of
|
|
3108
|
-
if (
|
|
3107
|
+
for (let t of Xe) {
|
|
3108
|
+
if (ft(t) || i && t.loop !== i) continue;
|
|
3109
3109
|
let r = `preset:${t.id}`;
|
|
3110
3110
|
e.push({
|
|
3111
3111
|
id: r,
|
|
3112
3112
|
label: t.label,
|
|
3113
|
-
group:
|
|
3113
|
+
group: Ve(ot(t.id))?.label ?? t.loop,
|
|
3114
3114
|
hint: t.sub
|
|
3115
3115
|
}), n.set(r, () => qr(t));
|
|
3116
3116
|
}
|
|
@@ -3149,7 +3149,7 @@ function Xr() {
|
|
|
3149
3149
|
return /* @__PURE__ */ P(Xt, {
|
|
3150
3150
|
open: !0,
|
|
3151
3151
|
onClose: () => {
|
|
3152
|
-
|
|
3152
|
+
Dt({ picker: null }), o(""), d(null);
|
|
3153
3153
|
},
|
|
3154
3154
|
suggestions: f,
|
|
3155
3155
|
results: p ? c.filter((e) => [
|
|
@@ -3171,7 +3171,7 @@ function Xr() {
|
|
|
3171
3171
|
presetLabel: r.presetLabel,
|
|
3172
3172
|
loopId: r.loopId,
|
|
3173
3173
|
...r.params
|
|
3174
|
-
}),
|
|
3174
|
+
}), Ot(r));
|
|
3175
3175
|
},
|
|
3176
3176
|
placeholder: "Search presets and files",
|
|
3177
3177
|
selectLabel: "Add step"
|
|
@@ -3321,10 +3321,10 @@ function si(e, t, n) {
|
|
|
3321
3321
|
}
|
|
3322
3322
|
return r;
|
|
3323
3323
|
}
|
|
3324
|
-
var
|
|
3325
|
-
function
|
|
3326
|
-
if (
|
|
3327
|
-
let t = new Uint8Array(
|
|
3324
|
+
var B = 512, ci = /* @__PURE__ */ new WeakMap();
|
|
3325
|
+
function li(e) {
|
|
3326
|
+
if (ci.has(e)) return ci.get(e);
|
|
3327
|
+
let t = new Uint8Array(B * B), n = [];
|
|
3328
3328
|
for (let t of e) for (let e = 0, r = t.length - 1; e < t.length; r = e++) {
|
|
3329
3329
|
let [i, a] = t[e], [o, s] = t[r];
|
|
3330
3330
|
if (a === s) continue;
|
|
@@ -3338,17 +3338,17 @@ function ui(e) {
|
|
|
3338
3338
|
}
|
|
3339
3339
|
n.sort((e, t) => e.y0 - t.y0);
|
|
3340
3340
|
let r = 0, i = [];
|
|
3341
|
-
for (let e = 0; e <
|
|
3342
|
-
let a = (e + .5) /
|
|
3341
|
+
for (let e = 0; e < B; e++) {
|
|
3342
|
+
let a = (e + .5) / B;
|
|
3343
3343
|
for (; r < n.length && n[r].y0 <= a;) i.push(n[r++]);
|
|
3344
3344
|
if (i = i.filter((e) => e.y1 > a), !i.length) continue;
|
|
3345
3345
|
let o = i.map((e) => e.x0 + (a - e.y0) * e.k).sort((e, t) => e - t);
|
|
3346
|
-
for (let n = 0; n + 1 < o.length; n += 2) for (let r = Math.max(0, Math.ceil(o[n] *
|
|
3346
|
+
for (let n = 0; n + 1 < o.length; n += 2) for (let r = Math.max(0, Math.ceil(o[n] * B - .5)); r <= Math.min(B - 1, Math.floor(o[n + 1] * B - .5)); r++) t[e * B + r] = 1;
|
|
3347
3347
|
}
|
|
3348
|
-
let a = (e, n) => e >= 0 && e < 1 && n >= 0 && n < 1 && t[Math.floor(n *
|
|
3349
|
-
return
|
|
3348
|
+
let a = (e, n) => e >= 0 && e < 1 && n >= 0 && n < 1 && t[Math.floor(n * B) * B + Math.floor(e * B)] === 1;
|
|
3349
|
+
return ci.set(e, a), a;
|
|
3350
3350
|
}
|
|
3351
|
-
function
|
|
3351
|
+
function ui(e, t = 1, n = null) {
|
|
3352
3352
|
let r = e.mKind ?? "none", i = e.mSize ?? 1;
|
|
3353
3353
|
switch (r) {
|
|
3354
3354
|
case "rect": {
|
|
@@ -3371,18 +3371,18 @@ function di(e, t = 1, n = null) {
|
|
|
3371
3371
|
};
|
|
3372
3372
|
case "arch": return (e, t) => t <= .5 || ((e - .5) / .5) ** 2 + ((t - .5) / .5) ** 2 <= 1;
|
|
3373
3373
|
case "letter":
|
|
3374
|
-
case "layer": return n?.length ?
|
|
3374
|
+
case "layer": return n?.length ? li(n) : () => !0;
|
|
3375
3375
|
default: return () => !0;
|
|
3376
3376
|
}
|
|
3377
3377
|
}
|
|
3378
|
-
function
|
|
3379
|
-
let r =
|
|
3378
|
+
function di(e, t = 1, n = null) {
|
|
3379
|
+
let r = fi(e, t, n);
|
|
3380
3380
|
return !r || !e.wPin ? r : (e, t) => {
|
|
3381
3381
|
let [n, i] = r(e, t), a = Math.sin(Math.PI * Math.min(1, Math.max(0, e))) * Math.sin(Math.PI * Math.min(1, Math.max(0, t)));
|
|
3382
3382
|
return [e + (n - e) * a, t + (i - t) * a];
|
|
3383
3383
|
};
|
|
3384
3384
|
}
|
|
3385
|
-
function
|
|
3385
|
+
function fi(e, t, n) {
|
|
3386
3386
|
let r = e.wKind ?? "none", i = e.wAmt ?? 0;
|
|
3387
3387
|
if (r === "none" || !i) return null;
|
|
3388
3388
|
if (r === "field") {
|
|
@@ -3424,7 +3424,7 @@ function pi(e, t, n) {
|
|
|
3424
3424
|
default: return null;
|
|
3425
3425
|
}
|
|
3426
3426
|
}
|
|
3427
|
-
var
|
|
3427
|
+
var pi = [
|
|
3428
3428
|
"flat",
|
|
3429
3429
|
"image",
|
|
3430
3430
|
"linear",
|
|
@@ -3446,16 +3446,16 @@ var mi = [
|
|
|
3446
3446
|
].map((e) => ({
|
|
3447
3447
|
value: e,
|
|
3448
3448
|
label: e[0].toUpperCase() + e.slice(1)
|
|
3449
|
-
})),
|
|
3449
|
+
})), mi = (e) => e === "g", hi = (e, t) => [
|
|
3450
3450
|
{
|
|
3451
3451
|
key: `${e}Kind`,
|
|
3452
|
-
label:
|
|
3452
|
+
label: mi(e) ? "Second" : "Source",
|
|
3453
3453
|
type: "select",
|
|
3454
|
-
default:
|
|
3455
|
-
options:
|
|
3454
|
+
default: mi(e) ? "none" : "radial",
|
|
3455
|
+
options: mi(e) ? [{
|
|
3456
3456
|
value: "none",
|
|
3457
3457
|
label: "None"
|
|
3458
|
-
}, ...
|
|
3458
|
+
}, ...pi] : pi,
|
|
3459
3459
|
section: t
|
|
3460
3460
|
},
|
|
3461
3461
|
{
|
|
@@ -3810,9 +3810,9 @@ var mi = [
|
|
|
3810
3810
|
section: t,
|
|
3811
3811
|
when: (t) => t[`${e}Kind`] === "noise"
|
|
3812
3812
|
}
|
|
3813
|
-
],
|
|
3814
|
-
...
|
|
3815
|
-
...
|
|
3813
|
+
], gi = [
|
|
3814
|
+
...hi("f", "Field"),
|
|
3815
|
+
...hi("g", "Field"),
|
|
3816
3816
|
{
|
|
3817
3817
|
key: "gInv",
|
|
3818
3818
|
label: "Invert second",
|
|
@@ -3909,13 +3909,13 @@ var mi = [
|
|
|
3909
3909
|
format: (e) => e ? `${Math.round(e * 100)}%` : "Off",
|
|
3910
3910
|
section: "Field"
|
|
3911
3911
|
}
|
|
3912
|
-
],
|
|
3912
|
+
], _i = [{
|
|
3913
3913
|
value: "inter",
|
|
3914
3914
|
label: "Inter"
|
|
3915
3915
|
}, {
|
|
3916
3916
|
value: "malromur",
|
|
3917
3917
|
label: "Malromur"
|
|
3918
|
-
}],
|
|
3918
|
+
}], vi = (e) => _i.some((t) => t.value === e?.mFamily) ? e.mFamily : "inter", yi = [
|
|
3919
3919
|
{
|
|
3920
3920
|
key: "mKind",
|
|
3921
3921
|
label: "Mask",
|
|
@@ -4001,7 +4001,7 @@ var mi = [
|
|
|
4001
4001
|
default: "inter",
|
|
4002
4002
|
section: "Mask",
|
|
4003
4003
|
when: (e) => e.mKind === "letter",
|
|
4004
|
-
options:
|
|
4004
|
+
options: _i
|
|
4005
4005
|
},
|
|
4006
4006
|
{
|
|
4007
4007
|
key: "mWeight",
|
|
@@ -4037,7 +4037,7 @@ var mi = [
|
|
|
4037
4037
|
section: "Mask",
|
|
4038
4038
|
when: (e) => e.mKind === "hourglass"
|
|
4039
4039
|
}
|
|
4040
|
-
],
|
|
4040
|
+
], bi = [
|
|
4041
4041
|
{
|
|
4042
4042
|
key: "wKind",
|
|
4043
4043
|
label: "Warp",
|
|
@@ -4178,7 +4178,7 @@ var mi = [
|
|
|
4178
4178
|
section: "Warp",
|
|
4179
4179
|
when: (e) => ["bulge", "swirl"].includes(e.wKind)
|
|
4180
4180
|
}
|
|
4181
|
-
],
|
|
4181
|
+
], xi = {
|
|
4182
4182
|
id: "lineScreen",
|
|
4183
4183
|
label: "Line screen",
|
|
4184
4184
|
about: "Line screen — parallel lines whose width follows a field, cut by a mask",
|
|
@@ -4398,7 +4398,7 @@ var mi = [
|
|
|
4398
4398
|
}
|
|
4399
4399
|
}
|
|
4400
4400
|
}
|
|
4401
|
-
},
|
|
4401
|
+
}, Si = {
|
|
4402
4402
|
id: "dotScreen",
|
|
4403
4403
|
label: "Dot screen",
|
|
4404
4404
|
about: "Dot screen — a grid of dots sized by a field, the grid bent by a warp",
|
|
@@ -4513,35 +4513,35 @@ var mi = [
|
|
|
4513
4513
|
}
|
|
4514
4514
|
],
|
|
4515
4515
|
draw(e, t, n, { field: r, mask: i, warp: a }) {
|
|
4516
|
-
let o = Math.max(1, Math.round(t.cols ?? 40)), s = n.w / o, c = Math.max(1, Math.round(t.rows || n.h / s)), l = n.h / c, u = Math.min(s, l) * (t.size ?? .9) / 2, d = t.min ?? .05, f = t.stretch ?? 1, p = f >= 1 ? 1 / Math.sqrt(f) : 1,
|
|
4516
|
+
let o = Math.max(1, Math.round(t.cols ?? 40)), s = n.w / o, c = Math.max(1, Math.round(t.rows || n.h / s)), l = n.h / c, u = Math.min(s, l) * (t.size ?? .9) / 2, d = t.min ?? .05, f = t.stretch ?? 1, p = f >= 1 ? 1 / Math.sqrt(f) : 1, h = f >= 1 ? Math.sqrt(f) : f, g = t.shape ?? "circle";
|
|
4517
4517
|
for (let s = 0; s < c; s++) {
|
|
4518
4518
|
let l = t.stagger && s % 2 ? .5 : 0;
|
|
4519
4519
|
for (let f = 0; f < o + (l ? -1 : 0); f++) {
|
|
4520
4520
|
let _ = (f + .5 + l) / o, v = (s + .5) / c;
|
|
4521
4521
|
if (t.justify) {
|
|
4522
|
-
let e = u * p / n.w, t = u *
|
|
4522
|
+
let e = u * p / n.w, t = u * h / n.h;
|
|
4523
4523
|
_ = e + (f + l) * (1 - 2 * e) / Math.max(1, o - 1), v = t + s * (1 - 2 * t) / Math.max(1, c - 1);
|
|
4524
4524
|
}
|
|
4525
|
-
let y = _,
|
|
4525
|
+
let y = _, x = v;
|
|
4526
4526
|
if (a) {
|
|
4527
4527
|
let [e, n] = a(_, v);
|
|
4528
|
-
t.wTarget === "field" ? (y = e,
|
|
4528
|
+
t.wTarget === "field" ? (y = e, x = n) : (_ = y = e, v = x = n);
|
|
4529
4529
|
}
|
|
4530
4530
|
if (!i(_, v)) continue;
|
|
4531
|
-
let
|
|
4532
|
-
if (C > 0)
|
|
4533
|
-
else if (
|
|
4534
|
-
let w = u *
|
|
4535
|
-
g === "square" ? ee(e, E, D, 2 * w, 2 * T, 0) : g === "diamond" ?
|
|
4531
|
+
let S = r(y, x), C = t.floor ?? 0;
|
|
4532
|
+
if (C > 0) S = C + (1 - C) * S;
|
|
4533
|
+
else if (S < d) continue;
|
|
4534
|
+
let w = u * S * p, T = u * S * h, E = n.x + _ * n.w, D = n.y + v * n.h;
|
|
4535
|
+
g === "square" ? ee(e, E, D, 2 * w, 2 * T, 0) : g === "diamond" ? m(e, [
|
|
4536
4536
|
[E, D - T * 1.25],
|
|
4537
4537
|
[E + w * 1.25, D],
|
|
4538
4538
|
[E, D + T * 1.25],
|
|
4539
4539
|
[E - w * 1.25, D]
|
|
4540
|
-
]) :
|
|
4540
|
+
]) : b(e, E, D, w, T);
|
|
4541
4541
|
}
|
|
4542
4542
|
}
|
|
4543
4543
|
}
|
|
4544
|
-
},
|
|
4544
|
+
}, Ci = {
|
|
4545
4545
|
linear: (e) => e,
|
|
4546
4546
|
ease: (e) => e * e * (3 - 2 * e),
|
|
4547
4547
|
in: (e) => e * e,
|
|
@@ -4552,10 +4552,10 @@ var mi = [
|
|
|
4552
4552
|
sine: (e) => .5 + .5 * Math.sin(2 * Math.PI * e),
|
|
4553
4553
|
bell: (e) => Math.exp(-(((e - .5) / .22) ** 2)),
|
|
4554
4554
|
last: (e) => +(e >= 1)
|
|
4555
|
-
},
|
|
4555
|
+
}, wi = Object.keys(Ci).map((e) => ({
|
|
4556
4556
|
value: e,
|
|
4557
4557
|
label: e[0].toUpperCase() + e.slice(1)
|
|
4558
|
-
})),
|
|
4558
|
+
})), Ti = (e, t, n, r, i, a, o, s = {}) => [
|
|
4559
4559
|
{
|
|
4560
4560
|
key: `${e}A`,
|
|
4561
4561
|
label: `${t} A`,
|
|
@@ -4583,14 +4583,14 @@ var mi = [
|
|
|
4583
4583
|
label: `${t} curve`,
|
|
4584
4584
|
type: "select",
|
|
4585
4585
|
default: "linear",
|
|
4586
|
-
options:
|
|
4586
|
+
options: wi,
|
|
4587
4587
|
section: o,
|
|
4588
4588
|
...s
|
|
4589
4589
|
}
|
|
4590
|
-
],
|
|
4590
|
+
], Ei = (e, t, n) => {
|
|
4591
4591
|
let r = e[`${t}A`] ?? 0;
|
|
4592
|
-
return r + ((e[`${t}B`] ?? r) - r) * (
|
|
4593
|
-
},
|
|
4592
|
+
return r + ((e[`${t}B`] ?? r) - r) * (Ci[e[`${t}C`]] ?? Ci.linear)(n);
|
|
4593
|
+
}, Di = {
|
|
4594
4594
|
id: "stripeArray",
|
|
4595
4595
|
label: "Stripe array",
|
|
4596
4596
|
about: "Stripe array — strips whose width, gap, length, shear, wave and bend ramp from first to last",
|
|
@@ -4655,11 +4655,11 @@ var mi = [
|
|
|
4655
4655
|
format: (e) => `${e}×`,
|
|
4656
4656
|
section: "Strips"
|
|
4657
4657
|
},
|
|
4658
|
-
...
|
|
4659
|
-
...
|
|
4660
|
-
...
|
|
4661
|
-
...
|
|
4662
|
-
...
|
|
4658
|
+
...Ti("w", "Width", 0, 1, .5, .5, "Strips", { format: (e) => e > 1 ? `${+e.toFixed(2)}` : `${Math.round(e * 100)}%` }),
|
|
4659
|
+
...Ti("s", "Start", -.5, 1, 0, 0, "Length"),
|
|
4660
|
+
...Ti("e", "End", 0, 1.5, 1, 1, "Length"),
|
|
4661
|
+
...Ti("k", "Shear", -3, 3, 0, 0, "Length"),
|
|
4662
|
+
...Ti("a", "Wave", 0, .3, 0, 0, "Wave"),
|
|
4663
4663
|
{
|
|
4664
4664
|
key: "freq",
|
|
4665
4665
|
label: "Waves",
|
|
@@ -4670,8 +4670,8 @@ var mi = [
|
|
|
4670
4670
|
default: 3,
|
|
4671
4671
|
section: "Wave"
|
|
4672
4672
|
},
|
|
4673
|
-
...
|
|
4674
|
-
...
|
|
4673
|
+
...Ti("ph", "Phase", -1, 1, 0, 0, "Wave"),
|
|
4674
|
+
...Ti("b", "Bend", -.6, .6, 0, 0, "Bend"),
|
|
4675
4675
|
{
|
|
4676
4676
|
key: "dash",
|
|
4677
4677
|
label: "Dash",
|
|
@@ -4779,7 +4779,7 @@ var mi = [
|
|
|
4779
4779
|
section: "Strips",
|
|
4780
4780
|
when: (e) => e.spread === "units"
|
|
4781
4781
|
},
|
|
4782
|
-
...
|
|
4782
|
+
...Ti("g", "Gap", 0, 400, .5, .5, "Strips", {
|
|
4783
4783
|
rMin: 0,
|
|
4784
4784
|
rMax: .6,
|
|
4785
4785
|
when: (e) => e.spread === "packed" || e.spread === "units"
|
|
@@ -4791,14 +4791,14 @@ var mi = [
|
|
|
4791
4791
|
y: n.y + n.h / 2 - a / 2,
|
|
4792
4792
|
w: a,
|
|
4793
4793
|
h: a
|
|
4794
|
-
} : n, s = r ? o.w : o.h, c = r ? o.h : o.w, l = Math.max(1, Math.round(t.count ?? 16)), u = s / l, d = Math.round(t.period ?? 0) || l, f = t.lead ?? 1, p = (e) => d > 1 ? e % d / (d - 1) : 0,
|
|
4794
|
+
} : n, s = r ? o.w : o.h, c = r ? o.h : o.w, l = Math.max(1, Math.round(t.count ?? 16)), u = s / l, d = Math.round(t.period ?? 0) || l, f = t.lead ?? 1, p = (e) => d > 1 ? e % d / (d - 1) : 0, h = (e) => Math.max(0, Ei(t, "w", p(e))) * (e % d === 0 ? f : 1), g, _;
|
|
4795
4795
|
if (t.spread === "packed" || t.spread === "units") {
|
|
4796
|
-
let e = Array.from({ length: l }, (e, t) =>
|
|
4796
|
+
let e = Array.from({ length: l }, (e, t) => h(t)), r = Array.from({ length: l }, (e, n) => Math.max(0, Ei(t, "g", p(n)))), i = t.spread === "units" ? Math.min(n.w, n.h) / 800 : s / (e.reduce((e, t) => e + t, 0) + r.slice(0, -1).reduce((e, t) => e + t, 0) || 1), a = t.spread === "units" ? (t.offset ?? 0) * s : 0;
|
|
4797
4797
|
g = [], _ = [];
|
|
4798
4798
|
for (let t = 0; t < l; t++) _.push(e[t] * i), g.push(a + e[t] * i / 2), a += (e[t] + r[t]) * i;
|
|
4799
4799
|
} else {
|
|
4800
|
-
_ = Array.from({ length: l }, (e, t) =>
|
|
4801
|
-
let e = Math.max(...Array.from({ length: l }, (e, n) => Math.abs(
|
|
4800
|
+
_ = Array.from({ length: l }, (e, t) => h(t) * u);
|
|
4801
|
+
let e = Math.max(...Array.from({ length: l }, (e, n) => Math.abs(Ei(t, "a", p(n))))) * s, n = _[0] / 2 + e, r = s - _[l - 1] / 2 - e;
|
|
4802
4802
|
g = _.map((e, t) => l > 1 ? n + (r - n) * t / (l - 1) : s / 2);
|
|
4803
4803
|
}
|
|
4804
4804
|
let v = n.x + n.w / 2, y = n.y + n.h / 2, b = Math.cos(i), x = Math.sin(i), S = (e, t) => {
|
|
@@ -4807,14 +4807,14 @@ var mi = [
|
|
|
4807
4807
|
let a = n[0] - v, s = n[1] - y;
|
|
4808
4808
|
return [v + a * b - s * x, y + a * x + s * b];
|
|
4809
4809
|
}, C = (t) => {
|
|
4810
|
-
i && (t = E(t, n)),
|
|
4810
|
+
i && (t = E(t, n)), m(e, t);
|
|
4811
4811
|
};
|
|
4812
4812
|
for (let e = 0; e < l; e++) {
|
|
4813
4813
|
let n = p(e), r = _[e];
|
|
4814
4814
|
if (r <= .05) continue;
|
|
4815
|
-
let i =
|
|
4815
|
+
let i = Ei(t, "s", n) * c, a = Ei(t, "e", n) * c;
|
|
4816
4816
|
if (a - i <= .5) continue;
|
|
4817
|
-
let o =
|
|
4817
|
+
let o = Ei(t, "k", n), l = Ei(t, "a", n) * s, u = Ei(t, "ph", n), d = Ei(t, "b", n) * s, f = t.freq ?? 3, m = (t) => {
|
|
4818
4818
|
let n = t / c;
|
|
4819
4819
|
return g[e] + l * Math.sin(2 * Math.PI * (n * f + u)) + d * 4 * (n - .5) * (n - .5);
|
|
4820
4820
|
}, h = [], v = (t.dash ?? 0) * c, y = (t.gap ?? .05) * c, b = String(t.edges ?? "").split(";").map((e) => e.split(":").map(Number)).filter((e) => e.length >= 1 && Number.isFinite(e[0])), x = t.edgeNoise ?? 0;
|
|
@@ -4844,17 +4844,17 @@ var mi = [
|
|
|
4844
4844
|
}
|
|
4845
4845
|
}
|
|
4846
4846
|
}
|
|
4847
|
-
},
|
|
4847
|
+
}, Oi = {
|
|
4848
4848
|
linear: (e) => e,
|
|
4849
4849
|
ease: (e) => e * e * (3 - 2 * e),
|
|
4850
4850
|
in: (e) => e * e,
|
|
4851
4851
|
out: (e) => 1 - (1 - e) * (1 - e),
|
|
4852
4852
|
hump: (e) => Math.sin(Math.PI * e),
|
|
4853
4853
|
alt: (e, t) => t % 2
|
|
4854
|
-
},
|
|
4854
|
+
}, ki = Object.keys(Oi).map((e) => ({
|
|
4855
4855
|
value: e,
|
|
4856
4856
|
label: { alt: "Alternate" }[e] ?? e[0].toUpperCase() + e.slice(1)
|
|
4857
|
-
})),
|
|
4857
|
+
})), Ai = (e, t, n, r, i, a, o, s = {}) => [
|
|
4858
4858
|
{
|
|
4859
4859
|
key: `${e}A`,
|
|
4860
4860
|
label: `${t} A`,
|
|
@@ -4882,14 +4882,14 @@ var mi = [
|
|
|
4882
4882
|
label: `${t} curve`,
|
|
4883
4883
|
type: "select",
|
|
4884
4884
|
default: "linear",
|
|
4885
|
-
options:
|
|
4885
|
+
options: ki,
|
|
4886
4886
|
section: o,
|
|
4887
4887
|
...s
|
|
4888
4888
|
}
|
|
4889
|
-
],
|
|
4889
|
+
], ji = (e, t, n, r) => {
|
|
4890
4890
|
let i = e[`${t}A`] ?? 0;
|
|
4891
|
-
return i + ((e[`${t}B`] ?? i) - i) * (
|
|
4892
|
-
},
|
|
4891
|
+
return i + ((e[`${t}B`] ?? i) - i) * (Oi[e[`${t}C`]] ?? Oi.linear)(n, r);
|
|
4892
|
+
}, Mi = (e) => e.mode === "rings", Ni = {
|
|
4893
4893
|
id: "radialArray",
|
|
4894
4894
|
label: "Radial array",
|
|
4895
4895
|
about: "Radial array — rays or rings around a centre, each ramping in length, width and turn",
|
|
@@ -4974,7 +4974,7 @@ var mi = [
|
|
|
4974
4974
|
type: "toggle",
|
|
4975
4975
|
default: !1,
|
|
4976
4976
|
section: "Rays",
|
|
4977
|
-
when: (e) => !
|
|
4977
|
+
when: (e) => !Mi(e)
|
|
4978
4978
|
},
|
|
4979
4979
|
{
|
|
4980
4980
|
key: "raySample",
|
|
@@ -4986,7 +4986,7 @@ var mi = [
|
|
|
4986
4986
|
default: 4,
|
|
4987
4987
|
format: (e) => `${e}px`,
|
|
4988
4988
|
section: "Rays",
|
|
4989
|
-
when: (e) => !
|
|
4989
|
+
when: (e) => !Mi(e) && !!e.byField
|
|
4990
4990
|
},
|
|
4991
4991
|
{
|
|
4992
4992
|
key: "shape",
|
|
@@ -4994,7 +4994,7 @@ var mi = [
|
|
|
4994
4994
|
type: "segmented",
|
|
4995
4995
|
default: "bar",
|
|
4996
4996
|
section: "Rays",
|
|
4997
|
-
when: (e) => !
|
|
4997
|
+
when: (e) => !Mi(e),
|
|
4998
4998
|
options: [
|
|
4999
4999
|
{
|
|
5000
5000
|
value: "bar",
|
|
@@ -5010,16 +5010,16 @@ var mi = [
|
|
|
5010
5010
|
}
|
|
5011
5011
|
]
|
|
5012
5012
|
},
|
|
5013
|
-
...
|
|
5013
|
+
...Ai("r0", "Inner", 0, 4, .2, .2, "Radii", {
|
|
5014
5014
|
rMin: 0,
|
|
5015
5015
|
rMax: .5
|
|
5016
5016
|
}),
|
|
5017
|
-
...
|
|
5017
|
+
...Ai("r1", "Outer", 0, 12, 1, 1, "Radii", {
|
|
5018
5018
|
rMin: .6,
|
|
5019
5019
|
rMax: 1.6
|
|
5020
5020
|
}),
|
|
5021
|
-
...
|
|
5022
|
-
...
|
|
5021
|
+
...Ai("w", "Width", 0, 1, .5, .5, "Width", { format: (e) => `${Math.round(e * 100)}%` }),
|
|
5022
|
+
...Ai("rot", "Turn", -180, 180, 0, 0, "Turn", { format: (e) => `${Math.round(e)}°` }),
|
|
5023
5023
|
{
|
|
5024
5024
|
key: "segments",
|
|
5025
5025
|
label: "Segments",
|
|
@@ -5029,7 +5029,7 @@ var mi = [
|
|
|
5029
5029
|
step: 1,
|
|
5030
5030
|
default: 1,
|
|
5031
5031
|
section: "Rings",
|
|
5032
|
-
when:
|
|
5032
|
+
when: Mi
|
|
5033
5033
|
},
|
|
5034
5034
|
{
|
|
5035
5035
|
key: "segGap",
|
|
@@ -5040,7 +5040,7 @@ var mi = [
|
|
|
5040
5040
|
step: .01,
|
|
5041
5041
|
default: .1,
|
|
5042
5042
|
section: "Rings",
|
|
5043
|
-
when: (e) =>
|
|
5043
|
+
when: (e) => Mi(e) && (e.segments ?? 1) > 1
|
|
5044
5044
|
},
|
|
5045
5045
|
{
|
|
5046
5046
|
key: "taper",
|
|
@@ -5051,7 +5051,7 @@ var mi = [
|
|
|
5051
5051
|
step: .01,
|
|
5052
5052
|
default: 0,
|
|
5053
5053
|
section: "Rings",
|
|
5054
|
-
when:
|
|
5054
|
+
when: Mi
|
|
5055
5055
|
},
|
|
5056
5056
|
{
|
|
5057
5057
|
key: "taperPow",
|
|
@@ -5062,7 +5062,7 @@ var mi = [
|
|
|
5062
5062
|
step: .05,
|
|
5063
5063
|
default: 1,
|
|
5064
5064
|
section: "Rings",
|
|
5065
|
-
when:
|
|
5065
|
+
when: Mi
|
|
5066
5066
|
},
|
|
5067
5067
|
{
|
|
5068
5068
|
key: "taperAlign",
|
|
@@ -5070,7 +5070,7 @@ var mi = [
|
|
|
5070
5070
|
type: "segmented",
|
|
5071
5071
|
default: "centre",
|
|
5072
5072
|
section: "Rings",
|
|
5073
|
-
when:
|
|
5073
|
+
when: Mi,
|
|
5074
5074
|
options: [
|
|
5075
5075
|
{
|
|
5076
5076
|
value: "centre",
|
|
@@ -5095,7 +5095,7 @@ var mi = [
|
|
|
5095
5095
|
step: .01,
|
|
5096
5096
|
default: 0,
|
|
5097
5097
|
section: "Rings",
|
|
5098
|
-
when:
|
|
5098
|
+
when: Mi
|
|
5099
5099
|
},
|
|
5100
5100
|
{
|
|
5101
5101
|
key: "zigN",
|
|
@@ -5106,21 +5106,21 @@ var mi = [
|
|
|
5106
5106
|
step: 1,
|
|
5107
5107
|
default: 8,
|
|
5108
5108
|
section: "Rings",
|
|
5109
|
-
when: (e) =>
|
|
5109
|
+
when: (e) => Mi(e) && (e.zig ?? 0) > 0
|
|
5110
5110
|
}
|
|
5111
5111
|
],
|
|
5112
5112
|
draw(e, t, n, { field: r, mask: i }) {
|
|
5113
|
-
let a = Math.max(1, Math.round(t.count ?? 36)), o = Math.min(n.w, n.h) / 2, s = n.x + (t.cx ?? .5) * n.w, c = n.y + (t.cy ?? .5) * n.h, l = (t.start ?? -90) * Math.PI / 180, u = (t.span ?? 360) * Math.PI / 180, d = (t.span ?? 360) >= 360, f = (t) =>
|
|
5113
|
+
let a = Math.max(1, Math.round(t.count ?? 36)), o = Math.min(n.w, n.h) / 2, s = n.x + (t.cx ?? .5) * n.w, c = n.y + (t.cy ?? .5) * n.h, l = (t.start ?? -90) * Math.PI / 180, u = (t.span ?? 360) * Math.PI / 180, d = (t.span ?? 360) >= 360, f = (t) => m(e, E(t, n)), p = (e, t) => [s + Math.cos(e) * t, c + Math.sin(e) * t], h = (e) => a > 1 ? e / (a - 1) : 0;
|
|
5114
5114
|
if (t.mode === "rings") {
|
|
5115
|
-
let e = Math.max(1, Math.round(t.segments ?? 1)), n = t.segGap ?? .1, r = t.zig ?? 0, i = Math.round(t.zigN ?? 8),
|
|
5115
|
+
let e = Math.max(1, Math.round(t.segments ?? 1)), n = t.segGap ?? .1, r = t.zig ?? 0, i = Math.round(t.zigN ?? 8), m = (e) => 4 * Math.abs((e % 1 + 1) % 1 - .5) - 1;
|
|
5116
5116
|
for (let g = 0; g < a; g++) {
|
|
5117
|
-
let a =
|
|
5117
|
+
let a = h(g), _ = ji(t, "r1", a, g) * o, v = ji(t, "w", a, g) * o;
|
|
5118
5118
|
if (v <= .05 || _ <= 0) continue;
|
|
5119
|
-
let y =
|
|
5119
|
+
let y = ji(t, "rot", a, g) * Math.PI / 180, b = u / e;
|
|
5120
5120
|
for (let a = 0; a < e; a++) {
|
|
5121
|
-
let u = l + y + a * b + (e > 1 ? b * n / 2 : 0),
|
|
5121
|
+
let u = l + y + a * b + (e > 1 ? b * n / 2 : 0), h = l + y + (a + 1) * b - (e > 1 ? b * n / 2 : 0), g = Math.max(8, Math.ceil((h - u) * _ / 6)) * (r ? 4 : 1), x = [], S = [];
|
|
5122
5122
|
for (let e = 0; e <= g; e++) {
|
|
5123
|
-
let n = u + (
|
|
5123
|
+
let n = u + (h - u) * e / g, a = e / g, s = r ? r * o * .25 * m((n - l) / (2 * Math.PI) * i) : 0;
|
|
5124
5124
|
x.push(p(n, _ + s)), S.push(v * Math.max(0, 1 + (t.taper ?? 0) * (2 * a ** (t.taperPow ?? 1) - 1)));
|
|
5125
5125
|
}
|
|
5126
5126
|
let C = [], w = [];
|
|
@@ -5140,19 +5140,19 @@ var mi = [
|
|
|
5140
5140
|
}
|
|
5141
5141
|
let g = d ? u / a : u / Math.max(1, a - 1);
|
|
5142
5142
|
for (let e = 0; e < a; e++) {
|
|
5143
|
-
let a =
|
|
5144
|
-
if (
|
|
5145
|
-
let _ =
|
|
5143
|
+
let a = h(e), u = l + e * g + ji(t, "rot", a, e) * Math.PI / 180, d = ji(t, "r0", a, e) * o, m = ji(t, "r1", a, e) * o;
|
|
5144
|
+
if (m - d <= .3) continue;
|
|
5145
|
+
let _ = ji(t, "w", a, e);
|
|
5146
5146
|
if (!(_ <= 0)) if (t.byField && r) {
|
|
5147
|
-
let e = Math.max(1, t.raySample ?? 4), a = Math.abs(g) *
|
|
5147
|
+
let e = Math.max(1, t.raySample ?? 4), a = Math.abs(g) * m * _ / 2, o = Math.cos(u), l = Math.sin(u), p = -l, h = o, v = [], y = () => {
|
|
5148
5148
|
if (v.length) {
|
|
5149
|
-
let e = v.map(([e, t]) => [s + o * e + p * t, c + l * e +
|
|
5149
|
+
let e = v.map(([e, t]) => [s + o * e + p * t, c + l * e + h * t]), t = v.map(([e, t]) => [s + o * e - p * t, c + l * e - h * t]).reverse();
|
|
5150
5150
|
f([...e, ...t]);
|
|
5151
5151
|
}
|
|
5152
5152
|
v = [];
|
|
5153
5153
|
};
|
|
5154
|
-
for (let t = d; t <
|
|
5155
|
-
let u = Math.min(
|
|
5154
|
+
for (let t = d; t < m; t += e) {
|
|
5155
|
+
let u = Math.min(m, t + e), d = (t + u) / 2, f = s + o * d, p = c + l * d, h = (f - n.x) / n.w, g = (p - n.y) / n.h, _ = i(h, g) ? a * r(h, g) : 0;
|
|
5156
5156
|
if (_ <= .05) {
|
|
5157
5157
|
y();
|
|
5158
5158
|
continue;
|
|
@@ -5161,50 +5161,50 @@ var mi = [
|
|
|
5161
5161
|
}
|
|
5162
5162
|
y();
|
|
5163
5163
|
} else if (t.shape === "spike") {
|
|
5164
|
-
let e = Math.abs(g) *
|
|
5164
|
+
let e = Math.abs(g) * m * _ / 2, t = Math.cos(u), n = Math.sin(u), r = -n, i = t;
|
|
5165
5165
|
f([
|
|
5166
5166
|
[s + t * d, c + n * d],
|
|
5167
|
-
[s + t *
|
|
5168
|
-
[s + t *
|
|
5167
|
+
[s + t * m + r * e, c + n * m + i * e],
|
|
5168
|
+
[s + t * m - r * e, c + n * m - i * e]
|
|
5169
5169
|
]);
|
|
5170
5170
|
} else if (t.shape === "wedge") {
|
|
5171
5171
|
let e = Math.abs(g) * _ / 2;
|
|
5172
5172
|
f([
|
|
5173
5173
|
p(u - e, d),
|
|
5174
|
-
p(u - e,
|
|
5175
|
-
p(u + e,
|
|
5174
|
+
p(u - e, m),
|
|
5175
|
+
p(u + e, m),
|
|
5176
5176
|
p(u + e, d)
|
|
5177
5177
|
]);
|
|
5178
5178
|
} else {
|
|
5179
|
-
let e = Math.abs(g) *
|
|
5179
|
+
let e = Math.abs(g) * m * _ / 2, t = Math.cos(u), n = Math.sin(u), r = -n, i = t;
|
|
5180
5180
|
f([
|
|
5181
5181
|
[s + t * d + r * e, c + n * d + i * e],
|
|
5182
|
-
[s + t *
|
|
5183
|
-
[s + t *
|
|
5182
|
+
[s + t * m + r * e, c + n * m + i * e],
|
|
5183
|
+
[s + t * m - r * e, c + n * m - i * e],
|
|
5184
5184
|
[s + t * d - r * e, c + n * d - i * e]
|
|
5185
5185
|
]);
|
|
5186
5186
|
}
|
|
5187
5187
|
}
|
|
5188
5188
|
}
|
|
5189
|
-
},
|
|
5189
|
+
}, Pi = (e, t) => {
|
|
5190
5190
|
let n = Math.imul(e + 1, 2654435761) ^ Math.imul(t + 7, 40503);
|
|
5191
5191
|
return n = Math.imul(n ^ n >>> 15, 2246822519), n ^= n >>> 13, (n >>> 0) / 4294967296;
|
|
5192
|
-
},
|
|
5192
|
+
}, Fi = (e, t, n, r, i, a) => {
|
|
5193
5193
|
let o = r - t, s = i - n, c = Math.hypot(o, s) || 1, l = -s / c * (a / 2), u = o / c * (a / 2);
|
|
5194
|
-
|
|
5194
|
+
m(e, [
|
|
5195
5195
|
[t + l, n + u],
|
|
5196
5196
|
[r + l, i + u],
|
|
5197
5197
|
[r - l, i - u],
|
|
5198
5198
|
[t - l, n - u]
|
|
5199
5199
|
]);
|
|
5200
|
-
},
|
|
5200
|
+
}, Ii = (e, t, n, r, i) => {
|
|
5201
5201
|
let a = [], o = [];
|
|
5202
5202
|
for (let e = 0; e < 24; e++) {
|
|
5203
5203
|
let s = e / 24 * 2 * Math.PI;
|
|
5204
5204
|
a.push([t + Math.cos(s) * r, n + Math.sin(s) * r]), o.push([t + Math.cos(s) * (r - i), n + Math.sin(s) * (r - i)]);
|
|
5205
5205
|
}
|
|
5206
|
-
|
|
5207
|
-
},
|
|
5206
|
+
we(e, [a, o]);
|
|
5207
|
+
}, Li = (e, t, n, r, i, a) => we(e, [[
|
|
5208
5208
|
[t - r, n - i],
|
|
5209
5209
|
[t + r, n - i],
|
|
5210
5210
|
[t + r, n + i],
|
|
@@ -5215,7 +5215,7 @@ var mi = [
|
|
|
5215
5215
|
[t + r - a, n + i - a],
|
|
5216
5216
|
[t - r + a, n + i - a]
|
|
5217
5217
|
]]);
|
|
5218
|
-
function
|
|
5218
|
+
function Ri(e, t, n, r, i, a, o, s) {
|
|
5219
5219
|
let c = Math.min(i, a);
|
|
5220
5220
|
switch (t) {
|
|
5221
5221
|
case "|": {
|
|
@@ -5224,16 +5224,16 @@ function zi(e, t, n, r, i, a, o, s) {
|
|
|
5224
5224
|
break;
|
|
5225
5225
|
}
|
|
5226
5226
|
case ".":
|
|
5227
|
-
|
|
5227
|
+
b(e, n, r, c * .12);
|
|
5228
5228
|
break;
|
|
5229
5229
|
case "o":
|
|
5230
|
-
|
|
5230
|
+
Ii(e, n, r, c * .22, s);
|
|
5231
5231
|
break;
|
|
5232
5232
|
case "x":
|
|
5233
|
-
|
|
5233
|
+
Fi(e, n - c * .2, r - c * .2, n + c * .2, r + c * .2, s), Fi(e, n - c * .2, r + c * .2, n + c * .2, r - c * .2, s);
|
|
5234
5234
|
break;
|
|
5235
5235
|
case "/":
|
|
5236
|
-
|
|
5236
|
+
Fi(e, n - c * .3, r + c * .3, n + c * .3, r - c * .3, s);
|
|
5237
5237
|
break;
|
|
5238
5238
|
case "-":
|
|
5239
5239
|
O(e, n - i * .35, r - s / 2, i * .7, s);
|
|
@@ -5242,15 +5242,15 @@ function zi(e, t, n, r, i, a, o, s) {
|
|
|
5242
5242
|
O(e, n - i * .3, r - a * .18, i * .6, a * .36);
|
|
5243
5243
|
break;
|
|
5244
5244
|
case "[":
|
|
5245
|
-
|
|
5245
|
+
Li(e, n, r, i * .35, a * .25, s);
|
|
5246
5246
|
break;
|
|
5247
5247
|
case "^":
|
|
5248
|
-
|
|
5248
|
+
Fi(e, n - i * .45, r + c * .25, n + i * .3, r + c * .25, s), Fi(e, n + i * .3, r + c * .25, n + i * .45, r - c * .25, s);
|
|
5249
5249
|
break;
|
|
5250
5250
|
default: break;
|
|
5251
5251
|
}
|
|
5252
5252
|
}
|
|
5253
|
-
var
|
|
5253
|
+
var zi = {
|
|
5254
5254
|
id: "symbolGrid",
|
|
5255
5255
|
label: "Symbol grid",
|
|
5256
5256
|
about: "Symbol grid — small symbols in a grid, picked and sized by a field, with tracks, accents and plots",
|
|
@@ -5596,25 +5596,25 @@ var Bi = {
|
|
|
5596
5596
|
let i = t[`c${r}A`] ?? .2, o = t[`c${r}F`] ?? 1, s = (t[`c${r}P`] ?? 0) * Math.PI / 180, c = t[`c${r}Y`] ?? .5, u = t[`c${r}D`] ?? 3, d = Math.max(1, Math.round(t[`c${r}N`] ?? 40)), f = (e) => n.y + n.h * (c - i * Math.sin(2 * Math.PI * e * o + s)), p = null, m = a * 4;
|
|
5597
5597
|
for (let t = 0; t <= m; t++) {
|
|
5598
5598
|
let r = t / m, i = n.x + r * n.w, a = f(r);
|
|
5599
|
-
p &&
|
|
5599
|
+
p && Fi(e, p[0], p[1], i, a, l), p = [i, a];
|
|
5600
5600
|
}
|
|
5601
5601
|
for (let t = 0; t <= d; t++) {
|
|
5602
5602
|
let r = t / d;
|
|
5603
|
-
|
|
5603
|
+
b(e, n.x + r * n.w, f(r), u);
|
|
5604
5604
|
}
|
|
5605
5605
|
}
|
|
5606
5606
|
return;
|
|
5607
5607
|
}
|
|
5608
5608
|
let d = (t.set || "|").replace(/\s+/g, "").split(""), f = t.empty ?? .05, p = (t.wave ?? 0) * c, m = t.track ?? 0, h = t.ragged ?? 0, g = (t.grain ?? 0) * c, _ = t.widthBy ?? 0;
|
|
5609
5609
|
for (let v = 0; v < o; v++) {
|
|
5610
|
-
let y = v * .07 + (t.waveDesync ?? 0) *
|
|
5610
|
+
let y = v * .07 + (t.waveDesync ?? 0) * Pi(v + 701, u), b = h * Pi(v + 801, u), x = 1 - h * Pi(v + 901, u);
|
|
5611
5611
|
for (let h = 0; h < a; h++) {
|
|
5612
5612
|
let S = v * a + h, C = (h + .5) / a;
|
|
5613
5613
|
if (C < b || C > x) continue;
|
|
5614
|
-
let w = (p ? p * Math.sin(2 * Math.PI * (C * (t.waveFreq ?? 2) + y)) : 0) + (g ? g * (
|
|
5614
|
+
let w = (p ? p * Math.sin(2 * Math.PI * (C * (t.waveFreq ?? 2) + y)) : 0) + (g ? g * (Pi(S + 1001, u) - .5) : 0), T = n.x + (h + .5) * s, E = n.y + (v + .5) * c + w, D = (E - n.y) / n.h;
|
|
5615
5615
|
if (!i(C, D)) continue;
|
|
5616
5616
|
let k = r(C, D);
|
|
5617
|
-
if ((t.accent ?? 0) > 0 &&
|
|
5617
|
+
if ((t.accent ?? 0) > 0 && Pi(S + 31, u) < t.accent) {
|
|
5618
5618
|
let n = Math.round(t.accentLen ?? 3);
|
|
5619
5619
|
O(e, T - s * .45, E - c * .18, s * (n - .1), c * .36), h += n - 1;
|
|
5620
5620
|
continue;
|
|
@@ -5622,22 +5622,22 @@ var Bi = {
|
|
|
5622
5622
|
if (m > 0) {
|
|
5623
5623
|
let n = .5 + m * Math.sin(2 * Math.PI * (C * (t.trackFreq ?? 1) + (t.trackPhase ?? 0)));
|
|
5624
5624
|
if (Math.abs(n - D) * o < .5) {
|
|
5625
|
-
|
|
5625
|
+
Li(e, T, E, Math.min(s, c) * .35, Math.min(s, c) * .35, l);
|
|
5626
5626
|
continue;
|
|
5627
5627
|
}
|
|
5628
5628
|
}
|
|
5629
|
-
k < f ||
|
|
5629
|
+
k < f || Ri(e, t.pick === "random" ? d[Math.floor(Pi(S, u) * d.length)] : t.pick === "row" ? d[v % d.length] : d[Math.min(d.length - 1, Math.floor(k * d.length))], T, E, s, c, k, _ ? l * (1 - _ + _ * k) : l);
|
|
5630
5630
|
}
|
|
5631
5631
|
}
|
|
5632
5632
|
for (let r = 0; r < Math.round(t.rules ?? 0); r++) {
|
|
5633
|
-
let t =
|
|
5633
|
+
let t = Pi(r + 101, u) < .5, i = n.x + Math.floor(Pi(r + 201, u) * a) * s, d = n.y + Math.floor(Pi(r + 301, u) * o) * c, f = (3 + Math.floor(Pi(r + 401, u) * 12)) * (t ? c : s);
|
|
5634
5634
|
t ? O(e, i - l / 4, d, l / 2, Math.min(f, n.y + n.h - d)) : O(e, i, d - l / 4, Math.min(f, n.x + n.w - i), l / 2);
|
|
5635
5635
|
}
|
|
5636
5636
|
}
|
|
5637
|
-
},
|
|
5637
|
+
}, Bi = (e, t) => {
|
|
5638
5638
|
let n = Math.imul(e + 1, 2654435761) ^ Math.imul(t + 3, 40503);
|
|
5639
5639
|
return n = Math.imul(n ^ n >>> 15, 2246822519), n ^= n >>> 13, (n >>> 0) / 4294967296;
|
|
5640
|
-
},
|
|
5640
|
+
}, Vi = [
|
|
5641
5641
|
"solid",
|
|
5642
5642
|
"dots",
|
|
5643
5643
|
"lines",
|
|
@@ -5647,15 +5647,15 @@ var Bi = {
|
|
|
5647
5647
|
value: e,
|
|
5648
5648
|
label: { hlines: "Rows of lines" }[e] ?? e[0].toUpperCase() + e.slice(1)
|
|
5649
5649
|
}));
|
|
5650
|
-
function
|
|
5650
|
+
function Hi(e, t, n, r, i, a, o, s) {
|
|
5651
5651
|
if (!(i <= 0 || a <= 0)) {
|
|
5652
5652
|
if (t === "solid") O(e, n, r, i, a);
|
|
5653
|
-
else if (t === "dots") for (let t = r + o / 2; t < r + a; t += o) for (let r = n + o / 2; r < n + i; r += o)
|
|
5653
|
+
else if (t === "dots") for (let t = r + o / 2; t < r + a; t += o) for (let r = n + o / 2; r < n + i; r += o) b(e, r, t, s * o * .5);
|
|
5654
5654
|
else if (t === "lines") for (let t = n; t < n + i - .1; t += o) O(e, t, r, Math.min(s * o, n + i - t), a);
|
|
5655
5655
|
else if (t === "hlines") for (let t = r; t < r + a - .1; t += o) O(e, n, t, i, Math.min(s * o, r + a - t));
|
|
5656
5656
|
}
|
|
5657
5657
|
}
|
|
5658
|
-
var
|
|
5658
|
+
var Ui = {
|
|
5659
5659
|
id: "tiling",
|
|
5660
5660
|
label: "Tiling",
|
|
5661
5661
|
about: "Tiling — bricks, a checker, columns or a maze, each cell solid or textured",
|
|
@@ -5742,7 +5742,7 @@ var Wi = {
|
|
|
5742
5742
|
label: "Fill A",
|
|
5743
5743
|
type: "select",
|
|
5744
5744
|
default: "solid",
|
|
5745
|
-
options:
|
|
5745
|
+
options: Vi,
|
|
5746
5746
|
section: "Fill"
|
|
5747
5747
|
},
|
|
5748
5748
|
{
|
|
@@ -5750,7 +5750,7 @@ var Wi = {
|
|
|
5750
5750
|
label: "Fill B",
|
|
5751
5751
|
type: "select",
|
|
5752
5752
|
default: "dots",
|
|
5753
|
-
options:
|
|
5753
|
+
options: Vi,
|
|
5754
5754
|
section: "Fill"
|
|
5755
5755
|
},
|
|
5756
5756
|
{
|
|
@@ -5813,8 +5813,8 @@ var Wi = {
|
|
|
5813
5813
|
}
|
|
5814
5814
|
],
|
|
5815
5815
|
draw(e, t, n) {
|
|
5816
|
-
let r = Math.max(1, Math.round(t.cols ?? 4)), i = Math.max(1, Math.round(t.rows ?? 6)), a = t.seed ?? 1, o = t.tex ?? 8, s = t.texSize ?? .45, c = (e, n, r) => (t.alt === "row" ? n % 2 : t.alt === "col" ? e % 2 : t.alt === "random" ?
|
|
5817
|
-
u > 0 && (
|
|
5816
|
+
let r = Math.max(1, Math.round(t.cols ?? 4)), i = Math.max(1, Math.round(t.rows ?? 6)), a = t.seed ?? 1, o = t.tex ?? 8, s = t.texSize ?? .45, c = (e, n, r) => (t.alt === "row" ? n % 2 : t.alt === "col" ? e % 2 : t.alt === "random" ? Bi(r, a) < .5 : (e + n) % 2) ? t.fillB ?? "dots" : t.fillA ?? "solid", l = n, u = (t.frame ?? 0) * Math.min(n.w, n.h);
|
|
5817
|
+
u > 0 && (we(e, [[
|
|
5818
5818
|
[n.x, n.y],
|
|
5819
5819
|
[n.x + n.w, n.y],
|
|
5820
5820
|
[n.x + n.w, n.y + n.h],
|
|
@@ -5834,7 +5834,7 @@ var Wi = {
|
|
|
5834
5834
|
if (m === "maze") {
|
|
5835
5835
|
let t = Math.max(1, o * s * .4), n = l.x, r = l.y, c = l.x + l.w, u = l.y + l.h;
|
|
5836
5836
|
for (let o = 0; o < i && c - n > 4 * t && u - r > 4 * t; o++) {
|
|
5837
|
-
|
|
5837
|
+
we(e, [[
|
|
5838
5838
|
[n, r],
|
|
5839
5839
|
[c, r],
|
|
5840
5840
|
[c, u],
|
|
@@ -5845,7 +5845,7 @@ var Wi = {
|
|
|
5845
5845
|
[c - t, u - t],
|
|
5846
5846
|
[n + t, u - t]
|
|
5847
5847
|
]]);
|
|
5848
|
-
let s = Math.min(c - n, u - r) / (i - o + 1), l =
|
|
5848
|
+
let s = Math.min(c - n, u - r) / (i - o + 1), l = Bi(o, a);
|
|
5849
5849
|
n += s * (l < .5 ? 1 : .4), r += s * (l < .25 || l > .75 ? 1 : .5), c -= s * (l >= .5 ? 1 : .4), u -= s * (l >= .25 && l <= .75 ? 1 : .5);
|
|
5850
5850
|
}
|
|
5851
5851
|
return;
|
|
@@ -5855,8 +5855,8 @@ var Wi = {
|
|
|
5855
5855
|
if (m === "bricks") {
|
|
5856
5856
|
let r = l.x - (n % 2 ? d / 2 : 0), i = 0;
|
|
5857
5857
|
for (; r < l.x + l.w;) {
|
|
5858
|
-
let u = d * (1 + (t.vary ?? .4) * (
|
|
5859
|
-
|
|
5858
|
+
let u = d * (1 + (t.vary ?? .4) * (Bi(h * 7 + n, a) * 2 - 1)), m = Math.max(l.x, r), g = Math.min(l.x + l.w, r + u);
|
|
5859
|
+
Hi(e, c(i, n, h), m + p / 2, l.y + n * f + p / 2, g - m - p, f - p, o, s), r += u, i++, h++;
|
|
5860
5860
|
}
|
|
5861
5861
|
continue;
|
|
5862
5862
|
}
|
|
@@ -5864,49 +5864,49 @@ var Wi = {
|
|
|
5864
5864
|
let r = m === "columns" && i % 2 ? (t.shift ?? 0) * f : 0, a = l.x + i * d, u = l.y + n * f + r;
|
|
5865
5865
|
if (r && u + f > l.y + l.h + .01) {
|
|
5866
5866
|
let r = c(0, n + i % 2, h), p = d * (t.gap ?? .04) / 2, m = u + f - (l.y + l.h);
|
|
5867
|
-
|
|
5867
|
+
Hi(e, r, a + p, u, d - 2 * p, f - m, o, s), Hi(e, r, a + p, l.y, d - 2 * p, m, o, s);
|
|
5868
5868
|
continue;
|
|
5869
5869
|
}
|
|
5870
5870
|
let g = m === "columns" ? c(0, n + i % 2, h) : c(i, n, h), _ = m === "columns" ? d * (t.gap ?? .04) / 2 : p / 2;
|
|
5871
|
-
|
|
5871
|
+
Hi(e, g, a + _, u + (m === "columns" ? 0 : p / 2), d - 2 * _, f - (m === "columns" ? 0 : p), o, s);
|
|
5872
5872
|
}
|
|
5873
5873
|
}
|
|
5874
5874
|
}
|
|
5875
|
-
},
|
|
5876
|
-
function
|
|
5877
|
-
|
|
5878
|
-
for (let t of [...
|
|
5875
|
+
}, Wi = /* @__PURE__ */ new Map(), Gi = /* @__PURE__ */ new Map();
|
|
5876
|
+
function Ki(e, t) {
|
|
5877
|
+
Wi.set(e, t);
|
|
5878
|
+
for (let t of [...Gi.keys()]) t.startsWith(`${e}|`) && Gi.delete(t);
|
|
5879
5879
|
}
|
|
5880
|
-
var
|
|
5881
|
-
function
|
|
5880
|
+
var qi = (e) => Wi.has(e);
|
|
5881
|
+
function Ji(e, t) {
|
|
5882
5882
|
let n = `${e}|${t}`;
|
|
5883
|
-
if (
|
|
5884
|
-
let r =
|
|
5883
|
+
if (Gi.has(n)) return Gi.get(n);
|
|
5884
|
+
let r = Wi.get(e), i;
|
|
5885
5885
|
if (!r || e === "pixel") i = {
|
|
5886
|
-
rings:
|
|
5886
|
+
rings: Me(t),
|
|
5887
5887
|
advance: 5 / 7
|
|
5888
5888
|
};
|
|
5889
5889
|
else {
|
|
5890
5890
|
let e = r.unitsPerEm, n = r.ascender, a = -r.descender, o = r.charToGlyph(t), s = o.getPath(0, n, e).toPathData(2), c = n + a;
|
|
5891
5891
|
i = {
|
|
5892
|
-
rings:
|
|
5892
|
+
rings: Ne(s, 4).map((e) => e.map(([e, t]) => [e / c, t / c])),
|
|
5893
5893
|
advance: (o.advanceWidth || e * .6) / c
|
|
5894
5894
|
};
|
|
5895
5895
|
}
|
|
5896
|
-
return
|
|
5896
|
+
return Gi.set(n, i), i;
|
|
5897
5897
|
}
|
|
5898
5898
|
//#endregion
|
|
5899
5899
|
//#region src/generate/styles/ascii.js
|
|
5900
|
-
var
|
|
5900
|
+
var Yi = (e, t) => {
|
|
5901
5901
|
let n = Math.imul(e + 1, 2654435761) ^ Math.imul(t + 5, 40503);
|
|
5902
5902
|
return n = Math.imul(n ^ n >>> 15, 2246822519), n ^= n >>> 13, (n >>> 0) / 4294967296;
|
|
5903
|
-
},
|
|
5903
|
+
}, Xi = {
|
|
5904
5904
|
classic: " .:-=+*#%@",
|
|
5905
5905
|
blocks: " .:░▒▓█",
|
|
5906
5906
|
dots: " .·•●",
|
|
5907
5907
|
data: " .-|=#",
|
|
5908
5908
|
glyphs: " ·+x*#"
|
|
5909
|
-
},
|
|
5909
|
+
}, Zi = (e, t) => e[Math.min(e.length - 1, Math.max(0, Math.floor(t * e.length)))], Qi = [
|
|
5910
5910
|
{
|
|
5911
5911
|
value: "pixel",
|
|
5912
5912
|
label: "Pixel"
|
|
@@ -5919,12 +5919,12 @@ var Xi = (e, t) => {
|
|
|
5919
5919
|
value: "malromur",
|
|
5920
5920
|
label: "Malromur"
|
|
5921
5921
|
}
|
|
5922
|
-
],
|
|
5923
|
-
function
|
|
5924
|
-
let t =
|
|
5925
|
-
return
|
|
5922
|
+
], $i = /^rg-[^-]+-(\d+)$/, ea = (e) => $i.test(e.font ?? "") ? "inter" : e.font ?? "pixel", ta = (e) => e.fontWeight ?? Number($i.exec(e.font ?? "")?.[1] ?? 900);
|
|
5923
|
+
function na(e) {
|
|
5924
|
+
let t = ea(e);
|
|
5925
|
+
return Qi.some((e) => e.value === t) && t !== "pixel" ? `${t}-${ta(e)}` : "pixel";
|
|
5926
5926
|
}
|
|
5927
|
-
var
|
|
5927
|
+
var ra = {
|
|
5928
5928
|
id: "ascii",
|
|
5929
5929
|
label: "ASCII",
|
|
5930
5930
|
about: "ASCII — a character grid; each cell’s glyph is picked from a ramp by the field’s brightness",
|
|
@@ -5945,7 +5945,7 @@ var ia = {
|
|
|
5945
5945
|
label: "Font",
|
|
5946
5946
|
type: "select",
|
|
5947
5947
|
default: "pixel",
|
|
5948
|
-
options:
|
|
5948
|
+
options: Qi,
|
|
5949
5949
|
section: "Characters"
|
|
5950
5950
|
},
|
|
5951
5951
|
{
|
|
@@ -5957,13 +5957,13 @@ var ia = {
|
|
|
5957
5957
|
step: 1,
|
|
5958
5958
|
default: 900,
|
|
5959
5959
|
section: "Characters",
|
|
5960
|
-
when: (e) =>
|
|
5960
|
+
when: (e) => ea(e) !== "pixel"
|
|
5961
5961
|
},
|
|
5962
5962
|
{
|
|
5963
5963
|
key: "ramp",
|
|
5964
5964
|
label: "Ramp",
|
|
5965
5965
|
type: "text",
|
|
5966
|
-
default:
|
|
5966
|
+
default: Xi.classic,
|
|
5967
5967
|
placeholder: "dark → bright",
|
|
5968
5968
|
section: "Characters"
|
|
5969
5969
|
},
|
|
@@ -5976,7 +5976,7 @@ var ia = {
|
|
|
5976
5976
|
options: [{
|
|
5977
5977
|
value: "",
|
|
5978
5978
|
label: "Custom"
|
|
5979
|
-
}, ...Object.entries(
|
|
5979
|
+
}, ...Object.entries(Xi).map(([e, t]) => ({
|
|
5980
5980
|
value: e,
|
|
5981
5981
|
label: `${e} ${t.trim()}`
|
|
5982
5982
|
}))]
|
|
@@ -6097,9 +6097,9 @@ var ia = {
|
|
|
6097
6097
|
}
|
|
6098
6098
|
],
|
|
6099
6099
|
draw(e, t, n, { field: r, mask: i, warp: a }) {
|
|
6100
|
-
let o = Math.max(1, Math.round(t.cols ?? 60)), s = n.w / o, c = s * (t.cell ?? 1.4), l = Math.max(1, Math.floor(n.h / c)), u = (n.h - l * c) / 2, d = [...
|
|
6100
|
+
let o = Math.max(1, Math.round(t.cols ?? 60)), s = n.w / o, c = s * (t.cell ?? 1.4), l = Math.max(1, Math.floor(n.h / c)), u = (n.h - l * c) / 2, d = [...Xi[t.rampPreset] ?? t.ramp ?? Xi.classic];
|
|
6101
6101
|
t.reverse && (d = d.reverse());
|
|
6102
|
-
let f =
|
|
6102
|
+
let f = na(t), p = [...t.text ?? ""], m = [...t.letters ?? ""], h = Math.round(t.word ?? 0), g = t.textBelow ?? 0, _ = t.seed ?? 1, v = t.scale ?? 1;
|
|
6103
6103
|
for (let y = 0; y < l; y++) for (let l = 0; l < o; l++) {
|
|
6104
6104
|
let b = y * o + l, x = (l + .5) / o, S = (u + (y + .5) * c) / n.h, C = x, w = S;
|
|
6105
6105
|
if (a) {
|
|
@@ -6110,24 +6110,24 @@ var ia = {
|
|
|
6110
6110
|
let T = r(C, w), E;
|
|
6111
6111
|
if ((p.length || m.length) && T < g) {
|
|
6112
6112
|
if (h > 0 && l % (h + 1) === h) continue;
|
|
6113
|
-
E = p.length ? p[b % p.length] : m[Math.floor(
|
|
6113
|
+
E = p.length ? p[b % p.length] : m[Math.floor(Yi(b, _) * m.length)];
|
|
6114
6114
|
} else {
|
|
6115
6115
|
let e = g > 0 && (p.length || m.length) ? (T - g) / (1 - g) : T;
|
|
6116
|
-
E = t.sizeBy ? d[d.length - 1] :
|
|
6116
|
+
E = t.sizeBy ? d[d.length - 1] : Zi(d, e);
|
|
6117
6117
|
}
|
|
6118
6118
|
if (!E || E === " ") continue;
|
|
6119
|
-
let D =
|
|
6119
|
+
let D = Ji(f, E);
|
|
6120
6120
|
if (!D.rings.length) continue;
|
|
6121
6121
|
let O = (t.sizeBy ? (t.sizeMin ?? .2) + (1 - (t.sizeMin ?? .2)) * T : 1) * v, k = c * O, ee = t.fitCell ? s * O : D.advance * k, te = t.fitCell ? ee / Math.max(1e-6, D.advance) : k, ne = n.x + x * n.w - ee / 2, re = n.y + S * n.h - k / 2;
|
|
6122
|
-
|
|
6122
|
+
we(e, D.rings.map((e) => e.map(([e, t]) => [ne + e * te, re + t * k])));
|
|
6123
6123
|
}
|
|
6124
6124
|
}
|
|
6125
|
-
},
|
|
6125
|
+
}, ia = (e) => {
|
|
6126
6126
|
let t = e * 2654435761 >>> 0 || 1;
|
|
6127
6127
|
return () => (t ^= t << 13, t ^= t >>> 17, t ^= t << 5, (t >>> 0) % 1e9 / 1e9);
|
|
6128
6128
|
};
|
|
6129
|
-
function
|
|
6130
|
-
let a =
|
|
6129
|
+
function aa(e, t, n, r, i = 20) {
|
|
6130
|
+
let a = ia(r), o = n / Math.SQRT2, s = Math.ceil(e / o), c = Math.ceil(t / o), l = new Int32Array(s * c).fill(-1), u = [], d = [], f = (e, t) => {
|
|
6131
6131
|
u.push([e, t]), d.push(u.length - 1), l[Math.floor(t / o) * s + Math.floor(e / o)] = u.length - 1;
|
|
6132
6132
|
};
|
|
6133
6133
|
for (f(a() * e, a() * t); d.length;) {
|
|
@@ -6152,7 +6152,7 @@ function oa(e, t, n, r, i = 20) {
|
|
|
6152
6152
|
}
|
|
6153
6153
|
return u;
|
|
6154
6154
|
}
|
|
6155
|
-
var
|
|
6155
|
+
var oa = {
|
|
6156
6156
|
id: "stipple",
|
|
6157
6157
|
label: "Stipple",
|
|
6158
6158
|
about: "Stipple — blue-noise dots, their density (and size) following a field",
|
|
@@ -6210,8 +6210,8 @@ var sa = {
|
|
|
6210
6210
|
}
|
|
6211
6211
|
],
|
|
6212
6212
|
draw(e, t, n, { field: r, mask: i, warp: a }) {
|
|
6213
|
-
let o = Math.max(2, t.spacing ?? 8), s = t.seed ?? 1, c =
|
|
6214
|
-
for (let [l, u] of
|
|
6213
|
+
let o = Math.max(2, t.spacing ?? 8), s = t.seed ?? 1, c = ia(s + 101);
|
|
6214
|
+
for (let [l, u] of aa(n.w, n.h, o, s)) {
|
|
6215
6215
|
let s = l / n.w, d = u / n.h, f = s, p = d;
|
|
6216
6216
|
if (a) {
|
|
6217
6217
|
let [e, n] = a(s, d);
|
|
@@ -6221,10 +6221,10 @@ var sa = {
|
|
|
6221
6221
|
let m = r(f, p);
|
|
6222
6222
|
if (c() >= m ** (t.gamma ?? 1)) continue;
|
|
6223
6223
|
let h = o * (t.dot ?? .35) * (t.sizeBy ? .3 + .7 * m : 1);
|
|
6224
|
-
|
|
6224
|
+
b(e, n.x + s * n.w, n.y + d * n.h, h);
|
|
6225
6225
|
}
|
|
6226
6226
|
}
|
|
6227
|
-
},
|
|
6227
|
+
}, sa = {
|
|
6228
6228
|
id: "mosaic",
|
|
6229
6229
|
label: "Mosaic",
|
|
6230
6230
|
about: "Mosaic — hex or square tiles, each scaled by a field",
|
|
@@ -6282,19 +6282,19 @@ var sa = {
|
|
|
6282
6282
|
draw(e, t, n, { field: r, mask: i, warp: a }) {
|
|
6283
6283
|
let o = Math.max(1, Math.round(t.cols ?? 40)), s = (t.tile ?? "hex") === "hex", c = n.w / o, l = s ? c / Math.sqrt(3) : c / 2, u = s ? l * 1.5 : c, d = Math.ceil(n.h / u) + 1;
|
|
6284
6284
|
for (let f = 0; f < d; f++) for (let d = 0; d <= o; d++) {
|
|
6285
|
-
let o = (d + (s && f % 2 ? .5 : 0)) * c, p = f * u,
|
|
6285
|
+
let o = (d + (s && f % 2 ? .5 : 0)) * c, p = f * u, h = o / n.w, g = p / n.h, _ = h, v = g;
|
|
6286
6286
|
if (a) {
|
|
6287
|
-
let [e, n] = a(
|
|
6288
|
-
t.wTarget === "field" ? (_ = e, v = n) : (
|
|
6287
|
+
let [e, n] = a(h, g);
|
|
6288
|
+
t.wTarget === "field" ? (_ = e, v = n) : (h = _ = e, g = v = n);
|
|
6289
6289
|
}
|
|
6290
|
-
if (
|
|
6290
|
+
if (h > 1.0001 || g > 1.0001 || !i(h, g)) continue;
|
|
6291
6291
|
let y = r(_, v);
|
|
6292
6292
|
if (y < (t.min ?? .05)) continue;
|
|
6293
|
-
let b = y * (1 - (t.gap ?? .08)), x = n.x +
|
|
6294
|
-
s ?
|
|
6293
|
+
let b = y * (1 - (t.gap ?? .08)), x = n.x + h * n.w, S = n.y + g * n.h;
|
|
6294
|
+
s ? m(e, Array.from({ length: 6 }, (e, t) => {
|
|
6295
6295
|
let n = Math.PI / 3 * t + Math.PI / 6;
|
|
6296
6296
|
return [x + Math.cos(n) * l * b, S + Math.sin(n) * l * b];
|
|
6297
|
-
})) :
|
|
6297
|
+
})) : m(e, [
|
|
6298
6298
|
[x - c / 2 * b, S - c / 2 * b],
|
|
6299
6299
|
[x + c / 2 * b, S - c / 2 * b],
|
|
6300
6300
|
[x + c / 2 * b, S + c / 2 * b],
|
|
@@ -6302,18 +6302,18 @@ var sa = {
|
|
|
6302
6302
|
]);
|
|
6303
6303
|
}
|
|
6304
6304
|
}
|
|
6305
|
-
},
|
|
6305
|
+
}, V = {
|
|
6306
6306
|
inset: 128,
|
|
6307
6307
|
color: "#FFFFFF"
|
|
6308
|
-
},
|
|
6308
|
+
}, H = [1056, 1056], ca = [1456, 1056], U = [1056, 1456], la = [
|
|
6309
6309
|
{
|
|
6310
6310
|
id: "eclipse",
|
|
6311
6311
|
style: "lineScreen",
|
|
6312
6312
|
label: "Eclipse",
|
|
6313
6313
|
ref: "lines/eclipse",
|
|
6314
|
-
size:
|
|
6314
|
+
size: H,
|
|
6315
6315
|
params: {
|
|
6316
|
-
...
|
|
6316
|
+
...V,
|
|
6317
6317
|
orient: "h",
|
|
6318
6318
|
count: 43,
|
|
6319
6319
|
fill: .932,
|
|
@@ -6336,9 +6336,9 @@ var sa = {
|
|
|
6336
6336
|
style: "lineScreen",
|
|
6337
6337
|
label: "Confluence",
|
|
6338
6338
|
ref: "lines/confluence",
|
|
6339
|
-
size:
|
|
6339
|
+
size: ca,
|
|
6340
6340
|
params: {
|
|
6341
|
-
...
|
|
6341
|
+
...V,
|
|
6342
6342
|
justify: !0,
|
|
6343
6343
|
orient: "v",
|
|
6344
6344
|
count: 55,
|
|
@@ -6368,7 +6368,7 @@ var sa = {
|
|
|
6368
6368
|
ref: "lines/counterform",
|
|
6369
6369
|
size: U,
|
|
6370
6370
|
params: {
|
|
6371
|
-
...
|
|
6371
|
+
...V,
|
|
6372
6372
|
orient: "v",
|
|
6373
6373
|
count: 33,
|
|
6374
6374
|
fill: .9,
|
|
@@ -6394,9 +6394,9 @@ var sa = {
|
|
|
6394
6394
|
style: "lineScreen",
|
|
6395
6395
|
label: "Cusp",
|
|
6396
6396
|
ref: "lines/cusp",
|
|
6397
|
-
size:
|
|
6397
|
+
size: ca,
|
|
6398
6398
|
params: {
|
|
6399
|
-
...
|
|
6399
|
+
...V,
|
|
6400
6400
|
orient: "v",
|
|
6401
6401
|
count: 49,
|
|
6402
6402
|
fill: .95,
|
|
@@ -6419,7 +6419,7 @@ var sa = {
|
|
|
6419
6419
|
ref: "lines/fulcrum",
|
|
6420
6420
|
size: U,
|
|
6421
6421
|
params: {
|
|
6422
|
-
...
|
|
6422
|
+
...V,
|
|
6423
6423
|
orient: "h",
|
|
6424
6424
|
count: 31,
|
|
6425
6425
|
fill: .9,
|
|
@@ -6444,7 +6444,7 @@ var sa = {
|
|
|
6444
6444
|
ref: "lines/inflection",
|
|
6445
6445
|
size: U,
|
|
6446
6446
|
params: {
|
|
6447
|
-
...
|
|
6447
|
+
...V,
|
|
6448
6448
|
justify: !0,
|
|
6449
6449
|
orient: "v",
|
|
6450
6450
|
count: 43,
|
|
@@ -6466,9 +6466,9 @@ var sa = {
|
|
|
6466
6466
|
style: "lineScreen",
|
|
6467
6467
|
label: "Relay",
|
|
6468
6468
|
ref: "lines/relay",
|
|
6469
|
-
size:
|
|
6469
|
+
size: ca,
|
|
6470
6470
|
params: {
|
|
6471
|
-
...
|
|
6471
|
+
...V,
|
|
6472
6472
|
justify: !0,
|
|
6473
6473
|
orient: "h",
|
|
6474
6474
|
count: 25,
|
|
@@ -6498,9 +6498,9 @@ var sa = {
|
|
|
6498
6498
|
style: "lineScreen",
|
|
6499
6499
|
label: "Spooky",
|
|
6500
6500
|
ref: "lines/spooky",
|
|
6501
|
-
size:
|
|
6501
|
+
size: H,
|
|
6502
6502
|
params: {
|
|
6503
|
-
...
|
|
6503
|
+
...V,
|
|
6504
6504
|
orient: "v",
|
|
6505
6505
|
count: 30,
|
|
6506
6506
|
fill: .95,
|
|
@@ -6524,7 +6524,7 @@ var sa = {
|
|
|
6524
6524
|
ref: "lines/summer",
|
|
6525
6525
|
size: U,
|
|
6526
6526
|
params: {
|
|
6527
|
-
...
|
|
6527
|
+
...V,
|
|
6528
6528
|
orient: "v",
|
|
6529
6529
|
count: 25,
|
|
6530
6530
|
fill: .95,
|
|
@@ -6545,9 +6545,9 @@ var sa = {
|
|
|
6545
6545
|
style: "lineScreen",
|
|
6546
6546
|
label: "Steps",
|
|
6547
6547
|
ref: "dot/steps",
|
|
6548
|
-
size:
|
|
6548
|
+
size: H,
|
|
6549
6549
|
params: {
|
|
6550
|
-
...
|
|
6550
|
+
...V,
|
|
6551
6551
|
orient: "h",
|
|
6552
6552
|
count: 8,
|
|
6553
6553
|
shift: -.159,
|
|
@@ -6570,7 +6570,7 @@ var sa = {
|
|
|
6570
6570
|
ref: "dots/compression",
|
|
6571
6571
|
size: U,
|
|
6572
6572
|
params: {
|
|
6573
|
-
...
|
|
6573
|
+
...V,
|
|
6574
6574
|
cols: 43,
|
|
6575
6575
|
rows: 81,
|
|
6576
6576
|
size: .56,
|
|
@@ -6595,7 +6595,7 @@ var sa = {
|
|
|
6595
6595
|
ref: "dots/counterweight",
|
|
6596
6596
|
size: U,
|
|
6597
6597
|
params: {
|
|
6598
|
-
...
|
|
6598
|
+
...V,
|
|
6599
6599
|
cols: 51,
|
|
6600
6600
|
size: 1.04,
|
|
6601
6601
|
min: .35,
|
|
@@ -6618,7 +6618,7 @@ var sa = {
|
|
|
6618
6618
|
ref: "dots/interference",
|
|
6619
6619
|
size: U,
|
|
6620
6620
|
params: {
|
|
6621
|
-
...
|
|
6621
|
+
...V,
|
|
6622
6622
|
cols: 60,
|
|
6623
6623
|
rows: 78,
|
|
6624
6624
|
size: .7,
|
|
@@ -6648,7 +6648,7 @@ var sa = {
|
|
|
6648
6648
|
ref: "dots/slipstream",
|
|
6649
6649
|
size: U,
|
|
6650
6650
|
params: {
|
|
6651
|
-
...
|
|
6651
|
+
...V,
|
|
6652
6652
|
justify: !0,
|
|
6653
6653
|
cols: 48,
|
|
6654
6654
|
rows: 68,
|
|
@@ -6669,9 +6669,9 @@ var sa = {
|
|
|
6669
6669
|
style: "dotScreen",
|
|
6670
6670
|
label: "Terraces",
|
|
6671
6671
|
ref: "dots/terraces",
|
|
6672
|
-
size:
|
|
6672
|
+
size: H,
|
|
6673
6673
|
params: {
|
|
6674
|
-
...
|
|
6674
|
+
...V,
|
|
6675
6675
|
cols: 44,
|
|
6676
6676
|
rows: 48,
|
|
6677
6677
|
size: .9,
|
|
@@ -6689,7 +6689,7 @@ var sa = {
|
|
|
6689
6689
|
ref: "dots/umbra",
|
|
6690
6690
|
size: U,
|
|
6691
6691
|
params: {
|
|
6692
|
-
...
|
|
6692
|
+
...V,
|
|
6693
6693
|
cols: 45,
|
|
6694
6694
|
size: 1.4,
|
|
6695
6695
|
min: .48,
|
|
@@ -6708,9 +6708,9 @@ var sa = {
|
|
|
6708
6708
|
style: "dotScreen",
|
|
6709
6709
|
label: "Warp",
|
|
6710
6710
|
ref: "dots/warp",
|
|
6711
|
-
size:
|
|
6711
|
+
size: H,
|
|
6712
6712
|
params: {
|
|
6713
|
-
...
|
|
6713
|
+
...V,
|
|
6714
6714
|
cols: 61,
|
|
6715
6715
|
size: 1.66,
|
|
6716
6716
|
min: .38,
|
|
@@ -6737,7 +6737,7 @@ var sa = {
|
|
|
6737
6737
|
ref: "fields/helix",
|
|
6738
6738
|
size: U,
|
|
6739
6739
|
params: {
|
|
6740
|
-
...
|
|
6740
|
+
...V,
|
|
6741
6741
|
cols: 100,
|
|
6742
6742
|
font: "pixel",
|
|
6743
6743
|
ramp: " ·•█",
|
|
@@ -6767,7 +6767,7 @@ var sa = {
|
|
|
6767
6767
|
ref: "fields/spires",
|
|
6768
6768
|
size: U,
|
|
6769
6769
|
params: {
|
|
6770
|
-
...
|
|
6770
|
+
...V,
|
|
6771
6771
|
cols: 26,
|
|
6772
6772
|
font: "pixel",
|
|
6773
6773
|
ramp: " ·▒█",
|
|
@@ -6799,9 +6799,9 @@ var sa = {
|
|
|
6799
6799
|
style: "ascii",
|
|
6800
6800
|
label: "Streaks",
|
|
6801
6801
|
ref: "fields/streaks",
|
|
6802
|
-
size:
|
|
6802
|
+
size: H,
|
|
6803
6803
|
params: {
|
|
6804
|
-
...
|
|
6804
|
+
...V,
|
|
6805
6805
|
cols: 125,
|
|
6806
6806
|
font: "pixel",
|
|
6807
6807
|
ramp: " -=█",
|
|
@@ -6820,9 +6820,9 @@ var sa = {
|
|
|
6820
6820
|
style: "ascii",
|
|
6821
6821
|
label: "Clouds",
|
|
6822
6822
|
ref: "fields/clouds",
|
|
6823
|
-
size:
|
|
6823
|
+
size: H,
|
|
6824
6824
|
params: {
|
|
6825
|
-
...
|
|
6825
|
+
...V,
|
|
6826
6826
|
scale: 1.15,
|
|
6827
6827
|
cols: 100,
|
|
6828
6828
|
font: "pixel",
|
|
@@ -6842,9 +6842,9 @@ var sa = {
|
|
|
6842
6842
|
style: "ascii",
|
|
6843
6843
|
label: "Swirl",
|
|
6844
6844
|
ref: "fields/swirl",
|
|
6845
|
-
size:
|
|
6845
|
+
size: H,
|
|
6846
6846
|
params: {
|
|
6847
|
-
...
|
|
6847
|
+
...V,
|
|
6848
6848
|
cols: 90,
|
|
6849
6849
|
font: "pixel",
|
|
6850
6850
|
ramp: " ·=█",
|
|
@@ -6873,9 +6873,9 @@ var sa = {
|
|
|
6873
6873
|
style: "ascii",
|
|
6874
6874
|
label: "Lattice",
|
|
6875
6875
|
ref: "fields/lattice",
|
|
6876
|
-
size:
|
|
6876
|
+
size: H,
|
|
6877
6877
|
params: {
|
|
6878
|
-
...
|
|
6878
|
+
...V,
|
|
6879
6879
|
cols: 100,
|
|
6880
6880
|
font: "pixel",
|
|
6881
6881
|
ramp: " ·•█",
|
|
@@ -6901,7 +6901,7 @@ var sa = {
|
|
|
6901
6901
|
ref: "fields/beacons",
|
|
6902
6902
|
size: U,
|
|
6903
6903
|
params: {
|
|
6904
|
-
...
|
|
6904
|
+
...V,
|
|
6905
6905
|
cols: 60,
|
|
6906
6906
|
font: "pixel",
|
|
6907
6907
|
ramp: " ░▒█",
|
|
@@ -6921,7 +6921,7 @@ var sa = {
|
|
|
6921
6921
|
ref: "patterns/text",
|
|
6922
6922
|
size: U,
|
|
6923
6923
|
params: {
|
|
6924
|
-
...
|
|
6924
|
+
...V,
|
|
6925
6925
|
font: "pixel",
|
|
6926
6926
|
cols: 52,
|
|
6927
6927
|
cell: 1.9,
|
|
@@ -6941,7 +6941,7 @@ var sa = {
|
|
|
6941
6941
|
ref: "patterns/type",
|
|
6942
6942
|
size: U,
|
|
6943
6943
|
params: {
|
|
6944
|
-
...
|
|
6944
|
+
...V,
|
|
6945
6945
|
font: "inter",
|
|
6946
6946
|
fontWeight: 900,
|
|
6947
6947
|
ramp: "a",
|
|
@@ -6962,9 +6962,9 @@ var sa = {
|
|
|
6962
6962
|
style: "stripeArray",
|
|
6963
6963
|
label: "Air",
|
|
6964
6964
|
ref: "bands/air",
|
|
6965
|
-
size:
|
|
6965
|
+
size: ca,
|
|
6966
6966
|
params: {
|
|
6967
|
-
...
|
|
6967
|
+
...V,
|
|
6968
6968
|
orient: "h",
|
|
6969
6969
|
count: 11,
|
|
6970
6970
|
spread: "packed",
|
|
@@ -6984,7 +6984,7 @@ var sa = {
|
|
|
6984
6984
|
ref: "bands/bars",
|
|
6985
6985
|
size: U,
|
|
6986
6986
|
params: {
|
|
6987
|
-
...
|
|
6987
|
+
...V,
|
|
6988
6988
|
orient: "v",
|
|
6989
6989
|
count: 21,
|
|
6990
6990
|
wA: .49,
|
|
@@ -6998,9 +6998,9 @@ var sa = {
|
|
|
6998
6998
|
style: "radialArray",
|
|
6999
6999
|
label: "Beam",
|
|
7000
7000
|
ref: "bands/beam",
|
|
7001
|
-
size:
|
|
7001
|
+
size: ca,
|
|
7002
7002
|
params: {
|
|
7003
|
-
...
|
|
7003
|
+
...V,
|
|
7004
7004
|
mode: "rings",
|
|
7005
7005
|
count: 11,
|
|
7006
7006
|
cx: 1.85,
|
|
@@ -7018,9 +7018,9 @@ var sa = {
|
|
|
7018
7018
|
style: "stripeArray",
|
|
7019
7019
|
label: "Drift",
|
|
7020
7020
|
ref: "bands/drift",
|
|
7021
|
-
size:
|
|
7021
|
+
size: ca,
|
|
7022
7022
|
params: {
|
|
7023
|
-
...
|
|
7023
|
+
...V,
|
|
7024
7024
|
orient: "h",
|
|
7025
7025
|
count: 17,
|
|
7026
7026
|
wA: .646,
|
|
@@ -7038,9 +7038,9 @@ var sa = {
|
|
|
7038
7038
|
style: "stripeArray",
|
|
7039
7039
|
label: "Noise",
|
|
7040
7040
|
ref: "bands/noise",
|
|
7041
|
-
size:
|
|
7041
|
+
size: ca,
|
|
7042
7042
|
params: {
|
|
7043
|
-
...
|
|
7043
|
+
...V,
|
|
7044
7044
|
orient: "h",
|
|
7045
7045
|
count: 15,
|
|
7046
7046
|
wA: .092,
|
|
@@ -7058,9 +7058,9 @@ var sa = {
|
|
|
7058
7058
|
style: "stripeArray",
|
|
7059
7059
|
label: "Rake",
|
|
7060
7060
|
ref: "bands/rake",
|
|
7061
|
-
size:
|
|
7061
|
+
size: H,
|
|
7062
7062
|
params: {
|
|
7063
|
-
...
|
|
7063
|
+
...V,
|
|
7064
7064
|
orient: "v",
|
|
7065
7065
|
count: 14,
|
|
7066
7066
|
wA: .543,
|
|
@@ -7080,9 +7080,9 @@ var sa = {
|
|
|
7080
7080
|
style: "stripeArray",
|
|
7081
7081
|
label: "Substances",
|
|
7082
7082
|
ref: "bands/substances",
|
|
7083
|
-
size:
|
|
7083
|
+
size: ca,
|
|
7084
7084
|
params: {
|
|
7085
|
-
...
|
|
7085
|
+
...V,
|
|
7086
7086
|
orient: "v",
|
|
7087
7087
|
count: 20,
|
|
7088
7088
|
angle: 33.94,
|
|
@@ -7102,9 +7102,9 @@ var sa = {
|
|
|
7102
7102
|
style: "stripeArray",
|
|
7103
7103
|
label: "Transfer",
|
|
7104
7104
|
ref: "bands/transfer",
|
|
7105
|
-
size:
|
|
7105
|
+
size: ca,
|
|
7106
7106
|
params: {
|
|
7107
|
-
...
|
|
7107
|
+
...V,
|
|
7108
7108
|
orient: "v",
|
|
7109
7109
|
count: 21,
|
|
7110
7110
|
wA: .061,
|
|
@@ -7117,9 +7117,9 @@ var sa = {
|
|
|
7117
7117
|
style: "stripeArray",
|
|
7118
7118
|
label: "Undulation",
|
|
7119
7119
|
ref: "bands/undulation",
|
|
7120
|
-
size:
|
|
7120
|
+
size: ca,
|
|
7121
7121
|
params: {
|
|
7122
|
-
...
|
|
7122
|
+
...V,
|
|
7123
7123
|
orient: "h",
|
|
7124
7124
|
count: 19,
|
|
7125
7125
|
wA: .06,
|
|
@@ -7139,7 +7139,7 @@ var sa = {
|
|
|
7139
7139
|
ref: "circles/counterturn",
|
|
7140
7140
|
size: U,
|
|
7141
7141
|
params: {
|
|
7142
|
-
...
|
|
7142
|
+
...V,
|
|
7143
7143
|
mode: "rings",
|
|
7144
7144
|
count: 1,
|
|
7145
7145
|
cx: .625,
|
|
@@ -7164,9 +7164,9 @@ var sa = {
|
|
|
7164
7164
|
style: "radialArray",
|
|
7165
7165
|
label: "Emblem",
|
|
7166
7166
|
ref: "circles/emblem",
|
|
7167
|
-
size:
|
|
7167
|
+
size: H,
|
|
7168
7168
|
params: {
|
|
7169
|
-
...
|
|
7169
|
+
...V,
|
|
7170
7170
|
mode: "rings",
|
|
7171
7171
|
count: 1,
|
|
7172
7172
|
r1A: .84,
|
|
@@ -7187,9 +7187,9 @@ var sa = {
|
|
|
7187
7187
|
style: "radialArray",
|
|
7188
7188
|
label: "Fan",
|
|
7189
7189
|
ref: "circles/fan",
|
|
7190
|
-
size:
|
|
7190
|
+
size: H,
|
|
7191
7191
|
params: {
|
|
7192
|
-
...
|
|
7192
|
+
...V,
|
|
7193
7193
|
mode: "rays",
|
|
7194
7194
|
count: 28,
|
|
7195
7195
|
shape: "wedge",
|
|
@@ -7209,9 +7209,9 @@ var sa = {
|
|
|
7209
7209
|
style: "radialArray",
|
|
7210
7210
|
label: "Method",
|
|
7211
7211
|
ref: "circles/method",
|
|
7212
|
-
size:
|
|
7212
|
+
size: H,
|
|
7213
7213
|
params: {
|
|
7214
|
-
...
|
|
7214
|
+
...V,
|
|
7215
7215
|
mode: "rays",
|
|
7216
7216
|
count: 2,
|
|
7217
7217
|
shape: "bar",
|
|
@@ -7236,9 +7236,9 @@ var sa = {
|
|
|
7236
7236
|
style: "radialArray",
|
|
7237
7237
|
label: "Orbit",
|
|
7238
7238
|
ref: "circles/orbit",
|
|
7239
|
-
size:
|
|
7239
|
+
size: H,
|
|
7240
7240
|
params: {
|
|
7241
|
-
...
|
|
7241
|
+
...V,
|
|
7242
7242
|
mode: "rings",
|
|
7243
7243
|
count: 1,
|
|
7244
7244
|
r1A: .8,
|
|
@@ -7257,9 +7257,9 @@ var sa = {
|
|
|
7257
7257
|
style: "radialArray",
|
|
7258
7258
|
label: "Radial",
|
|
7259
7259
|
ref: "circles/radial",
|
|
7260
|
-
size:
|
|
7260
|
+
size: H,
|
|
7261
7261
|
params: {
|
|
7262
|
-
...
|
|
7262
|
+
...V,
|
|
7263
7263
|
mode: "rays",
|
|
7264
7264
|
count: 6,
|
|
7265
7265
|
shape: "bar",
|
|
@@ -7279,9 +7279,9 @@ var sa = {
|
|
|
7279
7279
|
style: "radialArray",
|
|
7280
7280
|
label: "Radiation",
|
|
7281
7281
|
ref: "circles/radiation",
|
|
7282
|
-
size:
|
|
7282
|
+
size: ca,
|
|
7283
7283
|
params: {
|
|
7284
|
-
...
|
|
7284
|
+
...V,
|
|
7285
7285
|
mode: "rings",
|
|
7286
7286
|
count: 8,
|
|
7287
7287
|
cx: 1.887,
|
|
@@ -7299,9 +7299,9 @@ var sa = {
|
|
|
7299
7299
|
style: "radialArray",
|
|
7300
7300
|
label: "Ring",
|
|
7301
7301
|
ref: "circles/ring",
|
|
7302
|
-
size:
|
|
7302
|
+
size: H,
|
|
7303
7303
|
params: {
|
|
7304
|
-
...
|
|
7304
|
+
...V,
|
|
7305
7305
|
mode: "rays",
|
|
7306
7306
|
count: 80,
|
|
7307
7307
|
shape: "spike",
|
|
@@ -7321,9 +7321,9 @@ var sa = {
|
|
|
7321
7321
|
style: "radialArray",
|
|
7322
7322
|
label: "Sunburst",
|
|
7323
7323
|
ref: "circles/sunburst",
|
|
7324
|
-
size:
|
|
7324
|
+
size: H,
|
|
7325
7325
|
params: {
|
|
7326
|
-
...
|
|
7326
|
+
...V,
|
|
7327
7327
|
mode: "rays",
|
|
7328
7328
|
count: 80,
|
|
7329
7329
|
shape: "spike",
|
|
@@ -7345,7 +7345,7 @@ var sa = {
|
|
|
7345
7345
|
ref: "data/afterimage",
|
|
7346
7346
|
size: U,
|
|
7347
7347
|
params: {
|
|
7348
|
-
...
|
|
7348
|
+
...V,
|
|
7349
7349
|
set: "|",
|
|
7350
7350
|
pick: "field",
|
|
7351
7351
|
cols: 90,
|
|
@@ -7374,7 +7374,7 @@ var sa = {
|
|
|
7374
7374
|
ref: "data/carrier",
|
|
7375
7375
|
size: U,
|
|
7376
7376
|
params: {
|
|
7377
|
-
...
|
|
7377
|
+
...V,
|
|
7378
7378
|
set: ".|",
|
|
7379
7379
|
pick: "field",
|
|
7380
7380
|
cols: 83,
|
|
@@ -7411,7 +7411,7 @@ var sa = {
|
|
|
7411
7411
|
ref: "data/dropout",
|
|
7412
7412
|
size: U,
|
|
7413
7413
|
params: {
|
|
7414
|
-
...
|
|
7414
|
+
...V,
|
|
7415
7415
|
set: "|#",
|
|
7416
7416
|
pick: "field",
|
|
7417
7417
|
cols: 60,
|
|
@@ -7432,7 +7432,7 @@ var sa = {
|
|
|
7432
7432
|
ref: "data/handshake",
|
|
7433
7433
|
size: U,
|
|
7434
7434
|
params: {
|
|
7435
|
-
...
|
|
7435
|
+
...V,
|
|
7436
7436
|
set: "|",
|
|
7437
7437
|
pick: "row",
|
|
7438
7438
|
cols: 40,
|
|
@@ -7451,7 +7451,7 @@ var sa = {
|
|
|
7451
7451
|
ref: "data/switchboard",
|
|
7452
7452
|
size: U,
|
|
7453
7453
|
params: {
|
|
7454
|
-
...
|
|
7454
|
+
...V,
|
|
7455
7455
|
set: "#/^.o-x[|",
|
|
7456
7456
|
pick: "row",
|
|
7457
7457
|
cols: 26,
|
|
@@ -7469,7 +7469,7 @@ var sa = {
|
|
|
7469
7469
|
ref: "data/syncopation",
|
|
7470
7470
|
size: U,
|
|
7471
7471
|
params: {
|
|
7472
|
-
...
|
|
7472
|
+
...V,
|
|
7473
7473
|
set: "|.-xo",
|
|
7474
7474
|
pick: "random",
|
|
7475
7475
|
cols: 26,
|
|
@@ -7487,9 +7487,9 @@ var sa = {
|
|
|
7487
7487
|
style: "symbolGrid",
|
|
7488
7488
|
label: "Test",
|
|
7489
7489
|
ref: "data/test",
|
|
7490
|
-
size:
|
|
7490
|
+
size: H,
|
|
7491
7491
|
params: {
|
|
7492
|
-
...
|
|
7492
|
+
...V,
|
|
7493
7493
|
plot: !0,
|
|
7494
7494
|
cols: 55,
|
|
7495
7495
|
rows: 47,
|
|
@@ -7521,9 +7521,9 @@ var sa = {
|
|
|
7521
7521
|
style: "tiling",
|
|
7522
7522
|
label: "Bricks",
|
|
7523
7523
|
ref: "patterns/bricks",
|
|
7524
|
-
size:
|
|
7524
|
+
size: H,
|
|
7525
7525
|
params: {
|
|
7526
|
-
...
|
|
7526
|
+
...V,
|
|
7527
7527
|
layout: "bricks",
|
|
7528
7528
|
cols: 4,
|
|
7529
7529
|
rows: 6,
|
|
@@ -7541,9 +7541,9 @@ var sa = {
|
|
|
7541
7541
|
style: "tiling",
|
|
7542
7542
|
label: "Chessboard",
|
|
7543
7543
|
ref: "patterns/chessboard",
|
|
7544
|
-
size:
|
|
7544
|
+
size: H,
|
|
7545
7545
|
params: {
|
|
7546
|
-
...
|
|
7546
|
+
...V,
|
|
7547
7547
|
layout: "checker",
|
|
7548
7548
|
cols: 8,
|
|
7549
7549
|
rows: 8,
|
|
@@ -7563,7 +7563,7 @@ var sa = {
|
|
|
7563
7563
|
ref: "patterns/columns",
|
|
7564
7564
|
size: U,
|
|
7565
7565
|
params: {
|
|
7566
|
-
...
|
|
7566
|
+
...V,
|
|
7567
7567
|
layout: "columns",
|
|
7568
7568
|
shift: .24,
|
|
7569
7569
|
cols: 3,
|
|
@@ -7583,7 +7583,7 @@ var sa = {
|
|
|
7583
7583
|
ref: "patterns/maze",
|
|
7584
7584
|
size: U,
|
|
7585
7585
|
params: {
|
|
7586
|
-
...
|
|
7586
|
+
...V,
|
|
7587
7587
|
layout: "maze",
|
|
7588
7588
|
cols: 1,
|
|
7589
7589
|
rows: 10,
|
|
@@ -7634,7 +7634,7 @@ la.push({
|
|
|
7634
7634
|
style: "stipple",
|
|
7635
7635
|
label: "Glow",
|
|
7636
7636
|
params: {
|
|
7637
|
-
...
|
|
7637
|
+
...V,
|
|
7638
7638
|
spacing: 7,
|
|
7639
7639
|
dot: .35,
|
|
7640
7640
|
fKind: "radial",
|
|
@@ -7647,7 +7647,7 @@ la.push({
|
|
|
7647
7647
|
style: "mosaic",
|
|
7648
7648
|
label: "Hex",
|
|
7649
7649
|
params: {
|
|
7650
|
-
...
|
|
7650
|
+
...V,
|
|
7651
7651
|
tile: "hex",
|
|
7652
7652
|
cols: 36,
|
|
7653
7653
|
gap: .08,
|
|
@@ -7658,16 +7658,16 @@ la.push({
|
|
|
7658
7658
|
//#endregion
|
|
7659
7659
|
//#region src/generate/index.js
|
|
7660
7660
|
var da = [
|
|
7661
|
+
xi,
|
|
7661
7662
|
Si,
|
|
7662
|
-
|
|
7663
|
-
|
|
7664
|
-
|
|
7665
|
-
|
|
7666
|
-
|
|
7667
|
-
|
|
7663
|
+
ra,
|
|
7664
|
+
Di,
|
|
7665
|
+
Ni,
|
|
7666
|
+
zi,
|
|
7667
|
+
Ui,
|
|
7668
|
+
oa,
|
|
7668
7669
|
sa,
|
|
7669
|
-
|
|
7670
|
-
Ie
|
|
7670
|
+
Fe
|
|
7671
7671
|
], fa = (e) => da.find((t) => t.id === e) ?? da[0], pa = [
|
|
7672
7672
|
{
|
|
7673
7673
|
key: "jPos",
|
|
@@ -7743,7 +7743,7 @@ function ha(e, t) {
|
|
|
7743
7743
|
}
|
|
7744
7744
|
function ga(e, t, n, r) {
|
|
7745
7745
|
if (!t.repOn) return e;
|
|
7746
|
-
let i =
|
|
7746
|
+
let i = g(t, {
|
|
7747
7747
|
x: 0,
|
|
7748
7748
|
y: 0,
|
|
7749
7749
|
w: n,
|
|
@@ -7755,10 +7755,10 @@ function ga(e, t, n, r) {
|
|
|
7755
7755
|
};
|
|
7756
7756
|
for (let t of i) {
|
|
7757
7757
|
let n = Math.sqrt(Math.abs(t[0] * t[3] - t[1] * t[2]));
|
|
7758
|
-
for (let n of e.polys) a.polys.push(n.map(([e, n]) =>
|
|
7759
|
-
for (let n of e.compounds ?? []) a.compounds.push(n.map((e) => e.map(([e, n]) =>
|
|
7758
|
+
for (let n of e.polys) a.polys.push(n.map(([e, n]) => f(t, e, n)));
|
|
7759
|
+
for (let n of e.compounds ?? []) a.compounds.push(n.map((e) => e.map(([e, n]) => f(t, e, n))));
|
|
7760
7760
|
for (let [r, i, o, s] of e.circles) {
|
|
7761
|
-
let [e, c] =
|
|
7761
|
+
let [e, c] = f(t, r, i);
|
|
7762
7762
|
a.circles.push(s == null ? [
|
|
7763
7763
|
e,
|
|
7764
7764
|
c,
|
|
@@ -7828,9 +7828,9 @@ function ya(e) {
|
|
|
7828
7828
|
return [
|
|
7829
7829
|
...t.schema,
|
|
7830
7830
|
...t.sampled ? [
|
|
7831
|
-
...
|
|
7832
|
-
...
|
|
7833
|
-
...t.warp === !1 ? [] : va(
|
|
7831
|
+
...gi,
|
|
7832
|
+
...yi,
|
|
7833
|
+
...t.warp === !1 ? [] : va(bi)
|
|
7834
7834
|
] : [],
|
|
7835
7835
|
...va(pa),
|
|
7836
7836
|
...va([
|
|
@@ -7899,7 +7899,7 @@ function Ca(e, t, n, { rings: r = null, image: i = null } = {}) {
|
|
|
7899
7899
|
rings: r,
|
|
7900
7900
|
image: i
|
|
7901
7901
|
};
|
|
7902
|
-
return a.sampled && (u.field = oi(e, l, i), u.mask =
|
|
7902
|
+
return a.sampled && (u.field = oi(e, l, i), u.mask = ui(e, l, r), u.warp = a.warp === !1 ? null : di(e, l, u.field)), a.draw(o, e, s, u), ga(ha(o, e), e, t, n);
|
|
7903
7903
|
}
|
|
7904
7904
|
//#endregion
|
|
7905
7905
|
//#region src/editor/generate/generateCore.js
|
|
@@ -7948,13 +7948,13 @@ function Oa(e, t, n = Da(e)) {
|
|
|
7948
7948
|
function ka(e) {
|
|
7949
7949
|
if (!e) return null;
|
|
7950
7950
|
let t = e.x ?? 0, n = e.y ?? 0, r = (e) => e.map((e) => e.map(([e, r]) => [e + t, r + n]));
|
|
7951
|
-
if (e.type === "shape") return r(
|
|
7952
|
-
if (e.type === "path") return r(
|
|
7951
|
+
if (e.type === "shape") return r(Ne(oe(e) || "", 8));
|
|
7952
|
+
if (e.type === "path") return r(Ne([e.nodes ?? [], ...e.holes ?? []].map((e) => de(e, !0)).join(" "), 8));
|
|
7953
7953
|
if (e.type === "misc" && e.loopId === "paratype-glyph") {
|
|
7954
|
-
let r = { ...
|
|
7955
|
-
for (let t of Object.keys(
|
|
7954
|
+
let r = { ...Le };
|
|
7955
|
+
for (let t of Object.keys(Le)) e[t] != null && typeof e[t] != "object" && (r[t] = e[t]);
|
|
7956
7956
|
let i = [];
|
|
7957
|
-
for (let a of
|
|
7957
|
+
for (let a of Ke(r, Math.max(1, e.w ?? 480), Math.max(1, e.h ?? 480))) for (let e of a.g.paths) for (let r of Ne(e.d, 6)) i.push(r.map(([e, r]) => [t + a.tx + e * a.s, n + a.ty - r * a.s]));
|
|
7958
7958
|
return i;
|
|
7959
7959
|
}
|
|
7960
7960
|
return null;
|
|
@@ -7966,14 +7966,14 @@ function Aa(e, t) {
|
|
|
7966
7966
|
}
|
|
7967
7967
|
function ja(e, t, n = .9) {
|
|
7968
7968
|
if (!e?.length) return null;
|
|
7969
|
-
let r = Sa(t, t.w ?? 0, t.h ?? 0), i =
|
|
7969
|
+
let r = Sa(t, t.w ?? 0, t.h ?? 0), i = Pe(e), a = Math.min(r.w * n / (i.w || 1), r.h * n / (i.h || 1));
|
|
7970
7970
|
return e.map((e) => e.map(([e, t]) => [(r.w / 2 + (e - i.x - i.w / 2) * a) / r.w, (r.h / 2 + (t - i.y - i.h / 2) * a) / r.h]));
|
|
7971
7971
|
}
|
|
7972
7972
|
async function Ma(e, t = "inter", n = 700) {
|
|
7973
|
-
return
|
|
7973
|
+
return Ne((await fe(t, n, !1)).getPath(e || "A", 0, 0, 1e3).toPathData(2), 8);
|
|
7974
7974
|
}
|
|
7975
7975
|
function Na(e) {
|
|
7976
|
-
let { layers: t } =
|
|
7976
|
+
let { layers: t } = _(), n = e.mKind, [r, i] = un(null), a = e.mChar, o = vi(e), s = e.mWeight;
|
|
7977
7977
|
on(() => {
|
|
7978
7978
|
if (n !== "letter") return;
|
|
7979
7979
|
let e = !0;
|
|
@@ -7990,7 +7990,7 @@ function Na(e) {
|
|
|
7990
7990
|
o,
|
|
7991
7991
|
s
|
|
7992
7992
|
]);
|
|
7993
|
-
let c = n === "layer" && e.mLayer ?
|
|
7993
|
+
let c = n === "layer" && e.mLayer ? M(t, e.mLayer) : null, l = [
|
|
7994
7994
|
e.x,
|
|
7995
7995
|
e.y,
|
|
7996
7996
|
e.w,
|
|
@@ -8008,12 +8008,12 @@ function Na(e) {
|
|
|
8008
8008
|
//#endregion
|
|
8009
8009
|
//#region src/editor/generate/useGenerateFont.js
|
|
8010
8010
|
function Pa(e) {
|
|
8011
|
-
let t = e.genStyle === "ascii" ?
|
|
8011
|
+
let t = e.genStyle === "ascii" ? na(e) : null, [n, r] = un(0);
|
|
8012
8012
|
return on(() => {
|
|
8013
|
-
if (!t || t === "pixel" ||
|
|
8013
|
+
if (!t || t === "pixel" || qi(t)) return;
|
|
8014
8014
|
let [e, n] = t.split("-"), i = !0;
|
|
8015
|
-
return
|
|
8016
|
-
|
|
8015
|
+
return fe(e, Number(n)).then((e) => {
|
|
8016
|
+
Ki(t, e), i && r((e) => e + 1);
|
|
8017
8017
|
}).catch(() => {}), () => {
|
|
8018
8018
|
i = !1;
|
|
8019
8019
|
};
|
|
@@ -8056,7 +8056,7 @@ function La(e, t, n) {
|
|
|
8056
8056
|
};
|
|
8057
8057
|
}
|
|
8058
8058
|
function Ra(e) {
|
|
8059
|
-
let { layers: t } =
|
|
8059
|
+
let { layers: t } = _(), n = (e.fKind === "image" || e.gKind === "image") && e.fImgLayer ? se(M(t, e.fImgLayer)) : null, r = n?.src ?? null, [i, a] = un(null);
|
|
8060
8060
|
return on(() => {
|
|
8061
8061
|
if (!r) {
|
|
8062
8062
|
a(null);
|
|
@@ -8088,7 +8088,7 @@ function za({ layer: e, palette: t, layerStyle: n }) {
|
|
|
8088
8088
|
r,
|
|
8089
8089
|
i,
|
|
8090
8090
|
a
|
|
8091
|
-
]), s =
|
|
8091
|
+
]), s = _e(e.color, t) ?? "#FFFFFF", c = e.bg == null ? null : _e(e.bg, t), l = Math.max(1, e.w ?? 1), u = Math.max(1, e.h ?? 1);
|
|
8092
8092
|
return /* @__PURE__ */ F("svg", {
|
|
8093
8093
|
"data-layer-id": e.id,
|
|
8094
8094
|
width: l,
|
|
@@ -8160,9 +8160,9 @@ var Ba = (...e) => e.map((e) => typeof e == "string" ? {
|
|
|
8160
8160
|
curve: "linear"
|
|
8161
8161
|
}
|
|
8162
8162
|
}, r), Qa = [
|
|
8163
|
-
...
|
|
8164
|
-
...
|
|
8165
|
-
...
|
|
8163
|
+
...gi,
|
|
8164
|
+
...yi,
|
|
8165
|
+
...bi
|
|
8166
8166
|
], J = (e) => Qa.find((t) => t.key === e)?.when, $a = (e, ...t) => (n) => t.includes(n[e] ?? "none"), Y = (e) => `${Math.round(e * 100)}%`, eo = (e) => (t) => Number(t).toFixed(e), to = (e) => `${Math.round(e)}°`, X = (e) => `${Math.round(e)} px`, Z = (e, t = (e) => e, n = (e) => e) => ({
|
|
8167
8167
|
get: (t) => t[e] === void 0 ? void 0 : n(t[e], t),
|
|
8168
8168
|
set: (n, r) => ({ [e]: t(n, r) })
|
|
@@ -8405,7 +8405,7 @@ var Ba = (...e) => e.map((e) => typeof e == "string" ? {
|
|
|
8405
8405
|
})
|
|
8406
8406
|
]
|
|
8407
8407
|
}]
|
|
8408
|
-
}, ho =
|
|
8408
|
+
}, ho = _i, go = {
|
|
8409
8409
|
key: "mask",
|
|
8410
8410
|
label: "Mask",
|
|
8411
8411
|
state: (e) => vo.find((t) => t.value === (e.mKind === "layer" ? "linked" : e.mKind))?.label ?? "None",
|
|
@@ -8452,7 +8452,7 @@ var Ba = (...e) => e.map((e) => typeof e == "string" ? {
|
|
|
8452
8452
|
def: "inter",
|
|
8453
8453
|
id: "letter-font",
|
|
8454
8454
|
bind: {
|
|
8455
|
-
get: (e) =>
|
|
8455
|
+
get: (e) => vi(e),
|
|
8456
8456
|
set: (e) => ({ mFamily: e })
|
|
8457
8457
|
}
|
|
8458
8458
|
}),
|
|
@@ -8808,11 +8808,11 @@ var vo = Ba(..._o()), yo = Ba("None", "Pinch", "Bulge", "Wave", "Swirl", "Noise"
|
|
|
8808
8808
|
bind: Z("cell", (e) => Math.max(.5, Math.min(3, 1 / e)), (e) => 1 / e)
|
|
8809
8809
|
}),
|
|
8810
8810
|
K("Font", [
|
|
8811
|
-
|
|
8811
|
+
...Qi.filter((e) => e.value !== "pixel"),
|
|
8812
8812
|
"Mono",
|
|
8813
8813
|
"Pixel"
|
|
8814
8814
|
], { bind: {
|
|
8815
|
-
get: (e) => e.font === void 0 ? void 0 :
|
|
8815
|
+
get: (e) => e.font === void 0 ? void 0 : ea(e),
|
|
8816
8816
|
set: (e) => ({ font: e })
|
|
8817
8817
|
} }),
|
|
8818
8818
|
G("Weight", 100, 900, {
|
|
@@ -8834,7 +8834,7 @@ var vo = Ba(..._o()), yo = Ba("None", "Pinch", "Bulge", "Wave", "Swirl", "Noise"
|
|
|
8834
8834
|
def: " .:-=+*#%@",
|
|
8835
8835
|
id: "ramp-text",
|
|
8836
8836
|
bind: {
|
|
8837
|
-
get: (e) => e.rampPreset ?
|
|
8837
|
+
get: (e) => e.rampPreset ? Xi[e.rampPreset] : e.ramp,
|
|
8838
8838
|
set: (e) => ({
|
|
8839
8839
|
ramp: e,
|
|
8840
8840
|
rampPreset: ""
|
|
@@ -9911,20 +9911,20 @@ var ns = (e, t) => e.key === "style" ? `style:${oo(t.genStyle)}` : e.key, rs = (
|
|
|
9911
9911
|
misc: (e) => e.type === "misc" && e.loopId === "paratype-glyph"
|
|
9912
9912
|
};
|
|
9913
9913
|
function as(e) {
|
|
9914
|
-
let t = qo[e], n =
|
|
9914
|
+
let t = qo[e], n = x("generators"), r = _(), i = () => n ? n.presetParams({
|
|
9915
9915
|
id: "type",
|
|
9916
9916
|
loop: t.loop,
|
|
9917
9917
|
params: {}
|
|
9918
|
-
}) : {}, { params: a, layerId: o, live: c, contentKey: l } =
|
|
9918
|
+
}) : {}, { params: a, layerId: o, live: c, contentKey: l } = Ct(e, t.init ?? i), u = (t) => _t(e, (e) => ({ params: t(e.params) })), d = (e) => (n) => u((r) => ({
|
|
9919
9919
|
...r,
|
|
9920
9920
|
...Yo(t, e, n, r)
|
|
9921
|
-
})),
|
|
9921
|
+
})), f = t.sections(a), p = rs(r.layers ?? []), m = (e) => e.name || e.genLabel || e.presetLabel || e.kind || e.type, h = (e) => p.filter((t) => t.type !== "background" && t.id !== o && (e.kinds ? e.kinds.some((e) => is[e]?.(t)) : t.type !== "repeat" && t.w != null)).map((e) => ({
|
|
9922
9922
|
value: e.id,
|
|
9923
|
-
label:
|
|
9923
|
+
label: m(e)
|
|
9924
9924
|
}));
|
|
9925
9925
|
on(() => {
|
|
9926
9926
|
if (e !== "repeat" || a.sourceId) return;
|
|
9927
|
-
let t = r.selectedId && r.selectedId !== "canvas" ?
|
|
9927
|
+
let t = r.selectedId && r.selectedId !== "canvas" ? M(r.layers, r.selectedId) : null;
|
|
9928
9928
|
t && t.type !== "repeat" && t.w != null && u((e) => ({
|
|
9929
9929
|
...e,
|
|
9930
9930
|
sourceId: t.id
|
|
@@ -9934,7 +9934,7 @@ function as(e) {
|
|
|
9934
9934
|
a.sourceId,
|
|
9935
9935
|
r.selectedId
|
|
9936
9936
|
]);
|
|
9937
|
-
let
|
|
9937
|
+
let g = e === "generate" ? [...a.genPreset ? [] : [{
|
|
9938
9938
|
value: "custom",
|
|
9939
9939
|
label: "Custom"
|
|
9940
9940
|
}], ...Ro(a.genStyle).map((e) => ({
|
|
@@ -9942,9 +9942,9 @@ function as(e) {
|
|
|
9942
9942
|
label: e.label
|
|
9943
9943
|
}))] : null, v = (e) => {
|
|
9944
9944
|
e !== "custom" && u(() => zo(a.genStyle, e));
|
|
9945
|
-
},
|
|
9945
|
+
}, y = () => u((t) => {
|
|
9946
9946
|
for (let n = 0; n < 8; n++) {
|
|
9947
|
-
let n =
|
|
9947
|
+
let n = b(t);
|
|
9948
9948
|
if (e !== "generate") return n;
|
|
9949
9949
|
let r = "";
|
|
9950
9950
|
try {
|
|
@@ -9961,7 +9961,7 @@ function as(e) {
|
|
|
9961
9961
|
if (r && r.length > 40) return n;
|
|
9962
9962
|
}
|
|
9963
9963
|
return t;
|
|
9964
|
-
}),
|
|
9964
|
+
}), b = (n) => {
|
|
9965
9965
|
let r = e === "generate" ? Ro(n.genStyle) : [], i = r.length ? { ...zo(n.genStyle, r[Math.floor(Math.random() * r.length)].id) } : { ...n };
|
|
9966
9966
|
e === "generate" && Object.assign(i, {
|
|
9967
9967
|
inset: n.inset,
|
|
@@ -9982,7 +9982,7 @@ function as(e) {
|
|
|
9982
9982
|
...a,
|
|
9983
9983
|
...e === "generate" ? { genPreset: null } : {}
|
|
9984
9984
|
};
|
|
9985
|
-
}, S = o ?
|
|
9985
|
+
}, S = o ? M(r.layers ?? [], o) : null, C = e === "repeat" ? !!a.sourceId : e === "type" ? !!n : !0, w = () => {
|
|
9986
9986
|
if (!C) return null;
|
|
9987
9987
|
if (e === "type") {
|
|
9988
9988
|
if (S) return r.updateLayer(S.id, a), S.id;
|
|
@@ -9993,7 +9993,7 @@ function as(e) {
|
|
|
9993
9993
|
loopId: t.loop,
|
|
9994
9994
|
...a
|
|
9995
9995
|
});
|
|
9996
|
-
return
|
|
9996
|
+
return _t(e, { layerId: n }), n;
|
|
9997
9997
|
}
|
|
9998
9998
|
let n = e === "generate" ? "generate" : "repeat";
|
|
9999
9999
|
if (l && te(S).some((e) => e.key === l)) return r.updateContent(S.id, l, a), S.id;
|
|
@@ -10002,11 +10002,11 @@ function as(e) {
|
|
|
10002
10002
|
...a,
|
|
10003
10003
|
...e === "repeat" ? { name: "Repeat" } : {}
|
|
10004
10004
|
});
|
|
10005
|
-
return
|
|
10005
|
+
return _t(e, { layerId: i }), i;
|
|
10006
10006
|
}, T = () => {
|
|
10007
10007
|
let t = w();
|
|
10008
10008
|
t && setTimeout(() => {
|
|
10009
|
-
e === "generate" ? r.flattenGenerate(t) : e === "repeat" ? r.flattenRepeat(t) : r.flattenParatype(t),
|
|
10009
|
+
e === "generate" ? r.flattenGenerate(t) : e === "repeat" ? r.flattenRepeat(t) : r.flattenParatype(t), _t(e, { layerId: null });
|
|
10010
10010
|
}, 0);
|
|
10011
10011
|
};
|
|
10012
10012
|
return {
|
|
@@ -10017,23 +10017,23 @@ function as(e) {
|
|
|
10017
10017
|
params: a,
|
|
10018
10018
|
setParams: u,
|
|
10019
10019
|
set: d,
|
|
10020
|
-
sections:
|
|
10021
|
-
presets:
|
|
10020
|
+
sections: f,
|
|
10021
|
+
presets: g,
|
|
10022
10022
|
setPreset: v,
|
|
10023
|
-
randomise:
|
|
10024
|
-
layersFor:
|
|
10023
|
+
randomise: y,
|
|
10024
|
+
layersFor: h,
|
|
10025
10025
|
apply: w,
|
|
10026
10026
|
expand: T,
|
|
10027
10027
|
run: (e) => {
|
|
10028
|
-
e === "expand" ? T() : e === "open-type" &&
|
|
10028
|
+
e === "expand" ? T() : e === "open-type" && bt("type");
|
|
10029
10029
|
},
|
|
10030
|
-
reset: () =>
|
|
10030
|
+
reset: () => _t(e, {
|
|
10031
10031
|
params: (t.init ?? i)(),
|
|
10032
10032
|
layerId: null,
|
|
10033
10033
|
contentKey: null
|
|
10034
10034
|
}),
|
|
10035
10035
|
live: c,
|
|
10036
|
-
setLive: (t) =>
|
|
10036
|
+
setLive: (t) => _t(e, { live: t }),
|
|
10037
10037
|
canApply: C,
|
|
10038
10038
|
target: S,
|
|
10039
10039
|
contentKey: l,
|
|
@@ -10070,7 +10070,7 @@ function os({ t: e, className: t = "" }) {
|
|
|
10070
10070
|
i,
|
|
10071
10071
|
a,
|
|
10072
10072
|
o
|
|
10073
|
-
]), m =
|
|
10073
|
+
]), m = _e(n.color, r.palette) ?? "#FFFFFF", h = n.bg == null ? null : _e(n.bg, r.palette);
|
|
10074
10074
|
return /* @__PURE__ */ F("svg", {
|
|
10075
10075
|
viewBox: `0 0 ${a} ${o}`,
|
|
10076
10076
|
preserveAspectRatio: "xMidYMid meet",
|
|
@@ -10087,7 +10087,7 @@ function os({ t: e, className: t = "" }) {
|
|
|
10087
10087
|
});
|
|
10088
10088
|
}
|
|
10089
10089
|
function ss({ t: e, className: t = "" }) {
|
|
10090
|
-
let { params: n, state: r } = e, i = n.sourceId ?
|
|
10090
|
+
let { params: n, state: r } = e, i = n.sourceId ? M(r.layers ?? [], n.sourceId) : null, a = i && i.w != null ? {
|
|
10091
10091
|
x: i.x ?? 0,
|
|
10092
10092
|
y: i.y ?? 0,
|
|
10093
10093
|
w: i.w,
|
|
@@ -10097,7 +10097,7 @@ function ss({ t: e, className: t = "" }) {
|
|
|
10097
10097
|
y: 440,
|
|
10098
10098
|
w: 200,
|
|
10099
10099
|
h: 200
|
|
10100
|
-
}, o =
|
|
10100
|
+
}, o = g(n, a), s = [[a.x, a.y], [a.x + a.w, a.y + a.h]];
|
|
10101
10101
|
for (let e of o) for (let [t, n] of [
|
|
10102
10102
|
[a.x, a.y],
|
|
10103
10103
|
[a.x + a.w, a.y],
|
|
@@ -10166,8 +10166,7 @@ var ls = ({ t: e, className: t }) => e.id === "generate" ? /* @__PURE__ */ P(os,
|
|
|
10166
10166
|
}), us = {
|
|
10167
10167
|
Lights: "Lights / Point editor",
|
|
10168
10168
|
Image: "Image / Layer source"
|
|
10169
|
-
}, ds = "[--kol-slider-float-run:var(--kol-accent-primary)]", fs = "h-7 !rounded-md", ps = (e, t = !1) => `calc(${e}ch + ${t ? 38 : 22}px)`, ms = (e, t, n, r, i) => /* @__PURE__ */ P(
|
|
10170
|
-
variant: "float",
|
|
10169
|
+
}, ds = "[--kol-slider-float-run:var(--kol-accent-primary)]", fs = "h-7 !rounded-md", ps = (e, t = !1) => `calc(${e}ch + ${t ? 38 : 22}px)`, ms = (e, t, n, r, i) => /* @__PURE__ */ P(Pt, {
|
|
10171
10170
|
size: "sm",
|
|
10172
10171
|
options: e,
|
|
10173
10172
|
value: t,
|
|
@@ -10180,7 +10179,6 @@ function hs({ x: e, t }) {
|
|
|
10180
10179
|
let n = t.valueOf(e), r = e.bind ? t.set(e) : () => {}, i = !t.isLive(e);
|
|
10181
10180
|
switch (e.type) {
|
|
10182
10181
|
case "slider": return /* @__PURE__ */ P(Zt, {
|
|
10183
|
-
variant: "float",
|
|
10184
10182
|
readout: "input",
|
|
10185
10183
|
value: Number(n),
|
|
10186
10184
|
onChange: r,
|
|
@@ -10214,8 +10212,7 @@ function hs({ x: e, t }) {
|
|
|
10214
10212
|
(e.format ?? String)(n[1])
|
|
10215
10213
|
]
|
|
10216
10214
|
})] });
|
|
10217
|
-
case "point": return ["X", "Y"].map((t, a) => /* @__PURE__ */ P(
|
|
10218
|
-
variant: "float",
|
|
10215
|
+
case "point": return ["X", "Y"].map((t, a) => /* @__PURE__ */ P(It, {
|
|
10219
10216
|
size: "sm",
|
|
10220
10217
|
prefix: t,
|
|
10221
10218
|
disabled: i,
|
|
@@ -10229,7 +10226,6 @@ function hs({ x: e, t }) {
|
|
|
10229
10226
|
}, t));
|
|
10230
10227
|
case "select": return ms(e.options, n, r, e.name, i);
|
|
10231
10228
|
case "segmented": return /* @__PURE__ */ P($t, {
|
|
10232
|
-
variant: "float",
|
|
10233
10229
|
size: "xs",
|
|
10234
10230
|
tabs: e.options,
|
|
10235
10231
|
value: n,
|
|
@@ -10240,7 +10236,6 @@ function hs({ x: e, t }) {
|
|
|
10240
10236
|
case "toggle": return /* @__PURE__ */ P("span", {
|
|
10241
10237
|
className: "flex-1 flex justify-end",
|
|
10242
10238
|
children: /* @__PURE__ */ P(en, {
|
|
10243
|
-
variant: "float",
|
|
10244
10239
|
checked: !!n,
|
|
10245
10240
|
onChange: r,
|
|
10246
10241
|
disabled: i,
|
|
@@ -10248,8 +10243,7 @@ function hs({ x: e, t }) {
|
|
|
10248
10243
|
})
|
|
10249
10244
|
});
|
|
10250
10245
|
case "text":
|
|
10251
|
-
case "color": return /* @__PURE__ */ P(
|
|
10252
|
-
variant: "float",
|
|
10246
|
+
case "color": return /* @__PURE__ */ P(It, {
|
|
10253
10247
|
size: "sm",
|
|
10254
10248
|
value: n ?? "",
|
|
10255
10249
|
disabled: i,
|
|
@@ -10261,8 +10255,7 @@ function hs({ x: e, t }) {
|
|
|
10261
10255
|
value: "",
|
|
10262
10256
|
label: e.kinds?.includes("photo") ? "Choose photo layer…" : "None"
|
|
10263
10257
|
}, ...t.layersFor(e)], n ?? "", r, e.name, i);
|
|
10264
|
-
case "button": return /* @__PURE__ */ P(
|
|
10265
|
-
variant: "float",
|
|
10258
|
+
case "button": return /* @__PURE__ */ P(N, {
|
|
10266
10259
|
tone: "secondary",
|
|
10267
10260
|
size: "sm",
|
|
10268
10261
|
disabled: i,
|
|
@@ -10271,8 +10264,7 @@ function hs({ x: e, t }) {
|
|
|
10271
10264
|
children: e.name
|
|
10272
10265
|
});
|
|
10273
10266
|
case "ramp": return /* @__PURE__ */ F(dn, { children: [
|
|
10274
|
-
/* @__PURE__ */ P(
|
|
10275
|
-
variant: "float",
|
|
10267
|
+
/* @__PURE__ */ P(It, {
|
|
10276
10268
|
size: "sm",
|
|
10277
10269
|
"aria-label": `${e.name} A`,
|
|
10278
10270
|
width: ps(5),
|
|
@@ -10294,8 +10286,7 @@ function hs({ x: e, t }) {
|
|
|
10294
10286
|
curve: e
|
|
10295
10287
|
}), `${e.name} curve`, i)
|
|
10296
10288
|
}),
|
|
10297
|
-
/* @__PURE__ */ P(
|
|
10298
|
-
variant: "float",
|
|
10289
|
+
/* @__PURE__ */ P(It, {
|
|
10299
10290
|
size: "sm",
|
|
10300
10291
|
"aria-label": `${e.name} B`,
|
|
10301
10292
|
width: ps(5),
|
|
@@ -10319,8 +10310,7 @@ function _s({ x: e, t }) {
|
|
|
10319
10310
|
let n = t.valueOf(e), r = t.set(e), i = (e, t, i) => r(n.map((n, r) => r === e ? {
|
|
10320
10311
|
...n,
|
|
10321
10312
|
[t]: i
|
|
10322
|
-
} : n)), a = (e, t, r) => /* @__PURE__ */ P(
|
|
10323
|
-
variant: "float",
|
|
10313
|
+
} : n)), a = (e, t, r) => /* @__PURE__ */ P(It, {
|
|
10324
10314
|
size: "sm",
|
|
10325
10315
|
prefix: r,
|
|
10326
10316
|
"aria-label": `Light ${e + 1} ${r ?? t}`,
|
|
@@ -10367,7 +10357,6 @@ function _s({ x: e, t }) {
|
|
|
10367
10357
|
a(t, "y", "Y"),
|
|
10368
10358
|
a(t, "radius"),
|
|
10369
10359
|
/* @__PURE__ */ P(Zt, {
|
|
10370
|
-
variant: "float",
|
|
10371
10360
|
value: e.intensity,
|
|
10372
10361
|
min: 0,
|
|
10373
10362
|
max: 2,
|
|
@@ -10380,8 +10369,7 @@ function _s({ x: e, t }) {
|
|
|
10380
10369
|
className: "kol-float-timecode text-fg-emphasis text-[11px] text-right",
|
|
10381
10370
|
children: e.intensity.toFixed(1)
|
|
10382
10371
|
}),
|
|
10383
|
-
/* @__PURE__ */ P(
|
|
10384
|
-
variant: "float",
|
|
10372
|
+
/* @__PURE__ */ P(N, {
|
|
10385
10373
|
tone: "ghost",
|
|
10386
10374
|
size: "sm",
|
|
10387
10375
|
iconOnly: "close",
|
|
@@ -10391,8 +10379,7 @@ function _s({ x: e, t }) {
|
|
|
10391
10379
|
})
|
|
10392
10380
|
] }, t))
|
|
10393
10381
|
}),
|
|
10394
|
-
/* @__PURE__ */ P(
|
|
10395
|
-
variant: "float",
|
|
10382
|
+
/* @__PURE__ */ P(N, {
|
|
10396
10383
|
tone: "ghost",
|
|
10397
10384
|
size: "sm",
|
|
10398
10385
|
iconLeft: "plus",
|
|
@@ -10410,7 +10397,7 @@ function _s({ x: e, t }) {
|
|
|
10410
10397
|
});
|
|
10411
10398
|
}
|
|
10412
10399
|
function vs({ x: e, t }) {
|
|
10413
|
-
let n = t.valueOf(e), r = n ?
|
|
10400
|
+
let n = t.valueOf(e), r = n ? M(t.state.layers ?? [], n) : null;
|
|
10414
10401
|
return /* @__PURE__ */ F("div", {
|
|
10415
10402
|
className: "flex items-center gap-2",
|
|
10416
10403
|
"data-control": e.name,
|
|
@@ -10488,8 +10475,7 @@ function xs(e, t) {
|
|
|
10488
10475
|
type: "labeled",
|
|
10489
10476
|
id: i.id,
|
|
10490
10477
|
label: o[1],
|
|
10491
|
-
render: () => [i, a].map((e, n) => /* @__PURE__ */ P(
|
|
10492
|
-
variant: "float",
|
|
10478
|
+
render: () => [i, a].map((e, n) => /* @__PURE__ */ P(It, {
|
|
10493
10479
|
size: "sm",
|
|
10494
10480
|
prefix: n ? "Y" : "X",
|
|
10495
10481
|
"aria-label": e.name,
|
|
@@ -10557,13 +10543,11 @@ function Ss({ id: e, onClose: t, className: n = "" }) {
|
|
|
10557
10543
|
}] : [],
|
|
10558
10544
|
...xs(e.controls, r)
|
|
10559
10545
|
]), ...o]
|
|
10560
|
-
}), f, p, m = /* @__PURE__ */ P(
|
|
10561
|
-
variant: "float",
|
|
10546
|
+
}), f, p, m = /* @__PURE__ */ P(Rt, {
|
|
10562
10547
|
horizontal: !0,
|
|
10563
10548
|
label: "Live update",
|
|
10564
10549
|
className: "flex-1",
|
|
10565
10550
|
children: /* @__PURE__ */ P(en, {
|
|
10566
|
-
variant: "float",
|
|
10567
10551
|
checked: r.live,
|
|
10568
10552
|
onChange: r.setLive,
|
|
10569
10553
|
"aria-label": "Live update"
|
|
@@ -10622,8 +10606,7 @@ function Ss({ id: e, onClose: t, className: n = "" }) {
|
|
|
10622
10606
|
className: "kol-float-timecode text-oq-64 text-[11px]",
|
|
10623
10607
|
children: "512 × 512 px"
|
|
10624
10608
|
})]
|
|
10625
|
-
}), /* @__PURE__ */ P(
|
|
10626
|
-
variant: "float",
|
|
10609
|
+
}), /* @__PURE__ */ P(N, {
|
|
10627
10610
|
tone: "primary",
|
|
10628
10611
|
size: "md",
|
|
10629
10612
|
className: "w-full [--kol-tone-bg:var(--kol-accent-primary)] [--kol-tone-fg:var(--kol-accent-on-primary)]",
|
|
@@ -10633,12 +10616,12 @@ function Ss({ id: e, onClose: t, className: n = "" }) {
|
|
|
10633
10616
|
})]
|
|
10634
10617
|
});
|
|
10635
10618
|
} else if (e === "repeat") {
|
|
10636
|
-
let [e, t] = r.sections, n =
|
|
10619
|
+
let [e, t] = r.sections, n = g(a, {
|
|
10637
10620
|
x: 0,
|
|
10638
10621
|
y: 0,
|
|
10639
10622
|
w: 1,
|
|
10640
10623
|
h: 1
|
|
10641
|
-
}).length + 1, i = a.sourceId ?
|
|
10624
|
+
}).length + 1, i = a.sourceId ? M(r.state.layers ?? [], a.sourceId) : null;
|
|
10642
10625
|
f = [{
|
|
10643
10626
|
id: "head",
|
|
10644
10627
|
rows: xs(e.groups[0].controls, r)
|
|
@@ -10708,7 +10691,7 @@ function Ss({ id: e, onClose: t, className: n = "" }) {
|
|
|
10708
10691
|
sections: f,
|
|
10709
10692
|
footer: p,
|
|
10710
10693
|
surface: "solid",
|
|
10711
|
-
onExpand: () =>
|
|
10694
|
+
onExpand: () => bt(e, "dialog"),
|
|
10712
10695
|
onCollapseH: t,
|
|
10713
10696
|
className: `kol-generator-rail ${ds} ${n}`.trim()
|
|
10714
10697
|
});
|
|
@@ -10720,7 +10703,6 @@ function ws({ x: e, t }) {
|
|
|
10720
10703
|
let n = t.valueOf(e), r = e.bind ? t.set(e) : () => {}, i = !t.isLive(e), a = e.name, o = e.format ?? String;
|
|
10721
10704
|
switch (e.type) {
|
|
10722
10705
|
case "slider": return /* @__PURE__ */ P(Zt, {
|
|
10723
|
-
variant: "float",
|
|
10724
10706
|
readout: "input",
|
|
10725
10707
|
value: Number(n),
|
|
10726
10708
|
onChange: r,
|
|
@@ -10747,7 +10729,6 @@ function ws({ x: e, t }) {
|
|
|
10747
10729
|
onChange2: (e) => r([n[0], Math.max(e, n[0])])
|
|
10748
10730
|
});
|
|
10749
10731
|
case "segmented": return /* @__PURE__ */ P($t, {
|
|
10750
|
-
variant: "float",
|
|
10751
10732
|
size: "xs",
|
|
10752
10733
|
tabs: e.options,
|
|
10753
10734
|
value: n,
|
|
@@ -10755,8 +10736,7 @@ function ws({ x: e, t }) {
|
|
|
10755
10736
|
ariaLabel: a,
|
|
10756
10737
|
className: "w-full [&>*]:flex-1"
|
|
10757
10738
|
});
|
|
10758
|
-
case "select": return /* @__PURE__ */ P(
|
|
10759
|
-
variant: "float",
|
|
10739
|
+
case "select": return /* @__PURE__ */ P(Pt, {
|
|
10760
10740
|
size: "sm",
|
|
10761
10741
|
value: n,
|
|
10762
10742
|
onChange: r,
|
|
@@ -10765,7 +10745,6 @@ function ws({ x: e, t }) {
|
|
|
10765
10745
|
className: Cs
|
|
10766
10746
|
});
|
|
10767
10747
|
case "toggle": return /* @__PURE__ */ P(en, {
|
|
10768
|
-
variant: "float",
|
|
10769
10748
|
checked: !!n,
|
|
10770
10749
|
onChange: r,
|
|
10771
10750
|
disabled: i,
|
|
@@ -10780,8 +10759,7 @@ function ws({ x: e, t }) {
|
|
|
10780
10759
|
"aria-label": a
|
|
10781
10760
|
});
|
|
10782
10761
|
case "text":
|
|
10783
|
-
case "color": return /* @__PURE__ */ P(
|
|
10784
|
-
variant: "float",
|
|
10762
|
+
case "color": return /* @__PURE__ */ P(It, {
|
|
10785
10763
|
size: "sm",
|
|
10786
10764
|
value: n ?? "",
|
|
10787
10765
|
onChange: (e) => r(e.target.value),
|
|
@@ -10794,8 +10772,7 @@ function ws({ x: e, t }) {
|
|
|
10794
10772
|
onChange: r,
|
|
10795
10773
|
disabled: i
|
|
10796
10774
|
});
|
|
10797
|
-
case "picker": return /* @__PURE__ */ P(
|
|
10798
|
-
variant: "float",
|
|
10775
|
+
case "picker": return /* @__PURE__ */ P(Pt, {
|
|
10799
10776
|
size: "sm",
|
|
10800
10777
|
value: n ?? "",
|
|
10801
10778
|
onChange: r,
|
|
@@ -10806,8 +10783,7 @@ function ws({ x: e, t }) {
|
|
|
10806
10783
|
ariaLabel: a,
|
|
10807
10784
|
className: Cs
|
|
10808
10785
|
});
|
|
10809
|
-
case "button": return /* @__PURE__ */ P(
|
|
10810
|
-
variant: "float",
|
|
10786
|
+
case "button": return /* @__PURE__ */ P(N, {
|
|
10811
10787
|
tone: "secondary",
|
|
10812
10788
|
size: "sm",
|
|
10813
10789
|
disabled: i,
|
|
@@ -10823,7 +10799,7 @@ function Ts({ x: e, t }) {
|
|
|
10823
10799
|
return /* @__PURE__ */ P("fieldset", {
|
|
10824
10800
|
disabled: n || void 0,
|
|
10825
10801
|
className: `contents ${e.type === "lights" ? "[&>*]:col-span-2" : ""}`.trim(),
|
|
10826
|
-
children: /* @__PURE__ */ P(
|
|
10802
|
+
children: /* @__PURE__ */ P(Rt, {
|
|
10827
10803
|
variant: "settings",
|
|
10828
10804
|
horizontal: r,
|
|
10829
10805
|
labelWidth: r ? "auto" : void 0,
|
|
@@ -10927,8 +10903,7 @@ function ks({ id: e, open: t, onClose: n }) {
|
|
|
10927
10903
|
children: [
|
|
10928
10904
|
y && /* @__PURE__ */ P(tn, {
|
|
10929
10905
|
label: "Expand to editable paths",
|
|
10930
|
-
children: /* @__PURE__ */ P(
|
|
10931
|
-
variant: "float",
|
|
10906
|
+
children: /* @__PURE__ */ P(N, {
|
|
10932
10907
|
tone: "ghost",
|
|
10933
10908
|
size: "sm",
|
|
10934
10909
|
disabled: !r.canApply,
|
|
@@ -10939,8 +10914,7 @@ function ks({ id: e, open: t, onClose: n }) {
|
|
|
10939
10914
|
children: "Expand"
|
|
10940
10915
|
})
|
|
10941
10916
|
}),
|
|
10942
|
-
_ && /* @__PURE__ */ P(
|
|
10943
|
-
variant: "float",
|
|
10917
|
+
_ && /* @__PURE__ */ P(Rt, {
|
|
10944
10918
|
horizontal: !0,
|
|
10945
10919
|
label: "Style",
|
|
10946
10920
|
labelWidth: "fit-content",
|
|
@@ -10948,8 +10922,7 @@ function ks({ id: e, open: t, onClose: n }) {
|
|
|
10948
10922
|
children: /* @__PURE__ */ P("div", {
|
|
10949
10923
|
className: "w-[140px]",
|
|
10950
10924
|
"data-control": "Style",
|
|
10951
|
-
children: /* @__PURE__ */ P(
|
|
10952
|
-
variant: "float",
|
|
10925
|
+
children: /* @__PURE__ */ P(Pt, {
|
|
10953
10926
|
size: "sm",
|
|
10954
10927
|
value: r.valueOf(_),
|
|
10955
10928
|
onChange: (e) => {
|
|
@@ -10961,8 +10934,7 @@ function ks({ id: e, open: t, onClose: n }) {
|
|
|
10961
10934
|
})
|
|
10962
10935
|
})
|
|
10963
10936
|
}),
|
|
10964
|
-
r.presets && /* @__PURE__ */ P(
|
|
10965
|
-
variant: "float",
|
|
10937
|
+
r.presets && /* @__PURE__ */ P(Rt, {
|
|
10966
10938
|
horizontal: !0,
|
|
10967
10939
|
label: "Preset",
|
|
10968
10940
|
labelWidth: "fit-content",
|
|
@@ -10970,8 +10942,7 @@ function ks({ id: e, open: t, onClose: n }) {
|
|
|
10970
10942
|
children: /* @__PURE__ */ P("div", {
|
|
10971
10943
|
className: "w-[140px]",
|
|
10972
10944
|
"data-control": "Preset",
|
|
10973
|
-
children: /* @__PURE__ */ P(
|
|
10974
|
-
variant: "float",
|
|
10945
|
+
children: /* @__PURE__ */ P(Pt, {
|
|
10975
10946
|
size: "sm",
|
|
10976
10947
|
value: a.genPreset ?? "custom",
|
|
10977
10948
|
onChange: r.setPreset,
|
|
@@ -11017,8 +10988,7 @@ function ks({ id: e, open: t, onClose: n }) {
|
|
|
11017
10988
|
]
|
|
11018
10989
|
}),
|
|
11019
10990
|
footer: /* @__PURE__ */ F(dn, { children: [
|
|
11020
|
-
/* @__PURE__ */ P(
|
|
11021
|
-
variant: "float",
|
|
10991
|
+
/* @__PURE__ */ P(Rt, {
|
|
11022
10992
|
horizontal: !0,
|
|
11023
10993
|
label: "Live preview",
|
|
11024
10994
|
labelWidth: "fit-content",
|
|
@@ -11030,33 +11000,28 @@ function ks({ id: e, open: t, onClose: n }) {
|
|
|
11030
11000
|
className: "flex gap-0"
|
|
11031
11001
|
})
|
|
11032
11002
|
}),
|
|
11033
|
-
/* @__PURE__ */ P(
|
|
11034
|
-
variant: "float",
|
|
11003
|
+
/* @__PURE__ */ P(N, {
|
|
11035
11004
|
tone: "grey",
|
|
11036
11005
|
size: "sm",
|
|
11037
11006
|
onClick: r.reset,
|
|
11038
11007
|
children: "Reset"
|
|
11039
11008
|
}),
|
|
11040
|
-
/* @__PURE__ */ P(
|
|
11041
|
-
variant: "float",
|
|
11009
|
+
/* @__PURE__ */ P(N, {
|
|
11042
11010
|
tone: "grey",
|
|
11043
11011
|
size: "sm",
|
|
11044
11012
|
onClick: r.randomise,
|
|
11045
11013
|
"data-control": "Randomise",
|
|
11046
11014
|
children: "Randomise"
|
|
11047
11015
|
}),
|
|
11048
|
-
/* @__PURE__ */ F(
|
|
11016
|
+
/* @__PURE__ */ F(jt, {
|
|
11049
11017
|
align: "right",
|
|
11050
11018
|
className: "flex-1",
|
|
11051
|
-
children: [/* @__PURE__ */ P(
|
|
11052
|
-
variant: "float",
|
|
11019
|
+
children: [/* @__PURE__ */ P(N, {
|
|
11053
11020
|
tone: "grey",
|
|
11054
11021
|
size: "sm",
|
|
11055
11022
|
onClick: n,
|
|
11056
11023
|
children: "Cancel"
|
|
11057
|
-
}), /* @__PURE__ */ P(
|
|
11058
|
-
variant: "float",
|
|
11059
|
-
tone: "inverted",
|
|
11024
|
+
}), /* @__PURE__ */ P(N, {
|
|
11060
11025
|
size: "sm",
|
|
11061
11026
|
onClick: () => {
|
|
11062
11027
|
r.apply(), n();
|
|
@@ -11089,20 +11054,20 @@ function ks({ id: e, open: t, onClose: n }) {
|
|
|
11089
11054
|
});
|
|
11090
11055
|
}
|
|
11091
11056
|
function As() {
|
|
11092
|
-
let { dialog: e } =
|
|
11057
|
+
let { dialog: e } = vt();
|
|
11093
11058
|
return on(() => {
|
|
11094
11059
|
let e = (e) => {
|
|
11095
11060
|
let t = e.detail?.family;
|
|
11096
|
-
t && Ao(
|
|
11061
|
+
t && Ao(St("generate")?.params ?? {}).id !== t && _t("generate", {
|
|
11097
11062
|
params: Fo(t),
|
|
11098
11063
|
layerId: null
|
|
11099
|
-
}),
|
|
11064
|
+
}), bt(e.detail?.window ?? "generate", e.detail?.form ?? "rail");
|
|
11100
11065
|
};
|
|
11101
11066
|
return window.addEventListener("kol:open-generator-window", e), () => window.removeEventListener("kol:open-generator-window", e);
|
|
11102
11067
|
}, []), e ? /* @__PURE__ */ P(ks, {
|
|
11103
11068
|
id: e,
|
|
11104
11069
|
open: !0,
|
|
11105
|
-
onClose: () =>
|
|
11070
|
+
onClose: () => xt({ dialog: null })
|
|
11106
11071
|
}, e) : null;
|
|
11107
11072
|
}
|
|
11108
11073
|
//#endregion
|
|
@@ -11113,19 +11078,19 @@ var js = {
|
|
|
11113
11078
|
"misc",
|
|
11114
11079
|
"generate"
|
|
11115
11080
|
],
|
|
11116
|
-
GROUPS:
|
|
11117
|
-
loopById:
|
|
11118
|
-
loopDrawParams:
|
|
11119
|
-
resolveCameraKeys:
|
|
11120
|
-
loopBgToggleable:
|
|
11121
|
-
presetById:
|
|
11122
|
-
presetParams:
|
|
11123
|
-
presetsInGroup:
|
|
11124
|
-
presetsInSub:
|
|
11125
|
-
presetLayerPatch:
|
|
11126
|
-
isToolPreset:
|
|
11127
|
-
groupById:
|
|
11128
|
-
drawLoopFrame:
|
|
11081
|
+
GROUPS: $e,
|
|
11082
|
+
loopById: ut,
|
|
11083
|
+
loopDrawParams: Re,
|
|
11084
|
+
resolveCameraKeys: Ie,
|
|
11085
|
+
loopBgToggleable: Ue,
|
|
11086
|
+
presetById: Oe,
|
|
11087
|
+
presetParams: Be,
|
|
11088
|
+
presetsInGroup: je,
|
|
11089
|
+
presetsInSub: Ae,
|
|
11090
|
+
presetLayerPatch: ct,
|
|
11091
|
+
isToolPreset: ft,
|
|
11092
|
+
groupById: Ve,
|
|
11093
|
+
drawLoopFrame: Te,
|
|
11129
11094
|
GENERATIVE_TREE: pn,
|
|
11130
11095
|
MISC_TREE: mn,
|
|
11131
11096
|
THEME_OPTIONS: a,
|
|
@@ -11140,8 +11105,8 @@ var js = {
|
|
|
11140
11105
|
RailSettings: Ss,
|
|
11141
11106
|
GeneratorWindows: As,
|
|
11142
11107
|
GeneratorRail: Ss,
|
|
11143
|
-
loadGlHost: () => import("./host-
|
|
11108
|
+
loadGlHost: () => import("./host-II9SeVCH.js")
|
|
11144
11109
|
};
|
|
11145
|
-
|
|
11110
|
+
S("generators", js);
|
|
11146
11111
|
//#endregion
|
|
11147
11112
|
export { Pn as A, gn as B, or as C, Zn as D, ir as E, An as F, hn as H, jn as I, En as L, Mn as M, Tn as N, Yn as O, Dn as P, Cn as R, Rr as S, ar as T, mn as V, qr as _, ko as a, Br as b, Fo as c, ns as d, Jo as f, Yr as g, Xr as h, Xa as i, wn as j, Jn as k, No as l, Ma as m, ls as n, Ao as o, es as p, as as r, jo as s, js as t, ts as u, Kr as v, sr as w, zr as x, Gr as y, pn as z };
|