@abi-software/map-side-bar 2.16.0 → 2.17.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.
@@ -0,0 +1,23 @@
1
+ import js from "@eslint/js";
2
+ import vue from "eslint-plugin-vue";
3
+ import globals from "globals";
4
+
5
+ export default [
6
+ {
7
+ ignores: ["dist/**", "docs/.vitepress/**", "docs/components/**"],
8
+ },
9
+ js.configs.recommended,
10
+ ...vue.configs["flat/essential"],
11
+ {
12
+ files: ["**/*.{js,vue}"],
13
+ languageOptions: {
14
+ ecmaVersion: "latest",
15
+ sourceType: "module",
16
+ globals: {
17
+ ...globals.node,
18
+ ...globals.browser,
19
+ },
20
+ },
21
+ rules: {},
22
+ },
23
+ ];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abi-software/map-side-bar",
3
- "version": "2.16.0",
3
+ "version": "2.17.0",
4
4
  "license": "Apache-2.0",
5
5
  "engines": {
6
6
  "node": ">=20"
@@ -20,6 +20,7 @@
20
20
  "serve": "vite --host",
21
21
  "build-bundle": "vite build",
22
22
  "preview": "vite preview",
23
+ "lint": "eslint .",
23
24
  "test": "cypress run --component",
24
25
  "cypress:open": "cypress open",
25
26
  "release:beta": "npm version prerelease --preid=beta; npm publish --tag beta",
@@ -46,45 +47,49 @@
46
47
  "./src/*": "./src/*"
47
48
  },
48
49
  "dependencies": {
49
- "@abi-software/gallery": "1.3.0",
50
- "@abi-software/map-utilities": "1.9.0",
51
- "@abi-software/svg-sprite": "^1.1.0",
52
- "@element-plus/icons-vue": "^2.3.1",
53
- "algoliasearch": "^4.10.5",
54
- "element-plus": "2.8.4",
55
- "js-base64": "^3.7.7",
56
- "marked": "^4.1.1",
50
+ "@abi-software/gallery": "1.4.0",
51
+ "@abi-software/map-utilities": "1.10.0",
52
+ "@abi-software/svg-sprite": "1.2.0",
53
+ "@element-plus/icons-vue": "^2.3.2",
54
+ "algoliasearch": "^4.27.0",
55
+ "element-plus": "^2.14.5",
56
+ "js-base64": "^3.9.2",
57
+ "marked": "^8.0.1",
57
58
  "mitt": "^3.0.1",
58
- "unplugin-vue-components": "^0.26.0",
59
- "vue": "^3.4.21",
60
- "xss": "^1.0.14"
59
+ "vue": "^3.5.41",
60
+ "xss": "^1.0.15"
61
61
  },
62
62
  "devDependencies": {
63
- "@vitejs/plugin-vue": "^4.6.2",
64
- "@vue/compiler-sfc": "^3.3.13",
63
+ "@eslint/js": "^10.0.1",
64
+ "@vitejs/plugin-vue": "^6.0.8",
65
+ "unplugin-vue-components": "^32.1.0",
66
+ "@vue/compiler-sfc": "^3.5.41",
65
67
  "@vuese/markdown-render": "^2.11.3",
66
- "auto-changelog": "^2.4.0",
67
- "autoprefixer": "^10.4.17",
68
- "chokidar": "^3.6.0",
69
- "concurrently": "^8.2.2",
70
- "cypress": "^13.13.0",
71
- "cypress-multi-reporters": "^1.6.4",
72
- "cypress-wait-until": "^3.0.1",
73
- "eslint": "^8.56.0",
74
- "eslint-plugin-vue": "^9.19.2",
75
- "mochawesome": "^7.1.3",
76
- "raw-loader": "^0.5.1",
77
- "sass": "^1.70.0",
68
+ "auto-changelog": "^2.6.0",
69
+ "autoprefixer": "^10.5.4",
70
+ "chokidar": "^5.0.0",
71
+ "concurrently": "^9.2.4",
72
+ "cypress": "^15.21.0",
73
+ "cypress-multi-reporters": "^2.0.5",
74
+ "cypress-wait-until": "^3.0.2",
75
+ "eslint": "^10.9.1",
76
+ "eslint-plugin-vue": "^10.10.0",
77
+ "globals": "^17.11.0",
78
+ "mochawesome": "^8.0.1",
79
+ "raw-loader": "^4.0.2",
80
+ "sass": "^1.103.1",
78
81
  "transform-loader": "^0.2.4",
79
- "typescript": "^4.4.3",
80
- "vite": "^5.0.10",
81
- "vitepress": "^1.0.2",
82
+ "typescript": "^7.0.2",
83
+ "vite": "^8.2.1",
84
+ "vitepress": "^1.6.4",
82
85
  "vue-custom-element": "^3.3.0",
83
86
  "vue-docgen-api": "^4.79.2"
84
87
  },
