@soomo/react-text-annotator 3.2.0-staging.1 → 3.2.0-staging.2
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/react-text-annotator.es10.js +78 -497
- package/dist/react-text-annotator.es10.js.map +1 -1
- package/dist/react-text-annotator.es11.js +40 -77
- package/dist/react-text-annotator.es11.js.map +1 -1
- package/dist/react-text-annotator.es12.js +21 -41
- package/dist/react-text-annotator.es12.js.map +1 -1
- package/dist/react-text-annotator.es13.js +495 -19
- package/dist/react-text-annotator.es13.js.map +1 -1
- package/dist/react-text-annotator.es2.js +1 -1
- package/dist/react-text-annotator.es21.js +1 -1
- package/dist/react-text-annotator.es22.js +1 -1
- package/dist/react-text-annotator.es23.js +2 -114
- package/dist/react-text-annotator.es23.js.map +1 -1
- package/dist/react-text-annotator.es24.js +2 -309
- package/dist/react-text-annotator.es24.js.map +1 -1
- package/dist/react-text-annotator.es25.js +109 -53
- package/dist/react-text-annotator.es25.js.map +1 -1
- package/dist/react-text-annotator.es26.js +306 -17
- package/dist/react-text-annotator.es26.js.map +1 -1
- package/dist/react-text-annotator.es27.js +58 -2
- package/dist/react-text-annotator.es27.js.map +1 -1
- package/dist/react-text-annotator.es28.js +20 -2
- package/dist/react-text-annotator.es28.js.map +1 -1
- package/dist/react-text-annotator.es4.js +2 -2
- package/dist/react-text-annotator.es5.js +1 -1
- package/package.json +2 -2
|
@@ -1,85 +1,48 @@
|
|
|
1
|
-
|
|
2
|
-
let
|
|
3
|
-
|
|
4
|
-
if (!$319e236875307eab$var$liveAnnouncer) {
|
|
5
|
-
$319e236875307eab$var$liveAnnouncer = new $319e236875307eab$var$LiveAnnouncer();
|
|
6
|
-
if (!(typeof IS_REACT_ACT_ENVIRONMENT === "boolean" ? IS_REACT_ACT_ENVIRONMENT : typeof jest !== "undefined")) setTimeout(() => {
|
|
7
|
-
if ($319e236875307eab$var$liveAnnouncer === null || $319e236875307eab$var$liveAnnouncer === void 0 ? void 0 : $319e236875307eab$var$liveAnnouncer.isAttached()) $319e236875307eab$var$liveAnnouncer === null || $319e236875307eab$var$liveAnnouncer === void 0 ? void 0 : $319e236875307eab$var$liveAnnouncer.announce(message, assertiveness, timeout);
|
|
8
|
-
}, 100);
|
|
9
|
-
else $319e236875307eab$var$liveAnnouncer.announce(message, assertiveness, timeout);
|
|
10
|
-
} else $319e236875307eab$var$liveAnnouncer.announce(message, assertiveness, timeout);
|
|
11
|
-
}
|
|
12
|
-
function $319e236875307eab$export$d8686216b8b81b2f() {
|
|
13
|
-
if ($319e236875307eab$var$liveAnnouncer) {
|
|
14
|
-
$319e236875307eab$var$liveAnnouncer.destroy();
|
|
15
|
-
$319e236875307eab$var$liveAnnouncer = null;
|
|
1
|
+
function* range(minimum, maximum) {
|
|
2
|
+
for (let number = minimum; number <= maximum; number++) {
|
|
3
|
+
yield number;
|
|
16
4
|
}
|
|
17
5
|
}
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
return
|
|
29
|
-
}
|
|
30
|
-
destroy() {
|
|
31
|
-
if (!this.node) return;
|
|
32
|
-
document.body.removeChild(this.node);
|
|
33
|
-
this.node = null;
|
|
34
|
-
}
|
|
35
|
-
announce(message, assertiveness = "assertive", timeout = $319e236875307eab$var$LIVEREGION_TIMEOUT_DELAY) {
|
|
36
|
-
var _this_assertiveLog, _this_politeLog;
|
|
37
|
-
if (!this.node) return;
|
|
38
|
-
let node = document.createElement("div");
|
|
39
|
-
if (typeof message === "object") {
|
|
40
|
-
node.setAttribute("role", "img");
|
|
41
|
-
node.setAttribute("aria-labelledby", message["aria-labelledby"]);
|
|
42
|
-
} else node.textContent = message;
|
|
43
|
-
if (assertiveness === "assertive") (_this_assertiveLog = this.assertiveLog) === null || _this_assertiveLog === void 0 ? void 0 : _this_assertiveLog.appendChild(node);
|
|
44
|
-
else (_this_politeLog = this.politeLog) === null || _this_politeLog === void 0 ? void 0 : _this_politeLog.appendChild(node);
|
|
45
|
-
if (message !== "") setTimeout(() => {
|
|
46
|
-
node.remove();
|
|
47
|
-
}, timeout);
|
|
48
|
-
}
|
|
49
|
-
clear(assertiveness) {
|
|
50
|
-
if (!this.node) return;
|
|
51
|
-
if ((!assertiveness || assertiveness === "assertive") && this.assertiveLog) this.assertiveLog.innerHTML = "";
|
|
52
|
-
if ((!assertiveness || assertiveness === "polite") && this.politeLog) this.politeLog.innerHTML = "";
|
|
6
|
+
function randomInteger(minimum, maximum) {
|
|
7
|
+
return Math.floor(Math.random() * (maximum - minimum + 1)) + minimum;
|
|
8
|
+
}
|
|
9
|
+
function randomIntegerWithout(minimum, maximum, excludedValue) {
|
|
10
|
+
const number = randomInteger(minimum, maximum - 1);
|
|
11
|
+
return number >= excludedValue ? number + 1 : number;
|
|
12
|
+
}
|
|
13
|
+
function makeCallable(generator) {
|
|
14
|
+
const iterator = generator();
|
|
15
|
+
function random() {
|
|
16
|
+
return iterator.next().value;
|
|
53
17
|
}
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
this.politeLog = null;
|
|
58
|
-
if (typeof document !== "undefined") {
|
|
59
|
-
this.node = document.createElement("div");
|
|
60
|
-
this.node.dataset.liveAnnouncer = "true";
|
|
61
|
-
Object.assign(this.node.style, {
|
|
62
|
-
border: 0,
|
|
63
|
-
clip: "rect(0 0 0 0)",
|
|
64
|
-
clipPath: "inset(50%)",
|
|
65
|
-
height: "1px",
|
|
66
|
-
margin: "-1px",
|
|
67
|
-
overflow: "hidden",
|
|
68
|
-
padding: 0,
|
|
69
|
-
position: "absolute",
|
|
70
|
-
width: "1px",
|
|
71
|
-
whiteSpace: "nowrap"
|
|
72
|
-
});
|
|
73
|
-
this.assertiveLog = this.createLog("assertive");
|
|
74
|
-
this.node.appendChild(this.assertiveLog);
|
|
75
|
-
this.politeLog = this.createLog("polite");
|
|
76
|
-
this.node.appendChild(this.politeLog);
|
|
77
|
-
document.body.prepend(this.node);
|
|
18
|
+
random[Symbol.iterator] = function* () {
|
|
19
|
+
while (true) {
|
|
20
|
+
yield random();
|
|
78
21
|
}
|
|
79
|
-
}
|
|
22
|
+
};
|
|
23
|
+
return random;
|
|
24
|
+
}
|
|
25
|
+
function exhaustiveUniqueRandom(minimum, maximum) {
|
|
26
|
+
return makeCallable(function* () {
|
|
27
|
+
let unconsumedValues = [...range(minimum, maximum)];
|
|
28
|
+
while (true) {
|
|
29
|
+
while (unconsumedValues.length > 1) {
|
|
30
|
+
yield unconsumedValues.splice(
|
|
31
|
+
randomInteger(0, unconsumedValues.length - 1),
|
|
32
|
+
1
|
|
33
|
+
)[0];
|
|
34
|
+
}
|
|
35
|
+
const [previousValue] = unconsumedValues;
|
|
36
|
+
yield previousValue;
|
|
37
|
+
unconsumedValues = [...range(minimum, maximum)];
|
|
38
|
+
yield unconsumedValues.splice(
|
|
39
|
+
randomIntegerWithout(0, unconsumedValues.length - 1, previousValue - minimum),
|
|
40
|
+
1
|
|
41
|
+
)[0];
|
|
42
|
+
}
|
|
43
|
+
});
|
|
80
44
|
}
|
|
81
45
|
export {
|
|
82
|
-
|
|
83
|
-
$319e236875307eab$export$d8686216b8b81b2f as destroyAnnouncer
|
|
46
|
+
exhaustiveUniqueRandom
|
|
84
47
|
};
|
|
85
48
|
//# sourceMappingURL=react-text-annotator.es11.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"react-text-annotator.es11.js","sources":["../../../node_modules
|
|
1
|
+
{"version":3,"file":"react-text-annotator.es11.js","sources":["../../../node_modules/unique-random/index.js"],"sourcesContent":["function * range(minimum, maximum) {\n\tfor (let number = minimum; number <= maximum; number++) {\n\t\tyield number;\n\t}\n}\n\nfunction randomInteger(minimum, maximum) {\n\treturn Math.floor(Math.random() * (maximum - minimum + 1)) + minimum;\n}\n\nfunction randomIntegerWithout(minimum, maximum, excludedValue) {\n\tconst number = randomInteger(minimum, maximum - 1);\n\n\treturn number >= excludedValue ? number + 1 : number;\n}\n\nfunction makeCallable(generator) {\n\tconst iterator = generator();\n\n\tfunction random() {\n\t\treturn iterator.next().value;\n\t}\n\n\trandom[Symbol.iterator] = function * () {\n\t\twhile (true) {\n\t\t\tyield random();\n\t\t}\n\t};\n\n\treturn random;\n}\n\nexport function consecutiveUniqueRandom(minimum, maximum) {\n\treturn makeCallable(function * () {\n\t\tif (minimum === maximum) {\n\t\t\twhile (true) {\n\t\t\t\tyield minimum;\n\t\t\t}\n\t\t}\n\n\t\tlet previousValue = randomInteger(minimum, maximum);\n\t\tyield previousValue;\n\n\t\twhile (true) {\n\t\t\tpreviousValue = randomIntegerWithout(minimum, maximum, previousValue);\n\t\t\tyield previousValue;\n\t\t}\n\t});\n}\n\nexport function exhaustiveUniqueRandom(minimum, maximum) {\n\treturn makeCallable(function * () {\n\t\tif (minimum === maximum) {\n\t\t\twhile (true) {\n\t\t\t\tyield minimum;\n\t\t\t}\n\t\t}\n\n\t\tlet unconsumedValues = [...range(minimum, maximum)];\n\n\t\twhile (true) {\n\t\t\twhile (unconsumedValues.length > 1) {\n\t\t\t\tyield unconsumedValues.splice(\n\t\t\t\t\trandomInteger(0, unconsumedValues.length - 1),\n\t\t\t\t\t1,\n\t\t\t\t)[0];\n\t\t\t}\n\n\t\t\tconst [previousValue] = unconsumedValues;\n\n\t\t\tyield previousValue;\n\n\t\t\tunconsumedValues = [...range(minimum, maximum)];\n\n\t\t\tyield unconsumedValues.splice(\n\t\t\t\trandomIntegerWithout(0, unconsumedValues.length - 1, previousValue - minimum),\n\t\t\t\t1,\n\t\t\t)[0];\n\t\t}\n\t});\n}\n"],"names":[],"mappings":"AAAA,UAAW,MAAM,SAAS,SAAS;AAClC,WAAS,SAAS,SAAS,UAAU,SAAS,UAAU;AACvD,UAAM;AAAA,EACR;AACA;AAEA,SAAS,cAAc,SAAS,SAAS;AACxC,SAAO,KAAK,MAAM,KAAK,OAAM,KAAM,UAAU,UAAU,EAAE,IAAI;AAC9D;AAEA,SAAS,qBAAqB,SAAS,SAAS,eAAe;AAC9D,QAAM,SAAS,cAAc,SAAS,UAAU,CAAC;AAEjD,SAAO,UAAU,gBAAgB,SAAS,IAAI;AAC/C;AAEA,SAAS,aAAa,WAAW;AAChC,QAAM,WAAW,UAAW;AAE5B,WAAS,SAAS;AACjB,WAAO,SAAS,KAAI,EAAG;AAAA,EACzB;AAEC,SAAO,OAAO,QAAQ,IAAI,aAAc;AACvC,WAAO,MAAM;AACZ,YAAM,OAAQ;AAAA,IACjB;AAAA,EACE;AAED,SAAO;AACR;AAoBO,SAAS,uBAAuB,SAAS,SAAS;AACxD,SAAO,aAAa,aAAc;AAOjC,QAAI,mBAAmB,CAAC,GAAG,MAAM,SAAS,OAAO,CAAC;AAElD,WAAO,MAAM;AACZ,aAAO,iBAAiB,SAAS,GAAG;AACnC,cAAM,iBAAiB;AAAA,UACtB,cAAc,GAAG,iBAAiB,SAAS,CAAC;AAAA,UAC5C;AAAA,QACA,EAAC,CAAC;AAAA,MACP;AAEG,YAAM,CAAC,aAAa,IAAI;AAExB,YAAM;AAEN,yBAAmB,CAAC,GAAG,MAAM,SAAS,OAAO,CAAC;AAE9C,YAAM,iBAAiB;AAAA,QACtB,qBAAqB,GAAG,iBAAiB,SAAS,GAAG,gBAAgB,OAAO;AAAA,QAC5E;AAAA,MACA,EAAC,CAAC;AAAA,IACN;AAAA,EACA,CAAE;AACF;","x_google_ignoreList":[0]}
|
|
@@ -1,48 +1,28 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
function makeCallable(generator) {
|
|
14
|
-
const iterator = generator();
|
|
15
|
-
function random() {
|
|
16
|
-
return iterator.next().value;
|
|
17
|
-
}
|
|
18
|
-
random[Symbol.iterator] = function* () {
|
|
19
|
-
while (true) {
|
|
20
|
-
yield random();
|
|
1
|
+
var has = Object.prototype.hasOwnProperty;
|
|
2
|
+
function dequal(foo, bar) {
|
|
3
|
+
var ctor, len;
|
|
4
|
+
if (foo === bar) return true;
|
|
5
|
+
if (foo && bar && (ctor = foo.constructor) === bar.constructor) {
|
|
6
|
+
if (ctor === Date) return foo.getTime() === bar.getTime();
|
|
7
|
+
if (ctor === RegExp) return foo.toString() === bar.toString();
|
|
8
|
+
if (ctor === Array) {
|
|
9
|
+
if ((len = foo.length) === bar.length) {
|
|
10
|
+
while (len-- && dequal(foo[len], bar[len])) ;
|
|
11
|
+
}
|
|
12
|
+
return len === -1;
|
|
21
13
|
}
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
let unconsumedValues = [...range(minimum, maximum)];
|
|
28
|
-
while (true) {
|
|
29
|
-
while (unconsumedValues.length > 1) {
|
|
30
|
-
yield unconsumedValues.splice(
|
|
31
|
-
randomInteger(0, unconsumedValues.length - 1),
|
|
32
|
-
1
|
|
33
|
-
)[0];
|
|
14
|
+
if (!ctor || typeof foo === "object") {
|
|
15
|
+
len = 0;
|
|
16
|
+
for (ctor in foo) {
|
|
17
|
+
if (has.call(foo, ctor) && ++len && !has.call(bar, ctor)) return false;
|
|
18
|
+
if (!(ctor in bar) || !dequal(foo[ctor], bar[ctor])) return false;
|
|
34
19
|
}
|
|
35
|
-
|
|
36
|
-
yield previousValue;
|
|
37
|
-
unconsumedValues = [...range(minimum, maximum)];
|
|
38
|
-
yield unconsumedValues.splice(
|
|
39
|
-
randomIntegerWithout(0, unconsumedValues.length - 1, previousValue - minimum),
|
|
40
|
-
1
|
|
41
|
-
)[0];
|
|
20
|
+
return Object.keys(bar).length === len;
|
|
42
21
|
}
|
|
43
|
-
}
|
|
22
|
+
}
|
|
23
|
+
return foo !== foo && bar !== bar;
|
|
44
24
|
}
|
|
45
25
|
export {
|
|
46
|
-
|
|
26
|
+
dequal
|
|
47
27
|
};
|
|
48
28
|
//# sourceMappingURL=react-text-annotator.es12.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"react-text-annotator.es12.js","sources":["../../../node_modules/
|
|
1
|
+
{"version":3,"file":"react-text-annotator.es12.js","sources":["../../../node_modules/dequal/lite/index.mjs"],"sourcesContent":["var has = Object.prototype.hasOwnProperty;\n\nexport function dequal(foo, bar) {\n\tvar ctor, len;\n\tif (foo === bar) return true;\n\n\tif (foo && bar && (ctor=foo.constructor) === bar.constructor) {\n\t\tif (ctor === Date) return foo.getTime() === bar.getTime();\n\t\tif (ctor === RegExp) return foo.toString() === bar.toString();\n\n\t\tif (ctor === Array) {\n\t\t\tif ((len=foo.length) === bar.length) {\n\t\t\t\twhile (len-- && dequal(foo[len], bar[len]));\n\t\t\t}\n\t\t\treturn len === -1;\n\t\t}\n\n\t\tif (!ctor || typeof foo === 'object') {\n\t\t\tlen = 0;\n\t\t\tfor (ctor in foo) {\n\t\t\t\tif (has.call(foo, ctor) && ++len && !has.call(bar, ctor)) return false;\n\t\t\t\tif (!(ctor in bar) || !dequal(foo[ctor], bar[ctor])) return false;\n\t\t\t}\n\t\t\treturn Object.keys(bar).length === len;\n\t\t}\n\t}\n\n\treturn foo !== foo && bar !== bar;\n}\n"],"names":[],"mappings":"AAAA,IAAI,MAAM,OAAO,UAAU;AAEpB,SAAS,OAAO,KAAK,KAAK;AAChC,MAAI,MAAM;AACV,MAAI,QAAQ,IAAK,QAAO;AAExB,MAAI,OAAO,QAAQ,OAAK,IAAI,iBAAiB,IAAI,aAAa;AAC7D,QAAI,SAAS,KAAM,QAAO,IAAI,QAAS,MAAK,IAAI,QAAS;AACzD,QAAI,SAAS,OAAQ,QAAO,IAAI,SAAU,MAAK,IAAI,SAAU;AAE7D,QAAI,SAAS,OAAO;AACnB,WAAK,MAAI,IAAI,YAAY,IAAI,QAAQ;AACpC,eAAO,SAAS,OAAO,IAAI,GAAG,GAAG,IAAI,GAAG,CAAC,EAAE;AAAA,MAC/C;AACG,aAAO,QAAQ;AAAA,IAClB;AAEE,QAAI,CAAC,QAAQ,OAAO,QAAQ,UAAU;AACrC,YAAM;AACN,WAAK,QAAQ,KAAK;AACjB,YAAI,IAAI,KAAK,KAAK,IAAI,KAAK,EAAE,OAAO,CAAC,IAAI,KAAK,KAAK,IAAI,EAAG,QAAO;AACjE,YAAI,EAAE,QAAQ,QAAQ,CAAC,OAAO,IAAI,IAAI,GAAG,IAAI,IAAI,CAAC,EAAG,QAAO;AAAA,MAChE;AACG,aAAO,OAAO,KAAK,GAAG,EAAE,WAAW;AAAA,IACtC;AAAA,EACA;AAEC,SAAO,QAAQ,OAAO,QAAQ;AAC/B;","x_google_ignoreList":[0]}
|