@zohodesk/dot 1.0.0-temp-200.6 → 1.0.0-temp-210.1

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.
Files changed (32) hide show
  1. package/.cli/propValidation_report.html +1 -1
  2. package/es/Attachment/Attachment.module.css +3 -7
  3. package/es/AttachmentViewer/Attachment.js +3 -208
  4. package/es/AttachmentViewer/AttachmentViewer.js +24 -81
  5. package/es/AttachmentViewer/AttachmentViewer.module.css +9 -55
  6. package/es/AttachmentViewer/props/propTypes.js +1 -3
  7. package/es/AttachmentViewer/utils.js +2 -36
  8. package/es/Drawer/Drawer.js +10 -2
  9. package/es/Drawer/props/defaultProps.js +5 -1
  10. package/es/Drawer/props/propTypes.js +5 -1
  11. package/es/FreezeLayer/FreezeLayer.js +11 -3
  12. package/es/FreezeLayer/props/defaultProps.js +5 -1
  13. package/es/FreezeLayer/props/propTypes.js +5 -1
  14. package/es/common/dot_common.module.css +4 -0
  15. package/es/utils/General.js +1 -23
  16. package/lib/Attachment/Attachment.module.css +3 -7
  17. package/lib/AttachmentViewer/Attachment.js +3 -226
  18. package/lib/AttachmentViewer/AttachmentViewer.js +21 -82
  19. package/lib/AttachmentViewer/AttachmentViewer.module.css +9 -55
  20. package/lib/AttachmentViewer/props/propTypes.js +1 -3
  21. package/lib/AttachmentViewer/utils.js +1 -47
  22. package/lib/Drawer/Drawer.js +10 -2
  23. package/lib/Drawer/props/defaultProps.js +5 -1
  24. package/lib/Drawer/props/propTypes.js +5 -1
  25. package/lib/FreezeLayer/FreezeLayer.js +11 -3
  26. package/lib/FreezeLayer/props/defaultProps.js +5 -1
  27. package/lib/FreezeLayer/props/propTypes.js +5 -1
  28. package/lib/common/dot_common.module.css +4 -0
  29. package/lib/utils/General.js +1 -25
  30. package/package.json +4 -4
  31. package/result.json +0 -1
  32. 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
  }
@@ -345,7 +345,11 @@ 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
+ onParentAnimateComplete = _this$props5.onParentAnimateComplete,
350
+ onChildAnimateComplete = _this$props5.onChildAnimateComplete,
351
+ postAnimateParentStyles = _this$props5.postAnimateParentStyles,
352
+ postAnimateChildStyles = _this$props5.postAnimateChildStyles;
349
353
  var zindexNumber = isActive ? this.getNextIndex() : '';
