@aws/address-form-sdk-js 1.5.0 → 1.6.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 (32) hide show
  1. package/README.md +13 -12
  2. package/dist/lib/address-form-sdk-js.css +1 -1
  3. package/dist/lib/address-form-sdk.cjs.js +1 -1
  4. package/dist/lib/components/AddressForm/index.d.ts +2 -2
  5. package/dist/lib/components/AddressFormReact/AddressForm.d.ts +2 -0
  6. package/dist/lib/components/AddressFormReact/AddressFormAddressField.d.ts +1 -1
  7. package/dist/lib/components/AddressFormReact/AddressFormContext.d.ts +3 -0
  8. package/dist/lib/components/AddressFormReact/AddressFormCountryField.d.ts +1 -1
  9. package/dist/lib/components/AddressFormReact/AddressFormProvider.d.ts +2 -0
  10. package/dist/lib/components/AddressFormReact/AddressFormTextField.d.ts +1 -1
  11. package/dist/lib/components/AddressFormReact/SubmitButton.d.ts +2 -0
  12. package/dist/lib/components/AddressFormReact/render.d.ts +2 -0
  13. package/dist/lib/components/AmazonLocationProvider/index.d.ts +1 -1
  14. package/dist/lib/components/Button/index.d.ts +1 -1
  15. package/dist/lib/components/CountrySelect/index.d.ts +1 -1
  16. package/dist/lib/components/Flex/index.d.ts +1 -1
  17. package/dist/lib/components/FormField/index.d.ts +1 -1
  18. package/dist/lib/components/Input/index.d.ts +1 -1
  19. package/dist/lib/components/LocateButton/index.d.ts +3 -1
  20. package/dist/lib/components/Map/index.d.ts +1 -1
  21. package/dist/lib/components/MapMarker/index.d.ts +2 -1
  22. package/dist/lib/components/Tooltip/index.d.ts +1 -1
  23. package/dist/lib/components/Typeahead/index.d.ts +3 -1
  24. package/dist/lib/components/Typeahead/use-typeahead-query.d.ts +1 -1
  25. package/dist/lib/icons/Locate.d.ts +1 -1
  26. package/dist/lib/icons/Logo.d.ts +1 -1
  27. package/dist/lib/utils/bounds.d.ts +3 -0
  28. package/dist/standalone/address-form-sdk.css +1 -1
  29. package/dist/standalone/address-form-sdk.umd.js +460 -448
  30. package/dist/standalone/maplibre-gl-shared.mjs +5 -0
  31. package/dist/standalone/maplibre-gl-worker.mjs +5 -0
  32. package/package.json +16 -20
