venue-js 1.4.0-next.14 → 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.d.mts CHANGED
@@ -1,6 +1,6 @@
1
1
  export { QueryObserver } from '@tanstack/query-core';
2
2
  import { VenueDataClient } from './data/index.mjs';
3
- export { ALL_FEATURE_TYPES, AmenityFeature, AmenityFeaturePopulated, AmenityGeometry, AmenityProperties, AnchorFeature, AnchorFeaturePopulated, AnchorGeometry, AnchorProperties, DEFAULT_BASE_URL, DetailFeature, DetailGeometry, DetailProperties, ElementFeature, ElementGeometry, ElementProperties, EventFeature, EventGeometry, EventProperties, FeaturePopulatedResponseMap, FeatureQueryOptions, FeatureResponseMap, FeatureType, FilterParams, FindParams, FixtureFeature, FixtureFeaturePopulated, FixtureGeometry, FixtureProperties, GEOJSON_FEATURE_TYPES, IMDF_FEATURE_TYPES, Id, ImdfFeature, InternalFilterByType, InternalFindById, KioskFeature, KioskFeaturePopulated, KioskGeometry, KioskProperties, LabelFeature, LabelGeometry, LabelProperties, LevelFeature, LevelFeaturePopulated, LevelGeometry, LevelProperties, Media, MediaFile, Model3d, Model3dFeature, Model3dGeometry, Model3dPopulated, Model3dProperties, NONIMDF_FEATURE_TYPES, OccupantFeature, OccupantFeaturePopulated, OccupantGeometry, OccupantHelpers, OccupantProperties, OpeningFeature, OpeningFeaturePopulated, OpeningGeometry, OpeningProperties, Page, PolygonalFeature, PopulatableFeatureType, PopulatedParams, PrivilegeFeature, PrivilegeGeometry, PrivilegeProperties, PromotionFeature, PromotionProperties, RelationshipFeature, RelationshipGeometry, RelationshipProperties, SearchClient, SectionFeature, SectionFeaturePopulated, SectionGeometry, SectionProperties, SingleGeometry, SponsoredContentFeature, SponsoredContentLegacyType, SponsoredContentPlacementType, SponsoredContentStrapiV4ApiResponse, TaxonomyFeature, TaxonomyFeaturePopulated, TaxonomyGeometry, TaxonomyProperties, UnitFeature, UnitFeaturePopulated, UnitGeometry, UnitProperties, VenueClientOptions, VenueFeature, VenueFeaturePopulated, VenueGeometry, VenueProperties, defaultFeatureQueryOptionsMap, fetchDeliveryApi, fetchPreviewApi, getDataClient, getSearchClient, isValidCoordinate, isValidLineString, isValidLineStringCoordinates, isValidMultiPolygon, isValidMultiPolygonCoordinates, isValidPoint, isValidPolygon, isValidPolygonCoordinates, matchFilter, matchFilters, safeFetchFeature } from './data/index.mjs';
3
+ export { ALL_FEATURE_TYPES, AmenityFeature, AmenityFeaturePopulated, AmenityGeometry, AmenityProperties, AnchorFeature, AnchorFeaturePopulated, AnchorGeometry, AnchorProperties, AnyRelationshipFeature, BaseRelationshipProperties, DEFAULT_BASE_URL, DetailFeature, DetailGeometry, DetailProperties, ElementFeature, ElementGeometry, ElementProperties, ElevatorRelationshipFeature, ElevatorRelationshipFeaturePopulated, ElevatorRelationshipProperties, EscalatorRelationshipFeature, EscalatorRelationshipFeaturePopulated, EscalatorRelationshipProperties, EventFeature, EventGeometry, EventProperties, FeaturePopulatedResponseMap, FeatureQueryOptions, FeatureResponseMap, FeatureType, FilterParams, FindParams, FixtureFeature, FixtureFeaturePopulated, FixtureGeometry, FixtureProperties, GEOJSON_FEATURE_TYPES, IMDF_FEATURE_TYPES, Id, ImdfFeature, InternalFilterByType, InternalFindById, KioskFeature, KioskFeaturePopulated, KioskGeometry, KioskProperties, LabelFeature, LabelGeometry, LabelProperties, LevelFeature, LevelFeaturePopulated, LevelGeometry, LevelProperties, Media, MediaFile, Model3d, Model3dFeature, Model3dGeometry, Model3dPopulated, Model3dProperties, NONIMDF_FEATURE_TYPES, OccupantFeature, OccupantFeaturePopulated, OccupantGeometry, OccupantHelpers, OccupantProperties, OpeningFeature, OpeningFeaturePopulated, OpeningGeometry, OpeningProperties, Page, PolygonalFeature, PopulatableFeatureType, PopulatedParams, PrivilegeFeature, PrivilegeGeometry, PrivilegeProperties, PromotionFeature, PromotionProperties, RampRelationshipFeature, RampRelationshipFeaturePopulated, RampRelationshipProperties, RelationshipCategories, RelationshipDirectionTypes, RelationshipFeature, RelationshipFeaturePopulated, RelationshipGeometry, SearchClient, SectionFeature, SectionFeaturePopulated, SectionGeometry, SectionProperties, SingleGeometry, SponsoredContentFeature, SponsoredContentLegacyType, SponsoredContentPlacementType, SponsoredContentStrapiV4ApiResponse, StairRelationshipFeaturePopulated, StairsRelationshipFeature, StairsRelationshipProperties, TaxonomyFeature, TaxonomyFeaturePopulated, TaxonomyGeometry, TaxonomyProperties, TransalatableString, TraversalRelationshipFeature, TraversalRelationshipFeaturePopulated, TraversalRelationshipProperties, UnitFeature, UnitFeaturePopulated, UnitGeometry, UnitProperties, VenueClientOptions, VenueFeature, VenueFeaturePopulated, VenueGeometry, VenueProperties, defaultFeatureQueryOptionsMap, fetchDeliveryApi, fetchPreviewApi, getDataClient, getSearchClient, isValidCoordinate, isValidLineString, isValidLineStringCoordinates, isValidMultiPolygon, isValidMultiPolygonCoordinates, isValidPoint, isValidPolygon, isValidPolygonCoordinates, matchFilter, matchFilters, safeFetchFeature } from './data/index.mjs';
4
4
  import * as maptalks_dist_core_Class from 'maptalks/dist/core/Class';
