@magmamath/students-features 0.9.106 → 0.9.107-rc.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/commonjs/features/voiceRecord/components/VoiceRecord.js +81 -0
- package/dist/commonjs/features/voiceRecord/components/VoiceRecord.js.map +1 -0
- package/dist/commonjs/features/voiceRecord/components/VoiceRecordButton.js +72 -0
- package/dist/commonjs/features/voiceRecord/components/VoiceRecordButton.js.map +1 -0
- package/dist/commonjs/features/voiceRecord/components/VoiceRecordDeleteButton.js +32 -0
- package/dist/commonjs/features/voiceRecord/components/VoiceRecordDeleteButton.js.map +1 -0
- package/dist/commonjs/features/voiceRecord/components/VoiceRecordDevider.js +27 -0
- package/dist/commonjs/features/voiceRecord/components/VoiceRecordDevider.js.map +1 -0
- package/dist/commonjs/features/voiceRecord/components/VoiceRecordTimer.js +49 -0
- package/dist/commonjs/features/voiceRecord/components/VoiceRecordTimer.js.map +1 -0
- package/dist/commonjs/features/voiceRecord/constants.js +18 -0
- package/dist/commonjs/features/voiceRecord/constants.js.map +1 -0
- package/dist/commonjs/features/voiceRecord/helpers.js +138 -0
- package/dist/commonjs/features/voiceRecord/helpers.js.map +1 -0
- package/dist/commonjs/features/voiceRecord/hooks/useVoiceRecorder.js +75 -0
- package/dist/commonjs/features/voiceRecord/hooks/useVoiceRecorder.js.map +1 -0
- package/dist/commonjs/features/voiceRecord/hooks/useVoiceRecorderAnimation.js +22 -0
- package/dist/commonjs/features/voiceRecord/hooks/useVoiceRecorderAnimation.js.map +1 -0
- package/dist/commonjs/features/voiceRecord/index.js +72 -0
- package/dist/commonjs/features/voiceRecord/index.js.map +1 -0
- package/dist/commonjs/features/voiceRecord/modal/VoiceRecordDeleteModal.js +93 -0
- package/dist/commonjs/features/voiceRecord/modal/VoiceRecordDeleteModal.js.map +1 -0
- package/dist/commonjs/features/voiceRecord/modal/VoiceRecordUndoModal.js +75 -0
- package/dist/commonjs/features/voiceRecord/modal/VoiceRecordUndoModal.js.map +1 -0
- package/dist/commonjs/features/voiceRecord/model/Recorder.model.js +37 -0
- package/dist/commonjs/features/voiceRecord/model/Recorder.model.js.map +1 -0
- package/dist/commonjs/features/voiceRecord/model/VoiceRecord.model.js +151 -0
- package/dist/commonjs/features/voiceRecord/model/VoiceRecord.model.js.map +1 -0
- package/dist/commonjs/features/voiceRecord/model/VoiceRecordApi.js +29 -0
- package/dist/commonjs/features/voiceRecord/model/VoiceRecordApi.js.map +1 -0
- package/dist/commonjs/features/voiceRecord/model/VoiceRecordCollection.js +30 -0
- package/dist/commonjs/features/voiceRecord/model/VoiceRecordCollection.js.map +1 -0
- package/dist/commonjs/features/voiceRecord/types.js +6 -0
- package/dist/commonjs/features/voiceRecord/types.js.map +1 -0
- package/dist/commonjs/index.js +12 -0
- package/dist/commonjs/index.js.map +1 -1
- package/dist/commonjs/shared/translation/localization/ca.json +13 -0
- package/dist/commonjs/shared/translation/localization/de.json +13 -0
- package/dist/commonjs/shared/translation/localization/en.json +13 -0
- package/dist/commonjs/shared/translation/localization/gb.json +13 -0
- package/dist/commonjs/shared/translation/localization/sct.json +13 -0
- package/dist/commonjs/shared/translation/localization/sw.json +13 -0
- package/dist/module/features/voiceRecord/components/VoiceRecord.js +73 -0
- package/dist/module/features/voiceRecord/components/VoiceRecord.js.map +1 -0
- package/dist/module/features/voiceRecord/components/VoiceRecordButton.js +66 -0
- package/dist/module/features/voiceRecord/components/VoiceRecordButton.js.map +1 -0
- package/dist/module/features/voiceRecord/components/VoiceRecordDeleteButton.js +26 -0
- package/dist/module/features/voiceRecord/components/VoiceRecordDeleteButton.js.map +1 -0
- package/dist/module/features/voiceRecord/components/VoiceRecordDevider.js +21 -0
- package/dist/module/features/voiceRecord/components/VoiceRecordDevider.js.map +1 -0
- package/dist/module/features/voiceRecord/components/VoiceRecordTimer.js +43 -0
- package/dist/module/features/voiceRecord/components/VoiceRecordTimer.js.map +1 -0
- package/dist/module/features/voiceRecord/constants.js +14 -0
- package/dist/module/features/voiceRecord/constants.js.map +1 -0
- package/dist/module/features/voiceRecord/helpers.js +127 -0
- package/dist/module/features/voiceRecord/helpers.js.map +1 -0
- package/dist/module/features/voiceRecord/hooks/useVoiceRecorder.js +70 -0
- package/dist/module/features/voiceRecord/hooks/useVoiceRecorder.js.map +1 -0
- package/dist/module/features/voiceRecord/hooks/useVoiceRecorderAnimation.js +17 -0
- package/dist/module/features/voiceRecord/hooks/useVoiceRecorderAnimation.js.map +1 -0
- package/dist/module/features/voiceRecord/index.js +9 -0
- package/dist/module/features/voiceRecord/index.js.map +1 -0
- package/dist/module/features/voiceRecord/modal/VoiceRecordDeleteModal.js +86 -0
- package/dist/module/features/voiceRecord/modal/VoiceRecordDeleteModal.js.map +1 -0
- package/dist/module/features/voiceRecord/modal/VoiceRecordUndoModal.js +69 -0
- package/dist/module/features/voiceRecord/modal/VoiceRecordUndoModal.js.map +1 -0
- package/dist/module/features/voiceRecord/model/Recorder.model.js +32 -0
- package/dist/module/features/voiceRecord/model/Recorder.model.js.map +1 -0
- package/dist/module/features/voiceRecord/model/VoiceRecord.model.js +146 -0
- package/dist/module/features/voiceRecord/model/VoiceRecord.model.js.map +1 -0
- package/dist/module/features/voiceRecord/model/VoiceRecordApi.js +24 -0
- package/dist/module/features/voiceRecord/model/VoiceRecordApi.js.map +1 -0
- package/dist/module/features/voiceRecord/model/VoiceRecordCollection.js +25 -0
- package/dist/module/features/voiceRecord/model/VoiceRecordCollection.js.map +1 -0
- package/dist/module/features/voiceRecord/types.js +4 -0
- package/dist/module/features/voiceRecord/types.js.map +1 -0
- package/dist/module/index.js +1 -0
- package/dist/module/index.js.map +1 -1
- package/dist/module/shared/translation/localization/ca.json +13 -0
- package/dist/module/shared/translation/localization/de.json +13 -0
- package/dist/module/shared/translation/localization/en.json +13 -0
- package/dist/module/shared/translation/localization/gb.json +13 -0
- package/dist/module/shared/translation/localization/sct.json +13 -0
- package/dist/module/shared/translation/localization/sw.json +13 -0
- package/dist/typescript/commonjs/features/voiceRecord/components/VoiceRecord.d.ts +10 -0
- package/dist/typescript/commonjs/features/voiceRecord/components/VoiceRecord.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/voiceRecord/components/VoiceRecordButton.d.ts +11 -0
- package/dist/typescript/commonjs/features/voiceRecord/components/VoiceRecordButton.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/voiceRecord/components/VoiceRecordDeleteButton.d.ts +7 -0
- package/dist/typescript/commonjs/features/voiceRecord/components/VoiceRecordDeleteButton.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/voiceRecord/components/VoiceRecordDevider.d.ts +3 -0
- package/dist/typescript/commonjs/features/voiceRecord/components/VoiceRecordDevider.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/voiceRecord/components/VoiceRecordTimer.d.ts +11 -0
- package/dist/typescript/commonjs/features/voiceRecord/components/VoiceRecordTimer.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/voiceRecord/constants.d.ts +11 -0
- package/dist/typescript/commonjs/features/voiceRecord/constants.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/voiceRecord/helpers.d.ts +29 -0
- package/dist/typescript/commonjs/features/voiceRecord/helpers.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/voiceRecord/hooks/useVoiceRecorder.d.ts +5 -0
- package/dist/typescript/commonjs/features/voiceRecord/hooks/useVoiceRecorder.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/voiceRecord/hooks/useVoiceRecorderAnimation.d.ts +6 -0
- package/dist/typescript/commonjs/features/voiceRecord/hooks/useVoiceRecorderAnimation.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/voiceRecord/index.d.ts +7 -0
- package/dist/typescript/commonjs/features/voiceRecord/index.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/voiceRecord/modal/VoiceRecordDeleteModal.d.ts +13 -0
- package/dist/typescript/commonjs/features/voiceRecord/modal/VoiceRecordDeleteModal.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/voiceRecord/modal/VoiceRecordUndoModal.d.ts +13 -0
- package/dist/typescript/commonjs/features/voiceRecord/modal/VoiceRecordUndoModal.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/voiceRecord/model/Recorder.model.d.ts +15 -0
- package/dist/typescript/commonjs/features/voiceRecord/model/Recorder.model.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/voiceRecord/model/VoiceRecord.model.d.ts +39 -0
- package/dist/typescript/commonjs/features/voiceRecord/model/VoiceRecord.model.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/voiceRecord/model/VoiceRecordApi.d.ts +5 -0
- package/dist/typescript/commonjs/features/voiceRecord/model/VoiceRecordApi.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/voiceRecord/model/VoiceRecordCollection.d.ts +10 -0
- package/dist/typescript/commonjs/features/voiceRecord/model/VoiceRecordCollection.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/voiceRecord/types.d.ts +43 -0
- package/dist/typescript/commonjs/features/voiceRecord/types.d.ts.map +1 -0
- package/dist/typescript/commonjs/index.d.ts +1 -0
- package/dist/typescript/commonjs/index.d.ts.map +1 -1
- package/dist/typescript/commonjs/shared/translation/constants.d.ts +78 -0
- package/dist/typescript/commonjs/shared/translation/constants.d.ts.map +1 -1
- package/dist/typescript/commonjs/shared/translation/model.d.ts +26 -0
- package/dist/typescript/commonjs/shared/translation/model.d.ts.map +1 -1
- package/dist/typescript/commonjs/types/common.types.d.ts +3 -0
- package/dist/typescript/commonjs/types/common.types.d.ts.map +1 -1
- package/dist/typescript/module/features/voiceRecord/components/VoiceRecord.d.ts +10 -0
- package/dist/typescript/module/features/voiceRecord/components/VoiceRecord.d.ts.map +1 -0
- package/dist/typescript/module/features/voiceRecord/components/VoiceRecordButton.d.ts +11 -0
- package/dist/typescript/module/features/voiceRecord/components/VoiceRecordButton.d.ts.map +1 -0
- package/dist/typescript/module/features/voiceRecord/components/VoiceRecordDeleteButton.d.ts +7 -0
- package/dist/typescript/module/features/voiceRecord/components/VoiceRecordDeleteButton.d.ts.map +1 -0
- package/dist/typescript/module/features/voiceRecord/components/VoiceRecordDevider.d.ts +3 -0
- package/dist/typescript/module/features/voiceRecord/components/VoiceRecordDevider.d.ts.map +1 -0
- package/dist/typescript/module/features/voiceRecord/components/VoiceRecordTimer.d.ts +11 -0
- package/dist/typescript/module/features/voiceRecord/components/VoiceRecordTimer.d.ts.map +1 -0
- package/dist/typescript/module/features/voiceRecord/constants.d.ts +11 -0
- package/dist/typescript/module/features/voiceRecord/constants.d.ts.map +1 -0
- package/dist/typescript/module/features/voiceRecord/helpers.d.ts +29 -0
- package/dist/typescript/module/features/voiceRecord/helpers.d.ts.map +1 -0
- package/dist/typescript/module/features/voiceRecord/hooks/useVoiceRecorder.d.ts +5 -0
- package/dist/typescript/module/features/voiceRecord/hooks/useVoiceRecorder.d.ts.map +1 -0
- package/dist/typescript/module/features/voiceRecord/hooks/useVoiceRecorderAnimation.d.ts +6 -0
- package/dist/typescript/module/features/voiceRecord/hooks/useVoiceRecorderAnimation.d.ts.map +1 -0
- package/dist/typescript/module/features/voiceRecord/index.d.ts +7 -0
- package/dist/typescript/module/features/voiceRecord/index.d.ts.map +1 -0
- package/dist/typescript/module/features/voiceRecord/modal/VoiceRecordDeleteModal.d.ts +13 -0
- package/dist/typescript/module/features/voiceRecord/modal/VoiceRecordDeleteModal.d.ts.map +1 -0
- package/dist/typescript/module/features/voiceRecord/modal/VoiceRecordUndoModal.d.ts +13 -0
- package/dist/typescript/module/features/voiceRecord/modal/VoiceRecordUndoModal.d.ts.map +1 -0
- package/dist/typescript/module/features/voiceRecord/model/Recorder.model.d.ts +15 -0
- package/dist/typescript/module/features/voiceRecord/model/Recorder.model.d.ts.map +1 -0
- package/dist/typescript/module/features/voiceRecord/model/VoiceRecord.model.d.ts +39 -0
- package/dist/typescript/module/features/voiceRecord/model/VoiceRecord.model.d.ts.map +1 -0
- package/dist/typescript/module/features/voiceRecord/model/VoiceRecordApi.d.ts +5 -0
- package/dist/typescript/module/features/voiceRecord/model/VoiceRecordApi.d.ts.map +1 -0
- package/dist/typescript/module/features/voiceRecord/model/VoiceRecordCollection.d.ts +10 -0
- package/dist/typescript/module/features/voiceRecord/model/VoiceRecordCollection.d.ts.map +1 -0
- package/dist/typescript/module/features/voiceRecord/types.d.ts +43 -0
- package/dist/typescript/module/features/voiceRecord/types.d.ts.map +1 -0
- package/dist/typescript/module/index.d.ts +1 -0
- package/dist/typescript/module/index.d.ts.map +1 -1
- package/dist/typescript/module/shared/translation/constants.d.ts +78 -0
- package/dist/typescript/module/shared/translation/constants.d.ts.map +1 -1
- package/dist/typescript/module/shared/translation/model.d.ts +26 -0
- package/dist/typescript/module/shared/translation/model.d.ts.map +1 -1
- package/dist/typescript/module/types/common.types.d.ts +3 -0
- package/dist/typescript/module/types/common.types.d.ts.map +1 -1
- package/package.json +9 -3
- package/src/features/voiceRecord/components/VoiceRecord.tsx +73 -0
- package/src/features/voiceRecord/components/VoiceRecordButton.tsx +86 -0
- package/src/features/voiceRecord/components/VoiceRecordDeleteButton.tsx +24 -0
- package/src/features/voiceRecord/components/VoiceRecordDevider.tsx +17 -0
- package/src/features/voiceRecord/components/VoiceRecordTimer.tsx +53 -0
- package/src/features/voiceRecord/constants.ts +10 -0
- package/src/features/voiceRecord/helpers.ts +167 -0
- package/src/features/voiceRecord/hooks/useVoiceRecorder.ts +85 -0
- package/src/features/voiceRecord/hooks/useVoiceRecorderAnimation.ts +19 -0
- package/src/features/voiceRecord/index.ts +6 -0
- package/src/features/voiceRecord/modal/VoiceRecordDeleteModal.tsx +106 -0
- package/src/features/voiceRecord/modal/VoiceRecordUndoModal.tsx +82 -0
- package/src/features/voiceRecord/model/Recorder.model.ts +40 -0
- package/src/features/voiceRecord/model/VoiceRecord.model.ts +178 -0
- package/src/features/voiceRecord/model/VoiceRecordApi.ts +25 -0
- package/src/features/voiceRecord/model/VoiceRecordCollection.ts +26 -0
- package/src/features/voiceRecord/types.ts +49 -0
- package/src/index.ts +1 -0
- package/src/shared/translation/localization/ca.json +13 -0
- package/src/shared/translation/localization/de.json +13 -0
- package/src/shared/translation/localization/en.json +13 -0
- package/src/shared/translation/localization/gb.json +13 -0
- package/src/shared/translation/localization/sct.json +13 -0
- package/src/shared/translation/localization/sw.json +13 -0
- package/src/types/common.types.ts +1 -0
- package/.editorconfig +0 -15
- package/.eslintignore +0 -2
- package/.eslintrc +0 -22
- package/.gitattributes +0 -3
- package/.github/actions/setup/action.yml +0 -37
- package/.github/workflows/ci.yml +0 -73
- package/.gitignore +0 -84
- package/.idea/.gitignore +0 -8
- package/.idea/codeStyles/Project.xml +0 -62
- package/.idea/codeStyles/codeStyleConfig.xml +0 -5
- package/.idea/copilot.data.migration.agent.xml +0 -6
- package/.idea/copilot.data.migration.ask.xml +0 -6
- package/.idea/copilot.data.migration.ask2agent.xml +0 -6
- package/.idea/copilot.data.migration.edit.xml +0 -6
- package/.idea/inspectionProfiles/Project_Default.xml +0 -8
- package/.idea/jsLinters/eslint.xml +0 -6
- package/.idea/modules.xml +0 -8
- package/.idea/prettier.xml +0 -7
- package/.idea/shelf/Uncommitted_changes_before_Checkout_at_30_12_2025,_11_06_[Changes]/shelved.patch +0 -18
- package/.idea/shelf/Uncommitted_changes_before_Checkout_at_30_12_2025,_11_07_[Changes]/shelved.patch +0 -18
- package/.idea/shelf/Uncommitted_changes_before_Checkout_at_30_12_2025__11_06__Changes_.xml +0 -4
- package/.idea/shelf/Uncommitted_changes_before_Checkout_at_30_12_2025__11_07__Changes_.xml +0 -4
- package/.idea/students-features.iml +0 -12
- package/.idea/vcs.xml +0 -6
- package/.idea/workspace.xml +0 -646
- package/.nvmrc +0 -1
- package/.prettierrc +0 -11
- package/.release-it.json +0 -17
- package/.watchmanconfig +0 -1
- package/.yarn/plugins/@yarnpkg/plugin-interactive-tools.cjs +0 -541
- package/.yarn/plugins/@yarnpkg/plugin-workspace-tools.cjs +0 -28
- package/.yarn/releases/yarn-3.6.1.cjs +0 -874
- package/babel.config.js +0 -5
- package/bob.config.js +0 -25
- package/example/.expo/README.md +0 -8
- package/example/.expo/devices.json +0 -3
- package/example/.expo/web/cache/production/images/favicon/favicon-24272cdaeff82cc5facdaccd982a6f05b60c4504704bbf94c19a6388659880bb-contain-transparent/favicon-48.png +0 -0
- package/example/app.json +0 -30
- package/example/assets/adaptive-icon.png +0 -0
- package/example/assets/favicon.png +0 -0
- package/example/assets/icon.png +0 -0
- package/example/assets/splash-icon.png +0 -0
- package/example/babel.config.js +0 -28
- package/example/index.js +0 -8
- package/example/metro.config.js +0 -18
- package/example/package.json +0 -25
- package/example/src/App.tsx +0 -8
- package/example/tsconfig.json +0 -6
- package/example/yarn.lock +0 -6552
- package/tsconfig.build.json +0 -4
- package/tsconfig.json +0 -34
- package/yarn.lock +0 -8623
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import React, { useEffect } from 'react';
|
|
4
|
+
import { BaseModal, Button, ButtonColor, ButtonSize, ButtonVariant, SPACING } from '@magmamath/react-native-ui';
|
|
5
|
+
import { View, StyleSheet } from 'react-native';
|
|
6
|
+
import { useUnit } from 'effector-react';
|
|
7
|
+
import { VoiceRecorderState } from "../constants.js";
|
|
8
|
+
import { useText } from "../../../shared/translation/index.js";
|
|
9
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
10
|
+
const FooterButtons = ({
|
|
11
|
+
onClose,
|
|
12
|
+
onDelete
|
|
13
|
+
}) => {
|
|
14
|
+
const t = useText();
|
|
15
|
+
return /*#__PURE__*/_jsxs(View, {
|
|
16
|
+
style: styles.footerContainer,
|
|
17
|
+
children: [/*#__PURE__*/_jsx(Button, {
|
|
18
|
+
variant: ButtonVariant.TERTIARY,
|
|
19
|
+
size: ButtonSize.LARGE,
|
|
20
|
+
onPress: onClose,
|
|
21
|
+
children: t('voiceRecorder.cancel')
|
|
22
|
+
}), /*#__PURE__*/_jsx(Button, {
|
|
23
|
+
colorScheme: ButtonColor.RED,
|
|
24
|
+
variant: ButtonVariant.PRIMARY,
|
|
25
|
+
size: ButtonSize.LARGE,
|
|
26
|
+
onPress: onDelete,
|
|
27
|
+
children: t('voiceRecorder.delete')
|
|
28
|
+
})]
|
|
29
|
+
});
|
|
30
|
+
};
|
|
31
|
+
export const VoiceRecordDeleteModal = ({
|
|
32
|
+
modal: {
|
|
33
|
+
closeModal,
|
|
34
|
+
params
|
|
35
|
+
}
|
|
36
|
+
}) => {
|
|
37
|
+
const t = useText();
|
|
38
|
+
const {
|
|
39
|
+
model
|
|
40
|
+
} = params;
|
|
41
|
+
const recorderState = useUnit(model.recorderModel.$voiceRecordState);
|
|
42
|
+
const {
|
|
43
|
+
durationMillis
|
|
44
|
+
} = model.recorderModel.recorder.getStatus();
|
|
45
|
+
const isRecordingInProgress = (recorderState === VoiceRecorderState.PAUSED || recorderState === VoiceRecorderState.RECORDING) && durationMillis > 0;
|
|
46
|
+
const handleDelete = async () => {
|
|
47
|
+
if (isRecordingInProgress) {
|
|
48
|
+
await model.recorderModel.recorder.stop();
|
|
49
|
+
}
|
|
50
|
+
model.deleteCurrentRecording();
|
|
51
|
+
closeModal();
|
|
52
|
+
};
|
|
53
|
+
useEffect(() => {
|
|
54
|
+
if (recorderState === VoiceRecorderState.RECORDING) {
|
|
55
|
+
model.recorderModel.recorder.pause();
|
|
56
|
+
}
|
|
57
|
+
return () => {
|
|
58
|
+
if (isRecordingInProgress && model.recorderModel.recorder.getStatus().durationMillis > 0) {
|
|
59
|
+
model.recorderModel.recorder.record();
|
|
60
|
+
}
|
|
61
|
+
};
|
|
62
|
+
}, []);
|
|
63
|
+
return /*#__PURE__*/_jsx(BaseModal, {
|
|
64
|
+
style: {
|
|
65
|
+
container: styles.modalContainer
|
|
66
|
+
},
|
|
67
|
+
header: t('voiceRecorder.deleteRecording'),
|
|
68
|
+
content: t('voiceRecorder.youWontBeAbleToRecover'),
|
|
69
|
+
footer: /*#__PURE__*/_jsx(FooterButtons, {
|
|
70
|
+
onClose: closeModal,
|
|
71
|
+
onDelete: handleDelete
|
|
72
|
+
})
|
|
73
|
+
});
|
|
74
|
+
};
|
|
75
|
+
const styles = StyleSheet.create({
|
|
76
|
+
modalContainer: {
|
|
77
|
+
width: 600,
|
|
78
|
+
height: 268
|
|
79
|
+
},
|
|
80
|
+
footerContainer: {
|
|
81
|
+
flexDirection: 'row',
|
|
82
|
+
alignItems: 'center',
|
|
83
|
+
gap: SPACING[200]
|
|
84
|
+
}
|
|
85
|
+
});
|
|
86
|
+
//# sourceMappingURL=VoiceRecordDeleteModal.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","useEffect","BaseModal","Button","ButtonColor","ButtonSize","ButtonVariant","SPACING","View","StyleSheet","useUnit","VoiceRecorderState","useText","jsx","_jsx","jsxs","_jsxs","FooterButtons","onClose","onDelete","t","style","styles","footerContainer","children","variant","TERTIARY","size","LARGE","onPress","colorScheme","RED","PRIMARY","VoiceRecordDeleteModal","modal","closeModal","params","model","recorderState","recorderModel","$voiceRecordState","durationMillis","recorder","getStatus","isRecordingInProgress","PAUSED","RECORDING","handleDelete","stop","deleteCurrentRecording","pause","record","container","modalContainer","header","content","footer","create","width","height","flexDirection","alignItems","gap"],"sourceRoot":"../../../../../src","sources":["features/voiceRecord/modal/VoiceRecordDeleteModal.tsx"],"mappings":";;AAAA,OAAOA,KAAK,IAAIC,SAAS,QAAQ,OAAO;AACxC,SACEC,SAAS,EACTC,MAAM,EACNC,WAAW,EACXC,UAAU,EACVC,aAAa,EACbC,OAAO,QACF,4BAA4B;AACnC,SAASC,IAAI,EAAEC,UAAU,QAAQ,cAAc;AAC/C,SAASC,OAAO,QAAQ,gBAAgB;AAExC,SAASC,kBAAkB,QAAQ,iBAAc;AACjD,SAASC,OAAO,QAAQ,sCAA6B;AAAA,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAgBrD,MAAMC,aAAa,GAAGA,CAAC;EAAEC,OAAO;EAAEC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ize, ButtonVariant, SPACING } from '@magmamath/react-native-ui';
|
|
5
|
+
import { StyleSheet, View } from 'react-native';
|
|
6
|
+
import { useText } from "../../../shared/translation/index.js";
|
|
7
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
8
|
+
const FooterButtons = ({
|
|
9
|
+
onClose,
|
|
10
|
+
onRedo
|
|
11
|
+
}) => {
|
|
12
|
+
const t = useText();
|
|
13
|
+
return /*#__PURE__*/_jsxs(View, {
|
|
14
|
+
style: styles.footerContainer,
|
|
15
|
+
children: [/*#__PURE__*/_jsx(Button, {
|
|
16
|
+
variant: ButtonVariant.TERTIARY,
|
|
17
|
+
size: ButtonSize.LARGE,
|
|
18
|
+
onPress: onClose,
|
|
19
|
+
children: t('voiceRecorder.cancel')
|
|
20
|
+
}), /*#__PURE__*/_jsx(Button, {
|
|
21
|
+
colorScheme: ButtonColor.BLUE,
|
|
22
|
+
variant: ButtonVariant.PRIMARY,
|
|
23
|
+
size: ButtonSize.LARGE,
|
|
24
|
+
onPress: onRedo,
|
|
25
|
+
children: t('voiceRecorder.redo')
|
|
26
|
+
})]
|
|
27
|
+
});
|
|
28
|
+
};
|
|
29
|
+
export const VoiceRecordUndoModal = ({
|
|
30
|
+
modal: {
|
|
31
|
+
closeModal,
|
|
32
|
+
params
|
|
33
|
+
}
|
|
34
|
+
}) => {
|
|
35
|
+
const t = useText();
|
|
36
|
+
const {
|
|
37
|
+
model
|
|
38
|
+
} = params;
|
|
39
|
+
const handleRedo = () => {
|
|
40
|
+
model.deleteCurrentRecording({
|
|
41
|
+
notification: false
|
|
42
|
+
});
|
|
43
|
+
closeModal();
|
|
44
|
+
model.initializeRecording();
|
|
45
|
+
};
|
|
46
|
+
return /*#__PURE__*/_jsx(BaseModal, {
|
|
47
|
+
style: {
|
|
48
|
+
container: styles.modalStyle
|
|
49
|
+
},
|
|
50
|
+
header: t('voiceRecorder.redoRecording'),
|
|
51
|
+
content: t('voiceRecorder.thisWillRemoveRecording'),
|
|
52
|
+
footer: /*#__PURE__*/_jsx(FooterButtons, {
|
|
53
|
+
onClose: closeModal,
|
|
54
|
+
onRedo: handleRedo
|
|
55
|
+
})
|
|
56
|
+
});
|
|
57
|
+
};
|
|
58
|
+
const styles = StyleSheet.create({
|
|
59
|
+
modalStyle: {
|
|
60
|
+
width: 600,
|
|
61
|
+
height: 268
|
|
62
|
+
},
|
|
63
|
+
footerContainer: {
|
|
64
|
+
flexDirection: 'row',
|
|
65
|
+
alignItems: 'center',
|
|
66
|
+
gap: SPACING[200]
|
|
67
|
+
}
|
|
68
|
+
});
|
|
69
|
+
//# sourceMappingURL=VoiceRecordUndoModal.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","BaseModal","Button","ButtonColor","ButtonSize","ButtonVariant","SPACING","StyleSheet","View","useText","jsx","_jsx","jsxs","_jsxs","FooterButtons","onClose","onRedo","t","style","styles","footerContainer","children","variant","TERTIARY","size","LARGE","onPress","colorScheme","BLUE","PRIMARY","VoiceRecordUndoModal","modal","closeModal","params","model","handleRedo","deleteCurrentRecording","notification","initializeRecording","container","modalStyle","header","content","footer","create","width","height","flexDirection","alignItems","gap"],"sourceRoot":"../../../../../src","sources":["features/voiceRecord/modal/VoiceRecordUndoModal.tsx"],"mappings":";;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SACEC,SAAS,EACTC,MAAM,EACNC,WAAW,EACXC,UAAU,EACVC,aAAa,EACbC,OAAO,QACF,4BAA4B;AACnC,SAASC,UAAU,EAAEC,IAAI,QAAQ,cAAc;AAC/C,SAASC,OAAO,QAAQ,sCAA6B;AAAA,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAiBrD,MAAMC,aAAa,GAAGA,CAAC;EAAEC,OAAO;EAAEC;AAA2B,CAAC,KAAK;EACjE,MAAMC,CAAC,GAAGR,OAAO,CAAC,CAAC;EAEnB,oBACEI,KAAA,CAACL,IAAI;IAACU,KAAK,EAAE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CAACqC,MAAM,CAAC;EAC/BJ,UAAU,EAAE;IACVK,KAAK,EAAE,GAAG;IACVC,MAAM,EAAE;EACV,CAAC;EACD1B,eAAe,EAAE;IACf2B,aAAa,EAAE,KAAK;IACpBC,UAAU,EAAE,QAAQ;IACpBC,GAAG,EAAE3C,OAAO,CAAC,GAAG;EAClB;AACF,CAAC,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { createEffect, createEvent, restore } from 'effector';
|
|
4
|
+
import { setAudioModeAsync } from 'expo-audio';
|
|
5
|
+
import { VoiceRecorderState } from "../constants.js";
|
|
6
|
+
const AUDIO_MODE_CONFIG = {
|
|
7
|
+
playsInSilentMode: true,
|
|
8
|
+
allowsRecording: true
|
|
9
|
+
};
|
|
10
|
+
export class RecorderModel {
|
|
11
|
+
reset = createEvent();
|
|
12
|
+
setAudioFileDurationMs = createEvent();
|
|
13
|
+
setVoiceRecordState = createEvent();
|
|
14
|
+
setAvailableInputs = createEvent();
|
|
15
|
+
$audioFileDurationMs = restore(this.setAudioFileDurationMs, 0).reset(this.reset);
|
|
16
|
+
$voiceRecordState = restore(this.setVoiceRecordState, VoiceRecorderState.IDLE).reset(this.reset);
|
|
17
|
+
$availableInputs = restore(this.setAvailableInputs, []);
|
|
18
|
+
start = createEffect(async () => {
|
|
19
|
+
try {
|
|
20
|
+
await setAudioModeAsync(AUDIO_MODE_CONFIG);
|
|
21
|
+
await this.recorder.prepareToRecordAsync();
|
|
22
|
+
this.recorder.record();
|
|
23
|
+
} catch (error) {
|
|
24
|
+
console.error('Error starting recording:', error);
|
|
25
|
+
throw error;
|
|
26
|
+
}
|
|
27
|
+
});
|
|
28
|
+
stop = createEffect(async () => {
|
|
29
|
+
return this.recorder.stop();
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
//# sourceMappingURL=Recorder.model.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["createEffect","createEvent","restore","setAudioModeAsync","VoiceRecorderState","AUDIO_MODE_CONFIG","playsInSilentMode","allowsRecording","RecorderModel","reset","setAudioFileDurationMs","setVoiceRecordState","setAvailableInputs","$audioFileDurationMs","$voiceRecordState","IDLE","$availableInputs","start","recorder","prepareToRecordAsync","record","error","console","stop"],"sourceRoot":"../../../../../src","sources":["features/voiceRecord/model/Recorder.model.ts"],"mappings":";;AAAA,SAASA,YAAY,EAAEC,WAAW,EAAEC,OAAO,QAAQ,UAAU;AAC7D,SAAwBC,iBAAiB,QAAQ,YAAY;AAC7D,SAASC,kBAAkB,QAAQ,iBAAc;AAGjD,MAAMC,iBAAiB,GAAG;EACxBC,iBAAiB,EAAE,IAAI;EACvBC,eAAe,EAAE;AACnB,CAAU;AAEV,OAAO,MAAMC,aAAa,CAAC;EAGTC,KAAK,GAAGR,WAAW,CAAC,CAAC;EACrBS,sBAAsB,GAAGT,WAAW,CAAS,CAAC;EAC9CU,mBAAmB,GAAGV,WAAW,CAAqB,CAAC;EACvDW,kBAAkB,GAAGX,WAAW,CAAuB,CAAC;EAExDY,oBAAoB,GAAGX,OAAO,CAAC,IAAI,CAACQ,sBAAsB,EAAE,CAAC,CAAC,CAACD,KAAK,CAAC,IAAI,CAACA,KAAK,CAAC;EAChFK,iBAAiB,GAAGZ,OAAO,CACzC,IAAI,CAACS,mBAAmB,EACxBP,kBAAkB,CAACW,IACrB,CAAC,CAACN,KAAK,CAAC,IAAI,CAACA,KAAK,CAAC;EACHO,gBAAgB,GAAGd,OAAO,CAAC,IAAI,CAACU,kBAAkB,EAAE,EAAE,CAAC;EAEvDK,KAAK,GAAGjB,YAAY,CAAC,YAAY;IAC/C,IAAI;MACF,MAAMG,iBAAiB,CAACE,iBAAiB,CAAC;MAC1C,MAAM,IAAI,CAACa,QAAQ,CAACC,oBAAoB,CAAC,CAAC;MAC1C,IAAI,CAACD,QAAQ,CAACE,MAAM,CAAC,CAAC;IACxB,CAAC,CAAC,OAAOC,KAAK,EAAE;MACdC,OAAO,CAACD,KAAK,CAAC,2BAA2B,EAAEA,KAAK,CAAC;MACjD,MAAMA,KAAK;IACb;EACF,CAAC,CAAC;EAEcE,IAAI,GAAGvB,YAAY,CAAC,YAAY;IAC9C,OAAO,IAAI,CAACkB,QAAQ,CAACK,IAAI,CAAC,CAAC;EAC7B,CAAC,CAAC;AACJ","ignoreList":[]}
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { attach, createEffect, createEvent, createStore, restore, sample } from 'effector';
|
|
4
|
+
import { ensureRecordingPermissions, generateAudioFormData, getAudioDurationMs, getAvailableInputs, uploadAudioFileRequestGenerator } from "../helpers.js";
|
|
5
|
+
import { t } from "../../../shared/translation/index.js";
|
|
6
|
+
import { RecorderModel } from "./Recorder.model.js";
|
|
7
|
+
import { VoiceRecordsCollection } from "./VoiceRecordCollection.js";
|
|
8
|
+
export class VoiceRecordModel {
|
|
9
|
+
setCurrentKey = createEvent();
|
|
10
|
+
setUri = createEvent();
|
|
11
|
+
setCurrentRecord = createEvent();
|
|
12
|
+
reset = createEvent();
|
|
13
|
+
$currentKey = restore(this.setCurrentKey, '');
|
|
14
|
+
$currentRecord = createStore(null).reset(this.reset);
|
|
15
|
+
$uri = restore(this.setUri, '').reset(this.reset);
|
|
16
|
+
deleteCurrentRecording = attach({
|
|
17
|
+
source: this.$currentKey,
|
|
18
|
+
mapParams: (props, currentKey) => ({
|
|
19
|
+
notification: true,
|
|
20
|
+
...props,
|
|
21
|
+
currentKey
|
|
22
|
+
}),
|
|
23
|
+
effect: createEffect(({
|
|
24
|
+
currentKey,
|
|
25
|
+
notification
|
|
26
|
+
}) => {
|
|
27
|
+
const recordingItem = this.collection.get(currentKey);
|
|
28
|
+
this.abortUploadIfInProgress(recordingItem);
|
|
29
|
+
this.resetRecordingState(currentKey);
|
|
30
|
+
if (notification) {
|
|
31
|
+
this.notification.info(t('voiceRecorder.recordingDeleted'));
|
|
32
|
+
}
|
|
33
|
+
})
|
|
34
|
+
});
|
|
35
|
+
initializeRecording = createEffect(async () => {
|
|
36
|
+
this.deleteCurrentRecording({
|
|
37
|
+
notification: false
|
|
38
|
+
});
|
|
39
|
+
const hasPermissions = await ensureRecordingPermissions();
|
|
40
|
+
if (!hasPermissions) {
|
|
41
|
+
this.notification.error(t('voiceRecorder.noMicrophoneAccess'));
|
|
42
|
+
return;
|
|
43
|
+
}
|
|
44
|
+
const inputs = await getAvailableInputs(this.recorderModel.recorder);
|
|
45
|
+
this.recorderModel.setAvailableInputs(inputs);
|
|
46
|
+
if (inputs.length === 0) {
|
|
47
|
+
this.notification.error(t('voiceRecorder.noMicrophoneFound'));
|
|
48
|
+
return;
|
|
49
|
+
}
|
|
50
|
+
return this.recorderModel.start();
|
|
51
|
+
});
|
|
52
|
+
constructor({
|
|
53
|
+
api,
|
|
54
|
+
notification,
|
|
55
|
+
events
|
|
56
|
+
}) {
|
|
57
|
+
this.api = api;
|
|
58
|
+
this.notification = notification;
|
|
59
|
+
this.events = events;
|
|
60
|
+
this.recorderModel = new RecorderModel();
|
|
61
|
+
this.collection = new VoiceRecordsCollection();
|
|
62
|
+
this.setupUploadHandler();
|
|
63
|
+
this.setupCurrentRecordSync();
|
|
64
|
+
}
|
|
65
|
+
abortUploadIfInProgress(recordingItem) {
|
|
66
|
+
if (!recordingItem?.id && recordingItem?.controller) {
|
|
67
|
+
recordingItem.controller.abort();
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
resetRecordingState(currentKey) {
|
|
71
|
+
this.recorderModel.reset();
|
|
72
|
+
this.reset();
|
|
73
|
+
this.collection.delete(currentKey);
|
|
74
|
+
}
|
|
75
|
+
async handleAudioUpload({
|
|
76
|
+
uri,
|
|
77
|
+
currentKey
|
|
78
|
+
}) {
|
|
79
|
+
const durationMs = await getAudioDurationMs(uri);
|
|
80
|
+
const formData = await generateAudioFormData({
|
|
81
|
+
audioFileUri: uri,
|
|
82
|
+
durationMs
|
|
83
|
+
});
|
|
84
|
+
const {
|
|
85
|
+
uploadAudio,
|
|
86
|
+
controller
|
|
87
|
+
} = uploadAudioFileRequestGenerator(formData, this.api);
|
|
88
|
+
const audioUploadPromise = uploadAudio().then(data => {
|
|
89
|
+
// Check if the item still exists (wasn't deleted during upload)
|
|
90
|
+
if (this.collection.get(currentKey)) {
|
|
91
|
+
this.collection.update(currentKey, {
|
|
92
|
+
id: data.id
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
|
+
return data;
|
|
96
|
+
}).catch(error => {
|
|
97
|
+
if (error.name === 'CanceledError') return;
|
|
98
|
+
this.notification.error(t('voiceRecorder.uploadFailed'));
|
|
99
|
+
});
|
|
100
|
+
this.collection.add(currentKey, {
|
|
101
|
+
durationMs,
|
|
102
|
+
audioUploadPromise,
|
|
103
|
+
controller,
|
|
104
|
+
uri
|
|
105
|
+
});
|
|
106
|
+
return audioUploadPromise;
|
|
107
|
+
}
|
|
108
|
+
setupUploadHandler() {
|
|
109
|
+
sample({
|
|
110
|
+
clock: this.setUri,
|
|
111
|
+
source: this.$currentKey,
|
|
112
|
+
filter: (currentKey, uri) => !!uri && !!currentKey,
|
|
113
|
+
fn: (currentKey, uri) => ({
|
|
114
|
+
currentKey,
|
|
115
|
+
uri
|
|
116
|
+
}),
|
|
117
|
+
target: createEffect(({
|
|
118
|
+
uri,
|
|
119
|
+
currentKey
|
|
120
|
+
}) => this.handleAudioUpload({
|
|
121
|
+
uri,
|
|
122
|
+
currentKey
|
|
123
|
+
}))
|
|
124
|
+
});
|
|
125
|
+
}
|
|
126
|
+
setupCurrentRecordSync() {
|
|
127
|
+
sample({
|
|
128
|
+
source: this.$currentKey,
|
|
129
|
+
fn: currentKey => this.collection.get(currentKey),
|
|
130
|
+
target: createEffect(recordingItem => {
|
|
131
|
+
if (!recordingItem) {
|
|
132
|
+
this.reset();
|
|
133
|
+
return;
|
|
134
|
+
}
|
|
135
|
+
this.setCurrentRecord(recordingItem);
|
|
136
|
+
if (recordingItem.durationMs) {
|
|
137
|
+
this.recorderModel.setAudioFileDurationMs(recordingItem.durationMs);
|
|
138
|
+
}
|
|
139
|
+
if (recordingItem.uri) {
|
|
140
|
+
this.setUri(recordingItem.uri);
|
|
141
|
+
}
|
|
142
|
+
})
|
|
143
|
+
});
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
//# sourceMappingURL=VoiceRecord.model.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["attach","createEffect","createEvent","createStore","restore","sample","ensureRecordingPermissions","generateAudioFormData","getAudioDurationMs","getAvailableInputs","uploadAudioFileRequestGenerator","t","RecorderModel","VoiceRecordsCollection","VoiceRecordModel","setCurrentKey","setUri","setCurrentRecord","reset","$currentKey","$currentRecord","$uri","deleteCurrentRecording","source","mapParams","props","currentKey","notification","effect","recordingItem","collection","get","abortUploadIfInProgress","resetRecordingState","info","initializeRecording","hasPermissions","error","inputs","recorderModel","recorder","setAvailableInputs","length","start","constructor","api","events","setupUploadHandler","setupCurrentRecordSync","id","controller","abort","delete","handleAudioUpload","uri","durationMs","formData","audioFileUri","uploadAudio","audioUploadPromise","then","data","update","catch","name","add","clock","filter","fn","target","setAudioFileDurationMs"],"sourceRoot":"../../../../../src","sources":["features/voiceRecord/model/VoiceRecord.model.ts"],"mappings":";;AAAA,SAASA,MAAM,EAAWC,YAAY,EAAEC,WAAW,EAAEC,WAAW,EAAEC,OAAO,EAAEC,MAAM,QAAQ,UAAU;AACnG,SACEC,0BAA0B,EAC1BC,qBAAqB,EACrBC,kBAAkB,EAClBC,kBAAkB,EAClBC,+BAA+B,QAC1B,eAAY;AAEnB,SAASC,CAAC,QAAQ,sCAA6B;AAC/C,SAASC,aAAa,QAAQ,qBAAkB;AAChD,SAASC,sBAAsB,QAAQ,4BAAyB;AA0BhE,OAAO,MAAMC,gBAAgB,CAAC;EAOZC,aAAa,GAAGb,WAAW,CAAS,CAAC;EACrCc,MAAM,GAAGd,WAAW,CAAS,CAAC;EAC9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QAAE5B;MAAyB,CAAC,KACrD,IAAI,CAAC2B,iBAAiB,CAAC;QAAEC,GAAG;QAAE5B;MAAW,CAAC,CAC5C;IACF,CAAC,CAAC;EACJ;EAEQsB,sBAAsBA,CAAA,EAAG;IAC/B3C,MAAM,CAAC;MACLkB,MAAM,EAAE,IAAI,CAACJ,WAAW;MACxBiD,EAAE,EAAG1C,UAAU,IAAK,IAAI,CAACI,UAAU,CAACC,GAAG,CAACL,UAAU,CAAC;MACnD2C,MAAM,EAAEpE,YAAY,CAAE4B,aAAoC,IAAK;QAC7D,IAAI,CAACA,aAAa,EAAE;UAClB,IAAI,CAACX,KAAK,CAAC,CAAC;UACZ;QACF;QAEA,IAAI,CAACD,gBAAgB,CAACY,aAAa,CAAC;QAEpC,IAAIA,aAAa,CAAC0B,UAAU,EAAE;UAC5B,IAAI,CAAChB,aAAa,CAAC+B,sBAAsB,CAACzC,aAAa,CAAC0B,UAAU,CAAC;QACrE;QAEA,IAAI1B,aAAa,CAACyB,GAAG,EAAE;UACrB,IAAI,CAACtC,MAAM,CAACa,aAAa,CAACyB,GAAG,CAAC;QAChC;MACF,CAAC;IACH,CAAC,CAAC;EACJ;AACF","ignoreList":[]}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
export class VoiceRecordApi {
|
|
4
|
+
// public readonly uploadAudioFileFx
|
|
5
|
+
|
|
6
|
+
// public readonly abortUpload = createEffect(() => {
|
|
7
|
+
// if (this.uploadAudioFileFx.pending.getState()) {
|
|
8
|
+
// this.uploadAudioFileFx.controller.abort()
|
|
9
|
+
// }
|
|
10
|
+
// })
|
|
11
|
+
|
|
12
|
+
constructor(api) {
|
|
13
|
+
// this.uploadAudioFileFx = createControllerEffect((audioFileFormData: FormData, config) =>
|
|
14
|
+
// api.uploadAudioFile(
|
|
15
|
+
// { audioFileFormData },
|
|
16
|
+
// //@ts-ignore
|
|
17
|
+
// {
|
|
18
|
+
// signal: config?.signal,
|
|
19
|
+
// },
|
|
20
|
+
// ),
|
|
21
|
+
// )
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
//# sourceMappingURL=VoiceRecordApi.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["VoiceRecordApi","constructor","api"],"sourceRoot":"../../../../../src","sources":["features/voiceRecord/model/VoiceRecordApi.ts"],"mappings":";;AAIA,OAAO,MAAMA,cAAc,CAAC;EAC1B;;EAEA;EACA;EACA;EACA;EACA;;EAEAC,WAAWA,CAACC,GAAa,EAAE;IACzB;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;EAAA;AAEJ","ignoreList":[]}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
export class VoiceRecordsCollection {
|
|
4
|
+
collection = new Map();
|
|
5
|
+
add(key, item) {
|
|
6
|
+
this.collection.set(key, item);
|
|
7
|
+
}
|
|
8
|
+
update(key, item) {
|
|
9
|
+
const existingItem = this.collection.get(key) || {};
|
|
10
|
+
this.collection.set(key, {
|
|
11
|
+
...existingItem,
|
|
12
|
+
...item
|
|
13
|
+
});
|
|
14
|
+
}
|
|
15
|
+
delete(key) {
|
|
16
|
+
this.collection.delete(key);
|
|
17
|
+
}
|
|
18
|
+
get(key) {
|
|
19
|
+
return this.collection.get(key);
|
|
20
|
+
}
|
|
21
|
+
clear() {
|
|
22
|
+
this.collection.clear();
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
//# sourceMappingURL=VoiceRecordCollection.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["VoiceRecordsCollection","collection","Map","add","key","item","set","update","existingItem","get","delete","clear"],"sourceRoot":"../../../../../src","sources":["features/voiceRecord/model/VoiceRecordCollection.ts"],"mappings":";;AAEA,OAAO,MAAMA,sBAAsB,CAAC;EAClBC,UAAU,GAAsC,IAAIC,GAAG,CAAC,CAAC;EAElEC,GAAGA,CAACC,GAAW,EAAEC,IAA0B,EAAE;IAClD,IAAI,CAACJ,UAAU,CAACK,GAAG,CAACF,GAAG,EAAEC,IAAI,CAAC;EAChC;EAEOE,MAAMA,CAACH,GAAW,EAAEC,IAAmC,EAAE;IAC9D,MAAMG,YAAY,GAAG,IAAI,CAACP,UAAU,CAACQ,GAAG,CAACL,GAAG,CAAC,IAAI,CAAC,CAAC;IACnD,IAAI,CAACH,UAAU,CAACK,GAAG,CAACF,GAAG,EAAE;MAAE,GAAGI,YAAY;MAAE,GAAGH;IAAK,CAAC,CAAC;EACxD;EAEOK,MAAMA,CAACN,GAAW,EAAE;IACzB,IAAI,CAACH,UAAU,CAACS,MAAM,CAACN,GAAG,CAAC;EAC7B;EAEOK,GAAGA,CAACL,GAAW,EAAE;IACtB,OAAO,IAAI,CAACH,UAAU,CAACQ,GAAG,CAACL,GAAG,CAAC;EACjC;EAEOO,KAAKA,CAAA,EAAG;IACb,IAAI,CAACV,UAAU,CAACU,KAAK,CAAC,CAAC;EACzB;AACF","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sourceRoot":"../../../../src","sources":["features/voiceRecord/types.ts"],"mappings":"","ignoreList":[]}
|
package/dist/module/index.js
CHANGED
|
@@ -12,4 +12,5 @@ export * from "./features/gifCelebrations/index.js";
|
|
|
12
12
|
export * from "./features/exampleSolution/index.js";
|
|
13
13
|
export * from "./features/keyboard/index.js";
|
|
14
14
|
export * from "./shared/icons/index.js";
|
|
15
|
+
export * from "./features/voiceRecord/index.js";
|
|
15
16
|
//# sourceMappingURL=index.js.map
|
package/dist/module/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["useFeaturesLocalization","setFeaturesLocalization","Locale","generateRandomId"],"sourceRoot":"../../src","sources":["index.ts"],"mappings":";;AAAA,SAASA,uBAAuB,EAAEC,uBAAuB,EAAEC,MAAM,QAAQ,+BAAsB;AAC/F,SAASC,gBAAgB,QAAQ,0BAAuB;AACxD,cAAc,6BAAoB;AAClC,cAAc,8BAAqB;AACnC,cAAc,kCAAyB;AACvC,cAAc,qCAA4B;AAC1C,cAAc,kCAAyB;AACvC,cAAc,qCAA4B;AAC1C,cAAc,qCAA4B;AAC1C,cAAc,qCAA4B;AAC1C,cAAc,8BAAqB;AACnC,cAAc,yBAAgB","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["useFeaturesLocalization","setFeaturesLocalization","Locale","generateRandomId"],"sourceRoot":"../../src","sources":["index.ts"],"mappings":";;AAAA,SAASA,uBAAuB,EAAEC,uBAAuB,EAAEC,MAAM,QAAQ,+BAAsB;AAC/F,SAASC,gBAAgB,QAAQ,0BAAuB;AACxD,cAAc,6BAAoB;AAClC,cAAc,8BAAqB;AACnC,cAAc,kCAAyB;AACvC,cAAc,qCAA4B;AAC1C,cAAc,kCAAyB;AACvC,cAAc,qCAA4B;AAC1C,cAAc,qCAA4B;AAC1C,cAAc,qCAA4B;AAC1C,cAAc,8BAAqB;AACnC,cAAc,yBAAgB;AAC9B,cAAc,iCAAwB","ignoreList":[]}
|
|
@@ -39,5 +39,18 @@
|
|
|
39
39
|
"volume": "Volume",
|
|
40
40
|
"weight": "Weight",
|
|
41
41
|
"time": "Time"
|
|
42
|
+
},
|
|
43
|
+
"voiceRecorder": {
|
|
44
|
+
"deleteRecording": "Delete recording?",
|
|
45
|
+
"youWontBeAbleToRecover": "You won't be able to recover this file once it's gone.",
|
|
46
|
+
"recordingDeleted": "Recording successfully deleted",
|
|
47
|
+
"delete": "Delete",
|
|
48
|
+
"cancel": "Cancel",
|
|
49
|
+
"noMicrophoneAccess": "No microphone access",
|
|
50
|
+
"noMicrophoneFound": "No microphone found",
|
|
51
|
+
"uploadFailed": "Upload failed. Please try again.",
|
|
52
|
+
"redoRecording": "Redo recording?",
|
|
53
|
+
"redo": "Redo",
|
|
54
|
+
"thisWillRemoveRecording": "This will remove your previous recording."
|
|
42
55
|
}
|
|
43
56
|
}
|
|
@@ -39,5 +39,18 @@
|
|
|
39
39
|
"volume": "Volumen",
|
|
40
40
|
"weight": "Gewicht",
|
|
41
41
|
"time": "Zeit"
|
|
42
|
+
},
|
|
43
|
+
"voiceRecorder": {
|
|
44
|
+
"deleteRecording": "Aufnahme löschen?",
|
|
45
|
+
"youWontBeAbleToRecover": "Du kannst die Datei nicht wiederherstellen, wenn sie einmal gelöscht ist.",
|
|
46
|
+
"recordingDeleted": "Aufnahme gelöscht.",
|
|
47
|
+
"delete": "Löschen",
|
|
48
|
+
"cancel": "Abbrechen",
|
|
49
|
+
"noMicrophoneAccess": "Kein Mikrofon-Zugriff.",
|
|
50
|
+
"noMicrophoneFound": "Kein Mikrofon gefunden.",
|
|
51
|
+
"uploadFailed": "Hochladen fehlgeschlagen. Bitte versuche es erneut.",
|
|
52
|
+
"redoRecording": "Redo recording?",
|
|
53
|
+
"redo": "Redo",
|
|
54
|
+
"thisWillRemoveRecording": "This will remove your previous recording."
|
|
42
55
|
}
|
|
43
56
|
}
|
|
@@ -39,5 +39,18 @@
|
|
|
39
39
|
"volume": "Volume",
|
|
40
40
|
"weight": "Weight",
|
|
41
41
|
"time": "Time"
|
|
42
|
+
},
|
|
43
|
+
"voiceRecorder": {
|
|
44
|
+
"deleteRecording": "Delete recording?",
|
|
45
|
+
"youWontBeAbleToRecover": "You won't be able to recover this file once it's gone.",
|
|
46
|
+
"recordingDeleted": "Recording successfully deleted",
|
|
47
|
+
"delete": "Delete",
|
|
48
|
+
"cancel": "Cancel",
|
|
49
|
+
"noMicrophoneAccess": "No microphone access",
|
|
50
|
+
"noMicrophoneFound": "No microphone found",
|
|
51
|
+
"uploadFailed": "Upload failed. Please try again.",
|
|
52
|
+
"redoRecording": "Redo recording?",
|
|
53
|
+
"redo": "Redo",
|
|
54
|
+
"thisWillRemoveRecording": "This will remove your previous recording."
|
|
42
55
|
}
|
|
43
56
|
}
|
|
@@ -39,5 +39,18 @@
|
|
|
39
39
|
"volume": "Volume",
|
|
40
40
|
"weight": "Weight",
|
|
41
41
|
"time": "Time"
|
|
42
|
+
},
|
|
43
|
+
"voiceRecorder": {
|
|
44
|
+
"deleteRecording": "Delete recording?",
|
|
45
|
+
"youWontBeAbleToRecover": "You won't be able to recover this file once it's gone.",
|
|
46
|
+
"recordingDeleted": "Recording successfully deleted",
|
|
47
|
+
"delete": "Delete",
|
|
48
|
+
"cancel": "Cancel",
|
|
49
|
+
"noMicrophoneAccess": "No microphone access",
|
|
50
|
+
"noMicrophoneFound": "No microphone found",
|
|
51
|
+
"uploadFailed": "Upload failed. Please try again.",
|
|
52
|
+
"redoRecording": "Redo recording?",
|
|
53
|
+
"redo": "Redo",
|
|
54
|
+
"thisWillRemoveRecording": "This will remove your previous recording."
|
|
42
55
|
}
|
|
43
56
|
}
|
|
@@ -39,5 +39,18 @@
|
|
|
39
39
|
"volume": "Volume",
|
|
40
40
|
"weight": "Weight",
|
|
41
41
|
"time": "Time"
|
|
42
|
+
},
|
|
43
|
+
"voiceRecorder": {
|
|
44
|
+
"deleteRecording": "Delete recording?",
|
|
45
|
+
"youWontBeAbleToRecover": "You won't be able to recover this file once it's gone.",
|
|
46
|
+
"recordingDeleted": "Recording successfully deleted",
|
|
47
|
+
"delete": "Delete",
|
|
48
|
+
"cancel": "Cancel",
|
|
49
|
+
"noMicrophoneAccess": "No microphone access",
|
|
50
|
+
"noMicrophoneFound": "No microphone found",
|
|
51
|
+
"uploadFailed": "Upload failed. Please try again.",
|
|
52
|
+
"redoRecording": "Redo recording?",
|
|
53
|
+
"redo": "Redo",
|
|
54
|
+
"thisWillRemoveRecording": "This will remove your previous recording."
|
|
42
55
|
}
|
|
43
56
|
}
|
|
@@ -39,5 +39,18 @@
|
|
|
39
39
|
"volume": "Volym",
|
|
40
40
|
"weight": "Vikt",
|
|
41
41
|
"time": "Tid"
|
|
42
|
+
},
|
|
43
|
+
"voiceRecorder": {
|
|
44
|
+
"deleteRecording": "Radera inspelningen?",
|
|
45
|
+
"youWontBeAbleToRecover": "Du kommer inte att kunna återställa filen när den väl är borta.",
|
|
46
|
+
"recordingDeleted": "Recording deleted",
|
|
47
|
+
"delete": "Radera",
|
|
48
|
+
"cancel": "Avbryt",
|
|
49
|
+
"noMicrophoneAccess": "Ingen mikrofonåtkomst",
|
|
50
|
+
"noMicrophoneFound": "Ingen mikrofon hittades",
|
|
51
|
+
"uploadFailed": "Uppladdning misslyckades. Försök igen.",
|
|
52
|
+
"redoRecording": "Redo recording?",
|
|
53
|
+
"redo": "Redo",
|
|
54
|
+
"thisWillRemoveRecording": "This will remove your previous recording."
|
|
42
55
|
}
|
|
43
56
|
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { StyleProp, ViewStyle } from 'react-native';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { VoiceRecordModel } from '../model/VoiceRecord.model';
|
|
4
|
+
type VoiceRecordProps = {
|
|
5
|
+
style?: StyleProp<ViewStyle>;
|
|
6
|
+
model: VoiceRecordModel;
|
|
7
|
+
};
|
|
8
|
+
export declare const VoiceRecord: ({ style, model }: VoiceRecordProps) => React.JSX.Element;
|
|
9
|
+
export {};
|
|
10
|
+
//# sourceMappingURL=VoiceRecord.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"VoiceRecord.d.ts","sourceRoot":"","sources":["../../../../../../src/features/voiceRecord/components/VoiceRecord.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,SAAS,EAAc,MAAM,cAAc,CAAA;AAE/D,OAAO,KAAoB,MAAM,OAAO,CAAA;AAMxC,OAAO,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAA;AAK7D,KAAK,gBAAgB,GAAG;IACtB,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAA;IAC5B,KAAK,EAAE,gBAAgB,CAAA;CACxB,CAAA;AAED,eAAO,MAAM,WAAW,qBAAsB,gBAAgB,sBAoC7D,CAAA"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { ButtonStyle } from '@magmamath/react-native-ui';
|
|
3
|
+
import { VoiceRecordModel } from '../model/VoiceRecord.model';
|
|
4
|
+
type VoiceRecordButtonProps = {
|
|
5
|
+
style?: ButtonStyle;
|
|
6
|
+
disabled?: boolean;
|
|
7
|
+
model: VoiceRecordModel;
|
|
8
|
+
};
|
|
9
|
+
export declare const VoiceRecordButton: ({ style, disabled, model }: VoiceRecordButtonProps) => React.JSX.Element;
|
|
10
|
+
export {};
|
|
11
|
+
//# sourceMappingURL=VoiceRecordButton.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"VoiceRecordButton.d.ts","sourceRoot":"","sources":["../../../../../../src/features/voiceRecord/components/VoiceRecordButton.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAkB,MAAM,OAAO,CAAA;AACtC,OAAO,EAIL,WAAW,EAEZ,MAAM,4BAA4B,CAAA;AAGnC,OAAO,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAA;AAK7D,KAAK,sBAAsB,GAAG;IAC5B,KAAK,CAAC,EAAE,WAAW,CAAA;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,KAAK,EAAE,gBAAgB,CAAA;CACxB,CAAA;AAED,eAAO,MAAM,iBAAiB,+BAAgC,sBAAsB,sBAgEnF,CAAA"}
|
package/dist/typescript/commonjs/features/voiceRecord/components/VoiceRecordDeleteButton.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"VoiceRecordDeleteButton.d.ts","sourceRoot":"","sources":["../../../../../../src/features/voiceRecord/components/VoiceRecordDeleteButton.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,KAAK,sBAAsB,GAAG;IAC5B,OAAO,CAAC,EAAE,MAAM,IAAI,CAAA;CACrB,CAAA;AAED,eAAO,MAAM,uBAAuB,gBAAiB,sBAAsB,sBAM1E,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"VoiceRecordDevider.d.ts","sourceRoot":"","sources":["../../../../../../src/features/voiceRecord/components/VoiceRecordDevider.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAA;AAGzB,eAAO,MAAM,kBAAkB,yBAE9B,CAAA"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { StyleProp, ViewStyle } from 'react-native';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { VoiceRecordModel } from '../model/VoiceRecord.model';
|
|
4
|
+
type VoiceRecordTimerProps = {
|
|
5
|
+
style?: StyleProp<ViewStyle>;
|
|
6
|
+
model: VoiceRecordModel;
|
|
7
|
+
recordingFileDurationMs?: number;
|
|
8
|
+
};
|
|
9
|
+
export declare const VoiceRecordTimer: ({ style, model, recordingFileDurationMs, }: VoiceRecordTimerProps) => React.JSX.Element;
|
|
10
|
+
export default VoiceRecordTimer;
|
|
11
|
+
//# sourceMappingURL=VoiceRecordTimer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"VoiceRecordTimer.d.ts","sourceRoot":"","sources":["../../../../../../src/features/voiceRecord/components/VoiceRecordTimer.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAoB,SAAS,EAAE,MAAM,cAAc,CAAA;AAErE,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAA;AAI7D,KAAK,qBAAqB,GAAG;IAC3B,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAA;IAC5B,KAAK,EAAE,gBAAgB,CAAA;IACvB,uBAAuB,CAAC,EAAE,MAAM,CAAA;CACjC,CAAA;AAED,eAAO,MAAM,gBAAgB,+CAI1B,qBAAqB,sBAcvB,CAAA;AAED,eAAe,gBAAgB,CAAA"}
|