@zohodesk/dot 1.0.0-temp-230.1 → 1.0.0-temp-230.2

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.
@@ -43,7 +43,8 @@ export default class AttachmentImage extends Component {
43
43
  isCover,
44
44
  customClass,
45
45
  onLoad,
46
- onError
46
+ onError,
47
+ imageRef
47
48
  } = this.props;
48
49
  const {
49
50
  isImageValid
@@ -59,6 +60,7 @@ export default class AttachmentImage extends Component {
59
60
  className: customImageClass,
60
61
  alt: alt,
61
62
  isCover: isCover,
63
+ eleRef: imageRef,
62
64
  onLoad: onLoad,
63
65
  onError: onError
64
66
  });
@@ -367,7 +367,8 @@ export default class AttachmentViewer extends Component {
367
367
  children,
368
368
  dataId = 'attachViewer',
369
369
  customClass = {},
370
- customProps = {}
370
+ customProps = {},
371
+ imageRef
371
372
  } = data;
372
373
  const {
373
374
  imageProps = {}
@@ -376,6 +377,7 @@ export default class AttachmentViewer extends Component {
376
377
  customImageClass = '',
377
378
  customChildrenClass = ''
378
379
  } = customClass;
380
+ const resolvedImageRef = imageRef;
379
381
  const retainZoom = canZoom && selectedIndex == i && maintainZoom;
380
382
  const handleZoomOut = isPreviewAttachmentValid && isZoomed ? this.zoomOut.bind(this, i) : undefined;
381
383
  const handleZoomIn = isPreviewAttachmentValid && !isZoomed ? e => this.zoomIn(e, i, true) : undefined;
@@ -395,7 +397,9 @@ export default class AttachmentViewer extends Component {
395
397
  dataId: dataId,
396
398
  id: `img${i}`,
397
399
  isCover: false
398
- }, imageProps), children);
400
+ }, imageProps, {
401
+ imageRef: resolvedImageRef
402
+ }), children);
399
403
  return typeof renderCustomImagePreviewElement === 'function' ? renderCustomImagePreviewElement({
400
404
  defaultView: img,
401
405
  data,
@@ -2,6 +2,9 @@ import PropTypes from 'prop-types';
2
2
  import { propTypes as AvatarProps } from '@zohodesk/components/es/Avatar/props/propTypes';
3
3
  export const AttachmentImage_propTypes = {
4
4
  alt: PropTypes.string,
5
+ imageRef: PropTypes.oneOfType([PropTypes.func, PropTypes.shape({
6
+ current: PropTypes.any
7
+ })]),
5
8
  customClass: PropTypes.shape({
6
9
  customImageClass: PropTypes.string,
7
10
  customChildrenClass: PropTypes.string
@@ -17,6 +20,9 @@ export const AttachmentImage_propTypes = {
17
20
  };
18
21
  export const AttachmentViewer_propTypes = {
19
22
  hideAttachmentViewer: PropTypes.func,
23
+ imageRef: PropTypes.oneOfType([PropTypes.func, PropTypes.shape({
24
+ current: PropTypes.any
25
+ })]),
20
26
  i18nKeys: PropTypes.shape({
21
27
  nextText: PropTypes.string,
22
28
  previousText: PropTypes.string,
@@ -92,7 +92,8 @@ var AttachmentImage = /*#__PURE__*/function (_Component) {
92
92
  isCover = _this$props.isCover,
93
93
  customClass = _this$props.customClass,
94
94
  onLoad = _this$props.onLoad,
95
- onError = _this$props.onError;
95
+ onError = _this$props.onError,
96
+ imageRef = _this$props.imageRef;
96
97
  var isImageValid = this.state.isImageValid;
97
98
  var _customClass$customIm = customClass.customImageClass,
98
99
  customImageClass = _customClass$customIm === void 0 ? '' : _customClass$customIm;
@@ -104,6 +105,7 @@ var AttachmentImage = /*#__PURE__*/function (_Component) {
104
105
  className: customImageClass,
105
106
  alt: alt,
106
107
  isCover: isCover,
108
+ eleRef: imageRef,
107
109
  onLoad: onLoad,
108
110
  onError: onError
109
111
  });
@@ -461,13 +461,15 @@ var AttachmentViewer = /*#__PURE__*/function (_Component) {
461
461
  _data$customClass = data.customClass,
462
462
  customClass = _data$customClass === void 0 ? {} : _data$customClass,
463
463
  _data$customProps = data.customProps,
464
- customProps = _data$customProps === void 0 ? {} : _data$customProps;
464
+ customProps = _data$customProps === void 0 ? {} : _data$customProps,
465
+ imageRef = data.imageRef;
465
466
  var _customProps$imagePro = customProps.imageProps,
466
467
  imageProps = _customProps$imagePro === void 0 ? {} : _customProps$imagePro;
467
468
  var _customClass$customIm = customClass.customImageClass,
468
469
  customImageClass = _customClass$customIm === void 0 ? '' : _customClass$customIm,
469
470
  _customClass$customCh = customClass.customChildrenClass,
470
471
  customChildrenClass = _customClass$customCh === void 0 ? '' : _customClass$customCh;
472
+ var resolvedImageRef = imageRef;
471
473
  var retainZoom = canZoom && selectedIndex == i && maintainZoom;
472
474
  var handleZoomOut = isPreviewAttachmentValid && isZoomed ? this.zoomOut.bind(this, i) : undefined;
473
475
  var handleZoomIn = isPreviewAttachmentValid && !isZoomed ? function (e) {
@@ -490,7 +492,9 @@ var AttachmentViewer = /*#__PURE__*/function (_Component) {
490
492
  dataId: dataId,
491
493
  id: "img".concat(i),
492
494
  isCover: false
493
- }, imageProps), children);
495
+ }, imageProps, {
496
+ imageRef: resolvedImageRef
497
+ }), children);
494
498
 
495
499
  return typeof renderCustomImagePreviewElement === 'function' ? renderCustomImagePreviewElement({
496
500
  defaultView: img,
@@ -13,6 +13,9 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "d
13
13
 
14
14
  var AttachmentImage_propTypes = {
15
15
  alt: _propTypes["default"].string,
16
+ imageRef: _propTypes["default"].oneOfType([_propTypes["default"].func, _propTypes["default"].shape({
17
+ current: _propTypes["default"].any
18
+ })]),
16
19
  customClass: _propTypes["default"].shape({
17
20
  customImageClass: _propTypes["default"].string,
18
21
  customChildrenClass: _propTypes["default"].string
@@ -29,6 +32,9 @@ var AttachmentImage_propTypes = {
29
32
  exports.AttachmentImage_propTypes = AttachmentImage_propTypes;
30
33
  var AttachmentViewer_propTypes = {
31
34
  hideAttachmentViewer: _propTypes["default"].func,
35
+ imageRef: _propTypes["default"].oneOfType([_propTypes["default"].func, _propTypes["default"].shape({
36
+ current: _propTypes["default"].any
37
+ })]),
32
38
  i18nKeys: _propTypes["default"].shape({
33
39
  nextText: _propTypes["default"].string,
34
40
  previousText: _propTypes["default"].string,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zohodesk/dot",
3
- "version": "1.0.0-temp-230.1",
3
+ "version": "1.0.0-temp-230.2",
4
4
  "main": "lib/index",
5
5
  "module": "es/index.js",
6
6
  "private": false,
@@ -41,9 +41,9 @@
41
41
  "downloadOnly": "react-cli clean ./node_modules ./package-lock.json && npm install --legacy-peer-deps",
42
42
  "expublish": "node ../publish.js -- exp",
43
43
  "css:lineheight:validate": "npx z-node-plugins lineheight:errorcheck ./src/",
44
- "variable:addignore": "node ./node_modules/@zohodesk-private/css-variable-migrator/es/variableIgnore.js ./src",
45
- "variable:convert": "node ./node_modules/@zohodesk-private/css-variable-migrator/es/pxParserPostcss.js ./src",
46
- "variable:check": "node ./node_modules/@zohodesk-private/css-variable-migrator/es/variableErrorCheck.js ./src ./node_modules/@zohodesk-private/css-variable-migrator/es/config/cssVariableReplacementOptions.json",
44
+ "variable:addignore": "npx css-variable-migrator addignore ./src",
45
+ "variable:convert": "npx css-variable-migrator convert ./src",
46
+ "variable:check": "npx css-variable-migrator check ./src",
47
47
  "css:review": " npm run dubCheck && npm run css:lineheight:validate && npm run theme:validate ",
48
48
  "theme:validate": "npx z-node-plugins theme:validate ./src ./.cli ./.cli/stringContains.js",
49
49
  "theme:addignore": "npx z-node-plugins theme:addignore ./src ./.cli ./.cli/stringContains.js",
@@ -66,15 +66,15 @@
66
66
  "@testing-library/react-hooks": "^7.0.2",
67
67
  "@testing-library/user-event": "^13.0.10",
68
68
  "@zohodesk-private/color-variable-preprocessor": "1.3.1",
69
- "@zohodesk-private/css-variable-migrator": "1.0.9",
69
+ "@zohodesk-private/css-variable-migrator": "1.0.11",
70
70
  "@zohodesk-private/node-plugins": "1.1.14",
71
71
  "@zohodesk-private/react-prop-validator": "1.2.3",
72
72
  "@zohodesk/a11y": "2.3.9",
73
73
  "@zohodesk/client_build_tool": "0.0.20",
74
- "@zohodesk/components": "1.6.12",
74
+ "@zohodesk/components": "1.6.13",
75
75
  "@zohodesk/dotkit": "1.0.9",
76
76
  "@zohodesk/hooks": "2.0.8",
77
- "@zohodesk/icons": "1.3.0",
77
+ "@zohodesk/icons": "1.3.1",
78
78
  "@zohodesk/layout": "3.1.0",
79
79
  "@zohodesk/react-cli": "1.1.27",
80
80
  "@zohodesk/svg": "1.3.5",
@@ -89,8 +89,8 @@
89
89
  "peerDependencies": {
90
90
  "velocity-react": "1.4.3",
91
91
  "@zohodesk/variables": "1.3.1",
92
- "@zohodesk/components": "1.6.12",
93
- "@zohodesk/icons": "1.3.0",
92
+ "@zohodesk/components": "1.6.13",
93
+ "@zohodesk/icons": "1.3.1",
94
94
  "@zohodesk/svg": "1.3.5",
95
95
  "@zohodesk/virtualizer": "1.0.13",
96
96
  "react-sortable-hoc": "^0.8.3",