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