@aws-amplify/ui-react-notifications 0.0.0-studio-0fc3ce7-20230602222459 → 1.0.1

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.
Files changed (33) hide show
  1. package/dist/esm/components/InAppMessaging/Backdrop/Backdrop.mjs +1 -0
  2. package/dist/esm/components/InAppMessaging/Backdrop/withBackdrop.mjs +1 -0
  3. package/dist/esm/components/InAppMessaging/BannerMessage/BannerMessage.mjs +1 -0
  4. package/dist/esm/components/InAppMessaging/CloseIconButton/CloseIconButton.mjs +1 -0
  5. package/dist/esm/components/InAppMessaging/FullScreenMessage/FullScreenMessage.mjs +1 -0
  6. package/dist/esm/components/InAppMessaging/InAppMessageDisplay/InAppMessageDisplay.mjs +1 -0
  7. package/dist/esm/components/InAppMessaging/MessageLayout/MessageLayout.mjs +1 -0
  8. package/dist/esm/components/InAppMessaging/ModalMessage/ModalMessage.mjs +1 -0
  9. package/dist/esm/components/InAppMessaging/hooks/useMessageImage/useMessageImage.mjs +1 -0
  10. package/dist/esm/components/InAppMessaging/hooks/useMessageProps/useMessageProps.mjs +1 -0
  11. package/dist/esm/components/InAppMessaging/withInAppMessaging/withInAppMessaging.mjs +1 -0
  12. package/dist/esm/{index.js → index.mjs} +1 -1
  13. package/package.json +8 -9
  14. package/dist/esm/components/InAppMessaging/Backdrop/Backdrop.js +0 -1
  15. package/dist/esm/components/InAppMessaging/Backdrop/withBackdrop.js +0 -1
  16. package/dist/esm/components/InAppMessaging/BannerMessage/BannerMessage.js +0 -1
  17. package/dist/esm/components/InAppMessaging/CloseIconButton/CloseIconButton.js +0 -1
  18. package/dist/esm/components/InAppMessaging/FullScreenMessage/FullScreenMessage.js +0 -1
  19. package/dist/esm/components/InAppMessaging/InAppMessageDisplay/InAppMessageDisplay.js +0 -1
  20. package/dist/esm/components/InAppMessaging/MessageLayout/MessageLayout.js +0 -1
  21. package/dist/esm/components/InAppMessaging/ModalMessage/ModalMessage.js +0 -1
  22. package/dist/esm/components/InAppMessaging/hooks/useMessageImage/useMessageImage.js +0 -1
  23. package/dist/esm/components/InAppMessaging/hooks/useMessageProps/useMessageProps.js +0 -1
  24. package/dist/esm/components/InAppMessaging/withInAppMessaging/withInAppMessaging.js +0 -1
  25. /package/dist/esm/components/InAppMessaging/BannerMessage/{constants.js → constants.mjs} +0 -0
  26. /package/dist/esm/components/InAppMessaging/FullScreenMessage/{constants.js → constants.mjs} +0 -0
  27. /package/dist/esm/components/InAppMessaging/InAppMessageDisplay/{handleMessageLinkAction.js → handleMessageLinkAction.mjs} +0 -0
  28. /package/dist/esm/components/InAppMessaging/MessageLayout/{constants.js → constants.mjs} +0 -0
  29. /package/dist/esm/components/InAppMessaging/MessageLayout/{utils.js → utils.mjs} +0 -0
  30. /package/dist/esm/components/InAppMessaging/ModalMessage/{constants.js → constants.mjs} +0 -0
  31. /package/dist/esm/components/InAppMessaging/hooks/useMessageImage/{types.js → types.mjs} +0 -0
  32. /package/dist/esm/components/InAppMessaging/hooks/useMessageProps/{utils.js → utils.mjs} +0 -0
  33. /package/dist/esm/node_modules/tslib/{tslib.es6.js → tslib.es6.mjs} +0 -0
