@baseline-ui/core 3.2.0 → 3.3.0
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/Accordion.mjs +1 -1
- package/dist/ActionButton.css +1 -1
- package/dist/ActionButton.mjs +1 -1
- package/dist/ActionGroup.mjs +1 -1
- package/dist/ActionIconButton.mjs +1 -1
- package/dist/Actionable.mjs +1 -1
- package/dist/AlertDialog.css +1 -1
- package/dist/AlertDialog.mjs +1 -1
- package/dist/AudioPlayer.css +1 -1
- package/dist/AudioPlayer.mjs +1 -1
- package/dist/Avatar.mjs +1 -1
- package/dist/ButtonSelect.css +1 -1
- package/dist/ButtonSelect.mjs +1 -1
- package/dist/Calendar.css +1 -1
- package/dist/Calendar.mjs +1 -1
- package/dist/Checkbox.mjs +1 -1
- package/dist/Code.mjs +1 -1
- package/dist/ColorInput.css +1 -1
- package/dist/ColorInput.mjs +1 -1
- package/dist/ColorSwatch.mjs +1 -1
- package/dist/ColorSwatchPicker.mjs +1 -1
- package/dist/ComboBox.css +1 -1
- package/dist/ComboBox.mjs +1 -1
- package/dist/DateField.css +1 -1
- package/dist/DateField.mjs +1 -1
- package/dist/Dialog.mjs +1 -1
- package/dist/Disclosure.mjs +1 -1
- package/dist/DomNodeRenderer.mjs +1 -1
- package/dist/Drawer.mjs +1 -1
- package/dist/Editor.css +1 -1
- package/dist/Editor.mjs +1 -1
- package/dist/FileInput.css +1 -1
- package/dist/FileInput.mjs +1 -1
- package/dist/FileList.mjs +1 -1
- package/dist/FileUploader.css +1 -1
- package/dist/FileUploader.mjs +1 -1
- package/dist/FrameProvider.mjs +1 -1
- package/dist/FreehandCanvas.css +1 -1
- package/dist/FreehandCanvas.mjs +1 -1
- package/dist/GridList.mjs +1 -1
- package/dist/Icon.mjs +1 -1
- package/dist/ImageDropZone.css +1 -1
- package/dist/ImageDropZone.mjs +1 -1
- package/dist/ImageGallery.css +1 -1
- package/dist/ImageGallery.mjs +1 -1
- package/dist/InlineAlert.css +1 -1
- package/dist/InlineAlert.mjs +1 -1
- package/dist/InlineToolbar.mjs +2 -2
- package/dist/Kbd.mjs +1 -1
- package/dist/Link.mjs +1 -1
- package/dist/ListBox.mjs +1 -1
- package/dist/Markdown.mjs +1 -1
- package/dist/Menu.css +1 -1
- package/dist/Menu.mjs +1 -1
- package/dist/Modal.mjs +1 -1
- package/dist/NumberInput.mjs +1 -1
- package/dist/Pagination.mjs +1 -1
- package/dist/PointPicker.mjs +1 -1
- package/dist/Popover.mjs +1 -1
- package/dist/Portal.mjs +1 -1
- package/dist/Preview.mjs +1 -1
- package/dist/ProgressBar.mjs +1 -1
- package/dist/RadioGroup.mjs +1 -1
- package/dist/Reaction.mjs +1 -1
- package/dist/ScrollControlButton.mjs +1 -1
- package/dist/SearchInput.mjs +1 -1
- package/dist/Select.css +1 -1
- package/dist/Select.mjs +1 -1
- package/dist/Separator.mjs +1 -1
- package/dist/Slider.css +1 -1
- package/dist/Slider.mjs +1 -1
- package/dist/StatusCard.mjs +1 -1
- package/dist/Stepper.mjs +1 -1
- package/dist/Switch.mjs +1 -1
- package/dist/Table.mjs +1 -1
- package/dist/Tabs.mjs +1 -1
- package/dist/Tag.mjs +1 -1
- package/dist/TagGroup.mjs +1 -1
- package/dist/TaggedPagination.mjs +1 -1
- package/dist/Text.mjs +1 -1
- package/dist/TextInput.mjs +1 -1
- package/dist/ThemeProvider.mjs +1 -1
- package/dist/TimeField.mjs +1 -1
- package/dist/Toast.css +1 -1
- package/dist/Toast.mjs +1 -1
- package/dist/ToggleButton.css +1 -1
- package/dist/ToggleButton.mjs +1 -1
- package/dist/ToggleIconButton.mjs +1 -1
- package/dist/Toolbar.css +1 -1
- package/dist/Toolbar.mjs +1 -1
- package/dist/Tooltip.mjs +1 -1
- package/dist/TreeView.mjs +1 -1
- package/dist/UNSAFE_ListBox.mjs +1 -1
- package/dist/Virtualizer.mjs +1 -1
- package/dist/{chunk-XJGQXVMR.mjs → chunk-2BXXD6SW.mjs} +2 -2
- package/dist/{chunk-NCADIC3I.mjs → chunk-2EMOQIU7.mjs} +2 -2
- package/dist/{chunk-4FTKS25Q.mjs → chunk-2TH2QRSV.mjs} +2 -2
- package/dist/{chunk-JB3O4ABN.mjs → chunk-2V323KAD.mjs} +1 -1
- package/dist/{chunk-42B24XCP.mjs → chunk-2YTKLY4F.mjs} +1 -1
- package/dist/{chunk-PJM4COF5.mjs → chunk-4C6AJ3TZ.mjs} +2 -2
- package/dist/{chunk-NPJX2CEI.mjs → chunk-5HK56IXH.mjs} +1 -1
- package/dist/chunk-5IXSPQRW.mjs +10 -0
- package/dist/{chunk-IDEAEEBP.mjs → chunk-5K46OAX5.mjs} +2 -2
- package/dist/chunk-5MUEJ5WI.mjs +10 -0
- package/dist/chunk-6EFNC443.mjs +10 -0
- package/dist/{chunk-F6JQN7YM.mjs → chunk-6JWACCHG.mjs} +2 -2
- package/dist/{chunk-XVBOKL6D.mjs → chunk-6NQPENP4.mjs} +1 -1
- package/dist/{chunk-YT36W3OS.mjs → chunk-6PXOVWVM.mjs} +2 -2
- package/dist/chunk-6V7BIFQD.mjs +10 -0
- package/dist/chunk-6VXBFM6Q.mjs +10 -0
- package/dist/{chunk-4BYKAG4W.mjs → chunk-7L5UOGZA.mjs} +1 -1
- package/dist/{chunk-DF3BVX5Z.mjs → chunk-7MQBBSZ2.mjs} +2 -2
- package/dist/{chunk-O66FNQSB.mjs → chunk-7P322KP4.mjs} +1 -1
- package/dist/{chunk-UCZZLAPB.mjs → chunk-AW5WDI2U.mjs} +1 -1
- package/dist/chunk-AYBACQ6U.mjs +10 -0
- package/dist/chunk-B237CJT4.mjs +10 -0
- package/dist/{chunk-PBFIKNYZ.mjs → chunk-B6U6JHD4.mjs} +1 -1
- package/dist/{chunk-VHDXSFQC.mjs → chunk-BBZ2I3RF.mjs} +2 -2
- package/dist/chunk-BCENUHNO.mjs +10 -0
- package/dist/{chunk-DXP33KAB.mjs → chunk-BGHBSM3K.mjs} +2 -2
- package/dist/chunk-BIDNNBRG.mjs +10 -0
- package/dist/chunk-BROSGYL3.mjs +10 -0
- package/dist/{chunk-BW4VAHXR.mjs → chunk-C7AUJO36.mjs} +2 -2
- package/dist/{chunk-THRAJMLX.mjs → chunk-CCA2ABXO.mjs} +2 -2
- package/dist/{chunk-N7MTFSWR.mjs → chunk-CUOTJ7AP.mjs} +2 -2
- package/dist/chunk-CYTHB4M4.mjs +10 -0
- package/dist/chunk-DDLZ6CKC.mjs +10 -0
- package/dist/chunk-DMJHCNBU.mjs +10 -0
- package/dist/{chunk-HFVJXZBG.mjs → chunk-E3DMXJIC.mjs} +2 -2
- package/dist/{chunk-KG5PDPBK.mjs → chunk-E3QDPL77.mjs} +2 -2
- package/dist/chunk-E5GYCA3P.mjs +10 -0
- package/dist/{chunk-LQMY6TXS.mjs → chunk-EGXILQNX.mjs} +1 -1
- package/dist/{chunk-75722G3R.mjs → chunk-EYKIXVM3.mjs} +2 -2
- package/dist/{chunk-XB657BXX.mjs → chunk-GI2O6H4I.mjs} +1 -1
- package/dist/chunk-GVI6EBGJ.mjs +10 -0
- package/dist/chunk-HK3CZVHY.mjs +10 -0
- package/dist/{chunk-WSCZ34XO.mjs → chunk-HVKYWSRF.mjs} +2 -2
- package/dist/chunk-ILAQFMYD.mjs +10 -0
- package/dist/chunk-ITWJSFYK.mjs +10 -0
- package/dist/{chunk-MFH2E2GU.mjs → chunk-IVC2BJRU.mjs} +1 -1
- package/dist/{chunk-TEQE6WCH.mjs → chunk-IXK6S6IH.mjs} +1 -1
- package/dist/{chunk-HXTAOYOD.mjs → chunk-IXRSSEHQ.mjs} +1 -1
- package/dist/{chunk-5ODZPQL2.mjs → chunk-JDIGAVFU.mjs} +2 -2
- package/dist/{chunk-C5P23FUW.mjs → chunk-K6HE4Z2Y.mjs} +1 -1
- package/dist/chunk-K73R5G6G.mjs +10 -0
- package/dist/chunk-KEAM6GSA.mjs +10 -0
- package/dist/{chunk-JBMVWRHN.mjs → chunk-KHOXLBPR.mjs} +2 -2
- package/dist/{chunk-5DOFIGHJ.mjs → chunk-KWHTLY23.mjs} +2 -2
- package/dist/{chunk-4NYPVKDO.mjs → chunk-L6S5GBKS.mjs} +2 -2
- package/dist/chunk-M7OLZJYB.mjs +10 -0
- package/dist/{chunk-VXB5SVQC.mjs → chunk-MAJ74VNE.mjs} +1 -1
- package/dist/{chunk-TDOAVBKD.mjs → chunk-MONDDKB4.mjs} +2 -2
- package/dist/chunk-N26C7NYZ.mjs +10 -0
- package/dist/{chunk-P5GO3XIS.mjs → chunk-N6VKP3UH.mjs} +1 -1
- package/dist/chunk-NADBGP35.mjs +10 -0
- package/dist/chunk-NMSOOQB2.mjs +10 -0
- package/dist/{chunk-ENDOKA57.mjs → chunk-NQO6OQT6.mjs} +1 -1
- package/dist/{chunk-246VHB32.mjs → chunk-NUYBQ7KP.mjs} +1 -1
- package/dist/{chunk-77BAFSDX.mjs → chunk-NZQVKNP4.mjs} +2 -2
- package/dist/{chunk-K3S22PMF.mjs → chunk-P37WUXAI.mjs} +2 -2
- package/dist/{chunk-T3AMYEKR.mjs → chunk-P5LSMA24.mjs} +3 -3
- package/dist/{chunk-CSPZMYVG.mjs → chunk-PA3THES4.mjs} +1 -1
- package/dist/chunk-PG3WDHSK.mjs +10 -0
- package/dist/{chunk-GZ5ZWXIC.mjs → chunk-PNBYTIUO.mjs} +1 -1
- package/dist/{chunk-7HZ5JFYX.mjs → chunk-QDQPVCXN.mjs} +2 -2
- package/dist/{chunk-MXKP7NQ4.mjs → chunk-QSSCSN5S.mjs} +1 -1
- package/dist/chunk-QXOG2ISL.mjs +10 -0
- package/dist/{chunk-EV24JU64.mjs → chunk-QYTY3KJR.mjs} +2 -2
- package/dist/{chunk-3CWP2VCB.mjs → chunk-R2OV7FJO.mjs} +2 -2
- package/dist/{chunk-HLDCVJXD.mjs → chunk-RILRXWGE.mjs} +1 -1
- package/dist/{chunk-WOVAT6U4.mjs → chunk-RJZZIVSY.mjs} +2 -2
- package/dist/chunk-RO5ZRU3Y.mjs +10 -0
- package/dist/chunk-RSTHM3ZF.mjs +10 -0
- package/dist/{chunk-FTYXFTJV.mjs → chunk-SBR5UAUY.mjs} +2 -2
- package/dist/chunk-SHJ2TJYG.mjs +10 -0
- package/dist/{chunk-DRIHXAP3.mjs → chunk-SYFSGF73.mjs} +2 -2
- package/dist/{chunk-J7EAQSKX.mjs → chunk-SZTFMBPY.mjs} +1 -1
- package/dist/chunk-T4R3EXGI.mjs +10 -0
- package/dist/{chunk-WXWGGDTG.mjs → chunk-TBCZKWGQ.mjs} +2 -2
- package/dist/{chunk-JJPCZOOI.mjs → chunk-TCCQDGMI.mjs} +1 -1
- package/dist/{chunk-IHLJTHGQ.mjs → chunk-TDYBXLYP.mjs} +1 -1
- package/dist/{chunk-MI7DCFP2.mjs → chunk-TTYRHIRQ.mjs} +1 -1
- package/dist/{chunk-OC42IZG2.mjs → chunk-UBFMOTBM.mjs} +2 -2
- package/dist/chunk-UCPPKNGF.mjs +10 -0
- package/dist/{chunk-EK3RIYMV.mjs → chunk-UEDBY5JI.mjs} +1 -1
- package/dist/{chunk-ECPG4S5O.mjs → chunk-UN7XC7QV.mjs} +2 -2
- package/dist/{chunk-JUXBZ2ZN.mjs → chunk-UT2I4K7L.mjs} +1 -1
- package/dist/{chunk-J7K7I5U2.mjs → chunk-V37GPPZD.mjs} +1 -1
- package/dist/chunk-VAFIUM63.mjs +29 -0
- package/dist/{chunk-KKJ6XIU3.mjs → chunk-VIVNQZYK.mjs} +2 -2
- package/dist/{chunk-2JANDORZ.mjs → chunk-VOSSQAHC.mjs} +1 -1
- package/dist/chunk-VZFS4QRW.mjs +10 -0
- package/dist/chunk-X5Z54UUE.mjs +10 -0
- package/dist/{chunk-RJWPSJX2.mjs → chunk-X6IJEPSH.mjs} +1 -1
- package/dist/{chunk-7GJMJTRL.mjs → chunk-XEGXSFIP.mjs} +1 -1
- package/dist/{chunk-JQ4ZGZPV.mjs → chunk-XF5UMU6D.mjs} +3 -3
- package/dist/{chunk-5YYWD7PK.mjs → chunk-XJ2DFV56.mjs} +1 -1
- package/dist/{chunk-NSC53QWT.mjs → chunk-XUJJMAKM.mjs} +1 -1
- package/dist/{chunk-U2ODAIZG.mjs → chunk-XZSDCUID.mjs} +1 -1
- package/dist/{chunk-RF4E6MLM.mjs → chunk-Y3YZMICA.mjs} +1 -1
- package/dist/{chunk-TO6OQF2Y.mjs → chunk-YKMSINHH.mjs} +2 -2
- package/dist/{chunk-X3NOIEDZ.mjs → chunk-YWCU4PP7.mjs} +2 -2
- package/dist/chunk-YWQXHVMW.mjs +10 -0
- package/dist/{chunk-FOEGHU3P.mjs → chunk-YX2ASVM3.mjs} +1 -1
- package/dist/{chunk-N4UAXVES.mjs → chunk-Z4HTFTPM.mjs} +2 -2
- package/dist/chunk-ZLZAFTSD.mjs +10 -0
- package/dist/hooks/useContainerScopedRef.mjs +1 -1
- package/dist/hooks/useDevice.mjs +1 -1
- package/dist/hooks/useIntersectionObserver.mjs +1 -1
- package/dist/hooks/useLocalStorage.mjs +1 -1
- package/dist/hooks/useMutationObserver.mjs +1 -1
- package/dist/hooks/usePortalContainer.mjs +1 -1
- package/dist/hooks/usePreventFocus.mjs +1 -1
- package/dist/hooks/useResizeObserver.mjs +1 -1
- package/dist/hooks/useTextSelection.mjs +1 -1
- package/dist/hooks/useUndoRedo.mjs +1 -1
- package/dist/index.css +1 -1
- package/dist/index.d.ts +46 -31
- package/dist/index.js +19 -19
- package/dist/index.mjs +1 -1
- package/dist/utils/dom.mjs +1 -1
- package/dist/utils/isInShadowDOM.mjs +1 -1
- package/dist/utils/keyboards.mjs +1 -1
- package/package.json +6 -6
- package/sbom.json +27 -77
- package/dist/chunk-26T2EPFD.mjs +0 -29
- package/dist/chunk-2WAKHFPS.mjs +0 -10
- package/dist/chunk-3NQY5GPQ.mjs +0 -10
- package/dist/chunk-44OUOGJ4.mjs +0 -10
- package/dist/chunk-4N6CLPAY.mjs +0 -10
- package/dist/chunk-5PIO6M4F.mjs +0 -10
- package/dist/chunk-5ULL6IBX.mjs +0 -10
- package/dist/chunk-6IRWW75G.mjs +0 -10
- package/dist/chunk-6ZFBX7C7.mjs +0 -10
- package/dist/chunk-AMQX3KZR.mjs +0 -10
- package/dist/chunk-AZRPXTYJ.mjs +0 -10
- package/dist/chunk-BKDQLDOK.mjs +0 -10
- package/dist/chunk-BXSJTXXY.mjs +0 -10
- package/dist/chunk-CIIO5D3X.mjs +0 -10
- package/dist/chunk-E6VOSF6Z.mjs +0 -10
- package/dist/chunk-ELXWR5TS.mjs +0 -10
- package/dist/chunk-FJ2JRD3H.mjs +0 -10
- package/dist/chunk-HWUESZY2.mjs +0 -10
- package/dist/chunk-I4WMXV4T.mjs +0 -10
- package/dist/chunk-IW4GXU75.mjs +0 -10
- package/dist/chunk-J3MJZQUJ.mjs +0 -10
- package/dist/chunk-J6TYT6BF.mjs +0 -10
- package/dist/chunk-K4N7GVEI.mjs +0 -10
- package/dist/chunk-L452ID76.mjs +0 -10
- package/dist/chunk-LLAMYDGW.mjs +0 -10
- package/dist/chunk-LLVFPC5Q.mjs +0 -10
- package/dist/chunk-NHD7I3X2.mjs +0 -10
- package/dist/chunk-PF3OQKXP.mjs +0 -10
- package/dist/chunk-QY3O34WX.mjs +0 -10
- package/dist/chunk-ROHLZINC.mjs +0 -10
- package/dist/chunk-TIHKHXTS.mjs +0 -10
- package/dist/chunk-UVVONIZB.mjs +0 -10
- package/dist/chunk-WC2NUASA.mjs +0 -10
- package/dist/chunk-WDJ4GXWF.mjs +0 -10
- package/dist/chunk-Y45SV547.mjs +0 -10
- package/dist/chunk-YVYMYKYN.mjs +0 -10
- package/dist/chunk-ZREX7XOO.mjs +0 -10
- /package/dist/{chunk-EZXMEGV7.mjs → chunk-G6VX4SU6.mjs} +0 -0
- /package/dist/{chunk-FXCHST4Z.mjs → chunk-JQQGRJ5J.mjs} +0 -0
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import {a as a$3}from'./chunk-TKQOQVZD.mjs';import {a as a$2}from'./chunk-TAYP2OGC.mjs';import {a as a$4}from'./chunk-IVVZSESM.mjs';import {B as B$1}from'./chunk-OMT6ZWSV.mjs';import {b}from'./chunk-AYBACQ6U.mjs';import {a as a$6}from'./chunk-O7XK2WIX.mjs';import {a as a$5}from'./chunk-WWSGOGLA.mjs';import {c}from'./chunk-TZ4MVY4E.mjs';import {a}from'./chunk-JQQGRJ5J.mjs';import {a as a$7}from'./chunk-4QEH5CGK.mjs';import {UploadIcon}from'@baseline-ui/icons/20';import a$1 from'react';import {jsxs,jsx}from'react/jsx-runtime';/**
|
|
2
|
+
* Copyright (c) 2023-2024 PSPDFKit GmbH. All rights reserved.
|
|
3
|
+
*
|
|
4
|
+
* THIS SOURCE CODE AND ANY ACCOMPANYING DOCUMENTATION ARE PROTECTED BY INTERNATIONAL COPYRIGHT LAW
|
|
5
|
+
* AND MAY NOT BE RESOLD OR REDISTRIBUTED. USAGE IS BOUND TO THE PSPDFKIT LICENSE AGREEMENT.
|
|
6
|
+
* UNAUTHORIZED REPRODUCTION OR DISTRIBUTION IS SUBJECT TO CIVIL AND CRIMINAL PENALTIES.
|
|
7
|
+
* This notice may not be removed from this file.
|
|
8
|
+
*
|
|
9
|
+
*/
|
|
10
|
+
var U="_1yep5z6dv _1yep5z6f0",I=a({defaultClassName:"_12y0zas5 _1yep5z6c _1yep5z6d _1yep5z6e _1yep5z62o _1yep5z62p _1yep5z62q _1yep5z63u _1yep5z63v _1yep5z63w _1yep5z61i _1yep5z61j _1yep5z61k _1yep5z6j8 _1yep5z6j9 _1yep5z6ja _1yep5z6jk _1yep5z6jl _1yep5z6jm _1yep5z6jz _1yep5z6k0 _1yep5z6k1 _1yep5z6kt _1yep5z6ku _1yep5z6kv _1yep5z69i _1yep5z69j _1yep5z69k _1yep5z6m3 _1yep5z6dy _1yep5z6f5",variantClassNames:{isDisabled:{true:"_12y0zas6 _1yep5z611l"}},defaultVariants:{},compoundVariants:[]}),B=a({defaultClassName:"_12y0zas0 _1yep5z6j8 _1yep5z6j9 _1yep5z6ja _1yep5z6jk _1yep5z6jl _1yep5z6jm _1yep5z6m3 _1yep5z6gb",variantClassNames:{isInline:{true:"_1yep5z6x4 _1yep5z6x5 _1yep5z6x6 _1yep5z6xs _1yep5z6xt _1yep5z6xu _1yep5z6yg _1yep5z6yh _1yep5z6yi _1yep5z6z4 _1yep5z6z5 _1yep5z6z6 _1yep5z618z _1yep5z6190 _1yep5z6140"},isDropTarget:{true:"_1yep5z6132"},isError:{true:"_1yep5z618y _1yep5z6191 _1yep5z613e"},isDisabled:{true:"_1yep5z618y _1yep5z6190 _1yep5z6146"}},defaultVariants:{},compoundVariants:[[{isInline:true,isError:true},"_1yep5z61vi _1yep5z61vk _1yep5z61px"]]}),P=a({defaultClassName:"_12y0zas7 _1yep5z6fa",variantClassNames:{isDisabled:{true:"_1yep5z611u"}},defaultVariants:{},compoundVariants:[]}),E="_1yep5z6dv _1yep5z6ee",L="_1yep5z6j8 _1yep5z6j9 _1yep5z6ja _1yep5z6jk _1yep5z6jl _1yep5z6jm _1yep5z69f _1yep5z69g _1yep5z69h",D="_1yep5z6dy _1yep5z6ez",w="_1yep5z6j8 _1yep5z6j9 _1yep5z6ja _1yep5z6jk _1yep5z6jl _1yep5z6jm _1yep5z69i _1yep5z69j _1yep5z69k _1yep5z6m3";var Y="Drop files here or click to upload",$="Upload",V=a$1.forwardRef(({className:A,style:O,variant:m="dropzone",isInline:S=false,label:t,description:i,onAdd:f,accept:o,allowsMultiple:n=true,isDisabled:p,errorMessage:y,buttonLabel:H=$,dropzoneLabel:q=Y},Z)=>{let c$1=a$1.useId(),v=a$1.useId(),j=a$1.useId(),x=a$1.useRef(null),l=a$1.useCallback(e=>{if(!e.length)return;let X=n?e:e.slice(0,1);f?.(X);},[n,f]),b$1=e=>{e&&l([...e]);},{dropProps:G,isDropTarget:J}=B$1({ref:x,onDrop:async e=>{l(await a$2({items:e.items,accept:o}));}}),{clipboardProps:K}=a$3({isDisabled:p,onPaste:async e=>{l(await a$2({items:e,accept:o}));}}),C=[i?v:null,y?j:null].filter(Boolean).join(" ")||void 0,M=t||i?jsxs("div",{className:L,children:[t?jsx("div",{id:c$1,className:D,children:t}):null,i?jsx("div",{id:v,className:U,children:i}):null]}):null,Q=m==="dropzone"?jsx(a$4,{acceptedFileTypes:o?[o]:void 0,allowsMultiple:n,onSelect:b$1,children:jsx(a$5,{isDisabled:p,children:jsx("div",{ref:x,...c(p?{}:G,K),role:"button",tabIndex:p?-1:0,"aria-labelledby":t?c$1:void 0,"aria-describedby":C,"aria-disabled":p||void 0,"data-testid":"file-uploader-dropzone",className:B({isInline:S,isDropTarget:J,isDisabled:p,isError:!!y}),children:jsxs("div",{className:I({isDisabled:p}),children:[jsx(UploadIcon,{width:20,height:20,className:P({isDisabled:p})}),jsx("span",{children:q})]})})})}):jsx(a$4,{acceptedFileTypes:o?[o]:void 0,allowsMultiple:n,onSelect:b$1,children:jsx(b,{variant:"primary",iconStart:UploadIcon,label:H,isDisabled:p,"aria-describedby":C})}),W=y?jsx(a$6,{id:j,elementType:"span",role:"alert",className:E,children:y}):null;return jsxs("div",{ref:Z,className:a$7(w,"BaselineUI-FileUploader",A),style:O,"data-variant":m,"data-testid":"file-uploader",children:[M,Q,W]})});V.displayName="FileUploader";export{V as a};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import {a as a$1}from'./chunk-LZFTBNPW.mjs';import {a as a$2}from'./chunk-PG3WDHSK.mjs';import {c}from'./chunk-JDLUGVXG.mjs';import {a}from'./chunk-JQQGRJ5J.mjs';import {a as a$3}from'./chunk-4QEH5CGK.mjs';import M from'react';import {jsx,jsxs}from'react/jsx-runtime';/**
|
|
2
|
+
* Copyright (c) 2023-2024 PSPDFKit GmbH. All rights reserved.
|
|
3
|
+
*
|
|
4
|
+
* THIS SOURCE CODE AND ANY ACCOMPANYING DOCUMENTATION ARE PROTECTED BY INTERNATIONAL COPYRIGHT LAW
|
|
5
|
+
* AND MAY NOT BE RESOLD OR REDISTRIBUTED. USAGE IS BOUND TO THE PSPDFKIT LICENSE AGREEMENT.
|
|
6
|
+
* UNAUTHORIZED REPRODUCTION OR DISTRIBUTION IS SUBJECT TO CIVIL AND CRIMINAL PENALTIES.
|
|
7
|
+
* This notice may not be removed from this file.
|
|
8
|
+
*
|
|
9
|
+
*/
|
|
10
|
+
var v="_1yep5z6j8 _1yep5z6j9 _1yep5z6ja _1yep5z6jk _1yep5z6jl _1yep5z6jm _1yep5z6m3",u="_1yep5z6j8 _1yep5z6j9 _1yep5z6ja _1yep5z6jh _1yep5z6ji _1yep5z6jj _1yep5z6kz _1yep5z6l0 _1yep5z6l1",f=a({defaultClassName:"_12vfhl44",variantClassNames:{variant:{success:"_1yep5z612d",error:"_1yep5z6128",active:"_1yep5z612n"}},defaultVariants:{},compoundVariants:[]}),h="_1yep5z62f _1yep5z62g _1yep5z62h _1yep5z6ez _1yep5z6dy",B="_12vfhl43 _1yep5z6gd _1yep5z6m3",b="_12vfhl42 _1yep5z6j8 _1yep5z6j9 _1yep5z6ja _1yep5z6jh _1yep5z6ji _1yep5z6jj _1yep5z6jz _1yep5z6k0 _1yep5z6k1 _1yep5z69i _1yep5z69j _1yep5z69k",j="_1yep5z64l _1yep5z64m _1yep5z64n _1yep5z629 _1yep5z62a _1yep5z62b _1yep5z66 _1yep5z67 _1yep5z68 _1yep5z62i _1yep5z62j _1yep5z62k",C=a({defaultClassName:"_12vfhl40 _1yep5z62f _1yep5z62g _1yep5z62h _1yep5z6dy _1yep5z6ey",variantClassNames:{hasLabel:{false:"_1yep5z6py _1yep5z6pz _1yep5z6q0"}},defaultVariants:{},compoundVariants:[]});var x=M.forwardRef(({className:N,style:k,variant:p="active",showValue:y,description:l,errorMessage:P,"data-block-id":V,"data-block-class":T,...s},H)=>{let t=c(),{labelProps:L,progressBarProps:_}=a$1({...s,"aria-describedby":l?t:s["aria-describedby"]}),{minValue:z=0,maxValue:W=100,value:I=0,label:r}=s,R=(I-z)/(W-z),E=`${Math.round(R*100)}%`,i=jsx("output",{className:C({hasLabel:!!r}),children:_["aria-valuetext"]}),d=p==="error"?P:l;return jsxs("div",{..._,style:k,className:a$3(v,"BaselineUI-ProgressBar",N),"data-block-id":V,"data-block-class":T,ref:H,children:[r?jsxs("div",{className:u,children:[jsx("label",{...L,className:h,children:r}),y?i:null]}):null,jsxs("div",{className:j,children:[jsxs("div",{className:b,children:[jsx("div",{className:B,children:jsx("div",{style:{width:E},className:f({variant:p})})}),!r&&y?i:null]}),d?jsx("div",{className:a$2({hasError:p==="error"}),id:t,children:d}):null]})]})});x.displayName="ProgressBar";export{x as a};
|
|
@@ -7,4 +7,4 @@ import c from'react';/**
|
|
|
7
7
|
* This notice may not be removed from this file.
|
|
8
8
|
*
|
|
9
9
|
*/
|
|
10
|
-
function
|
|
10
|
+
function o(e){let r=c.useRef(null),n=()=>({get current(){return r.current},set current(u){r.current=u;}}),t=c.useRef({portalContainer:e,ref:n()});return t.current.portalContainer!==e&&(t.current={portalContainer:e,ref:n()}),t.current.ref}export{o as a};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {a as a$4}from'./chunk-
|
|
1
|
+
import {a as a$4}from'./chunk-7L5UOGZA.mjs';import {a as a$7,b as b$2}from'./chunk-XF5UMU6D.mjs';import {h,g}from'./chunk-AKES5B6C.mjs';import {a as a$8}from'./chunk-F2X474RV.mjs';import {a as a$5}from'./chunk-YX2ASVM3.mjs';import {a as a$3}from'./chunk-F3HQNHR5.mjs';import {c}from'./chunk-V3L4SVVF.mjs';import {b}from'./chunk-UT2I4K7L.mjs';import {b as b$1}from'./chunk-QR2AF3KT.mjs';import {a as a$1}from'./chunk-ZGRRD3TU.mjs';import {a as a$a}from'./chunk-UUBOEBYZ.mjs';import {a as a$9}from'./chunk-4PYEGHW5.mjs';import {a as a$2}from'./chunk-66CUIXA6.mjs';import {c as c$1}from'./chunk-TZ4MVY4E.mjs';import {b as b$3,e,f}from'./chunk-AUOQSTS5.mjs';import {a}from'./chunk-JQQGRJ5J.mjs';import {a as a$6}from'./chunk-4QEH5CGK.mjs';import x,{useContext,useMemo,useEffect,useState,useRef}from'react';import {jsx,jsxs}from'react/jsx-runtime';import {motion,AnimatePresence}from'motion/react';import {themeVars}from'@baseline-ui/tokens';/**
|
|
2
2
|
* Copyright (c) 2023-2024 PSPDFKit GmbH. All rights reserved.
|
|
3
3
|
*
|
|
4
4
|
* THIS SOURCE CODE AND ANY ACCOMPANYING DOCUMENTATION ARE PROTECTED BY INTERNATIONAL COPYRIGHT LAW
|
|
@@ -7,4 +7,4 @@ import {a as a$4}from'./chunk-4BYKAG4W.mjs';import {a as a$7,b as b$2}from'./chu
|
|
|
7
7
|
* This notice may not be removed from this file.
|
|
8
8
|
*
|
|
9
9
|
*/
|
|
10
|
-
var P=x.createContext({state:null,triggerProps:{},overlayProps:{}}),Ee=({children:e,...t})=>{let o=a$9(t),{triggerProps:a,overlayProps:n}=a$a({type:"dialog"},o),l=useMemo(()=>({state:o,triggerProps:a,overlayProps:n}),[o,a,n]);return jsx(P.Provider,{value:l,children:e})};Ee.displayName="Modal";function A(e,t,o){let{overlayProps:a,underlayProps:n}=a$7({...e,isOpen:t.isOpen,onClose:t.close},o);return b$2({isDisabled:!t.isOpen,root:e.root},o),c(),useEffect(()=>{if(t.isOpen&&o.current)return a$8([o.current],{shouldUseInert:e.shouldUseInert??false,root:e.root})},[t.isOpen,o,e.root,e.shouldUseInert]),{modalProps:c$1(a),underlayProps:n}}function se(e$1,t,o){let[a,n]=useState({}),l=useRef(false),[g$1,b]=useState(null),{container:p,shouldContainOverlays:d,isContainerPositioned:v,containerHeight:c,portalContainer:h$1}=useContext(b$1);useEffect(()=>{if(!e$1)return;let r=b$3(e$1),m=r.visualViewport,y=()=>{let M=o?m?.height??r.innerHeight:r.innerHeight,O=r.innerHeight-M;if(l.current=o?O>60:false,l.current){let i=f(e$1.ownerDocument);i&&g(i)&&i.scrollIntoView({behavior:"smooth",block:"center"});}if(t)n({maxHeight:(M||0)*.8,bottom:O});else {let i=`${M||0}px`,f=d?`min(${i}, ${c?c+"px":i})`:i;n({maxHeight:`calc(${f} - (2 * ${themeVars.spacing.xl} + env(safe-area-inset-top) + env(safe-area-inset-bottom)))`,top:l.current?`calc(env(safe-area-inset-top) + ${themeVars.spacing.xl})`:void 0});}};return y(),m?.addEventListener("resize",y),r.addEventListener("resize",y),()=>{m?.removeEventListener("resize",y),r.removeEventListener("resize",y);}},[e$1,t,d,o,c]);let C=h$1&&!e(p,h$1);useEffect(()=>{if(!p||!d||v&&!C)return;let r=()=>{p&&b(h(p));};r();let m=new ResizeObserver(()=>{r();});return m.observe(p),()=>{m.disconnect();}},[p,d,v,C]);let u=useMemo(()=>({...a,overflow:"auto",position:"relative"}),[a]),R=useMemo(()=>{if(!t&&l.current)return {alignItems:"flex-start"};if(d&&(!v||C)){let r=g$1||(p?h(p):{x:0,y:0,height:0,width:0});return {position:"absolute",left:r.x,top:r.y,height:r.height,width:r.width}}return {}},[t,l.current,p,v,d,g$1,C]);return {dialogStyle:u,containerStyle:R}}var le="aml2vl8
|
|
10
|
+
var P=x.createContext({state:null,triggerProps:{},overlayProps:{}}),Ee=({children:e,...t})=>{let o=a$9(t),{triggerProps:a,overlayProps:n}=a$a({type:"dialog"},o),l=useMemo(()=>({state:o,triggerProps:a,overlayProps:n}),[o,a,n]);return jsx(P.Provider,{value:l,children:e})};Ee.displayName="Modal";function A(e,t,o){let{overlayProps:a,underlayProps:n}=a$7({...e,isOpen:t.isOpen,onClose:t.close},o);return b$2({isDisabled:!t.isOpen,root:e.root},o),c(),useEffect(()=>{if(t.isOpen&&o.current)return a$8([o.current],{shouldUseInert:e.shouldUseInert??false,root:e.root})},[t.isOpen,o,e.root,e.shouldUseInert]),{modalProps:c$1(a),underlayProps:n}}function se(e$1,t,o){let[a,n]=useState({}),l=useRef(false),[g$1,b]=useState(null),{container:p,shouldContainOverlays:d,isContainerPositioned:v,containerHeight:c,portalContainer:h$1}=useContext(b$1);useEffect(()=>{if(!e$1)return;let r=b$3(e$1),m=r.visualViewport,y=()=>{let M=o?m?.height??r.innerHeight:r.innerHeight,O=r.innerHeight-M;if(l.current=o?O>60:false,l.current){let i=f(e$1.ownerDocument);i&&g(i)&&i.scrollIntoView({behavior:"smooth",block:"center"});}if(t)n({maxHeight:(M||0)*.8,bottom:O});else {let i=`${M||0}px`,f=d?`min(${i}, ${c?c+"px":i})`:i;n({maxHeight:`calc(${f} - (2 * ${themeVars.spacing.xl} + env(safe-area-inset-top) + env(safe-area-inset-bottom)))`,top:l.current?`calc(env(safe-area-inset-top) + ${themeVars.spacing.xl})`:void 0});}};return y(),m?.addEventListener("resize",y),r.addEventListener("resize",y),()=>{m?.removeEventListener("resize",y),r.removeEventListener("resize",y);}},[e$1,t,d,o,c]);let C=h$1&&!e(p,h$1);useEffect(()=>{if(!p||!d||v&&!C)return;let r=()=>{p&&b(h(p));};r();let m=new ResizeObserver(()=>{r();});return m.observe(p),()=>{m.disconnect();}},[p,d,v,C]);let u=useMemo(()=>({...a,overflow:"auto",position:"relative"}),[a]),R=useMemo(()=>{if(!t&&l.current)return {alignItems:"flex-start"};if(d&&(!v||C)){let r=g$1||(p?h(p):{x:0,y:0,height:0,width:0});return {position:"absolute",left:r.x,top:r.y,height:r.height,width:r.width}}return {}},[t,l.current,p,v,d,g$1,C]);return {dialogStyle:u,containerStyle:R}}var le="aml2vl8 _1yep5z6j8 _1yep5z6j9 _1yep5z6ja _1yep5z6iz _1yep5z6j0 _1yep5z6j1",pe="_1yep5z6al _1yep5z6am _1yep5z6an _1yep5z6b9 _1yep5z6ba _1yep5z6bb _1yep5z6bx _1yep5z6by _1yep5z6bz _1yep5z6cl _1yep5z6cm _1yep5z6cn _1yep5z6d7",me=a({defaultClassName:"aml2vl3 _1yep5z6lw _1yep5z6lx _1yep5z6lz _1yep5z6ly _1yep5z6j8 _1yep5z6j9 _1yep5z6ja",variantClassNames:{enableDrawer:{false:"_1yep5z6jz _1yep5z6k0 _1yep5z6k1 _1yep5z6kt _1yep5z6ku _1yep5z6kv",true:"aml2vl5"},shouldContainOverlays:{true:"aml2vl6",false:"aml2vl7"}},defaultVariants:{},compoundVariants:[]}),de=a({defaultClassName:"aml2vl0 _1yep5z6lw _1yep5z6lx _1yep5z6lz _1yep5z6ly _1yep5z6gj",variantClassNames:{shouldContainOverlays:{true:"aml2vl1",false:"aml2vl2"}},defaultVariants:{},compoundVariants:[]});var L=x.forwardRef(({children:e,className:t,style:o,isDismissable:a=true,isKeyboardDismissDisabled:n=false,portalContainer:l,disableAnimation:g,enableDrawer:b$2=false,"data-block-id":p,"data-block-class":d,shouldCloseOnInteractOutside:v,UNSAFE_enableInert:c,disableFocusManagement:h},C)=>{let{state:u}=x.useContext(P),[R,r]=x.useState(true),m=x.useRef(null),[y,M]=x.useState(null),{shouldHandleVirtualKeyboard:O}=useContext(b),{shouldContainOverlays:i,container:f}=useContext(b$1),Ce=a$1(),s=typeof b$2=="boolean"&&b$2||b$2==="auto"&&Ce==="mobile";a$2(u,"ModalContent must be a child of Modal");let Me=typeof a=="function"?a(s):a,ge=typeof n=="function"?n(s):n,be=typeof c=="function"?c(s):c??false,z=a$3(l),k=a$4(z),Pe=useMemo(()=>i&&f?f:z?.ownerDocument?.body??f?.ownerDocument?.body??document.body,[i,f,z]),{modalProps:xe,underlayProps:he}=A({isDismissable:R&&Me,shouldCloseOnInteractOutside:E=>!f?.contains(E)&&i&&!z?.contains(E)?false:v?.(E)??true,isKeyboardDismissDisabled:ge,root:Pe,shouldUseInert:be},u,k),{dialogStyle:V,containerStyle:Oe}=se(y,s,O),ze=useMemo(()=>({isDrawer:s,closeDrawer:u.close,dialogStyle:V,dialogRef:m,setDialogElement:M,isWithinModal:true}),[s,u.close,V,m,M]),_e=useMemo(()=>({setIsPopoverSafelyClosed:r}),[r]),j={duration:.3,type:"tween",ease:"easeOut"},De={type:"spring",duration:.3},we={open:{opacity:1,transform:s?"translateY(0%)":"scale(1)"},closed:g?{opacity:1,transform:s?"translateY(0%)":"scale(1)"}:{opacity:0,transform:s?"translateY(100%)":"scale(0.95)"}};return jsx(ye.Provider,{value:ze,children:jsx(fe.Provider,{value:_e,children:jsxs(a$5,{className:a$6(me({enableDrawer:s,shouldContainOverlays:i}),t),"data-block-id":p,"data-block-class":d,style:{...o,...Oe},portalContainer:l,disableFocusManagement:h,ref:C,children:[jsx(motion.div,{...he,variants:{open:{opacity:1},closed:{opacity:g?1:0}},initial:"closed",animate:"open",exit:"closed","data-testid":"underlay",transition:j,className:a$6(de({shouldContainOverlays:i}),"BaselineUI-Modal-Underlay")}),jsx(motion.div,{...xe,ref:k,"data-drawer":s,className:a$6(s?le:pe,"BaselineUI-Modal-Content"),variants:we,transition:s?j:De,initial:"closed",animate:"open",exit:"closed",children:typeof e=="function"?e(u):e})]})})})});L.displayName="ModalContentCore";var ye=x.createContext({isDrawer:false,closeDrawer:()=>{},dialogStyle:{},setDialogElement:()=>{},isWithinModal:false}),fe=x.createContext({setIsPopoverSafelyClosed:()=>{}}),Ve=x.forwardRef(({shouldAnimateOnMount:e=true,disableAnimation:t,...o},a)=>{let{state:n}=x.useContext(P);return jsx(AnimatePresence,{initial:e&&!t,children:n?.isOpen?jsx(L,{...o,disableAnimation:t,ref:a}):null})});Ve.displayName="ModalContent";export{P as a,Ee as b,ye as c,fe as d,Ve as e};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {a as a$1}from'./chunk-
|
|
1
|
+
import {a as a$1}from'./chunk-V37GPPZD.mjs';import {d}from'./chunk-UBFMOTBM.mjs';import {b as b$2}from'./chunk-DECHIERQ.mjs';import {a as a$2}from'./chunk-CGFLGZL4.mjs';import {b}from'./chunk-YB3KW7JC.mjs';import {b as b$1}from'./chunk-Y4DRSGEJ.mjs';import {a as a$4}from'./chunk-3FYY26ED.mjs';import {q}from'./chunk-MRJFGHFW.mjs';import {c as c$2,a as a$3}from'./chunk-TZ4MVY4E.mjs';import {a}from'./chunk-KEVERVHK.mjs';import {c as c$1,e}from'./chunk-JDLUGVXG.mjs';/**
|
|
2
2
|
* Copyright (c) 2023-2024 PSPDFKit GmbH. All rights reserved.
|
|
3
3
|
*
|
|
4
4
|
* THIS SOURCE CODE AND ANY ACCOMPANYING DOCUMENTATION ARE PROTECTED BY INTERNATIONAL COPYRIGHT LAW
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {g,e,d,f,h,b,a,c,i}from'./chunk-
|
|
1
|
+
import {g,e,d,f,h,b,a,c,i}from'./chunk-KEAM6GSA.mjs';import {y}from'./chunk-OMT6ZWSV.mjs';import {useMemo}from'react';/**
|
|
2
2
|
* Copyright (c) 2023-2024 PSPDFKit GmbH. All rights reserved.
|
|
3
3
|
*
|
|
4
4
|
* THIS SOURCE CODE AND ANY ACCOMPANYING DOCUMENTATION ARE PROTECTED BY INTERNATIONAL COPYRIGHT LAW
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import {a as a$2}from'./chunk-BIDNNBRG.mjs';import {b}from'./chunk-B6U6JHD4.mjs';import {d}from'./chunk-RCBUNCHV.mjs';import {e}from'./chunk-B7PSE5KC.mjs';import {a as a$1}from'./chunk-RSKKEGJZ.mjs';import {b as b$1,c}from'./chunk-TZ4MVY4E.mjs';import {a}from'./chunk-JQQGRJ5J.mjs';import {a as a$3}from'./chunk-4QEH5CGK.mjs';import {CaretDownIcon}from'@baseline-ui/icons/8';import R from'react';import {jsxs,jsx}from'react/jsx-runtime';/**
|
|
2
|
+
* Copyright (c) 2023-2024 PSPDFKit GmbH. All rights reserved.
|
|
3
|
+
*
|
|
4
|
+
* THIS SOURCE CODE AND ANY ACCOMPANYING DOCUMENTATION ARE PROTECTED BY INTERNATIONAL COPYRIGHT LAW
|
|
5
|
+
* AND MAY NOT BE RESOLD OR REDISTRIBUTED. USAGE IS BOUND TO THE PSPDFKIT LICENSE AGREEMENT.
|
|
6
|
+
* UNAUTHORIZED REPRODUCTION OR DISTRIBUTION IS SUBJECT TO CIVIL AND CRIMINAL PENALTIES.
|
|
7
|
+
* This notice may not be removed from this file.
|
|
8
|
+
*
|
|
9
|
+
*/
|
|
10
|
+
var w=a({defaultClassName:"oom8bs0 _1yep5z6ai _1yep5z6aj _1yep5z6ak _1yep5z6b6 _1yep5z6b7 _1yep5z6b8 _1yep5z6bu _1yep5z6bv _1yep5z6bw _1yep5z6ci _1yep5z6cj _1yep5z6ck _1yep5z6jb _1yep5z6jc _1yep5z6jd _1yep5z69i _1yep5z69j _1yep5z69k _1yep5z6jz _1yep5z6k0 _1yep5z6k1 _1yep5z6m5 _1yep5z6m6 _1yep5z6m0 _1yep5z6dy _1yep5z6lq z9nup88",variantClassNames:{variant:{primary:"oom8bs1",secondary:"oom8bs2",tertiary:"oom8bs3",ghost:"oom8bs4",popover:"oom8bs5",toolbar:"oom8bs6",success:"oom8bs7",warning:"oom8bs8",error:"oom8bs9","success-secondary":"oom8bsa","warning-secondary":"oom8bsb","error-secondary":"oom8bsc","success-tertiary":"oom8bsd","warning-tertiary":"oom8bse","error-tertiary":"oom8bsf"},isDisabled:{true:"oom8bsg"},isFocusVisible:{true:"oom8bsh"},isHovered:{true:"oom8bsi"},size:{sm:"oom8bsj",md:"oom8bsk",lg:"oom8bsl"}},defaultVariants:{},compoundVariants:[[{variant:"primary",isHovered:true},"oom8bsm"],[{variant:"secondary",isHovered:true},"oom8bsn"],[{variant:"tertiary",isHovered:true},"oom8bso"],[{variant:"ghost",isHovered:true},"oom8bsp"],[{variant:"success",isHovered:true},"oom8bsq"],[{variant:"warning",isHovered:true},"oom8bsr"],[{variant:"error",isHovered:true},"oom8bss"],[{variant:"primary",isFocusVisible:true},"oom8bst"],[{variant:"tertiary",isFocusVisible:true},"oom8bsu"],[{variant:"success",isFocusVisible:true},"oom8bsv"],[{variant:"success-secondary",isHovered:true},"oom8bsw"],[{variant:"success-secondary",isFocusVisible:true},"oom8bsx"],[{variant:"success-tertiary",isHovered:true},"oom8bsy"],[{variant:"success-tertiary",isFocusVisible:true},"oom8bsz"],[{variant:"warning",isFocusVisible:true},"oom8bs10"],[{variant:"warning-secondary",isHovered:true},"oom8bs11"],[{variant:"warning-secondary",isFocusVisible:true},"oom8bs12"],[{variant:"warning-tertiary",isHovered:true},"oom8bs13"],[{variant:"warning-tertiary",isFocusVisible:true},"oom8bs14"],[{variant:"error",isFocusVisible:true},"oom8bs15"],[{variant:"error-secondary",isHovered:true},"oom8bs16"],[{variant:"error-secondary",isFocusVisible:true},"oom8bs17"],[{variant:"error-tertiary",isHovered:true},"oom8bs18"],[{variant:"error-tertiary",isFocusVisible:true},"oom8bs19"]]}),n=a({defaultClassName:"oom8bs1a _1yep5z6lq",variantClassNames:{isDisabled:{true:"oom8bs1b"},isFocusVisible:{true:"oom8bs1c"},isHovered:{true:"_1yep5z611p"},variant:{primary:"_1yep5z611w",secondary:"_1yep5z611s",tertiary:"_1yep5z611x",ghost:"_1yep5z611x",popover:"_1yep5z611s",toolbar:"_1yep5z611s",success:"_1yep5z611v",warning:"_1yep5z611v",error:"_1yep5z611v","success-secondary":"_1yep5z6113","warning-secondary":"_1yep5z6118","error-secondary":"_1yep5z610y","success-tertiary":"_1yep5z6112","warning-tertiary":"_1yep5z6117","error-tertiary":"_1yep5z610x"}},defaultVariants:{},compoundVariants:[[{variant:"tertiary",isHovered:true},"_1yep5z61of"],[{variant:"ghost",isHovered:true},"_1yep5z61oh"],[{variant:"tertiary",isFocusVisible:true},"_1yep5z61of"],[{variant:"success-secondary",isHovered:true},"_1yep5z61nn"],[{variant:"success-tertiary",isHovered:true},"_1yep5z61oe"],[{variant:"success-tertiary",isFocusVisible:true},"_1yep5z61oe"],[{variant:"warning-secondary",isHovered:true},"_1yep5z61ns"],[{variant:"warning-tertiary",isHovered:true},"_1yep5z61oe"],[{variant:"warning-tertiary",isFocusVisible:true},"_1yep5z61oe"],[{variant:"error-secondary",isHovered:true},"_1yep5z61ni"],[{variant:"error-tertiary",isHovered:true},"_1yep5z61oe"],[{variant:"error-tertiary",isFocusVisible:true},"_1yep5z61oe"],[{variant:"secondary",isDisabled:true},"_1yep5z61od"],[{variant:"tertiary",isDisabled:true},"_1yep5z61od"],[{variant:"ghost",isDisabled:true},"_1yep5z61od"],[{variant:"popover",isDisabled:true},"_1yep5z61od"],[{variant:"toolbar",isDisabled:true},"_1yep5z61od"],[{variant:"success-secondary",isDisabled:true},"_1yep5z61od"],[{variant:"success-tertiary",isDisabled:true},"_1yep5z61od"],[{variant:"warning-secondary",isDisabled:true},"_1yep5z61od"],[{variant:"warning-tertiary",isDisabled:true},"_1yep5z61od"],[{variant:"error-secondary",isDisabled:true},"_1yep5z61od"],[{variant:"error-tertiary",isDisabled:true},"_1yep5z61od"]]});var q={sm:16,md:20,lg:24},F=R.forwardRef((D,C)=>{let[k,B]=e(D,C,d),{label:x,style:t,className:a,iconStart:c$1,iconEnd:u,variant:r="primary",elementType:p="button",isDisabled:e$1,size:m="sm","data-block-id":N,"data-block-class":h,slot:G,...A}=k,{buttonProps:P,isPressed:j,ref:I,isFocusVisible:o,isFocused:T,isHovered:s,uiStateOptions:b$2}=b({...A,elementType:p,isDisabled:e$1}),d$1=q[m],E=a$1({"data-block-id":N,"data-block-class":h,"data-disabled":e$1,"data-focused":T,"data-focus-visible":o,"data-hovered":s,"data-pressed":j});return jsxs(p,{...c(P,E),className:a$3(w({isDisabled:!!e$1,isFocusVisible:o,isHovered:s,variant:r,size:m}),"BaselineUI-ActionButton",typeof a=="function"?a(b$2):a),style:typeof t=="function"?t(b$2):t,ref:b$1(B,I),children:[!!c$1&&jsx(c$1,{size:d$1,className:n({variant:r,isDisabled:e$1,isFocusVisible:o,isHovered:s})}),x,!!u&&jsx(u,{size:d$1,className:n({variant:r,isDisabled:e$1,isFocusVisible:o,isHovered:s})}),r==="popover"&&jsx(CaretDownIcon,{size:8,className:a$2})]})});F.displayName="ActionButton";export{w as a,F as b};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import {a as a$7}from'./chunk-NV7KQVPE.mjs';import {a as a$c}from'./chunk-YCI6BEXQ.mjs';import {a as a$4}from'./chunk-TKQOQVZD.mjs';import {a as a$3}from'./chunk-TAYP2OGC.mjs';import {c as c$2}from'./chunk-5MUEJ5WI.mjs';import {b as b$1,c as c$1,a as a$d}from'./chunk-RO5ZRU3Y.mjs';import {B}from'./chunk-OMT6ZWSV.mjs';import {a as a$2}from'./chunk-SAZLJ66W.mjs';import {b,c as c$3}from'./chunk-GX2IOGYR.mjs';import {a as a$9,b as b$3}from'./chunk-AYBACQ6U.mjs';import {a as a$b}from'./chunk-O7XK2WIX.mjs';import {b as b$2}from'./chunk-4ZJMZB5B.mjs';import {a as a$1}from'./chunk-66CUIXA6.mjs';import {a}from'./chunk-X3AXUU3H.mjs';import {a as a$a}from'./chunk-RSKKEGJZ.mjs';import {a as a$5}from'./chunk-K6X2BHPP.mjs';import {a as a$6}from'./chunk-3FYY26ED.mjs';import {c}from'./chunk-TZ4MVY4E.mjs';import {a as a$e}from'./chunk-JDLUGVXG.mjs';import {a as a$8}from'./chunk-4QEH5CGK.mjs';import Z,{useState}from'react';import {jsxs,jsx}from'react/jsx-runtime';/**
|
|
2
|
+
* Copyright (c) 2023-2024 PSPDFKit GmbH. All rights reserved.
|
|
3
|
+
*
|
|
4
|
+
* THIS SOURCE CODE AND ANY ACCOMPANYING DOCUMENTATION ARE PROTECTED BY INTERNATIONAL COPYRIGHT LAW
|
|
5
|
+
* AND MAY NOT BE RESOLD OR REDISTRIBUTED. USAGE IS BOUND TO THE PSPDFKIT LICENSE AGREEMENT.
|
|
6
|
+
* UNAUTHORIZED REPRODUCTION OR DISTRIBUTION IS SUBJECT TO CIVIL AND CRIMINAL PENALTIES.
|
|
7
|
+
* This notice may not be removed from this file.
|
|
8
|
+
*
|
|
9
|
+
*/
|
|
10
|
+
var Q=Z.forwardRef(({className:t,style:u,isInline:n=true,accept:i="image/*",defaultImageSrc:g,imageSrc:s,imageAlt:X,pickerButtonLabel:Y,isDisabled:o,onDrop:$,onPaste:S,includeCheckeredBackground:ee=true,"data-block-id":te,"data-block-class":re,pickerButtonStyle:oe,pickerButtonClassName:se,footerClassName:ne,footerStyle:ie,clearLabel:y,placeholder:P,labelStyle:ae,labelClassName:le,maxFileSize:w,onFileSizeError:ue,onFileTypeError:me,...m},pe)=>{let f=Z.useRef(null),h=Z.useRef(null),{formatMessage:fe}=b(),ce=e=>!w||e.size<=w?true:(ue?.(e),false),de=e=>xe(e,i)?true:(me?.(e),false),F=e=>de(e)&&ce(e),[ge,c$3]=a(s,g||null,e=>{a$1(typeof e!="string"),m.onValueChange?.(e?[e]:[]);}),l=Te(ge),{fieldProps:ye,labelProps:Pe}=a$2({...m,ref:f}),{dropProps:he,isDropTarget:I}=B({ref:f,onDrop:async e=>{if(o)return;let r=await a$3({items:e.items});r.length&&F(r[0])&&c$3(r[0]),$?.(e);},...m}),{clipboardProps:Fe}=a$4({onPaste:async e=>{if(o)return;let r=await a$3({items:e});r.length&&F(r[0])&&c$3(r[0]),S?.(e);},...m}),Ie=()=>{c$3(null),h.current&&(h.current.value="");},be={type:"file",onChange:e=>{let r=[...e.target.files];r.length&&F(r[0])?c$3(r[0]):r.length&&(e.target.value=""),m.onChange?.(e);},accept:i,disabled:o},{focusProps:ve,isFocused:Ce,isFocusVisible:b$4}=a$5({within:true}),{hoverProps:Le,isHovered:B$1}=a$6({isDisabled:o}),{imgProps:Re,isLoading:Ze,isLoaded:v}=a$7({src:l,alt:X||""}),we={label:Y||fe(Ae.selectImage),onPress:()=>f.current?.click(),variant:"secondary",isDisabled:o,excludeFromTabOrder:true,className:a$8(a$9({isFocusVisible:b$4}),{[b$1]:I&&!o},se),style:oe},Be=a$a({"data-loaded":v,"data-block-id":te,"data-block-class":re,"data-hovered":B$1,"data-focused":Ce,"data-drop-target":I,"data-disabled":o,"data-focus-visible":b$4});return jsxs(a$b,{...Be,className:a$8("BaselineUI-ImageDropZone",t),display:"flex",flexDirection:"column",alignItems:"center",style:u,ref:pe,children:[jsxs("label",{...c(he,Le,ve,Pe),className:a$8(a$d({isInline:n,isHovered:B$1,isDisabled:o,hasLoadedImage:!!l&&v,showFocusRing:I||!!l&&b$4}),le),style:ae,ref:f,children:[jsx(b$2,{children:jsx("input",{...c(ye,Fe,be),ref:h})}),!l&&jsx(b$3,{...we}),!!l&&(Ze?jsx(a$c,{}):jsx("img",{className:c$1({isInline:n,isDisabled:o,hasLoadedImage:!!l&&v&&ee}),...Re}))]}),P||y?jsx("div",{style:ie,className:a$8(c$2({isInline:n,isDisabled:o}),ne),children:(l||!P)&&y?jsx(b$3,{size:"sm",variant:"ghost",label:y,isDisabled:o,onPress:Ie}):jsx(b$3,{size:"sm",variant:"ghost",label:P,isDisabled:true})}):null]})});Q.displayName="ImageDropZone";function Te(t){let[u,n]=useState();if(a$e(()=>{if(!t||typeof t=="string"){n(void 0);return}let i=URL.createObjectURL(t);return n(i),()=>{URL.revokeObjectURL(i);}},[t]),!!t)return typeof t=="string"?t:u}function xe(t,u){if(!u)return true;let n=u.split(",").map(s=>s.trim().toLowerCase()).filter(Boolean);if(n.length===0)return true;let i=t.type.toLowerCase(),g=t.name.toLowerCase();return n.some(s=>s==="*/*"?true:s.startsWith(".")?g.endsWith(s):i?s.endsWith("/*")?i.startsWith(s.slice(0,-1)):i===s:true)}var Ae=c$3({selectImage:{defaultMessage:"Select Image",id:"bui.imageDropZone.selectImage"}});export{Q as a};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {i}from'./chunk-
|
|
1
|
+
import {i}from'./chunk-L6S5GBKS.mjs';import {a as a$1}from'./chunk-VDUFLHKK.mjs';import {a as a$2}from'./chunk-YS3Y5KGV.mjs';import {a as a$3}from'./chunk-K6X2BHPP.mjs';import {a as a$4}from'./chunk-3FYY26ED.mjs';import {b,c,a as a$5}from'./chunk-TZ4MVY4E.mjs';import {a}from'./chunk-AUOQSTS5.mjs';import H,{useState,useEffect,useContext}from'react';/**
|
|
2
2
|
* Copyright (c) 2023-2024 PSPDFKit GmbH. All rights reserved.
|
|
3
3
|
*
|
|
4
4
|
* THIS SOURCE CODE AND ANY ACCOMPANYING DOCUMENTATION ARE PROTECTED BY INTERNATIONAL COPYRIGHT LAW
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {c as c$1,a as a$4,d,b,e}from'./chunk-
|
|
1
|
+
import {c as c$1,a as a$4,d,b as b$1,e}from'./chunk-X5Z54UUE.mjs';import {c as c$3,b as b$5}from'./chunk-UEDBY5JI.mjs';import {b as b$4}from'./chunk-NUYBQ7KP.mjs';import {a as a$8}from'./chunk-SAZLJ66W.mjs';import {a as a$5}from'./chunk-O7XK2WIX.mjs';import {b as b$2}from'./chunk-WL27JGVG.mjs';import {b as b$3}from'./chunk-N2XGJKZG.mjs';import {a as a$6}from'./chunk-XWLESSHN.mjs';import {a as a$2}from'./chunk-YS3Y5KGV.mjs';import {a}from'./chunk-K6X2BHPP.mjs';import {d as d$1}from'./chunk-BGMVPFYK.mjs';import {b as b$6}from'./chunk-YB3KW7JC.mjs';import {f as f$1}from'./chunk-Y4DRSGEJ.mjs';import {a as a$1}from'./chunk-3FYY26ED.mjs';import {p}from'./chunk-MRJFGHFW.mjs';import {c,b}from'./chunk-TZ4MVY4E.mjs';import {a as a$7}from'./chunk-KEVERVHK.mjs';import {c as c$2}from'./chunk-JDLUGVXG.mjs';import {a as a$3}from'./chunk-4QEH5CGK.mjs';import {XIcon as XIcon$1}from'@baseline-ui/icons/8';import {CheckmarkIcon as CheckmarkIcon$1,XIcon}from'@baseline-ui/icons/12';import {CheckmarkIcon}from'@baseline-ui/icons/16';import f,{useState,useRef,useEffect}from'react';import {jsx,jsxs}from'react/jsx-runtime';/**
|
|
2
2
|
* Copyright (c) 2023-2024 PSPDFKit GmbH. All rights reserved.
|
|
3
3
|
*
|
|
4
4
|
* THIS SOURCE CODE AND ANY ACCOMPANYING DOCUMENTATION ARE PROTECTED BY INTERNATIONAL COPYRIGHT LAW
|
|
@@ -7,4 +7,4 @@ import {c as c$1,a as a$4,d,b,e}from'./chunk-5ULL6IBX.mjs';import {c as c$3,b as
|
|
|
7
7
|
* This notice may not be removed from this file.
|
|
8
8
|
*
|
|
9
9
|
*/
|
|
10
|
-
var A=new WeakMap;function ve(i,e,a){let{direction:o}=b$2(),t=i.keyboardDelegate||new b$3({collection:e.collection,ref:a,orientation:"horizontal",direction:o,disabledKeys:e.disabledKeys,disabledBehavior:e.selectionManager.disabledBehavior}),{labelProps:p,fieldProps:r,descriptionProps:s,errorMessageProps:l}=a$8({...i,labelElementType:"span",ref:a}),{gridProps:c$1}=b$4({...i,...r,keyboardDelegate:t,shouldFocusWrap:true,linkBehavior:"override",keyboardNavigationBehavior:"tab"},e,a),[u,g]=useState(false),{focusWithinProps:m}=b$5({onFocusWithinChange:g}),b=a$7(i),n=useRef(e.collection.size);return useEffect(()=>{a.current&&n.current>0&&e.collection.size===0&&u&&a.current.focus(),n.current=e.collection.size;},[e.collection.size,u,a]),A.set(e,{onRemove:i.onRemove}),{gridProps:c(c$1,b,{role:e.collection.size?"grid":"group","aria-atomic":false,"aria-relevant":"additions","aria-live":u?"polite":"off",...m,...r}),labelProps:p,descriptionProps:s,errorMessageProps:l}}var ee={"ar-AE":{removeButtonLabel:"\u0625\u0632\u0627\u0644\u0629",removeDescription:"\u0627\u0636\u063A\u0637 \u0639\u0644\u0649 \u0645\u0641\u062A\u0627\u062D DELETE \u0644\u0625\u0632\u0627\u0644\u0629 \u0639\u0644\u0627\u0645\u0629."},"bg-BG":{removeButtonLabel:"\u041F\u0440\u0435\u043C\u0430\u0445\u0432\u0430\u043D\u0435",removeDescription:"\u041D\u0430\u0442\u0438\u0441\u043D\u0435\u0442\u0435 Delete, \u0437\u0430 \u0434\u0430 \u043F\u0440\u0435\u043C\u0430\u0445\u043D\u0435\u0442\u0435 \u043C\u0430\u0440\u043A\u0435\u0440\u0430."},"cs-CZ":{removeButtonLabel:"Odebrat",removeDescription:"Stisknut\xEDm kl\xE1vesy Delete odeberete zna\u010Dku."},"da-DK":{removeButtonLabel:"Fjern",removeDescription:"Tryk p\xE5 Slet for at fjerne tag."},"de-DE":{removeButtonLabel:"Entfernen",removeDescription:"Auf \u201EL\xF6schen\u201C dr\xFCcken, um das Tag zu entfernen."},"el-GR":{removeButtonLabel:"\u039A\u03B1\u03C4\u03AC\u03C1\u03B3\u03B7\u03C3\u03B7",removeDescription:"\u03A0\u03B1\u03C4\u03AE\u03C3\u03C4\u03B5 \u0394\u03B9\u03B1\u03B3\u03C1\u03B1\u03C6\u03AE \u03B3\u03B9\u03B1 \u03BD\u03B1 \u03BA\u03B1\u03C4\u03B1\u03C1\u03B3\u03AE\u03C3\u03B5\u03C4\u03B5 \u03C4\u03B7\u03BD \u03B5\u03C4\u03B9\u03BA\u03AD\u03C4\u03B1."},"en-US":{removeDescription:"Press Delete to remove tag.",removeButtonLabel:"Remove"},"es-ES":{removeButtonLabel:"Quitar",removeDescription:"Pulse Eliminar para quitar la etiqueta."},"et-EE":{removeButtonLabel:"Eemalda",removeDescription:"Sildi eemaldamiseks vajutage kustutusklahvi Delete."},"fi-FI":{removeButtonLabel:"Poista",removeDescription:"Poista tunniste painamalla Poista-painiketta."},"fr-FR":{removeButtonLabel:"Supprimer",removeDescription:"Appuyez sur Supprimer pour supprimer l\u2019\xE9tiquette."},"he-IL":{removeButtonLabel:"\u05D4\u05E1\u05E8",removeDescription:"\u05DC\u05D7\u05E5 \u05E2\u05DC \u05DE\u05D7\u05E7 \u05DB\u05D3\u05D9 \u05DC\u05D4\u05E1\u05D9\u05E8 \u05EA\u05D2."},"hr-HR":{removeButtonLabel:"Ukloni",removeDescription:"Pritisnite Delete za uklanjanje oznake."},"hu-HU":{removeButtonLabel:"Elt\xE1vol\xEDt\xE1s",removeDescription:"Nyomja meg a Delete billenty\u0171t a c\xEDmke elt\xE1vol\xEDt\xE1s\xE1hoz."},"it-IT":{removeButtonLabel:"Rimuovi",removeDescription:"Premi Elimina per rimuovere il tag."},"ja-JP":{removeButtonLabel:"\u524A\u9664",removeDescription:"\u30BF\u30B0\u3092\u524A\u9664\u3059\u308B\u306B\u306F\u3001Delete \u30AD\u30FC\u3092\u62BC\u3057\u307E\u3059\u3002"},"ko-KR":{removeButtonLabel:"\uC81C\uAC70",removeDescription:"\uD0DC\uADF8\uB97C \uC81C\uAC70\uD558\uB824\uBA74 Delete \uD0A4\uB97C \uB204\uB974\uC2ED\uC2DC\uC624."},"lt-LT":{removeButtonLabel:"Pa\u0161alinti",removeDescription:"Nor\u0117dami pa\u0161alinti \u017Eym\u0105, paspauskite \u201EDelete\u201C klavi\u0161\u0105."},"lv-LV":{removeButtonLabel:"No\u0146emt",removeDescription:"Nospiediet Delete [Dz\u0113st], lai no\u0146emtu tagu."},"nb-NO":{removeButtonLabel:"Fjern",removeDescription:"Trykk p\xE5 Slett for \xE5 fjerne taggen."},"nl-NL":{removeButtonLabel:"Verwijderen",removeDescription:"Druk op Verwijderen om de tag te verwijderen."},"pl-PL":{removeButtonLabel:"Usu\u0144",removeDescription:"Naci\u015Bnij Usu\u0144, aby usun\u0105\u0107 znacznik."},"pt-BR":{removeButtonLabel:"Remover",removeDescription:"Pressione Delete para remover a tag."},"pt-PT":{removeButtonLabel:"Eliminar",removeDescription:"Prima Delete para eliminar a tag."},"ro-RO":{removeButtonLabel:"\xCEndep\u0103rta\u0163i",removeDescription:"Ap\u0103sa\u021Bi pe Delete (\u0218tergere) pentru a elimina eticheta."},"ru-RU":{removeButtonLabel:"\u0423\u0434\u0430\u043B\u0438\u0442\u044C",removeDescription:"\u041D\u0430\u0436\u043C\u0438\u0442\u0435 DELETE, \u0447\u0442\u043E\u0431\u044B \u0443\u0434\u0430\u043B\u0438\u0442\u044C \u0442\u0435\u0433."},"sk-SK":{removeButtonLabel:"Odstr\xE1ni\u0165",removeDescription:"Ak chcete odstr\xE1ni\u0165 zna\u010Dku, stla\u010Dte kl\xE1ves Delete."},"sl-SI":{removeButtonLabel:"Odstrani",removeDescription:"Pritisnite Delete, da odstranite oznako."},"sr-SP":{removeButtonLabel:"Ukloni",removeDescription:"Pritisnite Obri\u0161i da biste uklonili oznaku."},"sv-SE":{removeButtonLabel:"Ta bort",removeDescription:"Tryck p\xE5 Radera f\xF6r att ta bort taggen."},"tr-TR":{removeButtonLabel:"Kald\u0131r",removeDescription:"Etiketi kald\u0131rmak i\xE7in Sil tu\u015Funa bas\u0131n."},"uk-UA":{removeButtonLabel:"\u0412\u0438\u043B\u0443\u0447\u0438\u0442\u0438",removeDescription:"\u041D\u0430\u0442\u0438\u0441\u043D\u0456\u0442\u044C Delete, \u0449\u043E\u0431 \u0432\u0438\u043B\u0443\u0447\u0438\u0442\u0438 \u0442\u0435\u0433."},"zh-CN":{removeButtonLabel:"\u5220\u9664",removeDescription:"\u6309\u4E0B\u201C\u5220\u9664\u201D\u4EE5\u5220\u9664\u6807\u8BB0\u3002"},"zh-TW":{removeButtonLabel:"\u79FB\u9664",removeDescription:"\u6309 Delete \u9375\u4EE5\u79FB\u9664\u6A19\u8A18\u3002"}};function E(i,e,a){let{item:o}=i,t=b$1(ee,"@react-aria/tag"),p$1=c$2(),{onRemove:r}=A.get(e)||{},{rowProps:s,gridCellProps:l,...c$1}=c$3({node:o},e,a),{descriptionProps:u,...g}=c$1,m=e.disabledKeys.has(o.key)||o.props.isDisabled,b=R=>{if(R.key==="Delete"||R.key==="Backspace"){if(m)return;R.preventDefault(),e.selectionManager.isSelected(o.key)?r?.(new Set(e.selectionManager.selectedKeys)):r?.(new Set([o.key]));}},n=f$1();n==="virtual"&&typeof window<"u"&&"ontouchstart"in window&&(n="pointer");let T=r&&(n==="keyboard"||n==="virtual")?t.format("removeDescription"):"",P=a$6(T,a),D=o.key===e.selectionManager.focusedKey,L=e.selectionManager.focusedKey!=null,y=-1;!m&&(D||!L)&&(y=0);let k=a$7(o.props),B=p(o.props),{focusableProps:h}=d$1({...o.props,isDisabled:m},a);return {removeButtonProps:{"aria-label":t.format("removeButtonLabel"),"aria-labelledby":`${p$1} ${s.id}`,isDisabled:m,id:p$1,onPress:()=>r?r(new Set([o.key])):null},rowProps:c(h,s,k,B,{tabIndex:y,onKeyDown:r?b:void 0,"aria-describedby":P["aria-describedby"]}),gridCellProps:c(l,{"aria-errormessage":i["aria-errormessage"],"aria-label":i["aria-label"]}),...g,allowsRemoving:!!r}}var te=f.createContext(null),re=f.createContext(null);var ae=f.forwardRef((i,e)=>{let a=f.useContext(te),o=f.useContext(re);return a&&o?jsx(se,{...i,ref:e,groupCtx:a,itemCtx:o}):jsx(ie,{...i,ref:e})});ae.displayName="Tag";var ie=f.forwardRef(({children:i,variant:e="neutral",size:a$2="md",icon:o,isDisabled:t=false,isSelected:p=false,onRemove:r,className:s,style:l,"data-block-id":c$1,"data-block-class":u},g)=>{let{focusProps:m,isFocusVisible:b}=a({within:true}),{hoverProps:n,isHovered:T}=a$1({isDisabled:t}),{hoverProps:P,isHovered:D}=a$1({isDisabled:t}),L=!!r;return jsx(w,{ref:g,outerProps:c(m,P),variant:e,size:a$2,Icon:o,isDisabled:t,isSelected:p,isFocusVisible:b,isTagHovered:D,allowsRemoving:L,allowsSelection:false,removeButtonProps:n,defaultRemoveProps:{"aria-label":"Remove",disabled:t,onClick:r},isRemoveHovered:T,className:s,style:l,"data-block-id":c$1,"data-block-class":u,children:i})});ie.displayName="TagStandalone";var se=f.forwardRef(({groupCtx:i,itemCtx:e,variant:a$3,...o},t)=>{let{state:p,variant:r,size:s}=i,{item:l}=e,c$1=f.useRef(null),{rowProps:u,gridCellProps:g,removeButtonProps:m,allowsRemoving:b,isDisabled:n,isSelected:T,allowsSelection:P}=E({item:l},p,c$1),D=f.useRef(null),{buttonProps:L}=a$2({...m,excludeFromTabOrder:true},D),{focusProps:y,isFocusVisible:k}=a({within:true}),{hoverProps:B,isHovered:h}=a$1({isDisabled:n}),{hoverProps:R,isHovered:ne}=a$1({isDisabled:n}),le=l.value?.icon,me=l.value?.data?.variant??a$3??r,pe=o.size??s??"md";return jsx(w,{ref:H=>{c$1.current=H,typeof t=="function"?t(H):t&&(t.current=H);},outerProps:c(u,y,R),gridCellProps:g,variant:me,size:pe,Icon:le,isDisabled:n,isSelected:T,isFocusVisible:k,isTagHovered:ne,allowsRemoving:b,allowsSelection:P,removeButtonProps:c(L,B),isRemoveHovered:h,children:l.rendered})});se.displayName="TagInGroup";var w=f.forwardRef(({children:i,outerProps:e$1,gridCellProps:a,variant:o="neutral",size:t,Icon:p,isDisabled:r,isSelected:s,isFocusVisible:l,isTagHovered:c$2,allowsRemoving:u,allowsSelection:g,removeButtonProps:m,defaultRemoveProps:b$1,isRemoveHovered:n,className:T,style:P,"data-block-id":D,"data-block-class":L},y)=>{let k=t==="md"?XIcon:XIcon$1,B=t==="md"?CheckmarkIcon:CheckmarkIcon$1;return jsx("div",{...e$1,ref:y,"aria-disabled":r||void 0,className:a$3(b({isFocusVisible:l,variant:o,isDisabled:r,allowsRemoving:u,isSelected:s,allowsSelection:g,isHovered:c$2,size:t}),e({variant:o,isDisabled:r,isSelected:s}),"BaselineUI-Tag",T),style:P,"data-block-id":D,"data-block-class":L,children:jsxs("div",{...a,className:c$1,children:[s?jsx(B,{size:t==="md"?16:12,className:a$3(a$4({variant:o,isDisabled:r,isSelected:s}),"BaselineUI-Tag-Icon")}):null,!s&&p?jsx(p,{size:t==="md"?16:12,className:a$3(a$4({variant:o,isDisabled:r,isSelected:s}),"BaselineUI-Tag-Icon")}):null,jsx(a$5,{paddingY:t==="md"?"sm":"none",typography:t==="sm"?"label.sm.medium":"label.md.medium",children:i}),u?jsx("button",{type:"button",...c(m,b$1??{}),className:d({variant:o,isHovered:n}),children:jsx(k,{size:t==="md"?12:8})}):null]})})});w.displayName="TagView";export{ve as a,te as b,re as c,ae as d};
|
|
10
|
+
var I=new WeakMap;function ve(i,e,a){let{direction:o}=b$3(),r=i.keyboardDelegate||new b$4({collection:e.collection,ref:a,orientation:"horizontal",direction:o,disabledKeys:e.disabledKeys,disabledBehavior:e.selectionManager.disabledBehavior}),{labelProps:p,fieldProps:t,descriptionProps:s,errorMessageProps:l}=a$8({...i,labelElementType:"span",ref:a}),{gridProps:c$1}=b$5({...i,...t,keyboardDelegate:r,shouldFocusWrap:true,linkBehavior:"override",keyboardNavigationBehavior:"tab"},e,a),[u,g]=useState(false),{focusWithinProps:m}=b$6({onFocusWithinChange:g}),b=a$7(i),n=useRef(e.collection.size);return useEffect(()=>{a.current&&n.current>0&&e.collection.size===0&&u&&a.current.focus(),n.current=e.collection.size;},[e.collection.size,u,a]),I.set(e,{onRemove:i.onRemove}),{gridProps:c(c$1,b,{role:e.collection.size?"grid":"group","aria-atomic":false,"aria-relevant":"additions","aria-live":u?"polite":"off",...m,...t}),labelProps:p,descriptionProps:s,errorMessageProps:l}}var ee={"ar-AE":{removeButtonLabel:"\u0625\u0632\u0627\u0644\u0629",removeDescription:"\u0627\u0636\u063A\u0637 \u0639\u0644\u0649 \u0645\u0641\u062A\u0627\u062D DELETE \u0644\u0625\u0632\u0627\u0644\u0629 \u0639\u0644\u0627\u0645\u0629."},"bg-BG":{removeButtonLabel:"\u041F\u0440\u0435\u043C\u0430\u0445\u0432\u0430\u043D\u0435",removeDescription:"\u041D\u0430\u0442\u0438\u0441\u043D\u0435\u0442\u0435 Delete, \u0437\u0430 \u0434\u0430 \u043F\u0440\u0435\u043C\u0430\u0445\u043D\u0435\u0442\u0435 \u043C\u0430\u0440\u043A\u0435\u0440\u0430."},"cs-CZ":{removeButtonLabel:"Odebrat",removeDescription:"Stisknut\xEDm kl\xE1vesy Delete odeberete zna\u010Dku."},"da-DK":{removeButtonLabel:"Fjern",removeDescription:"Tryk p\xE5 Slet for at fjerne tag."},"de-DE":{removeButtonLabel:"Entfernen",removeDescription:"Auf \u201EL\xF6schen\u201C dr\xFCcken, um das Tag zu entfernen."},"el-GR":{removeButtonLabel:"\u039A\u03B1\u03C4\u03AC\u03C1\u03B3\u03B7\u03C3\u03B7",removeDescription:"\u03A0\u03B1\u03C4\u03AE\u03C3\u03C4\u03B5 \u0394\u03B9\u03B1\u03B3\u03C1\u03B1\u03C6\u03AE \u03B3\u03B9\u03B1 \u03BD\u03B1 \u03BA\u03B1\u03C4\u03B1\u03C1\u03B3\u03AE\u03C3\u03B5\u03C4\u03B5 \u03C4\u03B7\u03BD \u03B5\u03C4\u03B9\u03BA\u03AD\u03C4\u03B1."},"en-US":{removeDescription:"Press Delete to remove tag.",removeButtonLabel:"Remove"},"es-ES":{removeButtonLabel:"Quitar",removeDescription:"Pulse Eliminar para quitar la etiqueta."},"et-EE":{removeButtonLabel:"Eemalda",removeDescription:"Sildi eemaldamiseks vajutage kustutusklahvi Delete."},"fi-FI":{removeButtonLabel:"Poista",removeDescription:"Poista tunniste painamalla Poista-painiketta."},"fr-FR":{removeButtonLabel:"Supprimer",removeDescription:"Appuyez sur Supprimer pour supprimer l\u2019\xE9tiquette."},"he-IL":{removeButtonLabel:"\u05D4\u05E1\u05E8",removeDescription:"\u05DC\u05D7\u05E5 \u05E2\u05DC \u05DE\u05D7\u05E7 \u05DB\u05D3\u05D9 \u05DC\u05D4\u05E1\u05D9\u05E8 \u05EA\u05D2."},"hr-HR":{removeButtonLabel:"Ukloni",removeDescription:"Pritisnite Delete za uklanjanje oznake."},"hu-HU":{removeButtonLabel:"Elt\xE1vol\xEDt\xE1s",removeDescription:"Nyomja meg a Delete billenty\u0171t a c\xEDmke elt\xE1vol\xEDt\xE1s\xE1hoz."},"it-IT":{removeButtonLabel:"Rimuovi",removeDescription:"Premi Elimina per rimuovere il tag."},"ja-JP":{removeButtonLabel:"\u524A\u9664",removeDescription:"\u30BF\u30B0\u3092\u524A\u9664\u3059\u308B\u306B\u306F\u3001Delete \u30AD\u30FC\u3092\u62BC\u3057\u307E\u3059\u3002"},"ko-KR":{removeButtonLabel:"\uC81C\uAC70",removeDescription:"\uD0DC\uADF8\uB97C \uC81C\uAC70\uD558\uB824\uBA74 Delete \uD0A4\uB97C \uB204\uB974\uC2ED\uC2DC\uC624."},"lt-LT":{removeButtonLabel:"Pa\u0161alinti",removeDescription:"Nor\u0117dami pa\u0161alinti \u017Eym\u0105, paspauskite \u201EDelete\u201C klavi\u0161\u0105."},"lv-LV":{removeButtonLabel:"No\u0146emt",removeDescription:"Nospiediet Delete [Dz\u0113st], lai no\u0146emtu tagu."},"nb-NO":{removeButtonLabel:"Fjern",removeDescription:"Trykk p\xE5 Slett for \xE5 fjerne taggen."},"nl-NL":{removeButtonLabel:"Verwijderen",removeDescription:"Druk op Verwijderen om de tag te verwijderen."},"pl-PL":{removeButtonLabel:"Usu\u0144",removeDescription:"Naci\u015Bnij Usu\u0144, aby usun\u0105\u0107 znacznik."},"pt-BR":{removeButtonLabel:"Remover",removeDescription:"Pressione Delete para remover a tag."},"pt-PT":{removeButtonLabel:"Eliminar",removeDescription:"Prima Delete para eliminar a tag."},"ro-RO":{removeButtonLabel:"\xCEndep\u0103rta\u0163i",removeDescription:"Ap\u0103sa\u021Bi pe Delete (\u0218tergere) pentru a elimina eticheta."},"ru-RU":{removeButtonLabel:"\u0423\u0434\u0430\u043B\u0438\u0442\u044C",removeDescription:"\u041D\u0430\u0436\u043C\u0438\u0442\u0435 DELETE, \u0447\u0442\u043E\u0431\u044B \u0443\u0434\u0430\u043B\u0438\u0442\u044C \u0442\u0435\u0433."},"sk-SK":{removeButtonLabel:"Odstr\xE1ni\u0165",removeDescription:"Ak chcete odstr\xE1ni\u0165 zna\u010Dku, stla\u010Dte kl\xE1ves Delete."},"sl-SI":{removeButtonLabel:"Odstrani",removeDescription:"Pritisnite Delete, da odstranite oznako."},"sr-SP":{removeButtonLabel:"Ukloni",removeDescription:"Pritisnite Obri\u0161i da biste uklonili oznaku."},"sv-SE":{removeButtonLabel:"Ta bort",removeDescription:"Tryck p\xE5 Radera f\xF6r att ta bort taggen."},"tr-TR":{removeButtonLabel:"Kald\u0131r",removeDescription:"Etiketi kald\u0131rmak i\xE7in Sil tu\u015Funa bas\u0131n."},"uk-UA":{removeButtonLabel:"\u0412\u0438\u043B\u0443\u0447\u0438\u0442\u0438",removeDescription:"\u041D\u0430\u0442\u0438\u0441\u043D\u0456\u0442\u044C Delete, \u0449\u043E\u0431 \u0432\u0438\u043B\u0443\u0447\u0438\u0442\u0438 \u0442\u0435\u0433."},"zh-CN":{removeButtonLabel:"\u5220\u9664",removeDescription:"\u6309\u4E0B\u201C\u5220\u9664\u201D\u4EE5\u5220\u9664\u6807\u8BB0\u3002"},"zh-TW":{removeButtonLabel:"\u79FB\u9664",removeDescription:"\u6309 Delete \u9375\u4EE5\u79FB\u9664\u6A19\u8A18\u3002"}};function A(i,e,a){let{item:o}=i,r=b$2(ee,"@react-aria/tag"),p$1=c$2(),{onRemove:t}=I.get(e)||{},{rowProps:s,gridCellProps:l,...c$1}=c$3({node:o},e,a),{descriptionProps:u,...g}=c$1,m=e.disabledKeys.has(o.key)||o.props.isDisabled,b=R=>{if(R.key==="Delete"||R.key==="Backspace"){if(m)return;R.preventDefault(),e.selectionManager.isSelected(o.key)?t?.(new Set(e.selectionManager.selectedKeys)):t?.(new Set([o.key]));}},n=f$1();n==="virtual"&&typeof window<"u"&&"ontouchstart"in window&&(n="pointer");let T=t&&(n==="keyboard"||n==="virtual")?r.format("removeDescription"):"",P=a$6(T,a),D=o.key===e.selectionManager.focusedKey,L=e.selectionManager.focusedKey!=null,y=-1;!m&&(D||!L)&&(y=0);let k=a$7(o.props),B=p(o.props),{focusableProps:h}=d$1({...o.props,isDisabled:m},a);return {removeButtonProps:{"aria-label":r.format("removeButtonLabel"),"aria-labelledby":`${p$1} ${s.id}`,isDisabled:m,id:p$1,onPress:()=>t?t(new Set([o.key])):null},rowProps:c(h,s,k,B,{tabIndex:y,onKeyDown:t?b:void 0,"aria-describedby":P["aria-describedby"]}),gridCellProps:c(l,{"aria-errormessage":i["aria-errormessage"],"aria-label":i["aria-label"]}),...g,allowsRemoving:!!t}}var te=f.createContext(null),re=f.createContext(null);var ae=f.forwardRef((i,e)=>{let a=f.useContext(te),o=f.useContext(re);return a&&o?jsx(se,{...i,ref:e,groupCtx:a,itemCtx:o}):jsx(ie,{...i,ref:e})});ae.displayName="Tag";var ie=f.forwardRef(({children:i,variant:e="neutral",size:a$2="md",icon:o,isDisabled:r=false,isSelected:p=false,onRemove:t,className:s,style:l,"data-block-id":c$1,"data-block-class":u},g)=>{let{focusProps:m,isFocusVisible:b}=a({within:true}),{hoverProps:n,isHovered:T}=a$1({isDisabled:r}),{hoverProps:P,isHovered:D}=a$1({isDisabled:r}),L=!!t;return jsx(w,{ref:g,outerProps:c(m,P),variant:e,size:a$2,Icon:o,isDisabled:r,isSelected:p,isFocusVisible:b,isTagHovered:D,allowsRemoving:L,allowsSelection:false,removeButtonProps:n,defaultRemoveProps:{"aria-label":"Remove",disabled:r,onClick:t},isRemoveHovered:T,className:s,style:l,"data-block-id":c$1,"data-block-class":u,children:i})});ie.displayName="TagStandalone";var se=f.forwardRef(({groupCtx:i,itemCtx:e,variant:a$3,...o},r)=>{let{state:p,variant:t,size:s}=i,{item:l}=e,c$1=f.useRef(null),{rowProps:u,gridCellProps:g,removeButtonProps:m,allowsRemoving:b$1,isDisabled:n,isSelected:T,allowsSelection:P}=A({item:l},p,c$1),D=f.useRef(null),{buttonProps:L}=a$2({...m,excludeFromTabOrder:true},D),{focusProps:y,isFocusVisible:k}=a({within:true}),{hoverProps:B,isHovered:h}=a$1({isDisabled:n}),{hoverProps:R,isHovered:ne}=a$1({isDisabled:n}),le=l.value?.icon,me=l.value?.data?.variant??a$3??t,pe=o.size??s??"md";return jsx(w,{ref:b(c$1,r),outerProps:c(u,y,R),gridCellProps:g,variant:me,size:pe,Icon:le,isDisabled:n,isSelected:T,isFocusVisible:k,isTagHovered:ne,allowsRemoving:b$1,allowsSelection:P,removeButtonProps:c(L,B),isRemoveHovered:h,children:l.rendered})});se.displayName="TagInGroup";var w=f.forwardRef(({children:i,outerProps:e$1,gridCellProps:a,variant:o="neutral",size:r,Icon:p,isDisabled:t,isSelected:s,isFocusVisible:l,isTagHovered:c$2,allowsRemoving:u,allowsSelection:g,removeButtonProps:m,defaultRemoveProps:b,isRemoveHovered:n,className:T,style:P,"data-block-id":D,"data-block-class":L},y)=>{let k=r==="md"?XIcon:XIcon$1,B=r==="md"?CheckmarkIcon:CheckmarkIcon$1;return jsx("div",{...e$1,ref:y,"aria-disabled":t||void 0,className:a$3(b$1({isFocusVisible:l,variant:o,isDisabled:t,allowsRemoving:u,isSelected:s,allowsSelection:g,isHovered:c$2,size:r}),e({variant:o,isDisabled:t,isSelected:s}),"BaselineUI-Tag",T),style:P,"data-block-id":D,"data-block-class":L,children:jsxs("div",{...a,className:c$1,children:[s?jsx(B,{size:r==="md"?16:12,className:a$3(a$4({variant:o,isDisabled:t,isSelected:s}),"BaselineUI-Tag-Icon")}):null,!s&&p?jsx(p,{size:r==="md"?16:12,className:a$3(a$4({variant:o,isDisabled:t,isSelected:s}),"BaselineUI-Tag-Icon")}):null,jsx(a$5,{paddingY:r==="md"?"sm":"none",typography:r==="sm"?"label.sm.medium":"label.md.medium",children:i}),u?jsx("button",{type:"button",...c(m,b??{}),className:d({variant:o,isHovered:n}),children:jsx(k,{size:r==="md"?12:8})}):null]})})});w.displayName="TagView";export{ve as a,te as b,re as c,ae as d};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import {a}from'./chunk-MHUFXHRU.mjs';import {a as a$3}from'./chunk-MONDDKB4.mjs';import {a as a$2}from'./chunk-NADBGP35.mjs';import {b,c}from'./chunk-GX2IOGYR.mjs';import {b as b$1}from'./chunk-4ZJMZB5B.mjs';import {a as a$1}from'./chunk-RSKKEGJZ.mjs';import {a as a$4}from'./chunk-4QEH5CGK.mjs';import {PauseIcon,PlayIcon}from'@baseline-ui/icons/24';import _ from'react';import {jsxs,jsx}from'react/jsx-runtime';/**
|
|
2
|
+
* Copyright (c) 2023-2024 PSPDFKit GmbH. All rights reserved.
|
|
3
|
+
*
|
|
4
|
+
* THIS SOURCE CODE AND ANY ACCOMPANYING DOCUMENTATION ARE PROTECTED BY INTERNATIONAL COPYRIGHT LAW
|
|
5
|
+
* AND MAY NOT BE RESOLD OR REDISTRIBUTED. USAGE IS BOUND TO THE PSPDFKIT LICENSE AGREEMENT.
|
|
6
|
+
* UNAUTHORIZED REPRODUCTION OR DISTRIBUTION IS SUBJECT TO CIVIL AND CRIMINAL PENALTIES.
|
|
7
|
+
* This notice may not be removed from this file.
|
|
8
|
+
*
|
|
9
|
+
*/
|
|
10
|
+
var g="_1yep5z6j8 _1yep5z6j9 _1yep5z6ja _1yep5z6jh _1yep5z6ji _1yep5z6jj _1yep5z6jz _1yep5z6k0 _1yep5z6k1 _1yep5z69o _1yep5z69p _1yep5z69q",z="rta2n91 _1yep5z6j8 _1yep5z6j9 _1yep5z6ja _1yep5z6jh _1yep5z6ji _1yep5z6jj _1yep5z6jz _1yep5z6k0 _1yep5z6k1 _1yep5z69o _1yep5z69p _1yep5z69q _1yep5z610h _1yep5z6w1 _1yep5z6w2 _1yep5z6w3 _1yep5z618m _1yep5z611i",f="rta2n90";var P=_.forwardRef(({className:h,style:k,size:v="lg",sources:j,playLabel:T,pauseLabel:I,audioTimelineLabel:x,playingLabel:A,pausedLabel:C,"data-block-id":S,"data-block-class":B,...M},w)=>{let t=_.useRef(null),{isPlaying:r,progress:U,duration:H,togglePlay:N,seek:R,formattedDuration:V,formattedCurrentTime:D,setProgress:E,setIsSliderDragging:s}=a(t,{playingLabel:A,pausedLabel:C}),{formatMessage:o}=b(),q=a$1({"data-block-id":S,"data-block-class":B,"data-state":r?"playing":"paused","data-loaded":H>0});return jsxs("div",{...q,...M,className:a$4(g,"BaselineUI-AudioPlayer",h),role:"group",style:k,ref:w,children:[jsx(b$1,{children:jsx("audio",{ref:t,children:j.map(({url:a,type:L})=>jsx("source",{src:a,type:L},a))})}),jsx(a$2,{icon:r?PauseIcon:PlayIcon,variant:"toolbar",isSelected:r,size:v,"aria-label":r?I??o(i.pause):T??o(i.play),style:{borderRadius:"50%"},onPress:N}),jsxs("div",{className:z,children:[jsx("span",{"aria-hidden":true,children:D}),jsx(a$3,{"aria-label":x??o(i.audioTimeline),value:U,minValue:0,maxValue:100,className:f,onChange:a=>{E(a),s(true);},onChangeEnd:a=>{R(a),s(false);}}),jsx("span",{"aria-hidden":true,children:V})]})]})});P.displayName="AudioPlayer";var i=c({play:{id:"bui.audioPlayer.play",defaultMessage:"Play"},pause:{id:"bui.audioPlayer.pause",defaultMessage:"Pause"},audioTimeline:{id:"bui.audioPlayer.audioTimeline",defaultMessage:"Audio timeline"}});export{P as a};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {b as b$1}from'./chunk-Q5UMLFN3.mjs';import {a as a$9}from'./chunk-
|
|
1
|
+
import {b as b$1}from'./chunk-Q5UMLFN3.mjs';import {a as a$9}from'./chunk-2V323KAD.mjs';import {a as a$4,b as b$2}from'./chunk-KUEDQO7P.mjs';import {a as a$5}from'./chunk-66CUIXA6.mjs';import {a as a$6}from'./chunk-YS3Y5KGV.mjs';import {a as a$7}from'./chunk-K6X2BHPP.mjs';import {a as a$1}from'./chunk-BGMVPFYK.mjs';import {a as a$8}from'./chunk-3FYY26ED.mjs';import {d}from'./chunk-AQYBKDT2.mjs';import {c}from'./chunk-TZ4MVY4E.mjs';import {c as c$1}from'./chunk-JDLUGVXG.mjs';import {f,a as a$2}from'./chunk-AUOQSTS5.mjs';import {a}from'./chunk-JQQGRJ5J.mjs';import {a as a$3}from'./chunk-4QEH5CGK.mjs';import b,{useContext,useEffect,useMemo}from'react';import {jsx,jsxs,Fragment}from'react/jsx-runtime';import {AnimatePresence,motion}from'motion/react';import {ChevronRightIcon}from'@baseline-ui/icons/8';/**
|
|
2
2
|
* Copyright (c) 2023-2024 PSPDFKit GmbH. All rights reserved.
|
|
3
3
|
*
|
|
4
4
|
* THIS SOURCE CODE AND ANY ACCOMPANYING DOCUMENTATION ARE PROTECTED BY INTERNATIONAL COPYRIGHT LAW
|
|
@@ -7,4 +7,4 @@ import {b as b$1}from'./chunk-Q5UMLFN3.mjs';import {a as a$9}from'./chunk-JB3O4A
|
|
|
7
7
|
* This notice may not be removed from this file.
|
|
8
8
|
*
|
|
9
9
|
*/
|
|
10
|
-
var J="
|
|
10
|
+
var J="_1yep5z6m3",U=a({defaultClassName:"_1kvz17db _1yep5z6lq _1yep5z6ls",variantClassNames:{showActionsOnTriggerOnly:{true:"_1kvz17dc"},isTriggered:{true:"_1kvz17dd"}},defaultVariants:{},compoundVariants:[]}),X=a({defaultClassName:"_1kvz17d0 _1yep5z64u _1yep5z64v _1yep5z64w _1yep5z676 _1yep5z677 _1yep5z678 _1yep5z68c _1yep5z68d _1yep5z68e _1yep5z660 _1yep5z661 _1yep5z662 _1yep5z6lq _1yep5z6lr",variantClassNames:{isExpanded:{true:"_1kvz17d1"}},defaultVariants:{},compoundVariants:[]}),G="_1kvz17de",Q="_1yep5z6ez _1yep5z6dy",W=a({defaultClassName:"_1kvz17d2 _1yep5z63o _1yep5z63p _1yep5z63q _1yep5z61f _1yep5z61g _1yep5z61h _1yep5z63 _1yep5z64 _1yep5z65 _1yep5z62f _1yep5z62g _1yep5z62h _1yep5z6j8 _1yep5z6j9 _1yep5z6ja _1yep5z6jz _1yep5z6k0 _1yep5z6k1 _1yep5z6kz _1yep5z6l0 _1yep5z6l1 _1yep5z6lq _1yep5z6lt",variantClassNames:{isFocusVisible:{true:"_1kvz17d3"},isHovered:{true:"_1yep5z6ga",false:"_1yep5z6gb"},isDisabled:{true:"z9nup82"}},defaultVariants:{},compoundVariants:[]}),Y="_1kvz17da _1yep5z66 _1yep5z67 _1yep5z68 _1yep5z62i _1yep5z62j _1yep5z62k _1yep5z6dz",Z=a({defaultClassName:"_1kvz17d7 _1yep5z6j8 _1yep5z6j9 _1yep5z6ja _1yep5z6jz _1yep5z6k0 _1yep5z6k1",variantClassNames:{isDisabled:{true:"_1yep5z6f2",false:"_1yep5z6ey"}},defaultVariants:{},compoundVariants:[]});var H=b.forwardRef(({children:f$1,className:p,style:z},e)=>{let{headers:r}=useContext(u),{disabledKeys:a}=useContext(u),{keyboardProps:y}=a$1({onKeyDown:t=>{let d=f(a$2(t.target)),s=[...r?.keys()||[]].findIndex(n=>{let o=r?.get(n)?.current;return o?o===d:false}),m=r?.get(s||0),i=r?.size||0,c=n=>{let o=r.get(n-1<0?i-1:n-1);a?.has(o?.current?.dataset.key||"")?c(n-1):o?.current?.focus();},l=n=>{let o=r.get((n+1)%i);a?.has(o?.current?.dataset.key||"")?l(n+1):o?.current?.focus();};if(m)switch(t.key){case "Home":{t.preventDefault(),l(-1);break}case "End":{t.preventDefault(),c(i);break}case "ArrowDown":{t.preventDefault(),l(s);break}case "ArrowUp":{t.preventDefault(),c(s);break}default:t.continuePropagation();}}});return jsx("div",{...b$1(y),style:z,className:a$3(J,p),ref:e,children:b.Children.map(f$1,(t,d)=>b.cloneElement(t,{index:d}))})});H.displayName="AccordionBase";var u=b.createContext({expandedKeys:new Set,setExpandedKeys:()=>{},disabledKeys:new Set,headers:new Map,expansionMode:"multiple"}),oe=b.forwardRef(({children:f,disabledKeys:p,defaultExpandedKeys:z=new Set,expandedKeys:e,expansionMode:r="multiple",onChange:a,className:y,style:t},d)=>{let[s,m]=b.useState(z),i=b.useRef(new Map).current,[c,l]=b.useState(r);useEffect(()=>{l(r);},[r]),useEffect(()=>{a?.(s);},[s,a]);let n=useMemo(()=>({expandedKeys:e||s,setExpandedKeys:e?()=>{}:m,disabledKeys:p,headers:i,expansionMode:c}),[e,s,p,i,c]);return jsx(u.Provider,{value:n,children:jsx(a$4,{children:jsx(H,{className:y,style:t,ref:d,children:f})})})});oe.displayName="Accordion";var K=b.forwardRef(({title:f,actions:p,controlId:z,value:e,id:r,index:a,subLabel:y,showActionsOnTriggerOnly:t},d$1)=>{let s=b.useRef(null),{expandedKeys:m,setExpandedKeys:i,expansionMode:c$1,disabledKeys:l,headers:n}=useContext(u),o=l?.has(e),S=b$2();a$5(S);let{focusNext:ne,focusPrevious:ae}=S,{keyboardProps:ie}=a$1({onKeyDown:_=>{_.key==="ArrowRight"?ne({wrap:true}):_.key==="ArrowLeft"?ae({wrap:true}):_.continuePropagation();},isDisabled:o});useEffect(()=>{a$5(typeof a=="number","AccordionItem must have an index"),n?.set(a,s);},[a,n]);let M=()=>{i(_=>{let v=new Set(_);return v.has(e)?v.delete(e):(c$1==="single"&&v.clear(),v.add(e)),v});},{buttonProps:ce}=a$6({"aria-expanded":m.has(e),"aria-controls":z,onPress:M,isDisabled:o},s),{pressProps:pe}=d({onPress:M,isDisabled:o}),{focusProps:de,isFocusVisible:me}=a$7(),{hoverProps:le,isHovered:I}=a$8({isDisabled:o}),{focusProps:ye,isFocusVisible:ue}=a$7({within:true}),fe=m.has(e);return jsxs("h3",{...c(ie,pe,le,ye),className:W({isFocusVisible:me,isHovered:I,isDisabled:o}),ref:d$1,children:[jsxs("div",{className:Z({isDisabled:!!o}),children:[jsx(ChevronRightIcon,{className:X({isExpanded:fe}),size:8}),jsx("button",{...c(ce,de),id:r,"data-key":e,className:Y,ref:s,children:f})]}),p?.length?jsx("div",{"data-testid":"action-buttons",className:U({showActionsOnTriggerOnly:t,isTriggered:ue||I}),children:p.map((_,v)=>jsx(a$9,{variant:"secondary",size:"sm",excludeFromTabOrder:true,isDisabled:o,..._},v))}):null,y?jsx("div",{className:Q,children:y}):null]})});K.displayName="AccordionHeader";var se=b.forwardRef(({title:f,actions:p,children:z,value:e,index:r,subLabel:a,style:y,className:t,showActionsOnTriggerOnly:d},s)=>{let m=c$1(),i=c$1(),{expandedKeys:c}=useContext(u),l=c.has(e);return jsxs(Fragment,{children:[jsx(a$4,{children:jsx(K,{value:e,actions:p,id:i,title:f,controlId:m,ref:s,index:r,subLabel:a,showActionsOnTriggerOnly:d})}),jsx(AnimatePresence,{initial:false,children:l?jsx(motion.section,{role:"region","aria-labelledby":i,id:m,className:G,variants:{open:{height:"auto",opacity:1},closed:{height:0,opacity:0}},initial:"closed",animate:"open",exit:"closed",children:jsx("div",{style:y,className:t,children:z})}):null})]})});se.displayName="AccordionItem";export{oe as a,se as b};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import {a as a$1}from'./chunk-JQQGRJ5J.mjs';/**
|
|
2
|
+
* Copyright (c) 2023-2024 PSPDFKit GmbH. All rights reserved.
|
|
3
|
+
*
|
|
4
|
+
* THIS SOURCE CODE AND ANY ACCOMPANYING DOCUMENTATION ARE PROTECTED BY INTERNATIONAL COPYRIGHT LAW
|
|
5
|
+
* AND MAY NOT BE RESOLD OR REDISTRIBUTED. USAGE IS BOUND TO THE PSPDFKIT LICENSE AGREEMENT.
|
|
6
|
+
* UNAUTHORIZED REPRODUCTION OR DISTRIBUTION IS SUBJECT TO CIVIL AND CRIMINAL PENALTIES.
|
|
7
|
+
* This notice may not be removed from this file.
|
|
8
|
+
*
|
|
9
|
+
*/
|
|
10
|
+
var t="uf19bsf _1yep5z6lq",a=a$1({defaultClassName:"uf19bs0 _1yep5z6ai _1yep5z6aj _1yep5z6ak _1yep5z6b6 _1yep5z6b7 _1yep5z6b8 _1yep5z6bu _1yep5z6bv _1yep5z6bw _1yep5z6ci _1yep5z6cj _1yep5z6ck _1yep5z6f9 _1yep5z6m5 _1yep5z6jb _1yep5z6jc _1yep5z6jd _1yep5z6jz _1yep5z6k0 _1yep5z6k1 _1yep5z6kt _1yep5z6ku _1yep5z6kv _1yep5z6m0 z9nup8a",variantClassNames:{size:{xxs:"uf19bs1",xs:"uf19bs2",sm:"uf19bs3",md:"uf19bs4",lg:"uf19bs5 _1yep5z6x4 _1yep5z6x5 _1yep5z6x6 _1yep5z6xs _1yep5z6xt _1yep5z6xu _1yep5z6yg _1yep5z6yh _1yep5z6yi _1yep5z6z4 _1yep5z6z5 _1yep5z6z6"},isHovered:{true:"uf19bs6"},isDisabled:{true:"uf19bs7 _1yep5z611u"},isFocusVisible:{true:"uf19bs8"},variant:{primary:"uf19bs9",secondary:"uf19bsa",tertiary:"uf19bsb",ghost:"uf19bsc",toolbar:"uf19bsd _1yep5z6xm _1yep5z6xn _1yep5z6xo _1yep5z6ya _1yep5z6yb _1yep5z6yc _1yep5z6yy _1yep5z6yz _1yep5z6z0 _1yep5z6zm _1yep5z6zn _1yep5z6zo",popover:"uf19bse _1yep5z6q7 _1yep5z6q8 _1yep5z6q9 _1yep5z6nv _1yep5z6nw _1yep5z6nx _1yep5z6mm _1yep5z6mn _1yep5z6mo _1yep5z6oy _1yep5z6oz _1yep5z6p0 _1yep5z6w7 _1yep5z6w8 _1yep5z6w9"}},defaultVariants:{},compoundVariants:[[{variant:"toolbar",isHovered:true,isFocusVisible:false},"_1yep5z61pd"],[{variant:"primary",isHovered:true,isFocusVisible:false},"_1yep5z61pd"],[{variant:"secondary",isHovered:true,isFocusVisible:false},"_1yep5z61oc"],[{variant:"tertiary",isHovered:true,isFocusVisible:false},"_1yep5z61ob _1yep5z61pd"],[{variant:"ghost",isHovered:true,isFocusVisible:false},"_1yep5z61oh"],[{variant:"popover",isHovered:true,isFocusVisible:false},"_1yep5z61ri _1yep5z61v9 _1yep5z61vd _1yep5z61va"],[{variant:"ghost",isDisabled:false},"_1yep5z61og"],[{variant:"popover",size:"lg"},"_1yep5z61jk _1yep5z61jl _1yep5z61jm _1yep5z61k8 _1yep5z61k9 _1yep5z61ka _1yep5z61kw _1yep5z61kx _1yep5z61ky _1yep5z61lk _1yep5z61ll _1yep5z61lm"]]});export{t as a,a as b};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import {a}from'./chunk-JQQGRJ5J.mjs';/**
|
|
2
|
+
* Copyright (c) 2023-2024 PSPDFKit GmbH. All rights reserved.
|
|
3
|
+
*
|
|
4
|
+
* THIS SOURCE CODE AND ANY ACCOMPANYING DOCUMENTATION ARE PROTECTED BY INTERNATIONAL COPYRIGHT LAW
|
|
5
|
+
* AND MAY NOT BE RESOLD OR REDISTRIBUTED. USAGE IS BOUND TO THE PSPDFKIT LICENSE AGREEMENT.
|
|
6
|
+
* UNAUTHORIZED REPRODUCTION OR DISTRIBUTION IS SUBJECT TO CIVIL AND CRIMINAL PENALTIES.
|
|
7
|
+
* This notice may not be removed from this file.
|
|
8
|
+
*
|
|
9
|
+
*/
|
|
10
|
+
var _=a({defaultClassName:"_16vugd0b _1yep5z6ez _1yep5z6dy",variantClassNames:{isDisabled:{true:"_1yep5z611l"}},defaultVariants:{},compoundVariants:[]}),t=a({defaultClassName:"_1yep5z6j8 _1yep5z6j9 _1yep5z6ja _1yep5z6jz _1yep5z6k0 _1yep5z6k1 _1yep5z6it _1yep5z6iu _1yep5z6iv z9nup88",variantClassNames:{labelPosition:{end:"_1yep5z6160 _1yep5z6161 _1yep5z6162 _1yep5z6w1 _1yep5z6w2 _1yep5z6w3",start:"_1yep5z6166 _1yep5z6167 _1yep5z6168 _1yep5z617i _1yep5z617j _1yep5z617k"}},defaultVariants:{},compoundVariants:[]}),i=a({defaultClassName:"_16vugd03 _1yep5z6ai _1yep5z6aj _1yep5z6ak _1yep5z6b6 _1yep5z6b7 _1yep5z6b8 _1yep5z6bu _1yep5z6bv _1yep5z6bw _1yep5z6ci _1yep5z6cj _1yep5z6ck _1yep5z6mh _1yep5z6mf _1yep5z6hi _1yep5z6j8 _1yep5z6j9 _1yep5z6ja _1yep5z6fc _1yep5z6jz _1yep5z6k0 _1yep5z6k1 _1yep5z6kt _1yep5z6ku _1yep5z6kv _1yep5z6m5 _1yep5z6lq _1yep5z6m0",variantClassNames:{isIndeterminate:{true:"_1yep5z618x _1yep5z6130"},isSelected:{true:"_16vugd05"},isFocusVisible:{true:"_16vugd06"},isHovered:{true:"_1yep5z6142"},isDisabled:{true:"_16vugd08 _1yep5z6146"},isReadOnly:{true:"_16vugd09 _1yep5z611s _1yep5z6190 _1yep5z618y _1yep5z6146"},hasError:{true:"_1yep5z613e _1yep5z6190 _1yep5z618y"}},defaultVariants:{},compoundVariants:[[{isSelected:true,isDisabled:false,isReadOnly:false},"_1yep5z61pj"],[{isSelected:true,isDisabled:false,isReadOnly:false,hasError:false},"_1yep5z61vg"],[{isSelected:true,isDisabled:true},"_1yep5z61pt _1yep5z61of"],[{isSelected:true,isDisabled:true,hasError:false},"_1yep5z61vg"],[{isHovered:true,isSelected:true,isReadOnly:false},"_1yep5z61pp _1yep5z61of"],[{isHovered:true,isSelected:true,isReadOnly:false,hasError:false},"_1yep5z61vg"],[{isHovered:true,isSelected:false,isIndeterminate:true,isReadOnly:false},"_1yep5z61pp _1yep5z61of"],[{isHovered:true,isSelected:false,isIndeterminate:true,isReadOnly:false,hasError:false},"_1yep5z61vg"]]});export{_ as a,t as b,i as c};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {a as a$9}from'./chunk-
|
|
1
|
+
import {a as a$9}from'./chunk-IXK6S6IH.mjs';import {a as a$3}from'./chunk-GXOXYPQQ.mjs';import {a as a$b,b as b$3}from'./chunk-ZNN43VZV.mjs';import {b as b$5,c as c$4}from'./chunk-UEDBY5JI.mjs';import {a as a$2}from'./chunk-AMYRLAIC.mjs';import {i,l,p,r,s,w,u,v,j,n,k,h as h$1,x,d as d$1,g,a as a$f}from'./chunk-SMAYNDQQ.mjs';import {b as b$1}from'./chunk-NUYBQ7KP.mjs';import {a as a$k}from'./chunk-X6IJEPSH.mjs';import {a as a$i}from'./chunk-NADBGP35.mjs';import {a as a$l}from'./chunk-E5GYCA3P.mjs';import {c as c$3,b as b$7}from'./chunk-GX2IOGYR.mjs';import {a as a$h}from'./chunk-O7XK2WIX.mjs';import {a as a$j}from'./chunk-2V323KAD.mjs';import {a as a$6}from'./chunk-KUEDQO7P.mjs';import {a}from'./chunk-USMC34OO.mjs';import {b as b$6}from'./chunk-WL27JGVG.mjs';import {b}from'./chunk-N2XGJKZG.mjs';import {a as a$a}from'./chunk-4ZJMZB5B.mjs';import {d}from'./chunk-RCBUNCHV.mjs';import {e,c,h,b as b$2,a as a$c}from'./chunk-B7PSE5KC.mjs';import {h as h$2,i as i$1}from'./chunk-SHJ2TJYG.mjs';import {a as a$g}from'./chunk-D3IZ4HBL.mjs';import {a as a$1}from'./chunk-X3AXUU3H.mjs';import {a as a$4}from'./chunk-K6X2BHPP.mjs';import {a as a$8}from'./chunk-3FYY26ED.mjs';import {a as a$7}from'./chunk-RT4LMB6X.mjs';import {c as c$1,b as b$4}from'./chunk-TZ4MVY4E.mjs';import {a as a$5}from'./chunk-KEVERVHK.mjs';import {c as c$2}from'./chunk-JDLUGVXG.mjs';import {a as a$d}from'./chunk-JQQGRJ5J.mjs';import {a as a$e}from'./chunk-4QEH5CGK.mjs';import Kt,{createContext,forwardRef,useRef,useEffect,useContext,useState,useMemo,useCallback,isValidElement}from'react';import {jsx,jsxs,Fragment}from'react/jsx-runtime';import {ChevronRightIcon}from'@baseline-ui/icons/8';import {themeVars,sprinkles}from'@baseline-ui/tokens';/**
|
|
2
2
|
* Copyright (c) 2023-2024 PSPDFKit GmbH. All rights reserved.
|
|
3
3
|
*
|
|
4
4
|
* THIS SOURCE CODE AND ANY ACCOMPANYING DOCUMENTATION ARE PROTECTED BY INTERNATIONAL COPYRIGHT LAW
|
|
@@ -7,4 +7,4 @@ import {a as a$9}from'./chunk-TEQE6WCH.mjs';import {a as a$3}from'./chunk-GXOXYP
|
|
|
7
7
|
* This notice may not be removed from this file.
|
|
8
8
|
*
|
|
9
9
|
*/
|
|
10
|
-
function ve(r,o,e){let{gridProps:t}=b$6(r,o,e);return t.role="treegrid",{gridProps:t}}var gt={"ar-AE":{collapse:"\u0637\u064A",expand:"\u062A\u0645\u062F\u064A\u062F"},"bg-BG":{collapse:"\u0421\u0432\u0438\u0432\u0430\u043D\u0435",expand:"\u0420\u0430\u0437\u0448\u0438\u0440\u044F\u0432\u0430\u043D\u0435"},"cs-CZ":{collapse:"Sbalit",expand:"Rozt\xE1hnout"},"da-DK":{collapse:"Skjul",expand:"Udvid"},"de-DE":{collapse:"Reduzieren",expand:"Erweitern"},"el-GR":{collapse:"\u03A3\u03CD\u03BC\u03C0\u03C4\u03C5\u03BE\u03B7",expand:"\u0391\u03BD\u03AC\u03C0\u03C4\u03C5\u03BE\u03B7"},"en-US":{expand:"Expand",collapse:"Collapse"},"es-ES":{collapse:"Contraer",expand:"Ampliar"},"et-EE":{collapse:"Ahenda",expand:"Laienda"},"fi-FI":{collapse:"Pienenn\xE4",expand:"Laajenna"},"fr-FR":{collapse:"R\xE9duire",expand:"D\xE9velopper"},"he-IL":{collapse:"\u05DB\u05D5\u05D5\u05E5",expand:"\u05D4\u05E8\u05D7\u05D1"},"hr-HR":{collapse:"Sa\u017Emi",expand:"Pro\u0161iri"},"hu-HU":{collapse:"\xD6sszecsuk\xE1s",expand:"Kibont\xE1s"},"it-IT":{collapse:"Comprimi",expand:"Espandi"},"ja-JP":{collapse:"\u6298\u308A\u305F\u305F\u3080",expand:"\u5C55\u958B"},"ko-KR":{collapse:"\uC811\uAE30",expand:"\uD3BC\uCE58\uAE30"},"lt-LT":{collapse:"Sutraukti",expand:"I\u0161skleisti"},"lv-LV":{collapse:"Sak\u013Caut",expand:"Izv\u0113rst"},"nb-NO":{collapse:"Skjul",expand:"Utvid"},"nl-NL":{collapse:"Samenvouwen",expand:"Uitvouwen"},"pl-PL":{collapse:"Zwi\u0144",expand:"Rozwi\u0144"},"pt-BR":{collapse:"Recolher",expand:"Expandir"},"pt-PT":{collapse:"Colapsar",expand:"Expandir"},"ro-RO":{collapse:"Restr\xE2nge\u021Bi",expand:"Extinde\u021Bi"},"ru-RU":{collapse:"\u0421\u0432\u0435\u0440\u043D\u0443\u0442\u044C",expand:"\u0420\u0430\u0437\u0432\u0435\u0440\u043D\u0443\u0442\u044C"},"sk-SK":{collapse:"Zbali\u0165",expand:"Rozbali\u0165"},"sl-SI":{collapse:"Strni",expand:"Raz\u0161iri"},"sr-SP":{collapse:" Skupi",expand:"Pro\u0161iri"},"sv-SE":{collapse:"D\xF6lj",expand:"Expandera"},"tr-TR":{collapse:"Daralt",expand:"Geni\u015Flet"},"uk-UA":{collapse:"\u0417\u0433\u043E\u0440\u043D\u0443\u0442\u0438",expand:"\u0420\u043E\u0437\u0433\u043E\u0440\u043D\u0443\u0442\u0438"},"zh-CN":{collapse:"\u6298\u53E0",expand:"\u6269\u5C55"},"zh-TW":{collapse:"\u6536\u5408",expand:"\u5C55\u958B"}};function se(r,o,e){let{node:t}=r,n=c$5(r,o,e),a=n.rowProps["aria-expanded"]===true,s=b$7(gt,"@react-aria/tree"),c=a$g({"aria-label":a?s.format("collapse"):s.format("expand"),"aria-labelledby":n.rowProps.id}),d={onPress:()=>{n.isDisabled||(o.toggleKey(t.key),o.selectionManager.setFocused(true),o.selectionManager.setFocusedKey(t.key));},excludeFromTabOrder:true,preventFocusOnPress:true,"data-react-aria-prevent-focus":true,...c};return {...n,expandButtonProps:d}}var be=class r extends g{expandedKeys=new Set;withExpandedKeys(o,e){let t=this.clone();return t.expandedKeys=e,r.cloneAncestorSections(e,o,t),r.cloneAncestorSections(o,e,t),t.frozen=this.frozen,t}static cloneAncestorSections(o,e,t){for(let n of o)if(!e.has(n)){let a=n;for(;a!=null;){let s=t.getItem(a);if(s?.type==="section"){t.keyMap.set(a,s.clone());break}else a=s?.parentKey??null;}}}*[Symbol.iterator](){let o=this.getFirstKey(),e=o!=null?this.getItem(o):null;for(;e;)if(yield e,e.type==="section")e=e.nextKey!=null?this.getItem(e.nextKey):null;else {let t=this.getKeyAfter(e.key);e=t!=null?this.getItem(t):null;}}getLastKey(){let o=this.lastKey;if(o==null)return null;let e=this.getItem(o);for(;e?.lastChildKey!=null&&(e.type!=="item"||this.expandedKeys.has(e.key));)e=this.getItem(e.lastChildKey);return e?.key}getKeyAfter(o){let e=this.getItem(o);if(!e)return null;if((this.expandedKeys.has(e.key)||e.type!=="item")&&e.firstChildKey!=null)return e.firstChildKey;for(;e;){if(e.nextKey!=null)return e.nextKey;if(e.parentKey!=null)e=this.getItem(e.parentKey);else return null}return null}getKeyBefore(o){let e=this.getItem(o);if(!e)return null;if(e.prevKey!=null){for(e=this.getItem(e.prevKey);e&&(e.type!=="item"||this.expandedKeys.has(e.key))&&e.lastChildKey!=null;)e=this.getItem(e.lastChildKey);return e?.key??null}return e.parentKey}getChildren(o){let e=this;return {*[Symbol.iterator](){let t=e.getItem(o),n=t?.firstChildKey!=null?e.getItem(t.firstChildKey):null;if(t&&t.type==="section"&&n)for(;n&&n.key!==t.nextKey;){yield e.getItem(n.key);let a=e.getKeyAfter(n.key);n=a!=null?e.getItem(a):null;}else for(;n;)yield n,n=n.nextKey!=null?e.getItem(n.nextKey):null;}}}getTextValue(o){let e=this.getItem(o);return e?e.textValue:""}},bt=createContext(null),ue=createContext(null),Ie=forwardRef(function(o,e$1){return [o,e$1]=e(o,e$1,bt),jsx(i,{content:jsx(l,{...o}),createCollection:()=>new be,children:t=>jsx(Ht,{props:o,collection:t,treeRef:e$1})})}),xt={expand:{ltr:"ArrowRight",rtl:"ArrowLeft"},collapse:{ltr:"ArrowLeft",rtl:"ArrowRight"}};function Ht({props:r$1,collection:o,treeRef:e}){let{dragAndDropHooks:t}=r$1,{direction:n}=b(),a$7=a({usage:"search",sensitivity:"base"}),s$1=!!t?.useDraggableCollectionState,c$2=!!t?.useDroppableCollectionState,d=useRef(s$1),C=useRef(c$2);useEffect(()=>{d.current!==s$1&&console.warn("Drag hooks were provided during one render, but not another. This should be avoided as it may produce unexpected behavior."),C.current!==c$2&&console.warn("Drop hooks were provided during one render, but not another. This should be avoided as it may produce unexpected behavior.");},[s$1,c$2]);let{selectionMode:T="none",expandedKeys:g,defaultExpandedKeys:u$1,onExpandedChange:b$3,disabledBehavior:m="all"}=r$1,{CollectionRoot:I,isVirtualized:f,layoutDelegate:y,dropTargetDelegate:x}=useContext(p),[v$1,K]=a$1(g?new Set(g):void 0,u$1?new Set(u$1):new Set,b$3),[R,M]=useState(o),[w$1,P]=useState(v$1),[i,h$1]=useState(()=>o.withExpandedKeys(w$1,v$1));(!Ft(w$1,v$1)||o!==R)&&(h$1(o.withExpandedKeys(w$1,v$1)),M(o),P(v$1));let l=a$2({...r$1,selectionMode:T,expandedKeys:v$1,onExpandedChange:K,collection:i,children:void 0,disabledBehavior:m}),{gridProps:H}=ve({...r$1,isVirtualized:f,layoutDelegate:y},l,e),S,E,j,V=false,U=null,Z=useRef(null);if(s$1&&t){S=t.useDraggableCollectionState({collection:l.collection,selectionManager:l.selectionManager,preview:t.renderDragPreview?Z:void 0}),t.useDraggableCollection({},S,e);let ee=t.DragPreview;U=t.renderDragPreview?jsx(ee,{ref:Z,children:t.renderDragPreview}):null;}let[q]=useState(()=>new a$3);if(c$2&&t){E=t.useDroppableCollectionState({collection:l.collection,selectionManager:l.selectionManager});let ee=t.dropTargetDelegate||x||new t.ListDropTargetDelegate(l.collection,e,{direction:n});q.setup(ee,l,n);let me=new b$1({collection:l.collection,collator:a$7,ref:e,disabledKeys:l.selectionManager.disabledKeys,disabledBehavior:l.selectionManager.disabledBehavior,direction:n,layoutDelegate:y});j=t.useDroppableCollection({keyboardDelegate:me,dropTargetDelegate:q,onDropActivate:N=>{if(N.target.type==="item"){let D=N.target.key,W=l.collection.getItem(D),kt=v$1.has(D);W&&W.hasChildNodes&&(!kt||t?.isVirtualDragging?.())&&l.toggleKey(D);}},onKeyDown:N=>{let D=E?.target;if(D&&D.type==="item"&&D.dropPosition==="on"){let W=l.collection.getItem(D.key);(N.key===xt.expand[n]&&W?.hasChildNodes&&!l.expandedKeys.has(D.key)||N.key===xt.collapse[n]&&W?.hasChildNodes&&l.expandedKeys.has(D.key))&&l.toggleKey(D.key);}}},E,e),V=E.isDropTarget({type:"root"});}let Y=!!(s$1&&!S?.isDisabled),{focusProps:Q,isFocused:z,isFocusVisible:O}=a$4(),Me={isEmpty:l.collection.size===0,isFocused:z,isFocusVisible:O,isDropTarget:V,selectionMode:l.selectionManager.selectionMode,allowsDragging:!!Y,state:l},Lt=c({...r$1,children:void 0,defaultClassName:"react-aria-Tree",values:Me}),ke=null;if(l.collection.size===0&&r$1.renderEmptyState){let{isEmpty:ee,...me}=Me,N=r$1.renderEmptyState({...me});ke=jsx("div",{role:"row",style:{display:"contents"},...{"aria-level":1},children:jsx("div",{role:"gridcell",style:{display:"contents"},children:N})});}let Mt=a$5(r$1,{global:true});return jsxs(Fragment,{children:[jsx(a$6,{children:jsxs(h.div,{...c$1(Mt,Lt,H,Q,j?.collectionProps),ref:e,slot:r$1.slot||void 0,"data-empty":l.collection.size===0||void 0,"data-focused":z||void 0,"data-drop-target":V||void 0,"data-focus-visible":O||void 0,"data-selection-mode":l.selectionManager.selectionMode==="none"?void 0:l.selectionManager.selectionMode,"data-allows-dragging":!!Y||void 0,children:[jsxs(b$2,{values:[[ue,l],[r,{dragAndDropHooks:t,dragState:S,dropState:E}],[s,{render:Nt}]],children:[c$2&&jsx(zt,{}),jsx(w,{children:jsx(I,{collection:l.collection,persistedKeys:v(l.selectionManager,t,E),scrollRef:e,renderDropIndicator:u(t,E)})})]}),ke]})}),U]})}var Pe=class extends a$f{static type="content"},Ce=j(Pe,function(o){let e=useContext(Pt),t=c({children:o.children,values:e});return jsx(p.Provider,{value:n,children:t.children})}),Pt=createContext(null),he=class extends a$f{static type="item"},Re=k(he,(r$1,o,e)=>{let t=useContext(ue);o=a$7(o);let{dragAndDropHooks:n,dragState:a,dropState:s}=useContext(r),c$3=a&&!(a.isDisabled||a.selectionManager.isDisabled(e.key)),{rowProps:d$1,gridCellProps:C,expandButtonProps:T,descriptionProps:g,...u}=se({node:e,shouldSelectOnPressUp:!!a},t,o),b=d$1["aria-expanded"]===true,m=r$1.hasChildItems||[...t.collection.getChildren(e.key)].length>1,I=d$1["aria-level"]||1,{hoverProps:f,isHovered:y}=a$8({isDisabled:!u.allowsSelection&&!u.hasAction&&!c$3,onHoverStart:r$1.onHoverStart,onHoverChange:r$1.onHoverChange,onHoverEnd:r$1.onHoverEnd}),{isFocusVisible:x$1,focusProps:v}=a$4(),{isFocusVisible:K,focusProps:R}=a$4({within:true}),{checkboxProps:M}=a$9({key:e.key},t),w=null;a&&n&&(w=n.useDraggableItem({key:e.key,hasDragButton:true},a,o));let P=null,i=useRef(null),h$2=useRef(null),l=useRef(null),{visuallyHiddenProps:H}=a$a();s&&n&&(P=n.useDropIndicator({target:{type:"item",key:e.key,dropPosition:"on"},activateButtonRef:l},s,h$2));let S=a&&a.isDragging(e.key),E=P?.isDropTarget,j=t.selectionManager.selectionMode,V=t.selectionManager.selectionBehavior,U=Kt.useMemo(()=>({...u,isHovered:y,isFocusVisible:x$1,isExpanded:b,hasChildItems:m,level:I,selectionMode:j,selectionBehavior:V,isFocusVisibleWithin:K,state:t,id:e.key,allowsDragging:!!a,isDragging:S,isDropTarget:E}),[u,y,x$1,b,m,I,K,t,e.key,a,S,E,V,j]),Z=c({...r$1,id:void 0,children:e.rendered,defaultClassName:"react-aria-TreeItem",defaultStyle:{"--tree-item-level":I},values:U});useEffect(()=>{!e.textValue&&process.env.NODE_ENV!=="production"&&console.warn("A `textValue` prop is required for <TreeItem> elements in order to support accessibility features such as type to select.");},[e.textValue]),useEffect(()=>{m&&!i.current&&process.env.NODE_ENV!=="production"&&console.warn("Expandable tree items must contain a expand button so screen reader users can expand/collapse the item.");},[]);let q=useRef(null);useEffect(()=>{a&&!q.current&&process.env.NODE_ENV!=="production"&&console.warn('Draggable items in a Tree must contain a <Button slot="drag"> element so that keyboard and screen reader users can drag them.');},[]);let Y=h$1({items:t.collection.getChildren(e.key),children:O=>{switch(O.type){case "content":return O.render(O);case "loader":case "item":return jsx(Fragment,{});default:throw new Error("Unsupported element type in TreeRow: "+O.type)}}}),Q=c$2(),z=a$5(r$1,{global:true});return delete z.id,delete z.onClick,jsxs(Fragment,{children:[P&&!P.isHidden&&jsx("div",{role:"row","aria-level":d$1["aria-level"],"aria-expanded":d$1["aria-expanded"],"aria-label":P.dropIndicatorProps["aria-label"],children:jsxs("div",{role:"gridcell","aria-colindex":1,style:{display:"contents"},children:[jsx("div",{role:"button",...H,...P.dropIndicatorProps,ref:h$2}),d$1["aria-expanded"]!=null?jsx("div",{role:"button",...H,id:Q,"aria-label":T["aria-label"],"aria-labelledby":`${Q} ${d$1.id}`,tabIndex:-1,ref:l}):null]})}),jsx(h.div,{...c$1(z,d$1,v,f,R,w?.dragProps),...Z,ref:o,"data-expanded":m&&b||void 0,"data-has-child-items":m||void 0,"data-level":I,"data-selected":u.isSelected||void 0,"data-disabled":u.isDisabled||void 0,"data-hovered":y||void 0,"data-focused":u.isFocused||void 0,"data-focus-visible":x$1||void 0,"data-pressed":u.isPressed||void 0,"data-selection-mode":t.selectionManager.selectionMode==="none"?void 0:t.selectionManager.selectionMode,"data-allows-dragging":!!a||void 0,"data-dragging":S||void 0,"data-drop-target":E||void 0,children:jsx("div",{...C,style:{display:"contents"},children:jsx(b$2,{values:[[a$b,{slots:{selection:M}}],[b$3,{slots:{selection:M}}],[d,{slots:{[a$c]:{},chevron:{...T,ref:i},drag:{...w?.dragButtonProps,ref:q,style:{pointerEvents:"none"}}}}],[Pt,{...U}],[x,{isSelected:u.isSelected}]],children:Y})})})]})});j(d$1,function(o,e,t){let{isVirtualized:n}=useContext(p),a=useContext(ue),{isLoading:s,onLoadMore:c$2,scrollOffset:d,...C}=o,T=useRef(null),g=useMemo(()=>({onLoadMore:c$2,collection:a?.collection,sentinelRef:T,scrollOffset:d}),[c$2,d,a?.collection]);b$4(g,T),e=a$7(e);let{rowProps:u,gridCellProps:b}=se({node:t},a,e),m=u["aria-level"]||1,I={role:"row","aria-level":u["aria-level"]},f=c({...C,id:void 0,children:t.rendered,defaultClassName:"react-aria-TreeLoader",values:{level:m}}),y={};return n&&(y={display:"contents"}),jsxs(Fragment,{children:[jsx("div",{style:{position:"relative",width:0,height:0},inert:c$3(true),children:jsx("div",{"data-testid":"loadMoreSentinel",ref:T,style:{position:"absolute",height:1,width:1}})}),s&&f.children&&jsx(h.div,{ref:e,...c$1(a$5(o),I),...f,"data-level":m,children:jsx("div",{...b,style:y,children:f.children})})]})});function Nt(r$1,o){o=a$7(o);let{dragAndDropHooks:e,dropState:t}=useContext(r),n=useRef(null),{dropIndicatorProps:a,isHidden:s,isDropTarget:c}=e.useDropIndicator(r$1,t,n);if(s)return null;let d=t&&r$1.target.type==="item"?(t.collection.getItem(r$1.target.key)?.level||0)+1:1;return jsx(Vt,{...r$1,dropIndicatorProps:a,isDropTarget:c,ref:o,buttonRef:n,level:d})}function Bt(r,o){let{dropIndicatorProps:e,isDropTarget:t,buttonRef:n,level:a,...s}=r,{visuallyHiddenProps:c$1}=a$a(),d=c({...s,defaultClassName:"react-aria-DropIndicator",defaultStyle:{position:"relative","--tree-item-level":a},values:{isDropTarget:t}});return jsx(h.div,{...d,role:"row","aria-level":a,ref:o,"data-drop-target":t||void 0,children:jsxs("div",{role:"gridcell",children:[jsx("div",{...c$1,role:"button",...e,ref:n}),d.children]})})}var Vt=forwardRef(Bt);function zt(){let{dragAndDropHooks:r$1,dropState:o}=useContext(r),e=useRef(null),{dropIndicatorProps:t}=r$1.useDropIndicator({target:{type:"root"}},o,e),n=o.isDropTarget({type:"root"}),{visuallyHiddenProps:a}=a$a();return !n&&t["aria-hidden"]?null:jsx("div",{role:"row","aria-hidden":t["aria-hidden"],style:{position:"absolute"},children:jsx("div",{role:"gridcell",children:jsx("div",{role:"button",...a,...t,ref:e})})})}function Ft(r,o){if(r.size!==o.size)return false;for(let e of r)if(!o.has(e))return false;return true}var ht=({actionsPosition:r,onPrimaryAction:o,onSecondaryAction:e,primaryActionIcon:t,secondaryActionIcon:n,primaryActionAriaLabel:a,secondaryActionAriaLabel:s,expandLabel:c,collapseLabel:d,onRename:C,renameLabel:T,renderItemTitle:g})=>Object.values({actionsPosition:r,onPrimaryAction:o,onSecondaryAction:e,primaryActionIcon:t,secondaryActionIcon:n,primaryActionAriaLabel:a,secondaryActionAriaLabel:s,expandLabel:c,collapseLabel:d,onRename:C,renameLabel:T,renderItemTitle:g});var Dt="_10dw1p96",It="_10dw1p95",Ct=a$d({defaultClassName:"_10dw1p90 _1yep5z63o _1yep5z63p _1yep5z63q _1yep5z61c _1yep5z61d _1yep5z61e _1yep5z6is _1yep5z6it _1yep5z6iu _1yep5z6j1 _1yep5z6j2 _1yep5z6j3 _1yep5z69f _1yep5z69g _1yep5z69h _1yep5z6jj _1yep5z6jk _1yep5z6jl _1yep5z6lq _1yep5z6ld _1yep5z6la",variantClassNames:{isSelected:{true:"_1yep5z6126"},isHovered:{true:"_10dw1p92"},isRenaming:{true:"_10dw1p93"},isFocusVisible:{true:"_1yep5z6140 _1yep5z617w _1yep5z617u _1yep5z617x"}},defaultVariants:{},compoundVariants:[[{isHovered:true,isSelected:false,isRenaming:false},"_1yep5z61o8 _1yep5z61q9 _1yep5z61ty _1yep5z61tx _1yep5z61u1"]]});function St(r,o){if(typeof r=="function"&&!r.prototype?.isReactComponent){let e=r(o);return isValidElement(e)?r:e}return r}var Se=({item:r,...o})=>{let{onPrimaryAction:e,onSecondaryAction:t,actionsPosition:n,primaryActionIcon:a,secondaryActionIcon:s,primaryActionAriaLabel:c,secondaryActionAriaLabel:d,expandLabel:C,collapseLabel:T,onRename:g,renameLabel:u,renderItemTitle:b}=o,{formatMessage:m}=b$8(),{renamingKey:I,setRenamingKey:f}=useContext(Ee),y=I===r.id,x=!!r.children?.length,v=r.icon,K=!!g,R=useRef(false),M=useMemo(()=>{let i=St(a,r.id),h=St(s,r.id),l=typeof c=="function"?c(r.id):c,H=typeof d=="function"?d(r.id):d;return i||h?jsxs(a$h,{display:"flex",flexDirection:"row",children:[i?jsx(a$i,{icon:i,"aria-label":l,size:"sm",excludeFromTabOrder:true,variant:"secondary",onPress:()=>{e?.(r.id);},tooltip:true}):null,h?jsx(a$i,{icon:h,"aria-label":H,size:"sm",excludeFromTabOrder:true,variant:"secondary",onPress:()=>{t?.(r.id);},tooltip:true}):null]}):null},[a,r.id,s,c,d,e,t]),w=useCallback(i=>{i.key==="Enter"?(R.current=true,g?.({key:r.id,value:i.target.value}),f(null)):i.key==="Escape"&&(R.current=true,f(null));},[r.id,g,f]),P=useCallback(()=>b?b(r):r.label,[b,r]);return jsxs(Re,{id:r.id,textValue:r.label,"data-key":r.id,className:i=>a$e(It,Ct({isHovered:i.isHovered,isSelected:i.isSelected,isFocusVisible:i.isFocusVisible,isRenaming:y}),"BaselineUI-TreeView-Row"),style:{justifyContent:n==="end"?"space-between":void 0},children:[jsx(Ce,{children:i=>{let h=i.level-1;return jsxs(Fragment,{children:[n==="start"?M:null,jsxs(a$h,{display:"flex",flexDirection:"row",alignItems:"center",children:[jsxs(a$h,{display:"flex",padding:"sm",flexDirection:"row",alignItems:"center",gap:"md",style:{marginInlineStart:`calc(${h*2} * ${themeVars.spacing.lg})`},children:[jsx(a$j,{icon:ChevronRightIcon,size:"xxs",variant:"secondary",onPress:()=>{i.state.toggleKey(i.id);},"aria-label":i.isExpanded?T??m(we.collapse):C??m(we.expand),style:{visibility:x?"visible":"hidden"},className:a$e(Dt,"BaselineUI-TreeView-ExpansionToggle")}),v?jsx(v,{size:16,style:{color:themeVars.color.icon.interactive.disabled}}):null]}),jsxs(a$h,{paddingLeft:"sm",paddingY:y?"none":"md",display:"flex",flexDirection:"column",gap:"xs",onDoubleClick:l=>{K&&(l.stopPropagation(),l.preventDefault(),f(r.id));},children:[y?jsx("div",{onClick:l=>{l.stopPropagation();},children:jsx(a$k,{defaultValue:r.label,autoFocus:true,onBlur:l=>{if(R.current){R.current=false;return}g?.({key:r.id,value:l.target.value}),f(null);},"aria-label":u??m(we.rename),onKeyDown:w,className:"BaselineUI-TreeView-RenameInput"})}):jsx(a$l,{type:"label",size:"sm",className:a$e(sprinkles.compoundVariants({color:"text.primary"}),"BaselineUI-TreeView-Title"),children:P()}),r.description?jsx(a$l,{type:"helper",size:"sm",className:"BaselineUI-TreeView-Description",children:r.description}):null]})]}),n==="end"?M:null]})}}),jsx(l,{items:r.children,children:i=>jsx(Se,{item:i,...o})})]})},we=c$4({expand:{id:"bui.treeView.expand",defaultMessage:"Expand"},collapse:{id:"bui.treeView.collapse",defaultMessage:"Collapse"},rename:{id:"bui.treeView.rename",defaultMessage:"Rename"}});var Ee=createContext({renamingKey:null,setRenamingKey:()=>{}}),Et=Kt.forwardRef(({className:r,style:o,"data-block-id":e,"data-block-class":t,items:n,onPrimaryAction:a,onSecondaryAction:s,primaryActionIcon:c,secondaryActionIcon:d,primaryActionAriaLabel:C,secondaryActionAriaLabel:T,actionsPosition:g="start",expandLabel:u,collapseLabel:b,onRename:m,renameLabel:I,onAction:f,renderItemTitle:y,...x},v)=>{let K=useRef(null),[R,M]=useState(null);useEffect(()=>{let i=K.current;if(!i||!m)return;let h=l=>{if(l.key==="F2"){let S=i.querySelector("[data-focused='true']")?.dataset.key;S&&(l.preventDefault(),l.stopPropagation(),M(S));}};return i.addEventListener("keydown",h),()=>{i.removeEventListener("keydown",h);}},[m]);let w=useMemo(()=>({renamingKey:R,setRenamingKey:M}),[R]),P={actionsPosition:g,onPrimaryAction:a,onSecondaryAction:s,primaryActionIcon:c,secondaryActionIcon:d,primaryActionAriaLabel:C,secondaryActionAriaLabel:T,expandLabel:u,collapseLabel:b,onRename:m,renameLabel:I,renderItemTitle:y};return jsx(Ee.Provider,{value:w,children:jsx(Ie,{ref:b$5(v,K),items:n.children||[],selectionMode:"multiple",expandedKeys:x.expandedKeys,defaultExpandedKeys:x.defaultExpandedKeys,onExpandedChange:x.onExpandedChange,selectedKeys:x.selectedKeys,onAction:f,"aria-label":x["aria-label"],"aria-labelledby":x["aria-labelledby"],"data-block-id":e,"data-block-class":t,style:o,className:a$e(r,"BaselineUI-TreeView"),dependencies:ht(P),children:i=>jsx(Se,{item:i,...P})})})});Et.displayName="TreeView";export{Et as a};
|
|
10
|
+
function ve(r,o,e){let{gridProps:t}=b$5(r,o,e);return t.role="treegrid",{gridProps:t}}var gt={"ar-AE":{collapse:"\u0637\u064A",expand:"\u062A\u0645\u062F\u064A\u062F"},"bg-BG":{collapse:"\u0421\u0432\u0438\u0432\u0430\u043D\u0435",expand:"\u0420\u0430\u0437\u0448\u0438\u0440\u044F\u0432\u0430\u043D\u0435"},"cs-CZ":{collapse:"Sbalit",expand:"Rozt\xE1hnout"},"da-DK":{collapse:"Skjul",expand:"Udvid"},"de-DE":{collapse:"Reduzieren",expand:"Erweitern"},"el-GR":{collapse:"\u03A3\u03CD\u03BC\u03C0\u03C4\u03C5\u03BE\u03B7",expand:"\u0391\u03BD\u03AC\u03C0\u03C4\u03C5\u03BE\u03B7"},"en-US":{expand:"Expand",collapse:"Collapse"},"es-ES":{collapse:"Contraer",expand:"Ampliar"},"et-EE":{collapse:"Ahenda",expand:"Laienda"},"fi-FI":{collapse:"Pienenn\xE4",expand:"Laajenna"},"fr-FR":{collapse:"R\xE9duire",expand:"D\xE9velopper"},"he-IL":{collapse:"\u05DB\u05D5\u05D5\u05E5",expand:"\u05D4\u05E8\u05D7\u05D1"},"hr-HR":{collapse:"Sa\u017Emi",expand:"Pro\u0161iri"},"hu-HU":{collapse:"\xD6sszecsuk\xE1s",expand:"Kibont\xE1s"},"it-IT":{collapse:"Comprimi",expand:"Espandi"},"ja-JP":{collapse:"\u6298\u308A\u305F\u305F\u3080",expand:"\u5C55\u958B"},"ko-KR":{collapse:"\uC811\uAE30",expand:"\uD3BC\uCE58\uAE30"},"lt-LT":{collapse:"Sutraukti",expand:"I\u0161skleisti"},"lv-LV":{collapse:"Sak\u013Caut",expand:"Izv\u0113rst"},"nb-NO":{collapse:"Skjul",expand:"Utvid"},"nl-NL":{collapse:"Samenvouwen",expand:"Uitvouwen"},"pl-PL":{collapse:"Zwi\u0144",expand:"Rozwi\u0144"},"pt-BR":{collapse:"Recolher",expand:"Expandir"},"pt-PT":{collapse:"Colapsar",expand:"Expandir"},"ro-RO":{collapse:"Restr\xE2nge\u021Bi",expand:"Extinde\u021Bi"},"ru-RU":{collapse:"\u0421\u0432\u0435\u0440\u043D\u0443\u0442\u044C",expand:"\u0420\u0430\u0437\u0432\u0435\u0440\u043D\u0443\u0442\u044C"},"sk-SK":{collapse:"Zbali\u0165",expand:"Rozbali\u0165"},"sl-SI":{collapse:"Strni",expand:"Raz\u0161iri"},"sr-SP":{collapse:" Skupi",expand:"Pro\u0161iri"},"sv-SE":{collapse:"D\xF6lj",expand:"Expandera"},"tr-TR":{collapse:"Daralt",expand:"Geni\u015Flet"},"uk-UA":{collapse:"\u0417\u0433\u043E\u0440\u043D\u0443\u0442\u0438",expand:"\u0420\u043E\u0437\u0433\u043E\u0440\u043D\u0443\u0442\u0438"},"zh-CN":{collapse:"\u6298\u53E0",expand:"\u6269\u5C55"},"zh-TW":{collapse:"\u6536\u5408",expand:"\u5C55\u958B"}};function se(r,o,e){let{node:t}=r,n=c$4(r,o,e),a=n.rowProps["aria-expanded"]===true,s=b$6(gt,"@react-aria/tree"),c=a$g({"aria-label":a?s.format("collapse"):s.format("expand"),"aria-labelledby":n.rowProps.id}),d={onPress:()=>{n.isDisabled||(o.toggleKey(t.key),o.selectionManager.setFocused(true),o.selectionManager.setFocusedKey(t.key));},excludeFromTabOrder:true,preventFocusOnPress:true,"data-react-aria-prevent-focus":true,...c};return {...n,expandButtonProps:d}}var be=class r extends g{expandedKeys=new Set;withExpandedKeys(o,e){let t=this.clone();return t.expandedKeys=e,r.cloneAncestorSections(e,o,t),r.cloneAncestorSections(o,e,t),t.frozen=this.frozen,t}static cloneAncestorSections(o,e,t){for(let n of o)if(!e.has(n)){let a=n;for(;a!=null;){let s=t.getItem(a);if(s?.type==="section"){t.keyMap.set(a,s.clone());break}else a=s?.parentKey??null;}}}*[Symbol.iterator](){let o=this.getFirstKey(),e=o!=null?this.getItem(o):null;for(;e;)if(yield e,e.type==="section")e=e.nextKey!=null?this.getItem(e.nextKey):null;else {let t=this.getKeyAfter(e.key);e=t!=null?this.getItem(t):null;}}getLastKey(){let o=this.lastKey;if(o==null)return null;let e=this.getItem(o);for(;e?.lastChildKey!=null&&(e.type!=="item"||this.expandedKeys.has(e.key));)e=this.getItem(e.lastChildKey);return e?.key}getKeyAfter(o){let e=this.getItem(o);if(!e)return null;if((this.expandedKeys.has(e.key)||e.type!=="item")&&e.firstChildKey!=null)return e.firstChildKey;for(;e;){if(e.nextKey!=null)return e.nextKey;if(e.parentKey!=null)e=this.getItem(e.parentKey);else return null}return null}getKeyBefore(o){let e=this.getItem(o);if(!e)return null;if(e.prevKey!=null){for(e=this.getItem(e.prevKey);e&&(e.type!=="item"||this.expandedKeys.has(e.key))&&e.lastChildKey!=null;)e=this.getItem(e.lastChildKey);return e?.key??null}return e.parentKey}getChildren(o){let e=this;return {*[Symbol.iterator](){let t=e.getItem(o),n=t?.firstChildKey!=null?e.getItem(t.firstChildKey):null;if(t&&t.type==="section"&&n)for(;n&&n.key!==t.nextKey;){yield e.getItem(n.key);let a=e.getKeyAfter(n.key);n=a!=null?e.getItem(a):null;}else for(;n;)yield n,n=n.nextKey!=null?e.getItem(n.nextKey):null;}}}getTextValue(o){let e=this.getItem(o);return e?e.textValue:""}},bt=createContext(null),ue=createContext(null),Ie=forwardRef(function(o,e$1){return [o,e$1]=e(o,e$1,bt),jsx(i,{content:jsx(l,{...o}),createCollection:()=>new be,children:t=>jsx(Ht,{props:o,collection:t,treeRef:e$1})})}),xt={expand:{ltr:"ArrowRight",rtl:"ArrowLeft"},collapse:{ltr:"ArrowLeft",rtl:"ArrowRight"}};function Ht({props:r$1,collection:o,treeRef:e}){let{dragAndDropHooks:t}=r$1,{direction:n}=b(),a$7=a({usage:"search",sensitivity:"base"}),s$1=!!t?.useDraggableCollectionState,c$2=!!t?.useDroppableCollectionState,d=useRef(s$1),C=useRef(c$2);useEffect(()=>{d.current!==s$1&&console.warn("Drag hooks were provided during one render, but not another. This should be avoided as it may produce unexpected behavior."),C.current!==c$2&&console.warn("Drop hooks were provided during one render, but not another. This should be avoided as it may produce unexpected behavior.");},[s$1,c$2]);let{selectionMode:T="none",expandedKeys:g,defaultExpandedKeys:u$1,onExpandedChange:b$3,disabledBehavior:m="all"}=r$1,{CollectionRoot:I,isVirtualized:f,layoutDelegate:y,dropTargetDelegate:x}=useContext(p),[v$1,K]=a$1(g?new Set(g):void 0,u$1?new Set(u$1):new Set,b$3),[R,M]=useState(o),[w$1,P]=useState(v$1),[i,h$1]=useState(()=>o.withExpandedKeys(w$1,v$1));(!Ft(w$1,v$1)||o!==R)&&(h$1(o.withExpandedKeys(w$1,v$1)),M(o),P(v$1));let l=a$2({...r$1,selectionMode:T,expandedKeys:v$1,onExpandedChange:K,collection:i,children:void 0,disabledBehavior:m}),{gridProps:H}=ve({...r$1,isVirtualized:f,layoutDelegate:y},l,e),S,E,j,V=false,U=null,Z=useRef(null);if(s$1&&t){S=t.useDraggableCollectionState({collection:l.collection,selectionManager:l.selectionManager,preview:t.renderDragPreview?Z:void 0}),t.useDraggableCollection({},S,e);let ee=t.DragPreview;U=t.renderDragPreview?jsx(ee,{ref:Z,children:t.renderDragPreview}):null;}let[q]=useState(()=>new a$3);if(c$2&&t){E=t.useDroppableCollectionState({collection:l.collection,selectionManager:l.selectionManager});let ee=t.dropTargetDelegate||x||new t.ListDropTargetDelegate(l.collection,e,{direction:n});q.setup(ee,l,n);let me=new b$1({collection:l.collection,collator:a$7,ref:e,disabledKeys:l.selectionManager.disabledKeys,disabledBehavior:l.selectionManager.disabledBehavior,direction:n,layoutDelegate:y});j=t.useDroppableCollection({keyboardDelegate:me,dropTargetDelegate:q,onDropActivate:N=>{if(N.target.type==="item"){let D=N.target.key,W=l.collection.getItem(D),kt=v$1.has(D);W&&W.hasChildNodes&&(!kt||t?.isVirtualDragging?.())&&l.toggleKey(D);}},onKeyDown:N=>{let D=E?.target;if(D&&D.type==="item"&&D.dropPosition==="on"){let W=l.collection.getItem(D.key);(N.key===xt.expand[n]&&W?.hasChildNodes&&!l.expandedKeys.has(D.key)||N.key===xt.collapse[n]&&W?.hasChildNodes&&l.expandedKeys.has(D.key))&&l.toggleKey(D.key);}}},E,e),V=E.isDropTarget({type:"root"});}let Y=!!(s$1&&!S?.isDisabled),{focusProps:Q,isFocused:z,isFocusVisible:O}=a$4(),Me={isEmpty:l.collection.size===0,isFocused:z,isFocusVisible:O,isDropTarget:V,selectionMode:l.selectionManager.selectionMode,allowsDragging:!!Y,state:l},Lt=c({...r$1,children:void 0,defaultClassName:"react-aria-Tree",values:Me}),ke=null;if(l.collection.size===0&&r$1.renderEmptyState){let{isEmpty:ee,...me}=Me,N=r$1.renderEmptyState({...me});ke=jsx("div",{role:"row",style:{display:"contents"},...{"aria-level":1},children:jsx("div",{role:"gridcell",style:{display:"contents"},children:N})});}let Mt=a$5(r$1,{global:true});return jsxs(Fragment,{children:[jsx(a$6,{children:jsxs(h.div,{...c$1(Mt,Lt,H,Q,j?.collectionProps),ref:e,slot:r$1.slot||void 0,"data-empty":l.collection.size===0||void 0,"data-focused":z||void 0,"data-drop-target":V||void 0,"data-focus-visible":O||void 0,"data-selection-mode":l.selectionManager.selectionMode==="none"?void 0:l.selectionManager.selectionMode,"data-allows-dragging":!!Y||void 0,children:[jsxs(b$2,{values:[[ue,l],[r,{dragAndDropHooks:t,dragState:S,dropState:E}],[s,{render:Nt}]],children:[c$2&&jsx(zt,{}),jsx(w,{children:jsx(I,{collection:l.collection,persistedKeys:v(l.selectionManager,t,E),scrollRef:e,renderDropIndicator:u(t,E)})})]}),ke]})}),U]})}var Pe=class extends a$f{static type="content"},Ce=j(Pe,function(o){let e=useContext(Pt),t=c({children:o.children,values:e});return jsx(p.Provider,{value:n,children:t.children})}),Pt=createContext(null),he=class extends a$f{static type="item"},Re=k(he,(r$1,o,e)=>{let t=useContext(ue);o=a$7(o);let{dragAndDropHooks:n,dragState:a,dropState:s}=useContext(r),c$3=a&&!(a.isDisabled||a.selectionManager.isDisabled(e.key)),{rowProps:d$1,gridCellProps:C,expandButtonProps:T,descriptionProps:g,...u}=se({node:e,shouldSelectOnPressUp:!!a},t,o),b=d$1["aria-expanded"]===true,m=r$1.hasChildItems||[...t.collection.getChildren(e.key)].length>1,I=d$1["aria-level"]||1,{hoverProps:f,isHovered:y}=a$8({isDisabled:!u.allowsSelection&&!u.hasAction&&!c$3,onHoverStart:r$1.onHoverStart,onHoverChange:r$1.onHoverChange,onHoverEnd:r$1.onHoverEnd}),{isFocusVisible:x$1,focusProps:v}=a$4(),{isFocusVisible:K,focusProps:R}=a$4({within:true}),{checkboxProps:M}=a$9({key:e.key},t),w=null;a&&n&&(w=n.useDraggableItem({key:e.key,hasDragButton:true},a,o));let P=null,i=useRef(null),h$2=useRef(null),l=useRef(null),{visuallyHiddenProps:H}=a$a();s&&n&&(P=n.useDropIndicator({target:{type:"item",key:e.key,dropPosition:"on"},activateButtonRef:l},s,h$2));let S=a&&a.isDragging(e.key),E=P?.isDropTarget,j=t.selectionManager.selectionMode,V=t.selectionManager.selectionBehavior,U=Kt.useMemo(()=>({...u,isHovered:y,isFocusVisible:x$1,isExpanded:b,hasChildItems:m,level:I,selectionMode:j,selectionBehavior:V,isFocusVisibleWithin:K,state:t,id:e.key,allowsDragging:!!a,isDragging:S,isDropTarget:E}),[u,y,x$1,b,m,I,K,t,e.key,a,S,E,V,j]),Z=c({...r$1,id:void 0,children:e.rendered,defaultClassName:"react-aria-TreeItem",defaultStyle:{"--tree-item-level":I},values:U});useEffect(()=>{!e.textValue&&process.env.NODE_ENV!=="production"&&console.warn("A `textValue` prop is required for <TreeItem> elements in order to support accessibility features such as type to select.");},[e.textValue]),useEffect(()=>{m&&!i.current&&process.env.NODE_ENV!=="production"&&console.warn("Expandable tree items must contain a expand button so screen reader users can expand/collapse the item.");},[]);let q=useRef(null);useEffect(()=>{a&&!q.current&&process.env.NODE_ENV!=="production"&&console.warn('Draggable items in a Tree must contain a <Button slot="drag"> element so that keyboard and screen reader users can drag them.');},[]);let Y=h$1({items:t.collection.getChildren(e.key),children:O=>{switch(O.type){case "content":return O.render(O);case "loader":case "item":return jsx(Fragment,{});default:throw new Error("Unsupported element type in TreeRow: "+O.type)}}}),Q=c$2(),z=a$5(r$1,{global:true});return delete z.id,delete z.onClick,jsxs(Fragment,{children:[P&&!P.isHidden&&jsx("div",{role:"row","aria-level":d$1["aria-level"],"aria-expanded":d$1["aria-expanded"],"aria-label":P.dropIndicatorProps["aria-label"],children:jsxs("div",{role:"gridcell","aria-colindex":1,style:{display:"contents"},children:[jsx("div",{role:"button",...H,...P.dropIndicatorProps,ref:h$2}),d$1["aria-expanded"]!=null?jsx("div",{role:"button",...H,id:Q,"aria-label":T["aria-label"],"aria-labelledby":`${Q} ${d$1.id}`,tabIndex:-1,ref:l}):null]})}),jsx(h.div,{...c$1(z,d$1,v,f,R,w?.dragProps),...Z,ref:o,"data-expanded":m&&b||void 0,"data-has-child-items":m||void 0,"data-level":I,"data-selected":u.isSelected||void 0,"data-disabled":u.isDisabled||void 0,"data-hovered":y||void 0,"data-focused":u.isFocused||void 0,"data-focus-visible":x$1||void 0,"data-pressed":u.isPressed||void 0,"data-selection-mode":t.selectionManager.selectionMode==="none"?void 0:t.selectionManager.selectionMode,"data-allows-dragging":!!a||void 0,"data-dragging":S||void 0,"data-drop-target":E||void 0,children:jsx("div",{...C,style:{display:"contents"},children:jsx(b$2,{values:[[a$b,{slots:{selection:M}}],[b$3,{slots:{selection:M}}],[d,{slots:{[a$c]:{},chevron:{...T,ref:i},drag:{...w?.dragButtonProps,ref:q,style:{pointerEvents:"none"}}}}],[Pt,{...U}],[x,{isSelected:u.isSelected}]],children:Y})})})]})});j(d$1,function(o,e,t){let{isVirtualized:n}=useContext(p),a=useContext(ue),{isLoading:s,onLoadMore:c$2,scrollOffset:d,...C}=o,T=useRef(null),g=useMemo(()=>({onLoadMore:c$2,collection:a?.collection,sentinelRef:T,scrollOffset:d}),[c$2,d,a?.collection]);h$2(g,T),e=a$7(e);let{rowProps:u,gridCellProps:b}=se({node:t},a,e),m=u["aria-level"]||1,I={role:"row","aria-level":u["aria-level"]},f=c({...C,id:void 0,children:t.rendered,defaultClassName:"react-aria-TreeLoader",values:{level:m}}),y={};return n&&(y={display:"contents"}),jsxs(Fragment,{children:[jsx("div",{style:{position:"relative",width:0,height:0},inert:i$1(true),children:jsx("div",{"data-testid":"loadMoreSentinel",ref:T,style:{position:"absolute",height:1,width:1}})}),s&&f.children&&jsx(h.div,{ref:e,...c$1(a$5(o),I),...f,"data-level":m,children:jsx("div",{...b,style:y,children:f.children})})]})});function Nt(r$1,o){o=a$7(o);let{dragAndDropHooks:e,dropState:t}=useContext(r),n=useRef(null),{dropIndicatorProps:a,isHidden:s,isDropTarget:c}=e.useDropIndicator(r$1,t,n);if(s)return null;let d=t&&r$1.target.type==="item"?(t.collection.getItem(r$1.target.key)?.level||0)+1:1;return jsx(Vt,{...r$1,dropIndicatorProps:a,isDropTarget:c,ref:o,buttonRef:n,level:d})}function Bt(r,o){let{dropIndicatorProps:e,isDropTarget:t,buttonRef:n,level:a,...s}=r,{visuallyHiddenProps:c$1}=a$a(),d=c({...s,defaultClassName:"react-aria-DropIndicator",defaultStyle:{position:"relative","--tree-item-level":a},values:{isDropTarget:t}});return jsx(h.div,{...d,role:"row","aria-level":a,ref:o,"data-drop-target":t||void 0,children:jsxs("div",{role:"gridcell",children:[jsx("div",{...c$1,role:"button",...e,ref:n}),d.children]})})}var Vt=forwardRef(Bt);function zt(){let{dragAndDropHooks:r$1,dropState:o}=useContext(r),e=useRef(null),{dropIndicatorProps:t}=r$1.useDropIndicator({target:{type:"root"}},o,e),n=o.isDropTarget({type:"root"}),{visuallyHiddenProps:a}=a$a();return !n&&t["aria-hidden"]?null:jsx("div",{role:"row","aria-hidden":t["aria-hidden"],style:{position:"absolute"},children:jsx("div",{role:"gridcell",children:jsx("div",{role:"button",...a,...t,ref:e})})})}function Ft(r,o){if(r.size!==o.size)return false;for(let e of r)if(!o.has(e))return false;return true}var ht=({actionsPosition:r,onPrimaryAction:o,onSecondaryAction:e,primaryActionIcon:t,secondaryActionIcon:n,primaryActionAriaLabel:a,secondaryActionAriaLabel:s,expandLabel:c,collapseLabel:d,onRename:C,renameLabel:T,renderItemTitle:g})=>Object.values({actionsPosition:r,onPrimaryAction:o,onSecondaryAction:e,primaryActionIcon:t,secondaryActionIcon:n,primaryActionAriaLabel:a,secondaryActionAriaLabel:s,expandLabel:c,collapseLabel:d,onRename:C,renameLabel:T,renderItemTitle:g});var Dt="_10dw1p96",It="_10dw1p95",Ct=a$d({defaultClassName:"_10dw1p90 _1yep5z63o _1yep5z63p _1yep5z63q _1yep5z61c _1yep5z61d _1yep5z61e _1yep5z6j8 _1yep5z6j9 _1yep5z6ja _1yep5z6jh _1yep5z6ji _1yep5z6jj _1yep5z69f _1yep5z69g _1yep5z69h _1yep5z6jz _1yep5z6k0 _1yep5z6k1 _1yep5z6m6 _1yep5z6lt _1yep5z6lq",variantClassNames:{isSelected:{true:"_1yep5z612u"},isHovered:{true:"_10dw1p92"},isRenaming:{true:"_10dw1p93"},isFocusVisible:{true:"_1yep5z614w _1yep5z618s _1yep5z618q _1yep5z618t"}},defaultVariants:{},compoundVariants:[[{isHovered:true,isSelected:false,isRenaming:false},"_1yep5z61pc _1yep5z61rl _1yep5z61va _1yep5z61v9 _1yep5z61vd"]]});function St(r,o){if(typeof r=="function"&&!r.prototype?.isReactComponent){let e=r(o);return isValidElement(e)?r:e}return r}var Se=({item:r,...o})=>{let{onPrimaryAction:e,onSecondaryAction:t,actionsPosition:n,primaryActionIcon:a,secondaryActionIcon:s,primaryActionAriaLabel:c,secondaryActionAriaLabel:d,expandLabel:C,collapseLabel:T,onRename:g,renameLabel:u,renderItemTitle:b}=o,{formatMessage:m}=b$7(),{renamingKey:I,setRenamingKey:f}=useContext(Ee),y=I===r.id,x=!!r.children?.length,v=r.icon,K=!!g,R=useRef(false),M=useMemo(()=>{let i=St(a,r.id),h=St(s,r.id),l=typeof c=="function"?c(r.id):c,H=typeof d=="function"?d(r.id):d;return i||h?jsxs(a$h,{display:"flex",flexDirection:"row",children:[i?jsx(a$i,{icon:i,"aria-label":l,size:"sm",excludeFromTabOrder:true,variant:"secondary",onPress:()=>{e?.(r.id);},tooltip:true}):null,h?jsx(a$i,{icon:h,"aria-label":H,size:"sm",excludeFromTabOrder:true,variant:"secondary",onPress:()=>{t?.(r.id);},tooltip:true}):null]}):null},[a,r.id,s,c,d,e,t]),w=useCallback(i=>{i.key==="Enter"?(R.current=true,g?.({key:r.id,value:i.target.value}),f(null)):i.key==="Escape"&&(R.current=true,f(null));},[r.id,g,f]),P=useCallback(()=>b?b(r):r.label,[b,r]);return jsxs(Re,{id:r.id,textValue:r.label,"data-key":r.id,className:i=>a$e(It,Ct({isHovered:i.isHovered,isSelected:i.isSelected,isFocusVisible:i.isFocusVisible,isRenaming:y}),"BaselineUI-TreeView-Row"),style:{justifyContent:n==="end"?"space-between":void 0},children:[jsx(Ce,{children:i=>{let h=i.level-1;return jsxs(Fragment,{children:[n==="start"?M:null,jsxs(a$h,{display:"flex",flexDirection:"row",alignItems:"center",children:[jsxs(a$h,{display:"flex",padding:"sm",flexDirection:"row",alignItems:"center",gap:"md",style:{marginInlineStart:`calc(${h*2} * ${themeVars.spacing.lg})`},children:[jsx(a$j,{icon:ChevronRightIcon,size:"xxs",variant:"secondary",onPress:()=>{i.state.toggleKey(i.id);},"aria-label":i.isExpanded?T??m(we.collapse):C??m(we.expand),style:{visibility:x?"visible":"hidden"},className:a$e(Dt,"BaselineUI-TreeView-ExpansionToggle")}),v?jsx(v,{size:16,style:{color:themeVars.color.icon.interactive.disabled}}):null]}),jsxs(a$h,{paddingLeft:"sm",paddingY:y?"none":"md",display:"flex",flexDirection:"column",gap:"xs",onDoubleClick:l=>{K&&(l.stopPropagation(),l.preventDefault(),f(r.id));},children:[y?jsx("div",{onClick:l=>{l.stopPropagation();},children:jsx(a$k,{defaultValue:r.label,autoFocus:true,onBlur:l=>{if(R.current){R.current=false;return}g?.({key:r.id,value:l.target.value}),f(null);},"aria-label":u??m(we.rename),onKeyDown:w,className:"BaselineUI-TreeView-RenameInput"})}):jsx(a$l,{type:"label",size:"sm",className:a$e(sprinkles.compoundVariants({color:"text.primary"}),"BaselineUI-TreeView-Title"),children:P()}),r.description?jsx(a$l,{type:"helper",size:"sm",className:"BaselineUI-TreeView-Description",children:r.description}):null]})]}),n==="end"?M:null]})}}),jsx(l,{items:r.children,children:i=>jsx(Se,{item:i,...o})})]})},we=c$3({expand:{id:"bui.treeView.expand",defaultMessage:"Expand"},collapse:{id:"bui.treeView.collapse",defaultMessage:"Collapse"},rename:{id:"bui.treeView.rename",defaultMessage:"Rename"}});var Ee=createContext({renamingKey:null,setRenamingKey:()=>{}}),Et=Kt.forwardRef(({className:r,style:o,"data-block-id":e,"data-block-class":t,items:n,onPrimaryAction:a,onSecondaryAction:s,primaryActionIcon:c,secondaryActionIcon:d,primaryActionAriaLabel:C,secondaryActionAriaLabel:T,actionsPosition:g="start",expandLabel:u,collapseLabel:b,onRename:m,renameLabel:I,onAction:f,renderItemTitle:y,...x},v)=>{let K=useRef(null),[R,M]=useState(null);useEffect(()=>{let i=K.current;if(!i||!m)return;let h=l=>{if(l.key==="F2"){let S=i.querySelector("[data-focused='true']")?.dataset.key;S&&(l.preventDefault(),l.stopPropagation(),M(S));}};return i.addEventListener("keydown",h),()=>{i.removeEventListener("keydown",h);}},[m]);let w=useMemo(()=>({renamingKey:R,setRenamingKey:M}),[R]),P={actionsPosition:g,onPrimaryAction:a,onSecondaryAction:s,primaryActionIcon:c,secondaryActionIcon:d,primaryActionAriaLabel:C,secondaryActionAriaLabel:T,expandLabel:u,collapseLabel:b,onRename:m,renameLabel:I,renderItemTitle:y};return jsx(Ee.Provider,{value:w,children:jsx(Ie,{ref:b$4(v,K),items:n.children||[],selectionMode:"multiple",expandedKeys:x.expandedKeys,defaultExpandedKeys:x.defaultExpandedKeys,onExpandedChange:x.onExpandedChange,selectedKeys:x.selectedKeys,onAction:f,"aria-label":x["aria-label"],"aria-labelledby":x["aria-labelledby"],"data-block-id":e,"data-block-class":t,style:o,className:a$e(r,"BaselineUI-TreeView"),dependencies:ht(P),children:i=>jsx(Se,{item:i,...P})})})});Et.displayName="TreeView";export{Et as a};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {b}from'./chunk-N2XGJKZG.mjs';import {b as b$2}from'./chunk-HONWMHMX.mjs';import {
|
|
1
|
+
import {b}from'./chunk-N2XGJKZG.mjs';import {b as b$2}from'./chunk-HONWMHMX.mjs';import {e as e$1}from'./chunk-SHJ2TJYG.mjs';import {a as a$2}from'./chunk-2VY4FAOY.mjs';import {i}from'./chunk-MRJFGHFW.mjs';import {a as a$1}from'./chunk-JDLUGVXG.mjs';import {a,f,b as b$1,e}from'./chunk-AUOQSTS5.mjs';import {useState,useRef,useEffect,useCallback}from'react';/**
|
|
2
2
|
* Copyright (c) 2023-2024 PSPDFKit GmbH. All rights reserved.
|
|
3
3
|
*
|
|
4
4
|
* THIS SOURCE CODE AND ANY ACCOMPANYING DOCUMENTATION ARE PROTECTED BY INTERNATIONAL COPYRIGHT LAW
|
|
@@ -7,4 +7,4 @@ import {b}from'./chunk-N2XGJKZG.mjs';import {b as b$2}from'./chunk-HONWMHMX.mjs'
|
|
|
7
7
|
* This notice may not be removed from this file.
|
|
8
8
|
*
|
|
9
9
|
*/
|
|
10
|
-
var $=1e7;function dt(t,e,l){let o=st(e.body,l);return t==="left"?{...o,left:-$/2,width:$,totalWidth:$,scroll:{...o.scroll,left:0}}:{...o,top:-$/2,height:$,totalHeight:$,scroll:{...o.scroll,top:0}}}var F={top:"top",bottom:"top",left:"left",right:"left"},G={top:"bottom",bottom:"top",left:"right",right:"left"},Ct={top:"left",left:"top"},it={top:"height",left:"width"},Et={width:"totalWidth",height:"totalHeight"},J={};function Ot(t){let e=b$1(t);return typeof e<"u"&&e.visualViewport?e.visualViewport:null}function st(t,e){let l=a(t),o=0,n=0,s=0,i$1=0,c=0,u=0,r={},a$1=(e?.scale??1)>1;if(t.tagName==="BODY"||t.tagName==="HTML"){let h=l.documentElement;s=h.clientWidth,i$1=h.clientHeight,o=e?.width??s,n=e?.height??i$1,r.top=h.scrollTop||t.scrollTop,r.left=h.scrollLeft||t.scrollLeft,e&&(c=e.offsetTop,u=e.offsetLeft);}else (({width:o,height:n,top:c,left:u}=Z(t,false))),r.top=t.scrollTop,r.left=t.scrollLeft,s=o,i$1=n;return i()&&(t.tagName==="BODY"||t.tagName==="HTML")&&a$1&&(r.top=0,r.left=0,c=e?.pageTop??0,u=e?.pageLeft??0),{width:o,height:n,totalWidth:s,totalHeight:i$1,scroll:r,top:c,left:u}}function Mt(t){return {top:t.scrollTop,left:t.scrollLeft,width:t.scrollWidth,height:t.scrollHeight}}function Q(t,e,l,o,n,s,i){let c=n.scroll[t]??0,u=o[it[t]],r=i[t]+o.scroll[F[t]]+s,a=i[t]+o.scroll[F[t]]+u-s,h=e-c+o.scroll[F[t]]+i[t]-o[F[t]],d=e-c+l+o.scroll[F[t]]+i[t]-o[F[t]];return h<r?r-h:d>a?Math.max(a-d,r-h):0}function It(t){let l=b$1(t).getComputedStyle(t);return {top:parseInt(l.marginTop,10)||0,bottom:parseInt(l.marginBottom,10)||0,left:parseInt(l.marginLeft,10)||0,right:parseInt(l.marginRight,10)||0}}function rt(t){if(J[t])return J[t];let[e,l]=t.split(" "),o=F[e]||"right",n=Ct[o];F[l]||(l="center");let s=it[o],i=it[n];return J[t]={placement:e,crossPlacement:l,axis:o,crossAxis:n,size:s,crossSize:i},J[t]}function tt(t,e,l,o,n,s,i,c,u,r,a){let{placement:h,crossPlacement:d,axis:y,crossAxis:f,size:H,crossSize:w}=o,b={};b[f]=t[f]??0,d==="center"?b[f]+=((t[w]??0)-(l[w]??0))/2:d!==f&&(b[f]+=(t[w]??0)-(l[w]??0)),b[f]+=s;let E=t[f]-l[w]+u+r,L=t[f]+t[w]-u-r;if(b[f]=a$3(b[f],E,L),h===y){let W=c?a[H]:a[Et[H]];b[G[y]]=Math.floor(W-t[y]+n);}else b[y]=Math.floor(t[y]+t[H]+n);return b}function vt(t,e,l,o,n,s,i,c,u,r,a){let h=(t.top!=null?t.top:u[Et.height]-(t.bottom??0)-i)-(u.scroll.top??0),d=r?l.top:0,y={top:Math.max(e.top+d,(a?.offsetTop??e.top)+d),bottom:Math.min(e.top+e.height+d,(a?.offsetTop??0)+(a?.height??0))};return c!=="top"?Math.max(0,y.bottom-h-((n.top??0)+(n.bottom??0)+s)):Math.max(0,h+i-y.top-((n.top??0)+(n.bottom??0)+s))}function Pt(t,e,l,o,n,s,i,c){let{placement:u,axis:r,size:a}=s;return u===r?Math.max(0,l[r]-(i.scroll[r]??0)-(t[r]+(c?e[r]:0))-(o[r]??0)-o[G[r]]-n):Math.max(0,t[a]+t[r]+(c?e[r]:0)-l[r]-l[a]+(i.scroll[r]??0)-(o[r]??0)-o[G[r]]-n)}function St(t,e,l,o,n,s,i,c,u,r,a,h,d,y,f,H,w,b,E,L,W,_){let m=rt(t),{size:A,crossAxis:p,crossSize:R,placement:M,crossPlacement:T}=m,P=tt(e,c,l,m,a,h,r,d,f,H,u),S=a,k=E?$:Pt(c,r,e,n,s+a,m,u,w);if(i&&l[A]>k){let j=rt(`${G[M]} ${T}`),X=tt(e,c,l,j,a,h,r,d,f,H,u);Pt(c,r,e,n,s+a,j,u,w)>k&&(m=j,P=X,S=a);}if(_==="anchor"&&L&&(m.placement==="top"||m.placement==="bottom")){let j=E?0:Q(p,P[p],l[R],c,u,s,r);if(j!==0){let X=m.crossPlacement==="center"?j>0?"left":"right":G[m.crossPlacement];if(X){let lt=rt(`${m.placement} ${X}`),pt=tt(e,c,l,lt,a,h,r,d,f,H,u),Lt=E?0:Q(p,pt[p],l[R],c,u,s,r);Math.abs(Lt)<Math.abs(j)&&(m=lt,P=pt);}}}let I="bottom";m.axis==="top"?m.placement==="top"?I="top":m.placement==="bottom"&&(I="bottom"):m.crossAxis==="top"&&(m.crossPlacement==="top"?I="bottom":m.crossPlacement==="bottom"&&(I="top"));let V=_==="anchor"&&L&&(m.placement==="top"||m.placement==="bottom")&&m.crossPlacement!=="center",z=V||E?0:Q(p,P[p],l[R],c,u,s,r);P[p]+=z;let x=E||!W?void 0:vt(P,c,r,d,n,s,l.height,I,u,w,b);y&&(x==null||y<x)&&(x=y),l.height=x!=null?Math.min(l.height,x):l.height,P=tt(e,c,l,m,S,h,r,d,f,H,u),z=V||E?0:Q(p,P[p],l[R],c,u,s,r),P[p]+=z;let v={},g=e[p]-P[p]-n[F[p]],C=g+.5*e[R],D=f/2+H,B=F[p]==="left"?(n.left??0)+(n.right??0):(n.top??0)+(n.bottom??0),N=l[R]-B-f/2-H,ot=e[p]+f/2-(P[p]+n[F[p]]),Tt=e[p]+e[R]-f/2-(P[p]+n[F[p]]),yt=a$3(C,ot,Tt);v[p]=a$3(yt,D,N),{placement:M,crossPlacement:T}=m,f?g=v[p]:T==="right"?g+=e[R]:T==="center"&&(g+=e[R]/2);let at=M==="left"||M==="top"?l[A]:0,Ht={x:M==="top"||M==="bottom"?g:at,y:M==="left"||M==="right"?g:at};return {position:P,maxHeight:x,arrowOffsetLeft:v.left,arrowOffsetTop:v.top,placement:M,triggerAnchorPoint:Ht}}function At(t){let{placement:e$1,targetNode:l,overlayNode:o,scrollNode:n,padding:s,shouldFlip:i,boundaryElement:c,boundaryAxis:u="both",horizontalBoundaryBehavior:r="shift",offset:a$1,crossOffset:h,maxHeight:d,arrowSize:y=0,arrowBoundaryOffset:f=0,targetRect:H}=t,w=a(o),b=b$1(o),E=Ot(o),L=o instanceof b.HTMLElement?zt(o):w.documentElement,W=L===w.documentElement,_=b.getComputedStyle(L).position,m=!!_&&_!=="static",A=W?Z(l,false,H):xt(l,L,false,H);if(!W){let{marginTop:D,marginLeft:B}=b.getComputedStyle(l);A.top+=parseInt(D,10)||0,A.left+=parseInt(B,10)||0;}let p=Z(o,true),R=It(o);p.width+=(R.left??0)+(R.right??0),p.height+=(R.top??0)+(R.bottom??0);let M=Mt(n),T=c===null,P=c??w.body,S=!T&&u!=="vertical",k=!T&&u!=="horizontal",I=st(P,E),V=S?I:dt("left",w,E),z=k?I:dt("top",w,E),x={...z,left:V.left,width:V.width,totalWidth:V.totalWidth,scroll:{top:z.scroll.top,left:V.scroll.left}},v=st(L,E);m&&!W&&(x.top-=v.top,x.left-=v.left,v.top=0,v.left=0);let g=T?{top:0,left:0,width:0,height:0}:xt(P,L,false),C=!T&&e(P,L)&&L!==P;return St(e$1,A,p,M,R,s,i,x,v,g,a$1,h,m,d,y,f,C,E,T,S,k,r)}function et(t,e){let l=b$1(t),{top:o,left:n,width:s,height:i}=t.getBoundingClientRect();return e&&t instanceof l.HTMLElement&&(s=t.offsetWidth,i=t.offsetHeight),{top:o,left:n,width:s,height:i}}function Z(t,e,l){let o=a(t),{top:n,left:s,width:i,height:c}=l||et(t,e),{scrollTop:u,scrollLeft:r,clientTop:a$1,clientLeft:h}=o.documentElement;return {top:n+u-a$1,left:s+r-h,width:i,height:c}}function xt(t,e,l,o){let n=b$1(t),s=n.getComputedStyle(t),i;if(s.position==="fixed")i=o||et(t,l);else {i=Z(t,l,o);let c=Z(e,l),u=n.getComputedStyle(e);c.top+=(parseInt(u.borderTopWidth,10)||0)-e.scrollTop,c.left+=(parseInt(u.borderLeftWidth,10)||0)-e.scrollLeft,i.top-=c.top,i.left-=c.left;}return i.top-=parseInt(s.marginTop,10)||0,i.left-=parseInt(s.marginLeft,10)||0,i}function zt(t){let e=a(t),l=b$1(t),o=t.offsetParent;if(o&&o===e.body&&l.getComputedStyle(o).position==="static"&&!wt(o)&&(o=e.documentElement),o==null)for(o=t.parentElement;o&&!wt(o);)o=o.parentElement;return o||e.documentElement}function wt(t){let l=b$1(t).getComputedStyle(t);return l.transform!=="none"||/transform|perspective/.test(l.willChange)||l.filter!=="none"||l.contain==="paint"||"backdropFilter"in l&&l.backdropFilter!=="none"||"WebkitBackdropFilter"in l&&l.WebkitBackdropFilter!=="none"}function mt(t){return typeof document>"u"?null:b$1(t).visualViewport??null}function te(t){let{direction:e$1}=b(),{arrowSize:l,targetRef:o,overlayRef:n,arrowRef:s,scrollRef:i=n,placement:c="bottom",containerPadding:u=12,shouldFlip:r=true,boundaryElement:a$3,boundaryAxis:h="both",horizontalBoundaryBehavior:d="shift",offset:y=0,crossOffset:f$1=0,shouldUpdatePosition:H=true,shouldCloseOnScroll:w=true,isOpen:b$3=true,onClose:E,maxHeight:L,arrowBoundaryOffset:W=0,getTargetRect:_}=t,m=a$3??(typeof document<"u"?o.current?.ownerDocument.body??n.current?.ownerDocument.body??document.body:void 0),[A,p]=useState(null),R=[H,c,n.current,o.current,s?.current,i.current,u,r,m,h,d,y,f$1,b$3,e$1,L,W,l],M=useRef(mt(n.current)?.scale);useEffect(()=>{b$3&&(M.current=mt(n.current)?.scale);},[b$3,n]);let T=useCallback(()=>{if(H===false||!b$3||!n.current||!o.current||m===void 0||mt(n.current)?.scale!==M.current)return;let z=a(n.current),x=f(z),v=b$1(z.body),g=null;if(i.current&&e(i.current,x)){let B=x?.getBoundingClientRect(),N=i.current.getBoundingClientRect();g={type:"top",offset:(B?.top??0)-N.top},g.offset>N.height/2&&(g.type="bottom",g.offset=(B?.bottom??0)-N.bottom);}let C=n.current;!L&&n.current&&(C.style.top="0px",C.style.bottom="",C.style.maxHeight=(v.visualViewport?.height??v.innerHeight)+"px");let D=At({placement:Wt(c,e$1),overlayNode:n.current,targetNode:o.current,scrollNode:i.current||n.current,padding:u,shouldFlip:r,boundaryElement:m,boundaryAxis:h,horizontalBoundaryBehavior:d,offset:y,crossOffset:f$1,maxHeight:L,arrowSize:l??(s?.current?et(s.current,true).width:0),arrowBoundaryOffset:W,targetRect:_?.(o.current)});if(D.position){if(C.style.top="",C.style.bottom="",C.style.left="",C.style.right="",Object.keys(D.position).forEach(B=>C.style[B]=D.position[B]+"px"),C.style.maxHeight=D.maxHeight!=null?D.maxHeight+"px":"",g&&x&&i.current){let B=x.getBoundingClientRect(),N=i.current.getBoundingClientRect(),ot=B[g.type]-N[g.type];i.current.scrollTop+=ot-g.offset;}p(D);}},R);a$1(T,R);let P=m?b$1(m):o.current?b$1(o.current):n.current?b$1(n.current):void 0;Bt(T,P);let S=useRef(null),k=useCallback(()=>{S.current!==null&&cancelAnimationFrame(S.current),S.current=requestAnimationFrame(()=>{S.current=null,T();});},[T]);useEffect(()=>()=>{S.current!==null&&cancelAnimationFrame(S.current);},[]),a$2({ref:n,onResize:k}),a$2({ref:o,onResize:k});let I=useRef(false);a$1(()=>{let z,x=()=>{I.current=true,clearTimeout(z),z=setTimeout(()=>{I.current=false;},500),T();},g=b$1(n.current).visualViewport,C=()=>{I.current&&x();};return g?.addEventListener("resize",x),g?.addEventListener("scroll",C),()=>{g?.removeEventListener("resize",x),g?.removeEventListener("scroll",C);}},[T]);let V=useCallback(()=>{I.current||E?.();},[E,I]);return b$2({triggerRef:o,isOpen:b$3,onClose:w?E&&V:null}),{overlayProps:{style:{position:A?"absolute":"fixed",top:A?void 0:0,left:A?void 0:0,zIndex:1e5,...A?.position,maxHeight:A==null?"100vh":A.maxHeight!=null?`${A.maxHeight}px`:""}},placement:A?.placement??null,triggerAnchorPoint:A?.triggerAnchorPoint??null,arrowProps:{"aria-hidden":"true",role:"presentation",style:{left:A?.arrowOffsetLeft,top:A?.arrowOffsetTop}},updatePosition:T}}function Bt(t,e=window){a$1(()=>(e?.addEventListener("resize",t,false),()=>{e?.removeEventListener("resize",t,false);}),[t,e]);}function Wt(t,e){return e==="rtl"?t.replace("start","right").replace("end","left"):t.replace("start","left").replace("end","right")}export{te as a};
|
|
10
|
+
var $=1e7;function dt(t,e,l){let o=st(e.body,l);return t==="left"?{...o,left:-$/2,width:$,totalWidth:$,scroll:{...o.scroll,left:0}}:{...o,top:-$/2,height:$,totalHeight:$,scroll:{...o.scroll,top:0}}}var F={top:"top",bottom:"top",left:"left",right:"left"},G={top:"bottom",bottom:"top",left:"right",right:"left"},Ct={top:"left",left:"top"},it={top:"height",left:"width"},Et={width:"totalWidth",height:"totalHeight"},J={};function Ot(t){let e=b$1(t);return typeof e<"u"&&e.visualViewport?e.visualViewport:null}function st(t,e){let l=a(t),o=0,n=0,s=0,i$1=0,c=0,u=0,r={},a$1=(e?.scale??1)>1;if(t.tagName==="BODY"||t.tagName==="HTML"){let h=l.documentElement;s=h.clientWidth,i$1=h.clientHeight,o=e?.width??s,n=e?.height??i$1,r.top=h.scrollTop||t.scrollTop,r.left=h.scrollLeft||t.scrollLeft,e&&(c=e.offsetTop,u=e.offsetLeft);}else (({width:o,height:n,top:c,left:u}=Z(t,false))),r.top=t.scrollTop,r.left=t.scrollLeft,s=o,i$1=n;return i()&&(t.tagName==="BODY"||t.tagName==="HTML")&&a$1&&(r.top=0,r.left=0,c=e?.pageTop??0,u=e?.pageLeft??0),{width:o,height:n,totalWidth:s,totalHeight:i$1,scroll:r,top:c,left:u}}function Mt(t){return {top:t.scrollTop,left:t.scrollLeft,width:t.scrollWidth,height:t.scrollHeight}}function Q(t,e,l,o,n,s,i){let c=n.scroll[t]??0,u=o[it[t]],r=i[t]+o.scroll[F[t]]+s,a=i[t]+o.scroll[F[t]]+u-s,h=e-c+o.scroll[F[t]]+i[t]-o[F[t]],d=e-c+l+o.scroll[F[t]]+i[t]-o[F[t]];return h<r?r-h:d>a?Math.max(a-d,r-h):0}function It(t){let l=b$1(t).getComputedStyle(t);return {top:parseInt(l.marginTop,10)||0,bottom:parseInt(l.marginBottom,10)||0,left:parseInt(l.marginLeft,10)||0,right:parseInt(l.marginRight,10)||0}}function rt(t){if(J[t])return J[t];let[e,l]=t.split(" "),o=F[e]||"right",n=Ct[o];F[l]||(l="center");let s=it[o],i=it[n];return J[t]={placement:e,crossPlacement:l,axis:o,crossAxis:n,size:s,crossSize:i},J[t]}function tt(t,e,l,o,n,s,i,c,u,r,a){let{placement:h,crossPlacement:d,axis:y,crossAxis:f,size:H,crossSize:w}=o,b={};b[f]=t[f]??0,d==="center"?b[f]+=((t[w]??0)-(l[w]??0))/2:d!==f&&(b[f]+=(t[w]??0)-(l[w]??0)),b[f]+=s;let E=t[f]-l[w]+u+r,L=t[f]+t[w]-u-r;if(b[f]=a$2(b[f],E,L),h===y){let W=c?a[H]:a[Et[H]];b[G[y]]=Math.floor(W-t[y]+n);}else b[y]=Math.floor(t[y]+t[H]+n);return b}function vt(t,e,l,o,n,s,i,c,u,r,a){let h=(t.top!=null?t.top:u[Et.height]-(t.bottom??0)-i)-(u.scroll.top??0),d=r?l.top:0,y={top:Math.max(e.top+d,(a?.offsetTop??e.top)+d),bottom:Math.min(e.top+e.height+d,(a?.offsetTop??0)+(a?.height??0))};return c!=="top"?Math.max(0,y.bottom-h-((n.top??0)+(n.bottom??0)+s)):Math.max(0,h+i-y.top-((n.top??0)+(n.bottom??0)+s))}function Pt(t,e,l,o,n,s,i,c){let{placement:u,axis:r,size:a}=s;return u===r?Math.max(0,l[r]-(i.scroll[r]??0)-(t[r]+(c?e[r]:0))-(o[r]??0)-o[G[r]]-n):Math.max(0,t[a]+t[r]+(c?e[r]:0)-l[r]-l[a]+(i.scroll[r]??0)-(o[r]??0)-o[G[r]]-n)}function St(t,e,l,o,n,s,i,c,u,r,a,h,d,y,f,H,w,b,E,L,W,_){let m=rt(t),{size:A,crossAxis:p,crossSize:R,placement:M,crossPlacement:T}=m,P=tt(e,c,l,m,a,h,r,d,f,H,u),S=a,k=E?$:Pt(c,r,e,n,s+a,m,u,w);if(i&&l[A]>k){let j=rt(`${G[M]} ${T}`),X=tt(e,c,l,j,a,h,r,d,f,H,u);Pt(c,r,e,n,s+a,j,u,w)>k&&(m=j,P=X,S=a);}if(_==="anchor"&&L&&(m.placement==="top"||m.placement==="bottom")){let j=E?0:Q(p,P[p],l[R],c,u,s,r);if(j!==0){let X=m.crossPlacement==="center"?j>0?"left":"right":G[m.crossPlacement];if(X){let lt=rt(`${m.placement} ${X}`),pt=tt(e,c,l,lt,a,h,r,d,f,H,u),Lt=E?0:Q(p,pt[p],l[R],c,u,s,r);Math.abs(Lt)<Math.abs(j)&&(m=lt,P=pt);}}}let I="bottom";m.axis==="top"?m.placement==="top"?I="top":m.placement==="bottom"&&(I="bottom"):m.crossAxis==="top"&&(m.crossPlacement==="top"?I="bottom":m.crossPlacement==="bottom"&&(I="top"));let V=_==="anchor"&&L&&(m.placement==="top"||m.placement==="bottom")&&m.crossPlacement!=="center",z=V||E?0:Q(p,P[p],l[R],c,u,s,r);P[p]+=z;let x=E||!W?void 0:vt(P,c,r,d,n,s,l.height,I,u,w,b);y&&(x==null||y<x)&&(x=y),l.height=x!=null?Math.min(l.height,x):l.height,P=tt(e,c,l,m,S,h,r,d,f,H,u),z=V||E?0:Q(p,P[p],l[R],c,u,s,r),P[p]+=z;let v={},g=e[p]-P[p]-n[F[p]],C=g+.5*e[R],D=f/2+H,B=F[p]==="left"?(n.left??0)+(n.right??0):(n.top??0)+(n.bottom??0),N=l[R]-B-f/2-H,ot=e[p]+f/2-(P[p]+n[F[p]]),Tt=e[p]+e[R]-f/2-(P[p]+n[F[p]]),yt=a$2(C,ot,Tt);v[p]=a$2(yt,D,N),{placement:M,crossPlacement:T}=m,f?g=v[p]:T==="right"?g+=e[R]:T==="center"&&(g+=e[R]/2);let at=M==="left"||M==="top"?l[A]:0,Ht={x:M==="top"||M==="bottom"?g:at,y:M==="left"||M==="right"?g:at};return {position:P,maxHeight:x,arrowOffsetLeft:v.left,arrowOffsetTop:v.top,placement:M,triggerAnchorPoint:Ht}}function At(t){let{placement:e$1,targetNode:l,overlayNode:o,scrollNode:n,padding:s,shouldFlip:i,boundaryElement:c,boundaryAxis:u="both",horizontalBoundaryBehavior:r="shift",offset:a$1,crossOffset:h,maxHeight:d,arrowSize:y=0,arrowBoundaryOffset:f=0,targetRect:H}=t,w=a(o),b=b$1(o),E=Ot(o),L=o instanceof b.HTMLElement?zt(o):w.documentElement,W=L===w.documentElement,_=b.getComputedStyle(L).position,m=!!_&&_!=="static",A=W?Z(l,false,H):xt(l,L,false,H);if(!W){let{marginTop:D,marginLeft:B}=b.getComputedStyle(l);A.top+=parseInt(D,10)||0,A.left+=parseInt(B,10)||0;}let p=Z(o,true),R=It(o);p.width+=(R.left??0)+(R.right??0),p.height+=(R.top??0)+(R.bottom??0);let M=Mt(n),T=c===null,P=c??w.body,S=!T&&u!=="vertical",k=!T&&u!=="horizontal",I=st(P,E),V=S?I:dt("left",w,E),z=k?I:dt("top",w,E),x={...z,left:V.left,width:V.width,totalWidth:V.totalWidth,scroll:{top:z.scroll.top,left:V.scroll.left}},v=st(L,E);m&&!W&&(x.top-=v.top,x.left-=v.left,v.top=0,v.left=0);let g=T?{top:0,left:0,width:0,height:0}:xt(P,L,false),C=!T&&e(P,L)&&L!==P;return St(e$1,A,p,M,R,s,i,x,v,g,a$1,h,m,d,y,f,C,E,T,S,k,r)}function et(t,e){let l=b$1(t),{top:o,left:n,width:s,height:i}=t.getBoundingClientRect();return e&&t instanceof l.HTMLElement&&(s=t.offsetWidth,i=t.offsetHeight),{top:o,left:n,width:s,height:i}}function Z(t,e,l){let o=a(t),{top:n,left:s,width:i,height:c}=l||et(t,e),{scrollTop:u,scrollLeft:r,clientTop:a$1,clientLeft:h}=o.documentElement;return {top:n+u-a$1,left:s+r-h,width:i,height:c}}function xt(t,e,l,o){let n=b$1(t),s=n.getComputedStyle(t),i;if(s.position==="fixed")i=o||et(t,l);else {i=Z(t,l,o);let c=Z(e,l),u=n.getComputedStyle(e);c.top+=(parseInt(u.borderTopWidth,10)||0)-e.scrollTop,c.left+=(parseInt(u.borderLeftWidth,10)||0)-e.scrollLeft,i.top-=c.top,i.left-=c.left;}return i.top-=parseInt(s.marginTop,10)||0,i.left-=parseInt(s.marginLeft,10)||0,i}function zt(t){let e=a(t),l=b$1(t),o=t.offsetParent;if(o&&o===e.body&&l.getComputedStyle(o).position==="static"&&!wt(o)&&(o=e.documentElement),o==null)for(o=t.parentElement;o&&!wt(o);)o=o.parentElement;return o||e.documentElement}function wt(t){let l=b$1(t).getComputedStyle(t);return l.transform!=="none"||/transform|perspective/.test(l.willChange)||l.filter!=="none"||l.contain==="paint"||"backdropFilter"in l&&l.backdropFilter!=="none"||"WebkitBackdropFilter"in l&&l.WebkitBackdropFilter!=="none"}function mt(t){return typeof document>"u"?null:b$1(t).visualViewport??null}function te(t){let{direction:e$2}=b(),{arrowSize:l,targetRef:o,overlayRef:n,arrowRef:s,scrollRef:i=n,placement:c="bottom",containerPadding:u=12,shouldFlip:r=true,boundaryElement:a$2,boundaryAxis:h="both",horizontalBoundaryBehavior:d="shift",offset:y=0,crossOffset:f$1=0,shouldUpdatePosition:H=true,shouldCloseOnScroll:w=true,isOpen:b$3=true,onClose:E,maxHeight:L,arrowBoundaryOffset:W=0,getTargetRect:_}=t,m=a$2??(typeof document<"u"?o.current?.ownerDocument.body??n.current?.ownerDocument.body??document.body:void 0),[A,p]=useState(null),R=[H,c,n.current,o.current,s?.current,i.current,u,r,m,h,d,y,f$1,b$3,e$2,L,W,l],M=useRef(mt(n.current)?.scale);useEffect(()=>{b$3&&(M.current=mt(n.current)?.scale);},[b$3,n]);let T=useCallback(()=>{if(H===false||!b$3||!n.current||!o.current||m===void 0||mt(n.current)?.scale!==M.current)return;let z=a(n.current),x=f(z),v=b$1(z.body),g=null;if(i.current&&e(i.current,x)){let B=x?.getBoundingClientRect(),N=i.current.getBoundingClientRect();g={type:"top",offset:(B?.top??0)-N.top},g.offset>N.height/2&&(g.type="bottom",g.offset=(B?.bottom??0)-N.bottom);}let C=n.current;!L&&n.current&&(C.style.top="0px",C.style.bottom="",C.style.maxHeight=(v.visualViewport?.height??v.innerHeight)+"px");let D=At({placement:Wt(c,e$2),overlayNode:n.current,targetNode:o.current,scrollNode:i.current||n.current,padding:u,shouldFlip:r,boundaryElement:m,boundaryAxis:h,horizontalBoundaryBehavior:d,offset:y,crossOffset:f$1,maxHeight:L,arrowSize:l??(s?.current?et(s.current,true).width:0),arrowBoundaryOffset:W,targetRect:_?.(o.current)});if(D.position){if(C.style.top="",C.style.bottom="",C.style.left="",C.style.right="",Object.keys(D.position).forEach(B=>C.style[B]=D.position[B]+"px"),C.style.maxHeight=D.maxHeight!=null?D.maxHeight+"px":"",g&&x&&i.current){let B=x.getBoundingClientRect(),N=i.current.getBoundingClientRect(),ot=B[g.type]-N[g.type];i.current.scrollTop+=ot-g.offset;}p(D);}},R);a$1(T,R);let P=m?b$1(m):o.current?b$1(o.current):n.current?b$1(n.current):void 0;Bt(T,P);let S=useRef(null),k=useCallback(()=>{S.current!==null&&cancelAnimationFrame(S.current),S.current=requestAnimationFrame(()=>{S.current=null,T();});},[T]);useEffect(()=>()=>{S.current!==null&&cancelAnimationFrame(S.current);},[]),e$1({ref:n,onResize:k}),e$1({ref:o,onResize:k});let I=useRef(false);a$1(()=>{let z,x=()=>{I.current=true,clearTimeout(z),z=setTimeout(()=>{I.current=false;},500),T();},g=b$1(n.current).visualViewport,C=()=>{I.current&&x();};return g?.addEventListener("resize",x),g?.addEventListener("scroll",C),()=>{g?.removeEventListener("resize",x),g?.removeEventListener("scroll",C);}},[T]);let V=useCallback(()=>{I.current||E?.();},[E,I]);return b$2({triggerRef:o,isOpen:b$3,onClose:w?E&&V:null}),{overlayProps:{style:{position:A?"absolute":"fixed",top:A?void 0:0,left:A?void 0:0,zIndex:1e5,...A?.position,maxHeight:A==null?"100vh":A.maxHeight!=null?`${A.maxHeight}px`:""}},placement:A?.placement??null,triggerAnchorPoint:A?.triggerAnchorPoint??null,arrowProps:{"aria-hidden":"true",role:"presentation",style:{left:A?.arrowOffsetLeft,top:A?.arrowOffsetTop}},updatePosition:T}}function Bt(t,e=window){a$1(()=>(e?.addEventListener("resize",t,false),()=>{e?.removeEventListener("resize",t,false);}),[t,e]);}function Wt(t,e){return e==="rtl"?t.replace("start","right").replace("end","left"):t.replace("start","left").replace("end","right")}export{te as a};
|