@mappedin/blue-dot 6.21.1-beta.0 → 6.23.0-beta.0
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/README.md +2 -0
- package/lib/esm/chunk-L57APJ3L.js +2 -0
- package/lib/esm/{chunk-Z7JSDF6R.js → chunk-SM3VIXP7.js} +1 -1
- package/lib/esm/debug/index.d.ts +33 -5
- package/lib/esm/debug/index.js +1 -1
- package/lib/esm/index.d.ts +34 -6
- package/lib/esm/index.js +1 -1
- package/lib/esm/react/index.d.ts +33 -5
- package/lib/esm/react/index.js +1 -1
- package/lib/rn/blue-dot.d.ts +9 -1
- package/lib/rn/index-rn.js +2 -2
- package/lib/rn/logger.d.ts +3 -1
- package/lib/rn/status/status.d.ts +2 -2
- package/lib/rn/status/types.d.ts +12 -1
- package/lib/rn/types.d.ts +14 -5
- package/package.json +4 -4
- package/lib/esm/chunk-Q6T2WYNW.js +0 -2
package/lib/esm/debug/index.d.ts
CHANGED
|
@@ -1178,7 +1178,18 @@ interface MapViewExtension<T> {
|
|
|
1178
1178
|
//#endregion
|
|
1179
1179
|
//#region src/status/types.d.ts
|
|
1180
1180
|
type BlueDotStatus = 'hidden' | 'active' | 'inactive' | 'disabled';
|
|
1181
|
-
|
|
1181
|
+
/**
|
|
1182
|
+
* State-machine input alphabet — the only values `StatusManager.transitionTo()`
|
|
1183
|
+
* accepts and the only keys the transition table is defined over.
|
|
1184
|
+
*/
|
|
1185
|
+
type BlueDotTransition = 'timeout' | 'error' | 'position-update' | 'enable' | 'disable' | 'initialize';
|
|
1186
|
+
/**
|
|
1187
|
+
* Reason a `status-change` event fired. Either a state-machine {@link BlueDotTransition}
|
|
1188
|
+
* or `'visibility-change'`, emitted when a visibility overlay flips the exposed status
|
|
1189
|
+
* without a state-machine transition (e.g. floor visibility when `multiFloorView` is
|
|
1190
|
+
* disabled). Read the event's `status` for the resulting value/direction.
|
|
1191
|
+
*/
|
|
1192
|
+
type BlueDotAction = BlueDotTransition | 'visibility-change';
|
|
1182
1193
|
//#endregion
|
|
1183
1194
|
//#region src/follow/types.d.ts
|
|
1184
1195
|
type FollowMode = /** Camera position follows the Blue Dot's position. */
|
|
@@ -1431,9 +1442,18 @@ type BlueDotPositionUpdate = {
|
|
|
1431
1442
|
*/
|
|
1432
1443
|
heading?: GeolocationPosition['coords']['heading'] | 'device' | undefined;
|
|
1433
1444
|
/**
|
|
1434
|
-
* Floor or floorId
|
|
1435
|
-
*
|
|
1436
|
-
* Set to `
|
|
1445
|
+
* Floor or floorId the Blue Dot is on.
|
|
1446
|
+
*
|
|
1447
|
+
* Set to `'device'` to reset to the device's floor level. Set to `undefined` to
|
|
1448
|
+
* clear the floor so the Blue Dot is not associated with any floor.
|
|
1449
|
+
*
|
|
1450
|
+
* Floor visibility behavior depends on the map's `multiFloorView` option:
|
|
1451
|
+
* - When `multiFloorView` is disabled, the Blue Dot is only shown while its floor
|
|
1452
|
+
* is the visible floor. Changing the map to a different floor hides the Blue Dot
|
|
1453
|
+
* (its `status` becomes `'hidden'`); returning to its floor shows it again. If no
|
|
1454
|
+
* floor is set, the Blue Dot is shown on all floors.
|
|
1455
|
+
* - When `multiFloorView` is enabled (the default), the Blue Dot is always shown
|
|
1456
|
+
* regardless of the floor value.
|
|
1437
1457
|
*/
|
|
1438
1458
|
floorOrFloorId?: Floor | string | 'device' | undefined;
|
|
1439
1459
|
/**
|
|
@@ -2389,6 +2409,10 @@ declare class BlueDot implements MapViewExtension<BlueDotState> {
|
|
|
2389
2409
|
* The current state of the BlueDot. Can be 'hidden', 'active', 'inactive', or 'disabled'.
|
|
2390
2410
|
* Listen for state changes using the 'status-change' event.
|
|
2391
2411
|
*
|
|
2412
|
+
* @remarks When `multiFloorView` is disabled, the status is `'hidden'` whenever the
|
|
2413
|
+
* Blue Dot's floor is not the visible floor, and returns to its previous value
|
|
2414
|
+
* (`'active'` or `'inactive'`) when that floor becomes visible again.
|
|
2415
|
+
*
|
|
2392
2416
|
* @example
|
|
2393
2417
|
* mapView.BlueDot.on('status-change', ({ status }) => {
|
|
2394
2418
|
* if (status === 'active') {
|
|
@@ -2419,7 +2443,11 @@ declare class BlueDot implements MapViewExtension<BlueDotState> {
|
|
|
2419
2443
|
*/
|
|
2420
2444
|
getState(): ReadonlyDeep<BlueDotState>;
|
|
2421
2445
|
/**
|
|
2422
|
-
* The floor the Blue Dot is currently on.
|
|
2446
|
+
* The floor the Blue Dot is currently on.
|
|
2447
|
+
*
|
|
2448
|
+
* When `multiFloorView` is disabled, the Blue Dot is only shown while this floor
|
|
2449
|
+
* is the visible floor; if it is `undefined`, the Blue Dot appears on every floor.
|
|
2450
|
+
* When `multiFloorView` is enabled, the Blue Dot appears on every floor regardless.
|
|
2423
2451
|
*/
|
|
2424
2452
|
get floor(): Floor | undefined;
|
|
2425
2453
|
/**
|
package/lib/esm/debug/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a,d as w,e,f as h,g as u,h as i,j as N,k as T}from"../chunk-
|
|
1
|
+
import{a,d as w,e,f as h,g as u,h as i,j as N,k as T}from"../chunk-L57APJ3L.js";N();N();N();function Je(d){let t={};for(let[l,m]of d.Sensors.getAll())t[l]={enabled:m.isEnabled};let n={timestamp:Date.now(),state:d.getState(),position:d.coordinate?{lat:d.coordinate.latitude,lon:d.coordinate.longitude,floor:d.floor?.name}:null,accuracy:d.accuracy,heading:d.heading,sensors:t,anchor:d.anchor,displacement:d.displacement},s=new Blob([JSON.stringify(n,null,2)],{type:"application/json"}),r=new File([s],`bluedot-debug-${Date.now()}.json`,{type:"application/json"});navigator.canShare?.({files:[r]})?navigator.share({files:[r]}).catch(()=>{qe(s,r.name)}):qe(s,r.name)}a(Je,"exportDebugData");function qe(d,t){let n=URL.createObjectURL(d),s=document.createElement("a");s.href=n,s.download=t,s.click(),URL.revokeObjectURL(n)}a(qe,"downloadFile");N();var B={heading:{headingResponsiveness:40,compassNoiseTolerance:30,headingSnapThreshold:10,magneticDisturbanceGating:!0,headingChangeThreshold:2},motion:{stepSensitivity:50,averageStepLength:.7,strideVariability:0,motionResponsiveness:50,pdrEnabled:!0}};function De(d){return{complementaryAlpha:.99-d.headingResponsiveness/100*.79,gyroNoiseThreshold:.1+d.compassNoiseTolerance/100*4.9,maxHeadingError:d.headingSnapThreshold,magneticGatingEnabled:d.magneticDisturbanceGating,deltaThreshold:d.headingChangeThreshold}}a(De,"headingConfigToFilterParams");function Fe(d){return{stepDetectionThreshold:2-d.stepSensitivity/100*1.5,stepLength:d.averageStepLength,strideAdaptation:d.strideVariability/100*.3,motionThreshold:1-d.motionResponsiveness/100*.8,pdrEnabled:d.pdrEnabled}}a(Fe,"motionConfigToSensorParams");function R(d,t,n){return Math.min(Math.max(d,t),n)}a(R,"clamp");function rt(d){let t={...B};return d.heading&&(t.heading={headingResponsiveness:R(d.heading.headingResponsiveness??30,0,100),compassNoiseTolerance:R(d.heading.compassNoiseTolerance??50,0,100),headingSnapThreshold:R(d.heading.headingSnapThreshold??30,10,90),magneticDisturbanceGating:d.heading.magneticDisturbanceGating??!0,headingChangeThreshold:R(d.heading.headingChangeThreshold??2,1,10)}),d.motion&&(t.motion={stepSensitivity:R(d.motion.stepSensitivity??50,0,100),averageStepLength:R(d.motion.averageStepLength??.7,.4,1.2),strideVariability:R(d.motion.strideVariability??0,0,100),motionResponsiveness:R(d.motion.motionResponsiveness??50,0,100),pdrEnabled:d.motion.pdrEnabled??!0}),t}a(rt,"normalizeTuningConfig");var Ke=`.bluedot-hud {
|
|
2
2
|
position: fixed;
|
|
3
3
|
bottom: 0;
|
|
4
4
|
left: 0;
|
package/lib/esm/index.d.ts
CHANGED
|
@@ -1178,7 +1178,18 @@ interface MapViewExtension<T> {
|
|
|
1178
1178
|
//#endregion
|
|
1179
1179
|
//#region src/status/types.d.ts
|
|
1180
1180
|
type BlueDotStatus = 'hidden' | 'active' | 'inactive' | 'disabled';
|
|
1181
|
-
|
|
1181
|
+
/**
|
|
1182
|
+
* State-machine input alphabet — the only values `StatusManager.transitionTo()`
|
|
1183
|
+
* accepts and the only keys the transition table is defined over.
|
|
1184
|
+
*/
|
|
1185
|
+
type BlueDotTransition = 'timeout' | 'error' | 'position-update' | 'enable' | 'disable' | 'initialize';
|
|
1186
|
+
/**
|
|
1187
|
+
* Reason a `status-change` event fired. Either a state-machine {@link BlueDotTransition}
|
|
1188
|
+
* or `'visibility-change'`, emitted when a visibility overlay flips the exposed status
|
|
1189
|
+
* without a state-machine transition (e.g. floor visibility when `multiFloorView` is
|
|
1190
|
+
* disabled). Read the event's `status` for the resulting value/direction.
|
|
1191
|
+
*/
|
|
1192
|
+
type BlueDotAction = BlueDotTransition | 'visibility-change';
|
|
1182
1193
|
//#endregion
|
|
1183
1194
|
//#region src/follow/types.d.ts
|
|
1184
1195
|
type FollowMode = /** Camera position follows the Blue Dot's position. */
|
|
@@ -1432,9 +1443,18 @@ type BlueDotPositionUpdate = {
|
|
|
1432
1443
|
*/
|
|
1433
1444
|
heading?: GeolocationPosition['coords']['heading'] | 'device' | undefined;
|
|
1434
1445
|
/**
|
|
1435
|
-
* Floor or floorId
|
|
1436
|
-
*
|
|
1437
|
-
* Set to `
|
|
1446
|
+
* Floor or floorId the Blue Dot is on.
|
|
1447
|
+
*
|
|
1448
|
+
* Set to `'device'` to reset to the device's floor level. Set to `undefined` to
|
|
1449
|
+
* clear the floor so the Blue Dot is not associated with any floor.
|
|
1450
|
+
*
|
|
1451
|
+
* Floor visibility behavior depends on the map's `multiFloorView` option:
|
|
1452
|
+
* - When `multiFloorView` is disabled, the Blue Dot is only shown while its floor
|
|
1453
|
+
* is the visible floor. Changing the map to a different floor hides the Blue Dot
|
|
1454
|
+
* (its `status` becomes `'hidden'`); returning to its floor shows it again. If no
|
|
1455
|
+
* floor is set, the Blue Dot is shown on all floors.
|
|
1456
|
+
* - When `multiFloorView` is enabled (the default), the Blue Dot is always shown
|
|
1457
|
+
* regardless of the floor value.
|
|
1438
1458
|
*/
|
|
1439
1459
|
floorOrFloorId?: Floor | string | 'device' | undefined;
|
|
1440
1460
|
/**
|
|
@@ -2390,6 +2410,10 @@ declare class BlueDot implements MapViewExtension<BlueDotState> {
|
|
|
2390
2410
|
* The current state of the BlueDot. Can be 'hidden', 'active', 'inactive', or 'disabled'.
|
|
2391
2411
|
* Listen for state changes using the 'status-change' event.
|
|
2392
2412
|
*
|
|
2413
|
+
* @remarks When `multiFloorView` is disabled, the status is `'hidden'` whenever the
|
|
2414
|
+
* Blue Dot's floor is not the visible floor, and returns to its previous value
|
|
2415
|
+
* (`'active'` or `'inactive'`) when that floor becomes visible again.
|
|
2416
|
+
*
|
|
2393
2417
|
* @example
|
|
2394
2418
|
* mapView.BlueDot.on('status-change', ({ status }) => {
|
|
2395
2419
|
* if (status === 'active') {
|
|
@@ -2420,7 +2444,11 @@ declare class BlueDot implements MapViewExtension<BlueDotState> {
|
|
|
2420
2444
|
*/
|
|
2421
2445
|
getState(): ReadonlyDeep<BlueDotState>;
|
|
2422
2446
|
/**
|
|
2423
|
-
* The floor the Blue Dot is currently on.
|
|
2447
|
+
* The floor the Blue Dot is currently on.
|
|
2448
|
+
*
|
|
2449
|
+
* When `multiFloorView` is disabled, the Blue Dot is only shown while this floor
|
|
2450
|
+
* is the visible floor; if it is `undefined`, the Blue Dot appears on every floor.
|
|
2451
|
+
* When `multiFloorView` is enabled, the Blue Dot appears on every floor regardless.
|
|
2424
2452
|
*/
|
|
2425
2453
|
get floor(): Floor | undefined;
|
|
2426
2454
|
/**
|
|
@@ -2682,4 +2710,4 @@ declare class BlueDot implements MapViewExtension<BlueDotState> {
|
|
|
2682
2710
|
destroy: () => void;
|
|
2683
2711
|
}
|
|
2684
2712
|
//#endregion
|
|
2685
|
-
export { BaseSensor, BlueDot, type BlueDotAction, type BlueDotEventPayloads, type BlueDotEvents, type BlueDotPositionProcessor, type BlueDotPositionUpdate, type BlueDotPositionUpdateWithFloor, type BlueDotState, type BlueDotStatus, type BlueDotUpdateOptions, type BlueDotUpdateState, type BuiltInSensorId, type CustomSensorId, type DisplacementVector, type FollowCameraOptions, type FollowMode, type FusedPosition, type GeolocationPositionExtended, type ManualDisplacementOptions, type ManualPositionOptions, ManualSensor, type PartialPositionUpdate, type PositionAnchor, type PositionMetadata, type PositionUpdate, type SensorEventPayloads, type SensorId, SensorRegistry, type SetAnchorOptions };
|
|
2713
|
+
export { BaseSensor, BlueDot, type BlueDotAction, type BlueDotEventPayloads, type BlueDotEvents, type BlueDotPositionProcessor, type BlueDotPositionUpdate, type BlueDotPositionUpdateWithFloor, type BlueDotState, type BlueDotStatus, type BlueDotTransition, type BlueDotUpdateOptions, type BlueDotUpdateState, type BuiltInSensorId, type CustomSensorId, type DisplacementVector, type FollowCameraOptions, type FollowMode, type FusedPosition, type GeolocationPositionExtended, type ManualDisplacementOptions, type ManualPositionOptions, ManualSensor, type PartialPositionUpdate, type PositionAnchor, type PositionMetadata, type PositionUpdate, type SensorEventPayloads, type SensorId, SensorRegistry, type SetAnchorOptions };
|
package/lib/esm/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as t,b as e,c as s,d as n}from"./chunk-
|
|
1
|
+
import{a as t,b as e,c as s,d as n}from"./chunk-SM3VIXP7.js";import{j as o}from"./chunk-L57APJ3L.js";o();export{t as BaseSensor,n as BlueDot,e as ManualSensor,s as SensorRegistry};
|
package/lib/esm/react/index.d.ts
CHANGED
|
@@ -1178,7 +1178,18 @@ interface MapViewExtension<T> {
|
|
|
1178
1178
|
//#endregion
|
|
1179
1179
|
//#region src/status/types.d.ts
|
|
1180
1180
|
type BlueDotStatus = 'hidden' | 'active' | 'inactive' | 'disabled';
|
|
1181
|
-
|
|
1181
|
+
/**
|
|
1182
|
+
* State-machine input alphabet — the only values `StatusManager.transitionTo()`
|
|
1183
|
+
* accepts and the only keys the transition table is defined over.
|
|
1184
|
+
*/
|
|
1185
|
+
type BlueDotTransition = 'timeout' | 'error' | 'position-update' | 'enable' | 'disable' | 'initialize';
|
|
1186
|
+
/**
|
|
1187
|
+
* Reason a `status-change` event fired. Either a state-machine {@link BlueDotTransition}
|
|
1188
|
+
* or `'visibility-change'`, emitted when a visibility overlay flips the exposed status
|
|
1189
|
+
* without a state-machine transition (e.g. floor visibility when `multiFloorView` is
|
|
1190
|
+
* disabled). Read the event's `status` for the resulting value/direction.
|
|
1191
|
+
*/
|
|
1192
|
+
type BlueDotAction = BlueDotTransition | 'visibility-change';
|
|
1182
1193
|
//#endregion
|
|
1183
1194
|
//#region src/follow/types.d.ts
|
|
1184
1195
|
type FollowMode = /** Camera position follows the Blue Dot's position. */
|
|
@@ -1432,9 +1443,18 @@ type BlueDotPositionUpdate = {
|
|
|
1432
1443
|
*/
|
|
1433
1444
|
heading?: GeolocationPosition['coords']['heading'] | 'device' | undefined;
|
|
1434
1445
|
/**
|
|
1435
|
-
* Floor or floorId
|
|
1436
|
-
*
|
|
1437
|
-
* Set to `
|
|
1446
|
+
* Floor or floorId the Blue Dot is on.
|
|
1447
|
+
*
|
|
1448
|
+
* Set to `'device'` to reset to the device's floor level. Set to `undefined` to
|
|
1449
|
+
* clear the floor so the Blue Dot is not associated with any floor.
|
|
1450
|
+
*
|
|
1451
|
+
* Floor visibility behavior depends on the map's `multiFloorView` option:
|
|
1452
|
+
* - When `multiFloorView` is disabled, the Blue Dot is only shown while its floor
|
|
1453
|
+
* is the visible floor. Changing the map to a different floor hides the Blue Dot
|
|
1454
|
+
* (its `status` becomes `'hidden'`); returning to its floor shows it again. If no
|
|
1455
|
+
* floor is set, the Blue Dot is shown on all floors.
|
|
1456
|
+
* - When `multiFloorView` is enabled (the default), the Blue Dot is always shown
|
|
1457
|
+
* regardless of the floor value.
|
|
1438
1458
|
*/
|
|
1439
1459
|
floorOrFloorId?: Floor | string | 'device' | undefined;
|
|
1440
1460
|
/**
|
|
@@ -2390,6 +2410,10 @@ declare class BlueDot implements MapViewExtension<BlueDotState> {
|
|
|
2390
2410
|
* The current state of the BlueDot. Can be 'hidden', 'active', 'inactive', or 'disabled'.
|
|
2391
2411
|
* Listen for state changes using the 'status-change' event.
|
|
2392
2412
|
*
|
|
2413
|
+
* @remarks When `multiFloorView` is disabled, the status is `'hidden'` whenever the
|
|
2414
|
+
* Blue Dot's floor is not the visible floor, and returns to its previous value
|
|
2415
|
+
* (`'active'` or `'inactive'`) when that floor becomes visible again.
|
|
2416
|
+
*
|
|
2393
2417
|
* @example
|
|
2394
2418
|
* mapView.BlueDot.on('status-change', ({ status }) => {
|
|
2395
2419
|
* if (status === 'active') {
|
|
@@ -2420,7 +2444,11 @@ declare class BlueDot implements MapViewExtension<BlueDotState> {
|
|
|
2420
2444
|
*/
|
|
2421
2445
|
getState(): ReadonlyDeep<BlueDotState>;
|
|
2422
2446
|
/**
|
|
2423
|
-
* The floor the Blue Dot is currently on.
|
|
2447
|
+
* The floor the Blue Dot is currently on.
|
|
2448
|
+
*
|
|
2449
|
+
* When `multiFloorView` is disabled, the Blue Dot is only shown while this floor
|
|
2450
|
+
* is the visible floor; if it is `undefined`, the Blue Dot appears on every floor.
|
|
2451
|
+
* When `multiFloorView` is enabled, the Blue Dot appears on every floor regardless.
|
|
2424
2452
|
*/
|
|
2425
2453
|
get floor(): Floor | undefined;
|
|
2426
2454
|
/**
|
package/lib/esm/react/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{d as f}from"../chunk-
|
|
1
|
+
import{d as f}from"../chunk-SM3VIXP7.js";import{a as n,j as u}from"../chunk-L57APJ3L.js";u();u();import{useCallback as c,useState as p}from"react";import{useMap as D,useMapViewExtension as m}from"@mappedin/react-sdk";function B(){let[,t]=p({});return c(()=>t({}),[])}n(B,"useForceUpdate");function l(){let{mapView:t}=D(),o=B(),{register:r}=m("blue-dot",{onRegister:n(()=>{let e=new f(t);return e.on("position-update",o),e.on("status-change",o),e.on("follow-change",o),e.on("error",o),e},"onRegister"),onDeregister:n(e=>{e.off("position-update",o),e.off("status-change",o),e.off("follow-change",o),e.off("error",o),e.destroy()},"onDeregister")}),s=r();if(!s)throw new Error("BlueDot failed to initialize.");return s}n(l,"useBlueDot");u();import{useCallback as d,useEffect as E,useRef as g}from"react";function w(t,o){let r=l(),s=g(o);s.current=o;let e=d(i=>{s.current(i)},[]);E(()=>{if(r!=null)return r.on(t,e),()=>{r?.off(t,e)}},[r,t,e])}n(w,"useBlueDotEvent");export{l as useBlueDot,w as useBlueDotEvent};
|
package/lib/rn/blue-dot.d.ts
CHANGED
|
@@ -75,6 +75,10 @@ export declare class BlueDot implements MapViewExtension<BlueDotState> {
|
|
|
75
75
|
* The current state of the BlueDot. Can be 'hidden', 'active', 'inactive', or 'disabled'.
|
|
76
76
|
* Listen for state changes using the 'status-change' event.
|
|
77
77
|
*
|
|
78
|
+
* @remarks When `multiFloorView` is disabled, the status is `'hidden'` whenever the
|
|
79
|
+
* Blue Dot's floor is not the visible floor, and returns to its previous value
|
|
80
|
+
* (`'active'` or `'inactive'`) when that floor becomes visible again.
|
|
81
|
+
*
|
|
78
82
|
* @example
|
|
79
83
|
* mapView.BlueDot.on('status-change', ({ status }) => {
|
|
80
84
|
* if (status === 'active') {
|
|
@@ -105,7 +109,11 @@ export declare class BlueDot implements MapViewExtension<BlueDotState> {
|
|
|
105
109
|
*/
|
|
106
110
|
getState(): ReadonlyDeep<BlueDotState>;
|
|
107
111
|
/**
|
|
108
|
-
* The floor the Blue Dot is currently on.
|
|
112
|
+
* The floor the Blue Dot is currently on.
|
|
113
|
+
*
|
|
114
|
+
* When `multiFloorView` is disabled, the Blue Dot is only shown while this floor
|
|
115
|
+
* is the visible floor; if it is `undefined`, the Blue Dot appears on every floor.
|
|
116
|
+
* When `multiFloorView` is enabled, the Blue Dot appears on every floor regardless.
|
|
109
117
|
*/
|
|
110
118
|
get floor(): Floor | undefined;
|
|
111
119
|
/**
|