@codecademy/brand 5.14.6-alpha.be029ea6f.0 → 5.14.6-alpha.d726470e5.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/InfoCard/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Anchor, Box, Card, FlexBox, Markdown, Text } from '@codecademy/gamut';
|
|
2
|
-
import { Iframe, MarkdownVideo } from '@codecademy/gamut/Video';
|
|
3
2
|
import { pxRem } from '@codecademy/gamut-styles';
|
|
4
3
|
import * as React from 'react';
|
|
4
|
+
import { markdownVideoOverrides } from '../lib/markdownVideoOverrides';
|
|
5
5
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
6
6
|
const cardMinWidth = 250;
|
|
7
7
|
const tagColorMap = {
|
|
@@ -45,12 +45,7 @@ const Subtitle = ({
|
|
|
45
45
|
const Body = ({
|
|
46
46
|
text
|
|
47
47
|
}) => /*#__PURE__*/_jsx(Markdown, {
|
|
48
|
-
|
|
49
|
-
component: Iframe
|
|
50
|
-
},
|
|
51
|
-
videoOverride: {
|
|
52
|
-
component: MarkdownVideo
|
|
53
|
-
},
|
|
48
|
+
...markdownVideoOverrides,
|
|
54
49
|
text: text,
|
|
55
50
|
overrides: {
|
|
56
51
|
p: {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Box, Markdown } from '@codecademy/gamut';
|
|
2
|
-
import { Iframe, MarkdownVideo } from '@codecademy/gamut/Video';
|
|
3
2
|
import * as React from 'react';
|
|
3
|
+
import { markdownVideoOverrides } from '../lib/markdownVideoOverrides';
|
|
4
4
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
5
5
|
export const Description = ({
|
|
6
6
|
text,
|
|
@@ -9,12 +9,7 @@ export const Description = ({
|
|
|
9
9
|
maxWidth: "38rem",
|
|
10
10
|
mt: 16,
|
|
11
11
|
children: /*#__PURE__*/_jsx(Markdown, {
|
|
12
|
-
|
|
13
|
-
component: Iframe
|
|
14
|
-
},
|
|
15
|
-
videoOverride: {
|
|
16
|
-
component: MarkdownVideo
|
|
17
|
-
},
|
|
12
|
+
...markdownVideoOverrides,
|
|
18
13
|
text: text,
|
|
19
14
|
onAnchorClick: onAnchorClick
|
|
20
15
|
})
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Anchor, FlexBox, GridBox, Markdown, Text } from '@codecademy/gamut';
|
|
2
|
-
import { Iframe, MarkdownVideo } from '@codecademy/gamut/Video';
|
|
3
2
|
import { CheckFilledIcon, DeleteFilledIcon } from '@codecademy/gamut-icons';
|
|
4
3
|
import { pxRem } from '@codecademy/gamut-styles';
|
|
4
|
+
import { markdownVideoOverrides } from '../lib/markdownVideoOverrides';
|
|
5
5
|
import { createResumeUrlPath } from './helpers';
|
|
6
6
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
7
7
|
const SHOW_REVIEW_SCORE = 0.6;
|
|
@@ -48,12 +48,7 @@ export const renderSubScores = ({
|
|
|
48
48
|
screenreader: true,
|
|
49
49
|
children: colorfulIcons ? `${subContentPercentCorrect >= PASSING_SCORE ? 'passed' : 'failed'}: ` : ''
|
|
50
50
|
}), isChallenge ? /*#__PURE__*/_jsx(Markdown, {
|
|
51
|
-
|
|
52
|
-
component: Iframe
|
|
53
|
-
},
|
|
54
|
-
videoOverride: {
|
|
55
|
-
component: MarkdownVideo
|
|
56
|
-
},
|
|
51
|
+
...markdownVideoOverrides,
|
|
57
52
|
inline: true,
|
|
58
53
|
spacing: "none",
|
|
59
54
|
text: subContentTitle
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { IframeProps, MarkdownVideoProps } from '@codecademy/gamut/Video';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
/** Markdown props that render embedded iframes/videos with Gamut's Video, loaded on demand. */
|
|
4
|
+
export declare const markdownVideoOverrides: {
|
|
5
|
+
iframeOverride: {
|
|
6
|
+
component: React.FC<IframeProps>;
|
|
7
|
+
};
|
|
8
|
+
videoOverride: {
|
|
9
|
+
component: React.FC<MarkdownVideoProps>;
|
|
10
|
+
};
|
|
11
|
+
};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
|
|
3
|
+
// Lazy so that importing @codecademy/brand doesn't pull @codecademy/gamut/Video
|
|
4
|
+
// (and react-player/vidstack) into consumers' main bundles.
|
|
5
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
6
|
+
const LazyIframe = /*#__PURE__*/React.lazy(() => import('@codecademy/gamut/Video').then(({
|
|
7
|
+
Iframe
|
|
8
|
+
}) => ({
|
|
9
|
+
default: Iframe
|
|
10
|
+
})));
|
|
11
|
+
const LazyMarkdownVideo = /*#__PURE__*/React.lazy(() => import('@codecademy/gamut/Video').then(({
|
|
12
|
+
MarkdownVideo
|
|
13
|
+
}) => ({
|
|
14
|
+
default: MarkdownVideo
|
|
15
|
+
})));
|
|
16
|
+
const Iframe = props => /*#__PURE__*/_jsx(React.Suspense, {
|
|
17
|
+
fallback: null,
|
|
18
|
+
children: /*#__PURE__*/_jsx(LazyIframe, {
|
|
19
|
+
...props
|
|
20
|
+
})
|
|
21
|
+
});
|
|
22
|
+
const MarkdownVideo = props => /*#__PURE__*/_jsx(React.Suspense, {
|
|
23
|
+
fallback: null,
|
|
24
|
+
children: /*#__PURE__*/_jsx(LazyMarkdownVideo, {
|
|
25
|
+
...props
|
|
26
|
+
})
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
/** Markdown props that render embedded iframes/videos with Gamut's Video, loaded on demand. */
|
|
30
|
+
export const markdownVideoOverrides = {
|
|
31
|
+
iframeOverride: {
|
|
32
|
+
component: Iframe
|
|
33
|
+
},
|
|
34
|
+
videoOverride: {
|
|
35
|
+
component: MarkdownVideo
|
|
36
|
+
}
|
|
37
|
+
};
|
package/package.json
CHANGED