@@ -0,0 +1 @@
1
+ import{__rest as a}from"../../../node_modules/tslib/tslib.es6.mjs";import i from"react";import{View as t}from"@aws-amplify/ui-react";const e="inappmessaging-backdrop";function o(o){var{onClick:s}=o,r=a(o,["onClick"]);return i.createElement(t,Object.assign({className:"amplify-inappmessaging-backdrop","data-testid":e,onClick:s},r))}export{e as BACKDROP_TEST_ID,o as Backdrop};
@@ -0,0 +1 @@
1
+ import e from"react";import{Flex as t,View as a}from"@aws-amplify/ui-react";import{Backdrop as n}from"./Backdrop.mjs";function r(r,m={}){return function(c){return e.createElement(e.Fragment,null,e.createElement(n,Object.assign({},m)),e.createElement(t,{className:"amplify-inappmessaging-backdrop-content-container"},e.createElement(a,{className:"amplify-inappmessaging-backdrop-content"},e.createElement(r,Object.assign({},c)))))}}export{r as withBackdrop};
@@ -0,0 +1 @@
1
+ import e from"react";import s from"classnames";import{useBreakpointValue as t,Flex as o}from"@aws-amplify/ui-react";import"../hooks/useMessageImage/useMessageImage.mjs";import a from"../hooks/useMessageProps/useMessageProps.mjs";import{MessageLayout as r}from"../MessageLayout/MessageLayout.mjs";import{BLOCK_CLASS as m}from"./constants.mjs";function i(i){const n=a(i),l=t([!0,!0,!1]),{shouldRenderMessage:g,styles:p}=n;if(!g)return null;const{alignment:u="right",position:c="top"}=i,d="center"===u&&"middle"===c;return e.createElement(o,{className:s(m,{[`${m}--${c}`]:!d,[`${m}--${u}`]:!d,[`${m}--center-middle`]:d,[`${m}--full-width`]:l}),role:"dialog",testId:`inappmessaging-${c}banner-dialog`},e.createElement(r,Object.assign({},i,n,{orientation:"horizontal",buttonSize:"small",styles:p})))}export{i as BannerMessage};
@@ -0,0 +1 @@
1
+ import{__rest as e}from"../../../node_modules/tslib/tslib.es6.mjs";import*as s from"react";import{Button as a}from"@aws-amplify/ui-react";import{IconClose as i}from"@aws-amplify/ui-react/internal";function t(t){var{className:r,dismissButtonLabel:m="Dismiss message",onClick:l,style:o}=t,n=e(t,["className","dismissButtonLabel","onClick","style"]);return s.createElement(a,Object.assign({ariaLabel:m,className:r,onClick:l,style:o,variation:"link"},n),s.createElement(i,{"aria-hidden":"true",size:"1.5rem"}))}export{t as CloseIconButton};
@@ -0,0 +1 @@
1
+ import*as e from"react";import s from"classnames";import{useBreakpointValue as o,Flex as r}from"@aws-amplify/ui-react";import{withBackdrop as t}from"../Backdrop/withBackdrop.mjs";import"../hooks/useMessageImage/useMessageImage.mjs";import a from"../hooks/useMessageProps/useMessageProps.mjs";import{MessageLayout as m}from"../MessageLayout/MessageLayout.mjs";import{BLOCK_CLASS as n}from"./constants.mjs";function l(l){const i=a(l),c=o([!0,!0,!1]),{shouldRenderMessage:u,styles:p}=i,{onClose:g}=l;if(!u)return null;const f=()=>e.createElement(r,{className:s(n,{[`${n}--fullscreen`]:c}),role:"dialog",testId:"inappmessaging-fullscreen-dialog"},e.createElement(m,Object.assign({},l,i,{styles:p})));if(c)return e.createElement(f,null);const d=t(f,{onClick:g});return e.createElement(d,null)}export{l as FullScreenMessage};
@@ -0,0 +1 @@
1
+ import e from"react";import{useMessage as s,handleMessageAction as a}from"@aws-amplify/ui-react-core-notifications";import{ThemeProvider as o}from"@aws-amplify/ui-react";import{BannerMessage as n}from"../BannerMessage/BannerMessage.mjs";import{FullScreenMessage as r}from"../FullScreenMessage/FullScreenMessage.mjs";import{ModalMessage as t}from"../ModalMessage/ModalMessage.mjs";import i from"./handleMessageLinkAction.mjs";function l(e){return null}const c={BannerMessage:n,CarouselMessage:l,FullScreenMessage:r,ModalMessage:t},m=({action:e,url:s})=>{a({action:e,url:s,handleMessageLinkAction:i})};function M({components:a}){const n=e.useMemo((()=>Object.assign(Object.assign({},c),a)),[a]),{Component:r,props:t}=s({components:n,onMessageAction:m});return e.createElement(o,{colorMode:"light"},e.createElement(r,Object.assign({},t)))}M.BannerMessage=n,M.CarouselMessage=l,M.FullScreenMessage=r,M.ModalMessage=t;export{M as default};
@@ -0,0 +1 @@
1
+ import*as e from"react";import t from"classnames";import{isEmpty as a}from"@aws-amplify/ui";import{Flex as n,Image as s,Heading as o,Text as r,ButtonGroup as l,Button as m}from"@aws-amplify/ui-react";import{CloseIconButton as c}from"../CloseIconButton/CloseIconButton.mjs";import{CLOSE_BUTTON_CLASS as i,BLOCK_CLASS as d,MESSAGE_LAYOUT_TEST_ID as y,CONTENT_CLASS as u,CONTENT_TEST_ID as p,IMAGE_CONTAINER_CLASS as f,IMAGE_CONTAINER_TEST_ID as E,TEXT_CONTAINER_CLASS as I,TEXT_CONTAINER_TEST_ID as $,HEADER_CLASS as B,HEADER_TEXT_TEST_ID as N,BODY_TEXT_TEST_ID as C,BUTTON_GROUP_TEST_ID as g,BUTTON_CLASS as v,SECONDARY_BUTTON_TEST_ID as b,PRIMARY_BUTTON_TEST_ID as h}from"./constants.mjs";import{getButtonModifier as j}from"./utils.mjs";const k=e=>!a(e);function x({body:a,buttonSize:x,hasRenderableImage:z,header:A,image:w,onClose:M,orientation:R="vertical",primaryButton:S,secondaryButton:T,styles:q}){const D=e.useMemo((()=>({primary:j(q.primaryButton),secondary:j(q.secondaryButton)})),[q]),F="horizontal"===R,G=e.createElement(c,{className:i,onClick:M,style:q.closeIconButton}),H=k(S),J=k(T),K=H||J;return e.createElement(n,{className:d,"data-testid":y,style:q.container},!F&&e.createElement(n,{justifyContent:"flex-end"},G),e.createElement(n,{className:t(u,`${u}--${R}`),"data-testid":p},z&&e.createElement(n,{className:t(f,`${f}--${R}`),"data-testid":E},e.createElement(s,{alt:"In-App Message Image",src:null==w?void 0:w.src,style:q.image})),e.createElement(n,{className:t(I,`${I}--${R}`),"data-testid":$},(null==A?void 0:A.content)&&e.createElement(o,{className:B,isTruncated:!0,level:2,style:q.header,testId:N},A.content),(null==a?void 0:a.content)&&e.createElement(r,{style:q.body,testId:C},a.content)),F&&e.createElement(n,{alignItems:"flex-start"},G)),K&&e.createElement(l,{size:x,testId:g},J&&e.createElement(m,{className:t(v,`${v}--${D.secondary}`),onClick:T.onAction,style:q.secondaryButton,testId:b},T.title),H&&e.createElement(m,{className:t(v,`${v}--${D.primary}`),onClick:S.onAction,style:q.primaryButton,testId:h},S.title)))}export{x as MessageLayout};
@@ -0,0 +1 @@
1
+ import*as s from"react";import e from"classnames";import{useBreakpointValue as a,Flex as o}from"@aws-amplify/ui-react";import"../hooks/useMessageImage/useMessageImage.mjs";import t from"../hooks/useMessageProps/useMessageProps.mjs";import{MessageLayout as m}from"../MessageLayout/MessageLayout.mjs";import{BLOCK_CLASS as r,DIALOG_CLASS as l}from"./constants.mjs";function i(i){const n=t(i),g=a([!0,!0,!1]),{shouldRenderMessage:p,styles:c}=n;return p?s.createElement(o,{className:r},s.createElement(o,{className:e(l,{[`${l}--full-width`]:g}),role:"dialog",testId:"inappmessaging-modal-dialog"},s.createElement(m,Object.assign({},i,n,{styles:c})))):null}export{i as ModalMessage};
@@ -0,0 +1 @@
1
+ import{useState as e,useEffect as r}from"react";import{ConsoleLogger as o}from"@aws-amplify/core";import{ImagePrefetchStatus as t}from"./types.mjs";const a=new o("Notifications.InAppMessaging");function n(o){const{src:n}=null!=o?o:{},s=!!n,[c,i]=e(s?t.Fetching:null),m=c===t.Fetching,l=c===t.Success;return r((()=>{if(!s)return;const e=new Image;e.onload=()=>{i(t.Success)},e.onabort=()=>{a.error(`Image load aborted: ${n}`),i(t.Aborted)},e.onerror=()=>{a.error(`Image failed to load: ${n}`),i(t.Failure)},e.src=n}),[s,n]),{hasRenderableImage:l,isImageFetching:m}}export{n as default};
@@ -0,0 +1 @@
1
+ import{useRef as e,useEffect as s,useMemo as a}from"react";import r from"../useMessageImage/useMessageImage.mjs";import{getMessageStyles as t,getPayloadStyle as m}from"./utils.mjs";function l(l){const{image:o,onDisplay:n}=l,g=e(!1),{hasRenderableImage:i,isImageFetching:u}=r(o),c=!u;s((()=>{!g.current&&c&&(null==n||n(),g.current=!0)}),[n,c]);const d=a((()=>t({styleParams:{payloadStyle:m(l),overrideStyle:l.style}})),[l]);return{hasRenderableImage:i,shouldRenderMessage:c,styles:d}}export{l as default};
@@ -0,0 +1 @@
1
+ import e from"react";import{InAppMessagingProvider as t}from"@aws-amplify/ui-react-core-notifications";import r from"../InAppMessageDisplay/InAppMessageDisplay.mjs";function a(a,n){return function(i){return e.createElement(t,null,e.createElement(r,Object.assign({},n)),e.createElement(a,Object.assign({},i)))}}export{a as default};
@@ -1 +1 @@
1
- export{InAppMessagingProvider,useInAppMessaging}from"@aws-amplify/ui-react-core-notifications";export{default as InAppMessageDisplay}from"./components/InAppMessaging/InAppMessageDisplay/InAppMessageDisplay.js";export{default as withInAppMessaging}from"./components/InAppMessaging/withInAppMessaging/withInAppMessaging.js";
1
+ export{InAppMessagingProvider,useInAppMessaging}from"@aws-amplify/ui-react-core-notifications";export{default as InAppMessageDisplay}from"./components/InAppMessaging/InAppMessageDisplay/InAppMessageDisplay.mjs";export{default as withInAppMessaging}from"./components/InAppMessaging/withInAppMessaging/withInAppMessaging.mjs";
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@aws-amplify/ui-react-notifications",
3
- "version": "0.0.0-studio-0fc3ce7-20230602222459",
3
+ "version": "1.0.1",
4
4
  "main": "dist/index.js",
