@apple-pie/slice 0.1.31 → 0.1.33
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 +35 -284
- package/dist/cjs/chunks/{AudioBubble-k7qS53g6.js → AudioBubble-_eYM1QMu.js} +4 -3
- package/dist/cjs/chunks/{Avatar-hP8GuwvD.js → Avatar-DTro_MXZ.js} +1 -1
- package/dist/cjs/chunks/{AvatarGroup-DMy34q7_.js → AvatarGroup-OPJJ_Te5.js} +1 -1
- package/dist/cjs/chunks/{Badge-D2TbyfJS.js → Badge-DWUeXxm2.js} +1 -1
- package/dist/cjs/chunks/{Button-CTsHZBEB.js → Button-CuGvPAkH.js} +1 -1
- package/dist/cjs/chunks/{ButtonBar-BRb1PTmw.js → ButtonBar-CbXToyfD.js} +1 -1
- package/dist/cjs/chunks/{Camera-CKv087kr.js → Camera-DjENiyud.js} +5 -4
- package/dist/cjs/chunks/{CheckBox-VRIL1FHh.js → CheckBox-DiJpbdy5.js} +1 -1
- package/dist/cjs/chunks/{Chip-Dr3vKvRY.js → Chip-kzOvEo0P.js} +1 -1
- package/dist/cjs/chunks/{DivInput-Ci0gaCWL.js → DivInput-B917fKB9.js} +1 -1
- package/dist/cjs/chunks/{Dot-C0MvSJOl.js → Dot-DaRF2JyO.js} +1 -1
- package/dist/cjs/chunks/{DrggablePanel-DflouLUs.js → DrggablePanel-CJTEmYW6.js} +4 -3
- package/dist/cjs/chunks/{DropDown-BS1H62yj.js → DropDown-DRSQvXCC.js} +1 -1
- package/dist/cjs/chunks/{ErrorSummary-B3tof7ir.js → ErrorSummary-ltiIsgJ6.js} +4 -3
- package/dist/cjs/chunks/{FileIcon-Te8MaqTs.js → FileIcon-WIVOTJLa.js} +5 -3
- package/dist/cjs/chunks/{FileList-CDcfKIV6.js → FileList-CzQZZErI.js} +1 -1
- package/dist/cjs/chunks/{FlexDiv-wO8IY0Zf.js → FlexDiv-CBENyLT4.js} +1 -1
- package/dist/cjs/chunks/{Grouper-DyGkzdvz.js → Grouper-Cd3AJEFv.js} +4 -3
- package/dist/cjs/chunks/{Icon-BFZ_5Qv3.js → Icon-DjvProjz.js} +4 -3
- package/dist/cjs/chunks/{IconButton-CgsuJIuF.js → IconButton-BuwQLUuj.js} +1 -1
- package/dist/cjs/chunks/{IndexedDB-Dgwal8na.js → IndexedDB-Ddhq6Gjd.js} +1 -1
- package/dist/cjs/chunks/{Label-BuyhcJbF.js → Label-d32ENzwL.js} +1 -1
- package/dist/cjs/chunks/Level-B8eT8XyV.js +58 -0
- package/dist/cjs/chunks/{MdStreamBuffer-CbG_VeRI.js → MdStreamBuffer-Chwibu07.js} +38 -16
- package/dist/cjs/chunks/{Modal-ByRyv3wy.js → Modal-CUAj4e6x.js} +34 -8
- package/dist/cjs/chunks/ModalController-BwFAVI5G.js +80 -0
- package/dist/cjs/chunks/{Overlay-FooE9M_s.js → Overlay-CaAA3ey5.js} +1 -1
- package/dist/cjs/chunks/{Pager-B-cuwffo.js → Pager-uExZ5E3x.js} +1 -1
- package/dist/cjs/chunks/{ProgressIndicator-ByZ_aYAZ.js → ProgressIndicator-DwqslY4o.js} +4 -3
- package/dist/cjs/chunks/{PromptInput--grtHPvy.js → PromptInput-Dl8l8cZv.js} +34 -30
- package/dist/cjs/chunks/{RadioButton-DP2X1dA_.js → RadioButton-DPpAOFQt.js} +1 -1
- package/dist/cjs/chunks/{RadioButtonList-COGNW5y3.js → RadioButtonList-IbPA6A3y.js} +1 -1
- package/dist/cjs/chunks/{Slider-G1a8UKef.js → Slider-D5oa7NGy.js} +1 -1
- package/dist/cjs/chunks/{Spacer-CsRCleXv.js → Spacer-DtUh2VLv.js} +1 -1
- package/dist/cjs/chunks/{Switch-OBVHKn_D.js → Switch-Bs0r5va5.js} +1 -1
- package/dist/cjs/chunks/{TabBar-C1HkBaxE.js → TabBar-BCSTg_Uc.js} +4 -3
- package/dist/cjs/chunks/{TextArea-BEmNI_HZ.js → TextArea-Dj7jsvVr.js} +1 -1
- package/dist/cjs/chunks/{TextField-D9_COA9H.js → TextField-DNP0wJla.js} +5 -4
- package/dist/cjs/chunks/{Tip-2W0u_oQN.js → Tip-awq6PDZa.js} +1 -1
- package/dist/cjs/chunks/{Toast-B9jX6ioq.js → Toast-xS1TC3Ba.js} +7 -6
- package/dist/cjs/chunks/{ToggleButton-C_Gu5dYR.js → ToggleButton-CqD5c6JA.js} +4 -3
- package/dist/cjs/chunks/{UploadArea-ENFAf4tE.js → UploadArea-CvWqk8YK.js} +1 -1
- package/dist/cjs/chunks/{WSConnection-CZ22tcLz.js → WSConnection-BACWw4TS.js} +1 -1
- package/dist/cjs/chunks/WebRTCConnection-DBeyg4j9.js +252 -0
- package/dist/cjs/chunks/{localDBStore-Ca73jeFf.js → localDBStore-wgCc1SmV.js} +1 -1
- package/dist/cjs/chunks/{microphoneStore-lxYIvhN8.js → microphoneStore-Dy5TwE2I.js} +27 -4
- package/dist/cjs/chunks/{misc-DZAbObFp.js → misc-BwQIEIuF.js} +1 -1
- package/dist/cjs/chunks/{sseStore-Bq7sVvyA.js → sseStore-CFFaYonG.js} +2 -2
- package/dist/cjs/chunks/{uploads-worker-CD-annza.js → uploads-worker-DWvOe9F8.js} +1 -1
- package/dist/cjs/chunks/{uploadsStore-CUeB10zx.js → uploadsStore-BCmts7Ie.js} +2 -2
- package/dist/cjs/chunks/{volumeStore-roYTyKJ2.js → volumeStore-BXFAQhvS.js} +5 -4
- package/dist/cjs/chunks/webRTCStore-DRjvbnve.js +55 -0
- package/dist/cjs/chunks/{windowStore-BdJv-RF0.js → windowStore-C4Bg6I9i.js} +1 -1
- package/dist/cjs/components/AudioBubble/index.js +6 -4
- package/dist/cjs/components/Avatar/index.js +3 -3
- package/dist/cjs/components/AvatarGroup/index.js +3 -3
- package/dist/cjs/components/Badge/index.js +2 -2
- package/dist/cjs/components/Button/index.js +9 -7
- package/dist/cjs/components/ButtonBar/index.js +6 -4
- package/dist/cjs/components/Camera/index.js +7 -5
- package/dist/cjs/components/CheckBox/index.js +6 -4
- package/dist/cjs/components/Chip/index.js +7 -5
- package/dist/cjs/components/DivInput/index.js +3 -3
- package/dist/cjs/components/Dot/index.js +2 -2
- package/dist/cjs/components/DraggablePanel/index.js +5 -3
- package/dist/cjs/components/DropDown/index.js +6 -4
- package/dist/cjs/components/ErrorSummary/index.js +5 -3
- package/dist/cjs/components/FileIcon/index.js +5 -3
- package/dist/cjs/components/FileList/index.js +7 -5
- package/dist/cjs/components/FlexDiv/index.js +2 -2
- package/dist/cjs/components/Grouper/index.js +7 -5
- package/dist/cjs/components/Icon/index.js +5 -3
- package/dist/cjs/components/IconButton/index.js +8 -6
- package/dist/cjs/components/Label/index.js +3 -3
- package/dist/cjs/components/Level/index.js +7 -0
- package/dist/cjs/components/Modal/index.js +10 -8
- package/dist/cjs/components/ModalController/index.js +6 -4
- package/dist/cjs/components/Overlay/index.js +2 -2
- package/dist/cjs/components/Pager/index.js +3 -3
- package/dist/cjs/components/Progress/index.js +5 -3
- package/dist/cjs/components/PromptInput/index.js +9 -7
- package/dist/cjs/components/RadioButton/index.js +6 -4
- package/dist/cjs/components/RadioButtonList/index.js +7 -5
- package/dist/cjs/components/Slider/index.js +4 -4
- package/dist/cjs/components/Spacer/index.js +2 -2
- package/dist/cjs/components/Switch/index.js +2 -2
- package/dist/cjs/components/TabBar/index.js +8 -6
- package/dist/cjs/components/TextArea/index.js +9 -7
- package/dist/cjs/components/Textfield/index.js +9 -7
- package/dist/cjs/components/Tip/index.js +3 -3
- package/dist/cjs/components/Toast/index.js +6 -4
- package/dist/cjs/components/ToggleButton/index.js +9 -7
- package/dist/cjs/components/UploadArea/index.js +11 -10
- package/dist/cjs/hooks/useAudioRecorder.js +1 -1
- package/dist/cjs/hooks/useBindWebRTC.js +60 -0
- package/dist/cjs/hooks/useLocalStore.js +3 -3
- package/dist/cjs/hooks/useMdStreamBuffer.js +55 -30
- package/dist/cjs/hooks/useMicrophone.js +1 -1
- package/dist/cjs/hooks/useTrackRenders.js +2 -2
- package/dist/cjs/hooks.js +7 -4
- package/dist/cjs/index.js +19 -18
- package/dist/cjs/providers/ThemeProvider.js +5 -4
- package/dist/cjs/providers/themeServer.js +15 -9
- package/dist/cjs/stores/LocalDB.js +3 -3
- package/dist/cjs/stores/SSE.js +2 -2
- package/dist/cjs/stores/WS.js +2 -2
- package/dist/cjs/stores/WebRTC.js +9 -0
- package/dist/cjs/stores/microphone.js +5 -4
- package/dist/cjs/stores/modal.js +1 -1
- 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/volume.js +2 -2
- package/dist/cjs/stores/window.js +2 -2
- package/dist/cjs/stores.js +24 -19
- package/dist/cjs/utils/index.js +4 -3
- package/dist/cjs/utils/objects/index.js +4 -3
- package/dist/cjs/workers/uploads/uploads.js +2 -2
- package/dist/esm/chunks/{AudioBubble-DfrxyTX_.mjs → AudioBubble-SB1LCBlJ.mjs} +9 -3
- package/dist/esm/chunks/{Avatar-pA41Pcyl.mjs → Avatar-B6PcVOmT.mjs} +2 -2
- package/dist/esm/chunks/{AvatarGroup-CZBtWjnj.mjs → AvatarGroup-DEb3j2IZ.mjs} +2 -2
- package/dist/esm/chunks/{Badge-pLwG0zm7.mjs → Badge-bh5UVUnt.mjs} +1 -1
- package/dist/esm/chunks/{Button-BJoMLZIs.mjs → Button-CWKs3uAV.mjs} +6 -6
- package/dist/esm/chunks/{ButtonBar-BO2RUJ8R.mjs → ButtonBar-CWeMhkSb.mjs} +3 -3
- package/dist/esm/chunks/{Camera-4MNA52HG.mjs → Camera-BmuMA9xY.mjs} +11 -5
- package/dist/esm/chunks/{CheckBox-7KAsvZld.mjs → CheckBox-BR6a2n0j.mjs} +3 -3
- package/dist/esm/chunks/{Chip-BuGvCLLU.mjs → Chip-DXW0jxKf.mjs} +4 -4
- package/dist/esm/chunks/{DivInput-D0YzSWjJ.mjs → DivInput-BWO1EJXA.mjs} +2 -2
- package/dist/esm/chunks/{Dot-h26m47Z-.mjs → Dot-DMst-5Q2.mjs} +1 -1
- package/dist/esm/chunks/{DrggablePanel-Bh6HLPMX.mjs → DrggablePanel-qxrCS7Ot.mjs} +8 -2
- package/dist/esm/chunks/{DropDown-NgMYjjXn.mjs → DropDown-DlO2J4QP.mjs} +3 -3
- package/dist/esm/chunks/{ErrorSummary-nNm9qymE.mjs → ErrorSummary-BplQFunJ.mjs} +8 -2
- package/dist/esm/chunks/{FileIcon-BqyV1wut.mjs → FileIcon-iFmAF7_a.mjs} +8 -2
- package/dist/esm/chunks/{FileList-C1tOvoc0.mjs → FileList-CztHFCJe.mjs} +5 -5
- package/dist/esm/chunks/{FlexDiv-CkK-DAyg.mjs → FlexDiv-DGmDZL7M.mjs} +1 -1
- package/dist/esm/chunks/{Grouper-CyrOkuu2.mjs → Grouper-DxOISLzH.mjs} +9 -3
- package/dist/esm/chunks/{Icon-DjW0Krm8.mjs → Icon-L8B35JN1.mjs} +8 -2
- package/dist/esm/chunks/{IconButton-DdLhTUl0.mjs → IconButton-DxwJemEK.mjs} +5 -5
- package/dist/esm/chunks/{IndexedDB-DVoDikoA.mjs → IndexedDB-DA5oZXju.mjs} +1 -1
- package/dist/esm/chunks/{Label-DhmJ_Sln.mjs → Label-wDPtyK4h.mjs} +2 -2
- package/dist/esm/chunks/Level-B9JayinM.mjs +63 -0
- package/dist/esm/chunks/{MdStreamBuffer-4AJH8WaN.mjs → MdStreamBuffer-Cyon3ytf.mjs} +38 -16
- package/dist/esm/chunks/{Modal-FztrJsQo.mjs → Modal-C-Q2A_RY.mjs} +39 -13
- package/dist/esm/chunks/ModalController-ClAjHLPb.mjs +91 -0
- package/dist/esm/chunks/{Overlay-Dsy55Bxm.mjs → Overlay-Dr9YYxJ6.mjs} +1 -1
- package/dist/esm/chunks/{Pager-BqSdwL0L.mjs → Pager-DPbTCMNe.mjs} +2 -2
- package/dist/esm/chunks/{ProgressIndicator-BnqZFATV.mjs → ProgressIndicator-HaJJDZ-m.mjs} +8 -2
- package/dist/esm/chunks/{PromptInput-CRkcPXJu.mjs → PromptInput-wGhpXw-h.mjs} +38 -31
- package/dist/esm/chunks/{RadioButton-DXq3yniV.mjs → RadioButton-oOGgTDhg.mjs} +3 -3
- package/dist/esm/chunks/{RadioButtonList-BgOskHCP.mjs → RadioButtonList-CDWKVvyL.mjs} +3 -3
- package/dist/esm/chunks/{Slider-DPOy9uNI.mjs → Slider-ioPGftDY.mjs} +3 -3
- package/dist/esm/chunks/{Spacer-BJd_D0Fn.mjs → Spacer-VJBjxVlr.mjs} +1 -1
- package/dist/esm/chunks/{Switch-DHqlyizo.mjs → Switch-BCk2sTh3.mjs} +1 -1
- package/dist/esm/chunks/{TabBar-RBXExqMK.mjs → TabBar-C1DYnCRx.mjs} +11 -5
- package/dist/esm/chunks/{TextArea-CIlx_P26.mjs → TextArea-CF3r5m2G.mjs} +2 -2
- package/dist/esm/chunks/{TextField-CX72ybwH.mjs → TextField-BNfTj9v2.mjs} +11 -5
- package/dist/esm/chunks/{Tip-COBSyEjm.mjs → Tip-DIKQvxxO.mjs} +2 -2
- package/dist/esm/chunks/{Toast-BTm3HxDD.mjs → Toast-CkXPrDpp.mjs} +12 -6
- package/dist/esm/chunks/{ToggleButton-DujsCKF3.mjs → ToggleButton-Dvy8fc4t.mjs} +5 -4
- package/dist/esm/chunks/{UploadArea-D--Nt8Ed.mjs → UploadArea-D_xGzR2e.mjs} +4 -4
- package/dist/esm/chunks/{WSConnection-BMXcuW3f.mjs → WSConnection-TiYLENWB.mjs} +1 -1
- package/dist/esm/chunks/WebRTCConnection-d0Yvd66q.mjs +252 -0
- package/dist/esm/chunks/{localDBStore-36E3160Z.mjs → localDBStore-C-5y16uv.mjs} +2 -2
- package/dist/esm/chunks/{microphoneStore-Cexu82zH.mjs → microphoneStore-Cbx9nV4R.mjs} +26 -3
- package/dist/esm/chunks/{misc-CTGTuM2J.mjs → misc-zecH7-IH.mjs} +1 -1
- package/dist/esm/chunks/{sseStore-Dow4NXkZ.mjs → sseStore-DIquUNpm.mjs} +2 -2
- package/dist/esm/chunks/{tslib.es6-BX2F90pK.mjs → tslib.es6-CVvvNSPr.mjs} +1 -1
- package/dist/esm/chunks/{uploads-worker-Dhyp4ot3.mjs → uploads-worker-CUggKU9b.mjs} +1 -1
- package/dist/esm/chunks/{uploadsStore-DT4lFybE.mjs → uploadsStore-9QngohOe.mjs} +1 -1
- package/dist/esm/chunks/{volumeStore-RAxdmQ60.mjs → volumeStore-BrgZCRKF.mjs} +5 -4
- package/dist/esm/chunks/webRTCStore-DhFE9-bb.mjs +57 -0
- package/dist/esm/chunks/{windowStore-C4AZexIa.mjs → windowStore-BKW7HyoD.mjs} +1 -1
- package/dist/esm/components/AudioBubble/index.mjs +14 -4
- package/dist/esm/components/Avatar/index.mjs +3 -3
- package/dist/esm/components/AvatarGroup/index.mjs +4 -4
- package/dist/esm/components/Badge/index.mjs +2 -2
- package/dist/esm/components/Button/index.mjs +18 -8
- package/dist/esm/components/ButtonBar/index.mjs +14 -4
- package/dist/esm/components/Camera/index.mjs +16 -6
- package/dist/esm/components/CheckBox/index.mjs +14 -4
- package/dist/esm/components/Chip/index.mjs +15 -5
- package/dist/esm/components/DivInput/index.mjs +3 -3
- package/dist/esm/components/Dot/index.mjs +2 -2
- package/dist/esm/components/DraggablePanel/index.mjs +13 -3
- package/dist/esm/components/DropDown/index.mjs +14 -4
- package/dist/esm/components/ErrorSummary/index.mjs +13 -3
- package/dist/esm/components/FileIcon/index.mjs +13 -3
- package/dist/esm/components/FileList/index.mjs +16 -6
- package/dist/esm/components/FlexDiv/index.mjs +2 -2
- package/dist/esm/components/Grouper/index.mjs +15 -5
- package/dist/esm/components/Icon/index.mjs +14 -4
- package/dist/esm/components/IconButton/index.mjs +17 -7
- package/dist/esm/components/Label/index.mjs +3 -3
- package/dist/esm/components/Level/index.mjs +11 -0
- package/dist/esm/components/Modal/index.mjs +20 -10
- package/dist/esm/components/ModalController/index.mjs +14 -6
- package/dist/esm/components/Overlay/index.mjs +2 -2
- package/dist/esm/components/Pager/index.mjs +3 -3
- package/dist/esm/components/Progress/index.mjs +14 -4
- package/dist/esm/components/PromptInput/index.mjs +22 -12
- package/dist/esm/components/RadioButton/index.mjs +14 -4
- package/dist/esm/components/RadioButtonList/index.mjs +15 -5
- package/dist/esm/components/Slider/index.mjs +4 -4
- package/dist/esm/components/Spacer/index.mjs +2 -2
- package/dist/esm/components/Switch/index.mjs +2 -2
- package/dist/esm/components/TabBar/index.mjs +18 -8
- package/dist/esm/components/TextArea/index.mjs +19 -9
- package/dist/esm/components/Textfield/index.mjs +20 -10
- package/dist/esm/components/Tip/index.mjs +3 -3
- package/dist/esm/components/Toast/index.mjs +15 -5
- package/dist/esm/components/ToggleButton/index.mjs +19 -9
- package/dist/esm/components/UploadArea/index.mjs +19 -9
- package/dist/esm/hooks/useAudioRecorder.mjs +1 -1
- package/dist/esm/hooks/useBindWebRTC.mjs +72 -0
- package/dist/esm/hooks/useLocalStore.mjs +3 -3
- package/dist/esm/hooks/useMdStreamBuffer.mjs +56 -28
- package/dist/esm/hooks/useMicrophone.mjs +1 -1
- package/dist/esm/hooks/useTrackRenders.mjs +2 -2
- package/dist/esm/hooks.mjs +14 -2
- package/dist/esm/index.mjs +62 -50
- package/dist/esm/providers/ThemeProvider.mjs +6 -5
- package/dist/esm/providers/themeServer.mjs +11 -6
- package/dist/esm/stores/LocalDB.mjs +3 -3
- package/dist/esm/stores/SSE.mjs +3 -3
- package/dist/esm/stores/WS.mjs +2 -2
- package/dist/esm/stores/WebRTC.mjs +7 -0
- package/dist/esm/stores/microphone.mjs +2 -2
- package/dist/esm/stores/modal.mjs +1 -1
- 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/volume.mjs +2 -2
- package/dist/esm/stores/window.mjs +2 -2
- package/dist/esm/stores.mjs +18 -14
- package/dist/esm/utils/index.mjs +11 -9
- package/dist/esm/utils/objects/index.mjs +8 -6
- package/dist/esm/workers/uploads/uploads.mjs +2 -2
- package/dist/styles.css +76 -13
- package/dist/types/components/Level/Level.d.ts +5 -0
- package/dist/types/components/Level/_types.d.ts +21 -0
- package/dist/types/components/Level/index.d.ts +2 -0
- package/dist/types/components/Modal/_types.d.ts +3 -0
- package/dist/types/components/PromptInput/PromptInput.d.ts +10 -2
- package/dist/types/components/PromptInput/_types.d.ts +5 -1
- package/dist/types/components/Toast/_types.d.ts +1 -0
- package/dist/types/components/ToggleButton/_types.d.ts +1 -0
- package/dist/types/hooks/index.d.ts +2 -0
- package/dist/types/hooks/useBindWebRTC/index.d.ts +1 -0
- package/dist/types/hooks/useBindWebRTC/useBindWebRTC.d.ts +15 -0
- package/dist/types/hooks/useLocalStore/useLocalStore.d.ts +1 -1
- package/dist/types/hooks/useMdStreamBuffer/useMdStreamBuffer.d.ts +6 -1
- package/dist/types/index.d.ts +3 -1
- package/dist/types/providers/ThemeProvider.d.ts +1 -0
- package/dist/types/providers/themeServer.d.ts +7 -3
- package/dist/types/stores/WebRTC/_types.d.ts +16 -0
- package/dist/types/stores/WebRTC/index.d.ts +2 -0
- package/dist/types/stores/WebRTC/webRTCStore.d.ts +21 -0
- package/dist/types/stores/index.d.ts +1 -0
- package/dist/types/stores/microphone/index.d.ts +1 -1
- package/dist/types/stores/microphone/microphoneStore.d.ts +14 -1
- package/dist/types/stores/toast/_types.d.ts +1 -0
- package/dist/types/stores/volume/_types.d.ts +3 -1
- package/dist/types/stores/volume/volumeStore.d.ts +6 -2
- package/dist/types/utils/functions/files.d.ts +1 -1
- package/dist/types/utils/index.d.ts +2 -2
- package/dist/types/utils/objects/MDStreamBuffer/MdStreamBuffer.d.ts +10 -0
- package/dist/types/utils/objects/MDStreamBuffer/_types.d.ts +2 -0
- package/dist/types/utils/objects/WebRTCConnection/WebRTCConnection.d.ts +37 -3
- package/dist/types/utils/objects/WebRTCConnection/_types.d.ts +13 -4
- package/dist/types/utils/objects/index.d.ts +2 -0
- package/package.json +1 -1
- package/dist/cjs/chunks/ModalController-xjflFsjF.js +0 -68
- package/dist/esm/chunks/ModalController-C1BnM5Dz.mjs +0 -76
- /package/dist/cjs/chunks/{SSEConnection-ACoOeeTO.js → SSEConnection-CF5WZG9b.js} +0 -0
- /package/dist/cjs/chunks/{_types-k-3V1fz_.js → _types-BTdDWVYI.js} +0 -0
- /package/dist/cjs/chunks/{audioVisualizer-MOSbvvnZ.js → audioVisualizer-C7fMG0WH.js} +0 -0
- /package/dist/cjs/chunks/{colors-B0_3srZN.js → colors-CmOkcjB3.js} +0 -0
- /package/dist/cjs/chunks/{debounce-CaoYvh12.js → debounce-BtCCTkbG.js} +0 -0
- /package/dist/cjs/chunks/{modalStore-D4bOjuWd.js → modalStore-CaQkdY5_.js} +0 -0
- /package/dist/cjs/chunks/{sharedTypes-CthHPjrO.js → sharedTypes-BOieqpQy.js} +0 -0
- /package/dist/cjs/chunks/{tipStore-CPB7RHKY.js → tipStore-4Bs9v2sg.js} +0 -0
- /package/dist/cjs/chunks/{toastStore-6eHe6esp.js → toastStore-CyCE9-lr.js} +0 -0
- /package/dist/cjs/chunks/{tslib.es6-CzpRaW14.js → tslib.es6-DqjaJVC3.js} +0 -0
- /package/dist/esm/chunks/{SSEConnection-qNnkZUOe.mjs → SSEConnection-g0GBGAqe.mjs} +0 -0
- /package/dist/esm/chunks/{_types-CEStVWlB.mjs → _types-9ekyeJYl.mjs} +0 -0
- /package/dist/esm/chunks/{audioVisualizer-BUNbarKP.mjs → audioVisualizer-nMo67yOW.mjs} +0 -0
- /package/dist/esm/chunks/{colors-D-qeA9gU.mjs → colors-v5b8_oYV.mjs} +0 -0
- /package/dist/esm/chunks/{debounce-D5b6tZ5a.mjs → debounce-DFxAyrPi.mjs} +0 -0
- /package/dist/esm/chunks/{modalStore-Crg_QmSJ.mjs → modalStore-D6_oc47l.mjs} +0 -0
- /package/dist/esm/chunks/{sharedTypes-U5H1I85x.mjs → sharedTypes-CdmzhKXN.mjs} +0 -0
- /package/dist/esm/chunks/{tipStore-pvswaezx.mjs → tipStore-C2M6zBzd.mjs} +0 -0
- /package/dist/esm/chunks/{toastStore-80oOTYsj.mjs → toastStore-B-6kdNHw.mjs} +0 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import {
|
|
2
|
+
import { _ as __rest } from "./tslib.es6-CVvvNSPr.mjs";
|
|
3
3
|
|
|
4
4
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
5
|
|
|
@@ -9,15 +9,21 @@ import { useTheme } from "../hooks/useTheme.mjs";
|
|
|
9
9
|
|
|
10
10
|
import "../theme/colors.mjs";
|
|
11
11
|
|
|
12
|
+
import "./webRTCStore-DhFE9-bb.mjs";
|
|
13
|
+
|
|
14
|
+
import "./microphoneStore-Cbx9nV4R.mjs";
|
|
15
|
+
|
|
16
|
+
import "./volumeStore-BrgZCRKF.mjs";
|
|
17
|
+
|
|
12
18
|
import "../hooks/useWindow.mjs";
|
|
13
19
|
|
|
14
|
-
import { B as Badge } from "./Badge-
|
|
20
|
+
import { B as Badge } from "./Badge-bh5UVUnt.mjs";
|
|
15
21
|
|
|
16
|
-
import { I as Icon } from "./Icon-
|
|
22
|
+
import { I as Icon } from "./Icon-L8B35JN1.mjs";
|
|
17
23
|
|
|
18
|
-
import { I as IconButton } from "./IconButton-
|
|
24
|
+
import { I as IconButton } from "./IconButton-DxwJemEK.mjs";
|
|
19
25
|
|
|
20
|
-
import { T as ToolTipType } from "./sharedTypes-
|
|
26
|
+
import { T as ToolTipType } from "./sharedTypes-CdmzhKXN.mjs";
|
|
21
27
|
|
|
22
28
|
var css_wrapper = "TabBar-module_wrapper__cyOR1 flexBox-module_rowStart__4tcxS", css_option = "TabBar-module_option__gYjDf flexBox-module_row__z24tF type-module_body-m-regular__LuQBA", css_icon = "TabBar-module_icon__JDgG3 flexBox-module_row__z24tF", css_close = "TabBar-module_close__bvSBh flexBox-module_row__z24tF";
|
|
23
29
|
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import {
|
|
2
|
+
import { _ as __rest } from "./tslib.es6-CVvvNSPr.mjs";
|
|
3
3
|
|
|
4
4
|
import { jsxs, jsx } from "react/jsx-runtime";
|
|
5
5
|
|
|
6
6
|
import React, { useState, useRef, useCallback, useEffect, useMemo } from "react";
|
|
7
7
|
|
|
8
|
-
import { B as Button } from "./Button-
|
|
8
|
+
import { B as Button } from "./Button-CWKs3uAV.mjs";
|
|
9
9
|
|
|
10
10
|
var css_wrapper = "TextArea-module_wrapper__O0sWP flexBox-module_columnStart__C7P44", css_textarea = "TextArea-module_textarea__-R2n0", css_send = "TextArea-module_send__Cub13", css_xs = "TextArea-module_xs__5e748 type-module_body-xs-regular__ZAFft", css_s = "TextArea-module_s__Ac-fq type-module_body-s-regular__vRHSP", css_m = "TextArea-module_m__dod4R type-module_body-m-regular__LuQBA", css_l = "TextArea-module_l__-uLCG type-module_body-l-regular__lOYbg";
|
|
11
11
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import {
|
|
2
|
+
import { _ as __rest } from "./tslib.es6-CVvvNSPr.mjs";
|
|
3
3
|
|
|
4
4
|
import { jsxs, jsx } from "react/jsx-runtime";
|
|
5
5
|
|
|
@@ -11,15 +11,21 @@ import { useTheme } from "../hooks/useTheme.mjs";
|
|
|
11
11
|
|
|
12
12
|
import "../theme/colors.mjs";
|
|
13
13
|
|
|
14
|
-
import { s as setStyle } from "./misc-
|
|
14
|
+
import { s as setStyle } from "./misc-zecH7-IH.mjs";
|
|
15
|
+
|
|
16
|
+
import "./webRTCStore-DhFE9-bb.mjs";
|
|
17
|
+
|
|
18
|
+
import "./microphoneStore-Cbx9nV4R.mjs";
|
|
19
|
+
|
|
20
|
+
import "./volumeStore-BrgZCRKF.mjs";
|
|
15
21
|
|
|
16
22
|
import "../hooks/useWindow.mjs";
|
|
17
23
|
|
|
18
|
-
import { B as Button } from "./Button-
|
|
24
|
+
import { B as Button } from "./Button-CWKs3uAV.mjs";
|
|
19
25
|
|
|
20
|
-
import { I as Icon } from "./Icon-
|
|
26
|
+
import { I as Icon } from "./Icon-L8B35JN1.mjs";
|
|
21
27
|
|
|
22
|
-
import { I as IconButton } from "./IconButton-
|
|
28
|
+
import { I as IconButton } from "./IconButton-DxwJemEK.mjs";
|
|
23
29
|
|
|
24
30
|
var css = {
|
|
25
31
|
wrapper: "TextField-module_wrapper__qZ-p- flexBox-module_rowStart__4tcxS",
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import {
|
|
2
|
+
import { _ as __rest } from "./tslib.es6-CVvvNSPr.mjs";
|
|
3
3
|
|
|
4
4
|
import { jsx } from "react/jsx-runtime";
|
|
5
5
|
|
|
@@ -7,7 +7,7 @@ import { motion } from "motion/react";
|
|
|
7
7
|
|
|
8
8
|
import React, { useState, useRef, useEffect, useMemo } from "react";
|
|
9
9
|
|
|
10
|
-
import { f as filterClasses } from "./misc-
|
|
10
|
+
import { f as filterClasses } from "./misc-zecH7-IH.mjs";
|
|
11
11
|
|
|
12
12
|
var css = {
|
|
13
13
|
wrapper: "Tip-module_wrapper__D7ACT flexBox-module_rowStart__4tcxS",
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import {
|
|
2
|
+
import { _ as __rest } from "./tslib.es6-CVvvNSPr.mjs";
|
|
3
3
|
|
|
4
4
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
5
|
|
|
@@ -11,13 +11,19 @@ import { useTheme } from "../hooks/useTheme.mjs";
|
|
|
11
11
|
|
|
12
12
|
import "../theme/colors.mjs";
|
|
13
13
|
|
|
14
|
-
import { s as setStyle, f as filterClasses, a as accessibleKeyDown } from "./misc-
|
|
14
|
+
import { s as setStyle, f as filterClasses, a as accessibleKeyDown } from "./misc-zecH7-IH.mjs";
|
|
15
|
+
|
|
16
|
+
import "./webRTCStore-DhFE9-bb.mjs";
|
|
17
|
+
|
|
18
|
+
import "./microphoneStore-Cbx9nV4R.mjs";
|
|
19
|
+
|
|
20
|
+
import "./volumeStore-BrgZCRKF.mjs";
|
|
15
21
|
|
|
16
22
|
import "../hooks/useWindow.mjs";
|
|
17
23
|
|
|
18
|
-
import { I as Icon } from "./Icon-
|
|
24
|
+
import { I as Icon } from "./Icon-L8B35JN1.mjs";
|
|
19
25
|
|
|
20
|
-
import { P as ProgressIndicator } from "./ProgressIndicator-
|
|
26
|
+
import { P as ProgressIndicator } from "./ProgressIndicator-HaJJDZ-m.mjs";
|
|
21
27
|
|
|
22
28
|
var ToastType, css = {
|
|
23
29
|
wrapper: "Toast-module_wrapper__1uj9O flexBox-module_rowBetween__5FEvi",
|
|
@@ -35,7 +41,7 @@ var ToastType, css = {
|
|
|
35
41
|
}(ToastType || (ToastType = {}));
|
|
36
42
|
|
|
37
43
|
const ToastBase = React.forwardRef((props, ref) => {
|
|
38
|
-
const {message: message = null, size: size = "m", border: border = !0, padding: padding, radius: radius = 8, container: container = "window", showDelay: showDelay = 0, duration: duration = 5e3, position: position = "bottom", offset: offset = 24, close: close = !0, progress: progress, type: type = ToastType.Info, didHide: didHide = () => null} = props, divAttributes = __rest(props, [ "message", "size", "border", "padding", "radius", "container", "showDelay", "duration", "position", "offset", "close", "progress", "type", "didHide" ]), theme = useTheme(), {id: divId, className: className, style: style} = divAttributes, rest = __rest(divAttributes, [ "id", "className", "style" ]), divStyle = null != style ? style : {}, divClass = className ? `${className}` : "", [ready, setReady] = useState(!1), [content, setContent] = useState(null), timer = useRef(null);
|
|
44
|
+
const {notifId: notifId, message: message = null, size: size = "m", border: border = !0, padding: padding, radius: radius = 8, container: container = "window", showDelay: showDelay = 0, duration: duration = 5e3, position: position = "bottom", offset: offset = 24, close: close = !0, progress: progress, type: type = ToastType.Info, didHide: didHide = () => null} = props, divAttributes = __rest(props, [ "notifId", "message", "size", "border", "padding", "radius", "container", "showDelay", "duration", "position", "offset", "close", "progress", "type", "didHide" ]), theme = useTheme(), {id: divId, className: className, style: style} = divAttributes, rest = __rest(divAttributes, [ "id", "className", "style" ]), divStyle = null != style ? style : {}, divClass = className ? `${className}` : "", [ready, setReady] = useState(!1), [content, setContent] = useState(null), timer = useRef(null);
|
|
39
45
|
useEffect(() => {
|
|
40
46
|
timer.current && clearTimeout(timer.current);
|
|
41
47
|
return message && message.length > 0 ? timer.current = setTimeout(() => {
|
|
@@ -178,7 +184,7 @@ const ToastBase = React.forwardRef((props, ref) => {
|
|
|
178
184
|
strokeColor: iconColor
|
|
179
185
|
})
|
|
180
186
|
}) ]
|
|
181
|
-
}))
|
|
187
|
+
}), notifId)
|
|
182
188
|
});
|
|
183
189
|
});
|
|
184
190
|
|
|
@@ -2,14 +2,14 @@ import { jsxs, jsx } from "react/jsx-runtime";
|
|
|
2
2
|
|
|
3
3
|
import { useMemo } from "react";
|
|
4
4
|
|
|
5
|
-
import { I as IconButton } from "./IconButton-
|
|
5
|
+
import { I as IconButton } from "./IconButton-DxwJemEK.mjs";
|
|
6
6
|
|
|
7
|
-
import { L as Label } from "./Label-
|
|
7
|
+
import { L as Label } from "./Label-wDPtyK4h.mjs";
|
|
8
8
|
|
|
9
9
|
var css_toggleButton = "ToggleButton-module_toggleButton__H7KgI flexBox-module_rowStart__4tcxS";
|
|
10
10
|
|
|
11
11
|
function ToggleButton(props) {
|
|
12
|
-
const {label: label, textSize: textSize, icon: icon, selected: selected = !1, iconColor: iconColor = "var(--core-text-primary)", iconColorOn: iconColorOn = "var(--core-surface-primary)", bgColor: bgColor = "var(--core-surface-secondary)", bgColorOn: bgColorOn = "var(--core-text-special)", iconSize: iconSize = 20, buttonSize: buttonSize = "m", tooltip: tooltip, gap: gap = 4, unselect: unselect = !0, fill: fill = !1, disabled: disabled = !1, onChange: onChange, onSelect: onSelect, onToolTip: onToolTip, children: children} = props, handleClick = () => {
|
|
12
|
+
const {label: label, textSize: textSize, icon: icon, selected: selected = !1, iconColor: iconColor = "var(--core-text-primary)", iconColorOn: iconColorOn = "var(--core-surface-primary)", bgColor: bgColor = "var(--core-surface-secondary)", bgColorOn: bgColorOn = "var(--core-text-special)", iconSize: iconSize = 20, buttonSize: buttonSize = "m", tooltip: tooltip, gap: gap = 4, unselect: unselect = !0, fill: fill = !1, disabled: disabled = !1, border: border = !1, onChange: onChange, onSelect: onSelect, onToolTip: onToolTip, children: children} = props, handleClick = () => {
|
|
13
13
|
if (!unselect && selected) return;
|
|
14
14
|
const newState = !selected;
|
|
15
15
|
null == onChange || onChange(newState), newState && (null == onSelect || onSelect());
|
|
@@ -33,7 +33,8 @@ function ToggleButton(props) {
|
|
|
33
33
|
iconSize: iconSize,
|
|
34
34
|
iconFill: fill,
|
|
35
35
|
disabled: disabled,
|
|
36
|
-
onToolTip: onToolTip
|
|
36
|
+
onToolTip: onToolTip,
|
|
37
|
+
border: border
|
|
37
38
|
}), (children || label) && jsx(Label, {
|
|
38
39
|
textSize: textSize,
|
|
39
40
|
borderSize: 0,
|
|
@@ -3,13 +3,13 @@ import { jsxs, jsx } from "react/jsx-runtime";
|
|
|
3
3
|
|
|
4
4
|
import React, { useState, useRef, useId, useCallback, useMemo } from "react";
|
|
5
5
|
|
|
6
|
-
import { s as setStyle, a as accessibleKeyDown } from "./misc-
|
|
6
|
+
import { s as setStyle, a as accessibleKeyDown } from "./misc-zecH7-IH.mjs";
|
|
7
7
|
|
|
8
|
-
import {
|
|
8
|
+
import { F as FileList } from "./FileList-CztHFCJe.mjs";
|
|
9
9
|
|
|
10
|
-
import {
|
|
10
|
+
import { I as Icon } from "./Icon-L8B35JN1.mjs";
|
|
11
11
|
|
|
12
|
-
import {
|
|
12
|
+
import { P as ProgressIndicator } from "./ProgressIndicator-HaJJDZ-m.mjs";
|
|
13
13
|
|
|
14
14
|
var css = {
|
|
15
15
|
wrapper: "UploadArea-module_wrapper__aircC flexBox-module_column__ezvMq",
|
|
@@ -0,0 +1,252 @@
|
|
|
1
|
+
import { a as __awaiter } from "./tslib.es6-CVvvNSPr.mjs";
|
|
2
|
+
|
|
3
|
+
class WebRTCConnection {
|
|
4
|
+
/**
|
|
5
|
+
* Report whether the peer connection is currently connected
|
|
6
|
+
*/
|
|
7
|
+
get connected() {
|
|
8
|
+
return "connected" === this.peerConnection.connectionState;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Report whether the connection currently has an audio path attached
|
|
12
|
+
*/ get audioConnected() {
|
|
13
|
+
var _a, _b;
|
|
14
|
+
const hasLocalAudioTrack = "live" === (null === (_b = null === (_a = this.RTCSenderAudioSender) || void 0 === _a ? void 0 : _a.track) || void 0 === _b ? void 0 : _b.readyState), hasRemoteAudioTrack = this.RTCReceiverAudioTracks.size > 0;
|
|
15
|
+
return Boolean(hasLocalAudioTrack || hasRemoteAudioTrack);
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Report whether the connection currently has a video path attached
|
|
19
|
+
*/ get videoConnected() {
|
|
20
|
+
var _a, _b;
|
|
21
|
+
const hasLocalVideoTrack = "live" === (null === (_a = this.RTCSenderVideoTrack) || void 0 === _a ? void 0 : _a.readyState) || "live" === (null === (_b = this.RTCScreenShareTrack) || void 0 === _b ? void 0 : _b.readyState), hasRemoteVideoTrack = this.RTCReceiverVideoTracks.size > 0;
|
|
22
|
+
return Boolean(hasLocalVideoTrack || hasRemoteVideoTrack);
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Report whether any data channel is currently open
|
|
26
|
+
*/ get dataConnected() {
|
|
27
|
+
return this.RTCDataChannels.some(channel => "open" === channel.readyState);
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Create the base instance
|
|
31
|
+
*/ constructor(rtcConnectionInfo) {
|
|
32
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
33
|
+
if (this.RTCSenderAudioTrack = null, this.RTCSenderVideoTrack = null, this.RTCSenderAudioSender = null,
|
|
34
|
+
this.RTCSenderAudioStream = new MediaStream, this.RTCScreenShareTrack = null, this.RTCScreenShareSender = null,
|
|
35
|
+
this.RTCReceiverAudioStream = new MediaStream, this.RTCReceiverVideoTracks = new Map,
|
|
36
|
+
this.RTCReceiverAudioTracks = new Map, this.RTCDataChannels = [], this.connectionUrl = "",
|
|
37
|
+
this.connectionOffer = null, this.autoPlayAudio = !0, this.iceTimer = null, !globalThis.document) throw new Error("RTC needs a valid browser environment");
|
|
38
|
+
if (this.connectionUrl = null !== (_a = rtcConnectionInfo.connectionUrl) && void 0 !== _a ? _a : "",
|
|
39
|
+
this.peerConnection = new RTCPeerConnection, this.RTCSenderAudioTrack = null !== (_d = null !== (_c = null === (_b = rtcConnectionInfo.micStream) || void 0 === _b ? void 0 : _b.getAudioTracks()[0]) && void 0 !== _c ? _c : rtcConnectionInfo.micTrack) && void 0 !== _d ? _d : null,
|
|
40
|
+
!this.RTCSenderAudioTrack) throw new Error("WebRTCConnection requires a microphone stream or track");
|
|
41
|
+
this.RTCSenderVideoTrack = rtcConnectionInfo.videoTrack, this.audioElement = null !== (_e = rtcConnectionInfo.audioElement) && void 0 !== _e ? _e : document.createElement("audio"),
|
|
42
|
+
this.autoPlayAudio = null === (_f = rtcConnectionInfo.autoPlayAudio) || void 0 === _f || _f;
|
|
43
|
+
const channels = null !== (_g = rtcConnectionInfo.dataChannels) && void 0 !== _g ? _g : [];
|
|
44
|
+
this.onRemoteVideoStream = rtcConnectionInfo.onRemoteVideoStream, this.onRemoteAudioStream = rtcConnectionInfo.onRemoteAudioStream,
|
|
45
|
+
this.onDataChannelEvent = rtcConnectionInfo.onDataChannelEvent, this.setupIncomingAudioStream(),
|
|
46
|
+
"number" == typeof rtcConnectionInfo.volume && this.setVolume(rtcConnectionInfo.volume),
|
|
47
|
+
this.setupOutgoingMediaStream(), this.setupDataChannels(channels), this.setupDataChannelEventListeners(),
|
|
48
|
+
this.peerConnection.ontrack = this.onTrack.bind(this);
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Initialize the RTC connection
|
|
52
|
+
*/ initialize(offerOptions, bearerToken) {
|
|
53
|
+
return __awaiter(this, void 0, void 0, function*() {
|
|
54
|
+
this.offerOptions = offerOptions, this.bearerToken = bearerToken, yield this.negotiate();
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Start an optional screen share stream and renegotiate if already connected
|
|
59
|
+
*/ startScreenShare() {
|
|
60
|
+
return __awaiter(this, void 0, void 0, function*() {
|
|
61
|
+
var _a, _b;
|
|
62
|
+
if (!(null === (_b = null === (_a = globalThis.navigator) || void 0 === _a ? void 0 : _a.mediaDevices) || void 0 === _b ? void 0 : _b.getDisplayMedia)) throw new Error("Screen share is not supported in this browser");
|
|
63
|
+
if (this.RTCScreenShareSender) return;
|
|
64
|
+
const screenTrack = (yield navigator.mediaDevices.getDisplayMedia({
|
|
65
|
+
video: !0,
|
|
66
|
+
audio: !1
|
|
67
|
+
})).getVideoTracks()[0];
|
|
68
|
+
if (!screenTrack) throw new Error("No screen share video track was provided");
|
|
69
|
+
const screenShareStream = new MediaStream([ screenTrack ]);
|
|
70
|
+
this.RTCScreenShareTrack = screenTrack, this.RTCScreenShareSender = this.peerConnection.addTrack(screenTrack, screenShareStream),
|
|
71
|
+
screenTrack.addEventListener("ended", () => {
|
|
72
|
+
this.stopScreenShare(!1);
|
|
73
|
+
}), this.peerConnection.remoteDescription && (yield this.negotiate());
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* Stop the optional screen share stream and renegotiate if already connected
|
|
78
|
+
*/ stopScreenShare() {
|
|
79
|
+
return __awaiter(this, arguments, void 0, function*(stopTrack = !0) {
|
|
80
|
+
this.RTCScreenShareSender && (this.peerConnection.removeTrack(this.RTCScreenShareSender),
|
|
81
|
+
this.RTCScreenShareSender = null), stopTrack && this.RTCScreenShareTrack && this.RTCScreenShareTrack.stop(),
|
|
82
|
+
this.RTCScreenShareTrack = null, this.peerConnection.remoteDescription && (yield this.negotiate());
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* Create an offer, wait for ICE gathering, POST SDP, and apply the answer
|
|
87
|
+
*/ negotiate() {
|
|
88
|
+
return __awaiter(this, void 0, void 0, function*() {
|
|
89
|
+
var _a;
|
|
90
|
+
if (!this.peerConnection) throw new Error("Peer connection not initialized");
|
|
91
|
+
if (!this.connectionUrl) throw new Error("Peer connection url not provided");
|
|
92
|
+
this.connectionOffer = yield this.peerConnection.createOffer(this.offerOptions),
|
|
93
|
+
yield this.peerConnection.setLocalDescription(this.connectionOffer), yield this.waitForIceGathering();
|
|
94
|
+
const headers = {
|
|
95
|
+
"Content-Type": "application/sdp"
|
|
96
|
+
};
|
|
97
|
+
this.bearerToken && "" !== this.bearerToken && (headers.Authorization = `Bearer ${this.bearerToken}`);
|
|
98
|
+
const sdpResponse = yield fetch(this.connectionUrl, {
|
|
99
|
+
method: "POST",
|
|
100
|
+
body: null === (_a = this.connectionOffer) || void 0 === _a ? void 0 : _a.sdp,
|
|
101
|
+
headers: headers
|
|
102
|
+
});
|
|
103
|
+
if (!sdpResponse.ok) throw new Error(`Failed to send connection offer to ${this.connectionUrl}. Status: ${sdpResponse.status} ${sdpResponse.statusText}`);
|
|
104
|
+
const sdpReply = {
|
|
105
|
+
type: "answer",
|
|
106
|
+
sdp: yield sdpResponse.text()
|
|
107
|
+
};
|
|
108
|
+
yield this.peerConnection.setRemoteDescription(sdpReply);
|
|
109
|
+
});
|
|
110
|
+
}
|
|
111
|
+
/**
|
|
112
|
+
* Send a JSON-serializable payload over a named data channel
|
|
113
|
+
*/ sendMessage(channelName, data) {
|
|
114
|
+
const channel = this.RTCDataChannels.find(dataChannel => dataChannel.label === channelName);
|
|
115
|
+
if (!channel) throw new Error(`Data channel "${channelName}" not found`);
|
|
116
|
+
if ("open" !== channel.readyState) throw new Error(`Data channel "${channelName}" is not open. Current state: ${channel.readyState}`);
|
|
117
|
+
channel.send(JSON.stringify(data));
|
|
118
|
+
}
|
|
119
|
+
/**
|
|
120
|
+
* Mute or unmute all incoming audio playback
|
|
121
|
+
*/ muteAllAudio(muted) {
|
|
122
|
+
this.audioElement.muted = muted;
|
|
123
|
+
}
|
|
124
|
+
/**
|
|
125
|
+
* Mute or unmute a specific incoming audio track
|
|
126
|
+
*/ muteAudioTrack(trackId, muted) {
|
|
127
|
+
const track = this.RTCReceiverAudioTracks.get(trackId);
|
|
128
|
+
if (!track) throw new Error(`Audio track "${trackId}" not found`);
|
|
129
|
+
track.enabled = !muted;
|
|
130
|
+
}
|
|
131
|
+
/**
|
|
132
|
+
* Set the playback volume for the incoming audio element
|
|
133
|
+
*/ setVolume(volume) {
|
|
134
|
+
this.audioElement.volume = Math.max(0, Math.min(1, volume));
|
|
135
|
+
}
|
|
136
|
+
/**
|
|
137
|
+
* Replace the outgoing audio source with the first track from a stream
|
|
138
|
+
*/ setOutgoingAudioStream(stream) {
|
|
139
|
+
return __awaiter(this, void 0, void 0, function*() {
|
|
140
|
+
var _a;
|
|
141
|
+
yield this.replaceAudioTrack(null !== (_a = null == stream ? void 0 : stream.getAudioTracks()[0]) && void 0 !== _a ? _a : null);
|
|
142
|
+
});
|
|
143
|
+
}
|
|
144
|
+
/**
|
|
145
|
+
* Replace the outgoing audio track without rebuilding the peer connection
|
|
146
|
+
*/ replaceAudioTrack(track) {
|
|
147
|
+
return __awaiter(this, void 0, void 0, function*() {
|
|
148
|
+
this.RTCSenderAudioTrack = track, this.syncSenderAudioStream(track), this.RTCSenderAudioSender ? yield this.RTCSenderAudioSender.replaceTrack(track) : track && (this.RTCSenderAudioSender = this.peerConnection.addTrack(track, this.RTCSenderAudioStream),
|
|
149
|
+
this.peerConnection.remoteDescription && (yield this.negotiate()));
|
|
150
|
+
});
|
|
151
|
+
}
|
|
152
|
+
/**
|
|
153
|
+
* Close the peer connection and release local media bindings
|
|
154
|
+
*/ close() {
|
|
155
|
+
this.iceTimer && (clearTimeout(this.iceTimer), this.iceTimer = null), this.RTCScreenShareSender && (this.peerConnection.removeTrack(this.RTCScreenShareSender),
|
|
156
|
+
this.RTCScreenShareSender = null), this.RTCSenderAudioSender && (this.peerConnection.removeTrack(this.RTCSenderAudioSender),
|
|
157
|
+
this.RTCSenderAudioSender = null), this.RTCScreenShareTrack = null, this.RTCSenderAudioTrack = null,
|
|
158
|
+
this.audioElement.srcObject = null, this.peerConnection.close();
|
|
159
|
+
}
|
|
160
|
+
/**
|
|
161
|
+
* Create an audio source node from the unified incoming audio stream
|
|
162
|
+
*/ createIncomingAudioSource(audioContext) {
|
|
163
|
+
return audioContext.createMediaStreamSource(this.RTCReceiverAudioStream);
|
|
164
|
+
}
|
|
165
|
+
/**
|
|
166
|
+
* Handle track events adding them to the unified audio and video streams
|
|
167
|
+
*/ onTrack(event) {
|
|
168
|
+
var _a, _b;
|
|
169
|
+
if (event.streams[0]) {
|
|
170
|
+
if ("video" === event.track.kind) {
|
|
171
|
+
const stream = event.streams[0], id = stream.id;
|
|
172
|
+
this.RTCReceiverVideoTracks.has(id) || (this.RTCReceiverVideoTracks.set(id, stream),
|
|
173
|
+
null === (_a = this.onRemoteVideoStream) || void 0 === _a || _a.call(this, this.RTCReceiverVideoTracks));
|
|
174
|
+
}
|
|
175
|
+
if ("audio" === event.track.kind) {
|
|
176
|
+
const id = event.track.id;
|
|
177
|
+
this.RTCReceiverAudioTracks.has(id) || (this.RTCReceiverAudioStream.addTrack(event.track),
|
|
178
|
+
this.RTCReceiverAudioTracks.set(id, event.track), null === (_b = this.onRemoteAudioStream) || void 0 === _b || _b.call(this, new Map([ [ this.RTCReceiverAudioStream.id, this.RTCReceiverAudioStream ] ])));
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
/**
|
|
183
|
+
* Create a local audio element and set its source to the rtc incoming media stream
|
|
184
|
+
*/ setupIncomingAudioStream() {
|
|
185
|
+
this.audioElement.autoplay = this.autoPlayAudio, this.audioElement.srcObject = this.RTCReceiverAudioStream;
|
|
186
|
+
}
|
|
187
|
+
/**
|
|
188
|
+
* Set up a local stream with mic and video tracks and add to peer connection
|
|
189
|
+
*/ setupOutgoingMediaStream() {
|
|
190
|
+
if (this.RTCSenderAudioTrack && (this.syncSenderAudioStream(this.RTCSenderAudioTrack),
|
|
191
|
+
this.RTCSenderAudioSender = this.peerConnection.addTrack(this.RTCSenderAudioTrack, this.RTCSenderAudioStream)),
|
|
192
|
+
this.RTCSenderVideoTrack) {
|
|
193
|
+
const senderStream = new MediaStream([ this.RTCSenderVideoTrack ]);
|
|
194
|
+
this.peerConnection.addTrack(this.RTCSenderVideoTrack, senderStream);
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
/**
|
|
198
|
+
* Keep the sender stream aligned to the current local audio track
|
|
199
|
+
*/ syncSenderAudioStream(track) {
|
|
200
|
+
for (const currentTrack of this.RTCSenderAudioStream.getAudioTracks()) this.RTCSenderAudioStream.removeTrack(currentTrack);
|
|
201
|
+
track && this.RTCSenderAudioStream.addTrack(track);
|
|
202
|
+
}
|
|
203
|
+
/**
|
|
204
|
+
* Setup data channels
|
|
205
|
+
*/ setupDataChannels(channels) {
|
|
206
|
+
const channelsArray = Array.isArray(channels) ? channels : [ channels ];
|
|
207
|
+
if (channelsArray.length > 0) for (const channel of channelsArray) {
|
|
208
|
+
const dataChannel = this.peerConnection.createDataChannel(channel);
|
|
209
|
+
this.RTCDataChannels.push(dataChannel);
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
/**
|
|
213
|
+
* Add listeners for data events and push through callback
|
|
214
|
+
*/ setupDataChannelEventListeners() {
|
|
215
|
+
for (const channel of this.RTCDataChannels) {
|
|
216
|
+
const channelName = channel.label;
|
|
217
|
+
channel.addEventListener("message", event => {
|
|
218
|
+
var _a;
|
|
219
|
+
null === (_a = this.onDataChannelEvent) || void 0 === _a || _a.call(this, channelName, "message", event);
|
|
220
|
+
}), channel.addEventListener("open", event => {
|
|
221
|
+
var _a;
|
|
222
|
+
null === (_a = this.onDataChannelEvent) || void 0 === _a || _a.call(this, channelName, "open", event);
|
|
223
|
+
}), channel.addEventListener("close", event => {
|
|
224
|
+
var _a;
|
|
225
|
+
null === (_a = this.onDataChannelEvent) || void 0 === _a || _a.call(this, channelName, "close", event);
|
|
226
|
+
}), channel.addEventListener("error", event => {
|
|
227
|
+
var _a;
|
|
228
|
+
null === (_a = this.onDataChannelEvent) || void 0 === _a || _a.call(this, channelName, "error", event);
|
|
229
|
+
});
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
/**
|
|
233
|
+
* Wait for the ICE gathering to be complete
|
|
234
|
+
*/ waitForIceGathering() {
|
|
235
|
+
return __awaiter(this, void 0, void 0, function*() {
|
|
236
|
+
if ("complete" !== this.peerConnection.iceGatheringState) return new Promise((resolve, reject) => {
|
|
237
|
+
const handleStateChange = () => {
|
|
238
|
+
"complete" === this.peerConnection.iceGatheringState && (this.iceTimer && clearTimeout(this.iceTimer),
|
|
239
|
+
this.iceTimer = null, this.peerConnection.removeEventListener("icegatheringstatechange", handleStateChange),
|
|
240
|
+
resolve());
|
|
241
|
+
};
|
|
242
|
+
this.peerConnection.addEventListener("icegatheringstatechange", handleStateChange),
|
|
243
|
+
this.iceTimer = setTimeout(() => {
|
|
244
|
+
this.peerConnection.removeEventListener("icegatheringstatechange", handleStateChange),
|
|
245
|
+
this.iceTimer = null, reject(new Error("ICE gathering timed out"));
|
|
246
|
+
}, 5e3);
|
|
247
|
+
});
|
|
248
|
+
});
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
export { WebRTCConnection as W };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { a as __awaiter, _ as __rest } from "./tslib.es6-CVvvNSPr.mjs";
|
|
2
2
|
|
|
3
3
|
import { useMemo } from "react";
|
|
4
4
|
|
|
@@ -6,7 +6,7 @@ import { create } from "zustand";
|
|
|
6
6
|
|
|
7
7
|
import { useShallow } from "zustand/react/shallow";
|
|
8
8
|
|
|
9
|
-
import { I as IndexedDB } from "./IndexedDB-
|
|
9
|
+
import { I as IndexedDB } from "./IndexedDB-DA5oZXju.mjs";
|
|
10
10
|
|
|
11
11
|
function isValidIDBKey(key) {
|
|
12
12
|
return "string" == typeof key || "number" == typeof key || key instanceof Date || key instanceof ArrayBuffer || (Array.isArray(key) ? key.every(entry => isValidIDBKey(entry)) : ArrayBuffer.isView(key));
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import {
|
|
2
|
+
import { a as __awaiter } from "./tslib.es6-CVvvNSPr.mjs";
|
|
3
3
|
|
|
4
4
|
import { useEffect } from "react";
|
|
5
5
|
|
|
@@ -130,6 +130,29 @@ function createBoundActions(microphone, clearState) {
|
|
|
130
130
|
}, [ sync, hasMicrophone, micStream, processedMicStream, micTrack, currentDeviceId, isActive, inputVolume, muted, isSupported, isRequesting, error, microphones, micOptions, requestMicrophone, stopMicrophone, muteMic, unmuteMic, toggleMute, setInputVolume, refreshMicrophones, setMicrophone ]);
|
|
131
131
|
}
|
|
132
132
|
|
|
133
|
-
const useMicStream = () => useMicrophoneStore(state => state.micStream), useProcessedMicStream = () => useMicrophoneStore(state => state.processedMicStream), useMicTrack = () => useMicrophoneStore(state => state.micTrack), useCurrentMicDeviceId = () => useMicrophoneStore(state => state.currentDeviceId),
|
|
133
|
+
const useMicStream = () => useMicrophoneStore(state => state.micStream), useProcessedMicStream = () => useMicrophoneStore(state => state.processedMicStream), useMicTrack = () => useMicrophoneStore(state => state.micTrack), useCurrentMicDeviceId = () => useMicrophoneStore(state => state.currentDeviceId), useCurrentMicDeviceLabel = () => useMicrophoneStore(state => {
|
|
134
|
+
var _a, _b, _c;
|
|
135
|
+
const liveTrackLabel = null === (_a = state.micTrack.current) || void 0 === _a ? void 0 : _a.label;
|
|
136
|
+
if (liveTrackLabel) return liveTrackLabel;
|
|
137
|
+
const currentDeviceId = state.currentDeviceId;
|
|
138
|
+
return currentDeviceId && null !== (_c = null === (_b = state.microphones.find(device => device.deviceId === currentDeviceId)) || void 0 === _b ? void 0 : _b.label) && void 0 !== _c ? _c : null;
|
|
139
|
+
}), useMicActive = () => useMicrophoneStore(state => state.isActive), useMicInputVolume = () => useMicrophoneStore(state => state.inputVolume), useMicMuted = () => useMicrophoneStore(state => state.muted), useMicSupported = () => useMicrophoneStore(state => state.isSupported), useMicRequesting = () => useMicrophoneStore(state => state.isRequesting), useMicError = () => useMicrophoneStore(state => state.error), useMicrophones = () => useMicrophoneStore(state => state.microphones), useMicOptions = () => useMicrophoneStore(state => state.micOptions), useMicrophoneStoreActions = () => useMicrophoneStore(state => state.actions), microphoneActions = {
|
|
140
|
+
sync: microphone => useMicrophoneStore.getState().actions.sync(microphone),
|
|
141
|
+
clear: () => useMicrophoneStore.getState().actions.clear(),
|
|
142
|
+
requestMicrophone: () => useMicrophoneStore.getState().actions.requestMicrophone(),
|
|
143
|
+
stopMicrophone: () => useMicrophoneStore.getState().actions.stopMicrophone(),
|
|
144
|
+
muteMic: () => useMicrophoneStore.getState().actions.muteMic(),
|
|
145
|
+
unmuteMic: () => useMicrophoneStore.getState().actions.unmuteMic(),
|
|
146
|
+
toggleMute: () => useMicrophoneStore.getState().actions.toggleMute(),
|
|
147
|
+
setInputVolume: volume => useMicrophoneStore.getState().actions.setInputVolume(volume),
|
|
148
|
+
refreshMicrophones: () => useMicrophoneStore.getState().actions.refreshMicrophones(),
|
|
149
|
+
setMicrophone: deviceId => useMicrophoneStore.getState().actions.setMicrophone(deviceId)
|
|
150
|
+
}, getMicrophoneState = () => useMicrophoneStore.getState(), getCurrentMicDeviceLabel = () => {
|
|
151
|
+
var _a, _b, _c;
|
|
152
|
+
const state = useMicrophoneStore.getState(), liveTrackLabel = null === (_a = state.micTrack.current) || void 0 === _a ? void 0 : _a.label;
|
|
153
|
+
if (liveTrackLabel) return liveTrackLabel;
|
|
154
|
+
const currentDeviceId = state.currentDeviceId;
|
|
155
|
+
return currentDeviceId && null !== (_c = null === (_b = state.microphones.find(device => device.deviceId === currentDeviceId)) || void 0 === _b ? void 0 : _b.label) && void 0 !== _c ? _c : null;
|
|
156
|
+
};
|
|
134
157
|
|
|
135
|
-
export {
|
|
158
|
+
export { getMicrophoneState as a, useCurrentMicDeviceLabel as b, useMicActive as c, useMicError as d, useMicInputVolume as e, useMicMuted as f, getCurrentMicDeviceLabel as g, useMicOptions as h, useMicRequesting as i, useMicStream as j, useMicSupported as k, useMicTrack as l, microphoneActions as m, useMicrophoneStore as n, useMicrophoneStoreActions as o, useMicrophones as p, useProcessedMicStream as q, useSyncMicrophoneStore as r, useCurrentMicDeviceId as u };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { create } from "zustand";
|
|
2
2
|
|
|
3
|
-
import "./tslib.es6-
|
|
3
|
+
import "./tslib.es6-CVvvNSPr.mjs";
|
|
4
4
|
|
|
5
|
-
import { S as SSEConnection } from "./SSEConnection-
|
|
5
|
+
import { S as SSEConnection } from "./SSEConnection-g0GBGAqe.mjs";
|
|
6
6
|
|
|
7
7
|
const useSSEStore = create((set, get) => ({
|
|
8
8
|
connections: [],
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { a as __awaiter } from "./tslib.es6-CVvvNSPr.mjs";
|
|
2
2
|
|
|
3
3
|
import { create } from "zustand";
|
|
4
4
|
|
|
@@ -26,12 +26,13 @@ const useVolumeStore = create((set, get) => ({
|
|
|
26
26
|
feedbackElement: null
|
|
27
27
|
});
|
|
28
28
|
},
|
|
29
|
-
setVolume: volume => {
|
|
30
|
-
|
|
29
|
+
setVolume: (volume, options) => {
|
|
30
|
+
var _a;
|
|
31
|
+
const muted = get().muted, currentVolume = muted ? 0 : volume, attachedMedia = get().elements, feedbackElement = get().feedbackElement, newStored = volume > 0 ? volume : get().storedVolume;
|
|
31
32
|
attachedMedia.size > 0 && adjustMediaVolume(attachedMedia, currentVolume), set({
|
|
32
33
|
volume: currentVolume,
|
|
33
34
|
storedVolume: newStored
|
|
34
|
-
});
|
|
35
|
+
}), muted || null !== (_a = null == options ? void 0 : options.playFeedback) && void 0 !== _a && !_a || playFeedbackSound(feedbackElement, currentVolume);
|
|
35
36
|
},
|
|
36
37
|
playFeedback: volume => __awaiter(void 0, void 0, void 0, function*() {
|
|
37
38
|
if (get().muted) return;
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { a as __awaiter } from "./tslib.es6-CVvvNSPr.mjs";
|
|
2
|
+
|
|
3
|
+
import { create } from "zustand";
|
|
4
|
+
|
|
5
|
+
import { W as WebRTCConnection } from "./WebRTCConnection-d0Yvd66q.mjs";
|
|
6
|
+
|
|
7
|
+
const useWebRTCStore = create((set, get) => ({
|
|
8
|
+
connections: [],
|
|
9
|
+
actions: {
|
|
10
|
+
addConnection: (name, options) => {
|
|
11
|
+
const existingConnection = get().connections.find(c => c.name === name);
|
|
12
|
+
null == existingConnection || existingConnection.connection.close();
|
|
13
|
+
const connection = new WebRTCConnection(options), nextConnection = {
|
|
14
|
+
name: name,
|
|
15
|
+
connection: connection
|
|
16
|
+
};
|
|
17
|
+
return set(state => ({
|
|
18
|
+
connections: [ ...state.connections.filter(connection => connection.name !== name), nextConnection ]
|
|
19
|
+
})), nextConnection;
|
|
20
|
+
},
|
|
21
|
+
initializeConnection: (name, offerOptions, bearerToken) => __awaiter(void 0, void 0, void 0, function*() {
|
|
22
|
+
var _a;
|
|
23
|
+
const connection = null === (_a = get().connections.find(c => c.name === name)) || void 0 === _a ? void 0 : _a.connection;
|
|
24
|
+
connection && (yield connection.initialize(offerOptions, bearerToken));
|
|
25
|
+
}),
|
|
26
|
+
removeConnection: name => {
|
|
27
|
+
const existingConnection = get().connections.find(c => c.name === name);
|
|
28
|
+
existingConnection && (existingConnection.connection.close(), set(state => ({
|
|
29
|
+
connections: state.connections.filter(connection => connection.name !== name)
|
|
30
|
+
})));
|
|
31
|
+
},
|
|
32
|
+
setMicStream: (name, stream) => __awaiter(void 0, void 0, void 0, function*() {
|
|
33
|
+
var _a;
|
|
34
|
+
const connection = null === (_a = get().connections.find(c => c.name === name)) || void 0 === _a ? void 0 : _a.connection;
|
|
35
|
+
connection && (yield connection.setOutgoingAudioStream(stream));
|
|
36
|
+
}),
|
|
37
|
+
setVolume: (name, volume) => {
|
|
38
|
+
var _a;
|
|
39
|
+
const connection = null === (_a = get().connections.find(c => c.name === name)) || void 0 === _a ? void 0 : _a.connection;
|
|
40
|
+
connection && connection.setVolume(volume);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
})), useWebRTC = () => useWebRTCStore(state => state.actions), useWebRTCConnections = () => useWebRTCStore(state => state.connections), useWebRTCConnection = name => useWebRTCStore(state => {
|
|
44
|
+
var _a;
|
|
45
|
+
return null !== (_a = state.connections.find(connection => connection.name === name)) && void 0 !== _a ? _a : null;
|
|
46
|
+
}), useWebRTCConnected = name => useWebRTCStore(state => {
|
|
47
|
+
var _a, _b;
|
|
48
|
+
return name ? null !== (_b = null === (_a = state.connections.find(entry => entry.name === name)) || void 0 === _a ? void 0 : _a.connection.connected) && void 0 !== _b && _b : state.connections.some(entry => entry.connection.connected);
|
|
49
|
+
}), useWebRTCActions = useWebRTCStore.getState().actions;
|
|
50
|
+
|
|
51
|
+
function getWebRTCConnections(name) {
|
|
52
|
+
var _a;
|
|
53
|
+
const connections = useWebRTCStore.getState().connections;
|
|
54
|
+
return name ? null !== (_a = connections.find(connection => connection.name === name)) && void 0 !== _a ? _a : null : connections;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
export { useWebRTCActions as a, useWebRTCConnected as b, useWebRTCConnection as c, useWebRTCConnections as d, useWebRTCStore as e, getWebRTCConnections as g, useWebRTC as u };
|