@geometra/proxy 1.65.5 → 1.65.7
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/dom-actions.d.ts.map +1 -1
- package/dist/dom-actions.js +99 -10
- package/dist/dom-actions.js.map +1 -1
- package/dist/geometry-ws.d.ts.map +1 -1
- package/dist/geometry-ws.js +11 -4
- package/dist/geometry-ws.js.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dom-actions.d.ts","sourceRoot":"","sources":["../src/dom-actions.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAkC,OAAO,EAAE,IAAI,EAAE,MAAM,YAAY,CAAA;AAE/E,OAAO,KAAK,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,YAAY,CAAA;AAEnE,wBAAgB,KAAK,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAE/C;AAED,MAAM,MAAM,kBAAkB,GAAG,MAAM,GAAG,SAAS,GAAG,QAAQ,GAAG,MAAM,CAAA;AAgDvE,MAAM,WAAW,eAAe;IAC9B,OAAO,EAAE,GAAG,CAAC,MAAM,EAAE,OAAO,GAAG,IAAI,CAAC,CAAA;IACpC,QAAQ,EAAE,GAAG,CAAC,MAAM,EAAE,OAAO,GAAG,IAAI,CAAC,CAAA;IACrC,SAAS,EAAE,GAAG,CAAC,MAAM,EAAE,OAAO,GAAG,IAAI,CAAC,CAAA;CACvC;AAED,wBAAgB,qBAAqB,IAAI,eAAe,CAMvD;AAED,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,eAAe,GAAG,IAAI,CAIjE;AAi+FD;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,QAAQ,EAAE,OAAO,EAAE,EAAE,YAAY,GAAE,MAAM,EAAO,GAAG,MAAM,EAAE,CAkC/F;
|
|
1
|
+
{"version":3,"file":"dom-actions.d.ts","sourceRoot":"","sources":["../src/dom-actions.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O,CAAC,IAAI,CAAC,CAwOf;AAED,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,KAAK,CAAC,EAAE,OAAO,CAAA;IACf,WAAW,CAAC,EAAE,UAAU,GAAG,OAAO,CAAA;IAClC,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,WAAW,CAAC,EAAE,MAAM,CAAA;CACrB;AA2MD;;;GAGG;AACH,wBAAsB,iBAAiB,CAAC,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,iBAAiB,GAAG,OAAO,CAAC,IAAI,CAAC,CAkD1G;AAED,wBAAsB,OAAO,CAAC,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CA4C/G"}
|
package/dist/dom-actions.js
CHANGED
|
@@ -3339,6 +3339,12 @@ async function beginFileInputCommitGuard(handle) {
|
|
|
3339
3339
|
const accessibleText = (control.getAttribute('aria-label') ??
|
|
3340
3340
|
control.getAttribute('title') ??
|
|
3341
3341
|
control.textContent ?? '').replace(/\s+/g, ' ').trim();
|
|
3342
|
+
if (/^(?:box|dropbox|google drive|iCloud(?: drive)?|one ?drive)$/i.test(accessibleText)) {
|
|
3343
|
+
return false;
|
|
3344
|
+
}
|
|
3345
|
+
if (/^(?:enter|paste|type)(?: (?:the )?(?:file|document|resume|cv|cover letter|text))? manually$/i.test(accessibleText)) {
|
|
3346
|
+
return false;
|
|
3347
|
+
}
|
|
3342
3348
|
const action = /^(attach|upload|browse|choose|select|add)\b/i.exec(accessibleText);
|
|
3343
3349
|
if (!action)
|
|
3344
3350
|
return true;
|
|
@@ -3366,27 +3372,98 @@ async function beginFileInputCommitGuard(handle) {
|
|
|
3366
3372
|
return Boolean(label && (scope.contains(label) || label === scope.previousElementSibling));
|
|
3367
3373
|
});
|
|
3368
3374
|
}
|
|
3375
|
+
function localFileGroupReceiptBranch(scope, exactInput) {
|
|
3376
|
+
if (scope.getAttribute('role')?.trim().toLowerCase() !== 'group')
|
|
3377
|
+
return null;
|
|
3378
|
+
if (scope instanceof HTMLFormElement ||
|
|
3379
|
+
scope instanceof HTMLBodyElement ||
|
|
3380
|
+
scope instanceof HTMLHtmlElement ||
|
|
3381
|
+
scope.querySelectorAll('input[type="file"]').length !== 1)
|
|
3382
|
+
return null;
|
|
3383
|
+
const broadContainerSelector = 'main, nav, aside, article, section, header, footer, ' +
|
|
3384
|
+
'[role="main"], [role="application"], [role="document"], [role="navigation"]';
|
|
3385
|
+
if (scope.matches(broadContainerSelector) || scope.querySelector(broadContainerSelector)) {
|
|
3386
|
+
return null;
|
|
3387
|
+
}
|
|
3388
|
+
const labelledBy = scope.getAttribute('aria-labelledby')?.trim().split(/\s+/).filter(Boolean) ?? [];
|
|
3389
|
+
const labels = labelledBy.map(id => {
|
|
3390
|
+
const label = exactInput.ownerDocument.getElementById(id);
|
|
3391
|
+
return label && (scope.contains(label) || label === scope.previousElementSibling)
|
|
3392
|
+
? label
|
|
3393
|
+
: null;
|
|
3394
|
+
}).filter((label) => label !== null);
|
|
3395
|
+
if (labels.length === 0)
|
|
3396
|
+
return null;
|
|
3397
|
+
const ignoredIdentityTokens = new Set([
|
|
3398
|
+
'add', 'application', 'attach', 'browse', 'button', 'candidate',
|
|
3399
|
+
'choose', 'control', 'field', 'file', 'form', 'input', 'job',
|
|
3400
|
+
'label', 'select', 'upload',
|
|
3401
|
+
]);
|
|
3402
|
+
const identityTokens = (values) => new Set(values.flatMap(value => value?.toLowerCase().match(/[a-z0-9]+/g) ?? [])
|
|
3403
|
+
.filter(token => token.length >= 2 && !ignoredIdentityTokens.has(token)));
|
|
3404
|
+
const groupIdentity = identityTokens(labels.flatMap(label => [label.id, label.textContent]));
|
|
3405
|
+
const inputLabelledBy = exactInput.getAttribute('aria-labelledby')?.trim().split(/\s+/).filter(Boolean) ?? [];
|
|
3406
|
+
const inputIdentity = identityTokens([
|
|
3407
|
+
exactInput.id,
|
|
3408
|
+
exactInput.getAttribute('name'),
|
|
3409
|
+
exactInput.getAttribute('aria-label'),
|
|
3410
|
+
exactInput.getAttribute('title'),
|
|
3411
|
+
...Array.from(exactInput.labels ?? []).flatMap(label => [label.id, label.textContent]),
|
|
3412
|
+
...inputLabelledBy.flatMap(id => {
|
|
3413
|
+
const label = exactInput.ownerDocument.getElementById(id);
|
|
3414
|
+
return label ? [label.id, label.textContent] : [];
|
|
3415
|
+
}),
|
|
3416
|
+
]);
|
|
3417
|
+
if (!Array.from(groupIdentity).some(token => inputIdentity.has(token)))
|
|
3418
|
+
return null;
|
|
3419
|
+
let branch = exactInput;
|
|
3420
|
+
let parent = composedParent(branch);
|
|
3421
|
+
while (parent && parent !== scope) {
|
|
3422
|
+
branch = parent;
|
|
3423
|
+
parent = composedParent(branch);
|
|
3424
|
+
}
|
|
3425
|
+
if (parent !== scope || branch === exactInput)
|
|
3426
|
+
return null;
|
|
3427
|
+
if (branch.matches(broadContainerSelector) || branch.querySelector(broadContainerSelector))
|
|
3428
|
+
return null;
|
|
3429
|
+
if (branch.querySelectorAll('input[type="file"]').length !== 1)
|
|
3430
|
+
return null;
|
|
3431
|
+
if (labels.some(label => branch.contains(label)))
|
|
3432
|
+
return null;
|
|
3433
|
+
if (!explicitlyAssociatesFileInput(branch, exactInput))
|
|
3434
|
+
return null;
|
|
3435
|
+
return branch;
|
|
3436
|
+
}
|
|
3369
3437
|
const input = element instanceof HTMLInputElement && element.type === 'file' ? element : null;
|
|
3370
3438
|
const guardedAncestors = new Set();
|
|
3371
3439
|
const receiptScopes = [];
|
|
3372
3440
|
let capturedReceiptScope = false;
|
|
3441
|
+
let capturedFieldGroupReceiptScope = false;
|
|
3373
3442
|
let current = input;
|
|
3374
3443
|
while (current) {
|
|
3375
3444
|
guardedAncestors.add(current);
|
|
3376
|
-
|
|
3445
|
+
const associatedLocalWrapper = !capturedReceiptScope &&
|
|
3446
|
+
input !== null &&
|
|
3377
3447
|
current !== input &&
|
|
3378
3448
|
!(current instanceof HTMLFormElement) &&
|
|
3379
3449
|
!(current instanceof HTMLBodyElement) &&
|
|
3380
3450
|
!(current instanceof HTMLHtmlElement) &&
|
|
3381
|
-
input
|
|
3382
|
-
explicitlyAssociatesFileInput(current, input)
|
|
3383
|
-
|
|
3384
|
-
|
|
3451
|
+
current.querySelectorAll('input[type="file"]').length === 1 &&
|
|
3452
|
+
explicitlyAssociatesFileInput(current, input);
|
|
3453
|
+
const fieldGroupReceiptBranch = !capturedFieldGroupReceiptScope && input !== null
|
|
3454
|
+
? localFileGroupReceiptBranch(current, input)
|
|
3455
|
+
: null;
|
|
3456
|
+
const receiptScope = associatedLocalWrapper ? current : fieldGroupReceiptBranch;
|
|
3457
|
+
if (receiptScope && !receiptScopes.some(entry => entry.element === receiptScope)) {
|
|
3458
|
+
const initialExactTexts = [receiptScope, ...Array.from(receiptScope.querySelectorAll('*'))]
|
|
3385
3459
|
.map(candidate => candidate.textContent?.replace(/\s+/g, ' ').trim() ?? '')
|
|
3386
3460
|
.filter(Boolean);
|
|
3387
|
-
receiptScopes.push({ element:
|
|
3388
|
-
capturedReceiptScope = true;
|
|
3461
|
+
receiptScopes.push({ element: receiptScope, initialExactTexts });
|
|
3389
3462
|
}
|
|
3463
|
+
if (associatedLocalWrapper)
|
|
3464
|
+
capturedReceiptScope = true;
|
|
3465
|
+
if (fieldGroupReceiptBranch)
|
|
3466
|
+
capturedFieldGroupReceiptScope = true;
|
|
3390
3467
|
if (current instanceof HTMLFormElement)
|
|
3391
3468
|
break;
|
|
3392
3469
|
current = composedParent(current);
|
|
@@ -3494,8 +3571,9 @@ async function readReactiveFileReceipt(guard, expectedNames) {
|
|
|
3494
3571
|
element.getClientRects().length > 0;
|
|
3495
3572
|
}
|
|
3496
3573
|
const normalize = (text) => (text ?? '').replace(/\s+/g, ' ').trim();
|
|
3497
|
-
//
|
|
3498
|
-
//
|
|
3574
|
+
// Each scope is either the exact input's nearest local wrapper or the
|
|
3575
|
+
// input-bearing branch of an explicitly labelled field group. Never scan
|
|
3576
|
+
// the group itself or combine evidence from sibling/ancestor controls.
|
|
3499
3577
|
const candidate = value.receiptScopes.find((entry) => entry.element.isConnected);
|
|
3500
3578
|
if (!candidate) {
|
|
3501
3579
|
return { hasScope: false, hasReceipt: false, hasProgress: false, hasError: false };
|
|
@@ -3538,7 +3616,18 @@ async function readReactiveFileReceipt(guard, expectedNames) {
|
|
|
3538
3616
|
return true;
|
|
3539
3617
|
return /^(?:(?:this|the|selected|uploaded|current)\s+)?(?:file|attachment|upload|document|resume|cv|cover letter)\b/i.test(remainder);
|
|
3540
3618
|
});
|
|
3541
|
-
const hasProgress = descendants.some(
|
|
3619
|
+
const hasProgress = descendants.some((element) => {
|
|
3620
|
+
if (!visible(element))
|
|
3621
|
+
return false;
|
|
3622
|
+
if (element.matches('[role="progressbar"], progress, [aria-busy="true"]'))
|
|
3623
|
+
return true;
|
|
3624
|
+
for (const attribute of ['data-state', 'data-status', 'data-upload-state', 'data-file-state']) {
|
|
3625
|
+
const state = element.getAttribute(attribute)?.trim().toLowerCase();
|
|
3626
|
+
if (state && /^(?:uploading|pending|processing|in[-_ ]?progress|queued)$/.test(state))
|
|
3627
|
+
return true;
|
|
3628
|
+
}
|
|
3629
|
+
return false;
|
|
3630
|
+
});
|
|
3542
3631
|
const hasError = descendants.some((element) => {
|
|
3543
3632
|
if (!visible(element))
|
|
3544
3633
|
return false;
|