venue-js 1.4.0-next.13 → 1.4.0-next.15

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.mjs CHANGED
@@ -291,7 +291,11 @@ __export(occupant_helper_exports, {
291
291
  getOccupantMainLocation: () => getOccupantMainLocation,
292
292
  getOccupantMarkerLocations: () => getOccupantMarkerLocations
293
293
  });
294
- import { compact } from "lodash";
294
+
295
+ // src/data/utils/lodash/compact.ts
296
+ var compact = (arr) => arr.filter((item) => Boolean(item));
297
+
298
+ // src/data/utils/occupant-helper.ts
295
299
  var getOccupantMainLocation = (occupant) => {
296
300
  return occupant.properties.kiosk || occupant.properties.unit;
297
301
  };
@@ -322,7 +326,6 @@ import {
322
326
  } from "@tanstack/query-core";
323
327
 
324
328
  // src/data/populator/index.ts
325
- import { compact as compact2 } from "lodash";
326
329
  import { booleanWithin } from "@turf/boolean-within";
327
330
  var createPopulator = ({
328
331
  internalFindById,
@@ -480,7 +483,7 @@ var createPopulator = ({
480
483
  ...occupant.properties,
481
484
  anchor: anchor ? await populateAnchor(anchor) : null,
482
485
  local_categories: await Promise.all(
483
- compact2(localCategories).map(populateTaxonomy)
486
+ compact(localCategories).map(populateTaxonomy)
484
487
  ),
485
488
  venue,
486
489
  promotions,
@@ -1920,7 +1923,7 @@ var getSearchClient = ({ occupants, amenities }) => {
1920
1923
  const fuseAmenities = new Fuse(amenities, {
1921
1924
  threshold: 0.2,
1922
1925
  keys: [
1923
- { name: "properties.name", "weight": 1, getFn: (obj) => Object.values(obj.properties.name) },
1926
+ { name: "properties.name", "weight": 1, getFn: (obj) => Object.values(obj.properties.name || {}) },
1924
1927
  { name: "properties.category", "weight": 1 }
1925
1928
  ]
1926
1929
  });
@@ -1930,17 +1933,13 @@ var getSearchClient = ({ occupants, amenities }) => {
1930
1933
  includeScore: true,
1931
1934
  shouldSort: true,
1932
1935
  keys: [
1933
- { name: "properties.name", "weight": 4, getFn: (obj) => Object.values(obj.properties.name) },
1934
- { name: "properties.category", "weight": 0.25 },
1935
- {
1936
- name: "properties.local_categories",
1937
- "weight": 0.25,
1938
- getFn: (occ) => occ.properties.local_categories.map((cat3) => Object.values(cat3.properties.name)).flat()
1939
- },
1936
+ { name: "properties.name", "weight": 4, getFn: (obj) => Object.values(obj.properties.name || {}) },
1940
1937
  { name: "properties.keywords", "weight": 0.5 },
1938
+ { name: "properties.category", "weight": 0.25 },
1939
+ { name: "properties.local_category_names", "weight": 0.25 },
1941
1940
  { name: "properties.description", "weight": 0.25, getFn: (occ) => Object.values(occ.properties.description || {}) },
1942
- { name: "properties.unit.properties.name", "weight": 0.25, getFn: (obj) => Object.values(obj.properties.unit?.properties.name || {}) },
1943
- { name: "properties.kiosk.properties.name", "weight": 0.25, getFn: (obj) => Object.values(obj.properties.kiosk?.properties.name || {}) }
1941
+ { name: "properties.unit_name", "weight": 0.25 },
1942
+ { name: "properties.kiosk_name", "weight": 0.25 }
1944
1943
  ]
1945
1944
  });
1946
1945
  const search2 = (value) => {
@@ -2071,7 +2070,7 @@ var getDataClient = (options) => {
2071
2070
  const searchFn = async (txt) => {
2072
2071
  if (!searchClient) {
2073
2072
  const [occupants, amenities] = await Promise.all([
2074
- filterByType("occupant", { populate: true }),
2073
+ filterByType("occupant"),
2075
2074
  filterByType("amenity")
2076
2075
  ]);
2077
2076
  const haystack = { occupants, amenities };
@@ -4074,7 +4073,7 @@ var CameraManager = class {
4074
4073
  };
4075
4074
 
4076
4075
  // src/IndoorMap/renderer/RendererManager.ts
4077
- import { min, compact as compact3, isFunction } from "lodash";
4076
+ import { min, compact as compact2, isFunction } from "lodash";
4078
4077
  import { center as turfCenter2 } from "@turf/center";
4079
4078
  import * as THREE4 from "three";
4080
4079
 
@@ -5867,7 +5866,7 @@ var RendererManager = class extends EventTarget {
5867
5866
  });
5868
5867
  units.filter((u4) => u4.properties.category === "room").forEach((unit) => {
5869
5868
  const openingRelationships = relationships.filter((r) => r.properties.origin?.id === unit.id || r.properties.destination?.id === unit.id);
5870
- const roomOpenings = compact3(openingRelationships.map((rel) => {
5869
+ const roomOpenings = compact2(openingRelationships.map((rel) => {
5871
5870
  const openingId = rel?.properties.intermediary[0].id;
5872
5871
  return openings.find((o) => o.id === openingId);
5873
5872
  }));