@powerhousedao/powerhouse-vetra-packages 6.2.3-dev.23 → 6.2.3-dev.25
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/browser/assets/{entry-4ObkElbc.js → entry-GDzXcBs1.js} +10 -6
- package/dist/browser/assets/{projection-entry-4FDMlGcp.js → projection-entry-BJpyPvov.js} +7 -13
- package/dist/browser/{documents-C-lAnv6o.js → documents-CRzouuNR.js} +45 -35
- package/dist/browser/{documents-C-lAnv6o.js.map → documents-CRzouuNR.js.map} +1 -1
- package/dist/browser/{editor-DNV-46lY.js → editor-CYdXmSpt.js} +2 -3
- package/dist/browser/{editor-DNV-46lY.js.map → editor-CYdXmSpt.js.map} +1 -1
- package/dist/browser/{editor-CQ4wUFK5.js → editor-Dk_HEgr2.js} +943 -66
- package/dist/browser/editor-Dk_HEgr2.js.map +1 -0
- package/dist/browser/editors/document-model-editor/module.js +1 -1
- package/dist/browser/editors/document-model-editor/module.js.map +1 -1
- package/dist/browser/editors/generic-drive-explorer/index.js +68 -57
- package/dist/browser/editors/generic-drive-explorer/index.js.map +1 -1
- package/dist/browser/editors/generic-drive-explorer/module.js +1 -1
- package/dist/browser/editors/generic-drive-explorer/module.js.map +1 -1
- package/dist/browser/{src-CVV6HzQZ-D-OQvEkh.js → folder-view-DjGlA0kT.js} +901 -1643
- package/dist/browser/folder-view-DjGlA0kT.js.map +1 -0
- package/dist/browser/{graphql-editor-DoXZvdNr.js → graphql-editor-C9Nc_cOY.js} +97 -85
- package/dist/browser/graphql-editor-C9Nc_cOY.js.map +1 -0
- package/dist/{node/hooks-Di3FASx-.mjs → browser/hooks-eQxBX7g4.js} +824 -444
- package/dist/browser/{hooks-Bh1JCohS.js.map → hooks-eQxBX7g4.js.map} +1 -1
- package/dist/browser/index.js +16 -14
- package/dist/browser/index.js.map +1 -1
- package/dist/browser/{json-editor-DBhkG5TF.js → json-editor-DfRD-pfk.js} +7 -7
- package/dist/browser/{json-editor-DBhkG5TF.js.map → json-editor-DfRD-pfk.js.map} +1 -1
- package/dist/browser/{parser-BBzK7bLd.js → parser-DtbeHA3H.js} +7 -6
- package/dist/browser/{parser-BBzK7bLd.js.map → parser-DtbeHA3H.js.map} +1 -1
- package/dist/browser/{chunk-BVTlhY3a.js → rolldown-runtime-DC62tzP2.js} +12 -3
- package/dist/browser/src-CrUksCLW-Co0PBoNN.js +5255 -0
- package/dist/browser/src-CrUksCLW-Co0PBoNN.js.map +1 -0
- package/dist/browser/{state-schemas-B47wHvDV.js → state-schemas-BSc_36Vd.js} +12 -10
- package/dist/browser/{state-schemas-B47wHvDV.js.map → state-schemas-BSc_36Vd.js.map} +1 -1
- package/dist/browser/{tslib.es6-CeIASJ2O.js → tslib.es6-Cno80yFJ.js} +1 -1
- package/dist/browser/{tslib.es6-CeIASJ2O.js.map → tslib.es6-Cno80yFJ.js.map} +1 -1
- package/dist/node/{documents-XAQfHX5Q.mjs → documents-D70S9PZL.mjs} +2 -2
- package/dist/node/documents-D70S9PZL.mjs.map +1 -0
- package/dist/node/{editor-Cp2TC5MJ.mjs → editor-BZZ0eN3p.mjs} +2 -3
- package/dist/node/{editor-Cp2TC5MJ.mjs.map → editor-BZZ0eN3p.mjs.map} +1 -1
- package/dist/node/{editor-BiiLqEe9.mjs → editor-CeSEXEgf.mjs} +866 -68
- package/dist/node/editor-CeSEXEgf.mjs.map +1 -0
- package/dist/node/editors/document-model-editor/module.mjs +1 -1
- package/dist/node/editors/document-model-editor/module.mjs.map +1 -1
- package/dist/node/editors/generic-drive-explorer/index.mjs +19 -13
- package/dist/node/editors/generic-drive-explorer/index.mjs.map +1 -1
- package/dist/node/editors/generic-drive-explorer/module.mjs +1 -1
- package/dist/node/editors/generic-drive-explorer/module.mjs.map +1 -1
- package/dist/node/{src-CVV6HzQZ-CvqjXbXk.mjs → folder-view-B2Jo-wsr.mjs} +891 -2311
- package/dist/node/{src-CVV6HzQZ-CvqjXbXk.mjs.map → folder-view-B2Jo-wsr.mjs.map} +1 -1
- package/dist/node/{graphql-BvV3tC1U.mjs → graphql-Dp4j7rmx.mjs} +50 -49
- package/dist/node/{graphql-BvV3tC1U.mjs.map → graphql-Dp4j7rmx.mjs.map} +1 -1
- package/dist/node/{graphql-editor-BhF6KN6y.mjs → graphql-editor-CBJXEY_C.mjs} +76 -61
- package/dist/node/graphql-editor-CBJXEY_C.mjs.map +1 -0
- package/dist/{browser/hooks-Bh1JCohS.js → node/hooks-C2b46djt.mjs} +824 -444
- package/dist/node/{hooks-Di3FASx-.mjs.map → hooks-C2b46djt.mjs.map} +1 -1
- package/dist/node/index.mjs +16 -15
- package/dist/node/index.mjs.map +1 -1
- package/dist/node/{json-editor-Cqc0zuz0.mjs → json-editor-DaqHARBD.mjs} +7 -7
- package/dist/node/{json-editor-Cqc0zuz0.mjs.map → json-editor-DaqHARBD.mjs.map} +1 -1
- package/dist/node/{schema-context-mHmP3Cl6.mjs → schema-context-CojjnSE6.mjs} +6 -5
- package/dist/node/schema-context-CojjnSE6.mjs.map +1 -0
- package/dist/node/src-CrUksCLW-BHpiSprT.mjs +5936 -0
- package/dist/node/src-CrUksCLW-BHpiSprT.mjs.map +1 -0
- package/dist/node/{state-schemas-DXG02fMh.mjs → state-schemas-CWuLjYFF.mjs} +13 -10
- package/dist/node/{state-schemas-DXG02fMh.mjs.map → state-schemas-CWuLjYFF.mjs.map} +1 -1
- package/dist/node/{tslib.es6-DdiHgz9e.mjs → tslib.es6-VORZjfk3.mjs} +45 -7
- package/dist/node/{tslib.es6-DdiHgz9e.mjs.map → tslib.es6-VORZjfk3.mjs.map} +1 -1
- package/package.json +11 -10
- package/dist/browser/button-sZQCXeCo.js +0 -803
- package/dist/browser/button-sZQCXeCo.js.map +0 -1
- package/dist/browser/dist-D3_ER0Dn.js +0 -2314
- package/dist/browser/dist-D3_ER0Dn.js.map +0 -1
- package/dist/browser/editor-CQ4wUFK5.js.map +0 -1
- package/dist/browser/folder-view-CzItU0hn.js +0 -957
- package/dist/browser/folder-view-CzItU0hn.js.map +0 -1
- package/dist/browser/graphql-editor-DoXZvdNr.js.map +0 -1
- package/dist/browser/schema-context-p2bhyog_.js +0 -69
- package/dist/browser/schema-context-p2bhyog_.js.map +0 -1
- package/dist/browser/src-CVV6HzQZ-D-OQvEkh.js.map +0 -1
- package/dist/node/button-5bnYEAVq.mjs +0 -785
- package/dist/node/button-5bnYEAVq.mjs.map +0 -1
- package/dist/node/chunk-17FXJ3dL.mjs +0 -31
- package/dist/node/dist-Bf_PIbO7.mjs +0 -2314
- package/dist/node/dist-Bf_PIbO7.mjs.map +0 -1
- package/dist/node/documents-XAQfHX5Q.mjs.map +0 -1
- package/dist/node/editor-BiiLqEe9.mjs.map +0 -1
- package/dist/node/folder-view-m_rH84Nz.mjs +0 -962
- package/dist/node/folder-view-m_rH84Nz.mjs.map +0 -1
- package/dist/node/graphql-editor-BhF6KN6y.mjs.map +0 -1
- package/dist/node/schema-context-mHmP3Cl6.mjs.map +0 -1
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import * as React$10 from "react";
|
|
5
|
-
import { Suspense, forwardRef, useEffect, useState } from "react";
|
|
1
|
+
import { h as twMerge, n as PowerhouseButton, r as useWindowSize } from "./src-CrUksCLW-BHpiSprT.mjs";
|
|
2
|
+
import * as React$1 from "react";
|
|
3
|
+
import React, { Suspense, useRef, useState } from "react";
|
|
6
4
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
7
|
-
import
|
|
8
|
-
|
|
5
|
+
import { flushSync } from "react-dom";
|
|
6
|
+
import { CreateDocumentWithTypeModal, FileItem, FolderItem } from "@powerhousedao/design-system/connect";
|
|
7
|
+
import { addDocument, isFileNodeKind, isFolderNodeKind, preloadEditorModule, setSelectedNode, useAllowedDocumentModelModules, useDisabledEditors, useEditorModules, useNodesInSelectedDriveOrFolder, useParentFolderForSelectedNode, useSelectedDriveSafe, useSelectedFolder, useStudioMode, useUserPermissions } from "@powerhousedao/reactor-browser";
|
|
8
|
+
//#region ../design-system/dist/Removed-OP4eTrAN.js
|
|
9
9
|
function Created(props) {
|
|
10
10
|
return /* @__PURE__ */ jsxs("svg", {
|
|
11
11
|
...props,
|
|
@@ -169,7 +169,7 @@ function Removed(props) {
|
|
|
169
169
|
});
|
|
170
170
|
}
|
|
171
171
|
//#endregion
|
|
172
|
-
//#region ../design-system/dist/Tabler-
|
|
172
|
+
//#region ../design-system/dist/Tabler-rjLxlzUV.js
|
|
173
173
|
function CrossCircle(props) {
|
|
174
174
|
return /* @__PURE__ */ jsxs("svg", {
|
|
175
175
|
...props,
|
|
@@ -226,7 +226,7 @@ function Tabler(props) {
|
|
|
226
226
|
});
|
|
227
227
|
}
|
|
228
228
|
//#endregion
|
|
229
|
-
//#region ../design-system/dist/icon-
|
|
229
|
+
//#region ../design-system/dist/icon-01W_S_9A.js
|
|
230
230
|
function AnalyticsProcessorModule(props) {
|
|
231
231
|
return /* @__PURE__ */ jsxs("svg", {
|
|
232
232
|
...props,
|
|
@@ -3449,2381 +3449,961 @@ function Icon({ name, size = 24, color, style, ...props }) {
|
|
|
3449
3449
|
});
|
|
3450
3450
|
}
|
|
3451
3451
|
//#endregion
|
|
3452
|
-
//#region
|
|
3453
|
-
|
|
3454
|
-
|
|
3455
|
-
|
|
3456
|
-
|
|
3457
|
-
|
|
3458
|
-
|
|
3459
|
-
|
|
3460
|
-
|
|
3461
|
-
|
|
3452
|
+
//#region editors/generic-drive-explorer/utils/select-creatable-modules.ts
|
|
3453
|
+
/**
|
|
3454
|
+
* The modules a user may pick from when creating a new document. Outside
|
|
3455
|
+
* studio mode only the latest version of each document type is offered: new
|
|
3456
|
+
* documents should never start on an outdated schema. Builders testing
|
|
3457
|
+
* migrations run in studio mode and still get every version.
|
|
3458
|
+
*/
|
|
3459
|
+
function selectCreatableModules(modules, studioMode) {
|
|
3460
|
+
if (studioMode) return [...modules];
|
|
3461
|
+
const latestByType = /* @__PURE__ */ new Map();
|
|
3462
|
+
for (const module of modules) {
|
|
3463
|
+
const id = module.documentModel.global.id;
|
|
3464
|
+
const current = latestByType.get(id);
|
|
3465
|
+
if (!current || (module.version ?? 1) > (current.version ?? 1)) latestByType.set(id, module);
|
|
3466
|
+
}
|
|
3467
|
+
return [...latestByType.values()];
|
|
3462
3468
|
}
|
|
3463
3469
|
//#endregion
|
|
3464
|
-
//#region
|
|
3465
|
-
|
|
3466
|
-
|
|
3467
|
-
var POINTER_DOWN_OUTSIDE = "dismissableLayer.pointerDownOutside";
|
|
3468
|
-
var FOCUS_OUTSIDE = "dismissableLayer.focusOutside";
|
|
3469
|
-
var originalBodyPointerEvents;
|
|
3470
|
-
var DismissableLayerContext = React$10.createContext({
|
|
3471
|
-
layers: /* @__PURE__ */ new Set(),
|
|
3472
|
-
layersWithOutsidePointerEventsDisabled: /* @__PURE__ */ new Set(),
|
|
3473
|
-
branches: /* @__PURE__ */ new Set()
|
|
3474
|
-
});
|
|
3475
|
-
var DismissableLayer = React$10.forwardRef((props, forwardedRef) => {
|
|
3476
|
-
const { disableOutsidePointerEvents = false, onEscapeKeyDown, onPointerDownOutside, onFocusOutside, onInteractOutside, onDismiss, ...layerProps } = props;
|
|
3477
|
-
const context = React$10.useContext(DismissableLayerContext);
|
|
3478
|
-
const [node, setNode] = React$10.useState(null);
|
|
3479
|
-
const ownerDocument = node?.ownerDocument ?? globalThis?.document;
|
|
3480
|
-
const [, force] = React$10.useState({});
|
|
3481
|
-
const composedRefs = useComposedRefs(forwardedRef, (node2) => setNode(node2));
|
|
3482
|
-
const layers = Array.from(context.layers);
|
|
3483
|
-
const [highestLayerWithOutsidePointerEventsDisabled] = [...context.layersWithOutsidePointerEventsDisabled].slice(-1);
|
|
3484
|
-
const highestLayerWithOutsidePointerEventsDisabledIndex = layers.indexOf(highestLayerWithOutsidePointerEventsDisabled);
|
|
3485
|
-
const index = node ? layers.indexOf(node) : -1;
|
|
3486
|
-
const isBodyPointerEventsDisabled = context.layersWithOutsidePointerEventsDisabled.size > 0;
|
|
3487
|
-
const isPointerEventsEnabled = index >= highestLayerWithOutsidePointerEventsDisabledIndex;
|
|
3488
|
-
const pointerDownOutside = usePointerDownOutside((event) => {
|
|
3489
|
-
const target = event.target;
|
|
3490
|
-
const isPointerDownOnBranch = [...context.branches].some((branch) => branch.contains(target));
|
|
3491
|
-
if (!isPointerEventsEnabled || isPointerDownOnBranch) return;
|
|
3492
|
-
onPointerDownOutside?.(event);
|
|
3493
|
-
onInteractOutside?.(event);
|
|
3494
|
-
if (!event.defaultPrevented) onDismiss?.();
|
|
3495
|
-
}, ownerDocument);
|
|
3496
|
-
const focusOutside = useFocusOutside((event) => {
|
|
3497
|
-
const target = event.target;
|
|
3498
|
-
if ([...context.branches].some((branch) => branch.contains(target))) return;
|
|
3499
|
-
onFocusOutside?.(event);
|
|
3500
|
-
onInteractOutside?.(event);
|
|
3501
|
-
if (!event.defaultPrevented) onDismiss?.();
|
|
3502
|
-
}, ownerDocument);
|
|
3503
|
-
useEscapeKeydown((event) => {
|
|
3504
|
-
if (!(index === context.layers.size - 1)) return;
|
|
3505
|
-
onEscapeKeyDown?.(event);
|
|
3506
|
-
if (!event.defaultPrevented && onDismiss) {
|
|
3507
|
-
event.preventDefault();
|
|
3508
|
-
onDismiss();
|
|
3509
|
-
}
|
|
3510
|
-
}, ownerDocument);
|
|
3511
|
-
React$10.useEffect(() => {
|
|
3512
|
-
if (!node) return;
|
|
3513
|
-
if (disableOutsidePointerEvents) {
|
|
3514
|
-
if (context.layersWithOutsidePointerEventsDisabled.size === 0) {
|
|
3515
|
-
originalBodyPointerEvents = ownerDocument.body.style.pointerEvents;
|
|
3516
|
-
ownerDocument.body.style.pointerEvents = "none";
|
|
3517
|
-
}
|
|
3518
|
-
context.layersWithOutsidePointerEventsDisabled.add(node);
|
|
3519
|
-
}
|
|
3520
|
-
context.layers.add(node);
|
|
3521
|
-
dispatchUpdate();
|
|
3522
|
-
return () => {
|
|
3523
|
-
if (disableOutsidePointerEvents && context.layersWithOutsidePointerEventsDisabled.size === 1) ownerDocument.body.style.pointerEvents = originalBodyPointerEvents;
|
|
3524
|
-
};
|
|
3525
|
-
}, [
|
|
3526
|
-
node,
|
|
3527
|
-
ownerDocument,
|
|
3528
|
-
disableOutsidePointerEvents,
|
|
3529
|
-
context
|
|
3530
|
-
]);
|
|
3531
|
-
React$10.useEffect(() => {
|
|
3532
|
-
return () => {
|
|
3533
|
-
if (!node) return;
|
|
3534
|
-
context.layers.delete(node);
|
|
3535
|
-
context.layersWithOutsidePointerEventsDisabled.delete(node);
|
|
3536
|
-
dispatchUpdate();
|
|
3537
|
-
};
|
|
3538
|
-
}, [node, context]);
|
|
3539
|
-
React$10.useEffect(() => {
|
|
3540
|
-
const handleUpdate = () => force({});
|
|
3541
|
-
document.addEventListener(CONTEXT_UPDATE, handleUpdate);
|
|
3542
|
-
return () => document.removeEventListener(CONTEXT_UPDATE, handleUpdate);
|
|
3543
|
-
}, []);
|
|
3544
|
-
return /* @__PURE__ */ jsx(Primitive$1.div, {
|
|
3545
|
-
...layerProps,
|
|
3546
|
-
ref: composedRefs,
|
|
3547
|
-
style: {
|
|
3548
|
-
pointerEvents: isBodyPointerEventsDisabled ? isPointerEventsEnabled ? "auto" : "none" : void 0,
|
|
3549
|
-
...props.style
|
|
3550
|
-
},
|
|
3551
|
-
onFocusCapture: composeEventHandlers(props.onFocusCapture, focusOutside.onFocusCapture),
|
|
3552
|
-
onBlurCapture: composeEventHandlers(props.onBlurCapture, focusOutside.onBlurCapture),
|
|
3553
|
-
onPointerDownCapture: composeEventHandlers(props.onPointerDownCapture, pointerDownOutside.onPointerDownCapture)
|
|
3554
|
-
});
|
|
3555
|
-
});
|
|
3556
|
-
DismissableLayer.displayName = DISMISSABLE_LAYER_NAME;
|
|
3557
|
-
var BRANCH_NAME = "DismissableLayerBranch";
|
|
3558
|
-
var DismissableLayerBranch = React$10.forwardRef((props, forwardedRef) => {
|
|
3559
|
-
const context = React$10.useContext(DismissableLayerContext);
|
|
3560
|
-
const ref = React$10.useRef(null);
|
|
3561
|
-
const composedRefs = useComposedRefs(forwardedRef, ref);
|
|
3562
|
-
React$10.useEffect(() => {
|
|
3563
|
-
const node = ref.current;
|
|
3564
|
-
if (node) {
|
|
3565
|
-
context.branches.add(node);
|
|
3566
|
-
return () => {
|
|
3567
|
-
context.branches.delete(node);
|
|
3568
|
-
};
|
|
3569
|
-
}
|
|
3570
|
-
}, [context.branches]);
|
|
3571
|
-
return /* @__PURE__ */ jsx(Primitive$1.div, {
|
|
3572
|
-
...props,
|
|
3573
|
-
ref: composedRefs
|
|
3574
|
-
});
|
|
3575
|
-
});
|
|
3576
|
-
DismissableLayerBranch.displayName = BRANCH_NAME;
|
|
3577
|
-
function usePointerDownOutside(onPointerDownOutside, ownerDocument = globalThis?.document) {
|
|
3578
|
-
const handlePointerDownOutside = useCallbackRef(onPointerDownOutside);
|
|
3579
|
-
const isPointerInsideReactTreeRef = React$10.useRef(false);
|
|
3580
|
-
const handleClickRef = React$10.useRef(() => {});
|
|
3581
|
-
React$10.useEffect(() => {
|
|
3582
|
-
const handlePointerDown = (event) => {
|
|
3583
|
-
if (event.target && !isPointerInsideReactTreeRef.current) {
|
|
3584
|
-
let handleAndDispatchPointerDownOutsideEvent2 = function() {
|
|
3585
|
-
handleAndDispatchCustomEvent(POINTER_DOWN_OUTSIDE, handlePointerDownOutside, eventDetail, { discrete: true });
|
|
3586
|
-
};
|
|
3587
|
-
const eventDetail = { originalEvent: event };
|
|
3588
|
-
if (event.pointerType === "touch") {
|
|
3589
|
-
ownerDocument.removeEventListener("click", handleClickRef.current);
|
|
3590
|
-
handleClickRef.current = handleAndDispatchPointerDownOutsideEvent2;
|
|
3591
|
-
ownerDocument.addEventListener("click", handleClickRef.current, { once: true });
|
|
3592
|
-
} else handleAndDispatchPointerDownOutsideEvent2();
|
|
3593
|
-
} else ownerDocument.removeEventListener("click", handleClickRef.current);
|
|
3594
|
-
isPointerInsideReactTreeRef.current = false;
|
|
3595
|
-
};
|
|
3596
|
-
const timerId = window.setTimeout(() => {
|
|
3597
|
-
ownerDocument.addEventListener("pointerdown", handlePointerDown);
|
|
3598
|
-
}, 0);
|
|
3599
|
-
return () => {
|
|
3600
|
-
window.clearTimeout(timerId);
|
|
3601
|
-
ownerDocument.removeEventListener("pointerdown", handlePointerDown);
|
|
3602
|
-
ownerDocument.removeEventListener("click", handleClickRef.current);
|
|
3603
|
-
};
|
|
3604
|
-
}, [ownerDocument, handlePointerDownOutside]);
|
|
3605
|
-
return { onPointerDownCapture: () => isPointerInsideReactTreeRef.current = true };
|
|
3606
|
-
}
|
|
3607
|
-
function useFocusOutside(onFocusOutside, ownerDocument = globalThis?.document) {
|
|
3608
|
-
const handleFocusOutside = useCallbackRef(onFocusOutside);
|
|
3609
|
-
const isFocusInsideReactTreeRef = React$10.useRef(false);
|
|
3610
|
-
React$10.useEffect(() => {
|
|
3611
|
-
const handleFocus = (event) => {
|
|
3612
|
-
if (event.target && !isFocusInsideReactTreeRef.current) handleAndDispatchCustomEvent(FOCUS_OUTSIDE, handleFocusOutside, { originalEvent: event }, { discrete: false });
|
|
3613
|
-
};
|
|
3614
|
-
ownerDocument.addEventListener("focusin", handleFocus);
|
|
3615
|
-
return () => ownerDocument.removeEventListener("focusin", handleFocus);
|
|
3616
|
-
}, [ownerDocument, handleFocusOutside]);
|
|
3470
|
+
//#region editors/generic-drive-explorer/components/create-document.tsx
|
|
3471
|
+
function toDocumentTypeOption(doc, studioMode) {
|
|
3472
|
+
const spec = doc.documentModel.global;
|
|
3617
3473
|
return {
|
|
3618
|
-
|
|
3619
|
-
|
|
3474
|
+
documentType: spec.id,
|
|
3475
|
+
name: spec.name,
|
|
3476
|
+
version: studioMode ? doc.version : void 0,
|
|
3477
|
+
description: spec.description
|
|
3620
3478
|
};
|
|
3621
3479
|
}
|
|
3622
|
-
function
|
|
3623
|
-
const
|
|
3624
|
-
|
|
3625
|
-
|
|
3626
|
-
|
|
3627
|
-
const
|
|
3628
|
-
const
|
|
3629
|
-
|
|
3630
|
-
|
|
3631
|
-
|
|
3632
|
-
|
|
3633
|
-
|
|
3634
|
-
|
|
3635
|
-
|
|
3636
|
-
}
|
|
3637
|
-
|
|
3638
|
-
|
|
3639
|
-
|
|
3640
|
-
|
|
3641
|
-
|
|
3642
|
-
|
|
3643
|
-
|
|
3644
|
-
|
|
3645
|
-
|
|
3646
|
-
|
|
3647
|
-
|
|
3648
|
-
|
|
3649
|
-
|
|
3650
|
-
|
|
3651
|
-
|
|
3652
|
-
|
|
3653
|
-
|
|
3654
|
-
|
|
3655
|
-
|
|
3656
|
-
|
|
3657
|
-
|
|
3658
|
-
|
|
3659
|
-
|
|
3660
|
-
|
|
3480
|
+
function CreateDocument() {
|
|
3481
|
+
const [showModal, setShowModal] = useState(false);
|
|
3482
|
+
const { isAllowedToCreateDocuments } = useUserPermissions();
|
|
3483
|
+
const allowedDocumentModelModules = useAllowedDocumentModelModules();
|
|
3484
|
+
const editorModules = useEditorModules();
|
|
3485
|
+
const disabledEditors = useDisabledEditors() ?? [];
|
|
3486
|
+
const [selectedDrive] = useSelectedDriveSafe();
|
|
3487
|
+
const selectedFolder = useSelectedFolder();
|
|
3488
|
+
const parentFolder = useParentFolderForSelectedNode();
|
|
3489
|
+
const DRIVE_CONTAINER_TYPES = ["powerhouse/document-drive", "powerhouse/reactor-drive"];
|
|
3490
|
+
const studioMode = useStudioMode() ?? false;
|
|
3491
|
+
const visibleDocumentModelModules = selectCreatableModules(allowedDocumentModelModules ?? [], studioMode).filter((module) => {
|
|
3492
|
+
const id = module.documentModel.global.id;
|
|
3493
|
+
return !DRIVE_CONTAINER_TYPES.includes(id) && !disabledEditors.includes(id);
|
|
3494
|
+
});
|
|
3495
|
+
const preloadEditorsForType = (documentType) => editorModules?.filter((editorModule) => editorModule.documentTypes.includes(documentType)).forEach((editorModule) => {
|
|
3496
|
+
preloadEditorModule(editorModule);
|
|
3497
|
+
});
|
|
3498
|
+
const handleCreate = async ({ name, documentType, version }) => {
|
|
3499
|
+
setShowModal(false);
|
|
3500
|
+
if (!selectedDrive) return;
|
|
3501
|
+
try {
|
|
3502
|
+
const node = await addDocument(selectedDrive.header.id, name, documentType, selectedFolder?.id ?? parentFolder?.id, void 0, void 0, void 0, version);
|
|
3503
|
+
setSelectedNode(node);
|
|
3504
|
+
} catch (error) {
|
|
3505
|
+
console.error("Failed to create document:", error);
|
|
3506
|
+
}
|
|
3507
|
+
};
|
|
3508
|
+
if (!isAllowedToCreateDocuments) return null;
|
|
3509
|
+
if (!visibleDocumentModelModules.length) return null;
|
|
3510
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(PowerhouseButton, {
|
|
3511
|
+
className: "py-2",
|
|
3512
|
+
color: "blue",
|
|
3513
|
+
icon: /* @__PURE__ */ jsx(Icon, {
|
|
3514
|
+
name: "Plus",
|
|
3515
|
+
size: 14
|
|
3516
|
+
}),
|
|
3517
|
+
onClick: () => setShowModal(true),
|
|
3518
|
+
size: "small",
|
|
3519
|
+
children: "Create New Document"
|
|
3520
|
+
}), /* @__PURE__ */ jsx(CreateDocumentWithTypeModal, {
|
|
3521
|
+
documentTypes: visibleDocumentModelModules.map((module) => toDocumentTypeOption(module, studioMode)),
|
|
3522
|
+
onCreate: (input) => void handleCreate(input),
|
|
3523
|
+
onOpenChange: setShowModal,
|
|
3524
|
+
onTypeSelected: preloadEditorsForType,
|
|
3525
|
+
open: showModal
|
|
3526
|
+
})] });
|
|
3661
3527
|
}
|
|
3662
3528
|
//#endregion
|
|
3663
|
-
//#region ../../node_modules/.pnpm/@
|
|
3664
|
-
|
|
3665
|
-
|
|
3666
|
-
|
|
3667
|
-
|
|
3668
|
-
|
|
3669
|
-
|
|
3670
|
-
|
|
3671
|
-
|
|
3672
|
-
|
|
3673
|
-
|
|
3674
|
-
|
|
3675
|
-
|
|
3676
|
-
|
|
3677
|
-
|
|
3678
|
-
|
|
3679
|
-
|
|
3680
|
-
|
|
3681
|
-
|
|
3682
|
-
|
|
3683
|
-
|
|
3684
|
-
|
|
3685
|
-
|
|
3686
|
-
}).current;
|
|
3687
|
-
React$10.useEffect(() => {
|
|
3688
|
-
if (trapped) {
|
|
3689
|
-
let handleFocusIn2 = function(event) {
|
|
3690
|
-
if (focusScope.paused || !container) return;
|
|
3691
|
-
const target = event.target;
|
|
3692
|
-
if (container.contains(target)) lastFocusedElementRef.current = target;
|
|
3693
|
-
else focus(lastFocusedElementRef.current, { select: true });
|
|
3694
|
-
}, handleFocusOut2 = function(event) {
|
|
3695
|
-
if (focusScope.paused || !container) return;
|
|
3696
|
-
const relatedTarget = event.relatedTarget;
|
|
3697
|
-
if (relatedTarget === null) return;
|
|
3698
|
-
if (!container.contains(relatedTarget)) focus(lastFocusedElementRef.current, { select: true });
|
|
3699
|
-
}, handleMutations2 = function(mutations) {
|
|
3700
|
-
if (document.activeElement !== document.body) return;
|
|
3701
|
-
for (const mutation of mutations) if (mutation.removedNodes.length > 0) focus(container);
|
|
3702
|
-
};
|
|
3703
|
-
document.addEventListener("focusin", handleFocusIn2);
|
|
3704
|
-
document.addEventListener("focusout", handleFocusOut2);
|
|
3705
|
-
const mutationObserver = new MutationObserver(handleMutations2);
|
|
3706
|
-
if (container) mutationObserver.observe(container, {
|
|
3707
|
-
childList: true,
|
|
3708
|
-
subtree: true
|
|
3709
|
-
});
|
|
3710
|
-
return () => {
|
|
3711
|
-
document.removeEventListener("focusin", handleFocusIn2);
|
|
3712
|
-
document.removeEventListener("focusout", handleFocusOut2);
|
|
3713
|
-
mutationObserver.disconnect();
|
|
3714
|
-
};
|
|
3715
|
-
}
|
|
3716
|
-
}, [
|
|
3717
|
-
trapped,
|
|
3718
|
-
container,
|
|
3719
|
-
focusScope.paused
|
|
3720
|
-
]);
|
|
3721
|
-
React$10.useEffect(() => {
|
|
3722
|
-
if (container) {
|
|
3723
|
-
focusScopesStack.add(focusScope);
|
|
3724
|
-
const previouslyFocusedElement = document.activeElement;
|
|
3725
|
-
if (!container.contains(previouslyFocusedElement)) {
|
|
3726
|
-
const mountEvent = new CustomEvent(AUTOFOCUS_ON_MOUNT, EVENT_OPTIONS);
|
|
3727
|
-
container.addEventListener(AUTOFOCUS_ON_MOUNT, onMountAutoFocus);
|
|
3728
|
-
container.dispatchEvent(mountEvent);
|
|
3729
|
-
if (!mountEvent.defaultPrevented) {
|
|
3730
|
-
focusFirst(removeLinks(getTabbableCandidates(container)), { select: true });
|
|
3731
|
-
if (document.activeElement === previouslyFocusedElement) focus(container);
|
|
3732
|
-
}
|
|
3733
|
-
}
|
|
3734
|
-
return () => {
|
|
3735
|
-
container.removeEventListener(AUTOFOCUS_ON_MOUNT, onMountAutoFocus);
|
|
3736
|
-
setTimeout(() => {
|
|
3737
|
-
const unmountEvent = new CustomEvent(AUTOFOCUS_ON_UNMOUNT, EVENT_OPTIONS);
|
|
3738
|
-
container.addEventListener(AUTOFOCUS_ON_UNMOUNT, onUnmountAutoFocus);
|
|
3739
|
-
container.dispatchEvent(unmountEvent);
|
|
3740
|
-
if (!unmountEvent.defaultPrevented) focus(previouslyFocusedElement ?? document.body, { select: true });
|
|
3741
|
-
container.removeEventListener(AUTOFOCUS_ON_UNMOUNT, onUnmountAutoFocus);
|
|
3742
|
-
focusScopesStack.remove(focusScope);
|
|
3743
|
-
}, 0);
|
|
3529
|
+
//#region ../../node_modules/.pnpm/@tanstack+virtual-core@3.13.19/node_modules/@tanstack/virtual-core/dist/esm/utils.js
|
|
3530
|
+
function memo$1(getDeps, fn, opts) {
|
|
3531
|
+
let deps = opts.initialDeps ?? [];
|
|
3532
|
+
let result;
|
|
3533
|
+
let isInitial = true;
|
|
3534
|
+
function memoizedFunction() {
|
|
3535
|
+
var _a, _b, _c;
|
|
3536
|
+
let depTime;
|
|
3537
|
+
if (opts.key && ((_a = opts.debug) == null ? void 0 : _a.call(opts))) depTime = Date.now();
|
|
3538
|
+
const newDeps = getDeps();
|
|
3539
|
+
if (!(newDeps.length !== deps.length || newDeps.some((dep, index) => deps[index] !== dep))) return result;
|
|
3540
|
+
deps = newDeps;
|
|
3541
|
+
let resultTime;
|
|
3542
|
+
if (opts.key && ((_b = opts.debug) == null ? void 0 : _b.call(opts))) resultTime = Date.now();
|
|
3543
|
+
result = fn(...newDeps);
|
|
3544
|
+
if (opts.key && ((_c = opts.debug) == null ? void 0 : _c.call(opts))) {
|
|
3545
|
+
const depEndTime = Math.round((Date.now() - depTime) * 100) / 100;
|
|
3546
|
+
const resultEndTime = Math.round((Date.now() - resultTime) * 100) / 100;
|
|
3547
|
+
const resultFpsPercentage = resultEndTime / 16;
|
|
3548
|
+
const pad = (str, num) => {
|
|
3549
|
+
str = String(str);
|
|
3550
|
+
while (str.length < num) str = " " + str;
|
|
3551
|
+
return str;
|
|
3744
3552
|
};
|
|
3553
|
+
console.info(`%c⏱ ${pad(resultEndTime, 5)} /${pad(depEndTime, 5)} ms`, `
|
|
3554
|
+
font-size: .6rem;
|
|
3555
|
+
font-weight: bold;
|
|
3556
|
+
color: hsl(${Math.max(0, Math.min(120 - 120 * resultFpsPercentage, 120))}deg 100% 31%);`, opts == null ? void 0 : opts.key);
|
|
3745
3557
|
}
|
|
3746
|
-
|
|
3747
|
-
|
|
3748
|
-
|
|
3749
|
-
onUnmountAutoFocus,
|
|
3750
|
-
focusScope
|
|
3751
|
-
]);
|
|
3752
|
-
const handleKeyDown = React$10.useCallback((event) => {
|
|
3753
|
-
if (!loop && !trapped) return;
|
|
3754
|
-
if (focusScope.paused) return;
|
|
3755
|
-
const isTabKey = event.key === "Tab" && !event.altKey && !event.ctrlKey && !event.metaKey;
|
|
3756
|
-
const focusedElement = document.activeElement;
|
|
3757
|
-
if (isTabKey && focusedElement) {
|
|
3758
|
-
const container2 = event.currentTarget;
|
|
3759
|
-
const [first, last] = getTabbableEdges(container2);
|
|
3760
|
-
if (!(first && last)) {
|
|
3761
|
-
if (focusedElement === container2) event.preventDefault();
|
|
3762
|
-
} else if (!event.shiftKey && focusedElement === last) {
|
|
3763
|
-
event.preventDefault();
|
|
3764
|
-
if (loop) focus(first, { select: true });
|
|
3765
|
-
} else if (event.shiftKey && focusedElement === first) {
|
|
3766
|
-
event.preventDefault();
|
|
3767
|
-
if (loop) focus(last, { select: true });
|
|
3768
|
-
}
|
|
3769
|
-
}
|
|
3770
|
-
}, [
|
|
3771
|
-
loop,
|
|
3772
|
-
trapped,
|
|
3773
|
-
focusScope.paused
|
|
3774
|
-
]);
|
|
3775
|
-
return /* @__PURE__ */ jsx(Primitive$1.div, {
|
|
3776
|
-
tabIndex: -1,
|
|
3777
|
-
...scopeProps,
|
|
3778
|
-
ref: composedRefs,
|
|
3779
|
-
onKeyDown: handleKeyDown
|
|
3780
|
-
});
|
|
3781
|
-
});
|
|
3782
|
-
FocusScope.displayName = FOCUS_SCOPE_NAME;
|
|
3783
|
-
function focusFirst(candidates, { select = false } = {}) {
|
|
3784
|
-
const previouslyFocusedElement = document.activeElement;
|
|
3785
|
-
for (const candidate of candidates) {
|
|
3786
|
-
focus(candidate, { select });
|
|
3787
|
-
if (document.activeElement !== previouslyFocusedElement) return;
|
|
3788
|
-
}
|
|
3789
|
-
}
|
|
3790
|
-
function getTabbableEdges(container) {
|
|
3791
|
-
const candidates = getTabbableCandidates(container);
|
|
3792
|
-
return [findVisible(candidates, container), findVisible(candidates.reverse(), container)];
|
|
3793
|
-
}
|
|
3794
|
-
function getTabbableCandidates(container) {
|
|
3795
|
-
const nodes = [];
|
|
3796
|
-
const walker = document.createTreeWalker(container, NodeFilter.SHOW_ELEMENT, { acceptNode: (node) => {
|
|
3797
|
-
const isHiddenInput = node.tagName === "INPUT" && node.type === "hidden";
|
|
3798
|
-
if (node.disabled || node.hidden || isHiddenInput) return NodeFilter.FILTER_SKIP;
|
|
3799
|
-
return node.tabIndex >= 0 ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP;
|
|
3800
|
-
} });
|
|
3801
|
-
while (walker.nextNode()) nodes.push(walker.currentNode);
|
|
3802
|
-
return nodes;
|
|
3803
|
-
}
|
|
3804
|
-
function findVisible(elements, container) {
|
|
3805
|
-
for (const element of elements) if (!isHidden(element, { upTo: container })) return element;
|
|
3806
|
-
}
|
|
3807
|
-
function isHidden(node, { upTo }) {
|
|
3808
|
-
if (getComputedStyle(node).visibility === "hidden") return true;
|
|
3809
|
-
while (node) {
|
|
3810
|
-
if (upTo !== void 0 && node === upTo) return false;
|
|
3811
|
-
if (getComputedStyle(node).display === "none") return true;
|
|
3812
|
-
node = node.parentElement;
|
|
3813
|
-
}
|
|
3814
|
-
return false;
|
|
3815
|
-
}
|
|
3816
|
-
function isSelectableInput(element) {
|
|
3817
|
-
return element instanceof HTMLInputElement && "select" in element;
|
|
3818
|
-
}
|
|
3819
|
-
function focus(element, { select = false } = {}) {
|
|
3820
|
-
if (element && element.focus) {
|
|
3821
|
-
const previouslyFocusedElement = document.activeElement;
|
|
3822
|
-
element.focus({ preventScroll: true });
|
|
3823
|
-
if (element !== previouslyFocusedElement && isSelectableInput(element) && select) element.select();
|
|
3558
|
+
if ((opts == null ? void 0 : opts.onChange) && !(isInitial && opts.skipInitialOnChange)) opts.onChange(result);
|
|
3559
|
+
isInitial = false;
|
|
3560
|
+
return result;
|
|
3824
3561
|
}
|
|
3825
|
-
|
|
3826
|
-
|
|
3827
|
-
function createFocusScopesStack() {
|
|
3828
|
-
let stack = [];
|
|
3829
|
-
return {
|
|
3830
|
-
add(focusScope) {
|
|
3831
|
-
const activeFocusScope = stack[0];
|
|
3832
|
-
if (focusScope !== activeFocusScope) activeFocusScope?.pause();
|
|
3833
|
-
stack = arrayRemove(stack, focusScope);
|
|
3834
|
-
stack.unshift(focusScope);
|
|
3835
|
-
},
|
|
3836
|
-
remove(focusScope) {
|
|
3837
|
-
stack = arrayRemove(stack, focusScope);
|
|
3838
|
-
stack[0]?.resume();
|
|
3839
|
-
}
|
|
3562
|
+
memoizedFunction.updateDeps = (newDeps) => {
|
|
3563
|
+
deps = newDeps;
|
|
3840
3564
|
};
|
|
3841
|
-
|
|
3842
|
-
|
|
3843
|
-
|
|
3844
|
-
|
|
3845
|
-
|
|
3846
|
-
|
|
3847
|
-
|
|
3848
|
-
|
|
3849
|
-
|
|
3850
|
-
|
|
3851
|
-
|
|
3852
|
-
|
|
3853
|
-
var PORTAL_NAME$1 = "Portal";
|
|
3854
|
-
var Portal$1 = React$10.forwardRef((props, forwardedRef) => {
|
|
3855
|
-
const { container: containerProp, ...portalProps } = props;
|
|
3856
|
-
const [mounted, setMounted] = React$10.useState(false);
|
|
3857
|
-
useLayoutEffect2(() => setMounted(true), []);
|
|
3858
|
-
const container = containerProp || mounted && globalThis?.document?.body;
|
|
3859
|
-
return container ? ReactDOM.createPortal(/* @__PURE__ */ jsx(Primitive$1.div, {
|
|
3860
|
-
...portalProps,
|
|
3861
|
-
ref: forwardedRef
|
|
3862
|
-
}), container) : null;
|
|
3863
|
-
});
|
|
3864
|
-
Portal$1.displayName = PORTAL_NAME$1;
|
|
3865
|
-
//#endregion
|
|
3866
|
-
//#region ../../node_modules/.pnpm/aria-hidden@1.2.6/node_modules/aria-hidden/dist/es5/index.js
|
|
3867
|
-
var require_es5$6 = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
3868
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3869
|
-
exports.suppressOthers = exports.supportsInert = exports.inertOthers = exports.hideOthers = void 0;
|
|
3870
|
-
var getDefaultParent = function(originalTarget) {
|
|
3871
|
-
if (typeof document === "undefined") return null;
|
|
3872
|
-
return (Array.isArray(originalTarget) ? originalTarget[0] : originalTarget).ownerDocument.body;
|
|
3565
|
+
return memoizedFunction;
|
|
3566
|
+
}
|
|
3567
|
+
function notUndefined(value, msg) {
|
|
3568
|
+
if (value === void 0) throw new Error(`Unexpected undefined${msg ? `: ${msg}` : ""}`);
|
|
3569
|
+
else return value;
|
|
3570
|
+
}
|
|
3571
|
+
const approxEqual = (a, b) => Math.abs(a - b) < 1.01;
|
|
3572
|
+
const debounce = (targetWindow, fn, ms) => {
|
|
3573
|
+
let timeoutId;
|
|
3574
|
+
return function(...args) {
|
|
3575
|
+
targetWindow.clearTimeout(timeoutId);
|
|
3576
|
+
timeoutId = targetWindow.setTimeout(() => fn.apply(this, args), ms);
|
|
3873
3577
|
};
|
|
3874
|
-
|
|
3875
|
-
|
|
3876
|
-
|
|
3877
|
-
|
|
3878
|
-
|
|
3879
|
-
|
|
3578
|
+
};
|
|
3579
|
+
//#endregion
|
|
3580
|
+
//#region ../../node_modules/.pnpm/@tanstack+virtual-core@3.13.19/node_modules/@tanstack/virtual-core/dist/esm/index.js
|
|
3581
|
+
const getRect = (element) => {
|
|
3582
|
+
const { offsetWidth, offsetHeight } = element;
|
|
3583
|
+
return {
|
|
3584
|
+
width: offsetWidth,
|
|
3585
|
+
height: offsetHeight
|
|
3880
3586
|
};
|
|
3881
|
-
|
|
3882
|
-
|
|
3883
|
-
|
|
3884
|
-
|
|
3885
|
-
|
|
3886
|
-
|
|
3887
|
-
|
|
3888
|
-
|
|
3889
|
-
|
|
3587
|
+
};
|
|
3588
|
+
const defaultKeyExtractor = (index) => index;
|
|
3589
|
+
const defaultRangeExtractor = (range) => {
|
|
3590
|
+
const start = Math.max(range.startIndex - range.overscan, 0);
|
|
3591
|
+
const end = Math.min(range.endIndex + range.overscan, range.count - 1);
|
|
3592
|
+
const arr = [];
|
|
3593
|
+
for (let i = start; i <= end; i++) arr.push(i);
|
|
3594
|
+
return arr;
|
|
3595
|
+
};
|
|
3596
|
+
const observeElementRect = (instance, cb) => {
|
|
3597
|
+
const element = instance.scrollElement;
|
|
3598
|
+
if (!element) return;
|
|
3599
|
+
const targetWindow = instance.targetWindow;
|
|
3600
|
+
if (!targetWindow) return;
|
|
3601
|
+
const handler = (rect) => {
|
|
3602
|
+
const { width, height } = rect;
|
|
3603
|
+
cb({
|
|
3604
|
+
width: Math.round(width),
|
|
3605
|
+
height: Math.round(height)
|
|
3890
3606
|
});
|
|
3891
3607
|
};
|
|
3892
|
-
|
|
3893
|
-
|
|
3894
|
-
|
|
3895
|
-
|
|
3896
|
-
|
|
3897
|
-
|
|
3898
|
-
|
|
3899
|
-
|
|
3900
|
-
|
|
3901
|
-
|
|
3902
|
-
|
|
3903
|
-
|
|
3904
|
-
|
|
3905
|
-
var elementsToKeep = /* @__PURE__ */ new Set();
|
|
3906
|
-
var elementsToStop = new Set(targets);
|
|
3907
|
-
var keep = function(el) {
|
|
3908
|
-
if (!el || elementsToKeep.has(el)) return;
|
|
3909
|
-
elementsToKeep.add(el);
|
|
3910
|
-
keep(el.parentNode);
|
|
3911
|
-
};
|
|
3912
|
-
targets.forEach(keep);
|
|
3913
|
-
var deep = function(parent) {
|
|
3914
|
-
if (!parent || elementsToStop.has(parent)) return;
|
|
3915
|
-
Array.prototype.forEach.call(parent.children, function(node) {
|
|
3916
|
-
if (elementsToKeep.has(node)) deep(node);
|
|
3917
|
-
else try {
|
|
3918
|
-
var attr = node.getAttribute(controlAttribute);
|
|
3919
|
-
var alreadyHidden = attr !== null && attr !== "false";
|
|
3920
|
-
var counterValue = (counterMap.get(node) || 0) + 1;
|
|
3921
|
-
var markerValue = (markerCounter.get(node) || 0) + 1;
|
|
3922
|
-
counterMap.set(node, counterValue);
|
|
3923
|
-
markerCounter.set(node, markerValue);
|
|
3924
|
-
hiddenNodes.push(node);
|
|
3925
|
-
if (counterValue === 1 && alreadyHidden) uncontrolledNodes.set(node, true);
|
|
3926
|
-
if (markerValue === 1) node.setAttribute(markerName, "true");
|
|
3927
|
-
if (!alreadyHidden) node.setAttribute(controlAttribute, "true");
|
|
3928
|
-
} catch (e) {
|
|
3929
|
-
console.error("aria-hidden: cannot operate on ", node, e);
|
|
3930
|
-
}
|
|
3931
|
-
});
|
|
3932
|
-
};
|
|
3933
|
-
deep(parentNode);
|
|
3934
|
-
elementsToKeep.clear();
|
|
3935
|
-
lockCount++;
|
|
3936
|
-
return function() {
|
|
3937
|
-
hiddenNodes.forEach(function(node) {
|
|
3938
|
-
var counterValue = counterMap.get(node) - 1;
|
|
3939
|
-
var markerValue = markerCounter.get(node) - 1;
|
|
3940
|
-
counterMap.set(node, counterValue);
|
|
3941
|
-
markerCounter.set(node, markerValue);
|
|
3942
|
-
if (!counterValue) {
|
|
3943
|
-
if (!uncontrolledNodes.has(node)) node.removeAttribute(controlAttribute);
|
|
3944
|
-
uncontrolledNodes.delete(node);
|
|
3608
|
+
handler(getRect(element));
|
|
3609
|
+
if (!targetWindow.ResizeObserver) return () => {};
|
|
3610
|
+
const observer = new targetWindow.ResizeObserver((entries) => {
|
|
3611
|
+
const run = () => {
|
|
3612
|
+
const entry = entries[0];
|
|
3613
|
+
if (entry == null ? void 0 : entry.borderBoxSize) {
|
|
3614
|
+
const box = entry.borderBoxSize[0];
|
|
3615
|
+
if (box) {
|
|
3616
|
+
handler({
|
|
3617
|
+
width: box.inlineSize,
|
|
3618
|
+
height: box.blockSize
|
|
3619
|
+
});
|
|
3620
|
+
return;
|
|
3945
3621
|
}
|
|
3946
|
-
if (!markerValue) node.removeAttribute(markerName);
|
|
3947
|
-
});
|
|
3948
|
-
lockCount--;
|
|
3949
|
-
if (!lockCount) {
|
|
3950
|
-
counterMap = /* @__PURE__ */ new WeakMap();
|
|
3951
|
-
counterMap = /* @__PURE__ */ new WeakMap();
|
|
3952
|
-
uncontrolledNodes = /* @__PURE__ */ new WeakMap();
|
|
3953
|
-
markerMap = {};
|
|
3954
3622
|
}
|
|
3623
|
+
handler(getRect(element));
|
|
3955
3624
|
};
|
|
3625
|
+
instance.options.useAnimationFrameWithResizeObserver ? requestAnimationFrame(run) : run();
|
|
3626
|
+
});
|
|
3627
|
+
observer.observe(element, { box: "border-box" });
|
|
3628
|
+
return () => {
|
|
3629
|
+
observer.unobserve(element);
|
|
3956
3630
|
};
|
|
3957
|
-
|
|
3958
|
-
|
|
3959
|
-
|
|
3960
|
-
|
|
3961
|
-
|
|
3962
|
-
|
|
3963
|
-
|
|
3964
|
-
|
|
3965
|
-
|
|
3966
|
-
|
|
3967
|
-
|
|
3968
|
-
|
|
3969
|
-
|
|
3970
|
-
};
|
|
3971
|
-
|
|
3972
|
-
|
|
3973
|
-
|
|
3974
|
-
exports.hideOthers = hideOthers;
|
|
3975
|
-
/**
|
|
3976
|
-
* Marks everything except given node(or nodes) as inert
|
|
3977
|
-
* @param {Element | Element[]} originalTarget - elements to keep on the page
|
|
3978
|
-
* @param [parentNode] - top element, defaults to document.body
|
|
3979
|
-
* @param {String} [markerName] - a special attribute to mark every node
|
|
3980
|
-
* @return {Undo} undo command
|
|
3981
|
-
*/
|
|
3982
|
-
var inertOthers = function(originalTarget, parentNode, markerName) {
|
|
3983
|
-
if (markerName === void 0) markerName = "data-inert-ed";
|
|
3984
|
-
var activeParentNode = parentNode || getDefaultParent(originalTarget);
|
|
3985
|
-
if (!activeParentNode) return function() {
|
|
3986
|
-
return null;
|
|
3987
|
-
};
|
|
3988
|
-
return applyAttributeToOthers(originalTarget, activeParentNode, markerName, "inert");
|
|
3989
|
-
};
|
|
3990
|
-
exports.inertOthers = inertOthers;
|
|
3991
|
-
/**
|
|
3992
|
-
* @returns if current browser supports inert
|
|
3993
|
-
*/
|
|
3994
|
-
var supportsInert = function() {
|
|
3995
|
-
return typeof HTMLElement !== "undefined" && HTMLElement.prototype.hasOwnProperty("inert");
|
|
3631
|
+
};
|
|
3632
|
+
const addEventListenerOptions = { passive: true };
|
|
3633
|
+
const supportsScrollend = typeof window == "undefined" ? true : "onscrollend" in window;
|
|
3634
|
+
const observeElementOffset = (instance, cb) => {
|
|
3635
|
+
const element = instance.scrollElement;
|
|
3636
|
+
if (!element) return;
|
|
3637
|
+
const targetWindow = instance.targetWindow;
|
|
3638
|
+
if (!targetWindow) return;
|
|
3639
|
+
let offset = 0;
|
|
3640
|
+
const fallback = instance.options.useScrollendEvent && supportsScrollend ? () => void 0 : debounce(targetWindow, () => {
|
|
3641
|
+
cb(offset, false);
|
|
3642
|
+
}, instance.options.isScrollingResetDelay);
|
|
3643
|
+
const createHandler = (isScrolling) => () => {
|
|
3644
|
+
const { horizontal, isRtl } = instance.options;
|
|
3645
|
+
offset = horizontal ? element["scrollLeft"] * (isRtl && -1 || 1) : element["scrollTop"];
|
|
3646
|
+
fallback();
|
|
3647
|
+
cb(offset, isScrolling);
|
|
3996
3648
|
};
|
|
3997
|
-
|
|
3998
|
-
|
|
3999
|
-
|
|
4000
|
-
|
|
4001
|
-
|
|
4002
|
-
|
|
4003
|
-
|
|
4004
|
-
|
|
4005
|
-
var suppressOthers = function(originalTarget, parentNode, markerName) {
|
|
4006
|
-
if (markerName === void 0) markerName = "data-suppressed";
|
|
4007
|
-
return ((0, exports.supportsInert)() ? exports.inertOthers : exports.hideOthers)(originalTarget, parentNode, markerName);
|
|
3649
|
+
const handler = createHandler(true);
|
|
3650
|
+
const endHandler = createHandler(false);
|
|
3651
|
+
element.addEventListener("scroll", handler, addEventListenerOptions);
|
|
3652
|
+
const registerScrollendEvent = instance.options.useScrollendEvent && supportsScrollend;
|
|
3653
|
+
if (registerScrollendEvent) element.addEventListener("scrollend", endHandler, addEventListenerOptions);
|
|
3654
|
+
return () => {
|
|
3655
|
+
element.removeEventListener("scroll", handler);
|
|
3656
|
+
if (registerScrollendEvent) element.removeEventListener("scrollend", endHandler);
|
|
4008
3657
|
};
|
|
4009
|
-
|
|
4010
|
-
|
|
4011
|
-
|
|
4012
|
-
|
|
4013
|
-
|
|
4014
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4015
|
-
exports.removedBarSizeVariable = exports.noScrollbarsClassName = exports.fullWidthClassName = exports.zeroRightClassName = void 0;
|
|
4016
|
-
exports.zeroRightClassName = "right-scroll-bar-position";
|
|
4017
|
-
exports.fullWidthClassName = "width-before-scroll-bar";
|
|
4018
|
-
exports.noScrollbarsClassName = "with-scroll-bars-hidden";
|
|
4019
|
-
/**
|
|
4020
|
-
* Name of a CSS variable containing the amount of "hidden" scrollbar
|
|
4021
|
-
* ! might be undefined ! use will fallback!
|
|
4022
|
-
*/
|
|
4023
|
-
exports.removedBarSizeVariable = "--removed-body-scroll-bar-size";
|
|
4024
|
-
}));
|
|
4025
|
-
//#endregion
|
|
4026
|
-
//#region ../../node_modules/.pnpm/use-callback-ref@1.3.3_@types+react@19.2.14_react@19.2.6/node_modules/use-callback-ref/dist/es5/assignRef.js
|
|
4027
|
-
var require_assignRef = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
4028
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4029
|
-
exports.assignRef = void 0;
|
|
4030
|
-
/**
|
|
4031
|
-
* Assigns a value for a given ref, no matter of the ref format
|
|
4032
|
-
* @param {RefObject} ref - a callback function or ref object
|
|
4033
|
-
* @param value - a new value
|
|
4034
|
-
*
|
|
4035
|
-
* @see https://github.com/theKashey/use-callback-ref#assignref
|
|
4036
|
-
* @example
|
|
4037
|
-
* const refObject = useRef();
|
|
4038
|
-
* const refFn = (ref) => {....}
|
|
4039
|
-
*
|
|
4040
|
-
* assignRef(refObject, "refValue");
|
|
4041
|
-
* assignRef(refFn, "refValue");
|
|
4042
|
-
*/
|
|
4043
|
-
function assignRef(ref, value) {
|
|
4044
|
-
if (typeof ref === "function") ref(value);
|
|
4045
|
-
else if (ref) ref.current = value;
|
|
4046
|
-
return ref;
|
|
3658
|
+
};
|
|
3659
|
+
const measureElement = (element, entry, instance) => {
|
|
3660
|
+
if (entry == null ? void 0 : entry.borderBoxSize) {
|
|
3661
|
+
const box = entry.borderBoxSize[0];
|
|
3662
|
+
if (box) return Math.round(box[instance.options.horizontal ? "inlineSize" : "blockSize"]);
|
|
4047
3663
|
}
|
|
4048
|
-
|
|
4049
|
-
}
|
|
4050
|
-
|
|
4051
|
-
|
|
4052
|
-
|
|
4053
|
-
|
|
4054
|
-
|
|
4055
|
-
|
|
4056
|
-
|
|
4057
|
-
|
|
4058
|
-
|
|
4059
|
-
|
|
4060
|
-
|
|
4061
|
-
|
|
4062
|
-
|
|
4063
|
-
|
|
4064
|
-
|
|
4065
|
-
|
|
4066
|
-
|
|
4067
|
-
|
|
4068
|
-
|
|
4069
|
-
|
|
4070
|
-
|
|
4071
|
-
|
|
3664
|
+
return element[instance.options.horizontal ? "offsetWidth" : "offsetHeight"];
|
|
3665
|
+
};
|
|
3666
|
+
const elementScroll = (offset, { adjustments = 0, behavior }, instance) => {
|
|
3667
|
+
var _a, _b;
|
|
3668
|
+
const toOffset = offset + adjustments;
|
|
3669
|
+
(_b = (_a = instance.scrollElement) == null ? void 0 : _a.scrollTo) == null || _b.call(_a, {
|
|
3670
|
+
[instance.options.horizontal ? "left" : "top"]: toOffset,
|
|
3671
|
+
behavior
|
|
3672
|
+
});
|
|
3673
|
+
};
|
|
3674
|
+
var Virtualizer = class {
|
|
3675
|
+
constructor(opts) {
|
|
3676
|
+
this.unsubs = [];
|
|
3677
|
+
this.scrollElement = null;
|
|
3678
|
+
this.targetWindow = null;
|
|
3679
|
+
this.isScrolling = false;
|
|
3680
|
+
this.currentScrollToIndex = null;
|
|
3681
|
+
this.measurementsCache = [];
|
|
3682
|
+
this.itemSizeCache = /* @__PURE__ */ new Map();
|
|
3683
|
+
this.laneAssignments = /* @__PURE__ */ new Map();
|
|
3684
|
+
this.pendingMeasuredCacheIndexes = [];
|
|
3685
|
+
this.prevLanes = void 0;
|
|
3686
|
+
this.lanesChangedFlag = false;
|
|
3687
|
+
this.lanesSettling = false;
|
|
3688
|
+
this.scrollRect = null;
|
|
3689
|
+
this.scrollOffset = null;
|
|
3690
|
+
this.scrollDirection = null;
|
|
3691
|
+
this.scrollAdjustments = 0;
|
|
3692
|
+
this.elementsCache = /* @__PURE__ */ new Map();
|
|
3693
|
+
this.observer = /* @__PURE__ */ (() => {
|
|
3694
|
+
let _ro = null;
|
|
3695
|
+
const get = () => {
|
|
3696
|
+
if (_ro) return _ro;
|
|
3697
|
+
if (!this.targetWindow || !this.targetWindow.ResizeObserver) return null;
|
|
3698
|
+
return _ro = new this.targetWindow.ResizeObserver((entries) => {
|
|
3699
|
+
entries.forEach((entry) => {
|
|
3700
|
+
const run = () => {
|
|
3701
|
+
this._measureElement(entry.target, entry);
|
|
3702
|
+
};
|
|
3703
|
+
this.options.useAnimationFrameWithResizeObserver ? requestAnimationFrame(run) : run();
|
|
3704
|
+
});
|
|
3705
|
+
});
|
|
3706
|
+
};
|
|
4072
3707
|
return {
|
|
4073
|
-
|
|
4074
|
-
|
|
4075
|
-
|
|
4076
|
-
|
|
4077
|
-
|
|
4078
|
-
|
|
4079
|
-
|
|
4080
|
-
|
|
4081
|
-
|
|
4082
|
-
|
|
4083
|
-
|
|
4084
|
-
|
|
4085
|
-
}
|
|
3708
|
+
disconnect: () => {
|
|
3709
|
+
var _a;
|
|
3710
|
+
(_a = get()) == null || _a.disconnect();
|
|
3711
|
+
_ro = null;
|
|
3712
|
+
},
|
|
3713
|
+
observe: (target) => {
|
|
3714
|
+
var _a;
|
|
3715
|
+
return (_a = get()) == null ? void 0 : _a.observe(target, { box: "border-box" });
|
|
3716
|
+
},
|
|
3717
|
+
unobserve: (target) => {
|
|
3718
|
+
var _a;
|
|
3719
|
+
return (_a = get()) == null ? void 0 : _a.unobserve(target);
|
|
4086
3720
|
}
|
|
4087
3721
|
};
|
|
4088
|
-
})
|
|
4089
|
-
|
|
4090
|
-
|
|
4091
|
-
|
|
4092
|
-
|
|
4093
|
-
}));
|
|
4094
|
-
//#endregion
|
|
4095
|
-
//#region ../../node_modules/.pnpm/use-callback-ref@1.3.3_@types+react@19.2.14_react@19.2.6/node_modules/use-callback-ref/dist/es5/createRef.js
|
|
4096
|
-
var require_createRef = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
4097
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4098
|
-
exports.createCallbackRef = void 0;
|
|
4099
|
-
/**
|
|
4100
|
-
* creates a Ref object with on change callback
|
|
4101
|
-
* @param callback
|
|
4102
|
-
* @returns {RefObject}
|
|
4103
|
-
*
|
|
4104
|
-
* @see {@link useCallbackRef}
|
|
4105
|
-
* @see https://reactjs.org/docs/refs-and-the-dom.html#creating-refs
|
|
4106
|
-
*/
|
|
4107
|
-
function createCallbackRef(callback) {
|
|
4108
|
-
var current = null;
|
|
4109
|
-
return {
|
|
4110
|
-
get current() {
|
|
4111
|
-
return current;
|
|
4112
|
-
},
|
|
4113
|
-
set current(value) {
|
|
4114
|
-
var last = current;
|
|
4115
|
-
if (last !== value) {
|
|
4116
|
-
current = value;
|
|
4117
|
-
callback(value, last);
|
|
4118
|
-
}
|
|
4119
|
-
}
|
|
4120
|
-
};
|
|
4121
|
-
}
|
|
4122
|
-
exports.createCallbackRef = createCallbackRef;
|
|
4123
|
-
}));
|
|
4124
|
-
//#endregion
|
|
4125
|
-
//#region ../../node_modules/.pnpm/use-callback-ref@1.3.3_@types+react@19.2.14_react@19.2.6/node_modules/use-callback-ref/dist/es5/mergeRef.js
|
|
4126
|
-
var require_mergeRef = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
4127
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4128
|
-
exports.mergeRefs = void 0;
|
|
4129
|
-
var assignRef_1 = require_assignRef();
|
|
4130
|
-
var createRef_1 = require_createRef();
|
|
4131
|
-
/**
|
|
4132
|
-
* Merges two or more refs together providing a single interface to set their value
|
|
4133
|
-
* @param {RefObject|Ref} refs
|
|
4134
|
-
* @returns {MutableRefObject} - a new ref, which translates all changes to {refs}
|
|
4135
|
-
*
|
|
4136
|
-
* @see {@link useMergeRefs} to be used in ReactComponents
|
|
4137
|
-
* @example
|
|
4138
|
-
* const Component = React.forwardRef((props, ref) => {
|
|
4139
|
-
* const ownRef = useRef();
|
|
4140
|
-
* const domRef = mergeRefs([ref, ownRef]); // 👈 merge together
|
|
4141
|
-
* return <div ref={domRef}>...</div>
|
|
4142
|
-
* }
|
|
4143
|
-
*/
|
|
4144
|
-
function mergeRefs(refs) {
|
|
4145
|
-
return (0, createRef_1.createCallbackRef)(function(newValue) {
|
|
4146
|
-
return refs.forEach(function(ref) {
|
|
4147
|
-
return (0, assignRef_1.assignRef)(ref, newValue);
|
|
4148
|
-
});
|
|
4149
|
-
});
|
|
4150
|
-
}
|
|
4151
|
-
exports.mergeRefs = mergeRefs;
|
|
4152
|
-
}));
|
|
4153
|
-
//#endregion
|
|
4154
|
-
//#region ../../node_modules/.pnpm/use-callback-ref@1.3.3_@types+react@19.2.14_react@19.2.6/node_modules/use-callback-ref/dist/es5/useMergeRef.js
|
|
4155
|
-
var require_useMergeRef = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
4156
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4157
|
-
exports.useMergeRefs = void 0;
|
|
4158
|
-
var React$9 = (init_tslib_es6(), __toCommonJS(tslib_es6_exports)).__importStar(__require("react"));
|
|
4159
|
-
var assignRef_1 = require_assignRef();
|
|
4160
|
-
var useRef_1 = require_useRef();
|
|
4161
|
-
var useIsomorphicLayoutEffect = typeof window !== "undefined" ? React$9.useLayoutEffect : React$9.useEffect;
|
|
4162
|
-
var currentValues = /* @__PURE__ */ new WeakMap();
|
|
4163
|
-
/**
|
|
4164
|
-
* Merges two or more refs together providing a single interface to set their value
|
|
4165
|
-
* @param {RefObject|Ref} refs
|
|
4166
|
-
* @returns {MutableRefObject} - a new ref, which translates all changes to {refs}
|
|
4167
|
-
*
|
|
4168
|
-
* @see {@link mergeRefs} a version without buit-in memoization
|
|
4169
|
-
* @see https://github.com/theKashey/use-callback-ref#usemergerefs
|
|
4170
|
-
* @example
|
|
4171
|
-
* const Component = React.forwardRef((props, ref) => {
|
|
4172
|
-
* const ownRef = useRef();
|
|
4173
|
-
* const domRef = useMergeRefs([ref, ownRef]); // 👈 merge together
|
|
4174
|
-
* return <div ref={domRef}>...</div>
|
|
4175
|
-
* }
|
|
4176
|
-
*/
|
|
4177
|
-
function useMergeRefs(refs, defaultValue) {
|
|
4178
|
-
var callbackRef = (0, useRef_1.useCallbackRef)(defaultValue || null, function(newValue) {
|
|
4179
|
-
return refs.forEach(function(ref) {
|
|
4180
|
-
return (0, assignRef_1.assignRef)(ref, newValue);
|
|
3722
|
+
})();
|
|
3723
|
+
this.range = null;
|
|
3724
|
+
this.setOptions = (opts2) => {
|
|
3725
|
+
Object.entries(opts2).forEach(([key, value]) => {
|
|
3726
|
+
if (typeof value === "undefined") delete opts2[key];
|
|
4181
3727
|
});
|
|
3728
|
+
this.options = {
|
|
3729
|
+
debug: false,
|
|
3730
|
+
initialOffset: 0,
|
|
3731
|
+
overscan: 1,
|
|
3732
|
+
paddingStart: 0,
|
|
3733
|
+
paddingEnd: 0,
|
|
3734
|
+
scrollPaddingStart: 0,
|
|
3735
|
+
scrollPaddingEnd: 0,
|
|
3736
|
+
horizontal: false,
|
|
3737
|
+
getItemKey: defaultKeyExtractor,
|
|
3738
|
+
rangeExtractor: defaultRangeExtractor,
|
|
3739
|
+
onChange: () => {},
|
|
3740
|
+
measureElement,
|
|
3741
|
+
initialRect: {
|
|
3742
|
+
width: 0,
|
|
3743
|
+
height: 0
|
|
3744
|
+
},
|
|
3745
|
+
scrollMargin: 0,
|
|
3746
|
+
gap: 0,
|
|
3747
|
+
indexAttribute: "data-index",
|
|
3748
|
+
initialMeasurementsCache: [],
|
|
3749
|
+
lanes: 1,
|
|
3750
|
+
isScrollingResetDelay: 150,
|
|
3751
|
+
enabled: true,
|
|
3752
|
+
isRtl: false,
|
|
3753
|
+
useScrollendEvent: false,
|
|
3754
|
+
useAnimationFrameWithResizeObserver: false,
|
|
3755
|
+
...opts2
|
|
3756
|
+
};
|
|
3757
|
+
};
|
|
3758
|
+
this.notify = (sync) => {
|
|
3759
|
+
var _a, _b;
|
|
3760
|
+
(_b = (_a = this.options).onChange) == null || _b.call(_a, this, sync);
|
|
3761
|
+
};
|
|
3762
|
+
this.maybeNotify = memo$1(() => {
|
|
3763
|
+
this.calculateRange();
|
|
3764
|
+
return [
|
|
3765
|
+
this.isScrolling,
|
|
3766
|
+
this.range ? this.range.startIndex : null,
|
|
3767
|
+
this.range ? this.range.endIndex : null
|
|
3768
|
+
];
|
|
3769
|
+
}, (isScrolling) => {
|
|
3770
|
+
this.notify(isScrolling);
|
|
3771
|
+
}, {
|
|
3772
|
+
key: process.env.NODE_ENV !== "production" && "maybeNotify",
|
|
3773
|
+
debug: () => this.options.debug,
|
|
3774
|
+
initialDeps: [
|
|
3775
|
+
this.isScrolling,
|
|
3776
|
+
this.range ? this.range.startIndex : null,
|
|
3777
|
+
this.range ? this.range.endIndex : null
|
|
3778
|
+
]
|
|
4182
3779
|
});
|
|
4183
|
-
|
|
4184
|
-
|
|
4185
|
-
|
|
4186
|
-
|
|
4187
|
-
|
|
4188
|
-
|
|
4189
|
-
|
|
4190
|
-
|
|
3780
|
+
this.cleanup = () => {
|
|
3781
|
+
this.unsubs.filter(Boolean).forEach((d) => d());
|
|
3782
|
+
this.unsubs = [];
|
|
3783
|
+
this.observer.disconnect();
|
|
3784
|
+
this.scrollElement = null;
|
|
3785
|
+
this.targetWindow = null;
|
|
3786
|
+
};
|
|
3787
|
+
this._didMount = () => {
|
|
3788
|
+
return () => {
|
|
3789
|
+
this.cleanup();
|
|
3790
|
+
};
|
|
3791
|
+
};
|
|
3792
|
+
this._willUpdate = () => {
|
|
3793
|
+
var _a;
|
|
3794
|
+
const scrollElement = this.options.enabled ? this.options.getScrollElement() : null;
|
|
3795
|
+
if (this.scrollElement !== scrollElement) {
|
|
3796
|
+
this.cleanup();
|
|
3797
|
+
if (!scrollElement) {
|
|
3798
|
+
this.maybeNotify();
|
|
3799
|
+
return;
|
|
3800
|
+
}
|
|
3801
|
+
this.scrollElement = scrollElement;
|
|
3802
|
+
if (this.scrollElement && "ownerDocument" in this.scrollElement) this.targetWindow = this.scrollElement.ownerDocument.defaultView;
|
|
3803
|
+
else this.targetWindow = ((_a = this.scrollElement) == null ? void 0 : _a.window) ?? null;
|
|
3804
|
+
this.elementsCache.forEach((cached) => {
|
|
3805
|
+
this.observer.observe(cached);
|
|
4191
3806
|
});
|
|
4192
|
-
|
|
4193
|
-
|
|
3807
|
+
this.unsubs.push(this.options.observeElementRect(this, (rect) => {
|
|
3808
|
+
this.scrollRect = rect;
|
|
3809
|
+
this.maybeNotify();
|
|
3810
|
+
}));
|
|
3811
|
+
this.unsubs.push(this.options.observeElementOffset(this, (offset, isScrolling) => {
|
|
3812
|
+
this.scrollAdjustments = 0;
|
|
3813
|
+
this.scrollDirection = isScrolling ? this.getScrollOffset() < offset ? "forward" : "backward" : null;
|
|
3814
|
+
this.scrollOffset = offset;
|
|
3815
|
+
this.isScrolling = isScrolling;
|
|
3816
|
+
this.maybeNotify();
|
|
3817
|
+
}));
|
|
3818
|
+
this._scrollToOffset(this.getScrollOffset(), {
|
|
3819
|
+
adjustments: void 0,
|
|
3820
|
+
behavior: void 0
|
|
4194
3821
|
});
|
|
4195
3822
|
}
|
|
4196
|
-
currentValues.set(callbackRef, refs);
|
|
4197
|
-
}, [refs]);
|
|
4198
|
-
return callbackRef;
|
|
4199
|
-
}
|
|
4200
|
-
exports.useMergeRefs = useMergeRefs;
|
|
4201
|
-
}));
|
|
4202
|
-
//#endregion
|
|
4203
|
-
//#region ../../node_modules/.pnpm/use-callback-ref@1.3.3_@types+react@19.2.14_react@19.2.6/node_modules/use-callback-ref/dist/es5/useTransformRef.js
|
|
4204
|
-
var require_useTransformRef = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
4205
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4206
|
-
exports.useTransformRef = void 0;
|
|
4207
|
-
var assignRef_1 = require_assignRef();
|
|
4208
|
-
var useRef_1 = require_useRef();
|
|
4209
|
-
/**
|
|
4210
|
-
* Create a _lense_ on Ref, making it possible to transform ref value
|
|
4211
|
-
* @param {ReactRef} ref
|
|
4212
|
-
* @param {Function} transformer. 👉 Ref would be __NOT updated__ on `transformer` update.
|
|
4213
|
-
* @returns {RefObject}
|
|
4214
|
-
*
|
|
4215
|
-
* @see https://github.com/theKashey/use-callback-ref#usetransformref-to-replace-reactuseimperativehandle
|
|
4216
|
-
* @example
|
|
4217
|
-
*
|
|
4218
|
-
* const ResizableWithRef = forwardRef((props, ref) =>
|
|
4219
|
-
* <Resizable {...props} ref={useTransformRef(ref, i => i ? i.resizable : null)}/>
|
|
4220
|
-
* );
|
|
4221
|
-
*/
|
|
4222
|
-
function useTransformRef(ref, transformer) {
|
|
4223
|
-
return (0, useRef_1.useCallbackRef)(null, function(value) {
|
|
4224
|
-
return (0, assignRef_1.assignRef)(ref, transformer(value));
|
|
4225
|
-
});
|
|
4226
|
-
}
|
|
4227
|
-
exports.useTransformRef = useTransformRef;
|
|
4228
|
-
}));
|
|
4229
|
-
//#endregion
|
|
4230
|
-
//#region ../../node_modules/.pnpm/use-callback-ref@1.3.3_@types+react@19.2.14_react@19.2.6/node_modules/use-callback-ref/dist/es5/transformRef.js
|
|
4231
|
-
var require_transformRef = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
4232
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4233
|
-
exports.transformRef = void 0;
|
|
4234
|
-
var assignRef_1 = require_assignRef();
|
|
4235
|
-
var createRef_1 = require_createRef();
|
|
4236
|
-
/**
|
|
4237
|
-
* Transforms one ref to another
|
|
4238
|
-
* @example
|
|
4239
|
-
* ```tsx
|
|
4240
|
-
* const ResizableWithRef = forwardRef((props, ref) =>
|
|
4241
|
-
* <Resizable {...props} ref={transformRef(ref, i => i ? i.resizable : null)}/>
|
|
4242
|
-
* );
|
|
4243
|
-
* ```
|
|
4244
|
-
*/
|
|
4245
|
-
function transformRef(ref, transformer) {
|
|
4246
|
-
return (0, createRef_1.createCallbackRef)(function(value) {
|
|
4247
|
-
return (0, assignRef_1.assignRef)(ref, transformer(value));
|
|
4248
|
-
});
|
|
4249
|
-
}
|
|
4250
|
-
exports.transformRef = transformRef;
|
|
4251
|
-
}));
|
|
4252
|
-
//#endregion
|
|
4253
|
-
//#region ../../node_modules/.pnpm/use-callback-ref@1.3.3_@types+react@19.2.14_react@19.2.6/node_modules/use-callback-ref/dist/es5/refToCallback.js
|
|
4254
|
-
var require_refToCallback = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
4255
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4256
|
-
exports.useRefToCallback = exports.refToCallback = void 0;
|
|
4257
|
-
/**
|
|
4258
|
-
* Unmemoized version of {@link useRefToCallback}
|
|
4259
|
-
* @see {@link useRefToCallback}
|
|
4260
|
-
* @param ref
|
|
4261
|
-
*/
|
|
4262
|
-
function refToCallback(ref) {
|
|
4263
|
-
return function(newValue) {
|
|
4264
|
-
if (typeof ref === "function") ref(newValue);
|
|
4265
|
-
else if (ref) ref.current = newValue;
|
|
4266
3823
|
};
|
|
4267
|
-
|
|
4268
|
-
|
|
4269
|
-
|
|
4270
|
-
|
|
4271
|
-
|
|
4272
|
-
|
|
4273
|
-
|
|
4274
|
-
|
|
4275
|
-
|
|
4276
|
-
|
|
4277
|
-
|
|
4278
|
-
|
|
4279
|
-
|
|
4280
|
-
|
|
4281
|
-
|
|
4282
|
-
|
|
4283
|
-
|
|
4284
|
-
|
|
4285
|
-
|
|
4286
|
-
|
|
4287
|
-
|
|
4288
|
-
|
|
4289
|
-
|
|
4290
|
-
|
|
4291
|
-
|
|
4292
|
-
|
|
4293
|
-
|
|
4294
|
-
|
|
4295
|
-
|
|
4296
|
-
|
|
4297
|
-
|
|
4298
|
-
|
|
4299
|
-
|
|
4300
|
-
|
|
4301
|
-
|
|
4302
|
-
|
|
4303
|
-
|
|
4304
|
-
|
|
4305
|
-
|
|
4306
|
-
|
|
4307
|
-
|
|
4308
|
-
|
|
4309
|
-
|
|
4310
|
-
|
|
4311
|
-
|
|
4312
|
-
|
|
4313
|
-
|
|
4314
|
-
|
|
4315
|
-
|
|
4316
|
-
|
|
4317
|
-
|
|
4318
|
-
|
|
4319
|
-
}
|
|
4320
|
-
|
|
4321
|
-
|
|
4322
|
-
|
|
4323
|
-
|
|
4324
|
-
|
|
4325
|
-
|
|
4326
|
-
|
|
4327
|
-
|
|
4328
|
-
|
|
4329
|
-
|
|
4330
|
-
|
|
4331
|
-
|
|
4332
|
-
|
|
4333
|
-
|
|
4334
|
-
|
|
4335
|
-
|
|
4336
|
-
|
|
4337
|
-
|
|
4338
|
-
|
|
4339
|
-
|
|
4340
|
-
|
|
4341
|
-
});
|
|
4342
|
-
var useTransformRef_1 = require_useTransformRef();
|
|
4343
|
-
Object.defineProperty(exports, "useTransformRef", {
|
|
4344
|
-
enumerable: true,
|
|
4345
|
-
get: function() {
|
|
4346
|
-
return useTransformRef_1.useTransformRef;
|
|
4347
|
-
}
|
|
4348
|
-
});
|
|
4349
|
-
var transformRef_1 = require_transformRef();
|
|
4350
|
-
Object.defineProperty(exports, "transformRef", {
|
|
4351
|
-
enumerable: true,
|
|
4352
|
-
get: function() {
|
|
4353
|
-
return transformRef_1.transformRef;
|
|
4354
|
-
}
|
|
4355
|
-
});
|
|
4356
|
-
var refToCallback_1 = require_refToCallback();
|
|
4357
|
-
Object.defineProperty(exports, "refToCallback", {
|
|
4358
|
-
enumerable: true,
|
|
4359
|
-
get: function() {
|
|
4360
|
-
return refToCallback_1.refToCallback;
|
|
4361
|
-
}
|
|
4362
|
-
});
|
|
4363
|
-
Object.defineProperty(exports, "useRefToCallback", {
|
|
4364
|
-
enumerable: true,
|
|
4365
|
-
get: function() {
|
|
4366
|
-
return refToCallback_1.useRefToCallback;
|
|
4367
|
-
}
|
|
4368
|
-
});
|
|
4369
|
-
}));
|
|
4370
|
-
//#endregion
|
|
4371
|
-
//#region ../../node_modules/.pnpm/detect-node-es@1.1.0/node_modules/detect-node-es/es5/node.js
|
|
4372
|
-
var require_node = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
4373
|
-
module.exports.isNode = Object.prototype.toString.call(typeof process !== "undefined" ? process : 0) === "[object process]";
|
|
4374
|
-
}));
|
|
4375
|
-
//#endregion
|
|
4376
|
-
//#region ../../node_modules/.pnpm/use-sidecar@1.1.3_@types+react@19.2.14_react@19.2.6/node_modules/use-sidecar/dist/es5/env.js
|
|
4377
|
-
var require_env = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
4378
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4379
|
-
exports.env = void 0;
|
|
4380
|
-
exports.env = {
|
|
4381
|
-
isNode: require_node().isNode,
|
|
4382
|
-
forceCache: false
|
|
4383
|
-
};
|
|
4384
|
-
}));
|
|
4385
|
-
//#endregion
|
|
4386
|
-
//#region ../../node_modules/.pnpm/use-sidecar@1.1.3_@types+react@19.2.14_react@19.2.6/node_modules/use-sidecar/dist/es5/hook.js
|
|
4387
|
-
var require_hook$1 = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
4388
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4389
|
-
exports.useSidecar = void 0;
|
|
4390
|
-
var react_1$1 = __require("react");
|
|
4391
|
-
var env_1 = require_env();
|
|
4392
|
-
var cache = /* @__PURE__ */ new WeakMap();
|
|
4393
|
-
var NO_OPTIONS = {};
|
|
4394
|
-
function useSidecar(importer, effect) {
|
|
4395
|
-
var options = effect && effect.options || NO_OPTIONS;
|
|
4396
|
-
if (env_1.env.isNode && !options.ssr) return [null, null];
|
|
4397
|
-
return useRealSidecar(importer, effect);
|
|
4398
|
-
}
|
|
4399
|
-
exports.useSidecar = useSidecar;
|
|
4400
|
-
function useRealSidecar(importer, effect) {
|
|
4401
|
-
var options = effect && effect.options || NO_OPTIONS;
|
|
4402
|
-
var couldUseCache = env_1.env.forceCache || env_1.env.isNode && !!options.ssr || !options.async;
|
|
4403
|
-
var _a = (0, react_1$1.useState)(couldUseCache ? function() {
|
|
4404
|
-
return cache.get(importer);
|
|
4405
|
-
} : void 0), Car = _a[0], setCar = _a[1];
|
|
4406
|
-
var _b = (0, react_1$1.useState)(null), error = _b[0], setError = _b[1];
|
|
4407
|
-
(0, react_1$1.useEffect)(function() {
|
|
4408
|
-
if (!Car) importer().then(function(car) {
|
|
4409
|
-
var resolved = effect ? effect.read() : car.default || car;
|
|
4410
|
-
if (!resolved) {
|
|
4411
|
-
console.error("Sidecar error: with importer", importer);
|
|
4412
|
-
var error_1;
|
|
4413
|
-
if (effect) {
|
|
4414
|
-
console.error("Sidecar error: with medium", effect);
|
|
4415
|
-
error_1 = /* @__PURE__ */ new Error("Sidecar medium was not found");
|
|
4416
|
-
} else error_1 = /* @__PURE__ */ new Error("Sidecar was not found in exports");
|
|
4417
|
-
setError(function() {
|
|
4418
|
-
return error_1;
|
|
4419
|
-
});
|
|
4420
|
-
throw error_1;
|
|
4421
|
-
}
|
|
4422
|
-
cache.set(importer, resolved);
|
|
4423
|
-
setCar(function() {
|
|
4424
|
-
return resolved;
|
|
4425
|
-
});
|
|
4426
|
-
}, function(e) {
|
|
4427
|
-
return setError(function() {
|
|
4428
|
-
return e;
|
|
3824
|
+
this.getSize = () => {
|
|
3825
|
+
if (!this.options.enabled) {
|
|
3826
|
+
this.scrollRect = null;
|
|
3827
|
+
return 0;
|
|
3828
|
+
}
|
|
3829
|
+
this.scrollRect = this.scrollRect ?? this.options.initialRect;
|
|
3830
|
+
return this.scrollRect[this.options.horizontal ? "width" : "height"];
|
|
3831
|
+
};
|
|
3832
|
+
this.getScrollOffset = () => {
|
|
3833
|
+
if (!this.options.enabled) {
|
|
3834
|
+
this.scrollOffset = null;
|
|
3835
|
+
return 0;
|
|
3836
|
+
}
|
|
3837
|
+
this.scrollOffset = this.scrollOffset ?? (typeof this.options.initialOffset === "function" ? this.options.initialOffset() : this.options.initialOffset);
|
|
3838
|
+
return this.scrollOffset;
|
|
3839
|
+
};
|
|
3840
|
+
this.getFurthestMeasurement = (measurements, index) => {
|
|
3841
|
+
const furthestMeasurementsFound = /* @__PURE__ */ new Map();
|
|
3842
|
+
const furthestMeasurements = /* @__PURE__ */ new Map();
|
|
3843
|
+
for (let m = index - 1; m >= 0; m--) {
|
|
3844
|
+
const measurement = measurements[m];
|
|
3845
|
+
if (furthestMeasurementsFound.has(measurement.lane)) continue;
|
|
3846
|
+
const previousFurthestMeasurement = furthestMeasurements.get(measurement.lane);
|
|
3847
|
+
if (previousFurthestMeasurement == null || measurement.end > previousFurthestMeasurement.end) furthestMeasurements.set(measurement.lane, measurement);
|
|
3848
|
+
else if (measurement.end < previousFurthestMeasurement.end) furthestMeasurementsFound.set(measurement.lane, true);
|
|
3849
|
+
if (furthestMeasurementsFound.size === this.options.lanes) break;
|
|
3850
|
+
}
|
|
3851
|
+
return furthestMeasurements.size === this.options.lanes ? Array.from(furthestMeasurements.values()).sort((a, b) => {
|
|
3852
|
+
if (a.end === b.end) return a.index - b.index;
|
|
3853
|
+
return a.end - b.end;
|
|
3854
|
+
})[0] : void 0;
|
|
3855
|
+
};
|
|
3856
|
+
this.getMeasurementOptions = memo$1(() => [
|
|
3857
|
+
this.options.count,
|
|
3858
|
+
this.options.paddingStart,
|
|
3859
|
+
this.options.scrollMargin,
|
|
3860
|
+
this.options.getItemKey,
|
|
3861
|
+
this.options.enabled,
|
|
3862
|
+
this.options.lanes
|
|
3863
|
+
], (count, paddingStart, scrollMargin, getItemKey, enabled, lanes) => {
|
|
3864
|
+
if (this.prevLanes !== void 0 && this.prevLanes !== lanes) this.lanesChangedFlag = true;
|
|
3865
|
+
this.prevLanes = lanes;
|
|
3866
|
+
this.pendingMeasuredCacheIndexes = [];
|
|
3867
|
+
return {
|
|
3868
|
+
count,
|
|
3869
|
+
paddingStart,
|
|
3870
|
+
scrollMargin,
|
|
3871
|
+
getItemKey,
|
|
3872
|
+
enabled,
|
|
3873
|
+
lanes
|
|
3874
|
+
};
|
|
3875
|
+
}, { key: false });
|
|
3876
|
+
this.getMeasurements = memo$1(() => [this.getMeasurementOptions(), this.itemSizeCache], ({ count, paddingStart, scrollMargin, getItemKey, enabled, lanes }, itemSizeCache) => {
|
|
3877
|
+
if (!enabled) {
|
|
3878
|
+
this.measurementsCache = [];
|
|
3879
|
+
this.itemSizeCache.clear();
|
|
3880
|
+
this.laneAssignments.clear();
|
|
3881
|
+
return [];
|
|
3882
|
+
}
|
|
3883
|
+
if (this.laneAssignments.size > count) {
|
|
3884
|
+
for (const index of this.laneAssignments.keys()) if (index >= count) this.laneAssignments.delete(index);
|
|
3885
|
+
}
|
|
3886
|
+
if (this.lanesChangedFlag) {
|
|
3887
|
+
this.lanesChangedFlag = false;
|
|
3888
|
+
this.lanesSettling = true;
|
|
3889
|
+
this.measurementsCache = [];
|
|
3890
|
+
this.itemSizeCache.clear();
|
|
3891
|
+
this.laneAssignments.clear();
|
|
3892
|
+
this.pendingMeasuredCacheIndexes = [];
|
|
3893
|
+
}
|
|
3894
|
+
if (this.measurementsCache.length === 0 && !this.lanesSettling) {
|
|
3895
|
+
this.measurementsCache = this.options.initialMeasurementsCache;
|
|
3896
|
+
this.measurementsCache.forEach((item) => {
|
|
3897
|
+
this.itemSizeCache.set(item.key, item.size);
|
|
4429
3898
|
});
|
|
3899
|
+
}
|
|
3900
|
+
const min = this.lanesSettling ? 0 : this.pendingMeasuredCacheIndexes.length > 0 ? Math.min(...this.pendingMeasuredCacheIndexes) : 0;
|
|
3901
|
+
this.pendingMeasuredCacheIndexes = [];
|
|
3902
|
+
if (this.lanesSettling && this.measurementsCache.length === count) this.lanesSettling = false;
|
|
3903
|
+
const measurements = this.measurementsCache.slice(0, min);
|
|
3904
|
+
const laneLastIndex = new Array(lanes).fill(void 0);
|
|
3905
|
+
for (let m = 0; m < min; m++) {
|
|
3906
|
+
const item = measurements[m];
|
|
3907
|
+
if (item) laneLastIndex[item.lane] = m;
|
|
3908
|
+
}
|
|
3909
|
+
for (let i = min; i < count; i++) {
|
|
3910
|
+
const key = getItemKey(i);
|
|
3911
|
+
const cachedLane = this.laneAssignments.get(i);
|
|
3912
|
+
let lane;
|
|
3913
|
+
let start;
|
|
3914
|
+
if (cachedLane !== void 0 && this.options.lanes > 1) {
|
|
3915
|
+
lane = cachedLane;
|
|
3916
|
+
const prevIndex = laneLastIndex[lane];
|
|
3917
|
+
const prevInLane = prevIndex !== void 0 ? measurements[prevIndex] : void 0;
|
|
3918
|
+
start = prevInLane ? prevInLane.end + this.options.gap : paddingStart + scrollMargin;
|
|
3919
|
+
} else {
|
|
3920
|
+
const furthestMeasurement = this.options.lanes === 1 ? measurements[i - 1] : this.getFurthestMeasurement(measurements, i);
|
|
3921
|
+
start = furthestMeasurement ? furthestMeasurement.end + this.options.gap : paddingStart + scrollMargin;
|
|
3922
|
+
lane = furthestMeasurement ? furthestMeasurement.lane : i % this.options.lanes;
|
|
3923
|
+
if (this.options.lanes > 1) this.laneAssignments.set(i, lane);
|
|
3924
|
+
}
|
|
3925
|
+
const measuredSize = itemSizeCache.get(key);
|
|
3926
|
+
const size = typeof measuredSize === "number" ? measuredSize : this.options.estimateSize(i);
|
|
3927
|
+
const end = start + size;
|
|
3928
|
+
measurements[i] = {
|
|
3929
|
+
index: i,
|
|
3930
|
+
start,
|
|
3931
|
+
size,
|
|
3932
|
+
end,
|
|
3933
|
+
key,
|
|
3934
|
+
lane
|
|
3935
|
+
};
|
|
3936
|
+
laneLastIndex[lane] = i;
|
|
3937
|
+
}
|
|
3938
|
+
this.measurementsCache = measurements;
|
|
3939
|
+
return measurements;
|
|
3940
|
+
}, {
|
|
3941
|
+
key: process.env.NODE_ENV !== "production" && "getMeasurements",
|
|
3942
|
+
debug: () => this.options.debug
|
|
3943
|
+
});
|
|
3944
|
+
this.calculateRange = memo$1(() => [
|
|
3945
|
+
this.getMeasurements(),
|
|
3946
|
+
this.getSize(),
|
|
3947
|
+
this.getScrollOffset(),
|
|
3948
|
+
this.options.lanes
|
|
3949
|
+
], (measurements, outerSize, scrollOffset, lanes) => {
|
|
3950
|
+
return this.range = measurements.length > 0 && outerSize > 0 ? calculateRange({
|
|
3951
|
+
measurements,
|
|
3952
|
+
outerSize,
|
|
3953
|
+
scrollOffset,
|
|
3954
|
+
lanes
|
|
3955
|
+
}) : null;
|
|
3956
|
+
}, {
|
|
3957
|
+
key: process.env.NODE_ENV !== "production" && "calculateRange",
|
|
3958
|
+
debug: () => this.options.debug
|
|
3959
|
+
});
|
|
3960
|
+
this.getVirtualIndexes = memo$1(() => {
|
|
3961
|
+
let startIndex = null;
|
|
3962
|
+
let endIndex = null;
|
|
3963
|
+
const range = this.calculateRange();
|
|
3964
|
+
if (range) {
|
|
3965
|
+
startIndex = range.startIndex;
|
|
3966
|
+
endIndex = range.endIndex;
|
|
3967
|
+
}
|
|
3968
|
+
this.maybeNotify.updateDeps([
|
|
3969
|
+
this.isScrolling,
|
|
3970
|
+
startIndex,
|
|
3971
|
+
endIndex
|
|
3972
|
+
]);
|
|
3973
|
+
return [
|
|
3974
|
+
this.options.rangeExtractor,
|
|
3975
|
+
this.options.overscan,
|
|
3976
|
+
this.options.count,
|
|
3977
|
+
startIndex,
|
|
3978
|
+
endIndex
|
|
3979
|
+
];
|
|
3980
|
+
}, (rangeExtractor, overscan, count, startIndex, endIndex) => {
|
|
3981
|
+
return startIndex === null || endIndex === null ? [] : rangeExtractor({
|
|
3982
|
+
startIndex,
|
|
3983
|
+
endIndex,
|
|
3984
|
+
overscan,
|
|
3985
|
+
count
|
|
4430
3986
|
});
|
|
4431
|
-
},
|
|
4432
|
-
|
|
4433
|
-
|
|
4434
|
-
})
|
|
4435
|
-
|
|
4436
|
-
|
|
4437
|
-
|
|
4438
|
-
|
|
4439
|
-
|
|
4440
|
-
|
|
4441
|
-
|
|
4442
|
-
|
|
4443
|
-
function sidecar(importer, errorComponent) {
|
|
4444
|
-
var ErrorCase = function() {
|
|
4445
|
-
return errorComponent;
|
|
3987
|
+
}, {
|
|
3988
|
+
key: process.env.NODE_ENV !== "production" && "getVirtualIndexes",
|
|
3989
|
+
debug: () => this.options.debug
|
|
3990
|
+
});
|
|
3991
|
+
this.indexFromElement = (node) => {
|
|
3992
|
+
const attributeName = this.options.indexAttribute;
|
|
3993
|
+
const indexStr = node.getAttribute(attributeName);
|
|
3994
|
+
if (!indexStr) {
|
|
3995
|
+
console.warn(`Missing attribute name '${attributeName}={index}' on measured element.`);
|
|
3996
|
+
return -1;
|
|
3997
|
+
}
|
|
3998
|
+
return parseInt(indexStr, 10);
|
|
4446
3999
|
};
|
|
4447
|
-
|
|
4448
|
-
|
|
4449
|
-
|
|
4450
|
-
|
|
4000
|
+
this._measureElement = (node, entry) => {
|
|
4001
|
+
const index = this.indexFromElement(node);
|
|
4002
|
+
const item = this.measurementsCache[index];
|
|
4003
|
+
if (!item) return;
|
|
4004
|
+
const key = item.key;
|
|
4005
|
+
const prevNode = this.elementsCache.get(key);
|
|
4006
|
+
if (prevNode !== node) {
|
|
4007
|
+
if (prevNode) this.observer.unobserve(prevNode);
|
|
4008
|
+
this.observer.observe(node);
|
|
4009
|
+
this.elementsCache.set(key, node);
|
|
4010
|
+
}
|
|
4011
|
+
if (node.isConnected) this.resizeItem(index, this.options.measureElement(node, entry, this));
|
|
4451
4012
|
};
|
|
4452
|
-
|
|
4453
|
-
|
|
4454
|
-
|
|
4455
|
-
|
|
4456
|
-
|
|
4457
|
-
|
|
4458
|
-
|
|
4459
|
-
|
|
4460
|
-
|
|
4461
|
-
|
|
4462
|
-
} };
|
|
4463
|
-
var setConfig = function(conf) {
|
|
4464
|
-
Object.assign(exports.config, conf);
|
|
4465
|
-
};
|
|
4466
|
-
exports.setConfig = setConfig;
|
|
4467
|
-
}));
|
|
4468
|
-
//#endregion
|
|
4469
|
-
//#region ../../node_modules/.pnpm/use-sidecar@1.1.3_@types+react@19.2.14_react@19.2.6/node_modules/use-sidecar/dist/es5/medium.js
|
|
4470
|
-
var require_medium$1 = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
4471
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4472
|
-
exports.createSidecarMedium = exports.createMedium = void 0;
|
|
4473
|
-
var tslib_1 = (init_tslib_es6(), __toCommonJS(tslib_es6_exports));
|
|
4474
|
-
function ItoI(a) {
|
|
4475
|
-
return a;
|
|
4476
|
-
}
|
|
4477
|
-
function innerCreateMedium(defaults, middleware) {
|
|
4478
|
-
if (middleware === void 0) middleware = ItoI;
|
|
4479
|
-
var buffer = [];
|
|
4480
|
-
var assigned = false;
|
|
4481
|
-
return {
|
|
4482
|
-
read: function() {
|
|
4483
|
-
if (assigned) throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");
|
|
4484
|
-
if (buffer.length) return buffer[buffer.length - 1];
|
|
4485
|
-
return defaults;
|
|
4486
|
-
},
|
|
4487
|
-
useMedium: function(data) {
|
|
4488
|
-
var item = middleware(data, assigned);
|
|
4489
|
-
buffer.push(item);
|
|
4490
|
-
return function() {
|
|
4491
|
-
buffer = buffer.filter(function(x) {
|
|
4492
|
-
return x !== item;
|
|
4013
|
+
this.resizeItem = (index, size) => {
|
|
4014
|
+
const item = this.measurementsCache[index];
|
|
4015
|
+
if (!item) return;
|
|
4016
|
+
const delta = size - (this.itemSizeCache.get(item.key) ?? item.size);
|
|
4017
|
+
if (delta !== 0) {
|
|
4018
|
+
if (this.shouldAdjustScrollPositionOnItemSizeChange !== void 0 ? this.shouldAdjustScrollPositionOnItemSizeChange(item, delta, this) : item.start < this.getScrollOffset() + this.scrollAdjustments) {
|
|
4019
|
+
if (process.env.NODE_ENV !== "production" && this.options.debug) console.info("correction", delta);
|
|
4020
|
+
this._scrollToOffset(this.getScrollOffset(), {
|
|
4021
|
+
adjustments: this.scrollAdjustments += delta,
|
|
4022
|
+
behavior: void 0
|
|
4493
4023
|
});
|
|
4494
|
-
};
|
|
4495
|
-
},
|
|
4496
|
-
assignSyncMedium: function(cb) {
|
|
4497
|
-
assigned = true;
|
|
4498
|
-
while (buffer.length) {
|
|
4499
|
-
var cbs = buffer;
|
|
4500
|
-
buffer = [];
|
|
4501
|
-
cbs.forEach(cb);
|
|
4502
4024
|
}
|
|
4503
|
-
|
|
4504
|
-
|
|
4505
|
-
|
|
4506
|
-
},
|
|
4507
|
-
filter: function() {
|
|
4508
|
-
return buffer;
|
|
4509
|
-
}
|
|
4510
|
-
};
|
|
4511
|
-
},
|
|
4512
|
-
assignMedium: function(cb) {
|
|
4513
|
-
assigned = true;
|
|
4514
|
-
var pendingQueue = [];
|
|
4515
|
-
if (buffer.length) {
|
|
4516
|
-
var cbs = buffer;
|
|
4517
|
-
buffer = [];
|
|
4518
|
-
cbs.forEach(cb);
|
|
4519
|
-
pendingQueue = buffer;
|
|
4520
|
-
}
|
|
4521
|
-
var executeQueue = function() {
|
|
4522
|
-
var cbs = pendingQueue;
|
|
4523
|
-
pendingQueue = [];
|
|
4524
|
-
cbs.forEach(cb);
|
|
4525
|
-
};
|
|
4526
|
-
var cycle = function() {
|
|
4527
|
-
return Promise.resolve().then(executeQueue);
|
|
4528
|
-
};
|
|
4529
|
-
cycle();
|
|
4530
|
-
buffer = {
|
|
4531
|
-
push: function(x) {
|
|
4532
|
-
pendingQueue.push(x);
|
|
4533
|
-
cycle();
|
|
4534
|
-
},
|
|
4535
|
-
filter: function(filter) {
|
|
4536
|
-
pendingQueue = pendingQueue.filter(filter);
|
|
4537
|
-
return buffer;
|
|
4538
|
-
}
|
|
4539
|
-
};
|
|
4025
|
+
this.pendingMeasuredCacheIndexes.push(item.index);
|
|
4026
|
+
this.itemSizeCache = new Map(this.itemSizeCache.set(item.key, size));
|
|
4027
|
+
this.notify(false);
|
|
4540
4028
|
}
|
|
4541
4029
|
};
|
|
4542
|
-
|
|
4543
|
-
|
|
4544
|
-
|
|
4545
|
-
|
|
4546
|
-
|
|
4547
|
-
|
|
4548
|
-
|
|
4549
|
-
if (options === void 0) options = {};
|
|
4550
|
-
var medium = innerCreateMedium(null);
|
|
4551
|
-
medium.options = tslib_1.__assign({
|
|
4552
|
-
async: true,
|
|
4553
|
-
ssr: false
|
|
4554
|
-
}, options);
|
|
4555
|
-
return medium;
|
|
4556
|
-
}
|
|
4557
|
-
exports.createSidecarMedium = createSidecarMedium;
|
|
4558
|
-
}));
|
|
4559
|
-
//#endregion
|
|
4560
|
-
//#region ../../node_modules/.pnpm/use-sidecar@1.1.3_@types+react@19.2.14_react@19.2.6/node_modules/use-sidecar/dist/es5/renderProp.js
|
|
4561
|
-
var require_renderProp = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
4562
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4563
|
-
exports.renderCar = void 0;
|
|
4564
|
-
var tslib_1 = (init_tslib_es6(), __toCommonJS(tslib_es6_exports));
|
|
4565
|
-
var React$7 = tslib_1.__importStar(__require("react"));
|
|
4566
|
-
var react_1 = __require("react");
|
|
4567
|
-
function renderCar(WrappedComponent, defaults) {
|
|
4568
|
-
function State(_a) {
|
|
4569
|
-
var stateRef = _a.stateRef, props = _a.props;
|
|
4570
|
-
var renderTarget = (0, react_1.useCallback)(function SideTarget() {
|
|
4571
|
-
var args = [];
|
|
4572
|
-
for (var _i = 0; _i < arguments.length; _i++) args[_i] = arguments[_i];
|
|
4573
|
-
(0, react_1.useLayoutEffect)(function() {
|
|
4574
|
-
stateRef.current(args);
|
|
4030
|
+
this.measureElement = (node) => {
|
|
4031
|
+
if (!node) {
|
|
4032
|
+
this.elementsCache.forEach((cached, key) => {
|
|
4033
|
+
if (!cached.isConnected) {
|
|
4034
|
+
this.observer.unobserve(cached);
|
|
4035
|
+
this.elementsCache.delete(key);
|
|
4036
|
+
}
|
|
4575
4037
|
});
|
|
4576
|
-
return
|
|
4577
|
-
}
|
|
4578
|
-
|
|
4579
|
-
}
|
|
4580
|
-
|
|
4581
|
-
|
|
4582
|
-
|
|
4583
|
-
|
|
4584
|
-
|
|
4585
|
-
}
|
|
4586
|
-
return
|
|
4587
|
-
},
|
|
4588
|
-
|
|
4038
|
+
return;
|
|
4039
|
+
}
|
|
4040
|
+
this._measureElement(node, void 0);
|
|
4041
|
+
};
|
|
4042
|
+
this.getVirtualItems = memo$1(() => [this.getVirtualIndexes(), this.getMeasurements()], (indexes, measurements) => {
|
|
4043
|
+
const virtualItems = [];
|
|
4044
|
+
for (let k = 0, len = indexes.length; k < len; k++) {
|
|
4045
|
+
const measurement = measurements[indexes[k]];
|
|
4046
|
+
virtualItems.push(measurement);
|
|
4047
|
+
}
|
|
4048
|
+
return virtualItems;
|
|
4049
|
+
}, {
|
|
4050
|
+
key: process.env.NODE_ENV !== "production" && "getVirtualItems",
|
|
4051
|
+
debug: () => this.options.debug
|
|
4589
4052
|
});
|
|
4590
|
-
|
|
4591
|
-
|
|
4592
|
-
|
|
4593
|
-
|
|
4053
|
+
this.getVirtualItemForOffset = (offset) => {
|
|
4054
|
+
const measurements = this.getMeasurements();
|
|
4055
|
+
if (measurements.length === 0) return;
|
|
4056
|
+
return notUndefined(measurements[findNearestBinarySearch(0, measurements.length - 1, (index) => notUndefined(measurements[index]).start, offset)]);
|
|
4057
|
+
};
|
|
4058
|
+
this.getMaxScrollOffset = () => {
|
|
4059
|
+
if (!this.scrollElement) return 0;
|
|
4060
|
+
if ("scrollHeight" in this.scrollElement) return this.options.horizontal ? this.scrollElement.scrollWidth - this.scrollElement.clientWidth : this.scrollElement.scrollHeight - this.scrollElement.clientHeight;
|
|
4061
|
+
else {
|
|
4062
|
+
const doc = this.scrollElement.document.documentElement;
|
|
4063
|
+
return this.options.horizontal ? doc.scrollWidth - this.scrollElement.innerWidth : doc.scrollHeight - this.scrollElement.innerHeight;
|
|
4064
|
+
}
|
|
4065
|
+
};
|
|
4066
|
+
this.getOffsetForAlignment = (toOffset, align, itemSize = 0) => {
|
|
4067
|
+
if (!this.scrollElement) return 0;
|
|
4068
|
+
const size = this.getSize();
|
|
4069
|
+
const scrollOffset = this.getScrollOffset();
|
|
4070
|
+
if (align === "auto") align = toOffset >= scrollOffset + size ? "end" : "start";
|
|
4071
|
+
if (align === "center") toOffset += (itemSize - size) / 2;
|
|
4072
|
+
else if (align === "end") toOffset -= size;
|
|
4073
|
+
const maxOffset = this.getMaxScrollOffset();
|
|
4074
|
+
return Math.max(Math.min(maxOffset, toOffset), 0);
|
|
4075
|
+
};
|
|
4076
|
+
this.getOffsetForIndex = (index, align = "auto") => {
|
|
4077
|
+
index = Math.max(0, Math.min(index, this.options.count - 1));
|
|
4078
|
+
const item = this.measurementsCache[index];
|
|
4079
|
+
if (!item) return;
|
|
4080
|
+
const size = this.getSize();
|
|
4081
|
+
const scrollOffset = this.getScrollOffset();
|
|
4082
|
+
if (align === "auto") {
|
|
4083
|
+
if (item.end >= scrollOffset + size - this.options.scrollPaddingEnd) align = "end";
|
|
4084
|
+
else if (item.start <= scrollOffset + this.options.scrollPaddingStart) align = "start";
|
|
4085
|
+
else return [scrollOffset, align];
|
|
4086
|
+
}
|
|
4087
|
+
if (align === "end" && index === this.options.count - 1) return [this.getMaxScrollOffset(), align];
|
|
4088
|
+
const toOffset = align === "end" ? item.end + this.options.scrollPaddingEnd : item.start - this.options.scrollPaddingStart;
|
|
4089
|
+
return [this.getOffsetForAlignment(toOffset, align, item.size), align];
|
|
4090
|
+
};
|
|
4091
|
+
this.isDynamicMode = () => this.elementsCache.size > 0;
|
|
4092
|
+
this.scrollToOffset = (toOffset, { align = "start", behavior } = {}) => {
|
|
4093
|
+
if (behavior === "smooth" && this.isDynamicMode()) console.warn("The `smooth` scroll behavior is not fully supported with dynamic size.");
|
|
4094
|
+
this._scrollToOffset(this.getOffsetForAlignment(toOffset, align), {
|
|
4095
|
+
adjustments: void 0,
|
|
4096
|
+
behavior
|
|
4594
4097
|
});
|
|
4595
|
-
return React$7.createElement(React$7.Fragment, null, React$7.createElement(State, {
|
|
4596
|
-
stateRef: ref,
|
|
4597
|
-
props
|
|
4598
|
-
}), React$7.createElement(Children, {
|
|
4599
|
-
stateRef: ref,
|
|
4600
|
-
defaultState,
|
|
4601
|
-
children: props.children
|
|
4602
|
-
}));
|
|
4603
4098
|
};
|
|
4604
|
-
|
|
4605
|
-
|
|
4606
|
-
|
|
4607
|
-
|
|
4608
|
-
|
|
4609
|
-
|
|
4610
|
-
|
|
4611
|
-
|
|
4612
|
-
|
|
4613
|
-
|
|
4614
|
-
|
|
4615
|
-
|
|
4616
|
-
if (!sideCar) throw new Error("Sidecar: please provide `sideCar` property to import the right car");
|
|
4617
|
-
var Target = sideCar.read();
|
|
4618
|
-
if (!Target) throw new Error("Sidecar medium not found");
|
|
4619
|
-
return React$6.createElement(Target, tslib_1.__assign({}, rest));
|
|
4620
|
-
};
|
|
4621
|
-
SideCar.isSideCarExport = true;
|
|
4622
|
-
function exportSidecar(medium, exported) {
|
|
4623
|
-
medium.useMedium(exported);
|
|
4624
|
-
return SideCar;
|
|
4625
|
-
}
|
|
4626
|
-
exports.exportSidecar = exportSidecar;
|
|
4627
|
-
}));
|
|
4628
|
-
//#endregion
|
|
4629
|
-
//#region ../../node_modules/.pnpm/use-sidecar@1.1.3_@types+react@19.2.14_react@19.2.6/node_modules/use-sidecar/dist/es5/index.js
|
|
4630
|
-
var require_es5$4 = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
4631
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4632
|
-
exports.exportSidecar = exports.renderCar = exports.createSidecarMedium = exports.createMedium = exports.setConfig = exports.useSidecar = exports.sidecar = void 0;
|
|
4633
|
-
var hoc_1 = require_hoc();
|
|
4634
|
-
Object.defineProperty(exports, "sidecar", {
|
|
4635
|
-
enumerable: true,
|
|
4636
|
-
get: function() {
|
|
4637
|
-
return hoc_1.sidecar;
|
|
4638
|
-
}
|
|
4639
|
-
});
|
|
4640
|
-
var hook_1 = require_hook$1();
|
|
4641
|
-
Object.defineProperty(exports, "useSidecar", {
|
|
4642
|
-
enumerable: true,
|
|
4643
|
-
get: function() {
|
|
4644
|
-
return hook_1.useSidecar;
|
|
4645
|
-
}
|
|
4646
|
-
});
|
|
4647
|
-
var config_1 = require_config();
|
|
4648
|
-
Object.defineProperty(exports, "setConfig", {
|
|
4649
|
-
enumerable: true,
|
|
4650
|
-
get: function() {
|
|
4651
|
-
return config_1.setConfig;
|
|
4652
|
-
}
|
|
4653
|
-
});
|
|
4654
|
-
var medium_1 = require_medium$1();
|
|
4655
|
-
Object.defineProperty(exports, "createMedium", {
|
|
4656
|
-
enumerable: true,
|
|
4657
|
-
get: function() {
|
|
4658
|
-
return medium_1.createMedium;
|
|
4659
|
-
}
|
|
4660
|
-
});
|
|
4661
|
-
Object.defineProperty(exports, "createSidecarMedium", {
|
|
4662
|
-
enumerable: true,
|
|
4663
|
-
get: function() {
|
|
4664
|
-
return medium_1.createSidecarMedium;
|
|
4665
|
-
}
|
|
4666
|
-
});
|
|
4667
|
-
var renderProp_1 = require_renderProp();
|
|
4668
|
-
Object.defineProperty(exports, "renderCar", {
|
|
4669
|
-
enumerable: true,
|
|
4670
|
-
get: function() {
|
|
4671
|
-
return renderProp_1.renderCar;
|
|
4672
|
-
}
|
|
4673
|
-
});
|
|
4674
|
-
var exports_1 = require_exports();
|
|
4675
|
-
Object.defineProperty(exports, "exportSidecar", {
|
|
4676
|
-
enumerable: true,
|
|
4677
|
-
get: function() {
|
|
4678
|
-
return exports_1.exportSidecar;
|
|
4679
|
-
}
|
|
4680
|
-
});
|
|
4681
|
-
}));
|
|
4682
|
-
//#endregion
|
|
4683
|
-
//#region ../../node_modules/.pnpm/react-remove-scroll@2.7.2_@types+react@19.2.14_react@19.2.6/node_modules/react-remove-scroll/dist/es5/medium.js
|
|
4684
|
-
var require_medium = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
4685
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4686
|
-
exports.effectCar = void 0;
|
|
4687
|
-
exports.effectCar = (0, require_es5$4().createSidecarMedium)();
|
|
4688
|
-
}));
|
|
4689
|
-
//#endregion
|
|
4690
|
-
//#region ../../node_modules/.pnpm/react-remove-scroll@2.7.2_@types+react@19.2.14_react@19.2.6/node_modules/react-remove-scroll/dist/es5/UI.js
|
|
4691
|
-
var require_UI = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
4692
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4693
|
-
exports.RemoveScroll = void 0;
|
|
4694
|
-
var tslib_1 = (init_tslib_es6(), __toCommonJS(tslib_es6_exports));
|
|
4695
|
-
var React$5 = tslib_1.__importStar(__require("react"));
|
|
4696
|
-
var constants_1 = require_constants();
|
|
4697
|
-
var use_callback_ref_1 = require_es5$5();
|
|
4698
|
-
var medium_1 = require_medium();
|
|
4699
|
-
var nothing = function() {};
|
|
4700
|
-
/**
|
|
4701
|
-
* Removes scrollbar from the page and contain the scroll within the Lock
|
|
4702
|
-
*/
|
|
4703
|
-
var RemoveScroll = React$5.forwardRef(function(props, parentRef) {
|
|
4704
|
-
var ref = React$5.useRef(null);
|
|
4705
|
-
var _a = React$5.useState({
|
|
4706
|
-
onScrollCapture: nothing,
|
|
4707
|
-
onWheelCapture: nothing,
|
|
4708
|
-
onTouchMoveCapture: nothing
|
|
4709
|
-
}), callbacks = _a[0], setCallbacks = _a[1];
|
|
4710
|
-
var forwardProps = props.forwardProps, children = props.children, className = props.className, removeScrollBar = props.removeScrollBar, enabled = props.enabled, shards = props.shards, sideCar = props.sideCar, noRelative = props.noRelative, noIsolation = props.noIsolation, inert = props.inert, allowPinchZoom = props.allowPinchZoom, _b = props.as, Container = _b === void 0 ? "div" : _b, gapMode = props.gapMode, rest = tslib_1.__rest(props, [
|
|
4711
|
-
"forwardProps",
|
|
4712
|
-
"children",
|
|
4713
|
-
"className",
|
|
4714
|
-
"removeScrollBar",
|
|
4715
|
-
"enabled",
|
|
4716
|
-
"shards",
|
|
4717
|
-
"sideCar",
|
|
4718
|
-
"noRelative",
|
|
4719
|
-
"noIsolation",
|
|
4720
|
-
"inert",
|
|
4721
|
-
"allowPinchZoom",
|
|
4722
|
-
"as",
|
|
4723
|
-
"gapMode"
|
|
4724
|
-
]);
|
|
4725
|
-
var SideCar = sideCar;
|
|
4726
|
-
var containerRef = (0, use_callback_ref_1.useMergeRefs)([ref, parentRef]);
|
|
4727
|
-
var containerProps = tslib_1.__assign(tslib_1.__assign({}, rest), callbacks);
|
|
4728
|
-
return React$5.createElement(React$5.Fragment, null, enabled && React$5.createElement(SideCar, {
|
|
4729
|
-
sideCar: medium_1.effectCar,
|
|
4730
|
-
removeScrollBar,
|
|
4731
|
-
shards,
|
|
4732
|
-
noRelative,
|
|
4733
|
-
noIsolation,
|
|
4734
|
-
inert,
|
|
4735
|
-
setCallbacks,
|
|
4736
|
-
allowPinchZoom: !!allowPinchZoom,
|
|
4737
|
-
lockRef: ref,
|
|
4738
|
-
gapMode
|
|
4739
|
-
}), forwardProps ? React$5.cloneElement(React$5.Children.only(children), tslib_1.__assign(tslib_1.__assign({}, containerProps), { ref: containerRef })) : React$5.createElement(Container, tslib_1.__assign({}, containerProps, {
|
|
4740
|
-
className,
|
|
4741
|
-
ref: containerRef
|
|
4742
|
-
}), children));
|
|
4743
|
-
});
|
|
4744
|
-
exports.RemoveScroll = RemoveScroll;
|
|
4745
|
-
RemoveScroll.defaultProps = {
|
|
4746
|
-
enabled: true,
|
|
4747
|
-
removeScrollBar: true,
|
|
4748
|
-
inert: false
|
|
4749
|
-
};
|
|
4750
|
-
RemoveScroll.classNames = {
|
|
4751
|
-
fullWidth: constants_1.fullWidthClassName,
|
|
4752
|
-
zeroRight: constants_1.zeroRightClassName
|
|
4753
|
-
};
|
|
4754
|
-
}));
|
|
4755
|
-
//#endregion
|
|
4756
|
-
//#region ../../node_modules/.pnpm/get-nonce@1.0.1/node_modules/get-nonce/dist/es5/index.js
|
|
4757
|
-
var require_es5$3 = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
4758
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4759
|
-
var currentNonce;
|
|
4760
|
-
exports.setNonce = function(nonce) {
|
|
4761
|
-
currentNonce = nonce;
|
|
4762
|
-
};
|
|
4763
|
-
exports.getNonce = function() {
|
|
4764
|
-
if (currentNonce) return currentNonce;
|
|
4765
|
-
if (typeof __webpack_nonce__ !== "undefined") return __webpack_nonce__;
|
|
4766
|
-
};
|
|
4767
|
-
}));
|
|
4768
|
-
//#endregion
|
|
4769
|
-
//#region ../../node_modules/.pnpm/react-style-singleton@2.2.3_@types+react@19.2.14_react@19.2.6/node_modules/react-style-singleton/dist/es5/singleton.js
|
|
4770
|
-
var require_singleton = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
4771
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4772
|
-
exports.stylesheetSingleton = void 0;
|
|
4773
|
-
var get_nonce_1 = require_es5$3();
|
|
4774
|
-
function makeStyleTag() {
|
|
4775
|
-
if (!document) return null;
|
|
4776
|
-
var tag = document.createElement("style");
|
|
4777
|
-
tag.type = "text/css";
|
|
4778
|
-
var nonce = (0, get_nonce_1.getNonce)();
|
|
4779
|
-
if (nonce) tag.setAttribute("nonce", nonce);
|
|
4780
|
-
return tag;
|
|
4781
|
-
}
|
|
4782
|
-
function injectStyles(tag, css) {
|
|
4783
|
-
if (tag.styleSheet) tag.styleSheet.cssText = css;
|
|
4784
|
-
else tag.appendChild(document.createTextNode(css));
|
|
4785
|
-
}
|
|
4786
|
-
function insertStyleTag(tag) {
|
|
4787
|
-
(document.head || document.getElementsByTagName("head")[0]).appendChild(tag);
|
|
4788
|
-
}
|
|
4789
|
-
var stylesheetSingleton = function() {
|
|
4790
|
-
var counter = 0;
|
|
4791
|
-
var stylesheet = null;
|
|
4792
|
-
return {
|
|
4793
|
-
add: function(style) {
|
|
4794
|
-
if (counter == 0) {
|
|
4795
|
-
if (stylesheet = makeStyleTag()) {
|
|
4796
|
-
injectStyles(stylesheet, style);
|
|
4797
|
-
insertStyleTag(stylesheet);
|
|
4798
|
-
}
|
|
4099
|
+
this.scrollToIndex = (index, { align: initialAlign = "auto", behavior } = {}) => {
|
|
4100
|
+
if (behavior === "smooth" && this.isDynamicMode()) console.warn("The `smooth` scroll behavior is not fully supported with dynamic size.");
|
|
4101
|
+
index = Math.max(0, Math.min(index, this.options.count - 1));
|
|
4102
|
+
this.currentScrollToIndex = index;
|
|
4103
|
+
let attempts = 0;
|
|
4104
|
+
const maxAttempts = 10;
|
|
4105
|
+
const tryScroll = (currentAlign) => {
|
|
4106
|
+
if (!this.targetWindow) return;
|
|
4107
|
+
const offsetInfo = this.getOffsetForIndex(index, currentAlign);
|
|
4108
|
+
if (!offsetInfo) {
|
|
4109
|
+
console.warn("Failed to get offset for index:", index);
|
|
4110
|
+
return;
|
|
4799
4111
|
}
|
|
4800
|
-
|
|
4801
|
-
|
|
4802
|
-
|
|
4803
|
-
|
|
4804
|
-
|
|
4805
|
-
|
|
4806
|
-
|
|
4112
|
+
const [offset, align] = offsetInfo;
|
|
4113
|
+
this._scrollToOffset(offset, {
|
|
4114
|
+
adjustments: void 0,
|
|
4115
|
+
behavior
|
|
4116
|
+
});
|
|
4117
|
+
this.targetWindow.requestAnimationFrame(() => {
|
|
4118
|
+
if (!this.targetWindow) return;
|
|
4119
|
+
const verify = () => {
|
|
4120
|
+
if (this.currentScrollToIndex !== index) return;
|
|
4121
|
+
const currentOffset = this.getScrollOffset();
|
|
4122
|
+
const afterInfo = this.getOffsetForIndex(index, align);
|
|
4123
|
+
if (!afterInfo) {
|
|
4124
|
+
console.warn("Failed to get offset for index:", index);
|
|
4125
|
+
return;
|
|
4126
|
+
}
|
|
4127
|
+
if (!approxEqual(afterInfo[0], currentOffset)) scheduleRetry(align);
|
|
4128
|
+
};
|
|
4129
|
+
if (this.isDynamicMode()) this.targetWindow.requestAnimationFrame(verify);
|
|
4130
|
+
else verify();
|
|
4131
|
+
});
|
|
4132
|
+
};
|
|
4133
|
+
const scheduleRetry = (align) => {
|
|
4134
|
+
if (!this.targetWindow) return;
|
|
4135
|
+
if (this.currentScrollToIndex !== index) return;
|
|
4136
|
+
attempts++;
|
|
4137
|
+
if (attempts < maxAttempts) {
|
|
4138
|
+
if (process.env.NODE_ENV !== "production" && this.options.debug) console.info("Schedule retry", attempts, maxAttempts);
|
|
4139
|
+
this.targetWindow.requestAnimationFrame(() => tryScroll(align));
|
|
4140
|
+
} else console.warn(`Failed to scroll to index ${index} after ${maxAttempts} attempts.`);
|
|
4141
|
+
};
|
|
4142
|
+
tryScroll(initialAlign);
|
|
4143
|
+
};
|
|
4144
|
+
this.scrollBy = (delta, { behavior } = {}) => {
|
|
4145
|
+
if (behavior === "smooth" && this.isDynamicMode()) console.warn("The `smooth` scroll behavior is not fully supported with dynamic size.");
|
|
4146
|
+
this._scrollToOffset(this.getScrollOffset() + delta, {
|
|
4147
|
+
adjustments: void 0,
|
|
4148
|
+
behavior
|
|
4149
|
+
});
|
|
4150
|
+
};
|
|
4151
|
+
this.getTotalSize = () => {
|
|
4152
|
+
var _a;
|
|
4153
|
+
const measurements = this.getMeasurements();
|
|
4154
|
+
let end;
|
|
4155
|
+
if (measurements.length === 0) end = this.options.paddingStart;
|
|
4156
|
+
else if (this.options.lanes === 1) end = ((_a = measurements[measurements.length - 1]) == null ? void 0 : _a.end) ?? 0;
|
|
4157
|
+
else {
|
|
4158
|
+
const endByLane = Array(this.options.lanes).fill(null);
|
|
4159
|
+
let endIndex = measurements.length - 1;
|
|
4160
|
+
while (endIndex >= 0 && endByLane.some((val) => val === null)) {
|
|
4161
|
+
const item = measurements[endIndex];
|
|
4162
|
+
if (endByLane[item.lane] === null) endByLane[item.lane] = item.end;
|
|
4163
|
+
endIndex--;
|
|
4807
4164
|
}
|
|
4165
|
+
end = Math.max(...endByLane.filter((val) => val !== null));
|
|
4808
4166
|
}
|
|
4167
|
+
return Math.max(end - this.options.scrollMargin + this.options.paddingEnd, 0);
|
|
4809
4168
|
};
|
|
4810
|
-
|
|
4811
|
-
|
|
4812
|
-
|
|
4813
|
-
|
|
4814
|
-
|
|
4815
|
-
var require_hook = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
4816
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4817
|
-
exports.styleHookSingleton = void 0;
|
|
4818
|
-
var React$4 = (init_tslib_es6(), __toCommonJS(tslib_es6_exports)).__importStar(__require("react"));
|
|
4819
|
-
var singleton_1 = require_singleton();
|
|
4820
|
-
/**
|
|
4821
|
-
* creates a hook to control style singleton
|
|
4822
|
-
* @see {@link styleSingleton} for a safer component version
|
|
4823
|
-
* @example
|
|
4824
|
-
* ```tsx
|
|
4825
|
-
* const useStyle = styleHookSingleton();
|
|
4826
|
-
* ///
|
|
4827
|
-
* useStyle('body { overflow: hidden}');
|
|
4828
|
-
*/
|
|
4829
|
-
var styleHookSingleton = function() {
|
|
4830
|
-
var sheet = (0, singleton_1.stylesheetSingleton)();
|
|
4831
|
-
return function(styles, isDynamic) {
|
|
4832
|
-
React$4.useEffect(function() {
|
|
4833
|
-
sheet.add(styles);
|
|
4834
|
-
return function() {
|
|
4835
|
-
sheet.remove();
|
|
4836
|
-
};
|
|
4837
|
-
}, [styles && isDynamic]);
|
|
4169
|
+
this._scrollToOffset = (offset, { adjustments, behavior }) => {
|
|
4170
|
+
this.options.scrollToFn(offset, {
|
|
4171
|
+
behavior,
|
|
4172
|
+
adjustments
|
|
4173
|
+
}, this);
|
|
4838
4174
|
};
|
|
4839
|
-
|
|
4840
|
-
|
|
4841
|
-
|
|
4842
|
-
|
|
4843
|
-
//#region ../../node_modules/.pnpm/react-style-singleton@2.2.3_@types+react@19.2.14_react@19.2.6/node_modules/react-style-singleton/dist/es5/component.js
|
|
4844
|
-
var require_component$1 = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
4845
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4846
|
-
exports.styleSingleton = void 0;
|
|
4847
|
-
var hook_1 = require_hook();
|
|
4848
|
-
/**
|
|
4849
|
-
* create a Component to add styles on demand
|
|
4850
|
-
* - styles are added when first instance is mounted
|
|
4851
|
-
* - styles are removed when the last instance is unmounted
|
|
4852
|
-
* - changing styles in runtime does nothing unless dynamic is set. But with multiple components that can lead to the undefined behavior
|
|
4853
|
-
*/
|
|
4854
|
-
var styleSingleton = function() {
|
|
4855
|
-
var useStyle = (0, hook_1.styleHookSingleton)();
|
|
4856
|
-
var Sheet = function(_a) {
|
|
4857
|
-
var styles = _a.styles, dynamic = _a.dynamic;
|
|
4858
|
-
useStyle(styles, dynamic);
|
|
4859
|
-
return null;
|
|
4175
|
+
this.measure = () => {
|
|
4176
|
+
this.itemSizeCache = /* @__PURE__ */ new Map();
|
|
4177
|
+
this.laneAssignments = /* @__PURE__ */ new Map();
|
|
4178
|
+
this.notify(false);
|
|
4860
4179
|
};
|
|
4861
|
-
|
|
4180
|
+
this.setOptions(opts);
|
|
4181
|
+
}
|
|
4182
|
+
};
|
|
4183
|
+
const findNearestBinarySearch = (low, high, getCurrentValue, value) => {
|
|
4184
|
+
while (low <= high) {
|
|
4185
|
+
const middle = (low + high) / 2 | 0;
|
|
4186
|
+
const currentValue = getCurrentValue(middle);
|
|
4187
|
+
if (currentValue < value) low = middle + 1;
|
|
4188
|
+
else if (currentValue > value) high = middle - 1;
|
|
4189
|
+
else return middle;
|
|
4190
|
+
}
|
|
4191
|
+
if (low > 0) return low - 1;
|
|
4192
|
+
else return 0;
|
|
4193
|
+
};
|
|
4194
|
+
function calculateRange({ measurements, outerSize, scrollOffset, lanes }) {
|
|
4195
|
+
const lastIndex = measurements.length - 1;
|
|
4196
|
+
const getOffset = (index) => measurements[index].start;
|
|
4197
|
+
if (measurements.length <= lanes) return {
|
|
4198
|
+
startIndex: 0,
|
|
4199
|
+
endIndex: lastIndex
|
|
4862
4200
|
};
|
|
4863
|
-
|
|
4864
|
-
|
|
4865
|
-
|
|
4866
|
-
|
|
4867
|
-
|
|
4868
|
-
|
|
4869
|
-
|
|
4870
|
-
|
|
4871
|
-
|
|
4872
|
-
enumerable: true,
|
|
4873
|
-
get: function() {
|
|
4874
|
-
return component_1.styleSingleton;
|
|
4875
|
-
}
|
|
4876
|
-
});
|
|
4877
|
-
var singleton_1 = require_singleton();
|
|
4878
|
-
Object.defineProperty(exports, "stylesheetSingleton", {
|
|
4879
|
-
enumerable: true,
|
|
4880
|
-
get: function() {
|
|
4881
|
-
return singleton_1.stylesheetSingleton;
|
|
4201
|
+
let startIndex = findNearestBinarySearch(0, lastIndex, getOffset, scrollOffset);
|
|
4202
|
+
let endIndex = startIndex;
|
|
4203
|
+
if (lanes === 1) while (endIndex < lastIndex && measurements[endIndex].end < scrollOffset + outerSize) endIndex++;
|
|
4204
|
+
else if (lanes > 1) {
|
|
4205
|
+
const endPerLane = Array(lanes).fill(0);
|
|
4206
|
+
while (endIndex < lastIndex && endPerLane.some((pos) => pos < scrollOffset + outerSize)) {
|
|
4207
|
+
const item = measurements[endIndex];
|
|
4208
|
+
endPerLane[item.lane] = item.end;
|
|
4209
|
+
endIndex++;
|
|
4882
4210
|
}
|
|
4883
|
-
|
|
4884
|
-
|
|
4885
|
-
|
|
4886
|
-
|
|
4887
|
-
|
|
4888
|
-
return hook_1.styleHookSingleton;
|
|
4211
|
+
const startPerLane = Array(lanes).fill(scrollOffset + outerSize);
|
|
4212
|
+
while (startIndex >= 0 && startPerLane.some((pos) => pos >= scrollOffset)) {
|
|
4213
|
+
const item = measurements[startIndex];
|
|
4214
|
+
startPerLane[item.lane] = item.start;
|
|
4215
|
+
startIndex--;
|
|
4889
4216
|
}
|
|
4890
|
-
|
|
4891
|
-
|
|
4892
|
-
|
|
4893
|
-
|
|
4894
|
-
|
|
4895
|
-
|
|
4896
|
-
exports.getGapWidth = exports.zeroGap = void 0;
|
|
4897
|
-
exports.zeroGap = {
|
|
4898
|
-
left: 0,
|
|
4899
|
-
top: 0,
|
|
4900
|
-
right: 0,
|
|
4901
|
-
gap: 0
|
|
4902
|
-
};
|
|
4903
|
-
var parse = function(x) {
|
|
4904
|
-
return parseInt(x || "", 10) || 0;
|
|
4905
|
-
};
|
|
4906
|
-
var getOffset = function(gapMode) {
|
|
4907
|
-
var cs = window.getComputedStyle(document.body);
|
|
4908
|
-
var left = cs[gapMode === "padding" ? "paddingLeft" : "marginLeft"];
|
|
4909
|
-
var top = cs[gapMode === "padding" ? "paddingTop" : "marginTop"];
|
|
4910
|
-
var right = cs[gapMode === "padding" ? "paddingRight" : "marginRight"];
|
|
4911
|
-
return [
|
|
4912
|
-
parse(left),
|
|
4913
|
-
parse(top),
|
|
4914
|
-
parse(right)
|
|
4915
|
-
];
|
|
4916
|
-
};
|
|
4917
|
-
var getGapWidth = function(gapMode) {
|
|
4918
|
-
if (gapMode === void 0) gapMode = "margin";
|
|
4919
|
-
if (typeof window === "undefined") return exports.zeroGap;
|
|
4920
|
-
var offsets = getOffset(gapMode);
|
|
4921
|
-
var documentWidth = document.documentElement.clientWidth;
|
|
4922
|
-
var windowWidth = window.innerWidth;
|
|
4923
|
-
return {
|
|
4924
|
-
left: offsets[0],
|
|
4925
|
-
top: offsets[1],
|
|
4926
|
-
right: offsets[2],
|
|
4927
|
-
gap: Math.max(0, windowWidth - documentWidth + offsets[2] - offsets[0])
|
|
4928
|
-
};
|
|
4929
|
-
};
|
|
4930
|
-
exports.getGapWidth = getGapWidth;
|
|
4931
|
-
}));
|
|
4932
|
-
//#endregion
|
|
4933
|
-
//#region ../../node_modules/.pnpm/react-remove-scroll-bar@2.3.8_@types+react@19.2.14_react@19.2.6/node_modules/react-remove-scroll-bar/dist/es5/component.js
|
|
4934
|
-
var require_component = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
4935
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4936
|
-
exports.RemoveScrollBar = exports.useLockAttribute = exports.lockAttribute = void 0;
|
|
4937
|
-
var React$3 = (init_tslib_es6(), __toCommonJS(tslib_es6_exports)).__importStar(__require("react"));
|
|
4938
|
-
var react_style_singleton_1 = require_es5$2();
|
|
4939
|
-
var constants_1 = require_constants();
|
|
4940
|
-
var utils_1 = require_utils();
|
|
4941
|
-
var Style = (0, react_style_singleton_1.styleSingleton)();
|
|
4942
|
-
exports.lockAttribute = "data-scroll-locked";
|
|
4943
|
-
var getStyles = function(_a, allowRelative, gapMode, important) {
|
|
4944
|
-
var left = _a.left, top = _a.top, right = _a.right, gap = _a.gap;
|
|
4945
|
-
if (gapMode === void 0) gapMode = "margin";
|
|
4946
|
-
return "\n .".concat(constants_1.noScrollbarsClassName, " {\n overflow: hidden ").concat(important, ";\n padding-right: ").concat(gap, "px ").concat(important, ";\n }\n body[").concat(exports.lockAttribute, "] {\n overflow: hidden ").concat(important, ";\n overscroll-behavior: contain;\n ").concat([
|
|
4947
|
-
allowRelative && "position: relative ".concat(important, ";"),
|
|
4948
|
-
gapMode === "margin" && "\n padding-left: ".concat(left, "px;\n padding-top: ").concat(top, "px;\n padding-right: ").concat(right, "px;\n margin-left:0;\n margin-top:0;\n margin-right: ").concat(gap, "px ").concat(important, ";\n "),
|
|
4949
|
-
gapMode === "padding" && "padding-right: ".concat(gap, "px ").concat(important, ";")
|
|
4950
|
-
].filter(Boolean).join(""), "\n }\n \n .").concat(constants_1.zeroRightClassName, " {\n right: ").concat(gap, "px ").concat(important, ";\n }\n \n .").concat(constants_1.fullWidthClassName, " {\n margin-right: ").concat(gap, "px ").concat(important, ";\n }\n \n .").concat(constants_1.zeroRightClassName, " .").concat(constants_1.zeroRightClassName, " {\n right: 0 ").concat(important, ";\n }\n \n .").concat(constants_1.fullWidthClassName, " .").concat(constants_1.fullWidthClassName, " {\n margin-right: 0 ").concat(important, ";\n }\n \n body[").concat(exports.lockAttribute, "] {\n ").concat(constants_1.removedBarSizeVariable, ": ").concat(gap, "px;\n }\n");
|
|
4951
|
-
};
|
|
4952
|
-
var getCurrentUseCounter = function() {
|
|
4953
|
-
var counter = parseInt(document.body.getAttribute(exports.lockAttribute) || "0", 10);
|
|
4954
|
-
return isFinite(counter) ? counter : 0;
|
|
4955
|
-
};
|
|
4956
|
-
var useLockAttribute = function() {
|
|
4957
|
-
React$3.useEffect(function() {
|
|
4958
|
-
document.body.setAttribute(exports.lockAttribute, (getCurrentUseCounter() + 1).toString());
|
|
4959
|
-
return function() {
|
|
4960
|
-
var newCounter = getCurrentUseCounter() - 1;
|
|
4961
|
-
if (newCounter <= 0) document.body.removeAttribute(exports.lockAttribute);
|
|
4962
|
-
else document.body.setAttribute(exports.lockAttribute, newCounter.toString());
|
|
4963
|
-
};
|
|
4964
|
-
}, []);
|
|
4965
|
-
};
|
|
4966
|
-
exports.useLockAttribute = useLockAttribute;
|
|
4967
|
-
/**
|
|
4968
|
-
* Removes page scrollbar and blocks page scroll when mounted
|
|
4969
|
-
*/
|
|
4970
|
-
var RemoveScrollBar = function(_a) {
|
|
4971
|
-
var noRelative = _a.noRelative, noImportant = _a.noImportant, _b = _a.gapMode, gapMode = _b === void 0 ? "margin" : _b;
|
|
4972
|
-
(0, exports.useLockAttribute)();
|
|
4973
|
-
var gap = React$3.useMemo(function() {
|
|
4974
|
-
return (0, utils_1.getGapWidth)(gapMode);
|
|
4975
|
-
}, [gapMode]);
|
|
4976
|
-
return React$3.createElement(Style, { styles: getStyles(gap, !noRelative, gapMode, !noImportant ? "!important" : "") });
|
|
4217
|
+
startIndex = Math.max(0, startIndex - startIndex % lanes);
|
|
4218
|
+
endIndex = Math.min(lastIndex, endIndex + (lanes - 1 - endIndex % lanes));
|
|
4219
|
+
}
|
|
4220
|
+
return {
|
|
4221
|
+
startIndex,
|
|
4222
|
+
endIndex
|
|
4977
4223
|
};
|
|
4978
|
-
|
|
4979
|
-
}));
|
|
4224
|
+
}
|
|
4980
4225
|
//#endregion
|
|
4981
|
-
//#region ../../node_modules/.pnpm
|
|
4982
|
-
|
|
4983
|
-
|
|
4984
|
-
|
|
4985
|
-
|
|
4986
|
-
|
|
4987
|
-
|
|
4988
|
-
|
|
4989
|
-
|
|
4990
|
-
|
|
4991
|
-
|
|
4992
|
-
var constants_1 = require_constants();
|
|
4993
|
-
Object.defineProperty(exports, "zeroRightClassName", {
|
|
4994
|
-
enumerable: true,
|
|
4995
|
-
get: function() {
|
|
4996
|
-
return constants_1.zeroRightClassName;
|
|
4997
|
-
}
|
|
4998
|
-
});
|
|
4999
|
-
Object.defineProperty(exports, "fullWidthClassName", {
|
|
5000
|
-
enumerable: true,
|
|
5001
|
-
get: function() {
|
|
5002
|
-
return constants_1.fullWidthClassName;
|
|
5003
|
-
}
|
|
5004
|
-
});
|
|
5005
|
-
Object.defineProperty(exports, "noScrollbarsClassName", {
|
|
5006
|
-
enumerable: true,
|
|
5007
|
-
get: function() {
|
|
5008
|
-
return constants_1.noScrollbarsClassName;
|
|
5009
|
-
}
|
|
5010
|
-
});
|
|
5011
|
-
Object.defineProperty(exports, "removedBarSizeVariable", {
|
|
5012
|
-
enumerable: true,
|
|
5013
|
-
get: function() {
|
|
5014
|
-
return constants_1.removedBarSizeVariable;
|
|
4226
|
+
//#region ../../node_modules/.pnpm/@tanstack+react-virtual@3.13.19_react-dom@19.2.6_react@19.2.6__react@19.2.6/node_modules/@tanstack/react-virtual/dist/esm/index.js
|
|
4227
|
+
const useIsomorphicLayoutEffect = typeof document !== "undefined" ? React$1.useLayoutEffect : React$1.useEffect;
|
|
4228
|
+
function useVirtualizerBase({ useFlushSync = true, ...options }) {
|
|
4229
|
+
const rerender = React$1.useReducer(() => ({}), {})[1];
|
|
4230
|
+
const resolvedOptions = {
|
|
4231
|
+
...options,
|
|
4232
|
+
onChange: (instance2, sync) => {
|
|
4233
|
+
var _a;
|
|
4234
|
+
if (useFlushSync && sync) flushSync(rerender);
|
|
4235
|
+
else rerender();
|
|
4236
|
+
(_a = options.onChange) == null || _a.call(options, instance2, sync);
|
|
5015
4237
|
}
|
|
4238
|
+
};
|
|
4239
|
+
const [instance] = React$1.useState(() => new Virtualizer(resolvedOptions));
|
|
4240
|
+
instance.setOptions(resolvedOptions);
|
|
4241
|
+
useIsomorphicLayoutEffect(() => {
|
|
4242
|
+
return instance._didMount();
|
|
4243
|
+
}, []);
|
|
4244
|
+
useIsomorphicLayoutEffect(() => {
|
|
4245
|
+
return instance._willUpdate();
|
|
5016
4246
|
});
|
|
5017
|
-
|
|
5018
|
-
|
|
5019
|
-
|
|
5020
|
-
|
|
5021
|
-
|
|
5022
|
-
|
|
4247
|
+
return instance;
|
|
4248
|
+
}
|
|
4249
|
+
function useVirtualizer(options) {
|
|
4250
|
+
return useVirtualizerBase({
|
|
4251
|
+
observeElementRect,
|
|
4252
|
+
observeElementOffset,
|
|
4253
|
+
scrollToFn: elementScroll,
|
|
4254
|
+
...options
|
|
5023
4255
|
});
|
|
5024
|
-
}
|
|
5025
|
-
//#endregion
|
|
5026
|
-
//#region ../../node_modules/.pnpm/react-remove-scroll@2.7.2_@types+react@19.2.14_react@19.2.6/node_modules/react-remove-scroll/dist/es5/aggresiveCapture.js
|
|
5027
|
-
var require_aggresiveCapture = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
5028
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5029
|
-
exports.nonPassive = void 0;
|
|
5030
|
-
var passiveSupported = false;
|
|
5031
|
-
if (typeof window !== "undefined") try {
|
|
5032
|
-
var options = Object.defineProperty({}, "passive", { get: function() {
|
|
5033
|
-
passiveSupported = true;
|
|
5034
|
-
return true;
|
|
5035
|
-
} });
|
|
5036
|
-
window.addEventListener("test", options, options);
|
|
5037
|
-
window.removeEventListener("test", options, options);
|
|
5038
|
-
} catch (err) {
|
|
5039
|
-
passiveSupported = false;
|
|
5040
|
-
}
|
|
5041
|
-
exports.nonPassive = passiveSupported ? { passive: false } : false;
|
|
5042
|
-
}));
|
|
5043
|
-
//#endregion
|
|
5044
|
-
//#region ../../node_modules/.pnpm/react-remove-scroll@2.7.2_@types+react@19.2.14_react@19.2.6/node_modules/react-remove-scroll/dist/es5/handleScroll.js
|
|
5045
|
-
var require_handleScroll = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
5046
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5047
|
-
exports.handleScroll = exports.locationCouldBeScrolled = void 0;
|
|
5048
|
-
var alwaysContainsScroll = function(node) {
|
|
5049
|
-
return node.tagName === "TEXTAREA";
|
|
5050
|
-
};
|
|
5051
|
-
var elementCanBeScrolled = function(node, overflow) {
|
|
5052
|
-
if (!(node instanceof Element)) return false;
|
|
5053
|
-
var styles = window.getComputedStyle(node);
|
|
5054
|
-
return styles[overflow] !== "hidden" && !(styles.overflowY === styles.overflowX && !alwaysContainsScroll(node) && styles[overflow] === "visible");
|
|
5055
|
-
};
|
|
5056
|
-
var elementCouldBeVScrolled = function(node) {
|
|
5057
|
-
return elementCanBeScrolled(node, "overflowY");
|
|
5058
|
-
};
|
|
5059
|
-
var elementCouldBeHScrolled = function(node) {
|
|
5060
|
-
return elementCanBeScrolled(node, "overflowX");
|
|
5061
|
-
};
|
|
5062
|
-
var locationCouldBeScrolled = function(axis, node) {
|
|
5063
|
-
var ownerDocument = node.ownerDocument;
|
|
5064
|
-
var current = node;
|
|
5065
|
-
do {
|
|
5066
|
-
if (typeof ShadowRoot !== "undefined" && current instanceof ShadowRoot) current = current.host;
|
|
5067
|
-
if (elementCouldBeScrolled(axis, current)) {
|
|
5068
|
-
var _a = getScrollVariables(axis, current);
|
|
5069
|
-
if (_a[1] > _a[2]) return true;
|
|
5070
|
-
}
|
|
5071
|
-
current = current.parentNode;
|
|
5072
|
-
} while (current && current !== ownerDocument.body);
|
|
5073
|
-
return false;
|
|
5074
|
-
};
|
|
5075
|
-
exports.locationCouldBeScrolled = locationCouldBeScrolled;
|
|
5076
|
-
var getVScrollVariables = function(_a) {
|
|
5077
|
-
return [
|
|
5078
|
-
_a.scrollTop,
|
|
5079
|
-
_a.scrollHeight,
|
|
5080
|
-
_a.clientHeight
|
|
5081
|
-
];
|
|
5082
|
-
};
|
|
5083
|
-
var getHScrollVariables = function(_a) {
|
|
5084
|
-
return [
|
|
5085
|
-
_a.scrollLeft,
|
|
5086
|
-
_a.scrollWidth,
|
|
5087
|
-
_a.clientWidth
|
|
5088
|
-
];
|
|
5089
|
-
};
|
|
5090
|
-
var elementCouldBeScrolled = function(axis, node) {
|
|
5091
|
-
return axis === "v" ? elementCouldBeVScrolled(node) : elementCouldBeHScrolled(node);
|
|
5092
|
-
};
|
|
5093
|
-
var getScrollVariables = function(axis, node) {
|
|
5094
|
-
return axis === "v" ? getVScrollVariables(node) : getHScrollVariables(node);
|
|
5095
|
-
};
|
|
5096
|
-
var getDirectionFactor = function(axis, direction) {
|
|
5097
|
-
/**
|
|
5098
|
-
* If the element's direction is rtl (right-to-left), then scrollLeft is 0 when the scrollbar is at its rightmost position,
|
|
5099
|
-
* and then increasingly negative as you scroll towards the end of the content.
|
|
5100
|
-
* @see https://developer.mozilla.org/en-US/docs/Web/API/Element/scrollLeft
|
|
5101
|
-
*/
|
|
5102
|
-
return axis === "h" && direction === "rtl" ? -1 : 1;
|
|
5103
|
-
};
|
|
5104
|
-
var handleScroll = function(axis, endTarget, event, sourceDelta, noOverscroll) {
|
|
5105
|
-
var directionFactor = getDirectionFactor(axis, window.getComputedStyle(endTarget).direction);
|
|
5106
|
-
var delta = directionFactor * sourceDelta;
|
|
5107
|
-
var target = event.target;
|
|
5108
|
-
var targetInLock = endTarget.contains(target);
|
|
5109
|
-
var shouldCancelScroll = false;
|
|
5110
|
-
var isDeltaPositive = delta > 0;
|
|
5111
|
-
var availableScroll = 0;
|
|
5112
|
-
var availableScrollTop = 0;
|
|
5113
|
-
do {
|
|
5114
|
-
if (!target) break;
|
|
5115
|
-
var _a = getScrollVariables(axis, target), position = _a[0];
|
|
5116
|
-
var elementScroll = _a[1] - _a[2] - directionFactor * position;
|
|
5117
|
-
if (position || elementScroll) {
|
|
5118
|
-
if (elementCouldBeScrolled(axis, target)) {
|
|
5119
|
-
availableScroll += elementScroll;
|
|
5120
|
-
availableScrollTop += position;
|
|
5121
|
-
}
|
|
5122
|
-
}
|
|
5123
|
-
var parent_1 = target.parentNode;
|
|
5124
|
-
target = parent_1 && parent_1.nodeType === Node.DOCUMENT_FRAGMENT_NODE ? parent_1.host : parent_1;
|
|
5125
|
-
} while (!targetInLock && target !== document.body || targetInLock && (endTarget.contains(target) || endTarget === target));
|
|
5126
|
-
if (isDeltaPositive && (noOverscroll && Math.abs(availableScroll) < 1 || !noOverscroll && delta > availableScroll)) shouldCancelScroll = true;
|
|
5127
|
-
else if (!isDeltaPositive && (noOverscroll && Math.abs(availableScrollTop) < 1 || !noOverscroll && -delta > availableScrollTop)) shouldCancelScroll = true;
|
|
5128
|
-
return shouldCancelScroll;
|
|
5129
|
-
};
|
|
5130
|
-
exports.handleScroll = handleScroll;
|
|
5131
|
-
}));
|
|
4256
|
+
}
|
|
5132
4257
|
//#endregion
|
|
5133
|
-
//#region
|
|
5134
|
-
|
|
5135
|
-
|
|
5136
|
-
|
|
5137
|
-
|
|
5138
|
-
|
|
5139
|
-
|
|
5140
|
-
|
|
5141
|
-
|
|
5142
|
-
|
|
5143
|
-
|
|
5144
|
-
|
|
5145
|
-
|
|
5146
|
-
|
|
5147
|
-
|
|
5148
|
-
|
|
5149
|
-
|
|
5150
|
-
|
|
5151
|
-
|
|
5152
|
-
|
|
5153
|
-
|
|
5154
|
-
|
|
5155
|
-
|
|
4258
|
+
//#region editors/generic-drive-explorer/components/file-content-view.tsx
|
|
4259
|
+
const GAP = 8;
|
|
4260
|
+
const ITEM_WIDTH = 256;
|
|
4261
|
+
const ITEM_HEIGHT = 48;
|
|
4262
|
+
const USED_SPACE = 420;
|
|
4263
|
+
function FileContentView() {
|
|
4264
|
+
const parentRef = useRef(null);
|
|
4265
|
+
const availableWidth = useWindowSize().innerWidth - USED_SPACE;
|
|
4266
|
+
const fileNodes = useNodesInSelectedDriveOrFolder().filter((n) => isFileNodeKind(n));
|
|
4267
|
+
const columnCount = Math.floor(availableWidth / 264) || 1;
|
|
4268
|
+
const rowVirtualizer = useVirtualizer({
|
|
4269
|
+
count: Math.ceil(fileNodes.length / columnCount),
|
|
4270
|
+
getScrollElement: () => parentRef.current,
|
|
4271
|
+
estimateSize: (index) => {
|
|
4272
|
+
if (index > 0) return 56;
|
|
4273
|
+
return ITEM_HEIGHT;
|
|
4274
|
+
},
|
|
4275
|
+
overscan: 5
|
|
4276
|
+
});
|
|
4277
|
+
const columnVirtualizer = useVirtualizer({
|
|
4278
|
+
horizontal: true,
|
|
4279
|
+
count: columnCount,
|
|
4280
|
+
getScrollElement: () => parentRef.current,
|
|
4281
|
+
estimateSize: (index) => {
|
|
4282
|
+
if (index > 0) return 264;
|
|
4283
|
+
return ITEM_WIDTH;
|
|
4284
|
+
},
|
|
4285
|
+
overscan: 5
|
|
4286
|
+
});
|
|
4287
|
+
const getItemIndex = (rowIndex, columnIndex) => rowIndex * columnCount + columnIndex;
|
|
4288
|
+
const getItem = (rowIndex, columnIndex) => {
|
|
4289
|
+
const index = getItemIndex(rowIndex, columnIndex);
|
|
4290
|
+
return fileNodes[index] || null;
|
|
5156
4291
|
};
|
|
5157
|
-
|
|
5158
|
-
|
|
4292
|
+
if (fileNodes.length === 0) return /* @__PURE__ */ jsx("div", {
|
|
4293
|
+
className: "mb-8 text-sm text-muted-foreground",
|
|
4294
|
+
children: "No documents or files 📄"
|
|
4295
|
+
});
|
|
4296
|
+
const renderItem = (rowIndex, columnIndex) => {
|
|
4297
|
+
const fileNode = getItem(rowIndex, columnIndex);
|
|
4298
|
+
if (!fileNode) return null;
|
|
4299
|
+
return /* @__PURE__ */ jsx("div", {
|
|
4300
|
+
style: { marginLeft: columnIndex === 0 ? 0 : GAP },
|
|
4301
|
+
children: /* @__PURE__ */ jsx(FileItem, { fileNode }, fileNode.id)
|
|
4302
|
+
});
|
|
5159
4303
|
};
|
|
5160
|
-
|
|
5161
|
-
|
|
5162
|
-
|
|
5163
|
-
|
|
5164
|
-
|
|
5165
|
-
|
|
5166
|
-
|
|
5167
|
-
|
|
5168
|
-
|
|
5169
|
-
|
|
5170
|
-
|
|
5171
|
-
|
|
5172
|
-
|
|
5173
|
-
|
|
5174
|
-
|
|
5175
|
-
|
|
5176
|
-
|
|
5177
|
-
|
|
5178
|
-
|
|
5179
|
-
|
|
5180
|
-
|
|
5181
|
-
|
|
5182
|
-
|
|
5183
|
-
|
|
5184
|
-
|
|
5185
|
-
|
|
5186
|
-
|
|
5187
|
-
|
|
5188
|
-
props.lockRef.current,
|
|
5189
|
-
props.shards
|
|
5190
|
-
]);
|
|
5191
|
-
var shouldCancelEvent = React$2.useCallback(function(event, parent) {
|
|
5192
|
-
if ("touches" in event && event.touches.length === 2 || event.type === "wheel" && event.ctrlKey) return !lastProps.current.allowPinchZoom;
|
|
5193
|
-
var touch = (0, exports.getTouchXY)(event);
|
|
5194
|
-
var touchStart = touchStartRef.current;
|
|
5195
|
-
var deltaX = "deltaX" in event ? event.deltaX : touchStart[0] - touch[0];
|
|
5196
|
-
var deltaY = "deltaY" in event ? event.deltaY : touchStart[1] - touch[1];
|
|
5197
|
-
var currentAxis;
|
|
5198
|
-
var target = event.target;
|
|
5199
|
-
var moveDirection = Math.abs(deltaX) > Math.abs(deltaY) ? "h" : "v";
|
|
5200
|
-
if ("touches" in event && moveDirection === "h" && target.type === "range") return false;
|
|
5201
|
-
var selection = window.getSelection();
|
|
5202
|
-
var anchorNode = selection && selection.anchorNode;
|
|
5203
|
-
if (anchorNode ? anchorNode === target || anchorNode.contains(target) : false) return false;
|
|
5204
|
-
var canBeScrolledInMainDirection = (0, handleScroll_1.locationCouldBeScrolled)(moveDirection, target);
|
|
5205
|
-
if (!canBeScrolledInMainDirection) return true;
|
|
5206
|
-
if (canBeScrolledInMainDirection) currentAxis = moveDirection;
|
|
5207
|
-
else {
|
|
5208
|
-
currentAxis = moveDirection === "v" ? "h" : "v";
|
|
5209
|
-
canBeScrolledInMainDirection = (0, handleScroll_1.locationCouldBeScrolled)(moveDirection, target);
|
|
5210
|
-
}
|
|
5211
|
-
if (!canBeScrolledInMainDirection) return false;
|
|
5212
|
-
if (!activeAxis.current && "changedTouches" in event && (deltaX || deltaY)) activeAxis.current = currentAxis;
|
|
5213
|
-
if (!currentAxis) return true;
|
|
5214
|
-
var cancelingAxis = activeAxis.current || currentAxis;
|
|
5215
|
-
return (0, handleScroll_1.handleScroll)(cancelingAxis, parent, event, cancelingAxis === "h" ? deltaX : deltaY, true);
|
|
5216
|
-
}, []);
|
|
5217
|
-
var shouldPrevent = React$2.useCallback(function(_event) {
|
|
5218
|
-
var event = _event;
|
|
5219
|
-
if (!lockStack.length || lockStack[lockStack.length - 1] !== Style) return;
|
|
5220
|
-
var delta = "deltaY" in event ? (0, exports.getDeltaXY)(event) : (0, exports.getTouchXY)(event);
|
|
5221
|
-
var sourceEvent = shouldPreventQueue.current.filter(function(e) {
|
|
5222
|
-
return e.name === event.type && (e.target === event.target || event.target === e.shadowParent) && deltaCompare(e.delta, delta);
|
|
5223
|
-
})[0];
|
|
5224
|
-
if (sourceEvent && sourceEvent.should) {
|
|
5225
|
-
if (event.cancelable) event.preventDefault();
|
|
5226
|
-
return;
|
|
5227
|
-
}
|
|
5228
|
-
if (!sourceEvent) {
|
|
5229
|
-
var shardNodes = (lastProps.current.shards || []).map(extractRef).filter(Boolean).filter(function(node) {
|
|
5230
|
-
return node.contains(event.target);
|
|
5231
|
-
});
|
|
5232
|
-
if (shardNodes.length > 0 ? shouldCancelEvent(event, shardNodes[0]) : !lastProps.current.noIsolation) {
|
|
5233
|
-
if (event.cancelable) event.preventDefault();
|
|
5234
|
-
}
|
|
5235
|
-
}
|
|
5236
|
-
}, []);
|
|
5237
|
-
var shouldCancel = React$2.useCallback(function(name, delta, target, should) {
|
|
5238
|
-
var event = {
|
|
5239
|
-
name,
|
|
5240
|
-
delta,
|
|
5241
|
-
target,
|
|
5242
|
-
should,
|
|
5243
|
-
shadowParent: getOutermostShadowParent(target)
|
|
5244
|
-
};
|
|
5245
|
-
shouldPreventQueue.current.push(event);
|
|
5246
|
-
setTimeout(function() {
|
|
5247
|
-
shouldPreventQueue.current = shouldPreventQueue.current.filter(function(e) {
|
|
5248
|
-
return e !== event;
|
|
5249
|
-
});
|
|
5250
|
-
}, 1);
|
|
5251
|
-
}, []);
|
|
5252
|
-
var scrollTouchStart = React$2.useCallback(function(event) {
|
|
5253
|
-
touchStartRef.current = (0, exports.getTouchXY)(event);
|
|
5254
|
-
activeAxis.current = void 0;
|
|
5255
|
-
}, []);
|
|
5256
|
-
var scrollWheel = React$2.useCallback(function(event) {
|
|
5257
|
-
shouldCancel(event.type, (0, exports.getDeltaXY)(event), event.target, shouldCancelEvent(event, props.lockRef.current));
|
|
5258
|
-
}, []);
|
|
5259
|
-
var scrollTouchMove = React$2.useCallback(function(event) {
|
|
5260
|
-
shouldCancel(event.type, (0, exports.getTouchXY)(event), event.target, shouldCancelEvent(event, props.lockRef.current));
|
|
5261
|
-
}, []);
|
|
5262
|
-
React$2.useEffect(function() {
|
|
5263
|
-
lockStack.push(Style);
|
|
5264
|
-
props.setCallbacks({
|
|
5265
|
-
onScrollCapture: scrollWheel,
|
|
5266
|
-
onWheelCapture: scrollWheel,
|
|
5267
|
-
onTouchMoveCapture: scrollTouchMove
|
|
5268
|
-
});
|
|
5269
|
-
document.addEventListener("wheel", shouldPrevent, aggresiveCapture_1.nonPassive);
|
|
5270
|
-
document.addEventListener("touchmove", shouldPrevent, aggresiveCapture_1.nonPassive);
|
|
5271
|
-
document.addEventListener("touchstart", scrollTouchStart, aggresiveCapture_1.nonPassive);
|
|
5272
|
-
return function() {
|
|
5273
|
-
lockStack = lockStack.filter(function(inst) {
|
|
5274
|
-
return inst !== Style;
|
|
5275
|
-
});
|
|
5276
|
-
document.removeEventListener("wheel", shouldPrevent, aggresiveCapture_1.nonPassive);
|
|
5277
|
-
document.removeEventListener("touchmove", shouldPrevent, aggresiveCapture_1.nonPassive);
|
|
5278
|
-
document.removeEventListener("touchstart", scrollTouchStart, aggresiveCapture_1.nonPassive);
|
|
5279
|
-
};
|
|
5280
|
-
}, []);
|
|
5281
|
-
var removeScrollBar = props.removeScrollBar, inert = props.inert;
|
|
5282
|
-
return React$2.createElement(React$2.Fragment, null, inert ? React$2.createElement(Style, { styles: generateStyle(id) }) : null, removeScrollBar ? React$2.createElement(react_remove_scroll_bar_1.RemoveScrollBar, {
|
|
5283
|
-
noRelative: props.noRelative,
|
|
5284
|
-
gapMode: props.gapMode
|
|
5285
|
-
}) : null);
|
|
5286
|
-
}
|
|
5287
|
-
exports.RemoveScrollSideCar = RemoveScrollSideCar;
|
|
5288
|
-
function getOutermostShadowParent(node) {
|
|
5289
|
-
var shadowParent = null;
|
|
5290
|
-
while (node !== null) {
|
|
5291
|
-
if (node instanceof ShadowRoot) {
|
|
5292
|
-
shadowParent = node.host;
|
|
5293
|
-
node = node.host;
|
|
5294
|
-
}
|
|
5295
|
-
node = node.parentNode;
|
|
5296
|
-
}
|
|
5297
|
-
return shadowParent;
|
|
5298
|
-
}
|
|
5299
|
-
}));
|
|
5300
|
-
//#endregion
|
|
5301
|
-
//#region ../../node_modules/.pnpm/react-remove-scroll@2.7.2_@types+react@19.2.14_react@19.2.6/node_modules/react-remove-scroll/dist/es5/sidecar.js
|
|
5302
|
-
var require_sidecar = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
5303
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5304
|
-
var use_sidecar_1 = require_es5$4();
|
|
5305
|
-
var SideEffect_1 = require_SideEffect();
|
|
5306
|
-
var medium_1 = require_medium();
|
|
5307
|
-
exports.default = (0, use_sidecar_1.exportSidecar)(medium_1.effectCar, SideEffect_1.RemoveScrollSideCar);
|
|
5308
|
-
}));
|
|
5309
|
-
//#endregion
|
|
5310
|
-
//#region ../../node_modules/.pnpm/react-remove-scroll@2.7.2_@types+react@19.2.14_react@19.2.6/node_modules/react-remove-scroll/dist/es5/Combination.js
|
|
5311
|
-
var require_Combination = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
5312
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5313
|
-
var tslib_1 = (init_tslib_es6(), __toCommonJS(tslib_es6_exports));
|
|
5314
|
-
var React$1 = tslib_1.__importStar(__require("react"));
|
|
5315
|
-
var UI_1 = require_UI();
|
|
5316
|
-
var sidecar_1 = tslib_1.__importDefault(require_sidecar());
|
|
5317
|
-
var ReactRemoveScroll = React$1.forwardRef(function(props, ref) {
|
|
5318
|
-
return React$1.createElement(UI_1.RemoveScroll, tslib_1.__assign({}, props, {
|
|
5319
|
-
ref,
|
|
5320
|
-
sideCar: sidecar_1.default
|
|
5321
|
-
}));
|
|
5322
|
-
});
|
|
5323
|
-
ReactRemoveScroll.classNames = UI_1.RemoveScroll.classNames;
|
|
5324
|
-
exports.default = ReactRemoveScroll;
|
|
5325
|
-
}));
|
|
4304
|
+
return /* @__PURE__ */ jsx("div", {
|
|
4305
|
+
ref: parentRef,
|
|
4306
|
+
style: {
|
|
4307
|
+
width: `100%`,
|
|
4308
|
+
overflow: "auto"
|
|
4309
|
+
},
|
|
4310
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
4311
|
+
style: {
|
|
4312
|
+
height: `${rowVirtualizer.getTotalSize()}px`,
|
|
4313
|
+
width: `${columnVirtualizer.getTotalSize()}px`,
|
|
4314
|
+
position: "relative"
|
|
4315
|
+
},
|
|
4316
|
+
children: rowVirtualizer.getVirtualItems().map((virtualRow) => /* @__PURE__ */ jsx(React.Fragment, { children: columnVirtualizer.getVirtualItems().map((virtualColumn) => /* @__PURE__ */ jsx("div", {
|
|
4317
|
+
style: {
|
|
4318
|
+
position: "absolute",
|
|
4319
|
+
top: 0,
|
|
4320
|
+
left: 0,
|
|
4321
|
+
marginTop: virtualRow.index === 0 ? 0 : GAP,
|
|
4322
|
+
width: `${virtualColumn.size}px`,
|
|
4323
|
+
height: `${ITEM_HEIGHT}px`,
|
|
4324
|
+
overflow: "hidden",
|
|
4325
|
+
transform: `translateX(${virtualColumn.start}px) translateY(${virtualRow.start}px)`
|
|
4326
|
+
},
|
|
4327
|
+
children: renderItem(virtualRow.index, virtualColumn.index)
|
|
4328
|
+
}, virtualColumn.key)) }, virtualRow.key))
|
|
4329
|
+
})
|
|
4330
|
+
});
|
|
4331
|
+
}
|
|
5326
4332
|
//#endregion
|
|
5327
|
-
//#region
|
|
5328
|
-
|
|
5329
|
-
|
|
5330
|
-
|
|
5331
|
-
|
|
5332
|
-
})))();
|
|
5333
|
-
var import_es5$1 = require_es5$6();
|
|
5334
|
-
var DIALOG_NAME = "Dialog";
|
|
5335
|
-
var [createDialogContext, createDialogScope] = createContextScope(DIALOG_NAME);
|
|
5336
|
-
var [DialogProvider, useDialogContext] = createDialogContext(DIALOG_NAME);
|
|
5337
|
-
var Dialog = (props) => {
|
|
5338
|
-
const { __scopeDialog, children, open: openProp, defaultOpen, onOpenChange, modal = true } = props;
|
|
5339
|
-
const triggerRef = React$10.useRef(null);
|
|
5340
|
-
const contentRef = React$10.useRef(null);
|
|
5341
|
-
const [open, setOpen] = useControllableState({
|
|
5342
|
-
prop: openProp,
|
|
5343
|
-
defaultProp: defaultOpen ?? false,
|
|
5344
|
-
onChange: onOpenChange,
|
|
5345
|
-
caller: DIALOG_NAME
|
|
5346
|
-
});
|
|
5347
|
-
return /* @__PURE__ */ jsx(DialogProvider, {
|
|
5348
|
-
scope: __scopeDialog,
|
|
5349
|
-
triggerRef,
|
|
5350
|
-
contentRef,
|
|
5351
|
-
contentId: useId$1(),
|
|
5352
|
-
titleId: useId$1(),
|
|
5353
|
-
descriptionId: useId$1(),
|
|
5354
|
-
open,
|
|
5355
|
-
onOpenChange: setOpen,
|
|
5356
|
-
onOpenToggle: React$10.useCallback(() => setOpen((prevOpen) => !prevOpen), [setOpen]),
|
|
5357
|
-
modal,
|
|
4333
|
+
//#region editors/generic-drive-explorer/components/layout.tsx
|
|
4334
|
+
function DriveLayout({ children, className, ...props }) {
|
|
4335
|
+
return /* @__PURE__ */ jsx(DriveLayout.Container, {
|
|
4336
|
+
className,
|
|
4337
|
+
...props,
|
|
5358
4338
|
children
|
|
5359
4339
|
});
|
|
5360
|
-
}
|
|
5361
|
-
|
|
5362
|
-
|
|
5363
|
-
|
|
5364
|
-
|
|
5365
|
-
|
|
5366
|
-
|
|
5367
|
-
return /* @__PURE__ */ jsx(Primitive$1.button, {
|
|
5368
|
-
type: "button",
|
|
5369
|
-
"aria-haspopup": "dialog",
|
|
5370
|
-
"aria-expanded": context.open,
|
|
5371
|
-
"aria-controls": context.contentId,
|
|
5372
|
-
"data-state": getState(context.open),
|
|
5373
|
-
...triggerProps,
|
|
5374
|
-
ref: composedTriggerRef,
|
|
5375
|
-
onClick: composeEventHandlers(props.onClick, context.onOpenToggle)
|
|
5376
|
-
});
|
|
5377
|
-
});
|
|
5378
|
-
DialogTrigger.displayName = TRIGGER_NAME;
|
|
5379
|
-
var PORTAL_NAME = "DialogPortal";
|
|
5380
|
-
var [PortalProvider, usePortalContext] = createDialogContext(PORTAL_NAME, { forceMount: void 0 });
|
|
5381
|
-
var DialogPortal = (props) => {
|
|
5382
|
-
const { __scopeDialog, forceMount, children, container } = props;
|
|
5383
|
-
const context = useDialogContext(PORTAL_NAME, __scopeDialog);
|
|
5384
|
-
return /* @__PURE__ */ jsx(PortalProvider, {
|
|
5385
|
-
scope: __scopeDialog,
|
|
5386
|
-
forceMount,
|
|
5387
|
-
children: React$10.Children.map(children, (child) => /* @__PURE__ */ jsx(Presence, {
|
|
5388
|
-
present: forceMount || context.open,
|
|
5389
|
-
children: /* @__PURE__ */ jsx(Portal$1, {
|
|
5390
|
-
asChild: true,
|
|
5391
|
-
container,
|
|
5392
|
-
children: child
|
|
5393
|
-
})
|
|
5394
|
-
}))
|
|
4340
|
+
}
|
|
4341
|
+
DriveLayout.Container = function DriveLayoutContainer({ children, className, containerProps, ...props }) {
|
|
4342
|
+
return /* @__PURE__ */ jsx("div", {
|
|
4343
|
+
className: twMerge("flex grow flex-col overflow-auto", className),
|
|
4344
|
+
...containerProps,
|
|
4345
|
+
...props,
|
|
4346
|
+
children
|
|
5395
4347
|
});
|
|
5396
4348
|
};
|
|
5397
|
-
|
|
5398
|
-
|
|
5399
|
-
|
|
5400
|
-
|
|
5401
|
-
|
|
5402
|
-
|
|
5403
|
-
return context.modal ? /* @__PURE__ */ jsx(Presence, {
|
|
5404
|
-
present: forceMount || context.open,
|
|
5405
|
-
children: /* @__PURE__ */ jsx(DialogOverlayImpl, {
|
|
5406
|
-
...overlayProps,
|
|
5407
|
-
ref: forwardedRef
|
|
5408
|
-
})
|
|
5409
|
-
}) : null;
|
|
5410
|
-
});
|
|
5411
|
-
DialogOverlay.displayName = OVERLAY_NAME;
|
|
5412
|
-
var Slot$1 = createSlot$1("DialogOverlay.RemoveScroll");
|
|
5413
|
-
var DialogOverlayImpl = React$10.forwardRef((props, forwardedRef) => {
|
|
5414
|
-
const { __scopeDialog, ...overlayProps } = props;
|
|
5415
|
-
const context = useDialogContext(OVERLAY_NAME, __scopeDialog);
|
|
5416
|
-
return /* @__PURE__ */ jsx(import_es5.RemoveScroll, {
|
|
5417
|
-
as: Slot$1,
|
|
5418
|
-
allowPinchZoom: true,
|
|
5419
|
-
shards: [context.contentRef],
|
|
5420
|
-
children: /* @__PURE__ */ jsx(Primitive$1.div, {
|
|
5421
|
-
"data-state": getState(context.open),
|
|
5422
|
-
...overlayProps,
|
|
5423
|
-
ref: forwardedRef,
|
|
5424
|
-
style: {
|
|
5425
|
-
pointerEvents: "auto",
|
|
5426
|
-
...overlayProps.style
|
|
5427
|
-
}
|
|
5428
|
-
})
|
|
5429
|
-
});
|
|
5430
|
-
});
|
|
5431
|
-
var CONTENT_NAME = "DialogContent";
|
|
5432
|
-
var DialogContent = React$10.forwardRef((props, forwardedRef) => {
|
|
5433
|
-
const portalContext = usePortalContext(CONTENT_NAME, props.__scopeDialog);
|
|
5434
|
-
const { forceMount = portalContext.forceMount, ...contentProps } = props;
|
|
5435
|
-
const context = useDialogContext(CONTENT_NAME, props.__scopeDialog);
|
|
5436
|
-
return /* @__PURE__ */ jsx(Presence, {
|
|
5437
|
-
present: forceMount || context.open,
|
|
5438
|
-
children: context.modal ? /* @__PURE__ */ jsx(DialogContentModal, {
|
|
5439
|
-
...contentProps,
|
|
5440
|
-
ref: forwardedRef
|
|
5441
|
-
}) : /* @__PURE__ */ jsx(DialogContentNonModal, {
|
|
5442
|
-
...contentProps,
|
|
5443
|
-
ref: forwardedRef
|
|
5444
|
-
})
|
|
5445
|
-
});
|
|
5446
|
-
});
|
|
5447
|
-
DialogContent.displayName = CONTENT_NAME;
|
|
5448
|
-
var DialogContentModal = React$10.forwardRef((props, forwardedRef) => {
|
|
5449
|
-
const context = useDialogContext(CONTENT_NAME, props.__scopeDialog);
|
|
5450
|
-
const contentRef = React$10.useRef(null);
|
|
5451
|
-
const composedRefs = useComposedRefs(forwardedRef, context.contentRef, contentRef);
|
|
5452
|
-
React$10.useEffect(() => {
|
|
5453
|
-
const content = contentRef.current;
|
|
5454
|
-
if (content) return (0, import_es5$1.hideOthers)(content);
|
|
5455
|
-
}, []);
|
|
5456
|
-
return /* @__PURE__ */ jsx(DialogContentImpl, {
|
|
5457
|
-
...props,
|
|
5458
|
-
ref: composedRefs,
|
|
5459
|
-
trapFocus: context.open,
|
|
5460
|
-
disableOutsidePointerEvents: true,
|
|
5461
|
-
onCloseAutoFocus: composeEventHandlers(props.onCloseAutoFocus, (event) => {
|
|
5462
|
-
event.preventDefault();
|
|
5463
|
-
context.triggerRef.current?.focus();
|
|
5464
|
-
}),
|
|
5465
|
-
onPointerDownOutside: composeEventHandlers(props.onPointerDownOutside, (event) => {
|
|
5466
|
-
const originalEvent = event.detail.originalEvent;
|
|
5467
|
-
const ctrlLeftClick = originalEvent.button === 0 && originalEvent.ctrlKey === true;
|
|
5468
|
-
if (originalEvent.button === 2 || ctrlLeftClick) event.preventDefault();
|
|
5469
|
-
}),
|
|
5470
|
-
onFocusOutside: composeEventHandlers(props.onFocusOutside, (event) => event.preventDefault())
|
|
5471
|
-
});
|
|
5472
|
-
});
|
|
5473
|
-
var DialogContentNonModal = React$10.forwardRef((props, forwardedRef) => {
|
|
5474
|
-
const context = useDialogContext(CONTENT_NAME, props.__scopeDialog);
|
|
5475
|
-
const hasInteractedOutsideRef = React$10.useRef(false);
|
|
5476
|
-
const hasPointerDownOutsideRef = React$10.useRef(false);
|
|
5477
|
-
return /* @__PURE__ */ jsx(DialogContentImpl, {
|
|
5478
|
-
...props,
|
|
5479
|
-
ref: forwardedRef,
|
|
5480
|
-
trapFocus: false,
|
|
5481
|
-
disableOutsidePointerEvents: false,
|
|
5482
|
-
onCloseAutoFocus: (event) => {
|
|
5483
|
-
props.onCloseAutoFocus?.(event);
|
|
5484
|
-
if (!event.defaultPrevented) {
|
|
5485
|
-
if (!hasInteractedOutsideRef.current) context.triggerRef.current?.focus();
|
|
5486
|
-
event.preventDefault();
|
|
5487
|
-
}
|
|
5488
|
-
hasInteractedOutsideRef.current = false;
|
|
5489
|
-
hasPointerDownOutsideRef.current = false;
|
|
5490
|
-
},
|
|
5491
|
-
onInteractOutside: (event) => {
|
|
5492
|
-
props.onInteractOutside?.(event);
|
|
5493
|
-
if (!event.defaultPrevented) {
|
|
5494
|
-
hasInteractedOutsideRef.current = true;
|
|
5495
|
-
if (event.detail.originalEvent.type === "pointerdown") hasPointerDownOutsideRef.current = true;
|
|
5496
|
-
}
|
|
5497
|
-
const target = event.target;
|
|
5498
|
-
if (context.triggerRef.current?.contains(target)) event.preventDefault();
|
|
5499
|
-
if (event.detail.originalEvent.type === "focusin" && hasPointerDownOutsideRef.current) event.preventDefault();
|
|
5500
|
-
}
|
|
4349
|
+
DriveLayout.Header = function DriveLayoutHeader({ children, className, containerProps, ...props }) {
|
|
4350
|
+
return /* @__PURE__ */ jsx("div", {
|
|
4351
|
+
className: twMerge("flex-0", className),
|
|
4352
|
+
...containerProps,
|
|
4353
|
+
...props,
|
|
4354
|
+
children
|
|
5501
4355
|
});
|
|
5502
|
-
});
|
|
5503
|
-
var DialogContentImpl = React$10.forwardRef((props, forwardedRef) => {
|
|
5504
|
-
const { __scopeDialog, trapFocus, onOpenAutoFocus, onCloseAutoFocus, ...contentProps } = props;
|
|
5505
|
-
const context = useDialogContext(CONTENT_NAME, __scopeDialog);
|
|
5506
|
-
const contentRef = React$10.useRef(null);
|
|
5507
|
-
const composedRefs = useComposedRefs(forwardedRef, contentRef);
|
|
5508
|
-
useFocusGuards();
|
|
5509
|
-
return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(FocusScope, {
|
|
5510
|
-
asChild: true,
|
|
5511
|
-
loop: true,
|
|
5512
|
-
trapped: trapFocus,
|
|
5513
|
-
onMountAutoFocus: onOpenAutoFocus,
|
|
5514
|
-
onUnmountAutoFocus: onCloseAutoFocus,
|
|
5515
|
-
children: /* @__PURE__ */ jsx(DismissableLayer, {
|
|
5516
|
-
role: "dialog",
|
|
5517
|
-
id: context.contentId,
|
|
5518
|
-
"aria-describedby": context.descriptionId,
|
|
5519
|
-
"aria-labelledby": context.titleId,
|
|
5520
|
-
"data-state": getState(context.open),
|
|
5521
|
-
...contentProps,
|
|
5522
|
-
ref: composedRefs,
|
|
5523
|
-
onDismiss: () => context.onOpenChange(false)
|
|
5524
|
-
})
|
|
5525
|
-
}), /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(TitleWarning, { titleId: context.titleId }), /* @__PURE__ */ jsx(DescriptionWarning, {
|
|
5526
|
-
contentRef,
|
|
5527
|
-
descriptionId: context.descriptionId
|
|
5528
|
-
})] })] });
|
|
5529
|
-
});
|
|
5530
|
-
var TITLE_NAME = "DialogTitle";
|
|
5531
|
-
var DialogTitle = React$10.forwardRef((props, forwardedRef) => {
|
|
5532
|
-
const { __scopeDialog, ...titleProps } = props;
|
|
5533
|
-
const context = useDialogContext(TITLE_NAME, __scopeDialog);
|
|
5534
|
-
return /* @__PURE__ */ jsx(Primitive$1.h2, {
|
|
5535
|
-
id: context.titleId,
|
|
5536
|
-
...titleProps,
|
|
5537
|
-
ref: forwardedRef
|
|
5538
|
-
});
|
|
5539
|
-
});
|
|
5540
|
-
DialogTitle.displayName = TITLE_NAME;
|
|
5541
|
-
var DESCRIPTION_NAME = "DialogDescription";
|
|
5542
|
-
var DialogDescription = React$10.forwardRef((props, forwardedRef) => {
|
|
5543
|
-
const { __scopeDialog, ...descriptionProps } = props;
|
|
5544
|
-
const context = useDialogContext(DESCRIPTION_NAME, __scopeDialog);
|
|
5545
|
-
return /* @__PURE__ */ jsx(Primitive$1.p, {
|
|
5546
|
-
id: context.descriptionId,
|
|
5547
|
-
...descriptionProps,
|
|
5548
|
-
ref: forwardedRef
|
|
5549
|
-
});
|
|
5550
|
-
});
|
|
5551
|
-
DialogDescription.displayName = DESCRIPTION_NAME;
|
|
5552
|
-
var CLOSE_NAME = "DialogClose";
|
|
5553
|
-
var DialogClose = React$10.forwardRef((props, forwardedRef) => {
|
|
5554
|
-
const { __scopeDialog, ...closeProps } = props;
|
|
5555
|
-
const context = useDialogContext(CLOSE_NAME, __scopeDialog);
|
|
5556
|
-
return /* @__PURE__ */ jsx(Primitive$1.button, {
|
|
5557
|
-
type: "button",
|
|
5558
|
-
...closeProps,
|
|
5559
|
-
ref: forwardedRef,
|
|
5560
|
-
onClick: composeEventHandlers(props.onClick, () => context.onOpenChange(false))
|
|
5561
|
-
});
|
|
5562
|
-
});
|
|
5563
|
-
DialogClose.displayName = CLOSE_NAME;
|
|
5564
|
-
function getState(open) {
|
|
5565
|
-
return open ? "open" : "closed";
|
|
5566
|
-
}
|
|
5567
|
-
var TITLE_WARNING_NAME = "DialogTitleWarning";
|
|
5568
|
-
var [WarningProvider, useWarningContext] = createContext2(TITLE_WARNING_NAME, {
|
|
5569
|
-
contentName: CONTENT_NAME,
|
|
5570
|
-
titleName: TITLE_NAME,
|
|
5571
|
-
docsSlug: "dialog"
|
|
5572
|
-
});
|
|
5573
|
-
var TitleWarning = ({ titleId }) => {
|
|
5574
|
-
const titleWarningContext = useWarningContext(TITLE_WARNING_NAME);
|
|
5575
|
-
const MESSAGE = `\`${titleWarningContext.contentName}\` requires a \`${titleWarningContext.titleName}\` for the component to be accessible for screen reader users.
|
|
5576
|
-
|
|
5577
|
-
If you want to hide the \`${titleWarningContext.titleName}\`, you can wrap it with our VisuallyHidden component.
|
|
5578
|
-
|
|
5579
|
-
For more information, see https://radix-ui.com/primitives/docs/components/${titleWarningContext.docsSlug}`;
|
|
5580
|
-
React$10.useEffect(() => {
|
|
5581
|
-
if (titleId) {
|
|
5582
|
-
if (!document.getElementById(titleId)) console.error(MESSAGE);
|
|
5583
|
-
}
|
|
5584
|
-
}, [MESSAGE, titleId]);
|
|
5585
|
-
return null;
|
|
5586
4356
|
};
|
|
5587
|
-
|
|
5588
|
-
|
|
5589
|
-
|
|
5590
|
-
|
|
5591
|
-
|
|
5592
|
-
|
|
5593
|
-
|
|
5594
|
-
}
|
|
5595
|
-
}, [
|
|
5596
|
-
MESSAGE,
|
|
5597
|
-
contentRef,
|
|
5598
|
-
descriptionId
|
|
5599
|
-
]);
|
|
5600
|
-
return null;
|
|
4357
|
+
DriveLayout.Content = function DriveLayoutContent({ children, className, containerProps, ...props }) {
|
|
4358
|
+
return /* @__PURE__ */ jsx("div", {
|
|
4359
|
+
className: twMerge("mb-5 flex-1 px-4", className),
|
|
4360
|
+
...containerProps,
|
|
4361
|
+
...props,
|
|
4362
|
+
children
|
|
4363
|
+
});
|
|
5601
4364
|
};
|
|
5602
|
-
|
|
5603
|
-
|
|
5604
|
-
|
|
5605
|
-
|
|
5606
|
-
|
|
5607
|
-
|
|
5608
|
-
|
|
5609
|
-
|
|
5610
|
-
|
|
5611
|
-
|
|
5612
|
-
|
|
5613
|
-
|
|
5614
|
-
|
|
5615
|
-
function isLazyComponent(element) {
|
|
5616
|
-
return element != null && typeof element === "object" && "$$typeof" in element && element.$$typeof === REACT_LAZY_TYPE && "_payload" in element && isPromiseLike(element._payload);
|
|
5617
|
-
}
|
|
5618
|
-
/* @__NO_SIDE_EFFECTS__ */
|
|
5619
|
-
function createSlot(ownerName) {
|
|
5620
|
-
const SlotClone = /* @__PURE__ */ createSlotClone(ownerName);
|
|
5621
|
-
const Slot2 = React$10.forwardRef((props, forwardedRef) => {
|
|
5622
|
-
let { children, ...slotProps } = props;
|
|
5623
|
-
if (isLazyComponent(children) && typeof use === "function") children = use(children._payload);
|
|
5624
|
-
const childrenArray = React$10.Children.toArray(children);
|
|
5625
|
-
const slottable = childrenArray.find(isSlottable);
|
|
5626
|
-
if (slottable) {
|
|
5627
|
-
const newElement = slottable.props.children;
|
|
5628
|
-
const newChildren = childrenArray.map((child) => {
|
|
5629
|
-
if (child === slottable) {
|
|
5630
|
-
if (React$10.Children.count(newElement) > 1) return React$10.Children.only(null);
|
|
5631
|
-
return React$10.isValidElement(newElement) ? newElement.props.children : null;
|
|
5632
|
-
} else return child;
|
|
5633
|
-
});
|
|
5634
|
-
return /* @__PURE__ */ jsx(SlotClone, {
|
|
5635
|
-
...slotProps,
|
|
5636
|
-
ref: forwardedRef,
|
|
5637
|
-
children: React$10.isValidElement(newElement) ? React$10.cloneElement(newElement, void 0, newChildren) : null
|
|
5638
|
-
});
|
|
5639
|
-
}
|
|
5640
|
-
return /* @__PURE__ */ jsx(SlotClone, {
|
|
5641
|
-
...slotProps,
|
|
5642
|
-
ref: forwardedRef,
|
|
4365
|
+
DriveLayout.ContentSection = function DriveLayoutContentSection({ title, actions, children, className, containerProps, ...props }) {
|
|
4366
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
4367
|
+
className: twMerge(className),
|
|
4368
|
+
...containerProps,
|
|
4369
|
+
...props,
|
|
4370
|
+
children: [(title || actions) && /* @__PURE__ */ jsxs("div", {
|
|
4371
|
+
className: "mb-4 flex items-center justify-between gap-3",
|
|
4372
|
+
children: [title && /* @__PURE__ */ jsx("div", {
|
|
4373
|
+
className: "text-base font-semibold text-foreground",
|
|
4374
|
+
children: title
|
|
4375
|
+
}), actions]
|
|
4376
|
+
}), /* @__PURE__ */ jsx("div", {
|
|
4377
|
+
className: "flex flex-wrap gap-2",
|
|
5643
4378
|
children
|
|
5644
|
-
})
|
|
5645
|
-
});
|
|
5646
|
-
Slot2.displayName = `${ownerName}.Slot`;
|
|
5647
|
-
return Slot2;
|
|
5648
|
-
}
|
|
5649
|
-
var Slot = /* @__PURE__ */ createSlot("Slot");
|
|
5650
|
-
/* @__NO_SIDE_EFFECTS__ */
|
|
5651
|
-
function createSlotClone(ownerName) {
|
|
5652
|
-
const SlotClone = React$10.forwardRef((props, forwardedRef) => {
|
|
5653
|
-
let { children, ...slotProps } = props;
|
|
5654
|
-
if (isLazyComponent(children) && typeof use === "function") children = use(children._payload);
|
|
5655
|
-
if (React$10.isValidElement(children)) {
|
|
5656
|
-
const childrenRef = getElementRef(children);
|
|
5657
|
-
const props2 = mergeProps(slotProps, children.props);
|
|
5658
|
-
if (children.type !== React$10.Fragment) props2.ref = forwardedRef ? composeRefs(forwardedRef, childrenRef) : childrenRef;
|
|
5659
|
-
return React$10.cloneElement(children, props2);
|
|
5660
|
-
}
|
|
5661
|
-
return React$10.Children.count(children) > 1 ? React$10.Children.only(null) : null;
|
|
5662
|
-
});
|
|
5663
|
-
SlotClone.displayName = `${ownerName}.SlotClone`;
|
|
5664
|
-
return SlotClone;
|
|
5665
|
-
}
|
|
5666
|
-
var SLOTTABLE_IDENTIFIER = Symbol("radix.slottable");
|
|
5667
|
-
function isSlottable(child) {
|
|
5668
|
-
return React$10.isValidElement(child) && typeof child.type === "function" && "__radixId" in child.type && child.type.__radixId === SLOTTABLE_IDENTIFIER;
|
|
5669
|
-
}
|
|
5670
|
-
function mergeProps(slotProps, childProps) {
|
|
5671
|
-
const overrideProps = { ...childProps };
|
|
5672
|
-
for (const propName in childProps) {
|
|
5673
|
-
const slotPropValue = slotProps[propName];
|
|
5674
|
-
const childPropValue = childProps[propName];
|
|
5675
|
-
if (/^on[A-Z]/.test(propName)) {
|
|
5676
|
-
if (slotPropValue && childPropValue) overrideProps[propName] = (...args) => {
|
|
5677
|
-
const result = childPropValue(...args);
|
|
5678
|
-
slotPropValue(...args);
|
|
5679
|
-
return result;
|
|
5680
|
-
};
|
|
5681
|
-
else if (slotPropValue) overrideProps[propName] = slotPropValue;
|
|
5682
|
-
} else if (propName === "style") overrideProps[propName] = {
|
|
5683
|
-
...slotPropValue,
|
|
5684
|
-
...childPropValue
|
|
5685
|
-
};
|
|
5686
|
-
else if (propName === "className") overrideProps[propName] = [slotPropValue, childPropValue].filter(Boolean).join(" ");
|
|
5687
|
-
}
|
|
5688
|
-
return {
|
|
5689
|
-
...slotProps,
|
|
5690
|
-
...overrideProps
|
|
5691
|
-
};
|
|
5692
|
-
}
|
|
5693
|
-
function getElementRef(element) {
|
|
5694
|
-
let getter = Object.getOwnPropertyDescriptor(element.props, "ref")?.get;
|
|
5695
|
-
let mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning;
|
|
5696
|
-
if (mayWarn) return element.ref;
|
|
5697
|
-
getter = Object.getOwnPropertyDescriptor(element, "ref")?.get;
|
|
5698
|
-
mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning;
|
|
5699
|
-
if (mayWarn) return element.props.ref;
|
|
5700
|
-
return element.props.ref || element.ref;
|
|
5701
|
-
}
|
|
5702
|
-
//#endregion
|
|
5703
|
-
//#region ../../node_modules/.pnpm/@radix-ui+react-primitive@2.1.4_@types+react-dom@19.2.3_@types+react@19.2.14__@types+re_c8c8fd2647f03197dbf56370d7498033/node_modules/@radix-ui/react-primitive/dist/index.mjs
|
|
5704
|
-
var Primitive = [
|
|
5705
|
-
"a",
|
|
5706
|
-
"button",
|
|
5707
|
-
"div",
|
|
5708
|
-
"form",
|
|
5709
|
-
"h2",
|
|
5710
|
-
"h3",
|
|
5711
|
-
"img",
|
|
5712
|
-
"input",
|
|
5713
|
-
"label",
|
|
5714
|
-
"li",
|
|
5715
|
-
"nav",
|
|
5716
|
-
"ol",
|
|
5717
|
-
"p",
|
|
5718
|
-
"select",
|
|
5719
|
-
"span",
|
|
5720
|
-
"svg",
|
|
5721
|
-
"ul"
|
|
5722
|
-
].reduce((primitive, node) => {
|
|
5723
|
-
const Slot = /* @__PURE__ */ createSlot(`Primitive.${node}`);
|
|
5724
|
-
const Node = React$10.forwardRef((props, forwardedRef) => {
|
|
5725
|
-
const { asChild, ...primitiveProps } = props;
|
|
5726
|
-
const Comp = asChild ? Slot : node;
|
|
5727
|
-
if (typeof window !== "undefined") window[Symbol.for("radix-ui")] = true;
|
|
5728
|
-
return /* @__PURE__ */ jsx(Comp, {
|
|
5729
|
-
...primitiveProps,
|
|
5730
|
-
ref: forwardedRef
|
|
5731
|
-
});
|
|
5732
|
-
});
|
|
5733
|
-
Node.displayName = `Primitive.${node}`;
|
|
5734
|
-
return {
|
|
5735
|
-
...primitive,
|
|
5736
|
-
[node]: Node
|
|
5737
|
-
};
|
|
5738
|
-
}, {});
|
|
5739
|
-
//#endregion
|
|
5740
|
-
//#region ../../node_modules/.pnpm/@radix-ui+react-visually-hidden@1.2.4_@types+react-dom@19.2.3_@types+react@19.2.14__@ty_c96f9879086bb31d068780de3c4b72ff/node_modules/@radix-ui/react-visually-hidden/dist/index.mjs
|
|
5741
|
-
var VISUALLY_HIDDEN_STYLES = Object.freeze({
|
|
5742
|
-
position: "absolute",
|
|
5743
|
-
border: 0,
|
|
5744
|
-
width: 1,
|
|
5745
|
-
height: 1,
|
|
5746
|
-
padding: 0,
|
|
5747
|
-
margin: -1,
|
|
5748
|
-
overflow: "hidden",
|
|
5749
|
-
clip: "rect(0, 0, 0, 0)",
|
|
5750
|
-
whiteSpace: "nowrap",
|
|
5751
|
-
wordWrap: "normal"
|
|
5752
|
-
});
|
|
5753
|
-
var NAME = "VisuallyHidden";
|
|
5754
|
-
var VisuallyHidden = React$10.forwardRef((props, forwardedRef) => {
|
|
5755
|
-
return /* @__PURE__ */ jsx(Primitive.span, {
|
|
5756
|
-
...props,
|
|
5757
|
-
ref: forwardedRef,
|
|
5758
|
-
style: {
|
|
5759
|
-
...VISUALLY_HIDDEN_STYLES,
|
|
5760
|
-
...props.style
|
|
5761
|
-
}
|
|
4379
|
+
})]
|
|
5762
4380
|
});
|
|
5763
|
-
}
|
|
5764
|
-
VisuallyHidden.displayName = NAME;
|
|
5765
|
-
var Root = VisuallyHidden;
|
|
4381
|
+
};
|
|
5766
4382
|
//#endregion
|
|
5767
|
-
//#region
|
|
5768
|
-
|
|
5769
|
-
const {
|
|
5770
|
-
|
|
5771
|
-
|
|
5772
|
-
|
|
5773
|
-
|
|
5774
|
-
|
|
5775
|
-
|
|
5776
|
-
|
|
5777
|
-
|
|
5778
|
-
|
|
5779
|
-
|
|
5780
|
-
|
|
5781
|
-
|
|
5782
|
-
|
|
5783
|
-
|
|
5784
|
-
|
|
5785
|
-
|
|
5786
|
-
]
|
|
5787
|
-
});
|
|
5788
|
-
});
|
|
5789
|
-
function Modal(props) {
|
|
5790
|
-
const { title, open, onOpenChange, contentProps, overlayProps, children, ...delegated } = props;
|
|
5791
|
-
return /* @__PURE__ */ jsx(Root$1, {
|
|
5792
|
-
defaultOpen: open,
|
|
5793
|
-
onOpenChange,
|
|
5794
|
-
open,
|
|
5795
|
-
children: /* @__PURE__ */ jsx(Portal, { children: /* @__PURE__ */ jsx(Overlay, {
|
|
5796
|
-
...overlayProps,
|
|
5797
|
-
className: twMerge("fixed inset-0 grid place-items-center overflow-y-auto bg-background/50 data-[state=closed]:animate-fade-out data-[state=open]:animate-fade-in", overlayProps?.className),
|
|
5798
|
-
children: /* @__PURE__ */ jsxs(Content, {
|
|
5799
|
-
...delegated,
|
|
5800
|
-
...contentProps,
|
|
5801
|
-
className: twMerge("overflow-hidden rounded-3xl bg-background shadow-modal data-[state=closed]:animate-zoom-out data-[state=open]:animate-zoom-in dark:shadow-modal-dark", contentProps?.className),
|
|
5802
|
-
children: [/* @__PURE__ */ jsxs(Root, { children: [/* @__PURE__ */ jsx(Title, { children: title || "Modal" }), /* @__PURE__ */ jsx(Description, { children: title || "Modal" })] }), children]
|
|
4383
|
+
//#region editors/generic-drive-explorer/components/folder-view.tsx
|
|
4384
|
+
function FolderView(props) {
|
|
4385
|
+
const { className } = props;
|
|
4386
|
+
const folderNodes = useNodesInSelectedDriveOrFolder().filter((n) => isFolderNodeKind(n));
|
|
4387
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
4388
|
+
className: twMerge("rounded-md border-2 border-transparent p-2", className),
|
|
4389
|
+
children: [/* @__PURE__ */ jsx(DriveLayout.ContentSection, {
|
|
4390
|
+
title: "Folders",
|
|
4391
|
+
className: "mb-4",
|
|
4392
|
+
children: folderNodes.length > 0 ? folderNodes.map((folderNode) => /* @__PURE__ */ jsx(FolderItem, { folderNode }, folderNode.id)) : /* @__PURE__ */ jsx("div", {
|
|
4393
|
+
className: "mb-8 text-sm text-muted-foreground",
|
|
4394
|
+
children: "No documents or files 📄"
|
|
4395
|
+
})
|
|
4396
|
+
}), /* @__PURE__ */ jsx(DriveLayout.ContentSection, {
|
|
4397
|
+
title: "Documents and files",
|
|
4398
|
+
actions: /* @__PURE__ */ jsx(CreateDocument, {}),
|
|
4399
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
4400
|
+
className: "w-full",
|
|
4401
|
+
children: /* @__PURE__ */ jsx(FileContentView, {})
|
|
5803
4402
|
})
|
|
5804
|
-
})
|
|
4403
|
+
})]
|
|
5805
4404
|
});
|
|
5806
4405
|
}
|
|
5807
|
-
const useWindowSize = () => {
|
|
5808
|
-
const [windowSize, setWindowSize] = useState({
|
|
5809
|
-
innerWidth: window.innerWidth,
|
|
5810
|
-
innerHeight: window.innerHeight
|
|
5811
|
-
});
|
|
5812
|
-
useEffect(() => {
|
|
5813
|
-
const windowSizeHandler = () => {
|
|
5814
|
-
setWindowSize({
|
|
5815
|
-
innerWidth: window.innerWidth,
|
|
5816
|
-
innerHeight: window.innerHeight
|
|
5817
|
-
});
|
|
5818
|
-
};
|
|
5819
|
-
window.addEventListener("resize", windowSizeHandler);
|
|
5820
|
-
return () => {
|
|
5821
|
-
window.removeEventListener("resize", windowSizeHandler);
|
|
5822
|
-
};
|
|
5823
|
-
}, []);
|
|
5824
|
-
return windowSize;
|
|
5825
|
-
};
|
|
5826
4406
|
//#endregion
|
|
5827
|
-
export {
|
|
4407
|
+
export { Icon as a, CreateDocument as i, DriveLayout as n, FileContentView as r, FolderView as t };
|
|
5828
4408
|
|
|
5829
|
-
//# sourceMappingURL=
|
|
4409
|
+
//# sourceMappingURL=folder-view-B2Jo-wsr.mjs.map
|