@enact/ui 4.6.2 → 4.7.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.
Files changed (81) hide show
  1. package/AnnounceDecorator/Announce.js +27 -17
  2. package/AnnounceDecorator/AnnounceDecorator.js +14 -7
  3. package/AnnounceDecorator/useAnnounce.js +1 -2
  4. package/BodyText/BodyText.js +14 -8
  5. package/Button/Button.js +16 -10
  6. package/CHANGELOG.md +10 -0
  7. package/Cancelable/Cancelable.js +13 -7
  8. package/Changeable/Changeable.js +11 -7
  9. package/ComponentOverride/ComponentOverride.js +18 -7
  10. package/FloatingLayer/FloatingLayer.js +10 -11
  11. package/FloatingLayer/FloatingLayerDecorator.js +9 -6
  12. package/ForwardRef/ForwardRef.js +11 -7
  13. package/GridListImageItem/GridListImageItem.js +16 -9
  14. package/Group/Group.js +17 -8
  15. package/Group/GroupItem.js +14 -10
  16. package/Heading/Heading.js +20 -9
  17. package/Icon/Icon.js +15 -8
  18. package/IconButton/IconButton.js +22 -9
  19. package/Image/Image.js +16 -8
  20. package/ImageItem/ImageItem.js +9 -1
  21. package/Item/Item.js +17 -9
  22. package/LabeledIcon/LabeledIcon.js +16 -8
  23. package/Layout/Cell.js +27 -4
  24. package/Layout/Layout.d.ts +22 -5
  25. package/Layout/Layout.js +154 -32
  26. package/Layout/Layout.module.css +8 -0
  27. package/Layout/tests/Layout-specs.js +39 -0
  28. package/Marquee/MarqueeController.js +50 -0
  29. package/Marquee/MarqueeDecorator.js +40 -2
  30. package/Measurable/Measurable.js +11 -7
  31. package/Media/Media.js +30 -23
  32. package/Placeholder/PlaceholderControllerDecorator.js +9 -8
  33. package/Placeholder/PlaceholderDecorator.js +7 -8
  34. package/ProgressBar/ProgressBar.js +12 -1
  35. package/RadioDecorator/RadioDecorator.js +13 -7
  36. package/Repeater/Repeater.js +14 -10
  37. package/Resizable/Resizable.js +12 -8
  38. package/Routable/Link.js +8 -8
  39. package/Routable/Routable.js +15 -8
  40. package/Routable/Router.js +10 -10
  41. package/Scrollable/ScrollThumb.js +8 -9
  42. package/Scrollable/Scrollable.js +23 -1
  43. package/Scrollable/ScrollableNative.js +12 -0
  44. package/Scroller/Scroller.js +8 -1
  45. package/Scroller/ScrollerBasic.js +8 -9
  46. package/Scroller/UiScrollerBase.js +11 -12
  47. package/Skinnable/Skinnable.js +19 -7
  48. package/Skinnable/useSkins.js +1 -2
  49. package/Slider/Knob.js +8 -8
  50. package/Slider/Slider.js +16 -9
  51. package/SlotItem/SlotItem.js +20 -8
  52. package/Slottable/Slottable.js +14 -8
  53. package/Spinner/Spinner.js +24 -9
  54. package/ToggleIcon/ToggleIcon.js +21 -9
  55. package/ToggleItem/ToggleItem.js +14 -1
  56. package/Toggleable/Toggleable.js +11 -7
  57. package/Toggleable/useToggle.js +0 -1
  58. package/Touchable/Drag.js +2 -1
  59. package/Touchable/Flick.js +2 -0
  60. package/Touchable/Hold.js +2 -0
  61. package/Touchable/Pinch.js +2 -1
  62. package/Touchable/Touch.js +3 -3
  63. package/Touchable/Touchable.js +7 -0
  64. package/Touchable/useTouch.js +0 -1
  65. package/Transition/Transition.js +19 -3
  66. package/ViewManager/Arranger.js +4 -1
  67. package/ViewManager/TransitionGroup.js +5 -4
  68. package/ViewManager/View.js +3 -2
  69. package/ViewManager/ViewManager.js +25 -9
  70. package/ViewManager/tests/ViewManager-specs.js +44 -0
  71. package/VirtualList/UiVirtualListBase.js +4 -0
  72. package/VirtualList/VirtualList.js +11 -1
  73. package/VirtualList/VirtualListBasic.js +4 -0
  74. package/internal/IdProvider/IdProvider.js +6 -7
  75. package/internal/IdProvider/useId.js +0 -1
  76. package/internal/Pure/Pure.js +11 -7
  77. package/package.json +2 -2
  78. package/resolution/ResolutionDecorator.js +36 -7
  79. package/resolution/resolution.js +23 -7
  80. package/useScroll/ScrollbarTrack.js +8 -8
  81. package/useScroll/useScroll.js +17 -1
