@twreporter/react-components 9.1.0-rc.1 → 9.1.1-rc.0
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 +20 -0
- package/lib/bookmark-widget/index.js +10 -10
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,26 @@
|
|
|
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
|
+
## [9.1.1-rc.0](https://github.com/twreporter/twreporter-npm-packages/compare/@twreporter/react-components@9.1.0...@twreporter/react-components@9.1.1-rc.0) (2024-06-24)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* **react-components:** bookmark-widget render issue ([e5f2458](https://github.com/twreporter/twreporter-npm-packages/commit/e5f2458851802f1ca1e01376ad42b82f7306fe9c))
|
|
12
|
+
* **react-components:** mounted issue ([f0d5d74](https://github.com/twreporter/twreporter-npm-packages/commit/f0d5d742aa55c994ad47f64286e5a6a50c37140a))
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
# [9.1.0](https://github.com/twreporter/twreporter-npm-packages/compare/@twreporter/react-components@9.1.0-rc.1...@twreporter/react-components@9.1.0) (2024-06-24)
|
|
19
|
+
|
|
20
|
+
**Note:** Version bump only for package @twreporter/react-components
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
|
|
6
26
|
# [9.1.0-rc.1](https://github.com/twreporter/twreporter-npm-packages/compare/@twreporter/react-components@9.1.0-rc.0...@twreporter/react-components@9.1.0-rc.1) (2024-06-19)
|
|
7
27
|
|
|
8
28
|
|
|
@@ -64,6 +64,15 @@ var BookmarkWidget = function BookmarkWidget(_ref) {
|
|
|
64
64
|
var currentSlug = _.get(articleMeta, 'slug');
|
|
65
65
|
return currentSlug && currentSlug === _.get(bookmarkInStore, 'slug') ? bookmarkInStore : null;
|
|
66
66
|
});
|
|
67
|
+
var checkIfThisArticleBookmarked = function checkIfThisArticleBookmarked() {
|
|
68
|
+
if (bookmark) {
|
|
69
|
+
var hostFromWindow = getHostFromWindowLocation();
|
|
70
|
+
if (_.get(bookmark, 'host') !== hostFromWindow) {
|
|
71
|
+
console.warn('Warning on checking bookmark status in `BookmarkWidget`:', 'The `host` in the bookmark data is different from the `host` in current `window`.', 'host in bookmark:', bookmark.host, 'host in `window.location`:', hostFromWindow);
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
return Boolean(bookmark);
|
|
75
|
+
};
|
|
67
76
|
(0, _react.useEffect)(function () {
|
|
68
77
|
/* TODO: Implement `status` for bookmark widget in redux reducer and action:
|
|
69
78
|
There should be different states below for the bookmark widget status of an article:
|
|
@@ -84,7 +93,7 @@ var BookmarkWidget = function BookmarkWidget(_ref) {
|
|
|
84
93
|
} else {
|
|
85
94
|
console.error('`articleMeta.slug` must be a non-empty string, but is', articleSlug);
|
|
86
95
|
}
|
|
87
|
-
}, [
|
|
96
|
+
}, []);
|
|
88
97
|
var redirectToLoginPageIfNotAuthorized = function redirectToLoginPageIfNotAuthorized() {
|
|
89
98
|
if (!isAuthed || !jwt) {
|
|
90
99
|
var currentHref = typeof window === 'undefined' ? '' : window.location.href;
|
|
@@ -107,15 +116,6 @@ var BookmarkWidget = function BookmarkWidget(_ref) {
|
|
|
107
116
|
console.error('Error on deleting bookmark with `BookmarkWidget`: No valid bookmark id.');
|
|
108
117
|
}
|
|
109
118
|
};
|
|
110
|
-
var checkIfThisArticleBookmarked = function checkIfThisArticleBookmarked() {
|
|
111
|
-
if (bookmark) {
|
|
112
|
-
var hostFromWindow = getHostFromWindowLocation();
|
|
113
|
-
if (_.get(bookmark, 'host') !== hostFromWindow) {
|
|
114
|
-
console.warn('Warning on checking bookmark status in `BookmarkWidget`:', 'The `host` in the bookmark data is different from the `host` in current `window`.', 'host in bookmark:', bookmark.host, 'host in `window.location`:', hostFromWindow);
|
|
115
|
-
}
|
|
116
|
-
}
|
|
117
|
-
return Boolean(bookmark);
|
|
118
|
-
};
|
|
119
119
|
if (!articleMeta.slug) {
|
|
120
120
|
return null;
|
|
121
121
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@twreporter/react-components",
|
|
3
|
-
"version": "9.1.
|
|
3
|
+
"version": "9.1.1-rc.0",
|
|
4
4
|
"main": "lib/index.js",
|
|
5
5
|
"repository": "https://github.com/twreporter/twreporter-npm-packages.git",
|
|
6
6
|
"author": "twreporter <developer@twreporter.org>",
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
},
|
|
17
17
|
"dependencies": {
|
|
18
18
|
"@twreporter/core": "^1.22.1",
|
|
19
|
-
"@twreporter/redux": "^8.0.3
|
|
19
|
+
"@twreporter/redux": "^8.0.3",
|
|
20
20
|
"fontfaceobserver-es": "^3.3.3",
|
|
21
21
|
"hoist-non-react-statics": "^2.3.1",
|
|
22
22
|
"lodash": "^4.0.0",
|
|
@@ -52,5 +52,5 @@
|
|
|
52
52
|
"react-dom": "^18.2.0",
|
|
53
53
|
"storybook": "^7.5.2"
|
|
54
54
|
},
|
|
55
|
-
"gitHead": "
|
|
55
|
+
"gitHead": "4ea493fc9d1fab5e3aee7adaa762d14aed5b0528"
|
|
56
56
|
}
|