@mochabug/adapt-react 1.0.1-rc.27 → 1.0.1-rc.29
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/README.md
CHANGED
|
@@ -415,6 +415,7 @@ Internal stacking order from low to high: separators (1), resize handles (10), m
|
|
|
415
415
|
| `allowDocking` | `boolean` — hide dock buttons and block user-initiated docking (default `true`) |
|
|
416
416
|
| `allowDialogDocking` | `boolean` — allow tab splits inside floating dialog overlays (default `true`) |
|
|
417
417
|
| `floatingAutoResize` | `boolean` — floating overlays auto-resize from iframe content (default `false`) |
|
|
418
|
+
| `confirmOnClose` | `boolean` — show confirmation dialog before leaving page (default `false`) |
|
|
418
419
|
| `persist` | `boolean \| PersistOptions` |
|
|
419
420
|
| `text` | `StatusText` |
|
|
420
421
|
| `theme` | `AdaptTheme` |
|
|
@@ -5,7 +5,7 @@ import { forwardRef, useLayoutEffect, useRef } from "react";
|
|
|
5
5
|
* React component for embedding Adapt automations.
|
|
6
6
|
* Renders `<adapt-automation>` custom element and syncs non-serializable properties via ref.
|
|
7
7
|
*/
|
|
8
|
-
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, debug, className, style, }, ref) {
|
|
8
|
+
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, confirmOnClose, onSession, onOutput, onForkActive, onError, classNames, styles, persist, text, theme, debug, className, style, }, ref) {
|
|
9
9
|
const internalRef = useRef(null);
|
|
10
10
|
// Merge refs
|
|
11
11
|
const setRef = (element) => {
|
|
@@ -42,5 +42,5 @@ export const AdaptAutomation = forwardRef(function AdaptAutomation({ automationI
|
|
|
42
42
|
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
43
|
forkDisplay.split !== undefined
|
|
44
44
|
? 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, "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 }));
|
|
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, "confirm-on-close": confirmOnClose ? "" : 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
46
|
});
|
package/dist/esm/AdaptCap.js
CHANGED
|
@@ -5,7 +5,7 @@ import { forwardRef, useLayoutEffect, useRef } from "react";
|
|
|
5
5
|
* React component for Cap.js proof-of-work challenges.
|
|
6
6
|
* Renders `<adapt-cap>` custom element and syncs non-serializable properties via ref.
|
|
7
7
|
*/
|
|
8
|
-
export const AdaptCap = forwardRef(function AdaptCap({ automationId, client, onSolve, onError, workerCount, i18n, darkMode, className, style, }, ref) {
|
|
8
|
+
export const AdaptCap = forwardRef(function AdaptCap({ automationId, client, onSolve, onError, workerCount, hiddenFieldName, troubleshootingUrl, disableHaptics, i18n, darkMode, className, style, }, ref) {
|
|
9
9
|
const internalRef = useRef(null);
|
|
10
10
|
// Merge refs
|
|
11
11
|
const setRef = (element) => {
|
|
@@ -27,5 +27,5 @@ export const AdaptCap = forwardRef(function AdaptCap({ automationId, client, onS
|
|
|
27
27
|
el.onSolveCallback = onSolve;
|
|
28
28
|
el.onErrorCallback = onError;
|
|
29
29
|
});
|
|
30
|
-
return (_jsx("adapt-cap", { ref: setRef, className: className, style: style, "automation-id": automationId, "dark-mode": darkMode ? "" : undefined, "worker-count": workerCount !== undefined ? String(workerCount) : undefined }));
|
|
30
|
+
return (_jsx("adapt-cap", { ref: setRef, className: className, style: style, "automation-id": automationId, "dark-mode": darkMode ? "" : undefined, "worker-count": workerCount !== undefined ? String(workerCount) : undefined, "hidden-field-name": hiddenFieldName, "troubleshooting-url": troubleshootingUrl, "disable-haptics": disableHaptics ? "" : undefined }));
|
|
31
31
|
});
|
|
@@ -22,6 +22,7 @@ declare module "react" {
|
|
|
22
22
|
"allow-minimize"?: string;
|
|
23
23
|
"allow-maximize"?: string;
|
|
24
24
|
"floating-auto-resize"?: string;
|
|
25
|
+
"confirm-on-close"?: string;
|
|
25
26
|
debug?: boolean;
|
|
26
27
|
}, AdaptAutomationElement>;
|
|
27
28
|
}
|
|
@@ -56,6 +57,7 @@ export interface AdaptAutomationProps {
|
|
|
56
57
|
allowMinimize?: boolean;
|
|
57
58
|
allowMaximize?: boolean;
|
|
58
59
|
floatingAutoResize?: boolean;
|
|
60
|
+
confirmOnClose?: boolean;
|
|
59
61
|
onSession?: (status: StatusJson, fork?: string) => void;
|
|
60
62
|
onOutput?: (output: Output) => void;
|
|
61
63
|
onForkActive?: (active: boolean) => void;
|
package/dist/types/AdaptCap.d.ts
CHANGED
|
@@ -8,6 +8,9 @@ declare module "react" {
|
|
|
8
8
|
"automation-id"?: string;
|
|
9
9
|
"dark-mode"?: string;
|
|
10
10
|
"worker-count"?: string;
|
|
11
|
+
"hidden-field-name"?: string;
|
|
12
|
+
"troubleshooting-url"?: string;
|
|
13
|
+
"disable-haptics"?: string;
|
|
11
14
|
}, AdaptCapElement>;
|
|
12
15
|
}
|
|
13
16
|
}
|
|
@@ -19,6 +22,9 @@ export interface AdaptCapProps {
|
|
|
19
22
|
automationId: string;
|
|
20
23
|
client: AutomationClient;
|
|
21
24
|
workerCount?: number;
|
|
25
|
+
hiddenFieldName?: string;
|
|
26
|
+
troubleshootingUrl?: string;
|
|
27
|
+
disableHaptics?: boolean;
|
|
22
28
|
i18n?: CapWidgetI18n;
|
|
23
29
|
darkMode?: boolean;
|
|
24
30
|
onSolve?: (token: string, expires: Date) => void;
|
package/dist/types/cap.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import "@mochabug/adapt-web/cap";
|
|
2
2
|
export { AdaptCap, type AdaptCapProps } from "./AdaptCap.js";
|
|
3
|
-
export { Cap as AdaptCapWidget, type AdaptCapWidgetOptions, createChallenge, redeemChallenge, AdaptCapElement, createConnectClient, type ChallengeInfo, type RedeemedChallenge, type CapWidgetI18n, type CapWidgetOptions, } from "@mochabug/adapt-web/cap";
|
|
3
|
+
export { Cap as AdaptCapWidget, type AdaptCapWidgetOptions, createChallenge, redeemChallenge, AdaptCapElement, createConnectClient, type ChallengeInfo, type RedeemChallengeOptions, type RedeemedChallenge, type CapWidgetI18n, type CapWidgetOptions, } from "@mochabug/adapt-web/cap";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mochabug/adapt-react",
|
|
3
|
-
"version": "1.0.1-rc.
|
|
3
|
+
"version": "1.0.1-rc.29",
|
|
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": "^6.0.3"
|
|
46
46
|
},
|
|
47
47
|
"dependencies": {
|
|
48
|
-
"@mochabug/adapt-web": "^1.0.1-rc.
|
|
48
|
+
"@mochabug/adapt-web": "^1.0.1-rc.29"
|
|
49
49
|
}
|
|
50
50
|
}
|