@enricai/barnacle 1.9.11 → 1.9.12
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/scraper/browser-click-expr.d.ts +44 -0
- package/dist/scraper/browser-click-expr.d.ts.map +1 -0
- package/dist/scraper/browser-click-expr.js +69 -0
- package/dist/scraper/browser-click-expr.js.map +1 -0
- package/dist/scraper/deep-locator-candidates.d.ts +43 -11
- package/dist/scraper/deep-locator-candidates.d.ts.map +1 -1
- package/dist/scraper/deep-locator-candidates.js +72 -19
- package/dist/scraper/deep-locator-candidates.js.map +1 -1
- package/dist/scraper/deep-locator-click.d.ts +40 -2
- package/dist/scraper/deep-locator-click.d.ts.map +1 -1
- package/dist/scraper/deep-locator-click.js +29 -3
- package/dist/scraper/deep-locator-click.js.map +1 -1
- package/dist/scraper/deep-locator-fake.d.ts.map +1 -1
- package/dist/scraper/deep-locator-fake.js +1 -0
- package/dist/scraper/deep-locator-fake.js.map +1 -1
- package/dist/scraper/deep-locator-scan.d.ts +9 -5
- package/dist/scraper/deep-locator-scan.d.ts.map +1 -1
- package/dist/scraper/deep-locator-scan.js +44 -14
- package/dist/scraper/deep-locator-scan.js.map +1 -1
- package/dist/scraper/deep-query.d.ts +5 -5
- package/dist/scraper/deep-query.d.ts.map +1 -1
- package/dist/scraper/deep-query.js +7 -9
- package/dist/scraper/deep-query.js.map +1 -1
- package/dist/scraper/flow-runner.d.ts.map +1 -1
- package/dist/scraper/flow-runner.js +36 -6
- package/dist/scraper/flow-runner.js.map +1 -1
- package/dist/scraper/submit-control.d.ts +5 -3
- package/dist/scraper/submit-control.d.ts.map +1 -1
- package/dist/scraper/submit-control.js +7 -7
- package/dist/scraper/submit-control.js.map +1 -1
- package/package.json +1 -1
|
@@ -39,9 +39,11 @@ export declare function buildRankSubmitCandidatesExpr(root?: string): string;
|
|
|
39
39
|
/**
|
|
40
40
|
* Builds a self-contained `page.evaluate` expression string that re-runs
|
|
41
41
|
* the same deterministic deep traversal as {@link buildRankSubmitCandidatesExpr}
|
|
42
|
-
* and clicks the element at `deepIndex`
|
|
43
|
-
*
|
|
44
|
-
*
|
|
42
|
+
* and clicks the element at `deepIndex` via the shared
|
|
43
|
+
* {@link clickActivationExpr} snippet (a real `PointerEvent`/`MouseEvent`
|
|
44
|
+
* sequence plus native `click()`, not a bare `new Event(...)` that a
|
|
45
|
+
* React/design-system handler ignores; see that module's docblock). Returns
|
|
46
|
+
* `{ clicked: false }` without throwing if the index is
|
|
45
47
|
* out of range for the current DOM (e.g. the page changed between the
|
|
46
48
|
* locate and click calls), and `{ clicked: false, reason: "not-actionable" }`
|
|
47
49
|
* without dispatching any event if the element at that index fails
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"submit-control.d.ts","sourceRoot":"","sources":["../../src/scraper/submit-control.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;
|
|
1
|
+
{"version":3,"file":"submit-control.d.ts","sourceRoot":"","sources":["../../src/scraper/submit-control.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AA6FH;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,wBAAgB,6BAA6B,CAAC,IAAI,SAAa,GAAG,MAAM,CAwBvE;AAED;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAgB,yBAAyB,CAAC,SAAS,EAAE,MAAM,EAAE,IAAI,SAAa,GAAG,MAAM,CAWtF;AAED,2HAA2H;AAC3H,MAAM,MAAM,mBAAmB,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;AAE5C,qGAAqG;AACrG,MAAM,WAAW,eAAe;IAC9B,mIAAmI;IACnI,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,mBAAmB,CAAC;IAC1B,GAAG,EAAE,MAAM,CAAC;IACZ,cAAc,EAAE,MAAM,CAAC;CACxB;AAED,0EAA0E;AAC1E,MAAM,WAAW,sBAAsB;IACrC,OAAO,EAAE,OAAO,CAAC;IACjB,oKAAoK;IACpK,MAAM,CAAC,EAAE,gBAAgB,CAAC;CAC3B"}
|
|
@@ -12,6 +12,7 @@
|
|
|
12
12
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
13
|
exports.buildRankSubmitCandidatesExpr = buildRankSubmitCandidatesExpr;
|
|
14
14
|
exports.buildClickByDeepIndexExpr = buildClickByDeepIndexExpr;
|
|
15
|
+
const browser_click_expr_1 = require("../scraper/browser-click-expr");
|
|
15
16
|
/**
|
|
16
17
|
* Verbs that identify a control as NOT the submit action even when it is
|
|
17
18
|
* button-shaped and reachable. Checked before any positive tier so a
|
|
@@ -151,9 +152,11 @@ function buildRankSubmitCandidatesExpr(root = "document") {
|
|
|
151
152
|
/**
|
|
152
153
|
* Builds a self-contained `page.evaluate` expression string that re-runs
|
|
153
154
|
* the same deterministic deep traversal as {@link buildRankSubmitCandidatesExpr}
|
|
154
|
-
* and clicks the element at `deepIndex`
|
|
155
|
-
*
|
|
156
|
-
*
|
|
155
|
+
* and clicks the element at `deepIndex` via the shared
|
|
156
|
+
* {@link clickActivationExpr} snippet (a real `PointerEvent`/`MouseEvent`
|
|
157
|
+
* sequence plus native `click()`, not a bare `new Event(...)` that a
|
|
158
|
+
* React/design-system handler ignores; see that module's docblock). Returns
|
|
159
|
+
* `{ clicked: false }` without throwing if the index is
|
|
157
160
|
* out of range for the current DOM (e.g. the page changed between the
|
|
158
161
|
* locate and click calls), and `{ clicked: false, reason: "not-actionable" }`
|
|
159
162
|
* without dispatching any event if the element at that index fails
|
|
@@ -176,10 +179,7 @@ function buildClickByDeepIndexExpr(deepIndex, root = "document") {
|
|
|
176
179
|
const el = all[${JSON.stringify(deepIndex)}];
|
|
177
180
|
if (!el) return { clicked: false };
|
|
178
181
|
if (!isVisible(el)) return { clicked: false, reason: "not-actionable" };
|
|
179
|
-
|
|
180
|
-
el.dispatchEvent(new Event("mousedown", { bubbles: true }));
|
|
181
|
-
el.dispatchEvent(new Event("mouseup", { bubbles: true }));
|
|
182
|
-
el.dispatchEvent(new Event("click", { bubbles: true }));
|
|
182
|
+
${(0, browser_click_expr_1.clickActivationExpr)("el")}
|
|
183
183
|
return { clicked: true };
|
|
184
184
|
})()`;
|
|
185
185
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"submit-control.js","sourceRoot":"","sources":["../../src/scraper/submit-control.ts"],"names":[],"mappings":";AAAA;;;;;;;;;GASG;;;;AAEH;;;;;;GAMG;AACH,MAAM,kBAAkB,GAAG;;;GAGxB,CAAC;AAEJ;;;;;GAKG;AACH,MAAM,oBAAoB,GAAG;;;GAG1B,CAAC;AAEJ;;;;;;;;;;GAUG;AACH,MAAM,eAAe,GAAG;;;;;GAKrB,CAAC;AAEJ;;;;;GAKG;AACH,MAAM,kBAAkB,GAAG;;;;;;;;;;;GAWxB,CAAC;AAEJ;;;;;;;;;;;;;;GAcG;AACH,MAAM,eAAe,GAAG;uBACD,kBAAkB;;;;;;;;;;;GAWtC,CAAC;AAEJ;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,uCAA8C,IAAI,GAAG,UAAU;IAC7D,OAAO;6BACoB,oBAAoB;uBAC1B,eAAe;wBACd,eAAe;2BACZ,kBAAkB;+BACd,IAAI;;;;;;;;;;;;;;;;;OAiB5B,CAAC;AACR,CAAC;AAED
|
|
1
|
+
{"version":3,"file":"submit-control.js","sourceRoot":"","sources":["../../src/scraper/submit-control.ts"],"names":[],"mappings":";AAAA;;;;;;;;;GASG;;;;AAEH,qEAAmE;AAEnE;;;;;;GAMG;AACH,MAAM,kBAAkB,GAAG;;;GAGxB,CAAC;AAEJ;;;;;GAKG;AACH,MAAM,oBAAoB,GAAG;;;GAG1B,CAAC;AAEJ;;;;;;;;;;GAUG;AACH,MAAM,eAAe,GAAG;;;;;GAKrB,CAAC;AAEJ;;;;;GAKG;AACH,MAAM,kBAAkB,GAAG;;;;;;;;;;;GAWxB,CAAC;AAEJ;;;;;;;;;;;;;;GAcG;AACH,MAAM,eAAe,GAAG;uBACD,kBAAkB;;;;;;;;;;;GAWtC,CAAC;AAEJ;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,uCAA8C,IAAI,GAAG,UAAU;IAC7D,OAAO;6BACoB,oBAAoB;uBAC1B,eAAe;wBACd,eAAe;2BACZ,kBAAkB;+BACd,IAAI;;;;;;;;;;;;;;;;;OAiB5B,CAAC;AACR,CAAC;AAED;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,mCAA0C,SAAiB,EAAE,IAAI,GAAG,UAAU;IAC5E,OAAO;wBACe,eAAe;2BACZ,kBAAkB;+BACd,IAAI;qBACd,IAAI,CAAC,SAAS,CAAC,SAAS,CAAC;;;MAGxC,IAAA,wCAAmB,EAAC,IAAI,CAAC;;OAExB,CAAC;AACR,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@enricai/barnacle",
|
|
3
|
-
"version": "1.9.
|
|
3
|
+
"version": "1.9.12",
|
|
4
4
|
"description": "Site-agnostic browser automation engine. POST a structured payload to a typed endpoint; Barnacle drives a Steel + Stagehand session through the target site and returns a structured result.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Enricai",
|