@quintype/arrow 3.15.1-perf.4 → 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 -170
- package/atoms/Author/styles.arrow.css +0 -1
- package/atoms/AuthorWithTime/index.js +0 -514
- package/atoms/AuthorWithTime/styles.arrow.css +0 -1
- package/atoms/CollectionName/index.js +0 -255
- package/atoms/CollectionName/styles.arrow.css +0 -1
- package/atoms/ExtendedLoadMore/index-0f809dd9.js +0 -254
- package/atoms/ExtendedLoadMore/index-142f015c.js +0 -476
- package/atoms/ExtendedLoadMore/index-37a9ccff.js +0 -182
- package/atoms/ExtendedLoadMore/index-446679c8.js +0 -191
- package/atoms/ExtendedLoadMore/index-44f97338.js +0 -300
- package/atoms/ExtendedLoadMore/index-57dd4870.js +0 -239
- package/atoms/ExtendedLoadMore/index-66dd4dbd.js +0 -215
- package/atoms/ExtendedLoadMore/index-8462c597.js +0 -363
- package/atoms/ExtendedLoadMore/index-93cb06d1.js +0 -1016
- package/atoms/ExtendedLoadMore/index-afd44863.js +0 -95
- package/atoms/ExtendedLoadMore/index-b5754c5d.js +0 -195
- package/atoms/ExtendedLoadMore/index-bbaf526e.js +0 -256
- package/atoms/ExtendedLoadMore/index-cfb262ef.js +0 -192
- package/atoms/ExtendedLoadMore/index.js +0 -20
- package/atoms/ExtendedLoadMore/styles.arrow.css +0 -1
- package/atoms/Headline/index.js +0 -379
- package/atoms/Headline/styles.arrow.css +0 -1
- package/atoms/HeroImage/index.js +0 -336
- package/atoms/HeroImage/styles.arrow.css +0 -1
- package/atoms/LoadmoreButton/index.js +0 -175
- package/atoms/LoadmoreButton/styles.arrow.css +0 -1
- package/atoms/ScrollSnap/index.js +0 -379
- package/atoms/ScrollSnap/styles.arrow.css +0 -1
- package/atoms/SectionTag/index.js +0 -140
- package/atoms/SectionTag/styles.arrow.css +0 -1
- package/atoms/Subheadline/index.js +0 -120
- package/atoms/Subheadline/styles.arrow.css +0 -1
- package/atoms/TimeStamp/index.js +0 -221
- package/atoms/TimeStamp/styles.arrow.css +0 -1
- package/molecules/KeyEvents/index.js +0 -457
- package/molecules/KeyEvents/styles.arrow.css +0 -1
- package/molecules/PageIntroductionCard/index.js +0 -248
- package/molecules/PageIntroductionCard/styles.arrow.css +0 -1
- package/molecules/SocialShareTemplate/index.js +0 -506
- package/molecules/SocialShareTemplate/styles.arrow.css +0 -1
- package/molecules/StoryCard/index.js +0 -1430
- package/molecules/StoryCard/styles.arrow.css +0 -1
- package/molecules/StoryElementCard/index.js +0 -3091
- package/molecules/StoryElementCard/styles.arrow.css +0 -1
- package/molecules/StorycardContent/index.js +0 -976
- package/molecules/StorycardContent/styles.arrow.css +0 -1
- package/rows/AlternateCollectionFilter/index.js +0 -2189
- package/rows/AlternateCollectionFilter/styles.arrow.css +0 -1
- package/rows/AsideCollection/index.js +0 -2135
- package/rows/AsideCollection/styles.arrow.css +0 -1
- package/rows/AstrologyCollection/index.js +0 -2106
- package/rows/AstrologyCollection/styles.arrow.css +0 -1
- package/rows/AuthorIntroductionCard/index.js +0 -813
- package/rows/AuthorIntroductionCard/styles.arrow.css +0 -1
- package/rows/AuthorsList/index.js +0 -996
- package/rows/AuthorsList/styles.arrow.css +0 -1
- package/rows/CollectionFilter/index.js +0 -2279
- package/rows/CollectionFilter/styles.arrow.css +0 -1
- package/rows/ElevenStories/index.js +0 -2118
- package/rows/ElevenStories/styles.arrow.css +0 -1
- package/rows/FourColFiveStories/index.js +0 -1861
- package/rows/FourColFiveStories/styles.arrow.css +0 -1
- package/rows/FourColGrid/index.js +0 -2083
- package/rows/FourColGrid/styles.arrow.css +0 -1
- package/rows/FourColPortraitStories/index.js +0 -2116
- package/rows/FourColPortraitStories/styles.arrow.css +0 -1
- package/rows/FourColSixteenStories/index.js +0 -1849
- package/rows/FourColSixteenStories/styles.arrow.css +0 -1
- package/rows/FourColTwelveStories/index.js +0 -1822
- package/rows/FourColTwelveStories/styles.arrow.css +0 -1
- package/rows/FourStorySlider/index.js +0 -2223
- package/rows/FourStorySlider/styles.arrow.css +0 -1
- package/rows/FourStorySliderPortrait/index.js +0 -2226
- package/rows/FourStorySliderPortrait/styles.arrow.css +0 -1
- package/rows/FourTabbedBigStorySlider/index.js +0 -1985
- package/rows/FourTabbedBigStorySlider/styles.arrow.css +0 -1
- package/rows/FullScreenSlider/index.js +0 -2141
- package/rows/FullScreenSlider/styles.arrow.css +0 -1
- package/rows/HalfScreenSlider/index.js +0 -1994
- package/rows/HalfScreenSlider/styles.arrow.css +0 -1
- package/rows/ListComponent/index.js +0 -1942
- package/rows/ListComponent/styles.arrow.css +0 -1
- package/rows/Listicles/index.js +0 -945
- package/rows/Listicles/styles.arrow.css +0 -1
- package/rows/MagazineEditions/index.js +0 -690
- package/rows/MagazineEditions/styles.arrow.css +0 -1
- package/rows/MagazineHeaderCard/index.js +0 -684
- package/rows/MagazineHeaderCard/styles.arrow.css +0 -1
- package/rows/MagazineWidget/index.js +0 -1994
- package/rows/MagazineWidget/styles.arrow.css +0 -1
- package/rows/OneColStoryList/index.js +0 -2169
- package/rows/OneColStoryList/styles.arrow.css +0 -1
- package/rows/OpinionCollection/index.js +0 -1545
- package/rows/OpinionCollection/styles.arrow.css +0 -1
- package/rows/SixColSixStories/index.js +0 -2014
- package/rows/SixColSixStories/styles.arrow.css +0 -1
- package/rows/StoryCollection/index.js +0 -2135
- package/rows/StoryCollection/styles.arrow.css +0 -1
- package/rows/TagIntroductionCard/index.js +0 -103
- package/rows/TagIntroductionCard/styles.arrow.css +0 -1
- package/rows/ThreeColFlexStories/index.js +0 -2074
- package/rows/ThreeColFlexStories/styles.arrow.css +0 -1
- package/rows/ThreeColFourteenStories/index.js +0 -1770
- package/rows/ThreeColFourteenStories/styles.arrow.css +0 -1
- package/rows/ThreeColGrid/index.js +0 -2104
- package/rows/ThreeColGrid/styles.arrow.css +0 -1
- package/rows/ThreeColSevenStory/index.js +0 -1982
- package/rows/ThreeColSevenStory/styles.arrow.css +0 -1
- package/rows/ThreeColSixStories/index.js +0 -1965
- package/rows/ThreeColSixStories/styles.arrow.css +0 -1
- package/rows/ThreeColTwelveStories/index.js +0 -1854
- package/rows/ThreeColTwelveStories/styles.arrow.css +0 -1
- package/rows/TwoColFourStories/index.js +0 -1943
- package/rows/TwoColFourStories/styles.arrow.css +0 -1
- package/rows/TwoColFourStoryHighlight/index.js +0 -1930
- package/rows/TwoColFourStoryHighlight/styles.arrow.css +0 -1
- package/rows/TwoColSevenStories/index.js +0 -1970
- package/rows/TwoColSevenStories/styles.arrow.css +0 -1
- package/rows/TwoColSixStories/index.js +0 -1963
- package/rows/TwoColSixStories/styles.arrow.css +0 -1
- package/rows/TwoColTenStoriesSidebar/index.js +0 -2029
- package/rows/TwoColTenStoriesSidebar/styles.arrow.css +0 -1
- package/rows/TwoColThreeStories/index.js +0 -1916
- package/rows/TwoColThreeStories/styles.arrow.css +0 -1
- package/story-elements/AlsoRead/index.js +0 -320
- package/story-elements/AlsoRead/styles.arrow.css +0 -1
- package/story-elements/Attachment/index.js +0 -167
- package/story-elements/Attachment/styles.arrow.css +0 -1
- package/story-elements/BigFact/index.js +0 -137
- package/story-elements/BigFact/styles.arrow.css +0 -1
- package/story-elements/BlockQuote/index.js +0 -304
- package/story-elements/BlockQuote/styles.arrow.css +0 -1
- package/story-elements/Blurb/index.js +0 -189
- package/story-elements/Blurb/styles.arrow.css +0 -1
- package/story-elements/Image/index.js +0 -529
- package/story-elements/Image/styles.arrow.css +0 -1
- package/story-elements/ImageGallery/index.js +0 -462
- package/story-elements/ImageGallery/styles.arrow.css +0 -1
- package/story-elements/ImageSlideshow/index.js +0 -773
- package/story-elements/ImageSlideshow/styles.arrow.css +0 -1
- package/story-elements/QuestionAnswer/index.js +0 -267
- package/story-elements/QuestionAnswer/styles.arrow.css +0 -1
- package/story-elements/Quote/index.js +0 -166
- package/story-elements/Quote/styles.arrow.css +0 -1
- package/story-elements/Reference/index.js +0 -160
- package/story-elements/Reference/styles.arrow.css +0 -1
- package/story-elements/StoryElement/index.js +0 -75
- package/story-elements/Summary/index.js +0 -190
- package/story-elements/Summary/styles.arrow.css +0 -1
- package/story-elements/Text/index.js +0 -165
- package/story-elements/Text/styles.arrow.css +0 -1
- package/story-elements/Video/index.js +0 -81
- package/story-elements/Video/styles.arrow.css +0 -1
- package/story-templates/ListicleStoryTemplate/index.js +0 -5586
- package/story-templates/ListicleStoryTemplate/styles.arrow.css +0 -1
- package/story-templates/LiveBlogStoryTemplate/index.js +0 -5762
- package/story-templates/LiveBlogStoryTemplate/styles.arrow.css +0 -1
- package/story-templates/PhotoStoryTemplate/index.js +0 -5564
- package/story-templates/PhotoStoryTemplate/styles.arrow.css +0 -1
- package/story-templates/TextStoryTemplate/index.js +0 -5637
- package/story-templates/TextStoryTemplate/styles.arrow.css +0 -1
- package/story-templates/VideoStoryTemplate/index.js +0 -5496
- package/story-templates/VideoStoryTemplate/styles.arrow.css +0 -1
|
@@ -1,684 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
-
|
|
5
|
-
var _defineProperty = require('@babel/runtime/helpers/defineProperty');
|
|
6
|
-
var _getClassName = require('babel-plugin-react-css-modules/dist/browser/getClassName');
|
|
7
|
-
var React = require('react');
|
|
8
|
-
var PropTypes = require('prop-types');
|
|
9
|
-
var reactRedux = require('react-redux');
|
|
10
|
-
var components = require('@quintype/components');
|
|
11
|
-
var lodash = require('lodash');
|
|
12
|
-
require('@babel/runtime/helpers/asyncToGenerator');
|
|
13
|
-
require('@babel/runtime/helpers/typeof');
|
|
14
|
-
require('@babel/runtime/regenerator');
|
|
15
|
-
var Timeago = require('react-timeago');
|
|
16
|
-
var dateFnsTz = require('date-fns-tz');
|
|
17
|
-
|
|
18
|
-
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
19
|
-
|
|
20
|
-
var _defineProperty__default = /*#__PURE__*/_interopDefaultLegacy(_defineProperty);
|
|
21
|
-
var _getClassName__default = /*#__PURE__*/_interopDefaultLegacy(_getClassName);
|
|
22
|
-
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
23
|
-
var PropTypes__default = /*#__PURE__*/_interopDefaultLegacy(PropTypes);
|
|
24
|
-
var Timeago__default = /*#__PURE__*/_interopDefaultLegacy(Timeago);
|
|
25
|
-
|
|
26
|
-
var StateContext = /*#__PURE__*/React.createContext(); // eslint-disable-next-line react/display-name
|
|
27
|
-
|
|
28
|
-
var StateProvider = function StateProvider(RowComponent) {
|
|
29
|
-
return function (props) {
|
|
30
|
-
return (
|
|
31
|
-
/*#__PURE__*/
|
|
32
|
-
// eslint-disable-next-line react/prop-types
|
|
33
|
-
React__default["default"].createElement(StateContext.Provider, {
|
|
34
|
-
value: props.config
|
|
35
|
-
}, /*#__PURE__*/React__default["default"].createElement(RowComponent, props))
|
|
36
|
-
);
|
|
37
|
-
};
|
|
38
|
-
};
|
|
39
|
-
var useStateValue = function useStateValue() {
|
|
40
|
-
return React.useContext(StateContext);
|
|
41
|
-
};
|
|
42
|
-
|
|
43
|
-
var timestampToFormat = function timestampToFormat(value, unit, suffix, timestamp) {
|
|
44
|
-
var config = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : {};
|
|
45
|
-
var _config$showTime = config.showTime,
|
|
46
|
-
showTime = _config$showTime === void 0 ? false : _config$showTime,
|
|
47
|
-
_config$isTimeFirst = config.isTimeFirst,
|
|
48
|
-
isTimeFirst = _config$isTimeFirst === void 0 ? false : _config$isTimeFirst,
|
|
49
|
-
_config$isUpperCase = config.isUpperCase,
|
|
50
|
-
isUpperCase = _config$isUpperCase === void 0 ? false : _config$isUpperCase,
|
|
51
|
-
_config$disableMeridi = config.disableMeridiem,
|
|
52
|
-
disableMeridiem = _config$disableMeridi === void 0 ? false : _config$disableMeridi,
|
|
53
|
-
_config$timeFormat = config.timeFormat,
|
|
54
|
-
timeFormat = _config$timeFormat === void 0 ? "12hours" : _config$timeFormat;
|
|
55
|
-
var monthList = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"];
|
|
56
|
-
var dateTime = new Date(timestamp);
|
|
57
|
-
var date = dateTime.getDate().toString().padStart(2, 0);
|
|
58
|
-
var month = monthList[dateTime.getMonth()];
|
|
59
|
-
var localizedMonth = month;
|
|
60
|
-
|
|
61
|
-
if (isUpperCase) {
|
|
62
|
-
localizedMonth = lodash.upperCase(month);
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
var year = dateTime.getFullYear();
|
|
66
|
-
var localizedMeridiem = config.localizedMeridiem,
|
|
67
|
-
localizedMonths = config.localizedMonths,
|
|
68
|
-
_config$direction = config.direction,
|
|
69
|
-
direction = _config$direction === void 0 ? "ltr" : _config$direction;
|
|
70
|
-
var time = formatAMPM(timestamp, timeFormat);
|
|
71
|
-
var timeWithLocalizedMeridiem = time;
|
|
72
|
-
var timetoShow;
|
|
73
|
-
|
|
74
|
-
if (localizedMonths) {
|
|
75
|
-
localizedMonth = lodash.get(localizedMonths, [lodash.lowerCase(month)]) || month;
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
if (localizedMeridiem) {
|
|
79
|
-
var isAm = time.includes("am");
|
|
80
|
-
var _localizedMeridiem$am = localizedMeridiem.am,
|
|
81
|
-
am = _localizedMeridiem$am === void 0 ? "am" : _localizedMeridiem$am,
|
|
82
|
-
_localizedMeridiem$pm = localizedMeridiem.pm,
|
|
83
|
-
pm = _localizedMeridiem$pm === void 0 ? "pm" : _localizedMeridiem$pm;
|
|
84
|
-
timeWithLocalizedMeridiem = (isAm ? time.replace("am", am) : time.replace("pm", pm)) || time;
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
if (direction === "rtl") {
|
|
88
|
-
timetoShow = showTime ? "".concat(timeWithLocalizedMeridiem) : "";
|
|
89
|
-
return "".concat(date, " ").concat(localizedMonth, ", ").concat(year, " ").concat(timetoShow, " ");
|
|
90
|
-
} else {
|
|
91
|
-
if (disableMeridiem) {
|
|
92
|
-
return "".concat(localizedMonth, " ").concat(date, ", ").concat(year);
|
|
93
|
-
} else if (isTimeFirst) {
|
|
94
|
-
return "".concat(timeWithLocalizedMeridiem, ", ").concat(date, " ").concat(localizedMonth, " ").concat(year);
|
|
95
|
-
} else {
|
|
96
|
-
timetoShow = showTime ? ", ".concat(timeWithLocalizedMeridiem) : "";
|
|
97
|
-
return "".concat(date, " ").concat(localizedMonth, ", ").concat(year).concat(timetoShow);
|
|
98
|
-
}
|
|
99
|
-
}
|
|
100
|
-
};
|
|
101
|
-
|
|
102
|
-
function formatAMPM(timestamp) {
|
|
103
|
-
var timeFormat = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "12hours";
|
|
104
|
-
var dateTime = new Date(timestamp);
|
|
105
|
-
var hours = dateTime.getHours();
|
|
106
|
-
var minutes = dateTime.getMinutes();
|
|
107
|
-
var ampm = hours >= 12 ? "pm" : "am";
|
|
108
|
-
hours = hours % 12;
|
|
109
|
-
hours = hours || 12;
|
|
110
|
-
minutes = minutes < 10 ? "0" + minutes : minutes;
|
|
111
|
-
var strTime = hours + ":" + minutes + " " + ampm;
|
|
112
|
-
|
|
113
|
-
if (timeFormat === "24hours") {
|
|
114
|
-
return dateTime.toLocaleTimeString([], {
|
|
115
|
-
hour: "2-digit",
|
|
116
|
-
minute: "2-digit"
|
|
117
|
-
});
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
return strTime;
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
var hexToRGB = function hexToRGB(hex) {
|
|
124
|
-
var r = parseInt(hex.slice(1, 3), 16);
|
|
125
|
-
var g = parseInt(hex.slice(3, 5), 16);
|
|
126
|
-
var b = parseInt(hex.slice(5, 7), 16);
|
|
127
|
-
return {
|
|
128
|
-
r: r,
|
|
129
|
-
g: g,
|
|
130
|
-
b: b
|
|
131
|
-
};
|
|
132
|
-
};
|
|
133
|
-
var getLuminanceOfColor = function getLuminanceOfColor(hex) {
|
|
134
|
-
var _hexToRGB = hexToRGB(hex),
|
|
135
|
-
r = _hexToRGB.r,
|
|
136
|
-
g = _hexToRGB.g,
|
|
137
|
-
b = _hexToRGB.b;
|
|
138
|
-
|
|
139
|
-
return r * 0.299 + g * 0.587 + b * 0.114;
|
|
140
|
-
};
|
|
141
|
-
var rgbToHex = function rgbToHex() {
|
|
142
|
-
var color = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : "rgba(255, 255, 255, 0)";
|
|
143
|
-
var rgba = color.match(/^rgba?[\s+]?\([\s+]?(\d+)[\s+]?,[\s+]?(\d+)[\s+]?,[\s+]?(\d+)[\s+]?/i);
|
|
144
|
-
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;
|
|
145
|
-
};
|
|
146
|
-
var clientWidths = {
|
|
147
|
-
mobile: 767,
|
|
148
|
-
tablet: 1024
|
|
149
|
-
};
|
|
150
|
-
var clientWidth = function clientWidth(device) {
|
|
151
|
-
var foundDeviceWidth = lodash.get(clientWidths, device);
|
|
152
|
-
|
|
153
|
-
if (foundDeviceWidth) {
|
|
154
|
-
return lodash.get(global, "document.documentElement.clientWidth") <= foundDeviceWidth;
|
|
155
|
-
}
|
|
156
|
-
|
|
157
|
-
return false;
|
|
158
|
-
};
|
|
159
|
-
var getTextColor = function getTextColor() {
|
|
160
|
-
var theme = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : "rgb(255,255,255)";
|
|
161
|
-
var isRegexCheck = /^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/.test(theme);
|
|
162
|
-
var getHexValue = !isRegexCheck ? rgbToHex(theme) : theme;
|
|
163
|
-
var textColor = getLuminanceOfColor(getHexValue) < 155 ? "light" : "dark";
|
|
164
|
-
return textColor;
|
|
165
|
-
};
|
|
166
|
-
var getSlug = function getSlug(collection) {
|
|
167
|
-
var config = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
168
|
-
var _config$magazineSlug = config.magazineSlug,
|
|
169
|
-
magazineSlug = _config$magazineSlug === void 0 ? "" : _config$magazineSlug,
|
|
170
|
-
_config$isArchivePage = config.isArchivePage,
|
|
171
|
-
isArchivePage = _config$isArchivePage === void 0 ? false : _config$isArchivePage;
|
|
172
|
-
|
|
173
|
-
if (isArchivePage) {
|
|
174
|
-
return "/magazine/archive/".concat(magazineSlug);
|
|
175
|
-
}
|
|
176
|
-
|
|
177
|
-
if (magazineSlug) {
|
|
178
|
-
return "/magazine/".concat(magazineSlug, "/").concat(collection.slug);
|
|
179
|
-
}
|
|
180
|
-
|
|
181
|
-
var isSection = collection.template === "section";
|
|
182
|
-
|
|
183
|
-
if (isSection) {
|
|
184
|
-
var sectionId = lodash.get(collection, ["metadata", "section", "0", "id"], "");
|
|
185
|
-
var sections = config.sections;
|
|
186
|
-
var section = sections && sections.find(function (section) {
|
|
187
|
-
return section.id === sectionId;
|
|
188
|
-
});
|
|
189
|
-
return section ? section["section-url"] : "/";
|
|
190
|
-
}
|
|
191
|
-
|
|
192
|
-
return "/collection/".concat(collection.slug);
|
|
193
|
-
};
|
|
194
|
-
PropTypes__default["default"].shape({
|
|
195
|
-
"sketches-host": PropTypes__default["default"].string,
|
|
196
|
-
"cdn-name": PropTypes__default["default"].string,
|
|
197
|
-
"cdn-image": PropTypes__default["default"].string
|
|
198
|
-
});
|
|
199
|
-
PropTypes__default["default"].shape({
|
|
200
|
-
headline: PropTypes__default["default"].string,
|
|
201
|
-
"last-published-at": PropTypes__default["default"].number,
|
|
202
|
-
subheadline: PropTypes__default["default"].string
|
|
203
|
-
});
|
|
204
|
-
var navigateTo = function navigateTo(dispatch) {
|
|
205
|
-
var url = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "";
|
|
206
|
-
global.app.navigateToPage(dispatch, url);
|
|
207
|
-
};
|
|
208
|
-
var generateNavigateSlug = function generateNavigateSlug() {
|
|
209
|
-
var collection = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
210
|
-
var config = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
211
|
-
var customUrlPath = arguments.length > 2 ? arguments[2] : undefined;
|
|
212
|
-
|
|
213
|
-
if (customUrlPath) {
|
|
214
|
-
return customUrlPath;
|
|
215
|
-
}
|
|
216
|
-
|
|
217
|
-
var _config$magazineSlug2 = config.magazineSlug,
|
|
218
|
-
magazineSlug = _config$magazineSlug2 === void 0 ? "" : _config$magazineSlug2,
|
|
219
|
-
_config$isArchivePage2 = config.isArchivePage,
|
|
220
|
-
isArchivePage = _config$isArchivePage2 === void 0 ? false : _config$isArchivePage2;
|
|
221
|
-
|
|
222
|
-
if (isArchivePage) {
|
|
223
|
-
return "/magazine/archive/".concat(magazineSlug);
|
|
224
|
-
}
|
|
225
|
-
|
|
226
|
-
if (magazineSlug) {
|
|
227
|
-
return "/magazine/".concat(magazineSlug, "/").concat(collection.slug);
|
|
228
|
-
}
|
|
229
|
-
|
|
230
|
-
if (collection) {
|
|
231
|
-
return getSlug(collection, config);
|
|
232
|
-
}
|
|
233
|
-
|
|
234
|
-
return "/";
|
|
235
|
-
};
|
|
236
|
-
var getTimeStamp = function getTimeStamp(date, _formatter) {
|
|
237
|
-
var config = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
238
|
-
var template = arguments.length > 3 ? arguments[3] : undefined;
|
|
239
|
-
var timezone = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : null;
|
|
240
|
-
|
|
241
|
-
if (timezone && template === "story") {
|
|
242
|
-
var zonedTime = timezone && dateFnsTz.utcToZonedTime(date, timezone);
|
|
243
|
-
var formatZonedTime = zonedTime && dateFnsTz.format(zonedTime, "yyyy-MM-dd'T'HH:mm:ssXXX", {
|
|
244
|
-
timeZone: timezone
|
|
245
|
-
});
|
|
246
|
-
var timeStamp = timestampToFormat("", "", "", date, config);
|
|
247
|
-
return /*#__PURE__*/React__default["default"].createElement("time", {
|
|
248
|
-
dateTime: formatZonedTime
|
|
249
|
-
}, timeStamp);
|
|
250
|
-
}
|
|
251
|
-
|
|
252
|
-
return /*#__PURE__*/React__default["default"].createElement(Timeago__default["default"], {
|
|
253
|
-
date: date,
|
|
254
|
-
formatter: function formatter(value, unit, suffix, date) {
|
|
255
|
-
return _formatter(value, unit, suffix, date, config);
|
|
256
|
-
}
|
|
257
|
-
});
|
|
258
|
-
};
|
|
259
|
-
|
|
260
|
-
var _styleModuleImportMap$2 = {
|
|
261
|
-
"./collection-name.m.css": {
|
|
262
|
-
"collection": "collection-name-m_collection__JD6sx",
|
|
263
|
-
"collection-borderLeft": "collection-name-m_collection-borderLeft__3Dznk",
|
|
264
|
-
"border-left": "collection-name-m_border-left__3_pYw",
|
|
265
|
-
"collection-borderBottomFull": "collection-name-m_collection-borderBottomFull__Dkq3K",
|
|
266
|
-
"collection-borderBottom": "collection-name-m_collection-borderBottom__2rdQM",
|
|
267
|
-
"collection-crossLine": "collection-name-m_collection-crossLine__1sIpN",
|
|
268
|
-
"border-bottom": "collection-name-m_border-bottom__1MnlV",
|
|
269
|
-
"dark": "collection-name-m_dark__nMe5H",
|
|
270
|
-
"light": "collection-name-m_light__1vFDN"
|
|
271
|
-
}
|
|
272
|
-
};
|
|
273
|
-
var CollectionNameBase = function CollectionNameBase(_ref) {
|
|
274
|
-
var _ref$collectionNameBo = _ref.collectionNameBorderColor,
|
|
275
|
-
collectionNameBorderColor = _ref$collectionNameBo === void 0 ? "" : _ref$collectionNameBo,
|
|
276
|
-
collection = _ref.collection,
|
|
277
|
-
config = _ref.config,
|
|
278
|
-
collectionNameTemplate = _ref.collectionNameTemplate,
|
|
279
|
-
headerLevel = _ref.headerLevel,
|
|
280
|
-
_ref$customCollection = _ref.customCollectionName,
|
|
281
|
-
customCollectionName = _ref$customCollection === void 0 ? "" : _ref$customCollection,
|
|
282
|
-
_ref$navigate = _ref.navigate,
|
|
283
|
-
navigate = _ref$navigate === void 0 ? true : _ref$navigate;
|
|
284
|
-
var collectionTitle = useStateValue() || {};
|
|
285
|
-
var showRowTitle = lodash.get(collectionTitle, ["showRowTitle"], true);
|
|
286
|
-
var supportedTemplates = ["borderLeft", "borderBottom", "crossLine", "borderBottomFull"];
|
|
287
|
-
var templateStyle = supportedTemplates.includes(collectionNameTemplate) ? " collection-".concat(collectionNameTemplate) : "";
|
|
288
|
-
var slug = navigate && collection && getSlug(collection, config) || "";
|
|
289
|
-
var collectionName = customCollectionName || collection.name || "";
|
|
290
|
-
var textColor = getTextColor(collectionTitle.theme);
|
|
291
|
-
var HeaderTag = "h" + headerLevel;
|
|
292
|
-
var CollectionNameBorderColor = rgbToHex(collectionNameBorderColor);
|
|
293
|
-
var borderBottomFullStyle = templateStyle.includes("collection-borderBottomFull") ? "4px solid ".concat(CollectionNameBorderColor) : "";
|
|
294
|
-
|
|
295
|
-
var borderBottomStyle = function borderBottomStyle() {
|
|
296
|
-
return templateStyle.includes("collection-borderBottom") && !templateStyle.includes("collection-borderBottomFull") ? /*#__PURE__*/React__default["default"].createElement("div", {
|
|
297
|
-
className: "collection-name-m_border-bottom__1MnlV",
|
|
298
|
-
style: {
|
|
299
|
-
borderBottom: "4px solid ".concat(CollectionNameBorderColor)
|
|
300
|
-
}
|
|
301
|
-
}) : "";
|
|
302
|
-
};
|
|
303
|
-
|
|
304
|
-
var isMobile = clientWidth("mobile");
|
|
305
|
-
|
|
306
|
-
var getBorderHeight = function getBorderHeight() {
|
|
307
|
-
if (isMobile) {
|
|
308
|
-
switch (headerLevel) {
|
|
309
|
-
case "1":
|
|
310
|
-
return "32px";
|
|
311
|
-
|
|
312
|
-
case "2":
|
|
313
|
-
return "24px";
|
|
314
|
-
|
|
315
|
-
case "3":
|
|
316
|
-
return "20px";
|
|
317
|
-
|
|
318
|
-
case "4":
|
|
319
|
-
return "18px";
|
|
320
|
-
|
|
321
|
-
case "5":
|
|
322
|
-
return "16px";
|
|
323
|
-
|
|
324
|
-
case "6":
|
|
325
|
-
return "16px";
|
|
326
|
-
|
|
327
|
-
default:
|
|
328
|
-
return "20px";
|
|
329
|
-
}
|
|
330
|
-
}
|
|
331
|
-
|
|
332
|
-
switch (headerLevel) {
|
|
333
|
-
case "1":
|
|
334
|
-
return "40px";
|
|
335
|
-
|
|
336
|
-
case "2":
|
|
337
|
-
return "32px";
|
|
338
|
-
|
|
339
|
-
case "3":
|
|
340
|
-
return "24px";
|
|
341
|
-
|
|
342
|
-
case "4":
|
|
343
|
-
return "20px";
|
|
344
|
-
|
|
345
|
-
case "5":
|
|
346
|
-
return "18px";
|
|
347
|
-
|
|
348
|
-
case "6":
|
|
349
|
-
return "16px";
|
|
350
|
-
|
|
351
|
-
default:
|
|
352
|
-
return "24px";
|
|
353
|
-
}
|
|
354
|
-
};
|
|
355
|
-
|
|
356
|
-
return /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, showRowTitle && collectionName && /*#__PURE__*/React__default["default"].createElement("div", {
|
|
357
|
-
style: {
|
|
358
|
-
borderBottom: borderBottomFullStyle
|
|
359
|
-
},
|
|
360
|
-
"data-test-id": "collection-name",
|
|
361
|
-
className: ("arr--collection-name arrow-component ".concat(templateStyle) ? "arr--collection-name arrow-component ".concat(templateStyle) + " " : "") + _getClassName__default["default"]("collection ".concat(textColor, " ").concat(templateStyle), _styleModuleImportMap$2)
|
|
362
|
-
}, templateStyle.includes("collection-borderLeft") && /*#__PURE__*/React__default["default"].createElement("span", {
|
|
363
|
-
className: "arr-collection-name-border-left collection-name-m_border-left__3_pYw",
|
|
364
|
-
style: {
|
|
365
|
-
color: CollectionNameBorderColor,
|
|
366
|
-
fontSize: getBorderHeight()
|
|
367
|
-
}
|
|
368
|
-
}), slug && !slug.includes(undefined) ? /*#__PURE__*/React__default["default"].createElement(components.Link, {
|
|
369
|
-
href: slug,
|
|
370
|
-
"aria-label": "collection-name"
|
|
371
|
-
}, /*#__PURE__*/React__default["default"].createElement(HeaderTag, null, collectionName)) : /*#__PURE__*/React__default["default"].createElement(HeaderTag, null, collectionName), borderBottomStyle()));
|
|
372
|
-
};
|
|
373
|
-
CollectionNameBase.propTypes = {
|
|
374
|
-
/** Collection name border color */
|
|
375
|
-
collectionNameBorderColor: PropTypes.PropTypes.string,
|
|
376
|
-
|
|
377
|
-
/** The Collection Object from the API response */
|
|
378
|
-
collection: PropTypes.PropTypes.object,
|
|
379
|
-
|
|
380
|
-
/** The publisher config from the API response */
|
|
381
|
-
config: PropTypes.PropTypes.object,
|
|
382
|
-
|
|
383
|
-
/** The style template for the component */
|
|
384
|
-
collectionNameTemplate: PropTypes.PropTypes.oneOf(["", "borderLeft", "borderBottom", "crossLine", "borderBottomFull"]),
|
|
385
|
-
|
|
386
|
-
/** Header tags ranging h1-h6, where h[headerLevel] */
|
|
387
|
-
headerLevel: PropTypes.PropTypes.string,
|
|
388
|
-
customCollectionName: PropTypes.PropTypes.string,
|
|
389
|
-
navigate: PropTypes.PropTypes.bool
|
|
390
|
-
};
|
|
391
|
-
CollectionNameBase.defaultProps = {
|
|
392
|
-
collectionNameTemplate: "",
|
|
393
|
-
headerLevel: "3"
|
|
394
|
-
};
|
|
395
|
-
|
|
396
|
-
function mapStateToProps(state) {
|
|
397
|
-
return {
|
|
398
|
-
config: lodash.get(state, ["qt", "config"], {})
|
|
399
|
-
};
|
|
400
|
-
}
|
|
401
|
-
|
|
402
|
-
var CollectionName = reactRedux.connect(mapStateToProps)(CollectionNameBase);
|
|
403
|
-
|
|
404
|
-
var _styleModuleImportMap$1 = {
|
|
405
|
-
"./load-more.m.css": {
|
|
406
|
-
"button": "load-more-m_button__1mmf1",
|
|
407
|
-
"default": "load-more-m_default__2_k4V",
|
|
408
|
-
"dark": "load-more-m_dark__3dfzb",
|
|
409
|
-
"light": "load-more-m_light__ePZQI"
|
|
410
|
-
}
|
|
411
|
-
};
|
|
412
|
-
|
|
413
|
-
function ownKeys$1(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; }
|
|
414
|
-
|
|
415
|
-
function _objectSpread$1(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$1(Object(source), !0).forEach(function (key) { _defineProperty__default["default"](target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$1(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
416
|
-
var LoadmoreButton = function LoadmoreButton(_ref) {
|
|
417
|
-
var _ref$config = _ref.config,
|
|
418
|
-
config = _ref$config === void 0 ? {} : _ref$config,
|
|
419
|
-
collection = _ref.collection,
|
|
420
|
-
_ref$template = _ref.template,
|
|
421
|
-
template = _ref$template === void 0 ? "SubsequentLoadCount" : _ref$template,
|
|
422
|
-
onClick = _ref.onClick,
|
|
423
|
-
navigate = _ref.navigate,
|
|
424
|
-
qtConfig = _ref.qtConfig;
|
|
425
|
-
var _config$showButton = config.showButton,
|
|
426
|
-
showButton = _config$showButton === void 0 ? true : _config$showButton,
|
|
427
|
-
_config$buttonText = config.buttonText,
|
|
428
|
-
buttonText = _config$buttonText === void 0 ? "Read More" : _config$buttonText,
|
|
429
|
-
_config$theme = config.theme,
|
|
430
|
-
theme = _config$theme === void 0 ? "" : _config$theme,
|
|
431
|
-
_config$customUrlPath = config.customUrlPath,
|
|
432
|
-
customUrlPath = _config$customUrlPath === void 0 ? "" : _config$customUrlPath;
|
|
433
|
-
if (!showButton) return null;
|
|
434
|
-
var textColor = getTextColor(theme);
|
|
435
|
-
var slug = customUrlPath ? "/".concat(customUrlPath) : generateNavigateSlug(collection, _objectSpread$1(_objectSpread$1({}, qtConfig), config));
|
|
436
|
-
return template === "SubsequentLoadCount" ? /*#__PURE__*/React__default["default"].createElement("div", {
|
|
437
|
-
onClick: onClick,
|
|
438
|
-
"data-test-id": "load-more",
|
|
439
|
-
className: "arr--button " + _getClassName__default["default"]("button ".concat(textColor, " default"), _styleModuleImportMap$1)
|
|
440
|
-
}, buttonText) : /*#__PURE__*/React__default["default"].createElement(components.LinkBase, {
|
|
441
|
-
href: slug,
|
|
442
|
-
navigateTo: navigate,
|
|
443
|
-
"data-test-id": "load-more",
|
|
444
|
-
"aria-label": "load-more"
|
|
445
|
-
}, /*#__PURE__*/React__default["default"].createElement("div", {
|
|
446
|
-
className: "arr--button " + _getClassName__default["default"]("button ".concat(textColor, " default"), _styleModuleImportMap$1)
|
|
447
|
-
}, buttonText));
|
|
448
|
-
};
|
|
449
|
-
LoadmoreButton.propTypes = {
|
|
450
|
-
collection: PropTypes__default["default"].object,
|
|
451
|
-
template: PropTypes__default["default"].string,
|
|
452
|
-
config: PropTypes__default["default"].object,
|
|
453
|
-
onClick: PropTypes__default["default"].func,
|
|
454
|
-
navigate: PropTypes__default["default"].func,
|
|
455
|
-
qtConfig: PropTypes__default["default"].object
|
|
456
|
-
};
|
|
457
|
-
|
|
458
|
-
var ImageFallbackIcon = function ImageFallbackIcon(_ref) {
|
|
459
|
-
var _ref$width = _ref.width,
|
|
460
|
-
width = _ref$width === void 0 ? 40 : _ref$width,
|
|
461
|
-
_ref$height = _ref.height,
|
|
462
|
-
height = _ref$height === void 0 ? 30 : _ref$height,
|
|
463
|
-
_ref$iconColor = _ref.iconColor,
|
|
464
|
-
iconColor = _ref$iconColor === void 0 ? "#99B0CB" : _ref$iconColor;
|
|
465
|
-
return /*#__PURE__*/React__default["default"].createElement("svg", {
|
|
466
|
-
width: width,
|
|
467
|
-
height: height,
|
|
468
|
-
viewBox: "0 0 102 76",
|
|
469
|
-
version: "1.1"
|
|
470
|
-
}, /*#__PURE__*/React__default["default"].createElement("g", {
|
|
471
|
-
id: "demo-home-copy",
|
|
472
|
-
stroke: "none",
|
|
473
|
-
strokeWidth: "1",
|
|
474
|
-
fill: "none",
|
|
475
|
-
fillRule: "evenodd",
|
|
476
|
-
transform: "translate(-377.000000, -314.000000)"
|
|
477
|
-
}, /*#__PURE__*/React__default["default"].createElement("g", {
|
|
478
|
-
id: "Group-13",
|
|
479
|
-
transform: "translate(377.000000, 314.000000)"
|
|
480
|
-
}, /*#__PURE__*/React__default["default"].createElement("path", {
|
|
481
|
-
d: "M43.2,49.7 L62.2,19.2 L87.2,59.4 L17,59.4 L32.8,39.4 L43.2,49.7 Z M29.9,28.6 C25.8683213,28.6 22.6,25.3316787 22.6,21.3 C22.6,17.2683213 25.8683213,14 29.9,14 C33.9316787,14 37.2,17.2683213 37.2,21.3 C37.2,25.3316787 33.9316787,28.6 29.9,28.6 Z",
|
|
482
|
-
id: "Combined-Shape",
|
|
483
|
-
fill: iconColor,
|
|
484
|
-
fillRule: "nonzero"
|
|
485
|
-
}), /*#__PURE__*/React__default["default"].createElement("rect", {
|
|
486
|
-
id: "Rectangle-19",
|
|
487
|
-
stroke: iconColor,
|
|
488
|
-
strokeWidth: "3",
|
|
489
|
-
x: "1.5",
|
|
490
|
-
y: "1.5",
|
|
491
|
-
width: "99",
|
|
492
|
-
height: "73",
|
|
493
|
-
rx: "3"
|
|
494
|
-
}))));
|
|
495
|
-
};
|
|
496
|
-
ImageFallbackIcon.propTypes = {
|
|
497
|
-
width: PropTypes__default["default"].object,
|
|
498
|
-
height: PropTypes__default["default"].object,
|
|
499
|
-
iconColor: PropTypes__default["default"].object
|
|
500
|
-
};
|
|
501
|
-
|
|
502
|
-
var imageFallback = function imageFallback() {
|
|
503
|
-
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
504
|
-
className: "arr--fallback-image fallback-m_image__1GYCJ fallback-m_image-position__3KddP"
|
|
505
|
-
}, /*#__PURE__*/React__default["default"].createElement("figure", {
|
|
506
|
-
className: "arr--fallback-svg fallback-m_fallback-svg__tK9fL"
|
|
507
|
-
}, /*#__PURE__*/React__default["default"].createElement(ImageFallbackIcon, null)));
|
|
508
|
-
};
|
|
509
|
-
|
|
510
|
-
var FallbackImage = function FallbackImage(_ref) {
|
|
511
|
-
var slug = _ref.slug;
|
|
512
|
-
|
|
513
|
-
if (slug) {
|
|
514
|
-
return /*#__PURE__*/React__default["default"].createElement(components.Link, {
|
|
515
|
-
href: slug,
|
|
516
|
-
"aria-label": "image-fallback"
|
|
517
|
-
}, imageFallback());
|
|
518
|
-
} else {
|
|
519
|
-
return imageFallback();
|
|
520
|
-
}
|
|
521
|
-
};
|
|
522
|
-
FallbackImage.propTypes = {
|
|
523
|
-
slug: PropTypes__default["default"].string
|
|
524
|
-
};
|
|
525
|
-
|
|
526
|
-
var MagazineCoverImageCard = function MagazineCoverImageCard(_ref) {
|
|
527
|
-
var collection = _ref.collection,
|
|
528
|
-
_ref$config = _ref.config,
|
|
529
|
-
config = _ref$config === void 0 ? {} : _ref$config;
|
|
530
|
-
var imgAltText = lodash.get(collection, ["metadata", "magazine", "name"], "cover-image");
|
|
531
|
-
var coverImageData = lodash.get(collection, ["metadata", "cover-image"]) || {};
|
|
532
|
-
var _config$magazineSlug = config.magazineSlug,
|
|
533
|
-
magazineSlug = _config$magazineSlug === void 0 ? "" : _config$magazineSlug;
|
|
534
|
-
var coverUrl = coverImageData["cover-image-url"],
|
|
535
|
-
covers3Key = coverImageData["cover-image-s3-key"],
|
|
536
|
-
coverImageMetaData = coverImageData["cover-image-metadata"];
|
|
537
|
-
var slug = magazineSlug && collection && getSlug(collection, config);
|
|
538
|
-
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
539
|
-
className: "arr--magazine-cover-img magazine-cover-image-m_cover-image__1McI_"
|
|
540
|
-
}, covers3Key || coverUrl ? /*#__PURE__*/React__default["default"].createElement("figure", {
|
|
541
|
-
className: "magazine-cover-image-m_image__3-ZtB"
|
|
542
|
-
}, covers3Key ? /*#__PURE__*/React__default["default"].createElement(components.Link, {
|
|
543
|
-
href: slug,
|
|
544
|
-
"aria-label": "magazine-cover-image"
|
|
545
|
-
}, /*#__PURE__*/React__default["default"].createElement(components.LazyLoadImages, null, /*#__PURE__*/React__default["default"].createElement(components.ResponsiveImage, {
|
|
546
|
-
slug: covers3Key,
|
|
547
|
-
aspectRatio: [1, 2],
|
|
548
|
-
metadata: {
|
|
549
|
-
coverImageMetaData: coverImageMetaData
|
|
550
|
-
},
|
|
551
|
-
defaultWidth: 400,
|
|
552
|
-
imgParams: {
|
|
553
|
-
auto: ["format", "compress"]
|
|
554
|
-
},
|
|
555
|
-
alt: imgAltText
|
|
556
|
-
}))) : /*#__PURE__*/React__default["default"].createElement("img", {
|
|
557
|
-
src: coverUrl,
|
|
558
|
-
alt: "cover-image",
|
|
559
|
-
loading: "lazy"
|
|
560
|
-
})) : /*#__PURE__*/React__default["default"].createElement("div", {
|
|
561
|
-
className: "magazine-cover-image-m_fallback-img__cyAjK"
|
|
562
|
-
}, /*#__PURE__*/React__default["default"].createElement(FallbackImage, {
|
|
563
|
-
slug: slug
|
|
564
|
-
})));
|
|
565
|
-
};
|
|
566
|
-
MagazineCoverImageCard.propTypes = {
|
|
567
|
-
collection: PropTypes__default["default"].shape({
|
|
568
|
-
"cover-image-url": PropTypes__default["default"].string,
|
|
569
|
-
"cover-image-s3-key": PropTypes__default["default"].string,
|
|
570
|
-
"cover-image-metadata": PropTypes__default["default"].string,
|
|
571
|
-
slug: PropTypes__default["default"].string
|
|
572
|
-
}),
|
|
573
|
-
config: PropTypes__default["default"].shape({
|
|
574
|
-
magazineSlug: PropTypes__default["default"].string
|
|
575
|
-
})
|
|
576
|
-
};
|
|
577
|
-
|
|
578
|
-
var _styleModuleImportMap = {
|
|
579
|
-
"./magazine-cards.m.css": {
|
|
580
|
-
"viewports": "\"../../../../assets/stylesheets/viewports.m.css\"",
|
|
581
|
-
"mobile": "768px",
|
|
582
|
-
"tablet": "992px",
|
|
583
|
-
"magazine-header": "magazine-cards-m_magazine-header__2pSI3",
|
|
584
|
-
"content": "magazine-cards-m_content__16_KC",
|
|
585
|
-
"time": "magazine-cards-m_time__3DIrk",
|
|
586
|
-
"story-cards": "magazine-cards-m_story-cards__1mNHC",
|
|
587
|
-
"widget": "magazine-cards-m_widget__2aE9g",
|
|
588
|
-
"intro-button": "magazine-cards-m_intro-button__3J5c6",
|
|
589
|
-
"widget-button": "magazine-cards-m_widget-button__3P7F7",
|
|
590
|
-
"summary": "magazine-cards-m_summary__2jUgG",
|
|
591
|
-
"dark": "magazine-cards-m_dark__3CSmK",
|
|
592
|
-
"light": "magazine-cards-m_light__33r9r"
|
|
593
|
-
}
|
|
594
|
-
};
|
|
595
|
-
|
|
596
|
-
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; }
|
|
597
|
-
|
|
598
|
-
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; }
|
|
599
|
-
var MagazineHeaderCardBase = function MagazineHeaderCardBase(_ref) {
|
|
600
|
-
var _ref$collection = _ref.collection,
|
|
601
|
-
collection = _ref$collection === void 0 ? {} : _ref$collection,
|
|
602
|
-
_ref$config = _ref.config,
|
|
603
|
-
config = _ref$config === void 0 ? {} : _ref$config;
|
|
604
|
-
var createdAt = collection["created-at"],
|
|
605
|
-
issueDate = collection["collection-date"],
|
|
606
|
-
summary = collection.summary;
|
|
607
|
-
var _config$theme = config.theme,
|
|
608
|
-
theme = _config$theme === void 0 ? "" : _config$theme,
|
|
609
|
-
_config$customUrlPath = config.customUrlPath,
|
|
610
|
-
customUrlPath = _config$customUrlPath === void 0 ? "" : _config$customUrlPath,
|
|
611
|
-
_config$magazineTitle = config.magazineTitle,
|
|
612
|
-
magazineTitle = _config$magazineTitle === void 0 ? "" : _config$magazineTitle,
|
|
613
|
-
_config$magazinePageU = config.magazinePageUrl,
|
|
614
|
-
magazinePageUrl = _config$magazinePageU === void 0 ? "" : _config$magazinePageU,
|
|
615
|
-
_config$magazineSlug = config.magazineSlug,
|
|
616
|
-
magazineSlug = _config$magazineSlug === void 0 ? "" : _config$magazineSlug;
|
|
617
|
-
var textColor = getTextColor(theme);
|
|
618
|
-
var dispatch = reactRedux.useDispatch();
|
|
619
|
-
var qtConfig = reactRedux.useSelector(function (state) {
|
|
620
|
-
return lodash.get(state, ["qt", "config"], {});
|
|
621
|
-
});
|
|
622
|
-
var url = generateNavigateSlug(collection, qtConfig, customUrlPath);
|
|
623
|
-
var date = issueDate || createdAt;
|
|
624
|
-
var timeStampConfig = {
|
|
625
|
-
isUpperCase: true,
|
|
626
|
-
disableMeridiem: true
|
|
627
|
-
};
|
|
628
|
-
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
629
|
-
className: "full-width-with-padding arrow-component",
|
|
630
|
-
style: {
|
|
631
|
-
backgroundColor: theme
|
|
632
|
-
},
|
|
633
|
-
"data-test-id": "magazine-header-card"
|
|
634
|
-
}, /*#__PURE__*/React__default["default"].createElement("div", {
|
|
635
|
-
className: "arr-magazine-card magazine-cards-m_magazine-header__2pSI3 magazine-cards-m_intro-button__3J5c6"
|
|
636
|
-
}, /*#__PURE__*/React__default["default"].createElement(MagazineCoverImageCard, {
|
|
637
|
-
collection: collection,
|
|
638
|
-
config: _objectSpread(_objectSpread({}, config), {}, {
|
|
639
|
-
magazineSlug: magazineSlug
|
|
640
|
-
})
|
|
641
|
-
}), /*#__PURE__*/React__default["default"].createElement("div", {
|
|
642
|
-
className: "magazine-cards-m_content__16_KC"
|
|
643
|
-
}, /*#__PURE__*/React__default["default"].createElement("div", {
|
|
644
|
-
"data-test-id": "title-time",
|
|
645
|
-
className: _getClassName__default["default"]("time ".concat(textColor), _styleModuleImportMap)
|
|
646
|
-
}, /*#__PURE__*/React__default["default"].createElement("a", {
|
|
647
|
-
href: magazinePageUrl,
|
|
648
|
-
"data-test-id": "magazine-title",
|
|
649
|
-
"aria-label": "magazine-title"
|
|
650
|
-
}, lodash.upperCase(magazineTitle)), "\xA0 | \xA0", getTimeStamp(date, timestampToFormat, timeStampConfig)), /*#__PURE__*/React__default["default"].createElement(CollectionName, {
|
|
651
|
-
collection: collection,
|
|
652
|
-
headerLevel: "2",
|
|
653
|
-
navigate: false
|
|
654
|
-
}), /*#__PURE__*/React__default["default"].createElement("div", {
|
|
655
|
-
"data-test-id": "magazine-summary",
|
|
656
|
-
className: _getClassName__default["default"]("summary ".concat(textColor), _styleModuleImportMap)
|
|
657
|
-
}, summary), /*#__PURE__*/React__default["default"].createElement(LoadmoreButton, {
|
|
658
|
-
collection: collection,
|
|
659
|
-
template: "customUrlPath",
|
|
660
|
-
config: config,
|
|
661
|
-
navigate: function navigate() {
|
|
662
|
-
return navigateTo(dispatch, url);
|
|
663
|
-
},
|
|
664
|
-
qtConfig: qtConfig
|
|
665
|
-
}))));
|
|
666
|
-
};
|
|
667
|
-
MagazineHeaderCardBase.propTypes = {
|
|
668
|
-
collection: PropTypes__default["default"].shape({
|
|
669
|
-
"created-at": PropTypes__default["default"].number,
|
|
670
|
-
summary: PropTypes__default["default"].string,
|
|
671
|
-
items: PropTypes__default["default"].array
|
|
672
|
-
}),
|
|
673
|
-
config: PropTypes__default["default"].shape({
|
|
674
|
-
theme: PropTypes__default["default"].string,
|
|
675
|
-
footerButton: PropTypes__default["default"].string,
|
|
676
|
-
magazineTitle: PropTypes__default["default"].string,
|
|
677
|
-
magazinePageUrl: PropTypes__default["default"].string,
|
|
678
|
-
customUrlPath: PropTypes__default["default"].string
|
|
679
|
-
})
|
|
680
|
-
};
|
|
681
|
-
var MagazineHeaderCard = StateProvider(MagazineHeaderCardBase);
|
|
682
|
-
|
|
683
|
-
exports.MagazineHeaderCard = MagazineHeaderCard;
|
|
684
|
-
exports.MagazineHeaderCardBase = MagazineHeaderCardBase;
|