@ebay/ui-core-react 5.4.2 → 5.4.4

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.
@@ -1 +1 @@
1
- {"version":3,"file":"listbox-button.d.ts","sourceRoot":"","sources":["../../src/ebay-listbox-button/listbox-button.tsx"],"names":[],"mappings":"AAAA,OAAc,EAEV,cAAc,EAAE,EAAE,EACrB,MAAM,OAAO,CAAA;AAGd,OAAO,EAAE,sBAAsB,EAAO,MAAM,6BAA6B,CAAA;AAIzE,oBAAY,gBAAgB,GAAG;IAC3B,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,UAAU,EAAE,OAAO,CAAC;CACvB,CAAA;AAED,oBAAY,sBAAsB,GAAG,IAAI,CAAC,cAAc,CAAC,OAAO,CAAC,EAAE,UAAU,CAAC,GAAG;IAC7E,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,EAAE,sBAAsB,CAAC,iBAAiB,EAAE,gBAAgB,CAAC,CAAC;IACvE,UAAU,CAAC,EAAE,MAAM,IAAI,CAAC;IACxB,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;CACzB,CAAA;AAED,QAAA,MAAM,aAAa,EAAE,EAAE,CAAC,sBAAsB,CA2R7C,CAAA;AAED,eAAe,aAAa,CAAA"}
1
+ {"version":3,"file":"listbox-button.d.ts","sourceRoot":"","sources":["../../src/ebay-listbox-button/listbox-button.tsx"],"names":[],"mappings":"AAAA,OAAc,EAEV,cAAc,EAAE,EAAE,EACrB,MAAM,OAAO,CAAA;AAGd,OAAO,EAAE,sBAAsB,EAAO,MAAM,6BAA6B,CAAA;AAIzE,oBAAY,gBAAgB,GAAG;IAC3B,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,UAAU,EAAE,OAAO,CAAC;CACvB,CAAA;AAED,oBAAY,sBAAsB,GAAG,IAAI,CAAC,cAAc,CAAC,OAAO,CAAC,EAAE,UAAU,CAAC,GAAG;IAC7E,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,EAAE,sBAAsB,CAAC,iBAAiB,EAAE,gBAAgB,CAAC,CAAC;IACvE,UAAU,CAAC,EAAE,MAAM,IAAI,CAAC;IACxB,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;CACzB,CAAA;AAED,QAAA,MAAM,aAAa,EAAE,EAAE,CAAC,sBAAsB,CA8R7C,CAAA;AAED,eAAe,aAAa,CAAA"}
@@ -85,10 +85,16 @@ var ListboxButton = function (_a) {
85
85
  }, [value]);
86
86
  var childrenArray = react_1.Children.toArray(children);
87
87
  var getSelectedValueByIndex = function (index) { return childrenArray[index].props.value; };
88
+ var getIndexByValue = react_1.useCallback(function (selectedValue) {
89
+ return childrenArray.findIndex(function (_a) {
90
+ var props = _a.props;
91
+ return props.value === selectedValue;
92
+ });
93
+ }, [childrenArray]);
88
94
  var getSelectedOption = function (currentIndex) { return optionsByIndexRef.current.get(currentIndex); };
89
95
  var setActiveDescendant = function (index) {
90
96
  var optionsContainerEle = optionsContainerRef.current;
91
- optionsContainerEle.setAttribute("aria-activedescendant", getSelectedOption(index).id);
97
+ optionsContainerEle === null || optionsContainerEle === void 0 ? void 0 : optionsContainerEle.setAttribute("aria-activedescendant", getSelectedOption(index).id);
92
98
  };
93
99
  var collapseListbox = function () {
94
100
  setExpanded(false);
@@ -106,7 +112,7 @@ var ListboxButton = function (_a) {
106
112
  expandListbox();
107
113
  }
108
114
  };
