@aws-amplify/ui 6.15.5 → 6.15.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.
@@ -73,6 +73,9 @@ function createAuthenticatorMachine(options) {
73
73
  onDone: { actions: 'setUser', target: 'setup' },
74
74
  onError: { target: 'setup' },
75
75
  },
76
+ // handle a sign out occurring while `handleGetCurrentUser` is in flight,
77
+ // exiting cancels the invoke so a stale user cannot be applied
78
+ on: { SIGN_OUT: '#authenticator.signOut' },
76
79
  },
77
80
  setup: {
78
81
  initial: 'initConfig',
@@ -118,6 +121,7 @@ function createAuthenticatorMachine(options) {
118
121
  },
119
122
  onError: { target: '#authenticator.setup' },
120
123
  },
124
+ on: { SIGN_OUT: '#authenticator.signOut' },
121
125
  },
122
126
  signInActor: {
123
127
  initial: 'spawnActor',
@@ -271,6 +275,14 @@ function createAuthenticatorMachine(options) {
271
275
  },
272
276
  },
273
277
  on: {
278
+ // `SIGN_OUT` handled by `setup.initConfig` moves the machine past setup without
279
+ // the UI ever sending `INIT`, leaving it configured with defaults. Accept `INIT`
280
+ // late so a subsequently rendered UI can still apply its `config` and `services`.
281
+ INIT: {
282
+ cond: 'shouldInitialize',
283
+ actions: 'configure',
284
+ target: '#authenticator.setup.getConfig',
285
+ },
274
286
  SIGN_IN_WITH_REDIRECT: { target: '#authenticator.getCurrentUser' },
275
287
  CHANGE: { actions: 'forwardToActor' },
276
288
  BLUR: { actions: 'forwardToActor' },
@@ -362,6 +374,7 @@ function createAuthenticatorMachine(options) {
362
374
  return {
363
375
  services: { ...defaultServices, ...customServices },
364
376
  config,
377
+ hasInitialized: true,
365
378
  };
366
379
  }),
367
380
  setHasSetup: assign({ hasSetup: true }),
@@ -372,6 +385,9 @@ function createAuthenticatorMachine(options) {
372
385
  isInitialStateSignUp: ({ config }) => config.initialState === 'signUp',
373
386
  isInitialStateResetPassword: ({ config }) => config.initialState === 'forgotPassword',
374
387
  shouldSetup: ({ hasSetup }) => !hasSetup,
388
+ // `hasSetup` prevents the late `INIT` from interrupting `idle`, which must
389
+ // resolve `handleGetCurrentUser` before the machine leaves it
390
+ shouldInitialize: ({ hasSetup, hasInitialized }) => hasSetup && !hasInitialized,
375
391
  hasUser: ({ user }) => {
376
392
  return !!user;
377
393
  },
package/dist/index.js CHANGED
@@ -6154,6 +6154,9 @@ function createAuthenticatorMachine(options) {
6154
6154
  onDone: { actions: 'setUser', target: 'setup' },
6155
6155
  onError: { target: 'setup' },
6156
6156
  },
6157
+ // handle a sign out occurring while `handleGetCurrentUser` is in flight,
6158
+ // exiting cancels the invoke so a stale user cannot be applied
6159
+ on: { SIGN_OUT: '#authenticator.signOut' },
6157
6160
  },
6158
6161
  setup: {
6159
6162
  initial: 'initConfig',
@@ -6199,6 +6202,7 @@ function createAuthenticatorMachine(options) {
6199
6202
  },
6200
6203
  onError: { target: '#authenticator.setup' },
6201
6204
  },
6205
+ on: { SIGN_OUT: '#authenticator.signOut' },
6202
6206
  },
6203
6207
  signInActor: {
6204
6208
  initial: 'spawnActor',
@@ -6352,6 +6356,14 @@ function createAuthenticatorMachine(options) {
6352
6356
  },
6353
6357
  },
6354
6358
  on: {
6359
+ // `SIGN_OUT` handled by `setup.initConfig` moves the machine past setup without
6360
+ // the UI ever sending `INIT`, leaving it configured with defaults. Accept `INIT`
6361
+ // late so a subsequently rendered UI can still apply its `config` and `services`.
6362
+ INIT: {
6363
+ cond: 'shouldInitialize',
6364
+ actions: 'configure',
6365
+ target: '#authenticator.setup.getConfig',
6366
+ },
6355
6367
  SIGN_IN_WITH_REDIRECT: { target: '#authenticator.getCurrentUser' },
6356
6368
  CHANGE: { actions: 'forwardToActor' },
6357
6369
  BLUR: { actions: 'forwardToActor' },
@@ -6443,6 +6455,7 @@ function createAuthenticatorMachine(options) {
6443
6455
  return {
6444
6456
  services: { ...defaultServices, ...customServices },
6445
6457
  config,
6458
+ hasInitialized: true,
6446
6459
  };
6447
6460
  }),
