@qontinui/ui-bridge-native 0.7.0 → 0.7.1
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/index.js +37 -22
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +37 -22
- package/dist/index.mjs.map +1 -1
- package/dist/react/index.js +37 -22
- package/dist/react/index.js.map +1 -1
- package/dist/react/index.mjs +37 -22
- package/dist/react/index.mjs.map +1 -1
- package/dist/server/index.js +37 -22
- package/dist/server/index.js.map +1 -1
- package/dist/server/index.mjs +37 -22
- package/dist/server/index.mjs.map +1 -1
- package/dist/server/page-health.d.ts +10 -1
- package/dist/server/page-health.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -3442,7 +3442,7 @@ var NATIVE_PAGE_HEALTH_PRODUCER_ID = "sdk-native/page-health";
|
|
|
3442
3442
|
function defaultProducer() {
|
|
3443
3443
|
return {
|
|
3444
3444
|
id: NATIVE_PAGE_HEALTH_PRODUCER_ID,
|
|
3445
|
-
version: "0.7.
|
|
3445
|
+
version: "0.7.1"
|
|
3446
3446
|
};
|
|
3447
3447
|
}
|
|
3448
3448
|
function pageHealthUnknown(code, detail, options = {}) {
|
|
@@ -3484,14 +3484,7 @@ var LOADING_PHRASES = [
|
|
|
3484
3484
|
"initializing",
|
|
3485
3485
|
"fetching"
|
|
3486
3486
|
];
|
|
3487
|
-
var EMPTY_PHRASES = [
|
|
3488
|
-
"no data",
|
|
3489
|
-
"no results",
|
|
3490
|
-
"nothing here",
|
|
3491
|
-
"empty",
|
|
3492
|
-
"no items",
|
|
3493
|
-
"get started"
|
|
3494
|
-
];
|
|
3487
|
+
var EMPTY_PHRASES = ["no data", "no results", "nothing here", "empty", "no items", "get started"];
|
|
3495
3488
|
function severityRank(s) {
|
|
3496
3489
|
if (s === "CRITICAL") return 3;
|
|
3497
3490
|
if (s === "WARNING") return 2;
|
|
@@ -3566,20 +3559,44 @@ function observe(input, producer, evaluatedAt) {
|
|
|
3566
3559
|
}
|
|
3567
3560
|
return analyze(elements, viewport, base);
|
|
3568
3561
|
}
|
|
3562
|
+
function nothingOnScreenDetail(elements, visibleCount, visibilityUnstated) {
|
|
3563
|
+
if (visibilityUnstated === 0 && visibleCount > 0) {
|
|
3564
|
+
return `all ${visibleCount} visible element(s) have no measured layout yet, so spatial coverage, layout regions and visual anomalies cannot be measured`;
|
|
3565
|
+
}
|
|
3566
|
+
if (visibilityUnstated > 0) {
|
|
3567
|
+
const geometry = visibleCount > 0 ? ` and none of the ${visibleCount} visible one(s) has a measured layout` : "";
|
|
3568
|
+
return `${visibilityUnstated} of ${elements.length} element(s) carry no boolean \`state.visible\`${geometry}, so no element can be placed on screen; spatial coverage, layout regions and visual anomalies cannot be measured`;
|
|
3569
|
+
}
|
|
3570
|
+
const unmounted = elements.filter((el) => el.state?.mounted === false).length;
|
|
3571
|
+
return `all ${elements.length} registered element(s) report visible: false (unmounted=${unmounted}, off-screen route or otherwise=${elements.length - unmounted}), so whatever is on screen is not a registered element and there is nothing on screen to measure; this says nothing about whether the screen is blank`;
|
|
3572
|
+
}
|
|
3569
3573
|
function analyze(elements, viewport, base) {
|
|
3570
3574
|
const findings = [];
|
|
3571
|
-
const
|
|
3572
|
-
const
|
|
3575
|
+
const onScreen = elements.filter((el) => el.state?.visible === true);
|
|
3576
|
+
const visibilityUnstated = elements.filter(
|
|
3577
|
+
(el) => typeof el.state?.visible !== "boolean"
|
|
3578
|
+
).length;
|
|
3579
|
+
const visible = onScreen.flatMap((el) => {
|
|
3573
3580
|
const rect = normalizeRect(el.state, viewport);
|
|
3574
3581
|
return rect ? [{ el, rect }] : [];
|
|
3575
3582
|
});
|
|
3576
|
-
const withoutGeometry =
|
|
3577
|
-
const unmeasured =
|
|
3578
|
-
|
|
3579
|
-
|
|
3583
|
+
const withoutGeometry = onScreen.length - visible.length;
|
|
3584
|
+
const unmeasured = [];
|
|
3585
|
+
if (withoutGeometry > 0) {
|
|
3586
|
+
unmeasured.push({ dimension: "geometry", count: withoutGeometry, code: "input_missing" });
|
|
3587
|
+
}
|
|
3588
|
+
if (visibilityUnstated > 0) {
|
|
3589
|
+
unmeasured.push({ dimension: "visibility", count: visibilityUnstated, code: "input_missing" });
|
|
3590
|
+
}
|
|
3591
|
+
const coverage = {
|
|
3592
|
+
considered: onScreen.length + visibilityUnstated,
|
|
3593
|
+
measured: visible.length,
|
|
3594
|
+
unmeasured
|
|
3595
|
+
};
|
|
3596
|
+
if (elements.length > 0 && visible.length === 0) {
|
|
3580
3597
|
return Observation.unknown(
|
|
3581
3598
|
"input_missing",
|
|
3582
|
-
|
|
3599
|
+
nothingOnScreenDetail(elements, onScreen.length, visibilityUnstated),
|
|
3583
3600
|
Observation.provenance({ ...base, coverage })
|
|
3584
3601
|
);
|
|
3585
3602
|
}
|
|
@@ -3669,7 +3686,7 @@ function analyze(elements, viewport, base) {
|
|
|
3669
3686
|
for (const el of elements) {
|
|
3670
3687
|
const elType = el.type ?? "";
|
|
3671
3688
|
if (SKIP_TEXT_TYPES.has(elType)) continue;
|
|
3672
|
-
const text = (el.state
|
|
3689
|
+
const text = (el.state?.textContent ?? "").toString();
|
|
3673
3690
|
if (!text) continue;
|
|
3674
3691
|
const textLower = text.toLowerCase();
|
|
3675
3692
|
for (const p of ERROR_PHRASES) {
|
|
@@ -3710,7 +3727,7 @@ function analyze(elements, viewport, base) {
|
|
|
3710
3727
|
for (const el of elements) {
|
|
3711
3728
|
if (!INTERACTIVE_TYPES2.has(el.type)) continue;
|
|
3712
3729
|
interactiveTotal++;
|
|
3713
|
-
if (el.state
|
|
3730
|
+
if (el.state?.enabled === false) interactiveDisabled++;
|
|
3714
3731
|
}
|
|
3715
3732
|
const interactiveSeverity = interactiveTotal > 0 && interactiveDisabled / interactiveTotal > 0.5 ? "WARNING" : "OK";
|
|
3716
3733
|
findings.push({
|
|
@@ -3734,9 +3751,7 @@ function analyze(elements, viewport, base) {
|
|
|
3734
3751
|
detail: `zero_size=${zeroSize}, outside_viewport=${outsideViewport} (horizontal-overflow only; below/above-fold scrollable content is not an anomaly)`,
|
|
3735
3752
|
data: { zero_size: zeroSize, outside_viewport: outsideViewport }
|
|
3736
3753
|
});
|
|
3737
|
-
const heatmap = grid.map(
|
|
3738
|
-
(row) => row.map((cell) => cell ? "#" : ".").join("")
|
|
3739
|
-
);
|
|
3754
|
+
const heatmap = grid.map((row) => row.map((cell) => cell ? "#" : ".").join(""));
|
|
3740
3755
|
return Observation.measured(
|
|
3741
3756
|
{
|
|
3742
3757
|
summary: worstSeverity(findings),
|
|
@@ -4722,7 +4737,7 @@ function createServerHandlers(registry, executor, config) {
|
|
|
4722
4737
|
};
|
|
4723
4738
|
if (config?.appInfo) {
|
|
4724
4739
|
response.uiBridge = {
|
|
4725
|
-
version: "0.7.
|
|
4740
|
+
version: "0.7.1",
|
|
4726
4741
|
...config.appInfo,
|
|
4727
4742
|
capabilities: ["elements", "components", "actions", "design"],
|
|
4728
4743
|
elementCount: stats.elements,
|