@appilots/sdk 0.11.0 → 0.11.3

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.js CHANGED
@@ -1,8 +1,8 @@
1
1
  'use strict';
2
2
 
3
- var chunkIZEWWAA7_js = require('./chunk-IZEWWAA7.js');
4
- var chunk2YPEQTL2_js = require('./chunk-2YPEQTL2.js');
5
- var chunk55Y2AQE7_js = require('./chunk-55Y2AQE7.js');
3
+ var chunk5UVMNKPT_js = require('./chunk-5UVMNKPT.js');
4
+ var chunkUFMTRGML_js = require('./chunk-UFMTRGML.js');
5
+ var chunkSUMIABJK_js = require('./chunk-SUMIABJK.js');
6
6
  var React7 = require('react');
7
7
  var reactNative = require('react-native');
8
8
  var reactNativeSafeAreaContext = require('react-native-safe-area-context');
@@ -47,14 +47,14 @@ function useSafeAreaInsetsOrDefault() {
47
47
 
48
48
  // src/components/breadcrumbPresentation.ts
49
49
  var DEFAULT_BREADCRUMB_PALETTE = {
50
- primary: chunk55Y2AQE7_js.defaultLightTheme.colors.primary,
51
- text: chunk55Y2AQE7_js.defaultLightTheme.colors.text,
52
- textSecondary: chunk55Y2AQE7_js.defaultLightTheme.colors.textSecondary,
53
- surface: chunk55Y2AQE7_js.defaultLightTheme.colors.surface,
54
- border: chunk55Y2AQE7_js.defaultLightTheme.colors.border,
55
- success: chunk55Y2AQE7_js.defaultLightTheme.colors.success,
56
- warning: chunk55Y2AQE7_js.defaultLightTheme.colors.warning,
57
- error: chunk55Y2AQE7_js.defaultLightTheme.colors.error
50
+ primary: chunkSUMIABJK_js.defaultLightTheme.colors.primary,
51
+ text: chunkSUMIABJK_js.defaultLightTheme.colors.text,
52
+ textSecondary: chunkSUMIABJK_js.defaultLightTheme.colors.textSecondary,
53
+ surface: chunkSUMIABJK_js.defaultLightTheme.colors.surface,
54
+ border: chunkSUMIABJK_js.defaultLightTheme.colors.border,
55
+ success: chunkSUMIABJK_js.defaultLightTheme.colors.success,
56
+ warning: chunkSUMIABJK_js.defaultLightTheme.colors.warning,
57
+ error: chunkSUMIABJK_js.defaultLightTheme.colors.error
58
58
  };
59
59
  var KNOWN_TINTS = {
60
60
  [DEFAULT_BREADCRUMB_PALETTE.primary.toUpperCase()]: "#EEF2FF",
@@ -190,7 +190,7 @@ function RegularBreadcrumbRow({
190
190
  onApprove,
191
191
  onReject
192
192
  }) {
193
- const { label, state } = chunk55Y2AQE7_js.describeAction(action);
193
+ const { label, state } = chunkSUMIABJK_js.describeAction(action);
194
194
  const tone = deriveStateTone(palette)[state];
195
195
  const fade = React7.useRef(new reactNative.Animated.Value(0)).current;
196
196
  const pulse = React7.useRef(new reactNative.Animated.Value(1)).current;
@@ -234,7 +234,8 @@ function RegularBreadcrumbRow({
234
234
  onPress: () => onReject(action.id),
235
235
  style: [styles.btn, { backgroundColor: deriveStateTone(palette).failed.iconBg }],
236
236
  activeOpacity: 0.7,
237
- accessibilityLabel: "Rejeitar a\xE7\xE3o"
237
+ accessibilityLabel: "Rejeitar a\xE7\xE3o",
238
+ testID: "assistant-action-reject"
238
239
  },
239
240
  /* @__PURE__ */ React7__namespace.default.createElement(reactNative.Text, { style: [styles.rejectBtnText, { color: palette.error }] }, "Rejeitar")
240
241
  ), /* @__PURE__ */ React7__namespace.default.createElement(
@@ -243,7 +244,8 @@ function RegularBreadcrumbRow({
243
244
  onPress: () => onApprove(action.id),
244
245
  style: [styles.btn, styles.approveBtn, { backgroundColor: primaryColor }],
245
246
  activeOpacity: 0.7,
246
- accessibilityLabel: "Aprovar a\xE7\xE3o"
247
+ accessibilityLabel: "Aprovar a\xE7\xE3o",
248
+ testID: "assistant-action-approve"
247
249
  },
248
250
  /* @__PURE__ */ React7__namespace.default.createElement(reactNative.Text, { style: styles.approveBtnText }, "Aprovar")
249
251
  )));
@@ -296,7 +298,7 @@ function ConfirmCard({
296
298
  onPress: () => onReject?.(action.id),
297
299
  style: [confirmCardStyles.btn, { backgroundColor: cancelBackground }],
298
300
  activeOpacity: 0.7,
299
- accessibilityLabel: "Cancelar",
301
+ accessibilityLabel: cancelLabel,
300
302
  testID: "assistant-confirm-reject"
301
303
  },
302
304
  /* @__PURE__ */ React7__namespace.default.createElement(reactNative.Text, { style: [confirmCardStyles.cancelText, { color: cancelTextColor, fontFamily }] }, cancelLabel)
@@ -310,7 +312,7 @@ function ConfirmCard({
310
312
  { backgroundColor: actionColor }
311
313
  ],
312
314
  activeOpacity: 0.7,
313
- accessibilityLabel: "Confirmar",
315
+ accessibilityLabel: confirmLabel,
314
316
  testID: "assistant-confirm-approve"
315
317
  },
316
318
  /* @__PURE__ */ React7__namespace.default.createElement(reactNative.Text, { style: [confirmCardStyles.confirmText, { fontFamily }] }, confirmLabel)
@@ -898,7 +900,7 @@ var styles2 = reactNative.StyleSheet.create({
898
900
  textDecorationLine: "underline"
899
901
  }
900
902
  });
901
- var ThemeContext = React7.createContext(chunk55Y2AQE7_js.defaultLightTheme);
903
+ var ThemeContext = React7.createContext(chunkSUMIABJK_js.defaultLightTheme);
902
904
  function AppilotsThemeProvider({
903
905
  theme,
904
906
  mode = "auto",
@@ -906,7 +908,7 @@ function AppilotsThemeProvider({
906
908
  }) {
907
909
  const systemScheme = reactNative.useColorScheme();
908
910
  const tokens = React7.useMemo(
909
- () => chunk55Y2AQE7_js.mergeThemeTokens(chunk55Y2AQE7_js.resolveBaseTheme(mode, systemScheme), theme ?? void 0),
911
+ () => chunkSUMIABJK_js.mergeThemeTokens(chunkSUMIABJK_js.resolveBaseTheme(mode, systemScheme), theme ?? void 0),
910
912
  [mode, systemScheme, theme]
911
913
  );
912
914
  return /* @__PURE__ */ React7__namespace.default.createElement(ThemeContext.Provider, { value: tokens }, children);
@@ -1208,12 +1210,12 @@ var APPILOTS_SKIP_PROPS = {
1208
1210
  __appilotsInternal: true
1209
1211
  };
1210
1212
  function AppilotsChat(props) {
1211
- const { degraded } = chunk55Y2AQE7_js.useAppilotsContext();
1213
+ const { degraded } = chunkSUMIABJK_js.useAppilotsContext();
1212
1214
  if (degraded) return null;
1213
- return /* @__PURE__ */ React7__namespace.default.createElement(chunk55Y2AQE7_js.AppilotsErrorBoundary, { surface: "chat", fallback: null }, /* @__PURE__ */ React7__namespace.default.createElement(AppilotsChatSurface, { ...props }));
1215
+ return /* @__PURE__ */ React7__namespace.default.createElement(chunkSUMIABJK_js.AppilotsErrorBoundary, { surface: "chat", fallback: null }, /* @__PURE__ */ React7__namespace.default.createElement(AppilotsChatSurface, { ...props }));
1214
1216
  }
1215
1217
  function AppilotsChatSurface(props) {
1216
- const { remotePersonalization } = chunk55Y2AQE7_js.useAppilotsContext();
1218
+ const { remotePersonalization } = chunkSUMIABJK_js.useAppilotsContext();
1217
1219
  const themeProp = React7.useMemo(() => {
1218
1220
  if (!props.theme) return void 0;
1219
1221
  return isLegacyTheme(props.theme) ? translateLegacyTheme(props.theme) : props.theme;
@@ -1256,7 +1258,7 @@ function AppilotsChatInner({
1256
1258
  clearMessages,
1257
1259
  escalation,
1258
1260
  requestHuman
1259
- } = chunk2YPEQTL2_js.useAppilotsChat({
1261
+ } = chunkUFMTRGML_js.useAppilotsChat({
1260
1262
  errorPrefix: t("somethingWentWrong"),
1261
1263
  escalationStrings: {
1262
1264
  requested: t("escalationRequested"),
@@ -1265,8 +1267,8 @@ function AppilotsChatInner({
1265
1267
  offer: t("escalationOffer")
1266
1268
  }
1267
1269
  });
1268
- const { pendingActions, executingActions, completedActions, approveAction, rejectAction } = chunk2YPEQTL2_js.useAppilotsActions({ autoExecute });
1269
- const { emit, remotePersonalization } = chunk55Y2AQE7_js.useAppilotsContext();
1270
+ const { pendingActions, executingActions, completedActions, approveAction, rejectAction } = chunkUFMTRGML_js.useAppilotsActions({ autoExecute });
1271
+ const { emit, remotePersonalization } = chunkSUMIABJK_js.useAppilotsContext();
1270
1272
  const {
1271
1273
  headerTitle: resolvedTitle,
1272
1274
  assistantAvatar,
@@ -1302,12 +1304,12 @@ function AppilotsChatInner({
1302
1304
  const flatListRef = React7.useRef(null);
1303
1305
  const slideAnim = React7.useRef(new reactNative.Animated.Value(SCREEN_HEIGHT)).current;
1304
1306
  const isVisible = mode === "inline" ? true : controlledVisible !== void 0 ? controlledVisible : internalVisible;
1305
- const showSuggestedPrompts = chunk2YPEQTL2_js.shouldShowSuggestedPrompts({
1307
+ const showSuggestedPrompts = chunkUFMTRGML_js.shouldShowSuggestedPrompts({
1306
1308
  isVisible,
1307
1309
  messageCount: messages.length,
1308
1310
  inputText
1309
1311
  });
1310
- const { prompts: suggestedPrompts } = chunk2YPEQTL2_js.useSuggestedPrompts({
1312
+ const { prompts: suggestedPrompts } = chunkUFMTRGML_js.useSuggestedPrompts({
1311
1313
  enabled: showSuggestedPrompts,
1312
1314
  limit: 3
1313
1315
  });
@@ -1600,7 +1602,9 @@ function AppilotsChatInner({
1600
1602
  {
1601
1603
  ...APPILOTS_SKIP_PROPS,
1602
1604
  onPress: clearMessages,
1603
- style: styles3.headerButton
1605
+ style: styles3.headerButton,
1606
+ accessibilityRole: "button",
1607
+ testID: "assistant-clear"
1604
1608
  },
1605
1609
  /* @__PURE__ */ React7__namespace.default.createElement(reactNative.Text, { style: [styles3.headerButtonText, { color: theme.colors.textSecondary }] }, strings.clearButton)
1606
1610
  ), mode !== "inline" && /* @__PURE__ */ React7__namespace.default.createElement(
@@ -1609,7 +1613,9 @@ function AppilotsChatInner({
1609
1613
  ...APPILOTS_SKIP_PROPS,
1610
1614
  onPress: closeChat,
1611
1615
  style: styles3.closeButton,
1612
- accessibilityLabel: strings.closeChatA11y
1616
+ accessibilityRole: "button",
1617
+ accessibilityLabel: strings.closeChatA11y,
1618
+ testID: "assistant-close"
1613
1619
  },
1614
1620
  /* @__PURE__ */ React7__namespace.default.createElement(reactNative.Text, { style: [styles3.closeButtonText, { color: theme.colors.text }] }, "\u2715")
1615
1621
  ))),
@@ -1693,7 +1699,7 @@ function AppilotsChatInner({
1693
1699
  numberOfLines: 2
1694
1700
  },
1695
1701
  resolvedEmptySubtitle
1696
- ), showSuggestedPrompts && suggestedPrompts.length > 0 && /* @__PURE__ */ React7__namespace.default.createElement(reactNative.View, { style: styles3.chipsContainer }, suggestedPrompts.map((prompt) => /* @__PURE__ */ React7__namespace.default.createElement(
1702
+ ), showSuggestedPrompts && suggestedPrompts.length > 0 && /* @__PURE__ */ React7__namespace.default.createElement(reactNative.View, { style: styles3.chipsContainer, testID: "assistant-suggested-prompts" }, suggestedPrompts.map((prompt) => /* @__PURE__ */ React7__namespace.default.createElement(
1697
1703
  reactNative.TouchableOpacity,
1698
1704
  {
1699
1705
  key: `${prompt.source}:${prompt.text}`,
@@ -1895,6 +1901,13 @@ function AppilotsChatInner({
1895
1901
  style: [
1896
1902
  mode === "fullscreen" ? styles3.modalContainerFullscreen : styles3.modalContainer,
1897
1903
  mode === "sidebar" && styles3.modalContainerSidebar,
1904
+ // Keeps the sheet out of the status bar / notch. It is padding
1905
+ // and not a margin so the scrim still covers the full screen.
1906
+ // Only reachable now that the sheet can grow to the top edge:
1907
+ // `fullscreen` and `sidebar` always could, and `bubble` does
1908
+ // whenever the keyboard shrinks it — without this, the header
1909
+ // renders under the clock.
1910
+ { paddingTop: insets.top },
1898
1911
  { transform: [{ translateY: slideAnim }] }
1899
1912
  ]
1900
1913
  },
@@ -1957,8 +1970,21 @@ var styles3 = reactNative.StyleSheet.create({
1957
1970
  flex: 1,
1958
1971
  justifyContent: "flex-end"
1959
1972
  },
1973
+ // The sheet has to be able to SHRINK, so its size is a maximum and not
1974
+ // a height. `keyboardView` is a KeyboardAvoidingView on `padding`
1975
+ // (`height` on Android): when the keyboard opens, the space left for
1976
+ // this child drops by the keyboard's height. A fixed `height` ignores
1977
+ // that — the sheet keeps its full size, the parent's
1978
+ // `justifyContent: 'flex-end'` pins it to the bottom, and it overflows
1979
+ // off the TOP, carrying the header away with it. Measured on a
1980
+ // third-party app at 0.75 × 812pt against a ~336pt keyboard: focusing
1981
+ // the input put the entire header off screen, close button included,
1982
+ // and nothing could dismiss the chat. `flex: 1` + `maxHeight` keeps the
1983
+ // same size with the keyboard down and shrinks instead of overflowing
1984
+ // with it up.
1960
1985
  chatContainer: {
1961
- height: SCREEN_HEIGHT * 0.75,
1986
+ flex: 1,
1987
+ maxHeight: SCREEN_HEIGHT * 0.75,
1962
1988
  shadowColor: "#000",
1963
1989
  shadowOffset: { width: 0, height: -3 },
1964
1990
  shadowOpacity: 0.1,
@@ -1966,15 +1992,19 @@ var styles3 = reactNative.StyleSheet.create({
1966
1992
  elevation: 10
1967
1993
  },
1968
1994
  chatContainerFullscreen: {
1969
- height: SCREEN_HEIGHT
1995
+ maxHeight: SCREEN_HEIGHT
1970
1996
  },
1971
1997
  chatContainerSidebar: {
1972
- height: SCREEN_HEIGHT,
1998
+ maxHeight: SCREEN_HEIGHT,
1973
1999
  width: SCREEN_WIDTH > 600 ? SCREEN_WIDTH * 0.4 : SCREEN_WIDTH
1974
2000
  },
2001
+ // Inline renders in place with no modal and no KeyboardAvoidingView, so
2002
+ // it fills its host instead — the 75% cap above would shrink it to
2003
+ // three quarters of whatever the integrator sized the slot.
1975
2004
  chatContainerInline: {
1976
2005
  height: "100%",
1977
2006
  width: "100%",
2007
+ maxHeight: "100%",
1978
2008
  flex: 1
1979
2009
  },
1980
2010
  header: {
@@ -2264,9 +2294,9 @@ function createAppilotsInput(WrappedComponent) {
2264
2294
  label: label ?? fieldId,
2265
2295
  screen: appilotsScreen
2266
2296
  };
2267
- chunk55Y2AQE7_js.componentRegistry.register(fieldId, entry);
2297
+ chunkSUMIABJK_js.componentRegistry.register(fieldId, entry);
2268
2298
  return () => {
2269
- chunk55Y2AQE7_js.componentRegistry.unregister(fieldId);
2299
+ chunkSUMIABJK_js.componentRegistry.unregister(fieldId);
2270
2300
  };
2271
2301
  }, [
2272
2302
  fieldId,
@@ -2322,9 +2352,9 @@ function createAppilotsButton(WrappedComponent) {
2322
2352
  label: title ?? targetId,
2323
2353
  screen: appilotsScreen
2324
2354
  };
2325
- chunk55Y2AQE7_js.componentRegistry.register(targetId, entry);
2355
+ chunkSUMIABJK_js.componentRegistry.register(targetId, entry);
2326
2356
  return () => {
2327
- chunk55Y2AQE7_js.componentRegistry.unregister(targetId);
2357
+ chunkSUMIABJK_js.componentRegistry.unregister(targetId);
2328
2358
  };
2329
2359
  }, [targetId, appilotsEnabled, press, title, appilotsScreen]);
2330
2360
  return /* @__PURE__ */ React7__namespace.default.createElement(
@@ -2368,9 +2398,9 @@ function createAppilotsSwitch(WrappedComponent) {
2368
2398
  label: label ?? toggleId,
2369
2399
  screen: appilotsScreen
2370
2400
  };
2371
- chunk55Y2AQE7_js.componentRegistry.register(toggleId, entry);
2401
+ chunkSUMIABJK_js.componentRegistry.register(toggleId, entry);
2372
2402
  return () => {
2373
- chunk55Y2AQE7_js.componentRegistry.unregister(toggleId);
2403
+ chunkSUMIABJK_js.componentRegistry.unregister(toggleId);
2374
2404
  };
2375
2405
  }, [toggleId, appilotsEnabled, getValue, setValue, label, appilotsScreen]);
2376
2406
  return /* @__PURE__ */ React7__namespace.default.createElement(
@@ -2387,179 +2417,179 @@ function createAppilotsSwitch(WrappedComponent) {
2387
2417
 
2388
2418
  Object.defineProperty(exports, "AppilotsNavigationContainer", {
2389
2419
  enumerable: true,
2390
- get: function () { return chunkIZEWWAA7_js.AppilotsNavigationContainer; }
2420
+ get: function () { return chunk5UVMNKPT_js.AppilotsNavigationContainer; }
2391
2421
  });
2392
2422
  Object.defineProperty(exports, "appilotsSelfCheck", {
2393
2423
  enumerable: true,
2394
- get: function () { return chunk2YPEQTL2_js.appilotsSelfCheck; }
2424
+ get: function () { return chunkUFMTRGML_js.appilotsSelfCheck; }
2395
2425
  });
2396
2426
  Object.defineProperty(exports, "captureSnapshot", {
2397
2427
  enumerable: true,
2398
- get: function () { return chunk2YPEQTL2_js.captureSnapshot; }
2428
+ get: function () { return chunkUFMTRGML_js.captureSnapshot; }
2399
2429
  });
2400
2430
  Object.defineProperty(exports, "executeAction", {
2401
2431
  enumerable: true,
2402
- get: function () { return chunk2YPEQTL2_js.executeAction; }
2432
+ get: function () { return chunkUFMTRGML_js.executeAction; }
2403
2433
  });
2404
2434
  Object.defineProperty(exports, "useAppilots", {
2405
2435
  enumerable: true,
2406
- get: function () { return chunk2YPEQTL2_js.useAppilots; }
2436
+ get: function () { return chunkUFMTRGML_js.useAppilots; }
2407
2437
  });
2408
2438
  Object.defineProperty(exports, "useAppilotsActions", {
2409
2439
  enumerable: true,
2410
- get: function () { return chunk2YPEQTL2_js.useAppilotsActions; }
2440
+ get: function () { return chunkUFMTRGML_js.useAppilotsActions; }
2411
2441
  });
2412
2442
  Object.defineProperty(exports, "useAppilotsChat", {
2413
2443
  enumerable: true,
2414
- get: function () { return chunk2YPEQTL2_js.useAppilotsChat; }
2444
+ get: function () { return chunkUFMTRGML_js.useAppilotsChat; }
2415
2445
  });
2416
2446
  Object.defineProperty(exports, "useAppilotsField", {
2417
2447
  enumerable: true,
2418
- get: function () { return chunk2YPEQTL2_js.useAppilotsField; }
2448
+ get: function () { return chunkUFMTRGML_js.useAppilotsField; }
2419
2449
  });
2420
2450
  Object.defineProperty(exports, "useAppilotsNavigation", {
2421
2451
  enumerable: true,
2422
- get: function () { return chunk2YPEQTL2_js.useAppilotsNavigation; }
2452
+ get: function () { return chunkUFMTRGML_js.useAppilotsNavigation; }
2423
2453
  });
2424
2454
  Object.defineProperty(exports, "useAppilotsSlider", {
2425
2455
  enumerable: true,
2426
- get: function () { return chunk2YPEQTL2_js.useAppilotsSlider; }
2456
+ get: function () { return chunkUFMTRGML_js.useAppilotsSlider; }
2427
2457
  });
2428
2458
  Object.defineProperty(exports, "useAppilotsTarget", {
2429
2459
  enumerable: true,
2430
- get: function () { return chunk2YPEQTL2_js.useAppilotsTarget; }
2460
+ get: function () { return chunkUFMTRGML_js.useAppilotsTarget; }
2431
2461
  });
2432
2462
  Object.defineProperty(exports, "useAppilotsToggle", {
2433
2463
  enumerable: true,
2434
- get: function () { return chunk2YPEQTL2_js.useAppilotsToggle; }
2464
+ get: function () { return chunkUFMTRGML_js.useAppilotsToggle; }
2435
2465
  });
2436
2466
  Object.defineProperty(exports, "useSuggestedPrompts", {
2437
2467
  enumerable: true,
2438
- get: function () { return chunk2YPEQTL2_js.useSuggestedPrompts; }
2468
+ get: function () { return chunkUFMTRGML_js.useSuggestedPrompts; }
2439
2469
  });
2440
2470
  Object.defineProperty(exports, "AppilotsClient", {
2441
2471
  enumerable: true,
2442
- get: function () { return chunk55Y2AQE7_js.AppilotsClient; }
2472
+ get: function () { return chunkSUMIABJK_js.AppilotsClient; }
2443
2473
  });
2444
2474
  Object.defineProperty(exports, "AppilotsProvider", {
2445
2475
  enumerable: true,
2446
- get: function () { return chunk55Y2AQE7_js.AppilotsProvider; }
2476
+ get: function () { return chunkSUMIABJK_js.AppilotsProvider; }
2447
2477
  });
2448
2478
  Object.defineProperty(exports, "AppilotsRegistryProvider", {
2449
2479
  enumerable: true,
2450
- get: function () { return chunk55Y2AQE7_js.AppilotsRegistryProvider; }
2480
+ get: function () { return chunkSUMIABJK_js.AppilotsRegistryProvider; }
2451
2481
  });
2452
2482
  Object.defineProperty(exports, "RateLimitedError", {
2453
2483
  enumerable: true,
2454
- get: function () { return chunk55Y2AQE7_js.RateLimitedError; }
2484
+ get: function () { return chunkSUMIABJK_js.RateLimitedError; }
2455
2485
  });
2456
2486
  Object.defineProperty(exports, "SDK_VERSION", {
2457
2487
  enumerable: true,
2458
- get: function () { return chunk55Y2AQE7_js.SDK_VERSION; }
2488
+ get: function () { return chunkSUMIABJK_js.SDK_VERSION; }
2459
2489
  });
2460
2490
  Object.defineProperty(exports, "_patchJsxRuntimes", {
2461
2491
  enumerable: true,
2462
- get: function () { return chunk55Y2AQE7_js._patchJsxRuntimes; }
2492
+ get: function () { return chunkSUMIABJK_js._patchJsxRuntimes; }
2463
2493
  });
2464
2494
  Object.defineProperty(exports, "clearAppilotsDebugTraces", {
2465
2495
  enumerable: true,
2466
- get: function () { return chunk55Y2AQE7_js.clearAppilotsDebugTraces; }
2496
+ get: function () { return chunkSUMIABJK_js.clearAppilotsDebugTraces; }
2467
2497
  });
2468
2498
  Object.defineProperty(exports, "componentRegistry", {
2469
2499
  enumerable: true,
2470
- get: function () { return chunk55Y2AQE7_js.componentRegistry; }
2500
+ get: function () { return chunkSUMIABJK_js.componentRegistry; }
2471
2501
  });
2472
2502
  Object.defineProperty(exports, "createComponentRegistry", {
2473
2503
  enumerable: true,
2474
- get: function () { return chunk55Y2AQE7_js.createComponentRegistry; }
2504
+ get: function () { return chunkSUMIABJK_js.createComponentRegistry; }
2475
2505
  });
2476
2506
  Object.defineProperty(exports, "createElementRegistry", {
2477
2507
  enumerable: true,
2478
- get: function () { return chunk55Y2AQE7_js.createElementRegistry; }
2508
+ get: function () { return chunkSUMIABJK_js.createElementRegistry; }
2479
2509
  });
2480
2510
  Object.defineProperty(exports, "createListRegistry", {
2481
2511
  enumerable: true,
2482
- get: function () { return chunk55Y2AQE7_js.createListRegistry; }
2512
+ get: function () { return chunkSUMIABJK_js.createListRegistry; }
2483
2513
  });
2484
2514
  Object.defineProperty(exports, "defaultDarkTheme", {
2485
2515
  enumerable: true,
2486
- get: function () { return chunk55Y2AQE7_js.defaultDarkTheme; }
2516
+ get: function () { return chunkSUMIABJK_js.defaultDarkTheme; }
2487
2517
  });
2488
2518
  Object.defineProperty(exports, "defaultLightTheme", {
2489
2519
  enumerable: true,
2490
- get: function () { return chunk55Y2AQE7_js.defaultLightTheme; }
2520
+ get: function () { return chunkSUMIABJK_js.defaultLightTheme; }
2491
2521
  });
2492
2522
  Object.defineProperty(exports, "describeAction", {
2493
2523
  enumerable: true,
2494
- get: function () { return chunk55Y2AQE7_js.describeAction; }
2524
+ get: function () { return chunkSUMIABJK_js.describeAction; }
2495
2525
  });
2496
2526
  Object.defineProperty(exports, "elementRegistry", {
2497
2527
  enumerable: true,
2498
- get: function () { return chunk55Y2AQE7_js.elementRegistry; }
2528
+ get: function () { return chunkSUMIABJK_js.elementRegistry; }
2499
2529
  });
2500
2530
  Object.defineProperty(exports, "enableAppilotsAutoTracking", {
2501
2531
  enumerable: true,
2502
- get: function () { return chunk55Y2AQE7_js.enableAppilotsAutoTracking; }
2532
+ get: function () { return chunkSUMIABJK_js.enableAppilotsAutoTracking; }
2503
2533
  });
2504
2534
  Object.defineProperty(exports, "getAppilotsDebugTraces", {
2505
2535
  enumerable: true,
2506
- get: function () { return chunk55Y2AQE7_js.getAppilotsDebugTraces; }
2536
+ get: function () { return chunkSUMIABJK_js.getAppilotsDebugTraces; }
2507
2537
  });
2508
2538
  Object.defineProperty(exports, "getAutoTrackingState", {
2509
2539
  enumerable: true,
2510
- get: function () { return chunk55Y2AQE7_js.getAutoTrackingState; }
2540
+ get: function () { return chunkSUMIABJK_js.getAutoTrackingState; }
2511
2541
  });
2512
2542
  Object.defineProperty(exports, "getGlobalConfig", {
2513
2543
  enumerable: true,
2514
- get: function () { return chunk55Y2AQE7_js.getGlobalConfig; }
2544
+ get: function () { return chunkSUMIABJK_js.getGlobalConfig; }
2515
2545
  });
2516
2546
  Object.defineProperty(exports, "getIntrospectionDiagnostics", {
2517
2547
  enumerable: true,
2518
- get: function () { return chunk55Y2AQE7_js.getIntrospectionDiagnostics; }
2548
+ get: function () { return chunkSUMIABJK_js.getIntrospectionDiagnostics; }
2519
2549
  });
2520
2550
  Object.defineProperty(exports, "humanizeError", {
2521
2551
  enumerable: true,
2522
- get: function () { return chunk55Y2AQE7_js.humanizeError; }
2552
+ get: function () { return chunkSUMIABJK_js.humanizeError; }
2523
2553
  });
2524
2554
  Object.defineProperty(exports, "initAppilots", {
2525
2555
  enumerable: true,
2526
- get: function () { return chunk55Y2AQE7_js.initAppilots; }
2556
+ get: function () { return chunkSUMIABJK_js.initAppilots; }
2527
2557
  });
2528
2558
  Object.defineProperty(exports, "isAutoTrackingEnabled", {
2529
2559
  enumerable: true,
2530
- get: function () { return chunk55Y2AQE7_js.isAutoTrackingEnabled; }
2560
+ get: function () { return chunkSUMIABJK_js.isAutoTrackingEnabled; }
2531
2561
  });
2532
2562
  Object.defineProperty(exports, "listRegistry", {
2533
2563
  enumerable: true,
2534
- get: function () { return chunk55Y2AQE7_js.listRegistry; }
2564
+ get: function () { return chunkSUMIABJK_js.listRegistry; }
2535
2565
  });
2536
2566
  Object.defineProperty(exports, "mergeThemeTokens", {
2537
2567
  enumerable: true,
2538
- get: function () { return chunk55Y2AQE7_js.mergeThemeTokens; }
2568
+ get: function () { return chunkSUMIABJK_js.mergeThemeTokens; }
2539
2569
  });
2540
2570
  Object.defineProperty(exports, "recordAppilotsDebugTrace", {
2541
2571
  enumerable: true,
2542
- get: function () { return chunk55Y2AQE7_js.recordAppilotsDebugTrace; }
2572
+ get: function () { return chunkSUMIABJK_js.recordAppilotsDebugTrace; }
2543
2573
  });
2544
2574
  Object.defineProperty(exports, "registerScreen", {
2545
2575
  enumerable: true,
2546
- get: function () { return chunk55Y2AQE7_js.registerScreen; }
2576
+ get: function () { return chunkSUMIABJK_js.registerScreen; }
2547
2577
  });
2548
2578
  Object.defineProperty(exports, "setCurrentScreen", {
2549
2579
  enumerable: true,
2550
- get: function () { return chunk55Y2AQE7_js.setCurrentScreen; }
2580
+ get: function () { return chunkSUMIABJK_js.setCurrentScreen; }
2551
2581
  });
2552
2582
  Object.defineProperty(exports, "subscribeAppilotsDebugTraces", {
2553
2583
  enumerable: true,
2554
- get: function () { return chunk55Y2AQE7_js.subscribeAppilotsDebugTraces; }
2584
+ get: function () { return chunkSUMIABJK_js.subscribeAppilotsDebugTraces; }
2555
2585
  });
2556
2586
  Object.defineProperty(exports, "useAppilotsContext", {
2557
2587
  enumerable: true,
2558
- get: function () { return chunk55Y2AQE7_js.useAppilotsContext; }
2588
+ get: function () { return chunkSUMIABJK_js.useAppilotsContext; }
2559
2589
  });
2560
2590
  Object.defineProperty(exports, "useResolvedRegistry", {
2561
2591
  enumerable: true,
2562
- get: function () { return chunk55Y2AQE7_js.useResolvedRegistry; }
2592
+ get: function () { return chunkSUMIABJK_js.useResolvedRegistry; }
2563
2593
  });
2564
2594
  exports.ActionBreadcrumb = ActionBreadcrumb;
2565
2595
  exports.AppilotsChat = AppilotsChat;
package/dist/index.mjs CHANGED
@@ -1,8 +1,8 @@
1
- export { AppilotsNavigationContainer } from './chunk-3K7ORC4X.mjs';
2
- import { useAppilotsChat, useAppilotsActions, shouldShowSuggestedPrompts, useSuggestedPrompts } from './chunk-NA5H4IHH.mjs';
3
- export { appilotsSelfCheck, captureSnapshot, executeAction, useAppilots, useAppilotsActions, useAppilotsChat, useAppilotsField, useAppilotsNavigation, useAppilotsSlider, useAppilotsTarget, useAppilotsToggle, useSuggestedPrompts } from './chunk-NA5H4IHH.mjs';
4
- import { defaultLightTheme, describeAction, mergeThemeTokens, resolveBaseTheme, useAppilotsContext, AppilotsErrorBoundary, componentRegistry } from './chunk-G6KI7KVH.mjs';
5
- export { AppilotsClient, AppilotsProvider, AppilotsRegistryProvider, RateLimitedError, SDK_VERSION, _patchJsxRuntimes, clearAppilotsDebugTraces, componentRegistry, createComponentRegistry, createElementRegistry, createListRegistry, defaultDarkTheme, defaultLightTheme, describeAction, elementRegistry, enableAppilotsAutoTracking, getAppilotsDebugTraces, getAutoTrackingState, getGlobalConfig, getIntrospectionDiagnostics, humanizeError, initAppilots, isAutoTrackingEnabled, listRegistry, mergeThemeTokens, recordAppilotsDebugTrace, registerScreen, setCurrentScreen, subscribeAppilotsDebugTraces, useAppilotsContext, useResolvedRegistry } from './chunk-G6KI7KVH.mjs';
1
+ export { AppilotsNavigationContainer } from './chunk-JKLE5SLN.mjs';
2
+ import { useAppilotsChat, useAppilotsActions, shouldShowSuggestedPrompts, useSuggestedPrompts } from './chunk-2ZDELL54.mjs';
3
+ export { appilotsSelfCheck, captureSnapshot, executeAction, useAppilots, useAppilotsActions, useAppilotsChat, useAppilotsField, useAppilotsNavigation, useAppilotsSlider, useAppilotsTarget, useAppilotsToggle, useSuggestedPrompts } from './chunk-2ZDELL54.mjs';
4
+ import { defaultLightTheme, describeAction, mergeThemeTokens, resolveBaseTheme, useAppilotsContext, AppilotsErrorBoundary, componentRegistry } from './chunk-ROXXCDIG.mjs';
5
+ export { AppilotsClient, AppilotsProvider, AppilotsRegistryProvider, RateLimitedError, SDK_VERSION, _patchJsxRuntimes, clearAppilotsDebugTraces, componentRegistry, createComponentRegistry, createElementRegistry, createListRegistry, defaultDarkTheme, defaultLightTheme, describeAction, elementRegistry, enableAppilotsAutoTracking, getAppilotsDebugTraces, getAutoTrackingState, getGlobalConfig, getIntrospectionDiagnostics, humanizeError, initAppilots, isAutoTrackingEnabled, listRegistry, mergeThemeTokens, recordAppilotsDebugTrace, registerScreen, setCurrentScreen, subscribeAppilotsDebugTraces, useAppilotsContext, useResolvedRegistry } from './chunk-ROXXCDIG.mjs';
6
6
  import * as React7 from 'react';
7
7
  import React7__default, { createContext, useRef, useEffect, useMemo, useContext, useState, useCallback } from 'react';
8
8
  import { StyleSheet, Dimensions, Platform, View, Animated, Text, TouchableOpacity, ActivityIndicator, useColorScheme, NativeModules, FlatList, Image, TextInput, Modal, KeyboardAvoidingView, Linking } from 'react-native';
@@ -212,7 +212,8 @@ function RegularBreadcrumbRow({
212
212
  onPress: () => onReject(action.id),
213
213
  style: [styles.btn, { backgroundColor: deriveStateTone(palette).failed.iconBg }],
214
214
  activeOpacity: 0.7,
215
- accessibilityLabel: "Rejeitar a\xE7\xE3o"
215
+ accessibilityLabel: "Rejeitar a\xE7\xE3o",
216
+ testID: "assistant-action-reject"
216
217
  },
217
218
  /* @__PURE__ */ React7__default.createElement(Text, { style: [styles.rejectBtnText, { color: palette.error }] }, "Rejeitar")
218
219
  ), /* @__PURE__ */ React7__default.createElement(
@@ -221,7 +222,8 @@ function RegularBreadcrumbRow({
221
222
  onPress: () => onApprove(action.id),
222
223
  style: [styles.btn, styles.approveBtn, { backgroundColor: primaryColor }],
223
224
  activeOpacity: 0.7,
224
- accessibilityLabel: "Aprovar a\xE7\xE3o"
225
+ accessibilityLabel: "Aprovar a\xE7\xE3o",
226
+ testID: "assistant-action-approve"
225
227
  },
226
228
  /* @__PURE__ */ React7__default.createElement(Text, { style: styles.approveBtnText }, "Aprovar")
227
229
  )));
@@ -274,7 +276,7 @@ function ConfirmCard({
274
276
  onPress: () => onReject?.(action.id),
275
277
  style: [confirmCardStyles.btn, { backgroundColor: cancelBackground }],
276
278
  activeOpacity: 0.7,
277
- accessibilityLabel: "Cancelar",
279
+ accessibilityLabel: cancelLabel,
278
280
  testID: "assistant-confirm-reject"
279
281
  },
280
282
  /* @__PURE__ */ React7__default.createElement(Text, { style: [confirmCardStyles.cancelText, { color: cancelTextColor, fontFamily }] }, cancelLabel)
@@ -288,7 +290,7 @@ function ConfirmCard({
288
290
  { backgroundColor: actionColor }
289
291
  ],
290
292
  activeOpacity: 0.7,
291
- accessibilityLabel: "Confirmar",
293
+ accessibilityLabel: confirmLabel,
292
294
  testID: "assistant-confirm-approve"
293
295
  },
294
296
  /* @__PURE__ */ React7__default.createElement(Text, { style: [confirmCardStyles.confirmText, { fontFamily }] }, confirmLabel)
@@ -1578,7 +1580,9 @@ function AppilotsChatInner({
1578
1580
  {
1579
1581
  ...APPILOTS_SKIP_PROPS,
1580
1582
  onPress: clearMessages,
1581
- style: styles3.headerButton
1583
+ style: styles3.headerButton,
1584
+ accessibilityRole: "button",
1585
+ testID: "assistant-clear"
1582
1586
  },
1583
1587
  /* @__PURE__ */ React7__default.createElement(Text, { style: [styles3.headerButtonText, { color: theme.colors.textSecondary }] }, strings.clearButton)
1584
1588
  ), mode !== "inline" && /* @__PURE__ */ React7__default.createElement(
@@ -1587,7 +1591,9 @@ function AppilotsChatInner({
1587
1591
  ...APPILOTS_SKIP_PROPS,
1588
1592
  onPress: closeChat,
1589
1593
  style: styles3.closeButton,
1590
- accessibilityLabel: strings.closeChatA11y
1594
+ accessibilityRole: "button",
1595
+ accessibilityLabel: strings.closeChatA11y,
1596
+ testID: "assistant-close"
1591
1597
  },
1592
1598
  /* @__PURE__ */ React7__default.createElement(Text, { style: [styles3.closeButtonText, { color: theme.colors.text }] }, "\u2715")
1593
1599
  ))),
@@ -1671,7 +1677,7 @@ function AppilotsChatInner({
1671
1677
  numberOfLines: 2
1672
1678
  },
1673
1679
  resolvedEmptySubtitle
1674
- ), showSuggestedPrompts && suggestedPrompts.length > 0 && /* @__PURE__ */ React7__default.createElement(View, { style: styles3.chipsContainer }, suggestedPrompts.map((prompt) => /* @__PURE__ */ React7__default.createElement(
1680
+ ), showSuggestedPrompts && suggestedPrompts.length > 0 && /* @__PURE__ */ React7__default.createElement(View, { style: styles3.chipsContainer, testID: "assistant-suggested-prompts" }, suggestedPrompts.map((prompt) => /* @__PURE__ */ React7__default.createElement(
1675
1681
  TouchableOpacity,
1676
1682
  {
1677
1683
  key: `${prompt.source}:${prompt.text}`,
@@ -1873,6 +1879,13 @@ function AppilotsChatInner({
1873
1879
  style: [
1874
1880
  mode === "fullscreen" ? styles3.modalContainerFullscreen : styles3.modalContainer,
1875
1881
  mode === "sidebar" && styles3.modalContainerSidebar,
1882
+ // Keeps the sheet out of the status bar / notch. It is padding
1883
+ // and not a margin so the scrim still covers the full screen.
1884
+ // Only reachable now that the sheet can grow to the top edge:
1885
+ // `fullscreen` and `sidebar` always could, and `bubble` does
1886
+ // whenever the keyboard shrinks it — without this, the header
1887
+ // renders under the clock.
1888
+ { paddingTop: insets.top },
1876
1889
  { transform: [{ translateY: slideAnim }] }
1877
1890
  ]
1878
1891
  },
@@ -1935,8 +1948,21 @@ var styles3 = StyleSheet.create({
1935
1948
  flex: 1,
1936
1949
  justifyContent: "flex-end"
1937
1950
  },
1951
+ // The sheet has to be able to SHRINK, so its size is a maximum and not
1952
+ // a height. `keyboardView` is a KeyboardAvoidingView on `padding`
1953
+ // (`height` on Android): when the keyboard opens, the space left for
1954
+ // this child drops by the keyboard's height. A fixed `height` ignores
1955
+ // that — the sheet keeps its full size, the parent's
1956
+ // `justifyContent: 'flex-end'` pins it to the bottom, and it overflows
1957
+ // off the TOP, carrying the header away with it. Measured on a
1958
+ // third-party app at 0.75 × 812pt against a ~336pt keyboard: focusing
1959
+ // the input put the entire header off screen, close button included,
1960
+ // and nothing could dismiss the chat. `flex: 1` + `maxHeight` keeps the
1961
+ // same size with the keyboard down and shrinks instead of overflowing
1962
+ // with it up.
1938
1963
  chatContainer: {
1939
- height: SCREEN_HEIGHT * 0.75,
1964
+ flex: 1,
1965
+ maxHeight: SCREEN_HEIGHT * 0.75,
1940
1966
  shadowColor: "#000",
1941
1967
  shadowOffset: { width: 0, height: -3 },
1942
1968
  shadowOpacity: 0.1,
@@ -1944,15 +1970,19 @@ var styles3 = StyleSheet.create({
1944
1970
  elevation: 10
1945
1971
  },
1946
1972
  chatContainerFullscreen: {
1947
- height: SCREEN_HEIGHT
1973
+ maxHeight: SCREEN_HEIGHT
1948
1974
  },
1949
1975
  chatContainerSidebar: {
1950
- height: SCREEN_HEIGHT,
1976
+ maxHeight: SCREEN_HEIGHT,
1951
1977
  width: SCREEN_WIDTH > 600 ? SCREEN_WIDTH * 0.4 : SCREEN_WIDTH
1952
1978
  },
1979
+ // Inline renders in place with no modal and no KeyboardAvoidingView, so
1980
+ // it fills its host instead — the 75% cap above would shrink it to
1981
+ // three quarters of whatever the integrator sized the slot.
1953
1982
  chatContainerInline: {
1954
1983
  height: "100%",
1955
1984
  width: "100%",
1985
+ maxHeight: "100%",
1956
1986
  flex: 1
1957
1987
  },
1958
1988
  header: {