109
- var onOptionsSelect = function (e, optionValue, index) {
115
+ var onOptionsSelect = function (e, index) {
110
116
  // OnSelect set the selectedValue to the state and expanded to false to close the list box
111
117
  setSelectedOption(childrenArray[index]);
112
118
  setSelectedIndex(index);
@@ -215,14 +221,14 @@ var ListboxButton = function (_a) {
215
221
  break;
216
222
  }
217
223
  };
218
- // We want to minic the select box behavior so we take the onSelect that passed
219
- // at the parent level and use it for the OnClick on the list box since its a fake dropdown
220
- var updatelistBoxButtonOptions = listBoxButtonOptions
224
+ // We want to mimic the select box behavior, so we take the onSelect that passed
225
+ // at the parent level and use it for the OnClick on the list box since it is a fake dropdown
226
+ var updateListBoxButtonOptions = listBoxButtonOptions
221
227
  .map(function (child, index) { return react_1.cloneElement(child, {
222
228
  index: index,
223
229
  key: index,
224
230
  selected: selectedOption && child.props.value === selectedOption.props.value,
225
- onClick: function (e, optionValue) { return onOptionsSelect(e, optionValue, index); },
231
+ onClick: function (e) { return onOptionsSelect(e, index); },
226
232
  innerRef: function (optionNode) { return !optionNode
227
233
  ? optionsByIndexRef.current.delete(index)
228
234
  : optionsByIndexRef.current.set(index, optionNode); }
@@ -255,8 +261,8 @@ var ListboxButton = function (_a) {
255
261
  }, onBlur: function () {
256
262
  collapseListbox();
257
263
  setTimeout(function () { return buttonRef.current.focus(); }, 0);
258
- } }, updatelistBoxButtonOptions)),
259
- react_1.default.createElement("select", { hidden: true, className: "listbox-button__native", name: name, value: selectedOption ? selectedOption === null || selectedOption === void 0 ? void 0 : selectedOption.props.value : '' }, updatelistBoxButtonOptions.map(function (option, i) {
264
+ } }, updateListBoxButtonOptions)),
265
+ react_1.default.createElement("select", { hidden: true, className: "listbox-button__native", name: name, onChange: function (e) { return onOptionsSelect(e, getIndexByValue(e.target.value)); }, value: selectedOption ? selectedOption === null || selectedOption === void 0 ? void 0 : selectedOption.props.value : '' }, updateListBoxButtonOptions.map(function (option, i) {
260
266
  return react_1.default.createElement("option", { value: option.props.value, key: i });
261
267
  }))));
262
268
  };
