@micromag/viewer 0.3.167 → 0.3.170
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/es/index.js +16 -7
- package/lib/index.js +16 -7
- package/package.json +10 -10
package/es/index.js
CHANGED
|
@@ -78,11 +78,11 @@ function useKeyboardShortcuts() {
|
|
|
78
78
|
|
|
79
79
|
function checkClickable(el) {
|
|
80
80
|
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
81
|
-
var
|
|
81
|
+
var parentDistance = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 1;
|
|
82
82
|
|
|
83
83
|
var _ref = options || {},
|
|
84
|
-
_ref$
|
|
85
|
-
|
|
84
|
+
_ref$maxParentDistanc = _ref.maxParentDistance,
|
|
85
|
+
maxParentDistance = _ref$maxParentDistanc === void 0 ? 5 : _ref$maxParentDistanc,
|
|
86
86
|
_ref$tags = _ref.tags,
|
|
87
87
|
tags = _ref$tags === void 0 ? ['BUTTON', 'A', 'INPUT', 'TEXTAREA'] : _ref$tags;
|
|
88
88
|
|
|
@@ -90,20 +90,29 @@ function checkClickable(el) {
|
|
|
90
90
|
_ref2$tagName = _ref2.tagName,
|
|
91
91
|
tagName = _ref2$tagName === void 0 ? null : _ref2$tagName,
|
|
92
92
|
_ref2$parentNode = _ref2.parentNode,
|
|
93
|
-
parentNode = _ref2$parentNode === void 0 ? null : _ref2$parentNode
|
|
93
|
+
parentNode = _ref2$parentNode === void 0 ? null : _ref2$parentNode,
|
|
94
|
+
_ref2$dataset = _ref2.dataset,
|
|
95
|
+
dataset = _ref2$dataset === void 0 ? {} : _ref2$dataset;
|
|
94
96
|
|
|
95
97
|
if (tagName === 'BODY') {
|
|
96
98
|
return false;
|
|
99
|
+
} // Check if video is suspended
|
|
100
|
+
|
|
101
|
+
|
|
102
|
+
console.log(tagName, dataset);
|
|
103
|
+
|
|
104
|
+
if (tagName === 'VIDEO' && typeof dataset.isSuspended !== 'undefined' && (dataset.isSuspended === 'true' || dataset.isSuspended === true)) {
|
|
105
|
+
return true;
|
|
97
106
|
}
|
|
98
107
|
|
|
99
108
|
if (tags.map(function (it) {
|
|
100
109
|
return it.toLowerCase();
|
|
101
|
-
}).indexOf(tagName.toLowerCase())
|
|
110
|
+
}).indexOf(tagName.toLowerCase()) !== -1) {
|
|
102
111
|
return true;
|
|
103
112
|
}
|
|
104
113
|
|
|
105
|
-
if (
|
|
106
|
-
return checkClickable(parentNode, options,
|
|
114
|
+
if (parentDistance < maxParentDistance) {
|
|
115
|
+
return checkClickable(parentNode, options, parentDistance + 1);
|
|
107
116
|
}
|
|
108
117
|
|
|
109
118
|
return false;
|
package/lib/index.js
CHANGED
|
@@ -98,11 +98,11 @@ function useKeyboardShortcuts() {
|
|
|
98
98
|
|
|
99
99
|
function checkClickable(el) {
|
|
100
100
|
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
101
|
-
var
|
|
101
|
+
var parentDistance = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 1;
|
|
102
102
|
|
|
103
103
|
var _ref = options || {},
|
|
104
|
-
_ref$
|
|
105
|
-
|
|
104
|
+
_ref$maxParentDistanc = _ref.maxParentDistance,
|
|
105
|
+
maxParentDistance = _ref$maxParentDistanc === void 0 ? 5 : _ref$maxParentDistanc,
|
|
106
106
|
_ref$tags = _ref.tags,
|
|
107
107
|
tags = _ref$tags === void 0 ? ['BUTTON', 'A', 'INPUT', 'TEXTAREA'] : _ref$tags;
|
|
108
108
|
|
|
@@ -110,20 +110,29 @@ function checkClickable(el) {
|
|
|
110
110
|
_ref2$tagName = _ref2.tagName,
|
|
111
111
|
tagName = _ref2$tagName === void 0 ? null : _ref2$tagName,
|
|
112
112
|
_ref2$parentNode = _ref2.parentNode,
|
|
113
|
-
parentNode = _ref2$parentNode === void 0 ? null : _ref2$parentNode
|
|
113
|
+
parentNode = _ref2$parentNode === void 0 ? null : _ref2$parentNode,
|
|
114
|
+
_ref2$dataset = _ref2.dataset,
|
|
115
|
+
dataset = _ref2$dataset === void 0 ? {} : _ref2$dataset;
|
|
114
116
|
|
|
115
117
|
if (tagName === 'BODY') {
|
|
116
118
|
return false;
|
|
119
|
+
} // Check if video is suspended
|
|
120
|
+
|
|
121
|
+
|
|
122
|
+
console.log(tagName, dataset);
|
|
123
|
+
|
|
124
|
+
if (tagName === 'VIDEO' && typeof dataset.isSuspended !== 'undefined' && (dataset.isSuspended === 'true' || dataset.isSuspended === true)) {
|
|
125
|
+
return true;
|
|
117
126
|
}
|
|
118
127
|
|
|
119
128
|
if (tags.map(function (it) {
|
|
120
129
|
return it.toLowerCase();
|
|
121
|
-
}).indexOf(tagName.toLowerCase())
|
|
130
|
+
}).indexOf(tagName.toLowerCase()) !== -1) {
|
|
122
131
|
return true;
|
|
123
132
|
}
|
|
124
133
|
|
|
125
|
-
if (
|
|
126
|
-
return checkClickable(parentNode, options,
|
|
134
|
+
if (parentDistance < maxParentDistance) {
|
|
135
|
+
return checkClickable(parentNode, options, parentDistance + 1);
|
|
127
136
|
}
|
|
128
137
|
|
|
129
138
|
return false;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@micromag/viewer",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.170",
|
|
4
4
|
"description": "",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"javascript"
|
|
@@ -59,14 +59,14 @@
|
|
|
59
59
|
"@fortawesome/fontawesome-svg-core": "^1.2.32",
|
|
60
60
|
"@fortawesome/free-solid-svg-icons": "^5.15.1",
|
|
61
61
|
"@fortawesome/react-fontawesome": "^0.1.13",
|
|
62
|
-
"@micromag/core": "^0.3.
|
|
63
|
-
"@micromag/element-scroll": "^0.3.
|
|
64
|
-
"@micromag/element-share-options": "^0.3.
|
|
65
|
-
"@micromag/element-webview": "^0.3.
|
|
66
|
-
"@micromag/elements": "^0.3.
|
|
67
|
-
"@micromag/fields": "^0.3.
|
|
68
|
-
"@micromag/intl": "^0.3.
|
|
69
|
-
"@micromag/screens": "^0.3.
|
|
62
|
+
"@micromag/core": "^0.3.169",
|
|
63
|
+
"@micromag/element-scroll": "^0.3.169",
|
|
64
|
+
"@micromag/element-share-options": "^0.3.169",
|
|
65
|
+
"@micromag/element-webview": "^0.3.169",
|
|
66
|
+
"@micromag/elements": "^0.3.170",
|
|
67
|
+
"@micromag/fields": "^0.3.169",
|
|
68
|
+
"@micromag/intl": "^0.3.169",
|
|
69
|
+
"@micromag/screens": "^0.3.170",
|
|
70
70
|
"@react-spring/core": "^9.1.1",
|
|
71
71
|
"@react-spring/web": "^9.1.1",
|
|
72
72
|
"@use-gesture/react": "^10.2.4",
|
|
@@ -84,5 +84,5 @@
|
|
|
84
84
|
"publishConfig": {
|
|
85
85
|
"access": "public"
|
|
86
86
|
},
|
|
87
|
-
"gitHead": "
|
|
87
|
+
"gitHead": "2aa04370d70f3bc7ee3992cad30b0877b23f5a20"
|
|
88
88
|
}
|