@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.
package/dist/index.mjs CHANGED
@@ -2244,6 +2244,15 @@ async function executeWorkflowStep(step, registry, executor) {
2244
2244
  };
2245
2245
  }
2246
2246
  }
2247
+ function getWindowDimensions() {
2248
+ try {
2249
+ const { Dimensions: Dimensions2 } = __require("react-native");
2250
+ const win = Dimensions2.get("window");
2251
+ return { width: win.width, height: win.height };
2252
+ } catch {
2253
+ return { width: 0, height: 0 };
2254
+ }
2255
+ }
2247
2256
  function success2(data) {
2248
2257
  return {
2249
2258
  success: true,
@@ -2451,16 +2460,7 @@ function createServerHandlers(registry, executor, config) {
2451
2460
  },
2452
2461
  getPageHealth: async (ctx) => {
2453
2462
  const bodyViewport = ctx.body?.viewport;
2454
- let viewport = bodyViewport;
2455
- if (!viewport) {
2456
- try {
2457
- const { Dimensions: Dimensions2 } = __require("react-native");
2458
- const win = Dimensions2.get("window");
2459
- viewport = { width: win.width, height: win.height };
2460
- } catch {
2461
- viewport = { width: 0, height: 0 };
2462
- }
2463
- }
2463
+ const viewport = bodyViewport ?? getWindowDimensions();
2464
2464
  const elements = registry.getAllElements().map((e) => ({
2465
2465
  type: e.type,
2466
2466
  state: e.getState()