react-listing-engine 0.6.4 → 0.6.5
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/README.md +37 -40
- package/dist/{components-provider-CjMxkxrP.d.ts → components-provider-FinfaqUT.d.cts} +13 -2
- package/dist/{components-provider-CF0Mo0B8.d.cts → components-provider-cWVWEDXC.d.ts} +13 -2
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +7 -10
- package/dist/index.d.ts +7 -10
- package/dist/index.js +1 -1
- package/dist/{listing-app-wmMuDlVU.d.ts → listing-app-BMoMKD4c.d.cts} +3 -5
- package/dist/{listing-app-DJbvx3oe.d.cts → listing-app-BSJKGh7k.d.ts} +3 -5
- package/dist/map-provider.interface-DT-v1plm.d.cts +67 -0
- package/dist/map-provider.interface-DT-v1plm.d.ts +67 -0
- package/dist/maps/google/index.d.cts +1 -2
- package/dist/maps/google/index.d.ts +1 -2
- package/dist/shadcn/index.cjs +1 -1
- package/dist/shadcn/index.d.cts +5 -7
- package/dist/shadcn/index.d.ts +5 -7
- package/dist/shadcn/index.js +1 -1
- package/dist/styled/index.d.cts +3 -5
- package/dist/styled/index.d.ts +3 -5
- package/dist/testing/index.d.cts +1 -2
- package/dist/testing/index.d.ts +1 -2
- package/dist/{url-sync.controller-DX67JivW.d.ts → url-sync.controller-DK5W_0OZ.d.ts} +1 -1
- package/dist/{url-sync.controller-CsU_QxoS.d.cts → url-sync.controller-DXSIWgTa.d.cts} +1 -1
- package/package.json +1 -6
- package/dist/chunk-5FBI2WIM.js +0 -2
- package/dist/chunk-6PZHSHU3.js +0 -2
- package/dist/chunk-CHNUE46K.cjs +0 -2
- package/dist/chunk-LCQZIWBO.cjs +0 -2
- package/dist/entity-adapter.interface-BDgbSxhq.d.cts +0 -33
- package/dist/entity-adapter.interface-BDgbSxhq.d.ts +0 -33
- package/dist/listing-config-options.interface-ZJYY_ZvR.d.cts +0 -12
- package/dist/listing-config-options.interface-ZJYY_ZvR.d.ts +0 -12
- package/dist/map-provider.interface-BMnwW3ob.d.cts +0 -37
- package/dist/map-provider.interface-BxexMT3X.d.ts +0 -37
- package/dist/presets/rental/index.cjs +0 -2
- package/dist/presets/rental/index.d.cts +0 -266
- package/dist/presets/rental/index.d.ts +0 -266
- package/dist/presets/rental/index.js +0 -2
package/dist/shadcn/index.d.ts
CHANGED
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
2
|
import { ReactNode } from 'react';
|
|
3
|
-
import {
|
|
4
|
-
import { L as LatLng } from '../
|
|
5
|
-
import {
|
|
6
|
-
import { I as IListingConfigOptions } from '../listing-config-options.interface-ZJYY_ZvR.js';
|
|
7
|
-
import { U as UrlSyncController } from '../url-sync.controller-DX67JivW.js';
|
|
3
|
+
import { d as IListingCardProps, e as IListingComponents, f as IListingEmptyProps, g as IListingFilterPanelProps, h as IListingLoadingProps, i as IListingMarkerProps, j as IListingPopupProps, k as IListingResultHeaderProps, l as IListingSearchProps, m as IListingSidebarProps, a as IListingToolbarProps, D as DatasetDefinition, F as FilterRegistry, I as IListingConfigOptions } from '../components-provider-cWVWEDXC.js';
|
|
4
|
+
import { L as LatLng, a as MapProvider } from '../map-provider.interface-DT-v1plm.js';
|
|
5
|
+
import { U as UrlSyncController } from '../url-sync.controller-DK5W_0OZ.js';
|
|
8
6
|
import { ClassValue } from 'clsx';
|
|
9
7
|
|
|
10
8
|
/**
|
|
@@ -216,13 +214,13 @@ interface ListingAppProps<TFilters> {
|
|
|
216
214
|
* -- see `compose-listing-providers.ts`'s `withDataset` doc comment.
|
|
217
215
|
*/
|
|
218
216
|
datasets: DatasetDefinition<any, TFilters>[];
|
|
219
|
-
/**
|
|
217
|
+
/** A `(reg) => { reg.add(...); }` callback that registers your filters -- forwarded verbatim to `withFilters`. */
|
|
220
218
|
filters?: (reg: FilterRegistry<TFilters>) => void;
|
|
221
219
|
/** A ready `MapProvider`, or `{ apiKey, mapId? }` to build a `googleProvider` internally. Omit for no map (the styled layout shows a "Map unavailable" fallback). */
|
|
222
220
|
map?: ListingAppMapProp;
|
|
223
221
|
/** Slot overrides, merged OVER the shadcn styled defaults -- see this file's doc comment for how the merge works. */
|
|
224
222
|
components?: Partial<IListingComponents>;
|
|
225
|
-
/** A `UrlSyncController<TFilters
|
|
223
|
+
/** A `UrlSyncController<TFilters>`, or `true`. `true` is a documented no-op: the library is filters-shape-erased and cannot generically derive a `TFilters <-> QueryParams` mapping, so build a real controller for your own filter shape. */
|
|
226
224
|
urlSync?: UrlSyncController<TFilters> | boolean;
|
|
227
225
|
initialFilters?: TFilters;
|
|
228
226
|
config?: Partial<IListingConfigOptions>;
|
package/dist/shadcn/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import{A as X,B as Y,h as U,i as H,j as _,k as O,l as W,m as z,n as B,p as v,q as $,s as Z,v as G,x as q,y as J,z as Q}from"../chunk-R3FX2V3N.js";import{
|
|
2
|
+
import{a as K}from"../chunk-35KYEBAC.js";import{A as X,B as Y,h as U,i as H,j as _,k as O,l as W,m as z,n as B,p as v,q as $,s as Z,v as G,x as q,y as J,z as Q}from"../chunk-R3FX2V3N.js";import{clsx as ie}from"clsx";import{twMerge as se}from"tailwind-merge";function s(...e){return se(ie(e))}import{Fragment as ne,jsx as m,jsxs as N}from"react/jsx-runtime";function ae(e){return typeof e!="number"?e:new Intl.NumberFormat("en-US",{style:"currency",currency:"USD",maximumFractionDigits:0}).format(e)}function w({item:e,selected:o,onSelect:t}){let r=e??{},l=s("flex w-full flex-col overflow-hidden rounded-lg border bg-card text-left text-card-foreground shadow-sm","motion-safe:transition-shadow",t&&"hover:shadow-md focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",o&&"ring-2 ring-ring"),a=N(ne,{children:[r.imageUrl&&m("img",{src:r.imageUrl,alt:r.title??"",className:"aspect-video w-full rounded-t-lg object-cover"}),N("div",{className:"flex flex-1 flex-col gap-1 p-3",children:[N("div",{className:"flex items-start justify-between gap-2",children:[r.title&&m("span",{className:"font-medium",children:r.title}),r.badge&&m("span",{className:"shrink-0 rounded-full bg-muted px-2 py-0.5 text-xs font-medium text-muted-foreground",children:r.badge})]}),r.subtitle&&m("span",{className:"text-sm text-muted-foreground",children:r.subtitle}),r.price!=null&&m("span",{className:"mt-1 font-semibold tabular-nums",children:ae(r.price)})]})]});return t?m("button",{type:"button",onClick:t,"aria-pressed":o??!1,className:l,children:a}):m("article",{className:l,children:a})}import{jsx as x,jsxs as j}from"react/jsx-runtime";function C(e){return j("div",{role:"status",className:"flex flex-col items-center justify-center gap-2 px-4 py-12 text-center text-muted-foreground",children:[j("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round",className:"h-8 w-8","aria-hidden":"true",children:[x("circle",{cx:"11",cy:"11",r:"7"}),x("path",{d:"m21 21-4.3-4.3"})]}),x("p",{className:"text-sm font-medium text-foreground",children:"No results"}),x("p",{className:"text-xs text-muted-foreground",children:"Try adjusting your filters or search terms."})]})}import{jsx as le}from"react/jsx-runtime";function I({children:e}){return le("div",{className:"flex flex-col gap-3",children:e})}import{jsx as L,jsxs as pe}from"react/jsx-runtime";function D(e){return L("div",{className:"flex flex-col gap-3 p-3",role:"status","aria-busy":"true","aria-label":"Loading results",children:Array.from({length:3}).map((o,t)=>pe("div",{className:"flex flex-col gap-2 motion-safe:animate-pulse",children:[L("div",{className:"aspect-video w-full rounded-md bg-muted"}),L("div",{className:"h-4 w-2/3 rounded-md bg-muted"}),L("div",{className:"h-3 w-1/3 rounded-md bg-muted"})]},t))})}import{jsx as de}from"react/jsx-runtime";function M({point:e}){let o=e.entity??{};return de("span",{className:"rounded-full border bg-background px-2 py-0.5 text-xs font-medium tabular-nums shadow-sm",children:o.price??""})}import{jsx as c,jsxs as k}from"react/jsx-runtime";function F({entity:e,onClose:o}){let t=e??{};return k("div",{className:"relative w-64 rounded-lg border bg-popover p-3 text-popover-foreground shadow-md",role:"group","aria-label":"Location details",children:[c("button",{type:"button",onClick:o,"aria-label":"Close",className:"absolute right-2 top-2 rounded-md p-1 text-muted-foreground motion-safe:transition-colors hover:bg-foreground/[0.06] hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",children:k("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",className:"h-4 w-4","aria-hidden":"true",children:[c("path",{d:"M18 6 6 18"}),c("path",{d:"m6 6 12 12"})]})}),k("div",{className:"pr-6",children:[t.title&&c("div",{className:"font-medium",children:t.title}),t.subtitle&&c("div",{className:"text-sm text-muted-foreground",children:t.subtitle}),t.price!=null&&c("div",{className:"mt-1 font-semibold tabular-nums",children:t.price})]})]})}import{jsx as me}from"react/jsx-runtime";function S({count:e,total:o}){let t=o!=null&&o!==e?`${e} of ${o} results`:`${e} results`;return me("div",{className:"text-sm tabular-nums text-muted-foreground",children:t})}import{jsx as ue}from"react/jsx-runtime";function T({value:e,onChange:o,placeholder:t}){return ue("input",{type:"search",value:e,placeholder:t,onChange:r=>o(r.target.value),"aria-label":t??"Search",className:s("h-9 w-full rounded-md border bg-background px-3 text-sm text-foreground placeholder:text-muted-foreground","focus-visible:border-ring focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring")})}import{jsx as fe}from"react/jsx-runtime";function R({children:e}){return fe("aside",{className:"flex w-full flex-col gap-4 p-4 md:border-r md:border-border",children:e})}import{jsx as ce}from"react/jsx-runtime";function A({children:e}){return ce("div",{className:"flex items-center gap-2 border-b p-2",children:e})}var g={Card:w,Marker:M,Popup:F,Sidebar:R,FilterPanel:I,Search:T,Empty:C,Loading:D,ResultHeader:S,Toolbar:A};import{jsx as be}from"react/jsx-runtime";function ge({children:e}){return be(v,{...g,children:e})}import{useEffect as ye,useState as he}from"react";import{useEffect as ve,useState as xe}from"react";import{jsx as i,jsxs as b}from"react/jsx-runtime";var Le=i("p",{className:"px-4 text-center text-sm text-muted-foreground",children:"Map unavailable - provide a Google Maps API key"});function E({search:e,className:o,toolbarEnd:t,autoFetch:r=!0,mapCenter:l,mapZoom:a}){let p=Z(),{Search:u}=$(),[f,y]=xe("list");ve(()=>{r!==!1&&p.applyFilters({})},[p,r]);let h=f==="map"?"hidden md:block":"block",P=f==="list"?"hidden md:block":"block";return b("div",{className:s("flex h-full min-h-0 w-full flex-col bg-background text-foreground",o),"data-slot":"listing-layout",children:[b("div",{className:"sticky top-0 z-10 flex flex-wrap items-end gap-3 border-b border-border bg-background p-3","data-slot":"listing-layout-filter-bar",children:[e&&i("div",{className:"w-full min-w-0 sm:w-auto sm:max-w-xs sm:flex-1",children:i(u,{value:e.value,onChange:e.onChange,placeholder:e.placeholder})}),i(G,{className:"flex flex-wrap items-end gap-3",groupClassName:"min-w-0"}),b("div",{className:"ml-auto flex items-center gap-3",children:[i(X,{}),t]})]}),i("div",{className:"flex items-center justify-center gap-1 border-b border-border bg-background p-2 md:hidden","data-slot":"listing-layout-mobile-toggle",children:i("div",{role:"group","aria-label":"View",className:"inline-flex rounded-md border border-border p-0.5",children:[{view:"list",label:"List"},{view:"map",label:"Map"}].map(({view:d,label:n})=>i("button",{type:"button","aria-pressed":f===d,onClick:()=>y(d),className:s("rounded-[5px] px-3 py-1 text-sm font-medium motion-safe:transition-colors",f===d?"bg-primary text-primary-foreground":"text-muted-foreground hover:bg-foreground/[0.06] hover:text-foreground"),children:n},d))})}),b("div",{className:"grid min-h-0 flex-1 md:grid-cols-[minmax(340px,42%)_1fr]","data-slot":"listing-layout-split",children:[b("div",{className:s("min-h-0 overflow-y-auto p-3",h),"data-slot":"listing-layout-list",children:[i(q,{className:"grid content-start gap-3 [grid-template-columns:repeat(auto-fill,minmax(200px,1fr))]"}),i("div",{className:"mt-4 flex justify-center",children:i(Q,{})})]}),i("div",{className:s("min-h-0 md:sticky md:top-0",P),"data-slot":"listing-layout-map",children:i(J,{center:l,zoom:a,fallback:Le})})]})]})}import{jsx as V}from"react/jsx-runtime";function ee(e){return"provider"in e}function Pe(e){let o=e!=null&&!ee(e),t=o?e.apiKey:void 0,r=o?e.mapId:void 0,[l,a]=he(()=>!e||ee(e)?{ready:!0,provider:e?.provider}:{ready:!1});return ye(()=>{if(!t)return;let p=!1;return import("../maps/google/index.js").then(({googleProvider:u})=>{p||a({ready:!0,provider:u({apiKey:t,mapId:r})})}),()=>{p=!0}},[t,r]),l}function Ne(e){let{datasets:o,filters:t,map:r,components:l,urlSync:a,initialFilters:p,config:u,className:f,search:y,autoFetch:h}=e,{ready:P,provider:d}=Pe(r);if(!P)return null;let n=[];for(let oe of o)n.push(O(oe));t&&n.push(W(t)),d&&n.push(_(d)),a instanceof K&&n.push(z(a)),p&&n.push(B(p)),u&&n.push(H(u));let te=U(...n),re={...g,...l};return V(Y,{...te,children:V(v,{...re,children:V(E,{className:f,search:y,autoFetch:h,mapCenter:r?.center,mapZoom:r?.zoom})})})}export{w as DefaultCard,C as DefaultEmpty,I as DefaultFilterPanel,D as DefaultLoading,M as DefaultMarker,F as DefaultPopup,S as DefaultResultHeader,T as DefaultSearch,R as DefaultSidebar,A as DefaultToolbar,Ne as ListingApp,ge as ListingComponentsProviderWithDefaults,E as ListingLayout,s as cn,g as shadcnDefaultComponents};
|
package/dist/styled/index.d.cts
CHANGED
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
2
|
import { ReactNode } from 'react';
|
|
3
|
-
import {
|
|
4
|
-
export { B as BottomNav, b as BottomNavView, I as IBottomNavAction, c as IBottomNavProps, d as IStyledListingLayoutProps, L as ListingApp, e as ListingAppMapProp, a as ListingAppProps, S as StyledListingLayout } from '../listing-app-
|
|
5
|
-
import '../
|
|
6
|
-
import '../map-provider.interface-BMnwW3ob.cjs';
|
|
7
|
-
import '../listing-config-options.interface-ZJYY_ZvR.cjs';
|
|
3
|
+
import { d as IListingCardProps, f as IListingEmptyProps, g as IListingFilterPanelProps, h as IListingLoadingProps, i as IListingMarkerProps, j as IListingPopupProps, k as IListingResultHeaderProps, l as IListingSearchProps, m as IListingSidebarProps, a as IListingToolbarProps, e as IListingComponents } from '../components-provider-FinfaqUT.cjs';
|
|
4
|
+
export { B as BottomNav, b as BottomNavView, I as IBottomNavAction, c as IBottomNavProps, d as IStyledListingLayoutProps, L as ListingApp, e as ListingAppMapProp, a as ListingAppProps, S as StyledListingLayout } from '../listing-app-BMoMKD4c.cjs';
|
|
5
|
+
import '../map-provider.interface-DT-v1plm.cjs';
|
|
8
6
|
|
|
9
7
|
/**
|
|
10
8
|
* Default `/styled` `Card` slot. Renders an optional image, title, subtitle,
|
package/dist/styled/index.d.ts
CHANGED
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
2
|
import { ReactNode } from 'react';
|
|
3
|
-
import {
|
|
4
|
-
export { B as BottomNav, b as BottomNavView, I as IBottomNavAction, c as IBottomNavProps, d as IStyledListingLayoutProps, L as ListingApp, e as ListingAppMapProp, a as ListingAppProps, S as StyledListingLayout } from '../listing-app-
|
|
5
|
-
import '../
|
|
6
|
-
import '../map-provider.interface-BxexMT3X.js';
|
|
7
|
-
import '../listing-config-options.interface-ZJYY_ZvR.js';
|
|
3
|
+
import { d as IListingCardProps, f as IListingEmptyProps, g as IListingFilterPanelProps, h as IListingLoadingProps, i as IListingMarkerProps, j as IListingPopupProps, k as IListingResultHeaderProps, l as IListingSearchProps, m as IListingSidebarProps, a as IListingToolbarProps, e as IListingComponents } from '../components-provider-cWVWEDXC.js';
|
|
4
|
+
export { B as BottomNav, b as BottomNavView, I as IBottomNavAction, c as IBottomNavProps, d as IStyledListingLayoutProps, L as ListingApp, e as ListingAppMapProp, a as ListingAppProps, S as StyledListingLayout } from '../listing-app-BSJKGh7k.js';
|
|
5
|
+
import '../map-provider.interface-DT-v1plm.js';
|
|
8
6
|
|
|
9
7
|
/**
|
|
10
8
|
* Default `/styled` `Card` slot. Renders an optional image, title, subtitle,
|
package/dist/testing/index.d.cts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { B as Bounds,
|
|
2
|
-
import { M as MapProvider, a as MapHandle, R as RenderedLayer, b as MapInitOptions, U as Unsubscribe } from '../map-provider.interface-BMnwW3ob.cjs';
|
|
1
|
+
import { a as MapProvider, c as MapHandle, R as RenderedLayer, B as Bounds, d as MapInitOptions, U as Unsubscribe, b as EntityAdapter, L as LatLng, E as EntityId, e as PageRequest, P as Page, M as MapPoint } from '../map-provider.interface-DT-v1plm.cjs';
|
|
3
2
|
|
|
4
3
|
type BoundsListener = (b: Bounds) => void;
|
|
5
4
|
/**
|
package/dist/testing/index.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { B as Bounds,
|
|
2
|
-
import { M as MapProvider, a as MapHandle, R as RenderedLayer, b as MapInitOptions, U as Unsubscribe } from '../map-provider.interface-BxexMT3X.js';
|
|
1
|
+
import { a as MapProvider, c as MapHandle, R as RenderedLayer, B as Bounds, d as MapInitOptions, U as Unsubscribe, b as EntityAdapter, L as LatLng, E as EntityId, e as PageRequest, P as Page, M as MapPoint } from '../map-provider.interface-DT-v1plm.js';
|
|
3
2
|
|
|
4
3
|
type BoundsListener = (b: Bounds) => void;
|
|
5
4
|
/**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-listing-engine",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.5",
|
|
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": [
|
|
@@ -59,11 +59,6 @@
|
|
|
59
59
|
"import": "./dist/maps/google/index.js",
|
|
60
60
|
"require": "./dist/maps/google/index.cjs"
|
|
61
61
|
},
|
|
62
|
-
"./presets/rental": {
|
|
63
|
-
"types": "./dist/presets/rental/index.d.ts",
|
|
64
|
-
"import": "./dist/presets/rental/index.js",
|
|
65
|
-
"require": "./dist/presets/rental/index.cjs"
|
|
66
|
-
},
|
|
67
62
|
"./testing": {
|
|
68
63
|
"types": "./dist/testing/index.d.ts",
|
|
69
64
|
"import": "./dist/testing/index.js",
|
package/dist/chunk-5FBI2WIM.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
var i=class{mode;constructor(e={}){this.mode=e.mode??"replace"}getQuery(){if(typeof window>"u")return{};let e=new URLSearchParams(window.location.search),t={};for(let[r,o]of e)o!==""&&(t[r]=o);return t}setQuery(e){if(typeof window>"u")return;let t=new URLSearchParams;for(let[a,n]of Object.entries(e))n===void 0||n===""||t.set(a,n);let r=t.toString(),o=r?`?${r}`:"";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(e){return typeof window>"u"?()=>{}:(window.addEventListener("popstate",e),()=>{window.removeEventListener("popstate",e)})}};export{i as a};
|
package/dist/chunk-6PZHSHU3.js
DELETED
package/dist/chunk-CHNUE46K.cjs
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } }"use client";
|
|
2
|
-
var i=class{constructor(e={}){this.mode=_nullishCoalesce(e.mode, () => ("replace"))}getQuery(){if(typeof window>"u")return{};let e=new URLSearchParams(window.location.search),t={};for(let[r,o]of e)o!==""&&(t[r]=o);return t}setQuery(e){if(typeof window>"u")return;let t=new URLSearchParams;for(let[a,n]of Object.entries(e))n===void 0||n===""||t.set(a,n);let r=t.toString(),o=r?`?${r}`:"";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(e){return typeof window>"u"?()=>{}:(window.addEventListener("popstate",e),()=>{window.removeEventListener("popstate",e)})}};exports.a = i;
|
package/dist/chunk-LCQZIWBO.cjs
DELETED
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
type EntityId = string | number;
|
|
2
|
-
interface Bounds {
|
|
3
|
-
west: number;
|
|
4
|
-
south: number;
|
|
5
|
-
east: number;
|
|
6
|
-
north: number;
|
|
7
|
-
}
|
|
8
|
-
interface LatLng {
|
|
9
|
-
lat: number;
|
|
10
|
-
lng: number;
|
|
11
|
-
}
|
|
12
|
-
interface PageRequest {
|
|
13
|
-
cursor?: string | null;
|
|
14
|
-
limit: number;
|
|
15
|
-
}
|
|
16
|
-
interface Page<T> {
|
|
17
|
-
items: T[];
|
|
18
|
-
nextCursor: string | null;
|
|
19
|
-
total?: number;
|
|
20
|
-
}
|
|
21
|
-
interface MapPoint<TEntity = unknown> {
|
|
22
|
-
id: EntityId;
|
|
23
|
-
position: LatLng;
|
|
24
|
-
entity: TEntity;
|
|
25
|
-
}
|
|
26
|
-
type QueryParams = Record<string, string | undefined>;
|
|
27
|
-
interface EntityAdapter<TEntity, TFilters> {
|
|
28
|
-
list(filters: TFilters, page: PageRequest): Promise<Page<TEntity>>;
|
|
29
|
-
getPoints(filters: TFilters, bounds: Bounds): Promise<MapPoint<TEntity>[]>;
|
|
30
|
-
getById?(id: EntityId): Promise<TEntity>;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
export type { Bounds as B, EntityId as E, LatLng as L, MapPoint as M, Page as P, QueryParams as Q, EntityAdapter as a, PageRequest as b };
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
type EntityId = string | number;
|
|
2
|
-
interface Bounds {
|
|
3
|
-
west: number;
|
|
4
|
-
south: number;
|
|
5
|
-
east: number;
|
|
6
|
-
north: number;
|
|
7
|
-
}
|
|
8
|
-
interface LatLng {
|
|
9
|
-
lat: number;
|
|
10
|
-
lng: number;
|
|
11
|
-
}
|
|
12
|
-
interface PageRequest {
|
|
13
|
-
cursor?: string | null;
|
|
14
|
-
limit: number;
|
|
15
|
-
}
|
|
16
|
-
interface Page<T> {
|
|
17
|
-
items: T[];
|
|
18
|
-
nextCursor: string | null;
|
|
19
|
-
total?: number;
|
|
20
|
-
}
|
|
21
|
-
interface MapPoint<TEntity = unknown> {
|
|
22
|
-
id: EntityId;
|
|
23
|
-
position: LatLng;
|
|
24
|
-
entity: TEntity;
|
|
25
|
-
}
|
|
26
|
-
type QueryParams = Record<string, string | undefined>;
|
|
27
|
-
interface EntityAdapter<TEntity, TFilters> {
|
|
28
|
-
list(filters: TFilters, page: PageRequest): Promise<Page<TEntity>>;
|
|
29
|
-
getPoints(filters: TFilters, bounds: Bounds): Promise<MapPoint<TEntity>[]>;
|
|
30
|
-
getById?(id: EntityId): Promise<TEntity>;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
export type { Bounds as B, EntityId as E, LatLng as L, MapPoint as M, Page as P, QueryParams as Q, EntityAdapter as a, PageRequest as b };
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
declare enum PaginationMode {
|
|
2
|
-
Paged = "paged",
|
|
3
|
-
Infinite = "infinite"
|
|
4
|
-
}
|
|
5
|
-
|
|
6
|
-
interface IListingConfigOptions {
|
|
7
|
-
pagination: PaginationMode;
|
|
8
|
-
pageSize: number;
|
|
9
|
-
debounceMs: number;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
export { type IListingConfigOptions as I, PaginationMode as P };
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
declare enum PaginationMode {
|
|
2
|
-
Paged = "paged",
|
|
3
|
-
Infinite = "infinite"
|
|
4
|
-
}
|
|
5
|
-
|
|
6
|
-
interface IListingConfigOptions {
|
|
7
|
-
pagination: PaginationMode;
|
|
8
|
-
pageSize: number;
|
|
9
|
-
debounceMs: number;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
export { type IListingConfigOptions as I, PaginationMode as P };
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import { L as LatLng, B as Bounds } from './entity-adapter.interface-BDgbSxhq.cjs';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Providers that need an API key take it via their factory (e.g. `googleProvider({ apiKey })`),
|
|
5
|
-
* not per-mount.
|
|
6
|
-
*/
|
|
7
|
-
interface MapInitOptions {
|
|
8
|
-
apiKey?: string;
|
|
9
|
-
center?: LatLng;
|
|
10
|
-
zoom?: number;
|
|
11
|
-
}
|
|
12
|
-
interface MapHandle {
|
|
13
|
-
readonly raw: unknown;
|
|
14
|
-
}
|
|
15
|
-
interface RenderedLayer {
|
|
16
|
-
id: string;
|
|
17
|
-
markers: Array<{
|
|
18
|
-
id: string | number;
|
|
19
|
-
position: LatLng;
|
|
20
|
-
iconUrl?: string;
|
|
21
|
-
element?: HTMLElement;
|
|
22
|
-
}>;
|
|
23
|
-
clustering?: {
|
|
24
|
-
maxZoom?: number;
|
|
25
|
-
} | false;
|
|
26
|
-
onMarkerClick?(id: string | number): void;
|
|
27
|
-
}
|
|
28
|
-
type Unsubscribe = () => void;
|
|
29
|
-
interface MapProvider {
|
|
30
|
-
mount(el: HTMLElement, opts: MapInitOptions): Promise<MapHandle> | MapHandle;
|
|
31
|
-
renderLayer(handle: MapHandle, layer: RenderedLayer): Unsubscribe;
|
|
32
|
-
onBoundsChange(handle: MapHandle, cb: (b: Bounds) => void): Unsubscribe;
|
|
33
|
-
fitBounds(handle: MapHandle, b: Bounds): void;
|
|
34
|
-
destroy(handle: MapHandle): void;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
export type { MapProvider as M, RenderedLayer as R, Unsubscribe as U, MapHandle as a, MapInitOptions as b };
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import { L as LatLng, B as Bounds } from './entity-adapter.interface-BDgbSxhq.js';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Providers that need an API key take it via their factory (e.g. `googleProvider({ apiKey })`),
|
|
5
|
-
* not per-mount.
|
|
6
|
-
*/
|
|
7
|
-
interface MapInitOptions {
|
|
8
|
-
apiKey?: string;
|
|
9
|
-
center?: LatLng;
|
|
10
|
-
zoom?: number;
|
|
11
|
-
}
|
|
12
|
-
interface MapHandle {
|
|
13
|
-
readonly raw: unknown;
|
|
14
|
-
}
|
|
15
|
-
interface RenderedLayer {
|
|
16
|
-
id: string;
|
|
17
|
-
markers: Array<{
|
|
18
|
-
id: string | number;
|
|
19
|
-
position: LatLng;
|
|
20
|
-
iconUrl?: string;
|
|
21
|
-
element?: HTMLElement;
|
|
22
|
-
}>;
|
|
23
|
-
clustering?: {
|
|
24
|
-
maxZoom?: number;
|
|
25
|
-
} | false;
|
|
26
|
-
onMarkerClick?(id: string | number): void;
|
|
27
|
-
}
|
|
28
|
-
type Unsubscribe = () => void;
|
|
29
|
-
interface MapProvider {
|
|
30
|
-
mount(el: HTMLElement, opts: MapInitOptions): Promise<MapHandle> | MapHandle;
|
|
31
|
-
renderLayer(handle: MapHandle, layer: RenderedLayer): Unsubscribe;
|
|
32
|
-
onBoundsChange(handle: MapHandle, cb: (b: Bounds) => void): Unsubscribe;
|
|
33
|
-
fitBounds(handle: MapHandle, b: Bounds): void;
|
|
34
|
-
destroy(handle: MapHandle): void;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
export type { MapProvider as M, RenderedLayer as R, Unsubscribe as U, MapHandle as a, MapInitOptions as b };
|
|
@@ -1,2 +0,0 @@
|
|
|
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; }"use client";
|
|
2
|
-
var _chunkCHNUE46Kcjs = require('../../chunk-CHNUE46K.cjs');var _chunkLCQZIWBOcjs = require('../../chunk-LCQZIWBO.cjs');var _chunk2VUHLHHXcjs = require('../../chunk-2VUHLHHX.cjs');var Y=["grocery","shopping","restaurants","schools","hospitals","parks","gyms","cafes"];function _(e,t){let n=e.list;return{id:"businesses",adapter:{list:n?(r,o)=>n(r,o):async()=>({items:[],nextCursor:null}),getPoints:(r,o)=>e.search(r,o).then(s=>s.filter(i=>!_optionalChain([t, 'optionalAccess', _2 => _2.categories])||t.categories.includes(i.category))).then(s=>s.map(i=>({id:i.id,position:i.coordinates,entity:i})))},marker:{iconUrl:r=>_nullishCoalesce(_optionalChain([t, 'optionalAccess', _3 => _3.icons, 'optionalAccess', _4 => _4[r.category]]), () => ("")),onClick:_optionalChain([t, 'optionalAccess', _5 => _5.onClick])},clustering:{maxZoom:15},visible:()=>!0}}var _jsxruntime = require('react/jsx-runtime');function b({value:e,onChange:t}){return _jsxruntime.jsx.call(void 0, "input",{type:"search",value:e,onChange:r=>{t(r.target.value)},"aria-label":"Keyword",placeholder:"Search keyword",className:"h-9 w-full rounded-md border border-border bg-background px-2 text-sm text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring"})}var _react = require('react');var k=["house","apartment","condo","townhouse","land"],N={house:"House",apartment:"Apartment",condo:"Condo",townhouse:"Townhouse",land:"Land"};function F({value:e,onChange:t}){let[n,r]=_react.useState.call(void 0, !1),o=i=>l=>{t(l.target.checked?[...e,i]:e.filter(c=>c!==i))};return _jsxruntime.jsxs.call(void 0, "details",{open:n,className:"group relative",children:[_jsxruntime.jsxs.call(void 0, "summary",{onClick:i=>{i.preventDefault(),r(l=>!l)},"aria-expanded":n,className:"flex h-9 w-fit cursor-pointer list-none items-center gap-1.5 rounded-md border border-border bg-background px-3 text-sm text-foreground motion-safe:transition-colors hover:bg-foreground/[0.06] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring [&::-webkit-details-marker]:hidden",children:["Property type",e.length>0&&_jsxruntime.jsx.call(void 0, "span",{className:"inline-flex h-5 min-w-5 items-center justify-center rounded-full bg-primary px-1 text-xs font-semibold tabular-nums text-primary-foreground",children:e.length}),_jsxruntime.jsx.call(void 0, "svg",{"aria-hidden":"true",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",className:"size-3.5 shrink-0 text-muted-foreground motion-safe:transition-transform group-open:rotate-180",children:_jsxruntime.jsx.call(void 0, "path",{d:"m6 9 6 6 6-6"})})]}),_jsxruntime.jsxs.call(void 0, "fieldset",{className:"absolute z-10 mt-1.5 flex w-48 flex-col gap-1.5 rounded-md border border-border bg-popover p-3 text-popover-foreground shadow-md",children:[_jsxruntime.jsx.call(void 0, "legend",{className:"sr-only",children:"Property type"}),k.map(i=>_jsxruntime.jsxs.call(void 0, "label",{className:"flex items-center gap-2 text-sm",children:[_jsxruntime.jsx.call(void 0, "input",{type:"checkbox",checked:e.includes(i),onChange:o(i),className:"size-4 rounded border-border accent-primary"}),N[i]]},i))]})]})}function R(e){if(e==="")return;let t=Number(e);return Number.isNaN(t)?void 0:t}function y({value:e,onChange:t}){let n=s=>{t({...e,min:R(s.target.value)})},r=s=>{t({...e,max:R(s.target.value)})},o="h-9 w-full rounded-md border border-border bg-background px-2 text-sm tabular-nums text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring";return _jsxruntime.jsxs.call(void 0, "div",{className:"flex items-center gap-2",children:[_jsxruntime.jsx.call(void 0, "input",{type:"number",inputMode:"numeric","aria-label":"Minimum",placeholder:"Min",value:_nullishCoalesce(e.min, () => ("")),onChange:n,className:o}),_jsxruntime.jsx.call(void 0, "span",{"aria-hidden":"true",className:"text-muted-foreground",children:"-"}),_jsxruntime.jsx.call(void 0, "input",{type:"number",inputMode:"numeric","aria-label":"Maximum",placeholder:"Max",value:_nullishCoalesce(e.max, () => ("")),onChange:r,className:o})]})}function f(e){return new Intl.NumberFormat("en-US",{style:"currency",currency:"USD",maximumFractionDigits:0}).format(e)}function v(e){return e.length?`${e[0].toUpperCase()}${e.slice(1)}`:e}function J({item:e,selected:t,onSelect:n}){let r=e,o=_chunkLCQZIWBOcjs.a.call(void 0, "flex w-full flex-col overflow-hidden rounded-[10px] border border-border bg-card text-left text-card-foreground","motion-safe:transition-shadow",n&&"hover:shadow-lg focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",t&&"ring-2 ring-ring"),s=_jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment,{children:[_optionalChain([r, 'optionalAccess', _6 => _6.imageUrl])?_jsxruntime.jsx.call(void 0, "img",{src:r.imageUrl,alt:_nullishCoalesce(r.title, () => ("")),className:"aspect-[4/3] w-full rounded-t-[10px] object-cover"}):_jsxruntime.jsx.call(void 0, "div",{className:"aspect-[4/3] w-full rounded-t-[10px] bg-muted","aria-hidden":"true"}),_jsxruntime.jsxs.call(void 0, "div",{className:"flex flex-1 flex-col gap-1 p-3",children:[_optionalChain([r, 'optionalAccess', _7 => _7.title])&&_jsxruntime.jsx.call(void 0, "span",{className:"text-base font-semibold",children:r.title}),_optionalChain([r, 'optionalAccess', _8 => _8.address])&&_jsxruntime.jsx.call(void 0, "span",{className:"text-sm text-muted-foreground",children:r.address}),_optionalChain([r, 'optionalAccess', _9 => _9.propertyType])!=null&&r.bedrooms!=null&&r.bathrooms!=null&&_jsxruntime.jsxs.call(void 0, "span",{className:"text-sm text-muted-foreground",children:[v(r.propertyType)," \xB7 ",r.bedrooms," bd \xB7 ",r.bathrooms," ba"]}),_optionalChain([r, 'optionalAccess', _10 => _10.price])!=null&&_jsxruntime.jsxs.call(void 0, "span",{className:"mt-1 font-bold tabular-nums",children:[f(r.price)," ",_jsxruntime.jsx.call(void 0, "span",{className:"text-sm font-normal text-muted-foreground",children:"/mo"})]})]})]});return n?_jsxruntime.jsx.call(void 0, "button",{type:"button",onClick:n,"aria-pressed":_nullishCoalesce(t, () => (!1)),className:o,children:s}):_jsxruntime.jsx.call(void 0, "article",{className:o,children:s})}function ee({point:e}){let t=e.entity;return _jsxruntime.jsxs.call(void 0, "span",{className:"relative inline-flex items-center whitespace-nowrap rounded-full bg-primary px-2.5 py-1 text-xs font-bold tabular-nums text-primary-foreground shadow",children:[_optionalChain([t, 'optionalAccess', _11 => _11.price])!=null?f(t.price):"",_jsxruntime.jsx.call(void 0, "span",{"aria-hidden":"true",className:"absolute -bottom-[3px] left-1/2 h-2 w-2 -translate-x-1/2 rotate-45 rounded-br-[2px] bg-primary"})]})}function S(e){let t=document.createElement("div");t.className="relative inline-flex items-center whitespace-nowrap rounded-full bg-primary px-2.5 py-1 text-xs font-bold text-primary-foreground shadow",t.textContent=f(e.price),t.style.position="relative",t.style.display="inline-flex",t.style.alignItems="center",t.style.whiteSpace="nowrap",t.style.borderRadius="9999px",t.style.backgroundColor="var(--primary, #16a34a)",t.style.color="var(--primary-foreground, #ffffff)",t.style.padding="4px 10px",t.style.fontSize="12px",t.style.fontWeight="700",t.style.fontFamily="inherit",t.style.boxShadow="0 1px 2px rgba(0, 0, 0, 0.3)";let n=document.createElement("span");return n.className="absolute -bottom-[3px] left-1/2 h-2 w-2 -translate-x-1/2 rotate-45 rounded-br-[2px] bg-primary",n.style.position="absolute",n.style.left="50%",n.style.bottom="-3px",n.style.width="8px",n.style.height="8px",n.style.borderRadius="0 0 2px 0",n.style.backgroundColor="var(--primary, #16a34a)",n.style.transform="translateX(-50%) rotate(45deg)",t.appendChild(n),t}function ie(e,t){let n=e.getById;return{id:"properties",adapter:{list:(r,o)=>e.list(r,o),getPoints:(r,o)=>e.search(r,o).then(s=>s.map(i=>({id:i.id,position:i.coordinates,entity:i}))),getById:n?r=>n(r):void 0},marker:{iconUrl:_optionalChain([t, 'optionalAccess', _12 => _12.iconUrl]),element:_nullishCoalesce(_optionalChain([t, 'optionalAccess', _13 => _13.element]), () => (S)),onClick:_optionalChain([t, 'optionalAccess', _14 => _14.onClick])},clustering:{maxZoom:14}}}var D={key:"price",order:10,label:"Price",render:y,toParams:e=>({minPrice:e.min,maxPrice:e.max}),fromParams:e=>({min:e.minPrice,max:e.maxPrice}),isActive:e=>e.minPrice!=null||e.maxPrice!=null},I={key:"beds",order:20,label:"Bedrooms",render:y,toParams:e=>({minBeds:e.min,maxBeds:e.max}),fromParams:e=>({min:e.minBeds,max:e.maxBeds}),isActive:e=>e.minBeds!=null||e.maxBeds!=null},M={key:"baths",order:30,label:"Bathrooms",render:y,toParams:e=>({minBaths:e.min,maxBaths:e.max}),fromParams:e=>({min:e.minBaths,max:e.maxBaths}),isActive:e=>e.minBaths!=null||e.maxBaths!=null},L={key:"propertyType",order:40,label:"Property type",render:F,toParams:e=>({propertyTypes:e.length?e:void 0}),fromParams:e=>_nullishCoalesce(e.propertyTypes, () => ([])),isActive:e=>(_nullishCoalesce(_optionalChain([e, 'access', _15 => _15.propertyTypes, 'optionalAccess', _16 => _16.length]), () => (0)))>0},O={key:"keyword",order:50,label:"Keyword",render:b,toParams:e=>({keyword:e||void 0}),fromParams:e=>_nullishCoalesce(e.keyword, () => ("")),isActive:e=>!!e.keyword},U= exports.rentalFilters =[D,I,M,L,O];function pe(){return e=>{U.forEach(t=>e.add(t))}}var A=["house","apartment","condo","townhouse","land"];function V(e){return A.includes(e)}function p(e){if(e===void 0||e==="")return;let t=Number(e);return Number.isNaN(t)?void 0:t}function H(e){let t={};return e.minPrice!=null&&(t.minPrice=String(e.minPrice)),e.maxPrice!=null&&(t.maxPrice=String(e.maxPrice)),e.minBeds!=null&&(t.minBeds=String(e.minBeds)),e.maxBeds!=null&&(t.maxBeds=String(e.maxBeds)),e.minBaths!=null&&(t.minBaths=String(e.minBaths)),e.maxBaths!=null&&(t.maxBaths=String(e.maxBaths)),_optionalChain([e, 'access', _17 => _17.propertyTypes, 'optionalAccess', _18 => _18.length])&&(t.type=e.propertyTypes.join(",")),e.keyword&&(t.q=e.keyword),t}function Q(e){let t={},n=p(e.minPrice);n!==void 0&&(t.minPrice=n);let r=p(e.maxPrice);r!==void 0&&(t.maxPrice=r);let o=p(e.minBeds);o!==void 0&&(t.minBeds=o);let s=p(e.maxBeds);s!==void 0&&(t.maxBeds=s);let i=p(e.minBaths);i!==void 0&&(t.minBaths=i);let l=p(e.maxBaths);l!==void 0&&(t.maxBaths=l);let c=_optionalChain([e, 'access', _19 => _19.type, 'optionalAccess', _20 => _20.split, 'call', _21 => _21(","), 'access', _22 => _22.map, 'call', _23 => _23(B=>B.trim()), 'access', _24 => _24.filter, 'call', _25 => _25(V)]);return _optionalChain([c, 'optionalAccess', _26 => _26.length])&&(t.propertyTypes=c),e.q&&(t.keyword=e.q),t}function ue(e={}){let t=_nullishCoalesce(e.history, () => (new (0, _chunkCHNUE46Kcjs.a)({mode:e.mode})));return new (0, _chunk2VUHLHHXcjs.a)({history:t,toQuery:H,toFilters:Q,hydrateOnStart:e.hydrateOnStart})}exports.KNOWN_BUSINESS_CATEGORIES = Y; exports.KeywordFilterControl = b; exports.PropertyCard = J; exports.PropertyMarker = ee; exports.PropertyTypeFilterControl = F; exports.RangeFilterControl = y; exports.defaultPriceMarkerElement = S; exports.formatRentalPrice = f; exports.nearbyBusinessesDataset = _; exports.propertiesDataset = ie; exports.rentalFilters = U; exports.rentalFiltersFromQuery = Q; exports.rentalFiltersToQuery = H; exports.rentalUrlSync = ue; exports.withRentalFilters = pe;
|