@soomo/react-text-annotator 3.0.0-staging.22 → 3.0.0-staging.24
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 +2 -2
- package/dist/react-text-annotator.es12.js +1 -1
- package/dist/react-text-annotator.es14.js +2 -136
- package/dist/react-text-annotator.es14.js.map +1 -1
- package/dist/react-text-annotator.es15.js +35 -2
- package/dist/react-text-annotator.es15.js.map +1 -1
- package/dist/react-text-annotator.es16.js +888 -24
- package/dist/react-text-annotator.es16.js.map +1 -1
- package/dist/react-text-annotator.es17.js +134 -897
- package/dist/react-text-annotator.es17.js.map +1 -1
- package/dist/react-text-annotator.es7.js +3 -3
- package/package.json +4 -4
|
@@ -2,8 +2,8 @@ import * as React from "react";
|
|
|
2
2
|
import { useLayoutEffect, useEffect } from "react";
|
|
3
3
|
import { useFloating as useFloating$1 } from "./react-text-annotator.es11.js";
|
|
4
4
|
import { autoPlacement, inline, offset, shift } from "./react-text-annotator.es11.js";
|
|
5
|
-
import { isElement } from "./react-text-annotator.
|
|
6
|
-
import { getOverflowAncestors } from "./react-text-annotator.
|
|
5
|
+
import { isElement } from "./react-text-annotator.es17.js";
|
|
6
|
+
import { getOverflowAncestors } from "./react-text-annotator.es17.js";
|
|
7
7
|
import "react-dom";
|
|
8
8
|
const SafeReact = {
|
|
9
9
|
...React
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { offset as offset$1, autoPlacement as autoPlacement$1, shift as shift$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, getNodeName, isOverflowElement, getNodeScroll, getParentNode, isLastTraversableNode, isTableElement, isContainingBlock, getContainingBlock } from "./react-text-annotator.
|
|
3
|
+
import { getOverflowAncestors, isElement, getWindow, getComputedStyle, getDocumentElement, isHTMLElement, isWebKit, 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,139 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
if (isNode(node)) {
|
|
3
|
-
return (node.nodeName || "").toLowerCase();
|
|
4
|
-
}
|
|
5
|
-
return "#document";
|
|
6
|
-
}
|
|
7
|
-
function getWindow(node) {
|
|
8
|
-
var _node$ownerDocument;
|
|
9
|
-
return (node == null || (_node$ownerDocument = node.ownerDocument) == null ? void 0 : _node$ownerDocument.defaultView) || window;
|
|
10
|
-
}
|
|
11
|
-
function getDocumentElement(node) {
|
|
12
|
-
var _ref;
|
|
13
|
-
return (_ref = (isNode(node) ? node.ownerDocument : node.document) || window.document) == null ? void 0 : _ref.documentElement;
|
|
14
|
-
}
|
|
15
|
-
function isNode(value) {
|
|
16
|
-
return value instanceof Node || value instanceof getWindow(value).Node;
|
|
17
|
-
}
|
|
18
|
-
function isElement(value) {
|
|
19
|
-
return value instanceof Element || value instanceof getWindow(value).Element;
|
|
20
|
-
}
|
|
21
|
-
function isHTMLElement(value) {
|
|
22
|
-
return value instanceof HTMLElement || value instanceof getWindow(value).HTMLElement;
|
|
23
|
-
}
|
|
24
|
-
function isShadowRoot(value) {
|
|
25
|
-
if (typeof ShadowRoot === "undefined") {
|
|
26
|
-
return false;
|
|
27
|
-
}
|
|
28
|
-
return value instanceof ShadowRoot || value instanceof getWindow(value).ShadowRoot;
|
|
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 isContainingBlock(element) {
|
|
43
|
-
const webkit = isWebKit();
|
|
44
|
-
const css = getComputedStyle(element);
|
|
45
|
-
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));
|
|
46
|
-
}
|
|
47
|
-
function getContainingBlock(element) {
|
|
48
|
-
let currentNode = getParentNode(element);
|
|
49
|
-
while (isHTMLElement(currentNode) && !isLastTraversableNode(currentNode)) {
|
|
50
|
-
if (isContainingBlock(currentNode)) {
|
|
51
|
-
return currentNode;
|
|
52
|
-
}
|
|
53
|
-
currentNode = getParentNode(currentNode);
|
|
54
|
-
}
|
|
55
|
-
return null;
|
|
56
|
-
}
|
|
57
|
-
function isWebKit() {
|
|
58
|
-
if (typeof CSS === "undefined" || !CSS.supports)
|
|
59
|
-
return false;
|
|
60
|
-
return CSS.supports("-webkit-backdrop-filter", "none");
|
|
61
|
-
}
|
|
62
|
-
function isLastTraversableNode(node) {
|
|
63
|
-
return ["html", "body", "#document"].includes(getNodeName(node));
|
|
64
|
-
}
|
|
65
|
-
function getComputedStyle(element) {
|
|
66
|
-
return getWindow(element).getComputedStyle(element);
|
|
67
|
-
}
|
|
68
|
-
function getNodeScroll(element) {
|
|
69
|
-
if (isElement(element)) {
|
|
70
|
-
return {
|
|
71
|
-
scrollLeft: element.scrollLeft,
|
|
72
|
-
scrollTop: element.scrollTop
|
|
73
|
-
};
|
|
74
|
-
}
|
|
75
|
-
return {
|
|
76
|
-
scrollLeft: element.pageXOffset,
|
|
77
|
-
scrollTop: element.pageYOffset
|
|
78
|
-
};
|
|
79
|
-
}
|
|
80
|
-
function getParentNode(node) {
|
|
81
|
-
if (getNodeName(node) === "html") {
|
|
82
|
-
return node;
|
|
83
|
-
}
|
|
84
|
-
const result = (
|
|
85
|
-
// Step into the shadow DOM of the parent of a slotted node.
|
|
86
|
-
node.assignedSlot || // DOM Element detected.
|
|
87
|
-
node.parentNode || // ShadowRoot detected.
|
|
88
|
-
isShadowRoot(node) && node.host || // Fallback.
|
|
89
|
-
getDocumentElement(node)
|
|
90
|
-
);
|
|
91
|
-
return isShadowRoot(result) ? result.host : result;
|
|
92
|
-
}
|
|
93
|
-
function getNearestOverflowAncestor(node) {
|
|
94
|
-
const parentNode = getParentNode(node);
|
|
95
|
-
if (isLastTraversableNode(parentNode)) {
|
|
96
|
-
return node.ownerDocument ? node.ownerDocument.body : node.body;
|
|
97
|
-
}
|
|
98
|
-
if (isHTMLElement(parentNode) && isOverflowElement(parentNode)) {
|
|
99
|
-
return parentNode;
|
|
100
|
-
}
|
|
101
|
-
return getNearestOverflowAncestor(parentNode);
|
|
102
|
-
}
|
|
103
|
-
function getOverflowAncestors(node, list, traverseIframes) {
|
|
104
|
-
var _node$ownerDocument2;
|
|
105
|
-
if (list === void 0) {
|
|
106
|
-
list = [];
|
|
107
|
-
}
|
|
108
|
-
if (traverseIframes === void 0) {
|
|
109
|
-
traverseIframes = true;
|
|
110
|
-
}
|
|
111
|
-
const scrollableAncestor = getNearestOverflowAncestor(node);
|
|
112
|
-
const isBody = scrollableAncestor === ((_node$ownerDocument2 = node.ownerDocument) == null ? void 0 : _node$ownerDocument2.body);
|
|
113
|
-
const win = getWindow(scrollableAncestor);
|
|
114
|
-
if (isBody) {
|
|
115
|
-
return list.concat(win, win.visualViewport || [], isOverflowElement(scrollableAncestor) ? scrollableAncestor : [], win.frameElement && traverseIframes ? getOverflowAncestors(win.frameElement) : []);
|
|
116
|
-
}
|
|
117
|
-
return list.concat(scrollableAncestor, getOverflowAncestors(scrollableAncestor, [], traverseIframes));
|
|
118
|
-
}
|
|
1
|
+
var jsxRuntime = { exports: {} };
|
|
119
2
|
export {
|
|
120
|
-
|
|
121
|
-
getContainingBlock,
|
|
122
|
-
getDocumentElement,
|
|
123
|
-
getNearestOverflowAncestor,
|
|
124
|
-
getNodeName,
|
|
125
|
-
getNodeScroll,
|
|
126
|
-
getOverflowAncestors,
|
|
127
|
-
getParentNode,
|
|
128
|
-
getWindow,
|
|
129
|
-
isContainingBlock,
|
|
130
|
-
isElement,
|
|
131
|
-
isHTMLElement,
|
|
132
|
-
isLastTraversableNode,
|
|
133
|
-
isNode,
|
|
134
|
-
isOverflowElement,
|
|
135
|
-
isShadowRoot,
|
|
136
|
-
isTableElement,
|
|
137
|
-
isWebKit
|
|
3
|
+
jsxRuntime as __module
|
|
138
4
|
};
|
|
139
5
|
//# sourceMappingURL=react-text-annotator.es14.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"react-text-annotator.es14.js","sources":[
|
|
1
|
+
{"version":3,"file":"react-text-annotator.es14.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
|
|
@@ -1,5 +1,38 @@
|
|
|
1
|
-
|
|
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)
|
|
15
|
+
return reactJsxRuntime_production_min;
|
|
16
|
+
hasRequiredReactJsxRuntime_production_min = 1;
|
|
17
|
+
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 };
|
|
18
|
+
function q(c, a, g) {
|
|
19
|
+
var b, d = {}, e = null, h = null;
|
|
20
|
+
void 0 !== g && (e = "" + g);
|
|
21
|
+
void 0 !== a.key && (e = "" + a.key);
|
|
22
|
+
void 0 !== a.ref && (h = a.ref);
|
|
23
|
+
for (b in a)
|
|
24
|
+
m.call(a, b) && !p.hasOwnProperty(b) && (d[b] = a[b]);
|
|
25
|
+
if (c && c.defaultProps)
|
|
26
|
+
for (b in a = c.defaultProps, a)
|
|
27
|
+
void 0 === d[b] && (d[b] = a[b]);
|
|
28
|
+
return { $$typeof: k, type: c, key: e, ref: h, props: d, _owner: n.current };
|
|
29
|
+
}
|
|
30
|
+
reactJsxRuntime_production_min.Fragment = l;
|
|
31
|
+
reactJsxRuntime_production_min.jsx = q;
|
|
32
|
+
reactJsxRuntime_production_min.jsxs = q;
|
|
33
|
+
return reactJsxRuntime_production_min;
|
|
34
|
+
}
|
|
2
35
|
export {
|
|
3
|
-
|
|
36
|
+
requireReactJsxRuntime_production_min as __require
|
|
4
37
|
};
|
|
5
38
|
//# sourceMappingURL=react-text-annotator.es15.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"react-text-annotator.es15.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
|
|
1
|
+
{"version":3,"file":"react-text-annotator.es15.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;AAAE,QAAE,KAAK,GAAE,CAAC,KAAG,CAAC,EAAE,eAAe,CAAC,MAAI,EAAE,CAAC,IAAE,EAAE,CAAC;AAAG,QAAG,KAAG,EAAE;AAAa,WAAI,KAAK,IAAE,EAAE,cAAa;AAAE,mBAAS,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]}
|