@ebay/ui-core-react 3.12.1 → 3.12.3
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/ebay-listbox-button/listbox-button.js +1 -1
- package/ebay-video/README.md +1 -0
- package/ebay-video/const.d.ts +0 -1
- package/ebay-video/const.d.ts.map +1 -1
- package/ebay-video/const.js +4 -6
- package/ebay-video/controls.d.ts +0 -1
- package/ebay-video/controls.d.ts.map +1 -1
- package/ebay-video/controls.js +2 -13
- package/ebay-video/video.d.ts +4 -4
- package/ebay-video/video.d.ts.map +1 -1
- package/ebay-video/video.js +13 -9
- package/package.json +1 -1
|
@@ -221,7 +221,7 @@ var ListboxButton = function (_a) {
|
|
|
221
221
|
react_1.default.createElement(ebay_icon_1.EbayIcon, { name: "dropdown" }))),
|
|
222
222
|
(expanded || optionsOpened) &&
|
|
223
223
|
react_1.default.createElement("div", { className: "listbox-button__listbox", ref: optionsParentContainerRef, style: { maxHeight: maxHeight } },
|
|
224
|
-
react_1.default.createElement("div", { className: "listbox-button__options", role: "listbox", tabIndex: 0, ref: optionsContainerRef, onKeyDown: function (e) { return onOptionContainerKeydown(e); },
|
|
224
|
+
react_1.default.createElement("div", { className: "listbox-button__options", role: "listbox", tabIndex: expanded ? 0 : -1, ref: optionsContainerRef, onKeyDown: function (e) { return onOptionContainerKeydown(e); },
|
|
225
225
|
// adding onMouseDown preventDefault b/c on IE the onClick event is not being fired on each
|
|
226
226
|
// option https://stackoverflow.com/questions/17769005/onclick-and-onblur-ordering-issue
|
|
227
227
|
onMouseDown: function (e) { return e.preventDefault(); }, onBlur: function () {
|
package/ebay-video/README.md
CHANGED
package/ebay-video/const.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"const.d.ts","sourceRoot":"","sources":["../../src/ebay-video/const.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"const.d.ts","sourceRoot":"","sources":["../../src/ebay-video/const.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,kBAAkB,OAAO,CAAA;AACtC,eAAO,MAAM,eAAe,KAAK,CAAA;AACjC,eAAO,MAAM,kBAAkB;;;;CAa9B,CAAA"}
|
package/ebay-video/const.js
CHANGED
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.defaultVideoConfig = exports.ERROR_NO_PLAYER = exports.ERROR_ANOTHER_LOAD = void 0;
|
|
4
|
-
// const MAX_RETRIES = 3
|
|
5
|
-
// const DEFAULT_SPINNER_TIMEOUT = 2000
|
|
6
4
|
exports.ERROR_ANOTHER_LOAD = 7000;
|
|
7
5
|
exports.ERROR_NO_PLAYER = 11;
|
|
8
6
|
exports.defaultVideoConfig = {
|
|
@@ -14,8 +12,8 @@ exports.defaultVideoConfig = {
|
|
|
14
12
|
'spacer',
|
|
15
13
|
'mute',
|
|
16
14
|
'report',
|
|
17
|
-
'
|
|
18
|
-
'
|
|
19
|
-
|
|
20
|
-
|
|
15
|
+
'captions',
|
|
16
|
+
// 'quality', // uncomment this to show a gear icon for video quality control
|
|
17
|
+
'fullscreen'
|
|
18
|
+
]
|
|
21
19
|
};
|
package/ebay-video/controls.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"controls.d.ts","sourceRoot":"","sources":["../../src/ebay-video/controls.tsx"],"names":[],"mappings":"AAKA,wBAAgB,cAAc,CAAC,QAAQ,aAAW,GAAG;IAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"controls.d.ts","sourceRoot":"","sources":["../../src/ebay-video/controls.tsx"],"names":[],"mappings":"AAKA,wBAAgB,cAAc,CAAC,QAAQ,aAAW,GAAG;IAAE,MAAM,MAAA;CAAE,CAuB9D"}
|
package/ebay-video/controls.js
CHANGED
|
@@ -28,7 +28,7 @@ function customControls(onReport) {
|
|
|
28
28
|
__extends(class_1, _super);
|
|
29
29
|
function class_1(parent, controls, text) {
|
|
30
30
|
var _this = _super.call(this, parent, controls) || this;
|
|
31
|
-
appendChild(
|
|
31
|
+
appendChild(parent, react_1.default.createElement(reportButton_1.ReportButton, { onReport: onReport }, text));
|
|
32
32
|
return _this;
|
|
33
33
|
}
|
|
34
34
|
return class_1;
|
|
@@ -42,18 +42,7 @@ function customControls(onReport) {
|
|
|
42
42
|
};
|
|
43
43
|
return class_2;
|
|
44
44
|
}());
|
|
45
|
-
|
|
46
|
-
TextSelection.Factory = /** @class */ (function () {
|
|
47
|
-
function Factory() {
|
|
48
|
-
}
|
|
49
|
-
/** @override */
|
|
50
|
-
// eslint-disable-next-line class-methods-use-this
|
|
51
|
-
Factory.prototype.create = function (rootElement, controls) {
|
|
52
|
-
return new shaka_player_ui_1.ui.TextSelection(rootElement, controls);
|
|
53
|
-
};
|
|
54
|
-
return Factory;
|
|
55
|
-
}());
|
|
56
|
-
return { Report: Report, TextSelection: TextSelection };
|
|
45
|
+
return { Report: Report };
|
|
57
46
|
}
|
|
58
47
|
exports.customControls = customControls;
|
|
59
48
|
function appendChild(container, reactElement) {
|
package/ebay-video/video.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { ComponentProps, FC, SyntheticEvent } from 'react';
|
|
2
|
-
import 'shaka-player/dist/controls.css';
|
|
3
2
|
import { VideoAction, VideoPlayView } from './types';
|
|
4
3
|
export declare type EbayVideoProps = ComponentProps<'video'> & {
|
|
5
4
|
width?: number;
|
|
@@ -9,6 +8,7 @@ export declare type EbayVideoProps = ComponentProps<'video'> & {
|
|
|
9
8
|
volume?: number;
|
|
10
9
|
muted?: boolean;
|
|
11
10
|
volumeSlider?: boolean;
|
|
11
|
+
hideReportButton?: boolean;
|
|
12
12
|
playView?: VideoPlayView;
|
|
13
13
|
cdnUrl?: string;
|
|
14
14
|
cssUrl?: string;
|
|
@@ -16,9 +16,9 @@ export declare type EbayVideoProps = ComponentProps<'video'> & {
|
|
|
16
16
|
a11yLoadText: string;
|
|
17
17
|
a11yPlayText: string;
|
|
18
18
|
errorText: string;
|
|
19
|
-
reportText
|
|
20
|
-
onLoadError?: (err:
|
|
21
|
-
onPlay?: (e: SyntheticEvent, { player:
|
|
19
|
+
reportText?: string;
|
|
20
|
+
onLoadError?: (err: Error) => void;
|
|
21
|
+
onPlay?: (e: SyntheticEvent, { player: Player }: {
|
|
22
22
|
player: any;
|
|
23
23
|
}) => void;
|
|
24
24
|
onVolumeChange?: (e: SyntheticEvent, { volume: number, muted: boolean }: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"video.d.ts","sourceRoot":"","sources":["../../src/ebay-video/video.tsx"],"names":[],"mappings":"AAAA,OAAc,EAAE,cAAc,EAAE,EAAE,EAAE,cAAc,EAA+B,MAAM,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"video.d.ts","sourceRoot":"","sources":["../../src/ebay-video/video.tsx"],"names":[],"mappings":"AAAA,OAAc,EAAE,cAAc,EAAE,EAAE,EAAE,cAAc,EAA+B,MAAM,OAAO,CAAA;AAM9F,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,SAAS,CAAA;AAKpD,oBAAY,cAAc,GAAG,cAAc,CAAC,OAAO,CAAC,GAAG;IACnD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,QAAQ,CAAC,EAAE,aAAa,CAAC;IAEzB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB,YAAY,EAAE,MAAM,CAAC;IACrB,YAAY,EAAE,MAAM,CAAC;IACrB,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,WAAW,CAAC,EAAE,CAAC,GAAG,EAAE,KAAK,KAAK,IAAI,CAAC;IACnC,MAAM,CAAC,EAAE,CAAC,CAAC,EAAE,cAAc,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE;;KAAA,KAAK,IAAI,CAAC;IACzD,cAAc,CAAC,EAAE,CAAC,CAAC,EAAE,cAAc,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE;;;KAAA,KAAK,IAAI,CAAC;IACjF,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;CACzB,CAAC;AAEF,QAAA,MAAM,SAAS,EAAE,EAAE,CAAC,cAAc,CAkOjC,CAAA;AAgBD,eAAe,SAAS,CAAA"}
|
package/ebay-video/video.js
CHANGED
|
@@ -54,18 +54,17 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
54
54
|
var react_1 = __importStar(require("react"));
|
|
55
55
|
var classnames_1 = __importDefault(require("classnames"));
|
|
56
56
|
var shaka_player_ui_1 = __importDefault(require("shaka-player/dist/shaka-player.ui"));
|
|
57
|
-
require("shaka-player/dist/controls.css");
|
|
58
57
|
var component_utils_1 = require("../common/component-utils");
|
|
59
58
|
var index_1 = require("../index");
|
|
60
59
|
var source_1 = __importDefault(require("./source"));
|
|
61
60
|
var const_1 = require("./const");
|
|
62
61
|
var controls_1 = require("./controls");
|
|
63
62
|
var EbayVideo = function (_a) {
|
|
64
|
-
var width = _a.width, height = _a.height, thumbnail = _a.thumbnail, action = _a.action, muted = _a.muted, _b = _a.playView, playView = _b === void 0 ? 'inline' : _b, a11yLoadText = _a.a11yLoadText, a11yPlayText = _a.a11yPlayText, reportText = _a.reportText, volumeSlider = _a.volumeSlider, _c = _a.volume, volume = _c === void 0 ? 1 : _c, errorText = _a.errorText, _d = _a.onVolumeChange, onVolumeChange = _d === void 0 ? function () {
|
|
63
|
+
var width = _a.width, height = _a.height, thumbnail = _a.thumbnail, action = _a.action, muted = _a.muted, _b = _a.playView, playView = _b === void 0 ? 'inline' : _b, a11yLoadText = _a.a11yLoadText, a11yPlayText = _a.a11yPlayText, reportText = _a.reportText, volumeSlider = _a.volumeSlider, _c = _a.volume, volume = _c === void 0 ? 1 : _c, hideReportButton = _a.hideReportButton, errorText = _a.errorText, _d = _a.onVolumeChange, onVolumeChange = _d === void 0 ? function () {
|
|
65
64
|
} : _d, _e = _a.onLoadError, onLoadError = _e === void 0 ? function () {
|
|
66
65
|
} : _e, _f = _a.onPlay, onPlay = _f === void 0 ? function () {
|
|
67
66
|
} : _f, _g = _a.onReport, onReport = _g === void 0 ? function () {
|
|
68
|
-
} : _g, children = _a.children, rest = __rest(_a, ["width", "height", "thumbnail", "action", "muted", "playView", "a11yLoadText", "a11yPlayText", "reportText", "volumeSlider", "volume", "errorText", "onVolumeChange", "onLoadError", "onPlay", "onReport", "children"]);
|
|
67
|
+
} : _g, children = _a.children, rest = __rest(_a, ["width", "height", "thumbnail", "action", "muted", "playView", "a11yLoadText", "a11yPlayText", "reportText", "volumeSlider", "volume", "hideReportButton", "errorText", "onVolumeChange", "onLoadError", "onPlay", "onReport", "children"]);
|
|
69
68
|
var _h = react_1.useState(), loaded = _h[0], setLoaded = _h[1];
|
|
70
69
|
var _j = react_1.useState(), buffering = _j[0], setBuffering = _j[1];
|
|
71
70
|
var _k = react_1.useState(), playing = _k[0], setPlaying = _k[1];
|
|
@@ -137,9 +136,10 @@ var EbayVideo = function (_a) {
|
|
|
137
136
|
controlPanelElements: [],
|
|
138
137
|
addSeekBar: false
|
|
139
138
|
});
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
139
|
+
if (!hideReportButton) {
|
|
140
|
+
var Report = controls_1.customControls(onReport).Report;
|
|
141
|
+
shaka_player_ui_1.default.ui.Controls.registerElement('report', new Report.Factory(reportText));
|
|
142
|
+
}
|
|
143
143
|
loadSource();
|
|
144
144
|
hideSpinner(container);
|
|
145
145
|
// return () => {
|
|
@@ -188,14 +188,18 @@ var EbayVideo = function (_a) {
|
|
|
188
188
|
// This forces the controls to always hide
|
|
189
189
|
videoRef.current.controls = false;
|
|
190
190
|
};
|
|
191
|
-
|
|
191
|
+
var style = {
|
|
192
|
+
width: width ? width + "px" : undefined,
|
|
193
|
+
height: height ? height + "px" : undefined
|
|
194
|
+
};
|
|
195
|
+
return (react_1.default.createElement("div", { style: style, className: classnames_1.default('video-player', { 'video-player--poster': !playing }) },
|
|
192
196
|
!playing && loaded && !failed && !buffering &&
|
|
193
197
|
react_1.default.createElement("div", { className: "shaka-play-button-container" },
|
|
194
198
|
react_1.default.createElement("button", { onClick: handleOnPlayClick, className: "shaka-play-button", style: { opacity: 1, zIndex: 999 }, "aria-label": a11yPlayText },
|
|
195
199
|
react_1.default.createElement(index_1.EbayIcon, { name: "videoPlay" }))),
|
|
196
200
|
react_1.default.createElement("div", { className: "video-player__container", ref: containerRef },
|
|
197
|
-
react_1.default.createElement("video", __assign({ ref: videoRef, style:
|
|
198
|
-
react_1.default.createElement("source", __assign({}, source));
|
|
201
|
+
react_1.default.createElement("video", __assign({ ref: videoRef, style: style, poster: thumbnail, muted: muted || false, onPlaying: handlePlaying, onPause: handleOnPause, onVolumeChange: handleVolumeChange }, rest), sources.map(function (source, i) {
|
|
202
|
+
react_1.default.createElement("source", __assign({ key: i }, source));
|
|
199
203
|
}))),
|
|
200
204
|
react_1.default.createElement("div", { className: classnames_1.default('video-player__overlay', { 'video-player__overlay--hidden': !failed }) },
|
|
201
205
|
react_1.default.createElement(index_1.EbayIcon, { name: "attention" }),
|