@soomo/react-text-annotator 3.0.0-staging.40 → 3.0.0-staging.41
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 +1381 -417
- package/dist/react-text-annotator.es11.js.map +1 -1
- package/dist/react-text-annotator.es13.js +232 -36
- package/dist/react-text-annotator.es13.js.map +1 -1
- package/dist/react-text-annotator.es14.js +491 -1373
- package/dist/react-text-annotator.es14.js.map +1 -1
- package/dist/react-text-annotator.es15.js +490 -0
- package/dist/react-text-annotator.es15.js.map +1 -0
- package/dist/react-text-annotator.es16.js +57 -234
- package/dist/react-text-annotator.es16.js.map +1 -1
- package/dist/react-text-annotator.es17.js +33 -557
- package/dist/react-text-annotator.es17.js.map +1 -1
- package/dist/react-text-annotator.es19.js +1 -1
- package/dist/react-text-annotator.es2.js +1 -1
- package/dist/react-text-annotator.es20.js +1 -1
- package/dist/react-text-annotator.es21.js +124 -111
- package/dist/react-text-annotator.es21.js.map +1 -1
- package/dist/react-text-annotator.es22.js +129 -286
- package/dist/react-text-annotator.es22.js.map +1 -1
- package/dist/react-text-annotator.es23.js +296 -43
- package/dist/react-text-annotator.es23.js.map +1 -1
- package/dist/react-text-annotator.es24.js +113 -19
- package/dist/react-text-annotator.es24.js.map +1 -1
- package/dist/react-text-annotator.es25.js +309 -2
- package/dist/react-text-annotator.es25.js.map +1 -1
- package/dist/react-text-annotator.es26.js +58 -2
- package/dist/react-text-annotator.es26.js.map +1 -1
- package/dist/react-text-annotator.es27.js +17 -124
- package/dist/react-text-annotator.es27.js.map +1 -1
- package/dist/react-text-annotator.es28.js +2 -152
- package/dist/react-text-annotator.es28.js.map +1 -1
- package/dist/react-text-annotator.es29.js +2 -311
- package/dist/react-text-annotator.es29.js.map +1 -1
- package/dist/react-text-annotator.es5.js +2 -2
- package/dist/react-text-annotator.es7.js +3 -3
- package/package.json +2 -2
- package/dist/react-text-annotator.es12.js +0 -67
- package/dist/react-text-annotator.es12.js.map +0 -1
|
@@ -1,312 +1,155 @@
|
|
|
1
|
-
function
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
while (e && e.previousElementSibling !== null && (name ? e.previousElementSibling.localName == name : true)) {
|
|
5
|
-
pos++;
|
|
6
|
-
e = e.previousElementSibling;
|
|
7
|
-
if (!e.previousElementSibling) {
|
|
8
|
-
break;
|
|
9
|
-
}
|
|
1
|
+
function getNodeName(node) {
|
|
2
|
+
if (isNode(node)) {
|
|
3
|
+
return (node.nodeName || "").toLowerCase();
|
|
10
4
|
}
|
|
11
|
-
return
|
|
5
|
+
return "#document";
|
|
12
6
|
}
|
|
13
|
-
function
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
let result;
|
|
17
|
-
switch (n.nodeType) {
|
|
18
|
-
case 1:
|
|
19
|
-
result = doc.createElement(n.nodeName);
|
|
20
|
-
break;
|
|
21
|
-
case 9:
|
|
22
|
-
result = doc.implementation.createDocument();
|
|
23
|
-
break;
|
|
24
|
-
case 11:
|
|
25
|
-
result = doc.createDocumentFragment();
|
|
26
|
-
break;
|
|
27
|
-
default:
|
|
28
|
-
result = n.cloneNode(true);
|
|
29
|
-
}
|
|
30
|
-
if (n.attributes) {
|
|
31
|
-
for (let att of Array.from(n.attributes)) {
|
|
32
|
-
if (att.name !== "data-processed") {
|
|
33
|
-
result.setAttribute(att.name, att.value);
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
for (let nd of Array.from(n.childNodes)) {
|
|
38
|
-
if (nd.nodeType == 1) {
|
|
39
|
-
if (nd.hasAttribute("data-original")) {
|
|
40
|
-
for (let childNode of Array.from(nd.childNodes)) {
|
|
41
|
-
let child = result.appendChild(clone(childNode));
|
|
42
|
-
if (child.nodeType === 1 && child.hasAttribute("data-origid")) {
|
|
43
|
-
child.setAttribute("id", child.getAttribute("data-origid"));
|
|
44
|
-
child.removeAttribute("data-origid");
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
return result;
|
|
48
|
-
} else if (nd.hasAttribute("data-origname")) {
|
|
49
|
-
result.appendChild(clone(nd));
|
|
50
|
-
}
|
|
51
|
-
} else {
|
|
52
|
-
result.appendChild(nd.cloneNode());
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
return result;
|
|
56
|
-
};
|
|
57
|
-
return clone(node);
|
|
7
|
+
function getWindow(node) {
|
|
8
|
+
var _node$ownerDocument;
|
|
9
|
+
return (node == null || (_node$ownerDocument = node.ownerDocument) == null ? void 0 : _node$ownerDocument.defaultView) || window;
|
|
58
10
|
}
|
|
59
|
-
function
|
|
60
|
-
|
|
11
|
+
function getDocumentElement(node) {
|
|
12
|
+
var _ref;
|
|
13
|
+
return (_ref = (isNode(node) ? node.ownerDocument : node.document) || window.document) == null ? void 0 : _ref.documentElement;
|
|
61
14
|
}
|
|
62
|
-
function
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
hidden.setAttribute("hidden", "");
|
|
68
|
-
hidden.setAttribute("data-original", "");
|
|
69
|
-
for (let node of Array.from(elt.childNodes)) {
|
|
70
|
-
if (node !== hidden) {
|
|
71
|
-
if (node.nodeType === 1) {
|
|
72
|
-
node.setAttribute("data-processed", "");
|
|
73
|
-
for (let e of node.querySelectorAll("*")) {
|
|
74
|
-
e.setAttribute("data-processed", "");
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
hidden.appendChild(elt.removeChild(node));
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
if (rewriteIds) {
|
|
81
|
-
for (let e of Array.from(hidden.querySelectorAll("*"))) {
|
|
82
|
-
if (e.hasAttribute("id")) {
|
|
83
|
-
e.setAttribute("data-origid", e.getAttribute("id"));
|
|
84
|
-
e.removeAttribute("id");
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
}
|
|
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;
|
|
89
20
|
}
|
|
90
|
-
function
|
|
91
|
-
return
|
|
21
|
+
function isHTMLElement(value) {
|
|
22
|
+
return value instanceof HTMLElement || value instanceof getWindow(value).HTMLElement;
|
|
92
23
|
}
|
|
93
|
-
function
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
result += str;
|
|
24
|
+
function isShadowRoot(value) {
|
|
25
|
+
if (typeof ShadowRoot === "undefined") {
|
|
26
|
+
return false;
|
|
97
27
|
}
|
|
98
|
-
return
|
|
28
|
+
return value instanceof ShadowRoot || value instanceof getWindow(value).ShadowRoot;
|
|
99
29
|
}
|
|
100
|
-
function
|
|
101
|
-
|
|
102
|
-
|
|
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);
|
|
103
38
|
}
|
|
104
|
-
function
|
|
105
|
-
return
|
|
39
|
+
function isTableElement(element) {
|
|
40
|
+
return ["table", "td", "th"].includes(getNodeName(element));
|
|
106
41
|
}
|
|
107
|
-
function
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
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
|
+
});
|
|
113
50
|
}
|
|
114
|
-
function
|
|
115
|
-
|
|
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));
|
|
116
55
|
}
|
|
117
|
-
function
|
|
118
|
-
let
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
if (typeof ws === "string" && ws !== "") {
|
|
127
|
-
str += "\n" + ws + "<";
|
|
128
|
-
} else {
|
|
129
|
-
str += "<";
|
|
130
|
-
}
|
|
131
|
-
str += el.getAttribute("data-origname");
|
|
132
|
-
let attrNames = el.hasAttribute("data-origatts") ? el.getAttribute("data-origatts").split(" ") : [];
|
|
133
|
-
for (let attr of Array.from(el.attributes)) {
|
|
134
|
-
if (!attr.name.startsWith("data-") && !["id", "lang", "class"].includes(attr.name)) {
|
|
135
|
-
str += " " + attrNames.find(function(e) {
|
|
136
|
-
return e.toLowerCase() == attr.name;
|
|
137
|
-
}) + '="' + attr.value + '"';
|
|
138
|
-
}
|
|
139
|
-
if (attr.name == "data-xmlns") {
|
|
140
|
-
str += ' xmlns="' + attr.value + '"';
|
|
141
|
-
}
|
|
142
|
-
}
|
|
143
|
-
if (el.childNodes.length > 0) {
|
|
144
|
-
str += ">";
|
|
145
|
-
} else {
|
|
146
|
-
str += "/>";
|
|
147
|
-
}
|
|
148
|
-
}
|
|
149
|
-
for (let node of Array.from(el.childNodes)) {
|
|
150
|
-
switch (node.nodeType) {
|
|
151
|
-
case 1:
|
|
152
|
-
if (typeof ws === "string") {
|
|
153
|
-
str += serialize(node, false, ws + " ");
|
|
154
|
-
} else {
|
|
155
|
-
str += serialize(node, false, ws);
|
|
156
|
-
}
|
|
157
|
-
break;
|
|
158
|
-
case 7:
|
|
159
|
-
str += `<?${node.nodeName} ${node.nodeValue}?>`;
|
|
160
|
-
if (el.nodeType === 9 || el.nodeType === 11) {
|
|
161
|
-
str += "\n";
|
|
162
|
-
}
|
|
163
|
-
break;
|
|
164
|
-
case 8:
|
|
165
|
-
str += `<!--${node.nodeValue}-->`;
|
|
166
|
-
if (el.nodeType === 9 || el.nodeType === 11) {
|
|
167
|
-
str += "\n";
|
|
168
|
-
}
|
|
169
|
-
break;
|
|
170
|
-
default:
|
|
171
|
-
if (stripElt && ignorable(node.nodeValue)) {
|
|
172
|
-
str += node.nodeValue.replace(/^\s*\n/, "");
|
|
173
|
-
}
|
|
174
|
-
if (typeof ws === "string" && ignorable(node.nodeValue)) {
|
|
175
|
-
break;
|
|
176
|
-
}
|
|
177
|
-
str += node.nodeValue;
|
|
178
|
-
}
|
|
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);
|
|
179
65
|
}
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
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
|
+
};
|
|
187
84
|
}
|
|
188
|
-
|
|
189
|
-
|
|
85
|
+
return {
|
|
86
|
+
scrollLeft: element.scrollX,
|
|
87
|
+
scrollTop: element.scrollY
|
|
88
|
+
};
|
|
89
|
+
}
|
|
90
|
+
function getParentNode(node) {
|
|
91
|
+
if (getNodeName(node) === "html") {
|
|
92
|
+
return node;
|
|
190
93
|
}
|
|
191
|
-
|
|
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;
|
|
192
102
|
}
|
|
193
|
-
function
|
|
194
|
-
const
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
return !/[^\t\n\r ]/.test(txt);
|
|
198
|
-
};
|
|
199
|
-
if (!stripElt && el.nodeType == 1) {
|
|
200
|
-
if (typeof ws === "string" && ws !== "") {
|
|
201
|
-
str += "\n" + ws + "<";
|
|
202
|
-
} else {
|
|
203
|
-
str += "<";
|
|
204
|
-
}
|
|
205
|
-
str += el.nodeName;
|
|
206
|
-
for (let attr of Array.from(el.attributes)) {
|
|
207
|
-
str += " " + attr.name + '="' + attr.value + '"';
|
|
208
|
-
}
|
|
209
|
-
str += ">";
|
|
103
|
+
function getNearestOverflowAncestor(node) {
|
|
104
|
+
const parentNode = getParentNode(node);
|
|
105
|
+
if (isLastTraversableNode(parentNode)) {
|
|
106
|
+
return node.ownerDocument ? node.ownerDocument.body : node.body;
|
|
210
107
|
}
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
case 1:
|
|
214
|
-
if (typeof ws === "string") {
|
|
215
|
-
str += serializeHTML(node, false, ws + " ");
|
|
216
|
-
} else {
|
|
217
|
-
str += serializeHTML(node, false, ws);
|
|
218
|
-
}
|
|
219
|
-
break;
|
|
220
|
-
case 7:
|
|
221
|
-
str += `<?${node.nodeName} ${node.nodeValue}?>`;
|
|
222
|
-
if (el.nodeType === 9 || el.nodeType === 11) {
|
|
223
|
-
str += "\n";
|
|
224
|
-
}
|
|
225
|
-
break;
|
|
226
|
-
case 8:
|
|
227
|
-
str += `<!--${node.nodeValue}-->`;
|
|
228
|
-
if (el.nodeType === 9 || el.nodeType === 11) {
|
|
229
|
-
str += "\n";
|
|
230
|
-
}
|
|
231
|
-
break;
|
|
232
|
-
default:
|
|
233
|
-
if (stripElt && ignorable(node.nodeValue)) {
|
|
234
|
-
str += node.nodeValue.replace(/^\s*\n/, "");
|
|
235
|
-
}
|
|
236
|
-
if (typeof ws === "string" && ignorable(node.nodeValue)) {
|
|
237
|
-
break;
|
|
238
|
-
}
|
|
239
|
-
str += node.nodeValue.replace(/</g, "<");
|
|
240
|
-
}
|
|
108
|
+
if (isHTMLElement(parentNode) && isOverflowElement(parentNode)) {
|
|
109
|
+
return parentNode;
|
|
241
110
|
}
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
str += "</";
|
|
249
|
-
}
|
|
250
|
-
str += `${el.nodeName}>`;
|
|
251
|
-
}
|
|
111
|
+
return getNearestOverflowAncestor(parentNode);
|
|
112
|
+
}
|
|
113
|
+
function getOverflowAncestors(node, list, traverseIframes) {
|
|
114
|
+
var _node$ownerDocument2;
|
|
115
|
+
if (list === void 0) {
|
|
116
|
+
list = [];
|
|
252
117
|
}
|
|
253
|
-
if (
|
|
254
|
-
|
|
118
|
+
if (traverseIframes === void 0) {
|
|
119
|
+
traverseIframes = true;
|
|
255
120
|
}
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
if (name.includes(":"), 1) {
|
|
263
|
-
return name.replace(/:/, "-").toLowerCase();
|
|
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
|
+
const frameElement = getFrameElement(win);
|
|
126
|
+
return list.concat(win, win.visualViewport || [], isOverflowElement(scrollableAncestor) ? scrollableAncestor : [], frameElement && traverseIframes ? getOverflowAncestors(frameElement) : []);
|
|
264
127
|
}
|
|
128
|
+
return list.concat(scrollableAncestor, getOverflowAncestors(scrollableAncestor, [], traverseIframes));
|
|
265
129
|
}
|
|
266
|
-
function
|
|
267
|
-
|
|
268
|
-
window.customElements.define(tagName(name), class extends HTMLElement {
|
|
269
|
-
constructor() {
|
|
270
|
-
super();
|
|
271
|
-
if (!this.matches(":defined")) {
|
|
272
|
-
if (behavior) {
|
|
273
|
-
behavior.call(this);
|
|
274
|
-
this.setAttribute("data-processed", "");
|
|
275
|
-
}
|
|
276
|
-
}
|
|
277
|
-
}
|
|
278
|
-
// Process new elements when they are connected to the browser DOM
|
|
279
|
-
connectedCallback() {
|
|
280
|
-
if (!this.hasAttribute("data-processed")) {
|
|
281
|
-
if (behavior) {
|
|
282
|
-
behavior.call(this);
|
|
283
|
-
this.setAttribute("data-processed", "");
|
|
284
|
-
}
|
|
285
|
-
}
|
|
286
|
-
}
|
|
287
|
-
});
|
|
288
|
-
} catch (error) {
|
|
289
|
-
if (debug) {
|
|
290
|
-
console.log(tagName(name) + " couldn't be registered or is already registered.");
|
|
291
|
-
console.log(error);
|
|
292
|
-
}
|
|
293
|
-
}
|
|
130
|
+
function getFrameElement(win) {
|
|
131
|
+
return win.parent && Object.getPrototypeOf(win.parent) ? win.frameElement : null;
|
|
294
132
|
}
|
|
295
133
|
export {
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
134
|
+
getComputedStyle,
|
|
135
|
+
getContainingBlock,
|
|
136
|
+
getDocumentElement,
|
|
137
|
+
getFrameElement,
|
|
138
|
+
getNearestOverflowAncestor,
|
|
139
|
+
getNodeName,
|
|
140
|
+
getNodeScroll,
|
|
141
|
+
getOverflowAncestors,
|
|
142
|
+
getParentNode,
|
|
143
|
+
getWindow,
|
|
144
|
+
isContainingBlock,
|
|
145
|
+
isElement,
|
|
146
|
+
isHTMLElement,
|
|
147
|
+
isLastTraversableNode,
|
|
148
|
+
isNode,
|
|
149
|
+
isOverflowElement,
|
|
150
|
+
isShadowRoot,
|
|
151
|
+
isTableElement,
|
|
152
|
+
isTopLayer,
|
|
153
|
+
isWebKit
|
|
311
154
|
};
|
|
312
155
|
//# sourceMappingURL=react-text-annotator.es22.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"react-text-annotator.es22.js","sources":["../../../node_modules/CETEIcean/src/utilities.js"],"sourcesContent":["export function getOrdinality(elt, name) {\n let pos = 1;\n let e = elt;\n while (e && e.previousElementSibling !== null && (name ? e.previousElementSibling.localName == name : true)) {\n pos++;\n e = e.previousElementSibling;\n if (!e.previousElementSibling) {\n break;\n }\n }\n return pos;\n}\n\n/* \n Performs a deep copy operation of the input node while stripping\n out child elements introduced by CETEIcean.\n*/ \nexport function copyAndReset(node) {\n const doc = node.ownerDocument;\n let clone = (n) => { \n let result;\n switch (n.nodeType) {\n case 1: // nodeType 1 is Node.ELEMENT_NODE\n result = doc.createElement(n.nodeName);\n break;\n case 9: // nodeType 9 is Node.DOCUMENT_NODE\n result = doc.implementation.createDocument();\n break;\n case 11: // nodeType 11 is Node.DOCUMENT_FRAGMENT_NODE\n result = doc.createDocumentFragment();\n break;\n default:\n result = n.cloneNode(true);\n }\n if (n.attributes) {\n for (let att of Array.from(n.attributes)) {\n if (att.name !== \"data-processed\") {\n result.setAttribute(att.name,att.value);\n }\n }\n }\n for (let nd of Array.from(n.childNodes)){\n // nodeType 1 is Node.ELEMENT_NODE\n if (nd.nodeType == 1) {\n if (nd.hasAttribute(\"data-original\")) {\n for (let childNode of Array.from(nd.childNodes)) {\n let child = result.appendChild(clone(childNode));\n // nodeType 1 is Node.ELEMENT_NODE\n if (child.nodeType === 1 && child.hasAttribute(\"data-origid\")) {\n child.setAttribute(\"id\", child.getAttribute(\"data-origid\"));\n child.removeAttribute(\"data-origid\");\n }\n }\n return result;\n } else if (nd.hasAttribute(\"data-origname\")) {\n result.appendChild(clone(nd));\n }\n } else {\n result.appendChild(nd.cloneNode());\n }\n }\n return result;\n }\n return clone(node);\n}\n\n/* \n Given a space-separated list of URLs (e.g. in a ref with multiple\n targets), returns just the first one.\n*/\nexport function first(urls) {\n return urls.replace(/ .*$/, \"\");\n}\n\n/* \n Wraps the content of the element parameter in a hidden <cetei-original data-original>\n*/\nexport function hideContent(elt, rewriteIds = true) {\n const doc = elt.ownerDocument;\n if (elt.childNodes.length > 0) {\n let hidden = doc.createElement(\"cetei-original\");\n elt.appendChild(hidden);\n hidden.setAttribute(\"hidden\", \"\");\n hidden.setAttribute(\"data-original\", \"\");\n for (let node of Array.from(elt.childNodes)) {\n if (node !== hidden) {\n // nodeType 1 is Node.ELEMENT_NODE\n if (node.nodeType === 1) {\n node.setAttribute(\"data-processed\", \"\");\n for (let e of node.querySelectorAll(\"*\")) {\n e.setAttribute(\"data-processed\", \"\");\n }\n }\n hidden.appendChild(elt.removeChild(node));\n }\n }\n if (rewriteIds) {\n for (let e of Array.from(hidden.querySelectorAll(\"*\"))) {\n if (e.hasAttribute(\"id\")) {\n e.setAttribute(\"data-origid\", e.getAttribute(\"id\"));\n e.removeAttribute(\"id\");\n }\n }\n }\n }\n}\n\nexport function normalizeURI(urls) {\n return this.rw(this.first(urls))\n}\n\n/* \n Takes a string and a number and returns the original string\n printed that number of times.\n*/\nexport function repeat(str, times) {\n let result = \"\";\n for (let i = 0; i < times; i++) {\n result += str;\n }\n return result;\n}\n\n/* \n Resolves URIs that use TEI prefixDefs into full URIs.\n See https://www.tei-c.org/release/doc/tei-p5-doc/en/html/ref-prefixDef.html\n*/\nexport function resolveURI(uri) {\n let prefixdef = this.prefixDefs[uri.substring(0,uri.indexOf(\":\"))];\n return uri.replace(new RegExp(prefixdef[\"matchPattern\"]), prefixdef[\"replacementPattern\"]);\n}\n\n/*\n Convenience function for getting prefix definitions, Takes a prefix\n and returns an object with \"matchPattern\" and \"replacementPattern\"\n keys.\n*/\nexport function getPrefixDef(prefix) {\n return this.prefixDefs[prefix];\n}\n\n/* \n Takes a relative URL and rewrites it based on the base URL of the\n HTML document\n*/\nexport function rw(url) {\n if (!url.match(/^(?:http|mailto|file|\\/|#).*$/)) {\n return this.base + first(url);\n } else {\n return url;\n }\n}\n\n/*\n Combines the functionality of copyAndReset() and serialize() to return\n a \"clean\" version of the XML markup.\n */\nexport function resetAndSerialize(el, stripElt, ws) {\n return serialize(copyAndReset(el), stripElt, ws);\n}\n\n/* \n Takes an element and serializes it to an XML string or, if the stripElt\n parameter is set, serializes the element's content. The ws parameter, if\n set, will switch on minimal \"pretty-printing\" and indenting of the serialized\n result.\n*/\nexport function serialize(el, stripElt, ws) {\n let str = \"\";\n const ignorable = (txt) => {\n return !(/[^\\t\\n\\r ]/.test(txt));\n }\n if (el.nodeType === 9 || el.nodeType === 11) { // nodeType 9 is Node.DOCUMENT_NODE; nodeType 11 is Node.DOCUMENT_FRAGMENT_NODE\n str += \"<?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?>\\n\";\n }\n // nodeType 1 is Node.ELEMENT_NODE\n if (!stripElt && el.nodeType == 1) {\n if ((typeof ws === \"string\") && ws !== \"\") {\n str += \"\\n\" + ws + \"<\";\n } else {\n str += \"<\";\n }\n str += el.getAttribute(\"data-origname\");\n // HTML5 lowercases all attribute names; @data-origatts contains the original names\n let attrNames = el.hasAttribute(\"data-origatts\") ? el.getAttribute(\"data-origatts\").split(\" \") : [];\n for (let attr of Array.from(el.attributes)) {\n if (!attr.name.startsWith(\"data-\") && !([\"id\", \"lang\", \"class\"].includes(attr.name))) {\n str += \" \" + attrNames.find(function(e) {return e.toLowerCase() == attr.name}) + \"=\\\"\" + attr.value + \"\\\"\";\n }\n if (attr.name == \"data-xmlns\") {\n str += \" xmlns=\\\"\" + attr.value +\"\\\"\";\n }\n }\n if (el.childNodes.length > 0) {\n str += \">\";\n } else {\n str += \"/>\";\n }\n }\n for (let node of Array.from(el.childNodes)) {\n // nodeType 1 is Node.ELEMENT_NODE\n // nodeType 7 is Node.PROCESSING_INSTRUCTION_NODE\n // nodeType 8 is Node.COMMENT_NODE\n switch (node.nodeType) {\n case 1:\n if (typeof ws === \"string\") {\n str += serialize(node, false, ws + \" \");\n } else {\n str += serialize(node, false, ws);\n }\n break;\n case 7:\n str += `<?${node.nodeName} ${node.nodeValue}?>`;\n if (el.nodeType === 9 || el.nodeType === 11) {\n str += \"\\n\";\n }\n break;\n case 8:\n str += `<!--${node.nodeValue}-->`;\n if (el.nodeType === 9 || el.nodeType === 11) {\n str += \"\\n\";\n }\n break;\n default:\n if (stripElt && ignorable(node.nodeValue)) {\n str += node.nodeValue.replace(/^\\s*\\n/, \"\");\n }\n if ((typeof ws === \"string\") && ignorable(node.nodeValue)) {\n break;\n }\n str += node.nodeValue;\n }\n }\n if (!stripElt && el.nodeType == 1 && el.childNodes.length > 0) {\n if (typeof ws === \"string\") {\n str += \"\\n\" + ws + \"</\";\n } else {\n str += \"</\";\n }\n str += el.getAttribute(\"data-origname\") + \">\";\n }\n if (el.nodeType === 9 || el.nodeType === 11) {\n str += \"\\n\";\n }\n return str;\n}\n\n/* \n Write out the HTML markup to a string, using HTML conventions.\n */\nexport function serializeHTML(el, stripElt, ws) {\n const EMPTY_ELEMENTS = ['area', 'base', 'br', 'col', 'embed', 'hr', 'img', 'input', 'link', 'meta', 'param', 'source', 'track', 'wbr'];\n let str = \"\";\n const ignorable = (txt) => {\n return !(/[^\\t\\n\\r ]/.test(txt));\n }\n // nodeType 1 is Node.ELEMENT_NODE\n if (!stripElt && el.nodeType == 1) {\n if ((typeof ws === \"string\") && ws !== \"\") {\n str += \"\\n\" + ws + \"<\";\n } else {\n str += \"<\";\n }\n str += el.nodeName;\n for (let attr of Array.from(el.attributes)) {\n str += \" \" + attr.name + \"=\\\"\" + attr.value + \"\\\"\";\n }\n str += \">\";\n }\n for (let node of Array.from(el.childNodes)) {\n // nodeType 1 is Node.ELEMENT_NODE\n // nodeType 7 is Node.PROCESSING_INSTRUCTION_NODE\n // nodeType 8 is Node.COMMENT_NODE\n switch (node.nodeType) {\n case 1:\n if (typeof ws === \"string\") {\n str += serializeHTML(node, false, ws + \" \");\n } else {\n str += serializeHTML(node, false, ws);\n }\n break;\n case 7:\n str += `<?${node.nodeName} ${node.nodeValue}?>`;\n if (el.nodeType === 9 || el.nodeType === 11) {\n str += \"\\n\";\n }\n break;\n case 8:\n str += `<!--${node.nodeValue}-->`;\n if (el.nodeType === 9 || el.nodeType === 11) {\n str += \"\\n\";\n }\n break;\n default:\n if (stripElt && ignorable(node.nodeValue)) {\n str += node.nodeValue.replace(/^\\s*\\n/, \"\");\n }\n if ((typeof ws === \"string\") && ignorable(node.nodeValue)) {\n break;\n }\n str += node.nodeValue.replace(/</g, \"<\");\n }\n }\n if (!EMPTY_ELEMENTS.includes(el.nodeName)) {\n if (!stripElt && el.nodeType == 1) {\n if (typeof ws === \"string\") {\n str += `\\n${ws}</`;\n } else {\n str += \"</\";\n }\n str += `${el.nodeName}>`;\n }\n }\n if (el.nodeType === 9 || el.nodeType === 11) {\n str += \"\\n\";\n }\n return str;\n}\n\nexport function unEscapeEntities(str) {\n return str.replace(/>/, \">\")\n .replace(/"/, \"\\\"\")\n .replace(/'/, \"'\")\n .replace(/&/, \"&\");\n}\n\n// Given a qualified name (e.g. tei:text), return the element name\nexport function tagName(name) {\n if (name.includes(\":\"), 1) {\n return name.replace(/:/,\"-\").toLowerCase();\n } else {\n return \"ceteicean-\" + name.toLowerCase();\n }\n}\n\nexport function defineCustomElement(name, behavior = null, debug = false) {\n /* \n Registers the list of elements provided with the browser.\n Called by makeHTML5(), but can be called independently if, for example,\n you've created Custom Elements via an XSLT transformation instead.\n */\n try {\n window.customElements.define(tagName(name), class extends HTMLElement {\n constructor() {\n super(); \n if (!this.matches(\":defined\")) { // \"Upgraded\" undefined elements can have attributes & children; new elements can't\n if (behavior) {\n behavior.call(this);\n // We don't want to double-process elements, so add a flag\n this.setAttribute(\"data-processed\", \"\");\n }\n }\n }\n // Process new elements when they are connected to the browser DOM\n connectedCallback() {\n if (!this.hasAttribute(\"data-processed\")) {\n if (behavior) {\n behavior.call(this);\n this.setAttribute(\"data-processed\", \"\");\n }\n }\n };\n });\n } catch (error) {\n // When using the same CETEIcean instance for multiple TEI files, this error becomes very common. \n // It's muted by default unless the debug option is set.\n if (debug) {\n console.log(tagName(name) + \" couldn't be registered or is already registered.\");\n console.log(error);\n }\n }\n}\n"],"names":[],"mappings":"AAAO,SAAS,cAAc,KAAK,MAAM;AACvC,MAAI,MAAM;AACV,MAAI,IAAI;AACR,SAAO,KAAK,EAAE,2BAA2B,SAAS,OAAO,EAAE,uBAAuB,aAAa,OAAO,OAAO;AAC3G;AACA,QAAI,EAAE;AACN,QAAI,CAAC,EAAE,wBAAwB;AAC7B;AAAA,IACD;AAAA,EACF;AACD,SAAO;AACT;AAMO,SAAS,aAAa,MAAM;AACjC,QAAM,MAAM,KAAK;AACjB,MAAI,QAAQ,CAAC,MAAM;AACjB,QAAI;AACJ,YAAQ,EAAE,UAAQ;AAAA,MAChB,KAAK;AACH,iBAAS,IAAI,cAAc,EAAE,QAAQ;AACrC;AAAA,MACF,KAAK;AACH,iBAAS,IAAI,eAAe;AAC5B;AAAA,MACF,KAAK;AACH,iBAAS,IAAI;AACb;AAAA,M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AI,KAAK,SAAS,GAAG,GAAG,GAAG;AACzB,WAAO,KAAK,QAAQ,KAAI,GAAG,EAAE,YAAW;AAAA,EAGzC;AACH;AAEO,SAAS,oBAAoB,MAAM,WAAW,MAAM,QAAQ,OAAO;AAMxE,MAAI;AACF,WAAO,eAAe,OAAO,QAAQ,IAAI,GAAG,cAAc,YAAY;AAAA,MACpE,cAAc;AACZ;AACA,YAAI,CAAC,KAAK,QAAQ,UAAU,GAAG;AAC7B,cAAI,UAAU;AACZ,qBAAS,KAAK,IAAI;AAElB,iBAAK,aAAa,kBAAkB,EAAE;AAAA,UACvC;AAAA,QACF;AAAA,MACF;AAAA;AAAA,MAED,oBAAoB;AAClB,YAAI,CAAC,KAAK,aAAa,gBAAgB,GAAG;AACxC,cAAI,UAAU;AACZ,qBAAS,KAAK,IAAI;AAClB,iBAAK,aAAa,kBAAkB,EAAE;AAAA,UACvC;AAAA,QACF;AAAA,MACF;AAAA,IACP,CAAK;AAAA,EACF,SAAQ,OAAO;AAGd,QAAI,OAAO;AACP,cAAQ,IAAI,QAAQ,IAAI,IAAI,mDAAmD;AAC/E,cAAQ,IAAI,KAAK;AAAA,IACpB;AAAA,EACF;AACH;","x_google_ignoreList":[0]}
|
|
1
|
+
{"version":3,"file":"react-text-annotator.es22.js","sources":["../../../node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.mjs"],"sourcesContent":["function 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 return value instanceof Node || value instanceof getWindow(value).Node;\n}\nfunction isElement(value) {\n return value instanceof Element || value instanceof getWindow(value).Element;\n}\nfunction isHTMLElement(value) {\n return value instanceof HTMLElement || value instanceof getWindow(value).HTMLElement;\n}\nfunction isShadowRoot(value) {\n // Browsers without `ShadowRoot` support.\n if (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, isO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