@powerhousedao/powerhouse-vetra-packages 6.2.2-dev.8 → 6.2.2-dev.80
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-5_Eh4a2Z.js} +3 -2
- package/dist/browser/assets/{projection-entry-DVec8YRh.js → projection-entry-DgFDnTMt.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-Df8YBCmF.js} +916 -200
- package/dist/browser/connect-Df8YBCmF.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-BIpFdiLp.js} +2388 -1848
- package/dist/browser/dist-BIpFdiLp.js.map +1 -0
- package/dist/browser/{document-drive-IdFV1QXL.js → document-drive-DU75CBKf.js} +1186 -124
- package/dist/browser/document-drive-DU75CBKf.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-BuYbUTIt.js} +671 -236
- package/dist/browser/editor-BuYbUTIt.js.map +1 -0
- package/dist/browser/editor-y1bqyeB_.js +25 -0
- package/dist/browser/editor-y1bqyeB_.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-BzERbCoQ.js} +73 -46
- package/dist/browser/folder-view-BzERbCoQ.js.map +1 -0
- package/dist/browser/{graphql-editor-ZLRO_8Ce.js → graphql-editor-Dv1FDpax.js} +8 -7
- package/dist/browser/{graphql-editor-ZLRO_8Ce.js.map → graphql-editor-Dv1FDpax.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-ZRgRDikU.js} +4 -4
- package/dist/browser/{json-editor-DBuZ6gN7.js.map → json-editor-ZRgRDikU.js.map} +1 -1
- package/dist/browser/{lib-C-f3izXz.js → lib-ewnRj2dJ.js} +13 -4
- package/dist/browser/lib-ewnRj2dJ.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-BBkkpjRl.js} +8 -18
- package/dist/browser/state-schemas-BBkkpjRl.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-DM43aaJZ.mjs} +916 -200
- package/dist/node/connect-DM43aaJZ.mjs.map +1 -0
- package/dist/node/{dist-DJEK2WVi.mjs → dist-4gA6tFmW.mjs} +2391 -1846
- package/dist/node/dist-4gA6tFmW.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-CRYbvD0-.mjs} +1186 -124
- package/dist/node/document-drive-CRYbvD0-.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-B1KhoF1f.mjs → editor-B5cnYfC7.mjs} +672 -237
- package/dist/node/editor-B5cnYfC7.mjs.map +1 -0
- package/dist/node/editor-Dn0DUR0W.mjs +25 -0
- package/dist/node/editor-Dn0DUR0W.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-BAAfODx_.mjs} +73 -46
- package/dist/node/folder-view-BAAfODx_.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-CUrJvXrG.mjs} +7 -7
- package/dist/node/{graphql-editor-C5VLRqEf.mjs.map → graphql-editor-CUrJvXrG.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-TvKShKo-.mjs} +4 -4
- package/dist/node/{json-editor-iI2s9a_4.mjs.map → json-editor-TvKShKo-.mjs.map} +1 -1
- package/dist/node/{main-D82dkD7g.mjs → main-B1tRsYOp.mjs} +15 -6
- package/dist/node/main-B1tRsYOp.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-CJK5hin3.mjs} +10 -20
- package/dist/{browser/state-schemas-BjQKM498.js.map → node/state-schemas-CJK5hin3.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 { A as
|
|
2
|
-
import {
|
|
3
|
-
import { n as init_tslib_es6, r as tslib_es6_exports } from "./main-
|
|
4
|
-
import { C as
|
|
5
|
-
import {
|
|
1
|
+
import { A as __require, D as __commonJSMin, M as __toESM, j as __toCommonJS } from "./dist-DT7jI9ol.mjs";
|
|
2
|
+
import { V as redo, at as undo, c as isValidName } from "./document-drive-CRYbvD0-.mjs";
|
|
3
|
+
import { n as init_tslib_es6, r as tslib_es6_exports } from "./main-B1tRsYOp.mjs";
|
|
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, v as createContext2, w as twMerge, x as useComposedRefs, y as createContextScope } from "./dist-CzYOpeXN.mjs";
|
|
5
|
+
import { B as useSelectedDriveId, C as addFolder$1, E as showRevisionHistory, F as t$9, H as useDocumentById, M as e$4, N as e$5, O as useDragNode, P as t$10, R as setSelectedDrive, T as showPHModal, V as useSelectedDriveSafe, a as useDownloadDocument, c as useGetSwitchboardLink, d as useNodeParentFolderById, h as useSelectedNodePath, i as useDocumentVersionStatus, k as useDropNode, l as useNodeActions, n as preloadEditorModule, s as useEditorModulesForDocumentType, t as getSyncStatusSync, u as useNodeById, w as showDeleteNodeModal, x as useSelectedDocumentSafe, y as useUserPermissions, z as setSelectedNode } from "./dist-4gA6tFmW.mjs";
|
|
6
6
|
import * as React$10 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$10.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$10.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$10.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$10.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$10.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$10.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$10.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$10.useState(null);
|
|
5606
5606
|
const composedRefs = useComposedRefs(forwardedRef, (node) => setContent(node));
|
|
5607
5607
|
const [arrow$4, setArrow] = React$10.useState(null);
|
|
@@ -5701,7 +5701,7 @@ var PopperContent = React$10.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$10.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$10.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$10.forwardRef((props, forwardedRef) => {
|
|
5813
5813
|
const { container: containerProp, ...portalProps } = props;
|
|
5814
5814
|
const [mounted, setMounted] = React$10.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/es5/index.js
|
|
5825
5825
|
var require_es5$6 = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
@@ -7380,17 +7380,17 @@ var MenuAnchor = React$10.forwardRef((props, forwardedRef) => {
|
|
|
7380
7380
|
});
|
|
7381
7381
|
});
|
|
7382
7382
|
MenuAnchor.displayName = ANCHOR_NAME;
|
|
7383
|
-
var PORTAL_NAME$
|
|
7384
|
-
var [PortalProvider, usePortalContext] = createMenuContext(PORTAL_NAME$
|
|
7383
|
+
var PORTAL_NAME$2 = "MenuPortal";
|
|
7384
|
+
var [PortalProvider$1, usePortalContext$1] = createMenuContext(PORTAL_NAME$2, { forceMount: void 0 });
|
|
7385
7385
|
var MenuPortal = (props) => {
|
|
7386
7386
|
const { __scopeMenu, forceMount, children, container } = props;
|
|
7387
|
-
const context = useMenuContext(PORTAL_NAME$
|
|
7388
|
-
return /* @__PURE__ */ jsx(PortalProvider, {
|
|
7387
|
+
const context = useMenuContext(PORTAL_NAME$2, __scopeMenu);
|
|
7388
|
+
return /* @__PURE__ */ jsx(PortalProvider$1, {
|
|
7389
7389
|
scope: __scopeMenu,
|
|
7390
7390
|
forceMount,
|
|
7391
7391
|
children: /* @__PURE__ */ jsx(Presence, {
|
|
7392
7392
|
present: forceMount || context.open,
|
|
7393
|
-
children: /* @__PURE__ */ jsx(Portal$
|
|
7393
|
+
children: /* @__PURE__ */ jsx(Portal$2, {
|
|
7394
7394
|
asChild: true,
|
|
7395
7395
|
container,
|
|
7396
7396
|
children
|
|
@@ -7398,14 +7398,14 @@ var MenuPortal = (props) => {
|
|
|
7398
7398
|
})
|
|
7399
7399
|
});
|
|
7400
7400
|
};
|
|
7401
|
-
MenuPortal.displayName = PORTAL_NAME$
|
|
7402
|
-
var CONTENT_NAME$
|
|
7403
|
-
var [MenuContentProvider, useMenuContentContext] = createMenuContext(CONTENT_NAME$
|
|
7401
|
+
MenuPortal.displayName = PORTAL_NAME$2;
|
|
7402
|
+
var CONTENT_NAME$2 = "MenuContent";
|
|
7403
|
+
var [MenuContentProvider, useMenuContentContext] = createMenuContext(CONTENT_NAME$2);
|
|
7404
7404
|
var MenuContent = React$10.forwardRef((props, forwardedRef) => {
|
|
7405
|
-
const portalContext = usePortalContext(CONTENT_NAME$
|
|
7405
|
+
const portalContext = usePortalContext$1(CONTENT_NAME$2, props.__scopeMenu);
|
|
7406
7406
|
const { forceMount = portalContext.forceMount, ...contentProps } = props;
|
|
7407
|
-
const context = useMenuContext(CONTENT_NAME$
|
|
7408
|
-
const rootContext = useMenuRootContext(CONTENT_NAME$
|
|
7407
|
+
const context = useMenuContext(CONTENT_NAME$2, props.__scopeMenu);
|
|
7408
|
+
const rootContext = useMenuRootContext(CONTENT_NAME$2, props.__scopeMenu);
|
|
7409
7409
|
return /* @__PURE__ */ jsx(Collection.Provider, {
|
|
7410
7410
|
scope: props.__scopeMenu,
|
|
7411
7411
|
children: /* @__PURE__ */ jsx(Presence, {
|
|
@@ -7424,7 +7424,7 @@ var MenuContent = React$10.forwardRef((props, forwardedRef) => {
|
|
|
7424
7424
|
});
|
|
7425
7425
|
});
|
|
7426
7426
|
var MenuRootContentModal = React$10.forwardRef((props, forwardedRef) => {
|
|
7427
|
-
const context = useMenuContext(CONTENT_NAME$
|
|
7427
|
+
const context = useMenuContext(CONTENT_NAME$2, props.__scopeMenu);
|
|
7428
7428
|
const ref = React$10.useRef(null);
|
|
7429
7429
|
const composedRefs = useComposedRefs(forwardedRef, ref);
|
|
7430
7430
|
React$10.useEffect(() => {
|
|
@@ -7442,7 +7442,7 @@ var MenuRootContentModal = React$10.forwardRef((props, forwardedRef) => {
|
|
|
7442
7442
|
});
|
|
7443
7443
|
});
|
|
7444
7444
|
var MenuRootContentNonModal = React$10.forwardRef((props, forwardedRef) => {
|
|
7445
|
-
const context = useMenuContext(CONTENT_NAME$
|
|
7445
|
+
const context = useMenuContext(CONTENT_NAME$2, props.__scopeMenu);
|
|
7446
7446
|
return /* @__PURE__ */ jsx(MenuContentImpl, {
|
|
7447
7447
|
...props,
|
|
7448
7448
|
ref: forwardedRef,
|
|
@@ -7452,11 +7452,11 @@ var MenuRootContentNonModal = React$10.forwardRef((props, forwardedRef) => {
|
|
|
7452
7452
|
onDismiss: () => context.onOpenChange(false)
|
|
7453
7453
|
});
|
|
7454
7454
|
});
|
|
7455
|
-
var Slot = createSlot("MenuContent.ScrollLock");
|
|
7455
|
+
var Slot$2 = createSlot$1("MenuContent.ScrollLock");
|
|
7456
7456
|
var MenuContentImpl = React$10.forwardRef((props, forwardedRef) => {
|
|
7457
7457
|
const { __scopeMenu, loop = false, trapFocus, onOpenAutoFocus, onCloseAutoFocus, disableOutsidePointerEvents, onEntryFocus, onEscapeKeyDown, onPointerDownOutside, onFocusOutside, onInteractOutside, onDismiss, disableOutsideScroll, ...contentProps } = props;
|
|
7458
|
-
const context = useMenuContext(CONTENT_NAME$
|
|
7459
|
-
const rootContext = useMenuRootContext(CONTENT_NAME$
|
|
7458
|
+
const context = useMenuContext(CONTENT_NAME$2, __scopeMenu);
|
|
7459
|
+
const rootContext = useMenuRootContext(CONTENT_NAME$2, __scopeMenu);
|
|
7460
7460
|
const popperScope = usePopperScope(__scopeMenu);
|
|
7461
7461
|
const rovingFocusGroupScope = useRovingFocusGroupScope(__scopeMenu);
|
|
7462
7462
|
const getItems = useCollection(__scopeMenu);
|
|
@@ -7471,7 +7471,7 @@ var MenuContentImpl = React$10.forwardRef((props, forwardedRef) => {
|
|
|
7471
7471
|
const lastPointerXRef = React$10.useRef(0);
|
|
7472
7472
|
const ScrollLockWrapper = disableOutsideScroll ? import_es5$1.RemoveScroll : React$10.Fragment;
|
|
7473
7473
|
const scrollLockWrapperProps = disableOutsideScroll ? {
|
|
7474
|
-
as: Slot,
|
|
7474
|
+
as: Slot$2,
|
|
7475
7475
|
allowPinchZoom: true
|
|
7476
7476
|
} : void 0;
|
|
7477
7477
|
const handleTypeaheadSearch = (key) => {
|
|
@@ -7531,7 +7531,7 @@ var MenuContentImpl = React$10.forwardRef((props, forwardedRef) => {
|
|
|
7531
7531
|
onFocusOutside,
|
|
7532
7532
|
onInteractOutside,
|
|
7533
7533
|
onDismiss,
|
|
7534
|
-
children: /* @__PURE__ */ jsx(Root$
|
|
7534
|
+
children: /* @__PURE__ */ jsx(Root$3, {
|
|
7535
7535
|
asChild: true,
|
|
7536
7536
|
...rovingFocusGroupScope,
|
|
7537
7537
|
dir: rootContext.dir,
|
|
@@ -7543,7 +7543,7 @@ var MenuContentImpl = React$10.forwardRef((props, forwardedRef) => {
|
|
|
7543
7543
|
if (!rootContext.isUsingKeyboardRef.current) event.preventDefault();
|
|
7544
7544
|
}),
|
|
7545
7545
|
preventScrollOnEntryFocus: true,
|
|
7546
|
-
children: /* @__PURE__ */ jsx(Content, {
|
|
7546
|
+
children: /* @__PURE__ */ jsx(Content$1, {
|
|
7547
7547
|
role: "menu",
|
|
7548
7548
|
"aria-orientation": "vertical",
|
|
7549
7549
|
"data-state": getOpenState(context.open),
|
|
@@ -7593,11 +7593,11 @@ var MenuContentImpl = React$10.forwardRef((props, forwardedRef) => {
|
|
|
7593
7593
|
})
|
|
7594
7594
|
});
|
|
7595
7595
|
});
|
|
7596
|
-
MenuContent.displayName = CONTENT_NAME$
|
|
7596
|
+
MenuContent.displayName = CONTENT_NAME$2;
|
|
7597
7597
|
var GROUP_NAME$1 = "MenuGroup";
|
|
7598
7598
|
var MenuGroup = React$10.forwardRef((props, forwardedRef) => {
|
|
7599
7599
|
const { __scopeMenu, ...groupProps } = props;
|
|
7600
|
-
return /* @__PURE__ */ jsx(Primitive.div, {
|
|
7600
|
+
return /* @__PURE__ */ jsx(Primitive$1.div, {
|
|
7601
7601
|
role: "group",
|
|
7602
7602
|
...groupProps,
|
|
7603
7603
|
ref: forwardedRef
|
|
@@ -7607,7 +7607,7 @@ MenuGroup.displayName = GROUP_NAME$1;
|
|
|
7607
7607
|
var LABEL_NAME$1 = "MenuLabel";
|
|
7608
7608
|
var MenuLabel = React$10.forwardRef((props, forwardedRef) => {
|
|
7609
7609
|
const { __scopeMenu, ...labelProps } = props;
|
|
7610
|
-
return /* @__PURE__ */ jsx(Primitive.div, {
|
|
7610
|
+
return /* @__PURE__ */ jsx(Primitive$1.div, {
|
|
7611
7611
|
...labelProps,
|
|
7612
7612
|
ref: forwardedRef
|
|
7613
7613
|
});
|
|
@@ -7678,7 +7678,7 @@ var MenuItemImpl = React$10.forwardRef((props, forwardedRef) => {
|
|
|
7678
7678
|
asChild: true,
|
|
7679
7679
|
...rovingFocusGroupScope,
|
|
7680
7680
|
focusable: !disabled,
|
|
7681
|
-
children: /* @__PURE__ */ jsx(Primitive.div, {
|
|
7681
|
+
children: /* @__PURE__ */ jsx(Primitive$1.div, {
|
|
7682
7682
|
role: "menuitem",
|
|
7683
7683
|
"data-highlighted": isFocused ? "" : void 0,
|
|
7684
7684
|
"aria-disabled": disabled || void 0,
|
|
@@ -7761,7 +7761,7 @@ var MenuItemIndicator = React$10.forwardRef((props, forwardedRef) => {
|
|
|
7761
7761
|
const indicatorContext = useItemIndicatorContext(ITEM_INDICATOR_NAME, __scopeMenu);
|
|
7762
7762
|
return /* @__PURE__ */ jsx(Presence, {
|
|
7763
7763
|
present: forceMount || isIndeterminate(indicatorContext.checked) || indicatorContext.checked === true,
|
|
7764
|
-
children: /* @__PURE__ */ jsx(Primitive.span, {
|
|
7764
|
+
children: /* @__PURE__ */ jsx(Primitive$1.span, {
|
|
7765
7765
|
...itemIndicatorProps,
|
|
7766
7766
|
ref: forwardedRef,
|
|
7767
7767
|
"data-state": getCheckedState(indicatorContext.checked)
|
|
@@ -7772,7 +7772,7 @@ MenuItemIndicator.displayName = ITEM_INDICATOR_NAME;
|
|
|
7772
7772
|
var SEPARATOR_NAME$1 = "MenuSeparator";
|
|
7773
7773
|
var MenuSeparator = React$10.forwardRef((props, forwardedRef) => {
|
|
7774
7774
|
const { __scopeMenu, ...separatorProps } = props;
|
|
7775
|
-
return /* @__PURE__ */ jsx(Primitive.div, {
|
|
7775
|
+
return /* @__PURE__ */ jsx(Primitive$1.div, {
|
|
7776
7776
|
role: "separator",
|
|
7777
7777
|
"aria-orientation": "horizontal",
|
|
7778
7778
|
...separatorProps,
|
|
@@ -7929,10 +7929,10 @@ var MenuSubTrigger = React$10.forwardRef((props, forwardedRef) => {
|
|
|
7929
7929
|
MenuSubTrigger.displayName = SUB_TRIGGER_NAME$1;
|
|
7930
7930
|
var SUB_CONTENT_NAME$1 = "MenuSubContent";
|
|
7931
7931
|
var MenuSubContent = React$10.forwardRef((props, forwardedRef) => {
|
|
7932
|
-
const portalContext = usePortalContext(CONTENT_NAME$
|
|
7932
|
+
const portalContext = usePortalContext$1(CONTENT_NAME$2, props.__scopeMenu);
|
|
7933
7933
|
const { forceMount = portalContext.forceMount, ...subContentProps } = props;
|
|
7934
|
-
const context = useMenuContext(CONTENT_NAME$
|
|
7935
|
-
const rootContext = useMenuRootContext(CONTENT_NAME$
|
|
7934
|
+
const context = useMenuContext(CONTENT_NAME$2, props.__scopeMenu);
|
|
7935
|
+
const rootContext = useMenuRootContext(CONTENT_NAME$2, props.__scopeMenu);
|
|
7936
7936
|
const subContext = useMenuSubContext(SUB_CONTENT_NAME$1, props.__scopeMenu);
|
|
7937
7937
|
const ref = React$10.useRef(null);
|
|
7938
7938
|
const composedRefs = useComposedRefs(forwardedRef, ref);
|
|
@@ -8033,10 +8033,10 @@ function whenMouse(handler) {
|
|
|
8033
8033
|
}
|
|
8034
8034
|
var Root3 = Menu;
|
|
8035
8035
|
var Anchor2 = MenuAnchor;
|
|
8036
|
-
var Portal = MenuPortal;
|
|
8036
|
+
var Portal$1 = MenuPortal;
|
|
8037
8037
|
var Content2$1 = MenuContent;
|
|
8038
8038
|
var Group = MenuGroup;
|
|
8039
|
-
var Label = MenuLabel;
|
|
8039
|
+
var Label$1 = MenuLabel;
|
|
8040
8040
|
var Item2$1 = MenuItem;
|
|
8041
8041
|
var CheckboxItem = MenuCheckboxItem;
|
|
8042
8042
|
var RadioGroup = MenuRadioGroup;
|
|
@@ -8082,14 +8082,14 @@ var DropdownMenu$1 = (props) => {
|
|
|
8082
8082
|
});
|
|
8083
8083
|
};
|
|
8084
8084
|
DropdownMenu$1.displayName = DROPDOWN_MENU_NAME;
|
|
8085
|
-
var TRIGGER_NAME = "DropdownMenuTrigger";
|
|
8085
|
+
var TRIGGER_NAME$1 = "DropdownMenuTrigger";
|
|
8086
8086
|
var DropdownMenuTrigger$1 = React$10.forwardRef((props, forwardedRef) => {
|
|
8087
8087
|
const { __scopeDropdownMenu, disabled = false, ...triggerProps } = props;
|
|
8088
|
-
const context = useDropdownMenuContext(TRIGGER_NAME, __scopeDropdownMenu);
|
|
8088
|
+
const context = useDropdownMenuContext(TRIGGER_NAME$1, __scopeDropdownMenu);
|
|
8089
8089
|
return /* @__PURE__ */ jsx(Anchor2, {
|
|
8090
8090
|
asChild: true,
|
|
8091
8091
|
...useMenuScope(__scopeDropdownMenu),
|
|
8092
|
-
children: /* @__PURE__ */ jsx(Primitive.button, {
|
|
8092
|
+
children: /* @__PURE__ */ jsx(Primitive$1.button, {
|
|
8093
8093
|
type: "button",
|
|
8094
8094
|
id: context.triggerId,
|
|
8095
8095
|
"aria-haspopup": "menu",
|
|
@@ -8119,20 +8119,20 @@ var DropdownMenuTrigger$1 = React$10.forwardRef((props, forwardedRef) => {
|
|
|
8119
8119
|
})
|
|
8120
8120
|
});
|
|
8121
8121
|
});
|
|
8122
|
-
DropdownMenuTrigger$1.displayName = TRIGGER_NAME;
|
|
8123
|
-
var PORTAL_NAME = "DropdownMenuPortal";
|
|
8122
|
+
DropdownMenuTrigger$1.displayName = TRIGGER_NAME$1;
|
|
8123
|
+
var PORTAL_NAME$1 = "DropdownMenuPortal";
|
|
8124
8124
|
var DropdownMenuPortal = (props) => {
|
|
8125
8125
|
const { __scopeDropdownMenu, ...portalProps } = props;
|
|
8126
|
-
return /* @__PURE__ */ jsx(Portal, {
|
|
8126
|
+
return /* @__PURE__ */ jsx(Portal$1, {
|
|
8127
8127
|
...useMenuScope(__scopeDropdownMenu),
|
|
8128
8128
|
...portalProps
|
|
8129
8129
|
});
|
|
8130
8130
|
};
|
|
8131
|
-
DropdownMenuPortal.displayName = PORTAL_NAME;
|
|
8132
|
-
var CONTENT_NAME = "DropdownMenuContent";
|
|
8131
|
+
DropdownMenuPortal.displayName = PORTAL_NAME$1;
|
|
8132
|
+
var CONTENT_NAME$1 = "DropdownMenuContent";
|
|
8133
8133
|
var DropdownMenuContent$1 = React$10.forwardRef((props, forwardedRef) => {
|
|
8134
8134
|
const { __scopeDropdownMenu, ...contentProps } = props;
|
|
8135
|
-
const context = useDropdownMenuContext(CONTENT_NAME, __scopeDropdownMenu);
|
|
8135
|
+
const context = useDropdownMenuContext(CONTENT_NAME$1, __scopeDropdownMenu);
|
|
8136
8136
|
const menuScope = useMenuScope(__scopeDropdownMenu);
|
|
8137
8137
|
const hasInteractedOutsideRef = React$10.useRef(false);
|
|
8138
8138
|
return /* @__PURE__ */ jsx(Content2$1, {
|
|
@@ -8162,7 +8162,7 @@ var DropdownMenuContent$1 = React$10.forwardRef((props, forwardedRef) => {
|
|
|
8162
8162
|
}
|
|
8163
8163
|
});
|
|
8164
8164
|
});
|
|
8165
|
-
DropdownMenuContent$1.displayName = CONTENT_NAME;
|
|
8165
|
+
DropdownMenuContent$1.displayName = CONTENT_NAME$1;
|
|
8166
8166
|
var GROUP_NAME = "DropdownMenuGroup";
|
|
8167
8167
|
var DropdownMenuGroup = React$10.forwardRef((props, forwardedRef) => {
|
|
8168
8168
|
const { __scopeDropdownMenu, ...groupProps } = props;
|
|
@@ -8176,7 +8176,7 @@ DropdownMenuGroup.displayName = GROUP_NAME;
|
|
|
8176
8176
|
var LABEL_NAME = "DropdownMenuLabel";
|
|
8177
8177
|
var DropdownMenuLabel = React$10.forwardRef((props, forwardedRef) => {
|
|
8178
8178
|
const { __scopeDropdownMenu, ...labelProps } = props;
|
|
8179
|
-
return /* @__PURE__ */ jsx(Label, {
|
|
8179
|
+
return /* @__PURE__ */ jsx(Label$1, {
|
|
8180
8180
|
...useMenuScope(__scopeDropdownMenu),
|
|
8181
8181
|
...labelProps,
|
|
8182
8182
|
ref: forwardedRef
|
|
@@ -8287,7 +8287,441 @@ var Portal2 = DropdownMenuPortal;
|
|
|
8287
8287
|
var Content2 = DropdownMenuContent$1;
|
|
8288
8288
|
var Item2 = DropdownMenuItem$1;
|
|
8289
8289
|
//#endregion
|
|
8290
|
-
//#region
|
|
8290
|
+
//#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
|
|
8291
|
+
var DIALOG_NAME = "Dialog";
|
|
8292
|
+
var [createDialogContext, createDialogScope] = createContextScope(DIALOG_NAME);
|
|
8293
|
+
var [DialogProvider, useDialogContext] = createDialogContext(DIALOG_NAME);
|
|
8294
|
+
var Dialog = (props) => {
|
|
8295
|
+
const { __scopeDialog, children, open: openProp, defaultOpen, onOpenChange, modal = true } = props;
|
|
8296
|
+
const triggerRef = React$10.useRef(null);
|
|
8297
|
+
const contentRef = React$10.useRef(null);
|
|
8298
|
+
const [open, setOpen] = useControllableState({
|
|
8299
|
+
prop: openProp,
|
|
8300
|
+
defaultProp: defaultOpen ?? false,
|
|
8301
|
+
onChange: onOpenChange,
|
|
8302
|
+
caller: DIALOG_NAME
|
|
8303
|
+
});
|
|
8304
|
+
return /* @__PURE__ */ jsx(DialogProvider, {
|
|
8305
|
+
scope: __scopeDialog,
|
|
8306
|
+
triggerRef,
|
|
8307
|
+
contentRef,
|
|
8308
|
+
contentId: useId$1(),
|
|
8309
|
+
titleId: useId$1(),
|
|
8310
|
+
descriptionId: useId$1(),
|
|
8311
|
+
open,
|
|
8312
|
+
onOpenChange: setOpen,
|
|
8313
|
+
onOpenToggle: React$10.useCallback(() => setOpen((prevOpen) => !prevOpen), [setOpen]),
|
|
8314
|
+
modal,
|
|
8315
|
+
children
|
|
8316
|
+
});
|
|
8317
|
+
};
|
|
8318
|
+
Dialog.displayName = DIALOG_NAME;
|
|
8319
|
+
var TRIGGER_NAME = "DialogTrigger";
|
|
8320
|
+
var DialogTrigger = React$10.forwardRef((props, forwardedRef) => {
|
|
8321
|
+
const { __scopeDialog, ...triggerProps } = props;
|
|
8322
|
+
const context = useDialogContext(TRIGGER_NAME, __scopeDialog);
|
|
8323
|
+
const composedTriggerRef = useComposedRefs(forwardedRef, context.triggerRef);
|
|
8324
|
+
return /* @__PURE__ */ jsx(Primitive$1.button, {
|
|
8325
|
+
type: "button",
|
|
8326
|
+
"aria-haspopup": "dialog",
|
|
8327
|
+
"aria-expanded": context.open,
|
|
8328
|
+
"aria-controls": context.contentId,
|
|
8329
|
+
"data-state": getState(context.open),
|
|
8330
|
+
...triggerProps,
|
|
8331
|
+
ref: composedTriggerRef,
|
|
8332
|
+
onClick: composeEventHandlers(props.onClick, context.onOpenToggle)
|
|
8333
|
+
});
|
|
8334
|
+
});
|
|
8335
|
+
DialogTrigger.displayName = TRIGGER_NAME;
|
|
8336
|
+
var PORTAL_NAME = "DialogPortal";
|
|
8337
|
+
var [PortalProvider, usePortalContext] = createDialogContext(PORTAL_NAME, { forceMount: void 0 });
|
|
8338
|
+
var DialogPortal = (props) => {
|
|
8339
|
+
const { __scopeDialog, forceMount, children, container } = props;
|
|
8340
|
+
const context = useDialogContext(PORTAL_NAME, __scopeDialog);
|
|
8341
|
+
return /* @__PURE__ */ jsx(PortalProvider, {
|
|
8342
|
+
scope: __scopeDialog,
|
|
8343
|
+
forceMount,
|
|
8344
|
+
children: React$10.Children.map(children, (child) => /* @__PURE__ */ jsx(Presence, {
|
|
8345
|
+
present: forceMount || context.open,
|
|
8346
|
+
children: /* @__PURE__ */ jsx(Portal$2, {
|
|
8347
|
+
asChild: true,
|
|
8348
|
+
container,
|
|
8349
|
+
children: child
|
|
8350
|
+
})
|
|
8351
|
+
}))
|
|
8352
|
+
});
|
|
8353
|
+
};
|
|
8354
|
+
DialogPortal.displayName = PORTAL_NAME;
|
|
8355
|
+
var OVERLAY_NAME = "DialogOverlay";
|
|
8356
|
+
var DialogOverlay = React$10.forwardRef((props, forwardedRef) => {
|
|
8357
|
+
const portalContext = usePortalContext(OVERLAY_NAME, props.__scopeDialog);
|
|
8358
|
+
const { forceMount = portalContext.forceMount, ...overlayProps } = props;
|
|
8359
|
+
const context = useDialogContext(OVERLAY_NAME, props.__scopeDialog);
|
|
8360
|
+
return context.modal ? /* @__PURE__ */ jsx(Presence, {
|
|
8361
|
+
present: forceMount || context.open,
|
|
8362
|
+
children: /* @__PURE__ */ jsx(DialogOverlayImpl, {
|
|
8363
|
+
...overlayProps,
|
|
8364
|
+
ref: forwardedRef
|
|
8365
|
+
})
|
|
8366
|
+
}) : null;
|
|
8367
|
+
});
|
|
8368
|
+
DialogOverlay.displayName = OVERLAY_NAME;
|
|
8369
|
+
var Slot$1 = createSlot$1("DialogOverlay.RemoveScroll");
|
|
8370
|
+
var DialogOverlayImpl = React$10.forwardRef((props, forwardedRef) => {
|
|
8371
|
+
const { __scopeDialog, ...overlayProps } = props;
|
|
8372
|
+
const context = useDialogContext(OVERLAY_NAME, __scopeDialog);
|
|
8373
|
+
return /* @__PURE__ */ jsx(import_es5$1.RemoveScroll, {
|
|
8374
|
+
as: Slot$1,
|
|
8375
|
+
allowPinchZoom: true,
|
|
8376
|
+
shards: [context.contentRef],
|
|
8377
|
+
children: /* @__PURE__ */ jsx(Primitive$1.div, {
|
|
8378
|
+
"data-state": getState(context.open),
|
|
8379
|
+
...overlayProps,
|
|
8380
|
+
ref: forwardedRef,
|
|
8381
|
+
style: {
|
|
8382
|
+
pointerEvents: "auto",
|
|
8383
|
+
...overlayProps.style
|
|
8384
|
+
}
|
|
8385
|
+
})
|
|
8386
|
+
});
|
|
8387
|
+
});
|
|
8388
|
+
var CONTENT_NAME = "DialogContent";
|
|
8389
|
+
var DialogContent = React$10.forwardRef((props, forwardedRef) => {
|
|
8390
|
+
const portalContext = usePortalContext(CONTENT_NAME, props.__scopeDialog);
|
|
8391
|
+
const { forceMount = portalContext.forceMount, ...contentProps } = props;
|
|
8392
|
+
const context = useDialogContext(CONTENT_NAME, props.__scopeDialog);
|
|
8393
|
+
return /* @__PURE__ */ jsx(Presence, {
|
|
8394
|
+
present: forceMount || context.open,
|
|
8395
|
+
children: context.modal ? /* @__PURE__ */ jsx(DialogContentModal, {
|
|
8396
|
+
...contentProps,
|
|
8397
|
+
ref: forwardedRef
|
|
8398
|
+
}) : /* @__PURE__ */ jsx(DialogContentNonModal, {
|
|
8399
|
+
...contentProps,
|
|
8400
|
+
ref: forwardedRef
|
|
8401
|
+
})
|
|
8402
|
+
});
|
|
8403
|
+
});
|
|
8404
|
+
DialogContent.displayName = CONTENT_NAME;
|
|
8405
|
+
var DialogContentModal = React$10.forwardRef((props, forwardedRef) => {
|
|
8406
|
+
const context = useDialogContext(CONTENT_NAME, props.__scopeDialog);
|
|
8407
|
+
const contentRef = React$10.useRef(null);
|
|
8408
|
+
const composedRefs = useComposedRefs(forwardedRef, context.contentRef, contentRef);
|
|
8409
|
+
React$10.useEffect(() => {
|
|
8410
|
+
const content = contentRef.current;
|
|
8411
|
+
if (content) return (0, import_es5.hideOthers)(content);
|
|
8412
|
+
}, []);
|
|
8413
|
+
return /* @__PURE__ */ jsx(DialogContentImpl, {
|
|
8414
|
+
...props,
|
|
8415
|
+
ref: composedRefs,
|
|
8416
|
+
trapFocus: context.open,
|
|
8417
|
+
disableOutsidePointerEvents: true,
|
|
8418
|
+
onCloseAutoFocus: composeEventHandlers(props.onCloseAutoFocus, (event) => {
|
|
8419
|
+
event.preventDefault();
|
|
8420
|
+
context.triggerRef.current?.focus();
|
|
8421
|
+
}),
|
|
8422
|
+
onPointerDownOutside: composeEventHandlers(props.onPointerDownOutside, (event) => {
|
|
8423
|
+
const originalEvent = event.detail.originalEvent;
|
|
8424
|
+
const ctrlLeftClick = originalEvent.button === 0 && originalEvent.ctrlKey === true;
|
|
8425
|
+
if (originalEvent.button === 2 || ctrlLeftClick) event.preventDefault();
|
|
8426
|
+
}),
|
|
8427
|
+
onFocusOutside: composeEventHandlers(props.onFocusOutside, (event) => event.preventDefault())
|
|
8428
|
+
});
|
|
8429
|
+
});
|
|
8430
|
+
var DialogContentNonModal = React$10.forwardRef((props, forwardedRef) => {
|
|
8431
|
+
const context = useDialogContext(CONTENT_NAME, props.__scopeDialog);
|
|
8432
|
+
const hasInteractedOutsideRef = React$10.useRef(false);
|
|
8433
|
+
const hasPointerDownOutsideRef = React$10.useRef(false);
|
|
8434
|
+
return /* @__PURE__ */ jsx(DialogContentImpl, {
|
|
8435
|
+
...props,
|
|
8436
|
+
ref: forwardedRef,
|
|
8437
|
+
trapFocus: false,
|
|
8438
|
+
disableOutsidePointerEvents: false,
|
|
8439
|
+
onCloseAutoFocus: (event) => {
|
|
8440
|
+
props.onCloseAutoFocus?.(event);
|
|
8441
|
+
if (!event.defaultPrevented) {
|
|
8442
|
+
if (!hasInteractedOutsideRef.current) context.triggerRef.current?.focus();
|
|
8443
|
+
event.preventDefault();
|
|
8444
|
+
}
|
|
8445
|
+
hasInteractedOutsideRef.current = false;
|
|
8446
|
+
hasPointerDownOutsideRef.current = false;
|
|
8447
|
+
},
|
|
8448
|
+
onInteractOutside: (event) => {
|
|
8449
|
+
props.onInteractOutside?.(event);
|
|
8450
|
+
if (!event.defaultPrevented) {
|
|
8451
|
+
hasInteractedOutsideRef.current = true;
|
|
8452
|
+
if (event.detail.originalEvent.type === "pointerdown") hasPointerDownOutsideRef.current = true;
|
|
8453
|
+
}
|
|
8454
|
+
const target = event.target;
|
|
8455
|
+
if (context.triggerRef.current?.contains(target)) event.preventDefault();
|
|
8456
|
+
if (event.detail.originalEvent.type === "focusin" && hasPointerDownOutsideRef.current) event.preventDefault();
|
|
8457
|
+
}
|
|
8458
|
+
});
|
|
8459
|
+
});
|
|
8460
|
+
var DialogContentImpl = React$10.forwardRef((props, forwardedRef) => {
|
|
8461
|
+
const { __scopeDialog, trapFocus, onOpenAutoFocus, onCloseAutoFocus, ...contentProps } = props;
|
|
8462
|
+
const context = useDialogContext(CONTENT_NAME, __scopeDialog);
|
|
8463
|
+
const contentRef = React$10.useRef(null);
|
|
8464
|
+
const composedRefs = useComposedRefs(forwardedRef, contentRef);
|
|
8465
|
+
useFocusGuards();
|
|
8466
|
+
return /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx(FocusScope, {
|
|
8467
|
+
asChild: true,
|
|
8468
|
+
loop: true,
|
|
8469
|
+
trapped: trapFocus,
|
|
8470
|
+
onMountAutoFocus: onOpenAutoFocus,
|
|
8471
|
+
onUnmountAutoFocus: onCloseAutoFocus,
|
|
8472
|
+
children: /* @__PURE__ */ jsx(DismissableLayer, {
|
|
8473
|
+
role: "dialog",
|
|
8474
|
+
id: context.contentId,
|
|
8475
|
+
"aria-describedby": context.descriptionId,
|
|
8476
|
+
"aria-labelledby": context.titleId,
|
|
8477
|
+
"data-state": getState(context.open),
|
|
8478
|
+
...contentProps,
|
|
8479
|
+
ref: composedRefs,
|
|
8480
|
+
onDismiss: () => context.onOpenChange(false)
|
|
8481
|
+
})
|
|
8482
|
+
}), /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx(TitleWarning, { titleId: context.titleId }), /* @__PURE__ */ jsx(DescriptionWarning, {
|
|
8483
|
+
contentRef,
|
|
8484
|
+
descriptionId: context.descriptionId
|
|
8485
|
+
})] })] });
|
|
8486
|
+
});
|
|
8487
|
+
var TITLE_NAME = "DialogTitle";
|
|
8488
|
+
var DialogTitle = React$10.forwardRef((props, forwardedRef) => {
|
|
8489
|
+
const { __scopeDialog, ...titleProps } = props;
|
|
8490
|
+
const context = useDialogContext(TITLE_NAME, __scopeDialog);
|
|
8491
|
+
return /* @__PURE__ */ jsx(Primitive$1.h2, {
|
|
8492
|
+
id: context.titleId,
|
|
8493
|
+
...titleProps,
|
|
8494
|
+
ref: forwardedRef
|
|
8495
|
+
});
|
|
8496
|
+
});
|
|
8497
|
+
DialogTitle.displayName = TITLE_NAME;
|
|
8498
|
+
var DESCRIPTION_NAME = "DialogDescription";
|
|
8499
|
+
var DialogDescription = React$10.forwardRef((props, forwardedRef) => {
|
|
8500
|
+
const { __scopeDialog, ...descriptionProps } = props;
|
|
8501
|
+
const context = useDialogContext(DESCRIPTION_NAME, __scopeDialog);
|
|
8502
|
+
return /* @__PURE__ */ jsx(Primitive$1.p, {
|
|
8503
|
+
id: context.descriptionId,
|
|
8504
|
+
...descriptionProps,
|
|
8505
|
+
ref: forwardedRef
|
|
8506
|
+
});
|
|
8507
|
+
});
|
|
8508
|
+
DialogDescription.displayName = DESCRIPTION_NAME;
|
|
8509
|
+
var CLOSE_NAME = "DialogClose";
|
|
8510
|
+
var DialogClose = React$10.forwardRef((props, forwardedRef) => {
|
|
8511
|
+
const { __scopeDialog, ...closeProps } = props;
|
|
8512
|
+
const context = useDialogContext(CLOSE_NAME, __scopeDialog);
|
|
8513
|
+
return /* @__PURE__ */ jsx(Primitive$1.button, {
|
|
8514
|
+
type: "button",
|
|
8515
|
+
...closeProps,
|
|
8516
|
+
ref: forwardedRef,
|
|
8517
|
+
onClick: composeEventHandlers(props.onClick, () => context.onOpenChange(false))
|
|
8518
|
+
});
|
|
8519
|
+
});
|
|
8520
|
+
DialogClose.displayName = CLOSE_NAME;
|
|
8521
|
+
function getState(open) {
|
|
8522
|
+
return open ? "open" : "closed";
|
|
8523
|
+
}
|
|
8524
|
+
var TITLE_WARNING_NAME = "DialogTitleWarning";
|
|
8525
|
+
var [WarningProvider, useWarningContext] = createContext2(TITLE_WARNING_NAME, {
|
|
8526
|
+
contentName: CONTENT_NAME,
|
|
8527
|
+
titleName: TITLE_NAME,
|
|
8528
|
+
docsSlug: "dialog"
|
|
8529
|
+
});
|
|
8530
|
+
var TitleWarning = ({ titleId }) => {
|
|
8531
|
+
const titleWarningContext = useWarningContext(TITLE_WARNING_NAME);
|
|
8532
|
+
const MESSAGE = `\`${titleWarningContext.contentName}\` requires a \`${titleWarningContext.titleName}\` for the component to be accessible for screen reader users.
|
|
8533
|
+
|
|
8534
|
+
If you want to hide the \`${titleWarningContext.titleName}\`, you can wrap it with our VisuallyHidden component.
|
|
8535
|
+
|
|
8536
|
+
For more information, see https://radix-ui.com/primitives/docs/components/${titleWarningContext.docsSlug}`;
|
|
8537
|
+
React$10.useEffect(() => {
|
|
8538
|
+
if (titleId) {
|
|
8539
|
+
if (!document.getElementById(titleId)) console.error(MESSAGE);
|
|
8540
|
+
}
|
|
8541
|
+
}, [MESSAGE, titleId]);
|
|
8542
|
+
return null;
|
|
8543
|
+
};
|
|
8544
|
+
var DESCRIPTION_WARNING_NAME = "DialogDescriptionWarning";
|
|
8545
|
+
var DescriptionWarning = ({ contentRef, descriptionId }) => {
|
|
8546
|
+
const MESSAGE = `Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${useWarningContext(DESCRIPTION_WARNING_NAME).contentName}}.`;
|
|
8547
|
+
React$10.useEffect(() => {
|
|
8548
|
+
const describedById = contentRef.current?.getAttribute("aria-describedby");
|
|
8549
|
+
if (descriptionId && describedById) {
|
|
8550
|
+
if (!document.getElementById(descriptionId)) console.warn(MESSAGE);
|
|
8551
|
+
}
|
|
8552
|
+
}, [
|
|
8553
|
+
MESSAGE,
|
|
8554
|
+
contentRef,
|
|
8555
|
+
descriptionId
|
|
8556
|
+
]);
|
|
8557
|
+
return null;
|
|
8558
|
+
};
|
|
8559
|
+
var Root$1 = Dialog;
|
|
8560
|
+
var Portal = DialogPortal;
|
|
8561
|
+
var Overlay = DialogOverlay;
|
|
8562
|
+
var Content = DialogContent;
|
|
8563
|
+
var Title = DialogTitle;
|
|
8564
|
+
var Description = DialogDescription;
|
|
8565
|
+
//#endregion
|
|
8566
|
+
//#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
|
|
8567
|
+
var REACT_LAZY_TYPE = Symbol.for("react.lazy");
|
|
8568
|
+
var use$1 = React$10[" use ".trim().toString()];
|
|
8569
|
+
function isPromiseLike(value) {
|
|
8570
|
+
return typeof value === "object" && value !== null && "then" in value;
|
|
8571
|
+
}
|
|
8572
|
+
function isLazyComponent(element) {
|
|
8573
|
+
return element != null && typeof element === "object" && "$$typeof" in element && element.$$typeof === REACT_LAZY_TYPE && "_payload" in element && isPromiseLike(element._payload);
|
|
8574
|
+
}
|
|
8575
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
8576
|
+
function createSlot(ownerName) {
|
|
8577
|
+
const SlotClone = /* @__PURE__ */ createSlotClone(ownerName);
|
|
8578
|
+
const Slot2 = React$10.forwardRef((props, forwardedRef) => {
|
|
8579
|
+
let { children, ...slotProps } = props;
|
|
8580
|
+
if (isLazyComponent(children) && typeof use$1 === "function") children = use$1(children._payload);
|
|
8581
|
+
const childrenArray = React$10.Children.toArray(children);
|
|
8582
|
+
const slottable = childrenArray.find(isSlottable);
|
|
8583
|
+
if (slottable) {
|
|
8584
|
+
const newElement = slottable.props.children;
|
|
8585
|
+
const newChildren = childrenArray.map((child) => {
|
|
8586
|
+
if (child === slottable) {
|
|
8587
|
+
if (React$10.Children.count(newElement) > 1) return React$10.Children.only(null);
|
|
8588
|
+
return React$10.isValidElement(newElement) ? newElement.props.children : null;
|
|
8589
|
+
} else return child;
|
|
8590
|
+
});
|
|
8591
|
+
return /* @__PURE__ */ jsx(SlotClone, {
|
|
8592
|
+
...slotProps,
|
|
8593
|
+
ref: forwardedRef,
|
|
8594
|
+
children: React$10.isValidElement(newElement) ? React$10.cloneElement(newElement, void 0, newChildren) : null
|
|
8595
|
+
});
|
|
8596
|
+
}
|
|
8597
|
+
return /* @__PURE__ */ jsx(SlotClone, {
|
|
8598
|
+
...slotProps,
|
|
8599
|
+
ref: forwardedRef,
|
|
8600
|
+
children
|
|
8601
|
+
});
|
|
8602
|
+
});
|
|
8603
|
+
Slot2.displayName = `${ownerName}.Slot`;
|
|
8604
|
+
return Slot2;
|
|
8605
|
+
}
|
|
8606
|
+
var Slot = /* @__PURE__ */ createSlot("Slot");
|
|
8607
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
8608
|
+
function createSlotClone(ownerName) {
|
|
8609
|
+
const SlotClone = React$10.forwardRef((props, forwardedRef) => {
|
|
8610
|
+
let { children, ...slotProps } = props;
|
|
8611
|
+
if (isLazyComponent(children) && typeof use$1 === "function") children = use$1(children._payload);
|
|
8612
|
+
if (React$10.isValidElement(children)) {
|
|
8613
|
+
const childrenRef = getElementRef(children);
|
|
8614
|
+
const props2 = mergeProps(slotProps, children.props);
|
|
8615
|
+
if (children.type !== React$10.Fragment) props2.ref = forwardedRef ? composeRefs(forwardedRef, childrenRef) : childrenRef;
|
|
8616
|
+
return React$10.cloneElement(children, props2);
|
|
8617
|
+
}
|
|
8618
|
+
return React$10.Children.count(children) > 1 ? React$10.Children.only(null) : null;
|
|
8619
|
+
});
|
|
8620
|
+
SlotClone.displayName = `${ownerName}.SlotClone`;
|
|
8621
|
+
return SlotClone;
|
|
8622
|
+
}
|
|
8623
|
+
var SLOTTABLE_IDENTIFIER = Symbol("radix.slottable");
|
|
8624
|
+
function isSlottable(child) {
|
|
8625
|
+
return React$10.isValidElement(child) && typeof child.type === "function" && "__radixId" in child.type && child.type.__radixId === SLOTTABLE_IDENTIFIER;
|
|
8626
|
+
}
|
|
8627
|
+
function mergeProps(slotProps, childProps) {
|
|
8628
|
+
const overrideProps = { ...childProps };
|
|
8629
|
+
for (const propName in childProps) {
|
|
8630
|
+
const slotPropValue = slotProps[propName];
|
|
8631
|
+
const childPropValue = childProps[propName];
|
|
8632
|
+
if (/^on[A-Z]/.test(propName)) {
|
|
8633
|
+
if (slotPropValue && childPropValue) overrideProps[propName] = (...args) => {
|
|
8634
|
+
const result = childPropValue(...args);
|
|
8635
|
+
slotPropValue(...args);
|
|
8636
|
+
return result;
|
|
8637
|
+
};
|
|
8638
|
+
else if (slotPropValue) overrideProps[propName] = slotPropValue;
|
|
8639
|
+
} else if (propName === "style") overrideProps[propName] = {
|
|
8640
|
+
...slotPropValue,
|
|
8641
|
+
...childPropValue
|
|
8642
|
+
};
|
|
8643
|
+
else if (propName === "className") overrideProps[propName] = [slotPropValue, childPropValue].filter(Boolean).join(" ");
|
|
8644
|
+
}
|
|
8645
|
+
return {
|
|
8646
|
+
...slotProps,
|
|
8647
|
+
...overrideProps
|
|
8648
|
+
};
|
|
8649
|
+
}
|
|
8650
|
+
function getElementRef(element) {
|
|
8651
|
+
let getter = Object.getOwnPropertyDescriptor(element.props, "ref")?.get;
|
|
8652
|
+
let mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning;
|
|
8653
|
+
if (mayWarn) return element.ref;
|
|
8654
|
+
getter = Object.getOwnPropertyDescriptor(element, "ref")?.get;
|
|
8655
|
+
mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning;
|
|
8656
|
+
if (mayWarn) return element.props.ref;
|
|
8657
|
+
return element.props.ref || element.ref;
|
|
8658
|
+
}
|
|
8659
|
+
//#endregion
|
|
8660
|
+
//#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
|
|
8661
|
+
var Primitive = [
|
|
8662
|
+
"a",
|
|
8663
|
+
"button",
|
|
8664
|
+
"div",
|
|
8665
|
+
"form",
|
|
8666
|
+
"h2",
|
|
8667
|
+
"h3",
|
|
8668
|
+
"img",
|
|
8669
|
+
"input",
|
|
8670
|
+
"label",
|
|
8671
|
+
"li",
|
|
8672
|
+
"nav",
|
|
8673
|
+
"ol",
|
|
8674
|
+
"p",
|
|
8675
|
+
"select",
|
|
8676
|
+
"span",
|
|
8677
|
+
"svg",
|
|
8678
|
+
"ul"
|
|
8679
|
+
].reduce((primitive, node) => {
|
|
8680
|
+
const Slot = /* @__PURE__ */ createSlot(`Primitive.${node}`);
|
|
8681
|
+
const Node = React$10.forwardRef((props, forwardedRef) => {
|
|
8682
|
+
const { asChild, ...primitiveProps } = props;
|
|
8683
|
+
const Comp = asChild ? Slot : node;
|
|
8684
|
+
if (typeof window !== "undefined") window[Symbol.for("radix-ui")] = true;
|
|
8685
|
+
return /* @__PURE__ */ jsx(Comp, {
|
|
8686
|
+
...primitiveProps,
|
|
8687
|
+
ref: forwardedRef
|
|
8688
|
+
});
|
|
8689
|
+
});
|
|
8690
|
+
Node.displayName = `Primitive.${node}`;
|
|
8691
|
+
return {
|
|
8692
|
+
...primitive,
|
|
8693
|
+
[node]: Node
|
|
8694
|
+
};
|
|
8695
|
+
}, {});
|
|
8696
|
+
//#endregion
|
|
8697
|
+
//#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
|
|
8698
|
+
var VISUALLY_HIDDEN_STYLES = Object.freeze({
|
|
8699
|
+
position: "absolute",
|
|
8700
|
+
border: 0,
|
|
8701
|
+
width: 1,
|
|
8702
|
+
height: 1,
|
|
8703
|
+
padding: 0,
|
|
8704
|
+
margin: -1,
|
|
8705
|
+
overflow: "hidden",
|
|
8706
|
+
clip: "rect(0, 0, 0, 0)",
|
|
8707
|
+
whiteSpace: "nowrap",
|
|
8708
|
+
wordWrap: "normal"
|
|
8709
|
+
});
|
|
8710
|
+
var NAME = "VisuallyHidden";
|
|
8711
|
+
var VisuallyHidden = React$10.forwardRef((props, forwardedRef) => {
|
|
8712
|
+
return /* @__PURE__ */ jsx(Primitive.span, {
|
|
8713
|
+
...props,
|
|
8714
|
+
ref: forwardedRef,
|
|
8715
|
+
style: {
|
|
8716
|
+
...VISUALLY_HIDDEN_STYLES,
|
|
8717
|
+
...props.style
|
|
8718
|
+
}
|
|
8719
|
+
});
|
|
8720
|
+
});
|
|
8721
|
+
VisuallyHidden.displayName = NAME;
|
|
8722
|
+
var Root = VisuallyHidden;
|
|
8723
|
+
//#endregion
|
|
8724
|
+
//#region ../design-system/dist/src-CVV6HzQZ.js
|
|
8291
8725
|
const PowerhouseButton = /* @__PURE__ */ forwardRef(function PowerhouseButton(props, ref) {
|
|
8292
8726
|
const { color = "dark", size = "medium", className = "", children, icon, iconPosition = "left", ...delegatedProps } = props;
|
|
8293
8727
|
return /* @__PURE__ */ jsxs("button", {
|
|
@@ -8319,6 +8753,24 @@ const DropdownMenuContent = /* @__PURE__ */ forwardRef(function DropdownMenuCont
|
|
|
8319
8753
|
}) });
|
|
8320
8754
|
});
|
|
8321
8755
|
const DropdownMenuItem = Item2;
|
|
8756
|
+
function Modal(props) {
|
|
8757
|
+
const { title, open, onOpenChange, contentProps, overlayProps, children, ...delegated } = props;
|
|
8758
|
+
return /* @__PURE__ */ jsx(Root$1, {
|
|
8759
|
+
defaultOpen: open,
|
|
8760
|
+
onOpenChange,
|
|
8761
|
+
open,
|
|
8762
|
+
children: /* @__PURE__ */ jsx(Portal, { children: /* @__PURE__ */ jsx(Overlay, {
|
|
8763
|
+
...overlayProps,
|
|
8764
|
+
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),
|
|
8765
|
+
children: /* @__PURE__ */ jsxs(Content, {
|
|
8766
|
+
...delegated,
|
|
8767
|
+
...contentProps,
|
|
8768
|
+
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),
|
|
8769
|
+
children: [/* @__PURE__ */ jsxs(Root, { children: [/* @__PURE__ */ jsx(Title, { children: title || "Modal" }), /* @__PURE__ */ jsx(Description, { children: title || "Modal" })] }), children]
|
|
8770
|
+
})
|
|
8771
|
+
}) })
|
|
8772
|
+
});
|
|
8773
|
+
}
|
|
8322
8774
|
const useWindowSize = () => {
|
|
8323
8775
|
const [windowSize, setWindowSize] = useState({
|
|
8324
8776
|
innerWidth: window.innerWidth,
|
|
@@ -8339,136 +8791,6 @@ const useWindowSize = () => {
|
|
|
8339
8791
|
return windowSize;
|
|
8340
8792
|
};
|
|
8341
8793
|
//#endregion
|
|
8342
|
-
//#region ../../node_modules/.pnpm/remeda@2.33.7/node_modules/remeda/dist/addProp.js
|
|
8343
|
-
function t$8(...t) {
|
|
8344
|
-
return t$9(n$5, t);
|
|
8345
|
-
}
|
|
8346
|
-
const n$5 = (e, t, n) => ({
|
|
8347
|
-
...e,
|
|
8348
|
-
[t]: n
|
|
8349
|
-
});
|
|
8350
|
-
//#endregion
|
|
8351
|
-
//#region ../../node_modules/.pnpm/remeda@2.33.7/node_modules/remeda/dist/defaultTo.js
|
|
8352
|
-
function t$7(...t) {
|
|
8353
|
-
return t$9(n$4, t);
|
|
8354
|
-
}
|
|
8355
|
-
const n$4 = (e, t) => e ?? t, t$6 = {
|
|
8356
|
-
done: !1,
|
|
8357
|
-
hasNext: !1
|
|
8358
|
-
};
|
|
8359
|
-
//#endregion
|
|
8360
|
-
//#region ../../node_modules/.pnpm/remeda@2.33.7/node_modules/remeda/dist/pipe.js
|
|
8361
|
-
function t$5(e, ...t) {
|
|
8362
|
-
let a = e, o = t.map((e) => `lazy` in e ? r$2(e) : void 0), s = 0;
|
|
8363
|
-
for (; s < t.length;) {
|
|
8364
|
-
if (o[s] === void 0 || !i$1(a)) {
|
|
8365
|
-
let e = t[s];
|
|
8366
|
-
a = e(a), s += 1;
|
|
8367
|
-
continue;
|
|
8368
|
-
}
|
|
8369
|
-
let e = [];
|
|
8370
|
-
for (let n = s; n < t.length; n++) {
|
|
8371
|
-
let t = o[n];
|
|
8372
|
-
if (t === void 0 || (e.push(t), t.isSingle)) break;
|
|
8373
|
-
}
|
|
8374
|
-
let r = [];
|
|
8375
|
-
for (let t of a) if (n$2(t, r, e)) break;
|
|
8376
|
-
let { isSingle: c } = e.at(-1);
|
|
8377
|
-
a = c ? r[0] : r, s += e.length;
|
|
8378
|
-
}
|
|
8379
|
-
return a;
|
|
8380
|
-
}
|
|
8381
|
-
function n$2(t, r, i) {
|
|
8382
|
-
if (i.length === 0) return r.push(t), !1;
|
|
8383
|
-
let a = t, o = t$6, s = !1;
|
|
8384
|
-
for (let [e, t] of i.entries()) {
|
|
8385
|
-
let { index: c, items: l } = t;
|
|
8386
|
-
if (l.push(a), o = t(a, c, l), t.index += 1, o.hasNext) {
|
|
8387
|
-
if (o.hasMany ?? !1) {
|
|
8388
|
-
for (let t of o.next) if (n$2(t, r, i.slice(e + 1))) return !0;
|
|
8389
|
-
return s;
|
|
8390
|
-
}
|
|
8391
|
-
a = o.next;
|
|
8392
|
-
}
|
|
8393
|
-
if (!o.hasNext) break;
|
|
8394
|
-
o.done && (s = !0);
|
|
8395
|
-
}
|
|
8396
|
-
return o.hasNext && r.push(a), s;
|
|
8397
|
-
}
|
|
8398
|
-
function r$2(e) {
|
|
8399
|
-
let { lazy: t, lazyArgs: n } = e, r = t(...n);
|
|
8400
|
-
return Object.assign(r, {
|
|
8401
|
-
isSingle: t.single ?? !1,
|
|
8402
|
-
index: 0,
|
|
8403
|
-
items: []
|
|
8404
|
-
});
|
|
8405
|
-
}
|
|
8406
|
-
function i$1(e) {
|
|
8407
|
-
return typeof e == `string` || typeof e == `object` && !!e && Symbol.iterator in e;
|
|
8408
|
-
}
|
|
8409
|
-
//#endregion
|
|
8410
|
-
//#region ../../node_modules/.pnpm/remeda@2.33.7/node_modules/remeda/dist/entries.js
|
|
8411
|
-
function t$4(...t) {
|
|
8412
|
-
return t$9(Object.entries, t);
|
|
8413
|
-
}
|
|
8414
|
-
//#endregion
|
|
8415
|
-
//#region ../../node_modules/.pnpm/remeda@2.33.7/node_modules/remeda/dist/filter.js
|
|
8416
|
-
function n$1(...t) {
|
|
8417
|
-
return t$9(r$1, t, i);
|
|
8418
|
-
}
|
|
8419
|
-
const r$1 = (e, t) => e.filter(t), i = (e) => (n, r, i) => e(n, r, i) ? {
|
|
8420
|
-
done: !1,
|
|
8421
|
-
hasNext: !0,
|
|
8422
|
-
next: n
|
|
8423
|
-
} : t$6;
|
|
8424
|
-
//#endregion
|
|
8425
|
-
//#region ../../node_modules/.pnpm/remeda@2.33.7/node_modules/remeda/dist/isArray.js
|
|
8426
|
-
function e$2(e) {
|
|
8427
|
-
return Array.isArray(e);
|
|
8428
|
-
}
|
|
8429
|
-
//#endregion
|
|
8430
|
-
//#region ../../node_modules/.pnpm/remeda@2.33.7/node_modules/remeda/dist/isIncludedIn.js
|
|
8431
|
-
function e$1(e, t) {
|
|
8432
|
-
if (t === void 0) {
|
|
8433
|
-
let t = new Set(e);
|
|
8434
|
-
return (e) => t.has(e);
|
|
8435
|
-
}
|
|
8436
|
-
return t.includes(e);
|
|
8437
|
-
}
|
|
8438
|
-
//#endregion
|
|
8439
|
-
//#region ../../node_modules/.pnpm/remeda@2.33.7/node_modules/remeda/dist/keys.js
|
|
8440
|
-
function t$3(...t) {
|
|
8441
|
-
return t$9(Object.keys, t);
|
|
8442
|
-
}
|
|
8443
|
-
//#endregion
|
|
8444
|
-
//#region ../../node_modules/.pnpm/remeda@2.33.7/node_modules/remeda/dist/map.js
|
|
8445
|
-
function t$2(...t) {
|
|
8446
|
-
return t$9(n, t, r);
|
|
8447
|
-
}
|
|
8448
|
-
const n = (e, t) => e.map(t), r = (e) => (t, n, r) => ({
|
|
8449
|
-
done: !1,
|
|
8450
|
-
hasNext: !0,
|
|
8451
|
-
next: e(t, n, r)
|
|
8452
|
-
});
|
|
8453
|
-
//#endregion
|
|
8454
|
-
//#region ../../node_modules/.pnpm/remeda@2.33.7/node_modules/remeda/dist/prop.js
|
|
8455
|
-
function e(e, ...n) {
|
|
8456
|
-
return typeof e == `string` || typeof e == `number` || typeof e == `symbol` ? (r) => t$1(r, e, ...n) : t$1(e, ...n);
|
|
8457
|
-
}
|
|
8458
|
-
function t$1(e, ...t) {
|
|
8459
|
-
let n = e;
|
|
8460
|
-
for (let e of t) {
|
|
8461
|
-
if (n == null) return;
|
|
8462
|
-
n = n[e];
|
|
8463
|
-
}
|
|
8464
|
-
return n;
|
|
8465
|
-
}
|
|
8466
|
-
//#endregion
|
|
8467
|
-
//#region ../../node_modules/.pnpm/remeda@2.33.7/node_modules/remeda/dist/values.js
|
|
8468
|
-
function t(...t) {
|
|
8469
|
-
return t$9(Object.values, t);
|
|
8470
|
-
}
|
|
8471
|
-
//#endregion
|
|
8472
8794
|
//#region ../../node_modules/.pnpm/react-hook-form@7.71.2_react@19.2.6/node_modules/react-hook-form/dist/index.esm.mjs
|
|
8473
8795
|
var isCheckBoxInput = (element) => element.type === "checkbox";
|
|
8474
8796
|
var isDateObject = (value) => value instanceof Date;
|
|
@@ -10658,6 +10980,136 @@ function useOnClickOutside(ref, handler, eventType = "mousedown", eventListenerO
|
|
|
10658
10980
|
}, void 0, eventListenerOptions);
|
|
10659
10981
|
}
|
|
10660
10982
|
//#endregion
|
|
10983
|
+
//#region ../../node_modules/.pnpm/remeda@2.33.7/node_modules/remeda/dist/addProp.js
|
|
10984
|
+
function t$8(...t) {
|
|
10985
|
+
return t$9(n$5, t);
|
|
10986
|
+
}
|
|
10987
|
+
const n$5 = (e, t, n) => ({
|
|
10988
|
+
...e,
|
|
10989
|
+
[t]: n
|
|
10990
|
+
});
|
|
10991
|
+
//#endregion
|
|
10992
|
+
//#region ../../node_modules/.pnpm/remeda@2.33.7/node_modules/remeda/dist/defaultTo.js
|
|
10993
|
+
function t$7(...t) {
|
|
10994
|
+
return t$9(n$4, t);
|
|
10995
|
+
}
|
|
10996
|
+
const n$4 = (e, t) => e ?? t, t$6 = {
|
|
10997
|
+
done: !1,
|
|
10998
|
+
hasNext: !1
|
|
10999
|
+
};
|
|
11000
|
+
//#endregion
|
|
11001
|
+
//#region ../../node_modules/.pnpm/remeda@2.33.7/node_modules/remeda/dist/pipe.js
|
|
11002
|
+
function t$5(e, ...t) {
|
|
11003
|
+
let a = e, o = t.map((e) => `lazy` in e ? r$2(e) : void 0), s = 0;
|
|
11004
|
+
for (; s < t.length;) {
|
|
11005
|
+
if (o[s] === void 0 || !i$1(a)) {
|
|
11006
|
+
let e = t[s];
|
|
11007
|
+
a = e(a), s += 1;
|
|
11008
|
+
continue;
|
|
11009
|
+
}
|
|
11010
|
+
let e = [];
|
|
11011
|
+
for (let n = s; n < t.length; n++) {
|
|
11012
|
+
let t = o[n];
|
|
11013
|
+
if (t === void 0 || (e.push(t), t.isSingle)) break;
|
|
11014
|
+
}
|
|
11015
|
+
let r = [];
|
|
11016
|
+
for (let t of a) if (n$2(t, r, e)) break;
|
|
11017
|
+
let { isSingle: c } = e.at(-1);
|
|
11018
|
+
a = c ? r[0] : r, s += e.length;
|
|
11019
|
+
}
|
|
11020
|
+
return a;
|
|
11021
|
+
}
|
|
11022
|
+
function n$2(t, r, i) {
|
|
11023
|
+
if (i.length === 0) return r.push(t), !1;
|
|
11024
|
+
let a = t, o = t$6, s = !1;
|
|
11025
|
+
for (let [e, t] of i.entries()) {
|
|
11026
|
+
let { index: c, items: l } = t;
|
|
11027
|
+
if (l.push(a), o = t(a, c, l), t.index += 1, o.hasNext) {
|
|
11028
|
+
if (o.hasMany ?? !1) {
|
|
11029
|
+
for (let t of o.next) if (n$2(t, r, i.slice(e + 1))) return !0;
|
|
11030
|
+
return s;
|
|
11031
|
+
}
|
|
11032
|
+
a = o.next;
|
|
11033
|
+
}
|
|
11034
|
+
if (!o.hasNext) break;
|
|
11035
|
+
o.done && (s = !0);
|
|
11036
|
+
}
|
|
11037
|
+
return o.hasNext && r.push(a), s;
|
|
11038
|
+
}
|
|
11039
|
+
function r$2(e) {
|
|
11040
|
+
let { lazy: t, lazyArgs: n } = e, r = t(...n);
|
|
11041
|
+
return Object.assign(r, {
|
|
11042
|
+
isSingle: t.single ?? !1,
|
|
11043
|
+
index: 0,
|
|
11044
|
+
items: []
|
|
11045
|
+
});
|
|
11046
|
+
}
|
|
11047
|
+
function i$1(e) {
|
|
11048
|
+
return typeof e == `string` || typeof e == `object` && !!e && Symbol.iterator in e;
|
|
11049
|
+
}
|
|
11050
|
+
//#endregion
|
|
11051
|
+
//#region ../../node_modules/.pnpm/remeda@2.33.7/node_modules/remeda/dist/entries.js
|
|
11052
|
+
function t$4(...t) {
|
|
11053
|
+
return t$9(Object.entries, t);
|
|
11054
|
+
}
|
|
11055
|
+
//#endregion
|
|
11056
|
+
//#region ../../node_modules/.pnpm/remeda@2.33.7/node_modules/remeda/dist/filter.js
|
|
11057
|
+
function n$1(...t) {
|
|
11058
|
+
return t$9(r$1, t, i);
|
|
11059
|
+
}
|
|
11060
|
+
const r$1 = (e, t) => e.filter(t), i = (e) => (n, r, i) => e(n, r, i) ? {
|
|
11061
|
+
done: !1,
|
|
11062
|
+
hasNext: !0,
|
|
11063
|
+
next: n
|
|
11064
|
+
} : t$6;
|
|
11065
|
+
//#endregion
|
|
11066
|
+
//#region ../../node_modules/.pnpm/remeda@2.33.7/node_modules/remeda/dist/isArray.js
|
|
11067
|
+
function e$2(e) {
|
|
11068
|
+
return Array.isArray(e);
|
|
11069
|
+
}
|
|
11070
|
+
//#endregion
|
|
11071
|
+
//#region ../../node_modules/.pnpm/remeda@2.33.7/node_modules/remeda/dist/isIncludedIn.js
|
|
11072
|
+
function e$1(e, t) {
|
|
11073
|
+
if (t === void 0) {
|
|
11074
|
+
let t = new Set(e);
|
|
11075
|
+
return (e) => t.has(e);
|
|
11076
|
+
}
|
|
11077
|
+
return t.includes(e);
|
|
11078
|
+
}
|
|
11079
|
+
//#endregion
|
|
11080
|
+
//#region ../../node_modules/.pnpm/remeda@2.33.7/node_modules/remeda/dist/keys.js
|
|
11081
|
+
function t$3(...t) {
|
|
11082
|
+
return t$9(Object.keys, t);
|
|
11083
|
+
}
|
|
11084
|
+
//#endregion
|
|
11085
|
+
//#region ../../node_modules/.pnpm/remeda@2.33.7/node_modules/remeda/dist/map.js
|
|
11086
|
+
function t$2(...t) {
|
|
11087
|
+
return t$9(n, t, r);
|
|
11088
|
+
}
|
|
11089
|
+
const n = (e, t) => e.map(t), r = (e) => (t, n, r) => ({
|
|
11090
|
+
done: !1,
|
|
11091
|
+
hasNext: !0,
|
|
11092
|
+
next: e(t, n, r)
|
|
11093
|
+
});
|
|
11094
|
+
//#endregion
|
|
11095
|
+
//#region ../../node_modules/.pnpm/remeda@2.33.7/node_modules/remeda/dist/prop.js
|
|
11096
|
+
function e(e, ...n) {
|
|
11097
|
+
return typeof e == `string` || typeof e == `number` || typeof e == `symbol` ? (r) => t$1(r, e, ...n) : t$1(e, ...n);
|
|
11098
|
+
}
|
|
11099
|
+
function t$1(e, ...t) {
|
|
11100
|
+
let n = e;
|
|
11101
|
+
for (let e of t) {
|
|
11102
|
+
if (n == null) return;
|
|
11103
|
+
n = n[e];
|
|
11104
|
+
}
|
|
11105
|
+
return n;
|
|
11106
|
+
}
|
|
11107
|
+
//#endregion
|
|
11108
|
+
//#region ../../node_modules/.pnpm/remeda@2.33.7/node_modules/remeda/dist/values.js
|
|
11109
|
+
function t(...t) {
|
|
11110
|
+
return t$9(Object.values, t);
|
|
11111
|
+
}
|
|
11112
|
+
//#endregion
|
|
10661
11113
|
//#region ../../node_modules/.pnpm/@babel+runtime@7.29.2/node_modules/@babel/runtime/helpers/extends.js
|
|
10662
11114
|
var require_extends = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
10663
11115
|
function _extends() {
|
|
@@ -13239,7 +13691,7 @@ function Breadcrumbs() {
|
|
|
13239
13691
|
}
|
|
13240
13692
|
function onSubmit(name) {
|
|
13241
13693
|
if (!isAllowedToCreateDocuments || !selectedDriveId) return;
|
|
13242
|
-
addFolder(selectedDriveId, name, selectedNodePath.at(-1)?.id).then((node) => {
|
|
13694
|
+
addFolder$1(selectedDriveId, name, selectedNodePath.at(-1)?.id).then((node) => {
|
|
13243
13695
|
setSelectedNode(node);
|
|
13244
13696
|
}).catch((error) => {
|
|
13245
13697
|
console.error(error);
|
|
@@ -13316,6 +13768,86 @@ function Breadcrumb(props) {
|
|
|
13316
13768
|
children: name
|
|
13317
13769
|
});
|
|
13318
13770
|
}
|
|
13771
|
+
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";
|
|
13772
|
+
function ModalButton(props) {
|
|
13773
|
+
const { variant, className, ...rest } = props;
|
|
13774
|
+
const confirmStyle = twMerge(defaultStyle, "bg-primary text-primary-foreground");
|
|
13775
|
+
const cancelStyle = twMerge(defaultStyle, "bg-muted text-muted-foreground");
|
|
13776
|
+
return /* @__PURE__ */ jsx("button", {
|
|
13777
|
+
className: twMerge(variant === "confirm" ? confirmStyle : cancelStyle, className),
|
|
13778
|
+
...rest
|
|
13779
|
+
});
|
|
13780
|
+
}
|
|
13781
|
+
function fixedForwardRef(render) {
|
|
13782
|
+
return /* @__PURE__ */ forwardRef(render);
|
|
13783
|
+
}
|
|
13784
|
+
const ConnectSelect = /* @__PURE__ */ fixedForwardRef(function Select(props, ref) {
|
|
13785
|
+
const { items, value, id, onChange, containerClassName, menuClassName, itemClassName, absolutePositionMenu = false, borderRadius = "6px", listClassName } = props;
|
|
13786
|
+
const [showItems, setShowItems] = useState(false);
|
|
13787
|
+
const containerRef = useRef(null);
|
|
13788
|
+
useEffect(() => {
|
|
13789
|
+
if (!showItems) return;
|
|
13790
|
+
function onPointerDown(event) {
|
|
13791
|
+
if (!containerRef.current?.contains(event.target)) setShowItems(false);
|
|
13792
|
+
}
|
|
13793
|
+
window.addEventListener("pointerdown", onPointerDown);
|
|
13794
|
+
return () => window.removeEventListener("pointerdown", onPointerDown);
|
|
13795
|
+
}, [showItems]);
|
|
13796
|
+
const selectedItem = getItemByValue(value) ?? items[0];
|
|
13797
|
+
function onItemClick(item) {
|
|
13798
|
+
if (item.disabled) return;
|
|
13799
|
+
onChange(item.value);
|
|
13800
|
+
setShowItems(false);
|
|
13801
|
+
}
|
|
13802
|
+
function getItemByValue(value) {
|
|
13803
|
+
return items.find((item) => item.value === value);
|
|
13804
|
+
}
|
|
13805
|
+
const itemsToShow = items.filter((item) => item.value !== value);
|
|
13806
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
13807
|
+
className: twMerge("border border-border bg-background text-foreground transition-[border-radius]", absolutePositionMenu && "relative", containerClassName),
|
|
13808
|
+
"data-open": showItems,
|
|
13809
|
+
ref: (node) => {
|
|
13810
|
+
containerRef.current = node;
|
|
13811
|
+
if (typeof ref === "function") ref(node);
|
|
13812
|
+
else if (ref) ref.current = node;
|
|
13813
|
+
},
|
|
13814
|
+
style: { borderRadius },
|
|
13815
|
+
children: [/* @__PURE__ */ jsxs("div", {
|
|
13816
|
+
className: twMerge("flex min-w-[360px] cursor-pointer items-center justify-between pr-3 text-foreground outline-none", menuClassName),
|
|
13817
|
+
id,
|
|
13818
|
+
onClick: () => setShowItems(!showItems),
|
|
13819
|
+
children: [/* @__PURE__ */ jsx(ItemContainer, {
|
|
13820
|
+
...selectedItem,
|
|
13821
|
+
className: itemClassName
|
|
13822
|
+
}), /* @__PURE__ */ jsx(Icon, {
|
|
13823
|
+
className: twJoin("transition", showItems ? "" : "-rotate-90"),
|
|
13824
|
+
name: "ChevronDown"
|
|
13825
|
+
})]
|
|
13826
|
+
}), /* @__PURE__ */ jsx("div", {
|
|
13827
|
+
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),
|
|
13828
|
+
style: { borderRadius: `0 0 ${borderRadius} ${borderRadius}` },
|
|
13829
|
+
children: itemsToShow.map((item) => /* @__PURE__ */ jsx(ItemContainer, {
|
|
13830
|
+
...item,
|
|
13831
|
+
className: itemClassName,
|
|
13832
|
+
onItemClick: () => onItemClick(item)
|
|
13833
|
+
}, item.value))
|
|
13834
|
+
})]
|
|
13835
|
+
});
|
|
13836
|
+
});
|
|
13837
|
+
function ItemContainer(props) {
|
|
13838
|
+
const { className, disabled, onItemClick, icon, displayValue, value, description } = props;
|
|
13839
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
13840
|
+
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),
|
|
13841
|
+
onClick: onItemClick,
|
|
13842
|
+
children: [icon, /* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsx("p", {
|
|
13843
|
+
className: "text-inherit capitalize",
|
|
13844
|
+
children: displayValue ?? value.toLowerCase()
|
|
13845
|
+
}), /* @__PURE__ */ jsx("p", {
|
|
13846
|
+
className: "text-xs text-foreground",
|
|
13847
|
+
children: description
|
|
13848
|
+
})] })]
|
|
13849
|
+
});
|
|
13850
|
+
}
|
|
13319
13851
|
const ANIM_DUR = 460;
|
|
13320
13852
|
1220 + ANIM_DUR + 800 + 1040 + ANIM_DUR + 400;
|
|
13321
13853
|
`${ANIM_DUR}`;
|
|
@@ -13536,6 +14068,33 @@ function ToolbarCloseButton(props) {
|
|
|
13536
14068
|
});
|
|
13537
14069
|
}
|
|
13538
14070
|
/**
|
|
14071
|
+
* Toolbar control for upgrading the document to the latest installed
|
|
14072
|
+
* document model version. Renders nothing when the document is already
|
|
14073
|
+
* current or no upgrade path is registered.
|
|
14074
|
+
*/
|
|
14075
|
+
function ToolbarUpgradeButton(props) {
|
|
14076
|
+
const { className, onClick: onClickOverride, document, children } = props;
|
|
14077
|
+
const versionStatus = useDocumentVersionStatus(document);
|
|
14078
|
+
const runUpgrade = () => {
|
|
14079
|
+
if (document) showPHModal({
|
|
14080
|
+
type: "confirmDocumentUpgrade",
|
|
14081
|
+
documentId: document.header.id
|
|
14082
|
+
});
|
|
14083
|
+
};
|
|
14084
|
+
const onClick = makeOnClick(document, onClickOverride, runUpgrade);
|
|
14085
|
+
if (!versionStatus || versionStatus.kind !== "upgrade-available" || !versionStatus.canUpgrade) return null;
|
|
14086
|
+
return /* @__PURE__ */ jsx(ToolbarButton, {
|
|
14087
|
+
"data-testid": "toolbar-upgrade-button",
|
|
14088
|
+
"aria-label": "Update document",
|
|
14089
|
+
className,
|
|
14090
|
+
onClick,
|
|
14091
|
+
children: children ?? /* @__PURE__ */ jsx("span", {
|
|
14092
|
+
className: "px-1 text-xs",
|
|
14093
|
+
children: "Update available"
|
|
14094
|
+
})
|
|
14095
|
+
});
|
|
14096
|
+
}
|
|
14097
|
+
/**
|
|
13539
14098
|
* Creates a toolbar button click handler.
|
|
13540
14099
|
*
|
|
13541
14100
|
* If an override is provided, it is called with the current document. Otherwise,
|
|
@@ -13614,6 +14173,7 @@ const defaultControlSlots = {
|
|
|
13614
14173
|
],
|
|
13615
14174
|
second: ["name"],
|
|
13616
14175
|
third: [
|
|
14176
|
+
"update",
|
|
13617
14177
|
"history",
|
|
13618
14178
|
"switchboard",
|
|
13619
14179
|
"close"
|
|
@@ -13644,6 +14204,7 @@ const defaultControlComponents = {
|
|
|
13644
14204
|
redo: ToolbarRedoButton,
|
|
13645
14205
|
download: ToolbarDownloadButton,
|
|
13646
14206
|
name: ToolbarName,
|
|
14207
|
+
update: ToolbarUpgradeButton,
|
|
13647
14208
|
switchboard: ToolbarSwitchboardButton,
|
|
13648
14209
|
history: ToolbarHistoryButton,
|
|
13649
14210
|
close: ToolbarCloseButton
|
|
@@ -14225,6 +14786,161 @@ function FolderItem(props) {
|
|
|
14225
14786
|
})
|
|
14226
14787
|
});
|
|
14227
14788
|
}
|
|
14789
|
+
const FormInput = /* @__PURE__ */ forwardRef(function FormInput(props, ref) {
|
|
14790
|
+
const { icon, errorMessage, isDirty, containerClassName, inputClassName, errorMessageClassName, hideErrors = false, ...delegatedProps } = props;
|
|
14791
|
+
const type = props.type ?? "text";
|
|
14792
|
+
const isError = !!errorMessage;
|
|
14793
|
+
return /* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsxs("div", {
|
|
14794
|
+
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),
|
|
14795
|
+
children: [icon && /* @__PURE__ */ jsx("span", {
|
|
14796
|
+
className: twJoin((!isDirty || isError) && "text-foreground"),
|
|
14797
|
+
children: icon
|
|
14798
|
+
}), /* @__PURE__ */ jsx("input", {
|
|
14799
|
+
...delegatedProps,
|
|
14800
|
+
className: twMerge("w-full bg-transparent font-semibold outline-none", inputClassName),
|
|
14801
|
+
ref,
|
|
14802
|
+
type
|
|
14803
|
+
})]
|
|
14804
|
+
}), /* @__PURE__ */ jsx("p", {
|
|
14805
|
+
className: twMerge("hidden min-h-4 text-xs text-destructive", isError && "block", hideErrors && "hidden", errorMessageClassName),
|
|
14806
|
+
children: errorMessage
|
|
14807
|
+
})] });
|
|
14808
|
+
});
|
|
14809
|
+
function Label(props) {
|
|
14810
|
+
const { children, className, ...labelProps } = props;
|
|
14811
|
+
return /* @__PURE__ */ jsx("label", {
|
|
14812
|
+
...labelProps,
|
|
14813
|
+
className: twMerge("block font-semibold text-muted-foreground", className),
|
|
14814
|
+
children
|
|
14815
|
+
});
|
|
14816
|
+
}
|
|
14817
|
+
const CLOSE_ANIMATION_DURATION = 300;
|
|
14818
|
+
const PLACEHOLDER_KEY = "";
|
|
14819
|
+
function optionKey(option) {
|
|
14820
|
+
return `${option.documentType}::${option.version ?? "latest"}`;
|
|
14821
|
+
}
|
|
14822
|
+
function optionDisplayName(option) {
|
|
14823
|
+
return option.version ? `${option.name} v${option.version}` : option.name;
|
|
14824
|
+
}
|
|
14825
|
+
function CreateDocumentWithTypeModal(props) {
|
|
14826
|
+
const { documentTypes, onCreate, onTypeSelected, onOpenChange, overlayProps, contentProps, ...restProps } = props;
|
|
14827
|
+
const [documentName, setDocumentName] = useState("");
|
|
14828
|
+
const [isNameValid, setIsNameValid] = useState(false);
|
|
14829
|
+
const [selectedKey, setSelectedKey] = useState(PLACEHOLDER_KEY);
|
|
14830
|
+
const selectedOption = documentTypes.find((option) => optionKey(option) === selectedKey);
|
|
14831
|
+
const canCreate = isNameValid && selectedOption !== void 0;
|
|
14832
|
+
const typeItems = documentTypes.map((option) => ({
|
|
14833
|
+
value: optionKey(option),
|
|
14834
|
+
displayValue: optionDisplayName(option)
|
|
14835
|
+
}));
|
|
14836
|
+
const items = selectedKey === PLACEHOLDER_KEY ? [{
|
|
14837
|
+
value: PLACEHOLDER_KEY,
|
|
14838
|
+
displayValue: "Select document type…"
|
|
14839
|
+
}, ...typeItems] : typeItems;
|
|
14840
|
+
const resetAfterClose = useCallback(() => {
|
|
14841
|
+
setTimeout(() => {
|
|
14842
|
+
setDocumentName("");
|
|
14843
|
+
setIsNameValid(false);
|
|
14844
|
+
setSelectedKey(PLACEHOLDER_KEY);
|
|
14845
|
+
}, CLOSE_ANIMATION_DURATION);
|
|
14846
|
+
}, []);
|
|
14847
|
+
const handleOpenChange = (open) => {
|
|
14848
|
+
onOpenChange?.(open);
|
|
14849
|
+
if (!open) resetAfterClose();
|
|
14850
|
+
};
|
|
14851
|
+
const handleCancel = () => {
|
|
14852
|
+
handleOpenChange(false);
|
|
14853
|
+
};
|
|
14854
|
+
const handleTypeChange = (value) => {
|
|
14855
|
+
if (value === PLACEHOLDER_KEY) return;
|
|
14856
|
+
setSelectedKey(value);
|
|
14857
|
+
const option = documentTypes.find((o) => optionKey(o) === value);
|
|
14858
|
+
if (option) onTypeSelected?.(option.documentType);
|
|
14859
|
+
};
|
|
14860
|
+
const handleCreate = useCallback(() => {
|
|
14861
|
+
if (!canCreate) return;
|
|
14862
|
+
onCreate({
|
|
14863
|
+
name: documentName,
|
|
14864
|
+
documentType: selectedOption.documentType,
|
|
14865
|
+
version: selectedOption.version
|
|
14866
|
+
});
|
|
14867
|
+
resetAfterClose();
|
|
14868
|
+
}, [
|
|
14869
|
+
canCreate,
|
|
14870
|
+
documentName,
|
|
14871
|
+
onCreate,
|
|
14872
|
+
resetAfterClose,
|
|
14873
|
+
selectedOption
|
|
14874
|
+
]);
|
|
14875
|
+
const handleSubmit = useCallback((e) => {
|
|
14876
|
+
e.preventDefault();
|
|
14877
|
+
handleCreate();
|
|
14878
|
+
}, [handleCreate]);
|
|
14879
|
+
return /* @__PURE__ */ jsx(Modal, {
|
|
14880
|
+
contentProps,
|
|
14881
|
+
onOpenChange: handleOpenChange,
|
|
14882
|
+
overlayProps,
|
|
14883
|
+
title: "Create a new document",
|
|
14884
|
+
...restProps,
|
|
14885
|
+
children: /* @__PURE__ */ jsxs("form", {
|
|
14886
|
+
name: "create-document-with-type",
|
|
14887
|
+
className: "max-h-[85vh] w-100 overflow-y-auto rounded-xl bg-background p-6 text-foreground",
|
|
14888
|
+
onSubmit: handleSubmit,
|
|
14889
|
+
children: [
|
|
14890
|
+
/* @__PURE__ */ jsx("div", {
|
|
14891
|
+
className: "pb-2 text-2xl font-bold text-foreground",
|
|
14892
|
+
children: "Create a new document"
|
|
14893
|
+
}),
|
|
14894
|
+
/* @__PURE__ */ jsxs("div", {
|
|
14895
|
+
className: "my-6",
|
|
14896
|
+
children: [!isNameValid && documentName ? /* @__PURE__ */ jsx("div", {
|
|
14897
|
+
className: "mb-2 text-destructive",
|
|
14898
|
+
children: "Document name must not be empty or contain control characters."
|
|
14899
|
+
}) : null, /* @__PURE__ */ jsx(FormInput, {
|
|
14900
|
+
icon: /* @__PURE__ */ jsx(Icon, { name: "BrickGlobe" }),
|
|
14901
|
+
onChange: (e) => {
|
|
14902
|
+
const name = e.target.value;
|
|
14903
|
+
setDocumentName(name);
|
|
14904
|
+
setIsNameValid(isValidName(name));
|
|
14905
|
+
},
|
|
14906
|
+
placeholder: "Document name",
|
|
14907
|
+
required: true,
|
|
14908
|
+
value: documentName
|
|
14909
|
+
})]
|
|
14910
|
+
}),
|
|
14911
|
+
/* @__PURE__ */ jsxs("div", {
|
|
14912
|
+
className: "my-6",
|
|
14913
|
+
children: [/* @__PURE__ */ jsx(Label, {
|
|
14914
|
+
className: "mb-2 text-sm font-medium text-foreground",
|
|
14915
|
+
htmlFor: "document-type",
|
|
14916
|
+
children: "Document type"
|
|
14917
|
+
}), /* @__PURE__ */ jsx(ConnectSelect, {
|
|
14918
|
+
id: "document-type",
|
|
14919
|
+
items,
|
|
14920
|
+
listClassName: "max-h-80 overflow-y-auto overscroll-contain",
|
|
14921
|
+
menuClassName: "min-w-0",
|
|
14922
|
+
onChange: handleTypeChange,
|
|
14923
|
+
value: selectedKey
|
|
14924
|
+
})]
|
|
14925
|
+
}),
|
|
14926
|
+
/* @__PURE__ */ jsxs("div", {
|
|
14927
|
+
className: "mt-8 flex justify-between gap-3",
|
|
14928
|
+
children: [/* @__PURE__ */ jsx(ModalButton, {
|
|
14929
|
+
onClick: handleCancel,
|
|
14930
|
+
type: "button",
|
|
14931
|
+
variant: "cancel",
|
|
14932
|
+
children: "Cancel"
|
|
14933
|
+
}), /* @__PURE__ */ jsx(ModalButton, {
|
|
14934
|
+
disabled: !canCreate,
|
|
14935
|
+
type: "submit",
|
|
14936
|
+
variant: "confirm",
|
|
14937
|
+
children: "Create"
|
|
14938
|
+
})]
|
|
14939
|
+
})
|
|
14940
|
+
]
|
|
14941
|
+
})
|
|
14942
|
+
});
|
|
14943
|
+
}
|
|
14228
14944
|
const FilterItem = (props) => {
|
|
14229
14945
|
const { item, className, ...containerProps } = props;
|
|
14230
14946
|
return /* @__PURE__ */ jsxs("div", {
|
|
@@ -14286,6 +15002,6 @@ const ConnectSearchBar = (props) => {
|
|
|
14286
15002
|
});
|
|
14287
15003
|
};
|
|
14288
15004
|
//#endregion
|
|
14289
|
-
export {
|
|
15005
|
+
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 };
|
|
14290
15006
|
|
|
14291
|
-
//# sourceMappingURL=connect-
|
|
15007
|
+
//# sourceMappingURL=connect-DM43aaJZ.mjs.map
|