@soomo/react-text-annotator 3.0.0-staging.35 → 3.0.0-staging.37
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.es11.js +1 -1
- package/dist/react-text-annotator.es13.js +2 -51
- package/dist/react-text-annotator.es13.js.map +1 -1
- package/dist/react-text-annotator.es14.js +30 -146
- package/dist/react-text-annotator.es14.js.map +1 -1
- package/dist/react-text-annotator.es15.js +898 -2
- package/dist/react-text-annotator.es15.js.map +1 -1
- package/dist/react-text-annotator.es16.js +49 -29
- package/dist/react-text-annotator.es16.js.map +1 -1
- package/dist/react-text-annotator.es17.js +145 -896
- package/dist/react-text-annotator.es17.js.map +1 -1
- package/dist/react-text-annotator.es7.js +3 -3
- package/dist/react-text-annotator.es9.js +2 -2
- package/package.json +2 -2
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { offset as offset$1, shift as shift$1, flip as flip$1, inline as inline$1, computePosition as computePosition$1 } from "./react-text-annotator.es25.js";
|
|
2
2
|
import { createCoords, rectToClientRect, round, floor, max, min } from "./react-text-annotator.es24.js";
|
|
3
|
-
import { getOverflowAncestors, isElement, getWindow, getComputedStyle, getDocumentElement, isHTMLElement, isWebKit, isTopLayer, getNodeName, isOverflowElement, getNodeScroll, getParentNode, isLastTraversableNode, isTableElement, isContainingBlock, getContainingBlock } from "./react-text-annotator.
|
|
3
|
+
import { getOverflowAncestors, isElement, getWindow, getComputedStyle, getDocumentElement, isHTMLElement, isWebKit, isTopLayer, getNodeName, isOverflowElement, getNodeScroll, getParentNode, isLastTraversableNode, isTableElement, isContainingBlock, getContainingBlock } from "./react-text-annotator.es17.js";
|
|
4
4
|
function getCssDimensions(element) {
|
|
5
5
|
const css = getComputedStyle(element);
|
|
6
6
|
let width = parseFloat(css.width) || 0;
|
|
@@ -1,54 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
function contains(parent, child) {
|
|
3
|
-
if (!parent || !child) {
|
|
4
|
-
return false;
|
|
5
|
-
}
|
|
6
|
-
const rootNode = child.getRootNode == null ? void 0 : child.getRootNode();
|
|
7
|
-
if (parent.contains(child)) {
|
|
8
|
-
return true;
|
|
9
|
-
}
|
|
10
|
-
if (rootNode && isShadowRoot(rootNode)) {
|
|
11
|
-
let next = child;
|
|
12
|
-
while (next) {
|
|
13
|
-
if (parent === next) {
|
|
14
|
-
return true;
|
|
15
|
-
}
|
|
16
|
-
next = next.parentNode || next.host;
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
return false;
|
|
20
|
-
}
|
|
21
|
-
function isReactEvent(event) {
|
|
22
|
-
return "nativeEvent" in event;
|
|
23
|
-
}
|
|
24
|
-
function isRootElement(element) {
|
|
25
|
-
return element.matches("html,body");
|
|
26
|
-
}
|
|
27
|
-
function getDocument(node) {
|
|
28
|
-
return (node == null ? void 0 : node.ownerDocument) || document;
|
|
29
|
-
}
|
|
30
|
-
function isEventTargetWithin(event, node) {
|
|
31
|
-
if (node == null) {
|
|
32
|
-
return false;
|
|
33
|
-
}
|
|
34
|
-
if ("composedPath" in event) {
|
|
35
|
-
return event.composedPath().includes(node);
|
|
36
|
-
}
|
|
37
|
-
const e = event;
|
|
38
|
-
return e.target != null && node.contains(e.target);
|
|
39
|
-
}
|
|
40
|
-
function getTarget(event) {
|
|
41
|
-
if ("composedPath" in event) {
|
|
42
|
-
return event.composedPath()[0];
|
|
43
|
-
}
|
|
44
|
-
return event.target;
|
|
45
|
-
}
|
|
1
|
+
var jsxRuntime = { exports: {} };
|
|
46
2
|
export {
|
|
47
|
-
|
|
48
|
-
getDocument,
|
|
49
|
-
getTarget,
|
|
50
|
-
isEventTargetWithin,
|
|
51
|
-
isReactEvent,
|
|
52
|
-
isRootElement
|
|
3
|
+
jsxRuntime as __module
|
|
53
4
|
};
|
|
54
5
|
//# sourceMappingURL=react-text-annotator.es13.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"react-text-annotator.es13.js","sources":[
|
|
1
|
+
{"version":3,"file":"react-text-annotator.es13.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
|
|
@@ -1,150 +1,34 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
function isOverflowElement(element) {
|
|
31
|
-
const {
|
|
32
|
-
overflow,
|
|
33
|
-
overflowX,
|
|
34
|
-
overflowY,
|
|
35
|
-
display
|
|
36
|
-
} = getComputedStyle(element);
|
|
37
|
-
return /auto|scroll|overlay|hidden|clip/.test(overflow + overflowY + overflowX) && !["inline", "contents"].includes(display);
|
|
38
|
-
}
|
|
39
|
-
function isTableElement(element) {
|
|
40
|
-
return ["table", "td", "th"].includes(getNodeName(element));
|
|
41
|
-
}
|
|
42
|
-
function isTopLayer(element) {
|
|
43
|
-
return [":popover-open", ":modal"].some((selector) => {
|
|
44
|
-
try {
|
|
45
|
-
return element.matches(selector);
|
|
46
|
-
} catch (e) {
|
|
47
|
-
return false;
|
|
48
|
-
}
|
|
49
|
-
});
|
|
50
|
-
}
|
|
51
|
-
function isContainingBlock(elementOrCss) {
|
|
52
|
-
const webkit = isWebKit();
|
|
53
|
-
const css = isElement(elementOrCss) ? getComputedStyle(elementOrCss) : elementOrCss;
|
|
54
|
-
return css.transform !== "none" || css.perspective !== "none" || (css.containerType ? css.containerType !== "normal" : false) || !webkit && (css.backdropFilter ? css.backdropFilter !== "none" : false) || !webkit && (css.filter ? css.filter !== "none" : false) || ["transform", "perspective", "filter"].some((value) => (css.willChange || "").includes(value)) || ["paint", "layout", "strict", "content"].some((value) => (css.contain || "").includes(value));
|
|
55
|
-
}
|
|
56
|
-
function getContainingBlock(element) {
|
|
57
|
-
let currentNode = getParentNode(element);
|
|
58
|
-
while (isHTMLElement(currentNode) && !isLastTraversableNode(currentNode)) {
|
|
59
|
-
if (isContainingBlock(currentNode)) {
|
|
60
|
-
return currentNode;
|
|
61
|
-
} else if (isTopLayer(currentNode)) {
|
|
62
|
-
return null;
|
|
63
|
-
}
|
|
64
|
-
currentNode = getParentNode(currentNode);
|
|
65
|
-
}
|
|
66
|
-
return null;
|
|
67
|
-
}
|
|
68
|
-
function isWebKit() {
|
|
69
|
-
if (typeof CSS === "undefined" || !CSS.supports) return false;
|
|
70
|
-
return CSS.supports("-webkit-backdrop-filter", "none");
|
|
71
|
-
}
|
|
72
|
-
function isLastTraversableNode(node) {
|
|
73
|
-
return ["html", "body", "#document"].includes(getNodeName(node));
|
|
74
|
-
}
|
|
75
|
-
function getComputedStyle(element) {
|
|
76
|
-
return getWindow(element).getComputedStyle(element);
|
|
77
|
-
}
|
|
78
|
-
function getNodeScroll(element) {
|
|
79
|
-
if (isElement(element)) {
|
|
80
|
-
return {
|
|
81
|
-
scrollLeft: element.scrollLeft,
|
|
82
|
-
scrollTop: element.scrollTop
|
|
83
|
-
};
|
|
84
|
-
}
|
|
85
|
-
return {
|
|
86
|
-
scrollLeft: element.scrollX,
|
|
87
|
-
scrollTop: element.scrollY
|
|
88
|
-
};
|
|
89
|
-
}
|
|
90
|
-
function getParentNode(node) {
|
|
91
|
-
if (getNodeName(node) === "html") {
|
|
92
|
-
return node;
|
|
93
|
-
}
|
|
94
|
-
const result = (
|
|
95
|
-
// Step into the shadow DOM of the parent of a slotted node.
|
|
96
|
-
node.assignedSlot || // DOM Element detected.
|
|
97
|
-
node.parentNode || // ShadowRoot detected.
|
|
98
|
-
isShadowRoot(node) && node.host || // Fallback.
|
|
99
|
-
getDocumentElement(node)
|
|
100
|
-
);
|
|
101
|
-
return isShadowRoot(result) ? result.host : result;
|
|
102
|
-
}
|
|
103
|
-
function getNearestOverflowAncestor(node) {
|
|
104
|
-
const parentNode = getParentNode(node);
|
|
105
|
-
if (isLastTraversableNode(parentNode)) {
|
|
106
|
-
return node.ownerDocument ? node.ownerDocument.body : node.body;
|
|
107
|
-
}
|
|
108
|
-
if (isHTMLElement(parentNode) && isOverflowElement(parentNode)) {
|
|
109
|
-
return parentNode;
|
|
110
|
-
}
|
|
111
|
-
return getNearestOverflowAncestor(parentNode);
|
|
112
|
-
}
|
|
113
|
-
function getOverflowAncestors(node, list, traverseIframes) {
|
|
114
|
-
var _node$ownerDocument2;
|
|
115
|
-
if (list === void 0) {
|
|
116
|
-
list = [];
|
|
117
|
-
}
|
|
118
|
-
if (traverseIframes === void 0) {
|
|
119
|
-
traverseIframes = true;
|
|
120
|
-
}
|
|
121
|
-
const scrollableAncestor = getNearestOverflowAncestor(node);
|
|
122
|
-
const isBody = scrollableAncestor === ((_node$ownerDocument2 = node.ownerDocument) == null ? void 0 : _node$ownerDocument2.body);
|
|
123
|
-
const win = getWindow(scrollableAncestor);
|
|
124
|
-
if (isBody) {
|
|
125
|
-
return list.concat(win, win.visualViewport || [], isOverflowElement(scrollableAncestor) ? scrollableAncestor : [], win.frameElement && traverseIframes ? getOverflowAncestors(win.frameElement) : []);
|
|
126
|
-
}
|
|
127
|
-
return list.concat(scrollableAncestor, getOverflowAncestors(scrollableAncestor, [], traverseIframes));
|
|
1
|
+
import { __exports as reactJsxRuntime_production_min } from "./react-text-annotator.es18.js";
|
|
2
|
+
import React__default from "react";
|
|
3
|
+
/**
|
|
4
|
+
* @license React
|
|
5
|
+
* react-jsx-runtime.production.min.js
|
|
6
|
+
*
|
|
7
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
8
|
+
*
|
|
9
|
+
* This source code is licensed under the MIT license found in the
|
|
10
|
+
* LICENSE file in the root directory of this source tree.
|
|
11
|
+
*/
|
|
12
|
+
var hasRequiredReactJsxRuntime_production_min;
|
|
13
|
+
function requireReactJsxRuntime_production_min() {
|
|
14
|
+
if (hasRequiredReactJsxRuntime_production_min) return reactJsxRuntime_production_min;
|
|
15
|
+
hasRequiredReactJsxRuntime_production_min = 1;
|
|
16
|
+
var f = React__default, k = Symbol.for("react.element"), l = Symbol.for("react.fragment"), m = Object.prototype.hasOwnProperty, n = f.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, p = { key: true, ref: true, __self: true, __source: true };
|
|
17
|
+
function q(c, a, g) {
|
|
18
|
+
var b, d = {}, e = null, h = null;
|
|
19
|
+
void 0 !== g && (e = "" + g);
|
|
20
|
+
void 0 !== a.key && (e = "" + a.key);
|
|
21
|
+
void 0 !== a.ref && (h = a.ref);
|
|
22
|
+
for (b in a) m.call(a, b) && !p.hasOwnProperty(b) && (d[b] = a[b]);
|
|
23
|
+
if (c && c.defaultProps) for (b in a = c.defaultProps, a) void 0 === d[b] && (d[b] = a[b]);
|
|
24
|
+
return { $$typeof: k, type: c, key: e, ref: h, props: d, _owner: n.current };
|
|
25
|
+
}
|
|
26
|
+
reactJsxRuntime_production_min.Fragment = l;
|
|
27
|
+
reactJsxRuntime_production_min.jsx = q;
|
|
28
|
+
reactJsxRuntime_production_min.jsxs = q;
|
|
29
|
+
return reactJsxRuntime_production_min;
|
|
128
30
|
}
|
|
129
31
|
export {
|
|
130
|
-
|
|
131
|
-
getContainingBlock,
|
|
132
|
-
getDocumentElement,
|
|
133
|
-
getNearestOverflowAncestor,
|
|
134
|
-
getNodeName,
|
|
135
|
-
getNodeScroll,
|
|
136
|
-
getOverflowAncestors,
|
|
137
|
-
getParentNode,
|
|
138
|
-
getWindow,
|
|
139
|
-
isContainingBlock,
|
|
140
|
-
isElement,
|
|
141
|
-
isHTMLElement,
|
|
142
|
-
isLastTraversableNode,
|
|
143
|
-
isNode,
|
|
144
|
-
isOverflowElement,
|
|
145
|
-
isShadowRoot,
|
|
146
|
-
isTableElement,
|
|
147
|
-
isTopLayer,
|
|
148
|
-
isWebKit
|
|
32
|
+
requireReactJsxRuntime_production_min as __require
|
|
149
33
|
};
|
|
150
34
|
//# sourceMappingURL=react-text-annotator.es14.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"react-text-annotator.es14.js","sources":["../../../node_modules
|
|
1
|
+
{"version":3,"file":"react-text-annotator.es14.js","sources":["../../../node_modules/react/cjs/react-jsx-runtime.production.min.js"],"sourcesContent":["/**\n * @license React\n * react-jsx-runtime.production.min.js\n *\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n'use strict';var f=require(\"react\"),k=Symbol.for(\"react.element\"),l=Symbol.for(\"react.fragment\"),m=Object.prototype.hasOwnProperty,n=f.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,p={key:!0,ref:!0,__self:!0,__source:!0};\nfunction q(c,a,g){var b,d={},e=null,h=null;void 0!==g&&(e=\"\"+g);void 0!==a.key&&(e=\"\"+a.key);void 0!==a.ref&&(h=a.ref);for(b in a)m.call(a,b)&&!p.hasOwnProperty(b)&&(d[b]=a[b]);if(c&&c.defaultProps)for(b in a=c.defaultProps,a)void 0===d[b]&&(d[b]=a[b]);return{$$typeof:k,type:c,key:e,ref:h,props:d,_owner:n.current}}exports.Fragment=l;exports.jsx=q;exports.jsxs=q;\n"],"names":["require$$0"],"mappings":";;;;;;;;;;;;;;;AASa,MAAI,IAAEA,gBAAiB,IAAE,OAAO,IAAI,eAAe,GAAE,IAAE,OAAO,IAAI,gBAAgB,GAAE,IAAE,OAAO,UAAU,gBAAe,IAAE,EAAE,mDAAmD,mBAAkB,IAAE,EAAC,KAAI,MAAG,KAAI,MAAG,QAAO,MAAG,UAAS,KAAE;AAClP,WAAS,EAAE,GAAE,GAAE,GAAE;AAAC,QAAI,GAAE,IAAE,IAAG,IAAE,MAAK,IAAE;AAAK,eAAS,MAAI,IAAE,KAAG;AAAG,eAAS,EAAE,QAAM,IAAE,KAAG,EAAE;AAAK,eAAS,EAAE,QAAM,IAAE,EAAE;AAAK,SAAI,KAAK,EAAE,GAAE,KAAK,GAAE,CAAC,KAAG,CAAC,EAAE,eAAe,CAAC,MAAI,EAAE,CAAC,IAAE,EAAE,CAAC;AAAG,QAAG,KAAG,EAAE,aAAa,MAAI,KAAK,IAAE,EAAE,cAAa,EAAE,YAAS,EAAE,CAAC,MAAI,EAAE,CAAC,IAAE,EAAE,CAAC;AAAG,WAAM,EAAC,UAAS,GAAE,MAAK,GAAE,KAAI,GAAE,KAAI,GAAE,OAAM,GAAE,QAAO,EAAE,QAAO;AAAA,EAAC;AAAC,4CAAiB;AAAE,iCAAW,MAAC;AAAE,iCAAA,OAAa;;;","x_google_ignoreList":[0]}
|