react-listing-engine 0.4.0 → 0.4.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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # react-listing-engine
2
2
 
3
+ ## 0.4.1
4
+
5
+ ### Patch Changes
6
+
7
+ - Fix: an `iconUrl`-driven marker layer (e.g. nearby businesses) crashed the map. `resolveMarkerContent` passed the `google.maps.marker.PinElement` INSTANCE as an `AdvancedMarkerElement`'s `content`, but the instance is not a DOM node at runtime (the `@types` wrongly declare it `extends HTMLElement`) -- so Google's marker mount called `IntersectionObserver.observe()` on a non-Element and threw. It now passes the PinElement's `.element`.
8
+
3
9
  ## 0.4.0
4
10
 
5
11
  ### Minor 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(); } } var _class;"use client";
2
- var _chunkJNURPGEBcjs = require('./chunk-JNURPGEB.cjs');var _chunkEYXV5OMYcjs = require('./chunk-EYXV5OMY.cjs');var _chunkCHNUE46Kcjs = require('./chunk-CHNUE46K.cjs');var _chunk2VUHLHHXcjs = require('./chunk-2VUHLHHX.cjs');var d=(o=>(o.Paged="paged",o.Infinite="infinite",o))(d||{});var f=(r=>(r.FiltersChanged="FiltersChanged",r.ResultsLoaded="ResultsLoaded",r.PointClicked="PointClicked",r.BoundsChanged="BoundsChanged",r.LayerToggled="LayerToggled",r))(f||{});var u= (_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);var _jsxruntime = require('react/jsx-runtime');function Z({children:e}){let{Toolbar:t}=_chunkEYXV5OMYcjs.q.call(void 0, );return _jsxruntime.jsx.call(void 0, t,{children:e})}var _react = require('react');function tt(){let e=_chunkEYXV5OMYcjs.s.call(void 0, ),t=_chunkEYXV5OMYcjs.t.call(void 0, ),o=_react.useCallback.call(void 0, a=>e.loadPoints(a),[e]),n=_react.useCallback.call(void 0, (a,r)=>e.selectPoint(a,r),[e]);return{bounds:t.bounds,points:t.points,loadPoints:o,selectPoint:n}}function it(e){let t=_chunkEYXV5OMYcjs.s.call(void 0, ),o=_chunkEYXV5OMYcjs.t.call(void 0, ),n=_react.useCallback.call(void 0, ()=>t.toggleLayer(e),[t,e]);return{visible:_nullishCoalesce(o.layers[e], () => (!0)),points:_nullishCoalesce(o.points[e], () => ([])),toggle:n}}exports.BrowserHistoryPort = _chunkCHNUE46Kcjs.a; exports.DatasetRegistry = _chunkEYXV5OMYcjs.c; exports.FilterRegistry = _chunkEYXV5OMYcjs.b; exports.ListingApp = _chunkJNURPGEBcjs.p; exports.ListingComponentsProvider = _chunkEYXV5OMYcjs.p; exports.ListingConfig = _chunkEYXV5OMYcjs.f; exports.ListingEngine = _chunkEYXV5OMYcjs.g; exports.ListingEngineContext = _chunkEYXV5OMYcjs.r; exports.ListingEventType = f; exports.ListingFilters = _chunkEYXV5OMYcjs.v; exports.ListingList = _chunkEYXV5OMYcjs.x; exports.ListingMap = _chunkEYXV5OMYcjs.y; exports.ListingPagination = _chunkEYXV5OMYcjs.z; exports.ListingProvider = _chunkEYXV5OMYcjs.B; exports.ListingResultHeader = _chunkEYXV5OMYcjs.A; exports.ListingStore = _chunkEYXV5OMYcjs.a; exports.ListingToolbar = Z; exports.MemoryHistoryPort = u; exports.PaginationMode = d; exports.TypedEmitter = _chunkEYXV5OMYcjs.d; exports.UrlSyncController = _chunk2VUHLHHXcjs.a; exports.composeListingProviders = _chunkEYXV5OMYcjs.h; exports.listingDefaultConfig = _chunkEYXV5OMYcjs.e; exports.useListing = _chunkEYXV5OMYcjs.s; exports.useListingComponents = _chunkEYXV5OMYcjs.q; exports.useListingEvent = _chunkJNURPGEBcjs.a; exports.useListingFilters = _chunkEYXV5OMYcjs.u; exports.useListingLayer = it; exports.useListingMap = tt; exports.useListingResults = _chunkEYXV5OMYcjs.w; exports.useListingState = _chunkEYXV5OMYcjs.t; exports.withConfig = _chunkEYXV5OMYcjs.i; exports.withDataset = _chunkEYXV5OMYcjs.k; exports.withFilters = _chunkEYXV5OMYcjs.l; exports.withInitialFilters = _chunkEYXV5OMYcjs.n; exports.withMap = _chunkEYXV5OMYcjs.j; exports.withPrimaryDataset = _chunkEYXV5OMYcjs.o; exports.withUrlSync = _chunkEYXV5OMYcjs.m;
2
+ var _chunkIE27WTWMcjs = require('./chunk-IE27WTWM.cjs');var _chunkEYXV5OMYcjs = require('./chunk-EYXV5OMY.cjs');var _chunkCHNUE46Kcjs = require('./chunk-CHNUE46K.cjs');var _chunk2VUHLHHXcjs = require('./chunk-2VUHLHHX.cjs');var d=(o=>(o.Paged="paged",o.Infinite="infinite",o))(d||{});var f=(r=>(r.FiltersChanged="FiltersChanged",r.ResultsLoaded="ResultsLoaded",r.PointClicked="PointClicked",r.BoundsChanged="BoundsChanged",r.LayerToggled="LayerToggled",r))(f||{});var u= (_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);var _jsxruntime = require('react/jsx-runtime');function Z({children:e}){let{Toolbar:t}=_chunkEYXV5OMYcjs.q.call(void 0, );return _jsxruntime.jsx.call(void 0, t,{children:e})}var _react = require('react');function tt(){let e=_chunkEYXV5OMYcjs.s.call(void 0, ),t=_chunkEYXV5OMYcjs.t.call(void 0, ),o=_react.useCallback.call(void 0, a=>e.loadPoints(a),[e]),n=_react.useCallback.call(void 0, (a,r)=>e.selectPoint(a,r),[e]);return{bounds:t.bounds,points:t.points,loadPoints:o,selectPoint:n}}function it(e){let t=_chunkEYXV5OMYcjs.s.call(void 0, ),o=_chunkEYXV5OMYcjs.t.call(void 0, ),n=_react.useCallback.call(void 0, ()=>t.toggleLayer(e),[t,e]);return{visible:_nullishCoalesce(o.layers[e], () => (!0)),points:_nullishCoalesce(o.points[e], () => ([])),toggle:n}}exports.BrowserHistoryPort = _chunkCHNUE46Kcjs.a; exports.DatasetRegistry = _chunkEYXV5OMYcjs.c; exports.FilterRegistry = _chunkEYXV5OMYcjs.b; exports.ListingApp = _chunkIE27WTWMcjs.p; exports.ListingComponentsProvider = _chunkEYXV5OMYcjs.p; exports.ListingConfig = _chunkEYXV5OMYcjs.f; exports.ListingEngine = _chunkEYXV5OMYcjs.g; exports.ListingEngineContext = _chunkEYXV5OMYcjs.r; exports.ListingEventType = f; exports.ListingFilters = _chunkEYXV5OMYcjs.v; exports.ListingList = _chunkEYXV5OMYcjs.x; exports.ListingMap = _chunkEYXV5OMYcjs.y; exports.ListingPagination = _chunkEYXV5OMYcjs.z; exports.ListingProvider = _chunkEYXV5OMYcjs.B; exports.ListingResultHeader = _chunkEYXV5OMYcjs.A; exports.ListingStore = _chunkEYXV5OMYcjs.a; exports.ListingToolbar = Z; exports.MemoryHistoryPort = u; exports.PaginationMode = d; exports.TypedEmitter = _chunkEYXV5OMYcjs.d; exports.UrlSyncController = _chunk2VUHLHHXcjs.a; exports.composeListingProviders = _chunkEYXV5OMYcjs.h; exports.listingDefaultConfig = _chunkEYXV5OMYcjs.e; exports.useListing = _chunkEYXV5OMYcjs.s; exports.useListingComponents = _chunkEYXV5OMYcjs.q; exports.useListingEvent = _chunkIE27WTWMcjs.a; exports.useListingFilters = _chunkEYXV5OMYcjs.u; exports.useListingLayer = it; exports.useListingMap = tt; exports.useListingResults = _chunkEYXV5OMYcjs.w; exports.useListingState = _chunkEYXV5OMYcjs.t; exports.withConfig = _chunkEYXV5OMYcjs.i; exports.withDataset = _chunkEYXV5OMYcjs.k; exports.withFilters = _chunkEYXV5OMYcjs.l; exports.withInitialFilters = _chunkEYXV5OMYcjs.n; exports.withMap = _chunkEYXV5OMYcjs.j; exports.withPrimaryDataset = _chunkEYXV5OMYcjs.o; exports.withUrlSync = _chunkEYXV5OMYcjs.m;
package/dist/index.js CHANGED
@@ -1,2 +1,2 @@
1
1
  "use client";
