@twreporter/react-article-components 2.1.0-rc.1 → 2.1.0-rc.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.
package/CHANGELOG.md CHANGED
@@ -3,6 +3,17 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ # [2.1.0-rc.2](https://github.com/twreporter/twreporter-npm-packages/compare/@twreporter/react-article-components@2.1.0-rc.1...@twreporter/react-article-components@2.1.0-rc.2) (2024-05-28)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * add clickable prop for image ([fcf3d6c](https://github.com/twreporter/twreporter-npm-packages/commit/fcf3d6c5ba152936f24ee8eb33745f856b22bf0f))
12
+
13
+
14
+
15
+
16
+
6
17
  # [2.1.0-rc.1](https://github.com/twreporter/twreporter-npm-packages/compare/@twreporter/react-article-components@2.1.0-rc.0...@twreporter/react-article-components@2.1.0-rc.1) (2024-05-28)
7
18
 
8
19
 
@@ -92,7 +92,8 @@ var Image = /*#__PURE__*/function (_PureComponent) {
92
92
  alt: alt,
93
93
  imgProps: imgProps,
94
94
  imageSet: [image.mobile, image.tablet, image.desktop, image.tiny],
95
- defaultImage: image.mobile
95
+ defaultImage: image.mobile,
96
+ clickable: true
96
97
  /* TODO: add sizes */
97
98
 
98
99
  }), caption ? /*#__PURE__*/_react["default"].createElement(Caption, {
@@ -273,10 +273,13 @@ var Img = /*#__PURE__*/function (_React$PureComponent) {
273
273
  defaultImage = _this$props2.defaultImage,
274
274
  objectFit = _this$props2.objectFit,
275
275
  objectPosition = _this$props2.objectPosition,
276
- sizes = _this$props2.sizes;
276
+ sizes = _this$props2.sizes,
277
+ clickable = _this$props2.clickable;
277
278
  var releaseBranch = (this === null || this === void 0 ? void 0 : (_this$context = this.context) === null || _this$context === void 0 ? void 0 : _this$context.releaseBranch) || _releaseBranch["default"].release;
278
279
 
279
280
  var openFullScreen = function openFullScreen() {
281
+ if (!clickable) return;
282
+
280
283
  _this3.setState({
281
284
  showFullScreenImg: true
282
285
  });
@@ -379,7 +382,8 @@ _defineProperty(Img, "propTypes", {
379
382
  imageSet: _propTypes["default"].arrayOf(_imgWithPlaceholder["default"].imagePropType),
380
383
  objectFit: _propTypes["default"].oneOf([objectFitConsts.cover, objectFitConsts.contain]),
381
384
  objectPosition: _propTypes["default"].string,
382
- sizes: _propTypes["default"].string.isRequired
385
+ sizes: _propTypes["default"].string.isRequired,
386
+ clickable: _propTypes["default"].bool
383
387
  });
384
388
 
385
389
  _defineProperty(Img, "defaultProps", {
@@ -391,5 +395,6 @@ _defineProperty(Img, "defaultProps", {
391
395
  imgProps: {},
392
396
  placeholderNoBlur: false,
393
397
  noImgPlaceholder: false,
394
- sizes: ''
398
+ sizes: '',
399
+ clickable: false
395
400
  });
@@ -149,7 +149,8 @@ var FullScreenLeading = /*#__PURE__*/function (_React$PureComponent) {
149
149
  defaultImage: poster.mobile,
150
150
  objectFit: "cover",
151
151
  objectPostion: "center center",
152
- sizes: "(max-width: 800px) 800px, (max-width: 1200px) 1200px, 2000px"
152
+ sizes: "(max-width: 800px) 800px, (max-width: 1200px) 1200px, 2000px",
153
+ clickable: true
153
154
  }));
154
155
 
155
156
  if (!this.isEmptyPortraitPoster(portraitPoster)) {
@@ -159,7 +160,8 @@ var FullScreenLeading = /*#__PURE__*/function (_React$PureComponent) {
159
160
  imageSet: [portraitPoster.mobile],
160
161
  defaultImage: portraitPoster.mobile,
161
162
  objectFit: "cover",
162
- objectPostion: "center center"
163
+ objectPostion: "center center",
164
+ clickable: true
163
165
  })));
164
166
  }
165
167
 
@@ -168,7 +168,8 @@ var NormalLeading = /*#__PURE__*/function (_React$PureComponent) {
168
168
  imgPlaceholderSrc: _.get(poster, 'tiny.url', ''),
169
169
  imageSet: [poster.mobile, poster.tablet, poster.desktop],
170
170
  defaultImage: poster.mobile,
171
- sizes: "(max-width: 800px) 800px, (max-width: 1200px) 1200px, 2000px"
171
+ sizes: "(max-width: 800px) 800px, (max-width: 1200px) 1200px, 2000px",
172
+ clickable: true
172
173
  }), figureCaption ? /*#__PURE__*/_react["default"].createElement(FigCaption, null, figureCaption) : null)));
173
174
  }
174
175
  }]);
@@ -157,7 +157,8 @@ var LeadingBlock = /*#__PURE__*/function (_PureComponent) {
157
157
  defaultImage: poster.mobile,
158
158
  objectFit: "cover",
159
159
  objectPostion: "center center",
160
- sizes: "(max-width: 800px) 800px, (max-width: 1200px) 1200px, 2000px"
160
+ sizes: "(max-width: 800px) 800px, (max-width: 1200px) 1200px, 2000px",
161
+ clickable: true
161
162
  }))));
162
163
  }
163
164
  }]);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@twreporter/react-article-components",
3
- "version": "2.1.0-rc.1",
3
+ "version": "2.1.0-rc.2",
4
4
  "description": "The Reporter react article components, which are used in article page",
5
5
  "main": "lib/components/article-page.js",
6
6
  "repository": "https://github.com/twreporter/twreporter-npm-packages.git",
@@ -41,5 +41,5 @@
41
41
  "files": [
42
42
  "lib"
43
43
  ],
44
- "gitHead": "c05e4f5114c3b56e7e0043ae1dc457692f270737"
44
+ "gitHead": "9c4e9f08523a0746274ea6ea14e2398bdf8101b6"
45
45
  }