oolib 2.123.0 → 2.124.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/Tags/Comps/TagDisplay/index.d.ts +2 -0
- package/dist/components/Tags/Comps/TagDisplay/index.js +3 -2
- package/dist/components/Tags/Comps/TagDisplay/styled.d.ts +1 -0
- package/dist/components/Tags/Comps/TagDisplay/styled.js +20 -7
- package/dist/components/cards/CardContent/index.d.ts +2 -1
- package/dist/components/cards/CardContent/index.js +10 -10
- package/dist/components/cards/CardContent/styled.js +6 -6
- package/dist/components/cards/ListContent/index.js +2 -1
- package/dist/components/cards/utils/parseCardConfig.d.ts +0 -1
- package/dist/components/cards/utils/parseCardConfig.js +0 -2
- package/dist/stories/cards/CardContent.stories.d.ts +1 -2
- package/dist/stories/cards/utils/cardArgTypes.d.ts +1 -3
- package/dist/stories/cards/utils/cardArgTypes.js +3 -4
- package/dist/stories/cards/utils/parseCardArgs.d.ts +4 -4
- package/dist/stories/cards/utils/parseCardArgs.js +5 -4
- package/package.json +1 -1
|
@@ -7,6 +7,7 @@ export interface TagDisplayProps {
|
|
|
7
7
|
XS?: boolean;
|
|
8
8
|
tagColor?: string;
|
|
9
9
|
textColor?: string;
|
|
10
|
+
color?: 'red' | 'green' | 'black';
|
|
10
11
|
variant?: 'primary' | 'secondary';
|
|
11
12
|
}
|
|
12
13
|
/**
|
|
@@ -19,6 +20,7 @@ export interface TagDisplayProps {
|
|
|
19
20
|
* @prop {boolean} [M] : A boolean indicating whether the component should render at the large size. Defaults to false.
|
|
20
21
|
* @prop {boolean} [XS] : A boolean indicating whether the component should render at the extra small size. Defaults to false.
|
|
21
22
|
* @prop {string} [tagColor] : A string indicating the background color of the component. Defaults to undefined.
|
|
23
|
+
* @prop {red | green | black} [color] : A string indicating the background color of the component. Defaults to undefined.
|
|
22
24
|
* @prop {string} [textColor] : A string indicating the text color of the component. Defaults to undefined.
|
|
23
25
|
* @prop {('primary' | 'secondary')} [variant] : A string indicating the variant of the component. Defaults to "primary".
|
|
24
26
|
* @return {ReactElement} The rendered TagDisplay component.
|
|
@@ -17,15 +17,16 @@ var getTypoComp_1 = require("../../utils/getTypoComp");
|
|
|
17
17
|
* @prop {boolean} [M] : A boolean indicating whether the component should render at the large size. Defaults to false.
|
|
18
18
|
* @prop {boolean} [XS] : A boolean indicating whether the component should render at the extra small size. Defaults to false.
|
|
19
19
|
* @prop {string} [tagColor] : A string indicating the background color of the component. Defaults to undefined.
|
|
20
|
+
* @prop {red | green | black} [color] : A string indicating the background color of the component. Defaults to undefined.
|
|
20
21
|
* @prop {string} [textColor] : A string indicating the text color of the component. Defaults to undefined.
|
|
21
22
|
* @prop {('primary' | 'secondary')} [variant] : A string indicating the variant of the component. Defaults to "primary".
|
|
22
23
|
* @return {ReactElement} The rendered TagDisplay component.
|
|
23
24
|
*/
|
|
24
25
|
var TagDisplay = function (_a) {
|
|
25
|
-
var display = _a.display, style = _a.style, invert = _a.invert, M = _a.M, XS = _a.XS, tagColor = _a.tagColor, textColor = _a.textColor, _b = _a.variant, variant = _b === void 0 ? 'primary' : _b;
|
|
26
|
+
var display = _a.display, style = _a.style, invert = _a.invert, M = _a.M, XS = _a.XS, tagColor = _a.tagColor, textColor = _a.textColor, color = _a.color, _b = _a.variant, variant = _b === void 0 ? 'primary' : _b;
|
|
26
27
|
var size = M ? 'M' : XS ? 'XS' : 'S';
|
|
27
28
|
var TYPO_COMP = (0, getTypoComp_1.getTypoComp)(size);
|
|
28
|
-
return (react_1.default.createElement(styled_1.StyledTagDisplay, { variant: variant, invert: invert, textColor: textColor, tagColor: tagColor, size: size, style: style },
|
|
29
|
+
return (react_1.default.createElement(styled_1.StyledTagDisplay, { variant: variant, invert: invert, textColor: textColor, tagColor: tagColor, size: size, style: style, color: color },
|
|
29
30
|
react_1.default.createElement(TYPO_COMP, null, display)));
|
|
30
31
|
};
|
|
31
32
|
exports.TagDisplay = TagDisplay;
|
|
@@ -5,5 +5,6 @@ export interface StyledTagDisplayProps {
|
|
|
5
5
|
size: keyof typeof SIZES;
|
|
6
6
|
textColor?: string;
|
|
7
7
|
tagColor?: string;
|
|
8
|
+
color?: 'red' | 'green' | 'black';
|
|
8
9
|
}
|
|
9
10
|
export declare const StyledTagDisplay: import("styled-components").StyledComponent<"div", any, StyledTagDisplayProps, never>;
|
|
@@ -31,14 +31,27 @@ exports.StyledTagDisplay = void 0;
|
|
|
31
31
|
var styled_components_1 = __importStar(require("styled-components"));
|
|
32
32
|
var styled_1 = require("../styled");
|
|
33
33
|
var themes_1 = require("../../../../themes");
|
|
34
|
-
var greyColor100 = themes_1.colors.greyColor100, greyColor80 = themes_1.colors.greyColor80, greyColor15 = themes_1.colors.greyColor15, greyColor40 = themes_1.colors.greyColor40;
|
|
35
|
-
exports.StyledTagDisplay = styled_components_1.default.div(
|
|
34
|
+
var greyColor100 = themes_1.colors.greyColor100, greyColor80 = themes_1.colors.greyColor80, greyColor15 = themes_1.colors.greyColor15, greyColor40 = themes_1.colors.greyColor40, red = themes_1.colors.red, invertRed = themes_1.colors.invertRed, green = themes_1.colors.green, invertGreen = themes_1.colors.invertGreen;
|
|
35
|
+
exports.StyledTagDisplay = styled_components_1.default.div(templateObject_6 || (templateObject_6 = __makeTemplateObject(["\n ", "\n ", "\n"], ["\n ", "\n ", "\n"])), function (_a) {
|
|
36
36
|
var size = _a.size;
|
|
37
37
|
return (0, styled_1.commonStyle)({ size: size });
|
|
38
38
|
}, function (_a) {
|
|
39
|
-
var variant = _a.variant, invert = _a.invert, size = _a.size, textColor = _a.textColor, tagColor = _a.tagColor;
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
39
|
+
var variant = _a.variant, invert = _a.invert, size = _a.size, textColor = _a.textColor, tagColor = _a.tagColor, color = _a.color;
|
|
40
|
+
switch (variant) {
|
|
41
|
+
case 'primary':
|
|
42
|
+
switch (color) {
|
|
43
|
+
case 'red':
|
|
44
|
+
return (0, styled_components_1.css)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n width: max-content;\n background-color: ", ";\n ", "\n ", "\n "], ["\n width: max-content;\n background-color: ", ";\n ", "\n ", "\n "])), !invert ? red : invertRed, (0, styled_1.textColor)({ invert: invert }), (0, styled_1.redHover)({ invert: invert }));
|
|
45
|
+
case 'green':
|
|
46
|
+
return (0, styled_components_1.css)(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n width: max-content;\n background-color: ", ";\n ", "\n ", "\n "], ["\n width: max-content;\n background-color: ", ";\n ", "\n ", "\n "])), !invert ? green : invertGreen, (0, styled_1.textColor)({ invert: invert }), (0, styled_1.greenHover)({ invert: invert }));
|
|
47
|
+
case 'black':
|
|
48
|
+
return (0, styled_components_1.css)(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n width: max-content;\n background-color: ", ";\n ", "\n ", "\n "], ["\n width: max-content;\n background-color: ", ";\n ", "\n ", "\n "])), !invert ? greyColor100 : greyColor15, (0, styled_1.textColor)({ invert: invert }), (0, styled_1.blackHover)({ invert: invert }));
|
|
49
|
+
default: //primary default
|
|
50
|
+
return (0, styled_components_1.css)(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n background-color: ", ";\n color: ", ";\n "], ["\n background-color: ", ";\n color: ", ";\n "])), tagColor ? tagColor : !invert ? greyColor15 : greyColor80, textColor ? textColor : !invert ? greyColor80 : greyColor40);
|
|
51
|
+
}
|
|
52
|
+
//secondary
|
|
53
|
+
case 'secondary':
|
|
54
|
+
return (0, styled_components_1.css)(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n background: none;\n border: ", " solid\n /* border: 2px solid */\n ", ";\n color: ", ";\n "], ["\n background: none;\n border: ", " solid\n /* border: 2px solid */\n ", ";\n color: ", ";\n "])), size === 'XS' ? '1px' : '2px', tagColor ? tagColor : !invert ? (size === 'XS' ? greyColor100 : greyColor15) : greyColor80, textColor ? textColor : !invert ? (size === 'XS' ? greyColor100 : greyColor80) : greyColor15);
|
|
55
|
+
}
|
|
43
56
|
});
|
|
44
|
-
var templateObject_1, templateObject_2, templateObject_3;
|
|
57
|
+
var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export function CardContent({ id, data, config, to, onClick, openInNewTab, actions, }: {
|
|
1
|
+
export function CardContent({ id, data, config, to, onClick, openInNewTab, actions, highlight }: {
|
|
2
2
|
id: any;
|
|
3
3
|
data: any;
|
|
4
4
|
config: any;
|
|
@@ -6,5 +6,6 @@ export function CardContent({ id, data, config, to, onClick, openInNewTab, actio
|
|
|
6
6
|
onClick: any;
|
|
7
7
|
openInNewTab: any;
|
|
8
8
|
actions: any;
|
|
9
|
+
highlight: any;
|
|
9
10
|
}): React.JSX.Element;
|
|
10
11
|
import React from "react";
|
|
@@ -25,26 +25,26 @@ var icons_1 = require("../../../icons");
|
|
|
25
25
|
var Tags_1 = require("../../Tags");
|
|
26
26
|
var CrownSimple = icons_1.icons.CrownSimple;
|
|
27
27
|
var CardContent = function (_a) {
|
|
28
|
-
var
|
|
29
|
-
var id = _a.id, data = _a.data, config = _a.config, to = _a.to, onClick = _a.onClick, openInNewTab = _a.openInNewTab, actions = _a.actions;
|
|
28
|
+
var id = _a.id, data = _a.data, config = _a.config, to = _a.to, onClick = _a.onClick, openInNewTab = _a.openInNewTab, actions = _a.actions, highlight = _a.highlight;
|
|
30
29
|
var theme = (0, styled_components_1.useTheme)();
|
|
30
|
+
var localize = (0, utilsOolib_1.useLocale)();
|
|
31
31
|
var parseSpecialSyntax = (theme || {}).parseSpecialSyntax;
|
|
32
32
|
var showEmbedSection = !!((config === null || config === void 0 ? void 0 : config.image) || (config === null || config === void 0 ? void 0 : config.video));
|
|
33
|
-
var
|
|
33
|
+
var _b = (0, parseCardConfig_1.parseCardConfig)({
|
|
34
34
|
config: config,
|
|
35
35
|
data: data,
|
|
36
36
|
parseSpecialSyntax: parseSpecialSyntax
|
|
37
|
-
}), cardLabel =
|
|
37
|
+
}), cardLabel = _b.cardLabel, title = _b.title, video = _b.video, image = _b.image, metaBlock = _b.metaBlock, tagDisplay = _b.tagDisplay;
|
|
38
38
|
var dontRenderRes = (0, dontRenderIfBothOnClickAndTo_1.dontRenderIfBothOnClickAndTo)({ onClick: onClick, to: to });
|
|
39
39
|
if (dontRenderRes)
|
|
40
40
|
return dontRenderRes;
|
|
41
|
-
var
|
|
41
|
+
var _c = (0, decideLinkCompAndTarget_1.decideLinkCompAndTarget)({ to: to, openInNewTab: openInNewTab }), LinkComp = _c.LinkComp, target = _c.target, externalUrl = _c.externalUrl;
|
|
42
42
|
return (react_1.default.createElement(LinkComp, { target: target, href: (0, injectHttps_1.injectHttps)(to), to: to },
|
|
43
|
-
react_1.default.createElement(styled_2.StyledCardWrapper, { id: id,
|
|
44
|
-
|
|
43
|
+
react_1.default.createElement(styled_2.StyledCardWrapper, { id: id, highlight: highlight, onClick: onClick ? function (e) { return onClick(e, data); } : undefined },
|
|
44
|
+
highlight && react_1.default.createElement(styled_2.StyledCrownWrapper, null,
|
|
45
45
|
react_1.default.createElement(styled_2.StyledCrown, null,
|
|
46
46
|
react_1.default.createElement(CrownSimple, { size: 24 }))),
|
|
47
|
-
react_1.default.createElement(styled_2.StyledUpperSection, {
|
|
47
|
+
react_1.default.createElement(styled_2.StyledUpperSection, { highlight: highlight },
|
|
48
48
|
react_1.default.createElement(styled_2.StyledContainer1, null,
|
|
49
49
|
cardLabel ? (react_1.default.createElement("div", { title: cardLabel, style: {
|
|
50
50
|
display: "flex",
|
|
@@ -61,8 +61,8 @@ var CardContent = function (_a) {
|
|
|
61
61
|
" ",
|
|
62
62
|
react_1.default.createElement(LineClampWrapper_1.LineClampWrapper, { noOfLines_M: 6, title: title },
|
|
63
63
|
react_1.default.createElement(styled_1.StyledTitle, { capitalize: true, className: "StyledTitle" },
|
|
64
|
-
react_1.default.createElement(styled_1.StyledTitleSpan, { className: "StyledTitleSpan" }, title))))) : null),
|
|
65
|
-
|
|
64
|
+
react_1.default.createElement(styled_1.StyledTitleSpan, { className: "StyledTitleSpan" }, localize(title)))))) : null),
|
|
65
|
+
tagDisplay && react_1.default.createElement(Tags_1.TagDisplay, { display: tagDisplay, color: "green" }),
|
|
66
66
|
(metaBlock === null || metaBlock === void 0 ? void 0 : metaBlock.length) > 0 ? (react_1.default.createElement(MetaBlock_1.default, { data: data, config: metaBlock }) //show only two meta for cardContent
|
|
67
67
|
) : null),
|
|
68
68
|
showEmbedSection && (react_1.default.createElement(styled_2.StyledEmbedSection, null,
|
|
@@ -38,15 +38,15 @@ exports.StyledContainer1 = styled_components_1.default.div(templateObject_2 || (
|
|
|
38
38
|
exports.StyledMetaBlock = styled_components_1.default.div(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n display: flex;\n gap: 0.5em;\n"], ["\n display: flex;\n gap: 0.5em;\n"])));
|
|
39
39
|
exports.StyledEmbedSection = styled_components_1.default.div(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n height: 100px;\n display: flex;\n align-items: center;\n overflow: hidden;\n width: 100%;\n"], ["\n height: 100px;\n display: flex;\n align-items: center;\n overflow: hidden;\n width: 100%;\n"])));
|
|
40
40
|
exports.StyledCardWrapper = styled_components_1.default.div(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n height: 100%;\n border: 2px solid ", ";\n background-color: ", "; \n display: flex;\n flex-direction: column;\n justify-content: space-between;\n\n ", "\n\n cursor: pointer;\n\n &:hover {\n background-color: ", ";\n ", ";\n #CardPlaceholder {\n opacity: 1;\n }\n }\n"], ["\n height: 100%;\n border: 2px solid ", ";\n background-color: ", "; \n display: flex;\n flex-direction: column;\n justify-content: space-between;\n\n ", "\n\n cursor: pointer;\n\n &:hover {\n background-color: ", ";\n ", ";\n #CardPlaceholder {\n opacity: 1;\n }\n }\n"])), greyColor5, function (_a) {
|
|
41
|
-
var
|
|
42
|
-
return
|
|
41
|
+
var highlight = _a.highlight;
|
|
42
|
+
return highlight ? colors_1.colors.lightGreen : greyColor5;
|
|
43
43
|
}, (0, transitions_1.transition)("background-color"), white, styled_1.CSSTitleAnimationOnHover);
|
|
44
44
|
exports.StyledUpperSection = styled_components_1.default.div(templateObject_6 || (templateObject_6 = __makeTemplateObject(["\n /* height: 100%; */\n flex-grow: 1;\n justify-content: space-between;\n padding: 2rem;\n ", "\n gap: ", ";\n padding-top: ", ";\n"], ["\n /* height: 100%; */\n flex-grow: 1;\n justify-content: space-between;\n padding: 2rem;\n ", "\n gap: ", ";\n padding-top: ", ";\n"])), flexColumn, function (_a) {
|
|
45
|
-
var
|
|
46
|
-
return
|
|
45
|
+
var highlight = _a.highlight;
|
|
46
|
+
return highlight ? '2rem' : '3rem';
|
|
47
47
|
}, function (_a) {
|
|
48
|
-
var
|
|
49
|
-
return
|
|
48
|
+
var highlight = _a.highlight;
|
|
49
|
+
return highlight ? "1rem" : "2rem";
|
|
50
50
|
});
|
|
51
51
|
exports.StyledCrownWrapper = styled_components_1.default.div(templateObject_7 || (templateObject_7 = __makeTemplateObject(["\n width: 100%;\n display: flex; \n justify-content: flex-end\n"], ["\n width: 100%;\n display: flex; \n justify-content: flex-end\n"])));
|
|
52
52
|
exports.StyledCrown = styled_components_1.default.div(templateObject_8 || (templateObject_8 = __makeTemplateObject(["\n width: max-content;\n background-color: ", ";\n padding: 1rem;\n"], ["\n width: max-content;\n background-color: ", ";\n padding: 1rem;\n"])), invertGreen);
|
|
@@ -27,6 +27,7 @@ var mixins_1 = require("../../../themes/mixins");
|
|
|
27
27
|
var ListContent = function (_a) {
|
|
28
28
|
var id = _a.id, data = _a.data, config = _a.config, to = _a.to, onClick = _a.onClick, openInNewTab = _a.openInNewTab, actions = _a.actions, statusTag = _a.statusTag, _b = _a.variant, variant = _b === void 0 ? "content" : _b;
|
|
29
29
|
var theme = (0, styled_components_1.useTheme)();
|
|
30
|
+
var localize = (0, utilsOolib_1.useLocale)();
|
|
30
31
|
var screenWidth = (0, _EXPORTS_1.useScreenWidth)();
|
|
31
32
|
var parseSpecialSyntax = (theme || {}).parseSpecialSyntax;
|
|
32
33
|
var _c = (0, parseCardConfig_1.parseCardConfig)({
|
|
@@ -54,7 +55,7 @@ var ListContent = function (_a) {
|
|
|
54
55
|
title ? (react_1.default.createElement("div", { style: { flexGrow: 1 } },
|
|
55
56
|
react_1.default.createElement(LineClampWrapper_1.LineClampWrapper, { noOfLines_M: 6, noOfLines_D: 3, title: title },
|
|
56
57
|
react_1.default.createElement(styled_1.StyledTitle, { capitalize: true, className: "StyledTitle" },
|
|
57
|
-
react_1.default.createElement(styled_1.StyledTitleSpan, { className: "StyledTitleSpan" }, title))))) : null,
|
|
58
|
+
react_1.default.createElement(styled_1.StyledTitleSpan, { className: "StyledTitleSpan" }, localize(title)))))) : null,
|
|
58
59
|
(metaBlock === null || metaBlock === void 0 ? void 0 : metaBlock.length) > 0 && (react_1.default.createElement("div", { style: { width: "100%", paddingTop: "1rem" } },
|
|
59
60
|
react_1.default.createElement(MetaBlock_1.default, { data: data, config: metaBlock })))),
|
|
60
61
|
variant === "content" ? ((mediaConfigExists || actions) && (react_1.default.createElement(styled_js_1.StyledContentModule2, null,
|
|
@@ -18,12 +18,10 @@ var parseCardConfig = function (_a) {
|
|
|
18
18
|
var tagDisplay = config.tagDisplay && (0, getVal_1.getVal)(data, config.tagDisplay);
|
|
19
19
|
var image = config.image && (0, getVal_1.getVal)(data, ((_b = config.image) === null || _b === void 0 ? void 0 : _b.valuePath) || config.image); // cuz image config could be either `image: <valuePath>` or `image: { valuePath: <valuePath>, aspectRatio: <aspectRatio> }`
|
|
20
20
|
var imageAspectRatio = (_c = config.image) === null || _c === void 0 ? void 0 : _c.aspectRatio;
|
|
21
|
-
var variant = (config.variant && Array.isArray((0, getVal_1.getVal)(data, config.variant)) && (0, getVal_1.getVal)(data, config.variant).length > 0) ? "success" : typeof config.variant === "string" ? config.variant : undefined;
|
|
22
21
|
return {
|
|
23
22
|
title: title,
|
|
24
23
|
titleOptional: titleOptional,
|
|
25
24
|
desc: desc,
|
|
26
|
-
variant: variant,
|
|
27
25
|
cardLabel: cardLabel,
|
|
28
26
|
video: video,
|
|
29
27
|
image: image,
|
|
@@ -89,7 +89,7 @@ export namespace cardContentArgTypes {
|
|
|
89
89
|
}
|
|
90
90
|
export { control_8 as control };
|
|
91
91
|
}
|
|
92
|
-
export namespace
|
|
92
|
+
export namespace highlight {
|
|
93
93
|
let name_9: string;
|
|
94
94
|
export { name_9 as name };
|
|
95
95
|
export namespace control_9 {
|
|
@@ -97,8 +97,6 @@ export namespace cardContentArgTypes {
|
|
|
97
97
|
export { type_1 as type };
|
|
98
98
|
}
|
|
99
99
|
export { control_9 as control };
|
|
100
|
-
let options_1: string[];
|
|
101
|
-
export { options_1 as options };
|
|
102
100
|
}
|
|
103
101
|
export namespace actions_1 {
|
|
104
102
|
let name_10: string;
|
|
@@ -57,10 +57,9 @@ exports.cardContentArgTypes = {
|
|
|
57
57
|
name: "Status Tag",
|
|
58
58
|
control: { type: "text" },
|
|
59
59
|
},
|
|
60
|
-
|
|
61
|
-
name: "
|
|
62
|
-
control: { type: "
|
|
63
|
-
options: ["success", undefined]
|
|
60
|
+
highlight: {
|
|
61
|
+
name: "Highlight",
|
|
62
|
+
control: { type: "boolean" },
|
|
64
63
|
},
|
|
65
64
|
actions: {
|
|
66
65
|
name: "Actions",
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export function parseCardArgs({ cardLabel, title, mediaType, image, video, metaText, metaName, metaDate, actions: _actions, statusTag, disabled, tagDisplay,
|
|
1
|
+
export function parseCardArgs({ cardLabel, title, mediaType, image, video, metaText, metaName, metaDate, actions: _actions, statusTag, disabled, tagDisplay, highlight, }: {
|
|
2
2
|
cardLabel: any;
|
|
3
3
|
title: any;
|
|
4
4
|
mediaType: any;
|
|
@@ -11,12 +11,12 @@ export function parseCardArgs({ cardLabel, title, mediaType, image, video, metaT
|
|
|
11
11
|
statusTag: any;
|
|
12
12
|
disabled: any;
|
|
13
13
|
tagDisplay: any;
|
|
14
|
-
|
|
14
|
+
highlight: any;
|
|
15
15
|
}): {
|
|
16
16
|
data: {
|
|
17
17
|
title: any;
|
|
18
18
|
cardLabel: any;
|
|
19
|
-
|
|
19
|
+
highlight: any;
|
|
20
20
|
image: {
|
|
21
21
|
publicUrl: any;
|
|
22
22
|
}[];
|
|
@@ -43,7 +43,7 @@ export function parseCardArgs({ cardLabel, title, mediaType, image, video, metaT
|
|
|
43
43
|
title: string;
|
|
44
44
|
cardLabel: string;
|
|
45
45
|
tagDisplay: string;
|
|
46
|
-
variant: any;
|
|
47
46
|
};
|
|
48
47
|
disabled: any;
|
|
48
|
+
highlight: any;
|
|
49
49
|
};
|
|
@@ -22,11 +22,11 @@ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
|
22
22
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
23
23
|
exports.parseCardArgs = void 0;
|
|
24
24
|
var parseCardArgs = function (_a) {
|
|
25
|
-
var cardLabel = _a.cardLabel, title = _a.title, mediaType = _a.mediaType, image = _a.image, video = _a.video, metaText = _a.metaText, metaName = _a.metaName, metaDate = _a.metaDate, _actions = _a.actions, statusTag = _a.statusTag, disabled = _a.disabled, tagDisplay = _a.tagDisplay,
|
|
25
|
+
var cardLabel = _a.cardLabel, title = _a.title, mediaType = _a.mediaType, image = _a.image, video = _a.video, metaText = _a.metaText, metaName = _a.metaName, metaDate = _a.metaDate, _actions = _a.actions, statusTag = _a.statusTag, disabled = _a.disabled, tagDisplay = _a.tagDisplay, highlight = _a.highlight;
|
|
26
26
|
var data = {
|
|
27
27
|
title: title,
|
|
28
28
|
cardLabel: cardLabel,
|
|
29
|
-
|
|
29
|
+
highlight: highlight,
|
|
30
30
|
image: image && [{ publicUrl: image }],
|
|
31
31
|
video: video && [{ publicUrl: video }],
|
|
32
32
|
text: metaText || undefined,
|
|
@@ -34,7 +34,7 @@ var parseCardArgs = function (_a) {
|
|
|
34
34
|
date: metaDate || undefined,
|
|
35
35
|
tagDisplay: tagDisplay,
|
|
36
36
|
};
|
|
37
|
-
var config = __assign(__assign(__assign({ title: "title", cardLabel: "cardLabel", tagDisplay: "tagDisplay"
|
|
37
|
+
var config = __assign(__assign(__assign({ title: "title", cardLabel: "cardLabel", tagDisplay: "tagDisplay" }, (mediaType === "image" ? { image: "image" } : {})), (mediaType === "video" ? { video: "video" } : {})), { metaBlock: __spreadArray(__spreadArray(__spreadArray([], (metaText ? [{ key: "text", valuePath: "text" }] : []), true), (metaName ? [{ key: "name", valuePath: "name" }] : []), true), (metaDate ? [{ key: "date", valuePath: "date" }] : []), true) });
|
|
38
38
|
var actions = !_actions
|
|
39
39
|
? undefined
|
|
40
40
|
: [
|
|
@@ -52,7 +52,8 @@ var parseCardArgs = function (_a) {
|
|
|
52
52
|
actions: actions,
|
|
53
53
|
statusTag: statusTag,
|
|
54
54
|
config: config,
|
|
55
|
-
disabled: disabled
|
|
55
|
+
disabled: disabled,
|
|
56
|
+
highlight: highlight
|
|
56
57
|
};
|
|
57
58
|
};
|
|
58
59
|
exports.parseCardArgs = parseCardArgs;
|