@desynova-digital/components 9.2.28 → 9.2.30
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/atoms/cardV2/cardV2.js +4 -2
- package/atoms/cardV2/thumbnailV2.js +97 -35
- package/package.json +2 -2
package/atoms/cardV2/cardV2.js
CHANGED
|
@@ -96,7 +96,8 @@ CardV2.propTypes = {
|
|
|
96
96
|
bgColor: _propTypes["default"].oneOf(['primary', 'secondary']),
|
|
97
97
|
isCardv2: _propTypes["default"].bool,
|
|
98
98
|
nestedDropdownData: _propTypes["default"].arrayOf(_propTypes["default"].object),
|
|
99
|
-
onNestedDropdownSelect: _propTypes["default"].func
|
|
99
|
+
onNestedDropdownSelect: _propTypes["default"].func,
|
|
100
|
+
isSearchPageCard: _propTypes["default"].bool
|
|
100
101
|
};
|
|
101
102
|
CardV2.defaultProps = {
|
|
102
103
|
isSegment: false,
|
|
@@ -105,6 +106,7 @@ CardV2.defaultProps = {
|
|
|
105
106
|
type: 'asset',
|
|
106
107
|
bgColor: 'primary',
|
|
107
108
|
thumbnail: 'https://thumbnail.desynova.com/default_placeholder/Contido_Placeholder_Image.png',
|
|
108
|
-
preview: ''
|
|
109
|
+
preview: '',
|
|
110
|
+
isSearchPageCard: false
|
|
109
111
|
};
|
|
110
112
|
var _default = exports["default"] = CardV2;
|
|
@@ -18,7 +18,7 @@ var _tokens2 = require("../../../tokens");
|
|
|
18
18
|
var _statusV = _interopRequireDefault(require("../../../tokens/statusV2"));
|
|
19
19
|
var _cardV = require("./cardV2");
|
|
20
20
|
var _utils = require("../../_helpers/utils");
|
|
21
|
-
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9, _templateObject10, _templateObject11, _templateObject12, _templateObject13, _templateObject14, _templateObject15, _templateObject16, _templateObject17, _templateObject18, _templateObject19, _templateObject20, _templateObject21, _templateObject22, _templateObject23, _templateObject24; // atoms
|
|
21
|
+
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9, _templateObject10, _templateObject11, _templateObject12, _templateObject13, _templateObject14, _templateObject15, _templateObject16, _templateObject17, _templateObject18, _templateObject19, _templateObject20, _templateObject21, _templateObject22, _templateObject23, _templateObject24, _templateObject25; // atoms
|
|
22
22
|
// tokens
|
|
23
23
|
// styles
|
|
24
24
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
@@ -177,7 +177,7 @@ var IconButtonStyles = (0, _styledComponents["default"])(function (props) {
|
|
|
177
177
|
});
|
|
178
178
|
var CardHeader = _styledComponents["default"].div(_templateObject19 || (_templateObject19 = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n justify-content: space-between;\n padding: 10px;\n"])));
|
|
179
179
|
var BottomActionContainer = _styledComponents["default"].div(_templateObject20 || (_templateObject20 = (0, _taggedTemplateLiteral2["default"])(["\n position: absolute;\n bottom: 8px;\n right: 8px;\n display: flex;\n align-items: center;\n gap: 6px;\n z-index: 3;\n opacity: 1;\n"])));
|
|
180
|
-
var SegmentTimeline = _styledComponents["default"].div(_templateObject21 || (_templateObject21 = (0, _taggedTemplateLiteral2["default"])(["\n width: 100%;\n height: 5px;\n position: absolute;\n top: 105px;\n left: 0;\n background: rgba(
|
|
180
|
+
var SegmentTimeline = _styledComponents["default"].div(_templateObject21 || (_templateObject21 = (0, _taggedTemplateLiteral2["default"])(["\n width: 100%;\n height: 5px;\n position: absolute;\n top: 105px;\n left: 0;\n background: rgba(12, 20, 29, 0.6);\n border-radius: 2px;\n"])));
|
|
181
181
|
var SegmentTimelinePopup = _styledComponents["default"].div(_templateObject22 || (_templateObject22 = (0, _taggedTemplateLiteral2["default"])(["\n display: inline-flex;\n width: max-content;\n max-width: calc(100% - 8px);\n min-height: 28px;\n padding: 6px 8px;\n box-sizing: border-box;\n align-items: center;\n justify-content: center;\n border-radius: 4px;\n background: var(--Color-Text-color-Pure-White, #fff);\n position: absolute;\n bottom: calc(100% + 6px);\n left: ", ";\n right: ", ";\n transform: ", ";\n box-shadow: 0 10px 30px rgba(13, 24, 41, 0.12);\n opacity: 0;\n visibility: hidden;\n transition:\n opacity 120ms ease,\n visibility 120ms ease;\n z-index: 20;\n\n span {\n color: #0b0f15;\n font-family: SFUIText-Regular;\n font-size: 10px;\n line-height: 12px;\n text-align: center;\n white-space: normal;\n overflow-wrap: anywhere;\n }\n"])), function (_ref13) {
|
|
182
182
|
var alignment = _ref13.alignment,
|
|
183
183
|
left = _ref13.left;
|
|
@@ -189,15 +189,22 @@ var SegmentTimelinePopup = _styledComponents["default"].div(_templateObject22 ||
|
|
|
189
189
|
var alignment = _ref15.alignment;
|
|
190
190
|
return alignment === "center" ? "translateX(-50%)" : "none";
|
|
191
191
|
});
|
|
192
|
-
var
|
|
192
|
+
var SegmentTimelinePointer = _styledComponents["default"].span(_templateObject23 || (_templateObject23 = (0, _taggedTemplateLiteral2["default"])(["\n position: absolute;\n left: ", ";\n bottom: calc(100% + 1px);\n transform: translateX(-50%);\n width: 0;\n height: 0;\n border-left: 6px solid transparent;\n border-right: 6px solid transparent;\n border-top: 8px solid ", ";\n opacity: 0;\n visibility: hidden;\n transition:\n opacity 120ms ease,\n visibility 120ms ease;\n z-index: 19;\n pointer-events: none;\n"])), function (_ref16) {
|
|
193
193
|
var left = _ref16.left;
|
|
194
194
|
return left;
|
|
195
195
|
}, function (_ref17) {
|
|
196
|
-
var
|
|
196
|
+
var theme = _ref17.theme;
|
|
197
|
+
return _tokens.colors[theme].card.themeColor;
|
|
198
|
+
});
|
|
199
|
+
var SegmentRangeMarker = _styledComponents["default"].div(_templateObject24 || (_templateObject24 = (0, _taggedTemplateLiteral2["default"])(["\n position: absolute;\n top: -6px;\n left: ", ";\n width: ", ";\n height: calc(100% + 12px);\n display: flex;\n align-items: center;\n justify-content: center;\n cursor: pointer;\n z-index: 15;\n\n &:hover + ", " {\n opacity: 1;\n visibility: visible;\n }\n\n &:hover + ", " + ", " {\n opacity: 1;\n visibility: visible;\n }\n"])), function (_ref18) {
|
|
200
|
+
var left = _ref18.left;
|
|
201
|
+
return left;
|
|
202
|
+
}, function (_ref19) {
|
|
203
|
+
var width = _ref19.width;
|
|
197
204
|
return width;
|
|
198
|
-
}, SegmentTimelinePopup);
|
|
199
|
-
var SegmentRangeBar = _styledComponents["default"].div(
|
|
200
|
-
var theme =
|
|
205
|
+
}, SegmentTimelinePopup, SegmentTimelinePopup, SegmentTimelinePointer);
|
|
206
|
+
var SegmentRangeBar = _styledComponents["default"].div(_templateObject25 || (_templateObject25 = (0, _taggedTemplateLiteral2["default"])(["\n width: 100%;\n height: 5px;\n border-radius: 2px;\n background: ", ";\n"])), function (_ref20) {
|
|
207
|
+
var theme = _ref20.theme;
|
|
201
208
|
return _tokens.colors[theme].card.themeColor;
|
|
202
209
|
});
|
|
203
210
|
var hasTimecodeFormat = function hasTimecodeFormat(value) {
|
|
@@ -235,13 +242,55 @@ var getStatusHexColor = function getStatusHexColor(status) {
|
|
|
235
242
|
});
|
|
236
243
|
return (matched === null || matched === void 0 ? void 0 : (_matched$hex = matched.hex) === null || _matched$hex === void 0 ? void 0 : _matched$hex.background) || "#18B96E";
|
|
237
244
|
};
|
|
245
|
+
var ARCHIVED_STATUS_CONFIG = {
|
|
246
|
+
0: {
|
|
247
|
+
label: "Pending",
|
|
248
|
+
color: "#AFB2BA"
|
|
249
|
+
},
|
|
250
|
+
pending: {
|
|
251
|
+
label: "Pending",
|
|
252
|
+
color: "#AFB2BA"
|
|
253
|
+
},
|
|
254
|
+
1: {
|
|
255
|
+
label: "Archived",
|
|
256
|
+
color: "#18B96E"
|
|
257
|
+
},
|
|
258
|
+
archive: {
|
|
259
|
+
label: "Archived",
|
|
260
|
+
color: "#18B96E"
|
|
261
|
+
},
|
|
262
|
+
archived: {
|
|
263
|
+
label: "Archived",
|
|
264
|
+
color: "#18B96E"
|
|
265
|
+
},
|
|
266
|
+
2: {
|
|
267
|
+
label: "Error",
|
|
268
|
+
color: "#FF6C56"
|
|
269
|
+
},
|
|
270
|
+
error: {
|
|
271
|
+
label: "Error",
|
|
272
|
+
color: "#FF6C56"
|
|
273
|
+
},
|
|
274
|
+
3: {
|
|
275
|
+
label: "In Progress",
|
|
276
|
+
color: "#FF8D29"
|
|
277
|
+
},
|
|
278
|
+
inprogress: {
|
|
279
|
+
label: "In Progress",
|
|
280
|
+
color: "#FF8D29"
|
|
281
|
+
},
|
|
282
|
+
in_progress: {
|
|
283
|
+
label: "In Progress",
|
|
284
|
+
color: "#FF8D29"
|
|
285
|
+
}
|
|
286
|
+
};
|
|
287
|
+
var getArchivedStatusHexColor = function getArchivedStatusHexColor(status) {
|
|
288
|
+
var _ARCHIVED_STATUS_CONF;
|
|
289
|
+
return (_ARCHIVED_STATUS_CONF = ARCHIVED_STATUS_CONFIG[normalizeStatusCode(status)]) === null || _ARCHIVED_STATUS_CONF === void 0 ? void 0 : _ARCHIVED_STATUS_CONF.color;
|
|
290
|
+
};
|
|
238
291
|
var getStatusLabel = function getStatusLabel(status) {
|
|
239
|
-
var
|
|
240
|
-
|
|
241
|
-
if (normalized === "3") return "In Progress";
|
|
242
|
-
if (normalized === "2") return "Error";
|
|
243
|
-
if (normalized === "1") return "Archive";
|
|
244
|
-
return null;
|
|
292
|
+
var _ARCHIVED_STATUS_CONF2;
|
|
293
|
+
return ((_ARCHIVED_STATUS_CONF2 = ARCHIVED_STATUS_CONFIG[normalizeStatusCode(status)]) === null || _ARCHIVED_STATUS_CONF2 === void 0 ? void 0 : _ARCHIVED_STATUS_CONF2.label) || null;
|
|
245
294
|
};
|
|
246
295
|
var ThumbnailV2 = function ThumbnailV2(props) {
|
|
247
296
|
var theme = props.theme,
|
|
@@ -273,12 +322,19 @@ var ThumbnailV2 = function ThumbnailV2(props) {
|
|
|
273
322
|
isSegment = props.isSegment,
|
|
274
323
|
is_segment = props.is_segment,
|
|
275
324
|
frame_rate = props.frame_rate,
|
|
276
|
-
archived_status = props.archived_status
|
|
325
|
+
archived_status = props.archived_status,
|
|
326
|
+
isSearchPageCard = props.isSearchPageCard;
|
|
277
327
|
var effectiveFrameRate = Number(frame_rate) || 25;
|
|
278
|
-
var
|
|
328
|
+
var fullDurationValue = full_duration === undefined || full_duration === null ? "" : String(full_duration).trim();
|
|
329
|
+
var hasFullDuration = Boolean(fullDurationValue) && (hasTimecodeFormat(fullDurationValue) || Number.isFinite(Number(fullDurationValue)));
|
|
330
|
+
var resolvedDuration = hasFullDuration ? full_duration : duration;
|
|
331
|
+
var durationValue = resolvedDuration === undefined || resolvedDuration === null ? "" : String(resolvedDuration).trim();
|
|
332
|
+
var hasDuration = Boolean(durationValue) && (hasTimecodeFormat(durationValue) || Number.isFinite(Number(durationValue)));
|
|
333
|
+
var displayDuration = hasDuration ? getDisplayTimecode(durationValue, effectiveFrameRate) : "";
|
|
334
|
+
var displayAssetType = asset_type === undefined || asset_type === null ? "" : String(asset_type).trim();
|
|
279
335
|
var actionItems = Array.isArray(actions) ? actions : [];
|
|
280
336
|
var isSegmentCard = Boolean(isSegment || is_segment);
|
|
281
|
-
var totalSeconds = getTimeInSeconds(
|
|
337
|
+
var totalSeconds = getTimeInSeconds(resolvedDuration, effectiveFrameRate);
|
|
282
338
|
var segmentStartSeconds = Math.max(0, Math.min(totalSeconds, getRelativeTimeInSeconds(in_time, in_timecode, effectiveFrameRate)));
|
|
283
339
|
var segmentEndSeconds = Math.max(0, Math.min(totalSeconds, getRelativeTimeInSeconds(out_time, out_timecode, effectiveFrameRate)));
|
|
284
340
|
var displayInTimecode = getDisplayTimecode(in_timecode, effectiveFrameRate);
|
|
@@ -341,24 +397,25 @@ var ThumbnailV2 = function ThumbnailV2(props) {
|
|
|
341
397
|
}, [showTopRightAction]);
|
|
342
398
|
var handleMouseMove = (0, _react.useCallback)(function (event) {
|
|
343
399
|
if (iframeImageBlockRef.current && hoverPointerRef.current && iframeImageRef.current) {
|
|
344
|
-
var
|
|
400
|
+
var iframeBlock = iframeImageBlockRef.current;
|
|
401
|
+
var iframeImage = iframeImageRef.current;
|
|
402
|
+
var iframeBlockHeight = iframeBlock.offsetHeight;
|
|
345
403
|
var iframeOgHeight = 120;
|
|
346
|
-
var ogHeight =
|
|
347
|
-
var offsetHeight =
|
|
348
|
-
var
|
|
349
|
-
var
|
|
404
|
+
var ogHeight = iframeImage.naturalHeight;
|
|
405
|
+
var offsetHeight = iframeImage.offsetHeight;
|
|
406
|
+
var rect = iframeBlock.getBoundingClientRect();
|
|
407
|
+
var offsetWidth = rect.width;
|
|
408
|
+
var iframeCount = Math.max(1, Math.floor(ogHeight / iframeOgHeight));
|
|
409
|
+
if (!ogHeight || !offsetHeight || !offsetWidth) return;
|
|
350
410
|
var iframeOffsetHeight = offsetHeight / iframeCount;
|
|
351
411
|
var imageChangePoint = offsetWidth / iframeCount;
|
|
352
412
|
var offsetTop = Math.abs(iframeBlockHeight - iframeOffsetHeight) / 2;
|
|
353
|
-
|
|
354
|
-
var imageNum =
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
imageTop = offsetHeight + offsetTop - iframeOffsetHeight;
|
|
358
|
-
}
|
|
359
|
-
iframeImageRef.current.style.top = "-".concat(imageTop, "px");
|
|
413
|
+
var pointerX = Math.max(0, Math.min(offsetWidth - 1, event.clientX - rect.left));
|
|
414
|
+
var imageNum = Math.min(iframeCount - 1, Math.floor(pointerX / imageChangePoint));
|
|
415
|
+
hoverPointerRef.current.style.left = "".concat(pointerX, "px");
|
|
416
|
+
iframeImage.style.top = "".concat(offsetTop - iframeOffsetHeight * imageNum - 11, "px");
|
|
360
417
|
}
|
|
361
|
-
}, [
|
|
418
|
+
}, []);
|
|
362
419
|
var handleThumbnailClick = (0, _react.useCallback)(function (e) {
|
|
363
420
|
if (!isClickPrevented) {
|
|
364
421
|
actionClick(e, "play", ingest_db_id);
|
|
@@ -396,7 +453,7 @@ var ThumbnailV2 = function ThumbnailV2(props) {
|
|
|
396
453
|
theme: props.theme,
|
|
397
454
|
data_type: data_type
|
|
398
455
|
}, getStatusLabel(archived_status) ? /*#__PURE__*/_react["default"].createElement(ThumbnailStatusPill, {
|
|
399
|
-
bgColor:
|
|
456
|
+
bgColor: getArchivedStatusHexColor(archived_status)
|
|
400
457
|
}, /*#__PURE__*/_react["default"].createElement("span", {
|
|
401
458
|
className: "status-dot"
|
|
402
459
|
}), getStatusLabel(archived_status)) : null, hasSegmentTimeline && /*#__PURE__*/_react["default"].createElement(SegmentTimeline, null, /*#__PURE__*/_react["default"].createElement(SegmentRangeMarker, {
|
|
@@ -408,9 +465,12 @@ var ThumbnailV2 = function ThumbnailV2(props) {
|
|
|
408
465
|
})), /*#__PURE__*/_react["default"].createElement(SegmentTimelinePopup, {
|
|
409
466
|
alignment: segmentPopupAlignment,
|
|
410
467
|
left: "".concat(segmentCenterPercent, "%")
|
|
411
|
-
}, /*#__PURE__*/_react["default"].createElement("span", null, "".concat(displayInTimecode, " to ").concat(displayOutTimecode)))
|
|
468
|
+
}, /*#__PURE__*/_react["default"].createElement("span", null, "".concat(displayInTimecode, " to ").concat(displayOutTimecode))), /*#__PURE__*/_react["default"].createElement(SegmentTimelinePointer, {
|
|
469
|
+
theme: theme,
|
|
470
|
+
left: "".concat(segmentCenterPercent, "%")
|
|
471
|
+
})), isSearchPageCard && displayAssetType ? /*#__PURE__*/_react["default"].createElement(AssetTypeChip, {
|
|
412
472
|
theme: theme
|
|
413
|
-
},
|
|
473
|
+
}, displayAssetType) : null, /*#__PURE__*/_react["default"].createElement(CardHeader, null, /*#__PURE__*/_react["default"].createElement(_cardV.DivStyles, {
|
|
414
474
|
theme: props.theme,
|
|
415
475
|
className: "asset-card-thumbnail-head",
|
|
416
476
|
display: "flex",
|
|
@@ -497,7 +557,7 @@ var ThumbnailV2 = function ThumbnailV2(props) {
|
|
|
497
557
|
className: "iframe-image",
|
|
498
558
|
src: iframeurl,
|
|
499
559
|
alt: "preview"
|
|
500
|
-
})) || null, /*#__PURE__*/_react["default"].createElement(DurationBadge, null, displayDuration));
|
|
560
|
+
})) || null, isSearchPageCard && displayDuration ? /*#__PURE__*/_react["default"].createElement(DurationBadge, null, displayDuration) : null);
|
|
501
561
|
};
|
|
502
562
|
ThumbnailV2.propTypes = {
|
|
503
563
|
theme: _propTypes["default"].oneOf(["light", "dark", "nexc"]),
|
|
@@ -523,13 +583,15 @@ ThumbnailV2.propTypes = {
|
|
|
523
583
|
duration: _propTypes["default"].oneOfType([_propTypes["default"].string, _propTypes["default"].number]),
|
|
524
584
|
isSegment: _propTypes["default"].bool,
|
|
525
585
|
is_segment: _propTypes["default"].bool,
|
|
526
|
-
frame_rate: _propTypes["default"].oneOfType([_propTypes["default"].string, _propTypes["default"].number])
|
|
586
|
+
frame_rate: _propTypes["default"].oneOfType([_propTypes["default"].string, _propTypes["default"].number]),
|
|
587
|
+
isSearchPageCard: _propTypes["default"].bool
|
|
527
588
|
};
|
|
528
589
|
ThumbnailV2.defaultProps = {
|
|
529
590
|
theme: "dark",
|
|
530
591
|
width: "lg",
|
|
531
592
|
thumbnail: "https://thumbnail.desynova.com/default_placeholder/Contido_Placeholder_Image.png",
|
|
532
593
|
iframeurl: "",
|
|
533
|
-
isAdobe: false
|
|
594
|
+
isAdobe: false,
|
|
595
|
+
isSearchPageCard: false
|
|
534
596
|
};
|
|
535
597
|
var _default = exports["default"] = ThumbnailV2;
|
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@desynova-digital/components",
|
|
3
|
-
"version": "9.2.
|
|
3
|
+
"version": "9.2.30",
|
|
4
4
|
"description": "Components for Desynova Digital",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"author": "desynova-digital",
|
|
7
7
|
"license": "MIT",
|
|
8
8
|
"repository": "desynova-digital",
|
|
9
9
|
"dependencies": {
|
|
10
|
-
"@desynova-digital/tokens": "9.2.
|
|
10
|
+
"@desynova-digital/tokens": "9.2.30",
|
|
11
11
|
"prop-types": "^15.7.2",
|
|
12
12
|
"styled-components": "^4.3.2"
|
|
13
13
|
},
|