@twreporter/react-components 9.3.0 → 9.4.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.
|
@@ -66,6 +66,11 @@ var getLinksGroups = exports.getLinksGroups = function getLinksGroups(mainOrigin
|
|
|
66
66
|
text: '出版品與周邊',
|
|
67
67
|
to: 'https://twreporter.backme.tw/shops/3619?locale=zh-TW',
|
|
68
68
|
target: '_blank'
|
|
69
|
+
}, {
|
|
70
|
+
slug: 'charity-cooperation',
|
|
71
|
+
text: '公益合作',
|
|
72
|
+
to: 'https://www.twreporter.org/a/cooperation',
|
|
73
|
+
target: '_blank'
|
|
69
74
|
}],
|
|
70
75
|
// third column
|
|
71
76
|
[{
|
|
@@ -8,7 +8,7 @@ var _font = require("@twreporter/core/lib/constants/font");
|
|
|
8
8
|
var _forEach = _interopRequireDefault(require("lodash/forEach"));
|
|
9
9
|
var _keys = _interopRequireDefault(require("lodash/keys"));
|
|
10
10
|
var _reduce = _interopRequireDefault(require("lodash/reduce"));
|
|
11
|
-
var _gcsFontFolder, _fontFaces;
|
|
11
|
+
var _gcsFontFolder, _fontWeightKeys, _fontFaces;
|
|
12
12
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
13
13
|
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
14
14
|
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
@@ -22,7 +22,7 @@ var _ = {
|
|
|
22
22
|
var baseGCSDir = 'https://www.twreporter.org/assets/font/';
|
|
23
23
|
var fileExt = '.woff2';
|
|
24
24
|
var gcsFontFolder = (_gcsFontFolder = {}, _defineProperty(_gcsFontFolder, _font.fonts.notoSansTC, 'NotoSansTC'), _defineProperty(_gcsFontFolder, _font.fonts.tauhuOo, 'TauhuOo'), _gcsFontFolder);
|
|
25
|
-
var fontWeightKeys = _.keys(_font.fontWeight);
|
|
25
|
+
var fontWeightKeys = (_fontWeightKeys = {}, _defineProperty(_fontWeightKeys, _font.fonts.notoSansTC, _.keys(_font.fontWeight)), _defineProperty(_fontWeightKeys, _font.fonts.tauhuOo, ['normal']), _fontWeightKeys);
|
|
26
26
|
|
|
27
27
|
// add @font-face to global style to use self-hosted font for performance reasons, to be more precise please check the issue below:
|
|
28
28
|
// https://twreporter-org.atlassian.net/browse/TWREPORTER-318?atlOrigin=eyJpIjoiNjg4OTQ2MWU2MGIxNGEzMGE0NDY2ZDNmZGRhOWExZDEiLCJwIjoiaiJ9
|
|
@@ -33,7 +33,7 @@ var getFontFaces = function getFontFaces(_ref) {
|
|
|
33
33
|
var fontWeightKey = _ref2.fontWeightKey;
|
|
34
34
|
return "\n @font-face {\n font-family: \"".concat(font, "\";\n font-weight: ").concat(_font.fontWeight[fontWeightKey], ";\n font-display: swap;\n src: url(\"").concat(baseGCSDir).concat(folder, "/").concat(fontWeightKey).concat(fileExt, "\");\n }\n ");
|
|
35
35
|
};
|
|
36
|
-
return _.reduce(fontWeightKeys, function (fontFaces, fontWeightKey) {
|
|
36
|
+
return _.reduce(fontWeightKeys[font], function (fontFaces, fontWeightKey) {
|
|
37
37
|
return fontFaces + fontFaceCSSTemplate({
|
|
38
38
|
fontWeightKey: fontWeightKey
|
|
39
39
|
});
|
|
@@ -48,7 +48,7 @@ var fontFaces = (_fontFaces = {}, _defineProperty(_fontFaces, _font.fonts.notoSa
|
|
|
48
48
|
})), _fontFaces);
|
|
49
49
|
var fontGCSFiles = [];
|
|
50
50
|
_.forEach(fontFaces, function (fontFace, font) {
|
|
51
|
-
_.forEach(fontWeightKeys, function (fontWeightKey) {
|
|
51
|
+
_.forEach(fontWeightKeys[font], function (fontWeightKey) {
|
|
52
52
|
fontGCSFiles.push("".concat(baseGCSDir).concat(gcsFontFolder[font], "/").concat(fontWeightKey).concat(fileExt));
|
|
53
53
|
});
|
|
54
54
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@twreporter/react-components",
|
|
3
|
-
"version": "9.
|
|
3
|
+
"version": "9.4.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>",
|
|
@@ -54,5 +54,5 @@
|
|
|
54
54
|
"react-dom": "^18.2.0",
|
|
55
55
|
"storybook": "^8.1.11"
|
|
56
56
|
},
|
|
57
|
-
"gitHead": "
|
|
57
|
+
"gitHead": "168152e47de13a749cc317781c823e2df413ba96"
|
|
58
58
|
}
|