350
354
  return /*#__PURE__*/_react["default"].createElement(_CustomResponsive.ResponsiveReceiver, {
351
355
  query: this.responsiveFunc,
@@ -361,7 +365,11 @@ var Drawer = /*#__PURE__*/function (_React$Component4) {
361
365
  palette: palette,
362
366
  forwardRef: forwardRef,
363
367
  customClass: customClass,
364
- needAutoZindex: needAutoZindex
368
+ needAutoZindex: needAutoZindex,
369
+ onParentAnimateComplete: onParentAnimateComplete,
370
+ onChildAnimateComplete: onChildAnimateComplete,
371
+ postAnimateParentStyles: postAnimateParentStyles,
372
+ postAnimateChildStyles: postAnimateChildStyles
365
373
  }, /*#__PURE__*/_react["default"].createElement(_Layout.Box, {
366
374
  flexible: true
367
375
  }, /*#__PURE__*/_react["default"].createElement(_Layout.Container, {
@@ -28,6 +28,10 @@ var Drawer_defaultProps = {
28
28
  onBodyClick: function onBodyClick() {},
29
29
  needFocusScope: false,
30
30
  customProps: {},
31
- a11y: {}
31
+ a11y: {},
32
+ onParentAnimateComplete: function onParentAnimateComplete() {},
33
+ onChildAnimateComplete: function onChildAnimateComplete() {},
34
+ postAnimateParentStyles: {},
35
+ postAnimateChildStyles: {}
32
36
  };
33
37
  exports.Drawer_defaultProps = Drawer_defaultProps;
@@ -63,6 +63,10 @@ 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
+ onParentAnimateComplete: _propTypes["default"].func,
68
+ onChildAnimateComplete: _propTypes["default"].func,
69
+ postAnimateParentStyles: _propTypes["default"].object,
70
+ postAnimateChildStyles: _propTypes["default"].object
67
71
  };
68
72
  exports.Drawer_propTypes = Drawer_propTypes;
@@ -39,7 +39,11 @@ 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
+ onParentAnimateComplete = props.onParentAnimateComplete,
44
+ onChildAnimateComplete = props.onChildAnimateComplete,
45
+ postAnimateParentStyles = props.postAnimateParentStyles,
46
+ postAnimateChildStyles = props.postAnimateChildStyles;
43
47
  var finalStyle = (0, _utils.mergeStyle)(_FreezeLayerModule["default"], customStyle);
44
48
 
45
49
  var _cssJSLogic = (0, _cssJSLogic2["default"])({
@@ -61,7 +65,9 @@ function FreezeLayer(props) {
61
65
  return /*#__PURE__*/_react["default"].createElement(_VelocityAnimationGroup["default"], {
62
66
  name: animationName && animationName,
63
67
  isActive: isActive,
64
- runOnMount: runOnMount
68
+ runOnMount: runOnMount,
69
+ onEnterComplete: onParentAnimateComplete,
70
+ postEnterStyles: postAnimateParentStyles
65
71
  }, /*#__PURE__*/_react["default"].createElement("div", {
66
72
  style: isActive && needAutoZindex ? {
67
73
  zIndex: "".concat(getNextIndex())
@@ -77,7 +83,9 @@ function FreezeLayer(props) {
77
83
  component: _Layout.Container,
78
84
  alignBox: "row",
79
85
  align: align,
80
- dataId: "reactFreezeLayer"
86
+ dataId: "reactFreezeLayer",
87
+ onEnterComplete: onChildAnimateComplete,
88
+ postEnterStyles: postAnimateChildStyles
81
89
  }, children) : isSvgMask ? /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, children) : /*#__PURE__*/_react["default"].createElement(_Layout.Container, {
82
90
  alignBox: "row",
83
91
  align: align,
@@ -11,6 +11,10 @@ var defaultProps = {
11
11
  isSvgMask: false,
12
12
  customClass: '',
13
13
  customStyle: {},
14
- needAutoZindex: true
14
+ needAutoZindex: true,
15
+ onParentAnimateComplete: function onParentAnimateComplete() {},
16
+ onChildAnimateComplete: function onChildAnimateComplete() {},
17
+ postAnimateParentStyles: {},
18
+ postAnimateChildStyles: {}
15
19
  };
16
20
  exports.defaultProps = defaultProps;
@@ -24,7 +24,11 @@ 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
+ onParentAnimateComplete: _propTypes["default"].func,
29
+ onChildAnimateComplete: _propTypes["default"].func,
30
+ postAnimateParentStyles: _propTypes["default"].object,
31
+ postAnimateChildStyles: _propTypes["default"].object
28
32
  };
29
33
  exports.propTypes = propTypes;
30
34
  var _default = propTypes;
@@ -0,0 +1,4 @@
1
+ .audioImage {
2
+ background-image: url('../../images/audio_thumbnail.png');
3
+ background-repeat: no-repeat;
4
+ }
@@ -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-200.6",
3
+ "version": "1.0.0-temp-210.1",
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.7",
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.2.63",
66
+ "@zohodesk/components": "1.0.0-temp-223.1",
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.2.63",
80
+ "@zohodesk/components": "1.0.0-temp-223.1",
81
81
  "@zohodesk/icons": "1.0.75",
82
82
  "@zohodesk/svg": "1.1.22",
83
83
  "@zohodesk/virtualizer": "1.0.3",