@aws-amplify/ui-react-core 2.1.13 → 2.1.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/dist/esm/Authenticator/hooks/useAuthenticator/utils.mjs +1 -2
- package/dist/esm/utils/index.mjs +2 -14
- package/dist/index.js +6 -18
- package/dist/types/utils/index.d.ts +0 -2
- package/package.json +10 -10
- package/dist/types/Authenticator/context/__tests__/AuthenticatorProvider.test.d.ts +0 -1
- package/dist/types/Authenticator/hooks/__mock__/components.d.ts +0 -7
- package/dist/types/Authenticator/hooks/__tests__/utils.spec.d.ts +0 -1
- package/dist/types/Authenticator/hooks/useAuthenticator/__tests__/useAuthenticator.spec.d.ts +0 -1
- package/dist/types/Authenticator/hooks/useAuthenticator/__tests__/utils.spec.d.ts +0 -1
- package/dist/types/Authenticator/hooks/useAuthenticatorInitMachine/__tests__/useAuthenticatorInitMachine.spec.d.ts +0 -1
- package/dist/types/Authenticator/hooks/useAuthenticatorRoute/__tests__/useAuthenticatorRoute.spec.d.ts +0 -1
- package/dist/types/Authenticator/hooks/useAuthenticatorRoute/__tests__/utils.spec.d.ts +0 -1
- package/dist/types/InAppMessaging/context/InAppMessagingProvider/__tests__/InAppMessagingProvider.spec.d.ts +0 -1
- package/dist/types/InAppMessaging/hooks/useInAppMessaging/__tests__/useInAppMessaging.spec.d.ts +0 -1
- package/dist/types/InAppMessaging/hooks/useMessage/__tests__/useMessage.spec.d.ts +0 -1
- package/dist/types/InAppMessaging/hooks/useMessage/__tests__/utils.spec.d.ts +0 -1
- package/dist/types/InAppMessaging/utils/__tests__/handleMessageAction.spec.d.ts +0 -1
- package/dist/types/__tests__/index.spec.d.ts +0 -1
- package/dist/types/components/RenderNothing/__tests__/RenderNothing.spec.d.ts +0 -1
- package/dist/types/hooks/__tests__/useHasValueUpdated.spec.d.ts +0 -1
- package/dist/types/hooks/__tests__/usePreviousValue.spec.d.ts +0 -1
- package/dist/types/utils/__tests__/index.spec.d.ts +0 -1
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { __awaiter } from '../../../node_modules/tslib/tslib.es6.mjs';
|
|
2
2
|
import { Auth } from 'aws-amplify';
|
|
3
|
-
import { getActorContext, getSortedFormFields, isString } from '@aws-amplify/ui';
|
|
4
|
-
import { areEmptyArrays, areEmptyObjects } from '../../../utils/index.mjs';
|
|
3
|
+
import { getActorContext, getSortedFormFields, isString, areEmptyArrays, areEmptyObjects } from '@aws-amplify/ui';
|
|
5
4
|
import { isComponentRouteKey } from '../utils.mjs';
|
|
6
5
|
|
|
7
6
|
const defaultComparator = () => false;
|
package/dist/esm/utils/index.mjs
CHANGED
|
@@ -1,19 +1,7 @@
|
|
|
1
|
-
import { isString
|
|
1
|
+
import { isString } from '@aws-amplify/ui';
|
|
2
2
|
|
|
3
|
-
function isEmptyArray(value) {
|
|
4
|
-
return Array.isArray(value) && isEmpty(value);
|
|
5
|
-
}
|
|
6
|
-
function areEmptyArrays(...values) {
|
|
7
|
-
return values.every(isEmptyArray);
|
|
8
|
-
}
|
|
9
|
-
function isEmptyObject(value) {
|
|
10
|
-
return isObject(value) && isEmpty(value);
|
|
11
|
-
}
|
|
12
|
-
function areEmptyObjects(...values) {
|
|
13
|
-
return values.every(isEmptyObject);
|
|
14
|
-
}
|
|
15
3
|
function templateJoin(values, template) {
|
|
16
4
|
return values.reduce((acc, curr) => `${acc}${isString(curr) ? template(curr) : ''}`, '');
|
|
17
5
|
}
|
|
18
6
|
|
|
19
|
-
export {
|
|
7
|
+
export { templateJoin };
|
package/dist/index.js
CHANGED
|
@@ -78,22 +78,6 @@ function __awaiter(thisArg, _arguments, P, generator) {
|
|
|
78
78
|
|
|
79
79
|
const USE_AUTHENTICATOR_ERROR = '`useAuthenticator` must be used inside an `Authenticator.Provider`.';
|
|
80
80
|
|
|
81
|
-
function isEmptyArray(value) {
|
|
82
|
-
return Array.isArray(value) && ui.isEmpty(value);
|
|
83
|
-
}
|
|
84
|
-
function areEmptyArrays(...values) {
|
|
85
|
-
return values.every(isEmptyArray);
|
|
86
|
-
}
|
|
87
|
-
function isEmptyObject(value) {
|
|
88
|
-
return ui.isObject(value) && ui.isEmpty(value);
|
|
89
|
-
}
|
|
90
|
-
function areEmptyObjects(...values) {
|
|
91
|
-
return values.every(isEmptyObject);
|
|
92
|
-
}
|
|
93
|
-
function templateJoin(values, template) {
|
|
94
|
-
return values.reduce((acc, curr) => `${acc}${ui.isString(curr) ? template(curr) : ''}`, '');
|
|
95
|
-
}
|
|
96
|
-
|
|
97
81
|
const COMPONENT_ROUTE_KEYS = [
|
|
98
82
|
'confirmResetPassword',
|
|
99
83
|
'confirmSignIn',
|
|
@@ -151,8 +135,8 @@ function areSelectorDepsEqual(currentDeps, nextDeps) {
|
|
|
151
135
|
}
|
|
152
136
|
return currentDeps.every((currentDep, index) => {
|
|
153
137
|
const nextDep = nextDeps[index];
|
|
154
|
-
if (areEmptyArrays(currentDep, nextDep) ||
|
|
155
|
-
areEmptyObjects(currentDep, nextDep)) {
|
|
138
|
+
if (ui.areEmptyArrays(currentDep, nextDep) ||
|
|
139
|
+
ui.areEmptyObjects(currentDep, nextDep)) {
|
|
156
140
|
return true;
|
|
157
141
|
}
|
|
158
142
|
return currentDep === nextDep;
|
|
@@ -623,6 +607,10 @@ function useHasValueUpdated(value, ignoreFirstRender = false) {
|
|
|
623
607
|
return previous !== value;
|
|
624
608
|
}
|
|
625
609
|
|
|
610
|
+
function templateJoin(values, template) {
|
|
611
|
+
return values.reduce((acc, curr) => `${acc}${ui.isString(curr) ? template(curr) : ''}`, '');
|
|
612
|
+
}
|
|
613
|
+
|
|
626
614
|
exports.AuthenticatorProvider = AuthenticatorProvider;
|
|
627
615
|
exports.InAppMessagingProvider = InAppMessagingProvider;
|
|
628
616
|
exports.handleMessageAction = handleMessageAction;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aws-amplify/ui-react-core",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.15",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"module": "dist/esm/index.mjs",
|
|
6
6
|
"react-native": "dist/index.js",
|
|
@@ -19,16 +19,18 @@
|
|
|
19
19
|
],
|
|
20
20
|
"scripts": {
|
|
21
21
|
"clean": "rimraf dist node_modules",
|
|
22
|
-
"prebuild": "rimraf dist",
|
|
23
22
|
"build": "rollup --config",
|
|
24
|
-
"
|
|
25
|
-
"
|
|
26
|
-
"
|
|
27
|
-
"test": "
|
|
28
|
-
"test:
|
|
23
|
+
"dev": "yarn build --watch",
|
|
24
|
+
"lint": "yarn typecheck && eslint src",
|
|
25
|
+
"prebuild": "rimraf dist",
|
|
26
|
+
"test": "yarn test:unit && yarn test:esm",
|
|
27
|
+
"test:esm": "node --input-type=module --eval 'import \"@aws-amplify/ui-react-core\"'",
|
|
28
|
+
"test:unit": "jest",
|
|
29
|
+
"test:unit:watch": "yarn test:unit --watch",
|
|
30
|
+
"typecheck": "tsc --noEmit"
|
|
29
31
|
},
|
|
30
32
|
"dependencies": {
|
|
31
|
-
"@aws-amplify/ui": "5.5.
|
|
33
|
+
"@aws-amplify/ui": "5.5.7",
|
|
32
34
|
"@xstate/react": "3.0.1",
|
|
33
35
|
"lodash": "4.17.21",
|
|
34
36
|
"xstate": "^4.33.6"
|
|
@@ -44,7 +46,6 @@
|
|
|
44
46
|
"@types/jest": "^26.0.23",
|
|
45
47
|
"@types/react": "^17.0.2",
|
|
46
48
|
"@types/react-dom": "^17.0.13",
|
|
47
|
-
"@types/react-native": "^0.63.45",
|
|
48
49
|
"@types/react-test-renderer": "^17.0.1",
|
|
49
50
|
"@typescript-eslint/eslint-plugin": "^5.6.0",
|
|
50
51
|
"@typescript-eslint/parser": "^5.6.0",
|
|
@@ -64,7 +65,6 @@
|
|
|
64
65
|
"rollup": "^2.70.0",
|
|
65
66
|
"rollup-plugin-node-externals": "^4.1.1",
|
|
66
67
|
"ts-jest": "^27.1.3",
|
|
67
|
-
"ts-node": "^10.2.1",
|
|
68
68
|
"typescript": "^4.3.2"
|
|
69
69
|
},
|
|
70
70
|
"sideEffects": false
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { Defaults, Overrides } from '../types';
|
|
2
|
-
declare type DefaultComponents<P> = Defaults<P>;
|
|
3
|
-
export declare const DEFAULTS: DefaultComponents<{}>;
|
|
4
|
-
export declare const OVERRIDES: Overrides;
|
|
5
|
-
export declare const INVALID_SIGN_IN_OVERRIDES: Overrides;
|
|
6
|
-
export declare const INVALID_OVERRIDES: Overrides<{}, {}>;
|
|
7
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
package/dist/types/Authenticator/hooks/useAuthenticator/__tests__/useAuthenticator.spec.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
package/dist/types/InAppMessaging/hooks/useInAppMessaging/__tests__/useInAppMessaging.spec.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|