@apple-pie/slice 0.1.60 → 0.2.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/README.md +17 -1
- package/dist/cjs/chunks/ActionButton-DhHiZwXV.js +200 -0
- package/dist/cjs/chunks/Attachment-DhyXAQUf.js +351 -0
- package/dist/cjs/chunks/AudioBubble-DS5Oea-b.js +46 -0
- package/dist/cjs/chunks/AudioLevel-uQJ-v5Qz.js +54 -0
- package/dist/cjs/chunks/Avatar-a2GHmu1o.js +125 -0
- package/dist/cjs/chunks/AvatarGroup-CWpoauJP.js +70 -0
- package/dist/cjs/chunks/Badge-DtVP2qH0.js +26 -0
- package/dist/cjs/chunks/Button-Cr5SlNim.js +293 -0
- package/dist/cjs/chunks/ButtonBar-DDupZZ_u.js +96 -0
- package/dist/cjs/chunks/Camera-bjjzmzar.js +560 -0
- package/dist/cjs/chunks/CheckBox-DBaKpMhg.js +66 -0
- package/dist/cjs/chunks/Chip-DsZHDLKG.js +203 -0
- package/dist/cjs/chunks/ContentEditable-BaxU62Mg.js +144 -0
- package/dist/cjs/chunks/DialogBox-C-ZvHDH6.js +204 -0
- package/dist/cjs/chunks/Dot-0Dv8WX0n.js +92 -0
- package/dist/cjs/chunks/DrggablePanel-zi27w3wY.js +251 -0
- package/dist/cjs/chunks/DropDown-BcTjhAtE.js +269 -0
- package/dist/cjs/chunks/ErrorSummary-DDz7nQWX.js +166 -0
- package/dist/cjs/chunks/{FileIcon-DctPd_KB.js → FileIcon-BM8n3o-c.js} +68 -40
- package/dist/cjs/chunks/FileList-T2_mhI_t.js +204 -0
- package/dist/cjs/chunks/FlexBox-DTCyWJeT.js +278 -0
- package/dist/cjs/chunks/FlexDiv-5YN9Hgxy.js +7 -0
- package/dist/cjs/chunks/Icon-COY7IZkK.js +7821 -0
- package/dist/cjs/chunks/IconButton-KJr15EW6.js +10 -0
- package/dist/cjs/chunks/{IndexedDB-Dn5mB5-k.js → IndexedDB-DwKh2Gfp.js} +1 -1
- package/dist/cjs/chunks/ModalController-D0S9VnNH.js +143 -0
- package/dist/cjs/chunks/ModalHostContext-DLgUa9Vl.js +5 -0
- package/dist/cjs/chunks/Overlay-CVZLmK8H.js +77 -0
- package/dist/cjs/chunks/Pager-QEUi0r59.js +146 -0
- package/dist/cjs/chunks/PopMenu-DkxhTcwD.js +423 -0
- package/dist/cjs/chunks/PopMenuController-CmS28S4h.js +32 -0
- package/dist/cjs/chunks/ProgressIndicator-Ddj5dfEA.js +237 -0
- package/dist/cjs/chunks/PromptInput-DtepCo-l.js +248 -0
- package/dist/cjs/chunks/RadioButton-B2HGjkQk.js +101 -0
- package/dist/cjs/chunks/RadioButtonList-Oc7oMivb.js +88 -0
- package/dist/cjs/chunks/Slider-Y7zMFKiM.js +170 -0
- package/dist/cjs/chunks/Spacer-CM7sstpQ.js +22 -0
- package/dist/cjs/chunks/Switch-CWJh4Pi4.js +70 -0
- package/dist/cjs/chunks/Tab-DFvjUNPs.js +96 -0
- package/dist/cjs/chunks/TabBar-lB0aqabp.js +186 -0
- package/dist/cjs/chunks/TextArea-UudvZQ9R.js +189 -0
- package/dist/cjs/chunks/TextField-QzgdqFys.js +312 -0
- package/dist/cjs/chunks/Tip-BxS2Wzz3.js +115 -0
- package/dist/cjs/chunks/ToggleButton-De8_kkMd.js +53 -0
- package/dist/cjs/chunks/UploadArea-BtqwFTDl.js +223 -0
- package/dist/cjs/chunks/Video-C1GATYS9.js +396 -0
- package/dist/cjs/chunks/VideoController-CnYz7Sdt.js +169 -0
- package/dist/cjs/chunks/{WSConnection-D5nSdN7z.js → WSConnection-DZKTeDtZ.js} +1 -1
- package/dist/cjs/chunks/{WebRTCConnection-CxMqLK-l.js → WebRTCConnection-DIUG7Gx3.js} +1 -1
- package/dist/cjs/chunks/_types-3m6769Z0.js +910 -0
- package/dist/cjs/chunks/_types-C_Jf14DZ.js +273 -0
- package/dist/cjs/chunks/audioVisualizer-Bak7PWOv.js +71 -0
- package/dist/cjs/chunks/breakpoints-BDw1OJh9.js +18 -0
- package/dist/cjs/chunks/{browserChannelsStore-CvkRtX7s.js → browserChannelsStore-DHE7Vr4_.js} +4 -2
- package/dist/cjs/chunks/colors-hDzzq_Dk.js +62 -0
- package/dist/cjs/chunks/files-RYD9L_pI.js +25 -0
- package/dist/cjs/chunks/getVideoControls-LxSY7z8h.js +19 -0
- package/dist/cjs/chunks/getWaterTransition-s_55VKK2.js +11 -0
- package/dist/cjs/chunks/{localDBStore-BYxZNIrv.js → localDBStore-CTWlm2t-.js} +6 -2
- package/dist/cjs/chunks/{microphoneStore-Dw-7f6Jb.js → microphoneStore-D7DuvQeX.js} +1 -1
- package/dist/cjs/chunks/{misc-B3tF47Um.js → misc-PmT7cZzC.js} +29 -38
- package/dist/cjs/chunks/{modalStore-BNeHu-nv.js → modalStore-BCn998Jz.js} +20 -17
- package/dist/cjs/chunks/popMenuStore-DqyTqDrl.js +20 -0
- package/dist/cjs/chunks/resolveColor-DkYThq2J.js +9 -0
- package/dist/cjs/chunks/resolveColorProps-DE1k1P-Z.js +17 -0
- package/dist/cjs/chunks/resolveShortcut-DiQdb8VR.js +38 -0
- package/dist/cjs/chunks/sharedTypes-BDMIewR9.js +22 -0
- package/dist/cjs/chunks/{sseStore-Dw-nvmmG.js → sseStore-DfS7e3vY.js} +3 -3
- package/dist/cjs/chunks/themes-bwU5x3_5.js +34 -0
- package/dist/cjs/chunks/toastStore-BxX1AtE7.js +33 -0
- package/dist/cjs/chunks/type.module-Dk5b_rHG.js +28 -0
- package/dist/cjs/chunks/{uploads-worker-BiugXTT6.js → uploads-worker-stCHn8-D.js} +1 -1
- package/dist/cjs/chunks/{uploadsStore-CxCy0NB7.js → uploadsStore-Ck3gzZuD.js} +2 -2
- package/dist/cjs/chunks/useAudioVisualizer-D7bStvIe.js +42 -0
- package/dist/cjs/chunks/useModalHost-B8oi4tfb.js +52 -0
- package/dist/cjs/chunks/usePrefersReducedMotion-GpD17CAE.js +16 -0
- package/dist/cjs/chunks/viewState-CMugA-g4.js +627 -0
- package/dist/cjs/chunks/{volumeStore-BQIMqtSw.js → volumeStore-BoEoo9wA.js} +1 -1
- package/dist/cjs/chunks/{webRTCStore-B8IKsBKT.js → webRTCStore-OGkXAovD.js} +6 -2
- package/dist/cjs/chunks/{windowStore-H9Jg7tnm.js → windowStore-HYnXbosz.js} +1 -1
- package/dist/cjs/components/Attachment/index.js +26 -0
- package/dist/cjs/components/AudioBubble/index.js +11 -8
- package/dist/cjs/components/AudioLevel/index.js +9 -0
- package/dist/cjs/components/Avatar/index.js +5 -3
- package/dist/cjs/components/AvatarGroup/index.js +4 -3
- package/dist/cjs/components/Badge/index.js +4 -3
- package/dist/cjs/components/Button/index.js +14 -11
- package/dist/cjs/components/ButtonBar/index.js +11 -9
- package/dist/cjs/components/Camera/index.js +15 -9
- package/dist/cjs/components/CheckBox/index.js +11 -10
- package/dist/cjs/components/Chip/index.js +13 -10
- package/dist/cjs/components/ContentEditable/index.js +8 -0
- package/dist/cjs/components/DataTable/index.js +12 -10
- package/dist/cjs/components/DialogBox/index.js +21 -0
- package/dist/cjs/components/Dot/index.js +8 -3
- package/dist/cjs/components/DraggablePanel/index.js +10 -10
- package/dist/cjs/components/DropDown/index.js +12 -10
- package/dist/cjs/components/ErrorSummary/index.js +10 -7
- package/dist/cjs/components/FileIcon/index.js +8 -9
- package/dist/cjs/components/FileList/index.js +16 -10
- package/dist/cjs/components/FlexBox/index.js +23 -0
- package/dist/cjs/components/FlexDiv/index.js +11 -5
- package/dist/cjs/components/Icon/index.js +8 -7
- package/dist/cjs/components/IconButton/index.js +15 -21
- package/dist/cjs/components/ModalController/index.js +11 -6
- package/dist/cjs/components/Overlay/index.js +9 -3
- package/dist/cjs/components/Pager/index.js +9 -3
- package/dist/cjs/components/PopMenu/index.js +17 -0
- package/dist/cjs/components/PopMenuController/index.js +18 -0
- package/dist/cjs/components/Progress/index.js +13 -10
- package/dist/cjs/components/PromptInput/index.js +19 -13
- package/dist/cjs/components/RadioButton/index.js +11 -10
- package/dist/cjs/components/RadioButtonList/index.js +12 -10
- package/dist/cjs/components/Slider/index.js +4 -8
- package/dist/cjs/components/Spacer/index.js +2 -2
- package/dist/cjs/components/Switch/index.js +9 -3
- package/dist/cjs/components/Tab/index.js +15 -0
- package/dist/cjs/components/TabBar/index.js +15 -11
- package/dist/cjs/components/TextArea/index.js +11 -12
- package/dist/cjs/components/Textfield/index.js +15 -11
- package/dist/cjs/components/Tip/index.js +9 -4
- package/dist/cjs/components/Toast/index.js +13 -10
- package/dist/cjs/components/ToggleButton/index.js +14 -11
- package/dist/cjs/components/UploadArea/index.js +17 -11
- package/dist/cjs/components/Video/index.js +18 -14
- package/dist/cjs/components/VideoController/index.js +17 -13
- package/dist/cjs/hooks/useAudioRecorder.js +1 -1
- package/dist/cjs/hooks/useBindWebRTC.js +4 -3
- package/dist/cjs/hooks/useClipboard.js +3 -2
- package/dist/cjs/hooks/useDoubleClick.js +6 -4
- package/dist/cjs/hooks/useInfiniteScroll.js +1 -1
- package/dist/cjs/hooks/useMdStreamBuffer.js +7 -2
- package/dist/cjs/hooks/useMicrophone.js +1 -1
- package/dist/cjs/hooks/useObserveTheme.js +4 -4
- package/dist/cjs/hooks/useTheme.js +9 -1
- package/dist/cjs/hooks/useToolTip.js +27 -32
- package/dist/cjs/hooks/useTrackRenders.js +2 -2
- package/dist/cjs/hooks/useWindow.js +13 -23
- package/dist/cjs/hooks.js +13 -12
- package/dist/cjs/index.js +55 -47
- package/dist/cjs/providers/ThemeProvider.js +4 -3
- package/dist/cjs/providers/themeServer.test.js +398 -403
- package/dist/cjs/providers.js +4 -3
- package/dist/cjs/stores/LocalDB.js +8 -6
- package/dist/cjs/stores/SSE.js +4 -3
- package/dist/cjs/stores/WS.js +4 -3
- package/dist/cjs/stores/WebRTC.js +8 -6
- package/dist/cjs/stores/activeTab.js +1 -1
- package/dist/cjs/stores/browserChannel.js +5 -4
- package/dist/cjs/stores/microphone.js +2 -2
- package/dist/cjs/stores/modal.js +1 -1
- package/dist/cjs/stores/popMenu.js +7 -0
- package/dist/cjs/stores/tip.js +1 -1
- package/dist/cjs/stores/toast.js +1 -1
- package/dist/cjs/stores/uploads.js +2 -2
- package/dist/cjs/stores/video.js +1 -1
- package/dist/cjs/stores/volume.js +2 -2
- package/dist/cjs/stores/window.js +2 -2
- package/dist/cjs/stores.js +38 -34
- package/dist/cjs/theme/colors.js +479 -231
- package/dist/cjs/theme/themes.js +3 -30
- package/dist/cjs/theme/type.js +31 -0
- package/dist/cjs/theme.js +10 -3
- package/dist/cjs/utils/index.js +24 -5
- package/dist/cjs/utils/objects/index.js +2 -2
- package/dist/cjs/workers/uploads/uploads.js +2 -2
- package/dist/css/type.module.css +27 -0
- package/dist/esm/chunks/ActionButton-guWI4qko.mjs +235 -0
- package/dist/esm/chunks/Attachment-BTSb0hKX.mjs +370 -0
- package/dist/esm/chunks/AudioBubble-D15lr4H6.mjs +68 -0
- package/dist/esm/chunks/AudioLevel-BcNrcGlh.mjs +63 -0
- package/dist/esm/chunks/Avatar-C4JzdLTW.mjs +132 -0
- package/dist/esm/chunks/AvatarGroup-Cn33-JkE.mjs +78 -0
- package/dist/esm/chunks/Badge-DpnuS-Ey.mjs +32 -0
- package/dist/esm/chunks/Button-BwTo8mSI.mjs +315 -0
- package/dist/esm/chunks/ButtonBar-BwHxexlC.mjs +111 -0
- package/dist/esm/chunks/Camera-DWmX5FZ-.mjs +585 -0
- package/dist/esm/chunks/CheckBox-CjmPDfLi.mjs +76 -0
- package/dist/esm/chunks/Chip-BfyUpZbH.mjs +223 -0
- package/dist/esm/chunks/ContentEditable-BvlyAJve.mjs +154 -0
- package/dist/esm/chunks/DialogBox-W9i6k5mv.mjs +224 -0
- package/dist/esm/chunks/Dot-CG395pS6.mjs +104 -0
- package/dist/esm/chunks/DrggablePanel-0Ef6TYrd.mjs +270 -0
- package/dist/esm/chunks/DropDown-CiB0Rp_P.mjs +286 -0
- package/dist/esm/chunks/ErrorSummary-3XoZyvmX.mjs +192 -0
- package/dist/esm/chunks/{FileIcon-DSPzFDJY.mjs → FileIcon-hKJZoGIx.mjs} +73 -53
- package/dist/esm/chunks/FileList-DxB0ZORo.mjs +220 -0
- package/dist/esm/chunks/FlexBox-VfQehVtm.mjs +296 -0
- package/dist/esm/chunks/FlexDiv-BZ5PBnE3.mjs +6 -0
- package/dist/esm/chunks/Icon-43T0fkr6.mjs +7841 -0
- package/dist/esm/chunks/IconButton-oqYTUJit.mjs +12 -0
- package/dist/esm/chunks/{IndexedDB-DpULdzpq.mjs → IndexedDB-DjCLZUf0.mjs} +1 -1
- package/dist/esm/chunks/ModalController-fvF-RWS8.mjs +169 -0
- package/dist/esm/chunks/ModalHostContext-BrT_g7sc.mjs +5 -0
- package/dist/esm/chunks/Overlay-C_FMcUyg.mjs +93 -0
- package/dist/esm/chunks/Pager-LqYNCZ8I.mjs +158 -0
- package/dist/esm/chunks/PopMenu-BkXfm6Sz.mjs +455 -0
- package/dist/esm/chunks/PopMenuController-Dj3uvc8F.mjs +44 -0
- package/dist/esm/chunks/ProgressIndicator-CR3pA1Me.mjs +266 -0
- package/dist/esm/chunks/PromptInput-Bq18i1Ac.mjs +266 -0
- package/dist/esm/chunks/RadioButton-DTUKMjvM.mjs +109 -0
- package/dist/esm/chunks/RadioButtonList-DsOgpe0m.mjs +99 -0
- package/dist/esm/chunks/Slider-DaZTE-eD.mjs +176 -0
- package/dist/esm/chunks/Spacer-CsJxUJ7E.mjs +24 -0
- package/dist/esm/chunks/Switch-BDFgMC0b.mjs +84 -0
- package/dist/esm/chunks/Tab-B8yJ9Qy4.mjs +105 -0
- package/dist/esm/chunks/TabBar-2kQmtcwW.mjs +214 -0
- package/dist/esm/chunks/TextArea-C32MToPG.mjs +201 -0
- package/dist/esm/chunks/TextField-BXrN1QkD.mjs +344 -0
- package/dist/esm/chunks/Tip-4R9wW1mE.mjs +133 -0
- package/dist/esm/chunks/ToggleButton-CGHa458C.mjs +61 -0
- package/dist/esm/chunks/UploadArea-Dq7ST-RG.mjs +237 -0
- package/dist/esm/chunks/Video-KuG0k3ly.mjs +418 -0
- package/dist/esm/chunks/VideoController-DQoDDY1a.mjs +201 -0
- package/dist/esm/chunks/{WSConnection-DNh3_RKt.mjs → WSConnection-ByCYrNOq.mjs} +1 -1
- package/dist/esm/chunks/{WebRTCConnection-B9ztLs_6.mjs → WebRTCConnection-DTjS3UUU.mjs} +1 -1
- package/dist/esm/chunks/_types-B6NStINb.mjs +296 -0
- package/dist/esm/chunks/_types-ntN11tyz.mjs +910 -0
- package/dist/esm/chunks/audioVisualizer-BMSpJwTS.mjs +71 -0
- package/dist/esm/chunks/breakpoints-Dn9DgpJe.mjs +18 -0
- package/dist/esm/chunks/{browserChannelsStore-CmMyobjW.mjs → browserChannelsStore-s7VUhLS9.mjs} +6 -2
- package/dist/esm/chunks/colors-DZ9xpMoE.mjs +63 -0
- package/dist/esm/chunks/files-6nwSZlJK.mjs +26 -0
- package/dist/esm/chunks/getVideoControls-aoqr4T3P.mjs +20 -0
- package/dist/esm/chunks/getWaterTransition-CrDSFJdk.mjs +12 -0
- package/dist/esm/chunks/{localDBStore-3uHThx73.mjs → localDBStore-DYhPmkHz.mjs} +7 -3
- package/dist/esm/chunks/{microphoneStore-lnK3t3JC.mjs → microphoneStore-BzSEbtfK.mjs} +1 -1
- package/dist/esm/chunks/{misc-CagHFpjD.mjs → misc-DI5GSqkt.mjs} +24 -34
- package/dist/esm/chunks/{modalStore-DDbEcsqD.mjs → modalStore-BgYt3q8T.mjs} +20 -17
- package/dist/esm/chunks/popMenuStore-DtApFGaq.mjs +18 -0
- package/dist/esm/chunks/resolveColor-Kvs7kDyy.mjs +9 -0
- package/dist/esm/chunks/resolveColorProps-CwAU25V-.mjs +17 -0
- package/dist/esm/chunks/resolveShortcut-C43ivgMc.mjs +37 -0
- package/dist/esm/chunks/sharedTypes-DYXO7VNa.mjs +25 -0
- package/dist/esm/chunks/{sseStore-CCkhffxC.mjs → sseStore-Duybemwt.mjs} +7 -3
- package/dist/esm/chunks/themes-DCtDY7XT.mjs +40 -0
- package/dist/esm/chunks/toastStore-Ds1Kx4-O.mjs +29 -0
- package/dist/esm/chunks/type.module--fVZ2ic7.mjs +28 -0
- package/dist/esm/chunks/{uploads-worker-BAc2rfWa.mjs → uploads-worker-CpJtBCvY.mjs} +1 -1
- package/dist/esm/chunks/{uploadsStore-CnmPPpay.mjs → uploadsStore-B_7wyr8k.mjs} +1 -1
- package/dist/esm/chunks/useAudioVisualizer-Dw8XLBmS.mjs +42 -0
- package/dist/esm/chunks/useModalHost-DiYFB7Mq.mjs +51 -0
- package/dist/esm/chunks/usePrefersReducedMotion-BWAwMMLE.mjs +15 -0
- package/dist/esm/chunks/viewState-D7e7CrHf.mjs +659 -0
- package/dist/esm/chunks/{volumeStore-CSItrUF2.mjs → volumeStore-mqWIRL0J.mjs} +1 -1
- package/dist/esm/chunks/{webRTCStore-BpDbSd4Q.mjs → webRTCStore-BepH2O9l.mjs} +7 -3
- package/dist/esm/chunks/{windowStore-Dkr9ooZW.mjs → windowStore-C8rGk_0b.mjs} +1 -1
- package/dist/esm/components/Attachment/index.mjs +71 -0
- package/dist/esm/components/AudioBubble/index.mjs +21 -11
- package/dist/esm/components/AudioLevel/index.mjs +21 -0
- package/dist/esm/components/Avatar/index.mjs +9 -3
- package/dist/esm/components/AvatarGroup/index.mjs +10 -4
- package/dist/esm/components/Badge/index.mjs +8 -2
- package/dist/esm/components/Button/index.mjs +27 -17
- package/dist/esm/components/ButtonBar/index.mjs +22 -14
- package/dist/esm/components/Camera/index.mjs +37 -13
- package/dist/esm/components/CheckBox/index.mjs +20 -16
- package/dist/esm/components/Chip/index.mjs +27 -17
- package/dist/esm/components/ContentEditable/index.mjs +17 -0
- package/dist/esm/components/DataTable/index.mjs +27 -21
- package/dist/esm/components/DialogBox/index.mjs +75 -0
- package/dist/esm/components/Dot/index.mjs +28 -2
- package/dist/esm/components/DraggablePanel/index.mjs +16 -20
- package/dist/esm/components/DropDown/index.mjs +25 -15
- package/dist/esm/components/ErrorSummary/index.mjs +22 -10
- package/dist/esm/components/FileIcon/index.mjs +8 -16
- package/dist/esm/components/FileList/index.mjs +40 -16
- package/dist/esm/components/FlexBox/index.mjs +39 -0
- package/dist/esm/components/FlexDiv/index.mjs +33 -3
- package/dist/esm/components/Icon/index.mjs +15 -11
- package/dist/esm/components/IconButton/index.mjs +31 -19
- package/dist/esm/components/ModalController/index.mjs +33 -9
- package/dist/esm/components/Overlay/index.mjs +30 -2
- package/dist/esm/components/Pager/index.mjs +31 -3
- package/dist/esm/components/PopMenu/index.mjs +59 -0
- package/dist/esm/components/PopMenuController/index.mjs +63 -0
- package/dist/esm/components/Progress/index.mjs +21 -11
- package/dist/esm/components/PromptInput/index.mjs +43 -21
- package/dist/esm/components/RadioButton/index.mjs +18 -14
- package/dist/esm/components/RadioButtonList/index.mjs +23 -17
- package/dist/esm/components/Slider/index.mjs +5 -23
- package/dist/esm/components/Spacer/index.mjs +2 -2
- package/dist/esm/components/Switch/index.mjs +30 -2
- package/dist/esm/components/Tab/index.mjs +51 -0
- package/dist/esm/components/TabBar/index.mjs +32 -16
- package/dist/esm/components/TextArea/index.mjs +17 -23
- package/dist/esm/components/Textfield/index.mjs +33 -17
- package/dist/esm/components/Tip/index.mjs +29 -3
- package/dist/esm/components/Toast/index.mjs +23 -13
- package/dist/esm/components/ToggleButton/index.mjs +30 -22
- package/dist/esm/components/UploadArea/index.mjs +41 -17
- package/dist/esm/components/Video/index.mjs +34 -24
- package/dist/esm/components/VideoController/index.mjs +44 -26
- package/dist/esm/hooks/useAudioRecorder.mjs +1 -1
- package/dist/esm/hooks/useBindWebRTC.mjs +12 -6
- package/dist/esm/hooks/useClipboard.mjs +9 -3
- package/dist/esm/hooks/useDoubleClick.mjs +8 -5
- package/dist/esm/hooks/useInfiniteScroll.mjs +1 -1
- package/dist/esm/hooks/useMdStreamBuffer.mjs +9 -3
- package/dist/esm/hooks/useMicrophone.mjs +1 -1
- package/dist/esm/hooks/useObserveTheme.mjs +5 -1
- package/dist/esm/hooks/useTheme.mjs +5 -1
- package/dist/esm/hooks/useToolTip.mjs +28 -33
- package/dist/esm/hooks/useTrackRenders.mjs +2 -2
- package/dist/esm/hooks/useWindow.mjs +6 -22
- package/dist/esm/hooks.mjs +16 -10
- package/dist/esm/index.mjs +96 -60
- package/dist/esm/providers/ThemeProvider.mjs +5 -1
- package/dist/esm/providers/themeServer.test.mjs +398 -403
- package/dist/esm/providers.mjs +5 -1
- package/dist/esm/stores/LocalDB.mjs +10 -4
- package/dist/esm/stores/SSE.mjs +10 -4
- package/dist/esm/stores/WS.mjs +9 -3
- package/dist/esm/stores/WebRTC.mjs +10 -4
- package/dist/esm/stores/activeTab.mjs +1 -1
- package/dist/esm/stores/browserChannel.mjs +9 -3
- package/dist/esm/stores/microphone.mjs +2 -2
- package/dist/esm/stores/modal.mjs +1 -1
- package/dist/esm/stores/popMenu.mjs +3 -0
- package/dist/esm/stores/tip.mjs +1 -1
- package/dist/esm/stores/toast.mjs +1 -1
- package/dist/esm/stores/uploads.mjs +3 -3
- package/dist/esm/stores/video.mjs +1 -1
- package/dist/esm/stores/volume.mjs +2 -2
- package/dist/esm/stores/window.mjs +2 -2
- package/dist/esm/stores.mjs +28 -20
- package/dist/esm/theme/colors.mjs +479 -231
- package/dist/esm/theme/themes.mjs +6 -35
- package/dist/esm/theme/type.mjs +31 -0
- package/dist/esm/theme.mjs +5 -1
- package/dist/esm/utils/index.mjs +37 -12
- package/dist/esm/utils/objects/index.mjs +8 -8
- package/dist/esm/workers/uploads/uploads.mjs +2 -2
- package/dist/styles.css +5343 -4109
- package/dist/types/components/Attachment/Attachment.d.ts +2 -0
- package/dist/types/components/Attachment/AttachmentImagePreview.d.ts +6 -0
- package/dist/types/components/Attachment/_types.d.ts +47 -0
- package/dist/types/components/Attachment/index.d.ts +3 -0
- package/dist/types/components/Attachment/useContentThumbnail.d.ts +19 -0
- package/dist/types/components/AudioBubble/AudioBubble.d.ts +1 -1
- package/dist/types/components/AudioBubble/_types.d.ts +4 -3
- package/dist/types/components/AudioLevel/AudioLevel.d.ts +5 -0
- package/dist/types/components/AudioLevel/_types.d.ts +22 -0
- package/dist/types/components/AudioLevel/index.d.ts +2 -0
- package/dist/types/components/Avatar/Avatar.d.ts +6 -1
- package/dist/types/components/Avatar/_types.d.ts +28 -15
- package/dist/types/components/AvatarGroup/AvatarGroup.d.ts +1 -1
- package/dist/types/components/AvatarGroup/AvatarGroupContext.d.ts +7 -0
- package/dist/types/components/AvatarGroup/_types.d.ts +26 -15
- package/dist/types/components/AvatarGroup/index.d.ts +1 -1
- package/dist/types/components/Badge/Badge.d.ts +1 -1
- package/dist/types/components/Badge/_types.d.ts +11 -3
- package/dist/types/components/Button/Button.d.ts +19 -52
- package/dist/types/components/Button/_types.d.ts +18 -14
- package/dist/types/components/ButtonBar/ButtonBar.d.ts +0 -14
- package/dist/types/components/ButtonBar/_types.d.ts +16 -13
- package/dist/types/components/Camera/Camera.d.ts +2 -4
- package/dist/types/components/Camera/_types.d.ts +25 -29
- package/dist/types/components/Camera/cameraSession.d.ts +59 -0
- package/dist/types/components/Camera/index.d.ts +1 -1
- package/dist/types/components/CheckBox/CheckBox.d.ts +1 -1
- package/dist/types/components/CheckBox/_types.d.ts +16 -4
- package/dist/types/components/Chip/Chip.d.ts +1 -1
- package/dist/types/components/Chip/_types.d.ts +35 -19
- package/dist/types/components/ContentEditable/ContentEditable.d.ts +3 -0
- package/dist/types/components/ContentEditable/_types.d.ts +26 -0
- package/dist/types/components/ContentEditable/index.d.ts +2 -0
- package/dist/types/components/DataTable/DataTable.d.ts +1 -1
- package/dist/types/components/DataTable/_types.d.ts +21 -11
- package/dist/types/components/DataTable/_useResizeColumn.d.ts +1 -1
- package/dist/types/components/DataTable/_useRowWindow.d.ts +1 -0
- package/dist/types/components/DataTable/compareValues.d.ts +2 -0
- package/dist/types/components/DialogBox/DialogBox.d.ts +6 -0
- package/dist/types/components/DialogBox/_types.d.ts +68 -0
- package/dist/types/components/DialogBox/index.d.ts +3 -0
- package/dist/types/components/DialogBox/parseSections.d.ts +7 -0
- package/dist/types/components/DialogBox/sections.d.ts +20 -0
- package/dist/types/components/DialogBox/useDialogBox.d.ts +4 -0
- package/dist/types/components/Dot/Dot.d.ts +1 -1
- package/dist/types/components/Dot/_types.d.ts +8 -2
- package/dist/types/components/DraggablePanel/DrggablePanel.d.ts +5 -55
- package/dist/types/components/DraggablePanel/_types.d.ts +46 -0
- package/dist/types/components/DraggablePanel/index.d.ts +1 -0
- package/dist/types/components/DraggablePanel/panelConstraints.d.ts +3 -0
- package/dist/types/components/DropDown/_types.d.ts +45 -16
- package/dist/types/components/DropDown/resolveOptions.d.ts +11 -0
- package/dist/types/components/ErrorSummary/ErrorSummary.d.ts +30 -2
- package/dist/types/components/ErrorSummary/_types.d.ts +16 -4
- package/dist/types/components/FileIcon/FileIcon.d.ts +1 -2
- package/dist/types/components/FileIcon/_types.d.ts +11 -6
- package/dist/types/components/FileIcon/index.d.ts +2 -2
- package/dist/types/components/FileList/FileList.d.ts +2 -2
- package/dist/types/components/FileList/_types.d.ts +16 -6
- package/dist/types/components/FileList/fileListValues.d.ts +5 -0
- package/dist/types/components/FlexBox/FlexBox.d.ts +3 -0
- package/dist/types/components/FlexBox/_types.d.ts +62 -0
- package/dist/types/components/FlexBox/index.d.ts +2 -0
- package/dist/types/components/FlexDiv/FlexDiv.d.ts +2 -64
- package/dist/types/components/FlexDiv/_types.d.ts +4 -146
- package/dist/types/components/Icon/Icon.d.ts +1 -1
- package/dist/types/components/Icon/_types.d.ts +910 -133
- package/dist/types/components/Icon/iconRegistry.d.ts +3 -2
- package/dist/types/components/Icon/index.d.ts +1 -0
- package/dist/types/components/IconButton/ActionButton.d.ts +19 -0
- package/dist/types/components/IconButton/IconButton.d.ts +1 -1
- package/dist/types/components/IconButton/_types.d.ts +24 -72
- package/dist/types/components/IconButton/index.d.ts +1 -2
- package/dist/types/components/ModalController/ModalController.d.ts +2 -2
- package/dist/types/components/ModalController/ModalHostContext.d.ts +1 -0
- package/dist/types/components/ModalController/_types.d.ts +3 -5
- package/dist/types/components/ModalController/useModalHost.d.ts +3 -0
- package/dist/types/components/Overlay/Overlay.d.ts +1 -1
- package/dist/types/components/Overlay/_types.d.ts +7 -8
- package/dist/types/components/Pager/Pager.d.ts +1 -1
- package/dist/types/components/Pager/_types.d.ts +21 -5
- package/dist/types/components/Pager/pagerLogic.d.ts +9 -0
- package/dist/types/components/PopMenu/PopMenu.d.ts +3 -0
- package/dist/types/components/PopMenu/PopMenuContext.d.ts +10 -0
- package/dist/types/components/PopMenu/PopMenuGroup.d.ts +2 -0
- package/dist/types/components/PopMenu/PopMenuItem.d.ts +3 -0
- package/dist/types/components/PopMenu/_types.d.ts +110 -0
- package/dist/types/components/PopMenu/index.d.ts +4 -0
- package/dist/types/components/PopMenu/usePopMenu.d.ts +17 -0
- package/dist/types/components/PopMenu/usePopMenuPortal.d.ts +3 -0
- package/dist/types/components/PopMenuController/PopMenuController.d.ts +2 -0
- package/dist/types/components/PopMenuController/index.d.ts +1 -0
- package/dist/types/components/Progress/DoneCheck/DoneCheck.d.ts +1 -1
- package/dist/types/components/Progress/DoneCheck/_types.d.ts +5 -2
- package/dist/types/components/Progress/ProgressIndicator/ProgressIndicator.d.ts +2 -4
- package/dist/types/components/Progress/ProgressIndicator/_types.d.ts +19 -7
- package/dist/types/components/Progress/ProgressIndicator/useSpinnerPlayback.d.ts +3 -0
- package/dist/types/components/PromptInput/PromptInput.d.ts +50 -15
- package/dist/types/components/PromptInput/_types.d.ts +45 -8
- package/dist/types/components/PromptInput/index.d.ts +1 -1
- package/dist/types/components/PromptInput/promptText.d.ts +6 -0
- package/dist/types/components/RadioButton/RadioGroupContext.d.ts +11 -0
- package/dist/types/components/RadioButton/_types.d.ts +24 -13
- package/dist/types/components/RadioButtonList/_types.d.ts +17 -19
- package/dist/types/components/RadioButtonList/index.d.ts +1 -1
- package/dist/types/components/Slider/Slider.d.ts +1 -1
- package/dist/types/components/Slider/_types.d.ts +15 -9
- package/dist/types/components/Slider/sliderLogic.d.ts +6 -0
- package/dist/types/components/Spacer/index.d.ts +1 -1
- package/dist/types/components/Switch/_types.d.ts +18 -7
- package/dist/types/components/Tab/Tab.d.ts +3 -0
- package/dist/types/components/Tab/_types.d.ts +26 -0
- package/dist/types/components/Tab/index.d.ts +2 -0
- package/dist/types/components/TabBar/TabBar.d.ts +1 -1
- package/dist/types/components/TabBar/_types.d.ts +14 -37
- package/dist/types/components/TabBar/index.d.ts +1 -1
- package/dist/types/components/TabBar/shared.d.ts +22 -0
- package/dist/types/components/TextArea/TextArea.d.ts +1 -1
- package/dist/types/components/TextArea/_types.d.ts +32 -11
- package/dist/types/components/TextArea/index.d.ts +1 -1
- package/dist/types/components/Textfield/TextField.d.ts +2 -2
- package/dist/types/components/Textfield/_types.d.ts +41 -37
- package/dist/types/components/Tip/Tip.d.ts +1 -2
- package/dist/types/components/Tip/_types.d.ts +11 -18
- package/dist/types/components/Tip/useTipVisibility.d.ts +6 -0
- package/dist/types/components/Toast/Toast.d.ts +2 -2
- package/dist/types/components/Toast/_types.d.ts +25 -12
- package/dist/types/components/Toast/index.d.ts +1 -1
- package/dist/types/components/Toast/useToastLifecycle.d.ts +15 -0
- package/dist/types/components/ToggleButton/ToggleButton.d.ts +2 -2
- package/dist/types/components/ToggleButton/_types.d.ts +18 -30
- package/dist/types/components/UploadArea/UploadArea.d.ts +27 -19
- package/dist/types/components/UploadArea/_types.d.ts +23 -20
- package/dist/types/components/UploadArea/index.d.ts +1 -1
- package/dist/types/components/UploadArea/selection.d.ts +7 -0
- package/dist/types/components/UploadArea/useFileSelection.d.ts +30 -0
- package/dist/types/components/Video/Video.d.ts +2 -72
- package/dist/types/components/Video/_types.d.ts +37 -11
- package/dist/types/components/Video/getVideoControls.d.ts +3 -0
- package/dist/types/components/Video/index.d.ts +1 -1
- package/dist/types/components/VideoController/VideoController.d.ts +1 -1
- package/dist/types/components/VideoController/_types.d.ts +6 -1
- package/dist/types/components/playHelpers.d.ts +10 -233
- package/dist/types/components/sharedTypes.d.ts +31 -0
- package/dist/types/hooks/index.d.ts +1 -1
- package/dist/types/hooks/useToolTip/useToolTip.d.ts +1 -0
- package/dist/types/hooks/useWindow/useWindow.d.ts +5 -16
- package/dist/types/index.d.ts +39 -30
- package/dist/types/stores/index.d.ts +1 -0
- package/dist/types/stores/popMenu/_types.d.ts +13 -0
- package/dist/types/stores/popMenu/index.d.ts +2 -0
- package/dist/types/stores/popMenu/popMenuStore.d.ts +12 -0
- package/dist/types/stores/toast/_types.d.ts +6 -11
- package/dist/types/stores/toast/toastStore.d.ts +6 -6
- package/dist/types/stores/window/windowStore.d.ts +2 -2
- package/dist/types/theme/breakpoints/breakpoints.d.ts +11 -0
- package/dist/types/theme/colors/palette.d.ts +461 -0
- package/dist/types/theme/colors/recipes.d.ts +34 -0
- package/dist/types/theme/colors/resolveColor.d.ts +7 -0
- package/dist/types/theme/colors/types.d.ts +8 -92
- package/dist/types/theme/index.d.ts +4 -0
- package/dist/types/theme/type/type.d.ts +1 -0
- package/dist/types/theme/type/types.d.ts +3 -0
- package/dist/types/utils/audio/useAudioVisualizer.d.ts +3 -0
- package/dist/types/utils/functions/colors.d.ts +7 -0
- package/dist/types/utils/functions/files.d.ts +3 -4
- package/dist/types/utils/functions/misc.d.ts +12 -2
- package/dist/types/utils/functions/resolveColorProps.d.ts +2 -0
- package/dist/types/utils/functions/resolveShortcut.d.ts +3 -0
- package/dist/types/utils/index.d.ts +5 -1
- package/dist/types/utils/objects/audioVisualizer/audioVisualizer.d.ts +3 -0
- package/dist/types/utils/styling/getWaterTransition.d.ts +4 -0
- package/dist/types/utils/styling/reduceMotionTargets.d.ts +4 -0
- package/dist/types/utils/styling/usePrefersReducedMotion.d.ts +2 -0
- package/package.json +195 -201
- package/scripts/README.md +19 -0
- package/dist/cjs/chunks/AudioBubble-B7rjYKZR.js +0 -55
- package/dist/cjs/chunks/Avatar-_FkV6_bj.js +0 -82
- package/dist/cjs/chunks/AvatarGroup-BMOQtckJ.js +0 -41
- package/dist/cjs/chunks/Badge-CQrpFFZl.js +0 -22
- package/dist/cjs/chunks/Button-D53KhAkv.js +0 -265
- package/dist/cjs/chunks/ButtonBar-N5L7PGg6.js +0 -72
- package/dist/cjs/chunks/Camera-BULkeKNC.js +0 -380
- package/dist/cjs/chunks/CheckBox-CxQeRMKr.js +0 -51
- package/dist/cjs/chunks/Chip-D0tBR0Uq.js +0 -80
- package/dist/cjs/chunks/DivInput-D0VUXFiS.js +0 -101
- package/dist/cjs/chunks/Dot-GHGV4L29.js +0 -72
- package/dist/cjs/chunks/DrggablePanel-DSNgmB_o.js +0 -224
- package/dist/cjs/chunks/DropDown-DRcukAxl.js +0 -105
- package/dist/cjs/chunks/ErrorSummary-DWh383tt.js +0 -88
- package/dist/cjs/chunks/FileList-Cl82aFlO.js +0 -223
- package/dist/cjs/chunks/FlexDiv-CwjTwIXH.js +0 -178
- package/dist/cjs/chunks/Grouper-DjUdigNr.js +0 -63
- package/dist/cjs/chunks/Icon-B07V8-iO.js +0 -1489
- package/dist/cjs/chunks/IconButton-C8l4gN5C.js +0 -182
- package/dist/cjs/chunks/Label-BbJHiOmP.js +0 -106
- package/dist/cjs/chunks/Level-Bj5Kg1W3.js +0 -63
- package/dist/cjs/chunks/Modal-CVmIsdGy.js +0 -128
- package/dist/cjs/chunks/ModalController-DeSot1gM.js +0 -81
- package/dist/cjs/chunks/Overlay-CFoktASG.js +0 -41
- package/dist/cjs/chunks/Pager-NsKBlF0O.js +0 -36
- package/dist/cjs/chunks/ProgressIndicator-BK0eIP3-.js +0 -140
- package/dist/cjs/chunks/PromptInput-BG1-rzlA.js +0 -161
- package/dist/cjs/chunks/RadioButton-DCiNs99y.js +0 -55
- package/dist/cjs/chunks/RadioButtonList-DLdTst71.js +0 -73
- package/dist/cjs/chunks/Slider-CekvQKaG.js +0 -169
- package/dist/cjs/chunks/Spacer-C-nVP3Ic.js +0 -26
- package/dist/cjs/chunks/Switch-DkU5T0Hm.js +0 -44
- package/dist/cjs/chunks/TabBar-Dm3tMtlm.js +0 -183
- package/dist/cjs/chunks/TextArea-Drq3c8dZ.js +0 -77
- package/dist/cjs/chunks/TextField-D38gJzBN.js +0 -190
- package/dist/cjs/chunks/Tip-DMQjQT85.js +0 -89
- package/dist/cjs/chunks/Toast-sZSVZ0ND.js +0 -185
- package/dist/cjs/chunks/ToggleButton-I3AxfCqI.js +0 -45
- package/dist/cjs/chunks/UploadArea-eGZIGNi3.js +0 -132
- package/dist/cjs/chunks/Video-CK1Ui0jI.js +0 -301
- package/dist/cjs/chunks/VideoController-Z2VgDcSG.js +0 -95
- package/dist/cjs/chunks/_types-Bvz68-MM.js +0 -141
- package/dist/cjs/chunks/audioVisualizer-cC1Q8TJs.js +0 -60
- package/dist/cjs/chunks/colors-BLmUwGPt.js +0 -27
- package/dist/cjs/chunks/debounce-CiNBCKOh.js +0 -18
- package/dist/cjs/chunks/sharedTypes-CnzGgdys.js +0 -6
- package/dist/cjs/chunks/toastStore-DtZ3Woz_.js +0 -17
- package/dist/cjs/chunks/viewState-C9dAI8FG.js +0 -497
- package/dist/cjs/components/DivInput/index.js +0 -7
- package/dist/cjs/components/Grouper/index.js +0 -14
- package/dist/cjs/components/Label/index.js +0 -12
- package/dist/cjs/components/Level/index.js +0 -7
- package/dist/cjs/components/Modal/index.js +0 -15
- package/dist/esm/chunks/AudioBubble-nUxpObow.mjs +0 -69
- package/dist/esm/chunks/Avatar-tdg93uhg.mjs +0 -88
- package/dist/esm/chunks/AvatarGroup-C-8btUsy.mjs +0 -47
- package/dist/esm/chunks/Badge-BsLebku3.mjs +0 -26
- package/dist/esm/chunks/Button-BtxNw6ia.mjs +0 -283
- package/dist/esm/chunks/ButtonBar-Duch_kZq.mjs +0 -82
- package/dist/esm/chunks/Camera-CcUUY3V-.mjs +0 -398
- package/dist/esm/chunks/CheckBox-CMzqOPXk.mjs +0 -61
- package/dist/esm/chunks/Chip-fbi2OZwl.mjs +0 -92
- package/dist/esm/chunks/DivInput-C0E2-H7Q.mjs +0 -113
- package/dist/esm/chunks/Dot-CUKJwIzW.mjs +0 -78
- package/dist/esm/chunks/DrggablePanel-R5vyKmMt.mjs +0 -236
- package/dist/esm/chunks/DropDown-Dak1tC81.mjs +0 -115
- package/dist/esm/chunks/ErrorSummary-7St6DRq1.mjs +0 -101
- package/dist/esm/chunks/FileList-DxypG1gf.mjs +0 -231
- package/dist/esm/chunks/FlexDiv-CaNnli-r.mjs +0 -188
- package/dist/esm/chunks/Grouper-Cfkyb5fu.mjs +0 -83
- package/dist/esm/chunks/Icon-BZ634R5u.mjs +0 -1503
- package/dist/esm/chunks/IconButton-BW8BwWt1.mjs +0 -197
- package/dist/esm/chunks/Label-gjoEtJAw.mjs +0 -119
- package/dist/esm/chunks/Level-D4r_4yC6.mjs +0 -68
- package/dist/esm/chunks/Modal-BpeG1ufF.mjs +0 -142
- package/dist/esm/chunks/ModalController-CWJu74sJ.mjs +0 -92
- package/dist/esm/chunks/Overlay-Ctpj5rdn.mjs +0 -47
- package/dist/esm/chunks/Pager-BqAdm87r.mjs +0 -42
- package/dist/esm/chunks/ProgressIndicator-BJGyKW4y.mjs +0 -156
- package/dist/esm/chunks/PromptInput-DAAohdde.mjs +0 -175
- package/dist/esm/chunks/RadioButton-Mubr8ARW.mjs +0 -63
- package/dist/esm/chunks/RadioButtonList-Mw2IVegX.mjs +0 -81
- package/dist/esm/chunks/Slider-tbgzaids.mjs +0 -183
- package/dist/esm/chunks/Spacer-DMPc2plL.mjs +0 -28
- package/dist/esm/chunks/Switch-CV6qfAb7.mjs +0 -50
- package/dist/esm/chunks/TabBar-e13ZmdaD.mjs +0 -205
- package/dist/esm/chunks/TextArea-Bhut96m6.mjs +0 -87
- package/dist/esm/chunks/TextField-iqgBuz_w.mjs +0 -210
- package/dist/esm/chunks/Tip-BhNgf7ae.mjs +0 -99
- package/dist/esm/chunks/Toast-C4ij2wVB.mjs +0 -203
- package/dist/esm/chunks/ToggleButton-74KPRo9V.mjs +0 -53
- package/dist/esm/chunks/UploadArea-CoI7E5w5.mjs +0 -142
- package/dist/esm/chunks/Video-DPue5vFh.mjs +0 -316
- package/dist/esm/chunks/VideoController-Ce6X6aAe.mjs +0 -114
- package/dist/esm/chunks/_types-YqjUzbuI.mjs +0 -141
- package/dist/esm/chunks/audioVisualizer-_H-alvTA.mjs +0 -60
- package/dist/esm/chunks/colors-qznBTNSD.mjs +0 -30
- package/dist/esm/chunks/debounce-Ck7nvyAV.mjs +0 -19
- package/dist/esm/chunks/sharedTypes-BS0kCucU.mjs +0 -8
- package/dist/esm/chunks/toastStore-OATPs-NI.mjs +0 -15
- package/dist/esm/chunks/viewState-DHKdCOat.mjs +0 -527
- package/dist/esm/components/DivInput/index.mjs +0 -13
- package/dist/esm/components/Grouper/index.mjs +0 -47
- package/dist/esm/components/Label/index.mjs +0 -11
- package/dist/esm/components/Level/index.mjs +0 -15
- package/dist/esm/components/Modal/index.mjs +0 -57
- package/dist/types/components/DataTable/_resolveVirtualizeRows.test.d.ts +0 -1
- package/dist/types/components/DataTable/_useReorderColumns.test.d.ts +0 -1
- package/dist/types/components/DataTable/_useResizeColumn.test.d.ts +0 -1
- package/dist/types/components/DataTable/_useRowWindow.test.d.ts +0 -1
- package/dist/types/components/DataTable/columnHelper.test.d.ts +0 -1
- package/dist/types/components/DataTable/viewState.test.d.ts +0 -1
- package/dist/types/components/DivInput/DivInput.d.ts +0 -3
- package/dist/types/components/DivInput/_types.d.ts +0 -24
- package/dist/types/components/DivInput/index.d.ts +0 -2
- package/dist/types/components/Grouper/Grouper.d.ts +0 -3
- package/dist/types/components/Grouper/_types.d.ts +0 -20
- package/dist/types/components/Grouper/index.d.ts +0 -2
- package/dist/types/components/Icon/iconRegistry.test.d.ts +0 -1
- package/dist/types/components/IconButton/_animation.d.ts +0 -18
- package/dist/types/components/IconButton/_animation.test.d.ts +0 -1
- package/dist/types/components/Label/Label.d.ts +0 -3
- package/dist/types/components/Label/_types.d.ts +0 -25
- package/dist/types/components/Label/index.d.ts +0 -3
- package/dist/types/components/Level/Level.d.ts +0 -5
- package/dist/types/components/Level/_types.d.ts +0 -21
- package/dist/types/components/Level/index.d.ts +0 -2
- package/dist/types/components/Modal/Modal.d.ts +0 -3
- package/dist/types/components/Modal/_types.d.ts +0 -49
- package/dist/types/components/Modal/index.d.ts +0 -2
- package/dist/types/hooks/useActiveTab/useActiveTab.test.d.ts +0 -1
- package/dist/types/hooks/useAudioRecorder/useAudioRecorder.test.d.ts +0 -1
- package/dist/types/hooks/useBindWebRTC/useBindWebRTC.test.d.ts +0 -1
- package/dist/types/hooks/useClipboard/useClipboard.test.d.ts +0 -1
- package/dist/types/hooks/useDoubleClick/useDoubleClick.test.d.ts +0 -1
- package/dist/types/hooks/useInfiniteScroll/useInfiniteScroll.test.d.ts +0 -1
- package/dist/types/hooks/useIntersecting/useIntersecting.test.d.ts +0 -1
- package/dist/types/hooks/useKeyboardShortcuts/useKeyboardShortcuts.test.d.ts +0 -1
- package/dist/types/hooks/useLastUpdated/useLastUpdated.test.d.ts +0 -1
- package/dist/types/hooks/useLocalStore/useLocalStore.test.d.ts +0 -1
- package/dist/types/hooks/useMdStreamBuffer/useMdStreamBuffer.test.d.ts +0 -1
- package/dist/types/hooks/useMicrophone/useMicrophone.test.d.ts +0 -1
- package/dist/types/hooks/useObserveTheme/useObserveTheme.test.d.ts +0 -1
- package/dist/types/hooks/useTheme/useTheme.test.d.ts +0 -1
- package/dist/types/hooks/useToolTip/useToolTip.test.d.ts +0 -1
- package/dist/types/hooks/useTrackRenders/useTrackRenders.test.d.ts +0 -1
- package/dist/types/hooks/useWindow/useWindow.test.d.ts +0 -1
- package/dist/types/providers/themeServer.test.d.ts +0 -1
- package/dist/types/stores/LocalDB/localDBStore.test.d.ts +0 -1
- package/dist/types/stores/SSE/sseStore.test.d.ts +0 -1
- package/dist/types/stores/WS/wsStore.test.d.ts +0 -1
- package/dist/types/stores/WebRTC/webRTCStore.test.d.ts +0 -1
- package/dist/types/stores/activeTab/activeTabStore.test.d.ts +0 -1
- package/dist/types/stores/browserChannel/browserChannelsStore.test.d.ts +0 -1
- package/dist/types/stores/microphone/microphoneStore.test.d.ts +0 -1
- package/dist/types/stores/modal/modalStore.test.d.ts +0 -1
- package/dist/types/stores/tip/tipStore.test.d.ts +0 -1
- package/dist/types/stores/toast/toastStore.test.d.ts +0 -1
- package/dist/types/stores/uploads/uploadsStore.test.d.ts +0 -1
- package/dist/types/stores/video/videoStore.test.d.ts +0 -1
- package/dist/types/stores/volume/volumeStore.test.d.ts +0 -1
- package/dist/types/stores/window/windowStore.test.d.ts +0 -1
- package/dist/types/utils/functions/colors.test.d.ts +0 -1
- package/dist/types/utils/functions/debounce.test.d.ts +0 -1
- package/dist/types/utils/functions/files.test.d.ts +0 -1
- package/dist/types/utils/functions/misc.test.d.ts +0 -1
- package/dist/types/utils/functions/rafThrottle.test.d.ts +0 -1
- package/dist/types/utils/objects/IndexedDB/IndexedDB.test.d.ts +0 -1
- package/dist/types/utils/objects/MDStreamBuffer/MdStreamBuffer.test.d.ts +0 -1
- package/dist/types/utils/objects/SSEConnection/SSEConnection.test.d.ts +0 -1
- package/dist/types/utils/objects/WSConnection/WSConnection.test.d.ts +0 -1
- package/dist/types/utils/objects/WebRTCConnection/WebRTCConnection.test.d.ts +0 -1
- package/dist/types/utils/objects/audioVisualizer/audioVisualizer.test.d.ts +0 -1
- package/dist/types/utils/objects/browserChannel/broadcastChannel.test.d.ts +0 -1
- package/dist/types/workers/uploads/uploads-worker.test.d.ts +0 -1
- /package/dist/cjs/chunks/{MdStreamBuffer-BwrT84Xh.js → MdStreamBuffer-B0KtaR_k.js} +0 -0
- /package/dist/cjs/chunks/{SSEConnection-Dciti25t.js → SSEConnection-BXWkgT66.js} +0 -0
- /package/dist/cjs/chunks/{activeTabStore-qP5wXhKH.js → activeTabStore-D2gxAoK6.js} +0 -0
- /package/dist/cjs/chunks/{broadcastChannel-BV0gIfvH.js → broadcastChannel-DdPZ3LUB.js} +0 -0
- /package/dist/cjs/chunks/{magic-string.es-Vs_88NMN.js → magic-string.es-DsAR0Q7u.js} +0 -0
- /package/dist/cjs/chunks/{rafThrottle-BlnxmQVH.js → rafThrottle-BRdLzPo7.js} +0 -0
- /package/dist/cjs/chunks/{tipStore-K8csyK2D.js → tipStore-DDHyGeyK.js} +0 -0
- /package/dist/cjs/chunks/{tslib.es6-DL37Dyu4.js → tslib.es6-B8JY5ZGw.js} +0 -0
- /package/dist/cjs/chunks/{videoStore-CR0cDt-h.js → videoStore-B0l9iBw4.js} +0 -0
- /package/dist/esm/chunks/{MdStreamBuffer-DFtBr080.mjs → MdStreamBuffer-CcO5IBxD.mjs} +0 -0
- /package/dist/esm/chunks/{SSEConnection-Djeh2C5G.mjs → SSEConnection-B5rVxalP.mjs} +0 -0
- /package/dist/esm/chunks/{activeTabStore-DSluAldJ.mjs → activeTabStore-CCstpXAC.mjs} +0 -0
- /package/dist/esm/chunks/{broadcastChannel-B2yT2lpA.mjs → broadcastChannel-CPT0S33H.mjs} +0 -0
- /package/dist/esm/chunks/{magic-string.es-Cm4dLOmN.mjs → magic-string.es-CI4cCGRB.mjs} +0 -0
- /package/dist/esm/chunks/{rafThrottle-CJcLGMwV.mjs → rafThrottle-Dl8Z5sJ-.mjs} +0 -0
- /package/dist/esm/chunks/{tipStore-BrCvK80A.mjs → tipStore-CBvk303u.mjs} +0 -0
- /package/dist/esm/chunks/{tslib.es6-DiR-r3pp.mjs → tslib.es6-CpnJrDBv.mjs} +0 -0
- /package/dist/esm/chunks/{videoStore-CLWsJ-oG.mjs → videoStore-Cd-Lewfy.mjs} +0 -0
|
@@ -1,380 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
"use strict";
|
|
3
|
-
|
|
4
|
-
var tslib_es6 = require("./tslib.es6-DL37Dyu4.js"), jsxRuntime = require("react/jsx-runtime"), React = require("react"), hooks_useTheme = require("../hooks/useTheme.js");
|
|
5
|
-
|
|
6
|
-
require("../theme/colors.js"), require("../theme/type.js");
|
|
7
|
-
|
|
8
|
-
var misc = require("./misc-B3tF47Um.js"), colors = require("./colors-BLmUwGPt.js");
|
|
9
|
-
|
|
10
|
-
require("./broadcastChannel-BV0gIfvH.js"), require("./webRTCStore-B8IKsBKT.js"),
|
|
11
|
-
require("./microphoneStore-Dw-7f6Jb.js"), require("./volumeStore-BQIMqtSw.js"),
|
|
12
|
-
require("../hooks/useWindow.js");
|
|
13
|
-
|
|
14
|
-
var Avatar = require("./Avatar-_FkV6_bj.js"), Icon = require("./Icon-B07V8-iO.js"), css_wrapper = "Camera-module_wrapper__GOsKp flexBox-module_column__ezvMq", css_video = "Camera-module_video__Q2r9B", css_controls = "Camera-module_controls__qXYoL flexBox-module_rowBetween__5FEvi", css_controlsRight = "Camera-module_controlsRight__VcIz7 flexBox-module_rowEnd__rVdVm", css_controlsCenter = "Camera-module_controlsCenter__e-erq flexBox-module_row__z24tF", css_controlsLeft = "Camera-module_controlsLeft__bR4TN flexBox-module_rowStart__4tcxS", css_error = "Camera-module_error__t0w-d flexBox-module_row__z24tF type-module_body-m-regular__LuQBA", css_poster = "Camera-module_poster__Gun-v flexBox-module_row__z24tF type-module_body-m-regular__LuQBA", css_snapshotFrame = "Camera-module_snapshotFrame__YM6Eu flexBox-module_row__z24tF", css_clear = "Camera-module_clear__aaCfT", css_snapshot = "Camera-module_snapshot__odQH0", css_toolbarButton = "Camera-module_toolbarButton__mnmoF flexBox-module_columnStartCenter__PKcrG", css_buttonIcon = "Camera-module_buttonIcon__a-VBR flexBox-module_row__z24tF", css_buttonLabel = "Camera-module_buttonLabel__6BEs1 flexBox-module_row__z24tF type-module_body-xs-regular__ZAFft";
|
|
15
|
-
|
|
16
|
-
const Camera = React.memo(React.forwardRef((props, ref) => {
|
|
17
|
-
const videoElement = React.useRef(null), containerElement = React.useRef(null), controlsTimer = React.useRef(null), {noVideoPoster: noVideoPoster, width: width, height: height, showControlBar: showControlBar = !0, autoHideControlBar: autoHideControlBar = !0, startCameraOff: startCameraOff = !1, startAudioMuted: startAudioMuted = !1, playLocalAudio: playLocalAudio = !1, pipSnapshot: pipSnapshot = !0, userProfile: userProfile, sessionSettings: sessionSettings, onChangeProfile: onChangeProfile, onChangeSettings: onChangeSettings, onSnapshot: onSnapshot, onVideoStream: onVideoStream, onNoVideo: onNoVideo, onNoAudio: onNoAudio} = props, theme = hooks_useTheme.useTheme(), [cameraSupport, setCameraSupport] = React.useState(void 0), [cameraError, setCameraError] = React.useState(void 0), [hovered, setHovered] = React.useState(!1), [cameraOn, setCameraOn] = React.useState(!1), [micMuted, setMicMuted] = React.useState(startAudioMuted), [snapshot, setSnapshot] = React.useState(void 0), [settings, setSettings] = React.useState(!1), [profile, setProfile] = React.useState(!1), [deviceList, setDeviceList] = React.useState([]), constraints = React.useMemo(() => {
|
|
18
|
-
const videoDeviceId = null == sessionSettings ? void 0 : sessionSettings.videoDeviceId, micDeviceId = null == sessionSettings ? void 0 : sessionSettings.micDeviceId;
|
|
19
|
-
return {
|
|
20
|
-
video: !videoDeviceId || {
|
|
21
|
-
deviceId: {
|
|
22
|
-
exact: videoDeviceId
|
|
23
|
-
}
|
|
24
|
-
},
|
|
25
|
-
audio: !micDeviceId || {
|
|
26
|
-
deviceId: {
|
|
27
|
-
exact: micDeviceId
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
};
|
|
31
|
-
}, [ null == sessionSettings ? void 0 : sessionSettings.micDeviceId, null == sessionSettings ? void 0 : sessionSettings.videoDeviceId ]), getStream = React.useCallback(() => {
|
|
32
|
-
var _a;
|
|
33
|
-
const srcObject = null === (_a = videoElement.current) || void 0 === _a ? void 0 : _a.srcObject;
|
|
34
|
-
if (!srcObject) return;
|
|
35
|
-
if ("undefined" != typeof MediaStream && srcObject instanceof MediaStream) return srcObject;
|
|
36
|
-
const possibleStream = srcObject;
|
|
37
|
-
return "function" == typeof possibleStream.getTracks && "function" == typeof possibleStream.getVideoTracks && "function" == typeof possibleStream.getAudioTracks ? possibleStream : void 0;
|
|
38
|
-
}, []), getTrack = React.useCallback(type => {
|
|
39
|
-
var _a, _b;
|
|
40
|
-
const stream = getStream();
|
|
41
|
-
if (stream) return "video" === type ? null !== (_a = stream.getVideoTracks()[0]) && void 0 !== _a ? _a : void 0 : null !== (_b = stream.getAudioTracks()[0]) && void 0 !== _b ? _b : void 0;
|
|
42
|
-
}, [ getStream ]), getMediaDevices = React.useCallback(() => tslib_es6.__awaiter(void 0, void 0, void 0, function*() {
|
|
43
|
-
var _a;
|
|
44
|
-
return "undefined" != typeof navigator && (null === (_a = navigator.mediaDevices) || void 0 === _a ? void 0 : _a.enumerateDevices) ? yield navigator.mediaDevices.enumerateDevices().catch(error => {
|
|
45
|
-
const defaultError = new Error("Unknown error enumerating devices. Please try again.");
|
|
46
|
-
return error instanceof Error ? error : defaultError;
|
|
47
|
-
}) : new Error("Media devices not supported");
|
|
48
|
-
}), []), hasMediaSupport = React.useMemo(() => {
|
|
49
|
-
var _a;
|
|
50
|
-
return "undefined" != typeof navigator && Boolean(null === (_a = navigator.mediaDevices) || void 0 === _a ? void 0 : _a.getUserMedia);
|
|
51
|
-
}, []), syncMediaState = React.useCallback(() => {
|
|
52
|
-
const stream = getStream(), videoTrack = null == stream ? void 0 : stream.getVideoTracks()[0], audioTrack = null == stream ? void 0 : stream.getAudioTracks()[0];
|
|
53
|
-
setCameraOn(Boolean("live" === (null == videoTrack ? void 0 : videoTrack.readyState) && videoTrack.enabled)),
|
|
54
|
-
setMicMuted(audioTrack ? !audioTrack.enabled : startAudioMuted);
|
|
55
|
-
}, [ getStream, startAudioMuted ]), takeSnapshot = React.useCallback(options => {
|
|
56
|
-
var _a, _b, _c, _d;
|
|
57
|
-
if (!videoElement.current) return;
|
|
58
|
-
const width = null !== (_a = null == options ? void 0 : options.width) && void 0 !== _a ? _a : videoElement.current.videoWidth, height = null !== (_b = null == options ? void 0 : options.height) && void 0 !== _b ? _b : videoElement.current.videoHeight;
|
|
59
|
-
if (!width || !height) return;
|
|
60
|
-
const canvas = document.createElement("canvas");
|
|
61
|
-
canvas.width = width, canvas.height = height;
|
|
62
|
-
const context = canvas.getContext("2d");
|
|
63
|
-
if (!context) return;
|
|
64
|
-
context.drawImage(videoElement.current, 0, 0, canvas.width, canvas.height);
|
|
65
|
-
const url = canvas.toDataURL("image/png"), [header, data] = url.split(",");
|
|
66
|
-
if (!header || !data) return;
|
|
67
|
-
const mimeType = null !== (_d = null === (_c = new RegExp(/data:(.*?);base64/).exec(header)) || void 0 === _c ? void 0 : _c[1]) && void 0 !== _d ? _d : "image/png", binary = atob(data), bytes = new Uint8Array(binary.length);
|
|
68
|
-
for (let index = 0; index < binary.length; index += 1) bytes[index] = binary.codePointAt(index);
|
|
69
|
-
return new Blob([ bytes ], {
|
|
70
|
-
type: mimeType
|
|
71
|
-
});
|
|
72
|
-
}, []), handleSnapshot = React.useCallback(options => {
|
|
73
|
-
if ((null == options ? void 0 : options.toggle) && snapshot) return void setSnapshot(void 0);
|
|
74
|
-
const photo = takeSnapshot(options);
|
|
75
|
-
return null == onSnapshot || onSnapshot(photo), setSnapshot(previousSnapshot => (previousSnapshot && URL.revokeObjectURL(previousSnapshot),
|
|
76
|
-
photo ? URL.createObjectURL(photo) : void 0)), photo;
|
|
77
|
-
}, [ onSnapshot, takeSnapshot, snapshot ]), muteMic = React.useCallback(() => {
|
|
78
|
-
const audioTrack = getTrack("audio");
|
|
79
|
-
return audioTrack ? (audioTrack.enabled = !1, setMicMuted(!0), !0) : new Error("No audio track found");
|
|
80
|
-
}, [ getTrack ]), unmuteMic = React.useCallback(() => {
|
|
81
|
-
const audioTrack = getTrack("audio");
|
|
82
|
-
return audioTrack ? (audioTrack.enabled = !0, setMicMuted(!1), !0) : new Error("No audio track found");
|
|
83
|
-
}, [ getTrack ]), toggleMic = React.useCallback(() => {
|
|
84
|
-
const audioTrack = getTrack("audio");
|
|
85
|
-
return audioTrack ? audioTrack.enabled ? muteMic() : unmuteMic() : new Error("No audio track found");
|
|
86
|
-
}, [ getTrack, muteMic, unmuteMic ]), disableVideo = React.useCallback(() => {
|
|
87
|
-
const videoTrack = getTrack("video");
|
|
88
|
-
return videoTrack ? (videoTrack.enabled = !1, setCameraOn(!1), !0) : new Error("No video track found");
|
|
89
|
-
}, [ getTrack ]), enableVideo = React.useCallback(() => {
|
|
90
|
-
const stream = getStream();
|
|
91
|
-
if (!stream) return new Error("No media stream found");
|
|
92
|
-
const videoTrack = getTrack("video");
|
|
93
|
-
return videoTrack ? "live" !== videoTrack.readyState ? new Error("Video track is no longer live") : (videoTrack.enabled = !0,
|
|
94
|
-
setCameraOn(!0), stream) : new Error("No video track found");
|
|
95
|
-
}, [ getStream, getTrack ]), markCameraReady = React.useCallback(() => {
|
|
96
|
-
setCameraSupport(!0), setCameraError(void 0), syncMediaState();
|
|
97
|
-
}, [ syncMediaState ]), reuseExistingStream = React.useCallback(() => {
|
|
98
|
-
const existingStream = getStream(), existingVideoTrack = null == existingStream ? void 0 : existingStream.getVideoTracks()[0];
|
|
99
|
-
if ("live" === (null == existingVideoTrack ? void 0 : existingVideoTrack.readyState) && !existingVideoTrack.enabled) {
|
|
100
|
-
const enabledStream = enableVideo();
|
|
101
|
-
return enabledStream instanceof Error || (null == onVideoStream || onVideoStream(enabledStream),
|
|
102
|
-
markCameraReady()), enabledStream;
|
|
103
|
-
}
|
|
104
|
-
if ((null == existingStream ? void 0 : existingStream.active) && "live" === (null == existingVideoTrack ? void 0 : existingVideoTrack.readyState)) return markCameraReady(),
|
|
105
|
-
existingStream;
|
|
106
|
-
}, [ enableVideo, getStream, markCameraReady, onVideoStream ]), requestMediaStream = React.useCallback(() => tslib_es6.__awaiter(void 0, void 0, void 0, function*() {
|
|
107
|
-
try {
|
|
108
|
-
return yield navigator.mediaDevices.getUserMedia(constraints);
|
|
109
|
-
} catch (error) {
|
|
110
|
-
if (!(error instanceof DOMException && "OverconstrainedError" === error.name || error instanceof DOMException && "NotFoundError" === error.name)) throw error;
|
|
111
|
-
return yield navigator.mediaDevices.getUserMedia({
|
|
112
|
-
video: !0,
|
|
113
|
-
audio: !0
|
|
114
|
-
});
|
|
115
|
-
}
|
|
116
|
-
}), [ constraints ]), attachStreamToVideo = React.useCallback(stream => tslib_es6.__awaiter(void 0, void 0, void 0, function*() {
|
|
117
|
-
const audioTrack = stream.getAudioTracks()[0], videoTrack = stream.getVideoTracks()[0], devices = yield getMediaDevices();
|
|
118
|
-
if (!videoTrack) {
|
|
119
|
-
null == onNoVideo || onNoVideo("No video track available");
|
|
120
|
-
for (const track of stream.getTracks()) track.stop();
|
|
121
|
-
return new Error("No video track available");
|
|
122
|
-
}
|
|
123
|
-
return audioTrack || null == onNoAudio || onNoAudio("No audio track available"),
|
|
124
|
-
audioTrack && (audioTrack.enabled = !startAudioMuted), videoElement.current ? (videoElement.current.muted = !playLocalAudio,
|
|
125
|
-
videoElement.current.srcObject = stream, yield videoElement.current.play(), null == onVideoStream || onVideoStream(stream),
|
|
126
|
-
setDeviceList(devices), markCameraReady(), stream) : new Error("Video element not found");
|
|
127
|
-
}), [ getMediaDevices, markCameraReady, onNoAudio, onNoVideo, onVideoStream, playLocalAudio, startAudioMuted ]), startCamera = React.useCallback(() => tslib_es6.__awaiter(void 0, void 0, void 0, function*() {
|
|
128
|
-
if (!videoElement.current) return new Error("Video element not found");
|
|
129
|
-
if (!hasMediaSupport) return setCameraSupport(!1), setCameraError("Camera not supported"),
|
|
130
|
-
new Error("Camera not supported");
|
|
131
|
-
const existingStream = reuseExistingStream();
|
|
132
|
-
if (existingStream) return existingStream;
|
|
133
|
-
try {
|
|
134
|
-
const stream = yield requestMediaStream();
|
|
135
|
-
return yield attachStreamToVideo(stream);
|
|
136
|
-
} catch (error) {
|
|
137
|
-
const defaultError = new Error("Could not access the camera. Ensure permissions are correct"), resolvedError = error instanceof Error ? error : defaultError;
|
|
138
|
-
return null == onNoVideo || onNoVideo(resolvedError), null == onNoAudio || onNoAudio(resolvedError),
|
|
139
|
-
setCameraSupport(!0), setCameraError(resolvedError.message), setCameraOn(!1), resolvedError;
|
|
140
|
-
}
|
|
141
|
-
}), [ attachStreamToVideo, hasMediaSupport, onNoAudio, onNoVideo, requestMediaStream, reuseExistingStream ]), toggleVideo = React.useCallback(() => tslib_es6.__awaiter(void 0, void 0, void 0, function*() {
|
|
142
|
-
const stream = getStream();
|
|
143
|
-
if (!stream) return yield startCamera();
|
|
144
|
-
const videoTrack = stream.getVideoTracks()[0];
|
|
145
|
-
return videoTrack ? videoTrack.enabled ? disableVideo() : enableVideo() : new Error("No video track found");
|
|
146
|
-
}), [ disableVideo, enableVideo, getStream, startCamera ]), stopCamera = React.useCallback(() => tslib_es6.__awaiter(void 0, void 0, void 0, function*() {
|
|
147
|
-
if (!videoElement.current) return new Error("Video element not found");
|
|
148
|
-
try {
|
|
149
|
-
const stream = getStream();
|
|
150
|
-
if (!stream) return new Error("No media stream to stop");
|
|
151
|
-
for (const track of stream.getTracks()) track.stop();
|
|
152
|
-
return videoElement.current.srcObject = null, setCameraOn(!1), setMicMuted(startAudioMuted),
|
|
153
|
-
setCameraError(void 0), setDeviceList([]), !0;
|
|
154
|
-
} catch (error) {
|
|
155
|
-
const defaultError = new Error("Unknown error stopping the camera. Please try again.");
|
|
156
|
-
return error instanceof Error ? error : defaultError;
|
|
157
|
-
}
|
|
158
|
-
}), [ getStream, startAudioMuted ]);
|
|
159
|
-
React.useImperativeHandle(ref, () => ({
|
|
160
|
-
get video() {
|
|
161
|
-
var _a;
|
|
162
|
-
return null !== (_a = videoElement.current) && void 0 !== _a ? _a : void 0;
|
|
163
|
-
},
|
|
164
|
-
get container() {
|
|
165
|
-
var _a;
|
|
166
|
-
return null !== (_a = containerElement.current) && void 0 !== _a ? _a : void 0;
|
|
167
|
-
},
|
|
168
|
-
get stream() {
|
|
169
|
-
return getStream();
|
|
170
|
-
},
|
|
171
|
-
get videoTrack() {
|
|
172
|
-
return getTrack("video");
|
|
173
|
-
},
|
|
174
|
-
get audioTrack() {
|
|
175
|
-
return getTrack("audio");
|
|
176
|
-
},
|
|
177
|
-
snapshot: options => handleSnapshot(options),
|
|
178
|
-
startCamera: () => startCamera(),
|
|
179
|
-
stopCamera: () => stopCamera(),
|
|
180
|
-
enableVideo: () => enableVideo(),
|
|
181
|
-
disableVideo: () => disableVideo(),
|
|
182
|
-
muteMic: () => muteMic(),
|
|
183
|
-
unmuteMic: () => unmuteMic(),
|
|
184
|
-
toggleMic: () => toggleMic(),
|
|
185
|
-
devices: () => getMediaDevices(),
|
|
186
|
-
toggleVideo: () => toggleVideo()
|
|
187
|
-
}), [ disableVideo, enableVideo, getMediaDevices, getStream, getTrack, handleSnapshot, muteMic, startCamera, stopCamera, toggleMic, toggleVideo, unmuteMic ]);
|
|
188
|
-
const showPoster = React.useMemo(() => !cameraError && (!1 === cameraSupport || !cameraOn), [ cameraError, cameraSupport, cameraOn ]), showError = React.useMemo(() => Boolean(cameraError), [ cameraError ]), controlsBg = React.useMemo(() => {
|
|
189
|
-
const bgColor = theme.current.colors["core-surface-primary"];
|
|
190
|
-
return colors.addOpacity(bgColor, .75);
|
|
191
|
-
}, [ theme.current ]), setControlBarVisible = React.useMemo(() => autoHideControlBar ? showControlBar && hovered ? "translateY(0%)" : "translateY(100%)" : "translateY(0%)", [ autoHideControlBar, hovered, showControlBar ]), cssVars = React.useMemo(() => ({
|
|
192
|
-
"--camera-width": width,
|
|
193
|
-
"--camera-height": height,
|
|
194
|
-
"--camera-controls-bg": controlsBg,
|
|
195
|
-
"--camera-controls-transform": setControlBarVisible
|
|
196
|
-
}), [ controlsBg, height, setControlBarVisible, width ]), handleMouseClick = React.useCallback(() => {
|
|
197
|
-
setHovered(!1);
|
|
198
|
-
}, []), handleControlsClick = React.useCallback(e => {
|
|
199
|
-
e.stopPropagation();
|
|
200
|
-
}, []);
|
|
201
|
-
return React.useEffect(() => {
|
|
202
|
-
startCameraOff ? stopCamera().then(() => null) : startCamera().then(() => null);
|
|
203
|
-
}, [ startCamera, startCameraOff, stopCamera ]), React.useEffect(() => {
|
|
204
|
-
videoElement.current && (videoElement.current.muted = !playLocalAudio);
|
|
205
|
-
}, [ playLocalAudio ]), React.useEffect(() => () => {
|
|
206
|
-
controlsTimer.current && clearTimeout(controlsTimer.current);
|
|
207
|
-
const stream = getStream();
|
|
208
|
-
if (stream) for (const track of stream.getTracks()) track.stop();
|
|
209
|
-
}, [ getStream ]), React.useEffect(() => () => {
|
|
210
|
-
snapshot && URL.revokeObjectURL(snapshot);
|
|
211
|
-
}, [ snapshot ]), jsxRuntime.jsxs("div", {
|
|
212
|
-
ref: containerElement,
|
|
213
|
-
className: css_wrapper,
|
|
214
|
-
style: cssVars,
|
|
215
|
-
onMouseEnter: () => {
|
|
216
|
-
controlsTimer.current && clearTimeout(controlsTimer.current), setHovered(!0), controlsTimer.current = setTimeout(() => setHovered(!1), 3e3);
|
|
217
|
-
},
|
|
218
|
-
onMouseLeave: () => {
|
|
219
|
-
controlsTimer.current && clearTimeout(controlsTimer.current), setHovered(!1);
|
|
220
|
-
},
|
|
221
|
-
onMouseMove: e => {
|
|
222
|
-
hovered || (setHovered(!0), controlsTimer.current && clearTimeout(controlsTimer.current),
|
|
223
|
-
controlsTimer.current = setTimeout(() => setHovered(!1), 3e3));
|
|
224
|
-
},
|
|
225
|
-
onClick: handleMouseClick,
|
|
226
|
-
onKeyDown: e => misc.accessibleKeyDown(e, handleMouseClick),
|
|
227
|
-
children: [ pipSnapshot && snapshot && jsxRuntime.jsxs("div", {
|
|
228
|
-
className: css_snapshotFrame,
|
|
229
|
-
children: [ jsxRuntime.jsx("div", {
|
|
230
|
-
className: css_clear,
|
|
231
|
-
children: jsxRuntime.jsx(Icon.Icon, {
|
|
232
|
-
name: "x",
|
|
233
|
-
pointer: !0,
|
|
234
|
-
role: "button",
|
|
235
|
-
"aria-label": "Clear snapshot",
|
|
236
|
-
onClick: () => setSnapshot(previousSnapshot => {
|
|
237
|
-
previousSnapshot && URL.revokeObjectURL(previousSnapshot);
|
|
238
|
-
})
|
|
239
|
-
})
|
|
240
|
-
}), jsxRuntime.jsx("img", {
|
|
241
|
-
className: css_snapshot,
|
|
242
|
-
src: snapshot,
|
|
243
|
-
alt: "Snapshot"
|
|
244
|
-
}) ]
|
|
245
|
-
}), !1 !== cameraSupport && jsxRuntime.jsx("video", {
|
|
246
|
-
ref: videoElement,
|
|
247
|
-
className: css_video,
|
|
248
|
-
autoPlay: !0,
|
|
249
|
-
playsInline: !0,
|
|
250
|
-
muted: !playLocalAudio,
|
|
251
|
-
children: jsxRuntime.jsx("track", {
|
|
252
|
-
kind: "captions",
|
|
253
|
-
src: void 0
|
|
254
|
-
})
|
|
255
|
-
}), showPoster && jsxRuntime.jsx("div", {
|
|
256
|
-
className: css_poster,
|
|
257
|
-
children: null != noVideoPoster ? noVideoPoster : jsxRuntime.jsx(DefaultNoVideoPoster, {
|
|
258
|
-
user: userProfile
|
|
259
|
-
})
|
|
260
|
-
}), showError && jsxRuntime.jsx("div", {
|
|
261
|
-
className: css_error,
|
|
262
|
-
children: cameraError
|
|
263
|
-
}), jsxRuntime.jsxs("div", {
|
|
264
|
-
className: css_controls,
|
|
265
|
-
onMouseEnter: e => {
|
|
266
|
-
e.stopPropagation(), controlsTimer.current && clearTimeout(controlsTimer.current),
|
|
267
|
-
setHovered(!0);
|
|
268
|
-
},
|
|
269
|
-
onMouseLeave: e => {
|
|
270
|
-
e.stopPropagation(), controlsTimer.current && clearTimeout(controlsTimer.current),
|
|
271
|
-
controlsTimer.current = setTimeout(() => setHovered(!1), 3e3);
|
|
272
|
-
},
|
|
273
|
-
onClick: handleControlsClick,
|
|
274
|
-
onKeyDown: e => misc.accessibleKeyDown(e, () => handleControlsClick(e)),
|
|
275
|
-
children: [ jsxRuntime.jsx("div", {
|
|
276
|
-
className: css_controlsLeft,
|
|
277
|
-
children: jsxRuntime.jsx(ToolbarButton, {
|
|
278
|
-
icon: "person",
|
|
279
|
-
iconActive: "person",
|
|
280
|
-
active: profile,
|
|
281
|
-
label: "User Info",
|
|
282
|
-
disabled: !1,
|
|
283
|
-
onClick: () => {
|
|
284
|
-
setProfile(!profile), null == onChangeProfile || onChangeProfile(userProfile);
|
|
285
|
-
}
|
|
286
|
-
})
|
|
287
|
-
}), jsxRuntime.jsxs("div", {
|
|
288
|
-
className: css_controlsCenter,
|
|
289
|
-
children: [ jsxRuntime.jsx(ToolbarButton, {
|
|
290
|
-
icon: "video",
|
|
291
|
-
iconActive: "video off",
|
|
292
|
-
active: !cameraOn,
|
|
293
|
-
label: cameraOn ? "Video" : "Off",
|
|
294
|
-
onClick: () => {
|
|
295
|
-
toggleVideo();
|
|
296
|
-
}
|
|
297
|
-
}), jsxRuntime.jsx(ToolbarButton, {
|
|
298
|
-
icon: "mic",
|
|
299
|
-
iconActive: "mic muted",
|
|
300
|
-
active: micMuted,
|
|
301
|
-
label: micMuted ? "Muted" : "Mic",
|
|
302
|
-
onClick: () => toggleMic()
|
|
303
|
-
}), jsxRuntime.jsx(ToolbarButton, {
|
|
304
|
-
icon: "camera",
|
|
305
|
-
iconActive: "camera",
|
|
306
|
-
active: !!snapshot,
|
|
307
|
-
label: "Photo",
|
|
308
|
-
disabled: !cameraOn,
|
|
309
|
-
onClick: () => cameraOn && handleSnapshot({
|
|
310
|
-
toggle: !0
|
|
311
|
-
})
|
|
312
|
-
}) ]
|
|
313
|
-
}), jsxRuntime.jsx("div", {
|
|
314
|
-
className: css_controlsRight,
|
|
315
|
-
children: jsxRuntime.jsx(ToolbarButton, {
|
|
316
|
-
icon: "more",
|
|
317
|
-
iconActive: "more",
|
|
318
|
-
active: settings,
|
|
319
|
-
label: "Settings",
|
|
320
|
-
disabled: !1,
|
|
321
|
-
onClick: () => {
|
|
322
|
-
setSettings(!settings), null == onChangeSettings || onChangeSettings(sessionSettings, deviceList);
|
|
323
|
-
}
|
|
324
|
-
})
|
|
325
|
-
}) ]
|
|
326
|
-
}) ]
|
|
327
|
-
});
|
|
328
|
-
}));
|
|
329
|
-
|
|
330
|
-
/**
|
|
331
|
-
* Custom toolbar button with labels for controlling video / audio / etc.
|
|
332
|
-
*/ function ToolbarButton(props) {
|
|
333
|
-
const {icon: icon, iconActive: iconActive, active: active, label: label, disabled: disabled, onClick: onClick, onMouseOver: onMouseOver} = props, iconColor = React.useMemo(() => active ? "var(--core-surface-primary)" : "var(--core-text-special)", [ active ]), labelColor = React.useMemo(() => active ? "var(--core-text-primary)" : disabled ? "var(--core-text-disabled)" : "var(--core-text-special)", [ active, disabled ]), cssVars = React.useMemo(() => ({
|
|
334
|
-
"--toolbar-button-size": "56px",
|
|
335
|
-
"--toolbar-button-border": "none",
|
|
336
|
-
"--toolbar-button-bg-color": active ? "var(--core-text-primary)" : "var(--core-surface-primary)",
|
|
337
|
-
"--toolbar-button-label-color": labelColor,
|
|
338
|
-
"--toolbar-button-opacity": disabled ? "0.25" : "1"
|
|
339
|
-
}), [ active, labelColor, disabled ]);
|
|
340
|
-
return jsxRuntime.jsxs("div", {
|
|
341
|
-
className: css_toolbarButton,
|
|
342
|
-
style: cssVars,
|
|
343
|
-
role: "button",
|
|
344
|
-
"aria-label": label,
|
|
345
|
-
"aria-disabled": disabled,
|
|
346
|
-
onFocus: onMouseOver,
|
|
347
|
-
onMouseOver: onMouseOver,
|
|
348
|
-
onKeyDown: e => {
|
|
349
|
-
disabled || misc.accessibleKeyDown(e, () => onClick());
|
|
350
|
-
},
|
|
351
|
-
onClick: disabled ? void 0 : onClick,
|
|
352
|
-
tabIndex: disabled ? -1 : 0,
|
|
353
|
-
children: [ jsxRuntime.jsx("div", {
|
|
354
|
-
className: css_buttonIcon,
|
|
355
|
-
children: jsxRuntime.jsx(Icon.Icon, {
|
|
356
|
-
size: 26,
|
|
357
|
-
name: active ? iconActive : icon,
|
|
358
|
-
strokeColor: iconColor
|
|
359
|
-
})
|
|
360
|
-
}), jsxRuntime.jsx("div", {
|
|
361
|
-
className: css_buttonLabel,
|
|
362
|
-
children: label
|
|
363
|
-
}) ]
|
|
364
|
-
});
|
|
365
|
-
}
|
|
366
|
-
|
|
367
|
-
/**
|
|
368
|
-
* the default poster image when no video is available
|
|
369
|
-
*/ function DefaultNoVideoPoster(props) {
|
|
370
|
-
const {size: size = .75, user: user, message: message = "Video is off"} = props;
|
|
371
|
-
return user ? jsxRuntime.jsx(Avatar.Avatar, {
|
|
372
|
-
image: null == user ? void 0 : user.avatar,
|
|
373
|
-
name: `${null == user ? void 0 : user.name}`,
|
|
374
|
-
email: `${null == user ? void 0 : user.email}`,
|
|
375
|
-
size: "50%",
|
|
376
|
-
fontSize: "25%"
|
|
377
|
-
}) : message;
|
|
378
|
-
}
|
|
379
|
-
|
|
380
|
-
exports.Camera = Camera;
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
"use strict";
|
|
3
|
-
|
|
4
|
-
var tslib_es6 = require("./tslib.es6-DL37Dyu4.js"), jsxRuntime = require("react/jsx-runtime"), react = require("motion/react"), React = require("react"), misc = require("./misc-B3tF47Um.js"), Icon = require("./Icon-B07V8-iO.js"), css_wrapper = "CheckBox-module_wrapper__uRsjI flexBox-module_row__z24tF", css_icon = "CheckBox-module_icon__FoDJN flexBox-module_row__z24tF", css_label = "CheckBox-module_label__0AiBp type-module_body-m-regular__LuQBA";
|
|
5
|
-
|
|
6
|
-
const CheckBox = React.memo(props => {
|
|
7
|
-
const {size: size = 20, checked: checked = !1, disabled: disabled = !1, color: color, children: children, onChange: onChange = () => null} = props, divAttributes = tslib_es6.__rest(props, [ "size", "checked", "disabled", "color", "children", "onChange" ]), {id: divId, className: className, style: style} = divAttributes, rest = tslib_es6.__rest(divAttributes, [ "id", "className", "style" ]), divStyle = null != style ? style : {}, divClass = className ? ` ${className}` : "", [state, setState] = React.useState(checked);
|
|
8
|
-
React.useEffect(() => setState(checked), [ checked ]);
|
|
9
|
-
const iconName = React.useMemo(() => !0 === state ? "checkbox checked" : "mixed" === state ? "checkbox partial" : "checkbox", [ state ]), iconColor = React.useMemo(() => color || (disabled ? "var(--core-icon-disabled)" : "mixed" === state ? "var(--core-icon-primary)" : state ? "var(--core-text-special)" : "var(--core-icon-secondary"), [ color, disabled, state ]), labelColor = React.useMemo(() => color || (disabled ? "var(--core-text-disabled)" : "var(--core-text-primary)"), [ color, disabled ]), cssVars = React.useMemo(() => ({
|
|
10
|
-
"--cb-size": `${size}px`,
|
|
11
|
-
"--cb-label-color": labelColor
|
|
12
|
-
}), [ size, labelColor ]), handleToggle = React.useCallback(() => {
|
|
13
|
-
if (disabled) return;
|
|
14
|
-
let newState = !1;
|
|
15
|
-
switch (state) {
|
|
16
|
-
case !0:
|
|
17
|
-
break;
|
|
18
|
-
|
|
19
|
-
case "mixed":
|
|
20
|
-
case !1:
|
|
21
|
-
newState = !0;
|
|
22
|
-
}
|
|
23
|
-
setState(newState), onChange(newState);
|
|
24
|
-
}, [ state, disabled, onChange ]);
|
|
25
|
-
return jsxRuntime.jsxs(react.motion.div, Object.assign({
|
|
26
|
-
id: divId,
|
|
27
|
-
className: `${css_wrapper}${divClass}`,
|
|
28
|
-
style: Object.assign(Object.assign({}, divStyle), cssVars),
|
|
29
|
-
onClick: handleToggle,
|
|
30
|
-
onKeyDown: e => misc.accessibleKeyDown(e, handleToggle),
|
|
31
|
-
tabIndex: disabled ? -1 : 0,
|
|
32
|
-
role: "checkbox",
|
|
33
|
-
"aria-checked": state,
|
|
34
|
-
"aria-disabled": disabled,
|
|
35
|
-
"aria-label": String(children)
|
|
36
|
-
}, rest, {
|
|
37
|
-
children: [ jsxRuntime.jsx("div", {
|
|
38
|
-
className: css_icon,
|
|
39
|
-
children: jsxRuntime.jsx(Icon.Icon, {
|
|
40
|
-
name: iconName,
|
|
41
|
-
strokeColor: iconColor,
|
|
42
|
-
size: size
|
|
43
|
-
})
|
|
44
|
-
}), children && jsxRuntime.jsx("span", {
|
|
45
|
-
className: css_label,
|
|
46
|
-
children: children
|
|
47
|
-
}) ]
|
|
48
|
-
}));
|
|
49
|
-
});
|
|
50
|
-
|
|
51
|
-
exports.CheckBox = CheckBox;
|
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
"use strict";
|
|
3
|
-
|
|
4
|
-
var tslib_es6 = require("./tslib.es6-DL37Dyu4.js"), jsxRuntime = require("react/jsx-runtime"), React = require("react"), misc = require("./misc-B3tF47Um.js"), theme_corners = require("../theme/corners.js"), Icon = require("./Icon-B07V8-iO.js"), sharedTypes = require("./sharedTypes-CnzGgdys.js"), css = {
|
|
5
|
-
chip: "Chip-module_chip__0nys- flexBox-module_row__z24tF",
|
|
6
|
-
icon: "Chip-module_icon__dtR-K flexBox-module_row__z24tF",
|
|
7
|
-
xs: "Chip-module_xs__s-KNG type-module_body-xs-regular__ZAFft",
|
|
8
|
-
s: "Chip-module_s__2KTXi type-module_body-s-regular__vRHSP",
|
|
9
|
-
m: "Chip-module_m__l2u3N type-module_body-m-regular__LuQBA",
|
|
10
|
-
l: "Chip-module_l__3MqPN type-module_body-l-regular__lOYbg",
|
|
11
|
-
xl: "Chip-module_xl__iJX-F type-module_body-xl-regular__pF2kC"
|
|
12
|
-
};
|
|
13
|
-
|
|
14
|
-
const Chip = React.memo(props => {
|
|
15
|
-
const {variant: variant = "normal", children: children, label: label, icon: icon, tooltip: tooltip, iconSize: iconSize = 20, disabled: disabled = !1, focused: focused = !1, iconPosition: iconPosition = "left", labelSize: labelSize = "m", labelColor: labelColor = "var(--core-text-primary)", labelColorHover: labelColorHover = ("normal" === variant ? labelColor : "var(--core-text-special)"), iconColor: iconColor = "var(--core-text-primary)", iconColorHover: iconColorHover = ("normal" === variant ? iconColor : "var(--core-text-special)"), backgroundColor: backgroundColor = "transparent", backgroundColorHover: backgroundColorHover = ("normal" === variant ? backgroundColor : "var(--core-surface-secondary)"), borderWidth: borderWidth, borderSize: borderSize = 1, borderColor: borderColor = "var(--core-text-primary)", borderColorHover: borderColorHover = ("normal" === variant ? borderColor : "var(--core-text-special)"), borderColorDisabled: borderColorDisabled = "var(--core-text-disabled)", borderRadius: borderRadius = theme_corners.corners["corner-m"], paddingTop: paddingTop, paddingTops: paddingTops, paddingSides: paddingSides, gap: gap = 4, onToolTip: onToolTip = () => null, onClick: onClick = () => null} = props, divAttributes = tslib_es6.__rest(props, [ "variant", "children", "label", "icon", "tooltip", "iconSize", "disabled", "focused", "iconPosition", "labelSize", "labelColor", "labelColorHover", "iconColor", "iconColorHover", "backgroundColor", "backgroundColorHover", "borderWidth", "borderSize", "borderColor", "borderColorHover", "borderColorDisabled", "borderRadius", "paddingTop", "paddingTops", "paddingSides", "gap", "onToolTip", "onClick" ]), {id: divId, className: className, style: style} = divAttributes, rest = tslib_es6.__rest(divAttributes, [ "id", "className", "style" ]), divStyle = null != style ? style : {}, divClass = className ? ` ${className}` : "", [isHovered, setIsHovered] = React.useState(!1), resolvedBackgroundColor = backgroundColor, resolvedBackgroundColorHover = backgroundColorHover, resolvedBorderWidth = null != borderWidth ? borderWidth : borderSize, resolvedPaddingTop = null != paddingTop ? paddingTop : paddingTops, handleClick = React.useCallback(e => {
|
|
16
|
-
disabled || onClick(e);
|
|
17
|
-
}, [ disabled, onClick ]), handleMouseEnter = React.useCallback((enter, event) => {
|
|
18
|
-
if (enter) {
|
|
19
|
-
if (tooltip) {
|
|
20
|
-
const tip = {
|
|
21
|
-
type: sharedTypes.ToolTipType.button,
|
|
22
|
-
payload: {
|
|
23
|
-
label: tooltip
|
|
24
|
-
},
|
|
25
|
-
ref: null,
|
|
26
|
-
event: event
|
|
27
|
-
};
|
|
28
|
-
onToolTip(tip);
|
|
29
|
-
}
|
|
30
|
-
"button" === variant && setIsHovered(!0);
|
|
31
|
-
} else onToolTip(null), setIsHovered(!1);
|
|
32
|
-
}, [ tooltip, variant, onToolTip ]), padding = React.useMemo(() => {
|
|
33
|
-
const compact = "s" === labelSize || "xs" === labelSize, vertical = void 0 === resolvedPaddingTop ? compact ? "var(--spacing-xs)" : "var(--spacing-s)" : `${resolvedPaddingTop}px`, horizontal = void 0 === paddingSides ? compact ? "var(--spacing-s)" : "var(--spacing-m)" : `${paddingSides}px`;
|
|
34
|
-
if (!label || !icon || void 0 !== paddingSides) return `${vertical} ${horizontal}`;
|
|
35
|
-
const iconPadding = `calc(${horizontal} - var(--spacing-${compact ? "xxs" : "xs"}))`;
|
|
36
|
-
return `${vertical} ${"right" === iconPosition ? iconPadding : horizontal} ${vertical} ${"right" === iconPosition ? horizontal : iconPadding}`;
|
|
37
|
-
}, [ icon, iconPosition, resolvedPaddingTop, paddingSides, label, labelSize ]), computedIconColor = React.useMemo(() => disabled ? "var(--core-text-disabled)" : isHovered ? null != iconColorHover ? iconColorHover : "var(--core-text-special)" : null != iconColor ? iconColor : "var(--core-text-primary)", [ iconColor, disabled, isHovered, iconColorHover ]), cssVars = React.useMemo(() => ({
|
|
38
|
-
"--ui-chip-padding": padding,
|
|
39
|
-
"--ui-chip-gap": misc.setStyle(gap),
|
|
40
|
-
"--ui-chip-border-radius": misc.setStyle(borderRadius),
|
|
41
|
-
"--ui-chip-border-size": misc.setStyle(resolvedBorderWidth),
|
|
42
|
-
"--ui-chip-border-color": disabled ? borderColorDisabled : borderColor,
|
|
43
|
-
"--ui-chip-border-color-hover": disabled ? borderColorDisabled : borderColorHover,
|
|
44
|
-
"--ui-chip-bg-color": resolvedBackgroundColor,
|
|
45
|
-
"--ui-chip-bg-color-hover": disabled ? resolvedBackgroundColor : resolvedBackgroundColorHover,
|
|
46
|
-
"--ui-chip-label-color": disabled ? "var(--core-text-disabled)" : labelColor,
|
|
47
|
-
"--ui-chip-label-color-hover": disabled ? "var(--core-text-disabled)" : labelColorHover,
|
|
48
|
-
"--ui-chip-cursor": disabled || "normal" === variant ? "default" : "pointer"
|
|
49
|
-
}), [ padding, resolvedBackgroundColor, borderColor, borderColorDisabled, borderColorHover, resolvedBorderWidth, resolvedBackgroundColorHover, labelColorHover, labelColor, gap, borderRadius, disabled, variant ]);
|
|
50
|
-
return jsxRuntime.jsxs("div", Object.assign({
|
|
51
|
-
id: divId,
|
|
52
|
-
className: `${css.chip}${divClass}`,
|
|
53
|
-
style: Object.assign(Object.assign({}, divStyle), cssVars),
|
|
54
|
-
onKeyDown: e => misc.accessibleKeyDown(e, () => handleClick(e)),
|
|
55
|
-
onClick: handleClick,
|
|
56
|
-
onMouseEnter: e => handleMouseEnter(!0, e),
|
|
57
|
-
onMouseLeave: e => handleMouseEnter(!1, e)
|
|
58
|
-
}, rest, {
|
|
59
|
-
children: [ icon && "right" !== iconPosition && jsxRuntime.jsx("div", {
|
|
60
|
-
className: css.icon,
|
|
61
|
-
children: jsxRuntime.jsx(Icon.Icon, {
|
|
62
|
-
name: icon,
|
|
63
|
-
size: iconSize,
|
|
64
|
-
strokeColor: computedIconColor
|
|
65
|
-
})
|
|
66
|
-
}), (children || label) && jsxRuntime.jsx("div", {
|
|
67
|
-
className: css[labelSize],
|
|
68
|
-
children: null != children ? children : label
|
|
69
|
-
}), icon && "right" === iconPosition && jsxRuntime.jsx("div", {
|
|
70
|
-
className: css.icon,
|
|
71
|
-
children: jsxRuntime.jsx(Icon.Icon, {
|
|
72
|
-
name: icon,
|
|
73
|
-
size: iconSize,
|
|
74
|
-
strokeColor: computedIconColor
|
|
75
|
-
})
|
|
76
|
-
}) ]
|
|
77
|
-
}));
|
|
78
|
-
});
|
|
79
|
-
|
|
80
|
-
exports.Chip = Chip;
|
|
@@ -1,101 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
"use strict";
|
|
3
|
-
|
|
4
|
-
var tslib_es6 = require("./tslib.es6-DL37Dyu4.js"), jsxRuntime = require("react/jsx-runtime"), react = require("motion/react"), React = require("react"), misc = require("./misc-B3tF47Um.js"), theme_corners = require("../theme/corners.js"), css_wrapper = "DivInput-module_wrapper__ZQxY-", css_input = "DivInput-module_input__J34-l type-module_body-m-regular__LuQBA";
|
|
5
|
-
|
|
6
|
-
const DivInput = React.memo(props => {
|
|
7
|
-
const {value: valueProp = "", name: name = "Input Field", placeholder: placeholder = "Placeholder", isEditable: isEditable = !0, wrap: wrap = !1, focus: focus = !1, width: width = "auto", textAlign: textAlign = "left", clamp: clamp = 3, padding: padding = "0px", onChange: onChange = () => null, onSubmit: onSubmit = () => null, onFocus: onFocus = () => null, onBlur: onBlur = () => null, onDblClick: onDblClick = () => null, onClick: onClick = () => null, borderRadius: borderRadius, radius: radius = theme_corners.corners["corner-xs"], backgroundColor: backgroundColor = "var(--core-surface-secondary)"} = props, divAttributes = tslib_es6.__rest(props, [ "value", "name", "placeholder", "isEditable", "wrap", "focus", "width", "textAlign", "clamp", "padding", "onChange", "onSubmit", "onFocus", "onBlur", "onDblClick", "onClick", "borderRadius", "radius", "backgroundColor" ]), {id: divId, className: className, style: style} = divAttributes, rest = tslib_es6.__rest(divAttributes, [ "id", "className", "style" ]), divStyle = null != style ? style : {}, divClass = className ? ` ${className}` : "", ref = React.useRef(null), value = null != valueProp ? valueProp : "", innerText = React.useRef("" === value ? misc.cleanString(placeholder) : misc.cleanString(value)), [isFocused, setIsFocused] = React.useState(focus), [text, setText] = React.useState(innerText.current), [isPlaceholder, setIsPlaceholder] = React.useState(!1), resolvedBorderRadius = null != borderRadius ? borderRadius : radius, resolvedBackgroundColor = backgroundColor, setCursor = React.useCallback((to, length = 1) => {
|
|
8
|
-
if (ref.current) {
|
|
9
|
-
const range = document.createRange();
|
|
10
|
-
range.setStart(ref.current, "start" === to ? 0 : length), range.setEnd(ref.current, "start" === to ? 0 : 1);
|
|
11
|
-
const selection = globalThis.getSelection();
|
|
12
|
-
null == selection || selection.removeAllRanges(), null == selection || selection.addRange(range);
|
|
13
|
-
}
|
|
14
|
-
}, []), handleSelectAll = React.useCallback(() => {
|
|
15
|
-
var _a, _b, _c;
|
|
16
|
-
if (!(null === (_a = ref.current) || void 0 === _a ? void 0 : _a.firstChild)) return;
|
|
17
|
-
const range = document.createRange();
|
|
18
|
-
range.selectNode(ref.current.firstChild), null === (_b = globalThis.getSelection()) || void 0 === _b || _b.removeAllRanges(),
|
|
19
|
-
null === (_c = globalThis.getSelection()) || void 0 === _c || _c.addRange(range);
|
|
20
|
-
}, []);
|
|
21
|
-
React.useEffect(() => {
|
|
22
|
-
if (!ref.current) return;
|
|
23
|
-
ref.current.contentEditable = isEditable ? "true" : "false", focus && (handleSelectAll(),
|
|
24
|
-
ref.current.focus()), setIsFocused(focus);
|
|
25
|
-
const newText = "" === value ? misc.cleanString(placeholder) : misc.cleanString(value);
|
|
26
|
-
innerText.current = newText, ref.current.innerText = newText, setText(newText);
|
|
27
|
-
}, [ value, placeholder, focus, isEditable, handleSelectAll ]), React.useEffect(() => {
|
|
28
|
-
placeholder && setIsPlaceholder(text === placeholder);
|
|
29
|
-
}, [ placeholder, text ]);
|
|
30
|
-
const handleSetValue = React.useCallback(e => {
|
|
31
|
-
let textString = "";
|
|
32
|
-
if (0 === e.currentTarget.innerText.replaceAll(/\s+/g, "").length && placeholder && ref.current) ref.current.innerText = placeholder,
|
|
33
|
-
setIsPlaceholder(!0), setCursor("start"); else if (isPlaceholder) {
|
|
34
|
-
const textString = e.currentTarget.innerText.replace(placeholder, "");
|
|
35
|
-
innerText.current = misc.cleanString(textString), ref.current && (ref.current.innerText = misc.cleanString(textString),
|
|
36
|
-
setCursor("end"));
|
|
37
|
-
} else textString = e.currentTarget.innerText, innerText.current = misc.cleanString(textString || "");
|
|
38
|
-
onChange(innerText.current), setText(innerText.current);
|
|
39
|
-
}, [ placeholder, isPlaceholder, onChange, setCursor ]), handleKeyDown = React.useCallback(e => (e.stopPropagation(),
|
|
40
|
-
"Enter" === e.key && ref.current ? (e.preventDefault(), ref.current.innerHTML = misc.cleanString(innerText.current),
|
|
41
|
-
onChange(null), onSubmit(innerText.current), null == ref || ref.current.blur(),
|
|
42
|
-
!0) : "<" === e.key || ">" === e.key ? (e.preventDefault(), !1) : void 0), [ onChange, onSubmit ]), handlePaste = React.useCallback(e => {
|
|
43
|
-
var _a;
|
|
44
|
-
if (e.preventDefault(), !e.clipboardData) return;
|
|
45
|
-
const textData = e.clipboardData.getData("text/plain");
|
|
46
|
-
if (!textData) return;
|
|
47
|
-
const pasteText = misc.cleanString(textData), selection = globalThis.getSelection();
|
|
48
|
-
if (!(null == selection ? void 0 : selection.rangeCount)) return;
|
|
49
|
-
null == selection || selection.deleteFromDocument(), null == selection || selection.getRangeAt(0).insertNode(document.createTextNode(pasteText)),
|
|
50
|
-
null == selection || selection.collapseToEnd();
|
|
51
|
-
const newText = (null === (_a = ref.current) || void 0 === _a ? void 0 : _a.innerText) || "";
|
|
52
|
-
return onChange(misc.cleanString(newText)), innerText.current = misc.cleanString(newText),
|
|
53
|
-
!0;
|
|
54
|
-
}, [ onChange ]), handleFocus = React.useCallback(e => {
|
|
55
|
-
setIsFocused(!0), onFocus(e);
|
|
56
|
-
}, [ onFocus ]), handleBlur = React.useCallback(_e => {
|
|
57
|
-
if (!ref.current) return;
|
|
58
|
-
const blurText = misc.cleanString(innerText.current);
|
|
59
|
-
"" === blurText && (ref.current.innerText = placeholder, innerText.current = placeholder),
|
|
60
|
-
onChange(null), onSubmit(innerText.current), setIsFocused(!1), onBlur(blurText);
|
|
61
|
-
}, [ placeholder, onChange, onSubmit, onBlur ]), handleClick = React.useCallback(e => {
|
|
62
|
-
e.preventDefault(), e.stopPropagation(), isPlaceholder && setTimeout(() => setCursor("start"), 50),
|
|
63
|
-
onClick();
|
|
64
|
-
}, [ isPlaceholder, setCursor, onClick ]), setWidth = React.useCallback(width => "string" == typeof width ? width : `${width}px`, []), cssVars = React.useMemo(() => ({
|
|
65
|
-
"--div-input-color": isPlaceholder ? "var(--core-text-tertiary)" : "var(--core-text-primary)",
|
|
66
|
-
"--div-input-width": `${setWidth(width)}`,
|
|
67
|
-
"--div-input-user-select": isEditable ? "text" : "none",
|
|
68
|
-
"--div-input-padding": null != padding ? padding : "0",
|
|
69
|
-
"--div-input-text-align": null != textAlign ? textAlign : "left",
|
|
70
|
-
"--div-input-white-space": isEditable && wrap ? "wrap" : "no-wrap",
|
|
71
|
-
"--div-input-line-clamp": isEditable && isFocused ? "none" : null != clamp ? clamp : "none",
|
|
72
|
-
"--div-input-cursor": isEditable ? "text" : "default",
|
|
73
|
-
"--div-input-bg": isEditable ? null != resolvedBackgroundColor ? resolvedBackgroundColor : "var(--core-surface-secondary)" : "transparent",
|
|
74
|
-
"--div-input-wrapper-bg": isEditable && isFocused ? null != resolvedBackgroundColor ? resolvedBackgroundColor : "var(--core-surface-secondary)" : "transparent",
|
|
75
|
-
"--div-input-border-radius": misc.setStyle(resolvedBorderRadius)
|
|
76
|
-
}), [ clamp, wrap, isEditable, width, textAlign, isFocused, padding, isPlaceholder, setWidth, resolvedBackgroundColor, resolvedBorderRadius ]);
|
|
77
|
-
return jsxRuntime.jsx("div", Object.assign({
|
|
78
|
-
id: divId,
|
|
79
|
-
className: `${css_wrapper}${divClass}`,
|
|
80
|
-
style: Object.assign(Object.assign({}, divStyle), cssVars)
|
|
81
|
-
}, rest, {
|
|
82
|
-
children: jsxRuntime.jsx(react.motion.div, {
|
|
83
|
-
className: css_input,
|
|
84
|
-
ref: ref,
|
|
85
|
-
contentEditable: isEditable,
|
|
86
|
-
suppressContentEditableWarning: !0,
|
|
87
|
-
onInput: handleSetValue,
|
|
88
|
-
onKeyDown: handleKeyDown,
|
|
89
|
-
onFocus: handleFocus,
|
|
90
|
-
onBlur: handleBlur,
|
|
91
|
-
onPaste: handlePaste,
|
|
92
|
-
onDoubleClick: onDblClick,
|
|
93
|
-
onClick: handleClick,
|
|
94
|
-
role: "textbox",
|
|
95
|
-
"aria-label": name,
|
|
96
|
-
children: null != valueProp ? valueProp : placeholder
|
|
97
|
-
})
|
|
98
|
-
}));
|
|
99
|
-
});
|
|
100
|
-
|
|
101
|
-
DivInput.displayName = "DivInput", exports.DivInput = DivInput;
|