@twreporter/universal-header 2.11.2-rc.1 → 2.12.0-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 +28 -0
- package/lib/constants/external-links.js +2 -1
- package/lib/constants/footer-old.js +17 -1
- package/lib/constants/footer.js +17 -0
- package/lib/utils/links-old.js +1 -1
- package/lib/utils/links.js +1 -1
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,34 @@
|
|
|
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.12.0-rc.1](https://github.com/twreporter/twreporter-npm-packages/compare/@twreporter/universal-header@2.12.0-rc.0...@twreporter/universal-header@2.12.0-rc.1) (2024-03-08)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* import from lib instead of src ([19b1e2e](https://github.com/twreporter/twreporter-npm-packages/commit/19b1e2e790acd680757f2606e959f778f46b787a))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
# [2.12.0-rc.0](https://github.com/twreporter/twreporter-npm-packages/compare/@twreporter/universal-header@2.11.2-rc.1...@twreporter/universal-header@2.12.0-rc.0) (2024-03-07)
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
### Bug Fixes
|
|
21
|
+
|
|
22
|
+
* remove console log ([ab9ee64](https://github.com/twreporter/twreporter-npm-packages/commit/ab9ee6464ca91ff863b05fb1830c93e5e23c9ef2))
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
### Features
|
|
26
|
+
|
|
27
|
+
* add feature toggle for new btn ([77cd2d2](https://github.com/twreporter/twreporter-npm-packages/commit/77cd2d27b922bde59f0abd2f6ef62d581c3f6944))
|
|
28
|
+
* add publicationAndMerchandise to hambugermenu ([c228997](https://github.com/twreporter/twreporter-npm-packages/commit/c228997548fc66815fb2343cba6266795ac25308))
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
|
|
6
34
|
## [2.11.2-rc.1](https://github.com/twreporter/twreporter-npm-packages/compare/@twreporter/universal-header@2.11.2-rc.0...@twreporter/universal-header@2.11.2-rc.1) (2024-03-07)
|
|
7
35
|
|
|
8
36
|
**Note:** Version bump only for package @twreporter/universal-header
|
|
@@ -14,7 +14,8 @@ var links = {
|
|
|
14
14
|
instagram: 'https://www.instagram.com/twreporter/',
|
|
15
15
|
twitter: 'https://twitter.com/tw_reporter_org',
|
|
16
16
|
youtube: 'https://www.youtube.com/c/TwreporterOrg',
|
|
17
|
-
kidsReporter: 'https://kids.twreporter.org/'
|
|
17
|
+
kidsReporter: 'https://kids.twreporter.org/',
|
|
18
|
+
publicationAndMerchandise: 'https://twreporter.backme.tw/shops/3589?locale=zh-TW'
|
|
18
19
|
};
|
|
19
20
|
var _default = links;
|
|
20
21
|
exports["default"] = _default;
|
|
@@ -5,6 +5,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.FOOTER_PATH = exports.FOOTER_ORDER = exports.FOOTER_LABEL = exports.FOOTER_KEY = void 0;
|
|
7
7
|
|
|
8
|
+
var _featureFlag = require("@twreporter/core/lib/constants/feature-flag");
|
|
9
|
+
|
|
8
10
|
var _FOOTER_PATH, _FOOTER_LABEL;
|
|
9
11
|
|
|
10
12
|
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
@@ -15,11 +17,25 @@ var footerKey = {
|
|
|
15
17
|
influenceReport: 'influence-report',
|
|
16
18
|
openLab: 'open-lab'
|
|
17
19
|
};
|
|
20
|
+
|
|
21
|
+
if (_featureFlag.PUB_AND_MERC_BTN) {
|
|
22
|
+
footerKey.publicationAndMerchandise = 'publication-and-merchandise';
|
|
23
|
+
}
|
|
24
|
+
|
|
18
25
|
var FOOTER_KEY = Object.freeze(footerKey);
|
|
19
26
|
exports.FOOTER_KEY = FOOTER_KEY;
|
|
20
27
|
var FOOTER_PATH = (_FOOTER_PATH = {}, _defineProperty(_FOOTER_PATH, footerKey.foundation, '/categories/foundation'), _defineProperty(_FOOTER_PATH, footerKey.aboutUs, '/about-us'), _defineProperty(_FOOTER_PATH, footerKey.influenceReport, '/a/impact-and-annual-report'), _FOOTER_PATH);
|
|
21
28
|
exports.FOOTER_PATH = FOOTER_PATH;
|
|
22
29
|
var FOOTER_LABEL = (_FOOTER_LABEL = {}, _defineProperty(_FOOTER_LABEL, footerKey.foundation, '基金會消息'), _defineProperty(_FOOTER_LABEL, footerKey.aboutUs, '關於我們'), _defineProperty(_FOOTER_LABEL, footerKey.influenceReport, '影響力報告'), _defineProperty(_FOOTER_LABEL, footerKey.openLab, '報導者開放實驗室'), _FOOTER_LABEL);
|
|
23
30
|
exports.FOOTER_LABEL = FOOTER_LABEL;
|
|
31
|
+
|
|
32
|
+
if (_featureFlag.PUB_AND_MERC_BTN) {
|
|
33
|
+
FOOTER_LABEL[footerKey.publicationAndMerchandise] = '出版品與周邊';
|
|
34
|
+
}
|
|
35
|
+
|
|
24
36
|
var FOOTER_ORDER = [footerKey.foundation, footerKey.aboutUs, footerKey.influenceReport, footerKey.openLab];
|
|
25
|
-
exports.FOOTER_ORDER = FOOTER_ORDER;
|
|
37
|
+
exports.FOOTER_ORDER = FOOTER_ORDER;
|
|
38
|
+
|
|
39
|
+
if (_featureFlag.PUB_AND_MERC_BTN) {
|
|
40
|
+
FOOTER_ORDER.push(footerKey.publicationAndMerchandise);
|
|
41
|
+
}
|
package/lib/constants/footer.js
CHANGED
|
@@ -5,6 +5,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.MEMBER_ORDER = exports.FOOTER_PATH = exports.FOOTER_ORDER = exports.FOOTER_LABEL = exports.FOOTER_KEY = exports.FOOTER_ICON = void 0;
|
|
7
7
|
|
|
8
|
+
var _featureFlag = require("@twreporter/core/lib/constants/feature-flag");
|
|
9
|
+
|
|
8
10
|
var _FOOTER_PATH, _FOOTER_LABEL, _FOOTER_ICON;
|
|
9
11
|
|
|
10
12
|
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
@@ -19,15 +21,30 @@ var footerKey = {
|
|
|
19
21
|
bookmark: 'bookmark',
|
|
20
22
|
history: 'history'
|
|
21
23
|
};
|
|
24
|
+
|
|
25
|
+
if (_featureFlag.PUB_AND_MERC_BTN) {
|
|
26
|
+
footerKey.publicationAndMerchandise = 'publication-and-merchandise';
|
|
27
|
+
}
|
|
28
|
+
|
|
22
29
|
var FOOTER_KEY = Object.freeze(footerKey);
|
|
23
30
|
exports.FOOTER_KEY = FOOTER_KEY;
|
|
24
31
|
var FOOTER_PATH = (_FOOTER_PATH = {}, _defineProperty(_FOOTER_PATH, footerKey.foundation, '/categories/foundation'), _defineProperty(_FOOTER_PATH, footerKey.aboutUs, '/about-us'), _defineProperty(_FOOTER_PATH, footerKey.influenceReport, '/a/impact-and-annual-report'), _defineProperty(_FOOTER_PATH, footerKey.member, '/account'), _defineProperty(_FOOTER_PATH, footerKey.myReading, '/myreading'), _defineProperty(_FOOTER_PATH, footerKey.bookmark, '/myreading/saved'), _defineProperty(_FOOTER_PATH, footerKey.history, '/myreading/history'), _FOOTER_PATH);
|
|
25
32
|
exports.FOOTER_PATH = FOOTER_PATH;
|
|
26
33
|
var FOOTER_LABEL = (_FOOTER_LABEL = {}, _defineProperty(_FOOTER_LABEL, footerKey.foundation, '基金會消息'), _defineProperty(_FOOTER_LABEL, footerKey.aboutUs, '關於我們'), _defineProperty(_FOOTER_LABEL, footerKey.influenceReport, '影響力報告'), _defineProperty(_FOOTER_LABEL, footerKey.openLab, '報導者開放實驗室'), _defineProperty(_FOOTER_LABEL, footerKey.member, '個人專區'), _defineProperty(_FOOTER_LABEL, footerKey.myReading, '我的閱讀'), _defineProperty(_FOOTER_LABEL, footerKey.bookmark, '已收藏'), _defineProperty(_FOOTER_LABEL, footerKey.history, '造訪紀錄'), _FOOTER_LABEL);
|
|
27
34
|
exports.FOOTER_LABEL = FOOTER_LABEL;
|
|
35
|
+
|
|
36
|
+
if (_featureFlag.PUB_AND_MERC_BTN) {
|
|
37
|
+
FOOTER_LABEL[footerKey.publicationAndMerchandise] = '出版品與周邊';
|
|
38
|
+
}
|
|
39
|
+
|
|
28
40
|
var FOOTER_ICON = (_FOOTER_ICON = {}, _defineProperty(_FOOTER_ICON, footerKey.member, 'member'), _defineProperty(_FOOTER_ICON, footerKey.myReading, 'kid_star'), _defineProperty(_FOOTER_ICON, footerKey.bookmark, 'bookmark_basic'), _defineProperty(_FOOTER_ICON, footerKey.history, 'history'), _FOOTER_ICON);
|
|
29
41
|
exports.FOOTER_ICON = FOOTER_ICON;
|
|
30
42
|
var FOOTER_ORDER = [footerKey.foundation, footerKey.aboutUs, footerKey.influenceReport, footerKey.openLab];
|
|
31
43
|
exports.FOOTER_ORDER = FOOTER_ORDER;
|
|
44
|
+
|
|
45
|
+
if (_featureFlag.PUB_AND_MERC_BTN) {
|
|
46
|
+
FOOTER_ORDER.push(footerKey.publicationAndMerchandise);
|
|
47
|
+
}
|
|
48
|
+
|
|
32
49
|
var MEMBER_ORDER = [footerKey.member, footerKey.myReading, footerKey.bookmark, footerKey.history];
|
|
33
50
|
exports.MEMBER_ORDER = MEMBER_ORDER;
|
package/lib/utils/links-old.js
CHANGED
|
@@ -176,7 +176,7 @@ function getFooterLinks() {
|
|
|
176
176
|
|
|
177
177
|
var isExternal = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : defaultIsExternal;
|
|
178
178
|
var releaseBranch = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : defaultReleaseBranch;
|
|
179
|
-
return _ref2 = {}, _defineProperty(_ref2, _footerOld.FOOTER_KEY.foundation, __getLink(isExternal, releaseBranch, mainBaseURL, _footerOld.FOOTER_PATH[_footerOld.FOOTER_KEY.foundation])), _defineProperty(_ref2, _footerOld.FOOTER_KEY.aboutUs, __getLink(true, releaseBranch, mainBaseURL, _footerOld.FOOTER_PATH[_footerOld.FOOTER_KEY.aboutUs], '_blank')), _defineProperty(_ref2, _footerOld.FOOTER_KEY.influenceReport, __getLink(isExternal, releaseBranch, mainBaseURL, _footerOld.FOOTER_PATH[_footerOld.FOOTER_KEY.influenceReport])), _defineProperty(_ref2, _footerOld.FOOTER_KEY.openLab, __composeExternalLink(__getExternalLinks().openLab, '_blank')), _ref2;
|
|
179
|
+
return _ref2 = {}, _defineProperty(_ref2, _footerOld.FOOTER_KEY.foundation, __getLink(isExternal, releaseBranch, mainBaseURL, _footerOld.FOOTER_PATH[_footerOld.FOOTER_KEY.foundation])), _defineProperty(_ref2, _footerOld.FOOTER_KEY.aboutUs, __getLink(true, releaseBranch, mainBaseURL, _footerOld.FOOTER_PATH[_footerOld.FOOTER_KEY.aboutUs], '_blank')), _defineProperty(_ref2, _footerOld.FOOTER_KEY.influenceReport, __getLink(isExternal, releaseBranch, mainBaseURL, _footerOld.FOOTER_PATH[_footerOld.FOOTER_KEY.influenceReport])), _defineProperty(_ref2, _footerOld.FOOTER_KEY.openLab, __composeExternalLink(__getExternalLinks().openLab, '_blank')), _defineProperty(_ref2, _footerOld.FOOTER_KEY.publicationAndMerchandise, __composeExternalLink(__getExternalLinks().publicationAndMerchandise, '_blank')), _ref2;
|
|
180
180
|
}
|
|
181
181
|
|
|
182
182
|
function getSocialMediaLinks() {
|
package/lib/utils/links.js
CHANGED
|
@@ -184,7 +184,7 @@ function getFooterLinks() {
|
|
|
184
184
|
|
|
185
185
|
var isExternal = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : defaultIsExternal;
|
|
186
186
|
var releaseBranch = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : defaultReleaseBranch;
|
|
187
|
-
return _ref2 = {}, _defineProperty(_ref2, _footer.FOOTER_KEY.foundation, __getLink(isExternal, releaseBranch, mainBaseURL, _footer.FOOTER_PATH[_footer.FOOTER_KEY.foundation])), _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;
|
|
187
|
+
return _ref2 = {}, _defineProperty(_ref2, _footer.FOOTER_KEY.foundation, __getLink(isExternal, releaseBranch, mainBaseURL, _footer.FOOTER_PATH[_footer.FOOTER_KEY.foundation])), _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')), _defineProperty(_ref2, _footer.FOOTER_KEY.publicationAndMerchandise, __composeExternalLink(__getExternalLinks().publicationAndMerchandise, '_blank')), _ref2;
|
|
188
188
|
}
|
|
189
189
|
|
|
190
190
|
function getMemberLinks() {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@twreporter/universal-header",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.12.0-rc.1",
|
|
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.
|
|
24
|
-
"@twreporter/react-components": "^8.26.0-rc.
|
|
23
|
+
"@twreporter/core": "^1.19.0-rc.0",
|
|
24
|
+
"@twreporter/react-components": "^8.26.0-rc.1",
|
|
25
25
|
"lodash": "^4.17.11",
|
|
26
26
|
"prop-types": "^15.6.2",
|
|
27
27
|
"querystring": "^0.2.0",
|
|
@@ -51,5 +51,5 @@
|
|
|
51
51
|
"babel-loader": "^8.2.5",
|
|
52
52
|
"react-dom": "16.8.6"
|
|
53
53
|
},
|
|
54
|
-
"gitHead": "
|
|
54
|
+
"gitHead": "a4db42b17a22cc11d5f60f9a473a65acda82b2a6"
|
|
55
55
|
}
|