@soomo/react-text-annotator 3.1.0-staging.8 → 3.2.0-staging.0

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.
Files changed (89) hide show
  1. package/dist/TextAnnotationPopup/TextAnnotationPopup.d.ts +32 -0
  2. package/dist/TextAnnotationPopup/TextAnnotationPopup.d.ts.map +1 -0
  3. package/dist/TextAnnotationPopup/index.d.ts +2 -0
  4. package/dist/TextAnnotationPopup/index.d.ts.map +1 -0
  5. package/dist/TextAnnotationPopup/isMobile.d.ts.map +1 -0
  6. package/dist/TextAnnotator.d.ts +5 -5
  7. package/dist/TextAnnotator.d.ts.map +1 -1
  8. package/dist/hooks/index.d.ts +2 -1
  9. package/dist/hooks/index.d.ts.map +1 -1
  10. package/dist/hooks/useAnnotationQuoteIdling.d.ts +4 -0
  11. package/dist/hooks/useAnnotationQuoteIdling.d.ts.map +1 -0
  12. package/dist/hooks/useAnnouncePopupNavigation.d.ts.map +1 -1
  13. package/dist/index.d.ts +4 -3
  14. package/dist/index.d.ts.map +1 -1
  15. package/dist/react-text-annotator.es.js +10 -4
  16. package/dist/react-text-annotator.es.js.map +1 -1
  17. package/dist/react-text-annotator.es10.js +24 -10
  18. package/dist/react-text-annotator.es10.js.map +1 -1
  19. package/dist/react-text-annotator.es11.js +82 -9
  20. package/dist/react-text-annotator.es11.js.map +1 -1
  21. package/dist/react-text-annotator.es12.js +33 -1436
  22. package/dist/react-text-annotator.es12.js.map +1 -1
  23. package/dist/react-text-annotator.es13.js +28 -0
  24. package/dist/react-text-annotator.es13.js.map +1 -0
  25. package/dist/react-text-annotator.es14.js +1590 -193
  26. package/dist/react-text-annotator.es14.js.map +1 -1
  27. package/dist/react-text-annotator.es15.js +9 -584
  28. package/dist/react-text-annotator.es15.js.map +1 -1
  29. package/dist/react-text-annotator.es17.js +592 -33
  30. package/dist/react-text-annotator.es17.js.map +1 -1
  31. package/dist/react-text-annotator.es18.js +282 -2
  32. package/dist/react-text-annotator.es18.js.map +1 -1
  33. package/dist/react-text-annotator.es19.js +13 -29
  34. package/dist/react-text-annotator.es19.js.map +1 -1
  35. package/dist/react-text-annotator.es2.js +5 -2
  36. package/dist/react-text-annotator.es2.js.map +1 -1
  37. package/dist/react-text-annotator.es20.js +2 -898
  38. package/dist/react-text-annotator.es20.js.map +1 -1
  39. package/dist/react-text-annotator.es21.js +30 -113
  40. package/dist/react-text-annotator.es21.js.map +1 -1
  41. package/dist/react-text-annotator.es22.js +876 -297
  42. package/dist/react-text-annotator.es22.js.map +1 -1
  43. package/dist/react-text-annotator.es23.js +109 -53
  44. package/dist/react-text-annotator.es23.js.map +1 -1
  45. package/dist/react-text-annotator.es24.js +306 -17
  46. package/dist/react-text-annotator.es24.js.map +1 -1
  47. package/dist/react-text-annotator.es25.js +58 -2
  48. package/dist/react-text-annotator.es25.js.map +1 -1
  49. package/dist/react-text-annotator.es26.js +20 -2
  50. package/dist/react-text-annotator.es26.js.map +1 -1
  51. package/dist/react-text-annotator.es27.js +2 -127
  52. package/dist/react-text-annotator.es27.js.map +1 -1
  53. package/dist/react-text-annotator.es28.js +2 -164
  54. package/dist/react-text-annotator.es28.js.map +1 -1
  55. package/dist/react-text-annotator.es29.js +115 -299
  56. package/dist/react-text-annotator.es29.js.map +1 -1
  57. package/dist/react-text-annotator.es3.js +3 -3
  58. package/dist/react-text-annotator.es3.js.map +1 -1
  59. package/dist/react-text-annotator.es30.js +146 -131
  60. package/dist/react-text-annotator.es30.js.map +1 -1
  61. package/dist/react-text-annotator.es31.js +281 -533
  62. package/dist/react-text-annotator.es31.js.map +1 -1
  63. package/dist/react-text-annotator.es32.js +152 -0
  64. package/dist/react-text-annotator.es32.js.map +1 -0
  65. package/dist/react-text-annotator.es33.js +629 -0
  66. package/dist/react-text-annotator.es33.js.map +1 -0
  67. package/dist/react-text-annotator.es4.js +2 -2
  68. package/dist/react-text-annotator.es4.js.map +1 -1
  69. package/dist/react-text-annotator.es5.js +43 -24
  70. package/dist/react-text-annotator.es5.js.map +1 -1
  71. package/dist/react-text-annotator.es6.js +23 -122
  72. package/dist/react-text-annotator.es6.js.map +1 -1
  73. package/dist/react-text-annotator.es7.js +133 -537
  74. package/dist/react-text-annotator.es7.js.map +1 -1
  75. package/dist/react-text-annotator.es8.js +2 -9
  76. package/dist/react-text-annotator.es8.js.map +1 -1
  77. package/dist/tei/CETEIcean.d.ts +1 -0
  78. package/dist/tei/CETEIcean.d.ts.map +1 -1
  79. package/dist/tei/TEIAnnotator.d.ts +1 -1
  80. package/dist/tei/TEIAnnotator.d.ts.map +1 -1
  81. package/package.json +16 -14
  82. package/dist/TextAnnotatorPopup/TextAnnotatorPopup.d.ts +0 -25
  83. package/dist/TextAnnotatorPopup/TextAnnotatorPopup.d.ts.map +0 -1
  84. package/dist/TextAnnotatorPopup/index.d.ts +0 -2
  85. package/dist/TextAnnotatorPopup/index.d.ts.map +0 -1
  86. package/dist/TextAnnotatorPopup/isMobile.d.ts.map +0 -1
  87. package/dist/react-text-annotator.es16.js +0 -85
  88. package/dist/react-text-annotator.es16.js.map +0 -1
  89. /package/dist/{TextAnnotatorPopup → TextAnnotationPopup}/isMobile.d.ts +0 -0
