@quintype/arrow 3.15.1-perf.4 → 3.15.1-perf.5

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