@expofp/floorplan 3.2.5 → 3.2.7
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/browser/{CookieConsent-Dg2oD8sN.js → CookieConsent-C0WrwOQU.js} +2995 -2564
- package/dist/browser/{Debug-CbQznba_.js → Debug-7KOvbcgu.js} +9 -9
- package/dist/browser/{Demo-BdNX6_TP.js → Demo-BTrpOaT8.js} +12 -12
- package/dist/browser/{Free-BwoR5utw.js → Free-1JPcV1Tq.js} +14 -14
- package/dist/browser/{Gallery-CXfebPUO.js → Gallery-PP-H3fui.js} +9 -9
- package/dist/browser/{GpsLoader-Br89Qdn5.js → GpsLoader-pif05qaO.js} +33 -33
- package/dist/browser/{KioskStore-B2-ZAICw.js → KioskStore-BmqfGXEW.js} +17 -17
- package/dist/browser/Mapbox-BEO3oA1E.js +120 -0
- package/dist/browser/{SetKioskMode-CeBuv4Qc.js → SetKioskMode-BjyRxPem.js} +17 -17
- package/dist/browser/ShowKiosk-DrNFPO0o.js +26 -0
- package/dist/browser/{ThreeComponent-yHjpVIkt.js → ThreeComponent-CkTRDPj-.js} +244 -244
- package/dist/browser/{TouchHand-BEAsV_dg.js → TouchHand-BX9ElW6V.js} +4 -4
- package/dist/browser/{ViewerMenuPanel-Db8sxCQM.js → ViewerMenuPanel-BpxIaNdU.js} +15 -15
- package/dist/browser/{add-debug-secret-listener-BLEkj_Uk.js → add-debug-secret-listener-BV3Vlx9C.js} +1 -1
- package/dist/browser/{boolean-editor-COimNwU3.js → boolean-editor-DfkvcIH0.js} +10 -10
- package/dist/browser/bootIntercom-XKKrQyNd.js +37 -0
- package/dist/browser/{box-BQZT5OqH.js → box-Cy-U95_G.js} +5 -5
- package/dist/browser/{browser-8dPZoUbt.js → browser-oUjLaYcl.js} +2 -2
- package/dist/browser/bundle.json +53 -53
- package/dist/browser/{classnames-BCwn2LMt.js → classnames-DpaK9tQ8.js} +2 -2
- package/dist/browser/{client-Db8--ZUb.js → client-smunwL9U.js} +4 -4
- package/dist/browser/{data-DmyuOKjY.js → data-BVaCNE1I.js} +56 -56
- package/dist/browser/{debug-overlay-B4Z5LEoG.js → debug-overlay-CYWt6Xv8.js} +11 -11
- package/dist/browser/{debug-ui-CvJwtvIB.js → debug-ui-D63K4FZz.js} +6 -6
- package/dist/browser/{dist-C97JwCm0.js → dist-BU_A8R-K.js} +6 -6
- package/dist/browser/{dist-BG3wb6v1.js → dist-XBFUxmAT.js} +3 -3
- package/dist/browser/{dist-Dci3wfOd.js → dist-irw0I8ne.js} +5 -5
- package/dist/browser/{efp-debug-init-p9zcimBs.js → efp-debug-init-CPGmIrNj.js} +2 -2
- package/dist/browser/{enum-editor-o306HPmN.js → enum-editor-B_JVlLVN.js} +11 -11
- package/dist/browser/{exports-CStWW5-w.js → exports-C5NN5UxX.js} +1 -1
- package/dist/browser/{favicon-BA1CtVMn.js → favicon-B0nAd4Pr.js} +1 -1
- package/dist/browser/{fetch-retry.umd-Baj5gCtY.js → fetch-retry.umd-DBq0GieJ.js} +2 -2
- package/dist/browser/{flex-Bk7NLAwd.js → flex-DOhgUp1k.js} +6 -6
- package/dist/browser/{flex.props-DYJg7oQW.js → flex.props-D8JHoC5B.js} +2 -2
- package/dist/browser/{floorplan.loader-DSLFX3Z1.js → floorplan.loader-Cme4mipd.js} +9 -9
- package/dist/browser/{floorplan.ready-D1C9tWKU.js → floorplan.ready-C25lQjgP.js} +215 -254
- package/dist/browser/{fuse-DHUSTGYM.js → fuse-D1o3bI0m.js} +2 -2
- package/dist/browser/index.js +12 -12
- package/dist/browser/{is-debug-Hdaykk22.js → is-debug-D9BzIDdu.js} +3 -3
- package/dist/browser/{jsx-runtime-BudMXsuy.js → jsx-runtime-C0zFKVvF.js} +2 -2
- package/dist/browser/{lib-Dl-Q0kBv.js → lib-D2sBqUIY.js} +4 -4
- package/dist/browser/{main-C74Uu09R.js → main-GLYY8zv3.js} +1 -1
- package/dist/browser/{mobx-CqnQOCE3.js → mobx-D5pYBM85.js} +4 -4
- package/dist/browser/{particles.min-By5wV8f0.js → particles.min-egXyIDIV.js} +2 -2
- package/dist/browser/{prop-types-PFP3f1FZ.js → prop-types-xhHzBbvi.js} +2 -2
- package/dist/browser/{react-COj6SqvB.js → react-CanbjT5I.js} +2 -2
- package/dist/browser/{react-dom-BdCxtmki.js → react-dom-wNBYs_H5.js} +3 -3
- package/dist/browser/{reset-all-settings-BQEz2q9w.js → reset-all-settings-5oUUws5J.js} +7 -7
- package/dist/browser/{rolldown-runtime-msuxsciZ.js → rolldown-runtime-BKpHzyBK.js} +1 -1
- package/dist/browser/{settings-C0lWPVRL.js → settings-D5qqIejY.js} +2 -2
- package/dist/browser/{settings-item-Y4RmHiJ4.js → settings-item-Blm7DAEt.js} +6 -6
- package/dist/browser/{store-5PES-APA.js → store-CM7rJpRZ.js} +1151 -916
- package/dist/browser/{string-editor-CDEAe6WK.js → string-editor-CLdOCbq2.js} +8 -8
- package/dist/browser/{theme-yitmRjt6.js → theme-App4ywLP.js} +8 -8
- package/dist/browser/{ui--XBIRzrF.js → ui-BN6m_5pK.js} +8 -8
- package/dist/esm/RouteCutIn.js +1 -1
- package/dist/esm/components/IntercomLauncher.d.ts +5 -0
- package/dist/esm/components/IntercomLauncher.js +1 -0
- package/dist/esm/components/Layout.js +1 -1
- package/dist/esm/components/Map/Map.js +1 -1
- package/dist/esm/components/Map/drawing/config/config-all.js +1 -1
- package/dist/esm/components/gps/useUserLocationAndHeading.js +1 -1
- package/dist/esm/components/gps/utils.js +1 -1
- package/dist/esm/floorplan.ready.js +1 -1
- package/dist/esm/intercom/bootIntercom.js +1 -19
- package/dist/esm/store/IntercomStore.d.ts +7 -0
- package/dist/esm/store/IntercomStore.js +1 -0
- package/dist/esm/store/RootStore.d.ts +2 -0
- package/dist/esm/store/RootStore.js +1 -1
- package/dist/esm/store/RouteStore.d.ts +1 -1
- package/dist/esm/store/RouteStore.js +1 -1
- package/dist/esm/store/index.d.ts +1 -0
- package/dist/esm/store/index.js +1 -1
- package/dist/esm/utils/gps.d.ts +0 -1
- package/dist/esm/utils/gps.js +1 -1
- package/dist/esm/utils/haversineDistance.d.ts +7 -0
- package/dist/esm/utils/haversineDistance.js +1 -0
- package/dist/esm/wayfinding/adapters/boothToEndpoint.d.ts +13 -0
- package/dist/esm/wayfinding/adapters/boothToEndpoint.js +1 -0
- package/dist/esm/wayfinding/adapters/boothToWaypoint.d.ts +1 -1
- package/dist/esm/wayfinding/adapters/canvasIconProvider.d.ts +20 -0
- package/dist/esm/wayfinding/adapters/canvasIconProvider.js +1 -0
- package/dist/esm/wayfinding/adapters/floorContext.d.ts +10 -0
- package/dist/esm/wayfinding/adapters/floorContext.js +1 -0
- package/dist/esm/wayfinding/adapters/graphDataSource.d.ts +1 -1
- package/dist/esm/wayfinding/adapters/iconProvider.d.ts +15 -0
- package/dist/esm/wayfinding/adapters/index.d.ts +9 -0
- package/dist/esm/wayfinding/adapters/index.js +1 -0
- package/dist/esm/wayfinding/adapters/kioskCanvas.d.ts +7 -0
- package/dist/esm/wayfinding/adapters/kioskCanvas.js +1 -0
- package/dist/esm/wayfinding/adapters/positionInput.d.ts +11 -0
- package/dist/esm/wayfinding/adapters/positionInput.js +1 -0
- package/dist/esm/wayfinding/bindMobxReactions.d.ts +27 -0
- package/dist/esm/wayfinding/bindMobxReactions.js +1 -0
- package/dist/esm/wayfinding/{__tests__ → core/__tests__}/helpers.d.ts +0 -5
- package/dist/esm/wayfinding/core/__tests__/helpers.js +1 -0
- package/dist/esm/wayfinding/core/createWayfindingEngine.d.ts +16 -0
- package/dist/esm/wayfinding/core/createWayfindingEngine.js +1 -0
- package/dist/esm/wayfinding/{graph → core/graph}/graphCache.d.ts +2 -1
- package/dist/esm/wayfinding/core/index.d.ts +16 -0
- package/dist/esm/wayfinding/core/index.js +1 -0
- package/dist/esm/wayfinding/core/position/distanceToRoute.d.ts +3 -0
- package/dist/esm/wayfinding/core/position/distanceToRoute.js +1 -0
- package/dist/esm/wayfinding/core/position/gpsThreshold.d.ts +22 -0
- package/dist/esm/wayfinding/core/position/gpsThreshold.js +1 -0
- package/dist/esm/wayfinding/core/position/shouldReroute.d.ts +3 -0
- package/dist/esm/wayfinding/core/position/shouldReroute.js +1 -0
- package/dist/esm/wayfinding/core/position/snapToRoute.d.ts +4 -0
- package/dist/esm/wayfinding/core/position/snapToRoute.js +1 -0
- package/dist/esm/{components/Map/drawing/config/route-snapping → wayfinding/core/position}/splitRouteByPoint.d.ts +1 -1
- package/dist/esm/wayfinding/core/position/splitRouteByPoint.js +1 -0
- package/dist/esm/wayfinding/core/rendering/computeTrailPoints.d.ts +19 -0
- package/dist/esm/wayfinding/core/rendering/computeTrailPoints.js +1 -0
- package/dist/esm/wayfinding/{rendering → core/rendering}/computeTransitionPoints.d.ts +2 -2
- package/dist/esm/wayfinding/core/rendering/getVisibleRouteLines.d.ts +11 -0
- package/dist/esm/wayfinding/core/rendering/getVisibleRouteLines.js +1 -0
- package/dist/esm/wayfinding/core/rendering/normalizeRouteDirection.d.ts +20 -0
- package/dist/esm/wayfinding/core/rendering/normalizeRouteDirection.js +1 -0
- package/dist/esm/wayfinding/core/rendering/routeGeometry.d.ts +15 -0
- package/dist/esm/wayfinding/core/rendering/routeGeometry.js +1 -0
- package/dist/esm/wayfinding/core/routing/optimizeWaypointOrder.d.ts +19 -0
- package/dist/esm/wayfinding/core/routing/optimizeWaypointOrder.js +1 -0
- package/dist/esm/wayfinding/core/routing/resolveWaypointCandidates.d.ts +7 -0
- package/dist/esm/wayfinding/core/routing/resolveWaypointCandidates.js +1 -0
- package/dist/esm/wayfinding/{types.d.ts → core/types.d.ts} +37 -0
- package/dist/esm/wayfinding/createWayfinding.d.ts +3 -0
- package/dist/esm/wayfinding/createWayfinding.js +1 -0
- package/dist/esm/wayfinding/handlers/kioskHandler.d.ts +25 -0
- package/dist/esm/wayfinding/handlers/kioskHandler.js +1 -0
- package/dist/esm/wayfinding/handlers/yahHandler.d.ts +23 -0
- package/dist/esm/wayfinding/handlers/yahHandler.js +1 -0
- package/dist/esm/wayfinding/layers.d.ts +14 -0
- package/dist/esm/wayfinding/layers.js +1 -0
- package/dist/esm/wayfinding/renderer/createWayfindingRenderer.d.ts +14 -0
- package/dist/esm/wayfinding/renderer/createWayfindingRenderer.js +1 -0
- package/dist/esm/wayfinding/renderer/iconManager.d.ts +31 -0
- package/dist/esm/wayfinding/renderer/iconManager.js +1 -0
- package/dist/esm/wayfinding/renderer/index.d.ts +3 -0
- package/dist/esm/wayfinding/renderer/index.js +1 -0
- package/dist/esm/wayfinding/renderer/layerManager.d.ts +27 -0
- package/dist/esm/wayfinding/renderer/layerManager.js +1 -0
- package/dist/esm/wayfinding/renderer/routeLineManager.d.ts +42 -0
- package/dist/esm/wayfinding/renderer/routeLineManager.js +1 -0
- package/dist/esm/wayfinding/renderer/trailManager.d.ts +27 -0
- package/dist/esm/wayfinding/renderer/trailManager.js +1 -0
- package/dist/esm/wayfinding/renderer/types.d.ts +162 -0
- package/dist/esm/wayfinding/runtime/createWayfindingRuntime.d.ts +3 -0
- package/dist/esm/wayfinding/runtime/createWayfindingRuntime.js +1 -0
- package/dist/esm/wayfinding/runtime/endpointView.d.ts +16 -0
- package/dist/esm/wayfinding/runtime/endpointView.js +1 -0
- package/dist/esm/wayfinding/runtime/getRouteLines.d.ts +13 -0
- package/dist/esm/wayfinding/runtime/getRouteLines.js +1 -0
- package/dist/esm/wayfinding/runtime/positionTrailView.d.ts +57 -0
- package/dist/esm/wayfinding/runtime/positionTrailView.js +1 -0
- package/dist/esm/wayfinding/runtime/positionView.d.ts +23 -0
- package/dist/esm/wayfinding/runtime/positionView.js +1 -0
- package/dist/esm/wayfinding/runtime/routeLinesView.d.ts +18 -0
- package/dist/esm/wayfinding/runtime/routeLinesView.js +1 -0
- package/dist/esm/wayfinding/runtime/routeRenderData.d.ts +29 -0
- package/dist/esm/wayfinding/runtime/routeRenderData.js +1 -0
- package/dist/esm/wayfinding/runtime/routeUpdate.d.ts +14 -0
- package/dist/esm/wayfinding/runtime/routeUpdate.js +1 -0
- package/dist/esm/wayfinding/runtime/trailView.d.ts +21 -0
- package/dist/esm/wayfinding/runtime/trailView.js +1 -0
- package/dist/esm/wayfinding/runtime/transitionView.d.ts +18 -0
- package/dist/esm/wayfinding/runtime/transitionView.js +1 -0
- package/dist/esm/wayfinding/runtime/types.d.ts +72 -0
- package/dist/esm/wayfinding/runtime/types.js +1 -0
- package/dist/esm/wayfinding/utils/findBoothInRadius.d.ts +4 -0
- package/dist/esm/wayfinding/utils/findBoothInRadius.js +1 -0
- package/package.json +3 -3
- package/dist/browser/Mapbox-B5PiDpk1.js +0 -120
- package/dist/browser/ShowKiosk-CfxC8v7B.js +0 -26
- package/dist/browser/bootIntercom-DjZFUOTC.js +0 -40
- package/dist/esm/components/Map/drawing/config/config-wf.d.ts +0 -8
- package/dist/esm/components/Map/drawing/config/config-wf.js +0 -1
- package/dist/esm/components/Map/drawing/config/route-snapping/index.d.ts +0 -5
- package/dist/esm/components/Map/drawing/config/route-snapping/index.js +0 -1
- package/dist/esm/components/Map/drawing/config/route-snapping/snapPositionToRoute.d.ts +0 -21
- package/dist/esm/components/Map/drawing/config/route-snapping/snapPositionToRoute.js +0 -1
- package/dist/esm/components/Map/drawing/config/route-snapping/splitRouteByPoint.js +0 -1
- package/dist/esm/components/Map/drawing/config/route-snapping/types.d.ts +0 -18
- package/dist/esm/components/Map/drawing/config/route-snapping/utils.d.ts +0 -29
- package/dist/esm/components/Map/drawing/config/route-snapping/utils.js +0 -1
- package/dist/esm/utils/buildOptimizedRoute.d.ts +0 -11
- package/dist/esm/utils/buildOptimizedRoute.js +0 -1
- package/dist/esm/wayfinding/_PLAN-public-api.d.ts +0 -220
- package/dist/esm/wayfinding/__integration__/legacy/legacyWayfinding.d.ts +0 -27
- package/dist/esm/wayfinding/__integration__/legacy/legacyWayfinding.js +0 -1
- package/dist/esm/wayfinding/__tests__/helpers.js +0 -1
- package/dist/esm/wayfinding/index.d.ts +0 -18
- package/dist/esm/wayfinding/index.js +0 -1
- package/dist/esm/wayfinding/rendering/normalizeRouteDirection.d.ts +0 -19
- package/dist/esm/wayfinding/rendering/normalizeRouteDirection.js +0 -1
- package/dist/esm/wayfinding/rendering/routeGeometry.d.ts +0 -16
- package/dist/esm/wayfinding/rendering/routeGeometry.js +0 -1
- package/dist/esm/wayfinding/routing/getGraphLines.d.ts +0 -14
- package/dist/esm/wayfinding/routing/getGraphLines.js +0 -1
- /package/dist/esm/{components/Map/drawing/config/route-snapping/types.js → wayfinding/adapters/iconProvider.js} +0 -0
- /package/dist/esm/wayfinding/{graph → core/graph}/buildGraph.d.ts +0 -0
- /package/dist/esm/wayfinding/{graph → core/graph}/buildGraph.js +0 -0
- /package/dist/esm/wayfinding/{graph → core/graph}/buildNGraph.d.ts +0 -0
- /package/dist/esm/wayfinding/{graph → core/graph}/buildNGraph.js +0 -0
- /package/dist/esm/wayfinding/{graph → core/graph}/constants.d.ts +0 -0
- /package/dist/esm/wayfinding/{graph → core/graph}/constants.js +0 -0
- /package/dist/esm/wayfinding/{graph → core/graph}/findShortestPath.d.ts +0 -0
- /package/dist/esm/wayfinding/{graph → core/graph}/findShortestPath.js +0 -0
- /package/dist/esm/wayfinding/{graph → core/graph}/graphCache.js +0 -0
- /package/dist/esm/wayfinding/{graph → core/graph}/graphHelpers.d.ts +0 -0
- /package/dist/esm/wayfinding/{graph → core/graph}/graphHelpers.js +0 -0
- /package/dist/esm/wayfinding/{graph → core/graph}/linkCost.d.ts +0 -0
- /package/dist/esm/wayfinding/{graph → core/graph}/linkCost.js +0 -0
- /package/dist/esm/wayfinding/{graph → core/graph}/pathfinder/aStarPathFinder.d.ts +0 -0
- /package/dist/esm/wayfinding/{graph → core/graph}/pathfinder/aStarPathFinder.js +0 -0
- /package/dist/esm/wayfinding/{graph → core/graph}/pathfinder/parseNodeId.d.ts +0 -0
- /package/dist/esm/wayfinding/{graph → core/graph}/pathfinder/parseNodeId.js +0 -0
- /package/dist/esm/wayfinding/{rendering → core/rendering}/computeTransitionPoints.js +0 -0
- /package/dist/esm/wayfinding/{routing → core/routing}/buildMultiPointRoute.d.ts +0 -0
- /package/dist/esm/wayfinding/{routing → core/routing}/buildMultiPointRoute.js +0 -0
- /package/dist/esm/wayfinding/{routing → core/routing}/buildRoute.d.ts +0 -0
- /package/dist/esm/wayfinding/{routing → core/routing}/buildRoute.js +0 -0
- /package/dist/esm/wayfinding/{routing → core/routing}/findNearestGraphPoint.d.ts +0 -0
- /package/dist/esm/wayfinding/{routing → core/routing}/findNearestGraphPoint.js +0 -0
- /package/dist/esm/wayfinding/{routing → core/routing}/getRouteLength.d.ts +0 -0
- /package/dist/esm/wayfinding/{routing → core/routing}/getRouteLength.js +0 -0
- /package/dist/esm/wayfinding/{routing → core/routing}/routeResult.d.ts +0 -0
- /package/dist/esm/wayfinding/{routing → core/routing}/routeResult.js +0 -0
- /package/dist/esm/wayfinding/{types.js → core/types.js} +0 -0
- /package/dist/esm/wayfinding/{_PLAN-public-api.js → renderer/types.js} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export const WF_POINTS_LAYER_NAME="wf-points",WF_TRAIL_LAYER_NAME="wf-trail-points",WF_LINES_LAYER_NAME="wf-lines",WF_LINES_ANIMATED_LAYER_NAME="wf-lines-animated";
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { RendererService } from "../../renderer";
|
|
2
|
+
import type { WayfindingRenderer, WayfindingRendererConfig } from "./types";
|
|
3
|
+
/**
|
|
4
|
+
* Create a {@link WayfindingRenderer} — the composition root that wires
|
|
5
|
+
* together {@link LayerManager}, {@link IconManager}, {@link TrailManager},
|
|
6
|
+
* and {@link RouteLineManager}.
|
|
7
|
+
*
|
|
8
|
+
* Registers `pointer:click` and `pointer:move` listeners on the renderer
|
|
9
|
+
* canvas for icon interaction. Call `destroy()` to unregister them.
|
|
10
|
+
*
|
|
11
|
+
* @throws If `rendererService.scene` or `rendererService.renderer` is null.
|
|
12
|
+
*/
|
|
13
|
+
export declare function createWayfindingRenderer(rendererService: RendererService, config?: WayfindingRendererConfig): WayfindingRenderer;
|
|
14
|
+
//# sourceMappingURL=createWayfindingRenderer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{createLayerManager as d}from"./layerManager";import{createIconManager as m}from"./iconManager";import{createTrailManager as f}from"./trailManager";import{createRouteLineManager as u}from"./routeLineManager";const v={passed:"#B5B7BC",remaining:"#A4CCE2",active:"#0794EA"};export function createWayfindingRenderer(r,i={}){const l={...v,...i.colors},n=d(r),e=m(n,r),t=f(n,r),o=u(n,r,l),a=r.renderer;if(!a)throw new Error("renderer: rendererService.renderer is null \u2014 start RendererService before constructing renderer");a.events.addEventListener("pointer:click",e.handleClick),a.events.addEventListener("pointer:move",e.handleHover);const c={setIcon:e.setIcon,clearIcons:e.clearIcons,setTrail:t.setTrail,setRouteLines:o.setRouteLines,clearRoute(){o.clearLines(),t.destroy(),e.hideAll()},flush:n.flush,destroy(){c.clearRoute();const s=r.renderer;s&&(s.events.removeEventListener("pointer:click",e.handleClick),s.events.removeEventListener("pointer:move",e.handleHover)),e.destroy(),t.destroy(),o.destroy(),n.destroy()}};return c}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { MouseEventData } from "@expofp/renderer";
|
|
2
|
+
import type { RendererService } from "../../renderer";
|
|
3
|
+
import type { IconConfig } from "./types";
|
|
4
|
+
import type { LayerManager } from "./layerManager";
|
|
5
|
+
/**
|
|
6
|
+
* Manages `ImageDef` icons in the scene graph.
|
|
7
|
+
*
|
|
8
|
+
* Icons are keyed by `(name, key?)`. First `setIcon` creates the `ImageDef`
|
|
9
|
+
* and registers scale/roll handlers; subsequent calls mutate in place.
|
|
10
|
+
* Pass `config: null` to hide an icon without destroying it.
|
|
11
|
+
*/
|
|
12
|
+
export interface IconManager {
|
|
13
|
+
/** Place, update, or hide an icon. See {@link WayfindingRenderer.setIcon}. */
|
|
14
|
+
setIcon(name: string, config: IconConfig | null, key?: string | number): void;
|
|
15
|
+
/** Hide all icons matching the given name(s). */
|
|
16
|
+
clearIcons(names: string | ReadonlyArray<string>): void;
|
|
17
|
+
/** Hide every managed icon (used by `clearRoute`). */
|
|
18
|
+
hideAll(): void;
|
|
19
|
+
/** Unregister all scale/roll handlers and clear internal state. */
|
|
20
|
+
destroy(): void;
|
|
21
|
+
/** Pointer click handler — fires the first matching icon's `onClick`. */
|
|
22
|
+
handleClick(event: MouseEventData): void;
|
|
23
|
+
/** Pointer move handler — sets cursor to "pointer" when hovering a clickable icon. */
|
|
24
|
+
handleHover(event: MouseEventData): void;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Create an {@link IconManager} that places `ImageDef` icons into layers
|
|
28
|
+
* managed by the given {@link LayerManager}.
|
|
29
|
+
*/
|
|
30
|
+
export declare function createIconManager(layerManager: LayerManager, rendererService: RendererService): IconManager;
|
|
31
|
+
//# sourceMappingURL=iconManager.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{createImageDef as w,getBounds as m,getRotation as L}from"../../renderer";import{pickDefaultScene as D}from"../../renderer/engine-core/defs";export function createIconManager(u,r){const l=new Map,d=new Map,f=new Map;function g(e,a){return a===void 0?e:`${e}#${a}`}function b(e,a){let t=d.get(e);t||(t=new Set,d.set(e,t)),t.add(a),f.set(a,e)}function k(e){const a=f.get(e);if(!a)return;const t=d.get(a);t&&t.delete(e),f.delete(e)}function h(e,a,t){const n=u.touchLayer(t.layer),i=w(t.canvas,m(t.x,t.y,t.canvas.width,t.canvas.height,r.scale,t.rotation),{hidden:t.hidden??!1,dim:t.dimmed??!1,origin:t.origin});n.children.push(i),r.onPtScale(e,c=>{const s=l.get(e);if(!(!s||s.imageDef.hidden))return s.imageDef.bounds=m(s.imageDef.bounds.center.x,s.imageDef.bounds.center.y,s.imageDef.source.width,s.imageDef.source.height,c,s.imageDef.bounds.rotation),s.imageDef}),t.cardinalSnap&&r.onRoll(e,c=>{const s=l.get(e);if(!s)return;const y=L(c,s.imageDef.bounds.rotation);if(y!==void 0)return s.imageDef.bounds.rotation+=y,s.imageDef});const o={imageDef:i,layerName:t.layer,callback:t.onClick??null};return l.set(e,o),b(a,e),o}function p(e,a,t,n){const i=u.resolveLayer(t.layerName),o=i.children,c=o.indexOf(t.imageDef);c>=0&&o.splice(c,1),u.touchedLayers.set(t.layerName,i),r.ptScaleRegistry.unregisterByName(e),r.rollRegistry.unregisterByName(e),l.delete(e),k(e),h(e,a,n)}function N(e,a,t,n){if(t.layerName!==n.layer)throw new Error(`renderer: icon "${e}" cannot move between layers (was "${t.layerName}", got "${n.layer}")`);if(t.imageDef.source!==n.canvas){p(e,a,t,n);return}t.imageDef.bounds=m(n.x,n.y,n.canvas.width,n.canvas.height,r.scale,n.rotation),t.imageDef.hidden=n.hidden??!1,t.imageDef.dim=n.dimmed??!1,t.callback=n.onClick??null,u.touchLayer(n.layer)}return{setIcon(e,a,t){const n=g(e,t);if(a===null){const o=l.get(n);o&&(o.imageDef.hidden=!0,o.callback=null,u.touchLayer(o.layerName));return}const i=l.get(n);i?N(n,e,i,a):h(n,e,a)},clearIcons(e){const a=typeof e=="string"?[e]:e;for(const t of a){const n=d.get(t);if(n)for(const i of n){const o=l.get(i);o&&(o.imageDef.hidden=!0,o.callback=null,u.touchLayer(o.layerName))}}},hideAll(){for(const e of l.values())e.imageDef.hidden=!0,e.callback=null,u.touchedLayers.set(e.layerName,u.resolveLayer(e.layerName))},destroy(){for(const e of l.keys())r.ptScaleRegistry.unregisterByName(e),r.rollRegistry.unregisterByName(e);l.clear(),d.clear(),f.clear()},handleClick({data:e}){const{defs:a}=D(e);for(const t of l.values())if(t.callback&&!t.imageDef.hidden&&a.includes(t.imageDef)){t.callback();return}},handleHover({data:e}){const a=r.renderer;if(!a)return;const{defs:t}=D(e);let n=!1;for(const i of l.values())if(i.callback&&!i.imageDef.hidden&&t.includes(i.imageDef)){n=!0;break}a.canvas.style.cursor=n?"pointer":""}}}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export{createWayfindingRenderer}from"./createWayfindingRenderer";
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { LayerDef } from "@expofp/renderer";
|
|
2
|
+
import type { RendererService } from "../../renderer";
|
|
3
|
+
/**
|
|
4
|
+
* Manages scene layer resolution, caching, dirty-tracking, and flush.
|
|
5
|
+
*
|
|
6
|
+
* Layers are resolved by name from `scene.rootLayer.children` and cached.
|
|
7
|
+
* `touchLayer` marks a layer as dirty; `flush` commits all dirty layers
|
|
8
|
+
* to `RendererService` in a single update call.
|
|
9
|
+
*/
|
|
10
|
+
export interface LayerManager {
|
|
11
|
+
/** Layers modified since the last {@link flush}. */
|
|
12
|
+
readonly touchedLayers: Map<string, LayerDef>;
|
|
13
|
+
/** Resolve a layer by name (cached). Throws if not found. */
|
|
14
|
+
resolveLayer(name: string): LayerDef;
|
|
15
|
+
/** Resolve a layer and mark it as dirty for the next {@link flush}. */
|
|
16
|
+
touchLayer(name: string): LayerDef;
|
|
17
|
+
/** Commit all dirty layers to `RendererService` and clear the dirty set. */
|
|
18
|
+
flush(): void;
|
|
19
|
+
/** Clear caches and dirty set. */
|
|
20
|
+
destroy(): void;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Create a {@link LayerManager} bound to the given `RendererService`.
|
|
24
|
+
* Throws if `rendererService.scene` is null.
|
|
25
|
+
*/
|
|
26
|
+
export declare function createLayerManager(rendererService: RendererService): LayerManager;
|
|
27
|
+
//# sourceMappingURL=layerManager.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export function createLayerManager(o){const s=o.scene;if(!s)throw new Error("renderer: rendererService.scene is null \u2014 start RendererService before constructing renderer");const a=s.rootLayer.children,t=new Map,r=new Map;return{touchedLayers:r,resolveLayer(e){const n=t.get(e);if(n)return n;const c=a.find(l=>l.name===e);if(!c)throw new Error(`renderer: layer "${e}" not found in scene`);return t.set(e,c),c},touchLayer(e){const n=this.resolveLayer(e);return r.set(e,n),n},flush(){if(r.size!==0){for(const e of r.values())e.children=[...e.children];o.update(...r.values()),r.clear()}},destroy(){r.clear(),t.clear()}}}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import type { RendererService } from "../../renderer";
|
|
2
|
+
import type { RouteColors } from "./types";
|
|
3
|
+
import type { LayerManager } from "./layerManager";
|
|
4
|
+
/**
|
|
5
|
+
* Manages static route lines (passed + remaining) and an animated overlay
|
|
6
|
+
* on the remaining segment.
|
|
7
|
+
*/
|
|
8
|
+
export interface RouteLineManager {
|
|
9
|
+
setRouteLines(passed: ReadonlyArray<{
|
|
10
|
+
readonly p0: {
|
|
11
|
+
x: number;
|
|
12
|
+
y: number;
|
|
13
|
+
};
|
|
14
|
+
readonly p1: {
|
|
15
|
+
x: number;
|
|
16
|
+
y: number;
|
|
17
|
+
};
|
|
18
|
+
}>, remaining: ReadonlyArray<{
|
|
19
|
+
readonly p0: {
|
|
20
|
+
x: number;
|
|
21
|
+
y: number;
|
|
22
|
+
};
|
|
23
|
+
readonly p1: {
|
|
24
|
+
x: number;
|
|
25
|
+
y: number;
|
|
26
|
+
};
|
|
27
|
+
}>, options: {
|
|
28
|
+
readonly linesLayer: string;
|
|
29
|
+
readonly animatedLinesLayer: string;
|
|
30
|
+
readonly resetAnimation?: boolean;
|
|
31
|
+
}): void;
|
|
32
|
+
/** Stop animation, wipe both lines layers. */
|
|
33
|
+
clearLines(): void;
|
|
34
|
+
/** Alias for {@link clearLines}. */
|
|
35
|
+
destroy(): void;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Create a {@link RouteLineManager} that renders `LineDef` segments
|
|
39
|
+
* into layers managed by the given {@link LayerManager}.
|
|
40
|
+
*/
|
|
41
|
+
export declare function createRouteLineManager(layerManager: LayerManager, rendererService: RendererService, colors: RouteColors): RouteLineManager;
|
|
42
|
+
//# sourceMappingURL=routeLineManager.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{createLineDef as d}from"../../renderer";import{animateLineSegments as A}from"../../renderer/engine-core/animation";export function createRouteLineManager(s,m,r){let e=null,n=null,i=null;return{setRouteLines(f,h,l){const o=s.touchLayer(l.linesLayer),a=s.touchLayer(l.animatedLinesLayer);n=o,i=a;const p=l.resetAnimation??!0;let u=0;e&&(p||(u=e.getProgress()),e.stop(),e=null);const y=f.map(t=>d(t,r.passed)),c=h.map(t=>d(t,r.remaining));if(o.children=[...y,...c],!c.length){a.children=[];return}const L=c.map(t=>({...t,color:r.active}));e=A(L,(t,g,D)=>{a.children=D?[]:[...L.slice(0,g),t],m.update(a)},()=>m.scale,u)??null},clearLines(){e&&(e.stop(),e=null),n&&(n.children=[],s.touchedLayers.set(n.name,n)),i&&(i.children=[],s.touchedLayers.set(i.name,i))},destroy(){this.clearLines()}}}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { RendererService } from "../../renderer";
|
|
2
|
+
import type { Point } from "./types";
|
|
3
|
+
import type { LayerManager } from "./layerManager";
|
|
4
|
+
/**
|
|
5
|
+
* Manages named trails of evenly-spaced dots between two points.
|
|
6
|
+
*
|
|
7
|
+
* Each trail has its own scale handler — when the camera zooms, dots are
|
|
8
|
+
* recalculated so visual spacing stays constant.
|
|
9
|
+
*/
|
|
10
|
+
export interface TrailManager {
|
|
11
|
+
/**
|
|
12
|
+
* Place, update, or remove a named trail.
|
|
13
|
+
* Pass `from/to = null` to remove the trail and unregister its scale handler.
|
|
14
|
+
*/
|
|
15
|
+
setTrail(name: string, from: Point | null, to: Point | null, options?: {
|
|
16
|
+
readonly canvas: HTMLCanvasElement;
|
|
17
|
+
readonly layer: string;
|
|
18
|
+
}): void;
|
|
19
|
+
/** Remove all trails and unregister their scale handlers. */
|
|
20
|
+
destroy(): void;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Create a {@link TrailManager} that renders dot trails into layers
|
|
24
|
+
* managed by the given {@link LayerManager}.
|
|
25
|
+
*/
|
|
26
|
+
export declare function createTrailManager(layerManager: LayerManager, rendererService: RendererService): TrailManager;
|
|
27
|
+
//# sourceMappingURL=trailManager.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{createImageDef as w,getBounds as d}from"../../renderer";import{computeTrailPoints as g}from"../core";const D=40;export function createTrailManager(l,c){const s=new Map;function f(t){return`trail#${t}`}function u(t){if(!t.dotDefs.length)return;const e=l.touchLayer(t.layerName),n=new Set(t.dotDefs);e.children=e.children.filter(r=>!n.has(r)),t.dotDefs=[]}function i(t){const e=l.touchLayer(t.layerName),n=c.scale,r=D*n,a=g(t.from,t.to,r),o=t.canvas,h=a.map(m=>w(o,d(m.x,m.y,o.width,o.height,n)));u(t),e.children.push(...h),t.dotDefs=h}function y(t){const e=s.get(t);e&&(u(e),c.ptScaleRegistry.unregisterByName(f(t)),s.delete(t))}return{setTrail(t,e,n,r){if(e===null||n===null){y(t);return}if(!r)throw new Error(`renderer: setTrail("${t}") requires options when from/to are non-null`);const a=s.get(t);if(a){if(a.canvas!==r.canvas||a.layerName!==r.layer)throw new Error(`renderer: trail "${t}" cannot change canvas or layer after first call`);a.from=e,a.to=n,i(a);return}const o={from:e,to:n,canvas:r.canvas,layerName:r.layer,dotDefs:[]};s.set(t,o),c.onPtScale(f(t),()=>(i(o),l.touchLayer(o.layerName))),i(o)},destroy(){for(const t of[...s.keys()])y(t)}}}
|
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* renderer public types.
|
|
3
|
+
*
|
|
4
|
+
* Generic, domain-neutral renderer abstraction over @expofp/renderer.
|
|
5
|
+
* Knows nothing about wayfinding domain (source/destination/transition/kiosk).
|
|
6
|
+
*/
|
|
7
|
+
export interface Point {
|
|
8
|
+
readonly x: number;
|
|
9
|
+
readonly y: number;
|
|
10
|
+
}
|
|
11
|
+
export interface RouteColors {
|
|
12
|
+
readonly passed: string;
|
|
13
|
+
readonly remaining: string;
|
|
14
|
+
readonly active: string;
|
|
15
|
+
}
|
|
16
|
+
export interface IconConfig {
|
|
17
|
+
readonly canvas: HTMLCanvasElement;
|
|
18
|
+
/**
|
|
19
|
+
* Target layer name in the scene. Renderer locates the layer once per
|
|
20
|
+
* (name, layer) slot and reuses it.
|
|
21
|
+
*
|
|
22
|
+
* TODO(future): when renderer learns to create layers dynamically
|
|
23
|
+
* inside `createWayfindingRenderer`, this field is removed — renderer
|
|
24
|
+
* will own layer creation by icon name.
|
|
25
|
+
*/
|
|
26
|
+
readonly layer: string;
|
|
27
|
+
readonly x: number;
|
|
28
|
+
readonly y: number;
|
|
29
|
+
/** Rotation in radians. */
|
|
30
|
+
readonly rotation?: number;
|
|
31
|
+
readonly hidden?: boolean;
|
|
32
|
+
readonly dimmed?: boolean;
|
|
33
|
+
/**
|
|
34
|
+
* Anchor point [0..1, 0..1]. Set at first setIcon for an icon key;
|
|
35
|
+
* ignored on subsequent updates (origin is fixed in ImageDef at creation).
|
|
36
|
+
*/
|
|
37
|
+
readonly origin?: [number, number];
|
|
38
|
+
/**
|
|
39
|
+
* When true, renderer registers a camera-roll handler that snaps the icon
|
|
40
|
+
* rotation to the nearest cardinal direction (N/S/E/W, 90° steps) as the
|
|
41
|
+
* camera rotates past 45° thresholds. Used for label-like icons
|
|
42
|
+
* (source/destination/transition) that should remain readable.
|
|
43
|
+
*
|
|
44
|
+
* Do NOT enable for icons whose `rotation` carries meaning (e.g. position
|
|
45
|
+
* arrow heading, kiosk heading) — the snap would override that meaning.
|
|
46
|
+
*
|
|
47
|
+
* Set at first setIcon for an icon key; ignored on subsequent updates.
|
|
48
|
+
*/
|
|
49
|
+
readonly cardinalSnap?: boolean;
|
|
50
|
+
readonly onClick?: () => void;
|
|
51
|
+
}
|
|
52
|
+
export interface WayfindingRendererConfig {
|
|
53
|
+
/** Optional color overrides; defaults applied if omitted. */
|
|
54
|
+
readonly colors?: Partial<RouteColors>;
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* WayfindingRenderer — generic ImageDef/LineDef renderer for wayfinding visuals.
|
|
58
|
+
*
|
|
59
|
+
* **Batching contract**: every mutator method (`setIcon`, `clearIcons`,
|
|
60
|
+
* `setTrail`, `setRouteLines`, `clearRoute`) only mutates
|
|
61
|
+
* internal state and scene-graph data structures. None of them push changes
|
|
62
|
+
* to `RendererService`. The caller MUST call `flush()` after a batch of
|
|
63
|
+
* mutations to commit them. This lets the caller group many changes into
|
|
64
|
+
* one render frame.
|
|
65
|
+
*
|
|
66
|
+
* Exceptions: animation tick + camera-scale handlers update the renderer
|
|
67
|
+
* directly because they fire asynchronously, outside any caller batch.
|
|
68
|
+
*/
|
|
69
|
+
export interface WayfindingRenderer {
|
|
70
|
+
/**
|
|
71
|
+
* Place or update an icon by `name`. `key` distinguishes multiple
|
|
72
|
+
* instances sharing the same name (transitions, kiosks).
|
|
73
|
+
*
|
|
74
|
+
* First call with a (name, key) pair creates an ImageDef in `config.layer`,
|
|
75
|
+
* registers a scale handler (and a roll handler if `cardinalSnap`), and
|
|
76
|
+
* stores the icon. Subsequent calls mutate the existing ImageDef in place
|
|
77
|
+
* (bounds, hidden, dim, onClick, source).
|
|
78
|
+
*
|
|
79
|
+
* Pass `config: null` to hide that icon (ImageDef stays alive for reuse).
|
|
80
|
+
*
|
|
81
|
+
* `config.layer` MUST stay stable for the same (name, key) — changing it
|
|
82
|
+
* after first call throws.
|
|
83
|
+
*
|
|
84
|
+
* **Buffered**: call `flush()` to commit.
|
|
85
|
+
*/
|
|
86
|
+
setIcon(name: string, config: IconConfig | null, key?: string | number): void;
|
|
87
|
+
/**
|
|
88
|
+
* Hide every icon that shares one of the given `names`. ImageDefs stay
|
|
89
|
+
* alive for reuse on next `setIcon`.
|
|
90
|
+
*
|
|
91
|
+
* **Buffered**: call `flush()` to commit.
|
|
92
|
+
*/
|
|
93
|
+
clearIcons(names: string | ReadonlyArray<string>): void;
|
|
94
|
+
/**
|
|
95
|
+
* Place or update a named trail of dots between two points. Multiple
|
|
96
|
+
* trails can coexist (e.g. one from-side, one to-side, possibly on
|
|
97
|
+
* different layers / floors). `name` identifies the trail; subsequent
|
|
98
|
+
* calls with the same `name` reuse its scale handler and replace its dots.
|
|
99
|
+
*
|
|
100
|
+
* Dot interval is fixed (visual constant). Renderer regenerates dots
|
|
101
|
+
* whenever the camera scale changes — count adapts so spacing stays
|
|
102
|
+
* constant.
|
|
103
|
+
*
|
|
104
|
+
* `options` is required when `from`/`to` are non-null. Pass both as `null`
|
|
105
|
+
* to clear that trail (no `options` needed).
|
|
106
|
+
*
|
|
107
|
+
* `options.canvas` and `options.layer` MUST stay stable for a given
|
|
108
|
+
* `name` — changing them after first call throws.
|
|
109
|
+
*
|
|
110
|
+
* **Buffered**: call `flush()` to commit.
|
|
111
|
+
*/
|
|
112
|
+
setTrail(name: string, from: Point | null, to: Point | null, options?: {
|
|
113
|
+
readonly canvas: HTMLCanvasElement;
|
|
114
|
+
readonly layer: string;
|
|
115
|
+
}): void;
|
|
116
|
+
/**
|
|
117
|
+
* Replace the static route lines (passed + remaining) and (re)start the
|
|
118
|
+
* animation on the remaining segment.
|
|
119
|
+
*
|
|
120
|
+
* **Buffered**: call `flush()` to commit. The animation tick itself
|
|
121
|
+
* updates the renderer directly (it runs async outside caller batches).
|
|
122
|
+
*/
|
|
123
|
+
setRouteLines(passed: ReadonlyArray<{
|
|
124
|
+
readonly p0: Point;
|
|
125
|
+
readonly p1: Point;
|
|
126
|
+
}>, remaining: ReadonlyArray<{
|
|
127
|
+
readonly p0: Point;
|
|
128
|
+
readonly p1: Point;
|
|
129
|
+
}>, options: {
|
|
130
|
+
/**
|
|
131
|
+
* TODO(future): remove. renderer will create this layer
|
|
132
|
+
* dynamically inside `createWayfindingRenderer` — caller will no
|
|
133
|
+
* longer pass layer names per call.
|
|
134
|
+
*/
|
|
135
|
+
readonly linesLayer: string;
|
|
136
|
+
/**
|
|
137
|
+
* TODO(future): remove. Same as above — animated lines layer will
|
|
138
|
+
* be created in `createWayfindingRenderer`.
|
|
139
|
+
*/
|
|
140
|
+
readonly animatedLinesLayer: string;
|
|
141
|
+
readonly resetAnimation?: boolean;
|
|
142
|
+
}): void;
|
|
143
|
+
/**
|
|
144
|
+
* Clear route lines, drop all trails, hide all icons. Icon ImageDefs stay
|
|
145
|
+
* alive for reuse; trail records and their scale handlers are removed.
|
|
146
|
+
*
|
|
147
|
+
* **Buffered**: call `flush()` to commit.
|
|
148
|
+
*/
|
|
149
|
+
clearRoute(): void;
|
|
150
|
+
/**
|
|
151
|
+
* Commit all buffered mutations to `RendererService`. Pushes every layer
|
|
152
|
+
* touched since the last `flush()` (or since construction).
|
|
153
|
+
*/
|
|
154
|
+
flush(): void;
|
|
155
|
+
/**
|
|
156
|
+
* Full teardown: `clearRoute()` + remove DOM listeners + unregister all
|
|
157
|
+
* scale and roll handlers. Does NOT call `flush()` — the renderer is
|
|
158
|
+
* going away, so committing pending changes is the caller's choice.
|
|
159
|
+
*/
|
|
160
|
+
destroy(): void;
|
|
161
|
+
}
|
|
162
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { WayfindingRuntime, WayfindingRuntimeConfig } from "./types";
|
|
2
|
+
export declare function createWayfindingRuntime({ engine, renderer, iconProvider, floorContext, layers, snapThreshold, onTransitionClick, onRouteUpdate, onRouteDistance, }: WayfindingRuntimeConfig): WayfindingRuntime;
|
|
3
|
+
//# sourceMappingURL=createWayfindingRuntime.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{getRouteLength as B,snapToRoute as G}from"../core";import{getRouteLines as H}from"./getRouteLines";import{createEndpointView as J}from"./endpointView";import{createPositionTrailView as K}from"./positionTrailView";import{createRouteLinesView as N}from"./routeLinesView";import{computeRouteRenderData as O}from"./routeRenderData";import{computeRouteUpdate as Q}from"./routeUpdate";import{createTrailView as X}from"./trailView";import{createTransitionView as Y}from"./transitionView";const Z=g=>g.flatMap(i=>[i.p0,i.p1]);export function createWayfindingRuntime({engine:g,renderer:i,iconProvider:h,floorContext:s,layers:a,snapThreshold:b,onTransitionClick:E,onRouteUpdate:d,onRouteDistance:m}){const L=J({renderer:i,iconProvider:h,floorContext:s,layer:a.points}),y=Y({renderer:i,iconProvider:h,floorContext:s,onTransitionClick:E,layer:a.points}),M=X({renderer:i,iconProvider:h,floorContext:s,layer:a.trail}),u=K({renderer:i,iconProvider:h,floorContext:s,trails:M,iconLayer:a.points,snapThreshold:b}),F=N({renderer:i,linesLayer:a.lines,animatedLinesLayer:a.linesAnimated});let o=[],e=null,r=null,l=null,c=0;function P(){return s.showAllFloors()?null:s.getActiveFloor()}function A(){const t=P();return t===null?o.filter(n=>!n.virtual):o.filter(n=>n.p0.layer===t&&!n.virtual)}function R(){if(!e||!r)return null;const t=A();return t.length?{from:e,to:r,routePoints:Z(t),visibleLines:t}:null}function f(t,n=!1){if(!e||!r)return;const p=O({routeLines:o,currentRouteLayer:P(),from:e,to:r,snap:t});F.draw(p,n),c=p.distance}function v(){if(!e||!r)return;const t=R();if(!t){L.hide(),y.clear(),u.refreshTrail(null),f();return}L.place(e,r,t.routePoints),y.place(o),f(),u.refreshTrail(t)}function T(){if(!l||!e||!r)return;const t=o.filter(p=>!p.virtual);if(!t.length)return;const n=R();return n?u.applyToRoute(l,n,t):(u.refreshTrail(null),G({x:l.x,y:l.y,z:l.layer||null},t,{snapThreshold:b,from:e,to:r}))}function I(){const t=Q(o,A());return d(t.lines,t.bounds),t}function S({from:t,to:n,waypoints:p,accessible:k}){const z=H({engine:g,from:t,to:n,waypoints:p,accessible:k});if(!z.length){V();return}e=t,r=n,o=z,v();const{lines:q}=I(),w=T();w&&f(w,!0),m(w?c:B(q)),i.flush()}function U(t){if(l=t,!t){u.hideIcon(),u.refreshTrail(R()),f(),m(c),i.flush();return}u.placeIcon(t);const n=T();n&&f(n,!0),m(c),i.flush()}function W(){v();const t=T();t&&f(t,!0),o.length&&I(),m(c),i.flush()}function V(){o=[],e=null,r=null,c=0,L.hide(),y.clear(),u.clearTrail(),F.clear(),d([],null),m(0),i.flush()}function j(){V(),l=null,i.destroy()}return{setRoute:S,onPositionChanged:U,onFloorChanged:W,clearRoute:V,destroy:j}}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { IconProvider } from "../adapters";
|
|
2
|
+
import type { RouteEndpoint, RoutePoint } from "../core";
|
|
3
|
+
import type { WayfindingRenderer } from "../renderer";
|
|
4
|
+
import type { FloorContext } from "./types";
|
|
5
|
+
interface EndpointView {
|
|
6
|
+
place(from: RouteEndpoint, to: RouteEndpoint, visibleRoutePoints: ReadonlyArray<RoutePoint>): void;
|
|
7
|
+
hide(): void;
|
|
8
|
+
}
|
|
9
|
+
export declare function createEndpointView({ renderer, iconProvider, floorContext, layer, }: {
|
|
10
|
+
renderer: WayfindingRenderer;
|
|
11
|
+
iconProvider: IconProvider;
|
|
12
|
+
floorContext: FloorContext;
|
|
13
|
+
layer: string;
|
|
14
|
+
}): EndpointView;
|
|
15
|
+
export {};
|
|
16
|
+
//# sourceMappingURL=endpointView.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export function createEndpointView({renderer:n,iconProvider:c,floorContext:s,layer:t}){return{place(o,e,a){if(!a.length)return;const i=s.isLayerVisible(o.layer),d=s.isLayerVisible(e.layer),l=a[a.length-1],u=a[0];n.setIcon("source",{canvas:c.getIcon("source").canvas,layer:t,x:l.x,y:l.y,hidden:!i||!o.bounds,dimmed:!i,cardinalSnap:!0}),n.setIcon("destination",{canvas:c.getIcon("destination").canvas,layer:t,x:u.x,y:u.y,hidden:!d||!e.bounds,dimmed:!d,cardinalSnap:!0})},hide(){n.setIcon("source",null),n.setIcon("destination",null)}}}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { RouteEndpoint, RouteLine, WayfindingEngine } from "../core";
|
|
2
|
+
/**
|
|
3
|
+
* Choose between `engine.buildRoute` and `engine.buildWaypointsRoute` based on
|
|
4
|
+
* whether intermediate waypoints are supplied, and return the resulting route lines.
|
|
5
|
+
*/
|
|
6
|
+
export declare function getRouteLines({ engine, from, to, waypoints, accessible, }: {
|
|
7
|
+
readonly engine: WayfindingEngine;
|
|
8
|
+
readonly from: RouteEndpoint;
|
|
9
|
+
readonly to: RouteEndpoint;
|
|
10
|
+
readonly waypoints?: ReadonlyArray<RouteEndpoint>;
|
|
11
|
+
readonly accessible: boolean;
|
|
12
|
+
}): RouteLine[];
|
|
13
|
+
//# sourceMappingURL=getRouteLines.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export function getRouteLines({engine:t,from:u,to:e,waypoints:n,accessible:i}){return n?.length?t.buildWaypointsRoute([u,...n,e],{accessible:i}).lines:t.buildRoute(u,e,{accessible:i}).lines}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import type { IconProvider } from "../adapters";
|
|
2
|
+
import type { RouteEndpoint, RouteLine, RoutePoint, RouteSnapResult } from "../core";
|
|
3
|
+
import type { WayfindingRenderer } from "../renderer";
|
|
4
|
+
import type { FloorContext, PositionInput } from "./types";
|
|
5
|
+
import type { TrailView } from "./trailView";
|
|
6
|
+
/**
|
|
7
|
+
* Snapshot of the visible route the position-trail view operates on. The
|
|
8
|
+
* runtime computes it (visibility filtering, route-points derivation) and
|
|
9
|
+
* passes it in so the view stays free of route-state knowledge.
|
|
10
|
+
*/
|
|
11
|
+
export interface RouteSnapshot {
|
|
12
|
+
readonly from: RouteEndpoint;
|
|
13
|
+
readonly to: RouteEndpoint;
|
|
14
|
+
readonly routePoints: ReadonlyArray<RoutePoint>;
|
|
15
|
+
readonly visibleLines: ReadonlyArray<RouteLine>;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Owns the user-position icon and the single shared trail slot. The two
|
|
19
|
+
* trail variants — off-graph endpoint trail (when an endpoint has no
|
|
20
|
+
* `bounds`) and off-route position trail — are mutually exclusive and reuse
|
|
21
|
+
* the same slot, so a single owner keeps the state machine simple.
|
|
22
|
+
*/
|
|
23
|
+
interface PositionTrailView {
|
|
24
|
+
/** Place the position icon at the raw position. */
|
|
25
|
+
placeIcon(position: PositionInput): void;
|
|
26
|
+
/** Hide the position icon. */
|
|
27
|
+
hideIcon(): void;
|
|
28
|
+
/**
|
|
29
|
+
* Snap the position to `routeLines` (caller-provided — typically the full
|
|
30
|
+
* non-virtual route across all floors) and update the trail slot.
|
|
31
|
+
* - Snapped: icon moves to the snap point; the off-graph endpoint trail
|
|
32
|
+
* is restored (or cleared when neither endpoint is off-graph).
|
|
33
|
+
* - Off-route: a trail is drawn from the position to the nearest end of
|
|
34
|
+
* the visible route; the icon stays where it was last placed.
|
|
35
|
+
*
|
|
36
|
+
* `routeLines` is decoupled from `route.visibleLines` so the snap stays
|
|
37
|
+
* correct regardless of which floor is currently selected in the UI.
|
|
38
|
+
*/
|
|
39
|
+
applyToRoute(position: PositionInput, route: RouteSnapshot, routeLines: ReadonlyArray<RouteLine>): RouteSnapResult;
|
|
40
|
+
/**
|
|
41
|
+
* Re-evaluate the trail when no position is active. Restores the
|
|
42
|
+
* off-graph endpoint trail when applicable; otherwise clears the slot.
|
|
43
|
+
*/
|
|
44
|
+
refreshTrail(route: RouteSnapshot | null): void;
|
|
45
|
+
/** Clear the trail slot (does not touch the icon). */
|
|
46
|
+
clearTrail(): void;
|
|
47
|
+
}
|
|
48
|
+
export declare function createPositionTrailView({ renderer, iconProvider, floorContext, trails, iconLayer, snapThreshold, }: {
|
|
49
|
+
renderer: WayfindingRenderer;
|
|
50
|
+
iconProvider: IconProvider;
|
|
51
|
+
floorContext: FloorContext;
|
|
52
|
+
trails: TrailView;
|
|
53
|
+
iconLayer: string;
|
|
54
|
+
snapThreshold: number;
|
|
55
|
+
}): PositionTrailView;
|
|
56
|
+
export {};
|
|
57
|
+
//# sourceMappingURL=positionTrailView.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{snapToRoute as P}from"../core";import{createPositionView as h}from"./positionView";const a="trail";export function createPositionTrailView({renderer:o,iconProvider:f,floorContext:y,trails:n,iconLayer:t,snapThreshold:p}){const c=h({renderer:o,iconProvider:f,layer:t});function i(e){if(!e.routePoints.length){n.clear(a);return}if(!e.from.bounds){n.place(a,e.routePoints[e.routePoints.length-1],{x:e.from.x,y:e.from.y,layer:e.from.layer});return}if(!e.to.bounds){n.place(a,e.routePoints[0],{x:e.to.x,y:e.to.y,layer:e.to.layer});return}n.clear(a)}return{placeIcon(e){const r=!y.isLayerVisible(e.layer);c.place(e,r)},hideIcon(){c.hide()},applyToRoute(e,r,s){const l=P({x:e.x,y:e.y,z:e.layer||null},[...s],{snapThreshold:p,from:r.from,to:r.to});if(l.snapped){i(r);const d=!y.isLayerVisible(e.layer);return c.place({...e,x:l.snappedPoint.x,y:l.snappedPoint.y},d),l}return r.routePoints.length?n.place(a,{x:e.x,y:e.y,layer:e.layer},r.routePoints[r.routePoints.length-1]):n.clear(a),l},refreshTrail(e){if(!e){n.clear(a);return}i(e)},clearTrail(){n.clear(a)}}}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { IconProvider } from "../adapters";
|
|
2
|
+
import type { WayfindingRenderer } from "../renderer";
|
|
3
|
+
import type { PositionInput } from "./types";
|
|
4
|
+
interface PositionView {
|
|
5
|
+
/**
|
|
6
|
+
* Place or update the current-position icon. The icon variant (dot vs
|
|
7
|
+
* arrow) is derived from `input.angle`: finite angle → arrow, otherwise
|
|
8
|
+
* → dot.
|
|
9
|
+
*
|
|
10
|
+
* `hidden` collapses the monolith's dual (hidden, dimmed) fields into a
|
|
11
|
+
* single boolean — they were always driven by the same
|
|
12
|
+
* `!isLayerVisible(position.layer)` source.
|
|
13
|
+
*/
|
|
14
|
+
place(input: PositionInput, hidden: boolean): void;
|
|
15
|
+
hide(): void;
|
|
16
|
+
}
|
|
17
|
+
export declare function createPositionView({ renderer, iconProvider, layer, }: {
|
|
18
|
+
renderer: WayfindingRenderer;
|
|
19
|
+
iconProvider: IconProvider;
|
|
20
|
+
layer: string;
|
|
21
|
+
}): PositionView;
|
|
22
|
+
export {};
|
|
23
|
+
//# sourceMappingURL=positionView.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const c="position";export function createPositionView({renderer:o,iconProvider:a,layer:i}){return{place(n,e){const t=Number.isFinite(n.angle),s=t?"current_arrow":"current",r=t?n.angle*Math.PI/180:void 0;o.setIcon(c,{canvas:a.getIcon(s).canvas,layer:i,x:n.x,y:n.y,rotation:r,hidden:e,dimmed:e,origin:[.5,.5]})},hide(){o.setIcon(c,null)}}}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { RouteLine } from "../core";
|
|
2
|
+
import type { WayfindingRenderer } from "../renderer";
|
|
3
|
+
interface RouteLinesView {
|
|
4
|
+
/** Push pre-split passed/remaining route lines to the renderer. */
|
|
5
|
+
draw(data: {
|
|
6
|
+
readonly passed: RouteLine[];
|
|
7
|
+
readonly remaining: RouteLine[];
|
|
8
|
+
}, preserveProgress?: boolean): void;
|
|
9
|
+
/** Clear all rendered route lines + animated segments. */
|
|
10
|
+
clear(): void;
|
|
11
|
+
}
|
|
12
|
+
export declare function createRouteLinesView({ renderer, linesLayer, animatedLinesLayer, }: {
|
|
13
|
+
renderer: WayfindingRenderer;
|
|
14
|
+
linesLayer: string;
|
|
15
|
+
animatedLinesLayer: string;
|
|
16
|
+
}): RouteLinesView;
|
|
17
|
+
export {};
|
|
18
|
+
//# sourceMappingURL=routeLinesView.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export function createRouteLinesView({renderer:t,linesLayer:e,animatedLinesLayer:o}){return{draw({passed:i,remaining:n},s=!1){t.setRouteLines(i,n,{linesLayer:e,animatedLinesLayer:o,resetAnimation:!s})},clear(){t.setRouteLines([],[],{linesLayer:e,animatedLinesLayer:o,resetAnimation:!0})}}}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { RouteEndpoint, RouteLine, RouteSnapResult } from "../core";
|
|
2
|
+
interface RouteRenderData {
|
|
3
|
+
/** Route lines behind the current user position (empty when no snap). */
|
|
4
|
+
readonly passed: RouteLine[];
|
|
5
|
+
/** Route lines ahead of the current user position (the full normalized route when no snap). */
|
|
6
|
+
readonly remaining: RouteLine[];
|
|
7
|
+
/** Remaining route distance along the polyline. */
|
|
8
|
+
readonly distance: number;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Pure pipeline that produces the data needed to render the route: the
|
|
12
|
+
* passed/remaining split for the visible floor plus the remaining
|
|
13
|
+
* distance to the destination.
|
|
14
|
+
*
|
|
15
|
+
* The full non-virtual route is normalized to from→to direction once and
|
|
16
|
+
* sliced down to the visible floor for rendering. The remaining distance
|
|
17
|
+
* is read from `snap.distance` (computed once inside `snapToRoute`); when
|
|
18
|
+
* no snap is active we fall back to the full route length.
|
|
19
|
+
*/
|
|
20
|
+
export declare function computeRouteRenderData({ routeLines, currentRouteLayer, from, to, snap, }: {
|
|
21
|
+
readonly routeLines: RouteLine[];
|
|
22
|
+
/** null = show-all mode; otherwise the active route floor. */
|
|
23
|
+
readonly currentRouteLayer: string | null;
|
|
24
|
+
readonly from: RouteEndpoint;
|
|
25
|
+
readonly to: RouteEndpoint;
|
|
26
|
+
readonly snap: RouteSnapResult | undefined;
|
|
27
|
+
}): RouteRenderData;
|
|
28
|
+
export {};
|
|
29
|
+
//# sourceMappingURL=routeRenderData.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{getRouteLength as p,normalizeRouteDirection as u,splitRouteByPoint as m}from"../core";export function computeRouteRenderData({routeLines:s,currentRouteLayer:o,from:d,to:a,snap:t}){const i=u(s.filter(r=>!r.virtual),d,a),n=o===null?i:i.filter(r=>r.p0.layer===o);if(!t?.snapped)return{passed:[],remaining:n,distance:p(i)};const{passed:c,remaining:e}=m(n,t.snappedPoint),l=e!==n&&e.length>0?[{...e[0],p0:t.snappedPoint},...e.slice(1)]:e;return{passed:c,remaining:l,distance:t.distance}}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { BoundingBox, RouteLine } from "../core";
|
|
2
|
+
/**
|
|
3
|
+
* Compute the payload for the runtime's `onRouteUpdate` callback:
|
|
4
|
+
* - `lines`: route lines as the consumer sees them — virtual graph-internal
|
|
5
|
+
* segments are filtered out before publication.
|
|
6
|
+
* - `bounds`: bounding box over the visible route points, or `null` when
|
|
7
|
+
* the route is empty or collapses to a single point (no useful viewport
|
|
8
|
+
* to fit).
|
|
9
|
+
*/
|
|
10
|
+
export declare function computeRouteUpdate(routeLines: ReadonlyArray<RouteLine>, visibleLines: ReadonlyArray<RouteLine>): {
|
|
11
|
+
lines: RouteLine[];
|
|
12
|
+
bounds: BoundingBox | null;
|
|
13
|
+
};
|
|
14
|
+
//# sourceMappingURL=routeUpdate.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{computeBoundingBox as p}from"../core";export function computeRouteUpdate(u,r){const n=u.filter(t=>!t.virtual),e=r.flatMap(t=>[t.p0,t.p1]),o=p(e);return o?o.x1===o.x2&&o.y1===o.y2?{lines:n,bounds:null}:{lines:n,bounds:o}:{lines:n,bounds:null}}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { IconProvider } from "../adapters";
|
|
2
|
+
import type { RoutePoint } from "../core";
|
|
3
|
+
import type { WayfindingRenderer } from "../renderer";
|
|
4
|
+
import type { FloorContext } from "./types";
|
|
5
|
+
/**
|
|
6
|
+
* Callers choose the slot name and provide two route-points; the view draws a dotted trail between them (or hides
|
|
7
|
+
* them if the layers are not on the active floor)
|
|
8
|
+
*/
|
|
9
|
+
export interface TrailView {
|
|
10
|
+
/** Draws dotted points between two route-points in the named slot. */
|
|
11
|
+
place(slot: string, from: RoutePoint, to: RoutePoint): void;
|
|
12
|
+
clear(slot: string): void;
|
|
13
|
+
clearAll(): void;
|
|
14
|
+
}
|
|
15
|
+
export declare function createTrailView({ renderer, iconProvider, floorContext, layer, }: {
|
|
16
|
+
renderer: WayfindingRenderer;
|
|
17
|
+
iconProvider: IconProvider;
|
|
18
|
+
floorContext: FloorContext;
|
|
19
|
+
layer: string;
|
|
20
|
+
}): TrailView;
|
|
21
|
+
//# sourceMappingURL=trailView.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export function createTrailView({renderer:r,iconProvider:c,floorContext:i,layer:u}){const a=new Set;function o(l,t){if(i.showAllFloors())return!0;const e=i.getActiveFloor();return e?l===e&&t===e:!1}function n(l){r.setTrail(l,null,null),a.delete(l)}return{place(l,t,e){if(!o(t.layer,e.layer)){n(l);return}r.setTrail(l,t,e,{canvas:c.getIcon("trail").canvas,layer:u}),a.add(l)},clear(l){n(l)},clearAll(){for(const l of a)r.setTrail(l,null,null);a.clear()}}}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { IconProvider } from "../adapters";
|
|
2
|
+
import type { RouteLine, TransitionPointDef } from "../core";
|
|
3
|
+
import type { WayfindingRenderer } from "../renderer";
|
|
4
|
+
import type { FloorContext } from "./types";
|
|
5
|
+
interface TransitionView {
|
|
6
|
+
/** Recomputes transition points from route lines + floor context and places their icons. */
|
|
7
|
+
place(routeLines: RouteLine[]): void;
|
|
8
|
+
clear(): void;
|
|
9
|
+
}
|
|
10
|
+
export declare function createTransitionView({ renderer, iconProvider, floorContext, onTransitionClick, layer, }: {
|
|
11
|
+
renderer: WayfindingRenderer;
|
|
12
|
+
iconProvider: IconProvider;
|
|
13
|
+
floorContext: FloorContext;
|
|
14
|
+
onTransitionClick: (point: TransitionPointDef) => void;
|
|
15
|
+
layer: string;
|
|
16
|
+
}): TransitionView;
|
|
17
|
+
export {};
|
|
18
|
+
//# sourceMappingURL=transitionView.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{computeTransitionPoints as f}from"../core";const a="transition";export function createTransitionView({renderer:t,iconProvider:r,floorContext:i,onTransitionClick:c,layer:s}){return{place(l){t.clearIcons(a);let e;if(i.showAllFloors())e=null;else{const o=i.getActiveFloor();if(!o)return;e=o}const u=f({routeLines:l,currentLayerName:e,floorOrder:i.getFloorOrder()});for(const[o,n]of u.entries())t.setIcon(a,{canvas:r.getIcon(p(n.role,n.direction)).canvas,layer:s,x:n.x,y:n.y,cardinalSnap:!0,onClick:n.role==="exit"?()=>c(n):void 0},o)},clear(){t.clearIcons(a)}}}function p(t,r){return t==="entry"?"transition_entry":r==="up"?"transition_up":r==="down"?"transition_down":"transition"}
|