@aws-amplify/ui-vue 4.4.5 → 4.4.7

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.js CHANGED
@@ -9369,7 +9369,10 @@ function Pv(t) {
9369
9369
  src: "handleGetCurrentUser",
9370
9370
  onDone: { actions: "setUser", target: "setup" },
9371
9371
  onError: { target: "setup" }
9372
- }
9372
+ },
9373
+ // handle a sign out occurring while `handleGetCurrentUser` is in flight,
9374
+ // exiting cancels the invoke so a stale user cannot be applied
9375
+ on: { SIGN_OUT: "#authenticator.signOut" }
9373
9376
  },
9374
9377
  setup: {
9375
9378
  initial: "initConfig",
@@ -9414,7 +9417,8 @@ function Pv(t) {
9414
9417
  target: "#authenticator.authenticated"
9415
9418
  },
9416
9419
  onError: { target: "#authenticator.setup" }
9417
- }
9420
+ },
9421
+ on: { SIGN_OUT: "#authenticator.signOut" }
9418
9422
  },
9419
9423
  signInActor: {
9420
9424
  initial: "spawnActor",
@@ -9568,6 +9572,14 @@ function Pv(t) {
9568
9572
  }
9569
9573
  },
9570
9574
  on: {
9575
+ // `SIGN_OUT` handled by `setup.initConfig` moves the machine past setup without
9576
+ // the UI ever sending `INIT`, leaving it configured with defaults. Accept `INIT`
9577
+ // late so a subsequently rendered UI can still apply its `config` and `services`.
9578
+ INIT: {
9579
+ cond: "shouldInitialize",
9580
+ actions: "configure",
9581
+ target: "#authenticator.setup.getConfig"
9582
+ },
9571
9583
  SIGN_IN_WITH_REDIRECT: { target: "#authenticator.getCurrentUser" },
9572
9584
  CHANGE: { actions: "forwardToActor" },
9573
9585
  BLUR: { actions: "forwardToActor" },
@@ -9645,7 +9657,8 @@ function Pv(t) {
9645
9657
  const { services: a, ...s } = Pf(r) ? o.data ?? {} : r;
9646
9658
  return {
9647
9659
  services: { ...et, ...a },
9648
- config: s
9660
+ config: s,
9661
+ hasInitialized: !0
9649
9662
  };
9650
9663
  }),
9651
9664
  setHasSetup: Be({ hasSetup: !0 })
@@ -9656,6 +9669,9 @@ function Pv(t) {
9656
9669
  isInitialStateSignUp: ({ config: i }) => i.initialState === "signUp",
9657
9670
  isInitialStateResetPassword: ({ config: i }) => i.initialState === "forgotPassword",
9658
9671
  shouldSetup: ({ hasSetup: i }) => !i,
9672
+ // `hasSetup` prevents the late `INIT` from interrupting `idle`, which must
9673
+ // resolve `handleGetCurrentUser` before the machine leaves it
9674
+ shouldInitialize: ({ hasSetup: i, hasInitialized: o }) => i && !o,
9659
9675
  hasUser: ({ user: i }) => !!i
9660
9676
  },
9661
9677
  services: {
@@ -10805,7 +10821,7 @@ const r_ = /* @__PURE__ */ hr(e_, [["render", t_]]), n_ = ["tabindex", "aria-sel
10805
10821
  role: "tab"
10806
10822
  }, q(v(i)), 11, n_));
10807
10823
  }
10808
- }), o_ = "4.4.5", a_ = {};
10824
+ }), o_ = "4.4.7", a_ = {};
10809
10825
  function s_(t, e) {
10810
10826
  return U(t.$slots, "textI", ne(ie(t.$attrs)), () => [
10811
10827
  G("span", Ee(t.$attrs, { "data-amplify-text": "" }), [