@moises.ai/design-system 4.18.3 → 4.18.5
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/index.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { jsx as a, jsxs as v, Fragment as we } from "react/jsx-runtime";
|
|
3
3
|
import { h as mo, f as vr, ag as oc, a as Ls, g as Pe, ah as ic, P as De, i as be, u as Jt, ai as lc, aj as fo, e as Co, F as vo, ak as cc, E as dc, al as uc, am as hc, an as Ac, ao as pc, D as gc, c as Ks, ap as mc, aq as fc, J as yr, ar as Cc, as as vc, at as Je, au as Vs, av as yc, aw as kc, ax as bc, ay as Ic, az as Sc, aA as Ec, aB as wc, aC as Nc, aD as Rc, aE as Bc, aF as xc, aG as Tc, aH as Dc, aI as Jc, R as Qc, aJ as yo, aK as ko, aL as vs, aM as ys, aN as Mc, aO as Uc, aP as Oc, aQ as Pc, aR as Fc, aS as zc, aT as Wc, aU as Hc, aV as Lc, aW as Kc, aX as Vc, aY as jc, aZ as Gc, a_ as qc, a$ as Yc, b0 as bo, b1 as Nr, b2 as Rr, b3 as Br, b4 as Xc, b5 as Zc, b6 as Io, b7 as So, b8 as Eo, H as wo, O as _c, Q as $c, b9 as ed, ba as td, bb as nd, bc as rd, bd as sd, be as ad, bf as js, bg as Gs, bh as No, bi as qs, bj as Ys, bk as Ro, bl as Bo, bm as xo, _ as To, bn as od, bo as id, bp as Do, bq as Jo, br as ks, bs, a1 as ld, b as cd, C as dd, bt as ud, bu as hd, bv as Ad, bw as pd } from "./index-O6YxrN1Z.js";
|
|
4
4
|
import * as A from "react";
|
|
5
|
-
import Te, { createContext as fn, useContext as gt, useCallback as J, useRef as _, useState as j, useLayoutEffect as Qo, memo as Ge, forwardRef as Cn, useEffect as le, useMemo as
|
|
5
|
+
import Te, { createContext as fn, useContext as gt, useCallback as J, useRef as _, useState as j, useLayoutEffect as Qo, memo as Ge, forwardRef as Cn, useEffect as le, useMemo as oe, Children as gd, useImperativeHandle as md, Fragment as fd } from "react";
|
|
6
6
|
import { bd as xr, e7 as Mo, aJ as Cd, kq as vd, gY as Tr, kr as yd, ck as kd, G as bd, y as Id, cr as Sd, aR as Xs, C as Dr, bX as Ed, e8 as vn, eR as Uo, ks as wd, kt as Nd, iu as Rd, gz as Oo, gU as Po, g3 as Bd, aV as xd, ir as Td, fz as Is, b as Ss, cO as Rt, c7 as Dd, d_ as Jd, jo as Qd, ib as Md, el as Ud, ek as Zs, iV as _s, kj as Fo, gE as zo, ef as An, Z as $s, cJ as ea, k8 as Od, k6 as Es, iF as Pd, fe as Wo, jU as Fd, iM as zd, iN as Wd, ku as Hd, hH as ta, fn as Oa, i0 as ns, fm as Pa, dM as Ld, hG as Kd, f0 as Vd, hs as jd, d6 as Gd, jw as qd, N as Yd, it as Xd, g_ as Ho, e6 as Lo, is as Ko, dZ as Zd, k9 as Fa, aQ as _d, aT as $d, fr as eu, A as tu } from "./ChordGrid4Icon-2Br7uolD.js";
|
|
7
7
|
import { useSensors as nu, useSensor as ru, PointerSensor as su, pointerWithin as au, useDndMonitor as ou, useDroppable as Vo, DndContext as iu, DragOverlay as lu } from "@dnd-kit/core";
|
|
8
8
|
import { snapCenterToCursor as cu } from "@dnd-kit/modifiers";
|
|
@@ -218,9 +218,9 @@ var nt = 10, [ti, Ut] = yn($t), Iu = "SelectContentImpl", Su = mc("SelectContent
|
|
|
218
218
|
}, [I]), hc();
|
|
219
219
|
const V = A.useCallback(
|
|
220
220
|
(M) => {
|
|
221
|
-
const [L, ...ie] = D().map((ee) => ee.ref.current), [ce] = ie.slice(-1),
|
|
221
|
+
const [L, ...ie] = D().map((ee) => ee.ref.current), [ce] = ie.slice(-1), ae = document.activeElement;
|
|
222
222
|
for (const ee of M)
|
|
223
|
-
if (ee ===
|
|
223
|
+
if (ee === ae || (ee == null || ee.scrollIntoView({ block: "nearest" }), ee === L && E && (E.scrollTop = 0), ee === ce && E && (E.scrollTop = E.scrollHeight), ee == null || ee.focus(), document.activeElement !== ae)) return;
|
|
224
224
|
},
|
|
225
225
|
[D, E]
|
|
226
226
|
), $ = A.useCallback(
|
|
@@ -235,9 +235,9 @@ var nt = 10, [ti, Ut] = yn($t), Iu = "SelectContentImpl", Su = mc("SelectContent
|
|
|
235
235
|
if (I) {
|
|
236
236
|
let M = { x: 0, y: 0 };
|
|
237
237
|
const L = (ce) => {
|
|
238
|
-
var
|
|
238
|
+
var ae, ee;
|
|
239
239
|
M = {
|
|
240
|
-
x: Math.abs(Math.round(ce.pageX) - (((
|
|
240
|
+
x: Math.abs(Math.round(ce.pageX) - (((ae = W.current) == null ? void 0 : ae.x) ?? 0)),
|
|
241
241
|
y: Math.abs(Math.round(ce.pageY) - (((ee = W.current) == null ? void 0 : ee.y) ?? 0))
|
|
242
242
|
};
|
|
243
243
|
}, ie = (ce) => {
|
|
@@ -254,7 +254,7 @@ var nt = 10, [ti, Ut] = yn($t), Iu = "SelectContentImpl", Su = mc("SelectContent
|
|
|
254
254
|
};
|
|
255
255
|
}, [G]);
|
|
256
256
|
const [q, he] = Ci((M) => {
|
|
257
|
-
const L = D().filter((
|
|
257
|
+
const L = D().filter((ae) => !ae.disabled), ie = L.find((ae) => ae.ref.current === document.activeElement), ce = vi(L, M, ie);
|
|
258
258
|
ce && setTimeout(() => ce.ref.current.focus());
|
|
259
259
|
}), de = A.useCallback(
|
|
260
260
|
(M, L, ie) => {
|
|
@@ -340,9 +340,9 @@ var nt = 10, [ti, Ut] = yn($t), Iu = "SelectContentImpl", Su = mc("SelectContent
|
|
|
340
340
|
onKeyDown: be(y.onKeyDown, (M) => {
|
|
341
341
|
const L = M.ctrlKey || M.altKey || M.metaKey;
|
|
342
342
|
if (M.key === "Tab" && M.preventDefault(), !L && M.key.length === 1 && he(M.key), ["ArrowUp", "ArrowDown", "Home", "End"].includes(M.key)) {
|
|
343
|
-
let ce = D().filter((
|
|
343
|
+
let ce = D().filter((ae) => !ae.disabled).map((ae) => ae.ref.current);
|
|
344
344
|
if (["ArrowUp", "End"].includes(M.key) && (ce = ce.slice().reverse()), ["ArrowUp", "ArrowDown"].includes(M.key)) {
|
|
345
|
-
const
|
|
345
|
+
const ae = M.target, ee = ce.indexOf(ae);
|
|
346
346
|
ce = ce.slice(ee + 1);
|
|
347
347
|
}
|
|
348
348
|
setTimeout(() => V(ce)), M.preventDefault();
|
|
@@ -364,7 +364,7 @@ var Eu = "SelectItemAlignedPosition", ri = A.forwardRef((n, t) => {
|
|
|
364
364
|
if (i.trigger && i.valueNode && c && u && f && k && y) {
|
|
365
365
|
const B = i.trigger.getBoundingClientRect(), x = u.getBoundingClientRect(), P = i.valueNode.getBoundingClientRect(), T = y.getBoundingClientRect();
|
|
366
366
|
if (i.dir !== "rtl") {
|
|
367
|
-
const
|
|
367
|
+
const ae = T.left - x.left, ee = P.left - ae, Ie = B.left - ee, Se = B.width + Ie, Ve = Math.max(Se, x.width), me = window.innerWidth - nt, ze = yr(ee, [
|
|
368
368
|
nt,
|
|
369
369
|
// Prevents the content from going off the starting edge of the
|
|
370
370
|
// viewport. It may still go off the ending edge, but this can be
|
|
@@ -375,7 +375,7 @@ var Eu = "SelectItemAlignedPosition", ri = A.forwardRef((n, t) => {
|
|
|
375
375
|
]);
|
|
376
376
|
c.style.minWidth = Se + "px", c.style.left = ze + "px";
|
|
377
377
|
} else {
|
|
378
|
-
const
|
|
378
|
+
const ae = x.right - T.right, ee = window.innerWidth - P.right - ae, Ie = window.innerWidth - B.right - ee, Se = B.width + Ie, Ve = Math.max(Se, x.width), me = window.innerWidth - nt, ze = yr(ee, [
|
|
379
379
|
nt,
|
|
380
380
|
Math.max(nt, me - Ve)
|
|
381
381
|
]);
|
|
@@ -383,21 +383,21 @@ var Eu = "SelectItemAlignedPosition", ri = A.forwardRef((n, t) => {
|
|
|
383
383
|
}
|
|
384
384
|
const Q = g(), D = window.innerHeight - nt * 2, z = f.scrollHeight, U = window.getComputedStyle(u), O = parseInt(U.borderTopWidth, 10), V = parseInt(U.paddingTop, 10), $ = parseInt(U.borderBottomWidth, 10), G = parseInt(U.paddingBottom, 10), W = O + V + z + G + $, q = Math.min(k.offsetHeight * 5, W), he = window.getComputedStyle(f), de = parseInt(he.paddingTop, 10), ge = parseInt(he.paddingBottom, 10), K = B.top + B.height / 2 - nt, X = D - K, F = k.offsetHeight / 2, M = k.offsetTop + F, L = O + V + M, ie = W - L;
|
|
385
385
|
if (L <= K) {
|
|
386
|
-
const
|
|
386
|
+
const ae = Q.length > 0 && k === Q[Q.length - 1].ref.current;
|
|
387
387
|
c.style.bottom = "0px";
|
|
388
388
|
const ee = u.clientHeight - f.offsetTop - f.offsetHeight, Ie = Math.max(
|
|
389
389
|
X,
|
|
390
390
|
F + // viewport might have padding bottom, include it to avoid a scrollable viewport
|
|
391
|
-
(
|
|
391
|
+
(ae ? ge : 0) + ee + $
|
|
392
392
|
), Se = L + Ie;
|
|
393
393
|
c.style.height = Se + "px";
|
|
394
394
|
} else {
|
|
395
|
-
const
|
|
395
|
+
const ae = Q.length > 0 && k === Q[0].ref.current;
|
|
396
396
|
c.style.top = "0px";
|
|
397
397
|
const Ie = Math.max(
|
|
398
398
|
K,
|
|
399
399
|
O + f.offsetTop + // viewport might have padding top, include it to avoid a scrollable viewport
|
|
400
|
-
(
|
|
400
|
+
(ae ? de : 0) + F
|
|
401
401
|
) + ie;
|
|
402
402
|
c.style.height = Ie + "px", f.scrollTop = L - K + f.offsetTop;
|
|
403
403
|
}
|
|
@@ -3081,7 +3081,7 @@ const Xf = "_DataTable_kyf7f_1", Zf = "_titleText_kyf7f_23", _f = "_artistText_k
|
|
|
3081
3081
|
ru(su, {
|
|
3082
3082
|
activationConstraint: { distance: 6 }
|
|
3083
3083
|
})
|
|
3084
|
-
), f =
|
|
3084
|
+
), f = oe(
|
|
3085
3085
|
() => new Map(n.map((B) => [B.id, B])),
|
|
3086
3086
|
[n]
|
|
3087
3087
|
), k = J(() => {
|
|
@@ -3146,7 +3146,7 @@ const Xf = "_DataTable_kyf7f_1", Zf = "_titleText_kyf7f_23", _f = "_artistText_k
|
|
|
3146
3146
|
f,
|
|
3147
3147
|
t
|
|
3148
3148
|
]
|
|
3149
|
-
), E =
|
|
3149
|
+
), E = oe(
|
|
3150
3150
|
() => ({
|
|
3151
3151
|
sensors: m,
|
|
3152
3152
|
collisionDetection: au,
|
|
@@ -3156,7 +3156,7 @@ const Xf = "_DataTable_kyf7f_1", Zf = "_titleText_kyf7f_23", _f = "_artistText_k
|
|
|
3156
3156
|
onDragEnd: N
|
|
3157
3157
|
}),
|
|
3158
3158
|
[I, N, R, y, m]
|
|
3159
|
-
), w =
|
|
3159
|
+
), w = oe(
|
|
3160
3160
|
() => ({
|
|
3161
3161
|
onDragStart: y,
|
|
3162
3162
|
onDragOver: R,
|
|
@@ -3578,16 +3578,16 @@ const YC = Te.memo(function({
|
|
|
3578
3578
|
...x
|
|
3579
3579
|
}) => {
|
|
3580
3580
|
var Z, Me;
|
|
3581
|
-
const P = _(null), T = c == null ? void 0 : c.field, Q = (Z = t == null ? void 0 : t[0]) == null ? void 0 : Z.id, D = (Me = t == null ? void 0 : t[1]) == null ? void 0 : Me.id, z =
|
|
3581
|
+
const P = _(null), T = c == null ? void 0 : c.field, Q = (Z = t == null ? void 0 : t[0]) == null ? void 0 : Z.id, D = (Me = t == null ? void 0 : t[1]) == null ? void 0 : Me.id, z = oe(() => {
|
|
3582
3582
|
if (t != null && t.length)
|
|
3583
3583
|
return !T || T === Q ? D : T;
|
|
3584
|
-
}, [t, T, Q, D]), U =
|
|
3584
|
+
}, [t, T, Q, D]), U = oe(
|
|
3585
3585
|
() => r.map((fe, Ce) => OC(fe, Ce)),
|
|
3586
3586
|
[r]
|
|
3587
|
-
), O =
|
|
3587
|
+
), O = oe(
|
|
3588
3588
|
() => new Set((s ?? []).map((fe) => String(fe))),
|
|
3589
3589
|
[s]
|
|
3590
|
-
), V =
|
|
3590
|
+
), V = oe(
|
|
3591
3591
|
() => U.filter((fe) => fe.id && O.has(fe.id)),
|
|
3592
3592
|
[U, O]
|
|
3593
3593
|
), $ = J(
|
|
@@ -3596,7 +3596,7 @@ const YC = Te.memo(function({
|
|
|
3596
3596
|
return Ee != null && O.has(Ee);
|
|
3597
3597
|
},
|
|
3598
3598
|
[O]
|
|
3599
|
-
), G = s.length, W = (r == null ? void 0 : r.length) ?? 0, q = G > 0, he = W > 0 && G === W, de =
|
|
3599
|
+
), G = s.length, W = (r == null ? void 0 : r.length) ?? 0, q = G > 0, he = W > 0 && G === W, de = oe(
|
|
3600
3600
|
() => r == null ? void 0 : r.some((fe) => {
|
|
3601
3601
|
var Ce;
|
|
3602
3602
|
return (Ce = fe.dropdownOptions) == null ? void 0 : Ce.length;
|
|
@@ -3630,7 +3630,7 @@ const YC = Te.memo(function({
|
|
|
3630
3630
|
overDragRowId: L,
|
|
3631
3631
|
activeDragContext: ie,
|
|
3632
3632
|
sortableItems: ce,
|
|
3633
|
-
monitorHandlers:
|
|
3633
|
+
monitorHandlers: ae
|
|
3634
3634
|
} = KC({
|
|
3635
3635
|
rows: U,
|
|
3636
3636
|
selectedSet: O,
|
|
@@ -3640,8 +3640,8 @@ const YC = Te.memo(function({
|
|
|
3640
3640
|
onRowDragStart: k,
|
|
3641
3641
|
onRowDragEnd: R,
|
|
3642
3642
|
dndScopeId: B
|
|
3643
|
-
}), ee = _(
|
|
3644
|
-
ee.current =
|
|
3643
|
+
}), ee = _(ae);
|
|
3644
|
+
ee.current = ae;
|
|
3645
3645
|
const { style: Ie, ...Se } = x, Ve = typeof h == "number" ? `${h}px` : h, me = typeof g == "number" ? `${g}px` : g, ze = /* @__PURE__ */ v(
|
|
3646
3646
|
Ba,
|
|
3647
3647
|
{
|
|
@@ -4355,7 +4355,7 @@ function zv(n, t) {
|
|
|
4355
4355
|
function Wv({ initialScreen: n, animated: t, children: r }) {
|
|
4356
4356
|
const [s, o] = j([{ name: n, params: {} }]), [i, l] = j({}), [c, d] = j(0), u = _(s), p = _(null);
|
|
4357
4357
|
u.current = s;
|
|
4358
|
-
const h =
|
|
4358
|
+
const h = oe(() => {
|
|
4359
4359
|
const Q = {};
|
|
4360
4360
|
return gd.forEach(r, (D) => {
|
|
4361
4361
|
(D == null ? void 0 : D.type) === Jl && (Q[D.props.name] = D.props);
|
|
@@ -4378,12 +4378,12 @@ function Wv({ initialScreen: n, animated: t, children: r }) {
|
|
|
4378
4378
|
), k = J(
|
|
4379
4379
|
(Q) => g(() => [{ name: Q || n, params: {} }]),
|
|
4380
4380
|
[g, n]
|
|
4381
|
-
), y = s.length > 1, R =
|
|
4381
|
+
), y = s.length > 1, R = oe(
|
|
4382
4382
|
() => ({ push: C, pop: m, popTo: f, reset: k, canGoBack: y, stack: s }),
|
|
4383
4383
|
[C, m, f, k, y, s]
|
|
4384
4384
|
), I = s[s.length - 1], N = h[I.name];
|
|
4385
4385
|
if (!N) return null;
|
|
4386
|
-
const E =
|
|
4386
|
+
const E = oe(
|
|
4387
4387
|
() => s.map((Q, D) => {
|
|
4388
4388
|
var z;
|
|
4389
4389
|
return (z = h[Q.name]) != null && z.keepMounted ? { entry: Q, stackIndex: D } : null;
|
|
@@ -4394,7 +4394,7 @@ function Wv({ initialScreen: n, animated: t, children: r }) {
|
|
|
4394
4394
|
u.current[u.current.length - 1].name === I.name && l((z) => ({ ...z, ...Q }));
|
|
4395
4395
|
},
|
|
4396
4396
|
[I.name]
|
|
4397
|
-
), T =
|
|
4397
|
+
), T = oe(
|
|
4398
4398
|
() => ({ name: I.name, params: I.params || {}, setOptions: P }),
|
|
4399
4399
|
[I.name, I.params, P]
|
|
4400
4400
|
);
|
|
@@ -4877,10 +4877,10 @@ const aR = $r, g1 = "_sliderRoot_19e7a_23", m1 = "_sliderTrack_19e7a_31", f1 = "
|
|
|
4877
4877
|
if (N < 1e-3) return -1 / 0;
|
|
4878
4878
|
const E = 20 * Math.log10(N);
|
|
4879
4879
|
return E < -60 ? -60 : E;
|
|
4880
|
-
}, []), d = J((N) => N === -1 / 0 || N <= -60 ? 0 : Math.pow(10, N / 20), []), u =
|
|
4880
|
+
}, []), d = J((N) => N === -1 / 0 || N <= -60 ? 0 : Math.pow(10, N / 20), []), u = oe(() => {
|
|
4881
4881
|
const N = c(t);
|
|
4882
4882
|
return N === -1 / 0 ? -60 : Math.max(-60, Math.min(6, N));
|
|
4883
|
-
}, [t, c]), p =
|
|
4883
|
+
}, [t, c]), p = oe(() => t < 1e-3, [t]), h = J(() => {
|
|
4884
4884
|
clearTimeout(i.current), o(!0);
|
|
4885
4885
|
}, []), g = J(() => {
|
|
4886
4886
|
i.current = setTimeout(() => {
|
|
@@ -4905,7 +4905,7 @@ const aR = $r, g1 = "_sliderRoot_19e7a_23", m1 = "_sliderTrack_19e7a_31", f1 = "
|
|
|
4905
4905
|
}, [n, h]), R = J(() => {
|
|
4906
4906
|
const N = Date.now();
|
|
4907
4907
|
N - l.current < 300 && y(), l.current = N;
|
|
4908
|
-
}, [y]), I =
|
|
4908
|
+
}, [y]), I = oe(
|
|
4909
4909
|
() => /* @__PURE__ */ v(we, { children: [
|
|
4910
4910
|
p ? "-∞ dB" : `${u.toFixed(1)} dB`,
|
|
4911
4911
|
/* @__PURE__ */ a(Ys, { className: Vt.tooltipArrow })
|
|
@@ -5288,14 +5288,14 @@ const Z1 = Cn(function({
|
|
|
5288
5288
|
className: d,
|
|
5289
5289
|
...u
|
|
5290
5290
|
}, p) {
|
|
5291
|
-
const h = o ?? i, g =
|
|
5291
|
+
const h = o ?? i, g = oe(() => {
|
|
5292
5292
|
if (typeof c == "number") return c;
|
|
5293
5293
|
if (c && typeof c == "object") {
|
|
5294
5294
|
const m = c.initial, f = typeof m == "string" ? parseInt(m, 10) : m;
|
|
5295
5295
|
return Number.isFinite(f) ? f : 2;
|
|
5296
5296
|
}
|
|
5297
5297
|
return 2;
|
|
5298
|
-
}, [c]), C =
|
|
5298
|
+
}, [c]), C = oe(
|
|
5299
5299
|
() => ({ gridTemplateColumns: `repeat(${g}, minmax(0, 1fr))` }),
|
|
5300
5300
|
[g]
|
|
5301
5301
|
);
|
|
@@ -5558,14 +5558,14 @@ const Ar = 19.5, pr = 19.5, $a = 14, eo = 18, ly = [
|
|
|
5558
5558
|
tooltipCloseDelay: d
|
|
5559
5559
|
});
|
|
5560
5560
|
k.current = { tooltipDelayDuration: c, tooltipCloseDelay: d };
|
|
5561
|
-
const y = Array.isArray(i) && i.length > 0, R =
|
|
5561
|
+
const y = Array.isArray(i) && i.length > 0, R = oe(() => (i == null ? void 0 : i.find((W) => W.default)) || (i == null ? void 0 : i[0]) || { position: 0, color: "neutral", default: !0 }, [i]), { containerRef: I, isDragging: N, handleClick: E, handleDotClick: w } = hy({
|
|
5562
5562
|
value: t,
|
|
5563
5563
|
onChange: r,
|
|
5564
5564
|
disabled: s,
|
|
5565
5565
|
dots: i || [],
|
|
5566
5566
|
defaultDot: R,
|
|
5567
5567
|
clickableDots: o
|
|
5568
|
-
}), B =
|
|
5568
|
+
}), B = oe(() => typeof t == "object" && t !== null ? t.position : dy(t, i), [t, i]), x = oe(() => typeof t == "object" && t !== null ? t : (i == null ? void 0 : i.find((W) => W.position === B)) ?? null, [t, i, B]), { pointerRotation: P, pointerColor: T } = oe(() => uy(B, s), [B, s]);
|
|
5569
5569
|
if (le(() => () => {
|
|
5570
5570
|
m.current != null && clearTimeout(m.current), f.current != null && clearTimeout(f.current);
|
|
5571
5571
|
}, []), !y)
|
|
@@ -5866,7 +5866,7 @@ const Wl = ({
|
|
|
5866
5866
|
className: i,
|
|
5867
5867
|
...l
|
|
5868
5868
|
}) => {
|
|
5869
|
-
const c =
|
|
5869
|
+
const c = oe(() => Object.keys(Ws), []), d = oe(() => Object.keys(zs), []), { color: u, graphic: p } = oe(() => {
|
|
5870
5870
|
let m = n, f = t;
|
|
5871
5871
|
if (o) {
|
|
5872
5872
|
const k = qy(o);
|
|
@@ -5881,7 +5881,7 @@ const Wl = ({
|
|
|
5881
5881
|
f = d[k];
|
|
5882
5882
|
}
|
|
5883
5883
|
return { color: m, graphic: f };
|
|
5884
|
-
}, [n, t, o, c, d]), h = Ws[u], g = zs[p], C =
|
|
5884
|
+
}, [n, t, o, c, d]), h = Ws[u], g = zs[p], C = oe(
|
|
5885
5885
|
() => ({
|
|
5886
5886
|
background: h.gradient,
|
|
5887
5887
|
opacity: h.opacity
|
|
@@ -6574,17 +6574,17 @@ const Vk = "_content_15iux_1", jk = "_pan_15iux_13", Gk = "_disabled_15iux_26",
|
|
|
6574
6574
|
}
|
|
6575
6575
|
},
|
|
6576
6576
|
[s, t, B]
|
|
6577
|
-
), { arcPath: U, pointerRotation: O, arcColor: V, pointerColor: $ } =
|
|
6578
|
-
const M = ds(t, o, i), L = cs(M), ie = ls + L * Math.PI, ce = xn + jt * Math.cos(ls),
|
|
6577
|
+
), { arcPath: U, pointerRotation: O, arcColor: V, pointerColor: $ } = oe(() => {
|
|
6578
|
+
const M = ds(t, o, i), L = cs(M), ie = ls + L * Math.PI, ce = xn + jt * Math.cos(ls), ae = Tn + jt * Math.sin(ls), ee = xn + jt * Math.cos(ie), Ie = Tn + jt * Math.sin(ie), Se = 0, Ve = L > 0 ? 1 : 0;
|
|
6579
6579
|
return {
|
|
6580
|
-
arcPath: `M ${ce.toFixed(3)} ${
|
|
6580
|
+
arcPath: `M ${ce.toFixed(3)} ${ae.toFixed(3)}
|
|
6581
6581
|
A ${jt} ${jt} 0 ${Se} ${Ve}
|
|
6582
6582
|
${ee.toFixed(3)} ${Ie.toFixed(3)}`,
|
|
6583
6583
|
pointerRotation: L * 180,
|
|
6584
6584
|
arcColor: s ? "#5A6169" : "#19E4F1",
|
|
6585
6585
|
pointerColor: s ? "#43484E" : "#B0B4BA"
|
|
6586
6586
|
};
|
|
6587
|
-
}, [t, s, o, i]), G =
|
|
6587
|
+
}, [t, s, o, i]), G = oe(() => {
|
|
6588
6588
|
const M = ds(t, o, i), L = Math.round(M * 100);
|
|
6589
6589
|
return `Pan: ${Math.abs(L) < 1 ? 0 : L}`;
|
|
6590
6590
|
}, [t, o, i]), W = cs(ds(t, o, i)), q = Math.round(W * 100), he = () => {
|
|
@@ -8047,7 +8047,7 @@ function v0(n, t) {
|
|
|
8047
8047
|
return r;
|
|
8048
8048
|
}
|
|
8049
8049
|
function y0(n, t) {
|
|
8050
|
-
const [r, s] = j(null), o =
|
|
8050
|
+
const [r, s] = j(null), o = oe(() => v0(t, ["plugins"]), [t]), i = oe(() => Object.entries(o).flat(), [o]);
|
|
8051
8051
|
return le(() => {
|
|
8052
8052
|
if (!(n != null && n.current)) return;
|
|
8053
8053
|
const l = jn.create(Object.assign(Object.assign({}, o), { plugins: t.plugins, container: n.current }));
|
|
@@ -8058,7 +8058,7 @@ function y0(n, t) {
|
|
|
8058
8058
|
}
|
|
8059
8059
|
const Gl = /^on([A-Z])/, k0 = (n) => Gl.test(n);
|
|
8060
8060
|
function b0(n, t) {
|
|
8061
|
-
const r =
|
|
8061
|
+
const r = oe(() => Object.entries(t).flat(), [t]);
|
|
8062
8062
|
le(() => {
|
|
8063
8063
|
if (!n) return;
|
|
8064
8064
|
const s = Object.entries(t);
|
|
@@ -8074,7 +8074,7 @@ function b0(n, t) {
|
|
|
8074
8074
|
}
|
|
8075
8075
|
const ql = Ge((n) => {
|
|
8076
8076
|
const t = _(null), [r, s] = function(o) {
|
|
8077
|
-
return
|
|
8077
|
+
return oe(() => {
|
|
8078
8078
|
const i = Object.assign({}, o), l = Object.assign({}, o);
|
|
8079
8079
|
for (const c in i) k0(c) ? delete i[c] : delete l[c];
|
|
8080
8080
|
return [i, l];
|
|
@@ -8128,11 +8128,11 @@ const ql = Ge((n) => {
|
|
|
8128
8128
|
previousWasPlaying: !1,
|
|
8129
8129
|
wasPlaying: !!((Se = o == null ? void 0 : o.state) != null && Se.isPlaying)
|
|
8130
8130
|
};
|
|
8131
|
-
const ce = (Ve = L.getCurrentTime) == null ? void 0 : Ve.call(L),
|
|
8131
|
+
const ce = (Ve = L.getCurrentTime) == null ? void 0 : Ve.call(L), ae = !!((me = L == null ? void 0 : L.isPlaying) != null && me.call(L)), ee = ae || !!((ze = o == null ? void 0 : o.state) != null && ze.isPlaying);
|
|
8132
8132
|
return L !== M && (L.pause(), D(L)), typeof X == "number" ? K.setTime(X) : F && typeof ce == "number" && K.setTime(ce), {
|
|
8133
8133
|
isHandoff: !0,
|
|
8134
8134
|
previousActive: L,
|
|
8135
|
-
previousWasPlaying:
|
|
8135
|
+
previousWasPlaying: ae,
|
|
8136
8136
|
wasPlaying: ee
|
|
8137
8137
|
};
|
|
8138
8138
|
},
|
|
@@ -8207,7 +8207,7 @@ const ql = Ge((n) => {
|
|
|
8207
8207
|
[D, o]
|
|
8208
8208
|
), q = J(
|
|
8209
8209
|
(K, X) => {
|
|
8210
|
-
var ce,
|
|
8210
|
+
var ce, ae;
|
|
8211
8211
|
if (T || i == null || i(), !o) return;
|
|
8212
8212
|
const F = o.state.active;
|
|
8213
8213
|
if (!(F && F !== K)) {
|
|
@@ -8221,7 +8221,7 @@ const ql = Ge((n) => {
|
|
|
8221
8221
|
const L = typeof X == "number" ? X : ((ce = K.getCurrentTime) == null ? void 0 : ce.call(K)) ?? 0, ie = z(K, {
|
|
8222
8222
|
seekTime: L
|
|
8223
8223
|
});
|
|
8224
|
-
x.current = L, B.current = !0, ie.previousWasPlaying || (
|
|
8224
|
+
x.current = L, B.current = !0, ie.previousWasPlaying || (ae = F.emit) == null || ae.call(F, "pause"), N || K.setOptions({ progressColor: p }), ie.wasPlaying && K.play(), o.setter((ee) => ({
|
|
8225
8225
|
...ee,
|
|
8226
8226
|
active: K,
|
|
8227
8227
|
lastPlayed: K,
|
|
@@ -8522,7 +8522,7 @@ const nb = ({
|
|
|
8522
8522
|
onProjectClick: C,
|
|
8523
8523
|
openedItem: m,
|
|
8524
8524
|
setOpenedItem: f
|
|
8525
|
-
} = gt(ts), [k, y] = j(!1), R =
|
|
8525
|
+
} = gt(ts), [k, y] = j(!1), R = oe(() => k ? i : i.slice(0, 6), [i, k]), I = J(() => {
|
|
8526
8526
|
if (c) return;
|
|
8527
8527
|
y(!1);
|
|
8528
8528
|
const w = h.find((B) => B.id === n);
|
|
@@ -8768,18 +8768,23 @@ const nb = ({
|
|
|
8768
8768
|
...n
|
|
8769
8769
|
}) => {
|
|
8770
8770
|
var N;
|
|
8771
|
-
const { onClickTrack: t } = gt(ts), { projectId: r, id: s, title: o, cover: i, transfers: l, audioUrl: c, onChangeTransfer: d, loading: u } = n, p =
|
|
8771
|
+
const { onClickTrack: t } = gt(ts), { projectId: r, id: s, title: o, cover: i, transfers: l, audioUrl: c, onChangeTransfer: d, loading: u } = n, p = oe(() => l && l.length > 0, [l]), h = 24, g = -24, [C, m] = j(p ? parseInt(((N = l == null ? void 0 : l[0]) == null ? void 0 : N.pitchShift) ?? 0) : 0), [f, k] = j(u);
|
|
8772
8772
|
le(() => {
|
|
8773
|
-
|
|
8774
|
-
|
|
8773
|
+
var E;
|
|
8774
|
+
k(u), !f && p && m(parseInt(((E = l == null ? void 0 : l[0]) == null ? void 0 : E.pitchShift) ?? 0));
|
|
8775
|
+
}, [u, p, l]);
|
|
8775
8776
|
const y = J((E) => {
|
|
8776
8777
|
var w;
|
|
8777
8778
|
return p ? (w = l == null ? void 0 : l.find((B) => parseInt(B.pitchShift) === E)) == null ? void 0 : w.audioUrl : c;
|
|
8778
8779
|
}, [p, l, c]), R = J((E) => {
|
|
8779
|
-
|
|
8780
|
+
m(E);
|
|
8781
|
+
const w = y(E);
|
|
8782
|
+
d == null || d(r, {
|
|
8780
8783
|
id: s,
|
|
8781
8784
|
title: o,
|
|
8782
|
-
audioUrl:
|
|
8785
|
+
audioUrl: w,
|
|
8786
|
+
processTrack: !w,
|
|
8787
|
+
pitchShift: E
|
|
8783
8788
|
});
|
|
8784
8789
|
}, [d, r, s, o, l]), I = J((E) => {
|
|
8785
8790
|
if (E.stopPropagation(), f)
|
|
@@ -8789,10 +8794,10 @@ const nb = ({
|
|
|
8789
8794
|
...n,
|
|
8790
8795
|
id: s,
|
|
8791
8796
|
title: o,
|
|
8792
|
-
audioUrl: p || c ? y(
|
|
8797
|
+
audioUrl: p || c ? y(C) : null,
|
|
8793
8798
|
processTrack: w
|
|
8794
8799
|
});
|
|
8795
|
-
}, [t, n, s, o, y,
|
|
8800
|
+
}, [t, n, s, o, y, C, p, f, c]);
|
|
8796
8801
|
return /* @__PURE__ */ a(S, { direction: "column", gap: "1", children: /* @__PURE__ */ v(
|
|
8797
8802
|
S,
|
|
8798
8803
|
{
|
|
@@ -8819,9 +8824,9 @@ const nb = ({
|
|
|
8819
8824
|
!p && !c && !f ? /* @__PURE__ */ a(S, { align: "center", justify: "center", p: "2", children: /* @__PURE__ */ a(Oe, { variant: "soft", color: "gray", size: "1", children: "Process" }) }) : f ? /* @__PURE__ */ a(S, { align: "center", justify: "center", p: "2", children: /* @__PURE__ */ a(Sn, {}) }) : /* @__PURE__ */ a(
|
|
8820
8825
|
Cb,
|
|
8821
8826
|
{
|
|
8822
|
-
min:
|
|
8823
|
-
max:
|
|
8824
|
-
value:
|
|
8827
|
+
min: g,
|
|
8828
|
+
max: h,
|
|
8829
|
+
value: C,
|
|
8825
8830
|
onChange: R
|
|
8826
8831
|
}
|
|
8827
8832
|
)
|
|
@@ -9838,7 +9843,7 @@ const Zl = ({
|
|
|
9838
9843
|
}, L);
|
|
9839
9844
|
}, ce = () => {
|
|
9840
9845
|
p && (U.current && (clearTimeout(U.current), U.current = null), x ? P(!1) : w || ie());
|
|
9841
|
-
},
|
|
9846
|
+
}, ae = () => {
|
|
9842
9847
|
p && w && (O.current && (clearTimeout(O.current), O.current = null), Q(!1), P(!0), U.current = setTimeout(() => {
|
|
9843
9848
|
U.current = null, B(!1), P(!1);
|
|
9844
9849
|
}, L));
|
|
@@ -9937,7 +9942,7 @@ const Zl = ({
|
|
|
9937
9942
|
ref: V,
|
|
9938
9943
|
className: b(se.hoverRegion, se.scrollShadow),
|
|
9939
9944
|
onMouseEnter: ce,
|
|
9940
|
-
onMouseLeave:
|
|
9945
|
+
onMouseLeave: ae,
|
|
9941
9946
|
onFocusCapture: Ie,
|
|
9942
9947
|
onBlurCapture: Se,
|
|
9943
9948
|
children: /* @__PURE__ */ v(
|
|
@@ -10509,12 +10514,12 @@ const sE = "_sectionTitle_bwlze_1", aE = "_separator_bwlze_17", co = {
|
|
|
10509
10514
|
}, []), le(() => {
|
|
10510
10515
|
const F = k.current;
|
|
10511
10516
|
if (!F) return;
|
|
10512
|
-
const M = 24, L = 150, ie = 50, ce = (
|
|
10517
|
+
const M = 24, L = 150, ie = 50, ce = (ae) => {
|
|
10513
10518
|
var fe, Ce;
|
|
10514
10519
|
const ee = T.current;
|
|
10515
10520
|
if (ee.disabled) return;
|
|
10516
|
-
|
|
10517
|
-
const { deltaX: Ie, deltaY: Se, deltaMode: Ve } =
|
|
10521
|
+
ae.preventDefault();
|
|
10522
|
+
const { deltaX: Ie, deltaY: Se, deltaMode: Ve } = ae, me = D.current, ze = (Ee) => Math.min(ee.max, Math.max(ee.min, Ee));
|
|
10518
10523
|
if (Ve !== 0 || Math.max(Math.abs(Ie), Math.abs(Se)) >= ie) {
|
|
10519
10524
|
me.accum = 0, me.axis = null;
|
|
10520
10525
|
const Ee = Math.abs(Ie) > Math.abs(Se) ? Ie : -Se;
|
|
@@ -10523,7 +10528,7 @@ const sE = "_sectionTitle_bwlze_1", aE = "_separator_bwlze_17", co = {
|
|
|
10523
10528
|
$e !== ee.value && ((fe = ee.onValueChange) == null || fe.call(ee, $e));
|
|
10524
10529
|
return;
|
|
10525
10530
|
}
|
|
10526
|
-
if (
|
|
10531
|
+
if (ae.timeStamp - me.lastTime > L && (me.accum = 0, me.axis = null), me.lastTime = ae.timeStamp, me.axis === null) {
|
|
10527
10532
|
if (Ie === 0 && Se === 0) return;
|
|
10528
10533
|
me.axis = Math.abs(Ie) > Math.abs(Se) ? "x" : "y";
|
|
10529
10534
|
}
|
|
@@ -11058,7 +11063,7 @@ const dr = (n) => {
|
|
|
11058
11063
|
handlePresetChange: t,
|
|
11059
11064
|
presets: r
|
|
11060
11065
|
}) => {
|
|
11061
|
-
const s =
|
|
11066
|
+
const s = oe(() => r.filter(
|
|
11062
11067
|
(o) => o.instrument === n.instrument
|
|
11063
11068
|
), [r, n.instrument]);
|
|
11064
11069
|
return /* @__PURE__ */ a(
|
|
@@ -11470,12 +11475,12 @@ const fr = {
|
|
|
11470
11475
|
onFetchSuggestedTags: x,
|
|
11471
11476
|
suggestedTagsLoading: P
|
|
11472
11477
|
}) => {
|
|
11473
|
-
const [T, Q] = j(!1), [D, z] = j("2"), [U, O] = j(D), { submitted: V, handleSubmit: $ } = Ma(d), G =
|
|
11478
|
+
const [T, Q] = j(!1), [D, z] = j("2"), [U, O] = j(D), { submitted: V, handleSubmit: $ } = Ma(d), G = oe(() => [
|
|
11474
11479
|
{ value: "2", label: l._("Presets") },
|
|
11475
11480
|
{ value: "1", label: l._("Custom") }
|
|
11476
11481
|
], []), W = (r ?? []).some(
|
|
11477
11482
|
(X) => X.instrument === n.instrument
|
|
11478
|
-
), q =
|
|
11483
|
+
), q = oe(() => {
|
|
11479
11484
|
const X = D === "2" && W, F = D === "1" || !W;
|
|
11480
11485
|
return u || k === 0 || X && !n.presetId || F && !n.conditioningText && !n.conditioningAudio;
|
|
11481
11486
|
}, [
|
|
@@ -11486,7 +11491,7 @@ const fr = {
|
|
|
11486
11491
|
n.presetId,
|
|
11487
11492
|
n.conditioningText,
|
|
11488
11493
|
n.conditioningAudio
|
|
11489
|
-
]), he =
|
|
11494
|
+
]), he = oe(
|
|
11490
11495
|
() => RE(l),
|
|
11491
11496
|
[l]
|
|
11492
11497
|
), de = J(
|
|
@@ -12633,7 +12638,7 @@ const ms = (n, t) => typeof n == "string" ? { title: n, description: "", variant
|
|
|
12633
12638
|
), g = J(
|
|
12634
12639
|
(m) => p(ms(m, "error")),
|
|
12635
12640
|
[p]
|
|
12636
|
-
), C =
|
|
12641
|
+
), C = oe(
|
|
12637
12642
|
() => ({
|
|
12638
12643
|
show: p,
|
|
12639
12644
|
success: h,
|
|
@@ -13275,7 +13280,7 @@ function ac({
|
|
|
13275
13280
|
le(() => {
|
|
13276
13281
|
typeof navigator < "u" && w(/^((?!chrome|android).)*safari/i.test(navigator.userAgent));
|
|
13277
13282
|
}, []);
|
|
13278
|
-
const B =
|
|
13283
|
+
const B = oe(() => s, [s]), x = oe(() => o ? !1 : !B || B && f, [B, f, o]), P = _(null), T = _(null);
|
|
13279
13284
|
le(() => {
|
|
13280
13285
|
I || (!p || i) && N(!0);
|
|
13281
13286
|
}, [p, i, I]);
|
|
@@ -13783,16 +13788,16 @@ const MN = "_footerVoiceForm_lsc2c_2", UN = {
|
|
|
13783
13788
|
})), s(O);
|
|
13784
13789
|
},
|
|
13785
13790
|
[s, w]
|
|
13786
|
-
), Q =
|
|
13791
|
+
), Q = oe(
|
|
13787
13792
|
() => ({
|
|
13788
13793
|
state: w,
|
|
13789
13794
|
setter: B
|
|
13790
13795
|
}),
|
|
13791
13796
|
[w]
|
|
13792
|
-
), D =
|
|
13797
|
+
), D = oe(
|
|
13793
13798
|
() => n.find((O) => O.identifier === i) || n[0],
|
|
13794
13799
|
[n, i]
|
|
13795
|
-
), z =
|
|
13800
|
+
), z = oe(
|
|
13796
13801
|
() => !!(t.trackName || t.trackId || t.customAudio),
|
|
13797
13802
|
[t.trackName, t.trackId, t.customAudio]
|
|
13798
13803
|
), U = J(() => {
|
package/package.json
CHANGED
|
@@ -15,15 +15,19 @@ const ProjectTrackVoice = ({
|
|
|
15
15
|
|
|
16
16
|
const hasTransfers = useMemo(() => transfers && transfers.length > 0, [transfers])
|
|
17
17
|
|
|
18
|
+
const max = 24
|
|
19
|
+
const min = -24
|
|
18
20
|
const [pitchShiftSelected, setpitchShiftSelected] = useState(hasTransfers ? parseInt(transfers?.[0]?.pitchShift ?? 0) : 0)
|
|
19
|
-
const min = useMemo(() => hasTransfers ? Math.min(...transfers?.map((transfer) => parseInt(transfer.pitchShift))) : 0, [transfers])
|
|
20
|
-
const max = useMemo(() => hasTransfers ? Math.max(...transfers?.map((transfer) => parseInt(transfer.pitchShift))) : 0, [transfers])
|
|
21
21
|
|
|
22
22
|
const [loading, setLoading] = useState(_loading)
|
|
23
23
|
|
|
24
24
|
useEffect(() => {
|
|
25
25
|
setLoading(_loading)
|
|
26
|
-
|
|
26
|
+
|
|
27
|
+
if (!loading && hasTransfers) {
|
|
28
|
+
setpitchShiftSelected(parseInt(transfers?.[0]?.pitchShift ?? 0))
|
|
29
|
+
}
|
|
30
|
+
}, [_loading, hasTransfers, transfers])
|
|
27
31
|
|
|
28
32
|
const getAudioUrl = useCallback((pitchShift) => {
|
|
29
33
|
return hasTransfers ? transfers?.find((transfer) => parseInt(transfer.pitchShift) === pitchShift)?.audioUrl : audioUrl
|
|
@@ -31,10 +35,13 @@ const ProjectTrackVoice = ({
|
|
|
31
35
|
|
|
32
36
|
const handleChangeTransfer = useCallback((value) => {
|
|
33
37
|
setpitchShiftSelected(value)
|
|
38
|
+
const newAudioUrl = getAudioUrl(value)
|
|
34
39
|
onChangeTransfer?.(projectId, {
|
|
35
40
|
id,
|
|
36
41
|
title,
|
|
37
|
-
audioUrl:
|
|
42
|
+
audioUrl: newAudioUrl,
|
|
43
|
+
processTrack: !newAudioUrl,
|
|
44
|
+
pitchShift: value,
|
|
38
45
|
})
|
|
39
46
|
}, [onChangeTransfer, projectId, id, title, transfers])
|
|
40
47
|
|