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.js CHANGED
@@ -378,7 +378,11 @@ __export(occupant_helper_exports, {
378
378
  getOccupantMainLocation: () => getOccupantMainLocation,
379
379
  getOccupantMarkerLocations: () => getOccupantMarkerLocations
380
380
  });
381
- var import_lodash = require("lodash");
381
+
382
+ // src/data/utils/lodash/compact.ts
383
+ var compact = (arr) => arr.filter((item) => Boolean(item));
384
+
385
+ // src/data/utils/occupant-helper.ts
382
386
  var getOccupantMainLocation = (occupant) => {
383
387
  return occupant.properties.kiosk || occupant.properties.unit;
384
388
  };
@@ -387,7 +391,7 @@ var getOccupantCorrelatedLocations = (occupant) => {
387
391
  ...occupant.properties.units,
388
392
  ...occupant.properties.kiosks
389
393
  ];
390
- return (0, import_lodash.compact)(allCorrelatedLocations);
394
+ return compact(allCorrelatedLocations);
391
395
  };
392
396
  var getOccupantMarkerLocations = (occupant, options) => {
393
397
  const placementType = options?.type ? options.type : occupant.properties.show_name_on_all_units ? "ALL_LOCATIONS" : "ONCE_PER_LEVEL";
@@ -395,18 +399,17 @@ var getOccupantMarkerLocations = (occupant, options) => {
395
399
  const mainLocationLevel = mainLocation?.properties?.level_id;
396
400
  const allCorrelatedLocations = getOccupantCorrelatedLocations(occupant);
397
401
  if (placementType === "ALL_LOCATIONS") {
398
- return (0, import_lodash.compact)([mainLocation, ...allCorrelatedLocations]);
402
+ return compact([mainLocation, ...allCorrelatedLocations]);
399
403
  }
400
404
  const otherLevelLocations = allCorrelatedLocations.filter((f) => f.properties.level_id !== mainLocationLevel);
401
405
  const onePerLevelLocations = [...new Map(otherLevelLocations.map((loc) => [loc.properties.level_id, loc])).values()];
402
- return (0, import_lodash.compact)([mainLocation, ...onePerLevelLocations]);
406
+ return compact([mainLocation, ...onePerLevelLocations]);
403
407
  };
404
408
 
405
409
  // src/data/getDataClient.ts
406
410
  var import_query_core = require("@tanstack/query-core");
407
411
 
408
412
  // src/data/populator/index.ts
409
- var import_lodash2 = require("lodash");
410
413
  var import_boolean_within = require("@turf/boolean-within");
411
414
  var createPopulator = ({
412
415
  internalFindById,
@@ -564,7 +567,7 @@ var createPopulator = ({
564
567
  ...occupant.properties,
565
568
  anchor: anchor ? await populateAnchor(anchor) : null,
566
569
  local_categories: await Promise.all(
567
- (0, import_lodash2.compact)(localCategories).map(populateTaxonomy)
570
+ compact(localCategories).map(populateTaxonomy)
568
571
  ),
569
572
  venue,
570
573
  promotions,
@@ -2004,7 +2007,7 @@ var getSearchClient = ({ occupants, amenities }) => {
2004
2007
  const fuseAmenities = new Fuse(amenities, {
2005
2008
  threshold: 0.2,
2006
2009
  keys: [
2007
- { name: "properties.name", "weight": 1, getFn: (obj) => Object.values(obj.properties.name) },
2010
+ { name: "properties.name", "weight": 1, getFn: (obj) => Object.values(obj.properties.name || {}) },
2008
2011
  { name: "properties.category", "weight": 1 }
2009
2012
  ]
2010
2013
  });
@@ -2014,17 +2017,13 @@ var getSearchClient = ({ occupants, amenities }) => {
2014
2017
  includeScore: true,
2015
2018
  shouldSort: true,
2016
2019
  keys: [
2017
- { name: "properties.name", "weight": 4, getFn: (obj) => Object.values(obj.properties.name) },
2018
- { name: "properties.category", "weight": 0.25 },
2019
- {
2020
- name: "properties.local_categories",
2021
- "weight": 0.25,
2022
- getFn: (occ) => occ.properties.local_categories.map((cat3) => Object.values(cat3.properties.name)).flat()
2023
- },
2020
+ { name: "properties.name", "weight": 4, getFn: (obj) => Object.values(obj.properties.name || {}) },
2024
2021
  { name: "properties.keywords", "weight": 0.5 },
2022
+ { name: "properties.category", "weight": 0.25 },
2023
+ { name: "properties.local_category_names", "weight": 0.25 },
2025
2024
  { name: "properties.description", "weight": 0.25, getFn: (occ) => Object.values(occ.properties.description || {}) },
2026
- { name: "properties.unit.properties.name", "weight": 0.25, getFn: (obj) => Object.values(obj.properties.unit?.properties.name || {}) },
2027
- { name: "properties.kiosk.properties.name", "weight": 0.25, getFn: (obj) => Object.values(obj.properties.kiosk?.properties.name || {}) }
2025
+ { name: "properties.unit_name", "weight": 0.25 },
2026
+ { name: "properties.kiosk_name", "weight": 0.25 }
2028
2027
  ]
2029
2028
  });
2030
2029
  const search2 = (value) => {
@@ -2155,7 +2154,7 @@ var getDataClient = (options) => {
2155
2154
  const searchFn = async (txt) => {
2156
2155
  if (!searchClient) {
2157
2156
  const [occupants, amenities] = await Promise.all([
2158
- filterByType("occupant", { populate: true }),
2157
+ filterByType("occupant"),
2159
2158
  filterByType("amenity")
2160
2159
  ]);
2161
2160
  const haystack = { occupants, amenities };