@mochabug/adapt-vue 1.0.1-rc.8 → 2.0.0-beta.0
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 +428 -41
- package/dist/esm/AdaptAutomation.js +195 -0
- package/dist/esm/AdaptCap.js +51 -36
- package/dist/esm/cap.js +4 -0
- package/dist/esm/core.js +3 -0
- package/dist/esm/index.js +2 -146
- package/dist/types/AdaptAutomation.d.ts +127 -0
- package/dist/types/AdaptCap.d.ts +42 -58
- package/dist/types/cap.d.ts +3 -0
- package/dist/types/core.d.ts +2 -0
- package/dist/types/index.d.ts +1 -210
- package/package.json +19 -6
|
@@ -0,0 +1,195 @@
|
|
|
1
|
+
import "@mochabug/adapt-web/core";
|
|
2
|
+
import { defineComponent, h, ref, watchEffect } from "vue";
|
|
3
|
+
const props = {
|
|
4
|
+
automationId: {
|
|
5
|
+
type: String,
|
|
6
|
+
required: true,
|
|
7
|
+
},
|
|
8
|
+
sessionToken: {
|
|
9
|
+
type: String,
|
|
10
|
+
default: undefined,
|
|
11
|
+
},
|
|
12
|
+
authToken: {
|
|
13
|
+
type: String,
|
|
14
|
+
default: undefined,
|
|
15
|
+
},
|
|
16
|
+
transmitter: {
|
|
17
|
+
type: String,
|
|
18
|
+
default: undefined,
|
|
19
|
+
},
|
|
20
|
+
signals: {
|
|
21
|
+
type: Object,
|
|
22
|
+
default: undefined,
|
|
23
|
+
},
|
|
24
|
+
inheritToken: {
|
|
25
|
+
type: String,
|
|
26
|
+
default: undefined,
|
|
27
|
+
},
|
|
28
|
+
inheritFrom: {
|
|
29
|
+
type: Object,
|
|
30
|
+
default: undefined,
|
|
31
|
+
},
|
|
32
|
+
forkDisplay: {
|
|
33
|
+
type: Object,
|
|
34
|
+
default: undefined,
|
|
35
|
+
},
|
|
36
|
+
darkMode: {
|
|
37
|
+
type: Boolean,
|
|
38
|
+
default: false,
|
|
39
|
+
},
|
|
40
|
+
autoResizing: {
|
|
41
|
+
type: Boolean,
|
|
42
|
+
default: false,
|
|
43
|
+
},
|
|
44
|
+
allowFloating: {
|
|
45
|
+
type: Boolean,
|
|
46
|
+
default: true,
|
|
47
|
+
},
|
|
48
|
+
allowDocking: {
|
|
49
|
+
type: Boolean,
|
|
50
|
+
default: true,
|
|
51
|
+
},
|
|
52
|
+
allowDialogDocking: {
|
|
53
|
+
type: Boolean,
|
|
54
|
+
default: true,
|
|
55
|
+
},
|
|
56
|
+
allowMinimize: {
|
|
57
|
+
type: Boolean,
|
|
58
|
+
default: true,
|
|
59
|
+
},
|
|
60
|
+
allowMaximize: {
|
|
61
|
+
type: Boolean,
|
|
62
|
+
default: true,
|
|
63
|
+
},
|
|
64
|
+
floatingAutoResize: {
|
|
65
|
+
type: Boolean,
|
|
66
|
+
default: false,
|
|
67
|
+
},
|
|
68
|
+
confirmOnClose: {
|
|
69
|
+
type: Boolean,
|
|
70
|
+
default: false,
|
|
71
|
+
},
|
|
72
|
+
classNames: {
|
|
73
|
+
type: Object,
|
|
74
|
+
default: undefined,
|
|
75
|
+
},
|
|
76
|
+
styles: {
|
|
77
|
+
type: Object,
|
|
78
|
+
default: undefined,
|
|
79
|
+
},
|
|
80
|
+
challengeToken: {
|
|
81
|
+
type: String,
|
|
82
|
+
default: undefined,
|
|
83
|
+
},
|
|
84
|
+
requiresChallenge: {
|
|
85
|
+
type: Boolean,
|
|
86
|
+
default: false,
|
|
87
|
+
},
|
|
88
|
+
capWidgetOptions: {
|
|
89
|
+
type: Object,
|
|
90
|
+
default: undefined,
|
|
91
|
+
},
|
|
92
|
+
persist: {
|
|
93
|
+
type: [Boolean, Object],
|
|
94
|
+
default: undefined,
|
|
95
|
+
},
|
|
96
|
+
text: {
|
|
97
|
+
type: Object,
|
|
98
|
+
default: undefined,
|
|
99
|
+
},
|
|
100
|
+
theme: {
|
|
101
|
+
type: Object,
|
|
102
|
+
default: undefined,
|
|
103
|
+
},
|
|
104
|
+
debug: {
|
|
105
|
+
type: Boolean,
|
|
106
|
+
default: false,
|
|
107
|
+
},
|
|
108
|
+
};
|
|
109
|
+
const emits = {
|
|
110
|
+
session: (_status, _fork) => true,
|
|
111
|
+
output: (_output) => true,
|
|
112
|
+
forkActive: (_active) => true,
|
|
113
|
+
error: (_error) => true,
|
|
114
|
+
};
|
|
115
|
+
const component = defineComponent({
|
|
116
|
+
name: "AdaptAutomation",
|
|
117
|
+
inheritAttrs: false,
|
|
118
|
+
props,
|
|
119
|
+
emits,
|
|
120
|
+
setup(props, { emit, attrs }) {
|
|
121
|
+
const elementRef = ref(null);
|
|
122
|
+
// Sync non-serializable properties when element is mounted
|
|
123
|
+
const syncProperties = () => {
|
|
124
|
+
const el = elementRef.value;
|
|
125
|
+
if (!el)
|
|
126
|
+
return;
|
|
127
|
+
el.signals = props.signals;
|
|
128
|
+
el.capWidgetOptions = props.capWidgetOptions;
|
|
129
|
+
el.inheritFrom = props.inheritFrom;
|
|
130
|
+
el.classNames = props.classNames;
|
|
131
|
+
el.styles = props.styles;
|
|
132
|
+
el.persistOptions =
|
|
133
|
+
typeof props.persist === "object" ? props.persist : undefined;
|
|
134
|
+
el.text = props.text;
|
|
135
|
+
el.theme = props.theme;
|
|
136
|
+
el.onSessionCallback = (status, fork) => {
|
|
137
|
+
emit("session", status, fork);
|
|
138
|
+
};
|
|
139
|
+
el.onOutputCallback = (output) => {
|
|
140
|
+
emit("output", output);
|
|
141
|
+
};
|
|
142
|
+
el.onForkActiveCallback = (active) => {
|
|
143
|
+
emit("forkActive", active);
|
|
144
|
+
};
|
|
145
|
+
el.onErrorCallback = (error) => {
|
|
146
|
+
emit("error", error);
|
|
147
|
+
};
|
|
148
|
+
el.initialize();
|
|
149
|
+
};
|
|
150
|
+
watchEffect(() => {
|
|
151
|
+
syncProperties();
|
|
152
|
+
});
|
|
153
|
+
return () => h("adapt-automation", {
|
|
154
|
+
ref: elementRef,
|
|
155
|
+
"automation-id": props.automationId,
|
|
156
|
+
"session-token": props.sessionToken,
|
|
157
|
+
"auth-token": props.authToken,
|
|
158
|
+
transmitter: props.transmitter,
|
|
159
|
+
"challenge-token": props.challengeToken,
|
|
160
|
+
"requires-challenge": props.requiresChallenge ? "" : undefined,
|
|
161
|
+
"inherit-token": props.inheritToken,
|
|
162
|
+
"fork-display-mode": props.forkDisplay?.mode,
|
|
163
|
+
"side-by-side-split": props.forkDisplay?.mode === "side-by-side" &&
|
|
164
|
+
props.forkDisplay.split !== undefined
|
|
165
|
+
? String(props.forkDisplay.split)
|
|
166
|
+
: undefined,
|
|
167
|
+
"dark-mode": props.darkMode ? "" : undefined,
|
|
168
|
+
"auto-resizing": props.autoResizing ? "" : undefined,
|
|
169
|
+
"allow-floating": props.allowFloating === false ? "false" : undefined,
|
|
170
|
+
"allow-docking": props.allowDocking === false ? "false" : undefined,
|
|
171
|
+
"allow-dialog-docking": props.allowDialogDocking === false ? "false" : undefined,
|
|
172
|
+
"allow-minimize": props.allowMinimize === false ? "false" : undefined,
|
|
173
|
+
"allow-maximize": props.allowMaximize === false ? "false" : undefined,
|
|
174
|
+
"floating-auto-resize": props.floatingAutoResize ? "" : undefined,
|
|
175
|
+
"confirm-on-close": props.confirmOnClose ? "" : undefined,
|
|
176
|
+
persist: props.persist ? true : undefined,
|
|
177
|
+
debug: props.debug ? "" : undefined,
|
|
178
|
+
"data-adapt-signals": props.signals ? JSON.stringify(props.signals) : undefined,
|
|
179
|
+
"data-adapt-cap-widget-options": props.capWidgetOptions ? JSON.stringify(props.capWidgetOptions) : undefined,
|
|
180
|
+
"data-adapt-inherit-from": props.inheritFrom ? JSON.stringify(props.inheritFrom) : undefined,
|
|
181
|
+
"data-adapt-class-names": props.classNames ? JSON.stringify(props.classNames) : undefined,
|
|
182
|
+
"data-adapt-persist-options": typeof props.persist === "object" ? JSON.stringify(props.persist) : undefined,
|
|
183
|
+
"data-adapt-text": props.text ? JSON.stringify(props.text) : undefined,
|
|
184
|
+
"data-adapt-theme": props.theme ? JSON.stringify(props.theme) : undefined,
|
|
185
|
+
...attrs,
|
|
186
|
+
});
|
|
187
|
+
},
|
|
188
|
+
});
|
|
189
|
+
/**
|
|
190
|
+
* Vue component for embedding Adapt automations.
|
|
191
|
+
* Renders `<adapt-automation>` custom element and syncs non-serializable properties via ref.
|
|
192
|
+
*/
|
|
193
|
+
// Keep the public declaration on the DefineComponent parameters shared by Vue 3 minors.
|
|
194
|
+
export const AdaptAutomation = component;
|
|
195
|
+
export default AdaptAutomation;
|
package/dist/esm/AdaptCap.js
CHANGED
|
@@ -1,42 +1,48 @@
|
|
|
1
|
-
import
|
|
1
|
+
import "@mochabug/adapt-web/cap";
|
|
2
2
|
import { defineComponent, h, ref, watchEffect, } from "vue";
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
client: {
|
|
20
|
-
type: Object,
|
|
21
|
-
required: true,
|
|
22
|
-
},
|
|
23
|
-
workerCount: {
|
|
24
|
-
type: Number,
|
|
25
|
-
default: undefined,
|
|
26
|
-
},
|
|
27
|
-
i18n: {
|
|
28
|
-
type: Object,
|
|
29
|
-
default: undefined,
|
|
30
|
-
},
|
|
31
|
-
darkMode: {
|
|
32
|
-
type: Boolean,
|
|
33
|
-
default: false,
|
|
34
|
-
},
|
|
3
|
+
const props = {
|
|
4
|
+
automationId: {
|
|
5
|
+
type: String,
|
|
6
|
+
required: true,
|
|
7
|
+
},
|
|
8
|
+
client: {
|
|
9
|
+
type: Object,
|
|
10
|
+
required: true,
|
|
11
|
+
},
|
|
12
|
+
workerCount: {
|
|
13
|
+
type: Number,
|
|
14
|
+
default: undefined,
|
|
15
|
+
},
|
|
16
|
+
hiddenFieldName: {
|
|
17
|
+
type: String,
|
|
18
|
+
default: undefined,
|
|
35
19
|
},
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
20
|
+
troubleshootingUrl: {
|
|
21
|
+
type: String,
|
|
22
|
+
default: undefined,
|
|
39
23
|
},
|
|
24
|
+
disableHaptics: {
|
|
25
|
+
type: Boolean,
|
|
26
|
+
default: false,
|
|
27
|
+
},
|
|
28
|
+
i18n: {
|
|
29
|
+
type: Object,
|
|
30
|
+
default: undefined,
|
|
31
|
+
},
|
|
32
|
+
darkMode: {
|
|
33
|
+
type: Boolean,
|
|
34
|
+
default: false,
|
|
35
|
+
},
|
|
36
|
+
};
|
|
37
|
+
const emits = {
|
|
38
|
+
solve: (_token, _expires) => true,
|
|
39
|
+
error: (_error) => true,
|
|
40
|
+
};
|
|
41
|
+
const component = defineComponent({
|
|
42
|
+
name: "AdaptCap",
|
|
43
|
+
inheritAttrs: false,
|
|
44
|
+
props,
|
|
45
|
+
emits,
|
|
40
46
|
setup(props, { emit, attrs }) {
|
|
41
47
|
const elementRef = ref(null);
|
|
42
48
|
const syncProperties = () => {
|
|
@@ -62,8 +68,17 @@ export const AdaptCap = defineComponent({
|
|
|
62
68
|
"worker-count": props.workerCount !== undefined
|
|
63
69
|
? String(props.workerCount)
|
|
64
70
|
: undefined,
|
|
71
|
+
"hidden-field-name": props.hiddenFieldName,
|
|
72
|
+
"troubleshooting-url": props.troubleshootingUrl,
|
|
73
|
+
"disable-haptics": props.disableHaptics ? "" : undefined,
|
|
65
74
|
...attrs,
|
|
66
75
|
});
|
|
67
76
|
},
|
|
68
77
|
});
|
|
78
|
+
/**
|
|
79
|
+
* Vue component for Cap.js proof-of-work challenges.
|
|
80
|
+
* Renders `<adapt-cap>` custom element and syncs non-serializable properties via ref.
|
|
81
|
+
*/
|
|
82
|
+
// Keep the public declaration on the DefineComponent parameters shared by Vue 3 minors.
|
|
83
|
+
export const AdaptCap = component;
|
|
69
84
|
export default AdaptCap;
|
package/dist/esm/cap.js
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
// Cap entry — standalone Cap.js widget for Vue
|
|
2
|
+
import "@mochabug/adapt-web/cap";
|
|
3
|
+
export { AdaptCap, default } from "./AdaptCap.js";
|
|
4
|
+
export { Cap as AdaptCapWidget, createChallenge, redeemChallenge, AdaptCapElement, createConnectClient, } from "@mochabug/adapt-web/cap";
|
package/dist/esm/core.js
ADDED
package/dist/esm/index.js
CHANGED
|
@@ -1,148 +1,4 @@
|
|
|
1
|
-
import { AdaptAutomationElement, } from "@mochabug/adapt-web";
|
|
2
|
-
import { defineComponent, h, ref, watchEffect } from "vue";
|
|
3
1
|
// Re-export everything from web
|
|
4
2
|
export * from "@mochabug/adapt-web";
|
|
5
|
-
//
|
|
6
|
-
export {
|
|
7
|
-
// Ensure custom element is registered
|
|
8
|
-
void AdaptAutomationElement;
|
|
9
|
-
/**
|
|
10
|
-
* Vue component for embedding Adapt automations.
|
|
11
|
-
* Renders `<adapt-automation>` custom element and syncs non-serializable properties via ref.
|
|
12
|
-
*/
|
|
13
|
-
export const Adapt = defineComponent({
|
|
14
|
-
name: "Adapt",
|
|
15
|
-
inheritAttrs: false,
|
|
16
|
-
props: {
|
|
17
|
-
id: {
|
|
18
|
-
type: String,
|
|
19
|
-
required: true,
|
|
20
|
-
},
|
|
21
|
-
sessionToken: {
|
|
22
|
-
type: String,
|
|
23
|
-
default: undefined,
|
|
24
|
-
},
|
|
25
|
-
authToken: {
|
|
26
|
-
type: String,
|
|
27
|
-
default: undefined,
|
|
28
|
-
},
|
|
29
|
-
transmitter: {
|
|
30
|
-
type: String,
|
|
31
|
-
default: undefined,
|
|
32
|
-
},
|
|
33
|
-
signals: {
|
|
34
|
-
type: Object,
|
|
35
|
-
default: undefined,
|
|
36
|
-
},
|
|
37
|
-
inheritToken: {
|
|
38
|
-
type: String,
|
|
39
|
-
default: undefined,
|
|
40
|
-
},
|
|
41
|
-
inheritFrom: {
|
|
42
|
-
type: Object,
|
|
43
|
-
default: undefined,
|
|
44
|
-
},
|
|
45
|
-
forkDisplay: {
|
|
46
|
-
type: Object,
|
|
47
|
-
default: undefined,
|
|
48
|
-
},
|
|
49
|
-
darkMode: {
|
|
50
|
-
type: Boolean,
|
|
51
|
-
default: false,
|
|
52
|
-
},
|
|
53
|
-
autoResizing: {
|
|
54
|
-
type: Boolean,
|
|
55
|
-
default: false,
|
|
56
|
-
},
|
|
57
|
-
classNames: {
|
|
58
|
-
type: Object,
|
|
59
|
-
default: undefined,
|
|
60
|
-
},
|
|
61
|
-
styles: {
|
|
62
|
-
type: Object,
|
|
63
|
-
default: undefined,
|
|
64
|
-
},
|
|
65
|
-
challengeToken: {
|
|
66
|
-
type: String,
|
|
67
|
-
default: undefined,
|
|
68
|
-
},
|
|
69
|
-
requiresChallenge: {
|
|
70
|
-
type: Boolean,
|
|
71
|
-
default: false,
|
|
72
|
-
},
|
|
73
|
-
capWidgetOptions: {
|
|
74
|
-
type: Object,
|
|
75
|
-
default: undefined,
|
|
76
|
-
},
|
|
77
|
-
persist: {
|
|
78
|
-
type: [Boolean, Object],
|
|
79
|
-
default: undefined,
|
|
80
|
-
},
|
|
81
|
-
text: {
|
|
82
|
-
type: Object,
|
|
83
|
-
default: undefined,
|
|
84
|
-
},
|
|
85
|
-
},
|
|
86
|
-
emits: {
|
|
87
|
-
session: (_status, _fork) => true,
|
|
88
|
-
output: (_output) => true,
|
|
89
|
-
forkActive: (_active) => true,
|
|
90
|
-
},
|
|
91
|
-
setup(props, { emit, attrs }) {
|
|
92
|
-
const elementRef = ref(null);
|
|
93
|
-
// Sync non-serializable properties when element is mounted
|
|
94
|
-
const syncProperties = () => {
|
|
95
|
-
const el = elementRef.value;
|
|
96
|
-
if (!el)
|
|
97
|
-
return;
|
|
98
|
-
el.signals = props.signals;
|
|
99
|
-
el.capWidgetOptions = props.capWidgetOptions;
|
|
100
|
-
el.inheritFrom = props.inheritFrom;
|
|
101
|
-
el.classNames = props.classNames;
|
|
102
|
-
el.styles = props.styles;
|
|
103
|
-
el.persistOptions =
|
|
104
|
-
typeof props.persist === "object" ? props.persist : undefined;
|
|
105
|
-
el.text = props.text;
|
|
106
|
-
el.onSessionCallback = (status, fork) => {
|
|
107
|
-
emit("session", status, fork);
|
|
108
|
-
};
|
|
109
|
-
el.onOutputCallback = (output) => {
|
|
110
|
-
emit("output", output);
|
|
111
|
-
};
|
|
112
|
-
el.onForkActiveCallback = (active) => {
|
|
113
|
-
emit("forkActive", active);
|
|
114
|
-
};
|
|
115
|
-
};
|
|
116
|
-
watchEffect(() => {
|
|
117
|
-
syncProperties();
|
|
118
|
-
});
|
|
119
|
-
return () => h("adapt-automation", {
|
|
120
|
-
ref: elementRef,
|
|
121
|
-
"automation-id": props.id,
|
|
122
|
-
"session-token": props.sessionToken,
|
|
123
|
-
"auth-token": props.authToken,
|
|
124
|
-
transmitter: props.transmitter,
|
|
125
|
-
"challenge-token": props.challengeToken,
|
|
126
|
-
"requires-challenge": props.requiresChallenge ? "" : undefined,
|
|
127
|
-
"inherit-token": props.inheritToken,
|
|
128
|
-
"fork-display-mode": props.forkDisplay?.mode,
|
|
129
|
-
"side-by-side-split": props.forkDisplay?.mode === "side-by-side" &&
|
|
130
|
-
props.forkDisplay.split !== undefined
|
|
131
|
-
? String(props.forkDisplay.split)
|
|
132
|
-
: undefined,
|
|
133
|
-
"dialog-backdrop-close": props.forkDisplay?.mode === "dialog" &&
|
|
134
|
-
props.forkDisplay.backdropClose !== false
|
|
135
|
-
? ""
|
|
136
|
-
: undefined,
|
|
137
|
-
"dialog-resize-to-content": props.forkDisplay?.mode === "dialog" &&
|
|
138
|
-
props.forkDisplay.resizeToContent !== false
|
|
139
|
-
? ""
|
|
140
|
-
: undefined,
|
|
141
|
-
"dark-mode": props.darkMode ? "" : undefined,
|
|
142
|
-
"auto-resizing": props.autoResizing ? "" : undefined,
|
|
143
|
-
persist: props.persist ? "" : undefined,
|
|
144
|
-
...attrs,
|
|
145
|
-
});
|
|
146
|
-
},
|
|
147
|
-
});
|
|
148
|
-
export default Adapt;
|
|
3
|
+
// Re-export the Vue component
|
|
4
|
+
export { AdaptAutomation, default } from "./AdaptAutomation.js";
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
import type { AdaptError, AdaptTheme, AdaptWebClientOptions, ForkDisplay, Output, PersistOptions, SignalValue, StatusJson, StatusText } from "@mochabug/adapt-web/core";
|
|
2
|
+
import "@mochabug/adapt-web/core";
|
|
3
|
+
import { type ComponentOptionsMixin, type DefineComponent, type PropType } from "vue";
|
|
4
|
+
declare const props: {
|
|
5
|
+
readonly automationId: {
|
|
6
|
+
readonly type: StringConstructor;
|
|
7
|
+
readonly required: true;
|
|
8
|
+
};
|
|
9
|
+
readonly sessionToken: {
|
|
10
|
+
readonly type: StringConstructor;
|
|
11
|
+
readonly default: undefined;
|
|
12
|
+
};
|
|
13
|
+
readonly authToken: {
|
|
14
|
+
readonly type: StringConstructor;
|
|
15
|
+
readonly default: undefined;
|
|
16
|
+
};
|
|
17
|
+
readonly transmitter: {
|
|
18
|
+
readonly type: StringConstructor;
|
|
19
|
+
readonly default: undefined;
|
|
20
|
+
};
|
|
21
|
+
readonly signals: {
|
|
22
|
+
readonly type: PropType<{
|
|
23
|
+
[key: string]: SignalValue;
|
|
24
|
+
}>;
|
|
25
|
+
readonly default: undefined;
|
|
26
|
+
};
|
|
27
|
+
readonly inheritToken: {
|
|
28
|
+
readonly type: StringConstructor;
|
|
29
|
+
readonly default: undefined;
|
|
30
|
+
};
|
|
31
|
+
readonly inheritFrom: {
|
|
32
|
+
readonly type: PropType<{
|
|
33
|
+
hash: string;
|
|
34
|
+
} | {
|
|
35
|
+
param: string;
|
|
36
|
+
}>;
|
|
37
|
+
readonly default: undefined;
|
|
38
|
+
};
|
|
39
|
+
readonly forkDisplay: {
|
|
40
|
+
readonly type: PropType<ForkDisplay>;
|
|
41
|
+
readonly default: undefined;
|
|
42
|
+
};
|
|
43
|
+
readonly darkMode: {
|
|
44
|
+
readonly type: BooleanConstructor;
|
|
45
|
+
readonly default: false;
|
|
46
|
+
};
|
|
47
|
+
readonly autoResizing: {
|
|
48
|
+
readonly type: BooleanConstructor;
|
|
49
|
+
readonly default: false;
|
|
50
|
+
};
|
|
51
|
+
readonly allowFloating: {
|
|
52
|
+
readonly type: BooleanConstructor;
|
|
53
|
+
readonly default: true;
|
|
54
|
+
};
|
|
55
|
+
readonly allowDocking: {
|
|
56
|
+
readonly type: BooleanConstructor;
|
|
57
|
+
readonly default: true;
|
|
58
|
+
};
|
|
59
|
+
readonly allowDialogDocking: {
|
|
60
|
+
readonly type: BooleanConstructor;
|
|
61
|
+
readonly default: true;
|
|
62
|
+
};
|
|
63
|
+
readonly allowMinimize: {
|
|
64
|
+
readonly type: BooleanConstructor;
|
|
65
|
+
readonly default: true;
|
|
66
|
+
};
|
|
67
|
+
readonly allowMaximize: {
|
|
68
|
+
readonly type: BooleanConstructor;
|
|
69
|
+
readonly default: true;
|
|
70
|
+
};
|
|
71
|
+
readonly floatingAutoResize: {
|
|
72
|
+
readonly type: BooleanConstructor;
|
|
73
|
+
readonly default: false;
|
|
74
|
+
};
|
|
75
|
+
readonly confirmOnClose: {
|
|
76
|
+
readonly type: BooleanConstructor;
|
|
77
|
+
readonly default: false;
|
|
78
|
+
};
|
|
79
|
+
readonly classNames: {
|
|
80
|
+
readonly type: PropType<AdaptWebClientOptions["classNames"]>;
|
|
81
|
+
readonly default: undefined;
|
|
82
|
+
};
|
|
83
|
+
readonly styles: {
|
|
84
|
+
readonly type: PropType<Partial<CSSStyleDeclaration>>;
|
|
85
|
+
readonly default: undefined;
|
|
86
|
+
};
|
|
87
|
+
readonly challengeToken: {
|
|
88
|
+
readonly type: StringConstructor;
|
|
89
|
+
readonly default: undefined;
|
|
90
|
+
};
|
|
91
|
+
readonly requiresChallenge: {
|
|
92
|
+
readonly type: BooleanConstructor;
|
|
93
|
+
readonly default: false;
|
|
94
|
+
};
|
|
95
|
+
readonly capWidgetOptions: {
|
|
96
|
+
readonly type: PropType<AdaptWebClientOptions["capWidgetOptions"]>;
|
|
97
|
+
readonly default: undefined;
|
|
98
|
+
};
|
|
99
|
+
readonly persist: {
|
|
100
|
+
readonly type: PropType<boolean | PersistOptions>;
|
|
101
|
+
readonly default: undefined;
|
|
102
|
+
};
|
|
103
|
+
readonly text: {
|
|
104
|
+
readonly type: PropType<StatusText>;
|
|
105
|
+
readonly default: undefined;
|
|
106
|
+
};
|
|
107
|
+
readonly theme: {
|
|
108
|
+
readonly type: PropType<AdaptTheme>;
|
|
109
|
+
readonly default: undefined;
|
|
110
|
+
};
|
|
111
|
+
readonly debug: {
|
|
112
|
+
readonly type: BooleanConstructor;
|
|
113
|
+
readonly default: false;
|
|
114
|
+
};
|
|
115
|
+
};
|
|
116
|
+
declare const emits: {
|
|
117
|
+
session: (_status: StatusJson, _fork?: string) => boolean;
|
|
118
|
+
output: (_output: Output) => boolean;
|
|
119
|
+
forkActive: (_active: boolean) => boolean;
|
|
120
|
+
error: (_error: AdaptError) => boolean;
|
|
121
|
+
};
|
|
122
|
+
/**
|
|
123
|
+
* Vue component for embedding Adapt automations.
|
|
124
|
+
* Renders `<adapt-automation>` custom element and syncs non-serializable properties via ref.
|
|
125
|
+
*/
|
|
126
|
+
export declare const AdaptAutomation: DefineComponent<typeof props, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, typeof emits>;
|
|
127
|
+
export default AdaptAutomation;
|
package/dist/types/AdaptCap.d.ts
CHANGED
|
@@ -1,64 +1,48 @@
|
|
|
1
1
|
import type { AutomationClient } from "@mochabug/adapt-core";
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
|
|
2
|
+
import type { CapWidgetI18n } from "@mochabug/adapt-web/cap";
|
|
3
|
+
import "@mochabug/adapt-web/cap";
|
|
4
|
+
import { type ComponentOptionsMixin, type DefineComponent, type PropType } from "vue";
|
|
5
|
+
declare const props: {
|
|
6
|
+
readonly automationId: {
|
|
7
|
+
readonly type: StringConstructor;
|
|
8
|
+
readonly required: true;
|
|
9
|
+
};
|
|
10
|
+
readonly client: {
|
|
11
|
+
readonly type: PropType<AutomationClient>;
|
|
12
|
+
readonly required: true;
|
|
13
|
+
};
|
|
14
|
+
readonly workerCount: {
|
|
15
|
+
readonly type: NumberConstructor;
|
|
16
|
+
readonly default: undefined;
|
|
17
|
+
};
|
|
18
|
+
readonly hiddenFieldName: {
|
|
19
|
+
readonly type: StringConstructor;
|
|
20
|
+
readonly default: undefined;
|
|
21
|
+
};
|
|
22
|
+
readonly troubleshootingUrl: {
|
|
23
|
+
readonly type: StringConstructor;
|
|
24
|
+
readonly default: undefined;
|
|
25
|
+
};
|
|
26
|
+
readonly disableHaptics: {
|
|
27
|
+
readonly type: BooleanConstructor;
|
|
28
|
+
readonly default: false;
|
|
29
|
+
};
|
|
30
|
+
readonly i18n: {
|
|
31
|
+
readonly type: PropType<CapWidgetI18n>;
|
|
32
|
+
readonly default: undefined;
|
|
33
|
+
};
|
|
34
|
+
readonly darkMode: {
|
|
35
|
+
readonly type: BooleanConstructor;
|
|
36
|
+
readonly default: false;
|
|
37
|
+
};
|
|
38
|
+
};
|
|
39
|
+
declare const emits: {
|
|
40
|
+
solve: (_token: string, _expires: Date) => boolean;
|
|
41
|
+
error: (_error: Error) => boolean;
|
|
42
|
+
};
|
|
5
43
|
/**
|
|
6
44
|
* Vue component for Cap.js proof-of-work challenges.
|
|
7
45
|
* Renders `<adapt-cap>` custom element and syncs non-serializable properties via ref.
|
|
8
46
|
*/
|
|
9
|
-
export declare const AdaptCap:
|
|
10
|
-
automationId: {
|
|
11
|
-
type: StringConstructor;
|
|
12
|
-
required: true;
|
|
13
|
-
};
|
|
14
|
-
client: {
|
|
15
|
-
type: PropType<AutomationClient>;
|
|
16
|
-
required: true;
|
|
17
|
-
};
|
|
18
|
-
workerCount: {
|
|
19
|
-
type: NumberConstructor;
|
|
20
|
-
default: undefined;
|
|
21
|
-
};
|
|
22
|
-
i18n: {
|
|
23
|
-
type: PropType<CapWidgetI18n>;
|
|
24
|
-
default: undefined;
|
|
25
|
-
};
|
|
26
|
-
darkMode: {
|
|
27
|
-
type: BooleanConstructor;
|
|
28
|
-
default: boolean;
|
|
29
|
-
};
|
|
30
|
-
}>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
31
|
-
[key: string]: any;
|
|
32
|
-
}>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
33
|
-
solve: (_token: string, _expires: Date) => true;
|
|
34
|
-
error: (_error: Error) => true;
|
|
35
|
-
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
36
|
-
automationId: {
|
|
37
|
-
type: StringConstructor;
|
|
38
|
-
required: true;
|
|
39
|
-
};
|
|
40
|
-
client: {
|
|
41
|
-
type: PropType<AutomationClient>;
|
|
42
|
-
required: true;
|
|
43
|
-
};
|
|
44
|
-
workerCount: {
|
|
45
|
-
type: NumberConstructor;
|
|
46
|
-
default: undefined;
|
|
47
|
-
};
|
|
48
|
-
i18n: {
|
|
49
|
-
type: PropType<CapWidgetI18n>;
|
|
50
|
-
default: undefined;
|
|
51
|
-
};
|
|
52
|
-
darkMode: {
|
|
53
|
-
type: BooleanConstructor;
|
|
54
|
-
default: boolean;
|
|
55
|
-
};
|
|
56
|
-
}>> & Readonly<{
|
|
57
|
-
onSolve?: ((_token: string, _expires: Date) => any) | undefined;
|
|
58
|
-
onError?: ((_error: Error) => any) | undefined;
|
|
59
|
-
}>, {
|
|
60
|
-
workerCount: number;
|
|
61
|
-
i18n: CapWidgetI18n;
|
|
62
|
-
darkMode: boolean;
|
|
63
|
-
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
47
|
+
export declare const AdaptCap: DefineComponent<typeof props, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, typeof emits>;
|
|
64
48
|
export default AdaptCap;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import "@mochabug/adapt-web/cap";
|
|
2
|
+
export { AdaptCap, default } from "./AdaptCap.js";
|
|
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";
|