atriusmaps-node-sdk 3.3.1056 → 3.3.1057
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/cjs/nodesdk/nodeEntry.js +17 -12
- package/dist/cjs/package.json.js +1 -1
- package/dist/cjs/src/app.js +1 -1
- package/dist/nodesdk/nodeEntry.js +1 -1
- package/dist/package.json.js +1 -1
- package/dist/src/app.js +1 -1
- package/dist/types/nodesdk/nodeEntry.d.ts +12 -0
- package/dist/types/nodesdk/nodeEntryCjs.d.cts +10 -0
- package/dist/types/plugins/monitoring/src/index.d.ts +1 -0
- package/dist/types/plugins/monitoring/src/monitoring.d.ts +34 -0
- package/dist/types/plugins/online/homeView/constants.d.ts +9 -0
- package/dist/types/plugins/sdkServer/src/prepareSDKConfig.d.ts +3 -0
- package/dist/types/plugins/sdkServer/src/publicTypes.d.ts +71 -0
- package/dist/types/plugins/sdkServer/src/types.d.ts +70 -0
- package/dist/types/plugins/wayfinder/src/navGraphDebug.d.ts +37 -0
- package/dist/types/src/LoadingIndicator.d.ts +11 -0
- package/dist/types/src/SystemErrorBoundary.d.ts +18 -0
- package/dist/types/src/app.d.ts +62 -0
- package/dist/types/src/configs/postproc-mol-url-parms.d.ts +3 -0
- package/dist/types/src/configs/postproc-stateTracking.d.ts +10 -0
- package/dist/types/src/controller.d.ts +13 -0
- package/dist/types/src/debugTools.d.ts +27 -0
- package/dist/types/src/env.d.ts +9 -0
- package/dist/types/src/extModules/bustle.d.ts +31 -0
- package/dist/types/src/extModules/log.d.ts +30 -0
- package/dist/types/src/historyManager.d.ts +4 -0
- package/dist/types/src/hooks/useCSSColors.d.ts +14 -0
- package/dist/types/src/layerManager.d.ts +3 -0
- package/dist/types/src/layouts/SpeedDial.d.ts +14 -0
- package/dist/types/src/layouts/fullscreenOnlyLayout.d.ts +10 -0
- package/dist/types/src/layouts/mapOnlyLayout.d.ts +2 -0
- package/dist/types/src/layouts/modEditorLayout.d.ts +2 -0
- package/dist/types/src/layouts/modLayout.d.ts +2 -0
- package/dist/types/src/layouts/searchDirectoryLayout.d.ts +2 -0
- package/dist/types/src/layouts/standardLayout.d.ts +2 -0
- package/dist/types/src/main.d.ts +2 -0
- package/dist/types/src/theme.d.ts +6 -0
- package/dist/types/src/themeManager.d.ts +29 -0
- package/dist/types/src/types/bus.d.ts +380 -0
- package/dist/types/src/types/layout.d.ts +56 -0
- package/dist/types/src/types/plugin-runtime.d.ts +91 -0
- package/dist/types/src/types/theme.d.ts +58 -0
- package/dist/types/src/ui/buttons/Button.d.ts +42 -0
- package/dist/types/src/ui/buttons/FloatingActionButton.d.ts +9 -0
- package/dist/types/src/ui/icons/Icon.d.ts +8 -0
- package/dist/types/src/ui/icons/iconRegistry.d.ts +53 -0
- package/dist/types/src/ui/icons/types.d.ts +47 -0
- package/dist/types/src/ui/icons/utils.d.ts +109 -0
- package/dist/types/src/ui/tageditorStyle.d.ts +2 -0
- package/dist/types/src/ui/tooltip/Tooltip.d.ts +16 -0
- package/dist/types/src/ui/tooltip/TooltipAnchor.d.ts +8 -0
- package/dist/types/src/ui/tooltip/index.d.ts +3 -0
- package/dist/types/src/utils/configUtils.d.ts +34 -0
- package/dist/types/src/utils/dom.d.ts +10 -0
- package/dist/types/src/utils/funcs.d.ts +36 -0
- package/dist/types/src/utils/i18n.d.ts +3 -0
- package/dist/types/src/utils/isInitialState.d.ts +6 -0
- package/dist/types/src/utils/mapElement.d.ts +54 -0
- package/dist/types/src/utils/modDefaultTheme.d.ts +164 -0
- package/dist/types/src/utils/molDesktopDefaultTheme.d.ts +156 -0
- package/dist/types/src/utils/observable.d.ts +17 -0
- package/dist/types/src/utils/stateObj.d.ts +31 -0
- package/dist/types/utils/constants.d.ts +31 -0
- package/dist/types/utils/findByLayoutId.d.ts +4 -0
- package/package.json +12 -4
|
@@ -16,7 +16,7 @@ function setupFetch(config) {
|
|
|
16
16
|
const httpsAgent = new https.Agent({ keepAlive: true });
|
|
17
17
|
const proxyAgent = config.proxy ? new httpsProxyAgent.HttpsProxyAgent(`http://${config.proxy.host}:${config.proxy.port}`) : null;
|
|
18
18
|
const agent = config.agent || proxyAgent || ((url) => url.protocol === "http:" ? httpAgent : httpsAgent);
|
|
19
|
-
global.fetch = async (url, options) => fetch(url, { ...options, agent });
|
|
19
|
+
global.fetch = (async (url, options) => fetch(url, { ...options, agent }));
|
|
20
20
|
}
|
|
21
21
|
let sdkLogging = false;
|
|
22
22
|
const pad2 = (x) => x.toString().length < 2 ? "0" + x : x;
|
|
@@ -42,20 +42,27 @@ function addCommands(map, commands) {
|
|
|
42
42
|
map[sig.command] = function(...args) {
|
|
43
43
|
const cob = { command: sig.command };
|
|
44
44
|
for (let i = 0; i < args.length; i++) {
|
|
45
|
-
|
|
45
|
+
const argDef = sig.args?.[i];
|
|
46
|
+
if (argDef?.name) {
|
|
47
|
+
cob[argDef.name] = args[i];
|
|
48
|
+
}
|
|
46
49
|
}
|
|
47
50
|
return map(cob);
|
|
48
51
|
};
|
|
49
52
|
});
|
|
50
53
|
}
|
|
51
54
|
async function newMap(sdkConfig) {
|
|
52
|
-
return new Promise((resolve) => {
|
|
55
|
+
return new Promise((resolve, reject) => {
|
|
53
56
|
sdkConfig.headless = true;
|
|
54
57
|
setupFetch(sdkConfig);
|
|
55
58
|
const config = prepareSDKConfig(sdkConfig);
|
|
56
|
-
config.plugins.monitoring =
|
|
59
|
+
config.plugins.monitoring = { active: false };
|
|
57
60
|
controller.create(config).then((app) => {
|
|
58
|
-
|
|
61
|
+
if (!app) {
|
|
62
|
+
reject(new Error("Atrius Maps engine failed to initialize."));
|
|
63
|
+
return;
|
|
64
|
+
}
|
|
65
|
+
const map = ((payload, arg2) => {
|
|
59
66
|
if (typeof payload === "string") {
|
|
60
67
|
payload = { ...arg2, command: payload };
|
|
61
68
|
}
|
|
@@ -67,16 +74,14 @@ async function newMap(sdkConfig) {
|
|
|
67
74
|
log("Error: ", e.message);
|
|
68
75
|
throw e;
|
|
69
76
|
});
|
|
70
|
-
};
|
|
77
|
+
});
|
|
71
78
|
observable(map);
|
|
72
|
-
app
|
|
79
|
+
const pluginApp = app;
|
|
80
|
+
pluginApp.eventListener?.observe?.((...args) => {
|
|
73
81
|
map.fire(...args);
|
|
74
82
|
});
|
|
75
|
-
map.on("ready", (
|
|
76
|
-
const {
|
|
77
|
-
commands
|
|
78
|
-
/*, customTypes */
|
|
79
|
-
} = data.commandJSON;
|
|
83
|
+
map.on("ready", (_eName, data) => {
|
|
84
|
+
const { commands } = data.commandJSON;
|
|
80
85
|
addCommands(map, commands);
|
|
81
86
|
resolve(map);
|
|
82
87
|
log("map ready");
|
package/dist/cjs/package.json.js
CHANGED
package/dist/cjs/src/app.js
CHANGED
|
@@ -90,7 +90,7 @@ const handleConfigPostProcess = async (config) => config.configPostProc ? series
|
|
|
90
90
|
async function create(rawConfig) {
|
|
91
91
|
const appInstance = /* @__PURE__ */ Object.create(null);
|
|
92
92
|
let config = rawConfig.extends ? await extendConfig(rawConfig, rawConfig.extends) : rawConfig;
|
|
93
|
-
if (config.plugins?.monitoring) {
|
|
93
|
+
if (config.plugins?.monitoring && config.plugins.monitoring.active !== false) {
|
|
94
94
|
const monConfig = config.plugins.monitoring;
|
|
95
95
|
try {
|
|
96
96
|
const mon = await Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespaceDefaultOnly(require('../_virtual/_empty_module_placeholder.js')); });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import e from"node:http";import t from"node:https";import{HttpsProxyAgent as n}from"https-proxy-agent";import o from"node-fetch";import r from"../package.json.js";import s from"../plugins/sdkServer/src/prepareSDKConfig.js";import{create as i}from"../src/controller.js";import c from"../src/utils/observable.js";const
|
|
1
|
+
import e from"node:http";import t from"node:https";import{HttpsProxyAgent as n}from"https-proxy-agent";import o from"node-fetch";import r from"../package.json.js";import s from"../plugins/sdkServer/src/prepareSDKConfig.js";import{create as i}from"../src/controller.js";import c from"../src/utils/observable.js";const a=r.version;let g=!1;const m=e=>e.toString().length<2?"0"+e:e,l=()=>`AtriusMaps Node SDK (${(()=>{const e=new Date;return`${e.getHours()}:${m(e.getMinutes())}:${m(e.getSeconds())}.${e.getMilliseconds()}`})()}): `,p=function(...e){if(g){let t=l()+Array.from(e).map(e=>"object"==typeof e?JSON.stringify(e):e).join(" ");const n=t.split("\n");n.length>1?t=n[0]+`… (+ ${n.length-1} lines)`:t.length>256&&(t=t.substring(0,255)+`… (length: ${t.length} chars)`),console.log(t)}};async function f(r){return new Promise((a,g)=>{r.headless=!0,function(r){const s=new e.Agent({keepAlive:!0}),i=new t.Agent({keepAlive:!0}),c=r.proxy?new n(`http://${r.proxy.host}:${r.proxy.port}`):null,a=r.agent||c||(e=>"http:"===e.protocol?s:i);global.fetch=async(e,t)=>o(e,{...t,agent:a})}(r);const m=s(r);m.plugins.monitoring={active:!1},i(m).then(e=>{if(!e)return void g(new Error("Atrius Maps engine failed to initialize."));const t=(t,n)=>("string"==typeof t&&(t={...n,command:t}),p("Sending command object: ",t),e.bus.get("clientAPI/execute",t).then(e=>(p("Received Message: ",e),e)).catch(e=>{throw p("Error: ",e.message),e}));c(t);const n=e;n.eventListener?.observe?.((...e)=>{t.fire(...e)}),t.on("ready",(e,n)=>{const{commands:o}=n.commandJSON;!function(e,t){t.forEach(t=>{e[t.command]=function(...n){const o={command:t.command};for(let e=0;e<n.length;e++){const r=t.args?.[e];r?.name&&(o[r.name]=n[e])}return e(o)}})}(t,o),a(t),p("map ready")})})})}const d={getVersion:()=>a,newMap:e=>f(e),setLogging:e=>{g=e,e&&p(`Atrius Maps JS SDK Client v${a} Logging enabled.`)}};export{d as default};
|
package/dist/package.json.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var a="3.3.
|
|
1
|
+
var a="3.3.1057",e={version:a};export{e as default,a as version};
|
package/dist/src/app.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{map as e,mergeDeepRight as n}from"ramda";import{evaluateResults as t}from"zousan/evaluate";import{series as o}from"zousan/series";import i from"./utils/i18n.js";import{startInitialStateListener as a}from"./utils/isInitialState.js";import{version as r}from"../package.json.js";import s from"./debugTools.js";import{buildEnv as l}from"./env.js";import{create as u}from"./extModules/bustle.js";import{initLog as c}from"./extModules/log.js";const g="undefined"!=typeof window;async function d(e,n,t){if(!t)return e.log.info(`Plugin ${n} explicitly disabled`),null;if(void 0!==t.active&&(!1===t.active||"notLocalhost"===t.active&&e.env.isLocalhost()))return e.log.info(`Plugin ${n} explicitly deativated`),null;return(n.includes("/")?(()=>{const[e,t]=n.split("/");return import(`../plugins/${e}/${t}/src/index.js`)})():import(`../plugins/${n}/src/index.js`)).then(o=>(e.log.info(`Creating plugin ${n}`),o.create(e,t)))}async function p(e){return g?import(`./configs/${e}.json`):import(`./configs/${e}.json.js`)}async function m(e,t){let o={};const i=await Promise.all(t.map(p));for(const e of i){let t=e.default;t=t.extends?await m(t,t.extends):t,o=n(o,t)}return o=n(o,e),o}const f=e=>n=>import(`./configs/postproc-${e}.ts`).then(e=>e.process(n));async function w(n){const p=Object.create(null);let w=n.extends?await m(n,n.extends):n;if(w.plugins?.monitoring){const e=w.plugins.monitoring;try{const n=await import("../_virtual/_empty_module_placeholder.js");await n.activate(e)}catch(e){const n=e instanceof Error?e.message:String(e);console.warn("Monitoring plugin failed to load (continuing without it):",n)}}w=await(async e=>e.configPostProc?o(e,...e.configPostProc.map(f)):e)(w);const h=(e=>{const n=e.supportedLanguages||["am","ar","de","el-GR","en","es","fr","hi","is","it","ja","ko","nl","pl","pt","ru","so","th","zh-Hans","zh-Hant"];if("undefined"!=typeof window){let e=new URLSearchParams(location.search).get("lang")||navigator.language;for(;e;){if(e&&n.includes(e))return e;e=e.substring(0,e.lastIndexOf("-"))}}return e.defaultLanguage||"en"})(w),y=await i(h,{debug:w.debug});p.i18n=()=>y,p.gt=()=>y.t.bind(y),p.config=w,p.plugins={};const b=c("web-engine",{enabled:!!w.debug,isBrowser:g,color:"cyan",logFilter:w.logFilter,truncateObjects:!g,trace:false});p.log=b.sublog(w.name),p.bus=u({showEvents:!0,reportAllErrors:!0,log:b}),p.info={wePkg:{version:r}},"undefined"!=typeof window&&(w.debug?(p.debug=e(e=>e.bind(p),s),s.dndGo.call(p)):p.debug={},window._app=p,window.document&&window.document.title&&w.setWindowTitle&&(document.title=w.name)),p.env=l(p);const{theme:j}=w;if(j?await t({name:"ThemeManagerModule",value:import("../_virtual/_empty_module_placeholder.js")},{name:"HistoryManager",value:import("./historyManager.js")},{name:"LayerManager",value:import("../_virtual/_empty_module_placeholder.js")}).then(async({LayerManager:e,HistoryManager:n,ThemeManagerModule:t})=>{const o=t.initThemeManager(p);p.themePack=await o.buildTheme(j,w.defaultTheme),a(),e.initLayerManager(p),n.initHistoryManager(p),p.destroy=()=>e.destroy()}):p.destroy=()=>{},w.plugins){for(const e in w.plugins)try{const n=w.plugins[e];if(p.plugins[e])throw Error(`Duplicate plugin name "${e}"`);const t=await d(p,e,n);t&&(p.plugins[e]=t)}catch(n){b.error("Error instantiating plugin "+e),b.error(n)}for(const e in p.plugins)p.plugins[e].init()}return"undefined"!=typeof window&&p.bus.send("appInsights/log",{name:"app/loaded",properties:{deploymentHost:window.location.host}}),p}export{w as create};
|
|
1
|
+
import{map as e,mergeDeepRight as n}from"ramda";import{evaluateResults as t}from"zousan/evaluate";import{series as o}from"zousan/series";import i from"./utils/i18n.js";import{startInitialStateListener as a}from"./utils/isInitialState.js";import{version as r}from"../package.json.js";import s from"./debugTools.js";import{buildEnv as l}from"./env.js";import{create as u}from"./extModules/bustle.js";import{initLog as c}from"./extModules/log.js";const g="undefined"!=typeof window;async function d(e,n,t){if(!t)return e.log.info(`Plugin ${n} explicitly disabled`),null;if(void 0!==t.active&&(!1===t.active||"notLocalhost"===t.active&&e.env.isLocalhost()))return e.log.info(`Plugin ${n} explicitly deativated`),null;return(n.includes("/")?(()=>{const[e,t]=n.split("/");return import(`../plugins/${e}/${t}/src/index.js`)})():import(`../plugins/${n}/src/index.js`)).then(o=>(e.log.info(`Creating plugin ${n}`),o.create(e,t)))}async function p(e){return g?import(`./configs/${e}.json`):import(`./configs/${e}.json.js`)}async function m(e,t){let o={};const i=await Promise.all(t.map(p));for(const e of i){let t=e.default;t=t.extends?await m(t,t.extends):t,o=n(o,t)}return o=n(o,e),o}const f=e=>n=>import(`./configs/postproc-${e}.ts`).then(e=>e.process(n));async function w(n){const p=Object.create(null);let w=n.extends?await m(n,n.extends):n;if(w.plugins?.monitoring&&!1!==w.plugins.monitoring.active){const e=w.plugins.monitoring;try{const n=await import("../_virtual/_empty_module_placeholder.js");await n.activate(e)}catch(e){const n=e instanceof Error?e.message:String(e);console.warn("Monitoring plugin failed to load (continuing without it):",n)}}w=await(async e=>e.configPostProc?o(e,...e.configPostProc.map(f)):e)(w);const h=(e=>{const n=e.supportedLanguages||["am","ar","de","el-GR","en","es","fr","hi","is","it","ja","ko","nl","pl","pt","ru","so","th","zh-Hans","zh-Hant"];if("undefined"!=typeof window){let e=new URLSearchParams(location.search).get("lang")||navigator.language;for(;e;){if(e&&n.includes(e))return e;e=e.substring(0,e.lastIndexOf("-"))}}return e.defaultLanguage||"en"})(w),y=await i(h,{debug:w.debug});p.i18n=()=>y,p.gt=()=>y.t.bind(y),p.config=w,p.plugins={};const b=c("web-engine",{enabled:!!w.debug,isBrowser:g,color:"cyan",logFilter:w.logFilter,truncateObjects:!g,trace:false});p.log=b.sublog(w.name),p.bus=u({showEvents:!0,reportAllErrors:!0,log:b}),p.info={wePkg:{version:r}},"undefined"!=typeof window&&(w.debug?(p.debug=e(e=>e.bind(p),s),s.dndGo.call(p)):p.debug={},window._app=p,window.document&&window.document.title&&w.setWindowTitle&&(document.title=w.name)),p.env=l(p);const{theme:j}=w;if(j?await t({name:"ThemeManagerModule",value:import("../_virtual/_empty_module_placeholder.js")},{name:"HistoryManager",value:import("./historyManager.js")},{name:"LayerManager",value:import("../_virtual/_empty_module_placeholder.js")}).then(async({LayerManager:e,HistoryManager:n,ThemeManagerModule:t})=>{const o=t.initThemeManager(p);p.themePack=await o.buildTheme(j,w.defaultTheme),a(),e.initLayerManager(p),n.initHistoryManager(p),p.destroy=()=>e.destroy()}):p.destroy=()=>{},w.plugins){for(const e in w.plugins)try{const n=w.plugins[e];if(p.plugins[e])throw Error(`Duplicate plugin name "${e}"`);const t=await d(p,e,n);t&&(p.plugins[e]=t)}catch(n){b.error("Error instantiating plugin "+e),b.error(n)}for(const e in p.plugins)p.plugins[e].init()}return"undefined"!=typeof window&&p.bus.send("appInsights/log",{name:"app/loaded",properties:{deploymentHost:window.location.host}}),p}export{w as create};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { SDKSourceConfig } from '../plugins/sdkServer/src/publicTypes.ts';
|
|
2
|
+
import type { ObservableInstance } from '../src/utils/observable.ts';
|
|
3
|
+
/** The `map` object returned to SDK consumers: a callable command dispatcher that is
|
|
4
|
+
* also augmented with pub/sub (via `createObservable`) and one member function per
|
|
5
|
+
* server-advertised command (via `addCommands`). */
|
|
6
|
+
type AtriusMap = ((payload: unknown, arg2?: unknown) => Promise<unknown>) & ObservableInstance & Record<string, (...args: unknown[]) => unknown>;
|
|
7
|
+
declare const Init: {
|
|
8
|
+
getVersion: () => string;
|
|
9
|
+
newMap: (config: SDKSourceConfig) => Promise<AtriusMap>;
|
|
10
|
+
setLogging: (flag: boolean) => void;
|
|
11
|
+
};
|
|
12
|
+
export default Init;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { SDKSourceConfig } from '../plugins/sdkServer/src/publicTypes.ts' with { 'resolution-mode': 'import' };
|
|
2
|
+
import type { ObservableInstance } from '../src/utils/observable.ts' with { 'resolution-mode': 'import' };
|
|
3
|
+
/** Keep in sync with the `AtriusMap` type and `Init` object declared in nodeEntry.ts. */
|
|
4
|
+
type AtriusMap = ((payload: unknown, arg2?: unknown) => Promise<unknown>) & ObservableInstance & Record<string, (...args: unknown[]) => unknown>;
|
|
5
|
+
declare const Init: {
|
|
6
|
+
getVersion: () => string;
|
|
7
|
+
newMap: (config: SDKSourceConfig) => Promise<AtriusMap>;
|
|
8
|
+
setLogging: (flag: boolean) => void;
|
|
9
|
+
};
|
|
10
|
+
export = Init;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { create, activate } from './monitoring.ts';
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
export interface MonitoringConfig {
|
|
2
|
+
active?: boolean;
|
|
3
|
+
applicationInsights?: {
|
|
4
|
+
application?: string;
|
|
5
|
+
};
|
|
6
|
+
}
|
|
7
|
+
interface MonitoringApp {
|
|
8
|
+
bus: {
|
|
9
|
+
on(event: string, handler: (payload: any) => unknown): () => void;
|
|
10
|
+
get(event: string, payload?: unknown): Promise<unknown>;
|
|
11
|
+
};
|
|
12
|
+
config: {
|
|
13
|
+
name: string;
|
|
14
|
+
uuid?: string;
|
|
15
|
+
[key: string]: unknown;
|
|
16
|
+
};
|
|
17
|
+
info: {
|
|
18
|
+
wePkg: {
|
|
19
|
+
version: string;
|
|
20
|
+
};
|
|
21
|
+
};
|
|
22
|
+
i18n: () => {
|
|
23
|
+
language: string;
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Non-standard plugin lifecycle — called from app.ts before the plugin loop
|
|
28
|
+
* so monitoring is active as early as possible.
|
|
29
|
+
*/
|
|
30
|
+
declare function activate(config: MonitoringConfig): Promise<void>;
|
|
31
|
+
declare function create(app: MonitoringApp, config: MonitoringConfig): {
|
|
32
|
+
init: () => void;
|
|
33
|
+
};
|
|
34
|
+
export { create, activate };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
declare const SEARCH_VIEW_BODY_ID = "SearchResultsBody";
|
|
2
|
+
declare const SEARCH_VIEW_CATEGORY_LIST_ID = "SearchResultsCategoryList";
|
|
3
|
+
declare const SEARCH_VIEW_TOGGLER = "SearchResultsToggler";
|
|
4
|
+
declare const MAX_UI_RESULTS_LENGTH = 50;
|
|
5
|
+
declare const ToggleViewState: {
|
|
6
|
+
SWITCH_TO_MAP: number;
|
|
7
|
+
SWITCH_TO_LIST: number;
|
|
8
|
+
};
|
|
9
|
+
export { SEARCH_VIEW_BODY_ID, SEARCH_VIEW_CATEGORY_LIST_ID, SEARCH_VIEW_TOGGLER, MAX_UI_RESULTS_LENGTH, ToggleViewState, };
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
export type SDKLocation = {
|
|
2
|
+
poiId?: number;
|
|
3
|
+
lat?: number;
|
|
4
|
+
lng?: number;
|
|
5
|
+
ord?: number;
|
|
6
|
+
floorId?: string;
|
|
7
|
+
zoom?: number;
|
|
8
|
+
pitch?: number;
|
|
9
|
+
bearing?: number;
|
|
10
|
+
};
|
|
11
|
+
export type SDKSchemaRef = {
|
|
12
|
+
type: string;
|
|
13
|
+
itemType?: SDKSchemaRef;
|
|
14
|
+
types?: SDKSchemaRef[];
|
|
15
|
+
};
|
|
16
|
+
export type SDKArgDef = SDKSchemaRef & {
|
|
17
|
+
name?: string;
|
|
18
|
+
optional?: boolean;
|
|
19
|
+
min?: number;
|
|
20
|
+
minLength?: number;
|
|
21
|
+
props?: SDKArgDef[];
|
|
22
|
+
};
|
|
23
|
+
export type SDKCommandDef = {
|
|
24
|
+
command: string;
|
|
25
|
+
args?: SDKArgDef[];
|
|
26
|
+
};
|
|
27
|
+
export type SDKKioskAuth = {
|
|
28
|
+
type: 'kiosk';
|
|
29
|
+
signedManifestUrl: string;
|
|
30
|
+
};
|
|
31
|
+
export type SDKSourceConfig = {
|
|
32
|
+
name?: string;
|
|
33
|
+
debug?: boolean | Record<string, unknown>;
|
|
34
|
+
headless?: boolean;
|
|
35
|
+
theme?: Record<string, unknown>;
|
|
36
|
+
defaultSearchTerms?: string[];
|
|
37
|
+
venueId?: string;
|
|
38
|
+
accountId?: string;
|
|
39
|
+
auth?: SDKKioskAuth;
|
|
40
|
+
poiCategories?: string[];
|
|
41
|
+
preserveStateInURL?: boolean;
|
|
42
|
+
supportURLDeepLinks?: boolean;
|
|
43
|
+
initState?: string;
|
|
44
|
+
deepLinkParms?: string;
|
|
45
|
+
uiHide?: Record<string, unknown>;
|
|
46
|
+
renderDiv?: string;
|
|
47
|
+
parentConfig?: string;
|
|
48
|
+
desktopViewMinWidth?: number;
|
|
49
|
+
forceDesktop?: boolean;
|
|
50
|
+
hostAppId?: string;
|
|
51
|
+
hostAppVersion?: string;
|
|
52
|
+
hostAppProperties?: Record<string, unknown>;
|
|
53
|
+
logFilter?: unknown;
|
|
54
|
+
searchPlaceholder?: string;
|
|
55
|
+
dataFetch?: unknown;
|
|
56
|
+
engineName?: string;
|
|
57
|
+
dynamicPoisUrlBaseV1?: string;
|
|
58
|
+
plugins?: Record<string, unknown>;
|
|
59
|
+
analytics2ActiveFlag?: boolean;
|
|
60
|
+
enablePoiSelection?: boolean;
|
|
61
|
+
showSurround?: boolean;
|
|
62
|
+
minZoom?: number;
|
|
63
|
+
maxZoom?: number;
|
|
64
|
+
noLangOptions?: boolean;
|
|
65
|
+
pinnedLocation?: SDKLocation;
|
|
66
|
+
pinnedLocationZoom?: number;
|
|
67
|
+
pinnedLocationFocusAtStart?: boolean;
|
|
68
|
+
pinnedLocationBearing?: number;
|
|
69
|
+
pinnedLocationPitch?: number;
|
|
70
|
+
[key: string]: unknown;
|
|
71
|
+
};
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import type React from 'react';
|
|
2
|
+
import type { EngineConfig, PluginApp } from '@typings/plugin-runtime.ts';
|
|
3
|
+
export type { SDKArgDef, SDKCommandDef, SDKKioskAuth, SDKLocation, SDKSchemaRef, SDKSourceConfig, } from './publicTypes.ts';
|
|
4
|
+
import type { SDKKioskAuth, SDKSourceConfig } from './publicTypes.ts';
|
|
5
|
+
export type SDKMapCenter = {
|
|
6
|
+
lat: number;
|
|
7
|
+
lng: number;
|
|
8
|
+
ordinal: number;
|
|
9
|
+
floorId?: string | number | null;
|
|
10
|
+
structureId?: string | number | null;
|
|
11
|
+
};
|
|
12
|
+
export type SDKMapView = {
|
|
13
|
+
zoom: number;
|
|
14
|
+
pitch: number;
|
|
15
|
+
bearing: number;
|
|
16
|
+
};
|
|
17
|
+
export type BrowserClientMessage = {
|
|
18
|
+
type: 'LL-client';
|
|
19
|
+
msgId?: string;
|
|
20
|
+
payload?: {
|
|
21
|
+
command?: string;
|
|
22
|
+
[key: string]: unknown;
|
|
23
|
+
};
|
|
24
|
+
};
|
|
25
|
+
export type BrowserInitMessage = {
|
|
26
|
+
type: 'LL-INIT';
|
|
27
|
+
config: SDKSourceConfig;
|
|
28
|
+
};
|
|
29
|
+
export type BrowserServerMessage = {
|
|
30
|
+
type: 'LL-server';
|
|
31
|
+
clientMsgId?: string;
|
|
32
|
+
event?: string;
|
|
33
|
+
error?: boolean;
|
|
34
|
+
payload?: unknown;
|
|
35
|
+
};
|
|
36
|
+
export type BrowserMessagePayload = {
|
|
37
|
+
messageType: string;
|
|
38
|
+
senderOrigin: string;
|
|
39
|
+
command?: string;
|
|
40
|
+
iframeOrigin: string;
|
|
41
|
+
};
|
|
42
|
+
export type SDKPluginConfig = EngineConfig & {
|
|
43
|
+
plugins: EngineConfig['plugins'] & {
|
|
44
|
+
venueDataLoader?: {
|
|
45
|
+
accountId?: string;
|
|
46
|
+
auth?: SDKKioskAuth;
|
|
47
|
+
dataFetch?: unknown;
|
|
48
|
+
venueId?: string;
|
|
49
|
+
};
|
|
50
|
+
};
|
|
51
|
+
};
|
|
52
|
+
export type SDKApp = PluginApp & {
|
|
53
|
+
config: SDKPluginConfig;
|
|
54
|
+
};
|
|
55
|
+
export type DrawMarkerOptions = {
|
|
56
|
+
anchor?: string;
|
|
57
|
+
color?: string;
|
|
58
|
+
hoverHTML?: string;
|
|
59
|
+
offset?: number[];
|
|
60
|
+
pitchAlignment?: string;
|
|
61
|
+
rotation?: number;
|
|
62
|
+
rotationAlignment?: string;
|
|
63
|
+
scale?: number;
|
|
64
|
+
};
|
|
65
|
+
export type DrawLinesStyle = {
|
|
66
|
+
color?: string;
|
|
67
|
+
gradient?: string[];
|
|
68
|
+
width?: number;
|
|
69
|
+
};
|
|
70
|
+
export type SDKReactNode = React.ReactNode;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
interface NavEdge {
|
|
2
|
+
src: string;
|
|
3
|
+
dst: string;
|
|
4
|
+
type: string;
|
|
5
|
+
isDriveway: boolean;
|
|
6
|
+
}
|
|
7
|
+
interface NavNode {
|
|
8
|
+
edges: NavEdge[];
|
|
9
|
+
floorId: string;
|
|
10
|
+
lat: number;
|
|
11
|
+
lng: number;
|
|
12
|
+
ordinal: number;
|
|
13
|
+
[key: string]: unknown;
|
|
14
|
+
}
|
|
15
|
+
type NodeMap = Record<string, NavNode>;
|
|
16
|
+
/**
|
|
17
|
+
* @param {Object.<id:node>} nodes - the node pool you wish to scan
|
|
18
|
+
* @param {Node} [startingNode] - which node to start the scan (default: "first" node)
|
|
19
|
+
* @returns two arrays of nodes in an object, { orphaned, connected }
|
|
20
|
+
*/
|
|
21
|
+
export declare function orphanTest(nodes: NodeMap, startingNode?: NavNode): {
|
|
22
|
+
orphaned: NavNode[];
|
|
23
|
+
orphanedByFloor: Partial<Record<string, NavNode[]>>;
|
|
24
|
+
connected: NavNode[];
|
|
25
|
+
};
|
|
26
|
+
export declare const enrichDebugNavGraph: (nodes: NodeMap) => {
|
|
27
|
+
nodes: Omit<Record<"isOrphaned", boolean>, "edges">[];
|
|
28
|
+
edges: {
|
|
29
|
+
startCoordinates: number[];
|
|
30
|
+
endCoordinates: number[];
|
|
31
|
+
isDriveway: boolean;
|
|
32
|
+
ordinal: number;
|
|
33
|
+
category: string;
|
|
34
|
+
defaultStrokeColor: string;
|
|
35
|
+
}[];
|
|
36
|
+
};
|
|
37
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
type LoadingIndicatorSize = 'lg' | 'sm' | 'xxsm';
|
|
3
|
+
type LoadingIndicatorProps = React.HTMLAttributes<HTMLDivElement> & {
|
|
4
|
+
children?: React.ReactNode;
|
|
5
|
+
hasLoaded?: boolean;
|
|
6
|
+
message?: string;
|
|
7
|
+
size?: LoadingIndicatorSize;
|
|
8
|
+
spinnerColor?: string;
|
|
9
|
+
};
|
|
10
|
+
export declare const LoadingIndicator: ({ children, hasLoaded, message, ...rest }: LoadingIndicatorProps) => import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { LayoutApp } from '@typings/layout.ts';
|
|
3
|
+
interface SystemErrorBoundaryProps {
|
|
4
|
+
app?: LayoutApp;
|
|
5
|
+
children: React.ReactNode;
|
|
6
|
+
}
|
|
7
|
+
interface SystemErrorBoundaryState {
|
|
8
|
+
hasError: boolean;
|
|
9
|
+
error: Error | null;
|
|
10
|
+
errorInfo: React.ErrorInfo | null;
|
|
11
|
+
shouldTriggerE2EError: boolean;
|
|
12
|
+
}
|
|
13
|
+
declare class SystemErrorBoundary extends React.Component<SystemErrorBoundaryProps, SystemErrorBoundaryState> {
|
|
14
|
+
constructor(props: SystemErrorBoundaryProps);
|
|
15
|
+
componentDidCatch(error: Error, errorInfo: React.ErrorInfo): void;
|
|
16
|
+
render(): import("react/jsx-runtime").JSX.Element;
|
|
17
|
+
}
|
|
18
|
+
export default SystemErrorBoundary;
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import type { LayoutUiHide } from '@typings/layout.ts';
|
|
2
|
+
import type { ThemeDef } from '@typings/theme.ts';
|
|
3
|
+
import { buildEnv } from './env.ts';
|
|
4
|
+
import { initLog } from './extModules/log.ts';
|
|
5
|
+
import type { MessageBus } from './types/bus.ts';
|
|
6
|
+
/** Base plugin configuration — all plugins share the `active` property */
|
|
7
|
+
export interface PluginConfig {
|
|
8
|
+
active?: boolean | 'notLocalhost';
|
|
9
|
+
[key: string]: unknown;
|
|
10
|
+
}
|
|
11
|
+
/** Application configuration as loaded from JSON config files */
|
|
12
|
+
export interface AppConfig {
|
|
13
|
+
name: string;
|
|
14
|
+
appName?: string;
|
|
15
|
+
engineName?: string;
|
|
16
|
+
renderDiv?: string;
|
|
17
|
+
initialLayout?: string;
|
|
18
|
+
defaultTheme?: string;
|
|
19
|
+
desktopViewMinWidth?: number;
|
|
20
|
+
mobileHighZoomBreakpoint?: number;
|
|
21
|
+
setWindowTitle?: boolean;
|
|
22
|
+
configPostProc?: string[];
|
|
23
|
+
supportedLanguages?: string[];
|
|
24
|
+
defaultLanguage?: string;
|
|
25
|
+
extends?: string[];
|
|
26
|
+
debug?: boolean | Record<string, unknown>;
|
|
27
|
+
logFilter?: RegExp | string;
|
|
28
|
+
theme?: ThemeDef;
|
|
29
|
+
uiHide?: LayoutUiHide;
|
|
30
|
+
plugins: Record<string, PluginConfig | false>;
|
|
31
|
+
[key: string]: unknown;
|
|
32
|
+
}
|
|
33
|
+
/** The full app instance created by create() */
|
|
34
|
+
export interface AppInstance {
|
|
35
|
+
bus: MessageBus;
|
|
36
|
+
config: AppConfig;
|
|
37
|
+
debug: Record<string, (...args: any[]) => unknown>;
|
|
38
|
+
destroy: () => void;
|
|
39
|
+
env: ReturnType<typeof buildEnv>;
|
|
40
|
+
gt: () => any;
|
|
41
|
+
i18n: () => unknown;
|
|
42
|
+
info: {
|
|
43
|
+
wePkg: {
|
|
44
|
+
version: string;
|
|
45
|
+
};
|
|
46
|
+
};
|
|
47
|
+
log: ReturnType<ReturnType<typeof initLog>['sublog']>;
|
|
48
|
+
plugins: Record<string, {
|
|
49
|
+
init: () => void;
|
|
50
|
+
[key: string]: unknown;
|
|
51
|
+
}>;
|
|
52
|
+
themePack?: unknown;
|
|
53
|
+
[key: string]: unknown;
|
|
54
|
+
}
|
|
55
|
+
declare global {
|
|
56
|
+
interface Window {
|
|
57
|
+
_app: AppInstance;
|
|
58
|
+
R: typeof import('ramda');
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
declare function create(rawConfig: AppConfig): Promise<AppInstance>;
|
|
62
|
+
export { create };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { EngineConfig } from '@typings/plugin-runtime.ts';
|
|
2
|
+
export declare function process(config: EngineConfig): EngineConfig;
|
|
3
|
+
/**
|
|
4
|
+
* Given a state string (JSON representation of latest state) this will update the
|
|
5
|
+
* app config by applying plugin deep-link state.
|
|
6
|
+
*
|
|
7
|
+
* Note: forceCreate is a potential security risk. It is used by the SDK before
|
|
8
|
+
* extends is processed, so it is still needed there.
|
|
9
|
+
*/
|
|
10
|
+
export declare function setStateFromStateString(config: EngineConfig, stateString: string, forceCreate?: boolean): EngineConfig;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This manages the creation and organization of your App instances.
|
|
3
|
+
* Each instance is created via the create function - passing in a configuration
|
|
4
|
+
* object, which extends any existing configuration template.
|
|
5
|
+
*/
|
|
6
|
+
import type { AppConfig } from './app.ts';
|
|
7
|
+
/**
|
|
8
|
+
* Create a new instance of the engine. Pass in a configuration object which will
|
|
9
|
+
* extend the config template.
|
|
10
|
+
* @param {} config Configuration for this instance. Will be shallow copied.
|
|
11
|
+
*/
|
|
12
|
+
declare function create(config: AppConfig): Promise<import("./app.ts").AppInstance | undefined>;
|
|
13
|
+
export { create };
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { orphanTest } from '../plugins/wayfinder/src/navGraphDebug.ts';
|
|
2
|
+
declare function poisByCategory(this: any): any;
|
|
3
|
+
declare function getPoiById(this: any, id: string): any;
|
|
4
|
+
declare function showOrphaned(this: any): Promise<void>;
|
|
5
|
+
declare function showgraph(this: any): Promise<void>;
|
|
6
|
+
declare function bounds(this: any): Promise<void>;
|
|
7
|
+
declare function buildingBounds(this: any, nameFilter: any): Promise<void>;
|
|
8
|
+
declare function floorBounds(this: any, nameFilter: any): Promise<void>;
|
|
9
|
+
declare function padding(this: any): Promise<void>;
|
|
10
|
+
declare function showCenter(this: any): Promise<void>;
|
|
11
|
+
declare function dndGo(this: any): void;
|
|
12
|
+
declare const _default: {
|
|
13
|
+
bounds: typeof bounds;
|
|
14
|
+
buildingBounds: typeof buildingBounds;
|
|
15
|
+
dndGo: typeof dndGo;
|
|
16
|
+
floorBounds: typeof floorBounds;
|
|
17
|
+
getPoiById: typeof getPoiById;
|
|
18
|
+
highlightNodes: () => HTMLElement;
|
|
19
|
+
orphanTest: typeof orphanTest;
|
|
20
|
+
padding: typeof padding;
|
|
21
|
+
poisByCategory: typeof poisByCategory;
|
|
22
|
+
showCenter: typeof showCenter;
|
|
23
|
+
showgraph: typeof showgraph;
|
|
24
|
+
showIcons: () => void;
|
|
25
|
+
showOrphaned: typeof showOrphaned;
|
|
26
|
+
};
|
|
27
|
+
export default _default;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Bustle is a highly performant event bus that offers event order guarantees.
|
|
3
|
+
*/
|
|
4
|
+
import type { BusPayload, EventName, MessageBus, Unsubscribe } from '@typings/bus.ts';
|
|
5
|
+
/**
|
|
6
|
+
* Every bus payload is a plain object literal: string-named properties whose
|
|
7
|
+
* values may be anything. Events that carry no payload pass `undefined`.
|
|
8
|
+
* Declare event payload shapes with `type` aliases, not `interface` — interfaces
|
|
9
|
+
* lack the implicit index signature needed to satisfy this constraint.
|
|
10
|
+
*/
|
|
11
|
+
type RuntimeBusPayload = BusPayload | undefined;
|
|
12
|
+
export type { BusPayload, MessageBus, Unsubscribe };
|
|
13
|
+
interface BustleLog {
|
|
14
|
+
info: (...args: unknown[]) => void;
|
|
15
|
+
error: (...args: unknown[]) => void;
|
|
16
|
+
sublog?: (name: string, options?: Record<string, unknown>) => BustleLog;
|
|
17
|
+
}
|
|
18
|
+
interface CreateOptions {
|
|
19
|
+
log?: BustleLog;
|
|
20
|
+
rejectOnError?: boolean;
|
|
21
|
+
reportAllErrors?: boolean;
|
|
22
|
+
showEvents?: boolean | ((eventName: EventName, payload: RuntimeBusPayload) => boolean);
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Escape hatch for the few legacy events whose payload predates the
|
|
26
|
+
* {@link BusPayload} object-literal rule and carries a bare string, boolean,
|
|
27
|
+
* or array (the `layers/*` id events, `map/setEnablePoiSelection`). Every use
|
|
28
|
+
* marks a migration candidate — do not use it for new events.
|
|
29
|
+
*/
|
|
30
|
+
export declare const legacyBusPayload: (payload: string | boolean | readonly unknown[]) => BusPayload;
|
|
31
|
+
export declare function create(opts?: CreateOptions): MessageBus;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
declare const nodeColorsOb: {
|
|
2
|
+
black: string;
|
|
3
|
+
red: string;
|
|
4
|
+
green: string;
|
|
5
|
+
yellow: string;
|
|
6
|
+
blue: string;
|
|
7
|
+
magenta: string;
|
|
8
|
+
cyan: string;
|
|
9
|
+
white: string;
|
|
10
|
+
};
|
|
11
|
+
type NodeColor = keyof typeof nodeColorsOb;
|
|
12
|
+
interface LogOptions {
|
|
13
|
+
color?: NodeColor | string;
|
|
14
|
+
enabled?: boolean;
|
|
15
|
+
isBrowser?: boolean;
|
|
16
|
+
logFilter?: RegExp | string;
|
|
17
|
+
trace?: boolean;
|
|
18
|
+
truncateObjects?: boolean | number | string;
|
|
19
|
+
}
|
|
20
|
+
export interface Logger {
|
|
21
|
+
(...restArgs: unknown[]): void;
|
|
22
|
+
info: Logger;
|
|
23
|
+
warn: Logger;
|
|
24
|
+
detailed: Logger;
|
|
25
|
+
error: Logger;
|
|
26
|
+
setEnabled: (enabled: boolean) => void;
|
|
27
|
+
sublog: (sublogName: string, sublogOptions?: Partial<LogOptions>) => Logger;
|
|
28
|
+
}
|
|
29
|
+
export declare function initLog(name: string, options?: LogOptions): Logger;
|
|
30
|
+
export {};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Hook to access theme colors for JavaScript usage.
|
|
3
|
+
* Useful for components that need color values in props (SVG fillColor, canvas operations, etc.)
|
|
4
|
+
*
|
|
5
|
+
* During the CSS variables migration, this provides a stable API for accessing colors
|
|
6
|
+
* while we transition from styled-components theme to CSS custom properties.
|
|
7
|
+
*
|
|
8
|
+
* @returns {Object} Color values as hex strings
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* const colors = useCSSColors();
|
|
12
|
+
* <ColoredIcon fillColor={colors.primary} />
|
|
13
|
+
*/
|
|
14
|
+
export declare function useCSSColors(): any;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { LayoutApp, LayoutUiHide } from '@typings/layout.ts';
|
|
3
|
+
type SpeedDialProps = {
|
|
4
|
+
app: LayoutApp;
|
|
5
|
+
buttonOptions: React.ReactNode[];
|
|
6
|
+
feedbackZone?: React.ReactNode;
|
|
7
|
+
filteredMapControls: React.ReactNode[];
|
|
8
|
+
isMapVisible: boolean;
|
|
9
|
+
isMobileReflow: boolean;
|
|
10
|
+
mapPanControlMobile?: React.ReactElement | null;
|
|
11
|
+
uiHide: LayoutUiHide;
|
|
12
|
+
};
|
|
13
|
+
declare const SpeedDial: ({ app, isMapVisible, uiHide, isMobileReflow, filteredMapControls, buttonOptions, mapPanControlMobile, }: SpeedDialProps) => false | import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
export default SpeedDial;
|