@abi-software/flatmapvuer 1.12.0-beta.0 → 1.12.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2,7 +2,7 @@ import { Loading as Mr, CircleCheck as Bl, CircleClose as _r, Close as ri, Arrow
2
2
  import { getCurrentScope as zl, onScopeDispose as Rr, unref as v, getCurrentInstance as ge, onMounted as he, nextTick as ce, ref as x, readonly as Fr, watch as q, warn as Hl, watchEffect as $r, onBeforeUnmount as Ve, inject as G, computed as b, isRef as lt, shallowRef as vo, onBeforeMount as Kl, provide as pe, defineComponent as H, openBlock as w, createElementBlock as L, mergeProps as Nt, renderSlot as K, toRef as Ze, onUnmounted as jl, createBlock as z, Transition as Vn, withCtx as E, withDirectives as ie, createElementVNode as R, normalizeClass as _, normalizeStyle as re, vShow as Ee, Fragment as fe, createVNode as P, reactive as ut, onActivated as Ul, onUpdated as Wl, resolveDynamicComponent as $e, createCommentVNode as V, cloneVNode as ql, Text as Dr, Comment as Gl, Teleport as Jl, onDeactivated as Yl, toDisplayString as ee, useSlots as ko, toRaw as go, withModifiers as le, vModelCheckbox as yo, createTextVNode as Z, toRefs as cn, vModelRadio as Nr, h as Zt, createSlots as Br, resolveComponent as Fe, resolveDirective as Zl, toHandlerKey as Ql, renderList as Ke, withKeys as En, vModelText as Xl, createApp as eu, createStaticVNode as tu, markRaw as Re } from "vue";
3
3
  import { MapSvgIcon as nu, MapSvgSpriteColor as ou } from "@abi-software/svg-sprite";
4
4
  import { Tooltip as iu, TreeControls as au, DrawToolbar as ru, fetchLabels as su, getFlatmapFilterOptions as lu } from "@abi-software/map-utilities";
5
- import * as Vr from "https://cdn.jsdelivr.net/npm/@abi-software/flatmap-viewer@4.4.0/+esm";
5
+ import * as Vr from "https://cdn.jsdelivr.net/npm/@abi-software/flatmap-viewer@4.4.1/+esm";
6
6
  import { AnnotationService as uu } from "@abi-software/sparc-annotation";
7
7
  import { defineStore as cu, mapState as du } from "pinia";
8
8
  const it = (e, t, { checkForDefaultPrevented: n = !0 } = {}) => (i) => {
@@ -9610,22 +9610,24 @@ const Ii = new Lb(), Rb = "cannot be found on the map.", Fb = (e) => {
9610
9610
  });
9611
9611
  } else {
9612
9612
  const a = o.join();
9613
- this.connectionType.toLowerCase() === "all" && this.$emit("neuron-connection-feature-click", {
9613
+ this.connectionType.toLowerCase() === "all" ? this.$emit("neuron-connection-feature-click", {
9614
9614
  filters: [],
9615
9615
  search: a
9616
- });
9617
- }
9618
- } else {
9619
- Tb(this.mapImp, this.flatmapQueries);
9620
- let o = [];
9621
- if (this.tooltipEntry = e.filter((i) => i.resource[0] in this.mapImp.pathways.paths).map((i) => ({ title: i.label, featureId: i.resource, ready: !1 })), this.tooltipEntry.length) {
9622
- this.$emit("connectivity-info-open", this.tooltipEntry);
9623
- for (let a = 0; a < e.length; a++)
9624
- o.push(await this.getKnowledgeTooltip(e[a]));
9625
- this.tooltipEntry = await Promise.all(o);
9626
- const i = this.tooltipEntry.map((a) => a.featureId[0]);
9627
- i.length > 0 && this.displayTooltip(i);
9616
+ }) : await this.openConnectivityInfo(e);
9628
9617
  }