5
- "module": "dist/esm/index.js",
5
+ "module": "dist/esm/index.mjs",
6
6
  "exports": {
7
7
  ".": {
8
8
  "types": "./dist/types/index.d.ts",
9
- "import": "./dist/esm/index.js",
9
+ "import": "./dist/esm/index.mjs",
10
10
  "require": "./dist/index.js"
11
11
  },
12
12
  "./styles.css": "./dist/styles.css"
@@ -35,14 +35,14 @@
35
35
  "prebuild": "rimraf dist",
36
36
  "size": "yarn size-limit",
37
37
  "test": "jest",
38
- "test:ci": "yarn test",
38
+ "test:ci": "yarn test && yarn check:esm",
39
39
  "test:watch": "yarn test --watch",
40
40
  "typecheck": "tsc --noEmit"
41
41
  },
42
42
  "dependencies": {
43
- "@aws-amplify/ui": "0.0.0-studio-0fc3ce7-20230602222459",
44
- "@aws-amplify/ui-react": "0.0.0-studio-0fc3ce7-20230602222459",
45
- "@aws-amplify/ui-react-core-notifications": "0.0.0-studio-0fc3ce7-20230602222459",
43
+ "@aws-amplify/ui": "5.6.4",
44
+ "@aws-amplify/ui-react": "5.0.0",
45
+ "@aws-amplify/ui-react-core-notifications": "1.0.0",
46
46
  "classnames": "2.3.1",
47
47
  "tinycolor2": "1.4.2"
48
48
  },
