@apple-pie/slice 0.1.28 → 0.1.30
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 +164 -3
- package/dist/cjs/chunks/{Avatar-Dg8ZHnw6.js → Avatar-CqUSRzVd.js} +1 -1
- package/dist/cjs/chunks/{AvatarGroup-F8eSiMwn.js → AvatarGroup-DhGp_qLw.js} +1 -1
- package/dist/cjs/chunks/{Button-Dic9Rfkr.js → Button-PsJx1WmV.js} +1 -1
- package/dist/cjs/chunks/{ButtonBar-C7tJ6pDM.js → ButtonBar-8zm6a_h7.js} +1 -1
- package/dist/cjs/chunks/{Camera-DfnOBHeI.js → Camera-zFyIXcge.js} +2 -2
- package/dist/cjs/chunks/{CheckBox-Cxzt7DJo.js → CheckBox-Cbh6UK-7.js} +1 -1
- package/dist/cjs/chunks/{Chip-DKbhpeho.js → Chip-DcS8dtW2.js} +1 -1
- package/dist/cjs/chunks/{DivInput-DWPwVUs_.js → DivInput-2cMdJQ9U.js} +1 -1
- package/dist/cjs/chunks/{DrggablePanel-DuOxkekq.js → DrggablePanel-P7TgBI3j.js} +4 -4
- package/dist/cjs/chunks/{DropDown-BcRH7Fle.js → DropDown-B0970yVe.js} +11 -10
- package/dist/cjs/chunks/{FileIcon-DgRlhqzv.js → FileIcon-PuDoz0mF.js} +1 -1
- package/dist/cjs/chunks/{FileList-S0Hf82-C.js → FileList-sDq1jK0b.js} +1 -1
- package/dist/cjs/chunks/{FlexDiv-BPnptnPL.js → FlexDiv-D4aSJC_G.js} +1 -1
- package/dist/cjs/chunks/{Grouper-CgkPu4sa.js → Grouper-Ccd-x_Nb.js} +1 -1
- package/dist/cjs/chunks/{Icon-UFrKtcYJ.js → Icon-BtcHXeqE.js} +84 -2
- package/dist/cjs/chunks/{IconButton-CaQ0SioJ.js → IconButton-CF4cR7Tr.js} +2 -2
- package/dist/cjs/chunks/{Label-Bxp2pCXf.js → Label-htjXHiQ4.js} +1 -1
- package/dist/cjs/chunks/{MdStreamBuffer-DObxjnAm.js → MdStreamBuffer-CvLO7CVi.js} +37 -3
- package/dist/cjs/chunks/Modal-C0Z59meI.js +101 -0
- package/dist/cjs/chunks/ModalController-13xmvKnm.js +70 -0
- package/dist/cjs/chunks/{Overlay-DDOvMM6L.js → Overlay-GXu6nMnw.js} +9 -3
- package/dist/cjs/chunks/{Pager-DO197OyC.js → Pager-D2_fshTy.js} +1 -1
- package/dist/cjs/chunks/{ProgressIndicator-n9CfW6jd.js → ProgressIndicator-D06PqCQk.js} +55 -51
- package/dist/cjs/chunks/{PromptInput-CI0iSYKL.js → PromptInput-DuE4vGxR.js} +1 -1
- package/dist/cjs/chunks/{RadioButton-JBNaNihZ.js → RadioButton-DPB2ZGVf.js} +1 -1
- package/dist/cjs/chunks/{RadioButtonList-CW2pDNIq.js → RadioButtonList-N7Fmvr5W.js} +1 -1
- package/dist/cjs/chunks/{Slider-BAcaZUs2.js → Slider-BSy8xciG.js} +26 -31
- package/dist/cjs/chunks/{TabBar-Bpngr90Q.js → TabBar-BtFfMwiB.js} +10 -7
- package/dist/cjs/chunks/{TextArea-BZgwajEC.js → TextArea-CRiPRF8v.js} +1 -1
- package/dist/cjs/chunks/{TextField-x1MWESCA.js → TextField-Bh2EA082.js} +2 -2
- package/dist/cjs/chunks/{Tip-BZQhRyng.js → Tip-C5keUoHx.js} +1 -1
- package/dist/cjs/chunks/{Toast-cda-RInJ.js → Toast-CyiFOsI3.js} +19 -9
- package/dist/cjs/chunks/{ToggleButton-CuX1nQk4.js → ToggleButton-D5_WnW0o.js} +2 -2
- package/dist/cjs/chunks/{UploadArea-CiiKnWe7.js → UploadArea-KqES_OLl.js} +1 -1
- package/dist/cjs/chunks/{_types-Cqkxw-yc.js → _types-Bdqd2vHh.js} +6 -2
- package/dist/cjs/chunks/{microphoneStore-CgFohRfy.js → microphoneStore-D1fV_8QQ.js} +21 -4
- package/dist/cjs/chunks/{misc-BTF7BCZW.js → misc-QpU0XEOW.js} +17 -20
- package/dist/cjs/chunks/modalStore-7VjHHM8X.js +70 -0
- package/dist/cjs/chunks/{uploads-worker-mD8pcsGP.js → uploads-worker-Az040BSN.js} +1 -1
- package/dist/cjs/chunks/{uploadsStore-CxWIctvI.js → uploadsStore-8mOTz0Qe.js} +2 -2
- package/dist/cjs/chunks/volumeStore-Pv23v12t.js +95 -0
- package/dist/cjs/components/Avatar/index.js +2 -2
- package/dist/cjs/components/AvatarGroup/index.js +2 -2
- package/dist/cjs/components/Button/index.js +4 -4
- package/dist/cjs/components/ButtonBar/index.js +2 -2
- package/dist/cjs/components/Camera/index.js +4 -4
- package/dist/cjs/components/CheckBox/index.js +2 -2
- package/dist/cjs/components/Chip/index.js +2 -2
- package/dist/cjs/components/DivInput/index.js +2 -2
- package/dist/cjs/components/DraggablePanel/index.js +2 -2
- package/dist/cjs/components/DropDown/index.js +2 -2
- package/dist/cjs/components/FileIcon/index.js +2 -2
- package/dist/cjs/components/FileList/index.js +3 -3
- package/dist/cjs/components/FlexDiv/index.js +1 -1
- package/dist/cjs/components/Grouper/index.js +2 -2
- package/dist/cjs/components/Icon/index.js +2 -2
- package/dist/cjs/components/IconButton/index.js +3 -3
- package/dist/cjs/components/Label/index.js +2 -2
- package/dist/cjs/components/Modal/index.js +14 -0
- package/dist/cjs/components/ModalController/index.js +7 -0
- package/dist/cjs/components/Overlay/index.js +1 -1
- package/dist/cjs/components/Pager/index.js +2 -2
- package/dist/cjs/components/Progress/index.js +2 -2
- package/dist/cjs/components/PromptInput/index.js +5 -5
- package/dist/cjs/components/RadioButton/index.js +2 -2
- package/dist/cjs/components/RadioButtonList/index.js +3 -3
- package/dist/cjs/components/Slider/index.js +2 -2
- package/dist/cjs/components/TabBar/index.js +3 -3
- package/dist/cjs/components/TextArea/index.js +5 -5
- package/dist/cjs/components/Textfield/index.js +4 -4
- package/dist/cjs/components/Tip/index.js +2 -2
- package/dist/cjs/components/Toast/index.js +4 -3
- package/dist/cjs/components/ToggleButton/index.js +5 -5
- package/dist/cjs/components/UploadArea/index.js +10 -10
- package/dist/cjs/hooks/useAudioRecorder.js +3 -4
- package/dist/cjs/hooks/useLocalStore.js +3 -9
- package/dist/cjs/hooks/useMdStreamBuffer.js +1 -1
- package/dist/cjs/hooks/useMicrophone.js +64 -24
- package/dist/cjs/hooks/useTrackRenders.js +1 -1
- package/dist/cjs/hooks.js +1 -1
- package/dist/cjs/index.js +7 -5
- package/dist/cjs/providers/ThemeProvider.js +2 -2
- package/dist/cjs/stores/microphone.js +5 -3
- package/dist/cjs/stores/modal.js +7 -0
- package/dist/cjs/stores/uploads.js +2 -2
- package/dist/cjs/stores/volume.js +10 -0
- package/dist/cjs/stores.js +30 -20
- package/dist/cjs/theme/colors.js +7 -1
- package/dist/cjs/utils/index.js +1 -1
- package/dist/cjs/utils/objects/index.js +1 -1
- package/dist/cjs/workers/uploads/uploads.js +1 -1
- package/dist/esm/chunks/{Avatar-m5-zleDk.mjs → Avatar-29zhNfxX.mjs} +1 -1
- package/dist/esm/chunks/{AvatarGroup-DlgP4lTS.mjs → AvatarGroup-C7YRtPmJ.mjs} +1 -1
- package/dist/esm/chunks/{Button-BIbAGVV8.mjs → Button-BQS3rwrS.mjs} +2 -2
- package/dist/esm/chunks/{ButtonBar-B-1YFX9u.mjs → ButtonBar-GLNRjmjv.mjs} +2 -2
- package/dist/esm/chunks/{Camera-BQBo2g52.mjs → Camera-CAp0Y2gN.mjs} +3 -3
- package/dist/esm/chunks/{CheckBox-DDwE1wkX.mjs → CheckBox-7TiT2U47.mjs} +2 -2
- package/dist/esm/chunks/{Chip-BuHc883v.mjs → Chip-CKsojimU.mjs} +2 -2
- package/dist/esm/chunks/{DivInput-WJltaCra.mjs → DivInput-g6F1YWTo.mjs} +1 -1
- package/dist/esm/chunks/{DrggablePanel-Dc6lqqfO.mjs → DrggablePanel-C0AmJy8g.mjs} +4 -4
- package/dist/esm/chunks/{DropDown-CdkEVTRk.mjs → DropDown-mwo8fY7p.mjs} +12 -11
- package/dist/esm/chunks/{FileIcon-Cufsp1gn.mjs → FileIcon-BQ2zZIW5.mjs} +1 -1
- package/dist/esm/chunks/{FileList-DN4Ubroe.mjs → FileList-fh-x9Dzm.mjs} +4 -4
- package/dist/esm/chunks/{FlexDiv-BWZ7f8mA.mjs → FlexDiv-DnY1_qk4.mjs} +1 -1
- package/dist/esm/chunks/{Grouper-C4A3qYot.mjs → Grouper-naJMvpB9.mjs} +1 -1
- package/dist/esm/chunks/{Icon-DRzjkybv.mjs → Icon--RjjODc9.mjs} +85 -3
- package/dist/esm/chunks/{IconButton-b1v9Me0P.mjs → IconButton-ByBYppAj.mjs} +2 -2
- package/dist/esm/chunks/{Label-CvCDAg1y.mjs → Label-C04tD7UZ.mjs} +1 -1
- package/dist/esm/chunks/{MdStreamBuffer-DNXE4XbN.mjs → MdStreamBuffer-By7pHJQL.mjs} +37 -3
- package/dist/esm/chunks/Modal-B9ad9OfJ.mjs +115 -0
- package/dist/esm/chunks/ModalController-BO5FkAqu.mjs +80 -0
- package/dist/esm/chunks/{Overlay-DiSvgIQP.mjs → Overlay-sXM7cEYc.mjs} +9 -3
- package/dist/esm/chunks/{Pager-BoDLaKFh.mjs → Pager-Bz0FpgO5.mjs} +1 -1
- package/dist/esm/chunks/{ProgressIndicator-D5e7406q.mjs → ProgressIndicator-B5oByN3i.mjs} +56 -52
- package/dist/esm/chunks/{PromptInput-Dmx4sQZ3.mjs → PromptInput-Cwd53ux7.mjs} +3 -3
- package/dist/esm/chunks/{RadioButton-D2T-SsVw.mjs → RadioButton-CLeRiZ8x.mjs} +2 -2
- package/dist/esm/chunks/{RadioButtonList-BSPuAYoh.mjs → RadioButtonList-C_heuiis.mjs} +2 -2
- package/dist/esm/chunks/{Slider-Cav86rU6.mjs → Slider-XEV0D2Rd.mjs} +26 -31
- package/dist/esm/chunks/{TabBar-DBoZ8aoV.mjs → TabBar-kPZ6ZJxr.mjs} +11 -8
- package/dist/esm/chunks/{TextArea-CSUDfcYd.mjs → TextArea-CxscPLwN.mjs} +1 -1
- package/dist/esm/chunks/{TextField-Z1O858hB.mjs → TextField-DwVKlLI_.mjs} +4 -4
- package/dist/esm/chunks/{Tip-B8YrmJEt.mjs → Tip-C6EcX7_M.mjs} +1 -1
- package/dist/esm/chunks/{Toast-QQ6GMr5F.mjs → Toast-D4uMNvaa.mjs} +21 -9
- package/dist/esm/chunks/{ToggleButton-B5oobnXJ.mjs → ToggleButton-C0QIflzX.mjs} +3 -3
- package/dist/esm/chunks/{UploadArea-CJAQmqOS.mjs → UploadArea-je-1NhGb.mjs} +5 -5
- package/dist/esm/chunks/{_types-fSW-DudT.mjs → _types-BVrr_Khp.mjs} +6 -2
- package/dist/esm/chunks/{microphoneStore-t16oxjGB.mjs → microphoneStore-Dr3lxoWX.mjs} +19 -5
- package/dist/esm/chunks/{misc-BeEWwOaJ.mjs → misc-wS74txaa.mjs} +17 -20
- package/dist/esm/chunks/modalStore-BpWnLtOF.mjs +68 -0
- package/dist/esm/chunks/{uploads-worker-7X9EwX9N.mjs → uploads-worker-CYp-F4dz.mjs} +1 -1
- package/dist/esm/chunks/{uploadsStore-B7VECR5Q.mjs → uploadsStore-DeRMJ5c9.mjs} +1 -1
- package/dist/esm/chunks/volumeStore-BX7QcrL-.mjs +90 -0
- package/dist/esm/components/Avatar/index.mjs +2 -2
- package/dist/esm/components/AvatarGroup/index.mjs +3 -3
- package/dist/esm/components/Button/index.mjs +4 -4
- package/dist/esm/components/ButtonBar/index.mjs +3 -3
- package/dist/esm/components/Camera/index.mjs +4 -4
- package/dist/esm/components/CheckBox/index.mjs +3 -3
- package/dist/esm/components/Chip/index.mjs +3 -3
- package/dist/esm/components/DivInput/index.mjs +2 -2
- package/dist/esm/components/DraggablePanel/index.mjs +2 -2
- package/dist/esm/components/DropDown/index.mjs +3 -3
- package/dist/esm/components/FileIcon/index.mjs +2 -2
- package/dist/esm/components/FileList/index.mjs +5 -5
- package/dist/esm/components/FlexDiv/index.mjs +1 -1
- package/dist/esm/components/Grouper/index.mjs +3 -3
- package/dist/esm/components/Icon/index.mjs +3 -3
- package/dist/esm/components/IconButton/index.mjs +3 -3
- package/dist/esm/components/Label/index.mjs +2 -2
- package/dist/esm/components/Modal/index.mjs +47 -0
- package/dist/esm/components/ModalController/index.mjs +17 -0
- package/dist/esm/components/Overlay/index.mjs +1 -1
- package/dist/esm/components/Pager/index.mjs +2 -2
- package/dist/esm/components/Progress/index.mjs +3 -3
- package/dist/esm/components/PromptInput/index.mjs +7 -7
- package/dist/esm/components/RadioButton/index.mjs +3 -3
- package/dist/esm/components/RadioButtonList/index.mjs +4 -4
- package/dist/esm/components/Slider/index.mjs +2 -2
- package/dist/esm/components/TabBar/index.mjs +4 -4
- package/dist/esm/components/TextArea/index.mjs +5 -5
- package/dist/esm/components/Textfield/index.mjs +6 -6
- package/dist/esm/components/Tip/index.mjs +2 -2
- package/dist/esm/components/Toast/index.mjs +5 -3
- package/dist/esm/components/ToggleButton/index.mjs +5 -5
- package/dist/esm/components/UploadArea/index.mjs +8 -8
- package/dist/esm/hooks/useAudioRecorder.mjs +3 -4
- package/dist/esm/hooks/useLocalStore.mjs +3 -9
- package/dist/esm/hooks/useMdStreamBuffer.mjs +1 -1
- package/dist/esm/hooks/useMicrophone.mjs +64 -24
- package/dist/esm/hooks/useTrackRenders.mjs +1 -1
- package/dist/esm/hooks.mjs +1 -1
- package/dist/esm/index.mjs +42 -34
- package/dist/esm/providers/ThemeProvider.mjs +2 -2
- package/dist/esm/stores/microphone.mjs +1 -1
- package/dist/esm/stores/modal.mjs +3 -0
- package/dist/esm/stores/uploads.mjs +2 -2
- package/dist/esm/stores/volume.mjs +5 -0
- package/dist/esm/stores.mjs +7 -3
- package/dist/esm/theme/colors.mjs +7 -1
- package/dist/esm/utils/index.mjs +2 -2
- package/dist/esm/utils/objects/index.mjs +1 -1
- package/dist/esm/workers/uploads/uploads.mjs +1 -1
- package/dist/types/components/DropDown/_types.d.ts +1 -0
- package/dist/types/components/Icon/_types.d.ts +4 -0
- package/dist/types/components/Modal/Modal.d.ts +3 -0
- package/dist/types/components/Modal/_types.d.ts +45 -0
- package/dist/types/components/Modal/index.d.ts +2 -0
- package/dist/types/components/ModalController/ModalController.d.ts +2 -0
- package/dist/types/components/ModalController/_types.d.ts +13 -0
- package/dist/types/components/ModalController/index.d.ts +2 -0
- package/dist/types/components/Overlay/_types.d.ts +4 -0
- package/dist/types/components/Progress/ProgressIndicator/ProgressIndicator.d.ts +1 -1
- package/dist/types/components/Progress/ProgressIndicator/_types.d.ts +2 -1
- package/dist/types/components/Slider/_types.d.ts +5 -0
- package/dist/types/components/TabBar/_types.d.ts +2 -0
- package/dist/types/components/Toast/_types.d.ts +3 -0
- package/dist/types/hooks/useMicrophone/useMicrophone.d.ts +4 -0
- package/dist/types/index.d.ts +4 -0
- package/dist/types/stores/index.d.ts +2 -0
- package/dist/types/stores/microphone/_types.d.ts +4 -0
- package/dist/types/stores/microphone/index.d.ts +1 -1
- package/dist/types/stores/microphone/microphoneStore.d.ts +3 -0
- package/dist/types/stores/modal/_types.d.ts +27 -0
- package/dist/types/stores/modal/index.d.ts +2 -0
- package/dist/types/stores/modal/modalStore.d.ts +20 -0
- package/dist/types/stores/toast/_types.d.ts +3 -1
- package/dist/types/stores/volume/_types.d.ts +19 -0
- package/dist/types/stores/volume/index.d.ts +3 -0
- package/dist/types/stores/volume/volumeStore.d.ts +32 -0
- package/dist/types/theme/colors/types.d.ts +3 -0
- package/dist/types/utils/functions/misc.d.ts +1 -1
- package/dist/types/utils/objects/MDStreamBuffer/MdStreamBuffer.d.ts +3 -0
- package/dist/types/utils/objects/MDStreamBuffer/_types.d.ts +1 -0
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { L as Label, a as LabelBackground } from "../../chunks/Label-
|
|
1
|
+
export { L as Label, a as LabelBackground } from "../../chunks/Label-C04tD7UZ.mjs";
|
|
2
2
|
|
|
3
3
|
import "../../chunks/tslib.es6-C-olHjXV.mjs";
|
|
4
4
|
|
|
@@ -6,6 +6,6 @@ import "react/jsx-runtime";
|
|
|
6
6
|
|
|
7
7
|
import "react";
|
|
8
8
|
|
|
9
|
-
import "../../chunks/misc-
|
|
9
|
+
import "../../chunks/misc-wS74txaa.mjs";
|
|
10
10
|
|
|
11
11
|
import "../../chunks/style-inject.es-D0BjEaN8.mjs";
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
export { M as Modal } from "../../chunks/Modal-B9ad9OfJ.mjs";
|
|
2
|
+
|
|
3
|
+
import "../../chunks/tslib.es6-C-olHjXV.mjs";
|
|
4
|
+
|
|
5
|
+
import "react/jsx-runtime";
|
|
6
|
+
|
|
7
|
+
import "react";
|
|
8
|
+
|
|
9
|
+
import "../../chunks/misc-wS74txaa.mjs";
|
|
10
|
+
|
|
11
|
+
import "../../chunks/Button-BQS3rwrS.mjs";
|
|
12
|
+
|
|
13
|
+
import "motion/react";
|
|
14
|
+
|
|
15
|
+
import "../../chunks/Badge-CC0zSLMf.mjs";
|
|
16
|
+
|
|
17
|
+
import "../../chunks/style-inject.es-D0BjEaN8.mjs";
|
|
18
|
+
|
|
19
|
+
import "../../chunks/Dot-DZE134mJ.mjs";
|
|
20
|
+
|
|
21
|
+
import "../../chunks/Icon--RjjODc9.mjs";
|
|
22
|
+
|
|
23
|
+
import "../../hooks/useTheme.mjs";
|
|
24
|
+
|
|
25
|
+
import "../../providers/ThemeProvider.mjs";
|
|
26
|
+
|
|
27
|
+
import "../../theme/themes.mjs";
|
|
28
|
+
|
|
29
|
+
import "../../theme/colors.mjs";
|
|
30
|
+
|
|
31
|
+
import "../../theme/corners.mjs";
|
|
32
|
+
|
|
33
|
+
import "../../theme/elevations.mjs";
|
|
34
|
+
|
|
35
|
+
import "../../theme/motion.mjs";
|
|
36
|
+
|
|
37
|
+
import "../../theme/type.mjs";
|
|
38
|
+
|
|
39
|
+
import "../../hooks/useObserveTheme.mjs";
|
|
40
|
+
|
|
41
|
+
import "../../hooks/useWindow.mjs";
|
|
42
|
+
|
|
43
|
+
import "../../chunks/ProgressIndicator-B5oByN3i.mjs";
|
|
44
|
+
|
|
45
|
+
import "../../chunks/sharedTypes-tn9-uJvb.mjs";
|
|
46
|
+
|
|
47
|
+
import "../../chunks/IconButton-ByBYppAj.mjs";
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export { M as ModalController } from "../../chunks/ModalController-BO5FkAqu.mjs";
|
|
2
|
+
|
|
3
|
+
import "react/jsx-runtime";
|
|
4
|
+
|
|
5
|
+
import "motion/react";
|
|
6
|
+
|
|
7
|
+
import "../../chunks/Overlay-sXM7cEYc.mjs";
|
|
8
|
+
|
|
9
|
+
import "../../chunks/tslib.es6-C-olHjXV.mjs";
|
|
10
|
+
|
|
11
|
+
import "react";
|
|
12
|
+
|
|
13
|
+
import "../../chunks/style-inject.es-D0BjEaN8.mjs";
|
|
14
|
+
|
|
15
|
+
import "../../chunks/modalStore-BpWnLtOF.mjs";
|
|
16
|
+
|
|
17
|
+
import "zustand";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { P as Pager } from "../../chunks/Pager-
|
|
1
|
+
export { P as Pager } from "../../chunks/Pager-Bz0FpgO5.mjs";
|
|
2
2
|
|
|
3
3
|
import "../../chunks/tslib.es6-C-olHjXV.mjs";
|
|
4
4
|
|
|
@@ -6,6 +6,6 @@ import "react/jsx-runtime";
|
|
|
6
6
|
|
|
7
7
|
import "react";
|
|
8
8
|
|
|
9
|
-
import "../../chunks/misc-
|
|
9
|
+
import "../../chunks/misc-wS74txaa.mjs";
|
|
10
10
|
|
|
11
11
|
import "../../chunks/style-inject.es-D0BjEaN8.mjs";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { D as DoneCheck, P as ProgressIndicator } from "../../chunks/ProgressIndicator-
|
|
1
|
+
export { D as DoneCheck, P as ProgressIndicator } from "../../chunks/ProgressIndicator-B5oByN3i.mjs";
|
|
2
2
|
|
|
3
3
|
import "react/jsx-runtime";
|
|
4
4
|
|
|
@@ -28,8 +28,8 @@ import "../../chunks/tslib.es6-C-olHjXV.mjs";
|
|
|
28
28
|
|
|
29
29
|
import "../../hooks/useWindow.mjs";
|
|
30
30
|
|
|
31
|
-
import "../../chunks/Icon
|
|
31
|
+
import "../../chunks/Icon--RjjODc9.mjs";
|
|
32
32
|
|
|
33
|
-
import "../../chunks/misc-
|
|
33
|
+
import "../../chunks/misc-wS74txaa.mjs";
|
|
34
34
|
|
|
35
35
|
import "motion/react";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { P as PromptInput } from "../../chunks/PromptInput-
|
|
1
|
+
export { P as PromptInput } from "../../chunks/PromptInput-Cwd53ux7.mjs";
|
|
2
2
|
|
|
3
3
|
import "react/jsx-runtime";
|
|
4
4
|
|
|
@@ -28,7 +28,7 @@ import "../../chunks/tslib.es6-C-olHjXV.mjs";
|
|
|
28
28
|
|
|
29
29
|
import "../../hooks/useWindow.mjs";
|
|
30
30
|
|
|
31
|
-
import "../../chunks/Button-
|
|
31
|
+
import "../../chunks/Button-BQS3rwrS.mjs";
|
|
32
32
|
|
|
33
33
|
import "motion/react";
|
|
34
34
|
|
|
@@ -36,14 +36,14 @@ import "../../chunks/Badge-CC0zSLMf.mjs";
|
|
|
36
36
|
|
|
37
37
|
import "../../chunks/Dot-DZE134mJ.mjs";
|
|
38
38
|
|
|
39
|
-
import "../../chunks/Icon
|
|
39
|
+
import "../../chunks/Icon--RjjODc9.mjs";
|
|
40
40
|
|
|
41
|
-
import "../../chunks/misc-
|
|
41
|
+
import "../../chunks/misc-wS74txaa.mjs";
|
|
42
42
|
|
|
43
|
-
import "../../chunks/ProgressIndicator-
|
|
43
|
+
import "../../chunks/ProgressIndicator-B5oByN3i.mjs";
|
|
44
44
|
|
|
45
45
|
import "../../chunks/sharedTypes-tn9-uJvb.mjs";
|
|
46
46
|
|
|
47
|
-
import "../../chunks/FileList-
|
|
47
|
+
import "../../chunks/FileList-fh-x9Dzm.mjs";
|
|
48
48
|
|
|
49
|
-
import "../../chunks/FileIcon-
|
|
49
|
+
import "../../chunks/FileIcon-BQ2zZIW5.mjs";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { R as RadioButton } from "../../chunks/RadioButton-
|
|
1
|
+
export { R as RadioButton } from "../../chunks/RadioButton-CLeRiZ8x.mjs";
|
|
2
2
|
|
|
3
3
|
import "../../chunks/tslib.es6-C-olHjXV.mjs";
|
|
4
4
|
|
|
@@ -6,9 +6,9 @@ import "react/jsx-runtime";
|
|
|
6
6
|
|
|
7
7
|
import "react";
|
|
8
8
|
|
|
9
|
-
import "../../chunks/misc-
|
|
9
|
+
import "../../chunks/misc-wS74txaa.mjs";
|
|
10
10
|
|
|
11
|
-
import "../../chunks/Icon
|
|
11
|
+
import "../../chunks/Icon--RjjODc9.mjs";
|
|
12
12
|
|
|
13
13
|
import "../../hooks/useTheme.mjs";
|
|
14
14
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { R as RadioButtonList } from "../../chunks/RadioButtonList-
|
|
1
|
+
export { R as RadioButtonList } from "../../chunks/RadioButtonList-C_heuiis.mjs";
|
|
2
2
|
|
|
3
3
|
import "../../chunks/tslib.es6-C-olHjXV.mjs";
|
|
4
4
|
|
|
@@ -6,11 +6,11 @@ import "react/jsx-runtime";
|
|
|
6
6
|
|
|
7
7
|
import "react";
|
|
8
8
|
|
|
9
|
-
import "../../chunks/misc-
|
|
9
|
+
import "../../chunks/misc-wS74txaa.mjs";
|
|
10
10
|
|
|
11
|
-
import "../../chunks/RadioButton-
|
|
11
|
+
import "../../chunks/RadioButton-CLeRiZ8x.mjs";
|
|
12
12
|
|
|
13
|
-
import "../../chunks/Icon
|
|
13
|
+
import "../../chunks/Icon--RjjODc9.mjs";
|
|
14
14
|
|
|
15
15
|
import "../../hooks/useTheme.mjs";
|
|
16
16
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { S as Slider } from "../../chunks/Slider-
|
|
1
|
+
export { S as Slider } from "../../chunks/Slider-XEV0D2Rd.mjs";
|
|
2
2
|
|
|
3
3
|
import "../../chunks/tslib.es6-C-olHjXV.mjs";
|
|
4
4
|
|
|
@@ -8,7 +8,7 @@ import "react";
|
|
|
8
8
|
|
|
9
9
|
import "../../hooks/useObserveResize.mjs";
|
|
10
10
|
|
|
11
|
-
import "../../chunks/misc-
|
|
11
|
+
import "../../chunks/misc-wS74txaa.mjs";
|
|
12
12
|
|
|
13
13
|
import "../../chunks/debounce-Bst1jxMS.mjs";
|
|
14
14
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { T as TabBar } from "../../chunks/TabBar-
|
|
1
|
+
export { T as TabBar } from "../../chunks/TabBar-kPZ6ZJxr.mjs";
|
|
2
2
|
|
|
3
3
|
import "../../chunks/tslib.es6-C-olHjXV.mjs";
|
|
4
4
|
|
|
@@ -30,11 +30,11 @@ import "../../hooks/useWindow.mjs";
|
|
|
30
30
|
|
|
31
31
|
import "../../chunks/Badge-CC0zSLMf.mjs";
|
|
32
32
|
|
|
33
|
-
import "../../chunks/Icon
|
|
33
|
+
import "../../chunks/Icon--RjjODc9.mjs";
|
|
34
34
|
|
|
35
|
-
import "../../chunks/misc-
|
|
35
|
+
import "../../chunks/misc-wS74txaa.mjs";
|
|
36
36
|
|
|
37
|
-
import "../../chunks/IconButton-
|
|
37
|
+
import "../../chunks/IconButton-ByBYppAj.mjs";
|
|
38
38
|
|
|
39
39
|
import "motion/react";
|
|
40
40
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { T as TextArea } from "../../chunks/TextArea-
|
|
1
|
+
export { T as TextArea } from "../../chunks/TextArea-CxscPLwN.mjs";
|
|
2
2
|
|
|
3
3
|
import "../../chunks/tslib.es6-C-olHjXV.mjs";
|
|
4
4
|
|
|
@@ -6,7 +6,7 @@ import "react/jsx-runtime";
|
|
|
6
6
|
|
|
7
7
|
import "react";
|
|
8
8
|
|
|
9
|
-
import "../../chunks/Button-
|
|
9
|
+
import "../../chunks/Button-BQS3rwrS.mjs";
|
|
10
10
|
|
|
11
11
|
import "motion/react";
|
|
12
12
|
|
|
@@ -16,7 +16,7 @@ import "../../chunks/style-inject.es-D0BjEaN8.mjs";
|
|
|
16
16
|
|
|
17
17
|
import "../../chunks/Dot-DZE134mJ.mjs";
|
|
18
18
|
|
|
19
|
-
import "../../chunks/Icon
|
|
19
|
+
import "../../chunks/Icon--RjjODc9.mjs";
|
|
20
20
|
|
|
21
21
|
import "../../hooks/useTheme.mjs";
|
|
22
22
|
|
|
@@ -36,10 +36,10 @@ import "../../theme/type.mjs";
|
|
|
36
36
|
|
|
37
37
|
import "../../hooks/useObserveTheme.mjs";
|
|
38
38
|
|
|
39
|
-
import "../../chunks/misc-
|
|
39
|
+
import "../../chunks/misc-wS74txaa.mjs";
|
|
40
40
|
|
|
41
41
|
import "../../hooks/useWindow.mjs";
|
|
42
42
|
|
|
43
|
-
import "../../chunks/ProgressIndicator-
|
|
43
|
+
import "../../chunks/ProgressIndicator-B5oByN3i.mjs";
|
|
44
44
|
|
|
45
45
|
import "../../chunks/sharedTypes-tn9-uJvb.mjs";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { T as TextField } from "../../chunks/TextField-
|
|
1
|
+
export { T as TextField } from "../../chunks/TextField-DwVKlLI_.mjs";
|
|
2
2
|
|
|
3
3
|
import "../../chunks/tslib.es6-C-olHjXV.mjs";
|
|
4
4
|
|
|
@@ -28,20 +28,20 @@ import "../../theme/type.mjs";
|
|
|
28
28
|
|
|
29
29
|
import "../../hooks/useObserveTheme.mjs";
|
|
30
30
|
|
|
31
|
-
import "../../chunks/misc-
|
|
31
|
+
import "../../chunks/misc-wS74txaa.mjs";
|
|
32
32
|
|
|
33
33
|
import "../../hooks/useWindow.mjs";
|
|
34
34
|
|
|
35
|
-
import "../../chunks/Button-
|
|
35
|
+
import "../../chunks/Button-BQS3rwrS.mjs";
|
|
36
36
|
|
|
37
37
|
import "../../chunks/Badge-CC0zSLMf.mjs";
|
|
38
38
|
|
|
39
39
|
import "../../chunks/Dot-DZE134mJ.mjs";
|
|
40
40
|
|
|
41
|
-
import "../../chunks/Icon
|
|
41
|
+
import "../../chunks/Icon--RjjODc9.mjs";
|
|
42
42
|
|
|
43
|
-
import "../../chunks/ProgressIndicator-
|
|
43
|
+
import "../../chunks/ProgressIndicator-B5oByN3i.mjs";
|
|
44
44
|
|
|
45
45
|
import "../../chunks/sharedTypes-tn9-uJvb.mjs";
|
|
46
46
|
|
|
47
|
-
import "../../chunks/IconButton-
|
|
47
|
+
import "../../chunks/IconButton-ByBYppAj.mjs";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { T as Tip } from "../../chunks/Tip-
|
|
1
|
+
export { T as Tip } from "../../chunks/Tip-C6EcX7_M.mjs";
|
|
2
2
|
|
|
3
3
|
import "../../chunks/tslib.es6-C-olHjXV.mjs";
|
|
4
4
|
|
|
@@ -8,6 +8,6 @@ import "motion/react";
|
|
|
8
8
|
|
|
9
9
|
import "react";
|
|
10
10
|
|
|
11
|
-
import "../../chunks/misc-
|
|
11
|
+
import "../../chunks/misc-wS74txaa.mjs";
|
|
12
12
|
|
|
13
13
|
import "../../chunks/style-inject.es-D0BjEaN8.mjs";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { T as Toast, a as ToastType } from "../../chunks/Toast-
|
|
1
|
+
export { T as Toast, a as ToastType } from "../../chunks/Toast-D4uMNvaa.mjs";
|
|
2
2
|
|
|
3
3
|
import "../../chunks/tslib.es6-C-olHjXV.mjs";
|
|
4
4
|
|
|
@@ -28,8 +28,10 @@ import "../../theme/type.mjs";
|
|
|
28
28
|
|
|
29
29
|
import "../../hooks/useObserveTheme.mjs";
|
|
30
30
|
|
|
31
|
-
import "../../chunks/misc-
|
|
31
|
+
import "../../chunks/misc-wS74txaa.mjs";
|
|
32
32
|
|
|
33
33
|
import "../../hooks/useWindow.mjs";
|
|
34
34
|
|
|
35
|
-
import "../../chunks/Icon
|
|
35
|
+
import "../../chunks/Icon--RjjODc9.mjs";
|
|
36
|
+
|
|
37
|
+
import "../../chunks/ProgressIndicator-B5oByN3i.mjs";
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
export { T as ToggleButton } from "../../chunks/ToggleButton-
|
|
1
|
+
export { T as ToggleButton } from "../../chunks/ToggleButton-C0QIflzX.mjs";
|
|
2
2
|
|
|
3
3
|
import "react/jsx-runtime";
|
|
4
4
|
|
|
5
5
|
import "react";
|
|
6
6
|
|
|
7
|
-
import "../../chunks/IconButton-
|
|
7
|
+
import "../../chunks/IconButton-ByBYppAj.mjs";
|
|
8
8
|
|
|
9
9
|
import "../../chunks/tslib.es6-C-olHjXV.mjs";
|
|
10
10
|
|
|
@@ -16,7 +16,7 @@ import "../../chunks/style-inject.es-D0BjEaN8.mjs";
|
|
|
16
16
|
|
|
17
17
|
import "../../chunks/Dot-DZE134mJ.mjs";
|
|
18
18
|
|
|
19
|
-
import "../../chunks/Icon
|
|
19
|
+
import "../../chunks/Icon--RjjODc9.mjs";
|
|
20
20
|
|
|
21
21
|
import "../../hooks/useTheme.mjs";
|
|
22
22
|
|
|
@@ -36,10 +36,10 @@ import "../../theme/type.mjs";
|
|
|
36
36
|
|
|
37
37
|
import "../../hooks/useObserveTheme.mjs";
|
|
38
38
|
|
|
39
|
-
import "../../chunks/misc-
|
|
39
|
+
import "../../chunks/misc-wS74txaa.mjs";
|
|
40
40
|
|
|
41
41
|
import "../../hooks/useWindow.mjs";
|
|
42
42
|
|
|
43
43
|
import "../../chunks/sharedTypes-tn9-uJvb.mjs";
|
|
44
44
|
|
|
45
|
-
import "../../chunks/Label-
|
|
45
|
+
import "../../chunks/Label-C04tD7UZ.mjs";
|
|
@@ -1,14 +1,16 @@
|
|
|
1
|
-
export { U as UploadArea, a as allTypes, b as audioTypes, d as documentTypes, i as imageTypes, t as textTypes, v as videoTypes } from "../../chunks/UploadArea-
|
|
1
|
+
export { U as UploadArea, a as allTypes, b as audioTypes, d as documentTypes, i as imageTypes, t as textTypes, v as videoTypes } from "../../chunks/UploadArea-je-1NhGb.mjs";
|
|
2
2
|
|
|
3
3
|
import "react/jsx-runtime";
|
|
4
4
|
|
|
5
5
|
import "react";
|
|
6
6
|
|
|
7
|
-
import "../../chunks/misc-
|
|
7
|
+
import "../../chunks/misc-wS74txaa.mjs";
|
|
8
8
|
|
|
9
9
|
import "../../chunks/tslib.es6-C-olHjXV.mjs";
|
|
10
10
|
|
|
11
|
-
import "../../chunks/
|
|
11
|
+
import "../../chunks/FileList-fh-x9Dzm.mjs";
|
|
12
|
+
|
|
13
|
+
import "../../chunks/FileIcon-BQ2zZIW5.mjs";
|
|
12
14
|
|
|
13
15
|
import "../../hooks/useTheme.mjs";
|
|
14
16
|
|
|
@@ -32,10 +34,8 @@ import "../../hooks/useObserveTheme.mjs";
|
|
|
32
34
|
|
|
33
35
|
import "../../hooks/useWindow.mjs";
|
|
34
36
|
|
|
35
|
-
import "../../chunks/
|
|
36
|
-
|
|
37
|
-
import "motion/react";
|
|
37
|
+
import "../../chunks/Icon--RjjODc9.mjs";
|
|
38
38
|
|
|
39
|
-
import "../../chunks/
|
|
39
|
+
import "../../chunks/ProgressIndicator-B5oByN3i.mjs";
|
|
40
40
|
|
|
41
|
-
import "
|
|
41
|
+
import "motion/react";
|
|
@@ -43,8 +43,7 @@ import { useRef, useState, useCallback, useEffect } from "react";
|
|
|
43
43
|
stopResolveRef.current = null;
|
|
44
44
|
}, mediaRecorderRef.current = mediaRecorder, mediaRecorder.start(250), setIsRecording(!0);
|
|
45
45
|
} catch (error) {
|
|
46
|
-
|
|
47
|
-
setIsRecording(!1);
|
|
46
|
+
setError(error instanceof Error ? error : new Error("Unknown error")), setIsRecording(!1);
|
|
48
47
|
}
|
|
49
48
|
}, [ audioStream, resetRecording ]), stopRecording = useCallback(() => __awaiter(this, void 0, void 0, function*() {
|
|
50
49
|
try {
|
|
@@ -53,8 +52,8 @@ import { useRef, useState, useCallback, useEffect } from "react";
|
|
|
53
52
|
stopResolveRef.current = resolve, mediaRecorder.stop();
|
|
54
53
|
}) : (setIsRecording(!1), audioBlob.current);
|
|
55
54
|
} catch (error) {
|
|
56
|
-
return
|
|
57
|
-
|
|
55
|
+
return setError(error instanceof Error ? error : new Error("Unknown error")), setIsRecording(!1),
|
|
56
|
+
null;
|
|
58
57
|
}
|
|
59
58
|
}), []);
|
|
60
59
|
return useEffect(() => () => {
|
|
@@ -11,10 +11,8 @@ function readLocalStorageValue(key, fallback) {
|
|
|
11
11
|
const raw = globalThis.localStorage.getItem(key);
|
|
12
12
|
return null === raw ? (globalThis.localStorage.setItem(key, JSON.stringify(fallback)),
|
|
13
13
|
fallback) : JSON.parse(raw);
|
|
14
|
-
} catch (
|
|
15
|
-
return
|
|
16
|
-
error: error
|
|
17
|
-
}), fallback;
|
|
14
|
+
} catch (_a) {
|
|
15
|
+
return fallback;
|
|
18
16
|
}
|
|
19
17
|
}
|
|
20
18
|
|
|
@@ -25,11 +23,7 @@ function useLocalStore(key, value) {
|
|
|
25
23
|
}, [ key, value ]), [ item, function(data) {
|
|
26
24
|
if (canUseLocalStorage()) try {
|
|
27
25
|
globalThis.localStorage.setItem(key, JSON.stringify(data));
|
|
28
|
-
} catch (
|
|
29
|
-
console.error(`Error setting local storage item for key ${key}:`, {
|
|
30
|
-
error: error
|
|
31
|
-
});
|
|
32
|
-
}
|
|
26
|
+
} catch (_a) {}
|
|
33
27
|
setItem(data);
|
|
34
28
|
} ];
|
|
35
29
|
}
|
|
@@ -3,7 +3,7 @@ import { useRef, useState, useEffect, useCallback } from "react";
|
|
|
3
3
|
|
|
4
4
|
import "../chunks/tslib.es6-C-olHjXV.mjs";
|
|
5
5
|
|
|
6
|
-
import { M as MdBuffer } from "../chunks/MdStreamBuffer-
|
|
6
|
+
import { M as MdBuffer } from "../chunks/MdStreamBuffer-By7pHJQL.mjs";
|
|
7
7
|
|
|
8
8
|
function useMDStreamBuffer(options) {
|
|
9
9
|
const bufferRef = useRef(null), [healthy, setHealthy] = useState(""), [raw, setRaw] = useState(""), [isComplete, setIsComplete] = useState(!1);
|
|
@@ -4,7 +4,24 @@ import { _ as __awaiter } from "../chunks/tslib.es6-C-olHjXV.mjs";
|
|
|
4
4
|
import { useRef, useState, useCallback, useMemo, useEffect } from "react";
|
|
5
5
|
|
|
6
6
|
function useMicrophone(startMuted = !0, microphoneDeviceId, autoRequest = !0) {
|
|
7
|
-
const micStream = useRef(null), micTrack = useRef(null), mutedRef = useRef(startMuted), mountedRef = useRef(!0), initializedRef = useRef(!1), [microphones, setMicrophones] = useState([]), [micOptions, setMicOptions] = useState([]), [isActive, setIsActive] = useState(!1), [muted, setMuted] = useState(startMuted), [isRequesting, setIsRequesting] = useState(!1), [error, setError] = useState(null),
|
|
7
|
+
const micStream = useRef(null), processedMicStream = useRef(null), micTrack = useRef(null), audioContextRef = useRef(null), sourceNodeRef = useRef(null), gainNodeRef = useRef(null), destinationNodeRef = useRef(null), inputVolumeRef = useRef(1), mutedRef = useRef(startMuted), mountedRef = useRef(!0), initializedRef = useRef(!1), [microphones, setMicrophones] = useState([]), [micOptions, setMicOptions] = useState([]), [currentDeviceId, setCurrentDeviceId] = useState(null), [isActive, setIsActive] = useState(!1), [inputVolume, setInputVolumeState] = useState(1), [muted, setMuted] = useState(startMuted), [isRequesting, setIsRequesting] = useState(!1), [error, setError] = useState(null), normalizeInputVolume = useCallback(volume => Number.isFinite(volume) ? Math.min(1, Math.max(0, volume)) : 1, []), resetAudioProcessing = useCallback(() => {
|
|
8
|
+
var _a, _b, _c, _d;
|
|
9
|
+
null === (_a = sourceNodeRef.current) || void 0 === _a || _a.disconnect(), null === (_b = gainNodeRef.current) || void 0 === _b || _b.disconnect(),
|
|
10
|
+
null === (_c = destinationNodeRef.current) || void 0 === _c || _c.disconnect(),
|
|
11
|
+
null === (_d = audioContextRef.current) || void 0 === _d || _d.close().catch(() => null),
|
|
12
|
+
sourceNodeRef.current = null, gainNodeRef.current = null, destinationNodeRef.current = null,
|
|
13
|
+
audioContextRef.current = null, processedMicStream.current = null;
|
|
14
|
+
}, []), setupAudioProcessing = useCallback(stream => {
|
|
15
|
+
var _a;
|
|
16
|
+
resetAudioProcessing();
|
|
17
|
+
const AudioContextCtor = null !== (_a = globalThis.AudioContext) && void 0 !== _a ? _a : globalThis.webkitAudioContext;
|
|
18
|
+
if (!AudioContextCtor) return processedMicStream.current = stream, stream;
|
|
19
|
+
const context = new AudioContextCtor, source = context.createMediaStreamSource(stream), gain = context.createGain(), destination = context.createMediaStreamDestination();
|
|
20
|
+
return gain.gain.value = normalizeInputVolume(inputVolumeRef.current), source.connect(gain),
|
|
21
|
+
gain.connect(destination), audioContextRef.current = context, sourceNodeRef.current = source,
|
|
22
|
+
gainNodeRef.current = gain, destinationNodeRef.current = destination, processedMicStream.current = destination.stream,
|
|
23
|
+
destination.stream;
|
|
24
|
+
}, [ normalizeInputVolume, resetAudioProcessing ]), waitForPaint = useCallback(() => __awaiter(this, void 0, void 0, function*() {
|
|
8
25
|
yield new Promise(resolve => {
|
|
9
26
|
requestAnimationFrame(() => resolve());
|
|
10
27
|
});
|
|
@@ -19,10 +36,12 @@ function useMicrophone(startMuted = !0, microphoneDeviceId, autoRequest = !0) {
|
|
|
19
36
|
}));
|
|
20
37
|
}), []), stopMicStream = useCallback(() => {
|
|
21
38
|
var _a;
|
|
39
|
+
resetAudioProcessing();
|
|
22
40
|
const tracks = null === (_a = micStream.current) || void 0 === _a ? void 0 : _a.getTracks();
|
|
23
41
|
for (const track of null != tracks ? tracks : []) track.stop();
|
|
24
|
-
micStream.current = null, micTrack.current = null,
|
|
25
|
-
|
|
42
|
+
micStream.current = null, micTrack.current = null, processedMicStream.current = null,
|
|
43
|
+
setCurrentDeviceId(null), setIsActive(!1);
|
|
44
|
+
}, [ resetAudioProcessing ]), hasMediaSupport = useMemo(() => {
|
|
26
45
|
var _a;
|
|
27
46
|
return "undefined" != typeof navigator && Boolean(null === (_a = navigator.mediaDevices) || void 0 === _a ? void 0 : _a.getUserMedia);
|
|
28
47
|
}, []), getMicTrack = useCallback(() => {
|
|
@@ -32,7 +51,11 @@ function useMicrophone(startMuted = !0, microphoneDeviceId, autoRequest = !0) {
|
|
|
32
51
|
return audioTrack;
|
|
33
52
|
}, []), hasActiveStream = useCallback(() => !(!micStream.current || !micTrack.current) && "live" === micTrack.current.readyState, []), muteMic = useCallback(() => (getMicTrack().enabled = !1,
|
|
34
53
|
mutedRef.current = !0, setMuted(!0), !0), [ getMicTrack ]), unmuteMic = useCallback(() => (getMicTrack().enabled = !0,
|
|
35
|
-
mutedRef.current = !1, setMuted(!1), !0), [ getMicTrack ]),
|
|
54
|
+
mutedRef.current = !1, setMuted(!1), !0), [ getMicTrack ]), setInputVolume = useCallback(volume => {
|
|
55
|
+
const nextVolume = normalizeInputVolume(volume);
|
|
56
|
+
return inputVolumeRef.current = nextVolume, setInputVolumeState(nextVolume), gainNodeRef.current && (gainNodeRef.current.gain.value = nextVolume),
|
|
57
|
+
nextVolume;
|
|
58
|
+
}, [ normalizeInputVolume ]), constraints = useCallback((deviceId, usePreferredDevice = !0) => {
|
|
36
59
|
var _a;
|
|
37
60
|
const id = usePreferredDevice ? null !== (_a = null != deviceId ? deviceId : microphoneDeviceId) && void 0 !== _a ? _a : void 0 : deviceId;
|
|
38
61
|
return {
|
|
@@ -43,15 +66,16 @@ function useMicrophone(startMuted = !0, microphoneDeviceId, autoRequest = !0) {
|
|
|
43
66
|
}
|
|
44
67
|
};
|
|
45
68
|
}, [ microphoneDeviceId ]), requestStream = useCallback((deviceId_1, ...args_1) => __awaiter(this, [ deviceId_1, ...args_1 ], void 0, function*(deviceId, usePreferredDevice = !0) {
|
|
69
|
+
var _a;
|
|
46
70
|
return micStream.current = yield navigator.mediaDevices.getUserMedia(constraints(deviceId, usePreferredDevice)),
|
|
47
|
-
micTrack.current = getMicTrack(), micTrack.current.
|
|
48
|
-
mutedRef.current || (yield waitForTrackToBecomeActive(micTrack.current)),
|
|
49
|
-
micStream.current;
|
|
50
|
-
}), [ constraints, getMicTrack, waitForTrackToBecomeActive ]), requestMicrophone = useCallback(() => __awaiter(this, void 0, void 0, function*() {
|
|
71
|
+
setupAudioProcessing(micStream.current), micTrack.current = getMicTrack(), setCurrentDeviceId(null !== (_a = micTrack.current.getSettings().deviceId) && void 0 !== _a ? _a : null),
|
|
72
|
+
micTrack.current.enabled = !mutedRef.current, mutedRef.current || (yield waitForTrackToBecomeActive(micTrack.current)),
|
|
73
|
+
setIsActive(Boolean("live" === micTrack.current.readyState)), micStream.current;
|
|
74
|
+
}), [ constraints, getMicTrack, setupAudioProcessing, waitForTrackToBecomeActive ]), requestMicrophone = useCallback(() => __awaiter(this, void 0, void 0, function*() {
|
|
51
75
|
if (hasActiveStream()) return setIsActive(!0), setError(null), micStream.current;
|
|
52
76
|
if (setIsRequesting(!0), yield waitForPaint(), !hasMediaSupport) {
|
|
53
|
-
const nextError = new Error("Microphone access
|
|
54
|
-
return setError(nextError), setIsActive(!1), mountedRef.current && setIsRequesting(!1),
|
|
77
|
+
const nextError = new Error("Microphone access isn't supported");
|
|
78
|
+
return setError(nextError), setCurrentDeviceId(null), setIsActive(!1), mountedRef.current && setIsRequesting(!1),
|
|
55
79
|
null;
|
|
56
80
|
}
|
|
57
81
|
setError(null), stopMicStream();
|
|
@@ -59,26 +83,41 @@ function useMicrophone(startMuted = !0, microphoneDeviceId, autoRequest = !0) {
|
|
|
59
83
|
return yield requestStream();
|
|
60
84
|
} catch (error) {
|
|
61
85
|
if (!(error instanceof DOMException && "OverconstrainedError" === error.name || error instanceof DOMException && "NotFoundError" === error.name)) {
|
|
62
|
-
|
|
63
|
-
throw
|
|
86
|
+
let nextError = new Error("Failed to access microphone");
|
|
87
|
+
throw error instanceof Error && (error.message.toLowerCase().includes("denied permission") || "NotAllowedError" === error.name) && (nextError = new Error("Permission to access the microphone was denied")),
|
|
88
|
+
setError(nextError), setCurrentDeviceId(null), setIsActive(!1), nextError;
|
|
64
89
|
}
|
|
65
90
|
return yield requestStream(void 0, !1);
|
|
66
91
|
} finally {
|
|
67
92
|
setIsRequesting(!1);
|
|
68
93
|
}
|
|
69
94
|
}), [ hasActiveStream, hasMediaSupport, requestStream, stopMicStream, waitForPaint ]), refreshMicrophones = useCallback(() => __awaiter(this, void 0, void 0, function*() {
|
|
95
|
+
var _a;
|
|
70
96
|
if (!hasMediaSupport) return [];
|
|
71
97
|
try {
|
|
72
|
-
const devices = yield navigator.mediaDevices.enumerateDevices(),
|
|
98
|
+
const devices = yield navigator.mediaDevices.enumerateDevices(), currentDeviceId = null === (_a = micTrack.current) || void 0 === _a ? void 0 : _a.getSettings().deviceId, mics = function(devices, activeDeviceId) {
|
|
99
|
+
const microphones = [ ...devices ], defaultIndex = microphones.findIndex(device => "default" === device.deviceId);
|
|
100
|
+
if (defaultIndex > 0) {
|
|
101
|
+
const [defaultDevice] = microphones.splice(defaultIndex, 1);
|
|
102
|
+
return microphones.unshift(defaultDevice), microphones;
|
|
103
|
+
}
|
|
104
|
+
if (0 === defaultIndex) return microphones;
|
|
105
|
+
if (!activeDeviceId) return microphones;
|
|
106
|
+
const activeIndex = microphones.findIndex(device => device.deviceId === activeDeviceId);
|
|
107
|
+
if (activeIndex > 0) {
|
|
108
|
+
const [activeDevice] = microphones.splice(activeIndex, 1);
|
|
109
|
+
microphones.unshift(activeDevice);
|
|
110
|
+
}
|
|
111
|
+
return microphones;
|
|
112
|
+
}(devices.filter(device => "audioinput" === device.kind), currentDeviceId), options = mics.map(mic => ({
|
|
73
113
|
value: {
|
|
74
114
|
id: mic.deviceId
|
|
75
115
|
},
|
|
76
116
|
label: mic.label
|
|
77
117
|
}));
|
|
78
|
-
return setMicrophones(mics), setMicOptions(options),
|
|
79
|
-
} catch (
|
|
80
|
-
return
|
|
81
|
-
setMicOptions([]), [];
|
|
118
|
+
return setMicrophones(mics), setMicOptions(options), mics;
|
|
119
|
+
} catch (_b) {
|
|
120
|
+
return setMicrophones([]), setMicOptions([]), [];
|
|
82
121
|
}
|
|
83
122
|
}), [ hasMediaSupport ]), setMicrophone = useCallback(deviceId => __awaiter(this, void 0, void 0, function*() {
|
|
84
123
|
var _a;
|
|
@@ -87,25 +126,22 @@ function useMicrophone(startMuted = !0, microphoneDeviceId, autoRequest = !0) {
|
|
|
87
126
|
try {
|
|
88
127
|
setError(null), stopMicStream(), yield requestStream(id, !1);
|
|
89
128
|
} catch (err) {
|
|
90
|
-
setIsActive(!1), setError(err instanceof Error ? err : new Error("Error switching microphone"))
|
|
91
|
-
console.warn("Error switching microphone:", err);
|
|
129
|
+
setCurrentDeviceId(null), setIsActive(!1), setError(err instanceof Error ? err : new Error("Error switching microphone"));
|
|
92
130
|
} finally {
|
|
93
131
|
setIsRequesting(!1);
|
|
94
132
|
}
|
|
95
133
|
}), [ requestStream, stopMicStream, waitForPaint ]), toggleMute = useCallback(() => {
|
|
96
134
|
try {
|
|
97
135
|
muted ? unmuteMic() : muteMic();
|
|
98
|
-
} catch (
|
|
99
|
-
return
|
|
136
|
+
} catch (_a) {
|
|
137
|
+
return;
|
|
100
138
|
}
|
|
101
139
|
}, [ muted, unmuteMic, muteMic ]);
|
|
102
140
|
return useEffect(() => {
|
|
103
141
|
if (mountedRef.current = !0, hasMediaSupport && !initializedRef.current) return initializedRef.current = !0,
|
|
104
142
|
autoRequest ? (requestMicrophone().then(() => {
|
|
105
143
|
startMuted && muteMic();
|
|
106
|
-
}).catch(
|
|
107
|
-
console.error("Error accessing microphone:", err);
|
|
108
|
-
}), () => {
|
|
144
|
+
}).catch(() => null), () => {
|
|
109
145
|
mountedRef.current = !1, stopMicStream();
|
|
110
146
|
}) : (refreshMicrophones(), () => {
|
|
111
147
|
mountedRef.current = !1, stopMicStream();
|
|
@@ -130,8 +166,11 @@ function useMicrophone(startMuted = !0, microphoneDeviceId, autoRequest = !0) {
|
|
|
130
166
|
}, [ hasMediaSupport, microphoneDeviceId, refreshMicrophones, requestMicrophone ]),
|
|
131
167
|
{
|
|
132
168
|
micStream: micStream,
|
|
169
|
+
processedMicStream: processedMicStream,
|
|
133
170
|
micTrack: micTrack,
|
|
171
|
+
currentDeviceId: currentDeviceId,
|
|
134
172
|
isActive: isActive,
|
|
173
|
+
inputVolume: inputVolume,
|
|
135
174
|
muted: muted,
|
|
136
175
|
isSupported: hasMediaSupport,
|
|
137
176
|
isRequesting: isRequesting,
|
|
@@ -143,6 +182,7 @@ function useMicrophone(startMuted = !0, microphoneDeviceId, autoRequest = !0) {
|
|
|
143
182
|
muteMic: muteMic,
|
|
144
183
|
unmuteMic: unmuteMic,
|
|
145
184
|
toggleMute: toggleMute,
|
|
185
|
+
setInputVolume: setInputVolume,
|
|
146
186
|
refreshMicrophones: refreshMicrophones,
|
|
147
187
|
setMicrophone: setMicrophone
|
|
148
188
|
};
|