UNPKG

@expofp/floorplan

Version:

Interactive floor plan library for expos and events

2 lines (1 loc) • 990 B
import{setConfig as u}from"@expofp/config";import{vi as t}from"vitest";let a={};async function s(o={}){f();const{default:e}=await import("../store/UIState.js"),r={fp:{},...o};return r.uiState=a=new e(r),r}export async function createUIState(o={}){return(await s(o)).uiState}export async function createRouteStore(o={}){const e=await s({fp:{},moveToList:t.fn(),showMap:t.fn(),layerStore:{layers:[],updateVisibility:t.fn(),findLayer:t.fn(()=>null)},...o}),{default:r,Route:i}=await import("../store/RouteStore.js"),n=new r(e);return e.routeStore=n,{routeStore:n,uiState:e.uiState,rootStore:e,Route:i}}function f(){window.__efpEvent="demo",HTMLCanvasElement.prototype.getContext=(()=>new Proxy({},{get:()=>()=>{}})),t.doMock("../store/index.js",()=>({get uiState(){return a}})),t.doMock("../data/svg.js",()=>({svgArea:()=>null,svgAreaExplicit:()=>null})),t.doMock("../tools/gtag.js",()=>({hasUserConsent:()=>!1,sendEventToGa:t.fn(),GaEventActions:{}})),u({fpSvgJsRef:{},fpSvgLayerJsRefs:{}})}