2
- import{a as O,p as m}from"./chunk-HOIUTFFL.js";import{A as N,B as U,a as y,b as P,c as L,d as h,e as b,f as x,g as C,h as I,i as k,j as q,k as v,l as B,m as S,n as A,o as F,p as T,q as p,r as w,s,t as i,u as H,v as z,w as D,x as G,y as J,z as K}from"./chunk-R3FX2V3N.js";import{a as R}from"./chunk-5FBI2WIM.js";import{a as Q}from"./chunk-35KYEBAC.js";var d=(o=>(o.Paged="paged",o.Infinite="infinite",o))(d||{});var f=(r=>(r.FiltersChanged="FiltersChanged",r.ResultsLoaded="ResultsLoaded",r.PointClicked="PointClicked",r.BoundsChanged="BoundsChanged",r.LayerToggled="LayerToggled",r))(f||{});var u=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()}};import{jsx as c}from"react/jsx-runtime";function Z({children:e}){let{Toolbar:t}=p();return c(t,{children:e})}import{useCallback as l}from"react";function tt(){let e=s(),t=i(),o=l(a=>e.loadPoints(a),[e]),n=l((a,r)=>e.selectPoint(a,r),[e]);return{bounds:t.bounds,points:t.points,loadPoints:o,selectPoint:n}}import{useCallback as g}from"react";function it(e){let t=s(),o=i(),n=g(()=>t.toggleLayer(e),[t,e]);return{visible:o.layers[e]??!0,points:o.points[e]??[],toggle:n}}export{R as BrowserHistoryPort,L as DatasetRegistry,P as FilterRegistry,m as ListingApp,T as ListingComponentsProvider,x as ListingConfig,C as ListingEngine,w as ListingEngineContext,f as ListingEventType,z as ListingFilters,G as ListingList,J as ListingMap,K as ListingPagination,U as ListingProvider,N as ListingResultHeader,y as ListingStore,Z as ListingToolbar,u as MemoryHistoryPort,d as PaginationMode,h as TypedEmitter,Q as UrlSyncController,I as composeListingProviders,b as listingDefaultConfig,s as useListing,p as useListingComponents,O as useListingEvent,H as useListingFilters,it as useListingLayer,tt as useListingMap,D as useListingResults,i as useListingState,k as withConfig,v as withDataset,B as withFilters,A as withInitialFilters,q as withMap,F as withPrimaryDataset,S as withUrlSync};
2
+ import{a as O,p as m}from"./chunk-I3HM2WET.js";import{A as N,B as U,a as y,b as P,c as L,d as h,e as b,f as x,g as C,h as I,i as k,j as q,k as v,l as B,m as S,n as A,o as F,p as T,q as p,r as w,s,t as i,u as H,v as z,w as D,x as G,y as J,z as K}from"./chunk-R3FX2V3N.js";import{a as R}from"./chunk-5FBI2WIM.js";import{a as Q}from"./chunk-35KYEBAC.js";var d=(o=>(o.Paged="paged",o.Infinite="infinite",o))(d||{});var f=(r=>(r.FiltersChanged="FiltersChanged",r.ResultsLoaded="ResultsLoaded",r.PointClicked="PointClicked",r.BoundsChanged="BoundsChanged",r.LayerToggled="LayerToggled",r))(f||{});var u=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()}};import{jsx as c}from"react/jsx-runtime";function Z({children:e}){let{Toolbar:t}=p();return c(t,{children:e})}import{useCallback as l}from"react";function tt(){let e=s(),t=i(),o=l(a=>e.loadPoints(a),[e]),n=l((a,r)=>e.selectPoint(a,r),[e]);return{bounds:t.bounds,points:t.points,loadPoints:o,selectPoint:n}}import{useCallback as g}from"react";function it(e){let t=s(),o=i(),n=g(()=>t.toggleLayer(e),[t,e]);return{visible:o.layers[e]??!0,points:o.points[e]??[],toggle:n}}export{R as BrowserHistoryPort,L as DatasetRegistry,P as FilterRegistry,m as ListingApp,T as ListingComponentsProvider,x as ListingConfig,C as ListingEngine,w as ListingEngineContext,f as ListingEventType,z as ListingFilters,G as ListingList,J as ListingMap,K as ListingPagination,U as ListingProvider,N as ListingResultHeader,y as ListingStore,Z as ListingToolbar,u as MemoryHistoryPort,d as PaginationMode,h as TypedEmitter,Q as UrlSyncController,I as composeListingProviders,b as listingDefaultConfig,s as useListing,p as useListingComponents,O as useListingEvent,H as useListingFilters,it as useListingLayer,tt as useListingMap,D as useListingResults,i as useListingState,k as withConfig,v as withDataset,B as withFilters,A as withInitialFilters,q as withMap,F as withPrimaryDataset,S 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 u(r){return r.raw}function v(r,n){if(r.element)return r.element;if(r.iconUrl)return new n.PinElement({glyphSrc:r.iconUrl})}function p(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 R(r){let n=r.getSouthWest(),s=r.getNorthEast();return{west:n.lng(),south:n.lat(),east:s.lng(),north:s.lat()}}function O(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,{center:i,zoom:_nullishCoalesce(e.zoom, () => (10)),mapId:_nullishCoalesce(r.mapId, () => (y))}),d=O(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=u(o),a=t.layers.get(e.id);a&&(p(a),t.layers.delete(e.id)),g(t,e.id);let i=e.markers.map(d=>{let c=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;c.addListener("click",()=>M(d.id))}return c});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&&(p(i),t.layers.delete(e.id),g(t,e.id)))}},onBoundsChange(o,e){let t=u(o),a=t.map.addListener("idle",()=>{let l=t.map.getBounds();l&&e(R(l))});t.boundsListeners.add(a);let i=!1;return()=>{i||(i=!0,a.remove(),t.boundsListeners.delete(a))}},fitBounds(o,e){u(o).map.fitBounds(e)},destroy(o){let e=u(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())p(t);e.layers.clear()}}}exports.googleProvider = P;
2
+ var _jsapiloader = require('@googlemaps/js-api-loader');var y="DEMO_MAP_ID";function u(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 p(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 R(r){let n=r.getSouthWest(),s=r.getNorthEast();return{west:n.lng(),south:n.lat(),east:s.lng(),north:s.lat()}}function O(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,{center:i,zoom:_nullishCoalesce(e.zoom, () => (10)),mapId:_nullishCoalesce(r.mapId, () => (y))}),d=O(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=u(o),a=t.layers.get(e.id);a&&(p(a),t.layers.delete(e.id)),g(t,e.id);let i=e.markers.map(d=>{let c=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;c.addListener("click",()=>M(d.id))}return c});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&&(p(i),t.layers.delete(e.id),g(t,e.id)))}},onBoundsChange(o,e){let t=u(o),a=t.map.addListener("idle",()=>{let l=t.map.getBounds();l&&e(R(l))});t.boundsListeners.add(a);let i=!1;return()=>{i||(i=!0,a.remove(),t.boundsListeners.delete(a))}},fitBounds(o,e){u(o).map.fitBounds(e)},destroy(o){let e=u(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())p(t);e.layers.clear()}}}exports.googleProvider = P;
@@ -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 u(r){return r.raw}function v(r,n){if(r.element)return r.element;if(r.iconUrl)return new n.PinElement({glyphSrc:r.iconUrl})}function p(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 R(r){let n=r.getSouthWest(),s=r.getNorthEast();return{west:n.lng(),south:n.lat(),east:s.lng(),north:s.lat()}}function O(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,{center:i,zoom:e.zoom??10,mapId:r.mapId??y}),d=O(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=u(o),a=t.layers.get(e.id);a&&(p(a),t.layers.delete(e.id)),g(t,e.id);let i=e.markers.map(d=>{let c=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;c.addListener("click",()=>M(d.id))}return c});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&&(p(i),t.layers.delete(e.id),g(t,e.id)))}},onBoundsChange(o,e){let t=u(o),a=t.map.addListener("idle",()=>{let l=t.map.getBounds();l&&e(R(l))});t.boundsListeners.add(a);let i=!1;return()=>{i||(i=!0,a.remove(),t.boundsListeners.delete(a))}},fitBounds(o,e){u(o).map.fitBounds(e)},destroy(o){let e=u(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())p(t);e.layers.clear()}}}export{P as googleProvider};
2
+ import{importLibrary as m,setOptions as k}from"@googlemaps/js-api-loader";var y="DEMO_MAP_ID";function u(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 p(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 R(r){let n=r.getSouthWest(),s=r.getNorthEast();return{west:n.lng(),south:n.lat(),east:s.lng(),north:s.lat()}}function O(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,{center:i,zoom:e.zoom??10,mapId:r.mapId??y}),d=O(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=u(o),a=t.layers.get(e.id);a&&(p(a),t.layers.delete(e.id)),g(t,e.id);let i=e.markers.map(d=>{let c=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;c.addListener("click",()=>M(d.id))}return c});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&&(p(i),t.layers.delete(e.id),g(t,e.id)))}},onBoundsChange(o,e){let t=u(o),a=t.map.addListener("idle",()=>{let l=t.map.getBounds();l&&e(R(l))});t.boundsListeners.add(a);let i=!1;return()=>{i||(i=!0,a.remove(),t.boundsListeners.delete(a))}},fitBounds(o,e){u(o).map.fitBounds(e)},destroy(o){let e=u(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())p(t);e.layers.clear()}}}export{P as googleProvider};
@@ -1,2 +1,2 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});"use client";
2
- var _chunkJNURPGEBcjs = require('../chunk-JNURPGEB.cjs');var _chunkEYXV5OMYcjs = require('../chunk-EYXV5OMY.cjs');var _jsxruntime = require('react/jsx-runtime');function L({children:o}){return _jsxruntime.jsx.call(void 0, _chunkEYXV5OMYcjs.p,{..._chunkJNURPGEBcjs.l,children:o})}exports.BottomNav = _chunkJNURPGEBcjs.m; exports.BottomSheet = _chunkJNURPGEBcjs.n; exports.ListingApp = _chunkJNURPGEBcjs.p; exports.StyledCard = _chunkJNURPGEBcjs.b; exports.StyledComponentsProviderWithDefaults = L; exports.StyledEmpty = _chunkJNURPGEBcjs.c; exports.StyledFilterPanel = _chunkJNURPGEBcjs.d; exports.StyledListingLayout = _chunkJNURPGEBcjs.o; exports.StyledLoading = _chunkJNURPGEBcjs.e; exports.StyledMarker = _chunkJNURPGEBcjs.f; exports.StyledPopup = _chunkJNURPGEBcjs.g; exports.StyledResultHeader = _chunkJNURPGEBcjs.h; exports.StyledSearch = _chunkJNURPGEBcjs.i; exports.StyledSidebar = _chunkJNURPGEBcjs.j; exports.StyledToolbar = _chunkJNURPGEBcjs.k; exports.styledDefaultComponents = _chunkJNURPGEBcjs.l;
2
+ var _chunkIE27WTWMcjs = require('../chunk-IE27WTWM.cjs');var _chunkEYXV5OMYcjs = require('../chunk-EYXV5OMY.cjs');var _jsxruntime = require('react/jsx-runtime');function L({children:o}){return _jsxruntime.jsx.call(void 0, _chunkEYXV5OMYcjs.p,{..._chunkIE27WTWMcjs.l,children:o})}exports.BottomNav = _chunkIE27WTWMcjs.m; exports.BottomSheet = _chunkIE27WTWMcjs.n; exports.ListingApp = _chunkIE27WTWMcjs.p; exports.StyledCard = _chunkIE27WTWMcjs.b; exports.StyledComponentsProviderWithDefaults = L; exports.StyledEmpty = _chunkIE27WTWMcjs.c; exports.StyledFilterPanel = _chunkIE27WTWMcjs.d; exports.StyledListingLayout = _chunkIE27WTWMcjs.o; exports.StyledLoading = _chunkIE27WTWMcjs.e; exports.StyledMarker = _chunkIE27WTWMcjs.f; exports.StyledPopup = _chunkIE27WTWMcjs.g; exports.StyledResultHeader = _chunkIE27WTWMcjs.h; exports.StyledSearch = _chunkIE27WTWMcjs.i; exports.StyledSidebar = _chunkIE27WTWMcjs.j; exports.StyledToolbar = _chunkIE27WTWMcjs.k; exports.styledDefaultComponents = _chunkIE27WTWMcjs.l;
@@ -1,2 +1,2 @@
1
1
  "use client";
2
- import{b as r,c as p,d as i,e as d,f as y,g as l,h as n,i as m,j as s,k as a,l as t,m as S,n as f,o as P,p as u}from"../chunk-HOIUTFFL.js";import{p as e}from"../chunk-R3FX2V3N.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};
2
+ import{b as r,c as p,d as i,e as d,f as y,g as l,h as n,i as m,j as s,k as a,l as t,m as S,n as f,o as P,p as u}from"../chunk-I3HM2WET.js";import{p as e}from"../chunk-R3FX2V3N.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.4.0",
3
+ "version": "0.4.1",
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 shadcn-compatible styled adapter.",
6
6
  "funding": [
File without changes
File without changes