@mochabug/adapt-react 1.0.1-rc.16 → 1.0.1-rc.17

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.
@@ -7,7 +7,7 @@ void AdaptAutomationElement;
7
7
  * React component for embedding Adapt automations.
8
8
  * Renders `<adapt-automation>` custom element and syncs non-serializable properties via ref.
9
9
  */
10
- export const AdaptAutomation = forwardRef(function AdaptAutomation({ automationId, sessionToken, authToken, transmitter, signals, challengeToken, requiresChallenge, capWidgetOptions, inheritToken, inheritFrom, forkDisplay, darkMode, autoResizing, allowFloating, allowDocking, allowDialogDocking, allowMinimize, allowMaximize, floatingAutoResize, onSession, onOutput, onForkActive, classNames, styles, persist, text, theme, className, style, }, ref) {
10
+ export const AdaptAutomation = forwardRef(function AdaptAutomation({ automationId, sessionToken, authToken, transmitter, signals, challengeToken, requiresChallenge, capWidgetOptions, inheritToken, inheritFrom, forkDisplay, darkMode, autoResizing, allowFloating, allowDocking, allowDialogDocking, allowMinimize, allowMaximize, floatingAutoResize, onSession, onOutput, onForkActive, onError, classNames, styles, persist, text, theme, className, style, }, ref) {
11
11
  const internalRef = useRef(null);
12
12
  // Merge refs
13
13
  const setRef = (element) => {
@@ -35,6 +35,7 @@ export const AdaptAutomation = forwardRef(function AdaptAutomation({ automationI
35
35
  el.onSessionCallback = onSession;
36
36
  el.onOutputCallback = onOutput;
37
37
  el.onForkActiveCallback = onForkActive;
38
+ el.onErrorCallback = onError;
38
39
  });
39
40
  // React doesn't natively set properties on custom elements (pre-19),
40
41
  // so we use attributes for serializable values and ref for the rest.
@@ -1,4 +1,4 @@
1
- import { AdaptAutomationElement, type AdaptTheme, type AdaptWebClientOptions, type ForkDisplay, type Output, type PersistOptions, type SignalValue, type StatusJson, type StatusText } from "@mochabug/adapt-web/core";
1
+ import { AdaptAutomationElement, type AdaptError, type AdaptTheme, type AdaptWebClientOptions, type ForkDisplay, type Output, type PersistOptions, type SignalValue, type StatusJson, type StatusText } from "@mochabug/adapt-web/core";
2
2
  declare module "react" {
3
3
  namespace JSX {
4
4
  interface IntrinsicElements {
@@ -57,6 +57,7 @@ export interface AdaptAutomationProps {
57
57
  onSession?: (status: StatusJson, fork?: string) => void;
58
58
  onOutput?: (output: Output) => void;
59
59
  onForkActive?: (active: boolean) => void;
60
+ onError?: (error: AdaptError) => void;
60
61
  classNames?: AdaptWebClientOptions["classNames"];
61
62
  styles?: Partial<CSSStyleDeclaration>;
62
63
  persist?: boolean | PersistOptions;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mochabug/adapt-react",
3
- "version": "1.0.1-rc.16",
3
+ "version": "1.0.1-rc.17",
4
4
  "description": "React component for Adapt automation platform",
5
5
  "type": "module",
6
6
  "main": "./dist/esm/index.js",
@@ -45,6 +45,6 @@
45
45
  "typescript": "^5.9.3"
46
46
  },
47
47
  "dependencies": {
48
- "@mochabug/adapt-web": "^1.0.1-rc.16"
48
+ "@mochabug/adapt-web": "^1.0.1-rc.17"
49
49
  }
50
50
  }