@abi-software/map-side-bar 2.14.2-demo.1 → 2.14.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abi-software/map-side-bar",
3
- "version": "2.14.2-demo.1",
3
+ "version": "2.14.2",
4
4
  "license": "Apache-2.0",
5
5
  "repository": {
6
6
  "type": "git",
@@ -12,6 +12,21 @@
12
12
  @click="toggleTitleExpansion"
13
13
  >
14
14
  <span>{{ capitalise(displayTitle) }}</span>
15
+ <template v-if="entry.featuresAlert">
16
+ <el-popover
17
+ width="250"
18
+ trigger="hover"
19
+ :teleported="false"
20
+ popper-class="popover-origin-help"
21
+ >
22
+ <template #reference>
23
+ <el-icon class="alert"><el-icon-warn-triangle-filled /></el-icon>
24
+ </template>
25
+ <span style="word-break: keep-all">
26
+ {{ entry.featuresAlert }}
27
+ </span>
28
+ </el-popover>
29
+ </template>
15
30
  </div>
16
31
  <button
17
32
  v-if="showTitleToggle"
@@ -26,19 +41,7 @@
26
41
  </el-icon>
27
42
  </button>
28
43
  </div>
29
- <div class="subtitle">
30
- <strong>Id: </strong>{{ entry.featureId[0] }}
31
- <el-button
32
- round
33
- size="small"
34
- class="alert-chip"
35
- @click="showAlertMessage"
36
- v-if="entry.featuresAlert"
37
- >
38
- <el-icon class="alert"><el-icon-warn-triangle-filled /></el-icon>
39
- Notes
40
- </el-button>
41
- </div>
44
+ <div class="subtitle"><strong>Id: </strong>{{ entry.featureId[0] }}</div>
42
45
  <div v-if="hasProvenanceTaxonomyLabel" class="subtitle">
43
46
  {{ provSpeciesDescription }}
44
47
  </div>
@@ -287,22 +290,6 @@
287
290
  @trackEvent="onTrackEvent"
288
291
  />
289
292
  </div>
290
-
291
- <div
292
- ref="alertElement"
293
- class="content-container content-container-alert"
294
- v-if="entry.featuresAlert"
295
- >
296
- <div class="block attribute-title-container">
297
- <span class="attribute-title">Alert</span>
298
- </div>
299
- <div class="block">
300
- <div class="alert-block"
301
- v-for="alert in entry.featuresAlert"
302
- v-html="formatAlertText(alert)"
303
- ></div>
304
- </div>
305
- </div>
306
293
  </div>
307
294
  </template>
308
295
 
@@ -798,14 +785,6 @@ export default {
798
785
  contentArray.push(contentString);
799
786
  }
800
787
 
801
- // Alert
802
- if (this.entry.featuresAlert) {
803
- const alertContent = this.entry.featuresAlert
804
- .map((alert) => this.formatAlertText(alert))
805
- .join('\n');
806
- contentArray.push(`<div><strong>Alert</strong></div>\n${alertContent}`);
807
- }
808
-
809
788
  return contentArray.join('\n\n<br>');
810
789
  },
811
790
  getConnectivityDatasets: function (label) {
@@ -932,51 +911,6 @@ export default {
932
911
  onTrackEvent: function (data) {
933
912
  EventBus.emit('trackEvent', data);
934
913
  },
935
- showAlertMessage: function () {
936
- // scroll to alert message
937
- this.$nextTick(() => {
938
- const alertElement = this.$refs.alertElement;
939
- if (alertElement) {
940
- alertElement.scrollIntoView({
941
- behavior: 'smooth',
942
- block: 'start',
943
- inline: 'nearest',
944
- });
945
- }
946
- });
947
- },
948
- formatAlertText: function (text) {
949
- if (!text) return '';
950
- const escaped = text
951
- .replace(/&/g, '&amp;')
952
- .replace(/</g, '&lt;')
953
- .replace(/>/g, '&gt;');
954
- const linkified = escaped.replace(
955
- /(https?:\/\/[^\s"<>\[]+)/g,
956
- (url) => {
957
- const parts = url.match(/^(.*?)([\].,;:!?]*)$/);
958
- const cleanUrl = parts ? parts[1] : url;
959
- const suffix = parts ? parts[2] : '';
960
- return `<a href="${cleanUrl}" target="_blank" rel="noopener noreferrer">${cleanUrl}</a>${suffix}`;
961
- }
962
- );
963
-
964
- const normalised = linkified
965
- .replace(/\\n/g, '\n')
966
- .replace(/\r\n/g, '\n')
967
- .replace(/\r/g, '\n');
968
-
969
- return normalised
970
- .split('\n')
971
- .map((line) => {
972
- const withBoldLabel = line.replace(
973
- /^\s*([A-Za-z][^:<]{0,120}:)/,
974
- '<strong>$1</strong>'
975
- );
976
- return `<div class="alert-line">${withBoldLabel}</div>`;
977
- })
978
- .join('\n');
979
- },
980
914
  },
981
915
  mounted: function () {
982
916
  this.updatedCopyContent = this.getUpdateCopyContent();
@@ -1155,6 +1089,15 @@ export default {
1155
1089
  text-transform: uppercase;
1156
1090
  }
1157
1091
 
1092
+ .main {
1093
+ .el-button.is-round {
1094
+ border-radius: 4px;
1095
+ padding: 9px 20px 10px 20px;
1096
+ display: flex;
1097
+ height: 36px;
1098
+ }
1099
+ }
1100
+
1158
1101
  .button {
1159
1102
  margin-left: 0px !important;
1160
1103
  margin-top: 0px !important;
@@ -1477,6 +1420,10 @@ export default {
1477
1420
 
1478
1421
  .content-container-connectivity {
1479
1422
  position: relative;
1423
+
1424
+ &:not([style*="display: none"]) ~ .content-container-references {
1425
+ margin-top: -1.25rem;
1426
+ }
1480
1427
  }
1481
1428
 
1482
1429
  .attribute-content {
@@ -1520,48 +1467,4 @@ export default {
1520
1467
  margin-bottom: 0.5em;
1521
1468
  }
1522
1469
  }
1523
-
1524
- .alert-block {
1525
- background-color: var(--el-color-warning-light-9);
1526
- border: 1px dashed var(--el-color-warning);
1527
- padding: 0.75rem;
1528
- border-radius: 4px;
1529
-
1530
- :deep(.alert-line + .alert-line) {
1531
- margin-top: 0.5rem;
1532
- }
1533
-
1534
- :deep(a) {
1535
- color: $app-primary-color;
1536
- word-break: break-all;
1537
-
1538
- &:hover {
1539
- opacity: 0.8;
1540
- }
1541
- }
1542
- }
1543
-
1544
- .alert-chip {
1545
- margin-left: 5px;
1546
- background-color: $app-primary-color;
1547
- border-color: $app-primary-color;
1548
- color: #fff;
1549
-
1550
- &:hover {
1551
- color: #fff !important;
1552
- background-color: #ac76c5 !important;
1553
- border: 1px solid #ac76c5 !important;
1554
- }
1555
-
1556
- :deep(> span) {
1557
- gap: 2px;
1558
- }
1559
-
1560
- .alert {
1561
- width: 1rem;
1562
- height: 1rem;
1563
- color: inherit;
1564
- margin: 0;
1565
- }
1566
- }
1567
1470
  </style>