@@ -1,167 +1,5 @@
1
- function hasWindow() {
2
- return typeof window !== "undefined";
3
- }
4
- function getNodeName(node) {
5
- if (isNode(node)) {
6
- return (node.nodeName || "").toLowerCase();
7
- }
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;
21
- }
22
- return value instanceof Node || value instanceof getWindow(value).Node;
23
- }
24
- function isElement(value) {
25
- if (!hasWindow()) {
26
- return false;
27
- }
28
- return value instanceof Element || value instanceof getWindow(value).Element;
29
- }
30
- function isHTMLElement(value) {
31
- if (!hasWindow()) {
32
- return false;
33
- }
34
- return value instanceof HTMLElement || value instanceof getWindow(value).HTMLElement;
35
- }
36
- function isShadowRoot(value) {
37
- if (!hasWindow() || typeof ShadowRoot === "undefined") {
38
- return false;
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));
53
- }
54
- function isTopLayer(element) {
55
- return [":popover-open", ":modal"].some((selector) => {
56
- try {
57
- return element.matches(selector);
58
- } catch (e) {
59
- return false;
60
- }
61
- });
62
- }
63
- function isContainingBlock(elementOrCss) {
64
- const webkit = isWebKit();
65
- const css = isElement(elementOrCss) ? getComputedStyle(elementOrCss) : elementOrCss;
66
- 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));
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;
75
- }
76
- currentNode = getParentNode(currentNode);
77
- }
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;
144
- }
1
+ var reactJsxRuntime_development = {};
145
2
  export {
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
3
+ reactJsxRuntime_development as __exports
166
4
  };
167
5
  //# sourceMappingURL=react-text-annotator.es28.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"react-text-annotator.es28.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 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));\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;AAC3B;AACA,SAAS,YAAY,MAAM;AACzB,MAAI,OAAO,IAAI,GAAG;AAChB,YAAQ,KAAK,YAAY,IAAI,YAAW;AAAA,EACzC;AAID,SAAO;AACT;AACA,SAAS,UAAU,MAAM;AACvB,MAAI;AACJ,UAAQ,QAAQ,SAAS,sBAAsB,K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google_ignoreList":[0]}
1
+ {"version":3,"file":"react-text-annotator.es28.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
@@ -1,314 +1,130 @@
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 + '"]');
137
- };
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;
1
+ import { isShadowRoot, isHTMLElement } from "./react-text-annotator.es30.js";
2
+ function activeElement(doc) {
3
+ let activeElement2 = doc.activeElement;
4
+ while (((_activeElement = activeElement2) == null || (_activeElement = _activeElement.shadowRoot) == null ? void 0 : _activeElement.activeElement) != null) {
5
+ var _activeElement;
6
+ activeElement2 = activeElement2.shadowRoot.activeElement;
7
+ }
8
+ return activeElement2;
9
+ }
10
+ function contains(parent, child) {
11
+ if (!parent || !child) {
12
+ return false;
183
13
  }
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]) *")) {
14
+ const rootNode = child.getRootNode == null ? void 0 : child.getRootNode();
15
+ if (parent.contains(child)) {
187
16
  return true;
188
17
  }
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
- }
18
+ if (rootNode && isShadowRoot(rootNode)) {
19
+ let next = child;
20
+ while (next) {
21
+ if (parent === next) {
229
22
  return true;
230
23
  }
231
- parentNode = parentNode.parentElement;
24
+ next = next.parentNode || next.host;
232
25
  }
233
26
  }
