@quintype/arrow 3.15.1-fallback-support.1 → 3.15.1-perf.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/atoms/Author/index.js +2250 -0
- package/{Author → atoms/Author}/styles.arrow.css +0 -0
- package/atoms/AuthorWithTime/index.js +2954 -0
- package/{AuthorWithTime → atoms/AuthorWithTime}/styles.arrow.css +0 -0
- package/atoms/CollectionName/index.js +2334 -0
- package/{CollectionName → atoms/CollectionName}/styles.arrow.css +0 -0
- package/atoms/ExtendedLoadMore/index-2d713010.js +166 -0
- package/atoms/ExtendedLoadMore/index-4191a84c.js +240 -0
- package/atoms/ExtendedLoadMore/index-5a7900ba.js +181 -0
- package/atoms/ExtendedLoadMore/index-6cb56d1a.js +350 -0
- package/atoms/ExtendedLoadMore/index-6daa674c.js +282 -0
- package/atoms/ExtendedLoadMore/index-6f8c780e.js +243 -0
- package/atoms/ExtendedLoadMore/index-7eb05b3d.js +199 -0
- package/atoms/ExtendedLoadMore/index-8345922c.js +175 -0
- package/atoms/ExtendedLoadMore/index-99af722e.js +175 -0
- package/atoms/ExtendedLoadMore/index-aa8b8ab8.js +990 -0
- package/atoms/ExtendedLoadMore/index-c8f346d0.js +223 -0
- package/atoms/ExtendedLoadMore/index-e39b3ca8.js +3023 -0
- package/atoms/ExtendedLoadMore/index-f6e578e3.js +86 -0
- package/atoms/ExtendedLoadMore/index.js +5 -0
- package/atoms/ExtendedLoadMore/styles.arrow.css +1 -0
- package/atoms/Headline/index.js +2459 -0
- package/{Headline → atoms/Headline}/styles.arrow.css +0 -0
- package/atoms/HeroImage/index.js +2475 -0
- package/{HeroImage → atoms/HeroImage}/styles.arrow.css +0 -0
- package/atoms/LoadmoreButton/index.js +2268 -0
- package/{LoadmoreButton → atoms/LoadmoreButton}/styles.arrow.css +0 -0
- package/atoms/ScrollSnap/index.js +2531 -0
- package/{ScrollSnap → atoms/ScrollSnap}/styles.arrow.css +0 -0
- package/atoms/SectionTag/index.js +2220 -0
- package/{SectionTag → atoms/SectionTag}/styles.arrow.css +0 -0
- package/atoms/Subheadline/index.js +2200 -0
- package/{Subheadline → atoms/Subheadline}/styles.arrow.css +0 -0
- package/atoms/TimeStamp/index.js +2661 -0
- package/{TimeStamp → atoms/TimeStamp}/styles.arrow.css +0 -0
- package/molecules/KeyEvents/index.js +2968 -0
- package/{KeyEvents → molecules/KeyEvents}/styles.arrow.css +0 -0
- package/molecules/PageIntroductionCard/index.js +2676 -0
- package/{PageIntroductionCard → molecules/PageIntroductionCard}/styles.arrow.css +0 -0
- package/molecules/SocialShareTemplate/index.js +3093 -0
- package/{SocialShareTemplate → molecules/SocialShareTemplate}/styles.arrow.css +0 -0
- package/molecules/StoryCard/index.js +3938 -0
- package/{StoryCard → molecules/StoryCard}/styles.arrow.css +0 -0
- package/molecules/StoryElementCard/index.js +5832 -0
- package/{StoryElementCard → molecules/StoryElementCard}/styles.arrow.css +0 -0
- package/molecules/StorycardContent/index.js +3416 -0
- package/{StorycardContent → molecules/StorycardContent}/styles.arrow.css +0 -0
- package/package.json +1 -1
- package/rows/AlternateCollectionFilter/index.js +4744 -0
- package/{AlternateCollectionFilter → rows/AlternateCollectionFilter}/styles.arrow.css +0 -0
- package/rows/AsideCollection/index.js +4690 -0
- package/{AsideCollection → rows/AsideCollection}/styles.arrow.css +0 -0
- package/rows/AstrologyCollection/index.js +4661 -0
- package/{AstrologyCollection → rows/AstrologyCollection}/styles.arrow.css +0 -0
- package/rows/AuthorIntroductionCard/index.js +3520 -0
- package/{AuthorIntroductionCard → rows/AuthorIntroductionCard}/styles.arrow.css +0 -0
- package/rows/AuthorsList/index.js +3715 -0
- package/{AuthorsList → rows/AuthorsList}/styles.arrow.css +0 -0
- package/rows/CollectionFilter/index.js +4834 -0
- package/{CollectionFilter → rows/CollectionFilter}/styles.arrow.css +0 -0
- package/rows/ElevenStories/index.js +4638 -0
- package/{ElevenStories → rows/ElevenStories}/styles.arrow.css +0 -0
- package/rows/FourColFiveStories/index.js +4359 -0
- package/{FourColFiveStories → rows/FourColFiveStories}/styles.arrow.css +0 -0
- package/rows/FourColGrid/index.js +4584 -0
- package/{FourColGrid → rows/FourColGrid}/styles.arrow.css +0 -0
- package/rows/FourColPortraitStories/index.js +4617 -0
- package/{FourColPortraitStories → rows/FourColPortraitStories}/styles.arrow.css +0 -0
- package/rows/FourColSixteenStories/index.js +4375 -0
- package/{FourColSixteenStories → rows/FourColSixteenStories}/styles.arrow.css +0 -0
- package/rows/FourColTwelveStories/index.js +4335 -0
- package/{FourColTwelveStories → rows/FourColTwelveStories}/styles.arrow.css +0 -0
- package/rows/FourStorySlider/index.js +4743 -0
- package/{FourStorySlider → rows/FourStorySlider}/styles.arrow.css +0 -0
- package/rows/FourStorySliderPortrait/index.js +4746 -0
- package/{FourStorySliderPortrait → rows/FourStorySliderPortrait}/styles.arrow.css +1 -1
- package/rows/FourTabbedBigStorySlider/index.js +4505 -0
- package/{FourTabbedBigStorySlider → rows/FourTabbedBigStorySlider}/styles.arrow.css +0 -0
- package/rows/FullScreenSlider/index.js +4661 -0
- package/{FullScreenSlider → rows/FullScreenSlider}/styles.arrow.css +0 -0
- package/rows/HalfScreenSlider/index.js +4514 -0
- package/{HalfScreenSlider → rows/HalfScreenSlider}/styles.arrow.css +0 -0
- package/rows/ListComponent/index.js +4462 -0
- package/{ListComponent → rows/ListComponent}/styles.arrow.css +0 -0
- package/rows/Listicles/index.js +3131 -0
- package/{Listicles → rows/Listicles}/styles.arrow.css +0 -0
- package/rows/MagazineEditions/index.js +3142 -0
- package/{MagazineEditions → rows/MagazineEditions}/styles.arrow.css +0 -0
- package/rows/MagazineHeaderCard/index.js +3136 -0
- package/{MagazineHeaderCard → rows/MagazineHeaderCard}/styles.arrow.css +0 -0
- package/rows/MagazineWidget/index.js +4514 -0
- package/{MagazineWidget → rows/MagazineWidget}/styles.arrow.css +0 -0
- package/rows/OneColStoryList/index.js +4670 -0
- package/{OneColStoryList → rows/OneColStoryList}/styles.arrow.css +0 -0
- package/rows/OpinionCollection/index.js +4037 -0
- package/{OpinionCollection → rows/OpinionCollection}/styles.arrow.css +0 -0
- package/rows/SixColSixStories/index.js +4515 -0
- package/{SixColSixStories → rows/SixColSixStories}/styles.arrow.css +0 -0
- package/rows/StoryCollection/index.js +4690 -0
- package/{StoryCollection → rows/StoryCollection}/styles.arrow.css +0 -0
- package/rows/TagIntroductionCard/index.js +1901 -0
- package/{TagIntroductionCard → rows/TagIntroductionCard}/styles.arrow.css +0 -0
- package/rows/ThreeColFlexStories/index.js +4575 -0
- package/{ThreeColFlexStories → rows/ThreeColFlexStories}/styles.arrow.css +0 -0
- package/rows/ThreeColFourteenStories/index.js +4283 -0
- package/{ThreeColFourteenStories → rows/ThreeColFourteenStories}/styles.arrow.css +0 -0
- package/rows/ThreeColGrid/index.js +4605 -0
- package/{ThreeColGrid → rows/ThreeColGrid}/styles.arrow.css +0 -0
- package/rows/ThreeColSevenStory/index.js +4502 -0
- package/{ThreeColSevenStory → rows/ThreeColSevenStory}/styles.arrow.css +0 -0
- package/rows/ThreeColSixStories/index.js +4485 -0
- package/{ThreeColSixStories → rows/ThreeColSixStories}/styles.arrow.css +0 -0
- package/rows/ThreeColTwelveStories/index.js +4380 -0
- package/{ThreeColTwelveStories → rows/ThreeColTwelveStories}/styles.arrow.css +0 -0
- package/rows/TwoColFourStories/index.js +4463 -0
- package/{TwoColFourStories → rows/TwoColFourStories}/styles.arrow.css +0 -0
- package/rows/TwoColFourStoryHighlight/index.js +4456 -0
- package/{TwoColFourStoryHighlight → rows/TwoColFourStoryHighlight}/styles.arrow.css +0 -0
- package/rows/TwoColSevenStories/index.js +4490 -0
- package/{TwoColSevenStories → rows/TwoColSevenStories}/styles.arrow.css +0 -0
- package/rows/TwoColSixStories/index.js +4489 -0
- package/{TwoColSixStories → rows/TwoColSixStories}/styles.arrow.css +0 -0
- package/rows/TwoColTenStoriesSidebar/index.js +4549 -0
- package/{TwoColTenStoriesSidebar → rows/TwoColTenStoriesSidebar}/styles.arrow.css +0 -0
- package/rows/TwoColThreeStories/index.js +4436 -0
- package/{TwoColThreeStories → rows/TwoColThreeStories}/styles.arrow.css +0 -0
- package/story-elements/AlsoRead/index.js +2457 -0
- package/{AlsoRead → story-elements/AlsoRead}/styles.arrow.css +0 -0
- package/story-elements/Attachment/index.js +2013 -0
- package/{Attachment → story-elements/Attachment}/styles.arrow.css +0 -0
- package/story-elements/BigFact/index.js +1983 -0
- package/{BigFact → story-elements/BigFact}/styles.arrow.css +0 -0
- package/story-elements/BlockQuote/index.js +2431 -0
- package/{BlockQuote → story-elements/BlockQuote}/styles.arrow.css +0 -0
- package/story-elements/Blurb/index.js +2094 -0
- package/{Blurb → story-elements/Blurb}/styles.arrow.css +0 -0
- package/story-elements/Image/index.js +2711 -0
- package/{Image → story-elements/Image}/styles.arrow.css +0 -0
- package/story-elements/ImageGallery/index.js +2644 -0
- package/{ImageGallery → story-elements/ImageGallery}/styles.arrow.css +0 -0
- package/story-elements/ImageSlideshow/index.js +2955 -0
- package/{ImageSlideshow → story-elements/ImageSlideshow}/styles.arrow.css +0 -0
- package/story-elements/QuestionAnswer/index.js +2395 -0
- package/{QuestionAnswer → story-elements/QuestionAnswer}/styles.arrow.css +0 -0
- package/story-elements/Quote/index.js +2012 -0
- package/{Quote → story-elements/Quote}/styles.arrow.css +0 -0
- package/story-elements/Reference/index.js +2006 -0
- package/{Reference → story-elements/Reference}/styles.arrow.css +0 -0
- package/story-elements/StoryElement/index.js +1779 -0
- package/story-elements/Summary/index.js +2036 -0
- package/{Summary → story-elements/Summary}/styles.arrow.css +0 -0
- package/story-elements/Text/index.js +2293 -0
- package/{Text → story-elements/Text}/styles.arrow.css +0 -0
- package/story-elements/Video/index.js +1785 -0
- package/{Video → story-elements/Video}/styles.arrow.css +0 -0
- package/story-templates/ListicleStoryTemplate/index.js +8442 -0
- package/{ListicleStoryTemplate → story-templates/ListicleStoryTemplate}/styles.arrow.css +0 -0
- package/story-templates/LiveBlogStoryTemplate/index.js +8618 -0
- package/{LiveBlogStoryTemplate → story-templates/LiveBlogStoryTemplate}/styles.arrow.css +0 -0
- package/story-templates/PhotoStoryTemplate/index.js +8420 -0
- package/{PhotoStoryTemplate → story-templates/PhotoStoryTemplate}/styles.arrow.css +0 -0
- package/story-templates/TextStoryTemplate/index.js +8493 -0
- package/{TextStoryTemplate → story-templates/TextStoryTemplate}/styles.arrow.css +0 -0
- package/story-templates/VideoStoryTemplate/index.js +8352 -0
- package/{VideoStoryTemplate → story-templates/VideoStoryTemplate}/styles.arrow.css +0 -0
- package/cjs/index.js +0 -1
- package/esm/index.js +0 -1
|
@@ -0,0 +1,990 @@
|
|
|
1
|
+
import { a as get_1, g as getTextColor, _ as _getClassName, e as getStoryUrl, f as isExternalStory, h as getTimeStamp, j as formatter, k as getSlug, r as rgbToHex, d as clientWidth, b as generateNavigateSlug, c as _slicedToArray } from './index-e39b3ca8.js';
|
|
2
|
+
import React, { useContext, createContext, useState, useEffect, useRef } from 'react';
|
|
3
|
+
import PropTypes, { PropTypes as PropTypes$1 } from 'prop-types';
|
|
4
|
+
import { Link, ResponsiveImage, LinkBase } from '@quintype/components';
|
|
5
|
+
import { connect } from 'react-redux';
|
|
6
|
+
import ReactDOM from 'react-dom';
|
|
7
|
+
|
|
8
|
+
var StateContext = /*#__PURE__*/createContext(); // eslint-disable-next-line react/display-name
|
|
9
|
+
|
|
10
|
+
var StateProvider = function StateProvider(RowComponent) {
|
|
11
|
+
return function (props) {
|
|
12
|
+
return (
|
|
13
|
+
/*#__PURE__*/
|
|
14
|
+
// eslint-disable-next-line react/prop-types
|
|
15
|
+
React.createElement(StateContext.Provider, {
|
|
16
|
+
value: props.config
|
|
17
|
+
}, /*#__PURE__*/React.createElement(RowComponent, props))
|
|
18
|
+
);
|
|
19
|
+
};
|
|
20
|
+
};
|
|
21
|
+
var useStateValue = function useStateValue() {
|
|
22
|
+
return useContext(StateContext);
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
var CrownIcon = function CrownIcon(_ref) {
|
|
26
|
+
var height = _ref.height,
|
|
27
|
+
width = _ref.width,
|
|
28
|
+
_ref$color = _ref.color,
|
|
29
|
+
color = _ref$color === void 0 ? "#D8D8D8" : _ref$color,
|
|
30
|
+
positionTop = _ref.positionTop;
|
|
31
|
+
return /*#__PURE__*/React.createElement("svg", {
|
|
32
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
33
|
+
width: width,
|
|
34
|
+
height: height,
|
|
35
|
+
viewBox: "0 0 40 40",
|
|
36
|
+
style: {
|
|
37
|
+
position: "relative",
|
|
38
|
+
top: positionTop
|
|
39
|
+
}
|
|
40
|
+
}, /*#__PURE__*/React.createElement("g", {
|
|
41
|
+
fill: "none",
|
|
42
|
+
fillRule: "evenodd",
|
|
43
|
+
stroke: "none",
|
|
44
|
+
strokeWidth: "1"
|
|
45
|
+
}, /*#__PURE__*/React.createElement("g", null, /*#__PURE__*/React.createElement("g", {
|
|
46
|
+
transform: "translate(8 8)"
|
|
47
|
+
}, /*#__PURE__*/React.createElement("path", {
|
|
48
|
+
d: "M0 0H24V24H0z"
|
|
49
|
+
}), /*#__PURE__*/React.createElement("g", {
|
|
50
|
+
fill: color,
|
|
51
|
+
fillRule: "nonzero",
|
|
52
|
+
transform: "translate(0 2)"
|
|
53
|
+
}, /*#__PURE__*/React.createElement("path", {
|
|
54
|
+
d: "M21.043 19.553c0-.743-.601-1.344-1.344-1.344h-15.4a1.343 1.343 0 100 2.688h15.4c.743 0 1.344-.603 1.344-1.344zM1.598 8.673c.022 0 .042 0 .064-.003l2.131 7.713h16.411l2.132-7.713c.022 0 .041.003.063.003a1.599 1.599 0 10-1.52-1.108L17.025 9.82 12.882 2.95a1.599 1.599 0 10-1.765 0L6.976 9.82 3.121 7.565a1.599 1.599 0 10-1.523 1.107z"
|
|
55
|
+
}))))));
|
|
56
|
+
};
|
|
57
|
+
CrownIcon.propTypes = {
|
|
58
|
+
height: PropTypes.string,
|
|
59
|
+
width: PropTypes.string,
|
|
60
|
+
color: PropTypes.string,
|
|
61
|
+
positionTop: PropTypes.string
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
var KeyIcon = function KeyIcon(_ref) {
|
|
65
|
+
var height = _ref.height,
|
|
66
|
+
width = _ref.width,
|
|
67
|
+
_ref$color = _ref.color,
|
|
68
|
+
color = _ref$color === void 0 ? "#D5D5D5" : _ref$color,
|
|
69
|
+
positionTop = _ref.positionTop;
|
|
70
|
+
return /*#__PURE__*/React.createElement("svg", {
|
|
71
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
72
|
+
width: width,
|
|
73
|
+
height: height,
|
|
74
|
+
viewBox: "0 0 40 40",
|
|
75
|
+
style: {
|
|
76
|
+
position: "relative",
|
|
77
|
+
top: positionTop
|
|
78
|
+
}
|
|
79
|
+
}, /*#__PURE__*/React.createElement("g", {
|
|
80
|
+
fill: "none",
|
|
81
|
+
fillRule: "evenodd",
|
|
82
|
+
stroke: "none",
|
|
83
|
+
strokeWidth: "1"
|
|
84
|
+
}, /*#__PURE__*/React.createElement("g", null, /*#__PURE__*/React.createElement("g", {
|
|
85
|
+
transform: "translate(8 8)"
|
|
86
|
+
}, /*#__PURE__*/React.createElement("path", {
|
|
87
|
+
d: "M0 0H24V24H0z"
|
|
88
|
+
}), /*#__PURE__*/React.createElement("path", {
|
|
89
|
+
fill: color,
|
|
90
|
+
fillRule: "nonzero",
|
|
91
|
+
d: "M12.71 4.364A6.54 6.54 0 000 6.545a6.54 6.54 0 0012.71 2.182h4.745v4.364h4.363V8.727H24V4.364H12.71zM6.544 8.727a2.181 2.181 0 110-4.362 2.181 2.181 0 010 4.362z",
|
|
92
|
+
transform: "translate(0 5)"
|
|
93
|
+
})))));
|
|
94
|
+
};
|
|
95
|
+
KeyIcon.propTypes = {
|
|
96
|
+
height: PropTypes.string,
|
|
97
|
+
width: PropTypes.string,
|
|
98
|
+
color: PropTypes.string,
|
|
99
|
+
positionTop: PropTypes.string
|
|
100
|
+
};
|
|
101
|
+
|
|
102
|
+
var LockIcon = function LockIcon(_ref) {
|
|
103
|
+
var height = _ref.height,
|
|
104
|
+
width = _ref.width,
|
|
105
|
+
_ref$color = _ref.color,
|
|
106
|
+
color = _ref$color === void 0 ? "#D5D5D5" : _ref$color,
|
|
107
|
+
positionTop = _ref.positionTop;
|
|
108
|
+
return /*#__PURE__*/React.createElement("svg", {
|
|
109
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
110
|
+
width: width,
|
|
111
|
+
height: height,
|
|
112
|
+
viewBox: "0 0 40 40",
|
|
113
|
+
style: {
|
|
114
|
+
position: "relative",
|
|
115
|
+
top: positionTop
|
|
116
|
+
}
|
|
117
|
+
}, /*#__PURE__*/React.createElement("g", {
|
|
118
|
+
fill: "none",
|
|
119
|
+
fillRule: "evenodd",
|
|
120
|
+
stroke: "none",
|
|
121
|
+
strokeWidth: "1"
|
|
122
|
+
}, /*#__PURE__*/React.createElement("g", null, /*#__PURE__*/React.createElement("g", {
|
|
123
|
+
transform: "translate(8 8)"
|
|
124
|
+
}, /*#__PURE__*/React.createElement("path", {
|
|
125
|
+
d: "M0 0H24V24H0z"
|
|
126
|
+
}), /*#__PURE__*/React.createElement("g", {
|
|
127
|
+
fill: color,
|
|
128
|
+
fillRule: "nonzero",
|
|
129
|
+
transform: "translate(3)"
|
|
130
|
+
}, /*#__PURE__*/React.createElement("path", {
|
|
131
|
+
d: "M15.692 9h-.747V6c0-3.31-2.681-6-5.978-6C5.67 0 2.989 2.69 2.989 6v3h-.747A2.249 2.249 0 000 11.25v10.5A2.249 2.249 0 002.242 24h13.45a2.249 2.249 0 002.242-2.25v-10.5A2.249 2.249 0 0015.692 9zM4.982 6c0-2.206 1.787-4 3.985-4s3.985 1.794 3.985 4v3h-7.97V6z"
|
|
132
|
+
}))))));
|
|
133
|
+
};
|
|
134
|
+
LockIcon.propTypes = {
|
|
135
|
+
height: PropTypes.string,
|
|
136
|
+
width: PropTypes.string,
|
|
137
|
+
color: PropTypes.string,
|
|
138
|
+
positionTop: PropTypes.string
|
|
139
|
+
};
|
|
140
|
+
|
|
141
|
+
var StarIcon = function StarIcon(_ref) {
|
|
142
|
+
var width = _ref.width,
|
|
143
|
+
height = _ref.height,
|
|
144
|
+
_ref$color = _ref.color,
|
|
145
|
+
color = _ref$color === void 0 ? "#D5D5D5" : _ref$color,
|
|
146
|
+
_ref$positionTop = _ref.positionTop,
|
|
147
|
+
positionTop = _ref$positionTop === void 0 ? "" : _ref$positionTop;
|
|
148
|
+
return /*#__PURE__*/React.createElement("svg", {
|
|
149
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
150
|
+
width: width,
|
|
151
|
+
height: height,
|
|
152
|
+
viewBox: "0 0 40 40",
|
|
153
|
+
style: {
|
|
154
|
+
position: "relative",
|
|
155
|
+
top: positionTop
|
|
156
|
+
}
|
|
157
|
+
}, /*#__PURE__*/React.createElement("g", {
|
|
158
|
+
fill: "none",
|
|
159
|
+
fillRule: "evenodd",
|
|
160
|
+
stroke: "none",
|
|
161
|
+
strokeWidth: "1"
|
|
162
|
+
}, /*#__PURE__*/React.createElement("g", null, /*#__PURE__*/React.createElement("path", {
|
|
163
|
+
fill: color,
|
|
164
|
+
d: "M20 26L12.946577 29.7082039 14.2936609 21.854102 8.5873218 16.2917961 16.4732885 15.145898 20 8 23.5267115 15.145898 31.4126782 16.2917961 25.7063391 21.854102 27.053423 29.7082039z"
|
|
165
|
+
}))));
|
|
166
|
+
};
|
|
167
|
+
StarIcon.propTypes = {
|
|
168
|
+
height: PropTypes.string,
|
|
169
|
+
width: PropTypes.string,
|
|
170
|
+
color: PropTypes.string,
|
|
171
|
+
positionTop: PropTypes.string
|
|
172
|
+
};
|
|
173
|
+
|
|
174
|
+
var PremiumStoryIcon = function PremiumStoryIcon(_ref) {
|
|
175
|
+
var width = _ref.width,
|
|
176
|
+
height = _ref.height,
|
|
177
|
+
color = _ref.color,
|
|
178
|
+
iconType = _ref.iconType,
|
|
179
|
+
positionTop = _ref.positionTop;
|
|
180
|
+
|
|
181
|
+
switch (iconType) {
|
|
182
|
+
case "crown":
|
|
183
|
+
return /*#__PURE__*/React.createElement(CrownIcon, {
|
|
184
|
+
width: width,
|
|
185
|
+
height: height,
|
|
186
|
+
color: color,
|
|
187
|
+
positionTop: positionTop
|
|
188
|
+
});
|
|
189
|
+
|
|
190
|
+
case "lock":
|
|
191
|
+
return /*#__PURE__*/React.createElement(LockIcon, {
|
|
192
|
+
width: width,
|
|
193
|
+
height: height,
|
|
194
|
+
color: color,
|
|
195
|
+
positionTop: positionTop
|
|
196
|
+
});
|
|
197
|
+
|
|
198
|
+
case "key":
|
|
199
|
+
return /*#__PURE__*/React.createElement(KeyIcon, {
|
|
200
|
+
width: width,
|
|
201
|
+
height: height,
|
|
202
|
+
color: color,
|
|
203
|
+
positionTop: positionTop
|
|
204
|
+
});
|
|
205
|
+
|
|
206
|
+
default:
|
|
207
|
+
return /*#__PURE__*/React.createElement(StarIcon, {
|
|
208
|
+
width: width,
|
|
209
|
+
height: height,
|
|
210
|
+
color: color,
|
|
211
|
+
positionTop: positionTop
|
|
212
|
+
});
|
|
213
|
+
}
|
|
214
|
+
};
|
|
215
|
+
PremiumStoryIcon.propTypes = {
|
|
216
|
+
width: PropTypes.string,
|
|
217
|
+
height: PropTypes.string,
|
|
218
|
+
color: PropTypes.string,
|
|
219
|
+
iconType: PropTypes.string,
|
|
220
|
+
positionTop: PropTypes.string
|
|
221
|
+
};
|
|
222
|
+
|
|
223
|
+
function LiveIcon() {
|
|
224
|
+
return /*#__PURE__*/React.createElement("svg", {
|
|
225
|
+
className: "live-icon",
|
|
226
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
227
|
+
width: "25",
|
|
228
|
+
height: "24",
|
|
229
|
+
viewBox: "0 0 25 24"
|
|
230
|
+
}, /*#__PURE__*/React.createElement("path", {
|
|
231
|
+
fill: "#ff5858",
|
|
232
|
+
d: "M12 18a6 6 0 110-12 6 6 0 010 12zm0 2.5a8.5 8.5 0 110-17 8.5 8.5 0 010 17zm0-1a7.5 7.5 0 100-15 7.5 7.5 0 000 15z"
|
|
233
|
+
}));
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
var _styleModuleImportMap$8 = {
|
|
237
|
+
"./headline.m.css": {
|
|
238
|
+
"wrapper": "headline-m_wrapper__3nUmh",
|
|
239
|
+
"headline": "headline-m_headline__3_NhV",
|
|
240
|
+
"dark": "headline-m_dark__en3hW",
|
|
241
|
+
"light": "headline-m_light__3lKJB"
|
|
242
|
+
}
|
|
243
|
+
};
|
|
244
|
+
var Headline = function Headline(_ref) {
|
|
245
|
+
var story = _ref.story,
|
|
246
|
+
headerLevel = _ref.headerLevel,
|
|
247
|
+
_ref$premiumStoryIcon = _ref.premiumStoryIconConfig,
|
|
248
|
+
premiumStoryIconConfig = _ref$premiumStoryIcon === void 0 ? {} : _ref$premiumStoryIcon,
|
|
249
|
+
isLink = _ref.isLink;
|
|
250
|
+
var configData = useStateValue() || {};
|
|
251
|
+
var _premiumStoryIconConf = premiumStoryIconConfig.iconColor,
|
|
252
|
+
iconColor = _premiumStoryIconConf === void 0 ? "#F7B500" : _premiumStoryIconConf,
|
|
253
|
+
_premiumStoryIconConf2 = premiumStoryIconConfig.iconStyle,
|
|
254
|
+
iconStyle = _premiumStoryIconConf2 === void 0 ? "star" : _premiumStoryIconConf2,
|
|
255
|
+
_premiumStoryIconConf3 = premiumStoryIconConfig.enablePremiumStoryIcon,
|
|
256
|
+
enablePremiumStoryIcon = _premiumStoryIconConf3 === void 0 ? false : _premiumStoryIconConf3,
|
|
257
|
+
_premiumStoryIconConf4 = premiumStoryIconConfig.showLiveIcon,
|
|
258
|
+
showLiveIcon = _premiumStoryIconConf4 === void 0 ? false : _premiumStoryIconConf4;
|
|
259
|
+
var alternateHeadline = get_1(story, ["alternative", "home", "default", "headline"]);
|
|
260
|
+
var premiumStory = enablePremiumStoryIcon && get_1(story, ["access"]) === "subscription";
|
|
261
|
+
var headline = alternateHeadline || story.headline;
|
|
262
|
+
var HeaderTag = "h" + headerLevel;
|
|
263
|
+
|
|
264
|
+
var positionHeadline = function positionHeadline() {
|
|
265
|
+
switch (parseInt(headerLevel)) {
|
|
266
|
+
case 1:
|
|
267
|
+
return "-2px";
|
|
268
|
+
|
|
269
|
+
case 2:
|
|
270
|
+
return "2px";
|
|
271
|
+
|
|
272
|
+
case 3:
|
|
273
|
+
return "4px";
|
|
274
|
+
|
|
275
|
+
case 4:
|
|
276
|
+
return "5px";
|
|
277
|
+
|
|
278
|
+
default:
|
|
279
|
+
return "6px";
|
|
280
|
+
}
|
|
281
|
+
};
|
|
282
|
+
|
|
283
|
+
var textColor = getTextColor(configData.theme);
|
|
284
|
+
var wrapperClass = premiumStory ? "wrapper" : "";
|
|
285
|
+
var iconSize = "24px";
|
|
286
|
+
var enableLiveIcon = showLiveIcon && story["story-template"] === "live-blog" && !get_1(story, ["metadata", "is-closed"], false);
|
|
287
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
288
|
+
"data-test-id": "headline",
|
|
289
|
+
className: "arrow-component arr--headline " + _getClassName(wrapperClass, _styleModuleImportMap$8)
|
|
290
|
+
}, premiumStory && /*#__PURE__*/React.createElement(PremiumStoryIcon, {
|
|
291
|
+
width: iconSize,
|
|
292
|
+
height: iconSize,
|
|
293
|
+
color: iconColor,
|
|
294
|
+
iconType: iconStyle,
|
|
295
|
+
positionTop: positionHeadline()
|
|
296
|
+
}), isLink ? /*#__PURE__*/React.createElement(Link, {
|
|
297
|
+
href: getStoryUrl(story, "/".concat(story.slug)),
|
|
298
|
+
externalLink: isExternalStory(story),
|
|
299
|
+
"aria-label": "headline"
|
|
300
|
+
}, /*#__PURE__*/React.createElement(HeaderTag, {
|
|
301
|
+
className: _getClassName("headline ".concat(textColor), _styleModuleImportMap$8)
|
|
302
|
+
}, enableLiveIcon && /*#__PURE__*/React.createElement(LiveIcon, null), headline)) : /*#__PURE__*/React.createElement(HeaderTag, {
|
|
303
|
+
className: _getClassName("headline ".concat(textColor), _styleModuleImportMap$8)
|
|
304
|
+
}, enableLiveIcon && /*#__PURE__*/React.createElement(LiveIcon, null), headline));
|
|
305
|
+
};
|
|
306
|
+
Headline.propTypes = {
|
|
307
|
+
/** The Story Object from the API response */
|
|
308
|
+
story: PropTypes.object.isRequired,
|
|
309
|
+
|
|
310
|
+
/** Header tags ranging h1-h6, where h[headerLevel] */
|
|
311
|
+
headerLevel: PropTypes.string,
|
|
312
|
+
premiumStoryIconConfig: PropTypes.shape({
|
|
313
|
+
iconColor: PropTypes.string,
|
|
314
|
+
iconType: PropTypes.string,
|
|
315
|
+
enablePremiumStoryIcon: PropTypes.bool
|
|
316
|
+
}),
|
|
317
|
+
isLink: PropTypes.bool
|
|
318
|
+
};
|
|
319
|
+
Headline.defaultProps = {
|
|
320
|
+
headerLevel: "6",
|
|
321
|
+
isLink: true
|
|
322
|
+
};
|
|
323
|
+
|
|
324
|
+
var _styleModuleImportMap$7 = {
|
|
325
|
+
"./timestamp.m.css": {
|
|
326
|
+
"time": "timestamp-m_time__2v46i",
|
|
327
|
+
"time-wrapper": "timestamp-m_time-wrapper__3O2lM",
|
|
328
|
+
"bottom-fix": "timestamp-m_bottom-fix__1Zh8r",
|
|
329
|
+
"dark": "timestamp-m_dark__2lk9E",
|
|
330
|
+
"light": "timestamp-m_light__2QlrI"
|
|
331
|
+
}
|
|
332
|
+
};
|
|
333
|
+
var TimeStamp = function TimeStamp(_ref) {
|
|
334
|
+
var story = _ref.story,
|
|
335
|
+
isBottom = _ref.isBottom,
|
|
336
|
+
_ref$config = _ref.config,
|
|
337
|
+
config = _ref$config === void 0 ? {} : _ref$config;
|
|
338
|
+
var configState = useStateValue() || {};
|
|
339
|
+
var isTime = get_1(config, ["showTime"], get_1(configState, ["showTime"], true));
|
|
340
|
+
var time = story["last-published-at"] || story["first-published-at"];
|
|
341
|
+
var isBottomClasses = isBottom ? "bottom-fix" : "";
|
|
342
|
+
var textColor = getTextColor(configState.theme);
|
|
343
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, isTime && /*#__PURE__*/React.createElement("div", {
|
|
344
|
+
"data-test-id": "publish-time",
|
|
345
|
+
className: "time arr--publish-time " + _getClassName("time ".concat(textColor, " ").concat(isBottomClasses), _styleModuleImportMap$7)
|
|
346
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
347
|
+
className: "timestamp-m_time-wrapper__3O2lM"
|
|
348
|
+
}, getTimeStamp(time, formatter, config))));
|
|
349
|
+
};
|
|
350
|
+
TimeStamp.propTypes = {
|
|
351
|
+
/** The Story Object from the API response */
|
|
352
|
+
story: PropTypes.object,
|
|
353
|
+
isBottom: PropTypes.bool,
|
|
354
|
+
config: PropTypes.object
|
|
355
|
+
};
|
|
356
|
+
|
|
357
|
+
var _styleModuleImportMap$6 = {
|
|
358
|
+
"./author.m.css": {
|
|
359
|
+
"author": "author-m_author__WRuLm",
|
|
360
|
+
"author-image": "author-m_author-image__3q2oc",
|
|
361
|
+
"author-name": "author-m_author-name__3WP-O",
|
|
362
|
+
"bottom-fix": "author-m_bottom-fix__223TT",
|
|
363
|
+
"prefix": "author-m_prefix__YSInK",
|
|
364
|
+
"rtl-image": "author-m_rtl-image__2nglD",
|
|
365
|
+
"ltr-image": "author-m_ltr-image__3bc0L",
|
|
366
|
+
"dark": "author-m_dark__2TTlp",
|
|
367
|
+
"light": "author-m_light__3y8_x"
|
|
368
|
+
}
|
|
369
|
+
};
|
|
370
|
+
|
|
371
|
+
var AuthorBase = function AuthorBase(_ref) {
|
|
372
|
+
var story = _ref.story,
|
|
373
|
+
hideAuthorImage = _ref.hideAuthorImage,
|
|
374
|
+
isBottom = _ref.isBottom,
|
|
375
|
+
_ref$prefix = _ref.prefix,
|
|
376
|
+
prefix = _ref$prefix === void 0 ? "" : _ref$prefix,
|
|
377
|
+
_ref$config = _ref.config,
|
|
378
|
+
config = _ref$config === void 0 ? {} : _ref$config;
|
|
379
|
+
var configData = useStateValue() || {};
|
|
380
|
+
var isAuthor = get_1(configData, ["showAuthor"], true);
|
|
381
|
+
|
|
382
|
+
var _get = get_1(story, ["authors", "0"], ""),
|
|
383
|
+
avatarUrl = _get["avatar-url"],
|
|
384
|
+
avatarS3Key = _get["avatar-s3-key"],
|
|
385
|
+
authorName = _get.name,
|
|
386
|
+
slug = _get.slug;
|
|
387
|
+
|
|
388
|
+
var isBottomClasses = isBottom ? "bottom-fix" : "";
|
|
389
|
+
var textColor = getTextColor(configData.theme);
|
|
390
|
+
var mountAt = get_1(config, ["mountAt"], "");
|
|
391
|
+
|
|
392
|
+
var authorImage = function authorImage(dir) {
|
|
393
|
+
if (!avatarUrl && !avatarS3Key) {
|
|
394
|
+
return null;
|
|
395
|
+
}
|
|
396
|
+
|
|
397
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
398
|
+
"data-test-id": "author-image",
|
|
399
|
+
className: _getClassName("author-image ".concat(dir, "-image"), _styleModuleImportMap$6)
|
|
400
|
+
}, /*#__PURE__*/React.createElement("figure", null, avatarS3Key ? /*#__PURE__*/React.createElement(ResponsiveImage, {
|
|
401
|
+
slug: avatarS3Key,
|
|
402
|
+
"aspect-ratio": [1, 1],
|
|
403
|
+
defaultWidth: 400,
|
|
404
|
+
imgParams: {
|
|
405
|
+
auto: ["format", "compress"]
|
|
406
|
+
},
|
|
407
|
+
alt: authorName
|
|
408
|
+
}) : /*#__PURE__*/React.createElement("img", {
|
|
409
|
+
src: avatarUrl
|
|
410
|
+
})));
|
|
411
|
+
};
|
|
412
|
+
|
|
413
|
+
var isPrefix = function isPrefix(dir) {
|
|
414
|
+
if (prefix) {
|
|
415
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
416
|
+
className: "arr-author-prefix " + _getClassName("prefix ".concat(textColor), _styleModuleImportMap$6)
|
|
417
|
+
}, prefix);
|
|
418
|
+
}
|
|
419
|
+
|
|
420
|
+
return !hideAuthorImage && authorImage(dir);
|
|
421
|
+
};
|
|
422
|
+
|
|
423
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, isAuthor && /*#__PURE__*/React.createElement(Link, {
|
|
424
|
+
href: "".concat(mountAt, "/author/") + slug,
|
|
425
|
+
"aria-label": "author-name",
|
|
426
|
+
className: "author-name arr-author-name arrow-component " + _getClassName("author ".concat(isBottomClasses), _styleModuleImportMap$6)
|
|
427
|
+
}, isPrefix("ltr"), /*#__PURE__*/React.createElement("div", {
|
|
428
|
+
"data-test-id": "author-name",
|
|
429
|
+
className: "author-name " + _getClassName("author-name ".concat(textColor), _styleModuleImportMap$6)
|
|
430
|
+
}, authorName || story["author-name"]), !prefix && isPrefix("rtl")));
|
|
431
|
+
};
|
|
432
|
+
|
|
433
|
+
function mapStateToProps$1(state) {
|
|
434
|
+
return {
|
|
435
|
+
config: get_1(state, ["qt", "config"], {})
|
|
436
|
+
};
|
|
437
|
+
}
|
|
438
|
+
|
|
439
|
+
var Author = connect(mapStateToProps$1)(AuthorBase);
|
|
440
|
+
AuthorBase.propTypes = {
|
|
441
|
+
/** The Story Object from the API response */
|
|
442
|
+
story: PropTypes.object.isRequired,
|
|
443
|
+
|
|
444
|
+
/** Hide Author Avatar Image */
|
|
445
|
+
hideAuthorImage: PropTypes.bool,
|
|
446
|
+
// fix Author bottom of the storyCard
|
|
447
|
+
isBottom: PropTypes.bool,
|
|
448
|
+
// fix prefix before the author name
|
|
449
|
+
prefix: PropTypes.string,
|
|
450
|
+
config: PropTypes.object
|
|
451
|
+
};
|
|
452
|
+
AuthorBase.defaultProps = {
|
|
453
|
+
hideAuthorImage: false,
|
|
454
|
+
isBottom: false,
|
|
455
|
+
prefix: ""
|
|
456
|
+
};
|
|
457
|
+
|
|
458
|
+
var _styleModuleImportMap$5 = {
|
|
459
|
+
"./dot.m.css": {
|
|
460
|
+
"dark": "dot-m_dark__1Njxl",
|
|
461
|
+
"light": "dot-m_light__27IA3"
|
|
462
|
+
}
|
|
463
|
+
};
|
|
464
|
+
var Dot = function Dot(_ref) {
|
|
465
|
+
var _ref$width = _ref.width,
|
|
466
|
+
width = _ref$width === void 0 ? "3px" : _ref$width,
|
|
467
|
+
_ref$height = _ref.height,
|
|
468
|
+
height = _ref$height === void 0 ? "3px" : _ref$height,
|
|
469
|
+
_ref$color = _ref.color,
|
|
470
|
+
color = _ref$color === void 0 ? "light" : _ref$color;
|
|
471
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
472
|
+
className: _getClassName(color, _styleModuleImportMap$5)
|
|
473
|
+
}, /*#__PURE__*/React.createElement("svg", {
|
|
474
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
475
|
+
width: width,
|
|
476
|
+
height: height,
|
|
477
|
+
viewBox: "0 0 3 3"
|
|
478
|
+
}, /*#__PURE__*/React.createElement("circle", {
|
|
479
|
+
cx: "87",
|
|
480
|
+
cy: "9",
|
|
481
|
+
r: "1",
|
|
482
|
+
fill: "inherit",
|
|
483
|
+
fillRule: "nonzero",
|
|
484
|
+
transform: "translate(-86 -8)"
|
|
485
|
+
})));
|
|
486
|
+
};
|
|
487
|
+
Dot.propTypes = {
|
|
488
|
+
/** height , width and color of the dot icon */
|
|
489
|
+
color: PropTypes.string,
|
|
490
|
+
width: PropTypes.string,
|
|
491
|
+
height: PropTypes.string
|
|
492
|
+
};
|
|
493
|
+
|
|
494
|
+
var _styleModuleImportMap$4 = {
|
|
495
|
+
"./divider.m.css": {
|
|
496
|
+
"dark": "divider-m_dark__26FRi",
|
|
497
|
+
"light": "divider-m_light__w-7sy"
|
|
498
|
+
}
|
|
499
|
+
};
|
|
500
|
+
var Divider = function Divider(_ref) {
|
|
501
|
+
var _ref$width = _ref.width,
|
|
502
|
+
width = _ref$width === void 0 ? "1" : _ref$width,
|
|
503
|
+
_ref$height = _ref.height,
|
|
504
|
+
height = _ref$height === void 0 ? "10" : _ref$height,
|
|
505
|
+
_ref$color = _ref.color,
|
|
506
|
+
color = _ref$color === void 0 ? "light" : _ref$color;
|
|
507
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
508
|
+
className: _getClassName(color, _styleModuleImportMap$4)
|
|
509
|
+
}, /*#__PURE__*/React.createElement("svg", {
|
|
510
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
511
|
+
width: width,
|
|
512
|
+
height: height
|
|
513
|
+
}, /*#__PURE__*/React.createElement("path", {
|
|
514
|
+
fill: "inherit",
|
|
515
|
+
d: "M0 0h1v10H0z"
|
|
516
|
+
})));
|
|
517
|
+
};
|
|
518
|
+
Divider.propTypes = {
|
|
519
|
+
/** height , width and color of the dot icon */
|
|
520
|
+
color: PropTypes.string,
|
|
521
|
+
width: PropTypes.string,
|
|
522
|
+
height: PropTypes.string
|
|
523
|
+
};
|
|
524
|
+
|
|
525
|
+
var _styleModuleImportMap$3 = {
|
|
526
|
+
"./read-time.m.css": {
|
|
527
|
+
"read-time-wrapper": "read-time-m_read-time-wrapper__3GyC_",
|
|
528
|
+
"dot-indicator": "read-time-m_dot-indicator__3Sqh2",
|
|
529
|
+
"dark": "read-time-m_dark__3yRaK",
|
|
530
|
+
"light": "read-time-m_light__1GAZu"
|
|
531
|
+
}
|
|
532
|
+
};
|
|
533
|
+
var ReadTime = function ReadTime(_ref) {
|
|
534
|
+
var story = _ref.story,
|
|
535
|
+
_ref$opts = _ref.opts,
|
|
536
|
+
opts = _ref$opts === void 0 ? {} : _ref$opts,
|
|
537
|
+
_ref$isLightTheme = _ref.isLightTheme,
|
|
538
|
+
isLightTheme = _ref$isLightTheme === void 0 ? false : _ref$isLightTheme;
|
|
539
|
+
var config = useStateValue() || {};
|
|
540
|
+
var showReadTime = get_1(config, ["showReadTime"]) || get_1(opts, ["showReadTime"], true);
|
|
541
|
+
var readTime = get_1(story, ["read-time"], 0);
|
|
542
|
+
var textColor = isLightTheme ? "light" : getTextColor(config.theme);
|
|
543
|
+
if (!showReadTime || !readTime) return null;
|
|
544
|
+
var timeToRead = get_1(opts, ["localizedTimeToRead"]) || "min read";
|
|
545
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
|
|
546
|
+
"data-test-id": "read-time",
|
|
547
|
+
className: "arrow-component arr--read-time " + _getClassName("read-time-wrapper ".concat(textColor), _styleModuleImportMap$3)
|
|
548
|
+
}, /*#__PURE__*/React.createElement("span", {
|
|
549
|
+
className: "read-time-indicator read-time-m_dot-indicator__3Sqh2"
|
|
550
|
+
}, /*#__PURE__*/React.createElement(Dot, {
|
|
551
|
+
color: textColor
|
|
552
|
+
})), /*#__PURE__*/React.createElement("span", null, readTime, " ", timeToRead)));
|
|
553
|
+
};
|
|
554
|
+
ReadTime.propTypes = {
|
|
555
|
+
story: PropTypes.shape({
|
|
556
|
+
"read-time": PropTypes.number
|
|
557
|
+
}),
|
|
558
|
+
opts: PropTypes.shape({
|
|
559
|
+
showReadTime: PropTypes.bool
|
|
560
|
+
}),
|
|
561
|
+
isLightTheme: PropTypes.bool
|
|
562
|
+
};
|
|
563
|
+
|
|
564
|
+
var _styleModuleImportMap$2 = {
|
|
565
|
+
"./author-with-timestamp.m.css": {
|
|
566
|
+
"author-time-wrapper": "author-with-timestamp-m_author-time-wrapper__G7_eI",
|
|
567
|
+
"author-image": "author-with-timestamp-m_author-image__24xrD",
|
|
568
|
+
"dot": "author-with-timestamp-m_dot__1LHXD",
|
|
569
|
+
"bottom-fix": "author-with-timestamp-m_bottom-fix__1rWGv",
|
|
570
|
+
"dash": "author-with-timestamp-m_dash__2L5XC"
|
|
571
|
+
}
|
|
572
|
+
};
|
|
573
|
+
var AuthorWithTime = function AuthorWithTime(_ref) {
|
|
574
|
+
var story = _ref.story,
|
|
575
|
+
separator = _ref.separator,
|
|
576
|
+
isBottom = _ref.isBottom,
|
|
577
|
+
hideAuthorImage = _ref.hideAuthorImage,
|
|
578
|
+
prefix = _ref.prefix,
|
|
579
|
+
_ref$config = _ref.config,
|
|
580
|
+
config = _ref$config === void 0 ? {} : _ref$config,
|
|
581
|
+
isLightTheme = _ref.isLightTheme;
|
|
582
|
+
var configState = useStateValue() || {};
|
|
583
|
+
var isAuthor = get_1(config, ["showAuthor"], get_1(configState, ["showAuthor"], true));
|
|
584
|
+
var isTime = get_1(config, ["showTime"], get_1(configState, ["showTime"], true));
|
|
585
|
+
var isReadTime = get_1(configState, ["showReadTime"], true);
|
|
586
|
+
var isBottomClasses = isBottom ? "bottom-fix" : "";
|
|
587
|
+
var seperatorStyle = separator === "dot" ? "dot" : "dash";
|
|
588
|
+
var textColor = isLightTheme ? "light" : getTextColor(configState.theme);
|
|
589
|
+
|
|
590
|
+
var getSeparator = function getSeparator() {
|
|
591
|
+
if (separator === "divider") {
|
|
592
|
+
return /*#__PURE__*/React.createElement(Divider, {
|
|
593
|
+
color: textColor
|
|
594
|
+
});
|
|
595
|
+
}
|
|
596
|
+
|
|
597
|
+
return /*#__PURE__*/React.createElement(Dot, {
|
|
598
|
+
color: textColor
|
|
599
|
+
});
|
|
600
|
+
};
|
|
601
|
+
|
|
602
|
+
var getTimeStamp = function getTimeStamp() {
|
|
603
|
+
if (!isTime) return null;
|
|
604
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, isAuthor && /*#__PURE__*/React.createElement("span", {
|
|
605
|
+
className: "arr-separator " + _getClassName("".concat(seperatorStyle), _styleModuleImportMap$2)
|
|
606
|
+
}, getSeparator()), /*#__PURE__*/React.createElement(TimeStamp, {
|
|
607
|
+
story: story,
|
|
608
|
+
config: config
|
|
609
|
+
}), isReadTime && /*#__PURE__*/React.createElement(ReadTime, {
|
|
610
|
+
story: story,
|
|
611
|
+
opts: config,
|
|
612
|
+
isLightTheme: isLightTheme
|
|
613
|
+
}));
|
|
614
|
+
};
|
|
615
|
+
|
|
616
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
617
|
+
className: "arr--author-time " + _getClassName("author-time-wrapper ".concat(isBottomClasses), _styleModuleImportMap$2)
|
|
618
|
+
}, isAuthor ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Author, {
|
|
619
|
+
story: story,
|
|
620
|
+
isBottom: true,
|
|
621
|
+
hideAuthorImage: hideAuthorImage,
|
|
622
|
+
prefix: prefix
|
|
623
|
+
}), getTimeStamp()) : getTimeStamp());
|
|
624
|
+
};
|
|
625
|
+
AuthorWithTime.propTypes = {
|
|
626
|
+
story: PropTypes.object,
|
|
627
|
+
|
|
628
|
+
/** Style of separator between the Author & Timestamp */
|
|
629
|
+
separator: PropTypes.oneOf(["dot", "divider"]),
|
|
630
|
+
|
|
631
|
+
/** hide the author image */
|
|
632
|
+
hideAuthorImage: PropTypes.bool,
|
|
633
|
+
// fix author and time at the end
|
|
634
|
+
isBottom: PropTypes.bool,
|
|
635
|
+
// fix prefix before the author name
|
|
636
|
+
prefix: PropTypes.string,
|
|
637
|
+
config: PropTypes.object,
|
|
638
|
+
isLightTheme: PropTypes.bool
|
|
639
|
+
};
|
|
640
|
+
AuthorWithTime.defaultProps = {
|
|
641
|
+
separator: "dot",
|
|
642
|
+
isBottom: false,
|
|
643
|
+
hideAuthorImage: true,
|
|
644
|
+
prefix: "",
|
|
645
|
+
isLightTheme: false
|
|
646
|
+
};
|
|
647
|
+
|
|
648
|
+
var _styleModuleImportMap$1 = {
|
|
649
|
+
"./collection-name.m.css": {
|
|
650
|
+
"collection": "collection-name-m_collection__JD6sx",
|
|
651
|
+
"collection-borderLeft": "collection-name-m_collection-borderLeft__3Dznk",
|
|
652
|
+
"border-left": "collection-name-m_border-left__3_pYw",
|
|
653
|
+
"collection-borderBottomFull": "collection-name-m_collection-borderBottomFull__Dkq3K",
|
|
654
|
+
"collection-borderBottom": "collection-name-m_collection-borderBottom__2rdQM",
|
|
655
|
+
"collection-crossLine": "collection-name-m_collection-crossLine__1sIpN",
|
|
656
|
+
"border-bottom": "collection-name-m_border-bottom__1MnlV",
|
|
657
|
+
"dark": "collection-name-m_dark__nMe5H",
|
|
658
|
+
"light": "collection-name-m_light__1vFDN"
|
|
659
|
+
}
|
|
660
|
+
};
|
|
661
|
+
var CollectionNameBase = function CollectionNameBase(_ref) {
|
|
662
|
+
var _ref$collectionNameBo = _ref.collectionNameBorderColor,
|
|
663
|
+
collectionNameBorderColor = _ref$collectionNameBo === void 0 ? "" : _ref$collectionNameBo,
|
|
664
|
+
collection = _ref.collection,
|
|
665
|
+
config = _ref.config,
|
|
666
|
+
collectionNameTemplate = _ref.collectionNameTemplate,
|
|
667
|
+
headerLevel = _ref.headerLevel,
|
|
668
|
+
_ref$customCollection = _ref.customCollectionName,
|
|
669
|
+
customCollectionName = _ref$customCollection === void 0 ? "" : _ref$customCollection,
|
|
670
|
+
_ref$navigate = _ref.navigate,
|
|
671
|
+
navigate = _ref$navigate === void 0 ? true : _ref$navigate;
|
|
672
|
+
var collectionTitle = useStateValue() || {};
|
|
673
|
+
var showRowTitle = get_1(collectionTitle, ["showRowTitle"], true);
|
|
674
|
+
var supportedTemplates = ["borderLeft", "borderBottom", "crossLine", "borderBottomFull"];
|
|
675
|
+
var templateStyle = supportedTemplates.includes(collectionNameTemplate) ? " collection-".concat(collectionNameTemplate) : "";
|
|
676
|
+
var slug = navigate && collection && getSlug(collection, config) || "";
|
|
677
|
+
var collectionName = customCollectionName || collection.name || "";
|
|
678
|
+
var textColor = getTextColor(collectionTitle.theme);
|
|
679
|
+
var HeaderTag = "h" + headerLevel;
|
|
680
|
+
var CollectionNameBorderColor = rgbToHex(collectionNameBorderColor);
|
|
681
|
+
var borderBottomFullStyle = templateStyle.includes("collection-borderBottomFull") ? "4px solid ".concat(CollectionNameBorderColor) : "";
|
|
682
|
+
|
|
683
|
+
var borderBottomStyle = function borderBottomStyle() {
|
|
684
|
+
return templateStyle.includes("collection-borderBottom") && !templateStyle.includes("collection-borderBottomFull") ? /*#__PURE__*/React.createElement("div", {
|
|
685
|
+
className: "collection-name-m_border-bottom__1MnlV",
|
|
686
|
+
style: {
|
|
687
|
+
borderBottom: "4px solid ".concat(CollectionNameBorderColor)
|
|
688
|
+
}
|
|
689
|
+
}) : "";
|
|
690
|
+
};
|
|
691
|
+
|
|
692
|
+
var isMobile = clientWidth("mobile");
|
|
693
|
+
|
|
694
|
+
var getBorderHeight = function getBorderHeight() {
|
|
695
|
+
if (isMobile) {
|
|
696
|
+
switch (headerLevel) {
|
|
697
|
+
case "1":
|
|
698
|
+
return "32px";
|
|
699
|
+
|
|
700
|
+
case "2":
|
|
701
|
+
return "24px";
|
|
702
|
+
|
|
703
|
+
case "3":
|
|
704
|
+
return "20px";
|
|
705
|
+
|
|
706
|
+
case "4":
|
|
707
|
+
return "18px";
|
|
708
|
+
|
|
709
|
+
case "5":
|
|
710
|
+
return "16px";
|
|
711
|
+
|
|
712
|
+
case "6":
|
|
713
|
+
return "16px";
|
|
714
|
+
|
|
715
|
+
default:
|
|
716
|
+
return "20px";
|
|
717
|
+
}
|
|
718
|
+
}
|
|
719
|
+
|
|
720
|
+
switch (headerLevel) {
|
|
721
|
+
case "1":
|
|
722
|
+
return "40px";
|
|
723
|
+
|
|
724
|
+
case "2":
|
|
725
|
+
return "32px";
|
|
726
|
+
|
|
727
|
+
case "3":
|
|
728
|
+
return "24px";
|
|
729
|
+
|
|
730
|
+
case "4":
|
|
731
|
+
return "20px";
|
|
732
|
+
|
|
733
|
+
case "5":
|
|
734
|
+
return "18px";
|
|
735
|
+
|
|
736
|
+
case "6":
|
|
737
|
+
return "16px";
|
|
738
|
+
|
|
739
|
+
default:
|
|
740
|
+
return "24px";
|
|
741
|
+
}
|
|
742
|
+
};
|
|
743
|
+
|
|
744
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, showRowTitle && collectionName && /*#__PURE__*/React.createElement("div", {
|
|
745
|
+
style: {
|
|
746
|
+
borderBottom: borderBottomFullStyle
|
|
747
|
+
},
|
|
748
|
+
"data-test-id": "collection-name",
|
|
749
|
+
className: ("arr--collection-name arrow-component ".concat(templateStyle) ? "arr--collection-name arrow-component ".concat(templateStyle) + " " : "") + _getClassName("collection ".concat(textColor, " ").concat(templateStyle), _styleModuleImportMap$1)
|
|
750
|
+
}, templateStyle.includes("collection-borderLeft") && /*#__PURE__*/React.createElement("span", {
|
|
751
|
+
className: "arr-collection-name-border-left collection-name-m_border-left__3_pYw",
|
|
752
|
+
style: {
|
|
753
|
+
color: CollectionNameBorderColor,
|
|
754
|
+
fontSize: getBorderHeight()
|
|
755
|
+
}
|
|
756
|
+
}), slug && !slug.includes(undefined) ? /*#__PURE__*/React.createElement(Link, {
|
|
757
|
+
href: slug,
|
|
758
|
+
"aria-label": "collection-name"
|
|
759
|
+
}, /*#__PURE__*/React.createElement(HeaderTag, null, collectionName)) : /*#__PURE__*/React.createElement(HeaderTag, null, collectionName), borderBottomStyle()));
|
|
760
|
+
};
|
|
761
|
+
CollectionNameBase.propTypes = {
|
|
762
|
+
/** Collection name border color */
|
|
763
|
+
collectionNameBorderColor: PropTypes$1.string,
|
|
764
|
+
|
|
765
|
+
/** The Collection Object from the API response */
|
|
766
|
+
collection: PropTypes$1.object,
|
|
767
|
+
|
|
768
|
+
/** The publisher config from the API response */
|
|
769
|
+
config: PropTypes$1.object,
|
|
770
|
+
|
|
771
|
+
/** The style template for the component */
|
|
772
|
+
collectionNameTemplate: PropTypes$1.oneOf(["", "borderLeft", "borderBottom", "crossLine", "borderBottomFull"]),
|
|
773
|
+
|
|
774
|
+
/** Header tags ranging h1-h6, where h[headerLevel] */
|
|
775
|
+
headerLevel: PropTypes$1.string,
|
|
776
|
+
customCollectionName: PropTypes$1.string,
|
|
777
|
+
navigate: PropTypes$1.bool
|
|
778
|
+
};
|
|
779
|
+
CollectionNameBase.defaultProps = {
|
|
780
|
+
collectionNameTemplate: "",
|
|
781
|
+
headerLevel: "3"
|
|
782
|
+
};
|
|
783
|
+
|
|
784
|
+
function mapStateToProps(state) {
|
|
785
|
+
return {
|
|
786
|
+
config: get_1(state, ["qt", "config"], {})
|
|
787
|
+
};
|
|
788
|
+
}
|
|
789
|
+
|
|
790
|
+
var CollectionName = connect(mapStateToProps)(CollectionNameBase);
|
|
791
|
+
|
|
792
|
+
function _defineProperty(obj, key, value) {
|
|
793
|
+
if (key in obj) {
|
|
794
|
+
Object.defineProperty(obj, key, {
|
|
795
|
+
value: value,
|
|
796
|
+
enumerable: true,
|
|
797
|
+
configurable: true,
|
|
798
|
+
writable: true
|
|
799
|
+
});
|
|
800
|
+
} else {
|
|
801
|
+
obj[key] = value;
|
|
802
|
+
}
|
|
803
|
+
|
|
804
|
+
return obj;
|
|
805
|
+
}
|
|
806
|
+
|
|
807
|
+
var _styleModuleImportMap = {
|
|
808
|
+
"./load-more.m.css": {
|
|
809
|
+
"button": "load-more-m_button__1mmf1",
|
|
810
|
+
"default": "load-more-m_default__2_k4V",
|
|
811
|
+
"dark": "load-more-m_dark__3dfzb",
|
|
812
|
+
"light": "load-more-m_light__ePZQI"
|
|
813
|
+
}
|
|
814
|
+
};
|
|
815
|
+
|
|
816
|
+
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; }
|
|
817
|
+
|
|
818
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
819
|
+
var LoadmoreButton = function LoadmoreButton(_ref) {
|
|
820
|
+
var _ref$config = _ref.config,
|
|
821
|
+
config = _ref$config === void 0 ? {} : _ref$config,
|
|
822
|
+
collection = _ref.collection,
|
|
823
|
+
_ref$template = _ref.template,
|
|
824
|
+
template = _ref$template === void 0 ? "SubsequentLoadCount" : _ref$template,
|
|
825
|
+
onClick = _ref.onClick,
|
|
826
|
+
navigate = _ref.navigate,
|
|
827
|
+
qtConfig = _ref.qtConfig;
|
|
828
|
+
var _config$showButton = config.showButton,
|
|
829
|
+
showButton = _config$showButton === void 0 ? true : _config$showButton,
|
|
830
|
+
_config$buttonText = config.buttonText,
|
|
831
|
+
buttonText = _config$buttonText === void 0 ? "Read More" : _config$buttonText,
|
|
832
|
+
_config$theme = config.theme,
|
|
833
|
+
theme = _config$theme === void 0 ? "" : _config$theme,
|
|
834
|
+
_config$customUrlPath = config.customUrlPath,
|
|
835
|
+
customUrlPath = _config$customUrlPath === void 0 ? "" : _config$customUrlPath;
|
|
836
|
+
if (!showButton) return null;
|
|
837
|
+
var textColor = getTextColor(theme);
|
|
838
|
+
var slug = customUrlPath ? "/".concat(customUrlPath) : generateNavigateSlug(collection, _objectSpread(_objectSpread({}, qtConfig), config));
|
|
839
|
+
return template === "SubsequentLoadCount" ? /*#__PURE__*/React.createElement("div", {
|
|
840
|
+
onClick: onClick,
|
|
841
|
+
"data-test-id": "load-more",
|
|
842
|
+
className: "arr--button " + _getClassName("button ".concat(textColor, " default"), _styleModuleImportMap)
|
|
843
|
+
}, buttonText) : /*#__PURE__*/React.createElement(LinkBase, {
|
|
844
|
+
href: slug,
|
|
845
|
+
navigateTo: navigate,
|
|
846
|
+
"data-test-id": "load-more",
|
|
847
|
+
"aria-label": "load-more"
|
|
848
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
849
|
+
className: "arr--button " + _getClassName("button ".concat(textColor, " default"), _styleModuleImportMap)
|
|
850
|
+
}, buttonText));
|
|
851
|
+
};
|
|
852
|
+
LoadmoreButton.propTypes = {
|
|
853
|
+
collection: PropTypes.object,
|
|
854
|
+
template: PropTypes.string,
|
|
855
|
+
config: PropTypes.object,
|
|
856
|
+
onClick: PropTypes.func,
|
|
857
|
+
navigate: PropTypes.func,
|
|
858
|
+
qtConfig: PropTypes.object
|
|
859
|
+
};
|
|
860
|
+
|
|
861
|
+
var isClient = typeof window !== "undefined";
|
|
862
|
+
|
|
863
|
+
var hasIntersectionObserverSupport = function hasIntersectionObserverSupport() {
|
|
864
|
+
return typeof window.IntersectionObserver !== "undefined";
|
|
865
|
+
}; // import intersection observer polyfill only if on client
|
|
866
|
+
// and if not supported by browser
|
|
867
|
+
|
|
868
|
+
|
|
869
|
+
var getIntersectionObserver = function getIntersectionObserver() {
|
|
870
|
+
return Promise.resolve(isClient && !hasIntersectionObserverSupport() && import('intersection-observer'));
|
|
871
|
+
}; // options for intersection observer in order to improve the effect
|
|
872
|
+
|
|
873
|
+
|
|
874
|
+
var intersectionObserverOptions = {
|
|
875
|
+
root: null,
|
|
876
|
+
// windows viewport will be used
|
|
877
|
+
rootMargin: "200px 0px 0px 0px"
|
|
878
|
+
};
|
|
879
|
+
|
|
880
|
+
var handleIntersect = function handleIntersect(entries, observer) {
|
|
881
|
+
entries.filter(function (entry) {
|
|
882
|
+
return entry.isIntersecting;
|
|
883
|
+
}).forEach(function (entry) {
|
|
884
|
+
var target = entry.target;
|
|
885
|
+
|
|
886
|
+
target._onIntersect(observer);
|
|
887
|
+
});
|
|
888
|
+
}; // get observer from the cache or create a new one
|
|
889
|
+
|
|
890
|
+
|
|
891
|
+
var getObserver = function getObserver() {
|
|
892
|
+
return getIntersectionObserver().then(function (_) {
|
|
893
|
+
|
|
894
|
+
if (isClient) {
|
|
895
|
+
return new window.IntersectionObserver(handleIntersect, intersectionObserverOptions);
|
|
896
|
+
}
|
|
897
|
+
});
|
|
898
|
+
};
|
|
899
|
+
|
|
900
|
+
var useNearScreen = (function (_ref) {
|
|
901
|
+
var ref = _ref.ref;
|
|
902
|
+
|
|
903
|
+
var _useState = useState(false),
|
|
904
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
905
|
+
show = _useState2[0],
|
|
906
|
+
setShow = _useState2[1];
|
|
907
|
+
|
|
908
|
+
useEffect(function () {
|
|
909
|
+
var current = ref.current;
|
|
910
|
+
if (!current) return; // get observer async and only when needed
|
|
911
|
+
|
|
912
|
+
getObserver().then(function (observer) {
|
|
913
|
+
return observer.observe(current);
|
|
914
|
+
}); // mutate the current target to add a method to be executed when intersecting
|
|
915
|
+
|
|
916
|
+
current._onIntersect = function (observer) {
|
|
917
|
+
setShow(true);
|
|
918
|
+
observer.unobserve(current);
|
|
919
|
+
}; // clean observed element when unmounted
|
|
920
|
+
|
|
921
|
+
|
|
922
|
+
return function () {
|
|
923
|
+
return current._isSubscribed = false;
|
|
924
|
+
};
|
|
925
|
+
}, [ref]);
|
|
926
|
+
return show;
|
|
927
|
+
});
|
|
928
|
+
|
|
929
|
+
var EMPTY_HTML = {
|
|
930
|
+
__html: ""
|
|
931
|
+
};
|
|
932
|
+
var isServer = typeof window === "undefined";
|
|
933
|
+
var ProgressiveHydration = function ProgressiveHydration(props) {
|
|
934
|
+
var children = props.children;
|
|
935
|
+
var ref = useRef(null);
|
|
936
|
+
var isNearScreen = useNearScreen({
|
|
937
|
+
ref: ref
|
|
938
|
+
});
|
|
939
|
+
useEffect(function () {
|
|
940
|
+
var el = ref.current; // CLIENT:
|
|
941
|
+
// If we want to force the hydration OR the element is near screen
|
|
942
|
+
// then we hydrate the content to get the functionality ready
|
|
943
|
+
|
|
944
|
+
if (isNearScreen) {
|
|
945
|
+
var action = el.hasChildNodes() ? "hydrate" : "render";
|
|
946
|
+
ReactDOM[action](children, el);
|
|
947
|
+
}
|
|
948
|
+
}, [children, isNearScreen]); // SERVER: Just render the content as usual
|
|
949
|
+
|
|
950
|
+
if (isServer) {
|
|
951
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
952
|
+
ref: ref
|
|
953
|
+
}, children);
|
|
954
|
+
} // CLIENT: Avoid hydration until we say so
|
|
955
|
+
|
|
956
|
+
|
|
957
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
958
|
+
ref: ref,
|
|
959
|
+
suppressHydrationWarning: true,
|
|
960
|
+
dangerouslySetInnerHTML: EMPTY_HTML
|
|
961
|
+
});
|
|
962
|
+
};
|
|
963
|
+
ProgressiveHydration.propTypes = {
|
|
964
|
+
children: PropTypes.element
|
|
965
|
+
};
|
|
966
|
+
|
|
967
|
+
var LoadMoreTarget = function LoadMoreTarget(_ref) {
|
|
968
|
+
var collection = _ref.collection,
|
|
969
|
+
componentName = _ref.componentName,
|
|
970
|
+
offset = _ref.offset,
|
|
971
|
+
limit = _ref.limit;
|
|
972
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
973
|
+
id: "ELM-".concat(collection.id),
|
|
974
|
+
"data-collection-slug": collection["slug"],
|
|
975
|
+
"data-component-name": componentName,
|
|
976
|
+
"data-collection-offset": offset,
|
|
977
|
+
"data-collection-limit": limit
|
|
978
|
+
});
|
|
979
|
+
};
|
|
980
|
+
LoadMoreTarget.propTypes = {
|
|
981
|
+
collection: PropTypes.shape({
|
|
982
|
+
id: PropTypes.string,
|
|
983
|
+
slug: PropTypes.string
|
|
984
|
+
}),
|
|
985
|
+
componentName: PropTypes.string,
|
|
986
|
+
offset: PropTypes.number,
|
|
987
|
+
limit: PropTypes.number
|
|
988
|
+
};
|
|
989
|
+
|
|
990
|
+
export { AuthorWithTime as A, CollectionName as C, Headline as H, LoadMoreTarget as L, ProgressiveHydration as P, StateProvider as S, _defineProperty as _, LoadmoreButton as a, Author as b, useStateValue as u };
|