@abi-software/map-utilities 1.7.0 → 1.7.2

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.
@@ -9592,7 +9592,7 @@ const C5 = function(t = {}) {
9592
9592
  e
9593
9593
  ), t = !1;
9594
9594
  }
9595
- t ? this.textLabel = _5 : this.textLabel = "Error trying to copy to clipboard!";
9595
+ t ? (this.textLabel = _5, this.$emit("copied", { status: "success" })) : (this.textLabel = "Error trying to copy to clipboard!", this.$emit("copied", { status: "error" }));
9596
9596
  },
9597
9597
  resetSettings: function() {
9598
9598
  this.autoHideTimeout = 0, this.textLabel = this.label;
@@ -9634,7 +9634,7 @@ function O5(t, e, r, n, a, i) {
9634
9634
  _: 1
9635
9635
  }, 8, ["content", "hide-after", "onHide", "append-to"]);
9636
9636
  }
9637
- const Sg = /* @__PURE__ */ Er(T5, [["render", O5], ["__scopeId", "data-v-91c822cd"]]), A5 = {
9637
+ const Sg = /* @__PURE__ */ Er(T5, [["render", O5], ["__scopeId", "data-v-c791b9aa"]]), A5 = {
9638
9638
  name: "AnnotationPopup",
9639
9639
  props: {
9640
9640
  annotationEntry: {
@@ -9705,10 +9705,24 @@ const Sg = /* @__PURE__ */ Er(T5, [["render", O5], ["__scopeId", "data-v-91c822c
9705
9705
  },
9706
9706
  methods: {
9707
9707
  previous: function() {
9708
- this.entryIndex !== 0 && (this.entryIndex = this.entryIndex - 1, this.emitActiveItemChange());
9708
+ if (this.entryIndex !== 0) {
9709
+ this.entryIndex = this.entryIndex - 1, this.emitActiveItemChange();
9710
+ const t = this.annotationEntry[this.entryIndex], e = {
9711
+ event_name: "portal_maps_annotation_previous",
9712
+ category: String((t == null ? void 0 : t.featureId) || "")
9713
+ };
9714
+ this.trackEvent(e);
9715
+ }
9709
9716
  },
9710
9717
  next: function() {
9711
- this.entryIndex !== this.annotationEntry.length - 1 && (this.entryIndex = this.entryIndex + 1, this.emitActiveItemChange());
9718
+ if (this.entryIndex !== this.annotationEntry.length - 1) {
9719
+ this.entryIndex = this.entryIndex + 1, this.emitActiveItemChange();
9720
+ const t = this.annotationEntry[this.entryIndex], e = {
9721
+ event_name: "portal_maps_annotation_next",
9722
+ category: String((t == null ? void 0 : t.featureId) || "")
9723
+ };
9724
+ this.trackEvent(e);
9725
+ }
9712
9726
  },
9713
9727
  emitActiveItemChange: function() {
9714
9728
  const t = { tabType: "annotation" }, e = this.annotationEntry[this.entryIndex], r = { ...t, ...e };
@@ -9833,6 +9847,21 @@ const Sg = /* @__PURE__ */ Er(T5, [["render", O5], ["__scopeId", "data-v-91c822c
9833
9847
  return t.join(`
9834
9848
 
9835
9849
  <br>`);
9850
+ },
9851
+ onCopied: function() {
9852
+ const t = this.annotationEntry[this.entryIndex], e = {
9853
+ event_name: "portal_maps_annotation_copy_content",
9854
+ category: String((t == null ? void 0 : t.featureId) || "")
9855
+ };
9856
+ this.trackEvent(e);
9857
+ },
9858
+ trackEvent: function(t) {
9859
+ const e = {
9860
+ event: "interaction_event",
9861
+ location: "map_annotation",
9862
+ ...t
9863
+ };
9864
+ this.$emit("trackEvent", e);
9836
9865
  }
9837
9866
  },
9838
9867
  watch: {
@@ -9857,7 +9886,7 @@ const Sg = /* @__PURE__ */ Er(T5, [["render", O5], ["__scopeId", "data-v-91c822c
9857
9886
  e.name && e.email && e.canUpdate ? (this.creator = e, e.orcid || (this.creator.orcid = "0000-0000-0000-0000"), this.authenticated = !0) : this.errorMessage = "", this.updatePrevSubmissions();
9858
9887
  });
9859
9888
  }
9860
- }, Ha = (t) => (Ba("data-v-52f81058"), t = t(), $a(), t), P5 = {
9889
+ }, Ha = (t) => (Ba("data-v-2a2f8754"), t = t(), $a(), t), P5 = {
9861
9890
  key: 0,
9862
9891
  class: "toggle-button"
9863
9892
  }, D5 = { class: "block" }, R5 = /* @__PURE__ */ Ha(() => /* @__PURE__ */ ae("div", { class: "title" }, "Feature Annotations", -1)), L5 = { class: "title-buttons" }, F5 = { key: 0 }, M5 = ["href"], N5 = /* @__PURE__ */ Ha(() => /* @__PURE__ */ ae("strong", { class: "sub-title" }, "Previous submissions:", -1)), B5 = /* @__PURE__ */ Ha(() => /* @__PURE__ */ ae("strong", null, "Evidence:  ", -1)), $5 = ["href"], q5 = { key: 1 }, z5 = { key: 2 }, V5 = /* @__PURE__ */ Ha(() => /* @__PURE__ */ ae("strong", null, "Comment:  ", -1)), H5 = /* @__PURE__ */ Ha(() => /* @__PURE__ */ ae("strong", { class: "sub-title" }, "Suggest changes:", -1)), K5 = /* @__PURE__ */ Ha(() => /* @__PURE__ */ ae("strong", null, "Evidence:", -1)), G5 = /* @__PURE__ */ Ha(() => /* @__PURE__ */ ae("strong", null, "Comment:", -1)), U5 = { class: "sub-title" };
@@ -9916,7 +9945,10 @@ function W5(t, e, r, n, a, i) {
9916
9945
  default: U(() => [
9917
9946
  R5,
9918
9947
  ae("div", L5, [
9919
- J(u, { content: i.updatedCopyContent }, null, 8, ["content"])
9948
+ J(u, {
9949
+ onCopied: i.onCopied,
9950
+ content: i.updatedCopyContent
9951
+ }, null, 8, ["onCopied", "content"])
9920
9952
  ])
9921
9953
  ]),
9922
9954
  _: 1
@@ -10190,7 +10222,7 @@ function W5(t, e, r, n, a, i) {
10190
10222
  _: 1
10191
10223
  });
10192
10224
  }
10193
- const j5 = /* @__PURE__ */ Er(A5, [["render", W5], ["__scopeId", "data-v-52f81058"]]), Y5 = {
10225
+ const j5 = /* @__PURE__ */ Er(A5, [["render", W5], ["__scopeId", "data-v-2a2f8754"]]), Y5 = {
10194
10226
  name: "CreateTooltipContent",
10195
10227
  components: {
10196
10228
  Button: mr,
@@ -32322,7 +32354,7 @@ const aK = 1.3, iK = 24 * 60 * 60 * 1e3, oK = "Reset position", wE = "Lock zoom"
32322
32354
  },
32323
32355
  start: function() {
32324
32356
  this.run().then((t) => {
32325
- t != null && t.success ? this.showGraph(this.entry) : t != null && t.error ? this.loadingError = t.error : this.loadingError = "Loading error!";
32357
+ t != null && t.success ? this.showGraph(this.entry) : t != null && t.error ? (this.loadingError = t.error, this.hideSpinner()) : (this.loadingError = "Loading error!", this.hideSpinner());
32326
32358
  }).catch((t) => {
32327
32359
  this.loadingError = "Loading error!", this.hideSpinner();
32328
32360
  });
@@ -32330,11 +32362,11 @@ const aK = 1.3, iK = 24 * 60 * 60 * 1e3, oK = "Reset position", wE = "Lock zoom"
32330
32362
  run: async function() {
32331
32363
  return this.schemaVersion || (this.schemaVersion = await this.getSchemaVersion(), sessionStorage.setItem("connectivity-graph-schema-version", this.schemaVersion), this.updateCacheExpiry()), this.schemaVersion < aK ? {
32332
32364
  error: `No server available for schema-version ${this.schemaVersion}.`
32333
- } : (this.availableSources.length || (this.availableSources = await this.loadAvailableSources()), this.isSCKANVersionAvailable() ? (await this.setPathList(this.selectedSource), {
32334
- success: !0
32335
- }) : {
32365
+ } : (this.availableSources.length || (this.availableSources = await this.loadAvailableSources()), !this.connectivityFromMap && !this.isSCKANVersionAvailable() ? {
32336
32366
  error: `No data available for SCKAN version ${this.selectedSource}.`
32337
- });
32367
+ } : (await this.setPathList(this.selectedSource), {
32368
+ success: !0
32369
+ }));
32338
32370
  },
32339
32371
  showGraph: async function(t) {
32340
32372
  const e = this.$refs.graphCanvas;
@@ -32463,7 +32495,7 @@ const aK = 1.3, iK = 24 * 60 * 60 * 1e3, oK = "Reset position", wE = "Lock zoom"
32463
32495
  }, vK = {
32464
32496
  ref: "graphCanvas",
32465
32497
  class: "graph-canvas"
32466
- }, hK = { class: "control-panel control-panel-tools" }, pK = { class: "visually-hidden" }, gK = { class: "visually-hidden" }, yK = { class: "visually-hidden" }, mK = { class: "visually-hidden" }, bK = /* @__PURE__ */ nI('<div class="control-panel control-panel-nodes" data-v-1239b5ce><div class="node-key" data-v-1239b5ce><div class="key-box-container" data-v-1239b5ce><div class="key-box key-box-dendrite" data-v-1239b5ce> Origin </div><div class="key-box key-box-node" data-v-1239b5ce> Components </div><div class="key-box key-box-axon" data-v-1239b5ce> Destination </div></div></div></div>', 1), wK = { class: "connectivity-graph-error" }, CK = {
32498
+ }, hK = { class: "control-panel control-panel-tools" }, pK = { class: "visually-hidden" }, gK = { class: "visually-hidden" }, yK = { class: "visually-hidden" }, mK = { class: "visually-hidden" }, bK = /* @__PURE__ */ nI('<div class="control-panel control-panel-nodes" data-v-95331209><div class="node-key" data-v-95331209><div class="key-box-container" data-v-95331209><div class="key-box key-box-dendrite" data-v-95331209> Origin </div><div class="key-box key-box-node" data-v-95331209> Components </div><div class="key-box key-box-axon" data-v-95331209> Destination </div></div></div></div>', 1), wK = { class: "connectivity-graph-error" }, CK = {
32467
32499
  key: 0,
32468
32500
  class: "loading-error"
32469
32501
  };
@@ -32597,7 +32629,7 @@ function xK(t, e, r, n, a, i) {
32597
32629
  [v, t.loading]
32598
32630
  ]);
32599
32631
  }
32600
- const B7 = /* @__PURE__ */ Er(dK, [["render", xK], ["__scopeId", "data-v-1239b5ce"]]), F_ = (t) => t && t.charAt(0).toUpperCase() + t.slice(1), EK = (t) => t.replace(/\w\S*/g, (e) => e.charAt(0).toUpperCase() + e.substr(1).toLowerCase()), SK = (t) => new Promise((e) => setTimeout(e, t)), kK = {
32632
+ const B7 = /* @__PURE__ */ Er(dK, [["render", xK], ["__scopeId", "data-v-95331209"]]), F_ = (t) => t && t.charAt(0).toUpperCase() + t.slice(1), EK = (t) => t.replace(/\w\S*/g, (e) => e.charAt(0).toUpperCase() + e.substr(1).toLowerCase()), SK = (t) => new Promise((e) => setTimeout(e, t)), kK = {
32601
32633
  name: "ConnectivityList",
32602
32634
  components: {
32603
32635
  Button: mr,
@@ -34345,6 +34377,13 @@ const bT = /* @__PURE__ */ Er(EG, [["render", kG], ["__scopeId", "data-v-2f3dd1d
34345
34377
  methods: {
34346
34378
  showRelatedConnectivities: function(t) {
34347
34379
  this.$emit("show-reference-connectivities", t);
34380
+ const e = {
34381
+ event: "interaction_event",
34382
+ event_name: "portal_maps_show_related_connectivities",
34383
+ category: t,
34384
+ location: "map_connectivity_references"
34385
+ };
34386
+ this.$emit("trackEvent", e);
34348
34387
  },
34349
34388
  formatReferences: function(t) {
34350
34389
  const e = this.extractNonPubMedReferences(t), r = t.filter((n) => !e.includes(n));
@@ -34558,9 +34597,26 @@ const bT = /* @__PURE__ */ Er(EG, [["render", kG], ["__scopeId", "data-v-2f3dd1d
34558
34597
  } catch (r) {
34559
34598
  throw new Error(r);
34560
34599
  }
34600
+ },
34601
+ onCopied: function(t, e) {
34602
+ let r = "Reference List", n = "", a = this.citationType;
34603
+ e ? (r = e.resource, n = e.type === "doi" ? e.id : "") : r = [
34604
+ ...this.pubMedReferences,
34605
+ ...this.openLibReferences,
34606
+ ...this.isbnDBReferences
34607
+ ].map((u) => u.type === "doi" ? u.id : u.resource).join(", ");
34608
+ const i = {
34609
+ event: "interaction_event",
34610
+ event_name: "portal_maps_copy_citation",
34611
+ category: r,
34612
+ doi: n,
34613
+ citation_type: a,
34614
+ location: "map_connectivity_references"
34615
+ };
34616
+ this.$emit("trackEvent", i);
34561
34617
  }
34562
34618
  }
34563
- }, Za = (t) => (Ba("data-v-a49d7266"), t = t(), $a(), t), AG = { class: "resource-container" }, PG = { class: "attribute-title-container" }, DG = /* @__PURE__ */ Za(() => /* @__PURE__ */ ae("div", { class: "attribute-title" }, "References", -1)), RG = { class: "copy-button" }, LG = {
34619
+ }, Za = (t) => (Ba("data-v-e4259096"), t = t(), $a(), t), AG = { class: "resource-container" }, PG = { class: "attribute-title-container" }, DG = /* @__PURE__ */ Za(() => /* @__PURE__ */ ae("div", { class: "attribute-title" }, "References", -1)), RG = { class: "copy-button" }, LG = {
34564
34620
  key: 0,
34565
34621
  class: "citation-tabs"
34566
34622
  }, FG = { class: "citation-list" }, MG = /* @__PURE__ */ Za(() => /* @__PURE__ */ ae("span", null, "Internal Server Error", -1)), NG = /* @__PURE__ */ Za(() => /* @__PURE__ */ ae("br", null, null, -1)), BG = /* @__PURE__ */ Za(() => /* @__PURE__ */ ae("br", null, null, -1)), $G = ["href"], qG = /* @__PURE__ */ Za(() => /* @__PURE__ */ ae("br", null, null, -1)), zG = /* @__PURE__ */ Za(() => /* @__PURE__ */ ae("span", null, "Sorry, something went wrong.", -1)), VG = /* @__PURE__ */ Za(() => /* @__PURE__ */ ae("br", null, null, -1)), HG = ["onClick"], KG = ["innerHTML"], GG = ["innerHTML"], UG = ["href"];
@@ -34571,6 +34627,7 @@ function WG(t, e, r, n, a, i) {
34571
34627
  DG,
34572
34628
  ae("div", RG, [
34573
34629
  J(o, {
34630
+ onCopied: e[0] || (e[0] = (l) => i.onCopied(l, "")),
34574
34631
  label: "Copy list to clipboard",
34575
34632
  content: t.referecesListContent
34576
34633
  }, null, 8, ["content"])
@@ -34630,8 +34687,9 @@ function WG(t, e, r, n, a, i) {
34630
34687
  onShowRelatedConnectivities: i.showRelatedConnectivities
34631
34688
  }, null, 8, ["resource", "onShowRelatedConnectivities"]),
34632
34689
  J(o, {
34690
+ onCopied: (v) => i.onCopied(v, l),
34633
34691
  content: l.citation[t.citationType]
34634
- }, null, 8, ["content"])
34692
+ }, null, 8, ["onCopied", "content"])
34635
34693
  ], 64))
34636
34694
  ], 64)) : pe("", !0)
34637
34695
  ], 2);
@@ -34647,8 +34705,9 @@ function WG(t, e, r, n, a, i) {
34647
34705
  onShowRelatedConnectivities: i.showRelatedConnectivities
34648
34706
  }, null, 8, ["resource", "onShowRelatedConnectivities"]),
34649
34707
  J(o, {
34708
+ onCopied: (c) => i.onCopied(c, l),
34650
34709
  content: i.formatCopyReference(l)
34651
- }, null, 8, ["content"])
34710
+ }, null, 8, ["onCopied", "content"])
34652
34711
  ]))), 128)),
34653
34712
  (q(!0), ie(je, null, Lt(t.isbnDBReferences, (l) => (q(), ie("li", {
34654
34713
  key: l.id
@@ -34662,13 +34721,14 @@ function WG(t, e, r, n, a, i) {
34662
34721
  onShowRelatedConnectivities: i.showRelatedConnectivities
34663
34722
  }, null, 8, ["resource", "onShowRelatedConnectivities"]),
34664
34723
  J(o, {
34724
+ onCopied: (c) => i.onCopied(c, l),
34665
34725
  content: l.url
34666
- }, null, 8, ["content"])
34726
+ }, null, 8, ["onCopied", "content"])
34667
34727
  ]))), 128))
34668
34728
  ])
34669
34729
  ]);
34670
34730
  }
34671
- const wT = /* @__PURE__ */ Er(OG, [["render", WG], ["__scopeId", "data-v-a49d7266"]]);
34731
+ const wT = /* @__PURE__ */ Er(OG, [["render", WG], ["__scopeId", "data-v-e4259096"]]);
34672
34732
  function jG(t) {
34673
34733
  return { all: t = t || /* @__PURE__ */ new Map(), on: function(e, r) {
34674
34734
  var n = t.get(e);