atriusmaps-node-sdk 3.3.1176 → 3.3.1177

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.
@@ -2,7 +2,7 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var version = "3.3.1176";
5
+ var version = "3.3.1177";
6
6
  var pkg = {
7
7
  version: version};
8
8
 
@@ -159,11 +159,13 @@ async function create(rawConfig) {
159
159
  isInitialState.startInitialStateListener();
160
160
  LayerManager.initLayerManager(appInstance);
161
161
  HistoryManager.initHistoryManager(appInstance);
162
- appInstance.destroy = () => LayerManager.destroy();
162
+ appInstance.destroy = () => {
163
+ appInstance.env.dispose();
164
+ return LayerManager.destroy();
165
+ };
163
166
  });
164
167
  } else {
165
- appInstance.destroy = () => {
166
- };
168
+ appInstance.destroy = () => appInstance.env.dispose();
167
169
  }
168
170
  if (config.plugins) {
169
171
  for (const { id, pluginConfig, loaded } of pluginLoads) {
@@ -201,3 +203,4 @@ async function create(rawConfig) {
201
203
  }
202
204
 
203
205
  exports.create = create;
206
+ exports.extendConfig = extendConfig;
@@ -19,16 +19,22 @@ function buildEnv(app) {
19
19
  isDesktop,
20
20
  supportsTouch
21
21
  };
22
- if (isBrowser) {
23
- window.addEventListener("resize", () => {
24
- app.bus.send("env/resize", {
25
- isMobile: env.isMobile(),
26
- isMobileReflow: env.isMobileReflow(),
27
- isVeryNarrow: env.isVeryNarrow()
28
- });
22
+ const onResize = () => {
23
+ app.bus.send("env/resize", {
24
+ isMobile: env.isMobile(),
25
+ isMobileReflow: env.isMobileReflow(),
26
+ isVeryNarrow: env.isVeryNarrow()
29
27
  });
28
+ };
29
+ if (isBrowser) {
30
+ window.addEventListener("resize", onResize);
30
31
  }
31
- return env;
32
+ const dispose = () => {
33
+ if (isBrowser) {
34
+ window.removeEventListener("resize", onResize);
35
+ }
36
+ };
37
+ return { ...env, dispose };
32
38
  }
33
39
 
34
40
  exports.buildEnv = buildEnv;
@@ -1 +1 @@
1
- var a="3.3.1176",e={version:a};export{e as default,a as version};
1
+ var a="3.3.1177",e={version:a};export{e as default,a as version};
package/dist/src/app.js CHANGED
@@ -1 +1 @@
1
- import{map as t,mergeDeepRight as e}from"ramda";import{evaluateResults as o}from"zousan/evaluate";import{series as n}from"zousan/series";import i from"./utils/i18n.js";import{startInitialStateListener as a}from"./utils/isInitialState.js";import{version as s}from"../package.json.js";import r 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 p(t,e,o){return o?void 0!==o.active&&(!1===o.active||"notLocalhost"===o.active&&t.env.isLocalhost())?(t.log.info(`Plugin ${e} explicitly deativated`),null):e.includes("/")?(()=>{const[t,o]=e.split("/");return import(`../plugins/${t}/${o}/src/index.js`)})():import(`../plugins/${e}/src/index.js`):(t.log.info(`Plugin ${e} explicitly disabled`),null)}async function d(t){return g?import(`./configs/${t}.json`):import(`./configs/${t}.json.js`)}async function m(t,o){let n={};const i=await Promise.all(o.map(d));for(const t of i){let o=t.default;o=o.extends?await m(o,o.extends):o,n=e(n,o)}return n=e(n,t),n}const f=t=>e=>import(`./configs/postproc-${t}.ts`).then(t=>t.process(e));async function w(e){const d=Object.create(null);let w=e.extends?await m(e,e.extends):e;if(w.plugins?.monitoring&&!1!==w.plugins.monitoring.active){const t=w.plugins.monitoring;try{const e=await(import("../_virtual/_empty_module_placeholder.js"));await e.activate(t)}catch(t){const e=t instanceof Error?t.message:String(t);console.warn("Monitoring plugin failed to load (continuing without it):",e)}}if(w=await(async t=>t.configPostProc?n(t,...t.configPostProc.map(f)):t)(w),g&&w.plugins?.posthog&&!1!==w.plugins.posthog.active)try{const{activate:t}=await(import("../plugins/posthog/src/posthog.js"));await t(w.plugins.posthog)}catch(t){console.warn("PostHog failed to start (continuing without it):",t)}const h=(t=>{const e=t.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 t=new URLSearchParams(location.search).get("lang")||navigator.language;for(;t;){if(t&&e.includes(t))return t;t=t.substring(0,t.lastIndexOf("-"))}}return t.defaultLanguage||"en"})(w),y=await i(h,{debug:w.debug});d.i18n=()=>y,d.gt=()=>y.t.bind(y),d.config=w,d.plugins={};const j=c("web-engine",{enabled:!!w.debug,isBrowser:g,color:"cyan",logFilter:w.logFilter,truncateObjects:!g,trace:false});d.log=j.sublog(w.name),d.bus=u({showEvents:!0,reportAllErrors:!0,log:j}),d.info={wePkg:{version:s}},"undefined"!=typeof window&&(w.debug?(d.debug=t(t=>t.bind(d),r),r.dndGo.call(d)):d.debug={},window._app=d,window.document&&window.document.title&&w.setWindowTitle&&(document.title=w.name)),d.env=l(d);const v=Object.entries(w.plugins??{}).map(([t,e])=>({id:t,pluginConfig:e,loaded:p(d,t,e).then(t=>({status:"fulfilled",pluginModule:t}),t=>({status:"rejected",error:t}))})),{theme:b}=w;if(b?await o({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:t,HistoryManager:e,ThemeManagerModule:o})=>{const n=o.initThemeManager(d);d.themePack=await n.buildTheme(b,w.defaultTheme),a(),t.initLayerManager(d),e.initHistoryManager(d),d.destroy=()=>t.destroy()}):d.destroy=()=>{},w.plugins){for(const{id:t,pluginConfig:e,loaded:o}of v)try{if(d.plugins[t])throw Error(`Duplicate plugin name "${t}"`);const n=await o;if("rejected"===n.status)throw n.error;if(n.pluginModule){j.info(`Creating plugin ${t}`);const o=await n.pluginModule.create(d,e);o&&(d.plugins[t]=o)}}catch(e){j.error("Error instantiating plugin "+t),j.error(e)}for(const t in d.plugins)d.plugins[t].init()}return"undefined"!=typeof window&&d.bus.send("appInsights/log",{name:"app/loaded",properties:{deploymentHost:window.location.host}}),d}export{w as create};
1
+ import{map as t,mergeDeepRight as e}from"ramda";import{evaluateResults as o}from"zousan/evaluate";import{series as n}from"zousan/series";import i from"./utils/i18n.js";import{startInitialStateListener as a}from"./utils/isInitialState.js";import{version as s}from"../package.json.js";import r 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 p(t,e,o){return o?void 0!==o.active&&(!1===o.active||"notLocalhost"===o.active&&t.env.isLocalhost())?(t.log.info(`Plugin ${e} explicitly deativated`),null):e.includes("/")?(()=>{const[t,o]=e.split("/");return import(`../plugins/${t}/${o}/src/index.js`)})():import(`../plugins/${e}/src/index.js`):(t.log.info(`Plugin ${e} explicitly disabled`),null)}async function d(t){return g?import(`./configs/${t}.json`):import(`./configs/${t}.json.js`)}async function m(t,o){let n={};const i=await Promise.all(o.map(d));for(const t of i){let o=t.default;o=o.extends?await m(o,o.extends):o,n=e(n,o)}return n=e(n,t),n}const f=t=>e=>import(`./configs/postproc-${t}.ts`).then(t=>t.process(e));async function w(e){const d=Object.create(null);let w=e.extends?await m(e,e.extends):e;if(w.plugins?.monitoring&&!1!==w.plugins.monitoring.active){const t=w.plugins.monitoring;try{const e=await(import("../_virtual/_empty_module_placeholder.js"));await e.activate(t)}catch(t){const e=t instanceof Error?t.message:String(t);console.warn("Monitoring plugin failed to load (continuing without it):",e)}}if(w=await(async t=>t.configPostProc?n(t,...t.configPostProc.map(f)):t)(w),g&&w.plugins?.posthog&&!1!==w.plugins.posthog.active)try{const{activate:t}=await(import("../plugins/posthog/src/posthog.js"));await t(w.plugins.posthog)}catch(t){console.warn("PostHog failed to start (continuing without it):",t)}const h=(t=>{const e=t.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 t=new URLSearchParams(location.search).get("lang")||navigator.language;for(;t;){if(t&&e.includes(t))return t;t=t.substring(0,t.lastIndexOf("-"))}}return t.defaultLanguage||"en"})(w),y=await i(h,{debug:w.debug});d.i18n=()=>y,d.gt=()=>y.t.bind(y),d.config=w,d.plugins={};const j=c("web-engine",{enabled:!!w.debug,isBrowser:g,color:"cyan",logFilter:w.logFilter,truncateObjects:!g,trace:false});d.log=j.sublog(w.name),d.bus=u({showEvents:!0,reportAllErrors:!0,log:j}),d.info={wePkg:{version:s}},"undefined"!=typeof window&&(w.debug?(d.debug=t(t=>t.bind(d),r),r.dndGo.call(d)):d.debug={},window._app=d,window.document&&window.document.title&&w.setWindowTitle&&(document.title=w.name)),d.env=l(d);const v=Object.entries(w.plugins??{}).map(([t,e])=>({id:t,pluginConfig:e,loaded:p(d,t,e).then(t=>({status:"fulfilled",pluginModule:t}),t=>({status:"rejected",error:t}))})),{theme:b}=w;if(b?await o({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:t,HistoryManager:e,ThemeManagerModule:o})=>{const n=o.initThemeManager(d);d.themePack=await n.buildTheme(b,w.defaultTheme),a(),t.initLayerManager(d),e.initHistoryManager(d),d.destroy=()=>(d.env.dispose(),t.destroy())}):d.destroy=()=>d.env.dispose(),w.plugins){for(const{id:t,pluginConfig:e,loaded:o}of v)try{if(d.plugins[t])throw Error(`Duplicate plugin name "${t}"`);const n=await o;if("rejected"===n.status)throw n.error;if(n.pluginModule){j.info(`Creating plugin ${t}`);const o=await n.pluginModule.create(d,e);o&&(d.plugins[t]=o)}}catch(e){j.error("Error instantiating plugin "+t),j.error(e)}for(const t in d.plugins)d.plugins[t].init()}return"undefined"!=typeof window&&d.bus.send("appInsights/log",{name:"app/loaded",properties:{deploymentHost:window.location.host}}),d}export{w as create,m as extendConfig};
package/dist/src/env.js CHANGED
@@ -1 +1 @@
1
- function i(i){const o=i.config.desktopViewMinWidth||0,e="undefined"!=typeof window,s=e&&("ontouchstart"in window||navigator.maxTouchPoints>0),t=()=>e&&innerWidth<o,n=()=>t(),r={isBrowser:e,isMobile:n,isMobileReflow:()=>n()&&innerHeight<360,isVeryNarrow:()=>n()&&innerWidth<320,isLocalhost:()=>location.host.startsWith("localhost")||location.host.startsWith("127.0.0.1"),isDesktop:()=>e&&!t(),supportsTouch:s};return e&&window.addEventListener("resize",()=>{i.bus.send("env/resize",{isMobile:r.isMobile(),isMobileReflow:r.isMobileReflow(),isVeryNarrow:r.isVeryNarrow()})}),r}export{i as buildEnv};
1
+ function i(i){const o=i.config.desktopViewMinWidth||0,e="undefined"!=typeof window,s=e&&("ontouchstart"in window||navigator.maxTouchPoints>0),t=()=>e&&innerWidth<o,n=()=>t(),r={isBrowser:e,isMobile:n,isMobileReflow:()=>n()&&innerHeight<360,isVeryNarrow:()=>n()&&innerWidth<320,isLocalhost:()=>location.host.startsWith("localhost")||location.host.startsWith("127.0.0.1"),isDesktop:()=>e&&!t(),supportsTouch:s},w=()=>{i.bus.send("env/resize",{isMobile:r.isMobile(),isMobileReflow:r.isMobileReflow(),isVeryNarrow:r.isVeryNarrow()})};e&&window.addEventListener("resize",w);return{...r,dispose:()=>{e&&window.removeEventListener("resize",w)}}}export{i as buildEnv};
@@ -58,5 +58,6 @@ declare global {
58
58
  R: typeof import('ramda');
59
59
  }
60
60
  }
61
+ declare function extendConfig(config: AppConfig, extendsConfigs: string[]): Promise<AppConfig>;
61
62
  declare function create(rawConfig: AppConfig): Promise<AppInstance>;
62
- export { create };
63
+ export { create, extendConfig };
@@ -1,4 +1,5 @@
1
1
  export declare function buildEnv(app: any): {
2
+ dispose: () => void;
2
3
  isBrowser: boolean;
3
4
  isMobile: () => boolean;
4
5
  isMobileReflow: () => boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "atriusmaps-node-sdk",
3
- "version": "3.3.1176",
3
+ "version": "3.3.1177",
4
4
  "description": "This project provides an API to Atrius Personal Wayfinder maps within a Node environment. See the README.md for more information",
5
5
  "keywords": [
6
6
  "acuitybrands",