clearcote 0.51.1 → 0.52.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/dist/attention.d.ts +26 -0
- package/dist/attention.d.ts.map +1 -0
- package/dist/attention.js +82 -0
- package/dist/attention.js.map +1 -0
- package/dist/cloud.d.ts +10 -3
- package/dist/cloud.d.ts.map +1 -1
- package/dist/cloud.js +9 -1
- package/dist/cloud.js.map +1 -1
- package/dist/forms.d.ts +8 -0
- package/dist/forms.d.ts.map +1 -1
- package/dist/forms.js +56 -0
- package/dist/forms.js.map +1 -1
- package/dist/frames.d.ts +33 -0
- package/dist/frames.d.ts.map +1 -0
- package/dist/frames.js +415 -0
- package/dist/frames.js.map +1 -0
- package/dist/hold.d.ts +14 -7
- package/dist/hold.d.ts.map +1 -1
- package/dist/hold.js +33 -6
- package/dist/hold.js.map +1 -1
- package/dist/humanize.d.ts +49 -20
- package/dist/humanize.d.ts.map +1 -1
- package/dist/humanize.js +2024 -261
- package/dist/humanize.js.map +1 -1
- package/dist/hzoptions.d.ts +78 -0
- package/dist/hzoptions.d.ts.map +1 -0
- package/dist/hzoptions.js +171 -0
- package/dist/hzoptions.js.map +1 -0
- package/dist/index.d.ts +9 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6 -0
- package/dist/index.js.map +1 -1
- package/dist/isolated.d.ts +6 -0
- package/dist/isolated.d.ts.map +1 -1
- package/dist/isolated.js +57 -1
- package/dist/isolated.js.map +1 -1
- package/dist/keys.d.ts +69 -0
- package/dist/keys.d.ts.map +1 -0
- package/dist/keys.js +201 -0
- package/dist/keys.js.map +1 -0
- package/dist/motion.d.ts +130 -12
- package/dist/motion.d.ts.map +1 -1
- package/dist/motion.js +258 -19
- package/dist/motion.js.map +1 -1
- package/dist/motionscore.d.ts +81 -0
- package/dist/motionscore.d.ts.map +1 -1
- package/dist/motionscore.js +279 -2
- package/dist/motionscore.js.map +1 -1
- package/dist/pacing.d.ts +5 -0
- package/dist/pacing.d.ts.map +1 -1
- package/dist/pacing.js +10 -0
- package/dist/pacing.js.map +1 -1
- package/dist/scroll.d.ts +143 -0
- package/dist/scroll.d.ts.map +1 -0
- package/dist/scroll.js +426 -0
- package/dist/scroll.js.map +1 -0
- package/dist/trace.d.ts +12 -0
- package/dist/trace.d.ts.map +1 -0
- package/dist/trace.js +60 -0
- package/dist/trace.js.map +1 -0
- package/package.json +1 -1
package/dist/isolated.d.ts
CHANGED
|
@@ -15,6 +15,8 @@
|
|
|
15
15
|
*
|
|
16
16
|
* Mirrors sdk/python/clearcote/_isolated.py and sdk/dotnet/src/Clearcote/IsolatedWorld.cs.
|
|
17
17
|
*/
|
|
18
|
+
/** @internal The JSON value of a Runtime.evaluate / callFunctionOn answer, or undefined. */
|
|
19
|
+
export declare const resultValue: <T>(r: any) => T | undefined;
|
|
18
20
|
/** @internal exported for tests. DOM.getNodeForLocation hit-tests in DOCUMENT coordinates (the
|
|
19
21
|
* viewport point plus the scroll offset); Playwright's boxes, CDP's box model and the mouse are all
|
|
20
22
|
* VIEWPORT coordinates. Measured on r37: a field scrolled 547 px down answered "No node found" at its
|
|
@@ -46,6 +48,8 @@ export declare class IsolatedWorld {
|
|
|
46
48
|
evaluate<T = unknown>(fnSource: string, arg?: unknown, awaitPromise?: boolean): Promise<T | undefined>;
|
|
47
49
|
/** A raw CDP call on this page's session (DOM reads that run no script), or undefined. */
|
|
48
50
|
send<T = any>(method: string, params?: Record<string, unknown>): Promise<T | undefined>;
|
|
51
|
+
/** The main frame's id (the world is made on first use), or undefined without CDP. */
|
|
52
|
+
mainFrameId(): Promise<string | undefined>;
|
|
49
53
|
/** The main frame's [scrollX, scrollY], read in the isolated world; [0, 0] if unknown. */
|
|
50
54
|
scroll(): Promise<[number, number]>;
|
|
51
55
|
/** backendNodeId of the MAIN-FRAME element at viewport point (x, y) -- for a point inside a child
|
|
@@ -84,6 +88,8 @@ export declare const ISO_ACTIVE_FIELD = "() => { let e = document.activeElement;
|
|
|
84
88
|
export declare const ISO_DESCRIBE = "function (a) {\n let e = this.nodeType === 1 ? this : this.parentElement;\n if (!e) return null;\n if (a && a.want) { const c = e.closest(a.want); if (!c) return null; e = c; }\n const r = e.getBoundingClientRect(), cs = getComputedStyle(e), tag = e.tagName.toLowerCase();\n const o = { tag, type: tag === 'input' ? e.type : '', ce: !!e.isContentEditable,\n rect: [r.x, r.y, r.width, r.height], focused: e === document.activeElement,\n value: typeof e.value === 'string' ? e.value : (e.isContentEditable ? e.textContent : null),\n min: e.getAttribute('min'), max: e.getAttribute('max'), step: e.getAttribute('step'),\n maxlength: typeof e.maxLength === 'number' ? e.maxLength : -1,\n inputmode: e.getAttribute('inputmode'), autocomplete: e.getAttribute('autocomplete'),\n readonly: !!e.readOnly, disabled: !!e.disabled, dir: cs.direction, wm: cs.writingMode,\n bl: e.clientLeft || 0, bt: e.clientTop || 0 };\n if (tag === 'select') {\n o.multiple = e.multiple; o.size = e.size; o.selectedIndex = e.selectedIndex;\n o.options = Array.from(e.options, x => ({ value: x.value, label: x.label,\n disabled: x.disabled || !!(x.parentElement && x.parentElement.tagName === 'OPTGROUP' && x.parentElement.disabled),\n selected: x.selected }));\n if (e.multiple || e.size > 1)\n o.optRects = Array.from(e.options, x => { const q = x.getBoundingClientRect(); return [q.x, q.y, q.width, q.height]; });\n }\n return o; }";
|
|
85
89
|
export declare const ISO_FORM_CONTROL = "input, textarea, select, [contenteditable=''], [contenteditable='true'], [contenteditable='plaintext-only']";
|
|
86
90
|
export declare const ISO_HIT_IN_BOX = "function (b) {\n const same = r => Math.abs(r.x - b.x) <= 1.5 && Math.abs(r.y - b.y) <= 1.5 &&\n Math.abs(r.width - b.width) <= 1.5 && Math.abs(r.height - b.height) <= 1.5;\n const up = n => { const p = n.parentNode; return n.parentElement || (p && p.nodeType === 11 && p.host) || null; };\n const h = this.nodeType === 1 ? this : this.parentElement;\n let t = null;\n if (b.sel) { try { t = document.querySelector(b.sel); } catch (x) { t = null; } }\n if (t && same(t.getBoundingClientRect())) {\n for (let e = h, n = 0; e && n < 128; e = up(e), n++)\n if (e === t || (e.tagName === 'LABEL' && e.control === t)) return true;\n return false;\n }\n const CTL = 'a[href], area[href], button, input, select, textarea, label, summary, iframe, [contenteditable], ' +\n '[tabindex], [role=button], [role=link], [role=checkbox], [role=radio], [role=switch], [role=tab], ' +\n '[role=menuitem], [role=option], [role=combobox], [role=textbox]';\n const takes = d => { const s = getComputedStyle(d); return s.pointerEvents !== 'none' && s.visibility === 'visible'; };\n const path = new Set();\n for (let e = h, n = 0; e && n < 128; e = up(e), n++) {\n path.add(e);\n if (same(e.getBoundingClientRect())) {\n const all = e.getElementsByTagName('*'), ctl = e.matches(CTL);\n if (all.length <= 4000)\n for (const d of all) {\n if (path.has(d) || !same(d.getBoundingClientRect()) || !takes(d)) continue;\n if (d.labels && Array.prototype.some.call(d.labels, l => l.contains(h))) continue;\n if (ctl && !d.matches(CTL) && !d.querySelector(CTL)) continue;\n return false;\n }\n return true;\n }\n }\n return false; }";
|
|
91
|
+
export declare const ISO_LABEL_OF = "function () {\n const e = this.nodeType === 1 ? this : this.parentElement;\n if (!e || e.tagName !== 'INPUT' || (e.type !== 'checkbox' && e.type !== 'radio')) return null;\n const r = e.getBoundingClientRect(), cs = getComputedStyle(e);\n const clip = /rect\\(\\s*0(px)?[ ,]+0(px)?[ ,]+0(px)?[ ,]+0(px)?\\s*\\)/.test(cs.clip || '');\n const hidden = cs.display === 'none' || cs.visibility !== 'visible' || parseFloat(cs.opacity) < 0.05 ||\n r.width <= 1 || r.height <= 1 || clip || r.right < 0 || r.bottom < 0 ||\n r.left > innerWidth + 1 || r.top > innerHeight + 1;\n const o = { tag: 'input', type: e.type, rect: [r.x, r.y, r.width, r.height], hidden,\n checked: !!e.checked, disabled: !!e.disabled, label: null };\n const lab = (e.labels && e.labels.length) ? e.labels[0] : e.closest('label');\n if (!lab) return o;\n const lr = lab.getBoundingClientRect(), ls = getComputedStyle(lab);\n if (ls.display === 'none' || ls.visibility !== 'visible' || lr.width < 2 || lr.height < 2) return o;\n // The TEXT's box: the union of the label's content rects clear of the control's own box. A label that WRAPS its\n // control lists the control's border box first (SC 239 box probe: text == the input's rect), and a click there is an\n // input click, not a label click. Text wrapped to a line under the control: the first clear rect alone.\n const wraps = lab.contains(e);\n const over = q => wraps && q.left < r.right - 0.5 && q.right > r.left + 0.5 && q.top < r.bottom - 0.5 && q.bottom > r.top + 0.5;\n let text = null;\n try {\n const rg = document.createRange(); rg.selectNodeContents(lab);\n const clear = Array.from(rg.getClientRects()).filter(q => q.width >= 2 && q.height >= 2 && !over(q));\n if (clear.length) {\n const u = { left: Infinity, top: Infinity, right: -Infinity, bottom: -Infinity };\n for (const q of clear) {\n u.left = Math.min(u.left, q.left); u.top = Math.min(u.top, q.top);\n u.right = Math.max(u.right, q.right); u.bottom = Math.max(u.bottom, q.bottom);\n }\n const t = over(u) ? clear[0] : u;\n text = [t.left, t.top, t.right - t.left, t.bottom - t.top];\n }\n } catch (x) { text = null; }\n o.label = { rect: [lr.x, lr.y, lr.width, lr.height], text, contains: wraps };\n return o; }";
|
|
92
|
+
export declare const ISO_LABEL_BY_SEL = "(a) => { let l;\n try { l = document.querySelectorAll(a.sel); } catch (e) { return null; }\n if (!l.length) return { n: 0 };\n const o = (function () {\n const e = this.nodeType === 1 ? this : this.parentElement;\n if (!e || e.tagName !== 'INPUT' || (e.type !== 'checkbox' && e.type !== 'radio')) return null;\n const r = e.getBoundingClientRect(), cs = getComputedStyle(e);\n const clip = /rect\\(\\s*0(px)?[ ,]+0(px)?[ ,]+0(px)?[ ,]+0(px)?\\s*\\)/.test(cs.clip || '');\n const hidden = cs.display === 'none' || cs.visibility !== 'visible' || parseFloat(cs.opacity) < 0.05 ||\n r.width <= 1 || r.height <= 1 || clip || r.right < 0 || r.bottom < 0 ||\n r.left > innerWidth + 1 || r.top > innerHeight + 1;\n const o = { tag: 'input', type: e.type, rect: [r.x, r.y, r.width, r.height], hidden,\n checked: !!e.checked, disabled: !!e.disabled, label: null };\n const lab = (e.labels && e.labels.length) ? e.labels[0] : e.closest('label');\n if (!lab) return o;\n const lr = lab.getBoundingClientRect(), ls = getComputedStyle(lab);\n if (ls.display === 'none' || ls.visibility !== 'visible' || lr.width < 2 || lr.height < 2) return o;\n // The TEXT's box: the union of the label's content rects clear of the control's own box. A label that WRAPS its\n // control lists the control's border box first (SC 239 box probe: text == the input's rect), and a click there is an\n // input click, not a label click. Text wrapped to a line under the control: the first clear rect alone.\n const wraps = lab.contains(e);\n const over = q => wraps && q.left < r.right - 0.5 && q.right > r.left + 0.5 && q.top < r.bottom - 0.5 && q.bottom > r.top + 0.5;\n let text = null;\n try {\n const rg = document.createRange(); rg.selectNodeContents(lab);\n const clear = Array.from(rg.getClientRects()).filter(q => q.width >= 2 && q.height >= 2 && !over(q));\n if (clear.length) {\n const u = { left: Infinity, top: Infinity, right: -Infinity, bottom: -Infinity };\n for (const q of clear) {\n u.left = Math.min(u.left, q.left); u.top = Math.min(u.top, q.top);\n u.right = Math.max(u.right, q.right); u.bottom = Math.max(u.bottom, q.bottom);\n }\n const t = over(u) ? clear[0] : u;\n text = [t.left, t.top, t.right - t.left, t.bottom - t.top];\n }\n } catch (x) { text = null; }\n o.label = { rect: [lr.x, lr.y, lr.width, lr.height], text, contains: wraps };\n return o; }).call(l[0]);\n if (!o) return { n: l.length };\n o.n = l.length; return o; }";
|
|
87
93
|
export declare const ISO_LISTBOX_ROW = "function (a) {\n const n = this.nodeType === 1 ? this : this.parentElement;\n const e = n && n.closest('select');\n if (!e || !e.options[a.i]) return null;\n const r = e.getBoundingClientRect(), q = e.options[a.i].getBoundingClientRect();\n return { box: [r.x, r.y, r.width, r.height], row: [q.x, q.y, q.width, q.height],\n top: r.y + e.clientTop, bottom: r.y + e.clientTop + e.clientHeight,\n st: e.scrollTop, max: e.scrollHeight - e.clientHeight,\n sel: Array.from(e.options, x => x.selected) }; }";
|
|
88
94
|
export declare const ISO_CSS_BOX = "(a) => { let l;\n try { l = document.querySelectorAll(a.sel); } catch (e) { return null; }\n if (!l.length) return { n: 0 };\n const e = l[0];\n if (a.scroll) { if (e.scrollIntoViewIfNeeded) e.scrollIntoViewIfNeeded(true);\n else e.scrollIntoView({ block: 'center', inline: 'center' }); }\n const r = e.getBoundingClientRect();\n return { n: l.length, rect: [r.x, r.y, r.width, r.height] }; }";
|
|
89
95
|
export declare const ISO_SCROLL_BY = "(d) => { const x = scrollX, y = scrollY;\n scrollBy({ left: d[0], top: d[1], behavior: 'instant' });\n return [scrollX - x, scrollY - y]; }";
|
package/dist/isolated.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"isolated.d.ts","sourceRoot":"","sources":["../src/isolated.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;
|
|
1
|
+
{"version":3,"file":"isolated.d.ts","sourceRoot":"","sources":["../src/isolated.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAIH,4FAA4F;AAC5F,eAAO,MAAM,WAAW,GAAI,CAAC,EAAE,GAAG,GAAG,KAAG,CAAC,GAAG,SAG3C,CAAC;AAEF;;;;;;;;8DAQ8D;AAC9D,wBAAgB,YAAY,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,SAAS,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,IAAI,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAGrH;AAED;+FAC+F;AAC/F,wBAAgB,aAAa,CAAC,IAAI,EAAE,GAAG,EAAE,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAiBrF;AAED,sGAAsG;AACtG,kGAAkG;AAClG,wBAAgB,aAAa,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAK/C;AAKD,qBAAa,aAAa;IAQZ,OAAO,CAAC,QAAQ,CAAC,IAAI;IAJjC,OAAO,CAAC,GA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AE,EAAE,MAAM,CAAC;IACX,EAAE,EAAE,MAAM,CAAC;IACX,EAAE,EAAE,MAAM,CAAC;IACX,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,OAAO,CAAC,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,OAAO,CAAC;QAAC,QAAQ,EAAE,OAAO,CAAA;KAAE,EAAE,CAAC;IACnF,QAAQ,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,CAAC;IAC9C,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,uFAAuF;IACvF,KAAK,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAC1B"}
|
package/dist/isolated.js
CHANGED
|
@@ -15,7 +15,8 @@
|
|
|
15
15
|
*
|
|
16
16
|
* Mirrors sdk/python/clearcote/_isolated.py and sdk/dotnet/src/Clearcote/IsolatedWorld.cs.
|
|
17
17
|
*/
|
|
18
|
-
|
|
18
|
+
/** @internal The JSON value of a Runtime.evaluate / callFunctionOn answer, or undefined. */
|
|
19
|
+
export const resultValue = (r) => {
|
|
19
20
|
if (!r || typeof r !== "object" || r.exceptionDetails)
|
|
20
21
|
return undefined;
|
|
21
22
|
return r.result?.value;
|
|
@@ -138,6 +139,16 @@ export class IsolatedWorld {
|
|
|
138
139
|
return undefined;
|
|
139
140
|
}
|
|
140
141
|
}
|
|
142
|
+
/** The main frame's id (the world is made on first use), or undefined without CDP. */
|
|
143
|
+
async mainFrameId() {
|
|
144
|
+
try {
|
|
145
|
+
const { world } = await this.ensure();
|
|
146
|
+
return (await world).frame;
|
|
147
|
+
}
|
|
148
|
+
catch {
|
|
149
|
+
return undefined;
|
|
150
|
+
}
|
|
151
|
+
}
|
|
141
152
|
/** The main frame's [scrollX, scrollY], read in the isolated world; [0, 0] if unknown. */
|
|
142
153
|
async scroll() {
|
|
143
154
|
const s = await this.evaluate(ISO_SCROLL);
|
|
@@ -343,6 +354,51 @@ export const ISO_HIT_IN_BOX = `function (b) {
|
|
|
343
354
|
// A list box's scroll state and one row's box, from any node inside the <select> (`this`): where its
|
|
344
355
|
// visible rows are (top / bottom of the client area), how far it is scrolled (st, of max), the row's
|
|
345
356
|
// rect, and which rows are selected.
|
|
357
|
+
// A checkbox / radio and its <label>, from the input node (`this`): mirrors _isolated.py LABEL_OF (is the input
|
|
358
|
+
// itself clickable -- `hidden` covers every "visually hidden" recipe a custom checkbox uses --, and the label the
|
|
359
|
+
// browser associates with it, with the label's box and the box of its text).
|
|
360
|
+
export const ISO_LABEL_OF = `function () {
|
|
361
|
+
const e = this.nodeType === 1 ? this : this.parentElement;
|
|
362
|
+
if (!e || e.tagName !== 'INPUT' || (e.type !== 'checkbox' && e.type !== 'radio')) return null;
|
|
363
|
+
const r = e.getBoundingClientRect(), cs = getComputedStyle(e);
|
|
364
|
+
const clip = /rect\\(\\s*0(px)?[ ,]+0(px)?[ ,]+0(px)?[ ,]+0(px)?\\s*\\)/.test(cs.clip || '');
|
|
365
|
+
const hidden = cs.display === 'none' || cs.visibility !== 'visible' || parseFloat(cs.opacity) < 0.05 ||
|
|
366
|
+
r.width <= 1 || r.height <= 1 || clip || r.right < 0 || r.bottom < 0 ||
|
|
367
|
+
r.left > innerWidth + 1 || r.top > innerHeight + 1;
|
|
368
|
+
const o = { tag: 'input', type: e.type, rect: [r.x, r.y, r.width, r.height], hidden,
|
|
369
|
+
checked: !!e.checked, disabled: !!e.disabled, label: null };
|
|
370
|
+
const lab = (e.labels && e.labels.length) ? e.labels[0] : e.closest('label');
|
|
371
|
+
if (!lab) return o;
|
|
372
|
+
const lr = lab.getBoundingClientRect(), ls = getComputedStyle(lab);
|
|
373
|
+
if (ls.display === 'none' || ls.visibility !== 'visible' || lr.width < 2 || lr.height < 2) return o;
|
|
374
|
+
// The TEXT's box: the union of the label's content rects clear of the control's own box. A label that WRAPS its
|
|
375
|
+
// control lists the control's border box first (SC 239 box probe: text == the input's rect), and a click there is an
|
|
376
|
+
// input click, not a label click. Text wrapped to a line under the control: the first clear rect alone.
|
|
377
|
+
const wraps = lab.contains(e);
|
|
378
|
+
const over = q => wraps && q.left < r.right - 0.5 && q.right > r.left + 0.5 && q.top < r.bottom - 0.5 && q.bottom > r.top + 0.5;
|
|
379
|
+
let text = null;
|
|
380
|
+
try {
|
|
381
|
+
const rg = document.createRange(); rg.selectNodeContents(lab);
|
|
382
|
+
const clear = Array.from(rg.getClientRects()).filter(q => q.width >= 2 && q.height >= 2 && !over(q));
|
|
383
|
+
if (clear.length) {
|
|
384
|
+
const u = { left: Infinity, top: Infinity, right: -Infinity, bottom: -Infinity };
|
|
385
|
+
for (const q of clear) {
|
|
386
|
+
u.left = Math.min(u.left, q.left); u.top = Math.min(u.top, q.top);
|
|
387
|
+
u.right = Math.max(u.right, q.right); u.bottom = Math.max(u.bottom, q.bottom);
|
|
388
|
+
}
|
|
389
|
+
const t = over(u) ? clear[0] : u;
|
|
390
|
+
text = [t.left, t.top, t.right - t.left, t.bottom - t.top];
|
|
391
|
+
}
|
|
392
|
+
} catch (x) { text = null; }
|
|
393
|
+
o.label = { rect: [lr.x, lr.y, lr.width, lr.height], text, contains: wraps };
|
|
394
|
+
return o; }`;
|
|
395
|
+
// ISO_LABEL_OF for the first match of a plain-CSS selector, plus how many match; null when it is not CSS.
|
|
396
|
+
export const ISO_LABEL_BY_SEL = `(a) => { let l;
|
|
397
|
+
try { l = document.querySelectorAll(a.sel); } catch (e) { return null; }
|
|
398
|
+
if (!l.length) return { n: 0 };
|
|
399
|
+
const o = (${ISO_LABEL_OF}).call(l[0]);
|
|
400
|
+
if (!o) return { n: l.length };
|
|
401
|
+
o.n = l.length; return o; }`;
|
|
346
402
|
export const ISO_LISTBOX_ROW = `function (a) {
|
|
347
403
|
const n = this.nodeType === 1 ? this : this.parentElement;
|
|
348
404
|
const e = n && n.closest('select');
|
package/dist/isolated.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"isolated.js","sourceRoot":"","sources":["../src/isolated.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAIH,MAAM,WAAW,GAAG,CAAI,CAAM,EAAiB,EAAE;
|
|
1
|
+
{"version":3,"file":"isolated.js","sourceRoot":"","sources":["../src/isolated.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAIH,4FAA4F;AAC5F,MAAM,CAAC,MAAM,WAAW,GAAG,CAAI,CAAM,EAAiB,EAAE;IACtD,IAAI,CAAC,CAAC,IAAI,OAAO,CAAC,KAAK,QAAQ,IAAI,CAAC,CAAC,gBAAgB;QAAE,OAAO,SAAS,CAAC;IACxE,OAAO,CAAC,CAAC,MAAM,EAAE,KAAU,CAAC;AAC9B,CAAC,CAAC;AAEF;;;;;;;;8DAQ8D;AAC9D,MAAM,UAAU,YAAY,CAAC,CAAS,EAAE,CAAS,EAAE,MAAyC;IAC1F,MAAM,CAAC,EAAE,EAAE,EAAE,CAAC,GAAG,MAAM,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;IAClC,OAAO,EAAE,CAAC,EAAE,aAAa,CAAC,CAAC,GAAG,EAAE,CAAC,EAAE,CAAC,EAAE,aAAa,CAAC,CAAC,GAAG,EAAE,CAAC,EAAE,yBAAyB,EAAE,KAAK,EAAE,CAAC;AAClG,CAAC;AAED;+FAC+F;AAC/F,MAAM,UAAU,aAAa,CAAC,IAAS,EAAE,OAAe,EAAE,IAAY;IACpE,MAAM,OAAO,GAAG,IAAI,GAAG,EAAyB,CAAC;IACjD,MAAM,IAAI,GAAG,CAAC,CAAM,EAAE,MAAqB,EAAE,EAAE;QAC7C,MAAM,EAAE,GAAG,CAAC,EAAE,KAAK,EAAE,EAAE,CAAC;QACxB,IAAI,CAAC,EAAE;YAAE,OAAO;QACh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sGAAsG;AACtG,qGAAqG;AACrG,yGAAyG;AACzG,sGAAsG;AACtG,sGAAsG;AACtG,uGAAuG;AACvG,uGAAuG;AACvG,8DAA8D;AAC9D,EAAE;AACF,sGAAsG;AACtG,qGAAqG;AACrG,yFAAyF;AACzF,MAAM,CAAC,MAAM,cAAc,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBA+BZ,CAAC;AACnB,qGAAqG;AACrG,qGAAqG;AACrG,qCAAqC;AACrC,gHAAgH;AAChH,kHAAkH;AAClH,6EAA6E;AAC7E,MAAM,CAAC,MAAM,YAAY,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAkCd,CAAC;AACf,0GAA0G;AAC1G,MAAM,CAAC,MAAM,gBAAgB,GAAG;;;eAGjB,YAAY;;8BAEG,CAAC;AAC/B,MAAM,CAAC,MAAM,eAAe,GAAG;;;;;;;;qDAQsB,CAAC;AACtD,oGAAoG;AACpG,oGAAoG;AACpG,mFAAmF;AACnF,uFAAuF;AACvF,MAAM,CAAC,MAAM,WAAW,GAAG;;;;;;;iEAOsC,CAAC;AAClE,oGAAoG;AACpG,gFAAgF;AAChF,MAAM,CAAC,MAAM,aAAa,GAAG;;uCAEU,CAAC"}
|
package/dist/keys.d.ts
ADDED
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { type Rng } from "./motion.js";
|
|
2
|
+
export declare const MIN_FLIGHT_MS = 25;
|
|
3
|
+
/** Per-identity typing signature, stable per seed (typingTraits). */
|
|
4
|
+
export interface TypingTraits {
|
|
5
|
+
wpm: number;
|
|
6
|
+
sameFinger: number;
|
|
7
|
+
sameHand: number;
|
|
8
|
+
alternate: number;
|
|
9
|
+
tabPref: number;
|
|
10
|
+
typoRate: number;
|
|
11
|
+
submitCenterMs: number;
|
|
12
|
+
tabCenterMs: number;
|
|
13
|
+
selectStyle: "triple" | "keys";
|
|
14
|
+
blurStyle: "tab" | "click";
|
|
15
|
+
repeatFirstMs: number;
|
|
16
|
+
repeatGapMs: number;
|
|
17
|
+
}
|
|
18
|
+
/** The typing identity of persona seed `seedInt` (Persona.seed). Draw order as _keys.typing_traits. */
|
|
19
|
+
export declare function typingTraits(seedInt: number): TypingTraits;
|
|
20
|
+
/** [finger 0..7, row 0..3] of the key that types `ch`, or null. Capitals / shifted symbols: their base key. */
|
|
21
|
+
export declare function fingerOf(ch: string | null | undefined): [number, number] | null;
|
|
22
|
+
export type BigramClass = "same_finger" | "same_hand" | "alternate" | "none";
|
|
23
|
+
/** How the hand gets from `prev` to `ch`, and whether it is a two-row reach on the same hand. */
|
|
24
|
+
export declare function bigramClass(prev: string | null | undefined, ch: string | null | undefined): [BigramClass, boolean];
|
|
25
|
+
/** How much this persona's finger factors and the flight noise stretch a neutral flight on English text (_keys.english_inflation). */
|
|
26
|
+
export declare function englishInflation(t: TypingTraits): number;
|
|
27
|
+
/** The neutral bigram's flight, calibrated so the mean keydown interval on English text is 60000 / (wpm x 5) (_keys.base_flight_ms). */
|
|
28
|
+
export declare function baseFlightMs(t: TypingTraits): number;
|
|
29
|
+
/** Flight (ms) from key `prev` to key `ch`; draw order as _keys.flight_ms. */
|
|
30
|
+
export declare function flightMs(t: TypingTraits, prev: string | null | undefined, ch: string | null | undefined, rng: Rng): number;
|
|
31
|
+
/** The whole sleep between key `prev` coming up and key `ch` going down (_keys.plan_gap). */
|
|
32
|
+
export declare function planGap(t: TypingTraits, prev: string | null | undefined, ch: string | null | undefined, rng: Rng, tempo?: number, pauseScale?: number): number;
|
|
33
|
+
export declare const WORD_FIX_RATE = 0.3;
|
|
34
|
+
export declare const SEARCH_SLIP_RATE = 0.1;
|
|
35
|
+
/** Playwright's key string split into [modifiers, key] ("Shift++" -> [["Shift"], "+"]). */
|
|
36
|
+
export declare function splitChord(key: string): [string[], string];
|
|
37
|
+
export declare const modifierLeadMs: (rng: Rng) => number;
|
|
38
|
+
export declare const modifierLagMs: (rng: Rng) => number;
|
|
39
|
+
export interface RepeatPlan {
|
|
40
|
+
firstMs: number;
|
|
41
|
+
gapMs: number;
|
|
42
|
+
releaseMs: number;
|
|
43
|
+
}
|
|
44
|
+
/** OS auto-repeat timing for one held key: the persona's repeat delay and interval (a machine setting,
|
|
45
|
+
* typingTraits) seen through +-2 / +-1 ms of timer jitter per run, and the hand's release. Draw order: first
|
|
46
|
+
* jitter, gap jitter, release (_keys.plan_repeat). */
|
|
47
|
+
export declare function planRepeat(t: TypingTraits, rng: Rng): RepeatPlan;
|
|
48
|
+
export declare const submitPauseMs: (t: TypingTraits, rng: Rng) => number;
|
|
49
|
+
export declare const tabPauseMs: (t: TypingTraits, rng: Rng) => number;
|
|
50
|
+
export declare const FOCUSABLE: string;
|
|
51
|
+
export declare const TAB_DISTANCE = "function (b) {\n const up = n => n.parentElement || (n.parentNode && n.parentNode.nodeType === 11 && n.parentNode.host) || null;\n const FOC = 'a[href], area[href], button, input, select, textarea, summary, iframe, [tabindex], [contenteditable], audio[controls], video[controls]';\n const same = r => Math.abs(r.x - b.x) <= 1.5 && Math.abs(r.y - b.y) <= 1.5 &&\n Math.abs(r.width - b.width) <= 1.5 && Math.abs(r.height - b.height) <= 1.5;\n let t = null;\n if (b.sel) { try { t = document.querySelector(b.sel); } catch (e) { t = null; } }\n if (!t) {\n for (let e = this.nodeType === 1 ? this : this.parentElement, n = 0; e && n < 64; e = up(e), n++)\n if (e.matches && e.matches(FOC)) { t = e; break; }\n }\n if (!t || !t.matches(FOC) || !same(t.getBoundingClientRect())) return null;\n const ti = e => { const v = parseInt(e.getAttribute('tabindex'), 10); return isNaN(v) ? 0 : v; };\n const vis = e => { const s = getComputedStyle(e); return s.visibility !== 'hidden' && s.display !== 'none' && e.getClientRects().length > 0; };\n const tabbable = e => !e.disabled && !(e.tagName === 'INPUT' && e.type === 'hidden') && ti(e) >= 0 &&\n !(e.tagName === 'A' && !e.hasAttribute('href')) && vis(e);\n const all = Array.from(document.querySelectorAll(FOC)).filter(tabbable);\n const pos = all.filter(e => ti(e) > 0).sort((x, y) => ti(x) - ti(y));\n const order = pos.concat(all.filter(e => ti(e) <= 0));\n let a = document.activeElement;\n while (a && a.shadowRoot && a.shadowRoot.activeElement) a = a.shadowRoot.activeElement;\n const ai = a ? order.indexOf(a) : -1, tix = order.indexOf(t);\n const VALUE_TYPES = ['checkbox', 'radio', 'button', 'submit', 'reset', 'file', 'image', 'range', 'color', 'hidden'];\n const text = e => !!e && ((e.tagName === 'INPUT' && VALUE_TYPES.indexOf(e.type) < 0) || e.tagName === 'TEXTAREA' || !!e.isContentEditable);\n const role = t.getAttribute('role') || '';\n const act = ['BUTTON', 'A', 'SUMMARY', 'SELECT'].indexOf(t.tagName) >= 0 ||\n (t.tagName === 'INPUT' && VALUE_TYPES.indexOf(t.type) >= 0) ||\n ['button', 'link', 'checkbox', 'radio', 'switch', 'tab', 'menuitem', 'option'].indexOf(role) >= 0;\n let near = null;\n if (tix >= 0) for (const off of [1, 2, 3, -1]) {\n const c = order[tix - off];\n if (!c || c === a || !text(c) || c.disabled) continue;\n const q = c.getBoundingClientRect();\n if (q.width >= 2 && q.height >= 2 && q.left >= 0 && q.top >= 0 && q.right <= innerWidth && q.bottom <= innerHeight) {\n near = { off, rect: [q.x, q.y, q.width, q.height] }; break; }\n }\n return { dist: ai >= 0 && tix >= 0 ? tix - ai : null, fromText: text(a), focused: a === t,\n activatable: act, text: text(t), tag: t.tagName.toLowerCase(), type: t.tagName === 'INPUT' ? t.type : '',\n n: order.length, noAnchor: ai < 0, near }; }";
|
|
52
|
+
export declare const BLANK_POINT = "(a) => { const b = a.box, FOC = 'a[href], area[href], button, input, select, textarea, summary, iframe, [tabindex], [contenteditable], audio[controls], video[controls], label, [onclick], [role]';\n const cands = [];\n for (const dy of [28, 56, 96]) cands.push([b.x + b.width * 0.5, b.y + b.height + dy]);\n for (const dx of [32, 72, 128]) cands.push([b.x + b.width + dx, b.y + b.height * 0.5]);\n for (const dx of [32, 72]) cands.push([b.x - dx, b.y + b.height * 0.5]);\n for (const dy of [40, 80]) cands.push([b.x + b.width * 0.5, b.y - dy]);\n const PLAIN = ['HTML', 'BODY', 'DIV', 'SECTION', 'MAIN', 'FORM', 'ARTICLE', 'P', 'SPAN', 'FIELDSET', 'UL', 'LI', 'HEADER', 'FOOTER', 'NAV', 'ASIDE', 'TD', 'TR', 'TABLE'];\n for (const [x, y] of cands) {\n if (x < 4 || y < 4 || x > a.vw - 4 || y > a.vh - 4) continue;\n const e = document.elementFromPoint(x, y);\n if (!e) continue;\n if (PLAIN.indexOf(e.tagName) < 0 || e.isContentEditable) continue;\n if (e.closest(FOC)) continue;\n return [x, y];\n }\n return null; }";
|
|
53
|
+
export declare const SELECTION_STATE = "() => { let e = document.activeElement;\n while (e && e.shadowRoot && e.shadowRoot.activeElement) e = e.shadowRoot.activeElement;\n if (!e) return null;\n if (typeof e.selectionStart === 'number' && typeof e.value === 'string')\n return [e.selectionStart, e.selectionEnd, e.value.length];\n if (e.isContentEditable) { const s = getSelection(); return [0, s ? s.toString().length : 0, (e.textContent || '').length]; }\n return null; }";
|
|
54
|
+
export interface TabInfo {
|
|
55
|
+
dist: number | null;
|
|
56
|
+
fromText: boolean;
|
|
57
|
+
focused: boolean;
|
|
58
|
+
activatable: boolean;
|
|
59
|
+
text: boolean;
|
|
60
|
+
tag: string;
|
|
61
|
+
type: string;
|
|
62
|
+
n: number;
|
|
63
|
+
noAnchor?: boolean;
|
|
64
|
+
near?: {
|
|
65
|
+
off: number;
|
|
66
|
+
rect: number[];
|
|
67
|
+
} | null;
|
|
68
|
+
}
|
|
69
|
+
//# sourceMappingURL=keys.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"keys.d.ts","sourceRoot":"","sources":["../src/keys.ts"],"names":[],"mappings":"AAeA,OAAO,EAAyB,KAAK,GAAG,EAAE,MAAM,aAAa,CAAC;AAI9D,eAAO,MAAM,aAAa,KAAK,CAAC;AAYhC,qEAAqE;AACrE,MAAM,WAAW,YAAY;IAC3B,GAAG,EAAE,MAAM,CAA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C9F,GAAG,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,CAAC;IACrC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,IAAI,CAAC,EAAE;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,EAAE,CAAA;KAAE,GAAG,IAAI,CAAC;CAC/C"}
|
package/dist/keys.js
ADDED
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
// Pure keyboard planning for humanized typing (lane D of SC 232): a faithful port of the Python SDK's
|
|
2
|
+
// clearcote/_keys.py, mirrored in .NET Keys.cs. Nothing here touches a page: given a persona seed and an
|
|
3
|
+
// RNG it decides how long a hand waits between two keys (a bigram flight model on the persona's WPM), how
|
|
4
|
+
// a chord splits into modifiers and key, how an OS auto-repeats a held key, and the pause before Enter or
|
|
5
|
+
// Tab after typing. sdk/testdata/humanize_typing_vectors.json pins the three SDKs to identical answers.
|
|
6
|
+
//
|
|
7
|
+
// The typing identity comes from a SALTED side stream of the persona seed (mulberry32(seed ^ salt)), like
|
|
8
|
+
// rolloverRate and shapeTraits, so makePersona's draw order -- every existing seed's motor identity -- is
|
|
9
|
+
// unchanged.
|
|
10
|
+
//
|
|
11
|
+
// Measured before this existed (SDK 0.51.0): Node's inter-key gap was uniform 45-150 ms with the 6 %
|
|
12
|
+
// thinking pause REPLACING the gap, while Python and .NET drew max(25, N(85, 45)) plus the pause -- one seed,
|
|
13
|
+
// two cadences; every bigram took the same time; a chord went down as one press (modifier and key within
|
|
14
|
+
// ~1 ms); Enter followed the last character after one key gap.
|
|
15
|
+
import { gaussFrom, mulberry32 } from "./motion.js";
|
|
16
|
+
const KEYS_SALT = 0xd3a2646c; // own stream (was 0x27d4eb2f = the aim salt: WPM moved with the aim spread)
|
|
17
|
+
const NOMINAL_DWELL_MS = 80;
|
|
18
|
+
export const MIN_FLIGHT_MS = 25;
|
|
19
|
+
// Calibration of the flight base (SC 232 triage, 10-16): the drawn WPM is the REALIZED speed on neutral English text --
|
|
20
|
+
// the class mix of consecutive key pairs on a 500-pair English sample (same finger 6 %, same hand 21 %, alternating 34 %,
|
|
21
|
+
// 39 % with a space or punctuation on one side; ~27 % of the same-finger / same-hand pairs are row jumps, x1.15), the
|
|
22
|
+
// flight noise's mean exp(0.35^2 / 2) and ~48 ms of pauses per character. Same constants as _keys.py / Keys.cs.
|
|
23
|
+
const EN_SAME_FINGER = 0.06, EN_SAME_HAND = 0.21, EN_ALTERNATE = 0.34, EN_NONE = 0.39;
|
|
24
|
+
const EN_ROW_JUMP = 1.04;
|
|
25
|
+
const EN_PAUSE_MS = 48.0;
|
|
26
|
+
const LOGNORMAL_MEAN = Math.exp(0.35 * 0.35 / 2);
|
|
27
|
+
const lerp = (a, b, t) => a + (b - a) * t;
|
|
28
|
+
/** The typing identity of persona seed `seedInt` (Persona.seed). Draw order as _keys.typing_traits. */
|
|
29
|
+
export function typingTraits(seedInt) {
|
|
30
|
+
const r = mulberry32((seedInt ^ KEYS_SALT) >>> 0);
|
|
31
|
+
const wpm = lerp(28, 75, r());
|
|
32
|
+
const sameFinger = lerp(1.5, 1.9, r());
|
|
33
|
+
const sameHand = lerp(1.1, 1.3, r());
|
|
34
|
+
const alternate = lerp(0.85, 1.0, r());
|
|
35
|
+
const tabPref = lerp(0.6, 0.85, r());
|
|
36
|
+
const typoRate = lerp(0.005, 0.04, r());
|
|
37
|
+
const submitCenterMs = lerp(400, 750, r());
|
|
38
|
+
const tabCenterMs = lerp(190, 330, r());
|
|
39
|
+
const selectStyle = r() < 0.55 ? "triple" : "keys";
|
|
40
|
+
const blurStyle = r() < 0.5 ? "tab" : "click";
|
|
41
|
+
const repeatFirstMs = lerp(252, 498, r()); // the two repeat draws came last (R1): every earlier trait is unchanged
|
|
42
|
+
const repeatGapMs = lerp(26, 39, r());
|
|
43
|
+
return { wpm, sameFinger, sameHand, alternate, tabPref, typoRate, submitCenterMs, tabCenterMs, selectStyle, blurStyle,
|
|
44
|
+
repeatFirstMs, repeatGapMs };
|
|
45
|
+
}
|
|
46
|
+
// US QWERTY touch-typing fingers: 0-3 left pinky..index, 4-7 right index..pinky; rows 0 (digits)..3.
|
|
47
|
+
const ROWS = ["`1234567890-=", "qwertyuiop[]\\", "asdfghjkl;'", "zxcvbnm,./"];
|
|
48
|
+
const FINGERS = [
|
|
49
|
+
[0, 0, 1, 2, 3, 3, 4, 4, 5, 6, 7, 7, 7],
|
|
50
|
+
[0, 1, 2, 3, 3, 4, 4, 5, 6, 7, 7, 7, 7],
|
|
51
|
+
[0, 1, 2, 3, 3, 4, 4, 5, 6, 7, 7],
|
|
52
|
+
[0, 1, 2, 3, 3, 4, 4, 5, 6, 7],
|
|
53
|
+
];
|
|
54
|
+
const SHIFTED = '~!@#$%^&*()_+{}|:"<>?';
|
|
55
|
+
const SHIFT_BASE = "`1234567890-=[]\\;',./";
|
|
56
|
+
const FINGER_MAP = new Map();
|
|
57
|
+
ROWS.forEach((keys, row) => Array.from(keys).forEach((k, i) => FINGER_MAP.set(k, [FINGERS[row][i], row])));
|
|
58
|
+
/** [finger 0..7, row 0..3] of the key that types `ch`, or null. Capitals / shifted symbols: their base key. */
|
|
59
|
+
export function fingerOf(ch) {
|
|
60
|
+
if (!ch || ch.length !== 1)
|
|
61
|
+
return null;
|
|
62
|
+
let c = ch.toLowerCase();
|
|
63
|
+
const j = SHIFTED.indexOf(c);
|
|
64
|
+
if (j >= 0)
|
|
65
|
+
c = SHIFT_BASE[j];
|
|
66
|
+
return FINGER_MAP.get(c) ?? null;
|
|
67
|
+
}
|
|
68
|
+
/** How the hand gets from `prev` to `ch`, and whether it is a two-row reach on the same hand. */
|
|
69
|
+
export function bigramClass(prev, ch) {
|
|
70
|
+
const a = fingerOf(prev), b = fingerOf(ch);
|
|
71
|
+
if (!a || !b)
|
|
72
|
+
return ["none", false];
|
|
73
|
+
if (a[0] === b[0])
|
|
74
|
+
return ["same_finger", Math.abs(a[1] - b[1]) >= 2];
|
|
75
|
+
if ((a[0] < 4) === (b[0] < 4))
|
|
76
|
+
return ["same_hand", Math.abs(a[1] - b[1]) >= 2];
|
|
77
|
+
return ["alternate", false];
|
|
78
|
+
}
|
|
79
|
+
const PUNCT = ".,;:!?";
|
|
80
|
+
const isWs = (c) => c === " " || c === "\t" || c === "\n";
|
|
81
|
+
/** How much this persona's finger factors and the flight noise stretch a neutral flight on English text (_keys.english_inflation). */
|
|
82
|
+
export function englishInflation(t) {
|
|
83
|
+
return (EN_SAME_FINGER * t.sameFinger * EN_ROW_JUMP + EN_SAME_HAND * t.sameHand * EN_ROW_JUMP
|
|
84
|
+
+ EN_ALTERNATE * t.alternate + EN_NONE) * LOGNORMAL_MEAN;
|
|
85
|
+
}
|
|
86
|
+
/** The neutral bigram's flight, calibrated so the mean keydown interval on English text is 60000 / (wpm x 5) (_keys.base_flight_ms). */
|
|
87
|
+
export function baseFlightMs(t) {
|
|
88
|
+
return Math.max(30, (60000 / (t.wpm * 5) - NOMINAL_DWELL_MS - EN_PAUSE_MS) / englishInflation(t));
|
|
89
|
+
}
|
|
90
|
+
/** Flight (ms) from key `prev` to key `ch`; draw order as _keys.flight_ms. */
|
|
91
|
+
export function flightMs(t, prev, ch, rng) {
|
|
92
|
+
const [cls, jump] = bigramClass(prev, ch);
|
|
93
|
+
let f = cls === "same_finger" ? t.sameFinger : cls === "same_hand" ? t.sameHand : cls === "alternate" ? t.alternate : 1;
|
|
94
|
+
if (jump)
|
|
95
|
+
f *= 1.15;
|
|
96
|
+
let ms = baseFlightMs(t) * f * Math.exp(0.35 * gaussFrom(rng));
|
|
97
|
+
if (prev != null && isWs(prev) && !isWs(ch))
|
|
98
|
+
ms += lerp(40, 120, rng());
|
|
99
|
+
if (prev != null && prev.length === 1 && PUNCT.includes(prev))
|
|
100
|
+
ms += lerp(80, 250, rng());
|
|
101
|
+
return Math.max(MIN_FLIGHT_MS, ms);
|
|
102
|
+
}
|
|
103
|
+
/** The whole sleep between key `prev` coming up and key `ch` going down (_keys.plan_gap). */
|
|
104
|
+
export function planGap(t, prev, ch, rng, tempo = 1, pauseScale = 1) {
|
|
105
|
+
let ms = flightMs(t, prev, ch, rng);
|
|
106
|
+
if (prev != null && isWs(prev))
|
|
107
|
+
ms += lerp(20, 100, rng());
|
|
108
|
+
if (rng() < 0.06 * pauseScale)
|
|
109
|
+
ms += lerp(180, 450, rng());
|
|
110
|
+
return ms * tempo; // tempo / pauseScale: lane A's presets (persona.tempo, persona.pauseScale); 1 = as planned
|
|
111
|
+
}
|
|
112
|
+
export const WORD_FIX_RATE = 0.3;
|
|
113
|
+
export const SEARCH_SLIP_RATE = 0.1;
|
|
114
|
+
/** Playwright's key string split into [modifiers, key] ("Shift++" -> [["Shift"], "+"]). */
|
|
115
|
+
export function splitChord(key) {
|
|
116
|
+
if (key === "+")
|
|
117
|
+
return [[], "+"];
|
|
118
|
+
if (key.endsWith("++"))
|
|
119
|
+
return [key.slice(0, -2).split("+"), "+"];
|
|
120
|
+
const parts = key.split("+");
|
|
121
|
+
return [parts.slice(0, -1), parts[parts.length - 1]];
|
|
122
|
+
}
|
|
123
|
+
export const modifierLeadMs = (rng) => lerp(40, 110, rng());
|
|
124
|
+
export const modifierLagMs = (rng) => lerp(20, 80, rng());
|
|
125
|
+
/** OS auto-repeat timing for one held key: the persona's repeat delay and interval (a machine setting,
|
|
126
|
+
* typingTraits) seen through +-2 / +-1 ms of timer jitter per run, and the hand's release. Draw order: first
|
|
127
|
+
* jitter, gap jitter, release (_keys.plan_repeat). */
|
|
128
|
+
export function planRepeat(t, rng) {
|
|
129
|
+
const firstMs = t.repeatFirstMs + lerp(-2, 2, rng());
|
|
130
|
+
const gapMs = t.repeatGapMs + lerp(-1, 1, rng());
|
|
131
|
+
const releaseMs = lerp(20, 60, rng());
|
|
132
|
+
return { firstMs, gapMs, releaseMs };
|
|
133
|
+
}
|
|
134
|
+
export const submitPauseMs = (t, rng) => Math.min(900, Math.max(250, t.submitCenterMs + (rng() - 0.5) * 300));
|
|
135
|
+
export const tabPauseMs = (t, rng) => Math.min(400, Math.max(120, t.tabCenterMs + (rng() - 0.5) * 140));
|
|
136
|
+
// ------------------------------------------------------------ isolated-world reads (same as _keys.py)
|
|
137
|
+
export const FOCUSABLE = "a[href], area[href], button, input, select, textarea, summary, iframe, [tabindex], "
|
|
138
|
+
+ "[contenteditable], audio[controls], video[controls]";
|
|
139
|
+
export const TAB_DISTANCE = `function (b) {
|
|
140
|
+
const up = n => n.parentElement || (n.parentNode && n.parentNode.nodeType === 11 && n.parentNode.host) || null;
|
|
141
|
+
const FOC = '${FOCUSABLE}';
|
|
142
|
+
const same = r => Math.abs(r.x - b.x) <= 1.5 && Math.abs(r.y - b.y) <= 1.5 &&
|
|
143
|
+
Math.abs(r.width - b.width) <= 1.5 && Math.abs(r.height - b.height) <= 1.5;
|
|
144
|
+
let t = null;
|
|
145
|
+
if (b.sel) { try { t = document.querySelector(b.sel); } catch (e) { t = null; } }
|
|
146
|
+
if (!t) {
|
|
147
|
+
for (let e = this.nodeType === 1 ? this : this.parentElement, n = 0; e && n < 64; e = up(e), n++)
|
|
148
|
+
if (e.matches && e.matches(FOC)) { t = e; break; }
|
|
149
|
+
}
|
|
150
|
+
if (!t || !t.matches(FOC) || !same(t.getBoundingClientRect())) return null;
|
|
151
|
+
const ti = e => { const v = parseInt(e.getAttribute('tabindex'), 10); return isNaN(v) ? 0 : v; };
|
|
152
|
+
const vis = e => { const s = getComputedStyle(e); return s.visibility !== 'hidden' && s.display !== 'none' && e.getClientRects().length > 0; };
|
|
153
|
+
const tabbable = e => !e.disabled && !(e.tagName === 'INPUT' && e.type === 'hidden') && ti(e) >= 0 &&
|
|
154
|
+
!(e.tagName === 'A' && !e.hasAttribute('href')) && vis(e);
|
|
155
|
+
const all = Array.from(document.querySelectorAll(FOC)).filter(tabbable);
|
|
156
|
+
const pos = all.filter(e => ti(e) > 0).sort((x, y) => ti(x) - ti(y));
|
|
157
|
+
const order = pos.concat(all.filter(e => ti(e) <= 0));
|
|
158
|
+
let a = document.activeElement;
|
|
159
|
+
while (a && a.shadowRoot && a.shadowRoot.activeElement) a = a.shadowRoot.activeElement;
|
|
160
|
+
const ai = a ? order.indexOf(a) : -1, tix = order.indexOf(t);
|
|
161
|
+
const VALUE_TYPES = ['checkbox', 'radio', 'button', 'submit', 'reset', 'file', 'image', 'range', 'color', 'hidden'];
|
|
162
|
+
const text = e => !!e && ((e.tagName === 'INPUT' && VALUE_TYPES.indexOf(e.type) < 0) || e.tagName === 'TEXTAREA' || !!e.isContentEditable);
|
|
163
|
+
const role = t.getAttribute('role') || '';
|
|
164
|
+
const act = ['BUTTON', 'A', 'SUMMARY', 'SELECT'].indexOf(t.tagName) >= 0 ||
|
|
165
|
+
(t.tagName === 'INPUT' && VALUE_TYPES.indexOf(t.type) >= 0) ||
|
|
166
|
+
['button', 'link', 'checkbox', 'radio', 'switch', 'tab', 'menuitem', 'option'].indexOf(role) >= 0;
|
|
167
|
+
let near = null;
|
|
168
|
+
if (tix >= 0) for (const off of [1, 2, 3, -1]) {
|
|
169
|
+
const c = order[tix - off];
|
|
170
|
+
if (!c || c === a || !text(c) || c.disabled) continue;
|
|
171
|
+
const q = c.getBoundingClientRect();
|
|
172
|
+
if (q.width >= 2 && q.height >= 2 && q.left >= 0 && q.top >= 0 && q.right <= innerWidth && q.bottom <= innerHeight) {
|
|
173
|
+
near = { off, rect: [q.x, q.y, q.width, q.height] }; break; }
|
|
174
|
+
}
|
|
175
|
+
return { dist: ai >= 0 && tix >= 0 ? tix - ai : null, fromText: text(a), focused: a === t,
|
|
176
|
+
activatable: act, text: text(t), tag: t.tagName.toLowerCase(), type: t.tagName === 'INPUT' ? t.type : '',
|
|
177
|
+
n: order.length, noAnchor: ai < 0, near }; }`;
|
|
178
|
+
export const BLANK_POINT = `(a) => { const b = a.box, FOC = '${FOCUSABLE}, label, [onclick], [role]';
|
|
179
|
+
const cands = [];
|
|
180
|
+
for (const dy of [28, 56, 96]) cands.push([b.x + b.width * 0.5, b.y + b.height + dy]);
|
|
181
|
+
for (const dx of [32, 72, 128]) cands.push([b.x + b.width + dx, b.y + b.height * 0.5]);
|
|
182
|
+
for (const dx of [32, 72]) cands.push([b.x - dx, b.y + b.height * 0.5]);
|
|
183
|
+
for (const dy of [40, 80]) cands.push([b.x + b.width * 0.5, b.y - dy]);
|
|
184
|
+
const PLAIN = ['HTML', 'BODY', 'DIV', 'SECTION', 'MAIN', 'FORM', 'ARTICLE', 'P', 'SPAN', 'FIELDSET', 'UL', 'LI', 'HEADER', 'FOOTER', 'NAV', 'ASIDE', 'TD', 'TR', 'TABLE'];
|
|
185
|
+
for (const [x, y] of cands) {
|
|
186
|
+
if (x < 4 || y < 4 || x > a.vw - 4 || y > a.vh - 4) continue;
|
|
187
|
+
const e = document.elementFromPoint(x, y);
|
|
188
|
+
if (!e) continue;
|
|
189
|
+
if (PLAIN.indexOf(e.tagName) < 0 || e.isContentEditable) continue;
|
|
190
|
+
if (e.closest(FOC)) continue;
|
|
191
|
+
return [x, y];
|
|
192
|
+
}
|
|
193
|
+
return null; }`;
|
|
194
|
+
export const SELECTION_STATE = `() => { let e = document.activeElement;
|
|
195
|
+
while (e && e.shadowRoot && e.shadowRoot.activeElement) e = e.shadowRoot.activeElement;
|
|
196
|
+
if (!e) return null;
|
|
197
|
+
if (typeof e.selectionStart === 'number' && typeof e.value === 'string')
|
|
198
|
+
return [e.selectionStart, e.selectionEnd, e.value.length];
|
|
199
|
+
if (e.isContentEditable) { const s = getSelection(); return [0, s ? s.toString().length : 0, (e.textContent || '').length]; }
|
|
200
|
+
return null; }`;
|
|
201
|
+
//# sourceMappingURL=keys.js.map
|
package/dist/keys.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"keys.js","sourceRoot":"","sources":["../src/keys.ts"],"names":[],"mappings":"AAAA,sGAAsG;AACtG,yGAAyG;AACzG,0GAA0G;AAC1G,0GAA0G;AAC1G,wGAAwG;AACxG,EAAE;AACF,0GAA0G;AAC1G,0GAA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