85
88
  "optionalDependencies": {
86
- "@rollup/rollup-darwin-arm64": "4.59.0",
87
- "@rollup/rollup-linux-x64-gnu": "4.59.0",
88
- "@rollup/rollup-win32-x64-msvc": "4.59.0"
89
+ "@esbuild/darwin-arm64": "0.28.2",
90
+ "@esbuild/linux-x64": "0.28.2",
91
+ "@rollup/rollup-darwin-arm64": "4.63.0",
92
+ "@rollup/rollup-linux-x64-gnu": "4.63.0",
93
+ "@rollup/rollup-win32-x64-msvc": "4.63.0"
89
94
  }
90
95
  }
@@ -1,4 +1,5 @@
1
- @import '_variables';
1
+ @use '_variables' as *;
2
+ @forward '_variables';
2
3
 
3
4
  .pagination {
4
5
  padding-bottom: 16px;
@@ -1,4 +1,7 @@
1
1
 
2
+ @use '_variables' as *;
3
+ @forward '_variables';
4
+
2
5
  .filter-help-popover {
3
6
  font-family: 'Asap', sans-serif;
4
7
  background: #f3ecf6 !important;
@@ -1,6 +1,7 @@
1
- @import url('https://fonts.googleapis.com/css?family=Asap:400,400i,500,600,700&display=swap');
1
+ @use '_variables' as *;
2
+ @forward '_variables';
2
3
 
3
- @import '_variables';
4
+ @import url('https://fonts.googleapis.com/css?family=Asap:400,400i,500,600,700&display=swap');
4
5
 
5
6
  /* icon font path, required */
6
7
  $--color-primary: $app-primary-color !default;
@@ -97,7 +97,7 @@ export default {
97
97
  </script>
98
98
 
99
99
  <style lang="scss" scoped>
100
- @import '../assets/connectivity-explorer.scss';
100
+ @use '../assets/connectivity-explorer.scss';
101
101
 
102
102
  .connectivity-card {
103
103
  padding-left: 5px;
@@ -653,8 +653,8 @@ export default {
653
653
  </script>
654
654
 
655
655
  <style lang="scss" scoped>
656
- @import '../assets/searchPopover.scss';
657
- @import '../assets/pagination.scss';
656
+ @use '../assets/searchPopover.scss';
657
+ @use '../assets/pagination.scss';
658
658
 
659
659
  .connectivity-card {
660
660
  position: relative;
@@ -1216,7 +1216,7 @@ export default {
1216
1216
  </script>
1217
1217
 
1218
1218
  <style lang="scss" scoped>
1219
- @import '../assets/connectivity-explorer.scss';
1219
+ @use '../assets/connectivity-explorer.scss';
1220
1220
 
1221
1221
  .connectivity-info-title {
1222
1222
  padding: 0;
@@ -57,7 +57,7 @@ export default {
57
57
  </script>
58
58
 
59
59
  <style lang="scss" scoped>
60
- @import '../assets/_variables.scss';
60
+ @use '../assets/_variables.scss';
61
61
 
62
62
  .contributor-item {
63
63
  display: inline;
@@ -67,7 +67,7 @@ export default {
67
67
  </style>
68
68
 
69
69
  <style lang="scss">
70
- @import '../assets/_variables.scss';
70
+ @use '../assets/_variables.scss';
71
71
 
72
72
  .contributor-popover.el-popover {
73
73
  font-family: $font-family;
@@ -217,6 +217,7 @@ export default {
217
217
  },
218
218
  createFlatmapItems: function () {
219
219
  if (this.entry.flatmaps) {
220
+ const flatmaps = []
220
221
  this.entry.flatmaps.forEach((flatmap) => {
221
222
  if (flatmap.associated_flatmap?.identifier) {
222
223
  const filePath = flatmap.dataset.path
@@ -245,7 +246,7 @@ export default {
245
246
  doi: this.entry.doi,
246
247
  version: this.version,
247
248
  }
248
- this.items['Flatmaps'].push({
249
+ flatmaps.push({
249
250
  id,
250
251
  title: baseName(filePath),
251
252
  type: 'Flatmap',
@@ -256,6 +257,7 @@ export default {
256
257
  })
257
258
  }
258
259
  })
260
+ this.items['Flatmaps'].push(...flatmaps.sort((a, b) => a.title.localeCompare(b.title)))
259
261
  }
260
262
  },
261
263
  createImageItems: function () {
@@ -276,6 +278,7 @@ export default {
276
278
  },
277
279
  createPlotItems: function () {
278
280
  if (this.entry.plots) {
281
+ const plots = []
279
282
  this.entry.plots.forEach((plot) => {
280
283
  const filePath = plot.dataset.path
281
284
  const id = plot.identifier
@@ -333,7 +336,7 @@ export default {
333
336
  discoverId: this.discoverId,
334
337
  version: this.version,
335
338
  }
336
- this.items['Plots'].push({
339
+ plots.push({
337
340
  id,
338
341
  title: baseName(filePath),
339
342
  type: 'Plot',
@@ -343,11 +346,14 @@ export default {
343
346
  mimetype,
344
347
  })
345
348
  })
349
+ this.items['Plots'].push(...plots.sort((a, b) => a.title.localeCompare(b.title)))
350
+
346
351
  }
347
352
  },
348
353
  createScaffoldItems: function () {
349
354
  if (this.entry.scaffolds) {
350
355
  let index = 0
356
+ const scaffolds = []
351
357
  this.entry.scaffolds.forEach((scaffold, i) => {
352
358
  const filePath = scaffold.dataset.path
353
359
  const id = scaffold.identifier
@@ -381,7 +387,7 @@ export default {
381
387
  s3uri: this.entry.s3uri,
382
388
  contextCardUrl: this.getContextCardUrl(i),
383
389
  }
384
- this.items['Scaffolds'].push({
390
+ scaffolds.push({
385
391
  id,
386
392
  title: baseName(filePath),
387
393
  type: 'Scaffold',
@@ -391,10 +397,12 @@ export default {
391
397
  mimetype,
392
398
  })
393
399
  })
400
+ this.items['Scaffolds'].push(...scaffolds.sort((a, b) => a.title.localeCompare(b.title)))
394
401
  }
395
402
  },
396
403
  createSimulationItems: function () {
397
404
  if (this.entry.simulation) {
405
+ const simulations = []
398
406
  this.entry.simulation.forEach((simulation) => {
399
407
  if (simulation.additional_mimetype.name === "application/x.vnd.abi.simulation+json") {
400
408
  let action = {
@@ -409,7 +417,7 @@ export default {
409
417
  discoverId: this.discoverId,
410
418
  dataset: `${this.envVars.ROOT_URL}/datasets/${this.discoverId}?type=dataset`,
411
419
  }
412
- this.items['Simulations'].push({
420
+ simulations.push({
413
421
  id: 'simulation',
414
422
  title: ' ',
415
423
  type: 'Simulation',
@@ -448,7 +456,7 @@ export default {
448
456
  doi: this.entry.doi,
449
457
  version: this.version,
450
458
  }
451
- this.items['Simulations'].push({
459
+ simulations.push({
452
460
  id,
453
461
  title: baseName(filePath),
454
462
  type: 'Simulation',
@@ -459,6 +467,7 @@ export default {
459
467
  })
460
468
  }
461
469
  })
470
+ this.items['Simulations'].push(...simulations.sort((a, b) => a.title.localeCompare(b.title)))
462
471
  }
463
472
  },
464
473
  createVideoItems: function () {
@@ -573,8 +573,8 @@ export default {
573
573
  </script>
574
574
 
575
575
  <style lang="scss" scoped>
576
- @import '../assets/searchPopover.scss';
577
- @import '../assets/pagination.scss';
576
+ @use '../assets/searchPopover.scss';
577
+ @use '../assets/pagination.scss';
578
578
 
579
579
  .dataset-card {
580
580
  position: relative;
@@ -208,6 +208,10 @@ export default {
208
208
  showFiltersText: true,
209
209
  cascadeSelected: [],
210
210
  cascadeSelectedWithBoolean: [],
211
+ // Re-entrancy lock: el-cascader can echo an extra @change
212
+ // after we reassign cascadeSelected in setCascader;
213
+ // stays locked until the filterTimeout debounce below unlocks it.
214
+ cascadeEventLocked: false,
211
215
  filterTimeout: null,
212
216
  numberShown: 10,
213
217
  filters: [],
@@ -258,7 +262,6 @@ export default {
258
262
  if (this.options.length) {
259
263
  this.checkShowAllBoxes()
260
264
  // this.setCascader(this.entry.filterFacets)
261
- this.cssMods()
262
265
  this.$emit('cascaderReady')
263
266
  }
264
267
  })
@@ -570,6 +573,12 @@ export default {
570
573
  },
571
574
  // cascadeEvent: initiate searches based off cascader changes
572
575
  cascadeEvent: function (eventIn) {
576
+ // Ignore the echoed @change el-cascader fires
577
+ // after we reassign cascadeSelected in setCascader
578
+ if (this.cascadeEventLocked) {
579
+ return
580
+ }
581
+ this.cascadeEventLocked = true
573
582
  let event = [...eventIn]
574
583
  if (event) {
575
584
  // Check for show all in selected cascade options
@@ -667,7 +676,7 @@ export default {
667
676
 
668
677
  this.filterTimeout = setTimeout(() => {
669
678
  this.$emit('filterResults', filters) // emit filters for apps above sidebar
670
- this.cssMods() // update css for the cascader
679
+ this.cascadeEventLocked = false // safe to process real cascader changes again
671
680
  }, 600);
672
681
  }
673
682
  },
@@ -775,7 +784,6 @@ export default {
775
784
  this.updateListFilters(this.__expandItem__[0])
776
785
  }
777
786
  this.updateListStyleOrder()
778
- this.cssMods()
779
787
  },
780
788
  updateListStyleOrder: function () {
781
789
  this.$nextTick(() => {
@@ -954,30 +962,6 @@ export default {
954
962
  })
955
963
  )
956
964
  },
957
- makeCascadeLabelsClickable: function () {
958
- // Next tick allows the cascader menu to change
959
- this.$nextTick(() => {
960
- document
961
- .querySelectorAll('.sidebar-cascader-popper .el-cascader-node__label')
962
- .forEach((el) => {
963
- // step through each cascade label
964
- el.onclick = function () {
965
- const checkbox = this.previousElementSibling
966
- if (checkbox) {
967
- if (!checkbox.parentElement.attributes['aria-owns']) {
968
- // check if we are at the lowest level of cascader
969
- this.previousElementSibling.click() // Click the checkbox
970
- }
971
- }
972
- }
973
- })
974
- })
975
- },
976
-
977
- cssMods: function () {
978
- this.makeCascadeLabelsClickable()
979
- },
980
-
981
965
  flattenToFilters: function (filter, targetOption, previousMatched = false) {
982
966
  let filtersArray = []
983
967
 
@@ -1142,7 +1126,6 @@ export default {
1142
1126
  this.cascaderIsReady = true
1143
1127
  this.checkShowAllBoxes()
1144
1128
  this.setCascader(this.entry.filterFacets)
1145
- this.cssMods()
1146
1129
  this.$emit('cascaderReady')
1147
1130
  })
1148
1131
  },
@@ -1,10 +1,14 @@
1
1
  /* eslint-disable */
2
- /* prettier-ignore */
3
2
  // @ts-nocheck
3
+ // biome-ignore lint: disable
4
+ // oxlint-disable
5
+ // ------
4
6
  // Generated by unplugin-vue-components
5
7
  // Read more: https://github.com/vuejs/core/pull/3399
8
+
6
9
  export {}
7
10
 
11
+ /* prettier-ignore */
8
12
  declare module 'vue' {
9
13
  export interface GlobalComponents {
10
14
  AnnotationTool: typeof import('./components/AnnotationTool.vue')['default']
@@ -50,7 +54,7 @@ declare module 'vue' {
50
54
  SideBar: typeof import('./components/SideBar.vue')['default']
51
55
  Tabs: typeof import('./components/Tabs.vue')['default']
52
56
  }
53
- export interface ComponentCustomProperties {
57
+ export interface GlobalDirectives {
54
58
  vLoading: typeof import('element-plus/es')['ElLoadingDirective']
55
59
  }
56
60
  }
package/vite.config.js CHANGED
@@ -28,12 +28,12 @@ export default defineConfig({
28
28
  ],
29
29
  resolve: {
30
30
  alias: {
31
- '@': resolve(__dirname, './src'),
31
+ '@': resolve(import.meta.dirname, './src'),
32
32
  }
33
33
  },
34
34
  build: {
35
35
  lib: {
36
- entry: resolve(__dirname, "./src/components/index.js"),
36
+ entry: resolve(import.meta.dirname, "./src/components/index.js"),
37
37
  name: "MapSideBar",
38
38
  fileName: 'map-side-bar',
39
39
  },
@@ -45,14 +45,20 @@ export default defineConfig({
45
45
  "@abi-software/map-utilities": "@abi-software/map-utilities",
46
46
  "@element-plus/icons-vue": "@element-plus/icons-vue"
47
47
  },
48
+ // keep css output name stable for the "./dist/style.css" export/import paths
49
+ assetFileNames: (assetInfo) =>
50
+ assetInfo.name?.endsWith(".css")
51
+ ? "style.css"
52
+ : "assets/[name][extname]",
48
53
  },
49
54
  },
50
55
  },
51
56
  css: {
52
57
  preprocessorOptions: {
53
58
  scss: {
54
- additionalData: `@use './src/assets/styles' as *;`
59
+ api: 'modern-compiler',
60
+ additionalData: `@use '@/assets/styles' as *;`
55
61
  }
56
62
  }
57
63
  }
58
- })
64
+ })
package/.eslintrc.js DELETED
@@ -1,12 +0,0 @@
1
- module.exports = {
2
- root: true,
3
- env: {
4
- node: true,
5
- es2022: true,
6
- },
7
- extends: [
8
- "plugin:vue/essential",
9
- "eslint:recommended"
10
- ],
11
- rules: {}
12
- }
package/static.json DELETED
@@ -1,7 +0,0 @@
1
- {
2
- "root": "dist",
3
- "clean_urls": true,
4
- "routes": {
5
- "/**": "index.html"
6
- }
7
- }