@bigbinary/neeto-media-recorder 1.3.1 → 1.3.3
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 +157 -123
- package/constants.js +2 -1
- package/constants.js.map +1 -1
- package/core.js +27 -2
- package/core.js.map +1 -1
- package/index.js +39 -9
- package/index.js.map +1 -1
- package/package.json +1 -1
- package/src/translations/en.json +2 -1
package/index.js
CHANGED
|
@@ -507,8 +507,11 @@ var AbortUpload = withT(function (_ref) {
|
|
|
507
507
|
}, /*#__PURE__*/React.createElement("div", {
|
|
508
508
|
className: "flex h-full w-full flex-col items-center justify-start space-y-4 py-10 2xl:py-20"
|
|
509
509
|
}, /*#__PURE__*/React.createElement(Typography, {
|
|
510
|
-
style: "h3"
|
|
511
|
-
|
|
510
|
+
style: "h3",
|
|
511
|
+
"data-cy": "recorder-discarding-recording-message"
|
|
512
|
+
}, t("neetoMediaRecorder.record.discardingVideo")), /*#__PURE__*/React.createElement(Typography, {
|
|
513
|
+
"data-cy": "recorder-do-not-leave-page-message"
|
|
514
|
+
}, t("neetoMediaRecorder.record.doNotLeaveThePage")), /*#__PURE__*/React.createElement(Spinner, null)));
|
|
512
515
|
});
|
|
513
516
|
|
|
514
517
|
function _toPrimitive(input, hint) {
|
|
@@ -687,6 +690,7 @@ var Controls = function Controls(_ref) {
|
|
|
687
690
|
}, className, isNotEmpty(classNames)))
|
|
688
691
|
}, shouldShowRecordButton && /*#__PURE__*/React.createElement(Button, {
|
|
689
692
|
className: "flex-shrink-0",
|
|
693
|
+
"data-cy": "media-recorder-record-button",
|
|
690
694
|
icon: function icon() {
|
|
691
695
|
return /*#__PURE__*/React.createElement(PlayIcon, {
|
|
692
696
|
size: 28
|
|
@@ -698,6 +702,7 @@ var Controls = function Controls(_ref) {
|
|
|
698
702
|
onClick: startRecording
|
|
699
703
|
}), isStatus(SCREEN_RECORDER_STATUS.recording) && /*#__PURE__*/React.createElement(Button, {
|
|
700
704
|
className: "flex-shrink-0",
|
|
705
|
+
"data-cy": "media-recorder-pause-button",
|
|
701
706
|
size: "large",
|
|
702
707
|
style: "text",
|
|
703
708
|
icon: function icon() {
|
|
@@ -718,6 +723,7 @@ var Controls = function Controls(_ref) {
|
|
|
718
723
|
size: 28
|
|
719
724
|
});
|
|
720
725
|
},
|
|
726
|
+
"data-cy": "media-recorder-play-button",
|
|
721
727
|
size: "large",
|
|
722
728
|
style: "text",
|
|
723
729
|
tooltipProps: {
|
|
@@ -729,6 +735,7 @@ var Controls = function Controls(_ref) {
|
|
|
729
735
|
className: "flex items-center gap-3"
|
|
730
736
|
}, /*#__PURE__*/React.createElement(Button, {
|
|
731
737
|
className: "flex-shrink-0",
|
|
738
|
+
"data-cy": "media-recorder-restart-button",
|
|
732
739
|
icon: function icon() {
|
|
733
740
|
return /*#__PURE__*/React.createElement(RestartIcon, {
|
|
734
741
|
size: 28
|
|
@@ -745,6 +752,7 @@ var Controls = function Controls(_ref) {
|
|
|
745
752
|
}
|
|
746
753
|
}), /*#__PURE__*/React.createElement(Button, {
|
|
747
754
|
className: "flex-shrink-0",
|
|
755
|
+
"data-cy": "media-recorder-discard-button",
|
|
748
756
|
size: "large",
|
|
749
757
|
style: "text",
|
|
750
758
|
icon: function icon() {
|
|
@@ -764,6 +772,7 @@ var Controls = function Controls(_ref) {
|
|
|
764
772
|
className: "neeto-ui-bg-gray-200 h-4 w-0.5"
|
|
765
773
|
}), /*#__PURE__*/React.createElement(Button, {
|
|
766
774
|
className: "flex-shrink-0",
|
|
775
|
+
"data-cy": "media-recorder-stop-button",
|
|
767
776
|
icon: function icon() {
|
|
768
777
|
return /*#__PURE__*/React.createElement(StopIcon, {
|
|
769
778
|
size: 28
|
|
@@ -840,15 +849,18 @@ var Timer = function Timer() {
|
|
|
840
849
|
}, shallow),
|
|
841
850
|
elapsedTime = _useRecorderStore.elapsedTime;
|
|
842
851
|
return /*#__PURE__*/React.createElement("div", {
|
|
843
|
-
className: "mb-4 flex flex-col items-center justify-center"
|
|
852
|
+
className: "mb-4 flex flex-col items-center justify-center",
|
|
853
|
+
"data-cy": "recorder-timer-wrapper"
|
|
844
854
|
}, /*#__PURE__*/React.createElement(Typography, {
|
|
845
855
|
className: "neeto-ui-text-4xl mb-3 flex justify-center",
|
|
846
856
|
weight: "semibold"
|
|
847
857
|
}, getTimeString(elapsedTime)), /*#__PURE__*/React.createElement(Typography, {
|
|
848
858
|
className: "mb-2",
|
|
859
|
+
"data-cy": "recorder-recording-in-progress-message",
|
|
849
860
|
style: "h3"
|
|
850
861
|
}, t("neetoMediaRecorder.record.inProgress")), /*#__PURE__*/React.createElement(Typography, {
|
|
851
|
-
style: "body2"
|
|
862
|
+
style: "body2",
|
|
863
|
+
"data-cy": "recorder-do-not-leave-page-message"
|
|
852
864
|
}, t("neetoMediaRecorder.record.doNotLeaveThePage")));
|
|
853
865
|
};
|
|
854
866
|
|
|
@@ -858,6 +870,7 @@ var UnSupportedBrowser = withT(function (_ref) {
|
|
|
858
870
|
className: "flex h-screen w-full items-center justify-center"
|
|
859
871
|
}, /*#__PURE__*/React.createElement(Callout, {
|
|
860
872
|
className: "p-5",
|
|
873
|
+
"data-cy": "recorder-unsupported-browser-callout",
|
|
861
874
|
style: "danger"
|
|
862
875
|
}, t("neetoMediaRecorder.unsupportedBrowser")));
|
|
863
876
|
});
|
|
@@ -903,20 +916,26 @@ var UploadingInProgress = function UploadingInProgress(_ref) {
|
|
|
903
916
|
}, /*#__PURE__*/React.createElement("div", {
|
|
904
917
|
className: "mt-2 flex space-x-3"
|
|
905
918
|
}, /*#__PURE__*/React.createElement(Typography, {
|
|
919
|
+
"data-cy": "recorder-uploading-recording-message",
|
|
906
920
|
style: "h3"
|
|
907
|
-
}, t("neetoMediaRecorder.record.uploadingRecording")), /*#__PURE__*/React.createElement(Spinner, null)), /*#__PURE__*/React.createElement(Typography,
|
|
921
|
+
}, t("neetoMediaRecorder.record.uploadingRecording")), /*#__PURE__*/React.createElement(Spinner, null)), /*#__PURE__*/React.createElement(Typography, {
|
|
922
|
+
"data-cy": "recorder-do-not-leave-page-message"
|
|
923
|
+
}, t("neetoMediaRecorder.record.doNotLeaveThePage")), /*#__PURE__*/React.createElement("div", {
|
|
908
924
|
className: "mt-6 flex items-center space-x-4"
|
|
909
925
|
}, /*#__PURE__*/React.createElement(CopyToClipboardButton, {
|
|
926
|
+
"data-cy": "recorder-recording-link-copy-button",
|
|
910
927
|
icon: Copy,
|
|
911
928
|
label: t("neetoMediaRecorder.record.copyToClipboard"),
|
|
912
929
|
style: "primary",
|
|
913
930
|
value: generatePublicUrl(recording.id, baseURL)
|
|
914
931
|
}), /*#__PURE__*/React.createElement(Button, {
|
|
932
|
+
"data-cy": "recorder-download-webm-button",
|
|
915
933
|
icon: Download,
|
|
916
934
|
label: t("neetoMediaRecorder.record.downloadWebm"),
|
|
917
935
|
style: "secondary",
|
|
918
936
|
onClick: handleRecordingBlobDownload
|
|
919
937
|
}), /*#__PURE__*/React.createElement(Button, {
|
|
938
|
+
"data-cy": "recorder-discard-recording-button",
|
|
920
939
|
icon: Close,
|
|
921
940
|
label: t("neetoMediaRecorder.record.discardRecording"),
|
|
922
941
|
style: "secondary",
|
|
@@ -958,12 +977,14 @@ var MediaRecorder = function MediaRecorder(_ref, ref) {
|
|
|
958
977
|
return {
|
|
959
978
|
status: store["status"],
|
|
960
979
|
error: store["error"],
|
|
961
|
-
countdownTimeLeft: store["countdownTimeLeft"]
|
|
980
|
+
countdownTimeLeft: store["countdownTimeLeft"],
|
|
981
|
+
showTimeLimitWarning: store["showTimeLimitWarning"]
|
|
962
982
|
};
|
|
963
983
|
}, shallow),
|
|
964
984
|
recorderStatus = _useRecorderStore.status,
|
|
965
985
|
error = _useRecorderStore.error,
|
|
966
|
-
countdownTimeLeft = _useRecorderStore.countdownTimeLeft
|
|
986
|
+
countdownTimeLeft = _useRecorderStore.countdownTimeLeft,
|
|
987
|
+
showTimeLimitWarning = _useRecorderStore.showTimeLimitWarning;
|
|
967
988
|
var _useMultipartS3Upload = useMultipartS3UploadStore(function (store) {
|
|
968
989
|
return {
|
|
969
990
|
status: store["status"]
|
|
@@ -974,6 +995,7 @@ var MediaRecorder = function MediaRecorder(_ref, ref) {
|
|
|
974
995
|
isRecorderStatus = _useRecorderStatus.isStatus;
|
|
975
996
|
var _useMultipartS3Upload2 = useMultipartS3UploadStatus(),
|
|
976
997
|
isUploadStatus = _useMultipartS3Upload2.isStatus;
|
|
998
|
+
var shouldShowTimeLimitWarning = showTimeLimitWarning && isRecorderStatus(SCREEN_RECORDER_STATUS.recording, SCREEN_RECORDER_STATUS.paused);
|
|
977
999
|
var _useCreateRecording = useCreateRecording({
|
|
978
1000
|
onSuccess: function onSuccess(_ref2) {
|
|
979
1001
|
var recording = _ref2.recording,
|
|
@@ -1121,6 +1143,7 @@ var MediaRecorder = function MediaRecorder(_ref, ref) {
|
|
|
1121
1143
|
className: classNames("w-full max-w-3xl")
|
|
1122
1144
|
}, error === SCREEN_RECORDER_ERROR.NotAllowedError && /*#__PURE__*/React.createElement(Callout, {
|
|
1123
1145
|
className: "mb-2 p-3",
|
|
1146
|
+
"data-cy": "recorder-permission-denied-danger-callout",
|
|
1124
1147
|
style: "danger"
|
|
1125
1148
|
}, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Trans, {
|
|
1126
1149
|
i18nKey: "neetoMediaRecorder.record.permissionDeniedMessage",
|
|
@@ -1134,12 +1157,19 @@ var MediaRecorder = function MediaRecorder(_ref, ref) {
|
|
|
1134
1157
|
}
|
|
1135
1158
|
}))), isRecorderStatus(SCREEN_RECORDER_STATUS.acquiring_media) && /*#__PURE__*/React.createElement(Callout, {
|
|
1136
1159
|
className: "mb-2 p-3",
|
|
1160
|
+
"data-cy": "recorder-grant-permission-info-callout",
|
|
1137
1161
|
style: "info"
|
|
1138
1162
|
}, t("neetoMediaRecorder.record.grantPermissionMessage")), shouldShowSafariExtensionCalloutToStartRecording && /*#__PURE__*/React.createElement(Callout, {
|
|
1139
1163
|
className: "mx-auto mb-2 w-1/2 p-3",
|
|
1164
|
+
"data-cy": "recorder-start-recording-info-callout",
|
|
1140
1165
|
style: "info"
|
|
1141
|
-
}, t("neetoMediaRecorder.record.clickToStartRecording")),
|
|
1142
|
-
className: "
|
|
1166
|
+
}, t("neetoMediaRecorder.record.clickToStartRecording")), shouldShowTimeLimitWarning && /*#__PURE__*/React.createElement(Callout, {
|
|
1167
|
+
className: "mx-auto mb-2 w-1/2 p-3",
|
|
1168
|
+
"data-cy": "recorder-time-limit-warning-callout",
|
|
1169
|
+
style: "warning"
|
|
1170
|
+
}, t("neetoMediaRecorder.record.timeLimitWarning")), isRecorderStatus(SCREEN_RECORDER_STATUS.media_acquired, SCREEN_RECORDER_STATUS.restarting) && /*#__PURE__*/React.createElement("div", {
|
|
1171
|
+
className: " mx-auto flex flex-col items-center justify-center space-y-4",
|
|
1172
|
+
"data-cy": "recorder-countdown-wrapper"
|
|
1143
1173
|
}, /*#__PURE__*/React.createElement(Typography, {
|
|
1144
1174
|
style: "h3"
|
|
1145
1175
|
}, t("neetoMediaRecorder.record.startsIn")), /*#__PURE__*/React.createElement(Typography, {
|