@mappedin/blue-dot 6.20.0-beta.0 → 6.21.1-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/lib/esm/{chunk-SAUTH2EA.js → chunk-Q6T2WYNW.js} +1 -1
- package/lib/esm/{chunk-HU7D72G7.js → chunk-Z7JSDF6R.js} +1 -1
- package/lib/esm/debug/index.js +1 -1
- package/lib/esm/index.js +1 -1
- package/lib/esm/react/index.js +1 -1
- package/lib/rn/index-rn.js +2 -2
- package/lib/rn/models/constants.d.ts +11 -0
- package/package.json +4 -4
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-Q6T2WYNW.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.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-Z7JSDF6R.js";import{j as o}from"./chunk-Q6T2WYNW.js";o();export{t as BaseSensor,n as BlueDot,e as ManualSensor,s as SensorRegistry};
|
package/lib/esm/react/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{d as f}from"../chunk-
|
|
1
|
+
import{d as f}from"../chunk-Z7JSDF6R.js";import{a as n,j as u}from"../chunk-Q6T2WYNW.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};
|