@aws-amplify/ui-react 2.15.5 → 2.15.6

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{__rest as o,__awaiter as i}from"../../../node_modules/tslib/tslib.es6.js";import{jsx as e}from"react/jsx-runtime";import{Amplify as t,Auth as r}from"aws-amplify";import l from"maplibre-gl";import{AmplifyMapLibreRequest as a}from"maplibre-gl-js-amplify";import{useState as m,useMemo as n,useEffect as s}from"react";import p from"react-map-gl";const c=c=>{var v,d,{mapLib:f,mapStyle:u,style:g}=c,b=o(c,["mapLib","mapStyle","style"]);const y=t.configure(),[_,j]=m(),h=n((()=>Object.assign({height:"100vh",position:"relative",width:"100vw"},g)),[g]);return s((()=>{i(void 0,void 0,void 0,(function*(){var o;const i=yield r.currentUserCredentials();if(i){const e=null===(o=y.geo)||void 0===o?void 0:o.amazon_location_service.region,{transformRequest:t}=new a(i,e);j((()=>t))}}))}),[null===(v=y.geo)||void 0===v?void 0:v.amazon_location_service.region]),_?e(p,Object.assign({},b,{mapLib:null!=f?f:l,mapStyle:null!=u?u:null===(d=y.geo)||void 0===d?void 0:d.amazon_location_service.maps.default,style:h,transformRequest:_})):null};export{c as MapView};
1
+ import{__rest as o,__awaiter as i}from"../../../node_modules/tslib/tslib.es6.js";import{jsx as e}from"react/jsx-runtime";import{Amplify as t,Auth as r}from"aws-amplify";import l from"maplibre-gl";import{AmplifyMapLibreRequest as m}from"maplibre-gl-js-amplify";import{useMemo as n,useState as a,useEffect as s}from"react";import p from"react-map-gl";const u=u=>{var v,{mapLib:d,mapStyle:c,style:f}=u,g=o(u,["mapLib","mapStyle","style"]);const b=t.configure(),y=n((()=>{var o,i,e,t;return null!==(t=null!==(i=null===(o=b.geo)||void 0===o?void 0:o.amazon_location_service)&&void 0!==i?i:null===(e=b.geo)||void 0===e?void 0:e.AmazonLocationService)&&void 0!==t?t:{}}),[b]),[j,h]=a(),w=n((()=>Object.assign({height:"100vh",position:"relative",width:"100vw"},f)),[f]);return s((()=>{i(void 0,void 0,void 0,(function*(){const o=yield r.currentUserCredentials();if(o){const{region:i}=y,{transformRequest:e}=new m(o,i);h((()=>e))}}))}),[y]),j?e(p,Object.assign({},g,{mapLib:null!=d?d:l,mapStyle:null!=c?c:null===(v=y.maps)||void 0===v?void 0:v.default,style:w,transformRequest:j})):null};export{u as MapView};