@enact/limestone 1.3.0 → 1.9.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/.github/workflows/ci-branch.yml +21 -0
- package/.github/workflows/ci-pull-request.yml +16 -0
- package/.github/workflows/ci-reusable.yml +73 -0
- package/ActionGuide/ActionGuide.d.ts +5 -4
- package/ActionGuide/ActionGuide.module.css +1 -1
- package/Alert/Alert.d.ts +4 -2
- package/Alert/Alert.js +4 -1
- package/Alert/Alert.module.css +36 -0
- package/BodyText/BodyText.d.ts +5 -4
- package/BodyText/BodyText.module.css +7 -7
- package/Button/Button.d.ts +17 -12
- package/Button/Button.js +1 -1
- package/Button/Button.module.css +195 -268
- package/CHANGELOG.md +220 -0
- package/Card/Card.d.ts +36 -8
- package/Card/Card.js +157 -20
- package/Card/Card.module.css +277 -58
- package/Card/tests/Card-specs.js +30 -0
- package/Checkbox/Checkbox.d.ts +8 -7
- package/Checkbox/Checkbox.js +3 -1
- package/Checkbox/Checkbox.module.css +213 -120
- package/Checkbox/tests/Checkbox-specs.js +1 -1
- package/CheckboxItem/CheckboxItem.d.ts +22 -7
- package/CheckboxItem/CheckboxItem.js +69 -4
- package/Chips/Chip.js +60 -7
- package/Chips/Chip.module.css +3 -3
- package/Chips/Chips.js +26 -12
- package/Chips/Chips.module.css +1 -1
- package/Chips/tests/Chip-specs.js +19 -9
- package/Chips/tests/Chips-specs.js +19 -19
- package/ContextualMenuDecorator/ContextualMenuDecorator.d.ts +4 -5
- package/ContextualPopupDecorator/ContextualPopup.module.css +34 -34
- package/ContextualPopupDecorator/ContextualPopupDecorator.js +557 -549
- package/DatePicker/DatePicker.d.ts +4 -5
- package/DayPicker/DayPicker.d.ts +8 -7
- package/Dropdown/Dropdown.d.ts +11 -13
- package/Dropdown/Dropdown.module.css +9 -9
- package/Dropdown/DropdownList.js +16 -11
- package/FixedPopupPanels/FixedPopupPanels.d.ts +4 -2
- package/FixedPopupPanels/FixedPopupPanels.module.css +18 -18
- package/FlexiblePopupPanels/FlexiblePopupPanels.module.css +23 -23
- package/FormCheckboxItem/FormCheckboxItem.d.ts +5 -4
- package/Heading/Heading.d.ts +8 -7
- package/Heading/Heading.module.css +5 -5
- package/Icon/Icon.d.ts +14 -4
- package/Icon/Icon.js +48 -2
- package/Icon/Icon.module.css +1 -1
- package/Icon/IconList.js +25 -1
- package/IconItem/IconItem.d.ts +13 -12
- package/IconItem/IconItem.js +15 -0
- package/IconItem/IconItem.module.css +107 -1
- package/Image/Image.d.ts +5 -4
- package/ImageItem/ImageItem.d.ts +11 -10
- package/ImageItem/ImageItem.js +37 -31
- package/ImageItem/ImageItem.module.css +30 -30
- package/ImageItem/tests/ImageItem-specs.js +3 -10
- package/Input/Input.js +9 -2
- package/Input/Input.module.css +37 -8
- package/Input/InputField.js +5 -1
- package/Input/InputField.module.css +17 -2
- package/Input/InputFieldSpotlightDecorator.js +213 -229
- package/Input/index.d.ts +15 -18
- package/Input/tests/InputField-specs.js +21 -0
- package/Item/Item.d.ts +16 -9
- package/Item/Item.js +20 -2
- package/Item/Item.module.css +1 -1
- package/KeyGuide/KeyGuide.d.ts +8 -7
- package/KeyGuide/KeyGuide.module.css +25 -1
- package/Marquee/Marquee.d.ts +2 -4
- package/MediaOverlay/MediaOverlay.d.ts +12 -11
- package/MediaOverlay/MediaOverlay.js +43 -21
- package/MediaOverlay/MediaOverlay.module.css +114 -15
- package/MediaPlayer/MediaControls.js +195 -13
- package/MediaPlayer/MediaControls.module.css +3 -2
- package/MediaPlayer/MediaSlider.module.css +7 -20
- package/MediaPlayer/index.d.ts +59 -7
- package/PageViews/PageViews.js +165 -80
- package/PageViews/PageViewsRouter.js +9 -0
- package/PageViews/tests/PageViews-specs.js +84 -0
- package/Panels/Header.js +48 -30
- package/Panels/Header.module.css +83 -31
- package/Panels/Panel.module.css +1 -1
- package/Panels/index.d.ts +7 -8
- package/Picker/Picker.d.ts +4 -5
- package/Picker/Picker.module.css +2 -2
- package/Popup/Popup.js +242 -240
- package/Popup/Popup.module.css +24 -24
- package/PopupTabLayout/PopupTabLayout.d.ts +5 -7
- package/PopupTabLayout/PopupTabLayout.js +15 -9
- package/PopupTabLayout/PopupTabLayout.module.css +53 -16
- package/PopupTabLayout/PopupTabLayoutStateContext.js +8 -0
- package/ProgressBar/ProgressBar.d.ts +5 -4
- package/ProgressBar/ProgressBarTooltip.module.css +12 -12
- package/ProgressButton/ProgressButton.d.ts +4 -5
- package/QuickGuidePanels/QuickGuidePanels.module.css +2 -2
- package/RadioItem/RadioItem.d.ts +18 -5
- package/RadioItem/RadioItem.js +67 -2
- package/RadioItem/RadioItem.module.css +36 -36
- package/RangePicker/RangePicker.module.css +2 -2
- package/Scroller/EditableWrapper.js +11 -4
- package/Scroller/Scroller.d.ts +20 -16
- package/Scroller/Scroller.js +9 -3
- package/Scroller/Scroller.module.css +4 -4
- package/Slider/Slider.d.ts +16 -14
- package/Slider/Slider.js +37 -4
- package/Slider/Slider.module.css +314 -91
- package/Slider/tests/Slider-specs.js +2 -1
- package/Spinner/Spinner.d.ts +5 -4
- package/Spinner/Spinner.module.css +9 -9
- package/Steps/Steps.d.ts +5 -4
- package/Steps/Steps.js +9 -5
- package/Switch/Switch.d.ts +8 -7
- package/Switch/Switch.module.css +100 -13
- package/SwitchItem/SwitchItem.d.ts +9 -6
- package/TabLayout/RefocusDecorator.js +15 -9
- package/TabLayout/TabGroup.js +3 -2
- package/TabLayout/TabGroup.module.css +2 -2
- package/TabLayout/TabLayout.d.ts +6 -0
- package/TabLayout/TabLayout.js +11 -1
- package/TabLayout/TabLayout.module.css +18 -0
- package/TabLayout/tests/TabLayout-specs.js +52 -0
- package/ThemeDecorator/ThemeDecorator.d.ts +9 -10
- package/ThemeDecorator/fontGenerator.js +1 -1
- package/ThemeDecorator/screenTypes.json +1 -0
- package/TimePicker/TimePicker.module.css +1 -1
- package/TooltipDecorator/Tooltip.module.css +1 -2
- package/TooltipDecorator/tests/util-specs.js +12 -0
- package/TooltipDecorator/useTooltip.js +1 -1
- package/TooltipDecorator/util.js +18 -11
- package/VideoPlayer/Feedback.js +3 -0
- package/VideoPlayer/Feedback.module.css +5 -9
- package/VideoPlayer/FeedbackIcons.js +1 -1
- package/VideoPlayer/FeedbackTooltip.module.css +55 -11
- package/VideoPlayer/VideoPlayer.d.ts +44 -18
- package/VideoPlayer/VideoPlayer.js +128 -23
- package/VideoPlayer/VideoPlayer.module.css +28 -11
- package/VirtualList/VirtualList.d.ts +9 -2
- package/VirtualList/VirtualList.js +31 -6
- package/VirtualList/tests/VirtualGridList-translate-specs.js +3 -0
- package/VirtualList/tests/VirtualList-specs.js +28 -1
- package/VirtualList/tests/VirtualList-translate-specs.js +4 -1
- package/WizardPanels/WizardPanels.module.css +2 -2
- package/WizardPanels/index.d.ts +4 -2
- package/fonts/Limestone_Icons.ttf +0 -0
- package/internal/$L/$L.js +3 -3
- package/internal/DateComponentPicker/DateComponentPicker.module.css +2 -2
- package/internal/DateTime/DateTime.module.css +1 -0
- package/internal/Panels/PanelsRouter.js +16 -5
- package/internal/Picker/Picker.module.css +2 -2
- package/internal/SharedStateDecorator/SharedStateDecorator.js +76 -99
- package/internal/validators/validators.js +21 -2
- package/package.json +14 -14
- package/styles/colors-highcontrast.less +9 -1
- package/styles/colors.less +11 -7
- package/styles/motion-mixins.less +66 -0
- package/styles/motions.less +78 -0
- package/styles/variables.less +176 -150
- package/useScroll/HoverToScroll.js +8 -5
- package/useScroll/ScrollbarTrack.module.css +8 -8
- package/useScroll/useEvent.js +7 -1
- package/useScroll/useScroll.js +2 -0
- package/useScroll/useScroll.module.css +6 -6
- package/.travis.yml +0 -40
|
@@ -36,6 +36,16 @@ var setPortraitOrientation = function setPortraitOrientation() {
|
|
|
36
36
|
value: 1920
|
|
37
37
|
});
|
|
38
38
|
};
|
|
39
|
+
var setLandscapeOrientation = function setLandscapeOrientation() {
|
|
40
|
+
Object.defineProperty(window, 'innerWidth', {
|
|
41
|
+
configurable: true,
|
|
42
|
+
value: 1920
|
|
43
|
+
});
|
|
44
|
+
Object.defineProperty(window, 'innerHeight', {
|
|
45
|
+
configurable: true,
|
|
46
|
+
value: 1080
|
|
47
|
+
});
|
|
48
|
+
};
|
|
39
49
|
var spySpotlight = function spySpotlight() {
|
|
40
50
|
jest.spyOn(_spotlight["default"], 'setPointerMode');
|
|
41
51
|
jest.spyOn(_spotlight["default"], 'move');
|
|
@@ -561,6 +571,27 @@ describe('TabLayout specs', function () {
|
|
|
561
571
|
var actual = _react.screen.getByTestId('tabLayout');
|
|
562
572
|
expect(actual).toHaveClass(expected);
|
|
563
573
|
});
|
|
574
|
+
test('should update orientation on window resize, collapse and expand tabs', function () {
|
|
575
|
+
(0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(_TabLayout["default"], {
|
|
576
|
+
"data-testid": "tabLayout",
|
|
577
|
+
orientation: "vertical",
|
|
578
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_TabLayout.Tab, {
|
|
579
|
+
title: "Home",
|
|
580
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
581
|
+
children: "Home"
|
|
582
|
+
})
|
|
583
|
+
})
|
|
584
|
+
}));
|
|
585
|
+
var actual = _react.screen.getByTestId('tabLayout');
|
|
586
|
+
setPortraitOrientation();
|
|
587
|
+
(0, _react.fireEvent)(window, new Event('resize'));
|
|
588
|
+
var expectedCollapsed = 'collapsed';
|
|
589
|
+
expect(actual).toHaveClass(expectedCollapsed);
|
|
590
|
+
setLandscapeOrientation();
|
|
591
|
+
(0, _react.fireEvent)(window, new Event('resize'));
|
|
592
|
+
var expectedExpanded = 'expanded';
|
|
593
|
+
expect(actual).not.toHaveClass(expectedExpanded);
|
|
594
|
+
});
|
|
564
595
|
test('should update orientation on window resize and not collapse tabs when \'blockCollapseOnPortrait\' is set', function () {
|
|
565
596
|
(0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(_TabLayout["default"], {
|
|
566
597
|
blockCollapseOnPortrait: true,
|
|
@@ -579,6 +610,27 @@ describe('TabLayout specs', function () {
|
|
|
579
610
|
var actual = _react.screen.getByTestId('tabLayout');
|
|
580
611
|
expect(actual).not.toHaveClass(expected);
|
|
581
612
|
});
|
|
613
|
+
test('should update orientation on window resize and not expand tabs when \'blockExpandOnLandscape\' is set', function () {
|
|
614
|
+
(0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(_TabLayout["default"], {
|
|
615
|
+
blockExpandOnLandscape: true,
|
|
616
|
+
"data-testid": "tabLayout",
|
|
617
|
+
orientation: "vertical",
|
|
618
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_TabLayout.Tab, {
|
|
619
|
+
title: "Home",
|
|
620
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
621
|
+
children: "Home"
|
|
622
|
+
})
|
|
623
|
+
})
|
|
624
|
+
}));
|
|
625
|
+
var actual = _react.screen.getByTestId('tabLayout');
|
|
626
|
+
var expected = 'collapsed';
|
|
627
|
+
setPortraitOrientation();
|
|
628
|
+
(0, _react.fireEvent)(window, new Event('resize'));
|
|
629
|
+
expect(actual).toHaveClass(expected);
|
|
630
|
+
setLandscapeOrientation();
|
|
631
|
+
(0, _react.fireEvent)(window, new Event('resize'));
|
|
632
|
+
expect(actual).toHaveClass(expected);
|
|
633
|
+
});
|
|
582
634
|
test('should set the tab size for all tabs in horizontal orientation', function () {
|
|
583
635
|
var tabSize = 300;
|
|
584
636
|
(0, _react.render)(/*#__PURE__*/(0, _jsxRuntime.jsxs)(_TabLayout.TabLayoutBase, {
|
|
@@ -117,20 +117,19 @@ applying the decorator.
|
|
|
117
117
|
*/
|
|
118
118
|
spotlight?: boolean;
|
|
119
119
|
}
|
|
120
|
-
export interface ThemeDecoratorProps
|
|
121
|
-
|
|
120
|
+
export interface ThemeDecoratorProps extends Merge<
|
|
121
|
+
Merge<
|
|
122
122
|
Merge<
|
|
123
123
|
Merge<
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
ui_resolution_ResolutionDecoratorProps
|
|
127
|
-
>,
|
|
128
|
-
spotlight_SpotlightRootDecorator_SpotlightRootDecoratorProps
|
|
124
|
+
ui_FloatingLayer_FloatingLayerDecoratorProps,
|
|
125
|
+
ui_resolution_ResolutionDecoratorProps
|
|
129
126
|
>,
|
|
130
|
-
|
|
127
|
+
spotlight_SpotlightRootDecorator_SpotlightRootDecoratorProps
|
|
131
128
|
>,
|
|
132
|
-
|
|
133
|
-
|
|
129
|
+
limestone_Skinnable_SkinnableProps
|
|
130
|
+
>,
|
|
131
|
+
AccessibilityDecoratorProps
|
|
132
|
+
> {}
|
|
134
133
|
export function ThemeDecorator<P>(
|
|
135
134
|
config: ThemeDecoratorConfig,
|
|
136
135
|
Component: React.ComponentType<P> | string,
|
|
@@ -6,5 +6,6 @@
|
|
|
6
6
|
{"name": "qhd", "pxPerRem": 32, "width": 2560, "height": 1440, "aspectRatioName": "hdtv"},
|
|
7
7
|
{"name": "wqhd", "pxPerRem": 32, "width": 3440, "height": 1440, "aspectRatioName": "cinema"},
|
|
8
8
|
{"name": "uhd", "pxPerRem": 48, "width": 3840, "height": 2160, "aspectRatioName": "hdtv", "base": true},
|
|
9
|
+
{"name": "wuhd", "pxPerRem": 48, "width": 5158, "height": 2160, "aspectRatioName": "cinema"},
|
|
9
10
|
{"name": "uhd2", "pxPerRem": 96, "width": 7680, "height": 4320, "aspectRatioName": "hdtv"}
|
|
10
11
|
]
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
}
|
|
11
11
|
:global(.enact-locale-right-to-left) .timePicker .pickers .hourPicker {
|
|
12
12
|
order: 3;
|
|
13
|
-
margin-inline-start:
|
|
13
|
+
margin-inline-start: var(--primitive-spacing-24);
|
|
14
14
|
}
|
|
15
15
|
:global(.enact-locale-right-to-left) .timePicker .pickers .timeSeparator {
|
|
16
16
|
order: 2;
|
|
@@ -30,10 +30,9 @@
|
|
|
30
30
|
.tooltip .tooltipLabel {
|
|
31
31
|
--lime-tooltip-label-width: auto;
|
|
32
32
|
font-family: "Limestone";
|
|
33
|
-
font-size: var(--primitive-font-size-54);
|
|
34
33
|
font-style: normal;
|
|
35
34
|
font-kerning: normal;
|
|
36
|
-
font-size:
|
|
35
|
+
font-size: var(--primitive-font-size-54);
|
|
37
36
|
font-weight: var(--primitive-font-weight-semibold);
|
|
38
37
|
line-height: 1.5rem;
|
|
39
38
|
white-space: nowrap;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _util = require("../util");
|
|
4
|
+
function asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); }
|
|
5
|
+
function _asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { asyncGeneratorStep(a, r, o, _next, _throw, "next", n); } function _throw(n) { asyncGeneratorStep(a, r, o, _next, _throw, "throw", n); } _next(void 0); }); }; }
|
|
6
|
+
describe('utils', function () {
|
|
7
|
+
test('should convert transition duration to number', /*#__PURE__*/_asyncToGenerator(function* () {
|
|
8
|
+
expect((0, _util.getTransitionDurationInMs)("0.2s")).toBe(200);
|
|
9
|
+
expect((0, _util.getTransitionDurationInMs)("200ms")).toBe(200);
|
|
10
|
+
expect((0, _util.getTransitionDurationInMs)("200")).toBe(0);
|
|
11
|
+
}));
|
|
12
|
+
});
|
|
@@ -206,7 +206,7 @@ var useTooltip = exports.useTooltip = function useTooltip(props) {
|
|
|
206
206
|
var overflow = (0, _util2.calcOverflow)(tooltipNode, clientNode, newLayout.tooltipDirection, _resolution["default"].scale(screenEdgeKeepout));
|
|
207
207
|
newLayout.tooltipDirection = (0, _util2.adjustDirection)(newLayout.tooltipDirection, overflow, rtl);
|
|
208
208
|
newLayout.arrowAnchor = (0, _util2.adjustAnchor)(newLayout.arrowAnchor, newLayout.tooltipDirection, overflow, rtl);
|
|
209
|
-
newLayout.position = (0, _util2.adjustTransform)(clientRef.current, newLayout.tooltipDirection, (0, _util2.getPosition)(clientNode, newLayout.tooltipDirection));
|
|
209
|
+
newLayout.position = (0, _util2.adjustTransform)(clientRef.current, newLayout.tooltipDirection, clientNode, (0, _util2.getPosition)(clientNode, newLayout.tooltipDirection));
|
|
210
210
|
newLayout.labelOffset = newLayout.arrowAnchor === 'center' ? (0, _util2.getLabelOffset)(tooltipNode, newLayout.tooltipDirection, newLayout.position, overflow) : null;
|
|
211
211
|
if (newLayout.position.top !== layout.position.top || newLayout.position.left !== layout.position.left || newLayout.labelOffset !== layout.labelOffset || newLayout.arrowAnchor !== layout.arrowAnchor) {
|
|
212
212
|
setLayout(newLayout);
|
package/TooltipDecorator/util.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.getPosition = exports.getLabelOffset = exports.calcOverflow = exports.adjustTransform = exports.adjustDirection = exports.adjustAnchor = void 0;
|
|
6
|
+
exports.getTransitionDurationInMs = exports.getPosition = exports.getLabelOffset = exports.calcOverflow = exports.adjustTransform = exports.adjustDirection = exports.adjustAnchor = void 0;
|
|
7
7
|
var _resolution = _interopRequireDefault(require("@enact/ui/resolution"));
|
|
8
8
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
9
9
|
function _toConsumableArray(r) { return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread(); }
|
|
@@ -101,32 +101,39 @@ var adjustDirection = exports.adjustDirection = function adjustDirection(tooltip
|
|
|
101
101
|
return tooltipDirection;
|
|
102
102
|
};
|
|
103
103
|
|
|
104
|
+
/* Converts computedStyle for transitionDuration to number value */
|
|
105
|
+
var getTransitionDurationInMs = exports.getTransitionDurationInMs = function getTransitionDurationInMs(duration) {
|
|
106
|
+
if (duration.endsWith("ms")) {
|
|
107
|
+
return parseFloat(duration);
|
|
108
|
+
} else if (duration.endsWith("s")) {
|
|
109
|
+
return parseFloat(duration) * 1000;
|
|
110
|
+
}
|
|
111
|
+
return 0;
|
|
112
|
+
};
|
|
113
|
+
|
|
104
114
|
/**
|
|
105
115
|
* Calculates the top and left position for `Tooltip` accounting for transform.
|
|
106
116
|
*
|
|
107
117
|
* @method
|
|
108
118
|
* @memberof limestone/TooltipDecorator
|
|
109
|
-
* @param {Node}
|
|
119
|
+
* @param {Node} clientRef The value for client node
|
|
110
120
|
* @param {String} tooltipDirection Direction of tooltip
|
|
121
|
+
* @param {Object} clientNode The DOMRect for client node
|
|
111
122
|
* @param {Object} tooltipPosition The `getBoundingClientRect` values for tooltip node
|
|
112
123
|
* @returns {Object} Tooltip's calculated new position accounting for transform
|
|
113
124
|
* @private
|
|
114
125
|
*/
|
|
115
|
-
var adjustTransform = exports.adjustTransform = function adjustTransform(
|
|
116
|
-
var componentNodes =
|
|
117
|
-
var nodePositions = clientNode.getBoundingClientRect();
|
|
126
|
+
var adjustTransform = exports.adjustTransform = function adjustTransform(clientRef, tooltipDirection, clientNode, tooltipPosition) {
|
|
127
|
+
var componentNodes = clientRef !== null && clientRef !== void 0 && clientRef.childNodes.length ? [clientRef].concat(_toConsumableArray(clientRef.childNodes)) : [clientRef];
|
|
118
128
|
var hasTransform = false;
|
|
119
|
-
var transformMatrix = [];
|
|
120
129
|
componentNodes.forEach(function (node) {
|
|
121
|
-
if (window.getComputedStyle(node).transitionProperty === 'transform') {
|
|
130
|
+
if (window.getComputedStyle(node).transitionProperty === 'transform' && getTransitionDurationInMs(window.getComputedStyle(node).transitionDuration) > 0) {
|
|
122
131
|
hasTransform = true;
|
|
123
|
-
var matrix = window.getComputedStyle(node).transform.split('(')[1].split(')')[0].split(',');
|
|
124
|
-
transformMatrix = [parseFloat(matrix[0]) - 1, parseFloat(matrix[3]) - 1];
|
|
125
132
|
}
|
|
126
133
|
});
|
|
127
134
|
if (!hasTransform) return tooltipPosition;
|
|
128
|
-
var horizontal = (
|
|
129
|
-
vertical = (
|
|
135
|
+
var horizontal = (clientNode.right - clientNode.left) * 0.1 / 2,
|
|
136
|
+
vertical = (clientNode.bottom - clientNode.top) * 0.1 / 2;
|
|
130
137
|
switch (tooltipDirection) {
|
|
131
138
|
case 'above':
|
|
132
139
|
tooltipPosition.top -= vertical;
|
package/VideoPlayer/Feedback.js
CHANGED
|
@@ -7,6 +7,7 @@ exports["default"] = exports.FeedbackBase = exports.Feedback = void 0;
|
|
|
7
7
|
var _kind = _interopRequireDefault(require("@enact/core/kind"));
|
|
8
8
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
9
9
|
var _util = require("../internal/util");
|
|
10
|
+
var _$L = _interopRequireDefault(require("../internal/$L"));
|
|
10
11
|
var _FeedbackIcon = _interopRequireDefault(require("./FeedbackIcon"));
|
|
11
12
|
var _FeedbackIcons = _interopRequireDefault(require("./FeedbackIcons.js"));
|
|
12
13
|
var _FeedbackModule = _interopRequireDefault(require("./Feedback.module.css"));
|
|
@@ -82,6 +83,8 @@ var FeedbackBase = exports.FeedbackBase = (0, _kind["default"])({
|
|
|
82
83
|
if (_FeedbackIcons["default"][s].message && _children !== 1) {
|
|
83
84
|
// `1` represents a playback rate of 1:1
|
|
84
85
|
return _children.toString().replace(/^-/, '') + _FeedbackIcons["default"][s].message;
|
|
86
|
+
} else if (s === 'pause') {
|
|
87
|
+
return (0, _$L["default"])('Pause');
|
|
85
88
|
}
|
|
86
89
|
} else {
|
|
87
90
|
// Custom Message
|
|
@@ -1,17 +1,13 @@
|
|
|
1
1
|
.feedback {
|
|
2
|
-
display: inline-
|
|
3
|
-
margin-inline-end: var(--primitive-spacing-12);
|
|
2
|
+
display: inline-flex;
|
|
4
3
|
}
|
|
5
4
|
.feedback.hidden {
|
|
6
5
|
display: none;
|
|
7
6
|
}
|
|
8
|
-
.feedback
|
|
7
|
+
.feedback * {
|
|
9
8
|
display: inline-block;
|
|
10
|
-
margin:
|
|
11
|
-
|
|
12
|
-
}
|
|
13
|
-
.feedback > *:last-child {
|
|
14
|
-
margin-inline-end: 0;
|
|
9
|
+
margin-inline-end: var(--primitive-spacing-42);
|
|
10
|
+
vertical-align: middle;
|
|
15
11
|
}
|
|
16
12
|
.feedback .message {
|
|
17
13
|
font-family: "Limestone";
|
|
@@ -24,9 +20,9 @@
|
|
|
24
20
|
.feedback .icon {
|
|
25
21
|
font-size: 1.25em;
|
|
26
22
|
margin: 0;
|
|
23
|
+
margin-inline-end: var(--primitive-spacing-42);
|
|
27
24
|
height: inherit;
|
|
28
25
|
line-height: inherit;
|
|
29
|
-
vertical-align: bottom;
|
|
30
26
|
}
|
|
31
27
|
.feedback .icon:global(.neutral) {
|
|
32
28
|
color: inherit;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
.feedbackTooltip {
|
|
2
2
|
position: absolute;
|
|
3
|
-
bottom:
|
|
3
|
+
bottom: var(--primitive-spacing-42);
|
|
4
4
|
}
|
|
5
5
|
.feedbackTooltip.shift {
|
|
6
|
-
bottom:
|
|
6
|
+
bottom: calc(var(--primitive-spacing-42) + 24px);
|
|
7
7
|
}
|
|
8
8
|
.feedbackTooltip.shift .content {
|
|
9
9
|
position: absolute;
|
|
@@ -11,6 +11,8 @@
|
|
|
11
11
|
right: 0;
|
|
12
12
|
bottom: 0;
|
|
13
13
|
left: 0;
|
|
14
|
+
font-size: var(--primitive-font-size-54);
|
|
15
|
+
margin-bottom: var(--primitive-spacing-30);
|
|
14
16
|
}
|
|
15
17
|
.feedbackTooltip.hidden {
|
|
16
18
|
display: none;
|
|
@@ -21,9 +23,9 @@
|
|
|
21
23
|
will-change: transform;
|
|
22
24
|
}
|
|
23
25
|
.feedbackTooltip .thumbnail {
|
|
24
|
-
border-width: 0.
|
|
26
|
+
border-width: 0.25rem;
|
|
25
27
|
border-style: solid;
|
|
26
|
-
border-radius:
|
|
28
|
+
border-radius: var(--primitive-radius-12);
|
|
27
29
|
overflow: hidden;
|
|
28
30
|
transition: opacity 250ms;
|
|
29
31
|
}
|
|
@@ -32,27 +34,33 @@
|
|
|
32
34
|
width: 8.875rem;
|
|
33
35
|
height: 5rem;
|
|
34
36
|
}
|
|
37
|
+
.feedbackTooltip .thumbnail::after {
|
|
38
|
+
content: "";
|
|
39
|
+
position: absolute;
|
|
40
|
+
top: auto;
|
|
41
|
+
right: 0;
|
|
42
|
+
bottom: 0;
|
|
43
|
+
left: 0;
|
|
44
|
+
height: 65%;
|
|
45
|
+
}
|
|
35
46
|
.feedbackTooltip.thumbnailDeactivated .thumbnail {
|
|
36
47
|
opacity: 0.5;
|
|
37
48
|
}
|
|
38
49
|
.feedbackTooltip .content {
|
|
39
50
|
font-family: "Limestone";
|
|
40
|
-
font-
|
|
41
|
-
font-size: 1rem;
|
|
51
|
+
font-size: var(--primitive-font-size-48);
|
|
42
52
|
font-weight: var(--primitive-font-weight-regular);
|
|
43
53
|
line-height: 1.5rem;
|
|
44
54
|
white-space: nowrap;
|
|
45
55
|
text-align: center;
|
|
46
|
-
margin-bottom:
|
|
56
|
+
margin-bottom: var(--primitive-spacing-6);
|
|
57
|
+
padding: 0 var(--primitive-spacing-36);
|
|
47
58
|
}
|
|
48
59
|
:global(.enact-locale-non-latin) .feedbackTooltip .content {
|
|
49
60
|
font-family: "Limestone";
|
|
50
|
-
font-size:
|
|
61
|
+
font-size: var(--primitive-font-size-48);
|
|
51
62
|
font-weight: var(--primitive-font-weight-regular);
|
|
52
63
|
}
|
|
53
|
-
:global(.enact-locale-non-latin) .feedbackTooltip .content {
|
|
54
|
-
font-family: "Limestone Number";
|
|
55
|
-
}
|
|
56
64
|
.feedbackTooltip .alignmentContainer {
|
|
57
65
|
position: relative;
|
|
58
66
|
right: 50%;
|
|
@@ -81,10 +89,16 @@
|
|
|
81
89
|
border-right-color: transparent;
|
|
82
90
|
border-left-color: transparent;
|
|
83
91
|
}
|
|
92
|
+
.feedbackTooltip:global(.neutral) .thumbnail::after {
|
|
93
|
+
background: linear-gradient(180deg, transparent 0%, color(from var(--semantic-color-on-surface-black) srgb r g b / 0.7) 100%);
|
|
94
|
+
}
|
|
84
95
|
.feedbackTooltip:global(.neutral) .content {
|
|
85
96
|
color: var(--semantic-color-on-background-main);
|
|
86
97
|
text-shadow: 0 0.08333rem 0.08333rem color(from var(--semantic-color-on-background-black) srgb r g b / 0.35);
|
|
87
98
|
}
|
|
99
|
+
.feedbackTooltip:global(.neutral):not(.shift) .content {
|
|
100
|
+
background-color: color(from var(--semantic-color-surface-overlay-default) srgb r g b / 0.5);
|
|
101
|
+
}
|
|
88
102
|
:global(.enact-a11y-high-contrast) .feedbackTooltip:global(.neutral):global(.highContrast) .thumbnail {
|
|
89
103
|
border-color: var(--semantic-color-on-background-main);
|
|
90
104
|
}
|
|
@@ -93,10 +107,16 @@
|
|
|
93
107
|
border-right-color: transparent;
|
|
94
108
|
border-left-color: transparent;
|
|
95
109
|
}
|
|
110
|
+
:global(.enact-a11y-high-contrast) .feedbackTooltip:global(.neutral):global(.highContrast) .thumbnail::after {
|
|
111
|
+
background: linear-gradient(180deg, transparent 0%, color(from var(--semantic-color-on-surface-black) srgb r g b / 0.7) 100%);
|
|
112
|
+
}
|
|
96
113
|
:global(.enact-a11y-high-contrast) .feedbackTooltip:global(.neutral):global(.highContrast) .content {
|
|
97
114
|
color: var(--semantic-color-on-background-main);
|
|
98
115
|
text-shadow: 0 0.08333rem 0.08333rem color(from var(--semantic-color-on-background-black) srgb r g b / 0.35);
|
|
99
116
|
}
|
|
117
|
+
:global(.enact-a11y-high-contrast) .feedbackTooltip:global(.neutral):global(.highContrast):not(.shift) .content {
|
|
118
|
+
background-color: color(from var(--semantic-color-surface-overlay-default) srgb r g b / 0.5);
|
|
119
|
+
}
|
|
100
120
|
.feedbackTooltip:global(.light) .thumbnail {
|
|
101
121
|
border-color: var(--semantic-color-on-background-main);
|
|
102
122
|
}
|
|
@@ -105,10 +125,16 @@
|
|
|
105
125
|
border-right-color: transparent;
|
|
106
126
|
border-left-color: transparent;
|
|
107
127
|
}
|
|
128
|
+
.feedbackTooltip:global(.light) .thumbnail::after {
|
|
129
|
+
background: linear-gradient(180deg, transparent 0%, color(from var(--semantic-color-on-surface-black) srgb r g b / 0.7) 100%);
|
|
130
|
+
}
|
|
108
131
|
.feedbackTooltip:global(.light) .content {
|
|
109
132
|
color: var(--semantic-color-on-background-main);
|
|
110
133
|
text-shadow: 0 0.08333rem 0.08333rem color(from var(--semantic-color-on-background-black) srgb r g b / 0.35);
|
|
111
134
|
}
|
|
135
|
+
.feedbackTooltip:global(.light):not(.shift) .content {
|
|
136
|
+
background-color: color(from var(--semantic-color-surface-overlay-default) srgb r g b / 0.5);
|
|
137
|
+
}
|
|
112
138
|
.feedbackTooltip:global(.game) {
|
|
113
139
|
--semantic-color-surface-default: #2d224c;
|
|
114
140
|
--semantic-color-surface-default-focused: #6d2fa1;
|
|
@@ -122,10 +148,16 @@
|
|
|
122
148
|
border-right-color: transparent;
|
|
123
149
|
border-left-color: transparent;
|
|
124
150
|
}
|
|
151
|
+
.feedbackTooltip:global(.game) .thumbnail::after {
|
|
152
|
+
background: linear-gradient(180deg, transparent 0%, color(from var(--semantic-color-on-surface-black) srgb r g b / 0.7) 100%);
|
|
153
|
+
}
|
|
125
154
|
.feedbackTooltip:global(.game) .content {
|
|
126
155
|
color: var(--semantic-color-on-background-main);
|
|
127
156
|
text-shadow: 0 0.08333rem 0.08333rem color(from var(--semantic-color-on-background-black) srgb r g b / 0.35);
|
|
128
157
|
}
|
|
158
|
+
.feedbackTooltip:global(.game):not(.shift) .content {
|
|
159
|
+
background-color: color(from var(--semantic-color-surface-overlay-default) srgb r g b / 0.5);
|
|
160
|
+
}
|
|
129
161
|
:global(.green) .feedbackTooltip:global(.game) {
|
|
130
162
|
--semantic-color-surface-default: #1F2C24;
|
|
131
163
|
--semantic-color-surface-default-focused: #3ea07d;
|
|
@@ -138,10 +170,16 @@
|
|
|
138
170
|
border-right-color: transparent;
|
|
139
171
|
border-left-color: transparent;
|
|
140
172
|
}
|
|
173
|
+
:global(.green) .feedbackTooltip:global(.game) .thumbnail::after {
|
|
174
|
+
background: linear-gradient(180deg, transparent 0%, color(from var(--semantic-color-on-surface-black) srgb r g b / 0.7) 100%);
|
|
175
|
+
}
|
|
141
176
|
:global(.green) .feedbackTooltip:global(.game) .content {
|
|
142
177
|
color: var(--semantic-color-on-background-main);
|
|
143
178
|
text-shadow: 0 0.08333rem 0.08333rem color(from var(--semantic-color-on-background-black) srgb r g b / 0.35);
|
|
144
179
|
}
|
|
180
|
+
:global(.green) .feedbackTooltip:global(.game):not(.shift) .content {
|
|
181
|
+
background-color: color(from var(--semantic-color-surface-overlay-default) srgb r g b / 0.5);
|
|
182
|
+
}
|
|
145
183
|
:global(.orange) .feedbackTooltip:global(.game) {
|
|
146
184
|
--semantic-color-surface-default: #422923;
|
|
147
185
|
--semantic-color-surface-default-focused: #b85f23;
|
|
@@ -154,7 +192,13 @@
|
|
|
154
192
|
border-right-color: transparent;
|
|
155
193
|
border-left-color: transparent;
|
|
156
194
|
}
|
|
195
|
+
:global(.orange) .feedbackTooltip:global(.game) .thumbnail::after {
|
|
196
|
+
background: linear-gradient(180deg, transparent 0%, color(from var(--semantic-color-on-surface-black) srgb r g b / 0.7) 100%);
|
|
197
|
+
}
|
|
157
198
|
:global(.orange) .feedbackTooltip:global(.game) .content {
|
|
158
199
|
color: var(--semantic-color-on-background-main);
|
|
159
200
|
text-shadow: 0 0.08333rem 0.08333rem color(from var(--semantic-color-on-background-black) srgb r g b / 0.35);
|
|
160
201
|
}
|
|
202
|
+
:global(.orange) .feedbackTooltip:global(.game):not(.shift) .content {
|
|
203
|
+
background-color: color(from var(--semantic-color-surface-overlay-default) srgb r g b / 0.5);
|
|
204
|
+
}
|
|
@@ -92,24 +92,24 @@ export interface videoStatus {
|
|
|
92
92
|
/**
|
|
93
93
|
* Type of event that triggered this callback
|
|
94
94
|
*/
|
|
95
|
-
type: string /**
|
|
95
|
+
type: string; /**
|
|
96
96
|
* Playback index of the media in seconds
|
|
97
|
-
|
|
98
|
-
currentTime: number /**
|
|
97
|
+
*/
|
|
98
|
+
currentTime: number; /**
|
|
99
99
|
* Media's entire duration in seconds
|
|
100
|
-
|
|
101
|
-
duration: number /**
|
|
100
|
+
*/
|
|
101
|
+
duration: number; /**
|
|
102
102
|
* Playing vs paused state. `true` means the media is paused
|
|
103
|
-
|
|
104
|
-
paused: boolean /**
|
|
103
|
+
*/
|
|
104
|
+
paused: boolean; /**
|
|
105
105
|
* Current playback rate, as a number
|
|
106
|
-
|
|
107
|
-
playbackRate: number /**
|
|
106
|
+
*/
|
|
107
|
+
playbackRate: number; /**
|
|
108
108
|
* A value between `0` and `1` representing the proportion of the media that has loaded
|
|
109
|
-
|
|
110
|
-
proportionLoaded: number /**
|
|
109
|
+
*/
|
|
110
|
+
proportionLoaded: number; /**
|
|
111
111
|
* A value between `0` and `1` representing the proportion of the media that has already been shown
|
|
112
|
-
|
|
112
|
+
*/
|
|
113
113
|
proportionPlayed: number;
|
|
114
114
|
}
|
|
115
115
|
/**
|
|
@@ -127,15 +127,15 @@ export interface playbackRateHash {
|
|
|
127
127
|
/**
|
|
128
128
|
* An array of playback rates when media fast forwards
|
|
129
129
|
*/
|
|
130
|
-
fastForward: Array /**
|
|
130
|
+
fastForward: Array; /**
|
|
131
131
|
* An array of playback rates when media rewinds
|
|
132
|
-
|
|
133
|
-
rewind: Array /**
|
|
132
|
+
*/
|
|
133
|
+
rewind: Array; /**
|
|
134
134
|
* An array of playback rates when media slow-forwards
|
|
135
|
-
|
|
136
|
-
slowForward: Array /**
|
|
135
|
+
*/
|
|
136
|
+
slowForward: Array; /**
|
|
137
137
|
* An array of playback rates when media slow-rewinds
|
|
138
|
-
|
|
138
|
+
*/
|
|
139
139
|
slowRewind: Array;
|
|
140
140
|
}
|
|
141
141
|
export interface VideoPlayerBaseProps {
|
|
@@ -211,8 +211,10 @@ jump event on a right or left pulse.
|
|
|
211
211
|
* * `onJumpBackwardButtonClick` - Called when the jump backward button is pressed
|
|
212
212
|
* * `onJumpForwardButtonClick` - Called when the jump forward button is pressed
|
|
213
213
|
* * `onKeyDown` - Called when a key is pressed
|
|
214
|
+
* * `onNextButtonClick` - Called when the next button is pressed
|
|
214
215
|
* * `onPause` - Called when the media is paused via a key event
|
|
215
216
|
* * `onPlay` - Called when the media is played via a key event
|
|
217
|
+
* * `onPreviousButtonClick` - Called when the previous button is pressed
|
|
216
218
|
* * `onRewind` - Called when the media is rewound via a key event
|
|
217
219
|
* * `onToggleMore` - Called when the more components are hidden or shown
|
|
218
220
|
* * `paused` - `true` when the media is paused
|
|
@@ -291,6 +293,12 @@ which will be either `true` or `false` . (e.g.: `onControlsAvailable({availa
|
|
|
291
293
|
* Is passed a as the first argument.
|
|
292
294
|
*/
|
|
293
295
|
onJumpForward?: Function;
|
|
296
|
+
/**
|
|
297
|
+
* Called when the user clicks the next button.
|
|
298
|
+
*
|
|
299
|
+
* Is passed a as the first argument.
|
|
300
|
+
*/
|
|
301
|
+
onNext?: Function;
|
|
294
302
|
/**
|
|
295
303
|
* Called when the video has been paused.
|
|
296
304
|
*/
|
|
@@ -299,6 +307,12 @@ which will be either `true` or `false` . (e.g.: `onControlsAvailable({availa
|
|
|
299
307
|
* Called when the video has been played.
|
|
300
308
|
*/
|
|
301
309
|
onPlay?: Function;
|
|
310
|
+
/**
|
|
311
|
+
* Called when the user clicks the previous button.
|
|
312
|
+
*
|
|
313
|
+
* Is passed a as the first argument.
|
|
314
|
+
*/
|
|
315
|
+
onPrevious?: Function;
|
|
302
316
|
/**
|
|
303
317
|
* Called when the video has been rewound.
|
|
304
318
|
*/
|
|
@@ -349,6 +363,12 @@ will prevent the seek operation.
|
|
|
349
363
|
* Is passed a as the first argument.
|
|
350
364
|
*/
|
|
351
365
|
onWillJumpForward?: Function;
|
|
366
|
+
/**
|
|
367
|
+
* Called once before playing the next video in the playlist.
|
|
368
|
+
*
|
|
369
|
+
* Is passed a as the first argument.
|
|
370
|
+
*/
|
|
371
|
+
onWillNext?: Function;
|
|
352
372
|
/**
|
|
353
373
|
* Called once before the video is paused.
|
|
354
374
|
*/
|
|
@@ -357,6 +377,12 @@ will prevent the seek operation.
|
|
|
357
377
|
* Called once before the video is played
|
|
358
378
|
*/
|
|
359
379
|
onWillPlay?: Function;
|
|
380
|
+
/**
|
|
381
|
+
* Called once before playing the previous video in the playlist.
|
|
382
|
+
*
|
|
383
|
+
* Is passed a as the first argument.
|
|
384
|
+
*/
|
|
385
|
+
onWillPrevious?: Function;
|
|
360
386
|
/**
|
|
361
387
|
* Called once before the video is rewound.
|
|
362
388
|
*/
|