@1urso/generic-editor 0.1.68 → 0.1.69
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/generic-editor.js +1242 -1147
- package/dist/generic-editor.umd.cjs +14 -13
- package/package.json +1 -1
package/dist/generic-editor.js
CHANGED
|
@@ -987,15 +987,15 @@ var DISMISSABLE_LAYER_NAME = "DismissableLayer", CONTEXT_UPDATE = "dismissableLa
|
|
|
987
987
|
layersWithOutsidePointerEventsDisabled: /* @__PURE__ */ new Set(),
|
|
988
988
|
branches: /* @__PURE__ */ new Set()
|
|
989
989
|
}), DismissableLayer = React$1.forwardRef((_, E) => {
|
|
990
|
-
let { disableOutsidePointerEvents: O = !1, onEscapeKeyDown: A, onPointerDownOutside: j, onFocusOutside: M, onInteractOutside: N, onDismiss: P, ...z } = _, B = React$1.useContext(DismissableLayerContext), [H, U] = React$1.useState(null), W = H?.ownerDocument ?? globalThis?.document, [, G] = React$1.useState({}), Z = useComposedRefs$1(E, (n) => U(n)),
|
|
990
|
+
let { disableOutsidePointerEvents: O = !1, onEscapeKeyDown: A, onPointerDownOutside: j, onFocusOutside: M, onInteractOutside: N, onDismiss: P, ...z } = _, B = React$1.useContext(DismissableLayerContext), [H, U] = React$1.useState(null), W = H?.ownerDocument ?? globalThis?.document, [, G] = React$1.useState({}), Z = useComposedRefs$1(E, (n) => U(n)), qF = Array.from(B.layers), [JF] = [...B.layersWithOutsidePointerEventsDisabled].slice(-1), YF = qF.indexOf(JF), XF = H ? qF.indexOf(H) : -1, ZF = B.layersWithOutsidePointerEventsDisabled.size > 0, QF = XF >= YF, $F = usePointerDownOutside((n) => {
|
|
991
991
|
let _ = n.target, E = [...B.branches].some((n) => n.contains(_));
|
|
992
|
-
!
|
|
993
|
-
}, W),
|
|
992
|
+
!QF || E || (j?.(n), N?.(n), n.defaultPrevented || P?.());
|
|
993
|
+
}, W), eI = useFocusOutside((n) => {
|
|
994
994
|
let _ = n.target;
|
|
995
995
|
[...B.branches].some((n) => n.contains(_)) || (M?.(n), N?.(n), n.defaultPrevented || P?.());
|
|
996
996
|
}, W);
|
|
997
997
|
return useEscapeKeydown((n) => {
|
|
998
|
-
|
|
998
|
+
XF === B.layers.size - 1 && (A?.(n), !n.defaultPrevented && P && (n.preventDefault(), P()));
|
|
999
999
|
}, W), React$1.useEffect(() => {
|
|
1000
1000
|
if (H) return O && (B.layersWithOutsidePointerEventsDisabled.size === 0 && (originalBodyPointerEvents = W.body.style.pointerEvents, W.body.style.pointerEvents = "none"), B.layersWithOutsidePointerEventsDisabled.add(H)), B.layers.add(H), dispatchUpdate(), () => {
|
|
1001
1001
|
O && B.layersWithOutsidePointerEventsDisabled.size === 1 && (W.body.style.pointerEvents = originalBodyPointerEvents);
|
|
@@ -1014,12 +1014,12 @@ var DISMISSABLE_LAYER_NAME = "DismissableLayer", CONTEXT_UPDATE = "dismissableLa
|
|
|
1014
1014
|
...z,
|
|
1015
1015
|
ref: Z,
|
|
1016
1016
|
style: {
|
|
1017
|
-
pointerEvents:
|
|
1017
|
+
pointerEvents: ZF ? QF ? "auto" : "none" : void 0,
|
|
1018
1018
|
..._.style
|
|
1019
1019
|
},
|
|
1020
|
-
onFocusCapture: composeEventHandlers(_.onFocusCapture,
|
|
1021
|
-
onBlurCapture: composeEventHandlers(_.onBlurCapture,
|
|
1022
|
-
onPointerDownCapture: composeEventHandlers(_.onPointerDownCapture,
|
|
1020
|
+
onFocusCapture: composeEventHandlers(_.onFocusCapture, eI.onFocusCapture),
|
|
1021
|
+
onBlurCapture: composeEventHandlers(_.onBlurCapture, eI.onBlurCapture),
|
|
1022
|
+
onPointerDownCapture: composeEventHandlers(_.onPointerDownCapture, $F.onPointerDownCapture)
|
|
1023
1023
|
});
|
|
1024
1024
|
});
|
|
1025
1025
|
DismissableLayer.displayName = DISMISSABLE_LAYER_NAME;
|
|
@@ -1378,7 +1378,7 @@ var effectCar = createSidecarMedium(), nothing = function() {}, RemoveScroll = R
|
|
|
1378
1378
|
onScrollCapture: nothing,
|
|
1379
1379
|
onWheelCapture: nothing,
|
|
1380
1380
|
onTouchMoveCapture: nothing
|
|
1381
|
-
}), j = A[0], M = A[1], N = _.forwardProps, P = _.children, z = _.className, B = _.removeScrollBar, H = _.enabled, U = _.shards, W = _.sideCar, G = _.noRelative, Z = _.noIsolation,
|
|
1381
|
+
}), j = A[0], M = A[1], N = _.forwardProps, P = _.children, z = _.className, B = _.removeScrollBar, H = _.enabled, U = _.shards, W = _.sideCar, G = _.noRelative, Z = _.noIsolation, qF = _.inert, JF = _.allowPinchZoom, YF = _.as, XF = YF === void 0 ? "div" : YF, ZF = _.gapMode, QF = __rest(_, [
|
|
1382
1382
|
"forwardProps",
|
|
1383
1383
|
"children",
|
|
1384
1384
|
"className",
|
|
@@ -1392,21 +1392,21 @@ var effectCar = createSidecarMedium(), nothing = function() {}, RemoveScroll = R
|
|
|
1392
1392
|
"allowPinchZoom",
|
|
1393
1393
|
"as",
|
|
1394
1394
|
"gapMode"
|
|
1395
|
-
]),
|
|
1396
|
-
return React$1.createElement(React$1.Fragment, null, H && React$1.createElement(
|
|
1395
|
+
]), $F = W, eI = useMergeRefs([O, E]), tI = __assign$2(__assign$2({}, QF), j);
|
|
1396
|
+
return React$1.createElement(React$1.Fragment, null, H && React$1.createElement($F, {
|
|
1397
1397
|
sideCar: effectCar,
|
|
1398
1398
|
removeScrollBar: B,
|
|
1399
1399
|
shards: U,
|
|
1400
1400
|
noRelative: G,
|
|
1401
1401
|
noIsolation: Z,
|
|
1402
|
-
inert:
|
|
1402
|
+
inert: qF,
|
|
1403
1403
|
setCallbacks: M,
|
|
1404
|
-
allowPinchZoom: !!
|
|
1404
|
+
allowPinchZoom: !!JF,
|
|
1405
1405
|
lockRef: O,
|
|
1406
|
-
gapMode:
|
|
1407
|
-
}), N ? React$1.cloneElement(React$1.Children.only(P), __assign$2(__assign$2({},
|
|
1406
|
+
gapMode: ZF
|
|
1407
|
+
}), N ? React$1.cloneElement(React$1.Children.only(P), __assign$2(__assign$2({}, tI), { ref: eI })) : React$1.createElement(XF, __assign$2({}, tI, {
|
|
1408
1408
|
className: z,
|
|
1409
|
-
ref:
|
|
1409
|
+
ref: eI
|
|
1410
1410
|
}), P));
|
|
1411
1411
|
});
|
|
1412
1412
|
RemoveScroll.defaultProps = {
|
|
@@ -1596,8 +1596,8 @@ var nonPassive = passiveSupported ? { passive: !1 } : !1, alwaysContainsScroll =
|
|
|
1596
1596
|
if (!N) break;
|
|
1597
1597
|
var W = getScrollVariables(n, N), G = W[0], Z = W[1] - W[2] - j * G;
|
|
1598
1598
|
(G || Z) && elementCouldBeScrolled(n, N) && (H += Z, U += G);
|
|
1599
|
-
var
|
|
1600
|
-
N =
|
|
1599
|
+
var qF = N.parentNode;
|
|
1600
|
+
N = qF && qF.nodeType === Node.DOCUMENT_FRAGMENT_NODE ? qF.host : qF;
|
|
1601
1601
|
} while (!P && N !== document.body || P && (_.contains(N) || _ === N));
|
|
1602
1602
|
return (B && (A && Math.abs(H) < 1 || !A && M > H) || !B && (A && Math.abs(U) < 1 || !A && -M > U)) && (z = !0), z;
|
|
1603
1603
|
}, getTouchXY = function(n) {
|
|
@@ -2144,7 +2144,7 @@ var computePosition$1 = async (n, _, E) => {
|
|
|
2144
2144
|
strategy: A
|
|
2145
2145
|
}), { x: B, y: H } = computeCoordsFromPlacement(z, O, P), U = O, W = {}, G = 0;
|
|
2146
2146
|
for (let E = 0; E < N.length; E++) {
|
|
2147
|
-
let { name: j, fn: Z } = N[E], { x:
|
|
2147
|
+
let { name: j, fn: Z } = N[E], { x: qF, y: JF, data: YF, reset: XF } = await Z({
|
|
2148
2148
|
x: B,
|
|
2149
2149
|
y: H,
|
|
2150
2150
|
initialPlacement: O,
|
|
@@ -2158,17 +2158,17 @@ var computePosition$1 = async (n, _, E) => {
|
|
|
2158
2158
|
floating: _
|
|
2159
2159
|
}
|
|
2160
2160
|
});
|
|
2161
|
-
B =
|
|
2161
|
+
B = qF ?? B, H = JF ?? H, W = {
|
|
2162
2162
|
...W,
|
|
2163
2163
|
[j]: {
|
|
2164
2164
|
...W[j],
|
|
2165
|
-
...
|
|
2165
|
+
...YF
|
|
2166
2166
|
}
|
|
2167
|
-
},
|
|
2167
|
+
}, XF && G <= 50 && (G++, typeof XF == "object" && (XF.placement && (U = XF.placement), XF.rects && (z = XF.rects === !0 ? await M.getElementRects({
|
|
2168
2168
|
reference: n,
|
|
2169
2169
|
floating: _,
|
|
2170
2170
|
strategy: A
|
|
2171
|
-
}) :
|
|
2171
|
+
}) : XF.rects), {x: B, y: H} = computeCoordsFromPlacement(z, U, P)), E = -1);
|
|
2172
2172
|
}
|
|
2173
2173
|
return {
|
|
2174
2174
|
x: B,
|
|
@@ -2185,25 +2185,25 @@ async function detectOverflow$1(n, _) {
|
|
|
2185
2185
|
boundary: P,
|
|
2186
2186
|
rootBoundary: z,
|
|
2187
2187
|
strategy: N
|
|
2188
|
-
})),
|
|
2188
|
+
})), qF = B === "floating" ? {
|
|
2189
2189
|
x: E,
|
|
2190
2190
|
y: O,
|
|
2191
2191
|
width: j.floating.width,
|
|
2192
2192
|
height: j.floating.height
|
|
2193
|
-
} : j.reference,
|
|
2193
|
+
} : j.reference, JF = await (A.getOffsetParent == null ? void 0 : A.getOffsetParent(M.floating)), YF = await (A.isElement == null ? void 0 : A.isElement(JF)) && await (A.getScale == null ? void 0 : A.getScale(JF)) || {
|
|
2194
2194
|
x: 1,
|
|
2195
2195
|
y: 1
|
|
2196
|
-
},
|
|
2196
|
+
}, XF = rectToClientRect(A.convertOffsetParentRelativeRectToViewportRelativeRect ? await A.convertOffsetParentRelativeRectToViewportRelativeRect({
|
|
2197
2197
|
elements: M,
|
|
2198
|
-
rect:
|
|
2199
|
-
offsetParent:
|
|
2198
|
+
rect: qF,
|
|
2199
|
+
offsetParent: JF,
|
|
2200
2200
|
strategy: N
|
|
2201
|
-
}) :
|
|
2201
|
+
}) : qF);
|
|
2202
2202
|
return {
|
|
2203
|
-
top: (Z.top -
|
|
2204
|
-
bottom: (
|
|
2205
|
-
left: (Z.left -
|
|
2206
|
-
right: (
|
|
2203
|
+
top: (Z.top - XF.top + W.top) / YF.y,
|
|
2204
|
+
bottom: (XF.bottom - Z.bottom + W.bottom) / YF.y,
|
|
2205
|
+
left: (Z.left - XF.left + W.left) / YF.x,
|
|
2206
|
+
right: (XF.right - Z.right + W.right) / YF.x
|
|
2207
2207
|
};
|
|
2208
2208
|
}
|
|
2209
2209
|
var arrow$2 = (n) => ({
|
|
@@ -2215,17 +2215,17 @@ var arrow$2 = (n) => ({
|
|
|
2215
2215
|
let H = getPaddingObject(B), U = {
|
|
2216
2216
|
x: E,
|
|
2217
2217
|
y: O
|
|
2218
|
-
}, W = getAlignmentAxis(A), G = getAxisLength(W), Z = await M.getDimensions(z),
|
|
2219
|
-
(
|
|
2220
|
-
let
|
|
2218
|
+
}, W = getAlignmentAxis(A), G = getAxisLength(W), Z = await M.getDimensions(z), qF = W === "y", JF = qF ? "top" : "left", YF = qF ? "bottom" : "right", XF = qF ? "clientHeight" : "clientWidth", ZF = j.reference[G] + j.reference[W] - U[W] - j.floating[G], QF = U[W] - j.reference[W], $F = await (M.getOffsetParent == null ? void 0 : M.getOffsetParent(z)), eI = $F ? $F[XF] : 0;
|
|
2219
|
+
(!eI || !await (M.isElement == null ? void 0 : M.isElement($F))) && (eI = N.floating[XF] || j.floating[G]);
|
|
2220
|
+
let tI = ZF / 2 - QF / 2, nI = eI / 2 - Z[G] / 2 - 1, rI = min(H[JF], nI), iI = min(H[YF], nI), aI = rI, oI = eI - Z[G] - iI, sI = eI / 2 - Z[G] / 2 + tI, cI = clamp$3(aI, sI, oI), lI = !P.arrow && getAlignment(A) != null && sI !== cI && j.reference[G] / 2 - (sI < aI ? rI : iI) - Z[G] / 2 < 0, uI = lI ? sI < aI ? sI - aI : sI - oI : 0;
|
|
2221
2221
|
return {
|
|
2222
|
-
[W]: U[W] +
|
|
2222
|
+
[W]: U[W] + uI,
|
|
2223
2223
|
data: {
|
|
2224
|
-
[W]:
|
|
2225
|
-
centerOffset:
|
|
2226
|
-
...
|
|
2224
|
+
[W]: cI,
|
|
2225
|
+
centerOffset: sI - cI - uI,
|
|
2226
|
+
...lI && { alignmentOffset: uI }
|
|
2227
2227
|
},
|
|
2228
|
-
reset:
|
|
2228
|
+
reset: lI
|
|
2229
2229
|
};
|
|
2230
2230
|
}
|
|
2231
2231
|
}), flip$2 = function(n) {
|
|
@@ -2236,32 +2236,32 @@ var arrow$2 = (n) => ({
|
|
|
2236
2236
|
var E;
|
|
2237
2237
|
let { placement: O, middlewareData: A, rects: j, initialPlacement: M, platform: N, elements: P } = _, { mainAxis: z = !0, crossAxis: B = !0, fallbackPlacements: H, fallbackStrategy: U = "bestFit", fallbackAxisSideDirection: W = "none", flipAlignment: G = !0, ...Z } = evaluate(n, _);
|
|
2238
2238
|
if ((E = A.arrow) != null && E.alignmentOffset) return {};
|
|
2239
|
-
let
|
|
2240
|
-
!H &&
|
|
2241
|
-
let
|
|
2242
|
-
if (z &&
|
|
2243
|
-
let n = getAlignmentSides(O, j,
|
|
2244
|
-
|
|
2239
|
+
let qF = getSide(O), JF = getSideAxis(M), YF = getSide(M) === M, XF = await (N.isRTL == null ? void 0 : N.isRTL(P.floating)), ZF = H || (YF || !G ? [getOppositePlacement(M)] : getExpandedPlacements(M)), QF = W !== "none";
|
|
2240
|
+
!H && QF && ZF.push(...getOppositeAxisPlacements(M, G, W, XF));
|
|
2241
|
+
let $F = [M, ...ZF], eI = await detectOverflow$1(_, Z), tI = [], nI = A.flip?.overflows || [];
|
|
2242
|
+
if (z && tI.push(eI[qF]), B) {
|
|
2243
|
+
let n = getAlignmentSides(O, j, XF);
|
|
2244
|
+
tI.push(eI[n[0]], eI[n[1]]);
|
|
2245
2245
|
}
|
|
2246
|
-
if (
|
|
2246
|
+
if (nI = [...nI, {
|
|
2247
2247
|
placement: O,
|
|
2248
|
-
overflows:
|
|
2249
|
-
}], !
|
|
2250
|
-
let n = (A.flip?.index || 0) + 1, _ =
|
|
2251
|
-
if (_ && (!(B === "alignment" &&
|
|
2248
|
+
overflows: tI
|
|
2249
|
+
}], !tI.every((n) => n <= 0)) {
|
|
2250
|
+
let n = (A.flip?.index || 0) + 1, _ = $F[n];
|
|
2251
|
+
if (_ && (!(B === "alignment" && JF !== getSideAxis(_)) || nI.every((n) => getSideAxis(n.placement) === JF ? n.overflows[0] > 0 : !0))) return {
|
|
2252
2252
|
data: {
|
|
2253
2253
|
index: n,
|
|
2254
|
-
overflows:
|
|
2254
|
+
overflows: nI
|
|
2255
2255
|
},
|
|
2256
2256
|
reset: { placement: _ }
|
|
2257
2257
|
};
|
|
2258
|
-
let E =
|
|
2258
|
+
let E = nI.filter((n) => n.overflows[0] <= 0).sort((n, _) => n.overflows[1] - _.overflows[1])[0]?.placement;
|
|
2259
2259
|
if (!E) switch (U) {
|
|
2260
2260
|
case "bestFit": {
|
|
2261
|
-
let n =
|
|
2262
|
-
if (
|
|
2261
|
+
let n = nI.filter((n) => {
|
|
2262
|
+
if (QF) {
|
|
2263
2263
|
let _ = getSideAxis(n.placement);
|
|
2264
|
-
return _ ===
|
|
2264
|
+
return _ === JF || _ === "y";
|
|
2265
2265
|
}
|
|
2266
2266
|
return !0;
|
|
2267
2267
|
}).map((n) => [n.placement, n.overflows.filter((n) => n > 0).reduce((n, _) => n + _, 0)]).sort((n, _) => n[1] - _[1])[0]?.[0];
|
|
@@ -2404,7 +2404,7 @@ var offset$2 = function(n) {
|
|
|
2404
2404
|
let { x: E, y: O, placement: A, rects: j, middlewareData: M } = _, { offset: N = 0, mainAxis: P = !0, crossAxis: z = !0 } = evaluate(n, _), B = {
|
|
2405
2405
|
x: E,
|
|
2406
2406
|
y: O
|
|
2407
|
-
}, H = getSideAxis(A), U = getOppositeAxis(H), W = B[U], G = B[H], Z = evaluate(N, _),
|
|
2407
|
+
}, H = getSideAxis(A), U = getOppositeAxis(H), W = B[U], G = B[H], Z = evaluate(N, _), qF = typeof Z == "number" ? {
|
|
2408
2408
|
mainAxis: Z,
|
|
2409
2409
|
crossAxis: 0
|
|
2410
2410
|
} : {
|
|
@@ -2413,11 +2413,11 @@ var offset$2 = function(n) {
|
|
|
2413
2413
|
...Z
|
|
2414
2414
|
};
|
|
2415
2415
|
if (P) {
|
|
2416
|
-
let n = U === "y" ? "height" : "width", _ = j.reference[U] - j.floating[n] +
|
|
2416
|
+
let n = U === "y" ? "height" : "width", _ = j.reference[U] - j.floating[n] + qF.mainAxis, E = j.reference[U] + j.reference[n] - qF.mainAxis;
|
|
2417
2417
|
W < _ ? W = _ : W > E && (W = E);
|
|
2418
2418
|
}
|
|
2419
2419
|
if (z) {
|
|
2420
|
-
let n = U === "y" ? "width" : "height", _ = originSides.has(getSide(A)), E = j.reference[H] - j.floating[n] + (_ && M.offset?.[H] || 0) + (_ ? 0 :
|
|
2420
|
+
let n = U === "y" ? "width" : "height", _ = originSides.has(getSide(A)), E = j.reference[H] - j.floating[n] + (_ && M.offset?.[H] || 0) + (_ ? 0 : qF.crossAxis), O = j.reference[H] + j.reference[n] + (_ ? 0 : M.offset?.[H] || 0) - (_ ? qF.crossAxis : 0);
|
|
2421
2421
|
G < E ? G = E : G > O && (G = O);
|
|
2422
2422
|
}
|
|
2423
2423
|
return {
|
|
@@ -2432,20 +2432,20 @@ var offset$2 = function(n) {
|
|
|
2432
2432
|
options: n,
|
|
2433
2433
|
async fn(_) {
|
|
2434
2434
|
var E, O;
|
|
2435
|
-
let { placement: A, rects: j, platform: M, elements: N } = _, { apply: P = () => {}, ...z } = evaluate(n, _), B = await detectOverflow$1(_, z), H = getSide(A), U = getAlignment(A), W = getSideAxis(A) === "y", { width: G, height: Z } = j.floating,
|
|
2436
|
-
H === "top" || H === "bottom" ? (
|
|
2437
|
-
let
|
|
2438
|
-
if ((E = _.middlewareData.shift) != null && E.enabled.x && (
|
|
2435
|
+
let { placement: A, rects: j, platform: M, elements: N } = _, { apply: P = () => {}, ...z } = evaluate(n, _), B = await detectOverflow$1(_, z), H = getSide(A), U = getAlignment(A), W = getSideAxis(A) === "y", { width: G, height: Z } = j.floating, qF, JF;
|
|
2436
|
+
H === "top" || H === "bottom" ? (qF = H, JF = U === (await (M.isRTL == null ? void 0 : M.isRTL(N.floating)) ? "start" : "end") ? "left" : "right") : (JF = H, qF = U === "end" ? "top" : "bottom");
|
|
2437
|
+
let YF = Z - B.top - B.bottom, XF = G - B.left - B.right, ZF = min(Z - B[qF], YF), QF = min(G - B[JF], XF), $F = !_.middlewareData.shift, eI = ZF, tI = QF;
|
|
2438
|
+
if ((E = _.middlewareData.shift) != null && E.enabled.x && (tI = XF), (O = _.middlewareData.shift) != null && O.enabled.y && (eI = YF), $F && !U) {
|
|
2439
2439
|
let n = max(B.left, 0), _ = max(B.right, 0), E = max(B.top, 0), O = max(B.bottom, 0);
|
|
2440
|
-
W ?
|
|
2440
|
+
W ? tI = G - 2 * (n !== 0 || _ !== 0 ? n + _ : max(B.left, B.right)) : eI = Z - 2 * (E !== 0 || O !== 0 ? E + O : max(B.top, B.bottom));
|
|
2441
2441
|
}
|
|
2442
2442
|
await P({
|
|
2443
2443
|
..._,
|
|
2444
|
-
availableWidth:
|
|
2445
|
-
availableHeight:
|
|
2444
|
+
availableWidth: tI,
|
|
2445
|
+
availableHeight: eI
|
|
2446
2446
|
});
|
|
2447
|
-
let
|
|
2448
|
-
return G !==
|
|
2447
|
+
let nI = await M.getDimensions(N.floating);
|
|
2448
|
+
return G !== nI.width || Z !== nI.height ? { reset: { rects: !0 } } : {};
|
|
2449
2449
|
}
|
|
2450
2450
|
};
|
|
2451
2451
|
};
|
|
@@ -2829,27 +2829,27 @@ function observeMove(n, _) {
|
|
|
2829
2829
|
N === void 0 && (N = !1), P === void 0 && (P = 1), j();
|
|
2830
2830
|
let z = n.getBoundingClientRect(), { left: B, top: H, width: U, height: W } = z;
|
|
2831
2831
|
if (N || _(), !U || !W) return;
|
|
2832
|
-
let G = floor(H), Z = floor(A.clientWidth - (B + U)),
|
|
2833
|
-
rootMargin: -G + "px " + -Z + "px " + -
|
|
2832
|
+
let G = floor(H), Z = floor(A.clientWidth - (B + U)), qF = floor(A.clientHeight - (H + W)), JF = floor(B), YF = {
|
|
2833
|
+
rootMargin: -G + "px " + -Z + "px " + -qF + "px " + -JF + "px",
|
|
2834
2834
|
threshold: max(0, min(1, P)) || 1
|
|
2835
|
-
},
|
|
2836
|
-
function
|
|
2835
|
+
}, XF = !0;
|
|
2836
|
+
function ZF(_) {
|
|
2837
2837
|
let E = _[0].intersectionRatio;
|
|
2838
2838
|
if (E !== P) {
|
|
2839
|
-
if (!
|
|
2839
|
+
if (!XF) return M();
|
|
2840
2840
|
E ? M(!1, E) : O = setTimeout(() => {
|
|
2841
2841
|
M(!1, 1e-7);
|
|
2842
2842
|
}, 1e3);
|
|
2843
2843
|
}
|
|
2844
|
-
E === 1 && !rectsAreEqual(z, n.getBoundingClientRect()) && M(),
|
|
2844
|
+
E === 1 && !rectsAreEqual(z, n.getBoundingClientRect()) && M(), XF = !1;
|
|
2845
2845
|
}
|
|
2846
2846
|
try {
|
|
2847
|
-
E = new IntersectionObserver(
|
|
2848
|
-
...
|
|
2847
|
+
E = new IntersectionObserver(ZF, {
|
|
2848
|
+
...YF,
|
|
2849
2849
|
root: A.ownerDocument
|
|
2850
2850
|
});
|
|
2851
2851
|
} catch {
|
|
2852
|
-
E = new IntersectionObserver(
|
|
2852
|
+
E = new IntersectionObserver(ZF, YF);
|
|
2853
2853
|
}
|
|
2854
2854
|
E.observe(n);
|
|
2855
2855
|
}
|
|
@@ -2870,10 +2870,10 @@ function autoUpdate(n, _, E, O) {
|
|
|
2870
2870
|
})), E();
|
|
2871
2871
|
}), z && !P && W.observe(z), W.observe(_));
|
|
2872
2872
|
let G, Z = P ? getBoundingClientRect(n) : null;
|
|
2873
|
-
P &&
|
|
2874
|
-
function
|
|
2873
|
+
P && qF();
|
|
2874
|
+
function qF() {
|
|
2875
2875
|
let _ = getBoundingClientRect(n);
|
|
2876
|
-
Z && !rectsAreEqual(Z, _) && E(), Z = _, G = requestAnimationFrame(
|
|
2876
|
+
Z && !rectsAreEqual(Z, _) && E(), Z = _, G = requestAnimationFrame(qF);
|
|
2877
2877
|
}
|
|
2878
2878
|
return E(), () => {
|
|
2879
2879
|
var n;
|
|
@@ -2940,23 +2940,23 @@ function useFloating(_) {
|
|
|
2940
2940
|
isPositioned: !1
|
|
2941
2941
|
}), [W, G] = React$1.useState(A);
|
|
2942
2942
|
deepEqual(W, A) || G(A);
|
|
2943
|
-
let [Z,
|
|
2944
|
-
n !==
|
|
2945
|
-
}, []),
|
|
2946
|
-
n !==
|
|
2947
|
-
}, []),
|
|
2948
|
-
if (!
|
|
2943
|
+
let [Z, qF] = React$1.useState(null), [JF, YF] = React$1.useState(null), XF = React$1.useCallback((n) => {
|
|
2944
|
+
n !== tI.current && (tI.current = n, qF(n));
|
|
2945
|
+
}, []), ZF = React$1.useCallback((n) => {
|
|
2946
|
+
n !== nI.current && (nI.current = n, YF(n));
|
|
2947
|
+
}, []), QF = M || Z, $F = N || JF, tI = React$1.useRef(null), nI = React$1.useRef(null), rI = React$1.useRef(H), iI = z != null, aI = useLatestRef(z), oI = useLatestRef(j), sI = useLatestRef(B), cI = React$1.useCallback(() => {
|
|
2948
|
+
if (!tI.current || !nI.current) return;
|
|
2949
2949
|
let n = {
|
|
2950
2950
|
placement: E,
|
|
2951
2951
|
strategy: O,
|
|
2952
2952
|
middleware: W
|
|
2953
2953
|
};
|
|
2954
|
-
|
|
2954
|
+
oI.current && (n.platform = oI.current), computePosition(tI.current, nI.current, n).then((n) => {
|
|
2955
2955
|
let _ = {
|
|
2956
2956
|
...n,
|
|
2957
|
-
isPositioned:
|
|
2957
|
+
isPositioned: sI.current !== !1
|
|
2958
2958
|
};
|
|
2959
|
-
|
|
2959
|
+
lI.current && !deepEqual(rI.current, _) && (rI.current = _, ReactDOM$1.flushSync(() => {
|
|
2960
2960
|
U(_);
|
|
2961
2961
|
}));
|
|
2962
2962
|
});
|
|
@@ -2964,50 +2964,50 @@ function useFloating(_) {
|
|
|
2964
2964
|
W,
|
|
2965
2965
|
E,
|
|
2966
2966
|
O,
|
|
2967
|
-
|
|
2968
|
-
|
|
2967
|
+
oI,
|
|
2968
|
+
sI
|
|
2969
2969
|
]);
|
|
2970
2970
|
index(() => {
|
|
2971
|
-
B === !1 &&
|
|
2971
|
+
B === !1 && rI.current.isPositioned && (rI.current.isPositioned = !1, U((n) => ({
|
|
2972
2972
|
...n,
|
|
2973
2973
|
isPositioned: !1
|
|
2974
2974
|
})));
|
|
2975
2975
|
}, [B]);
|
|
2976
|
-
let
|
|
2977
|
-
index(() => (
|
|
2978
|
-
|
|
2976
|
+
let lI = React$1.useRef(!1);
|
|
2977
|
+
index(() => (lI.current = !0, () => {
|
|
2978
|
+
lI.current = !1;
|
|
2979
2979
|
}), []), index(() => {
|
|
2980
|
-
if (
|
|
2981
|
-
if (
|
|
2982
|
-
|
|
2980
|
+
if (QF && (tI.current = QF), $F && (nI.current = $F), QF && $F) {
|
|
2981
|
+
if (aI.current) return aI.current(QF, $F, cI);
|
|
2982
|
+
cI();
|
|
2983
2983
|
}
|
|
2984
2984
|
}, [
|
|
2985
|
-
ZF,
|
|
2986
2985
|
QF,
|
|
2987
|
-
|
|
2988
|
-
|
|
2989
|
-
|
|
2986
|
+
$F,
|
|
2987
|
+
cI,
|
|
2988
|
+
aI,
|
|
2989
|
+
iI
|
|
2990
2990
|
]);
|
|
2991
|
-
let
|
|
2992
|
-
reference:
|
|
2993
|
-
floating:
|
|
2994
|
-
setReference:
|
|
2995
|
-
setFloating:
|
|
2996
|
-
}), [
|
|
2997
|
-
reference:
|
|
2998
|
-
floating:
|
|
2999
|
-
}), [
|
|
2991
|
+
let uI = React$1.useMemo(() => ({
|
|
2992
|
+
reference: tI,
|
|
2993
|
+
floating: nI,
|
|
2994
|
+
setReference: XF,
|
|
2995
|
+
setFloating: ZF
|
|
2996
|
+
}), [XF, ZF]), dI = React$1.useMemo(() => ({
|
|
2997
|
+
reference: QF,
|
|
2998
|
+
floating: $F
|
|
2999
|
+
}), [QF, $F]), fI = React$1.useMemo(() => {
|
|
3000
3000
|
let n = {
|
|
3001
3001
|
position: O,
|
|
3002
3002
|
left: 0,
|
|
3003
3003
|
top: 0
|
|
3004
3004
|
};
|
|
3005
|
-
if (!
|
|
3006
|
-
let _ = roundByDPR(
|
|
3005
|
+
if (!dI.floating) return n;
|
|
3006
|
+
let _ = roundByDPR(dI.floating, H.x), E = roundByDPR(dI.floating, H.y);
|
|
3007
3007
|
return P ? {
|
|
3008
3008
|
...n,
|
|
3009
3009
|
transform: "translate(" + _ + "px, " + E + "px)",
|
|
3010
|
-
...getDPR(
|
|
3010
|
+
...getDPR(dI.floating) >= 1.5 && { willChange: "transform" }
|
|
3011
3011
|
} : {
|
|
3012
3012
|
position: O,
|
|
3013
3013
|
left: _,
|
|
@@ -3016,22 +3016,22 @@ function useFloating(_) {
|
|
|
3016
3016
|
}, [
|
|
3017
3017
|
O,
|
|
3018
3018
|
P,
|
|
3019
|
-
|
|
3019
|
+
dI.floating,
|
|
3020
3020
|
H.x,
|
|
3021
3021
|
H.y
|
|
3022
3022
|
]);
|
|
3023
3023
|
return React$1.useMemo(() => ({
|
|
3024
3024
|
...H,
|
|
3025
|
-
update:
|
|
3026
|
-
refs:
|
|
3027
|
-
elements:
|
|
3028
|
-
floatingStyles:
|
|
3025
|
+
update: cI,
|
|
3026
|
+
refs: uI,
|
|
3027
|
+
elements: dI,
|
|
3028
|
+
floatingStyles: fI
|
|
3029
3029
|
}), [
|
|
3030
3030
|
H,
|
|
3031
|
-
|
|
3032
|
-
lI,
|
|
3031
|
+
cI,
|
|
3033
3032
|
uI,
|
|
3034
|
-
dI
|
|
3033
|
+
dI,
|
|
3034
|
+
fI
|
|
3035
3035
|
]);
|
|
3036
3036
|
}
|
|
3037
3037
|
var arrow$1$1 = (n) => {
|
|
@@ -3108,70 +3108,70 @@ var ANCHOR_NAME$2 = "PopperAnchor", PopperAnchor = React$1.forwardRef((_, E) =>
|
|
|
3108
3108
|
});
|
|
3109
3109
|
PopperAnchor.displayName = ANCHOR_NAME$2;
|
|
3110
3110
|
var CONTENT_NAME$6 = "PopperContent", [PopperContentProvider, useContentContext] = createPopperContext(CONTENT_NAME$6), PopperContent = React$1.forwardRef((_, E) => {
|
|
3111
|
-
let { __scopePopper: O, side: A = "bottom", sideOffset: j = 0, align: M = "center", alignOffset: N = 0, arrowPadding: P = 0, avoidCollisions: z = !0, collisionBoundary: B = [], collisionPadding: H = 0, sticky: U = "partial", hideWhenDetached: W = !1, updatePositionStrategy: G = "optimized", onPlaced: Z, ...
|
|
3111
|
+
let { __scopePopper: O, side: A = "bottom", sideOffset: j = 0, align: M = "center", alignOffset: N = 0, arrowPadding: P = 0, avoidCollisions: z = !0, collisionBoundary: B = [], collisionPadding: H = 0, sticky: U = "partial", hideWhenDetached: W = !1, updatePositionStrategy: G = "optimized", onPlaced: Z, ...qF } = _, JF = usePopperContext(CONTENT_NAME$6, O), [YF, XF] = React$1.useState(null), ZF = useComposedRefs$1(E, (n) => XF(n)), [QF, $F] = React$1.useState(null), eI = useSize(QF), tI = eI?.width ?? 0, nI = eI?.height ?? 0, rI = A + (M === "center" ? "" : "-" + M), iI = typeof H == "number" ? H : {
|
|
3112
3112
|
top: 0,
|
|
3113
3113
|
right: 0,
|
|
3114
3114
|
bottom: 0,
|
|
3115
3115
|
left: 0,
|
|
3116
3116
|
...H
|
|
3117
|
-
},
|
|
3118
|
-
padding:
|
|
3119
|
-
boundary:
|
|
3120
|
-
altBoundary:
|
|
3121
|
-
}, { refs:
|
|
3117
|
+
}, aI = Array.isArray(B) ? B : [B], sI = aI.length > 0, cI = {
|
|
3118
|
+
padding: iI,
|
|
3119
|
+
boundary: aI.filter(isNotNull$2),
|
|
3120
|
+
altBoundary: sI
|
|
3121
|
+
}, { refs: lI, floatingStyles: uI, placement: dI, isPositioned: fI, middlewareData: pI } = useFloating({
|
|
3122
3122
|
strategy: "fixed",
|
|
3123
|
-
placement:
|
|
3123
|
+
placement: rI,
|
|
3124
3124
|
whileElementsMounted: (...n) => autoUpdate(...n, { animationFrame: G === "always" }),
|
|
3125
|
-
elements: { reference:
|
|
3125
|
+
elements: { reference: JF.anchor },
|
|
3126
3126
|
middleware: [
|
|
3127
3127
|
offset({
|
|
3128
|
-
mainAxis: j +
|
|
3128
|
+
mainAxis: j + nI,
|
|
3129
3129
|
alignmentAxis: N
|
|
3130
3130
|
}),
|
|
3131
3131
|
z && shift({
|
|
3132
3132
|
mainAxis: !0,
|
|
3133
3133
|
crossAxis: !1,
|
|
3134
3134
|
limiter: U === "partial" ? limitShift() : void 0,
|
|
3135
|
-
...
|
|
3135
|
+
...cI
|
|
3136
3136
|
}),
|
|
3137
|
-
z && flip({ ...
|
|
3137
|
+
z && flip({ ...cI }),
|
|
3138
3138
|
size({
|
|
3139
|
-
...
|
|
3139
|
+
...cI,
|
|
3140
3140
|
apply: ({ elements: n, rects: _, availableWidth: E, availableHeight: O }) => {
|
|
3141
3141
|
let { width: A, height: j } = _.reference, M = n.floating.style;
|
|
3142
3142
|
M.setProperty("--radix-popper-available-width", `${E}px`), M.setProperty("--radix-popper-available-height", `${O}px`), M.setProperty("--radix-popper-anchor-width", `${A}px`), M.setProperty("--radix-popper-anchor-height", `${j}px`);
|
|
3143
3143
|
}
|
|
3144
3144
|
}),
|
|
3145
|
-
|
|
3146
|
-
element:
|
|
3145
|
+
QF && arrow({
|
|
3146
|
+
element: QF,
|
|
3147
3147
|
padding: P
|
|
3148
3148
|
}),
|
|
3149
3149
|
transformOrigin({
|
|
3150
|
-
arrowWidth:
|
|
3151
|
-
arrowHeight:
|
|
3150
|
+
arrowWidth: tI,
|
|
3151
|
+
arrowHeight: nI
|
|
3152
3152
|
}),
|
|
3153
3153
|
W && hide({
|
|
3154
3154
|
strategy: "referenceHidden",
|
|
3155
|
-
...
|
|
3155
|
+
...cI
|
|
3156
3156
|
})
|
|
3157
3157
|
]
|
|
3158
|
-
}), [
|
|
3158
|
+
}), [mI, hI] = getSideAndAlignFromPlacement(dI), gI = useCallbackRef(Z);
|
|
3159
3159
|
useLayoutEffect2(() => {
|
|
3160
|
-
|
|
3161
|
-
}, [
|
|
3162
|
-
let
|
|
3160
|
+
fI && gI?.();
|
|
3161
|
+
}, [fI, gI]);
|
|
3162
|
+
let _I = pI.arrow?.x, vI = pI.arrow?.y, yI = pI.arrow?.centerOffset !== 0, [bI, xI] = React$1.useState();
|
|
3163
3163
|
return useLayoutEffect2(() => {
|
|
3164
|
-
|
|
3165
|
-
}, [
|
|
3166
|
-
ref:
|
|
3164
|
+
YF && xI(window.getComputedStyle(YF).zIndex);
|
|
3165
|
+
}, [YF]), /* @__PURE__ */ jsx("div", {
|
|
3166
|
+
ref: lI.setFloating,
|
|
3167
3167
|
"data-radix-popper-content-wrapper": "",
|
|
3168
3168
|
style: {
|
|
3169
|
-
...
|
|
3170
|
-
transform:
|
|
3169
|
+
...uI,
|
|
3170
|
+
transform: fI ? uI.transform : "translate(0, -200%)",
|
|
3171
3171
|
minWidth: "max-content",
|
|
3172
|
-
zIndex:
|
|
3173
|
-
"--radix-popper-transform-origin": [
|
|
3174
|
-
...
|
|
3172
|
+
zIndex: bI,
|
|
3173
|
+
"--radix-popper-transform-origin": [pI.transformOrigin?.x, pI.transformOrigin?.y].join(" "),
|
|
3174
|
+
...pI.hide?.referenceHidden && {
|
|
3175
3175
|
visibility: "hidden",
|
|
3176
3176
|
pointerEvents: "none"
|
|
3177
3177
|
}
|
|
@@ -3179,19 +3179,19 @@ var CONTENT_NAME$6 = "PopperContent", [PopperContentProvider, useContentContext]
|
|
|
3179
3179
|
dir: _.dir,
|
|
3180
3180
|
children: /* @__PURE__ */ jsx(PopperContentProvider, {
|
|
3181
3181
|
scope: O,
|
|
3182
|
-
placedSide:
|
|
3183
|
-
onArrowChange:
|
|
3184
|
-
arrowX:
|
|
3185
|
-
arrowY:
|
|
3186
|
-
shouldHideArrow:
|
|
3182
|
+
placedSide: mI,
|
|
3183
|
+
onArrowChange: $F,
|
|
3184
|
+
arrowX: _I,
|
|
3185
|
+
arrowY: vI,
|
|
3186
|
+
shouldHideArrow: yI,
|
|
3187
3187
|
children: /* @__PURE__ */ jsx(Primitive.div, {
|
|
3188
|
-
"data-side":
|
|
3189
|
-
"data-align":
|
|
3190
|
-
...
|
|
3191
|
-
ref:
|
|
3188
|
+
"data-side": mI,
|
|
3189
|
+
"data-align": hI,
|
|
3190
|
+
...qF,
|
|
3191
|
+
ref: ZF,
|
|
3192
3192
|
style: {
|
|
3193
|
-
...
|
|
3194
|
-
animation:
|
|
3193
|
+
...qF.style,
|
|
3194
|
+
animation: fI ? void 0 : "none"
|
|
3195
3195
|
}
|
|
3196
3196
|
})
|
|
3197
3197
|
})
|
|
@@ -3274,27 +3274,27 @@ var Root2$4 = Popper, Anchor = PopperAnchor, Content$1 = PopperContent, Arrow =
|
|
|
3274
3274
|
}));
|
|
3275
3275
|
RovingFocusGroup.displayName = GROUP_NAME$3;
|
|
3276
3276
|
var RovingFocusGroupImpl = React$1.forwardRef((_, E) => {
|
|
3277
|
-
let { __scopeRovingFocusGroup: O, orientation: A, loop: j = !1, dir: M, currentTabStopId: N, defaultCurrentTabStopId: P, onCurrentTabStopIdChange: z, onEntryFocus: B, preventScrollOnEntryFocus: H = !1, ...U } = _, W = React$1.useRef(null), G = useComposedRefs$1(E, W), Z = useDirection(M), [
|
|
3277
|
+
let { __scopeRovingFocusGroup: O, orientation: A, loop: j = !1, dir: M, currentTabStopId: N, defaultCurrentTabStopId: P, onCurrentTabStopIdChange: z, onEntryFocus: B, preventScrollOnEntryFocus: H = !1, ...U } = _, W = React$1.useRef(null), G = useComposedRefs$1(E, W), Z = useDirection(M), [qF, JF] = useControllableState({
|
|
3278
3278
|
prop: N,
|
|
3279
3279
|
defaultProp: P ?? null,
|
|
3280
3280
|
onChange: z,
|
|
3281
3281
|
caller: GROUP_NAME$3
|
|
3282
|
-
}), [
|
|
3282
|
+
}), [YF, XF] = React$1.useState(!1), ZF = useCallbackRef(B), QF = useCollection$1(O), $F = React$1.useRef(!1), [eI, tI] = React$1.useState(0);
|
|
3283
3283
|
return React$1.useEffect(() => {
|
|
3284
3284
|
let n = W.current;
|
|
3285
|
-
if (n) return n.addEventListener(ENTRY_FOCUS,
|
|
3286
|
-
}, [
|
|
3285
|
+
if (n) return n.addEventListener(ENTRY_FOCUS, ZF), () => n.removeEventListener(ENTRY_FOCUS, ZF);
|
|
3286
|
+
}, [ZF]), /* @__PURE__ */ jsx(RovingFocusProvider, {
|
|
3287
3287
|
scope: O,
|
|
3288
3288
|
orientation: A,
|
|
3289
3289
|
dir: Z,
|
|
3290
3290
|
loop: j,
|
|
3291
|
-
currentTabStopId:
|
|
3292
|
-
onItemFocus: React$1.useCallback((n) =>
|
|
3293
|
-
onItemShiftTab: React$1.useCallback(() =>
|
|
3294
|
-
onFocusableItemAdd: React$1.useCallback(() =>
|
|
3295
|
-
onFocusableItemRemove: React$1.useCallback(() =>
|
|
3291
|
+
currentTabStopId: qF,
|
|
3292
|
+
onItemFocus: React$1.useCallback((n) => JF(n), [JF]),
|
|
3293
|
+
onItemShiftTab: React$1.useCallback(() => XF(!0), []),
|
|
3294
|
+
onFocusableItemAdd: React$1.useCallback(() => tI((n) => n + 1), []),
|
|
3295
|
+
onFocusableItemRemove: React$1.useCallback(() => tI((n) => n - 1), []),
|
|
3296
3296
|
children: /* @__PURE__ */ jsx(Primitive.div, {
|
|
3297
|
-
tabIndex:
|
|
3297
|
+
tabIndex: YF || eI === 0 ? -1 : 0,
|
|
3298
3298
|
"data-orientation": A,
|
|
3299
3299
|
...U,
|
|
3300
3300
|
ref: G,
|
|
@@ -3303,28 +3303,28 @@ var RovingFocusGroupImpl = React$1.forwardRef((_, E) => {
|
|
|
3303
3303
|
..._.style
|
|
3304
3304
|
},
|
|
3305
3305
|
onMouseDown: composeEventHandlers(_.onMouseDown, () => {
|
|
3306
|
-
|
|
3306
|
+
$F.current = !0;
|
|
3307
3307
|
}),
|
|
3308
3308
|
onFocus: composeEventHandlers(_.onFocus, (n) => {
|
|
3309
|
-
let _ =
|
|
3310
|
-
if (n.target === n.currentTarget && _ && !
|
|
3309
|
+
let _ = !$F.current;
|
|
3310
|
+
if (n.target === n.currentTarget && _ && !YF) {
|
|
3311
3311
|
let _ = new CustomEvent(ENTRY_FOCUS, EVENT_OPTIONS);
|
|
3312
3312
|
if (n.currentTarget.dispatchEvent(_), !_.defaultPrevented) {
|
|
3313
|
-
let n =
|
|
3313
|
+
let n = QF().filter((n) => n.focusable);
|
|
3314
3314
|
focusFirst$1([
|
|
3315
3315
|
n.find((n) => n.active),
|
|
3316
|
-
n.find((n) => n.id ===
|
|
3316
|
+
n.find((n) => n.id === qF),
|
|
3317
3317
|
...n
|
|
3318
3318
|
].filter(Boolean).map((n) => n.ref.current), H);
|
|
3319
3319
|
}
|
|
3320
3320
|
}
|
|
3321
|
-
|
|
3321
|
+
$F.current = !1;
|
|
3322
3322
|
}),
|
|
3323
|
-
onBlur: composeEventHandlers(_.onBlur, () =>
|
|
3323
|
+
onBlur: composeEventHandlers(_.onBlur, () => XF(!1))
|
|
3324
3324
|
})
|
|
3325
3325
|
});
|
|
3326
3326
|
}), ITEM_NAME$3 = "RovingFocusGroupItem", RovingFocusGroupItem = React$1.forwardRef((_, E) => {
|
|
3327
|
-
let { __scopeRovingFocusGroup: O, focusable: A = !0, active: j = !1, tabStopId: M, children: N, ...P } = _, z = useId$1(), B = M || z, H = useRovingFocusContext(ITEM_NAME$3, O), U = H.currentTabStopId === B, W = useCollection$1(O), { onFocusableItemAdd: G, onFocusableItemRemove: Z, currentTabStopId:
|
|
3327
|
+
let { __scopeRovingFocusGroup: O, focusable: A = !0, active: j = !1, tabStopId: M, children: N, ...P } = _, z = useId$1(), B = M || z, H = useRovingFocusContext(ITEM_NAME$3, O), U = H.currentTabStopId === B, W = useCollection$1(O), { onFocusableItemAdd: G, onFocusableItemRemove: Z, currentTabStopId: qF } = H;
|
|
3328
3328
|
return React$1.useEffect(() => {
|
|
3329
3329
|
if (A) return G(), () => Z();
|
|
3330
3330
|
}, [
|
|
@@ -3367,7 +3367,7 @@ var RovingFocusGroupImpl = React$1.forwardRef((_, E) => {
|
|
|
3367
3367
|
}),
|
|
3368
3368
|
children: typeof N == "function" ? N({
|
|
3369
3369
|
isCurrentTabStop: U,
|
|
3370
|
-
hasTabStop:
|
|
3370
|
+
hasTabStop: qF != null
|
|
3371
3371
|
}) : N
|
|
3372
3372
|
})
|
|
3373
3373
|
});
|
|
@@ -3518,40 +3518,40 @@ var CONTENT_NAME$5 = "MenuContent", [MenuContentProvider, useMenuContentContext]
|
|
|
3518
3518
|
onDismiss: () => E.onOpenChange(!1)
|
|
3519
3519
|
});
|
|
3520
3520
|
}), Slot$1 = /* @__PURE__ */ createSlot("MenuContent.ScrollLock"), MenuContentImpl = React$1.forwardRef((_, E) => {
|
|
3521
|
-
let { __scopeMenu: O, loop: A = !1, trapFocus: j, onOpenAutoFocus: M, onCloseAutoFocus: N, disableOutsidePointerEvents: P, onEntryFocus: z, onEscapeKeyDown: B, onPointerDownOutside: H, onFocusOutside: U, onInteractOutside: W, onDismiss: G, disableOutsideScroll: Z, ...
|
|
3521
|
+
let { __scopeMenu: O, loop: A = !1, trapFocus: j, onOpenAutoFocus: M, onCloseAutoFocus: N, disableOutsidePointerEvents: P, onEntryFocus: z, onEscapeKeyDown: B, onPointerDownOutside: H, onFocusOutside: U, onInteractOutside: W, onDismiss: G, disableOutsideScroll: Z, ...qF } = _, JF = useMenuContext(CONTENT_NAME$5, O), YF = useMenuRootContext(CONTENT_NAME$5, O), XF = usePopperScope$2(O), ZF = useRovingFocusGroupScope$1(O), QF = useCollection(O), [$F, eI] = React$1.useState(null), tI = React$1.useRef(null), nI = useComposedRefs$1(E, tI, JF.onContentChange), rI = React$1.useRef(0), iI = React$1.useRef(""), aI = React$1.useRef(0), sI = React$1.useRef(null), cI = React$1.useRef("right"), lI = React$1.useRef(0), uI = Z ? Combination_default : React$1.Fragment, dI = Z ? {
|
|
3522
3522
|
as: Slot$1,
|
|
3523
3523
|
allowPinchZoom: !0
|
|
3524
|
-
} : void 0,
|
|
3525
|
-
let _ =
|
|
3524
|
+
} : void 0, fI = (n) => {
|
|
3525
|
+
let _ = iI.current + n, E = QF().filter((n) => !n.disabled), O = document.activeElement, A = E.find((n) => n.ref.current === O)?.textValue, j = getNextMatch(E.map((n) => n.textValue), _, A), M = E.find((n) => n.textValue === j)?.ref.current;
|
|
3526
3526
|
(function n(_) {
|
|
3527
|
-
|
|
3527
|
+
iI.current = _, window.clearTimeout(rI.current), _ !== "" && (rI.current = window.setTimeout(() => n(""), 1e3));
|
|
3528
3528
|
})(_), M && setTimeout(() => M.focus());
|
|
3529
3529
|
};
|
|
3530
|
-
React$1.useEffect(() => () => window.clearTimeout(
|
|
3531
|
-
let
|
|
3530
|
+
React$1.useEffect(() => () => window.clearTimeout(rI.current), []), useFocusGuards();
|
|
3531
|
+
let pI = React$1.useCallback((n) => cI.current === sI.current?.side && isPointerInGraceArea(n, sI.current?.area), []);
|
|
3532
3532
|
return /* @__PURE__ */ jsx(MenuContentProvider, {
|
|
3533
3533
|
scope: O,
|
|
3534
|
-
searchRef:
|
|
3534
|
+
searchRef: iI,
|
|
3535
3535
|
onItemEnter: React$1.useCallback((n) => {
|
|
3536
|
-
|
|
3537
|
-
}, [
|
|
3536
|
+
pI(n) && n.preventDefault();
|
|
3537
|
+
}, [pI]),
|
|
3538
3538
|
onItemLeave: React$1.useCallback((n) => {
|
|
3539
|
-
|
|
3540
|
-
}, [
|
|
3539
|
+
pI(n) || (tI.current?.focus(), eI(null));
|
|
3540
|
+
}, [pI]),
|
|
3541
3541
|
onTriggerLeave: React$1.useCallback((n) => {
|
|
3542
|
-
|
|
3543
|
-
}, [
|
|
3544
|
-
pointerGraceTimerRef:
|
|
3542
|
+
pI(n) && n.preventDefault();
|
|
3543
|
+
}, [pI]),
|
|
3544
|
+
pointerGraceTimerRef: aI,
|
|
3545
3545
|
onPointerGraceIntentChange: React$1.useCallback((n) => {
|
|
3546
|
-
|
|
3546
|
+
sI.current = n;
|
|
3547
3547
|
}, []),
|
|
3548
|
-
children: /* @__PURE__ */ jsx(
|
|
3549
|
-
...
|
|
3548
|
+
children: /* @__PURE__ */ jsx(uI, {
|
|
3549
|
+
...dI,
|
|
3550
3550
|
children: /* @__PURE__ */ jsx(FocusScope, {
|
|
3551
3551
|
asChild: !0,
|
|
3552
3552
|
trapped: j,
|
|
3553
3553
|
onMountAutoFocus: composeEventHandlers(M, (n) => {
|
|
3554
|
-
n.preventDefault(),
|
|
3554
|
+
n.preventDefault(), tI.current?.focus({ preventScroll: !0 });
|
|
3555
3555
|
}),
|
|
3556
3556
|
onUnmountAutoFocus: N,
|
|
3557
3557
|
children: /* @__PURE__ */ jsx(DismissableLayer, {
|
|
@@ -3564,44 +3564,44 @@ var CONTENT_NAME$5 = "MenuContent", [MenuContentProvider, useMenuContentContext]
|
|
|
3564
3564
|
onDismiss: G,
|
|
3565
3565
|
children: /* @__PURE__ */ jsx(Root$2, {
|
|
3566
3566
|
asChild: !0,
|
|
3567
|
-
...
|
|
3568
|
-
dir:
|
|
3567
|
+
...ZF,
|
|
3568
|
+
dir: YF.dir,
|
|
3569
3569
|
orientation: "vertical",
|
|
3570
3570
|
loop: A,
|
|
3571
|
-
currentTabStopId:
|
|
3572
|
-
onCurrentTabStopIdChange:
|
|
3571
|
+
currentTabStopId: $F,
|
|
3572
|
+
onCurrentTabStopIdChange: eI,
|
|
3573
3573
|
onEntryFocus: composeEventHandlers(z, (n) => {
|
|
3574
|
-
|
|
3574
|
+
YF.isUsingKeyboardRef.current || n.preventDefault();
|
|
3575
3575
|
}),
|
|
3576
3576
|
preventScrollOnEntryFocus: !0,
|
|
3577
3577
|
children: /* @__PURE__ */ jsx(Content$1, {
|
|
3578
3578
|
role: "menu",
|
|
3579
3579
|
"aria-orientation": "vertical",
|
|
3580
|
-
"data-state": getOpenState(
|
|
3580
|
+
"data-state": getOpenState(JF.open),
|
|
3581
3581
|
"data-radix-menu-content": "",
|
|
3582
|
-
dir:
|
|
3583
|
-
...
|
|
3584
|
-
...
|
|
3585
|
-
ref:
|
|
3582
|
+
dir: YF.dir,
|
|
3583
|
+
...XF,
|
|
3584
|
+
...qF,
|
|
3585
|
+
ref: nI,
|
|
3586
3586
|
style: {
|
|
3587
3587
|
outline: "none",
|
|
3588
|
-
...
|
|
3588
|
+
...qF.style
|
|
3589
3589
|
},
|
|
3590
|
-
onKeyDown: composeEventHandlers(
|
|
3590
|
+
onKeyDown: composeEventHandlers(qF.onKeyDown, (n) => {
|
|
3591
3591
|
let _ = n.target.closest("[data-radix-menu-content]") === n.currentTarget, E = n.ctrlKey || n.altKey || n.metaKey, O = n.key.length === 1;
|
|
3592
|
-
_ && (n.key === "Tab" && n.preventDefault(), !E && O &&
|
|
3593
|
-
let A =
|
|
3592
|
+
_ && (n.key === "Tab" && n.preventDefault(), !E && O && fI(n.key));
|
|
3593
|
+
let A = tI.current;
|
|
3594
3594
|
if (n.target !== A || !FIRST_LAST_KEYS.includes(n.key)) return;
|
|
3595
3595
|
n.preventDefault();
|
|
3596
|
-
let j =
|
|
3596
|
+
let j = QF().filter((n) => !n.disabled).map((n) => n.ref.current);
|
|
3597
3597
|
LAST_KEYS.includes(n.key) && j.reverse(), focusFirst(j);
|
|
3598
3598
|
}),
|
|
3599
3599
|
onBlur: composeEventHandlers(_.onBlur, (n) => {
|
|
3600
|
-
n.currentTarget.contains(n.target) || (window.clearTimeout(
|
|
3600
|
+
n.currentTarget.contains(n.target) || (window.clearTimeout(rI.current), iI.current = "");
|
|
3601
3601
|
}),
|
|
3602
3602
|
onPointerMove: composeEventHandlers(_.onPointerMove, whenMouse((n) => {
|
|
3603
|
-
let _ = n.target, E =
|
|
3604
|
-
n.currentTarget.contains(_) && E && (
|
|
3603
|
+
let _ = n.target, E = lI.current !== n.clientX;
|
|
3604
|
+
n.currentTarget.contains(_) && E && (cI.current = n.clientX > lI.current ? "right" : "left", lI.current = n.clientX);
|
|
3605
3605
|
}))
|
|
3606
3606
|
})
|
|
3607
3607
|
})
|
|
@@ -4549,11 +4549,11 @@ function useStateMachine(_, E) {
|
|
|
4549
4549
|
return React$1.useReducer((n, _) => E[n][_] ?? n, _);
|
|
4550
4550
|
}
|
|
4551
4551
|
var SCROLL_AREA_NAME = "ScrollArea", [createScrollAreaContext, createScrollAreaScope] = createContextScope(SCROLL_AREA_NAME), [ScrollAreaProvider, useScrollAreaContext] = createScrollAreaContext(SCROLL_AREA_NAME), ScrollArea = React$1.forwardRef((_, E) => {
|
|
4552
|
-
let { __scopeScrollArea: O, type: A = "hover", dir: j, scrollHideDelay: M = 600, ...N } = _, [P, z] = React$1.useState(null), [B, H] = React$1.useState(null), [U, W] = React$1.useState(null), [G, Z] = React$1.useState(null), [
|
|
4552
|
+
let { __scopeScrollArea: O, type: A = "hover", dir: j, scrollHideDelay: M = 600, ...N } = _, [P, z] = React$1.useState(null), [B, H] = React$1.useState(null), [U, W] = React$1.useState(null), [G, Z] = React$1.useState(null), [qF, JF] = React$1.useState(null), [YF, XF] = React$1.useState(0), [ZF, QF] = React$1.useState(0), [$F, eI] = React$1.useState(!1), [tI, nI] = React$1.useState(!1), rI = useComposedRefs$1(E, (n) => z(n)), iI = useDirection(j);
|
|
4553
4553
|
return /* @__PURE__ */ jsx(ScrollAreaProvider, {
|
|
4554
4554
|
scope: O,
|
|
4555
4555
|
type: A,
|
|
4556
|
-
dir:
|
|
4556
|
+
dir: iI,
|
|
4557
4557
|
scrollHideDelay: M,
|
|
4558
4558
|
scrollArea: P,
|
|
4559
4559
|
viewport: B,
|
|
@@ -4562,22 +4562,22 @@ var SCROLL_AREA_NAME = "ScrollArea", [createScrollAreaContext, createScrollAreaS
|
|
|
4562
4562
|
onContentChange: W,
|
|
4563
4563
|
scrollbarX: G,
|
|
4564
4564
|
onScrollbarXChange: Z,
|
|
4565
|
-
scrollbarXEnabled:
|
|
4566
|
-
onScrollbarXEnabledChange:
|
|
4567
|
-
scrollbarY:
|
|
4568
|
-
onScrollbarYChange:
|
|
4569
|
-
scrollbarYEnabled:
|
|
4570
|
-
onScrollbarYEnabledChange:
|
|
4571
|
-
onCornerWidthChange:
|
|
4572
|
-
onCornerHeightChange:
|
|
4565
|
+
scrollbarXEnabled: $F,
|
|
4566
|
+
onScrollbarXEnabledChange: eI,
|
|
4567
|
+
scrollbarY: qF,
|
|
4568
|
+
onScrollbarYChange: JF,
|
|
4569
|
+
scrollbarYEnabled: tI,
|
|
4570
|
+
onScrollbarYEnabledChange: nI,
|
|
4571
|
+
onCornerWidthChange: XF,
|
|
4572
|
+
onCornerHeightChange: QF,
|
|
4573
4573
|
children: /* @__PURE__ */ jsx(Primitive.div, {
|
|
4574
|
-
dir:
|
|
4574
|
+
dir: iI,
|
|
4575
4575
|
...N,
|
|
4576
|
-
ref:
|
|
4576
|
+
ref: rI,
|
|
4577
4577
|
style: {
|
|
4578
4578
|
position: "relative",
|
|
4579
|
-
"--radix-scroll-area-corner-width":
|
|
4580
|
-
"--radix-scroll-area-corner-height":
|
|
4579
|
+
"--radix-scroll-area-corner-width": YF + "px",
|
|
4580
|
+
"--radix-scroll-area-corner-height": ZF + "px",
|
|
4581
4581
|
..._.style
|
|
4582
4582
|
}
|
|
4583
4583
|
})
|
|
@@ -4848,46 +4848,46 @@ var ScrollAreaScrollbarHover = React$1.forwardRef((_, E) => {
|
|
|
4848
4848
|
}
|
|
4849
4849
|
});
|
|
4850
4850
|
}), [ScrollbarProvider, useScrollbarContext] = createScrollAreaContext(SCROLLBAR_NAME), ScrollAreaScrollbarImpl = React$1.forwardRef((_, E) => {
|
|
4851
|
-
let { __scopeScrollArea: O, sizes: A, hasThumb: j, onThumbChange: M, onThumbPointerUp: N, onThumbPointerDown: P, onThumbPositionChange: z, onDragScroll: B, onWheelScroll: H, onResize: U, ...W } = _, G = useScrollAreaContext(SCROLLBAR_NAME, O), [Z,
|
|
4852
|
-
function
|
|
4853
|
-
|
|
4854
|
-
x: n.clientX -
|
|
4855
|
-
y: n.clientY -
|
|
4851
|
+
let { __scopeScrollArea: O, sizes: A, hasThumb: j, onThumbChange: M, onThumbPointerUp: N, onThumbPointerDown: P, onThumbPositionChange: z, onDragScroll: B, onWheelScroll: H, onResize: U, ...W } = _, G = useScrollAreaContext(SCROLLBAR_NAME, O), [Z, qF] = React$1.useState(null), JF = useComposedRefs$1(E, (n) => qF(n)), YF = React$1.useRef(null), XF = React$1.useRef(""), ZF = G.viewport, QF = A.content - A.viewport, $F = useCallbackRef(H), eI = useCallbackRef(z), tI = useDebounceCallback(U, 10);
|
|
4852
|
+
function nI(n) {
|
|
4853
|
+
YF.current && B({
|
|
4854
|
+
x: n.clientX - YF.current.left,
|
|
4855
|
+
y: n.clientY - YF.current.top
|
|
4856
4856
|
});
|
|
4857
4857
|
}
|
|
4858
4858
|
return React$1.useEffect(() => {
|
|
4859
4859
|
let n = (n) => {
|
|
4860
4860
|
let _ = n.target;
|
|
4861
|
-
Z?.contains(_) &&
|
|
4861
|
+
Z?.contains(_) && $F(n, QF);
|
|
4862
4862
|
};
|
|
4863
4863
|
return document.addEventListener("wheel", n, { passive: !1 }), () => document.removeEventListener("wheel", n, { passive: !1 });
|
|
4864
4864
|
}, [
|
|
4865
|
-
XF,
|
|
4866
|
-
Z,
|
|
4867
4865
|
ZF,
|
|
4868
|
-
|
|
4869
|
-
|
|
4866
|
+
Z,
|
|
4867
|
+
QF,
|
|
4868
|
+
$F
|
|
4869
|
+
]), React$1.useEffect(eI, [A, eI]), useResizeObserver$1(Z, tI), useResizeObserver$1(G.content, tI), /* @__PURE__ */ jsx(ScrollbarProvider, {
|
|
4870
4870
|
scope: O,
|
|
4871
4871
|
scrollbar: Z,
|
|
4872
4872
|
hasThumb: j,
|
|
4873
4873
|
onThumbChange: useCallbackRef(M),
|
|
4874
4874
|
onThumbPointerUp: useCallbackRef(N),
|
|
4875
|
-
onThumbPositionChange:
|
|
4875
|
+
onThumbPositionChange: eI,
|
|
4876
4876
|
onThumbPointerDown: useCallbackRef(P),
|
|
4877
4877
|
children: /* @__PURE__ */ jsx(Primitive.div, {
|
|
4878
4878
|
...W,
|
|
4879
|
-
ref:
|
|
4879
|
+
ref: JF,
|
|
4880
4880
|
style: {
|
|
4881
4881
|
position: "absolute",
|
|
4882
4882
|
...W.style
|
|
4883
4883
|
},
|
|
4884
4884
|
onPointerDown: composeEventHandlers(_.onPointerDown, (n) => {
|
|
4885
|
-
n.button === 0 && (n.target.setPointerCapture(n.pointerId),
|
|
4885
|
+
n.button === 0 && (n.target.setPointerCapture(n.pointerId), YF.current = Z.getBoundingClientRect(), XF.current = document.body.style.webkitUserSelect, document.body.style.webkitUserSelect = "none", G.viewport && (G.viewport.style.scrollBehavior = "auto"), nI(n));
|
|
4886
4886
|
}),
|
|
4887
|
-
onPointerMove: composeEventHandlers(_.onPointerMove,
|
|
4887
|
+
onPointerMove: composeEventHandlers(_.onPointerMove, nI),
|
|
4888
4888
|
onPointerUp: composeEventHandlers(_.onPointerUp, (n) => {
|
|
4889
4889
|
let _ = n.target;
|
|
4890
|
-
_.hasPointerCapture(n.pointerId) && _.releasePointerCapture(n.pointerId), document.body.style.webkitUserSelect =
|
|
4890
|
+
_.hasPointerCapture(n.pointerId) && _.releasePointerCapture(n.pointerId), document.body.style.webkitUserSelect = XF.current, G.viewport && (G.viewport.style.scrollBehavior = ""), YF.current = null;
|
|
4891
4891
|
})
|
|
4892
4892
|
})
|
|
4893
4893
|
});
|
|
@@ -5029,7 +5029,7 @@ function useResizeObserver$1(n, _) {
|
|
|
5029
5029
|
}, [n, E]);
|
|
5030
5030
|
}
|
|
5031
5031
|
var Root$1 = ScrollArea, Viewport = ScrollAreaViewport, Scrollbar = ScrollAreaScrollbar, Thumb$1 = ScrollAreaThumb, Corner = ScrollAreaCorner, SWITCH_NAME = "Switch", [createSwitchContext, createSwitchScope] = createContextScope(SWITCH_NAME), [SwitchProvider, useSwitchContext] = createSwitchContext(SWITCH_NAME), Switch = React$1.forwardRef((_, E) => {
|
|
5032
|
-
let { __scopeSwitch: O, name: A, checked: j, defaultChecked: M, required: N, disabled: P, value: z = "on", onCheckedChange: B, form: H, ...U } = _, [W, G] = React$1.useState(null), Z = useComposedRefs$1(E, (n) => G(n)),
|
|
5032
|
+
let { __scopeSwitch: O, name: A, checked: j, defaultChecked: M, required: N, disabled: P, value: z = "on", onCheckedChange: B, form: H, ...U } = _, [W, G] = React$1.useState(null), Z = useComposedRefs$1(E, (n) => G(n)), qF = React$1.useRef(!1), JF = W ? H || !!W.closest("form") : !0, [YF, XF] = useControllableState({
|
|
5033
5033
|
prop: j,
|
|
5034
5034
|
defaultProp: M ?? !1,
|
|
5035
5035
|
onChange: B,
|
|
@@ -5037,28 +5037,28 @@ var Root$1 = ScrollArea, Viewport = ScrollAreaViewport, Scrollbar = ScrollAreaSc
|
|
|
5037
5037
|
});
|
|
5038
5038
|
return /* @__PURE__ */ jsxs(SwitchProvider, {
|
|
5039
5039
|
scope: O,
|
|
5040
|
-
checked:
|
|
5040
|
+
checked: YF,
|
|
5041
5041
|
disabled: P,
|
|
5042
5042
|
children: [/* @__PURE__ */ jsx(Primitive.button, {
|
|
5043
5043
|
type: "button",
|
|
5044
5044
|
role: "switch",
|
|
5045
|
-
"aria-checked":
|
|
5045
|
+
"aria-checked": YF,
|
|
5046
5046
|
"aria-required": N,
|
|
5047
|
-
"data-state": getState(
|
|
5047
|
+
"data-state": getState(YF),
|
|
5048
5048
|
"data-disabled": P ? "" : void 0,
|
|
5049
5049
|
disabled: P,
|
|
5050
5050
|
value: z,
|
|
5051
5051
|
...U,
|
|
5052
5052
|
ref: Z,
|
|
5053
5053
|
onClick: composeEventHandlers(_.onClick, (n) => {
|
|
5054
|
-
|
|
5054
|
+
XF((n) => !n), JF && (qF.current = n.isPropagationStopped(), qF.current || n.stopPropagation());
|
|
5055
5055
|
})
|
|
5056
|
-
}),
|
|
5056
|
+
}), JF && /* @__PURE__ */ jsx(SwitchBubbleInput, {
|
|
5057
5057
|
control: W,
|
|
5058
|
-
bubbles: !
|
|
5058
|
+
bubbles: !qF.current,
|
|
5059
5059
|
name: A,
|
|
5060
5060
|
value: z,
|
|
5061
|
-
checked:
|
|
5061
|
+
checked: YF,
|
|
5062
5062
|
required: N,
|
|
5063
5063
|
disabled: P,
|
|
5064
5064
|
form: H,
|
|
@@ -5242,22 +5242,22 @@ var Root2 = Tabs, List = TabsList, Trigger$1 = TabsTrigger, Content = TabsConten
|
|
|
5242
5242
|
};
|
|
5243
5243
|
TooltipProvider.displayName = PROVIDER_NAME;
|
|
5244
5244
|
var TOOLTIP_NAME = "Tooltip", [TooltipContextProvider, useTooltipContext] = createTooltipContext(TOOLTIP_NAME), Tooltip = (_) => {
|
|
5245
|
-
let { __scopeTooltip: E, children: O, open: A, defaultOpen: j, onOpenChange: M, disableHoverableContent: N, delayDuration: P } = _, z = useTooltipProviderContext(TOOLTIP_NAME, _.__scopeTooltip), B = usePopperScope(E), [H, U] = React$1.useState(null), W = useId$1(), G = React$1.useRef(0), Z = N ?? z.disableHoverableContent,
|
|
5245
|
+
let { __scopeTooltip: E, children: O, open: A, defaultOpen: j, onOpenChange: M, disableHoverableContent: N, delayDuration: P } = _, z = useTooltipProviderContext(TOOLTIP_NAME, _.__scopeTooltip), B = usePopperScope(E), [H, U] = React$1.useState(null), W = useId$1(), G = React$1.useRef(0), Z = N ?? z.disableHoverableContent, qF = P ?? z.delayDuration, JF = React$1.useRef(!1), [YF, XF] = useControllableState({
|
|
5246
5246
|
prop: A,
|
|
5247
5247
|
defaultProp: j ?? !1,
|
|
5248
5248
|
onChange: (n) => {
|
|
5249
5249
|
n ? (z.onOpen(), document.dispatchEvent(new CustomEvent(TOOLTIP_OPEN))) : z.onClose(), M?.(n);
|
|
5250
5250
|
},
|
|
5251
5251
|
caller: TOOLTIP_NAME
|
|
5252
|
-
}),
|
|
5253
|
-
window.clearTimeout(G.current), G.current = 0,
|
|
5254
|
-
}, [
|
|
5255
|
-
window.clearTimeout(G.current), G.current = 0,
|
|
5256
|
-
}, [
|
|
5252
|
+
}), ZF = React$1.useMemo(() => YF ? JF.current ? "delayed-open" : "instant-open" : "closed", [YF]), QF = React$1.useCallback(() => {
|
|
5253
|
+
window.clearTimeout(G.current), G.current = 0, JF.current = !1, XF(!0);
|
|
5254
|
+
}, [XF]), $F = React$1.useCallback(() => {
|
|
5255
|
+
window.clearTimeout(G.current), G.current = 0, XF(!1);
|
|
5256
|
+
}, [XF]), eI = React$1.useCallback(() => {
|
|
5257
5257
|
window.clearTimeout(G.current), G.current = window.setTimeout(() => {
|
|
5258
|
-
|
|
5259
|
-
},
|
|
5260
|
-
}, [
|
|
5258
|
+
JF.current = !0, XF(!0), G.current = 0;
|
|
5259
|
+
}, qF);
|
|
5260
|
+
}, [qF, XF]);
|
|
5261
5261
|
return React$1.useEffect(() => () => {
|
|
5262
5262
|
G.current &&= (window.clearTimeout(G.current), 0);
|
|
5263
5263
|
}, []), /* @__PURE__ */ jsx(Root2$4, {
|
|
@@ -5265,22 +5265,22 @@ var TOOLTIP_NAME = "Tooltip", [TooltipContextProvider, useTooltipContext] = crea
|
|
|
5265
5265
|
children: /* @__PURE__ */ jsx(TooltipContextProvider, {
|
|
5266
5266
|
scope: E,
|
|
5267
5267
|
contentId: W,
|
|
5268
|
-
open:
|
|
5269
|
-
stateAttribute:
|
|
5268
|
+
open: YF,
|
|
5269
|
+
stateAttribute: ZF,
|
|
5270
5270
|
trigger: H,
|
|
5271
5271
|
onTriggerChange: U,
|
|
5272
5272
|
onTriggerEnter: React$1.useCallback(() => {
|
|
5273
|
-
z.isOpenDelayedRef.current ?
|
|
5273
|
+
z.isOpenDelayedRef.current ? eI() : QF();
|
|
5274
5274
|
}, [
|
|
5275
5275
|
z.isOpenDelayedRef,
|
|
5276
|
-
|
|
5277
|
-
|
|
5276
|
+
eI,
|
|
5277
|
+
QF
|
|
5278
5278
|
]),
|
|
5279
5279
|
onTriggerLeave: React$1.useCallback(() => {
|
|
5280
|
-
Z ?
|
|
5281
|
-
}, [
|
|
5282
|
-
onOpen:
|
|
5283
|
-
onClose:
|
|
5280
|
+
Z ? $F() : (window.clearTimeout(G.current), G.current = 0);
|
|
5281
|
+
}, [$F, Z]),
|
|
5282
|
+
onOpen: QF,
|
|
5283
|
+
onClose: $F,
|
|
5284
5284
|
disableHoverableContent: Z,
|
|
5285
5285
|
children: O
|
|
5286
5286
|
})
|
|
@@ -6093,14 +6093,14 @@ var I$3 = React$1.forwardRef((_, E) => {
|
|
|
6093
6093
|
React$1.useEffect(() => U(O), [O]);
|
|
6094
6094
|
let [W, G] = React$1.useState(A);
|
|
6095
6095
|
React$1.useEffect(() => G(A), [A]);
|
|
6096
|
-
let [Z,
|
|
6097
|
-
React$1.useEffect(() =>
|
|
6098
|
-
let [
|
|
6099
|
-
React$1.useEffect(() =>
|
|
6100
|
-
let [
|
|
6101
|
-
React$1.useEffect(() =>
|
|
6102
|
-
let [
|
|
6103
|
-
return React$1.useEffect(() =>
|
|
6096
|
+
let [Z, qF] = React$1.useState(j);
|
|
6097
|
+
React$1.useEffect(() => qF(j), [j]);
|
|
6098
|
+
let [JF, YF] = React$1.useState(M);
|
|
6099
|
+
React$1.useEffect(() => YF(M), [M]);
|
|
6100
|
+
let [XF, ZF] = React$1.useState(N);
|
|
6101
|
+
React$1.useEffect(() => ZF(N), [N]);
|
|
6102
|
+
let [QF, $F] = React$1.useState(P);
|
|
6103
|
+
return React$1.useEffect(() => $F(P), [P]), React$1.createElement(A$2, {
|
|
6104
6104
|
...B,
|
|
6105
6105
|
ref: E,
|
|
6106
6106
|
isRoot: !0,
|
|
@@ -6108,62 +6108,62 @@ var I$3 = React$1.forwardRef((_, E) => {
|
|
|
6108
6108
|
appearance: H,
|
|
6109
6109
|
accentColor: W,
|
|
6110
6110
|
grayColor: Z,
|
|
6111
|
-
panelBackground:
|
|
6112
|
-
radius:
|
|
6113
|
-
scaling:
|
|
6111
|
+
panelBackground: JF,
|
|
6112
|
+
radius: XF,
|
|
6113
|
+
scaling: QF,
|
|
6114
6114
|
onAppearanceChange: U,
|
|
6115
6115
|
onAccentColorChange: G,
|
|
6116
|
-
onGrayColorChange:
|
|
6117
|
-
onPanelBackgroundChange:
|
|
6118
|
-
onRadiusChange:
|
|
6119
|
-
onScalingChange:
|
|
6116
|
+
onGrayColorChange: qF,
|
|
6117
|
+
onPanelBackgroundChange: YF,
|
|
6118
|
+
onRadiusChange: ZF,
|
|
6119
|
+
onScalingChange: $F
|
|
6120
6120
|
});
|
|
6121
6121
|
});
|
|
6122
6122
|
I$3.displayName = "ThemeRoot";
|
|
6123
6123
|
var A$2 = React$1.forwardRef((_, E) => {
|
|
6124
|
-
let O = React$1.useContext(P$3), { asChild: A, isRoot: j, hasBackground: M, appearance: N = O?.appearance ?? s$13.appearance.default, accentColor: P = O?.accentColor ?? s$13.accentColor.default, grayColor: z = O?.resolvedGrayColor ?? s$13.grayColor.default, panelBackground: B = O?.panelBackground ?? s$13.panelBackground.default, radius: H = O?.radius ?? s$13.radius.default, scaling: U = O?.scaling ?? s$13.scaling.default, onAppearanceChange: W = d$5, onAccentColorChange: G = d$5, onGrayColorChange: Z = d$5, onPanelBackgroundChange:
|
|
6124
|
+
let O = React$1.useContext(P$3), { asChild: A, isRoot: j, hasBackground: M, appearance: N = O?.appearance ?? s$13.appearance.default, accentColor: P = O?.accentColor ?? s$13.accentColor.default, grayColor: z = O?.resolvedGrayColor ?? s$13.grayColor.default, panelBackground: B = O?.panelBackground ?? s$13.panelBackground.default, radius: H = O?.radius ?? s$13.radius.default, scaling: U = O?.scaling ?? s$13.scaling.default, onAppearanceChange: W = d$5, onAccentColorChange: G = d$5, onGrayColorChange: Z = d$5, onPanelBackgroundChange: qF = d$5, onRadiusChange: JF = d$5, onScalingChange: YF = d$5, ...XF } = _, ZF = A ? Slot$3 : "div", QF = z === "auto" ? a$12(P) : z, $F = _.appearance === "light" || _.appearance === "dark", eI = M === void 0 ? j || $F : M;
|
|
6125
6125
|
return React$1.createElement(P$3.Provider, { value: React$1.useMemo(() => ({
|
|
6126
6126
|
appearance: N,
|
|
6127
6127
|
accentColor: P,
|
|
6128
6128
|
grayColor: z,
|
|
6129
|
-
resolvedGrayColor:
|
|
6129
|
+
resolvedGrayColor: QF,
|
|
6130
6130
|
panelBackground: B,
|
|
6131
6131
|
radius: H,
|
|
6132
6132
|
scaling: U,
|
|
6133
6133
|
onAppearanceChange: W,
|
|
6134
6134
|
onAccentColorChange: G,
|
|
6135
6135
|
onGrayColorChange: Z,
|
|
6136
|
-
onPanelBackgroundChange:
|
|
6137
|
-
onRadiusChange:
|
|
6138
|
-
onScalingChange:
|
|
6136
|
+
onPanelBackgroundChange: qF,
|
|
6137
|
+
onRadiusChange: JF,
|
|
6138
|
+
onScalingChange: YF
|
|
6139
6139
|
}), [
|
|
6140
6140
|
N,
|
|
6141
6141
|
P,
|
|
6142
6142
|
z,
|
|
6143
|
-
|
|
6143
|
+
QF,
|
|
6144
6144
|
B,
|
|
6145
6145
|
H,
|
|
6146
6146
|
U,
|
|
6147
6147
|
W,
|
|
6148
6148
|
G,
|
|
6149
6149
|
Z,
|
|
6150
|
-
KF,
|
|
6151
6150
|
qF,
|
|
6152
|
-
JF
|
|
6153
|
-
|
|
6151
|
+
JF,
|
|
6152
|
+
YF
|
|
6153
|
+
]) }, React$1.createElement(ZF, {
|
|
6154
6154
|
"data-is-root-theme": j ? "true" : "false",
|
|
6155
6155
|
"data-accent-color": P,
|
|
6156
|
-
"data-gray-color":
|
|
6157
|
-
"data-has-background":
|
|
6156
|
+
"data-gray-color": QF,
|
|
6157
|
+
"data-has-background": eI ? "true" : "false",
|
|
6158
6158
|
"data-panel-background": B,
|
|
6159
6159
|
"data-radius": H,
|
|
6160
6160
|
"data-scaling": U,
|
|
6161
6161
|
ref: E,
|
|
6162
|
-
...
|
|
6162
|
+
...XF,
|
|
6163
6163
|
className: (0, import_classnames$20.default)("radix-themes", {
|
|
6164
6164
|
light: N === "light",
|
|
6165
6165
|
dark: N === "dark"
|
|
6166
|
-
},
|
|
6166
|
+
}, XF.className)
|
|
6167
6167
|
}));
|
|
6168
6168
|
});
|
|
6169
6169
|
A$2.displayName = "ThemeImpl";
|
|
@@ -6935,7 +6935,7 @@ function S$2(n) {
|
|
|
6935
6935
|
return [(0, import_classnames$12.default)(_, O, j, N, z, H, W), l$1(E, A, M, P, B, U, G)];
|
|
6936
6936
|
}
|
|
6937
6937
|
var import_classnames$11 = /* @__PURE__ */ __toESM(require_classnames()), c = React$1.forwardRef((_, E) => {
|
|
6938
|
-
let { rest: O, ...A } = a$5(_), [j, M] = S$2(A), { asChild: N, children: P, className: z, style: B, type: H, scrollHideDelay: U = H === "scroll" ? void 0 : 0, dir: W, size: G = t$3.size.default, radius: Z = t$3.radius.default, scrollbars:
|
|
6938
|
+
let { rest: O, ...A } = a$5(_), [j, M] = S$2(A), { asChild: N, children: P, className: z, style: B, type: H, scrollHideDelay: U = H === "scroll" ? void 0 : 0, dir: W, size: G = t$3.size.default, radius: Z = t$3.radius.default, scrollbars: qF = t$3.scrollbars.default, ...JF } = O;
|
|
6939
6939
|
return React$1.createElement(Root$1, {
|
|
6940
6940
|
type: H,
|
|
6941
6941
|
scrollHideDelay: U,
|
|
@@ -6946,10 +6946,10 @@ var import_classnames$11 = /* @__PURE__ */ __toESM(require_classnames()), c = Re
|
|
|
6946
6946
|
asChild: N,
|
|
6947
6947
|
children: P
|
|
6948
6948
|
}, (_) => React$1.createElement(React$1.Fragment, null, React$1.createElement(Viewport, {
|
|
6949
|
-
...
|
|
6949
|
+
...JF,
|
|
6950
6950
|
ref: E,
|
|
6951
6951
|
className: "rt-ScrollAreaViewport"
|
|
6952
|
-
}, _), React$1.createElement("div", { className: "rt-ScrollAreaViewportFocusRing" }),
|
|
6952
|
+
}, _), React$1.createElement("div", { className: "rt-ScrollAreaViewportFocusRing" }), qF === "vertical" ? null : React$1.createElement(Scrollbar, {
|
|
6953
6953
|
"data-radius": Z,
|
|
6954
6954
|
orientation: "horizontal",
|
|
6955
6955
|
className: (0, import_classnames$11.default)("rt-ScrollAreaScrollbar", g$3({
|
|
@@ -6957,7 +6957,7 @@ var import_classnames$11 = /* @__PURE__ */ __toESM(require_classnames()), c = Re
|
|
|
6957
6957
|
value: G,
|
|
6958
6958
|
propValues: t$3.size.values
|
|
6959
6959
|
}))
|
|
6960
|
-
}, React$1.createElement(Thumb$1, { className: "rt-ScrollAreaThumb" })),
|
|
6960
|
+
}, React$1.createElement(Thumb$1, { className: "rt-ScrollAreaThumb" })), qF === "horizontal" ? null : React$1.createElement(Scrollbar, {
|
|
6961
6961
|
"data-radius": Z,
|
|
6962
6962
|
orientation: "vertical",
|
|
6963
6963
|
className: (0, import_classnames$11.default)("rt-ScrollAreaScrollbar", g$3({
|
|
@@ -6965,7 +6965,7 @@ var import_classnames$11 = /* @__PURE__ */ __toESM(require_classnames()), c = Re
|
|
|
6965
6965
|
value: G,
|
|
6966
6966
|
propValues: t$3.size.values
|
|
6967
6967
|
}))
|
|
6968
|
-
}, React$1.createElement(Thumb$1, { className: "rt-ScrollAreaThumb" })),
|
|
6968
|
+
}, React$1.createElement(Thumb$1, { className: "rt-ScrollAreaThumb" })), qF === "both" ? React$1.createElement(Corner, { className: "rt-ScrollAreaCorner" }) : null)));
|
|
6969
6969
|
});
|
|
6970
6970
|
c.displayName = "ScrollArea";
|
|
6971
6971
|
var n$2 = {
|
|
@@ -8231,17 +8231,17 @@ function $e({ document: n, event: _, hitRegions: E, initialLayoutMap: O, mounted
|
|
|
8231
8231
|
E.forEach((n) => {
|
|
8232
8232
|
let { group: E, groupSize: P } = n, { disableCursor: z, orientation: B, panels: H } = E, U = 0;
|
|
8233
8233
|
U = j ? B === "horizontal" ? (_.clientX - j.x) / P * 100 : (_.clientY - j.y) / P * 100 : B === "horizontal" ? _.clientX < 0 ? -100 : 100 : _.clientY < 0 ? -100 : 100;
|
|
8234
|
-
let W = O.get(E), { defaultLayoutDeferred: G, derivedPanelConstraints: Z, layout:
|
|
8235
|
-
if (Z && W &&
|
|
8234
|
+
let W = O.get(E), { defaultLayoutDeferred: G, derivedPanelConstraints: Z, layout: qF, separatorToPanels: JF } = A.get(E) ?? { defaultLayoutDeferred: !1 };
|
|
8235
|
+
if (Z && W && qF && JF) {
|
|
8236
8236
|
let _ = Z$1({
|
|
8237
8237
|
delta: U,
|
|
8238
8238
|
initialLayout: W,
|
|
8239
8239
|
panelConstraints: Z,
|
|
8240
8240
|
pivotIndices: n.panels.map((n) => H.indexOf(n)),
|
|
8241
|
-
prevLayout:
|
|
8241
|
+
prevLayout: qF,
|
|
8242
8242
|
trigger: "mouse-or-touch"
|
|
8243
8243
|
});
|
|
8244
|
-
if (B$1(_,
|
|
8244
|
+
if (B$1(_, qF)) {
|
|
8245
8245
|
if (U !== 0 && !z) switch (B) {
|
|
8246
8246
|
case "horizontal":
|
|
8247
8247
|
M |= U < 0 ? De : Oe$1;
|
|
@@ -8255,7 +8255,7 @@ function $e({ document: n, event: _, hitRegions: E, initialLayoutMap: O, mounted
|
|
|
8255
8255
|
defaultLayoutDeferred: G,
|
|
8256
8256
|
derivedPanelConstraints: Z,
|
|
8257
8257
|
layout: _,
|
|
8258
|
-
separatorToPanels:
|
|
8258
|
+
separatorToPanels: JF
|
|
8259
8259
|
});
|
|
8260
8260
|
let E = n.group.panels.map(({ id: n }) => n).join(",");
|
|
8261
8261
|
n.group.inMemoryLayouts[E] = _;
|
|
@@ -8467,64 +8467,64 @@ function Pt(n, _) {
|
|
|
8467
8467
|
function Rt({ children: n, className: _, defaultLayout: E, disableCursor: O, disabled: A, elementRef: j, groupRef: M, id: N, onLayoutChange: P, orientation: z = "horizontal", style: B, ...H }) {
|
|
8468
8468
|
let U = useRef({}), W = le$1((n) => {
|
|
8469
8469
|
B$1(U.current, n) || (U.current = n, P?.(n));
|
|
8470
|
-
}), Z = ae$1(N),
|
|
8470
|
+
}), Z = ae$1(N), qF = useRef(null), [JF, YF] = useState(!1), [ZF, eI] = useState(E ?? {}), [tI, nI] = wt(), rI = useRef({
|
|
8471
8471
|
lastExpandedPanelSizes: {},
|
|
8472
8472
|
layouts: {},
|
|
8473
8473
|
panels: [],
|
|
8474
8474
|
separators: []
|
|
8475
|
-
}),
|
|
8475
|
+
}), iI = ue$1(qF, j);
|
|
8476
8476
|
Pt(Z, M);
|
|
8477
|
-
let
|
|
8477
|
+
let aI = useMemo(() => ({
|
|
8478
8478
|
id: Z,
|
|
8479
8479
|
orientation: z,
|
|
8480
8480
|
registerPanel: (n) => {
|
|
8481
|
-
let _ =
|
|
8482
|
-
return _.panels = ie$1(z, [..._.panels, n]),
|
|
8483
|
-
_.panels = _.panels.filter((_) => _ !== n),
|
|
8481
|
+
let _ = rI.current;
|
|
8482
|
+
return _.panels = ie$1(z, [..._.panels, n]), nI(), () => {
|
|
8483
|
+
_.panels = _.panels.filter((_) => _ !== n), nI();
|
|
8484
8484
|
};
|
|
8485
8485
|
},
|
|
8486
8486
|
registerSeparator: (n) => {
|
|
8487
|
-
let _ =
|
|
8488
|
-
return _.separators = ie$1(z, [..._.separators, n]),
|
|
8489
|
-
_.separators = _.separators.filter((_) => _ !== n),
|
|
8487
|
+
let _ = rI.current;
|
|
8488
|
+
return _.separators = ie$1(z, [..._.separators, n]), nI(), () => {
|
|
8489
|
+
_.separators = _.separators.filter((_) => _ !== n), nI();
|
|
8490
8490
|
};
|
|
8491
8491
|
}
|
|
8492
8492
|
}), [
|
|
8493
8493
|
Z,
|
|
8494
|
-
|
|
8494
|
+
nI,
|
|
8495
8495
|
z
|
|
8496
|
-
]),
|
|
8496
|
+
]), sI = Lt({
|
|
8497
8497
|
defaultLayout: E,
|
|
8498
8498
|
disableCursor: O
|
|
8499
|
-
}),
|
|
8499
|
+
}), cI = useRef(null);
|
|
8500
8500
|
A$1(() => {
|
|
8501
|
-
let n =
|
|
8501
|
+
let n = qF.current;
|
|
8502
8502
|
if (n === null) return;
|
|
8503
|
-
let _ =
|
|
8504
|
-
defaultLayout:
|
|
8505
|
-
disableCursor: !!
|
|
8503
|
+
let _ = rI.current, E = {
|
|
8504
|
+
defaultLayout: sI.defaultLayout,
|
|
8505
|
+
disableCursor: !!sI.disableCursor,
|
|
8506
8506
|
disabled: !!A,
|
|
8507
8507
|
element: n,
|
|
8508
8508
|
id: Z,
|
|
8509
|
-
inMemoryLastExpandedPanelSizes:
|
|
8510
|
-
inMemoryLayouts:
|
|
8509
|
+
inMemoryLastExpandedPanelSizes: rI.current.lastExpandedPanelSizes,
|
|
8510
|
+
inMemoryLayouts: rI.current.layouts,
|
|
8511
8511
|
orientation: z,
|
|
8512
8512
|
panels: _.panels,
|
|
8513
8513
|
separators: _.separators
|
|
8514
8514
|
};
|
|
8515
|
-
|
|
8515
|
+
cI.current = E;
|
|
8516
8516
|
let O = bt(E), j = D$1().mountedGroups.get(E);
|
|
8517
8517
|
if (j) {
|
|
8518
8518
|
let { defaultLayoutDeferred: n, derivedPanelConstraints: _, layout: E } = j;
|
|
8519
|
-
!n && _.length > 0 && (
|
|
8519
|
+
!n && _.length > 0 && (eI(E), W?.(E));
|
|
8520
8520
|
}
|
|
8521
8521
|
let M = T$1.addListener("interactionStateChange", (n) => {
|
|
8522
8522
|
switch (n.state) {
|
|
8523
8523
|
case "active":
|
|
8524
|
-
|
|
8524
|
+
YF(n.hitRegions.some((n) => n.group === E));
|
|
8525
8525
|
break;
|
|
8526
8526
|
default:
|
|
8527
|
-
|
|
8527
|
+
YF(!1);
|
|
8528
8528
|
break;
|
|
8529
8529
|
}
|
|
8530
8530
|
}), N = T$1.addListener("mountedGroupsChange", (n) => {
|
|
@@ -8532,30 +8532,30 @@ function Rt({ children: n, className: _, defaultLayout: E, disableCursor: O, dis
|
|
|
8532
8532
|
if (_) {
|
|
8533
8533
|
let { defaultLayoutDeferred: n, derivedPanelConstraints: E, layout: O } = _;
|
|
8534
8534
|
if (n || E.length === 0) return;
|
|
8535
|
-
|
|
8535
|
+
eI(O), W?.(O);
|
|
8536
8536
|
}
|
|
8537
8537
|
});
|
|
8538
8538
|
return () => {
|
|
8539
|
-
|
|
8539
|
+
cI.current = null, O(), M(), N();
|
|
8540
8540
|
};
|
|
8541
8541
|
}, [
|
|
8542
8542
|
A,
|
|
8543
8543
|
Z,
|
|
8544
8544
|
W,
|
|
8545
8545
|
z,
|
|
8546
|
-
|
|
8547
|
-
|
|
8546
|
+
tI,
|
|
8547
|
+
sI
|
|
8548
8548
|
]), useEffect(() => {
|
|
8549
|
-
let n =
|
|
8549
|
+
let n = cI.current;
|
|
8550
8550
|
n && (n.defaultLayout = E, n.disableCursor = !!O);
|
|
8551
8551
|
});
|
|
8552
|
-
let
|
|
8553
|
-
for (let n in
|
|
8552
|
+
let lI = { [Fe]: JF ? "none" : void 0 };
|
|
8553
|
+
for (let n in ZF) {
|
|
8554
8554
|
let _ = Ve(Z, n);
|
|
8555
|
-
|
|
8555
|
+
lI[_] = ZF[n];
|
|
8556
8556
|
}
|
|
8557
8557
|
return /* @__PURE__ */ jsx(je.Provider, {
|
|
8558
|
-
value:
|
|
8558
|
+
value: aI,
|
|
8559
8559
|
children: /* @__PURE__ */ jsx("div", {
|
|
8560
8560
|
...H,
|
|
8561
8561
|
"aria-orientation": z,
|
|
@@ -8563,13 +8563,13 @@ function Rt({ children: n, className: _, defaultLayout: E, disableCursor: O, dis
|
|
|
8563
8563
|
"data-group": !0,
|
|
8564
8564
|
"data-testid": Z,
|
|
8565
8565
|
id: Z,
|
|
8566
|
-
ref:
|
|
8566
|
+
ref: iI,
|
|
8567
8567
|
style: {
|
|
8568
8568
|
height: "100%",
|
|
8569
8569
|
width: "100%",
|
|
8570
8570
|
overflow: "hidden",
|
|
8571
8571
|
...B,
|
|
8572
|
-
...
|
|
8572
|
+
...lI,
|
|
8573
8573
|
display: "flex",
|
|
8574
8574
|
flexDirection: z === "horizontal" ? "row" : "column",
|
|
8575
8575
|
flexWrap: "nowrap"
|
|
@@ -8687,12 +8687,12 @@ function It(n, _) {
|
|
|
8687
8687
|
});
|
|
8688
8688
|
}
|
|
8689
8689
|
function kt({ children: n, className: _, collapsedSize: E = "0%", collapsible: O = !1, defaultSize: A, elementRef: j, id: M, maxSize: N = "100%", minSize: P = "0%", onResize: z, panelRef: B, style: H, ...U }) {
|
|
8690
|
-
let W = !!M, G = ae$1(M), Z = useRef(null),
|
|
8690
|
+
let W = !!M, G = ae$1(M), Z = useRef(null), qF = ue$1(Z, j), { id: JF, registerPanel: YF } = ce$1(), XF = z !== null, ZF = le$1((n, _, E) => {
|
|
8691
8691
|
z?.(n, M, E);
|
|
8692
8692
|
});
|
|
8693
8693
|
A$1(() => {
|
|
8694
8694
|
let n = Z.current;
|
|
8695
|
-
if (n !== null) return
|
|
8695
|
+
if (n !== null) return YF({
|
|
8696
8696
|
element: n,
|
|
8697
8697
|
id: G,
|
|
8698
8698
|
idIsStable: W,
|
|
@@ -8700,7 +8700,7 @@ function kt({ children: n, className: _, collapsedSize: E = "0%", collapsible: O
|
|
|
8700
8700
|
expandToSize: void 0,
|
|
8701
8701
|
prevSize: void 0
|
|
8702
8702
|
},
|
|
8703
|
-
onResize:
|
|
8703
|
+
onResize: XF ? ZF : void 0,
|
|
8704
8704
|
panelConstraints: {
|
|
8705
8705
|
collapsedSize: E,
|
|
8706
8706
|
collapsible: O,
|
|
@@ -8713,25 +8713,25 @@ function kt({ children: n, className: _, collapsedSize: E = "0%", collapsible: O
|
|
|
8713
8713
|
E,
|
|
8714
8714
|
O,
|
|
8715
8715
|
A,
|
|
8716
|
-
|
|
8716
|
+
XF,
|
|
8717
8717
|
G,
|
|
8718
8718
|
W,
|
|
8719
8719
|
N,
|
|
8720
8720
|
P,
|
|
8721
|
-
|
|
8722
|
-
|
|
8721
|
+
ZF,
|
|
8722
|
+
YF
|
|
8723
8723
|
]), It(G, B);
|
|
8724
|
-
let
|
|
8724
|
+
let $F = Ve(JF, G);
|
|
8725
8725
|
return /* @__PURE__ */ jsx("div", {
|
|
8726
8726
|
...U,
|
|
8727
8727
|
"data-panel": !0,
|
|
8728
8728
|
"data-testid": G,
|
|
8729
8729
|
id: G,
|
|
8730
|
-
ref:
|
|
8730
|
+
ref: qF,
|
|
8731
8731
|
style: {
|
|
8732
8732
|
...Gt,
|
|
8733
8733
|
flexBasis: 0,
|
|
8734
|
-
flexGrow: `var(${
|
|
8734
|
+
flexGrow: `var(${$F}, 1)`,
|
|
8735
8735
|
flexShrink: 1,
|
|
8736
8736
|
overflow: "hidden",
|
|
8737
8737
|
pointerEvents: `var(${Fe})`
|
|
@@ -8794,7 +8794,7 @@ function Dt({ layout: n, panelConstraints: _, panelId: E, panelIndex: O }) {
|
|
|
8794
8794
|
};
|
|
8795
8795
|
}
|
|
8796
8796
|
function Ot({ children: n, className: _, elementRef: E, id: O, style: A, ...j }) {
|
|
8797
|
-
let M = ae$1(O), [N, P] = useState({}), [z, B] = useState("inactive"), H = useRef(null), U = ue$1(H, E), { id: W, orientation: G, registerSeparator: Z } = ce$1(),
|
|
8797
|
+
let M = ae$1(O), [N, P] = useState({}), [z, B] = useState("inactive"), H = useRef(null), U = ue$1(H, E), { id: W, orientation: G, registerSeparator: Z } = ce$1(), qF = G === "horizontal" ? "vertical" : "horizontal";
|
|
8798
8798
|
return A$1(() => {
|
|
8799
8799
|
let n = H.current;
|
|
8800
8800
|
if (n !== null) {
|
|
@@ -8830,7 +8830,7 @@ function Ot({ children: n, className: _, elementRef: E, id: O, style: A, ...j })
|
|
|
8830
8830
|
]), /* @__PURE__ */ jsx("div", {
|
|
8831
8831
|
...j,
|
|
8832
8832
|
"aria-controls": N.valueControls,
|
|
8833
|
-
"aria-orientation":
|
|
8833
|
+
"aria-orientation": qF,
|
|
8834
8834
|
"aria-valuemax": N.valueMax,
|
|
8835
8835
|
"aria-valuemin": N.valueMin,
|
|
8836
8836
|
"aria-valuenow": N.valueNow,
|
|
@@ -8853,7 +8853,7 @@ function Ot({ children: n, className: _, elementRef: E, id: O, style: A, ...j })
|
|
|
8853
8853
|
Ot.displayName = "Separator";
|
|
8854
8854
|
var package_default = {
|
|
8855
8855
|
name: "@1urso/generic-editor",
|
|
8856
|
-
version: "0.1.
|
|
8856
|
+
version: "0.1.69",
|
|
8857
8857
|
publishConfig: { access: "public" },
|
|
8858
8858
|
type: "module",
|
|
8859
8859
|
main: "./dist/generic-editor.umd.cjs",
|
|
@@ -9081,7 +9081,7 @@ const EditorProvider = ({ children: n, isList: E = !1, availableProps: O = [], t
|
|
|
9081
9081
|
historyIndex: n,
|
|
9082
9082
|
selectedElementIds: []
|
|
9083
9083
|
} : _);
|
|
9084
|
-
}, []),
|
|
9084
|
+
}, []), qF = React.useCallback(() => {
|
|
9085
9085
|
M((n) => {
|
|
9086
9086
|
if (n.selectedElementIds.length > 0) {
|
|
9087
9087
|
let _ = n.elements.filter((_) => n.selectedElementIds.includes(_.id));
|
|
@@ -9092,7 +9092,7 @@ const EditorProvider = ({ children: n, isList: E = !1, availableProps: O = [], t
|
|
|
9092
9092
|
}
|
|
9093
9093
|
return n;
|
|
9094
9094
|
});
|
|
9095
|
-
}, []),
|
|
9095
|
+
}, []), JF = React.useCallback(() => {
|
|
9096
9096
|
M((n) => {
|
|
9097
9097
|
if (n.clipboard.length > 0) {
|
|
9098
9098
|
let _ = n.clipboard.map((n) => ({
|
|
@@ -9111,7 +9111,7 @@ const EditorProvider = ({ children: n, isList: E = !1, availableProps: O = [], t
|
|
|
9111
9111
|
}
|
|
9112
9112
|
return n;
|
|
9113
9113
|
});
|
|
9114
|
-
}, []),
|
|
9114
|
+
}, []), YF = React.useCallback((n) => {
|
|
9115
9115
|
let _ = {};
|
|
9116
9116
|
n.type === "box" && (_.backgroundColor = "var(--gray-4)"), n.type === "text-container" && (_.backgroundColor = "var(--gray-4)", _.border = "1px solid var(--gray-8)", _.padding = "8px", _.display = "flex", _.alignItems = "flex-start", _.justifyContent = "flex-start");
|
|
9117
9117
|
let E = {
|
|
@@ -9136,7 +9136,7 @@ const EditorProvider = ({ children: n, isList: E = !1, availableProps: O = [], t
|
|
|
9136
9136
|
selectedElementIds: [E.id]
|
|
9137
9137
|
};
|
|
9138
9138
|
});
|
|
9139
|
-
}, []),
|
|
9139
|
+
}, []), XF = React.useCallback((n) => {
|
|
9140
9140
|
M((_) => {
|
|
9141
9141
|
let E = _.elements.filter((_) => _.id !== n), O = _.history.slice(0, _.historyIndex + 1);
|
|
9142
9142
|
O.push(E);
|
|
@@ -9150,7 +9150,7 @@ const EditorProvider = ({ children: n, isList: E = !1, availableProps: O = [], t
|
|
|
9150
9150
|
historyIndex: O.length - 1
|
|
9151
9151
|
};
|
|
9152
9152
|
});
|
|
9153
|
-
}, []),
|
|
9153
|
+
}, []), ZF = React.useCallback(() => {
|
|
9154
9154
|
M((n) => {
|
|
9155
9155
|
if (n.selectedElementIds.length === 0) return n;
|
|
9156
9156
|
let _ = n.elements.filter((_) => !n.selectedElementIds.includes(_.id)), E = n.history.slice(0, n.historyIndex + 1);
|
|
@@ -9165,7 +9165,7 @@ const EditorProvider = ({ children: n, isList: E = !1, availableProps: O = [], t
|
|
|
9165
9165
|
historyIndex: E.length - 1
|
|
9166
9166
|
};
|
|
9167
9167
|
});
|
|
9168
|
-
}, []),
|
|
9168
|
+
}, []), QF = React.useCallback((n, _ = !1) => {
|
|
9169
9169
|
M((E) => {
|
|
9170
9170
|
if (n === null) return {
|
|
9171
9171
|
...E,
|
|
@@ -9182,12 +9182,12 @@ const EditorProvider = ({ children: n, isList: E = !1, availableProps: O = [], t
|
|
|
9182
9182
|
selectedElementIds: [n]
|
|
9183
9183
|
};
|
|
9184
9184
|
});
|
|
9185
|
-
}, []),
|
|
9185
|
+
}, []), eI = React.useCallback((n) => {
|
|
9186
9186
|
M((_) => ({
|
|
9187
9187
|
..._,
|
|
9188
9188
|
selectedElementIds: n
|
|
9189
9189
|
}));
|
|
9190
|
-
}, []),
|
|
9190
|
+
}, []), tI = React.useCallback((n, _) => {
|
|
9191
9191
|
M((E) => {
|
|
9192
9192
|
let O = [...E.elements], A = O[n];
|
|
9193
9193
|
O.splice(n, 1), O.splice(_, 0, A);
|
|
@@ -9199,7 +9199,7 @@ const EditorProvider = ({ children: n, isList: E = !1, availableProps: O = [], t
|
|
|
9199
9199
|
historyIndex: j.length - 1
|
|
9200
9200
|
};
|
|
9201
9201
|
});
|
|
9202
|
-
}, []),
|
|
9202
|
+
}, []), nI = React.useCallback((n, _, E = !0) => {
|
|
9203
9203
|
M((O) => {
|
|
9204
9204
|
let A = O.elements.map((E) => E.id === n ? {
|
|
9205
9205
|
...E,
|
|
@@ -9212,7 +9212,7 @@ const EditorProvider = ({ children: n, isList: E = !1, availableProps: O = [], t
|
|
|
9212
9212
|
historyIndex: M
|
|
9213
9213
|
};
|
|
9214
9214
|
});
|
|
9215
|
-
}, []),
|
|
9215
|
+
}, []), rI = React.useCallback((n, _ = !0) => {
|
|
9216
9216
|
M((E) => {
|
|
9217
9217
|
let O = [...E.elements], A = [], j = /* @__PURE__ */ new Set();
|
|
9218
9218
|
n.forEach(({ id: n, changes: _ }) => {
|
|
@@ -9266,7 +9266,7 @@ const EditorProvider = ({ children: n, isList: E = !1, availableProps: O = [], t
|
|
|
9266
9266
|
historyIndex: P
|
|
9267
9267
|
};
|
|
9268
9268
|
});
|
|
9269
|
-
}, []),
|
|
9269
|
+
}, []), iI = React.useCallback((n) => {
|
|
9270
9270
|
M((_) => {
|
|
9271
9271
|
let E = _.elements.filter((_) => n.includes(_.id));
|
|
9272
9272
|
if (E.length === 0) return _;
|
|
@@ -9297,7 +9297,7 @@ const EditorProvider = ({ children: n, isList: E = !1, availableProps: O = [], t
|
|
|
9297
9297
|
historyIndex: z.length - 1
|
|
9298
9298
|
};
|
|
9299
9299
|
});
|
|
9300
|
-
}, []),
|
|
9300
|
+
}, []), aI = React.useCallback((n) => {
|
|
9301
9301
|
M((_) => {
|
|
9302
9302
|
let E = _.elements.find((_) => _.id === n);
|
|
9303
9303
|
if (!E || E.type !== "group") return _;
|
|
@@ -9316,7 +9316,7 @@ const EditorProvider = ({ children: n, isList: E = !1, availableProps: O = [], t
|
|
|
9316
9316
|
historyIndex: j.length - 1
|
|
9317
9317
|
};
|
|
9318
9318
|
});
|
|
9319
|
-
}, []),
|
|
9319
|
+
}, []), sI = React.useCallback((n, _) => {
|
|
9320
9320
|
M((E) => {
|
|
9321
9321
|
let O = E.elements.map((E) => E.id === n ? {
|
|
9322
9322
|
...E,
|
|
@@ -9327,7 +9327,7 @@ const EditorProvider = ({ children: n, isList: E = !1, availableProps: O = [], t
|
|
|
9327
9327
|
elements: O
|
|
9328
9328
|
};
|
|
9329
9329
|
});
|
|
9330
|
-
}, []),
|
|
9330
|
+
}, []), cI = React.useCallback((n, _) => {
|
|
9331
9331
|
if (!n.find((n) => n.id === _ && n.type === "group")) return n;
|
|
9332
9332
|
let E = n.filter((n) => n.groupId === _);
|
|
9333
9333
|
if (E.length === 0) return n;
|
|
@@ -9339,7 +9339,7 @@ const EditorProvider = ({ children: n, isList: E = !1, availableProps: O = [], t
|
|
|
9339
9339
|
width: j - O,
|
|
9340
9340
|
height: M - A
|
|
9341
9341
|
} : n);
|
|
9342
|
-
}, []),
|
|
9342
|
+
}, []), lI = React.useCallback((n, _) => {
|
|
9343
9343
|
M((E) => {
|
|
9344
9344
|
let O = E.elements.find((_) => _.id === n), A = E.elements.find((n) => n.id === _ && n.type === "group");
|
|
9345
9345
|
if (!O || !A) return E;
|
|
@@ -9347,7 +9347,7 @@ const EditorProvider = ({ children: n, isList: E = !1, availableProps: O = [], t
|
|
|
9347
9347
|
...E,
|
|
9348
9348
|
groupId: _
|
|
9349
9349
|
} : E);
|
|
9350
|
-
j =
|
|
9350
|
+
j = cI(j, _);
|
|
9351
9351
|
let M = E.history.slice(0, E.historyIndex + 1);
|
|
9352
9352
|
M.push(j);
|
|
9353
9353
|
let N = E.historyDescriptions.slice(0, E.historyIndex + 1);
|
|
@@ -9359,7 +9359,7 @@ const EditorProvider = ({ children: n, isList: E = !1, availableProps: O = [], t
|
|
|
9359
9359
|
historyIndex: M.length - 1
|
|
9360
9360
|
};
|
|
9361
9361
|
});
|
|
9362
|
-
}, [
|
|
9362
|
+
}, [cI]), uI = React.useCallback((n) => {
|
|
9363
9363
|
M((_) => {
|
|
9364
9364
|
let E = _.elements.find((_) => _.id === n);
|
|
9365
9365
|
if (!E || !E.groupId) return _;
|
|
@@ -9367,7 +9367,7 @@ const EditorProvider = ({ children: n, isList: E = !1, availableProps: O = [], t
|
|
|
9367
9367
|
..._,
|
|
9368
9368
|
groupId: void 0
|
|
9369
9369
|
} : _);
|
|
9370
|
-
A =
|
|
9370
|
+
A = cI(A, O);
|
|
9371
9371
|
let j = _.history.slice(0, _.historyIndex + 1);
|
|
9372
9372
|
j.push(A);
|
|
9373
9373
|
let M = _.historyDescriptions.slice(0, _.historyIndex + 1);
|
|
@@ -9379,7 +9379,7 @@ const EditorProvider = ({ children: n, isList: E = !1, availableProps: O = [], t
|
|
|
9379
9379
|
historyIndex: j.length - 1
|
|
9380
9380
|
};
|
|
9381
9381
|
});
|
|
9382
|
-
}, [
|
|
9382
|
+
}, [cI]), dI = React.useCallback((n, _, E) => {
|
|
9383
9383
|
M((O) => {
|
|
9384
9384
|
let A = O.elements.find((_) => _.id === n && _.type === "group");
|
|
9385
9385
|
if (!A) return O;
|
|
@@ -9411,13 +9411,13 @@ const EditorProvider = ({ children: n, isList: E = !1, availableProps: O = [], t
|
|
|
9411
9411
|
historyIndex: B.length - 1
|
|
9412
9412
|
};
|
|
9413
9413
|
});
|
|
9414
|
-
}, []),
|
|
9414
|
+
}, []), fI = React.useCallback((n, _) => {
|
|
9415
9415
|
M((E) => ({
|
|
9416
9416
|
...E,
|
|
9417
9417
|
mockData: n,
|
|
9418
9418
|
singleMockData: _
|
|
9419
9419
|
}));
|
|
9420
|
-
}, []),
|
|
9420
|
+
}, []), pI = React.useCallback((n) => {
|
|
9421
9421
|
M((_) => ({
|
|
9422
9422
|
..._,
|
|
9423
9423
|
listSettings: {
|
|
@@ -9425,81 +9425,81 @@ const EditorProvider = ({ children: n, isList: E = !1, availableProps: O = [], t
|
|
|
9425
9425
|
...n
|
|
9426
9426
|
}
|
|
9427
9427
|
}));
|
|
9428
|
-
}, []),
|
|
9428
|
+
}, []), mI = React.useCallback((n) => {
|
|
9429
9429
|
M((_) => ({
|
|
9430
9430
|
..._,
|
|
9431
9431
|
assets: [..._.assets, n]
|
|
9432
9432
|
}));
|
|
9433
|
-
}, []),
|
|
9433
|
+
}, []), hI = React.useCallback((n) => {
|
|
9434
9434
|
M((_) => ({
|
|
9435
9435
|
..._,
|
|
9436
9436
|
assets: _.assets.filter((_) => _.id !== n)
|
|
9437
9437
|
}));
|
|
9438
|
-
}, []),
|
|
9438
|
+
}, []), gI = React.useMemo(() => ({
|
|
9439
9439
|
state: j,
|
|
9440
|
-
addElement:
|
|
9441
|
-
removeElement:
|
|
9442
|
-
removeSelected:
|
|
9443
|
-
selectElement:
|
|
9444
|
-
setSelectedElements:
|
|
9445
|
-
moveElement:
|
|
9446
|
-
updateElement:
|
|
9447
|
-
updateElements:
|
|
9448
|
-
groupElements:
|
|
9449
|
-
ungroupElements:
|
|
9450
|
-
renameElement:
|
|
9451
|
-
addToGroup:
|
|
9452
|
-
removeFromGroup:
|
|
9453
|
-
resizeGroup:
|
|
9454
|
-
setMockData:
|
|
9455
|
-
updateListSettings:
|
|
9440
|
+
addElement: YF,
|
|
9441
|
+
removeElement: XF,
|
|
9442
|
+
removeSelected: ZF,
|
|
9443
|
+
selectElement: QF,
|
|
9444
|
+
setSelectedElements: eI,
|
|
9445
|
+
moveElement: tI,
|
|
9446
|
+
updateElement: nI,
|
|
9447
|
+
updateElements: rI,
|
|
9448
|
+
groupElements: iI,
|
|
9449
|
+
ungroupElements: aI,
|
|
9450
|
+
renameElement: sI,
|
|
9451
|
+
addToGroup: lI,
|
|
9452
|
+
removeFromGroup: uI,
|
|
9453
|
+
resizeGroup: dI,
|
|
9454
|
+
setMockData: fI,
|
|
9455
|
+
updateListSettings: pI,
|
|
9456
9456
|
setCanvasHeight: N,
|
|
9457
9457
|
loadState: U,
|
|
9458
9458
|
undo: W,
|
|
9459
9459
|
redo: G,
|
|
9460
9460
|
jumpToHistory: Z,
|
|
9461
|
-
copy:
|
|
9462
|
-
paste:
|
|
9461
|
+
copy: qF,
|
|
9462
|
+
paste: JF,
|
|
9463
9463
|
setGridSize: P,
|
|
9464
9464
|
setZoom: z,
|
|
9465
9465
|
setPan: B,
|
|
9466
9466
|
setSnapLines: H,
|
|
9467
|
-
addAsset:
|
|
9468
|
-
removeAsset:
|
|
9467
|
+
addAsset: mI,
|
|
9468
|
+
removeAsset: hI
|
|
9469
9469
|
}), [
|
|
9470
9470
|
j,
|
|
9471
|
-
JF,
|
|
9472
9471
|
YF,
|
|
9473
9472
|
XF,
|
|
9474
9473
|
ZF,
|
|
9475
|
-
|
|
9474
|
+
QF,
|
|
9476
9475
|
eI,
|
|
9477
9476
|
tI,
|
|
9478
9477
|
nI,
|
|
9479
9478
|
rI,
|
|
9480
9479
|
iI,
|
|
9481
|
-
|
|
9482
|
-
|
|
9480
|
+
aI,
|
|
9481
|
+
sI,
|
|
9483
9482
|
lI,
|
|
9484
9483
|
uI,
|
|
9485
9484
|
dI,
|
|
9486
9485
|
fI,
|
|
9486
|
+
pI,
|
|
9487
9487
|
N,
|
|
9488
9488
|
U,
|
|
9489
9489
|
W,
|
|
9490
9490
|
G,
|
|
9491
9491
|
Z,
|
|
9492
|
-
KF,
|
|
9493
9492
|
qF,
|
|
9493
|
+
JF,
|
|
9494
9494
|
P,
|
|
9495
9495
|
z,
|
|
9496
9496
|
B,
|
|
9497
9497
|
H,
|
|
9498
|
-
|
|
9499
|
-
|
|
9498
|
+
mI,
|
|
9499
|
+
hI
|
|
9500
9500
|
]);
|
|
9501
9501
|
return /* @__PURE__ */ jsx(EditorContext.Provider, {
|
|
9502
|
-
value:
|
|
9502
|
+
value: gI,
|
|
9503
9503
|
children: n
|
|
9504
9504
|
});
|
|
9505
9505
|
}, useEditor = () => {
|
|
@@ -9941,16 +9941,16 @@ var __assign$1 = function() {
|
|
|
9941
9941
|
maxHeight: _
|
|
9942
9942
|
};
|
|
9943
9943
|
}, _.prototype.calculateNewSizeFromDirection = function(n, _) {
|
|
9944
|
-
var E = this.props.scale || 1, O = normalizeToPair(this.props.resizeRatio || 1), A = O[0], j = O[1], M = this.state, N = M.direction, P = M.original, z = this.props, B = z.lockAspectRatio, H = z.lockAspectRatioExtraHeight, U = z.lockAspectRatioExtraWidth, W = P.width, G = P.height, Z = H || 0,
|
|
9945
|
-
return hasDirection("right", N) && (W = P.width + (n - P.x) * A / E, B && (G = (W -
|
|
9944
|
+
var E = this.props.scale || 1, O = normalizeToPair(this.props.resizeRatio || 1), A = O[0], j = O[1], M = this.state, N = M.direction, P = M.original, z = this.props, B = z.lockAspectRatio, H = z.lockAspectRatioExtraHeight, U = z.lockAspectRatioExtraWidth, W = P.width, G = P.height, Z = H || 0, qF = U || 0;
|
|
9945
|
+
return hasDirection("right", N) && (W = P.width + (n - P.x) * A / E, B && (G = (W - qF) / this.ratio + Z)), hasDirection("left", N) && (W = P.width - (n - P.x) * A / E, B && (G = (W - qF) / this.ratio + Z)), hasDirection("bottom", N) && (G = P.height + (_ - P.y) * j / E, B && (W = (G - Z) * this.ratio + qF)), hasDirection("top", N) && (G = P.height - (_ - P.y) * j / E, B && (W = (G - Z) * this.ratio + qF)), {
|
|
9946
9946
|
newWidth: W,
|
|
9947
9947
|
newHeight: G
|
|
9948
9948
|
};
|
|
9949
9949
|
}, _.prototype.calculateNewSizeFromAspectRatio = function(n, _, E, O) {
|
|
9950
9950
|
var A = this.props, j = A.lockAspectRatio, M = A.lockAspectRatioExtraHeight, N = A.lockAspectRatioExtraWidth, P = O.width === void 0 ? 10 : O.width, z = E.width === void 0 || E.width < 0 ? n : E.width, B = O.height === void 0 ? 10 : O.height, H = E.height === void 0 || E.height < 0 ? _ : E.height, U = M || 0, W = N || 0;
|
|
9951
9951
|
if (j) {
|
|
9952
|
-
var G = (B - U) * this.ratio + W, Z = (H - U) * this.ratio + W,
|
|
9953
|
-
n = clamp$1(n,
|
|
9952
|
+
var G = (B - U) * this.ratio + W, Z = (H - U) * this.ratio + W, qF = (P - W) / this.ratio + U, JF = (z - W) / this.ratio + U, YF = Math.max(P, G), XF = Math.min(z, Z), ZF = Math.max(B, qF), QF = Math.min(H, JF);
|
|
9953
|
+
n = clamp$1(n, YF, XF), _ = clamp$1(_, ZF, QF);
|
|
9954
9954
|
} else n = clamp$1(n, P, z), _ = clamp$1(_, B, H);
|
|
9955
9955
|
return {
|
|
9956
9956
|
newWidth: n,
|
|
@@ -10007,56 +10007,56 @@ var __assign$1 = function() {
|
|
|
10007
10007
|
} catch {}
|
|
10008
10008
|
var E = this.props, O = E.maxWidth, A = E.maxHeight, j = E.minWidth, M = E.minHeight, N = isTouchEvent$1(n) ? n.touches[0].clientX : n.clientX, P = isTouchEvent$1(n) ? n.touches[0].clientY : n.clientY, z = this.state, B = z.direction, H = z.original, U = z.width, W = z.height, G = this.getParentSize(), Z = calculateNewMax(G, this.window.innerWidth, this.window.innerHeight, O, A, j, M);
|
|
10009
10009
|
O = Z.maxWidth, A = Z.maxHeight, j = Z.minWidth, M = Z.minHeight;
|
|
10010
|
-
var
|
|
10011
|
-
this.props.snap && this.props.snap.x && (
|
|
10012
|
-
var
|
|
10013
|
-
width:
|
|
10014
|
-
height:
|
|
10010
|
+
var qF = this.calculateNewSizeFromDirection(N, P), JF = qF.newHeight, YF = qF.newWidth, XF = this.calculateNewMaxFromBoundary(O, A);
|
|
10011
|
+
this.props.snap && this.props.snap.x && (YF = findClosestSnap(YF, this.props.snap.x, this.props.snapGap)), this.props.snap && this.props.snap.y && (JF = findClosestSnap(JF, this.props.snap.y, this.props.snapGap));
|
|
10012
|
+
var ZF = this.calculateNewSizeFromAspectRatio(YF, JF, {
|
|
10013
|
+
width: XF.maxWidth,
|
|
10014
|
+
height: XF.maxHeight
|
|
10015
10015
|
}, {
|
|
10016
10016
|
width: j,
|
|
10017
10017
|
height: M
|
|
10018
10018
|
});
|
|
10019
|
-
if (
|
|
10020
|
-
var
|
|
10021
|
-
|
|
10019
|
+
if (YF = ZF.newWidth, JF = ZF.newHeight, this.props.grid) {
|
|
10020
|
+
var QF = snap(YF, this.props.grid[0], this.props.gridGap ? this.props.gridGap[0] : 0), $F = snap(JF, this.props.grid[1], this.props.gridGap ? this.props.gridGap[1] : 0), eI = this.props.snapGap || 0, tI = eI === 0 || Math.abs(QF - YF) <= eI ? QF : YF, nI = eI === 0 || Math.abs($F - JF) <= eI ? $F : JF;
|
|
10021
|
+
YF = tI, JF = nI;
|
|
10022
10022
|
}
|
|
10023
|
-
var
|
|
10024
|
-
width:
|
|
10025
|
-
height:
|
|
10023
|
+
var iI = {
|
|
10024
|
+
width: YF - H.width,
|
|
10025
|
+
height: JF - H.height
|
|
10026
10026
|
};
|
|
10027
|
-
if (this.delta =
|
|
10027
|
+
if (this.delta = iI, U && typeof U == "string") {
|
|
10028
10028
|
if (U.endsWith("%")) {
|
|
10029
|
-
var
|
|
10030
|
-
|
|
10029
|
+
var aI = YF / G.width * 100;
|
|
10030
|
+
YF = `${aI}%`;
|
|
10031
10031
|
} else if (U.endsWith("vw")) {
|
|
10032
|
-
var
|
|
10033
|
-
|
|
10032
|
+
var oI = YF / this.window.innerWidth * 100;
|
|
10033
|
+
YF = `${oI}vw`;
|
|
10034
10034
|
} else if (U.endsWith("vh")) {
|
|
10035
|
-
var
|
|
10036
|
-
|
|
10035
|
+
var sI = YF / this.window.innerHeight * 100;
|
|
10036
|
+
YF = `${sI}vh`;
|
|
10037
10037
|
}
|
|
10038
10038
|
}
|
|
10039
10039
|
if (W && typeof W == "string") {
|
|
10040
10040
|
if (W.endsWith("%")) {
|
|
10041
|
-
var
|
|
10042
|
-
|
|
10041
|
+
var aI = JF / G.height * 100;
|
|
10042
|
+
JF = `${aI}%`;
|
|
10043
10043
|
} else if (W.endsWith("vw")) {
|
|
10044
|
-
var
|
|
10045
|
-
|
|
10044
|
+
var oI = JF / this.window.innerWidth * 100;
|
|
10045
|
+
JF = `${oI}vw`;
|
|
10046
10046
|
} else if (W.endsWith("vh")) {
|
|
10047
|
-
var
|
|
10048
|
-
|
|
10047
|
+
var sI = JF / this.window.innerHeight * 100;
|
|
10048
|
+
JF = `${sI}vh`;
|
|
10049
10049
|
}
|
|
10050
10050
|
}
|
|
10051
|
-
var
|
|
10052
|
-
width: this.createSizeForCssProperty(
|
|
10053
|
-
height: this.createSizeForCssProperty(
|
|
10051
|
+
var cI = {
|
|
10052
|
+
width: this.createSizeForCssProperty(YF, "width"),
|
|
10053
|
+
height: this.createSizeForCssProperty(JF, "height")
|
|
10054
10054
|
};
|
|
10055
|
-
this.flexDir === "row" ?
|
|
10056
|
-
var
|
|
10057
|
-
|
|
10058
|
-
_.setState(
|
|
10059
|
-
}), this.props.onResize &&
|
|
10055
|
+
this.flexDir === "row" ? cI.flexBasis = cI.width : this.flexDir === "column" && (cI.flexBasis = cI.height);
|
|
10056
|
+
var lI = this.state.width !== cI.width, uI = this.state.height !== cI.height, dI = this.state.flexBasis !== cI.flexBasis, fI = lI || uI || dI;
|
|
10057
|
+
fI && flushSync(function() {
|
|
10058
|
+
_.setState(cI);
|
|
10059
|
+
}), this.props.onResize && fI && this.props.onResize(n, B, this.resizable, iI);
|
|
10060
10060
|
}
|
|
10061
10061
|
}, _.prototype.onMouseUp = function(n) {
|
|
10062
10062
|
var _ = this.state, E = _.isResizing, O = _.direction;
|
|
@@ -11190,6 +11190,10 @@ var AnimationSettings = ({ element: n, updateElement: _ }) => {
|
|
|
11190
11190
|
{
|
|
11191
11191
|
label: "Cor da Borda",
|
|
11192
11192
|
value: "borderColor"
|
|
11193
|
+
},
|
|
11194
|
+
{
|
|
11195
|
+
label: "Cor da Sombra",
|
|
11196
|
+
value: "boxShadowColor"
|
|
11193
11197
|
}
|
|
11194
11198
|
], P = (E, O) => {
|
|
11195
11199
|
let j = { ...A };
|
|
@@ -11566,32 +11570,32 @@ var AnimationSettings = ({ element: n, updateElement: _ }) => {
|
|
|
11566
11570
|
});
|
|
11567
11571
|
}, stopProp = (n) => n.stopPropagation();
|
|
11568
11572
|
const ElementContextMenu = ({ children: n, element: _ }) => {
|
|
11569
|
-
let { updateElement: E, removeElement: O, removeSelected: A, addElement: j, moveElement: M, copy: N, paste: P, state: z, renameElement: B, groupElements: H, ungroupElements: U } = useEditor(), [W, G] = useState(!1), [Z,
|
|
11573
|
+
let { updateElement: E, removeElement: O, removeSelected: A, addElement: j, moveElement: M, copy: N, paste: P, state: z, renameElement: B, groupElements: H, ungroupElements: U } = useEditor(), [W, G] = useState(!1), [Z, qF] = useState(!1), [JF, YF] = useState(!1), [XF, ZF] = useState(!1), [eI, tI] = useState("formatting"), [nI, rI] = useState({
|
|
11570
11574
|
open: !1,
|
|
11571
11575
|
prop: "",
|
|
11572
11576
|
value: ""
|
|
11573
|
-
}), [
|
|
11574
|
-
let _ =
|
|
11577
|
+
}), [iI, cI] = useState(!1), [lI, uI] = useState(""), [dI, fI] = useState(""), [pI, mI] = useState(_.content), [hI, gI] = useState(_.dataBinding || ""), _I = useRef(null), vI = useRef(null), yI = (n) => {
|
|
11578
|
+
let _ = _I.current;
|
|
11575
11579
|
if (_) {
|
|
11576
|
-
let E = _.selectionStart, O = _.selectionEnd, A =
|
|
11577
|
-
|
|
11580
|
+
let E = _.selectionStart, O = _.selectionEnd, A = pI;
|
|
11581
|
+
mI(A.substring(0, E) + `{{${n}}}` + A.substring(O)), setTimeout(() => {
|
|
11578
11582
|
_.focus();
|
|
11579
11583
|
let O = E + n.length + 4;
|
|
11580
11584
|
_.setSelectionRange(O, O);
|
|
11581
11585
|
}, 0);
|
|
11582
|
-
} else
|
|
11583
|
-
},
|
|
11586
|
+
} else mI((_) => _ + `{{${n}}}`);
|
|
11587
|
+
}, bI = (n) => {
|
|
11584
11588
|
E(_.id, { style: {
|
|
11585
11589
|
..._.style,
|
|
11586
11590
|
...n
|
|
11587
11591
|
} });
|
|
11588
|
-
},
|
|
11592
|
+
}, xI = () => {
|
|
11589
11593
|
let n = z.elements.findIndex((n) => n.id === _.id);
|
|
11590
11594
|
n < z.elements.length - 1 && M(n, z.elements.length - 1);
|
|
11591
|
-
},
|
|
11595
|
+
}, SI = () => {
|
|
11592
11596
|
let n = z.elements.findIndex((n) => n.id === _.id);
|
|
11593
11597
|
n > 0 && M(n, 0);
|
|
11594
|
-
},
|
|
11598
|
+
}, CI = () => {
|
|
11595
11599
|
z.selectedElementIds.includes(_.id) && z.selectedElementIds.length > 1 ? (N(), P()) : j({
|
|
11596
11600
|
type: _.type,
|
|
11597
11601
|
content: _.content,
|
|
@@ -11601,7 +11605,7 @@ const ElementContextMenu = ({ children: n, element: _ }) => {
|
|
|
11601
11605
|
height: _.height,
|
|
11602
11606
|
style: _.style
|
|
11603
11607
|
});
|
|
11604
|
-
},
|
|
11608
|
+
}, wI = [
|
|
11605
11609
|
"#000000",
|
|
11606
11610
|
"#FFFFFF",
|
|
11607
11611
|
"#FF0000",
|
|
@@ -11611,59 +11615,95 @@ const ElementContextMenu = ({ children: n, element: _ }) => {
|
|
|
11611
11615
|
"#808080",
|
|
11612
11616
|
"#800080",
|
|
11613
11617
|
"transparent"
|
|
11614
|
-
],
|
|
11618
|
+
], TI = [
|
|
11615
11619
|
0,
|
|
11616
11620
|
1,
|
|
11617
11621
|
2,
|
|
11618
11622
|
4,
|
|
11619
11623
|
8
|
|
11620
|
-
],
|
|
11624
|
+
], EI = [
|
|
11621
11625
|
"solid",
|
|
11622
11626
|
"dashed",
|
|
11623
11627
|
"dotted",
|
|
11624
11628
|
"double"
|
|
11625
|
-
],
|
|
11626
|
-
|
|
11629
|
+
], DI = [
|
|
11630
|
+
{
|
|
11631
|
+
label: "Sem Sombra",
|
|
11632
|
+
value: "none"
|
|
11633
|
+
},
|
|
11634
|
+
{
|
|
11635
|
+
label: "Suave",
|
|
11636
|
+
value: "0 2px 8px rgba(0, 0, 0, 0.12)"
|
|
11637
|
+
},
|
|
11638
|
+
{
|
|
11639
|
+
label: "Média",
|
|
11640
|
+
value: "0 6px 16px rgba(0, 0, 0, 0.18)"
|
|
11641
|
+
},
|
|
11642
|
+
{
|
|
11643
|
+
label: "Forte",
|
|
11644
|
+
value: "0 10px 24px rgba(0, 0, 0, 0.28)"
|
|
11645
|
+
},
|
|
11646
|
+
{
|
|
11647
|
+
label: "Brilho",
|
|
11648
|
+
value: "0 0 16px rgba(0, 0, 0, 0.35)"
|
|
11649
|
+
}
|
|
11650
|
+
], OI = (n, _) => {
|
|
11651
|
+
if (!n || n === "none") return `0 4px 12px ${_}`;
|
|
11652
|
+
let E = n.split(","), O = E[E.length - 1].trim(), A = /(rgba?\([^)]+\)|#(?:[0-9a-fA-F]{3,8})|[a-zA-Z]+)\s*$/, j = A.test(O) ? O.replace(A, _) : `${O} ${_}`;
|
|
11653
|
+
return E[E.length - 1] = j, E.join(", ");
|
|
11654
|
+
}, kI = (n, _) => {
|
|
11655
|
+
rI({
|
|
11627
11656
|
open: !0,
|
|
11628
11657
|
prop: n,
|
|
11629
11658
|
value: _
|
|
11630
11659
|
});
|
|
11631
|
-
},
|
|
11632
|
-
|
|
11660
|
+
}, AI = () => {
|
|
11661
|
+
if (nI.prop === "boxShadowColor") {
|
|
11662
|
+
bI({ boxShadow: OI(_.style?.boxShadow, nI.value) }), rI((n) => ({
|
|
11663
|
+
...n,
|
|
11664
|
+
open: !1
|
|
11665
|
+
}));
|
|
11666
|
+
return;
|
|
11667
|
+
}
|
|
11668
|
+
bI({ [nI.prop]: nI.value }), rI((n) => ({
|
|
11633
11669
|
...n,
|
|
11634
11670
|
open: !1
|
|
11635
11671
|
}));
|
|
11636
|
-
},
|
|
11672
|
+
}, jI = (n) => {
|
|
11637
11673
|
if (n === 0) {
|
|
11638
|
-
|
|
11674
|
+
bI({
|
|
11639
11675
|
borderWidth: "0px",
|
|
11640
11676
|
borderStyle: "none"
|
|
11641
11677
|
});
|
|
11642
11678
|
return;
|
|
11643
11679
|
}
|
|
11644
|
-
|
|
11680
|
+
bI({
|
|
11645
11681
|
borderWidth: `${n}px`,
|
|
11646
11682
|
borderStyle: _.style?.borderStyle || "solid"
|
|
11647
11683
|
});
|
|
11648
|
-
},
|
|
11684
|
+
}, MI = (n) => {
|
|
11649
11685
|
if (!parseInt(_.style?.borderWidth || "0", 10)) {
|
|
11650
|
-
|
|
11686
|
+
bI({
|
|
11651
11687
|
borderStyle: n,
|
|
11652
11688
|
borderWidth: "1px"
|
|
11653
11689
|
});
|
|
11654
11690
|
return;
|
|
11655
11691
|
}
|
|
11656
|
-
|
|
11657
|
-
},
|
|
11692
|
+
bI({ borderStyle: n });
|
|
11693
|
+
}, NI = (n) => {
|
|
11658
11694
|
if (!parseInt(_.style?.borderWidth || "0", 10)) {
|
|
11659
|
-
|
|
11695
|
+
bI({
|
|
11660
11696
|
borderColor: n,
|
|
11661
11697
|
borderWidth: "1px",
|
|
11662
11698
|
borderStyle: _.style?.borderStyle || "solid"
|
|
11663
11699
|
});
|
|
11664
11700
|
return;
|
|
11665
11701
|
}
|
|
11666
|
-
|
|
11702
|
+
bI({ borderColor: n });
|
|
11703
|
+
}, PI = (n) => {
|
|
11704
|
+
bI({ boxShadow: n });
|
|
11705
|
+
}, FI = (n) => {
|
|
11706
|
+
bI({ boxShadow: OI(_.style?.boxShadow, n) });
|
|
11667
11707
|
};
|
|
11668
11708
|
return /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
11669
11709
|
/* @__PURE__ */ jsx(s$4, {
|
|
@@ -11676,8 +11716,8 @@ const ElementContextMenu = ({ children: n, element: _ }) => {
|
|
|
11676
11716
|
direction: "column",
|
|
11677
11717
|
gap: "3",
|
|
11678
11718
|
children: [/* @__PURE__ */ jsx(u$1, {
|
|
11679
|
-
value:
|
|
11680
|
-
onChange: (n) =>
|
|
11719
|
+
value: dI,
|
|
11720
|
+
onChange: (n) => fI(n.target.value),
|
|
11681
11721
|
placeholder: "Nome da camada..."
|
|
11682
11722
|
}), /* @__PURE__ */ jsxs(p$1, {
|
|
11683
11723
|
gap: "3",
|
|
@@ -11688,7 +11728,7 @@ const ElementContextMenu = ({ children: n, element: _ }) => {
|
|
|
11688
11728
|
children: "Cancelar"
|
|
11689
11729
|
}) }), /* @__PURE__ */ jsx(o, {
|
|
11690
11730
|
onClick: () => {
|
|
11691
|
-
B(_.id,
|
|
11731
|
+
B(_.id, dI), G(!1);
|
|
11692
11732
|
},
|
|
11693
11733
|
children: "Salvar"
|
|
11694
11734
|
})]
|
|
@@ -11698,7 +11738,7 @@ const ElementContextMenu = ({ children: n, element: _ }) => {
|
|
|
11698
11738
|
}),
|
|
11699
11739
|
/* @__PURE__ */ jsx(s$4, {
|
|
11700
11740
|
open: Z,
|
|
11701
|
-
onOpenChange:
|
|
11741
|
+
onOpenChange: qF,
|
|
11702
11742
|
children: /* @__PURE__ */ jsxs(p$8, {
|
|
11703
11743
|
style: { maxWidth: 450 },
|
|
11704
11744
|
onPointerDown: stopProp,
|
|
@@ -11707,9 +11747,9 @@ const ElementContextMenu = ({ children: n, element: _ }) => {
|
|
|
11707
11747
|
gap: "3",
|
|
11708
11748
|
children: [
|
|
11709
11749
|
/* @__PURE__ */ jsx(r$1, {
|
|
11710
|
-
ref:
|
|
11711
|
-
value:
|
|
11712
|
-
onChange: (n) =>
|
|
11750
|
+
ref: _I,
|
|
11751
|
+
value: pI,
|
|
11752
|
+
onChange: (n) => mI(n.target.value),
|
|
11713
11753
|
placeholder: "Digite o novo texto...",
|
|
11714
11754
|
style: { height: 100 }
|
|
11715
11755
|
}),
|
|
@@ -11727,7 +11767,7 @@ const ElementContextMenu = ({ children: n, element: _ }) => {
|
|
|
11727
11767
|
color: "blue",
|
|
11728
11768
|
variant: "surface",
|
|
11729
11769
|
style: { cursor: "pointer" },
|
|
11730
|
-
onClick: () =>
|
|
11770
|
+
onClick: () => yI(n.dataName),
|
|
11731
11771
|
children: n.name
|
|
11732
11772
|
}, n.dataName))
|
|
11733
11773
|
})]
|
|
@@ -11741,7 +11781,7 @@ const ElementContextMenu = ({ children: n, element: _ }) => {
|
|
|
11741
11781
|
children: "Cancelar"
|
|
11742
11782
|
}) }), /* @__PURE__ */ jsx(o, {
|
|
11743
11783
|
onClick: () => {
|
|
11744
|
-
E(_.id, { content:
|
|
11784
|
+
E(_.id, { content: pI }), qF(!1);
|
|
11745
11785
|
},
|
|
11746
11786
|
children: "Salvar"
|
|
11747
11787
|
})]
|
|
@@ -11751,8 +11791,8 @@ const ElementContextMenu = ({ children: n, element: _ }) => {
|
|
|
11751
11791
|
})
|
|
11752
11792
|
}),
|
|
11753
11793
|
/* @__PURE__ */ jsx(s$4, {
|
|
11754
|
-
open:
|
|
11755
|
-
onOpenChange:
|
|
11794
|
+
open: JF,
|
|
11795
|
+
onOpenChange: YF,
|
|
11756
11796
|
children: /* @__PURE__ */ jsxs(p$8, {
|
|
11757
11797
|
style: { maxWidth: 450 },
|
|
11758
11798
|
onPointerDown: stopProp,
|
|
@@ -11765,8 +11805,8 @@ const ElementContextMenu = ({ children: n, element: _ }) => {
|
|
|
11765
11805
|
children: "Nome da propriedade (ex: titulo, preco, imagem):"
|
|
11766
11806
|
}),
|
|
11767
11807
|
/* @__PURE__ */ jsx(u$1, {
|
|
11768
|
-
value:
|
|
11769
|
-
onChange: (n) =>
|
|
11808
|
+
value: hI,
|
|
11809
|
+
onChange: (n) => gI(n.target.value),
|
|
11770
11810
|
placeholder: "propriedade"
|
|
11771
11811
|
}),
|
|
11772
11812
|
/* @__PURE__ */ jsxs(p$1, {
|
|
@@ -11778,8 +11818,8 @@ const ElementContextMenu = ({ children: n, element: _ }) => {
|
|
|
11778
11818
|
children: "Cancelar"
|
|
11779
11819
|
}) }), /* @__PURE__ */ jsx(o, {
|
|
11780
11820
|
onClick: () => {
|
|
11781
|
-
let n =
|
|
11782
|
-
(_.type === "text" || _.type === "text-container") && (O.content = `{{${n}}}`), E(_.id, O),
|
|
11821
|
+
let n = hI, O = { dataBinding: n };
|
|
11822
|
+
(_.type === "text" || _.type === "text-container") && (O.content = `{{${n}}}`), E(_.id, O), YF(!1);
|
|
11783
11823
|
},
|
|
11784
11824
|
children: "Vincular"
|
|
11785
11825
|
})]
|
|
@@ -11789,8 +11829,8 @@ const ElementContextMenu = ({ children: n, element: _ }) => {
|
|
|
11789
11829
|
})
|
|
11790
11830
|
}),
|
|
11791
11831
|
/* @__PURE__ */ jsx(s$4, {
|
|
11792
|
-
open:
|
|
11793
|
-
onOpenChange: (n) =>
|
|
11832
|
+
open: nI.open,
|
|
11833
|
+
onOpenChange: (n) => rI((_) => ({
|
|
11794
11834
|
..._,
|
|
11795
11835
|
open: n
|
|
11796
11836
|
})),
|
|
@@ -11800,8 +11840,8 @@ const ElementContextMenu = ({ children: n, element: _ }) => {
|
|
|
11800
11840
|
children: [
|
|
11801
11841
|
/* @__PURE__ */ jsx(g$2, { children: "Selecionar Cor" }),
|
|
11802
11842
|
/* @__PURE__ */ jsx(ColorPickerContent, {
|
|
11803
|
-
color:
|
|
11804
|
-
onChange: (n) =>
|
|
11843
|
+
color: nI.value,
|
|
11844
|
+
onChange: (n) => rI((_) => ({
|
|
11805
11845
|
..._,
|
|
11806
11846
|
value: n
|
|
11807
11847
|
}))
|
|
@@ -11815,7 +11855,7 @@ const ElementContextMenu = ({ children: n, element: _ }) => {
|
|
|
11815
11855
|
color: "gray",
|
|
11816
11856
|
children: "Cancelar"
|
|
11817
11857
|
}) }), /* @__PURE__ */ jsx(o, {
|
|
11818
|
-
onClick:
|
|
11858
|
+
onClick: AI,
|
|
11819
11859
|
children: "Aplicar"
|
|
11820
11860
|
})]
|
|
11821
11861
|
})
|
|
@@ -11824,13 +11864,13 @@ const ElementContextMenu = ({ children: n, element: _ }) => {
|
|
|
11824
11864
|
}),
|
|
11825
11865
|
/* @__PURE__ */ jsx(ElementAdvancedSettings, {
|
|
11826
11866
|
elementId: _.id,
|
|
11827
|
-
open:
|
|
11828
|
-
onOpenChange:
|
|
11829
|
-
initialTab:
|
|
11867
|
+
open: XF,
|
|
11868
|
+
onOpenChange: ZF,
|
|
11869
|
+
initialTab: eI
|
|
11830
11870
|
}),
|
|
11831
11871
|
/* @__PURE__ */ jsx(s$4, {
|
|
11832
|
-
open:
|
|
11833
|
-
onOpenChange:
|
|
11872
|
+
open: iI,
|
|
11873
|
+
onOpenChange: cI,
|
|
11834
11874
|
children: /* @__PURE__ */ jsxs(p$8, {
|
|
11835
11875
|
style: { maxWidth: 450 },
|
|
11836
11876
|
onPointerDown: stopProp,
|
|
@@ -11838,8 +11878,8 @@ const ElementContextMenu = ({ children: n, element: _ }) => {
|
|
|
11838
11878
|
direction: "column",
|
|
11839
11879
|
gap: "3",
|
|
11840
11880
|
children: [/* @__PURE__ */ jsx(u$1, {
|
|
11841
|
-
value:
|
|
11842
|
-
onChange: (n) =>
|
|
11881
|
+
value: lI,
|
|
11882
|
+
onChange: (n) => uI(n.target.value),
|
|
11843
11883
|
placeholder: "https://exemplo.com/imagem.png"
|
|
11844
11884
|
}), /* @__PURE__ */ jsxs(p$1, {
|
|
11845
11885
|
gap: "3",
|
|
@@ -11850,7 +11890,7 @@ const ElementContextMenu = ({ children: n, element: _ }) => {
|
|
|
11850
11890
|
children: "Cancelar"
|
|
11851
11891
|
}) }), /* @__PURE__ */ jsx(o, {
|
|
11852
11892
|
onClick: () => {
|
|
11853
|
-
E(_.id, { content:
|
|
11893
|
+
E(_.id, { content: lI }), cI(!1);
|
|
11854
11894
|
},
|
|
11855
11895
|
children: "Aplicar"
|
|
11856
11896
|
})]
|
|
@@ -11860,7 +11900,7 @@ const ElementContextMenu = ({ children: n, element: _ }) => {
|
|
|
11860
11900
|
}),
|
|
11861
11901
|
/* @__PURE__ */ jsx("input", {
|
|
11862
11902
|
type: "file",
|
|
11863
|
-
ref:
|
|
11903
|
+
ref: vI,
|
|
11864
11904
|
style: { display: "none" },
|
|
11865
11905
|
accept: "image/*",
|
|
11866
11906
|
onChange: (n) => {
|
|
@@ -11948,7 +11988,7 @@ const ElementContextMenu = ({ children: n, element: _ }) => {
|
|
|
11948
11988
|
className: "ContextMenuItem",
|
|
11949
11989
|
onPointerDown: stopProp,
|
|
11950
11990
|
onSelect: () => {
|
|
11951
|
-
|
|
11991
|
+
gI(_.dataBinding || ""), YF(!0);
|
|
11952
11992
|
},
|
|
11953
11993
|
children: "Outro / Manual..."
|
|
11954
11994
|
}),
|
|
@@ -11966,7 +12006,7 @@ const ElementContextMenu = ({ children: n, element: _ }) => {
|
|
|
11966
12006
|
className: "ContextMenuItem",
|
|
11967
12007
|
onPointerDown: stopProp,
|
|
11968
12008
|
onSelect: () => {
|
|
11969
|
-
|
|
12009
|
+
mI(_.content), qF(!0);
|
|
11970
12010
|
},
|
|
11971
12011
|
children: "Editar Texto..."
|
|
11972
12012
|
}), /* @__PURE__ */ jsx(Separator2$1, { className: "ContextMenuSeparator" })] }),
|
|
@@ -11974,7 +12014,7 @@ const ElementContextMenu = ({ children: n, element: _ }) => {
|
|
|
11974
12014
|
className: "ContextMenuItem",
|
|
11975
12015
|
onPointerDown: stopProp,
|
|
11976
12016
|
onSelect: () => {
|
|
11977
|
-
|
|
12017
|
+
fI(_.name || (_.type === "group" ? "Grupo" : "Elemento")), G(!0);
|
|
11978
12018
|
},
|
|
11979
12019
|
children: "Renomear..."
|
|
11980
12020
|
}),
|
|
@@ -11994,14 +12034,14 @@ const ElementContextMenu = ({ children: n, element: _ }) => {
|
|
|
11994
12034
|
/* @__PURE__ */ jsx(Item2$1, {
|
|
11995
12035
|
className: "ContextMenuItem",
|
|
11996
12036
|
onPointerDown: stopProp,
|
|
11997
|
-
onSelect: () =>
|
|
12037
|
+
onSelect: () => ZF(!0),
|
|
11998
12038
|
children: "Configurações Avançadas..."
|
|
11999
12039
|
}),
|
|
12000
12040
|
/* @__PURE__ */ jsx(Separator2$1, { className: "ContextMenuSeparator" }),
|
|
12001
12041
|
/* @__PURE__ */ jsx(Item2$1, {
|
|
12002
12042
|
className: "ContextMenuItem",
|
|
12003
12043
|
onPointerDown: stopProp,
|
|
12004
|
-
onSelect:
|
|
12044
|
+
onSelect: CI,
|
|
12005
12045
|
children: z.selectedElementIds.includes(_.id) && z.selectedElementIds.length > 1 ? `Duplicar Selecionados (${z.selectedElementIds.length})` : "Duplicar"
|
|
12006
12046
|
}),
|
|
12007
12047
|
/* @__PURE__ */ jsx(Item2$1, {
|
|
@@ -12028,13 +12068,13 @@ const ElementContextMenu = ({ children: n, element: _ }) => {
|
|
|
12028
12068
|
children: [/* @__PURE__ */ jsx(Item2$1, {
|
|
12029
12069
|
className: "ContextMenuItem",
|
|
12030
12070
|
onPointerDown: stopProp,
|
|
12031
|
-
onSelect: () =>
|
|
12071
|
+
onSelect: () => vI.current?.click(),
|
|
12032
12072
|
children: "Carregar do Computador"
|
|
12033
12073
|
}), /* @__PURE__ */ jsx(Item2$1, {
|
|
12034
12074
|
className: "ContextMenuItem",
|
|
12035
12075
|
onPointerDown: stopProp,
|
|
12036
12076
|
onSelect: () => {
|
|
12037
|
-
|
|
12077
|
+
uI(typeof _.content == "string" ? _.content : ""), cI(!0);
|
|
12038
12078
|
},
|
|
12039
12079
|
children: "Inserir URL"
|
|
12040
12080
|
})]
|
|
@@ -12054,19 +12094,19 @@ const ElementContextMenu = ({ children: n, element: _ }) => {
|
|
|
12054
12094
|
/* @__PURE__ */ jsx(Item2$1, {
|
|
12055
12095
|
className: "ContextMenuItem",
|
|
12056
12096
|
onPointerDown: stopProp,
|
|
12057
|
-
onSelect: () =>
|
|
12097
|
+
onSelect: () => bI({ objectFit: "cover" }),
|
|
12058
12098
|
children: "Preencher (Cover)"
|
|
12059
12099
|
}),
|
|
12060
12100
|
/* @__PURE__ */ jsx(Item2$1, {
|
|
12061
12101
|
className: "ContextMenuItem",
|
|
12062
12102
|
onPointerDown: stopProp,
|
|
12063
|
-
onSelect: () =>
|
|
12103
|
+
onSelect: () => bI({ objectFit: "contain" }),
|
|
12064
12104
|
children: "Ajustar (Contain)"
|
|
12065
12105
|
}),
|
|
12066
12106
|
/* @__PURE__ */ jsx(Item2$1, {
|
|
12067
12107
|
className: "ContextMenuItem",
|
|
12068
12108
|
onPointerDown: stopProp,
|
|
12069
|
-
onSelect: () =>
|
|
12109
|
+
onSelect: () => bI({ objectFit: "fill" }),
|
|
12070
12110
|
children: "Esticar (Fill)"
|
|
12071
12111
|
})
|
|
12072
12112
|
]
|
|
@@ -12087,12 +12127,12 @@ const ElementContextMenu = ({ children: n, element: _ }) => {
|
|
|
12087
12127
|
children: [/* @__PURE__ */ jsx(Item2$1, {
|
|
12088
12128
|
className: "ContextMenuItem",
|
|
12089
12129
|
onPointerDown: stopProp,
|
|
12090
|
-
onSelect:
|
|
12130
|
+
onSelect: xI,
|
|
12091
12131
|
children: "Trazer para frente"
|
|
12092
12132
|
}), /* @__PURE__ */ jsx(Item2$1, {
|
|
12093
12133
|
className: "ContextMenuItem",
|
|
12094
12134
|
onPointerDown: stopProp,
|
|
12095
|
-
onSelect:
|
|
12135
|
+
onSelect: SI,
|
|
12096
12136
|
children: "Enviar para trás"
|
|
12097
12137
|
})]
|
|
12098
12138
|
}) })] }),
|
|
@@ -12112,7 +12152,7 @@ const ElementContextMenu = ({ children: n, element: _ }) => {
|
|
|
12112
12152
|
children: z.availableFonts && z.availableFonts.map((n) => /* @__PURE__ */ jsxs(Item2$1, {
|
|
12113
12153
|
className: "ContextMenuItem",
|
|
12114
12154
|
onPointerDown: stopProp,
|
|
12115
|
-
onSelect: () =>
|
|
12155
|
+
onSelect: () => bI({ fontFamily: n }),
|
|
12116
12156
|
style: { fontFamily: n },
|
|
12117
12157
|
children: [n, _.style?.fontFamily === n && /* @__PURE__ */ jsx("div", {
|
|
12118
12158
|
className: "RightSlot",
|
|
@@ -12143,7 +12183,7 @@ const ElementContextMenu = ({ children: n, element: _ }) => {
|
|
|
12143
12183
|
].map((n) => /* @__PURE__ */ jsxs(Item2$1, {
|
|
12144
12184
|
className: "ContextMenuItem",
|
|
12145
12185
|
onPointerDown: stopProp,
|
|
12146
|
-
onSelect: () =>
|
|
12186
|
+
onSelect: () => bI({ fontSize: `${n}px` }),
|
|
12147
12187
|
children: [n, "px"]
|
|
12148
12188
|
}, n))
|
|
12149
12189
|
}) })] }),
|
|
@@ -12159,10 +12199,10 @@ const ElementContextMenu = ({ children: n, element: _ }) => {
|
|
|
12159
12199
|
sideOffset: 2,
|
|
12160
12200
|
alignOffset: -5,
|
|
12161
12201
|
children: [
|
|
12162
|
-
|
|
12202
|
+
wI.filter((n) => n !== "transparent").map((n) => /* @__PURE__ */ jsxs(Item2$1, {
|
|
12163
12203
|
className: "ContextMenuItem",
|
|
12164
12204
|
onPointerDown: stopProp,
|
|
12165
|
-
onSelect: () =>
|
|
12205
|
+
onSelect: () => bI({ color: n }),
|
|
12166
12206
|
children: [/* @__PURE__ */ jsx("div", { style: {
|
|
12167
12207
|
width: 12,
|
|
12168
12208
|
height: 12,
|
|
@@ -12175,7 +12215,7 @@ const ElementContextMenu = ({ children: n, element: _ }) => {
|
|
|
12175
12215
|
/* @__PURE__ */ jsx(Item2$1, {
|
|
12176
12216
|
className: "ContextMenuItem",
|
|
12177
12217
|
onPointerDown: stopProp,
|
|
12178
|
-
onSelect: () =>
|
|
12218
|
+
onSelect: () => kI("color", _.style?.color || "#000000"),
|
|
12179
12219
|
children: "Outra Cor..."
|
|
12180
12220
|
})
|
|
12181
12221
|
]
|
|
@@ -12194,12 +12234,12 @@ const ElementContextMenu = ({ children: n, element: _ }) => {
|
|
|
12194
12234
|
children: [/* @__PURE__ */ jsx(Item2$1, {
|
|
12195
12235
|
className: "ContextMenuItem",
|
|
12196
12236
|
onPointerDown: stopProp,
|
|
12197
|
-
onSelect: () =>
|
|
12237
|
+
onSelect: () => bI({ fontWeight: "normal" }),
|
|
12198
12238
|
children: "Normal"
|
|
12199
12239
|
}), /* @__PURE__ */ jsx(Item2$1, {
|
|
12200
12240
|
className: "ContextMenuItem",
|
|
12201
12241
|
onPointerDown: stopProp,
|
|
12202
|
-
onSelect: () =>
|
|
12242
|
+
onSelect: () => bI({ fontWeight: "bold" }),
|
|
12203
12243
|
children: "Negrito"
|
|
12204
12244
|
})]
|
|
12205
12245
|
}) })] }),
|
|
@@ -12218,19 +12258,19 @@ const ElementContextMenu = ({ children: n, element: _ }) => {
|
|
|
12218
12258
|
/* @__PURE__ */ jsx(Item2$1, {
|
|
12219
12259
|
className: "ContextMenuItem",
|
|
12220
12260
|
onPointerDown: stopProp,
|
|
12221
|
-
onSelect: () =>
|
|
12261
|
+
onSelect: () => bI({ textAlign: "left" }),
|
|
12222
12262
|
children: "Esquerda"
|
|
12223
12263
|
}),
|
|
12224
12264
|
/* @__PURE__ */ jsx(Item2$1, {
|
|
12225
12265
|
className: "ContextMenuItem",
|
|
12226
12266
|
onPointerDown: stopProp,
|
|
12227
|
-
onSelect: () =>
|
|
12267
|
+
onSelect: () => bI({ textAlign: "center" }),
|
|
12228
12268
|
children: "Centro"
|
|
12229
12269
|
}),
|
|
12230
12270
|
/* @__PURE__ */ jsx(Item2$1, {
|
|
12231
12271
|
className: "ContextMenuItem",
|
|
12232
12272
|
onPointerDown: stopProp,
|
|
12233
|
-
onSelect: () =>
|
|
12273
|
+
onSelect: () => bI({ textAlign: "right" }),
|
|
12234
12274
|
children: "Direita"
|
|
12235
12275
|
})
|
|
12236
12276
|
]
|
|
@@ -12250,7 +12290,7 @@ const ElementContextMenu = ({ children: n, element: _ }) => {
|
|
|
12250
12290
|
/* @__PURE__ */ jsx(Item2$1, {
|
|
12251
12291
|
className: "ContextMenuItem",
|
|
12252
12292
|
onPointerDown: stopProp,
|
|
12253
|
-
onSelect: () =>
|
|
12293
|
+
onSelect: () => bI({
|
|
12254
12294
|
display: "flex",
|
|
12255
12295
|
flexDirection: "column",
|
|
12256
12296
|
justifyContent: "flex-start"
|
|
@@ -12260,7 +12300,7 @@ const ElementContextMenu = ({ children: n, element: _ }) => {
|
|
|
12260
12300
|
/* @__PURE__ */ jsx(Item2$1, {
|
|
12261
12301
|
className: "ContextMenuItem",
|
|
12262
12302
|
onPointerDown: stopProp,
|
|
12263
|
-
onSelect: () =>
|
|
12303
|
+
onSelect: () => bI({
|
|
12264
12304
|
display: "flex",
|
|
12265
12305
|
flexDirection: "column",
|
|
12266
12306
|
justifyContent: "center"
|
|
@@ -12270,7 +12310,7 @@ const ElementContextMenu = ({ children: n, element: _ }) => {
|
|
|
12270
12310
|
/* @__PURE__ */ jsx(Item2$1, {
|
|
12271
12311
|
className: "ContextMenuItem",
|
|
12272
12312
|
onPointerDown: stopProp,
|
|
12273
|
-
onSelect: () =>
|
|
12313
|
+
onSelect: () => bI({
|
|
12274
12314
|
display: "flex",
|
|
12275
12315
|
flexDirection: "column",
|
|
12276
12316
|
justifyContent: "flex-end"
|
|
@@ -12292,10 +12332,10 @@ const ElementContextMenu = ({ children: n, element: _ }) => {
|
|
|
12292
12332
|
sideOffset: 2,
|
|
12293
12333
|
alignOffset: -5,
|
|
12294
12334
|
children: [
|
|
12295
|
-
|
|
12335
|
+
wI.map((n) => /* @__PURE__ */ jsxs(Item2$1, {
|
|
12296
12336
|
className: "ContextMenuItem",
|
|
12297
12337
|
onPointerDown: stopProp,
|
|
12298
|
-
onSelect: () =>
|
|
12338
|
+
onSelect: () => bI({ backgroundColor: n }),
|
|
12299
12339
|
children: [/* @__PURE__ */ jsx("div", { style: {
|
|
12300
12340
|
width: 12,
|
|
12301
12341
|
height: 12,
|
|
@@ -12308,7 +12348,47 @@ const ElementContextMenu = ({ children: n, element: _ }) => {
|
|
|
12308
12348
|
/* @__PURE__ */ jsx(Item2$1, {
|
|
12309
12349
|
className: "ContextMenuItem",
|
|
12310
12350
|
onPointerDown: stopProp,
|
|
12311
|
-
onSelect: () =>
|
|
12351
|
+
onSelect: () => kI("backgroundColor", _.style?.backgroundColor || "transparent"),
|
|
12352
|
+
children: "Outra Cor..."
|
|
12353
|
+
})
|
|
12354
|
+
]
|
|
12355
|
+
}) })] }),
|
|
12356
|
+
/* @__PURE__ */ jsxs(Sub2$1, { children: [/* @__PURE__ */ jsxs(SubTrigger2$1, {
|
|
12357
|
+
className: "ContextMenuSubTrigger",
|
|
12358
|
+
onPointerDown: stopProp,
|
|
12359
|
+
children: ["Sombra", /* @__PURE__ */ jsx("div", {
|
|
12360
|
+
className: "RightSlot",
|
|
12361
|
+
children: /* @__PURE__ */ jsx(ChevronRightIcon, {})
|
|
12362
|
+
})]
|
|
12363
|
+
}), /* @__PURE__ */ jsx(Portal2$1, { children: /* @__PURE__ */ jsxs(SubContent2$1, {
|
|
12364
|
+
className: "ContextMenuSubContent",
|
|
12365
|
+
sideOffset: 2,
|
|
12366
|
+
alignOffset: -5,
|
|
12367
|
+
children: [
|
|
12368
|
+
DI.map((n) => /* @__PURE__ */ jsx(Item2$1, {
|
|
12369
|
+
className: "ContextMenuItem",
|
|
12370
|
+
onPointerDown: stopProp,
|
|
12371
|
+
onSelect: () => PI(n.value),
|
|
12372
|
+
children: n.label
|
|
12373
|
+
}, n.label)),
|
|
12374
|
+
/* @__PURE__ */ jsx(Separator2$1, { className: "ContextMenuSeparator" }),
|
|
12375
|
+
wI.filter((n) => n !== "transparent").map((n) => /* @__PURE__ */ jsxs(Item2$1, {
|
|
12376
|
+
className: "ContextMenuItem",
|
|
12377
|
+
onPointerDown: stopProp,
|
|
12378
|
+
onSelect: () => FI(n),
|
|
12379
|
+
children: [/* @__PURE__ */ jsx("div", { style: {
|
|
12380
|
+
width: 12,
|
|
12381
|
+
height: 12,
|
|
12382
|
+
backgroundColor: n,
|
|
12383
|
+
marginRight: 8,
|
|
12384
|
+
border: "1px solid #ccc"
|
|
12385
|
+
} }), n]
|
|
12386
|
+
}, n)),
|
|
12387
|
+
/* @__PURE__ */ jsx(Separator2$1, { className: "ContextMenuSeparator" }),
|
|
12388
|
+
/* @__PURE__ */ jsx(Item2$1, {
|
|
12389
|
+
className: "ContextMenuItem",
|
|
12390
|
+
onPointerDown: stopProp,
|
|
12391
|
+
onSelect: () => kI("boxShadowColor", "#000000"),
|
|
12312
12392
|
children: "Outra Cor..."
|
|
12313
12393
|
})
|
|
12314
12394
|
]
|
|
@@ -12325,24 +12405,24 @@ const ElementContextMenu = ({ children: n, element: _ }) => {
|
|
|
12325
12405
|
sideOffset: 2,
|
|
12326
12406
|
alignOffset: -5,
|
|
12327
12407
|
children: [
|
|
12328
|
-
|
|
12408
|
+
TI.map((n) => /* @__PURE__ */ jsx(Item2$1, {
|
|
12329
12409
|
className: "ContextMenuItem",
|
|
12330
12410
|
onPointerDown: stopProp,
|
|
12331
|
-
onSelect: () =>
|
|
12411
|
+
onSelect: () => jI(n),
|
|
12332
12412
|
children: n === 0 ? "Sem Borda" : `${n}px`
|
|
12333
12413
|
}, n)),
|
|
12334
12414
|
/* @__PURE__ */ jsx(Separator2$1, { className: "ContextMenuSeparator" }),
|
|
12335
|
-
|
|
12415
|
+
EI.map((n) => /* @__PURE__ */ jsx(Item2$1, {
|
|
12336
12416
|
className: "ContextMenuItem",
|
|
12337
12417
|
onPointerDown: stopProp,
|
|
12338
|
-
onSelect: () =>
|
|
12418
|
+
onSelect: () => MI(n),
|
|
12339
12419
|
children: n
|
|
12340
12420
|
}, n)),
|
|
12341
12421
|
/* @__PURE__ */ jsx(Separator2$1, { className: "ContextMenuSeparator" }),
|
|
12342
|
-
|
|
12422
|
+
wI.map((n) => /* @__PURE__ */ jsxs(Item2$1, {
|
|
12343
12423
|
className: "ContextMenuItem",
|
|
12344
12424
|
onPointerDown: stopProp,
|
|
12345
|
-
onSelect: () =>
|
|
12425
|
+
onSelect: () => NI(n),
|
|
12346
12426
|
children: [/* @__PURE__ */ jsx("div", { style: {
|
|
12347
12427
|
width: 12,
|
|
12348
12428
|
height: 12,
|
|
@@ -12355,7 +12435,7 @@ const ElementContextMenu = ({ children: n, element: _ }) => {
|
|
|
12355
12435
|
/* @__PURE__ */ jsx(Item2$1, {
|
|
12356
12436
|
className: "ContextMenuItem",
|
|
12357
12437
|
onPointerDown: stopProp,
|
|
12358
|
-
onSelect: () =>
|
|
12438
|
+
onSelect: () => kI("borderColor", _.style?.borderColor || "#000000"),
|
|
12359
12439
|
children: "Outra Cor..."
|
|
12360
12440
|
})
|
|
12361
12441
|
]
|
|
@@ -12383,7 +12463,7 @@ const ElementContextMenu = ({ children: n, element: _ }) => {
|
|
|
12383
12463
|
].map((n) => /* @__PURE__ */ jsx(Item2$1, {
|
|
12384
12464
|
className: "ContextMenuItem",
|
|
12385
12465
|
onPointerDown: stopProp,
|
|
12386
|
-
onSelect: () =>
|
|
12466
|
+
onSelect: () => bI({ borderRadius: typeof n == "number" ? `${n}px` : n }),
|
|
12387
12467
|
children: n === "50%" ? "Círculo" : `${n}px`
|
|
12388
12468
|
}, n)),
|
|
12389
12469
|
/* @__PURE__ */ jsx(Separator2$1, { className: "ContextMenuSeparator" }),
|
|
@@ -12391,7 +12471,7 @@ const ElementContextMenu = ({ children: n, element: _ }) => {
|
|
|
12391
12471
|
className: "ContextMenuItem",
|
|
12392
12472
|
onPointerDown: stopProp,
|
|
12393
12473
|
onSelect: () => {
|
|
12394
|
-
|
|
12474
|
+
tI("style"), ZF(!0);
|
|
12395
12475
|
},
|
|
12396
12476
|
children: "Personalizar..."
|
|
12397
12477
|
})
|
|
@@ -12420,7 +12500,7 @@ const ElementContextMenu = ({ children: n, element: _ }) => {
|
|
|
12420
12500
|
].map((n) => /* @__PURE__ */ jsxs(Item2$1, {
|
|
12421
12501
|
className: "ContextMenuItem",
|
|
12422
12502
|
onPointerDown: stopProp,
|
|
12423
|
-
onSelect: () =>
|
|
12503
|
+
onSelect: () => bI({ padding: `${n}px` }),
|
|
12424
12504
|
children: [n, "px"]
|
|
12425
12505
|
}, n)),
|
|
12426
12506
|
/* @__PURE__ */ jsx(Separator2$1, { className: "ContextMenuSeparator" }),
|
|
@@ -12428,7 +12508,7 @@ const ElementContextMenu = ({ children: n, element: _ }) => {
|
|
|
12428
12508
|
className: "ContextMenuItem",
|
|
12429
12509
|
onPointerDown: stopProp,
|
|
12430
12510
|
onSelect: () => {
|
|
12431
|
-
|
|
12511
|
+
tI("style"), ZF(!0);
|
|
12432
12512
|
},
|
|
12433
12513
|
children: "Personalizar..."
|
|
12434
12514
|
})
|
|
@@ -12438,55 +12518,65 @@ const ElementContextMenu = ({ children: n, element: _ }) => {
|
|
|
12438
12518
|
}) })] })
|
|
12439
12519
|
] });
|
|
12440
12520
|
}, DraggableElement = React.memo(({ element: n, isSelected: _ }) => {
|
|
12441
|
-
let { selectElement: E, updateElement: O, updateElements: A, state: j, resizeGroup: M, setSnapLines: N } = useEditor(), [P, z] = useState(!1), [B, H] = useState(!1), [U, W] = useState(!1), Z = useRef(null),
|
|
12521
|
+
let { selectElement: E, updateElement: O, updateElements: A, state: j, resizeGroup: M, setSnapLines: N } = useEditor(), [P, z] = useState(!1), [B, H] = useState(!1), [U, W] = useState(!1), Z = useRef(null), qF = useRef({
|
|
12442
12522
|
x: 0,
|
|
12443
12523
|
y: 0
|
|
12444
|
-
}),
|
|
12524
|
+
}), JF = useRef({}), YF = useRef(!1), XF = useRef(!1), ZF = useRef(0), eI = useRef(0), tI = useRef({
|
|
12445
12525
|
x: 0,
|
|
12446
12526
|
y: 0
|
|
12447
|
-
}),
|
|
12448
|
-
|
|
12449
|
-
|
|
12450
|
-
|
|
12527
|
+
}), nI = useRef(!1), rI = j.canvasHeight || 150, iI = j.isList ? j.mockData.length > 0 ? j.mockData[0] : null : j.singleMockData, aI = n.content, cI = {}, lI = (n, _) => {
|
|
12528
|
+
if (!n || n === "none") return `0 4px 12px ${_}`;
|
|
12529
|
+
let E = n.split(","), O = E[E.length - 1].trim(), A = /(rgba?\([^)]+\)|#(?:[0-9a-fA-F]{3,8})|[a-zA-Z]+)\s*$/, j = A.test(O) ? O.replace(A, _) : `${O} ${_}`;
|
|
12530
|
+
return E[E.length - 1] = j, E.join(", ");
|
|
12531
|
+
};
|
|
12532
|
+
if (iI) {
|
|
12533
|
+
if (n.type === "text" || n.type === "text-container") aI = aI.replace(/\{\{(.*?)\}\}/g, (_, E) => {
|
|
12534
|
+
let O = iI[E.trim()];
|
|
12451
12535
|
return O == null ? _ : n.formatting ? formatValue$1(O, n.formatting) : String(O);
|
|
12452
12536
|
});
|
|
12453
12537
|
else if (n.type === "image") if (n.dataBinding) {
|
|
12454
|
-
let _ =
|
|
12455
|
-
_ != null && (
|
|
12456
|
-
} else
|
|
12457
|
-
let E =
|
|
12538
|
+
let _ = iI[n.dataBinding];
|
|
12539
|
+
_ != null && (aI = String(_));
|
|
12540
|
+
} else aI = aI.replace(/\{\{(.*?)\}\}/g, (n, _) => {
|
|
12541
|
+
let E = iI[_.trim()];
|
|
12458
12542
|
return E == null ? n : String(E);
|
|
12459
12543
|
});
|
|
12460
|
-
n.styleBindings && Object.entries(n.styleBindings).forEach(([
|
|
12461
|
-
let
|
|
12462
|
-
|
|
12463
|
-
|
|
12464
|
-
|
|
12465
|
-
|
|
12544
|
+
n.styleBindings && Object.entries(n.styleBindings).forEach(([_, E]) => {
|
|
12545
|
+
let O = iI[E];
|
|
12546
|
+
if (O != null) if (_ === "boxShadowColor") {
|
|
12547
|
+
let _ = cI.boxShadow || n.style?.boxShadow;
|
|
12548
|
+
cI = {
|
|
12549
|
+
...cI,
|
|
12550
|
+
boxShadow: lI(_, String(O))
|
|
12551
|
+
};
|
|
12552
|
+
} else cI = {
|
|
12553
|
+
...cI,
|
|
12554
|
+
[_]: String(O)
|
|
12555
|
+
};
|
|
12466
12556
|
}), n.conditions && n.conditions.forEach((n) => {
|
|
12467
|
-
let _ =
|
|
12468
|
-
checkCondition$1(_, n.operator, n.value) && (
|
|
12469
|
-
...
|
|
12557
|
+
let _ = iI[n.property];
|
|
12558
|
+
checkCondition$1(_, n.operator, n.value) && (cI = {
|
|
12559
|
+
...cI,
|
|
12470
12560
|
...n.style
|
|
12471
12561
|
});
|
|
12472
12562
|
});
|
|
12473
12563
|
}
|
|
12474
|
-
let
|
|
12475
|
-
if (
|
|
12476
|
-
let { display: n, ..._ } =
|
|
12477
|
-
|
|
12564
|
+
let uI = cI.display === "none";
|
|
12565
|
+
if (uI && _) {
|
|
12566
|
+
let { display: n, ..._ } = cI;
|
|
12567
|
+
cI = _;
|
|
12478
12568
|
}
|
|
12479
|
-
let
|
|
12480
|
-
_.stopPropagation(), !
|
|
12481
|
-
},
|
|
12569
|
+
let dI = (_) => {
|
|
12570
|
+
_.stopPropagation(), !YF.current && !XF.current && !P && (_.shiftKey ? E(n.id, !0) : E(n.id, !1));
|
|
12571
|
+
}, fI = (O) => {
|
|
12482
12572
|
if (n.locked || O.button !== 0) return;
|
|
12483
12573
|
O.stopPropagation();
|
|
12484
12574
|
let A = O.shiftKey;
|
|
12485
|
-
if (
|
|
12575
|
+
if (YF.current = !1, XF.current = !1, n.groupId && !_) {
|
|
12486
12576
|
E(n.groupId, A);
|
|
12487
12577
|
return;
|
|
12488
12578
|
}
|
|
12489
|
-
_ || (E(n.id, A),
|
|
12579
|
+
_ || (E(n.id, A), XF.current = !0), z(!0), qF.current = {
|
|
12490
12580
|
x: O.clientX,
|
|
12491
12581
|
y: O.clientY
|
|
12492
12582
|
}, O.currentTarget.setPointerCapture(O.pointerId);
|
|
@@ -12498,17 +12588,17 @@ const ElementContextMenu = ({ children: n, element: _ }) => {
|
|
|
12498
12588
|
x: n.x,
|
|
12499
12589
|
y: n.y
|
|
12500
12590
|
});
|
|
12501
|
-
}),
|
|
12502
|
-
},
|
|
12591
|
+
}), JF.current = N;
|
|
12592
|
+
}, pI = (_) => {
|
|
12503
12593
|
if (P) {
|
|
12504
|
-
let E = j.zoom || 1, O = (_.clientX -
|
|
12505
|
-
(Math.abs(O) > 2 || Math.abs(M) > 2) && (
|
|
12506
|
-
let P = 5 / E, z = [], B = Object.entries(
|
|
12594
|
+
let E = j.zoom || 1, O = (_.clientX - qF.current.x) / E, M = (_.clientY - qF.current.y) / E;
|
|
12595
|
+
(Math.abs(O) > 2 || Math.abs(M) > 2) && (YF.current = !0);
|
|
12596
|
+
let P = 5 / E, z = [], B = Object.entries(JF.current).map(([_, E]) => {
|
|
12507
12597
|
let A = E.x + O, N = E.y + M;
|
|
12508
12598
|
if (j.gridSize > 0) A = Math.round(A / j.gridSize) * j.gridSize, N = Math.round(N / j.gridSize) * j.gridSize;
|
|
12509
12599
|
else {
|
|
12510
12600
|
let E = !1, O = !1, M = n.width ?? 100, B = n.height ?? 100;
|
|
12511
|
-
Object.keys(
|
|
12601
|
+
Object.keys(JF.current).length === 1 && j.elements.forEach((n) => {
|
|
12512
12602
|
if (n.id === _) return;
|
|
12513
12603
|
let j = n.width ?? 100, H = n.height ?? 100;
|
|
12514
12604
|
E || (Math.abs(A - n.x) < P ? (A = n.x, E = !0, z.push({
|
|
@@ -12541,7 +12631,7 @@ const ElementContextMenu = ({ children: n, element: _ }) => {
|
|
|
12541
12631
|
if (A = Math.max(0, A), j.isList) {
|
|
12542
12632
|
N = Math.max(0, N);
|
|
12543
12633
|
let _ = n.height ?? 100;
|
|
12544
|
-
|
|
12634
|
+
rI > 0 && (N = Math.min(N, rI - _)), N = Math.max(0, N);
|
|
12545
12635
|
}
|
|
12546
12636
|
return {
|
|
12547
12637
|
id: _,
|
|
@@ -12553,25 +12643,25 @@ const ElementContextMenu = ({ children: n, element: _ }) => {
|
|
|
12553
12643
|
});
|
|
12554
12644
|
N && N(z), A(B, !1);
|
|
12555
12645
|
}
|
|
12556
|
-
},
|
|
12646
|
+
}, mI = (n) => {
|
|
12557
12647
|
P && (z(!1), n.currentTarget.releasePointerCapture(n.pointerId), A([], !0), N && N([]));
|
|
12558
|
-
},
|
|
12648
|
+
}, hI = (_) => {
|
|
12559
12649
|
_.stopPropagation(), _.preventDefault(), W(!0);
|
|
12560
12650
|
let E = _.target.closest(".resizable-element");
|
|
12561
12651
|
if (E) {
|
|
12562
12652
|
let O = E.getBoundingClientRect();
|
|
12563
|
-
|
|
12653
|
+
tI.current = {
|
|
12564
12654
|
x: O.left + O.width / 2,
|
|
12565
12655
|
y: O.top + O.height / 2
|
|
12566
12656
|
};
|
|
12567
|
-
let A = _.clientX -
|
|
12568
|
-
|
|
12657
|
+
let A = _.clientX - tI.current.x, j = _.clientY - tI.current.y;
|
|
12658
|
+
ZF.current = Math.atan2(j, A) * (180 / Math.PI), eI.current = n.rotation || 0;
|
|
12569
12659
|
}
|
|
12570
12660
|
};
|
|
12571
12661
|
useEffect(() => {
|
|
12572
12662
|
let _ = (_) => {
|
|
12573
12663
|
if (U) {
|
|
12574
|
-
let E = _.clientX -
|
|
12664
|
+
let E = _.clientX - tI.current.x, A = _.clientY - tI.current.y, j = Math.atan2(A, E) * (180 / Math.PI) - ZF.current, M = (eI.current + j) % 360;
|
|
12575
12665
|
O(n.id, { rotation: M }, !1);
|
|
12576
12666
|
}
|
|
12577
12667
|
}, E = () => {
|
|
@@ -12593,7 +12683,7 @@ const ElementContextMenu = ({ children: n, element: _ }) => {
|
|
|
12593
12683
|
}
|
|
12594
12684
|
});
|
|
12595
12685
|
}, [
|
|
12596
|
-
|
|
12686
|
+
aI,
|
|
12597
12687
|
n.autoGrow,
|
|
12598
12688
|
n.containerExpansion,
|
|
12599
12689
|
n.style,
|
|
@@ -12603,7 +12693,7 @@ const ElementContextMenu = ({ children: n, element: _ }) => {
|
|
|
12603
12693
|
n.id,
|
|
12604
12694
|
n.type
|
|
12605
12695
|
]);
|
|
12606
|
-
let
|
|
12696
|
+
let gI = {
|
|
12607
12697
|
position: "relative",
|
|
12608
12698
|
left: 0,
|
|
12609
12699
|
top: 0,
|
|
@@ -12621,7 +12711,7 @@ const ElementContextMenu = ({ children: n, element: _ }) => {
|
|
|
12621
12711
|
userSelect: "none",
|
|
12622
12712
|
boxSizing: "border-box",
|
|
12623
12713
|
...n.style,
|
|
12624
|
-
...
|
|
12714
|
+
...cI
|
|
12625
12715
|
};
|
|
12626
12716
|
return /* @__PURE__ */ jsx(Resizable, {
|
|
12627
12717
|
className: "resizable-element",
|
|
@@ -12629,9 +12719,9 @@ const ElementContextMenu = ({ children: n, element: _ }) => {
|
|
|
12629
12719
|
width: n.width ?? 100,
|
|
12630
12720
|
height: n.autoGrow ? "auto" : n.height ?? 100
|
|
12631
12721
|
},
|
|
12632
|
-
maxHeight: j.isList ? Math.max(10,
|
|
12722
|
+
maxHeight: j.isList ? Math.max(10, rI - n.y) : void 0,
|
|
12633
12723
|
onResizeStart: (n) => {
|
|
12634
|
-
H(!0),
|
|
12724
|
+
H(!0), nI.current = !!n.shiftKey;
|
|
12635
12725
|
},
|
|
12636
12726
|
onResizeStop: (_, E, A, j) => {
|
|
12637
12727
|
H(!1);
|
|
@@ -12766,8 +12856,8 @@ const ElementContextMenu = ({ children: n, element: _ }) => {
|
|
|
12766
12856
|
position: "absolute",
|
|
12767
12857
|
transform: `translate(${n.x ?? 0}px, ${n.y ?? 0}px) rotate(${n.rotation || 0}deg)`,
|
|
12768
12858
|
height: n.autoGrow ? "auto" : void 0,
|
|
12769
|
-
display:
|
|
12770
|
-
opacity:
|
|
12859
|
+
display: uI && !_ ? "none" : void 0,
|
|
12860
|
+
opacity: uI && _ ? .4 : 1,
|
|
12771
12861
|
zIndex: _ ? 1e3 : void 0,
|
|
12772
12862
|
outline: "none",
|
|
12773
12863
|
overflow: "visible"
|
|
@@ -12782,7 +12872,7 @@ const ElementContextMenu = ({ children: n, element: _ }) => {
|
|
|
12782
12872
|
bottomLeft: !1,
|
|
12783
12873
|
topLeft: !1
|
|
12784
12874
|
} : void 0,
|
|
12785
|
-
lockAspectRatio:
|
|
12875
|
+
lockAspectRatio: nI.current,
|
|
12786
12876
|
grid: j.gridSize > 0 ? [j.gridSize, j.gridSize] : void 0,
|
|
12787
12877
|
children: /* @__PURE__ */ jsx(ElementContextMenu, {
|
|
12788
12878
|
element: n,
|
|
@@ -12795,18 +12885,18 @@ const ElementContextMenu = ({ children: n, element: _ }) => {
|
|
|
12795
12885
|
children: [/* @__PURE__ */ jsxs(p, {
|
|
12796
12886
|
ref: Z,
|
|
12797
12887
|
style: {
|
|
12798
|
-
...
|
|
12799
|
-
whiteSpace: n.type === "text-container" && n.autoGrow && n.containerExpansion === "horizontal" ? "nowrap" :
|
|
12888
|
+
...gI,
|
|
12889
|
+
whiteSpace: n.type === "text-container" && n.autoGrow && n.containerExpansion === "horizontal" ? "nowrap" : gI.whiteSpace,
|
|
12800
12890
|
width: n.type === "text-container" && n.autoGrow && n.containerExpansion === "horizontal" ? "max-content" : "100%",
|
|
12801
12891
|
height: n.type === "text-container" && n.autoGrow && n.containerExpansion === "vertical" ? "auto" : "100%"
|
|
12802
12892
|
},
|
|
12803
|
-
onPointerDown:
|
|
12804
|
-
onPointerMove:
|
|
12805
|
-
onPointerUp:
|
|
12893
|
+
onPointerDown: fI,
|
|
12894
|
+
onPointerMove: pI,
|
|
12895
|
+
onPointerUp: mI,
|
|
12806
12896
|
onMouseDown: (n) => {
|
|
12807
12897
|
n.button === 0 && n.stopPropagation();
|
|
12808
12898
|
},
|
|
12809
|
-
onClick:
|
|
12899
|
+
onClick: dI,
|
|
12810
12900
|
title: n.name,
|
|
12811
12901
|
onMouseEnter: (n) => {
|
|
12812
12902
|
_ || (n.currentTarget.style.borderColor = "var(--gray-6)");
|
|
@@ -12837,7 +12927,7 @@ const ElementContextMenu = ({ children: n, element: _ }) => {
|
|
|
12837
12927
|
width: "100%",
|
|
12838
12928
|
height: "100%"
|
|
12839
12929
|
},
|
|
12840
|
-
children:
|
|
12930
|
+
children: aI
|
|
12841
12931
|
}),
|
|
12842
12932
|
n.type === "text-container" && /* @__PURE__ */ jsx(p$2, {
|
|
12843
12933
|
style: {
|
|
@@ -12845,10 +12935,10 @@ const ElementContextMenu = ({ children: n, element: _ }) => {
|
|
|
12845
12935
|
height: "100%",
|
|
12846
12936
|
display: "block"
|
|
12847
12937
|
},
|
|
12848
|
-
children:
|
|
12938
|
+
children: aI
|
|
12849
12939
|
}),
|
|
12850
|
-
n.type === "image" && (
|
|
12851
|
-
src:
|
|
12940
|
+
n.type === "image" && (aI ? /* @__PURE__ */ jsx("img", {
|
|
12941
|
+
src: aI,
|
|
12852
12942
|
alt: "Element",
|
|
12853
12943
|
style: {
|
|
12854
12944
|
width: "100%",
|
|
@@ -12914,7 +13004,7 @@ const ElementContextMenu = ({ children: n, element: _ }) => {
|
|
|
12914
13004
|
zIndex: 50,
|
|
12915
13005
|
boxShadow: "0 0 0 2px white"
|
|
12916
13006
|
},
|
|
12917
|
-
onMouseDown:
|
|
13007
|
+
onMouseDown: hI,
|
|
12918
13008
|
onPointerDown: (n) => n.stopPropagation(),
|
|
12919
13009
|
children: /* @__PURE__ */ jsx(p, { style: {
|
|
12920
13010
|
position: "absolute",
|
|
@@ -12944,74 +13034,74 @@ const ElementContextMenu = ({ children: n, element: _ }) => {
|
|
|
12944
13034
|
borderTop: n.orientation === "horizontal" ? "1px dashed #ff0000" : "none"
|
|
12945
13035
|
} }, _)) });
|
|
12946
13036
|
}, Canvas = () => {
|
|
12947
|
-
let { state: n, selectElement: _, setSelectedElements: E, addElement: O, setZoom: A, setPan: j, undo: M, redo: N, copy: P, paste: z, removeSelected: B, updateElements: H } = useEditor(), W = useRef(null), [Z,
|
|
13037
|
+
let { state: n, selectElement: _, setSelectedElements: E, addElement: O, setZoom: A, setPan: j, undo: M, redo: N, copy: P, paste: z, removeSelected: B, updateElements: H } = useEditor(), W = useRef(null), [Z, qF] = useState(null), JF = useRef(!1), YF = useRef(!1), XF = useRef(!1), ZF = useRef({
|
|
12948
13038
|
x: 0,
|
|
12949
13039
|
y: 0
|
|
12950
|
-
}),
|
|
13040
|
+
}), eI = useRef({
|
|
12951
13041
|
x: 0,
|
|
12952
13042
|
y: 0
|
|
12953
|
-
}),
|
|
13043
|
+
}), tI = useRef([]), nI = useRef([]), rI = useRef(n), iI = useRef(0);
|
|
12954
13044
|
useEffect(() => {
|
|
12955
|
-
|
|
13045
|
+
rI.current = n;
|
|
12956
13046
|
}, [n]);
|
|
12957
|
-
let
|
|
13047
|
+
let aI = useCallback((n) => {
|
|
12958
13048
|
if (!W.current) return;
|
|
12959
|
-
let _ =
|
|
12960
|
-
if (
|
|
12961
|
-
let E = n.clientX -
|
|
13049
|
+
let _ = rI.current;
|
|
13050
|
+
if (YF.current) {
|
|
13051
|
+
let E = n.clientX - eI.current.x, O = n.clientY - eI.current.y;
|
|
12962
13052
|
j({
|
|
12963
13053
|
x: _.pan.x + E,
|
|
12964
13054
|
y: _.pan.y + O
|
|
12965
|
-
}),
|
|
13055
|
+
}), eI.current = {
|
|
12966
13056
|
x: n.clientX,
|
|
12967
13057
|
y: n.clientY
|
|
12968
13058
|
};
|
|
12969
13059
|
return;
|
|
12970
13060
|
}
|
|
12971
|
-
if (!
|
|
12972
|
-
let O = W.current.getBoundingClientRect(), A = (n.clientX - O.left - _.pan.x) / _.zoom, M = (n.clientY - O.top - _.pan.y) / _.zoom, N = Math.min(
|
|
12973
|
-
|
|
13061
|
+
if (!JF.current) return;
|
|
13062
|
+
let O = W.current.getBoundingClientRect(), A = (n.clientX - O.left - _.pan.x) / _.zoom, M = (n.clientY - O.top - _.pan.y) / _.zoom, N = Math.min(ZF.current.x, A), P = Math.min(ZF.current.y, M), z = Math.abs(A - ZF.current.x), B = Math.abs(M - ZF.current.y);
|
|
13063
|
+
qF({
|
|
12974
13064
|
x: N,
|
|
12975
13065
|
y: P,
|
|
12976
13066
|
width: z,
|
|
12977
13067
|
height: B
|
|
12978
13068
|
});
|
|
12979
13069
|
let H = Date.now();
|
|
12980
|
-
if (!(H -
|
|
13070
|
+
if (!(H - iI.current < 50) && (z > 0 || B > 0)) {
|
|
12981
13071
|
let n = [];
|
|
12982
13072
|
_.elements.forEach((_) => {
|
|
12983
13073
|
let E = _.x ?? 0, O = _.y ?? 0, A = _.width ?? 100, j = _.height ?? 100, M = E + A, H = O + j, U = N + z, W = P + B;
|
|
12984
13074
|
E < U && M > N && O < W && H > P && n.push(_.id);
|
|
12985
13075
|
});
|
|
12986
|
-
let O = Array.from(new Set([...
|
|
12987
|
-
A.length === O.length && A.every((n) => O.includes(n)) || (E(O),
|
|
13076
|
+
let O = Array.from(new Set([...tI.current, ...n])), A = nI.current;
|
|
13077
|
+
A.length === O.length && A.every((n) => O.includes(n)) || (E(O), nI.current = O, iI.current = H);
|
|
12988
13078
|
}
|
|
12989
|
-
}, [E, j]),
|
|
12990
|
-
(
|
|
12991
|
-
}, []),
|
|
13079
|
+
}, [E, j]), cI = useCallback((n) => {
|
|
13080
|
+
(JF.current || YF.current) && n.target.releasePointerCapture(n.pointerId), JF.current = !1, YF.current = !1, qF(null);
|
|
13081
|
+
}, []), lI = (E) => {
|
|
12992
13082
|
if (E.button === 2) return;
|
|
12993
13083
|
let O = E.target;
|
|
12994
13084
|
if (O.closest(".resize-handle") || O.closest(".rotate-handle")) return;
|
|
12995
|
-
if (E.currentTarget.setPointerCapture(E.pointerId), E.button === 1 || E.button === 0 &&
|
|
12996
|
-
E.preventDefault(),
|
|
13085
|
+
if (E.currentTarget.setPointerCapture(E.pointerId), E.button === 1 || E.button === 0 && XF.current) {
|
|
13086
|
+
E.preventDefault(), YF.current = !0, eI.current = {
|
|
12997
13087
|
x: E.clientX,
|
|
12998
13088
|
y: E.clientY
|
|
12999
13089
|
};
|
|
13000
13090
|
return;
|
|
13001
13091
|
}
|
|
13002
|
-
|
|
13092
|
+
JF.current = E.shiftKey;
|
|
13003
13093
|
let A = W.current?.getBoundingClientRect();
|
|
13004
13094
|
if (!A) return;
|
|
13005
13095
|
let j = A.left, M = A.top;
|
|
13006
|
-
|
|
13096
|
+
ZF.current = {
|
|
13007
13097
|
x: (E.clientX - j - n.pan.x) / n.zoom,
|
|
13008
13098
|
y: (E.clientY - M - n.pan.y) / n.zoom
|
|
13009
|
-
},
|
|
13099
|
+
}, tI.current = n.selectedElementIds, nI.current = n.selectedElementIds, E.shiftKey || (_(null), tI.current = [], nI.current = []);
|
|
13010
13100
|
};
|
|
13011
13101
|
useEffect(() => {
|
|
13012
13102
|
let n = (n) => {
|
|
13013
13103
|
n.preventDefault();
|
|
13014
|
-
let _ =
|
|
13104
|
+
let _ = rI.current;
|
|
13015
13105
|
if (n.ctrlKey || n.metaKey) A(Math.min(Math.max(.1, _.zoom - n.deltaY * .001), 5));
|
|
13016
13106
|
else {
|
|
13017
13107
|
let E = n.shiftKey ? n.deltaY : n.deltaX, O = n.shiftKey ? n.deltaX : n.deltaY;
|
|
@@ -13026,7 +13116,7 @@ const ElementContextMenu = ({ children: n, element: _ }) => {
|
|
|
13026
13116
|
};
|
|
13027
13117
|
}, [A, j]), useEffect(() => {
|
|
13028
13118
|
let _ = (_) => {
|
|
13029
|
-
if (_.code === "Space" && !_.repeat && !(_.target instanceof HTMLInputElement || _.target instanceof HTMLTextAreaElement) && (
|
|
13119
|
+
if (_.code === "Space" && !_.repeat && !(_.target instanceof HTMLInputElement || _.target instanceof HTMLTextAreaElement) && (XF.current = !0, W.current && (W.current.style.cursor = "grab")), !(_.target instanceof HTMLInputElement || _.target instanceof HTMLTextAreaElement) && ((_.ctrlKey || _.metaKey) && _.key.toLowerCase() === "z" && (_.preventDefault(), _.shiftKey ? N() : M()), (_.ctrlKey || _.metaKey) && _.key.toLowerCase() === "y" && (_.preventDefault(), N()), (_.ctrlKey || _.metaKey) && _.key.toLowerCase() === "c" && (_.preventDefault(), P()), (_.ctrlKey || _.metaKey) && _.key.toLowerCase() === "v" && (_.preventDefault(), z()), (_.key === "Delete" || _.key === "Backspace") && (_.preventDefault(), B()), [
|
|
13030
13120
|
"ArrowUp",
|
|
13031
13121
|
"ArrowDown",
|
|
13032
13122
|
"ArrowLeft",
|
|
@@ -13054,7 +13144,7 @@ const ElementContextMenu = ({ children: n, element: _ }) => {
|
|
|
13054
13144
|
}), O.length > 0 && H(O);
|
|
13055
13145
|
}
|
|
13056
13146
|
}, E = (n) => {
|
|
13057
|
-
n.code === "Space" && (
|
|
13147
|
+
n.code === "Space" && (XF.current = !1, W.current && !YF.current && (W.current.style.cursor = "default"));
|
|
13058
13148
|
};
|
|
13059
13149
|
return window.addEventListener("keydown", _), window.addEventListener("keyup", E), () => {
|
|
13060
13150
|
window.removeEventListener("keydown", _), window.removeEventListener("keyup", E);
|
|
@@ -13069,21 +13159,21 @@ const ElementContextMenu = ({ children: n, element: _ }) => {
|
|
|
13069
13159
|
n.selectedElementIds,
|
|
13070
13160
|
n.elements
|
|
13071
13161
|
]);
|
|
13072
|
-
let
|
|
13073
|
-
n.stopPropagation(), n.preventDefault(),
|
|
13074
|
-
},
|
|
13075
|
-
if (!
|
|
13162
|
+
let uI = useRef(!1), { setCanvasHeight: dI } = useEditor(), fI = (n) => {
|
|
13163
|
+
n.stopPropagation(), n.preventDefault(), uI.current = !0, window.addEventListener("mousemove", pI), window.addEventListener("mouseup", mI);
|
|
13164
|
+
}, pI = useCallback((n) => {
|
|
13165
|
+
if (!uI.current || !W.current) return;
|
|
13076
13166
|
let _ = W.current.getBoundingClientRect(), E = n.clientY - _.top, O = Math.max(50, Math.min(E, 2e3));
|
|
13077
|
-
|
|
13078
|
-
}, [
|
|
13079
|
-
|
|
13080
|
-
}, [
|
|
13167
|
+
dI(Math.round(O));
|
|
13168
|
+
}, [dI]), mI = useCallback(() => {
|
|
13169
|
+
uI.current = !1, window.removeEventListener("mousemove", pI), window.removeEventListener("mouseup", mI);
|
|
13170
|
+
}, [pI]);
|
|
13081
13171
|
useEffect(() => () => {
|
|
13082
|
-
window.removeEventListener("mousemove",
|
|
13083
|
-
}, [
|
|
13084
|
-
let
|
|
13172
|
+
window.removeEventListener("mousemove", pI), window.removeEventListener("mouseup", mI);
|
|
13173
|
+
}, [pI, mI]);
|
|
13174
|
+
let hI = (n) => {
|
|
13085
13175
|
n.preventDefault(), n.dataTransfer.dropEffect = "copy";
|
|
13086
|
-
},
|
|
13176
|
+
}, gI = (_) => {
|
|
13087
13177
|
_.preventDefault();
|
|
13088
13178
|
let E = _.currentTarget.getBoundingClientRect(), A = (_.clientX - E.left - n.pan.x) / n.zoom, j = (_.clientY - E.top - n.pan.y) / n.zoom, M = _.dataTransfer.getData("application/x-editor-prop");
|
|
13089
13179
|
if (M) {
|
|
@@ -13113,25 +13203,25 @@ const ElementContextMenu = ({ children: n, element: _ }) => {
|
|
|
13113
13203
|
} catch (n) {
|
|
13114
13204
|
console.error("Failed to parse asset", n);
|
|
13115
13205
|
}
|
|
13116
|
-
},
|
|
13206
|
+
}, _I = n.canvasHeight || 150;
|
|
13117
13207
|
return /* @__PURE__ */ jsxs(p, {
|
|
13118
13208
|
ref: W,
|
|
13119
|
-
onPointerDown:
|
|
13209
|
+
onPointerDown: lI,
|
|
13120
13210
|
onPointerMove: (n) => {
|
|
13121
|
-
(
|
|
13211
|
+
(JF.current || YF.current) && aI(n.nativeEvent);
|
|
13122
13212
|
},
|
|
13123
13213
|
onPointerUp: (n) => {
|
|
13124
|
-
(
|
|
13214
|
+
(JF.current || YF.current) && cI(n.nativeEvent);
|
|
13125
13215
|
},
|
|
13126
|
-
onDragOver:
|
|
13127
|
-
onDrop:
|
|
13216
|
+
onDragOver: hI,
|
|
13217
|
+
onDrop: gI,
|
|
13128
13218
|
style: {
|
|
13129
13219
|
width: "100%",
|
|
13130
13220
|
height: "100%",
|
|
13131
13221
|
position: "relative",
|
|
13132
13222
|
overflow: "hidden",
|
|
13133
13223
|
backgroundColor: "var(--gray-1)",
|
|
13134
|
-
cursor:
|
|
13224
|
+
cursor: YF.current ? "grabbing" : "default",
|
|
13135
13225
|
backgroundImage: "radial-gradient(var(--gray-5) 1px, transparent 1px)",
|
|
13136
13226
|
backgroundSize: `${20 * n.zoom}px ${20 * n.zoom}px`,
|
|
13137
13227
|
backgroundPosition: `${n.pan.x}px ${n.pan.y}px`
|
|
@@ -13195,7 +13285,7 @@ const ElementContextMenu = ({ children: n, element: _ }) => {
|
|
|
13195
13285
|
n.isList && /* @__PURE__ */ jsxs("div", {
|
|
13196
13286
|
style: {
|
|
13197
13287
|
position: "absolute",
|
|
13198
|
-
top:
|
|
13288
|
+
top: _I,
|
|
13199
13289
|
left: 0,
|
|
13200
13290
|
right: 0,
|
|
13201
13291
|
height: "10px",
|
|
@@ -13206,7 +13296,7 @@ const ElementContextMenu = ({ children: n, element: _ }) => {
|
|
|
13206
13296
|
alignItems: "center",
|
|
13207
13297
|
justifyContent: "center"
|
|
13208
13298
|
},
|
|
13209
|
-
onMouseDown:
|
|
13299
|
+
onMouseDown: fI,
|
|
13210
13300
|
children: [/* @__PURE__ */ jsx("div", { style: {
|
|
13211
13301
|
width: "100%",
|
|
13212
13302
|
height: "2px",
|
|
@@ -13230,7 +13320,7 @@ const ElementContextMenu = ({ children: n, element: _ }) => {
|
|
|
13230
13320
|
},
|
|
13231
13321
|
children: [
|
|
13232
13322
|
"Altura do Item: ",
|
|
13233
|
-
|
|
13323
|
+
_I,
|
|
13234
13324
|
"px"
|
|
13235
13325
|
]
|
|
13236
13326
|
})]
|
|
@@ -13290,22 +13380,22 @@ const ElementContextMenu = ({ children: n, element: _ }) => {
|
|
|
13290
13380
|
]
|
|
13291
13381
|
});
|
|
13292
13382
|
}, EditorSettings = () => {
|
|
13293
|
-
let { state: n, updateListSettings: _, setCanvasHeight: E, setGridSize: O } = useEditor(), [A, j] = useState(!1), [M, N] = useState(""), [P, z] = useState("asc"), [B, H] = useState("bottom"), [U, W] = useState("down"), [Z,
|
|
13383
|
+
let { state: n, updateListSettings: _, setCanvasHeight: E, setGridSize: O } = useEditor(), [A, j] = useState(!1), [M, N] = useState(""), [P, z] = useState("asc"), [B, H] = useState("bottom"), [U, W] = useState("down"), [Z, qF] = useState("150"), [JF, YF] = useState(""), [XF, ZF] = useState("0"), [QF, eI] = useState("slideIn"), [tI, nI] = useState(.3), [rI, iI] = useState("ease-out");
|
|
13294
13384
|
return useEffect(() => {
|
|
13295
13385
|
if (A) {
|
|
13296
|
-
N(n.listSettings.sortProp || "__none__"), z(n.listSettings.sortOrder || "asc"), H(n.listSettings.newestPosition || "bottom"), W(n.listSettings.scrollDirection || "down"),
|
|
13386
|
+
N(n.listSettings.sortProp || "__none__"), z(n.listSettings.sortOrder || "asc"), H(n.listSettings.newestPosition || "bottom"), W(n.listSettings.scrollDirection || "down"), YF(n.listSettings.containerHeight ? String(n.listSettings.containerHeight) : ""), qF(String(n.canvasHeight || 150)), ZF(String(n.gridSize || 0));
|
|
13297
13387
|
let _ = n.listSettings.entryAnimation;
|
|
13298
|
-
|
|
13388
|
+
eI(_?.type || "slideIn"), nI(_?.duration || .3), iI(_?.timingFunction || "ease-out");
|
|
13299
13389
|
}
|
|
13300
13390
|
}, [A]), useEffect(() => {
|
|
13301
13391
|
if (!A) return;
|
|
13302
13392
|
let _ = parseInt(Z, 10);
|
|
13303
13393
|
!isNaN(_) && _ > 0 && n.canvasHeight !== _ && E(_);
|
|
13304
|
-
let j = parseInt(
|
|
13394
|
+
let j = parseInt(XF, 10);
|
|
13305
13395
|
!isNaN(j) && j >= 0 && n.gridSize !== j && O(j);
|
|
13306
13396
|
}, [
|
|
13307
13397
|
Z,
|
|
13308
|
-
|
|
13398
|
+
XF,
|
|
13309
13399
|
A,
|
|
13310
13400
|
E,
|
|
13311
13401
|
O,
|
|
@@ -13484,7 +13574,7 @@ const ElementContextMenu = ({ children: n, element: _ }) => {
|
|
|
13484
13574
|
type: "number",
|
|
13485
13575
|
min: "10",
|
|
13486
13576
|
value: Z,
|
|
13487
|
-
onChange: (n) =>
|
|
13577
|
+
onChange: (n) => qF(n.target.value)
|
|
13488
13578
|
}),
|
|
13489
13579
|
/* @__PURE__ */ jsx(p$2, {
|
|
13490
13580
|
size: "1",
|
|
@@ -13505,8 +13595,8 @@ const ElementContextMenu = ({ children: n, element: _ }) => {
|
|
|
13505
13595
|
type: "number",
|
|
13506
13596
|
min: "0",
|
|
13507
13597
|
placeholder: "Auto (100%)",
|
|
13508
|
-
value:
|
|
13509
|
-
onChange: (n) =>
|
|
13598
|
+
value: JF,
|
|
13599
|
+
onChange: (n) => YF(n.target.value)
|
|
13510
13600
|
}),
|
|
13511
13601
|
/* @__PURE__ */ jsx(p$2, {
|
|
13512
13602
|
size: "1",
|
|
@@ -13532,8 +13622,8 @@ const ElementContextMenu = ({ children: n, element: _ }) => {
|
|
|
13532
13622
|
as: "div",
|
|
13533
13623
|
children: "Efeito"
|
|
13534
13624
|
}), /* @__PURE__ */ jsxs("select", {
|
|
13535
|
-
value:
|
|
13536
|
-
onChange: (n) =>
|
|
13625
|
+
value: QF,
|
|
13626
|
+
onChange: (n) => eI(n.target.value),
|
|
13537
13627
|
style: {
|
|
13538
13628
|
width: "100%",
|
|
13539
13629
|
padding: "6px",
|
|
@@ -13595,8 +13685,8 @@ const ElementContextMenu = ({ children: n, element: _ }) => {
|
|
|
13595
13685
|
type: "number",
|
|
13596
13686
|
step: "0.1",
|
|
13597
13687
|
min: "0.1",
|
|
13598
|
-
value:
|
|
13599
|
-
onChange: (n) =>
|
|
13688
|
+
value: tI,
|
|
13689
|
+
onChange: (n) => nI(parseFloat(n.target.value) || .3)
|
|
13600
13690
|
})] }),
|
|
13601
13691
|
/* @__PURE__ */ jsxs(p, { children: [/* @__PURE__ */ jsx(p$2, {
|
|
13602
13692
|
size: "1",
|
|
@@ -13604,8 +13694,8 @@ const ElementContextMenu = ({ children: n, element: _ }) => {
|
|
|
13604
13694
|
as: "div",
|
|
13605
13695
|
children: "Curva (Easing)"
|
|
13606
13696
|
}), /* @__PURE__ */ jsxs("select", {
|
|
13607
|
-
value:
|
|
13608
|
-
onChange: (n) =>
|
|
13697
|
+
value: rI,
|
|
13698
|
+
onChange: (n) => iI(n.target.value),
|
|
13609
13699
|
style: {
|
|
13610
13700
|
width: "100%",
|
|
13611
13701
|
padding: "6px",
|
|
@@ -13660,8 +13750,8 @@ const ElementContextMenu = ({ children: n, element: _ }) => {
|
|
|
13660
13750
|
children: "Tamanho do Grid (px) - 0 para desativar"
|
|
13661
13751
|
}), /* @__PURE__ */ jsx(u$1, {
|
|
13662
13752
|
type: "number",
|
|
13663
|
-
value:
|
|
13664
|
-
onChange: (n) =>
|
|
13753
|
+
value: XF,
|
|
13754
|
+
onChange: (n) => ZF(n.target.value),
|
|
13665
13755
|
placeholder: "0"
|
|
13666
13756
|
})]
|
|
13667
13757
|
})
|
|
@@ -13680,11 +13770,11 @@ const ElementContextMenu = ({ children: n, element: _ }) => {
|
|
|
13680
13770
|
children: "Cancelar"
|
|
13681
13771
|
}) }), /* @__PURE__ */ jsx(D$2, { children: /* @__PURE__ */ jsx(o, {
|
|
13682
13772
|
onClick: () => {
|
|
13683
|
-
let n = parseInt(
|
|
13684
|
-
type:
|
|
13685
|
-
duration: Number(
|
|
13773
|
+
let n = parseInt(JF, 10), E = {
|
|
13774
|
+
type: QF,
|
|
13775
|
+
duration: Number(tI),
|
|
13686
13776
|
delay: 0,
|
|
13687
|
-
timingFunction:
|
|
13777
|
+
timingFunction: rI
|
|
13688
13778
|
};
|
|
13689
13779
|
_({
|
|
13690
13780
|
sortProp: M === "__none__" ? "" : M,
|
|
@@ -14463,7 +14553,7 @@ var defaultKeyboardCodes = {
|
|
|
14463
14553
|
let A = n.code, { isTop: j, isRight: N, isLeft: P, isBottom: z, maxScroll: H, minScroll: U } = getScrollPosition(E), W = getScrollElementRect(E), G = {
|
|
14464
14554
|
x: Math.min(A === KeyboardCode.Right ? W.right - W.width / 2 : W.right, Math.max(A === KeyboardCode.Right ? W.left : W.left + W.width / 2, B.x)),
|
|
14465
14555
|
y: Math.min(A === KeyboardCode.Down ? W.bottom - W.height / 2 : W.bottom, Math.max(A === KeyboardCode.Down ? W.top : W.top + W.height / 2, B.y))
|
|
14466
|
-
}, Z = A === KeyboardCode.Right && !N || A === KeyboardCode.Left && !P,
|
|
14556
|
+
}, Z = A === KeyboardCode.Right && !N || A === KeyboardCode.Left && !P, qF = A === KeyboardCode.Down && !z || A === KeyboardCode.Up && !j;
|
|
14467
14557
|
if (Z && G.x !== B.x) {
|
|
14468
14558
|
let n = E.scrollLeft + _.x, j = A === KeyboardCode.Right && n <= H.x || A === KeyboardCode.Left && n >= U.x;
|
|
14469
14559
|
if (j && !_.y) {
|
|
@@ -14478,7 +14568,7 @@ var defaultKeyboardCodes = {
|
|
|
14478
14568
|
behavior: M
|
|
14479
14569
|
});
|
|
14480
14570
|
break;
|
|
14481
|
-
} else if (
|
|
14571
|
+
} else if (qF && G.y !== B.y) {
|
|
14482
14572
|
let n = E.scrollTop + _.y, j = A === KeyboardCode.Down && n <= H.y || A === KeyboardCode.Up && n >= U.y;
|
|
14483
14573
|
if (j && !_.x) {
|
|
14484
14574
|
E.scrollTo({
|
|
@@ -14670,13 +14760,13 @@ function useAutoScroller(n) {
|
|
|
14670
14760
|
let { acceleration: _, activator: E = AutoScrollActivator.Pointer, canScroll: O, draggingRect: A, enabled: j, interval: M = 5, order: N = TraversalOrder.TreeOrder, pointerCoordinates: P, scrollableAncestors: z, scrollableAncestorRects: B, delta: H, threshold: W } = n, Z = useScrollIntent({
|
|
14671
14761
|
delta: H,
|
|
14672
14762
|
disabled: !j
|
|
14673
|
-
}), [
|
|
14763
|
+
}), [qF, JF] = useInterval(), YF = useRef({
|
|
14674
14764
|
x: 0,
|
|
14675
14765
|
y: 0
|
|
14676
|
-
}),
|
|
14766
|
+
}), ZF = useRef({
|
|
14677
14767
|
x: 0,
|
|
14678
14768
|
y: 0
|
|
14679
|
-
}),
|
|
14769
|
+
}), $F = useMemo(() => {
|
|
14680
14770
|
switch (E) {
|
|
14681
14771
|
case AutoScrollActivator.Pointer: return P ? {
|
|
14682
14772
|
top: P.y,
|
|
@@ -14690,47 +14780,47 @@ function useAutoScroller(n) {
|
|
|
14690
14780
|
E,
|
|
14691
14781
|
A,
|
|
14692
14782
|
P
|
|
14693
|
-
]),
|
|
14694
|
-
let n =
|
|
14783
|
+
]), eI = useRef(null), tI = useCallback(() => {
|
|
14784
|
+
let n = eI.current;
|
|
14695
14785
|
if (!n) return;
|
|
14696
|
-
let _ =
|
|
14786
|
+
let _ = YF.current.x * ZF.current.x, E = YF.current.y * ZF.current.y;
|
|
14697
14787
|
n.scrollBy(_, E);
|
|
14698
|
-
}, []),
|
|
14788
|
+
}, []), nI = useMemo(() => N === TraversalOrder.TreeOrder ? [...z].reverse() : z, [N, z]);
|
|
14699
14789
|
useEffect(() => {
|
|
14700
|
-
if (!j || !z.length ||
|
|
14701
|
-
|
|
14790
|
+
if (!j || !z.length || !$F) {
|
|
14791
|
+
JF();
|
|
14702
14792
|
return;
|
|
14703
14793
|
}
|
|
14704
|
-
for (let n of
|
|
14794
|
+
for (let n of nI) {
|
|
14705
14795
|
if (O?.(n) === !1) continue;
|
|
14706
14796
|
let E = B[z.indexOf(n)];
|
|
14707
14797
|
if (!E) continue;
|
|
14708
|
-
let { direction: A, speed: j } = getScrollDirectionAndSpeed(n, E,
|
|
14798
|
+
let { direction: A, speed: j } = getScrollDirectionAndSpeed(n, E, $F, _, W);
|
|
14709
14799
|
for (let n of ["x", "y"]) Z[n][A[n]] || (j[n] = 0, A[n] = 0);
|
|
14710
14800
|
if (j.x > 0 || j.y > 0) {
|
|
14711
|
-
|
|
14801
|
+
JF(), eI.current = n, qF(tI, M), YF.current = j, ZF.current = A;
|
|
14712
14802
|
return;
|
|
14713
14803
|
}
|
|
14714
14804
|
}
|
|
14715
|
-
|
|
14805
|
+
YF.current = {
|
|
14716
14806
|
x: 0,
|
|
14717
14807
|
y: 0
|
|
14718
|
-
},
|
|
14808
|
+
}, ZF.current = {
|
|
14719
14809
|
x: 0,
|
|
14720
14810
|
y: 0
|
|
14721
|
-
},
|
|
14811
|
+
}, JF();
|
|
14722
14812
|
}, [
|
|
14723
14813
|
_,
|
|
14724
|
-
|
|
14814
|
+
tI,
|
|
14725
14815
|
O,
|
|
14726
|
-
|
|
14816
|
+
JF,
|
|
14727
14817
|
j,
|
|
14728
14818
|
M,
|
|
14729
|
-
JSON.stringify(
|
|
14819
|
+
JSON.stringify($F),
|
|
14730
14820
|
JSON.stringify(Z),
|
|
14731
|
-
|
|
14821
|
+
qF,
|
|
14732
14822
|
z,
|
|
14733
|
-
|
|
14823
|
+
nI,
|
|
14734
14824
|
B,
|
|
14735
14825
|
JSON.stringify(W)
|
|
14736
14826
|
]);
|
|
@@ -14792,9 +14882,9 @@ var MeasuringFrequency;
|
|
|
14792
14882
|
})(MeasuringFrequency ||= {});
|
|
14793
14883
|
var defaultValue = /* @__PURE__ */ new Map();
|
|
14794
14884
|
function useDroppableMeasuring(n, _) {
|
|
14795
|
-
let { dragging: E, dependencies: O, config: A } = _, [j, M] = useState(null), { frequency: N, measure: P, strategy: z } = A, B = useRef(n), H =
|
|
14885
|
+
let { dragging: E, dependencies: O, config: A } = _, [j, M] = useState(null), { frequency: N, measure: P, strategy: z } = A, B = useRef(n), H = YF(), W = useLatestValue(H), Z = useCallback(function(n) {
|
|
14796
14886
|
n === void 0 && (n = []), !W.current && M((_) => _ === null ? n : _.concat(n.filter((n) => !_.includes(n))));
|
|
14797
|
-
}, [W]),
|
|
14887
|
+
}, [W]), qF = useRef(null), JF = useLazyMemo((_) => {
|
|
14798
14888
|
if (H && !E) return defaultValue;
|
|
14799
14889
|
if (!_ || _ === defaultValue || B.current !== n || j != null) {
|
|
14800
14890
|
let _ = /* @__PURE__ */ new Map();
|
|
@@ -14824,8 +14914,8 @@ function useDroppableMeasuring(n, _) {
|
|
|
14824
14914
|
}, [E, H]), useEffect(() => {
|
|
14825
14915
|
j && j.length > 0 && M(null);
|
|
14826
14916
|
}, [JSON.stringify(j)]), useEffect(() => {
|
|
14827
|
-
H || typeof N != "number" ||
|
|
14828
|
-
Z(),
|
|
14917
|
+
H || typeof N != "number" || qF.current !== null || (qF.current = setTimeout(() => {
|
|
14918
|
+
Z(), qF.current = null;
|
|
14829
14919
|
}, N));
|
|
14830
14920
|
}, [
|
|
14831
14921
|
N,
|
|
@@ -14833,11 +14923,11 @@ function useDroppableMeasuring(n, _) {
|
|
|
14833
14923
|
Z,
|
|
14834
14924
|
...O
|
|
14835
14925
|
]), {
|
|
14836
|
-
droppableRects:
|
|
14926
|
+
droppableRects: JF,
|
|
14837
14927
|
measureDroppableContainers: Z,
|
|
14838
14928
|
measuringScheduled: j != null
|
|
14839
14929
|
};
|
|
14840
|
-
function
|
|
14930
|
+
function YF() {
|
|
14841
14931
|
switch (z) {
|
|
14842
14932
|
case MeasuringStrategy.Always: return !1;
|
|
14843
14933
|
case MeasuringStrategy.BeforeDragging: return E;
|
|
@@ -15262,84 +15352,84 @@ var ActiveDraggableContext = /* @__PURE__ */ createContext({
|
|
|
15262
15352
|
n[n.Uninitialized = 0] = "Uninitialized", n[n.Initializing = 1] = "Initializing", n[n.Initialized = 2] = "Initialized";
|
|
15263
15353
|
})(Status ||= {});
|
|
15264
15354
|
var DndContext = /* @__PURE__ */ memo(function(n) {
|
|
15265
|
-
let { id: E, accessibility: O, autoScroll: A = !0, children: j, sensors: M = defaultSensors, collisionDetection: N = rectIntersection, measuring: P, modifiers: z, ...B } = n, [H, W] = useReducer(reducer, void 0, getInitialState), [Z,
|
|
15355
|
+
let { id: E, accessibility: O, autoScroll: A = !0, children: j, sensors: M = defaultSensors, collisionDetection: N = rectIntersection, measuring: P, modifiers: z, ...B } = n, [H, W] = useReducer(reducer, void 0, getInitialState), [Z, qF] = useDndMonitorProvider(), [JF, YF] = useState(Status.Uninitialized), eI = JF === Status.Initialized, { draggable: { active: tI, nodes: nI, translate: rI }, droppable: { containers: aI } } = H, oI = tI == null ? null : nI.get(tI), sI = useRef({
|
|
15266
15356
|
initial: null,
|
|
15267
15357
|
translated: null
|
|
15268
|
-
}),
|
|
15269
|
-
id:
|
|
15270
|
-
data:
|
|
15271
|
-
rect:
|
|
15272
|
-
}, [
|
|
15273
|
-
dragging:
|
|
15274
|
-
dependencies: [
|
|
15275
|
-
config:
|
|
15276
|
-
}),
|
|
15358
|
+
}), cI = useMemo(() => tI == null ? null : {
|
|
15359
|
+
id: tI,
|
|
15360
|
+
data: oI?.data ?? defaultData,
|
|
15361
|
+
rect: sI
|
|
15362
|
+
}, [tI, oI]), lI = useRef(null), [uI, dI] = useState(null), [fI, pI] = useState(null), mI = useLatestValue(B, Object.values(B)), hI = useUniqueId("DndDescribedBy", E), gI = useMemo(() => aI.getEnabled(), [aI]), _I = useMeasuringConfiguration(P), { droppableRects: vI, measureDroppableContainers: yI, measuringScheduled: bI } = useDroppableMeasuring(gI, {
|
|
15363
|
+
dragging: eI,
|
|
15364
|
+
dependencies: [rI.x, rI.y],
|
|
15365
|
+
config: _I.droppable
|
|
15366
|
+
}), xI = useCachedNode(nI, tI), SI = useMemo(() => fI ? getEventCoordinates(fI) : null, [fI]), CI = eL(), wI = useInitialRect(xI, _I.draggable.measure);
|
|
15277
15367
|
useLayoutShiftScrollCompensation({
|
|
15278
|
-
activeNode:
|
|
15279
|
-
config:
|
|
15280
|
-
initialRect:
|
|
15281
|
-
measure:
|
|
15368
|
+
activeNode: tI == null ? null : nI.get(tI),
|
|
15369
|
+
config: CI.layoutShiftCompensation,
|
|
15370
|
+
initialRect: wI,
|
|
15371
|
+
measure: _I.draggable.measure
|
|
15282
15372
|
});
|
|
15283
|
-
let
|
|
15373
|
+
let TI = useRect(xI, _I.draggable.measure, wI), EI = useRect(xI ? xI.parentElement : null), DI = useRef({
|
|
15284
15374
|
activatorEvent: null,
|
|
15285
15375
|
active: null,
|
|
15286
|
-
activeNode:
|
|
15376
|
+
activeNode: xI,
|
|
15287
15377
|
collisionRect: null,
|
|
15288
15378
|
collisions: null,
|
|
15289
|
-
droppableRects:
|
|
15290
|
-
draggableNodes:
|
|
15379
|
+
droppableRects: vI,
|
|
15380
|
+
draggableNodes: nI,
|
|
15291
15381
|
draggingNode: null,
|
|
15292
15382
|
draggingNodeRect: null,
|
|
15293
|
-
droppableContainers:
|
|
15383
|
+
droppableContainers: aI,
|
|
15294
15384
|
over: null,
|
|
15295
15385
|
scrollableAncestors: [],
|
|
15296
15386
|
scrollAdjustedTranslate: null
|
|
15297
|
-
}),
|
|
15387
|
+
}), OI = aI.getNodeFor(DI.current.over?.id), kI = useDragOverlayMeasuring({ measure: _I.dragOverlay.measure }), AI = kI.nodeRef.current ?? xI, jI = eI ? kI.rect ?? TI : null, MI = !!(kI.nodeRef.current && kI.rect), NI = useRectDelta(MI ? null : TI), PI = useWindowRect(AI ? getWindow(AI) : null), FI = useScrollableAncestors(eI ? OI ?? xI : null), II = useRects(FI), LI = applyModifiers(z, {
|
|
15298
15388
|
transform: {
|
|
15299
|
-
x:
|
|
15300
|
-
y:
|
|
15389
|
+
x: rI.x - NI.x,
|
|
15390
|
+
y: rI.y - NI.y,
|
|
15301
15391
|
scaleX: 1,
|
|
15302
15392
|
scaleY: 1
|
|
15303
15393
|
},
|
|
15304
|
-
activatorEvent:
|
|
15305
|
-
active:
|
|
15306
|
-
activeNodeRect:
|
|
15307
|
-
containerNodeRect:
|
|
15308
|
-
draggingNodeRect:
|
|
15309
|
-
over:
|
|
15310
|
-
overlayNodeRect:
|
|
15311
|
-
scrollableAncestors:
|
|
15312
|
-
scrollableAncestorRects:
|
|
15313
|
-
windowRect:
|
|
15314
|
-
}),
|
|
15315
|
-
active:
|
|
15316
|
-
collisionRect:
|
|
15317
|
-
droppableRects:
|
|
15318
|
-
droppableContainers:
|
|
15319
|
-
pointerCoordinates:
|
|
15320
|
-
}) : null,
|
|
15394
|
+
activatorEvent: fI,
|
|
15395
|
+
active: cI,
|
|
15396
|
+
activeNodeRect: TI,
|
|
15397
|
+
containerNodeRect: EI,
|
|
15398
|
+
draggingNodeRect: jI,
|
|
15399
|
+
over: DI.current.over,
|
|
15400
|
+
overlayNodeRect: kI.rect,
|
|
15401
|
+
scrollableAncestors: FI,
|
|
15402
|
+
scrollableAncestorRects: II,
|
|
15403
|
+
windowRect: PI
|
|
15404
|
+
}), RI = SI ? add(SI, rI) : null, zI = useScrollOffsets(FI), BI = useScrollOffsetsDelta(zI), VI = useScrollOffsetsDelta(zI, [TI]), HI = add(LI, BI), UI = jI ? getAdjustedRect(jI, LI) : null, WI = cI && UI ? N({
|
|
15405
|
+
active: cI,
|
|
15406
|
+
collisionRect: UI,
|
|
15407
|
+
droppableRects: vI,
|
|
15408
|
+
droppableContainers: gI,
|
|
15409
|
+
pointerCoordinates: RI
|
|
15410
|
+
}) : null, GI = getFirstCollision(WI, "id"), [KI, qI] = useState(null), JI = adjustScale(MI ? LI : add(LI, VI), KI?.rect ?? null, TI), YI = useRef(null), XI = useCallback((n, _) => {
|
|
15321
15411
|
let { sensor: E, options: O } = _;
|
|
15322
|
-
if (
|
|
15323
|
-
let A =
|
|
15412
|
+
if (lI.current == null) return;
|
|
15413
|
+
let A = nI.get(lI.current);
|
|
15324
15414
|
if (!A) return;
|
|
15325
15415
|
let j = n.nativeEvent;
|
|
15326
|
-
|
|
15327
|
-
active:
|
|
15416
|
+
YI.current = new E({
|
|
15417
|
+
active: lI.current,
|
|
15328
15418
|
activeNode: A,
|
|
15329
15419
|
event: j,
|
|
15330
15420
|
options: O,
|
|
15331
|
-
context:
|
|
15421
|
+
context: DI,
|
|
15332
15422
|
onAbort(n) {
|
|
15333
|
-
if (!
|
|
15334
|
-
let { onDragAbort: _ } =
|
|
15423
|
+
if (!nI.get(n)) return;
|
|
15424
|
+
let { onDragAbort: _ } = mI.current, E = { id: n };
|
|
15335
15425
|
_?.(E), Z({
|
|
15336
15426
|
type: "onDragAbort",
|
|
15337
15427
|
event: E
|
|
15338
15428
|
});
|
|
15339
15429
|
},
|
|
15340
15430
|
onPending(n, _, E, O) {
|
|
15341
|
-
if (!
|
|
15342
|
-
let { onDragPending: A } =
|
|
15431
|
+
if (!nI.get(n)) return;
|
|
15432
|
+
let { onDragPending: A } = mI.current, j = {
|
|
15343
15433
|
id: n,
|
|
15344
15434
|
constraint: _,
|
|
15345
15435
|
initialCoordinates: E,
|
|
@@ -15351,27 +15441,27 @@ var DndContext = /* @__PURE__ */ memo(function(n) {
|
|
|
15351
15441
|
});
|
|
15352
15442
|
},
|
|
15353
15443
|
onStart(n) {
|
|
15354
|
-
let _ =
|
|
15444
|
+
let _ = lI.current;
|
|
15355
15445
|
if (_ == null) return;
|
|
15356
|
-
let E =
|
|
15446
|
+
let E = nI.get(_);
|
|
15357
15447
|
if (!E) return;
|
|
15358
|
-
let { onDragStart: O } =
|
|
15448
|
+
let { onDragStart: O } = mI.current, A = {
|
|
15359
15449
|
activatorEvent: j,
|
|
15360
15450
|
active: {
|
|
15361
15451
|
id: _,
|
|
15362
15452
|
data: E.data,
|
|
15363
|
-
rect:
|
|
15453
|
+
rect: sI
|
|
15364
15454
|
}
|
|
15365
15455
|
};
|
|
15366
15456
|
unstable_batchedUpdates(() => {
|
|
15367
|
-
O?.(A),
|
|
15457
|
+
O?.(A), YF(Status.Initializing), W({
|
|
15368
15458
|
type: Action.DragStart,
|
|
15369
15459
|
initialCoordinates: n,
|
|
15370
15460
|
active: _
|
|
15371
15461
|
}), Z({
|
|
15372
15462
|
type: "onDragStart",
|
|
15373
15463
|
event: A
|
|
15374
|
-
}),
|
|
15464
|
+
}), dI(YI.current), pI(j);
|
|
15375
15465
|
});
|
|
15376
15466
|
},
|
|
15377
15467
|
onMove(n) {
|
|
@@ -15385,9 +15475,9 @@ var DndContext = /* @__PURE__ */ memo(function(n) {
|
|
|
15385
15475
|
});
|
|
15386
15476
|
function M(n) {
|
|
15387
15477
|
return async function() {
|
|
15388
|
-
let { active: _, collisions: E, over: O, scrollAdjustedTranslate: A } =
|
|
15478
|
+
let { active: _, collisions: E, over: O, scrollAdjustedTranslate: A } = DI.current, M = null;
|
|
15389
15479
|
if (_ && A) {
|
|
15390
|
-
let { cancelDrop: N } =
|
|
15480
|
+
let { cancelDrop: N } = mI.current;
|
|
15391
15481
|
M = {
|
|
15392
15482
|
activatorEvent: j,
|
|
15393
15483
|
active: _,
|
|
@@ -15396,11 +15486,11 @@ var DndContext = /* @__PURE__ */ memo(function(n) {
|
|
|
15396
15486
|
over: O
|
|
15397
15487
|
}, n === Action.DragEnd && typeof N == "function" && await Promise.resolve(N(M)) && (n = Action.DragCancel);
|
|
15398
15488
|
}
|
|
15399
|
-
|
|
15400
|
-
W({ type: n }),
|
|
15489
|
+
lI.current = null, unstable_batchedUpdates(() => {
|
|
15490
|
+
W({ type: n }), YF(Status.Uninitialized), qI(null), dI(null), pI(null), YI.current = null;
|
|
15401
15491
|
let _ = n === Action.DragEnd ? "onDragEnd" : "onDragCancel";
|
|
15402
15492
|
if (M) {
|
|
15403
|
-
let n =
|
|
15493
|
+
let n = mI.current[_];
|
|
15404
15494
|
n?.(M), Z({
|
|
15405
15495
|
type: _,
|
|
15406
15496
|
event: M
|
|
@@ -15409,24 +15499,24 @@ var DndContext = /* @__PURE__ */ memo(function(n) {
|
|
|
15409
15499
|
});
|
|
15410
15500
|
};
|
|
15411
15501
|
}
|
|
15412
|
-
}, [
|
|
15413
|
-
let A = E.nativeEvent, j =
|
|
15414
|
-
if (
|
|
15502
|
+
}, [nI]), ZI = useCombineActivators(M, useCallback((n, _) => (E, O) => {
|
|
15503
|
+
let A = E.nativeEvent, j = nI.get(O);
|
|
15504
|
+
if (lI.current !== null || !j || A.dndKit || A.defaultPrevented) return;
|
|
15415
15505
|
let M = { active: j };
|
|
15416
|
-
n(E, _.options, M) === !0 && (A.dndKit = { capturedBy: _.sensor },
|
|
15417
|
-
}, [
|
|
15506
|
+
n(E, _.options, M) === !0 && (A.dndKit = { capturedBy: _.sensor }, lI.current = O, XI(E, _));
|
|
15507
|
+
}, [nI, XI]));
|
|
15418
15508
|
useSensorSetup(M), useIsomorphicLayoutEffect$1(() => {
|
|
15419
|
-
|
|
15420
|
-
}, [
|
|
15421
|
-
let { onDragMove: n } =
|
|
15509
|
+
TI && JF === Status.Initializing && YF(Status.Initialized);
|
|
15510
|
+
}, [TI, JF]), useEffect(() => {
|
|
15511
|
+
let { onDragMove: n } = mI.current, { active: _, activatorEvent: E, collisions: O, over: A } = DI.current;
|
|
15422
15512
|
if (!_ || !E) return;
|
|
15423
15513
|
let j = {
|
|
15424
15514
|
active: _,
|
|
15425
15515
|
activatorEvent: E,
|
|
15426
15516
|
collisions: O,
|
|
15427
15517
|
delta: {
|
|
15428
|
-
x:
|
|
15429
|
-
y:
|
|
15518
|
+
x: HI.x,
|
|
15519
|
+
y: HI.y
|
|
15430
15520
|
},
|
|
15431
15521
|
over: A
|
|
15432
15522
|
};
|
|
@@ -15436,10 +15526,10 @@ var DndContext = /* @__PURE__ */ memo(function(n) {
|
|
|
15436
15526
|
event: j
|
|
15437
15527
|
});
|
|
15438
15528
|
});
|
|
15439
|
-
}, [
|
|
15440
|
-
let { active: n, activatorEvent: _, collisions: E, droppableContainers: O, scrollAdjustedTranslate: A } =
|
|
15441
|
-
if (!n ||
|
|
15442
|
-
let { onDragOver: j } =
|
|
15529
|
+
}, [HI.x, HI.y]), useEffect(() => {
|
|
15530
|
+
let { active: n, activatorEvent: _, collisions: E, droppableContainers: O, scrollAdjustedTranslate: A } = DI.current;
|
|
15531
|
+
if (!n || lI.current == null || !_ || !A) return;
|
|
15532
|
+
let { onDragOver: j } = mI.current, M = O.get(GI), N = M && M.rect.current ? {
|
|
15443
15533
|
id: M.id,
|
|
15444
15534
|
rect: M.rect.current,
|
|
15445
15535
|
data: M.data,
|
|
@@ -15455,114 +15545,114 @@ var DndContext = /* @__PURE__ */ memo(function(n) {
|
|
|
15455
15545
|
over: N
|
|
15456
15546
|
};
|
|
15457
15547
|
unstable_batchedUpdates(() => {
|
|
15458
|
-
|
|
15548
|
+
qI(N), j?.(P), Z({
|
|
15459
15549
|
type: "onDragOver",
|
|
15460
15550
|
event: P
|
|
15461
15551
|
});
|
|
15462
15552
|
});
|
|
15463
|
-
}, [
|
|
15464
|
-
|
|
15465
|
-
activatorEvent:
|
|
15466
|
-
active:
|
|
15467
|
-
activeNode:
|
|
15468
|
-
collisionRect:
|
|
15469
|
-
collisions:
|
|
15470
|
-
droppableRects:
|
|
15471
|
-
draggableNodes:
|
|
15472
|
-
draggingNode:
|
|
15473
|
-
draggingNodeRect:
|
|
15474
|
-
droppableContainers:
|
|
15475
|
-
over:
|
|
15476
|
-
scrollableAncestors:
|
|
15477
|
-
scrollAdjustedTranslate:
|
|
15478
|
-
},
|
|
15479
|
-
initial:
|
|
15480
|
-
translated:
|
|
15553
|
+
}, [GI]), useIsomorphicLayoutEffect$1(() => {
|
|
15554
|
+
DI.current = {
|
|
15555
|
+
activatorEvent: fI,
|
|
15556
|
+
active: cI,
|
|
15557
|
+
activeNode: xI,
|
|
15558
|
+
collisionRect: UI,
|
|
15559
|
+
collisions: WI,
|
|
15560
|
+
droppableRects: vI,
|
|
15561
|
+
draggableNodes: nI,
|
|
15562
|
+
draggingNode: AI,
|
|
15563
|
+
draggingNodeRect: jI,
|
|
15564
|
+
droppableContainers: aI,
|
|
15565
|
+
over: KI,
|
|
15566
|
+
scrollableAncestors: FI,
|
|
15567
|
+
scrollAdjustedTranslate: HI
|
|
15568
|
+
}, sI.current = {
|
|
15569
|
+
initial: jI,
|
|
15570
|
+
translated: UI
|
|
15481
15571
|
};
|
|
15482
15572
|
}, [
|
|
15483
|
-
|
|
15484
|
-
|
|
15573
|
+
cI,
|
|
15574
|
+
xI,
|
|
15575
|
+
WI,
|
|
15485
15576
|
UI,
|
|
15486
|
-
|
|
15487
|
-
tI,
|
|
15488
|
-
kI,
|
|
15577
|
+
nI,
|
|
15489
15578
|
AI,
|
|
15490
|
-
|
|
15491
|
-
|
|
15492
|
-
|
|
15493
|
-
|
|
15494
|
-
|
|
15579
|
+
jI,
|
|
15580
|
+
vI,
|
|
15581
|
+
aI,
|
|
15582
|
+
KI,
|
|
15583
|
+
FI,
|
|
15584
|
+
HI
|
|
15495
15585
|
]), useAutoScroller({
|
|
15496
|
-
...
|
|
15497
|
-
delta:
|
|
15498
|
-
draggingRect:
|
|
15499
|
-
pointerCoordinates:
|
|
15500
|
-
scrollableAncestors:
|
|
15501
|
-
scrollableAncestorRects:
|
|
15586
|
+
...CI,
|
|
15587
|
+
delta: rI,
|
|
15588
|
+
draggingRect: UI,
|
|
15589
|
+
pointerCoordinates: RI,
|
|
15590
|
+
scrollableAncestors: FI,
|
|
15591
|
+
scrollableAncestorRects: II
|
|
15502
15592
|
});
|
|
15503
|
-
let
|
|
15504
|
-
active:
|
|
15505
|
-
activeNode:
|
|
15506
|
-
activeNodeRect:
|
|
15507
|
-
activatorEvent:
|
|
15508
|
-
collisions:
|
|
15509
|
-
containerNodeRect:
|
|
15510
|
-
dragOverlay:
|
|
15511
|
-
draggableNodes:
|
|
15512
|
-
droppableContainers:
|
|
15513
|
-
droppableRects:
|
|
15514
|
-
over:
|
|
15515
|
-
measureDroppableContainers:
|
|
15516
|
-
scrollableAncestors:
|
|
15517
|
-
scrollableAncestorRects:
|
|
15518
|
-
measuringConfiguration:
|
|
15519
|
-
measuringScheduled:
|
|
15520
|
-
windowRect:
|
|
15593
|
+
let QI = useMemo(() => ({
|
|
15594
|
+
active: cI,
|
|
15595
|
+
activeNode: xI,
|
|
15596
|
+
activeNodeRect: TI,
|
|
15597
|
+
activatorEvent: fI,
|
|
15598
|
+
collisions: WI,
|
|
15599
|
+
containerNodeRect: EI,
|
|
15600
|
+
dragOverlay: kI,
|
|
15601
|
+
draggableNodes: nI,
|
|
15602
|
+
droppableContainers: aI,
|
|
15603
|
+
droppableRects: vI,
|
|
15604
|
+
over: KI,
|
|
15605
|
+
measureDroppableContainers: yI,
|
|
15606
|
+
scrollableAncestors: FI,
|
|
15607
|
+
scrollableAncestorRects: II,
|
|
15608
|
+
measuringConfiguration: _I,
|
|
15609
|
+
measuringScheduled: bI,
|
|
15610
|
+
windowRect: PI
|
|
15521
15611
|
}), [
|
|
15522
|
-
|
|
15523
|
-
|
|
15524
|
-
wI,
|
|
15525
|
-
dI,
|
|
15526
|
-
UI,
|
|
15612
|
+
cI,
|
|
15613
|
+
xI,
|
|
15527
15614
|
TI,
|
|
15528
|
-
|
|
15529
|
-
|
|
15530
|
-
|
|
15531
|
-
|
|
15532
|
-
|
|
15615
|
+
fI,
|
|
15616
|
+
WI,
|
|
15617
|
+
EI,
|
|
15618
|
+
kI,
|
|
15619
|
+
nI,
|
|
15620
|
+
aI,
|
|
15533
15621
|
vI,
|
|
15534
|
-
|
|
15535
|
-
FI,
|
|
15536
|
-
gI,
|
|
15622
|
+
KI,
|
|
15537
15623
|
yI,
|
|
15538
|
-
|
|
15539
|
-
|
|
15540
|
-
|
|
15541
|
-
|
|
15542
|
-
|
|
15543
|
-
|
|
15544
|
-
|
|
15624
|
+
FI,
|
|
15625
|
+
II,
|
|
15626
|
+
_I,
|
|
15627
|
+
bI,
|
|
15628
|
+
PI
|
|
15629
|
+
]), $I = useMemo(() => ({
|
|
15630
|
+
activatorEvent: fI,
|
|
15631
|
+
activators: ZI,
|
|
15632
|
+
active: cI,
|
|
15633
|
+
activeNodeRect: TI,
|
|
15634
|
+
ariaDescribedById: { draggable: hI },
|
|
15545
15635
|
dispatch: W,
|
|
15546
|
-
draggableNodes:
|
|
15547
|
-
over:
|
|
15548
|
-
measureDroppableContainers:
|
|
15636
|
+
draggableNodes: nI,
|
|
15637
|
+
over: KI,
|
|
15638
|
+
measureDroppableContainers: yI
|
|
15549
15639
|
}), [
|
|
15550
|
-
|
|
15551
|
-
|
|
15552
|
-
|
|
15553
|
-
|
|
15640
|
+
fI,
|
|
15641
|
+
ZI,
|
|
15642
|
+
cI,
|
|
15643
|
+
TI,
|
|
15554
15644
|
W,
|
|
15555
|
-
|
|
15556
|
-
|
|
15557
|
-
|
|
15558
|
-
|
|
15645
|
+
hI,
|
|
15646
|
+
nI,
|
|
15647
|
+
KI,
|
|
15648
|
+
yI
|
|
15559
15649
|
]);
|
|
15560
|
-
return React.createElement(DndMonitorContext.Provider, { value:
|
|
15650
|
+
return React.createElement(DndMonitorContext.Provider, { value: qF }, React.createElement(InternalContext.Provider, { value: $I }, React.createElement(PublicContext.Provider, { value: QI }, React.createElement(ActiveDraggableContext.Provider, { value: JI }, j)), React.createElement(RestoreFocus, { disabled: O?.restoreFocus === !1 })), React.createElement(Accessibility, {
|
|
15561
15651
|
...O,
|
|
15562
|
-
hiddenTextDescribedById:
|
|
15652
|
+
hiddenTextDescribedById: hI
|
|
15563
15653
|
}));
|
|
15564
|
-
function
|
|
15565
|
-
let n =
|
|
15654
|
+
function eL() {
|
|
15655
|
+
let n = uI?.autoScrollEnabled === !1, _ = typeof A == "object" ? A.enabled === !1 : A === !1, E = eI && !n && !_;
|
|
15566
15656
|
return typeof A == "object" ? {
|
|
15567
15657
|
...A,
|
|
15568
15658
|
enabled: E
|
|
@@ -15570,13 +15660,13 @@ var DndContext = /* @__PURE__ */ memo(function(n) {
|
|
|
15570
15660
|
}
|
|
15571
15661
|
}), NullContext = /* @__PURE__ */ createContext(null), defaultRole = "button", ID_PREFIX$1 = "Draggable";
|
|
15572
15662
|
function useDraggable(n) {
|
|
15573
|
-
let { id: _, data: E, disabled: O = !1, attributes: A } = n, j = useUniqueId(ID_PREFIX$1), { activators: M, activatorEvent: N, active: P, activeNodeRect: z, ariaDescribedById: B, draggableNodes: H, over: U } = useContext(InternalContext), { role: G = defaultRole, roleDescription: Z = "draggable", tabIndex:
|
|
15663
|
+
let { id: _, data: E, disabled: O = !1, attributes: A } = n, j = useUniqueId(ID_PREFIX$1), { activators: M, activatorEvent: N, active: P, activeNodeRect: z, ariaDescribedById: B, draggableNodes: H, over: U } = useContext(InternalContext), { role: G = defaultRole, roleDescription: Z = "draggable", tabIndex: qF = 0 } = A ?? {}, JF = P?.id === _, YF = useContext(JF ? ActiveDraggableContext : NullContext), [ZF, QF] = useNodeRef(), [$F, eI] = useNodeRef(), tI = useSyntheticListeners(M, _), nI = useLatestValue(E);
|
|
15574
15664
|
return useIsomorphicLayoutEffect$1(() => (H.set(_, {
|
|
15575
15665
|
id: _,
|
|
15576
15666
|
key: j,
|
|
15577
|
-
node:
|
|
15578
|
-
activatorNode:
|
|
15579
|
-
data:
|
|
15667
|
+
node: ZF,
|
|
15668
|
+
activatorNode: $F,
|
|
15669
|
+
data: nI
|
|
15580
15670
|
}), () => {
|
|
15581
15671
|
let n = H.get(_);
|
|
15582
15672
|
n && n.key === j && H.delete(_);
|
|
@@ -15586,26 +15676,26 @@ function useDraggable(n) {
|
|
|
15586
15676
|
activeNodeRect: z,
|
|
15587
15677
|
attributes: useMemo(() => ({
|
|
15588
15678
|
role: G,
|
|
15589
|
-
tabIndex:
|
|
15679
|
+
tabIndex: qF,
|
|
15590
15680
|
"aria-disabled": O,
|
|
15591
|
-
"aria-pressed":
|
|
15681
|
+
"aria-pressed": JF && G === defaultRole ? !0 : void 0,
|
|
15592
15682
|
"aria-roledescription": Z,
|
|
15593
15683
|
"aria-describedby": B.draggable
|
|
15594
15684
|
}), [
|
|
15595
15685
|
O,
|
|
15596
15686
|
G,
|
|
15597
|
-
KF,
|
|
15598
15687
|
qF,
|
|
15688
|
+
JF,
|
|
15599
15689
|
Z,
|
|
15600
15690
|
B.draggable
|
|
15601
15691
|
]),
|
|
15602
|
-
isDragging:
|
|
15603
|
-
listeners: O ? void 0 :
|
|
15604
|
-
node:
|
|
15692
|
+
isDragging: JF,
|
|
15693
|
+
listeners: O ? void 0 : tI,
|
|
15694
|
+
node: ZF,
|
|
15605
15695
|
over: U,
|
|
15606
|
-
setNodeRef:
|
|
15607
|
-
setActivatorNodeRef:
|
|
15608
|
-
transform:
|
|
15696
|
+
setNodeRef: QF,
|
|
15697
|
+
setActivatorNodeRef: eI,
|
|
15698
|
+
transform: YF
|
|
15609
15699
|
};
|
|
15610
15700
|
}
|
|
15611
15701
|
function useDndContext() {
|
|
@@ -15613,34 +15703,34 @@ function useDndContext() {
|
|
|
15613
15703
|
}
|
|
15614
15704
|
var ID_PREFIX$1$1 = "Droppable", defaultResizeObserverConfig = { timeout: 25 };
|
|
15615
15705
|
function useDroppable(n) {
|
|
15616
|
-
let { data: _, disabled: E = !1, id: O, resizeObserverConfig: A } = n, j = useUniqueId(ID_PREFIX$1$1), { active: M, dispatch: N, over: P, measureDroppableContainers: z } = useContext(InternalContext), B = useRef({ disabled: E }), H = useRef(!1), Z = useRef(null),
|
|
15706
|
+
let { data: _, disabled: E = !1, id: O, resizeObserverConfig: A } = n, j = useUniqueId(ID_PREFIX$1$1), { active: M, dispatch: N, over: P, measureDroppableContainers: z } = useContext(InternalContext), B = useRef({ disabled: E }), H = useRef(!1), Z = useRef(null), qF = useRef(null), { disabled: JF, updateMeasurementsFor: YF, timeout: XF } = {
|
|
15617
15707
|
...defaultResizeObserverConfig,
|
|
15618
15708
|
...A
|
|
15619
|
-
},
|
|
15709
|
+
}, ZF = useLatestValue(YF ?? O), $F = useResizeObserver({
|
|
15620
15710
|
callback: useCallback(() => {
|
|
15621
15711
|
if (!H.current) {
|
|
15622
15712
|
H.current = !0;
|
|
15623
15713
|
return;
|
|
15624
15714
|
}
|
|
15625
|
-
|
|
15626
|
-
z(Array.isArray(
|
|
15627
|
-
},
|
|
15628
|
-
}, [
|
|
15629
|
-
disabled:
|
|
15630
|
-
}), [
|
|
15631
|
-
|
|
15632
|
-
}, [
|
|
15715
|
+
qF.current != null && clearTimeout(qF.current), qF.current = setTimeout(() => {
|
|
15716
|
+
z(Array.isArray(ZF.current) ? ZF.current : [ZF.current]), qF.current = null;
|
|
15717
|
+
}, XF);
|
|
15718
|
+
}, [XF]),
|
|
15719
|
+
disabled: JF || !M
|
|
15720
|
+
}), [eI, tI] = useNodeRef(useCallback((n, _) => {
|
|
15721
|
+
$F && (_ && ($F.unobserve(_), H.current = !1), n && $F.observe(n));
|
|
15722
|
+
}, [$F])), nI = useLatestValue(_);
|
|
15633
15723
|
return useEffect(() => {
|
|
15634
|
-
|
|
15635
|
-
}, [$F
|
|
15724
|
+
!$F || !eI.current || ($F.disconnect(), H.current = !1, $F.observe(eI.current));
|
|
15725
|
+
}, [eI, $F]), useEffect(() => (N({
|
|
15636
15726
|
type: Action.RegisterDroppable,
|
|
15637
15727
|
element: {
|
|
15638
15728
|
id: O,
|
|
15639
15729
|
key: j,
|
|
15640
15730
|
disabled: E,
|
|
15641
|
-
node:
|
|
15731
|
+
node: eI,
|
|
15642
15732
|
rect: Z,
|
|
15643
|
-
data:
|
|
15733
|
+
data: nI
|
|
15644
15734
|
}
|
|
15645
15735
|
}), () => N({
|
|
15646
15736
|
type: Action.UnregisterDroppable,
|
|
@@ -15662,9 +15752,9 @@ function useDroppable(n) {
|
|
|
15662
15752
|
active: M,
|
|
15663
15753
|
rect: Z,
|
|
15664
15754
|
isOver: P?.id === O,
|
|
15665
|
-
node:
|
|
15755
|
+
node: eI,
|
|
15666
15756
|
over: P,
|
|
15667
|
-
setNodeRef:
|
|
15757
|
+
setNodeRef: tI
|
|
15668
15758
|
};
|
|
15669
15759
|
}
|
|
15670
15760
|
function AnimationManager(n) {
|
|
@@ -15801,13 +15891,13 @@ function createDefaultDropAnimation(n) {
|
|
|
15801
15891
|
active: j,
|
|
15802
15892
|
dragOverlay: M,
|
|
15803
15893
|
...P
|
|
15804
|
-
}),
|
|
15894
|
+
}), qF = M.node.animate(U, {
|
|
15805
15895
|
duration: _,
|
|
15806
15896
|
easing: E,
|
|
15807
15897
|
fill: "forwards"
|
|
15808
15898
|
});
|
|
15809
15899
|
return new Promise((n) => {
|
|
15810
|
-
|
|
15900
|
+
qF.onfinish = () => {
|
|
15811
15901
|
Z?.(), n();
|
|
15812
15902
|
};
|
|
15813
15903
|
});
|
|
@@ -15820,39 +15910,39 @@ function useKey(n) {
|
|
|
15820
15910
|
}, [n]);
|
|
15821
15911
|
}
|
|
15822
15912
|
var DragOverlay = /* @__PURE__ */ React.memo((n) => {
|
|
15823
|
-
let { adjustScale: E = !1, children: O, dropAnimation: A, style: j, transition: M, modifiers: N, wrapperElement: P = "div", className: z, zIndex: B = 999 } = n, { activatorEvent: H, active: U, activeNodeRect: G, containerNodeRect: Z, draggableNodes:
|
|
15913
|
+
let { adjustScale: E = !1, children: O, dropAnimation: A, style: j, transition: M, modifiers: N, wrapperElement: P = "div", className: z, zIndex: B = 999 } = n, { activatorEvent: H, active: U, activeNodeRect: G, containerNodeRect: Z, draggableNodes: qF, droppableContainers: JF, dragOverlay: YF, over: XF, measuringConfiguration: ZF, scrollableAncestors: QF, scrollableAncestorRects: $F, windowRect: eI } = useDndContext(), tI = useContext(ActiveDraggableContext), nI = useKey(U?.id), rI = applyModifiers(N, {
|
|
15824
15914
|
activatorEvent: H,
|
|
15825
15915
|
active: U,
|
|
15826
15916
|
activeNodeRect: G,
|
|
15827
15917
|
containerNodeRect: Z,
|
|
15828
|
-
draggingNodeRect:
|
|
15829
|
-
over:
|
|
15830
|
-
overlayNodeRect:
|
|
15831
|
-
scrollableAncestors:
|
|
15832
|
-
scrollableAncestorRects:
|
|
15833
|
-
transform:
|
|
15834
|
-
windowRect:
|
|
15835
|
-
}),
|
|
15918
|
+
draggingNodeRect: YF.rect,
|
|
15919
|
+
over: XF,
|
|
15920
|
+
overlayNodeRect: YF.rect,
|
|
15921
|
+
scrollableAncestors: QF,
|
|
15922
|
+
scrollableAncestorRects: $F,
|
|
15923
|
+
transform: tI,
|
|
15924
|
+
windowRect: eI
|
|
15925
|
+
}), iI = useInitialValue(G), aI = useDropAnimation({
|
|
15836
15926
|
config: A,
|
|
15837
|
-
draggableNodes:
|
|
15838
|
-
droppableContainers:
|
|
15839
|
-
measuringConfiguration:
|
|
15840
|
-
}),
|
|
15841
|
-
return React.createElement(NullifiedContextProvider, null, React.createElement(AnimationManager, { animation:
|
|
15842
|
-
key:
|
|
15927
|
+
draggableNodes: qF,
|
|
15928
|
+
droppableContainers: JF,
|
|
15929
|
+
measuringConfiguration: ZF
|
|
15930
|
+
}), oI = iI ? YF.setRef : void 0;
|
|
15931
|
+
return React.createElement(NullifiedContextProvider, null, React.createElement(AnimationManager, { animation: aI }, U && nI ? React.createElement(PositionedOverlay, {
|
|
15932
|
+
key: nI,
|
|
15843
15933
|
id: U.id,
|
|
15844
|
-
ref:
|
|
15934
|
+
ref: oI,
|
|
15845
15935
|
as: P,
|
|
15846
15936
|
activatorEvent: H,
|
|
15847
15937
|
adjustScale: E,
|
|
15848
15938
|
className: z,
|
|
15849
15939
|
transition: M,
|
|
15850
|
-
rect:
|
|
15940
|
+
rect: iI,
|
|
15851
15941
|
style: {
|
|
15852
15942
|
zIndex: B,
|
|
15853
15943
|
...j
|
|
15854
15944
|
},
|
|
15855
|
-
transform:
|
|
15945
|
+
transform: rI
|
|
15856
15946
|
}, O) : null));
|
|
15857
15947
|
});
|
|
15858
15948
|
function arrayMove(n, _, E) {
|
|
@@ -15936,40 +16026,40 @@ var ID_PREFIX = "Sortable", Context = /* @__PURE__ */ React.createContext({
|
|
|
15936
16026
|
}
|
|
15937
16027
|
});
|
|
15938
16028
|
function SortableContext(n) {
|
|
15939
|
-
let { children: E, id: O, items: A, strategy: j = rectSortingStrategy, disabled: M = !1 } = n, { active: N, dragOverlay: P, droppableRects: z, over: B, measureDroppableContainers: H } = useDndContext(), U = useUniqueId(ID_PREFIX, O), W = P.rect !== null, Z = useMemo(() => A.map((n) => typeof n == "object" && "id" in n ? n.id : n), [A]),
|
|
16029
|
+
let { children: E, id: O, items: A, strategy: j = rectSortingStrategy, disabled: M = !1 } = n, { active: N, dragOverlay: P, droppableRects: z, over: B, measureDroppableContainers: H } = useDndContext(), U = useUniqueId(ID_PREFIX, O), W = P.rect !== null, Z = useMemo(() => A.map((n) => typeof n == "object" && "id" in n ? n.id : n), [A]), qF = N != null, JF = N ? Z.indexOf(N.id) : -1, YF = B ? Z.indexOf(B.id) : -1, ZF = useRef(Z), $F = !itemsEqual(Z, ZF.current), eI = YF !== -1 && JF === -1 || $F, tI = normalizeDisabled(M);
|
|
15940
16030
|
useIsomorphicLayoutEffect$1(() => {
|
|
15941
|
-
|
|
16031
|
+
$F && qF && H(Z);
|
|
15942
16032
|
}, [
|
|
15943
|
-
|
|
16033
|
+
$F,
|
|
15944
16034
|
Z,
|
|
15945
|
-
|
|
16035
|
+
qF,
|
|
15946
16036
|
H
|
|
15947
16037
|
]), useEffect(() => {
|
|
15948
|
-
|
|
16038
|
+
ZF.current = Z;
|
|
15949
16039
|
}, [Z]);
|
|
15950
|
-
let
|
|
15951
|
-
activeIndex:
|
|
16040
|
+
let nI = useMemo(() => ({
|
|
16041
|
+
activeIndex: JF,
|
|
15952
16042
|
containerId: U,
|
|
15953
|
-
disabled:
|
|
15954
|
-
disableTransforms:
|
|
16043
|
+
disabled: tI,
|
|
16044
|
+
disableTransforms: eI,
|
|
15955
16045
|
items: Z,
|
|
15956
|
-
overIndex:
|
|
16046
|
+
overIndex: YF,
|
|
15957
16047
|
useDragOverlay: W,
|
|
15958
16048
|
sortedRects: getSortedRects(Z, z),
|
|
15959
16049
|
strategy: j
|
|
15960
16050
|
}), [
|
|
15961
|
-
|
|
16051
|
+
JF,
|
|
15962
16052
|
U,
|
|
15963
|
-
|
|
15964
|
-
|
|
15965
|
-
|
|
16053
|
+
tI.draggable,
|
|
16054
|
+
tI.droppable,
|
|
16055
|
+
eI,
|
|
15966
16056
|
Z,
|
|
15967
|
-
|
|
16057
|
+
YF,
|
|
15968
16058
|
z,
|
|
15969
16059
|
W,
|
|
15970
16060
|
j
|
|
15971
16061
|
]);
|
|
15972
|
-
return React.createElement(Context.Provider, { value:
|
|
16062
|
+
return React.createElement(Context.Provider, { value: nI }, E);
|
|
15973
16063
|
}
|
|
15974
16064
|
var defaultNewIndexGetter = (n) => {
|
|
15975
16065
|
let { id: _, items: E, activeIndex: O, overIndex: A } = n;
|
|
@@ -16011,112 +16101,112 @@ function useDerivedTransform(n) {
|
|
|
16011
16101
|
}, [j]), j;
|
|
16012
16102
|
}
|
|
16013
16103
|
function useSortable(n) {
|
|
16014
|
-
let { animateLayoutChanges: _ = defaultAnimateLayoutChanges, attributes: E, disabled: O, data: A, getNewIndex: j = defaultNewIndexGetter, id: M, strategy: N, resizeObserverConfig: P, transition: z = defaultTransition } = n, { items: B, containerId: H, activeIndex: U, disabled: Z, disableTransforms:
|
|
16104
|
+
let { animateLayoutChanges: _ = defaultAnimateLayoutChanges, attributes: E, disabled: O, data: A, getNewIndex: j = defaultNewIndexGetter, id: M, strategy: N, resizeObserverConfig: P, transition: z = defaultTransition } = n, { items: B, containerId: H, activeIndex: U, disabled: Z, disableTransforms: qF, sortedRects: JF, overIndex: YF, useDragOverlay: ZF, strategy: $F } = useContext(Context), eI = normalizeLocalDisabled(O, Z), tI = B.indexOf(M), nI = useMemo(() => ({
|
|
16015
16105
|
sortable: {
|
|
16016
16106
|
containerId: H,
|
|
16017
|
-
index:
|
|
16107
|
+
index: tI,
|
|
16018
16108
|
items: B
|
|
16019
16109
|
},
|
|
16020
16110
|
...A
|
|
16021
16111
|
}), [
|
|
16022
16112
|
H,
|
|
16023
16113
|
A,
|
|
16024
|
-
|
|
16114
|
+
tI,
|
|
16025
16115
|
B
|
|
16026
|
-
]),
|
|
16116
|
+
]), rI = useMemo(() => B.slice(B.indexOf(M)), [B, M]), { rect: iI, node: aI, isOver: oI, setNodeRef: sI } = useDroppable({
|
|
16027
16117
|
id: M,
|
|
16028
|
-
data:
|
|
16029
|
-
disabled:
|
|
16118
|
+
data: nI,
|
|
16119
|
+
disabled: eI.droppable,
|
|
16030
16120
|
resizeObserverConfig: {
|
|
16031
|
-
updateMeasurementsFor:
|
|
16121
|
+
updateMeasurementsFor: rI,
|
|
16032
16122
|
...P
|
|
16033
16123
|
}
|
|
16034
|
-
}), { active:
|
|
16124
|
+
}), { active: cI, activatorEvent: lI, activeNodeRect: uI, attributes: dI, setNodeRef: fI, listeners: pI, isDragging: mI, over: hI, setActivatorNodeRef: gI, transform: _I } = useDraggable({
|
|
16035
16125
|
id: M,
|
|
16036
|
-
data:
|
|
16126
|
+
data: nI,
|
|
16037
16127
|
attributes: {
|
|
16038
16128
|
...defaultAttributes,
|
|
16039
16129
|
...E
|
|
16040
16130
|
},
|
|
16041
|
-
disabled:
|
|
16042
|
-
}),
|
|
16043
|
-
rects:
|
|
16044
|
-
activeNodeRect:
|
|
16131
|
+
disabled: eI.draggable
|
|
16132
|
+
}), vI = useCombinedRefs(sI, fI), yI = !!cI, bI = yI && !qF && isValidIndex(U) && isValidIndex(YF), xI = !ZF && mI, SI = bI ? (xI && bI ? _I : null) ?? (N ?? $F)({
|
|
16133
|
+
rects: JF,
|
|
16134
|
+
activeNodeRect: uI,
|
|
16045
16135
|
activeIndex: U,
|
|
16046
|
-
overIndex:
|
|
16047
|
-
index:
|
|
16048
|
-
}) : null,
|
|
16136
|
+
overIndex: YF,
|
|
16137
|
+
index: tI
|
|
16138
|
+
}) : null, CI = isValidIndex(U) && isValidIndex(YF) ? j({
|
|
16049
16139
|
id: M,
|
|
16050
16140
|
items: B,
|
|
16051
16141
|
activeIndex: U,
|
|
16052
|
-
overIndex:
|
|
16053
|
-
}) :
|
|
16054
|
-
activeId:
|
|
16142
|
+
overIndex: YF
|
|
16143
|
+
}) : tI, wI = cI?.id, TI = useRef({
|
|
16144
|
+
activeId: wI,
|
|
16055
16145
|
items: B,
|
|
16056
|
-
newIndex:
|
|
16146
|
+
newIndex: CI,
|
|
16057
16147
|
containerId: H
|
|
16058
|
-
}),
|
|
16059
|
-
active:
|
|
16148
|
+
}), EI = B !== TI.current.items, DI = _({
|
|
16149
|
+
active: cI,
|
|
16060
16150
|
containerId: H,
|
|
16061
|
-
isDragging:
|
|
16062
|
-
isSorting:
|
|
16151
|
+
isDragging: mI,
|
|
16152
|
+
isSorting: yI,
|
|
16063
16153
|
id: M,
|
|
16064
|
-
index:
|
|
16154
|
+
index: tI,
|
|
16065
16155
|
items: B,
|
|
16066
|
-
newIndex:
|
|
16067
|
-
previousItems:
|
|
16068
|
-
previousContainerId:
|
|
16156
|
+
newIndex: TI.current.newIndex,
|
|
16157
|
+
previousItems: TI.current.items,
|
|
16158
|
+
previousContainerId: TI.current.containerId,
|
|
16069
16159
|
transition: z,
|
|
16070
|
-
wasDragging:
|
|
16071
|
-
}),
|
|
16072
|
-
disabled: !
|
|
16073
|
-
index:
|
|
16074
|
-
node:
|
|
16075
|
-
rect:
|
|
16160
|
+
wasDragging: TI.current.activeId != null
|
|
16161
|
+
}), OI = useDerivedTransform({
|
|
16162
|
+
disabled: !DI,
|
|
16163
|
+
index: tI,
|
|
16164
|
+
node: aI,
|
|
16165
|
+
rect: iI
|
|
16076
16166
|
});
|
|
16077
16167
|
return useEffect(() => {
|
|
16078
|
-
|
|
16168
|
+
yI && TI.current.newIndex !== CI && (TI.current.newIndex = CI), H !== TI.current.containerId && (TI.current.containerId = H), B !== TI.current.items && (TI.current.items = B);
|
|
16079
16169
|
}, [
|
|
16080
|
-
|
|
16081
|
-
|
|
16170
|
+
yI,
|
|
16171
|
+
CI,
|
|
16082
16172
|
H,
|
|
16083
16173
|
B
|
|
16084
16174
|
]), useEffect(() => {
|
|
16085
|
-
if (
|
|
16086
|
-
if (
|
|
16087
|
-
|
|
16175
|
+
if (wI === TI.current.activeId) return;
|
|
16176
|
+
if (wI != null && TI.current.activeId == null) {
|
|
16177
|
+
TI.current.activeId = wI;
|
|
16088
16178
|
return;
|
|
16089
16179
|
}
|
|
16090
16180
|
let n = setTimeout(() => {
|
|
16091
|
-
|
|
16181
|
+
TI.current.activeId = wI;
|
|
16092
16182
|
}, 50);
|
|
16093
16183
|
return () => clearTimeout(n);
|
|
16094
|
-
}, [
|
|
16095
|
-
active:
|
|
16184
|
+
}, [wI]), {
|
|
16185
|
+
active: cI,
|
|
16096
16186
|
activeIndex: U,
|
|
16097
|
-
attributes:
|
|
16098
|
-
data:
|
|
16099
|
-
rect:
|
|
16100
|
-
index:
|
|
16101
|
-
newIndex:
|
|
16187
|
+
attributes: dI,
|
|
16188
|
+
data: nI,
|
|
16189
|
+
rect: iI,
|
|
16190
|
+
index: tI,
|
|
16191
|
+
newIndex: CI,
|
|
16102
16192
|
items: B,
|
|
16103
|
-
isOver:
|
|
16104
|
-
isSorting:
|
|
16105
|
-
isDragging:
|
|
16106
|
-
listeners:
|
|
16107
|
-
node:
|
|
16108
|
-
overIndex:
|
|
16109
|
-
over:
|
|
16110
|
-
setNodeRef:
|
|
16111
|
-
setActivatorNodeRef:
|
|
16112
|
-
setDroppableNodeRef:
|
|
16113
|
-
setDraggableNodeRef:
|
|
16114
|
-
transform:
|
|
16115
|
-
transition:
|
|
16193
|
+
isOver: oI,
|
|
16194
|
+
isSorting: yI,
|
|
16195
|
+
isDragging: mI,
|
|
16196
|
+
listeners: pI,
|
|
16197
|
+
node: aI,
|
|
16198
|
+
overIndex: YF,
|
|
16199
|
+
over: hI,
|
|
16200
|
+
setNodeRef: vI,
|
|
16201
|
+
setActivatorNodeRef: gI,
|
|
16202
|
+
setDroppableNodeRef: sI,
|
|
16203
|
+
setDraggableNodeRef: fI,
|
|
16204
|
+
transform: OI ?? SI,
|
|
16205
|
+
transition: kI()
|
|
16116
16206
|
};
|
|
16117
|
-
function
|
|
16118
|
-
if (
|
|
16119
|
-
if (!(
|
|
16207
|
+
function kI() {
|
|
16208
|
+
if (OI || EI && TI.current.newIndex === tI) return disabledTransition;
|
|
16209
|
+
if (!(xI && !isKeyboardEvent(lI) || !z) && (yI || DI)) return CSS$1.Transition.toString({
|
|
16120
16210
|
...z,
|
|
16121
16211
|
property: transitionProperty
|
|
16122
16212
|
});
|
|
@@ -16512,13 +16602,13 @@ function createRenderBatcher(n, _) {
|
|
|
16512
16602
|
}, j = () => E = !0, M = stepsOrder.reduce((n, E) => (n[E] = createRenderStep(j, _ ? E : void 0), n), {}), { setup: N, read: P, resolveKeyframes: z, preUpdate: B, update: H, preRender: U, render: W, postRender: G } = M, Z = () => {
|
|
16513
16603
|
let j = MotionGlobalConfig.useManualTiming ? A.timestamp : performance.now();
|
|
16514
16604
|
E = !1, MotionGlobalConfig.useManualTiming || (A.delta = O ? 1e3 / 60 : Math.max(Math.min(j - A.timestamp, maxElapsed), 1)), A.timestamp = j, A.isProcessing = !0, N.process(A), P.process(A), z.process(A), B.process(A), H.process(A), U.process(A), W.process(A), G.process(A), A.isProcessing = !1, E && _ && (O = !1, n(Z));
|
|
16515
|
-
},
|
|
16605
|
+
}, qF = () => {
|
|
16516
16606
|
E = !0, O = !0, A.isProcessing || n(Z);
|
|
16517
16607
|
};
|
|
16518
16608
|
return {
|
|
16519
16609
|
schedule: stepsOrder.reduce((n, _) => {
|
|
16520
16610
|
let O = M[_];
|
|
16521
|
-
return n[_] = (n, _ = !1, A = !1) => (E ||
|
|
16611
|
+
return n[_] = (n, _ = !1, A = !1) => (E || qF(), O.schedule(n, _, A)), n;
|
|
16522
16612
|
}, {}),
|
|
16523
16613
|
cancel: (n) => {
|
|
16524
16614
|
for (let _ = 0; _ < stepsOrder.length; _++) M[stepsOrder[_]].cancel(n);
|
|
@@ -16876,40 +16966,40 @@ function spring(n = springDefaults.visualDuration, _ = springDefaults.bounce) {
|
|
|
16876
16966
|
}, { stiffness: P, damping: z, mass: B, duration: H, velocity: U, isResolvedFromDuration: W } = getSpringOptions({
|
|
16877
16967
|
...E,
|
|
16878
16968
|
velocity: -/* @__PURE__ */ millisecondsToSeconds(E.velocity || 0)
|
|
16879
|
-
}), G = U || 0, Z = z / (2 * Math.sqrt(P * B)),
|
|
16880
|
-
O ||=
|
|
16881
|
-
let
|
|
16969
|
+
}), G = U || 0, Z = z / (2 * Math.sqrt(P * B)), qF = M - j, JF = /* @__PURE__ */ millisecondsToSeconds(Math.sqrt(P / B)), YF = Math.abs(qF) < 5;
|
|
16970
|
+
O ||= YF ? springDefaults.restSpeed.granular : springDefaults.restSpeed.default, A ||= YF ? springDefaults.restDelta.granular : springDefaults.restDelta.default;
|
|
16971
|
+
let XF;
|
|
16882
16972
|
if (Z < 1) {
|
|
16883
|
-
let n = calcAngularFreq(
|
|
16884
|
-
|
|
16885
|
-
} else if (Z === 1)
|
|
16973
|
+
let n = calcAngularFreq(JF, Z);
|
|
16974
|
+
XF = (_) => M - Math.exp(-Z * JF * _) * ((G + Z * JF * qF) / n * Math.sin(n * _) + qF * Math.cos(n * _));
|
|
16975
|
+
} else if (Z === 1) XF = (n) => M - Math.exp(-JF * n) * (qF + (G + JF * qF) * n);
|
|
16886
16976
|
else {
|
|
16887
|
-
let n =
|
|
16888
|
-
|
|
16889
|
-
let E = Math.exp(-Z *
|
|
16890
|
-
return M - E * ((G + Z *
|
|
16977
|
+
let n = JF * Math.sqrt(Z * Z - 1);
|
|
16978
|
+
XF = (_) => {
|
|
16979
|
+
let E = Math.exp(-Z * JF * _), O = Math.min(n * _, 300);
|
|
16980
|
+
return M - E * ((G + Z * JF * qF) * Math.sinh(O) + n * qF * Math.cosh(O)) / n;
|
|
16891
16981
|
};
|
|
16892
16982
|
}
|
|
16893
|
-
let
|
|
16983
|
+
let ZF = {
|
|
16894
16984
|
calculatedDuration: W && H || null,
|
|
16895
16985
|
next: (n) => {
|
|
16896
|
-
let _ =
|
|
16986
|
+
let _ = XF(n);
|
|
16897
16987
|
if (W) N.done = n >= H;
|
|
16898
16988
|
else {
|
|
16899
16989
|
let E = n === 0 ? G : 0;
|
|
16900
|
-
Z < 1 && (E = n === 0 ? /* @__PURE__ */ secondsToMilliseconds(G) : calcGeneratorVelocity(
|
|
16990
|
+
Z < 1 && (E = n === 0 ? /* @__PURE__ */ secondsToMilliseconds(G) : calcGeneratorVelocity(XF, n, _));
|
|
16901
16991
|
let j = Math.abs(E) <= O, P = Math.abs(M - _) <= A;
|
|
16902
16992
|
N.done = j && P;
|
|
16903
16993
|
}
|
|
16904
16994
|
return N.value = N.done ? M : _, N;
|
|
16905
16995
|
},
|
|
16906
16996
|
toString: () => {
|
|
16907
|
-
let n = Math.min(calcGeneratorDuration(
|
|
16997
|
+
let n = Math.min(calcGeneratorDuration(ZF), maxGeneratorDuration), _ = generateLinearEasing((_) => ZF.next(n * _).value, n, 30);
|
|
16908
16998
|
return n + "ms " + _;
|
|
16909
16999
|
},
|
|
16910
17000
|
toTransition: () => {}
|
|
16911
17001
|
};
|
|
16912
|
-
return
|
|
17002
|
+
return ZF;
|
|
16913
17003
|
}
|
|
16914
17004
|
spring.applyToOptions = (n) => {
|
|
16915
17005
|
let _ = createGeneratorEasing(n, 100, spring);
|
|
@@ -16919,26 +17009,26 @@ function inertia({ keyframes: n, velocity: _ = 0, power: E = .8, timeConstant: O
|
|
|
16919
17009
|
let H = n[0], U = {
|
|
16920
17010
|
done: !1,
|
|
16921
17011
|
value: H
|
|
16922
|
-
}, W = (n) => N !== void 0 && n < N || P !== void 0 && n > P, G = (n) => N === void 0 ? P : P === void 0 || Math.abs(N - n) < Math.abs(P - n) ? N : P, Z = E * _,
|
|
16923
|
-
|
|
16924
|
-
let
|
|
16925
|
-
let _ =
|
|
16926
|
-
U.done = Math.abs(_) <= z, U.value = U.done ?
|
|
16927
|
-
},
|
|
16928
|
-
W(U.value) && (
|
|
17012
|
+
}, W = (n) => N !== void 0 && n < N || P !== void 0 && n > P, G = (n) => N === void 0 ? P : P === void 0 || Math.abs(N - n) < Math.abs(P - n) ? N : P, Z = E * _, qF = H + Z, JF = M === void 0 ? qF : M(qF);
|
|
17013
|
+
JF !== qF && (Z = JF - H);
|
|
17014
|
+
let YF = (n) => -Z * Math.exp(-n / O), XF = (n) => JF + YF(n), ZF = (n) => {
|
|
17015
|
+
let _ = YF(n), E = XF(n);
|
|
17016
|
+
U.done = Math.abs(_) <= z, U.value = U.done ? JF : E;
|
|
17017
|
+
}, QF, $F, eI = (n) => {
|
|
17018
|
+
W(U.value) && (QF = n, $F = spring({
|
|
16929
17019
|
keyframes: [U.value, G(U.value)],
|
|
16930
|
-
velocity: calcGeneratorVelocity(
|
|
17020
|
+
velocity: calcGeneratorVelocity(XF, n, U.value),
|
|
16931
17021
|
damping: A,
|
|
16932
17022
|
stiffness: j,
|
|
16933
17023
|
restDelta: z,
|
|
16934
17024
|
restSpeed: B
|
|
16935
17025
|
}));
|
|
16936
17026
|
};
|
|
16937
|
-
return
|
|
17027
|
+
return eI(0), {
|
|
16938
17028
|
calculatedDuration: null,
|
|
16939
17029
|
next: (n) => {
|
|
16940
17030
|
let _ = !1;
|
|
16941
|
-
return
|
|
17031
|
+
return !$F && QF === void 0 && (_ = !0, ZF(n), eI(n)), QF !== void 0 && n >= QF ? $F.next(n - QF) : (!_ && ZF(n), U);
|
|
16942
17032
|
}
|
|
16943
17033
|
};
|
|
16944
17034
|
}
|
|
@@ -17058,22 +17148,22 @@ var WithPromise = class {
|
|
|
17058
17148
|
if (this.startTime === null) return E.next(0);
|
|
17059
17149
|
let { delay: P = 0, keyframes: z, repeat: B, repeatType: H, repeatDelay: U, type: W, onUpdate: G, finalKeyframe: Z } = this.options;
|
|
17060
17150
|
this.speed > 0 ? this.startTime = Math.min(this.startTime, n) : this.speed < 0 && (this.startTime = Math.min(n - O / this.speed, this.startTime)), _ ? this.currentTime = n : this.updateTime(n);
|
|
17061
|
-
let
|
|
17062
|
-
this.currentTime = Math.max(
|
|
17063
|
-
let
|
|
17151
|
+
let qF = this.currentTime - P * (this.playbackSpeed >= 0 ? 1 : -1), JF = this.playbackSpeed >= 0 ? qF < 0 : qF > O;
|
|
17152
|
+
this.currentTime = Math.max(qF, 0), this.state === "finished" && this.holdTime === null && (this.currentTime = O);
|
|
17153
|
+
let YF = this.currentTime, XF = E;
|
|
17064
17154
|
if (B) {
|
|
17065
17155
|
let n = Math.min(this.currentTime, O) / M, _ = Math.floor(n), E = n % 1;
|
|
17066
|
-
!E && n >= 1 && (E = 1), E === 1 && _--, _ = Math.min(_, B + 1), _ % 2 && (H === "reverse" ? (E = 1 - E, U && (E -= U / M)) : H === "mirror" && (
|
|
17156
|
+
!E && n >= 1 && (E = 1), E === 1 && _--, _ = Math.min(_, B + 1), _ % 2 && (H === "reverse" ? (E = 1 - E, U && (E -= U / M)) : H === "mirror" && (XF = j)), YF = clamp(0, 1, E) * M;
|
|
17067
17157
|
}
|
|
17068
|
-
let
|
|
17158
|
+
let ZF = JF ? {
|
|
17069
17159
|
done: !1,
|
|
17070
17160
|
value: z[0]
|
|
17071
|
-
} :
|
|
17072
|
-
A && (
|
|
17073
|
-
let { done:
|
|
17074
|
-
!
|
|
17075
|
-
let
|
|
17076
|
-
return
|
|
17161
|
+
} : XF.next(YF);
|
|
17162
|
+
A && (ZF.value = A(ZF.value));
|
|
17163
|
+
let { done: QF } = ZF;
|
|
17164
|
+
!JF && N !== null && (QF = this.playbackSpeed >= 0 ? this.currentTime >= O : this.currentTime <= 0);
|
|
17165
|
+
let $F = this.holdTime === null && (this.state === "finished" || this.state === "running" && QF);
|
|
17166
|
+
return $F && W !== inertia && (ZF.value = getFinalKeyframe$1(z, this.options, Z, this.speed)), G && G(ZF.value), $F && this.finish(), ZF;
|
|
17077
17167
|
}
|
|
17078
17168
|
then(n, _) {
|
|
17079
17169
|
return this.finished.then(n, _);
|
|
@@ -18136,46 +18226,46 @@ function onlyElements(n) {
|
|
|
18136
18226
|
}), _;
|
|
18137
18227
|
}
|
|
18138
18228
|
var AnimatePresence = ({ children: n, custom: _, initial: E = !0, onExitComplete: O, presenceAffectsLayout: A = !0, mode: j = "sync", propagate: M = !1, anchorX: N = "left", root: P }) => {
|
|
18139
|
-
let [z, B] = usePresence(M), H = useMemo(() => onlyElements(n), [n]), U = M && !z ? [] : H.map(getChildKey), G = useRef(!0), Z = useRef(H),
|
|
18229
|
+
let [z, B] = usePresence(M), H = useMemo(() => onlyElements(n), [n]), U = M && !z ? [] : H.map(getChildKey), G = useRef(!0), Z = useRef(H), qF = useConstant(() => /* @__PURE__ */ new Map()), JF = useRef(/* @__PURE__ */ new Set()), [YF, ZF] = useState(H), [eI, tI] = useState(H);
|
|
18140
18230
|
useIsomorphicLayoutEffect(() => {
|
|
18141
18231
|
G.current = !1, Z.current = H;
|
|
18142
|
-
for (let n = 0; n <
|
|
18143
|
-
let _ = getChildKey(
|
|
18144
|
-
U.includes(_) ? (
|
|
18232
|
+
for (let n = 0; n < eI.length; n++) {
|
|
18233
|
+
let _ = getChildKey(eI[n]);
|
|
18234
|
+
U.includes(_) ? (qF.delete(_), JF.current.delete(_)) : qF.get(_) !== !0 && qF.set(_, !1);
|
|
18145
18235
|
}
|
|
18146
18236
|
}, [
|
|
18147
|
-
|
|
18237
|
+
eI,
|
|
18148
18238
|
U.length,
|
|
18149
18239
|
U.join("-")
|
|
18150
18240
|
]);
|
|
18151
|
-
let
|
|
18152
|
-
if (H !==
|
|
18241
|
+
let nI = [];
|
|
18242
|
+
if (H !== YF) {
|
|
18153
18243
|
let n = [...H];
|
|
18154
|
-
for (let _ = 0; _ <
|
|
18155
|
-
let E =
|
|
18156
|
-
U.includes(O) || (n.splice(_, 0, E),
|
|
18244
|
+
for (let _ = 0; _ < eI.length; _++) {
|
|
18245
|
+
let E = eI[_], O = getChildKey(E);
|
|
18246
|
+
U.includes(O) || (n.splice(_, 0, E), nI.push(E));
|
|
18157
18247
|
}
|
|
18158
|
-
return j === "wait" &&
|
|
18248
|
+
return j === "wait" && nI.length && (n = nI), tI(onlyElements(n)), ZF(H), null;
|
|
18159
18249
|
}
|
|
18160
|
-
process.env.NODE_ENV !== "production" && j === "wait" &&
|
|
18161
|
-
let { forceRender:
|
|
18162
|
-
return jsx(Fragment$1, { children:
|
|
18163
|
-
let W = getChildKey(n),
|
|
18250
|
+
process.env.NODE_ENV !== "production" && j === "wait" && eI.length > 1 && console.warn("You're attempting to animate multiple children within AnimatePresence, but its mode is set to \"wait\". This will lead to odd visual behaviour.");
|
|
18251
|
+
let { forceRender: rI } = useContext(LayoutGroupContext);
|
|
18252
|
+
return jsx(Fragment$1, { children: eI.map((n) => {
|
|
18253
|
+
let W = getChildKey(n), YF = M && !z ? !1 : H === eI || U.includes(W);
|
|
18164
18254
|
return jsx(PresenceChild, {
|
|
18165
|
-
isPresent:
|
|
18255
|
+
isPresent: YF,
|
|
18166
18256
|
initial: !G.current || E ? void 0 : !1,
|
|
18167
18257
|
custom: _,
|
|
18168
18258
|
presenceAffectsLayout: A,
|
|
18169
18259
|
mode: j,
|
|
18170
18260
|
root: P,
|
|
18171
|
-
onExitComplete:
|
|
18172
|
-
if (
|
|
18173
|
-
if (
|
|
18261
|
+
onExitComplete: YF ? void 0 : () => {
|
|
18262
|
+
if (JF.current.has(W)) return;
|
|
18263
|
+
if (JF.current.add(W), qF.has(W)) qF.set(W, !0);
|
|
18174
18264
|
else return;
|
|
18175
18265
|
let n = !0;
|
|
18176
|
-
|
|
18266
|
+
qF.forEach((_) => {
|
|
18177
18267
|
_ || (n = !1);
|
|
18178
|
-
}), n && (
|
|
18268
|
+
}), n && (rI?.(), tI(Z.current), M && B?.(), O && O());
|
|
18179
18269
|
},
|
|
18180
18270
|
anchorX: N,
|
|
18181
18271
|
children: n
|
|
@@ -18604,12 +18694,12 @@ function useVisualElement(n, _, E, O, A, j) {
|
|
|
18604
18694
|
useInsertionEffect(() => {
|
|
18605
18695
|
H && Z.current && H.update(E, P);
|
|
18606
18696
|
});
|
|
18607
|
-
let
|
|
18697
|
+
let qF = E[optimizedAppearDataAttribute], YF = useRef(!!qF && !window.MotionHandoffIsComplete?.(qF) && window.MotionHasOptimisedAnimation?.(qF));
|
|
18608
18698
|
return useIsomorphicLayoutEffect(() => {
|
|
18609
|
-
H && (Z.current = !0, window.MotionIsMounted = !0, H.updateFeatures(), H.scheduleRenderMicrotask(),
|
|
18699
|
+
H && (Z.current = !0, window.MotionIsMounted = !0, H.updateFeatures(), H.scheduleRenderMicrotask(), YF.current && H.animationState && H.animationState.animateChanges());
|
|
18610
18700
|
}), useEffect(() => {
|
|
18611
|
-
H && (!
|
|
18612
|
-
window.MotionHandoffMarkAsComplete?.(
|
|
18701
|
+
H && (!YF.current && H.animationState && H.animationState.animateChanges(), YF.current &&= (queueMicrotask(() => {
|
|
18702
|
+
window.MotionHandoffMarkAsComplete?.(qF);
|
|
18613
18703
|
}), !1), H.enteringChildren = void 0);
|
|
18614
18704
|
}), H;
|
|
18615
18705
|
}
|
|
@@ -19287,34 +19377,34 @@ function createAnimationState(n) {
|
|
|
19287
19377
|
function M(j) {
|
|
19288
19378
|
let { props: M } = n, N = getVariantContext(n.parent) || {}, P = [], z = /* @__PURE__ */ new Set(), B = {}, H = Infinity;
|
|
19289
19379
|
for (let _ = 0; _ < numAnimationTypes; _++) {
|
|
19290
|
-
let U = reversePriorityOrder[_], W = E[U], G = M[U] === void 0 ? N[U] : M[U], Z = isVariantLabel(G),
|
|
19291
|
-
|
|
19292
|
-
let
|
|
19293
|
-
if (
|
|
19294
|
-
let
|
|
19295
|
-
|
|
19296
|
-
let { prevResolvedValues:
|
|
19297
|
-
|
|
19298
|
-
|
|
19299
|
-
},
|
|
19300
|
-
|
|
19380
|
+
let U = reversePriorityOrder[_], W = E[U], G = M[U] === void 0 ? N[U] : M[U], Z = isVariantLabel(G), qF = U === j ? W.isActive : null;
|
|
19381
|
+
qF === !1 && (H = _);
|
|
19382
|
+
let JF = G === N[U] && G !== M[U] && Z;
|
|
19383
|
+
if (JF && O && n.manuallyAnimateOnMount && (JF = !1), W.protectedKeys = { ...B }, !W.isActive && qF === null || !G && !W.prevProp || isAnimationControls(G) || typeof G == "boolean") continue;
|
|
19384
|
+
let YF = checkVariantsDidChange(W.prevProp, G), XF = YF || U === j && W.isActive && !JF && Z || _ > H && Z, ZF = !1, QF = Array.isArray(G) ? G : [G], $F = QF.reduce(A(U), {});
|
|
19385
|
+
qF === !1 && ($F = {});
|
|
19386
|
+
let { prevResolvedValues: eI = {} } = W, tI = {
|
|
19387
|
+
...eI,
|
|
19388
|
+
...$F
|
|
19389
|
+
}, nI = (_) => {
|
|
19390
|
+
XF = !0, z.has(_) && (ZF = !0, z.delete(_)), W.needsAnimating[_] = !0;
|
|
19301
19391
|
let E = n.getValue(_);
|
|
19302
19392
|
E && (E.liveStyle = !1);
|
|
19303
19393
|
};
|
|
19304
|
-
for (let n in
|
|
19305
|
-
let _ =
|
|
19394
|
+
for (let n in tI) {
|
|
19395
|
+
let _ = $F[n], E = eI[n];
|
|
19306
19396
|
if (B.hasOwnProperty(n)) continue;
|
|
19307
19397
|
let O = !1;
|
|
19308
|
-
O = isKeyframesTarget(_) && isKeyframesTarget(E) ? !shallowCompare(_, E) : _ !== E, O ? _ == null ? z.add(n) :
|
|
19398
|
+
O = isKeyframesTarget(_) && isKeyframesTarget(E) ? !shallowCompare(_, E) : _ !== E, O ? _ == null ? z.add(n) : nI(n) : _ !== void 0 && z.has(n) ? nI(n) : W.protectedKeys[n] = !0;
|
|
19309
19399
|
}
|
|
19310
|
-
W.prevProp = G, W.prevResolvedValues =
|
|
19400
|
+
W.prevProp = G, W.prevResolvedValues = $F, W.isActive && (B = {
|
|
19311
19401
|
...B,
|
|
19312
|
-
|
|
19313
|
-
}), O && n.blockInitialAnimation && (
|
|
19314
|
-
let
|
|
19315
|
-
|
|
19402
|
+
...$F
|
|
19403
|
+
}), O && n.blockInitialAnimation && (XF = !1);
|
|
19404
|
+
let rI = JF && YF;
|
|
19405
|
+
XF && (!rI || ZF) && P.push(...QF.map((_) => {
|
|
19316
19406
|
let E = { type: U };
|
|
19317
|
-
if (typeof _ == "string" && O && !
|
|
19407
|
+
if (typeof _ == "string" && O && !rI && n.manuallyAnimateOnMount && n.parent) {
|
|
19318
19408
|
let { parent: O } = n, A = resolveVariant(O, _);
|
|
19319
19409
|
if (O.enteringChildren && A) {
|
|
19320
19410
|
let { delayChildren: _ } = A.transition || {};
|
|
@@ -21472,10 +21562,10 @@ const ShortcutsDialog = () => /* @__PURE__ */ jsxs(s$4, { children: [/* @__PURE_
|
|
|
21472
21562
|
});
|
|
21473
21563
|
let N = j - n + 100, P = M - O + 100, z = window.innerWidth - 300, B = window.innerHeight - 100, H = z / N, U = B / P, W = Math.min(H, U);
|
|
21474
21564
|
W = Math.min(Math.max(W, .1), 5), _(W);
|
|
21475
|
-
let G = (n + j) / 2, Z = (O + M) / 2,
|
|
21565
|
+
let G = (n + j) / 2, Z = (O + M) / 2, qF = z / 2, JF = B / 2;
|
|
21476
21566
|
E({
|
|
21477
|
-
x:
|
|
21478
|
-
y:
|
|
21567
|
+
x: qF - G * W,
|
|
21568
|
+
y: JF - Z * W
|
|
21479
21569
|
});
|
|
21480
21570
|
},
|
|
21481
21571
|
children: /* @__PURE__ */ jsx(AspectRatioIcon, {})
|
|
@@ -21485,34 +21575,34 @@ const ShortcutsDialog = () => /* @__PURE__ */ jsxs(s$4, { children: [/* @__PURE_
|
|
|
21485
21575
|
});
|
|
21486
21576
|
};
|
|
21487
21577
|
var EditorContent = ({ layout: n, initialState: E, onSave: O, theme: A = "light", templates: j, activeTemplateId: M, onTemplateChange: N }) => {
|
|
21488
|
-
let [P, z] = useState(!0), [B, H] = useState(!0), [U, W] = useState(null), [G, Z] = useState(!1), [
|
|
21578
|
+
let [P, z] = useState(!0), [B, H] = useState(!0), [U, W] = useState(null), [G, Z] = useState(!1), [qF, JF] = useState(!1), [YF, XF] = useState(j && j.length > 0 ? j[0].id : null), ZF = React.useRef(null), { addElement: QF, loadState: eI, state: tI, undo: nI, redo: rI, copy: iI, paste: aI, removeSelected: cI, updateElements: lI } = useEditor(), uI = React.useRef(null);
|
|
21489
21579
|
React.useEffect(() => {
|
|
21490
21580
|
let n = () => {
|
|
21491
|
-
|
|
21581
|
+
JF(window.innerWidth < 768);
|
|
21492
21582
|
};
|
|
21493
21583
|
return n(), window.addEventListener("resize", n), () => window.removeEventListener("resize", n);
|
|
21494
21584
|
}, []);
|
|
21495
|
-
let
|
|
21585
|
+
let dI = () => {
|
|
21496
21586
|
let n = {
|
|
21497
|
-
elements:
|
|
21498
|
-
isList:
|
|
21499
|
-
mockData:
|
|
21500
|
-
singleMockData:
|
|
21501
|
-
listSettings:
|
|
21502
|
-
canvasHeight:
|
|
21503
|
-
gridSize:
|
|
21587
|
+
elements: tI.elements,
|
|
21588
|
+
isList: tI.isList,
|
|
21589
|
+
mockData: tI.mockData,
|
|
21590
|
+
singleMockData: tI.singleMockData,
|
|
21591
|
+
listSettings: tI.listSettings,
|
|
21592
|
+
canvasHeight: tI.canvasHeight,
|
|
21593
|
+
gridSize: tI.gridSize
|
|
21504
21594
|
}, _ = JSON.stringify(n, null, 2), E = new Blob([_], { type: "application/json" }), O = URL.createObjectURL(E), A = document.createElement("a");
|
|
21505
21595
|
A.href = O, A.download = `layout-${(/* @__PURE__ */ new Date()).toISOString().slice(0, 10)}.json`, document.body.appendChild(A), A.click(), document.body.removeChild(A), URL.revokeObjectURL(O);
|
|
21506
|
-
},
|
|
21507
|
-
|
|
21508
|
-
},
|
|
21596
|
+
}, fI = () => {
|
|
21597
|
+
uI.current?.click();
|
|
21598
|
+
}, pI = (n) => {
|
|
21509
21599
|
let _ = n.target.files?.[0];
|
|
21510
21600
|
if (!_) return;
|
|
21511
21601
|
let E = new FileReader();
|
|
21512
21602
|
E.onload = (n) => {
|
|
21513
21603
|
try {
|
|
21514
21604
|
let _ = n.target?.result;
|
|
21515
|
-
|
|
21605
|
+
eI(JSON.parse(_));
|
|
21516
21606
|
} catch (n) {
|
|
21517
21607
|
console.error("Failed to import layout", n), alert("Erro ao importar layout. Arquivo inválido.");
|
|
21518
21608
|
}
|
|
@@ -21530,7 +21620,7 @@ var EditorContent = ({ layout: n, initialState: E, onSave: O, theme: A = "light"
|
|
|
21530
21620
|
let n = new FileReader();
|
|
21531
21621
|
n.onload = (n) => {
|
|
21532
21622
|
let _ = n.target?.result;
|
|
21533
|
-
|
|
21623
|
+
QF({
|
|
21534
21624
|
type: "image",
|
|
21535
21625
|
content: _,
|
|
21536
21626
|
width: 200,
|
|
@@ -21542,24 +21632,24 @@ var EditorContent = ({ layout: n, initialState: E, onSave: O, theme: A = "light"
|
|
|
21542
21632
|
}
|
|
21543
21633
|
};
|
|
21544
21634
|
return window.addEventListener("paste", n), () => window.removeEventListener("paste", n);
|
|
21545
|
-
}, [
|
|
21635
|
+
}, [QF]), React.useEffect(() => {
|
|
21546
21636
|
let n = (n) => {
|
|
21547
21637
|
if (!(document.activeElement?.tagName === "INPUT" || document.activeElement?.tagName === "TEXTAREA" || document.activeElement?.isContentEditable)) {
|
|
21548
|
-
if ((n.ctrlKey || n.metaKey) && n.key === "z") n.shiftKey ? (n.preventDefault(),
|
|
21549
|
-
else if ((n.ctrlKey || n.metaKey) && n.key === "y") n.preventDefault(),
|
|
21550
|
-
else if ((n.ctrlKey || n.metaKey) && n.key === "c") n.preventDefault(),
|
|
21551
|
-
else if ((n.ctrlKey || n.metaKey) && n.key === "v") n.preventDefault(),
|
|
21552
|
-
else if (n.key === "Delete" || n.key === "Backspace")
|
|
21638
|
+
if ((n.ctrlKey || n.metaKey) && n.key === "z") n.shiftKey ? (n.preventDefault(), rI()) : (n.preventDefault(), nI());
|
|
21639
|
+
else if ((n.ctrlKey || n.metaKey) && n.key === "y") n.preventDefault(), rI();
|
|
21640
|
+
else if ((n.ctrlKey || n.metaKey) && n.key === "c") n.preventDefault(), iI();
|
|
21641
|
+
else if ((n.ctrlKey || n.metaKey) && n.key === "v") n.preventDefault(), aI();
|
|
21642
|
+
else if (n.key === "Delete" || n.key === "Backspace") tI.selectedElementIds.length > 0 && (n.preventDefault(), cI());
|
|
21553
21643
|
else if ([
|
|
21554
21644
|
"ArrowUp",
|
|
21555
21645
|
"ArrowDown",
|
|
21556
21646
|
"ArrowLeft",
|
|
21557
21647
|
"ArrowRight"
|
|
21558
|
-
].includes(n.key) &&
|
|
21648
|
+
].includes(n.key) && tI.selectedElementIds.length > 0) {
|
|
21559
21649
|
n.preventDefault();
|
|
21560
21650
|
let _ = n.shiftKey ? 10 : 1, E = [];
|
|
21561
|
-
|
|
21562
|
-
let A =
|
|
21651
|
+
tI.selectedElementIds.forEach((O) => {
|
|
21652
|
+
let A = tI.elements.find((n) => n.id === O);
|
|
21563
21653
|
if (A) {
|
|
21564
21654
|
let j = {};
|
|
21565
21655
|
n.key === "ArrowUp" && (j.y = A.y - _), n.key === "ArrowDown" && (j.y = A.y + _), n.key === "ArrowLeft" && (j.x = A.x - _), n.key === "ArrowRight" && (j.x = A.x + _), E.push({
|
|
@@ -21567,66 +21657,66 @@ var EditorContent = ({ layout: n, initialState: E, onSave: O, theme: A = "light"
|
|
|
21567
21657
|
changes: j
|
|
21568
21658
|
});
|
|
21569
21659
|
}
|
|
21570
|
-
}), E.length > 0 &&
|
|
21660
|
+
}), E.length > 0 && lI(E);
|
|
21571
21661
|
}
|
|
21572
21662
|
}
|
|
21573
21663
|
};
|
|
21574
21664
|
return window.addEventListener("keydown", n), () => window.removeEventListener("keydown", n);
|
|
21575
21665
|
}, [
|
|
21576
|
-
tI,
|
|
21577
21666
|
nI,
|
|
21578
21667
|
rI,
|
|
21579
21668
|
iI,
|
|
21580
|
-
|
|
21581
|
-
|
|
21582
|
-
|
|
21583
|
-
|
|
21669
|
+
aI,
|
|
21670
|
+
cI,
|
|
21671
|
+
tI.selectedElementIds,
|
|
21672
|
+
tI.elements,
|
|
21673
|
+
lI
|
|
21584
21674
|
]), React.useEffect(() => {
|
|
21585
21675
|
if (E) try {
|
|
21586
21676
|
let n = typeof E == "string" ? JSON.parse(E) : E;
|
|
21587
|
-
Array.isArray(n) ?
|
|
21677
|
+
Array.isArray(n) ? eI({ elements: n }) : n.elements && eI(n);
|
|
21588
21678
|
} catch (n) {
|
|
21589
21679
|
console.error("Failed to load initial state", n);
|
|
21590
21680
|
}
|
|
21591
|
-
}, [E,
|
|
21681
|
+
}, [E, eI]), React.useEffect(() => {
|
|
21592
21682
|
if (!(!j || j.length === 0)) {
|
|
21593
21683
|
if (M) {
|
|
21594
|
-
|
|
21684
|
+
XF(M);
|
|
21595
21685
|
return;
|
|
21596
21686
|
}
|
|
21597
|
-
|
|
21687
|
+
YF || XF(j[0].id);
|
|
21598
21688
|
}
|
|
21599
21689
|
}, [
|
|
21600
21690
|
M,
|
|
21601
|
-
|
|
21691
|
+
YF,
|
|
21602
21692
|
j
|
|
21603
21693
|
]);
|
|
21604
|
-
let
|
|
21694
|
+
let mI = React.useCallback((n) => {
|
|
21605
21695
|
if (n) try {
|
|
21606
21696
|
let _ = typeof n == "string" ? JSON.parse(n) : n;
|
|
21607
21697
|
if (Array.isArray(_)) {
|
|
21608
|
-
|
|
21698
|
+
eI({ elements: _ });
|
|
21609
21699
|
return;
|
|
21610
21700
|
}
|
|
21611
21701
|
if (_ && typeof _ == "object" && "elements" in _) {
|
|
21612
|
-
|
|
21702
|
+
eI(_);
|
|
21613
21703
|
return;
|
|
21614
21704
|
}
|
|
21615
21705
|
} catch (n) {
|
|
21616
21706
|
console.error("Failed to apply template", n);
|
|
21617
21707
|
}
|
|
21618
|
-
}, [
|
|
21708
|
+
}, [eI]);
|
|
21619
21709
|
React.useEffect(() => {
|
|
21620
|
-
if (!j || j.length === 0 || !M ||
|
|
21710
|
+
if (!j || j.length === 0 || !M || ZF.current === M) return;
|
|
21621
21711
|
let n = j.find((n) => n.id === M);
|
|
21622
|
-
n && (
|
|
21712
|
+
n && (mI(n.state), ZF.current = M);
|
|
21623
21713
|
}, [
|
|
21624
21714
|
M,
|
|
21625
|
-
|
|
21715
|
+
mI,
|
|
21626
21716
|
j
|
|
21627
21717
|
]);
|
|
21628
|
-
let
|
|
21629
|
-
console.log(`Adding element of type: ${n}`),
|
|
21718
|
+
let hI = (n) => {
|
|
21719
|
+
console.log(`Adding element of type: ${n}`), QF({
|
|
21630
21720
|
type: n,
|
|
21631
21721
|
content: `New ${n}`
|
|
21632
21722
|
});
|
|
@@ -21696,19 +21786,19 @@ var EditorContent = ({ layout: n, initialState: E, onSave: O, theme: A = "light"
|
|
|
21696
21786
|
style: { width: "240px" },
|
|
21697
21787
|
children: [
|
|
21698
21788
|
/* @__PURE__ */ jsx(v$3, {
|
|
21699
|
-
onSelect: () =>
|
|
21789
|
+
onSelect: () => hI("text"),
|
|
21700
21790
|
children: "Texto"
|
|
21701
21791
|
}),
|
|
21702
21792
|
/* @__PURE__ */ jsx(v$3, {
|
|
21703
|
-
onSelect: () =>
|
|
21793
|
+
onSelect: () => hI("image"),
|
|
21704
21794
|
children: "Imagem"
|
|
21705
21795
|
}),
|
|
21706
21796
|
/* @__PURE__ */ jsx(v$3, {
|
|
21707
|
-
onSelect: () =>
|
|
21797
|
+
onSelect: () => hI("box"),
|
|
21708
21798
|
children: "Caixa (Container)"
|
|
21709
21799
|
}),
|
|
21710
21800
|
/* @__PURE__ */ jsx(v$3, {
|
|
21711
|
-
onSelect: () =>
|
|
21801
|
+
onSelect: () => hI("text-container"),
|
|
21712
21802
|
children: "Container com Texto"
|
|
21713
21803
|
})
|
|
21714
21804
|
]
|
|
@@ -21724,12 +21814,12 @@ var EditorContent = ({ layout: n, initialState: E, onSave: O, theme: A = "light"
|
|
|
21724
21814
|
onClick: () => {
|
|
21725
21815
|
if (O) {
|
|
21726
21816
|
let n = {
|
|
21727
|
-
elements:
|
|
21728
|
-
isList:
|
|
21729
|
-
mockData:
|
|
21730
|
-
singleMockData:
|
|
21731
|
-
listSettings:
|
|
21732
|
-
canvasHeight:
|
|
21817
|
+
elements: tI.elements,
|
|
21818
|
+
isList: tI.isList,
|
|
21819
|
+
mockData: tI.mockData,
|
|
21820
|
+
singleMockData: tI.singleMockData,
|
|
21821
|
+
listSettings: tI.listSettings,
|
|
21822
|
+
canvasHeight: tI.canvasHeight
|
|
21733
21823
|
};
|
|
21734
21824
|
O(JSON.stringify(n, null, 2));
|
|
21735
21825
|
}
|
|
@@ -21747,7 +21837,7 @@ var EditorContent = ({ layout: n, initialState: E, onSave: O, theme: A = "light"
|
|
|
21747
21837
|
cursor: "pointer",
|
|
21748
21838
|
justifyContent: "center"
|
|
21749
21839
|
},
|
|
21750
|
-
onClick:
|
|
21840
|
+
onClick: dI,
|
|
21751
21841
|
children: [/* @__PURE__ */ jsx(DownloadIcon, {}), " Exportar"]
|
|
21752
21842
|
}), /* @__PURE__ */ jsxs(o, {
|
|
21753
21843
|
variant: "soft",
|
|
@@ -21757,16 +21847,16 @@ var EditorContent = ({ layout: n, initialState: E, onSave: O, theme: A = "light"
|
|
|
21757
21847
|
cursor: "pointer",
|
|
21758
21848
|
justifyContent: "center"
|
|
21759
21849
|
},
|
|
21760
|
-
onClick:
|
|
21850
|
+
onClick: fI,
|
|
21761
21851
|
children: [/* @__PURE__ */ jsx(UploadIcon, {}), " Importar"]
|
|
21762
21852
|
})]
|
|
21763
21853
|
}),
|
|
21764
21854
|
/* @__PURE__ */ jsx("input", {
|
|
21765
21855
|
type: "file",
|
|
21766
|
-
ref:
|
|
21856
|
+
ref: uI,
|
|
21767
21857
|
style: { display: "none" },
|
|
21768
21858
|
accept: ".json",
|
|
21769
|
-
onChange:
|
|
21859
|
+
onChange: pI
|
|
21770
21860
|
}),
|
|
21771
21861
|
/* @__PURE__ */ jsxs(p, {
|
|
21772
21862
|
mt: "3",
|
|
@@ -21827,8 +21917,8 @@ var EditorContent = ({ layout: n, initialState: E, onSave: O, theme: A = "light"
|
|
|
21827
21917
|
/* @__PURE__ */ jsx(p, {
|
|
21828
21918
|
mt: "2",
|
|
21829
21919
|
children: /* @__PURE__ */ jsx("select", {
|
|
21830
|
-
value:
|
|
21831
|
-
onChange: (n) =>
|
|
21920
|
+
value: YF || "",
|
|
21921
|
+
onChange: (n) => XF(n.target.value),
|
|
21832
21922
|
style: {
|
|
21833
21923
|
width: "100%",
|
|
21834
21924
|
padding: "8px",
|
|
@@ -21845,12 +21935,12 @@ var EditorContent = ({ layout: n, initialState: E, onSave: O, theme: A = "light"
|
|
|
21845
21935
|
}, n.id))
|
|
21846
21936
|
})
|
|
21847
21937
|
}),
|
|
21848
|
-
|
|
21938
|
+
YF && j.find((n) => n.id === YF)?.description && /* @__PURE__ */ jsx(p$2, {
|
|
21849
21939
|
size: "1",
|
|
21850
21940
|
color: "gray",
|
|
21851
21941
|
as: "div",
|
|
21852
21942
|
mt: "2",
|
|
21853
|
-
children: j.find((n) => n.id ===
|
|
21943
|
+
children: j.find((n) => n.id === YF)?.description
|
|
21854
21944
|
}),
|
|
21855
21945
|
/* @__PURE__ */ jsx(o, {
|
|
21856
21946
|
variant: "soft",
|
|
@@ -21862,13 +21952,13 @@ var EditorContent = ({ layout: n, initialState: E, onSave: O, theme: A = "light"
|
|
|
21862
21952
|
marginTop: "10px"
|
|
21863
21953
|
},
|
|
21864
21954
|
onClick: () => {
|
|
21865
|
-
if (!
|
|
21955
|
+
if (!YF) return;
|
|
21866
21956
|
if (N) {
|
|
21867
|
-
N(
|
|
21957
|
+
N(YF);
|
|
21868
21958
|
return;
|
|
21869
21959
|
}
|
|
21870
|
-
let n = j.find((n) => n.id ===
|
|
21871
|
-
n && (
|
|
21960
|
+
let n = j.find((n) => n.id === YF);
|
|
21961
|
+
n && (mI(n.state), ZF.current = YF);
|
|
21872
21962
|
},
|
|
21873
21963
|
children: "Aplicar Template"
|
|
21874
21964
|
})
|
|
@@ -22122,7 +22212,7 @@ var EditorContent = ({ layout: n, initialState: E, onSave: O, theme: A = "light"
|
|
|
22122
22212
|
onOpenChange: Z
|
|
22123
22213
|
}),
|
|
22124
22214
|
/* @__PURE__ */ jsx(s$4, {
|
|
22125
|
-
open:
|
|
22215
|
+
open: qF,
|
|
22126
22216
|
children: /* @__PURE__ */ jsxs(p$8, {
|
|
22127
22217
|
style: { maxWidth: 450 },
|
|
22128
22218
|
children: [/* @__PURE__ */ jsx(g$2, { children: "Dispositivo Não Suportado" }), /* @__PURE__ */ jsx(m$3, {
|
|
@@ -22173,6 +22263,10 @@ var camelToKebab = (n) => n.replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g, "$1-$2").toL
|
|
|
22173
22263
|
let O = camelToKebab(n), A = typeof E == "number" && _.includes(n) ? E + "px" : E;
|
|
22174
22264
|
return typeof A == "string" && /^#([0-9a-fA-F]{8})$/.test(A) && (A = hex8ToRgba(A)), `${O}: ${A}`;
|
|
22175
22265
|
}).filter(Boolean).join("; ");
|
|
22266
|
+
}, applyShadowColor = (n, _) => {
|
|
22267
|
+
if (!n || n === "none") return `0 4px 12px ${_}`;
|
|
22268
|
+
let E = n.split(","), O = E[E.length - 1].trim(), A = /(rgba?\([^)]+\)|#(?:[0-9a-fA-F]{3,8})|[a-zA-Z]+)\s*$/, j = A.test(O) ? O.replace(A, _) : `${O} ${_}`;
|
|
22269
|
+
return E[E.length - 1] = j, E.join(", ");
|
|
22176
22270
|
}, measureTextHeight = (n, _, E, O, A = 1.2) => {
|
|
22177
22271
|
if (!n) return 0;
|
|
22178
22272
|
try {
|
|
@@ -22273,8 +22367,8 @@ var camelToKebab = (n) => n.replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g, "$1-$2").toL
|
|
|
22273
22367
|
} else _ = measureTextHeight(M, B, z, P);
|
|
22274
22368
|
let U = _ + N * 2;
|
|
22275
22369
|
(!H || H && !_) && (U += 4);
|
|
22276
|
-
let W = parseInt(String(n.style && n.style.minHeight || 0)), G = Math.max(U, W), Z = n.height,
|
|
22277
|
-
if (
|
|
22370
|
+
let W = parseInt(String(n.style && n.style.minHeight || 0)), G = Math.max(U, W), Z = n.height, qF = G - Z;
|
|
22371
|
+
if (qF > 0) {
|
|
22278
22372
|
n.height = G, n.content = M;
|
|
22279
22373
|
let _ = [], N = O.get(n.id);
|
|
22280
22374
|
N && E.forEach((E) => {
|
|
@@ -22284,10 +22378,10 @@ var camelToKebab = (n) => n.replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g, "$1-$2").toL
|
|
|
22284
22378
|
});
|
|
22285
22379
|
let P = new Set([n.id]);
|
|
22286
22380
|
_.forEach((n) => {
|
|
22287
|
-
n.height +=
|
|
22381
|
+
n.height += qF, P.add(n.id);
|
|
22288
22382
|
}), A.push({
|
|
22289
22383
|
triggerY: n.y + Z,
|
|
22290
|
-
delta:
|
|
22384
|
+
delta: qF,
|
|
22291
22385
|
ignoreIds: P
|
|
22292
22386
|
});
|
|
22293
22387
|
}
|
|
@@ -22335,9 +22429,9 @@ var camelToKebab = (n) => n.replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g, "$1-$2").toL
|
|
|
22335
22429
|
});
|
|
22336
22430
|
});
|
|
22337
22431
|
let j = {};
|
|
22338
|
-
n.styleBindings && Object.entries(n.styleBindings).forEach(([
|
|
22339
|
-
let
|
|
22340
|
-
|
|
22432
|
+
n.styleBindings && Object.entries(n.styleBindings).forEach(([E, O]) => {
|
|
22433
|
+
let M = _[O];
|
|
22434
|
+
M != null && (E === "boxShadowColor" ? j.boxShadow = applyShadowColor(A.boxShadow || n.style?.boxShadow, String(M)) : j[E] = String(M));
|
|
22341
22435
|
});
|
|
22342
22436
|
let M = {
|
|
22343
22437
|
width: n.width,
|
|
@@ -22405,9 +22499,9 @@ var camelToKebab = (n) => n.replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g, "$1-$2").toL
|
|
|
22405
22499
|
});
|
|
22406
22500
|
});
|
|
22407
22501
|
let j = {};
|
|
22408
|
-
n.styleBindings && Object.entries(n.styleBindings).forEach(([
|
|
22409
|
-
let
|
|
22410
|
-
|
|
22502
|
+
n.styleBindings && Object.entries(n.styleBindings).forEach(([E, O]) => {
|
|
22503
|
+
let M = _[O];
|
|
22504
|
+
M != null && (E === "boxShadowColor" ? j.boxShadow = applyShadowColor(A.boxShadow || n.style?.boxShadow, String(M)) : j[E] = String(M));
|
|
22411
22505
|
});
|
|
22412
22506
|
let M = {
|
|
22413
22507
|
position: "absolute",
|
|
@@ -22552,6 +22646,7 @@ var getRuntimeScript = (n, _) => `
|
|
|
22552
22646
|
const camelToKebab = ${camelToKebab.toString()};
|
|
22553
22647
|
const hex8ToRgba = ${hex8ToRgba.toString()};
|
|
22554
22648
|
const styleObjectToString = ${styleObjectToString.toString()};
|
|
22649
|
+
const applyShadowColor = ${applyShadowColor.toString()};
|
|
22555
22650
|
const measureTextHeight = ${measureTextHeight.toString()};
|
|
22556
22651
|
const checkCondition = ${checkCondition.toString()};
|
|
22557
22652
|
const formatValue = ${formatValue.toString()};
|