@drawbridge/components 0.1.16 → 0.1.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.
- package/dist/bridge/form-subdomain-missions.js +43 -34
- package/dist/bridge/form-subdomain-missions.mjs +43 -34
- package/dist/dashboard/form-organization-campaign-agreement.js +2 -2
- package/dist/dashboard/form-organization-campaign-agreement.mjs +2 -2
- package/dist/dashboard/form-organization-workflow.js +521 -40
- package/dist/dashboard/form-organization-workflow.mjs +513 -40
- package/dist/dashboard/form-otc.js +7 -4
- package/dist/dashboard/form-otc.mjs +8 -5
- package/dist/dashboard/input-editor.js +46 -10
- package/dist/dashboard/input-editor.mjs +44 -9
- package/dist/dashboard/order-sections.js +23 -12
- package/dist/dashboard/order-sections.mjs +23 -12
- package/dist/dashboard/steps.js +5 -0
- package/dist/dashboard/steps.mjs +5 -0
- package/dist/dashboard/template-socket.js +6 -0
- package/dist/dashboard/template-socket.mjs +6 -0
- package/dist/input-code.js +2 -8
- package/dist/input-code.mjs +2 -8
- package/package.json +3 -3
- package/types/dashboard/form-organization-workflow.d.ts +44 -0
- package/types/dashboard/input-editor.d.ts +7 -1
- package/types/dashboard/steps.d.ts +2 -0
- package/types/input-code.d.ts +0 -2
|
@@ -43,10 +43,10 @@ var import_missions = require("@drawbridge/drawbridge-utils/missions");
|
|
|
43
43
|
var import_button = __toESM(require("../shared/button"));
|
|
44
44
|
var import_copy_to_clipboard = __toESM(require("../shared/copy-to-clipboard"));
|
|
45
45
|
var import_error = __toESM(require("../shared/error"));
|
|
46
|
+
var import_form = __toESM(require("../shared/form"));
|
|
46
47
|
var import_check = __toESM(require("../icons/check"));
|
|
47
48
|
var import_chevron_left = __toESM(require("../icons/chevron-left"));
|
|
48
49
|
var import_chevron_right = __toESM(require("../icons/chevron-right"));
|
|
49
|
-
var import_loader = __toESM(require("../icons/loader"));
|
|
50
50
|
var import_input_group = __toESM(require("../input-group"));
|
|
51
51
|
var import_input_code = __toESM(require("../input-code"));
|
|
52
52
|
var import_share_button = __toESM(require("./share-button"));
|
|
@@ -131,29 +131,54 @@ const Strong = ({ children, className }) => /* @__PURE__ */ (0, import_jsx_runti
|
|
|
131
131
|
children
|
|
132
132
|
}
|
|
133
133
|
);
|
|
134
|
-
const CodeStep = ({
|
|
134
|
+
const CodeStep = ({ busy, error, onSubmit, style }) => {
|
|
135
135
|
const [code, setCode] = (0, import_react.useState)("");
|
|
136
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.
|
|
137
|
-
|
|
136
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
137
|
+
import_form.default,
|
|
138
138
|
{
|
|
139
139
|
...{
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
140
|
+
className: "space-y-6",
|
|
141
|
+
onSubmit: (event) => {
|
|
142
|
+
event.preventDefault();
|
|
143
|
+
onSubmit(code);
|
|
144
|
+
}
|
|
145
|
+
},
|
|
146
|
+
children: [
|
|
147
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
148
|
+
import_input_group.default,
|
|
143
149
|
{
|
|
144
150
|
...{
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
+
error,
|
|
152
|
+
input: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
153
|
+
import_input_code.default,
|
|
154
|
+
{
|
|
155
|
+
...{
|
|
156
|
+
autoFocus: true,
|
|
157
|
+
disabled: busy,
|
|
158
|
+
onChange: setCode,
|
|
159
|
+
style,
|
|
160
|
+
value: code
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
),
|
|
164
|
+
label: "Verification code",
|
|
165
|
+
style
|
|
151
166
|
}
|
|
152
167
|
}
|
|
153
168
|
),
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
169
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
170
|
+
import_button.default,
|
|
171
|
+
{
|
|
172
|
+
...{
|
|
173
|
+
disabled: code.length !== 6,
|
|
174
|
+
loading: busy,
|
|
175
|
+
style,
|
|
176
|
+
type: "submit"
|
|
177
|
+
},
|
|
178
|
+
children: "Confirm"
|
|
179
|
+
}
|
|
180
|
+
)
|
|
181
|
+
]
|
|
157
182
|
}
|
|
158
183
|
);
|
|
159
184
|
};
|
|
@@ -288,30 +313,14 @@ const FormSubdomainMissions = ({
|
|
|
288
313
|
CodeStep,
|
|
289
314
|
{
|
|
290
315
|
...{
|
|
291
|
-
|
|
316
|
+
busy,
|
|
292
317
|
error,
|
|
293
|
-
|
|
318
|
+
onSubmit: confirm,
|
|
294
319
|
style
|
|
295
320
|
}
|
|
296
321
|
},
|
|
297
322
|
attempt
|
|
298
323
|
),
|
|
299
|
-
busy && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
300
|
-
"div",
|
|
301
|
-
{
|
|
302
|
-
...{
|
|
303
|
-
className: "flex justify-center"
|
|
304
|
-
},
|
|
305
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
306
|
-
import_loader.default,
|
|
307
|
-
{
|
|
308
|
-
...{
|
|
309
|
-
className: "w-5 h-5 animate-spin"
|
|
310
|
-
}
|
|
311
|
-
}
|
|
312
|
-
)
|
|
313
|
-
}
|
|
314
|
-
),
|
|
315
324
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
316
325
|
"p",
|
|
317
326
|
{
|
|
@@ -6,10 +6,10 @@ import { CODE_CHANNELS, COMPLETIONS, entriesText, missions as manifests } from "
|
|
|
6
6
|
import Button from "../shared/button.mjs";
|
|
7
7
|
import CopyToClipboard from "../shared/copy-to-clipboard.mjs";
|
|
8
8
|
import Error from "../shared/error.mjs";
|
|
9
|
+
import Form from "../shared/form.mjs";
|
|
9
10
|
import Check from "../icons/check.mjs";
|
|
10
11
|
import ChevronLeft from "../icons/chevron-left.mjs";
|
|
11
12
|
import ChevronRight from "../icons/chevron-right.mjs";
|
|
12
|
-
import Loader from "../icons/loader.mjs";
|
|
13
13
|
import InputGroup from "../input-group.mjs";
|
|
14
14
|
import InputCode from "../input-code.mjs";
|
|
15
15
|
import ShareButton from "./share-button.mjs";
|
|
@@ -94,29 +94,54 @@ const Strong = ({ children, className }) => /* @__PURE__ */ jsx(
|
|
|
94
94
|
children
|
|
95
95
|
}
|
|
96
96
|
);
|
|
97
|
-
const CodeStep = ({
|
|
97
|
+
const CodeStep = ({ busy, error, onSubmit, style }) => {
|
|
98
98
|
const [code, setCode] = useState("");
|
|
99
|
-
return /* @__PURE__ */
|
|
100
|
-
|
|
99
|
+
return /* @__PURE__ */ jsxs(
|
|
100
|
+
Form,
|
|
101
101
|
{
|
|
102
102
|
...{
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
103
|
+
className: "space-y-6",
|
|
104
|
+
onSubmit: (event) => {
|
|
105
|
+
event.preventDefault();
|
|
106
|
+
onSubmit(code);
|
|
107
|
+
}
|
|
108
|
+
},
|
|
109
|
+
children: [
|
|
110
|
+
/* @__PURE__ */ jsx(
|
|
111
|
+
InputGroup,
|
|
106
112
|
{
|
|
107
113
|
...{
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
+
error,
|
|
115
|
+
input: /* @__PURE__ */ jsx(
|
|
116
|
+
InputCode,
|
|
117
|
+
{
|
|
118
|
+
...{
|
|
119
|
+
autoFocus: true,
|
|
120
|
+
disabled: busy,
|
|
121
|
+
onChange: setCode,
|
|
122
|
+
style,
|
|
123
|
+
value: code
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
),
|
|
127
|
+
label: "Verification code",
|
|
128
|
+
style
|
|
114
129
|
}
|
|
115
130
|
}
|
|
116
131
|
),
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
132
|
+
/* @__PURE__ */ jsx(
|
|
133
|
+
Button,
|
|
134
|
+
{
|
|
135
|
+
...{
|
|
136
|
+
disabled: code.length !== 6,
|
|
137
|
+
loading: busy,
|
|
138
|
+
style,
|
|
139
|
+
type: "submit"
|
|
140
|
+
},
|
|
141
|
+
children: "Confirm"
|
|
142
|
+
}
|
|
143
|
+
)
|
|
144
|
+
]
|
|
120
145
|
}
|
|
121
146
|
);
|
|
122
147
|
};
|
|
@@ -251,30 +276,14 @@ const FormSubdomainMissions = ({
|
|
|
251
276
|
CodeStep,
|
|
252
277
|
{
|
|
253
278
|
...{
|
|
254
|
-
|
|
279
|
+
busy,
|
|
255
280
|
error,
|
|
256
|
-
|
|
281
|
+
onSubmit: confirm,
|
|
257
282
|
style
|
|
258
283
|
}
|
|
259
284
|
},
|
|
260
285
|
attempt
|
|
261
286
|
),
|
|
262
|
-
busy && /* @__PURE__ */ jsx(
|
|
263
|
-
"div",
|
|
264
|
-
{
|
|
265
|
-
...{
|
|
266
|
-
className: "flex justify-center"
|
|
267
|
-
},
|
|
268
|
-
children: /* @__PURE__ */ jsx(
|
|
269
|
-
Loader,
|
|
270
|
-
{
|
|
271
|
-
...{
|
|
272
|
-
className: "w-5 h-5 animate-spin"
|
|
273
|
-
}
|
|
274
|
-
}
|
|
275
|
-
)
|
|
276
|
-
}
|
|
277
|
-
),
|
|
278
287
|
/* @__PURE__ */ jsxs(
|
|
279
288
|
"p",
|
|
280
289
|
{
|
|
@@ -64,7 +64,7 @@ const FormOrganizationCampaignAgreement = ({
|
|
|
64
64
|
params
|
|
65
65
|
}) => {
|
|
66
66
|
const ids = Object.keys(agreements);
|
|
67
|
-
const { control, handleSubmit, formState, reset } = (0, import_form.useForm)({
|
|
67
|
+
const { control, getValues, handleSubmit, formState, reset } = (0, import_form.useForm)({
|
|
68
68
|
defaultValues: Object.fromEntries(ids.map((id) => {
|
|
69
69
|
var _a;
|
|
70
70
|
return [id, ((_a = agreements[id]) == null ? void 0 : _a.values) || {}];
|
|
@@ -106,7 +106,7 @@ const FormOrganizationCampaignAgreement = ({
|
|
|
106
106
|
});
|
|
107
107
|
}
|
|
108
108
|
;
|
|
109
|
-
reset(
|
|
109
|
+
reset(getValues());
|
|
110
110
|
if (response) onSuccess(response);
|
|
111
111
|
} catch (error) {
|
|
112
112
|
onError(error);
|
|
@@ -32,7 +32,7 @@ const FormOrganizationCampaignAgreement = ({
|
|
|
32
32
|
params
|
|
33
33
|
}) => {
|
|
34
34
|
const ids = Object.keys(agreements);
|
|
35
|
-
const { control, handleSubmit, formState, reset } = useForm({
|
|
35
|
+
const { control, getValues, handleSubmit, formState, reset } = useForm({
|
|
36
36
|
defaultValues: Object.fromEntries(ids.map((id) => {
|
|
37
37
|
var _a;
|
|
38
38
|
return [id, ((_a = agreements[id]) == null ? void 0 : _a.values) || {}];
|
|
@@ -74,7 +74,7 @@ const FormOrganizationCampaignAgreement = ({
|
|
|
74
74
|
});
|
|
75
75
|
}
|
|
76
76
|
;
|
|
77
|
-
reset(
|
|
77
|
+
reset(getValues());
|
|
78
78
|
if (response) onSuccess(response);
|
|
79
79
|
} catch (error) {
|
|
80
80
|
onError(error);
|