@soomo/react-text-annotator 3.1.0-staging.3 → 3.1.0-staging.5
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 +11 -1
- package/dist/TextAnnotatorPopup/TextAnnotatorPopup.d.ts.map +1 -1
- package/dist/react-text-annotator.es.js +2 -1
- package/dist/react-text-annotator.es10.js +5 -5
- package/dist/react-text-annotator.es11.js +9 -82
- package/dist/react-text-annotator.es11.js.map +1 -1
- package/dist/react-text-annotator.es12.js +1436 -33
- package/dist/react-text-annotator.es12.js.map +1 -1
- package/dist/react-text-annotator.es14.js +196 -1398
- package/dist/react-text-annotator.es14.js.map +1 -1
- package/dist/react-text-annotator.es15.js +588 -0
- package/dist/react-text-annotator.es15.js.map +1 -0
- package/dist/react-text-annotator.es16.js +74 -238
- package/dist/react-text-annotator.es16.js.map +1 -1
- package/dist/react-text-annotator.es17.js +33 -573
- package/dist/react-text-annotator.es17.js.map +1 -1
- package/dist/react-text-annotator.es19.js +1 -1
- package/dist/react-text-annotator.es20.js +1 -1
- package/dist/react-text-annotator.es21.js +114 -2
- package/dist/react-text-annotator.es21.js.map +1 -1
- package/dist/react-text-annotator.es22.js +309 -2
- package/dist/react-text-annotator.es22.js.map +1 -1
- package/dist/react-text-annotator.es23.js +53 -109
- package/dist/react-text-annotator.es23.js.map +1 -1
- package/dist/react-text-annotator.es24.js +17 -306
- package/dist/react-text-annotator.es24.js.map +1 -1
- package/dist/react-text-annotator.es25.js +2 -58
- package/dist/react-text-annotator.es25.js.map +1 -1
- package/dist/react-text-annotator.es26.js +2 -20
- package/dist/react-text-annotator.es26.js.map +1 -1
- package/dist/react-text-annotator.es4.js +2 -2
- package/dist/react-text-annotator.es6.js +22 -20
- package/dist/react-text-annotator.es6.js.map +1 -1
- package/package.json +2 -2
- package/dist/react-text-annotator.es13.js +0 -12
- package/dist/react-text-annotator.es13.js.map +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { FC, PointerEvent, ReactNode } from 'react';
|
|
1
|
+
import { FC, PointerEvent, MouseEvent, ReactNode } from 'react';
|
|
2
2
|
import { TextAnnotation } from '@soomo/text-annotator';
|
|
3
3
|
interface TextAnnotationPopupProps {
|
|
4
4
|
ariaNavigationMessage?: string;
|
|
@@ -11,5 +11,15 @@ export interface TextAnnotationPopupContentProps {
|
|
|
11
11
|
event?: PointerEvent;
|
|
12
12
|
}
|
|
13
13
|
export declare const TextAnnotatorPopup: FC<TextAnnotationPopupProps>;
|
|
14
|
+
/**
|
|
15
|
+
* Prevent text-annotator from handling the irrelevant events
|
|
16
|
+
* triggered from the popup/toolbar/dialog
|
|
17
|
+
*/
|
|
18
|
+
export declare const getStopEventsPropagationProps: <T extends HTMLElement = HTMLElement>() => {
|
|
19
|
+
onPointerUp: (event: PointerEvent<T>) => void;
|
|
20
|
+
onPointerDown: (event: PointerEvent<T>) => void;
|
|
21
|
+
onMouseDown: (event: MouseEvent<T>) => void;
|
|
22
|
+
onMouseUp: (event: MouseEvent<T>) => void;
|
|
23
|
+
};
|
|
14
24
|
export {};
|
|
15
25
|
//# sourceMappingURL=TextAnnotatorPopup.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TextAnnotatorPopup.d.ts","sourceRoot":"","sources":["../../src/TextAnnotatorPopup/TextAnnotatorPopup.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,YAAY,EAAE,SAAS,EAA6C,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"TextAnnotatorPopup.d.ts","sourceRoot":"","sources":["../../src/TextAnnotatorPopup/TextAnnotatorPopup.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,YAAY,EAAE,UAAU,EAAE,SAAS,EAA6C,MAAM,OAAO,CAAC;AAiB3G,OAAO,EAIL,KAAK,cAAc,EAEpB,MAAM,uBAAuB,CAAC;AAG/B,OAAO,0BAA0B,CAAC;AAElC,UAAU,wBAAwB;IAEhC,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAE/B,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAE1B,KAAK,CAAC,KAAK,EAAE,+BAA+B,GAAG,SAAS,CAAC;CAE1D;AAED,MAAM,WAAW,+BAA+B;IAE9C,UAAU,EAAE,cAAc,CAAC;IAE3B,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB,KAAK,CAAC,EAAE,YAAY,CAAC;CAEtB;AAED,eAAO,MAAM,kBAAkB,EAAE,EAAE,CAAC,wBAAwB,CAuI3D,CAAA;AAED;;;GAGG;AACH,eAAO,MAAM,6BAA6B,GAAI,CAAC,SAAS,WAAW;yBAC5C,YAAY,CAAC,CAAC,CAAC;2BACb,YAAY,CAAC,CAAC,CAAC;yBACjB,UAAU,CAAC,CAAC,CAAC;uBACf,UAAU,CAAC,CAAC,CAAC;CAChC,CAAC"}
|
|
@@ -2,7 +2,7 @@ import { CETEIcean } from "./react-text-annotator.es2.js";
|
|
|
2
2
|
import { TEIAnnotator } from "./react-text-annotator.es3.js";
|
|
3
3
|
import { useAnnouncePopupNavigation } from "./react-text-annotator.es4.js";
|
|
4
4
|
import { TextAnnotator } from "./react-text-annotator.es5.js";
|
|
5
|
-
import { TextAnnotatorPopup } from "./react-text-annotator.es6.js";
|
|
5
|
+
import { TextAnnotatorPopup, getStopEventsPropagationProps } from "./react-text-annotator.es6.js";
|
|
6
6
|
import { Origin, UserSelectAction, createBody } from "@annotorious/core";
|
|
7
7
|
import { AnnotoriousPlugin } from "@annotorious/react";
|
|
8
8
|
import { W3CTextFormat } from "./react-text-annotator.es7.js";
|
|
@@ -16,6 +16,7 @@ export {
|
|
|
16
16
|
UserSelectAction,
|
|
17
17
|
W3CTextFormat,
|
|
18
18
|
createBody,
|
|
19
|
+
getStopEventsPropagationProps,
|
|
19
20
|
useAnnouncePopupNavigation
|
|
20
21
|
};
|
|
21
22
|
//# sourceMappingURL=react-text-annotator.es.js.map
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import defaultBehaviors from "./react-text-annotator.
|
|
2
|
-
import * as utilities from "./react-text-annotator.
|
|
3
|
-
import { hideContent, defineCustomElement, tagName } from "./react-text-annotator.
|
|
4
|
-
import { addBehaviors, addBehavior, removeBehavior } from "./react-text-annotator.
|
|
5
|
-
import { learnElementNames, learnCustomElementNames } from "./react-text-annotator.
|
|
1
|
+
import defaultBehaviors from "./react-text-annotator.es21.js";
|
|
2
|
+
import * as utilities from "./react-text-annotator.es22.js";
|
|
3
|
+
import { hideContent, defineCustomElement, tagName } from "./react-text-annotator.es22.js";
|
|
4
|
+
import { addBehaviors, addBehavior, removeBehavior } from "./react-text-annotator.es23.js";
|
|
5
|
+
import { learnElementNames, learnCustomElementNames } from "./react-text-annotator.es24.js";
|
|
6
6
|
class CETEI {
|
|
7
7
|
constructor(options) {
|
|
8
8
|
this.options = options ? options : {};
|
|
@@ -1,85 +1,12 @@
|
|
|
1
|
-
const
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
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;
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
class $319e236875307eab$var$LiveAnnouncer {
|
|
19
|
-
isAttached() {
|
|
20
|
-
var _this_node;
|
|
21
|
-
return (_this_node = this.node) === null || _this_node === void 0 ? void 0 : _this_node.isConnected;
|
|
22
|
-
}
|
|
23
|
-
createLog(ariaLive) {
|
|
24
|
-
let node = document.createElement("div");
|
|
25
|
-
node.setAttribute("role", "log");
|
|
26
|
-
node.setAttribute("aria-live", ariaLive);
|
|
27
|
-
node.setAttribute("aria-relevant", "additions");
|
|
28
|
-
return node;
|
|
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 = "";
|
|
53
|
-
}
|
|
54
|
-
constructor() {
|
|
55
|
-
this.node = null;
|
|
56
|
-
this.assertiveLog = null;
|
|
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);
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
}
|
|
1
|
+
const isMobile = () => {
|
|
2
|
+
var userAgent = navigator.userAgent || navigator.vendor || window.opera;
|
|
3
|
+
if (/android/i.test(userAgent))
|
|
4
|
+
return true;
|
|
5
|
+
if (/iPad|iPhone/.test(userAgent) && !window.MSStream)
|
|
6
|
+
return true;
|
|
7
|
+
return false;
|
|
8
|
+
};
|
|
81
9
|
export {
|
|
82
|
-
|
|
83
|
-
$319e236875307eab$export$d8686216b8b81b2f as destroyAnnouncer
|
|
10
|
+
isMobile
|
|
84
11
|
};
|
|
85
12
|
//# sourceMappingURL=react-text-annotator.es11.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"react-text-annotator.es11.js","sources":["
|
|
1
|
+
{"version":3,"file":"react-text-annotator.es11.js","sources":["../src/TextAnnotatorPopup/isMobile.ts"],"sourcesContent":["// https://stackoverflow.com/questions/21741841/detecting-ios-android-operating-system\nexport const isMobile = () => {\n // @ts-ignore\n var userAgent: string = navigator.userAgent || navigator.vendor || window.opera;\n\n if (/android/i.test(userAgent)) \n return true;\n\n // @ts-ignore\n // Note: as of recently, this NO LONGER DETECTS FIREFOX ON iOS!\n // This means FF/iOS will behave like on the desktop, and loose\n // selection handlebars after the popup opens.\n if (/iPad|iPhone/.test(userAgent) && !window.MSStream)\n return true;\n\n return false;\n}"],"names":[],"mappings":"AACO,MAAM,WAAW,MAAM;AAE5B,MAAI,YAAoB,UAAU,aAAa,UAAU,UAAU,OAAO;AAEtE,MAAA,WAAW,KAAK,SAAS;AACpB,WAAA;AAMT,MAAI,cAAc,KAAK,SAAS,KAAK,CAAC,OAAO;AACpC,WAAA;AAEF,SAAA;AACT;"}
|