234
27
  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) {
28
+ }
29
+ function getPlatform() {
30
+ const uaData = navigator.userAgentData;
31
+ if (uaData != null && uaData.platform) {
32
+ return uaData.platform;
33
+ }
34
+ return navigator.platform;
35
+ }
36
+ function getUserAgent() {
37
+ const uaData = navigator.userAgentData;
38
+ if (uaData && Array.isArray(uaData.brands)) {
39
+ return uaData.brands.map((_ref) => {
40
+ let {
41
+ brand,
42
+ version
43
+ } = _ref;
44
+ return brand + "/" + version;
45
+ }).join(" ");
46
+ }
47
+ return navigator.userAgent;
48
+ }
49
+ function isVirtualClick(event) {
50
+ if (event.mozInputSource === 0 && event.isTrusted) {
255
51
  return true;
256
52
  }
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) {
53
+ if (isAndroid() && event.pointerType) {
54
+ return event.type === "click" && event.buttons === 1;
55
+ }
56
+ return event.detail === 0 && !event.pointerType;
57
+ }
58
+ function isVirtualPointerEvent(event) {
59
+ if (isJSDOM()) return false;
60
+ return !isAndroid() && event.width === 0 && event.height === 0 || isAndroid() && event.width === 1 && event.height === 1 && event.pressure === 0 && event.detail === 0 && event.pointerType === "mouse" || // iOS VoiceOver returns 0.333• for width/height.
61
+ event.width < 1 && event.height < 1 && event.pressure === 0 && event.detail === 0 && event.pointerType === "touch";
62
+ }
63
+ function isSafari() {
64
+ return /apple/i.test(navigator.vendor);
65
+ }
66
+ function isAndroid() {
67
+ const re = /android/i;
68
+ return re.test(getPlatform()) || re.test(getUserAgent());
69
+ }
70
+ function isJSDOM() {
71
+ return getUserAgent().includes("jsdom/");
72
+ }
73
+ function isReactEvent(event) {
74
+ return "nativeEvent" in event;
75
+ }
76
+ function isRootElement(element) {
77
+ return element.matches("html,body");
78
+ }
79
+ function getDocument(node) {
80
+ return (node == null ? void 0 : node.ownerDocument) || document;
81
+ }
82
+ function isEventTargetWithin(event, node) {
83
+ if (node == null) {
305
84
  return false;
306
85
  }
307
- return isNodeMatchingSelectorTabbable(options, node);
308
- };
86
+ if ("composedPath" in event) {
87
+ return event.composedPath().includes(node);
88
+ }
89
+ const e = event;
90
+ return e.target != null && node.contains(e.target);
91
+ }
92
+ function getTarget(event) {
93
+ if ("composedPath" in event) {
94
+ return event.composedPath()[0];
95
+ }
96
+ return event.target;
97
+ }
98
+ const TYPEABLE_SELECTOR = "input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])";
99
+ function isTypeableElement(element) {
100
+ return isHTMLElement(element) && element.matches(TYPEABLE_SELECTOR);
101
+ }
102
+ function stopEvent(event) {
103
+ event.preventDefault();
104
+ event.stopPropagation();
105
+ }
106
+ function isTypeableCombobox(element) {
107
+ if (!element) return false;
108
+ return element.getAttribute("role") === "combobox" && isTypeableElement(element);
109
+ }
309
110
  export {
310
- getTabIndex,
311
- isTabbable,
312
- tabbable
111
+ TYPEABLE_SELECTOR,
112
+ activeElement,
113
+ contains,
114
+ getDocument,
115
+ getPlatform,
116
+ getTarget,
117
+ getUserAgent,
118
+ isAndroid,
119
+ isEventTargetWithin,
120
+ isJSDOM,
121
+ isReactEvent,
122
+ isRootElement,
123
+ isSafari,
124
+ isTypeableCombobox,
125
+ isTypeableElement,
126
+ isVirtualClick,
127
+ isVirtualPointerEvent,
128
+ stopEvent
313
129
  };
314
130
  //# sourceMappingURL=react-text-annotator.es29.js.map