@@ -68,7 +68,7 @@ var EbayTourtip = function (_a) {
68
68
  var heading = component_utils_1.findComponent(children, ebay_tourtip_heading_1.default);
69
69
  var footer = component_utils_1.findComponent(children, ebay_tourtip_footer_1.default);
70
70
  return (react_1.default.createElement(tooltip_utils_1.Tooltip, __assign({}, rest, { className: className, type: "tourtip", isExpanded: isExpanded, ref: containerRef }),
71
- react_1.default.createElement(tooltip_utils_1.TooltipHost, __assign({}, host.props, { forwardedRef: hostRef, ariaLabel: ariaLabel, ariaExpanded: isExpanded })),
71
+ react_1.default.createElement(tooltip_utils_1.TooltipHost, __assign({}, host.props, { forwardedRef: hostRef, "aria-label": ariaLabel, "aria-expanded": isExpanded })),
72
72
  react_1.default.createElement(tooltip_utils_1.TooltipContent, __assign({}, contentProps, { a11yCloseText: a11yCloseText, onClose: collapseTooltip, pointer: pointer, showCloseButton: true, style: overlayStyle, type: "tourtip" }),
73
73
  heading,
74
74
  contentChildren,
@@ -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,MAAA;CAAE,CA0B9D"}
1
+ {"version":3,"file":"controls.d.ts","sourceRoot":"","sources":["../../src/ebay-video/controls.tsx"],"names":[],"mappings":"AAOA,wBAAgB,cAAc,CAAC,QAAQ,aAAW,GAAG;IAAE,MAAM,MAAA;CAAE,CA2B9D"}
@@ -19,11 +19,14 @@ Object.defineProperty(exports, "__esModule", { value: true });
19
19
  exports.customControls = void 0;
20
20
  var react_1 = __importDefault(require("react"));
21
21
  var react_dom_1 = __importDefault(require("react-dom"));
22
+ // need that for broken definitions workaround
23
+ // @ts-ignore
22
24
  var shaka_player_ui_1 = require("shaka-player/dist/shaka-player.ui");
23
25
  var reportButton_1 = require("./reportButton");
24
26
  function customControls(onReport) {
25
27
  if (onReport === void 0) { onReport = function () { }; }
26
28
  // Have to contain in order to not execute until shaka is downloaded
29
+ // eslint-disable-next-line no-extra-parens
27
30
  var Report = /** @class */ (function (_super) {
28
31
  __extends(class_1, _super);
29
32
  function class_1(parent, controls, text) {
@@ -5,4 +5,5 @@ export declare type VideoSource = {
5
5
  src: string;
6
6
  type?: VideoSourceType;
7
7
  };
8
+ export declare type Player = Record<string, any>;
8
9
  //# sourceMappingURL=types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/ebay-video/types.ts"],"names":[],"mappings":"AAAA,oBAAY,WAAW,GAAG,MAAM,GAAG,OAAO,CAAA;AAC1C,oBAAY,aAAa,GAAG,QAAQ,GAAG,YAAY,CAAA;AAEnD,oBAAY,eAAe,GAAG,MAAM,GAAG,KAAK,CAAA;AAC5C,oBAAY,WAAW,GAAG;IACtB,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,CAAC,EAAE,eAAe,CAAA;CACzB,CAAA"}
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/ebay-video/types.ts"],"names":[],"mappings":"AAAA,oBAAY,WAAW,GAAG,MAAM,GAAG,OAAO,CAAA;AAC1C,oBAAY,aAAa,GAAG,QAAQ,GAAG,YAAY,CAAA;AAEnD,oBAAY,eAAe,GAAG,MAAM,GAAG,KAAK,CAAA;AAC5C,oBAAY,WAAW,GAAG;IACtB,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,CAAC,EAAE,eAAe,CAAA;CACzB,CAAA;AAED,oBAAY,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA"}
@@ -1,5 +1,5 @@
1
1
  import { ComponentProps, FC, MouseEvent } from 'react';
2
- import { VideoAction, VideoPlayView } from './types';
2
+ import { Player, VideoAction, VideoPlayView } from './types';
3
3
  import { EbayEventHandler } from '../common/event-utils/types';
4
4
  export declare type PlayEventProps = {
5
5
  player: Player;
@@ -1 +1 @@
1
- {"version":3,"file":"video.d.ts","sourceRoot":"","sources":["../../src/ebay-video/video.tsx"],"names":[],"mappings":"AAAA,OAAc,EAAE,cAAc,EAAE,EAAE,EAAkB,UAAU,EAA+B,MAAM,OAAO,CAAA;AAO1G,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,SAAS,CAAA;AAIpD,OAAO,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAA;AAE9D,oBAAY,cAAc,GAAG;IACzB,MAAM,EAAE,MAAM,CAAC;CAClB,CAAA;AACD,oBAAY,iBAAiB,GAAG;IAC5B,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,OAAO,CAAC;CAClB,CAAA;AACD,oBAAY,cAAc,GAAG,IAAI,CAAC,cAAc,CAAC,OAAO,CAAC,EAAE,QAAQ,GAAG,gBAAgB,CAAC,GAAG;IACtF,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,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Y,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,gBAAgB,CAAC,gBAAgB,EAAE,cAAc,CAAC,CAAC;IAC5D,cAAc,CAAC,EAAE,gBAAgB,CAAC,gBAAgB,EAAE,iBAAiB,CAAC,CAAC;IACvE,QAAQ,CAAC,EAAE,CAAC,KAAK,CAAC,EAAE,UAAU,CAAC,iBAAiB,CAAC,KAAK,IAAI,CAAC;CAC9D,CAAC;AAEF,QAAA,MAAM,SAAS,EAAE,EAAE,CAAC,cAAc,CAqOjC,CAAA;AAgBD,eAAe,SAAS,CAAA"}
@@ -53,6 +53,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
53
53
  Object.defineProperty(exports, "__esModule", { value: true });
54
54
  var react_1 = __importStar(require("react"));
55
55
  var classnames_1 = __importDefault(require("classnames"));
56
+ // need that for broken definitions workaround
57
+ // @ts-ignore
56
58
  var shaka_player_ui_1 = __importDefault(require("shaka-player/dist/shaka-player.ui"));
57
59
  var component_utils_1 = require("../common/component-utils");
58
60
  var ebay_icon_1 = require("../ebay-icon");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ebay/ui-core-react",
3
- "version": "5.4.2",
3
+ "version": "5.4.4",
4
4
  "description": "Skin components build off React",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org"