@soomo/react-text-annotator 3.2.0-staging.4 → 3.2.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/react-text-annotator.es10.js +497 -78
- package/dist/react-text-annotator.es10.js.map +1 -1
- package/dist/react-text-annotator.es11.js +77 -40
- package/dist/react-text-annotator.es11.js.map +1 -1
- package/dist/react-text-annotator.es12.js +41 -21
- package/dist/react-text-annotator.es12.js.map +1 -1
- package/dist/react-text-annotator.es13.js +19 -1637
- package/dist/react-text-annotator.es13.js.map +1 -1
- package/dist/react-text-annotator.es14.js +1642 -9
- package/dist/react-text-annotator.es14.js.map +1 -1
- package/dist/react-text-annotator.es15.js +13 -0
- package/dist/react-text-annotator.es15.js.map +1 -0
- package/dist/react-text-annotator.es17.js +566 -244
- package/dist/react-text-annotator.es17.js.map +1 -1
- package/dist/react-text-annotator.es18.js +252 -471
- package/dist/react-text-annotator.es18.js.map +1 -1
- package/dist/react-text-annotator.es2.js +1 -1
- package/dist/react-text-annotator.es25.js +111 -124
- package/dist/react-text-annotator.es25.js.map +1 -1
- package/dist/react-text-annotator.es26.js +285 -140
- package/dist/react-text-annotator.es26.js.map +1 -1
- package/dist/react-text-annotator.es27.js +43 -296
- package/dist/react-text-annotator.es27.js.map +1 -1
- package/dist/react-text-annotator.es28.js +19 -113
- package/dist/react-text-annotator.es28.js.map +1 -1
- package/dist/react-text-annotator.es29.js +105 -287
- package/dist/react-text-annotator.es29.js.map +1 -1
- package/dist/react-text-annotator.es30.js +154 -48
- package/dist/react-text-annotator.es30.js.map +1 -1
- package/dist/react-text-annotator.es31.js +310 -19
- package/dist/react-text-annotator.es31.js.map +1 -1
- package/dist/react-text-annotator.es4.js +2 -2
- package/dist/react-text-annotator.es5.js +1 -1
- package/dist/react-text-annotator.es7.js +4 -4
- package/package.json +2 -2
- package/dist/react-text-annotator.es16.js +0 -607
- package/dist/react-text-annotator.es16.js.map +0 -1
|
@@ -1,61 +1,167 @@
|
|
|
1
|
-
function
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
}
|
|
1
|
+
function hasWindow() {
|
|
2
|
+
return typeof window !== "undefined";
|
|
3
|
+
}
|
|
4
|
+
function getNodeName(node) {
|
|
5
|
+
if (isNode(node)) {
|
|
6
|
+
return (node.nodeName || "").toLowerCase();
|
|
8
7
|
}
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
8
|
+
return "#document";
|
|
9
|
+
}
|
|
10
|
+
function getWindow(node) {
|
|
11
|
+
var _node$ownerDocument;
|
|
12
|
+
return (node == null || (_node$ownerDocument = node.ownerDocument) == null ? void 0 : _node$ownerDocument.defaultView) || window;
|
|
13
|
+
}
|
|
14
|
+
function getDocumentElement(node) {
|
|
15
|
+
var _ref;
|
|
16
|
+
return (_ref = (isNode(node) ? node.ownerDocument : node.document) || window.document) == null ? void 0 : _ref.documentElement;
|
|
17
|
+
}
|
|
18
|
+
function isNode(value) {
|
|
19
|
+
if (!hasWindow()) {
|
|
20
|
+
return false;
|
|
15
21
|
}
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
22
|
+
return value instanceof Node || value instanceof getWindow(value).Node;
|
|
23
|
+
}
|
|
24
|
+
function isElement(value) {
|
|
25
|
+
if (!hasWindow()) {
|
|
26
|
+
return false;
|
|
20
27
|
}
|
|
21
|
-
|
|
22
|
-
|
|
28
|
+
return value instanceof Element || value instanceof getWindow(value).Element;
|
|
29
|
+
}
|
|
30
|
+
function isHTMLElement(value) {
|
|
31
|
+
if (!hasWindow()) {
|
|
32
|
+
return false;
|
|
23
33
|
}
|
|
24
|
-
|
|
25
|
-
|
|
34
|
+
return value instanceof HTMLElement || value instanceof getWindow(value).HTMLElement;
|
|
35
|
+
}
|
|
36
|
+
function isShadowRoot(value) {
|
|
37
|
+
if (!hasWindow() || typeof ShadowRoot === "undefined") {
|
|
38
|
+
return false;
|
|
26
39
|
}
|
|
40
|
+
return value instanceof ShadowRoot || value instanceof getWindow(value).ShadowRoot;
|
|
41
|
+
}
|
|
42
|
+
function isOverflowElement(element) {
|
|
43
|
+
const {
|
|
44
|
+
overflow,
|
|
45
|
+
overflowX,
|
|
46
|
+
overflowY,
|
|
47
|
+
display
|
|
48
|
+
} = getComputedStyle(element);
|
|
49
|
+
return /auto|scroll|overlay|hidden|clip/.test(overflow + overflowY + overflowX) && !["inline", "contents"].includes(display);
|
|
50
|
+
}
|
|
51
|
+
function isTableElement(element) {
|
|
52
|
+
return ["table", "td", "th"].includes(getNodeName(element));
|
|
27
53
|
}
|
|
28
|
-
function
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
p = prefix;
|
|
35
|
-
}
|
|
54
|
+
function isTopLayer(element) {
|
|
55
|
+
return [":popover-open", ":modal"].some((selector) => {
|
|
56
|
+
try {
|
|
57
|
+
return element.matches(selector);
|
|
58
|
+
} catch (e) {
|
|
59
|
+
return false;
|
|
36
60
|
}
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
function isContainingBlock(elementOrCss) {
|
|
64
|
+
const webkit = isWebKit();
|
|
65
|
+
const css = isElement(elementOrCss) ? getComputedStyle(elementOrCss) : elementOrCss;
|
|
66
|
+
return ["transform", "translate", "scale", "rotate", "perspective"].some((value) => css[value] ? css[value] !== "none" : false) || (css.containerType ? css.containerType !== "normal" : false) || !webkit && (css.backdropFilter ? css.backdropFilter !== "none" : false) || !webkit && (css.filter ? css.filter !== "none" : false) || ["transform", "translate", "scale", "rotate", "perspective", "filter"].some((value) => (css.willChange || "").includes(value)) || ["paint", "layout", "strict", "content"].some((value) => (css.contain || "").includes(value));
|
|
67
|
+
}
|
|
68
|
+
function getContainingBlock(element) {
|
|
69
|
+
let currentNode = getParentNode(element);
|
|
70
|
+
while (isHTMLElement(currentNode) && !isLastTraversableNode(currentNode)) {
|
|
71
|
+
if (isContainingBlock(currentNode)) {
|
|
72
|
+
return currentNode;
|
|
73
|
+
} else if (isTopLayer(currentNode)) {
|
|
74
|
+
return null;
|
|
50
75
|
}
|
|
51
|
-
|
|
52
|
-
p = ns;
|
|
76
|
+
currentNode = getParentNode(currentNode);
|
|
53
77
|
}
|
|
54
|
-
|
|
78
|
+
return null;
|
|
79
|
+
}
|
|
80
|
+
function isWebKit() {
|
|
81
|
+
if (typeof CSS === "undefined" || !CSS.supports) return false;
|
|
82
|
+
return CSS.supports("-webkit-backdrop-filter", "none");
|
|
83
|
+
}
|
|
84
|
+
function isLastTraversableNode(node) {
|
|
85
|
+
return ["html", "body", "#document"].includes(getNodeName(node));
|
|
86
|
+
}
|
|
87
|
+
function getComputedStyle(element) {
|
|
88
|
+
return getWindow(element).getComputedStyle(element);
|
|
89
|
+
}
|
|
90
|
+
function getNodeScroll(element) {
|
|
91
|
+
if (isElement(element)) {
|
|
92
|
+
return {
|
|
93
|
+
scrollLeft: element.scrollLeft,
|
|
94
|
+
scrollTop: element.scrollTop
|
|
95
|
+
};
|
|
96
|
+
}
|
|
97
|
+
return {
|
|
98
|
+
scrollLeft: element.scrollX,
|
|
99
|
+
scrollTop: element.scrollY
|
|
100
|
+
};
|
|
101
|
+
}
|
|
102
|
+
function getParentNode(node) {
|
|
103
|
+
if (getNodeName(node) === "html") {
|
|
104
|
+
return node;
|
|
105
|
+
}
|
|
106
|
+
const result = (
|
|
107
|
+
// Step into the shadow DOM of the parent of a slotted node.
|
|
108
|
+
node.assignedSlot || // DOM Element detected.
|
|
109
|
+
node.parentNode || // ShadowRoot detected.
|
|
110
|
+
isShadowRoot(node) && node.host || // Fallback.
|
|
111
|
+
getDocumentElement(node)
|
|
112
|
+
);
|
|
113
|
+
return isShadowRoot(result) ? result.host : result;
|
|
114
|
+
}
|
|
115
|
+
function getNearestOverflowAncestor(node) {
|
|
116
|
+
const parentNode = getParentNode(node);
|
|
117
|
+
if (isLastTraversableNode(parentNode)) {
|
|
118
|
+
return node.ownerDocument ? node.ownerDocument.body : node.body;
|
|
119
|
+
}
|
|
120
|
+
if (isHTMLElement(parentNode) && isOverflowElement(parentNode)) {
|
|
121
|
+
return parentNode;
|
|
122
|
+
}
|
|
123
|
+
return getNearestOverflowAncestor(parentNode);
|
|
124
|
+
}
|
|
125
|
+
function getOverflowAncestors(node, list, traverseIframes) {
|
|
126
|
+
var _node$ownerDocument2;
|
|
127
|
+
if (list === void 0) {
|
|
128
|
+
list = [];
|
|
129
|
+
}
|
|
130
|
+
if (traverseIframes === void 0) {
|
|
131
|
+
traverseIframes = true;
|
|
132
|
+
}
|
|
133
|
+
const scrollableAncestor = getNearestOverflowAncestor(node);
|
|
134
|
+
const isBody = scrollableAncestor === ((_node$ownerDocument2 = node.ownerDocument) == null ? void 0 : _node$ownerDocument2.body);
|
|
135
|
+
const win = getWindow(scrollableAncestor);
|
|
136
|
+
if (isBody) {
|
|
137
|
+
const frameElement = getFrameElement(win);
|
|
138
|
+
return list.concat(win, win.visualViewport || [], isOverflowElement(scrollableAncestor) ? scrollableAncestor : [], frameElement && traverseIframes ? getOverflowAncestors(frameElement) : []);
|
|
139
|
+
}
|
|
140
|
+
return list.concat(scrollableAncestor, getOverflowAncestors(scrollableAncestor, [], traverseIframes));
|
|
141
|
+
}
|
|
142
|
+
function getFrameElement(win) {
|
|
143
|
+
return win.parent && Object.getPrototypeOf(win.parent) ? win.frameElement : null;
|
|
55
144
|
}
|
|
56
145
|
export {
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
146
|
+
getComputedStyle,
|
|
147
|
+
getContainingBlock,
|
|
148
|
+
getDocumentElement,
|
|
149
|
+
getFrameElement,
|
|
150
|
+
getNearestOverflowAncestor,
|
|
151
|
+
getNodeName,
|
|
152
|
+
getNodeScroll,
|
|
153
|
+
getOverflowAncestors,
|
|
154
|
+
getParentNode,
|
|
155
|
+
getWindow,
|
|
156
|
+
isContainingBlock,
|
|
157
|
+
isElement,
|
|
158
|
+
isHTMLElement,
|
|
159
|
+
isLastTraversableNode,
|
|
160
|
+
isNode,
|
|
161
|
+
isOverflowElement,
|
|
162
|
+
isShadowRoot,
|
|
163
|
+
isTableElement,
|
|
164
|
+
isTopLayer,
|
|
165
|
+
isWebKit
|
|
60
166
|
};
|
|
61
167
|
//# sourceMappingURL=react-text-annotator.es30.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"react-text-annotator.es30.js","sources":["../../../node_modules/
|
|
1
|
+
{"version":3,"file":"react-text-annotator.es30.js","sources":["../../../node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.mjs"],"sourcesContent":["function hasWindow() {\n return typeof window !== 'undefined';\n}\nfunction getNodeName(node) {\n if (isNode(node)) {\n return (node.nodeName || '').toLowerCase();\n }\n // Mocked nodes in testing environments may not be instances of Node. By\n // returning `#document` an infinite loop won't occur.\n // https://github.com/floating-ui/floating-ui/issues/2317\n return '#document';\n}\nfunction getWindow(node) {\n var _node$ownerDocument;\n return (node == null || (_node$ownerDocument = node.ownerDocument) == null ? void 0 : _node$ownerDocument.defaultView) || window;\n}\nfunction getDocumentElement(node) {\n var _ref;\n return (_ref = (isNode(node) ? node.ownerDocument : node.document) || window.document) == null ? void 0 : _ref.documentElement;\n}\nfunction isNode(value) {\n if (!hasWindow()) {\n return false;\n }\n return value instanceof Node || value instanceof getWindow(value).Node;\n}\nfunction isElement(value) {\n if (!hasWindow()) {\n return false;\n }\n return value instanceof Element || value instanceof getWindow(value).Element;\n}\nfunction isHTMLElement(value) {\n if (!hasWindow()) {\n return false;\n }\n return value instanceof HTMLElement || value instanceof getWindow(value).HTMLElement;\n}\nfunction isShadowRoot(value) {\n if (!hasWindow() || typeof ShadowRoot === 'undefined') {\n return false;\n }\n return value instanceof ShadowRoot || value instanceof getWindow(value).ShadowRoot;\n}\nfunction isOverflowElement(element) {\n const {\n overflow,\n overflowX,\n overflowY,\n display\n } = getComputedStyle(element);\n return /auto|scroll|overlay|hidden|clip/.test(overflow + overflowY + overflowX) && !['inline', 'contents'].includes(display);\n}\nfunction isTableElement(element) {\n return ['table', 'td', 'th'].includes(getNodeName(element));\n}\nfunction isTopLayer(element) {\n return [':popover-open', ':modal'].some(selector => {\n try {\n return element.matches(selector);\n } catch (e) {\n return false;\n }\n });\n}\nfunction isContainingBlock(elementOrCss) {\n const webkit = isWebKit();\n const css = isElement(elementOrCss) ? getComputedStyle(elementOrCss) : elementOrCss;\n\n // https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block\n // https://drafts.csswg.org/css-transforms-2/#individual-transforms\n return ['transform', 'translate', 'scale', 'rotate', 'perspective'].some(value => css[value] ? css[value] !== 'none' : false) || (css.containerType ? css.containerType !== 'normal' : false) || !webkit && (css.backdropFilter ? css.backdropFilter !== 'none' : false) || !webkit && (css.filter ? css.filter !== 'none' : false) || ['transform', 'translate', 'scale', 'rotate', 'perspective', 'filter'].some(value => (css.willChange || '').includes(value)) || ['paint', 'layout', 'strict', 'content'].some(value => (css.contain || '').includes(value));\n}\nfunction getContainingBlock(element) {\n let currentNode = getParentNode(element);\n while (isHTMLElement(currentNode) && !isLastTraversableNode(currentNode)) {\n if (isContainingBlock(currentNode)) {\n return currentNode;\n } else if (isTopLayer(currentNode)) {\n return null;\n }\n currentNode = getParentNode(currentNode);\n }\n return null;\n}\nfunction isWebKit() {\n if (typeof CSS === 'undefined' || !CSS.supports) return false;\n return CSS.supports('-webkit-backdrop-filter', 'none');\n}\nfunction isLastTraversableNode(node) {\n return ['html', 'body', '#document'].includes(getNodeName(node));\n}\nfunction getComputedStyle(element) {\n return getWindow(element).getComputedStyle(element);\n}\nfunction getNodeScroll(element) {\n if (isElement(element)) {\n return {\n scrollLeft: element.scrollLeft,\n scrollTop: element.scrollTop\n };\n }\n return {\n scrollLeft: element.scrollX,\n scrollTop: element.scrollY\n };\n}\nfunction getParentNode(node) {\n if (getNodeName(node) === 'html') {\n return node;\n }\n const result =\n // Step into the shadow DOM of the parent of a slotted node.\n node.assignedSlot ||\n // DOM Element detected.\n node.parentNode ||\n // ShadowRoot detected.\n isShadowRoot(node) && node.host ||\n // Fallback.\n getDocumentElement(node);\n return isShadowRoot(result) ? result.host : result;\n}\nfunction getNearestOverflowAncestor(node) {\n const parentNode = getParentNode(node);\n if (isLastTraversableNode(parentNode)) {\n return node.ownerDocument ? node.ownerDocument.body : node.body;\n }\n if (isHTMLElement(parentNode) && isOverflowElement(parentNode)) {\n return parentNode;\n }\n return getNearestOverflowAncestor(parentNode);\n}\nfunction getOverflowAncestors(node, list, traverseIframes) {\n var _node$ownerDocument2;\n if (list === void 0) {\n list = [];\n }\n if (traverseIframes === void 0) {\n traverseIframes = true;\n }\n const scrollableAncestor = getNearestOverflowAncestor(node);\n const isBody = scrollableAncestor === ((_node$ownerDocument2 = node.ownerDocument) == null ? void 0 : _node$ownerDocument2.body);\n const win = getWindow(scrollableAncestor);\n if (isBody) {\n const frameElement = getFrameElement(win);\n return list.concat(win, win.visualViewport || [], isOverflowElement(scrollableAncestor) ? scrollableAncestor : [], frameElement && traverseIframes ? getOverflowAncestors(frameElement) : []);\n }\n return list.concat(scrollableAncestor, getOverflowAncestors(scrollableAncestor, [], traverseIframes));\n}\nfunction getFrameElement(win) {\n return win.parent && Object.getPrototypeOf(win.parent) ? win.frameElement : null;\n}\n\nexport { getComputedStyle, getContainingBlock, getDocumentElement, getFrameElement, getNearestOverflowAncestor, getNodeName, getNodeScroll, getOverflowAncestors, getParentNode, getWindow, isContainingBlock, isElement, isHTMLElement, isLastTraversableNode, isNode, isOverflowElement, isShadowRoot, isTableElement, isTopLayer, isWebKit };\n"],"names":[],"mappings":"AAAA,SAAS,YAAY;AACnB,SAAO,OAAO,WAAW;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,GAAE,kBAAkB,kBAAkB,IAAI,qBAAqB,CAAE,GAAE,gBAAgB,kBAAkB,qBAAqB,YAAY,IAAI,EAAE;AAAA,EAChM;AACE,SAAO,KAAK,OAAO,oBAAoB,qBAAqB,oBAAoB,CAAA,GAAI,eAAe,CAAC;AACtG;AACA,SAAS,gBAAgB,KAAK;AAC5B,SAAO,IAAI,UAAU,OAAO,eAAe,IAAI,MAAM,IAAI,IAAI,eAAe;AAC9E;","x_google_ignoreList":[0]}
|
|
@@ -1,23 +1,314 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
/*!
|
|
2
|
+
* tabbable 6.2.0
|
|
3
|
+
* @license MIT, https://github.com/focus-trap/tabbable/blob/master/LICENSE
|
|
4
|
+
*/
|
|
5
|
+
var candidateSelectors = ["input:not([inert])", "select:not([inert])", "textarea:not([inert])", "a[href]:not([inert])", "button:not([inert])", "[tabindex]:not(slot):not([inert])", "audio[controls]:not([inert])", "video[controls]:not([inert])", '[contenteditable]:not([contenteditable="false"]):not([inert])', "details>summary:first-of-type:not([inert])", "details:not([inert])"];
|
|
6
|
+
var candidateSelector = /* @__PURE__ */ candidateSelectors.join(",");
|
|
7
|
+
var NoElement = typeof Element === "undefined";
|
|
8
|
+
var matches = NoElement ? function() {
|
|
9
|
+
} : Element.prototype.matches || Element.prototype.msMatchesSelector || Element.prototype.webkitMatchesSelector;
|
|
10
|
+
var getRootNode = !NoElement && Element.prototype.getRootNode ? function(element) {
|
|
11
|
+
var _element$getRootNode;
|
|
12
|
+
return element === null || element === void 0 ? void 0 : (_element$getRootNode = element.getRootNode) === null || _element$getRootNode === void 0 ? void 0 : _element$getRootNode.call(element);
|
|
13
|
+
} : function(element) {
|
|
14
|
+
return element === null || element === void 0 ? void 0 : element.ownerDocument;
|
|
15
|
+
};
|
|
16
|
+
var isInert = function isInert2(node, lookUp) {
|
|
17
|
+
var _node$getAttribute;
|
|
18
|
+
if (lookUp === void 0) {
|
|
19
|
+
lookUp = true;
|
|
20
|
+
}
|
|
21
|
+
var inertAtt = node === null || node === void 0 ? void 0 : (_node$getAttribute = node.getAttribute) === null || _node$getAttribute === void 0 ? void 0 : _node$getAttribute.call(node, "inert");
|
|
22
|
+
var inert = inertAtt === "" || inertAtt === "true";
|
|
23
|
+
var result = inert || lookUp && node && isInert2(node.parentNode);
|
|
24
|
+
return result;
|
|
25
|
+
};
|
|
26
|
+
var isContentEditable = function isContentEditable2(node) {
|
|
27
|
+
var _node$getAttribute2;
|
|
28
|
+
var attValue = node === null || node === void 0 ? void 0 : (_node$getAttribute2 = node.getAttribute) === null || _node$getAttribute2 === void 0 ? void 0 : _node$getAttribute2.call(node, "contenteditable");
|
|
29
|
+
return attValue === "" || attValue === "true";
|
|
30
|
+
};
|
|
31
|
+
var getCandidates = function getCandidates2(el, includeContainer, filter) {
|
|
32
|
+
if (isInert(el)) {
|
|
33
|
+
return [];
|
|
34
|
+
}
|
|
35
|
+
var candidates = Array.prototype.slice.apply(el.querySelectorAll(candidateSelector));
|
|
36
|
+
if (includeContainer && matches.call(el, candidateSelector)) {
|
|
37
|
+
candidates.unshift(el);
|
|
38
|
+
}
|
|
39
|
+
candidates = candidates.filter(filter);
|
|
40
|
+
return candidates;
|
|
41
|
+
};
|
|
42
|
+
var getCandidatesIteratively = function getCandidatesIteratively2(elements, includeContainer, options) {
|
|
43
|
+
var candidates = [];
|
|
44
|
+
var elementsToCheck = Array.from(elements);
|
|
45
|
+
while (elementsToCheck.length) {
|
|
46
|
+
var element = elementsToCheck.shift();
|
|
47
|
+
if (isInert(element, false)) {
|
|
48
|
+
continue;
|
|
49
|
+
}
|
|
50
|
+
if (element.tagName === "SLOT") {
|
|
51
|
+
var assigned = element.assignedElements();
|
|
52
|
+
var content = assigned.length ? assigned : element.children;
|
|
53
|
+
var nestedCandidates = getCandidatesIteratively2(content, true, options);
|
|
54
|
+
if (options.flatten) {
|
|
55
|
+
candidates.push.apply(candidates, nestedCandidates);
|
|
56
|
+
} else {
|
|
57
|
+
candidates.push({
|
|
58
|
+
scopeParent: element,
|
|
59
|
+
candidates: nestedCandidates
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
} else {
|
|
63
|
+
var validCandidate = matches.call(element, candidateSelector);
|
|
64
|
+
if (validCandidate && options.filter(element) && (includeContainer || !elements.includes(element))) {
|
|
65
|
+
candidates.push(element);
|
|
66
|
+
}
|
|
67
|
+
var shadowRoot = element.shadowRoot || // check for an undisclosed shadow
|
|
68
|
+
typeof options.getShadowRoot === "function" && options.getShadowRoot(element);
|
|
69
|
+
var validShadowRoot = !isInert(shadowRoot, false) && (!options.shadowRootFilter || options.shadowRootFilter(element));
|
|
70
|
+
if (shadowRoot && validShadowRoot) {
|
|
71
|
+
var _nestedCandidates = getCandidatesIteratively2(shadowRoot === true ? element.children : shadowRoot.children, true, options);
|
|
72
|
+
if (options.flatten) {
|
|
73
|
+
candidates.push.apply(candidates, _nestedCandidates);
|
|
74
|
+
} else {
|
|
75
|
+
candidates.push({
|
|
76
|
+
scopeParent: element,
|
|
77
|
+
candidates: _nestedCandidates
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
} else {
|
|
81
|
+
elementsToCheck.unshift.apply(elementsToCheck, element.children);
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
return candidates;
|
|
86
|
+
};
|
|
87
|
+
var hasTabIndex = function hasTabIndex2(node) {
|
|
88
|
+
return !isNaN(parseInt(node.getAttribute("tabindex"), 10));
|
|
89
|
+
};
|
|
90
|
+
var getTabIndex = function getTabIndex2(node) {
|
|
91
|
+
if (!node) {
|
|
92
|
+
throw new Error("No node provided");
|
|
93
|
+
}
|
|
94
|
+
if (node.tabIndex < 0) {
|
|
95
|
+
if ((/^(AUDIO|VIDEO|DETAILS)$/.test(node.tagName) || isContentEditable(node)) && !hasTabIndex(node)) {
|
|
96
|
+
return 0;
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
return node.tabIndex;
|
|
100
|
+
};
|
|
101
|
+
var getSortOrderTabIndex = function getSortOrderTabIndex2(node, isScope) {
|
|
102
|
+
var tabIndex = getTabIndex(node);
|
|
103
|
+
if (tabIndex < 0 && isScope && !hasTabIndex(node)) {
|
|
104
|
+
return 0;
|
|
105
|
+
}
|
|
106
|
+
return tabIndex;
|
|
107
|
+
};
|
|
108
|
+
var sortOrderedTabbables = function sortOrderedTabbables2(a, b) {
|
|
109
|
+
return a.tabIndex === b.tabIndex ? a.documentOrder - b.documentOrder : a.tabIndex - b.tabIndex;
|
|
110
|
+
};
|
|
111
|
+
var isInput = function isInput2(node) {
|
|
112
|
+
return node.tagName === "INPUT";
|
|
113
|
+
};
|
|
114
|
+
var isHiddenInput = function isHiddenInput2(node) {
|
|
115
|
+
return isInput(node) && node.type === "hidden";
|
|
116
|
+
};
|
|
117
|
+
var isDetailsWithSummary = function isDetailsWithSummary2(node) {
|
|
118
|
+
var r = node.tagName === "DETAILS" && Array.prototype.slice.apply(node.children).some(function(child) {
|
|
119
|
+
return child.tagName === "SUMMARY";
|
|
120
|
+
});
|
|
121
|
+
return r;
|
|
122
|
+
};
|
|
123
|
+
var getCheckedRadio = function getCheckedRadio2(nodes, form) {
|
|
124
|
+
for (var i = 0; i < nodes.length; i++) {
|
|
125
|
+
if (nodes[i].checked && nodes[i].form === form) {
|
|
126
|
+
return nodes[i];
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
};
|
|
130
|
+
var isTabbableRadio = function isTabbableRadio2(node) {
|
|
131
|
+
if (!node.name) {
|
|
132
|
+
return true;
|
|
133
|
+
}
|
|
134
|
+
var radioScope = node.form || getRootNode(node);
|
|
135
|
+
var queryRadios = function queryRadios2(name) {
|
|
136
|
+
return radioScope.querySelectorAll('input[type="radio"][name="' + name + '"]');
|
|
9
137
|
};
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
138
|
+
var radioSet;
|
|
139
|
+
if (typeof window !== "undefined" && typeof window.CSS !== "undefined" && typeof window.CSS.escape === "function") {
|
|
140
|
+
radioSet = queryRadios(window.CSS.escape(node.name));
|
|
141
|
+
} else {
|
|
142
|
+
try {
|
|
143
|
+
radioSet = queryRadios(node.name);
|
|
144
|
+
} catch (err) {
|
|
145
|
+
console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s", err.message);
|
|
146
|
+
return false;
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
var checked = getCheckedRadio(radioSet, node.form);
|
|
150
|
+
return !checked || checked === node;
|
|
151
|
+
};
|
|
152
|
+
var isRadio = function isRadio2(node) {
|
|
153
|
+
return isInput(node) && node.type === "radio";
|
|
154
|
+
};
|
|
155
|
+
var isNonTabbableRadio = function isNonTabbableRadio2(node) {
|
|
156
|
+
return isRadio(node) && !isTabbableRadio(node);
|
|
157
|
+
};
|
|
158
|
+
var isNodeAttached = function isNodeAttached2(node) {
|
|
159
|
+
var _nodeRoot;
|
|
160
|
+
var nodeRoot = node && getRootNode(node);
|
|
161
|
+
var nodeRootHost = (_nodeRoot = nodeRoot) === null || _nodeRoot === void 0 ? void 0 : _nodeRoot.host;
|
|
162
|
+
var attached = false;
|
|
163
|
+
if (nodeRoot && nodeRoot !== node) {
|
|
164
|
+
var _nodeRootHost, _nodeRootHost$ownerDo, _node$ownerDocument;
|
|
165
|
+
attached = !!((_nodeRootHost = nodeRootHost) !== null && _nodeRootHost !== void 0 && (_nodeRootHost$ownerDo = _nodeRootHost.ownerDocument) !== null && _nodeRootHost$ownerDo !== void 0 && _nodeRootHost$ownerDo.contains(nodeRootHost) || node !== null && node !== void 0 && (_node$ownerDocument = node.ownerDocument) !== null && _node$ownerDocument !== void 0 && _node$ownerDocument.contains(node));
|
|
166
|
+
while (!attached && nodeRootHost) {
|
|
167
|
+
var _nodeRoot2, _nodeRootHost2, _nodeRootHost2$ownerD;
|
|
168
|
+
nodeRoot = getRootNode(nodeRootHost);
|
|
169
|
+
nodeRootHost = (_nodeRoot2 = nodeRoot) === null || _nodeRoot2 === void 0 ? void 0 : _nodeRoot2.host;
|
|
170
|
+
attached = !!((_nodeRootHost2 = nodeRootHost) !== null && _nodeRootHost2 !== void 0 && (_nodeRootHost2$ownerD = _nodeRootHost2.ownerDocument) !== null && _nodeRootHost2$ownerD !== void 0 && _nodeRootHost2$ownerD.contains(nodeRootHost));
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
return attached;
|
|
174
|
+
};
|
|
175
|
+
var isZeroArea = function isZeroArea2(node) {
|
|
176
|
+
var _node$getBoundingClie = node.getBoundingClientRect(), width = _node$getBoundingClie.width, height = _node$getBoundingClie.height;
|
|
177
|
+
return width === 0 && height === 0;
|
|
178
|
+
};
|
|
179
|
+
var isHidden = function isHidden2(node, _ref) {
|
|
180
|
+
var displayCheck = _ref.displayCheck, getShadowRoot = _ref.getShadowRoot;
|
|
181
|
+
if (getComputedStyle(node).visibility === "hidden") {
|
|
182
|
+
return true;
|
|
183
|
+
}
|
|
184
|
+
var isDirectSummary = matches.call(node, "details>summary:first-of-type");
|
|
185
|
+
var nodeUnderDetails = isDirectSummary ? node.parentElement : node;
|
|
186
|
+
if (matches.call(nodeUnderDetails, "details:not([open]) *")) {
|
|
187
|
+
return true;
|
|
188
|
+
}
|
|
189
|
+
if (!displayCheck || displayCheck === "full" || displayCheck === "legacy-full") {
|
|
190
|
+
if (typeof getShadowRoot === "function") {
|
|
191
|
+
var originalNode = node;
|
|
192
|
+
while (node) {
|
|
193
|
+
var parentElement = node.parentElement;
|
|
194
|
+
var rootNode = getRootNode(node);
|
|
195
|
+
if (parentElement && !parentElement.shadowRoot && getShadowRoot(parentElement) === true) {
|
|
196
|
+
return isZeroArea(node);
|
|
197
|
+
} else if (node.assignedSlot) {
|
|
198
|
+
node = node.assignedSlot;
|
|
199
|
+
} else if (!parentElement && rootNode !== node.ownerDocument) {
|
|
200
|
+
node = rootNode.host;
|
|
201
|
+
} else {
|
|
202
|
+
node = parentElement;
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
node = originalNode;
|
|
206
|
+
}
|
|
207
|
+
if (isNodeAttached(node)) {
|
|
208
|
+
return !node.getClientRects().length;
|
|
209
|
+
}
|
|
210
|
+
if (displayCheck !== "legacy-full") {
|
|
211
|
+
return true;
|
|
212
|
+
}
|
|
213
|
+
} else if (displayCheck === "non-zero-area") {
|
|
214
|
+
return isZeroArea(node);
|
|
215
|
+
}
|
|
216
|
+
return false;
|
|
217
|
+
};
|
|
218
|
+
var isDisabledFromFieldset = function isDisabledFromFieldset2(node) {
|
|
219
|
+
if (/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(node.tagName)) {
|
|
220
|
+
var parentNode = node.parentElement;
|
|
221
|
+
while (parentNode) {
|
|
222
|
+
if (parentNode.tagName === "FIELDSET" && parentNode.disabled) {
|
|
223
|
+
for (var i = 0; i < parentNode.children.length; i++) {
|
|
224
|
+
var child = parentNode.children.item(i);
|
|
225
|
+
if (child.tagName === "LEGEND") {
|
|
226
|
+
return matches.call(parentNode, "fieldset[disabled] *") ? true : !child.contains(node);
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
return true;
|
|
230
|
+
}
|
|
231
|
+
parentNode = parentNode.parentElement;
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
return false;
|
|
235
|
+
};
|
|
236
|
+
var isNodeMatchingSelectorFocusable = function isNodeMatchingSelectorFocusable2(options, node) {
|
|
237
|
+
if (node.disabled || // we must do an inert look up to filter out any elements inside an inert ancestor
|
|
238
|
+
// because we're limited in the type of selectors we can use in JSDom (see related
|
|
239
|
+
// note related to `candidateSelectors`)
|
|
240
|
+
isInert(node) || isHiddenInput(node) || isHidden(node, options) || // For a details element with a summary, the summary element gets the focus
|
|
241
|
+
isDetailsWithSummary(node) || isDisabledFromFieldset(node)) {
|
|
242
|
+
return false;
|
|
243
|
+
}
|
|
244
|
+
return true;
|
|
245
|
+
};
|
|
246
|
+
var isNodeMatchingSelectorTabbable = function isNodeMatchingSelectorTabbable2(options, node) {
|
|
247
|
+
if (isNonTabbableRadio(node) || getTabIndex(node) < 0 || !isNodeMatchingSelectorFocusable(options, node)) {
|
|
248
|
+
return false;
|
|
249
|
+
}
|
|
250
|
+
return true;
|
|
251
|
+
};
|
|
252
|
+
var isValidShadowRootTabbable = function isValidShadowRootTabbable2(shadowHostNode) {
|
|
253
|
+
var tabIndex = parseInt(shadowHostNode.getAttribute("tabindex"), 10);
|
|
254
|
+
if (isNaN(tabIndex) || tabIndex >= 0) {
|
|
255
|
+
return true;
|
|
256
|
+
}
|
|
257
|
+
return false;
|
|
258
|
+
};
|
|
259
|
+
var sortByOrder = function sortByOrder2(candidates) {
|
|
260
|
+
var regularTabbables = [];
|
|
261
|
+
var orderedTabbables = [];
|
|
262
|
+
candidates.forEach(function(item, i) {
|
|
263
|
+
var isScope = !!item.scopeParent;
|
|
264
|
+
var element = isScope ? item.scopeParent : item;
|
|
265
|
+
var candidateTabindex = getSortOrderTabIndex(element, isScope);
|
|
266
|
+
var elements = isScope ? sortByOrder2(item.candidates) : element;
|
|
267
|
+
if (candidateTabindex === 0) {
|
|
268
|
+
isScope ? regularTabbables.push.apply(regularTabbables, elements) : regularTabbables.push(element);
|
|
269
|
+
} else {
|
|
270
|
+
orderedTabbables.push({
|
|
271
|
+
documentOrder: i,
|
|
272
|
+
tabIndex: candidateTabindex,
|
|
273
|
+
item,
|
|
274
|
+
isScope,
|
|
275
|
+
content: elements
|
|
276
|
+
});
|
|
277
|
+
}
|
|
278
|
+
});
|
|
279
|
+
return orderedTabbables.sort(sortOrderedTabbables).reduce(function(acc, sortable) {
|
|
280
|
+
sortable.isScope ? acc.push.apply(acc, sortable.content) : acc.push(sortable.content);
|
|
281
|
+
return acc;
|
|
282
|
+
}, []).concat(regularTabbables);
|
|
283
|
+
};
|
|
284
|
+
var tabbable = function tabbable2(container, options) {
|
|
285
|
+
options = options || {};
|
|
286
|
+
var candidates;
|
|
287
|
+
if (options.getShadowRoot) {
|
|
288
|
+
candidates = getCandidatesIteratively([container], options.includeContainer, {
|
|
289
|
+
filter: isNodeMatchingSelectorTabbable.bind(null, options),
|
|
290
|
+
flatten: false,
|
|
291
|
+
getShadowRoot: options.getShadowRoot,
|
|
292
|
+
shadowRootFilter: isValidShadowRootTabbable
|
|
293
|
+
});
|
|
294
|
+
} else {
|
|
295
|
+
candidates = getCandidates(container, options.includeContainer, isNodeMatchingSelectorTabbable.bind(null, options));
|
|
296
|
+
}
|
|
297
|
+
return sortByOrder(candidates);
|
|
298
|
+
};
|
|
299
|
+
var isTabbable = function isTabbable2(node, options) {
|
|
300
|
+
options = options || {};
|
|
301
|
+
if (!node) {
|
|
302
|
+
throw new Error("No node provided");
|
|
303
|
+
}
|
|
304
|
+
if (matches.call(node, candidateSelector) === false) {
|
|
305
|
+
return false;
|
|
306
|
+
}
|
|
307
|
+
return isNodeMatchingSelectorTabbable(options, node);
|
|
308
|
+
};
|
|
19
309
|
export {
|
|
20
|
-
|
|
21
|
-
|
|
310
|
+
getTabIndex,
|
|
311
|
+
isTabbable,
|
|
312
|
+
tabbable
|
|
22
313
|
};
|
|
23
314
|
//# sourceMappingURL=react-text-annotator.es31.js.map
|