graphico 1.1.0 → 1.1.1
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/dist/canvas.js +10 -4
- package/package.json +1 -1
- package/types/types.d.ts +4 -0
package/dist/canvas.js
CHANGED
|
@@ -164,10 +164,15 @@ var Canvas = /** @class */ (function () {
|
|
|
164
164
|
_this.animation = requestAnimationFrame(function (time) { return _this.startAnimate(time); });
|
|
165
165
|
});
|
|
166
166
|
main.addEventListener('focusout', function (e) {
|
|
167
|
-
_this.
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
167
|
+
if (_this.config.keepFocused) {
|
|
168
|
+
main.focus();
|
|
169
|
+
}
|
|
170
|
+
else {
|
|
171
|
+
_this.focused = false;
|
|
172
|
+
main.style.borderColor = _this.config.borderBlur;
|
|
173
|
+
_this.log(e.type, _this.focused);
|
|
174
|
+
cancelAnimationFrame(_this.animation);
|
|
175
|
+
}
|
|
171
176
|
});
|
|
172
177
|
window.addEventListener('blur', function (e) {
|
|
173
178
|
_this.log(e.type);
|
|
@@ -441,6 +446,7 @@ var Canvas = /** @class */ (function () {
|
|
|
441
446
|
border: 'transparent',
|
|
442
447
|
borderBlur: 'transparent',
|
|
443
448
|
showMouse: true,
|
|
449
|
+
keepFocused: false,
|
|
444
450
|
numLayers: 1,
|
|
445
451
|
numTracks: 1,
|
|
446
452
|
keydown: function () { return; },
|
package/package.json
CHANGED
package/types/types.d.ts
CHANGED
|
@@ -38,6 +38,10 @@ export interface Options {
|
|
|
38
38
|
* Optionally show or hide the mouse when hovering over the canvas
|
|
39
39
|
*/
|
|
40
40
|
readonly showMouse: boolean;
|
|
41
|
+
/**
|
|
42
|
+
* Refocus the canvas when it loses focus
|
|
43
|
+
*/
|
|
44
|
+
readonly keepFocused: boolean;
|
|
41
45
|
/**
|
|
42
46
|
* The number of layers in this canvas
|
|
43
47
|
*/
|