@aws-amplify/ui-react-core 2.1.7 → 2.1.9

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/index.js CHANGED
@@ -11,3 +11,4 @@ export { default as InAppMessagingProvider } from './InAppMessaging/context/InAp
11
11
  export { default as handleMessageAction } from './InAppMessaging/utils/handleMessageAction.js';
12
12
  export { default as usePreviousValue } from './hooks/usePreviousValue.js';
13
13
  export { default as useHasValueUpdated } from './hooks/useHasValueUpdated.js';
14
+ export { templateJoin } from './utils/index.js';
@@ -1,5 +1,6 @@
1
1
  import isEmpty from 'lodash/isEmpty';
2
2
  import isObject from 'lodash/isObject';
3
+ import isString from 'lodash/isString';
3
4
 
4
5
  function isEmptyArray(value) {
5
6
  return Array.isArray(value) && isEmpty(value);
@@ -13,5 +14,8 @@ function isEmptyObject(value) {
13
14
  function areEmptyObjects(...values) {
14
15
  return values.every(isEmptyObject);
15
16
  }
17
+ function templateJoin(values, template) {
18
+ return values.reduce((acc, curr) => `${acc}${isString(curr) ? template(curr) : ''}`, '');
19
+ }
16
20
 
17
- export { areEmptyArrays, areEmptyObjects };
21
+ export { areEmptyArrays, areEmptyObjects, templateJoin };
package/dist/index.js CHANGED
@@ -101,6 +101,9 @@ function isEmptyObject(value) {
101
101
  function areEmptyObjects(...values) {
102
102
  return values.every(isEmptyObject);
103
103
  }
104
+ function templateJoin(values, template) {
105
+ return values.reduce((acc, curr) => `${acc}${isString__default["default"](curr) ? template(curr) : ''}`, '');
106
+ }
104
107
 
105
108
  const COMPONENT_ROUTE_KEYS = [
106
109
  'confirmResetPassword',
@@ -639,6 +642,7 @@ exports.InAppMessagingProvider = InAppMessagingProvider;
639
642
  exports.handleMessageAction = handleMessageAction;
640
643
  exports.isAuthenticatorComponentRouteKey = isComponentRouteKey;
641
644
  exports.resolveAuthenticatorComponents = resolveAuthenticatorComponents;
645
+ exports.templateJoin = templateJoin;
642
646
  exports.useAuthenticator = useAuthenticator;
643
647
  exports.useAuthenticatorInitMachine = useAuthenticatorInitMachine;
644
648
  exports.useAuthenticatorRoute = useAuthenticatorRoute;
@@ -1,3 +1,4 @@
1
1
  export { AuthenticatorComponentDefaults, AuthenticatorComponentDefaultProps, AuthenticatorComponentOverrides, AuthenticatorFooterComponent, AuthenticatorFormFieldsComponent, AuthenticatorHeaderComponent, AuthenticatorLegacyField, AuthenticatorMachineContext, AuthenticatorProvider, AuthenticatorRouteComponentKey, AuthenticatorRouteComponentName, isAuthenticatorComponentRouteKey, resolveAuthenticatorComponents, useAuthenticator, useAuthenticatorRoute, UseAuthenticator, useAuthenticatorInitMachine, UseAuthenticatorRoute, } from './Authenticator';
2
2
  export { BannerMessageCommonProps, BannerMessageComponent, CarouselMessageCommonProps, CarouselMessageComponent, FullScreenMessageCommonProps, FullScreenMessageComponent, handleMessageAction, HandleMessageLinkAction, InAppMessagingProvider, MessageButtonProps, MessageCommonProps, MessageComponentBaseProps, MessageContentProps, MessageImage, MessageLayout, MessagePayloadStyle, MessageTextAlign, ModalMessageCommonProps, ModalMessageComponent, OnMessageAction, useInAppMessaging, useMessage, } from './InAppMessaging';
3
3
  export { useHasValueUpdated, usePreviousValue } from './hooks';
4
+ export { templateJoin } from './utils';
@@ -1,2 +1,3 @@
1
1
  export declare function areEmptyArrays<T>(...values: T[]): boolean;
2
2
  export declare function areEmptyObjects<T>(...values: T[]): boolean;
3
+ 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.7",
3
+ "version": "2.1.9",
4
4
  "main": "dist/index.js",
5
5
  "module": "dist/esm/index.js",
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.4.2",
31
+ "@aws-amplify/ui": "5.5.1",
32
32
  "@xstate/react": "3.0.1",
33
33
  "lodash": "4.17.21",
34
34
  "xstate": "^4.33.6"