9618
+ } else
9619
+ await this.openConnectivityInfo(e);
9620
+ },
9621
+ openConnectivityInfo: async function(e) {
9622
+ Tb(this.mapImp, this.flatmapQueries);
9623
+ let t = [];
9624
+ if (this.tooltipEntry = e.filter((n) => n.resource[0] in this.mapImp.pathways.paths).map((n) => ({ title: n.label, featureId: n.resource, ready: !1 })), this.tooltipEntry.length) {
9625
+ this.$emit("connectivity-info-open", this.tooltipEntry);
9626
+ for (let o = 0; o < e.length; o++)
9627
+ t.push(await this.getKnowledgeTooltip(e[o]));
9628
+ this.tooltipEntry = await Promise.all(t);
9629
+ const n = this.tooltipEntry.map((o) => o.featureId[0]);
9630
+ n.length > 0 && this.displayTooltip(n);
9629
9631
  }
9630
9632
  },
9631
9633
  /**
@@ -11313,7 +11315,7 @@ function Gb(e, t, n, o, i, a) {
11313
11315
  [B, e.loading]
11314
11316
  ]);
11315
11317
  }
11316
- const wl = /* @__PURE__ */ Kt($b, [["render", Gb], ["__scopeId", "data-v-ba0755eb"]]), Or = {
11318
+ const wl = /* @__PURE__ */ Kt($b, [["render", Gb], ["__scopeId", "data-v-b1c18844"]]), Or = {
11317
11319
  "NCBITaxon:10114": "01fedbf9-d783-509c-a10c-827941ab13da",
11318
11320
  "NCBITaxon:9823": "a336ac04-24db-561f-a25f-1c994fe17410",
11319
11321
  "NCBITaxon:9606": "42ed6323-f645-5fbe-bada-9581819cf689",
@@ -11347,48 +11349,69 @@ const wl = /* @__PURE__ */ Kt($b, [["render", Gb], ["__scopeId", "data-v-ba0755e
11347
11349
  */
11348
11350
  initialise: function() {
11349
11351
  return this.multiflatmapError = null, new Promise((e) => {
11350
- this.requireInitialisation ? (this.requireInitialisation = !1, fetch(this.flatmapAPI).then((t) => t.json()).then((t) => {
11351
- t.status_code === 404 && (console.error("Flatmap API endpoint is incorrect", t), this.multiflatmapError = {}, this.multiflatmapError.title = "MultiFlatmap Error!", this.multiflatmapError.messages = [
11352
- `Sorry, the component could not be loaded because the specified
11352
+ if (this.requireInitialisation) {
11353
+ this.requireInitialisation = !1;
11354
+ const t = new AbortController(), n = t.signal, o = setTimeout(() => t.abort(), 5e3);
11355
+ fetch(this.flatmapAPI, { signal: n }).then((i) => {
11356
+ if (!i.ok) {
11357
+ if (i.status === 404)
11358
+ return this.multiflatmapError = {}, this.multiflatmapError.title = "MultiFlatmap Error!", this.multiflatmapError.messages = [
11359
+ `Sorry, the component could not be loaded because the specified
11360
+ flatmap API endpoint is incorrect. Please check the endpoint URL
11361
+ or contact support if the problem persists.`
11362
+ ], this.initialised = !0, e(), this.resolveList.forEach((a) => a()), Promise.reject({ handled: !0 });
11363
+ throw new Error(`HTTP ${i.status}: ${i.statusText}`);
11364
+ }
11365
+ return i.json();
11366
+ }).then((i) => {
11367
+ if (i && i.status_code === 404) {
11368
+ console.error("Flatmap API endpoint is incorrect", i), this.multiflatmapError = {}, this.multiflatmapError.title = "MultiFlatmap Error!", this.multiflatmapError.messages = [
11369
+ `Sorry, the component could not be loaded because the specified
11353
11370
  flatmap API endpoint is incorrect. Please check the endpoint URL
11354
11371
  or contact support if the problem persists.`
11355
- ]), Object.keys(this.availableSpecies).forEach((o) => {
11356
- const i = this.availableSpecies[o].uuid;
11357
- if (i && t.length && t.map((a) => a.uuid).indexOf(i) > 0)
11358
- this.speciesList[o] = this.availableSpecies[o];
11359
- else
11360
- for (let a = 0; a < t.length; a++)
11361
- if (this.availableSpecies[o].taxo === t[a].taxon)
11362
- if (this.availableSpecies[o].biologicalSex) {
11363
- if (t[a].biologicalSex && t[a].biologicalSex === this.availableSpecies[o].biologicalSex) {
11364
- this.speciesList[o] = this.availableSpecies[o];
11372
+ ], this.initialised = !0, e(), this.resolveList.forEach((r) => r());
11373
+ return;
11374
+ }
11375
+ Object.keys(this.availableSpecies).forEach((r) => {
11376
+ const s = this.availableSpecies[r].uuid;
11377
+ if (s && i.length && i.map((l) => l.uuid).indexOf(s) > 0)
11378
+ this.speciesList[r] = this.availableSpecies[r];
11379
+ else
11380
+ for (let l = 0; l < i.length; l++)
11381
+ if (this.availableSpecies[r].taxo === i[l].taxon)
11382
+ if (this.availableSpecies[r].biologicalSex) {
11383
+ if (i[l].biologicalSex && i[l].biologicalSex === this.availableSpecies[r].biologicalSex) {
11384
+ this.speciesList[r] = this.availableSpecies[r];
11385
+ break;
11386
+ }
11387
+ } else {
11388
+ this.speciesList[r] = this.availableSpecies[r];
11365
11389
  break;
11366
11390
  }
11367
- } else {
11368
- this.speciesList[o] = this.availableSpecies[o];
11369
- break;
11370
- }
11371
- });
11372
- let n = this.initial;
11373
- if (this.state) {
11374
- const o = this.state.state;
11375
- (!o || !o.uuid && !o.entry) && this.state.species ? n = this.state.species : n = void 0;
11376
- }
11377
- n && (n && this.speciesList[n] !== void 0 ? this.activeSpecies = n : this.activeSpecies = Object.keys(this.speciesList)[0], this.setSpecies(
11378
- this.activeSpecies,
11379
- this.state ? this.state.state : void 0,
11380
- 5
11381
- )), this.initialised = !0, e(), this.resolveList.forEach((o) => {
11382
- o();
11383
- });
11384
- }).catch((t) => {
11385
- console.error("Error fetching flatmap:", t), this.initialised = !0, this.multiflatmapError = {}, this.multiflatmapError.title = "MultiFlatmap Error!", this.multiflatmapError.messages = [
11386
- `Sorry, the component could not be loaded due to an unexpected error.
11391
+ });
11392
+ let a = this.initial;
11393
+ if (this.state) {
11394
+ const r = this.state.state;
11395
+ (!r || !r.uuid && !r.entry) && this.state.species ? a = this.state.species : a = void 0;
11396
+ }
11397
+ a && (a && this.speciesList[a] !== void 0 ? this.activeSpecies = a : this.activeSpecies = Object.keys(this.speciesList)[0], this.setSpecies(
11398
+ this.activeSpecies,
11399
+ this.state ? this.state.state : void 0,
11400
+ 5
11401
+ )), this.initialised = !0, e(), this.resolveList.forEach((r) => {
11402
+ r();
11403
+ });
11404
+ }).catch((i) => {
11405
+ i && i.handled || (console.error("Error fetching flatmap:", i), this.initialised = !0, this.multiflatmapError = {}, this.multiflatmapError.title = "MultiFlatmap Error!", this.multiflatmapError.messages = [
11406
+ `Sorry, the component could not be loaded due to an unexpected error.
11387
11407
  Please try again later or contact support if the problem persists.`
11388
- ], e(), this.resolveList.forEach((n) => {
11389
- n();
11408
+ ], e(), this.resolveList.forEach((a) => {
11409
+ a();
11410
+ }));
11411
+ }).finally(() => {
11412
+ clearTimeout(o);
11390
11413
  });
11391
- })) : this.initialised ? e() : this.resolveList.push(e);
11414
+ } else this.initialised ? e() : this.resolveList.push(e);
11392
11415
  });
11393
11416
  },
11394
11417
  /**
@@ -12038,7 +12061,7 @@ function Xb(e, t, n, o, i, a) {
12038
12061
  }, null, 8, ["flatmapError"])) : V("", !0)
12039
12062
  ], 512);
12040
12063
  }
12041
- const r0 = /* @__PURE__ */ Kt(Jb, [["render", Xb], ["__scopeId", "data-v-7b90a46d"]]);
12064
+ const r0 = /* @__PURE__ */ Kt(Jb, [["render", Xb], ["__scopeId", "data-v-1a5d097a"]]);
12042
12065
  export {
12043
12066
  wl as FlatmapVuer,
12044
12067
  r0 as MultiFlatmapVuer