@mappedin/react-native-sdk 4.0.11 → 4.1.0-beta.1

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.
Files changed (3) hide show
  1. package/dist/index.d.ts +70 -29
  2. package/dist/index.js +196 -196
  3. package/package.json +2 -2
package/dist/index.d.ts CHANGED
@@ -120,7 +120,7 @@ declare module '@mappedin/react-native-sdk/wrappers/react-native-sdk/src/MiMapVi
120
120
  /**
121
121
  * @category Component
122
122
  */
123
- export const MiMapView: React.MemoExoticComponent<React.ForwardRefExoticComponent<Pick<TMiMapViewProps, "onFirstMapLoaded" | "onDataLoaded" | "venueData" | "options" | "style" | "onPolygonClicked" | "onBlueDotStateChanged" | "onBlueDotPositionUpdated" | "onNothingClicked" | "onMapChanged" | "onStateChanged" | "onVenueLoadError"> & React.RefAttributes<MapViewStore>>>;
123
+ export const MiMapView: React.MemoExoticComponent<React.ForwardRefExoticComponent<Pick<TMiMapViewProps, "options" | "style" | "onFirstMapLoaded" | "onDataLoaded" | "venueData" | "onPolygonClicked" | "onBlueDotStateChanged" | "onBlueDotPositionUpdated" | "onNothingClicked" | "onMapChanged" | "onStateChanged" | "onVenueLoadError"> & React.RefAttributes<MapViewStore>>>;
124
124
  }
125
125
 
126
126
  declare module '@mappedin/react-native-sdk/wrappers/react-native-sdk/src/MiMiniMap' {
@@ -943,6 +943,13 @@ declare module '@mappedin/react-native-sdk/core/packages/renderer/MapView.types'
943
943
  * The rank of the object used when comparing colliders to determine which should be shown.
944
944
  */
945
945
  collisionRank?: COLLISION_RANKING_TIERS;
946
+ /**
947
+ * By default, we don't hide tooltips when they collide. This is
948
+ * so that for floor switching tooltips we don't lose where the elevator is
949
+ * This option will override that behavior
950
+ * @default true
951
+ */
952
+ alwaysVisible?: boolean;
946
953
  };
