@blario/react-native 0.1.0 → 0.1.2

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.
@@ -23,7 +23,7 @@ export interface WidgetShellOptions {
23
23
  identity: ShellIdentity | null;
24
24
  }
25
25
 
26
- const MESSAGE_CREATE_PATH = '/api/ai/contact-sessions/\\\\d+/widget/messages/create/';
26
+ const MESSAGE_CREATE_PATH = '/api/ai/contact-sessions/\\d+/widget/messages/create/';
27
27
 
28
28
  function safeJson(value: unknown): string {
29
29
  return JSON.stringify(value).replace(/</g, '\\u003c').replace(/\u2028/g, '\\u2028').replace(/\u2029/g, '\\u2029');
@@ -2,6 +2,14 @@ import { childrenOf, propsOf } from '../fiber/reader.ts';
2
2
  import type { Fiber } from '../fiber/types.ts';
3
3
  import { AGENT_OVERLAY_TEST_ID, isOpenModal } from './collect.ts';
4
4
 
5
+ const NATIVE_SCREEN = 'RNSScreen';
6
+
7
+ // A native-stack screen presented as a modal or sheet is a UIKit presentation too, which covers the agent layer.
8
+ function isPresentedScreen(fiber: Fiber): boolean {
9
+ const presentation = propsOf(fiber).stackPresentation;
10
+ return fiber.type === NATIVE_SCREEN && typeof presentation === 'string' && presentation !== 'push';
11
+ }
12
+
5
13
  export function countOpenModals(fiber: Fiber): number {
6
14
  const pending = [fiber];
7
15
  let count = 0;
@@ -10,7 +18,7 @@ export function countOpenModals(fiber: Fiber): number {
10
18
  if (current === undefined || propsOf(current).testID === AGENT_OVERLAY_TEST_ID) {
11
19
  continue;
12
20
  }
13
- if (isOpenModal(current)) {
21
+ if (isOpenModal(current) || isPresentedScreen(current)) {
14
22
  count += 1;
15
23
  }
16
24
  for (const child of childrenOf(current)) {
package/src/version.ts CHANGED
@@ -1 +1 @@
1
- export const SDK_VERSION = '0.1.0';
1
+ export const SDK_VERSION = '0.1.2';