@forgerock/login-widget 1.0.0-beta.13 → 1.0.0-beta.15

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 CHANGED
@@ -1,3 +1,17 @@
1
+ # [1.0.0-beta.15](https://github.com/forgerock/forgerock-web-login-framework/compare/v1.0.0-beta.14...v1.0.0-beta.15) (2023-03-27)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * **login-failure:** handle 500 failures within login store ([90fb461](https://github.com/forgerock/forgerock-web-login-framework/commit/90fb461e2598f929e4b418c9794f8b085e433e54))
7
+
8
+ # [1.0.0-beta.14](https://github.com/forgerock/forgerock-web-login-framework/compare/v1.0.0-beta.13...v1.0.0-beta.14) (2023-03-27)
9
+
10
+
11
+ ### Bug Fixes
12
+
13
+ * **configuration:** improve handling and reporting of missing configuration ([a611623](https://github.com/forgerock/forgerock-web-login-framework/commit/a611623d7c33b0af18483ccad81a8725e461be65))
14
+
1
15
  # [1.0.0-beta.13](https://github.com/forgerock/forgerock-web-login-framework/compare/v1.0.0-beta.12...v1.0.0-beta.13) (2023-03-27)
2
16
 
3
17
 
@@ -8,25 +22,22 @@
8
22
 
9
23
  # [1.0.0-beta.12](https://github.com/forgerock/forgerock-web-login-framework/compare/v1.0.0-beta.11...v1.0.0-beta.12) (2023-03-27)
10
24
 
11
-
12
25
  ### Bug Fixes
13
26
 
14
- * **password:** fix password confirmation reset and validation failures ([181c67e](https://github.com/forgerock/forgerock-web-login-framework/commit/181c67e475f712a131383317707f3760af2d099d))
27
+ - **password:** fix password confirmation reset and validation failures ([181c67e](https://github.com/forgerock/forgerock-web-login-framework/commit/181c67e475f712a131383317707f3760af2d099d))
15
28
 
16
29
  # [1.0.0-beta.11](https://github.com/forgerock/forgerock-web-login-framework/compare/v1.0.0-beta.10...v1.0.0-beta.11) (2023-03-27)
17
30
 
18
-
19
31
  ### Bug Fixes
20
32
 
21
- * **style-e2e:** fix style for kba and fix e2e tests ([4d55431](https://github.com/forgerock/forgerock-web-login-framework/commit/4d55431a60ecdffea196dc8eb2c14d5f9c290e6c))
22
- * **style:** reworking application of headers and footers of widget ([bca81ca](https://github.com/forgerock/forgerock-web-login-framework/commit/bca81ca7286612c1ebe73151f8788ebdbda1d92a))
33
+ - **style-e2e:** fix style for kba and fix e2e tests ([4d55431](https://github.com/forgerock/forgerock-web-login-framework/commit/4d55431a60ecdffea196dc8eb2c14d5f9c290e6c))
34
+ - **style:** reworking application of headers and footers of widget ([bca81ca](https://github.com/forgerock/forgerock-web-login-framework/commit/bca81ca7286612c1ebe73151f8788ebdbda1d92a))
23
35
 
24
36
  # [1.0.0-beta.10](https://github.com/forgerock/forgerock-web-login-framework/compare/v1.0.0-beta.9...v1.0.0-beta.10) (2023-03-25)
25
37
 
26
-
27
38
  ### Bug Fixes
28
39
 
29
- * **index.svelte:** bind http client to request ([460a826](https://github.com/forgerock/forgerock-web-login-framework/commit/460a8269834be31e044fe1239db628b0c28d856b))
40
+ - **index.svelte:** bind http client to request ([460a826](https://github.com/forgerock/forgerock-web-login-framework/commit/460a8269834be31e044fe1239db628b0c28d856b))
30
41
 
31
42
  # [1.0.0-beta.9](https://github.com/forgerock/forgerock-web-login-framework/compare/v1.0.0-beta.8...v1.0.0-beta.9) (2023-03-21)
32
43
 
package/index.cjs CHANGED
@@ -16829,6 +16829,7 @@ var tryAgain = "Please try again";
16829
16829
  var twoFactorAuthentication = "Two factor authentication";
16830
16830
  var useValidEmail = "Please use a valid email address.";
16831
16831
  var unrecoverableError = "There was an error in the form submission.";
16832
+ var unknownLoginError = "Unknown login failure has occurred.";
16832
16833
  var unknownNetworkError = "Unknown network request failure has occurred.";
16833
16834
  var userName = "Username";
16834
16835
  var usernameRequirements = "Username requirements:";
@@ -16907,6 +16908,7 @@ var fallback = {
16907
16908
  twoFactorAuthentication: twoFactorAuthentication,
16908
16909
  useValidEmail: useValidEmail,
16909
16910
  unrecoverableError: unrecoverableError,
16911
+ unknownLoginError: unknownLoginError,
16910
16912
  unknownNetworkError: unknownNetworkError,
16911
16913
  userName: userName,
16912
16914
  usernameRequirements: usernameRequirements,
@@ -16988,6 +16990,7 @@ const stringsSchema = z
16988
16990
  twoFactorAuthentication: z.string(),
16989
16991
  useValidEmail: z.string(),
16990
16992
  unrecoverableError: z.string(),
16993
+ unknownLoginError: z.string(),
16991
16994
  unknownNetworkError: z.string(),
16992
16995
  userName: z.string(),
16993
16996
  usernameRequirements: z.string(),
@@ -17002,9 +17005,10 @@ stringsSchema.partial();
17002
17005
  stringsSchema.parse(fallback);
17003
17006
  const stringsStore = writable(null);
17004
17007
  /**
17005
- * initialize locale information for Login Widget
17006
- * @param: userLocale - optional locale object to override default locale
17007
- * @returns: a schema which represents the user locale schema
17008
+ * @function initialize - Initialize the locale store
17009
+ * @param {object} userLocale - An object of custom locale strings to merge with the default
17010
+ * @returns {object} - The locale store
17011
+ * @example initialize({ loginHeader: 'Welcome to the login page' });
17008
17012
  */
17009
17013
  function initialize$5(userLocale) {
17010
17014
  if (userLocale) {
@@ -17456,6 +17460,11 @@ function buildStepMetadata(callbackMetadataArray, stageJson, stageName) {
17456
17460
  };
17457
17461
  }
17458
17462
 
17463
+ /**
17464
+ * @function initializeJourney - Initializes the journey stack for tracking journey switches
17465
+ * @param {object} initOptions - The initial options to set
17466
+ * @returns {object} - The journey stack store with stack methods
17467
+ */
17459
17468
  function initializeStack(initOptions) {
17460
17469
  const initialValue = initOptions ? [initOptions] : [];
17461
17470
  const { update, set, subscribe } = writable(initialValue);
@@ -17519,6 +17528,11 @@ const journeyStore = writable({
17519
17528
  successful: false,
17520
17529
  response: null,
17521
17530
  });
17531
+ /**
17532
+ * @function initialize - Initializes the journey store
17533
+ * @param {object} initOptions - The initial options to set
17534
+ * @returns {object} - The journey store
17535
+ */
17522
17536
  function initialize$4(initOptions) {
17523
17537
  const stack = initializeStack();
17524
17538
  let stepNumber = 0;
@@ -17638,7 +17652,7 @@ function initialize$4(initOptions) {
17638
17652
  *
17639
17653
  * Grab failure message, which may contain encoded HTML
17640
17654
  */
17641
- const failureMessageStr = htmlDecode(nextStep.payload.message || '');
17655
+ const failureMessageStr = htmlDecode(nextStep.payload.message || 'Unknown login error');
17642
17656
  let restartedStep = null;
17643
17657
  try {
17644
17658
  /**
@@ -35411,7 +35425,7 @@ function create_else_block$1(ctx) {
35411
35425
  };
35412
35426
  }
35413
35427
 
35414
- // (53:36)
35428
+ // (56:52)
35415
35429
  function create_if_block_3(ctx) {
35416
35430
  let div;
35417
35431
  let spinner;
@@ -35452,7 +35466,7 @@ function create_if_block_3(ctx) {
35452
35466
  };
35453
35467
  }
35454
35468
 
35455
- // (27:0) {#if !$journeyStore?.completed}
35469
+ // (30:0) {#if $journeyStore && !$journeyStore.completed}
35456
35470
  function create_if_block$1(ctx) {
35457
35471
  let current_block_type_index;
35458
35472
  let if_block;
@@ -35462,8 +35476,8 @@ function create_if_block$1(ctx) {
35462
35476
  const if_blocks = [];
35463
35477
 
35464
35478
  function select_block_type_1(ctx, dirty) {
35465
- if (!/*$journeyStore*/ ctx[5].step) return 0;
35466
- if (/*$journeyStore*/ ctx[5].step.type === StepType$1.Step) return 1;
35479
+ if (/*$journeyStore*/ ctx[5] && !/*$journeyStore*/ ctx[5].step) return 0;
35480
+ if (/*$journeyStore*/ ctx[5].step?.type === StepType$1.Step) return 1;
35467
35481
  return -1;
35468
35482
  }
35469
35483
 
@@ -35539,7 +35553,7 @@ function create_if_block$1(ctx) {
35539
35553
  };
35540
35554
  }
35541
35555
 
35542
- // (58:2) <Alert id="unrecoverableStepError" needsFocus={alertNeedsFocus} type="error">
35556
+ // (61:2) <Alert id="unrecoverableStepError" needsFocus={alertNeedsFocus} type="error">
35543
35557
  function create_default_slot_1(ctx) {
35544
35558
  let t;
35545
35559
  let current;
@@ -35572,7 +35586,7 @@ function create_default_slot_1(ctx) {
35572
35586
  };
35573
35587
  }
35574
35588
 
35575
- // (61:2) <Button style="secondary" onClick={tryAgain}>
35589
+ // (64:2) <Button style="secondary" onClick={tryAgain}>
35576
35590
  function create_default_slot$1(ctx) {
35577
35591
  let t;
35578
35592
  let current;
@@ -35602,7 +35616,7 @@ function create_default_slot$1(ctx) {
35602
35616
  };
35603
35617
  }
35604
35618
 
35605
- // (32:54)
35619
+ // (35:55)
35606
35620
  function create_if_block_2(ctx) {
35607
35621
  let switch_instance;
35608
35622
  let updating_formEl;
@@ -35724,7 +35738,7 @@ function create_if_block_2(ctx) {
35724
35738
  };
35725
35739
  }
35726
35740
 
35727
- // (28:2) {#if !$journeyStore.step}
35741
+ // (31:2) {#if $journeyStore && !$journeyStore.step}
35728
35742
  function create_if_block_1(ctx) {
35729
35743
  let div;
35730
35744
  let spinner;
@@ -35774,8 +35788,8 @@ function create_fragment$1(ctx) {
35774
35788
  const if_blocks = [];
35775
35789
 
35776
35790
  function select_block_type(ctx, dirty) {
35777
- if (!/*$journeyStore*/ ctx[5]?.completed) return 0;
35778
- if (/*$journeyStore*/ ctx[5]?.successful) return 1;
35791
+ if (/*$journeyStore*/ ctx[5] && !/*$journeyStore*/ ctx[5].completed) return 0;
35792
+ if (/*$journeyStore*/ ctx[5] && /*$journeyStore*/ ctx[5].successful) return 1;
35779
35793
  return 2;
35780
35794
  }
35781
35795
 
@@ -35846,6 +35860,11 @@ function instance$1($$self, $$props, $$invalidate) {
35846
35860
  let { formEl = null } = $$props;
35847
35861
  let { journeyStore } = $$props;
35848
35862
  $$subscribe_journeyStore();
35863
+
35864
+ if (!$journeyStore) {
35865
+ console.error('Widget missing configuration. Import and call `configuration()`, then use `set()` to configure.');
35866
+ }
35867
+
35849
35868
  let alertNeedsFocus = false;
35850
35869
 
35851
35870
  function submitForm() {
@@ -35859,7 +35878,7 @@ function instance$1($$self, $$props, $$invalidate) {
35859
35878
  }
35860
35879
 
35861
35880
  afterUpdate(() => {
35862
- $$invalidate(4, alertNeedsFocus = !$journeyStore.successful);
35881
+ $$invalidate(4, alertNeedsFocus = $journeyStore && !$journeyStore.successful);
35863
35882
  });
35864
35883
 
35865
35884
  function switch_instance_formEl_binding(value) {