@ory/elements-react 1.0.0-pr.5494d7c2 → 1.0.0-pr.97a7df82
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/CHANGELOG.md +13 -0
- package/dist/index.js +145 -12
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +143 -10
- package/dist/index.mjs.map +1 -1
- package/dist/theme/default/index.js +102 -96
- package/dist/theme/default/index.js.map +1 -1
- package/dist/theme/default/index.mjs +11 -7
- package/dist/theme/default/index.mjs.map +1 -1
- package/package.json +1 -1
|
@@ -92,12 +92,12 @@ function DefaultCardContent({ children }) {
|
|
|
92
92
|
}
|
|
93
93
|
|
|
94
94
|
// src/theme/default/components/card/footer.tsx
|
|
95
|
-
var
|
|
95
|
+
var import_client_fetch29 = require("@ory/client-fetch");
|
|
96
96
|
var import_elements_react3 = require("@ory/elements-react");
|
|
97
97
|
var import_react_intl10 = require("react-intl");
|
|
98
98
|
|
|
99
99
|
// src/components/card/two-step/state-select-method.tsx
|
|
100
|
-
var
|
|
100
|
+
var import_client_fetch28 = require("@ory/client-fetch");
|
|
101
101
|
|
|
102
102
|
// src/context/component.tsx
|
|
103
103
|
var import_client_fetch = require("@ory/client-fetch");
|
|
@@ -297,46 +297,52 @@ function getSDKUrl() {
|
|
|
297
297
|
var import_react_intl8 = require("react-intl");
|
|
298
298
|
|
|
299
299
|
// src/components/form/form.tsx
|
|
300
|
-
var
|
|
300
|
+
var import_client_fetch16 = require("@ory/client-fetch");
|
|
301
301
|
var import_react_hook_form2 = require("react-hook-form");
|
|
302
302
|
var import_react_intl = require("react-intl");
|
|
303
303
|
|
|
304
304
|
// src/components/form/useOryFormSubmit.ts
|
|
305
|
-
var
|
|
305
|
+
var import_client_fetch15 = require("@ory/client-fetch");
|
|
306
306
|
var import_react_hook_form = require("react-hook-form");
|
|
307
307
|
|
|
308
308
|
// src/util/onSubmitLogin.ts
|
|
309
|
+
var import_client_fetch9 = require("@ory/client-fetch");
|
|
310
|
+
|
|
311
|
+
// src/util/sdk-helpers/error.ts
|
|
309
312
|
var import_client_fetch7 = require("@ory/client-fetch");
|
|
310
313
|
|
|
311
|
-
// src/util/
|
|
314
|
+
// src/util/sdk-helpers/utils.ts
|
|
312
315
|
var import_client_fetch8 = require("@ory/client-fetch");
|
|
313
316
|
|
|
317
|
+
// src/util/onSubmitRecovery.ts
|
|
318
|
+
var import_client_fetch10 = require("@ory/client-fetch");
|
|
319
|
+
|
|
314
320
|
// src/util/onSubmitRegistration.ts
|
|
315
|
-
var
|
|
321
|
+
var import_client_fetch11 = require("@ory/client-fetch");
|
|
316
322
|
|
|
317
323
|
// src/util/onSubmitSettings.ts
|
|
318
|
-
var
|
|
324
|
+
var import_client_fetch12 = require("@ory/client-fetch");
|
|
319
325
|
|
|
320
326
|
// src/util/onSubmitVerification.ts
|
|
321
|
-
var
|
|
327
|
+
var import_client_fetch13 = require("@ory/client-fetch");
|
|
322
328
|
|
|
323
329
|
// src/components/form/form-helpers.ts
|
|
324
|
-
var
|
|
330
|
+
var import_client_fetch14 = require("@ory/client-fetch");
|
|
325
331
|
|
|
326
332
|
// src/components/form/form.tsx
|
|
327
333
|
var import_jsx_runtime7 = require("react/jsx-runtime");
|
|
328
334
|
|
|
329
335
|
// src/components/form/groups.tsx
|
|
330
|
-
var
|
|
336
|
+
var import_client_fetch19 = require("@ory/client-fetch");
|
|
331
337
|
|
|
332
338
|
// src/components/form/nodes/input.tsx
|
|
333
|
-
var
|
|
339
|
+
var import_client_fetch17 = require("@ory/client-fetch");
|
|
334
340
|
var import_react6 = require("react");
|
|
335
341
|
var import_react_hook_form3 = require("react-hook-form");
|
|
336
342
|
var import_jsx_runtime8 = require("react/jsx-runtime");
|
|
337
343
|
|
|
338
344
|
// src/components/form/nodes/node.tsx
|
|
339
|
-
var
|
|
345
|
+
var import_client_fetch18 = require("@ory/client-fetch");
|
|
340
346
|
var import_jsx_runtime9 = require("react/jsx-runtime");
|
|
341
347
|
|
|
342
348
|
// src/components/form/groups.tsx
|
|
@@ -346,15 +352,15 @@ var import_jsx_runtime10 = require("react/jsx-runtime");
|
|
|
346
352
|
var import_jsx_runtime11 = require("react/jsx-runtime");
|
|
347
353
|
|
|
348
354
|
// src/components/form/social.tsx
|
|
349
|
-
var
|
|
355
|
+
var import_client_fetch22 = require("@ory/client-fetch");
|
|
350
356
|
var import_react_hook_form5 = require("react-hook-form");
|
|
351
357
|
|
|
352
358
|
// src/components/form/form-provider.tsx
|
|
353
|
-
var
|
|
359
|
+
var import_client_fetch21 = require("@ory/client-fetch");
|
|
354
360
|
var import_react_hook_form4 = require("react-hook-form");
|
|
355
361
|
|
|
356
362
|
// src/components/form/form-resolver.ts
|
|
357
|
-
var
|
|
363
|
+
var import_client_fetch20 = require("@ory/client-fetch");
|
|
358
364
|
|
|
359
365
|
// src/components/form/form-provider.tsx
|
|
360
366
|
var import_jsx_runtime12 = require("react/jsx-runtime");
|
|
@@ -367,14 +373,14 @@ var import_react_hook_form6 = require("react-hook-form");
|
|
|
367
373
|
var import_jsx_runtime14 = require("react/jsx-runtime");
|
|
368
374
|
|
|
369
375
|
// src/components/generic/divider.tsx
|
|
370
|
-
var
|
|
376
|
+
var import_client_fetch23 = require("@ory/client-fetch");
|
|
371
377
|
var import_jsx_runtime15 = require("react/jsx-runtime");
|
|
372
378
|
|
|
373
379
|
// src/components/generic/page-header.tsx
|
|
374
380
|
var import_jsx_runtime16 = require("react/jsx-runtime");
|
|
375
381
|
|
|
376
382
|
// src/components/settings/settings-card.tsx
|
|
377
|
-
var
|
|
383
|
+
var import_client_fetch24 = require("@ory/client-fetch");
|
|
378
384
|
var import_react_intl7 = require("react-intl");
|
|
379
385
|
|
|
380
386
|
// src/components/settings/oidc-settings.tsx
|
|
@@ -2814,11 +2820,11 @@ var import_jsx_runtime27 = require("react/jsx-runtime");
|
|
|
2814
2820
|
var import_jsx_runtime28 = require("react/jsx-runtime");
|
|
2815
2821
|
|
|
2816
2822
|
// src/components/card/two-step/state-method-active.tsx
|
|
2817
|
-
var
|
|
2823
|
+
var import_client_fetch25 = require("@ory/client-fetch");
|
|
2818
2824
|
var import_jsx_runtime29 = require("react/jsx-runtime");
|
|
2819
2825
|
|
|
2820
2826
|
// src/components/card/two-step/state-provide-identifier.tsx
|
|
2821
|
-
var
|
|
2827
|
+
var import_client_fetch26 = require("@ory/client-fetch");
|
|
2822
2828
|
var import_jsx_runtime30 = require("react/jsx-runtime");
|
|
2823
2829
|
|
|
2824
2830
|
// src/components/card/card-two-step.tsx
|
|
@@ -2826,7 +2832,7 @@ var import_elements_react = require("@ory/elements-react");
|
|
|
2826
2832
|
var import_jsx_runtime31 = require("react/jsx-runtime");
|
|
2827
2833
|
|
|
2828
2834
|
// src/components/card/card-consent.tsx
|
|
2829
|
-
var
|
|
2835
|
+
var import_client_fetch27 = require("@ory/client-fetch");
|
|
2830
2836
|
var import_jsx_runtime32 = require("react/jsx-runtime");
|
|
2831
2837
|
|
|
2832
2838
|
// src/components/card/two-step/state-select-method.tsx
|
|
@@ -2841,17 +2847,17 @@ var import_jsx_runtime33 = require("react/jsx-runtime");
|
|
|
2841
2847
|
var import_jsx_runtime34 = require("react/jsx-runtime");
|
|
2842
2848
|
function toAuthMethodPickerOptions(visibleGroups) {
|
|
2843
2849
|
return Object.fromEntries(
|
|
2844
|
-
Object.values(
|
|
2850
|
+
Object.values(import_client_fetch28.UiNodeGroupEnum).filter((group) => {
|
|
2845
2851
|
var _a;
|
|
2846
2852
|
return (_a = visibleGroups[group]) == null ? void 0 : _a.length;
|
|
2847
2853
|
}).filter(
|
|
2848
2854
|
(group) => ![
|
|
2849
|
-
|
|
2850
|
-
|
|
2851
|
-
|
|
2852
|
-
|
|
2853
|
-
|
|
2854
|
-
|
|
2855
|
+
import_client_fetch28.UiNodeGroupEnum.Oidc,
|
|
2856
|
+
import_client_fetch28.UiNodeGroupEnum.Saml,
|
|
2857
|
+
import_client_fetch28.UiNodeGroupEnum.Default,
|
|
2858
|
+
import_client_fetch28.UiNodeGroupEnum.IdentifierFirst,
|
|
2859
|
+
import_client_fetch28.UiNodeGroupEnum.Profile,
|
|
2860
|
+
import_client_fetch28.UiNodeGroupEnum.Captcha
|
|
2855
2861
|
].includes(group)
|
|
2856
2862
|
).map((g) => [g, {}])
|
|
2857
2863
|
);
|
|
@@ -2926,15 +2932,15 @@ var import_jsx_runtime35 = require("react/jsx-runtime");
|
|
|
2926
2932
|
function DefaultCardFooter() {
|
|
2927
2933
|
const oryFlow = (0, import_elements_react3.useOryFlow)();
|
|
2928
2934
|
switch (oryFlow.flowType) {
|
|
2929
|
-
case
|
|
2935
|
+
case import_client_fetch29.FlowType.Login:
|
|
2930
2936
|
return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(LoginCardFooter, {});
|
|
2931
|
-
case
|
|
2937
|
+
case import_client_fetch29.FlowType.Registration:
|
|
2932
2938
|
return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(RegistrationCardFooter, {});
|
|
2933
|
-
case
|
|
2939
|
+
case import_client_fetch29.FlowType.Recovery:
|
|
2934
2940
|
return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(RecoveryCardFooter, {});
|
|
2935
|
-
case
|
|
2941
|
+
case import_client_fetch29.FlowType.Verification:
|
|
2936
2942
|
return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(VerificationCardFooter, {});
|
|
2937
|
-
case
|
|
2943
|
+
case import_client_fetch29.FlowType.OAuth2Consent:
|
|
2938
2944
|
return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(ConsentCardFooter, { flow: oryFlow.flow });
|
|
2939
2945
|
default:
|
|
2940
2946
|
return null;
|
|
@@ -2961,7 +2967,7 @@ function LoginCardFooter() {
|
|
|
2961
2967
|
const { formState, flow, flowType, dispatchFormState } = (0, import_elements_react3.useOryFlow)();
|
|
2962
2968
|
const config = (0, import_elements_react3.useOryConfiguration)();
|
|
2963
2969
|
const intl = (0, import_react_intl10.useIntl)();
|
|
2964
|
-
if (flowType !==
|
|
2970
|
+
if (flowType !== import_client_fetch29.FlowType.Login) {
|
|
2965
2971
|
return null;
|
|
2966
2972
|
}
|
|
2967
2973
|
const authMethods = nodesToAuthMethodGroups(flow.ui.nodes);
|
|
@@ -3154,7 +3160,7 @@ function ConsentCardFooter({ flow }) {
|
|
|
3154
3160
|
var import_elements_react5 = require("@ory/elements-react");
|
|
3155
3161
|
|
|
3156
3162
|
// src/theme/default/utils/constructCardHeader.ts
|
|
3157
|
-
var
|
|
3163
|
+
var import_client_fetch30 = require("@ory/client-fetch");
|
|
3158
3164
|
var import_react_intl11 = require("react-intl");
|
|
3159
3165
|
function joinWithCommaOr(list, orText = "or") {
|
|
3160
3166
|
if (list.length === 0) {
|
|
@@ -3171,7 +3177,7 @@ function useCardHeaderText(container, opts) {
|
|
|
3171
3177
|
const nodes = container.nodes;
|
|
3172
3178
|
const intl = (0, import_react_intl11.useIntl)();
|
|
3173
3179
|
switch (opts.flowType) {
|
|
3174
|
-
case
|
|
3180
|
+
case import_client_fetch30.FlowType.Recovery:
|
|
3175
3181
|
if (nodes.find(
|
|
3176
3182
|
(node) => "name" in node.attributes && node.attributes.name === "code"
|
|
3177
3183
|
)) {
|
|
@@ -3193,7 +3199,7 @@ function useCardHeaderText(container, opts) {
|
|
|
3193
3199
|
id: "recovery.subtitle"
|
|
3194
3200
|
})
|
|
3195
3201
|
};
|
|
3196
|
-
case
|
|
3202
|
+
case import_client_fetch30.FlowType.Settings:
|
|
3197
3203
|
return {
|
|
3198
3204
|
title: intl.formatMessage({
|
|
3199
3205
|
id: "settings.title"
|
|
@@ -3202,7 +3208,7 @@ function useCardHeaderText(container, opts) {
|
|
|
3202
3208
|
id: "settings.subtitle"
|
|
3203
3209
|
})
|
|
3204
3210
|
};
|
|
3205
|
-
case
|
|
3211
|
+
case import_client_fetch30.FlowType.Verification:
|
|
3206
3212
|
if (nodes.find(
|
|
3207
3213
|
(node) => "name" in node.attributes && node.attributes.name === "code"
|
|
3208
3214
|
)) {
|
|
@@ -3224,7 +3230,7 @@ function useCardHeaderText(container, opts) {
|
|
|
3224
3230
|
id: "verification.subtitle"
|
|
3225
3231
|
})
|
|
3226
3232
|
};
|
|
3227
|
-
case
|
|
3233
|
+
case import_client_fetch30.FlowType.Login: {
|
|
3228
3234
|
const accountLinkingMessage = (_a = container.messages) == null ? void 0 : _a.find(
|
|
3229
3235
|
(m) => m.id === 1010016
|
|
3230
3236
|
);
|
|
@@ -3247,7 +3253,7 @@ function useCardHeaderText(container, opts) {
|
|
|
3247
3253
|
const parts = [];
|
|
3248
3254
|
if (nodes.find((node) => node.group === "password")) {
|
|
3249
3255
|
switch (opts.flowType) {
|
|
3250
|
-
case
|
|
3256
|
+
case import_client_fetch30.FlowType.Registration:
|
|
3251
3257
|
parts.push(
|
|
3252
3258
|
intl.formatMessage(
|
|
3253
3259
|
{ id: "card.header.parts.password.registration" },
|
|
@@ -3290,7 +3296,7 @@ function useCardHeaderText(container, opts) {
|
|
|
3290
3296
|
}
|
|
3291
3297
|
if (nodes.find((node) => node.group === "identifier_first")) {
|
|
3292
3298
|
const identifier = nodes.find(
|
|
3293
|
-
(node) => (0,
|
|
3299
|
+
(node) => (0, import_client_fetch30.isUiNodeInputAttributes)(node.attributes) && node.attributes.name.startsWith("identifier") && node.attributes.type !== "hidden"
|
|
3294
3300
|
);
|
|
3295
3301
|
if (identifier) {
|
|
3296
3302
|
parts.push(
|
|
@@ -3306,7 +3312,7 @@ function useCardHeaderText(container, opts) {
|
|
|
3306
3312
|
}
|
|
3307
3313
|
}
|
|
3308
3314
|
switch (opts.flowType) {
|
|
3309
|
-
case
|
|
3315
|
+
case import_client_fetch30.FlowType.Login:
|
|
3310
3316
|
if (opts.flow.refresh) {
|
|
3311
3317
|
return {
|
|
3312
3318
|
title: intl.formatMessage({
|
|
@@ -3347,7 +3353,7 @@ function useCardHeaderText(container, opts) {
|
|
|
3347
3353
|
}
|
|
3348
3354
|
) : ""
|
|
3349
3355
|
};
|
|
3350
|
-
case
|
|
3356
|
+
case import_client_fetch30.FlowType.Registration:
|
|
3351
3357
|
return {
|
|
3352
3358
|
title: intl.formatMessage({
|
|
3353
3359
|
id: "registration.title"
|
|
@@ -3364,7 +3370,7 @@ function useCardHeaderText(container, opts) {
|
|
|
3364
3370
|
}
|
|
3365
3371
|
) : ""
|
|
3366
3372
|
};
|
|
3367
|
-
case
|
|
3373
|
+
case import_client_fetch30.FlowType.OAuth2Consent:
|
|
3368
3374
|
return {
|
|
3369
3375
|
title: intl.formatMessage(
|
|
3370
3376
|
{
|
|
@@ -3391,7 +3397,7 @@ function useCardHeaderText(container, opts) {
|
|
|
3391
3397
|
}
|
|
3392
3398
|
|
|
3393
3399
|
// src/theme/default/components/card/current-identifier-button.tsx
|
|
3394
|
-
var
|
|
3400
|
+
var import_client_fetch31 = require("@ory/client-fetch");
|
|
3395
3401
|
var import_elements_react4 = require("@ory/elements-react");
|
|
3396
3402
|
var import_react8 = require("react");
|
|
3397
3403
|
var import_react_hook_form13 = require("react-hook-form");
|
|
@@ -3448,7 +3454,7 @@ function DefaultCurrentIdentifierButton() {
|
|
|
3448
3454
|
if (formState.current === "provide_identifier") {
|
|
3449
3455
|
return null;
|
|
3450
3456
|
}
|
|
3451
|
-
if (flowType ===
|
|
3457
|
+
if (flowType === import_client_fetch31.FlowType.Login && flow.requested_aal === "aal2") {
|
|
3452
3458
|
return null;
|
|
3453
3459
|
}
|
|
3454
3460
|
const nodeBackButton = getBackButtonNodeAttributes(flowType, ui.nodes);
|
|
@@ -3463,7 +3469,7 @@ function DefaultCurrentIdentifierButton() {
|
|
|
3463
3469
|
if (screenSelectionNode) {
|
|
3464
3470
|
return /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("form", { action: flow.ui.action, method: flow.ui.method, children: [
|
|
3465
3471
|
flow.ui.nodes.filter((n) => {
|
|
3466
|
-
if ((0,
|
|
3472
|
+
if ((0, import_client_fetch31.isUiNodeInputAttributes)(n.attributes)) {
|
|
3467
3473
|
return n.attributes.type === "hidden";
|
|
3468
3474
|
}
|
|
3469
3475
|
return false;
|
|
@@ -3541,18 +3547,18 @@ function getBackButtonNodeAttributes(flowType, nodes) {
|
|
|
3541
3547
|
var _a, _b;
|
|
3542
3548
|
let nodeBackButtonAttributes;
|
|
3543
3549
|
switch (flowType) {
|
|
3544
|
-
case
|
|
3550
|
+
case import_client_fetch31.FlowType.Login:
|
|
3545
3551
|
nodeBackButtonAttributes = (_a = nodes.find(
|
|
3546
|
-
(node) => (0,
|
|
3552
|
+
(node) => (0, import_client_fetch31.isUiNodeInputAttributes)(node.attributes) && node.attributes.name === "identifier" && ["default", "identifier_first"].includes(node.group)
|
|
3547
3553
|
)) == null ? void 0 : _a.attributes;
|
|
3548
3554
|
break;
|
|
3549
|
-
case
|
|
3555
|
+
case import_client_fetch31.FlowType.Registration:
|
|
3550
3556
|
nodeBackButtonAttributes = guessRegistrationBackButton(nodes);
|
|
3551
3557
|
break;
|
|
3552
|
-
case
|
|
3553
|
-
case
|
|
3558
|
+
case import_client_fetch31.FlowType.Recovery:
|
|
3559
|
+
case import_client_fetch31.FlowType.Verification:
|
|
3554
3560
|
nodeBackButtonAttributes = (_b = nodes.find(
|
|
3555
|
-
(n) => (0,
|
|
3561
|
+
(n) => (0, import_client_fetch31.isUiNodeInputAttributes)(n.attributes) && n.attributes.name === "email"
|
|
3556
3562
|
)) == null ? void 0 : _b.attributes;
|
|
3557
3563
|
break;
|
|
3558
3564
|
}
|
|
@@ -3569,7 +3575,7 @@ var backButtonCandiates = [
|
|
|
3569
3575
|
function guessRegistrationBackButton(uiNodes) {
|
|
3570
3576
|
var _a;
|
|
3571
3577
|
return (_a = uiNodes.find(
|
|
3572
|
-
(node) => (0,
|
|
3578
|
+
(node) => (0, import_client_fetch31.isUiNodeInputAttributes)(node.attributes) && backButtonCandiates.includes(node.attributes.name) && node.group === "default"
|
|
3573
3579
|
)) == null ? void 0 : _a.attributes;
|
|
3574
3580
|
}
|
|
3575
3581
|
|
|
@@ -3650,7 +3656,7 @@ function cn(...inputs) {
|
|
|
3650
3656
|
// src/theme/default/components/form/index.tsx
|
|
3651
3657
|
var import_react_intl13 = require("react-intl");
|
|
3652
3658
|
var import_elements_react8 = require("@ory/elements-react");
|
|
3653
|
-
var
|
|
3659
|
+
var import_client_fetch33 = require("@ory/client-fetch");
|
|
3654
3660
|
|
|
3655
3661
|
// src/theme/default/components/form/social.tsx
|
|
3656
3662
|
var import_elements_react7 = require("@ory/elements-react");
|
|
@@ -3873,7 +3879,7 @@ function Spinner({ className }) {
|
|
|
3873
3879
|
}
|
|
3874
3880
|
|
|
3875
3881
|
// src/theme/default/components/form/social.tsx
|
|
3876
|
-
var
|
|
3882
|
+
var import_client_fetch32 = require("@ory/client-fetch");
|
|
3877
3883
|
var import_jsx_runtime56 = require("react/jsx-runtime");
|
|
3878
3884
|
function extractProvider(context) {
|
|
3879
3885
|
if (context && typeof context === "object" && "provider" in context && typeof context.provider === "string") {
|
|
@@ -3900,7 +3906,7 @@ function DefaultButtonSocial({
|
|
|
3900
3906
|
formState: { isSubmitting }
|
|
3901
3907
|
} = (0, import_react_hook_form14.useFormContext)();
|
|
3902
3908
|
const oidcNodeCount = (_a = ui.nodes.filter(
|
|
3903
|
-
(node2) => node2.group ===
|
|
3909
|
+
(node2) => node2.group === import_client_fetch32.UiNodeGroupEnum.Oidc || node2.group === import_client_fetch32.UiNodeGroupEnum.Saml
|
|
3904
3910
|
).length) != null ? _a : 0;
|
|
3905
3911
|
const Logo = logos2[attributes.value.split("-")[0]];
|
|
3906
3912
|
const showLabel = _showLabel != null ? _showLabel : oidcNodeCount % 3 !== 0 && oidcNodeCount % 4 !== 0;
|
|
@@ -3991,7 +3997,7 @@ function DefaultMessageContainer({ children }) {
|
|
|
3991
3997
|
"section",
|
|
3992
3998
|
{
|
|
3993
3999
|
className: cn(
|
|
3994
|
-
flowType ===
|
|
4000
|
+
flowType === import_client_fetch33.FlowType.Settings ? "text-center" : "text-left"
|
|
3995
4001
|
),
|
|
3996
4002
|
children
|
|
3997
4003
|
}
|
|
@@ -4143,7 +4149,7 @@ function DefaultAuthMethodListItem({
|
|
|
4143
4149
|
}
|
|
4144
4150
|
|
|
4145
4151
|
// src/theme/default/components/form/button.tsx
|
|
4146
|
-
var
|
|
4152
|
+
var import_client_fetch34 = require("@ory/client-fetch");
|
|
4147
4153
|
var import_elements_react9 = require("@ory/elements-react");
|
|
4148
4154
|
var import_class_variance_authority = require("class-variance-authority");
|
|
4149
4155
|
var import_react_hook_form15 = require("react-hook-form");
|
|
@@ -4191,7 +4197,7 @@ var DefaultButton = ({
|
|
|
4191
4197
|
const { type, name, value, ...rest } = attributes;
|
|
4192
4198
|
const [clicked, setClicked] = (0, import_react10.useState)(false);
|
|
4193
4199
|
const intl = (0, import_react_intl15.useIntl)();
|
|
4194
|
-
const label = (0,
|
|
4200
|
+
const label = (0, import_client_fetch34.getNodeLabel)(node);
|
|
4195
4201
|
const {
|
|
4196
4202
|
formState: { isSubmitting },
|
|
4197
4203
|
setValue
|
|
@@ -4231,7 +4237,7 @@ var DefaultButton = ({
|
|
|
4231
4237
|
DefaultButton.displayName = "DefaultButton";
|
|
4232
4238
|
|
|
4233
4239
|
// src/theme/default/components/form/checkbox.tsx
|
|
4234
|
-
var
|
|
4240
|
+
var import_client_fetch35 = require("@ory/client-fetch");
|
|
4235
4241
|
var import_elements_react10 = require("@ory/elements-react");
|
|
4236
4242
|
var import_react_hook_form16 = require("react-hook-form");
|
|
4237
4243
|
var import_react_intl17 = require("react-intl");
|
|
@@ -4311,7 +4317,7 @@ var DefaultCheckbox = ({
|
|
|
4311
4317
|
}) => {
|
|
4312
4318
|
const { value, name, ...attributes } = initialAttributes;
|
|
4313
4319
|
const intl = (0, import_react_intl17.useIntl)();
|
|
4314
|
-
const label = (0,
|
|
4320
|
+
const label = (0, import_client_fetch35.getNodeLabel)(node);
|
|
4315
4321
|
const { register } = (0, import_react_hook_form16.useFormContext)();
|
|
4316
4322
|
const hasError = node.messages.some((m) => m.type === "error");
|
|
4317
4323
|
return /* @__PURE__ */ (0, import_jsx_runtime68.jsxs)("label", { className: "flex items-start gap-3 self-stretch antialiased", children: [
|
|
@@ -4352,7 +4358,7 @@ var DefaultCheckbox = ({
|
|
|
4352
4358
|
|
|
4353
4359
|
// src/theme/default/components/form/group-container.tsx
|
|
4354
4360
|
var import_elements_react11 = require("@ory/elements-react");
|
|
4355
|
-
var
|
|
4361
|
+
var import_client_fetch36 = require("@ory/client-fetch");
|
|
4356
4362
|
|
|
4357
4363
|
// src/util/childCounter.ts
|
|
4358
4364
|
var import_react11 = require("react");
|
|
@@ -4378,7 +4384,7 @@ function DefaultGroupContainer({ children }) {
|
|
|
4378
4384
|
{
|
|
4379
4385
|
className: cn(
|
|
4380
4386
|
"grid",
|
|
4381
|
-
flowType ===
|
|
4387
|
+
flowType === import_client_fetch36.FlowType.OAuth2Consent ? "grid-cols-2 gap-2" : "grid-cols-1 gap-8"
|
|
4382
4388
|
),
|
|
4383
4389
|
children
|
|
4384
4390
|
}
|
|
@@ -4405,7 +4411,7 @@ function DefaultImage({ attributes, node }) {
|
|
|
4405
4411
|
}
|
|
4406
4412
|
|
|
4407
4413
|
// src/theme/default/components/form/input.tsx
|
|
4408
|
-
var
|
|
4414
|
+
var import_client_fetch37 = require("@ory/client-fetch");
|
|
4409
4415
|
var import_elements_react12 = require("@ory/elements-react");
|
|
4410
4416
|
var import_react12 = require("react");
|
|
4411
4417
|
var import_react_hook_form17 = require("react-hook-form");
|
|
@@ -4447,7 +4453,7 @@ var DefaultInput = ({
|
|
|
4447
4453
|
attributes,
|
|
4448
4454
|
onClick
|
|
4449
4455
|
}) => {
|
|
4450
|
-
const label = (0,
|
|
4456
|
+
const label = (0, import_client_fetch37.getNodeLabel)(node);
|
|
4451
4457
|
const { register } = (0, import_react_hook_form17.useFormContext)();
|
|
4452
4458
|
const { value, autocomplete, name, maxlength, ...rest } = attributes;
|
|
4453
4459
|
const intl = (0, import_react_intl18.useIntl)();
|
|
@@ -4483,7 +4489,7 @@ var DefaultInput = ({
|
|
|
4483
4489
|
className: cn(
|
|
4484
4490
|
"relative flex justify-stretch",
|
|
4485
4491
|
// The settings flow input fields are supposed to be dense, so we don't need the extra padding we want on the user flows.
|
|
4486
|
-
flowType ===
|
|
4492
|
+
flowType === import_client_fetch37.FlowType.Settings && "max-w-[488px]"
|
|
4487
4493
|
),
|
|
4488
4494
|
children: [
|
|
4489
4495
|
/* @__PURE__ */ (0, import_jsx_runtime74.jsx)(
|
|
@@ -4531,7 +4537,7 @@ function PasswordToggle({
|
|
|
4531
4537
|
}
|
|
4532
4538
|
|
|
4533
4539
|
// src/theme/default/components/form/label.tsx
|
|
4534
|
-
var
|
|
4540
|
+
var import_client_fetch38 = require("@ory/client-fetch");
|
|
4535
4541
|
var import_elements_react13 = require("@ory/elements-react");
|
|
4536
4542
|
var import_react_hook_form18 = require("react-hook-form");
|
|
4537
4543
|
var import_react_intl19 = require("react-intl");
|
|
@@ -4548,7 +4554,7 @@ function DefaultLabel({
|
|
|
4548
4554
|
...rest
|
|
4549
4555
|
}) {
|
|
4550
4556
|
const intl = (0, import_react_intl19.useIntl)();
|
|
4551
|
-
const label = (0,
|
|
4557
|
+
const label = (0, import_client_fetch38.getNodeLabel)(node);
|
|
4552
4558
|
const { Message } = (0, import_elements_react13.useComponents)();
|
|
4553
4559
|
const { flowType, flow } = (0, import_elements_react13.useOryFlow)();
|
|
4554
4560
|
const config = (0, import_elements_react13.useOryConfiguration)();
|
|
@@ -4574,7 +4580,7 @@ function DefaultLabel({
|
|
|
4574
4580
|
children: (0, import_elements_react13.uiTextToFormattedMessage)(label, intl)
|
|
4575
4581
|
}
|
|
4576
4582
|
),
|
|
4577
|
-
isPassword && config.project.recovery_enabled && flowType ===
|
|
4583
|
+
isPassword && config.project.recovery_enabled && flowType === import_client_fetch38.FlowType.Login && // TODO: make it possible to override with a custom component
|
|
4578
4584
|
/* @__PURE__ */ (0, import_jsx_runtime75.jsx)(
|
|
4579
4585
|
"a",
|
|
4580
4586
|
{
|
|
@@ -4600,19 +4606,19 @@ function DefaultLabel({
|
|
|
4600
4606
|
] }),
|
|
4601
4607
|
children,
|
|
4602
4608
|
node.messages.map((message) => /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(Message.Content, { message }, message.id)),
|
|
4603
|
-
fieldError && (0,
|
|
4609
|
+
fieldError && (0, import_client_fetch38.instanceOfUiText)(fieldError) && /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(Message.Content, { message: fieldError })
|
|
4604
4610
|
] });
|
|
4605
4611
|
}
|
|
4606
4612
|
|
|
4607
4613
|
// src/theme/default/components/form/link-button.tsx
|
|
4608
|
-
var
|
|
4614
|
+
var import_client_fetch39 = require("@ory/client-fetch");
|
|
4609
4615
|
var import_elements_react14 = require("@ory/elements-react");
|
|
4610
4616
|
var import_react13 = require("react");
|
|
4611
4617
|
var import_react_intl20 = require("react-intl");
|
|
4612
4618
|
var import_jsx_runtime76 = require("react/jsx-runtime");
|
|
4613
4619
|
var DefaultLinkButton = (0, import_react13.forwardRef)(({ attributes, node }, ref) => {
|
|
4614
4620
|
const intl = (0, import_react_intl20.useIntl)();
|
|
4615
|
-
const label = (0,
|
|
4621
|
+
const label = (0, import_client_fetch39.getNodeLabel)(node);
|
|
4616
4622
|
return /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(
|
|
4617
4623
|
"a",
|
|
4618
4624
|
{
|
|
@@ -4676,7 +4682,7 @@ InputOTPSlot.displayName = "InputOTPSlot";
|
|
|
4676
4682
|
|
|
4677
4683
|
// src/theme/default/components/form/pin-code-input.tsx
|
|
4678
4684
|
var import_elements_react15 = require("@ory/elements-react");
|
|
4679
|
-
var
|
|
4685
|
+
var import_client_fetch40 = require("@ory/client-fetch");
|
|
4680
4686
|
var import_jsx_runtime78 = require("react/jsx-runtime");
|
|
4681
4687
|
var DefaultPinCodeInput = ({ attributes }) => {
|
|
4682
4688
|
const { setValue, watch } = (0, import_react_hook_form19.useFormContext)();
|
|
@@ -4700,7 +4706,7 @@ var DefaultPinCodeInput = ({ attributes }) => {
|
|
|
4700
4706
|
className: cn(
|
|
4701
4707
|
"w-full flex gap-2 justify-stretch",
|
|
4702
4708
|
// The settings flow input fields are supposed to be dense, so we don't need the extra padding we want on the user flows.
|
|
4703
|
-
flowType ===
|
|
4709
|
+
flowType === import_client_fetch40.FlowType.Settings && "max-w-[488px]"
|
|
4704
4710
|
),
|
|
4705
4711
|
children: [...Array(elements)].map((_, index) => /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(InputOTPSlot, { index }, index))
|
|
4706
4712
|
}
|
|
@@ -5521,7 +5527,7 @@ function DefaultAuthMethodListContainer({
|
|
|
5521
5527
|
}
|
|
5522
5528
|
|
|
5523
5529
|
// src/theme/default/components/form/captcha.tsx
|
|
5524
|
-
var
|
|
5530
|
+
var import_client_fetch41 = require("@ory/client-fetch");
|
|
5525
5531
|
var import_react_turnstile = require("@marsidev/react-turnstile");
|
|
5526
5532
|
var import_react17 = require("react");
|
|
5527
5533
|
var import_react_hook_form25 = require("react-hook-form");
|
|
@@ -5540,7 +5546,7 @@ var DefaultCaptcha = ({ node }) => {
|
|
|
5540
5546
|
}, 100);
|
|
5541
5547
|
}
|
|
5542
5548
|
}, [formState.submitCount, formState.isSubmitSuccessful]);
|
|
5543
|
-
if (!(0,
|
|
5549
|
+
if (!(0, import_client_fetch41.isUiNodeInputAttributes)(node.attributes)) {
|
|
5544
5550
|
return null;
|
|
5545
5551
|
}
|
|
5546
5552
|
if (node.attributes.name === "transient_payload.captcha_turnstile_response") {
|
|
@@ -5698,7 +5704,7 @@ function getOryComponents(overrides) {
|
|
|
5698
5704
|
}
|
|
5699
5705
|
|
|
5700
5706
|
// src/theme/default/flows/error.tsx
|
|
5701
|
-
var
|
|
5707
|
+
var import_client_fetch42 = require("@ory/client-fetch");
|
|
5702
5708
|
var import_elements_react22 = require("@ory/elements-react");
|
|
5703
5709
|
var import_react18 = require("react");
|
|
5704
5710
|
var import_react_intl24 = require("react-intl");
|
|
@@ -5721,14 +5727,14 @@ function useStandardize(error) {
|
|
|
5721
5727
|
timestamp: /* @__PURE__ */ new Date()
|
|
5722
5728
|
};
|
|
5723
5729
|
}
|
|
5724
|
-
if ((0,
|
|
5730
|
+
if ((0, import_client_fetch42.instanceOfFlowError)(error)) {
|
|
5725
5731
|
const parsed = error.error;
|
|
5726
5732
|
return {
|
|
5727
5733
|
...parsed,
|
|
5728
5734
|
id: error.id,
|
|
5729
5735
|
timestamp: error.created_at
|
|
5730
5736
|
};
|
|
5731
|
-
} else if (error.error && (0,
|
|
5737
|
+
} else if (error.error && (0, import_client_fetch42.instanceOfGenericError)(error.error)) {
|
|
5732
5738
|
return {
|
|
5733
5739
|
code: (_a = error.error.code) != null ? _a : 500,
|
|
5734
5740
|
message: error.error.message,
|
|
@@ -5852,7 +5858,7 @@ function ErrorLogo() {
|
|
|
5852
5858
|
}
|
|
5853
5859
|
|
|
5854
5860
|
// src/theme/default/flows/login.tsx
|
|
5855
|
-
var
|
|
5861
|
+
var import_client_fetch43 = require("@ory/client-fetch");
|
|
5856
5862
|
var import_elements_react23 = require("@ory/elements-react");
|
|
5857
5863
|
var import_jsx_runtime105 = require("react/jsx-runtime");
|
|
5858
5864
|
function Login({
|
|
@@ -5867,7 +5873,7 @@ function Login({
|
|
|
5867
5873
|
{
|
|
5868
5874
|
config,
|
|
5869
5875
|
flow,
|
|
5870
|
-
flowType:
|
|
5876
|
+
flowType: import_client_fetch43.FlowType.Login,
|
|
5871
5877
|
components,
|
|
5872
5878
|
children: children != null ? children : /* @__PURE__ */ (0, import_jsx_runtime105.jsx)(import_elements_react23.OryTwoStepCard, {})
|
|
5873
5879
|
}
|
|
@@ -5875,7 +5881,7 @@ function Login({
|
|
|
5875
5881
|
}
|
|
5876
5882
|
|
|
5877
5883
|
// src/theme/default/flows/recovery.tsx
|
|
5878
|
-
var
|
|
5884
|
+
var import_client_fetch44 = require("@ory/client-fetch");
|
|
5879
5885
|
var import_elements_react24 = require("@ory/elements-react");
|
|
5880
5886
|
var import_jsx_runtime106 = require("react/jsx-runtime");
|
|
5881
5887
|
function Recovery({
|
|
@@ -5890,7 +5896,7 @@ function Recovery({
|
|
|
5890
5896
|
{
|
|
5891
5897
|
config,
|
|
5892
5898
|
flow,
|
|
5893
|
-
flowType:
|
|
5899
|
+
flowType: import_client_fetch44.FlowType.Recovery,
|
|
5894
5900
|
components,
|
|
5895
5901
|
children: children != null ? children : /* @__PURE__ */ (0, import_jsx_runtime106.jsx)(import_elements_react24.OryTwoStepCard, {})
|
|
5896
5902
|
}
|
|
@@ -5898,7 +5904,7 @@ function Recovery({
|
|
|
5898
5904
|
}
|
|
5899
5905
|
|
|
5900
5906
|
// src/theme/default/flows/registration.tsx
|
|
5901
|
-
var
|
|
5907
|
+
var import_client_fetch45 = require("@ory/client-fetch");
|
|
5902
5908
|
var import_elements_react25 = require("@ory/elements-react");
|
|
5903
5909
|
var import_jsx_runtime107 = require("react/jsx-runtime");
|
|
5904
5910
|
function Registration({
|
|
@@ -5913,7 +5919,7 @@ function Registration({
|
|
|
5913
5919
|
{
|
|
5914
5920
|
config,
|
|
5915
5921
|
flow,
|
|
5916
|
-
flowType:
|
|
5922
|
+
flowType: import_client_fetch45.FlowType.Registration,
|
|
5917
5923
|
components,
|
|
5918
5924
|
children: children != null ? children : /* @__PURE__ */ (0, import_jsx_runtime107.jsx)(import_elements_react25.OryTwoStepCard, {})
|
|
5919
5925
|
}
|
|
@@ -5921,7 +5927,7 @@ function Registration({
|
|
|
5921
5927
|
}
|
|
5922
5928
|
|
|
5923
5929
|
// src/theme/default/flows/settings.tsx
|
|
5924
|
-
var
|
|
5930
|
+
var import_client_fetch46 = require("@ory/client-fetch");
|
|
5925
5931
|
var import_elements_react26 = require("@ory/elements-react");
|
|
5926
5932
|
var import_jsx_runtime108 = require("react/jsx-runtime");
|
|
5927
5933
|
function Settings({
|
|
@@ -5936,7 +5942,7 @@ function Settings({
|
|
|
5936
5942
|
{
|
|
5937
5943
|
config,
|
|
5938
5944
|
flow,
|
|
5939
|
-
flowType:
|
|
5945
|
+
flowType: import_client_fetch46.FlowType.Settings,
|
|
5940
5946
|
components,
|
|
5941
5947
|
children: children != null ? children : /* @__PURE__ */ (0, import_jsx_runtime108.jsxs)(import_jsx_runtime108.Fragment, { children: [
|
|
5942
5948
|
/* @__PURE__ */ (0, import_jsx_runtime108.jsx)(import_elements_react26.HeadlessPageHeader, {}),
|
|
@@ -5947,7 +5953,7 @@ function Settings({
|
|
|
5947
5953
|
}
|
|
5948
5954
|
|
|
5949
5955
|
// src/theme/default/flows/verification.tsx
|
|
5950
|
-
var
|
|
5956
|
+
var import_client_fetch47 = require("@ory/client-fetch");
|
|
5951
5957
|
var import_elements_react27 = require("@ory/elements-react");
|
|
5952
5958
|
var import_jsx_runtime109 = require("react/jsx-runtime");
|
|
5953
5959
|
function Verification({
|
|
@@ -5962,7 +5968,7 @@ function Verification({
|
|
|
5962
5968
|
{
|
|
5963
5969
|
config,
|
|
5964
5970
|
flow,
|
|
5965
|
-
flowType:
|
|
5971
|
+
flowType: import_client_fetch47.FlowType.Verification,
|
|
5966
5972
|
components,
|
|
5967
5973
|
children: children != null ? children : /* @__PURE__ */ (0, import_jsx_runtime109.jsx)(import_elements_react27.OryTwoStepCard, {})
|
|
5968
5974
|
}
|
|
@@ -5970,11 +5976,11 @@ function Verification({
|
|
|
5970
5976
|
}
|
|
5971
5977
|
|
|
5972
5978
|
// src/theme/default/flows/consent.tsx
|
|
5973
|
-
var
|
|
5979
|
+
var import_client_fetch49 = require("@ory/client-fetch");
|
|
5974
5980
|
var import_elements_react28 = require("@ory/elements-react");
|
|
5975
5981
|
|
|
5976
5982
|
// src/theme/default/utils/oauth2.ts
|
|
5977
|
-
var
|
|
5983
|
+
var import_client_fetch48 = require("@ory/client-fetch");
|
|
5978
5984
|
var rememberCheckbox = {
|
|
5979
5985
|
type: "input",
|
|
5980
5986
|
group: "oauth2_consent",
|
|
@@ -5982,7 +5988,7 @@ var rememberCheckbox = {
|
|
|
5982
5988
|
label: {
|
|
5983
5989
|
id: 9999111,
|
|
5984
5990
|
text: "Remember my decision",
|
|
5985
|
-
type:
|
|
5991
|
+
type: import_client_fetch48.UiTextTypeEnum.Info
|
|
5986
5992
|
}
|
|
5987
5993
|
},
|
|
5988
5994
|
attributes: {
|
|
@@ -6001,7 +6007,7 @@ var acceptButton = {
|
|
|
6001
6007
|
label: {
|
|
6002
6008
|
id: 9999111,
|
|
6003
6009
|
text: "Accept",
|
|
6004
|
-
type:
|
|
6010
|
+
type: import_client_fetch48.UiTextTypeEnum.Info
|
|
6005
6011
|
}
|
|
6006
6012
|
},
|
|
6007
6013
|
attributes: {
|
|
@@ -6020,7 +6026,7 @@ var rejectButton = {
|
|
|
6020
6026
|
label: {
|
|
6021
6027
|
id: 9999111,
|
|
6022
6028
|
text: "Reject",
|
|
6023
|
-
type:
|
|
6029
|
+
type: import_client_fetch48.UiTextTypeEnum.Info
|
|
6024
6030
|
}
|
|
6025
6031
|
},
|
|
6026
6032
|
attributes: {
|
|
@@ -6067,7 +6073,7 @@ function scopesToUiNodes(scopes) {
|
|
|
6067
6073
|
label: {
|
|
6068
6074
|
id: 9999111,
|
|
6069
6075
|
text: scope,
|
|
6070
|
-
type:
|
|
6076
|
+
type: import_client_fetch48.UiTextTypeEnum.Info
|
|
6071
6077
|
}
|
|
6072
6078
|
},
|
|
6073
6079
|
attributes: {
|
|
@@ -6134,7 +6140,7 @@ function Consent({
|
|
|
6134
6140
|
{
|
|
6135
6141
|
config,
|
|
6136
6142
|
flow,
|
|
6137
|
-
flowType:
|
|
6143
|
+
flowType: import_client_fetch49.FlowType.OAuth2Consent,
|
|
6138
6144
|
components,
|
|
6139
6145
|
children: children != null ? children : /* @__PURE__ */ (0, import_jsx_runtime110.jsx)(import_elements_react28.OryConsentCard, {})
|
|
6140
6146
|
}
|