@graineai/inapp-react-native 0.33.0 → 0.33.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.
@@ -278,9 +278,11 @@ export function GraineVoiceLauncher({ webView: WebView, autoStart = false, activ
278
278
  }, [post]);
279
279
  if (!voiceAgentId)
280
280
  return _jsx(_Fragment, { children: children?.(api) });
281
+ const mountStampRef = useRef(Date.now());
281
282
  const effectiveTransport = transport ?? (appearance?.audioTransport === "rtc" ? "rtc" : "ws");
282
283
  const src = `${client.opts.baseUrl.replace(/\/$/, "")}/embed/${voiceAgentId}` +
283
284
  `?mode=voice&branding=0&embed=1&transport=${effectiveTransport}` +
285
+ `&b=${mountStampRef.current}` +
284
286
  (mountedIdleRef.current ? "&idle=1" : "") +
285
287
  `&pk=${encodeURIComponent(client.opts.publishableKey)}` +
286
288
  (appearance?.accent ? `&accent=${encodeURIComponent(String(appearance.accent).replace("#", ""))}` : "");
@@ -1,6 +1,7 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
+ import { useContext } from "react";
2
3
  import { Image, Modal, Pressable, ScrollView, Text, View, useColorScheme } from "react-native";
3
- import { useGraineAgent, useGraineWidget } from "./index.js";
4
+ import { Ctx, useGraineWidget } from "./index.js";
4
5
  import { resolveNativeAppearance, resolveWidgetPalette } from "./appearance.js";
5
6
  import { widgetSurface } from "../protocol.js";
6
7
  function tint(hex, alpha) {
@@ -57,7 +58,7 @@ function AnsweredLine({ answered, theme, accent, radius, onClear }) {
57
58
  }
58
59
  export function GraineWidget(props) {
59
60
  const { widget, answered, submit, dismiss } = useGraineWidget();
60
- const { appearance } = useGraineAgent();
61
+ const appearance = useContext(Ctx)?.appearance ?? null;
61
62
  const scheme = useColorScheme();
62
63
  const dash = resolveNativeAppearance(appearance, { accent: "#318CE7", heading: "" });
63
64
  const accent = props.accent ?? dash.accent;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@graineai/inapp-react-native",
3
- "version": "0.33.0",
3
+ "version": "0.33.2",
4
4
  "type": "module",
5
5
  "description": "Graine in-app agent for React Native — an agent that sees the screen your customer is on and can act on it.",
6
6
  "license": "MIT",