issue-sticker 0.10.0 → 0.11.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.
- package/CHANGELOG.md +17 -0
- package/dist/{externalUserPayload-DNGAp9bP.js → externalUserPayload-BbOEmKZD.js} +1243 -29
- package/dist/issue-sticker-headless-react.js +3 -3
- package/dist/issue-sticker-headless.js +2 -2
- package/dist/issue-sticker-react.js +574 -96
- package/dist/{three-_bdgDAmI.js → three-DQdLNs7v.js} +2 -2
- package/dist/{tooltip-UijEbdDX.js → tooltip-DSCAsWIp.js} +1 -1
- package/headless.d.ts +22 -0
- package/package.json +2 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { t as getCanvasSource, v as onCanvasSourceRegistered, C as CANVAS_INTERACTION_TAG, w as gzip_1, R as REPLAY_EVENT_TYPE, x as record, a as cn, p as useCallbackRef$1, i as useComposedRefs, f as Primitive, P as Presence, j as Portal$1, g as composeEventHandlers, k as createContextScope, l as createSlot, D as DismissableLayer, y as Content, z as createPopperScope, m as useControllableState,
|
|
1
|
+
import { t as getCanvasSource, v as onCanvasSourceRegistered, C as CANVAS_INTERACTION_TAG, w as gzip_1, R as REPLAY_EVENT_TYPE, x as record, a as cn, p as useCallbackRef$1, i as useComposedRefs, f as Primitive, P as Presence, j as Portal$1, g as composeEventHandlers, k as createContextScope, l as createSlot, D as DismissableLayer, y as Content, z as createPopperScope, A as Anchor, m as useControllableState, B as Root2$1, n as useId, E as Arrow, d as usePortalContainer, e as OVERLAY_LAYER, s as stopEscapePropagation, o as useLayoutEffect2, V as VISUALLY_HIDDEN_STYLES, c as createLucideIcon, F as clsx, S as Slot$2, O as OVERLAY_LAYER_INDEX, M as MousePointer2 } from "./three-DQdLNs7v.js";
|
|
2
2
|
import { jsx, jsxs, Fragment } from "react/jsx-runtime";
|
|
3
3
|
import * as React from "react";
|
|
4
|
-
import React__default, { useState,
|
|
4
|
+
import React__default, { useState, useRef, useEffect, useCallback, createContext, useContext, useLayoutEffect, useMemo } from "react";
|
|
5
5
|
import * as ReactDOM from "react-dom";
|
|
6
6
|
const DEFAULT_MAX_DURATION_MS = 12e4;
|
|
7
7
|
const MIME_TYPE_CANDIDATES = ["video/webm;codecs=vp9", "video/webm"];
|
|
@@ -894,7 +894,7 @@ function settleFrame() {
|
|
|
894
894
|
async function resolveNodeId(canvas) {
|
|
895
895
|
var _a;
|
|
896
896
|
try {
|
|
897
|
-
const { record: record2 } = await import("./three-
|
|
897
|
+
const { record: record2 } = await import("./three-DQdLNs7v.js").then((n) => n.I);
|
|
898
898
|
const id = (_a = record2.mirror) == null ? void 0 : _a.getId(canvas);
|
|
899
899
|
return typeof id === "number" && id > 0 ? id : null;
|
|
900
900
|
} catch {
|
|
@@ -913,7 +913,7 @@ function startCanvasInteractionTracking(options = {}) {
|
|
|
913
913
|
const lastSnapshot = /* @__PURE__ */ new WeakMap();
|
|
914
914
|
let pending = null;
|
|
915
915
|
const emit2 = options.emit ?? ((tag, payload) => {
|
|
916
|
-
void import("./three-
|
|
916
|
+
void import("./three-DQdLNs7v.js").then((n) => n.I).then(({ addCustomEvent }) => addCustomEvent(tag, payload));
|
|
917
917
|
});
|
|
918
918
|
const pointerOf = (started, rect) => [
|
|
919
919
|
(started.x - rect.left) / rect.width * 2 - 1,
|
|
@@ -6169,14 +6169,844 @@ function composeIssueFilterGroups(integrations, customFields) {
|
|
|
6169
6169
|
}
|
|
6170
6170
|
return Array.from(groups.values()).sort((a2, b) => a2.label.localeCompare(b.label));
|
|
6171
6171
|
}
|
|
6172
|
-
const
|
|
6173
|
-
|
|
6174
|
-
|
|
6175
|
-
|
|
6176
|
-
|
|
6177
|
-
|
|
6178
|
-
|
|
6179
|
-
|
|
6172
|
+
const IGNORED_NAME = /^(Primitive\.|Slot|Presence|Portal|Fragment|Suspense|StrictMode)|(Provider|Context|Consumer)$/;
|
|
6173
|
+
const MAX_DEPTH = 300;
|
|
6174
|
+
function fiberOf(element) {
|
|
6175
|
+
for (const key of Object.keys(element)) {
|
|
6176
|
+
if (key.startsWith("__reactFiber$") || key.startsWith("__reactInternalInstance$")) {
|
|
6177
|
+
return element[key] ?? null;
|
|
6178
|
+
}
|
|
6179
|
+
}
|
|
6180
|
+
return null;
|
|
6181
|
+
}
|
|
6182
|
+
function nameOf(type) {
|
|
6183
|
+
if (typeof type === "function") {
|
|
6184
|
+
const fn = type;
|
|
6185
|
+
return fn.displayName ?? fn.name ?? null;
|
|
6186
|
+
}
|
|
6187
|
+
if (type && typeof type === "object") {
|
|
6188
|
+
const wrapper = type;
|
|
6189
|
+
return wrapper.displayName ?? nameOf(wrapper.render) ?? nameOf(wrapper.type);
|
|
6190
|
+
}
|
|
6191
|
+
return null;
|
|
6192
|
+
}
|
|
6193
|
+
const reactAdapter = {
|
|
6194
|
+
framework: "react",
|
|
6195
|
+
collect(element) {
|
|
6196
|
+
let fiber = fiberOf(element);
|
|
6197
|
+
if (!fiber) return null;
|
|
6198
|
+
const names = [];
|
|
6199
|
+
for (let depth = 0; fiber && depth < MAX_DEPTH; depth += 1) {
|
|
6200
|
+
const name = nameOf(fiber.type);
|
|
6201
|
+
if (typeof name === "string" && name && !IGNORED_NAME.test(name)) names.unshift(name);
|
|
6202
|
+
fiber = fiber.return;
|
|
6203
|
+
}
|
|
6204
|
+
return names;
|
|
6205
|
+
}
|
|
6206
|
+
};
|
|
6207
|
+
const ADAPTERS = [reactAdapter];
|
|
6208
|
+
const MIN_NAME_LENGTH = 3;
|
|
6209
|
+
const MAX_NAME_LENGTH = 60;
|
|
6210
|
+
function cleanPath(names) {
|
|
6211
|
+
if (!names) return [];
|
|
6212
|
+
const kept = names.filter((name) => typeof name === "string").map(
|
|
6213
|
+
(name) => name.replace(/\s+/g, " ").trim().slice(0, MAX_NAME_LENGTH).replace(/[\uD800-\uDBFF]$/, "")
|
|
6214
|
+
).filter((name) => name.length >= MIN_NAME_LENGTH);
|
|
6215
|
+
const deduped = kept.filter((name, index) => name !== kept[index - 1]);
|
|
6216
|
+
return deduped.slice(-8);
|
|
6217
|
+
}
|
|
6218
|
+
function collectComponentPath(element, adapters = ADAPTERS) {
|
|
6219
|
+
for (const adapter of adapters) {
|
|
6220
|
+
let path = [];
|
|
6221
|
+
try {
|
|
6222
|
+
path = cleanPath(adapter.collect(element));
|
|
6223
|
+
} catch {
|
|
6224
|
+
path = [];
|
|
6225
|
+
}
|
|
6226
|
+
if (path.length) return { framework: adapter.framework, path };
|
|
6227
|
+
}
|
|
6228
|
+
return null;
|
|
6229
|
+
}
|
|
6230
|
+
var toStr = Object.prototype.toString;
|
|
6231
|
+
function isCallable(fn) {
|
|
6232
|
+
return typeof fn === "function" || toStr.call(fn) === "[object Function]";
|
|
6233
|
+
}
|
|
6234
|
+
function toInteger(value) {
|
|
6235
|
+
var number = Number(value);
|
|
6236
|
+
if (isNaN(number)) {
|
|
6237
|
+
return 0;
|
|
6238
|
+
}
|
|
6239
|
+
if (number === 0 || !isFinite(number)) {
|
|
6240
|
+
return number;
|
|
6241
|
+
}
|
|
6242
|
+
return (number > 0 ? 1 : -1) * Math.floor(Math.abs(number));
|
|
6243
|
+
}
|
|
6244
|
+
var maxSafeInteger = Math.pow(2, 53) - 1;
|
|
6245
|
+
function toLength(value) {
|
|
6246
|
+
var len = toInteger(value);
|
|
6247
|
+
return Math.min(Math.max(len, 0), maxSafeInteger);
|
|
6248
|
+
}
|
|
6249
|
+
function arrayFrom(arrayLike, mapFn) {
|
|
6250
|
+
var C = Array;
|
|
6251
|
+
var items = Object(arrayLike);
|
|
6252
|
+
if (arrayLike == null) {
|
|
6253
|
+
throw new TypeError("Array.from requires an array-like object - not null or undefined");
|
|
6254
|
+
}
|
|
6255
|
+
var len = toLength(items.length);
|
|
6256
|
+
var A = isCallable(C) ? Object(new C(len)) : new Array(len);
|
|
6257
|
+
var k = 0;
|
|
6258
|
+
var kValue;
|
|
6259
|
+
while (k < len) {
|
|
6260
|
+
kValue = items[k];
|
|
6261
|
+
{
|
|
6262
|
+
A[k] = kValue;
|
|
6263
|
+
}
|
|
6264
|
+
k += 1;
|
|
6265
|
+
}
|
|
6266
|
+
A.length = len;
|
|
6267
|
+
return A;
|
|
6268
|
+
}
|
|
6269
|
+
function _typeof(o2) {
|
|
6270
|
+
"@babel/helpers - typeof";
|
|
6271
|
+
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o3) {
|
|
6272
|
+
return typeof o3;
|
|
6273
|
+
} : function(o3) {
|
|
6274
|
+
return o3 && "function" == typeof Symbol && o3.constructor === Symbol && o3 !== Symbol.prototype ? "symbol" : typeof o3;
|
|
6275
|
+
}, _typeof(o2);
|
|
6276
|
+
}
|
|
6277
|
+
function _classCallCheck(instance, Constructor) {
|
|
6278
|
+
if (!(instance instanceof Constructor)) {
|
|
6279
|
+
throw new TypeError("Cannot call a class as a function");
|
|
6280
|
+
}
|
|
6281
|
+
}
|
|
6282
|
+
function _defineProperties(target, props) {
|
|
6283
|
+
for (var i2 = 0; i2 < props.length; i2++) {
|
|
6284
|
+
var descriptor = props[i2];
|
|
6285
|
+
descriptor.enumerable = descriptor.enumerable || false;
|
|
6286
|
+
descriptor.configurable = true;
|
|
6287
|
+
if ("value" in descriptor) descriptor.writable = true;
|
|
6288
|
+
Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor);
|
|
6289
|
+
}
|
|
6290
|
+
}
|
|
6291
|
+
function _createClass(Constructor, protoProps, staticProps) {
|
|
6292
|
+
if (protoProps) _defineProperties(Constructor.prototype, protoProps);
|
|
6293
|
+
Object.defineProperty(Constructor, "prototype", { writable: false });
|
|
6294
|
+
return Constructor;
|
|
6295
|
+
}
|
|
6296
|
+
function _defineProperty(obj, key, value) {
|
|
6297
|
+
key = _toPropertyKey(key);
|
|
6298
|
+
if (key in obj) {
|
|
6299
|
+
Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
|
|
6300
|
+
} else {
|
|
6301
|
+
obj[key] = value;
|
|
6302
|
+
}
|
|
6303
|
+
return obj;
|
|
6304
|
+
}
|
|
6305
|
+
function _toPropertyKey(t2) {
|
|
6306
|
+
var i2 = _toPrimitive(t2, "string");
|
|
6307
|
+
return "symbol" == _typeof(i2) ? i2 : i2 + "";
|
|
6308
|
+
}
|
|
6309
|
+
function _toPrimitive(t2, r2) {
|
|
6310
|
+
if ("object" != _typeof(t2) || !t2) return t2;
|
|
6311
|
+
var e2 = t2[Symbol.toPrimitive];
|
|
6312
|
+
if (void 0 !== e2) {
|
|
6313
|
+
var i2 = e2.call(t2, r2);
|
|
6314
|
+
if ("object" != _typeof(i2)) return i2;
|
|
6315
|
+
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
6316
|
+
}
|
|
6317
|
+
return String(t2);
|
|
6318
|
+
}
|
|
6319
|
+
var SetLike = /* @__PURE__ */ (function() {
|
|
6320
|
+
function SetLike2() {
|
|
6321
|
+
var items = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : [];
|
|
6322
|
+
_classCallCheck(this, SetLike2);
|
|
6323
|
+
_defineProperty(this, "items", void 0);
|
|
6324
|
+
this.items = items;
|
|
6325
|
+
}
|
|
6326
|
+
return _createClass(SetLike2, [{
|
|
6327
|
+
key: "add",
|
|
6328
|
+
value: function add(value) {
|
|
6329
|
+
if (this.has(value) === false) {
|
|
6330
|
+
this.items.push(value);
|
|
6331
|
+
}
|
|
6332
|
+
return this;
|
|
6333
|
+
}
|
|
6334
|
+
}, {
|
|
6335
|
+
key: "clear",
|
|
6336
|
+
value: function clear() {
|
|
6337
|
+
this.items = [];
|
|
6338
|
+
}
|
|
6339
|
+
}, {
|
|
6340
|
+
key: "delete",
|
|
6341
|
+
value: function _delete(value) {
|
|
6342
|
+
var previousLength = this.items.length;
|
|
6343
|
+
this.items = this.items.filter(function(item) {
|
|
6344
|
+
return item !== value;
|
|
6345
|
+
});
|
|
6346
|
+
return previousLength !== this.items.length;
|
|
6347
|
+
}
|
|
6348
|
+
}, {
|
|
6349
|
+
key: "forEach",
|
|
6350
|
+
value: function forEach(callbackfn) {
|
|
6351
|
+
var _this = this;
|
|
6352
|
+
this.items.forEach(function(item) {
|
|
6353
|
+
callbackfn(item, item, _this);
|
|
6354
|
+
});
|
|
6355
|
+
}
|
|
6356
|
+
}, {
|
|
6357
|
+
key: "has",
|
|
6358
|
+
value: function has(value) {
|
|
6359
|
+
return this.items.indexOf(value) !== -1;
|
|
6360
|
+
}
|
|
6361
|
+
}, {
|
|
6362
|
+
key: "size",
|
|
6363
|
+
get: function get() {
|
|
6364
|
+
return this.items.length;
|
|
6365
|
+
}
|
|
6366
|
+
}]);
|
|
6367
|
+
})();
|
|
6368
|
+
const SetLike$1 = typeof Set === "undefined" ? Set : SetLike;
|
|
6369
|
+
function getLocalName(element) {
|
|
6370
|
+
var _element$localName;
|
|
6371
|
+
return (
|
|
6372
|
+
// eslint-disable-next-line no-restricted-properties -- actual guard for environments without localName
|
|
6373
|
+
(_element$localName = element.localName) !== null && _element$localName !== void 0 ? _element$localName : (
|
|
6374
|
+
// eslint-disable-next-line no-restricted-properties -- required for the fallback
|
|
6375
|
+
element.tagName.toLowerCase()
|
|
6376
|
+
)
|
|
6377
|
+
);
|
|
6378
|
+
}
|
|
6379
|
+
var localNameToRoleMappings = {
|
|
6380
|
+
article: "article",
|
|
6381
|
+
aside: "complementary",
|
|
6382
|
+
button: "button",
|
|
6383
|
+
datalist: "listbox",
|
|
6384
|
+
dd: "definition",
|
|
6385
|
+
details: "group",
|
|
6386
|
+
dialog: "dialog",
|
|
6387
|
+
dt: "term",
|
|
6388
|
+
fieldset: "group",
|
|
6389
|
+
figure: "figure",
|
|
6390
|
+
// WARNING: Only with an accessible name
|
|
6391
|
+
form: "form",
|
|
6392
|
+
footer: "contentinfo",
|
|
6393
|
+
h1: "heading",
|
|
6394
|
+
h2: "heading",
|
|
6395
|
+
h3: "heading",
|
|
6396
|
+
h4: "heading",
|
|
6397
|
+
h5: "heading",
|
|
6398
|
+
h6: "heading",
|
|
6399
|
+
header: "banner",
|
|
6400
|
+
hr: "separator",
|
|
6401
|
+
html: "document",
|
|
6402
|
+
legend: "legend",
|
|
6403
|
+
li: "listitem",
|
|
6404
|
+
math: "math",
|
|
6405
|
+
main: "main",
|
|
6406
|
+
menu: "list",
|
|
6407
|
+
nav: "navigation",
|
|
6408
|
+
ol: "list",
|
|
6409
|
+
optgroup: "group",
|
|
6410
|
+
// WARNING: Only in certain context
|
|
6411
|
+
option: "option",
|
|
6412
|
+
output: "status",
|
|
6413
|
+
progress: "progressbar",
|
|
6414
|
+
// WARNING: Only with an accessible name
|
|
6415
|
+
section: "region",
|
|
6416
|
+
summary: "button",
|
|
6417
|
+
table: "table",
|
|
6418
|
+
tbody: "rowgroup",
|
|
6419
|
+
textarea: "textbox",
|
|
6420
|
+
tfoot: "rowgroup",
|
|
6421
|
+
// WARNING: Only in certain context
|
|
6422
|
+
td: "cell",
|
|
6423
|
+
th: "columnheader",
|
|
6424
|
+
thead: "rowgroup",
|
|
6425
|
+
tr: "row",
|
|
6426
|
+
ul: "list"
|
|
6427
|
+
};
|
|
6428
|
+
var prohibitedAttributes = {
|
|
6429
|
+
caption: /* @__PURE__ */ new Set(["aria-label", "aria-labelledby"]),
|
|
6430
|
+
code: /* @__PURE__ */ new Set(["aria-label", "aria-labelledby"]),
|
|
6431
|
+
deletion: /* @__PURE__ */ new Set(["aria-label", "aria-labelledby"]),
|
|
6432
|
+
emphasis: /* @__PURE__ */ new Set(["aria-label", "aria-labelledby"]),
|
|
6433
|
+
generic: /* @__PURE__ */ new Set(["aria-label", "aria-labelledby", "aria-roledescription"]),
|
|
6434
|
+
insertion: /* @__PURE__ */ new Set(["aria-label", "aria-labelledby"]),
|
|
6435
|
+
none: /* @__PURE__ */ new Set(["aria-label", "aria-labelledby"]),
|
|
6436
|
+
paragraph: /* @__PURE__ */ new Set(["aria-label", "aria-labelledby"]),
|
|
6437
|
+
presentation: /* @__PURE__ */ new Set(["aria-label", "aria-labelledby"]),
|
|
6438
|
+
strong: /* @__PURE__ */ new Set(["aria-label", "aria-labelledby"]),
|
|
6439
|
+
subscript: /* @__PURE__ */ new Set(["aria-label", "aria-labelledby"]),
|
|
6440
|
+
superscript: /* @__PURE__ */ new Set(["aria-label", "aria-labelledby"])
|
|
6441
|
+
};
|
|
6442
|
+
function hasGlobalAriaAttributes(element, role) {
|
|
6443
|
+
return [
|
|
6444
|
+
"aria-atomic",
|
|
6445
|
+
"aria-busy",
|
|
6446
|
+
"aria-controls",
|
|
6447
|
+
"aria-current",
|
|
6448
|
+
"aria-description",
|
|
6449
|
+
"aria-describedby",
|
|
6450
|
+
"aria-details",
|
|
6451
|
+
// "disabled",
|
|
6452
|
+
"aria-dropeffect",
|
|
6453
|
+
// "errormessage",
|
|
6454
|
+
"aria-flowto",
|
|
6455
|
+
"aria-grabbed",
|
|
6456
|
+
// "haspopup",
|
|
6457
|
+
"aria-hidden",
|
|
6458
|
+
// "invalid",
|
|
6459
|
+
"aria-keyshortcuts",
|
|
6460
|
+
"aria-label",
|
|
6461
|
+
"aria-labelledby",
|
|
6462
|
+
"aria-live",
|
|
6463
|
+
"aria-owns",
|
|
6464
|
+
"aria-relevant",
|
|
6465
|
+
"aria-roledescription"
|
|
6466
|
+
].some(function(attributeName) {
|
|
6467
|
+
var _prohibitedAttributes;
|
|
6468
|
+
return element.hasAttribute(attributeName) && !((_prohibitedAttributes = prohibitedAttributes[role]) !== null && _prohibitedAttributes !== void 0 && _prohibitedAttributes.has(attributeName));
|
|
6469
|
+
});
|
|
6470
|
+
}
|
|
6471
|
+
function ignorePresentationalRole(element, implicitRole) {
|
|
6472
|
+
return hasGlobalAriaAttributes(element, implicitRole);
|
|
6473
|
+
}
|
|
6474
|
+
function getRole(element) {
|
|
6475
|
+
var explicitRole = getExplicitRole(element);
|
|
6476
|
+
if (explicitRole === null || presentationRoles.indexOf(explicitRole) !== -1) {
|
|
6477
|
+
var implicitRole = getImplicitRole(element);
|
|
6478
|
+
if (presentationRoles.indexOf(explicitRole || "") === -1 || ignorePresentationalRole(element, implicitRole || "")) {
|
|
6479
|
+
return implicitRole;
|
|
6480
|
+
}
|
|
6481
|
+
}
|
|
6482
|
+
return explicitRole;
|
|
6483
|
+
}
|
|
6484
|
+
function getImplicitRole(element) {
|
|
6485
|
+
var mappedByTag = localNameToRoleMappings[getLocalName(element)];
|
|
6486
|
+
if (mappedByTag !== void 0) {
|
|
6487
|
+
return mappedByTag;
|
|
6488
|
+
}
|
|
6489
|
+
switch (getLocalName(element)) {
|
|
6490
|
+
case "a":
|
|
6491
|
+
case "area":
|
|
6492
|
+
case "link":
|
|
6493
|
+
if (element.hasAttribute("href")) {
|
|
6494
|
+
return "link";
|
|
6495
|
+
}
|
|
6496
|
+
break;
|
|
6497
|
+
case "img":
|
|
6498
|
+
if (element.getAttribute("alt") === "" && !ignorePresentationalRole(element, "img")) {
|
|
6499
|
+
return "presentation";
|
|
6500
|
+
}
|
|
6501
|
+
return "img";
|
|
6502
|
+
case "input": {
|
|
6503
|
+
var _ref = element, type = _ref.type;
|
|
6504
|
+
switch (type) {
|
|
6505
|
+
case "button":
|
|
6506
|
+
case "image":
|
|
6507
|
+
case "reset":
|
|
6508
|
+
case "submit":
|
|
6509
|
+
return "button";
|
|
6510
|
+
case "checkbox":
|
|
6511
|
+
case "radio":
|
|
6512
|
+
return type;
|
|
6513
|
+
case "range":
|
|
6514
|
+
return "slider";
|
|
6515
|
+
case "email":
|
|
6516
|
+
case "tel":
|
|
6517
|
+
case "text":
|
|
6518
|
+
case "url":
|
|
6519
|
+
if (element.hasAttribute("list")) {
|
|
6520
|
+
return "combobox";
|
|
6521
|
+
}
|
|
6522
|
+
return "textbox";
|
|
6523
|
+
case "search":
|
|
6524
|
+
if (element.hasAttribute("list")) {
|
|
6525
|
+
return "combobox";
|
|
6526
|
+
}
|
|
6527
|
+
return "searchbox";
|
|
6528
|
+
case "number":
|
|
6529
|
+
return "spinbutton";
|
|
6530
|
+
default:
|
|
6531
|
+
return null;
|
|
6532
|
+
}
|
|
6533
|
+
}
|
|
6534
|
+
case "select":
|
|
6535
|
+
if (element.hasAttribute("multiple") || element.size > 1) {
|
|
6536
|
+
return "listbox";
|
|
6537
|
+
}
|
|
6538
|
+
return "combobox";
|
|
6539
|
+
}
|
|
6540
|
+
return null;
|
|
6541
|
+
}
|
|
6542
|
+
function getExplicitRole(element) {
|
|
6543
|
+
var role = element.getAttribute("role");
|
|
6544
|
+
if (role !== null) {
|
|
6545
|
+
var explicitRole = role.trim().split(" ")[0];
|
|
6546
|
+
if (explicitRole.length > 0) {
|
|
6547
|
+
return explicitRole;
|
|
6548
|
+
}
|
|
6549
|
+
}
|
|
6550
|
+
return null;
|
|
6551
|
+
}
|
|
6552
|
+
var presentationRoles = ["presentation", "none"];
|
|
6553
|
+
function isElement(node) {
|
|
6554
|
+
return node !== null && node.nodeType === node.ELEMENT_NODE;
|
|
6555
|
+
}
|
|
6556
|
+
function isHTMLTableCaptionElement(node) {
|
|
6557
|
+
return isElement(node) && getLocalName(node) === "caption";
|
|
6558
|
+
}
|
|
6559
|
+
function isHTMLInputElement(node) {
|
|
6560
|
+
return isElement(node) && getLocalName(node) === "input";
|
|
6561
|
+
}
|
|
6562
|
+
function isHTMLOptGroupElement(node) {
|
|
6563
|
+
return isElement(node) && getLocalName(node) === "optgroup";
|
|
6564
|
+
}
|
|
6565
|
+
function isHTMLSelectElement(node) {
|
|
6566
|
+
return isElement(node) && getLocalName(node) === "select";
|
|
6567
|
+
}
|
|
6568
|
+
function isHTMLTableElement(node) {
|
|
6569
|
+
return isElement(node) && getLocalName(node) === "table";
|
|
6570
|
+
}
|
|
6571
|
+
function isHTMLTextAreaElement(node) {
|
|
6572
|
+
return isElement(node) && getLocalName(node) === "textarea";
|
|
6573
|
+
}
|
|
6574
|
+
function safeWindow(node) {
|
|
6575
|
+
var _ref = node.ownerDocument === null ? node : node.ownerDocument, defaultView = _ref.defaultView;
|
|
6576
|
+
if (defaultView === null) {
|
|
6577
|
+
throw new TypeError("no window available");
|
|
6578
|
+
}
|
|
6579
|
+
return defaultView;
|
|
6580
|
+
}
|
|
6581
|
+
function isHTMLFieldSetElement(node) {
|
|
6582
|
+
return isElement(node) && getLocalName(node) === "fieldset";
|
|
6583
|
+
}
|
|
6584
|
+
function isHTMLLegendElement(node) {
|
|
6585
|
+
return isElement(node) && getLocalName(node) === "legend";
|
|
6586
|
+
}
|
|
6587
|
+
function isHTMLSlotElement(node) {
|
|
6588
|
+
return isElement(node) && getLocalName(node) === "slot";
|
|
6589
|
+
}
|
|
6590
|
+
function isSVGElement(node) {
|
|
6591
|
+
return isElement(node) && node.ownerSVGElement !== void 0;
|
|
6592
|
+
}
|
|
6593
|
+
function isSVGSVGElement(node) {
|
|
6594
|
+
return isElement(node) && getLocalName(node) === "svg";
|
|
6595
|
+
}
|
|
6596
|
+
function isSVGTitleElement(node) {
|
|
6597
|
+
return isSVGElement(node) && getLocalName(node) === "title";
|
|
6598
|
+
}
|
|
6599
|
+
function queryIdRefs(node, attributeName) {
|
|
6600
|
+
if (isElement(node) && node.hasAttribute(attributeName)) {
|
|
6601
|
+
var ids = node.getAttribute(attributeName).split(" ");
|
|
6602
|
+
var root = node.getRootNode ? node.getRootNode() : node.ownerDocument;
|
|
6603
|
+
return ids.map(function(id) {
|
|
6604
|
+
return root.getElementById(id);
|
|
6605
|
+
}).filter(
|
|
6606
|
+
function(element) {
|
|
6607
|
+
return element !== null;
|
|
6608
|
+
}
|
|
6609
|
+
// TODO: why does this not narrow?
|
|
6610
|
+
);
|
|
6611
|
+
}
|
|
6612
|
+
return [];
|
|
6613
|
+
}
|
|
6614
|
+
function hasAnyConcreteRoles(node, roles) {
|
|
6615
|
+
if (isElement(node)) {
|
|
6616
|
+
return roles.indexOf(getRole(node)) !== -1;
|
|
6617
|
+
}
|
|
6618
|
+
return false;
|
|
6619
|
+
}
|
|
6620
|
+
function asFlatString(s2) {
|
|
6621
|
+
return s2.trim().replace(/\s\s+/g, " ");
|
|
6622
|
+
}
|
|
6623
|
+
function isHidden$1(node, getComputedStyleImplementation) {
|
|
6624
|
+
if (!isElement(node)) {
|
|
6625
|
+
return false;
|
|
6626
|
+
}
|
|
6627
|
+
if (node.hasAttribute("hidden") || node.getAttribute("aria-hidden") === "true") {
|
|
6628
|
+
return true;
|
|
6629
|
+
}
|
|
6630
|
+
var style = getComputedStyleImplementation(node);
|
|
6631
|
+
return style.getPropertyValue("display") === "none" || style.getPropertyValue("visibility") === "hidden";
|
|
6632
|
+
}
|
|
6633
|
+
function isControl(node) {
|
|
6634
|
+
return hasAnyConcreteRoles(node, ["button", "combobox", "listbox", "textbox"]) || hasAbstractRole(node, "range");
|
|
6635
|
+
}
|
|
6636
|
+
function hasAbstractRole(node, role) {
|
|
6637
|
+
if (!isElement(node)) {
|
|
6638
|
+
return false;
|
|
6639
|
+
}
|
|
6640
|
+
switch (role) {
|
|
6641
|
+
case "range":
|
|
6642
|
+
return hasAnyConcreteRoles(node, ["meter", "progressbar", "scrollbar", "slider", "spinbutton"]);
|
|
6643
|
+
default:
|
|
6644
|
+
throw new TypeError("No knowledge about abstract role '".concat(role, "'. This is likely a bug :("));
|
|
6645
|
+
}
|
|
6646
|
+
}
|
|
6647
|
+
function querySelectorAllSubtree(element, selectors) {
|
|
6648
|
+
var elements = arrayFrom(element.querySelectorAll(selectors));
|
|
6649
|
+
queryIdRefs(element, "aria-owns").forEach(function(root) {
|
|
6650
|
+
elements.push.apply(elements, arrayFrom(root.querySelectorAll(selectors)));
|
|
6651
|
+
});
|
|
6652
|
+
return elements;
|
|
6653
|
+
}
|
|
6654
|
+
function querySelectedOptions(listbox) {
|
|
6655
|
+
if (isHTMLSelectElement(listbox)) {
|
|
6656
|
+
return listbox.selectedOptions || querySelectorAllSubtree(listbox, "[selected]");
|
|
6657
|
+
}
|
|
6658
|
+
return querySelectorAllSubtree(listbox, '[aria-selected="true"]');
|
|
6659
|
+
}
|
|
6660
|
+
function isMarkedPresentational(node) {
|
|
6661
|
+
return hasAnyConcreteRoles(node, presentationRoles);
|
|
6662
|
+
}
|
|
6663
|
+
function isNativeHostLanguageTextAlternativeElement(node) {
|
|
6664
|
+
return isHTMLTableCaptionElement(node);
|
|
6665
|
+
}
|
|
6666
|
+
function allowsNameFromContent(node) {
|
|
6667
|
+
return hasAnyConcreteRoles(node, ["button", "cell", "checkbox", "columnheader", "gridcell", "heading", "label", "legend", "link", "menuitem", "menuitemcheckbox", "menuitemradio", "option", "radio", "row", "rowheader", "switch", "tab", "tooltip", "treeitem"]);
|
|
6668
|
+
}
|
|
6669
|
+
function isDescendantOfNativeHostLanguageTextAlternativeElement(node) {
|
|
6670
|
+
return false;
|
|
6671
|
+
}
|
|
6672
|
+
function getValueOfTextbox(element) {
|
|
6673
|
+
if (isHTMLInputElement(element) || isHTMLTextAreaElement(element)) {
|
|
6674
|
+
return element.value;
|
|
6675
|
+
}
|
|
6676
|
+
return element.textContent || "";
|
|
6677
|
+
}
|
|
6678
|
+
function getTextualContent(declaration) {
|
|
6679
|
+
var content = declaration.getPropertyValue("content");
|
|
6680
|
+
if (/^["'].*["']$/.test(content)) {
|
|
6681
|
+
return content.slice(1, -1);
|
|
6682
|
+
}
|
|
6683
|
+
return "";
|
|
6684
|
+
}
|
|
6685
|
+
function isLabelableElement(element) {
|
|
6686
|
+
var localName = getLocalName(element);
|
|
6687
|
+
return localName === "button" || localName === "input" && element.getAttribute("type") !== "hidden" || localName === "meter" || localName === "output" || localName === "progress" || localName === "select" || localName === "textarea";
|
|
6688
|
+
}
|
|
6689
|
+
function findLabelableElement(element) {
|
|
6690
|
+
if (isLabelableElement(element)) {
|
|
6691
|
+
return element;
|
|
6692
|
+
}
|
|
6693
|
+
var labelableElement = null;
|
|
6694
|
+
element.childNodes.forEach(function(childNode) {
|
|
6695
|
+
if (labelableElement === null && isElement(childNode)) {
|
|
6696
|
+
var descendantLabelableElement = findLabelableElement(childNode);
|
|
6697
|
+
if (descendantLabelableElement !== null) {
|
|
6698
|
+
labelableElement = descendantLabelableElement;
|
|
6699
|
+
}
|
|
6700
|
+
}
|
|
6701
|
+
});
|
|
6702
|
+
return labelableElement;
|
|
6703
|
+
}
|
|
6704
|
+
function getControlOfLabel(label) {
|
|
6705
|
+
if (label.control !== void 0) {
|
|
6706
|
+
return label.control;
|
|
6707
|
+
}
|
|
6708
|
+
var htmlFor = label.getAttribute("for");
|
|
6709
|
+
if (htmlFor !== null) {
|
|
6710
|
+
return label.ownerDocument.getElementById(htmlFor);
|
|
6711
|
+
}
|
|
6712
|
+
return findLabelableElement(label);
|
|
6713
|
+
}
|
|
6714
|
+
function getLabels$1(element) {
|
|
6715
|
+
var labelsProperty = element.labels;
|
|
6716
|
+
if (labelsProperty === null) {
|
|
6717
|
+
return labelsProperty;
|
|
6718
|
+
}
|
|
6719
|
+
if (labelsProperty !== void 0) {
|
|
6720
|
+
return arrayFrom(labelsProperty);
|
|
6721
|
+
}
|
|
6722
|
+
if (!isLabelableElement(element)) {
|
|
6723
|
+
return null;
|
|
6724
|
+
}
|
|
6725
|
+
var document2 = element.ownerDocument;
|
|
6726
|
+
return arrayFrom(document2.querySelectorAll("label")).filter(function(label) {
|
|
6727
|
+
return getControlOfLabel(label) === element;
|
|
6728
|
+
});
|
|
6729
|
+
}
|
|
6730
|
+
function getSlotContents(slot) {
|
|
6731
|
+
var assignedNodes = slot.assignedNodes();
|
|
6732
|
+
if (assignedNodes.length === 0) {
|
|
6733
|
+
return arrayFrom(slot.childNodes);
|
|
6734
|
+
}
|
|
6735
|
+
return assignedNodes;
|
|
6736
|
+
}
|
|
6737
|
+
function computeTextAlternative(root) {
|
|
6738
|
+
var options = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
|
|
6739
|
+
var consultedNodes = new SetLike$1();
|
|
6740
|
+
var computedStyles = typeof Map === "undefined" ? void 0 : /* @__PURE__ */ new Map();
|
|
6741
|
+
var window2 = safeWindow(root);
|
|
6742
|
+
var _options$compute = options.compute, compute = _options$compute === void 0 ? "name" : _options$compute, _options$computedStyl = options.computedStyleSupportsPseudoElements, computedStyleSupportsPseudoElements = _options$computedStyl === void 0 ? options.getComputedStyle !== void 0 : _options$computedStyl, _options$getComputedS = options.getComputedStyle, uncachedGetComputedStyle = _options$getComputedS === void 0 ? window2.getComputedStyle.bind(window2) : _options$getComputedS, _options$hidden = options.hidden, hidden = _options$hidden === void 0 ? false : _options$hidden;
|
|
6743
|
+
var getComputedStyle2 = function getComputedStyle3(el, pseudoElement) {
|
|
6744
|
+
if (pseudoElement !== void 0) {
|
|
6745
|
+
throw new Error("use uncachedGetComputedStyle directly for pseudo elements");
|
|
6746
|
+
}
|
|
6747
|
+
if (computedStyles === void 0) {
|
|
6748
|
+
return uncachedGetComputedStyle(el);
|
|
6749
|
+
}
|
|
6750
|
+
var cachedStyles = computedStyles.get(el);
|
|
6751
|
+
if (cachedStyles) {
|
|
6752
|
+
return cachedStyles;
|
|
6753
|
+
}
|
|
6754
|
+
var style = uncachedGetComputedStyle(el, pseudoElement);
|
|
6755
|
+
computedStyles.set(el, style);
|
|
6756
|
+
return style;
|
|
6757
|
+
};
|
|
6758
|
+
function computeMiscTextAlternative(node, context) {
|
|
6759
|
+
var accumulatedText = "";
|
|
6760
|
+
if (isElement(node) && computedStyleSupportsPseudoElements) {
|
|
6761
|
+
var pseudoBefore = uncachedGetComputedStyle(node, "::before");
|
|
6762
|
+
var beforeContent = getTextualContent(pseudoBefore);
|
|
6763
|
+
accumulatedText = "".concat(beforeContent, " ").concat(accumulatedText);
|
|
6764
|
+
}
|
|
6765
|
+
var childNodes = isHTMLSlotElement(node) ? getSlotContents(node) : arrayFrom(node.childNodes).concat(queryIdRefs(node, "aria-owns"));
|
|
6766
|
+
childNodes.forEach(function(child) {
|
|
6767
|
+
var result = computeTextAlternative2(child, {
|
|
6768
|
+
isEmbeddedInLabel: context.isEmbeddedInLabel,
|
|
6769
|
+
isReferenced: false,
|
|
6770
|
+
recursion: true
|
|
6771
|
+
});
|
|
6772
|
+
var display = isElement(child) ? getComputedStyle2(child).getPropertyValue("display") : "inline";
|
|
6773
|
+
var separator = display !== "inline" ? " " : "";
|
|
6774
|
+
accumulatedText += "".concat(separator).concat(result).concat(separator);
|
|
6775
|
+
});
|
|
6776
|
+
if (isElement(node) && computedStyleSupportsPseudoElements) {
|
|
6777
|
+
var pseudoAfter = uncachedGetComputedStyle(node, "::after");
|
|
6778
|
+
var afterContent = getTextualContent(pseudoAfter);
|
|
6779
|
+
accumulatedText = "".concat(accumulatedText, " ").concat(afterContent);
|
|
6780
|
+
}
|
|
6781
|
+
return accumulatedText.trim();
|
|
6782
|
+
}
|
|
6783
|
+
function useAttribute(element, attributeName) {
|
|
6784
|
+
var attribute = element.getAttributeNode(attributeName);
|
|
6785
|
+
if (attribute !== null && !consultedNodes.has(attribute) && attribute.value.trim() !== "") {
|
|
6786
|
+
consultedNodes.add(attribute);
|
|
6787
|
+
return attribute.value;
|
|
6788
|
+
}
|
|
6789
|
+
return null;
|
|
6790
|
+
}
|
|
6791
|
+
function computeTooltipAttributeValue(node) {
|
|
6792
|
+
if (!isElement(node)) {
|
|
6793
|
+
return null;
|
|
6794
|
+
}
|
|
6795
|
+
return useAttribute(node, "title");
|
|
6796
|
+
}
|
|
6797
|
+
function computeElementTextAlternative(node) {
|
|
6798
|
+
if (!isElement(node)) {
|
|
6799
|
+
return null;
|
|
6800
|
+
}
|
|
6801
|
+
if (isHTMLFieldSetElement(node)) {
|
|
6802
|
+
consultedNodes.add(node);
|
|
6803
|
+
var children = arrayFrom(node.childNodes);
|
|
6804
|
+
for (var i2 = 0; i2 < children.length; i2 += 1) {
|
|
6805
|
+
var child = children[i2];
|
|
6806
|
+
if (isHTMLLegendElement(child)) {
|
|
6807
|
+
return computeTextAlternative2(child, {
|
|
6808
|
+
isEmbeddedInLabel: false,
|
|
6809
|
+
isReferenced: false,
|
|
6810
|
+
recursion: false
|
|
6811
|
+
});
|
|
6812
|
+
}
|
|
6813
|
+
}
|
|
6814
|
+
} else if (isHTMLTableElement(node)) {
|
|
6815
|
+
consultedNodes.add(node);
|
|
6816
|
+
var _children = arrayFrom(node.childNodes);
|
|
6817
|
+
for (var _i = 0; _i < _children.length; _i += 1) {
|
|
6818
|
+
var _child = _children[_i];
|
|
6819
|
+
if (isHTMLTableCaptionElement(_child)) {
|
|
6820
|
+
return computeTextAlternative2(_child, {
|
|
6821
|
+
isEmbeddedInLabel: false,
|
|
6822
|
+
isReferenced: false,
|
|
6823
|
+
recursion: false
|
|
6824
|
+
});
|
|
6825
|
+
}
|
|
6826
|
+
}
|
|
6827
|
+
} else if (isSVGSVGElement(node)) {
|
|
6828
|
+
consultedNodes.add(node);
|
|
6829
|
+
var _children2 = arrayFrom(node.childNodes);
|
|
6830
|
+
for (var _i2 = 0; _i2 < _children2.length; _i2 += 1) {
|
|
6831
|
+
var _child2 = _children2[_i2];
|
|
6832
|
+
if (isSVGTitleElement(_child2)) {
|
|
6833
|
+
return _child2.textContent;
|
|
6834
|
+
}
|
|
6835
|
+
}
|
|
6836
|
+
return null;
|
|
6837
|
+
} else if (getLocalName(node) === "img" || getLocalName(node) === "area") {
|
|
6838
|
+
var nameFromAlt = useAttribute(node, "alt");
|
|
6839
|
+
if (nameFromAlt !== null) {
|
|
6840
|
+
return nameFromAlt;
|
|
6841
|
+
}
|
|
6842
|
+
} else if (isHTMLOptGroupElement(node)) {
|
|
6843
|
+
var nameFromLabel = useAttribute(node, "label");
|
|
6844
|
+
if (nameFromLabel !== null) {
|
|
6845
|
+
return nameFromLabel;
|
|
6846
|
+
}
|
|
6847
|
+
}
|
|
6848
|
+
if (isHTMLInputElement(node) && (node.type === "button" || node.type === "submit" || node.type === "reset")) {
|
|
6849
|
+
var nameFromValue = useAttribute(node, "value");
|
|
6850
|
+
if (nameFromValue !== null) {
|
|
6851
|
+
return nameFromValue;
|
|
6852
|
+
}
|
|
6853
|
+
if (node.type === "submit") {
|
|
6854
|
+
return "Submit";
|
|
6855
|
+
}
|
|
6856
|
+
if (node.type === "reset") {
|
|
6857
|
+
return "Reset";
|
|
6858
|
+
}
|
|
6859
|
+
}
|
|
6860
|
+
var labels = getLabels$1(node);
|
|
6861
|
+
if (labels !== null && labels.length !== 0) {
|
|
6862
|
+
consultedNodes.add(node);
|
|
6863
|
+
return arrayFrom(labels).map(function(element) {
|
|
6864
|
+
return computeTextAlternative2(element, {
|
|
6865
|
+
isEmbeddedInLabel: true,
|
|
6866
|
+
isReferenced: false,
|
|
6867
|
+
recursion: true
|
|
6868
|
+
});
|
|
6869
|
+
}).filter(function(label) {
|
|
6870
|
+
return label.length > 0;
|
|
6871
|
+
}).join(" ");
|
|
6872
|
+
}
|
|
6873
|
+
if (isHTMLInputElement(node) && node.type === "image") {
|
|
6874
|
+
var _nameFromAlt = useAttribute(node, "alt");
|
|
6875
|
+
if (_nameFromAlt !== null) {
|
|
6876
|
+
return _nameFromAlt;
|
|
6877
|
+
}
|
|
6878
|
+
var nameFromTitle = useAttribute(node, "title");
|
|
6879
|
+
if (nameFromTitle !== null) {
|
|
6880
|
+
return nameFromTitle;
|
|
6881
|
+
}
|
|
6882
|
+
return "Submit Query";
|
|
6883
|
+
}
|
|
6884
|
+
if (hasAnyConcreteRoles(node, ["button"])) {
|
|
6885
|
+
var nameFromSubTree = computeMiscTextAlternative(node, {
|
|
6886
|
+
isEmbeddedInLabel: false
|
|
6887
|
+
});
|
|
6888
|
+
if (nameFromSubTree !== "") {
|
|
6889
|
+
return nameFromSubTree;
|
|
6890
|
+
}
|
|
6891
|
+
}
|
|
6892
|
+
return null;
|
|
6893
|
+
}
|
|
6894
|
+
function computeTextAlternative2(current, context) {
|
|
6895
|
+
if (consultedNodes.has(current)) {
|
|
6896
|
+
return "";
|
|
6897
|
+
}
|
|
6898
|
+
if (!hidden && isHidden$1(current, getComputedStyle2) && !context.isReferenced) {
|
|
6899
|
+
consultedNodes.add(current);
|
|
6900
|
+
return "";
|
|
6901
|
+
}
|
|
6902
|
+
var labelAttributeNode = isElement(current) ? current.getAttributeNode("aria-labelledby") : null;
|
|
6903
|
+
var labelElements = labelAttributeNode !== null && !consultedNodes.has(labelAttributeNode) ? queryIdRefs(current, "aria-labelledby") : [];
|
|
6904
|
+
if (compute === "name" && !context.isReferenced && labelElements.length > 0) {
|
|
6905
|
+
consultedNodes.add(labelAttributeNode);
|
|
6906
|
+
return labelElements.map(function(element) {
|
|
6907
|
+
return computeTextAlternative2(element, {
|
|
6908
|
+
isEmbeddedInLabel: context.isEmbeddedInLabel,
|
|
6909
|
+
isReferenced: true,
|
|
6910
|
+
// this isn't recursion as specified, otherwise we would skip
|
|
6911
|
+
// `aria-label` in
|
|
6912
|
+
// <input id="myself" aria-label="foo" aria-labelledby="myself"
|
|
6913
|
+
recursion: false
|
|
6914
|
+
});
|
|
6915
|
+
}).join(" ");
|
|
6916
|
+
}
|
|
6917
|
+
var skipToStep2E = context.recursion && isControl(current) && compute === "name";
|
|
6918
|
+
if (!skipToStep2E) {
|
|
6919
|
+
var ariaLabel = (isElement(current) && current.getAttribute("aria-label") || "").trim();
|
|
6920
|
+
if (ariaLabel !== "" && compute === "name") {
|
|
6921
|
+
consultedNodes.add(current);
|
|
6922
|
+
return ariaLabel;
|
|
6923
|
+
}
|
|
6924
|
+
if (!isMarkedPresentational(current)) {
|
|
6925
|
+
var elementTextAlternative = computeElementTextAlternative(current);
|
|
6926
|
+
if (elementTextAlternative !== null) {
|
|
6927
|
+
consultedNodes.add(current);
|
|
6928
|
+
return elementTextAlternative;
|
|
6929
|
+
}
|
|
6930
|
+
}
|
|
6931
|
+
}
|
|
6932
|
+
if (hasAnyConcreteRoles(current, ["menu"])) {
|
|
6933
|
+
consultedNodes.add(current);
|
|
6934
|
+
return "";
|
|
6935
|
+
}
|
|
6936
|
+
if (skipToStep2E || context.isEmbeddedInLabel || context.isReferenced) {
|
|
6937
|
+
if (hasAnyConcreteRoles(current, ["combobox", "listbox"])) {
|
|
6938
|
+
consultedNodes.add(current);
|
|
6939
|
+
var selectedOptions = querySelectedOptions(current);
|
|
6940
|
+
if (selectedOptions.length === 0) {
|
|
6941
|
+
return isHTMLInputElement(current) ? current.value : "";
|
|
6942
|
+
}
|
|
6943
|
+
return arrayFrom(selectedOptions).map(function(selectedOption) {
|
|
6944
|
+
return computeTextAlternative2(selectedOption, {
|
|
6945
|
+
isEmbeddedInLabel: context.isEmbeddedInLabel,
|
|
6946
|
+
isReferenced: false,
|
|
6947
|
+
recursion: true
|
|
6948
|
+
});
|
|
6949
|
+
}).join(" ");
|
|
6950
|
+
}
|
|
6951
|
+
if (hasAbstractRole(current, "range")) {
|
|
6952
|
+
consultedNodes.add(current);
|
|
6953
|
+
if (current.hasAttribute("aria-valuetext")) {
|
|
6954
|
+
return current.getAttribute("aria-valuetext");
|
|
6955
|
+
}
|
|
6956
|
+
if (current.hasAttribute("aria-valuenow")) {
|
|
6957
|
+
return current.getAttribute("aria-valuenow");
|
|
6958
|
+
}
|
|
6959
|
+
return current.getAttribute("value") || "";
|
|
6960
|
+
}
|
|
6961
|
+
if (hasAnyConcreteRoles(current, ["textbox"])) {
|
|
6962
|
+
consultedNodes.add(current);
|
|
6963
|
+
return getValueOfTextbox(current);
|
|
6964
|
+
}
|
|
6965
|
+
}
|
|
6966
|
+
if (allowsNameFromContent(current) || isElement(current) && context.isReferenced || isNativeHostLanguageTextAlternativeElement(current) || isDescendantOfNativeHostLanguageTextAlternativeElement()) {
|
|
6967
|
+
var accumulatedText2F = computeMiscTextAlternative(current, {
|
|
6968
|
+
isEmbeddedInLabel: context.isEmbeddedInLabel
|
|
6969
|
+
});
|
|
6970
|
+
if (accumulatedText2F !== "") {
|
|
6971
|
+
consultedNodes.add(current);
|
|
6972
|
+
return accumulatedText2F;
|
|
6973
|
+
}
|
|
6974
|
+
}
|
|
6975
|
+
if (current.nodeType === current.TEXT_NODE) {
|
|
6976
|
+
consultedNodes.add(current);
|
|
6977
|
+
return current.textContent || "";
|
|
6978
|
+
}
|
|
6979
|
+
if (context.recursion) {
|
|
6980
|
+
consultedNodes.add(current);
|
|
6981
|
+
return computeMiscTextAlternative(current, {
|
|
6982
|
+
isEmbeddedInLabel: context.isEmbeddedInLabel
|
|
6983
|
+
});
|
|
6984
|
+
}
|
|
6985
|
+
var tooltipAttributeValue = computeTooltipAttributeValue(current);
|
|
6986
|
+
if (tooltipAttributeValue !== null) {
|
|
6987
|
+
consultedNodes.add(current);
|
|
6988
|
+
return tooltipAttributeValue;
|
|
6989
|
+
}
|
|
6990
|
+
consultedNodes.add(current);
|
|
6991
|
+
return "";
|
|
6992
|
+
}
|
|
6993
|
+
return asFlatString(computeTextAlternative2(root, {
|
|
6994
|
+
isEmbeddedInLabel: false,
|
|
6995
|
+
// by spec computeAccessibleDescription starts with the referenced elements as roots
|
|
6996
|
+
isReferenced: compute === "description",
|
|
6997
|
+
recursion: false
|
|
6998
|
+
}));
|
|
6999
|
+
}
|
|
7000
|
+
function prohibitsNaming(node) {
|
|
7001
|
+
return hasAnyConcreteRoles(node, ["caption", "code", "deletion", "emphasis", "generic", "insertion", "none", "paragraph", "presentation", "strong", "subscript", "superscript"]);
|
|
7002
|
+
}
|
|
7003
|
+
function computeAccessibleName(root) {
|
|
7004
|
+
var options = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
|
|
7005
|
+
if (prohibitsNaming(root)) {
|
|
7006
|
+
return "";
|
|
7007
|
+
}
|
|
7008
|
+
return computeTextAlternative(root, options);
|
|
7009
|
+
}
|
|
6180
7010
|
const STATE_CLASS_RE = /^(is-|has-|js-)|^(active|open|selected|disabled|focus|hover|show|hidden|loading|dragging)$/i;
|
|
6181
7011
|
function looksHashed(segment) {
|
|
6182
7012
|
if (segment.includes("-")) return false;
|
|
@@ -6188,17 +7018,35 @@ function looksHashed(segment) {
|
|
|
6188
7018
|
}
|
|
6189
7019
|
return false;
|
|
6190
7020
|
}
|
|
7021
|
+
const GENERATED_CLASS_PATTERNS = [
|
|
7022
|
+
/^css-[a-z0-9]+(-|$)/i,
|
|
7023
|
+
// emotion / MUI. 라벨이 붙으면 css-1e6y48t-MuiButtonBase-root
|
|
7024
|
+
/^sc-[a-z0-9]+$/i,
|
|
7025
|
+
// styled-components
|
|
7026
|
+
/^makeStyles-.+-\d+$/,
|
|
7027
|
+
// JSS makeStyles
|
|
7028
|
+
/^jss\d+$/,
|
|
7029
|
+
// JSS 기본 생성기
|
|
7030
|
+
/^ng-tns-c\d+-\d+$/,
|
|
7031
|
+
// Angular 애니메이션
|
|
7032
|
+
/^_[\w-]+_[a-z0-9]{5}_\d+$/
|
|
7033
|
+
// Vite CSS Modules 기본값: _로컬_해시(base36 5자)_줄번호
|
|
7034
|
+
];
|
|
7035
|
+
function hasCssModulesHash(token) {
|
|
7036
|
+
const index = token.lastIndexOf("__");
|
|
7037
|
+
if (index <= 0) return false;
|
|
7038
|
+
const suffix = token.slice(index + 2);
|
|
7039
|
+
return suffix.length === 5 && /^[\w-]+$/.test(suffix) && /[A-Z0-9_-]/.test(suffix);
|
|
7040
|
+
}
|
|
6191
7041
|
function isUnstableToken(token) {
|
|
6192
7042
|
if (!token) return true;
|
|
6193
7043
|
if (token.includes(":") || token.includes("/")) return true;
|
|
6194
7044
|
if (token.includes("--")) return true;
|
|
6195
|
-
if (/^css-[a-z0-9]+$/i.test(token)) return true;
|
|
6196
|
-
if (/^sc-[a-z0-9]+$/i.test(token)) return true;
|
|
6197
7045
|
if (STATE_CLASS_RE.test(token)) return true;
|
|
6198
|
-
|
|
6199
|
-
if (
|
|
7046
|
+
if (GENERATED_CLASS_PATTERNS.some((pattern) => pattern.test(token))) return true;
|
|
7047
|
+
if (hasCssModulesHash(token)) return true;
|
|
6200
7048
|
if (looksHashed(token)) return true;
|
|
6201
|
-
return
|
|
7049
|
+
return token.split(/[-_]+/).some(looksHashed);
|
|
6202
7050
|
}
|
|
6203
7051
|
function isStableClassName(cls) {
|
|
6204
7052
|
return !isUnstableToken(cls);
|
|
@@ -6211,6 +7059,297 @@ function isUnstableId(id) {
|
|
|
6211
7059
|
if (looksHashed(id)) return true;
|
|
6212
7060
|
return false;
|
|
6213
7061
|
}
|
|
7062
|
+
function intersection(firstArr, secondArr) {
|
|
7063
|
+
const secondSet = new Set(secondArr);
|
|
7064
|
+
return firstArr.filter((item) => secondSet.has(item));
|
|
7065
|
+
}
|
|
7066
|
+
function uniq(arr) {
|
|
7067
|
+
return [...new Set(arr)];
|
|
7068
|
+
}
|
|
7069
|
+
function union(arr1, arr2) {
|
|
7070
|
+
return uniq(arr1.concat(arr2));
|
|
7071
|
+
}
|
|
7072
|
+
const LOCATOR_TEXT_MAX = 80;
|
|
7073
|
+
const RAW_SLICE_FACTOR = 8;
|
|
7074
|
+
const LOCATOR_RAW_TEXT_MAX = LOCATOR_TEXT_MAX * RAW_SLICE_FACTOR;
|
|
7075
|
+
function dropTrailingLoneSurrogate(value) {
|
|
7076
|
+
return /[\uD800-\uDBFF]$/.test(value) ? value.slice(0, -1) : value;
|
|
7077
|
+
}
|
|
7078
|
+
function cleanLocatorText(value, max2 = LOCATOR_TEXT_MAX) {
|
|
7079
|
+
if (!value) return void 0;
|
|
7080
|
+
const bounded = value.slice(0, max2 * RAW_SLICE_FACTOR);
|
|
7081
|
+
const cleaned = dropTrailingLoneSurrogate(
|
|
7082
|
+
redactSensitiveValues(bounded.replace(/\s+/g, " ").trim()).slice(0, max2)
|
|
7083
|
+
).trim();
|
|
7084
|
+
return cleaned || void 0;
|
|
7085
|
+
}
|
|
7086
|
+
function normalizeForCompare(value) {
|
|
7087
|
+
return value.toLowerCase().replace(/\d+/g, "#");
|
|
7088
|
+
}
|
|
7089
|
+
function jaccard(a2, b) {
|
|
7090
|
+
const all = union(uniq(a2), uniq(b));
|
|
7091
|
+
if (all.length === 0) return 0;
|
|
7092
|
+
return intersection(uniq(a2), uniq(b)).length / all.length;
|
|
7093
|
+
}
|
|
7094
|
+
function textSimilarity(a2, b) {
|
|
7095
|
+
const left = normalizeForCompare(a2);
|
|
7096
|
+
const right = normalizeForCompare(b);
|
|
7097
|
+
if (left === right) return 1;
|
|
7098
|
+
const [shorter, longer] = left.length <= right.length ? [left, right] : [right, left];
|
|
7099
|
+
const containment = shorter && longer.startsWith(shorter) ? shorter.length / longer.length : 0;
|
|
7100
|
+
return Math.max(jaccard(left.split(" "), right.split(" ")), containment);
|
|
7101
|
+
}
|
|
7102
|
+
function labelSimilarity(stored, observed) {
|
|
7103
|
+
const storedWords = new Set(normalizeForCompare(stored).split(" "));
|
|
7104
|
+
const observedWords = new Set(normalizeForCompare(observed).split(" "));
|
|
7105
|
+
const [smaller, larger] = storedWords.size <= observedWords.size ? [storedWords, observedWords] : [observedWords, storedWords];
|
|
7106
|
+
const isStrictSubset = larger.size > smaller.size && [...smaller].every((w) => larger.has(w));
|
|
7107
|
+
return isStrictSubset ? 0 : textSimilarity(stored, observed);
|
|
7108
|
+
}
|
|
7109
|
+
function digitGroups(value) {
|
|
7110
|
+
return (value.match(/\d+/g) ?? []).join(" ");
|
|
7111
|
+
}
|
|
7112
|
+
function sameDigitGroups(a2, b) {
|
|
7113
|
+
return digitGroups(a2) === digitGroups(b);
|
|
7114
|
+
}
|
|
7115
|
+
function labelSimilarityKeepingDigits(stored, observed) {
|
|
7116
|
+
const left = stored.replace(/\s+/g, " ").trim();
|
|
7117
|
+
const right = observed.replace(/\s+/g, " ").trim();
|
|
7118
|
+
return sameDigitGroups(left, right) ? labelSimilarity(left, right) : 0;
|
|
7119
|
+
}
|
|
7120
|
+
const TEST_ATTR_KEYS = ["data-testid", "data-test", "data-qa", "data-cy"];
|
|
7121
|
+
const OTHER_ATTR_KEYS = ["name", "type", "placeholder", "alt", "title", "href", "src"];
|
|
7122
|
+
const URL_ATTR_KEYS = /* @__PURE__ */ new Set(["href", "src"]);
|
|
7123
|
+
const ATTR_VALUE_MAX = 120;
|
|
7124
|
+
const CLASS_LIMIT = 5;
|
|
7125
|
+
const LOCATOR_SIZE_MAX = 1024;
|
|
7126
|
+
const CONTAINER_ROLES = /* @__PURE__ */ new Set(["dialog", "alertdialog", "menu", "listbox", "tooltip"]);
|
|
7127
|
+
const CONTAINER_SELECTOR = 'dialog, [role="dialog"], [role="alertdialog"], [role="menu"], [role="listbox"], [role="tooltip"]';
|
|
7128
|
+
const LANDMARK_ROLES = /* @__PURE__ */ new Set([
|
|
7129
|
+
"banner",
|
|
7130
|
+
"navigation",
|
|
7131
|
+
"main",
|
|
7132
|
+
"complementary",
|
|
7133
|
+
"contentinfo",
|
|
7134
|
+
"region",
|
|
7135
|
+
"form",
|
|
7136
|
+
"search"
|
|
7137
|
+
]);
|
|
7138
|
+
const NAMED_ONLY_LANDMARKS = /* @__PURE__ */ new Set(["region", "form"]);
|
|
7139
|
+
const ROW_SELECTOR = 'li, tr, [role="row"], [role="listitem"], [role="option"]';
|
|
7140
|
+
const HEADING_SELECTOR = 'h1, h2, h3, h4, h5, h6, [role="heading"]';
|
|
7141
|
+
function safeRole(element) {
|
|
7142
|
+
try {
|
|
7143
|
+
return getRole(element) ?? void 0;
|
|
7144
|
+
} catch {
|
|
7145
|
+
return void 0;
|
|
7146
|
+
}
|
|
7147
|
+
}
|
|
7148
|
+
function safeAccessibleName(element) {
|
|
7149
|
+
try {
|
|
7150
|
+
return cleanLocatorText(computeAccessibleName(element));
|
|
7151
|
+
} catch {
|
|
7152
|
+
return void 0;
|
|
7153
|
+
}
|
|
7154
|
+
}
|
|
7155
|
+
function landmarkRole(node) {
|
|
7156
|
+
const role = safeRole(node);
|
|
7157
|
+
if (role === void 0 || !LANDMARK_ROLES.has(role)) return void 0;
|
|
7158
|
+
if (NAMED_ONLY_LANDMARKS.has(role) && !safeAccessibleName(node)) return void 0;
|
|
7159
|
+
return role;
|
|
7160
|
+
}
|
|
7161
|
+
function collectHeadings(doc) {
|
|
7162
|
+
return Array.from(doc.querySelectorAll(HEADING_SELECTOR));
|
|
7163
|
+
}
|
|
7164
|
+
function matchesMask(element) {
|
|
7165
|
+
try {
|
|
7166
|
+
return element.matches(SESSION_REPLAY_FULL_MASK_SELECTOR);
|
|
7167
|
+
} catch {
|
|
7168
|
+
return true;
|
|
7169
|
+
}
|
|
7170
|
+
}
|
|
7171
|
+
function hasMaskedDescendant(root) {
|
|
7172
|
+
try {
|
|
7173
|
+
return root.querySelector(SESSION_REPLAY_FULL_MASK_SELECTOR) !== null;
|
|
7174
|
+
} catch {
|
|
7175
|
+
return true;
|
|
7176
|
+
}
|
|
7177
|
+
}
|
|
7178
|
+
function visibleText(root) {
|
|
7179
|
+
if (!hasMaskedDescendant(root)) return root.textContent ?? "";
|
|
7180
|
+
const walker = root.ownerDocument.createTreeWalker(
|
|
7181
|
+
root,
|
|
7182
|
+
NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_TEXT,
|
|
7183
|
+
(node) => node.nodeType === Node.ELEMENT_NODE && matchesMask(node) ? NodeFilter.FILTER_REJECT : NodeFilter.FILTER_ACCEPT
|
|
7184
|
+
);
|
|
7185
|
+
let text = "";
|
|
7186
|
+
for (let node = walker.nextNode(); node && text.length < LOCATOR_RAW_TEXT_MAX; ) {
|
|
7187
|
+
if (node.nodeType === Node.TEXT_NODE) text += node.nodeValue ?? "";
|
|
7188
|
+
node = walker.nextNode();
|
|
7189
|
+
}
|
|
7190
|
+
return text;
|
|
7191
|
+
}
|
|
7192
|
+
function closestAncestor(element, matches) {
|
|
7193
|
+
let current = element.parentElement;
|
|
7194
|
+
while (current) {
|
|
7195
|
+
if (matches(current)) return current;
|
|
7196
|
+
current = current.parentElement;
|
|
7197
|
+
}
|
|
7198
|
+
return null;
|
|
7199
|
+
}
|
|
7200
|
+
function nearestPrecedingHeading(element, headings) {
|
|
7201
|
+
let found = null;
|
|
7202
|
+
for (const heading of headings) {
|
|
7203
|
+
if (heading === element || heading.contains(element)) continue;
|
|
7204
|
+
if (heading.compareDocumentPosition(element) & Node.DOCUMENT_POSITION_FOLLOWING) {
|
|
7205
|
+
found = heading;
|
|
7206
|
+
} else {
|
|
7207
|
+
break;
|
|
7208
|
+
}
|
|
7209
|
+
}
|
|
7210
|
+
return found;
|
|
7211
|
+
}
|
|
7212
|
+
function rowTextOf(element) {
|
|
7213
|
+
const row = element.closest(ROW_SELECTOR);
|
|
7214
|
+
if (!row) return void 0;
|
|
7215
|
+
const label = Array.from(row.children).find(
|
|
7216
|
+
(cell) => !cell.contains(element) && visibleText(cell).trim()
|
|
7217
|
+
);
|
|
7218
|
+
const source = label ?? row;
|
|
7219
|
+
if (isElementFullyMasked(source)) return void 0;
|
|
7220
|
+
return cleanLocatorText(visibleText(source));
|
|
7221
|
+
}
|
|
7222
|
+
function urlPath(value, doc) {
|
|
7223
|
+
try {
|
|
7224
|
+
const url = new URL(value, doc.baseURI);
|
|
7225
|
+
return url.protocol === "http:" || url.protocol === "https:" ? url.pathname : void 0;
|
|
7226
|
+
} catch {
|
|
7227
|
+
return void 0;
|
|
7228
|
+
}
|
|
7229
|
+
}
|
|
7230
|
+
function attrValue(element, key) {
|
|
7231
|
+
const raw = element.getAttribute(key);
|
|
7232
|
+
if (!raw) return void 0;
|
|
7233
|
+
return cleanLocatorText(
|
|
7234
|
+
URL_ATTR_KEYS.has(key) ? urlPath(raw, element.ownerDocument) : raw,
|
|
7235
|
+
ATTR_VALUE_MAX
|
|
7236
|
+
);
|
|
7237
|
+
}
|
|
7238
|
+
function sharesUrlPath(element, key, value) {
|
|
7239
|
+
return Array.from(element.ownerDocument.getElementsByTagName(element.tagName)).some(
|
|
7240
|
+
(other) => other !== element && attrValue(other, key) === value
|
|
7241
|
+
);
|
|
7242
|
+
}
|
|
7243
|
+
function collectAttrs(element, masked, uniqueUrlAttrs) {
|
|
7244
|
+
const attrs = {};
|
|
7245
|
+
const keys = masked ? TEST_ATTR_KEYS : [...TEST_ATTR_KEYS, ...OTHER_ATTR_KEYS];
|
|
7246
|
+
for (const key of keys) {
|
|
7247
|
+
const value = attrValue(element, key);
|
|
7248
|
+
if (!value) continue;
|
|
7249
|
+
if (uniqueUrlAttrs && URL_ATTR_KEYS.has(key) && sharesUrlPath(element, key, value)) continue;
|
|
7250
|
+
attrs[key] = value;
|
|
7251
|
+
}
|
|
7252
|
+
return Object.keys(attrs).length ? attrs : void 0;
|
|
7253
|
+
}
|
|
7254
|
+
function collectClasses(element) {
|
|
7255
|
+
const classes = Array.from(element.classList).filter(isStableClassName).slice(0, CLASS_LIMIT);
|
|
7256
|
+
return classes.length ? classes : void 0;
|
|
7257
|
+
}
|
|
7258
|
+
function tagIndex(element, scope) {
|
|
7259
|
+
return Array.from(scope.getElementsByTagName(element.tagName)).indexOf(element);
|
|
7260
|
+
}
|
|
7261
|
+
function labelSources(element) {
|
|
7262
|
+
var _a;
|
|
7263
|
+
const doc = element.ownerDocument;
|
|
7264
|
+
const ids = ((_a = element.getAttribute("aria-labelledby")) == null ? void 0 : _a.split(/\s+/).filter(Boolean)) ?? [];
|
|
7265
|
+
const sources = ids.map((id) => doc.getElementById(id)).filter((node) => node !== null);
|
|
7266
|
+
const labels = element.labels;
|
|
7267
|
+
if (labels) sources.push(...Array.from(labels));
|
|
7268
|
+
const wrapping = element.closest("label");
|
|
7269
|
+
if (wrapping) sources.push(wrapping);
|
|
7270
|
+
return sources;
|
|
7271
|
+
}
|
|
7272
|
+
function labelSourceMasked(element) {
|
|
7273
|
+
return labelSources(element).some(
|
|
7274
|
+
(node) => isElementFullyMasked(node) || hasMaskedDescendant(node)
|
|
7275
|
+
);
|
|
7276
|
+
}
|
|
7277
|
+
function capSize(locator) {
|
|
7278
|
+
const size = () => JSON.stringify(locator).length;
|
|
7279
|
+
if (size() <= LOCATOR_SIZE_MAX) return locator;
|
|
7280
|
+
delete locator.classes;
|
|
7281
|
+
if (size() <= LOCATOR_SIZE_MAX) return locator;
|
|
7282
|
+
if (locator.context) delete locator.context.heading;
|
|
7283
|
+
if (size() <= LOCATOR_SIZE_MAX) return locator;
|
|
7284
|
+
if (locator.attrs) {
|
|
7285
|
+
for (const key of OTHER_ATTR_KEYS) delete locator.attrs[key];
|
|
7286
|
+
}
|
|
7287
|
+
if (size() <= LOCATOR_SIZE_MAX) return locator;
|
|
7288
|
+
delete locator.context;
|
|
7289
|
+
if (size() <= LOCATOR_SIZE_MAX) return locator;
|
|
7290
|
+
delete locator.text;
|
|
7291
|
+
return locator;
|
|
7292
|
+
}
|
|
7293
|
+
function buildElementLocator(element, options = {}) {
|
|
7294
|
+
try {
|
|
7295
|
+
return buildLocatorUnsafe(element, options);
|
|
7296
|
+
} catch {
|
|
7297
|
+
return { v: 1, tag: element.localName || element.tagName.toLowerCase() };
|
|
7298
|
+
}
|
|
7299
|
+
}
|
|
7300
|
+
function buildLocatorUnsafe(element, options) {
|
|
7301
|
+
const doc = element.ownerDocument;
|
|
7302
|
+
const masked = isElementFullyMasked(element);
|
|
7303
|
+
const locator = { v: 1, tag: element.tagName.toLowerCase() };
|
|
7304
|
+
const role = safeRole(element);
|
|
7305
|
+
if (role) locator.role = role;
|
|
7306
|
+
if (!masked) {
|
|
7307
|
+
const nameMasked = hasMaskedDescendant(element) || labelSourceMasked(element);
|
|
7308
|
+
if (options.includeName !== false && !nameMasked) {
|
|
7309
|
+
const name = safeAccessibleName(element);
|
|
7310
|
+
if (name) locator.name = name;
|
|
7311
|
+
}
|
|
7312
|
+
const text = cleanLocatorText(visibleText(element));
|
|
7313
|
+
if (text) locator.text = text;
|
|
7314
|
+
}
|
|
7315
|
+
const attrs = collectAttrs(element, masked, options.uniqueUrlAttrs !== false);
|
|
7316
|
+
if (attrs) locator.attrs = attrs;
|
|
7317
|
+
const classes = collectClasses(element);
|
|
7318
|
+
if (classes) locator.classes = classes;
|
|
7319
|
+
const container = closestAncestor(element, (node) => {
|
|
7320
|
+
const nodeRole = safeRole(node);
|
|
7321
|
+
return nodeRole !== void 0 && CONTAINER_ROLES.has(nodeRole);
|
|
7322
|
+
});
|
|
7323
|
+
const landmark = closestAncestor(element, (node) => landmarkRole(node) !== void 0);
|
|
7324
|
+
const heading = nearestPrecedingHeading(element, options.headings ?? collectHeadings(doc));
|
|
7325
|
+
const rowText = masked ? void 0 : rowTextOf(element);
|
|
7326
|
+
const context = {};
|
|
7327
|
+
if (container) {
|
|
7328
|
+
const containerName = isElementFullyMasked(container) || hasMaskedDescendant(container) || labelSourceMasked(container) ? void 0 : safeAccessibleName(container);
|
|
7329
|
+
context.container = {
|
|
7330
|
+
role: safeRole(container),
|
|
7331
|
+
...containerName ? { name: containerName } : {}
|
|
7332
|
+
};
|
|
7333
|
+
}
|
|
7334
|
+
if (landmark) context.landmark = landmarkRole(landmark);
|
|
7335
|
+
const headingText = heading && !isElementFullyMasked(heading) ? cleanLocatorText(visibleText(heading)) : void 0;
|
|
7336
|
+
if (headingText) context.heading = headingText;
|
|
7337
|
+
if (rowText) context.rowText = rowText;
|
|
7338
|
+
if (Object.keys(context).length) locator.context = context;
|
|
7339
|
+
if (options.includeRoleIndex !== false) {
|
|
7340
|
+
const index = tagIndex(element, container ?? doc);
|
|
7341
|
+
if (index >= 0) locator.roleIndex = index;
|
|
7342
|
+
}
|
|
7343
|
+
return capSize(locator);
|
|
7344
|
+
}
|
|
7345
|
+
const STABLE_ATTR_KEYS = [
|
|
7346
|
+
"data-testid",
|
|
7347
|
+
"data-test",
|
|
7348
|
+
"data-qa",
|
|
7349
|
+
"data-cy",
|
|
7350
|
+
"name",
|
|
7351
|
+
"aria-label"
|
|
7352
|
+
];
|
|
6214
7353
|
function cssAttrValue(value) {
|
|
6215
7354
|
return value.replace(/(["\\])/g, "\\$1");
|
|
6216
7355
|
}
|
|
@@ -6279,8 +7418,8 @@ function getElementSelector(element) {
|
|
|
6279
7418
|
const segments = [];
|
|
6280
7419
|
let current = element;
|
|
6281
7420
|
let depth = 0;
|
|
6282
|
-
const
|
|
6283
|
-
while (current && current.nodeType === Node.ELEMENT_NODE && depth <
|
|
7421
|
+
const MAX_DEPTH2 = 5;
|
|
7422
|
+
while (current && current.nodeType === Node.ELEMENT_NODE && depth < MAX_DEPTH2) {
|
|
6284
7423
|
segments.unshift(structuralSegment(current));
|
|
6285
7424
|
const candidate = segments.join(" > ");
|
|
6286
7425
|
if (matchesUniquely(candidate, element)) return candidate;
|
|
@@ -6320,9 +7459,15 @@ function getXPath(element) {
|
|
|
6320
7459
|
}
|
|
6321
7460
|
return parts.length ? `/html/body/${parts.join("/")}` : "/html/body";
|
|
6322
7461
|
}
|
|
6323
|
-
function getElementPosition(element, event) {
|
|
7462
|
+
function getElementPosition(element, event, options = {}) {
|
|
6324
7463
|
const rect = element.getBoundingClientRect();
|
|
6325
7464
|
const scroll = getScrollPosition();
|
|
7465
|
+
let component = null;
|
|
7466
|
+
try {
|
|
7467
|
+
component = (options.collectComponent ?? collectComponentPath)(element);
|
|
7468
|
+
} catch {
|
|
7469
|
+
component = null;
|
|
7470
|
+
}
|
|
6326
7471
|
return {
|
|
6327
7472
|
x: event ? event.clientX + scroll.x : rect.left + scroll.x,
|
|
6328
7473
|
y: event ? event.clientY + scroll.y : rect.top + scroll.y,
|
|
@@ -6334,7 +7479,9 @@ function getElementPosition(element, event) {
|
|
|
6334
7479
|
top: rect.top + scroll.y,
|
|
6335
7480
|
width: rect.width,
|
|
6336
7481
|
height: rect.height
|
|
6337
|
-
}
|
|
7482
|
+
},
|
|
7483
|
+
locator: buildElementLocator(element),
|
|
7484
|
+
...component ? { component } : {}
|
|
6338
7485
|
};
|
|
6339
7486
|
}
|
|
6340
7487
|
function findElementByXPath(xpath) {
|
|
@@ -7964,15 +9111,68 @@ var Anchor2 = PopoverAnchor$1;
|
|
|
7964
9111
|
var Trigger = PopoverTrigger$1;
|
|
7965
9112
|
var Portal = PopoverPortal;
|
|
7966
9113
|
var Content2 = PopoverContent$1;
|
|
7967
|
-
const
|
|
9114
|
+
const FLOATING_LAYER_SELECTOR = "[data-radix-popper-content-wrapper]";
|
|
9115
|
+
function isInsideLayer(path, content) {
|
|
9116
|
+
return path.some((node) => {
|
|
9117
|
+
if (!(node instanceof Element)) return false;
|
|
9118
|
+
if (node === content) return true;
|
|
9119
|
+
if (content.id && node.getAttribute("aria-controls") === content.id) return true;
|
|
9120
|
+
return node.matches(FLOATING_LAYER_SELECTOR) && !node.contains(content);
|
|
9121
|
+
});
|
|
9122
|
+
}
|
|
9123
|
+
function useShadowOutsideDismiss(onDismiss) {
|
|
9124
|
+
const onDismissRef = useRef(onDismiss);
|
|
9125
|
+
const detachRef = useRef(null);
|
|
9126
|
+
useEffect(() => {
|
|
9127
|
+
onDismissRef.current = onDismiss;
|
|
9128
|
+
}, [onDismiss]);
|
|
9129
|
+
useEffect(() => () => {
|
|
9130
|
+
var _a;
|
|
9131
|
+
return (_a = detachRef.current) == null ? void 0 : _a.call(detachRef);
|
|
9132
|
+
}, []);
|
|
9133
|
+
return useCallback((content) => {
|
|
9134
|
+
var _a;
|
|
9135
|
+
(_a = detachRef.current) == null ? void 0 : _a.call(detachRef);
|
|
9136
|
+
detachRef.current = null;
|
|
9137
|
+
if (!content) return;
|
|
9138
|
+
const root = content.getRootNode();
|
|
9139
|
+
if (!(root instanceof ShadowRoot)) return;
|
|
9140
|
+
const handle = (event) => {
|
|
9141
|
+
var _a2;
|
|
9142
|
+
if (isInsideLayer(event.composedPath(), content)) return;
|
|
9143
|
+
(_a2 = onDismissRef.current) == null ? void 0 : _a2.call(onDismissRef);
|
|
9144
|
+
};
|
|
9145
|
+
const types = ["pointerdown", "focusin"];
|
|
9146
|
+
types.forEach((type) => root.addEventListener(type, handle));
|
|
9147
|
+
detachRef.current = () => types.forEach((type) => root.removeEventListener(type, handle));
|
|
9148
|
+
}, []);
|
|
9149
|
+
}
|
|
9150
|
+
const PopoverOpenChangeContext = React.createContext(
|
|
9151
|
+
void 0
|
|
9152
|
+
);
|
|
9153
|
+
function Popover(props) {
|
|
9154
|
+
return /* @__PURE__ */ jsx(PopoverOpenChangeContext.Provider, { value: props.onOpenChange, children: /* @__PURE__ */ jsx(Root2, { ...props }) });
|
|
9155
|
+
}
|
|
7968
9156
|
const PopoverTrigger = Trigger;
|
|
7969
9157
|
const PopoverAnchor = Anchor2;
|
|
7970
9158
|
const PopoverContent = React.forwardRef(({ className, align = "center", sideOffset = 6, onEscapeKeyDown, ...props }, ref) => {
|
|
7971
9159
|
const portalContainer = usePortalContainer();
|
|
9160
|
+
const onOpenChange = React.useContext(PopoverOpenChangeContext);
|
|
9161
|
+
const dismissRef = useShadowOutsideDismiss(
|
|
9162
|
+
React.useCallback(() => onOpenChange == null ? void 0 : onOpenChange(false), [onOpenChange])
|
|
9163
|
+
);
|
|
9164
|
+
const contentRef = React.useCallback(
|
|
9165
|
+
(node) => {
|
|
9166
|
+
dismissRef(node);
|
|
9167
|
+
if (typeof ref === "function") ref(node);
|
|
9168
|
+
else if (ref) ref.current = node;
|
|
9169
|
+
},
|
|
9170
|
+
[dismissRef, ref]
|
|
9171
|
+
);
|
|
7972
9172
|
return /* @__PURE__ */ jsx(Portal, { container: portalContainer, children: /* @__PURE__ */ jsx(
|
|
7973
9173
|
Content2,
|
|
7974
9174
|
{
|
|
7975
|
-
ref,
|
|
9175
|
+
ref: contentRef,
|
|
7976
9176
|
align,
|
|
7977
9177
|
sideOffset,
|
|
7978
9178
|
onEscapeKeyDown: stopEscapePropagation(onEscapeKeyDown),
|
|
@@ -13977,6 +15177,7 @@ function DatePicker({
|
|
|
13977
15177
|
};
|
|
13978
15178
|
const showClear = clearable && Boolean(value) && !disabled;
|
|
13979
15179
|
const selectedDate = fromIso(value);
|
|
15180
|
+
const dismissRef = useShadowOutsideDismiss(React.useCallback(() => setOpen(false), []));
|
|
13980
15181
|
return /* @__PURE__ */ jsxs(Root2, { open, onOpenChange: setOpen, children: [
|
|
13981
15182
|
/* @__PURE__ */ jsx(
|
|
13982
15183
|
DatePickerTriggerField,
|
|
@@ -13994,6 +15195,7 @@ function DatePicker({
|
|
|
13994
15195
|
/* @__PURE__ */ jsx(Portal, { container: portalContainer, children: /* @__PURE__ */ jsx(
|
|
13995
15196
|
Content2,
|
|
13996
15197
|
{
|
|
15198
|
+
ref: dismissRef,
|
|
13997
15199
|
align,
|
|
13998
15200
|
side: "bottom",
|
|
13999
15201
|
sideOffset: 6,
|
|
@@ -15355,6 +16557,15 @@ export {
|
|
|
15355
16557
|
toast as a7,
|
|
15356
16558
|
getSnapshot as a8,
|
|
15357
16559
|
subscribe as a9,
|
|
16560
|
+
sameDigitGroups as aA,
|
|
16561
|
+
labelSimilarityKeepingDigits as aB,
|
|
16562
|
+
landmarkRole as aC,
|
|
16563
|
+
findElementBySelector as aD,
|
|
16564
|
+
findElementByXPath as aE,
|
|
16565
|
+
OnboardingProvider as aF,
|
|
16566
|
+
useOnboardingTarget as aG,
|
|
16567
|
+
useOnboardingFlow as aH,
|
|
16568
|
+
PopoverAnchor as aI,
|
|
15358
16569
|
getRegisteredUploadId as aa,
|
|
15359
16570
|
ChevronRight as ab,
|
|
15360
16571
|
ReactRemoveScroll as ac,
|
|
@@ -15372,12 +16583,15 @@ export {
|
|
|
15372
16583
|
useDirection as ao,
|
|
15373
16584
|
getPrimaryNotionMapping as ap,
|
|
15374
16585
|
buttonVariants as aq,
|
|
15375
|
-
|
|
15376
|
-
|
|
15377
|
-
|
|
15378
|
-
|
|
15379
|
-
|
|
15380
|
-
|
|
16586
|
+
TEST_ATTR_KEYS as ar,
|
|
16587
|
+
jaccard as as,
|
|
16588
|
+
textSimilarity as at,
|
|
16589
|
+
collectHeadings as au,
|
|
16590
|
+
buildElementLocator as av,
|
|
16591
|
+
normalizeForCompare as aw,
|
|
16592
|
+
CONTAINER_SELECTOR as ax,
|
|
16593
|
+
safeRole as ay,
|
|
16594
|
+
safeAccessibleName as az,
|
|
15381
16595
|
buildJiraCreateFields as b,
|
|
15382
16596
|
captureWithModernScreenshot as c,
|
|
15383
16597
|
directUploadToSignedUrl as d,
|