@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.
Files changed (167) hide show
  1. package/atoms/Author/index.js +2250 -0
  2. package/{Author → atoms/Author}/styles.arrow.css +0 -0
  3. package/atoms/AuthorWithTime/index.js +2954 -0
  4. package/{AuthorWithTime → atoms/AuthorWithTime}/styles.arrow.css +0 -0
  5. package/atoms/CollectionName/index.js +2334 -0
  6. package/{CollectionName → atoms/CollectionName}/styles.arrow.css +0 -0
  7. package/atoms/ExtendedLoadMore/index-2d713010.js +166 -0
  8. package/atoms/ExtendedLoadMore/index-4191a84c.js +240 -0
  9. package/atoms/ExtendedLoadMore/index-5a7900ba.js +181 -0
  10. package/atoms/ExtendedLoadMore/index-6cb56d1a.js +350 -0
  11. package/atoms/ExtendedLoadMore/index-6daa674c.js +282 -0
  12. package/atoms/ExtendedLoadMore/index-6f8c780e.js +243 -0
  13. package/atoms/ExtendedLoadMore/index-7eb05b3d.js +199 -0
  14. package/atoms/ExtendedLoadMore/index-8345922c.js +175 -0
  15. package/atoms/ExtendedLoadMore/index-99af722e.js +175 -0
  16. package/atoms/ExtendedLoadMore/index-aa8b8ab8.js +990 -0
  17. package/atoms/ExtendedLoadMore/index-c8f346d0.js +223 -0
  18. package/atoms/ExtendedLoadMore/index-e39b3ca8.js +3023 -0
  19. package/atoms/ExtendedLoadMore/index-f6e578e3.js +86 -0
  20. package/atoms/ExtendedLoadMore/index.js +5 -0
  21. package/atoms/ExtendedLoadMore/styles.arrow.css +1 -0
  22. package/atoms/Headline/index.js +2459 -0
  23. package/{Headline → atoms/Headline}/styles.arrow.css +0 -0
  24. package/atoms/HeroImage/index.js +2475 -0
  25. package/{HeroImage → atoms/HeroImage}/styles.arrow.css +0 -0
  26. package/atoms/LoadmoreButton/index.js +2268 -0
  27. package/{LoadmoreButton → atoms/LoadmoreButton}/styles.arrow.css +0 -0
  28. package/atoms/ScrollSnap/index.js +2531 -0
  29. package/{ScrollSnap → atoms/ScrollSnap}/styles.arrow.css +0 -0
  30. package/atoms/SectionTag/index.js +2220 -0
  31. package/{SectionTag → atoms/SectionTag}/styles.arrow.css +0 -0
  32. package/atoms/Subheadline/index.js +2200 -0
  33. package/{Subheadline → atoms/Subheadline}/styles.arrow.css +0 -0
  34. package/atoms/TimeStamp/index.js +2661 -0
  35. package/{TimeStamp → atoms/TimeStamp}/styles.arrow.css +0 -0
  36. package/molecules/KeyEvents/index.js +2968 -0
  37. package/{KeyEvents → molecules/KeyEvents}/styles.arrow.css +0 -0
  38. package/molecules/PageIntroductionCard/index.js +2676 -0
  39. package/{PageIntroductionCard → molecules/PageIntroductionCard}/styles.arrow.css +0 -0
  40. package/molecules/SocialShareTemplate/index.js +3093 -0
  41. package/{SocialShareTemplate → molecules/SocialShareTemplate}/styles.arrow.css +0 -0
  42. package/molecules/StoryCard/index.js +3938 -0
  43. package/{StoryCard → molecules/StoryCard}/styles.arrow.css +0 -0
  44. package/molecules/StoryElementCard/index.js +5832 -0
  45. package/{StoryElementCard → molecules/StoryElementCard}/styles.arrow.css +0 -0
  46. package/molecules/StorycardContent/index.js +3416 -0
  47. package/{StorycardContent → molecules/StorycardContent}/styles.arrow.css +0 -0
  48. package/package.json +1 -1
  49. package/rows/AlternateCollectionFilter/index.js +4744 -0
  50. package/{AlternateCollectionFilter → rows/AlternateCollectionFilter}/styles.arrow.css +0 -0
  51. package/rows/AsideCollection/index.js +4690 -0
  52. package/{AsideCollection → rows/AsideCollection}/styles.arrow.css +0 -0
  53. package/rows/AstrologyCollection/index.js +4661 -0
  54. package/{AstrologyCollection → rows/AstrologyCollection}/styles.arrow.css +0 -0
  55. package/rows/AuthorIntroductionCard/index.js +3520 -0
  56. package/{AuthorIntroductionCard → rows/AuthorIntroductionCard}/styles.arrow.css +0 -0
  57. package/rows/AuthorsList/index.js +3715 -0
  58. package/{AuthorsList → rows/AuthorsList}/styles.arrow.css +0 -0
  59. package/rows/CollectionFilter/index.js +4834 -0
  60. package/{CollectionFilter → rows/CollectionFilter}/styles.arrow.css +0 -0
  61. package/rows/ElevenStories/index.js +4638 -0
  62. package/{ElevenStories → rows/ElevenStories}/styles.arrow.css +0 -0
  63. package/rows/FourColFiveStories/index.js +4359 -0
  64. package/{FourColFiveStories → rows/FourColFiveStories}/styles.arrow.css +0 -0
  65. package/rows/FourColGrid/index.js +4584 -0
  66. package/{FourColGrid → rows/FourColGrid}/styles.arrow.css +0 -0
  67. package/rows/FourColPortraitStories/index.js +4617 -0
  68. package/{FourColPortraitStories → rows/FourColPortraitStories}/styles.arrow.css +0 -0
  69. package/rows/FourColSixteenStories/index.js +4375 -0
  70. package/{FourColSixteenStories → rows/FourColSixteenStories}/styles.arrow.css +0 -0
  71. package/rows/FourColTwelveStories/index.js +4335 -0
  72. package/{FourColTwelveStories → rows/FourColTwelveStories}/styles.arrow.css +0 -0
  73. package/rows/FourStorySlider/index.js +4743 -0
  74. package/{FourStorySlider → rows/FourStorySlider}/styles.arrow.css +0 -0
  75. package/rows/FourStorySliderPortrait/index.js +4746 -0
  76. package/{FourStorySliderPortrait → rows/FourStorySliderPortrait}/styles.arrow.css +1 -1
  77. package/rows/FourTabbedBigStorySlider/index.js +4505 -0
  78. package/{FourTabbedBigStorySlider → rows/FourTabbedBigStorySlider}/styles.arrow.css +0 -0
  79. package/rows/FullScreenSlider/index.js +4661 -0
  80. package/{FullScreenSlider → rows/FullScreenSlider}/styles.arrow.css +0 -0
  81. package/rows/HalfScreenSlider/index.js +4514 -0
  82. package/{HalfScreenSlider → rows/HalfScreenSlider}/styles.arrow.css +0 -0
  83. package/rows/ListComponent/index.js +4462 -0
  84. package/{ListComponent → rows/ListComponent}/styles.arrow.css +0 -0
  85. package/rows/Listicles/index.js +3131 -0
  86. package/{Listicles → rows/Listicles}/styles.arrow.css +0 -0
  87. package/rows/MagazineEditions/index.js +3142 -0
  88. package/{MagazineEditions → rows/MagazineEditions}/styles.arrow.css +0 -0
  89. package/rows/MagazineHeaderCard/index.js +3136 -0
  90. package/{MagazineHeaderCard → rows/MagazineHeaderCard}/styles.arrow.css +0 -0
  91. package/rows/MagazineWidget/index.js +4514 -0
  92. package/{MagazineWidget → rows/MagazineWidget}/styles.arrow.css +0 -0
  93. package/rows/OneColStoryList/index.js +4670 -0
  94. package/{OneColStoryList → rows/OneColStoryList}/styles.arrow.css +0 -0
  95. package/rows/OpinionCollection/index.js +4037 -0
  96. package/{OpinionCollection → rows/OpinionCollection}/styles.arrow.css +0 -0
  97. package/rows/SixColSixStories/index.js +4515 -0
  98. package/{SixColSixStories → rows/SixColSixStories}/styles.arrow.css +0 -0
  99. package/rows/StoryCollection/index.js +4690 -0
  100. package/{StoryCollection → rows/StoryCollection}/styles.arrow.css +0 -0
  101. package/rows/TagIntroductionCard/index.js +1901 -0
  102. package/{TagIntroductionCard → rows/TagIntroductionCard}/styles.arrow.css +0 -0
  103. package/rows/ThreeColFlexStories/index.js +4575 -0
  104. package/{ThreeColFlexStories → rows/ThreeColFlexStories}/styles.arrow.css +0 -0
  105. package/rows/ThreeColFourteenStories/index.js +4283 -0
  106. package/{ThreeColFourteenStories → rows/ThreeColFourteenStories}/styles.arrow.css +0 -0
  107. package/rows/ThreeColGrid/index.js +4605 -0
  108. package/{ThreeColGrid → rows/ThreeColGrid}/styles.arrow.css +0 -0
  109. package/rows/ThreeColSevenStory/index.js +4502 -0
  110. package/{ThreeColSevenStory → rows/ThreeColSevenStory}/styles.arrow.css +0 -0
  111. package/rows/ThreeColSixStories/index.js +4485 -0
  112. package/{ThreeColSixStories → rows/ThreeColSixStories}/styles.arrow.css +0 -0
  113. package/rows/ThreeColTwelveStories/index.js +4380 -0
  114. package/{ThreeColTwelveStories → rows/ThreeColTwelveStories}/styles.arrow.css +0 -0
  115. package/rows/TwoColFourStories/index.js +4463 -0
  116. package/{TwoColFourStories → rows/TwoColFourStories}/styles.arrow.css +0 -0
  117. package/rows/TwoColFourStoryHighlight/index.js +4456 -0
  118. package/{TwoColFourStoryHighlight → rows/TwoColFourStoryHighlight}/styles.arrow.css +0 -0
  119. package/rows/TwoColSevenStories/index.js +4490 -0
  120. package/{TwoColSevenStories → rows/TwoColSevenStories}/styles.arrow.css +0 -0
  121. package/rows/TwoColSixStories/index.js +4489 -0
  122. package/{TwoColSixStories → rows/TwoColSixStories}/styles.arrow.css +0 -0
  123. package/rows/TwoColTenStoriesSidebar/index.js +4549 -0
  124. package/{TwoColTenStoriesSidebar → rows/TwoColTenStoriesSidebar}/styles.arrow.css +0 -0
  125. package/rows/TwoColThreeStories/index.js +4436 -0
  126. package/{TwoColThreeStories → rows/TwoColThreeStories}/styles.arrow.css +0 -0
  127. package/story-elements/AlsoRead/index.js +2457 -0
  128. package/{AlsoRead → story-elements/AlsoRead}/styles.arrow.css +0 -0
  129. package/story-elements/Attachment/index.js +2013 -0
  130. package/{Attachment → story-elements/Attachment}/styles.arrow.css +0 -0
  131. package/story-elements/BigFact/index.js +1983 -0
  132. package/{BigFact → story-elements/BigFact}/styles.arrow.css +0 -0
  133. package/story-elements/BlockQuote/index.js +2431 -0
  134. package/{BlockQuote → story-elements/BlockQuote}/styles.arrow.css +0 -0
  135. package/story-elements/Blurb/index.js +2094 -0
  136. package/{Blurb → story-elements/Blurb}/styles.arrow.css +0 -0
  137. package/story-elements/Image/index.js +2711 -0
  138. package/{Image → story-elements/Image}/styles.arrow.css +0 -0
  139. package/story-elements/ImageGallery/index.js +2644 -0
  140. package/{ImageGallery → story-elements/ImageGallery}/styles.arrow.css +0 -0
  141. package/story-elements/ImageSlideshow/index.js +2955 -0
  142. package/{ImageSlideshow → story-elements/ImageSlideshow}/styles.arrow.css +0 -0
  143. package/story-elements/QuestionAnswer/index.js +2395 -0
  144. package/{QuestionAnswer → story-elements/QuestionAnswer}/styles.arrow.css +0 -0
  145. package/story-elements/Quote/index.js +2012 -0
  146. package/{Quote → story-elements/Quote}/styles.arrow.css +0 -0
  147. package/story-elements/Reference/index.js +2006 -0
  148. package/{Reference → story-elements/Reference}/styles.arrow.css +0 -0
  149. package/story-elements/StoryElement/index.js +1779 -0
  150. package/story-elements/Summary/index.js +2036 -0
  151. package/{Summary → story-elements/Summary}/styles.arrow.css +0 -0
  152. package/story-elements/Text/index.js +2293 -0
  153. package/{Text → story-elements/Text}/styles.arrow.css +0 -0
  154. package/story-elements/Video/index.js +1785 -0
  155. package/{Video → story-elements/Video}/styles.arrow.css +0 -0
  156. package/story-templates/ListicleStoryTemplate/index.js +8442 -0
  157. package/{ListicleStoryTemplate → story-templates/ListicleStoryTemplate}/styles.arrow.css +0 -0
  158. package/story-templates/LiveBlogStoryTemplate/index.js +8618 -0
  159. package/{LiveBlogStoryTemplate → story-templates/LiveBlogStoryTemplate}/styles.arrow.css +0 -0
  160. package/story-templates/PhotoStoryTemplate/index.js +8420 -0
  161. package/{PhotoStoryTemplate → story-templates/PhotoStoryTemplate}/styles.arrow.css +0 -0
  162. package/story-templates/TextStoryTemplate/index.js +8493 -0
  163. package/{TextStoryTemplate → story-templates/TextStoryTemplate}/styles.arrow.css +0 -0
  164. package/story-templates/VideoStoryTemplate/index.js +8352 -0
  165. package/{VideoStoryTemplate → story-templates/VideoStoryTemplate}/styles.arrow.css +0 -0
  166. package/cjs/index.js +0 -1
  167. package/esm/index.js +0 -1
