venue-js 1.4.0-next.10 → 1.4.0-next.12
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 +15 -5
- package/dist/index.d.ts +15 -5
- package/dist/index.js +174 -175
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +16 -18
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -291,7 +291,7 @@ __export(occupant_helper_exports, {
|
|
|
291
291
|
getOccupantMainLocation: () => getOccupantMainLocation,
|
|
292
292
|
getOccupantMarkerLocations: () => getOccupantMarkerLocations
|
|
293
293
|
});
|
|
294
|
-
import { compact } from "lodash
|
|
294
|
+
import { compact } from "lodash";
|
|
295
295
|
var getOccupantMainLocation = (occupant) => {
|
|
296
296
|
return occupant.properties.kiosk || occupant.properties.unit;
|
|
297
297
|
};
|
|
@@ -322,7 +322,7 @@ import {
|
|
|
322
322
|
} from "@tanstack/query-core";
|
|
323
323
|
|
|
324
324
|
// src/data/populator/index.ts
|
|
325
|
-
import { compact as compact2 } from "lodash
|
|
325
|
+
import { compact as compact2 } from "lodash";
|
|
326
326
|
import { booleanWithin } from "@turf/boolean-within";
|
|
327
327
|
var createPopulator = ({
|
|
328
328
|
internalFindById,
|
|
@@ -1917,11 +1917,18 @@ var sanitizeInput = (str) => str.replace(/[\u200E\u200F\u202A-\u202E\u2066-\u206
|
|
|
1917
1917
|
|
|
1918
1918
|
// src/data/search/getSearchClient.ts
|
|
1919
1919
|
var getSearchClient = ({ occupants, amenities }) => {
|
|
1920
|
-
const fuseAmenities = new Fuse(amenities, {
|
|
1920
|
+
const fuseAmenities = new Fuse(amenities, {
|
|
1921
|
+
threshold: 0.2,
|
|
1922
|
+
keys: [
|
|
1923
|
+
{ name: "properties.name", "weight": 1, getFn: (obj) => Object.values(obj.properties.name) },
|
|
1924
|
+
{ name: "properties.category", "weight": 1 }
|
|
1925
|
+
]
|
|
1926
|
+
});
|
|
1921
1927
|
const fuseOccupants = new Fuse(occupants, {
|
|
1922
|
-
threshold: 0.
|
|
1928
|
+
threshold: 0.25,
|
|
1923
1929
|
// 0.2 is too strict (can't find Mo-Mo Paradise with "momo" search string)
|
|
1924
1930
|
includeScore: true,
|
|
1931
|
+
shouldSort: true,
|
|
1925
1932
|
keys: [
|
|
1926
1933
|
{ name: "properties.name", "weight": 4, getFn: (obj) => Object.values(obj.properties.name) },
|
|
1927
1934
|
{ name: "properties.category", "weight": 0.25 },
|
|
@@ -1930,27 +1937,17 @@ var getSearchClient = ({ occupants, amenities }) => {
|
|
|
1930
1937
|
"weight": 0.25,
|
|
1931
1938
|
getFn: (occ) => occ.properties.local_categories.map((cat3) => Object.values(cat3.properties.name)).flat()
|
|
1932
1939
|
},
|
|
1933
|
-
{ name: "properties.keywords", "weight": 0.
|
|
1940
|
+
{ name: "properties.keywords", "weight": 0.5 },
|
|
1934
1941
|
{ name: "properties.description", "weight": 0.25, getFn: (occ) => Object.values(occ.properties.description || {}) },
|
|
1935
1942
|
{ name: "properties.unit.properties.name", "weight": 0.25, getFn: (obj) => Object.values(obj.properties.unit?.properties.name || {}) },
|
|
1936
1943
|
{ name: "properties.kiosk.properties.name", "weight": 0.25, getFn: (obj) => Object.values(obj.properties.kiosk?.properties.name || {}) }
|
|
1937
1944
|
]
|
|
1938
1945
|
});
|
|
1939
|
-
const fuseFuzzyAmenities = new Fuse(amenities, {
|
|
1940
|
-
threshold: 0.2,
|
|
1941
|
-
keys: [
|
|
1942
|
-
{ name: "properties.category", weight: 4 }
|
|
1943
|
-
]
|
|
1944
|
-
});
|
|
1945
1946
|
const search2 = (value) => {
|
|
1946
1947
|
const sanitizedValue = sanitizeInput(value);
|
|
1947
1948
|
const matchedAmenities = fuseAmenities.search(sanitizedValue);
|
|
1948
|
-
if (matchedAmenities.length > 0) return matchedAmenities;
|
|
1949
1949
|
const matchedOccupants = fuseOccupants.search(sanitizedValue);
|
|
1950
|
-
|
|
1951
|
-
const matchedFuzzyAmenities = fuseFuzzyAmenities.search(sanitizedValue);
|
|
1952
|
-
if (matchedFuzzyAmenities.length > 0) return matchedFuzzyAmenities;
|
|
1953
|
-
return [];
|
|
1950
|
+
return [...matchedAmenities, ...matchedOccupants];
|
|
1954
1951
|
};
|
|
1955
1952
|
return {
|
|
1956
1953
|
search: search2
|
|
@@ -4077,7 +4074,7 @@ var CameraManager = class {
|
|
|
4077
4074
|
};
|
|
4078
4075
|
|
|
4079
4076
|
// src/IndoorMap/renderer/RendererManager.ts
|
|
4080
|
-
import { min, compact as compact3, isFunction } from "lodash
|
|
4077
|
+
import { min, compact as compact3, isFunction } from "lodash";
|
|
4081
4078
|
import { center as turfCenter2 } from "@turf/center";
|
|
4082
4079
|
import * as THREE4 from "three";
|
|
4083
4080
|
|
|
@@ -4102,7 +4099,7 @@ import {
|
|
|
4102
4099
|
PlaneGeometry
|
|
4103
4100
|
} from "three";
|
|
4104
4101
|
import { largestRect } from "d3plus-shape";
|
|
4105
|
-
import { max, merge, isNumber as isNumber3, isArray as isArray2, range } from "lodash
|
|
4102
|
+
import { max, merge, isNumber as isNumber3, isArray as isArray2, range } from "lodash";
|
|
4106
4103
|
var OPTIONS3 = {
|
|
4107
4104
|
// Allowing click through and prevent interaction
|
|
4108
4105
|
interactive: false,
|
|
@@ -6844,6 +6841,7 @@ export {
|
|
|
6844
6841
|
getRelatedLocationsByAmenity,
|
|
6845
6842
|
getRelatedLocationsByFeature,
|
|
6846
6843
|
getRelatedLocationsByOccupant,
|
|
6844
|
+
getSearchClient,
|
|
6847
6845
|
getSuitablyValueBetweenBearings,
|
|
6848
6846
|
isClickableFeature,
|
|
6849
6847
|
isValidCoordinate,
|