@powerhousedao/powerhouse-vetra-packages 6.2.2-dev.6 → 6.2.2-dev.60
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-Cvoo4_c9.js → entry-D-JZwwGk.js} +3 -2
- package/dist/browser/assets/{projection-entry-DVec8YRh.js → projection-entry-64-WZZjU.js} +4 -4
- package/dist/browser/{linting-Dn6pXRkK.js → button-CuO8Gh3v.js} +20 -6
- package/dist/browser/button-CuO8Gh3v.js.map +1 -0
- package/dist/browser/{connect-KEU-HR3o.js → connect-D1KIMa_5.js} +916 -200
- package/dist/browser/connect-D1KIMa_5.js.map +1 -0
- package/dist/browser/{dist-CXoKspdx.js → dist-B4FWbuEM.js} +10 -2
- package/dist/browser/{dist-CXoKspdx.js.map → dist-B4FWbuEM.js.map} +1 -1
- package/dist/{node/dist-BeZaEP6S.mjs → browser/dist-BAJ5nRDl.js} +21 -2
- package/dist/browser/{dist-D8H48e8N.js.map → dist-BAJ5nRDl.js.map} +1 -1
- package/dist/browser/{dist-D5ra2aRj.js → dist-dmLcxsWV.js} +1588 -1293
- package/dist/browser/dist-dmLcxsWV.js.map +1 -0
- package/dist/browser/{document-drive-IdFV1QXL.js → document-drive-cxHraTVQ.js} +1157 -122
- package/dist/browser/document-drive-cxHraTVQ.js.map +1 -0
- package/dist/browser/document-models/index.js +1 -1
- package/dist/browser/{documents-D4ek7Ubv.js → documents-J_l59mSV.js} +5 -604
- package/dist/browser/documents-J_l59mSV.js.map +1 -0
- package/dist/browser/{editor-DiZF3ao3.js → editor-BAUTcFP2.js} +671 -236
- package/dist/browser/editor-BAUTcFP2.js.map +1 -0
- package/dist/browser/editor-PmQcB82h.js +25 -0
- package/dist/browser/editor-PmQcB82h.js.map +1 -0
- package/dist/browser/editors/document-model-editor/module.js +1 -1
- package/dist/browser/editors/generic-drive-explorer/index.js +5 -5
- package/dist/browser/editors/generic-drive-explorer/module.js +1 -1
- package/dist/{node/folder-view-Cy-QxsDg.mjs → browser/folder-view-CWnDdLMC.js} +73 -46
- package/dist/browser/folder-view-CWnDdLMC.js.map +1 -0
- package/dist/browser/{graphql-editor-ZLRO_8Ce.js → graphql-editor-Cq_L5IUQ.js} +8 -7
- package/dist/browser/{graphql-editor-ZLRO_8Ce.js.map → graphql-editor-Cq_L5IUQ.js.map} +1 -1
- package/dist/browser/{hooks-CORHBNHb.js → hooks-KKcNp2X0.js} +2 -2
- package/dist/browser/{hooks-CORHBNHb.js.map → hooks-KKcNp2X0.js.map} +1 -1
- package/dist/browser/index.js +378 -9
- package/dist/browser/index.js.map +1 -1
- package/dist/browser/{json-editor-DBuZ6gN7.js → json-editor-D8lysNHE.js} +4 -4
- package/dist/browser/{json-editor-DBuZ6gN7.js.map → json-editor-D8lysNHE.js.map} +1 -1
- package/dist/browser/{lib-C-f3izXz.js → lib-DKvC6Hnv.js} +13 -4
- package/dist/browser/lib-DKvC6Hnv.js.map +1 -0
- package/dist/browser/printer-CEYr4JOg.js +604 -0
- package/dist/browser/printer-CEYr4JOg.js.map +1 -0
- package/dist/browser/{schema-context-DY-GEGnY.js → schema-context-ZyeclQwy.js} +2 -2
- package/dist/browser/{schema-context-DY-GEGnY.js.map → schema-context-ZyeclQwy.js.map} +1 -1
- package/dist/browser/{state-schemas-BjQKM498.js → state-schemas-NyThZN-C.js} +8 -18
- package/dist/browser/state-schemas-NyThZN-C.js.map +1 -0
- package/dist/node/{linting-Dx50GuLN.mjs → button-Da7CxMn7.mjs} +20 -7
- package/dist/node/button-Da7CxMn7.mjs.map +1 -0
- package/dist/node/{connect-KcYZcy_Z.mjs → connect-BixjoUPL.mjs} +916 -200
- package/dist/node/connect-BixjoUPL.mjs.map +1 -0
- package/dist/node/{dist-DJEK2WVi.mjs → dist-BtnA_6jV.mjs} +1592 -1292
- package/dist/node/dist-BtnA_6jV.mjs.map +1 -0
- package/dist/{browser/dist-D8H48e8N.js → node/dist-CzYOpeXN.mjs} +21 -2
- package/dist/node/{dist-BeZaEP6S.mjs.map → dist-CzYOpeXN.mjs.map} +1 -1
- package/dist/node/{dist-fA4EItr0.mjs → dist-DT7jI9ol.mjs} +10 -2
- package/dist/node/{dist-fA4EItr0.mjs.map → dist-DT7jI9ol.mjs.map} +1 -1
- package/dist/node/{document-drive-C8hbqQ3C.mjs → document-drive-ChLoGFvU.mjs} +1157 -122
- package/dist/node/document-drive-ChLoGFvU.mjs.map +1 -0
- package/dist/node/document-models/index.mjs +1 -1
- package/dist/node/{documents-BFBPmyw1.mjs → documents-DCf53bzO.mjs} +3 -3
- package/dist/node/{documents-BFBPmyw1.mjs.map → documents-DCf53bzO.mjs.map} +1 -1
- package/dist/node/editor-C8Drq-be.mjs +25 -0
- package/dist/node/editor-C8Drq-be.mjs.map +1 -0
- package/dist/node/{editor-B1KhoF1f.mjs → editor-cfoi-9LF.mjs} +672 -237
- package/dist/node/editor-cfoi-9LF.mjs.map +1 -0
- package/dist/node/editors/document-model-editor/module.mjs +1 -1
- package/dist/node/editors/generic-drive-explorer/index.mjs +5 -5
- package/dist/node/editors/generic-drive-explorer/module.mjs +1 -1
- package/dist/{browser/folder-view-DMFqcJhc.js → node/folder-view--I9GOsir.mjs} +73 -46
- package/dist/node/folder-view--I9GOsir.mjs.map +1 -0
- package/dist/node/{graphql-DskHmkMe.mjs → graphql-BfAoPeWM.mjs} +2 -2
- package/dist/node/{graphql-DskHmkMe.mjs.map → graphql-BfAoPeWM.mjs.map} +1 -1
- package/dist/node/{graphql-editor-C5VLRqEf.mjs → graphql-editor-BKGQ8ojN.mjs} +7 -7
- package/dist/node/{graphql-editor-C5VLRqEf.mjs.map → graphql-editor-BKGQ8ojN.mjs.map} +1 -1
- package/dist/node/{hooks-DJrjfVaS.mjs → hooks-D0DcS3MV.mjs} +2 -2
- package/dist/node/{hooks-DJrjfVaS.mjs.map → hooks-D0DcS3MV.mjs.map} +1 -1
- package/dist/node/index.mjs +378 -9
- package/dist/node/index.mjs.map +1 -1
- package/dist/node/{json-editor-iI2s9a_4.mjs → json-editor-32paCJkU.mjs} +4 -4
- package/dist/node/{json-editor-iI2s9a_4.mjs.map → json-editor-32paCJkU.mjs.map} +1 -1
- package/dist/node/{main-D82dkD7g.mjs → main-DRfab-vL.mjs} +15 -6
- package/dist/node/main-DRfab-vL.mjs.map +1 -0
- package/dist/node/{schema-context-CX5ml_9t.mjs → schema-context-DL8jhi_d.mjs} +3 -3
- package/dist/node/{schema-context-CX5ml_9t.mjs.map → schema-context-DL8jhi_d.mjs.map} +1 -1
- package/dist/node/{state-schemas-Bl7nA8bB.mjs → state-schemas-ClrkM0Fn.mjs} +10 -20
- package/dist/{browser/state-schemas-BjQKM498.js.map → node/state-schemas-ClrkM0Fn.mjs.map} +1 -1
- package/package.json +8 -7
- package/dist/browser/connect-KEU-HR3o.js.map +0 -1
- package/dist/browser/dist-D5ra2aRj.js.map +0 -1
- package/dist/browser/document-drive-IdFV1QXL.js.map +0 -1
- package/dist/browser/documents-D4ek7Ubv.js.map +0 -1
- package/dist/browser/editor-DiZF3ao3.js.map +0 -1
- package/dist/browser/editor-SqNULDP-.js +0 -29
- package/dist/browser/editor-SqNULDP-.js.map +0 -1
- package/dist/browser/folder-view-DMFqcJhc.js.map +0 -1
- package/dist/browser/lib-C-f3izXz.js.map +0 -1
- package/dist/browser/linting-Dn6pXRkK.js.map +0 -1
- package/dist/node/connect-KcYZcy_Z.mjs.map +0 -1
- package/dist/node/dist-DJEK2WVi.mjs.map +0 -1
- package/dist/node/document-drive-C8hbqQ3C.mjs.map +0 -1
- package/dist/node/editor-B1KhoF1f.mjs.map +0 -1
- package/dist/node/editor-yBGEvMGD.mjs +0 -29
- package/dist/node/editor-yBGEvMGD.mjs.map +0 -1
- package/dist/node/folder-view-Cy-QxsDg.mjs.map +0 -1
- package/dist/node/linting-Dx50GuLN.mjs.map +0 -1
- package/dist/node/main-D82dkD7g.mjs.map +0 -1
- package/dist/node/state-schemas-Bl7nA8bB.mjs.map +0 -1
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { i as __spreadArray, n as __assign, r as __rest } from "./lib-
|
|
4
|
-
import { C as
|
|
5
|
-
import { D as
|
|
1
|
+
import { D as __commonJSMin } from "./dist-B4FWbuEM.js";
|
|
2
|
+
import { B as redo, c as isValidName, it as undo } from "./document-drive-cxHraTVQ.js";
|
|
3
|
+
import { i as __spreadArray, n as __assign, r as __rest } from "./lib-DKvC6Hnv.js";
|
|
4
|
+
import { C as twJoin, S as composeEventHandlers, _ as useLayoutEffect2, a as Item, b as composeRefs, c as Presence, d as useDirection, f as createCollection, g as useControllableState, h as createSlot$1, l as useId$1, m as dispatchDiscreteCustomEvent, o as Root$3, p as Primitive$1, s as createRovingFocusGroupScope, u as useCallbackRef$1, v as createContext2, w as twMerge, x as useComposedRefs, y as createContextScope } from "./dist-BAJ5nRDl.js";
|
|
5
|
+
import { A as showRevisionHistory, B as t$10, C as addFolder$1, D as setSelectedNode, E as setSelectedDrive, F as useSelectedDriveId, H as useDocumentById, I as useSelectedDriveSafe, M as useDragNode, N as useDropNode, O as showDeleteNodeModal, R as e$4, V as t$9, _ as useSelectedNodePath, a as useDownloadDocument, c as useGetSwitchboardLink, d as useNodeParentFolderById, h as useSelectedDocumentSafe, i as useDocumentVersionStatus, k as showPHModal, l as useNodeActions, n as preloadEditorModule, s as useEditorModulesForDocumentType, t as getSyncStatusSync, u as useNodeById, x as useUserPermissions, z as e$5 } from "./dist-dmLcxsWV.js";
|
|
6
6
|
import * as React$1 from "react";
|
|
7
|
-
import React, { Fragment, Suspense, createContext, createElement, forwardRef, useContext, useEffect, useLayoutEffect, useMemo, useReducer, useRef, useState } from "react";
|
|
7
|
+
import React, { Fragment, Suspense, createContext, createElement, forwardRef, useCallback, useContext, useEffect, useLayoutEffect, useMemo, useReducer, useRef, useState } from "react";
|
|
8
8
|
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
9
9
|
import * as ReactDOM$1 from "react-dom";
|
|
10
10
|
import ReactDOM, { flushSync } from "react-dom";
|
|
@@ -3544,7 +3544,7 @@ var DismissableLayer = React$1.forwardRef((props, forwardedRef) => {
|
|
|
3544
3544
|
document.addEventListener(CONTEXT_UPDATE, handleUpdate);
|
|
3545
3545
|
return () => document.removeEventListener(CONTEXT_UPDATE, handleUpdate);
|
|
3546
3546
|
}, []);
|
|
3547
|
-
return /* @__PURE__ */ jsx(Primitive.div, {
|
|
3547
|
+
return /* @__PURE__ */ jsx(Primitive$1.div, {
|
|
3548
3548
|
...layerProps,
|
|
3549
3549
|
ref: composedRefs,
|
|
3550
3550
|
style: {
|
|
@@ -3571,7 +3571,7 @@ var DismissableLayerBranch = React$1.forwardRef((props, forwardedRef) => {
|
|
|
3571
3571
|
};
|
|
3572
3572
|
}
|
|
3573
3573
|
}, [context.branches]);
|
|
3574
|
-
return /* @__PURE__ */ jsx(Primitive.div, {
|
|
3574
|
+
return /* @__PURE__ */ jsx(Primitive$1.div, {
|
|
3575
3575
|
...props,
|
|
3576
3576
|
ref: composedRefs
|
|
3577
3577
|
});
|
|
@@ -3775,7 +3775,7 @@ var FocusScope = React$1.forwardRef((props, forwardedRef) => {
|
|
|
3775
3775
|
trapped,
|
|
3776
3776
|
focusScope.paused
|
|
3777
3777
|
]);
|
|
3778
|
-
return /* @__PURE__ */ jsx(Primitive.div, {
|
|
3778
|
+
return /* @__PURE__ */ jsx(Primitive$1.div, {
|
|
3779
3779
|
tabIndex: -1,
|
|
3780
3780
|
...scopeProps,
|
|
3781
3781
|
ref: composedRefs,
|
|
@@ -5512,10 +5512,10 @@ const arrow = (options, deps) => ({
|
|
|
5512
5512
|
});
|
|
5513
5513
|
//#endregion
|
|
5514
5514
|
//#region ../../node_modules/.pnpm/@radix-ui+react-arrow@1.1.7_@types+react-dom@19.2.3_@types+react@19.2.14__@types+react@_07ab85c571739f89808dad9390df6d71/node_modules/@radix-ui/react-arrow/dist/index.mjs
|
|
5515
|
-
var NAME = "Arrow";
|
|
5515
|
+
var NAME$1 = "Arrow";
|
|
5516
5516
|
var Arrow$3 = React$1.forwardRef((props, forwardedRef) => {
|
|
5517
5517
|
const { children, width = 10, height = 5, ...arrowProps } = props;
|
|
5518
|
-
return /* @__PURE__ */ jsx(Primitive.svg, {
|
|
5518
|
+
return /* @__PURE__ */ jsx(Primitive$1.svg, {
|
|
5519
5519
|
...arrowProps,
|
|
5520
5520
|
ref: forwardedRef,
|
|
5521
5521
|
width,
|
|
@@ -5525,8 +5525,8 @@ var Arrow$3 = React$1.forwardRef((props, forwardedRef) => {
|
|
|
5525
5525
|
children: props.asChild ? children : /* @__PURE__ */ jsx("polygon", { points: "0,0 30,0 15,10" })
|
|
5526
5526
|
});
|
|
5527
5527
|
});
|
|
5528
|
-
Arrow$3.displayName = NAME;
|
|
5529
|
-
var Root = Arrow$3;
|
|
5528
|
+
Arrow$3.displayName = NAME$1;
|
|
5529
|
+
var Root$2 = Arrow$3;
|
|
5530
5530
|
//#endregion
|
|
5531
5531
|
//#region ../../node_modules/.pnpm/@radix-ui+react-use-size@1.1.1_@types+react@19.2.14_react@19.2.6/node_modules/@radix-ui/react-use-size/dist/index.mjs
|
|
5532
5532
|
function useSize(element) {
|
|
@@ -5591,17 +5591,17 @@ var PopperAnchor = React$1.forwardRef((props, forwardedRef) => {
|
|
|
5591
5591
|
anchorRef.current = virtualRef?.current || ref.current;
|
|
5592
5592
|
if (previousAnchor !== anchorRef.current) context.onAnchorChange(anchorRef.current);
|
|
5593
5593
|
});
|
|
5594
|
-
return virtualRef ? null : /* @__PURE__ */ jsx(Primitive.div, {
|
|
5594
|
+
return virtualRef ? null : /* @__PURE__ */ jsx(Primitive$1.div, {
|
|
5595
5595
|
...anchorProps,
|
|
5596
5596
|
ref: composedRefs
|
|
5597
5597
|
});
|
|
5598
5598
|
});
|
|
5599
5599
|
PopperAnchor.displayName = ANCHOR_NAME$1;
|
|
5600
|
-
var CONTENT_NAME$
|
|
5601
|
-
var [PopperContentProvider, useContentContext] = createPopperContext(CONTENT_NAME$
|
|
5600
|
+
var CONTENT_NAME$3 = "PopperContent";
|
|
5601
|
+
var [PopperContentProvider, useContentContext] = createPopperContext(CONTENT_NAME$3);
|
|
5602
5602
|
var PopperContent = React$1.forwardRef((props, forwardedRef) => {
|
|
5603
5603
|
const { __scopePopper, side = "bottom", sideOffset = 0, align = "center", alignOffset = 0, arrowPadding = 0, avoidCollisions = true, collisionBoundary = [], collisionPadding: collisionPaddingProp = 0, sticky = "partial", hideWhenDetached = false, updatePositionStrategy = "optimized", onPlaced, ...contentProps } = props;
|
|
5604
|
-
const context = usePopperContext(CONTENT_NAME$
|
|
5604
|
+
const context = usePopperContext(CONTENT_NAME$3, __scopePopper);
|
|
5605
5605
|
const [content, setContent] = React$1.useState(null);
|
|
5606
5606
|
const composedRefs = useComposedRefs(forwardedRef, (node) => setContent(node));
|
|
5607
5607
|
const [arrow$4, setArrow] = React$1.useState(null);
|
|
@@ -5701,7 +5701,7 @@ var PopperContent = React$1.forwardRef((props, forwardedRef) => {
|
|
|
5701
5701
|
arrowX,
|
|
5702
5702
|
arrowY,
|
|
5703
5703
|
shouldHideArrow: cannotCenterArrow,
|
|
5704
|
-
children: /* @__PURE__ */ jsx(Primitive.div, {
|
|
5704
|
+
children: /* @__PURE__ */ jsx(Primitive$1.div, {
|
|
5705
5705
|
"data-side": placedSide,
|
|
5706
5706
|
"data-align": placedAlign,
|
|
5707
5707
|
...contentProps,
|
|
@@ -5714,7 +5714,7 @@ var PopperContent = React$1.forwardRef((props, forwardedRef) => {
|
|
|
5714
5714
|
})
|
|
5715
5715
|
});
|
|
5716
5716
|
});
|
|
5717
|
-
PopperContent.displayName = CONTENT_NAME$
|
|
5717
|
+
PopperContent.displayName = CONTENT_NAME$3;
|
|
5718
5718
|
var ARROW_NAME$2 = "PopperArrow";
|
|
5719
5719
|
var OPPOSITE_SIDE = {
|
|
5720
5720
|
top: "bottom",
|
|
@@ -5747,7 +5747,7 @@ var PopperArrow = React$1.forwardRef(function PopperArrow2(props, forwardedRef)
|
|
|
5747
5747
|
}[contentContext.placedSide],
|
|
5748
5748
|
visibility: contentContext.shouldHideArrow ? "hidden" : void 0
|
|
5749
5749
|
},
|
|
5750
|
-
children: /* @__PURE__ */ jsx(Root, {
|
|
5750
|
+
children: /* @__PURE__ */ jsx(Root$2, {
|
|
5751
5751
|
...arrowProps,
|
|
5752
5752
|
ref: forwardedRef,
|
|
5753
5753
|
style: {
|
|
@@ -5804,22 +5804,22 @@ function getSideAndAlignFromPlacement(placement) {
|
|
|
5804
5804
|
}
|
|
5805
5805
|
var Root2$1 = Popper;
|
|
5806
5806
|
var Anchor = PopperAnchor;
|
|
5807
|
-
var Content = PopperContent;
|
|
5807
|
+
var Content$1 = PopperContent;
|
|
5808
5808
|
var Arrow$2 = PopperArrow;
|
|
5809
5809
|
//#endregion
|
|
5810
5810
|
//#region ../../node_modules/.pnpm/@radix-ui+react-portal@1.1.9_@types+react-dom@19.2.3_@types+react@19.2.14__@types+react_266ca67294f168fbf2e025541d323e69/node_modules/@radix-ui/react-portal/dist/index.mjs
|
|
5811
|
-
var PORTAL_NAME$
|
|
5812
|
-
var Portal$
|
|
5811
|
+
var PORTAL_NAME$3 = "Portal";
|
|
5812
|
+
var Portal$2 = React$1.forwardRef((props, forwardedRef) => {
|
|
5813
5813
|
const { container: containerProp, ...portalProps } = props;
|
|
5814
5814
|
const [mounted, setMounted] = React$1.useState(false);
|
|
5815
5815
|
useLayoutEffect2(() => setMounted(true), []);
|
|
5816
5816
|
const container = containerProp || mounted && globalThis?.document?.body;
|
|
5817
|
-
return container ? ReactDOM.createPortal(/* @__PURE__ */ jsx(Primitive.div, {
|
|
5817
|
+
return container ? ReactDOM.createPortal(/* @__PURE__ */ jsx(Primitive$1.div, {
|
|
5818
5818
|
...portalProps,
|
|
5819
5819
|
ref: forwardedRef
|
|
5820
5820
|
}), container) : null;
|
|
5821
5821
|
});
|
|
5822
|
-
Portal$
|
|
5822
|
+
Portal$2.displayName = PORTAL_NAME$3;
|
|
5823
5823
|
//#endregion
|
|
5824
5824
|
//#region ../../node_modules/.pnpm/aria-hidden@1.2.6/node_modules/aria-hidden/dist/es2015/index.js
|
|
5825
5825
|
var getDefaultParent = function(originalTarget) {
|
|
@@ -6700,17 +6700,17 @@ var MenuAnchor = React$1.forwardRef((props, forwardedRef) => {
|
|
|
6700
6700
|
});
|
|
6701
6701
|
});
|
|
6702
6702
|
MenuAnchor.displayName = ANCHOR_NAME;
|
|
6703
|
-
var PORTAL_NAME$
|
|
6704
|
-
var [PortalProvider, usePortalContext] = createMenuContext(PORTAL_NAME$
|
|
6703
|
+
var PORTAL_NAME$2 = "MenuPortal";
|
|
6704
|
+
var [PortalProvider$1, usePortalContext$1] = createMenuContext(PORTAL_NAME$2, { forceMount: void 0 });
|
|
6705
6705
|
var MenuPortal = (props) => {
|
|
6706
6706
|
const { __scopeMenu, forceMount, children, container } = props;
|
|
6707
|
-
const context = useMenuContext(PORTAL_NAME$
|
|
6708
|
-
return /* @__PURE__ */ jsx(PortalProvider, {
|
|
6707
|
+
const context = useMenuContext(PORTAL_NAME$2, __scopeMenu);
|
|
6708
|
+
return /* @__PURE__ */ jsx(PortalProvider$1, {
|
|
6709
6709
|
scope: __scopeMenu,
|
|
6710
6710
|
forceMount,
|
|
6711
6711
|
children: /* @__PURE__ */ jsx(Presence, {
|
|
6712
6712
|
present: forceMount || context.open,
|
|
6713
|
-
children: /* @__PURE__ */ jsx(Portal$
|
|
6713
|
+
children: /* @__PURE__ */ jsx(Portal$2, {
|
|
6714
6714
|
asChild: true,
|
|
6715
6715
|
container,
|
|
6716
6716
|
children
|
|
@@ -6718,14 +6718,14 @@ var MenuPortal = (props) => {
|
|
|
6718
6718
|
})
|
|
6719
6719
|
});
|
|
6720
6720
|
};
|
|
6721
|
-
MenuPortal.displayName = PORTAL_NAME$
|
|
6722
|
-
var CONTENT_NAME$
|
|
6723
|
-
var [MenuContentProvider, useMenuContentContext] = createMenuContext(CONTENT_NAME$
|
|
6721
|
+
MenuPortal.displayName = PORTAL_NAME$2;
|
|
6722
|
+
var CONTENT_NAME$2 = "MenuContent";
|
|
6723
|
+
var [MenuContentProvider, useMenuContentContext] = createMenuContext(CONTENT_NAME$2);
|
|
6724
6724
|
var MenuContent = React$1.forwardRef((props, forwardedRef) => {
|
|
6725
|
-
const portalContext = usePortalContext(CONTENT_NAME$
|
|
6725
|
+
const portalContext = usePortalContext$1(CONTENT_NAME$2, props.__scopeMenu);
|
|
6726
6726
|
const { forceMount = portalContext.forceMount, ...contentProps } = props;
|
|
6727
|
-
const context = useMenuContext(CONTENT_NAME$
|
|
6728
|
-
const rootContext = useMenuRootContext(CONTENT_NAME$
|
|
6727
|
+
const context = useMenuContext(CONTENT_NAME$2, props.__scopeMenu);
|
|
6728
|
+
const rootContext = useMenuRootContext(CONTENT_NAME$2, props.__scopeMenu);
|
|
6729
6729
|
return /* @__PURE__ */ jsx(Collection.Provider, {
|
|
6730
6730
|
scope: props.__scopeMenu,
|
|
6731
6731
|
children: /* @__PURE__ */ jsx(Presence, {
|
|
@@ -6744,7 +6744,7 @@ var MenuContent = React$1.forwardRef((props, forwardedRef) => {
|
|
|
6744
6744
|
});
|
|
6745
6745
|
});
|
|
6746
6746
|
var MenuRootContentModal = React$1.forwardRef((props, forwardedRef) => {
|
|
6747
|
-
const context = useMenuContext(CONTENT_NAME$
|
|
6747
|
+
const context = useMenuContext(CONTENT_NAME$2, props.__scopeMenu);
|
|
6748
6748
|
const ref = React$1.useRef(null);
|
|
6749
6749
|
const composedRefs = useComposedRefs(forwardedRef, ref);
|
|
6750
6750
|
React$1.useEffect(() => {
|
|
@@ -6762,7 +6762,7 @@ var MenuRootContentModal = React$1.forwardRef((props, forwardedRef) => {
|
|
|
6762
6762
|
});
|
|
6763
6763
|
});
|
|
6764
6764
|
var MenuRootContentNonModal = React$1.forwardRef((props, forwardedRef) => {
|
|
6765
|
-
const context = useMenuContext(CONTENT_NAME$
|
|
6765
|
+
const context = useMenuContext(CONTENT_NAME$2, props.__scopeMenu);
|
|
6766
6766
|
return /* @__PURE__ */ jsx(MenuContentImpl, {
|
|
6767
6767
|
...props,
|
|
6768
6768
|
ref: forwardedRef,
|
|
@@ -6772,11 +6772,11 @@ var MenuRootContentNonModal = React$1.forwardRef((props, forwardedRef) => {
|
|
|
6772
6772
|
onDismiss: () => context.onOpenChange(false)
|
|
6773
6773
|
});
|
|
6774
6774
|
});
|
|
6775
|
-
var Slot = createSlot("MenuContent.ScrollLock");
|
|
6775
|
+
var Slot$2 = createSlot$1("MenuContent.ScrollLock");
|
|
6776
6776
|
var MenuContentImpl = React$1.forwardRef((props, forwardedRef) => {
|
|
6777
6777
|
const { __scopeMenu, loop = false, trapFocus, onOpenAutoFocus, onCloseAutoFocus, disableOutsidePointerEvents, onEntryFocus, onEscapeKeyDown, onPointerDownOutside, onFocusOutside, onInteractOutside, onDismiss, disableOutsideScroll, ...contentProps } = props;
|
|
6778
|
-
const context = useMenuContext(CONTENT_NAME$
|
|
6779
|
-
const rootContext = useMenuRootContext(CONTENT_NAME$
|
|
6778
|
+
const context = useMenuContext(CONTENT_NAME$2, __scopeMenu);
|
|
6779
|
+
const rootContext = useMenuRootContext(CONTENT_NAME$2, __scopeMenu);
|
|
6780
6780
|
const popperScope = usePopperScope(__scopeMenu);
|
|
6781
6781
|
const rovingFocusGroupScope = useRovingFocusGroupScope(__scopeMenu);
|
|
6782
6782
|
const getItems = useCollection(__scopeMenu);
|
|
@@ -6791,7 +6791,7 @@ var MenuContentImpl = React$1.forwardRef((props, forwardedRef) => {
|
|
|
6791
6791
|
const lastPointerXRef = React$1.useRef(0);
|
|
6792
6792
|
const ScrollLockWrapper = disableOutsideScroll ? ReactRemoveScroll : React$1.Fragment;
|
|
6793
6793
|
const scrollLockWrapperProps = disableOutsideScroll ? {
|
|
6794
|
-
as: Slot,
|
|
6794
|
+
as: Slot$2,
|
|
6795
6795
|
allowPinchZoom: true
|
|
6796
6796
|
} : void 0;
|
|
6797
6797
|
const handleTypeaheadSearch = (key) => {
|
|
@@ -6851,7 +6851,7 @@ var MenuContentImpl = React$1.forwardRef((props, forwardedRef) => {
|
|
|
6851
6851
|
onFocusOutside,
|
|
6852
6852
|
onInteractOutside,
|
|
6853
6853
|
onDismiss,
|
|
6854
|
-
children: /* @__PURE__ */ jsx(Root$
|
|
6854
|
+
children: /* @__PURE__ */ jsx(Root$3, {
|
|
6855
6855
|
asChild: true,
|
|
6856
6856
|
...rovingFocusGroupScope,
|
|
6857
6857
|
dir: rootContext.dir,
|
|
@@ -6863,7 +6863,7 @@ var MenuContentImpl = React$1.forwardRef((props, forwardedRef) => {
|
|
|
6863
6863
|
if (!rootContext.isUsingKeyboardRef.current) event.preventDefault();
|
|
6864
6864
|
}),
|
|
6865
6865
|
preventScrollOnEntryFocus: true,
|
|
6866
|
-
children: /* @__PURE__ */ jsx(Content, {
|
|
6866
|
+
children: /* @__PURE__ */ jsx(Content$1, {
|
|
6867
6867
|
role: "menu",
|
|
6868
6868
|
"aria-orientation": "vertical",
|
|
6869
6869
|
"data-state": getOpenState(context.open),
|
|
@@ -6913,11 +6913,11 @@ var MenuContentImpl = React$1.forwardRef((props, forwardedRef) => {
|
|
|
6913
6913
|
})
|
|
6914
6914
|
});
|
|
6915
6915
|
});
|
|
6916
|
-
MenuContent.displayName = CONTENT_NAME$
|
|
6916
|
+
MenuContent.displayName = CONTENT_NAME$2;
|
|
6917
6917
|
var GROUP_NAME$1 = "MenuGroup";
|
|
6918
6918
|
var MenuGroup = React$1.forwardRef((props, forwardedRef) => {
|
|
6919
6919
|
const { __scopeMenu, ...groupProps } = props;
|
|
6920
|
-
return /* @__PURE__ */ jsx(Primitive.div, {
|
|
6920
|
+
return /* @__PURE__ */ jsx(Primitive$1.div, {
|
|
6921
6921
|
role: "group",
|
|
6922
6922
|
...groupProps,
|
|
6923
6923
|
ref: forwardedRef
|
|
@@ -6927,7 +6927,7 @@ MenuGroup.displayName = GROUP_NAME$1;
|
|
|
6927
6927
|
var LABEL_NAME$1 = "MenuLabel";
|
|
6928
6928
|
var MenuLabel = React$1.forwardRef((props, forwardedRef) => {
|
|
6929
6929
|
const { __scopeMenu, ...labelProps } = props;
|
|
6930
|
-
return /* @__PURE__ */ jsx(Primitive.div, {
|
|
6930
|
+
return /* @__PURE__ */ jsx(Primitive$1.div, {
|
|
6931
6931
|
...labelProps,
|
|
6932
6932
|
ref: forwardedRef
|
|
6933
6933
|
});
|
|
@@ -6998,7 +6998,7 @@ var MenuItemImpl = React$1.forwardRef((props, forwardedRef) => {
|
|
|
6998
6998
|
asChild: true,
|
|
6999
6999
|
...rovingFocusGroupScope,
|
|
7000
7000
|
focusable: !disabled,
|
|
7001
|
-
children: /* @__PURE__ */ jsx(Primitive.div, {
|
|
7001
|
+
children: /* @__PURE__ */ jsx(Primitive$1.div, {
|
|
7002
7002
|
role: "menuitem",
|
|
7003
7003
|
"data-highlighted": isFocused ? "" : void 0,
|
|
7004
7004
|
"aria-disabled": disabled || void 0,
|
|
@@ -7081,7 +7081,7 @@ var MenuItemIndicator = React$1.forwardRef((props, forwardedRef) => {
|
|
|
7081
7081
|
const indicatorContext = useItemIndicatorContext(ITEM_INDICATOR_NAME, __scopeMenu);
|
|
7082
7082
|
return /* @__PURE__ */ jsx(Presence, {
|
|
7083
7083
|
present: forceMount || isIndeterminate(indicatorContext.checked) || indicatorContext.checked === true,
|
|
7084
|
-
children: /* @__PURE__ */ jsx(Primitive.span, {
|
|
7084
|
+
children: /* @__PURE__ */ jsx(Primitive$1.span, {
|
|
7085
7085
|
...itemIndicatorProps,
|
|
7086
7086
|
ref: forwardedRef,
|
|
7087
7087
|
"data-state": getCheckedState(indicatorContext.checked)
|
|
@@ -7092,7 +7092,7 @@ MenuItemIndicator.displayName = ITEM_INDICATOR_NAME;
|
|
|
7092
7092
|
var SEPARATOR_NAME$1 = "MenuSeparator";
|
|
7093
7093
|
var MenuSeparator = React$1.forwardRef((props, forwardedRef) => {
|
|
7094
7094
|
const { __scopeMenu, ...separatorProps } = props;
|
|
7095
|
-
return /* @__PURE__ */ jsx(Primitive.div, {
|
|
7095
|
+
return /* @__PURE__ */ jsx(Primitive$1.div, {
|
|
7096
7096
|
role: "separator",
|
|
7097
7097
|
"aria-orientation": "horizontal",
|
|
7098
7098
|
...separatorProps,
|
|
@@ -7249,10 +7249,10 @@ var MenuSubTrigger = React$1.forwardRef((props, forwardedRef) => {
|
|
|
7249
7249
|
MenuSubTrigger.displayName = SUB_TRIGGER_NAME$1;
|
|
7250
7250
|
var SUB_CONTENT_NAME$1 = "MenuSubContent";
|
|
7251
7251
|
var MenuSubContent = React$1.forwardRef((props, forwardedRef) => {
|
|
7252
|
-
const portalContext = usePortalContext(CONTENT_NAME$
|
|
7252
|
+
const portalContext = usePortalContext$1(CONTENT_NAME$2, props.__scopeMenu);
|
|
7253
7253
|
const { forceMount = portalContext.forceMount, ...subContentProps } = props;
|
|
7254
|
-
const context = useMenuContext(CONTENT_NAME$
|
|
7255
|
-
const rootContext = useMenuRootContext(CONTENT_NAME$
|
|
7254
|
+
const context = useMenuContext(CONTENT_NAME$2, props.__scopeMenu);
|
|
7255
|
+
const rootContext = useMenuRootContext(CONTENT_NAME$2, props.__scopeMenu);
|
|
7256
7256
|
const subContext = useMenuSubContext(SUB_CONTENT_NAME$1, props.__scopeMenu);
|
|
7257
7257
|
const ref = React$1.useRef(null);
|
|
7258
7258
|
const composedRefs = useComposedRefs(forwardedRef, ref);
|
|
@@ -7353,10 +7353,10 @@ function whenMouse(handler) {
|
|
|
7353
7353
|
}
|
|
7354
7354
|
var Root3 = Menu;
|
|
7355
7355
|
var Anchor2 = MenuAnchor;
|
|
7356
|
-
var Portal = MenuPortal;
|
|
7356
|
+
var Portal$1 = MenuPortal;
|
|
7357
7357
|
var Content2$1 = MenuContent;
|
|
7358
7358
|
var Group = MenuGroup;
|
|
7359
|
-
var Label = MenuLabel;
|
|
7359
|
+
var Label$1 = MenuLabel;
|
|
7360
7360
|
var Item2$1 = MenuItem;
|
|
7361
7361
|
var CheckboxItem = MenuCheckboxItem;
|
|
7362
7362
|
var RadioGroup = MenuRadioGroup;
|
|
@@ -7402,14 +7402,14 @@ var DropdownMenu$1 = (props) => {
|
|
|
7402
7402
|
});
|
|
7403
7403
|
};
|
|
7404
7404
|
DropdownMenu$1.displayName = DROPDOWN_MENU_NAME;
|
|
7405
|
-
var TRIGGER_NAME = "DropdownMenuTrigger";
|
|
7405
|
+
var TRIGGER_NAME$1 = "DropdownMenuTrigger";
|
|
7406
7406
|
var DropdownMenuTrigger$1 = React$1.forwardRef((props, forwardedRef) => {
|
|
7407
7407
|
const { __scopeDropdownMenu, disabled = false, ...triggerProps } = props;
|
|
7408
|
-
const context = useDropdownMenuContext(TRIGGER_NAME, __scopeDropdownMenu);
|
|
7408
|
+
const context = useDropdownMenuContext(TRIGGER_NAME$1, __scopeDropdownMenu);
|
|
7409
7409
|
return /* @__PURE__ */ jsx(Anchor2, {
|
|
7410
7410
|
asChild: true,
|
|
7411
7411
|
...useMenuScope(__scopeDropdownMenu),
|
|
7412
|
-
children: /* @__PURE__ */ jsx(Primitive.button, {
|
|
7412
|
+
children: /* @__PURE__ */ jsx(Primitive$1.button, {
|
|
7413
7413
|
type: "button",
|
|
7414
7414
|
id: context.triggerId,
|
|
7415
7415
|
"aria-haspopup": "menu",
|
|
@@ -7439,20 +7439,20 @@ var DropdownMenuTrigger$1 = React$1.forwardRef((props, forwardedRef) => {
|
|
|
7439
7439
|
})
|
|
7440
7440
|
});
|
|
7441
7441
|
});
|
|
7442
|
-
DropdownMenuTrigger$1.displayName = TRIGGER_NAME;
|
|
7443
|
-
var PORTAL_NAME = "DropdownMenuPortal";
|
|
7442
|
+
DropdownMenuTrigger$1.displayName = TRIGGER_NAME$1;
|
|
7443
|
+
var PORTAL_NAME$1 = "DropdownMenuPortal";
|
|
7444
7444
|
var DropdownMenuPortal = (props) => {
|
|
7445
7445
|
const { __scopeDropdownMenu, ...portalProps } = props;
|
|
7446
|
-
return /* @__PURE__ */ jsx(Portal, {
|
|
7446
|
+
return /* @__PURE__ */ jsx(Portal$1, {
|
|
7447
7447
|
...useMenuScope(__scopeDropdownMenu),
|
|
7448
7448
|
...portalProps
|
|
7449
7449
|
});
|
|
7450
7450
|
};
|
|
7451
|
-
DropdownMenuPortal.displayName = PORTAL_NAME;
|
|
7452
|
-
var CONTENT_NAME = "DropdownMenuContent";
|
|
7451
|
+
DropdownMenuPortal.displayName = PORTAL_NAME$1;
|
|
7452
|
+
var CONTENT_NAME$1 = "DropdownMenuContent";
|
|
7453
7453
|
var DropdownMenuContent$1 = React$1.forwardRef((props, forwardedRef) => {
|
|
7454
7454
|
const { __scopeDropdownMenu, ...contentProps } = props;
|
|
7455
|
-
const context = useDropdownMenuContext(CONTENT_NAME, __scopeDropdownMenu);
|
|
7455
|
+
const context = useDropdownMenuContext(CONTENT_NAME$1, __scopeDropdownMenu);
|
|
7456
7456
|
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
7457
7457
|
const hasInteractedOutsideRef = React$1.useRef(false);
|
|
7458
7458
|
return /* @__PURE__ */ jsx(Content2$1, {
|
|
@@ -7482,7 +7482,7 @@ var DropdownMenuContent$1 = React$1.forwardRef((props, forwardedRef) => {
|
|
|
7482
7482
|
}
|
|
7483
7483
|
});
|
|
7484
7484
|
});
|
|
7485
|
-
DropdownMenuContent$1.displayName = CONTENT_NAME;
|
|
7485
|
+
DropdownMenuContent$1.displayName = CONTENT_NAME$1;
|
|
7486
7486
|
var GROUP_NAME = "DropdownMenuGroup";
|
|
7487
7487
|
var DropdownMenuGroup = React$1.forwardRef((props, forwardedRef) => {
|
|
7488
7488
|
const { __scopeDropdownMenu, ...groupProps } = props;
|
|
@@ -7496,7 +7496,7 @@ DropdownMenuGroup.displayName = GROUP_NAME;
|
|
|
7496
7496
|
var LABEL_NAME = "DropdownMenuLabel";
|
|
7497
7497
|
var DropdownMenuLabel = React$1.forwardRef((props, forwardedRef) => {
|
|
7498
7498
|
const { __scopeDropdownMenu, ...labelProps } = props;
|
|
7499
|
-
return /* @__PURE__ */ jsx(Label, {
|
|
7499
|
+
return /* @__PURE__ */ jsx(Label$1, {
|
|
7500
7500
|
...useMenuScope(__scopeDropdownMenu),
|
|
7501
7501
|
...labelProps,
|
|
7502
7502
|
ref: forwardedRef
|
|
@@ -7607,7 +7607,441 @@ var Portal2 = DropdownMenuPortal;
|
|
|
7607
7607
|
var Content2 = DropdownMenuContent$1;
|
|
7608
7608
|
var Item2 = DropdownMenuItem$1;
|
|
7609
7609
|
//#endregion
|
|
7610
|
-
//#region
|
|
7610
|
+
//#region ../../node_modules/.pnpm/@radix-ui+react-dialog@1.1.15_@types+react-dom@19.2.3_@types+react@19.2.14__@types+reac_340425d8afbecb0b8c61fd2281bc18a1/node_modules/@radix-ui/react-dialog/dist/index.mjs
|
|
7611
|
+
var DIALOG_NAME = "Dialog";
|
|
7612
|
+
var [createDialogContext, createDialogScope] = createContextScope(DIALOG_NAME);
|
|
7613
|
+
var [DialogProvider, useDialogContext] = createDialogContext(DIALOG_NAME);
|
|
7614
|
+
var Dialog = (props) => {
|
|
7615
|
+
const { __scopeDialog, children, open: openProp, defaultOpen, onOpenChange, modal = true } = props;
|
|
7616
|
+
const triggerRef = React$1.useRef(null);
|
|
7617
|
+
const contentRef = React$1.useRef(null);
|
|
7618
|
+
const [open, setOpen] = useControllableState({
|
|
7619
|
+
prop: openProp,
|
|
7620
|
+
defaultProp: defaultOpen ?? false,
|
|
7621
|
+
onChange: onOpenChange,
|
|
7622
|
+
caller: DIALOG_NAME
|
|
7623
|
+
});
|
|
7624
|
+
return /* @__PURE__ */ jsx(DialogProvider, {
|
|
7625
|
+
scope: __scopeDialog,
|
|
7626
|
+
triggerRef,
|
|
7627
|
+
contentRef,
|
|
7628
|
+
contentId: useId$1(),
|
|
7629
|
+
titleId: useId$1(),
|
|
7630
|
+
descriptionId: useId$1(),
|
|
7631
|
+
open,
|
|
7632
|
+
onOpenChange: setOpen,
|
|
7633
|
+
onOpenToggle: React$1.useCallback(() => setOpen((prevOpen) => !prevOpen), [setOpen]),
|
|
7634
|
+
modal,
|
|
7635
|
+
children
|
|
7636
|
+
});
|
|
7637
|
+
};
|
|
7638
|
+
Dialog.displayName = DIALOG_NAME;
|
|
7639
|
+
var TRIGGER_NAME = "DialogTrigger";
|
|
7640
|
+
var DialogTrigger = React$1.forwardRef((props, forwardedRef) => {
|
|
7641
|
+
const { __scopeDialog, ...triggerProps } = props;
|
|
7642
|
+
const context = useDialogContext(TRIGGER_NAME, __scopeDialog);
|
|
7643
|
+
const composedTriggerRef = useComposedRefs(forwardedRef, context.triggerRef);
|
|
7644
|
+
return /* @__PURE__ */ jsx(Primitive$1.button, {
|
|
7645
|
+
type: "button",
|
|
7646
|
+
"aria-haspopup": "dialog",
|
|
7647
|
+
"aria-expanded": context.open,
|
|
7648
|
+
"aria-controls": context.contentId,
|
|
7649
|
+
"data-state": getState(context.open),
|
|
7650
|
+
...triggerProps,
|
|
7651
|
+
ref: composedTriggerRef,
|
|
7652
|
+
onClick: composeEventHandlers(props.onClick, context.onOpenToggle)
|
|
7653
|
+
});
|
|
7654
|
+
});
|
|
7655
|
+
DialogTrigger.displayName = TRIGGER_NAME;
|
|
7656
|
+
var PORTAL_NAME = "DialogPortal";
|
|
7657
|
+
var [PortalProvider, usePortalContext] = createDialogContext(PORTAL_NAME, { forceMount: void 0 });
|
|
7658
|
+
var DialogPortal = (props) => {
|
|
7659
|
+
const { __scopeDialog, forceMount, children, container } = props;
|
|
7660
|
+
const context = useDialogContext(PORTAL_NAME, __scopeDialog);
|
|
7661
|
+
return /* @__PURE__ */ jsx(PortalProvider, {
|
|
7662
|
+
scope: __scopeDialog,
|
|
7663
|
+
forceMount,
|
|
7664
|
+
children: React$1.Children.map(children, (child) => /* @__PURE__ */ jsx(Presence, {
|
|
7665
|
+
present: forceMount || context.open,
|
|
7666
|
+
children: /* @__PURE__ */ jsx(Portal$2, {
|
|
7667
|
+
asChild: true,
|
|
7668
|
+
container,
|
|
7669
|
+
children: child
|
|
7670
|
+
})
|
|
7671
|
+
}))
|
|
7672
|
+
});
|
|
7673
|
+
};
|
|
7674
|
+
DialogPortal.displayName = PORTAL_NAME;
|
|
7675
|
+
var OVERLAY_NAME = "DialogOverlay";
|
|
7676
|
+
var DialogOverlay = React$1.forwardRef((props, forwardedRef) => {
|
|
7677
|
+
const portalContext = usePortalContext(OVERLAY_NAME, props.__scopeDialog);
|
|
7678
|
+
const { forceMount = portalContext.forceMount, ...overlayProps } = props;
|
|
7679
|
+
const context = useDialogContext(OVERLAY_NAME, props.__scopeDialog);
|
|
7680
|
+
return context.modal ? /* @__PURE__ */ jsx(Presence, {
|
|
7681
|
+
present: forceMount || context.open,
|
|
7682
|
+
children: /* @__PURE__ */ jsx(DialogOverlayImpl, {
|
|
7683
|
+
...overlayProps,
|
|
7684
|
+
ref: forwardedRef
|
|
7685
|
+
})
|
|
7686
|
+
}) : null;
|
|
7687
|
+
});
|
|
7688
|
+
DialogOverlay.displayName = OVERLAY_NAME;
|
|
7689
|
+
var Slot$1 = createSlot$1("DialogOverlay.RemoveScroll");
|
|
7690
|
+
var DialogOverlayImpl = React$1.forwardRef((props, forwardedRef) => {
|
|
7691
|
+
const { __scopeDialog, ...overlayProps } = props;
|
|
7692
|
+
const context = useDialogContext(OVERLAY_NAME, __scopeDialog);
|
|
7693
|
+
return /* @__PURE__ */ jsx(ReactRemoveScroll, {
|
|
7694
|
+
as: Slot$1,
|
|
7695
|
+
allowPinchZoom: true,
|
|
7696
|
+
shards: [context.contentRef],
|
|
7697
|
+
children: /* @__PURE__ */ jsx(Primitive$1.div, {
|
|
7698
|
+
"data-state": getState(context.open),
|
|
7699
|
+
...overlayProps,
|
|
7700
|
+
ref: forwardedRef,
|
|
7701
|
+
style: {
|
|
7702
|
+
pointerEvents: "auto",
|
|
7703
|
+
...overlayProps.style
|
|
7704
|
+
}
|
|
7705
|
+
})
|
|
7706
|
+
});
|
|
7707
|
+
});
|
|
7708
|
+
var CONTENT_NAME = "DialogContent";
|
|
7709
|
+
var DialogContent = React$1.forwardRef((props, forwardedRef) => {
|
|
7710
|
+
const portalContext = usePortalContext(CONTENT_NAME, props.__scopeDialog);
|
|
7711
|
+
const { forceMount = portalContext.forceMount, ...contentProps } = props;
|
|
7712
|
+
const context = useDialogContext(CONTENT_NAME, props.__scopeDialog);
|
|
7713
|
+
return /* @__PURE__ */ jsx(Presence, {
|
|
7714
|
+
present: forceMount || context.open,
|
|
7715
|
+
children: context.modal ? /* @__PURE__ */ jsx(DialogContentModal, {
|
|
7716
|
+
...contentProps,
|
|
7717
|
+
ref: forwardedRef
|
|
7718
|
+
}) : /* @__PURE__ */ jsx(DialogContentNonModal, {
|
|
7719
|
+
...contentProps,
|
|
7720
|
+
ref: forwardedRef
|
|
7721
|
+
})
|
|
7722
|
+
});
|
|
7723
|
+
});
|
|
7724
|
+
DialogContent.displayName = CONTENT_NAME;
|
|
7725
|
+
var DialogContentModal = React$1.forwardRef((props, forwardedRef) => {
|
|
7726
|
+
const context = useDialogContext(CONTENT_NAME, props.__scopeDialog);
|
|
7727
|
+
const contentRef = React$1.useRef(null);
|
|
7728
|
+
const composedRefs = useComposedRefs(forwardedRef, context.contentRef, contentRef);
|
|
7729
|
+
React$1.useEffect(() => {
|
|
7730
|
+
const content = contentRef.current;
|
|
7731
|
+
if (content) return hideOthers(content);
|
|
7732
|
+
}, []);
|
|
7733
|
+
return /* @__PURE__ */ jsx(DialogContentImpl, {
|
|
7734
|
+
...props,
|
|
7735
|
+
ref: composedRefs,
|
|
7736
|
+
trapFocus: context.open,
|
|
7737
|
+
disableOutsidePointerEvents: true,
|
|
7738
|
+
onCloseAutoFocus: composeEventHandlers(props.onCloseAutoFocus, (event) => {
|
|
7739
|
+
event.preventDefault();
|
|
7740
|
+
context.triggerRef.current?.focus();
|
|
7741
|
+
}),
|
|
7742
|
+
onPointerDownOutside: composeEventHandlers(props.onPointerDownOutside, (event) => {
|
|
7743
|
+
const originalEvent = event.detail.originalEvent;
|
|
7744
|
+
const ctrlLeftClick = originalEvent.button === 0 && originalEvent.ctrlKey === true;
|
|
7745
|
+
if (originalEvent.button === 2 || ctrlLeftClick) event.preventDefault();
|
|
7746
|
+
}),
|
|
7747
|
+
onFocusOutside: composeEventHandlers(props.onFocusOutside, (event) => event.preventDefault())
|
|
7748
|
+
});
|
|
7749
|
+
});
|
|
7750
|
+
var DialogContentNonModal = React$1.forwardRef((props, forwardedRef) => {
|
|
7751
|
+
const context = useDialogContext(CONTENT_NAME, props.__scopeDialog);
|
|
7752
|
+
const hasInteractedOutsideRef = React$1.useRef(false);
|
|
7753
|
+
const hasPointerDownOutsideRef = React$1.useRef(false);
|
|
7754
|
+
return /* @__PURE__ */ jsx(DialogContentImpl, {
|
|
7755
|
+
...props,
|
|
7756
|
+
ref: forwardedRef,
|
|
7757
|
+
trapFocus: false,
|
|
7758
|
+
disableOutsidePointerEvents: false,
|
|
7759
|
+
onCloseAutoFocus: (event) => {
|
|
7760
|
+
props.onCloseAutoFocus?.(event);
|
|
7761
|
+
if (!event.defaultPrevented) {
|
|
7762
|
+
if (!hasInteractedOutsideRef.current) context.triggerRef.current?.focus();
|
|
7763
|
+
event.preventDefault();
|
|
7764
|
+
}
|
|
7765
|
+
hasInteractedOutsideRef.current = false;
|
|
7766
|
+
hasPointerDownOutsideRef.current = false;
|
|
7767
|
+
},
|
|
7768
|
+
onInteractOutside: (event) => {
|
|
7769
|
+
props.onInteractOutside?.(event);
|
|
7770
|
+
if (!event.defaultPrevented) {
|
|
7771
|
+
hasInteractedOutsideRef.current = true;
|
|
7772
|
+
if (event.detail.originalEvent.type === "pointerdown") hasPointerDownOutsideRef.current = true;
|
|
7773
|
+
}
|
|
7774
|
+
const target = event.target;
|
|
7775
|
+
if (context.triggerRef.current?.contains(target)) event.preventDefault();
|
|
7776
|
+
if (event.detail.originalEvent.type === "focusin" && hasPointerDownOutsideRef.current) event.preventDefault();
|
|
7777
|
+
}
|
|
7778
|
+
});
|
|
7779
|
+
});
|
|
7780
|
+
var DialogContentImpl = React$1.forwardRef((props, forwardedRef) => {
|
|
7781
|
+
const { __scopeDialog, trapFocus, onOpenAutoFocus, onCloseAutoFocus, ...contentProps } = props;
|
|
7782
|
+
const context = useDialogContext(CONTENT_NAME, __scopeDialog);
|
|
7783
|
+
const contentRef = React$1.useRef(null);
|
|
7784
|
+
const composedRefs = useComposedRefs(forwardedRef, contentRef);
|
|
7785
|
+
useFocusGuards();
|
|
7786
|
+
return /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx(FocusScope, {
|
|
7787
|
+
asChild: true,
|
|
7788
|
+
loop: true,
|
|
7789
|
+
trapped: trapFocus,
|
|
7790
|
+
onMountAutoFocus: onOpenAutoFocus,
|
|
7791
|
+
onUnmountAutoFocus: onCloseAutoFocus,
|
|
7792
|
+
children: /* @__PURE__ */ jsx(DismissableLayer, {
|
|
7793
|
+
role: "dialog",
|
|
7794
|
+
id: context.contentId,
|
|
7795
|
+
"aria-describedby": context.descriptionId,
|
|
7796
|
+
"aria-labelledby": context.titleId,
|
|
7797
|
+
"data-state": getState(context.open),
|
|
7798
|
+
...contentProps,
|
|
7799
|
+
ref: composedRefs,
|
|
7800
|
+
onDismiss: () => context.onOpenChange(false)
|
|
7801
|
+
})
|
|
7802
|
+
}), /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx(TitleWarning, { titleId: context.titleId }), /* @__PURE__ */ jsx(DescriptionWarning, {
|
|
7803
|
+
contentRef,
|
|
7804
|
+
descriptionId: context.descriptionId
|
|
7805
|
+
})] })] });
|
|
7806
|
+
});
|
|
7807
|
+
var TITLE_NAME = "DialogTitle";
|
|
7808
|
+
var DialogTitle = React$1.forwardRef((props, forwardedRef) => {
|
|
7809
|
+
const { __scopeDialog, ...titleProps } = props;
|
|
7810
|
+
const context = useDialogContext(TITLE_NAME, __scopeDialog);
|
|
7811
|
+
return /* @__PURE__ */ jsx(Primitive$1.h2, {
|
|
7812
|
+
id: context.titleId,
|
|
7813
|
+
...titleProps,
|
|
7814
|
+
ref: forwardedRef
|
|
7815
|
+
});
|
|
7816
|
+
});
|
|
7817
|
+
DialogTitle.displayName = TITLE_NAME;
|
|
7818
|
+
var DESCRIPTION_NAME = "DialogDescription";
|
|
7819
|
+
var DialogDescription = React$1.forwardRef((props, forwardedRef) => {
|
|
7820
|
+
const { __scopeDialog, ...descriptionProps } = props;
|
|
7821
|
+
const context = useDialogContext(DESCRIPTION_NAME, __scopeDialog);
|
|
7822
|
+
return /* @__PURE__ */ jsx(Primitive$1.p, {
|
|
7823
|
+
id: context.descriptionId,
|
|
7824
|
+
...descriptionProps,
|
|
7825
|
+
ref: forwardedRef
|
|
7826
|
+
});
|
|
7827
|
+
});
|
|
7828
|
+
DialogDescription.displayName = DESCRIPTION_NAME;
|
|
7829
|
+
var CLOSE_NAME = "DialogClose";
|
|
7830
|
+
var DialogClose = React$1.forwardRef((props, forwardedRef) => {
|
|
7831
|
+
const { __scopeDialog, ...closeProps } = props;
|
|
7832
|
+
const context = useDialogContext(CLOSE_NAME, __scopeDialog);
|
|
7833
|
+
return /* @__PURE__ */ jsx(Primitive$1.button, {
|
|
7834
|
+
type: "button",
|
|
7835
|
+
...closeProps,
|
|
7836
|
+
ref: forwardedRef,
|
|
7837
|
+
onClick: composeEventHandlers(props.onClick, () => context.onOpenChange(false))
|
|
7838
|
+
});
|
|
7839
|
+
});
|
|
7840
|
+
DialogClose.displayName = CLOSE_NAME;
|
|
7841
|
+
function getState(open) {
|
|
7842
|
+
return open ? "open" : "closed";
|
|
7843
|
+
}
|
|
7844
|
+
var TITLE_WARNING_NAME = "DialogTitleWarning";
|
|
7845
|
+
var [WarningProvider, useWarningContext] = createContext2(TITLE_WARNING_NAME, {
|
|
7846
|
+
contentName: CONTENT_NAME,
|
|
7847
|
+
titleName: TITLE_NAME,
|
|
7848
|
+
docsSlug: "dialog"
|
|
7849
|
+
});
|
|
7850
|
+
var TitleWarning = ({ titleId }) => {
|
|
7851
|
+
const titleWarningContext = useWarningContext(TITLE_WARNING_NAME);
|
|
7852
|
+
const MESSAGE = `\`${titleWarningContext.contentName}\` requires a \`${titleWarningContext.titleName}\` for the component to be accessible for screen reader users.
|
|
7853
|
+
|
|
7854
|
+
If you want to hide the \`${titleWarningContext.titleName}\`, you can wrap it with our VisuallyHidden component.
|
|
7855
|
+
|
|
7856
|
+
For more information, see https://radix-ui.com/primitives/docs/components/${titleWarningContext.docsSlug}`;
|
|
7857
|
+
React$1.useEffect(() => {
|
|
7858
|
+
if (titleId) {
|
|
7859
|
+
if (!document.getElementById(titleId)) console.error(MESSAGE);
|
|
7860
|
+
}
|
|
7861
|
+
}, [MESSAGE, titleId]);
|
|
7862
|
+
return null;
|
|
7863
|
+
};
|
|
7864
|
+
var DESCRIPTION_WARNING_NAME = "DialogDescriptionWarning";
|
|
7865
|
+
var DescriptionWarning = ({ contentRef, descriptionId }) => {
|
|
7866
|
+
const MESSAGE = `Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${useWarningContext(DESCRIPTION_WARNING_NAME).contentName}}.`;
|
|
7867
|
+
React$1.useEffect(() => {
|
|
7868
|
+
const describedById = contentRef.current?.getAttribute("aria-describedby");
|
|
7869
|
+
if (descriptionId && describedById) {
|
|
7870
|
+
if (!document.getElementById(descriptionId)) console.warn(MESSAGE);
|
|
7871
|
+
}
|
|
7872
|
+
}, [
|
|
7873
|
+
MESSAGE,
|
|
7874
|
+
contentRef,
|
|
7875
|
+
descriptionId
|
|
7876
|
+
]);
|
|
7877
|
+
return null;
|
|
7878
|
+
};
|
|
7879
|
+
var Root$1 = Dialog;
|
|
7880
|
+
var Portal = DialogPortal;
|
|
7881
|
+
var Overlay = DialogOverlay;
|
|
7882
|
+
var Content = DialogContent;
|
|
7883
|
+
var Title = DialogTitle;
|
|
7884
|
+
var Description = DialogDescription;
|
|
7885
|
+
//#endregion
|
|
7886
|
+
//#region ../../node_modules/.pnpm/@radix-ui+react-slot@1.2.4_@types+react@19.2.14_react@19.2.6/node_modules/@radix-ui/react-slot/dist/index.mjs
|
|
7887
|
+
var REACT_LAZY_TYPE = Symbol.for("react.lazy");
|
|
7888
|
+
var use$1 = React$1[" use ".trim().toString()];
|
|
7889
|
+
function isPromiseLike(value) {
|
|
7890
|
+
return typeof value === "object" && value !== null && "then" in value;
|
|
7891
|
+
}
|
|
7892
|
+
function isLazyComponent(element) {
|
|
7893
|
+
return element != null && typeof element === "object" && "$$typeof" in element && element.$$typeof === REACT_LAZY_TYPE && "_payload" in element && isPromiseLike(element._payload);
|
|
7894
|
+
}
|
|
7895
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
7896
|
+
function createSlot(ownerName) {
|
|
7897
|
+
const SlotClone = /* @__PURE__ */ createSlotClone(ownerName);
|
|
7898
|
+
const Slot2 = React$1.forwardRef((props, forwardedRef) => {
|
|
7899
|
+
let { children, ...slotProps } = props;
|
|
7900
|
+
if (isLazyComponent(children) && typeof use$1 === "function") children = use$1(children._payload);
|
|
7901
|
+
const childrenArray = React$1.Children.toArray(children);
|
|
7902
|
+
const slottable = childrenArray.find(isSlottable);
|
|
7903
|
+
if (slottable) {
|
|
7904
|
+
const newElement = slottable.props.children;
|
|
7905
|
+
const newChildren = childrenArray.map((child) => {
|
|
7906
|
+
if (child === slottable) {
|
|
7907
|
+
if (React$1.Children.count(newElement) > 1) return React$1.Children.only(null);
|
|
7908
|
+
return React$1.isValidElement(newElement) ? newElement.props.children : null;
|
|
7909
|
+
} else return child;
|
|
7910
|
+
});
|
|
7911
|
+
return /* @__PURE__ */ jsx(SlotClone, {
|
|
7912
|
+
...slotProps,
|
|
7913
|
+
ref: forwardedRef,
|
|
7914
|
+
children: React$1.isValidElement(newElement) ? React$1.cloneElement(newElement, void 0, newChildren) : null
|
|
7915
|
+
});
|
|
7916
|
+
}
|
|
7917
|
+
return /* @__PURE__ */ jsx(SlotClone, {
|
|
7918
|
+
...slotProps,
|
|
7919
|
+
ref: forwardedRef,
|
|
7920
|
+
children
|
|
7921
|
+
});
|
|
7922
|
+
});
|
|
7923
|
+
Slot2.displayName = `${ownerName}.Slot`;
|
|
7924
|
+
return Slot2;
|
|
7925
|
+
}
|
|
7926
|
+
var Slot = /* @__PURE__ */ createSlot("Slot");
|
|
7927
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
7928
|
+
function createSlotClone(ownerName) {
|
|
7929
|
+
const SlotClone = React$1.forwardRef((props, forwardedRef) => {
|
|
7930
|
+
let { children, ...slotProps } = props;
|
|
7931
|
+
if (isLazyComponent(children) && typeof use$1 === "function") children = use$1(children._payload);
|
|
7932
|
+
if (React$1.isValidElement(children)) {
|
|
7933
|
+
const childrenRef = getElementRef(children);
|
|
7934
|
+
const props2 = mergeProps(slotProps, children.props);
|
|
7935
|
+
if (children.type !== React$1.Fragment) props2.ref = forwardedRef ? composeRefs(forwardedRef, childrenRef) : childrenRef;
|
|
7936
|
+
return React$1.cloneElement(children, props2);
|
|
7937
|
+
}
|
|
7938
|
+
return React$1.Children.count(children) > 1 ? React$1.Children.only(null) : null;
|
|
7939
|
+
});
|
|
7940
|
+
SlotClone.displayName = `${ownerName}.SlotClone`;
|
|
7941
|
+
return SlotClone;
|
|
7942
|
+
}
|
|
7943
|
+
var SLOTTABLE_IDENTIFIER = Symbol("radix.slottable");
|
|
7944
|
+
function isSlottable(child) {
|
|
7945
|
+
return React$1.isValidElement(child) && typeof child.type === "function" && "__radixId" in child.type && child.type.__radixId === SLOTTABLE_IDENTIFIER;
|
|
7946
|
+
}
|
|
7947
|
+
function mergeProps(slotProps, childProps) {
|
|
7948
|
+
const overrideProps = { ...childProps };
|
|
7949
|
+
for (const propName in childProps) {
|
|
7950
|
+
const slotPropValue = slotProps[propName];
|
|
7951
|
+
const childPropValue = childProps[propName];
|
|
7952
|
+
if (/^on[A-Z]/.test(propName)) {
|
|
7953
|
+
if (slotPropValue && childPropValue) overrideProps[propName] = (...args) => {
|
|
7954
|
+
const result = childPropValue(...args);
|
|
7955
|
+
slotPropValue(...args);
|
|
7956
|
+
return result;
|
|
7957
|
+
};
|
|
7958
|
+
else if (slotPropValue) overrideProps[propName] = slotPropValue;
|
|
7959
|
+
} else if (propName === "style") overrideProps[propName] = {
|
|
7960
|
+
...slotPropValue,
|
|
7961
|
+
...childPropValue
|
|
7962
|
+
};
|
|
7963
|
+
else if (propName === "className") overrideProps[propName] = [slotPropValue, childPropValue].filter(Boolean).join(" ");
|
|
7964
|
+
}
|
|
7965
|
+
return {
|
|
7966
|
+
...slotProps,
|
|
7967
|
+
...overrideProps
|
|
7968
|
+
};
|
|
7969
|
+
}
|
|
7970
|
+
function getElementRef(element) {
|
|
7971
|
+
let getter = Object.getOwnPropertyDescriptor(element.props, "ref")?.get;
|
|
7972
|
+
let mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning;
|
|
7973
|
+
if (mayWarn) return element.ref;
|
|
7974
|
+
getter = Object.getOwnPropertyDescriptor(element, "ref")?.get;
|
|
7975
|
+
mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning;
|
|
7976
|
+
if (mayWarn) return element.props.ref;
|
|
7977
|
+
return element.props.ref || element.ref;
|
|
7978
|
+
}
|
|
7979
|
+
//#endregion
|
|
7980
|
+
//#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
|
|
7981
|
+
var Primitive = [
|
|
7982
|
+
"a",
|
|
7983
|
+
"button",
|
|
7984
|
+
"div",
|
|
7985
|
+
"form",
|
|
7986
|
+
"h2",
|
|
7987
|
+
"h3",
|
|
7988
|
+
"img",
|
|
7989
|
+
"input",
|
|
7990
|
+
"label",
|
|
7991
|
+
"li",
|
|
7992
|
+
"nav",
|
|
7993
|
+
"ol",
|
|
7994
|
+
"p",
|
|
7995
|
+
"select",
|
|
7996
|
+
"span",
|
|
7997
|
+
"svg",
|
|
7998
|
+
"ul"
|
|
7999
|
+
].reduce((primitive, node) => {
|
|
8000
|
+
const Slot = /* @__PURE__ */ createSlot(`Primitive.${node}`);
|
|
8001
|
+
const Node = React$1.forwardRef((props, forwardedRef) => {
|
|
8002
|
+
const { asChild, ...primitiveProps } = props;
|
|
8003
|
+
const Comp = asChild ? Slot : node;
|
|
8004
|
+
if (typeof window !== "undefined") window[Symbol.for("radix-ui")] = true;
|
|
8005
|
+
return /* @__PURE__ */ jsx(Comp, {
|
|
8006
|
+
...primitiveProps,
|
|
8007
|
+
ref: forwardedRef
|
|
8008
|
+
});
|
|
8009
|
+
});
|
|
8010
|
+
Node.displayName = `Primitive.${node}`;
|
|
8011
|
+
return {
|
|
8012
|
+
...primitive,
|
|
8013
|
+
[node]: Node
|
|
8014
|
+
};
|
|
8015
|
+
}, {});
|
|
8016
|
+
//#endregion
|
|
8017
|
+
//#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
|
|
8018
|
+
var VISUALLY_HIDDEN_STYLES = Object.freeze({
|
|
8019
|
+
position: "absolute",
|
|
8020
|
+
border: 0,
|
|
8021
|
+
width: 1,
|
|
8022
|
+
height: 1,
|
|
8023
|
+
padding: 0,
|
|
8024
|
+
margin: -1,
|
|
8025
|
+
overflow: "hidden",
|
|
8026
|
+
clip: "rect(0, 0, 0, 0)",
|
|
8027
|
+
whiteSpace: "nowrap",
|
|
8028
|
+
wordWrap: "normal"
|
|
8029
|
+
});
|
|
8030
|
+
var NAME = "VisuallyHidden";
|
|
8031
|
+
var VisuallyHidden = React$1.forwardRef((props, forwardedRef) => {
|
|
8032
|
+
return /* @__PURE__ */ jsx(Primitive.span, {
|
|
8033
|
+
...props,
|
|
8034
|
+
ref: forwardedRef,
|
|
8035
|
+
style: {
|
|
8036
|
+
...VISUALLY_HIDDEN_STYLES,
|
|
8037
|
+
...props.style
|
|
8038
|
+
}
|
|
8039
|
+
});
|
|
8040
|
+
});
|
|
8041
|
+
VisuallyHidden.displayName = NAME;
|
|
8042
|
+
var Root = VisuallyHidden;
|
|
8043
|
+
//#endregion
|
|
8044
|
+
//#region ../design-system/dist/src-CVV6HzQZ.js
|
|
7611
8045
|
const PowerhouseButton = /* @__PURE__ */ forwardRef(function PowerhouseButton(props, ref) {
|
|
7612
8046
|
const { color = "dark", size = "medium", className = "", children, icon, iconPosition = "left", ...delegatedProps } = props;
|
|
7613
8047
|
return /* @__PURE__ */ jsxs("button", {
|
|
@@ -7639,6 +8073,24 @@ const DropdownMenuContent = /* @__PURE__ */ forwardRef(function DropdownMenuCont
|
|
|
7639
8073
|
}) });
|
|
7640
8074
|
});
|
|
7641
8075
|
const DropdownMenuItem = Item2;
|
|
8076
|
+
function Modal(props) {
|
|
8077
|
+
const { title, open, onOpenChange, contentProps, overlayProps, children, ...delegated } = props;
|
|
8078
|
+
return /* @__PURE__ */ jsx(Root$1, {
|
|
8079
|
+
defaultOpen: open,
|
|
8080
|
+
onOpenChange,
|
|
8081
|
+
open,
|
|
8082
|
+
children: /* @__PURE__ */ jsx(Portal, { children: /* @__PURE__ */ jsx(Overlay, {
|
|
8083
|
+
...overlayProps,
|
|
8084
|
+
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),
|
|
8085
|
+
children: /* @__PURE__ */ jsxs(Content, {
|
|
8086
|
+
...delegated,
|
|
8087
|
+
...contentProps,
|
|
8088
|
+
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),
|
|
8089
|
+
children: [/* @__PURE__ */ jsxs(Root, { children: [/* @__PURE__ */ jsx(Title, { children: title || "Modal" }), /* @__PURE__ */ jsx(Description, { children: title || "Modal" })] }), children]
|
|
8090
|
+
})
|
|
8091
|
+
}) })
|
|
8092
|
+
});
|
|
8093
|
+
}
|
|
7642
8094
|
const useWindowSize = () => {
|
|
7643
8095
|
const [windowSize, setWindowSize] = useState({
|
|
7644
8096
|
innerWidth: window.innerWidth,
|
|
@@ -7659,136 +8111,6 @@ const useWindowSize = () => {
|
|
|
7659
8111
|
return windowSize;
|
|
7660
8112
|
};
|
|
7661
8113
|
//#endregion
|
|
7662
|
-
//#region ../../node_modules/.pnpm/remeda@2.33.7/node_modules/remeda/dist/addProp.js
|
|
7663
|
-
function t$8(...t) {
|
|
7664
|
-
return t$9(n$5, t);
|
|
7665
|
-
}
|
|
7666
|
-
const n$5 = (e, t, n) => ({
|
|
7667
|
-
...e,
|
|
7668
|
-
[t]: n
|
|
7669
|
-
});
|
|
7670
|
-
//#endregion
|
|
7671
|
-
//#region ../../node_modules/.pnpm/remeda@2.33.7/node_modules/remeda/dist/defaultTo.js
|
|
7672
|
-
function t$7(...t) {
|
|
7673
|
-
return t$9(n$4, t);
|
|
7674
|
-
}
|
|
7675
|
-
const n$4 = (e, t) => e ?? t, t$6 = {
|
|
7676
|
-
done: !1,
|
|
7677
|
-
hasNext: !1
|
|
7678
|
-
};
|
|
7679
|
-
//#endregion
|
|
7680
|
-
//#region ../../node_modules/.pnpm/remeda@2.33.7/node_modules/remeda/dist/pipe.js
|
|
7681
|
-
function t$5(e, ...t) {
|
|
7682
|
-
let a = e, o = t.map((e) => `lazy` in e ? r$2(e) : void 0), s = 0;
|
|
7683
|
-
for (; s < t.length;) {
|
|
7684
|
-
if (o[s] === void 0 || !i$1(a)) {
|
|
7685
|
-
let e = t[s];
|
|
7686
|
-
a = e(a), s += 1;
|
|
7687
|
-
continue;
|
|
7688
|
-
}
|
|
7689
|
-
let e = [];
|
|
7690
|
-
for (let n = s; n < t.length; n++) {
|
|
7691
|
-
let t = o[n];
|
|
7692
|
-
if (t === void 0 || (e.push(t), t.isSingle)) break;
|
|
7693
|
-
}
|
|
7694
|
-
let r = [];
|
|
7695
|
-
for (let t of a) if (n$2(t, r, e)) break;
|
|
7696
|
-
let { isSingle: c } = e.at(-1);
|
|
7697
|
-
a = c ? r[0] : r, s += e.length;
|
|
7698
|
-
}
|
|
7699
|
-
return a;
|
|
7700
|
-
}
|
|
7701
|
-
function n$2(t, r, i) {
|
|
7702
|
-
if (i.length === 0) return r.push(t), !1;
|
|
7703
|
-
let a = t, o = t$6, s = !1;
|
|
7704
|
-
for (let [e, t] of i.entries()) {
|
|
7705
|
-
let { index: c, items: l } = t;
|
|
7706
|
-
if (l.push(a), o = t(a, c, l), t.index += 1, o.hasNext) {
|
|
7707
|
-
if (o.hasMany ?? !1) {
|
|
7708
|
-
for (let t of o.next) if (n$2(t, r, i.slice(e + 1))) return !0;
|
|
7709
|
-
return s;
|
|
7710
|
-
}
|
|
7711
|
-
a = o.next;
|
|
7712
|
-
}
|
|
7713
|
-
if (!o.hasNext) break;
|
|
7714
|
-
o.done && (s = !0);
|
|
7715
|
-
}
|
|
7716
|
-
return o.hasNext && r.push(a), s;
|
|
7717
|
-
}
|
|
7718
|
-
function r$2(e) {
|
|
7719
|
-
let { lazy: t, lazyArgs: n } = e, r = t(...n);
|
|
7720
|
-
return Object.assign(r, {
|
|
7721
|
-
isSingle: t.single ?? !1,
|
|
7722
|
-
index: 0,
|
|
7723
|
-
items: []
|
|
7724
|
-
});
|
|
7725
|
-
}
|
|
7726
|
-
function i$1(e) {
|
|
7727
|
-
return typeof e == `string` || typeof e == `object` && !!e && Symbol.iterator in e;
|
|
7728
|
-
}
|
|
7729
|
-
//#endregion
|
|
7730
|
-
//#region ../../node_modules/.pnpm/remeda@2.33.7/node_modules/remeda/dist/entries.js
|
|
7731
|
-
function t$4(...t) {
|
|
7732
|
-
return t$9(Object.entries, t);
|
|
7733
|
-
}
|
|
7734
|
-
//#endregion
|
|
7735
|
-
//#region ../../node_modules/.pnpm/remeda@2.33.7/node_modules/remeda/dist/filter.js
|
|
7736
|
-
function n$1(...t) {
|
|
7737
|
-
return t$9(r$1, t, i);
|
|
7738
|
-
}
|
|
7739
|
-
const r$1 = (e, t) => e.filter(t), i = (e) => (n, r, i) => e(n, r, i) ? {
|
|
7740
|
-
done: !1,
|
|
7741
|
-
hasNext: !0,
|
|
7742
|
-
next: n
|
|
7743
|
-
} : t$6;
|
|
7744
|
-
//#endregion
|
|
7745
|
-
//#region ../../node_modules/.pnpm/remeda@2.33.7/node_modules/remeda/dist/isArray.js
|
|
7746
|
-
function e$2(e) {
|
|
7747
|
-
return Array.isArray(e);
|
|
7748
|
-
}
|
|
7749
|
-
//#endregion
|
|
7750
|
-
//#region ../../node_modules/.pnpm/remeda@2.33.7/node_modules/remeda/dist/isIncludedIn.js
|
|
7751
|
-
function e$1(e, t) {
|
|
7752
|
-
if (t === void 0) {
|
|
7753
|
-
let t = new Set(e);
|
|
7754
|
-
return (e) => t.has(e);
|
|
7755
|
-
}
|
|
7756
|
-
return t.includes(e);
|
|
7757
|
-
}
|
|
7758
|
-
//#endregion
|
|
7759
|
-
//#region ../../node_modules/.pnpm/remeda@2.33.7/node_modules/remeda/dist/keys.js
|
|
7760
|
-
function t$3(...t) {
|
|
7761
|
-
return t$9(Object.keys, t);
|
|
7762
|
-
}
|
|
7763
|
-
//#endregion
|
|
7764
|
-
//#region ../../node_modules/.pnpm/remeda@2.33.7/node_modules/remeda/dist/map.js
|
|
7765
|
-
function t$2(...t) {
|
|
7766
|
-
return t$9(n, t, r);
|
|
7767
|
-
}
|
|
7768
|
-
const n = (e, t) => e.map(t), r = (e) => (t, n, r) => ({
|
|
7769
|
-
done: !1,
|
|
7770
|
-
hasNext: !0,
|
|
7771
|
-
next: e(t, n, r)
|
|
7772
|
-
});
|
|
7773
|
-
//#endregion
|
|
7774
|
-
//#region ../../node_modules/.pnpm/remeda@2.33.7/node_modules/remeda/dist/prop.js
|
|
7775
|
-
function e(e, ...n) {
|
|
7776
|
-
return typeof e == `string` || typeof e == `number` || typeof e == `symbol` ? (r) => t$1(r, e, ...n) : t$1(e, ...n);
|
|
7777
|
-
}
|
|
7778
|
-
function t$1(e, ...t) {
|
|
7779
|
-
let n = e;
|
|
7780
|
-
for (let e of t) {
|
|
7781
|
-
if (n == null) return;
|
|
7782
|
-
n = n[e];
|
|
7783
|
-
}
|
|
7784
|
-
return n;
|
|
7785
|
-
}
|
|
7786
|
-
//#endregion
|
|
7787
|
-
//#region ../../node_modules/.pnpm/remeda@2.33.7/node_modules/remeda/dist/values.js
|
|
7788
|
-
function t(...t) {
|
|
7789
|
-
return t$9(Object.values, t);
|
|
7790
|
-
}
|
|
7791
|
-
//#endregion
|
|
7792
8114
|
//#region ../../node_modules/.pnpm/react-hook-form@7.71.2_react@19.2.6/node_modules/react-hook-form/dist/index.esm.mjs
|
|
7793
8115
|
var isCheckBoxInput = (element) => element.type === "checkbox";
|
|
7794
8116
|
var isDateObject = (value) => value instanceof Date;
|
|
@@ -9978,6 +10300,136 @@ function useOnClickOutside(ref, handler, eventType = "mousedown", eventListenerO
|
|
|
9978
10300
|
}, void 0, eventListenerOptions);
|
|
9979
10301
|
}
|
|
9980
10302
|
//#endregion
|
|
10303
|
+
//#region ../../node_modules/.pnpm/remeda@2.33.7/node_modules/remeda/dist/addProp.js
|
|
10304
|
+
function t$8(...t) {
|
|
10305
|
+
return t$9(n$5, t);
|
|
10306
|
+
}
|
|
10307
|
+
const n$5 = (e, t, n) => ({
|
|
10308
|
+
...e,
|
|
10309
|
+
[t]: n
|
|
10310
|
+
});
|
|
10311
|
+
//#endregion
|
|
10312
|
+
//#region ../../node_modules/.pnpm/remeda@2.33.7/node_modules/remeda/dist/defaultTo.js
|
|
10313
|
+
function t$7(...t) {
|
|
10314
|
+
return t$9(n$4, t);
|
|
10315
|
+
}
|
|
10316
|
+
const n$4 = (e, t) => e ?? t, t$6 = {
|
|
10317
|
+
done: !1,
|
|
10318
|
+
hasNext: !1
|
|
10319
|
+
};
|
|
10320
|
+
//#endregion
|
|
10321
|
+
//#region ../../node_modules/.pnpm/remeda@2.33.7/node_modules/remeda/dist/pipe.js
|
|
10322
|
+
function t$5(e, ...t) {
|
|
10323
|
+
let a = e, o = t.map((e) => `lazy` in e ? r$2(e) : void 0), s = 0;
|
|
10324
|
+
for (; s < t.length;) {
|
|
10325
|
+
if (o[s] === void 0 || !i$1(a)) {
|
|
10326
|
+
let e = t[s];
|
|
10327
|
+
a = e(a), s += 1;
|
|
10328
|
+
continue;
|
|
10329
|
+
}
|
|
10330
|
+
let e = [];
|
|
10331
|
+
for (let n = s; n < t.length; n++) {
|
|
10332
|
+
let t = o[n];
|
|
10333
|
+
if (t === void 0 || (e.push(t), t.isSingle)) break;
|
|
10334
|
+
}
|
|
10335
|
+
let r = [];
|
|
10336
|
+
for (let t of a) if (n$2(t, r, e)) break;
|
|
10337
|
+
let { isSingle: c } = e.at(-1);
|
|
10338
|
+
a = c ? r[0] : r, s += e.length;
|
|
10339
|
+
}
|
|
10340
|
+
return a;
|
|
10341
|
+
}
|
|
10342
|
+
function n$2(t, r, i) {
|
|
10343
|
+
if (i.length === 0) return r.push(t), !1;
|
|
10344
|
+
let a = t, o = t$6, s = !1;
|
|
10345
|
+
for (let [e, t] of i.entries()) {
|
|
10346
|
+
let { index: c, items: l } = t;
|
|
10347
|
+
if (l.push(a), o = t(a, c, l), t.index += 1, o.hasNext) {
|
|
10348
|
+
if (o.hasMany ?? !1) {
|
|
10349
|
+
for (let t of o.next) if (n$2(t, r, i.slice(e + 1))) return !0;
|
|
10350
|
+
return s;
|
|
10351
|
+
}
|
|
10352
|
+
a = o.next;
|
|
10353
|
+
}
|
|
10354
|
+
if (!o.hasNext) break;
|
|
10355
|
+
o.done && (s = !0);
|
|
10356
|
+
}
|
|
10357
|
+
return o.hasNext && r.push(a), s;
|
|
10358
|
+
}
|
|
10359
|
+
function r$2(e) {
|
|
10360
|
+
let { lazy: t, lazyArgs: n } = e, r = t(...n);
|
|
10361
|
+
return Object.assign(r, {
|
|
10362
|
+
isSingle: t.single ?? !1,
|
|
10363
|
+
index: 0,
|
|
10364
|
+
items: []
|
|
10365
|
+
});
|
|
10366
|
+
}
|
|
10367
|
+
function i$1(e) {
|
|
10368
|
+
return typeof e == `string` || typeof e == `object` && !!e && Symbol.iterator in e;
|
|
10369
|
+
}
|
|
10370
|
+
//#endregion
|
|
10371
|
+
//#region ../../node_modules/.pnpm/remeda@2.33.7/node_modules/remeda/dist/entries.js
|
|
10372
|
+
function t$4(...t) {
|
|
10373
|
+
return t$9(Object.entries, t);
|
|
10374
|
+
}
|
|
10375
|
+
//#endregion
|
|
10376
|
+
//#region ../../node_modules/.pnpm/remeda@2.33.7/node_modules/remeda/dist/filter.js
|
|
10377
|
+
function n$1(...t) {
|
|
10378
|
+
return t$9(r$1, t, i);
|
|
10379
|
+
}
|
|
10380
|
+
const r$1 = (e, t) => e.filter(t), i = (e) => (n, r, i) => e(n, r, i) ? {
|
|
10381
|
+
done: !1,
|
|
10382
|
+
hasNext: !0,
|
|
10383
|
+
next: n
|
|
10384
|
+
} : t$6;
|
|
10385
|
+
//#endregion
|
|
10386
|
+
//#region ../../node_modules/.pnpm/remeda@2.33.7/node_modules/remeda/dist/isArray.js
|
|
10387
|
+
function e$2(e) {
|
|
10388
|
+
return Array.isArray(e);
|
|
10389
|
+
}
|
|
10390
|
+
//#endregion
|
|
10391
|
+
//#region ../../node_modules/.pnpm/remeda@2.33.7/node_modules/remeda/dist/isIncludedIn.js
|
|
10392
|
+
function e$1(e, t) {
|
|
10393
|
+
if (t === void 0) {
|
|
10394
|
+
let t = new Set(e);
|
|
10395
|
+
return (e) => t.has(e);
|
|
10396
|
+
}
|
|
10397
|
+
return t.includes(e);
|
|
10398
|
+
}
|
|
10399
|
+
//#endregion
|
|
10400
|
+
//#region ../../node_modules/.pnpm/remeda@2.33.7/node_modules/remeda/dist/keys.js
|
|
10401
|
+
function t$3(...t) {
|
|
10402
|
+
return t$9(Object.keys, t);
|
|
10403
|
+
}
|
|
10404
|
+
//#endregion
|
|
10405
|
+
//#region ../../node_modules/.pnpm/remeda@2.33.7/node_modules/remeda/dist/map.js
|
|
10406
|
+
function t$2(...t) {
|
|
10407
|
+
return t$9(n, t, r);
|
|
10408
|
+
}
|
|
10409
|
+
const n = (e, t) => e.map(t), r = (e) => (t, n, r) => ({
|
|
10410
|
+
done: !1,
|
|
10411
|
+
hasNext: !0,
|
|
10412
|
+
next: e(t, n, r)
|
|
10413
|
+
});
|
|
10414
|
+
//#endregion
|
|
10415
|
+
//#region ../../node_modules/.pnpm/remeda@2.33.7/node_modules/remeda/dist/prop.js
|
|
10416
|
+
function e(e, ...n) {
|
|
10417
|
+
return typeof e == `string` || typeof e == `number` || typeof e == `symbol` ? (r) => t$1(r, e, ...n) : t$1(e, ...n);
|
|
10418
|
+
}
|
|
10419
|
+
function t$1(e, ...t) {
|
|
10420
|
+
let n = e;
|
|
10421
|
+
for (let e of t) {
|
|
10422
|
+
if (n == null) return;
|
|
10423
|
+
n = n[e];
|
|
10424
|
+
}
|
|
10425
|
+
return n;
|
|
10426
|
+
}
|
|
10427
|
+
//#endregion
|
|
10428
|
+
//#region ../../node_modules/.pnpm/remeda@2.33.7/node_modules/remeda/dist/values.js
|
|
10429
|
+
function t(...t) {
|
|
10430
|
+
return t$9(Object.values, t);
|
|
10431
|
+
}
|
|
10432
|
+
//#endregion
|
|
9981
10433
|
//#region ../../node_modules/.pnpm/@babel+runtime@7.29.2/node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js
|
|
9982
10434
|
function _objectWithoutPropertiesLoose(r, e) {
|
|
9983
10435
|
if (null == r) return {};
|
|
@@ -12545,7 +12997,7 @@ function Breadcrumbs() {
|
|
|
12545
12997
|
}
|
|
12546
12998
|
function onSubmit(name) {
|
|
12547
12999
|
if (!isAllowedToCreateDocuments || !selectedDriveId) return;
|
|
12548
|
-
addFolder(selectedDriveId, name, selectedNodePath.at(-1)?.id).then((node) => {
|
|
13000
|
+
addFolder$1(selectedDriveId, name, selectedNodePath.at(-1)?.id).then((node) => {
|
|
12549
13001
|
setSelectedNode(node);
|
|
12550
13002
|
}).catch((error) => {
|
|
12551
13003
|
console.error(error);
|
|
@@ -12622,6 +13074,86 @@ function Breadcrumb(props) {
|
|
|
12622
13074
|
children: name
|
|
12623
13075
|
});
|
|
12624
13076
|
}
|
|
13077
|
+
const defaultStyle = "min-h-12 min-w-35.5 flex-1 transform place-items-center rounded-xl px-6 py-3 text-base font-semibold transition-all outline-none hover:hover-effect active:active-effect disabled:disabled-effect";
|
|
13078
|
+
function ModalButton(props) {
|
|
13079
|
+
const { variant, className, ...rest } = props;
|
|
13080
|
+
const confirmStyle = twMerge(defaultStyle, "bg-primary text-primary-foreground");
|
|
13081
|
+
const cancelStyle = twMerge(defaultStyle, "bg-muted text-muted-foreground");
|
|
13082
|
+
return /* @__PURE__ */ jsx("button", {
|
|
13083
|
+
className: twMerge(variant === "confirm" ? confirmStyle : cancelStyle, className),
|
|
13084
|
+
...rest
|
|
13085
|
+
});
|
|
13086
|
+
}
|
|
13087
|
+
function fixedForwardRef(render) {
|
|
13088
|
+
return /* @__PURE__ */ forwardRef(render);
|
|
13089
|
+
}
|
|
13090
|
+
const ConnectSelect = /* @__PURE__ */ fixedForwardRef(function Select(props, ref) {
|
|
13091
|
+
const { items, value, id, onChange, containerClassName, menuClassName, itemClassName, absolutePositionMenu = false, borderRadius = "6px", listClassName } = props;
|
|
13092
|
+
const [showItems, setShowItems] = useState(false);
|
|
13093
|
+
const containerRef = useRef(null);
|
|
13094
|
+
useEffect(() => {
|
|
13095
|
+
if (!showItems) return;
|
|
13096
|
+
function onPointerDown(event) {
|
|
13097
|
+
if (!containerRef.current?.contains(event.target)) setShowItems(false);
|
|
13098
|
+
}
|
|
13099
|
+
window.addEventListener("pointerdown", onPointerDown);
|
|
13100
|
+
return () => window.removeEventListener("pointerdown", onPointerDown);
|
|
13101
|
+
}, [showItems]);
|
|
13102
|
+
const selectedItem = getItemByValue(value) ?? items[0];
|
|
13103
|
+
function onItemClick(item) {
|
|
13104
|
+
if (item.disabled) return;
|
|
13105
|
+
onChange(item.value);
|
|
13106
|
+
setShowItems(false);
|
|
13107
|
+
}
|
|
13108
|
+
function getItemByValue(value) {
|
|
13109
|
+
return items.find((item) => item.value === value);
|
|
13110
|
+
}
|
|
13111
|
+
const itemsToShow = items.filter((item) => item.value !== value);
|
|
13112
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
13113
|
+
className: twMerge("border border-border bg-background text-foreground transition-[border-radius]", absolutePositionMenu && "relative", containerClassName),
|
|
13114
|
+
"data-open": showItems,
|
|
13115
|
+
ref: (node) => {
|
|
13116
|
+
containerRef.current = node;
|
|
13117
|
+
if (typeof ref === "function") ref(node);
|
|
13118
|
+
else if (ref) ref.current = node;
|
|
13119
|
+
},
|
|
13120
|
+
style: { borderRadius },
|
|
13121
|
+
children: [/* @__PURE__ */ jsxs("div", {
|
|
13122
|
+
className: twMerge("flex min-w-[360px] cursor-pointer items-center justify-between pr-3 text-foreground outline-none", menuClassName),
|
|
13123
|
+
id,
|
|
13124
|
+
onClick: () => setShowItems(!showItems),
|
|
13125
|
+
children: [/* @__PURE__ */ jsx(ItemContainer, {
|
|
13126
|
+
...selectedItem,
|
|
13127
|
+
className: itemClassName
|
|
13128
|
+
}), /* @__PURE__ */ jsx(Icon, {
|
|
13129
|
+
className: twJoin("transition", showItems ? "" : "-rotate-90"),
|
|
13130
|
+
name: "ChevronDown"
|
|
13131
|
+
})]
|
|
13132
|
+
}), /* @__PURE__ */ jsx("div", {
|
|
13133
|
+
className: twMerge("max-h-0 w-full overflow-hidden bg-inherit transition-[max-height] ease-in-out", showItems && "max-h-screen", absolutePositionMenu && "absolute", showItems && listClassName),
|
|
13134
|
+
style: { borderRadius: `0 0 ${borderRadius} ${borderRadius}` },
|
|
13135
|
+
children: itemsToShow.map((item) => /* @__PURE__ */ jsx(ItemContainer, {
|
|
13136
|
+
...item,
|
|
13137
|
+
className: itemClassName,
|
|
13138
|
+
onItemClick: () => onItemClick(item)
|
|
13139
|
+
}, item.value))
|
|
13140
|
+
})]
|
|
13141
|
+
});
|
|
13142
|
+
});
|
|
13143
|
+
function ItemContainer(props) {
|
|
13144
|
+
const { className, disabled, onItemClick, icon, displayValue, value, description } = props;
|
|
13145
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
13146
|
+
className: twMerge(disabled ? "cursor-not-allowed text-muted-foreground" : "text-foreground", "flex size-full cursor-pointer items-center gap-2 bg-inherit py-3 pl-3 text-start outline-none", onItemClick && !disabled && "hover:bg-muted", className),
|
|
13147
|
+
onClick: onItemClick,
|
|
13148
|
+
children: [icon, /* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsx("p", {
|
|
13149
|
+
className: "text-inherit capitalize",
|
|
13150
|
+
children: displayValue ?? value.toLowerCase()
|
|
13151
|
+
}), /* @__PURE__ */ jsx("p", {
|
|
13152
|
+
className: "text-xs text-foreground",
|
|
13153
|
+
children: description
|
|
13154
|
+
})] })]
|
|
13155
|
+
});
|
|
13156
|
+
}
|
|
12625
13157
|
const ANIM_DUR = 460;
|
|
12626
13158
|
1220 + ANIM_DUR + 800 + 1040 + ANIM_DUR + 400;
|
|
12627
13159
|
`${ANIM_DUR}`;
|
|
@@ -12842,6 +13374,33 @@ function ToolbarCloseButton(props) {
|
|
|
12842
13374
|
});
|
|
12843
13375
|
}
|
|
12844
13376
|
/**
|
|
13377
|
+
* Toolbar control for upgrading the document to the latest installed
|
|
13378
|
+
* document model version. Renders nothing when the document is already
|
|
13379
|
+
* current or no upgrade path is registered.
|
|
13380
|
+
*/
|
|
13381
|
+
function ToolbarUpgradeButton(props) {
|
|
13382
|
+
const { className, onClick: onClickOverride, document, children } = props;
|
|
13383
|
+
const versionStatus = useDocumentVersionStatus(document);
|
|
13384
|
+
const runUpgrade = () => {
|
|
13385
|
+
if (document) showPHModal({
|
|
13386
|
+
type: "confirmDocumentUpgrade",
|
|
13387
|
+
documentId: document.header.id
|
|
13388
|
+
});
|
|
13389
|
+
};
|
|
13390
|
+
const onClick = makeOnClick(document, onClickOverride, runUpgrade);
|
|
13391
|
+
if (!versionStatus || versionStatus.kind !== "upgrade-available" || !versionStatus.canUpgrade) return null;
|
|
13392
|
+
return /* @__PURE__ */ jsx(ToolbarButton, {
|
|
13393
|
+
"data-testid": "toolbar-upgrade-button",
|
|
13394
|
+
"aria-label": "Update document",
|
|
13395
|
+
className,
|
|
13396
|
+
onClick,
|
|
13397
|
+
children: children ?? /* @__PURE__ */ jsx("span", {
|
|
13398
|
+
className: "px-1 text-xs",
|
|
13399
|
+
children: "Update available"
|
|
13400
|
+
})
|
|
13401
|
+
});
|
|
13402
|
+
}
|
|
13403
|
+
/**
|
|
12845
13404
|
* Creates a toolbar button click handler.
|
|
12846
13405
|
*
|
|
12847
13406
|
* If an override is provided, it is called with the current document. Otherwise,
|
|
@@ -12920,6 +13479,7 @@ const defaultControlSlots = {
|
|
|
12920
13479
|
],
|
|
12921
13480
|
second: ["name"],
|
|
12922
13481
|
third: [
|
|
13482
|
+
"update",
|
|
12923
13483
|
"history",
|
|
12924
13484
|
"switchboard",
|
|
12925
13485
|
"close"
|
|
@@ -12950,6 +13510,7 @@ const defaultControlComponents = {
|
|
|
12950
13510
|
redo: ToolbarRedoButton,
|
|
12951
13511
|
download: ToolbarDownloadButton,
|
|
12952
13512
|
name: ToolbarName,
|
|
13513
|
+
update: ToolbarUpgradeButton,
|
|
12953
13514
|
switchboard: ToolbarSwitchboardButton,
|
|
12954
13515
|
history: ToolbarHistoryButton,
|
|
12955
13516
|
close: ToolbarCloseButton
|
|
@@ -13531,6 +14092,161 @@ function FolderItem(props) {
|
|
|
13531
14092
|
})
|
|
13532
14093
|
});
|
|
13533
14094
|
}
|
|
14095
|
+
const FormInput = /* @__PURE__ */ forwardRef(function FormInput(props, ref) {
|
|
14096
|
+
const { icon, errorMessage, isDirty, containerClassName, inputClassName, errorMessageClassName, hideErrors = false, ...delegatedProps } = props;
|
|
14097
|
+
const type = props.type ?? "text";
|
|
14098
|
+
const isError = !!errorMessage;
|
|
14099
|
+
return /* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsxs("div", {
|
|
14100
|
+
className: twMerge("mb-1 flex gap-2 rounded-md border border-border bg-background p-3 text-foreground placeholder:text-muted-foreground disabled:disabled-effect", isError && "border-destructive", containerClassName),
|
|
14101
|
+
children: [icon && /* @__PURE__ */ jsx("span", {
|
|
14102
|
+
className: twJoin((!isDirty || isError) && "text-foreground"),
|
|
14103
|
+
children: icon
|
|
14104
|
+
}), /* @__PURE__ */ jsx("input", {
|
|
14105
|
+
...delegatedProps,
|
|
14106
|
+
className: twMerge("w-full bg-transparent font-semibold outline-none", inputClassName),
|
|
14107
|
+
ref,
|
|
14108
|
+
type
|
|
14109
|
+
})]
|
|
14110
|
+
}), /* @__PURE__ */ jsx("p", {
|
|
14111
|
+
className: twMerge("hidden min-h-4 text-xs text-destructive", isError && "block", hideErrors && "hidden", errorMessageClassName),
|
|
14112
|
+
children: errorMessage
|
|
14113
|
+
})] });
|
|
14114
|
+
});
|
|
14115
|
+
function Label(props) {
|
|
14116
|
+
const { children, className, ...labelProps } = props;
|
|
14117
|
+
return /* @__PURE__ */ jsx("label", {
|
|
14118
|
+
...labelProps,
|
|
14119
|
+
className: twMerge("block font-semibold text-muted-foreground", className),
|
|
14120
|
+
children
|
|
14121
|
+
});
|
|
14122
|
+
}
|
|
14123
|
+
const CLOSE_ANIMATION_DURATION = 300;
|
|
14124
|
+
const PLACEHOLDER_KEY = "";
|
|
14125
|
+
function optionKey(option) {
|
|
14126
|
+
return `${option.documentType}::${option.version ?? "latest"}`;
|
|
14127
|
+
}
|
|
14128
|
+
function optionDisplayName(option) {
|
|
14129
|
+
return option.version ? `${option.name} v${option.version}` : option.name;
|
|
14130
|
+
}
|
|
14131
|
+
function CreateDocumentWithTypeModal(props) {
|
|
14132
|
+
const { documentTypes, onCreate, onTypeSelected, onOpenChange, overlayProps, contentProps, ...restProps } = props;
|
|
14133
|
+
const [documentName, setDocumentName] = useState("");
|
|
14134
|
+
const [isNameValid, setIsNameValid] = useState(false);
|
|
14135
|
+
const [selectedKey, setSelectedKey] = useState(PLACEHOLDER_KEY);
|
|
14136
|
+
const selectedOption = documentTypes.find((option) => optionKey(option) === selectedKey);
|
|
14137
|
+
const canCreate = isNameValid && selectedOption !== void 0;
|
|
14138
|
+
const typeItems = documentTypes.map((option) => ({
|
|
14139
|
+
value: optionKey(option),
|
|
14140
|
+
displayValue: optionDisplayName(option)
|
|
14141
|
+
}));
|
|
14142
|
+
const items = selectedKey === PLACEHOLDER_KEY ? [{
|
|
14143
|
+
value: PLACEHOLDER_KEY,
|
|
14144
|
+
displayValue: "Select document type…"
|
|
14145
|
+
}, ...typeItems] : typeItems;
|
|
14146
|
+
const resetAfterClose = useCallback(() => {
|
|
14147
|
+
setTimeout(() => {
|
|
14148
|
+
setDocumentName("");
|
|
14149
|
+
setIsNameValid(false);
|
|
14150
|
+
setSelectedKey(PLACEHOLDER_KEY);
|
|
14151
|
+
}, CLOSE_ANIMATION_DURATION);
|
|
14152
|
+
}, []);
|
|
14153
|
+
const handleOpenChange = (open) => {
|
|
14154
|
+
onOpenChange?.(open);
|
|
14155
|
+
if (!open) resetAfterClose();
|
|
14156
|
+
};
|
|
14157
|
+
const handleCancel = () => {
|
|
14158
|
+
handleOpenChange(false);
|
|
14159
|
+
};
|
|
14160
|
+
const handleTypeChange = (value) => {
|
|
14161
|
+
if (value === PLACEHOLDER_KEY) return;
|
|
14162
|
+
setSelectedKey(value);
|
|
14163
|
+
const option = documentTypes.find((o) => optionKey(o) === value);
|
|
14164
|
+
if (option) onTypeSelected?.(option.documentType);
|
|
14165
|
+
};
|
|
14166
|
+
const handleCreate = useCallback(() => {
|
|
14167
|
+
if (!canCreate) return;
|
|
14168
|
+
onCreate({
|
|
14169
|
+
name: documentName,
|
|
14170
|
+
documentType: selectedOption.documentType,
|
|
14171
|
+
version: selectedOption.version
|
|
14172
|
+
});
|
|
14173
|
+
resetAfterClose();
|
|
14174
|
+
}, [
|
|
14175
|
+
canCreate,
|
|
14176
|
+
documentName,
|
|
14177
|
+
onCreate,
|
|
14178
|
+
resetAfterClose,
|
|
14179
|
+
selectedOption
|
|
14180
|
+
]);
|
|
14181
|
+
const handleSubmit = useCallback((e) => {
|
|
14182
|
+
e.preventDefault();
|
|
14183
|
+
handleCreate();
|
|
14184
|
+
}, [handleCreate]);
|
|
14185
|
+
return /* @__PURE__ */ jsx(Modal, {
|
|
14186
|
+
contentProps,
|
|
14187
|
+
onOpenChange: handleOpenChange,
|
|
14188
|
+
overlayProps,
|
|
14189
|
+
title: "Create a new document",
|
|
14190
|
+
...restProps,
|
|
14191
|
+
children: /* @__PURE__ */ jsxs("form", {
|
|
14192
|
+
name: "create-document-with-type",
|
|
14193
|
+
className: "max-h-[85vh] w-100 overflow-y-auto rounded-xl bg-background p-6 text-foreground",
|
|
14194
|
+
onSubmit: handleSubmit,
|
|
14195
|
+
children: [
|
|
14196
|
+
/* @__PURE__ */ jsx("div", {
|
|
14197
|
+
className: "pb-2 text-2xl font-bold text-foreground",
|
|
14198
|
+
children: "Create a new document"
|
|
14199
|
+
}),
|
|
14200
|
+
/* @__PURE__ */ jsxs("div", {
|
|
14201
|
+
className: "my-6",
|
|
14202
|
+
children: [!isNameValid && documentName ? /* @__PURE__ */ jsx("div", {
|
|
14203
|
+
className: "mb-2 text-destructive",
|
|
14204
|
+
children: "Document name must not be empty or contain control characters."
|
|
14205
|
+
}) : null, /* @__PURE__ */ jsx(FormInput, {
|
|
14206
|
+
icon: /* @__PURE__ */ jsx(Icon, { name: "BrickGlobe" }),
|
|
14207
|
+
onChange: (e) => {
|
|
14208
|
+
const name = e.target.value;
|
|
14209
|
+
setDocumentName(name);
|
|
14210
|
+
setIsNameValid(isValidName(name));
|
|
14211
|
+
},
|
|
14212
|
+
placeholder: "Document name",
|
|
14213
|
+
required: true,
|
|
14214
|
+
value: documentName
|
|
14215
|
+
})]
|
|
14216
|
+
}),
|
|
14217
|
+
/* @__PURE__ */ jsxs("div", {
|
|
14218
|
+
className: "my-6",
|
|
14219
|
+
children: [/* @__PURE__ */ jsx(Label, {
|
|
14220
|
+
className: "mb-2 text-sm font-medium text-foreground",
|
|
14221
|
+
htmlFor: "document-type",
|
|
14222
|
+
children: "Document type"
|
|
14223
|
+
}), /* @__PURE__ */ jsx(ConnectSelect, {
|
|
14224
|
+
id: "document-type",
|
|
14225
|
+
items,
|
|
14226
|
+
listClassName: "max-h-80 overflow-y-auto overscroll-contain",
|
|
14227
|
+
menuClassName: "min-w-0",
|
|
14228
|
+
onChange: handleTypeChange,
|
|
14229
|
+
value: selectedKey
|
|
14230
|
+
})]
|
|
14231
|
+
}),
|
|
14232
|
+
/* @__PURE__ */ jsxs("div", {
|
|
14233
|
+
className: "mt-8 flex justify-between gap-3",
|
|
14234
|
+
children: [/* @__PURE__ */ jsx(ModalButton, {
|
|
14235
|
+
onClick: handleCancel,
|
|
14236
|
+
type: "button",
|
|
14237
|
+
variant: "cancel",
|
|
14238
|
+
children: "Cancel"
|
|
14239
|
+
}), /* @__PURE__ */ jsx(ModalButton, {
|
|
14240
|
+
disabled: !canCreate,
|
|
14241
|
+
type: "submit",
|
|
14242
|
+
variant: "confirm",
|
|
14243
|
+
children: "Create"
|
|
14244
|
+
})]
|
|
14245
|
+
})
|
|
14246
|
+
]
|
|
14247
|
+
})
|
|
14248
|
+
});
|
|
14249
|
+
}
|
|
13534
14250
|
const FilterItem = (props) => {
|
|
13535
14251
|
const { item, className, ...containerProps } = props;
|
|
13536
14252
|
return /* @__PURE__ */ jsxs("div", {
|
|
@@ -13592,6 +14308,6 @@ const ConnectSearchBar = (props) => {
|
|
|
13592
14308
|
});
|
|
13593
14309
|
};
|
|
13594
14310
|
//#endregion
|
|
13595
|
-
export {
|
|
14311
|
+
export { Icon as S, Modal as _, DocumentToolbar as a, Primitive as b, ModalButton as c, FormProvider as d, appendErrors as f, useFormContext as g, useForm as h, CreateDocumentWithTypeModal as i, useVirtualizer as l, set as m, ConnectSearchBar as n, FileItem as o, get as p, ConnectSelect as r, FolderItem as s, Breadcrumbs as t, Controller as u, PowerhouseButton as v, Slot as x, useWindowSize as y };
|
|
13596
14312
|
|
|
13597
|
-
//# sourceMappingURL=connect-
|
|
14313
|
+
//# sourceMappingURL=connect-D1KIMa_5.js.map
|