@enact/spotlight 3.4.9-experimental-3 → 3.4.9-experimental-7
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/{build/Accelerator → Accelerator}/Accelerator.d.ts +0 -0
- package/Accelerator/Accelerator.js +149 -156
- package/CHANGELOG.md +22 -0
- package/{build/Pause → Pause}/Pause.d.ts +0 -0
- package/Pause/Pause.js +102 -80
- package/Pause/tests/Pause-specs.js +65 -97
- package/SpotlightContainerDecorator/SpotlightContainer.js +175 -140
- package/{build/SpotlightContainerDecorator → SpotlightContainerDecorator}/SpotlightContainerDecorator.d.ts +0 -0
- package/SpotlightContainerDecorator/SpotlightContainerDecorator.js +222 -176
- package/SpotlightContainerDecorator/tests/Element.prototype.closest.js +44 -40
- package/SpotlightContainerDecorator/tests/SpotlightContainerDecorator-specs.js +221 -210
- package/SpotlightContainerDecorator/tests/useSpotlightContainer-specs.js +150 -243
- package/SpotlightContainerDecorator/useSpotlightContainer.js +47 -28
- package/{build/SpotlightRootDecorator → SpotlightRootDecorator}/SpotlightRootDecorator.d.ts +0 -0
- package/SpotlightRootDecorator/SpotlightRootDecorator.js +206 -111
- package/{build/Spottable → Spottable}/Spottable.d.ts +0 -0
- package/Spottable/Spottable.js +448 -410
- package/Spottable/tests/Spottable-specs.js +90 -117
- package/package.json +3 -2
- package/src/container.js +718 -653
- package/src/navigate.js +406 -491
- package/src/pointer.js +86 -78
- package/{build/src → src}/spotlight.d.ts +0 -0
- package/src/spotlight.js +846 -885
- package/src/target.js +448 -474
- package/src/tests/container-specs.js +643 -1251
- package/src/tests/navigate-specs.js +77 -134
- package/src/tests/pointer-specs.js +126 -182
- package/src/tests/spotlight-specs.js +103 -133
- package/src/tests/target-specs.js +597 -960
- package/src/tests/utils.js +89 -67
- package/src/utils.js +155 -158
- package/build/Accelerator/Accelerator.js +0 -162
- package/build/Accelerator/package.json +0 -3
- package/build/CHANGELOG.md +0 -838
- package/build/Pause/Pause.js +0 -164
- package/build/Pause/package.json +0 -3
- package/build/Pause/tests/Pause-specs.js +0 -65
- package/build/README.md +0 -61
- package/build/SpotlightContainerDecorator/SpotlightContainer.js +0 -176
- package/build/SpotlightContainerDecorator/SpotlightContainerDecorator.js +0 -282
- package/build/SpotlightContainerDecorator/package.json +0 -3
- package/build/SpotlightContainerDecorator/tests/Element.prototype.closest.js +0 -45
- package/build/SpotlightContainerDecorator/tests/SpotlightContainerDecorator-specs.js +0 -221
- package/build/SpotlightContainerDecorator/tests/useSpotlightContainer-specs.js +0 -160
- package/build/SpotlightContainerDecorator/useSpotlightContainer.js +0 -133
- package/build/SpotlightRootDecorator/SpotlightRootDecorator.js +0 -189
- package/build/SpotlightRootDecorator/package.json +0 -3
- package/build/Spottable/Spottable.js +0 -491
- package/build/Spottable/package.json +0 -3
- package/build/Spottable/tests/Spottable-specs.js +0 -90
- package/build/package-lock.json +0 -229
- package/build/package.json +0 -28
- package/build/src/container.js +0 -1201
- package/build/src/navigate.js +0 -419
- package/build/src/pointer.js +0 -183
- package/build/src/spotlight.js +0 -896
- package/build/src/target.js +0 -507
- package/build/src/tests/container-specs.js +0 -653
- package/build/src/tests/navigate-specs.js +0 -87
- package/build/src/tests/pointer-specs.js +0 -130
- package/build/src/tests/spotlight-specs.js +0 -112
- package/build/src/tests/target-specs.js +0 -614
- package/build/src/tests/utils.js +0 -104
- package/build/src/utils.js +0 -180
- package/build/styles/debug.less +0 -97
- package/build/styles/mixins.less +0 -63
- package/docs/index.md +0 -364
|
File without changes
|
|
@@ -1,3 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.Accelerator = exports["default"] = void 0;
|
|
7
|
+
|
|
8
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
9
|
+
|
|
1
10
|
/**
|
|
2
11
|
* Provides the {@link spotlight/Accelerator.Accelerator} class.
|
|
3
12
|
*
|
|
@@ -9,161 +18,145 @@
|
|
|
9
18
|
* @class Accelerator
|
|
10
19
|
* @memberof spotlight/Accelerator
|
|
11
20
|
*/
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
this.time = 0;
|
|
138
|
-
this.keyCode = 0;
|
|
139
|
-
this.canceled = false;
|
|
140
|
-
this.accelerating = false;
|
|
141
|
-
};
|
|
142
|
-
|
|
143
|
-
/**
|
|
144
|
-
* Cancels the Accelerator.
|
|
145
|
-
*
|
|
146
|
-
* @function
|
|
147
|
-
* @returns {undefined}
|
|
148
|
-
* @public
|
|
149
|
-
* @memberof spotlight/Accelerator.Accelerator.prototype
|
|
150
|
-
*/
|
|
151
|
-
cancel = () => {
|
|
152
|
-
this.canceled = true;
|
|
153
|
-
};
|
|
154
|
-
|
|
155
|
-
/**
|
|
156
|
-
* Verifies that the Accelerator is active.
|
|
157
|
-
*
|
|
158
|
-
* @function
|
|
159
|
-
* @returns {Boolean} `true` if the Accelerator is active; otherwise, `false`.
|
|
160
|
-
* @public
|
|
161
|
-
* @memberof spotlight/Accelerator.Accelerator.prototype
|
|
162
|
-
*/
|
|
163
|
-
isAccelerating = () => {
|
|
164
|
-
return this.accelerating;
|
|
165
|
-
};
|
|
21
|
+
var Accelerator =
|
|
22
|
+
/**
|
|
23
|
+
* @constructor
|
|
24
|
+
* @param {Number[]} frequency - Controls the frequency with which the acceleration will
|
|
25
|
+
* "freeze". While frozen, the current target item cannot change, and all events are directed
|
|
26
|
+
* to it.
|
|
27
|
+
* @memberof spotlight/Accelerator.Accelerator.prototype
|
|
28
|
+
*/
|
|
29
|
+
function Accelerator() {
|
|
30
|
+
var _this = this;
|
|
31
|
+
|
|
32
|
+
var frequency = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [3, 3, 3, 2, 2, 2, 1];
|
|
33
|
+
|
|
34
|
+
_classCallCheck(this, Accelerator);
|
|
35
|
+
|
|
36
|
+
this.processKey = function (event, callback) {
|
|
37
|
+
switch (event.type) {
|
|
38
|
+
case 'keydown':
|
|
39
|
+
if (event.keyCode !== _this.keyCode) {
|
|
40
|
+
_this.reset();
|
|
41
|
+
|
|
42
|
+
_this.time = Date.now();
|
|
43
|
+
_this.keyCode = event.keyCode;
|
|
44
|
+
return callback(event);
|
|
45
|
+
} else if (_this.canceled) {
|
|
46
|
+
// Prevent skipped keydown events from bubbling
|
|
47
|
+
event.preventDefault();
|
|
48
|
+
return true;
|
|
49
|
+
} else {
|
|
50
|
+
var elapsedTime = Date.now() - _this.time,
|
|
51
|
+
seconds = Math.floor(elapsedTime / 1000),
|
|
52
|
+
toSkip = 0;
|
|
53
|
+
|
|
54
|
+
seconds = seconds > _this.frequency.length - 1 ? _this.frequency.length - 1 : seconds;
|
|
55
|
+
toSkip = _this.frequency[seconds] - 1;
|
|
56
|
+
|
|
57
|
+
if (toSkip < 0) {
|
|
58
|
+
toSkip = 0;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
_this.accelerating = !(seconds === 0 && _this.skipped === 0);
|
|
62
|
+
|
|
63
|
+
if (_this.skipped >= toSkip) {
|
|
64
|
+
_this.skipped = 0;
|
|
65
|
+
return callback(event);
|
|
66
|
+
} else {
|
|
67
|
+
_this.skipped++; // Prevent skipped keydown events from bubbling
|
|
68
|
+
|
|
69
|
+
event.preventDefault();
|
|
70
|
+
return true;
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
case 'keyup':
|
|
75
|
+
_this.reset();
|
|
76
|
+
|
|
77
|
+
return callback(event);
|
|
78
|
+
}
|
|
79
|
+
};
|
|
80
|
+
|
|
81
|
+
this.reset = function () {
|
|
82
|
+
_this.skipped = 0;
|
|
83
|
+
_this.time = 0;
|
|
84
|
+
_this.keyCode = 0;
|
|
85
|
+
_this.canceled = false;
|
|
86
|
+
_this.accelerating = false;
|
|
87
|
+
};
|
|
88
|
+
|
|
89
|
+
this.cancel = function () {
|
|
90
|
+
_this.canceled = true;
|
|
91
|
+
};
|
|
92
|
+
|
|
93
|
+
this.isAccelerating = function () {
|
|
94
|
+
return _this.accelerating;
|
|
95
|
+
};
|
|
96
|
+
|
|
97
|
+
/*
|
|
98
|
+
* Whether the instance is currently in an accelerating state.
|
|
99
|
+
*
|
|
100
|
+
* @type {Boolean}
|
|
101
|
+
* @default false
|
|
102
|
+
*/
|
|
103
|
+
this.accelerating = false;
|
|
104
|
+
/*
|
|
105
|
+
* The current count of skipped events.
|
|
106
|
+
*
|
|
107
|
+
* @type {Number}
|
|
108
|
+
* @default 0
|
|
109
|
+
*/
|
|
110
|
+
|
|
111
|
+
this.skipped = 0;
|
|
112
|
+
/*
|
|
113
|
+
* The timestamp of the last evaluated event.
|
|
114
|
+
*
|
|
115
|
+
* @type {Number}
|
|
116
|
+
* @default 0
|
|
117
|
+
*/
|
|
118
|
+
|
|
119
|
+
this.time = 0;
|
|
120
|
+
/*
|
|
121
|
+
* The keyCode of the last evaluated event.
|
|
122
|
+
*
|
|
123
|
+
* @type {Number}
|
|
124
|
+
* @default 0
|
|
125
|
+
*/
|
|
126
|
+
|
|
127
|
+
this.keyCode = 0;
|
|
128
|
+
/*
|
|
129
|
+
* Whether the instance is in a state of being canceled.
|
|
130
|
+
*
|
|
131
|
+
* @type {Boolean}
|
|
132
|
+
* @default false
|
|
133
|
+
*/
|
|
134
|
+
|
|
135
|
+
this.canceled = false;
|
|
136
|
+
/*
|
|
137
|
+
* Controls the frequency with which the acceleration will "freeze". While frozen,
|
|
138
|
+
* the current target item cannot change, and all events are directed to it.
|
|
139
|
+
*
|
|
140
|
+
* @type {Number[]}
|
|
141
|
+
* @default [3, 3, 3, 2, 2, 2, 1]
|
|
142
|
+
* @public
|
|
143
|
+
*/
|
|
144
|
+
|
|
145
|
+
this.frequency = frequency;
|
|
166
146
|
}
|
|
147
|
+
/**
|
|
148
|
+
* Called with the current keydown event and callback, which will be called when the event is
|
|
149
|
+
* allowed through.
|
|
150
|
+
*
|
|
151
|
+
* @function
|
|
152
|
+
* @param {Object} event - The current event to validate.
|
|
153
|
+
* @param {Function} callback - The callback to execute.
|
|
154
|
+
* @returns {Boolean} `true` if the event was consumed by processKey and callback was not called
|
|
155
|
+
* @public
|
|
156
|
+
* @memberof spotlight/Accelerator.Accelerator.prototype
|
|
157
|
+
*/
|
|
158
|
+
;
|
|
167
159
|
|
|
168
|
-
|
|
169
|
-
|
|
160
|
+
exports.Accelerator = Accelerator;
|
|
161
|
+
var _default = Accelerator;
|
|
162
|
+
exports["default"] = _default;
|
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,28 @@
|
|
|
2
2
|
|
|
3
3
|
The following is a curated list of changes in the Enact spotlight module, newest changes on the top.
|
|
4
4
|
|
|
5
|
+
## [3.4.9-experimental-7] - 2021-11-24
|
|
6
|
+
|
|
7
|
+
### Fixed
|
|
8
|
+
|
|
9
|
+
- `spotlight/SpotlightRootDecorator` to show focus when last input type is `none`
|
|
10
|
+
|
|
11
|
+
## [3.4.9-experimental-6] - 2021-04-07
|
|
12
|
+
|
|
13
|
+
### Fixed
|
|
14
|
+
|
|
15
|
+
- `spotlight/SpotlightRootDecorator` to not change to none touch mode when tapping VKB button
|
|
16
|
+
|
|
17
|
+
## [3.4.9-experimental-5] - 2021-03-17
|
|
18
|
+
|
|
19
|
+
No significant changes.
|
|
20
|
+
|
|
21
|
+
## [3.4.9-experimental-4] - 2021-02-23
|
|
22
|
+
|
|
23
|
+
### Fixed
|
|
24
|
+
|
|
25
|
+
- `spotlight/SpotlightRootDecorator` to refer the last input type from webos
|
|
26
|
+
|
|
5
27
|
## [3.4.9-experimental-3] - 2021-01-26
|
|
6
28
|
|
|
7
29
|
### Fixed
|
|
File without changes
|
package/Pause/Pause.js
CHANGED
|
@@ -1,3 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.isPaused = isPaused;
|
|
7
|
+
exports.pause = pause;
|
|
8
|
+
exports.resume = _resume;
|
|
9
|
+
exports.Pause = exports["default"] = void 0;
|
|
10
|
+
|
|
11
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
12
|
+
|
|
13
|
+
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
|
14
|
+
|
|
15
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
|
16
|
+
|
|
1
17
|
/**
|
|
2
18
|
* Provides a class which allows consumers to safely pause and resume spotlight without resuming
|
|
3
19
|
* another consumer's pause.
|
|
@@ -42,23 +58,19 @@
|
|
|
42
58
|
* @exports pause
|
|
43
59
|
* @exports resume
|
|
44
60
|
*/
|
|
61
|
+
var paused = false; // Private, exported methods used by Spotlight to set and query the pause state from its public API
|
|
45
62
|
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
// Private, exported methods used by Spotlight to set and query the pause state from its public API
|
|
49
|
-
|
|
50
|
-
function pause () {
|
|
51
|
-
paused = true;
|
|
63
|
+
function pause() {
|
|
64
|
+
paused = true;
|
|
52
65
|
}
|
|
53
66
|
|
|
54
|
-
function
|
|
55
|
-
|
|
67
|
+
function _resume() {
|
|
68
|
+
paused = false;
|
|
56
69
|
}
|
|
57
70
|
|
|
58
|
-
function isPaused
|
|
59
|
-
|
|
71
|
+
function isPaused() {
|
|
72
|
+
return paused !== false;
|
|
60
73
|
}
|
|
61
|
-
|
|
62
74
|
/**
|
|
63
75
|
* Acts as a semaphore for Spotlight pause state ensuring that only the last Pause instance can
|
|
64
76
|
* resume Spotlight.
|
|
@@ -70,73 +82,83 @@ function isPaused () {
|
|
|
70
82
|
* @memberof spotlight/Pause
|
|
71
83
|
* @public
|
|
72
84
|
*/
|
|
73
|
-
class Pause {
|
|
74
|
-
|
|
75
|
-
/**
|
|
76
|
-
* Accepts a name for the instance
|
|
77
|
-
*
|
|
78
|
-
* The `name` is not used but may be useful for debugging which instance has currently paused
|
|
79
|
-
* Spotlight.
|
|
80
|
-
*
|
|
81
|
-
* @param {String} name The name of the pause instance
|
|
82
|
-
* @memberof spotlight/Pause.Pause.prototype
|
|
83
|
-
* @constructor
|
|
84
|
-
* @public
|
|
85
|
-
*/
|
|
86
|
-
constructor (name) {
|
|
87
|
-
this.name = name;
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
toString () {
|
|
91
|
-
return `Pause<${this.name}>`;
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
/**
|
|
95
|
-
* Returns `true` when Spotlight is paused by this instance
|
|
96
|
-
*
|
|
97
|
-
* @returns {Boolean}
|
|
98
|
-
* @memberof spotlight/Pause.Pause.prototype
|
|
99
|
-
* @public
|
|
100
|
-
*/
|
|
101
|
-
isPaused () {
|
|
102
|
-
return paused === this;
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
/**
|
|
106
|
-
* Pauses spotlight if not currently paused
|
|
107
|
-
*
|
|
108
|
-
* @returns {undefined}
|
|
109
|
-
* @memberof spotlight/Pause.Pause.prototype
|
|
110
|
-
* @public
|
|
111
|
-
*/
|
|
112
|
-
pause () {
|
|
113
|
-
if (!isPaused()) {
|
|
114
|
-
paused = this;
|
|
115
|
-
}
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
/**
|
|
119
|
-
* Resumes spotlight if this instance was the last to pause spotlight
|
|
120
|
-
*
|
|
121
|
-
* @returns {Boolean} `true` if spotlight was resumed
|
|
122
|
-
* @memberof spotlight/Pause.Pause.prototype
|
|
123
|
-
* @public
|
|
124
|
-
*/
|
|
125
|
-
resume () {
|
|
126
|
-
if (this.isPaused()) {
|
|
127
|
-
resume();
|
|
128
|
-
|
|
129
|
-
return true;
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
return false;
|
|
133
|
-
}
|
|
134
|
-
}
|
|
135
85
|
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
86
|
+
|
|
87
|
+
var Pause = /*#__PURE__*/function () {
|
|
88
|
+
/**
|
|
89
|
+
* Accepts a name for the instance
|
|
90
|
+
*
|
|
91
|
+
* The `name` is not used but may be useful for debugging which instance has currently paused
|
|
92
|
+
* Spotlight.
|
|
93
|
+
*
|
|
94
|
+
* @param {String} name The name of the pause instance
|
|
95
|
+
* @memberof spotlight/Pause.Pause.prototype
|
|
96
|
+
* @constructor
|
|
97
|
+
* @public
|
|
98
|
+
*/
|
|
99
|
+
function Pause(name) {
|
|
100
|
+
_classCallCheck(this, Pause);
|
|
101
|
+
|
|
102
|
+
this.name = name;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
_createClass(Pause, [{
|
|
106
|
+
key: "toString",
|
|
107
|
+
value: function toString() {
|
|
108
|
+
return "Pause<".concat(this.name, ">");
|
|
109
|
+
}
|
|
110
|
+
/**
|
|
111
|
+
* Returns `true` when Spotlight is paused by this instance
|
|
112
|
+
*
|
|
113
|
+
* @returns {Boolean}
|
|
114
|
+
* @memberof spotlight/Pause.Pause.prototype
|
|
115
|
+
* @public
|
|
116
|
+
*/
|
|
117
|
+
|
|
118
|
+
}, {
|
|
119
|
+
key: "isPaused",
|
|
120
|
+
value: function isPaused() {
|
|
121
|
+
return paused === this;
|
|
122
|
+
}
|
|
123
|
+
/**
|
|
124
|
+
* Pauses spotlight if not currently paused
|
|
125
|
+
*
|
|
126
|
+
* @returns {undefined}
|
|
127
|
+
* @memberof spotlight/Pause.Pause.prototype
|
|
128
|
+
* @public
|
|
129
|
+
*/
|
|
130
|
+
|
|
131
|
+
}, {
|
|
132
|
+
key: "pause",
|
|
133
|
+
value: function pause() {
|
|
134
|
+
if (!isPaused()) {
|
|
135
|
+
paused = this;
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
/**
|
|
139
|
+
* Resumes spotlight if this instance was the last to pause spotlight
|
|
140
|
+
*
|
|
141
|
+
* @returns {Boolean} `true` if spotlight was resumed
|
|
142
|
+
* @memberof spotlight/Pause.Pause.prototype
|
|
143
|
+
* @public
|
|
144
|
+
*/
|
|
145
|
+
|
|
146
|
+
}, {
|
|
147
|
+
key: "resume",
|
|
148
|
+
value: function resume() {
|
|
149
|
+
if (this.isPaused()) {
|
|
150
|
+
_resume();
|
|
151
|
+
|
|
152
|
+
return true;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
return false;
|
|
156
|
+
}
|
|
157
|
+
}]);
|
|
158
|
+
|
|
159
|
+
return Pause;
|
|
160
|
+
}();
|
|
161
|
+
|
|
162
|
+
exports.Pause = Pause;
|
|
163
|
+
var _default = Pause;
|
|
164
|
+
exports["default"] = _default;
|