@seafile/sdoc-editor 3.0.244 → 3.0.245
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.
|
@@ -95,10 +95,10 @@ var InsertElementDialog = function InsertElementDialog(_ref) {
|
|
|
95
95
|
}
|
|
96
96
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
97
97
|
}, [validEditor, uploadLocalImageInputRef, insertPosition, slateNode]);
|
|
98
|
-
var handleDisplayAlert = (0, _react.useCallback)(function (
|
|
98
|
+
var handleDisplayAlert = (0, _react.useCallback)(function () {
|
|
99
99
|
setTimeout(function () {
|
|
100
100
|
_toast["default"].warning(t('The_video_file_exceeds_the_size_limit', {
|
|
101
|
-
size: (0, _index3.formatSeadocVideoSizeLimit)(
|
|
101
|
+
size: (0, _index3.formatSeadocVideoSizeLimit)()
|
|
102
102
|
}), {
|
|
103
103
|
duration: 3
|
|
104
104
|
});
|
|
@@ -106,10 +106,10 @@ var InsertElementDialog = function InsertElementDialog(_ref) {
|
|
|
106
106
|
}, [t]);
|
|
107
107
|
var onVideoFileChanged = (0, _react.useCallback)(function (event) {
|
|
108
108
|
var files = event.target.files;
|
|
109
|
-
var videoSizeLimit =
|
|
110
|
-
// Show warning for 3s and no further insertion if the video file exceeds the
|
|
109
|
+
var videoSizeLimit = _index3.SEADOC_VIDEO_SIZE_LIMIT;
|
|
110
|
+
// Show warning for 3s and no further insertion if the video file exceeds the default limit.
|
|
111
111
|
if (files[0].size > videoSizeLimit) {
|
|
112
|
-
handleDisplayAlert(
|
|
112
|
+
handleDisplayAlert();
|
|
113
113
|
event.target.value = null;
|
|
114
114
|
return;
|
|
115
115
|
}
|
|
@@ -3,15 +3,12 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.
|
|
7
|
-
var SEADOC_VIDEO_SIZE_LIMIT = exports.SEADOC_VIDEO_SIZE_LIMIT =
|
|
8
|
-
var
|
|
9
|
-
var
|
|
10
|
-
return Number.isFinite(parsedSizeLimit) && parsedSizeLimit > 0 ? parsedSizeLimit : SEADOC_VIDEO_SIZE_LIMIT;
|
|
11
|
-
};
|
|
12
|
-
var formatSeadocVideoSizeLimit = exports.formatSeadocVideoSizeLimit = function formatSeadocVideoSizeLimit(sizeLimit) {
|
|
6
|
+
exports.formatSeadocVideoSizeLimit = exports.SEADOC_VIDEO_SIZE_LIMIT = exports.ONE_MB = exports.ONE_KB = exports.ONE_GB = void 0;
|
|
7
|
+
var SEADOC_VIDEO_SIZE_LIMIT = exports.SEADOC_VIDEO_SIZE_LIMIT = 100 * 1024 * 1024;
|
|
8
|
+
var formatSeadocVideoSizeLimit = exports.formatSeadocVideoSizeLimit = function formatSeadocVideoSizeLimit() {
|
|
9
|
+
var sizeLimit = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : SEADOC_VIDEO_SIZE_LIMIT;
|
|
13
10
|
var units = ['B', 'KB', 'MB', 'GB', 'TB'];
|
|
14
|
-
var formattedSize =
|
|
11
|
+
var formattedSize = sizeLimit;
|
|
15
12
|
var unitIndex = 0;
|
|
16
13
|
while (formattedSize >= 1024 && unitIndex < units.length - 1) {
|
|
17
14
|
formattedSize /= 1024;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@seafile/sdoc-editor",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.245",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"test": "jest",
|
|
@@ -71,5 +71,5 @@
|
|
|
71
71
|
"publishConfig": {
|
|
72
72
|
"access": "public"
|
|
73
73
|
},
|
|
74
|
-
"gitHead": "
|
|
74
|
+
"gitHead": "5923b1242461ceefc159405339b40a622343e318"
|
|
75
75
|
}
|