@quintype/arrow 3.15.1-perf.4 → 3.15.1-perf.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cjs/index.js +14589 -0
- package/package.json +1 -1
- package/atoms/Author/index.js +0 -170
- package/atoms/Author/styles.arrow.css +0 -1
- package/atoms/AuthorWithTime/index.js +0 -514
- package/atoms/AuthorWithTime/styles.arrow.css +0 -1
- package/atoms/CollectionName/index.js +0 -255
- package/atoms/CollectionName/styles.arrow.css +0 -1
- package/atoms/ExtendedLoadMore/index-0f809dd9.js +0 -254
- package/atoms/ExtendedLoadMore/index-142f015c.js +0 -476
- package/atoms/ExtendedLoadMore/index-37a9ccff.js +0 -182
- package/atoms/ExtendedLoadMore/index-446679c8.js +0 -191
- package/atoms/ExtendedLoadMore/index-44f97338.js +0 -300
- package/atoms/ExtendedLoadMore/index-57dd4870.js +0 -239
- package/atoms/ExtendedLoadMore/index-66dd4dbd.js +0 -215
- package/atoms/ExtendedLoadMore/index-8462c597.js +0 -363
- package/atoms/ExtendedLoadMore/index-93cb06d1.js +0 -1016
- package/atoms/ExtendedLoadMore/index-afd44863.js +0 -95
- package/atoms/ExtendedLoadMore/index-b5754c5d.js +0 -195
- package/atoms/ExtendedLoadMore/index-bbaf526e.js +0 -256
- package/atoms/ExtendedLoadMore/index-cfb262ef.js +0 -192
- package/atoms/ExtendedLoadMore/index.js +0 -20
- package/atoms/ExtendedLoadMore/styles.arrow.css +0 -1
- package/atoms/Headline/index.js +0 -379
- package/atoms/Headline/styles.arrow.css +0 -1
- package/atoms/HeroImage/index.js +0 -336
- package/atoms/HeroImage/styles.arrow.css +0 -1
- package/atoms/LoadmoreButton/index.js +0 -175
- package/atoms/LoadmoreButton/styles.arrow.css +0 -1
- package/atoms/ScrollSnap/index.js +0 -379
- package/atoms/ScrollSnap/styles.arrow.css +0 -1
- package/atoms/SectionTag/index.js +0 -140
- package/atoms/SectionTag/styles.arrow.css +0 -1
- package/atoms/Subheadline/index.js +0 -120
- package/atoms/Subheadline/styles.arrow.css +0 -1
- package/atoms/TimeStamp/index.js +0 -221
- package/atoms/TimeStamp/styles.arrow.css +0 -1
- package/molecules/KeyEvents/index.js +0 -457
- package/molecules/KeyEvents/styles.arrow.css +0 -1
- package/molecules/PageIntroductionCard/index.js +0 -248
- package/molecules/PageIntroductionCard/styles.arrow.css +0 -1
- package/molecules/SocialShareTemplate/index.js +0 -506
- package/molecules/SocialShareTemplate/styles.arrow.css +0 -1
- package/molecules/StoryCard/index.js +0 -1430
- package/molecules/StoryCard/styles.arrow.css +0 -1
- package/molecules/StoryElementCard/index.js +0 -3091
- package/molecules/StoryElementCard/styles.arrow.css +0 -1
- package/molecules/StorycardContent/index.js +0 -976
- package/molecules/StorycardContent/styles.arrow.css +0 -1
- package/rows/AlternateCollectionFilter/index.js +0 -2189
- package/rows/AlternateCollectionFilter/styles.arrow.css +0 -1
- package/rows/AsideCollection/index.js +0 -2135
- package/rows/AsideCollection/styles.arrow.css +0 -1
- package/rows/AstrologyCollection/index.js +0 -2106
- package/rows/AstrologyCollection/styles.arrow.css +0 -1
- package/rows/AuthorIntroductionCard/index.js +0 -813
- package/rows/AuthorIntroductionCard/styles.arrow.css +0 -1
- package/rows/AuthorsList/index.js +0 -996
- package/rows/AuthorsList/styles.arrow.css +0 -1
- package/rows/CollectionFilter/index.js +0 -2279
- package/rows/CollectionFilter/styles.arrow.css +0 -1
- package/rows/ElevenStories/index.js +0 -2118
- package/rows/ElevenStories/styles.arrow.css +0 -1
- package/rows/FourColFiveStories/index.js +0 -1861
- package/rows/FourColFiveStories/styles.arrow.css +0 -1
- package/rows/FourColGrid/index.js +0 -2083
- package/rows/FourColGrid/styles.arrow.css +0 -1
- package/rows/FourColPortraitStories/index.js +0 -2116
- package/rows/FourColPortraitStories/styles.arrow.css +0 -1
- package/rows/FourColSixteenStories/index.js +0 -1849
- package/rows/FourColSixteenStories/styles.arrow.css +0 -1
- package/rows/FourColTwelveStories/index.js +0 -1822
- package/rows/FourColTwelveStories/styles.arrow.css +0 -1
- package/rows/FourStorySlider/index.js +0 -2223
- package/rows/FourStorySlider/styles.arrow.css +0 -1
- package/rows/FourStorySliderPortrait/index.js +0 -2226
- package/rows/FourStorySliderPortrait/styles.arrow.css +0 -1
- package/rows/FourTabbedBigStorySlider/index.js +0 -1985
- package/rows/FourTabbedBigStorySlider/styles.arrow.css +0 -1
- package/rows/FullScreenSlider/index.js +0 -2141
- package/rows/FullScreenSlider/styles.arrow.css +0 -1
- package/rows/HalfScreenSlider/index.js +0 -1994
- package/rows/HalfScreenSlider/styles.arrow.css +0 -1
- package/rows/ListComponent/index.js +0 -1942
- package/rows/ListComponent/styles.arrow.css +0 -1
- package/rows/Listicles/index.js +0 -945
- package/rows/Listicles/styles.arrow.css +0 -1
- package/rows/MagazineEditions/index.js +0 -690
- package/rows/MagazineEditions/styles.arrow.css +0 -1
- package/rows/MagazineHeaderCard/index.js +0 -684
- package/rows/MagazineHeaderCard/styles.arrow.css +0 -1
- package/rows/MagazineWidget/index.js +0 -1994
- package/rows/MagazineWidget/styles.arrow.css +0 -1
- package/rows/OneColStoryList/index.js +0 -2169
- package/rows/OneColStoryList/styles.arrow.css +0 -1
- package/rows/OpinionCollection/index.js +0 -1545
- package/rows/OpinionCollection/styles.arrow.css +0 -1
- package/rows/SixColSixStories/index.js +0 -2014
- package/rows/SixColSixStories/styles.arrow.css +0 -1
- package/rows/StoryCollection/index.js +0 -2135
- package/rows/StoryCollection/styles.arrow.css +0 -1
- package/rows/TagIntroductionCard/index.js +0 -103
- package/rows/TagIntroductionCard/styles.arrow.css +0 -1
- package/rows/ThreeColFlexStories/index.js +0 -2074
- package/rows/ThreeColFlexStories/styles.arrow.css +0 -1
- package/rows/ThreeColFourteenStories/index.js +0 -1770
- package/rows/ThreeColFourteenStories/styles.arrow.css +0 -1
- package/rows/ThreeColGrid/index.js +0 -2104
- package/rows/ThreeColGrid/styles.arrow.css +0 -1
- package/rows/ThreeColSevenStory/index.js +0 -1982
- package/rows/ThreeColSevenStory/styles.arrow.css +0 -1
- package/rows/ThreeColSixStories/index.js +0 -1965
- package/rows/ThreeColSixStories/styles.arrow.css +0 -1
- package/rows/ThreeColTwelveStories/index.js +0 -1854
- package/rows/ThreeColTwelveStories/styles.arrow.css +0 -1
- package/rows/TwoColFourStories/index.js +0 -1943
- package/rows/TwoColFourStories/styles.arrow.css +0 -1
- package/rows/TwoColFourStoryHighlight/index.js +0 -1930
- package/rows/TwoColFourStoryHighlight/styles.arrow.css +0 -1
- package/rows/TwoColSevenStories/index.js +0 -1970
- package/rows/TwoColSevenStories/styles.arrow.css +0 -1
- package/rows/TwoColSixStories/index.js +0 -1963
- package/rows/TwoColSixStories/styles.arrow.css +0 -1
- package/rows/TwoColTenStoriesSidebar/index.js +0 -2029
- package/rows/TwoColTenStoriesSidebar/styles.arrow.css +0 -1
- package/rows/TwoColThreeStories/index.js +0 -1916
- package/rows/TwoColThreeStories/styles.arrow.css +0 -1
- package/story-elements/AlsoRead/index.js +0 -320
- package/story-elements/AlsoRead/styles.arrow.css +0 -1
- package/story-elements/Attachment/index.js +0 -167
- package/story-elements/Attachment/styles.arrow.css +0 -1
- package/story-elements/BigFact/index.js +0 -137
- package/story-elements/BigFact/styles.arrow.css +0 -1
- package/story-elements/BlockQuote/index.js +0 -304
- package/story-elements/BlockQuote/styles.arrow.css +0 -1
- package/story-elements/Blurb/index.js +0 -189
- package/story-elements/Blurb/styles.arrow.css +0 -1
- package/story-elements/Image/index.js +0 -529
- package/story-elements/Image/styles.arrow.css +0 -1
- package/story-elements/ImageGallery/index.js +0 -462
- package/story-elements/ImageGallery/styles.arrow.css +0 -1
- package/story-elements/ImageSlideshow/index.js +0 -773
- package/story-elements/ImageSlideshow/styles.arrow.css +0 -1
- package/story-elements/QuestionAnswer/index.js +0 -267
- package/story-elements/QuestionAnswer/styles.arrow.css +0 -1
- package/story-elements/Quote/index.js +0 -166
- package/story-elements/Quote/styles.arrow.css +0 -1
- package/story-elements/Reference/index.js +0 -160
- package/story-elements/Reference/styles.arrow.css +0 -1
- package/story-elements/StoryElement/index.js +0 -75
- package/story-elements/Summary/index.js +0 -190
- package/story-elements/Summary/styles.arrow.css +0 -1
- package/story-elements/Text/index.js +0 -165
- package/story-elements/Text/styles.arrow.css +0 -1
- package/story-elements/Video/index.js +0 -81
- package/story-elements/Video/styles.arrow.css +0 -1
- package/story-templates/ListicleStoryTemplate/index.js +0 -5586
- package/story-templates/ListicleStoryTemplate/styles.arrow.css +0 -1
- package/story-templates/LiveBlogStoryTemplate/index.js +0 -5762
- package/story-templates/LiveBlogStoryTemplate/styles.arrow.css +0 -1
- package/story-templates/PhotoStoryTemplate/index.js +0 -5564
- package/story-templates/PhotoStoryTemplate/styles.arrow.css +0 -1
- package/story-templates/TextStoryTemplate/index.js +0 -5637
- package/story-templates/TextStoryTemplate/styles.arrow.css +0 -1
- package/story-templates/VideoStoryTemplate/index.js +0 -5496
- package/story-templates/VideoStoryTemplate/styles.arrow.css +0 -1
|
@@ -1,363 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var _slicedToArray = require('@babel/runtime/helpers/slicedToArray');
|
|
4
|
-
var _getClassName = require('babel-plugin-react-css-modules/dist/browser/getClassName');
|
|
5
|
-
var components = require('@quintype/components');
|
|
6
|
-
var lodash = require('lodash');
|
|
7
|
-
var PropTypes = require('prop-types');
|
|
8
|
-
var React = require('react');
|
|
9
|
-
var reactRedux = require('react-redux');
|
|
10
|
-
var index$1 = require('./index-142f015c.js');
|
|
11
|
-
var index = require('./index-93cb06d1.js');
|
|
12
|
-
|
|
13
|
-
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
14
|
-
|
|
15
|
-
var _slicedToArray__default = /*#__PURE__*/_interopDefaultLegacy(_slicedToArray);
|
|
16
|
-
var _getClassName__default = /*#__PURE__*/_interopDefaultLegacy(_getClassName);
|
|
17
|
-
var PropTypes__default = /*#__PURE__*/_interopDefaultLegacy(PropTypes);
|
|
18
|
-
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
19
|
-
|
|
20
|
-
var ImageFallbackIcon = function ImageFallbackIcon(_ref) {
|
|
21
|
-
var _ref$width = _ref.width,
|
|
22
|
-
width = _ref$width === void 0 ? 40 : _ref$width,
|
|
23
|
-
_ref$height = _ref.height,
|
|
24
|
-
height = _ref$height === void 0 ? 30 : _ref$height,
|
|
25
|
-
_ref$iconColor = _ref.iconColor,
|
|
26
|
-
iconColor = _ref$iconColor === void 0 ? "#99B0CB" : _ref$iconColor;
|
|
27
|
-
return /*#__PURE__*/React__default["default"].createElement("svg", {
|
|
28
|
-
width: width,
|
|
29
|
-
height: height,
|
|
30
|
-
viewBox: "0 0 102 76",
|
|
31
|
-
version: "1.1"
|
|
32
|
-
}, /*#__PURE__*/React__default["default"].createElement("g", {
|
|
33
|
-
id: "demo-home-copy",
|
|
34
|
-
stroke: "none",
|
|
35
|
-
strokeWidth: "1",
|
|
36
|
-
fill: "none",
|
|
37
|
-
fillRule: "evenodd",
|
|
38
|
-
transform: "translate(-377.000000, -314.000000)"
|
|
39
|
-
}, /*#__PURE__*/React__default["default"].createElement("g", {
|
|
40
|
-
id: "Group-13",
|
|
41
|
-
transform: "translate(377.000000, 314.000000)"
|
|
42
|
-
}, /*#__PURE__*/React__default["default"].createElement("path", {
|
|
43
|
-
d: "M43.2,49.7 L62.2,19.2 L87.2,59.4 L17,59.4 L32.8,39.4 L43.2,49.7 Z M29.9,28.6 C25.8683213,28.6 22.6,25.3316787 22.6,21.3 C22.6,17.2683213 25.8683213,14 29.9,14 C33.9316787,14 37.2,17.2683213 37.2,21.3 C37.2,25.3316787 33.9316787,28.6 29.9,28.6 Z",
|
|
44
|
-
id: "Combined-Shape",
|
|
45
|
-
fill: iconColor,
|
|
46
|
-
fillRule: "nonzero"
|
|
47
|
-
}), /*#__PURE__*/React__default["default"].createElement("rect", {
|
|
48
|
-
id: "Rectangle-19",
|
|
49
|
-
stroke: iconColor,
|
|
50
|
-
strokeWidth: "3",
|
|
51
|
-
x: "1.5",
|
|
52
|
-
y: "1.5",
|
|
53
|
-
width: "99",
|
|
54
|
-
height: "73",
|
|
55
|
-
rx: "3"
|
|
56
|
-
}))));
|
|
57
|
-
};
|
|
58
|
-
ImageFallbackIcon.propTypes = {
|
|
59
|
-
width: PropTypes__default["default"].object,
|
|
60
|
-
height: PropTypes__default["default"].object,
|
|
61
|
-
iconColor: PropTypes__default["default"].object
|
|
62
|
-
};
|
|
63
|
-
|
|
64
|
-
var imageFallback = function imageFallback() {
|
|
65
|
-
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
66
|
-
className: "arr--fallback-image fallback-m_image__1GYCJ fallback-m_image-position__3KddP"
|
|
67
|
-
}, /*#__PURE__*/React__default["default"].createElement("figure", {
|
|
68
|
-
className: "arr--fallback-svg fallback-m_fallback-svg__tK9fL"
|
|
69
|
-
}, /*#__PURE__*/React__default["default"].createElement(ImageFallbackIcon, null)));
|
|
70
|
-
};
|
|
71
|
-
|
|
72
|
-
var FallbackImage = function FallbackImage(_ref) {
|
|
73
|
-
var slug = _ref.slug;
|
|
74
|
-
|
|
75
|
-
if (slug) {
|
|
76
|
-
return /*#__PURE__*/React__default["default"].createElement(components.Link, {
|
|
77
|
-
href: slug,
|
|
78
|
-
"aria-label": "image-fallback"
|
|
79
|
-
}, imageFallback());
|
|
80
|
-
} else {
|
|
81
|
-
return imageFallback();
|
|
82
|
-
}
|
|
83
|
-
};
|
|
84
|
-
FallbackImage.propTypes = {
|
|
85
|
-
slug: PropTypes__default["default"].string
|
|
86
|
-
};
|
|
87
|
-
|
|
88
|
-
var HyperLinkIcon = function HyperLinkIcon() {
|
|
89
|
-
return /*#__PURE__*/React__default["default"].createElement("svg", {
|
|
90
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
91
|
-
width: "36",
|
|
92
|
-
height: "28"
|
|
93
|
-
}, /*#__PURE__*/React__default["default"].createElement("g", {
|
|
94
|
-
fill: "none",
|
|
95
|
-
fillRule: "evenodd"
|
|
96
|
-
}, /*#__PURE__*/React__default["default"].createElement("rect", {
|
|
97
|
-
width: "36",
|
|
98
|
-
height: "28",
|
|
99
|
-
fill: "#3D6FCF",
|
|
100
|
-
rx: "4"
|
|
101
|
-
}), /*#__PURE__*/React__default["default"].createElement("path", {
|
|
102
|
-
stroke: "#FFF",
|
|
103
|
-
strokeLinecap: "round",
|
|
104
|
-
strokeLinejoin: "round",
|
|
105
|
-
strokeWidth: "2",
|
|
106
|
-
d: "M22 14.667v4c0 .736-.597 1.333-1.333 1.333h-7.334A1.333 1.333 0 0112 18.667v-7.334c0-.736.597-1.333 1.333-1.333h4M20 8h4v4m-7.333 3.333L24 8"
|
|
107
|
-
})));
|
|
108
|
-
};
|
|
109
|
-
|
|
110
|
-
var HyperLink = function HyperLink(_ref) {
|
|
111
|
-
var _ref$hyperLink = _ref.hyperLink,
|
|
112
|
-
hyperLink = _ref$hyperLink === void 0 ? "" : _ref$hyperLink;
|
|
113
|
-
if (!hyperLink) return null;
|
|
114
|
-
return /*#__PURE__*/React__default["default"].createElement(components.Link, {
|
|
115
|
-
href: hyperLink,
|
|
116
|
-
"aria-label": "hyperlink-button",
|
|
117
|
-
className: "arr--hyperlink-button hyperlink-m_hyperlink-button__1CqWx",
|
|
118
|
-
target: "_blank",
|
|
119
|
-
rel: "noopener noreferrer"
|
|
120
|
-
}, /*#__PURE__*/React__default["default"].createElement(HyperLinkIcon, null));
|
|
121
|
-
};
|
|
122
|
-
HyperLink.propTypes = {
|
|
123
|
-
hyperLink: PropTypes__default["default"].string
|
|
124
|
-
};
|
|
125
|
-
|
|
126
|
-
var _styleModuleImportMap$1 = {
|
|
127
|
-
"./hero-image.m.css": {
|
|
128
|
-
"hero-image": "hero-image-m_hero-image__3lraV",
|
|
129
|
-
"right-padding": "hero-image-m_right-padding__1LkCe",
|
|
130
|
-
"left-padding": "hero-image-m_left-padding__pYRAj",
|
|
131
|
-
"right-padding-mob": "hero-image-m_right-padding-mob__3-uOU",
|
|
132
|
-
"placeholder": "hero-image-m_placeholder__1omCm",
|
|
133
|
-
"hero-image-mob": "hero-image-m_hero-image-mob__13JJp",
|
|
134
|
-
"with-padding": "hero-image-m_with-padding__324G_",
|
|
135
|
-
"image": "hero-image-m_image__1mz0U"
|
|
136
|
-
}
|
|
137
|
-
};
|
|
138
|
-
var HeroImage = function HeroImage(_ref) {
|
|
139
|
-
var story = _ref.story,
|
|
140
|
-
FullBleed = _ref.FullBleed,
|
|
141
|
-
aspectRatio = _ref.aspectRatio,
|
|
142
|
-
defaultWidth = _ref.defaultWidth,
|
|
143
|
-
widths = _ref.widths,
|
|
144
|
-
isHorizontal = _ref.isHorizontal,
|
|
145
|
-
isHorizontalMobile = _ref.isHorizontalMobile,
|
|
146
|
-
isHorizontalWithImageLast = _ref.isHorizontalWithImageLast,
|
|
147
|
-
defaultFallback = _ref.defaultFallback,
|
|
148
|
-
isStoryPageImage = _ref.isStoryPageImage,
|
|
149
|
-
config = _ref.config;
|
|
150
|
-
|
|
151
|
-
var _ref2 = index.useStateValue() || {},
|
|
152
|
-
_ref2$fallbackImageUr = _ref2.fallbackImageUrl,
|
|
153
|
-
fallbackImageUrl = _ref2$fallbackImageUr === void 0 ? "" : _ref2$fallbackImageUr;
|
|
154
|
-
|
|
155
|
-
var _config$StoryTemplate = config.StoryTemplateIcon,
|
|
156
|
-
StoryTemplateIcon = _config$StoryTemplate === void 0 ? function () {
|
|
157
|
-
return null;
|
|
158
|
-
} : _config$StoryTemplate;
|
|
159
|
-
var showImagePlaceholder = reactRedux.useSelector(function (state) {
|
|
160
|
-
return lodash.get(state, ["qt", "config", "showPlaceholder"]);
|
|
161
|
-
});
|
|
162
|
-
var getPlaceholderStyleName = showImagePlaceholder ? "placeholder" : "";
|
|
163
|
-
var fullBleed = FullBleed ? "" : "with-padding";
|
|
164
|
-
var heroImageClass = "hero-image";
|
|
165
|
-
if (isHorizontal) heroImageClass = "right-padding";else if (isHorizontalWithImageLast) heroImageClass = "left-padding";
|
|
166
|
-
var heroImageMobClasses = isHorizontalMobile ? "right-padding-mob" : "";
|
|
167
|
-
|
|
168
|
-
var getPadding = function getPadding(aspectRatio) {
|
|
169
|
-
var _aspectRatio = _slicedToArray__default["default"](aspectRatio, 2),
|
|
170
|
-
height = _aspectRatio[0],
|
|
171
|
-
width = _aspectRatio[1];
|
|
172
|
-
|
|
173
|
-
if (height > 0 && width > 0) {
|
|
174
|
-
var padding = width / height * 100;
|
|
175
|
-
return padding;
|
|
176
|
-
}
|
|
177
|
-
|
|
178
|
-
return 0;
|
|
179
|
-
};
|
|
180
|
-
|
|
181
|
-
var _aspectRatio2 = _slicedToArray__default["default"](aspectRatio, 2),
|
|
182
|
-
mobileAspectRatio = _aspectRatio2[0],
|
|
183
|
-
_aspectRatio2$ = _aspectRatio2[1],
|
|
184
|
-
desktopAspectRatio = _aspectRatio2$ === void 0 ? mobileAspectRatio : _aspectRatio2$;
|
|
185
|
-
|
|
186
|
-
var isMobile = index$1.clientWidth("mobile");
|
|
187
|
-
var imageAspectRatio = isMobile ? mobileAspectRatio : desktopAspectRatio;
|
|
188
|
-
var imagePadding = isMobile ? getPadding(mobileAspectRatio) : getPadding(desktopAspectRatio);
|
|
189
|
-
var slug = lodash.get(story, ["hero-image-s3-key"]) || lodash.get(story, ["alternative", "home", "default", "hero-image", "hero-image-s3-key"]);
|
|
190
|
-
var hyperLink = lodash.get(story, ["hero-image-hyperlink"], "");
|
|
191
|
-
|
|
192
|
-
var fallbackImage = function fallbackImage() {
|
|
193
|
-
if (!slug) {
|
|
194
|
-
if (fallbackImageUrl && !isStoryPageImage) {
|
|
195
|
-
return /*#__PURE__*/React__default["default"].createElement("figure", {
|
|
196
|
-
style: {
|
|
197
|
-
paddingTop: imagePadding + "%"
|
|
198
|
-
},
|
|
199
|
-
className: "arr--responsive-hero-image " + _getClassName__default["default"]("image ".concat(getPlaceholderStyleName), _styleModuleImportMap$1)
|
|
200
|
-
}, /*#__PURE__*/React__default["default"].createElement("img", {
|
|
201
|
-
className: "qt-image",
|
|
202
|
-
"data-src": "".concat(fallbackImageUrl),
|
|
203
|
-
alt: "image-fallback"
|
|
204
|
-
}));
|
|
205
|
-
}
|
|
206
|
-
|
|
207
|
-
return /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, defaultFallback ? /*#__PURE__*/React__default["default"].createElement("div", {
|
|
208
|
-
"data-test-id": "arr--fallback-hero-image",
|
|
209
|
-
style: {
|
|
210
|
-
paddingTop: imagePadding + "%"
|
|
211
|
-
},
|
|
212
|
-
className: "arr--fallback-hero-image " + _getClassName__default["default"]("image ".concat(getPlaceholderStyleName), _styleModuleImportMap$1)
|
|
213
|
-
}, /*#__PURE__*/React__default["default"].createElement(StoryTemplateIcon, {
|
|
214
|
-
storyTemplate: story["story-template"]
|
|
215
|
-
}), /*#__PURE__*/React__default["default"].createElement(FallbackImage, null)) : null);
|
|
216
|
-
}
|
|
217
|
-
|
|
218
|
-
return /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, /*#__PURE__*/React__default["default"].createElement("figure", {
|
|
219
|
-
style: {
|
|
220
|
-
paddingTop: imagePadding + "%"
|
|
221
|
-
},
|
|
222
|
-
className: "arr--responsive-hero-image " + _getClassName__default["default"]("image ".concat(getPlaceholderStyleName), _styleModuleImportMap$1)
|
|
223
|
-
}, /*#__PURE__*/React__default["default"].createElement(StoryTemplateIcon, {
|
|
224
|
-
storyTemplate: story["story-template"]
|
|
225
|
-
}), /*#__PURE__*/React__default["default"].createElement(components.ResponsiveHeroImage, {
|
|
226
|
-
story: story,
|
|
227
|
-
aspectRatio: imageAspectRatio,
|
|
228
|
-
defaultWidth: defaultWidth,
|
|
229
|
-
widths: widths,
|
|
230
|
-
imgParams: {
|
|
231
|
-
auto: ["format", "compress"],
|
|
232
|
-
fit: "max"
|
|
233
|
-
}
|
|
234
|
-
})), isStoryPageImage && hyperLink && /*#__PURE__*/React__default["default"].createElement(HyperLink, {
|
|
235
|
-
hyperLink: hyperLink
|
|
236
|
-
}));
|
|
237
|
-
};
|
|
238
|
-
|
|
239
|
-
return story && (isStoryPageImage ? /*#__PURE__*/React__default["default"].createElement("div", {
|
|
240
|
-
"data-test-id": "arr--hero-image",
|
|
241
|
-
className: "arr--hero-image " + _getClassName__default["default"]("".concat(heroImageClass, " ").concat(fullBleed, " ").concat(heroImageMobClasses), _styleModuleImportMap$1)
|
|
242
|
-
}, fallbackImage()) : /*#__PURE__*/React__default["default"].createElement(components.Link, {
|
|
243
|
-
"data-test-id": "arr--hero-image",
|
|
244
|
-
href: index$1.getStoryUrl(story, "/".concat(story.slug)),
|
|
245
|
-
externalLink: index$1.isExternalStory(story),
|
|
246
|
-
"aria-label": "fallback-hero-image",
|
|
247
|
-
className: "arr--hero-image " + _getClassName__default["default"]("".concat(heroImageClass, " ").concat(fullBleed, " ").concat(heroImageMobClasses), _styleModuleImportMap$1)
|
|
248
|
-
}, fallbackImage()));
|
|
249
|
-
};
|
|
250
|
-
HeroImage.propTypes = {
|
|
251
|
-
/** The Story Object from the API response */
|
|
252
|
-
story: PropTypes__default["default"].object.isRequired,
|
|
253
|
-
|
|
254
|
-
/** Removes the Hero Image padding for the image to bleed over the margin */
|
|
255
|
-
FullBleed: PropTypes__default["default"].bool,
|
|
256
|
-
|
|
257
|
-
/** The default width for the image, in case the browser does not support srcset */
|
|
258
|
-
defaultWidth: PropTypes__default["default"].number,
|
|
259
|
-
|
|
260
|
-
/** The list of available widths */
|
|
261
|
-
widths: PropTypes__default["default"].array,
|
|
262
|
-
// fatch the correct hero image
|
|
263
|
-
aspectRatio: PropTypes__default["default"].array,
|
|
264
|
-
// Hints for the browser to choose the best size
|
|
265
|
-
|
|
266
|
-
/** This prop is responsible for adding padding-right of the image and remove padding bottom of the image */
|
|
267
|
-
isHorizontal: PropTypes__default["default"].bool,
|
|
268
|
-
|
|
269
|
-
/** This prop is responsible for adding padding-bottom in desktop and padding-right in mobile */
|
|
270
|
-
isHorizontalMobile: PropTypes__default["default"].bool,
|
|
271
|
-
// this prop is responsive for rendering fallback image on story page
|
|
272
|
-
defaultFallback: PropTypes__default["default"].bool,
|
|
273
|
-
isHorizontalWithImageLast: PropTypes__default["default"].bool,
|
|
274
|
-
isStoryPageImage: PropTypes__default["default"].bool,
|
|
275
|
-
config: PropTypes__default["default"].object
|
|
276
|
-
};
|
|
277
|
-
HeroImage.defaultProps = {
|
|
278
|
-
FullBleed: true,
|
|
279
|
-
aspectRatio: [[1, 1], [16, 9]],
|
|
280
|
-
defaultWidth: 480,
|
|
281
|
-
widths: [250, 480, 640],
|
|
282
|
-
isHorizontal: false,
|
|
283
|
-
isHorizontalMobile: false,
|
|
284
|
-
defaultFallback: true,
|
|
285
|
-
isStoryPageImage: false,
|
|
286
|
-
isHorizontalWithImageLast: false,
|
|
287
|
-
config: {}
|
|
288
|
-
};
|
|
289
|
-
|
|
290
|
-
var _styleModuleImportMap = {
|
|
291
|
-
"./section.m.css": {
|
|
292
|
-
"section": "section-m_section__2N4S3",
|
|
293
|
-
"section-borderBottomSml": "section-m_section-borderBottomSml__2GNbo",
|
|
294
|
-
"border-bottom": "section-m_border-bottom__3cRoD",
|
|
295
|
-
"section-borderLeft": "section-m_section-borderLeft__3hKVj",
|
|
296
|
-
"border-left": "section-m_border-left__2oUyp",
|
|
297
|
-
"section-solid": "section-m_section-solid__1vB1Q",
|
|
298
|
-
"dark": "section-m_dark__1r3C4",
|
|
299
|
-
"light": "section-m_light__306hW"
|
|
300
|
-
}
|
|
301
|
-
};
|
|
302
|
-
var SectionTag = function SectionTag(_ref) {
|
|
303
|
-
var story = _ref.story,
|
|
304
|
-
_ref$template = _ref.template,
|
|
305
|
-
template = _ref$template === void 0 ? "" : _ref$template,
|
|
306
|
-
_ref$borderColor = _ref.borderColor,
|
|
307
|
-
borderColor = _ref$borderColor === void 0 ? "" : _ref$borderColor,
|
|
308
|
-
isLightTheme = _ref.isLightTheme;
|
|
309
|
-
var config = index.useStateValue() || {};
|
|
310
|
-
var isSection = lodash.get(config, ["showSection"], true);
|
|
311
|
-
var templateFromRowContext = lodash.get(config, ["sectionTagTemplate"]);
|
|
312
|
-
var section = lodash.get(story, ["sections", 0], "");
|
|
313
|
-
var supportedTemplates = ["borderBottomSml", "borderLeft", "solid"];
|
|
314
|
-
var getUrl = section ? section["section-url"] : "/";
|
|
315
|
-
var colorToApplyContrast = template === "solid" || templateFromRowContext === "solid" ? borderColor : config.theme;
|
|
316
|
-
var textColor = isLightTheme ? "light" : index$1.getTextColor(colorToApplyContrast);
|
|
317
|
-
var sectionTagBorderColor = index$1.rgbToHex(borderColor);
|
|
318
|
-
var templateStyle = supportedTemplates.includes(template) ? "section section-".concat(template) : "section";
|
|
319
|
-
|
|
320
|
-
if (templateFromRowContext) {
|
|
321
|
-
templateStyle = supportedTemplates.includes(templateFromRowContext) ? "section section-".concat(templateFromRowContext) : "section";
|
|
322
|
-
}
|
|
323
|
-
|
|
324
|
-
if (!isSection) return null;
|
|
325
|
-
return /*#__PURE__*/React__default["default"].createElement(components.Link, {
|
|
326
|
-
href: getUrl,
|
|
327
|
-
className: "arrow-component arr--section-name",
|
|
328
|
-
"aria-label": "section-name"
|
|
329
|
-
}, /*#__PURE__*/React__default["default"].createElement("div", {
|
|
330
|
-
"data-test-id": "sectionTag",
|
|
331
|
-
style: {
|
|
332
|
-
backgroundColor: templateStyle.includes("section-solid") ? sectionTagBorderColor : ""
|
|
333
|
-
},
|
|
334
|
-
className: "section-tag arrow-component " + _getClassName__default["default"]("".concat(textColor, " ").concat(templateStyle), _styleModuleImportMap)
|
|
335
|
-
}, templateStyle.includes("section-borderLeft") && /*#__PURE__*/React__default["default"].createElement("span", {
|
|
336
|
-
className: "section-m_border-left__2oUyp",
|
|
337
|
-
style: {
|
|
338
|
-
color: sectionTagBorderColor
|
|
339
|
-
}
|
|
340
|
-
}), section["display-name"] || section["name"], /*#__PURE__*/React__default["default"].createElement("div", {
|
|
341
|
-
className: "section-m_border-bottom__3cRoD",
|
|
342
|
-
style: {
|
|
343
|
-
backgroundColor: "".concat(template === "solid" ? "" : sectionTagBorderColor)
|
|
344
|
-
}
|
|
345
|
-
})));
|
|
346
|
-
};
|
|
347
|
-
SectionTag.propTypes = {
|
|
348
|
-
/** The Story Object from the API response */
|
|
349
|
-
story: PropTypes__default["default"].object.isRequired,
|
|
350
|
-
|
|
351
|
-
/** The style template for section tag */
|
|
352
|
-
template: PropTypes__default["default"].oneOf(["", "borderBottomSml", "borderLeft", "solid"]),
|
|
353
|
-
borderColor: PropTypes__default["default"].string,
|
|
354
|
-
solidBorderColor: PropTypes__default["default"].string,
|
|
355
|
-
isLightTheme: PropTypes__default["default"].bool
|
|
356
|
-
};
|
|
357
|
-
SectionTag.defaultProps = {
|
|
358
|
-
template: "",
|
|
359
|
-
isLightTheme: false
|
|
360
|
-
};
|
|
361
|
-
|
|
362
|
-
exports.HeroImage = HeroImage;
|
|
363
|
-
exports.SectionTag = SectionTag;
|