@aws-amplify/ui-react-core 2.1.13 → 2.1.14

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.
@@ -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;
@@ -1,19 +1,7 @@
1
- import { isString, isEmpty, isObject } from '@aws-amplify/ui';
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 { areEmptyArrays, areEmptyObjects, templateJoin };
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;
@@ -1,3 +1 @@
1
- export declare function areEmptyArrays<T>(...values: T[]): boolean;
2
- export declare function areEmptyObjects<T>(...values: T[]): boolean;
3
1
  export declare function templateJoin(values: string[], template: (value: string) => string): string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aws-amplify/ui-react-core",
3
- "version": "2.1.13",
3
+ "version": "2.1.14",
4
4
  "main": "dist/index.js",
5
5
  "module": "dist/esm/index.mjs",
6
6
  "react-native": "dist/index.js",
@@ -28,7 +28,7 @@
28
28
  "test:watch": "yarn test --watch"
29
29
  },
30
30
  "dependencies": {
31
- "@aws-amplify/ui": "5.5.5",
31
+ "@aws-amplify/ui": "5.5.6",
32
32
  "@xstate/react": "3.0.1",
33
33
  "lodash": "4.17.21",
34
34
  "xstate": "^4.33.6"