947
954
  export type TCreateTextTooltipOptions = TCreateTooltipCommonOptions & {
948
955
  /**
@@ -2098,7 +2105,7 @@ declare module '@mappedin/react-native-sdk/wrappers/common/controller' {
2098
2105
  msgID?: string | undefined;
2099
2106
  data: {
2100
2107
  polygonId: string;
2101
- options: (import("../react-native-sdk/src").TFloatingLabelPolygonOptions | import("../react-native-sdk/src").TFlatLabelPolygonOptions) & {
2108
+ options: (import("../react-native-sdk/src").TFlatLabelPolygonOptions | import("../react-native-sdk/src").TFloatingLabelPolygonOptions) & {
2102
2109
  legacyLabels?: boolean | undefined;
2103
2110
  };
2104
2111
  };
@@ -3814,7 +3821,7 @@ declare module '@mappedin/react-native-sdk/core/packages/renderer/internal/Mappe
3814
3821
  get strategies(): TColliderStrategy[];
3815
3822
  getCachedSymbol(orientation: any, textAlign: any, xCoordinate: any): any;
3816
3823
  colliderDidMount(): void;
3817
- colliderDidUpdatePosition(x: any, y: any): void;
3824
+ colliderDidUpdatePosition(pos: any): void;
3818
3825
  setPriority(priority: any): void;
3819
3826
  colliderDidUpdateVisiblity(): void;
3820
3827
  colliderDidGoOutsideGrid(): void;
@@ -4036,6 +4043,7 @@ declare module '@mappedin/react-native-sdk/core/packages/renderer/internal/Mappe
4036
4043
  selector?: string;
4037
4044
  map: string;
4038
4045
  padding?: number;
4046
+ alwaysVisible?: boolean;
4039
4047
  collisionRank?: COLLISION_RANKING_TIERS;
4040
4048
  defaultAnchorType?: string;
4041
4049
  enabledAnchorTypes?: {
@@ -4057,6 +4065,7 @@ declare module '@mappedin/react-native-sdk/core/packages/renderer/internal/Mappe
4057
4065
  bottomRight?: boolean;
4058
4066
  };
4059
4067
  class SmartTooltip extends HTMLCollider implements IHTMLCollider {
4068
+ #private;
4060
4069
  className: string;
4061
4070
  _el: Element | null;
4062
4071
  style: TTooltipStyle;
@@ -4065,7 +4074,6 @@ declare module '@mappedin/react-native-sdk/core/packages/renderer/internal/Mappe
4065
4074
  get strategies(): TColliderStrategy[];
4066
4075
  colliderDidMount(): void;
4067
4076
  setAction(action: any): void;
4068
- updateDimensions(): void;
4069
4077
  colliderDidNotFindAHome(): void;
4070
4078
  colliderDidGoOffscreen(): void;
4071
4079
  colliderDidUpdateVisiblity(): void;
@@ -4843,7 +4851,7 @@ declare module '@mappedin/react-native-sdk/core/packages/get-venue/MappedinTheme
4843
4851
  }
4844
4852
 
4845
4853
  declare module '@mappedin/react-native-sdk/core/packages/renderer/internal/Mappedin.SmartCollider' {
4846
- import { ISmartCollisionEngine } from '@mappedin/react-native-sdk/core/packages/renderer/internal/Mappedin.SmartCollisionEngine';
4854
+ import SmartCollisionEngine from '@mappedin/react-native-sdk/core/packages/renderer/internal/Mappedin.SmartCollisionEngine';
4847
4855
  import { Vector3 } from 'three';
4848
4856
  export type TRange = [number, number, number, number];
4849
4857
  type TCustomCollider<T> = ICollider & T;
@@ -4880,7 +4888,7 @@ declare module '@mappedin/react-native-sdk/core/packages/renderer/internal/Mappe
4880
4888
  setAction: (action: EColliderAction) => void;
4881
4889
  action?: EColliderAction;
4882
4890
  position: Vector3;
4883
- __engine?: ISmartCollisionEngine;
4891
+ __engine?: SmartCollisionEngine;
4884
4892
  enable: () => void;
4885
4893
  disable: () => void;
4886
4894
  enabled: boolean;
@@ -4894,7 +4902,7 @@ declare module '@mappedin/react-native-sdk/core/packages/renderer/internal/Mappe
4894
4902
  colliderDidGoOffscreen?: () => void;
4895
4903
  colliderDidGoOutsideGrid?: () => void;
4896
4904
  colliderDidUpdateVisiblity?: () => void;
4897
- colliderDidUpdatePosition?: (x: number, y: number) => void;
4905
+ colliderDidUpdatePosition?: (prop: [x: number, y: number]) => void;
4898
4906
  }
4899
4907
  class BaseCollider implements ICollider {
4900
4908
  __engine: any;
@@ -4924,7 +4932,7 @@ declare module '@mappedin/react-native-sdk/core/packages/renderer/internal/Mappe
4924
4932
  removeSelf(): void;
4925
4933
  enable(): void;
4926
4934
  disable(): void;
4927
- colliderDidUpdatePosition(x: any, y: any): void;
4935
+ colliderDidUpdatePosition(pos: any): void;
4928
4936
  colliderDidNotFindAHome(): void;
4929
4937
  colliderDidMount(): void;
4930
4938
  colliderDidUpdateVisiblity(): void;
@@ -5147,6 +5155,7 @@ declare module '@mappedin/react-native-sdk/core/packages/renderer/internal/Mappe
5147
5155
  contentEl: any;
5148
5156
  }
5149
5157
  class HTMLCollider extends BaseCollider {
5158
+ #private;
5150
5159
  contentEl: any;
5151
5160
  containerEl: any;
5152
5161
  removeSelf(): void;
@@ -5154,7 +5163,12 @@ declare module '@mappedin/react-native-sdk/core/packages/renderer/internal/Mappe
5154
5163
  disable(): void;
5155
5164
  colliderDidGoOffscreen(): void;
5156
5165
  colliderDidNotFindAHome(): void;
5157
- colliderDidUpdatePosition(x: any, y: any): void;
5166
+ colliderDidUpdatePosition(pos: any): void;
5167
+ updateDimensions(): void;
5168
+ /**
5169
+ * @internal
5170
+ */
5171
+ updateDimensionsImmediately(): void;
5158
5172
  colliderDidMount(): void;
5159
5173
  colliderDidUpdateVisiblity(): void;
5160
5174
  }
@@ -5389,7 +5403,6 @@ declare module '@mappedin/react-native-sdk/core/packages/renderer/internal/Mappe
5389
5403
  get strategies(): TColliderStrategy[];
