@qontinui/ui-bridge-native 0.6.3 → 0.6.4

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.
@@ -2192,6 +2192,15 @@ async function executeWorkflowStep(step, registry, executor) {
2192
2192
  };
2193
2193
  }
2194
2194
  }
2195
+ function getWindowDimensions() {
2196
+ try {
2197
+ const { Dimensions } = __require("react-native");
2198
+ const win = Dimensions.get("window");
2199
+ return { width: win.width, height: win.height };
2200
+ } catch {
2201
+ return { width: 0, height: 0 };
2202
+ }
2203
+ }
2195
2204
  function success2(data) {
2196
2205
  return {
2197
2206
  success: true,
@@ -2399,16 +2408,7 @@ function createServerHandlers(registry, executor, config) {
2399
2408
  },
2400
2409
  getPageHealth: async (ctx) => {
2401
2410
  const bodyViewport = ctx.body?.viewport;
2402
- let viewport = bodyViewport;
2403
- if (!viewport) {
2404
- try {
2405
- const { Dimensions } = __require("react-native");
2406
- const win = Dimensions.get("window");
2407
- viewport = { width: win.width, height: win.height };
2408
- } catch {
2409
- viewport = { width: 0, height: 0 };
2410
- }
2411
- }
2411
+ const viewport = bodyViewport ?? getWindowDimensions();
2412
2412
  const elements = registry.getAllElements().map((e) => ({
2413
2413
  type: e.type,
2414
2414
  state: e.getState()