@swmansion/argent 0.15.1-next.11 → 0.15.1-next.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/tool-server.cjs +9 -4
- package/package.json +1 -1
package/dist/tool-server.cjs
CHANGED
|
@@ -133273,8 +133273,13 @@ async function describeVega(_serial) {
|
|
|
133273
133273
|
|
|
133274
133274
|
// ../tool-server/src/utils/ui-tree-match.ts
|
|
133275
133275
|
init_zod();
|
|
133276
|
+
function hasVisibleText(text) {
|
|
133277
|
+
return text.replace(/[\p{Cf}\p{Co}\p{Cc}]/gu, "").trim().length > 0;
|
|
133278
|
+
}
|
|
133276
133279
|
var selectorFieldsSchema = external_exports.object({
|
|
133277
|
-
text: external_exports.string().min(1).
|
|
133280
|
+
text: external_exports.string().min(1).refine(hasVisibleText, {
|
|
133281
|
+
message: "text must contain at least one visible character (icon-font/private-use and zero-width characters render as nothing) \u2014 select by identifier or role instead"
|
|
133282
|
+
}).optional().describe("Case-insensitive substring of the element's visible label or value."),
|
|
133278
133283
|
identifier: external_exports.string().min(1).optional().describe(
|
|
133279
133284
|
"The element's identifier (accessibilityIdentifier / resource-id / testid), matched case-insensitively as the exact identifier or the unqualified resource-id name ('submit' matches 'com.example.app:id/submit')."
|
|
133280
133285
|
),
|
|
@@ -133462,7 +133467,7 @@ var GENERIC_ROLES = /* @__PURE__ */ new Set([
|
|
|
133462
133467
|
]);
|
|
133463
133468
|
function deriveSelector(node) {
|
|
133464
133469
|
if (node.identifier && node.identifier.trim()) return { identifier: node.identifier };
|
|
133465
|
-
const text = [node.label, node.value].map((t) => t?.trim()).find(
|
|
133470
|
+
const text = [node.label, node.value].map((t) => t?.trim()).find((t) => t && hasVisibleText(t));
|
|
133466
133471
|
if (text) return { text };
|
|
133467
133472
|
if (node.role && !GENERIC_ROLES.has(node.role.toLowerCase())) return { role: node.role };
|
|
133468
133473
|
return null;
|
|
@@ -144664,9 +144669,9 @@ function selectorToYaml(sel) {
|
|
|
144664
144669
|
'Cannot serialize flow selector without losing constraints: both `text` and `textMatches` are set, but flow YAML can represent only one `text` constraint (a literal string or `{ matches: "<regex>" }`). Use either literal or regex text matching.'
|
|
144665
144670
|
);
|
|
144666
144671
|
}
|
|
144667
|
-
if (sel.
|
|
144672
|
+
if (sel.text !== void 0 && (typeof sel.text !== "string" || !hasVisibleText(sel.text))) {
|
|
144668
144673
|
throw new Error(
|
|
144669
|
-
"Cannot serialize
|
|
144674
|
+
"Cannot serialize flow selector: `text` must contain at least one visible character (icon-font/private-use and zero-width characters render as nothing). Select by identifier or role, or use a coordinate tap."
|
|
144670
144675
|
);
|
|
144671
144676
|
}
|
|
144672
144677
|
if (sel.loose && (sel.text === void 0 || sel.textMatches !== void 0 || sel.identifier !== void 0 || sel.role !== void 0)) {
|