@newhighsco/chipset 6.14.11 → 6.14.13
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/package.json +30 -30
- package/src/components/Backdrop/Backdrop.jsx +3 -3
- package/src/components/Button/Button.jsx +3 -2
- package/src/components/Button/ButtonGroup.jsx +2 -2
- package/src/components/Button/index.jsx +2 -2
- package/src/components/Card/Card.jsx +3 -2
- package/src/components/Card/CardHeading.jsx +2 -1
- package/src/components/Card/CardImage.jsx +2 -1
- package/src/components/Card/index.jsx +1 -1
- package/src/components/ContentContainer/ContentContainer.jsx +3 -2
- package/src/components/ContentContainer/index.js +0 -1
- package/src/components/CreditLockup/CreditLockup.jsx +3 -3
- package/src/components/CreditLockup/index.js +0 -1
- package/src/components/Element/Element.jsx +1 -1
- package/src/components/FooterContainer/FooterContainer.jsx +2 -3
- package/src/components/Grid/Grid.jsx +2 -2
- package/src/components/Grid/GridItem.jsx +2 -2
- package/src/components/Grid/index.js +1 -2
- package/src/components/HeaderContainer/HeaderContainer.jsx +2 -3
- package/src/components/Icon/Icon.jsx +3 -2
- package/src/components/Icon/index.js +0 -1
- package/src/components/Image/Image.jsx +1 -1
- package/src/components/Landmark/Landmark.jsx +3 -3
- package/src/components/List/List.jsx +3 -2
- package/src/components/List/index.js +0 -1
- package/src/components/LiveStream/LiveStream.jsx +21 -22
- package/src/components/LiveStream/index.js +0 -1
- package/src/components/LiveStream/utils.js +22 -15
- package/src/components/Navigation/Navigation.jsx +6 -6
- package/src/components/Navigation/index.js +0 -1
- package/src/components/PageContainer/PageContainer.jsx +2 -3
- package/src/components/PageContainer/index.js +0 -1
- package/src/components/Prose/Prose.jsx +2 -2
- package/src/components/Prose/index.js +0 -1
- package/src/components/ResponsiveMedia/ResponsiveMedia.jsx +2 -2
- package/src/components/ResponsiveMedia/index.js +0 -1
- package/src/components/SiteContainer/SiteContainer.jsx +3 -2
- package/src/components/SiteContainer/index.js +0 -1
- package/src/components/SmartLink/SmartLink.jsx +2 -1
- package/src/components/SmartLink/index.jsx +1 -0
- package/src/components/Tooltip/Tooltip.jsx +5 -4
- package/src/components/Tooltip/index.js +0 -1
- package/src/components/VisuallyHidden/VisuallyHidden.jsx +2 -2
- package/src/components/index.js +1 -1
- package/src/docs/README.stories.mdx +2 -2
- package/src/index.js +1 -1
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@newhighsco/chipset",
|
|
3
3
|
"description": "Shareable, theme-able component library by New High Score",
|
|
4
|
-
"version": "6.14.
|
|
4
|
+
"version": "6.14.13",
|
|
5
5
|
"author": "New High Score <hello@newhighsco.re>",
|
|
6
6
|
"license": "ISC",
|
|
7
7
|
"config": {
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
},
|
|
27
27
|
"scripts": {
|
|
28
28
|
"prepare": "is-ci || husky install",
|
|
29
|
-
"start": "start-storybook --docs --no-manager-cache",
|
|
29
|
+
"start": "start-storybook --port 49928 --docs --no-manager-cache",
|
|
30
30
|
"prebuild": "rm -rf build",
|
|
31
31
|
"build": "build-storybook --output-dir build --docs --quiet",
|
|
32
32
|
"pretest": "yarn lint",
|
|
@@ -44,45 +44,45 @@
|
|
|
44
44
|
"dependencies": {
|
|
45
45
|
"@dr.pogodin/react-themes": "1.4.7",
|
|
46
46
|
"classnames": "2.3.2",
|
|
47
|
-
"react-device-detect": "2.2.
|
|
47
|
+
"react-device-detect": "2.2.3"
|
|
48
48
|
},
|
|
49
49
|
"devDependencies": {
|
|
50
|
-
"@babel/core": "7.20.
|
|
51
|
-
"@babel/polyfill": "7.12.1",
|
|
50
|
+
"@babel/core": "7.20.12",
|
|
52
51
|
"@babel/preset-env": "7.20.2",
|
|
53
52
|
"@babel/preset-react": "7.18.6",
|
|
54
|
-
"@commitlint/cli": "17.2
|
|
53
|
+
"@commitlint/cli": "17.4.2",
|
|
55
54
|
"@fullhuman/postcss-purgecss": "5.0.0",
|
|
56
55
|
"@newhighsco/browserslist-config": "1.1.0",
|
|
57
|
-
"@newhighsco/commitlint-config": "1.1.
|
|
56
|
+
"@newhighsco/commitlint-config": "1.1.13",
|
|
58
57
|
"@newhighsco/editor-config": "1.2.0",
|
|
59
|
-
"@newhighsco/eslint-config": "
|
|
60
|
-
"@newhighsco/postcss-config": "3.5.
|
|
61
|
-
"@newhighsco/prettier-config": "2.1.
|
|
62
|
-
"@newhighsco/release-config": "1.3.
|
|
63
|
-
"@newhighsco/storybook-preset": "4.5.
|
|
64
|
-
"@newhighsco/stylelint-config": "3.1.
|
|
65
|
-
"@storybook/builder-webpack5": "6.5.
|
|
66
|
-
"@storybook/manager-webpack5": "6.5.
|
|
67
|
-
"@storybook/react": "6.5.
|
|
68
|
-
"@
|
|
69
|
-
"
|
|
70
|
-
"babel-loader": "9.1.
|
|
71
|
-
"chromatic": "6.
|
|
72
|
-
"
|
|
73
|
-
"
|
|
74
|
-
"husky": "8.0.2",
|
|
75
|
-
"is-ci": "3.0.1",
|
|
58
|
+
"@newhighsco/eslint-config": "4.0.11",
|
|
59
|
+
"@newhighsco/postcss-config": "3.5.113",
|
|
60
|
+
"@newhighsco/prettier-config": "2.1.8",
|
|
61
|
+
"@newhighsco/release-config": "1.3.15",
|
|
62
|
+
"@newhighsco/storybook-preset": "4.5.62",
|
|
63
|
+
"@newhighsco/stylelint-config": "3.1.34",
|
|
64
|
+
"@storybook/builder-webpack5": "6.5.16",
|
|
65
|
+
"@storybook/manager-webpack5": "6.5.16",
|
|
66
|
+
"@storybook/react": "6.5.16",
|
|
67
|
+
"@testing-library/jest-dom": "5.16.5",
|
|
68
|
+
"@testing-library/react": "13.4.0",
|
|
69
|
+
"babel-loader": "9.1.2",
|
|
70
|
+
"chromatic": "6.17.0",
|
|
71
|
+
"eslint": "8.33.0",
|
|
72
|
+
"husky": "8.0.3",
|
|
76
73
|
"identity-obj-proxy": "3.0.0",
|
|
77
|
-
"
|
|
74
|
+
"is-ci": "3.0.1",
|
|
75
|
+
"jest": "29.4.2",
|
|
76
|
+
"jest-environment-jsdom": "29.4.2",
|
|
77
|
+
"jest-environment-node-single-context": "29.0.0",
|
|
78
78
|
"npm-run-all": "4.1.5",
|
|
79
|
-
"postcss": "8.4.
|
|
80
|
-
"prettier": "2.
|
|
79
|
+
"postcss": "8.4.21",
|
|
80
|
+
"prettier": "2.8.4",
|
|
81
81
|
"react": "18.2.0",
|
|
82
82
|
"react-dom": "18.2.0",
|
|
83
|
-
"sass-true": "
|
|
84
|
-
"semantic-release": "
|
|
85
|
-
"stylelint": "
|
|
83
|
+
"sass-true": "7.0.0",
|
|
84
|
+
"semantic-release": "20.1.0",
|
|
85
|
+
"stylelint": "15.0.0",
|
|
86
86
|
"webpack": "5.75.0"
|
|
87
87
|
},
|
|
88
88
|
"peerDependencies": {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import React from 'react'
|
|
2
|
-
import { node, string } from 'prop-types'
|
|
3
1
|
import classNames from 'classnames'
|
|
4
|
-
import
|
|
2
|
+
import { node, string } from 'prop-types'
|
|
3
|
+
import React from 'react'
|
|
5
4
|
|
|
5
|
+
import Element from '../Element'
|
|
6
6
|
import styles from './Backdrop.module.scss'
|
|
7
7
|
|
|
8
8
|
/**
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import React from 'react'
|
|
2
|
-
import { bool, func, node, object, oneOfType, shape, string } from 'prop-types'
|
|
3
1
|
import classNames from 'classnames'
|
|
2
|
+
import { bool, func, node, object, oneOfType, shape, string } from 'prop-types'
|
|
3
|
+
import React from 'react'
|
|
4
|
+
|
|
4
5
|
import SmartLink from '../SmartLink'
|
|
5
6
|
|
|
6
7
|
const Button = ({ active, children, theme, className, setRef, ...rest }) => {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import React from 'react'
|
|
2
|
-
import { node, shape, string } from 'prop-types'
|
|
3
1
|
import classNames from 'classnames'
|
|
2
|
+
import { node, shape, string } from 'prop-types'
|
|
3
|
+
import React from 'react'
|
|
4
4
|
|
|
5
5
|
const ButtonGroup = ({ children, theme, className }) => {
|
|
6
6
|
if (!children) return null
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import React, { forwardRef } from 'react'
|
|
2
|
+
|
|
2
3
|
import { withTheme } from '../../providers'
|
|
3
4
|
import PureButton from './Button'
|
|
4
|
-
import PureButtonGroup from './ButtonGroup'
|
|
5
|
-
|
|
6
5
|
import theme from './Button.module.scss'
|
|
6
|
+
import PureButtonGroup from './ButtonGroup'
|
|
7
7
|
|
|
8
8
|
const { displayName } = PureButton
|
|
9
9
|
const ButtonWithRef = forwardRef((props, ref) => (
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import classNames from 'classnames'
|
|
2
2
|
import {
|
|
3
3
|
func,
|
|
4
4
|
node,
|
|
@@ -8,7 +8,8 @@ import {
|
|
|
8
8
|
shape,
|
|
9
9
|
string
|
|
10
10
|
} from 'prop-types'
|
|
11
|
-
import
|
|
11
|
+
import React from 'react'
|
|
12
|
+
|
|
12
13
|
import CardHeading from './CardHeading'
|
|
13
14
|
import CardImage from './CardImage'
|
|
14
15
|
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import React from 'react'
|
|
2
1
|
import { oneOf, shape, string } from 'prop-types'
|
|
3
|
-
import
|
|
4
|
-
import Icon from '../Icon'
|
|
2
|
+
import React from 'react'
|
|
5
3
|
|
|
4
|
+
import Icon from '../Icon'
|
|
5
|
+
import SmartLink from '../SmartLink'
|
|
6
6
|
import { ReactComponent as LogoSvg } from './images/logo.svg'
|
|
7
7
|
|
|
8
8
|
const name = 'New High Score'
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import React from 'react'
|
|
2
1
|
import { node } from 'prop-types'
|
|
2
|
+
import React from 'react'
|
|
3
|
+
|
|
3
4
|
import ContentContainer from '../ContentContainer'
|
|
4
5
|
|
|
5
6
|
const FooterContainer = ({ children, theme, ...rest }) => {
|
|
6
|
-
if (!children) return null
|
|
7
|
-
|
|
8
7
|
return (
|
|
9
8
|
<ContentContainer as="footer" role="contentinfo" theme={theme} {...rest}>
|
|
10
9
|
{children}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import React from 'react'
|
|
2
|
-
import { bool, node, oneOf, shape, string } from 'prop-types'
|
|
3
1
|
import classNames from 'classnames'
|
|
2
|
+
import { bool, node, oneOf, shape, string } from 'prop-types'
|
|
3
|
+
import React from 'react'
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* `Grid` provides a simple `inline-block` based responsive grid
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import React from 'react'
|
|
2
|
-
import { arrayOf, node, oneOf, shape, string } from 'prop-types'
|
|
3
1
|
import classNames from 'classnames'
|
|
2
|
+
import { arrayOf, node, oneOf, shape, string } from 'prop-types'
|
|
3
|
+
import React from 'react'
|
|
4
4
|
|
|
5
5
|
const GridItem = ({ sizes, children, theme, className, ...rest }) => {
|
|
6
6
|
if (!children) return null
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { withTheme } from '../../providers'
|
|
2
2
|
import PureGrid from './Grid'
|
|
3
|
-
import PureGridItem from './GridItem'
|
|
4
|
-
|
|
5
3
|
import theme from './Grid.module.scss'
|
|
4
|
+
import PureGridItem from './GridItem'
|
|
6
5
|
|
|
7
6
|
const { displayName } = PureGrid
|
|
8
7
|
const Grid = withTheme(displayName, theme)(PureGrid)
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import React from 'react'
|
|
2
1
|
import { node } from 'prop-types'
|
|
2
|
+
import React from 'react'
|
|
3
|
+
|
|
3
4
|
import ContentContainer from '../ContentContainer'
|
|
4
5
|
|
|
5
6
|
const HeaderContainer = ({ children, theme, ...rest }) => {
|
|
6
|
-
if (!children) return null
|
|
7
|
-
|
|
8
7
|
return (
|
|
9
8
|
<ContentContainer
|
|
10
9
|
id="top"
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import React from 'react'
|
|
2
|
-
import { node, number, oneOfType, shape, string } from 'prop-types'
|
|
3
1
|
import classNames from 'classnames'
|
|
2
|
+
import { node, number, oneOfType, shape, string } from 'prop-types'
|
|
3
|
+
import React from 'react'
|
|
4
|
+
|
|
4
5
|
import VisuallyHidden from '../VisuallyHidden'
|
|
5
6
|
|
|
6
7
|
/**
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import React from 'react'
|
|
2
1
|
import { node } from 'prop-types'
|
|
3
|
-
import
|
|
2
|
+
import React from 'react'
|
|
4
3
|
|
|
4
|
+
import VisuallyHidden from '../VisuallyHidden'
|
|
5
5
|
import styles from './Landmark.module.scss'
|
|
6
6
|
|
|
7
7
|
/**
|
|
@@ -11,7 +11,7 @@ const Landmark = ({ children, ...rest }) => (
|
|
|
11
11
|
<>
|
|
12
12
|
{/* eslint-disable jsx-a11y/anchor-is-valid */}
|
|
13
13
|
<a className={styles.root} {...rest}>
|
|
14
|
-
|
|
14
|
+
<VisuallyHidden>{children}</VisuallyHidden>
|
|
15
15
|
</a>
|
|
16
16
|
{/* eslint-enable jsx-a11y/anchor-is-valid */}
|
|
17
17
|
</>
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import React from 'react'
|
|
2
|
-
import { bool, node, oneOf, shape, string } from 'prop-types'
|
|
3
1
|
import classNames from 'classnames'
|
|
2
|
+
import { bool, node, oneOf, shape, string } from 'prop-types'
|
|
3
|
+
import React from 'react'
|
|
4
|
+
|
|
4
5
|
import Element from '../Element'
|
|
5
6
|
|
|
6
7
|
const List = ({
|
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
import React, { useEffect, useState } from 'react'
|
|
2
|
-
import { bool, shape, string } from 'prop-types'
|
|
3
1
|
import classNames from 'classnames'
|
|
2
|
+
import { bool, shape, string } from 'prop-types'
|
|
3
|
+
import React, { useEffect, useState } from 'react'
|
|
4
|
+
|
|
4
5
|
import Grid from '../Grid'
|
|
5
6
|
import ResponsiveMedia from '../ResponsiveMedia'
|
|
7
|
+
import VisuallyHidden from '../VisuallyHidden'
|
|
6
8
|
import { getLiveStreamUrls } from './utils'
|
|
7
9
|
|
|
8
10
|
const LiveStream = ({
|
|
@@ -15,8 +17,7 @@ const LiveStream = ({
|
|
|
15
17
|
theme,
|
|
16
18
|
className
|
|
17
19
|
}) => {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
+
const [loading, setLoading] = useState(true)
|
|
20
21
|
const [liveStreamUrls, setLiveSteamUrls] = useState({
|
|
21
22
|
videoUrl: null,
|
|
22
23
|
chatUrl: null
|
|
@@ -24,19 +25,23 @@ const LiveStream = ({
|
|
|
24
25
|
|
|
25
26
|
useEffect(() => {
|
|
26
27
|
const loadUrls = async () => {
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
)
|
|
28
|
+
const urls = await getLiveStreamUrls({
|
|
29
|
+
href,
|
|
30
|
+
autoPlay,
|
|
31
|
+
muted,
|
|
32
|
+
darkMode,
|
|
33
|
+
showChat
|
|
34
|
+
})
|
|
35
|
+
|
|
36
|
+
setLiveSteamUrls(urls)
|
|
37
|
+
setLoading(false)
|
|
36
38
|
}
|
|
37
39
|
|
|
38
40
|
loadUrls()
|
|
39
|
-
|
|
41
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
42
|
+
}, [])
|
|
43
|
+
|
|
44
|
+
if (loading) return <VisuallyHidden>Loading live stream</VisuallyHidden>
|
|
40
45
|
|
|
41
46
|
const { videoUrl, chatUrl } = liveStreamUrls
|
|
42
47
|
|
|
@@ -47,9 +52,8 @@ const LiveStream = ({
|
|
|
47
52
|
<Grid.Item className={theme?.video}>
|
|
48
53
|
<ResponsiveMedia ratio="16:9">
|
|
49
54
|
<iframe
|
|
50
|
-
data-test-id="LiveStreamVideo"
|
|
51
55
|
title="Live stream"
|
|
52
|
-
src={videoUrl.
|
|
56
|
+
src={videoUrl.href}
|
|
53
57
|
allowFullScreen={allowFullScreen}
|
|
54
58
|
loading="lazy"
|
|
55
59
|
/>
|
|
@@ -57,12 +61,7 @@ const LiveStream = ({
|
|
|
57
61
|
</Grid.Item>
|
|
58
62
|
{chatUrl && (
|
|
59
63
|
<Grid.Item className={theme?.chat}>
|
|
60
|
-
<iframe
|
|
61
|
-
data-test-id="LiveStreamChat"
|
|
62
|
-
title="Live chat"
|
|
63
|
-
src={chatUrl.toString()}
|
|
64
|
-
loading="lazy"
|
|
65
|
-
/>
|
|
64
|
+
<iframe title="Live chat" src={chatUrl.href} loading="lazy" />
|
|
66
65
|
</Grid.Item>
|
|
67
66
|
)}
|
|
68
67
|
</Grid>
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import fetch from 'node-fetch'
|
|
2
|
-
import urlJoin from 'url-join'
|
|
3
2
|
import { isMobile } from 'react-device-detect'
|
|
3
|
+
import urlJoin from 'url-join'
|
|
4
4
|
|
|
5
5
|
const getExternalUrl = url =>
|
|
6
6
|
`https://api.allorigins.win/get?url=${encodeURIComponent(url)}`
|
|
7
7
|
|
|
8
8
|
const location = typeof window !== 'undefined' ? window.location : null
|
|
9
|
+
const { hostname } = location
|
|
9
10
|
|
|
10
11
|
const PROVIDERS = {
|
|
11
12
|
facebook: {
|
|
@@ -19,8 +20,7 @@ const PROVIDERS = {
|
|
|
19
20
|
})
|
|
20
21
|
|
|
21
22
|
return url
|
|
22
|
-
}
|
|
23
|
-
getChatUrl: () => ''
|
|
23
|
+
}
|
|
24
24
|
},
|
|
25
25
|
twitch: {
|
|
26
26
|
urlRegEx: /^(https?:\/\/)?(www\.)?(twitch\.tv)\/(.+)$/,
|
|
@@ -29,7 +29,7 @@ const PROVIDERS = {
|
|
|
29
29
|
const url = new URL('https://player.twitch.tv')
|
|
30
30
|
url.search = new URLSearchParams({
|
|
31
31
|
channel,
|
|
32
|
-
parent:
|
|
32
|
+
parent: hostname,
|
|
33
33
|
autoplay: !!autoPlay,
|
|
34
34
|
muted: !!muted
|
|
35
35
|
})
|
|
@@ -39,7 +39,7 @@ const PROVIDERS = {
|
|
|
39
39
|
getChatUrl: ({ channel, darkMode }) => {
|
|
40
40
|
const url = new URL(`https://www.twitch.tv/embed/${channel}/chat`)
|
|
41
41
|
url.search = new URLSearchParams({
|
|
42
|
-
parent:
|
|
42
|
+
parent: hostname,
|
|
43
43
|
...(darkMode && { darkpopout: '' })
|
|
44
44
|
})
|
|
45
45
|
|
|
@@ -49,13 +49,17 @@ const PROVIDERS = {
|
|
|
49
49
|
youtube: {
|
|
50
50
|
urlRegEx: /^(https?:\/\/)?(www\.)?(youtube\.com)(\/c(hannel)?)?\/(.+)$/,
|
|
51
51
|
getChannelParam: async url => {
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
52
|
+
try {
|
|
53
|
+
const { contents } = await fetch(
|
|
54
|
+
getExternalUrl(urlJoin(url, 'live'))
|
|
55
|
+
).then(response => response.json())
|
|
55
56
|
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
57
|
+
return contents?.match(
|
|
58
|
+
/"liveStreamabilityRenderer":{"videoId":"([\w|-]+?)"/
|
|
59
|
+
)?.[1]
|
|
60
|
+
} catch {
|
|
61
|
+
return null
|
|
62
|
+
}
|
|
59
63
|
},
|
|
60
64
|
getVideoUrl: ({ channel, autoPlay, muted }) => {
|
|
61
65
|
const url = new URL(`https://www.youtube-nocookie.com/embed/${channel}`)
|
|
@@ -72,7 +76,7 @@ const PROVIDERS = {
|
|
|
72
76
|
const url = new URL('https://www.youtube.com/live_chat')
|
|
73
77
|
url.search = new URLSearchParams({
|
|
74
78
|
v: channel,
|
|
75
|
-
embed_domain:
|
|
79
|
+
embed_domain: hostname,
|
|
76
80
|
...(darkMode && { dark_theme: 1 })
|
|
77
81
|
})
|
|
78
82
|
|
|
@@ -82,6 +86,8 @@ const PROVIDERS = {
|
|
|
82
86
|
}
|
|
83
87
|
|
|
84
88
|
const getProvider = url => {
|
|
89
|
+
if (!url) return null
|
|
90
|
+
|
|
85
91
|
const keys = Object.keys(PROVIDERS)
|
|
86
92
|
let i = keys.length
|
|
87
93
|
|
|
@@ -100,9 +106,10 @@ export const getLiveStreamUrls = async ({
|
|
|
100
106
|
showChat
|
|
101
107
|
}) => {
|
|
102
108
|
const provider = getProvider(href)
|
|
103
|
-
const channel = await
|
|
104
|
-
const videoUrl =
|
|
105
|
-
|
|
109
|
+
const channel = await provider?.getChannelParam(href)
|
|
110
|
+
const videoUrl =
|
|
111
|
+
channel && provider?.getVideoUrl?.({ channel, autoPlay, muted })
|
|
112
|
+
const chatUrl = channel && provider?.getChatUrl?.({ channel, darkMode })
|
|
106
113
|
|
|
107
114
|
return { videoUrl, chatUrl: showChat && chatUrl }
|
|
108
115
|
}
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import React from 'react'
|
|
2
|
-
import { array, bool, func, shape, string } from 'prop-types'
|
|
3
1
|
import classNames from 'classnames'
|
|
2
|
+
import { array, bool, func, shape, string } from 'prop-types'
|
|
3
|
+
import React from 'react'
|
|
4
|
+
|
|
4
5
|
import { useToggle } from '../../hooks'
|
|
5
6
|
import Button from '../Button'
|
|
6
7
|
import Icon from '../Icon'
|
|
7
8
|
import List from '../List'
|
|
8
9
|
import SmartLink from '../SmartLink'
|
|
9
10
|
import VisuallyHidden from '../VisuallyHidden'
|
|
10
|
-
|
|
11
|
-
import { ReactComponent as MenuSvg } from './images/menu.svg'
|
|
12
11
|
import { ReactComponent as CloseSvg } from './images/close.svg'
|
|
12
|
+
import { ReactComponent as MenuSvg } from './images/menu.svg'
|
|
13
13
|
|
|
14
14
|
const Navigation = ({
|
|
15
15
|
title = 'Navigation',
|
|
@@ -21,10 +21,10 @@ const Navigation = ({
|
|
|
21
21
|
theme,
|
|
22
22
|
className
|
|
23
23
|
}) => {
|
|
24
|
-
if (!links.length) return null
|
|
25
|
-
|
|
26
24
|
const [visible, setVisibility] = useToggle(!toggle)
|
|
27
25
|
|
|
26
|
+
if (!links.length) return null
|
|
27
|
+
|
|
28
28
|
const toggleVisibility = () => {
|
|
29
29
|
setVisibility()
|
|
30
30
|
onToggle({ visible })
|
|
@@ -1,13 +1,12 @@
|
|
|
1
|
-
import React from 'react'
|
|
2
1
|
import { node } from 'prop-types'
|
|
2
|
+
import React from 'react'
|
|
3
|
+
|
|
3
4
|
import ContentContainer from '../ContentContainer'
|
|
4
5
|
|
|
5
6
|
/**
|
|
6
7
|
* The `PageContainer` flexes to fill the unused space within its parent
|
|
7
8
|
*/
|
|
8
9
|
const PageContainer = ({ header, footer, children, theme, ...rest }) => {
|
|
9
|
-
if (!children) return null
|
|
10
|
-
|
|
11
10
|
return (
|
|
12
11
|
<>
|
|
13
12
|
{header}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import React from 'react'
|
|
2
|
-
import { node, shape, string } from 'prop-types'
|
|
3
1
|
import classNames from 'classnames'
|
|
2
|
+
import { node, shape, string } from 'prop-types'
|
|
3
|
+
import React from 'react'
|
|
4
4
|
|
|
5
5
|
const Prose = ({ html, children, theme, className, ...rest }) => {
|
|
6
6
|
if (!html && !children) return null
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import classNames from 'classnames'
|
|
2
2
|
import {
|
|
3
3
|
func,
|
|
4
4
|
node,
|
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
shape,
|
|
9
9
|
string
|
|
10
10
|
} from 'prop-types'
|
|
11
|
-
import
|
|
11
|
+
import React from 'react'
|
|
12
12
|
|
|
13
13
|
const ratioRegExp = /^\d+:\d+$/
|
|
14
14
|
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import React from 'react'
|
|
2
|
-
import { bool, node, oneOf, shape, string } from 'prop-types'
|
|
3
1
|
import classNames from 'classnames'
|
|
2
|
+
import { bool, node, oneOf, shape, string } from 'prop-types'
|
|
3
|
+
import React from 'react'
|
|
4
|
+
|
|
4
5
|
import { useToggle } from '../../hooks'
|
|
5
6
|
import SmartLink from '../SmartLink'
|
|
6
7
|
|
|
@@ -21,10 +22,10 @@ const Tooltip = ({
|
|
|
21
22
|
theme,
|
|
22
23
|
className
|
|
23
24
|
}) => {
|
|
24
|
-
if (!heading && !children) return null
|
|
25
|
-
|
|
26
25
|
const [visible, setVisibility] = useToggle(!hidden)
|
|
27
26
|
|
|
27
|
+
if (!heading && !children) return null
|
|
28
|
+
|
|
28
29
|
return (
|
|
29
30
|
<span
|
|
30
31
|
className={classNames(theme?.root, className)}
|
package/src/components/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export { default as ContentContainer } from './ContentContainer'
|
|
2
1
|
export { default as Backdrop } from './Backdrop'
|
|
3
2
|
export { default as Button } from './Button'
|
|
4
3
|
export { default as Card } from './Card'
|
|
4
|
+
export { default as ContentContainer } from './ContentContainer'
|
|
5
5
|
export { default as CreditLockup } from './CreditLockup'
|
|
6
6
|
export { default as Element } from './Element'
|
|
7
7
|
export { default as FooterContainer } from './FooterContainer'
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Meta, Title } from '@storybook/addon-docs'
|
|
2
|
-
import { CreditLockup, Image, SmartLink } from '../../src'
|
|
3
|
-
import packageInfo from '../../package.json'
|
|
4
2
|
|
|
5
3
|
import { ReactComponent as LogoSvg } from '../../.storybook/static/logo.svg'
|
|
4
|
+
import packageInfo from '../../package.json'
|
|
5
|
+
import { CreditLockup, Image, SmartLink } from '../../src'
|
|
6
6
|
|
|
7
7
|
<Meta title="Docs/README" />
|
|
8
8
|
|