@twreporter/index-page 2.0.2 → 2.0.3-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 +16 -0
- package/lib/components/animations/scroll-fadein.js +17 -44
- package/lib/components/animations/section-animation-wrapper.js +19 -44
- package/lib/components/category-section.js +12 -61
- package/lib/components/common-utils/bottom-link.js +10 -34
- package/lib/components/common-utils/category-name.js +1 -7
- package/lib/components/common-utils/hover-effect.js +1 -8
- package/lib/components/common-utils/img-placeholder.js +2 -12
- package/lib/components/common-utils/img-wrapper.js +11 -43
- package/lib/components/common-utils/section-content-wrapper.js +1 -10
- package/lib/components/common-utils/section-name.js +1 -10
- package/lib/components/common-utils/section.js +1 -9
- package/lib/components/common-utils/swipable-mixin.js +5 -28
- package/lib/components/common-utils/twreporter-link.js +5 -18
- package/lib/components/donation-box-section.js +5 -40
- package/lib/components/editor-picks-mobile.js +10 -51
- package/lib/components/editor-picks.js +21 -83
- package/lib/components/infographic-section.js +18 -75
- package/lib/components/junior-box-section.js +6 -42
- package/lib/components/latest-section.js +9 -52
- package/lib/components/latest-topic.js +16 -77
- package/lib/components/mobile-swiper-list.js +5 -17
- package/lib/components/photography-section.js +29 -90
- package/lib/components/podcast-box-section.js +6 -43
- package/lib/components/prop-types/image.js +1 -7
- package/lib/components/prop-types/post.js +7 -13
- package/lib/components/prop-types/topic.js +7 -14
- package/lib/components/reviews.js +13 -62
- package/lib/components/topics-section.js +20 -100
- package/lib/constants/app.js +2 -3
- package/lib/constants/category-strings.js +2 -6
- package/lib/constants/mobile-mockup-specification.js +10 -9
- package/lib/constants/section-strings.js +2 -6
- package/lib/constants/strings.js +1 -2
- package/lib/index.js +2 -17
- package/lib/styles/animation.js +2 -6
- package/lib/utils/getHref.js +2 -5
- package/lib/utils/image-processor.js +4 -12
- package/lib/utils/style-utils.js +3 -6
- package/package.json +3 -3
|
@@ -4,37 +4,28 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports["default"] = void 0;
|
|
7
|
-
|
|
8
7
|
var _get = _interopRequireDefault(require("lodash/get"));
|
|
9
|
-
|
|
10
8
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
11
|
-
|
|
12
9
|
var _react = _interopRequireDefault(require("react"));
|
|
13
|
-
|
|
14
10
|
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
15
|
-
|
|
16
11
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
17
|
-
|
|
18
12
|
var _ = {
|
|
19
13
|
get: _get["default"]
|
|
20
14
|
};
|
|
21
|
-
|
|
22
15
|
var Img = /*#__PURE__*/_styledComponents["default"].div.withConfig({
|
|
23
16
|
displayName: "img-placeholder__Img",
|
|
24
17
|
componentId: "sc-89d4r1-0"
|
|
25
18
|
})(["width:100%;height:100%;background-size:cover;background-image:", ";background-position:center center;"], function (props) {
|
|
26
19
|
return "url(".concat(_.get(props, 'url'), ")");
|
|
27
20
|
});
|
|
28
|
-
|
|
29
21
|
var ImgPlaceholder = function ImgPlaceholder(_ref) {
|
|
30
22
|
var src = _ref.src,
|
|
31
|
-
|
|
23
|
+
alt = _ref.alt;
|
|
32
24
|
return /*#__PURE__*/_react["default"].createElement(Img, {
|
|
33
25
|
url: src,
|
|
34
26
|
alt: alt
|
|
35
27
|
});
|
|
36
28
|
};
|
|
37
|
-
|
|
38
29
|
ImgPlaceholder.defaultProps = {
|
|
39
30
|
src: '',
|
|
40
31
|
alt: ''
|
|
@@ -43,5 +34,4 @@ ImgPlaceholder.propTypes = {
|
|
|
43
34
|
src: _propTypes["default"].string,
|
|
44
35
|
alt: _propTypes["default"].string
|
|
45
36
|
};
|
|
46
|
-
var _default = ImgPlaceholder;
|
|
47
|
-
exports["default"] = _default;
|
|
37
|
+
var _default = exports["default"] = ImgPlaceholder;
|
|
@@ -1,98 +1,69 @@
|
|
|
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 _react = _interopRequireDefault(require("react"));
|
|
11
|
-
|
|
12
9
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
13
|
-
|
|
14
10
|
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
15
|
-
|
|
16
11
|
var _get = _interopRequireDefault(require("lodash/get"));
|
|
17
|
-
|
|
18
12
|
var _storageUrlProcessor = require("@twreporter/core/lib/utils/storage-url-processor");
|
|
19
|
-
|
|
20
13
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
21
|
-
|
|
22
14
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
23
|
-
|
|
24
|
-
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); } }
|
|
25
|
-
|
|
15
|
+
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); } }
|
|
26
16
|
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
27
|
-
|
|
17
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
18
|
+
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); }
|
|
28
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); }
|
|
29
|
-
|
|
30
20
|
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
31
|
-
|
|
32
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); }; }
|
|
33
|
-
|
|
34
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); }
|
|
35
|
-
|
|
36
23
|
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
37
|
-
|
|
38
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; } }
|
|
39
|
-
|
|
40
|
-
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
41
|
-
|
|
25
|
+
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } /* eslint camelcase: 0 */
|
|
42
26
|
var _ = {
|
|
43
27
|
get: _get["default"]
|
|
44
28
|
};
|
|
45
|
-
|
|
46
29
|
var ImgObjectFit = /*#__PURE__*/_styledComponents["default"].div.withConfig({
|
|
47
30
|
displayName: "img-wrapper__ImgObjectFit",
|
|
48
31
|
componentId: "pv7pm0-0"
|
|
49
32
|
})(["width:100%;height:100%;> img{width:100%;height:100%;object-fit:cover;}"]);
|
|
50
|
-
|
|
51
33
|
var ImgFallback = /*#__PURE__*/_styledComponents["default"].div.withConfig({
|
|
52
34
|
displayName: "img-wrapper__ImgFallback",
|
|
53
35
|
componentId: "pv7pm0-1"
|
|
54
36
|
})(["width:100%;height:100%;background-size:cover;background-image:", ";background-position:center center;"], function (props) {
|
|
55
37
|
return "url(".concat(_.get(props, 'url'), ")");
|
|
56
38
|
});
|
|
39
|
+
|
|
57
40
|
/**
|
|
58
41
|
* @description Pick hero-image between 800px or 400px depends on the resolution.
|
|
59
42
|
* @param {object} sources Get srcSet from hero_images of post
|
|
60
43
|
* @return {string} Return the srcSet which will be srcSet of img element
|
|
61
44
|
* * */
|
|
62
|
-
|
|
63
|
-
|
|
64
45
|
var srcSetDependOnResolutions = function srcSetDependOnResolutions(sources) {
|
|
65
46
|
var mobileInherentWidth = '800w';
|
|
66
47
|
var w400InherentWidth = '400w';
|
|
67
|
-
|
|
68
48
|
var mobile_url = _.get(sources, 'mobile.url', '');
|
|
69
|
-
|
|
70
49
|
var w400_url = _.get(sources, 'w400.url', '');
|
|
71
|
-
|
|
72
50
|
if (!w400_url) {
|
|
73
51
|
return "".concat((0, _storageUrlProcessor.replaceGCSUrlOrigin)(mobile_url), " ").concat(mobileInherentWidth);
|
|
74
52
|
}
|
|
75
|
-
|
|
76
53
|
return "".concat((0, _storageUrlProcessor.replaceGCSUrlOrigin)(mobile_url), " ").concat(mobileInherentWidth, ", ").concat((0, _storageUrlProcessor.replaceGCSUrlOrigin)(w400_url), " ").concat(w400InherentWidth);
|
|
77
54
|
};
|
|
78
|
-
|
|
79
55
|
var ImgWrapper = /*#__PURE__*/function (_React$Component) {
|
|
80
56
|
_inherits(ImgWrapper, _React$Component);
|
|
81
|
-
|
|
82
57
|
var _super = _createSuper(ImgWrapper);
|
|
83
|
-
|
|
84
58
|
function ImgWrapper(props) {
|
|
85
59
|
var _this;
|
|
86
|
-
|
|
87
60
|
_classCallCheck(this, ImgWrapper);
|
|
88
|
-
|
|
89
61
|
_this = _super.call(this, props);
|
|
90
62
|
_this.state = {
|
|
91
63
|
isObjectFit: true
|
|
92
64
|
};
|
|
93
65
|
return _this;
|
|
94
66
|
}
|
|
95
|
-
|
|
96
67
|
_createClass(ImgWrapper, [{
|
|
97
68
|
key: "componentDidMount",
|
|
98
69
|
value: function componentDidMount() {
|
|
@@ -104,10 +75,10 @@ var ImgWrapper = /*#__PURE__*/function (_React$Component) {
|
|
|
104
75
|
key: "render",
|
|
105
76
|
value: function render() {
|
|
106
77
|
var _this$props = this.props,
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
78
|
+
src = _this$props.src,
|
|
79
|
+
alt = _this$props.alt,
|
|
80
|
+
srcSet = _this$props.srcSet,
|
|
81
|
+
sizes = _this$props.sizes;
|
|
111
82
|
var isObjectFit = this.state.isObjectFit;
|
|
112
83
|
return isObjectFit ? /*#__PURE__*/_react["default"].createElement(ImgObjectFit, null, /*#__PURE__*/_react["default"].createElement("img", {
|
|
113
84
|
alt: alt,
|
|
@@ -122,10 +93,8 @@ var ImgWrapper = /*#__PURE__*/function (_React$Component) {
|
|
|
122
93
|
}, this.props.children);
|
|
123
94
|
}
|
|
124
95
|
}]);
|
|
125
|
-
|
|
126
96
|
return ImgWrapper;
|
|
127
97
|
}(_react["default"].Component);
|
|
128
|
-
|
|
129
98
|
ImgWrapper.defaultProps = {
|
|
130
99
|
alt: '',
|
|
131
100
|
children: null,
|
|
@@ -140,5 +109,4 @@ ImgWrapper.propTypes = {
|
|
|
140
109
|
srcSet: _propTypes["default"].object,
|
|
141
110
|
sizes: _propTypes["default"].string
|
|
142
111
|
};
|
|
143
|
-
var _default = ImgWrapper;
|
|
144
|
-
exports["default"] = _default;
|
|
112
|
+
var _default = exports["default"] = ImgWrapper;
|
|
@@ -4,23 +4,14 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports["default"] = void 0;
|
|
7
|
-
|
|
8
7
|
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
9
|
-
|
|
10
8
|
var _styleUtils = require("../../utils/style-utils");
|
|
11
|
-
|
|
12
9
|
var _mediaQuery = _interopRequireDefault(require("@twreporter/core/lib/utils/media-query"));
|
|
13
|
-
|
|
14
10
|
var _templateObject, _templateObject2, _templateObject3;
|
|
15
|
-
|
|
16
11
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
17
|
-
|
|
18
12
|
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
19
|
-
|
|
20
13
|
var ContentWrapper = /*#__PURE__*/_styledComponents["default"].div.withConfig({
|
|
21
14
|
displayName: "section-content-wrapper__ContentWrapper",
|
|
22
15
|
componentId: "shv972-0"
|
|
23
16
|
})(["margin:0 auto;max-width:", ";", " ", " ", ""], _styleUtils.breakPoints.overDesktopMinWidth, _mediaQuery["default"].desktopOnly(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n max-width: ", ";\n "])), _styleUtils.breakPoints.desktopMinWidth), _mediaQuery["default"].tabletOnly(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n max-width: ", ";\n "])), _styleUtils.breakPoints.tabletMinWidth), _mediaQuery["default"].mobileOnly(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n max-width: ", ";\n "])), _styleUtils.breakPoints.mobileMaxWidth));
|
|
24
|
-
|
|
25
|
-
var _default = ContentWrapper;
|
|
26
|
-
exports["default"] = _default;
|
|
17
|
+
var _default = exports["default"] = ContentWrapper;
|
|
@@ -4,23 +4,14 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports["default"] = void 0;
|
|
7
|
-
|
|
8
7
|
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
9
|
-
|
|
10
8
|
var _mediaQuery = _interopRequireDefault(require("@twreporter/core/lib/utils/media-query"));
|
|
11
|
-
|
|
12
9
|
var _color = require("@twreporter/core/lib/constants/color");
|
|
13
|
-
|
|
14
10
|
var _templateObject;
|
|
15
|
-
|
|
16
11
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
17
|
-
|
|
18
12
|
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
19
|
-
|
|
20
13
|
var SectionName = /*#__PURE__*/_styledComponents["default"].div.withConfig({
|
|
21
14
|
displayName: "section-name__SectionName",
|
|
22
15
|
componentId: "ezov0u-0"
|
|
23
16
|
})(["display:none;", ""], _mediaQuery["default"].mobileOnly(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n display: block;\n font-size: 12px;\n position: absolute;\n letter-spacing: 0.4px;\n z-index: 3;\n top: -8px;\n left: 0;\n right: 0;\n text-align: center;\n >span {\n color: ", ";\n padding-left: 5px;\n padding-right: 5px;\n background-color: ", ";\n }\n "])), _color.colorGrayscale.white, _color.colorBrand.heavy));
|
|
24
|
-
|
|
25
|
-
var _default = SectionName;
|
|
26
|
-
exports["default"] = _default;
|
|
17
|
+
var _default = exports["default"] = SectionName;
|
|
@@ -4,22 +4,14 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports["default"] = void 0;
|
|
7
|
-
|
|
8
7
|
var _sectionContentWrapper = _interopRequireDefault(require("./section-content-wrapper"));
|
|
9
|
-
|
|
10
8
|
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
11
|
-
|
|
12
9
|
var _mediaQuery = _interopRequireDefault(require("@twreporter/core/lib/utils/media-query"));
|
|
13
|
-
|
|
14
10
|
var _templateObject;
|
|
15
|
-
|
|
16
11
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
17
|
-
|
|
18
12
|
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
19
|
-
|
|
20
13
|
var Section = /*#__PURE__*/(0, _styledComponents["default"])(_sectionContentWrapper["default"]).withConfig({
|
|
21
14
|
displayName: "section__Section",
|
|
22
15
|
componentId: "z0ptm1-0"
|
|
23
16
|
})(["position:relative;padding-top:100px;padding-bottom:80px;", ""], _mediaQuery["default"].mobileOnly(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n padding-top: 30px;\n padding-bottom: 60px;\n "]))));
|
|
24
|
-
var _default = Section;
|
|
25
|
-
exports["default"] = _default;
|
|
17
|
+
var _default = exports["default"] = Section;
|
|
@@ -1,48 +1,31 @@
|
|
|
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 _propTypes = _interopRequireDefault(require("prop-types"));
|
|
11
|
-
|
|
12
9
|
var _react = _interopRequireDefault(require("react"));
|
|
13
|
-
|
|
14
10
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
15
|
-
|
|
16
11
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
17
|
-
|
|
18
|
-
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); } }
|
|
19
|
-
|
|
12
|
+
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); } }
|
|
20
13
|
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
21
|
-
|
|
14
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
15
|
+
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); }
|
|
22
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); }
|
|
23
|
-
|
|
24
17
|
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
25
|
-
|
|
26
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); }; }
|
|
27
|
-
|
|
28
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); }
|
|
29
|
-
|
|
30
20
|
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
31
|
-
|
|
32
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; } }
|
|
33
|
-
|
|
34
22
|
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
35
|
-
|
|
36
23
|
var SwipableMixin = /*#__PURE__*/function (_React$Component) {
|
|
37
24
|
_inherits(SwipableMixin, _React$Component);
|
|
38
|
-
|
|
39
25
|
var _super = _createSuper(SwipableMixin);
|
|
40
|
-
|
|
41
26
|
function SwipableMixin(props) {
|
|
42
27
|
var _this;
|
|
43
|
-
|
|
44
28
|
_classCallCheck(this, SwipableMixin);
|
|
45
|
-
|
|
46
29
|
_this = _super.call(this, props);
|
|
47
30
|
_this.state = {
|
|
48
31
|
selected: 0
|
|
@@ -51,12 +34,10 @@ var SwipableMixin = /*#__PURE__*/function (_React$Component) {
|
|
|
51
34
|
_this.onSwipedLeft = _this._onSwipedLeft.bind(_assertThisInitialized(_this));
|
|
52
35
|
return _this;
|
|
53
36
|
}
|
|
54
|
-
|
|
55
37
|
_createClass(SwipableMixin, [{
|
|
56
38
|
key: "_onSwipedLeft",
|
|
57
39
|
value: function _onSwipedLeft() {
|
|
58
40
|
var selected = this.state.selected;
|
|
59
|
-
|
|
60
41
|
if (selected < this.props.maxSwipableItems) {
|
|
61
42
|
this.setState({
|
|
62
43
|
selected: selected + 1
|
|
@@ -67,7 +48,6 @@ var SwipableMixin = /*#__PURE__*/function (_React$Component) {
|
|
|
67
48
|
key: "_onSwipedRight",
|
|
68
49
|
value: function _onSwipedRight() {
|
|
69
50
|
var selected = this.state.selected;
|
|
70
|
-
|
|
71
51
|
if (selected > 0) {
|
|
72
52
|
this.setState({
|
|
73
53
|
selected: selected - 1
|
|
@@ -75,15 +55,12 @@ var SwipableMixin = /*#__PURE__*/function (_React$Component) {
|
|
|
75
55
|
}
|
|
76
56
|
}
|
|
77
57
|
}]);
|
|
78
|
-
|
|
79
58
|
return SwipableMixin;
|
|
80
59
|
}(_react["default"].Component);
|
|
81
|
-
|
|
82
60
|
SwipableMixin.defaultProps = {
|
|
83
61
|
maxSwipableItems: 0
|
|
84
62
|
};
|
|
85
63
|
SwipableMixin.propTypes = {
|
|
86
64
|
maxSwipableItems: _propTypes["default"].string
|
|
87
65
|
};
|
|
88
|
-
var _default = SwipableMixin;
|
|
89
|
-
exports["default"] = _default;
|
|
66
|
+
var _default = exports["default"] = SwipableMixin;
|
|
@@ -4,42 +4,32 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports["default"] = void 0;
|
|
7
|
-
|
|
8
7
|
var _hoverEffect = _interopRequireDefault(require("./hover-effect"));
|
|
9
|
-
|
|
10
8
|
var _reactRouterDom = require("react-router-dom");
|
|
11
|
-
|
|
12
9
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
13
|
-
|
|
14
10
|
var _react = _interopRequireDefault(require("react"));
|
|
15
|
-
|
|
16
11
|
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
17
|
-
|
|
18
12
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
19
|
-
|
|
20
13
|
var A = /*#__PURE__*/_styledComponents["default"].a.withConfig({
|
|
21
14
|
displayName: "twreporter-link__A",
|
|
22
15
|
componentId: "sc-16vqglp-0"
|
|
23
16
|
})(["text-decoration:none;"]);
|
|
24
|
-
|
|
25
17
|
var PlainContainer = /*#__PURE__*/_styledComponents["default"].div.withConfig({
|
|
26
18
|
displayName: "twreporter-link__PlainContainer",
|
|
27
19
|
componentId: "sc-16vqglp-1"
|
|
28
|
-
})(["width:100%;height:100%;"]);
|
|
29
|
-
|
|
20
|
+
})(["width:100%;height:100%;"]);
|
|
30
21
|
|
|
22
|
+
// noTxtDec = noTextDecoration
|
|
31
23
|
var TRLink = function TRLink(props) {
|
|
32
24
|
var href = props.href,
|
|
33
|
-
|
|
34
|
-
|
|
25
|
+
redirect = props.redirect,
|
|
26
|
+
plain = props.plain;
|
|
35
27
|
var ContentContainer;
|
|
36
|
-
|
|
37
28
|
if (plain) {
|
|
38
29
|
ContentContainer = PlainContainer;
|
|
39
30
|
} else {
|
|
40
31
|
ContentContainer = _hoverEffect["default"];
|
|
41
32
|
}
|
|
42
|
-
|
|
43
33
|
if (redirect) {
|
|
44
34
|
return /*#__PURE__*/_react["default"].createElement(A, {
|
|
45
35
|
href: "https://www.twreporter.org/".concat(href),
|
|
@@ -47,12 +37,10 @@ var TRLink = function TRLink(props) {
|
|
|
47
37
|
rel: "noreferrer noopener"
|
|
48
38
|
}, /*#__PURE__*/_react["default"].createElement(ContentContainer, null, props.children));
|
|
49
39
|
}
|
|
50
|
-
|
|
51
40
|
return /*#__PURE__*/_react["default"].createElement(_reactRouterDom.Link, {
|
|
52
41
|
to: "/".concat(href)
|
|
53
42
|
}, /*#__PURE__*/_react["default"].createElement(ContentContainer, null, props.children));
|
|
54
43
|
};
|
|
55
|
-
|
|
56
44
|
TRLink.defaultProps = {
|
|
57
45
|
href: '',
|
|
58
46
|
redirect: false,
|
|
@@ -64,5 +52,4 @@ TRLink.propTypes = {
|
|
|
64
52
|
children: _propTypes["default"].any.isRequired,
|
|
65
53
|
redirect: _propTypes["default"].bool
|
|
66
54
|
};
|
|
67
|
-
var _default = TRLink;
|
|
68
|
-
exports["default"] = _default;
|
|
55
|
+
var _default = exports["default"] = TRLink;
|
|
@@ -1,50 +1,31 @@
|
|
|
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 _react = _interopRequireDefault(require("react"));
|
|
11
|
-
|
|
12
9
|
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
13
|
-
|
|
14
10
|
var _donationLink = _interopRequireDefault(require("@twreporter/react-components/lib/donation-link"));
|
|
15
|
-
|
|
16
11
|
var _font = require("@twreporter/core/lib/constants/font");
|
|
17
|
-
|
|
18
12
|
var _mediaQuery = _interopRequireDefault(require("@twreporter/core/lib/utils/media-query"));
|
|
19
|
-
|
|
20
13
|
var _color = require("@twreporter/core/lib/constants/color");
|
|
21
|
-
|
|
22
14
|
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7;
|
|
23
|
-
|
|
24
15
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
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
|
-
|
|
19
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
20
|
+
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); }
|
|
32
21
|
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
22
|
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
23
|
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
24
|
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
25
|
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
41
|
-
|
|
42
26
|
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
27
|
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
45
|
-
|
|
46
28
|
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
47
|
-
|
|
48
29
|
// assets
|
|
49
30
|
var ArrowIcon = function ArrowIcon(props) {
|
|
50
31
|
return /*#__PURE__*/_react["default"].createElement("svg", props, /*#__PURE__*/_react["default"].createElement("title", null, "icon-donate-arrow-gold"), /*#__PURE__*/_react["default"].createElement("defs", null, /*#__PURE__*/_react["default"].createElement("path", {
|
|
@@ -56,7 +37,6 @@ var ArrowIcon = function ArrowIcon(props) {
|
|
|
56
37
|
xlinkHref: "#a"
|
|
57
38
|
}));
|
|
58
39
|
};
|
|
59
|
-
|
|
60
40
|
ArrowIcon.defaultProps = {
|
|
61
41
|
width: "8",
|
|
62
42
|
height: "12",
|
|
@@ -64,60 +44,45 @@ ArrowIcon.defaultProps = {
|
|
|
64
44
|
xmlns: "http://www.w3.org/2000/svg",
|
|
65
45
|
xmlnsXlink: "http://www.w3.org/1999/xlink"
|
|
66
46
|
}; // @twreporter
|
|
67
|
-
|
|
68
47
|
var mockup = {
|
|
69
48
|
defaultWidth: 320,
|
|
70
49
|
contentWidth: 238
|
|
71
50
|
};
|
|
72
51
|
var mobileContentWidthPct = mockup.contentWidth / mockup.defaultWidth * 100;
|
|
73
|
-
|
|
74
52
|
var Container = /*#__PURE__*/_styledComponents["default"].div.withConfig({
|
|
75
53
|
displayName: "donation-box-section__Container",
|
|
76
54
|
componentId: "sc-1xxgww4-0"
|
|
77
55
|
})(["background-color:", ";padding-top:30px;padding-bottom:30px;", ""], _color.colorSupportive.heavy, _mediaQuery["default"].mobileOnly(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n padding-top: 40px;\n padding-bottom: 60px;\n "]))));
|
|
78
|
-
|
|
79
56
|
var ContentContainer = /*#__PURE__*/_styledComponents["default"].div.withConfig({
|
|
80
57
|
displayName: "donation-box-section__ContentContainer",
|
|
81
58
|
componentId: "sc-1xxgww4-1"
|
|
82
59
|
})(["display:flex;justify-content:space-between;align-items:center;max-width:1024px;margin:0 auto;padding:0 100px;color:", ";h3{margin:0;font-size:32px;font-weight:", ";font-family:", ";line-height:1.63;}p{margin-top:10px;font-size:14px;line-height:1.57;text-align:left;}", " ", " ", ""], _color.colorGrayscale.white, _font.fontWeight.bold, _font.fontFamily.title, _mediaQuery["default"].hdOnly(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n max-width: 1440px;\n padding: 0 219px;\n "]))), _mediaQuery["default"].tabletOnly(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n position: relative;\n padding: 0 110px;\n p{\n margin-top: 17px;\n }\n "]))), _mediaQuery["default"].mobileOnly(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n max-width: ", "%;\n display: block;\n text-align: center;\n padding: 0;\n h3{\n font-size: 24px;\n line-height: 2.17;\n }\n p{\n margin-top: 0;\n }\n "])), mobileContentWidthPct));
|
|
83
|
-
|
|
84
60
|
var DonateButton = /*#__PURE__*/_styledComponents["default"].div.withConfig({
|
|
85
61
|
displayName: "donation-box-section__DonateButton",
|
|
86
62
|
componentId: "sc-1xxgww4-2"
|
|
87
63
|
})(["a{width:116px;height:40px;border-radius:20px;background:", ";border:none;color:", ";font-size:16px;cursor:pointer;display:table;", " ", " span{display:table-cell;vertical-align:middle;text-align:center;font-weight:", ";}}"], _color.colorGrayscale.white, _color.colorSupportive.heavy, _mediaQuery["default"].tabletOnly(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n position: absolute;\n right: 110px;\n top: 9px;\n "]))), _mediaQuery["default"].mobileOnly(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["\n margin: 40px auto 0 auto;\n "]))), _font.fontWeight.bold);
|
|
88
|
-
|
|
89
64
|
var TextColumn = /*#__PURE__*/_styledComponents["default"].div.withConfig({
|
|
90
65
|
displayName: "donation-box-section__TextColumn",
|
|
91
66
|
componentId: "sc-1xxgww4-3"
|
|
92
67
|
})(["", ""], _mediaQuery["default"].desktopOnly(_templateObject7 || (_templateObject7 = _taggedTemplateLiteral(["\n max-width: 608px;\n "]))));
|
|
93
|
-
|
|
94
68
|
var Icon = /*#__PURE__*/_styledComponents["default"].div.withConfig({
|
|
95
69
|
displayName: "donation-box-section__Icon",
|
|
96
70
|
componentId: "sc-1xxgww4-4"
|
|
97
71
|
})(["display:inline-block;margin-left:8.6px;width:7px;height:12px;"]);
|
|
98
|
-
|
|
99
72
|
var DonateInfo = /*#__PURE__*/_react["default"].createElement("span", null, "\u8D0A\u52A9\u6211\u5011", /*#__PURE__*/_react["default"].createElement(Icon, null, /*#__PURE__*/_react["default"].createElement(ArrowIcon, null)));
|
|
100
|
-
|
|
101
73
|
var DonationBoxSection = /*#__PURE__*/function (_React$PureComponent) {
|
|
102
74
|
_inherits(DonationBoxSection, _React$PureComponent);
|
|
103
|
-
|
|
104
75
|
var _super = _createSuper(DonationBoxSection);
|
|
105
|
-
|
|
106
76
|
function DonationBoxSection() {
|
|
107
77
|
_classCallCheck(this, DonationBoxSection);
|
|
108
|
-
|
|
109
78
|
return _super.apply(this, arguments);
|
|
110
79
|
}
|
|
111
|
-
|
|
112
80
|
_createClass(DonationBoxSection, [{
|
|
113
81
|
key: "render",
|
|
114
82
|
value: function render() {
|
|
115
83
|
return /*#__PURE__*/_react["default"].createElement(Container, null, /*#__PURE__*/_react["default"].createElement(ContentContainer, null, /*#__PURE__*/_react["default"].createElement(TextColumn, null, /*#__PURE__*/_react["default"].createElement("h3", null, "\u7528\u884C\u52D5\u652F\u6301\u5831\u5C0E\u8005"), /*#__PURE__*/_react["default"].createElement("p", null, "\u6DF1\u5EA6\u8ABF\u67E5\u5831\u5C0E\u5FC5\u9808\u6295\u5165\u512A\u79C0\u8A18\u8005\u3001\u8DB3\u5920\u6642\u9593\u8207\u5927\u91CF\u8CC7\u6E90\u3002\u6B61\u8FCE\u60A8\u6210\u70BA\u300C\u300A\u5831\u5C0E\u8005\u300B\u8D0A\u52A9\u5925\u4F34\u300D\uFF0C\u4E00\u8D77\u70BA\u6253\u9020\u66F4\u597D\u7684\u793E\u6703\u53CA\u5A92\u9AD4\u74B0\u5883\u52AA\u529B\u3002")), /*#__PURE__*/_react["default"].createElement(DonateButton, null, /*#__PURE__*/_react["default"].createElement(_donationLink["default"], null, DonateInfo))));
|
|
116
84
|
}
|
|
117
85
|
}]);
|
|
118
|
-
|
|
119
86
|
return DonationBoxSection;
|
|
120
87
|
}(_react["default"].PureComponent);
|
|
121
|
-
|
|
122
|
-
var _default = DonationBoxSection;
|
|
123
|
-
exports["default"] = _default;
|
|
88
|
+
var _default = exports["default"] = DonationBoxSection;
|