5
5
  import * as maptalks$1 from 'maptalks-gl';
6
6
  import { Map, Coordinate as Coordinate$1 } from 'maptalks-gl';
package/dist/index.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  export { QueryObserver } from '@tanstack/query-core';
2
2
  import { VenueDataClient } from './data/index.js';
3
- export { ALL_FEATURE_TYPES, AmenityFeature, AmenityFeaturePopulated, AmenityGeometry, AmenityProperties, AnchorFeature, AnchorFeaturePopulated, AnchorGeometry, AnchorProperties, DEFAULT_BASE_URL, DetailFeature, DetailGeometry, DetailProperties, ElementFeature, ElementGeometry, ElementProperties, EventFeature, EventGeometry, EventProperties, FeaturePopulatedResponseMap, FeatureQueryOptions, FeatureResponseMap, FeatureType, FilterParams, FindParams, FixtureFeature, FixtureFeaturePopulated, FixtureGeometry, FixtureProperties, GEOJSON_FEATURE_TYPES, IMDF_FEATURE_TYPES, Id, ImdfFeature, InternalFilterByType, InternalFindById, KioskFeature, KioskFeaturePopulated, KioskGeometry, KioskProperties, LabelFeature, LabelGeometry, LabelProperties, LevelFeature, LevelFeaturePopulated, LevelGeometry, LevelProperties, Media, MediaFile, Model3d, Model3dFeature, Model3dGeometry, Model3dPopulated, Model3dProperties, NONIMDF_FEATURE_TYPES, OccupantFeature, OccupantFeaturePopulated, OccupantGeometry, OccupantHelpers, OccupantProperties, OpeningFeature, OpeningFeaturePopulated, OpeningGeometry, OpeningProperties, Page, PolygonalFeature, PopulatableFeatureType, PopulatedParams, PrivilegeFeature, PrivilegeGeometry, PrivilegeProperties, PromotionFeature, PromotionProperties, RelationshipFeature, RelationshipGeometry, RelationshipProperties, SearchClient, SectionFeature, SectionFeaturePopulated, SectionGeometry, SectionProperties, SingleGeometry, SponsoredContentFeature, SponsoredContentLegacyType, SponsoredContentPlacementType, SponsoredContentStrapiV4ApiResponse, TaxonomyFeature, TaxonomyFeaturePopulated, TaxonomyGeometry, TaxonomyProperties, UnitFeature, UnitFeaturePopulated, UnitGeometry, UnitProperties, VenueClientOptions, VenueFeature, VenueFeaturePopulated, VenueGeometry, VenueProperties, defaultFeatureQueryOptionsMap, fetchDeliveryApi, fetchPreviewApi, getDataClient, getSearchClient, isValidCoordinate, isValidLineString, isValidLineStringCoordinates, isValidMultiPolygon, isValidMultiPolygonCoordinates, isValidPoint, isValidPolygon, isValidPolygonCoordinates, matchFilter, matchFilters, safeFetchFeature } from './data/index.js';
3
+ export { ALL_FEATURE_TYPES, AmenityFeature, AmenityFeaturePopulated, AmenityGeometry, AmenityProperties, AnchorFeature, AnchorFeaturePopulated, AnchorGeometry, AnchorProperties, AnyRelationshipFeature, BaseRelationshipProperties, DEFAULT_BASE_URL, DetailFeature, DetailGeometry, DetailProperties, ElementFeature, ElementGeometry, ElementProperties, ElevatorRelationshipFeature, ElevatorRelationshipFeaturePopulated, ElevatorRelationshipProperties, EscalatorRelationshipFeature, EscalatorRelationshipFeaturePopulated, EscalatorRelationshipProperties, EventFeature, EventGeometry, EventProperties, FeaturePopulatedResponseMap, FeatureQueryOptions, FeatureResponseMap, FeatureType, FilterParams, FindParams, FixtureFeature, FixtureFeaturePopulated, FixtureGeometry, FixtureProperties, GEOJSON_FEATURE_TYPES, IMDF_FEATURE_TYPES, Id, ImdfFeature, InternalFilterByType, InternalFindById, KioskFeature, KioskFeaturePopulated, KioskGeometry, KioskProperties, LabelFeature, LabelGeometry, LabelProperties, LevelFeature, LevelFeaturePopulated, LevelGeometry, LevelProperties, Media, MediaFile, Model3d, Model3dFeature, Model3dGeometry, Model3dPopulated, Model3dProperties, NONIMDF_FEATURE_TYPES, OccupantFeature, OccupantFeaturePopulated, OccupantGeometry, OccupantHelpers, OccupantProperties, OpeningFeature, OpeningFeaturePopulated, OpeningGeometry, OpeningProperties, Page, PolygonalFeature, PopulatableFeatureType, PopulatedParams, PrivilegeFeature, PrivilegeGeometry, PrivilegeProperties, PromotionFeature, PromotionProperties, RampRelationshipFeature, RampRelationshipFeaturePopulated, RampRelationshipProperties, RelationshipCategories, RelationshipDirectionTypes, RelationshipFeature, RelationshipFeaturePopulated, RelationshipGeometry, SearchClient, SectionFeature, SectionFeaturePopulated, SectionGeometry, SectionProperties, SingleGeometry, SponsoredContentFeature, SponsoredContentLegacyType, SponsoredContentPlacementType, SponsoredContentStrapiV4ApiResponse, StairRelationshipFeaturePopulated, StairsRelationshipFeature, StairsRelationshipProperties, TaxonomyFeature, TaxonomyFeaturePopulated, TaxonomyGeometry, TaxonomyProperties, TransalatableString, TraversalRelationshipFeature, TraversalRelationshipFeaturePopulated, TraversalRelationshipProperties, UnitFeature, UnitFeaturePopulated, UnitGeometry, UnitProperties, VenueClientOptions, VenueFeature, VenueFeaturePopulated, VenueGeometry, VenueProperties, defaultFeatureQueryOptionsMap, fetchDeliveryApi, fetchPreviewApi, getDataClient, getSearchClient, isValidCoordinate, isValidLineString, isValidLineStringCoordinates, isValidMultiPolygon, isValidMultiPolygonCoordinates, isValidPoint, isValidPolygon, isValidPolygonCoordinates, matchFilter, matchFilters, safeFetchFeature } from './data/index.js';
4
4
  import * as maptalks_dist_core_Class from 'maptalks/dist/core/Class';
5
5
  import * as maptalks$1 from 'maptalks-gl';
6
6
  import { Map, Coordinate as Coordinate$1 } from 'maptalks-gl';
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,