@twreporter/react-components 9.1.0 → 9.1.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 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](https://github.com/twreporter/twreporter-npm-packages/compare/@twreporter/react-components@9.1.1-rc.0...@twreporter/react-components@9.1.1) (2024-06-24)
7
+
8
+ **Note:** Version bump only for package @twreporter/react-components
9
+
10
+
11
+
12
+
13
+
14
+ ## [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)
15
+
16
+
17
+ ### Bug Fixes
18
+
19
+ * **react-components:** bookmark-widget render issue ([e5f2458](https://github.com/twreporter/twreporter-npm-packages/commit/e5f2458851802f1ca1e01376ad42b82f7306fe9c))
20
+ * **react-components:** mounted issue ([f0d5d74](https://github.com/twreporter/twreporter-npm-packages/commit/f0d5d742aa55c994ad47f64286e5a6a50c37140a))
21
+
22
+
23
+
24
+
25
+
6
26
  # [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)
7
27
 
8
28
  **Note:** Version bump only for package @twreporter/react-components
@@ -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
- }, [articleMeta, isAuthed, toAutoCheck, jwt, userID, dispatch]);
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.0",
3
+ "version": "9.1.1",
4
4
  "main": "lib/index.js",
5
5
  "repository": "https://github.com/twreporter/twreporter-npm-packages.git",
6
6
  "author": "twreporter <developer@twreporter.org>",
@@ -52,5 +52,5 @@
52
52
  "react-dom": "^18.2.0",
53
53
  "storybook": "^7.5.2"
54
54
  },
55
- "gitHead": "d4e15f1555f27b231f403fb987576cec3c23e800"
55
+ "gitHead": "f972534496803a6b80f6578bf49244fc73bb0c04"
56
56
  }