@twreporter/react-article-components 2.2.0-rc.0 → 2.2.0-rc.2
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 +16 -0
- package/lib/components/article-page.js +39 -108
- package/lib/components/aside/desktop-aside.js +25 -65
- package/lib/components/aside/desktop-tools.js +11 -57
- package/lib/components/aside/metadata.js +22 -89
- package/lib/components/aside/mobile-tool-bar.js +79 -175
- package/lib/components/aside/utils/theme.js +5 -11
- package/lib/components/body/annotation.js +15 -73
- package/lib/components/body/audio/audio-contexts.js +4 -16
- package/lib/components/body/audio/audio-provider.js +13 -48
- package/lib/components/body/audio/control-button.js +4 -28
- package/lib/components/body/audio/index.js +10 -56
- package/lib/components/body/audio/seek-bar.js +6 -23
- package/lib/components/body/audio/time.js +0 -6
- package/lib/components/body/blockquote.js +11 -52
- package/lib/components/body/brief.js +10 -55
- package/lib/components/body/centered-quote.js +10 -52
- package/lib/components/body/embedded-code.js +22 -101
- package/lib/components/body/headings.js +6 -23
- package/lib/components/body/image-diff.js +13 -66
- package/lib/components/body/image.js +11 -46
- package/lib/components/body/index.js +21 -118
- package/lib/components/body/infobox.js +13 -58
- package/lib/components/body/list.js +8 -29
- package/lib/components/body/multimedia.js +10 -29
- package/lib/components/body/paragraph.js +5 -23
- package/lib/components/body/slider/index.js +28 -96
- package/lib/components/body/slideshow/index.js +36 -107
- package/lib/components/body/tracking-section.js +7 -46
- package/lib/components/body/youtube.js +8 -41
- package/lib/components/donation-box.js +10 -44
- package/lib/components/img-with-placeholder/index.js +34 -106
- package/lib/components/leading/extend.js +6 -25
- package/lib/components/leading/fullscreen.js +17 -63
- package/lib/components/leading/index.js +2 -10
- package/lib/components/leading/normal.js +19 -64
- package/lib/components/leading/pink.js +20 -59
- package/lib/components/leading/small.js +6 -25
- package/lib/components/license.js +9 -40
- package/lib/components/link.js +8 -37
- package/lib/components/related/card.js +20 -73
- package/lib/components/related/index.js +25 -71
- package/lib/components/related/list.js +16 -70
- package/lib/components/related/mockup.js +10 -12
- package/lib/components/separation-curve.js +0 -15
- package/lib/components/table-of-contents/index.js +17 -46
- package/lib/components/table-of-contents/styled.js +10 -38
- package/lib/constants/anchor.js +4 -8
- package/lib/constants/css.js +2 -15
- package/lib/constants/element-alignment.js +2 -3
- package/lib/constants/prop-types/article-page.js +2 -7
- package/lib/constants/prop-types/aside.js +2 -8
- package/lib/constants/prop-types/body.js +4 -9
- package/lib/constants/prop-types/img-with-placeholder.js +2 -7
- package/lib/constants/prop-types/leading.js +8 -13
- package/lib/constants/prop-types/related.js +2 -7
- package/lib/constants/theme.js +2 -3
- package/lib/constants/typography.js +2 -5
- package/lib/contexts/dynamic-components-context.js +2 -8
- package/lib/managers/layout-manager.js +13 -28
- package/lib/managers/theme-manager.js +13 -32
- package/lib/managers/ui-manager.js +14 -26
- package/lib/utils/image.js +5 -14
- package/package.json +6 -6
|
@@ -1,62 +1,40 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
function _typeof(
|
|
4
|
-
|
|
3
|
+
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); }
|
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
8
7
|
exports["default"] = void 0;
|
|
9
|
-
|
|
10
8
|
var _dynamicComponentsContext = _interopRequireDefault(require("../../contexts/dynamic-components-context"));
|
|
11
|
-
|
|
12
9
|
var _react = _interopRequireWildcard(require("react"));
|
|
13
|
-
|
|
14
10
|
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
15
|
-
|
|
16
11
|
var _imgWithPlaceholder = _interopRequireDefault(require("../img-with-placeholder"));
|
|
17
|
-
|
|
18
12
|
var _leading = _interopRequireDefault(require("../../constants/prop-types/leading"));
|
|
19
|
-
|
|
20
13
|
var _typography = _interopRequireDefault(require("../../constants/typography"));
|
|
21
|
-
|
|
22
14
|
var _mediaQuery = _interopRequireDefault(require("@twreporter/core/lib/utils/media-query"));
|
|
23
|
-
|
|
24
15
|
var _color = require("@twreporter/core/lib/constants/color");
|
|
25
|
-
|
|
26
16
|
var _get = _interopRequireDefault(require("lodash/get"));
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
function _interopRequireWildcard(
|
|
33
|
-
|
|
17
|
+
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9, _templateObject10, _templateObject11; // components
|
|
18
|
+
// constants
|
|
19
|
+
// @twreporter
|
|
20
|
+
// lodash
|
|
21
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
22
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { "default": e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n["default"] = e, t && t.set(e, n), n; }
|
|
34
23
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
35
|
-
|
|
36
24
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
37
|
-
|
|
38
|
-
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
|
39
|
-
|
|
25
|
+
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
|
|
40
26
|
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
41
|
-
|
|
42
27
|
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
43
|
-
|
|
44
28
|
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
45
|
-
|
|
46
29
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
47
|
-
|
|
48
30
|
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
|
|
49
|
-
|
|
50
31
|
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
51
|
-
|
|
52
32
|
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
53
|
-
|
|
54
33
|
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
55
|
-
|
|
56
|
-
function
|
|
57
|
-
|
|
34
|
+
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; }
|
|
35
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
36
|
+
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
58
37
|
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
59
|
-
|
|
60
38
|
var _ = {
|
|
61
39
|
get: _get["default"]
|
|
62
40
|
};
|
|
@@ -64,13 +42,12 @@ var mockup = {
|
|
|
64
42
|
mobile: {
|
|
65
43
|
title: {
|
|
66
44
|
width: 'calc(282/375*100%)' // %
|
|
67
|
-
|
|
68
45
|
}
|
|
69
46
|
},
|
|
47
|
+
|
|
70
48
|
desktop: {
|
|
71
49
|
title: {
|
|
72
50
|
width: 437 // px
|
|
73
|
-
|
|
74
51
|
}
|
|
75
52
|
}
|
|
76
53
|
};
|
|
@@ -83,17 +60,14 @@ var BackgroundBlock = /*#__PURE__*/_styledComponents["default"].div.withConfig({
|
|
|
83
60
|
}, _mediaQuery["default"].desktopAndAbove(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n padding: 0 10px 18px 10px;\n\n height: ", ";\n "])), function (props) {
|
|
84
61
|
return "calc(100vh - ".concat(props.$paddingTop || '108px', ")");
|
|
85
62
|
}));
|
|
86
|
-
|
|
87
63
|
var ContentBlock = /*#__PURE__*/_styledComponents["default"].header.withConfig({
|
|
88
64
|
displayName: "pink__ContentBlock",
|
|
89
65
|
componentId: "sc-1gnwclr-1"
|
|
90
66
|
})(["width:100%;height:100%;position:relative;", ""], _mediaQuery["default"].tabletAndBelow(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n padding-top: 60px;\n "]))));
|
|
91
|
-
|
|
92
67
|
var TextBlock = /*#__PURE__*/_styledComponents["default"].div.withConfig({
|
|
93
68
|
displayName: "pink__TextBlock",
|
|
94
69
|
componentId: "sc-1gnwclr-2"
|
|
95
70
|
})(["", " ", " ", ""], _mediaQuery["default"].mobileOnly(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n position: static;\n width: calc(282/375*100%);\n margin-left: calc(30/375*100%);\n "]))), _mediaQuery["default"].tabletOnly(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n position: static;\n width: calc(513/768*100%);\n margin-left: auto;\n margin-right: auto;\n "]))), _mediaQuery["default"].desktopAndAbove(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n position: absolute;\n bottom: 0px;\n z-index: 1;\n "]))));
|
|
96
|
-
|
|
97
71
|
var TopicTextBlock = /*#__PURE__*/_styledComponents["default"].div.withConfig({
|
|
98
72
|
displayName: "pink__TopicTextBlock",
|
|
99
73
|
componentId: "sc-1gnwclr-3"
|
|
@@ -102,48 +76,40 @@ var TopicTextBlock = /*#__PURE__*/_styledComponents["default"].div.withConfig({
|
|
|
102
76
|
}, _color.colorGrayscale.white, function (props) {
|
|
103
77
|
return props.theme.colors.primary.text;
|
|
104
78
|
}, _typography["default"].font.weight.bold, _color.colorGrayscale.white);
|
|
105
|
-
|
|
106
79
|
var TitleTextBlock = /*#__PURE__*/_styledComponents["default"].h1.withConfig({
|
|
107
80
|
displayName: "pink__TitleTextBlock",
|
|
108
81
|
componentId: "sc-1gnwclr-4"
|
|
109
82
|
})(["color:", ";font-weight:", ";font-family:", ";padding-left:10px;margin:0;", " ", " ", ""], function (props) {
|
|
110
83
|
return props.theme.colors.primary.text;
|
|
111
84
|
}, _typography["default"].font.weight.bold, _typography["default"].font.family.title, _mediaQuery["default"].mobileOnly(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["\n font-size: 28px;\n > span {\n line-height: 1.29;\n }\n "]))), _mediaQuery["default"].tabletOnly(_templateObject7 || (_templateObject7 = _taggedTemplateLiteral(["\n font-size: 42px;\n > span {\n line-height: 1.38;\n }\n "]))), _mediaQuery["default"].desktopAndAbove(_templateObject8 || (_templateObject8 = _taggedTemplateLiteral(["\n width: ", "px;\n font-size: 34px;\n > span {\n line-height: 1.6;\n background-color: ", ";\n box-shadow: 10px 0 0 ", ", -10px 0 0 ", ";\n }\n "])), mockup.desktop.title.width, _color.colorGrayscale.white, _color.colorGrayscale.white, _color.colorGrayscale.white));
|
|
112
|
-
|
|
113
85
|
var SubtitleTextBlock = /*#__PURE__*/_styledComponents["default"].h2.withConfig({
|
|
114
86
|
displayName: "pink__SubtitleTextBlock",
|
|
115
87
|
componentId: "sc-1gnwclr-5"
|
|
116
88
|
})(["color:", ";display:block;font-size:20px;font-weight:", ";margin:0 0 10px 0;> span{line-height:2.1;padding:6px 12px;}", ""], function (props) {
|
|
117
89
|
return props.theme.colors.primary.text;
|
|
118
90
|
}, _typography["default"].font.weight.bold, _mediaQuery["default"].desktopAndAbove(_templateObject9 || (_templateObject9 = _taggedTemplateLiteral(["\n > span {\n background-color: ", ";\n }\n "])), _color.colorGrayscale.white));
|
|
119
|
-
|
|
120
91
|
var FigureBlock = /*#__PURE__*/_styledComponents["default"].figure.withConfig({
|
|
121
92
|
displayName: "pink__FigureBlock",
|
|
122
93
|
componentId: "sc-1gnwclr-6"
|
|
123
94
|
})(["margin:0;", " ", ""], _mediaQuery["default"].tabletAndBelow(_templateObject10 || (_templateObject10 = _taggedTemplateLiteral(["\n position: relative;\n width: 100%;\n padding-bottom: 75%;\n margin-top: 40px;\n\n > .leading-image {\n position: absolute;\n }\n "]))), _mediaQuery["default"].desktopAndAbove(_templateObject11 || (_templateObject11 = _taggedTemplateLiteral(["\n width: 100%;\n height: 100%;\n position: absolute;\n "]))));
|
|
124
|
-
|
|
125
|
-
var LeadingBlock = /*#__PURE__*/function (_PureComponent) {
|
|
95
|
+
var LeadingBlock = exports["default"] = /*#__PURE__*/function (_PureComponent) {
|
|
126
96
|
_inherits(LeadingBlock, _PureComponent);
|
|
127
|
-
|
|
128
97
|
var _super = _createSuper(LeadingBlock);
|
|
129
|
-
|
|
130
98
|
function LeadingBlock() {
|
|
131
99
|
_classCallCheck(this, LeadingBlock);
|
|
132
|
-
|
|
133
100
|
return _super.apply(this, arguments);
|
|
134
101
|
}
|
|
135
|
-
|
|
136
102
|
_createClass(LeadingBlock, [{
|
|
137
103
|
key: "render",
|
|
138
104
|
value: function render() {
|
|
139
105
|
var _this$props = this.props,
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
106
|
+
paddingTop = _this$props.paddingTop,
|
|
107
|
+
poster = _this$props.poster,
|
|
108
|
+
subtitle = _this$props.subtitle,
|
|
109
|
+
title = _this$props.title,
|
|
110
|
+
topicHref = _this$props.topicHref,
|
|
111
|
+
shortTitle = _this$props.shortTitle,
|
|
112
|
+
isTopicPublished = _this$props.isTopicPublished;
|
|
147
113
|
return /*#__PURE__*/_react["default"].createElement(BackgroundBlock, {
|
|
148
114
|
$paddingTop: paddingTop
|
|
149
115
|
}, /*#__PURE__*/_react["default"].createElement(ContentBlock, null, /*#__PURE__*/_react["default"].createElement(TextBlock, null, isTopicPublished && shortTitle ? /*#__PURE__*/_react["default"].createElement(_dynamicComponentsContext["default"].Consumer, null, function (components) {
|
|
@@ -162,14 +128,9 @@ var LeadingBlock = /*#__PURE__*/function (_PureComponent) {
|
|
|
162
128
|
}))));
|
|
163
129
|
}
|
|
164
130
|
}]);
|
|
165
|
-
|
|
166
131
|
return LeadingBlock;
|
|
167
132
|
}(_react.PureComponent);
|
|
168
|
-
|
|
169
|
-
exports["default"] = LeadingBlock;
|
|
170
|
-
|
|
171
133
|
_defineProperty(LeadingBlock, "propTypes", _leading["default"].pink);
|
|
172
|
-
|
|
173
134
|
_defineProperty(LeadingBlock, "defaultProps", {
|
|
174
135
|
poster: {},
|
|
175
136
|
subtitle: '',
|
|
@@ -1,46 +1,30 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
function _typeof(
|
|
4
|
-
|
|
3
|
+
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); }
|
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
8
7
|
exports["default"] = void 0;
|
|
9
|
-
|
|
10
8
|
var _normal = _interopRequireDefault(require("./normal"));
|
|
11
|
-
|
|
12
9
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
13
|
-
|
|
14
|
-
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
|
15
|
-
|
|
10
|
+
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
|
|
16
11
|
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
17
|
-
|
|
12
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
13
|
+
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
18
14
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
19
|
-
|
|
20
15
|
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
21
|
-
|
|
22
16
|
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
23
|
-
|
|
24
17
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
25
|
-
|
|
26
18
|
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
|
|
27
|
-
|
|
28
19
|
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
29
|
-
|
|
30
20
|
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
31
|
-
|
|
32
21
|
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
33
|
-
|
|
34
|
-
var SmallLeading = /*#__PURE__*/function (_NormalLeading) {
|
|
22
|
+
var SmallLeading = exports["default"] = /*#__PURE__*/function (_NormalLeading) {
|
|
35
23
|
_inherits(SmallLeading, _NormalLeading);
|
|
36
|
-
|
|
37
24
|
var _super = _createSuper(SmallLeading);
|
|
38
|
-
|
|
39
25
|
function SmallLeading(props) {
|
|
40
26
|
var _this;
|
|
41
|
-
|
|
42
27
|
_classCallCheck(this, SmallLeading);
|
|
43
|
-
|
|
44
28
|
_this = _super.call(this, props);
|
|
45
29
|
_this.figureWidth = {
|
|
46
30
|
tablet: 576,
|
|
@@ -49,8 +33,5 @@ var SmallLeading = /*#__PURE__*/function (_NormalLeading) {
|
|
|
49
33
|
};
|
|
50
34
|
return _this;
|
|
51
35
|
}
|
|
52
|
-
|
|
53
36
|
return _createClass(SmallLeading);
|
|
54
|
-
}(_normal["default"]);
|
|
55
|
-
|
|
56
|
-
exports["default"] = SmallLeading;
|
|
37
|
+
}(_normal["default"]);
|
|
@@ -1,65 +1,43 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
4
|
-
|
|
5
3
|
Object.defineProperty(exports, "__esModule", {
|
|
6
4
|
value: true
|
|
7
5
|
});
|
|
8
6
|
exports["default"] = void 0;
|
|
9
|
-
|
|
10
7
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
11
|
-
|
|
12
8
|
var _react = _interopRequireDefault(require("react"));
|
|
13
|
-
|
|
14
9
|
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
15
|
-
|
|
16
10
|
var _color = require("@twreporter/core/lib/constants/color");
|
|
17
|
-
|
|
18
11
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
19
|
-
|
|
12
|
+
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); }
|
|
20
13
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
21
|
-
|
|
22
|
-
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
|
23
|
-
|
|
14
|
+
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
|
|
24
15
|
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
25
|
-
|
|
26
16
|
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
27
|
-
|
|
28
17
|
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
29
|
-
|
|
30
18
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
31
|
-
|
|
32
19
|
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
|
|
33
|
-
|
|
34
20
|
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
35
|
-
|
|
36
21
|
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
37
|
-
|
|
38
22
|
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
39
|
-
|
|
40
|
-
function
|
|
41
|
-
|
|
23
|
+
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; }
|
|
24
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
25
|
+
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
42
26
|
var Text = /*#__PURE__*/_styledComponents["default"].p.withConfig({
|
|
43
27
|
displayName: "license__Text",
|
|
44
28
|
componentId: "sc-1vtq5dr-0"
|
|
45
29
|
})(["margin:0;color:", ";font-size:16px;line-height:1.38;"], _color.colorGrayscale.gray600);
|
|
46
|
-
|
|
47
30
|
var Container = /*#__PURE__*/_styledComponents["default"].div.withConfig({
|
|
48
31
|
displayName: "license__Container",
|
|
49
32
|
componentId: "sc-1vtq5dr-1"
|
|
50
33
|
})(["text-align:center;padding:0 24px;"]);
|
|
51
|
-
|
|
52
|
-
var License = /*#__PURE__*/function (_React$PureComponent) {
|
|
34
|
+
var License = exports["default"] = /*#__PURE__*/function (_React$PureComponent) {
|
|
53
35
|
_inherits(License, _React$PureComponent);
|
|
54
|
-
|
|
55
36
|
var _super = _createSuper(License);
|
|
56
|
-
|
|
57
37
|
function License() {
|
|
58
38
|
_classCallCheck(this, License);
|
|
59
|
-
|
|
60
39
|
return _super.apply(this, arguments);
|
|
61
40
|
}
|
|
62
|
-
|
|
63
41
|
_createClass(License, [{
|
|
64
42
|
key: "_extractYear",
|
|
65
43
|
value: function _extractYear(publishedDate) {
|
|
@@ -70,37 +48,28 @@ var License = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
70
48
|
key: "render",
|
|
71
49
|
value: function render() {
|
|
72
50
|
var _this$props = this.props,
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
51
|
+
license = _this$props.license,
|
|
52
|
+
publishedDate = _this$props.publishedDate,
|
|
53
|
+
id = _this$props.id;
|
|
77
54
|
var year = this._extractYear(publishedDate);
|
|
78
|
-
|
|
79
55
|
var licenseJSX = '';
|
|
80
|
-
|
|
81
56
|
if (typeof license === 'string' && license.toLowerCase() === 'copyrighted') {
|
|
82
57
|
licenseJSX = /*#__PURE__*/_react["default"].createElement(Text, null, "\xA9 ", year, " All rights Reserved");
|
|
83
58
|
} else {
|
|
84
59
|
licenseJSX = /*#__PURE__*/_react["default"].createElement(Text, null, "\u672C\u6587\u4F9D CC \u5275\u7528\u59D3\u540D\u6A19\u793A-\u975E\u5546\u696D\u6027-\u7981\u6B62\u6539\u4F5C3.0\u53F0\u7063\u6388\u6B0A\u689D\u6B3E\u91CB\u51FA");
|
|
85
60
|
}
|
|
86
|
-
|
|
87
61
|
return /*#__PURE__*/_react["default"].createElement(Container, {
|
|
88
62
|
id: id
|
|
89
63
|
}, licenseJSX);
|
|
90
64
|
}
|
|
91
65
|
}]);
|
|
92
|
-
|
|
93
66
|
return License;
|
|
94
67
|
}(_react["default"].PureComponent);
|
|
95
|
-
|
|
96
|
-
exports["default"] = License;
|
|
97
|
-
|
|
98
68
|
_defineProperty(License, "defaultProps", {
|
|
99
69
|
license: 'Creative-Commons',
|
|
100
70
|
publishedDate: '',
|
|
101
71
|
id: ''
|
|
102
72
|
});
|
|
103
|
-
|
|
104
73
|
_defineProperty(License, "propTypes", {
|
|
105
74
|
license: _propTypes["default"].string,
|
|
106
75
|
publishedDate: _propTypes["default"].string,
|
package/lib/components/link.js
CHANGED
|
@@ -1,84 +1,55 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
4
|
-
|
|
5
3
|
Object.defineProperty(exports, "__esModule", {
|
|
6
4
|
value: true
|
|
7
5
|
});
|
|
8
6
|
exports["default"] = void 0;
|
|
9
|
-
|
|
10
7
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
11
|
-
|
|
12
8
|
var _react = _interopRequireDefault(require("react"));
|
|
13
|
-
|
|
14
9
|
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
15
|
-
|
|
16
10
|
var _excluded = ["to"];
|
|
17
|
-
|
|
18
11
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
19
|
-
|
|
12
|
+
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); }
|
|
20
13
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
21
|
-
|
|
22
14
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
23
|
-
|
|
24
15
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
25
|
-
|
|
26
16
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
27
|
-
|
|
28
|
-
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
|
29
|
-
|
|
17
|
+
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
|
|
30
18
|
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
31
|
-
|
|
32
19
|
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
33
|
-
|
|
34
20
|
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
35
|
-
|
|
36
21
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
37
|
-
|
|
38
22
|
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
|
|
39
|
-
|
|
40
23
|
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
41
|
-
|
|
42
24
|
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
43
|
-
|
|
44
25
|
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
45
|
-
|
|
46
|
-
function
|
|
47
|
-
|
|
26
|
+
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; }
|
|
27
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
28
|
+
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
48
29
|
var A = /*#__PURE__*/_styledComponents["default"].a.withConfig({
|
|
49
30
|
displayName: "link__A",
|
|
50
31
|
componentId: "ewcdia-0"
|
|
51
32
|
})(["text-decoration:none;"]);
|
|
52
|
-
|
|
53
|
-
var Link = /*#__PURE__*/function (_React$Component) {
|
|
33
|
+
var Link = exports["default"] = /*#__PURE__*/function (_React$Component) {
|
|
54
34
|
_inherits(Link, _React$Component);
|
|
55
|
-
|
|
56
35
|
var _super = _createSuper(Link);
|
|
57
|
-
|
|
58
36
|
function Link() {
|
|
59
37
|
_classCallCheck(this, Link);
|
|
60
|
-
|
|
61
38
|
return _super.apply(this, arguments);
|
|
62
39
|
}
|
|
63
|
-
|
|
64
40
|
_createClass(Link, [{
|
|
65
41
|
key: "render",
|
|
66
42
|
value: function render() {
|
|
67
43
|
var _this$props = this.props,
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
44
|
+
to = _this$props.to,
|
|
45
|
+
rest = _objectWithoutProperties(_this$props, _excluded);
|
|
71
46
|
return /*#__PURE__*/_react["default"].createElement(A, _extends({
|
|
72
47
|
href: to
|
|
73
48
|
}, rest));
|
|
74
49
|
}
|
|
75
50
|
}]);
|
|
76
|
-
|
|
77
51
|
return Link;
|
|
78
52
|
}(_react["default"].Component);
|
|
79
|
-
|
|
80
|
-
exports["default"] = Link;
|
|
81
|
-
|
|
82
53
|
_defineProperty(Link, "propTypes", {
|
|
83
54
|
to: _propTypes["default"].string.isRequired
|
|
84
55
|
});
|