@twreporter/universal-header 2.4.0-rc.4 → 2.4.0-rc.5
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,18 @@
|
|
|
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.4.0-rc.5](https://github.com/twreporter/twreporter-npm-packages/compare/@twreporter/universal-header@2.4.0-rc.4...@twreporter/universal-header@2.4.0-rc.5) (2022-11-07)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* address defects ([a33aa3b](https://github.com/twreporter/twreporter-npm-packages/commit/a33aa3bf55fd9b1bf5472a4a13de942a9f8757ca))
|
|
12
|
+
* remove console.log ([97eb713](https://github.com/twreporter/twreporter-npm-packages/commit/97eb7135bbdb1923d5050a805cebf5207e29e6f5))
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
|
|
6
18
|
# [2.4.0-rc.4](https://github.com/twreporter/twreporter-npm-packages/compare/@twreporter/universal-header@2.4.0-rc.3...@twreporter/universal-header@2.4.0-rc.4) (2022-10-31)
|
|
7
19
|
|
|
8
20
|
**Note:** Version bump only for package @twreporter/universal-header
|
|
@@ -53,7 +53,7 @@ var Item = /*#__PURE__*/_styledComponents["default"].div.withConfig({
|
|
|
53
53
|
var CategoryContainer = /*#__PURE__*/_styledComponents["default"].div.withConfig({
|
|
54
54
|
displayName: "channels__CategoryContainer",
|
|
55
55
|
componentId: "nu2llv-1"
|
|
56
|
-
})(["display:flex;align-items:center;justify-content:space-between;width:
|
|
56
|
+
})(["display:flex;align-items:center;justify-content:space-between;width:100%;padding:8px 16px;"]);
|
|
57
57
|
|
|
58
58
|
var ChannelContainer = /*#__PURE__*/_styledComponents["default"].div.withConfig({
|
|
59
59
|
displayName: "channels__ChannelContainer",
|
|
@@ -184,7 +184,7 @@ var DropdownContent = function DropdownContent(_ref) {
|
|
|
184
184
|
path = "/categories/".concat(_categorySet.CATEGORY_PATH[itemKey]);
|
|
185
185
|
|
|
186
186
|
if (subItem.key !== 'all') {
|
|
187
|
-
path += "/
|
|
187
|
+
path += "/".concat(subItem.key);
|
|
188
188
|
}
|
|
189
189
|
}
|
|
190
190
|
|
|
@@ -343,10 +343,13 @@ var HamburgerMenu = function HamburgerMenu(_ref2) {
|
|
|
343
343
|
iconComponent: CloseIcon,
|
|
344
344
|
theme: menuTheme,
|
|
345
345
|
onClick: handleClose
|
|
346
|
-
})), /*#__PURE__*/_react["default"].createElement(LogoSection, null, /*#__PURE__*/_react["default"].createElement(_customizedLink["default"],
|
|
346
|
+
})), /*#__PURE__*/_react["default"].createElement(LogoSection, null, /*#__PURE__*/_react["default"].createElement(_customizedLink["default"], _extends({}, logoLink, {
|
|
347
|
+
onClick: handleClose
|
|
348
|
+
}), /*#__PURE__*/_react["default"].createElement(_logo.LogoSymbol, {
|
|
347
349
|
type: logoType
|
|
348
350
|
}))), /*#__PURE__*/_react["default"].createElement(SearchSection, null, /*#__PURE__*/_react["default"].createElement(_input.SearchBar, {
|
|
349
|
-
onSearch: onSearch
|
|
351
|
+
onSearch: onSearch,
|
|
352
|
+
autofocus: false
|
|
350
353
|
})), /*#__PURE__*/_react["default"].createElement(Content, null), /*#__PURE__*/_react["default"].createElement(_hamburgerFooter["default"], null), /*#__PURE__*/_react["default"].createElement(ActionSection, null, /*#__PURE__*/_react["default"].createElement(_actionButton["default"], {
|
|
351
354
|
actions: actions,
|
|
352
355
|
direction: "column"
|
package/lib/components/header.js
CHANGED
|
@@ -108,7 +108,7 @@ var HeaderSection = /*#__PURE__*/_styledComponents["default"].div.withConfig({
|
|
|
108
108
|
var LogoContainer = /*#__PURE__*/_styledComponents["default"].div.withConfig({
|
|
109
109
|
displayName: "header__LogoContainer",
|
|
110
110
|
componentId: "sc-1krza7i-2"
|
|
111
|
-
})(["display:flex;align-items:center;
|
|
111
|
+
})(["display:flex;align-items:center;a{display:flex;}"]);
|
|
112
112
|
|
|
113
113
|
var HideWhenNarrow = /*#__PURE__*/_styledComponents["default"].div.withConfig({
|
|
114
114
|
displayName: "header__HideWhenNarrow",
|
package/lib/components/icons.js
CHANGED
|
@@ -13,6 +13,8 @@ var _querystring = _interopRequireDefault(require("querystring"));
|
|
|
13
13
|
|
|
14
14
|
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
15
15
|
|
|
16
|
+
var _CSSTransition = _interopRequireDefault(require("react-transition-group/CSSTransition"));
|
|
17
|
+
|
|
16
18
|
var _headerContext = _interopRequireDefault(require("../contexts/header-context"));
|
|
17
19
|
|
|
18
20
|
var _links = require("../utils/links");
|
|
@@ -55,7 +57,7 @@ var IconsContainer = /*#__PURE__*/_styledComponents["default"].div.withConfig({
|
|
|
55
57
|
var IconContainer = /*#__PURE__*/_styledComponents["default"].div.withConfig({
|
|
56
58
|
displayName: "icons__IconContainer",
|
|
57
59
|
componentId: "ay66zn-1"
|
|
58
|
-
})(["position:relative;margin-right:16px;a{display:flex;}"]);
|
|
60
|
+
})(["position:relative;margin-right:16px;&:last-child{margin-right:0;}a{display:flex;}"]);
|
|
59
61
|
|
|
60
62
|
var Container = /*#__PURE__*/_styledComponents["default"].div.withConfig({
|
|
61
63
|
displayName: "icons__Container",
|
|
@@ -72,7 +74,7 @@ var LogContainer = /*#__PURE__*/_styledComponents["default"].div.withConfig({
|
|
|
72
74
|
var SearchContainer = /*#__PURE__*/_styledComponents["default"].div.withConfig({
|
|
73
75
|
displayName: "icons__SearchContainer",
|
|
74
76
|
componentId: "ay66zn-4"
|
|
75
|
-
})(["opacity:", ";transition:opacity 300ms ease;position:absolute;right:0;top:-
|
|
77
|
+
})(["opacity:", ";transition:opacity 300ms ease;position:absolute;right:0;top:-8px;z-index:", ";"], function (props) {
|
|
76
78
|
return props.isSearchOpened ? '1' : '0';
|
|
77
79
|
}, function (props) {
|
|
78
80
|
return props.isSearchOpened ? 999 : -1;
|
|
@@ -110,7 +112,7 @@ var LogInOutIcon = function LogInOutIcon() {
|
|
|
110
112
|
destination: redirectURL
|
|
111
113
|
});
|
|
112
114
|
|
|
113
|
-
window.location = (0, _links.
|
|
115
|
+
window.location = (0, _links.getLoginLink)(releaseBranch).to + '?' + query;
|
|
114
116
|
};
|
|
115
117
|
|
|
116
118
|
var onClickLogOut = function onClickLogOut(e) {
|
|
@@ -121,7 +123,7 @@ var LogInOutIcon = function LogInOutIcon() {
|
|
|
121
123
|
destination: redirectURL
|
|
122
124
|
});
|
|
123
125
|
|
|
124
|
-
window.location = (0, _links.
|
|
126
|
+
window.location = (0, _links.getLogoutLink)(releaseBranch).to + '?' + query;
|
|
125
127
|
};
|
|
126
128
|
|
|
127
129
|
var closeDialog = function closeDialog() {
|
|
@@ -142,12 +144,21 @@ var LogInOutIcon = function LogInOutIcon() {
|
|
|
142
144
|
}, /*#__PURE__*/_react["default"].createElement(_button.IconButton, {
|
|
143
145
|
iconComponent: Icon,
|
|
144
146
|
theme: theme
|
|
145
|
-
}), /*#__PURE__*/_react["default"].createElement(
|
|
147
|
+
}), /*#__PURE__*/_react["default"].createElement(_CSSTransition["default"], {
|
|
148
|
+
"in": showDialog,
|
|
149
|
+
classNames: "dialog-effect",
|
|
150
|
+
timeout: {
|
|
151
|
+
appear: 0,
|
|
152
|
+
enter: 100,
|
|
153
|
+
exit: 100
|
|
154
|
+
},
|
|
155
|
+
unmountOnExit: true
|
|
156
|
+
}, /*#__PURE__*/_react["default"].createElement(StyledDialog, {
|
|
146
157
|
text: "\u767B\u51FA",
|
|
147
158
|
size: "L",
|
|
148
159
|
showDialog: showDialog,
|
|
149
160
|
onClick: onClickLogOut
|
|
150
|
-
})));
|
|
161
|
+
}))));
|
|
151
162
|
};
|
|
152
163
|
|
|
153
164
|
var SearchIcon = function SearchIcon() {
|
|
@@ -208,7 +219,8 @@ var SearchIcon = function SearchIcon() {
|
|
|
208
219
|
placeholder: "\u95DC\u9375\u5B57\u641C\u5C0B",
|
|
209
220
|
theme: theme,
|
|
210
221
|
onClose: closeSearchBox,
|
|
211
|
-
onSearch: onSearch
|
|
222
|
+
onSearch: onSearch,
|
|
223
|
+
handleBlur: closeSearchBox
|
|
212
224
|
})));
|
|
213
225
|
};
|
|
214
226
|
|
package/lib/components/slogan.js
CHANGED
|
@@ -30,9 +30,9 @@ function _extends() { _extends = Object.assign || function (target) { for (var i
|
|
|
30
30
|
var SloganContainer = /*#__PURE__*/_styledComponents["default"].div.withConfig({
|
|
31
31
|
displayName: "slogan__SloganContainer",
|
|
32
32
|
componentId: "sc-1eoofl8-0"
|
|
33
|
-
})(["color:", ";display:flex;align-items:center;cursor:default;font-family:", ";font-weight:", ";"], function (props) {
|
|
33
|
+
})(["color:", ";display:flex;align-items:center;cursor:default;font-family:", ";font-weight:", ";font-size:14px;"], function (props) {
|
|
34
34
|
return props.color;
|
|
35
|
-
}, _font.fontFamily.title, _font.fontWeight.
|
|
35
|
+
}, _font.fontFamily.title, _font.fontWeight.normal);
|
|
36
36
|
|
|
37
37
|
var Slogan = function Slogan(_ref) {
|
|
38
38
|
var props = _extends({}, _ref);
|
package/lib/utils/links.js
CHANGED
|
@@ -66,11 +66,14 @@ var defaultReleaseBranch = _releaseBranch["default"].master;
|
|
|
66
66
|
var defaultIsExternal = false;
|
|
67
67
|
|
|
68
68
|
function __getLink(isExternal, releaseBranch, baseURL, path) {
|
|
69
|
+
var target = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : '_self';
|
|
70
|
+
|
|
69
71
|
if (isExternal) {
|
|
70
72
|
if (baseURL.hasOwnProperty(releaseBranch)) {
|
|
71
73
|
return {
|
|
72
74
|
to: baseURL[releaseBranch] + path,
|
|
73
|
-
isExternal: isExternal
|
|
75
|
+
isExternal: isExternal,
|
|
76
|
+
target: target
|
|
74
77
|
};
|
|
75
78
|
}
|
|
76
79
|
}
|
|
@@ -148,7 +151,7 @@ function getFooterLinks() {
|
|
|
148
151
|
|
|
149
152
|
var isExternal = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : defaultIsExternal;
|
|
150
153
|
var releaseBranch = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : defaultReleaseBranch;
|
|
151
|
-
return _ref2 = {}, _defineProperty(_ref2, _footer.FOOTER_KEY.aboutUs, __getLink(
|
|
154
|
+
return _ref2 = {}, _defineProperty(_ref2, _footer.FOOTER_KEY.aboutUs, __getLink(true, releaseBranch, mainBaseURL, _footer.FOOTER_PATH[_footer.FOOTER_KEY.aboutUs], '_blank')), _defineProperty(_ref2, _footer.FOOTER_KEY.influenceReport, __getLink(isExternal, releaseBranch, mainBaseURL, _footer.FOOTER_PATH[_footer.FOOTER_KEY.influenceReport])), _defineProperty(_ref2, _footer.FOOTER_KEY.openLab, __composeExternalLink(__getExternalLinks().openLab, '_blank')), _ref2;
|
|
152
155
|
}
|
|
153
156
|
|
|
154
157
|
function getSocialMediaLinks() {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@twreporter/universal-header",
|
|
3
|
-
"version": "2.4.0-rc.
|
|
3
|
+
"version": "2.4.0-rc.5",
|
|
4
4
|
"description": "Universal header of TWReporter sites",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -20,8 +20,8 @@
|
|
|
20
20
|
],
|
|
21
21
|
"license": "MIT",
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"@twreporter/core": "^1.8.0-rc.
|
|
24
|
-
"@twreporter/react-components": "^8.15.0-rc.
|
|
23
|
+
"@twreporter/core": "^1.8.0-rc.5",
|
|
24
|
+
"@twreporter/react-components": "^8.15.0-rc.5",
|
|
25
25
|
"lodash": "^4.17.11",
|
|
26
26
|
"prop-types": "^15.6.2",
|
|
27
27
|
"querystring": "^0.2.0",
|
|
@@ -48,5 +48,5 @@
|
|
|
48
48
|
"@storybook/testing-library": "^0.0.13",
|
|
49
49
|
"babel-loader": "^8.2.5"
|
|
50
50
|
},
|
|
51
|
-
"gitHead": "
|
|
51
|
+
"gitHead": "bf226b81aae93197d4cad8519a574ef6f85acc9b"
|
|
52
52
|
}
|