6448
6461
  setHasSetup: xstate.assign({ hasSetup: true }),
@@ -6453,6 +6466,9 @@ function createAuthenticatorMachine(options) {
6453
6466
  isInitialStateSignUp: ({ config }) => config.initialState === 'signUp',
6454
6467
  isInitialStateResetPassword: ({ config }) => config.initialState === 'forgotPassword',
6455
6468
  shouldSetup: ({ hasSetup }) => !hasSetup,
6469
+ // `hasSetup` prevents the late `INIT` from interrupting `idle`, which must
6470
+ // resolve `handleGetCurrentUser` before the machine leaves it
6471
+ shouldInitialize: ({ hasSetup, hasInitialized }) => hasSetup && !hasInitialized,
6456
6472
  hasUser: ({ user }) => {
6457
6473
  return !!user;
6458
6474
  },
@@ -30,7 +30,21 @@
30
30
  opacity: 0;
31
31
  }
32
32
  }
33
+ .liveness-detector {
34
+ display: flex;
35
+ flex-direction: column;
36
+ height: 100%;
37
+ min-height: 0;
38
+ }
39
+ .liveness-detector > .amplify-flex,
40
+ .liveness-detector .liveness-detector-check {
41
+ flex: 1 1 auto;
42
+ min-height: 0;
43
+ }
44
+
33
45
  .amplify-liveness-camera-module {
46
+ flex: 1 1 auto;
47
+ min-height: 0;
34
48
  flex-direction: column;
35
49
  align-items: center;
36
50
  justify-content: center;
@@ -107,6 +121,13 @@
107
121
  .amplify-liveness-video-anchor {
108
122
  position: relative;
109
123
  width: 100%;
124
+ flex: 1 1 auto;
125
+ min-height: 200px;
126
+ overflow: hidden;
127
+ }
128
+
129
+ .amplify-liveness-camera-module--mobile .amplify-liveness-video-anchor {
130
+ flex: none;
110
131
  }
111
132
 
112
133
  .amplify-liveness-recording-icon-container {
@@ -447,4 +468,5 @@
447
468
  justify-content: center;
448
469
  text-align: center;
449
470
  height: 480px;
471
+ max-height: 100%;
450
472
  }
@@ -31,7 +31,21 @@
31
31
  opacity: 0;
32
32
  }
33
33
  }
34
+ .liveness-detector {
35
+ display: flex;
36
+ flex-direction: column;
37
+ height: 100%;
38
+ min-height: 0;
39
+ }
40
+ .liveness-detector > .amplify-flex,
41
+ .liveness-detector .liveness-detector-check {
42
+ flex: 1 1 auto;
43
+ min-height: 0;
44
+ }
45
+
34
46
  .amplify-liveness-camera-module {
47
+ flex: 1 1 auto;
48
+ min-height: 0;
35
49
  flex-direction: column;
36
50
  align-items: center;
37
51
  justify-content: center;
@@ -108,6 +122,13 @@
108
122
  .amplify-liveness-video-anchor {
109
123
  position: relative;
110
124
  width: 100%;
125
+ flex: 1 1 auto;
126
+ min-height: 200px;
127
+ overflow: hidden;
128
+ }
129
+
130
+ .amplify-liveness-camera-module--mobile .amplify-liveness-video-anchor {
131
+ flex: none;
111
132
  }
112
133
 
113
134
  .amplify-liveness-recording-icon-container {
@@ -448,5 +469,6 @@
448
469
  justify-content: center;
449
470
  text-align: center;
450
471
  height: 480px;
472
+ max-height: 100%;
451
473
  }
452
474
  }
@@ -6,7 +6,6 @@
6
6
 
7
7
  html:focus-within {
8
8
  scroll-behavior: smooth;
9
- -moz-text-size-adjust: none;
10
9
  -webkit-text-size-adjust: none;
11
10
  text-size-adjust: none;
12
11
  }
@@ -7,7 +7,6 @@
7
7
 
8
8
  html:focus-within {
9
9
  scroll-behavior: smooth;
10
- -moz-text-size-adjust: none;
11
10
  -webkit-text-size-adjust: none;
12
11
  text-size-adjust: none;
13
12
  }
package/dist/styles.css CHANGED
@@ -4246,7 +4246,21 @@ html[dir=rtl] .amplify-field-group__inner-start {
4246
4246
  opacity: 0;
4247
4247
  }
