@realsee/dnalogel 3.73.1 → 3.73.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/CHANGELOG.md +8 -0
- package/dist/MeasurePlugin/Controller.d.ts +3 -4
- package/dist/MeasurePlugin/index.d.ts +2 -1
- package/dist/Sculpt/utils/export.d.ts +1 -0
- package/dist/index.cjs.js +71 -71
- package/dist/index.js +4893 -4894
- package/dist/index.umd.js +76 -76
- package/dist/shared-utils/three/index.d.ts +2 -0
- package/libs/AreaMakerPlugin/Controller.js +3 -2
- package/libs/AreaMakerPlugin/index.js +3 -2
- package/libs/AreaMakerPlugin/utils/Item.js +80 -79
- package/libs/CSS3DRenderPlugin/Controller.js +3 -2
- package/libs/CSS3DRenderPlugin/index.js +6 -5
- package/libs/CSS3DRenderPlugin/utils/three/CSS3DObject.js +3 -2
- package/libs/CSS3DRenderPlugin/utils/three/CSS3DRender.js +1 -0
- package/libs/CruisePlugin/BaseController.js +5 -4
- package/libs/CruisePlugin/Move.js +1 -1
- package/libs/CruisePlugin/Work.js +1 -1
- package/libs/CruisePlugin/index.js +1 -1
- package/libs/CurrentPanoImagePlugin/Controller.js +3 -2
- package/libs/CurrentPanoImagePlugin/index.js +4 -3
- package/libs/GuideLinePlugin/Controller.js +1 -1
- package/libs/GuideLinePlugin/GuideLineItem.js +1 -1
- package/libs/GuideLinePlugin/GuideLineModeItem/index.js +3 -2
- package/libs/GuideLinePlugin/GuideLineModeItem.js +1 -1
- package/libs/GuideLinePlugin/index.js +1 -1
- package/libs/MeasurePlugin/Controller.d.ts +3 -4
- package/libs/MeasurePlugin/Controller.js +29 -29
- package/libs/MeasurePlugin/index.d.ts +2 -1
- package/libs/MeasurePlugin/index.js +6 -5
- package/libs/MeasurePlugin/utils/MeasureMesh.js +1 -1
- package/libs/ModelChassisCompassPlugin/Plugin.js +4 -3
- package/libs/ModelChassisCompassPlugin/index.js +1 -0
- package/libs/ModelEntryDoorGuidePlugin/Plugin.js +6 -5
- package/libs/ModelEntryDoorGuidePlugin/index.js +1 -0
- package/libs/ModelMakerPlugin/Controller.js +1 -1
- package/libs/ModelMakerPlugin/index.js +1 -1
- package/libs/ModelMakerPlugin/item/baseItem.js +3 -2
- package/libs/ModelMakerPlugin/item/boxItem.js +3 -2
- package/libs/ModelMakerPlugin/item/polygonItem.js +3 -2
- package/libs/ModelMakerPlugin/item/prismItem.js +3 -2
- package/libs/ModelTVVideoPlugin/Plugin.js +4 -3
- package/libs/ModelTVVideoPlugin/index.js +3 -2
- package/libs/ModelViewPlugin/Plugin.js +4 -3
- package/libs/ModelViewPlugin/index.js +1 -0
- package/libs/Object3DHelperPlugin/Controller.js +18 -17
- package/libs/Object3DHelperPlugin/index.js +6 -5
- package/libs/PanoCompassPlugin/Controller.js +3 -2
- package/libs/PanoCompassPlugin/index.js +4 -3
- package/libs/PanoDoorLabelPlugin/Controller.js +3 -2
- package/libs/PanoDoorLabelPlugin/index.js +4 -3
- package/libs/PanoMeasurePlugin/Controller/EditController.js +1 -1
- package/libs/PanoMeasurePlugin/Controller/WatchController.js +1 -1
- package/libs/PanoMeasurePlugin/Controller/index.js +1 -1
- package/libs/PanoMeasurePlugin/Modules/Magnifier.js +1 -0
- package/libs/PanoMeasurePlugin/index.js +1 -1
- package/libs/PanoMeasurePlugin/utils/dom/areaDom.js +3 -2
- package/libs/PanoRulerProPlugin/Controller.js +3 -2
- package/libs/PanoRulerProPlugin/RulerItems.js +3 -2
- package/libs/PanoRulerProPlugin/index.js +4 -3
- package/libs/PanoSpatialTagPlugin/Plugin.js +4 -3
- package/libs/PanoSpatialTagPlugin/index.js +1 -0
- package/libs/PanoTagPlugin/Components/Common/TagPoint.js +3 -2
- package/libs/PanoTagPlugin/Components/Common/TagPopover/PopoverContent.js +3 -2
- package/libs/PanoTagPlugin/Components/Common/TagPopover/TagPopoverToolBar.js +3 -2
- package/libs/PanoTagPlugin/Components/Common/TagPopover/index.js +3 -2
- package/libs/PanoTagPlugin/Components/Tag/MarketingTag.js +233 -232
- package/libs/PanoTagPlugin/Components/Tag/index.js +3 -2
- package/libs/PanoTagPlugin/Components/TagContainer.js +3 -2
- package/libs/PanoTagPlugin/Components/TagItem.js +3 -2
- package/libs/PanoTagPlugin/controller/Tag/BaseTag.js +3 -2
- package/libs/PanoTagPlugin/controller/Tag/ModelTag.js +22 -21
- package/libs/PanoTagPlugin/controller/Tag/PlaneTag.js +1 -1
- package/libs/PanoTagPlugin/controller/Tag/PointTag.js +3 -2
- package/libs/PanoTagPlugin/controller/TagRender.js +3 -2
- package/libs/PanoTagPlugin/controller/TagUtil.js +3 -2
- package/libs/PanoTagPlugin/controller/index.js +1 -1
- package/libs/PanoTagPlugin/index.js +1 -1
- package/libs/PanoTagPlugin/utils/tag/calculateTagConfig.js +3 -2
- package/libs/PanoTagPlugin/utils/tag/format.js +3 -2
- package/libs/PanoVideoPlugin/Controller.js +3 -2
- package/libs/PanoVideoPlugin/VideoMeshController.js +3 -2
- package/libs/PanoVideoPlugin/index.js +6 -5
- package/libs/PipelinePlugin/Controller.js +95 -94
- package/libs/PipelinePlugin/index.js +4 -3
- package/libs/PipelinePlugin/utils/Objects/FlowPipe.js +3 -2
- package/libs/PipelinePlugin/utils/Objects/HighlightPipe.js +3 -2
- package/libs/PipelinePlugin/utils/Objects/Pipe.js +22 -21
- package/libs/Sculpt/Meshes/Circle.js +3 -2
- package/libs/Sculpt/Meshes/Cylinder.js +3 -2
- package/libs/Sculpt/Meshes/Line.js +3 -2
- package/libs/Sculpt/Meshes/LineWithDots.js +5 -4
- package/libs/Sculpt/Meshes/Point.js +3 -2
- package/libs/Sculpt/Meshes/Rectangle.js +4 -3
- package/libs/Sculpt/Objects/Base/index.js +1 -0
- package/libs/Sculpt/Objects/Line/Editor.js +7 -6
- package/libs/Sculpt/index.js +19 -18
- package/libs/Sculpt/utils/export.d.ts +1 -0
- package/libs/Sculpt/utils/export.js +23 -20
- package/libs/Sculpt/utils/three/ColoredMesh.js +3 -2
- package/libs/base/BasePlugin.js +8 -7
- package/libs/floorplan/FloorplanGuidePlugin/Controller.js +3 -2
- package/libs/floorplan/FloorplanGuidePlugin/index.js +4 -3
- package/libs/floorplan/MapviewFloorplanPlugin/Controller.js +3 -2
- package/libs/floorplan/MapviewFloorplanPlugin/index.js +4 -3
- package/libs/floorplan/ModelFloorplanPlugin/Controller.js +3 -2
- package/libs/floorplan/ModelFloorplanPlugin/index.js +4 -3
- package/libs/floorplan/PanoFloorplanRadarPlugin/Controller.js +3 -2
- package/libs/floorplan/PanoFloorplanRadarPlugin/index.js +4 -3
- package/libs/floorplan/TopviewFloorplanPlugin/Controller.js +3 -2
- package/libs/floorplan/TopviewFloorplanPlugin/index.js +4 -3
- package/libs/floorplan/index.js +1 -0
- package/libs/index.js +146 -145
- package/libs/shared-utils/CSS3DRender/CSS3DObject.js +3 -2
- package/libs/shared-utils/exports.js +62 -55
- package/libs/shared-utils/five/index.js +4 -3
- package/libs/shared-utils/five/lookObject.js +3 -2
- package/libs/shared-utils/index.js +1 -0
- package/libs/shared-utils/logger.js +1 -1
- package/libs/shared-utils/tag.js +3 -2
- package/libs/shared-utils/three/PointDomHelper.js +3 -2
- package/libs/shared-utils/three/PointSelector/utils/PointSelectorHelper.js +3 -2
- package/libs/shared-utils/three/geometryUtil.js +12 -8
- package/libs/shared-utils/three/index.d.ts +2 -0
- package/libs/shared-utils/three/index.js +1 -0
- package/libs/vendor/hotkeys-js/dist/hotkeys.esm.js +139 -151
- package/package.json +1 -1
|
@@ -1,14 +1,17 @@
|
|
|
1
1
|
import { Vector3 as l } from "three";
|
|
2
2
|
import { centerPoint as p } from "./centerPoint.js";
|
|
3
3
|
function b(n) {
|
|
4
|
-
|
|
4
|
+
return a(n).reduce((e, [r, i, o]) => e + u(r, i, o), 0);
|
|
5
|
+
}
|
|
6
|
+
function h(n) {
|
|
7
|
+
const t = a(n);
|
|
5
8
|
if (t.length === 0) {
|
|
6
9
|
console.warn("No geometry triangles found"), console.debug({ geometry: n, triangles: t });
|
|
7
10
|
return;
|
|
8
11
|
}
|
|
9
12
|
let e = 0, r = new l();
|
|
10
13
|
for (const [i, o, c] of t) {
|
|
11
|
-
const s = u(i, o, c), g =
|
|
14
|
+
const s = u(i, o, c), g = A(i, o, c, s);
|
|
12
15
|
e += s, r.add(g);
|
|
13
16
|
}
|
|
14
17
|
return r = r.divideScalar(e), { center: r, area: e };
|
|
@@ -16,24 +19,25 @@ function b(n) {
|
|
|
16
19
|
function u(n, t, e) {
|
|
17
20
|
return t.clone().sub(n).cross(e.clone().sub(n)).length() / 2;
|
|
18
21
|
}
|
|
19
|
-
function
|
|
22
|
+
function A(n, t, e, r) {
|
|
20
23
|
const i = r != null ? r : u(n, t, e);
|
|
21
24
|
return p(n, t, e).multiplyScalar(i);
|
|
22
25
|
}
|
|
23
|
-
function
|
|
26
|
+
function a(n) {
|
|
24
27
|
var i;
|
|
25
28
|
const t = n.getAttribute("position"), e = (i = n.getIndex()) == null ? void 0 : i.array;
|
|
26
29
|
if (!t || !e)
|
|
27
30
|
return [];
|
|
28
31
|
let r = [];
|
|
29
32
|
for (let o = 0; o < e.length; o += 3) {
|
|
30
|
-
const c = e[o], s = e[o + 1], g = e[o + 2], f = new l().fromArray([t.getX(c), t.getY(c), t.getZ(c)]),
|
|
31
|
-
r.push([f,
|
|
33
|
+
const c = e[o], s = e[o + 1], g = e[o + 2], f = new l().fromArray([t.getX(c), t.getY(c), t.getZ(c)]), m = new l().fromArray([t.getX(s), t.getY(s), t.getZ(s)]), d = new l().fromArray([t.getX(g), t.getY(g), t.getZ(g)]);
|
|
34
|
+
r.push([f, m, d]);
|
|
32
35
|
}
|
|
33
36
|
return r;
|
|
34
37
|
}
|
|
35
38
|
export {
|
|
36
|
-
b as
|
|
39
|
+
b as getGeometryArea,
|
|
40
|
+
h as getGeometryInfo,
|
|
37
41
|
u as triangleArea,
|
|
38
|
-
|
|
42
|
+
A as triangleCenter
|
|
39
43
|
};
|
|
@@ -1,32 +1,32 @@
|
|
|
1
1
|
const j = typeof navigator != "undefined" ? navigator.userAgent.toLowerCase().indexOf("firefox") > 0 : !1;
|
|
2
|
-
function A(e, t,
|
|
3
|
-
e.addEventListener ? e.addEventListener(t,
|
|
2
|
+
function A(e, t, i, n) {
|
|
3
|
+
e.addEventListener ? e.addEventListener(t, i, n) : e.attachEvent && e.attachEvent("on".concat(t), i);
|
|
4
4
|
}
|
|
5
|
-
function
|
|
6
|
-
e.removeEventListener ? e.removeEventListener(t,
|
|
5
|
+
function O(e, t, i, n) {
|
|
6
|
+
e.removeEventListener ? e.removeEventListener(t, i, n) : e.detachEvent && e.detachEvent("on".concat(t), i);
|
|
7
7
|
}
|
|
8
8
|
function B(e, t) {
|
|
9
|
-
const
|
|
10
|
-
for (let n = 0; n <
|
|
11
|
-
|
|
12
|
-
return
|
|
9
|
+
const i = t.slice(0, t.length - 1);
|
|
10
|
+
for (let n = 0; n < i.length; n++)
|
|
11
|
+
i[n] = e[i[n].toLowerCase()];
|
|
12
|
+
return i;
|
|
13
13
|
}
|
|
14
14
|
function D(e) {
|
|
15
15
|
typeof e != "string" && (e = ""), e = e.replace(/\s/g, "");
|
|
16
16
|
const t = e.split(",");
|
|
17
|
-
let
|
|
18
|
-
for (;
|
|
19
|
-
t[
|
|
17
|
+
let i = t.lastIndexOf("");
|
|
18
|
+
for (; i >= 0; )
|
|
19
|
+
t[i - 1] += ",", t.splice(i, 1), i = t.lastIndexOf("");
|
|
20
20
|
return t;
|
|
21
21
|
}
|
|
22
22
|
function H(e, t) {
|
|
23
|
-
const
|
|
24
|
-
let
|
|
25
|
-
for (let r = 0; r <
|
|
26
|
-
n.indexOf(
|
|
27
|
-
return
|
|
23
|
+
const i = e.length >= t.length ? e : t, n = e.length >= t.length ? t : e;
|
|
24
|
+
let s = !0;
|
|
25
|
+
for (let r = 0; r < i.length; r++)
|
|
26
|
+
n.indexOf(i[r]) === -1 && (s = !1);
|
|
27
|
+
return s;
|
|
28
28
|
}
|
|
29
|
-
const
|
|
29
|
+
const b = {
|
|
30
30
|
backspace: 8,
|
|
31
31
|
"⌫": 8,
|
|
32
32
|
tab: 9,
|
|
@@ -41,11 +41,6 @@ const x = {
|
|
|
41
41
|
up: 38,
|
|
42
42
|
right: 39,
|
|
43
43
|
down: 40,
|
|
44
|
-
/// https://w3c.github.io/uievents/#events-keyboard-key-location
|
|
45
|
-
arrowup: 38,
|
|
46
|
-
arrowdown: 40,
|
|
47
|
-
arrowleft: 37,
|
|
48
|
-
arrowright: 39,
|
|
49
44
|
del: 46,
|
|
50
45
|
delete: 46,
|
|
51
46
|
ins: 45,
|
|
@@ -80,12 +75,10 @@ const x = {
|
|
|
80
75
|
"=": j ? 61 : 187,
|
|
81
76
|
";": j ? 59 : 186,
|
|
82
77
|
"'": 222,
|
|
83
|
-
"{": 219,
|
|
84
|
-
"}": 221,
|
|
85
78
|
"[": 219,
|
|
86
79
|
"]": 221,
|
|
87
80
|
"\\": 220
|
|
88
|
-
},
|
|
81
|
+
}, g = {
|
|
89
82
|
// shiftKey
|
|
90
83
|
"⇧": 16,
|
|
91
84
|
shift: 16,
|
|
@@ -100,9 +93,8 @@ const x = {
|
|
|
100
93
|
// metaKey
|
|
101
94
|
"⌘": 91,
|
|
102
95
|
cmd: 91,
|
|
103
|
-
meta: 91,
|
|
104
96
|
command: 91
|
|
105
|
-
},
|
|
97
|
+
}, C = {
|
|
106
98
|
16: "shiftKey",
|
|
107
99
|
18: "altKey",
|
|
108
100
|
17: "ctrlKey",
|
|
@@ -111,20 +103,20 @@ const x = {
|
|
|
111
103
|
ctrlKey: 17,
|
|
112
104
|
altKey: 18,
|
|
113
105
|
metaKey: 91
|
|
114
|
-
},
|
|
106
|
+
}, u = {
|
|
115
107
|
16: !1,
|
|
116
108
|
18: !1,
|
|
117
109
|
17: !1,
|
|
118
110
|
91: !1
|
|
119
111
|
}, c = {};
|
|
120
112
|
for (let e = 1; e < 20; e++)
|
|
121
|
-
|
|
122
|
-
let f = [],
|
|
123
|
-
const w = /* @__PURE__ */ new Map(),
|
|
113
|
+
b["f".concat(e)] = 111 + e;
|
|
114
|
+
let f = [], E = null, z = "all";
|
|
115
|
+
const w = /* @__PURE__ */ new Map(), L = (e) => b[e.toLowerCase()] || g[e.toLowerCase()] || e.toUpperCase().charCodeAt(0), I = (e) => Object.keys(b).find((t) => b[t] === e), R = (e) => Object.keys(g).find((t) => g[t] === e);
|
|
124
116
|
function F(e) {
|
|
125
117
|
z = e || "all";
|
|
126
118
|
}
|
|
127
|
-
function
|
|
119
|
+
function x() {
|
|
128
120
|
return z || "all";
|
|
129
121
|
}
|
|
130
122
|
function V() {
|
|
@@ -136,172 +128,168 @@ function X() {
|
|
|
136
128
|
function q() {
|
|
137
129
|
const e = [];
|
|
138
130
|
return Object.keys(c).forEach((t) => {
|
|
139
|
-
c[t].forEach((
|
|
131
|
+
c[t].forEach((i) => {
|
|
140
132
|
let {
|
|
141
133
|
key: n,
|
|
142
|
-
scope:
|
|
134
|
+
scope: s,
|
|
143
135
|
mods: r,
|
|
144
136
|
shortcut: l
|
|
145
|
-
} =
|
|
137
|
+
} = i;
|
|
146
138
|
e.push({
|
|
147
|
-
scope:
|
|
139
|
+
scope: s,
|
|
148
140
|
shortcut: l,
|
|
149
141
|
mods: r,
|
|
150
|
-
keys: n.split("+").map((o) =>
|
|
142
|
+
keys: n.split("+").map((o) => L(o))
|
|
151
143
|
});
|
|
152
144
|
});
|
|
153
145
|
}), e;
|
|
154
146
|
}
|
|
155
|
-
function
|
|
147
|
+
function v(e) {
|
|
156
148
|
const t = e.target || e.srcElement, {
|
|
157
|
-
tagName:
|
|
149
|
+
tagName: i
|
|
158
150
|
} = t;
|
|
159
151
|
let n = !0;
|
|
160
|
-
const
|
|
161
|
-
return (t.isContentEditable || (
|
|
152
|
+
const s = i === "INPUT" && !["checkbox", "radio", "range", "button", "file", "reset", "submit", "color"].includes(t.type);
|
|
153
|
+
return (t.isContentEditable || (s || i === "TEXTAREA" || i === "SELECT") && !t.readOnly) && (n = !1), n;
|
|
162
154
|
}
|
|
163
|
-
function
|
|
164
|
-
return typeof e == "string" && (e =
|
|
155
|
+
function J(e) {
|
|
156
|
+
return typeof e == "string" && (e = L(e)), f.indexOf(e) !== -1;
|
|
165
157
|
}
|
|
166
|
-
function
|
|
167
|
-
let
|
|
168
|
-
e || (e =
|
|
169
|
-
for (const
|
|
170
|
-
if (Object.prototype.hasOwnProperty.call(c,
|
|
171
|
-
for (
|
|
172
|
-
|
|
158
|
+
function Q(e, t) {
|
|
159
|
+
let i, n;
|
|
160
|
+
e || (e = x());
|
|
161
|
+
for (const s in c)
|
|
162
|
+
if (Object.prototype.hasOwnProperty.call(c, s))
|
|
163
|
+
for (i = c[s], n = 0; n < i.length; )
|
|
164
|
+
i[n].scope === e ? i.splice(n, 1).forEach((l) => {
|
|
173
165
|
let {
|
|
174
166
|
element: o
|
|
175
167
|
} = l;
|
|
176
168
|
return S(o);
|
|
177
169
|
}) : n++;
|
|
178
|
-
|
|
170
|
+
x() === e && F(t || "all");
|
|
179
171
|
}
|
|
180
|
-
function
|
|
172
|
+
function W(e) {
|
|
181
173
|
let t = e.keyCode || e.which || e.charCode;
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
y[n] === t && (k[n] = !1);
|
|
174
|
+
const i = f.indexOf(t);
|
|
175
|
+
if (i >= 0 && f.splice(i, 1), e.key && e.key.toLowerCase() === "meta" && f.splice(0, f.length), (t === 93 || t === 224) && (t = 91), t in u) {
|
|
176
|
+
u[t] = !1;
|
|
177
|
+
for (const n in g)
|
|
178
|
+
g[n] === t && (K[n] = !1);
|
|
188
179
|
}
|
|
189
180
|
}
|
|
190
181
|
function G(e) {
|
|
191
182
|
if (typeof e == "undefined")
|
|
192
|
-
Object.keys(c).forEach((
|
|
193
|
-
Array.isArray(c[
|
|
183
|
+
Object.keys(c).forEach((s) => {
|
|
184
|
+
Array.isArray(c[s]) && c[s].forEach((r) => _(r)), delete c[s];
|
|
194
185
|
}), S(null);
|
|
195
186
|
else if (Array.isArray(e))
|
|
196
|
-
e.forEach((
|
|
197
|
-
|
|
187
|
+
e.forEach((s) => {
|
|
188
|
+
s.key && _(s);
|
|
198
189
|
});
|
|
199
190
|
else if (typeof e == "object")
|
|
200
|
-
e.key &&
|
|
191
|
+
e.key && _(e);
|
|
201
192
|
else if (typeof e == "string") {
|
|
202
|
-
for (var t = arguments.length,
|
|
203
|
-
|
|
204
|
-
let [
|
|
205
|
-
typeof
|
|
193
|
+
for (var t = arguments.length, i = new Array(t > 1 ? t - 1 : 0), n = 1; n < t; n++)
|
|
194
|
+
i[n - 1] = arguments[n];
|
|
195
|
+
let [s, r] = i;
|
|
196
|
+
typeof s == "function" && (r = s, s = ""), _({
|
|
206
197
|
key: e,
|
|
207
|
-
scope:
|
|
198
|
+
scope: s,
|
|
208
199
|
method: r,
|
|
209
200
|
splitKey: "+"
|
|
210
201
|
});
|
|
211
202
|
}
|
|
212
203
|
}
|
|
213
|
-
const
|
|
204
|
+
const _ = (e) => {
|
|
214
205
|
let {
|
|
215
206
|
key: t,
|
|
216
|
-
scope:
|
|
207
|
+
scope: i,
|
|
217
208
|
method: n,
|
|
218
|
-
splitKey:
|
|
209
|
+
splitKey: s = "+"
|
|
219
210
|
} = e;
|
|
220
211
|
D(t).forEach((l) => {
|
|
221
|
-
const o = l.split(
|
|
222
|
-
if (!c[
|
|
212
|
+
const o = l.split(s), a = o.length, y = o[a - 1], h = y === "*" ? "*" : L(y);
|
|
213
|
+
if (!c[h])
|
|
223
214
|
return;
|
|
224
|
-
|
|
225
|
-
const p =
|
|
226
|
-
c[
|
|
227
|
-
const
|
|
228
|
-
return
|
|
215
|
+
i || (i = x());
|
|
216
|
+
const p = a > 1 ? B(g, o) : [], m = [];
|
|
217
|
+
c[h] = c[h].filter((d) => {
|
|
218
|
+
const k = (n ? d.method === n : !0) && d.scope === i && H(d.mods, p);
|
|
219
|
+
return k && m.push(d.element), !k;
|
|
229
220
|
}), m.forEach((d) => S(d));
|
|
230
221
|
});
|
|
231
222
|
};
|
|
232
|
-
function T(e, t,
|
|
223
|
+
function T(e, t, i, n) {
|
|
233
224
|
if (t.element !== n)
|
|
234
225
|
return;
|
|
235
|
-
let
|
|
236
|
-
if (t.scope ===
|
|
237
|
-
|
|
238
|
-
for (const r in
|
|
239
|
-
Object.prototype.hasOwnProperty.call(
|
|
240
|
-
(t.mods.length === 0 && !
|
|
226
|
+
let s;
|
|
227
|
+
if (t.scope === i || t.scope === "all") {
|
|
228
|
+
s = t.mods.length > 0;
|
|
229
|
+
for (const r in u)
|
|
230
|
+
Object.prototype.hasOwnProperty.call(u, r) && (!u[r] && t.mods.indexOf(+r) > -1 || u[r] && t.mods.indexOf(+r) === -1) && (s = !1);
|
|
231
|
+
(t.mods.length === 0 && !u[16] && !u[18] && !u[17] && !u[91] || s || t.shortcut === "*") && (t.keys = [], t.keys = t.keys.concat(f), t.method(e, t) === !1 && (e.preventDefault ? e.preventDefault() : e.returnValue = !1, e.stopPropagation && e.stopPropagation(), e.cancelBubble && (e.cancelBubble = !0)));
|
|
241
232
|
}
|
|
242
233
|
}
|
|
243
234
|
function U(e, t) {
|
|
244
|
-
const
|
|
235
|
+
const i = c["*"];
|
|
245
236
|
let n = e.keyCode || e.which || e.charCode;
|
|
246
|
-
if (
|
|
237
|
+
if (!K.filter.call(this, e))
|
|
247
238
|
return;
|
|
248
239
|
if ((n === 93 || n === 224) && (n = 91), f.indexOf(n) === -1 && n !== 229 && f.push(n), ["metaKey", "ctrlKey", "altKey", "shiftKey"].forEach((o) => {
|
|
249
|
-
const
|
|
250
|
-
e[o] && f.indexOf(
|
|
251
|
-
}), n in
|
|
252
|
-
|
|
253
|
-
for (const o in
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
k[o] = e[u];
|
|
257
|
-
}
|
|
258
|
-
if (!s)
|
|
240
|
+
const a = C[o];
|
|
241
|
+
e[o] && f.indexOf(a) === -1 ? f.push(a) : !e[o] && f.indexOf(a) > -1 ? f.splice(f.indexOf(a), 1) : o === "metaKey" && e[o] && (f = f.filter((y) => y in C || y === n));
|
|
242
|
+
}), n in u) {
|
|
243
|
+
u[n] = !0;
|
|
244
|
+
for (const o in g)
|
|
245
|
+
g[o] === n && (K[o] = !0);
|
|
246
|
+
if (!i)
|
|
259
247
|
return;
|
|
260
248
|
}
|
|
261
|
-
for (const o in
|
|
262
|
-
Object.prototype.hasOwnProperty.call(
|
|
263
|
-
e.getModifierState && !(e.altKey && !e.ctrlKey) && e.getModifierState("AltGraph") && (f.indexOf(17) === -1 && f.push(17), f.indexOf(18) === -1 && f.push(18),
|
|
264
|
-
const
|
|
265
|
-
if (
|
|
266
|
-
for (let o = 0; o <
|
|
267
|
-
|
|
249
|
+
for (const o in u)
|
|
250
|
+
Object.prototype.hasOwnProperty.call(u, o) && (u[o] = e[C[o]]);
|
|
251
|
+
e.getModifierState && !(e.altKey && !e.ctrlKey) && e.getModifierState("AltGraph") && (f.indexOf(17) === -1 && f.push(17), f.indexOf(18) === -1 && f.push(18), u[17] = !0, u[18] = !0);
|
|
252
|
+
const s = x();
|
|
253
|
+
if (i)
|
|
254
|
+
for (let o = 0; o < i.length; o++)
|
|
255
|
+
i[o].scope === s && (e.type === "keydown" && i[o].keydown || e.type === "keyup" && i[o].keyup) && T(e, i[o], s, t);
|
|
268
256
|
if (!(n in c))
|
|
269
257
|
return;
|
|
270
258
|
const r = c[n], l = r.length;
|
|
271
259
|
for (let o = 0; o < l; o++)
|
|
272
260
|
if ((e.type === "keydown" && r[o].keydown || e.type === "keyup" && r[o].keyup) && r[o].key) {
|
|
273
|
-
const
|
|
274
|
-
splitKey:
|
|
275
|
-
} =
|
|
276
|
-
for (let m = 0; m <
|
|
277
|
-
p.push(
|
|
278
|
-
p.sort().join("") === f.sort().join("") && T(e,
|
|
261
|
+
const a = r[o], {
|
|
262
|
+
splitKey: y
|
|
263
|
+
} = a, h = a.key.split(y), p = [];
|
|
264
|
+
for (let m = 0; m < h.length; m++)
|
|
265
|
+
p.push(L(h[m]));
|
|
266
|
+
p.sort().join("") === f.sort().join("") && T(e, a, s, t);
|
|
279
267
|
}
|
|
280
268
|
}
|
|
281
|
-
function
|
|
269
|
+
function K(e, t, i) {
|
|
282
270
|
f = [];
|
|
283
271
|
const n = D(e);
|
|
284
|
-
let
|
|
285
|
-
for (
|
|
286
|
-
e = n[o].split(
|
|
287
|
-
keyup:
|
|
288
|
-
keydown:
|
|
272
|
+
let s = [], r = "all", l = document, o = 0, a = !1, y = !0, h = "+", p = !1, m = !1;
|
|
273
|
+
for (i === void 0 && typeof t == "function" && (i = t), Object.prototype.toString.call(t) === "[object Object]" && (t.scope && (r = t.scope), t.element && (l = t.element), t.keyup && (a = t.keyup), t.keydown !== void 0 && (y = t.keydown), t.capture !== void 0 && (p = t.capture), typeof t.splitKey == "string" && (h = t.splitKey), t.single === !0 && (m = !0)), typeof t == "string" && (r = t), m && G(e, r); o < n.length; o++)
|
|
274
|
+
e = n[o].split(h), s = [], e.length > 1 && (s = B(g, e)), e = e[e.length - 1], e = e === "*" ? "*" : L(e), e in c || (c[e] = []), c[e].push({
|
|
275
|
+
keyup: a,
|
|
276
|
+
keydown: y,
|
|
289
277
|
scope: r,
|
|
290
|
-
mods:
|
|
278
|
+
mods: s,
|
|
291
279
|
shortcut: n[o],
|
|
292
|
-
method:
|
|
280
|
+
method: i,
|
|
293
281
|
key: n[o],
|
|
294
|
-
splitKey:
|
|
282
|
+
splitKey: h,
|
|
295
283
|
element: l
|
|
296
284
|
});
|
|
297
285
|
if (typeof l != "undefined" && window) {
|
|
298
286
|
if (!w.has(l)) {
|
|
299
287
|
const d = function() {
|
|
300
|
-
let
|
|
301
|
-
return U(
|
|
288
|
+
let k = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : window.event;
|
|
289
|
+
return U(k, l);
|
|
302
290
|
}, M = function() {
|
|
303
|
-
let
|
|
304
|
-
U(
|
|
291
|
+
let k = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : window.event;
|
|
292
|
+
U(k, l), W(k);
|
|
305
293
|
};
|
|
306
294
|
w.set(l, {
|
|
307
295
|
keydownListener: d,
|
|
@@ -309,22 +297,22 @@ function k(e, t, s) {
|
|
|
309
297
|
capture: p
|
|
310
298
|
}), A(l, "keydown", d, p), A(l, "keyup", M, p);
|
|
311
299
|
}
|
|
312
|
-
if (!
|
|
300
|
+
if (!E) {
|
|
313
301
|
const d = () => {
|
|
314
302
|
f = [];
|
|
315
303
|
};
|
|
316
|
-
|
|
304
|
+
E = {
|
|
317
305
|
listener: d,
|
|
318
306
|
capture: p
|
|
319
307
|
}, A(window, "focus", d, p);
|
|
320
308
|
}
|
|
321
309
|
}
|
|
322
310
|
}
|
|
323
|
-
function
|
|
311
|
+
function Y(e) {
|
|
324
312
|
let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "all";
|
|
325
|
-
Object.keys(c).forEach((
|
|
326
|
-
c[
|
|
327
|
-
|
|
313
|
+
Object.keys(c).forEach((i) => {
|
|
314
|
+
c[i].filter((s) => s.scope === t && s.shortcut === e).forEach((s) => {
|
|
315
|
+
s && s.method && s.method();
|
|
328
316
|
});
|
|
329
317
|
});
|
|
330
318
|
}
|
|
@@ -332,53 +320,53 @@ function S(e) {
|
|
|
332
320
|
const t = Object.values(c).flat();
|
|
333
321
|
if (t.findIndex((n) => {
|
|
334
322
|
let {
|
|
335
|
-
element:
|
|
323
|
+
element: s
|
|
336
324
|
} = n;
|
|
337
|
-
return
|
|
325
|
+
return s === e;
|
|
338
326
|
}) < 0) {
|
|
339
327
|
const {
|
|
340
328
|
keydownListener: n,
|
|
341
|
-
keyupListenr:
|
|
329
|
+
keyupListenr: s,
|
|
342
330
|
capture: r
|
|
343
331
|
} = w.get(e) || {};
|
|
344
|
-
n &&
|
|
332
|
+
n && s && (O(e, "keyup", s, r), O(e, "keydown", n, r), w.delete(e));
|
|
345
333
|
}
|
|
346
|
-
if ((t.length <= 0 || w.size <= 0) && (Object.keys(w).forEach((
|
|
334
|
+
if ((t.length <= 0 || w.size <= 0) && (Object.keys(w).forEach((s) => {
|
|
347
335
|
const {
|
|
348
336
|
keydownListener: r,
|
|
349
337
|
keyupListenr: l,
|
|
350
338
|
capture: o
|
|
351
|
-
} = w.get(
|
|
352
|
-
r && l && (
|
|
353
|
-
}), w.clear(), Object.keys(c).forEach((
|
|
339
|
+
} = w.get(s) || {};
|
|
340
|
+
r && l && (O(s, "keyup", l, o), O(s, "keydown", r, o), w.delete(s));
|
|
341
|
+
}), w.clear(), Object.keys(c).forEach((s) => delete c[s]), E)) {
|
|
354
342
|
const {
|
|
355
|
-
listener:
|
|
343
|
+
listener: s,
|
|
356
344
|
capture: r
|
|
357
|
-
} =
|
|
358
|
-
|
|
345
|
+
} = E;
|
|
346
|
+
O(window, "focus", s, r), E = null;
|
|
359
347
|
}
|
|
360
348
|
}
|
|
361
349
|
const P = {
|
|
362
350
|
getPressedKeyString: X,
|
|
363
351
|
setScope: F,
|
|
364
|
-
getScope:
|
|
365
|
-
deleteScope:
|
|
352
|
+
getScope: x,
|
|
353
|
+
deleteScope: Q,
|
|
366
354
|
getPressedKeyCodes: V,
|
|
367
355
|
getAllKeyCodes: q,
|
|
368
|
-
isPressed:
|
|
369
|
-
filter:
|
|
370
|
-
trigger:
|
|
356
|
+
isPressed: J,
|
|
357
|
+
filter: v,
|
|
358
|
+
trigger: Y,
|
|
371
359
|
unbind: G,
|
|
372
|
-
keyMap:
|
|
373
|
-
modifier:
|
|
374
|
-
modifierMap:
|
|
360
|
+
keyMap: b,
|
|
361
|
+
modifier: g,
|
|
362
|
+
modifierMap: C
|
|
375
363
|
};
|
|
376
364
|
for (const e in P)
|
|
377
|
-
Object.prototype.hasOwnProperty.call(P, e) && (
|
|
365
|
+
Object.prototype.hasOwnProperty.call(P, e) && (K[e] = P[e]);
|
|
378
366
|
if (typeof window != "undefined") {
|
|
379
367
|
const e = window.hotkeys;
|
|
380
|
-
|
|
368
|
+
K.noConflict = (t) => (t && window.hotkeys === K && (window.hotkeys = e), K), window.hotkeys = K;
|
|
381
369
|
}
|
|
382
370
|
export {
|
|
383
|
-
|
|
371
|
+
K as hotkeys
|
|
384
372
|
};
|