@zohodesk/dot 1.0.0-temp-200.6 → 1.0.0-temp-210
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/.cli/propValidation_report.html +1 -1
- package/es/Attachment/Attachment.module.css +3 -7
- package/es/AttachmentViewer/Attachment.js +3 -208
- package/es/AttachmentViewer/AttachmentViewer.js +24 -81
- package/es/AttachmentViewer/AttachmentViewer.module.css +9 -55
- package/es/AttachmentViewer/props/propTypes.js +1 -3
- package/es/AttachmentViewer/utils.js +2 -36
- package/es/Drawer/Drawer.js +4 -2
- package/es/Drawer/props/defaultProps.js +2 -1
- package/es/Drawer/props/propTypes.js +2 -1
- package/es/FreezeLayer/FreezeLayer.js +6 -3
- package/es/FreezeLayer/props/defaultProps.js +2 -1
- package/es/FreezeLayer/props/propTypes.js +2 -1
- package/es/common/dot_common.module.css +4 -0
- package/es/utils/General.js +1 -23
- package/lib/Attachment/Attachment.module.css +3 -7
- package/lib/AttachmentViewer/Attachment.js +3 -226
- package/lib/AttachmentViewer/AttachmentViewer.js +21 -82
- package/lib/AttachmentViewer/AttachmentViewer.module.css +9 -55
- package/lib/AttachmentViewer/props/propTypes.js +1 -3
- package/lib/AttachmentViewer/utils.js +1 -47
- package/lib/Drawer/Drawer.js +4 -2
- package/lib/Drawer/props/defaultProps.js +2 -1
- package/lib/Drawer/props/propTypes.js +2 -1
- package/lib/FreezeLayer/FreezeLayer.js +6 -3
- package/lib/FreezeLayer/props/defaultProps.js +2 -1
- package/lib/FreezeLayer/props/propTypes.js +2 -1
- package/lib/common/dot_common.module.css +4 -0
- package/lib/utils/General.js +1 -25
- package/package.json +4 -4
- package/result.json +0 -1
- package/unittest/index.html +0 -41
|
@@ -7,9 +7,6 @@ exports.ZoomEvent = exports.Zoom = void 0;
|
|
|
7
7
|
exports.checkAudioUrlValidity = checkAudioUrlValidity;
|
|
8
8
|
exports.checkFileSourcesValidation = checkFileSourcesValidation;
|
|
9
9
|
exports.checkImageValidity = checkImageValidity;
|
|
10
|
-
exports.checkVideoUrlValidity = checkVideoUrlValidity;
|
|
11
|
-
exports.getFrameOrigin = getFrameOrigin;
|
|
12
|
-
exports.isValidDocument = isValidDocument;
|
|
13
10
|
|
|
14
11
|
var _Attachment = require("./Attachment");
|
|
15
12
|
|
|
@@ -156,21 +153,6 @@ function checkImageValidity(src) {
|
|
|
156
153
|
});
|
|
157
154
|
}
|
|
158
155
|
|
|
159
|
-
function checkVideoUrlValidity(url) {
|
|
160
|
-
return new Promise(function (resolve) {
|
|
161
|
-
var video = document.createElement('video');
|
|
162
|
-
video.src = url;
|
|
163
|
-
|
|
164
|
-
video.oncanplaythrough = function () {
|
|
165
|
-
return resolve(true);
|
|
166
|
-
};
|
|
167
|
-
|
|
168
|
-
video.onerror = function () {
|
|
169
|
-
return resolve(false);
|
|
170
|
-
};
|
|
171
|
-
});
|
|
172
|
-
}
|
|
173
|
-
|
|
174
156
|
function checkAudioUrlValidity(url) {
|
|
175
157
|
return new Promise(function (resolve) {
|
|
176
158
|
var audio = new Audio(url);
|
|
@@ -187,19 +169,9 @@ function checkAudioUrlValidity(url) {
|
|
|
187
169
|
|
|
188
170
|
;
|
|
189
171
|
|
|
190
|
-
function isValidDocument(url) {
|
|
191
|
-
if (!url) {
|
|
192
|
-
return false;
|
|
193
|
-
}
|
|
194
|
-
|
|
195
|
-
return true;
|
|
196
|
-
}
|
|
197
|
-
|
|
198
172
|
function checkFileSourcesValidation(_ref) {
|
|
199
173
|
var fileName = _ref.fileName,
|
|
200
|
-
viewURL = _ref.viewURL
|
|
201
|
-
previewUrl = _ref.previewUrl;
|
|
202
|
-
var documentTypes = (0, _Attachment.isDocsFile)(fileName) || (0, _Attachment.isSheetFile)(fileName) || (0, _Attachment.isPresentationFile)(fileName) || (0, _Attachment.isPdfFile)(fileName) || (0, _Attachment.isEmailFile)(fileName);
|
|
174
|
+
viewURL = _ref.viewURL;
|
|
203
175
|
|
|
204
176
|
if ((0, _Attachment.isAudioFile)(fileName)) {
|
|
205
177
|
var audioValidityPromise = checkAudioUrlValidity(viewURL);
|
|
@@ -209,20 +181,6 @@ function checkFileSourcesValidation(_ref) {
|
|
|
209
181
|
canZoom: false
|
|
210
182
|
};
|
|
211
183
|
});
|
|
212
|
-
} else if ((0, _Attachment.isVideoFile)(fileName)) {
|
|
213
|
-
var videoValidityPromise = checkVideoUrlValidity(viewURL);
|
|
214
|
-
return videoValidityPromise.then(function (isURLValid) {
|
|
215
|
-
return {
|
|
216
|
-
isViewURLValid: isURLValid,
|
|
217
|
-
canZoom: false
|
|
218
|
-
};
|
|
219
|
-
});
|
|
220
|
-
} else if (documentTypes && isValidDocument(previewUrl)) {
|
|
221
|
-
var isValid = isValidDocument(previewUrl);
|
|
222
|
-
return Promise.resolve({
|
|
223
|
-
isViewURLValid: isValid,
|
|
224
|
-
canZoom: false
|
|
225
|
-
});
|
|
226
184
|
} else {
|
|
227
185
|
var imageValidityPromise = checkImageValidity(viewURL);
|
|
228
186
|
return imageValidityPromise.then(function (isURLValid) {
|
|
@@ -232,8 +190,4 @@ function checkFileSourcesValidation(_ref) {
|
|
|
232
190
|
};
|
|
233
191
|
});
|
|
234
192
|
}
|
|
235
|
-
}
|
|
236
|
-
|
|
237
|
-
function getFrameOrigin() {
|
|
238
|
-
return new URL(window.location.href).origin;
|
|
239
193
|
}
|
package/lib/Drawer/Drawer.js
CHANGED
|
@@ -345,7 +345,8 @@ var Drawer = /*#__PURE__*/function (_React$Component4) {
|
|
|
345
345
|
subDrawerActive = _this$props5.subDrawerActive,
|
|
346
346
|
customClass = _this$props5.customClass,
|
|
347
347
|
needAutoZindex = _this$props5.needAutoZindex,
|
|
348
|
-
innerPortalName = _this$props5.innerPortalName
|
|
348
|
+
innerPortalName = _this$props5.innerPortalName,
|
|
349
|
+
onEnterComplete = _this$props5.onEnterComplete;
|
|
349
350
|
var zindexNumber = isActive ? this.getNextIndex() : '';
|
|
350
351
|
return /*#__PURE__*/_react["default"].createElement(_CustomResponsive.ResponsiveReceiver, {
|
|
351
352
|
query: this.responsiveFunc,
|
|
@@ -361,7 +362,8 @@ var Drawer = /*#__PURE__*/function (_React$Component4) {
|
|
|
361
362
|
palette: palette,
|
|
362
363
|
forwardRef: forwardRef,
|
|
363
364
|
customClass: customClass,
|
|
364
|
-
needAutoZindex: needAutoZindex
|
|
365
|
+
needAutoZindex: needAutoZindex,
|
|
366
|
+
onEnterComplete: onEnterComplete
|
|
365
367
|
}, /*#__PURE__*/_react["default"].createElement(_Layout.Box, {
|
|
366
368
|
flexible: true
|
|
367
369
|
}, /*#__PURE__*/_react["default"].createElement(_Layout.Container, {
|
|
@@ -63,6 +63,7 @@ var Drawer_propTypes = {
|
|
|
63
63
|
needFocusScope: _propTypes["default"].bool,
|
|
64
64
|
customProps: _propTypes["default"].object,
|
|
65
65
|
innerPortalName: _propTypes["default"].string,
|
|
66
|
-
a11y: _propTypes["default"].object
|
|
66
|
+
a11y: _propTypes["default"].object,
|
|
67
|
+
onEnterComplete: _propTypes["default"].oneOfType([_propTypes["default"].object, _propTypes["default"].func])
|
|
67
68
|
};
|
|
68
69
|
exports.Drawer_propTypes = Drawer_propTypes;
|
|
@@ -39,7 +39,8 @@ function FreezeLayer(props) {
|
|
|
39
39
|
forwardRef = props.forwardRef,
|
|
40
40
|
isSvgMask = props.isSvgMask,
|
|
41
41
|
needAutoZindex = props.needAutoZindex,
|
|
42
|
-
customStyle = props.customStyle
|
|
42
|
+
customStyle = props.customStyle,
|
|
43
|
+
onEnterComplete = props.onEnterComplete;
|
|
43
44
|
var finalStyle = (0, _utils.mergeStyle)(_FreezeLayerModule["default"], customStyle);
|
|
44
45
|
|
|
45
46
|
var _cssJSLogic = (0, _cssJSLogic2["default"])({
|
|
@@ -61,7 +62,8 @@ function FreezeLayer(props) {
|
|
|
61
62
|
return /*#__PURE__*/_react["default"].createElement(_VelocityAnimationGroup["default"], {
|
|
62
63
|
name: animationName && animationName,
|
|
63
64
|
isActive: isActive,
|
|
64
|
-
runOnMount: runOnMount
|
|
65
|
+
runOnMount: runOnMount,
|
|
66
|
+
onEnterComplete: onEnterComplete
|
|
65
67
|
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
66
68
|
style: isActive && needAutoZindex ? {
|
|
67
69
|
zIndex: "".concat(getNextIndex())
|
|
@@ -77,7 +79,8 @@ function FreezeLayer(props) {
|
|
|
77
79
|
component: _Layout.Container,
|
|
78
80
|
alignBox: "row",
|
|
79
81
|
align: align,
|
|
80
|
-
dataId: "reactFreezeLayer"
|
|
82
|
+
dataId: "reactFreezeLayer",
|
|
83
|
+
onEnterComplete: onEnterComplete
|
|
81
84
|
}, children) : isSvgMask ? /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, children) : /*#__PURE__*/_react["default"].createElement(_Layout.Container, {
|
|
82
85
|
alignBox: "row",
|
|
83
86
|
align: align,
|
|
@@ -24,7 +24,8 @@ var propTypes = {
|
|
|
24
24
|
palette: _propTypes["default"].oneOf(['dark', 'default', 'darkLight', 'plain', 'snow']),
|
|
25
25
|
runOnMount: _propTypes["default"].bool,
|
|
26
26
|
customStyle: _propTypes["default"].object,
|
|
27
|
-
zIndex: _propTypes["default"].oneOf(['3', '5', '7', '10'])
|
|
27
|
+
zIndex: _propTypes["default"].oneOf(['3', '5', '7', '10']),
|
|
28
|
+
onEnterComplete: _propTypes["default"].oneOfType([_propTypes["default"].object, _propTypes["default"].func])
|
|
28
29
|
};
|
|
29
30
|
exports.propTypes = propTypes;
|
|
30
31
|
var _default = propTypes;
|
package/lib/utils/General.js
CHANGED
|
@@ -5,7 +5,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.DUMMY_OBJECT = void 0;
|
|
7
7
|
exports.formatPhoneUrl = formatPhoneUrl;
|
|
8
|
-
exports.getBrowserWithVersion = getBrowserWithVersion;
|
|
9
8
|
exports.getFullName = getFullName;
|
|
10
9
|
exports.shallowDiff = shallowDiff;
|
|
11
10
|
exports.stopBubbling = stopBubbling;
|
|
@@ -60,27 +59,4 @@ function formatPhoneUrl(phone) {
|
|
|
60
59
|
}
|
|
61
60
|
|
|
62
61
|
var DUMMY_OBJECT = Object.freeze({});
|
|
63
|
-
exports.DUMMY_OBJECT = DUMMY_OBJECT;
|
|
64
|
-
|
|
65
|
-
function getBrowserWithVersion() {
|
|
66
|
-
var userAgent = navigator.userAgent;
|
|
67
|
-
var tempMatch;
|
|
68
|
-
var browserMatch = userAgent.match(/(opera|chrome|safari|firefox|msie|trident(?=\/))\/?\s*([\d\.]+)/i) || [];
|
|
69
|
-
|
|
70
|
-
if (userAgent.toLowerCase().indexOf('edge') !== -1) {
|
|
71
|
-
return userAgent.substring(userAgent.toLowerCase().indexOf('edge'));
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
if (/trident/i.test(browserMatch[1])) {
|
|
75
|
-
tempMatch = /\brv[ :]+(\d+(\.\d+)?)/g.exec(userAgent) || [];
|
|
76
|
-
return "IE ".concat(tempMatch[1] || '');
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
browserMatch = browserMatch[2] ? [browserMatch[1], browserMatch[2]] : [navigator.appName, navigator.appVersion, '-?'];
|
|
80
|
-
|
|
81
|
-
if ((tempMatch = userAgent.match(/version\/([\.\d]+)/i)) !== null) {
|
|
82
|
-
browserMatch[2] = tempMatch[1];
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
return browserMatch.join(' ');
|
|
86
|
-
}
|
|
62
|
+
exports.DUMMY_OBJECT = DUMMY_OBJECT;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zohodesk/dot",
|
|
3
|
-
"version": "1.0.0-temp-
|
|
3
|
+
"version": "1.0.0-temp-210",
|
|
4
4
|
"main": "lib/index",
|
|
5
5
|
"module": "es/index.js",
|
|
6
6
|
"private": false,
|
|
@@ -59,11 +59,11 @@
|
|
|
59
59
|
"@testing-library/react-hooks": "^7.0.2",
|
|
60
60
|
"@testing-library/user-event": "^13.0.10",
|
|
61
61
|
"@zohodesk-private/color-variable-preprocessor": "1.2.0",
|
|
62
|
-
"@zohodesk-private/css-variable-migrator": "^1.0.
|
|
62
|
+
"@zohodesk-private/css-variable-migrator": "^1.0.8",
|
|
63
63
|
"@zohodesk-private/node-plugins": "1.1.8",
|
|
64
64
|
"@zohodesk-private/react-prop-validator": "1.2.3",
|
|
65
65
|
"@zohodesk/a11y": "2.3.4",
|
|
66
|
-
"@zohodesk/components": "1.
|
|
66
|
+
"@zohodesk/components": "1.0.0-temp-223",
|
|
67
67
|
"@zohodesk/hooks": "2.0.5",
|
|
68
68
|
"@zohodesk/icons": "1.0.75",
|
|
69
69
|
"@zohodesk/layout": "^3.1.0",
|
|
@@ -77,7 +77,7 @@
|
|
|
77
77
|
"peerDependencies": {
|
|
78
78
|
"velocity-react": "1.4.3",
|
|
79
79
|
"@zohodesk/variables": "1.0.0",
|
|
80
|
-
"@zohodesk/components": "1.
|
|
80
|
+
"@zohodesk/components": "1.0.0-temp-223",
|
|
81
81
|
"@zohodesk/icons": "1.0.75",
|
|
82
82
|
"@zohodesk/svg": "1.1.22",
|
|
83
83
|
"@zohodesk/virtualizer": "1.0.3",
|