react-listing-engine 0.7.14 → 0.7.15
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/index.cjs +1 -1
- package/dist/index.js +1 -1
- package/dist/maps/google/index.cjs +1 -1
- package/dist/maps/google/index.js +1 -1
- package/dist/styled/index.cjs +1 -1
- package/dist/styled/index.js +1 -1
- package/package.json +1 -1
- /package/dist/{chunk-CZSQNQKK.cjs → chunk-2B47DZWF.cjs} +0 -0
- /package/dist/{chunk-K24SFDS3.js → chunk-VJC4ZCO7.js} +0 -0
package/dist/index.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; } var _class; var _class2;"use client";
|
|
2
|
-
var
|
|
2
|
+
var _chunk2B47DZWFcjs = require('./chunk-2B47DZWF.cjs');var b=(r=>(r.Paged="paged",r.Infinite="infinite",r))(b||{});var v=(i=>(i.FiltersChanged="FiltersChanged",i.ResultsLoaded="ResultsLoaded",i.PointClicked="PointClicked",i.BoundsChanged="BoundsChanged",i.LayerToggled="LayerToggled",i))(v||{});var h= (_class =class{__init() {this.listeners=new Set}constructor(t={}){;_class.prototype.__init.call(this);this.query={...t}}getQuery(){return{...this.query}}setQuery(t){this.query={...t},this.notify()}subscribe(t){return this.listeners.add(t),()=>{this.listeners.delete(t)}}notify(){for(let t of[...this.listeners])t()}}, _class);function F(e,t){let r=new Set([...Object.keys(e),...Object.keys(t)]);for(let s of r)if(e[s]!==t[s])return!1;return!0}var f= (_class2 =class{__init2() {this.isSyncing=!1}__init3() {this.unsubscribeEngine=null}__init4() {this.unsubscribeHistory=null}constructor(t){;_class2.prototype.__init2.call(this);_class2.prototype.__init3.call(this);_class2.prototype.__init4.call(this);this.history=t.history,this.toQueryFn=t.toQuery,this.toFiltersFn=t.toFilters,this.hydrateOnStart=_nullishCoalesce(t.hydrateOnStart, () => (!0))}start(t){this.stop(),this.unsubscribeEngine=t.subscribe(()=>{this.isSyncing||this.syncEngineToHistory(t)}),this.unsubscribeHistory=this.history.subscribe(()=>{this.isSyncing||this.withSyncGuard(()=>{this.applyFiltersSafely(t,this.toFiltersFn(this.history.getQuery()))})}),this.hydrateOnStart&&this.withSyncGuard(()=>{this.applyFiltersSafely(t,this.toFiltersFn(this.history.getQuery()))})}stop(){_optionalChain([this, 'access', _ => _.unsubscribeEngine, 'optionalCall', _2 => _2()]),this.unsubscribeEngine=null,_optionalChain([this, 'access', _3 => _3.unsubscribeHistory, 'optionalCall', _4 => _4()]),this.unsubscribeHistory=null}syncEngineToHistory(t){let r=this.toQueryFn(t.state.filters);F(r,this.history.getQuery())||this.withSyncGuard(()=>this.history.setQuery(r))}applyFiltersSafely(t,r){Promise.resolve(t.applyFilters(r)).catch(()=>{})}withSyncGuard(t){this.isSyncing=!0;try{t()}finally{this.isSyncing=!1}}}, _class2);var m=class{constructor(t={}){this.mode=_nullishCoalesce(t.mode, () => ("replace"))}getQuery(){if(typeof window>"u")return{};let t=new URLSearchParams(window.location.search),r={};for(let[s,o]of t)o!==""&&(r[s]=o);return r}setQuery(t){if(typeof window>"u")return;let r=new URLSearchParams;for(let[c,l]of Object.entries(t))l===void 0||l===""||r.set(c,l);let s=r.toString(),o=s?`?${s}`:"";if(o===window.location.search)return;let i=`${window.location.pathname}${o}${window.location.hash}`;this.mode==="push"?window.history.pushState(window.history.state,"",i):window.history.replaceState(window.history.state,"",i)}subscribe(t){return typeof window>"u"?()=>{}:(window.addEventListener("popstate",t),()=>{window.removeEventListener("popstate",t)})}};var _jsxruntime = require('react/jsx-runtime');function st({children:e}){let{Toolbar:t}=_chunk2B47DZWFcjs.r.call(void 0, );return _jsxruntime.jsx.call(void 0, t,{children:e})}var _react = require('react');function ut(){let e=_chunk2B47DZWFcjs.t.call(void 0, ),t=_chunk2B47DZWFcjs.u.call(void 0, ),r=_react.useCallback.call(void 0, n=>e.loadPoints(n),[e]),s=_react.useCallback.call(void 0, (n,p)=>e.selectPoint(n,p),[e]),o=_react.useCallback.call(void 0, n=>e.setHovered(e.primaryDatasetId,n),[e]),i=_react.useCallback.call(void 0, ()=>_optionalChain([e, 'access', _5 => _5.map, 'optionalAccess', _6 => _6.zoomIn, 'call', _7 => _7()]),[e]),c=_react.useCallback.call(void 0, ()=>_optionalChain([e, 'access', _8 => _8.map, 'optionalAccess', _9 => _9.zoomOut, 'call', _10 => _10()]),[e]),l=_react.useCallback.call(void 0, ()=>_optionalChain([e, 'access', _11 => _11.map, 'optionalAccess', _12 => _12.toggleFullscreen, 'call', _13 => _13()]),[e]),g=_react.useCallback.call(void 0, (n,p)=>e.fitBounds(n,p),[e]);return{bounds:t.bounds,points:t.points,hovered:t.hovered,loadPoints:r,selectPoint:s,setHovered:o,zoomIn:i,zoomOut:c,toggleFullscreen:l,fitBounds:g}}function ht(e){let t=_chunk2B47DZWFcjs.t.call(void 0, ),r=_chunk2B47DZWFcjs.u.call(void 0, ),s=_react.useCallback.call(void 0, ()=>t.toggleLayer(e),[t,e]);return{visible:_nullishCoalesce(r.layers[e], () => (!0)),points:_nullishCoalesce(r.points[e], () => ([])),toggle:s}}exports.BrowserHistoryPort = m; exports.DatasetRegistry = _chunk2B47DZWFcjs.c; exports.FallbackPopup = _chunk2B47DZWFcjs.p; exports.FilterRegistry = _chunk2B47DZWFcjs.b; exports.ListingApp = _chunk2B47DZWFcjs.S; exports.ListingComponentsProvider = _chunk2B47DZWFcjs.q; exports.ListingConfig = _chunk2B47DZWFcjs.f; exports.ListingEngine = _chunk2B47DZWFcjs.g; exports.ListingEngineContext = _chunk2B47DZWFcjs.s; exports.ListingEventType = v; exports.ListingFilters = _chunk2B47DZWFcjs.w; exports.ListingList = _chunk2B47DZWFcjs.y; exports.ListingMap = _chunk2B47DZWFcjs.z; exports.ListingPagination = _chunk2B47DZWFcjs.A; exports.ListingProvider = _chunk2B47DZWFcjs.D; exports.ListingResultHeader = _chunk2B47DZWFcjs.B; exports.ListingStore = _chunk2B47DZWFcjs.a; exports.ListingToolbar = st; exports.MemoryHistoryPort = h; exports.PaginationMode = b; exports.TypedEmitter = _chunk2B47DZWFcjs.d; exports.UrlSyncController = f; exports.composeListingProviders = _chunk2B47DZWFcjs.h; exports.listingDefaultConfig = _chunk2B47DZWFcjs.e; exports.useListing = _chunk2B47DZWFcjs.t; exports.useListingComponents = _chunk2B47DZWFcjs.r; exports.useListingEvent = _chunk2B47DZWFcjs.C; exports.useListingFilters = _chunk2B47DZWFcjs.v; exports.useListingLayer = ht; exports.useListingMap = ut; exports.useListingResults = _chunk2B47DZWFcjs.x; exports.useListingState = _chunk2B47DZWFcjs.u; exports.withConfig = _chunk2B47DZWFcjs.i; exports.withDataset = _chunk2B47DZWFcjs.k; exports.withFilters = _chunk2B47DZWFcjs.l; exports.withInitialFilters = _chunk2B47DZWFcjs.n; exports.withMap = _chunk2B47DZWFcjs.j; exports.withPrimaryDataset = _chunk2B47DZWFcjs.o; exports.withUrlSync = _chunk2B47DZWFcjs.m;
|
package/dist/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import{A as V,B as W,C as X,D as Y,S as P,a as Q,b as x,c as T,d as L,e as O,f as H,g as E,h as k,i as q,j as B,k as C,l as I,m as U,n as z,o as G,p as R,q as $,r as d,s as j,t as u,u as y,v as A,w as D,x as J,y as K,z as N}from"./chunk-
|
|
2
|
+
import{A as V,B as W,C as X,D as Y,S as P,a as Q,b as x,c as T,d as L,e as O,f as H,g as E,h as k,i as q,j as B,k as C,l as I,m as U,n as z,o as G,p as R,q as $,r as d,s as j,t as u,u as y,v as A,w as D,x as J,y as K,z as N}from"./chunk-VJC4ZCO7.js";var b=(r=>(r.Paged="paged",r.Infinite="infinite",r))(b||{});var v=(i=>(i.FiltersChanged="FiltersChanged",i.ResultsLoaded="ResultsLoaded",i.PointClicked="PointClicked",i.BoundsChanged="BoundsChanged",i.LayerToggled="LayerToggled",i))(v||{});var h=class{query;listeners=new Set;constructor(t={}){this.query={...t}}getQuery(){return{...this.query}}setQuery(t){this.query={...t},this.notify()}subscribe(t){return this.listeners.add(t),()=>{this.listeners.delete(t)}}notify(){for(let t of[...this.listeners])t()}};function F(e,t){let r=new Set([...Object.keys(e),...Object.keys(t)]);for(let s of r)if(e[s]!==t[s])return!1;return!0}var f=class{history;toQueryFn;toFiltersFn;hydrateOnStart;isSyncing=!1;unsubscribeEngine=null;unsubscribeHistory=null;constructor(t){this.history=t.history,this.toQueryFn=t.toQuery,this.toFiltersFn=t.toFilters,this.hydrateOnStart=t.hydrateOnStart??!0}start(t){this.stop(),this.unsubscribeEngine=t.subscribe(()=>{this.isSyncing||this.syncEngineToHistory(t)}),this.unsubscribeHistory=this.history.subscribe(()=>{this.isSyncing||this.withSyncGuard(()=>{this.applyFiltersSafely(t,this.toFiltersFn(this.history.getQuery()))})}),this.hydrateOnStart&&this.withSyncGuard(()=>{this.applyFiltersSafely(t,this.toFiltersFn(this.history.getQuery()))})}stop(){this.unsubscribeEngine?.(),this.unsubscribeEngine=null,this.unsubscribeHistory?.(),this.unsubscribeHistory=null}syncEngineToHistory(t){let r=this.toQueryFn(t.state.filters);F(r,this.history.getQuery())||this.withSyncGuard(()=>this.history.setQuery(r))}applyFiltersSafely(t,r){Promise.resolve(t.applyFilters(r)).catch(()=>{})}withSyncGuard(t){this.isSyncing=!0;try{t()}finally{this.isSyncing=!1}}};var m=class{mode;constructor(t={}){this.mode=t.mode??"replace"}getQuery(){if(typeof window>"u")return{};let t=new URLSearchParams(window.location.search),r={};for(let[s,o]of t)o!==""&&(r[s]=o);return r}setQuery(t){if(typeof window>"u")return;let r=new URLSearchParams;for(let[c,l]of Object.entries(t))l===void 0||l===""||r.set(c,l);let s=r.toString(),o=s?`?${s}`:"";if(o===window.location.search)return;let i=`${window.location.pathname}${o}${window.location.hash}`;this.mode==="push"?window.history.pushState(window.history.state,"",i):window.history.replaceState(window.history.state,"",i)}subscribe(t){return typeof window>"u"?()=>{}:(window.addEventListener("popstate",t),()=>{window.removeEventListener("popstate",t)})}};import{jsx as w}from"react/jsx-runtime";function st({children:e}){let{Toolbar:t}=d();return w(t,{children:e})}import{useCallback as a}from"react";function ut(){let e=u(),t=y(),r=a(n=>e.loadPoints(n),[e]),s=a((n,p)=>e.selectPoint(n,p),[e]),o=a(n=>e.setHovered(e.primaryDatasetId,n),[e]),i=a(()=>e.map?.zoomIn(),[e]),c=a(()=>e.map?.zoomOut(),[e]),l=a(()=>e.map?.toggleFullscreen(),[e]),g=a((n,p)=>e.fitBounds(n,p),[e]);return{bounds:t.bounds,points:t.points,hovered:t.hovered,loadPoints:r,selectPoint:s,setHovered:o,zoomIn:i,zoomOut:c,toggleFullscreen:l,fitBounds:g}}import{useCallback as S}from"react";function ht(e){let t=u(),r=y(),s=S(()=>t.toggleLayer(e),[t,e]);return{visible:r.layers[e]??!0,points:r.points[e]??[],toggle:s}}export{m as BrowserHistoryPort,T as DatasetRegistry,R as FallbackPopup,x as FilterRegistry,P as ListingApp,$ as ListingComponentsProvider,H as ListingConfig,E as ListingEngine,j as ListingEngineContext,v as ListingEventType,D as ListingFilters,K as ListingList,N as ListingMap,V as ListingPagination,Y as ListingProvider,W as ListingResultHeader,Q as ListingStore,st as ListingToolbar,h as MemoryHistoryPort,b as PaginationMode,L as TypedEmitter,f as UrlSyncController,k as composeListingProviders,O as listingDefaultConfig,u as useListing,d as useListingComponents,X as useListingEvent,A as useListingFilters,ht as useListingLayer,ut as useListingMap,J as useListingResults,y as useListingState,q as withConfig,C as withDataset,I as withFilters,z as withInitialFilters,B as withMap,G as withPrimaryDataset,U as withUrlSync};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }"use client";
|
|
2
|
-
var _jsapiloader = require('@googlemaps/js-api-loader');var G="DEMO_MAP_ID";function M(n){return n.raw}function B(n,r){if(n.element)return n.element;if(n.iconUrl)return new r.PinElement({glyphSrc:n.iconUrl}).element}var H=12,W="#b3261e";function U(n){if(n.element)return n.element;if(n.iconUrl){let l=document.createElement("img");return l.src=n.iconUrl,l}let r=document.createElement("div");return r.style.width=`${H}px`,r.style.height=`${H}px`,r.style.borderRadius="50%",r.style.backgroundColor=W,r.style.border="2px solid #ffffff",r.style.boxShadow="0 1px 4px rgba(0, 0, 0, 0.4)",r}var y;function Z(){if(y)return y;class n extends google.maps.OverlayView{constructor(t,a,i,e){super();n.prototype.__init.call(this);;this.position=t;this.content=a;this.onClick=i;this.lifecycle=e}__init() {this.div=null}onAdd(){let t=document.createElement("div");t.style.position="absolute",t.style.transform="translate(-50%, -50%)",this.onClick&&(t.style.cursor="pointer",t.addEventListener("click",this.onClick)),t.appendChild(this.content),this.div=t,_optionalChain([this, 'access', _2 => _2.getPanes, 'call', _3 => _3(), 'optionalAccess', _4 => _4.overlayMouseTarget, 'access', _5 => _5.appendChild, 'call', _6 => _6(t)]),typeof google.maps.OverlayView.preventMapHitsFrom=="function"&&google.maps.OverlayView.preventMapHitsFrom(t),this.lifecycle.onContainerAdd(t)}draw(){if(!this.div)return;let t=this.getProjection();if(!t)return;let a=t.fromLatLngToDivPixel(new google.maps.LatLng(this.position.lat,this.position.lng));a&&(this.div.style.left=`${a.x}px`,this.div.style.top=`${a.y}px`)}onRemove(){let t=this.div;_optionalChain([this, 'access', _7 => _7.div, 'optionalAccess', _8 => _8.remove, 'call', _9 => _9()]),this.div=null,t&&this.lifecycle.onContainerRemove(t)}}return y=n,y}var v=14,D=8;function V(n){let{anchorX:r,anchorY:l,popupW:t,popupH:a,mapW:i,mapH:e,offsetY:o,pad:s}=n,c=r-t/2,d=r+t/2,p=0;t>i-s*2?p=s-c:d>i-s?p=i-s-d:c<s&&(p=s-c);let u=l-o-a,m=l+o+a,f=u<s&&m<=e-s;return{dx:p,flipBelow:f}}var h;function Y(){if(h)return h;class n extends google.maps.OverlayView{constructor(t,a,i){super();n.prototype.__init2.call(this);n.prototype.__init3.call(this);;this.container=t;this.position=a;this.mapContainerEl=i}__init2() {this.attached=!1}__init3() {this.clampOffset=null}onAdd(){this.attached=!0,_optionalChain([this, 'access', _10 => _10.getPanes, 'call', _11 => _11(), 'optionalAccess', _12 => _12.floatPane, 'access', _13 => _13.appendChild, 'call', _14 => _14(this.container)]),typeof google.maps.OverlayView.preventMapHitsAndGesturesFrom=="function"&&google.maps.OverlayView.preventMapHitsAndGesturesFrom(this.container),typeof requestAnimationFrame<"u"&&requestAnimationFrame(()=>this.draw())}draw(){let t=this.getProjection();if(!t)return;let a=new google.maps.LatLng(this.position.lat,this.position.lng),i=t.fromLatLngToDivPixel(a);if(!i)return;if(this.clampOffset===null){let s=this.container.offsetWidth,c=this.container.offsetHeight,d=s&&c?t.fromLatLngToContainerPixel(a):null;if(!d){this.container.style.transform="translate(-50%, -100%)",this.container.style.left=`${i.x}px`,this.container.style.top=`${i.y-v}px`;return}this.clampOffset=V({anchorX:d.x,anchorY:d.y,popupW:s,popupH:c,mapW:this.mapContainerEl.clientWidth,mapH:this.mapContainerEl.clientHeight,offsetY:v,pad:D})}let{dx:e,flipBelow:o}=this.clampOffset;this.container.style.left=`${i.x+e}px`,o?(this.container.style.top=`${i.y+v}px`,this.container.style.transform="translate(-50%, 0)"):(this.container.style.top=`${i.y-v}px`,this.container.style.transform="translate(-50%, -100%)")}onRemove(){this.attached=!1,this.container.remove()}updatePosition(t){(t.lat!==this.position.lat||t.lng!==this.position.lng)&&(this.clampOffset=null),this.position=t,this.attached&&this.draw()}}return h=n,h}function E(n){for(let r of n)typeof r.setMap=="function"?r.setMap(null):r.map=null}var X="#b3261e",q=40,$=64,j=14;function K(n,r){let l=r.count,t=Math.min($,q+Math.round(Math.log10(l+1)*j)),a=document.createElement("div");return a.textContent=String(l),a.style.display="flex",a.style.alignItems="center",a.style.justifyContent="center",a.style.width=`${t}px`,a.style.height=`${t}px`,a.style.borderRadius="50%",a.style.backgroundColor=X,a.style.border="2px solid #ffffff",a.style.boxShadow="0 1px 4px rgba(0, 0, 0, 0.4)",a.style.color="#ffffff",a.style.fontFamily="inherit",a.style.fontWeight="700",a.style.fontSize=t>=52?"15px":"13px",new n.AdvancedMarkerElement({position:r.position,content:a})}var I=!1;async function N(n,r,l,t){let a;try{a=await Promise.resolve().then(() => _interopRequireWildcard(require("@googlemaps/markerclusterer")))}catch(e){I||(I=!0,console.warn('[react-listing-engine] "@googlemaps/markerclusterer" is not installed -- rendering plain (unclustered) markers instead. Install "@googlemaps/markerclusterer" to enable clustering.',e));return}if(n.layers.get(r)!==l)return;let i=new a.MarkerClusterer({map:n.map,markers:l,algorithmOptions:{maxZoom:t.maxZoom},renderer:{render:e=>K(n.markerLib,e)}});n.clusterers.set(r,i)}function b(n,r){let l=n.clusterers.get(r);l&&(l.setMap(null),n.clusterers.delete(r))}var R=!1;function J(){R||(R=!0,console.warn('[react-listing-engine] Marker clustering is not supported in `styles` (OverlayView) mode -- "@googlemaps/markerclusterer" only manages Marker/AdvancedMarkerElement instances. Rendering plain, unclustered overlay markers instead. Use a `mapId` (advanced-marker mode) to enable clustering.'))}function Q(n,r){return r.markers.map(l=>{let t=new n.markerLib.AdvancedMarkerElement({map:n.map,position:l.position,content:B(l,n.markerLib),gmpClickable:!!r.onMarkerClick});if(r.onMarkerClick){let a=r.onMarkerClick;t.addListener("click",()=>a(l.id))}return t})}function F(n,r,l,t){n.classList.toggle("rle-marker--selected",r===l),n.classList.toggle("rle-marker--hovered",r===t&&r!==l)}function ee(n,r){let l=Z();return r.markers.map(t=>{let a=r.onMarkerClick,i=a?()=>a(t.id):void 0,e=new l(t.position,U(t),i,{onContainerAdd:o=>{n.markerElements.set(t.id,o),F(o,t.id,n.selectedMarkerId,n.hoveredMarkerId)},onContainerRemove:o=>{n.markerElements.get(t.id)===o&&n.markerElements.delete(t.id)}});return e.setMap(n.map),e})}function A(n,r){let l=n.layerMarkerIds.get(r);if(l){for(let t of l)n.markerElements.delete(t);n.layerMarkerIds.delete(r)}}function te(n){let r=n.getSouthWest(),l=n.getNorthEast();return{west:r.lng(),south:r.lat(),east:l.lng(),north:l.lat()}}var k=256,ne=450,re=1500,oe=260,ae=4;function L(n,r){let l=Math.min(Math.max(Math.sin(n*Math.PI/180),-.9999),.9999);return{x:k*(.5+r/360),y:k*(.5-Math.log((1+l)/(1-l))/(4*Math.PI))}}function T(n){let r=Math.PI-2*Math.PI*n.y/k;return{lat:180/Math.PI*Math.atan(.5*(Math.exp(r)-Math.exp(-r))),lng:(n.x/k-.5)*360}}function ie(n,r,l){let t=L(n.north,n.east),a=L(n.south,n.west),i=Math.abs(t.x-a.x),e=Math.abs(t.y-a.y);return i===0||e===0||r===0||l===0?null:{center:T({x:(t.x+a.x)/2,y:(t.y+a.y)/2}),zoom:Math.min(Math.log2(r/i),Math.log2(l/e))}}function se(n){return n<.5?4*n*n*n:1-Math.pow(-2*n+2,3)/2}function le(n,r,l){if(typeof ResizeObserver>"u")return;let t=!1,a=()=>{let{width:e,height:o}=n.getBoundingClientRect();e===0||o===0||(google.maps.event.trigger(r,"resize"),t||(t=!0,r.setCenter(l)))},i=new ResizeObserver(a);return i.observe(n),typeof requestAnimationFrame<"u"?requestAnimationFrame(a):queueMicrotask(a),i}function ce(n){if(!n.apiKey)throw new Error("googleProvider: config.apiKey is required (no hardcoded fallback key is ever used).");let r=!1,l=()=>{r||(_jsapiloader.setOptions.call(void 0, {...n.loaderOptions,key:n.apiKey}),r=!0)},t,a=0;return{async mount(i,e){let o=++a;l();let s=await _jsapiloader.importLibrary.call(void 0, "maps"),c=await _jsapiloader.importLibrary.call(void 0, "marker"),d=_nullishCoalesce(e.center, () => ({lat:0,lng:0})),p=n.styles!=null,u=new s.Map(i,{...n.mapOptions,center:d,zoom:_nullishCoalesce(e.zoom, () => (10)),...p?{styles:n.styles}:{mapId:_nullishCoalesce(n.mapId, () => (G))}}),m=le(i,u,d),f={map:u,containerEl:i,fullscreenEl:_nullishCoalesce(e.fullscreenTarget, () => (i)),markerLib:c,markerMode:p?"overlay":"advanced",layers:new Map,clusterers:new Map,boundsListeners:new Set,clickListeners:new Set,resizeObserver:m,markerElements:new Map,layerMarkerIds:new Map,selectedMarkerId:null,hoveredMarkerId:null,flightFrame:null};return o===a&&(t=f),{raw:f}},renderLayer(i,e){let o=M(i),s=o.layers.get(e.id);s&&(E(s),o.layers.delete(e.id),A(o,e.id)),b(o,e.id);let c=o.markerMode==="overlay"?ee(o,e):Q(o,e);o.layers.set(e.id,c),o.markerMode==="overlay"&&o.layerMarkerIds.set(e.id,e.markers.map(p=>p.id)),e.clustering&&(o.markerMode==="overlay"?J():N(o,e.id,c,e.clustering));let d=!1;return()=>{d||(d=!0,o.layers.get(e.id)===c&&(E(c),o.layers.delete(e.id),b(o,e.id),A(o,e.id)))}},onBoundsChange(i,e){let o=M(i),s=o.map.addListener("idle",()=>{let d=o.map.getBounds();d&&e(te(d))});o.boundsListeners.add(s);let c=!1;return()=>{c||(c=!0,s.remove(),o.boundsListeners.delete(s))}},onMapClick(i){let e=t;if(!e)return()=>{};let o=e.map.addListener("click",()=>i());e.clickListeners.add(o);let s=!1;return()=>{s||(s=!0,o.remove(),e.clickListeners.delete(o))}},fitBounds(i,e,o){let s=M(i);if(s.flightFrame!=null&&(cancelAnimationFrame(s.flightFrame),s.flightFrame=null),!_optionalChain([o, 'optionalAccess', _15 => _15.animate])){s.map.fitBounds(e);return}let c=s.map.getZoom(),d=s.map.getCenter(),p=ie(e,s.containerEl.clientWidth,s.containerEl.clientHeight);if(c==null||!d||!p){s.map.fitBounds(e);return}s.map.setOptions({isFractionalZoomEnabled:!0});let u={...L(d.lat(),d.lng()),zoom:c},m={...L(p.center.lat,p.center.lng),zoom:p.zoom},f=Math.hypot(m.x-u.x,m.y-u.y)*2**Math.min(u.zoom,m.zoom),C=Math.max(s.containerEl.clientWidth,s.containerEl.clientHeight),O=f>C?Math.min(ae,Math.log2(f/C)+1):0,_=Math.min(re,ne+O*oe),S=performance.now(),P=()=>{let x=Math.min(1,(performance.now()-S)/_),g=se(x);s.map.setZoom(u.zoom+(m.zoom-u.zoom)*g-O*Math.sin(Math.PI*g)),s.map.setCenter(T({x:u.x+(m.x-u.x)*g,y:u.y+(m.y-u.y)*g})),s.flightFrame=x<1?requestAnimationFrame(P):null};s.flightFrame=requestAnimationFrame(P)},destroy(i){let e=M(i);_optionalChain([e, 'access', _16 => _16.resizeObserver, 'optionalAccess', _17 => _17.disconnect, 'call', _18 => _18()]),e.flightFrame!=null&&(cancelAnimationFrame(e.flightFrame),e.flightFrame=null);for(let o of e.boundsListeners)o.remove();e.boundsListeners.clear();for(let o of e.clickListeners)o.remove();e.clickListeners.clear();for(let o of[...e.clusterers.keys()])b(e,o);for(let o of e.layers.values())E(o);e.layers.clear(),e.markerElements.clear(),e.layerMarkerIds.clear(),t===e&&(t=void 0)},updateMarkerStates(i,e){if(t){t.selectedMarkerId=i,t.hoveredMarkerId=e;for(let[o,s]of t.markerElements)F(s,o,i,e)}},mountOverlay(i){let e=document.createElement("div");if(e.style.position="absolute",e.style.transform="translate(-50%, -100%)",e.style.pointerEvents="auto",!t)return{container:e,setPosition:()=>{},unmount:()=>e.remove()};let o=Y(),s=new o(e,i,t.containerEl);return s.setMap(t.map),{container:e,setPosition:c=>s.updatePosition(c),unmount:()=>{s.setMap(null),e.remove()}}},zoomIn(){t&&t.map.setZoom((_nullishCoalesce(t.map.getZoom(), () => (0)))+1)},zoomOut(){t&&t.map.setZoom((_nullishCoalesce(t.map.getZoom(), () => (0)))-1)},toggleFullscreen(){if(!t)return;let i=t.fullscreenEl,e=document.fullscreenElement;e!=null&&i.contains(e)?typeof document.exitFullscreen=="function"&&_optionalChain([document, 'access', _19 => _19.exitFullscreen, 'call', _20 => _20(), 'optionalAccess', _21 => _21.catch, 'call', _22 => _22(()=>{})]):typeof i.requestFullscreen=="function"&&_optionalChain([i, 'access', _23 => _23.requestFullscreen, 'call', _24 => _24(), 'optionalAccess', _25 => _25.catch, 'call', _26 => _26(()=>{})])}}}exports.googleProvider = ce;
|
|
2
|
+
var _jsapiloader = require('@googlemaps/js-api-loader');var V="DEMO_MAP_ID";function M(t){return t.raw}function U(t,r){if(t.element)return t.element;if(t.iconUrl)return new r.PinElement({glyphSrc:t.iconUrl}).element}var I=12,Y="#b3261e";function D(t){if(t.element)return t.element;if(t.iconUrl){let l=document.createElement("img");return l.src=t.iconUrl,l}let r=document.createElement("div");return r.style.width=`${I}px`,r.style.height=`${I}px`,r.style.borderRadius="50%",r.style.backgroundColor=Y,r.style.border="2px solid #ffffff",r.style.boxShadow="0 1px 4px rgba(0, 0, 0, 0.4)",r}var g;function X(){if(g)return g;class t extends google.maps.OverlayView{constructor(n,i,s,e){super();t.prototype.__init.call(this);;this.position=n;this.content=i;this.onClick=s;this.lifecycle=e}__init() {this.div=null}onAdd(){let n=document.createElement("div");n.style.position="absolute",n.style.transform="translate(-50%, -50%)",this.onClick&&(n.style.cursor="pointer",n.addEventListener("click",this.onClick)),n.appendChild(this.content),this.div=n,_optionalChain([this, 'access', _2 => _2.getPanes, 'call', _3 => _3(), 'optionalAccess', _4 => _4.overlayMouseTarget, 'access', _5 => _5.appendChild, 'call', _6 => _6(n)]),typeof google.maps.OverlayView.preventMapHitsFrom=="function"&&google.maps.OverlayView.preventMapHitsFrom(n),this.lifecycle.onContainerAdd(n)}draw(){if(!this.div)return;let n=this.getProjection();if(!n)return;let i=n.fromLatLngToDivPixel(new google.maps.LatLng(this.position.lat,this.position.lng));i&&(this.div.style.left=`${i.x}px`,this.div.style.top=`${i.y}px`)}onRemove(){let n=this.div;_optionalChain([this, 'access', _7 => _7.div, 'optionalAccess', _8 => _8.remove, 'call', _9 => _9()]),this.div=null,n&&this.lifecycle.onContainerRemove(n)}}return g=t,g}var v=14,q=8;function $(t){let{anchorX:r,anchorY:l,popupW:n,popupH:i,mapW:s,mapH:e,offsetY:o,pad:a}=t,c=r-n/2,d=r+n/2,p=0;n>s-a*2?p=a-c:d>s-a?p=s-a-d:c<a&&(p=a-c);let m=l-o-i,f=l+o+i,u=m<a&&f<=e-a;return{dx:p,flipBelow:u}}var y;function j(){if(y)return y;class t extends google.maps.OverlayView{constructor(n,i,s){super();t.prototype.__init2.call(this);t.prototype.__init3.call(this);;this.container=n;this.position=i;this.mapContainerEl=s}__init2() {this.attached=!1}__init3() {this.clampOffset=null}onAdd(){this.attached=!0,_optionalChain([this, 'access', _10 => _10.getPanes, 'call', _11 => _11(), 'optionalAccess', _12 => _12.floatPane, 'access', _13 => _13.appendChild, 'call', _14 => _14(this.container)]),typeof google.maps.OverlayView.preventMapHitsAndGesturesFrom=="function"&&google.maps.OverlayView.preventMapHitsAndGesturesFrom(this.container),typeof requestAnimationFrame<"u"&&requestAnimationFrame(()=>this.draw())}draw(){let n=this.getProjection();if(!n)return;let i=new google.maps.LatLng(this.position.lat,this.position.lng),s=n.fromLatLngToDivPixel(i);if(!s)return;if(this.clampOffset===null){let a=this.container.offsetWidth,c=this.container.offsetHeight,d=a&&c?n.fromLatLngToContainerPixel(i):null;if(!d){this.container.style.transform="translate(-50%, -100%)",this.container.style.left=`${s.x}px`,this.container.style.top=`${s.y-v}px`;return}this.clampOffset=$({anchorX:d.x,anchorY:d.y,popupW:a,popupH:c,mapW:this.mapContainerEl.clientWidth,mapH:this.mapContainerEl.clientHeight,offsetY:v,pad:q})}let{dx:e,flipBelow:o}=this.clampOffset;this.container.style.left=`${s.x+e}px`,o?(this.container.style.top=`${s.y+v}px`,this.container.style.transform="translate(-50%, 0)"):(this.container.style.top=`${s.y-v}px`,this.container.style.transform="translate(-50%, -100%)")}onRemove(){this.attached=!1,this.container.remove()}updatePosition(n){(n.lat!==this.position.lat||n.lng!==this.position.lng)&&(this.clampOffset=null),this.position=n,this.attached&&this.draw()}}return y=t,y}function b(t){for(let r of t)typeof r.setMap=="function"?r.setMap(null):r.map=null}var K="#b3261e",N=40,J=64,Q=14;function ee(t,r){let l=r.count,n=Math.min(J,N+Math.round(Math.log10(l+1)*Q)),i=document.createElement("div");return i.textContent=String(l),i.style.display="flex",i.style.alignItems="center",i.style.justifyContent="center",i.style.width=`${n}px`,i.style.height=`${n}px`,i.style.borderRadius="50%",i.style.backgroundColor=K,i.style.border="2px solid #ffffff",i.style.boxShadow="0 1px 4px rgba(0, 0, 0, 0.4)",i.style.color="#ffffff",i.style.fontFamily="inherit",i.style.fontWeight="700",i.style.fontSize=n>=52?"15px":"13px",new t.AdvancedMarkerElement({position:r.position,content:i})}var H=!1;async function te(t,r,l,n){let i;try{i=await Promise.resolve().then(() => _interopRequireWildcard(require("@googlemaps/markerclusterer")))}catch(e){H||(H=!0,console.warn('[react-listing-engine] "@googlemaps/markerclusterer" is not installed -- rendering plain (unclustered) markers instead. Install "@googlemaps/markerclusterer" to enable clustering.',e));return}if(t.layers.get(r)!==l)return;let s=new i.MarkerClusterer({map:t.map,markers:l,algorithmOptions:{maxZoom:n.maxZoom},renderer:{render:e=>ee(t.markerLib,e)}});t.clusterers.set(r,s)}function C(t,r){let l=t.clusterers.get(r);l&&(l.setMap(null),t.clusterers.delete(r))}var R=!1;function ne(){R||(R=!0,console.warn('[react-listing-engine] Marker clustering is not supported in `styles` (OverlayView) mode -- "@googlemaps/markerclusterer" only manages Marker/AdvancedMarkerElement instances. Rendering plain, unclustered overlay markers instead. Use a `mapId` (advanced-marker mode) to enable clustering.'))}function re(t,r){return r.markers.map(l=>{let n=new t.markerLib.AdvancedMarkerElement({map:t.map,position:l.position,content:U(l,t.markerLib),gmpClickable:!!r.onMarkerClick});if(r.onMarkerClick){let i=r.onMarkerClick;n.addListener("click",()=>i(l.id))}return n})}function T(t,r,l,n){t.classList.toggle("rle-marker--selected",r===l),t.classList.toggle("rle-marker--hovered",r===n&&r!==l)}function oe(t,r){let l=X();return r.markers.map(n=>{let i=r.onMarkerClick,s=i?()=>i(n.id):void 0,e=new l(n.position,D(n),s,{onContainerAdd:o=>{t.markerElements.set(n.id,o),T(o,n.id,t.selectedMarkerId,t.hoveredMarkerId)},onContainerRemove:o=>{t.markerElements.get(n.id)===o&&t.markerElements.delete(n.id)}});return e.setMap(t.map),e})}function _(t,r){let l=t.layerMarkerIds.get(r);if(l){for(let n of l)t.markerElements.delete(n);t.layerMarkerIds.delete(r)}}function ae(t){let r=t.getSouthWest(),l=t.getNorthEast();return{west:r.lng(),south:r.lat(),east:l.lng(),north:l.lat()}}var h=256,ie=450,se=1500,le=260,ce=4,A=4,de=1400,pe=900,ue=4;function k(t,r){let l=Math.min(Math.max(Math.sin(t*Math.PI/180),-.9999),.9999);return{x:h*(.5+r/360),y:h*(.5-Math.log((1+l)/(1-l))/(4*Math.PI))}}function S(t){let r=Math.PI-2*Math.PI*t.y/h;return{lat:180/Math.PI*Math.atan(.5*(Math.exp(r)-Math.exp(-r))),lng:(t.x/h-.5)*360}}function me(t,r,l){let n=k(t.north,t.east),i=k(t.south,t.west),s=Math.abs(n.x-i.x),e=Math.abs(n.y-i.y);return s===0||e===0||r===0||l===0?null:{center:S({x:(n.x+i.x)/2,y:(n.y+i.y)/2}),zoom:Math.min(Math.log2(r/s),Math.log2(l/e))}}function fe(t){return t<.5?4*t*t*t:1-Math.pow(-2*t+2,3)/2}function F(t,r,l,n,i){let s=performance.now(),e,o=()=>{let a=Math.min(1,(performance.now()-s)/n),c=fe(a);t.map.setZoom(r.zoom+(l.zoom-r.zoom)*c-i*Math.sin(Math.PI*c)),t.map.setCenter(S({x:r.x+(l.x-r.x)*c,y:r.y+(l.y-r.y)*c})),a<1?e=requestAnimationFrame(o):t.cancelFlight=null};return e=requestAnimationFrame(o),()=>cancelAnimationFrame(e)}function Me(t,r,l){if(typeof ResizeObserver>"u")return;let n=!1,i=()=>{let{width:e,height:o}=t.getBoundingClientRect();e===0||o===0||(google.maps.event.trigger(r,"resize"),n||(n=!0,r.setCenter(l)))},s=new ResizeObserver(i);return s.observe(t),typeof requestAnimationFrame<"u"?requestAnimationFrame(i):queueMicrotask(i),s}function ge(t){if(!t.apiKey)throw new Error("googleProvider: config.apiKey is required (no hardcoded fallback key is ever used).");let r=!1,l=()=>{r||(_jsapiloader.setOptions.call(void 0, {...t.loaderOptions,key:t.apiKey}),r=!0)},n,i=0;return{async mount(s,e){let o=++i;l();let a=await _jsapiloader.importLibrary.call(void 0, "maps"),c=await _jsapiloader.importLibrary.call(void 0, "marker"),d=_nullishCoalesce(e.center, () => ({lat:0,lng:0})),p=t.styles!=null,m=new a.Map(s,{...t.mapOptions,center:d,zoom:_nullishCoalesce(e.zoom, () => (10)),...p?{styles:t.styles}:{mapId:_nullishCoalesce(t.mapId, () => (V))}}),f=Me(s,m,d),u={map:m,containerEl:s,fullscreenEl:_nullishCoalesce(e.fullscreenTarget, () => (s)),markerLib:c,markerMode:p?"overlay":"advanced",layers:new Map,clusterers:new Map,boundsListeners:new Set,clickListeners:new Set,resizeObserver:f,markerElements:new Map,layerMarkerIds:new Map,selectedMarkerId:null,hoveredMarkerId:null,cancelFlight:null};return o===i&&(n=u),{raw:u}},renderLayer(s,e){let o=M(s),a=o.layers.get(e.id);a&&(b(a),o.layers.delete(e.id),_(o,e.id)),C(o,e.id);let c=o.markerMode==="overlay"?oe(o,e):re(o,e);o.layers.set(e.id,c),o.markerMode==="overlay"&&o.layerMarkerIds.set(e.id,e.markers.map(p=>p.id)),e.clustering&&(o.markerMode==="overlay"?ne():te(o,e.id,c,e.clustering));let d=!1;return()=>{d||(d=!0,o.layers.get(e.id)===c&&(b(c),o.layers.delete(e.id),C(o,e.id),_(o,e.id)))}},onBoundsChange(s,e){let o=M(s),a=o.map.addListener("idle",()=>{let d=o.map.getBounds();d&&e(ae(d))});o.boundsListeners.add(a);let c=!1;return()=>{c||(c=!0,a.remove(),o.boundsListeners.delete(a))}},onMapClick(s){let e=n;if(!e)return()=>{};let o=e.map.addListener("click",()=>s());e.clickListeners.add(o);let a=!1;return()=>{a||(a=!0,o.remove(),e.clickListeners.delete(o))}},fitBounds(s,e,o){let a=M(s);if(_optionalChain([a, 'access', _15 => _15.cancelFlight, 'optionalCall', _16 => _16()]),a.cancelFlight=null,!_optionalChain([o, 'optionalAccess', _17 => _17.animate])){a.map.fitBounds(e);return}let c=a.map.getZoom(),d=a.map.getCenter(),p=me(e,a.containerEl.clientWidth,a.containerEl.clientHeight);if(c==null||!d||!p){a.map.fitBounds(e);return}a.map.setOptions({isFractionalZoomEnabled:!0});let m={...k(d.lat(),d.lng()),zoom:c},f=k(p.center.lat,p.center.lng),u={...f,zoom:p.zoom},L=Math.hypot(u.x-m.x,u.y-m.y)*2**Math.min(m.zoom,u.zoom),E=Math.max(a.containerEl.clientWidth,a.containerEl.clientHeight);if(L>E*ce){a.map.setCenter(p.center),a.map.setZoom(p.zoom-A);let P=()=>{x();let B=_nullishCoalesce(a.map.getZoom(), () => (p.zoom-A));a.cancelFlight=F(a,{...f,zoom:B},u,de,0)},W=a.map.addListener("tilesloaded",P),G=setTimeout(P,pe),x=()=>{W.remove(),clearTimeout(G)};a.cancelFlight=x;return}let O=L>E?Math.min(ue,Math.log2(L/E)+1):0,z=Math.min(se,ie+O*le);a.cancelFlight=F(a,m,u,z,O)},destroy(s){let e=M(s);_optionalChain([e, 'access', _18 => _18.resizeObserver, 'optionalAccess', _19 => _19.disconnect, 'call', _20 => _20()]),_optionalChain([e, 'access', _21 => _21.cancelFlight, 'optionalCall', _22 => _22()]),e.cancelFlight=null;for(let o of e.boundsListeners)o.remove();e.boundsListeners.clear();for(let o of e.clickListeners)o.remove();e.clickListeners.clear();for(let o of[...e.clusterers.keys()])C(e,o);for(let o of e.layers.values())b(o);e.layers.clear(),e.markerElements.clear(),e.layerMarkerIds.clear(),n===e&&(n=void 0)},updateMarkerStates(s,e){if(n){n.selectedMarkerId=s,n.hoveredMarkerId=e;for(let[o,a]of n.markerElements)T(a,o,s,e)}},mountOverlay(s){let e=document.createElement("div");if(e.style.position="absolute",e.style.transform="translate(-50%, -100%)",e.style.pointerEvents="auto",!n)return{container:e,setPosition:()=>{},unmount:()=>e.remove()};let o=j(),a=new o(e,s,n.containerEl);return a.setMap(n.map),{container:e,setPosition:c=>a.updatePosition(c),unmount:()=>{a.setMap(null),e.remove()}}},zoomIn(){n&&n.map.setZoom((_nullishCoalesce(n.map.getZoom(), () => (0)))+1)},zoomOut(){n&&n.map.setZoom((_nullishCoalesce(n.map.getZoom(), () => (0)))-1)},toggleFullscreen(){if(!n)return;let s=n.fullscreenEl,e=document.fullscreenElement;e!=null&&s.contains(e)?typeof document.exitFullscreen=="function"&&_optionalChain([document, 'access', _23 => _23.exitFullscreen, 'call', _24 => _24(), 'optionalAccess', _25 => _25.catch, 'call', _26 => _26(()=>{})]):typeof s.requestFullscreen=="function"&&_optionalChain([s, 'access', _27 => _27.requestFullscreen, 'call', _28 => _28(), 'optionalAccess', _29 => _29.catch, 'call', _30 => _30(()=>{})])}}}exports.googleProvider = ge;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import{importLibrary as w,setOptions as z}from"@googlemaps/js-api-loader";var G="DEMO_MAP_ID";function M(n){return n.raw}function B(n,r){if(n.element)return n.element;if(n.iconUrl)return new r.PinElement({glyphSrc:n.iconUrl}).element}var H=12,W="#b3261e";function U(n){if(n.element)return n.element;if(n.iconUrl){let l=document.createElement("img");return l.src=n.iconUrl,l}let r=document.createElement("div");return r.style.width=`${H}px`,r.style.height=`${H}px`,r.style.borderRadius="50%",r.style.backgroundColor=W,r.style.border="2px solid #ffffff",r.style.boxShadow="0 1px 4px rgba(0, 0, 0, 0.4)",r}var y;function Z(){if(y)return y;class n extends google.maps.OverlayView{constructor(t,a,i,e){super();this.position=t;this.content=a;this.onClick=i;this.lifecycle=e}position;content;onClick;lifecycle;div=null;onAdd(){let t=document.createElement("div");t.style.position="absolute",t.style.transform="translate(-50%, -50%)",this.onClick&&(t.style.cursor="pointer",t.addEventListener("click",this.onClick)),t.appendChild(this.content),this.div=t,this.getPanes()?.overlayMouseTarget.appendChild(t),typeof google.maps.OverlayView.preventMapHitsFrom=="function"&&google.maps.OverlayView.preventMapHitsFrom(t),this.lifecycle.onContainerAdd(t)}draw(){if(!this.div)return;let t=this.getProjection();if(!t)return;let a=t.fromLatLngToDivPixel(new google.maps.LatLng(this.position.lat,this.position.lng));a&&(this.div.style.left=`${a.x}px`,this.div.style.top=`${a.y}px`)}onRemove(){let t=this.div;this.div?.remove(),this.div=null,t&&this.lifecycle.onContainerRemove(t)}}return y=n,y}var v=14,D=8;function V(n){let{anchorX:r,anchorY:l,popupW:t,popupH:a,mapW:i,mapH:e,offsetY:o,pad:s}=n,c=r-t/2,d=r+t/2,p=0;t>i-s*2?p=s-c:d>i-s?p=i-s-d:c<s&&(p=s-c);let u=l-o-a,m=l+o+a,f=u<s&&m<=e-s;return{dx:p,flipBelow:f}}var h;function Y(){if(h)return h;class n extends google.maps.OverlayView{constructor(t,a,i){super();this.container=t;this.position=a;this.mapContainerEl=i}container;position;mapContainerEl;attached=!1;clampOffset=null;onAdd(){this.attached=!0,this.getPanes()?.floatPane.appendChild(this.container),typeof google.maps.OverlayView.preventMapHitsAndGesturesFrom=="function"&&google.maps.OverlayView.preventMapHitsAndGesturesFrom(this.container),typeof requestAnimationFrame<"u"&&requestAnimationFrame(()=>this.draw())}draw(){let t=this.getProjection();if(!t)return;let a=new google.maps.LatLng(this.position.lat,this.position.lng),i=t.fromLatLngToDivPixel(a);if(!i)return;if(this.clampOffset===null){let s=this.container.offsetWidth,c=this.container.offsetHeight,d=s&&c?t.fromLatLngToContainerPixel(a):null;if(!d){this.container.style.transform="translate(-50%, -100%)",this.container.style.left=`${i.x}px`,this.container.style.top=`${i.y-v}px`;return}this.clampOffset=V({anchorX:d.x,anchorY:d.y,popupW:s,popupH:c,mapW:this.mapContainerEl.clientWidth,mapH:this.mapContainerEl.clientHeight,offsetY:v,pad:D})}let{dx:e,flipBelow:o}=this.clampOffset;this.container.style.left=`${i.x+e}px`,o?(this.container.style.top=`${i.y+v}px`,this.container.style.transform="translate(-50%, 0)"):(this.container.style.top=`${i.y-v}px`,this.container.style.transform="translate(-50%, -100%)")}onRemove(){this.attached=!1,this.container.remove()}updatePosition(t){(t.lat!==this.position.lat||t.lng!==this.position.lng)&&(this.clampOffset=null),this.position=t,this.attached&&this.draw()}}return h=n,h}function E(n){for(let r of n)typeof r.setMap=="function"?r.setMap(null):r.map=null}var X="#b3261e",q=40,$=64,j=14;function K(n,r){let l=r.count,t=Math.min($,q+Math.round(Math.log10(l+1)*j)),a=document.createElement("div");return a.textContent=String(l),a.style.display="flex",a.style.alignItems="center",a.style.justifyContent="center",a.style.width=`${t}px`,a.style.height=`${t}px`,a.style.borderRadius="50%",a.style.backgroundColor=X,a.style.border="2px solid #ffffff",a.style.boxShadow="0 1px 4px rgba(0, 0, 0, 0.4)",a.style.color="#ffffff",a.style.fontFamily="inherit",a.style.fontWeight="700",a.style.fontSize=t>=52?"15px":"13px",new n.AdvancedMarkerElement({position:r.position,content:a})}var I=!1;async function N(n,r,l,t){let a;try{a=await import("@googlemaps/markerclusterer")}catch(e){I||(I=!0,console.warn('[react-listing-engine] "@googlemaps/markerclusterer" is not installed -- rendering plain (unclustered) markers instead. Install "@googlemaps/markerclusterer" to enable clustering.',e));return}if(n.layers.get(r)!==l)return;let i=new a.MarkerClusterer({map:n.map,markers:l,algorithmOptions:{maxZoom:t.maxZoom},renderer:{render:e=>K(n.markerLib,e)}});n.clusterers.set(r,i)}function b(n,r){let l=n.clusterers.get(r);l&&(l.setMap(null),n.clusterers.delete(r))}var R=!1;function J(){R||(R=!0,console.warn('[react-listing-engine] Marker clustering is not supported in `styles` (OverlayView) mode -- "@googlemaps/markerclusterer" only manages Marker/AdvancedMarkerElement instances. Rendering plain, unclustered overlay markers instead. Use a `mapId` (advanced-marker mode) to enable clustering.'))}function Q(n,r){return r.markers.map(l=>{let t=new n.markerLib.AdvancedMarkerElement({map:n.map,position:l.position,content:B(l,n.markerLib),gmpClickable:!!r.onMarkerClick});if(r.onMarkerClick){let a=r.onMarkerClick;t.addListener("click",()=>a(l.id))}return t})}function F(n,r,l,t){n.classList.toggle("rle-marker--selected",r===l),n.classList.toggle("rle-marker--hovered",r===t&&r!==l)}function ee(n,r){let l=Z();return r.markers.map(t=>{let a=r.onMarkerClick,i=a?()=>a(t.id):void 0,e=new l(t.position,U(t),i,{onContainerAdd:o=>{n.markerElements.set(t.id,o),F(o,t.id,n.selectedMarkerId,n.hoveredMarkerId)},onContainerRemove:o=>{n.markerElements.get(t.id)===o&&n.markerElements.delete(t.id)}});return e.setMap(n.map),e})}function A(n,r){let l=n.layerMarkerIds.get(r);if(l){for(let t of l)n.markerElements.delete(t);n.layerMarkerIds.delete(r)}}function te(n){let r=n.getSouthWest(),l=n.getNorthEast();return{west:r.lng(),south:r.lat(),east:l.lng(),north:l.lat()}}var k=256,ne=450,re=1500,oe=260,ae=4;function L(n,r){let l=Math.min(Math.max(Math.sin(n*Math.PI/180),-.9999),.9999);return{x:k*(.5+r/360),y:k*(.5-Math.log((1+l)/(1-l))/(4*Math.PI))}}function T(n){let r=Math.PI-2*Math.PI*n.y/k;return{lat:180/Math.PI*Math.atan(.5*(Math.exp(r)-Math.exp(-r))),lng:(n.x/k-.5)*360}}function ie(n,r,l){let t=L(n.north,n.east),a=L(n.south,n.west),i=Math.abs(t.x-a.x),e=Math.abs(t.y-a.y);return i===0||e===0||r===0||l===0?null:{center:T({x:(t.x+a.x)/2,y:(t.y+a.y)/2}),zoom:Math.min(Math.log2(r/i),Math.log2(l/e))}}function se(n){return n<.5?4*n*n*n:1-Math.pow(-2*n+2,3)/2}function le(n,r,l){if(typeof ResizeObserver>"u")return;let t=!1,a=()=>{let{width:e,height:o}=n.getBoundingClientRect();e===0||o===0||(google.maps.event.trigger(r,"resize"),t||(t=!0,r.setCenter(l)))},i=new ResizeObserver(a);return i.observe(n),typeof requestAnimationFrame<"u"?requestAnimationFrame(a):queueMicrotask(a),i}function ce(n){if(!n.apiKey)throw new Error("googleProvider: config.apiKey is required (no hardcoded fallback key is ever used).");let r=!1,l=()=>{r||(z({...n.loaderOptions,key:n.apiKey}),r=!0)},t,a=0;return{async mount(i,e){let o=++a;l();let s=await w("maps"),c=await w("marker"),d=e.center??{lat:0,lng:0},p=n.styles!=null,u=new s.Map(i,{...n.mapOptions,center:d,zoom:e.zoom??10,...p?{styles:n.styles}:{mapId:n.mapId??G}}),m=le(i,u,d),f={map:u,containerEl:i,fullscreenEl:e.fullscreenTarget??i,markerLib:c,markerMode:p?"overlay":"advanced",layers:new Map,clusterers:new Map,boundsListeners:new Set,clickListeners:new Set,resizeObserver:m,markerElements:new Map,layerMarkerIds:new Map,selectedMarkerId:null,hoveredMarkerId:null,flightFrame:null};return o===a&&(t=f),{raw:f}},renderLayer(i,e){let o=M(i),s=o.layers.get(e.id);s&&(E(s),o.layers.delete(e.id),A(o,e.id)),b(o,e.id);let c=o.markerMode==="overlay"?ee(o,e):Q(o,e);o.layers.set(e.id,c),o.markerMode==="overlay"&&o.layerMarkerIds.set(e.id,e.markers.map(p=>p.id)),e.clustering&&(o.markerMode==="overlay"?J():N(o,e.id,c,e.clustering));let d=!1;return()=>{d||(d=!0,o.layers.get(e.id)===c&&(E(c),o.layers.delete(e.id),b(o,e.id),A(o,e.id)))}},onBoundsChange(i,e){let o=M(i),s=o.map.addListener("idle",()=>{let d=o.map.getBounds();d&&e(te(d))});o.boundsListeners.add(s);let c=!1;return()=>{c||(c=!0,s.remove(),o.boundsListeners.delete(s))}},onMapClick(i){let e=t;if(!e)return()=>{};let o=e.map.addListener("click",()=>i());e.clickListeners.add(o);let s=!1;return()=>{s||(s=!0,o.remove(),e.clickListeners.delete(o))}},fitBounds(i,e,o){let s=M(i);if(s.flightFrame!=null&&(cancelAnimationFrame(s.flightFrame),s.flightFrame=null),!o?.animate){s.map.fitBounds(e);return}let c=s.map.getZoom(),d=s.map.getCenter(),p=ie(e,s.containerEl.clientWidth,s.containerEl.clientHeight);if(c==null||!d||!p){s.map.fitBounds(e);return}s.map.setOptions({isFractionalZoomEnabled:!0});let u={...L(d.lat(),d.lng()),zoom:c},m={...L(p.center.lat,p.center.lng),zoom:p.zoom},f=Math.hypot(m.x-u.x,m.y-u.y)*2**Math.min(u.zoom,m.zoom),C=Math.max(s.containerEl.clientWidth,s.containerEl.clientHeight),O=f>C?Math.min(ae,Math.log2(f/C)+1):0,_=Math.min(re,ne+O*oe),S=performance.now(),P=()=>{let x=Math.min(1,(performance.now()-S)/_),g=se(x);s.map.setZoom(u.zoom+(m.zoom-u.zoom)*g-O*Math.sin(Math.PI*g)),s.map.setCenter(T({x:u.x+(m.x-u.x)*g,y:u.y+(m.y-u.y)*g})),s.flightFrame=x<1?requestAnimationFrame(P):null};s.flightFrame=requestAnimationFrame(P)},destroy(i){let e=M(i);e.resizeObserver?.disconnect(),e.flightFrame!=null&&(cancelAnimationFrame(e.flightFrame),e.flightFrame=null);for(let o of e.boundsListeners)o.remove();e.boundsListeners.clear();for(let o of e.clickListeners)o.remove();e.clickListeners.clear();for(let o of[...e.clusterers.keys()])b(e,o);for(let o of e.layers.values())E(o);e.layers.clear(),e.markerElements.clear(),e.layerMarkerIds.clear(),t===e&&(t=void 0)},updateMarkerStates(i,e){if(t){t.selectedMarkerId=i,t.hoveredMarkerId=e;for(let[o,s]of t.markerElements)F(s,o,i,e)}},mountOverlay(i){let e=document.createElement("div");if(e.style.position="absolute",e.style.transform="translate(-50%, -100%)",e.style.pointerEvents="auto",!t)return{container:e,setPosition:()=>{},unmount:()=>e.remove()};let o=Y(),s=new o(e,i,t.containerEl);return s.setMap(t.map),{container:e,setPosition:c=>s.updatePosition(c),unmount:()=>{s.setMap(null),e.remove()}}},zoomIn(){t&&t.map.setZoom((t.map.getZoom()??0)+1)},zoomOut(){t&&t.map.setZoom((t.map.getZoom()??0)-1)},toggleFullscreen(){if(!t)return;let i=t.fullscreenEl,e=document.fullscreenElement;e!=null&&i.contains(e)?typeof document.exitFullscreen=="function"&&document.exitFullscreen()?.catch(()=>{}):typeof i.requestFullscreen=="function"&&i.requestFullscreen()?.catch(()=>{})}}}export{ce as googleProvider};
|
|
2
|
+
import{importLibrary as w,setOptions as Z}from"@googlemaps/js-api-loader";var V="DEMO_MAP_ID";function M(t){return t.raw}function U(t,r){if(t.element)return t.element;if(t.iconUrl)return new r.PinElement({glyphSrc:t.iconUrl}).element}var I=12,Y="#b3261e";function D(t){if(t.element)return t.element;if(t.iconUrl){let l=document.createElement("img");return l.src=t.iconUrl,l}let r=document.createElement("div");return r.style.width=`${I}px`,r.style.height=`${I}px`,r.style.borderRadius="50%",r.style.backgroundColor=Y,r.style.border="2px solid #ffffff",r.style.boxShadow="0 1px 4px rgba(0, 0, 0, 0.4)",r}var g;function X(){if(g)return g;class t extends google.maps.OverlayView{constructor(n,i,s,e){super();this.position=n;this.content=i;this.onClick=s;this.lifecycle=e}position;content;onClick;lifecycle;div=null;onAdd(){let n=document.createElement("div");n.style.position="absolute",n.style.transform="translate(-50%, -50%)",this.onClick&&(n.style.cursor="pointer",n.addEventListener("click",this.onClick)),n.appendChild(this.content),this.div=n,this.getPanes()?.overlayMouseTarget.appendChild(n),typeof google.maps.OverlayView.preventMapHitsFrom=="function"&&google.maps.OverlayView.preventMapHitsFrom(n),this.lifecycle.onContainerAdd(n)}draw(){if(!this.div)return;let n=this.getProjection();if(!n)return;let i=n.fromLatLngToDivPixel(new google.maps.LatLng(this.position.lat,this.position.lng));i&&(this.div.style.left=`${i.x}px`,this.div.style.top=`${i.y}px`)}onRemove(){let n=this.div;this.div?.remove(),this.div=null,n&&this.lifecycle.onContainerRemove(n)}}return g=t,g}var v=14,q=8;function $(t){let{anchorX:r,anchorY:l,popupW:n,popupH:i,mapW:s,mapH:e,offsetY:o,pad:a}=t,c=r-n/2,d=r+n/2,p=0;n>s-a*2?p=a-c:d>s-a?p=s-a-d:c<a&&(p=a-c);let m=l-o-i,f=l+o+i,u=m<a&&f<=e-a;return{dx:p,flipBelow:u}}var y;function j(){if(y)return y;class t extends google.maps.OverlayView{constructor(n,i,s){super();this.container=n;this.position=i;this.mapContainerEl=s}container;position;mapContainerEl;attached=!1;clampOffset=null;onAdd(){this.attached=!0,this.getPanes()?.floatPane.appendChild(this.container),typeof google.maps.OverlayView.preventMapHitsAndGesturesFrom=="function"&&google.maps.OverlayView.preventMapHitsAndGesturesFrom(this.container),typeof requestAnimationFrame<"u"&&requestAnimationFrame(()=>this.draw())}draw(){let n=this.getProjection();if(!n)return;let i=new google.maps.LatLng(this.position.lat,this.position.lng),s=n.fromLatLngToDivPixel(i);if(!s)return;if(this.clampOffset===null){let a=this.container.offsetWidth,c=this.container.offsetHeight,d=a&&c?n.fromLatLngToContainerPixel(i):null;if(!d){this.container.style.transform="translate(-50%, -100%)",this.container.style.left=`${s.x}px`,this.container.style.top=`${s.y-v}px`;return}this.clampOffset=$({anchorX:d.x,anchorY:d.y,popupW:a,popupH:c,mapW:this.mapContainerEl.clientWidth,mapH:this.mapContainerEl.clientHeight,offsetY:v,pad:q})}let{dx:e,flipBelow:o}=this.clampOffset;this.container.style.left=`${s.x+e}px`,o?(this.container.style.top=`${s.y+v}px`,this.container.style.transform="translate(-50%, 0)"):(this.container.style.top=`${s.y-v}px`,this.container.style.transform="translate(-50%, -100%)")}onRemove(){this.attached=!1,this.container.remove()}updatePosition(n){(n.lat!==this.position.lat||n.lng!==this.position.lng)&&(this.clampOffset=null),this.position=n,this.attached&&this.draw()}}return y=t,y}function b(t){for(let r of t)typeof r.setMap=="function"?r.setMap(null):r.map=null}var K="#b3261e",N=40,J=64,Q=14;function ee(t,r){let l=r.count,n=Math.min(J,N+Math.round(Math.log10(l+1)*Q)),i=document.createElement("div");return i.textContent=String(l),i.style.display="flex",i.style.alignItems="center",i.style.justifyContent="center",i.style.width=`${n}px`,i.style.height=`${n}px`,i.style.borderRadius="50%",i.style.backgroundColor=K,i.style.border="2px solid #ffffff",i.style.boxShadow="0 1px 4px rgba(0, 0, 0, 0.4)",i.style.color="#ffffff",i.style.fontFamily="inherit",i.style.fontWeight="700",i.style.fontSize=n>=52?"15px":"13px",new t.AdvancedMarkerElement({position:r.position,content:i})}var H=!1;async function te(t,r,l,n){let i;try{i=await import("@googlemaps/markerclusterer")}catch(e){H||(H=!0,console.warn('[react-listing-engine] "@googlemaps/markerclusterer" is not installed -- rendering plain (unclustered) markers instead. Install "@googlemaps/markerclusterer" to enable clustering.',e));return}if(t.layers.get(r)!==l)return;let s=new i.MarkerClusterer({map:t.map,markers:l,algorithmOptions:{maxZoom:n.maxZoom},renderer:{render:e=>ee(t.markerLib,e)}});t.clusterers.set(r,s)}function C(t,r){let l=t.clusterers.get(r);l&&(l.setMap(null),t.clusterers.delete(r))}var R=!1;function ne(){R||(R=!0,console.warn('[react-listing-engine] Marker clustering is not supported in `styles` (OverlayView) mode -- "@googlemaps/markerclusterer" only manages Marker/AdvancedMarkerElement instances. Rendering plain, unclustered overlay markers instead. Use a `mapId` (advanced-marker mode) to enable clustering.'))}function re(t,r){return r.markers.map(l=>{let n=new t.markerLib.AdvancedMarkerElement({map:t.map,position:l.position,content:U(l,t.markerLib),gmpClickable:!!r.onMarkerClick});if(r.onMarkerClick){let i=r.onMarkerClick;n.addListener("click",()=>i(l.id))}return n})}function T(t,r,l,n){t.classList.toggle("rle-marker--selected",r===l),t.classList.toggle("rle-marker--hovered",r===n&&r!==l)}function oe(t,r){let l=X();return r.markers.map(n=>{let i=r.onMarkerClick,s=i?()=>i(n.id):void 0,e=new l(n.position,D(n),s,{onContainerAdd:o=>{t.markerElements.set(n.id,o),T(o,n.id,t.selectedMarkerId,t.hoveredMarkerId)},onContainerRemove:o=>{t.markerElements.get(n.id)===o&&t.markerElements.delete(n.id)}});return e.setMap(t.map),e})}function _(t,r){let l=t.layerMarkerIds.get(r);if(l){for(let n of l)t.markerElements.delete(n);t.layerMarkerIds.delete(r)}}function ae(t){let r=t.getSouthWest(),l=t.getNorthEast();return{west:r.lng(),south:r.lat(),east:l.lng(),north:l.lat()}}var h=256,ie=450,se=1500,le=260,ce=4,A=4,de=1400,pe=900,ue=4;function k(t,r){let l=Math.min(Math.max(Math.sin(t*Math.PI/180),-.9999),.9999);return{x:h*(.5+r/360),y:h*(.5-Math.log((1+l)/(1-l))/(4*Math.PI))}}function S(t){let r=Math.PI-2*Math.PI*t.y/h;return{lat:180/Math.PI*Math.atan(.5*(Math.exp(r)-Math.exp(-r))),lng:(t.x/h-.5)*360}}function me(t,r,l){let n=k(t.north,t.east),i=k(t.south,t.west),s=Math.abs(n.x-i.x),e=Math.abs(n.y-i.y);return s===0||e===0||r===0||l===0?null:{center:S({x:(n.x+i.x)/2,y:(n.y+i.y)/2}),zoom:Math.min(Math.log2(r/s),Math.log2(l/e))}}function fe(t){return t<.5?4*t*t*t:1-Math.pow(-2*t+2,3)/2}function F(t,r,l,n,i){let s=performance.now(),e,o=()=>{let a=Math.min(1,(performance.now()-s)/n),c=fe(a);t.map.setZoom(r.zoom+(l.zoom-r.zoom)*c-i*Math.sin(Math.PI*c)),t.map.setCenter(S({x:r.x+(l.x-r.x)*c,y:r.y+(l.y-r.y)*c})),a<1?e=requestAnimationFrame(o):t.cancelFlight=null};return e=requestAnimationFrame(o),()=>cancelAnimationFrame(e)}function Me(t,r,l){if(typeof ResizeObserver>"u")return;let n=!1,i=()=>{let{width:e,height:o}=t.getBoundingClientRect();e===0||o===0||(google.maps.event.trigger(r,"resize"),n||(n=!0,r.setCenter(l)))},s=new ResizeObserver(i);return s.observe(t),typeof requestAnimationFrame<"u"?requestAnimationFrame(i):queueMicrotask(i),s}function ge(t){if(!t.apiKey)throw new Error("googleProvider: config.apiKey is required (no hardcoded fallback key is ever used).");let r=!1,l=()=>{r||(Z({...t.loaderOptions,key:t.apiKey}),r=!0)},n,i=0;return{async mount(s,e){let o=++i;l();let a=await w("maps"),c=await w("marker"),d=e.center??{lat:0,lng:0},p=t.styles!=null,m=new a.Map(s,{...t.mapOptions,center:d,zoom:e.zoom??10,...p?{styles:t.styles}:{mapId:t.mapId??V}}),f=Me(s,m,d),u={map:m,containerEl:s,fullscreenEl:e.fullscreenTarget??s,markerLib:c,markerMode:p?"overlay":"advanced",layers:new Map,clusterers:new Map,boundsListeners:new Set,clickListeners:new Set,resizeObserver:f,markerElements:new Map,layerMarkerIds:new Map,selectedMarkerId:null,hoveredMarkerId:null,cancelFlight:null};return o===i&&(n=u),{raw:u}},renderLayer(s,e){let o=M(s),a=o.layers.get(e.id);a&&(b(a),o.layers.delete(e.id),_(o,e.id)),C(o,e.id);let c=o.markerMode==="overlay"?oe(o,e):re(o,e);o.layers.set(e.id,c),o.markerMode==="overlay"&&o.layerMarkerIds.set(e.id,e.markers.map(p=>p.id)),e.clustering&&(o.markerMode==="overlay"?ne():te(o,e.id,c,e.clustering));let d=!1;return()=>{d||(d=!0,o.layers.get(e.id)===c&&(b(c),o.layers.delete(e.id),C(o,e.id),_(o,e.id)))}},onBoundsChange(s,e){let o=M(s),a=o.map.addListener("idle",()=>{let d=o.map.getBounds();d&&e(ae(d))});o.boundsListeners.add(a);let c=!1;return()=>{c||(c=!0,a.remove(),o.boundsListeners.delete(a))}},onMapClick(s){let e=n;if(!e)return()=>{};let o=e.map.addListener("click",()=>s());e.clickListeners.add(o);let a=!1;return()=>{a||(a=!0,o.remove(),e.clickListeners.delete(o))}},fitBounds(s,e,o){let a=M(s);if(a.cancelFlight?.(),a.cancelFlight=null,!o?.animate){a.map.fitBounds(e);return}let c=a.map.getZoom(),d=a.map.getCenter(),p=me(e,a.containerEl.clientWidth,a.containerEl.clientHeight);if(c==null||!d||!p){a.map.fitBounds(e);return}a.map.setOptions({isFractionalZoomEnabled:!0});let m={...k(d.lat(),d.lng()),zoom:c},f=k(p.center.lat,p.center.lng),u={...f,zoom:p.zoom},L=Math.hypot(u.x-m.x,u.y-m.y)*2**Math.min(m.zoom,u.zoom),E=Math.max(a.containerEl.clientWidth,a.containerEl.clientHeight);if(L>E*ce){a.map.setCenter(p.center),a.map.setZoom(p.zoom-A);let P=()=>{x();let B=a.map.getZoom()??p.zoom-A;a.cancelFlight=F(a,{...f,zoom:B},u,de,0)},W=a.map.addListener("tilesloaded",P),G=setTimeout(P,pe),x=()=>{W.remove(),clearTimeout(G)};a.cancelFlight=x;return}let O=L>E?Math.min(ue,Math.log2(L/E)+1):0,z=Math.min(se,ie+O*le);a.cancelFlight=F(a,m,u,z,O)},destroy(s){let e=M(s);e.resizeObserver?.disconnect(),e.cancelFlight?.(),e.cancelFlight=null;for(let o of e.boundsListeners)o.remove();e.boundsListeners.clear();for(let o of e.clickListeners)o.remove();e.clickListeners.clear();for(let o of[...e.clusterers.keys()])C(e,o);for(let o of e.layers.values())b(o);e.layers.clear(),e.markerElements.clear(),e.layerMarkerIds.clear(),n===e&&(n=void 0)},updateMarkerStates(s,e){if(n){n.selectedMarkerId=s,n.hoveredMarkerId=e;for(let[o,a]of n.markerElements)T(a,o,s,e)}},mountOverlay(s){let e=document.createElement("div");if(e.style.position="absolute",e.style.transform="translate(-50%, -100%)",e.style.pointerEvents="auto",!n)return{container:e,setPosition:()=>{},unmount:()=>e.remove()};let o=j(),a=new o(e,s,n.containerEl);return a.setMap(n.map),{container:e,setPosition:c=>a.updatePosition(c),unmount:()=>{a.setMap(null),e.remove()}}},zoomIn(){n&&n.map.setZoom((n.map.getZoom()??0)+1)},zoomOut(){n&&n.map.setZoom((n.map.getZoom()??0)-1)},toggleFullscreen(){if(!n)return;let s=n.fullscreenEl,e=document.fullscreenElement;e!=null&&s.contains(e)?typeof document.exitFullscreen=="function"&&document.exitFullscreen()?.catch(()=>{}):typeof s.requestFullscreen=="function"&&s.requestFullscreen()?.catch(()=>{})}}}export{ge as googleProvider};
|
package/dist/styled/index.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});"use client";
|
|
2
|
-
var
|
|
2
|
+
var _chunk2B47DZWFcjs = require('../chunk-2B47DZWF.cjs');var _jsxruntime = require('react/jsx-runtime');function L({children:o}){return _jsxruntime.jsx.call(void 0, _chunk2B47DZWFcjs.q,{..._chunk2B47DZWFcjs.O,children:o})}exports.BottomNav = _chunk2B47DZWFcjs.P; exports.BottomSheet = _chunk2B47DZWFcjs.Q; exports.ListingApp = _chunk2B47DZWFcjs.S; exports.StyledCard = _chunk2B47DZWFcjs.E; exports.StyledComponentsProviderWithDefaults = L; exports.StyledEmpty = _chunk2B47DZWFcjs.F; exports.StyledFilterPanel = _chunk2B47DZWFcjs.G; exports.StyledListingLayout = _chunk2B47DZWFcjs.R; exports.StyledLoading = _chunk2B47DZWFcjs.H; exports.StyledMarker = _chunk2B47DZWFcjs.I; exports.StyledPopup = _chunk2B47DZWFcjs.J; exports.StyledResultHeader = _chunk2B47DZWFcjs.K; exports.StyledSearch = _chunk2B47DZWFcjs.L; exports.StyledSidebar = _chunk2B47DZWFcjs.M; exports.StyledToolbar = _chunk2B47DZWFcjs.N; exports.styledDefaultComponents = _chunk2B47DZWFcjs.O;
|
package/dist/styled/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import{E as r,F as p,G as i,H as y,I as d,J as l,K as n,L as m,M as s,N as a,O as t,P as S,Q as f,R as P,S as u,q as e}from"../chunk-
|
|
2
|
+
import{E as r,F as p,G as i,H as y,I as d,J as l,K as n,L as m,M as s,N as a,O as t,P as S,Q as f,R as P,S as u,q as e}from"../chunk-VJC4ZCO7.js";import{jsx as g}from"react/jsx-runtime";function L({children:o}){return g(e,{...t,children:o})}export{S as BottomNav,f as BottomSheet,u as ListingApp,r as StyledCard,L as StyledComponentsProviderWithDefaults,p as StyledEmpty,i as StyledFilterPanel,P as StyledListingLayout,y as StyledLoading,d as StyledMarker,l as StyledPopup,n as StyledResultHeader,m as StyledSearch,s as StyledSidebar,a as StyledToolbar,t as styledDefaultComponents};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-listing-engine",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.15",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "Headless, composable listing engine for React: filterable list + Google-Maps multi-layer map, with pluggable data adapters, a filter/dataset registry, injectable components, and a Tailwind-free styled adapter.",
|
|
6
6
|
"funding": [
|
|
File without changes
|
|
File without changes
|