@@ -0,0 +1,5 @@
1
+ /**
2
+ * MapLibre GL JS
3
+ * @license 3-Clause BSD. Full text of license: https://github.com/maplibre/maplibre-gl-js/blob/v6.8.0/LICENSE.txt
4
+ */
5
+ import{$n as e,$t as t,An as n,Cn as r,D as i,En as a,F as o,Fn as s,N as c,Nn as l,On as u,Pr as d,Ri as f,Rr as p,Sn as m,Tt as h,U as g,_,c as v,d as y,en as b,g as x,gr as S,hn as C,i as w,l as T,ln as E,lr as D,lt as O,mr as k,o as A,r as j,rn as M,sr as N,t as P,tr as F,un as I,vt as L,wt as R,z,zt as B}from"./maplibre-gl-shared.mjs";function V(e){let t=typeof e;if(t===`number`||t===`boolean`||t===`string`||e==null)return JSON.stringify(e);if(Array.isArray(e)){let t=`[`;for(let n of e)t+=`${V(n)},`;return`${t}]`}let n=Object.keys(e).sort(),r=`{`;for(let t=0;t<n.length;t++)r+=`${JSON.stringify(n[t])}:${V(e[n[t]])},`;return`${r}}`}function H(e){let t=``;for(let n of C)t+=`/${V(e[n])}`;return t}function U(e,t){let n={};for(let r=0;r<e.length;r++){let i=t&&t[e[r].id]||H(e[r]);t&&(t[e[r].id]=i);let a=n[i];a||=n[i]=[],a.push(e[r])}let r=[];for(let e in n)r.push(n[e]);return r}var W=class{constructor(e,t){this.keyCache={},e&&this.replace(e,t)}replace(e,t){this._layerConfigs={},this._layers={},this.update(e,[],t)}update(e,t,n){for(let t of e){this._layerConfigs[t.id]=t;let e=this._layers[t.id]=_(t,n);e._featureFilter=E(e.filter,`layers[${t.id}].filter`,n),this.keyCache[t.id]&&delete this.keyCache[t.id]}for(let e of t)delete this.keyCache[e],delete this._layerConfigs[e],delete this._layers[e];this.familiesBySource={};let r=U(Object.values(this._layerConfigs),this.keyCache);for(let e of r){let t=e.map(e=>this._layers[e.id]),n=t[0];if(n.isHidden())continue;let r=n.source||``,i=this.familiesBySource[r];i||=this.familiesBySource[r]={};let a=n.sourceLayer||`_geojsonTileLayer`,o=i[a];o||=i[a]=[],o.push(t)}}},G=class{constructor(e){let t={},n=[];for(let r in e){let i=e[r],a=t[r]={};for(let e in i){let t=i[e];if(!t||t.bitmap.width===0||t.bitmap.height===0)continue;let r={x:0,y:0,w:t.bitmap.width+2,h:t.bitmap.height+2};n.push(r),a[e]={rect:r,metrics:t.metrics}}}let{w:r,h:i}=o(n),a=new R({width:r||1,height:i||1});for(let n in e){let r=e[n];for(let e in r){let i=r[e];if(!i||i.bitmap.width===0||i.bitmap.height===0)continue;let o=t[n][e].rect;R.copy(i.bitmap,a,{x:0,y:0},{x:o.x+1,y:o.y+1},i.bitmap)}}this.image=a,this.positions=t}};M(`GlyphAtlas`,G);var K=class{constructor(e){this.tileID=new y(e.tileID.overscaledZ,e.tileID.wrap,e.tileID.canonical.z,e.tileID.canonical.x,e.tileID.canonical.y),this.uid=e.uid,this.zoom=e.zoom,this.pixelRatio=e.pixelRatio,this.tileSize=e.tileSize,this.source=e.source,this.overscaling=this.tileID.overscaleFactor(),this.showCollisionBoxes=e.showCollisionBoxes,this.collectResourceTiming=!!e.collectResourceTiming,this.returnDependencies=!!e.returnDependencies,this.promoteId=e.promoteId,this.inFlightDependencies=[]}async parse(e,t,n,r,i){this.data=e,this.collisionBoxArray=new B;let a=new A(Object.keys(e.layers).sort()),o=new j(this.tileID,this.promoteId);o.bucketLayerIDs=[];let s={},l={featureIndex:o,iconDependencies:{},patternDependencies:{},glyphDependencies:{},dashDependencies:{},availableImages:n,subdivisionGranularity:i},u=t.familiesBySource[this.source];for(let t in u){let r=e.layers[t];if(!r)continue;r.version===1&&d(`Vector tile source "${this.source}" layer "${t}" does not use vector tile spec v2 and therefore may have some rendering errors.`);let i=a.encode(t),c=[];for(let e=0;e<r.length;e++){let n=r.feature(e),a=o.getId(n,t);c.push({feature:n,id:a,index:e,sourceLayerIndex:i})}for(let e of u[t]){let t=e[0];t.source!==this.source&&d(`layer.source = ${t.source} does not equal this.source = ${this.source}`),!t.isHidden(this.zoom,!0)&&(q(e,this.zoom,n),(s[t.id]=t.createBucket({index:o.bucketLayerIDs.length,layers:e,zoom:this.zoom,pixelRatio:this.pixelRatio,overscaling:this.overscaling,collisionBoxArray:this.collisionBoxArray,sourceLayerIndex:i,sourceID:this.source})).populate(c,l,this.tileID.canonical),o.bucketLayerIDs.push(e.map(e=>e.id)))}}let f=S(l.glyphDependencies,e=>Object.keys(e));for(let e of this.inFlightDependencies)e?.abort();this.inFlightDependencies=[];let p=Promise.resolve({});if(Object.keys(f).length){let e=new AbortController;this.inFlightDependencies.push(e),p=r.sendAsync({type:`GG`,data:{stacks:f,source:this.source,tileID:this.tileID,type:`glyphs`}},e)}let m=Object.keys(l.iconDependencies),h=Promise.resolve({});if(m.length){let e=new AbortController;this.inFlightDependencies.push(e),h=r.sendAsync({type:`GI`,data:{icons:m,source:this.source,tileID:this.tileID,type:`icons`}},e)}let g=Object.keys(l.patternDependencies),_=Promise.resolve({});if(g.length){let e=new AbortController;this.inFlightDependencies.push(e),_=r.sendAsync({type:`GI`,data:{icons:g,source:this.source,tileID:this.tileID,type:`patterns`}},e)}let v=l.dashDependencies,y=Promise.resolve({});if(Object.keys(v).length){let e=new AbortController;this.inFlightDependencies.push(e),y=r.sendAsync({type:`GDA`,data:{dashes:v}},e)}let[b,x,C,w]=await Promise.all([p,h,_,y]),T=new G(b),E=new c(x,C);for(let e in s){let t=s[e];t.hasDependencies&&(q(t.layers,this.zoom,n),t.addFeatures({options:l,canonical:this.tileID.canonical,glyphMap:b,glyphPositions:T.positions,iconMap:x,iconPositions:E.iconPositions,patternMap:C,patternPositions:E.patternPositions,dashPositions:w,showCollisionBoxes:this.showCollisionBoxes}))}return{buckets:Object.values(s).filter(e=>!e.isEmpty()),featureIndex:o,collisionBoxArray:this.collisionBoxArray,glyphAtlasImage:T.image,imageAtlas:E,dashPositions:w,glyphMap:this.returnDependencies?b:null,iconMap:this.returnDependencies?x:null,glyphPositions:this.returnDependencies?T.positions:null}}};function q(e,n,r){let i=new t(n);for(let t of e)t.recalculate(i,r)}var J=class{constructor(){this.loading={},this.loaded={},this.parsing={}}startLoading(e,t){this.loading[e]=t}finishLoading(e){delete this.loading[e]}abort(e){let t=this.loading[e];t?.abort&&(t.abort.abort(),delete this.loading[e])}getParsing(e){return this.parsing[e]}setParsing(e,t){this.parsing[e]=t}removeParsing(e){delete this.parsing[e]}markLoaded(e,t){this.loaded[e]=t}getLoaded(e){let t=this.loaded[e];if(t)return t}removeLoaded(e){delete this.loaded[e]}clearLoaded(){this.loaded={}}},Y=class{constructor(e){this.start=`${e}#start`,this.end=`${e}#end`,this.measure=e,performance.mark(this.start)}finish(){performance.mark(this.end);let e=performance.getEntriesByName(this.measure);return e.length===0&&(performance.measure(this.measure,this.start,this.end),e=performance.getEntriesByName(this.measure),performance.clearMarks(this.start),performance.clearMarks(this.end),performance.clearMeasures(this.measure)),e}},X=class{constructor(e,t,n,r,i){this.type=e,this.properties=n||{},this.extent=i,this.pointsArray=t,this.id=r}loadGeometry(){return this.pointsArray.map(e=>e.map(e=>new f(e.x,e.y)))}},ee=class{constructor(e,t,n){this.version=2,this._myFeatures=e,this.name=t,this.length=e.length,this.extent=n}feature(e){return this._myFeatures[e]}},te=class{constructor(){this.layers={}}addLayer(e){this.layers[e.name]=e}};function ne(e,t,n){let{extent:r}=e,a=2**(n.z-t.z),o=(n.x-t.x*a)*r,s=(n.y-t.y*a)*r,c=[];for(let t=0;t<e.length;t++){let n=e.feature(t),l=n.loadGeometry();for(let e of l)for(let t of e)t.x=t.x*a-o,t.y=t.y*a-s;l=i(l,n.type,-128,-128,r+128,r+128),l.length!==0&&c.push(new X(n.type,l,n.properties,n.id,r))}return new ee(c,e.name,r)}var re=class{constructor(e,t,n){this.actor=e,this.layerIndex=t,this.availableImages=n,this.tileState=new J,this.overzoomedTileResultCache=new P(1e3)}loadVectorTile(t,n){try{return{vectorTile:t.encoding===`mlt`?new w(n):new O(new z(n)),rawData:n}}catch(r){let i=new Uint8Array(n),a=i[0]===31&&i[1]===139,o=`Unable to parse the tile at ${t.request.url}, `;throw o+=a?`please make sure the data is not gzipped and that you have configured the relevant header in the server`:`got error: ${e(r).message}`,Error(o)}}async loadTile(e){let{uid:t,overzoomParameters:n}=e;n&&(e.request=n.overzoomRequest);let r=this._startRequestTiming(e),i=new K(e);this.tileState.startLoading(t,i);let a=new AbortController;i.abort=a;try{let o=await m(e.request,a);if(e.etag&&e.etag===o.etag)return this.tileState.finishLoading(t),this._getEtagUnmodifiedResult(o,r);let s=this.loadVectorTile(e,o.data);if(this.tileState.finishLoading(t),!s)return null;let{vectorTile:c,rawData:l}=s;n&&({vectorTile:c,rawData:l}=this._getOverzoomTile(e,c));let u=this._getExpiryData(o),d=this._finishRequestTiming(r);i.vectorTile=c,i.etag=o.etag,this.tileState.markLoaded(t,i);let f={rawData:l,cacheControl:u,resourceTiming:d};return this.tileState.setParsing(t,f),await this._parseWorkerTile(i,e)}catch(e){throw this.tileState.finishLoading(t),this.tileState.markLoaded(t,i),e}}_getEtagUnmodifiedResult(e,t){let n=this._getExpiryData(e),r=this._finishRequestTiming(t);return F({etagUnmodified:!0},n,r)}async _parseWorkerTile(e,t){let n=this.tileState.getParsing(e.uid),r=await e.parse(e.vectorTile,this.layerIndex,this.availableImages,this.actor,t.subdivisionGranularity);if(n){let{rawData:i,cacheControl:a,resourceTiming:o}=n,s=t.overzoomParameters?`mvt`:t.encoding;r=F({rawTileData:i.slice(0),encoding:s},r,a,o),this.tileState.removeParsing(e.uid)}else e.etag&&(r=F(r,{etag:e.etag}));return r}_getExpiryData({expires:e,cacheControl:t,etag:n}){let r={};return e&&(r.expires=e),t&&(r.cacheControl=t),n&&(r.etag=n),r}_startRequestTiming(e){if(e.request?.collectResourceTiming)return new Y(e.request.url)}_finishRequestTiming(e){let t=e?.finish();return t?{resourceTiming:JSON.parse(JSON.stringify(t))}:{}}_getOverzoomTile(e,t){let{tileID:n,source:r,overzoomParameters:i}=e,{maxZoomTileID:a}=i,o=`${a.key}_${n.key}_${e.request?.url}`,s=this.overzoomedTileResultCache.get(o);if(s)return s;let c=new te,l=this.layerIndex.familiesBySource[r];for(let e in l){let r=t.layers[e];if(!r)continue;let i=ne(r,a,n.canonical);i.length>0&&c.addLayer(i)}let u={vectorTile:c,rawData:T(c).buffer};return this.overzoomedTileResultCache.set(o,u),u}async reloadTile(e){let t=e.uid,n=this.tileState.getLoaded(t);if(!n)throw Error(`Should not be trying to reload a tile that was never loaded or has been removed`);if(n.vectorTile)return n.showCollisionBoxes=e.showCollisionBoxes,await this._parseWorkerTile(n,e)}async abortTile(e){this.tileState.abort(e.uid)}async removeTile(e){this.tileState.removeLoaded(e.uid)}},ie=class{constructor(){this.loaded={}}async loadTile(e){let{uid:t,encoding:n,rawImageData:r,redFactor:i,greenFactor:a,blueFactor:o,baseShift:s}=e,c=r.width+4,l=r.height+4,u=D(r)?new h({width:c,height:l},await N(r,-2,-2,c,l)):r,d=new L(t,u,n,i,a,o,s);return this.loaded||={},this.loaded[t]=d,d}removeTile(e){let t=this.loaded,n=e.uid;t?.[n]&&delete t[n]}},ae=class{constructor(e,t,n,r=oe){this.actor=e,this.layerIndex=t,this.availableImages=n,this.tileState=new J,this._createGeoJSONIndex=r}loadVectorTile(e){if(!this._geoJSONIndex)throw Error(`Unable to parse the data into a cluster or geojson`);let{z:t,x:n,y:r}=e.tileID.canonical,i=this._geoJSONIndex.getTile(t,n,r);if(!i)return null;let a=new v(i.features,{version:2,extent:p});return{vectorTile:a,rawData:T(a,s).buffer}}async loadTile(e){let{uid:t}=e,n=new K(e);n.abort=new AbortController;try{let r=this.loadVectorTile(e);if(!r)return null;let{vectorTile:i,rawData:a}=r;n.vectorTile=i,this.tileState.markLoaded(t,n);let o={rawData:a};return this.tileState.setParsing(t,o),await this._parseWorkerTile(n,e)}catch(e){throw this.tileState.markLoaded(t,n),e}}async _parseWorkerTile(e,t){let n=this.tileState.getParsing(e.uid),r=await e.parse(e.vectorTile,this.layerIndex,this.availableImages,this.actor,t.subdivisionGranularity);if(n){let{rawData:t}=n;r=F({rawTileData:t.slice(0),encoding:`mvt`},r),this.tileState.removeParsing(e.uid)}return r}async abortTile(e){this.tileState.abort(e.uid)}async removeTile(e){this.tileState.removeLoaded(e.uid)}async loadData(e){this._pendingRequest?.abort();let t=this._startRequestTiming(e);this._pendingRequest=new AbortController;try{await this.loadAndProcessGeoJSON(e,this._pendingRequest),delete this._pendingRequest,this.tileState.clearLoaded();let n={};return e.request&&(n.data=e.data),this._finishRequestTiming(t,e,n),n}catch(e){if(delete this._pendingRequest,!l(e))throw e;return{abandoned:!0}}}_startRequestTiming(e){if(e.request?.collectResourceTiming)return new Y(e.request.url)}_finishRequestTiming(e,t,n){let r=e?.finish();r&&(n.resourceTiming={[t.source]:JSON.parse(JSON.stringify(r))})}async reloadTile(e){let t=e.uid,n=this.tileState.getLoaded(t);if(!n)return await this.loadTile(e);if(n.vectorTile)return n.showCollisionBoxes=e.showCollisionBoxes,await this._parseWorkerTile(n,e)}async loadAndProcessGeoJSON(e,t){if(e.request&&(e.data=(await r(e.request,t)).data),e.data){e.data=this._filterGeoJSON(e.data,e.filter,e.source),this._geoJSONIndex=this._createGeoJSONIndex(e.data,e);return}if(e.dataDiff){this._geoJSONIndex??=this._createGeoJSONIndex({type:`FeatureCollection`,features:[]},e),this._geoJSONIndex.updateData(e.dataDiff,this._getFilterPredicate(e.filter,e.source));return}if(e.updateCluster&&this._geoJSONIndex.updateClusterOptions(e.geojsonVtOptions.cluster,Z(e)),this._geoJSONIndex==null)throw Error(`Input data given to '${e.source}' is not a valid GeoJSON object.`)}_filterGeoJSON(e,t,n){if(e.type!==`FeatureCollection`)return e;let r=this._getFilterPredicate(t,n);return r?{type:`FeatureCollection`,features:e.features.filter(e=>r(e))}:e}_getFilterPredicate(e,t){if(typeof e!=`boolean`&&!e?.length)return;let n=I(e,`sources.${t}.filter`,{type:`boolean`,"property-type":`data-driven`,overridable:!1,transition:!1});if(n.result===`error`)throw Error(n.value.map(e=>`${e.key}: ${e.message}`).join(`, `));return e=>n.value.evaluate({zoom:0},e)}async removeSource(e){this._pendingRequest?.abort()}getClusterExpansionZoom(e){return this._geoJSONIndex.getClusterExpansionZoom(e.clusterId)}getClusterChildren(e){return this._geoJSONIndex.getClusterChildren(e.clusterId)}getClusterLeaves(e){return this._geoJSONIndex.getClusterLeaves(e.clusterId,e.limit,e.offset)}};function oe(e,t){let n=F(t.geojsonVtOptions||{},{updateable:!0,clusterOptions:Z(t)});return new g(e,n)}function Z({geojsonVtOptions:e,clusterProperties:t,source:n}){if(!t||!e.clusterOptions)return e.clusterOptions;let r={},i={},a={accumulated:null,zoom:0},o={properties:null},s=Object.keys(t);for(let e of s){let[a,o]=t[e],s=I(o,`sources.${n}.clusterProperties.${e}[1]`),c=I(typeof a==`string`?[a,[`accumulated`],[`get`,e]]:a,`sources.${n}.clusterProperties.${e}[0]`);r[e]=s.value,i[e]=c.value}return e.clusterOptions.map=e=>{o.properties=e;let t={};for(let e of s)t[e]=r[e].evaluate(a,o);return t},e.clusterOptions.reduce=(e,t)=>{o.properties=t;for(let t of s)a.accumulated=e[t],e[t]=i[t].evaluate(a,o)},e.clusterOptions}async function Q(e){if(e.endsWith(`.mjs`)){await import(e);return}let t=await fetch(e,{credentials:`same-origin`});if(!t.ok)throw Error(`Failed to load ${e}: ${t.status}`);let n=await t.text();if(/^[ \t]*(import|export)\s/m.test(n)){let e=URL.createObjectURL(new Blob([n],{type:`text/javascript`}));try{await import(e)}finally{URL.revokeObjectURL(e)}return}globalThis.eval(n)}var $=class{constructor(e){this.self=e,this.actor=new x(e),this.layerIndexes={},this.availableImages={},this.workerSources={},this.demWorkerSources={},this.externalWorkerSourceTypes={},this.globalStates=new Map,this.self.registerWorkerSource=(e,t)=>{if(this.externalWorkerSourceTypes[e])throw Error(`Worker source with name "${e}" already registered.`);this.externalWorkerSourceTypes[e]=t},this.self.addProtocol=u,this.self.removeProtocol=n,this.self.registerRTLTextPlugin=e=>{b.setMethods(e)},this.self.makeRequest=a,this.actor.registerMessageHandler(`LDT`,(e,t)=>this._getDEMWorkerSource(e,t.source).loadTile(t)),this.actor.registerMessageHandler(`RDT`,async(e,t)=>{this._getDEMWorkerSource(e,t.source).removeTile(t)}),this.actor.registerMessageHandler(`GCEZ`,async(e,t)=>this._getWorkerSource(e,t.type,t.source).getClusterExpansionZoom(t)),this.actor.registerMessageHandler(`GCC`,async(e,t)=>this._getWorkerSource(e,t.type,t.source).getClusterChildren(t)),this.actor.registerMessageHandler(`GCL`,async(e,t)=>this._getWorkerSource(e,t.type,t.source).getClusterLeaves(t)),this.actor.registerMessageHandler(`LD`,(e,t)=>this._getWorkerSource(e,t.type,t.source).loadData(t)),this.actor.registerMessageHandler(`LT`,(e,t)=>this._getWorkerSource(e,t.type,t.source).loadTile(t)),this.actor.registerMessageHandler(`RT`,(e,t)=>this._getWorkerSource(e,t.type,t.source).reloadTile(t)),this.actor.registerMessageHandler(`AT`,(e,t)=>this._getWorkerSource(e,t.type,t.source).abortTile(t)),this.actor.registerMessageHandler(`RMT`,(e,t)=>this._getWorkerSource(e,t.type,t.source).removeTile(t)),this.actor.registerMessageHandler(`RS`,async(e,t)=>{if(!this.workerSources[e]?.[t.type]?.[t.source])return;let n=this.workerSources[e][t.type][t.source];delete this.workerSources[e][t.type][t.source],n.removeSource!==void 0&&n.removeSource(t)}),this.actor.registerMessageHandler(`RM`,async e=>{delete this.layerIndexes[e],delete this.availableImages[e],delete this.workerSources[e],delete this.demWorkerSources[e],this.globalStates.delete(e)}),this.actor.registerMessageHandler(`SR`,async(e,t)=>{this.referrer=t}),this.actor.registerMessageHandler(`SRPS`,(e,t)=>this._syncRTLPluginState(e,t)),this.actor.registerMessageHandler(`IS`,async(e,t)=>{await Q(t)}),this.actor.registerMessageHandler(`SI`,(e,t)=>this._setImages(e,t)),this.actor.registerMessageHandler(`UL`,async(e,t)=>{this._getLayerIndex(e).update(t.layers,t.removedIds,this._getGlobalState(e))}),this.actor.registerMessageHandler(`UGS`,async(e,t)=>{let n=this._getGlobalState(e);for(let e in t)n[e]=t[e]}),this.actor.registerMessageHandler(`SL`,async(e,t)=>{this._getLayerIndex(e).replace(t,this._getGlobalState(e))})}_getGlobalState(e){let t=this.globalStates.get(e);return t||(t={},this.globalStates.set(e,t)),t}async _setImages(e,t){this.availableImages[e]=t;for(let n in this.workerSources[e]){let r=this.workerSources[e][n];for(let e in r)r[e].availableImages=t}}async _syncRTLPluginState(e,t){return await b.syncState(t,Q)}_getAvailableImages(e){let t=this.availableImages[e];return t||=[],t}_getLayerIndex(e){let t=this.layerIndexes[e];return t||=this.layerIndexes[e]=new W,t}_getWorkerSource(e,t,n){if(this.workerSources[e]||={},this.workerSources[e][t]||={},!this.workerSources[e][t][n]){let r={sendAsync:(t,n)=>(t.targetMapId=e,this.actor.sendAsync(t,n))};switch(t){case`vector`:this.workerSources[e][t][n]=new re(r,this._getLayerIndex(e),this._getAvailableImages(e));break;case`geojson`:this.workerSources[e][t][n]=new ae(r,this._getLayerIndex(e),this._getAvailableImages(e));break;default:this.workerSources[e][t][n]=new this.externalWorkerSourceTypes[t](r,this._getLayerIndex(e),this._getAvailableImages(e))}}return this.workerSources[e][t][n]}_getDEMWorkerSource(e,t){return this.demWorkerSources[e]||={},this.demWorkerSources[e][t]||=new ie,this.demWorkerSources[e][t]}};k(self)&&(self.worker=new $(self));export{$ as default};
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@aws/address-form-sdk-js",
3
3
  "description": "Address Form SDK for Javascript",
