@quintype/arrow 3.15.1-perf.2 → 3.15.1-perf.5
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/cjs/index.js +14589 -0
- package/package.json +1 -1
- package/atoms/Author/index.js +0 -2250
- package/atoms/Author/styles.arrow.css +0 -1
- package/atoms/AuthorWithTime/index.js +0 -2954
- package/atoms/AuthorWithTime/styles.arrow.css +0 -1
- package/atoms/CollectionName/index.js +0 -2334
- package/atoms/CollectionName/styles.arrow.css +0 -1
- package/atoms/ExtendedLoadMore/index-0519e570.js +0 -243
- package/atoms/ExtendedLoadMore/index-1256e453.js +0 -175
- package/atoms/ExtendedLoadMore/index-1e444d20.js +0 -990
- package/atoms/ExtendedLoadMore/index-4356ce04.js +0 -282
- package/atoms/ExtendedLoadMore/index-81eb3978.js +0 -86
- package/atoms/ExtendedLoadMore/index-aba6b278.js +0 -166
- package/atoms/ExtendedLoadMore/index-ad3c83c3.js +0 -3023
- package/atoms/ExtendedLoadMore/index-beed3a68.js +0 -240
- package/atoms/ExtendedLoadMore/index-c2f73d18.js +0 -199
- package/atoms/ExtendedLoadMore/index-c61a16dc.js +0 -350
- package/atoms/ExtendedLoadMore/index-d0f6c865.js +0 -181
- package/atoms/ExtendedLoadMore/index-e4cf9cb7.js +0 -223
- package/atoms/ExtendedLoadMore/index-fd651f70.js +0 -175
- package/atoms/ExtendedLoadMore/index.js +0 -5
- package/atoms/ExtendedLoadMore/styles.arrow.css +0 -1
- package/atoms/Headline/index.js +0 -2459
- package/atoms/Headline/styles.arrow.css +0 -1
- package/atoms/HeroImage/index.js +0 -2475
- package/atoms/HeroImage/styles.arrow.css +0 -1
- package/atoms/LoadmoreButton/index.js +0 -2268
- package/atoms/LoadmoreButton/styles.arrow.css +0 -1
- package/atoms/ScrollSnap/index.js +0 -2531
- package/atoms/ScrollSnap/styles.arrow.css +0 -1
- package/atoms/SectionTag/index.js +0 -2220
- package/atoms/SectionTag/styles.arrow.css +0 -1
- package/atoms/Subheadline/index.js +0 -2200
- package/atoms/Subheadline/styles.arrow.css +0 -1
- package/atoms/TimeStamp/index.js +0 -2661
- package/atoms/TimeStamp/styles.arrow.css +0 -1
- package/molecules/KeyEvents/index.js +0 -2968
- package/molecules/KeyEvents/styles.arrow.css +0 -1
- package/molecules/PageIntroductionCard/index.js +0 -2676
- package/molecules/PageIntroductionCard/styles.arrow.css +0 -1
- package/molecules/SocialShareTemplate/index.js +0 -3093
- package/molecules/SocialShareTemplate/styles.arrow.css +0 -1
- package/molecules/StoryCard/index.js +0 -3938
- package/molecules/StoryCard/styles.arrow.css +0 -1
- package/molecules/StoryElementCard/index.js +0 -5832
- package/molecules/StoryElementCard/styles.arrow.css +0 -1
- package/molecules/StorycardContent/index.js +0 -3416
- package/molecules/StorycardContent/styles.arrow.css +0 -1
- package/rows/AlternateCollectionFilter/index.js +0 -4744
- package/rows/AlternateCollectionFilter/styles.arrow.css +0 -1
- package/rows/AsideCollection/index.js +0 -4690
- package/rows/AsideCollection/styles.arrow.css +0 -1
- package/rows/AstrologyCollection/index.js +0 -4661
- package/rows/AstrologyCollection/styles.arrow.css +0 -1
- package/rows/AuthorIntroductionCard/index.js +0 -3520
- package/rows/AuthorIntroductionCard/styles.arrow.css +0 -1
- package/rows/AuthorsList/index.js +0 -3715
- package/rows/AuthorsList/styles.arrow.css +0 -1
- package/rows/CollectionFilter/index.js +0 -4834
- package/rows/CollectionFilter/styles.arrow.css +0 -1
- package/rows/ElevenStories/index.js +0 -4638
- package/rows/ElevenStories/styles.arrow.css +0 -1
- package/rows/FourColFiveStories/index.js +0 -4359
- package/rows/FourColFiveStories/styles.arrow.css +0 -1
- package/rows/FourColGrid/index.js +0 -4584
- package/rows/FourColGrid/styles.arrow.css +0 -1
- package/rows/FourColPortraitStories/index.js +0 -4617
- package/rows/FourColPortraitStories/styles.arrow.css +0 -1
- package/rows/FourColSixteenStories/index.js +0 -4375
- package/rows/FourColSixteenStories/styles.arrow.css +0 -1
- package/rows/FourColTwelveStories/index.js +0 -4335
- package/rows/FourColTwelveStories/styles.arrow.css +0 -1
- package/rows/FourStorySlider/index.js +0 -4743
- package/rows/FourStorySlider/styles.arrow.css +0 -1
- package/rows/FourStorySliderPortrait/index.js +0 -4746
- package/rows/FourStorySliderPortrait/styles.arrow.css +0 -1
- package/rows/FourTabbedBigStorySlider/index.js +0 -4505
- package/rows/FourTabbedBigStorySlider/styles.arrow.css +0 -1
- package/rows/FullScreenSlider/index.js +0 -4661
- package/rows/FullScreenSlider/styles.arrow.css +0 -1
- package/rows/HalfScreenSlider/index.js +0 -4514
- package/rows/HalfScreenSlider/styles.arrow.css +0 -1
- package/rows/ListComponent/index.js +0 -4462
- package/rows/ListComponent/styles.arrow.css +0 -1
- package/rows/Listicles/index.js +0 -3131
- package/rows/Listicles/styles.arrow.css +0 -1
- package/rows/MagazineEditions/index.js +0 -3142
- package/rows/MagazineEditions/styles.arrow.css +0 -1
- package/rows/MagazineHeaderCard/index.js +0 -3136
- package/rows/MagazineHeaderCard/styles.arrow.css +0 -1
- package/rows/MagazineWidget/index.js +0 -4514
- package/rows/MagazineWidget/styles.arrow.css +0 -1
- package/rows/OneColStoryList/index.js +0 -4670
- package/rows/OneColStoryList/styles.arrow.css +0 -1
- package/rows/OpinionCollection/index.js +0 -4037
- package/rows/OpinionCollection/styles.arrow.css +0 -1
- package/rows/SixColSixStories/index.js +0 -4515
- package/rows/SixColSixStories/styles.arrow.css +0 -1
- package/rows/StoryCollection/index.js +0 -4690
- package/rows/StoryCollection/styles.arrow.css +0 -1
- package/rows/TagIntroductionCard/index.js +0 -1901
- package/rows/TagIntroductionCard/styles.arrow.css +0 -1
- package/rows/ThreeColFlexStories/index.js +0 -4575
- package/rows/ThreeColFlexStories/styles.arrow.css +0 -1
- package/rows/ThreeColFourteenStories/index.js +0 -4283
- package/rows/ThreeColFourteenStories/styles.arrow.css +0 -1
- package/rows/ThreeColGrid/index.js +0 -4605
- package/rows/ThreeColGrid/styles.arrow.css +0 -1
- package/rows/ThreeColSevenStory/index.js +0 -4502
- package/rows/ThreeColSevenStory/styles.arrow.css +0 -1
- package/rows/ThreeColSixStories/index.js +0 -4485
- package/rows/ThreeColSixStories/styles.arrow.css +0 -1
- package/rows/ThreeColTwelveStories/index.js +0 -4380
- package/rows/ThreeColTwelveStories/styles.arrow.css +0 -1
- package/rows/TwoColFourStories/index.js +0 -4463
- package/rows/TwoColFourStories/styles.arrow.css +0 -1
- package/rows/TwoColFourStoryHighlight/index.js +0 -4456
- package/rows/TwoColFourStoryHighlight/styles.arrow.css +0 -1
- package/rows/TwoColSevenStories/index.js +0 -4490
- package/rows/TwoColSevenStories/styles.arrow.css +0 -1
- package/rows/TwoColSixStories/index.js +0 -4489
- package/rows/TwoColSixStories/styles.arrow.css +0 -1
- package/rows/TwoColTenStoriesSidebar/index.js +0 -4549
- package/rows/TwoColTenStoriesSidebar/styles.arrow.css +0 -1
- package/rows/TwoColThreeStories/index.js +0 -4436
- package/rows/TwoColThreeStories/styles.arrow.css +0 -1
- package/story-elements/AlsoRead/index.js +0 -2457
- package/story-elements/AlsoRead/styles.arrow.css +0 -1
- package/story-elements/Attachment/index.js +0 -2013
- package/story-elements/Attachment/styles.arrow.css +0 -1
- package/story-elements/BigFact/index.js +0 -1983
- package/story-elements/BigFact/styles.arrow.css +0 -1
- package/story-elements/BlockQuote/index.js +0 -2431
- package/story-elements/BlockQuote/styles.arrow.css +0 -1
- package/story-elements/Blurb/index.js +0 -2094
- package/story-elements/Blurb/styles.arrow.css +0 -1
- package/story-elements/Image/index.js +0 -2711
- package/story-elements/Image/styles.arrow.css +0 -1
- package/story-elements/ImageGallery/index.js +0 -2644
- package/story-elements/ImageGallery/styles.arrow.css +0 -1
- package/story-elements/ImageSlideshow/index.js +0 -2955
- package/story-elements/ImageSlideshow/styles.arrow.css +0 -1
- package/story-elements/QuestionAnswer/index.js +0 -2395
- package/story-elements/QuestionAnswer/styles.arrow.css +0 -1
- package/story-elements/Quote/index.js +0 -2012
- package/story-elements/Quote/styles.arrow.css +0 -1
- package/story-elements/Reference/index.js +0 -2006
- package/story-elements/Reference/styles.arrow.css +0 -1
- package/story-elements/StoryElement/index.js +0 -1779
- package/story-elements/Summary/index.js +0 -2036
- package/story-elements/Summary/styles.arrow.css +0 -1
- package/story-elements/Text/index.js +0 -2293
- package/story-elements/Text/styles.arrow.css +0 -1
- package/story-elements/Video/index.js +0 -1785
- package/story-elements/Video/styles.arrow.css +0 -1
- package/story-templates/ListicleStoryTemplate/index.js +0 -8442
- package/story-templates/ListicleStoryTemplate/styles.arrow.css +0 -1
- package/story-templates/LiveBlogStoryTemplate/index.js +0 -8618
- package/story-templates/LiveBlogStoryTemplate/styles.arrow.css +0 -1
- package/story-templates/PhotoStoryTemplate/index.js +0 -8420
- package/story-templates/PhotoStoryTemplate/styles.arrow.css +0 -1
- package/story-templates/TextStoryTemplate/index.js +0 -8493
- package/story-templates/TextStoryTemplate/styles.arrow.css +0 -1
- package/story-templates/VideoStoryTemplate/index.js +0 -8352
- package/story-templates/VideoStoryTemplate/styles.arrow.css +0 -1
|
@@ -1,240 +0,0 @@
|
|
|
1
|
-
import { collectionToStories } from '@quintype/components';
|
|
2
|
-
import { a as get_1, g as getTextColor, l as getSlot, b as generateNavigateSlug, n as navigateTo } from './index-ad3c83c3.js';
|
|
3
|
-
import PropTypes from 'prop-types';
|
|
4
|
-
import React from 'react';
|
|
5
|
-
import { useDispatch, useSelector } from 'react-redux';
|
|
6
|
-
import { C as CollectionName, S as StateProvider, L as LoadMoreTarget, P as ProgressiveHydration, a as LoadmoreButton, H as Headline, A as AuthorWithTime } from './index-1e444d20.js';
|
|
7
|
-
import { H as HeroImage, S as SectionTag } from './index-c61a16dc.js';
|
|
8
|
-
import { S as StoryCard, a as Subheadline } from './index-0519e570.js';
|
|
9
|
-
import { S as StorycardContent } from './index-81eb3978.js';
|
|
10
|
-
import 'react-timeago';
|
|
11
|
-
import 'date-fns-tz';
|
|
12
|
-
import 'react-dom';
|
|
13
|
-
|
|
14
|
-
var loadMore = function loadMore(_ref) {
|
|
15
|
-
var isLoading = _ref.isLoading,
|
|
16
|
-
storyItems = _ref.storyItems,
|
|
17
|
-
getMoreStories = _ref.getMoreStories,
|
|
18
|
-
_ref$subsequentLoadCo = _ref.subsequentLoadCount,
|
|
19
|
-
subsequentLoadCount = _ref$subsequentLoadCo === void 0 ? 8 : _ref$subsequentLoadCo;
|
|
20
|
-
if (isLoading) return;
|
|
21
|
-
var limit = subsequentLoadCount;
|
|
22
|
-
var offset = storyItems.length;
|
|
23
|
-
getMoreStories(offset, limit);
|
|
24
|
-
};
|
|
25
|
-
|
|
26
|
-
var OneColStoryListBase = function OneColStoryListBase(_ref2) {
|
|
27
|
-
var collection = _ref2.collection,
|
|
28
|
-
_ref2$config = _ref2.config,
|
|
29
|
-
config = _ref2$config === void 0 ? {} : _ref2$config,
|
|
30
|
-
getMoreStories = _ref2.getMoreStories,
|
|
31
|
-
isLoadMoreVisible = _ref2.isLoadMoreVisible,
|
|
32
|
-
isLoading = _ref2.isLoading,
|
|
33
|
-
isolatedLoadMore = _ref2.isolatedLoadMore;
|
|
34
|
-
var storyItems = collectionToStories(collection);
|
|
35
|
-
if (!storyItems.length) return null;
|
|
36
|
-
var _config$collectionNam = config.collectionNameBorderColor,
|
|
37
|
-
collectionNameBorderColor = _config$collectionNam === void 0 ? "" : _config$collectionNam,
|
|
38
|
-
_config$borderColor = config.borderColor,
|
|
39
|
-
borderColor = _config$borderColor === void 0 ? "" : _config$borderColor,
|
|
40
|
-
_config$theme = config.theme,
|
|
41
|
-
theme = _config$theme === void 0 ? "" : _config$theme,
|
|
42
|
-
_config$border = config.border,
|
|
43
|
-
border = _config$border === void 0 ? "" : _config$border,
|
|
44
|
-
_config$slotConfig = config.slotConfig,
|
|
45
|
-
slotConfig = _config$slotConfig === void 0 ? [] : _config$slotConfig,
|
|
46
|
-
_config$collectionNam2 = config.collectionNameTemplate,
|
|
47
|
-
collectionNameTemplate = _config$collectionNam2 === void 0 ? "" : _config$collectionNam2,
|
|
48
|
-
_config$footerSlotCon = config.footerSlotConfig,
|
|
49
|
-
footerSlotConfig = _config$footerSlotCon === void 0 ? {} : _config$footerSlotCon,
|
|
50
|
-
_config$footerButton = config.footerButton,
|
|
51
|
-
footerButton = _config$footerButton === void 0 ? "" : _config$footerButton,
|
|
52
|
-
_config$localizationC = config.localizationConfig,
|
|
53
|
-
localizationConfig = _config$localizationC === void 0 ? {} : _config$localizationC,
|
|
54
|
-
_config$subsequentLoa = config.subsequentLoadCount,
|
|
55
|
-
subsequentLoadCount = _config$subsequentLoa === void 0 ? 8 : _config$subsequentLoa;
|
|
56
|
-
var footerSlot = footerSlotConfig.footerSlot;
|
|
57
|
-
|
|
58
|
-
var _get = get_1(slotConfig, [0], {}),
|
|
59
|
-
type = _get.type,
|
|
60
|
-
component = _get.component;
|
|
61
|
-
|
|
62
|
-
var dispatch = useDispatch();
|
|
63
|
-
var qtConfig = useSelector(function (state) {
|
|
64
|
-
return get_1(state, ["qt", "config"], {});
|
|
65
|
-
});
|
|
66
|
-
|
|
67
|
-
var getLoadMore = function getLoadMore(opts) {
|
|
68
|
-
if (!isLoadMoreVisible) return null;
|
|
69
|
-
|
|
70
|
-
if (isolatedLoadMore) {
|
|
71
|
-
return /*#__PURE__*/React.createElement(LoadMoreTarget, {
|
|
72
|
-
collection: collection,
|
|
73
|
-
componentName: "OneColStoryList",
|
|
74
|
-
offset: storyItems.length,
|
|
75
|
-
limit: subsequentLoadCount
|
|
76
|
-
});
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
var url = generateNavigateSlug(collection, qtConfig);
|
|
80
|
-
return /*#__PURE__*/React.createElement(ProgressiveHydration, null, /*#__PURE__*/React.createElement(LoadmoreButton, {
|
|
81
|
-
config: config,
|
|
82
|
-
collection: collection,
|
|
83
|
-
template: footerButton,
|
|
84
|
-
onClick: function onClick() {
|
|
85
|
-
return loadMore(opts);
|
|
86
|
-
},
|
|
87
|
-
navigate: function navigate() {
|
|
88
|
-
return navigateTo(dispatch, url);
|
|
89
|
-
},
|
|
90
|
-
qtConfig: qtConfig
|
|
91
|
-
}));
|
|
92
|
-
};
|
|
93
|
-
|
|
94
|
-
var footerSlotComp = footerSlot ? footerSlot() : null;
|
|
95
|
-
|
|
96
|
-
var borderHandler = function borderHandler(story) {
|
|
97
|
-
switch (border) {
|
|
98
|
-
case "bottom":
|
|
99
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
100
|
-
className: "one-col-story-list-m_one-col-border-bottom__13nPb"
|
|
101
|
-
}, /*#__PURE__*/React.createElement(StoryCard, {
|
|
102
|
-
story: story,
|
|
103
|
-
theme: theme,
|
|
104
|
-
headerLevel: "4",
|
|
105
|
-
isHorizontal: true,
|
|
106
|
-
border: border,
|
|
107
|
-
aspectRatio: [[1, 1], [4, 3]],
|
|
108
|
-
borderColor: borderColor,
|
|
109
|
-
prefix: "By",
|
|
110
|
-
config: config
|
|
111
|
-
}));
|
|
112
|
-
|
|
113
|
-
case "full":
|
|
114
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
115
|
-
className: "one-col-story-list-m_one-col-border-full__3PSl0"
|
|
116
|
-
}, /*#__PURE__*/React.createElement(StoryCard, {
|
|
117
|
-
story: story,
|
|
118
|
-
border: border,
|
|
119
|
-
theme: theme,
|
|
120
|
-
isHorizontal: true,
|
|
121
|
-
borderColor: borderColor
|
|
122
|
-
}, /*#__PURE__*/React.createElement(HeroImage, {
|
|
123
|
-
story: story,
|
|
124
|
-
isHorizontal: true,
|
|
125
|
-
aspectRatio: [[1, 1], [4, 3]]
|
|
126
|
-
}), /*#__PURE__*/React.createElement("div", {
|
|
127
|
-
className: "one-col-story-list-m_story-card-content-wrapper__1baqS"
|
|
128
|
-
}, /*#__PURE__*/React.createElement(StorycardContent, {
|
|
129
|
-
story: story,
|
|
130
|
-
borderColor: borderColor,
|
|
131
|
-
config: config
|
|
132
|
-
}, /*#__PURE__*/React.createElement(SectionTag, {
|
|
133
|
-
story: story
|
|
134
|
-
}), /*#__PURE__*/React.createElement(Headline, {
|
|
135
|
-
story: story,
|
|
136
|
-
headerLevel: "4",
|
|
137
|
-
premiumStoryIconConfig: config
|
|
138
|
-
}), /*#__PURE__*/React.createElement(Subheadline, {
|
|
139
|
-
story: story
|
|
140
|
-
}), /*#__PURE__*/React.createElement(AuthorWithTime, {
|
|
141
|
-
config: localizationConfig,
|
|
142
|
-
story: story,
|
|
143
|
-
prefix: "By"
|
|
144
|
-
})))));
|
|
145
|
-
|
|
146
|
-
default:
|
|
147
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
148
|
-
className: "one-col-story-list-m_one-col-border-default__2BDg7"
|
|
149
|
-
}, /*#__PURE__*/React.createElement(StoryCard, {
|
|
150
|
-
story: story,
|
|
151
|
-
theme: theme,
|
|
152
|
-
headerLevel: "4",
|
|
153
|
-
isHorizontal: true,
|
|
154
|
-
border: border,
|
|
155
|
-
aspectRatio: [[1, 1], [4, 3]],
|
|
156
|
-
borderColor: borderColor,
|
|
157
|
-
prefix: "By",
|
|
158
|
-
config: config
|
|
159
|
-
}));
|
|
160
|
-
}
|
|
161
|
-
};
|
|
162
|
-
|
|
163
|
-
var textColor = getTextColor(theme);
|
|
164
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
165
|
-
className: "full-width-with-padding arrow-component",
|
|
166
|
-
"data-test-id": "one-col-story-list",
|
|
167
|
-
style: {
|
|
168
|
-
backgroundColor: theme,
|
|
169
|
-
color: textColor
|
|
170
|
-
}
|
|
171
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
172
|
-
className: "one-col-story-list-m_one-col-story-list-wrapper__ICvTq"
|
|
173
|
-
}, /*#__PURE__*/React.createElement(CollectionName, {
|
|
174
|
-
collection: collection,
|
|
175
|
-
collectionNameTemplate: collectionNameTemplate,
|
|
176
|
-
collectionNameBorderColor: collectionNameBorderColor
|
|
177
|
-
}), /*#__PURE__*/React.createElement("div", {
|
|
178
|
-
className: "one-col-story-list-m_wrapper__38qTp",
|
|
179
|
-
style: {
|
|
180
|
-
backgroundColor: theme,
|
|
181
|
-
color: textColor
|
|
182
|
-
}
|
|
183
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
184
|
-
className: "one-col-story-list-m_one-col-first-story__1aC6i"
|
|
185
|
-
}, storyItems.slice(0, 1).map(function (story, index) {
|
|
186
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
187
|
-
key: "default-".concat(index)
|
|
188
|
-
}, borderHandler(story));
|
|
189
|
-
})), /*#__PURE__*/React.createElement("div", {
|
|
190
|
-
className: "one-col-story-list-m_one-col-story-list__3d6Bp"
|
|
191
|
-
}, storyItems.slice(1).map(function (story, index) {
|
|
192
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
193
|
-
key: "default-".concat(index)
|
|
194
|
-
}, borderHandler(story));
|
|
195
|
-
})), /*#__PURE__*/React.createElement("div", {
|
|
196
|
-
className: "one-col-story-list-m_one-col-ads__UN_hF"
|
|
197
|
-
}, getSlot(type, component, function () {
|
|
198
|
-
return null;
|
|
199
|
-
}, function () {
|
|
200
|
-
return null;
|
|
201
|
-
}))), /*#__PURE__*/React.createElement("div", {
|
|
202
|
-
className: "one-col-story-list-m_footer-ad-wrapper__NGgvp"
|
|
203
|
-
}, getLoadMore({
|
|
204
|
-
isLoading: isLoading,
|
|
205
|
-
storyItems: storyItems,
|
|
206
|
-
getMoreStories: getMoreStories,
|
|
207
|
-
subsequentLoadCount: subsequentLoadCount
|
|
208
|
-
}), /*#__PURE__*/React.createElement("div", {
|
|
209
|
-
className: "one-col-story-list-m_ad-wrapper__3_cNc"
|
|
210
|
-
}, footerSlotComp))));
|
|
211
|
-
};
|
|
212
|
-
OneColStoryListBase.propTypes = {
|
|
213
|
-
/** collection is the array of objects which is returning by API */
|
|
214
|
-
collection: PropTypes.object.isRequired,
|
|
215
|
-
|
|
216
|
-
/** The config for the Row */
|
|
217
|
-
config: PropTypes.shape({
|
|
218
|
-
borderColor: PropTypes.string,
|
|
219
|
-
theme: PropTypes.string,
|
|
220
|
-
border: PropTypes.string,
|
|
221
|
-
footerButton: PropTypes.string,
|
|
222
|
-
// row title style
|
|
223
|
-
collectionNameTemplate: PropTypes.string,
|
|
224
|
-
// row title style colour
|
|
225
|
-
collectionNameBorderColor: PropTypes.string,
|
|
226
|
-
subsequentLoadCount: PropTypes.number
|
|
227
|
-
}),
|
|
228
|
-
getMoreStories: PropTypes.func,
|
|
229
|
-
isLoadMoreVisible: PropTypes.bool,
|
|
230
|
-
isLoading: PropTypes.bool,
|
|
231
|
-
isolatedLoadMore: PropTypes.bool
|
|
232
|
-
};
|
|
233
|
-
OneColStoryListBase.defaultProps = {
|
|
234
|
-
getMoreStories: function getMoreStories() {},
|
|
235
|
-
isLoadMoreVisible: true,
|
|
236
|
-
isLoading: false
|
|
237
|
-
};
|
|
238
|
-
var OneColStoryList = StateProvider(OneColStoryListBase);
|
|
239
|
-
|
|
240
|
-
export { OneColStoryList, OneColStoryListBase };
|
|
@@ -1,199 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { useDispatch, useSelector } from 'react-redux';
|
|
3
|
-
import { i as isEmpty, g as getTextColor, a as get_1, b as generateNavigateSlug, n as navigateTo } from './index-ad3c83c3.js';
|
|
4
|
-
import PropTypes from 'prop-types';
|
|
5
|
-
import { collectionToStories } from '@quintype/components';
|
|
6
|
-
import { S as StateProvider, C as CollectionName, L as LoadMoreTarget, P as ProgressiveHydration, a as LoadmoreButton } from './index-1e444d20.js';
|
|
7
|
-
import { S as StoryCard } from './index-0519e570.js';
|
|
8
|
-
import { S as StorycardContent } from './index-81eb3978.js';
|
|
9
|
-
import { H as HeroImage } from './index-c61a16dc.js';
|
|
10
|
-
import 'react-timeago';
|
|
11
|
-
import 'date-fns-tz';
|
|
12
|
-
import 'react-dom';
|
|
13
|
-
|
|
14
|
-
var PortraitStoryCardBase = function PortraitStoryCardBase(_ref) {
|
|
15
|
-
var story = _ref.story,
|
|
16
|
-
_ref$border = _ref.border,
|
|
17
|
-
border = _ref$border === void 0 ? "" : _ref$border,
|
|
18
|
-
_ref$theme = _ref.theme,
|
|
19
|
-
theme = _ref$theme === void 0 ? "" : _ref$theme,
|
|
20
|
-
_ref$headerLevel = _ref.headerLevel,
|
|
21
|
-
headerLevel = _ref$headerLevel === void 0 ? "6" : _ref$headerLevel,
|
|
22
|
-
_ref$separator = _ref.separator,
|
|
23
|
-
separator = _ref$separator === void 0 ? "" : _ref$separator,
|
|
24
|
-
_ref$config = _ref.config,
|
|
25
|
-
config = _ref$config === void 0 ? {} : _ref$config,
|
|
26
|
-
_ref$borderColor = _ref.borderColor,
|
|
27
|
-
borderColor = _ref$borderColor === void 0 ? "" : _ref$borderColor;
|
|
28
|
-
if (isEmpty(story)) return null;
|
|
29
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
30
|
-
className: "portrait-story-card-m_wrapper__3nche"
|
|
31
|
-
}, /*#__PURE__*/React.createElement(StoryCard, {
|
|
32
|
-
story: story,
|
|
33
|
-
border: border,
|
|
34
|
-
theme: theme,
|
|
35
|
-
config: config,
|
|
36
|
-
useImageAsBackground: true
|
|
37
|
-
}, /*#__PURE__*/React.createElement(HeroImage, {
|
|
38
|
-
story: story,
|
|
39
|
-
aspectRatio: [[9, 16]]
|
|
40
|
-
}), /*#__PURE__*/React.createElement(StorycardContent, {
|
|
41
|
-
story: story,
|
|
42
|
-
config: config,
|
|
43
|
-
separator: separator,
|
|
44
|
-
borderColor: borderColor,
|
|
45
|
-
headerLevel: headerLevel
|
|
46
|
-
})));
|
|
47
|
-
};
|
|
48
|
-
PortraitStoryCardBase.propTypes = {
|
|
49
|
-
border: PropTypes.string,
|
|
50
|
-
theme: PropTypes.string,
|
|
51
|
-
headerLevel: PropTypes.string,
|
|
52
|
-
separator: PropTypes.string,
|
|
53
|
-
borderColor: PropTypes.string,
|
|
54
|
-
config: PropTypes.object,
|
|
55
|
-
story: PropTypes.object
|
|
56
|
-
};
|
|
57
|
-
var PortraitStoryCard = StateProvider(PortraitStoryCardBase);
|
|
58
|
-
|
|
59
|
-
var loadMore = function loadMore(_ref) {
|
|
60
|
-
var isLoading = _ref.isLoading,
|
|
61
|
-
storyItems = _ref.storyItems,
|
|
62
|
-
getMoreStories = _ref.getMoreStories,
|
|
63
|
-
_ref$subsequentLoadCo = _ref.subsequentLoadCount,
|
|
64
|
-
subsequentLoadCount = _ref$subsequentLoadCo === void 0 ? 4 : _ref$subsequentLoadCo;
|
|
65
|
-
if (isLoading) return; // prevent multiple clicks/calls
|
|
66
|
-
|
|
67
|
-
var limit = subsequentLoadCount;
|
|
68
|
-
var offset = storyItems.length;
|
|
69
|
-
getMoreStories(offset, limit);
|
|
70
|
-
};
|
|
71
|
-
|
|
72
|
-
var FourColPortraitStoriesBase = function FourColPortraitStoriesBase(_ref2) {
|
|
73
|
-
var collection = _ref2.collection,
|
|
74
|
-
_ref2$config = _ref2.config,
|
|
75
|
-
config = _ref2$config === void 0 ? {} : _ref2$config,
|
|
76
|
-
getMoreStories = _ref2.getMoreStories,
|
|
77
|
-
isLoadMoreVisible = _ref2.isLoadMoreVisible,
|
|
78
|
-
isLoading = _ref2.isLoading,
|
|
79
|
-
isolatedLoadMore = _ref2.isolatedLoadMore;
|
|
80
|
-
var storyItems = collectionToStories(collection);
|
|
81
|
-
if (!storyItems.length) return null;
|
|
82
|
-
var _config$collectionNam = config.collectionNameBorderColor,
|
|
83
|
-
collectionNameBorderColor = _config$collectionNam === void 0 ? "" : _config$collectionNam,
|
|
84
|
-
_config$borderColor = config.borderColor,
|
|
85
|
-
borderColor = _config$borderColor === void 0 ? "" : _config$borderColor,
|
|
86
|
-
_config$theme = config.theme,
|
|
87
|
-
theme = _config$theme === void 0 ? "" : _config$theme,
|
|
88
|
-
_config$border = config.border,
|
|
89
|
-
border = _config$border === void 0 ? "" : _config$border,
|
|
90
|
-
_config$collectionNam2 = config.collectionNameTemplate,
|
|
91
|
-
collectionNameTemplate = _config$collectionNam2 === void 0 ? "" : _config$collectionNam2,
|
|
92
|
-
_config$footerSlotCon = config.footerSlotConfig,
|
|
93
|
-
footerSlotConfig = _config$footerSlotCon === void 0 ? {} : _config$footerSlotCon,
|
|
94
|
-
_config$footerButton = config.footerButton,
|
|
95
|
-
footerButton = _config$footerButton === void 0 ? "" : _config$footerButton,
|
|
96
|
-
customCollectionName = config.customCollectionName,
|
|
97
|
-
_config$navigate = config.navigate,
|
|
98
|
-
navigate = _config$navigate === void 0 ? true : _config$navigate,
|
|
99
|
-
_config$subsequentLoa = config.subsequentLoadCount,
|
|
100
|
-
subsequentLoadCount = _config$subsequentLoa === void 0 ? 4 : _config$subsequentLoa;
|
|
101
|
-
var footerSlot = footerSlotConfig.footerSlot;
|
|
102
|
-
var footerSlotComp = typeof footerSlot === "function" ? footerSlot() : null;
|
|
103
|
-
var textColor = getTextColor(theme);
|
|
104
|
-
var dispatch = useDispatch();
|
|
105
|
-
var qtConfig = useSelector(function (state) {
|
|
106
|
-
return get_1(state, ["qt", "config"], {});
|
|
107
|
-
});
|
|
108
|
-
|
|
109
|
-
var getLoadMore = function getLoadMore(opts) {
|
|
110
|
-
if (!isLoadMoreVisible) return null;
|
|
111
|
-
|
|
112
|
-
if (isolatedLoadMore) {
|
|
113
|
-
return /*#__PURE__*/React.createElement(LoadMoreTarget, {
|
|
114
|
-
collection: collection,
|
|
115
|
-
componentName: "FourColPortraitStories",
|
|
116
|
-
offset: storyItems.length,
|
|
117
|
-
limit: subsequentLoadCount
|
|
118
|
-
});
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
var url = generateNavigateSlug(collection, qtConfig);
|
|
122
|
-
return /*#__PURE__*/React.createElement(ProgressiveHydration, null, /*#__PURE__*/React.createElement(LoadmoreButton, {
|
|
123
|
-
config: config,
|
|
124
|
-
collection: collection,
|
|
125
|
-
template: footerButton,
|
|
126
|
-
onClick: function onClick() {
|
|
127
|
-
return loadMore(opts);
|
|
128
|
-
},
|
|
129
|
-
navigate: function navigate() {
|
|
130
|
-
return navigateTo(dispatch, url);
|
|
131
|
-
},
|
|
132
|
-
qtConfig: qtConfig
|
|
133
|
-
}));
|
|
134
|
-
};
|
|
135
|
-
|
|
136
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
137
|
-
className: "full-width-with-padding arrow-component",
|
|
138
|
-
"data-test-id": "four-col-portrait-stories",
|
|
139
|
-
style: {
|
|
140
|
-
backgroundColor: theme,
|
|
141
|
-
color: textColor
|
|
142
|
-
}
|
|
143
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
144
|
-
className: "four-col-portrait-stories-m_four-col-portrait__AtWub"
|
|
145
|
-
}, /*#__PURE__*/React.createElement(CollectionName, {
|
|
146
|
-
collection: collection,
|
|
147
|
-
collectionNameTemplate: collectionNameTemplate,
|
|
148
|
-
collectionNameBorderColor: collectionNameBorderColor,
|
|
149
|
-
customCollectionName: customCollectionName,
|
|
150
|
-
navigate: navigate
|
|
151
|
-
}), /*#__PURE__*/React.createElement("div", {
|
|
152
|
-
className: "four-col-portrait-stories-m_wrapper__1BX02"
|
|
153
|
-
}, storyItems.map(function (story, index) {
|
|
154
|
-
return /*#__PURE__*/React.createElement(PortraitStoryCard, {
|
|
155
|
-
story: story,
|
|
156
|
-
border: border,
|
|
157
|
-
theme: theme,
|
|
158
|
-
config: Object.assign({
|
|
159
|
-
showSection: false,
|
|
160
|
-
showAuthor: false,
|
|
161
|
-
showReadTime: false
|
|
162
|
-
}, config),
|
|
163
|
-
borderColor: borderColor,
|
|
164
|
-
key: "story-card-".concat(index)
|
|
165
|
-
});
|
|
166
|
-
})), getLoadMore({
|
|
167
|
-
isLoading: isLoading,
|
|
168
|
-
storyItems: storyItems,
|
|
169
|
-
getMoreStories: getMoreStories,
|
|
170
|
-
subsequentLoadCount: subsequentLoadCount
|
|
171
|
-
}), footerSlotComp));
|
|
172
|
-
};
|
|
173
|
-
FourColPortraitStoriesBase.propTypes = {
|
|
174
|
-
/** collection is the array of objects which is returning by API */
|
|
175
|
-
collection: PropTypes.object.isRequired,
|
|
176
|
-
|
|
177
|
-
/** The config for the Row */
|
|
178
|
-
config: PropTypes.shape({
|
|
179
|
-
borderColor: PropTypes.string,
|
|
180
|
-
theme: PropTypes.string,
|
|
181
|
-
border: PropTypes.bool,
|
|
182
|
-
collectionNameTemplate: PropTypes.string,
|
|
183
|
-
footerButton: PropTypes.string,
|
|
184
|
-
collectionNameBorderColor: PropTypes.string,
|
|
185
|
-
subsequentLoadCount: PropTypes.number
|
|
186
|
-
}),
|
|
187
|
-
getMoreStories: PropTypes.func,
|
|
188
|
-
isLoadMoreVisible: PropTypes.bool,
|
|
189
|
-
isLoading: PropTypes.bool,
|
|
190
|
-
isolatedLoadMore: PropTypes.bool
|
|
191
|
-
};
|
|
192
|
-
FourColPortraitStoriesBase.defaultProps = {
|
|
193
|
-
getMoreStories: function getMoreStories() {},
|
|
194
|
-
isLoadMoreVisible: true,
|
|
195
|
-
isLoading: false
|
|
196
|
-
};
|
|
197
|
-
var FourColPortraitStories = StateProvider(FourColPortraitStoriesBase);
|
|
198
|
-
|
|
199
|
-
export { FourColPortraitStories, FourColPortraitStoriesBase };
|