@mapfirst.ai/react 0.0.44 → 0.0.45
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +45 -51
- package/dist/index.d.ts +45 -51
- package/dist/index.js +18 -27
- package/dist/index.mjs +18 -27
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -226,15 +226,15 @@ type SmartFilter = {
|
|
|
226
226
|
* }, [mapLibreInstance]);
|
|
227
227
|
*
|
|
228
228
|
* // Use search methods
|
|
229
|
-
* await propertiesSearch
|
|
229
|
+
* await propertiesSearch({
|
|
230
230
|
* body: { city: "Paris", country: "France" }
|
|
231
231
|
* });
|
|
232
232
|
*
|
|
233
|
-
* await smartFilterSearch
|
|
233
|
+
* await smartFilterSearch({
|
|
234
234
|
* query: "hotels near beach with pool"
|
|
235
235
|
* });
|
|
236
236
|
*
|
|
237
|
-
* await boundsSearch
|
|
237
|
+
* await boundsSearch();
|
|
238
238
|
* ```
|
|
239
239
|
*/
|
|
240
240
|
declare function useMapFirst(options: BaseMapFirstOptions): {
|
|
@@ -243,54 +243,48 @@ declare function useMapFirst(options: BaseMapFirstOptions): {
|
|
|
243
243
|
setPrimaryType: (type: PropertyType) => void;
|
|
244
244
|
setSelectedMarker: (id: number | null) => void;
|
|
245
245
|
setUseApi: (useApi: boolean, autoLoad?: boolean) => void;
|
|
246
|
-
propertiesSearch: {
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
properties: Property[];
|
|
289
|
-
isComplete: boolean | undefined;
|
|
290
|
-
pollingLink: string | undefined;
|
|
291
|
-
durationSeconds: number;
|
|
292
|
-
} | null>;
|
|
293
|
-
};
|
|
246
|
+
propertiesSearch: (options: {
|
|
247
|
+
body: InitialRequestBody;
|
|
248
|
+
beforeApplyProperties?: (data: any) => {
|
|
249
|
+
price?: any;
|
|
250
|
+
limit?: number;
|
|
251
|
+
};
|
|
252
|
+
smartFiltersClearable?: boolean;
|
|
253
|
+
onError?: (error: unknown) => void;
|
|
254
|
+
}) => Promise<{
|
|
255
|
+
location_id?: number;
|
|
256
|
+
filters: _mapfirst_ai_core.FilterSchema;
|
|
257
|
+
properties: Property[];
|
|
258
|
+
isComplete: boolean | undefined;
|
|
259
|
+
pollingLink: string | undefined;
|
|
260
|
+
durationSeconds: number;
|
|
261
|
+
} | null>;
|
|
262
|
+
smartFilterSearch: (options: {
|
|
263
|
+
query?: string;
|
|
264
|
+
filters?: SmartFilter[];
|
|
265
|
+
onProcessFilters?: (filters: any, location_id?: number) => {
|
|
266
|
+
smartFilters?: SmartFilter[];
|
|
267
|
+
price?: any;
|
|
268
|
+
limit?: number;
|
|
269
|
+
language?: string;
|
|
270
|
+
};
|
|
271
|
+
onError?: (error: unknown) => void;
|
|
272
|
+
}) => Promise<{
|
|
273
|
+
location_id?: number;
|
|
274
|
+
filters: _mapfirst_ai_core.FilterSchema;
|
|
275
|
+
properties: Property[];
|
|
276
|
+
isComplete: boolean | undefined;
|
|
277
|
+
pollingLink: string | undefined;
|
|
278
|
+
durationSeconds: number;
|
|
279
|
+
} | null>;
|
|
280
|
+
boundsSearch: () => Promise<{
|
|
281
|
+
location_id?: number;
|
|
282
|
+
filters: _mapfirst_ai_core.FilterSchema;
|
|
283
|
+
properties: Property[];
|
|
284
|
+
isComplete: boolean | undefined;
|
|
285
|
+
pollingLink: string | undefined;
|
|
286
|
+
durationSeconds: number;
|
|
287
|
+
} | null>;
|
|
294
288
|
attachMapLibre: (map: any, maplibregl: MapLibreNamespace, options?: {
|
|
295
289
|
onMarkerClick?: (marker: Property) => void;
|
|
296
290
|
}) => void;
|
package/dist/index.d.ts
CHANGED
|
@@ -226,15 +226,15 @@ type SmartFilter = {
|
|
|
226
226
|
* }, [mapLibreInstance]);
|
|
227
227
|
*
|
|
228
228
|
* // Use search methods
|
|
229
|
-
* await propertiesSearch
|
|
229
|
+
* await propertiesSearch({
|
|
230
230
|
* body: { city: "Paris", country: "France" }
|
|
231
231
|
* });
|
|
232
232
|
*
|
|
233
|
-
* await smartFilterSearch
|
|
233
|
+
* await smartFilterSearch({
|
|
234
234
|
* query: "hotels near beach with pool"
|
|
235
235
|
* });
|
|
236
236
|
*
|
|
237
|
-
* await boundsSearch
|
|
237
|
+
* await boundsSearch();
|
|
238
238
|
* ```
|
|
239
239
|
*/
|
|
240
240
|
declare function useMapFirst(options: BaseMapFirstOptions): {
|
|
@@ -243,54 +243,48 @@ declare function useMapFirst(options: BaseMapFirstOptions): {
|
|
|
243
243
|
setPrimaryType: (type: PropertyType) => void;
|
|
244
244
|
setSelectedMarker: (id: number | null) => void;
|
|
245
245
|
setUseApi: (useApi: boolean, autoLoad?: boolean) => void;
|
|
246
|
-
propertiesSearch: {
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
properties: Property[];
|
|
289
|
-
isComplete: boolean | undefined;
|
|
290
|
-
pollingLink: string | undefined;
|
|
291
|
-
durationSeconds: number;
|
|
292
|
-
} | null>;
|
|
293
|
-
};
|
|
246
|
+
propertiesSearch: (options: {
|
|
247
|
+
body: InitialRequestBody;
|
|
248
|
+
beforeApplyProperties?: (data: any) => {
|
|
249
|
+
price?: any;
|
|
250
|
+
limit?: number;
|
|
251
|
+
};
|
|
252
|
+
smartFiltersClearable?: boolean;
|
|
253
|
+
onError?: (error: unknown) => void;
|
|
254
|
+
}) => Promise<{
|
|
255
|
+
location_id?: number;
|
|
256
|
+
filters: _mapfirst_ai_core.FilterSchema;
|
|
257
|
+
properties: Property[];
|
|
258
|
+
isComplete: boolean | undefined;
|
|
259
|
+
pollingLink: string | undefined;
|
|
260
|
+
durationSeconds: number;
|
|
261
|
+
} | null>;
|
|
262
|
+
smartFilterSearch: (options: {
|
|
263
|
+
query?: string;
|
|
264
|
+
filters?: SmartFilter[];
|
|
265
|
+
onProcessFilters?: (filters: any, location_id?: number) => {
|
|
266
|
+
smartFilters?: SmartFilter[];
|
|
267
|
+
price?: any;
|
|
268
|
+
limit?: number;
|
|
269
|
+
language?: string;
|
|
270
|
+
};
|
|
271
|
+
onError?: (error: unknown) => void;
|
|
272
|
+
}) => Promise<{
|
|
273
|
+
location_id?: number;
|
|
274
|
+
filters: _mapfirst_ai_core.FilterSchema;
|
|
275
|
+
properties: Property[];
|
|
276
|
+
isComplete: boolean | undefined;
|
|
277
|
+
pollingLink: string | undefined;
|
|
278
|
+
durationSeconds: number;
|
|
279
|
+
} | null>;
|
|
280
|
+
boundsSearch: () => Promise<{
|
|
281
|
+
location_id?: number;
|
|
282
|
+
filters: _mapfirst_ai_core.FilterSchema;
|
|
283
|
+
properties: Property[];
|
|
284
|
+
isComplete: boolean | undefined;
|
|
285
|
+
pollingLink: string | undefined;
|
|
286
|
+
durationSeconds: number;
|
|
287
|
+
} | null>;
|
|
294
288
|
attachMapLibre: (map: any, maplibregl: MapLibreNamespace, options?: {
|
|
295
289
|
onMarkerClick?: (marker: Property) => void;
|
|
296
290
|
}) => void;
|
package/dist/index.js
CHANGED
|
@@ -1488,39 +1488,30 @@ function useMapFirst(options) {
|
|
|
1488
1488
|
},
|
|
1489
1489
|
[]
|
|
1490
1490
|
);
|
|
1491
|
-
const propertiesSearch = import_react9.default.
|
|
1492
|
-
() =>
|
|
1493
|
-
|
|
1494
|
-
|
|
1495
|
-
throw new Error("MapFirst instance not available");
|
|
1496
|
-
}
|
|
1497
|
-
return await instanceRef.current.runPropertiesSearch(options2);
|
|
1498
|
-
}
|
|
1499
|
-
}),
|
|
1500
|
-
[]
|
|
1501
|
-
);
|
|
1502
|
-
const smartFilterSearch = import_react9.default.useMemo(
|
|
1503
|
-
() => ({
|
|
1504
|
-
search: async (options2) => {
|
|
1505
|
-
if (!instanceRef.current) {
|
|
1506
|
-
throw new Error("MapFirst instance not available");
|
|
1507
|
-
}
|
|
1508
|
-
return await instanceRef.current.runSmartFilterSearch(options2);
|
|
1491
|
+
const propertiesSearch = import_react9.default.useCallback(
|
|
1492
|
+
async (options2) => {
|
|
1493
|
+
if (!instanceRef.current) {
|
|
1494
|
+
throw new Error("MapFirst instance not available");
|
|
1509
1495
|
}
|
|
1510
|
-
|
|
1496
|
+
return await instanceRef.current.runPropertiesSearch(options2);
|
|
1497
|
+
},
|
|
1511
1498
|
[]
|
|
1512
1499
|
);
|
|
1513
|
-
const
|
|
1514
|
-
() =>
|
|
1515
|
-
|
|
1516
|
-
|
|
1517
|
-
return null;
|
|
1518
|
-
}
|
|
1519
|
-
return await instanceRef.current.performBoundsSearch();
|
|
1500
|
+
const smartFilterSearch = import_react9.default.useCallback(
|
|
1501
|
+
async (options2) => {
|
|
1502
|
+
if (!instanceRef.current) {
|
|
1503
|
+
throw new Error("MapFirst instance not available");
|
|
1520
1504
|
}
|
|
1521
|
-
|
|
1505
|
+
return await instanceRef.current.runSmartFilterSearch(options2);
|
|
1506
|
+
},
|
|
1522
1507
|
[]
|
|
1523
1508
|
);
|
|
1509
|
+
const boundsSearch = import_react9.default.useCallback(async () => {
|
|
1510
|
+
if (!instanceRef.current) {
|
|
1511
|
+
return null;
|
|
1512
|
+
}
|
|
1513
|
+
return await instanceRef.current.performBoundsSearch();
|
|
1514
|
+
}, []);
|
|
1524
1515
|
const mapLibreAttachedRef = import_react9.default.useRef(false);
|
|
1525
1516
|
const attachMapLibre = import_react9.default.useCallback(
|
|
1526
1517
|
(map, maplibregl, options2) => {
|
package/dist/index.mjs
CHANGED
|
@@ -1448,39 +1448,30 @@ function useMapFirst(options) {
|
|
|
1448
1448
|
},
|
|
1449
1449
|
[]
|
|
1450
1450
|
);
|
|
1451
|
-
const propertiesSearch = React6.
|
|
1452
|
-
() =>
|
|
1453
|
-
|
|
1454
|
-
|
|
1455
|
-
throw new Error("MapFirst instance not available");
|
|
1456
|
-
}
|
|
1457
|
-
return await instanceRef.current.runPropertiesSearch(options2);
|
|
1458
|
-
}
|
|
1459
|
-
}),
|
|
1460
|
-
[]
|
|
1461
|
-
);
|
|
1462
|
-
const smartFilterSearch = React6.useMemo(
|
|
1463
|
-
() => ({
|
|
1464
|
-
search: async (options2) => {
|
|
1465
|
-
if (!instanceRef.current) {
|
|
1466
|
-
throw new Error("MapFirst instance not available");
|
|
1467
|
-
}
|
|
1468
|
-
return await instanceRef.current.runSmartFilterSearch(options2);
|
|
1451
|
+
const propertiesSearch = React6.useCallback(
|
|
1452
|
+
async (options2) => {
|
|
1453
|
+
if (!instanceRef.current) {
|
|
1454
|
+
throw new Error("MapFirst instance not available");
|
|
1469
1455
|
}
|
|
1470
|
-
|
|
1456
|
+
return await instanceRef.current.runPropertiesSearch(options2);
|
|
1457
|
+
},
|
|
1471
1458
|
[]
|
|
1472
1459
|
);
|
|
1473
|
-
const
|
|
1474
|
-
() =>
|
|
1475
|
-
|
|
1476
|
-
|
|
1477
|
-
return null;
|
|
1478
|
-
}
|
|
1479
|
-
return await instanceRef.current.performBoundsSearch();
|
|
1460
|
+
const smartFilterSearch = React6.useCallback(
|
|
1461
|
+
async (options2) => {
|
|
1462
|
+
if (!instanceRef.current) {
|
|
1463
|
+
throw new Error("MapFirst instance not available");
|
|
1480
1464
|
}
|
|
1481
|
-
|
|
1465
|
+
return await instanceRef.current.runSmartFilterSearch(options2);
|
|
1466
|
+
},
|
|
1482
1467
|
[]
|
|
1483
1468
|
);
|
|
1469
|
+
const boundsSearch = React6.useCallback(async () => {
|
|
1470
|
+
if (!instanceRef.current) {
|
|
1471
|
+
return null;
|
|
1472
|
+
}
|
|
1473
|
+
return await instanceRef.current.performBoundsSearch();
|
|
1474
|
+
}, []);
|
|
1484
1475
|
const mapLibreAttachedRef = React6.useRef(false);
|
|
1485
1476
|
const attachMapLibre = React6.useCallback(
|
|
1486
1477
|
(map, maplibregl, options2) => {
|