@twreporter/react-article-components 2.2.0-rc.0 → 2.2.0-rc.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +8 -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
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,14 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
# [2.2.0-rc.1](https://github.com/twreporter/twreporter-npm-packages/compare/@twreporter/react-article-components@2.2.0-rc.0...@twreporter/react-article-components@2.2.0-rc.1) (2024-06-18)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @twreporter/react-article-components
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
6
14
|
# [2.2.0-rc.0](https://github.com/twreporter/twreporter-npm-packages/compare/@twreporter/react-article-components@2.1.2-rc.1...@twreporter/react-article-components@2.2.0-rc.0) (2024-06-18)
|
|
7
15
|
|
|
8
16
|
|
|
@@ -1,184 +1,134 @@
|
|
|
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 _propTypes = _interopRequireDefault(require("prop-types"));
|
|
13
|
-
|
|
14
10
|
var _react = _interopRequireWildcard(require("react"));
|
|
15
|
-
|
|
16
11
|
var _styledComponents = _interopRequireWildcard(require("styled-components"));
|
|
17
|
-
|
|
18
12
|
var _body = _interopRequireDefault(require("./body"));
|
|
19
|
-
|
|
20
13
|
var _desktopAside = _interopRequireDefault(require("./aside/desktop-aside"));
|
|
21
|
-
|
|
22
14
|
var _donationBox = _interopRequireDefault(require("./donation-box"));
|
|
23
|
-
|
|
24
15
|
var _license = _interopRequireDefault(require("./license"));
|
|
25
|
-
|
|
26
16
|
var _link = _interopRequireDefault(require("./link"));
|
|
27
|
-
|
|
28
17
|
var _metadata = _interopRequireDefault(require("./aside/metadata"));
|
|
29
|
-
|
|
30
18
|
var _related = _interopRequireDefault(require("./related"));
|
|
31
|
-
|
|
32
19
|
var _separationCurve = _interopRequireDefault(require("./separation-curve"));
|
|
33
|
-
|
|
34
20
|
var _uiManager = _interopRequireDefault(require("../managers/ui-manager"));
|
|
35
|
-
|
|
36
21
|
var _theme = _interopRequireDefault(require("../constants/theme"));
|
|
37
|
-
|
|
38
22
|
var _anchor = require("../constants/anchor");
|
|
39
|
-
|
|
40
23
|
var _mediaQuery = _interopRequireDefault(require("@twreporter/core/lib/utils/media-query"));
|
|
41
|
-
|
|
42
24
|
var _propTypes2 = _interopRequireDefault(require("@twreporter/core/lib/constants/prop-types"));
|
|
43
|
-
|
|
44
25
|
var _releaseBranch = _interopRequireDefault(require("@twreporter/core/lib/constants/release-branch"));
|
|
45
|
-
|
|
46
26
|
var _color = require("@twreporter/core/lib/constants/color");
|
|
47
|
-
|
|
48
27
|
var _desktopTools = _interopRequireDefault(require("./aside/desktop-tools"));
|
|
49
|
-
|
|
50
28
|
var _mobileToolBar = _interopRequireDefault(require("./aside/mobile-tool-bar"));
|
|
51
|
-
|
|
52
29
|
var _get = _interopRequireDefault(require("lodash/get"));
|
|
53
|
-
|
|
54
30
|
var _throttle = _interopRequireDefault(require("lodash/throttle"));
|
|
55
|
-
|
|
56
|
-
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9, _templateObject10, _templateObject11, _templateObject12, _templateObject13, _templateObject14, _templateObject15, _templateObject16, _templateObject17, _templateObject18, _templateObject19, _templateObject20;
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
31
|
+
var _reactRedux = require("react-redux");
|
|
32
|
+
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9, _templateObject10, _templateObject11, _templateObject12, _templateObject13, _templateObject14, _templateObject15, _templateObject16, _templateObject17, _templateObject18, _templateObject19, _templateObject20; // components
|
|
33
|
+
// constants
|
|
34
|
+
// @twreporter
|
|
35
|
+
// aside
|
|
36
|
+
// lodash
|
|
37
|
+
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); }
|
|
38
|
+
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; }
|
|
62
39
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
63
|
-
|
|
64
40
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
65
|
-
|
|
66
|
-
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); } }
|
|
67
|
-
|
|
41
|
+
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); } }
|
|
68
42
|
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
69
|
-
|
|
70
43
|
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); }
|
|
71
|
-
|
|
72
44
|
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
73
|
-
|
|
74
45
|
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); }; }
|
|
75
|
-
|
|
76
46
|
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); }
|
|
77
|
-
|
|
78
47
|
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
79
|
-
|
|
80
48
|
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; } }
|
|
81
|
-
|
|
82
49
|
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
83
|
-
|
|
84
|
-
function
|
|
85
|
-
|
|
50
|
+
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; }
|
|
51
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
52
|
+
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); }
|
|
86
53
|
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
87
|
-
|
|
88
54
|
var _ = {
|
|
89
55
|
get: _get["default"],
|
|
90
56
|
throttle: _throttle["default"]
|
|
91
57
|
};
|
|
92
58
|
var shiftLeftCss = /*#__PURE__*/(0, _styledComponents.css)(["position:relative;width:calc(100% + 20px);left:-10px;"]);
|
|
93
|
-
|
|
94
59
|
var BorderBox = /*#__PURE__*/_styledComponents["default"].div.withConfig({
|
|
95
60
|
displayName: "article-page__BorderBox",
|
|
96
61
|
componentId: "sc-1wuywdb-0"
|
|
97
62
|
})(["*{box-sizing:border-box;}"]);
|
|
98
|
-
|
|
99
63
|
var LeadingBlock = /*#__PURE__*/_styledComponents["default"].div.withConfig({
|
|
100
64
|
displayName: "article-page__LeadingBlock",
|
|
101
65
|
componentId: "sc-1wuywdb-1"
|
|
102
66
|
})(["", ""], shiftLeftCss);
|
|
103
|
-
|
|
104
67
|
var SeprationLine = /*#__PURE__*/_styledComponents["default"].div.withConfig({
|
|
105
68
|
displayName: "article-page__SeprationLine",
|
|
106
69
|
componentId: "sc-1wuywdb-2"
|
|
107
70
|
})(["", ""], _mediaQuery["default"].desktopAndAbove(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n ", "\n "])), function (props) {
|
|
108
71
|
return props.$visible ? (0, _styledComponents.css)(["width:100%;border-bottom:solid 1px ", ";padding-bottom:60px;"], _color.colorGrayscale.gray200) : (0, _styledComponents.css)(["padding-bottom:30px;"]);
|
|
109
72
|
}));
|
|
110
|
-
|
|
111
73
|
var BodyBackground = /*#__PURE__*/_styledComponents["default"].div.withConfig({
|
|
112
74
|
displayName: "article-page__BodyBackground",
|
|
113
75
|
componentId: "sc-1wuywdb-3"
|
|
114
76
|
})(["width:100%;padding-bottom:80px;", " ", ""], _mediaQuery["default"].desktopOnly(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n padding-top: 60px;\n "]))), _mediaQuery["default"].hdOnly(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n padding-top: 55px;\n "]))));
|
|
115
|
-
|
|
116
77
|
var BodyBlock = /*#__PURE__*/_styledComponents["default"].div.withConfig({
|
|
117
78
|
displayName: "article-page__BodyBlock",
|
|
118
79
|
componentId: "sc-1wuywdb-4"
|
|
119
80
|
})(["position:relative;width:100%;", " ", ""], _mediaQuery["default"].desktopOnly(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n max-width: 1024px;\n margin: 0 auto;\n "]))), _mediaQuery["default"].hdOnly(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n max-width: 1440px;\n margin: 0 auto;\n "]))));
|
|
120
|
-
|
|
121
81
|
var DesktopAsideBlock = /*#__PURE__*/_styledComponents["default"].div.withConfig({
|
|
122
82
|
displayName: "article-page__DesktopAsideBlock",
|
|
123
83
|
componentId: "sc-1wuywdb-5"
|
|
124
84
|
})(["", " ", " ", " ", ""], _mediaQuery["default"].tabletAndBelow(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["\n display: none;\n "]))), _mediaQuery["default"].desktopAndAbove(_templateObject7 || (_templateObject7 = _taggedTemplateLiteral(["\n position: absolute;\n height: 100%;\n "]))), _mediaQuery["default"].desktopOnly(_templateObject8 || (_templateObject8 = _taggedTemplateLiteral(["\n width: 190px;\n left: 28px;\n "]))), _mediaQuery["default"].hdOnly(_templateObject9 || (_templateObject9 = _taggedTemplateLiteral(["\n width: 250px;\n left: 53px;\n "]))));
|
|
125
|
-
|
|
126
85
|
var MetadataAndToolsBlock = /*#__PURE__*/_styledComponents["default"].div.withConfig({
|
|
127
86
|
displayName: "article-page__MetadataAndToolsBlock",
|
|
128
87
|
componentId: "sc-1wuywdb-6"
|
|
129
88
|
})(["", " ", " ", ""], _mediaQuery["default"].mobileOnly(_templateObject10 || (_templateObject10 = _taggedTemplateLiteral(["\n padding-top: 33px;\n padding-bottom: 33px;\n "]))), _mediaQuery["default"].tabletOnly(_templateObject11 || (_templateObject11 = _taggedTemplateLiteral(["\n padding-top: 60px;\n padding-bottom: 60px;\n "]))), _mediaQuery["default"].desktopAndAbove(_templateObject12 || (_templateObject12 = _taggedTemplateLiteral(["\n display: none;\n "]))));
|
|
130
|
-
|
|
131
89
|
var DesktopToolsBlock = /*#__PURE__*/_styledComponents["default"].div.withConfig({
|
|
132
90
|
displayName: "article-page__DesktopToolsBlock",
|
|
133
91
|
componentId: "sc-1wuywdb-7"
|
|
134
92
|
})(["", ""], _mediaQuery["default"].tabletAndBelow(_templateObject13 || (_templateObject13 = _taggedTemplateLiteral(["\n display: none;\n "]))));
|
|
135
|
-
|
|
136
93
|
var MobileToolBar = /*#__PURE__*/(0, _styledComponents["default"])(_mobileToolBar["default"]).withConfig({
|
|
137
94
|
displayName: "article-page__MobileToolBar",
|
|
138
95
|
componentId: "sc-1wuywdb-8"
|
|
139
96
|
})(["", ""], _mediaQuery["default"].desktopAndAbove(_templateObject14 || (_templateObject14 = _taggedTemplateLiteral(["\n display: none;\n "]))));
|
|
140
|
-
|
|
141
97
|
var ContentBlock = /*#__PURE__*/_styledComponents["default"].div.withConfig({
|
|
142
98
|
displayName: "article-page__ContentBlock",
|
|
143
99
|
componentId: "sc-1wuywdb-9"
|
|
144
100
|
})(["margin:0 auto;", " ", " ", ""], _mediaQuery["default"].tabletAndBelow(_templateObject15 || (_templateObject15 = _taggedTemplateLiteral(["\n ", "\n "])), shiftLeftCss), _mediaQuery["default"].desktopOnly(_templateObject16 || (_templateObject16 = _taggedTemplateLiteral(["\n width: 550px;\n "]))), _mediaQuery["default"].hdOnly(_templateObject17 || (_templateObject17 = _taggedTemplateLiteral(["\n width: 730px;\n "]))));
|
|
145
|
-
|
|
146
101
|
var StyledSeparationCurve = /*#__PURE__*/(0, _styledComponents["default"])(_separationCurve["default"]).withConfig({
|
|
147
102
|
displayName: "article-page__StyledSeparationCurve",
|
|
148
103
|
componentId: "sc-1wuywdb-10"
|
|
149
104
|
})(["", ""], _mediaQuery["default"].desktopAndAbove(_templateObject18 || (_templateObject18 = _taggedTemplateLiteral(["\n display: none;\n "]))));
|
|
150
|
-
|
|
151
105
|
var RelatedBlock = /*#__PURE__*/_styledComponents["default"].div.withConfig({
|
|
152
106
|
displayName: "article-page__RelatedBlock",
|
|
153
107
|
componentId: "sc-1wuywdb-11"
|
|
154
108
|
})(["margin-left:auto;margin-right:auto;margin-bottom:0;width:100%;", " ", ""], _mediaQuery["default"].desktopOnly(_templateObject19 || (_templateObject19 = _taggedTemplateLiteral(["\n max-width: 1024px;\n margin-top: 60px;\n "]))), _mediaQuery["default"].hdOnly(_templateObject20 || (_templateObject20 = _taggedTemplateLiteral(["\n max-width: 1440px;\n margin-top: 90px;\n "]))));
|
|
155
|
-
|
|
156
109
|
var BackgroundBlock = /*#__PURE__*/(0, _styledComponents["default"])(BorderBox).withConfig({
|
|
157
110
|
displayName: "article-page__BackgroundBlock",
|
|
158
111
|
componentId: "sc-1wuywdb-12"
|
|
159
112
|
})(["", " @media print{-webkit-print-color-adjust:exact;color-adjust:exact;.hidden-print{display:none;}.avoid-break{break-inside:avoid;}}padding-left:10px;padding-right:10px;"], function (props) {
|
|
160
113
|
return getBackgroundBlockStyles(props.theme.name);
|
|
161
114
|
});
|
|
162
|
-
|
|
163
115
|
function getBackgroundBlockStyles(themeName) {
|
|
164
116
|
switch (themeName) {
|
|
165
117
|
case _theme["default"].article.v2.pink:
|
|
166
118
|
return (0, _styledComponents.css)(["background-color:", ";", "{background-color:", ";}"], _color.COLOR_PINK_ARTICLE.lightPink, BodyBackground, _color.colorGrayscale.gray100);
|
|
167
|
-
|
|
168
119
|
case _theme["default"].article.v2.photo:
|
|
169
120
|
return (0, _styledComponents.css)(["background-color:", ";", "{background-color:", ";}"], _color.COLOR_PINK_ARTICLE.darkBlue, BodyBackground, _color.COLOR_PINK_ARTICLE.darkBlue);
|
|
170
|
-
|
|
171
121
|
case _theme["default"].article.v2["default"]:
|
|
172
122
|
default:
|
|
173
123
|
return (0, _styledComponents.css)(["background-color:", ";", "{background-color:", ";}"], _color.colorGrayscale.gray100, BodyBackground, _color.colorGrayscale.gray100);
|
|
174
124
|
}
|
|
175
125
|
}
|
|
176
|
-
|
|
177
126
|
var _fontLevel = {
|
|
178
127
|
small: 'small',
|
|
179
128
|
medium: 'medium',
|
|
180
129
|
large: 'large'
|
|
181
130
|
};
|
|
131
|
+
|
|
182
132
|
/**
|
|
183
133
|
* @module Article
|
|
184
134
|
*/
|
|
@@ -230,42 +180,33 @@ var _fontLevel = {
|
|
|
230
180
|
*/
|
|
231
181
|
|
|
232
182
|
function noop() {}
|
|
183
|
+
|
|
233
184
|
/**
|
|
234
185
|
* @exports
|
|
235
186
|
*/
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
var Article = /*#__PURE__*/function (_PureComponent) {
|
|
187
|
+
var Article = exports["default"] = /*#__PURE__*/function (_PureComponent) {
|
|
239
188
|
_inherits(Article, _PureComponent);
|
|
240
|
-
|
|
241
189
|
var _super = _createSuper(Article);
|
|
242
|
-
|
|
243
190
|
function Article(props) {
|
|
244
191
|
var _this;
|
|
245
|
-
|
|
246
192
|
_classCallCheck(this, Article);
|
|
247
|
-
|
|
248
193
|
_this = _super.call(this, props);
|
|
249
|
-
|
|
250
194
|
_defineProperty(_assertThisInitialized(_this), "changeFontLevel", function () {
|
|
251
195
|
var _this$props = _this.props,
|
|
252
|
-
|
|
253
|
-
|
|
196
|
+
fontLevel = _this$props.fontLevel,
|
|
197
|
+
onFontLevelChange = _this$props.onFontLevelChange;
|
|
254
198
|
var nextFontLevel = '';
|
|
255
|
-
|
|
256
199
|
switch (fontLevel) {
|
|
257
200
|
case _fontLevel.medium:
|
|
258
201
|
{
|
|
259
202
|
nextFontLevel = _fontLevel.large;
|
|
260
203
|
break;
|
|
261
204
|
}
|
|
262
|
-
|
|
263
205
|
case _fontLevel.large:
|
|
264
206
|
{
|
|
265
207
|
nextFontLevel = _fontLevel.small;
|
|
266
208
|
break;
|
|
267
209
|
}
|
|
268
|
-
|
|
269
210
|
case _fontLevel.small:
|
|
270
211
|
default:
|
|
271
212
|
{
|
|
@@ -273,12 +214,10 @@ var Article = /*#__PURE__*/function (_PureComponent) {
|
|
|
273
214
|
break;
|
|
274
215
|
}
|
|
275
216
|
}
|
|
276
|
-
|
|
277
217
|
if (typeof onFontLevelChange === 'function') {
|
|
278
218
|
onFontLevelChange(nextFontLevel);
|
|
279
219
|
}
|
|
280
220
|
});
|
|
281
|
-
|
|
282
221
|
_this.state = {
|
|
283
222
|
scrollStage: 1
|
|
284
223
|
};
|
|
@@ -287,7 +226,6 @@ var Article = /*#__PURE__*/function (_PureComponent) {
|
|
|
287
226
|
_this.handleScroll = _.throttle(_this._handleScroll.bind(_assertThisInitialized(_this)), 500);
|
|
288
227
|
return _this;
|
|
289
228
|
}
|
|
290
|
-
|
|
291
229
|
_createClass(Article, [{
|
|
292
230
|
key: "getFontSizeOffset",
|
|
293
231
|
value: function getFontSizeOffset(fontLevel) {
|
|
@@ -296,12 +234,10 @@ var Article = /*#__PURE__*/function (_PureComponent) {
|
|
|
296
234
|
{
|
|
297
235
|
return 2;
|
|
298
236
|
}
|
|
299
|
-
|
|
300
237
|
case _fontLevel.large:
|
|
301
238
|
{
|
|
302
239
|
return 4;
|
|
303
240
|
}
|
|
304
|
-
|
|
305
241
|
case _fontLevel.small:
|
|
306
242
|
default:
|
|
307
243
|
{
|
|
@@ -315,14 +251,11 @@ var Article = /*#__PURE__*/function (_PureComponent) {
|
|
|
315
251
|
var scrollThreshold = 16;
|
|
316
252
|
this.lastY = window.pageYOffset;
|
|
317
253
|
var scrollDistance = Math.abs(this.currentY - this.lastY);
|
|
318
|
-
|
|
319
254
|
if (scrollDistance < scrollThreshold) {
|
|
320
255
|
return;
|
|
321
256
|
}
|
|
322
|
-
|
|
323
257
|
var scrollDirection = this.lastY > this.currentY ? 'down' : 'up';
|
|
324
258
|
this.currentY = this.lastY;
|
|
325
|
-
|
|
326
259
|
if (scrollDirection === 'up') {
|
|
327
260
|
this.setState(function (prevState) {
|
|
328
261
|
return {
|
|
@@ -353,16 +286,17 @@ var Article = /*#__PURE__*/function (_PureComponent) {
|
|
|
353
286
|
key: "render",
|
|
354
287
|
value: function render() {
|
|
355
288
|
var _this$props2 = this.props,
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
289
|
+
LinkComponent = _this$props2.LinkComponent,
|
|
290
|
+
fontLevel = _this$props2.fontLevel,
|
|
291
|
+
post = _this$props2.post,
|
|
292
|
+
relatedPosts = _this$props2.relatedPosts,
|
|
293
|
+
relatedTopic = _this$props2.relatedTopic,
|
|
294
|
+
hasMoreRelateds = _this$props2.hasMoreRelateds,
|
|
295
|
+
loadMoreRelateds = _this$props2.loadMoreRelateds,
|
|
296
|
+
releaseBranch = _this$props2.releaseBranch,
|
|
297
|
+
onToggleTabExpanded = _this$props2.onToggleTabExpanded,
|
|
298
|
+
store = _this$props2.store,
|
|
299
|
+
trackingSection = _this$props2.trackingSection;
|
|
366
300
|
var articleMetaForBookmark = {
|
|
367
301
|
slug: _.get(post, 'slug', ''),
|
|
368
302
|
title: _.get(post, 'title', ''),
|
|
@@ -376,8 +310,9 @@ var Article = /*#__PURE__*/function (_PureComponent) {
|
|
|
376
310
|
var uiManager = new _uiManager["default"](post, relatedTopic);
|
|
377
311
|
var LeadingComponent = uiManager.getLeadingComponent();
|
|
378
312
|
var leadingProps = uiManager.getLeadingComponentProps();
|
|
379
|
-
var backToTopic = leadingProps && leadingProps.isTopicPublished ? leadingProps.topicHref : '';
|
|
313
|
+
var backToTopic = leadingProps && leadingProps.isTopicPublished ? leadingProps.topicHref : '';
|
|
380
314
|
|
|
315
|
+
// only for tablet and below
|
|
381
316
|
var metadataAndToolsJSX = /*#__PURE__*/_react["default"].createElement(MetadataAndToolsBlock, null, /*#__PURE__*/_react["default"].createElement(_metadata["default"], {
|
|
382
317
|
categorySet: post.category_set,
|
|
383
318
|
date: post.published_date,
|
|
@@ -392,8 +327,9 @@ var Article = /*#__PURE__*/function (_PureComponent) {
|
|
|
392
327
|
backToTopic: backToTopic,
|
|
393
328
|
onFontLevelChange: this.changeFontLevel
|
|
394
329
|
})));
|
|
395
|
-
|
|
396
|
-
|
|
330
|
+
return /*#__PURE__*/_react["default"].createElement(_reactRedux.Provider, {
|
|
331
|
+
store: store
|
|
332
|
+
}, /*#__PURE__*/_react["default"].createElement(_styledComponents.ThemeProvider, {
|
|
397
333
|
theme: {
|
|
398
334
|
name: _.get(post, 'style', _theme["default"].article.v2["default"]),
|
|
399
335
|
colors: uiManager.getThemeColors(),
|
|
@@ -411,7 +347,8 @@ var Article = /*#__PURE__*/function (_PureComponent) {
|
|
|
411
347
|
backToTopic: backToTopic,
|
|
412
348
|
articleMetaForBookmark: articleMetaForBookmark,
|
|
413
349
|
onFontLevelChange: this.changeFontLevel,
|
|
414
|
-
scrollStage: this.state.scrollStage
|
|
350
|
+
scrollStage: this.state.scrollStage,
|
|
351
|
+
trackingSection: trackingSection
|
|
415
352
|
}), /*#__PURE__*/_react["default"].createElement(DesktopAsideBlock, null, /*#__PURE__*/_react["default"].createElement(_desktopAside["default"], {
|
|
416
353
|
backToTopic: backToTopic,
|
|
417
354
|
categorySet: post.category_set,
|
|
@@ -429,27 +366,21 @@ var Article = /*#__PURE__*/function (_PureComponent) {
|
|
|
429
366
|
brief: _.get(post, 'brief.api_data'),
|
|
430
367
|
content: _.get(post, 'content.api_data'),
|
|
431
368
|
onToggleTabExpanded: onToggleTabExpanded,
|
|
432
|
-
scrollStage: this.state.scrollStage
|
|
433
|
-
trackingSection: trackingSection
|
|
369
|
+
scrollStage: this.state.scrollStage
|
|
434
370
|
})), metadataAndToolsJSX), /*#__PURE__*/_react["default"].createElement(_donationBox["default"], null), /*#__PURE__*/_react["default"].createElement(_license["default"], {
|
|
435
371
|
license: post.copyright,
|
|
436
372
|
publishedDate: post.published_date,
|
|
437
373
|
id: _anchor.RELATED_POST_ANCHOR_ID // current scroll to releated post anchor
|
|
438
|
-
|
|
439
374
|
}), /*#__PURE__*/_react["default"].createElement(StyledSeparationCurve, null), /*#__PURE__*/_react["default"].createElement(RelatedBlock, null, /*#__PURE__*/_react["default"].createElement(_related["default"], {
|
|
440
375
|
id: post.id,
|
|
441
376
|
data: relatedPosts,
|
|
442
377
|
hasMore: hasMoreRelateds,
|
|
443
378
|
loadMore: loadMoreRelateds
|
|
444
|
-
}))))));
|
|
379
|
+
})))))));
|
|
445
380
|
}
|
|
446
381
|
}]);
|
|
447
|
-
|
|
448
382
|
return Article;
|
|
449
383
|
}(_react.PureComponent);
|
|
450
|
-
|
|
451
|
-
exports["default"] = Article;
|
|
452
|
-
|
|
453
384
|
_defineProperty(Article, "propTypes", {
|
|
454
385
|
post: _propTypes["default"].object.isRequired,
|
|
455
386
|
relatedTopic: _propTypes["default"].object,
|
|
@@ -461,9 +392,9 @@ _defineProperty(Article, "propTypes", {
|
|
|
461
392
|
loadMoreRelateds: _propTypes["default"].func,
|
|
462
393
|
releaseBranch: _propTypes2["default"].releaseBranch,
|
|
463
394
|
onToggleTabExpanded: _propTypes["default"].func,
|
|
395
|
+
store: _propTypes["default"].object,
|
|
464
396
|
trackingSection: _propTypes["default"].array
|
|
465
397
|
});
|
|
466
|
-
|
|
467
398
|
_defineProperty(Article, "defaultProps", {
|
|
468
399
|
LinkComponent: _link["default"],
|
|
469
400
|
fontLevel: _fontLevel.small,
|
|
@@ -1,68 +1,45 @@
|
|
|
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 _metadata = _interopRequireDefault(require("./metadata"));
|
|
11
|
-
|
|
12
8
|
var _react = _interopRequireDefault(require("react"));
|
|
13
|
-
|
|
14
9
|
var _desktopTools = _interopRequireDefault(require("./desktop-tools"));
|
|
15
|
-
|
|
16
10
|
var _aside = _interopRequireDefault(require("../../constants/prop-types/aside"));
|
|
17
|
-
|
|
18
11
|
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
19
|
-
|
|
20
12
|
var _reactWaypoint = require("react-waypoint");
|
|
21
|
-
|
|
22
13
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
23
|
-
|
|
24
|
-
function
|
|
25
|
-
|
|
26
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
27
|
-
|
|
14
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
15
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
16
|
+
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); }
|
|
28
17
|
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
|
-
|
|
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, _toPropertyKey(descriptor.key), descriptor); } }
|
|
32
19
|
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
33
|
-
|
|
34
20
|
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); }
|
|
35
|
-
|
|
36
21
|
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
37
|
-
|
|
38
22
|
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
23
|
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
24
|
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
43
|
-
|
|
44
25
|
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
26
|
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
47
|
-
|
|
48
|
-
function
|
|
49
|
-
|
|
27
|
+
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; }
|
|
28
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
29
|
+
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); }
|
|
50
30
|
var _toolPosition = {
|
|
51
31
|
top: 'top',
|
|
52
32
|
fixed: 'fixed',
|
|
53
33
|
bottom: 'bottom'
|
|
54
34
|
};
|
|
55
|
-
|
|
56
35
|
var AsideFlexBox = /*#__PURE__*/_styledComponents["default"].aside.withConfig({
|
|
57
36
|
displayName: "desktop-aside__AsideFlexBox",
|
|
58
37
|
componentId: "physaw-0"
|
|
59
38
|
})(["height:100%;display:flex;flex-direction:column;justify-content:space-between;"]);
|
|
60
|
-
|
|
61
39
|
var ToolsFixedArea = /*#__PURE__*/_styledComponents["default"].div.withConfig({
|
|
62
40
|
displayName: "desktop-aside__ToolsFixedArea",
|
|
63
41
|
componentId: "physaw-1"
|
|
64
42
|
})(["position:relative;flex-grow:1;margin-top:90px;margin-bottom:90px;"]);
|
|
65
|
-
|
|
66
43
|
var ToolsPositioningBlock = /*#__PURE__*/_styledComponents["default"].div.withConfig({
|
|
67
44
|
displayName: "desktop-aside__ToolsPositioningBlock",
|
|
68
45
|
componentId: "physaw-2"
|
|
@@ -72,10 +49,8 @@ var ToolsPositioningBlock = /*#__PURE__*/_styledComponents["default"].div.withCo
|
|
|
72
49
|
switch (props.toolPosition) {
|
|
73
50
|
case _toolPosition.fixed:
|
|
74
51
|
return '50%';
|
|
75
|
-
|
|
76
52
|
case _toolPosition.top:
|
|
77
53
|
return '0';
|
|
78
|
-
|
|
79
54
|
case _toolPosition.bottom:
|
|
80
55
|
default:
|
|
81
56
|
return 'auto';
|
|
@@ -84,7 +59,6 @@ var ToolsPositioningBlock = /*#__PURE__*/_styledComponents["default"].div.withCo
|
|
|
84
59
|
switch (props.$toolPosition) {
|
|
85
60
|
case _toolPosition.bottom:
|
|
86
61
|
return '0';
|
|
87
|
-
|
|
88
62
|
case _toolPosition.fixed:
|
|
89
63
|
case _toolPosition.top:
|
|
90
64
|
default:
|
|
@@ -93,14 +67,12 @@ var ToolsPositioningBlock = /*#__PURE__*/_styledComponents["default"].div.withCo
|
|
|
93
67
|
}, function (props) {
|
|
94
68
|
return props.$toolPosition === _toolPosition.fixed ? 'translateY(-50%)' : 'none';
|
|
95
69
|
});
|
|
96
|
-
|
|
97
70
|
var TriggerFixBlock = /*#__PURE__*/_styledComponents["default"].div.withConfig({
|
|
98
71
|
displayName: "desktop-aside__TriggerFixBlock",
|
|
99
72
|
componentId: "physaw-3"
|
|
100
73
|
})(["position:absolute;height:", "px;"], function (props) {
|
|
101
74
|
return props.$height;
|
|
102
75
|
});
|
|
103
|
-
|
|
104
76
|
var TriggerFixTopBlock = /*#__PURE__*/(0, _styledComponents["default"])(TriggerFixBlock).withConfig({
|
|
105
77
|
displayName: "desktop-aside__TriggerFixTopBlock",
|
|
106
78
|
componentId: "physaw-4"
|
|
@@ -109,17 +81,12 @@ var TriggerFixBottomBlock = /*#__PURE__*/(0, _styledComponents["default"])(Trigg
|
|
|
109
81
|
displayName: "desktop-aside__TriggerFixBottomBlock",
|
|
110
82
|
componentId: "physaw-5"
|
|
111
83
|
})(["bottom:0;"]);
|
|
112
|
-
|
|
113
|
-
var Aside = /*#__PURE__*/function (_React$PureComponent) {
|
|
84
|
+
var Aside = exports["default"] = /*#__PURE__*/function (_React$PureComponent) {
|
|
114
85
|
_inherits(Aside, _React$PureComponent);
|
|
115
|
-
|
|
116
86
|
var _super = _createSuper(Aside);
|
|
117
|
-
|
|
118
87
|
function Aside(props) {
|
|
119
88
|
var _this;
|
|
120
|
-
|
|
121
89
|
_classCallCheck(this, Aside);
|
|
122
|
-
|
|
123
90
|
_this = _super.call(this, props);
|
|
124
91
|
_this.state = {
|
|
125
92
|
toolPosition: _toolPosition.top
|
|
@@ -129,20 +96,19 @@ var Aside = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
129
96
|
_this.setToolsBottom = _this.setToolsPosition.bind(_assertThisInitialized(_this), _toolPosition.bottom);
|
|
130
97
|
return _this;
|
|
131
98
|
}
|
|
132
|
-
|
|
133
99
|
_createClass(Aside, [{
|
|
134
100
|
key: "setToolsPosition",
|
|
135
101
|
value: function setToolsPosition(nextPosition, waypointObj) {
|
|
136
102
|
var toolPosition = this.state.toolPosition;
|
|
137
|
-
|
|
138
|
-
|
|
103
|
+
if (
|
|
104
|
+
// viewport is below `ToolsFixedArea`
|
|
139
105
|
// make toolPosition stay at `bottom`
|
|
140
|
-
toolPosition === _toolPosition.bottom && waypointObj.currentPosition === 'above' ||
|
|
106
|
+
toolPosition === _toolPosition.bottom && waypointObj.currentPosition === 'above' ||
|
|
107
|
+
// viewport is above `ToolsFixedArea`
|
|
141
108
|
// make toolPosition stay at top
|
|
142
109
|
toolPosition === _toolPosition.top && waypointObj.currentPosition === 'below') {
|
|
143
110
|
return;
|
|
144
111
|
}
|
|
145
|
-
|
|
146
112
|
this.setState({
|
|
147
113
|
toolPosition: nextPosition
|
|
148
114
|
});
|
|
@@ -153,20 +119,19 @@ var Aside = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
153
119
|
var toolsHeight = 258; // px
|
|
154
120
|
|
|
155
121
|
var _this$props = this.props,
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
122
|
+
articleMetaForBookmark = _this$props.articleMetaForBookmark,
|
|
123
|
+
backToTopic = _this$props.backToTopic,
|
|
124
|
+
categories = _this$props.categories,
|
|
125
|
+
categorySet = _this$props.categorySet,
|
|
126
|
+
date = _this$props.date,
|
|
127
|
+
designers = _this$props.designers,
|
|
128
|
+
engineers = _this$props.engineers,
|
|
129
|
+
onFontLevelChange = _this$props.onFontLevelChange,
|
|
130
|
+
photographers = _this$props.photographers,
|
|
131
|
+
rawAutherText = _this$props.rawAutherText,
|
|
132
|
+
tags = _this$props.tags,
|
|
133
|
+
title = _this$props.title,
|
|
134
|
+
writers = _this$props.writers;
|
|
170
135
|
var metadataJSX = /*#__PURE__*/_react["default"].createElement(_metadata["default"], {
|
|
171
136
|
categories: categories,
|
|
172
137
|
categorySet: categorySet,
|
|
@@ -178,7 +143,6 @@ var Aside = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
178
143
|
engineers: engineers,
|
|
179
144
|
rawAutherText: rawAutherText
|
|
180
145
|
});
|
|
181
|
-
|
|
182
146
|
return /*#__PURE__*/_react["default"].createElement(AsideFlexBox, null, metadataJSX, /*#__PURE__*/_react["default"].createElement(ToolsFixedArea, null, /*#__PURE__*/_react["default"].createElement(_reactWaypoint.Waypoint, {
|
|
183
147
|
onEnter: this.setToolsTop,
|
|
184
148
|
onLeave: this.setToolsFixed,
|
|
@@ -202,10 +166,6 @@ var Aside = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
202
166
|
}))), metadataJSX);
|
|
203
167
|
}
|
|
204
168
|
}]);
|
|
205
|
-
|
|
206
169
|
return Aside;
|
|
207
170
|
}(_react["default"].PureComponent);
|
|
208
|
-
|
|
209
|
-
exports["default"] = Aside;
|
|
210
|
-
|
|
211
171
|
_defineProperty(Aside, "propTypes", _objectSpread(_objectSpread({}, _aside["default"].metadata), _aside["default"].tools));
|