@soomo/react-text-annotator 3.1.0-staging.13 → 3.1.0-staging.14
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/TextAnnotatorPopup/TextAnnotatorPopup.d.ts.map +1 -1
- package/dist/react-text-annotator.es13.js +1482 -8
- package/dist/react-text-annotator.es13.js.map +1 -1
- package/dist/react-text-annotator.es14.js +8 -1447
- package/dist/react-text-annotator.es14.js.map +1 -1
- package/dist/react-text-annotator.es6.js +3 -4
- package/dist/react-text-annotator.es6.js.map +1 -1
- package/dist/react-text-annotator.es7.js +108 -107
- package/dist/react-text-annotator.es7.js.map +1 -1
- package/package.json +11 -11
|
@@ -1,45 +1,46 @@
|
|
|
1
|
-
const
|
|
2
|
-
const e = t.cloneContents();
|
|
3
|
-
return e.querySelectorAll(H).forEach((n) => n.remove()), e;
|
|
4
|
-
};
|
|
1
|
+
const se = "not-annotatable", Z = `.${se}`;
|
|
5
2
|
/mac/i.test(navigator.userAgentData ? navigator.userAgentData.platform : navigator.platform);
|
|
6
|
-
const
|
|
3
|
+
const _t = (t) => {
|
|
4
|
+
const e = t.cloneContents();
|
|
5
|
+
return e.querySelectorAll(Z).forEach((n) => n.remove()), e;
|
|
6
|
+
}, ke = (t, e, n = 10, o) => {
|
|
7
7
|
const i = e, s = document.createRange();
|
|
8
8
|
s.setStart(i, 0), s.setEnd(t.startContainer, t.startOffset);
|
|
9
|
-
const a =
|
|
9
|
+
const a = _t(s).textContent, r = document.createRange();
|
|
10
10
|
r.setStart(t.endContainer, t.endOffset), i === document.body ? r.setEnd(i, i.childNodes.length) : r.setEndAfter(i);
|
|
11
|
-
const l =
|
|
11
|
+
const l = _t(r).textContent;
|
|
12
12
|
return {
|
|
13
13
|
prefix: a.substring(a.length - n),
|
|
14
14
|
suffix: l.substring(0, n)
|
|
15
15
|
};
|
|
16
16
|
};
|
|
17
|
-
|
|
18
|
-
for (
|
|
19
|
-
|
|
17
|
+
const U = [];
|
|
18
|
+
for (let t = 0; t < 256; ++t)
|
|
19
|
+
U.push((t + 256).toString(16).slice(1));
|
|
20
20
|
function cn(t, e = 0) {
|
|
21
|
-
return (
|
|
21
|
+
return (U[t[e + 0]] + U[t[e + 1]] + U[t[e + 2]] + U[t[e + 3]] + "-" + U[t[e + 4]] + U[t[e + 5]] + "-" + U[t[e + 6]] + U[t[e + 7]] + "-" + U[t[e + 8]] + U[t[e + 9]] + "-" + U[t[e + 10]] + U[t[e + 11]] + U[t[e + 12]] + U[t[e + 13]] + U[t[e + 14]] + U[t[e + 15]]).toLowerCase();
|
|
22
22
|
}
|
|
23
|
-
|
|
23
|
+
let St;
|
|
24
|
+
const ln = new Uint8Array(16);
|
|
24
25
|
function dn() {
|
|
25
|
-
if (!
|
|
26
|
-
|
|
27
|
-
|
|
26
|
+
if (!St) {
|
|
27
|
+
if (typeof crypto > "u" || !crypto.getRandomValues)
|
|
28
|
+
throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
|
|
29
|
+
St = crypto.getRandomValues.bind(crypto);
|
|
30
|
+
}
|
|
31
|
+
return St(ln);
|
|
28
32
|
}
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
randomUUID
|
|
32
|
-
|
|
33
|
-
function pe(t, e, n) {
|
|
34
|
-
if (Zt.randomUUID && !e && !t)
|
|
35
|
-
return Zt.randomUUID();
|
|
33
|
+
const un = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto), Gt = { randomUUID: un };
|
|
34
|
+
function ue(t, e, n) {
|
|
35
|
+
if (Gt.randomUUID && !e && !t)
|
|
36
|
+
return Gt.randomUUID();
|
|
36
37
|
t = t || {};
|
|
37
|
-
|
|
38
|
+
const o = t.random || (t.rng || dn)();
|
|
38
39
|
return o[6] = o[6] & 15 | 64, o[8] = o[8] & 63 | 128, cn(o);
|
|
39
40
|
}
|
|
40
|
-
var
|
|
41
|
-
for (var
|
|
42
|
-
|
|
41
|
+
var V = [];
|
|
42
|
+
for (var Lt = 0; Lt < 256; ++Lt)
|
|
43
|
+
V.push((Lt + 256).toString(16).slice(1));
|
|
43
44
|
typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto);
|
|
44
45
|
const Nn = "useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";
|
|
45
46
|
let Yn = (t = 21) => {
|
|
@@ -56,7 +57,7 @@ const Xn = (t) => {
|
|
|
56
57
|
n = (n << 5) - n + s, n |= 0;
|
|
57
58
|
}
|
|
58
59
|
return `${n}`;
|
|
59
|
-
},
|
|
60
|
+
}, pe = (t) => t ? typeof t == "object" ? { ...t } : t : void 0, Pn = (t, e) => (Array.isArray(t) ? t : [t]).map((n) => {
|
|
60
61
|
const { id: o, type: i, purpose: s, value: a, created: r, modified: l, creator: f, ...u } = n;
|
|
61
62
|
return {
|
|
62
63
|
id: o || `temp-${Xn(n)}`,
|
|
@@ -64,7 +65,7 @@ const Xn = (t) => {
|
|
|
64
65
|
type: i,
|
|
65
66
|
purpose: s,
|
|
66
67
|
value: a,
|
|
67
|
-
creator:
|
|
68
|
+
creator: pe(f),
|
|
68
69
|
created: r ? new Date(r) : void 0,
|
|
69
70
|
updated: l ? new Date(l) : void 0,
|
|
70
71
|
...u
|
|
@@ -79,7 +80,7 @@ const Xn = (t) => {
|
|
|
79
80
|
return (n = r.id) != null && n.startsWith("temp-") && delete r.id, r;
|
|
80
81
|
});
|
|
81
82
|
Yn();
|
|
82
|
-
const
|
|
83
|
+
const Ao = (t, e) => ({
|
|
83
84
|
parse: (n) => zn(n),
|
|
84
85
|
serialize: (n) => Fn(n, t, e)
|
|
85
86
|
}), Hn = (t) => t.quote !== void 0 && t.start !== void 0 && t.end !== void 0, jn = (t) => {
|
|
@@ -90,7 +91,7 @@ const xo = (t, e) => ({
|
|
|
90
91
|
modified: i,
|
|
91
92
|
target: s
|
|
92
93
|
} = t, a = Array.isArray(s) ? s : [s], r = {
|
|
93
|
-
creator:
|
|
94
|
+
creator: pe(n),
|
|
94
95
|
created: o ? new Date(o) : void 0,
|
|
95
96
|
updated: i ? new Date(i) : void 0,
|
|
96
97
|
annotation: e,
|
|
@@ -120,7 +121,7 @@ const xo = (t, e) => ({
|
|
|
120
121
|
}
|
|
121
122
|
return { parsed: r };
|
|
122
123
|
}, zn = (t) => {
|
|
123
|
-
const e = t.id ||
|
|
124
|
+
const e = t.id || ue(), {
|
|
124
125
|
creator: n,
|
|
125
126
|
created: o,
|
|
126
127
|
modified: i,
|
|
@@ -143,7 +144,7 @@ const xo = (t, e) => ({
|
|
|
143
144
|
updated: f,
|
|
144
145
|
...u
|
|
145
146
|
} = i, h = a.map((g) => {
|
|
146
|
-
const { quote: p, start: v, end: y, range: m } = g, { prefix: d, suffix: c } = ke(m, n),
|
|
147
|
+
const { quote: p, start: v, end: y, range: m } = g, { prefix: d, suffix: c } = ke(m, n), b = [{
|
|
147
148
|
type: "TextQuoteSelector",
|
|
148
149
|
exact: p,
|
|
149
150
|
prefix: d,
|
|
@@ -157,7 +158,7 @@ const xo = (t, e) => ({
|
|
|
157
158
|
...u,
|
|
158
159
|
id: g.id,
|
|
159
160
|
source: e,
|
|
160
|
-
selector:
|
|
161
|
+
selector: b
|
|
161
162
|
};
|
|
162
163
|
});
|
|
163
164
|
return {
|
|
@@ -172,19 +173,19 @@ const xo = (t, e) => ({
|
|
|
172
173
|
target: h
|
|
173
174
|
};
|
|
174
175
|
};
|
|
175
|
-
const
|
|
176
|
-
function
|
|
176
|
+
const Bt = typeof navigator < "u" ? navigator.userAgent.toLowerCase().indexOf("firefox") > 0 : false;
|
|
177
|
+
function kt(t, e, n, o) {
|
|
177
178
|
t.addEventListener ? t.addEventListener(e, n, o) : t.attachEvent && t.attachEvent("on".concat(e), n);
|
|
178
179
|
}
|
|
179
|
-
function
|
|
180
|
+
function et(t, e, n, o) {
|
|
180
181
|
t.removeEventListener ? t.removeEventListener(e, n, o) : t.detachEvent && t.detachEvent("on".concat(e), n);
|
|
181
182
|
}
|
|
182
|
-
function
|
|
183
|
+
function me(t, e) {
|
|
183
184
|
const n = e.slice(0, e.length - 1);
|
|
184
185
|
for (let o = 0; o < n.length; o++) n[o] = t[n[o].toLowerCase()];
|
|
185
186
|
return n;
|
|
186
187
|
}
|
|
187
|
-
function
|
|
188
|
+
function ye(t) {
|
|
188
189
|
typeof t != "string" && (t = ""), t = t.replace(/\s/g, "");
|
|
189
190
|
const e = t.split(",");
|
|
190
191
|
let n = e.lastIndexOf("");
|
|
@@ -244,14 +245,14 @@ const at = {
|
|
|
244
245
|
".": 190,
|
|
245
246
|
"/": 191,
|
|
246
247
|
"`": 192,
|
|
247
|
-
"-":
|
|
248
|
-
"=":
|
|
249
|
-
";":
|
|
248
|
+
"-": Bt ? 173 : 189,
|
|
249
|
+
"=": Bt ? 61 : 187,
|
|
250
|
+
";": Bt ? 59 : 186,
|
|
250
251
|
"'": 222,
|
|
251
252
|
"[": 219,
|
|
252
253
|
"]": 221,
|
|
253
254
|
"\\": 220
|
|
254
|
-
},
|
|
255
|
+
}, H = {
|
|
255
256
|
// shiftKey
|
|
256
257
|
"⇧": 16,
|
|
257
258
|
shift: 16,
|
|
@@ -267,7 +268,7 @@ const at = {
|
|
|
267
268
|
"⌘": 91,
|
|
268
269
|
cmd: 91,
|
|
269
270
|
command: 91
|
|
270
|
-
},
|
|
271
|
+
}, Ut = {
|
|
271
272
|
16: "shiftKey",
|
|
272
273
|
18: "altKey",
|
|
273
274
|
17: "ctrlKey",
|
|
@@ -276,7 +277,7 @@ const at = {
|
|
|
276
277
|
ctrlKey: 17,
|
|
277
278
|
altKey: 18,
|
|
278
279
|
metaKey: 91
|
|
279
|
-
},
|
|
280
|
+
}, K = {
|
|
280
281
|
16: false,
|
|
281
282
|
18: false,
|
|
282
283
|
17: false,
|
|
@@ -284,13 +285,13 @@ const at = {
|
|
|
284
285
|
}, _ = {};
|
|
285
286
|
for (let t = 1; t < 20; t++)
|
|
286
287
|
at["f".concat(t)] = 111 + t;
|
|
287
|
-
let I = [], rt = null,
|
|
288
|
-
const
|
|
289
|
-
function
|
|
290
|
-
|
|
288
|
+
let I = [], rt = null, be = "all";
|
|
289
|
+
const z = /* @__PURE__ */ new Map(), lt = (t) => at[t.toLowerCase()] || H[t.toLowerCase()] || t.toUpperCase().charCodeAt(0), ro = (t) => Object.keys(at).find((e) => at[e] === t), ao = (t) => Object.keys(H).find((e) => H[e] === t);
|
|
290
|
+
function we(t) {
|
|
291
|
+
be = t || "all";
|
|
291
292
|
}
|
|
292
293
|
function ct() {
|
|
293
|
-
return
|
|
294
|
+
return be || "all";
|
|
294
295
|
}
|
|
295
296
|
function co() {
|
|
296
297
|
return I.slice(0);
|
|
@@ -338,34 +339,34 @@ function po(t, e) {
|
|
|
338
339
|
let {
|
|
339
340
|
element: r
|
|
340
341
|
} = a;
|
|
341
|
-
return
|
|
342
|
+
return Dt(r);
|
|
342
343
|
}) : o++;
|
|
343
|
-
ct() === t &&
|
|
344
|
+
ct() === t && we(e || "all");
|
|
344
345
|
}
|
|
345
346
|
function go(t) {
|
|
346
347
|
let e = t.keyCode || t.which || t.charCode;
|
|
347
348
|
const n = I.indexOf(e);
|
|
348
|
-
if (n >= 0 && I.splice(n, 1), t.key && t.key.toLowerCase() === "meta" && I.splice(0, I.length), (e === 93 || e === 224) && (e = 91), e in
|
|
349
|
-
|
|
350
|
-
for (const o in
|
|
349
|
+
if (n >= 0 && I.splice(n, 1), t.key && t.key.toLowerCase() === "meta" && I.splice(0, I.length), (e === 93 || e === 224) && (e = 91), e in K) {
|
|
350
|
+
K[e] = false;
|
|
351
|
+
for (const o in H) H[o] === e && (P[o] = false);
|
|
351
352
|
}
|
|
352
353
|
}
|
|
353
|
-
function
|
|
354
|
+
function ve(t) {
|
|
354
355
|
if (typeof t > "u")
|
|
355
356
|
Object.keys(_).forEach((i) => {
|
|
356
|
-
Array.isArray(_[i]) && _[i].forEach((s) =>
|
|
357
|
-
}),
|
|
357
|
+
Array.isArray(_[i]) && _[i].forEach((s) => mt(s)), delete _[i];
|
|
358
|
+
}), Dt(null);
|
|
358
359
|
else if (Array.isArray(t))
|
|
359
360
|
t.forEach((i) => {
|
|
360
|
-
i.key &&
|
|
361
|
+
i.key && mt(i);
|
|
361
362
|
});
|
|
362
363
|
else if (typeof t == "object")
|
|
363
|
-
t.key &&
|
|
364
|
+
t.key && mt(t);
|
|
364
365
|
else if (typeof t == "string") {
|
|
365
366
|
for (var e = arguments.length, n = new Array(e > 1 ? e - 1 : 0), o = 1; o < e; o++)
|
|
366
367
|
n[o - 1] = arguments[o];
|
|
367
368
|
let [i, s] = n;
|
|
368
|
-
typeof i == "function" && (s = i, i = ""),
|
|
369
|
+
typeof i == "function" && (s = i, i = ""), mt({
|
|
369
370
|
key: t,
|
|
370
371
|
scope: i,
|
|
371
372
|
method: s,
|
|
@@ -373,55 +374,55 @@ function Ee(t) {
|
|
|
373
374
|
});
|
|
374
375
|
}
|
|
375
376
|
}
|
|
376
|
-
const
|
|
377
|
+
const mt = (t) => {
|
|
377
378
|
let {
|
|
378
379
|
key: e,
|
|
379
380
|
scope: n,
|
|
380
381
|
method: o,
|
|
381
382
|
splitKey: i = "+"
|
|
382
383
|
} = t;
|
|
383
|
-
|
|
384
|
+
ye(e).forEach((a) => {
|
|
384
385
|
const r = a.split(i), l = r.length, f = r[l - 1], u = f === "*" ? "*" : lt(f);
|
|
385
386
|
if (!_[u]) return;
|
|
386
387
|
n || (n = ct());
|
|
387
|
-
const h = l > 1 ?
|
|
388
|
+
const h = l > 1 ? me(H, r) : [], g = [];
|
|
388
389
|
_[u] = _[u].filter((p) => {
|
|
389
390
|
const y = (o ? p.method === o : true) && p.scope === n && so(p.mods, h);
|
|
390
391
|
return y && g.push(p.element), !y;
|
|
391
|
-
}), g.forEach((p) =>
|
|
392
|
+
}), g.forEach((p) => Dt(p));
|
|
392
393
|
});
|
|
393
394
|
};
|
|
394
|
-
function
|
|
395
|
+
function ee(t, e, n, o) {
|
|
395
396
|
if (e.element !== o)
|
|
396
397
|
return;
|
|
397
398
|
let i;
|
|
398
399
|
if (e.scope === n || e.scope === "all") {
|
|
399
400
|
i = e.mods.length > 0;
|
|
400
|
-
for (const s in
|
|
401
|
-
Object.prototype.hasOwnProperty.call(
|
|
402
|
-
(e.mods.length === 0 && !
|
|
401
|
+
for (const s in K)
|
|
402
|
+
Object.prototype.hasOwnProperty.call(K, s) && (!K[s] && e.mods.indexOf(+s) > -1 || K[s] && e.mods.indexOf(+s) === -1) && (i = false);
|
|
403
|
+
(e.mods.length === 0 && !K[16] && !K[18] && !K[17] && !K[91] || i || e.shortcut === "*") && (e.keys = [], e.keys = e.keys.concat(I), e.method(t, e) === false && (t.preventDefault ? t.preventDefault() : t.returnValue = false, t.stopPropagation && t.stopPropagation(), t.cancelBubble && (t.cancelBubble = true)));
|
|
403
404
|
}
|
|
404
405
|
}
|
|
405
|
-
function
|
|
406
|
+
function ne(t, e) {
|
|
406
407
|
const n = _["*"];
|
|
407
408
|
let o = t.keyCode || t.which || t.charCode;
|
|
408
409
|
if (!P.filter.call(this, t)) return;
|
|
409
410
|
if ((o === 93 || o === 224) && (o = 91), I.indexOf(o) === -1 && o !== 229 && I.push(o), ["ctrlKey", "altKey", "shiftKey", "metaKey"].forEach((r) => {
|
|
410
|
-
const l =
|
|
411
|
+
const l = Ut[r];
|
|
411
412
|
t[r] && I.indexOf(l) === -1 ? I.push(l) : !t[r] && I.indexOf(l) > -1 ? I.splice(I.indexOf(l), 1) : r === "metaKey" && t[r] && I.length === 3 && (t.ctrlKey || t.shiftKey || t.altKey || (I = I.slice(I.indexOf(l))));
|
|
412
|
-
}), o in
|
|
413
|
-
|
|
414
|
-
for (const r in
|
|
415
|
-
|
|
413
|
+
}), o in K) {
|
|
414
|
+
K[o] = true;
|
|
415
|
+
for (const r in H)
|
|
416
|
+
H[r] === o && (P[r] = true);
|
|
416
417
|
if (!n) return;
|
|
417
418
|
}
|
|
418
|
-
for (const r in
|
|
419
|
-
Object.prototype.hasOwnProperty.call(
|
|
420
|
-
t.getModifierState && !(t.altKey && !t.ctrlKey) && t.getModifierState("AltGraph") && (I.indexOf(17) === -1 && I.push(17), I.indexOf(18) === -1 && I.push(18),
|
|
419
|
+
for (const r in K)
|
|
420
|
+
Object.prototype.hasOwnProperty.call(K, r) && (K[r] = t[Ut[r]]);
|
|
421
|
+
t.getModifierState && !(t.altKey && !t.ctrlKey) && t.getModifierState("AltGraph") && (I.indexOf(17) === -1 && I.push(17), I.indexOf(18) === -1 && I.push(18), K[17] = true, K[18] = true);
|
|
421
422
|
const i = ct();
|
|
422
423
|
if (n)
|
|
423
424
|
for (let r = 0; r < n.length; r++)
|
|
424
|
-
n[r].scope === i && (t.type === "keydown" && n[r].keydown || t.type === "keyup" && n[r].keyup) &&
|
|
425
|
+
n[r].scope === i && (t.type === "keydown" && n[r].keydown || t.type === "keyup" && n[r].keyup) && ee(t, n[r], i, e);
|
|
425
426
|
if (!(o in _)) return;
|
|
426
427
|
const s = _[o], a = s.length;
|
|
427
428
|
for (let r = 0; r < a; r++)
|
|
@@ -431,15 +432,15 @@ function se(t, e) {
|
|
|
431
432
|
} = l, u = l.key.split(f), h = [];
|
|
432
433
|
for (let g = 0; g < u.length; g++)
|
|
433
434
|
h.push(lt(u[g]));
|
|
434
|
-
h.sort().join("") === I.sort().join("") &&
|
|
435
|
+
h.sort().join("") === I.sort().join("") && ee(t, l, i, e);
|
|
435
436
|
}
|
|
436
437
|
}
|
|
437
438
|
function P(t, e, n) {
|
|
438
439
|
I = [];
|
|
439
|
-
const o =
|
|
440
|
+
const o = ye(t);
|
|
440
441
|
let i = [], s = "all", a = document, r = 0, l = false, f = true, u = "+", h = false, g = false;
|
|
441
|
-
for (n === void 0 && typeof e == "function" && (n = e), Object.prototype.toString.call(e) === "[object Object]" && (e.scope && (s = e.scope), e.element && (a = e.element), e.keyup && (l = e.keyup), e.keydown !== void 0 && (f = e.keydown), e.capture !== void 0 && (h = e.capture), typeof e.splitKey == "string" && (u = e.splitKey), e.single === true && (g = true)), typeof e == "string" && (s = e), g &&
|
|
442
|
-
t = o[r].split(u), i = [], t.length > 1 && (i =
|
|
442
|
+
for (n === void 0 && typeof e == "function" && (n = e), Object.prototype.toString.call(e) === "[object Object]" && (e.scope && (s = e.scope), e.element && (a = e.element), e.keyup && (l = e.keyup), e.keydown !== void 0 && (f = e.keydown), e.capture !== void 0 && (h = e.capture), typeof e.splitKey == "string" && (u = e.splitKey), e.single === true && (g = true)), typeof e == "string" && (s = e), g && ve(t, s); r < o.length; r++)
|
|
443
|
+
t = o[r].split(u), i = [], t.length > 1 && (i = me(H, t)), t = t[t.length - 1], t = t === "*" ? "*" : lt(t), t in _ || (_[t] = []), _[t].push({
|
|
443
444
|
keyup: l,
|
|
444
445
|
keydown: f,
|
|
445
446
|
scope: s,
|
|
@@ -451,19 +452,19 @@ function P(t, e, n) {
|
|
|
451
452
|
element: a
|
|
452
453
|
});
|
|
453
454
|
if (typeof a < "u" && window) {
|
|
454
|
-
if (!
|
|
455
|
+
if (!z.has(a)) {
|
|
455
456
|
const p = function() {
|
|
456
457
|
let y = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : window.event;
|
|
457
|
-
return
|
|
458
|
+
return ne(y, a);
|
|
458
459
|
}, v = function() {
|
|
459
460
|
let y = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : window.event;
|
|
460
|
-
|
|
461
|
+
ne(y, a), go(y);
|
|
461
462
|
};
|
|
462
|
-
|
|
463
|
+
z.set(a, {
|
|
463
464
|
keydownListener: p,
|
|
464
465
|
keyupListenr: v,
|
|
465
466
|
capture: h
|
|
466
|
-
}),
|
|
467
|
+
}), kt(a, "keydown", p, h), kt(a, "keyup", v, h);
|
|
467
468
|
}
|
|
468
469
|
if (!rt) {
|
|
469
470
|
const p = () => {
|
|
@@ -472,7 +473,7 @@ function P(t, e, n) {
|
|
|
472
473
|
rt = {
|
|
473
474
|
listener: p,
|
|
474
475
|
capture: h
|
|
475
|
-
},
|
|
476
|
+
}, kt(window, "focus", p, h);
|
|
476
477
|
}
|
|
477
478
|
}
|
|
478
479
|
}
|
|
@@ -484,7 +485,7 @@ function mo(t) {
|
|
|
484
485
|
});
|
|
485
486
|
});
|
|
486
487
|
}
|
|
487
|
-
function
|
|
488
|
+
function Dt(t) {
|
|
488
489
|
const e = Object.values(_).flat();
|
|
489
490
|
if (e.findIndex((o) => {
|
|
490
491
|
let {
|
|
@@ -496,27 +497,27 @@ function $t(t) {
|
|
|
496
497
|
keydownListener: o,
|
|
497
498
|
keyupListenr: i,
|
|
498
499
|
capture: s
|
|
499
|
-
} =
|
|
500
|
-
o && i && (
|
|
500
|
+
} = z.get(t) || {};
|
|
501
|
+
o && i && (et(t, "keyup", i, s), et(t, "keydown", o, s), z.delete(t));
|
|
501
502
|
}
|
|
502
|
-
if ((e.length <= 0 ||
|
|
503
|
+
if ((e.length <= 0 || z.size <= 0) && (Object.keys(z).forEach((i) => {
|
|
503
504
|
const {
|
|
504
505
|
keydownListener: s,
|
|
505
506
|
keyupListenr: a,
|
|
506
507
|
capture: r
|
|
507
|
-
} =
|
|
508
|
-
s && a && (
|
|
509
|
-
}),
|
|
508
|
+
} = z.get(i) || {};
|
|
509
|
+
s && a && (et(i, "keyup", a, r), et(i, "keydown", s, r), z.delete(i));
|
|
510
|
+
}), z.clear(), Object.keys(_).forEach((i) => delete _[i]), rt)) {
|
|
510
511
|
const {
|
|
511
512
|
listener: i,
|
|
512
513
|
capture: s
|
|
513
514
|
} = rt;
|
|
514
|
-
|
|
515
|
+
et(window, "focus", i, s), rt = null;
|
|
515
516
|
}
|
|
516
517
|
}
|
|
517
|
-
const
|
|
518
|
+
const It = {
|
|
518
519
|
getPressedKeyString: lo,
|
|
519
|
-
setScope:
|
|
520
|
+
setScope: we,
|
|
520
521
|
getScope: ct,
|
|
521
522
|
deleteScope: po,
|
|
522
523
|
getPressedKeyCodes: co,
|
|
@@ -524,23 +525,23 @@ const Ut = {
|
|
|
524
525
|
isPressed: ho,
|
|
525
526
|
filter: fo,
|
|
526
527
|
trigger: mo,
|
|
527
|
-
unbind:
|
|
528
|
+
unbind: ve,
|
|
528
529
|
keyMap: at,
|
|
529
|
-
modifier:
|
|
530
|
-
modifierMap:
|
|
530
|
+
modifier: H,
|
|
531
|
+
modifierMap: Ut
|
|
531
532
|
};
|
|
532
|
-
for (const t in
|
|
533
|
-
Object.prototype.hasOwnProperty.call(
|
|
533
|
+
for (const t in It)
|
|
534
|
+
Object.prototype.hasOwnProperty.call(It, t) && (P[t] = It[t]);
|
|
534
535
|
if (typeof window < "u") {
|
|
535
536
|
const t = window.hotkeys;
|
|
536
537
|
P.noConflict = (e) => (e && window.hotkeys === P && (window.hotkeys = t), P), window.hotkeys = P;
|
|
537
538
|
}
|
|
538
539
|
export {
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
540
|
+
se as NOT_ANNOTATABLE_CLASS,
|
|
541
|
+
Z as NOT_ANNOTATABLE_SELECTOR,
|
|
542
|
+
Ao as W3CTextFormat,
|
|
542
543
|
ke as getQuoteContext,
|
|
543
|
-
|
|
544
|
+
_t as getRangeAnnotatableContents,
|
|
544
545
|
zn as parseW3CTextAnnotation,
|
|
545
546
|
Fn as serializeW3CTextAnnotation
|
|
546
547
|
};
|