@twreporter/react-article-components 1.4.12 → 1.5.0-rc.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.
- package/CHANGELOG.md +17 -0
- package/lib/components/article-page.js +41 -95
- package/lib/components/aside/desktop-aside.js +3 -3
- package/lib/components/aside/desktop-tools.js +198 -0
- package/lib/components/aside/mobile-tool-bar.js +464 -0
- package/lib/components/aside/utils/theme.js +37 -0
- package/lib/components/license.js +9 -4
- package/lib/constants/anchor.js +8 -0
- package/package.json +4 -4
- package/lib/components/aside/mobile-aside.js +0 -212
- package/lib/components/aside/tools.js +0 -383
|
@@ -1,212 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
|
4
|
-
|
|
5
|
-
Object.defineProperty(exports, "__esModule", {
|
|
6
|
-
value: true
|
|
7
|
-
});
|
|
8
|
-
exports["default"] = void 0;
|
|
9
|
-
|
|
10
|
-
var _bookmarkWidget = _interopRequireDefault(require("@twreporter/react-components/lib/bookmark-widget"));
|
|
11
|
-
|
|
12
|
-
var _dynamicComponentsContext = _interopRequireDefault(require("../../contexts/dynamic-components-context"));
|
|
13
|
-
|
|
14
|
-
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
15
|
-
|
|
16
|
-
var _react = _interopRequireDefault(require("react"));
|
|
17
|
-
|
|
18
|
-
var _mediaQuery = _interopRequireDefault(require("@twreporter/core/lib/utils/media-query"));
|
|
19
|
-
|
|
20
|
-
var _propTypes2 = _interopRequireDefault(require("@twreporter/core/lib/constants/prop-types"));
|
|
21
|
-
|
|
22
|
-
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
23
|
-
|
|
24
|
-
var _templateObject, _templateObject2;
|
|
25
|
-
|
|
26
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
27
|
-
|
|
28
|
-
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
29
|
-
|
|
30
|
-
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); } }
|
|
31
|
-
|
|
32
|
-
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
|
33
|
-
|
|
34
|
-
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 } }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
35
|
-
|
|
36
|
-
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
37
|
-
|
|
38
|
-
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); }; }
|
|
39
|
-
|
|
40
|
-
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); }
|
|
41
|
-
|
|
42
|
-
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
43
|
-
|
|
44
|
-
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; } }
|
|
45
|
-
|
|
46
|
-
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
47
|
-
|
|
48
|
-
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
49
|
-
|
|
50
|
-
// icons
|
|
51
|
-
var BackToTopicIcon = function BackToTopicIcon(props) {
|
|
52
|
-
return /*#__PURE__*/_react["default"].createElement("svg", props, /*#__PURE__*/_react["default"].createElement("circle", {
|
|
53
|
-
fill: "#fff",
|
|
54
|
-
cx: "25.82",
|
|
55
|
-
cy: "25.82",
|
|
56
|
-
r: "25.82"
|
|
57
|
-
}), /*#__PURE__*/_react["default"].createElement("path", {
|
|
58
|
-
fill: "#a67a44",
|
|
59
|
-
d: "M23.6 21.92H31a1 1 0 1 0 0-2h-7.4a1 1 0 0 0 0 2zM23.6 26.82H31a1 1 0 0 0 0-2h-7.4a1 1 0 0 0 0 2zM23.6 31.71H31a1 1 0 0 0 0-2h-7.4a1 1 0 0 0 0 2z"
|
|
60
|
-
}), /*#__PURE__*/_react["default"].createElement("path", {
|
|
61
|
-
fill: "#a67a44",
|
|
62
|
-
d: "M33.92 13.92h-16.2a1.91 1.91 0 0 0-1.9 1.9v20a1.9 1.9 0 0 0 1.9 1.9h16.2a1.9 1.9 0 0 0 1.9-1.9v-20a1.91 1.91 0 0 0-1.9-1.9zm-.1 21.79h-16V15.92h16z"
|
|
63
|
-
}), /*#__PURE__*/_react["default"].createElement("circle", {
|
|
64
|
-
fill: "#a67a44",
|
|
65
|
-
cx: "20.15",
|
|
66
|
-
cy: "20.92",
|
|
67
|
-
r: "1"
|
|
68
|
-
}), /*#__PURE__*/_react["default"].createElement("circle", {
|
|
69
|
-
fill: "#a67a44",
|
|
70
|
-
cx: "20.15",
|
|
71
|
-
cy: "25.82",
|
|
72
|
-
r: "1"
|
|
73
|
-
}), /*#__PURE__*/_react["default"].createElement("circle", {
|
|
74
|
-
fill: "#a67a44",
|
|
75
|
-
cx: "20.15",
|
|
76
|
-
cy: "30.71",
|
|
77
|
-
r: "1"
|
|
78
|
-
}));
|
|
79
|
-
};
|
|
80
|
-
|
|
81
|
-
BackToTopicIcon.defaultProps = {
|
|
82
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
83
|
-
viewBox: "0 0 51.64 51.64"
|
|
84
|
-
}; // bookmark icons
|
|
85
|
-
|
|
86
|
-
var ToAddBookmarkIcon = function ToAddBookmarkIcon(props) {
|
|
87
|
-
return /*#__PURE__*/_react["default"].createElement("svg", props, /*#__PURE__*/_react["default"].createElement("circle", {
|
|
88
|
-
fill: "#fff",
|
|
89
|
-
cx: "25.82",
|
|
90
|
-
cy: "25.82",
|
|
91
|
-
r: "25.82"
|
|
92
|
-
}), /*#__PURE__*/_react["default"].createElement("path", {
|
|
93
|
-
fill: "#a67a44",
|
|
94
|
-
d: "M17.48 37.66a1.65 1.65 0 0 1-.81-.2 1.45 1.45 0 0 1-.79-1.28V15.45a1.55 1.55 0 0 1 1.6-1.45h16.68a1.54 1.54 0 0 1 1.59 1.48v20.7a1.42 1.42 0 0 1-.75 1.28 1.68 1.68 0 0 1-1.72-.07l-7.42-4.86-7.46 4.86a1.68 1.68 0 0 1-.92.27zm-.18-1.94zm17 0zM17.88 16v19.34l7.94-5.2 7.93 5.2V16z"
|
|
95
|
-
}));
|
|
96
|
-
};
|
|
97
|
-
|
|
98
|
-
ToAddBookmarkIcon.defaultProps = {
|
|
99
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
100
|
-
viewBox: "0 0 51.64 51.64"
|
|
101
|
-
};
|
|
102
|
-
|
|
103
|
-
var AddedBookmarkIcon = function AddedBookmarkIcon(props) {
|
|
104
|
-
return /*#__PURE__*/_react["default"].createElement("svg", props, /*#__PURE__*/_react["default"].createElement("circle", {
|
|
105
|
-
fill: "#fff",
|
|
106
|
-
cx: "25.82",
|
|
107
|
-
cy: "25.82",
|
|
108
|
-
r: "25.82"
|
|
109
|
-
}), /*#__PURE__*/_react["default"].createElement("path", {
|
|
110
|
-
fill: "#a67a44",
|
|
111
|
-
d: "M17.48 37.66a1.65 1.65 0 0 1-.81-.2 1.45 1.45 0 0 1-.79-1.28V15.45a1.55 1.55 0 0 1 1.6-1.45h16.68a1.54 1.54 0 0 1 1.59 1.48v20.7a1.42 1.42 0 0 1-.75 1.28 1.68 1.68 0 0 1-1.72-.07l-7.42-4.86-7.46 4.86a1.68 1.68 0 0 1-.92.27zm-.18-1.94zm17 0z"
|
|
112
|
-
}));
|
|
113
|
-
};
|
|
114
|
-
|
|
115
|
-
AddedBookmarkIcon.defaultProps = {
|
|
116
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
117
|
-
viewBox: "0 0 51.64 51.64"
|
|
118
|
-
};
|
|
119
|
-
|
|
120
|
-
var Container = /*#__PURE__*/_styledComponents["default"].div.withConfig({
|
|
121
|
-
displayName: "mobile-aside__Container",
|
|
122
|
-
componentId: "sc-1k1zo00-0"
|
|
123
|
-
})(["", " ", ""], _mediaQuery["default"].tabletAndBelow(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n display: inline-block;\n position: fixed;\n right: 5%;\n bottom: 3%;\n z-index: 999;\n visibility: ", ";\n opacity: ", ";\n transition: opacity 0.5s linear;\n "])), function (props) {
|
|
124
|
-
return props.toShow ? 'visible' : 'hidden';
|
|
125
|
-
}, function (props) {
|
|
126
|
-
return props.toShow ? 1 : 0;
|
|
127
|
-
}), _mediaQuery["default"].desktopAndAbove(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n display: none;\n "]))));
|
|
128
|
-
|
|
129
|
-
var IconContainer = /*#__PURE__*/_styledComponents["default"].div.withConfig({
|
|
130
|
-
displayName: "mobile-aside__IconContainer",
|
|
131
|
-
componentId: "sc-1k1zo00-1"
|
|
132
|
-
})(["position:relative;width:52px;height:52px;cursor:pointer;svg{width:100%;position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);}"]);
|
|
133
|
-
|
|
134
|
-
var SubsequentIconContainer = /*#__PURE__*/(0, _styledComponents["default"])(IconContainer).withConfig({
|
|
135
|
-
displayName: "mobile-aside__SubsequentIconContainer",
|
|
136
|
-
componentId: "sc-1k1zo00-2"
|
|
137
|
-
})(["margin-bottom:20px;"]);
|
|
138
|
-
|
|
139
|
-
var BackToTopicBtn = function BackToTopicBtn(props) {
|
|
140
|
-
return /*#__PURE__*/_react["default"].createElement(_dynamicComponentsContext["default"].Consumer, null, function (components) {
|
|
141
|
-
return /*#__PURE__*/_react["default"].createElement(components.Link, {
|
|
142
|
-
to: props.href,
|
|
143
|
-
target: "_self"
|
|
144
|
-
}, /*#__PURE__*/_react["default"].createElement(SubsequentIconContainer, null, /*#__PURE__*/_react["default"].createElement(BackToTopicIcon, null)));
|
|
145
|
-
});
|
|
146
|
-
};
|
|
147
|
-
|
|
148
|
-
BackToTopicBtn.propTypes = {
|
|
149
|
-
href: _propTypes["default"].string.isRequired
|
|
150
|
-
};
|
|
151
|
-
|
|
152
|
-
var MobileAside = /*#__PURE__*/function (_React$PureComponent) {
|
|
153
|
-
_inherits(MobileAside, _React$PureComponent);
|
|
154
|
-
|
|
155
|
-
var _super = _createSuper(MobileAside);
|
|
156
|
-
|
|
157
|
-
function MobileAside(props) {
|
|
158
|
-
var _this;
|
|
159
|
-
|
|
160
|
-
_classCallCheck(this, MobileAside);
|
|
161
|
-
|
|
162
|
-
_this = _super.call(this, props);
|
|
163
|
-
_this.state = {
|
|
164
|
-
toShow: false
|
|
165
|
-
};
|
|
166
|
-
return _this;
|
|
167
|
-
}
|
|
168
|
-
|
|
169
|
-
_createClass(MobileAside, [{
|
|
170
|
-
key: "toShow",
|
|
171
|
-
set: function set(toShow) {
|
|
172
|
-
this.setState({
|
|
173
|
-
toShow: toShow
|
|
174
|
-
});
|
|
175
|
-
}
|
|
176
|
-
}, {
|
|
177
|
-
key: "render",
|
|
178
|
-
value: function render() {
|
|
179
|
-
var _this$props = this.props,
|
|
180
|
-
backToTopic = _this$props.backToTopic,
|
|
181
|
-
articleMetaForBookmark = _this$props.articleMetaForBookmark;
|
|
182
|
-
var toShow = this.state.toShow;
|
|
183
|
-
return /*#__PURE__*/_react["default"].createElement(Container, {
|
|
184
|
-
className: "hidden-print",
|
|
185
|
-
toShow: toShow
|
|
186
|
-
}, backToTopic ? /*#__PURE__*/_react["default"].createElement(BackToTopicBtn, {
|
|
187
|
-
href: backToTopic
|
|
188
|
-
}) : null, /*#__PURE__*/_react["default"].createElement(_bookmarkWidget["default"], {
|
|
189
|
-
toAutoCheck: true,
|
|
190
|
-
articleMeta: articleMetaForBookmark,
|
|
191
|
-
renderIcon: function renderIcon(isBookmarked, addAction, removeAction) {
|
|
192
|
-
return /*#__PURE__*/_react["default"].createElement(IconContainer, {
|
|
193
|
-
onClick: isBookmarked ? removeAction : addAction
|
|
194
|
-
}, isBookmarked ? /*#__PURE__*/_react["default"].createElement(AddedBookmarkIcon, null) : /*#__PURE__*/_react["default"].createElement(ToAddBookmarkIcon, null));
|
|
195
|
-
}
|
|
196
|
-
}));
|
|
197
|
-
}
|
|
198
|
-
}]);
|
|
199
|
-
|
|
200
|
-
return MobileAside;
|
|
201
|
-
}(_react["default"].PureComponent);
|
|
202
|
-
|
|
203
|
-
MobileAside.propTypes = {
|
|
204
|
-
backToTopic: _propTypes["default"].string,
|
|
205
|
-
articleMetaForBookmark: _propTypes2["default"].articleMetaForBookmark
|
|
206
|
-
};
|
|
207
|
-
MobileAside.defaultProps = {
|
|
208
|
-
backToTopic: '',
|
|
209
|
-
articleMetaForBookmark: {}
|
|
210
|
-
};
|
|
211
|
-
var _default = MobileAside;
|
|
212
|
-
exports["default"] = _default;
|
|
@@ -1,383 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
|
4
|
-
|
|
5
|
-
Object.defineProperty(exports, "__esModule", {
|
|
6
|
-
value: true
|
|
7
|
-
});
|
|
8
|
-
exports["default"] = void 0;
|
|
9
|
-
|
|
10
|
-
var _dynamicComponentsContext = _interopRequireDefault(require("../../contexts/dynamic-components-context"));
|
|
11
|
-
|
|
12
|
-
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
13
|
-
|
|
14
|
-
var _react = _interopRequireDefault(require("react"));
|
|
15
|
-
|
|
16
|
-
var _styledComponents = _interopRequireWildcard(require("styled-components"));
|
|
17
|
-
|
|
18
|
-
var _theme = _interopRequireDefault(require("../../constants/theme"));
|
|
19
|
-
|
|
20
|
-
var _color = _interopRequireDefault(require("../../constants/color"));
|
|
21
|
-
|
|
22
|
-
var _aside = _interopRequireDefault(require("../../constants/prop-types/aside"));
|
|
23
|
-
|
|
24
|
-
var _bookmarkWidget = _interopRequireDefault(require("@twreporter/react-components/lib/bookmark-widget"));
|
|
25
|
-
|
|
26
|
-
var _mediaQuery = _interopRequireDefault(require("@twreporter/core/lib/utils/media-query"));
|
|
27
|
-
|
|
28
|
-
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5;
|
|
29
|
-
|
|
30
|
-
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
31
|
-
|
|
32
|
-
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
33
|
-
|
|
34
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
35
|
-
|
|
36
|
-
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
|
-
|
|
40
|
-
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
|
41
|
-
|
|
42
|
-
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 } }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
43
|
-
|
|
44
|
-
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
45
|
-
|
|
46
|
-
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
|
-
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
|
-
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
51
|
-
|
|
52
|
-
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
|
-
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
55
|
-
|
|
56
|
-
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; }
|
|
57
|
-
|
|
58
|
-
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
59
|
-
|
|
60
|
-
// icons
|
|
61
|
-
var BackToTopicIcon = function BackToTopicIcon(props) {
|
|
62
|
-
return /*#__PURE__*/_react["default"].createElement("svg", props, /*#__PURE__*/_react["default"].createElement("circle", {
|
|
63
|
-
fill: "#f1f1f1",
|
|
64
|
-
cx: "18",
|
|
65
|
-
cy: "18",
|
|
66
|
-
r: "18"
|
|
67
|
-
}), /*#__PURE__*/_react["default"].createElement("path", {
|
|
68
|
-
fill: "#404040",
|
|
69
|
-
d: "M25.05 7.4H11a1.83 1.83 0 0 0-1.87 1.82v17.56A1.83 1.83 0 0 0 11 28.6h14.1a1.83 1.83 0 0 0 1.82-1.82V9.22a1.83 1.83 0 0 0-1.87-1.82zm.52 19.38a.52.52 0 0 1-.52.52H11a.52.52 0 0 1-.52-.52V9.22A.52.52 0 0 1 11 8.7h14.1a.52.52 0 0 1 .52.52z"
|
|
70
|
-
}), /*#__PURE__*/_react["default"].createElement("path", {
|
|
71
|
-
fill: "#404040",
|
|
72
|
-
d: "M23 12.88h-6.68a.65.65 0 0 0 0 1.3H23a.65.65 0 1 0 0-1.3zM23 17.35h-6.68a.65.65 0 0 0 0 1.3H23a.65.65 0 0 0 0-1.3zM23 21.82h-6.68a.65.65 0 1 0 0 1.3H23a.65.65 0 0 0 0-1.3zM13.17 12.68a.85.85 0 1 0 .84.85.85.85 0 0 0-.84-.85z"
|
|
73
|
-
}), /*#__PURE__*/_react["default"].createElement("circle", {
|
|
74
|
-
fill: "#404040",
|
|
75
|
-
cx: "13.17",
|
|
76
|
-
cy: "18",
|
|
77
|
-
r: ".85"
|
|
78
|
-
}), /*#__PURE__*/_react["default"].createElement("circle", {
|
|
79
|
-
fill: "#404040",
|
|
80
|
-
cx: "13.17",
|
|
81
|
-
cy: "22.47",
|
|
82
|
-
r: ".85"
|
|
83
|
-
}));
|
|
84
|
-
};
|
|
85
|
-
|
|
86
|
-
BackToTopicIcon.defaultProps = {
|
|
87
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
88
|
-
viewBox: "0 0 36 36"
|
|
89
|
-
};
|
|
90
|
-
|
|
91
|
-
var FBIcon = function FBIcon(props) {
|
|
92
|
-
return /*#__PURE__*/_react["default"].createElement("svg", props, /*#__PURE__*/_react["default"].createElement("circle", {
|
|
93
|
-
cx: "15",
|
|
94
|
-
cy: "15",
|
|
95
|
-
r: "15",
|
|
96
|
-
fill: "#fff"
|
|
97
|
-
}), /*#__PURE__*/_react["default"].createElement("path", {
|
|
98
|
-
fill: "#404040",
|
|
99
|
-
d: "M21.49 7.69h-13a.82.82 0 0 0-.82.81v13a.82.82 0 0 0 .82.81h7v-5.65H13.6v-2.22h1.9v-1.62a2.66 2.66 0 0 1 2.84-2.92A16 16 0 0 1 20 10v2h-1.12c-.92 0-1.1.43-1.1 1.07v1.41H20l-.28 2.21h-1.94v5.66h3.71a.82.82 0 0 0 .82-.81V8.5a.82.82 0 0 0-.82-.81"
|
|
100
|
-
}));
|
|
101
|
-
};
|
|
102
|
-
|
|
103
|
-
FBIcon.defaultProps = {
|
|
104
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
105
|
-
viewBox: "0 0 30 30"
|
|
106
|
-
};
|
|
107
|
-
|
|
108
|
-
var LineIcon = function LineIcon(props) {
|
|
109
|
-
return /*#__PURE__*/_react["default"].createElement("svg", props, /*#__PURE__*/_react["default"].createElement("circle", {
|
|
110
|
-
fill: "#fff",
|
|
111
|
-
cx: "15",
|
|
112
|
-
cy: "15",
|
|
113
|
-
r: "15"
|
|
114
|
-
}), /*#__PURE__*/_react["default"].createElement("path", {
|
|
115
|
-
fill: "#404040",
|
|
116
|
-
d: "M14.53 24.27h-.25a.48.48 0 0 1-.24-.65c0-.1.07-.2.11-.3a4.11 4.11 0 0 0 .26-1.43.43.43 0 0 0-.45-.48 11 11 0 0 1-1.17-.16 9.52 9.52 0 0 1-5.9-3.39 6.47 6.47 0 0 1-.84-7.18A8 8 0 0 1 9.73 7a11.19 11.19 0 0 1 7.7-1 9.42 9.42 0 0 1 5.73 3.4 6.45 6.45 0 0 1 1.38 5.46 7.46 7.46 0 0 1-2.08 3.72 26.71 26.71 0 0 1-4 3.31 26.48 26.48 0 0 1-4 2.38m3.15-10.75v-1.81c0-.35-.18-.54-.48-.55s-.48.2-.48.56v2.16c0 .04-.14-.09-.19-.16-.23-.3-.45-.61-.68-.92-.34-.46-.67-.92-1-1.37a.51.51 0 0 0-.75-.17.61.61 0 0 0-.18.5v3.55a.71.71 0 0 0 .05.29.46.46 0 0 0 .49.3.45.45 0 0 0 .41-.43 2.44 2.44 0 0 0 0-.27v-1.81c0-.08 0-.19.06-.22s.12.07.16.13l.63.86c.38.51.74 1 1.12 1.52a.46.46 0 0 0 .54.2.5.5 0 0 0 .35-.49v-1.87m.72 0v1.81c0 .39.18.56.56.56h1.75a.47.47 0 0 0 .53-.46.5.5 0 0 0-.52-.49H20c-.79 0-.65.12-.68-.68 0-.19 0-.26.25-.25h1.16a.48.48 0 0 0 .48-.47.46.46 0 0 0-.49-.48H20c-.66 0-.65 0-.65-.65 0-.25.09-.32.32-.31h1A.56.56 0 0 0 21 12a.43.43 0 0 0 .23-.5.44.44 0 0 0-.46-.37H19c-.44 0-.59.16-.59.61v1.77m-9.6 0v1.84c0 .39.17.55.56.55h1.71a.51.51 0 0 0 .57-.48.51.51 0 0 0-.56-.47h-1c-.35 0-.36 0-.36-.35v-2.81a.73.73 0 0 0 0-.36.45.45 0 0 0-.52-.24.43.43 0 0 0-.36.44v1.89m4.29 0v-1.86a.46.46 0 1 0-.91 0v3.7c0 .34.19.55.48.54s.44-.21.45-.54v-1.83"
|
|
117
|
-
}));
|
|
118
|
-
};
|
|
119
|
-
|
|
120
|
-
LineIcon.defaultProps = {
|
|
121
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
122
|
-
viewBox: "0 0 30 30"
|
|
123
|
-
};
|
|
124
|
-
|
|
125
|
-
var PrintIcon = function PrintIcon(props) {
|
|
126
|
-
return /*#__PURE__*/_react["default"].createElement("svg", props, /*#__PURE__*/_react["default"].createElement("circle", {
|
|
127
|
-
fill: "#f1f1f1",
|
|
128
|
-
cx: "18",
|
|
129
|
-
cy: "18",
|
|
130
|
-
r: "18"
|
|
131
|
-
}), /*#__PURE__*/_react["default"].createElement("path", {
|
|
132
|
-
fill: "#404040",
|
|
133
|
-
d: "M27.8 11.62H25V8.11A2.07 2.07 0 0 0 22.93 6h-9.86A2.07 2.07 0 0 0 11 8.11v3.51H8.2a2 2 0 0 0-2 2v9.74a2 2 0 0 0 2 2h2.63v2.59A2 2 0 0 0 12.77 30h10.46a2 2 0 0 0 1.94-2.1v-2.63h2.63a2 2 0 0 0 2-2v-9.7a2 2 0 0 0-2-1.95zM12.31 8.11a.77.77 0 0 1 .76-.77h9.86a.77.77 0 0 1 .76.77v3.51H12.31zm11.56 19.75a.74.74 0 0 1-.64.8H12.77a.74.74 0 0 1-.64-.8v-7.14a.74.74 0 0 1 .64-.8h10.46a.74.74 0 0 1 .64.8zm4.59-4.55a.66.66 0 0 1-.66.66h-2.63v-3.25a2 2 0 0 0-1.94-2.1H12.77a2 2 0 0 0-1.94 2.1V24H8.2a.66.66 0 0 1-.66-.66v-9.77a.66.66 0 0 1 .66-.65h19.6a.66.66 0 0 1 .66.65z"
|
|
134
|
-
}), /*#__PURE__*/_react["default"].createElement("path", {
|
|
135
|
-
fill: "#404040",
|
|
136
|
-
d: "M24.34 15.41a.83.83 0 1 0 .83.82.82.82 0 0 0-.83-.82zM21.65 22h-7.3a.65.65 0 0 0 0 1.3h7.3a.65.65 0 0 0 0-1.3zM21.65 25.26h-7.3a.65.65 0 0 0 0 1.3h7.3a.65.65 0 0 0 0-1.3z"
|
|
137
|
-
}));
|
|
138
|
-
};
|
|
139
|
-
|
|
140
|
-
PrintIcon.defaultProps = {
|
|
141
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
142
|
-
viewBox: "0 0 36 36"
|
|
143
|
-
};
|
|
144
|
-
|
|
145
|
-
var TextIcon = function TextIcon(props) {
|
|
146
|
-
return /*#__PURE__*/_react["default"].createElement("svg", props, /*#__PURE__*/_react["default"].createElement("circle", {
|
|
147
|
-
fill: "#f1f1f1",
|
|
148
|
-
cx: "18",
|
|
149
|
-
cy: "18",
|
|
150
|
-
r: "18"
|
|
151
|
-
}), /*#__PURE__*/_react["default"].createElement("path", {
|
|
152
|
-
fill: "#404040",
|
|
153
|
-
d: "M14.37 10.44a1.54 1.54 0 0 0-.55-.71 1.49 1.49 0 0 0-.82-.27 1.46 1.46 0 0 0-.85.27 1.48 1.48 0 0 0-.55.71L6.22 25.63a.64.64 0 0 0 .1.62.66.66 0 0 0 .56.29 1.32 1.32 0 0 0 1.26-.91l1.29-3.89a.25.25 0 0 1 .26-.18h6.48a.27.27 0 0 1 .28.18l1.24 3.84a1.38 1.38 0 0 0 .5.69 1.35 1.35 0 0 0 .83.27.66.66 0 0 0 .56-.29.67.67 0 0 0 .1-.64zM15.78 20a.11.11 0 0 1-.1.06h-5.5a.14.14 0 0 1-.12-.06.12.12 0 0 1 0-.13l2.85-8.7 2.86 8.7a.28.28 0 0 1 .01.13zM29.78 22.26l-3.17-8.52a1.17 1.17 0 0 0-.41-.52 1.1 1.1 0 0 0-.63-.2h-.17a1.09 1.09 0 0 0-.62.2 1.1 1.1 0 0 0-.41.52l-3.18 8.52a.54.54 0 0 0 .5.72 1 1 0 0 0 .62-.21 1 1 0 0 0 .4-.53l.61-1.8a.16.16 0 0 1 .15-.11h3.93a.16.16 0 0 1 .15.11l.61 1.8a1 1 0 0 0 .4.53 1 1 0 0 0 .62.21h.1a.53.53 0 0 0 .44-.23.49.49 0 0 0 .06-.49zM27 19.16h-3.08c-.07 0-.09 0-.07-.11l1.6-4.69 1.6 4.69c.04.07.01.11-.05.11z"
|
|
154
|
-
}));
|
|
155
|
-
};
|
|
156
|
-
|
|
157
|
-
TextIcon.defaultProps = {
|
|
158
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
159
|
-
viewBox: "0 0 36 36"
|
|
160
|
-
};
|
|
161
|
-
|
|
162
|
-
var TwitterIcon = function TwitterIcon(props) {
|
|
163
|
-
return /*#__PURE__*/_react["default"].createElement("svg", props, /*#__PURE__*/_react["default"].createElement("circle", {
|
|
164
|
-
fill: "#fff",
|
|
165
|
-
cx: "15",
|
|
166
|
-
cy: "15",
|
|
167
|
-
r: "15"
|
|
168
|
-
}), /*#__PURE__*/_react["default"].createElement("path", {
|
|
169
|
-
fill: "#404040",
|
|
170
|
-
d: "M12.07 22.06a9.53 9.53 0 0 0 9.82-9.39v-.42a6.82 6.82 0 0 0 1.72-1.71 7.59 7.59 0 0 1-2 .52 3.38 3.38 0 0 0 1.52-1.83A7.19 7.19 0 0 1 21 10a3.51 3.51 0 0 0-2.52-1A3.38 3.38 0 0 0 15 12.29a3.74 3.74 0 0 0 .08.75A9.94 9.94 0 0 1 8 9.59 3.23 3.23 0 0 0 9 14a3.72 3.72 0 0 1-1.56-.41 3.34 3.34 0 0 0 2.77 3.24 3.39 3.39 0 0 1-.91.12 3.49 3.49 0 0 1-.65-.06 3.45 3.45 0 0 0 3.23 2.29 7.12 7.12 0 0 1-4.29 1.41 7.38 7.38 0 0 1-.82 0 10.11 10.11 0 0 0 5.28 1.47"
|
|
171
|
-
}));
|
|
172
|
-
};
|
|
173
|
-
|
|
174
|
-
TwitterIcon.defaultProps = {
|
|
175
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
176
|
-
viewBox: "0 0 30 30"
|
|
177
|
-
}; // bookmark icons
|
|
178
|
-
|
|
179
|
-
var ToAddBookmarkIcon = function ToAddBookmarkIcon(props) {
|
|
180
|
-
return /*#__PURE__*/_react["default"].createElement("svg", props, /*#__PURE__*/_react["default"].createElement("circle", {
|
|
181
|
-
fill: "#f1f1f1",
|
|
182
|
-
cx: "18",
|
|
183
|
-
cy: "18",
|
|
184
|
-
r: "18"
|
|
185
|
-
}), /*#__PURE__*/_react["default"].createElement("path", {
|
|
186
|
-
fill: "#404040",
|
|
187
|
-
d: "M10.38 28.56a1.21 1.21 0 0 1-.61-.16 1.05 1.05 0 0 1-.58-.94V8.54a1.14 1.14 0 0 1 1.19-1.1h15.24a1.14 1.14 0 0 1 1.19 1.1v18.92a1.05 1.05 0 0 1-.58.94 1.28 1.28 0 0 1-1.31 0L18 23.82l-6.92 4.53a1.25 1.25 0 0 1-.7.21zm.11-19.82v18.45L18 22.26l7.51 4.93V8.74z"
|
|
188
|
-
}));
|
|
189
|
-
};
|
|
190
|
-
|
|
191
|
-
ToAddBookmarkIcon.defaultProps = {
|
|
192
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
193
|
-
viewBox: "0 0 36 36"
|
|
194
|
-
};
|
|
195
|
-
|
|
196
|
-
var AddedBookmarkIcon = function AddedBookmarkIcon(props) {
|
|
197
|
-
return /*#__PURE__*/_react["default"].createElement("svg", props, /*#__PURE__*/_react["default"].createElement("circle", {
|
|
198
|
-
fill: "#f1f1f1",
|
|
199
|
-
cx: "18",
|
|
200
|
-
cy: "18",
|
|
201
|
-
r: "18"
|
|
202
|
-
}), /*#__PURE__*/_react["default"].createElement("path", {
|
|
203
|
-
fill: "#404040",
|
|
204
|
-
d: "M10.38 28.56a1.21 1.21 0 0 1-.61-.16 1.05 1.05 0 0 1-.58-.94V8.54a1.14 1.14 0 0 1 1.19-1.1h15.24a1.14 1.14 0 0 1 1.19 1.1v18.92a1.05 1.05 0 0 1-.58.94 1.28 1.28 0 0 1-1.31 0L18 23.82l-6.92 4.53a1.25 1.25 0 0 1-.7.21z"
|
|
205
|
-
}));
|
|
206
|
-
};
|
|
207
|
-
|
|
208
|
-
AddedBookmarkIcon.defaultProps = {
|
|
209
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
210
|
-
viewBox: "0 0 36 36"
|
|
211
|
-
}; // @twreporter
|
|
212
|
-
|
|
213
|
-
function changeFontSizeOffsetToPct(fontSizeOffset) {
|
|
214
|
-
switch (fontSizeOffset) {
|
|
215
|
-
case 2:
|
|
216
|
-
{
|
|
217
|
-
return '110%';
|
|
218
|
-
}
|
|
219
|
-
|
|
220
|
-
case 4:
|
|
221
|
-
{
|
|
222
|
-
return '120%';
|
|
223
|
-
}
|
|
224
|
-
|
|
225
|
-
case 0:
|
|
226
|
-
default:
|
|
227
|
-
{
|
|
228
|
-
return '100%';
|
|
229
|
-
}
|
|
230
|
-
}
|
|
231
|
-
}
|
|
232
|
-
|
|
233
|
-
var iconBlockCSS = /*#__PURE__*/(0, _styledComponents.css)(["position:relative;cursor:pointer;line-height:1;svg{width:36px;height:36px;}&::after{position:absolute;top:5px;color:", ";font-size:14px;line-height:23px;visibility:hidden;width:100px;}&:hover{&::after{visibility:visible;}}", ""], _color["default"].gray95, _mediaQuery["default"].tabletAndBelow(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n &::after {\n top: 100%;\n left: 50%;\n transform: translateX(-50%);\n text-align: center;\n }\n "]))));
|
|
234
|
-
|
|
235
|
-
var TextIconBlock = /*#__PURE__*/_styledComponents["default"].div.withConfig({
|
|
236
|
-
displayName: "tools__TextIconBlock",
|
|
237
|
-
componentId: "jf7k3l-0"
|
|
238
|
-
})(["", " &::after{content:'\u5B57\u7D1A\u5927\u5C0F", "';}"], iconBlockCSS, function (props) {
|
|
239
|
-
return changeFontSizeOffsetToPct(props.theme.fontSizeOffset);
|
|
240
|
-
});
|
|
241
|
-
|
|
242
|
-
var BackToTopicBlock = /*#__PURE__*/_styledComponents["default"].div.withConfig({
|
|
243
|
-
displayName: "tools__BackToTopicBlock",
|
|
244
|
-
componentId: "jf7k3l-1"
|
|
245
|
-
})(["", " &::after{content:'\u56DE\u5230\u5C08\u984C';}"], iconBlockCSS);
|
|
246
|
-
|
|
247
|
-
var PrintIconBlock = /*#__PURE__*/_styledComponents["default"].div.withConfig({
|
|
248
|
-
displayName: "tools__PrintIconBlock",
|
|
249
|
-
componentId: "jf7k3l-2"
|
|
250
|
-
})(["", " &::after{content:'\u5217\u5370';}"], iconBlockCSS);
|
|
251
|
-
|
|
252
|
-
var BookmarkIconBlock = /*#__PURE__*/_styledComponents["default"].div.withConfig({
|
|
253
|
-
displayName: "tools__BookmarkIconBlock",
|
|
254
|
-
componentId: "jf7k3l-3"
|
|
255
|
-
})(["", " &::after{content:'", "';}"], iconBlockCSS, function (props) {
|
|
256
|
-
return props.isBookmarked ? '取消書籤' : '加入書籤';
|
|
257
|
-
});
|
|
258
|
-
|
|
259
|
-
var ShareIconBlock = /*#__PURE__*/_styledComponents["default"].div.withConfig({
|
|
260
|
-
displayName: "tools__ShareIconBlock",
|
|
261
|
-
componentId: "jf7k3l-4"
|
|
262
|
-
})(["width:36px;height:36px;padding:3px;cursor:pointer;"]);
|
|
263
|
-
|
|
264
|
-
var ToolsBlock = /*#__PURE__*/_styledComponents["default"].div.withConfig({
|
|
265
|
-
displayName: "tools__ToolsBlock",
|
|
266
|
-
componentId: "jf7k3l-5"
|
|
267
|
-
})(["display:flex;", " ", " ", " ", " ", ""], _mediaQuery["default"].mobileOnly(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n width: calc(300/375*100%);\n margin-left: auto;\n margin-right: auto;\n "]))), _mediaQuery["default"].tabletOnly(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n width: calc(453/768*100%);\n max-width: 453px;\n margin-left: auto;\n margin-right: auto;\n > svg, > div, > a {\n margin-right: 30px;\n }\n "]))), _mediaQuery["default"].tabletAndBelow(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n justify-content: space-between;\n "]))), _mediaQuery["default"].desktopAndAbove(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n width: 36px;\n height: ", ";\n flex-direction: column;\n justify-content: space-around;\n align-items: center;\n "])), function (props) {
|
|
268
|
-
return props.height || 'auto';
|
|
269
|
-
}), function (props) {
|
|
270
|
-
switch (props.theme.name) {
|
|
271
|
-
case _theme["default"].article.v2.photo:
|
|
272
|
-
return (0, _styledComponents.css)(["", "{svg circle:first-child{fill:", ";}svg path{fill:", ";}}", ",", ",", ",", "{svg circle:first-child{fill:", ";}svg path{fill:", ";}&::after{color:", ";}}", "{svg circle:not(:first-child){fill:", ";}}"], ShareIconBlock, _color["default"].gray25, _color["default"].notSoWhite, TextIconBlock, BackToTopicBlock, PrintIconBlock, BookmarkIconBlock, _color["default"].darkBlue, _color["default"].notSoWhite, _color["default"].notSoWhite, BackToTopicBlock, _color["default"].notSoWhite);
|
|
273
|
-
|
|
274
|
-
default:
|
|
275
|
-
return '';
|
|
276
|
-
}
|
|
277
|
-
});
|
|
278
|
-
|
|
279
|
-
function FBShareBT(props) {
|
|
280
|
-
var handleClick = function handleClick() {
|
|
281
|
-
var currentURL = window.location.href;
|
|
282
|
-
var location = 'https://www.facebook.com/dialog/feed?' + 'display=page' + "&app_id=".concat(props.appID) + "&link=".concat(encodeURIComponent(currentURL)) + "&redirect_uri=".concat(encodeURIComponent('https://www.facebook.com/'));
|
|
283
|
-
window.open(location, '_blank');
|
|
284
|
-
};
|
|
285
|
-
|
|
286
|
-
return /*#__PURE__*/_react["default"].createElement(ShareIconBlock, {
|
|
287
|
-
id: "fb-share"
|
|
288
|
-
}, /*#__PURE__*/_react["default"].createElement(FBIcon, {
|
|
289
|
-
width: "30px",
|
|
290
|
-
onClick: handleClick
|
|
291
|
-
}));
|
|
292
|
-
}
|
|
293
|
-
|
|
294
|
-
FBShareBT.propTypes = {
|
|
295
|
-
appID: _propTypes["default"].string.isRequired
|
|
296
|
-
};
|
|
297
|
-
|
|
298
|
-
function TwitterShareBT(props) {
|
|
299
|
-
var handleClick = function handleClick() {
|
|
300
|
-
var currentURL = window.location.href;
|
|
301
|
-
var location = 'https://twitter.com/intent/tweet?' + "url=".concat(encodeURIComponent(currentURL), "&text=").concat(encodeURIComponent(document.title + ' #報導者'));
|
|
302
|
-
window.open(location, '_blank');
|
|
303
|
-
};
|
|
304
|
-
|
|
305
|
-
return /*#__PURE__*/_react["default"].createElement(ShareIconBlock, {
|
|
306
|
-
id: "twitter-share"
|
|
307
|
-
}, /*#__PURE__*/_react["default"].createElement(TwitterIcon, {
|
|
308
|
-
width: "30px",
|
|
309
|
-
onClick: handleClick
|
|
310
|
-
}));
|
|
311
|
-
}
|
|
312
|
-
|
|
313
|
-
function LineShareBT(props) {
|
|
314
|
-
var handleClick = function handleClick() {
|
|
315
|
-
var currentURL = window.location.href;
|
|
316
|
-
var location = "https://social-plugins.line.me/lineit/share?url=".concat(encodeURIComponent(currentURL));
|
|
317
|
-
window.open(location, '_blank');
|
|
318
|
-
};
|
|
319
|
-
|
|
320
|
-
return /*#__PURE__*/_react["default"].createElement(ShareIconBlock, {
|
|
321
|
-
id: "line-share"
|
|
322
|
-
}, /*#__PURE__*/_react["default"].createElement(LineIcon, {
|
|
323
|
-
width: "30px",
|
|
324
|
-
onClick: handleClick
|
|
325
|
-
}));
|
|
326
|
-
}
|
|
327
|
-
|
|
328
|
-
var defaultFbAppID = '962589903815787';
|
|
329
|
-
|
|
330
|
-
var Tools = /*#__PURE__*/function (_React$PureComponent) {
|
|
331
|
-
_inherits(Tools, _React$PureComponent);
|
|
332
|
-
|
|
333
|
-
var _super = _createSuper(Tools);
|
|
334
|
-
|
|
335
|
-
function Tools() {
|
|
336
|
-
_classCallCheck(this, Tools);
|
|
337
|
-
|
|
338
|
-
return _super.apply(this, arguments);
|
|
339
|
-
}
|
|
340
|
-
|
|
341
|
-
_createClass(Tools, [{
|
|
342
|
-
key: "render",
|
|
343
|
-
value: function render() {
|
|
344
|
-
var _this$props = this.props,
|
|
345
|
-
backToTopic = _this$props.backToTopic,
|
|
346
|
-
fbAppID = _this$props.fbAppID,
|
|
347
|
-
height = _this$props.height,
|
|
348
|
-
onFontLevelChange = _this$props.onFontLevelChange,
|
|
349
|
-
articleMetaForBookmark = _this$props.articleMetaForBookmark;
|
|
350
|
-
return /*#__PURE__*/_react["default"].createElement(ToolsBlock, {
|
|
351
|
-
height: height
|
|
352
|
-
}, backToTopic ? /*#__PURE__*/_react["default"].createElement(_dynamicComponentsContext["default"].Consumer, null, function (components) {
|
|
353
|
-
return /*#__PURE__*/_react["default"].createElement(components.Link, {
|
|
354
|
-
to: backToTopic,
|
|
355
|
-
target: "_self"
|
|
356
|
-
}, /*#__PURE__*/_react["default"].createElement(BackToTopicBlock, null, /*#__PURE__*/_react["default"].createElement(BackToTopicIcon, null)));
|
|
357
|
-
}) : null, /*#__PURE__*/_react["default"].createElement(_bookmarkWidget["default"], {
|
|
358
|
-
toAutoCheck: false,
|
|
359
|
-
articleMeta: articleMetaForBookmark,
|
|
360
|
-
renderIcon: function renderIcon(isBookmarked, addAction, removeAction) {
|
|
361
|
-
return /*#__PURE__*/_react["default"].createElement(BookmarkIconBlock, {
|
|
362
|
-
onClick: isBookmarked ? removeAction : addAction,
|
|
363
|
-
isBookmarked: isBookmarked
|
|
364
|
-
}, isBookmarked ? /*#__PURE__*/_react["default"].createElement(AddedBookmarkIcon, null) : /*#__PURE__*/_react["default"].createElement(ToAddBookmarkIcon, null));
|
|
365
|
-
}
|
|
366
|
-
}), /*#__PURE__*/_react["default"].createElement(TextIconBlock, null, /*#__PURE__*/_react["default"].createElement(TextIcon, {
|
|
367
|
-
onClick: onFontLevelChange
|
|
368
|
-
})), /*#__PURE__*/_react["default"].createElement(PrintIconBlock, null, /*#__PURE__*/_react["default"].createElement(PrintIcon, {
|
|
369
|
-
onClick: function onClick() {
|
|
370
|
-
window.print();
|
|
371
|
-
}
|
|
372
|
-
})), /*#__PURE__*/_react["default"].createElement(FBShareBT, {
|
|
373
|
-
appID: fbAppID || defaultFbAppID
|
|
374
|
-
}), /*#__PURE__*/_react["default"].createElement(TwitterShareBT, null), /*#__PURE__*/_react["default"].createElement(LineShareBT, null));
|
|
375
|
-
}
|
|
376
|
-
}]);
|
|
377
|
-
|
|
378
|
-
return Tools;
|
|
379
|
-
}(_react["default"].PureComponent);
|
|
380
|
-
|
|
381
|
-
exports["default"] = Tools;
|
|
382
|
-
|
|
383
|
-
_defineProperty(Tools, "propTypes", _aside["default"].tools);
|