@ory/elements-react 1.0.0-next.33 → 1.0.0-next.36

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/index.mjs CHANGED
@@ -262,17 +262,24 @@ function parseStateFromFlow(flow) {
262
262
  );
263
263
  throw new Error("Unknown form state");
264
264
  }
265
- function formStateReducer(state, action) {
266
- switch (action.type) {
267
- case "action_flow_update":
268
- return parseStateFromFlow(action.flow);
269
- case "action_select_method":
270
- return { current: "method_active", method: action.method };
271
- }
272
- return state;
273
- }
274
265
  function useFormStateReducer(flow) {
275
- return useReducer(formStateReducer, parseStateFromFlow(flow));
266
+ const action = parseStateFromFlow(flow);
267
+ const [selectedMethod, setSelectedMethod] = useState();
268
+ const formStateReducer = (state, action2) => {
269
+ switch (action2.type) {
270
+ case "action_flow_update": {
271
+ if (selectedMethod)
272
+ return { current: "method_active", method: selectedMethod };
273
+ return parseStateFromFlow(action2.flow);
274
+ }
275
+ case "action_select_method": {
276
+ setSelectedMethod(action2.method);
277
+ return { current: "method_active", method: action2.method };
278
+ }
279
+ }
280
+ return state;
281
+ };
282
+ return useReducer(formStateReducer, action);
276
283
  }
277
284
  function useOryFlow() {
278
285
  const ctx = useContext(OryFlowContext);
@@ -2001,7 +2008,13 @@ var en_default = {
2001
2008
  "property.phone": "phone",
2002
2009
  "property.username": "username",
2003
2010
  "property.identifier": "identifier",
2004
- "property.code": "code"
2011
+ "property.code": "code",
2012
+ "error.title.what-happened": "What happened?",
2013
+ "error.title.what-can-i-do": "What can I do?",
2014
+ "error.instructions": "Please try again in a few minutes or contact the website operator.",
2015
+ "error.footer.text": "When reporting this error, please include the following information:",
2016
+ "error.footer.copy": "Copy",
2017
+ "error.action.go-back": "Go back"
2005
2018
  };
2006
2019
 
2007
2020
  // src/locales/de.json
@@ -2266,7 +2279,13 @@ var de_default = {
2266
2279
  "property.password": "Passwort",
2267
2280
  "property.phone": "Telefon",
2268
2281
  "property.code": "Code",
2269
- "property.username": "Benutzername"
2282
+ "property.username": "Benutzername",
2283
+ "error.title.what-happened": "Was ist passiert?",
2284
+ "error.footer.copy": "Kopieren",
2285
+ "error.footer.text": "Bitte f\xFCgen Sie bei der Meldung dieses Fehlers die folgenden Informationen hinzu:",
2286
+ "error.instructions": "Bitte versuchen Sie es in wenigen Minuten erneut oder wenden Sie sich an den Website-Betreiber.",
2287
+ "error.title.what-can-i-do": "Was kann ich tun?",
2288
+ "error.action.go-back": "Zur\xFCck"
2270
2289
  };
2271
2290
 
2272
2291
  // src/locales/es.json
@@ -2282,7 +2301,7 @@ var es_default = {
2282
2301
  "error.back-button": "Regresar",
2283
2302
  "error.description": "Ocurri\xF3 un error con el siguiente mensaje:",
2284
2303
  "error.support-email-link": "Si el problema persiste, por favor contacte a <a>{contactSupportEmail}</a>",
2285
- "error.title": "Ocurri\xF3 un error",
2304
+ "error.title": "",
2286
2305
  "error.title-internal-server-error": "Error Interno del Servidor",
2287
2306
  "error.title-not-found": "404 - P\xE1gina no encontrada",
2288
2307
  "identities.messages.1010001": "Iniciar sesi\xF3n",
@@ -2531,7 +2550,13 @@ var es_default = {
2531
2550
  "property.identifier": "",
2532
2551
  "property.password": "",
2533
2552
  "property.phone": "",
2534
- "property.username": ""
2553
+ "property.username": "",
2554
+ "error.action.go-back": "",
2555
+ "error.footer.copy": "",
2556
+ "error.footer.text": "",
2557
+ "error.instructions": "",
2558
+ "error.title.what-can-i-do": "",
2559
+ "error.title.what-happened": ""
2535
2560
  };
2536
2561
 
2537
2562
  // src/locales/fr.json
@@ -2796,7 +2821,13 @@ var fr_default = {
2796
2821
  "property.identifier": "",
2797
2822
  "property.password": "",
2798
2823
  "property.phone": "",
2799
- "property.username": ""
2824
+ "property.username": "",
2825
+ "error.action.go-back": "",
2826
+ "error.footer.copy": "",
2827
+ "error.footer.text": "",
2828
+ "error.title.what-can-i-do": "",
2829
+ "error.title.what-happened": "",
2830
+ "error.instructions": ""
2800
2831
  };
2801
2832
 
2802
2833
  // src/locales/nl.json
@@ -3061,7 +3092,13 @@ var nl_default = {
3061
3092
  "property.identifier": "",
3062
3093
  "property.password": "",
3063
3094
  "property.phone": "",
3064
- "property.username": ""
3095
+ "property.username": "",
3096
+ "error.action.go-back": "",
3097
+ "error.footer.copy": "",
3098
+ "error.footer.text": "",
3099
+ "error.title.what-can-i-do": "",
3100
+ "error.title.what-happened": "",
3101
+ "error.instructions": ""
3065
3102
  };
3066
3103
 
3067
3104
  // src/locales/pl.json
@@ -3326,7 +3363,13 @@ var pl_default = {
3326
3363
  "property.password": "",
3327
3364
  "property.phone": "",
3328
3365
  "property.username": "",
3329
- "property.identifier": ""
3366
+ "property.identifier": "",
3367
+ "error.action.go-back": "",
3368
+ "error.footer.copy": "",
3369
+ "error.footer.text": "",
3370
+ "error.title.what-can-i-do": "",
3371
+ "error.title.what-happened": "",
3372
+ "error.instructions": ""
3330
3373
  };
3331
3374
 
3332
3375
  // src/locales/pt.json
@@ -3591,7 +3634,13 @@ var pt_default = {
3591
3634
  "property.identifier": "",
3592
3635
  "property.password": "",
3593
3636
  "property.phone": "",
3594
- "property.username": ""
3637
+ "property.username": "",
3638
+ "error.action.go-back": "",
3639
+ "error.footer.copy": "",
3640
+ "error.footer.text": "",
3641
+ "error.title.what-can-i-do": "",
3642
+ "error.title.what-happened": "",
3643
+ "error.instructions": ""
3595
3644
  };
3596
3645
 
3597
3646
  // src/locales/sv.json
@@ -3856,7 +3905,13 @@ var sv_default = {
3856
3905
  "property.phone": "telefon",
3857
3906
  "property.username": "anv\xE4ndarnamn",
3858
3907
  "property.identifier": "identifier",
3859
- "property.code": "kod"
3908
+ "property.code": "kod",
3909
+ "error.action.go-back": "",
3910
+ "error.footer.copy": "",
3911
+ "error.footer.text": "",
3912
+ "error.title.what-can-i-do": "",
3913
+ "error.title.what-happened": "",
3914
+ "error.instructions": ""
3860
3915
  };
3861
3916
 
3862
3917
  // src/locales/index.ts