@quintype/arrow 3.15.1-perf.1 → 3.15.1-perf.4
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/atoms/Author/index.js +48 -2128
- package/atoms/Author/styles.arrow.css +1 -1
- package/atoms/AuthorWithTime/index.js +116 -2556
- package/atoms/AuthorWithTime/styles.arrow.css +1 -1
- package/atoms/CollectionName/index.js +48 -2127
- package/atoms/CollectionName/styles.arrow.css +1 -1
- package/atoms/ExtendedLoadMore/{index-6f8c780e.js → index-0f809dd9.js} +73 -62
- package/atoms/ExtendedLoadMore/index-142f015c.js +476 -0
- package/atoms/ExtendedLoadMore/{index-2d713010.js → index-37a9ccff.js} +63 -47
- package/atoms/ExtendedLoadMore/{index-8345922c.js → index-446679c8.js} +67 -51
- package/atoms/ExtendedLoadMore/{index-6daa674c.js → index-44f97338.js} +86 -68
- package/atoms/ExtendedLoadMore/{index-c8f346d0.js → index-57dd4870.js} +80 -64
- package/atoms/ExtendedLoadMore/{index-7eb05b3d.js → index-66dd4dbd.js} +70 -54
- package/atoms/ExtendedLoadMore/{index-6cb56d1a.js → index-8462c597.js} +93 -80
- package/atoms/ExtendedLoadMore/{index-aa8b8ab8.js → index-93cb06d1.js} +252 -226
- package/atoms/ExtendedLoadMore/index-afd44863.js +95 -0
- package/atoms/ExtendedLoadMore/{index-5a7900ba.js → index-b5754c5d.js} +67 -53
- package/atoms/ExtendedLoadMore/{index-4191a84c.js → index-bbaf526e.js} +78 -62
- package/atoms/ExtendedLoadMore/{index-99af722e.js → index-cfb262ef.js} +65 -48
- package/atoms/ExtendedLoadMore/index.js +20 -5
- package/atoms/ExtendedLoadMore/styles.arrow.css +1 -1
- package/atoms/Headline/index.js +95 -2175
- package/atoms/Headline/styles.arrow.css +1 -1
- package/atoms/HeroImage/index.js +91 -2230
- package/atoms/HeroImage/styles.arrow.css +1 -1
- package/atoms/LoadmoreButton/index.js +40 -2133
- package/atoms/LoadmoreButton/styles.arrow.css +1 -1
- package/atoms/ScrollSnap/index.js +89 -2241
- package/atoms/ScrollSnap/styles.arrow.css +1 -1
- package/atoms/SectionTag/index.js +40 -2120
- package/atoms/SectionTag/styles.arrow.css +1 -1
- package/atoms/Subheadline/index.js +35 -2115
- package/atoms/Subheadline/styles.arrow.css +1 -1
- package/atoms/TimeStamp/index.js +43 -2483
- package/atoms/TimeStamp/styles.arrow.css +1 -1
- package/molecules/KeyEvents/index.js +95 -2606
- package/molecules/KeyEvents/styles.arrow.css +1 -1
- package/molecules/PageIntroductionCard/index.js +59 -2487
- package/molecules/PageIntroductionCard/styles.arrow.css +1 -1
- package/molecules/SocialShareTemplate/index.js +213 -2800
- package/molecules/SocialShareTemplate/styles.arrow.css +1 -1
- package/molecules/StoryCard/index.js +308 -2816
- package/molecules/StoryCard/styles.arrow.css +1 -1
- package/molecules/StoryElementCard/index.js +611 -3352
- package/molecules/StoryElementCard/styles.arrow.css +1 -1
- package/molecules/StorycardContent/index.js +218 -2658
- package/molecules/StorycardContent/styles.arrow.css +1 -1
- package/package.json +1 -1
- package/rows/AlternateCollectionFilter/index.js +438 -2993
- package/rows/AlternateCollectionFilter/styles.arrow.css +1 -1
- package/rows/AsideCollection/index.js +432 -2987
- package/rows/AsideCollection/styles.arrow.css +1 -1
- package/rows/AstrologyCollection/index.js +411 -2966
- package/rows/AstrologyCollection/styles.arrow.css +1 -1
- package/rows/AuthorIntroductionCard/index.js +183 -2890
- package/rows/AuthorIntroductionCard/styles.arrow.css +1 -1
- package/rows/AuthorsList/index.js +217 -2936
- package/rows/AuthorsList/styles.arrow.css +1 -1
- package/rows/CollectionFilter/index.js +453 -3008
- package/rows/CollectionFilter/styles.arrow.css +1 -1
- package/rows/ElevenStories/index.js +439 -2959
- package/rows/ElevenStories/styles.arrow.css +1 -1
- package/rows/FourColFiveStories/index.js +374 -2872
- package/rows/FourColFiveStories/styles.arrow.css +1 -1
- package/rows/FourColGrid/index.js +426 -2927
- package/rows/FourColGrid/styles.arrow.css +1 -1
- package/rows/FourColPortraitStories/index.js +430 -2931
- package/rows/FourColPortraitStories/styles.arrow.css +1 -1
- package/rows/FourColSixteenStories/index.js +368 -2894
- package/rows/FourColSixteenStories/styles.arrow.css +1 -1
- package/rows/FourColTwelveStories/index.js +387 -2900
- package/rows/FourColTwelveStories/styles.arrow.css +1 -1
- package/rows/FourStorySlider/index.js +443 -2963
- package/rows/FourStorySlider/styles.arrow.css +1 -1
- package/rows/FourStorySliderPortrait/index.js +444 -2964
- package/rows/FourStorySliderPortrait/styles.arrow.css +1 -1
- package/rows/FourTabbedBigStorySlider/index.js +403 -2923
- package/rows/FourTabbedBigStorySlider/styles.arrow.css +1 -1
- package/rows/FullScreenSlider/index.js +422 -2942
- package/rows/FullScreenSlider/styles.arrow.css +1 -1
- package/rows/HalfScreenSlider/index.js +390 -2910
- package/rows/HalfScreenSlider/styles.arrow.css +1 -1
- package/rows/ListComponent/index.js +398 -2918
- package/rows/ListComponent/styles.arrow.css +1 -1
- package/rows/Listicles/index.js +189 -2375
- package/rows/Listicles/styles.arrow.css +1 -1
- package/rows/MagazineEditions/index.js +128 -2580
- package/rows/MagazineEditions/styles.arrow.css +1 -1
- package/rows/MagazineHeaderCard/index.js +125 -2577
- package/rows/MagazineHeaderCard/styles.arrow.css +1 -1
- package/rows/MagazineWidget/index.js +408 -2928
- package/rows/MagazineWidget/styles.arrow.css +1 -1
- package/rows/OneColStoryList/index.js +439 -2940
- package/rows/OneColStoryList/styles.arrow.css +1 -1
- package/rows/OpinionCollection/index.js +308 -2800
- package/rows/OpinionCollection/styles.arrow.css +1 -1
- package/rows/SixColSixStories/index.js +405 -2906
- package/rows/SixColSixStories/styles.arrow.css +1 -1
- package/rows/StoryCollection/index.js +432 -2987
- package/rows/StoryCollection/styles.arrow.css +1 -1
- package/rows/TagIntroductionCard/index.js +35 -1833
- package/rows/TagIntroductionCard/styles.arrow.css +1 -1
- package/rows/ThreeColFlexStories/index.js +421 -2922
- package/rows/ThreeColFlexStories/styles.arrow.css +1 -1
- package/rows/ThreeColFourteenStories/index.js +358 -2871
- package/rows/ThreeColFourteenStories/styles.arrow.css +1 -1
- package/rows/ThreeColGrid/index.js +428 -2929
- package/rows/ThreeColGrid/styles.arrow.css +1 -1
- package/rows/ThreeColSevenStory/index.js +406 -2926
- package/rows/ThreeColSevenStory/styles.arrow.css +1 -1
- package/rows/ThreeColSixStories/index.js +400 -2920
- package/rows/ThreeColSixStories/styles.arrow.css +1 -1
- package/rows/ThreeColTwelveStories/index.js +383 -2909
- package/rows/ThreeColTwelveStories/styles.arrow.css +1 -1
- package/rows/TwoColFourStories/index.js +395 -2915
- package/rows/TwoColFourStories/styles.arrow.css +1 -1
- package/rows/TwoColFourStoryHighlight/index.js +398 -2924
- package/rows/TwoColFourStoryHighlight/styles.arrow.css +1 -1
- package/rows/TwoColSevenStories/index.js +400 -2920
- package/rows/TwoColSevenStories/styles.arrow.css +1 -1
- package/rows/TwoColSixStories/index.js +398 -2924
- package/rows/TwoColSixStories/styles.arrow.css +1 -1
- package/rows/TwoColTenStoriesSidebar/index.js +418 -2938
- package/rows/TwoColTenStoriesSidebar/styles.arrow.css +1 -1
- package/rows/TwoColThreeStories/index.js +392 -2912
- package/rows/TwoColThreeStories/styles.arrow.css +1 -1
- package/story-elements/AlsoRead/index.js +92 -2229
- package/story-elements/AlsoRead/styles.arrow.css +1 -1
- package/story-elements/Attachment/index.js +53 -1899
- package/story-elements/Attachment/styles.arrow.css +1 -1
- package/story-elements/BigFact/index.js +49 -1895
- package/story-elements/BigFact/styles.arrow.css +1 -1
- package/story-elements/BlockQuote/index.js +79 -2206
- package/story-elements/BlockQuote/styles.arrow.css +1 -1
- package/story-elements/Blurb/index.js +52 -1957
- package/story-elements/Blurb/styles.arrow.css +1 -1
- package/story-elements/Image/index.js +147 -2329
- package/story-elements/Image/styles.arrow.css +1 -1
- package/story-elements/ImageGallery/index.js +135 -2317
- package/story-elements/ImageGallery/styles.arrow.css +1 -1
- package/story-elements/ImageSlideshow/index.js +173 -2355
- package/story-elements/ImageSlideshow/styles.arrow.css +1 -1
- package/story-elements/QuestionAnswer/index.js +79 -2207
- package/story-elements/QuestionAnswer/styles.arrow.css +1 -1
- package/story-elements/Quote/index.js +52 -1898
- package/story-elements/Quote/styles.arrow.css +1 -1
- package/story-elements/Reference/index.js +53 -1899
- package/story-elements/Reference/styles.arrow.css +1 -1
- package/story-elements/StoryElement/index.js +34 -1738
- package/story-elements/Summary/index.js +56 -1902
- package/story-elements/Summary/styles.arrow.css +1 -1
- package/story-elements/Text/index.js +48 -2176
- package/story-elements/Text/styles.arrow.css +1 -1
- package/story-elements/Video/index.js +35 -1739
- package/story-elements/Video/styles.arrow.css +1 -1
- package/story-templates/ListicleStoryTemplate/index.js +1182 -4038
- package/story-templates/ListicleStoryTemplate/styles.arrow.css +1 -1
- package/story-templates/LiveBlogStoryTemplate/index.js +1377 -4233
- package/story-templates/LiveBlogStoryTemplate/styles.arrow.css +1 -1
- package/story-templates/PhotoStoryTemplate/index.js +1162 -4018
- package/story-templates/PhotoStoryTemplate/styles.arrow.css +1 -1
- package/story-templates/TextStoryTemplate/index.js +1277 -4133
- package/story-templates/TextStoryTemplate/styles.arrow.css +1 -1
- package/story-templates/VideoStoryTemplate/index.js +1231 -4087
- package/story-templates/VideoStoryTemplate/styles.arrow.css +1 -1
- package/atoms/ExtendedLoadMore/index-e39b3ca8.js +0 -3023
- package/atoms/ExtendedLoadMore/index-f6e578e3.js +0 -86
|
@@ -1,15 +1,30 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var React = require('react');
|
|
4
|
+
var lodash = require('lodash');
|
|
5
|
+
var index$2 = require('./index-0f809dd9.js');
|
|
6
|
+
var index$3 = require('./index-8462c597.js');
|
|
7
|
+
var index$4 = require('./index-afd44863.js');
|
|
8
|
+
var index$1 = require('./index-93cb06d1.js');
|
|
9
|
+
var index = require('./index-142f015c.js');
|
|
10
|
+
var components = require('@quintype/components');
|
|
11
|
+
var PropTypes = require('prop-types');
|
|
12
|
+
var reactRedux = require('react-redux');
|
|
13
|
+
require('babel-plugin-react-css-modules/dist/browser/getClassName');
|
|
14
|
+
require('@babel/runtime/helpers/slicedToArray');
|
|
15
|
+
require('@babel/runtime/helpers/defineProperty');
|
|
16
|
+
require('react-dom');
|
|
17
|
+
require('@babel/runtime/helpers/toConsumableArray');
|
|
18
|
+
require('@babel/runtime/helpers/asyncToGenerator');
|
|
19
|
+
require('@babel/runtime/regenerator');
|
|
20
|
+
require('@babel/runtime/helpers/typeof');
|
|
21
|
+
require('react-timeago');
|
|
22
|
+
require('date-fns-tz');
|
|
23
|
+
|
|
24
|
+
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
25
|
+
|
|
26
|
+
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
27
|
+
var PropTypes__default = /*#__PURE__*/_interopDefaultLegacy(PropTypes);
|
|
13
28
|
|
|
14
29
|
var loadMore = function loadMore(_ref) {
|
|
15
30
|
var isLoading = _ref.isLoading,
|
|
@@ -49,28 +64,28 @@ var ThreeColGridBase = function ThreeColGridBase(_ref2) {
|
|
|
49
64
|
footerButton = _config$footerButton === void 0 ? "" : _config$footerButton,
|
|
50
65
|
_config$subsequentLoa = config.subsequentLoadCount,
|
|
51
66
|
subsequentLoadCount = _config$subsequentLoa === void 0 ? 3 : _config$subsequentLoa;
|
|
52
|
-
var storyItems = collectionToStories(collection);
|
|
67
|
+
var storyItems = components.collectionToStories(collection);
|
|
53
68
|
if (!storyItems.length) return null;
|
|
54
|
-
var textColor = getTextColor(theme);
|
|
69
|
+
var textColor = index.getTextColor(theme);
|
|
55
70
|
var footerSlot = footerSlotConfig.footerSlot;
|
|
56
71
|
var footerSlotComp = footerSlot ? footerSlot() : null;
|
|
57
72
|
|
|
58
|
-
var _get =
|
|
73
|
+
var _get = lodash.get(slotConfig, [0], {}),
|
|
59
74
|
_get$type = _get.type,
|
|
60
75
|
type = _get$type === void 0 ? "" : _get$type,
|
|
61
76
|
component = _get.component;
|
|
62
77
|
|
|
63
|
-
var adWidgetSlot = type === "ad" || type === "widget" ? getSlot(type, component) : null;
|
|
64
|
-
var dispatch = useDispatch();
|
|
65
|
-
var qtConfig = useSelector(function (state) {
|
|
66
|
-
return
|
|
78
|
+
var adWidgetSlot = type === "ad" || type === "widget" ? index.getSlot(type, component) : null;
|
|
79
|
+
var dispatch = reactRedux.useDispatch();
|
|
80
|
+
var qtConfig = reactRedux.useSelector(function (state) {
|
|
81
|
+
return lodash.get(state, ["qt", "config"], {});
|
|
67
82
|
});
|
|
68
83
|
|
|
69
84
|
var getLoadMore = function getLoadMore(opts) {
|
|
70
85
|
if (!isLoadMoreVisible) return null;
|
|
71
86
|
|
|
72
87
|
if (isolatedLoadMore) {
|
|
73
|
-
return /*#__PURE__*/
|
|
88
|
+
return /*#__PURE__*/React__default["default"].createElement(index$1.LoadMoreTarget, {
|
|
74
89
|
collection: collection,
|
|
75
90
|
componentName: "ThreeColGrid",
|
|
76
91
|
offset: storyItems.length,
|
|
@@ -78,8 +93,8 @@ var ThreeColGridBase = function ThreeColGridBase(_ref2) {
|
|
|
78
93
|
});
|
|
79
94
|
}
|
|
80
95
|
|
|
81
|
-
var url = generateNavigateSlug(collection, qtConfig);
|
|
82
|
-
return /*#__PURE__*/
|
|
96
|
+
var url = index.generateNavigateSlug(collection, qtConfig);
|
|
97
|
+
return /*#__PURE__*/React__default["default"].createElement(index$1.ProgressiveHydration, null, /*#__PURE__*/React__default["default"].createElement(index$1.LoadmoreButton, {
|
|
83
98
|
config: config,
|
|
84
99
|
collection: collection,
|
|
85
100
|
template: footerButton,
|
|
@@ -87,26 +102,26 @@ var ThreeColGridBase = function ThreeColGridBase(_ref2) {
|
|
|
87
102
|
return loadMore(opts);
|
|
88
103
|
},
|
|
89
104
|
navigate: function navigate() {
|
|
90
|
-
return navigateTo(dispatch, url);
|
|
105
|
+
return index.navigateTo(dispatch, url);
|
|
91
106
|
},
|
|
92
107
|
qtConfig: qtConfig
|
|
93
108
|
}));
|
|
94
109
|
};
|
|
95
110
|
|
|
96
111
|
var storyCard = function storyCard(story) {
|
|
97
|
-
return /*#__PURE__*/
|
|
112
|
+
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
98
113
|
className: "three-col-m_cards__2HyyK"
|
|
99
|
-
}, /*#__PURE__*/
|
|
114
|
+
}, /*#__PURE__*/React__default["default"].createElement(index$2.StoryCard, {
|
|
100
115
|
story: story,
|
|
101
116
|
border: border,
|
|
102
117
|
theme: theme,
|
|
103
118
|
isHorizontalMobile: true,
|
|
104
119
|
config: config
|
|
105
|
-
}, /*#__PURE__*/
|
|
120
|
+
}, /*#__PURE__*/React__default["default"].createElement(index$3.HeroImage, {
|
|
106
121
|
aspectRatio: [[16, 9]],
|
|
107
122
|
story: story,
|
|
108
123
|
isHorizontalMobile: true
|
|
109
|
-
}), /*#__PURE__*/
|
|
124
|
+
}), /*#__PURE__*/React__default["default"].createElement(index$4.StorycardContent, {
|
|
110
125
|
theme: theme,
|
|
111
126
|
border: border,
|
|
112
127
|
story: story,
|
|
@@ -116,28 +131,28 @@ var ThreeColGridBase = function ThreeColGridBase(_ref2) {
|
|
|
116
131
|
})));
|
|
117
132
|
};
|
|
118
133
|
|
|
119
|
-
return /*#__PURE__*/
|
|
134
|
+
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
120
135
|
className: "full-width-with-padding arrow-component",
|
|
121
136
|
"data-test-id": "three-col-grid",
|
|
122
137
|
style: {
|
|
123
138
|
backgroundColor: theme,
|
|
124
139
|
color: textColor
|
|
125
140
|
}
|
|
126
|
-
}, /*#__PURE__*/
|
|
141
|
+
}, /*#__PURE__*/React__default["default"].createElement("div", {
|
|
127
142
|
className: "three-col-m_three-col-grid__y7rZK"
|
|
128
|
-
}, /*#__PURE__*/
|
|
143
|
+
}, /*#__PURE__*/React__default["default"].createElement(index$1.CollectionName, {
|
|
129
144
|
collection: collection,
|
|
130
145
|
collectionNameTemplate: collectionNameTemplate,
|
|
131
146
|
collectionNameBorderColor: collectionNameBorderColor
|
|
132
|
-
}), /*#__PURE__*/
|
|
147
|
+
}), /*#__PURE__*/React__default["default"].createElement("div", {
|
|
133
148
|
className: "three-col-m_wrapper__20m5m"
|
|
134
149
|
}, storyItems.slice(0, 2).map(function (story, index) {
|
|
135
|
-
return /*#__PURE__*/
|
|
136
|
-
key: "story-3col1-".concat(index, "-").concat(
|
|
150
|
+
return /*#__PURE__*/React__default["default"].createElement(React.Fragment, {
|
|
151
|
+
key: "story-3col1-".concat(index, "-").concat(lodash.get(story, ["id"], "0"))
|
|
137
152
|
}, storyCard(story));
|
|
138
|
-
}), storyItems.length < 2 && /*#__PURE__*/
|
|
139
|
-
return /*#__PURE__*/
|
|
140
|
-
key: "story-3col1-".concat(index, "-").concat(
|
|
153
|
+
}), storyItems.length < 2 && /*#__PURE__*/React__default["default"].createElement("div", null), adWidgetSlot, storyItems.slice(2).map(function (story, index) {
|
|
154
|
+
return /*#__PURE__*/React__default["default"].createElement(React.Fragment, {
|
|
155
|
+
key: "story-3col1-".concat(index, "-").concat(lodash.get(story, ["id"], "0"))
|
|
141
156
|
}, storyCard(story));
|
|
142
157
|
})), getLoadMore({
|
|
143
158
|
isLoading: isLoading,
|
|
@@ -148,28 +163,29 @@ var ThreeColGridBase = function ThreeColGridBase(_ref2) {
|
|
|
148
163
|
};
|
|
149
164
|
ThreeColGridBase.propTypes = {
|
|
150
165
|
/** collection is the array of objects which is returning by API */
|
|
151
|
-
collection:
|
|
166
|
+
collection: PropTypes__default["default"].object.isRequired,
|
|
152
167
|
|
|
153
168
|
/** The config for the Row */
|
|
154
|
-
config:
|
|
155
|
-
theme:
|
|
156
|
-
border:
|
|
157
|
-
slotConfig:
|
|
158
|
-
footerButton:
|
|
159
|
-
collectionNameTemplate:
|
|
160
|
-
collectionNameBorderColor:
|
|
161
|
-
subsequentLoadCount:
|
|
169
|
+
config: PropTypes__default["default"].shape({
|
|
170
|
+
theme: PropTypes__default["default"].string,
|
|
171
|
+
border: PropTypes__default["default"].bool,
|
|
172
|
+
slotConfig: PropTypes__default["default"].array,
|
|
173
|
+
footerButton: PropTypes__default["default"].string,
|
|
174
|
+
collectionNameTemplate: PropTypes__default["default"].string,
|
|
175
|
+
collectionNameBorderColor: PropTypes__default["default"].string,
|
|
176
|
+
subsequentLoadCount: PropTypes__default["default"].number
|
|
162
177
|
}),
|
|
163
|
-
getMoreStories:
|
|
164
|
-
isLoadMoreVisible:
|
|
165
|
-
isLoading:
|
|
166
|
-
isolatedLoadMore:
|
|
178
|
+
getMoreStories: PropTypes__default["default"].func,
|
|
179
|
+
isLoadMoreVisible: PropTypes__default["default"].bool,
|
|
180
|
+
isLoading: PropTypes__default["default"].bool,
|
|
181
|
+
isolatedLoadMore: PropTypes__default["default"].bool
|
|
167
182
|
};
|
|
168
183
|
ThreeColGridBase.defaultProps = {
|
|
169
184
|
getMoreStories: function getMoreStories() {},
|
|
170
185
|
isLoadMoreVisible: true,
|
|
171
186
|
isLoading: false
|
|
172
187
|
};
|
|
173
|
-
var ThreeColGrid = StateProvider(ThreeColGridBase);
|
|
188
|
+
var ThreeColGrid = index$1.StateProvider(ThreeColGridBase);
|
|
174
189
|
|
|
175
|
-
|
|
190
|
+
exports.ThreeColGrid = ThreeColGrid;
|
|
191
|
+
exports.ThreeColGridBase = ThreeColGridBase;
|
|
@@ -1,32 +1,49 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var _defineProperty = require('@babel/runtime/helpers/defineProperty');
|
|
4
|
+
var _getClassName = require('babel-plugin-react-css-modules/dist/browser/getClassName');
|
|
5
|
+
var React = require('react');
|
|
6
|
+
var reactRedux = require('react-redux');
|
|
7
|
+
var lodash = require('lodash');
|
|
8
|
+
var PropTypes = require('prop-types');
|
|
9
|
+
var components = require('@quintype/components');
|
|
10
|
+
var index$1 = require('./index-93cb06d1.js');
|
|
11
|
+
var index = require('./index-142f015c.js');
|
|
12
|
+
require('react-dom');
|
|
13
|
+
require('@babel/runtime/helpers/slicedToArray');
|
|
14
|
+
require('@babel/runtime/helpers/toConsumableArray');
|
|
15
|
+
require('@babel/runtime/helpers/asyncToGenerator');
|
|
16
|
+
require('@babel/runtime/regenerator');
|
|
17
|
+
require('@babel/runtime/helpers/typeof');
|
|
18
|
+
require('react-timeago');
|
|
19
|
+
require('date-fns-tz');
|
|
20
|
+
|
|
21
|
+
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
22
|
+
|
|
23
|
+
var _defineProperty__default = /*#__PURE__*/_interopDefaultLegacy(_defineProperty);
|
|
24
|
+
var _getClassName__default = /*#__PURE__*/_interopDefaultLegacy(_getClassName);
|
|
25
|
+
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
26
|
+
var PropTypes__default = /*#__PURE__*/_interopDefaultLegacy(PropTypes);
|
|
10
27
|
|
|
11
28
|
var UserFallbackIcon = function UserFallbackIcon(_ref) {
|
|
12
29
|
var _ref$width = _ref.width,
|
|
13
30
|
width = _ref$width === void 0 ? 120 : _ref$width,
|
|
14
31
|
_ref$height = _ref.height,
|
|
15
32
|
height = _ref$height === void 0 ? 120 : _ref$height;
|
|
16
|
-
return /*#__PURE__*/
|
|
33
|
+
return /*#__PURE__*/React__default["default"].createElement("svg", {
|
|
17
34
|
width: width,
|
|
18
35
|
height: height,
|
|
19
36
|
viewBox: "0 0 120 120",
|
|
20
37
|
xmlns: "http://www.w3.org/2000/svg"
|
|
21
|
-
}, /*#__PURE__*/
|
|
38
|
+
}, /*#__PURE__*/React__default["default"].createElement("path", {
|
|
22
39
|
d: "M93.28 108.98c-1.055-17.675-15.47-31.678-33.098-31.678-17.708 0-32.173 14.129-33.11 31.916 9.415 6.311 20.741 9.993 32.927 9.993 12.338 0 23.795-3.774 33.28-10.23l.001-.001zM58.584 73.283c9.928 0 17.977-8.275 17.977-18.483 0-10.209-8.049-18.484-17.977-18.484-9.929 0-17.977 8.275-17.977 18.484 0 10.208 8.048 18.483 17.977 18.483zM60 120C26.863 120 0 93.137 0 60S26.863 0 60 0s60 26.863 60 60-26.863 60-60 60z",
|
|
23
40
|
fill: "#DADADA",
|
|
24
41
|
fillRule: "nonzero"
|
|
25
42
|
}));
|
|
26
43
|
};
|
|
27
44
|
UserFallbackIcon.propTypes = {
|
|
28
|
-
width:
|
|
29
|
-
height:
|
|
45
|
+
width: PropTypes__default["default"].object,
|
|
46
|
+
height: PropTypes__default["default"].object
|
|
30
47
|
};
|
|
31
48
|
|
|
32
49
|
var _styleModuleImportMap$1 = {
|
|
@@ -46,12 +63,12 @@ var authorWithImage = function authorWithImage(author, templateStyle) {
|
|
|
46
63
|
var avatarUrl = author["avatar-url"],
|
|
47
64
|
avatarS3Key = author["avatar-s3-key"],
|
|
48
65
|
name = author.name;
|
|
49
|
-
return /*#__PURE__*/
|
|
66
|
+
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
50
67
|
"data-test-id": "author-image",
|
|
51
|
-
className: "arr--author-image " +
|
|
52
|
-
}, /*#__PURE__*/
|
|
68
|
+
className: "arr--author-image " + _getClassName__default["default"]("author-image ".concat(templateStyle), _styleModuleImportMap$1)
|
|
69
|
+
}, /*#__PURE__*/React__default["default"].createElement("figure", {
|
|
53
70
|
className: "author-image-m_image-container__19WNd"
|
|
54
|
-
}, avatarS3Key ? /*#__PURE__*/
|
|
71
|
+
}, avatarS3Key ? /*#__PURE__*/React__default["default"].createElement(components.ResponsiveImage, {
|
|
55
72
|
slug: avatarS3Key,
|
|
56
73
|
alt: name,
|
|
57
74
|
defaultWidth: 250,
|
|
@@ -61,9 +78,9 @@ var authorWithImage = function authorWithImage(author, templateStyle) {
|
|
|
61
78
|
imgParams: {
|
|
62
79
|
auto: ["format", "compress"]
|
|
63
80
|
}
|
|
64
|
-
}) : avatarUrl ? /*#__PURE__*/
|
|
81
|
+
}) : avatarUrl ? /*#__PURE__*/React__default["default"].createElement("img", {
|
|
65
82
|
src: avatarUrl
|
|
66
|
-
}) : /*#__PURE__*/
|
|
83
|
+
}) : /*#__PURE__*/React__default["default"].createElement(UserFallbackIcon, null)));
|
|
67
84
|
};
|
|
68
85
|
|
|
69
86
|
var AuthorImage = function AuthorImage(_ref) {
|
|
@@ -77,19 +94,19 @@ var AuthorImage = function AuthorImage(_ref) {
|
|
|
77
94
|
var mountAt = config.mountAt || "";
|
|
78
95
|
var templateStyle = "";
|
|
79
96
|
if (template === "smallerCircle") templateStyle = "smaller-circle";else if (template === "smallCircle") templateStyle = "small-circle";else if (template === "square") templateStyle = "square";
|
|
80
|
-
if (slug) return /*#__PURE__*/
|
|
97
|
+
if (slug) return /*#__PURE__*/React__default["default"].createElement(components.Link, {
|
|
81
98
|
href: "".concat(mountAt, "/author/") + slug
|
|
82
99
|
}, authorWithImage(author, templateStyle));else return authorWithImage(author, templateStyle);
|
|
83
100
|
};
|
|
84
101
|
|
|
85
102
|
AuthorImage.propTypes = {
|
|
86
|
-
author:
|
|
87
|
-
"avatar-url":
|
|
88
|
-
"avatar-s3-key":
|
|
89
|
-
name:
|
|
90
|
-
slug:
|
|
103
|
+
author: PropTypes__default["default"].shape({
|
|
104
|
+
"avatar-url": PropTypes__default["default"].string,
|
|
105
|
+
"avatar-s3-key": PropTypes__default["default"].string,
|
|
106
|
+
name: PropTypes__default["default"].string,
|
|
107
|
+
slug: PropTypes__default["default"].string
|
|
91
108
|
}),
|
|
92
|
-
template:
|
|
109
|
+
template: PropTypes__default["default"].string
|
|
93
110
|
};
|
|
94
111
|
|
|
95
112
|
var _styleModuleImportMap = {
|
|
@@ -113,7 +130,7 @@ var _styleModuleImportMap = {
|
|
|
113
130
|
|
|
114
131
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
115
132
|
|
|
116
|
-
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) {
|
|
133
|
+
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__default["default"](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; }
|
|
117
134
|
|
|
118
135
|
var loadMore = function loadMore(_ref) {
|
|
119
136
|
var isLoading = _ref.isLoading,
|
|
@@ -134,7 +151,7 @@ var OpinionCollectionBase = function OpinionCollectionBase(_ref2) {
|
|
|
134
151
|
isLoadMoreVisible = _ref2.isLoadMoreVisible,
|
|
135
152
|
isLoading = _ref2.isLoading,
|
|
136
153
|
isolatedLoadMore = _ref2.isolatedLoadMore;
|
|
137
|
-
var stories = collectionToStories(collection);
|
|
154
|
+
var stories = components.collectionToStories(collection);
|
|
138
155
|
var _config$theme = config.theme,
|
|
139
156
|
theme = _config$theme === void 0 ? "" : _config$theme,
|
|
140
157
|
_config$footerButton = config.footerButton,
|
|
@@ -150,27 +167,27 @@ var OpinionCollectionBase = function OpinionCollectionBase(_ref2) {
|
|
|
150
167
|
_config$subsequentLoa = config.subsequentLoadCount,
|
|
151
168
|
subsequentLoadCount = _config$subsequentLoa === void 0 ? 3 : _config$subsequentLoa;
|
|
152
169
|
|
|
153
|
-
var _get =
|
|
170
|
+
var _get = lodash.get(slotConfig, [0], {}),
|
|
154
171
|
_get$type = _get.type,
|
|
155
172
|
type = _get$type === void 0 ? "story" : _get$type,
|
|
156
173
|
_get$component = _get.component,
|
|
157
174
|
component = _get$component === void 0 ? null : _get$component;
|
|
158
175
|
|
|
159
|
-
var dispatch = useDispatch();
|
|
160
|
-
var qtConfig = useSelector(function (state) {
|
|
161
|
-
return
|
|
176
|
+
var dispatch = reactRedux.useDispatch();
|
|
177
|
+
var qtConfig = reactRedux.useSelector(function (state) {
|
|
178
|
+
return lodash.get(state, ["qt", "config"], {});
|
|
162
179
|
});
|
|
163
180
|
if (!stories.length) return null;
|
|
164
|
-
var textColor = getTextColor(theme);
|
|
181
|
+
var textColor = index.getTextColor(theme);
|
|
165
182
|
var borderStyle = border === "fullBorder" ? "border" : "";
|
|
166
|
-
var slot = type === "ad" ? getSlot(type, component) : null;
|
|
183
|
+
var slot = type === "ad" ? index.getSlot(type, component) : null;
|
|
167
184
|
var adStyle = slot ? "custom-grid" : "";
|
|
168
185
|
|
|
169
186
|
var getLoadMore = function getLoadMore(opts) {
|
|
170
187
|
if (!isLoadMoreVisible) return null;
|
|
171
188
|
|
|
172
189
|
if (isolatedLoadMore) {
|
|
173
|
-
return /*#__PURE__*/
|
|
190
|
+
return /*#__PURE__*/React__default["default"].createElement(index$1.LoadMoreTarget, {
|
|
174
191
|
collection: collection,
|
|
175
192
|
componentName: "OpinionCollection",
|
|
176
193
|
offset: stories.length,
|
|
@@ -178,8 +195,8 @@ var OpinionCollectionBase = function OpinionCollectionBase(_ref2) {
|
|
|
178
195
|
});
|
|
179
196
|
}
|
|
180
197
|
|
|
181
|
-
var url = generateNavigateSlug(collection, qtConfig);
|
|
182
|
-
return /*#__PURE__*/
|
|
198
|
+
var url = index.generateNavigateSlug(collection, qtConfig);
|
|
199
|
+
return /*#__PURE__*/React__default["default"].createElement(index$1.ProgressiveHydration, null, /*#__PURE__*/React__default["default"].createElement(index$1.LoadmoreButton, {
|
|
183
200
|
config: config,
|
|
184
201
|
collection: collection,
|
|
185
202
|
template: footerButton,
|
|
@@ -187,28 +204,28 @@ var OpinionCollectionBase = function OpinionCollectionBase(_ref2) {
|
|
|
187
204
|
return loadMore(opts);
|
|
188
205
|
},
|
|
189
206
|
navigate: function navigate() {
|
|
190
|
-
return navigateTo(dispatch, url);
|
|
207
|
+
return index.navigateTo(dispatch, url);
|
|
191
208
|
},
|
|
192
209
|
qtConfig: qtConfig
|
|
193
210
|
}));
|
|
194
211
|
};
|
|
195
212
|
|
|
196
213
|
var getAuthorCard = function getAuthorCard(story) {
|
|
197
|
-
var authorData =
|
|
198
|
-
return /*#__PURE__*/
|
|
214
|
+
var authorData = lodash.get(story, ["authors", "0"]);
|
|
215
|
+
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
199
216
|
"data-test-id": "story-card"
|
|
200
|
-
}, /*#__PURE__*/
|
|
217
|
+
}, /*#__PURE__*/React__default["default"].createElement(index$1.Author, {
|
|
201
218
|
story: story,
|
|
202
219
|
hideAuthorImage: true
|
|
203
|
-
}), /*#__PURE__*/
|
|
220
|
+
}), /*#__PURE__*/React__default["default"].createElement("div", {
|
|
204
221
|
className: "opinion-collection-m_headline-author__2H6Tv"
|
|
205
|
-
}, /*#__PURE__*/
|
|
222
|
+
}, /*#__PURE__*/React__default["default"].createElement(index$1.Headline, {
|
|
206
223
|
story: story
|
|
207
|
-
}), /*#__PURE__*/
|
|
224
|
+
}), /*#__PURE__*/React__default["default"].createElement(AuthorImage, {
|
|
208
225
|
author: authorData,
|
|
209
226
|
template: "smallerCircle",
|
|
210
227
|
config: config
|
|
211
|
-
})), /*#__PURE__*/
|
|
228
|
+
})), /*#__PURE__*/React__default["default"].createElement(index$1.AuthorWithTime, {
|
|
212
229
|
story: story,
|
|
213
230
|
config: _objectSpread(_objectSpread({}, config), {}, {
|
|
214
231
|
disableMeridiem: true,
|
|
@@ -218,31 +235,31 @@ var OpinionCollectionBase = function OpinionCollectionBase(_ref2) {
|
|
|
218
235
|
};
|
|
219
236
|
|
|
220
237
|
var countStyleName = stories.length === 2 || stories.length === 3 ? "count-".concat(stories.length) : "";
|
|
221
|
-
return /*#__PURE__*/
|
|
238
|
+
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
222
239
|
className: "full-width-with-padding arrow-component",
|
|
223
240
|
"data-test-id": "opinion-collection",
|
|
224
241
|
style: {
|
|
225
242
|
backgroundColor: theme,
|
|
226
243
|
color: textColor
|
|
227
244
|
}
|
|
228
|
-
}, /*#__PURE__*/
|
|
245
|
+
}, /*#__PURE__*/React__default["default"].createElement("div", {
|
|
229
246
|
className: "opinion-collection-m_opinion-collection__1Bc7h",
|
|
230
247
|
style: {
|
|
231
248
|
backgroundColor: theme,
|
|
232
249
|
color: textColor
|
|
233
250
|
}
|
|
234
|
-
}, /*#__PURE__*/
|
|
251
|
+
}, /*#__PURE__*/React__default["default"].createElement(index$1.CollectionName, {
|
|
235
252
|
collection: collection,
|
|
236
253
|
collectionNameTemplate: collectionNameTemplate,
|
|
237
254
|
collectionNameBorderColor: collectionNameBorderColor,
|
|
238
255
|
headerLevel: 2
|
|
239
|
-
}), /*#__PURE__*/
|
|
240
|
-
className: ("content-wrapper ".concat(borderStyle, " ").concat(textColor) ? "content-wrapper ".concat(borderStyle, " ").concat(textColor) + " " : "") +
|
|
241
|
-
}, slot ? /*#__PURE__*/
|
|
242
|
-
className: "wrapper-with-ads " +
|
|
256
|
+
}), /*#__PURE__*/React__default["default"].createElement("div", {
|
|
257
|
+
className: ("content-wrapper ".concat(borderStyle, " ").concat(textColor) ? "content-wrapper ".concat(borderStyle, " ").concat(textColor) + " " : "") + _getClassName__default["default"]("content-wrapper ".concat(borderStyle, " ").concat(textColor, " ").concat(adStyle), _styleModuleImportMap)
|
|
258
|
+
}, slot ? /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, /*#__PURE__*/React__default["default"].createElement("div", {
|
|
259
|
+
className: "wrapper-with-ads " + _getClassName__default["default"]("wrapper-with-ads ".concat(countStyleName), _styleModuleImportMap)
|
|
243
260
|
}, stories.slice(0, 4).map(function (story) {
|
|
244
261
|
return getAuthorCard(story);
|
|
245
|
-
})), /*#__PURE__*/
|
|
262
|
+
})), /*#__PURE__*/React__default["default"].createElement("div", {
|
|
246
263
|
className: "opinion-collection-m_ad-slot__2ZpaC"
|
|
247
264
|
}, slot)) : stories.map(function (story) {
|
|
248
265
|
return getAuthorCard(story);
|
|
@@ -254,20 +271,20 @@ var OpinionCollectionBase = function OpinionCollectionBase(_ref2) {
|
|
|
254
271
|
})));
|
|
255
272
|
};
|
|
256
273
|
OpinionCollectionBase.propTypes = {
|
|
257
|
-
collection:
|
|
258
|
-
config:
|
|
259
|
-
collectionNameBorderColor:
|
|
260
|
-
theme:
|
|
261
|
-
collectionNameTemplate:
|
|
262
|
-
footerButton:
|
|
263
|
-
border:
|
|
264
|
-
slotConfig:
|
|
265
|
-
subsequentLoadCount:
|
|
274
|
+
collection: PropTypes__default["default"].object,
|
|
275
|
+
config: PropTypes__default["default"].shape({
|
|
276
|
+
collectionNameBorderColor: PropTypes__default["default"].string,
|
|
277
|
+
theme: PropTypes__default["default"].string,
|
|
278
|
+
collectionNameTemplate: PropTypes__default["default"].string,
|
|
279
|
+
footerButton: PropTypes__default["default"].string,
|
|
280
|
+
border: PropTypes__default["default"].string,
|
|
281
|
+
slotConfig: PropTypes__default["default"].array,
|
|
282
|
+
subsequentLoadCount: PropTypes__default["default"].number
|
|
266
283
|
}),
|
|
267
|
-
getMoreStories:
|
|
268
|
-
isLoading:
|
|
269
|
-
isLoadMoreVisible:
|
|
270
|
-
isolatedLoadMore:
|
|
284
|
+
getMoreStories: PropTypes__default["default"].func,
|
|
285
|
+
isLoading: PropTypes__default["default"].bool,
|
|
286
|
+
isLoadMoreVisible: PropTypes__default["default"].bool,
|
|
287
|
+
isolatedLoadMore: PropTypes__default["default"].bool
|
|
271
288
|
};
|
|
272
289
|
OpinionCollectionBase.defaultProps = {
|
|
273
290
|
getMoreStories: function getMoreStories() {},
|
|
@@ -277,6 +294,7 @@ OpinionCollectionBase.defaultProps = {
|
|
|
277
294
|
config: {},
|
|
278
295
|
hideFirstCard: false
|
|
279
296
|
};
|
|
280
|
-
var OpinionCollection = StateProvider(OpinionCollectionBase);
|
|
297
|
+
var OpinionCollection = index$1.StateProvider(OpinionCollectionBase);
|
|
281
298
|
|
|
282
|
-
|
|
299
|
+
exports.OpinionCollection = OpinionCollection;
|
|
300
|
+
exports.OpinionCollectionBase = OpinionCollectionBase;
|