@ndla/ui 55.0.14-alpha.0 → 55.0.16-alpha.0
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/panda.buildinfo.json +40 -13
- package/dist/styles.css +160 -54
- package/es/Article/ArticleByline.js +81 -48
- package/es/Article/ArticleFootNotes.js +31 -19
- package/es/AudioPlayer/AudioPlayer.js +1 -0
- package/es/Concept/Concept.js +2 -2
- package/es/ContactBlock/ContactBlock.js +17 -17
- package/es/ContentTypeBadge/ContentTypeBadgeNew.js +1 -0
- package/es/Embed/BrightcoveEmbed.js +0 -1
- package/es/Embed/CopyrightEmbed.js +1 -2
- package/es/FrontpageArticle/FrontpageArticle.js +1 -2
- package/es/LicenseByline/EmbedByline.js +143 -33
- package/es/LicenseByline/LicenseLink.js +16 -9
- package/es/LicenseByline/index.js +2 -2
- package/es/index.js +0 -2
- package/es/model/ContentType.js +3 -1
- package/es/styles.css +160 -54
- package/lib/Article/ArticleByline.d.ts +1 -3
- package/lib/Article/ArticleByline.js +84 -51
- package/lib/Article/ArticleFootNotes.js +31 -20
- package/lib/AudioPlayer/AudioPlayer.js +1 -0
- package/lib/Concept/Concept.js +1 -1
- package/lib/ContactBlock/ContactBlock.js +18 -18
- package/lib/ContentTypeBadge/ContentTypeBadgeNew.d.ts +1 -2
- package/lib/ContentTypeBadge/ContentTypeBadgeNew.js +1 -0
- package/lib/Embed/BrightcoveEmbed.js +0 -1
- package/lib/Embed/CopyrightEmbed.js +1 -2
- package/lib/FrontpageArticle/FrontpageArticle.js +1 -2
- package/lib/LicenseByline/EmbedByline.d.ts +2 -4
- package/lib/LicenseByline/EmbedByline.js +145 -35
- package/lib/LicenseByline/LicenseLink.d.ts +2 -2
- package/lib/LicenseByline/LicenseLink.js +16 -9
- package/lib/LicenseByline/index.d.ts +2 -2
- package/lib/LicenseByline/index.js +4 -5
- package/lib/index.d.ts +0 -2
- package/lib/index.js +0 -20
- package/lib/model/ContentType.d.ts +1 -0
- package/lib/model/ContentType.js +4 -2
- package/lib/styles.css +160 -54
- package/package.json +5 -6
- package/src/Article/ArticleByline.tsx +83 -70
- package/src/Article/ArticleFootNotes.tsx +32 -36
- package/src/AudioPlayer/AudioPlayer.tsx +1 -0
- package/src/Concept/Concept.tsx +2 -2
- package/src/ContactBlock/ContactBlock.tsx +1 -1
- package/src/ContentTypeBadge/ContentTypeBadgeNew.tsx +3 -1
- package/src/Embed/BrightcoveEmbed.tsx +1 -1
- package/src/Embed/CopyrightEmbed.tsx +1 -1
- package/src/FrontpageArticle/FrontpageArticle.tsx +1 -1
- package/src/LicenseByline/EmbedByline.stories.tsx +9 -4
- package/src/LicenseByline/EmbedByline.tsx +139 -53
- package/src/LicenseByline/LicenseLink.tsx +15 -15
- package/src/LicenseByline/index.tsx +2 -2
- package/src/index.ts +0 -3
- package/src/model/ContentType.ts +2 -0
- package/es/CreatedBy/CreatedBy.js +0 -73
- package/es/CreatedBy/index.js +0 -10
- package/es/LicenseByline/LicenseDescription.js +0 -63
- package/es/List/OrderedList.js +0 -41
- package/es/List/UnOrderedList.js +0 -28
- package/es/List/index.js +0 -10
- package/lib/CreatedBy/CreatedBy.d.ts +0 -15
- package/lib/CreatedBy/CreatedBy.js +0 -78
- package/lib/CreatedBy/index.d.ts +0 -9
- package/lib/CreatedBy/index.js +0 -16
- package/lib/LicenseByline/LicenseDescription.d.ts +0 -15
- package/lib/LicenseByline/LicenseDescription.js +0 -70
- package/lib/List/OrderedList.d.ts +0 -16
- package/lib/List/OrderedList.js +0 -48
- package/lib/List/UnOrderedList.d.ts +0 -10
- package/lib/List/UnOrderedList.js +0 -35
- package/lib/List/index.d.ts +0 -9
- package/lib/List/index.js +0 -20
- package/src/CreatedBy/CreatedBy.stories.tsx +0 -36
- package/src/CreatedBy/CreatedBy.tsx +0 -63
- package/src/CreatedBy/index.ts +0 -11
- package/src/LicenseByline/LicenseDescription.tsx +0 -100
- package/src/List/OrderedList.stories.tsx +0 -135
- package/src/List/OrderedList.tsx +0 -158
- package/src/List/UnOrderedList.tsx +0 -43
- package/src/List/UnorderedList.stories.tsx +0 -72
- package/src/List/index.ts +0 -10
|
@@ -27,6 +27,7 @@ export const contentTypeToBadgeVariantMap = {
|
|
|
27
27
|
// TODO: Verify resourceEmbedTypeMapping colors
|
|
28
28
|
[contentTypes.IMAGE]: "brand1",
|
|
29
29
|
[contentTypes.AUDIO]: "brand1",
|
|
30
|
+
[contentTypes.PODCAST]: "brand1",
|
|
30
31
|
[contentTypes.VIDEO]: "brand1",
|
|
31
32
|
[contentTypes.MISSING]: "neutral"
|
|
32
33
|
};
|
|
@@ -18,7 +18,7 @@ export const WIDE_FRONTPAGE_ARTICLE_MAX_WIDTH = "1100px";
|
|
|
18
18
|
const StyledArticle = /*#__PURE__*/_styled("article", {
|
|
19
19
|
target: "e10a6yg80",
|
|
20
20
|
label: "StyledArticle"
|
|
21
|
-
})("width:100%;max-width:773px;h2[id]{margin-top:", spacing.large, ";}div[data-type=\"campaign-block\"]{margin:", spacing.large, " 0px;}div[data-type=\"grid\"]{h2,h3,h4{margin-top:0px;}}div[data-type=\"grid\"]+div[data-type=\"grid\"]{margin-top:", spacing.xxlarge, ";}&[data-wide=\"true\"]{max-width:1100px;h2[id]{margin-top:", spacing.xxlarge, ";}div[data-type=\"campaign-block\"]{margin:", spacing.xxlarge, " 0px;}}" + (process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIkZyb250cGFnZUFydGljbGUudHN4Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQTJCb0MiLCJmaWxlIjoiRnJvbnRwYWdlQXJ0aWNsZS50c3giLCJzb3VyY2VzQ29udGVudCI6WyIvKipcbiAqIENvcHlyaWdodCAoYykgMjAyMy1wcmVzZW50LCBORExBLlxuICpcbiAqIFRoaXMgc291cmNlIGNvZGUgaXMgbGljZW5zZWQgdW5kZXIgdGhlI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iwgY29udGVudCB9ID0gYXJ0aWNsZTtcblxuICBpZiAoaXNXaWRlKSB7XG4gICAgcmV0dXJuIChcbiAgICAgIDxTdHlsZWRBcnRpY2xlIGRhdGEtd2lkZT17aXNXaWRlfSBzdHlsZT17Y3NzVmFyc30gaWQ9e2lkfT5cbiAgICAgICAge2NvbnRlbnR9XG4gICAgICA8L1N0eWxlZEFydGljbGU+XG4gICAgKTtcbiAgfVxuXG4gIHJldHVybiAoXG4gICAgPFN0eWxlZEFydGljbGUgc3R5bGU9e2Nzc1ZhcnN9PlxuICAgICAgPEhlYWRpbmcgaWQ9e2lkfSBoZWFkaW5nU3R5bGU9XCJoMS1yZXNvdXJjZVwiIGVsZW1lbnQ9XCJoMVwiIG1hcmdpbj1cIm5vcm1hbFwiIHRhYkluZGV4PXstMX0gbGFuZz17bGFuZ30+XG4gICAgICAgIHt0aXRsZX1cbiAgICAgIDwvSGVhZGluZz5cbiAgICAgIDxUZXh0IHRleHRTdHlsZT1cImluZ3Jlc3NcIiBlbGVtZW50PVwiZGl2XCIgbGFuZz17bGFuZ30+XG4gICAgICAgIHtpbnRyb2R1Y3Rpb259XG4gICAgICA8L1RleHQ+
|
|
21
|
+
})("width:100%;max-width:773px;h2[id]{margin-top:", spacing.large, ";}div[data-type=\"campaign-block\"]{margin:", spacing.large, " 0px;}div[data-type=\"grid\"]{h2,h3,h4{margin-top:0px;}}div[data-type=\"grid\"]+div[data-type=\"grid\"]{margin-top:", spacing.xxlarge, ";}&[data-wide=\"true\"]{max-width:1100px;h2[id]{margin-top:", spacing.xxlarge, ";}div[data-type=\"campaign-block\"]{margin:", spacing.xxlarge, " 0px;}}" + (process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIkZyb250cGFnZUFydGljbGUudHN4Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQTJCb0MiLCJmaWxlIjoiRnJvbnRwYWd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@ -62,7 +62,6 @@ export const FrontpageArticle = _ref => {
|
|
|
62
62
|
lang: lang,
|
|
63
63
|
children: introduction
|
|
64
64
|
}), content, _jsx(ArticleByline, {
|
|
65
|
-
accordionHeaderVariant: "white",
|
|
66
65
|
licenseBox: licenseBox,
|
|
67
66
|
displayByline: false
|
|
68
67
|
})]
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import _styled from "@emotion/styled/base";
|
|
2
1
|
/**
|
|
3
2
|
* Copyright (c) 2023-present, NDLA.
|
|
4
3
|
*
|
|
@@ -7,26 +6,55 @@ import _styled from "@emotion/styled/base";
|
|
|
7
6
|
*
|
|
8
7
|
*/
|
|
9
8
|
|
|
9
|
+
import { useState } from "react";
|
|
10
10
|
import { useTranslation } from "react-i18next";
|
|
11
|
-
import { colors, fonts, misc, spacing } from "@ndla/core";
|
|
12
11
|
import { WarningOutline } from "@ndla/icons/common";
|
|
13
12
|
import { getLicenseByAbbreviation, getLicenseCredits } from "@ndla/licenses";
|
|
14
|
-
import
|
|
15
|
-
import
|
|
13
|
+
import { Button, Text } from "@ndla/primitives";
|
|
14
|
+
import { styled } from "@ndla/styled-system/jsx";
|
|
15
|
+
import { LicenseLink } from "./LicenseLink";
|
|
16
16
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "@emotion/react/jsx-runtime";
|
|
17
|
-
const BylineWrapper =
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
}
|
|
25
|
-
|
|
17
|
+
const BylineWrapper = styled("figcaption", {
|
|
18
|
+
base: {
|
|
19
|
+
display: "flex",
|
|
20
|
+
flexDirection: "column",
|
|
21
|
+
paddingBlock: "xsmall",
|
|
22
|
+
background: "surface.default",
|
|
23
|
+
textStyle: "label.medium"
|
|
24
|
+
}
|
|
25
|
+
});
|
|
26
|
+
const ErrorBylineWrapper = styled(BylineWrapper, {
|
|
27
|
+
base: {
|
|
28
|
+
border: "1px solid",
|
|
29
|
+
borderColor: "stroke.error",
|
|
30
|
+
borderRadius: "xsmall",
|
|
31
|
+
background: "surface.dangerSubtle",
|
|
32
|
+
paddingInline: "medium",
|
|
33
|
+
paddingBlock: "medium"
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
const StyledText = styled(Text, {
|
|
37
|
+
base: {
|
|
38
|
+
fontStyle: "italic"
|
|
39
|
+
}
|
|
40
|
+
});
|
|
41
|
+
const ContentWrapper = styled("div", {
|
|
42
|
+
base: {
|
|
43
|
+
display: "flex",
|
|
44
|
+
gap: "xsmall",
|
|
45
|
+
alignItems: "center",
|
|
46
|
+
textStyle: "label.medium"
|
|
47
|
+
}
|
|
48
|
+
});
|
|
49
|
+
const BaseDescription = styled("div", {
|
|
50
|
+
base: {
|
|
51
|
+
display: "inline-flex",
|
|
52
|
+
whiteSpace: "pre-wrap"
|
|
53
|
+
}
|
|
54
|
+
});
|
|
55
|
+
export const EmbedByline = _ref => {
|
|
26
56
|
let {
|
|
27
57
|
type,
|
|
28
|
-
topRounded,
|
|
29
|
-
bottomRounded,
|
|
30
58
|
description,
|
|
31
59
|
children,
|
|
32
60
|
visibleAlt,
|
|
@@ -37,16 +65,15 @@ const EmbedByline = _ref => {
|
|
|
37
65
|
} = useTranslation();
|
|
38
66
|
if (props.error) {
|
|
39
67
|
const typeString = type === "h5p" ? "H5P" : t(`embed.type.${type}`).toLowerCase();
|
|
40
|
-
return _jsx(
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
})
|
|
68
|
+
return _jsx(ErrorBylineWrapper, {
|
|
69
|
+
children: _jsxs(ContentWrapper, {
|
|
70
|
+
children: [_jsx(WarningOutline, {}), _jsx(BaseDescription, {
|
|
71
|
+
children: _jsx("span", {
|
|
72
|
+
children: t("embed.embedError", {
|
|
73
|
+
type: typeString
|
|
74
|
+
})
|
|
75
|
+
})
|
|
76
|
+
})]
|
|
50
77
|
})
|
|
51
78
|
});
|
|
52
79
|
}
|
|
@@ -62,17 +89,89 @@ const EmbedByline = _ref => {
|
|
|
62
89
|
children: description
|
|
63
90
|
}), children]
|
|
64
91
|
})
|
|
65
|
-
}), visibleAlt ? _jsx(
|
|
66
|
-
|
|
92
|
+
}), visibleAlt ? _jsx(StyledText, {
|
|
93
|
+
color: "text.subtle",
|
|
94
|
+
textStyle: "label.medium",
|
|
95
|
+
asChild: true,
|
|
96
|
+
consumeCss: true,
|
|
97
|
+
children: _jsx("span", {
|
|
98
|
+
children: `Alt: ${visibleAlt}`
|
|
99
|
+
})
|
|
67
100
|
}) : null]
|
|
68
101
|
});
|
|
69
102
|
};
|
|
70
|
-
|
|
103
|
+
const StyledDescription = styled(BaseDescription, {
|
|
104
|
+
base: {
|
|
105
|
+
mobileWideDown: {
|
|
106
|
+
display: "grid",
|
|
107
|
+
gridTemplateColumns: "1fr auto",
|
|
108
|
+
alignItems: "center",
|
|
109
|
+
overflow: "hidden",
|
|
110
|
+
_open: {
|
|
111
|
+
display: "inline"
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
});
|
|
116
|
+
const TextContent = styled("span", {
|
|
117
|
+
base: {
|
|
118
|
+
mobileWideDown: {
|
|
119
|
+
whiteSpace: "nowrap",
|
|
120
|
+
maxHeight: "large",
|
|
121
|
+
overflow: "hidden",
|
|
122
|
+
textOverflow: "ellipsis",
|
|
123
|
+
transitionProperty: "max-height",
|
|
124
|
+
transitionDuration: "slow",
|
|
125
|
+
transitionTimingFunction: "ease-in",
|
|
126
|
+
_open: {
|
|
127
|
+
whiteSpace: "pre-wrap",
|
|
128
|
+
maxHeight: "none"
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
});
|
|
133
|
+
const StyledButton = styled(Button, {
|
|
134
|
+
base: {
|
|
135
|
+
mobileWide: {
|
|
136
|
+
display: "none"
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
});
|
|
140
|
+
const LicenseDescription = _ref2 => {
|
|
141
|
+
let {
|
|
142
|
+
children
|
|
143
|
+
} = _ref2;
|
|
144
|
+
const [isOpen, setIsOpen] = useState(false);
|
|
145
|
+
const open = isOpen ? {
|
|
146
|
+
"data-open": ""
|
|
147
|
+
} : {};
|
|
148
|
+
const {
|
|
149
|
+
t
|
|
150
|
+
} = useTranslation();
|
|
151
|
+
const handleToggle = () => {
|
|
152
|
+
setIsOpen(!isOpen);
|
|
153
|
+
};
|
|
154
|
+
return _jsx(ContentWrapper, {
|
|
155
|
+
children: _jsxs(StyledDescription, {
|
|
156
|
+
...open,
|
|
157
|
+
children: [_jsx(TextContent, {
|
|
158
|
+
...open,
|
|
159
|
+
children: children
|
|
160
|
+
}), _jsx(StyledButton, {
|
|
161
|
+
variant: "link",
|
|
162
|
+
size: "small",
|
|
163
|
+
onClick: handleToggle,
|
|
164
|
+
children: isOpen ? `${t("audio.readLessDescriptionLabel")}` : `${t("audio.readMoreDescriptionLabel")}`
|
|
165
|
+
})]
|
|
166
|
+
})
|
|
167
|
+
});
|
|
168
|
+
};
|
|
169
|
+
export const LicenseContainerContent = _ref3 => {
|
|
71
170
|
let {
|
|
72
171
|
children,
|
|
73
172
|
copyright,
|
|
74
173
|
type
|
|
75
|
-
} =
|
|
174
|
+
} = _ref3;
|
|
76
175
|
const {
|
|
77
176
|
t,
|
|
78
177
|
i18n
|
|
@@ -80,13 +179,24 @@ export const LicenseContainerContent = _ref2 => {
|
|
|
80
179
|
const license = copyright ? getLicenseByAbbreviation(copyright.license?.license ?? "", i18n.language) : undefined;
|
|
81
180
|
const authors = getLicenseCredits(copyright);
|
|
82
181
|
const captionAuthors = Object.values(authors).find(i => i.length > 0) ?? [];
|
|
83
|
-
const
|
|
84
|
-
return _jsxs(Component, {
|
|
182
|
+
const content = _jsxs(_Fragment, {
|
|
85
183
|
children: [children, ` ${t(`embed.type.${type}`)}${captionAuthors.length ? ": " : ""}`, captionAuthors.map(author => author.name).join(", "), license ? _jsxs(_Fragment, {
|
|
86
184
|
children: [" / ", _jsx(LicenseLink, {
|
|
87
185
|
license: license
|
|
88
186
|
})]
|
|
89
187
|
}) : null]
|
|
90
188
|
});
|
|
91
|
-
|
|
92
|
-
|
|
189
|
+
if (children) {
|
|
190
|
+
return _jsx(LicenseDescription, {
|
|
191
|
+
children: content
|
|
192
|
+
});
|
|
193
|
+
}
|
|
194
|
+
return _jsx(Text, {
|
|
195
|
+
textStyle: "label.medium",
|
|
196
|
+
asChild: true,
|
|
197
|
+
consumeCss: true,
|
|
198
|
+
children: _jsx("span", {
|
|
199
|
+
children: content
|
|
200
|
+
})
|
|
201
|
+
});
|
|
202
|
+
};
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import _styled from "@emotion/styled/base";
|
|
2
1
|
/**
|
|
3
2
|
* Copyright (c) 2023-present, NDLA.
|
|
4
3
|
*
|
|
@@ -7,14 +6,23 @@ import _styled from "@emotion/styled/base";
|
|
|
7
6
|
*
|
|
8
7
|
*/
|
|
9
8
|
|
|
10
|
-
import { colors } from "@ndla/core";
|
|
11
9
|
import { SafeLink } from "@ndla/safelink";
|
|
10
|
+
import { styled } from "@ndla/styled-system/jsx";
|
|
12
11
|
import { jsx as _jsx } from "@emotion/react/jsx-runtime";
|
|
13
|
-
const StyledSafeLink =
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
12
|
+
const StyledSafeLink = styled(SafeLink, {
|
|
13
|
+
base: {
|
|
14
|
+
color: "primary",
|
|
15
|
+
textDecoration: "underline",
|
|
16
|
+
whiteSpace: "nowrap",
|
|
17
|
+
_hover: {
|
|
18
|
+
textDecoration: "none"
|
|
19
|
+
},
|
|
20
|
+
_focusWithin: {
|
|
21
|
+
textDecoration: "none"
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
export const LicenseLink = _ref => {
|
|
18
26
|
let {
|
|
19
27
|
license
|
|
20
28
|
} = _ref;
|
|
@@ -31,5 +39,4 @@ const LicenseLink = _ref => {
|
|
|
31
39
|
return _jsx("span", {
|
|
32
40
|
children: license.abbreviation
|
|
33
41
|
});
|
|
34
|
-
};
|
|
35
|
-
export default LicenseLink;
|
|
42
|
+
};
|
package/es/index.js
CHANGED
|
@@ -26,7 +26,6 @@ export { default as SearchResultSleeve } from "./Search/SearchResultSleeve";
|
|
|
26
26
|
export { default as ContentTypeResult } from "./Search/ContentTypeResult";
|
|
27
27
|
export { SearchFieldForm } from "./Search/SearchFieldForm";
|
|
28
28
|
export { default as resourceTypeColor } from "./utils/resourceTypeColor";
|
|
29
|
-
export { default as CreatedBy } from "./CreatedBy";
|
|
30
29
|
export { MessageBox, MessageBanner } from "./Messages";
|
|
31
30
|
export { ResourceBox } from "./ResourceBox";
|
|
32
31
|
export { default as AudioPlayer } from "./AudioPlayer";
|
|
@@ -47,7 +46,6 @@ export { TagSelectorRoot, TagSelectorLabel, TagSelectorItemInput, TagSelectorTri
|
|
|
47
46
|
export { SnackbarProvider, useSnack, BaseSnack, DefaultSnackbar } from "./SnackBar";
|
|
48
47
|
export { TreeStructure } from "./TreeStructure";
|
|
49
48
|
export { SearchField, SearchResultList, SearchResultItem, ActiveFilters } from "./Search";
|
|
50
|
-
export { OrderedList, UnOrderedList } from "./List";
|
|
51
49
|
export { BlogPostV2 } from "./BlogPost";
|
|
52
50
|
export { ProgrammeCard } from "./ProgrammeCard";
|
|
53
51
|
export { KeyFigure } from "./KeyFigure";
|
package/es/model/ContentType.js
CHANGED
|
@@ -20,6 +20,7 @@ export const MISSING = "missing";
|
|
|
20
20
|
export const IMAGE = "image";
|
|
21
21
|
export const VIDEO = "video";
|
|
22
22
|
export const AUDIO = "audio";
|
|
23
|
+
export const PODCAST = "podcast";
|
|
23
24
|
export const contentTypes = {
|
|
24
25
|
SUBJECT_MATERIAL,
|
|
25
26
|
TASKS_AND_ACTIVITIES,
|
|
@@ -53,5 +54,6 @@ export const resourceEmbedTypeMapping = {
|
|
|
53
54
|
image: "image",
|
|
54
55
|
video: "video",
|
|
55
56
|
concept: "concept",
|
|
56
|
-
audio: "audio"
|
|
57
|
+
audio: "audio",
|
|
58
|
+
podcast: "podcast"
|
|
57
59
|
};
|