@mochabug/adapt-react 1.0.1-rc.21 → 1.0.1-rc.23

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.
@@ -19,7 +19,8 @@ export const AdaptAutomation = forwardRef(function AdaptAutomation({ automationI
19
19
  ref.current = element;
20
20
  }
21
21
  };
22
- // Sync non-serializable properties to the element
22
+ // Sync non-serializable properties, then explicitly initialize.
23
+ // This guarantees properties are set BEFORE the client is created.
23
24
  useLayoutEffect(() => {
24
25
  const el = internalRef.current;
25
26
  if (!el)
@@ -36,11 +37,12 @@ export const AdaptAutomation = forwardRef(function AdaptAutomation({ automationI
36
37
  el.onOutputCallback = onOutput;
37
38
  el.onForkActiveCallback = onForkActive;
38
39
  el.onErrorCallback = onError;
40
+ el.initialize();
39
41
  });
40
42
  // React doesn't natively set properties on custom elements (pre-19),
41
43
  // so we use attributes for serializable values and ref for the rest.
42
44
  return (_jsx("adapt-automation", { ref: setRef, className: className, style: style, "automation-id": automationId, "session-token": sessionToken, "auth-token": authToken, transmitter: transmitter, "challenge-token": challengeToken, "requires-challenge": requiresChallenge ? "" : undefined, "inherit-token": inheritToken, "fork-display-mode": forkDisplay?.mode, "side-by-side-split": forkDisplay?.mode === "side-by-side" &&
43
45
  forkDisplay.split !== undefined
44
46
  ? String(forkDisplay.split)
45
- : undefined, "dark-mode": darkMode ? "" : undefined, "auto-resizing": autoResizing ? "" : undefined, "allow-floating": allowFloating === false ? "false" : undefined, "allow-docking": allowDocking === false ? "false" : undefined, "allow-dialog-docking": allowDialogDocking === false ? "false" : undefined, "allow-minimize": allowMinimize === false ? "false" : undefined, "allow-maximize": allowMaximize === false ? "false" : undefined, "floating-auto-resize": floatingAutoResize ? "" : undefined, persist: persist ? true : undefined, debug: debug ? true : undefined }));
47
+ : undefined, "dark-mode": darkMode ? "" : undefined, "auto-resizing": autoResizing ? "" : undefined, "allow-floating": allowFloating === false ? "false" : undefined, "allow-docking": allowDocking === false ? "false" : undefined, "allow-dialog-docking": allowDialogDocking === false ? "false" : undefined, "allow-minimize": allowMinimize === false ? "false" : undefined, "allow-maximize": allowMaximize === false ? "false" : undefined, "floating-auto-resize": floatingAutoResize ? "" : undefined, persist: persist ? true : undefined, debug: debug ? true : undefined, "data-adapt-signals": signals ? JSON.stringify(signals) : undefined, "data-adapt-cap-widget-options": capWidgetOptions ? JSON.stringify(capWidgetOptions) : undefined, "data-adapt-inherit-from": inheritFrom ? JSON.stringify(inheritFrom) : undefined, "data-adapt-class-names": classNames ? JSON.stringify(classNames) : undefined, "data-adapt-persist-options": typeof persist === "object" ? JSON.stringify(persist) : undefined, "data-adapt-text": text ? JSON.stringify(text) : undefined, "data-adapt-theme": theme ? JSON.stringify(theme) : undefined }));
46
48
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mochabug/adapt-react",
3
- "version": "1.0.1-rc.21",
3
+ "version": "1.0.1-rc.23",
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.21"
48
+ "@mochabug/adapt-web": "^1.0.1-rc.23"
49
49
  }
50
50
  }