@apple-pie/slice 0.1.30 → 0.1.32
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 +36 -276
- package/dist/cjs/chunks/{AudioBubble-DisHuKIC.js → AudioBubble-Dh2IlYW0.js} +3 -5
- package/dist/cjs/chunks/Avatar-WcBAu25_.js +82 -0
- package/dist/cjs/chunks/{AvatarGroup-DhGp_qLw.js → AvatarGroup-eUkVdeTf.js} +1 -3
- package/dist/cjs/chunks/Badge-4tBynWZe.js +22 -0
- package/dist/cjs/chunks/{Button-PsJx1WmV.js → Button-QJ5lsSAz.js} +1 -3
- package/dist/cjs/chunks/{ButtonBar-8zm6a_h7.js → ButtonBar-DcpvT1vD.js} +1 -3
- package/dist/cjs/chunks/{Camera-zFyIXcge.js → Camera-iDyPLq9h.js} +3 -5
- package/dist/cjs/chunks/CheckBox-CmZJd8u2.js +51 -0
- package/dist/cjs/chunks/Chip-Bd1bSYeC.js +77 -0
- package/dist/cjs/chunks/{DivInput-2cMdJQ9U.js → DivInput-BY9pQ6ty.js} +1 -3
- package/dist/cjs/chunks/{Dot-fKIwhjYA.js → Dot-BeWDLajy.js} +1 -3
- package/dist/cjs/chunks/{DrggablePanel-P7TgBI3j.js → DrggablePanel-DzY5wTco.js} +3 -5
- package/dist/cjs/chunks/DropDown-Cn_nX8u7.js +104 -0
- package/dist/cjs/chunks/ErrorSummary-D-0uVwyV.js +85 -0
- package/dist/cjs/chunks/{FileIcon-PuDoz0mF.js → FileIcon-JfY2AYqG.js} +2 -2
- package/dist/cjs/chunks/FileList-Dc1nfpR2.js +222 -0
- package/dist/cjs/chunks/{FlexDiv-D4aSJC_G.js → FlexDiv-B5Pi0-aJ.js} +2 -3
- package/dist/cjs/chunks/Grouper-DKZkTlow.js +61 -0
- package/dist/cjs/chunks/{Icon-BtcHXeqE.js → Icon-BVYVJp9J.js} +4 -7
- package/dist/cjs/chunks/IconButton-CP1Wsvsx.js +82 -0
- package/dist/cjs/chunks/{IndexedDB-BaVmQgkK.js → IndexedDB-CeiVT55Z.js} +1 -1
- package/dist/cjs/chunks/Label-DIs1rOey.js +102 -0
- package/dist/cjs/chunks/Level-3yxetsco.js +58 -0
- package/dist/cjs/chunks/{MdStreamBuffer-CvLO7CVi.js → MdStreamBuffer-BudWFoNw.js} +38 -16
- package/dist/cjs/chunks/Modal-CjpQdoOe.js +127 -0
- package/dist/cjs/chunks/{ModalController-13xmvKnm.js → ModalController-Cp2PXOOS.js} +1 -3
- package/dist/cjs/chunks/{Overlay-GXu6nMnw.js → Overlay-DRpHYZek.js} +1 -3
- package/dist/cjs/chunks/Pager-ChnTKwml.js +36 -0
- package/dist/cjs/chunks/{ProgressIndicator-D06PqCQk.js → ProgressIndicator-CFiAU-aF.js} +2 -6
- package/dist/cjs/chunks/{PromptInput-DuE4vGxR.js → PromptInput-BFWR0TaP.js} +2 -4
- package/dist/cjs/chunks/RadioButton-Bi-FP41j.js +55 -0
- package/dist/cjs/chunks/{RadioButtonList-N7Fmvr5W.js → RadioButtonList-JHPKMCoX.js} +1 -2
- package/dist/cjs/chunks/{Slider-BSy8xciG.js → Slider-D97ws1Cl.js} +1 -3
- package/dist/cjs/chunks/{Spacer-CyZAUR5N.js → Spacer-DvI2M1wZ.js} +1 -1
- package/dist/cjs/chunks/{Switch-Crm-nHYI.js → Switch-DDSSprb7.js} +1 -2
- package/dist/cjs/chunks/{TabBar-BtFfMwiB.js → TabBar-TllSeSzb.js} +2 -4
- package/dist/cjs/chunks/TextArea-DjZRDixt.js +74 -0
- package/dist/cjs/chunks/{TextField-Bh2EA082.js → TextField-CKA3K0AN.js} +3 -5
- package/dist/cjs/chunks/Tip-BdGXN-TQ.js +88 -0
- package/dist/cjs/chunks/Toast-COrDS_50.js +177 -0
- package/dist/cjs/chunks/ToggleButton-hoOMzBZc.js +39 -0
- package/dist/cjs/chunks/UploadArea-ClG8ZgRZ.js +127 -0
- package/dist/cjs/chunks/{WSConnection-DrOC8Z0R.js → WSConnection-Brxc2hEv.js} +1 -1
- package/dist/cjs/chunks/WebRTCConnection-eWP4lueC.js +252 -0
- package/dist/cjs/chunks/{localDBStore-zyDhaEiP.js → localDBStore-SS_r0C6F.js} +1 -1
- package/dist/cjs/chunks/{microphoneStore-D1fV_8QQ.js → microphoneStore-DM_8bhFr.js} +27 -4
- package/dist/cjs/chunks/{misc-QpU0XEOW.js → misc-4xyXRU2K.js} +1 -1
- package/dist/cjs/chunks/{sseStore-1OeJ9TRP.js → sseStore-Ag-UnuQq.js} +2 -2
- package/dist/cjs/chunks/{uploads-worker-Az040BSN.js → uploads-worker-CI-SZptI.js} +1 -1
- package/dist/cjs/chunks/{uploadsStore-8mOTz0Qe.js → uploadsStore-DR2hc4ct.js} +2 -2
- package/dist/cjs/chunks/{volumeStore-Pv23v12t.js → volumeStore-DtTHf-9_.js} +5 -4
- package/dist/cjs/chunks/webRTCStore-DWWn7k-0.js +55 -0
- package/dist/cjs/chunks/{windowStore-CCxCOUqa.js → windowStore-BUo9Du_e.js} +1 -1
- package/dist/cjs/components/AudioBubble/index.js +7 -7
- package/dist/cjs/components/Avatar/index.js +3 -4
- package/dist/cjs/components/AvatarGroup/index.js +4 -4
- package/dist/cjs/components/Badge/index.js +3 -3
- package/dist/cjs/components/Button/index.js +7 -8
- package/dist/cjs/components/ButtonBar/index.js +7 -7
- package/dist/cjs/components/Camera/index.js +8 -8
- package/dist/cjs/components/CheckBox/index.js +7 -7
- package/dist/cjs/components/Chip/index.js +7 -8
- package/dist/cjs/components/DivInput/index.js +3 -4
- package/dist/cjs/components/Dot/index.js +3 -3
- package/dist/cjs/components/DraggablePanel/index.js +6 -6
- package/dist/cjs/components/DropDown/index.js +7 -7
- package/dist/cjs/components/ErrorSummary/index.js +6 -7
- package/dist/cjs/components/FileIcon/index.js +6 -7
- package/dist/cjs/components/FileList/index.js +7 -7
- package/dist/cjs/components/FlexDiv/index.js +3 -4
- package/dist/cjs/components/Grouper/index.js +7 -8
- package/dist/cjs/components/Icon/index.js +6 -7
- package/dist/cjs/components/IconButton/index.js +6 -7
- package/dist/cjs/components/Label/index.js +3 -4
- package/dist/cjs/components/Level/index.js +7 -0
- package/dist/cjs/components/Modal/index.js +7 -8
- package/dist/cjs/components/ModalController/index.js +4 -4
- package/dist/cjs/components/Overlay/index.js +3 -3
- package/dist/cjs/components/Pager/index.js +3 -4
- package/dist/cjs/components/Progress/index.js +5 -6
- package/dist/cjs/components/PromptInput/index.js +9 -10
- package/dist/cjs/components/RadioButton/index.js +7 -7
- package/dist/cjs/components/RadioButtonList/index.js +8 -8
- package/dist/cjs/components/Slider/index.js +4 -5
- package/dist/cjs/components/Spacer/index.js +2 -2
- package/dist/cjs/components/Switch/index.js +3 -3
- package/dist/cjs/components/TabBar/index.js +9 -9
- package/dist/cjs/components/TextArea/index.js +8 -8
- package/dist/cjs/components/Textfield/index.js +9 -9
- package/dist/cjs/components/Tip/index.js +3 -4
- package/dist/cjs/components/Toast/index.js +7 -8
- package/dist/cjs/components/ToggleButton/index.js +8 -8
- package/dist/cjs/components/UploadArea/index.js +7 -7
- 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/useObserveTheme.js +3 -3
- package/dist/cjs/hooks/useTheme.js +2 -3
- package/dist/cjs/hooks/useTrackRenders.js +2 -2
- package/dist/cjs/hooks.js +9 -6
- package/dist/cjs/index.js +19 -17
- package/dist/cjs/providers/ThemeProvider.js +6 -17
- package/dist/cjs/providers/themeServer.js +15 -9
- package/dist/cjs/providers.js +4 -5
- 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 +18 -13
- package/dist/cjs/theme/type.js +1 -1
- 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-D052QyPH.mjs → AudioBubble-cYlxxQ7c.mjs} +3 -7
- package/dist/esm/chunks/Avatar-D84wF2os.mjs +88 -0
- package/dist/esm/chunks/{AvatarGroup-C7YRtPmJ.mjs → AvatarGroup-DiwfbRxH.mjs} +2 -6
- package/dist/esm/chunks/Badge-DuUb5-80.mjs +26 -0
- package/dist/esm/chunks/{Button-BQS3rwrS.mjs → Button-BIgwWrPJ.mjs} +6 -10
- package/dist/esm/chunks/{ButtonBar-GLNRjmjv.mjs → ButtonBar-vNvnvw7u.mjs} +3 -7
- package/dist/esm/chunks/{Camera-CAp0Y2gN.mjs → Camera-BMwkTJPq.mjs} +5 -9
- package/dist/esm/chunks/CheckBox-Cpoxy8w_.mjs +61 -0
- package/dist/esm/chunks/Chip-BayNVv7N.mjs +87 -0
- package/dist/esm/chunks/{DivInput-g6F1YWTo.mjs → DivInput-CWRUxy1y.mjs} +2 -6
- package/dist/esm/chunks/{Dot-DZE134mJ.mjs → Dot-v_kcIWV2.mjs} +1 -5
- package/dist/esm/chunks/{DrggablePanel-C0AmJy8g.mjs → DrggablePanel-yEeGeE1w.mjs} +2 -6
- package/dist/esm/chunks/DropDown-QQhwAg_J.mjs +112 -0
- package/dist/esm/chunks/ErrorSummary-DzIZMIll.mjs +90 -0
- package/dist/esm/chunks/{FileIcon-BQ2zZIW5.mjs → FileIcon-6UlkbKzk.mjs} +2 -2
- package/dist/esm/chunks/FileList-vMiGJByw.mjs +230 -0
- package/dist/esm/chunks/{FlexDiv-DnY1_qk4.mjs → FlexDiv-B1m7aY04.mjs} +3 -6
- package/dist/esm/chunks/Grouper-BDrAnfDF.mjs +73 -0
- package/dist/esm/chunks/{Icon--RjjODc9.mjs → Icon-D4A6_c4x.mjs} +3 -8
- package/dist/esm/chunks/IconButton-B_W-aOsB.mjs +96 -0
- package/dist/esm/chunks/{IndexedDB-Dk7a4fPS.mjs → IndexedDB-CTqfKmp1.mjs} +1 -1
- package/dist/esm/chunks/Label-I75yz3gq.mjs +113 -0
- package/dist/esm/chunks/Level-DgczkKBr.mjs +63 -0
- package/dist/esm/chunks/{MdStreamBuffer-By7pHJQL.mjs → MdStreamBuffer-CoQWQwRL.mjs} +38 -16
- package/dist/esm/chunks/Modal-CwwyijaO.mjs +139 -0
- package/dist/esm/chunks/{ModalController-BO5FkAqu.mjs → ModalController-IyB9lDRa.mjs} +2 -6
- package/dist/esm/chunks/{Overlay-sXM7cEYc.mjs → Overlay-C-yori3-.mjs} +1 -5
- package/dist/esm/chunks/Pager-BEtfyKtq.mjs +42 -0
- package/dist/esm/chunks/{ProgressIndicator-B5oByN3i.mjs → ProgressIndicator-BV0ginXb.mjs} +2 -8
- package/dist/esm/chunks/{PromptInput-Cwd53ux7.mjs → PromptInput-Cn5fRYap.mjs} +3 -7
- package/dist/esm/chunks/RadioButton-DWlg6ldv.mjs +63 -0
- package/dist/esm/chunks/{RadioButtonList-C_heuiis.mjs → RadioButtonList-D9FdlhPL.mjs} +3 -6
- package/dist/esm/chunks/{Slider-XEV0D2Rd.mjs → Slider-B2WZkZSg.mjs} +3 -7
- package/dist/esm/chunks/{Spacer-C5651N0N.mjs → Spacer-7Oj0SlD0.mjs} +1 -1
- package/dist/esm/chunks/{Switch-RfA431T4.mjs → Switch-DRhnznnO.mjs} +1 -4
- package/dist/esm/chunks/{TabBar-kPZ6ZJxr.mjs → TabBar-D6VR71ye.mjs} +5 -9
- package/dist/esm/chunks/TextArea-CkB5rJjI.mjs +80 -0
- package/dist/esm/chunks/{TextField-DwVKlLI_.mjs → TextField-BIXmkjEz.mjs} +5 -9
- package/dist/esm/chunks/Tip-CTdrwLky.mjs +96 -0
- package/dist/esm/chunks/Toast-8bUziIgh.mjs +189 -0
- package/dist/esm/chunks/ToggleButton-BOFITa8_.mjs +47 -0
- package/dist/esm/chunks/UploadArea-DE2ccDVx.mjs +135 -0
- package/dist/esm/chunks/{WSConnection-DV7k84B4.mjs → WSConnection-CHudrD62.mjs} +1 -1
- package/dist/esm/chunks/WebRTCConnection-DQbNa7Z9.mjs +252 -0
- package/dist/esm/chunks/{localDBStore-Dnpo5nSv.mjs → localDBStore-CaYiqITY.mjs} +2 -2
- package/dist/esm/chunks/{microphoneStore-Dr3lxoWX.mjs → microphoneStore-COEGtgyX.mjs} +26 -3
- package/dist/esm/chunks/{misc-wS74txaa.mjs → misc-2MIIqzsX.mjs} +1 -1
- package/dist/esm/chunks/{sseStore-DjrfpNAS.mjs → sseStore-nW9CMec_.mjs} +2 -2
- package/dist/esm/chunks/{tslib.es6-C-olHjXV.mjs → tslib.es6-C81Qhn1z.mjs} +1 -1
- package/dist/esm/chunks/{uploads-worker-CYp-F4dz.mjs → uploads-worker-CMomtRvm.mjs} +1 -1
- package/dist/esm/chunks/{uploadsStore-DeRMJ5c9.mjs → uploadsStore-CsfpSOTS.mjs} +1 -1
- package/dist/esm/chunks/{volumeStore-BX7QcrL-.mjs → volumeStore-TSYPqbHx.mjs} +5 -4
- package/dist/esm/chunks/webRTCStore-CVCDJzj5.mjs +57 -0
- package/dist/esm/chunks/{windowStore-CAzx2-QV.mjs → windowStore-BvejIR82.mjs} +1 -1
- package/dist/esm/components/AudioBubble/index.mjs +4 -6
- package/dist/esm/components/Avatar/index.mjs +3 -5
- package/dist/esm/components/AvatarGroup/index.mjs +4 -6
- package/dist/esm/components/Badge/index.mjs +2 -4
- package/dist/esm/components/Button/index.mjs +8 -10
- package/dist/esm/components/ButtonBar/index.mjs +4 -6
- package/dist/esm/components/Camera/index.mjs +6 -8
- package/dist/esm/components/CheckBox/index.mjs +4 -6
- package/dist/esm/components/Chip/index.mjs +5 -7
- package/dist/esm/components/DivInput/index.mjs +3 -5
- package/dist/esm/components/Dot/index.mjs +2 -4
- package/dist/esm/components/DraggablePanel/index.mjs +3 -5
- package/dist/esm/components/DropDown/index.mjs +4 -6
- package/dist/esm/components/ErrorSummary/index.mjs +3 -5
- package/dist/esm/components/FileIcon/index.mjs +3 -5
- package/dist/esm/components/FileList/index.mjs +6 -8
- package/dist/esm/components/FlexDiv/index.mjs +2 -4
- package/dist/esm/components/Grouper/index.mjs +5 -7
- package/dist/esm/components/Icon/index.mjs +4 -6
- package/dist/esm/components/IconButton/index.mjs +7 -9
- package/dist/esm/components/Label/index.mjs +3 -5
- package/dist/esm/components/Level/index.mjs +11 -0
- package/dist/esm/components/Modal/index.mjs +10 -12
- package/dist/esm/components/ModalController/index.mjs +4 -6
- package/dist/esm/components/Overlay/index.mjs +2 -4
- package/dist/esm/components/Pager/index.mjs +3 -5
- package/dist/esm/components/Progress/index.mjs +4 -6
- package/dist/esm/components/PromptInput/index.mjs +11 -13
- package/dist/esm/components/RadioButton/index.mjs +4 -6
- package/dist/esm/components/RadioButtonList/index.mjs +5 -7
- package/dist/esm/components/Slider/index.mjs +4 -6
- package/dist/esm/components/Spacer/index.mjs +2 -2
- package/dist/esm/components/Switch/index.mjs +2 -4
- package/dist/esm/components/TabBar/index.mjs +8 -10
- package/dist/esm/components/TextArea/index.mjs +9 -11
- package/dist/esm/components/Textfield/index.mjs +10 -12
- package/dist/esm/components/Tip/index.mjs +3 -5
- package/dist/esm/components/Toast/index.mjs +5 -7
- package/dist/esm/components/ToggleButton/index.mjs +9 -11
- package/dist/esm/components/UploadArea/index.mjs +9 -11
- 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/useObserveTheme.mjs +0 -2
- package/dist/esm/hooks/useTheme.mjs +0 -2
- package/dist/esm/hooks/useTrackRenders.mjs +2 -2
- package/dist/esm/hooks.mjs +14 -4
- package/dist/esm/index.mjs +62 -52
- package/dist/esm/providers/ThemeProvider.mjs +6 -19
- package/dist/esm/providers/themeServer.mjs +11 -6
- package/dist/esm/providers.mjs +0 -2
- 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 +17 -13
- package/dist/esm/theme/type.mjs +1 -1
- 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 +8476 -0
- 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 +4 -0
- package/dist/types/components/Toast/_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 +4 -1
- package/dist/types/providers/ThemeProvider.d.ts +1 -6
- 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 +8 -3
- package/dist/cjs/chunks/Avatar-CqUSRzVd.js +0 -84
- package/dist/cjs/chunks/Badge-DjPJ_iJX.js +0 -24
- package/dist/cjs/chunks/CheckBox-Cbh6UK-7.js +0 -53
- package/dist/cjs/chunks/Chip-DcS8dtW2.js +0 -79
- package/dist/cjs/chunks/DropDown-B0970yVe.js +0 -105
- package/dist/cjs/chunks/ErrorSummary-K_rPxGWK.js +0 -87
- package/dist/cjs/chunks/FileList-sDq1jK0b.js +0 -225
- package/dist/cjs/chunks/Grouper-Ccd-x_Nb.js +0 -63
- package/dist/cjs/chunks/IconButton-CF4cR7Tr.js +0 -84
- package/dist/cjs/chunks/Label-htjXHiQ4.js +0 -103
- package/dist/cjs/chunks/Modal-C0Z59meI.js +0 -101
- package/dist/cjs/chunks/Pager-D2_fshTy.js +0 -38
- package/dist/cjs/chunks/RadioButton-DPB2ZGVf.js +0 -56
- package/dist/cjs/chunks/TextArea-CRiPRF8v.js +0 -76
- package/dist/cjs/chunks/Tip-C5keUoHx.js +0 -90
- package/dist/cjs/chunks/Toast-CyiFOsI3.js +0 -178
- package/dist/cjs/chunks/ToggleButton-D5_WnW0o.js +0 -40
- package/dist/cjs/chunks/UploadArea-KqES_OLl.js +0 -129
- package/dist/cjs/chunks/style-inject.es-CMuL-BfJ.js +0 -11
- package/dist/esm/chunks/Avatar-29zhNfxX.mjs +0 -92
- package/dist/esm/chunks/Badge-CC0zSLMf.mjs +0 -30
- package/dist/esm/chunks/CheckBox-7TiT2U47.mjs +0 -65
- package/dist/esm/chunks/Chip-CKsojimU.mjs +0 -91
- package/dist/esm/chunks/DropDown-mwo8fY7p.mjs +0 -115
- package/dist/esm/chunks/ErrorSummary-EzCqVifm.mjs +0 -94
- package/dist/esm/chunks/FileList-fh-x9Dzm.mjs +0 -235
- package/dist/esm/chunks/Grouper-naJMvpB9.mjs +0 -77
- package/dist/esm/chunks/IconButton-ByBYppAj.mjs +0 -100
- package/dist/esm/chunks/Label-C04tD7UZ.mjs +0 -116
- package/dist/esm/chunks/Modal-B9ad9OfJ.mjs +0 -115
- package/dist/esm/chunks/Pager-Bz0FpgO5.mjs +0 -46
- package/dist/esm/chunks/RadioButton-CLeRiZ8x.mjs +0 -66
- package/dist/esm/chunks/TextArea-CxscPLwN.mjs +0 -84
- package/dist/esm/chunks/Tip-C6EcX7_M.mjs +0 -100
- package/dist/esm/chunks/Toast-D4uMNvaa.mjs +0 -192
- package/dist/esm/chunks/ToggleButton-C0QIflzX.mjs +0 -51
- package/dist/esm/chunks/UploadArea-je-1NhGb.mjs +0 -139
- package/dist/esm/chunks/style-inject.es-D0BjEaN8.mjs +0 -11
- /package/dist/cjs/chunks/{SSEConnection-C-1OzEOp.js → SSEConnection-DfjLAlOG.js} +0 -0
- /package/dist/cjs/chunks/{_types-Bdqd2vHh.js → _types-DMyBIF8s.js} +0 -0
- /package/dist/cjs/chunks/{audioVisualizer-EIfIjWH7.js → audioVisualizer-BxPvUj4h.js} +0 -0
- /package/dist/cjs/chunks/{colors-njquvHkx.js → colors-4n0sNFRA.js} +0 -0
- /package/dist/cjs/chunks/{debounce-BF4i6uIC.js → debounce-_IK-La-Z.js} +0 -0
- /package/dist/cjs/chunks/{modalStore-7VjHHM8X.js → modalStore-CFsfK3ba.js} +0 -0
- /package/dist/cjs/chunks/{sharedTypes-gCECyn2N.js → sharedTypes-C0ZHzH_T.js} +0 -0
- /package/dist/cjs/chunks/{tipStore-Ck4NLvml.js → tipStore-dqD9-c30.js} +0 -0
- /package/dist/cjs/chunks/{toastStore-CSStgB9d.js → toastStore-BN1N7WXv.js} +0 -0
- /package/dist/cjs/chunks/{tslib.es6-C8dZW5nY.js → tslib.es6-DsF7Wv4Y.js} +0 -0
- /package/dist/esm/chunks/{SSEConnection-DcA3wFsO.mjs → SSEConnection-iFKOV9Uo.mjs} +0 -0
- /package/dist/esm/chunks/{_types-BVrr_Khp.mjs → _types-DrNviSG6.mjs} +0 -0
- /package/dist/esm/chunks/{audioVisualizer-ZgT77nUw.mjs → audioVisualizer-BsmpLZyK.mjs} +0 -0
- /package/dist/esm/chunks/{colors-FQ0uNQcW.mjs → colors-BAATtfbL.mjs} +0 -0
- /package/dist/esm/chunks/{debounce-Bst1jxMS.mjs → debounce-CYBH5qXQ.mjs} +0 -0
- /package/dist/esm/chunks/{modalStore-BpWnLtOF.mjs → modalStore-DmaeMv7z.mjs} +0 -0
- /package/dist/esm/chunks/{sharedTypes-tn9-uJvb.mjs → sharedTypes-CyrInj1b.mjs} +0 -0
- /package/dist/esm/chunks/{tipStore-CL5a95Bl.mjs → tipStore-B_MUZfr2.mjs} +0 -0
- /package/dist/esm/chunks/{toastStore-D2PEIqCo.mjs → toastStore-DAprlBVj.mjs} +0 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type React from 'react';
|
|
2
|
+
export type LevelBaseProps = {
|
|
3
|
+
audioStream?: MediaStream | MediaStreamTrack | null;
|
|
4
|
+
playing?: boolean;
|
|
5
|
+
backgroundColor?: string;
|
|
6
|
+
colorActive?: string;
|
|
7
|
+
borderRadius?: number | string;
|
|
8
|
+
borderColor?: string;
|
|
9
|
+
borderWidth?: number;
|
|
10
|
+
width?: number | string;
|
|
11
|
+
gap?: number;
|
|
12
|
+
height?: number;
|
|
13
|
+
minIntensity?: number;
|
|
14
|
+
maxIntensity?: number;
|
|
15
|
+
intensity?: number;
|
|
16
|
+
peakIntensity?: number;
|
|
17
|
+
risePerSeconds?: number;
|
|
18
|
+
releasePerSeconds?: number;
|
|
19
|
+
ReleasePerSeconds?: number;
|
|
20
|
+
};
|
|
21
|
+
export type LevelProps = Omit<React.HTMLAttributes<HTMLDivElement>, keyof LevelBaseProps> & LevelBaseProps;
|
|
@@ -28,12 +28,16 @@ type ModalBaseProps<T = string> = {
|
|
|
28
28
|
titleBorderColor?: string;
|
|
29
29
|
titleBorderWidth?: number;
|
|
30
30
|
titleIcon?: string;
|
|
31
|
+
titleIconFill?: boolean;
|
|
31
32
|
titleSize?: 'xs' | 's' | 'm' | 'l' | 'xl';
|
|
32
33
|
contentSize?: 'xs' | 's' | 'm' | 'l' | 'xl';
|
|
33
34
|
close?: boolean;
|
|
34
35
|
actions?: ModalAction<T>[];
|
|
35
36
|
actionsBorderColor?: string;
|
|
36
37
|
actionsBorderWidth?: number;
|
|
38
|
+
autoBorderBottom?: boolean;
|
|
39
|
+
scrollHandleColor?: string;
|
|
40
|
+
scrollHandleColorHover?: string;
|
|
37
41
|
onAction?: (value?: T) => void;
|
|
38
42
|
onResolve?: (value?: T) => void;
|
|
39
43
|
onReject?: (value?: Error) => void;
|
|
@@ -6,6 +6,8 @@ export { type KeyboardShortcut, type KeyboardShortcuts, useKeyboardShortcuts, }
|
|
|
6
6
|
export { useLastUpdated } from './useLastUpdated/useLastUpdated';
|
|
7
7
|
export { useLocalStore } from './useLocalStore/useLocalStore';
|
|
8
8
|
export { useMDStreamBuffer } from './useMdStreamBuffer/useMdStreamBuffer';
|
|
9
|
+
export type { UseMDStreamBufferOptions } from './useMdStreamBuffer/useMdStreamBuffer';
|
|
10
|
+
export { useBindWebRTC, type UseBindWebRTCOptions, type UseBindWebRTCReturn, } from './useBindWebRTC/useBindWebRTC';
|
|
9
11
|
export { useMicrophone } from './useMicrophone/useMicrophone';
|
|
10
12
|
export type { MicOption, UseMicrophoneReturn, } from './useMicrophone/useMicrophone';
|
|
11
13
|
export { useAudioRecorder } from './useAudioRecorder/useAudioRecorder';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './useBindWebRTC';
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { WebRTCStoreConnectionOptions } from '../../stores/WebRTC';
|
|
2
|
+
import type { WebRTCConnection } from '../../utils';
|
|
3
|
+
export type UseBindWebRTCOptions = {
|
|
4
|
+
connectionName: string;
|
|
5
|
+
offerOptions?: RTCOfferOptions;
|
|
6
|
+
bearerToken?: string;
|
|
7
|
+
} & Omit<WebRTCStoreConnectionOptions, 'micStream' | 'micTrack' | 'volume'>;
|
|
8
|
+
export type UseBindWebRTCReturn = {
|
|
9
|
+
connection: WebRTCConnection | null;
|
|
10
|
+
error: Error | null;
|
|
11
|
+
bind: () => Promise<WebRTCConnection | null>;
|
|
12
|
+
unbind: () => void;
|
|
13
|
+
bound: boolean;
|
|
14
|
+
};
|
|
15
|
+
export declare function useBindWebRTC(options: UseBindWebRTCOptions): UseBindWebRTCReturn;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare function useLocalStore<T>(key: string, value: T): readonly [T, (data: T) => void];
|
|
1
|
+
export declare function useLocalStore<T>(key: string, value: T): readonly [T, (data: T) => void, boolean];
|
|
@@ -1,8 +1,13 @@
|
|
|
1
1
|
import type { MarkdownStreamBufferOptions, MarkdownStreamBufferSnapshot } from '../../utils';
|
|
2
|
-
export
|
|
2
|
+
export type UseMDStreamBufferOptions = MarkdownStreamBufferOptions & {
|
|
3
|
+
paceDelayMs?: number;
|
|
4
|
+
paceChunkSize?: number;
|
|
5
|
+
};
|
|
6
|
+
export declare function useMDStreamBuffer(options?: UseMDStreamBufferOptions): {
|
|
3
7
|
raw: string;
|
|
4
8
|
healthy: string;
|
|
5
9
|
isComplete: boolean;
|
|
10
|
+
pendingCharacters: number;
|
|
6
11
|
append: (value: string) => void;
|
|
7
12
|
flush: () => MarkdownStreamBufferSnapshot | undefined;
|
|
8
13
|
complete: () => MarkdownStreamBufferSnapshot | undefined;
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
|
+
import './theme.css';
|
|
1
2
|
export type { ToolTip, ToolTipInfo } from './components/sharedTypes';
|
|
2
3
|
export { ToolTipType } from './components/sharedTypes';
|
|
3
4
|
export { light, dark, lightTheme, darkTheme, motion, elevations, Elevation, } from './theme';
|
|
4
5
|
export type { SliceTheme, Colors, Type, Corners, Elevations, } from './theme';
|
|
5
|
-
export { type KeyboardShortcut, type KeyboardShortcuts, type BreakPoints, type WindowGeolocation, type WindowGeolocationError, type MicOption, type UseMicrophoneReturn, useKeyboardShortcuts, useTheme, useObserveTheme, useToolTip, useLastUpdated, useLocalStore, useMDStreamBuffer, useAudioRecorder, useMicrophone, useWindow, useDoubleClick, useObserveResize, } from './hooks';
|
|
6
|
+
export { type KeyboardShortcut, type KeyboardShortcuts, type BreakPoints, type WindowGeolocation, type WindowGeolocationError, type MicOption, type UseBindWebRTCOptions, type UseBindWebRTCReturn, type UseMDStreamBufferOptions, type UseMicrophoneReturn, useBindWebRTC, useKeyboardShortcuts, useTheme, useObserveTheme, useToolTip, useLastUpdated, useLocalStore, useMDStreamBuffer, useAudioRecorder, useMicrophone, useWindow, useDoubleClick, useObserveResize, } from './hooks';
|
|
6
7
|
export { AudioBubble } from './components/AudioBubble/index';
|
|
7
8
|
export type { AudioBubbleProps } from './components/AudioBubble/index';
|
|
8
9
|
export { Avatar } from './components/Avatar/index';
|
|
@@ -78,6 +79,8 @@ export type { BarButton, ButtonBarProps } from './components/ButtonBar/_types';
|
|
|
78
79
|
export { Label } from './components/Label';
|
|
79
80
|
export { LabelBackground } from './components/Label';
|
|
80
81
|
export type { LabelProps } from './components/Label';
|
|
82
|
+
export { Level } from './components/Level';
|
|
83
|
+
export type { LevelProps } from './components/Level';
|
|
81
84
|
export { UploadArea } from './components/UploadArea';
|
|
82
85
|
export type { UploadAreaProps } from './components/UploadArea/_types';
|
|
83
86
|
export { imageTypes, videoTypes, documentTypes, audioTypes, textTypes, allTypes, } from './components/UploadArea/_types';
|
|
@@ -1,14 +1,9 @@
|
|
|
1
1
|
import type React from 'react';
|
|
2
|
-
import '../theme/colors/colors.css';
|
|
3
|
-
import '../theme/elevations/elevation.css';
|
|
4
|
-
import '../theme/type/type.css';
|
|
5
|
-
import '../theme/breakpoints/custom-media.css';
|
|
6
|
-
import '../theme/motion/motion.css';
|
|
7
|
-
import '../theme/global/global.css';
|
|
8
2
|
interface ThemeProviderProps {
|
|
9
3
|
children?: React.ReactNode;
|
|
10
4
|
theme?: string;
|
|
11
5
|
initialTheme?: string;
|
|
6
|
+
initialSystem?: boolean;
|
|
12
7
|
system?: boolean;
|
|
13
8
|
global?: boolean;
|
|
14
9
|
}
|
|
@@ -1,14 +1,18 @@
|
|
|
1
1
|
export type SliceThemeName = 'lightMode' | 'darkMode';
|
|
2
2
|
type ResolveInitialThemeOptions = {
|
|
3
3
|
theme?: string | null;
|
|
4
|
-
|
|
4
|
+
systemTheme?: boolean;
|
|
5
|
+
activeTheme?: string | null;
|
|
5
6
|
fallbackTheme?: SliceThemeName;
|
|
6
7
|
};
|
|
7
8
|
/**
|
|
8
9
|
* Resolve the startup Slice theme from an explicit theme value, cookie value,
|
|
9
|
-
* or fallback theme in that order.
|
|
10
|
+
* or fallback theme in that order. Resolves a system to true if undefined.
|
|
10
11
|
*/
|
|
11
|
-
export declare function resolveInitialTheme(options?: ResolveInitialThemeOptions):
|
|
12
|
+
export declare function resolveInitialTheme(options?: ResolveInitialThemeOptions): {
|
|
13
|
+
initialTheme: SliceThemeName;
|
|
14
|
+
initialSystem: boolean;
|
|
15
|
+
};
|
|
12
16
|
/**
|
|
13
17
|
* Return the root HTML attributes needed to render the active Slice theme
|
|
14
18
|
* before client hydration.
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { WebRTCConnection, WebRTCConnectionOptions } from '../../utils';
|
|
2
|
+
export type WebRTCStoreConnectionOptions = WebRTCConnectionOptions;
|
|
3
|
+
export interface WebRTCStoreConnection {
|
|
4
|
+
name: string;
|
|
5
|
+
connection: WebRTCConnection;
|
|
6
|
+
}
|
|
7
|
+
export interface WebRTCStore {
|
|
8
|
+
connections: WebRTCStoreConnection[];
|
|
9
|
+
actions: {
|
|
10
|
+
addConnection: (name: string, options: WebRTCStoreConnectionOptions) => WebRTCStoreConnection;
|
|
11
|
+
initializeConnection: (name: string, offerOptions?: RTCOfferOptions, bearerToken?: string) => Promise<void>;
|
|
12
|
+
removeConnection: (name: string) => void;
|
|
13
|
+
setMicStream: (name: string, stream: MediaStream | null) => Promise<void>;
|
|
14
|
+
setVolume: (name: string, volume: number) => void;
|
|
15
|
+
};
|
|
16
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { WebRTCStore, WebRTCStoreConnectionOptions } from './_types';
|
|
2
|
+
export declare const useWebRTCStore: import("zustand").UseBoundStore<import("zustand").StoreApi<WebRTCStore>>;
|
|
3
|
+
export declare const useWebRTC: () => {
|
|
4
|
+
addConnection: (name: string, options: WebRTCStoreConnectionOptions) => import("./_types").WebRTCStoreConnection;
|
|
5
|
+
initializeConnection: (name: string, offerOptions?: RTCOfferOptions, bearerToken?: string) => Promise<void>;
|
|
6
|
+
removeConnection: (name: string) => void;
|
|
7
|
+
setMicStream: (name: string, stream: MediaStream | null) => Promise<void>;
|
|
8
|
+
setVolume: (name: string, volume: number) => void;
|
|
9
|
+
};
|
|
10
|
+
export declare const useWebRTCConnections: () => import("./_types").WebRTCStoreConnection[];
|
|
11
|
+
export declare const useWebRTCConnection: (name: string) => import("./_types").WebRTCStoreConnection | null;
|
|
12
|
+
export declare const useWebRTCConnected: (name?: string) => boolean;
|
|
13
|
+
export declare const useWebRTCActions: {
|
|
14
|
+
addConnection: (name: string, options: WebRTCStoreConnectionOptions) => import("./_types").WebRTCStoreConnection;
|
|
15
|
+
initializeConnection: (name: string, offerOptions?: RTCOfferOptions, bearerToken?: string) => Promise<void>;
|
|
16
|
+
removeConnection: (name: string) => void;
|
|
17
|
+
setMicStream: (name: string, stream: MediaStream | null) => Promise<void>;
|
|
18
|
+
setVolume: (name: string, volume: number) => void;
|
|
19
|
+
};
|
|
20
|
+
export declare function getWebRTCConnections(): ReturnType<typeof useWebRTCStore.getState>['connections'];
|
|
21
|
+
export declare function getWebRTCConnections(name: string): ReturnType<typeof useWebRTCStore.getState>['connections'][number] | null;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { useMicrophoneStore, useSyncMicrophoneStore, useMicStream, useProcessedMicStream, useMicTrack, useCurrentMicDeviceId, useMicActive, useMicInputVolume, useMicMuted, useMicSupported, useMicRequesting, useMicError, useMicrophones, useMicOptions, useMicrophoneStoreActions, microphoneActions, getMicrophoneState, } from './microphoneStore';
|
|
1
|
+
export { useMicrophoneStore, useSyncMicrophoneStore, useMicStream, useProcessedMicStream, useMicTrack, useCurrentMicDeviceId, useCurrentMicDeviceLabel, useMicActive, useMicInputVolume, useMicMuted, useMicSupported, useMicRequesting, useMicError, useMicrophones, useMicOptions, useMicrophoneStoreActions, microphoneActions, getMicrophoneState, getCurrentMicDeviceLabel, } from './microphoneStore';
|
|
2
2
|
export type { MicrophoneStore, MicrophoneStoreActions, MicrophoneStoreState, } from './_types';
|
|
@@ -14,6 +14,7 @@ export declare const useMicStream: () => RefObject<MediaStream | null>;
|
|
|
14
14
|
export declare const useProcessedMicStream: () => RefObject<MediaStream | null>;
|
|
15
15
|
export declare const useMicTrack: () => RefObject<MediaStreamTrack | null>;
|
|
16
16
|
export declare const useCurrentMicDeviceId: () => string | null;
|
|
17
|
+
export declare const useCurrentMicDeviceLabel: () => string | null;
|
|
17
18
|
export declare const useMicActive: () => boolean;
|
|
18
19
|
export declare const useMicInputVolume: () => number;
|
|
19
20
|
export declare const useMicMuted: () => boolean;
|
|
@@ -23,5 +24,17 @@ export declare const useMicError: () => Error | null;
|
|
|
23
24
|
export declare const useMicrophones: () => MediaDeviceInfo[];
|
|
24
25
|
export declare const useMicOptions: () => DropDownOption<MicOption>[];
|
|
25
26
|
export declare const useMicrophoneStoreActions: () => MicrophoneStoreActions;
|
|
26
|
-
export declare const microphoneActions:
|
|
27
|
+
export declare const microphoneActions: {
|
|
28
|
+
sync: (microphone: UseMicrophoneReturn | null) => void;
|
|
29
|
+
clear: () => void;
|
|
30
|
+
requestMicrophone: () => Promise<MediaStream | null>;
|
|
31
|
+
stopMicrophone: () => void;
|
|
32
|
+
muteMic: () => boolean;
|
|
33
|
+
unmuteMic: () => boolean;
|
|
34
|
+
toggleMute: () => void;
|
|
35
|
+
setInputVolume: (volume: number) => number;
|
|
36
|
+
refreshMicrophones: () => Promise<MediaDeviceInfo[]>;
|
|
37
|
+
setMicrophone: (deviceId: string | DropDownOption<MicOption>) => Promise<void>;
|
|
38
|
+
};
|
|
27
39
|
export declare const getMicrophoneState: () => MicrophoneStore;
|
|
40
|
+
export declare const getCurrentMicDeviceLabel: () => string | null;
|
|
@@ -10,7 +10,9 @@ export type VolumeStore = {
|
|
|
10
10
|
attachFeedbackElement: (element: AudioElement) => void;
|
|
11
11
|
detachFeedbackElement: (element: AudioElement) => void;
|
|
12
12
|
playFeedback: (volume?: number) => Promise<void>;
|
|
13
|
-
setVolume: (volume: number
|
|
13
|
+
setVolume: (volume: number, options?: {
|
|
14
|
+
playFeedback?: boolean;
|
|
15
|
+
}) => void;
|
|
14
16
|
mute: () => Promise<void>;
|
|
15
17
|
unmute: () => Promise<void>;
|
|
16
18
|
clearMedia: () => void;
|
|
@@ -10,7 +10,9 @@ export declare const useVolumeActions: () => {
|
|
|
10
10
|
attachFeedbackElement: (element: AudioElement) => void;
|
|
11
11
|
detachFeedbackElement: (element: AudioElement) => void;
|
|
12
12
|
playFeedback: (volume?: number) => Promise<void>;
|
|
13
|
-
setVolume: (volume: number
|
|
13
|
+
setVolume: (volume: number, options?: {
|
|
14
|
+
playFeedback?: boolean;
|
|
15
|
+
}) => void;
|
|
14
16
|
mute: () => Promise<void>;
|
|
15
17
|
unmute: () => Promise<void>;
|
|
16
18
|
clearMedia: () => void;
|
|
@@ -21,7 +23,9 @@ export declare const volumeActions: {
|
|
|
21
23
|
attachFeedbackElement: (element: AudioElement) => void;
|
|
22
24
|
detachFeedbackElement: (element: AudioElement) => void;
|
|
23
25
|
playFeedback: (volume?: number) => Promise<void>;
|
|
24
|
-
setVolume: (volume: number
|
|
26
|
+
setVolume: (volume: number, options?: {
|
|
27
|
+
playFeedback?: boolean;
|
|
28
|
+
}) => void;
|
|
25
29
|
mute: () => Promise<void>;
|
|
26
30
|
unmute: () => Promise<void>;
|
|
27
31
|
clearMedia: () => void;
|
|
@@ -8,7 +8,7 @@ export declare function nameAndExtension(fileName: string): {
|
|
|
8
8
|
/**
|
|
9
9
|
* Map a file extension to the corresponding file icon name.
|
|
10
10
|
*/
|
|
11
|
-
export declare function fileIconName(extension: string): "other" | "
|
|
11
|
+
export declare function fileIconName(extension: string): "other" | "audio" | "video" | "text" | "sheet" | "image" | "md" | "code" | "preso" | "pdf" | "clipboard";
|
|
12
12
|
/**
|
|
13
13
|
* Create a clipboard-text file with a guaranteed `.clipboard` extension.
|
|
14
14
|
*/
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { copyToClipboard, hexToRgb } from './functions/misc';
|
|
2
2
|
export { debounce } from './functions/debounce';
|
|
3
3
|
export * from './functions/colors';
|
|
4
|
-
export { AudioVisualizer, IndexedDB, MdBuffer, SSEConnection, WSConnection, } from './objects';
|
|
5
|
-
export type { AudioVisualizerOptions, AudioVisualizerSource, IndexedDBOptions, MarkdownAutoCloseRule, MarkdownStreamBufferOptions, MarkdownStreamBufferSnapshot, SSECustomEvent, SSEConnectionCloseOption, SSEConnectionOptions, SSEEventMap, SSEUnifiedBuiltInMessage, SSEUnifiedCustomMessage, SSEUnifiedMessage, UnifiedMessageEvent, WSConnectionOptions, } from './objects';
|
|
4
|
+
export { AudioVisualizer, IndexedDB, MdBuffer, SSEConnection, WebRTCConnection, WSConnection, } from './objects';
|
|
5
|
+
export type { AudioVisualizerOptions, AudioVisualizerSource, IndexedDBOptions, MarkdownAutoCloseRule, MarkdownStreamBufferOptions, MarkdownStreamBufferSnapshot, SSECustomEvent, SSEConnectionCloseOption, SSEConnectionOptions, SSEEventMap, SSEUnifiedBuiltInMessage, SSEUnifiedCustomMessage, SSEUnifiedMessage, UnifiedMessageEvent, WebRTCConnectionOptions, WSConnectionOptions, } from './objects';
|
|
@@ -7,6 +7,7 @@ export declare class MdBuffer {
|
|
|
7
7
|
private readonly healthyEndMarker?;
|
|
8
8
|
private readonly htmlHandling;
|
|
9
9
|
private readonly includeLinksAndImages;
|
|
10
|
+
private readonly flushDelayMs;
|
|
10
11
|
private readonly onFlush?;
|
|
11
12
|
private readonly requestFrame;
|
|
12
13
|
private readonly cancelFrame;
|
|
@@ -14,6 +15,9 @@ export declare class MdBuffer {
|
|
|
14
15
|
private committedRaw;
|
|
15
16
|
private activeRaw;
|
|
16
17
|
private frameHandle;
|
|
18
|
+
private flushTimer;
|
|
19
|
+
private lastFlushAt;
|
|
20
|
+
private lastFlushedRawLength;
|
|
17
21
|
private completeSignal;
|
|
18
22
|
constructor(options?: MarkdownStreamBufferOptions);
|
|
19
23
|
/**
|
|
@@ -24,6 +28,10 @@ export declare class MdBuffer {
|
|
|
24
28
|
* The current parser-safe preview derived from the raw buffer.
|
|
25
29
|
*/
|
|
26
30
|
get healthy(): string;
|
|
31
|
+
/**
|
|
32
|
+
* Characters appended since the last emitted snapshot.
|
|
33
|
+
*/
|
|
34
|
+
get pendingCharacters(): number;
|
|
27
35
|
/**
|
|
28
36
|
* Append a streamed Markdown token and schedule a frame flush.
|
|
29
37
|
*/
|
|
@@ -46,6 +54,8 @@ export declare class MdBuffer {
|
|
|
46
54
|
dispose(): void;
|
|
47
55
|
private handleEndOfStreamToken;
|
|
48
56
|
private scheduleFlush;
|
|
57
|
+
private getRemainingFlushDelay;
|
|
58
|
+
private clearScheduledFlush;
|
|
49
59
|
private commitStableLines;
|
|
50
60
|
private buildHealthyOutput;
|
|
51
61
|
private applyHealthyEndMarker;
|
|
@@ -3,6 +3,7 @@ export interface MarkdownStreamBufferSnapshot {
|
|
|
3
3
|
healthy: string;
|
|
4
4
|
reason: 'raf' | 'manual' | 'complete';
|
|
5
5
|
isComplete: boolean;
|
|
6
|
+
pendingCharacters: number;
|
|
6
7
|
}
|
|
7
8
|
export interface MarkdownAutoCloseRule {
|
|
8
9
|
name?: string;
|
|
@@ -19,6 +20,7 @@ export interface MarkdownStreamBufferOptions {
|
|
|
19
20
|
healthyEndMarker?: string;
|
|
20
21
|
htmlHandling?: 'ignore' | 'strip';
|
|
21
22
|
includeLinksAndImages?: boolean;
|
|
23
|
+
flushDelayMs?: number;
|
|
22
24
|
onFlush?: (snapshot: MarkdownStreamBufferSnapshot) => void;
|
|
23
25
|
requestFrame?: (callback: FrameRequestCallback) => number;
|
|
24
26
|
cancelFrame?: (handle: number) => void;
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import type { WebRTCConnectionOptions } from './_types';
|
|
2
2
|
export declare class WebRTCConnection {
|
|
3
3
|
private readonly peerConnection;
|
|
4
|
-
private
|
|
4
|
+
private RTCSenderAudioTrack;
|
|
5
5
|
private readonly RTCSenderVideoTrack?;
|
|
6
|
+
private RTCSenderAudioSender;
|
|
7
|
+
private readonly RTCSenderAudioStream;
|
|
6
8
|
private RTCScreenShareTrack;
|
|
7
9
|
private RTCScreenShareSender;
|
|
8
10
|
private readonly RTCReceiverAudioStream;
|
|
@@ -11,7 +13,7 @@ export declare class WebRTCConnection {
|
|
|
11
13
|
private readonly RTCDataChannels;
|
|
12
14
|
private readonly connectionUrl;
|
|
13
15
|
private connectionOffer;
|
|
14
|
-
private audioElement;
|
|
16
|
+
private readonly audioElement;
|
|
15
17
|
private readonly autoPlayAudio;
|
|
16
18
|
private readonly onRemoteAudioStream?;
|
|
17
19
|
private readonly onRemoteVideoStream?;
|
|
@@ -19,6 +21,22 @@ export declare class WebRTCConnection {
|
|
|
19
21
|
private iceTimer?;
|
|
20
22
|
private offerOptions?;
|
|
21
23
|
private bearerToken?;
|
|
24
|
+
/**
|
|
25
|
+
* Report whether the peer connection is currently connected
|
|
26
|
+
*/
|
|
27
|
+
get connected(): boolean;
|
|
28
|
+
/**
|
|
29
|
+
* Report whether the connection currently has an audio path attached
|
|
30
|
+
*/
|
|
31
|
+
get audioConnected(): boolean;
|
|
32
|
+
/**
|
|
33
|
+
* Report whether the connection currently has a video path attached
|
|
34
|
+
*/
|
|
35
|
+
get videoConnected(): boolean;
|
|
36
|
+
/**
|
|
37
|
+
* Report whether any data channel is currently open
|
|
38
|
+
*/
|
|
39
|
+
get dataConnected(): boolean;
|
|
22
40
|
/**
|
|
23
41
|
* Create the base instance
|
|
24
42
|
*/
|
|
@@ -54,7 +72,19 @@ export declare class WebRTCConnection {
|
|
|
54
72
|
/**
|
|
55
73
|
* Set the playback volume for the incoming audio element
|
|
56
74
|
*/
|
|
57
|
-
|
|
75
|
+
setVolume(volume: number): void;
|
|
76
|
+
/**
|
|
77
|
+
* Replace the outgoing audio source with the first track from a stream
|
|
78
|
+
*/
|
|
79
|
+
setOutgoingAudioStream(stream: MediaStream | null): Promise<void>;
|
|
80
|
+
/**
|
|
81
|
+
* Replace the outgoing audio track without rebuilding the peer connection
|
|
82
|
+
*/
|
|
83
|
+
replaceAudioTrack(track: MediaStreamTrack | null): Promise<void>;
|
|
84
|
+
/**
|
|
85
|
+
* Close the peer connection and release local media bindings
|
|
86
|
+
*/
|
|
87
|
+
close(): void;
|
|
58
88
|
/**
|
|
59
89
|
* Create an audio source node from the unified incoming audio stream
|
|
60
90
|
*/
|
|
@@ -71,6 +101,10 @@ export declare class WebRTCConnection {
|
|
|
71
101
|
* Set up a local stream with mic and video tracks and add to peer connection
|
|
72
102
|
*/
|
|
73
103
|
private setupOutgoingMediaStream;
|
|
104
|
+
/**
|
|
105
|
+
* Keep the sender stream aligned to the current local audio track
|
|
106
|
+
*/
|
|
107
|
+
private syncSenderAudioStream;
|
|
74
108
|
/**
|
|
75
109
|
* Setup data channels
|
|
76
110
|
*/
|
|
@@ -1,11 +1,20 @@
|
|
|
1
|
-
|
|
1
|
+
type WebRTCMicStreamOption = {
|
|
2
|
+
micStream: MediaStream;
|
|
3
|
+
micTrack?: MediaStreamTrack | null;
|
|
4
|
+
};
|
|
5
|
+
type WebRTCMicTrackOption = {
|
|
6
|
+
micStream?: MediaStream | null;
|
|
7
|
+
micTrack: MediaStreamTrack;
|
|
8
|
+
};
|
|
9
|
+
export type WebRTCConnectionOptions = (WebRTCMicStreamOption | WebRTCMicTrackOption) & {
|
|
2
10
|
connectionUrl?: string;
|
|
3
11
|
audioElement?: HTMLAudioElement;
|
|
4
12
|
autoPlayAudio?: boolean;
|
|
13
|
+
volume?: number;
|
|
5
14
|
dataChannels?: string | string[];
|
|
6
|
-
|
|
7
|
-
videoMediaTrack?: MediaStreamTrack;
|
|
15
|
+
videoTrack?: MediaStreamTrack | null;
|
|
8
16
|
onRemoteVideoStream?: (streams: Map<string, MediaStream>) => void;
|
|
9
17
|
onRemoteAudioStream?: (streams: Map<string, MediaStream>) => void;
|
|
10
18
|
onDataChannelEvent?: (channel: string, eventType: 'message' | 'open' | 'close' | 'error', eventData: MessageEvent | Event | RTCErrorEvent) => void;
|
|
11
|
-
}
|
|
19
|
+
};
|
|
20
|
+
export {};
|
|
@@ -8,3 +8,5 @@ export { SSEConnection } from './SSEConnection/SSEConnection';
|
|
|
8
8
|
export { WSConnection } from './WSConnection/WSConnection';
|
|
9
9
|
export type { SSECustomEvent, SSEConnectionCloseOption, SSEConnectionOptions, SSEEventMap, SSEUnifiedBuiltInMessage, SSEUnifiedCustomMessage, SSEUnifiedMessage, } from './SSEConnection/SSEConnection';
|
|
10
10
|
export type { UnifiedMessageEvent, WSConnectionOptions, } from './WSConnection/WSConnection';
|
|
11
|
+
export { WebRTCConnection } from './WebRTCConnection/WebRTCConnection';
|
|
12
|
+
export type { WebRTCConnectionOptions } from './WebRTCConnection/_types';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@apple-pie/slice",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.32",
|
|
4
4
|
"main": "dist/cjs/index.js",
|
|
5
5
|
"module": "dist/esm/index.mjs",
|
|
6
6
|
"exports": {
|
|
@@ -73,6 +73,9 @@
|
|
|
73
73
|
"import": "./dist/esm/theme/type.mjs",
|
|
74
74
|
"require": "./dist/cjs/theme/type.js"
|
|
75
75
|
},
|
|
76
|
+
"./styles.css": "./dist/styles.css",
|
|
77
|
+
"./css/flexBox.module.css": "./dist/css/flexBox.module.css",
|
|
78
|
+
"./css/type.module.css": "./dist/css/type.module.css",
|
|
76
79
|
"./theme/themes": {
|
|
77
80
|
"types": "./dist/types/theme/themes.d.ts",
|
|
78
81
|
"import": "./dist/esm/theme/themes.mjs",
|
|
@@ -109,8 +112,8 @@
|
|
|
109
112
|
"pack:tarball": "npm pack && ./scripts/copy-tgz.sh",
|
|
110
113
|
"prepack": "npm run build",
|
|
111
114
|
"prebuild": "rm -rf dist",
|
|
112
|
-
"build": "NODE_ENV=production rollup -c --bundleConfigAsCjs && tsc -p tsconfig.build.json && ./scripts/copy-css.sh",
|
|
113
|
-
"build:min": "MINIFY=true NODE_ENV=production rollup -c --bundleConfigAsCjs && tsc -p tsconfig.build.json && ./scripts/copy-css.sh",
|
|
115
|
+
"build": "NODE_ENV=production rollup -c --bundleConfigAsCjs && tsc -p tsconfig.build.json && node ./scripts/finalize-styles.mjs && ./scripts/copy-css.sh",
|
|
116
|
+
"build:min": "MINIFY=true NODE_ENV=production rollup -c --bundleConfigAsCjs && tsc -p tsconfig.build.json && node ./scripts/finalize-styles.mjs && ./scripts/copy-css.sh",
|
|
114
117
|
"dev": "vite",
|
|
115
118
|
"storybook": "storybook dev -p 6006",
|
|
116
119
|
"build-storybook": "storybook build"
|
|
@@ -152,6 +155,8 @@
|
|
|
152
155
|
"jsdom": "^28.1.0",
|
|
153
156
|
"playwright": "^1.58.2",
|
|
154
157
|
"postcss-custom-media": "^11.0.6",
|
|
158
|
+
"postcss-import": "^16.1.1",
|
|
159
|
+
"postcss-nested": "^6.2.0",
|
|
155
160
|
"rollup": "^4.32.0",
|
|
156
161
|
"rollup-plugin-json": "^4.0.0",
|
|
157
162
|
"rollup-plugin-peer-deps-external": "^2.2.4",
|
|
@@ -1,84 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
"use strict";
|
|
3
|
-
|
|
4
|
-
var tslib_es6 = require("./tslib.es6-C8dZW5nY.js"), jsxRuntime = require("react/jsx-runtime"), React = require("react"), misc = require("./misc-QpU0XEOW.js"), styleInject_es = require("./style-inject.es-CMuL-BfJ.js"), css_wrapper = "Avatar-module_wrapper__ab1D7 flexBox-module_row__z24tF type-module_body-m-regular__LuQBA", css_user = "Avatar-module_user__ZQv0Q flexBox-module_row__z24tF type-module_body-m-regular__LuQBA";
|
|
5
|
-
|
|
6
|
-
styleInject_es.styleInject(".flexBox-module_row__z24tF {\n\tdisplay: flex;\n\tjustify-content: center;\n\talign-items: center;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.flexBox-module_rowBetween__5FEvi {\n\tdisplay: flex;\n\tjustify-content: space-between;\n\talign-items: center;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.flexBox-module_rowStart__4tcxS {\n\tdisplay: flex;\n\tjustify-content: flex-start;\n\talign-items: center;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.flexBox-module_rowEnd__rVdVm {\n\tdisplay: flex;\n\tjustify-content: flex-end;\n\talign-items: center;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.flexBox-module_column__ezvMq {\n\tdisplay: flex;\n\tflex-direction: column;\n\tjustify-content: center;\n\talign-items: center;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.flexBox-module_columnStart__C7P44 {\n\tdisplay: flex;\n\tflex-direction: column;\n\tjustify-content: flex-start;\n\talign-items: flex-start;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.flexBox-module_columnStartCenter__PKcrG {\n\tdisplay: flex;\n\tflex-direction: column;\n\tjustify-content: flex-start;\n\talign-items: center;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.flexBox-module_columnBetween__ERfp7 {\n\tdisplay: flex;\n\tflex-direction: column;\n\tjustify-content: space-between;\n\talign-items: center;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.flexBox-module_columnEnd__lLJuc {\n\tdisplay: flex;\n\tflex-direction: column;\n\tjustify-content: flex-end;\n\talign-items: flex-end;\n\tbox-sizing: border-box;\n\tpadding: 0;\n\tmargin: 0;\n}.type-module_body-xs-regular__ZAFft {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-regular);\n\tfont-size: var(--font-size-xs);\n\tline-height: 133.33%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_body-xs-medium__s3KvF {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-medium);\n\tfont-size: var(--font-size-xs);\n\tline-height: 133.33%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_body-xs-bold__Lhqqq {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-bold);\n\tfont-size: var(--font-size-xs);\n\tline-height: 133.33%;\n\ttext-decoration: none;\n\tletter-spacing: 0.25px;\n}.type-module_body-s-regular__vRHSP {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-regular);\n\tfont-size: var(--font-size-s);\n\tline-height: 142.86%;\n\ttext-decoration: none;\n\tletter-spacing: 0.15px;\n}.type-module_body-s-medium__tjdFc {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-medium);\n\tfont-size: var(--font-size-s);\n\tline-height: 142.86%;\n\ttext-decoration: none;\n\tletter-spacing: 0.15px;\n}.type-module_body-s-bold__Iy-VX {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-bold);\n\tfont-size: var(--font-size-s);\n\tline-height: 142.86%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_body-m-regular__LuQBA {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-regular);\n\tfont-size: var(--font-size-m);\n\tline-height: 140%;\n\ttext-decoration: none;\n\tletter-spacing: 0.15px;\n}.type-module_body-m-medium__uW1on {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-medium);\n\tfont-size: var(--font-size-m);\n\tline-height: 140%;\n\ttext-decoration: none;\n\tletter-spacing: 0.15px;\n}.type-module_body-m-bold__UBcvQ {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-bold);\n\tfont-size: var(--font-size-m);\n\tline-height: 140%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_body-l-regular__lOYbg {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-regular);\n\tfont-size: var(--font-size-l);\n\tline-height: 162.5%;\n\ttext-decoration: none;\n\tletter-spacing: 0.1px;\n}.type-module_body-l-medium__BqRC7 {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-medium);\n\tfont-size: var(--font-size-l);\n\tline-height: 162.5%;\n\ttext-decoration: none;\n\tletter-spacing: 0.1px;\n}.type-module_body-l-bold__Fh2dt {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-bold);\n\tfont-size: var(--font-size-l);\n\tline-height: 162.5%;\n\ttext-decoration: none;\n\tletter-spacing: 0.15px;\n}.type-module_body-xl-regular__pF2kC {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-regular);\n\tfont-size: var(--font-size-xl);\n\tline-height: 162.5%;\n\ttext-decoration: none;\n\tletter-spacing: 0.1px;\n}.type-module_body-xl-medium__BeyrH {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-medium);\n\tfont-size: var(--font-size-xl);\n\tline-height: 162.5%;\n\ttext-decoration: none;\n\tletter-spacing: 0.1px;\n}.type-module_body-xl-bold__Ruknj {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: var(--font-weight-bold);\n\tfont-size: var(--font-size-xl);\n\tline-height: 162.5%;\n\ttext-decoration: none;\n\tletter-spacing: 0.15px;\n}.type-module_heading-s-medium__z8L3G {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: 500;\n\tfont-size: 20px;\n\tline-height: 140%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_heading-s-bold__0O3g6 {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: 600;\n\tfont-size: 20px;\n\tline-height: 140%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_heading-m-bold__KXxEB {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: 500;\n\tfont-size: 24px;\n\tline-height: 116.67%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_heading-m-medium__cJeEA {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: 600;\n\tfont-size: 24px;\n\tline-height: 116.67%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_heading-l-medium__eRe05 {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: 500;\n\tfont-size: 30px;\n\tline-height: 128.57%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_heading-l-bold__Xmwtf {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: 600;\n\tfont-size: 30px;\n\tline-height: 128.57%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_heading-xl-medium__5q1m3 {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: 500;\n\tfont-size: 36px;\n\tline-height: 128.57%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}.type-module_heading-xl-bold__k9VFV {\n\tfont-family: var(--font-family), sans-serif;\n\tfont-weight: 600;\n\tfont-size: 36px;\n\tline-height: 128.57%;\n\ttext-decoration: none;\n\tletter-spacing: 0.2px;\n}\n\n.Avatar-module_wrapper__ab1D7 {\n\tposition: relative;\n\tmin-height: var(--avatar-size);\n\tmin-width: var(--avatar-size);\n\tmax-height: var(--avatar-size);\n\tmax-width: var(--avatar-size);\n\theight: var(--avatar-size);\n\twidth: var(--avatar-size);\n\tborder: var(--avatar-outer-border-size) solid var(--avatar-outer-border-color);\n\tborder-radius: 100%;\n\toutline: 0;\n}\n\n.Avatar-module_user__ZQv0Q {\n\tfont-size: var(--avatar-font-size) !important;\n\theight: 100%;\n\twidth: 100%;\n\tline-height: 1em;\n\ttext-transform: uppercase;\n\tborder-radius: 100%;\n\tborder: var(--avatar-border) solid var(--avatar-border-color);\n\tbackground-color: var(--avatar-bg-color);\n\tcolor: var(--avatar-color);\n\tbackground-image: var(--avatar-bg-image);\n\tbackground-size: cover;\n\tcursor: pointer;\n\tuser-select: none;\n\t-webkit-user-select: none;\n\ttransition: border-color var(--motion-water-duration) var(--motion-water) 0s;\n\t&:hover {\n\t\tborder-color: var(--avatar-border-color-hover);\n\t}\n}\n");
|
|
7
|
-
|
|
8
|
-
const Avatar = React.memo(props => {
|
|
9
|
-
var _a;
|
|
10
|
-
const {email: email, name: name, image: image = "", textColor: textColor, borderWidth: borderWidth, borderSize: borderSize = 0, color: color, borderColor: borderColor, borderColorHover: borderColorHover, outerBorderSize: outerBorderSize, outerBorderColor: outerBorderColor, backgroundColor: backgroundColor, bgColor: bgColor, onClick: onClick, onKeyDown: onKeyDown, fontSize: fontSize, onToolTip: onToolTip = () => null, size: size = 34, frame: frame = 34, tabIndex: tabIndex = 0} = props, divAttributes = tslib_es6.__rest(props, [ "email", "name", "image", "textColor", "borderWidth", "borderSize", "color", "borderColor", "borderColorHover", "outerBorderSize", "outerBorderColor", "backgroundColor", "bgColor", "onClick", "onKeyDown", "fontSize", "onToolTip", "size", "frame", "tabIndex" ]), {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), [textSize, setTextSize] = React.useState("inherit"), resolvedTextColor = null != textColor ? textColor : color, resolvedBorderWidth = null != borderWidth ? borderWidth : borderSize, resolvedBackgroundColor = null != backgroundColor ? backgroundColor : bgColor, initials = React.useMemo(() => {
|
|
11
|
-
if (!name && !email) return "";
|
|
12
|
-
if (name) {
|
|
13
|
-
let last;
|
|
14
|
-
const parts = name.trim().split(" "), first = parts[0];
|
|
15
|
-
return parts.length > 1 && (last = parts.at(-1)), `${first.charAt(0)}${last ? last.charAt(0) : ""}`;
|
|
16
|
-
}
|
|
17
|
-
return email ? email.charAt(0) : void 0;
|
|
18
|
-
}, [ name, email ]), bgImage = React.useMemo(() => image ? `url(${image})` : "", [ image ]);
|
|
19
|
-
React.useEffect(() => {
|
|
20
|
-
var _a;
|
|
21
|
-
if (void 0 !== fontSize) {
|
|
22
|
-
if ("auto" === fontSize || "number" == typeof fontSize && fontSize <= 1) {
|
|
23
|
-
const parentHeight = null === (_a = ref.current) || void 0 === _a ? void 0 : _a.offsetHeight;
|
|
24
|
-
if (!parentHeight) return void setTextSize("inherit");
|
|
25
|
-
let size = .5;
|
|
26
|
-
"number" == typeof fontSize && (size = fontSize);
|
|
27
|
-
const fSize = Math.round(parentHeight * size);
|
|
28
|
-
return void setTextSize(fSize);
|
|
29
|
-
}
|
|
30
|
-
if ("string" == typeof fontSize && fontSize.includes("%")) {
|
|
31
|
-
const normalized = misc.normalizedPercent(fontSize);
|
|
32
|
-
return void setTextSize(normalized);
|
|
33
|
-
}
|
|
34
|
-
setTextSize(fontSize);
|
|
35
|
-
} else setTextSize("inherit");
|
|
36
|
-
}, [ fontSize ]);
|
|
37
|
-
const displayContent = React.useMemo(() => image ? null : initials, [ image, initials ]), onMouseEnter = React.useCallback(event => {
|
|
38
|
-
var _a;
|
|
39
|
-
const payload = {
|
|
40
|
-
label: null !== (_a = null != name ? name : email) && void 0 !== _a ? _a : ""
|
|
41
|
-
};
|
|
42
|
-
onToolTip({
|
|
43
|
-
payload: payload,
|
|
44
|
-
event: event
|
|
45
|
-
});
|
|
46
|
-
}, [ name, email, onToolTip ]), onMouseLeave = React.useCallback(() => {
|
|
47
|
-
onToolTip(null);
|
|
48
|
-
}, [ onToolTip ]), handleKeyDown = React.useCallback(event => {
|
|
49
|
-
null == onKeyDown || onKeyDown(event), onClick && !event.defaultPrevented && misc.accessibleKeyDown(event, () => onClick(event));
|
|
50
|
-
}, [ onClick, onKeyDown ]), avatarVars = React.useMemo(() => ({
|
|
51
|
-
"--avatar-size": misc.setStyle(size),
|
|
52
|
-
"--avatar-frame": misc.setStyle(frame),
|
|
53
|
-
"--avatar-border": `${resolvedBorderWidth}px`,
|
|
54
|
-
"--avatar-color": null != resolvedTextColor ? resolvedTextColor : "var(--core-text-primary)",
|
|
55
|
-
"--avatar-bg-color": null != resolvedBackgroundColor ? resolvedBackgroundColor : "var(--core-surface-secondary)",
|
|
56
|
-
"--avatar-border-color": null != borderColor ? borderColor : "var(--core-outline-primary)",
|
|
57
|
-
"--avatar-border-color-hover": null != borderColorHover ? borderColorHover : "var(--core-outline-special)",
|
|
58
|
-
"--avatar-bg-image": `${bgImage}`,
|
|
59
|
-
"--avatar-font-size": misc.setStyle(textSize),
|
|
60
|
-
"--avatar-outer-border-size": misc.setStyle(outerBorderSize),
|
|
61
|
-
"--avatar-outer-border-color": null != outerBorderColor ? outerBorderColor : "var(--core-surface-primary)"
|
|
62
|
-
}), [ size, frame, resolvedBorderWidth, resolvedTextColor, resolvedBackgroundColor, borderColor, borderColorHover, bgImage, textSize, outerBorderSize, outerBorderColor ]), classNames = React.useMemo(() => `${css_wrapper}${divClass}`, [ divClass ]);
|
|
63
|
-
return jsxRuntime.jsx("div", Object.assign({
|
|
64
|
-
id: divId,
|
|
65
|
-
className: classNames,
|
|
66
|
-
style: Object.assign(Object.assign({}, divStyle), avatarVars),
|
|
67
|
-
onMouseEnter: onMouseEnter,
|
|
68
|
-
onMouseLeave: onMouseLeave,
|
|
69
|
-
onClick: onClick,
|
|
70
|
-
onKeyDown: handleKeyDown,
|
|
71
|
-
role: onClick ? "button" : "img",
|
|
72
|
-
tabIndex: onClick ? tabIndex : void 0,
|
|
73
|
-
"aria-label": `User Avatar - ${null !== (_a = null != name ? name : email) && void 0 !== _a ? _a : "Unknown User"}`
|
|
74
|
-
}, rest, {
|
|
75
|
-
children: jsxRuntime.jsx("div", {
|
|
76
|
-
ref: ref,
|
|
77
|
-
"aria-hidden": !0,
|
|
78
|
-
className: css_user,
|
|
79
|
-
children: displayContent
|
|
80
|
-
})
|
|
81
|
-
}));
|
|
82
|
-
});
|
|
83
|
-
|
|
84
|
-
exports.Avatar = Avatar;
|