@@ -0,0 +1,243 @@
1
+ import { a as get_1, g as getTextColor, _ as _getClassName, t as truncate, i as isEmpty, r as rgbToHex } from './index-e39b3ca8.js';
2
+ import React from 'react';
3
+ import { u as useStateValue, H as Headline, A as AuthorWithTime } from './index-aa8b8ab8.js';
4
+ import PropTypes from 'prop-types';
5
+ import { H as HeroImage, S as SectionTag } from './index-6cb56d1a.js';
6
+
7
+ var _styleModuleImportMap$1 = {
8
+ "./subheadline.m.css": {
9
+ "subheadline": "subheadline-m_subheadline__3fd7z",
10
+ "dark": "subheadline-m_dark__28u00",
11
+ "light": "subheadline-m_light__2YUOe"
12
+ }
13
+ };
14
+ var Subheadline = function Subheadline(_ref) {
15
+ var story = _ref.story,
16
+ _ref$truncateChars = _ref.truncateChars,
17
+ truncateChars = _ref$truncateChars === void 0 ? 200 : _ref$truncateChars,
18
+ lineClamp = _ref.lineClamp,
19
+ _ref$clazzName = _ref.clazzName,
20
+ clazzName = _ref$clazzName === void 0 ? "" : _ref$clazzName,
21
+ forceShowAtom = _ref.forceShowAtom,
22
+ showFullContent = _ref.showFullContent;
23
+ var config = useStateValue() || {};
24
+ var subheadline = forceShowAtom || get_1(config, ["showSubheadline"], true);
25
+ if (!subheadline) return null;
26
+ var textColor = getTextColor(config.theme);
27
+ return /*#__PURE__*/React.createElement("div", {
28
+ style: {
29
+ WebkitLineClamp: lineClamp
30
+ },
31
+ "data-test-id": "subheadline",
32
+ className: ("p-alt arr--sub-headline arrow-component ".concat(clazzName) ? "p-alt arr--sub-headline arrow-component ".concat(clazzName) + " " : "") + _getClassName("subheadline ".concat(textColor), _styleModuleImportMap$1)
33
+ }, showFullContent || typeof lineClamp === "number" ? story.subheadline : truncate(story.subheadline, truncateChars, true));
34
+ };
35
+ Subheadline.propTypes = {
36
+ /** The Story Object from the API response */
37
+ story: PropTypes.object.isRequired,
38
+ // Restricts the number of lines for subheadline.
39
+ lineClamp: PropTypes.number,
40
+
41
+ /** Number of characters to truncate the subheadline */
42
+ truncateChars: PropTypes.number,
43
+ clazzName: PropTypes.string,
44
+ forceShowAtom: PropTypes.bool,
45
+ showFullContent: PropTypes.bool
46
+ };
47
+ Subheadline.defaultProps = {
48
+ forceShowAtom: false,
49
+ showFullContent: false
50
+ };
51
+
52
+ var _styleModuleImportMap = {
53
+ "./storycard.m.css": {
54
+ "author-timestamp-wrapper": "storycard-m_author-timestamp-wrapper__20yjp",
55
+ "default-card": "storycard-m_default-card__1-POn",
56
+ "horizontal-card": "storycard-m_horizontal-card___7afz",
57
+ "backgroung-img": "storycard-m_backgroung-img__1FMJT",
58
+ "content-overlap": "storycard-m_content-overlap__1yNHR",
59
+ "border-full": "storycard-m_border-full__1nhy7",
60
+ "light": "storycard-m_light__3EhXN",
61
+ "dark": "storycard-m_dark__2wCTq",
62
+ "border-bottom": "storycard-m_border-bottom__2_E-I",
63
+ "border-boxShadow": "storycard-m_border-boxShadow__2-k3Z",
64
+ "center-align": "storycard-m_center-align__1Sn8-",
65
+ "content-bottom": "storycard-m_content-bottom__1QHeC",
66
+ "content-full": "storycard-m_content-full__2zJmU",
67
+ "content-boxShadow": "storycard-m_content-boxShadow__2IAWZ",
68
+ "hero-image": "storycard-m_hero-image__1H3MB",
69
+ "right-padding": "storycard-m_right-padding__12-lQ",
70
+ "horizontal-mob": "storycard-m_horizontal-mob__17JG2",
71
+ "content": "storycard-m_content__1Q9vq",
72
+ "border-default": "storycard-m_border-default__PEZ1x",
73
+ "card": "storycard-m_card__KJwRa",
74
+ "horizontal-image-last": "storycard-m_horizontal-image-last__3o6LY"
75
+ }
76
+ };
77
+ var StoryCard = function StoryCard(_ref) {
78
+ var story = _ref.story,
79
+ children = _ref.children,
80
+ isHorizontal = _ref.isHorizontal,
81
+ aspectRatio = _ref.aspectRatio,
82
+ border = _ref.border,
83
+ useImageAsBackground = _ref.useImageAsBackground,
84
+ bgImgContentOverlap = _ref.bgImgContentOverlap,
85
+ theme = _ref.theme,
86
+ borderColor = _ref.borderColor,
87
+ isHorizontalMobile = _ref.isHorizontalMobile,
88
+ centerAlign = _ref.centerAlign,
89
+ headerLevel = _ref.headerLevel,
90
+ hideAuthorImage = _ref.hideAuthorImage,
91
+ prefix = _ref.prefix,
92
+ config = _ref.config,
93
+ isHorizontalWithImageLast = _ref.isHorizontalWithImageLast;
94
+ if (!story || isEmpty(story)) return /*#__PURE__*/React.createElement("div", null);
95
+ var borderOptions = ["default", "full", "bottom", "boxShadow"];
96
+ var borderTemplate = borderOptions.includes(border) ? "border-".concat(border) : ""; // TODO optimize conditions
97
+
98
+ var horizontalCardStyle = "default-card";
99
+ if (isHorizontal) horizontalCardStyle = "horizontal-card";else if (isHorizontalWithImageLast) horizontalCardStyle = "horizontal-image-last";
100
+ var bgImageClasses = useImageAsBackground ? "backgroung-img" : "";
101
+ var bgImgContentOverlapClass = bgImgContentOverlap ? "content-overlap" : "";
102
+ var textColor = getTextColor(theme);
103
+ var horizontalMobileClasses = isHorizontalMobile ? "horizontal-mob" : "";
104
+ var defaultStorycard = /*#__PURE__*/React.createElement(DefaultStoryCard, {
105
+ story: story,
106
+ aspectRatio: aspectRatio,
107
+ border: border,
108
+ isHorizontalMobile: isHorizontalMobile,
109
+ isHorizontal: isHorizontal,
110
+ centerAlign: centerAlign,
111
+ headerLevel: headerLevel,
112
+ borderColor: borderColor,
113
+ hideAuthorImage: hideAuthorImage,
114
+ prefix: prefix,
115
+ config: config,
116
+ isHorizontalWithImageLast: isHorizontalWithImageLast
117
+ });
118
+ return /*#__PURE__*/React.createElement("div", {
119
+ "data-test-id": "story-card",
120
+ style: {
121
+ backgroundColor: theme,
122
+ color: textColor
123
+ },
124
+ className: "arr--story-card " + _getClassName("card ".concat(horizontalCardStyle, " ").concat(borderTemplate, " ").concat(textColor, " ").concat(bgImageClasses, " ").concat(bgImgContentOverlapClass, " ").concat(horizontalMobileClasses), _styleModuleImportMap)
125
+ }, children || defaultStorycard);
126
+ };
127
+
128
+ var DefaultStoryCard = function DefaultStoryCard(_ref2) {
129
+ var story = _ref2.story;
130
+ _ref2.border;
131
+ var isHorizontal = _ref2.isHorizontal,
132
+ aspectRatio = _ref2.aspectRatio,
133
+ headerLevel = _ref2.headerLevel,
134
+ _ref2$isHorizontalMob = _ref2.isHorizontalMobile,
135
+ isHorizontalMobile = _ref2$isHorizontalMob === void 0 ? false : _ref2$isHorizontalMob,
136
+ _ref2$centerAlign = _ref2.centerAlign,
137
+ centerAlign = _ref2$centerAlign === void 0 ? false : _ref2$centerAlign,
138
+ borderColor = _ref2.borderColor,
139
+ hideAuthorImage = _ref2.hideAuthorImage,
140
+ prefix = _ref2.prefix,
141
+ isHorizontalWithImageLast = _ref2.isHorizontalWithImageLast,
142
+ config = _ref2.config;
143
+ var alignment = centerAlign ? "center-align" : "";
144
+ var SectionTagborderColor = rgbToHex(borderColor);
145
+ var _config$localizationC = config.localizationConfig,
146
+ localizationConfig = _config$localizationC === void 0 ? {} : _config$localizationC;
147
+ return /*#__PURE__*/React.createElement(React.Fragment, null, isHorizontal ? /*#__PURE__*/React.createElement(HeroImage, {
148
+ config: config,
149
+ story: story,
150
+ isHorizontal: true,
151
+ isHorizontalMobile: isHorizontalMobile,
152
+ aspectRatio: aspectRatio
153
+ }) : isHorizontalWithImageLast ? /*#__PURE__*/React.createElement(HeroImage, {
154
+ config: config,
155
+ story: story,
156
+ isHorizontalWithImageLast: true,
157
+ isHorizontalMobile: isHorizontalMobile,
158
+ aspectRatio: aspectRatio
159
+ }) : /*#__PURE__*/React.createElement(HeroImage, {
160
+ story: story,
161
+ config: config,
162
+ isHorizontalMobile: isHorizontalMobile,
163
+ aspectRatio: aspectRatio
164
+ }), /*#__PURE__*/React.createElement("div", {
165
+ className: "arr--story-content " + _getClassName("content ".concat(alignment), _styleModuleImportMap)
166
+ }, /*#__PURE__*/React.createElement(SectionTag, {
167
+ story: story,
168
+ borderColor: SectionTagborderColor
169
+ }), /*#__PURE__*/React.createElement(Headline, {
170
+ story: story,
171
+ headerLevel: headerLevel,
172
+ premiumStoryIconConfig: config
173
+ }), /*#__PURE__*/React.createElement(AuthorWithTime, {
174
+ config: localizationConfig,
175
+ story: story,
176
+ isBottom: true,
177
+ prefix: prefix,
178
+ hideAuthorImage: hideAuthorImage
179
+ }), /*#__PURE__*/React.createElement(Subheadline, {
180
+ story: story
181
+ })));
182
+ };
183
+
184
+ DefaultStoryCard.propTypes = {
185
+ story: PropTypes.object.isRequired,
186
+ border: PropTypes.oneOfType([PropTypes.string]),
187
+ isBottom: PropTypes.bool,
188
+ isHorizontal: PropTypes.bool,
189
+ aspectRatio: PropTypes.oneOfType([PropTypes.array]),
190
+ isHorizontalMobile: PropTypes.bool,
191
+ centerAlign: PropTypes.bool,
192
+ headerLevel: PropTypes.string,
193
+ borderColor: PropTypes.string,
194
+ hideAuthorImage: PropTypes.bool,
195
+ prefix: PropTypes.string,
196
+ config: PropTypes.object,
197
+ isHorizontalWithImageLast: PropTypes.bool
198
+ };
199
+ StoryCard.propTypes = {
200
+ /** The Story Object from the API response */
201
+ story: PropTypes.object.isRequired,
202
+ children: PropTypes.node,
203
+
204
+ /** Flip the Story Card to Horizonal mode */
205
+ isHorizontal: PropTypes.bool,
206
+
207
+ /** Add border to the Story Card */
208
+ border: PropTypes.oneOfType([PropTypes.string]),
209
+ // story card with background image
210
+ useImageAsBackground: PropTypes.bool,
211
+ // story card content overlap with image
212
+ bgImgContentOverlap: PropTypes.bool,
213
+
214
+ /** add aspect ratio for hero image */
215
+ aspectRatio: PropTypes.oneOfType([PropTypes.array]),
216
+
217
+ /** add theme(dark /light/custom color) for storycard */
218
+ theme: PropTypes.string,
219
+
220
+ /** flip the story card mobile design horizontal */
221
+ isHorizontalMobile: PropTypes.bool,
222
+ // make content center align in desktop and left align in mobile
223
+ centerAlign: PropTypes.bool,
224
+ headerLevel: PropTypes.string,
225
+ borderColor: PropTypes.string,
226
+ // handle author image through storycard
227
+ hideAuthorImage: PropTypes.bool,
228
+ // handle author prefix through storycard
229
+ prefix: PropTypes.string,
230
+ config: PropTypes.object,
231
+ isHorizontalWithImageLast: PropTypes.bool
232
+ };
233
+ StoryCard.defaultProps = {
234
+ isHorizontal: false,
235
+ isHorizontalMobile: false,
236
+ border: "default",
237
+ theme: "",
238
+ centerAlign: false,
239
+ borderColor: "",
240
+ isHorizontalWithImageLast: false
241
+ };
242
+
243
+ export { StoryCard as S, Subheadline as a };
@@ -0,0 +1,199 @@
1
+ import React from 'react';
2
+ import { useDispatch, useSelector } from 'react-redux';
3
+ import { i as isEmpty, g as getTextColor, a as get_1, b as generateNavigateSlug, n as navigateTo } from './index-e39b3ca8.js';
4
+ import PropTypes from 'prop-types';
5
+ import { collectionToStories } from '@quintype/components';
6
+ import { S as StateProvider, C as CollectionName, L as LoadMoreTarget, P as ProgressiveHydration, a as LoadmoreButton } from './index-aa8b8ab8.js';
7
+ import { S as StoryCard } from './index-6f8c780e.js';
8
+ import { S as StorycardContent } from './index-f6e578e3.js';
9
+ import { H as HeroImage } from './index-6cb56d1a.js';
10
+ import 'react-timeago';
11
+ import 'date-fns-tz';
12
+ import 'react-dom';
13
+
14
+ var PortraitStoryCardBase = function PortraitStoryCardBase(_ref) {
15
+ var story = _ref.story,
16
+ _ref$border = _ref.border,
17
+ border = _ref$border === void 0 ? "" : _ref$border,
18
+ _ref$theme = _ref.theme,
19
+ theme = _ref$theme === void 0 ? "" : _ref$theme,
20
+ _ref$headerLevel = _ref.headerLevel,
21
+ headerLevel = _ref$headerLevel === void 0 ? "6" : _ref$headerLevel,
22
+ _ref$separator = _ref.separator,
23
+ separator = _ref$separator === void 0 ? "" : _ref$separator,
24
+ _ref$config = _ref.config,
25
+ config = _ref$config === void 0 ? {} : _ref$config,
26
+ _ref$borderColor = _ref.borderColor,
27
+ borderColor = _ref$borderColor === void 0 ? "" : _ref$borderColor;
28
+ if (isEmpty(story)) return null;
29
+ return /*#__PURE__*/React.createElement("div", {
30
+ className: "portrait-story-card-m_wrapper__3nche"
31
+ }, /*#__PURE__*/React.createElement(StoryCard, {
32
+ story: story,
33
+ border: border,
34
+ theme: theme,
35
+ config: config,
36
+ useImageAsBackground: true
37
+ }, /*#__PURE__*/React.createElement(HeroImage, {
38
+ story: story,
39
+ aspectRatio: [[9, 16]]
40
+ }), /*#__PURE__*/React.createElement(StorycardContent, {
41
+ story: story,
42
+ config: config,
43
+ separator: separator,
44
+ borderColor: borderColor,
45
+ headerLevel: headerLevel
46
+ })));
47
+ };
48
+ PortraitStoryCardBase.propTypes = {
49
+ border: PropTypes.string,
50
+ theme: PropTypes.string,
51
+ headerLevel: PropTypes.string,
52
+ separator: PropTypes.string,
53
+ borderColor: PropTypes.string,
54
+ config: PropTypes.object,
55
+ story: PropTypes.object
56
+ };
57
+ var PortraitStoryCard = StateProvider(PortraitStoryCardBase);
58
+
59
+ var loadMore = function loadMore(_ref) {
60
+ var isLoading = _ref.isLoading,
61
+ storyItems = _ref.storyItems,
62
+ getMoreStories = _ref.getMoreStories,
63
+ _ref$subsequentLoadCo = _ref.subsequentLoadCount,
64
+ subsequentLoadCount = _ref$subsequentLoadCo === void 0 ? 4 : _ref$subsequentLoadCo;
65
+ if (isLoading) return; // prevent multiple clicks/calls
66
+
67
+ var limit = subsequentLoadCount;
68
+ var offset = storyItems.length;
69
+ getMoreStories(offset, limit);
70
+ };
71
+
72
+ var FourColPortraitStoriesBase = function FourColPortraitStoriesBase(_ref2) {
73
+ var collection = _ref2.collection,
74
+ _ref2$config = _ref2.config,
75
+ config = _ref2$config === void 0 ? {} : _ref2$config,
76
+ getMoreStories = _ref2.getMoreStories,
77
+ isLoadMoreVisible = _ref2.isLoadMoreVisible,
78
+ isLoading = _ref2.isLoading,
79
+ isolatedLoadMore = _ref2.isolatedLoadMore;
80
+ var storyItems = collectionToStories(collection);
81
+ if (!storyItems.length) return null;
82
+ var _config$collectionNam = config.collectionNameBorderColor,
83
+ collectionNameBorderColor = _config$collectionNam === void 0 ? "" : _config$collectionNam,
84
+ _config$borderColor = config.borderColor,
85
+ borderColor = _config$borderColor === void 0 ? "" : _config$borderColor,
86
+ _config$theme = config.theme,
87
+ theme = _config$theme === void 0 ? "" : _config$theme,
88
+ _config$border = config.border,
89
+ border = _config$border === void 0 ? "" : _config$border,
90
+ _config$collectionNam2 = config.collectionNameTemplate,
91
+ collectionNameTemplate = _config$collectionNam2 === void 0 ? "" : _config$collectionNam2,
92
+ _config$footerSlotCon = config.footerSlotConfig,
93
+ footerSlotConfig = _config$footerSlotCon === void 0 ? {} : _config$footerSlotCon,
94
+ _config$footerButton = config.footerButton,
95
+ footerButton = _config$footerButton === void 0 ? "" : _config$footerButton,
96
+ customCollectionName = config.customCollectionName,
97
+ _config$navigate = config.navigate,
98
+ navigate = _config$navigate === void 0 ? true : _config$navigate,
99
+ _config$subsequentLoa = config.subsequentLoadCount,
100
+ subsequentLoadCount = _config$subsequentLoa === void 0 ? 4 : _config$subsequentLoa;
101
+ var footerSlot = footerSlotConfig.footerSlot;
102
+ var footerSlotComp = typeof footerSlot === "function" ? footerSlot() : null;
103
+ var textColor = getTextColor(theme);
104
+ var dispatch = useDispatch();
105
+ var qtConfig = useSelector(function (state) {
106
+ return get_1(state, ["qt", "config"], {});
107
+ });
108
+
109
+ var getLoadMore = function getLoadMore(opts) {
110
+ if (!isLoadMoreVisible) return null;
111
+
112
+ if (isolatedLoadMore) {
113
+ return /*#__PURE__*/React.createElement(LoadMoreTarget, {
114
+ collection: collection,
115
+ componentName: "FourColPortraitStories",
116
+ offset: storyItems.length,
117
+ limit: subsequentLoadCount
118
+ });
119
+ }
120
+
121
+ var url = generateNavigateSlug(collection, qtConfig);
122
+ return /*#__PURE__*/React.createElement(ProgressiveHydration, null, /*#__PURE__*/React.createElement(LoadmoreButton, {
123
+ config: config,
124
+ collection: collection,
125
+ template: footerButton,
126
+ onClick: function onClick() {
127
+ return loadMore(opts);
128
+ },
129
+ navigate: function navigate() {
130
+ return navigateTo(dispatch, url);
131
+ },
132
+ qtConfig: qtConfig
133
+ }));
134
+ };
135
+
136
+ return /*#__PURE__*/React.createElement("div", {
137
+ className: "full-width-with-padding arrow-component",
138
+ "data-test-id": "four-col-portrait-stories",
139
+ style: {
140
+ backgroundColor: theme,
141
+ color: textColor
142
+ }
143
+ }, /*#__PURE__*/React.createElement("div", {
144
+ className: "four-col-portrait-stories-m_four-col-portrait__AtWub"
145
+ }, /*#__PURE__*/React.createElement(CollectionName, {
146
+ collection: collection,
147
+ collectionNameTemplate: collectionNameTemplate,
148
+ collectionNameBorderColor: collectionNameBorderColor,
149
+ customCollectionName: customCollectionName,
150
+ navigate: navigate
151
+ }), /*#__PURE__*/React.createElement("div", {
152
+ className: "four-col-portrait-stories-m_wrapper__1BX02"
153
+ }, storyItems.map(function (story, index) {
154
+ return /*#__PURE__*/React.createElement(PortraitStoryCard, {
155
+ story: story,
156
+ border: border,
157
+ theme: theme,
158
+ config: Object.assign({
159
+ showSection: false,
160
+ showAuthor: false,
161
+ showReadTime: false
162
+ }, config),
163
+ borderColor: borderColor,
164
+ key: "story-card-".concat(index)
165
+ });
166
+ })), getLoadMore({
167
+ isLoading: isLoading,
168
+ storyItems: storyItems,
169
+ getMoreStories: getMoreStories,
170
+ subsequentLoadCount: subsequentLoadCount
171
+ }), footerSlotComp));
172
+ };
173
+ FourColPortraitStoriesBase.propTypes = {
174
+ /** collection is the array of objects which is returning by API */
175
+ collection: PropTypes.object.isRequired,
176
+
177
+ /** The config for the Row */
178
+ config: PropTypes.shape({
179
+ borderColor: PropTypes.string,
180
+ theme: PropTypes.string,
181
+ border: PropTypes.bool,
182
+ collectionNameTemplate: PropTypes.string,
183
+ footerButton: PropTypes.string,
184
+ collectionNameBorderColor: PropTypes.string,
185
+ subsequentLoadCount: PropTypes.number
186
+ }),
187
+ getMoreStories: PropTypes.func,
188
+ isLoadMoreVisible: PropTypes.bool,
189
+ isLoading: PropTypes.bool,
190
+ isolatedLoadMore: PropTypes.bool
191
+ };
192
+ FourColPortraitStoriesBase.defaultProps = {
193
+ getMoreStories: function getMoreStories() {},
194
+ isLoadMoreVisible: true,
195
+ isLoading: false
196
+ };
197
+ var FourColPortraitStories = StateProvider(FourColPortraitStoriesBase);
198
+
199
+ export { FourColPortraitStories, FourColPortraitStoriesBase };
@@ -0,0 +1,175 @@
1
+ import React, { Fragment } from 'react';
2
+ import { g as getTextColor, a as get_1, l as getSlot, b as generateNavigateSlug, n as navigateTo } from './index-e39b3ca8.js';
3
+ import { S as StoryCard } from './index-6f8c780e.js';
4
+ import { H as HeroImage } from './index-6cb56d1a.js';
5
+ import { S as StorycardContent } from './index-f6e578e3.js';
6
+ import { C as CollectionName, S as StateProvider, L as LoadMoreTarget, P as ProgressiveHydration, a as LoadmoreButton } from './index-aa8b8ab8.js';
7
+ import { collectionToStories } from '@quintype/components';
8
+ import PropTypes from 'prop-types';
9
+ import { useDispatch, useSelector } from 'react-redux';
10
+ import 'react-timeago';
11
+ import 'date-fns-tz';
12
+ import 'react-dom';
13
+
14
+ var loadMore = function loadMore(_ref) {
15
+ var isLoading = _ref.isLoading,
16
+ storyItems = _ref.storyItems,
17
+ getMoreStories = _ref.getMoreStories,
18
+ _ref$subsequentLoadCo = _ref.subsequentLoadCount,
19
+ subsequentLoadCount = _ref$subsequentLoadCo === void 0 ? 3 : _ref$subsequentLoadCo;
20
+ if (isLoading) return;
21
+ var limit = subsequentLoadCount;
22
+ var offset = storyItems.length;
23
+ getMoreStories(offset, limit);
24
+ };
25
+
26
+ var ThreeColGridBase = function ThreeColGridBase(_ref2) {
27
+ var collection = _ref2.collection,
28
+ _ref2$config = _ref2.config,
29
+ config = _ref2$config === void 0 ? {} : _ref2$config,
30
+ getMoreStories = _ref2.getMoreStories,
31
+ isLoadMoreVisible = _ref2.isLoadMoreVisible,
32
+ isLoading = _ref2.isLoading,
33
+ isolatedLoadMore = _ref2.isolatedLoadMore;
34
+ var _config$collectionNam = config.collectionNameBorderColor,
35
+ collectionNameBorderColor = _config$collectionNam === void 0 ? "" : _config$collectionNam,
36
+ _config$borderColor = config.borderColor,
37
+ borderColor = _config$borderColor === void 0 ? "" : _config$borderColor,
38
+ _config$theme = config.theme,
39
+ theme = _config$theme === void 0 ? "" : _config$theme,
40
+ _config$slotConfig = config.slotConfig,
41
+ slotConfig = _config$slotConfig === void 0 ? [] : _config$slotConfig,
42
+ _config$border = config.border,
43
+ border = _config$border === void 0 ? "" : _config$border,
44
+ _config$collectionNam2 = config.collectionNameTemplate,
45
+ collectionNameTemplate = _config$collectionNam2 === void 0 ? "" : _config$collectionNam2,
46
+ _config$footerSlotCon = config.footerSlotConfig,
47
+ footerSlotConfig = _config$footerSlotCon === void 0 ? {} : _config$footerSlotCon,
48
+ _config$footerButton = config.footerButton,
49
+ footerButton = _config$footerButton === void 0 ? "" : _config$footerButton,
50
+ _config$subsequentLoa = config.subsequentLoadCount,
51
+ subsequentLoadCount = _config$subsequentLoa === void 0 ? 3 : _config$subsequentLoa;
52
+ var storyItems = collectionToStories(collection);
53
+ if (!storyItems.length) return null;
54
+ var textColor = getTextColor(theme);
55
+ var footerSlot = footerSlotConfig.footerSlot;
56
+ var footerSlotComp = footerSlot ? footerSlot() : null;
57
+
58
+ var _get = get_1(slotConfig, [0], {}),
59
+ _get$type = _get.type,
60
+ type = _get$type === void 0 ? "" : _get$type,
61
+ component = _get.component;
62
+
63
+ var adWidgetSlot = type === "ad" || type === "widget" ? getSlot(type, component) : null;
64
+ var dispatch = useDispatch();
65
+ var qtConfig = useSelector(function (state) {
66
+ return get_1(state, ["qt", "config"], {});
67
+ });
68
+
69
+ var getLoadMore = function getLoadMore(opts) {
70
+ if (!isLoadMoreVisible) return null;
71
+
72
+ if (isolatedLoadMore) {
73
+ return /*#__PURE__*/React.createElement(LoadMoreTarget, {
74
+ collection: collection,
75
+ componentName: "ThreeColGrid",
76
+ offset: storyItems.length,
77
+ limit: subsequentLoadCount
78
+ });
79
+ }
80
+
81
+ var url = generateNavigateSlug(collection, qtConfig);
82
+ return /*#__PURE__*/React.createElement(ProgressiveHydration, null, /*#__PURE__*/React.createElement(LoadmoreButton, {
83
+ config: config,
84
+ collection: collection,
85
+ template: footerButton,
86
+ onClick: function onClick() {
87
+ return loadMore(opts);
88
+ },
89
+ navigate: function navigate() {
90
+ return navigateTo(dispatch, url);
91
+ },
92
+ qtConfig: qtConfig
93
+ }));
94
+ };
95
+
96
+ var storyCard = function storyCard(story) {
97
+ return /*#__PURE__*/React.createElement("div", {
98
+ className: "three-col-m_cards__2HyyK"
99
+ }, /*#__PURE__*/React.createElement(StoryCard, {
100
+ story: story,
101
+ border: border,
102
+ theme: theme,
103
+ isHorizontalMobile: true,
104
+ config: config
105
+ }, /*#__PURE__*/React.createElement(HeroImage, {
106
+ aspectRatio: [[16, 9]],
107
+ story: story,
108
+ isHorizontalMobile: true
109
+ }), /*#__PURE__*/React.createElement(StorycardContent, {
110
+ theme: theme,
111
+ border: border,
112
+ story: story,
113
+ isHorizontalMobile: true,
114
+ borderColor: borderColor,
115
+ config: config
116
+ })));
117
+ };
118
+
119
+ return /*#__PURE__*/React.createElement("div", {
120
+ className: "full-width-with-padding arrow-component",
121
+ "data-test-id": "three-col-grid",
122
+ style: {
123
+ backgroundColor: theme,
124
+ color: textColor
125
+ }
126
+ }, /*#__PURE__*/React.createElement("div", {
127
+ className: "three-col-m_three-col-grid__y7rZK"
128
+ }, /*#__PURE__*/React.createElement(CollectionName, {
129
+ collection: collection,
130
+ collectionNameTemplate: collectionNameTemplate,
131
+ collectionNameBorderColor: collectionNameBorderColor
132
+ }), /*#__PURE__*/React.createElement("div", {
133
+ className: "three-col-m_wrapper__20m5m"
134
+ }, storyItems.slice(0, 2).map(function (story, index) {
135
+ return /*#__PURE__*/React.createElement(Fragment, {
136
+ key: "story-3col1-".concat(index, "-").concat(get_1(story, ["id"], "0"))
137
+ }, storyCard(story));
138
+ }), storyItems.length < 2 && /*#__PURE__*/React.createElement("div", null), adWidgetSlot, storyItems.slice(2).map(function (story, index) {
139
+ return /*#__PURE__*/React.createElement(Fragment, {
140
+ key: "story-3col1-".concat(index, "-").concat(get_1(story, ["id"], "0"))
141
+ }, storyCard(story));
142
+ })), getLoadMore({
143
+ isLoading: isLoading,
144
+ storyItems: storyItems,
145
+ getMoreStories: getMoreStories,
146
+ subsequentLoadCount: subsequentLoadCount
147
+ }), footerSlotComp));
148
+ };
149
+ ThreeColGridBase.propTypes = {
150
+ /** collection is the array of objects which is returning by API */
151
+ collection: PropTypes.object.isRequired,
152
+
153
+ /** The config for the Row */
154
+ config: PropTypes.shape({
155
+ theme: PropTypes.string,
156
+ border: PropTypes.bool,
157
+ slotConfig: PropTypes.array,
158
+ footerButton: PropTypes.string,
159
+ collectionNameTemplate: PropTypes.string,
160
+ collectionNameBorderColor: PropTypes.string,
161
+ subsequentLoadCount: PropTypes.number
162
+ }),
163
+ getMoreStories: PropTypes.func,
164
+ isLoadMoreVisible: PropTypes.bool,
165
+ isLoading: PropTypes.bool,
166
+ isolatedLoadMore: PropTypes.bool
167
+ };
168
+ ThreeColGridBase.defaultProps = {
169
+ getMoreStories: function getMoreStories() {},
170
+ isLoadMoreVisible: true,
171
+ isLoading: false
172
+ };
173
+ var ThreeColGrid = StateProvider(ThreeColGridBase);
174
+
175
+ export { ThreeColGrid, ThreeColGridBase };