@aws-amplify/ui-react 2.17.0 → 2.18.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.
@@ -1 +1 @@
1
- import{jsx as e}from"react/jsx-runtime";import*as t from"react";import{getSendEventAliases as r,createAuthenticatorMachine as s,listenToAuthHub as n,getServiceContextFacade as o}from"@aws-amplify/ui";import{useSelector as i,useInterpret as c}from"@xstate/react";import a from"lodash/isEmpty";import{areArrayValuesEqual as u}from"../../../../helpers/utils.js";const m=t.createContext({}),p=({children:r})=>{const o=t.useContext(m),i={service:c(s)},u=a(o)?i:o,{service:{send:p}}=u,f=t.useRef(!1);return t.useEffect((()=>{if(!f.current)return f.current=!0,n(p)}),[p]),e(m.Provider,Object.assign({value:u},{children:r}))},f=e=>{const s=(()=>{const{service:e}=t.useContext(m);if(!e)throw new Error("Please ensure you wrap your App with `Authenticator.Provider`.\nSee the `useAuthenticator` section on https://ui.docs.amplify.aws/components/authenticator.");return e})(),{send:n}=s,c=t.useMemo((()=>r(n)),[n]),a=i(s,(e=>(e=>Object.assign(Object.assign({},c),o(e)))(e)),((t,r)=>{if(!e)return!1;const s=e(t),n=e(r);return u(s,n)}));return Object.assign(Object.assign({},a),{_state:s.getSnapshot(),_send:n})};export{m as AuthenticatorContext,p as Provider,f as useAuthenticator};
1
+ import{jsx as e}from"react/jsx-runtime";import*as t from"react";import{getSendEventAliases as r,createAuthenticatorMachine as s,listenToAuthHub as o,getServiceContextFacade as n}from"@aws-amplify/ui";import{useSelector as i,useInterpret as c}from"@xstate/react";import a from"lodash/isEmpty";import{areArrayValuesEqual as u}from"../../../../helpers/utils.js";const m=t.createContext({}),p=({children:r})=>{const n=t.useContext(m),i={service:c(s)},u=a(n)?i:n,{service:p}=u,f=t.useRef(!1);return t.useEffect((()=>{if(!f.current)return f.current=!0,o(p)}),[p]),e(m.Provider,Object.assign({value:u},{children:r}))},f=e=>{const s=(()=>{const{service:e}=t.useContext(m);if(!e)throw new Error("Please ensure you wrap your App with `Authenticator.Provider`.\nSee the `useAuthenticator` section on https://ui.docs.amplify.aws/components/authenticator.");return e})(),{send:o}=s,c=t.useMemo((()=>r(o)),[o]),a=i(s,(e=>(e=>Object.assign(Object.assign({},c),n(e)))(e)),((t,r)=>{if(!e)return!1;const s=e(t),o=e(r);return u(s,o)}));return Object.assign(Object.assign({},a),{_state:s.getSnapshot(),_send:o})};export{m as AuthenticatorContext,p as Provider,f as useAuthenticator};