@@ -53,7 +53,6 @@
53
53
  },
54
54
  "devDependencies": {
55
55
  "@aws-amplify/eslint-config-amplify-ui": "0.0.0",
56
- "@rollup/plugin-commonjs": "^22.0.1",
57
56
  "@rollup/plugin-typescript": "^8.3.1",
58
57
  "@size-limit/preset-big-lib": "^7.0.8",
59
58
  "@testing-library/jest-dom": "^5.14.1",
@@ -82,7 +81,7 @@
82
81
  "size-limit": [
83
82
  {
84
83
  "name": "InAppMessaging",
85
- "path": "dist/esm/index.js",
84
+ "path": "dist/esm/index.mjs",
86
85
  "import": "{ InAppMessagingProvider, InAppMessageDisplay }",
87
86
  "limit": "110 kB"
88
87
  }
@@ -1 +0,0 @@
1
- import{__rest as a}from"../../../node_modules/tslib/tslib.es6.js";import i from"react";import{View as t}from"@aws-amplify/ui-react";const e="inappmessaging-backdrop";function o(o){var{onClick:s}=o,r=a(o,["onClick"]);return i.createElement(t,Object.assign({className:"amplify-inappmessaging-backdrop","data-testid":e,onClick:s},r))}export{e as BACKDROP_TEST_ID,o as Backdrop};
@@ -1 +0,0 @@
1
- import e from"react";import{Flex as t,View as a}from"@aws-amplify/ui-react";import{Backdrop as n}from"./Backdrop.js";function r(r,c={}){return function(m){return e.createElement(e.Fragment,null,e.createElement(n,Object.assign({},c)),e.createElement(t,{className:"amplify-inappmessaging-backdrop-content-container"},e.createElement(a,{className:"amplify-inappmessaging-backdrop-content"},e.createElement(r,Object.assign({},m)))))}}export{r as withBackdrop};
@@ -1 +0,0 @@
1
- import e from"react";import s from"classnames";import{useBreakpointValue as t,Flex as o}from"@aws-amplify/ui-react";import"../hooks/useMessageImage/useMessageImage.js";import a from"../hooks/useMessageProps/useMessageProps.js";import{MessageLayout as r}from"../MessageLayout/MessageLayout.js";import{BLOCK_CLASS as i}from"./constants.js";function n(n){const m=a(n),l=t([!0,!0,!1]),{shouldRenderMessage:g,styles:p}=m;if(!g)return null;const{alignment:u="right",position:c="top"}=n,d="center"===u&&"middle"===c;return e.createElement(o,{className:s(i,{[`${i}--${c}`]:!d,[`${i}--${u}`]:!d,[`${i}--center-middle`]:d,[`${i}--full-width`]:l}),role:"dialog",testId:`inappmessaging-${c}banner-dialog`},e.createElement(r,Object.assign({},n,m,{orientation:"horizontal",buttonSize:"small",styles:p})))}export{n as BannerMessage};
@@ -1 +0,0 @@
1
- import{__rest as e}from"../../../node_modules/tslib/tslib.es6.js";import*as s from"react";import{Button as a}from"@aws-amplify/ui-react";import{IconClose as i}from"@aws-amplify/ui-react/internal";function t(t){var{className:r,dismissButtonLabel:l="Dismiss message",onClick:m,style:o}=t,n=e(t,["className","dismissButtonLabel","onClick","style"]);return s.createElement(a,Object.assign({ariaLabel:l,className:r,onClick:m,style:o,variation:"link"},n),s.createElement(i,{"aria-hidden":"true",size:"1.5rem"}))}export{t as CloseIconButton};
@@ -1 +0,0 @@
1
- import*as e from"react";import s from"classnames";import{useBreakpointValue as o,Flex as r}from"@aws-amplify/ui-react";import{withBackdrop as t}from"../Backdrop/withBackdrop.js";import"../hooks/useMessageImage/useMessageImage.js";import a from"../hooks/useMessageProps/useMessageProps.js";import{MessageLayout as n}from"../MessageLayout/MessageLayout.js";import{BLOCK_CLASS as l}from"./constants.js";function m(m){const i=a(m),c=o([!0,!0,!1]),{shouldRenderMessage:u,styles:p}=i,{onClose:g}=m;if(!u)return null;const f=()=>e.createElement(r,{className:s(l,{[`${l}--fullscreen`]:c}),role:"dialog",testId:"inappmessaging-fullscreen-dialog"},e.createElement(n,Object.assign({},m,i,{styles:p})));if(c)return e.createElement(f,null);const d=t(f,{onClick:g});return e.createElement(d,null)}export{m as FullScreenMessage};
@@ -1 +0,0 @@
1
- import e from"react";import{useMessage as s,handleMessageAction as a}from"@aws-amplify/ui-react-core-notifications";import{ThemeProvider as o}from"@aws-amplify/ui-react";import{BannerMessage as n}from"../BannerMessage/BannerMessage.js";import{FullScreenMessage as r}from"../FullScreenMessage/FullScreenMessage.js";import{ModalMessage as t}from"../ModalMessage/ModalMessage.js";import i from"./handleMessageLinkAction.js";function l(e){return null}const c={BannerMessage:n,CarouselMessage:l,FullScreenMessage:r,ModalMessage:t},M=({action:e,url:s})=>{a({action:e,url:s,handleMessageLinkAction:i})};function m({components:a}){const n=e.useMemo((()=>Object.assign(Object.assign({},c),a)),[a]),{Component:r,props:t}=s({components:n,onMessageAction:M});return e.createElement(o,{colorMode:"light"},e.createElement(r,Object.assign({},t)))}m.BannerMessage=n,m.CarouselMessage=l,m.FullScreenMessage=r,m.ModalMessage=t;export{m as default};
@@ -1 +0,0 @@
1
- import*as e from"react";import t from"classnames";import{isEmpty as a}from"@aws-amplify/ui";import{Flex as n,Image as s,Heading as o,Text as r,ButtonGroup as l,Button as c}from"@aws-amplify/ui-react";import{CloseIconButton as m}from"../CloseIconButton/CloseIconButton.js";import{CLOSE_BUTTON_CLASS as i,BLOCK_CLASS as d,MESSAGE_LAYOUT_TEST_ID as y,CONTENT_CLASS as u,CONTENT_TEST_ID as p,IMAGE_CONTAINER_CLASS as f,IMAGE_CONTAINER_TEST_ID as E,TEXT_CONTAINER_CLASS as I,TEXT_CONTAINER_TEST_ID as $,HEADER_CLASS as B,HEADER_TEXT_TEST_ID as N,BODY_TEXT_TEST_ID as C,BUTTON_GROUP_TEST_ID as g,BUTTON_CLASS as v,SECONDARY_BUTTON_TEST_ID as b,PRIMARY_BUTTON_TEST_ID as h}from"./constants.js";import{getButtonModifier as j}from"./utils.js";const k=e=>!a(e);function x({body:a,buttonSize:x,hasRenderableImage:z,header:A,image:w,onClose:M,orientation:R="vertical",primaryButton:S,secondaryButton:T,styles:q}){const D=e.useMemo((()=>({primary:j(q.primaryButton),secondary:j(q.secondaryButton)})),[q]),F="horizontal"===R,G=e.createElement(m,{className:i,onClick:M,style:q.closeIconButton}),H=k(S),J=k(T),K=H||J;return e.createElement(n,{className:d,"data-testid":y,style:q.container},!F&&e.createElement(n,{justifyContent:"flex-end"},G),e.createElement(n,{className:t(u,`${u}--${R}`),"data-testid":p},z&&e.createElement(n,{className:t(f,`${f}--${R}`),"data-testid":E},e.createElement(s,{alt:"In-App Message Image",src:null==w?void 0:w.src,style:q.image})),e.createElement(n,{className:t(I,`${I}--${R}`),"data-testid":$},(null==A?void 0:A.content)&&e.createElement(o,{className:B,isTruncated:!0,level:2,style:q.header,testId:N},A.content),(null==a?void 0:a.content)&&e.createElement(r,{style:q.body,testId:C},a.content)),F&&e.createElement(n,{alignItems:"flex-start"},G)),K&&e.createElement(l,{size:x,testId:g},J&&e.createElement(c,{className:t(v,`${v}--${D.secondary}`),onClick:T.onAction,style:q.secondaryButton,testId:b},T.title),H&&e.createElement(c,{className:t(v,`${v}--${D.primary}`),onClick:S.onAction,style:q.primaryButton,testId:h},S.title)))}export{x as MessageLayout};
@@ -1 +0,0 @@
1
- import*as s from"react";import e from"classnames";import{useBreakpointValue as a,Flex as o}from"@aws-amplify/ui-react";import"../hooks/useMessageImage/useMessageImage.js";import t from"../hooks/useMessageProps/useMessageProps.js";import{MessageLayout as r}from"../MessageLayout/MessageLayout.js";import{BLOCK_CLASS as m,DIALOG_CLASS as l}from"./constants.js";function i(i){const n=t(i),g=a([!0,!0,!1]),{shouldRenderMessage:p,styles:c}=n;return p?s.createElement(o,{className:m},s.createElement(o,{className:e(l,{[`${l}--full-width`]:g}),role:"dialog",testId:"inappmessaging-modal-dialog"},s.createElement(r,Object.assign({},i,n,{styles:c})))):null}export{i as ModalMessage};
@@ -1 +0,0 @@
1
- import{useState as e,useEffect as r}from"react";import{ConsoleLogger as o}from"@aws-amplify/core";import{ImagePrefetchStatus as t}from"./types.js";const a=new o("Notifications.InAppMessaging");function n(o){const{src:n}=null!=o?o:{},s=!!n,[c,i]=e(s?t.Fetching:null),l=c===t.Fetching,m=c===t.Success;return r((()=>{if(!s)return;const e=new Image;e.onload=()=>{i(t.Success)},e.onabort=()=>{a.error(`Image load aborted: ${n}`),i(t.Aborted)},e.onerror=()=>{a.error(`Image failed to load: ${n}`),i(t.Failure)},e.src=n}),[s,n]),{hasRenderableImage:m,isImageFetching:l}}export{n as default};
@@ -1 +0,0 @@
1
- import{useRef as e,useEffect as s,useMemo as a}from"react";import r from"../useMessageImage/useMessageImage.js";import{getMessageStyles as t,getPayloadStyle as l}from"./utils.js";function o(o){const{image:m,onDisplay:n}=o,g=e(!1),{hasRenderableImage:i,isImageFetching:u}=r(m),c=!u;s((()=>{!g.current&&c&&(null==n||n(),g.current=!0)}),[n,c]);const d=a((()=>t({styleParams:{payloadStyle:l(o),overrideStyle:o.style}})),[o]);return{hasRenderableImage:i,shouldRenderMessage:c,styles:d}}export{o as default};
@@ -1 +0,0 @@
1
- import e from"react";import{InAppMessagingProvider as t}from"@aws-amplify/ui-react-core-notifications";import r from"../InAppMessageDisplay/InAppMessageDisplay.js";function a(a,n){return function(i){return e.createElement(t,null,e.createElement(r,Object.assign({},n)),e.createElement(a,Object.assign({},i)))}}export{a as default};