package/Layout/Layout.js CHANGED
@@ -37,37 +37,159 @@ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (O
37
37
  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
38
38
  function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
39
39
  function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
40
- function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
41
- /**
42
- * A container for `Cell`s.
43
- *
44
- * A stateless component that acts as a containing area for {@link ui/Layout.Cell|Cells} to be
45
- * positioned in a row or a column (horizontally or vertically, respectively. It supports an
46
- * {@link ui/Layout.Layout#orientation|orientation} property for laying-out its contents
47
- * (`Cells`) in an organized, readable way.
48
- *
49
- * Example:
50
- * ```
51
- * import Input from '@enact/moonstone/Input';
52
- * import css from './LayoutExample.less';
53
- * ...
54
- * <fieldset>
55
- * <Layout align="center">
56
- * <Cell component="label" size="40%" className={css.label} shrink>First Name</Cell>
57
- * <Cell component={Input} placeholder="First" className={css.input} />
58
- * </Layout>
59
- * <Layout align="center">
60
- * <Cell component="label" size="40%" className={css.label} shrink>Last Name</Cell>
61
- * <Cell component={Input} placeholder="Last" className={css.input} />
62
- * </Layout>
63
- * </fieldset>
64
- * ```
65
- *
66
- * @class LayoutBase
67
- * @ui
68
- * @memberof ui/Layout
69
- * @public
70
- */
40
+ function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); } /**
41
+ * A convenient tool for laying-out content using `Layout`, `Cell`, `Row`, and `Column`.
42
+ *
43
+ * Layout is a powerful and versatile tool used for arranging content on the screen. On a conceptual
44
+ * level, it mixes the best parts of HTML tables wtih the best parts of HTML framesets, both of
45
+ * which were largely abandoned for their drawbacks, ignoring their strengths. A `Layout` is simply
46
+ * a container for `Cell`, the only "legal" child. Conversely, `Cell` may only be used in a
47
+ * `Layout`. Cells in a Layout can either be positioned next to each other (horizontally) or
48
+ * above/below each other (vertically) in what we refer to as a {@link ui/Layout.Row|Row} or
49
+ * {@link ui/Layout.Column|Column}, respectively.
50
+ *
51
+ * The `Row` and `Column` layout presets describe the direction of layout for their children. This
52
+ * can sometimes cause confusion. A `Row` of children naturally forms a _layout_ whose children can
53
+ * have the _appearance_ of columns. To keep things clear, think about the layout rather than the
54
+ * what the children themselves represent.
55
+ *
56
+ * `Layout` is an implementation of flex-box, but with built-in rails, properties, and features to
57
+ * help avoid common problems with flex-box; things like content overflowing, sizing quirks, and
58
+ * positioning problems regarding content of unknown or undefined dimension.
59
+ *
60
+ * The following scenarios are some common cases where `Layout` can truly help out. A quality of
61
+ * `Cell` you'll see below is that when a `Cell` has no defined size, it automatically sizes to fill
62
+ * any remaining space in the `Layout`. If there are multiple auto-sizing `Cell` components, they
63
+ * share the space, subdividing it equally among themselves. It's great to leverage this and only
64
+ * apply sizes to `Cell`s which must have defined sizes. `shrink` is one of the ways you can impose
65
+ * size guidelines on a `Cell`. It automatically fits the size of the Cell to the size of its
66
+ * content.
67
+ *
68
+ * A row of cells where the last one should always attach to the right side, regardless of the size
69
+ * of the main "content" cell:
70
+ * ```
71
+ * ┌───────┬─┐
72
+ * │Main │R│
73
+ * └───────┴─┘
74
+ * ```
75
+ *
76
+ * ```
77
+ * <Row>
78
+ * <Cell>Main Content</Cell>
79
+ * <Cell shrink>Right Side</Cell>
80
+ * </Row>
81
+ * ```
82
+ *
83
+ * A "two-column" layout with equal sized cells using `Row`:
84
+ * ```
85
+ * ┌────┬────┐
86
+ * │L │R │
87
+ * └────┴────┘
88
+ * ```
89
+ *
90
+ * ```
91
+ * <Row style={{height: '100%'}}>
92
+ * <Cell>Left Column</Cell>
93
+ * <Cell>Right Column</Cell>
94
+ * </Row>
95
+ * ```
96
+ * *Remember:* The cells of the `Row` are the columns in our layout. It's likely that in a complex
97
+ * layout `Column` would be used inside the left and right cells to arrange the components, as in
98
+ * the example below.
99
+ *
100
+ * A full-height sidebar with a header and body to the right:
101
+ * ```
102
+ * ┌──┬──────┐
103
+ * │S │HEADER│
104
+ * │ ├──────┤
105
+ * │ │Body │
106
+ * │ │ │
107
+ * └──┴──────┘
108
+ * ```
109
+ *
110
+ * ```
111
+ * <Row style={{height: '100%'}}>
112
+ * <Cell size="20%">Sidebar</Cell>
113
+ * <Cell>
114
+ * <Column>
115
+ * <Cell size={90} component="header">
116
+ * <h1>HEADER</h1>
117
+ * </Cell>
118
+ * <Cell>
119
+ * <p>Body area</p>
120
+ * </Cell>
121
+ * </Column>
122
+ * </Cell>
123
+ * </Row>
124
+ * ```
125
+ * *Note:* Here, we've set the height of `Row` so it fills the height of the screen, allowing the
126
+ * Sidebar Cell and content Cell to stretch from the top to the bottom. We've also leveraged the
127
+ * `component` prop on the header cell, which tells `Cell` to render itself as a "header" HTML tag
128
+ * rather than its usual "div" tag.
129
+ *
130
+ * The example below produces a layout like the following:
131
+ * ```
132
+ * ┌─┬─────┬─┐
133
+ * │o│Item │o│
134
+ * └─┴─────┴─┘
135
+ * ```
136
+ *
137
+ * You'll notice the use of some special classes in the example: `"debug layout"`. Adding these on
138
+ * any element in your DOM hierarchy will enable borders in Layout and Cell to help visualize what
139
+ * is happening in the layout. They automatically change color the deeper in the stack they go.
140
+ *
141
+ * @example
142
+ * <Layout className="debug layout">
143
+ * <Cell shrink>
144
+ * <button>First</button>
145
+ * </Cell>
146
+ * <Cell>
147
+ * <div>A div with some long text in it</div>
148
+ * </Cell>
149
+ * <Cell shrink>
150
+ * <button>Last</button>
151
+ * </Cell>
152
+ * </Layout>
153
+ *
154
+ * @module ui/Layout
155
+ * @exports Cell
156
+ * @exports CellBase
157
+ * @exports CellDecorator
158
+ * @exports Column
159
+ * @exports Layout
160
+ * @exports LayoutBase
161
+ * @exports LayoutDecorator
162
+ * @exports Row
163
+ */ /**
164
+ * A container for `Cell`s.
165
+ *
166
+ * A stateless component that acts as a containing area for {@link ui/Layout.Cell|Cells} to be
167
+ * positioned in a row or a column (horizontally or vertically, respectively. It supports an
168
+ * {@link ui/Layout.LayoutBase.orientation|orientation} property for laying-out its contents
169
+ * (`Cells`) in an organized, readable way.
170
+ *
171
+ * Example:
172
+ * ```
173
+ * import Input from '@enact/moonstone/Input';
174
+ * import css from './LayoutExample.less';
175
+ * ...
176
+ * <fieldset>
177
+ * <Layout align="center">
178
+ * <Cell component="label" size="40%" className={css.label} shrink>First Name</Cell>
179
+ * <Cell component={Input} placeholder="First" className={css.input} />
180
+ * </Layout>
181
+ * <Layout align="center">
182
+ * <Cell component="label" size="40%" className={css.label} shrink>Last Name</Cell>
183
+ * <Cell component={Input} placeholder="Last" className={css.input} />
184
+ * </Layout>
185
+ * </fieldset>
186
+ * ```
187
+ *
188
+ * @class LayoutBase
189
+ * @ui
190
+ * @memberof ui/Layout
191
+ * @public
192
+ */
71
193
  var LayoutBase = (0, _kind["default"])({
72
194
  name: 'LayoutBase',
73
195
  propTypes: /** @lends ui/Layout.LayoutBase.prototype */{
@@ -237,7 +359,7 @@ var LayoutDecorator = (0, _ForwardRef["default"])({
237
359
  *
238
360
  * A stateless component that acts as a containing area for {@link ui/Layout.Cell|Cells} to be
239
361
  * positioned in a row or a column (horizontally or vertically, respectively. It supports an
240
- * {@link ui/Layout.Layout#orientation|orientation} property for laying-out its contents
362
+ * {@link ui/Layout.LayoutBase.orientation|orientation} property for laying-out its contents
241
363
  * (`Cells`) in an organized, readable way.
242
364
  *
243
365
  * Example:
@@ -22,6 +22,10 @@
22
22
  .layout.horizontal > .cell.grow {
23
23
  width: 0;
24
24
  }
25
+ .layout.horizontal > .cell.grow.size {
26
+ max-width: none;
27
+ min-width: var(--cell-size);
28
+ }
25
29
  .layout.vertical {
26
30
  flex-direction: column;
27
31
  height: 100%;
@@ -33,6 +37,10 @@
33
37
  height: 0;
34
38
  align-self: normal;
35
39
  }
40
+ .layout.vertical > .cell.grow.size {
41
+ max-height: none;
42
+ min-height: var(--cell-size);
43
+ }
36
44
  .layout.inline {
37
45
  display: inline-flex;
38
46
  }
@@ -104,6 +104,45 @@ describe('Layout Specs', function () {
104
104
  });
105
105
  });
106
106
  });
107
+ test('should apply a class for grow', function () {
108
+ (0, _react.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_Layout.Cell, {
109
+ children: "Body"
110
+ }));
111
+ var cell = _react.screen.getByText('Body');
112
+ var expected = 'grow';
113
+ expect(cell).toHaveClass(expected);
114
+ });
115
+ test('should apply classes for grow and size and flexBasis styles the size prop value 100px', function () {
116
+ (0, _react.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_Layout["default"], {
117
+ style: {
118
+ width: "300px"
119
+ },
120
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Layout.Cell, {
121
+ grow: true,
122
+ size: "100px",
123
+ children: "Body"
124
+ })
125
+ }));
126
+ var cell = _react.screen.getByText('Body');
127
+ var expectedGrowClass = 'grow';
128
+ var expectedSizeClass = 'size';
129
+ var expectedFlexBasis = '100px';
130
+ expect(cell).toHaveClass(expectedGrowClass);
131
+ expect(cell).toHaveClass(expectedSizeClass);
132
+ expect(cell).toHaveStyle({
133
+ 'flex-basis': expectedFlexBasis
134
+ });
135
+ });
136
+ test('should not be apply a class for grow when using shrink', function () {
137
+ (0, _react.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_Layout.Cell, {
138
+ grow: true,
139
+ shrink: true,
140
+ children: "Body"
141
+ }));
142
+ var cell = _react.screen.getByText('Body');
143
+ var notExpected = 'grow';
144
+ expect(cell).not.toHaveClass(notExpected);
145
+ });
107
146
  test('should return a DOM node reference for `componentRef` on `Layout`', function () {
108
147
  var ref = jest.fn();
109
148
  (0, _react.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_Layout["default"], {
@@ -171,6 +171,56 @@ var MarqueeController = (0, _hoc["default"])(defaultConfig, function (config, Wr
171
171
  value: function componentWillUnmount() {
172
172
  this.cancelJob.stop();
173
173
  }
174
+
175
+ /*
176
+ * Registers `component` with a set of handlers for `start` and `stop`.
177
+ *
178
+ * @param {Object} component A component, typically a React component instance, on
179
+ * which handlers will be dispatched.
180
+ * @param {Object} handlers An object containing `start` and `stop` functions
181
+ *
182
+ * @returns {undefined}
183
+ */
184
+
185
+ /*
186
+ * Unregisters `component` for synchronization
187
+ *
188
+ * @param {Object} component A previously registered component
189
+ *
190
+ * @returns {undefined}
191
+ */
192
+
193
+ /*
194
+ * Handler for the `start` context function
195
+ *
196
+ * @param {Object} component A previously registered component
197
+ *
198
+ * @returns {undefined}
199
+ */
200
+
201
+ /*
202
+ * Handler for the `cancel` context function
203
+ *
204
+ * @param {Object} component A previously registered component
205
+ *
206
+ * @returns {undefined}
207
+ */
208
+
209
+ /*
210
+ * Handler for the `complete` context function
211
+ *
212
+ * @param {Object} component A previously registered component
213
+ *
214
+ * @returns {undefined}
215
+ */
216
+
217
+ /*
218
+ * Handler for the focus event
219
+ */
220
+
221
+ /*
222
+ * Handler for the blur event
223
+ */
174
224
  }, {
175
225
  key: "dispatch",
176
226
  value:
@@ -39,8 +39,7 @@ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflec
39
39
  function _possibleConstructorReturn(self, call) { if (call && (typeof call === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
40
40
  function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
41
41
  function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
42
- function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
43
- // The minimum number of milliseconds to wait before resetting the marquee position after it finishes.
42
+ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } // The minimum number of milliseconds to wait before resetting the marquee position after it finishes.
44
43
  var MINIMUM_MARQUEE_RESET_DELAY = 40;
45
44
 
46
45
  /**
@@ -694,6 +693,45 @@ var MarqueeDecorator = (0, _hoc["default"])(defaultConfig, function (config, Wra
694
693
  * @param {Number} [delay] Milliseconds to wait before animating
695
694
  * @returns {undefined}
696
695
  */
696
+
697
+ /*
698
+ * Stops the animation
699
+ *
700
+ * @returns {undefined}
701
+ */
702
+
703
+ /*
704
+ * Starts marquee animation with synchronization, if not already animating and a timer is
705
+ * not already active to start.
706
+ *
707
+ * @param {Number} [delay] Milliseconds to wait before animating
708
+ * @returns {undefined}
709
+ */
710
+
711
+ /*
712
+ * Starts marquee animation with synchronization
713
+ *
714
+ * @param {Number} [delay] Milliseconds to wait before animating
715
+ * @returns {undefined}
716
+ */
717
+
718
+ /*
719
+ * Resets the marquee and restarts it after `marqueeDelay` milliseconds.
720
+ *
721
+ * @returns {undefined}
722
+ */
723
+
724
+ /*
725
+ * Resets and restarts the marquee after `marqueeResetDelay` milliseconds
726
+ *
727
+ * @returns {undefined}
728
+ */
729
+
730
+ /*
731
+ * Cancels the marquee
732
+ *
733
+ * @returns {undefined}
734
+ */
697
735
  }, {
698
736
  key: "handleUnhover",
699
737
  value: function handleUnhover() {
@@ -19,13 +19,17 @@ function _nonIterableRest() { throw new TypeError("Invalid attempt to destructur
19
19
  function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
20
20
  function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
21
21
  function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i["return"] && (_r = _i["return"](), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
22
- function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
23
- /**
24
- * Default config for {@link ui/Measurable.Measurable}.
25
- *
26
- * @memberof ui/Measurable.Measurable
27
- * @hocconfig
28
- */
22
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } /* global ResizeObserver, MutationObserver */ /**
23
+ * A higher-order component that adds the ability to measure nodes conveniently.
24
+ *
25
+ * @module ui/Measurable
26
+ * @exports Measurable
27
+ */ /**
28
+ * Default config for {@link ui/Measurable.Measurable}.
29
+ *
30
+ * @memberof ui/Measurable.Measurable
31
+ * @hocconfig
32
+ */
29
33
  var defaultConfig = {
30
34
  /**
31
35
  * Configures the prop name to pass the measurement object.
package/Media/Media.js CHANGED
@@ -28,29 +28,36 @@ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflec
28
28
  function _possibleConstructorReturn(self, call) { if (call && (typeof call === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
29
29
  function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
30
30
  function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
31
- function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
32
- /**
33
- * Generates a key representing the source node or nodes provided
34
- *
35
- * Example:
36
- * ```
37
- * getKeyFromSource('path/file.mp4'); // 'path/file.mp4'
38
- * getKeyFromSource(
39
- * <source src="path/file.mp4" type="video/mp4" />
40
- * ); // 'path/file.mp4'
41
- * getKeyFromSource([
42
- * <source src="path/file.mp4" type="video/mp4" />,
43
- * <source src="path/file.ogg" type="video/ogg" />,
44
- * ]); // 'path/file.mp4+path/file.ogg'
45
- * ```
46
- *
47
- * @function
48
- * @param {String|Element|Element[]} source URI for a source, `<source>` node, or array of
49
- * `<source>` nodes
50
- * @returns {String} Key representing sources
51
- * @memberof ui/Media
52
- * @public
53
- */
31
+ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } /**
32
+ * A representation of `HTMLMediaElement` component with an ability to attach a custom event
33
+ * handler.
34
+ *
35
+ * @module ui/Media
36
+ * @exports getKeyFromSource
37
+ * @exports handledMediaEventsMap
38
+ * @exports Media
39
+ */ /**
40
+ * Generates a key representing the source node or nodes provided
41
+ *
42
+ * Example:
43
+ * ```
44
+ * getKeyFromSource('path/file.mp4'); // 'path/file.mp4'
45
+ * getKeyFromSource(
46
+ * <source src="path/file.mp4" type="video/mp4" />
47
+ * ); // 'path/file.mp4'
48
+ * getKeyFromSource([
49
+ * <source src="path/file.mp4" type="video/mp4" />,
50
+ * <source src="path/file.ogg" type="video/ogg" />,
51
+ * ]); // 'path/file.mp4+path/file.ogg'
52
+ * ```
53
+ *
54
+ * @function
55
+ * @param {String|Element|Element[]} source URI for a source, `<source>` node, or array of
56
+ * `<source>` nodes
57
+ * @returns {String} Key representing sources
58
+ * @memberof ui/Media
59
+ * @public
60
+ */
54
61
  var getKeyFromSource = function getKeyFromSource() {
55
62
  var source = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
56
63
  if ( /*#__PURE__*/(0, _react.isValidElement)(source)) {