@twreporter/react-article-components 1.6.2-rc.0 → 1.6.2-rc.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.
- package/CHANGELOG.md +11 -0
- package/lib/components/body/embedded-code.js +18 -8
- package/package.json +2 -2
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
|
+
## [1.6.2-rc.1](https://github.com/twreporter/twreporter-npm-packages/compare/@twreporter/react-article-components@1.6.2-rc.0...@twreporter/react-article-components@1.6.2-rc.1) (2022-08-03)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* update isLoaded initially for non-infogram embed ([#296](https://github.com/twreporter/twreporter-npm-packages/issues/296)) ([714b12e](https://github.com/twreporter/twreporter-npm-packages/commit/714b12ebff7b36f970813435f7b268a92fde0250))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
6
17
|
## [1.6.2-rc.0](https://github.com/twreporter/twreporter-npm-packages/compare/@twreporter/react-article-components@1.6.1...@twreporter/react-article-components@1.6.2-rc.0) (2022-07-27)
|
|
7
18
|
|
|
8
19
|
**Note:** Version bump only for package @twreporter/react-article-components
|
|
@@ -202,7 +202,9 @@ var EmbeddedCode = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
202
202
|
|
|
203
203
|
// Delay loading infogram in loadEmbed()
|
|
204
204
|
if (!((_this$_embeddedCodeWi = this._embeddedCodeWithoutScript) !== null && _this$_embeddedCodeWi !== void 0 && _this$_embeddedCodeWi.includes(infogramEmbed))) {
|
|
205
|
-
this.
|
|
205
|
+
this.setState({
|
|
206
|
+
isLoaded: true
|
|
207
|
+
}, this.executeScript);
|
|
206
208
|
}
|
|
207
209
|
}
|
|
208
210
|
}, {
|
|
@@ -278,13 +280,21 @@ var WayPointWrapper = function WayPointWrapper(props) {
|
|
|
278
280
|
setIsInViewPort(false);
|
|
279
281
|
};
|
|
280
282
|
|
|
281
|
-
return
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
283
|
+
return (
|
|
284
|
+
/*#__PURE__*/
|
|
285
|
+
// Note: When an anchor is exactly below an infogram embed, onLeave() is not fired
|
|
286
|
+
// when jumping to the anchor because infogram's bottom boundary is just overlapped
|
|
287
|
+
// with viewport's top boundary. Setting topOffset is to shorter infogram's boundary
|
|
288
|
+
// a little bit to make sure onLeave() fires.
|
|
289
|
+
_react["default"].createElement(_reactWaypoint.Waypoint, {
|
|
290
|
+
onEnter: onEnter,
|
|
291
|
+
onLeave: onLeave,
|
|
292
|
+
fireOnRapidScroll: false,
|
|
293
|
+
topOffset: 5
|
|
294
|
+
}, /*#__PURE__*/_react["default"].createElement("div", null, /*#__PURE__*/_react["default"].createElement(EmbeddedCode, _extends({}, props, {
|
|
295
|
+
ref: embedRef
|
|
296
|
+
}))))
|
|
297
|
+
);
|
|
288
298
|
};
|
|
289
299
|
|
|
290
300
|
WayPointWrapper.defaultProps = {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@twreporter/react-article-components",
|
|
3
|
-
"version": "1.6.2-rc.
|
|
3
|
+
"version": "1.6.2-rc.1",
|
|
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",
|
|
@@ -40,5 +40,5 @@
|
|
|
40
40
|
"files": [
|
|
41
41
|
"lib"
|
|
42
42
|
],
|
|
43
|
-
"gitHead": "
|
|
43
|
+
"gitHead": "5ecf776ab96cef00c58295783e230f483dc653d6"
|
|
44
44
|
}
|