5390
5404
  colliderDidMount(): void;
5391
5405
  setAction(action: any): void;
5392
- updateDimensions(): void;
5393
5406
  colliderDidGoOffscreen(): void;
5394
5407
  colliderDidUpdateVisiblity(): void;
5395
5408
  }
@@ -5623,27 +5636,55 @@ declare module '@mappedin/react-native-sdk/core/packages/renderer/internal/Mappe
5623
5636
  declare module '@mappedin/react-native-sdk/core/packages/renderer/internal/Mappedin.SmartCollisionEngine' {
5624
5637
  import { Vector3 } from 'three';
5625
5638
  import './Mappedin.SmartCollisionEngine.scss';
5626
- import { ICollider } from '@mappedin/react-native-sdk/core/packages/renderer/internal/Mappedin.SmartCollider';
5639
+ import { ICollider, TRange } from '@mappedin/react-native-sdk/core/packages/renderer/internal/Mappedin.SmartCollider';
5640
+ import { MappedinMap, MapView } from '@mappedin/react-native-sdk/core/packages/renderer';
5627
5641
  export const COLLIDER_STRATEGY_LOW_PRIORITY = "LOW_PRIORITY";
5628
- type TProjectFn = ({ position, mapId }: {
5629
- position: Vector3;
5630
- mapId: string;
5631
- }) => [number, number];
5632
- export interface ISmartCollisionEngine {
5633
- add: (colliderId: string, collider: ICollider) => void;
5634
- remove: (colliderId: string) => void;
5635
- init: (container: HTMLElement, projectFn: TProjectFn) => void;
5636
- resize: (container: HTMLElement) => void;
5637
- resort: () => void;
5638
- updatePosition: () => void;
5639
- updateVisibility: () => void;
5640
- makeCollidersDirty: () => void;
5641
- update: () => void;
5642
- destroy: () => void;
5643
- makeCollidersDirtyThrottled: (time: number) => void;
5644
- _makeCollidersDirtyThrottled?: [() => void, number];
5642
+ class SmartCollisionEngine {
5643
+ #private;
5644
+ _makeCollidersDirtyThrottled: any;
5645
+ colliderCanvas: HTMLCanvasElement;
5646
+ debugCanvas: HTMLCanvasElement;
5647
+ colliderCanvasContext: CanvasRenderingContext2D;
5648
+ debugCanvasContext: CanvasRenderingContext2D;
5649
+ collisionEngineContainerEl: HTMLDivElement;
5650
+ stepsX: any;
5651
+ stepsY: any;
5652
+ totalWidth: any;
5653
+ totalHeight: any;
5654
+ project: any;
5655
+ grid: Uint8Array;
5656
+ colliders: Map<string, ICollider>;
5657
+ offscreenRanges: TRange[];
5658
+ get sortedColliders(): ICollider[];
5659
+ initialized: boolean;
5660
+ mapView: MapView;
5661
+ constructor(mapView: any);
5662
+ init: (container: HTMLDivElement, projectFn: ({ position, mapId }: {
5663
+ position: Vector3;
5664
+ mapId: MappedinMap['id'];
5665
+ }) => {
5666
+ x: number;
5667
+ y: number;
5668
+ }) => void;
5669
+ updatePosition: () => void;
5670
+ updateVisibility: () => void;
5671
+ add: (colliderId: string, collider: ICollider) => void;
5672
+ remove: (colliderId: string) => void;
5673
+ /**
5674
+ * When adding/removing new colliders, or when updating their priorty, we need to make all colliders around them as "dirty",
5675
+ * so they can be reconcilded correctly
5676
+ */
5677
+ makeCollidersDirty: () => void;
5678
+ /**
5679
+ * Allow to throttle making collders dirty. This is useful for things like BlueDot follow mode,
5680
+ * As we follow the BlueDot, colliders will overlap, but constantly updating their visiblity makes
5681
+ * for a bad experience
5682
+ */
5683
+ makeCollidersDirtyThrottled: (time: any) => void;
5684
+ resize: (container: any) => void;
5685
+ update: () => void;
5686
+ destroy: () => void;
5645
5687
  }
5646
- const SmartCollisionEngine: () => ISmartCollisionEngine;
5647
5688
  export default SmartCollisionEngine;
5648
5689
  }
5649
5690