@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
|
@@ -0,0 +1,476 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var _toConsumableArray = require('@babel/runtime/helpers/toConsumableArray');
|
|
4
|
+
var _asyncToGenerator = require('@babel/runtime/helpers/asyncToGenerator');
|
|
5
|
+
var _slicedToArray = require('@babel/runtime/helpers/slicedToArray');
|
|
6
|
+
var _getClassName = require('babel-plugin-react-css-modules/dist/browser/getClassName');
|
|
7
|
+
var _regeneratorRuntime = require('@babel/runtime/regenerator');
|
|
8
|
+
var lodash = require('lodash');
|
|
9
|
+
var PropTypes = require('prop-types');
|
|
10
|
+
var React = require('react');
|
|
11
|
+
var _typeof = require('@babel/runtime/helpers/typeof');
|
|
12
|
+
var Timeago = require('react-timeago');
|
|
13
|
+
var dateFnsTz = require('date-fns-tz');
|
|
14
|
+
|
|
15
|
+
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
16
|
+
|
|
17
|
+
var _toConsumableArray__default = /*#__PURE__*/_interopDefaultLegacy(_toConsumableArray);
|
|
18
|
+
var _asyncToGenerator__default = /*#__PURE__*/_interopDefaultLegacy(_asyncToGenerator);
|
|
19
|
+
var _slicedToArray__default = /*#__PURE__*/_interopDefaultLegacy(_slicedToArray);
|
|
20
|
+
var _getClassName__default = /*#__PURE__*/_interopDefaultLegacy(_getClassName);
|
|
21
|
+
var _regeneratorRuntime__default = /*#__PURE__*/_interopDefaultLegacy(_regeneratorRuntime);
|
|
22
|
+
var PropTypes__default = /*#__PURE__*/_interopDefaultLegacy(PropTypes);
|
|
23
|
+
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
24
|
+
var _typeof__default = /*#__PURE__*/_interopDefaultLegacy(_typeof);
|
|
25
|
+
var Timeago__default = /*#__PURE__*/_interopDefaultLegacy(Timeago);
|
|
26
|
+
|
|
27
|
+
function truncate() {
|
|
28
|
+
var string = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : "";
|
|
29
|
+
var limit = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 60;
|
|
30
|
+
var ellipsis = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
|
|
31
|
+
var putEllipsis = ellipsis ? " ..." : "";
|
|
32
|
+
return typeof string === "string" && string.length > limit ? string.substring(0, limit) + putEllipsis : string;
|
|
33
|
+
}
|
|
34
|
+
var timestampToFormat = function timestampToFormat(value, unit, suffix, timestamp) {
|
|
35
|
+
var config = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : {};
|
|
36
|
+
var _config$showTime = config.showTime,
|
|
37
|
+
showTime = _config$showTime === void 0 ? false : _config$showTime,
|
|
38
|
+
_config$isTimeFirst = config.isTimeFirst,
|
|
39
|
+
isTimeFirst = _config$isTimeFirst === void 0 ? false : _config$isTimeFirst,
|
|
40
|
+
_config$isUpperCase = config.isUpperCase,
|
|
41
|
+
isUpperCase = _config$isUpperCase === void 0 ? false : _config$isUpperCase,
|
|
42
|
+
_config$disableMeridi = config.disableMeridiem,
|
|
43
|
+
disableMeridiem = _config$disableMeridi === void 0 ? false : _config$disableMeridi,
|
|
44
|
+
_config$timeFormat = config.timeFormat,
|
|
45
|
+
timeFormat = _config$timeFormat === void 0 ? "12hours" : _config$timeFormat;
|
|
46
|
+
var monthList = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"];
|
|
47
|
+
var dateTime = new Date(timestamp);
|
|
48
|
+
var date = dateTime.getDate().toString().padStart(2, 0);
|
|
49
|
+
var month = monthList[dateTime.getMonth()];
|
|
50
|
+
var localizedMonth = month;
|
|
51
|
+
|
|
52
|
+
if (isUpperCase) {
|
|
53
|
+
localizedMonth = lodash.upperCase(month);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
var year = dateTime.getFullYear();
|
|
57
|
+
var localizedMeridiem = config.localizedMeridiem,
|
|
58
|
+
localizedMonths = config.localizedMonths,
|
|
59
|
+
_config$direction = config.direction,
|
|
60
|
+
direction = _config$direction === void 0 ? "ltr" : _config$direction;
|
|
61
|
+
var time = formatAMPM(timestamp, timeFormat);
|
|
62
|
+
var timeWithLocalizedMeridiem = time;
|
|
63
|
+
var timetoShow;
|
|
64
|
+
|
|
65
|
+
if (localizedMonths) {
|
|
66
|
+
localizedMonth = lodash.get(localizedMonths, [lodash.lowerCase(month)]) || month;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
if (localizedMeridiem) {
|
|
70
|
+
var isAm = time.includes("am");
|
|
71
|
+
var _localizedMeridiem$am = localizedMeridiem.am,
|
|
72
|
+
am = _localizedMeridiem$am === void 0 ? "am" : _localizedMeridiem$am,
|
|
73
|
+
_localizedMeridiem$pm = localizedMeridiem.pm,
|
|
74
|
+
pm = _localizedMeridiem$pm === void 0 ? "pm" : _localizedMeridiem$pm;
|
|
75
|
+
timeWithLocalizedMeridiem = (isAm ? time.replace("am", am) : time.replace("pm", pm)) || time;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
if (direction === "rtl") {
|
|
79
|
+
timetoShow = showTime ? "".concat(timeWithLocalizedMeridiem) : "";
|
|
80
|
+
return "".concat(date, " ").concat(localizedMonth, ", ").concat(year, " ").concat(timetoShow, " ");
|
|
81
|
+
} else {
|
|
82
|
+
if (disableMeridiem) {
|
|
83
|
+
return "".concat(localizedMonth, " ").concat(date, ", ").concat(year);
|
|
84
|
+
} else if (isTimeFirst) {
|
|
85
|
+
return "".concat(timeWithLocalizedMeridiem, ", ").concat(date, " ").concat(localizedMonth, " ").concat(year);
|
|
86
|
+
} else {
|
|
87
|
+
timetoShow = showTime ? ", ".concat(timeWithLocalizedMeridiem) : "";
|
|
88
|
+
return "".concat(date, " ").concat(localizedMonth, ", ").concat(year).concat(timetoShow);
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
};
|
|
92
|
+
function formatter(value, unit, suffix, date, config) {
|
|
93
|
+
var showDateForUnits = ["day", "week", "month", "year"]; // suffix here refers to ago
|
|
94
|
+
// unit here refers to seconds, minute, minutes,...
|
|
95
|
+
|
|
96
|
+
var localizedSuffix = lodash.get(config, ["localizedPublishTime", suffix]) || suffix;
|
|
97
|
+
var localizedUnitOfTime;
|
|
98
|
+
|
|
99
|
+
if (unit === "hour" && value > 23 || showDateForUnits.indexOf(unit) !== -1) {
|
|
100
|
+
return timestampToFormat(value, unit, suffix, date, config);
|
|
101
|
+
} else if (value > 1) {
|
|
102
|
+
localizedUnitOfTime = lodash.get(config, ["localizedPublishTime", "".concat(unit, "s")]) || "".concat(unit, "s");
|
|
103
|
+
return "".concat(value, " ").concat(localizedUnitOfTime, " ").concat(localizedSuffix);
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
localizedUnitOfTime = lodash.get(config, ["localizedPublishTime", unit]) || unit;
|
|
107
|
+
return "".concat(value, " ").concat(localizedUnitOfTime, " ").concat(localizedSuffix, " ");
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
function formatAMPM(timestamp) {
|
|
111
|
+
var timeFormat = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "12hours";
|
|
112
|
+
var dateTime = new Date(timestamp);
|
|
113
|
+
var hours = dateTime.getHours();
|
|
114
|
+
var minutes = dateTime.getMinutes();
|
|
115
|
+
var ampm = hours >= 12 ? "pm" : "am";
|
|
116
|
+
hours = hours % 12;
|
|
117
|
+
hours = hours || 12;
|
|
118
|
+
minutes = minutes < 10 ? "0" + minutes : minutes;
|
|
119
|
+
var strTime = hours + ":" + minutes + " " + ampm;
|
|
120
|
+
|
|
121
|
+
if (timeFormat === "24hours") {
|
|
122
|
+
return dateTime.toLocaleTimeString([], {
|
|
123
|
+
hour: "2-digit",
|
|
124
|
+
minute: "2-digit"
|
|
125
|
+
});
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
return strTime;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
var hexToRGB = function hexToRGB(hex) {
|
|
132
|
+
var r = parseInt(hex.slice(1, 3), 16);
|
|
133
|
+
var g = parseInt(hex.slice(3, 5), 16);
|
|
134
|
+
var b = parseInt(hex.slice(5, 7), 16);
|
|
135
|
+
return {
|
|
136
|
+
r: r,
|
|
137
|
+
g: g,
|
|
138
|
+
b: b
|
|
139
|
+
};
|
|
140
|
+
};
|
|
141
|
+
var getLuminanceOfColor = function getLuminanceOfColor(hex) {
|
|
142
|
+
var _hexToRGB = hexToRGB(hex),
|
|
143
|
+
r = _hexToRGB.r,
|
|
144
|
+
g = _hexToRGB.g,
|
|
145
|
+
b = _hexToRGB.b;
|
|
146
|
+
|
|
147
|
+
return r * 0.299 + g * 0.587 + b * 0.114;
|
|
148
|
+
};
|
|
149
|
+
var rgbToHex = function rgbToHex() {
|
|
150
|
+
var color = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : "rgba(255, 255, 255, 0)";
|
|
151
|
+
var rgba = color.match(/^rgba?[\s+]?\([\s+]?(\d+)[\s+]?,[\s+]?(\d+)[\s+]?,[\s+]?(\d+)[\s+]?/i);
|
|
152
|
+
return rgba && rgba.length === 4 ? "#" + ("0" + parseInt(rgba[1], 10).toString(16)).slice(-2) + ("0" + parseInt(rgba[2], 10).toString(16)).slice(-2) + ("0" + parseInt(rgba[3], 10).toString(16)).slice(-2) : color;
|
|
153
|
+
};
|
|
154
|
+
var clientWidths = {
|
|
155
|
+
mobile: 767,
|
|
156
|
+
tablet: 1024
|
|
157
|
+
};
|
|
158
|
+
var clientWidth = function clientWidth(device) {
|
|
159
|
+
var foundDeviceWidth = lodash.get(clientWidths, device);
|
|
160
|
+
|
|
161
|
+
if (foundDeviceWidth) {
|
|
162
|
+
return lodash.get(global, "document.documentElement.clientWidth") <= foundDeviceWidth;
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
return false;
|
|
166
|
+
};
|
|
167
|
+
var getTextColor = function getTextColor() {
|
|
168
|
+
var theme = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : "rgb(255,255,255)";
|
|
169
|
+
var isRegexCheck = /^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/.test(theme);
|
|
170
|
+
var getHexValue = !isRegexCheck ? rgbToHex(theme) : theme;
|
|
171
|
+
var textColor = getLuminanceOfColor(getHexValue) < 155 ? "light" : "dark";
|
|
172
|
+
return textColor;
|
|
173
|
+
};
|
|
174
|
+
var getSlot = function getSlot(type, component, storyCallback, collectionCallback) {
|
|
175
|
+
switch (type) {
|
|
176
|
+
case "story":
|
|
177
|
+
return storyCallback();
|
|
178
|
+
|
|
179
|
+
case "collection":
|
|
180
|
+
return collectionCallback();
|
|
181
|
+
|
|
182
|
+
default:
|
|
183
|
+
return component ? component() : null;
|
|
184
|
+
}
|
|
185
|
+
};
|
|
186
|
+
var getSlug = function getSlug(collection) {
|
|
187
|
+
var config = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
188
|
+
var _config$magazineSlug = config.magazineSlug,
|
|
189
|
+
magazineSlug = _config$magazineSlug === void 0 ? "" : _config$magazineSlug,
|
|
190
|
+
_config$isArchivePage = config.isArchivePage,
|
|
191
|
+
isArchivePage = _config$isArchivePage === void 0 ? false : _config$isArchivePage;
|
|
192
|
+
|
|
193
|
+
if (isArchivePage) {
|
|
194
|
+
return "/magazine/archive/".concat(magazineSlug);
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
if (magazineSlug) {
|
|
198
|
+
return "/magazine/".concat(magazineSlug, "/").concat(collection.slug);
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
var isSection = collection.template === "section";
|
|
202
|
+
|
|
203
|
+
if (isSection) {
|
|
204
|
+
var sectionId = lodash.get(collection, ["metadata", "section", "0", "id"], "");
|
|
205
|
+
var sections = config.sections;
|
|
206
|
+
var section = sections && sections.find(function (section) {
|
|
207
|
+
return section.id === sectionId;
|
|
208
|
+
});
|
|
209
|
+
return section ? section["section-url"] : "/";
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
return "/collection/".concat(collection.slug);
|
|
213
|
+
};
|
|
214
|
+
function isExternalStory() {
|
|
215
|
+
var story = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
216
|
+
var _story$storyTemplate = story["story-template"],
|
|
217
|
+
storyTemplate = _story$storyTemplate === void 0 ? "" : _story$storyTemplate,
|
|
218
|
+
_story$metadata = story.metadata,
|
|
219
|
+
metadata = _story$metadata === void 0 ? {} : _story$metadata;
|
|
220
|
+
return storyTemplate === "news-elsewhere" ? lodash.get(metadata, ["reference-url"], "") : "";
|
|
221
|
+
} // Adds target='_blank' attribute to anchor tags if not present
|
|
222
|
+
var isEmpty = function isEmpty(value) {
|
|
223
|
+
return value == null || // From standard.js: Always use === - but value == null is allowed to check null || undefined
|
|
224
|
+
_typeof__default["default"](value) === "object" && Object.entries(value).length === 0 && value.constructor === Object || typeof value === "string" && value.trim().length === 0;
|
|
225
|
+
};
|
|
226
|
+
PropTypes__default["default"].shape({
|
|
227
|
+
"sketches-host": PropTypes__default["default"].string,
|
|
228
|
+
"cdn-name": PropTypes__default["default"].string,
|
|
229
|
+
"cdn-image": PropTypes__default["default"].string
|
|
230
|
+
});
|
|
231
|
+
PropTypes__default["default"].shape({
|
|
232
|
+
headline: PropTypes__default["default"].string,
|
|
233
|
+
"last-published-at": PropTypes__default["default"].number,
|
|
234
|
+
subheadline: PropTypes__default["default"].string
|
|
235
|
+
});
|
|
236
|
+
var getStoryUrl = function getStoryUrl(story) {
|
|
237
|
+
var defaultValue = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "";
|
|
238
|
+
return lodash.get(story, ["story-template"]) === "news-elsewhere" ? lodash.get(story, ["metadata", "reference-url"], "") : story.url || defaultValue;
|
|
239
|
+
};
|
|
240
|
+
var navigateTo = function navigateTo(dispatch) {
|
|
241
|
+
var url = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "";
|
|
242
|
+
global.app.navigateToPage(dispatch, url);
|
|
243
|
+
};
|
|
244
|
+
var generateNavigateSlug = function generateNavigateSlug() {
|
|
245
|
+
var collection = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
246
|
+
var config = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
247
|
+
var customUrlPath = arguments.length > 2 ? arguments[2] : undefined;
|
|
248
|
+
|
|
249
|
+
if (customUrlPath) {
|
|
250
|
+
return customUrlPath;
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
var _config$magazineSlug2 = config.magazineSlug,
|
|
254
|
+
magazineSlug = _config$magazineSlug2 === void 0 ? "" : _config$magazineSlug2,
|
|
255
|
+
_config$isArchivePage2 = config.isArchivePage,
|
|
256
|
+
isArchivePage = _config$isArchivePage2 === void 0 ? false : _config$isArchivePage2;
|
|
257
|
+
|
|
258
|
+
if (isArchivePage) {
|
|
259
|
+
return "/magazine/archive/".concat(magazineSlug);
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
if (magazineSlug) {
|
|
263
|
+
return "/magazine/".concat(magazineSlug, "/").concat(collection.slug);
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
if (collection) {
|
|
267
|
+
return getSlug(collection, config);
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
return "/";
|
|
271
|
+
};
|
|
272
|
+
var getTimeStamp = function getTimeStamp(date, _formatter) {
|
|
273
|
+
var config = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
274
|
+
var template = arguments.length > 3 ? arguments[3] : undefined;
|
|
275
|
+
var timezone = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : null;
|
|
276
|
+
|
|
277
|
+
if (timezone && template === "story") {
|
|
278
|
+
var zonedTime = timezone && dateFnsTz.utcToZonedTime(date, timezone);
|
|
279
|
+
var formatZonedTime = zonedTime && dateFnsTz.format(zonedTime, "yyyy-MM-dd'T'HH:mm:ssXXX", {
|
|
280
|
+
timeZone: timezone
|
|
281
|
+
});
|
|
282
|
+
var timeStamp = timestampToFormat("", "", "", date, config);
|
|
283
|
+
return /*#__PURE__*/React__default["default"].createElement("time", {
|
|
284
|
+
dateTime: formatZonedTime
|
|
285
|
+
}, timeStamp);
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
return /*#__PURE__*/React__default["default"].createElement(Timeago__default["default"], {
|
|
289
|
+
date: date,
|
|
290
|
+
formatter: function formatter(value, unit, suffix, date) {
|
|
291
|
+
return _formatter(value, unit, suffix, date, config);
|
|
292
|
+
}
|
|
293
|
+
});
|
|
294
|
+
};
|
|
295
|
+
|
|
296
|
+
var _styleModuleImportMap = {
|
|
297
|
+
"./../Loadmore/load-more.m.css": {
|
|
298
|
+
"button": "load-more-m_button__1mmf1",
|
|
299
|
+
"default": "load-more-m_default__2_k4V",
|
|
300
|
+
"dark": "load-more-m_dark__3dfzb",
|
|
301
|
+
"light": "load-more-m_light__ePZQI"
|
|
302
|
+
}
|
|
303
|
+
};
|
|
304
|
+
|
|
305
|
+
var getTemplate = function getTemplate(templateName) {
|
|
306
|
+
switch (templateName) {
|
|
307
|
+
case "ArrowFourColGrid":
|
|
308
|
+
return /*#__PURE__*/React.lazy(function () {
|
|
309
|
+
return Promise.resolve().then(function () { return require('./index-37a9ccff.js'); });
|
|
310
|
+
});
|
|
311
|
+
|
|
312
|
+
case "ArrowThreeColGrid":
|
|
313
|
+
return /*#__PURE__*/React.lazy(function () {
|
|
314
|
+
return Promise.resolve().then(function () { return require('./index-446679c8.js'); });
|
|
315
|
+
});
|
|
316
|
+
|
|
317
|
+
case "ArrowOneColStoryList":
|
|
318
|
+
return /*#__PURE__*/React.lazy(function () {
|
|
319
|
+
return Promise.resolve().then(function () { return require('./index-bbaf526e.js'); });
|
|
320
|
+
});
|
|
321
|
+
|
|
322
|
+
case "ArrowFourColFiveStories":
|
|
323
|
+
return /*#__PURE__*/React.lazy(function () {
|
|
324
|
+
return Promise.resolve().then(function () { return require('./index-b5754c5d.js'); });
|
|
325
|
+
});
|
|
326
|
+
|
|
327
|
+
case "ArrowOpinionCollection":
|
|
328
|
+
return /*#__PURE__*/React.lazy(function () {
|
|
329
|
+
return Promise.resolve().then(function () { return require('./index-44f97338.js'); });
|
|
330
|
+
});
|
|
331
|
+
|
|
332
|
+
case "ArrowSixColSixStories":
|
|
333
|
+
return /*#__PURE__*/React.lazy(function () {
|
|
334
|
+
return Promise.resolve().then(function () { return require('./index-cfb262ef.js'); });
|
|
335
|
+
});
|
|
336
|
+
|
|
337
|
+
case "ArrowThreeColFlexStories":
|
|
338
|
+
return /*#__PURE__*/React.lazy(function () {
|
|
339
|
+
return Promise.resolve().then(function () { return require('./index-57dd4870.js'); });
|
|
340
|
+
});
|
|
341
|
+
|
|
342
|
+
case "ArrowFourColPortraitStories":
|
|
343
|
+
return /*#__PURE__*/React.lazy(function () {
|
|
344
|
+
return Promise.resolve().then(function () { return require('./index-66dd4dbd.js'); });
|
|
345
|
+
});
|
|
346
|
+
|
|
347
|
+
default:
|
|
348
|
+
return /*#__PURE__*/React.lazy(function () {
|
|
349
|
+
return Promise.resolve().then(function () { return require('./index-446679c8.js'); });
|
|
350
|
+
});
|
|
351
|
+
}
|
|
352
|
+
};
|
|
353
|
+
|
|
354
|
+
var ExtendedLoadMore = function ExtendedLoadMore(_ref) {
|
|
355
|
+
var config = _ref.config,
|
|
356
|
+
componentName = _ref.componentName,
|
|
357
|
+
WithArrowConfig = _ref.WithArrowConfig,
|
|
358
|
+
withSubsequentLoad = _ref.withSubsequentLoad;
|
|
359
|
+
var showButton = lodash.get(config, ["showButton"], true);
|
|
360
|
+
var btnText = lodash.get(config, ["buttonText"], "Read More");
|
|
361
|
+
var theme = lodash.get(config, ["theme"], "");
|
|
362
|
+
var textColor = getTextColor(theme);
|
|
363
|
+
/* Open an array to maintain load-more initiated components to re-render */
|
|
364
|
+
|
|
365
|
+
var _useState = React.useState([]),
|
|
366
|
+
_useState2 = _slicedToArray__default["default"](_useState, 2),
|
|
367
|
+
components = _useState2[0],
|
|
368
|
+
setComponents = _useState2[1];
|
|
369
|
+
|
|
370
|
+
var addComponent = /*#__PURE__*/function () {
|
|
371
|
+
var _ref2 = _asyncToGenerator__default["default"]( /*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee(event) {
|
|
372
|
+
var collectionSlug, offset, limit, Component, _yield$yield$fetch$js, items, updatedOffset, updatedCompList;
|
|
373
|
+
|
|
374
|
+
return _regeneratorRuntime__default["default"].wrap(function _callee$(_context) {
|
|
375
|
+
while (1) {
|
|
376
|
+
switch (_context.prev = _context.next) {
|
|
377
|
+
case 0:
|
|
378
|
+
event.persist();
|
|
379
|
+
collectionSlug = event.target.parentElement.getAttribute("data-collection-slug");
|
|
380
|
+
offset = event.target.parentElement.getAttribute("data-collection-offset");
|
|
381
|
+
limit = event.target.parentElement.getAttribute("data-collection-limit");
|
|
382
|
+
Component = getTemplate(componentName);
|
|
383
|
+
_context.next = 7;
|
|
384
|
+
return fetch("/api/v1/collections/".concat(collectionSlug, "?item-type=story&offset=").concat(offset, "&limit=").concat(limit));
|
|
385
|
+
|
|
386
|
+
case 7:
|
|
387
|
+
_context.next = 9;
|
|
388
|
+
return _context.sent.json();
|
|
389
|
+
|
|
390
|
+
case 9:
|
|
391
|
+
_yield$yield$fetch$js = _context.sent;
|
|
392
|
+
items = _yield$yield$fetch$js.items;
|
|
393
|
+
|
|
394
|
+
if (items.length) {
|
|
395
|
+
updatedOffset = parseInt(offset) + parseInt(limit);
|
|
396
|
+
event.target.parentElement.setAttribute("data-collection-offset", updatedOffset);
|
|
397
|
+
}
|
|
398
|
+
|
|
399
|
+
updatedCompList = [].concat(_toConsumableArray__default["default"](components), [{
|
|
400
|
+
// Passing a number below the initial collection length (which we will not know here)
|
|
401
|
+
// as the second parameter causes the Load More button to be rendered regardless of
|
|
402
|
+
// the value given to `isLoadMoreVisible`. Since this paramter will be ignored anyway,
|
|
403
|
+
// we pass in a number that is sufficiently always larger.
|
|
404
|
+
Component: WithArrowConfig(withSubsequentLoad(Component, limit || 10, true)),
|
|
405
|
+
props: {
|
|
406
|
+
collection: {
|
|
407
|
+
items: items
|
|
408
|
+
},
|
|
409
|
+
isLoadMoreVisible: false,
|
|
410
|
+
config: config
|
|
411
|
+
},
|
|
412
|
+
componentName: componentName
|
|
413
|
+
}]);
|
|
414
|
+
setComponents(updatedCompList);
|
|
415
|
+
|
|
416
|
+
case 14:
|
|
417
|
+
case "end":
|
|
418
|
+
return _context.stop();
|
|
419
|
+
}
|
|
420
|
+
}
|
|
421
|
+
}, _callee);
|
|
422
|
+
}));
|
|
423
|
+
|
|
424
|
+
return function addComponent(_x) {
|
|
425
|
+
return _ref2.apply(this, arguments);
|
|
426
|
+
};
|
|
427
|
+
}();
|
|
428
|
+
|
|
429
|
+
if (!showButton) return null;
|
|
430
|
+
/* TODO: !HACK! Remove this line post deployment */
|
|
431
|
+
|
|
432
|
+
var componentStyles = function componentStyles(componentName) {
|
|
433
|
+
return componentName === "ArrowOneColStoryList" ? {
|
|
434
|
+
marginLeft: 0
|
|
435
|
+
} : {};
|
|
436
|
+
};
|
|
437
|
+
|
|
438
|
+
return /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, components.map(function (_ref3, index) {
|
|
439
|
+
var Component = _ref3.Component,
|
|
440
|
+
props = _ref3.props;
|
|
441
|
+
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
442
|
+
style: {
|
|
443
|
+
maxWidth: 1172,
|
|
444
|
+
margin: "auto"
|
|
445
|
+
},
|
|
446
|
+
key: "extendedLoadMoreBase-key-".concat(index)
|
|
447
|
+
}, /*#__PURE__*/React__default["default"].createElement(React.Suspense, {
|
|
448
|
+
fallback: /*#__PURE__*/React__default["default"].createElement("div", null, "Loading...")
|
|
449
|
+
}, /*#__PURE__*/React__default["default"].createElement(Component, props)));
|
|
450
|
+
}), /*#__PURE__*/React__default["default"].createElement("div", {
|
|
451
|
+
style: componentStyles(componentName),
|
|
452
|
+
onClick: addComponent,
|
|
453
|
+
className: "arr--button " + _getClassName__default["default"]("button ".concat(textColor, " default"), _styleModuleImportMap)
|
|
454
|
+
}, btnText));
|
|
455
|
+
};
|
|
456
|
+
ExtendedLoadMore.propTypes = {
|
|
457
|
+
componentName: PropTypes__default["default"].string,
|
|
458
|
+
config: PropTypes__default["default"].object,
|
|
459
|
+
WithArrowConfig: PropTypes__default["default"].func,
|
|
460
|
+
withSubsequentLoad: PropTypes__default["default"].func
|
|
461
|
+
};
|
|
462
|
+
|
|
463
|
+
exports.ExtendedLoadMore = ExtendedLoadMore;
|
|
464
|
+
exports.clientWidth = clientWidth;
|
|
465
|
+
exports.formatter = formatter;
|
|
466
|
+
exports.generateNavigateSlug = generateNavigateSlug;
|
|
467
|
+
exports.getSlot = getSlot;
|
|
468
|
+
exports.getSlug = getSlug;
|
|
469
|
+
exports.getStoryUrl = getStoryUrl;
|
|
470
|
+
exports.getTextColor = getTextColor;
|
|
471
|
+
exports.getTimeStamp = getTimeStamp;
|
|
472
|
+
exports.isEmpty = isEmpty;
|
|
473
|
+
exports.isExternalStory = isExternalStory;
|
|
474
|
+
exports.navigateTo = navigateTo;
|
|
475
|
+
exports.rgbToHex = rgbToHex;
|
|
476
|
+
exports.truncate = truncate;
|
|
@@ -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 index$2 = require('./index-0f809dd9.js');
|
|
5
|
+
var index$4 = require('./index-afd44863.js');
|
|
6
|
+
var index$3 = require('./index-8462c597.js');
|
|
7
|
+
var lodash = require('lodash');
|
|
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,
|
|
@@ -51,21 +66,21 @@ var FourColGridBase = function FourColGridBase(_ref2) {
|
|
|
51
66
|
navigate = _config$navigate === void 0 ? true : _config$navigate,
|
|
52
67
|
_config$subsequentLoa = config.subsequentLoadCount,
|
|
53
68
|
subsequentLoadCount = _config$subsequentLoa === void 0 ? 4 : _config$subsequentLoa;
|
|
54
|
-
var storyItems = collectionToStories(collection);
|
|
69
|
+
var storyItems = components.collectionToStories(collection);
|
|
55
70
|
if (!storyItems.length) return null;
|
|
56
71
|
var footerSlot = footerSlotConfig.footerSlot;
|
|
57
72
|
var footerSlotComp = footerSlot ? footerSlot() : null;
|
|
58
|
-
var textColor = getTextColor(theme);
|
|
59
|
-
var dispatch = useDispatch();
|
|
60
|
-
var qtConfig = useSelector(function (state) {
|
|
61
|
-
return
|
|
73
|
+
var textColor = index.getTextColor(theme);
|
|
74
|
+
var dispatch = reactRedux.useDispatch();
|
|
75
|
+
var qtConfig = reactRedux.useSelector(function (state) {
|
|
76
|
+
return lodash.get(state, ["qt", "config"], {});
|
|
62
77
|
});
|
|
63
78
|
|
|
64
79
|
var getLoadMore = function getLoadMore(opts) {
|
|
65
80
|
if (!isLoadMoreVisible) return null;
|
|
66
81
|
|
|
67
82
|
if (isolatedLoadMore) {
|
|
68
|
-
return /*#__PURE__*/
|
|
83
|
+
return /*#__PURE__*/React__default["default"].createElement(index$1.LoadMoreTarget, {
|
|
69
84
|
collection: collection,
|
|
70
85
|
componentName: "FourColGrid",
|
|
71
86
|
offset: storyItems.length,
|
|
@@ -73,8 +88,8 @@ var FourColGridBase = function FourColGridBase(_ref2) {
|
|
|
73
88
|
});
|
|
74
89
|
}
|
|
75
90
|
|
|
76
|
-
var url = generateNavigateSlug(collection, qtConfig);
|
|
77
|
-
return /*#__PURE__*/
|
|
91
|
+
var url = index.generateNavigateSlug(collection, qtConfig);
|
|
92
|
+
return /*#__PURE__*/React__default["default"].createElement(index$1.ProgressiveHydration, null, /*#__PURE__*/React__default["default"].createElement(index$1.LoadmoreButton, {
|
|
78
93
|
config: config,
|
|
79
94
|
collection: collection,
|
|
80
95
|
template: footerButton,
|
|
@@ -82,46 +97,46 @@ var FourColGridBase = function FourColGridBase(_ref2) {
|
|
|
82
97
|
return loadMore(opts);
|
|
83
98
|
},
|
|
84
99
|
navigate: function navigate() {
|
|
85
|
-
return navigateTo(dispatch, url);
|
|
100
|
+
return index.navigateTo(dispatch, url);
|
|
86
101
|
},
|
|
87
102
|
qtConfig: qtConfig
|
|
88
103
|
}));
|
|
89
104
|
};
|
|
90
105
|
|
|
91
|
-
return /*#__PURE__*/
|
|
106
|
+
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
92
107
|
className: "full-width-with-padding arrow-component",
|
|
93
108
|
"data-test-id": "four-col-grid",
|
|
94
109
|
style: {
|
|
95
110
|
backgroundColor: theme,
|
|
96
111
|
color: textColor
|
|
97
112
|
}
|
|
98
|
-
}, /*#__PURE__*/
|
|
113
|
+
}, /*#__PURE__*/React__default["default"].createElement("div", {
|
|
99
114
|
className: "four-col-m_four-col-grid__1EiO7"
|
|
100
|
-
}, /*#__PURE__*/
|
|
115
|
+
}, /*#__PURE__*/React__default["default"].createElement(index$1.CollectionName, {
|
|
101
116
|
collection: collection,
|
|
102
117
|
collectionNameTemplate: collectionNameTemplate,
|
|
103
118
|
collectionNameBorderColor: collectionNameBorderColor,
|
|
104
119
|
customCollectionName: customCollectionName,
|
|
105
120
|
navigate: navigate
|
|
106
|
-
}), /*#__PURE__*/
|
|
121
|
+
}), /*#__PURE__*/React__default["default"].createElement("div", {
|
|
107
122
|
className: "four-col-m_wrapper__1vOV7"
|
|
108
123
|
}, storyItems.map(function (story, index) {
|
|
109
|
-
return /*#__PURE__*/
|
|
110
|
-
key: "story-4col-".concat(index, "-").concat(
|
|
111
|
-
}, /*#__PURE__*/
|
|
124
|
+
return /*#__PURE__*/React__default["default"].createElement(React.Fragment, {
|
|
125
|
+
key: "story-4col-".concat(index, "-").concat(lodash.get(story, ["id"], "0"))
|
|
126
|
+
}, /*#__PURE__*/React__default["default"].createElement("div", {
|
|
112
127
|
className: "four-col-m_story-card-wrapper__1e8p0",
|
|
113
128
|
key: "default-".concat(index)
|
|
114
|
-
}, /*#__PURE__*/
|
|
129
|
+
}, /*#__PURE__*/React__default["default"].createElement(index$2.StoryCard, {
|
|
115
130
|
story: story,
|
|
116
131
|
border: border,
|
|
117
132
|
theme: theme,
|
|
118
133
|
isHorizontalMobile: true,
|
|
119
134
|
config: config
|
|
120
|
-
}, /*#__PURE__*/
|
|
135
|
+
}, /*#__PURE__*/React__default["default"].createElement(index$3.HeroImage, {
|
|
121
136
|
aspectRatio: [[16, 9]],
|
|
122
137
|
story: story,
|
|
123
138
|
isHorizontalMobile: true
|
|
124
|
-
}), /*#__PURE__*/
|
|
139
|
+
}), /*#__PURE__*/React__default["default"].createElement(index$4.StorycardContent, {
|
|
125
140
|
theme: theme,
|
|
126
141
|
border: border,
|
|
127
142
|
borderColor: borderColor,
|
|
@@ -138,29 +153,30 @@ var FourColGridBase = function FourColGridBase(_ref2) {
|
|
|
138
153
|
};
|
|
139
154
|
FourColGridBase.propTypes = {
|
|
140
155
|
/** collection is the array of objects which is returning by API */
|
|
141
|
-
collection:
|
|
156
|
+
collection: PropTypes__default["default"].object.isRequired,
|
|
142
157
|
|
|
143
158
|
/** The config for the Row */
|
|
144
|
-
config:
|
|
145
|
-
borderColor:
|
|
146
|
-
theme:
|
|
147
|
-
border:
|
|
148
|
-
slotConfig:
|
|
149
|
-
collectionNameTemplate:
|
|
150
|
-
footerButton:
|
|
151
|
-
collectionNameBorderColor:
|
|
152
|
-
subsequentLoadCount:
|
|
159
|
+
config: PropTypes__default["default"].shape({
|
|
160
|
+
borderColor: PropTypes__default["default"].string,
|
|
161
|
+
theme: PropTypes__default["default"].string,
|
|
162
|
+
border: PropTypes__default["default"].bool,
|
|
163
|
+
slotConfig: PropTypes__default["default"].array,
|
|
164
|
+
collectionNameTemplate: PropTypes__default["default"].string,
|
|
165
|
+
footerButton: PropTypes__default["default"].string,
|
|
166
|
+
collectionNameBorderColor: PropTypes__default["default"].string,
|
|
167
|
+
subsequentLoadCount: PropTypes__default["default"].number
|
|
153
168
|
}),
|
|
154
|
-
getMoreStories:
|
|
155
|
-
isLoadMoreVisible:
|
|
156
|
-
isLoading:
|
|
157
|
-
isolatedLoadMore:
|
|
169
|
+
getMoreStories: PropTypes__default["default"].func,
|
|
170
|
+
isLoadMoreVisible: PropTypes__default["default"].bool,
|
|
171
|
+
isLoading: PropTypes__default["default"].bool,
|
|
172
|
+
isolatedLoadMore: PropTypes__default["default"].bool
|
|
158
173
|
};
|
|
159
174
|
FourColGridBase.defaultProps = {
|
|
160
175
|
getMoreStories: function getMoreStories() {},
|
|
161
176
|
isLoadMoreVisible: true,
|
|
162
177
|
isLoading: false
|
|
163
178
|
};
|
|
164
|
-
var FourColGrid = StateProvider(FourColGridBase);
|
|
179
|
+
var FourColGrid = index$1.StateProvider(FourColGridBase);
|
|
165
180
|
|
|
166
|
-
|
|
181
|
+
exports.FourColGrid = FourColGrid;
|
|
182
|
+
exports.FourColGridBase = FourColGridBase;
|