@qontinui/ui-bridge-native 0.6.4 → 0.6.5

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.
@@ -1092,15 +1092,6 @@ async function executeWorkflowStep(step, registry, executor) {
1092
1092
  };
1093
1093
  }
1094
1094
  }
1095
- function getWindowDimensions() {
1096
- try {
1097
- const { Dimensions } = __require("react-native");
1098
- const win = Dimensions.get("window");
1099
- return { width: win.width, height: win.height };
1100
- } catch {
1101
- return { width: 0, height: 0 };
1102
- }
1103
- }
1104
1095
  function success2(data) {
1105
1096
  return {
1106
1097
  success: true,
@@ -1308,7 +1299,7 @@ function createServerHandlers(registry, executor, config) {
1308
1299
  },
1309
1300
  getPageHealth: async (ctx) => {
1310
1301
  const bodyViewport = ctx.body?.viewport;
1311
- const viewport = bodyViewport ?? getWindowDimensions();
1302
+ const viewport = bodyViewport ?? config?.viewportProvider?.() ?? { width: 0, height: 0 };
1312
1303
  const elements = registry.getAllElements().map((e) => ({
1313
1304
  type: e.type,
1314
1305
  state: e.getState()
@@ -2279,7 +2270,8 @@ var NativeUIBridgeServer = class {
2279
2270
  this.handlers = createServerHandlers(registry, executor, {
2280
2271
  appInfo: this.config.appInfo,
2281
2272
  consoleErrorBuffer: this.consoleErrorBuffer,
2282
- networkRequestBuffer: this.networkRequestBuffer
2273
+ networkRequestBuffer: this.networkRequestBuffer,
2274
+ viewportProvider: this.config.viewportProvider
2283
2275
  });
2284
2276
  this.handlers.getMethods = async () => {
2285
2277
  const testHooks = this.config.testHooks === true;