react-listing-engine 0.6.7 → 0.6.8
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/CHANGELOG.md +6 -0
- 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.d.cts +10 -0
- package/dist/maps/google/index.d.ts +10 -0
- 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-4CZJODMK.cjs → chunk-DU2POAB7.cjs} +0 -0
- /package/dist/{chunk-GSWGCJCO.js → chunk-ROMDYRUV.js} +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# react-listing-engine
|
|
2
2
|
|
|
3
|
+
## 0.6.8
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Add `mapOptions` to `googleProvider`'s config: a `Partial<google.maps.MapOptions>` merged into every map the provider creates, so consumers can set the zoom envelope (`minZoom`/`maxZoom`), UI chrome (`disableDefaultUI`, `zoomControl`), `clickableIcons`, gesture handling, etc. It is spread first, so the provider's own required keys always win: `mapId` comes from the `mapId` field and `center`/`zoom` from the per-mount init options. (The legacy `styles` array remains ignored by Google whenever a `mapId` is present — style a Map ID via the Cloud Console.)
|
|
8
|
+
|
|
3
9
|
## 0.6.1
|
|
4
10
|
|
|
5
11
|
### Patch Changes
|
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 _chunkDU2POAB7cjs = require('./chunk-DU2POAB7.cjs');var m=(e=>(e.Paged="paged",e.Infinite="infinite",e))(m||{});var g=(s=>(s.FiltersChanged="FiltersChanged",s.ResultsLoaded="ResultsLoaded",s.PointClicked="PointClicked",s.BoundsChanged="BoundsChanged",s.LayerToggled="LayerToggled",s))(g||{});var y= (_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 P(r,t){let e=new Set([...Object.keys(r),...Object.keys(t)]);for(let i of e)if(r[i]!==t[i])return!1;return!0}var c= (_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 e=this.toQueryFn(t.state.filters);P(e,this.history.getQuery())||this.withSyncGuard(()=>this.history.setQuery(e))}applyFiltersSafely(t,e){Promise.resolve(t.applyFilters(e)).catch(()=>{})}withSyncGuard(t){this.isSyncing=!0;try{t()}finally{this.isSyncing=!1}}}, _class2);var p=class{constructor(t={}){this.mode=_nullishCoalesce(t.mode, () => ("replace"))}getQuery(){if(typeof window>"u")return{};let t=new URLSearchParams(window.location.search),e={};for(let[i,o]of t)o!==""&&(e[i]=o);return e}setQuery(t){if(typeof window>"u")return;let e=new URLSearchParams;for(let[h,u]of Object.entries(t))u===void 0||u===""||e.set(h,u);let i=e.toString(),o=i?`?${i}`:"";if(o===window.location.search)return;let s=`${window.location.pathname}${o}${window.location.hash}`;this.mode==="push"?window.history.pushState(window.history.state,"",s):window.history.replaceState(window.history.state,"",s)}subscribe(t){return typeof window>"u"?()=>{}:(window.addEventListener("popstate",t),()=>{window.removeEventListener("popstate",t)})}};var _jsxruntime = require('react/jsx-runtime');function M({children:r}){let{Toolbar:t}=_chunkDU2POAB7cjs.q.call(void 0, );return _jsxruntime.jsx.call(void 0, t,{children:r})}var _react = require('react');function ot(){let r=_chunkDU2POAB7cjs.s.call(void 0, ),t=_chunkDU2POAB7cjs.t.call(void 0, ),e=_react.useCallback.call(void 0, o=>r.loadPoints(o),[r]),i=_react.useCallback.call(void 0, (o,s)=>r.selectPoint(o,s),[r]);return{bounds:t.bounds,points:t.points,loadPoints:e,selectPoint:i}}function yt(r){let t=_chunkDU2POAB7cjs.s.call(void 0, ),e=_chunkDU2POAB7cjs.t.call(void 0, ),i=_react.useCallback.call(void 0, ()=>t.toggleLayer(r),[t,r]);return{visible:_nullishCoalesce(e.layers[r], () => (!0)),points:_nullishCoalesce(e.points[r], () => ([])),toggle:i}}exports.BrowserHistoryPort = p; exports.DatasetRegistry = _chunkDU2POAB7cjs.c; exports.FilterRegistry = _chunkDU2POAB7cjs.b; exports.ListingApp = _chunkDU2POAB7cjs.R; exports.ListingComponentsProvider = _chunkDU2POAB7cjs.p; exports.ListingConfig = _chunkDU2POAB7cjs.f; exports.ListingEngine = _chunkDU2POAB7cjs.g; exports.ListingEngineContext = _chunkDU2POAB7cjs.r; exports.ListingEventType = g; exports.ListingFilters = _chunkDU2POAB7cjs.v; exports.ListingList = _chunkDU2POAB7cjs.x; exports.ListingMap = _chunkDU2POAB7cjs.y; exports.ListingPagination = _chunkDU2POAB7cjs.z; exports.ListingProvider = _chunkDU2POAB7cjs.C; exports.ListingResultHeader = _chunkDU2POAB7cjs.A; exports.ListingStore = _chunkDU2POAB7cjs.a; exports.ListingToolbar = M; exports.MemoryHistoryPort = y; exports.PaginationMode = m; exports.TypedEmitter = _chunkDU2POAB7cjs.d; exports.UrlSyncController = c; exports.composeListingProviders = _chunkDU2POAB7cjs.h; exports.listingDefaultConfig = _chunkDU2POAB7cjs.e; exports.useListing = _chunkDU2POAB7cjs.s; exports.useListingComponents = _chunkDU2POAB7cjs.q; exports.useListingEvent = _chunkDU2POAB7cjs.B; exports.useListingFilters = _chunkDU2POAB7cjs.u; exports.useListingLayer = yt; exports.useListingMap = ot; exports.useListingResults = _chunkDU2POAB7cjs.w; exports.useListingState = _chunkDU2POAB7cjs.t; exports.withConfig = _chunkDU2POAB7cjs.i; exports.withDataset = _chunkDU2POAB7cjs.k; exports.withFilters = _chunkDU2POAB7cjs.l; exports.withInitialFilters = _chunkDU2POAB7cjs.n; exports.withMap = _chunkDU2POAB7cjs.j; exports.withPrimaryDataset = _chunkDU2POAB7cjs.o; exports.withUrlSync = _chunkDU2POAB7cjs.m;
|
package/dist/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import{A as J,B as K,C as N,R as f,a as w,b as F,c as S,d as Q,e as x,f as T,g as L,h as H,i as O,j as k,k as q,l as E,m as C,n as U,o as B,p as I,q as l,r as G,s as n,t as a,u as R,v as $,w as j,x as A,y as z,z as D}from"./chunk-
|
|
2
|
+
import{A as J,B as K,C as N,R as f,a as w,b as F,c as S,d as Q,e as x,f as T,g as L,h as H,i as O,j as k,k as q,l as E,m as C,n as U,o as B,p as I,q as l,r as G,s as n,t as a,u as R,v as $,w as j,x as A,y as z,z as D}from"./chunk-ROMDYRUV.js";var m=(e=>(e.Paged="paged",e.Infinite="infinite",e))(m||{});var g=(s=>(s.FiltersChanged="FiltersChanged",s.ResultsLoaded="ResultsLoaded",s.PointClicked="PointClicked",s.BoundsChanged="BoundsChanged",s.LayerToggled="LayerToggled",s))(g||{});var y=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 P(r,t){let e=new Set([...Object.keys(r),...Object.keys(t)]);for(let i of e)if(r[i]!==t[i])return!1;return!0}var c=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 e=this.toQueryFn(t.state.filters);P(e,this.history.getQuery())||this.withSyncGuard(()=>this.history.setQuery(e))}applyFiltersSafely(t,e){Promise.resolve(t.applyFilters(e)).catch(()=>{})}withSyncGuard(t){this.isSyncing=!0;try{t()}finally{this.isSyncing=!1}}};var p=class{mode;constructor(t={}){this.mode=t.mode??"replace"}getQuery(){if(typeof window>"u")return{};let t=new URLSearchParams(window.location.search),e={};for(let[i,o]of t)o!==""&&(e[i]=o);return e}setQuery(t){if(typeof window>"u")return;let e=new URLSearchParams;for(let[h,u]of Object.entries(t))u===void 0||u===""||e.set(h,u);let i=e.toString(),o=i?`?${i}`:"";if(o===window.location.search)return;let s=`${window.location.pathname}${o}${window.location.hash}`;this.mode==="push"?window.history.pushState(window.history.state,"",s):window.history.replaceState(window.history.state,"",s)}subscribe(t){return typeof window>"u"?()=>{}:(window.addEventListener("popstate",t),()=>{window.removeEventListener("popstate",t)})}};import{jsx as b}from"react/jsx-runtime";function M({children:r}){let{Toolbar:t}=l();return b(t,{children:r})}import{useCallback as d}from"react";function ot(){let r=n(),t=a(),e=d(o=>r.loadPoints(o),[r]),i=d((o,s)=>r.selectPoint(o,s),[r]);return{bounds:t.bounds,points:t.points,loadPoints:e,selectPoint:i}}import{useCallback as v}from"react";function yt(r){let t=n(),e=a(),i=v(()=>t.toggleLayer(r),[t,r]);return{visible:e.layers[r]??!0,points:e.points[r]??[],toggle:i}}export{p as BrowserHistoryPort,S as DatasetRegistry,F as FilterRegistry,f as ListingApp,I as ListingComponentsProvider,T as ListingConfig,L as ListingEngine,G as ListingEngineContext,g as ListingEventType,$ as ListingFilters,A as ListingList,z as ListingMap,D as ListingPagination,N as ListingProvider,J as ListingResultHeader,w as ListingStore,M as ListingToolbar,y as MemoryHistoryPort,m as PaginationMode,Q as TypedEmitter,c as UrlSyncController,H as composeListingProviders,x as listingDefaultConfig,n as useListing,l as useListingComponents,K as useListingEvent,R as useListingFilters,yt as useListingLayer,ot as useListingMap,j as useListingResults,a as useListingState,O as withConfig,q as withDataset,E as withFilters,U as withInitialFilters,k as withMap,B as withPrimaryDataset,C 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 y="DEMO_MAP_ID";function
|
|
2
|
+
var _jsapiloader = require('@googlemaps/js-api-loader');var y="DEMO_MAP_ID";function p(r){return r.raw}function v(r,n){if(r.element)return r.element;if(r.iconUrl)return new n.PinElement({glyphSrc:r.iconUrl}).element}function c(r){for(let n of r)n.map=null}var L="#b3261e",b=40,C=64,w=14;function E(r,n){let s=n.count,o=Math.min(C,b+Math.round(Math.log10(s+1)*w)),e=document.createElement("div");return e.textContent=String(s),e.style.display="flex",e.style.alignItems="center",e.style.justifyContent="center",e.style.width=`${o}px`,e.style.height=`${o}px`,e.style.borderRadius="50%",e.style.backgroundColor=L,e.style.border="2px solid #ffffff",e.style.boxShadow="0 1px 4px rgba(0, 0, 0, 0.4)",e.style.color="#ffffff",e.style.fontFamily="inherit",e.style.fontWeight="700",e.style.fontSize=o>=52?"15px":"13px",new r.AdvancedMarkerElement({position:n.position,content:e})}var f=!1;async function h(r,n,s,o){let e;try{e=await Promise.resolve().then(() => _interopRequireWildcard(require("@googlemaps/markerclusterer")))}catch(a){f||(f=!0,console.warn('[react-listing-engine] "@googlemaps/markerclusterer" is not installed -- rendering plain (unclustered) markers instead. Install "@googlemaps/markerclusterer" to enable clustering.',a));return}if(r.layers.get(n)!==s)return;let t=new e.MarkerClusterer({map:r.map,markers:s,algorithmOptions:{maxZoom:o.maxZoom},renderer:{render:a=>E(r.markerLib,a)}});r.clusterers.set(n,t)}function g(r,n){let s=r.clusterers.get(n);s&&(s.setMap(null),r.clusterers.delete(n))}function O(r){let n=r.getSouthWest(),s=r.getNorthEast();return{west:n.lng(),south:n.lat(),east:s.lng(),north:s.lat()}}function R(r,n,s){if(typeof ResizeObserver>"u")return;let o=!1,e=()=>{let{width:a,height:i}=r.getBoundingClientRect();a===0||i===0||(google.maps.event.trigger(n,"resize"),o||(o=!0,n.setCenter(s)))},t=new ResizeObserver(e);return t.observe(r),typeof requestAnimationFrame<"u"?requestAnimationFrame(e):queueMicrotask(e),t}function P(r){if(!r.apiKey)throw new Error("googleProvider: config.apiKey is required (no hardcoded fallback key is ever used).");let n=!1,s=()=>{n||(_jsapiloader.setOptions.call(void 0, {...r.loaderOptions,key:r.apiKey}),n=!0)};return{async mount(o,e){s();let t=await _jsapiloader.importLibrary.call(void 0, "maps"),a=await _jsapiloader.importLibrary.call(void 0, "marker"),i=_nullishCoalesce(e.center, () => ({lat:0,lng:0})),l=new t.Map(o,{...r.mapOptions,center:i,zoom:_nullishCoalesce(e.zoom, () => (10)),mapId:_nullishCoalesce(r.mapId, () => (y))}),d=R(o,l,i);return{raw:{map:l,markerLib:a,layers:new Map,clusterers:new Map,boundsListeners:new Set,resizeObserver:d}}},renderLayer(o,e){let t=p(o),a=t.layers.get(e.id);a&&(c(a),t.layers.delete(e.id)),g(t,e.id);let i=e.markers.map(d=>{let u=new t.markerLib.AdvancedMarkerElement({map:t.map,position:d.position,content:v(d,t.markerLib),gmpClickable:!!e.onMarkerClick});if(e.onMarkerClick){let M=e.onMarkerClick;u.addListener("click",()=>M(d.id))}return u});t.layers.set(e.id,i),e.clustering&&h(t,e.id,i,e.clustering);let l=!1;return()=>{l||(l=!0,t.layers.get(e.id)===i&&(c(i),t.layers.delete(e.id),g(t,e.id)))}},onBoundsChange(o,e){let t=p(o),a=t.map.addListener("idle",()=>{let l=t.map.getBounds();l&&e(O(l))});t.boundsListeners.add(a);let i=!1;return()=>{i||(i=!0,a.remove(),t.boundsListeners.delete(a))}},fitBounds(o,e){p(o).map.fitBounds(e)},destroy(o){let e=p(o);_optionalChain([e, 'access', _ => _.resizeObserver, 'optionalAccess', _2 => _2.disconnect, 'call', _3 => _3()]);for(let t of e.boundsListeners)t.remove();e.boundsListeners.clear();for(let t of[...e.clusterers.keys()])g(e,t);for(let t of e.layers.values())c(t);e.layers.clear()}}}exports.googleProvider = P;
|
|
@@ -20,6 +20,16 @@ interface GoogleMapsProviderConfig {
|
|
|
20
20
|
* comes from `apiKey` and cannot be overridden here.
|
|
21
21
|
*/
|
|
22
22
|
loaderOptions?: Partial<Omit<APIOptions, 'key'>>;
|
|
23
|
+
/**
|
|
24
|
+
* Extra `google.maps.MapOptions` merged into every map this provider creates -- the zoom
|
|
25
|
+
* envelope (`minZoom`/`maxZoom`), UI chrome (`disableDefaultUI`, `zoomControl`), gesture
|
|
26
|
+
* handling, `clickableIcons`, etc. Spread FIRST, so the provider's own required keys always
|
|
27
|
+
* win over it: `mapId` here is ignored (use the `mapId` field), and `center`/`zoom` here are
|
|
28
|
+
* ignored (they come from the per-mount `MapInitOptions`). NOTE: the legacy `styles` array is
|
|
29
|
+
* IGNORED by Google whenever a `mapId` is present (a Map ID always is here) -- style a Map ID
|
|
30
|
+
* via the Cloud Console, not here.
|
|
31
|
+
*/
|
|
32
|
+
mapOptions?: Partial<google.maps.MapOptions>;
|
|
23
33
|
}
|
|
24
34
|
/**
|
|
25
35
|
* `MapProvider` backed by the Google Maps JavaScript API.
|
|
@@ -20,6 +20,16 @@ interface GoogleMapsProviderConfig {
|
|
|
20
20
|
* comes from `apiKey` and cannot be overridden here.
|
|
21
21
|
*/
|
|
22
22
|
loaderOptions?: Partial<Omit<APIOptions, 'key'>>;
|
|
23
|
+
/**
|
|
24
|
+
* Extra `google.maps.MapOptions` merged into every map this provider creates -- the zoom
|
|
25
|
+
* envelope (`minZoom`/`maxZoom`), UI chrome (`disableDefaultUI`, `zoomControl`), gesture
|
|
26
|
+
* handling, `clickableIcons`, etc. Spread FIRST, so the provider's own required keys always
|
|
27
|
+
* win over it: `mapId` here is ignored (use the `mapId` field), and `center`/`zoom` here are
|
|
28
|
+
* ignored (they come from the per-mount `MapInitOptions`). NOTE: the legacy `styles` array is
|
|
29
|
+
* IGNORED by Google whenever a `mapId` is present (a Map ID always is here) -- style a Map ID
|
|
30
|
+
* via the Cloud Console, not here.
|
|
31
|
+
*/
|
|
32
|
+
mapOptions?: Partial<google.maps.MapOptions>;
|
|
23
33
|
}
|
|
24
34
|
/**
|
|
25
35
|
* `MapProvider` backed by the Google Maps JavaScript API.
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import{importLibrary as m,setOptions as k}from"@googlemaps/js-api-loader";var y="DEMO_MAP_ID";function
|
|
2
|
+
import{importLibrary as m,setOptions as k}from"@googlemaps/js-api-loader";var y="DEMO_MAP_ID";function p(r){return r.raw}function v(r,n){if(r.element)return r.element;if(r.iconUrl)return new n.PinElement({glyphSrc:r.iconUrl}).element}function c(r){for(let n of r)n.map=null}var L="#b3261e",b=40,C=64,w=14;function E(r,n){let s=n.count,o=Math.min(C,b+Math.round(Math.log10(s+1)*w)),e=document.createElement("div");return e.textContent=String(s),e.style.display="flex",e.style.alignItems="center",e.style.justifyContent="center",e.style.width=`${o}px`,e.style.height=`${o}px`,e.style.borderRadius="50%",e.style.backgroundColor=L,e.style.border="2px solid #ffffff",e.style.boxShadow="0 1px 4px rgba(0, 0, 0, 0.4)",e.style.color="#ffffff",e.style.fontFamily="inherit",e.style.fontWeight="700",e.style.fontSize=o>=52?"15px":"13px",new r.AdvancedMarkerElement({position:n.position,content:e})}var f=!1;async function h(r,n,s,o){let e;try{e=await import("@googlemaps/markerclusterer")}catch(a){f||(f=!0,console.warn('[react-listing-engine] "@googlemaps/markerclusterer" is not installed -- rendering plain (unclustered) markers instead. Install "@googlemaps/markerclusterer" to enable clustering.',a));return}if(r.layers.get(n)!==s)return;let t=new e.MarkerClusterer({map:r.map,markers:s,algorithmOptions:{maxZoom:o.maxZoom},renderer:{render:a=>E(r.markerLib,a)}});r.clusterers.set(n,t)}function g(r,n){let s=r.clusterers.get(n);s&&(s.setMap(null),r.clusterers.delete(n))}function O(r){let n=r.getSouthWest(),s=r.getNorthEast();return{west:n.lng(),south:n.lat(),east:s.lng(),north:s.lat()}}function R(r,n,s){if(typeof ResizeObserver>"u")return;let o=!1,e=()=>{let{width:a,height:i}=r.getBoundingClientRect();a===0||i===0||(google.maps.event.trigger(n,"resize"),o||(o=!0,n.setCenter(s)))},t=new ResizeObserver(e);return t.observe(r),typeof requestAnimationFrame<"u"?requestAnimationFrame(e):queueMicrotask(e),t}function P(r){if(!r.apiKey)throw new Error("googleProvider: config.apiKey is required (no hardcoded fallback key is ever used).");let n=!1,s=()=>{n||(k({...r.loaderOptions,key:r.apiKey}),n=!0)};return{async mount(o,e){s();let t=await m("maps"),a=await m("marker"),i=e.center??{lat:0,lng:0},l=new t.Map(o,{...r.mapOptions,center:i,zoom:e.zoom??10,mapId:r.mapId??y}),d=R(o,l,i);return{raw:{map:l,markerLib:a,layers:new Map,clusterers:new Map,boundsListeners:new Set,resizeObserver:d}}},renderLayer(o,e){let t=p(o),a=t.layers.get(e.id);a&&(c(a),t.layers.delete(e.id)),g(t,e.id);let i=e.markers.map(d=>{let u=new t.markerLib.AdvancedMarkerElement({map:t.map,position:d.position,content:v(d,t.markerLib),gmpClickable:!!e.onMarkerClick});if(e.onMarkerClick){let M=e.onMarkerClick;u.addListener("click",()=>M(d.id))}return u});t.layers.set(e.id,i),e.clustering&&h(t,e.id,i,e.clustering);let l=!1;return()=>{l||(l=!0,t.layers.get(e.id)===i&&(c(i),t.layers.delete(e.id),g(t,e.id)))}},onBoundsChange(o,e){let t=p(o),a=t.map.addListener("idle",()=>{let l=t.map.getBounds();l&&e(O(l))});t.boundsListeners.add(a);let i=!1;return()=>{i||(i=!0,a.remove(),t.boundsListeners.delete(a))}},fitBounds(o,e){p(o).map.fitBounds(e)},destroy(o){let e=p(o);e.resizeObserver?.disconnect();for(let t of e.boundsListeners)t.remove();e.boundsListeners.clear();for(let t of[...e.clusterers.keys()])g(e,t);for(let t of e.layers.values())c(t);e.layers.clear()}}}export{P 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 _chunkDU2POAB7cjs = require('../chunk-DU2POAB7.cjs');var _jsxruntime = require('react/jsx-runtime');function L({children:o}){return _jsxruntime.jsx.call(void 0, _chunkDU2POAB7cjs.p,{..._chunkDU2POAB7cjs.N,children:o})}exports.BottomNav = _chunkDU2POAB7cjs.O; exports.BottomSheet = _chunkDU2POAB7cjs.P; exports.ListingApp = _chunkDU2POAB7cjs.R; exports.StyledCard = _chunkDU2POAB7cjs.D; exports.StyledComponentsProviderWithDefaults = L; exports.StyledEmpty = _chunkDU2POAB7cjs.E; exports.StyledFilterPanel = _chunkDU2POAB7cjs.F; exports.StyledListingLayout = _chunkDU2POAB7cjs.Q; exports.StyledLoading = _chunkDU2POAB7cjs.G; exports.StyledMarker = _chunkDU2POAB7cjs.H; exports.StyledPopup = _chunkDU2POAB7cjs.I; exports.StyledResultHeader = _chunkDU2POAB7cjs.J; exports.StyledSearch = _chunkDU2POAB7cjs.K; exports.StyledSidebar = _chunkDU2POAB7cjs.L; exports.StyledToolbar = _chunkDU2POAB7cjs.M; exports.styledDefaultComponents = _chunkDU2POAB7cjs.N;
|
package/dist/styled/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import{D as r,E as p,F as i,G as d,H as y,I as l,J as n,K as m,L as s,M as a,N as t,O as S,P as f,Q as P,R as u,p as e}from"../chunk-
|
|
2
|
+
import{D as r,E as p,F as i,G as d,H as y,I as l,J as n,K as m,L as s,M as a,N as t,O as S,P as f,Q as P,R as u,p as e}from"../chunk-ROMDYRUV.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,d as StyledLoading,y 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.6.
|
|
3
|
+
"version": "0.6.8",
|
|
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
|