@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,514 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
-
|
|
5
|
-
var _getClassName = require('babel-plugin-react-css-modules/dist/browser/getClassName');
|
|
6
|
-
var React = require('react');
|
|
7
|
-
var lodash = require('lodash');
|
|
8
|
-
require('@babel/runtime/helpers/asyncToGenerator');
|
|
9
|
-
require('@babel/runtime/helpers/typeof');
|
|
10
|
-
require('@babel/runtime/regenerator');
|
|
11
|
-
var PropTypes = require('prop-types');
|
|
12
|
-
var Timeago = require('react-timeago');
|
|
13
|
-
var dateFnsTz = require('date-fns-tz');
|
|
14
|
-
var components = require('@quintype/components');
|
|
15
|
-
var reactRedux = require('react-redux');
|
|
16
|
-
|
|
17
|
-
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
18
|
-
|
|
19
|
-
var _getClassName__default = /*#__PURE__*/_interopDefaultLegacy(_getClassName);
|
|
20
|
-
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
21
|
-
var PropTypes__default = /*#__PURE__*/_interopDefaultLegacy(PropTypes);
|
|
22
|
-
var Timeago__default = /*#__PURE__*/_interopDefaultLegacy(Timeago);
|
|
23
|
-
|
|
24
|
-
var StateContext = /*#__PURE__*/React.createContext(); // eslint-disable-next-line react/display-name
|
|
25
|
-
var useStateValue = function useStateValue() {
|
|
26
|
-
return React.useContext(StateContext);
|
|
27
|
-
};
|
|
28
|
-
|
|
29
|
-
var timestampToFormat = function timestampToFormat(value, unit, suffix, timestamp) {
|
|
30
|
-
var config = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : {};
|
|
31
|
-
var _config$showTime = config.showTime,
|
|
32
|
-
showTime = _config$showTime === void 0 ? false : _config$showTime,
|
|
33
|
-
_config$isTimeFirst = config.isTimeFirst,
|
|
34
|
-
isTimeFirst = _config$isTimeFirst === void 0 ? false : _config$isTimeFirst,
|
|
35
|
-
_config$isUpperCase = config.isUpperCase,
|
|
36
|
-
isUpperCase = _config$isUpperCase === void 0 ? false : _config$isUpperCase,
|
|
37
|
-
_config$disableMeridi = config.disableMeridiem,
|
|
38
|
-
disableMeridiem = _config$disableMeridi === void 0 ? false : _config$disableMeridi,
|
|
39
|
-
_config$timeFormat = config.timeFormat,
|
|
40
|
-
timeFormat = _config$timeFormat === void 0 ? "12hours" : _config$timeFormat;
|
|
41
|
-
var monthList = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"];
|
|
42
|
-
var dateTime = new Date(timestamp);
|
|
43
|
-
var date = dateTime.getDate().toString().padStart(2, 0);
|
|
44
|
-
var month = monthList[dateTime.getMonth()];
|
|
45
|
-
var localizedMonth = month;
|
|
46
|
-
|
|
47
|
-
if (isUpperCase) {
|
|
48
|
-
localizedMonth = lodash.upperCase(month);
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
var year = dateTime.getFullYear();
|
|
52
|
-
var localizedMeridiem = config.localizedMeridiem,
|
|
53
|
-
localizedMonths = config.localizedMonths,
|
|
54
|
-
_config$direction = config.direction,
|
|
55
|
-
direction = _config$direction === void 0 ? "ltr" : _config$direction;
|
|
56
|
-
var time = formatAMPM(timestamp, timeFormat);
|
|
57
|
-
var timeWithLocalizedMeridiem = time;
|
|
58
|
-
var timetoShow;
|
|
59
|
-
|
|
60
|
-
if (localizedMonths) {
|
|
61
|
-
localizedMonth = lodash.get(localizedMonths, [lodash.lowerCase(month)]) || month;
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
if (localizedMeridiem) {
|
|
65
|
-
var isAm = time.includes("am");
|
|
66
|
-
var _localizedMeridiem$am = localizedMeridiem.am,
|
|
67
|
-
am = _localizedMeridiem$am === void 0 ? "am" : _localizedMeridiem$am,
|
|
68
|
-
_localizedMeridiem$pm = localizedMeridiem.pm,
|
|
69
|
-
pm = _localizedMeridiem$pm === void 0 ? "pm" : _localizedMeridiem$pm;
|
|
70
|
-
timeWithLocalizedMeridiem = (isAm ? time.replace("am", am) : time.replace("pm", pm)) || time;
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
if (direction === "rtl") {
|
|
74
|
-
timetoShow = showTime ? "".concat(timeWithLocalizedMeridiem) : "";
|
|
75
|
-
return "".concat(date, " ").concat(localizedMonth, ", ").concat(year, " ").concat(timetoShow, " ");
|
|
76
|
-
} else {
|
|
77
|
-
if (disableMeridiem) {
|
|
78
|
-
return "".concat(localizedMonth, " ").concat(date, ", ").concat(year);
|
|
79
|
-
} else if (isTimeFirst) {
|
|
80
|
-
return "".concat(timeWithLocalizedMeridiem, ", ").concat(date, " ").concat(localizedMonth, " ").concat(year);
|
|
81
|
-
} else {
|
|
82
|
-
timetoShow = showTime ? ", ".concat(timeWithLocalizedMeridiem) : "";
|
|
83
|
-
return "".concat(date, " ").concat(localizedMonth, ", ").concat(year).concat(timetoShow);
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
};
|
|
87
|
-
function formatter(value, unit, suffix, date, config) {
|
|
88
|
-
var showDateForUnits = ["day", "week", "month", "year"]; // suffix here refers to ago
|
|
89
|
-
// unit here refers to seconds, minute, minutes,...
|
|
90
|
-
|
|
91
|
-
var localizedSuffix = lodash.get(config, ["localizedPublishTime", suffix]) || suffix;
|
|
92
|
-
var localizedUnitOfTime;
|
|
93
|
-
|
|
94
|
-
if (unit === "hour" && value > 23 || showDateForUnits.indexOf(unit) !== -1) {
|
|
95
|
-
return timestampToFormat(value, unit, suffix, date, config);
|
|
96
|
-
} else if (value > 1) {
|
|
97
|
-
localizedUnitOfTime = lodash.get(config, ["localizedPublishTime", "".concat(unit, "s")]) || "".concat(unit, "s");
|
|
98
|
-
return "".concat(value, " ").concat(localizedUnitOfTime, " ").concat(localizedSuffix);
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
localizedUnitOfTime = lodash.get(config, ["localizedPublishTime", unit]) || unit;
|
|
102
|
-
return "".concat(value, " ").concat(localizedUnitOfTime, " ").concat(localizedSuffix, " ");
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
function formatAMPM(timestamp) {
|
|
106
|
-
var timeFormat = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "12hours";
|
|
107
|
-
var dateTime = new Date(timestamp);
|
|
108
|
-
var hours = dateTime.getHours();
|
|
109
|
-
var minutes = dateTime.getMinutes();
|
|
110
|
-
var ampm = hours >= 12 ? "pm" : "am";
|
|
111
|
-
hours = hours % 12;
|
|
112
|
-
hours = hours || 12;
|
|
113
|
-
minutes = minutes < 10 ? "0" + minutes : minutes;
|
|
114
|
-
var strTime = hours + ":" + minutes + " " + ampm;
|
|
115
|
-
|
|
116
|
-
if (timeFormat === "24hours") {
|
|
117
|
-
return dateTime.toLocaleTimeString([], {
|
|
118
|
-
hour: "2-digit",
|
|
119
|
-
minute: "2-digit"
|
|
120
|
-
});
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
return strTime;
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
var hexToRGB = function hexToRGB(hex) {
|
|
127
|
-
var r = parseInt(hex.slice(1, 3), 16);
|
|
128
|
-
var g = parseInt(hex.slice(3, 5), 16);
|
|
129
|
-
var b = parseInt(hex.slice(5, 7), 16);
|
|
130
|
-
return {
|
|
131
|
-
r: r,
|
|
132
|
-
g: g,
|
|
133
|
-
b: b
|
|
134
|
-
};
|
|
135
|
-
};
|
|
136
|
-
var getLuminanceOfColor = function getLuminanceOfColor(hex) {
|
|
137
|
-
var _hexToRGB = hexToRGB(hex),
|
|
138
|
-
r = _hexToRGB.r,
|
|
139
|
-
g = _hexToRGB.g,
|
|
140
|
-
b = _hexToRGB.b;
|
|
141
|
-
|
|
142
|
-
return r * 0.299 + g * 0.587 + b * 0.114;
|
|
143
|
-
};
|
|
144
|
-
var rgbToHex = function rgbToHex() {
|
|
145
|
-
var color = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : "rgba(255, 255, 255, 0)";
|
|
146
|
-
var rgba = color.match(/^rgba?[\s+]?\([\s+]?(\d+)[\s+]?,[\s+]?(\d+)[\s+]?,[\s+]?(\d+)[\s+]?/i);
|
|
147
|
-
return rgba && rgba.length === 4 ? "#" + ("0" + parseInt(rgba[1], 10).toString(16)).slice(-2) + ("0" + parseInt(rgba[2], 10).toString(16)).slice(-2) + ("0" + parseInt(rgba[3], 10).toString(16)).slice(-2) : color;
|
|
148
|
-
};
|
|
149
|
-
var getTextColor = function getTextColor() {
|
|
150
|
-
var theme = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : "rgb(255,255,255)";
|
|
151
|
-
var isRegexCheck = /^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/.test(theme);
|
|
152
|
-
var getHexValue = !isRegexCheck ? rgbToHex(theme) : theme;
|
|
153
|
-
var textColor = getLuminanceOfColor(getHexValue) < 155 ? "light" : "dark";
|
|
154
|
-
return textColor;
|
|
155
|
-
};
|
|
156
|
-
PropTypes__default["default"].shape({
|
|
157
|
-
"sketches-host": PropTypes__default["default"].string,
|
|
158
|
-
"cdn-name": PropTypes__default["default"].string,
|
|
159
|
-
"cdn-image": PropTypes__default["default"].string
|
|
160
|
-
});
|
|
161
|
-
PropTypes__default["default"].shape({
|
|
162
|
-
headline: PropTypes__default["default"].string,
|
|
163
|
-
"last-published-at": PropTypes__default["default"].number,
|
|
164
|
-
subheadline: PropTypes__default["default"].string
|
|
165
|
-
});
|
|
166
|
-
var getTimeStamp = function getTimeStamp(date, _formatter) {
|
|
167
|
-
var config = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
168
|
-
var template = arguments.length > 3 ? arguments[3] : undefined;
|
|
169
|
-
var timezone = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : null;
|
|
170
|
-
|
|
171
|
-
if (timezone && template === "story") {
|
|
172
|
-
var zonedTime = timezone && dateFnsTz.utcToZonedTime(date, timezone);
|
|
173
|
-
var formatZonedTime = zonedTime && dateFnsTz.format(zonedTime, "yyyy-MM-dd'T'HH:mm:ssXXX", {
|
|
174
|
-
timeZone: timezone
|
|
175
|
-
});
|
|
176
|
-
var timeStamp = timestampToFormat("", "", "", date, config);
|
|
177
|
-
return /*#__PURE__*/React__default["default"].createElement("time", {
|
|
178
|
-
dateTime: formatZonedTime
|
|
179
|
-
}, timeStamp);
|
|
180
|
-
}
|
|
181
|
-
|
|
182
|
-
return /*#__PURE__*/React__default["default"].createElement(Timeago__default["default"], {
|
|
183
|
-
date: date,
|
|
184
|
-
formatter: function formatter(value, unit, suffix, date) {
|
|
185
|
-
return _formatter(value, unit, suffix, date, config);
|
|
186
|
-
}
|
|
187
|
-
});
|
|
188
|
-
};
|
|
189
|
-
|
|
190
|
-
var _styleModuleImportMap$5 = {
|
|
191
|
-
"./timestamp.m.css": {
|
|
192
|
-
"time": "timestamp-m_time__2v46i",
|
|
193
|
-
"time-wrapper": "timestamp-m_time-wrapper__3O2lM",
|
|
194
|
-
"bottom-fix": "timestamp-m_bottom-fix__1Zh8r",
|
|
195
|
-
"dark": "timestamp-m_dark__2lk9E",
|
|
196
|
-
"light": "timestamp-m_light__2QlrI"
|
|
197
|
-
}
|
|
198
|
-
};
|
|
199
|
-
var TimeStamp = function TimeStamp(_ref) {
|
|
200
|
-
var story = _ref.story,
|
|
201
|
-
isBottom = _ref.isBottom,
|
|
202
|
-
_ref$config = _ref.config,
|
|
203
|
-
config = _ref$config === void 0 ? {} : _ref$config;
|
|
204
|
-
var configState = useStateValue() || {};
|
|
205
|
-
var isTime = lodash.get(config, ["showTime"], lodash.get(configState, ["showTime"], true));
|
|
206
|
-
var time = story["last-published-at"] || story["first-published-at"];
|
|
207
|
-
var isBottomClasses = isBottom ? "bottom-fix" : "";
|
|
208
|
-
var textColor = getTextColor(configState.theme);
|
|
209
|
-
return /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, isTime && /*#__PURE__*/React__default["default"].createElement("div", {
|
|
210
|
-
"data-test-id": "publish-time",
|
|
211
|
-
className: "time arr--publish-time " + _getClassName__default["default"]("time ".concat(textColor, " ").concat(isBottomClasses), _styleModuleImportMap$5)
|
|
212
|
-
}, /*#__PURE__*/React__default["default"].createElement("div", {
|
|
213
|
-
className: "timestamp-m_time-wrapper__3O2lM"
|
|
214
|
-
}, getTimeStamp(time, formatter, config))));
|
|
215
|
-
};
|
|
216
|
-
TimeStamp.propTypes = {
|
|
217
|
-
/** The Story Object from the API response */
|
|
218
|
-
story: PropTypes__default["default"].object,
|
|
219
|
-
isBottom: PropTypes__default["default"].bool,
|
|
220
|
-
config: PropTypes__default["default"].object
|
|
221
|
-
};
|
|
222
|
-
|
|
223
|
-
var _styleModuleImportMap$4 = {
|
|
224
|
-
"./author.m.css": {
|
|
225
|
-
"author": "author-m_author__WRuLm",
|
|
226
|
-
"author-image": "author-m_author-image__3q2oc",
|
|
227
|
-
"author-name": "author-m_author-name__3WP-O",
|
|
228
|
-
"bottom-fix": "author-m_bottom-fix__223TT",
|
|
229
|
-
"prefix": "author-m_prefix__YSInK",
|
|
230
|
-
"rtl-image": "author-m_rtl-image__2nglD",
|
|
231
|
-
"ltr-image": "author-m_ltr-image__3bc0L",
|
|
232
|
-
"dark": "author-m_dark__2TTlp",
|
|
233
|
-
"light": "author-m_light__3y8_x"
|
|
234
|
-
}
|
|
235
|
-
};
|
|
236
|
-
|
|
237
|
-
var AuthorBase = function AuthorBase(_ref) {
|
|
238
|
-
var story = _ref.story,
|
|
239
|
-
hideAuthorImage = _ref.hideAuthorImage,
|
|
240
|
-
isBottom = _ref.isBottom,
|
|
241
|
-
_ref$prefix = _ref.prefix,
|
|
242
|
-
prefix = _ref$prefix === void 0 ? "" : _ref$prefix,
|
|
243
|
-
_ref$config = _ref.config,
|
|
244
|
-
config = _ref$config === void 0 ? {} : _ref$config;
|
|
245
|
-
var configData = useStateValue() || {};
|
|
246
|
-
var isAuthor = lodash.get(configData, ["showAuthor"], true);
|
|
247
|
-
|
|
248
|
-
var _get = lodash.get(story, ["authors", "0"], ""),
|
|
249
|
-
avatarUrl = _get["avatar-url"],
|
|
250
|
-
avatarS3Key = _get["avatar-s3-key"],
|
|
251
|
-
authorName = _get.name,
|
|
252
|
-
slug = _get.slug;
|
|
253
|
-
|
|
254
|
-
var isBottomClasses = isBottom ? "bottom-fix" : "";
|
|
255
|
-
var textColor = getTextColor(configData.theme);
|
|
256
|
-
var mountAt = lodash.get(config, ["mountAt"], "");
|
|
257
|
-
|
|
258
|
-
var authorImage = function authorImage(dir) {
|
|
259
|
-
if (!avatarUrl && !avatarS3Key) {
|
|
260
|
-
return null;
|
|
261
|
-
}
|
|
262
|
-
|
|
263
|
-
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
264
|
-
"data-test-id": "author-image",
|
|
265
|
-
className: _getClassName__default["default"]("author-image ".concat(dir, "-image"), _styleModuleImportMap$4)
|
|
266
|
-
}, /*#__PURE__*/React__default["default"].createElement("figure", null, avatarS3Key ? /*#__PURE__*/React__default["default"].createElement(components.ResponsiveImage, {
|
|
267
|
-
slug: avatarS3Key,
|
|
268
|
-
"aspect-ratio": [1, 1],
|
|
269
|
-
defaultWidth: 400,
|
|
270
|
-
imgParams: {
|
|
271
|
-
auto: ["format", "compress"]
|
|
272
|
-
},
|
|
273
|
-
alt: authorName
|
|
274
|
-
}) : /*#__PURE__*/React__default["default"].createElement("img", {
|
|
275
|
-
src: avatarUrl
|
|
276
|
-
})));
|
|
277
|
-
};
|
|
278
|
-
|
|
279
|
-
var isPrefix = function isPrefix(dir) {
|
|
280
|
-
if (prefix) {
|
|
281
|
-
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
282
|
-
className: "arr-author-prefix " + _getClassName__default["default"]("prefix ".concat(textColor), _styleModuleImportMap$4)
|
|
283
|
-
}, prefix);
|
|
284
|
-
}
|
|
285
|
-
|
|
286
|
-
return !hideAuthorImage && authorImage(dir);
|
|
287
|
-
};
|
|
288
|
-
|
|
289
|
-
return /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, isAuthor && /*#__PURE__*/React__default["default"].createElement(components.Link, {
|
|
290
|
-
href: "".concat(mountAt, "/author/") + slug,
|
|
291
|
-
"aria-label": "author-name",
|
|
292
|
-
className: "author-name arr-author-name arrow-component " + _getClassName__default["default"]("author ".concat(isBottomClasses), _styleModuleImportMap$4)
|
|
293
|
-
}, isPrefix("ltr"), /*#__PURE__*/React__default["default"].createElement("div", {
|
|
294
|
-
"data-test-id": "author-name",
|
|
295
|
-
className: "author-name " + _getClassName__default["default"]("author-name ".concat(textColor), _styleModuleImportMap$4)
|
|
296
|
-
}, authorName || story["author-name"]), !prefix && isPrefix("rtl")));
|
|
297
|
-
};
|
|
298
|
-
|
|
299
|
-
function mapStateToProps(state) {
|
|
300
|
-
return {
|
|
301
|
-
config: lodash.get(state, ["qt", "config"], {})
|
|
302
|
-
};
|
|
303
|
-
}
|
|
304
|
-
|
|
305
|
-
var Author = reactRedux.connect(mapStateToProps)(AuthorBase);
|
|
306
|
-
AuthorBase.propTypes = {
|
|
307
|
-
/** The Story Object from the API response */
|
|
308
|
-
story: PropTypes__default["default"].object.isRequired,
|
|
309
|
-
|
|
310
|
-
/** Hide Author Avatar Image */
|
|
311
|
-
hideAuthorImage: PropTypes__default["default"].bool,
|
|
312
|
-
// fix Author bottom of the storyCard
|
|
313
|
-
isBottom: PropTypes__default["default"].bool,
|
|
314
|
-
// fix prefix before the author name
|
|
315
|
-
prefix: PropTypes__default["default"].string,
|
|
316
|
-
config: PropTypes__default["default"].object
|
|
317
|
-
};
|
|
318
|
-
AuthorBase.defaultProps = {
|
|
319
|
-
hideAuthorImage: false,
|
|
320
|
-
isBottom: false,
|
|
321
|
-
prefix: ""
|
|
322
|
-
};
|
|
323
|
-
|
|
324
|
-
var _styleModuleImportMap$3 = {
|
|
325
|
-
"./dot.m.css": {
|
|
326
|
-
"dark": "dot-m_dark__1Njxl",
|
|
327
|
-
"light": "dot-m_light__27IA3"
|
|
328
|
-
}
|
|
329
|
-
};
|
|
330
|
-
var Dot = function Dot(_ref) {
|
|
331
|
-
var _ref$width = _ref.width,
|
|
332
|
-
width = _ref$width === void 0 ? "3px" : _ref$width,
|
|
333
|
-
_ref$height = _ref.height,
|
|
334
|
-
height = _ref$height === void 0 ? "3px" : _ref$height,
|
|
335
|
-
_ref$color = _ref.color,
|
|
336
|
-
color = _ref$color === void 0 ? "light" : _ref$color;
|
|
337
|
-
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
338
|
-
className: _getClassName__default["default"](color, _styleModuleImportMap$3)
|
|
339
|
-
}, /*#__PURE__*/React__default["default"].createElement("svg", {
|
|
340
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
341
|
-
width: width,
|
|
342
|
-
height: height,
|
|
343
|
-
viewBox: "0 0 3 3"
|
|
344
|
-
}, /*#__PURE__*/React__default["default"].createElement("circle", {
|
|
345
|
-
cx: "87",
|
|
346
|
-
cy: "9",
|
|
347
|
-
r: "1",
|
|
348
|
-
fill: "inherit",
|
|
349
|
-
fillRule: "nonzero",
|
|
350
|
-
transform: "translate(-86 -8)"
|
|
351
|
-
})));
|
|
352
|
-
};
|
|
353
|
-
Dot.propTypes = {
|
|
354
|
-
/** height , width and color of the dot icon */
|
|
355
|
-
color: PropTypes__default["default"].string,
|
|
356
|
-
width: PropTypes__default["default"].string,
|
|
357
|
-
height: PropTypes__default["default"].string
|
|
358
|
-
};
|
|
359
|
-
|
|
360
|
-
var _styleModuleImportMap$2 = {
|
|
361
|
-
"./divider.m.css": {
|
|
362
|
-
"dark": "divider-m_dark__26FRi",
|
|
363
|
-
"light": "divider-m_light__w-7sy"
|
|
364
|
-
}
|
|
365
|
-
};
|
|
366
|
-
var Divider = function Divider(_ref) {
|
|
367
|
-
var _ref$width = _ref.width,
|
|
368
|
-
width = _ref$width === void 0 ? "1" : _ref$width,
|
|
369
|
-
_ref$height = _ref.height,
|
|
370
|
-
height = _ref$height === void 0 ? "10" : _ref$height,
|
|
371
|
-
_ref$color = _ref.color,
|
|
372
|
-
color = _ref$color === void 0 ? "light" : _ref$color;
|
|
373
|
-
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
374
|
-
className: _getClassName__default["default"](color, _styleModuleImportMap$2)
|
|
375
|
-
}, /*#__PURE__*/React__default["default"].createElement("svg", {
|
|
376
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
377
|
-
width: width,
|
|
378
|
-
height: height
|
|
379
|
-
}, /*#__PURE__*/React__default["default"].createElement("path", {
|
|
380
|
-
fill: "inherit",
|
|
381
|
-
d: "M0 0h1v10H0z"
|
|
382
|
-
})));
|
|
383
|
-
};
|
|
384
|
-
Divider.propTypes = {
|
|
385
|
-
/** height , width and color of the dot icon */
|
|
386
|
-
color: PropTypes__default["default"].string,
|
|
387
|
-
width: PropTypes__default["default"].string,
|
|
388
|
-
height: PropTypes__default["default"].string
|
|
389
|
-
};
|
|
390
|
-
|
|
391
|
-
var _styleModuleImportMap$1 = {
|
|
392
|
-
"./read-time.m.css": {
|
|
393
|
-
"read-time-wrapper": "read-time-m_read-time-wrapper__3GyC_",
|
|
394
|
-
"dot-indicator": "read-time-m_dot-indicator__3Sqh2",
|
|
395
|
-
"dark": "read-time-m_dark__3yRaK",
|
|
396
|
-
"light": "read-time-m_light__1GAZu"
|
|
397
|
-
}
|
|
398
|
-
};
|
|
399
|
-
var ReadTime = function ReadTime(_ref) {
|
|
400
|
-
var story = _ref.story,
|
|
401
|
-
_ref$opts = _ref.opts,
|
|
402
|
-
opts = _ref$opts === void 0 ? {} : _ref$opts,
|
|
403
|
-
_ref$isLightTheme = _ref.isLightTheme,
|
|
404
|
-
isLightTheme = _ref$isLightTheme === void 0 ? false : _ref$isLightTheme;
|
|
405
|
-
var config = useStateValue() || {};
|
|
406
|
-
var showReadTime = lodash.get(config, ["showReadTime"]) || lodash.get(opts, ["showReadTime"], true);
|
|
407
|
-
var readTime = lodash.get(story, ["read-time"], 0);
|
|
408
|
-
var textColor = isLightTheme ? "light" : getTextColor(config.theme);
|
|
409
|
-
if (!showReadTime || !readTime) return null;
|
|
410
|
-
var timeToRead = lodash.get(opts, ["localizedTimeToRead"]) || "min read";
|
|
411
|
-
return /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, /*#__PURE__*/React__default["default"].createElement("div", {
|
|
412
|
-
"data-test-id": "read-time",
|
|
413
|
-
className: "arrow-component arr--read-time " + _getClassName__default["default"]("read-time-wrapper ".concat(textColor), _styleModuleImportMap$1)
|
|
414
|
-
}, /*#__PURE__*/React__default["default"].createElement("span", {
|
|
415
|
-
className: "read-time-indicator read-time-m_dot-indicator__3Sqh2"
|
|
416
|
-
}, /*#__PURE__*/React__default["default"].createElement(Dot, {
|
|
417
|
-
color: textColor
|
|
418
|
-
})), /*#__PURE__*/React__default["default"].createElement("span", null, readTime, " ", timeToRead)));
|
|
419
|
-
};
|
|
420
|
-
ReadTime.propTypes = {
|
|
421
|
-
story: PropTypes__default["default"].shape({
|
|
422
|
-
"read-time": PropTypes__default["default"].number
|
|
423
|
-
}),
|
|
424
|
-
opts: PropTypes__default["default"].shape({
|
|
425
|
-
showReadTime: PropTypes__default["default"].bool
|
|
426
|
-
}),
|
|
427
|
-
isLightTheme: PropTypes__default["default"].bool
|
|
428
|
-
};
|
|
429
|
-
|
|
430
|
-
var _styleModuleImportMap = {
|
|
431
|
-
"./author-with-timestamp.m.css": {
|
|
432
|
-
"author-time-wrapper": "author-with-timestamp-m_author-time-wrapper__G7_eI",
|
|
433
|
-
"author-image": "author-with-timestamp-m_author-image__24xrD",
|
|
434
|
-
"dot": "author-with-timestamp-m_dot__1LHXD",
|
|
435
|
-
"bottom-fix": "author-with-timestamp-m_bottom-fix__1rWGv",
|
|
436
|
-
"dash": "author-with-timestamp-m_dash__2L5XC"
|
|
437
|
-
}
|
|
438
|
-
};
|
|
439
|
-
var AuthorWithTime = function AuthorWithTime(_ref) {
|
|
440
|
-
var story = _ref.story,
|
|
441
|
-
separator = _ref.separator,
|
|
442
|
-
isBottom = _ref.isBottom,
|
|
443
|
-
hideAuthorImage = _ref.hideAuthorImage,
|
|
444
|
-
prefix = _ref.prefix,
|
|
445
|
-
_ref$config = _ref.config,
|
|
446
|
-
config = _ref$config === void 0 ? {} : _ref$config,
|
|
447
|
-
isLightTheme = _ref.isLightTheme;
|
|
448
|
-
var configState = useStateValue() || {};
|
|
449
|
-
var isAuthor = lodash.get(config, ["showAuthor"], lodash.get(configState, ["showAuthor"], true));
|
|
450
|
-
var isTime = lodash.get(config, ["showTime"], lodash.get(configState, ["showTime"], true));
|
|
451
|
-
var isReadTime = lodash.get(configState, ["showReadTime"], true);
|
|
452
|
-
var isBottomClasses = isBottom ? "bottom-fix" : "";
|
|
453
|
-
var seperatorStyle = separator === "dot" ? "dot" : "dash";
|
|
454
|
-
var textColor = isLightTheme ? "light" : getTextColor(configState.theme);
|
|
455
|
-
|
|
456
|
-
var getSeparator = function getSeparator() {
|
|
457
|
-
if (separator === "divider") {
|
|
458
|
-
return /*#__PURE__*/React__default["default"].createElement(Divider, {
|
|
459
|
-
color: textColor
|
|
460
|
-
});
|
|
461
|
-
}
|
|
462
|
-
|
|
463
|
-
return /*#__PURE__*/React__default["default"].createElement(Dot, {
|
|
464
|
-
color: textColor
|
|
465
|
-
});
|
|
466
|
-
};
|
|
467
|
-
|
|
468
|
-
var getTimeStamp = function getTimeStamp() {
|
|
469
|
-
if (!isTime) return null;
|
|
470
|
-
return /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, isAuthor && /*#__PURE__*/React__default["default"].createElement("span", {
|
|
471
|
-
className: "arr-separator " + _getClassName__default["default"]("".concat(seperatorStyle), _styleModuleImportMap)
|
|
472
|
-
}, getSeparator()), /*#__PURE__*/React__default["default"].createElement(TimeStamp, {
|
|
473
|
-
story: story,
|
|
474
|
-
config: config
|
|
475
|
-
}), isReadTime && /*#__PURE__*/React__default["default"].createElement(ReadTime, {
|
|
476
|
-
story: story,
|
|
477
|
-
opts: config,
|
|
478
|
-
isLightTheme: isLightTheme
|
|
479
|
-
}));
|
|
480
|
-
};
|
|
481
|
-
|
|
482
|
-
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
483
|
-
className: "arr--author-time " + _getClassName__default["default"]("author-time-wrapper ".concat(isBottomClasses), _styleModuleImportMap)
|
|
484
|
-
}, isAuthor ? /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, /*#__PURE__*/React__default["default"].createElement(Author, {
|
|
485
|
-
story: story,
|
|
486
|
-
isBottom: true,
|
|
487
|
-
hideAuthorImage: hideAuthorImage,
|
|
488
|
-
prefix: prefix
|
|
489
|
-
}), getTimeStamp()) : getTimeStamp());
|
|
490
|
-
};
|
|
491
|
-
AuthorWithTime.propTypes = {
|
|
492
|
-
story: PropTypes__default["default"].object,
|
|
493
|
-
|
|
494
|
-
/** Style of separator between the Author & Timestamp */
|
|
495
|
-
separator: PropTypes__default["default"].oneOf(["dot", "divider"]),
|
|
496
|
-
|
|
497
|
-
/** hide the author image */
|
|
498
|
-
hideAuthorImage: PropTypes__default["default"].bool,
|
|
499
|
-
// fix author and time at the end
|
|
500
|
-
isBottom: PropTypes__default["default"].bool,
|
|
501
|
-
// fix prefix before the author name
|
|
502
|
-
prefix: PropTypes__default["default"].string,
|
|
503
|
-
config: PropTypes__default["default"].object,
|
|
504
|
-
isLightTheme: PropTypes__default["default"].bool
|
|
505
|
-
};
|
|
506
|
-
AuthorWithTime.defaultProps = {
|
|
507
|
-
separator: "dot",
|
|
508
|
-
isBottom: false,
|
|
509
|
-
hideAuthorImage: true,
|
|
510
|
-
prefix: "",
|
|
511
|
-
isLightTheme: false
|
|
512
|
-
};
|
|
513
|
-
|
|
514
|
-
exports.AuthorWithTime = AuthorWithTime;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
.timestamp-m_time__nFaiw{display:flex;margin-bottom:2px}.timestamp-m_time-wrapper__K6nmZ{margin-bottom:var(--arrow-spacing-xxs)}.timestamp-m_bottom-fix__gjxS2{margin-top:auto}.timestamp-m_dark__z8gbw{color:var(--arrow-c-mono4)}.timestamp-m_light__BcFUe{color:var(--arrow-c-invert-mono4)}.author-m_author__GP-nT{align-items:center;color:var(--arrow-c-mono4);display:flex;margin-bottom:var(--arrow-spacing-xs)}.author-m_author-image__vpWED{border-radius:100%;height:var(--arrow-spacing-l);margin-right:var(--arrow-spacing-xs);overflow:hidden;width:var(--arrow-spacing-l)}.author-m_author-image__vpWED figure,.author-m_author-image__vpWED img{height:100%;width:100%}.author-m_author-name__H-L6p{margin:auto var(--arrow-spacing-xs) auto 0}.author-m_bottom-fix__iLW5j{margin-top:auto}.author-m_prefix__fXK6f{margin:auto var(--arrow-spacing-xxs) auto 0}.author-m_rtl-image__fPZig{display:none}html[dir=rtl] .author-m_author-name__H-L6p{margin-right:0}html[dir=rtl] .author-m_prefix__fXK6f{margin-left:var(--arrow-spacing-xxs);margin-right:0}html[dir=rtl] .author-m_ltr-image__ZBPrO{display:none}html[dir=rtl] .author-m_rtl-image__fPZig{display:block}.author-m_dark__tes5T{color:var(--arrow-c-mono4)}.author-m_light__KyiCD{color:var(--arrow-c-invert-mono4)}.dot-m_dark__pv0-t{fill:var(--arrow-c-mono4)}.dot-m_light__emVqc{fill:var(--arrow-c-invert-mono4)}.divider-m_dark__9iuK9{fill:var(--arrow-c-mono4)}.divider-m_light__K1yzB{fill:var(--arrow-c-invert-mono4)}.author-with-timestamp-m_author-time-wrapper__6mTnA{align-items:center;color:var(--arrow-c-mono2);display:flex;flex-wrap:wrap}.author-with-timestamp-m_author-image__x3ck7{border-radius:100%;height:var(--arrow-spacing-l);margin-right:var(--arrow-spacing-xs);width:var(--arrow-spacing-l)}.author-with-timestamp-m_dot__P84rZ{margin-right:var(--arrow-spacing-xs);position:relative;top:-6px}.author-with-timestamp-m_bottom-fix__jceqG{margin-top:auto}.author-with-timestamp-m_dash__eaT-k{margin-right:var(--arrow-spacing-xs);position:relative;top:-1px}@media (min-width:768px){.author-with-timestamp-m_dash__eaT-k{top:-3px}}html[dir=rtl] .author-with-timestamp-m_dot__P84rZ{margin-left:var(--arrow-spacing-xs)}html[dir=rtl] .author-with-timestamp-m_dash__eaT-k{padding-left:var(--arrow-spacing-xs)}.read-time-m_read-time-wrapper__ltd31{display:flex;font-size:var(--arrow-fs-tiny);line-height:var(--arrow-lh-2)}.read-time-m_dot-indicator__RMIwp{padding:0 var(--arrow-spacing-xs) var(--arrow-spacing-xs)}.read-time-m_dark__tpGlu{color:var(--arrow-c-mono4)}.read-time-m_light__g3NL4{color:var(--arrow-c-invert-mono4)}html[dir=rtl] .read-time-m_read-time-wrapper__ltd31{margin-right:var(--arrow-spacing-xs)}
|