@mappedin/blue-dot 6.0.1-beta.55 → 6.0.1-beta.56
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/lib/blue-dot.iife.js.map +7 -0
- package/lib/esm/index.d.ts +4 -3
- package/lib/esm/index.js +234 -1
- package/lib/esm/index.js.map +7 -0
- package/lib/rn/index-rn.d.ts +4 -0
- package/lib/rn/index-rn.js +295 -0
- package/lib/rn/index-rn.js.map +7 -0
- package/lib/rn/rn/extension-augmentation.d.ts +15 -0
- package/lib/rn/rn/extension-source.d.ts +6 -0
- package/lib/rn/rn/use-blue-dot-events.d.ts +40 -0
- package/lib/rn/rn/use-blue-dot-registration.d.ts +16 -0
- package/lib/rn/rn/use-blue-dot.d.ts +131 -0
- package/lib/rn/types.d.ts +194 -0
- package/package.json +36 -5
|
@@ -0,0 +1,194 @@
|
|
|
1
|
+
import type { Coordinate, Floor } from '@mappedin/mappedin-js';
|
|
2
|
+
import type { EasingCurve } from '../../packages/common';
|
|
3
|
+
export type FollowMode =
|
|
4
|
+
/** Camera position follows the Blue Dot's position. */
|
|
5
|
+
'position-only'
|
|
6
|
+
/** Camera position follows the Blue Dot's position. Camera bearing matches the Blue Dot's heading. */
|
|
7
|
+
| 'position-and-heading'
|
|
8
|
+
/** Camera position follows the Blue Dot's position. Camera bearing is calculated based on the Navigation path. */
|
|
9
|
+
| 'position-and-path-direction'
|
|
10
|
+
/** Disables follow mode */
|
|
11
|
+
| false;
|
|
12
|
+
export type FollowCameraOptions = {
|
|
13
|
+
/**
|
|
14
|
+
* @default 21
|
|
15
|
+
*/
|
|
16
|
+
zoomLevel?: number;
|
|
17
|
+
/**
|
|
18
|
+
* @default 45
|
|
19
|
+
*/
|
|
20
|
+
pitch?: number;
|
|
21
|
+
/**
|
|
22
|
+
* Camera bearing in degrees clockwise from North. 0 is North, 90 is East, 180 is South, 270 is West.
|
|
23
|
+
* This option is only available in 'position-only' mode. In all other modes, the bearing will be calculated automatically.
|
|
24
|
+
* @default undefined
|
|
25
|
+
*/
|
|
26
|
+
bearing?: number;
|
|
27
|
+
/**
|
|
28
|
+
* @default undefined
|
|
29
|
+
*/
|
|
30
|
+
elevation?: number;
|
|
31
|
+
/**
|
|
32
|
+
* @default 1000
|
|
33
|
+
*/
|
|
34
|
+
duration?: number;
|
|
35
|
+
/**
|
|
36
|
+
* @default 'ease-in-out'
|
|
37
|
+
*/
|
|
38
|
+
easing?: EasingCurve;
|
|
39
|
+
};
|
|
40
|
+
export type BlueDotEventPayloads = {
|
|
41
|
+
/**
|
|
42
|
+
* Emitted when the Blue Dot's position is updated.
|
|
43
|
+
*/
|
|
44
|
+
'position-update': {
|
|
45
|
+
floor: Floor | undefined;
|
|
46
|
+
heading: GeolocationPosition['coords']['heading'] | undefined;
|
|
47
|
+
accuracy: GeolocationPosition['coords']['accuracy'] | undefined;
|
|
48
|
+
coordinate: Coordinate;
|
|
49
|
+
};
|
|
50
|
+
/**
|
|
51
|
+
* Emitted when the Blue Dot's state changes.
|
|
52
|
+
*/
|
|
53
|
+
'state-change': {
|
|
54
|
+
/**
|
|
55
|
+
* The new state of the Blue Dot.
|
|
56
|
+
*/
|
|
57
|
+
state: BlueDotState;
|
|
58
|
+
/**
|
|
59
|
+
* The action that caused the state change.
|
|
60
|
+
*/
|
|
61
|
+
action: BlueDotAction;
|
|
62
|
+
};
|
|
63
|
+
/**
|
|
64
|
+
* Emitted when the Blue Dot encounters an error.
|
|
65
|
+
*/
|
|
66
|
+
error: GeolocationPositionError;
|
|
67
|
+
/**
|
|
68
|
+
* Emitted when the Blue Dot's following state changes.
|
|
69
|
+
*/
|
|
70
|
+
'follow-change': {
|
|
71
|
+
/**
|
|
72
|
+
* Whether the Blue Dot is following the user.
|
|
73
|
+
*/
|
|
74
|
+
following: boolean;
|
|
75
|
+
/**
|
|
76
|
+
* The mode the Blue Dot is following the user in.
|
|
77
|
+
*/
|
|
78
|
+
mode?: FollowMode;
|
|
79
|
+
};
|
|
80
|
+
/**
|
|
81
|
+
* Emitted when the user clicks on the Blue Dot.
|
|
82
|
+
*/
|
|
83
|
+
click: {
|
|
84
|
+
coordinate: Coordinate;
|
|
85
|
+
};
|
|
86
|
+
/**
|
|
87
|
+
* Emitted when the user hovers over the Blue Dot.
|
|
88
|
+
*/
|
|
89
|
+
hover: undefined;
|
|
90
|
+
};
|
|
91
|
+
export type BlueDotEvents = keyof BlueDotEventPayloads;
|
|
92
|
+
export type BlueDotState = 'hidden' | 'active' | 'inactive' | 'disabled';
|
|
93
|
+
export type BlueDotAction = 'timeout' | 'error' | 'position-update' | 'enable' | 'disable' | 'initialize';
|
|
94
|
+
export type BlueDotOptions = {
|
|
95
|
+
/**
|
|
96
|
+
* The radius of the BlueDot in pixels. The BlueDot will maintain this size clamped to a minimum of 0.35 metres.
|
|
97
|
+
* @default 10
|
|
98
|
+
*/
|
|
99
|
+
radius?: number;
|
|
100
|
+
/**
|
|
101
|
+
* The color of the BlueDot core element.
|
|
102
|
+
* @default #2266ff
|
|
103
|
+
*/
|
|
104
|
+
color?: string;
|
|
105
|
+
/**
|
|
106
|
+
* The color of the BlueDot when it has timed out and gone inactive.
|
|
107
|
+
* @default #808080
|
|
108
|
+
*/
|
|
109
|
+
inactiveColor?: string;
|
|
110
|
+
/**
|
|
111
|
+
* Options for the accuracy ring around the BlueDot.
|
|
112
|
+
*/
|
|
113
|
+
accuracyRing?: {
|
|
114
|
+
/**
|
|
115
|
+
* The color of the accuracy ring.
|
|
116
|
+
* @default #2266ff
|
|
117
|
+
*/
|
|
118
|
+
color?: string;
|
|
119
|
+
/**
|
|
120
|
+
* The opacity of the accuracy ring.
|
|
121
|
+
* @default 0.3
|
|
122
|
+
*/
|
|
123
|
+
opacity?: number;
|
|
124
|
+
};
|
|
125
|
+
/**
|
|
126
|
+
* Options for the heading directional indicator.
|
|
127
|
+
*/
|
|
128
|
+
heading?: {
|
|
129
|
+
/**
|
|
130
|
+
* The color of the heading cone.
|
|
131
|
+
* @default #2266ff
|
|
132
|
+
*/
|
|
133
|
+
color?: string;
|
|
134
|
+
/**
|
|
135
|
+
* The opacity of the heading cone.
|
|
136
|
+
* @default 0.7
|
|
137
|
+
*/
|
|
138
|
+
opacity?: number;
|
|
139
|
+
};
|
|
140
|
+
/**
|
|
141
|
+
* The duration of the timeout in milliseconds.
|
|
142
|
+
* If the BlueDot does not receive a position update within this time, it will grey out until a position is received.
|
|
143
|
+
* @default 30000
|
|
144
|
+
*/
|
|
145
|
+
timeout?: number;
|
|
146
|
+
/**
|
|
147
|
+
* Whether to watch the device's position.
|
|
148
|
+
* @default true
|
|
149
|
+
*/
|
|
150
|
+
watchDevicePosition?: boolean;
|
|
151
|
+
/**
|
|
152
|
+
* Whether to log debug messages.
|
|
153
|
+
* @default false
|
|
154
|
+
*/
|
|
155
|
+
debug?: boolean;
|
|
156
|
+
/**
|
|
157
|
+
* The maximum acceptable accuracy in meters. Position updates with accuracy exceeding this value will be dropped.
|
|
158
|
+
* @default 50
|
|
159
|
+
*/
|
|
160
|
+
accuracyThreshold?: number;
|
|
161
|
+
};
|
|
162
|
+
/**
|
|
163
|
+
* Position update options for the {@link BlueDot.update} method.
|
|
164
|
+
*/
|
|
165
|
+
export type BlueDotPositionUpdate = {
|
|
166
|
+
/**
|
|
167
|
+
* Latitude to override.
|
|
168
|
+
* Set to `'device'` to reset to the device's latitude.
|
|
169
|
+
*/
|
|
170
|
+
latitude?: GeolocationPosition['coords']['latitude'] | 'device' | undefined;
|
|
171
|
+
/**
|
|
172
|
+
* Longitude to override.
|
|
173
|
+
* Set to `'device'` to reset to the device's longitude.
|
|
174
|
+
*/
|
|
175
|
+
longitude?: GeolocationPosition['coords']['longitude'] | 'device' | undefined;
|
|
176
|
+
/**
|
|
177
|
+
* Accuracy to override.
|
|
178
|
+
* Set to `'device'` to reset to the device's accuracy.
|
|
179
|
+
* Set to `undefined` to disable the accuracy ring.
|
|
180
|
+
*/
|
|
181
|
+
accuracy?: GeolocationPosition['coords']['accuracy'] | 'device' | undefined;
|
|
182
|
+
/**
|
|
183
|
+
* Heading to override.
|
|
184
|
+
* Set to `'device'` to reset to the device's heading.
|
|
185
|
+
* Set to `undefined` to disable the heading indicator.
|
|
186
|
+
*/
|
|
187
|
+
heading?: GeolocationPosition['coords']['heading'] | 'device' | undefined;
|
|
188
|
+
/**
|
|
189
|
+
* Floor or floorId to override.
|
|
190
|
+
* Set to `'device'` to reset to the device's floor level.
|
|
191
|
+
* Set to `undefined` to disable floor level and show the BlueDot on all floors.
|
|
192
|
+
*/
|
|
193
|
+
floorOrFloorId?: Floor | string | 'device' | undefined;
|
|
194
|
+
};
|
package/package.json
CHANGED
|
@@ -1,12 +1,31 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mappedin/blue-dot",
|
|
3
|
-
"version": "6.0.1-beta.
|
|
3
|
+
"version": "6.0.1-beta.56",
|
|
4
4
|
"homepage": "https://developer.mappedin.com/",
|
|
5
5
|
"private": false,
|
|
6
6
|
"main": "lib/esm/index.js",
|
|
7
7
|
"module": "lib/esm/index.js",
|
|
8
8
|
"browser": "lib/esm/index.js",
|
|
9
9
|
"types": "lib/esm/index.d.ts",
|
|
10
|
+
"exports": {
|
|
11
|
+
".": {
|
|
12
|
+
"import": "./lib/esm/index.js",
|
|
13
|
+
"require": "./lib/esm/index.js",
|
|
14
|
+
"types": "./lib/esm/index.d.ts"
|
|
15
|
+
},
|
|
16
|
+
"./rn": {
|
|
17
|
+
"import": "./lib/rn/index-rn.js",
|
|
18
|
+
"require": "./lib/rn/index-rn.js",
|
|
19
|
+
"types": "./lib/rn/index-rn.d.ts"
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
"typesVersions": {
|
|
23
|
+
"*": {
|
|
24
|
+
"rn": [
|
|
25
|
+
"lib/rn/index-rn.d.ts"
|
|
26
|
+
]
|
|
27
|
+
}
|
|
28
|
+
},
|
|
10
29
|
"files": [
|
|
11
30
|
"lib",
|
|
12
31
|
"README.md",
|
|
@@ -16,19 +35,31 @@
|
|
|
16
35
|
"license": "SEE LICENSE IN LICENSE.txt",
|
|
17
36
|
"scripts": {
|
|
18
37
|
"start": "pnpm build && concurrently \"node scripts/build.mjs --watchChanges\" \"node scripts/start.mjs\"",
|
|
38
|
+
"build:deps": "RN_BUILD=true npx turbo build --filter=@mappedin/blue-dot --ui stream",
|
|
19
39
|
"build": "pnpm clean && tsc -b && node scripts/build.mjs",
|
|
20
|
-
"build:prod": "cross-env NODE_ENV=production pnpm build",
|
|
40
|
+
"build:prod": "cross-env NODE_ENV=production pnpm build && pnpm build:rn",
|
|
41
|
+
"build:rn": "cross-env RN_BUILD=true pnpm build",
|
|
21
42
|
"types": "tsc -b",
|
|
22
|
-
"test": "
|
|
43
|
+
"test": "pnpm -w test blue-dot",
|
|
23
44
|
"test:cov": "NODE_ENV=test jest --coverage",
|
|
24
45
|
"clean": "rm -rf lib/** && rm -rf examples/dist/**",
|
|
25
46
|
"docs": "pnpm build && typedoc"
|
|
26
47
|
},
|
|
27
48
|
"peerDependencies": {
|
|
28
|
-
"@mappedin/mappedin-js": "^6.0.1-beta.42"
|
|
49
|
+
"@mappedin/mappedin-js": "^6.0.1-beta.42",
|
|
50
|
+
"@mappedin/react-native-sdk": ">=6.0.0-alpha.0",
|
|
51
|
+
"react": ">=16.8.0"
|
|
52
|
+
},
|
|
53
|
+
"peerDependenciesMeta": {
|
|
54
|
+
"@mappedin/react-native-sdk": {
|
|
55
|
+
"optional": true
|
|
56
|
+
},
|
|
57
|
+
"react": {
|
|
58
|
+
"optional": true
|
|
59
|
+
}
|
|
29
60
|
},
|
|
30
61
|
"volta": {
|
|
31
62
|
"extends": "../../package.json"
|
|
32
63
|
},
|
|
33
|
-
"gitHead": "
|
|
64
|
+
"gitHead": "deada2546fa6868b53fe81ce8c007edda58f76fa"
|
|
34
65
|
}
|