4248
4248
  }
4249
+ .liveness-detector {
4250
+ display: flex;
4251
+ flex-direction: column;
4252
+ height: 100%;
4253
+ min-height: 0;
4254
+ }
4255
+ .liveness-detector > .amplify-flex,
4256
+ .liveness-detector .liveness-detector-check {
4257
+ flex: 1 1 auto;
4258
+ min-height: 0;
4259
+ }
4260
+
4249
4261
  .amplify-liveness-camera-module {
4262
+ flex: 1 1 auto;
4263
+ min-height: 0;
4250
4264
  flex-direction: column;
4251
4265
  align-items: center;
4252
4266
  justify-content: center;
@@ -4323,6 +4337,13 @@ html[dir=rtl] .amplify-field-group__inner-start {
4323
4337
  .amplify-liveness-video-anchor {
4324
4338
  position: relative;
4325
4339
  width: 100%;
4340
+ flex: 1 1 auto;
4341
+ min-height: 200px;
4342
+ overflow: hidden;
4343
+ }
4344
+
4345
+ .amplify-liveness-camera-module--mobile .amplify-liveness-video-anchor {
4346
+ flex: none;
4326
4347
  }
4327
4348
 
4328
4349
  .amplify-liveness-recording-icon-container {
@@ -4663,6 +4684,7 @@ html[dir=rtl] .amplify-field-group__inner-start {
4663
4684
  justify-content: center;
4664
4685
  text-align: center;
4665
4686
  height: 480px;
4687
+ max-height: 100%;
4666
4688
  }
4667
4689
 
4668
4690
  .amplify-menu__wrapper {
@@ -4247,7 +4247,21 @@ html[dir=rtl] .amplify-field-group__inner-start {
4247
4247
  opacity: 0;
4248
4248
  }
4249
4249
  }
4250
+ .liveness-detector {
4251
+ display: flex;
4252
+ flex-direction: column;
4253
+ height: 100%;
4254
+ min-height: 0;
4255
+ }
4256
+ .liveness-detector > .amplify-flex,
4257
+ .liveness-detector .liveness-detector-check {
4258
+ flex: 1 1 auto;
4259
+ min-height: 0;
4260
+ }
4261
+
4250
4262
  .amplify-liveness-camera-module {
4263
+ flex: 1 1 auto;
4264
+ min-height: 0;
4251
4265
  flex-direction: column;
4252
4266
  align-items: center;
4253
4267
  justify-content: center;
@@ -4324,6 +4338,13 @@ html[dir=rtl] .amplify-field-group__inner-start {
4324
4338
  .amplify-liveness-video-anchor {
4325
4339
  position: relative;
4326
4340
  width: 100%;
4341
+ flex: 1 1 auto;
4342
+ min-height: 200px;
4343
+ overflow: hidden;
4344
+ }
4345
+
4346
+ .amplify-liveness-camera-module--mobile .amplify-liveness-video-anchor {
4347
+ flex: none;
4327
4348
  }
4328
4349
 
4329
4350
  .amplify-liveness-recording-icon-container {
@@ -4664,6 +4685,7 @@ html[dir=rtl] .amplify-field-group__inner-start {
4664
4685
  justify-content: center;
4665
4686
  text-align: center;
4666
4687
  height: 480px;
4688
+ max-height: 100%;
4667
4689
  }
4668
4690
 
4669
4691
  .amplify-menu__wrapper {
@@ -96,6 +96,7 @@ export interface AuthContext {
96
96
  user?: AuthUser;
97
97
  actorDoneData?: ActorDoneData;
98
98
  hasSetup?: boolean;
99
+ hasInitialized?: boolean;
99
100
  passwordlessCapabilities?: PasswordlessCapabilities;
100
101
  }
101
102
  export type InitialStep = 'FORGOT_PASSWORD' | 'SIGN_IN' | 'SIGN_UP';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aws-amplify/ui",
3
- "version": "6.15.5",
3
+ "version": "6.15.7",
4
4
  "main": "dist/index.js",
5
5
  "module": "dist/esm/index.mjs",
6
6
  "exports": {
@@ -64,7 +64,7 @@
64
64
  "@types/webpack-env": "^1.16.2",
65
65
  "autoprefixer": "^10.3.1",
66
66
  "glob": "^10.5.0",
67
- "postcss": "^8.5.10",
67
+ "postcss": "^8.5.18",
68
68
  "sass": "^1.35.2",
69
69
  "style-dictionary": "3.9.1",
70
70
  "ts-node": "^10.9.1"