@telus-uds/components-web 2.43.0 → 3.0.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/.eslintrc.cjs +26 -0
- package/CHANGELOG.md +21 -2
- package/babel.config.cjs +4 -0
- package/jest.config.cjs +29 -0
- package/lib/Badge/Badge.js +21 -29
- package/lib/Badge/index.js +2 -10
- package/lib/BlockQuote/BlockQuote.js +31 -39
- package/lib/BlockQuote/index.js +2 -10
- package/lib/Breadcrumbs/Breadcrumbs.js +39 -49
- package/lib/Breadcrumbs/Item/Item.js +26 -34
- package/lib/Breadcrumbs/index.js +1 -13
- package/lib/Callout/Callout.js +19 -27
- package/lib/Callout/index.js +2 -10
- package/lib/Card/Card.js +44 -54
- package/lib/Card/CardContent.js +17 -25
- package/lib/Card/CardFooter.js +16 -24
- package/lib/Card/index.js +2 -10
- package/lib/Countdown/Countdown.js +34 -42
- package/lib/Countdown/Segment.js +26 -34
- package/lib/Countdown/constants.js +4 -14
- package/lib/Countdown/dictionary.js +2 -9
- package/lib/Countdown/index.js +2 -10
- package/lib/Countdown/types.js +18 -28
- package/lib/Countdown/useCountdown.js +4 -11
- package/lib/DatePicker/CalendarContainer.js +6 -12
- package/lib/DatePicker/DatePicker.js +105 -101
- package/lib/DatePicker/dictionary.js +1 -8
- package/lib/DatePicker/index.js +2 -10
- package/lib/DatePicker/reactDatesCss.js +3 -10
- package/lib/Disclaimer/Disclaimer.js +15 -23
- package/lib/Disclaimer/index.js +1 -13
- package/lib/ExpandCollapseMini/ExpandCollapseMini.js +16 -24
- package/lib/ExpandCollapseMini/ExpandCollapseMiniControl.js +17 -26
- package/lib/ExpandCollapseMini/index.js +2 -10
- package/lib/Footnote/Footnote.js +85 -95
- package/lib/Footnote/FootnoteLink.js +25 -33
- package/lib/Footnote/dictionary.js +2 -9
- package/lib/Footnote/index.js +4 -12
- package/lib/IconButton/IconButton.js +12 -20
- package/lib/IconButton/index.js +2 -10
- package/lib/Image/Image.js +17 -25
- package/lib/Image/index.js +6 -18
- package/lib/Image/server.js +4 -12
- package/lib/List/List.js +2 -9
- package/lib/List/ListItem.js +10 -18
- package/lib/List/index.js +4 -12
- package/lib/NavigationBar/NavigationBar.js +51 -59
- package/lib/NavigationBar/NavigationItem.js +19 -27
- package/lib/NavigationBar/NavigationSubMenu.js +34 -40
- package/lib/NavigationBar/collapseItems.js +1 -11
- package/lib/NavigationBar/index.js +4 -12
- package/lib/NavigationBar/resolveItemSelection.js +1 -8
- package/lib/OptimizeImage/OptimizeImage.js +26 -34
- package/lib/OptimizeImage/index.js +2 -10
- package/lib/OptimizeImage/utils/getFallbackUrl.js +3 -10
- package/lib/OptimizeImage/utils/getImageUrls.js +9 -16
- package/lib/OptimizeImage/utils/getOptimizedUrl.js +3 -10
- package/lib/OptimizeImage/utils/hasWebpSupport.js +1 -7
- package/lib/OptimizeImage/utils/index.js +5 -34
- package/lib/OptimizeImage/utils/isSvgUrl.js +1 -7
- package/lib/OrderedList/Item.js +28 -36
- package/lib/OrderedList/ItemBase.js +8 -16
- package/lib/OrderedList/OrderedList.js +22 -30
- package/lib/OrderedList/OrderedListBase.js +12 -20
- package/lib/OrderedList/constants.js +1 -8
- package/lib/OrderedList/index.js +4 -12
- package/lib/Paragraph/Paragraph.js +22 -30
- package/lib/Paragraph/index.js +2 -10
- package/lib/PreviewCard/AuthorDate.js +17 -21
- package/lib/PreviewCard/PreviewCard.js +40 -49
- package/lib/PreviewCard/index.js +2 -10
- package/lib/PriceLockup/PriceLockup.js +56 -64
- package/lib/PriceLockup/index.js +2 -10
- package/lib/PriceLockup/tokens.js +2 -9
- package/lib/Progress/ProgressBar.js +17 -24
- package/lib/Progress/index.js +4 -12
- package/lib/QuantitySelector/QuantitySelector.js +55 -63
- package/lib/QuantitySelector/SideButton.js +15 -23
- package/lib/QuantitySelector/dictionary.js +2 -9
- package/lib/QuantitySelector/index.js +2 -10
- package/lib/QuantitySelector/styles.js +4 -13
- package/lib/ResponsiveImage/ResponsiveImage.js +29 -37
- package/lib/ResponsiveImage/index.js +2 -10
- package/lib/Ribbon/Ribbon.js +22 -30
- package/lib/Ribbon/index.js +2 -10
- package/lib/SkeletonProvider/SkeletonImage.js +14 -22
- package/lib/SkeletonProvider/SkeletonProvider.js +17 -25
- package/lib/SkeletonProvider/SkeletonTypography.js +14 -22
- package/lib/SkeletonProvider/index.js +2 -10
- package/lib/Span/Span.js +23 -31
- package/lib/Span/index.js +2 -10
- package/lib/Spinner/Spinner.js +43 -51
- package/lib/Spinner/SpinnerContent.js +21 -29
- package/lib/Spinner/constants.js +4 -14
- package/lib/Spinner/index.js +2 -10
- package/lib/StoryCard/StoryCard.js +40 -49
- package/lib/StoryCard/index.js +2 -10
- package/lib/Table/Body.js +7 -15
- package/lib/Table/Cell.js +28 -38
- package/lib/Table/Header.js +11 -19
- package/lib/Table/Row.js +8 -16
- package/lib/Table/SubHeading.js +10 -18
- package/lib/Table/Table.js +26 -35
- package/lib/Table/index.js +12 -20
- package/lib/TermsAndConditions/ExpandCollapse.js +22 -30
- package/lib/TermsAndConditions/TermsAndConditions.js +52 -60
- package/lib/TermsAndConditions/dictionary.js +2 -9
- package/lib/TermsAndConditions/index.js +1 -13
- package/lib/Testimonial/Testimonial.js +37 -45
- package/lib/Testimonial/index.js +2 -10
- package/lib/Toast/Toast.js +32 -42
- package/lib/Toast/index.js +2 -10
- package/lib/Video/ControlBar/ControlBar.js +73 -81
- package/lib/Video/ControlBar/Controls/VideoButton/VideoButton.js +16 -24
- package/lib/Video/ControlBar/Controls/VideoMenu/VideoMenu.js +27 -35
- package/lib/Video/ControlBar/Controls/VideoProgressBar/VideoProgressBar.js +27 -36
- package/lib/Video/ControlBar/Controls/VolumeSlider/VolumeSlider.js +30 -38
- package/lib/Video/MiddleControlButton/MiddleControlButton.js +16 -24
- package/lib/Video/Video.js +74 -83
- package/lib/Video/index.js +2 -10
- package/lib/Video/videoText.js +1 -8
- package/lib/VideoPicker/VideoPicker.js +43 -53
- package/lib/VideoPicker/VideoPickerPlayer.js +17 -25
- package/lib/VideoPicker/VideoPickerThumbnail.js +38 -46
- package/lib/VideoPicker/VideoSlider.js +17 -26
- package/lib/VideoPicker/index.js +2 -10
- package/lib/VideoPicker/videoPropType.js +9 -18
- package/lib/WaffleGrid/WaffleGrid.js +33 -43
- package/lib/WaffleGrid/index.js +2 -10
- package/lib/WebVideo/WebVideo.js +42 -52
- package/lib/WebVideo/index.js +2 -10
- package/lib/WebVideo/utils/index.js +3 -11
- package/lib/baseExports.js +18 -431
- package/lib/index.js +38 -323
- package/lib/server.js +4 -12
- package/lib/shared/ConditionalWrapper/ConditionalWrapper.js +9 -17
- package/lib/shared/ConditionalWrapper/index.js +2 -10
- package/lib/shared/FullBleedContent/FullBleedContent.js +21 -29
- package/lib/shared/FullBleedContent/getFullBleedBorderRadius.js +1 -8
- package/lib/shared/FullBleedContent/index.js +4 -24
- package/lib/shared/FullBleedContent/useFullBleedContentProps.js +4 -11
- package/lib/shared/VideoSplash/SplashButton/SplashButton.js +19 -27
- package/lib/shared/VideoSplash/SplashButtonWithDetails/SplashButtonWithDetails.js +27 -35
- package/lib/shared/VideoSplash/VideoSplash.js +24 -32
- package/lib/shared/VideoSplash/helpers.js +5 -14
- package/lib/utils/index.js +10 -75
- package/lib/utils/isElementFocusable.js +1 -8
- package/lib/utils/logger.js +6 -15
- package/lib/utils/media.js +5 -11
- package/lib/utils/renderStructuredContent.js +8 -15
- package/lib/utils/ssr.js +5 -12
- package/lib/utils/theming/get-theme-from-server.js +2 -10
- package/lib/utils/theming/with-client-theme.js +9 -17
- package/lib/utils/theming/with-server-theme.js +11 -19
- package/lib/utils/transforms.js +3 -11
- package/lib/utils/useOverlaidPosition.js +15 -23
- package/lib/utils/useTypographyTheme.js +6 -13
- package/package.json +18 -20
- package/src/Card/Card.jsx +2 -2
- package/src/DatePicker/DatePicker.jsx +17 -4
- package/src/PreviewCard/AuthorDate.jsx +5 -3
- package/src/utils/logger.js +2 -2
- package/lib-module/Badge/Badge.js +0 -121
- package/lib-module/Badge/index.js +0 -2
- package/lib-module/BlockQuote/BlockQuote.js +0 -204
- package/lib-module/BlockQuote/index.js +0 -2
- package/lib-module/Breadcrumbs/Breadcrumbs.js +0 -250
- package/lib-module/Breadcrumbs/Item/Item.js +0 -175
- package/lib-module/Breadcrumbs/index.js +0 -1
- package/lib-module/Callout/Callout.js +0 -135
- package/lib-module/Callout/index.js +0 -2
- package/lib-module/Card/Card.js +0 -251
- package/lib-module/Card/CardContent.js +0 -90
- package/lib-module/Card/CardFooter.js +0 -78
- package/lib-module/Card/index.js +0 -2
- package/lib-module/Countdown/Countdown.js +0 -169
- package/lib-module/Countdown/Segment.js +0 -96
- package/lib-module/Countdown/constants.js +0 -4
- package/lib-module/Countdown/dictionary.js +0 -22
- package/lib-module/Countdown/index.js +0 -2
- package/lib-module/Countdown/types.js +0 -24
- package/lib-module/Countdown/useCountdown.js +0 -26
- package/lib-module/DatePicker/CalendarContainer.js +0 -208
- package/lib-module/DatePicker/DatePicker.js +0 -506
- package/lib-module/DatePicker/dictionary.js +0 -119
- package/lib-module/DatePicker/index.js +0 -2
- package/lib-module/DatePicker/reactDatesCss.js +0 -3
- package/lib-module/Disclaimer/Disclaimer.js +0 -54
- package/lib-module/Disclaimer/index.js +0 -1
- package/lib-module/ExpandCollapseMini/ExpandCollapseMini.js +0 -73
- package/lib-module/ExpandCollapseMini/ExpandCollapseMiniControl.js +0 -117
- package/lib-module/ExpandCollapseMini/index.js +0 -2
- package/lib-module/Footnote/Footnote.js +0 -632
- package/lib-module/Footnote/FootnoteLink.js +0 -118
- package/lib-module/Footnote/dictionary.js +0 -12
- package/lib-module/Footnote/index.js +0 -4
- package/lib-module/IconButton/IconButton.js +0 -55
- package/lib-module/IconButton/index.js +0 -2
- package/lib-module/Image/Image.js +0 -83
- package/lib-module/Image/index.js +0 -9
- package/lib-module/Image/server.js +0 -4
- package/lib-module/List/List.js +0 -2
- package/lib-module/List/ListItem.js +0 -28
- package/lib-module/List/index.js +0 -4
- package/lib-module/NavigationBar/NavigationBar.js +0 -224
- package/lib-module/NavigationBar/NavigationItem.js +0 -87
- package/lib-module/NavigationBar/NavigationSubMenu.js +0 -162
- package/lib-module/NavigationBar/collapseItems.js +0 -41
- package/lib-module/NavigationBar/index.js +0 -4
- package/lib-module/NavigationBar/resolveItemSelection.js +0 -16
- package/lib-module/OptimizeImage/OptimizeImage.js +0 -92
- package/lib-module/OptimizeImage/index.js +0 -2
- package/lib-module/OptimizeImage/utils/getFallbackUrl.js +0 -7
- package/lib-module/OptimizeImage/utils/getImageUrls.js +0 -12
- package/lib-module/OptimizeImage/utils/getOptimizedUrl.js +0 -17
- package/lib-module/OptimizeImage/utils/hasWebpSupport.js +0 -28
- package/lib-module/OptimizeImage/utils/index.js +0 -5
- package/lib-module/OptimizeImage/utils/isSvgUrl.js +0 -3
- package/lib-module/OrderedList/Item.js +0 -145
- package/lib-module/OrderedList/ItemBase.js +0 -27
- package/lib-module/OrderedList/OrderedList.js +0 -86
- package/lib-module/OrderedList/OrderedListBase.js +0 -45
- package/lib-module/OrderedList/constants.js +0 -2
- package/lib-module/OrderedList/index.js +0 -4
- package/lib-module/Paragraph/Paragraph.js +0 -90
- package/lib-module/Paragraph/index.js +0 -2
- package/lib-module/PreviewCard/AuthorDate.js +0 -57
- package/lib-module/PreviewCard/PreviewCard.js +0 -209
- package/lib-module/PreviewCard/index.js +0 -2
- package/lib-module/PriceLockup/PriceLockup.js +0 -335
- package/lib-module/PriceLockup/index.js +0 -2
- package/lib-module/PriceLockup/tokens.js +0 -55
- package/lib-module/Progress/ProgressBar.js +0 -83
- package/lib-module/Progress/index.js +0 -4
- package/lib-module/QuantitySelector/QuantitySelector.js +0 -261
- package/lib-module/QuantitySelector/SideButton.js +0 -70
- package/lib-module/QuantitySelector/dictionary.js +0 -26
- package/lib-module/QuantitySelector/index.js +0 -2
- package/lib-module/QuantitySelector/styles.js +0 -9
- package/lib-module/ResponsiveImage/ResponsiveImage.js +0 -95
- package/lib-module/ResponsiveImage/index.js +0 -2
- package/lib-module/Ribbon/Ribbon.js +0 -216
- package/lib-module/Ribbon/index.js +0 -2
- package/lib-module/SkeletonProvider/SkeletonImage.js +0 -39
- package/lib-module/SkeletonProvider/SkeletonProvider.js +0 -57
- package/lib-module/SkeletonProvider/SkeletonTypography.js +0 -38
- package/lib-module/SkeletonProvider/index.js +0 -2
- package/lib-module/Span/Span.js +0 -72
- package/lib-module/Span/index.js +0 -2
- package/lib-module/Spinner/Spinner.js +0 -215
- package/lib-module/Spinner/SpinnerContent.js +0 -94
- package/lib-module/Spinner/constants.js +0 -4
- package/lib-module/Spinner/index.js +0 -2
- package/lib-module/StoryCard/StoryCard.js +0 -212
- package/lib-module/StoryCard/index.js +0 -2
- package/lib-module/Table/Body.js +0 -17
- package/lib-module/Table/Cell.js +0 -176
- package/lib-module/Table/Header.js +0 -25
- package/lib-module/Table/Row.js +0 -19
- package/lib-module/Table/SubHeading.js +0 -23
- package/lib-module/Table/Table.js +0 -114
- package/lib-module/Table/index.js +0 -12
- package/lib-module/TermsAndConditions/ExpandCollapse.js +0 -153
- package/lib-module/TermsAndConditions/TermsAndConditions.js +0 -277
- package/lib-module/TermsAndConditions/dictionary.js +0 -16
- package/lib-module/TermsAndConditions/index.js +0 -1
- package/lib-module/Testimonial/Testimonial.js +0 -234
- package/lib-module/Testimonial/index.js +0 -2
- package/lib-module/Toast/Toast.js +0 -158
- package/lib-module/Toast/index.js +0 -2
- package/lib-module/Video/ControlBar/ControlBar.js +0 -288
- package/lib-module/Video/ControlBar/Controls/VideoButton/VideoButton.js +0 -70
- package/lib-module/Video/ControlBar/Controls/VideoMenu/VideoMenu.js +0 -163
- package/lib-module/Video/ControlBar/Controls/VideoProgressBar/VideoProgressBar.js +0 -203
- package/lib-module/Video/ControlBar/Controls/VolumeSlider/VolumeSlider.js +0 -191
- package/lib-module/Video/MiddleControlButton/MiddleControlButton.js +0 -71
- package/lib-module/Video/Video.js +0 -959
- package/lib-module/Video/index.js +0 -2
- package/lib-module/Video/videoText.js +0 -55
- package/lib-module/VideoPicker/VideoPicker.js +0 -190
- package/lib-module/VideoPicker/VideoPickerPlayer.js +0 -48
- package/lib-module/VideoPicker/VideoPickerThumbnail.js +0 -218
- package/lib-module/VideoPicker/VideoSlider.js +0 -82
- package/lib-module/VideoPicker/index.js +0 -2
- package/lib-module/VideoPicker/videoPropType.js +0 -10
- package/lib-module/WaffleGrid/WaffleGrid.js +0 -157
- package/lib-module/WaffleGrid/index.js +0 -2
- package/lib-module/WebVideo/WebVideo.js +0 -191
- package/lib-module/WebVideo/index.js +0 -2
- package/lib-module/WebVideo/utils/index.js +0 -50
- package/lib-module/baseExports.js +0 -19
- package/lib-module/index.js +0 -40
- package/lib-module/server.js +0 -5
- package/lib-module/shared/ConditionalWrapper/ConditionalWrapper.js +0 -22
- package/lib-module/shared/ConditionalWrapper/index.js +0 -2
- package/lib-module/shared/FullBleedContent/FullBleedContent.js +0 -101
- package/lib-module/shared/FullBleedContent/getFullBleedBorderRadius.js +0 -55
- package/lib-module/shared/FullBleedContent/index.js +0 -4
- package/lib-module/shared/FullBleedContent/useFullBleedContentProps.js +0 -55
- package/lib-module/shared/VideoSplash/SplashButton/SplashButton.js +0 -84
- package/lib-module/shared/VideoSplash/SplashButtonWithDetails/SplashButtonWithDetails.js +0 -223
- package/lib-module/shared/VideoSplash/VideoSplash.js +0 -65
- package/lib-module/shared/VideoSplash/helpers.js +0 -23
- package/lib-module/utils/index.js +0 -10
- package/lib-module/utils/isElementFocusable.js +0 -8
- package/lib-module/utils/logger.js +0 -18
- package/lib-module/utils/media.js +0 -39
- package/lib-module/utils/renderStructuredContent.js +0 -66
- package/lib-module/utils/ssr.js +0 -37
- package/lib-module/utils/theming/get-theme-from-server.js +0 -16
- package/lib-module/utils/theming/with-client-theme.js +0 -24
- package/lib-module/utils/theming/with-server-theme.js +0 -26
- package/lib-module/utils/transforms.js +0 -4
- package/lib-module/utils/useOverlaidPosition.js +0 -216
- package/lib-module/utils/useTypographyTheme.js +0 -24
|
@@ -1,20 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
var _VideoButton = _interopRequireDefault(require("../VideoButton/VideoButton"));
|
|
12
|
-
var _videoText = _interopRequireDefault(require("../../../videoText"));
|
|
13
|
-
var _utils = require("../../../../utils");
|
|
14
|
-
var _jsxRuntime = require("react/jsx-runtime");
|
|
15
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
16
|
-
const [selectProps, selectedSystemPropTypes] = (0, _componentsBase.selectSystemProps)([_utils.htmlAttrs]);
|
|
17
|
-
const VolumeSliderContainer = /*#__PURE__*/_styledComponents.default.div.withConfig({
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
3
|
+
import styled from 'styled-components';
|
|
4
|
+
import { Icon, useThemeTokens, selectSystemProps } from '@telus-uds/components-base';
|
|
5
|
+
import VideoButton from '../VideoButton/VideoButton';
|
|
6
|
+
import videoText from '../../../videoText';
|
|
7
|
+
import { htmlAttrs } from '../../../../utils';
|
|
8
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
9
|
+
const [selectProps, selectedSystemPropTypes] = selectSystemProps([htmlAttrs]);
|
|
10
|
+
const VolumeSliderContainer = /*#__PURE__*/styled.div.withConfig({
|
|
18
11
|
displayName: "VolumeSlider__VolumeSliderContainer",
|
|
19
12
|
componentId: "components-web__sc-apixz4-0"
|
|
20
13
|
})(_ref => {
|
|
@@ -61,7 +54,7 @@ const sharedStyles = _ref2 => {
|
|
|
61
54
|
})
|
|
62
55
|
};
|
|
63
56
|
};
|
|
64
|
-
const StyledVolumeSlider = /*#__PURE__*/
|
|
57
|
+
const StyledVolumeSlider = /*#__PURE__*/styled.input.attrs(_ref3 => {
|
|
65
58
|
let {
|
|
66
59
|
videoCurrentVolume
|
|
67
60
|
} = _ref3;
|
|
@@ -129,7 +122,7 @@ const VolumeSlider = _ref5 => {
|
|
|
129
122
|
variant,
|
|
130
123
|
...rest
|
|
131
124
|
} = _ref5;
|
|
132
|
-
const refVolumeSlider =
|
|
125
|
+
const refVolumeSlider = React.useRef();
|
|
133
126
|
const {
|
|
134
127
|
marginLeft,
|
|
135
128
|
marginRight,
|
|
@@ -141,7 +134,7 @@ const VolumeSlider = _ref5 => {
|
|
|
141
134
|
rangeBackground,
|
|
142
135
|
mutedIcon,
|
|
143
136
|
unmutedIcon
|
|
144
|
-
} =
|
|
137
|
+
} = useThemeTokens('VideoVolumeSlider', tokens, variant);
|
|
145
138
|
const sharedProps = {
|
|
146
139
|
thumbHeight,
|
|
147
140
|
thumbWidth,
|
|
@@ -151,22 +144,22 @@ const VolumeSlider = _ref5 => {
|
|
|
151
144
|
rangeBackground
|
|
152
145
|
};
|
|
153
146
|
const handleVolumeChange = () => setVolume(refVolumeSlider.current.value);
|
|
154
|
-
return /*#__PURE__*/(
|
|
147
|
+
return /*#__PURE__*/_jsxs(VolumeSliderContainer, {
|
|
155
148
|
compactModeThreshold: compactModeThreshold,
|
|
156
149
|
videoPlayerWidth: videoPlayerWidth,
|
|
157
150
|
margin: `0 ${marginRight}px 0 ${marginLeft}px`,
|
|
158
151
|
...selectProps(rest),
|
|
159
|
-
children: [/*#__PURE__*/(
|
|
160
|
-
icon: videoIsMuted ? /*#__PURE__*/(
|
|
152
|
+
children: [/*#__PURE__*/_jsx(VideoButton, {
|
|
153
|
+
icon: videoIsMuted ? /*#__PURE__*/_jsx(Icon, {
|
|
161
154
|
icon: mutedIcon
|
|
162
|
-
}) : /*#__PURE__*/(
|
|
155
|
+
}) : /*#__PURE__*/_jsx(Icon, {
|
|
163
156
|
icon: unmutedIcon
|
|
164
157
|
}),
|
|
165
|
-
label: videoIsMuted ?
|
|
158
|
+
label: videoIsMuted ? videoText[copy].unmute : videoText[copy].mute,
|
|
166
159
|
disableFocus: disableFocus,
|
|
167
160
|
onClick: toggleMute,
|
|
168
161
|
onFocus: resetInactivityTimer
|
|
169
|
-
}), /*#__PURE__*/(
|
|
162
|
+
}), /*#__PURE__*/_jsx(StyledVolumeSlider, {
|
|
170
163
|
type: "range",
|
|
171
164
|
min: "0",
|
|
172
165
|
max: "1",
|
|
@@ -177,22 +170,21 @@ const VolumeSlider = _ref5 => {
|
|
|
177
170
|
onChange: handleVolumeChange,
|
|
178
171
|
onFocus: resetInactivityTimer,
|
|
179
172
|
tabIndex: "-1",
|
|
180
|
-
"aria-label":
|
|
173
|
+
"aria-label": videoText[copy].volumeSliderLabel,
|
|
181
174
|
...sharedProps
|
|
182
175
|
})]
|
|
183
176
|
});
|
|
184
177
|
};
|
|
185
178
|
VolumeSlider.propTypes = {
|
|
186
179
|
...selectedSystemPropTypes,
|
|
187
|
-
videoCurrentVolume:
|
|
188
|
-
setVolume:
|
|
189
|
-
videoIsMuted:
|
|
190
|
-
toggleMute:
|
|
191
|
-
resetInactivityTimer:
|
|
192
|
-
copy:
|
|
193
|
-
compactModeThreshold:
|
|
194
|
-
videoPlayerWidth:
|
|
195
|
-
disableFocus:
|
|
180
|
+
videoCurrentVolume: PropTypes.number.isRequired,
|
|
181
|
+
setVolume: PropTypes.func.isRequired,
|
|
182
|
+
videoIsMuted: PropTypes.bool.isRequired,
|
|
183
|
+
toggleMute: PropTypes.func.isRequired,
|
|
184
|
+
resetInactivityTimer: PropTypes.func.isRequired,
|
|
185
|
+
copy: PropTypes.oneOf(['en', 'fr']).isRequired,
|
|
186
|
+
compactModeThreshold: PropTypes.number.isRequired,
|
|
187
|
+
videoPlayerWidth: PropTypes.number.isRequired,
|
|
188
|
+
disableFocus: PropTypes.bool.isRequired
|
|
196
189
|
};
|
|
197
|
-
|
|
198
|
-
exports.default = _default;
|
|
190
|
+
export default VolumeSlider;
|
|
@@ -1,18 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
10
|
-
var _componentsBase = require("@telus-uds/components-base");
|
|
11
|
-
var _utils = require("../../utils");
|
|
12
|
-
var _jsxRuntime = require("react/jsx-runtime");
|
|
13
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
14
|
-
const [selectProps, selectedSystemPropTypes] = (0, _componentsBase.selectSystemProps)([_utils.htmlAttrs]);
|
|
15
|
-
const StyledMiddleControlButton = /*#__PURE__*/_styledComponents.default.button.withConfig({
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
3
|
+
import styled from 'styled-components';
|
|
4
|
+
import { useThemeTokens, selectSystemProps } from '@telus-uds/components-base';
|
|
5
|
+
import { htmlAttrs } from '../../utils';
|
|
6
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
7
|
+
const [selectProps, selectedSystemPropTypes] = selectSystemProps([htmlAttrs]);
|
|
8
|
+
const StyledMiddleControlButton = /*#__PURE__*/styled.button.withConfig({
|
|
16
9
|
displayName: "MiddleControlButton__StyledMiddleControlButton",
|
|
17
10
|
componentId: "components-web__sc-1um2s37-0"
|
|
18
11
|
})(_ref => {
|
|
@@ -53,8 +46,8 @@ const MiddleControlButton = _ref2 => {
|
|
|
53
46
|
height,
|
|
54
47
|
background,
|
|
55
48
|
iconColor
|
|
56
|
-
} =
|
|
57
|
-
return /*#__PURE__*/(
|
|
49
|
+
} = useThemeTokens('VideoMiddleControlButton', tokens, variant);
|
|
50
|
+
return /*#__PURE__*/_jsx(StyledMiddleControlButton, {
|
|
58
51
|
isHidden: isHidden,
|
|
59
52
|
onClick: onClick,
|
|
60
53
|
onFocus: onFocus,
|
|
@@ -62,7 +55,7 @@ const MiddleControlButton = _ref2 => {
|
|
|
62
55
|
height: height,
|
|
63
56
|
background: background,
|
|
64
57
|
...selectProps(rest),
|
|
65
|
-
children: /*#__PURE__*/(
|
|
58
|
+
children: /*#__PURE__*/_jsx(Icon, {
|
|
66
59
|
color: iconColor,
|
|
67
60
|
size: 24
|
|
68
61
|
})
|
|
@@ -70,10 +63,9 @@ const MiddleControlButton = _ref2 => {
|
|
|
70
63
|
};
|
|
71
64
|
MiddleControlButton.propTypes = {
|
|
72
65
|
...selectedSystemPropTypes,
|
|
73
|
-
icon:
|
|
74
|
-
isHidden:
|
|
75
|
-
onClick:
|
|
76
|
-
onFocus:
|
|
66
|
+
icon: PropTypes.elementType.isRequired,
|
|
67
|
+
isHidden: PropTypes.bool,
|
|
68
|
+
onClick: PropTypes.func,
|
|
69
|
+
onFocus: PropTypes.func
|
|
77
70
|
};
|
|
78
|
-
|
|
79
|
-
exports.default = _default;
|
|
71
|
+
export default MiddleControlButton;
|
package/lib/Video/Video.js
CHANGED
|
@@ -1,26 +1,19 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
var _VideoSplash = _interopRequireDefault(require("../shared/VideoSplash/VideoSplash"));
|
|
15
|
-
var _MiddleControlButton = _interopRequireDefault(require("./MiddleControlButton/MiddleControlButton"));
|
|
16
|
-
var _ControlBar = _interopRequireDefault(require("./ControlBar/ControlBar"));
|
|
17
|
-
var _videoText = _interopRequireDefault(require("./videoText"));
|
|
18
|
-
var _jsxRuntime = require("react/jsx-runtime");
|
|
19
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
20
|
-
const [selectProps, selectedSystemPropTypes] = (0, _componentsBase.selectSystemProps)([_utils.htmlAttrs]);
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
3
|
+
import styled from 'styled-components';
|
|
4
|
+
import fscreen from 'fscreen';
|
|
5
|
+
import { useThemeTokens, selectSystemProps, getTokensPropType, variantProp } from '@telus-uds/components-base';
|
|
6
|
+
import Spinner from '../Spinner';
|
|
7
|
+
import { warn, htmlAttrs } from '../utils';
|
|
8
|
+
import VideoSplash from '../shared/VideoSplash/VideoSplash';
|
|
9
|
+
import MiddleControlButton from './MiddleControlButton/MiddleControlButton';
|
|
10
|
+
import ControlBar from './ControlBar/ControlBar';
|
|
11
|
+
import videoText from './videoText';
|
|
12
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
|
+
const [selectProps, selectedSystemPropTypes] = selectSystemProps([htmlAttrs]);
|
|
21
14
|
|
|
22
15
|
// TODO: replace with the actual spinner component from UDS
|
|
23
|
-
const VideoPlayerContainer = /*#__PURE__*/
|
|
16
|
+
const VideoPlayerContainer = /*#__PURE__*/styled.div.withConfig({
|
|
24
17
|
displayName: "Video__VideoPlayerContainer",
|
|
25
18
|
componentId: "components-web__sc-12ltnuw-0"
|
|
26
19
|
})(_ref => {
|
|
@@ -35,7 +28,7 @@ const VideoPlayerContainer = /*#__PURE__*/_styledComponents.default.div.withConf
|
|
|
35
28
|
border: videoBorder ? `20px solid ${borderColor}` : undefined
|
|
36
29
|
};
|
|
37
30
|
});
|
|
38
|
-
const VideoElementContainer = /*#__PURE__*/
|
|
31
|
+
const VideoElementContainer = /*#__PURE__*/styled.div.withConfig({
|
|
39
32
|
displayName: "Video__VideoElementContainer",
|
|
40
33
|
componentId: "components-web__sc-12ltnuw-1"
|
|
41
34
|
})({
|
|
@@ -44,14 +37,14 @@ const VideoElementContainer = /*#__PURE__*/_styledComponents.default.div.withCon
|
|
|
44
37
|
height: '100%',
|
|
45
38
|
fontSize: 0
|
|
46
39
|
});
|
|
47
|
-
const VideoPlayer = /*#__PURE__*/
|
|
40
|
+
const VideoPlayer = /*#__PURE__*/styled.video.withConfig({
|
|
48
41
|
displayName: "Video__VideoPlayer",
|
|
49
42
|
componentId: "components-web__sc-12ltnuw-2"
|
|
50
43
|
})({
|
|
51
44
|
width: '100%',
|
|
52
45
|
height: '100%'
|
|
53
46
|
});
|
|
54
|
-
const VideoOverlayContainer = /*#__PURE__*/
|
|
47
|
+
const VideoOverlayContainer = /*#__PURE__*/styled.div.withConfig({
|
|
55
48
|
displayName: "Video__VideoOverlayContainer",
|
|
56
49
|
componentId: "components-web__sc-12ltnuw-3"
|
|
57
50
|
})(_ref2 => {
|
|
@@ -65,7 +58,7 @@ const VideoOverlayContainer = /*#__PURE__*/_styledComponents.default.div.withCon
|
|
|
65
58
|
cursor: mouseInactive ? 'none' : 'pointer'
|
|
66
59
|
};
|
|
67
60
|
});
|
|
68
|
-
const VideoSplashContainer = /*#__PURE__*/
|
|
61
|
+
const VideoSplashContainer = /*#__PURE__*/styled.div.withConfig({
|
|
69
62
|
displayName: "Video__VideoSplashContainer",
|
|
70
63
|
componentId: "components-web__sc-12ltnuw-4"
|
|
71
64
|
})({
|
|
@@ -74,7 +67,7 @@ const VideoSplashContainer = /*#__PURE__*/_styledComponents.default.div.withConf
|
|
|
74
67
|
height: '100%',
|
|
75
68
|
zIndex: 5
|
|
76
69
|
});
|
|
77
|
-
const VideoOverlayElementContainer = /*#__PURE__*/
|
|
70
|
+
const VideoOverlayElementContainer = /*#__PURE__*/styled.div.withConfig({
|
|
78
71
|
displayName: "Video__VideoOverlayElementContainer",
|
|
79
72
|
componentId: "components-web__sc-12ltnuw-5"
|
|
80
73
|
})({
|
|
@@ -105,16 +98,16 @@ const Video = _ref3 => {
|
|
|
105
98
|
variant = {},
|
|
106
99
|
...rest
|
|
107
100
|
} = _ref3;
|
|
108
|
-
const refVideoPlayer =
|
|
109
|
-
const refVideoPlayerContainer =
|
|
110
|
-
const refKeyboardInstructions =
|
|
101
|
+
const refVideoPlayer = React.useRef({});
|
|
102
|
+
const refVideoPlayerContainer = React.useRef({});
|
|
103
|
+
const refKeyboardInstructions = React.useRef({});
|
|
111
104
|
let inactivityTimer = null;
|
|
112
105
|
const {
|
|
113
106
|
borderColor,
|
|
114
107
|
pauseIcon,
|
|
115
108
|
playIcon,
|
|
116
109
|
replayIcon
|
|
117
|
-
} =
|
|
110
|
+
} = useThemeTokens('Video', tokens, variant);
|
|
118
111
|
const playerOptions = {
|
|
119
112
|
mouseTimeout: simpleMode ? 750 : 1500,
|
|
120
113
|
// defined in ms
|
|
@@ -124,8 +117,7 @@ const Video = _ref3 => {
|
|
|
124
117
|
// from 0 to 1
|
|
125
118
|
compactModeThreshold: 700 // in px
|
|
126
119
|
};
|
|
127
|
-
|
|
128
|
-
const [videoPlayerState, setVideoPlayerState] = _react.default.useState({
|
|
120
|
+
const [videoPlayerState, setVideoPlayerState] = React.useState({
|
|
129
121
|
loadedSources: null,
|
|
130
122
|
loadedTracks: null,
|
|
131
123
|
videoLength: 0,
|
|
@@ -152,7 +144,7 @@ const Video = _ref3 => {
|
|
|
152
144
|
const generateSources = videoQuality => {
|
|
153
145
|
return sources.map(source => {
|
|
154
146
|
if (source.qualityRank === videoQuality) {
|
|
155
|
-
return /*#__PURE__*/
|
|
147
|
+
return /*#__PURE__*/React.createElement('source', {
|
|
156
148
|
src: source.source,
|
|
157
149
|
type: source.mediaType,
|
|
158
150
|
key: source.source
|
|
@@ -163,7 +155,7 @@ const Video = _ref3 => {
|
|
|
163
155
|
};
|
|
164
156
|
const generateTracks = () => {
|
|
165
157
|
return tracks.map(track => {
|
|
166
|
-
return /*#__PURE__*/
|
|
158
|
+
return /*#__PURE__*/React.createElement('track', {
|
|
167
159
|
label: track.label,
|
|
168
160
|
kind: track.kind,
|
|
169
161
|
srcLang: track.language,
|
|
@@ -537,11 +529,11 @@ const Video = _ref3 => {
|
|
|
537
529
|
}));
|
|
538
530
|
};
|
|
539
531
|
const toggleFullscreen = () => {
|
|
540
|
-
if (
|
|
541
|
-
if (
|
|
542
|
-
|
|
532
|
+
if (fscreen.fullscreenEnabled) {
|
|
533
|
+
if (fscreen.fullscreenElement === null) {
|
|
534
|
+
fscreen.requestFullscreen(refVideoPlayerContainer.current);
|
|
543
535
|
} else {
|
|
544
|
-
|
|
536
|
+
fscreen.exitFullscreen();
|
|
545
537
|
}
|
|
546
538
|
setVideoPlayerState(prevState => {
|
|
547
539
|
return {
|
|
@@ -577,8 +569,8 @@ const Video = _ref3 => {
|
|
|
577
569
|
|
|
578
570
|
// This allows playing videos within components that act like
|
|
579
571
|
// links, e.g. `PreviewCard`, `StoryCard`, etc.
|
|
580
|
-
event === null || event === void 0
|
|
581
|
-
event === null || event === void 0
|
|
572
|
+
event === null || event === void 0 || event.preventDefault();
|
|
573
|
+
event === null || event === void 0 || event.stopPropagation();
|
|
582
574
|
};
|
|
583
575
|
const handleKeyboard = event => {
|
|
584
576
|
const {
|
|
@@ -678,13 +670,13 @@ const Video = _ref3 => {
|
|
|
678
670
|
};
|
|
679
671
|
|
|
680
672
|
// Prepares video and caption files
|
|
681
|
-
|
|
673
|
+
React.useEffect(() => {
|
|
682
674
|
refreshMedia();
|
|
683
675
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
684
676
|
}, []);
|
|
685
677
|
|
|
686
678
|
// Initial Setup after loading sources
|
|
687
|
-
|
|
679
|
+
React.useEffect(() => {
|
|
688
680
|
const {
|
|
689
681
|
loadedSources,
|
|
690
682
|
loadedTracks
|
|
@@ -735,7 +727,7 @@ const Video = _ref3 => {
|
|
|
735
727
|
|
|
736
728
|
// Video Analytics
|
|
737
729
|
if (analyticsTracking !== undefined && videoTitle === undefined || analyticsTracking === undefined && videoTitle !== undefined) {
|
|
738
|
-
|
|
730
|
+
warn('Video', 'Both the `analyticsTracking` and `videoTitle` props must be defined in order to return a proper analytics object.');
|
|
739
731
|
}
|
|
740
732
|
return () => {
|
|
741
733
|
clearInactivityTimer();
|
|
@@ -774,7 +766,7 @@ const Video = _ref3 => {
|
|
|
774
766
|
as,
|
|
775
767
|
...safeRest
|
|
776
768
|
} = rest;
|
|
777
|
-
return /*#__PURE__*/(
|
|
769
|
+
return /*#__PURE__*/_jsxs(VideoPlayerContainer, {
|
|
778
770
|
...safeRest,
|
|
779
771
|
ref: refVideoPlayerContainer,
|
|
780
772
|
videoBorder: videoBorder,
|
|
@@ -783,17 +775,17 @@ const Video = _ref3 => {
|
|
|
783
775
|
onClick: handleClick,
|
|
784
776
|
onKeyDown: handleKeyboard,
|
|
785
777
|
tabIndex: "0",
|
|
786
|
-
"aria-label": simpleMode ?
|
|
778
|
+
"aria-label": simpleMode ? videoText[copy].videoSelectedSimple : videoText[copy].videoSelected,
|
|
787
779
|
"data-testid": "videoPlayer",
|
|
788
780
|
...selectProps(rest),
|
|
789
|
-
children: [/*#__PURE__*/(
|
|
781
|
+
children: [/*#__PURE__*/_jsxs(VideoOverlayContainer, {
|
|
790
782
|
mouseInactive: mouseInactive,
|
|
791
783
|
onClick: () => {
|
|
792
784
|
closeSubMenus();
|
|
793
785
|
togglePlayPause();
|
|
794
786
|
},
|
|
795
|
-
children: [videoUnplayed && !videoQualityChanged && /*#__PURE__*/(
|
|
796
|
-
children: /*#__PURE__*/(
|
|
787
|
+
children: [videoUnplayed && !videoQualityChanged && /*#__PURE__*/_jsx(VideoSplashContainer, {
|
|
788
|
+
children: /*#__PURE__*/_jsx(VideoSplash, {
|
|
797
789
|
poster: posterSrc,
|
|
798
790
|
copy: copy,
|
|
799
791
|
videoLength: videoLength,
|
|
@@ -801,23 +793,23 @@ const Video = _ref3 => {
|
|
|
801
793
|
iconLeftOffsetPx: 2,
|
|
802
794
|
onClick: beginVideo
|
|
803
795
|
})
|
|
804
|
-
}), /*#__PURE__*/(
|
|
805
|
-
children: [videoEnded && /*#__PURE__*/(
|
|
796
|
+
}), /*#__PURE__*/_jsxs(VideoOverlayElementContainer, {
|
|
797
|
+
children: [videoEnded && /*#__PURE__*/_jsx(MiddleControlButton, {
|
|
806
798
|
icon: replayIcon,
|
|
807
799
|
onClick: replayVideo
|
|
808
|
-
}), !videoUnplayed && !videoIsBuffering && !videoEnded && !isMobile && /*#__PURE__*/(
|
|
800
|
+
}), !videoUnplayed && !videoIsBuffering && !videoEnded && !isMobile && /*#__PURE__*/_jsx(MiddleControlButton, {
|
|
809
801
|
icon: videoIsPlaying ? pauseIcon : playIcon,
|
|
810
802
|
isHidden: mouseInactive,
|
|
811
803
|
onClick: togglePlayPause,
|
|
812
804
|
onFocus: resetInactivityTimer
|
|
813
|
-
}), videoIsBuffering && !isMobile && /*#__PURE__*/(
|
|
805
|
+
}), videoIsBuffering && !isMobile && /*#__PURE__*/_jsx(Spinner, {
|
|
814
806
|
show: true
|
|
815
807
|
})]
|
|
816
808
|
})]
|
|
817
|
-
}), /*#__PURE__*/(
|
|
809
|
+
}), /*#__PURE__*/_jsx(VideoElementContainer, {
|
|
818
810
|
videoIsFullscreen: videoIsFullscreen,
|
|
819
811
|
mouseInactive: mouseInactive,
|
|
820
|
-
children: /*#__PURE__*/(
|
|
812
|
+
children: /*#__PURE__*/_jsxs(VideoPlayer, {
|
|
821
813
|
ref: refVideoPlayer,
|
|
822
814
|
controls: isMobile,
|
|
823
815
|
videoIsFullscreen: videoIsFullscreen,
|
|
@@ -825,7 +817,7 @@ const Video = _ref3 => {
|
|
|
825
817
|
playsinline: true,
|
|
826
818
|
children: [loadedSources, loadedTracks, "Your browser does not support the video tag."]
|
|
827
819
|
})
|
|
828
|
-
}), !simpleMode && /*#__PURE__*/(
|
|
820
|
+
}), !simpleMode && /*#__PURE__*/_jsx(ControlBar, {
|
|
829
821
|
videoPlayer: refVideoPlayer,
|
|
830
822
|
videoPlayerContainer: refVideoPlayerContainer,
|
|
831
823
|
sources: sources,
|
|
@@ -863,10 +855,10 @@ const Video = _ref3 => {
|
|
|
863
855
|
onMouseOut: () => setMouseOnControlBar(false),
|
|
864
856
|
onFocus: () => {},
|
|
865
857
|
onBlur: () => {}
|
|
866
|
-
}), /*#__PURE__*/(
|
|
858
|
+
}), /*#__PURE__*/_jsx("span", {
|
|
867
859
|
tabIndex: "-1",
|
|
868
860
|
ref: refKeyboardInstructions,
|
|
869
|
-
"aria-label":
|
|
861
|
+
"aria-label": videoText[copy].videoPlayer,
|
|
870
862
|
role: "note"
|
|
871
863
|
})]
|
|
872
864
|
});
|
|
@@ -876,71 +868,71 @@ Video.propTypes = {
|
|
|
876
868
|
/**
|
|
877
869
|
* An array of objects that defines each video file. See the "Basic Usage" section for more information.
|
|
878
870
|
*/
|
|
879
|
-
sources:
|
|
871
|
+
sources: PropTypes.arrayOf(PropTypes.shape({
|
|
880
872
|
/** A path to a video file */
|
|
881
|
-
source:
|
|
873
|
+
source: PropTypes.string.isRequired,
|
|
882
874
|
/** The video's MIME type (example: `video/mp4`) */
|
|
883
|
-
mediaType:
|
|
875
|
+
mediaType: PropTypes.string.isRequired,
|
|
884
876
|
/** The label to be given to this file in the quality selector (example: `1080p`) */
|
|
885
|
-
qualityName:
|
|
877
|
+
qualityName: PropTypes.string.isRequired,
|
|
886
878
|
/** A number indicating the video's quality, with 1 being the best, and the number increasing from there as quality degrades */
|
|
887
|
-
qualityRank:
|
|
879
|
+
qualityRank: PropTypes.number.isRequired,
|
|
888
880
|
/** A boolean that defines its source as a fallback for another source with the same `qualityRank` */
|
|
889
|
-
isFallback:
|
|
881
|
+
isFallback: PropTypes.bool
|
|
890
882
|
})).isRequired,
|
|
891
883
|
/**
|
|
892
884
|
* A path of the image that will be displayed on the video's splash screen.
|
|
893
885
|
*/
|
|
894
|
-
posterSrc:
|
|
886
|
+
posterSrc: PropTypes.string.isRequired,
|
|
895
887
|
/**
|
|
896
888
|
* An array of objects that defines each caption file. See the "Basic Usage" section for more information.
|
|
897
889
|
*/
|
|
898
|
-
tracks:
|
|
890
|
+
tracks: PropTypes.arrayOf(PropTypes.shape({
|
|
899
891
|
/** A path to the track file */
|
|
900
|
-
source:
|
|
892
|
+
source: PropTypes.string.isRequired,
|
|
901
893
|
/** The name of the track file as it will appear in the "Captions" dialogue */
|
|
902
|
-
label:
|
|
894
|
+
label: PropTypes.string.isRequired,
|
|
903
895
|
/** The track's file type, typically one of "subtitles", "captions", or "descriptions". See [MDN's documentation](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/track#Attributes) for more information on these types */
|
|
904
|
-
kind:
|
|
896
|
+
kind: PropTypes.string.isRequired,
|
|
905
897
|
/** The language of the track file represented as a ISO 639-1 language code */
|
|
906
|
-
language:
|
|
898
|
+
language: PropTypes.string.isRequired
|
|
907
899
|
})),
|
|
908
900
|
/**
|
|
909
901
|
* The video's default volume, defined from 1 to 100. Please use the `beginMuted` prop to have the video start silenced.
|
|
910
902
|
*/
|
|
911
|
-
defaultVolume:
|
|
903
|
+
defaultVolume: PropTypes.number,
|
|
912
904
|
/**
|
|
913
905
|
* Defines if the video should start muted.
|
|
914
906
|
*/
|
|
915
|
-
beginMuted:
|
|
907
|
+
beginMuted: PropTypes.bool,
|
|
916
908
|
/**
|
|
917
909
|
* The default quality level if the user is on mobile. See the `sources` prop for available quality levels.
|
|
918
910
|
*/
|
|
919
|
-
defaultMobileQuality:
|
|
911
|
+
defaultMobileQuality: PropTypes.number,
|
|
920
912
|
/**
|
|
921
913
|
* The default quality level if the user is on desktop. See the `sources` prop for available quality levels.
|
|
922
914
|
*/
|
|
923
|
-
defaultDesktopQuality:
|
|
915
|
+
defaultDesktopQuality: PropTypes.number,
|
|
924
916
|
/**
|
|
925
917
|
* The video player UI's language as an ISO language code. It currently supports English and French.
|
|
926
918
|
*/
|
|
927
|
-
copy:
|
|
919
|
+
copy: PropTypes.oneOf(['en', 'fr']).isRequired,
|
|
928
920
|
/**
|
|
929
921
|
* Sets the `video` tag's `crossorigin` mode. Please note that content loaded without CORS approval may be insecure.
|
|
930
922
|
* @since 1.1.0
|
|
931
923
|
*/
|
|
932
|
-
crossOrigin:
|
|
924
|
+
crossOrigin: PropTypes.oneOf(['anonymous', 'use-credentials']),
|
|
933
925
|
/**
|
|
934
926
|
* Disables the control bar during playback and reduces the amount of time until the UI hides itself.
|
|
935
927
|
* For special approved internal uses only.
|
|
936
928
|
* @since 1.2.0
|
|
937
929
|
*/
|
|
938
|
-
simpleMode:
|
|
930
|
+
simpleMode: PropTypes.bool,
|
|
939
931
|
/**
|
|
940
932
|
* Renders a gainsboro coloured border around the video. Used to seperate the video from the rest of the page if the video's background is the same colour as the container's.
|
|
941
933
|
* @since 1.2.0
|
|
942
934
|
*/
|
|
943
|
-
videoBorder:
|
|
935
|
+
videoBorder: PropTypes.bool,
|
|
944
936
|
/**
|
|
945
937
|
* A callback function that fires when a customer interacts with Video.
|
|
946
938
|
* When using `analyticsTracking`, `videoTitle` must also be defined.
|
|
@@ -953,14 +945,13 @@ Video.propTypes = {
|
|
|
953
945
|
* @param {string} analyticsObject.action Contains the latest customer action
|
|
954
946
|
* @param {string} analyticsObject.details The name of the video based on the `videoTitle` prop
|
|
955
947
|
*/
|
|
956
|
-
analyticsTracking:
|
|
948
|
+
analyticsTracking: PropTypes.func,
|
|
957
949
|
/**
|
|
958
950
|
* The title of the video being rendered. This is used for analytics purposes in conjunction with `analyticsTracking`.
|
|
959
951
|
* @since 1.3.0
|
|
960
952
|
*/
|
|
961
|
-
videoTitle:
|
|
962
|
-
tokens:
|
|
963
|
-
variant:
|
|
953
|
+
videoTitle: PropTypes.string,
|
|
954
|
+
tokens: getTokensPropType('Video'),
|
|
955
|
+
variant: variantProp.propType
|
|
964
956
|
};
|
|
965
|
-
|
|
966
|
-
exports.default = _default;
|
|
957
|
+
export default Video;
|
package/lib/Video/index.js
CHANGED
|
@@ -1,10 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
var _Video = _interopRequireDefault(require("./Video"));
|
|
8
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
9
|
-
var _default = _Video.default;
|
|
10
|
-
exports.default = _default;
|
|
1
|
+
import Video from './Video';
|
|
2
|
+
export default Video;
|
package/lib/Video/videoText.js
CHANGED
|
@@ -1,9 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
1
|
const videoText = {
|
|
8
2
|
en: {
|
|
9
3
|
videoPlayer: 'Press the space bar or K to toggle play and pause. Use the left and right arrow keys or the comma and period keys to scrub through the video. Use the up and down arrow keys, the dash and equal keys, or the add and subtract number pad keys to increase and decrease volume. Press M to toggle mute. Press F to toggle fullscreen. Press escape to exit instructions and return to video.',
|
|
@@ -58,5 +52,4 @@ const videoText = {
|
|
|
58
52
|
fr: 'Français'
|
|
59
53
|
}
|
|
60
54
|
};
|
|
61
|
-
|
|
62
|
-
exports.default = _default;
|
|
55
|
+
export default videoText;
|