4
- "version": "1.5.0",
4
+ "version": "1.6.1",
5
5
  "main": "./dist/lib/address-form-sdk.cjs.js",
6
6
  "types": "dist/lib/main.d.ts",
7
7
  "files": [
@@ -29,14 +29,10 @@
29
29
  "prepare": "vite build"
30
30
  },
31
31
  "devDependencies": {
32
- "@eslint/js": "^9.22.0",
33
- "@storybook/addon-essentials": "^8.6.12",
34
- "@storybook/addon-interactions": "^8.6.12",
35
- "@storybook/addon-onboarding": "^8.6.12",
36
- "@storybook/blocks": "^8.6.12",
37
- "@storybook/react": "^8.6.12",
38
- "@storybook/react-vite": "^8.6.12",
39
- "@storybook/test": "^8.6.12",
32
+ "@eslint/js": "^10.0.1",
33
+ "@storybook/addon-docs": "^10.5.2",
34
+ "@storybook/addon-onboarding": "^10.5.2",
35
+ "@storybook/react-vite": "^10.5.2",
40
36
  "@testing-library/dom": "^10.4.0",
41
37
  "@testing-library/jest-dom": "^6.6.3",
42
38
  "@testing-library/react": "^16.3.0",
@@ -46,11 +42,11 @@
46
42
  "@types/react-dom": "^19.1.0",
47
43
  "@vanilla-extract/vite-plugin": "^5.0.1",
48
44
  "@vitejs/plugin-react": "^4.3.4",
49
- "@vitest/coverage-v8": "^3.2.6",
50
- "eslint": "^9.22.0",
51
- "eslint-plugin-react-hooks": "^5.2.0",
45
+ "@vitest/coverage-v8": "^4.1.12",
46
+ "eslint": "^10.8.0",
47
+ "eslint-plugin-react-hooks": "^7.1.1",
52
48
  "eslint-plugin-react-refresh": "^0.4.19",
53
- "eslint-plugin-storybook": "^0.12.0",
49
+ "eslint-plugin-storybook": "^10.5.2",
54
50
  "glob": "^12.0.0",
55
51
  "globals": "^16.0.0",
56
52
  "jsdom": "^26.1.0",
@@ -59,21 +55,21 @@
59
55
  "react": "^19.1.0",
60
56
  "react-dom": "^19.1.0",
61
57
  "rollup-plugin-visualizer": "^5.14.0",
62
- "storybook": "^8.6.12",
58
+ "storybook": "^10.5.2",
63
59
  "typescript": "~5.7.2",
64
- "typescript-eslint": "^8.26.1",
60
+ "typescript-eslint": "^8.65.0",
65
61
  "vite": "^6.4.1",
66
- "vite-plugin-dts": "^4.5.3",
67
- "vitest": "^3.2.6"
62
+ "vite-plugin-dts": "^5.0.3",
63
+ "vitest": "^4.1.12"
68
64
  },
69
65
  "dependencies": {
70
- "@aws-sdk/client-geo-places": "^3.799.0",
71
- "@aws/amazon-location-utilities-auth-helper": "^1.2.1",
66
+ "@aws-sdk/client-geo-places": "^3.1088.0",
67
+ "@aws/amazon-location-utilities-auth-helper": "^1.3.3",
72
68
  "@headlessui/react": "^2.2.2",
73
69
  "@tanstack/react-query": "^5.81.5",
74
70
  "@vanilla-extract/css": "^1.17.1",
75
71
  "clsx": "^2.1.1",
76
- "maplibre-gl": "^5.4.0",
72
+ "maplibre-gl": "^6.8.0",
77
73
  "react-hook-form": "^7.57.0",
78
74
  "react-map-gl": "^8.0.4",
79
75
  "zustand": "^5.0.8"