@qontinui/ui-bridge-native 0.6.3 → 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.
@@ -1299,16 +1299,7 @@ function createServerHandlers(registry, executor, config) {
1299
1299
  },
1300
1300
  getPageHealth: async (ctx) => {
1301
1301
  const bodyViewport = ctx.body?.viewport;
1302
- let viewport = bodyViewport;
1303
- if (!viewport) {
1304
- try {
1305
- const { Dimensions } = __require("react-native");
1306
- const win = Dimensions.get("window");
1307
- viewport = { width: win.width, height: win.height };
1308
- } catch {
1309
- viewport = { width: 0, height: 0 };
1310
- }
1311
- }
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;