@abi-software/map-side-bar 2.17.1-demo.1 → 2.19.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.
Files changed (41) hide show
  1. package/.postcssrc.json +5 -5
  2. package/README.md +8 -9
  3. package/cypress.config.js +6 -7
  4. package/dist/map-side-bar.js +5906 -7001
  5. package/dist/map-side-bar.umd.cjs +62 -65
  6. package/dist/style.css +1 -1
  7. package/eslint.config.js +44 -9
  8. package/package.json +12 -5
  9. package/reporter-config.json +1 -1
  10. package/src/App.vue +80 -86
  11. package/src/algolia/algolia.js +173 -167
  12. package/src/algolia/utils.js +34 -38
  13. package/src/assets/_variables.scss +12 -10
  14. package/src/assets/connectivity-explorer.scss +1 -1
  15. package/src/assets/fonts.scss +0 -1
  16. package/src/assets/searchPopover.scss +1 -2
  17. package/src/components/AnnotationTool.vue +9 -32
  18. package/src/components/BadgesGroup.vue +29 -32
  19. package/src/components/ConnectivityCard.vue +22 -19
  20. package/src/components/ConnectivityExplorer.vue +107 -128
  21. package/src/components/ConnectivityInfo.vue +169 -128
  22. package/src/components/ContributorItem.vue +15 -11
  23. package/src/components/DatasetCard.vue +166 -201
  24. package/src/components/DatasetExplorer.vue +160 -201
  25. package/src/components/ImageGallery.vue +35 -36
  26. package/src/components/SearchFilters.vue +381 -408
  27. package/src/components/SearchHistory.vue +75 -91
  28. package/src/components/SideBar.vue +86 -193
  29. package/src/components/Tabs.vue +16 -30
  30. package/src/components/index.js +3 -5
  31. package/src/components/species-map.js +7 -7
  32. package/src/components.d.ts +0 -3
  33. package/src/exampleConnectivityInput.js +310 -318
  34. package/src/main.js +6 -6
  35. package/src/mixins/S3Bucket.vue +10 -13
  36. package/vite.config.js +62 -61
  37. package/vuese-generator.js +47 -55
  38. package/src/components/CellCard.vue +0 -994
  39. package/src/components/CellCardExplorer.vue +0 -882
  40. package/src/components/icons/IconOpenExternal.vue +0 -28
  41. package/src/utils/common.js +0 -71
package/src/main.js CHANGED
@@ -1,10 +1,10 @@
1
- import { createApp } from 'vue'
2
- import App from './App.vue'
3
- import "./assets/fonts.scss"
4
- import MapSideBar from './components/SideBar.vue'
1
+ import { createApp } from 'vue';
2
+ import App from './App.vue';
3
+ import './assets/fonts.scss';
4
+ import MapSideBar from './components/SideBar.vue';
5
5
 
6
6
  const app = createApp(App);
7
7
 
8
- app.component('MapSideBar', MapSideBar)
8
+ app.component('MapSideBar', MapSideBar);
9
9
 
10
- app.mount("#app");
10
+ app.mount('#app');
@@ -1,37 +1,34 @@
1
1
  <script>
2
2
  export default {
3
- name: "S3Bucket",
3
+ name: 'S3Bucket',
4
4
  data() {
5
5
  return {
6
6
  s3Bucket: undefined,
7
- s3Prefix: "",
7
+ s3Prefix: '',
8
8
  };
9
9
  },
10
10
  methods: {
11
- updateS3Bucket: function(s3uri) {
11
+ updateS3Bucket: function (s3uri) {
12
12
  this.s3Bucket = undefined;
13
13
  if (s3uri) {
14
- const substring = s3uri.split("//")[1];
14
+ const substring = s3uri.split('//')[1];
15
15
  if (substring) {
16
- this.s3Bucket = substring.split("/")[0];
16
+ this.s3Bucket = substring.split('/')[0];
17
17
  const n = substring.indexOf('/');
18
18
  this.s3Prefix = substring.substring(n + 1);
19
19
  return;
20
20
  }
21
21
  }
22
22
  },
23
- getS3Args: function() {
23
+ getS3Args: function () {
24
24
  if (this.s3Bucket) {
25
- return `?s3BucketName=${this.s3Bucket}`
25
+ return `?s3BucketName=${this.s3Bucket}`;
26
26
  }
27
- return "";
27
+ return '';
28
28
  },
29
- getS3Prefix: function() {
29
+ getS3Prefix: function () {
30
30
  return this.s3Prefix;
31
- }
31
+ },
32
32
  },
33
-
34
33
  };
35
34
  </script>
36
-
37
-
package/vite.config.js CHANGED
@@ -1,69 +1,70 @@
1
- import { resolve } from "node:path"
1
+ import { resolve } from 'node:path';
2
2
 
3
- import { defineConfig } from 'vite'
4
- import vue from '@vitejs/plugin-vue'
5
-
6
- import Components from 'unplugin-vue-components/vite'
7
- import { ElementPlusResolver } from 'unplugin-vue-components/resolvers'
3
+ import { defineConfig } from 'vite';
4
+ import vue from '@vitejs/plugin-vue';
5
+ import AutoImport from 'unplugin-auto-import/vite';
6
+ import Components from 'unplugin-vue-components/vite';
7
+ import { ElementPlusResolver } from 'unplugin-vue-components/resolvers';
8
8
 
9
9
  // https://vitejs.dev/config/
10
10
  export default defineConfig({
11
- server: {
12
- port: 8081,
13
- },
14
- plugins: [
15
- vue(),
16
- Components({
17
- // allow auto load markdown components under `./src/components/`
18
- extensions: ['vue', 'md'],
19
- // allow auto import and register components used in markdown
20
- include: [/\.vue$/, /\.vue\?vue/, /\.md$/],
21
- resolvers: [
22
- ElementPlusResolver({
23
- importStyle: 'sass',
24
- }),
25
- ],
26
- dts: './src/components.d.ts',
11
+ server: {
12
+ port: 8081,
13
+ },
14
+ plugins: [
15
+ vue(),
16
+ AutoImport({
17
+ resolvers: [ElementPlusResolver()],
18
+ }),
19
+ Components({
20
+ // allow auto load markdown components under `./src/components/`
21
+ extensions: ['vue', 'md'],
22
+ // allow auto import and register components used in markdown
23
+ include: [/\.vue$/, /\.vue\?vue/, /\.md$/],
24
+ resolvers: [
25
+ ElementPlusResolver({
26
+ importStyle: 'sass',
27
27
  }),
28
- ],
29
- resolve: {
30
- alias: {
31
- '@': resolve(import.meta.dirname, './src'),
32
- }
28
+ ],
29
+ dts: './src/components.d.ts',
30
+ }),
31
+ ],
32
+ resolve: {
33
+ alias: {
34
+ '@': resolve(import.meta.dirname, './src'),
33
35
  },
34
- build: {
35
- lib: {
36
- entry: resolve(import.meta.dirname, "./src/components/index.js"),
37
- name: "MapSideBar",
38
- fileName: 'map-side-bar',
39
- },
40
- rollupOptions: {
41
- external: [
42
- "vue",
43
- "@abi-software/map-utilities",
44
- "@element-plus/icons-vue",
45
- "@abi-software/map-utilities/dist/style.css"
46
- ],
47
- output: {
48
- globals: {
49
- vue: "Vue",
50
- "@abi-software/map-utilities": "@abi-software/map-utilities",
51
- "@element-plus/icons-vue": "@element-plus/icons-vue"
52
- },
53
- // keep css output name stable for the "./dist/style.css" export/import paths
54
- assetFileNames: (assetInfo) =>
55
- assetInfo.name?.endsWith(".css")
56
- ? "style.css"
57
- : "assets/[name][extname]",
58
- },
36
+ },
37
+ build: {
38
+ lib: {
39
+ entry: resolve(import.meta.dirname, './src/components/index.js'),
40
+ name: 'MapSideBar',
41
+ fileName: 'map-side-bar',
42
+ },
43
+ rollupOptions: {
44
+ external: [
45
+ 'vue',
46
+ '@abi-software/map-utilities',
47
+ '@element-plus/icons-vue',
48
+ '@abi-software/map-utilities/dist/style.css',
49
+ ],
50
+ output: {
51
+ globals: {
52
+ vue: 'Vue',
53
+ '@abi-software/map-utilities': '@abi-software/map-utilities',
54
+ '@element-plus/icons-vue': '@element-plus/icons-vue',
59
55
  },
56
+ // keep css output name stable for the "./dist/style.css" export/import paths
57
+ assetFileNames: (assetInfo) =>
58
+ assetInfo.name?.endsWith('.css') ? 'style.css' : 'assets/[name][extname]',
59
+ },
60
+ },
61
+ },
62
+ css: {
63
+ preprocessorOptions: {
64
+ scss: {
65
+ api: 'modern-compiler',
66
+ additionalData: `@use '@/assets/styles' as *;`,
67
+ },
60
68
  },
61
- css: {
62
- preprocessorOptions: {
63
- scss: {
64
- api: 'modern-compiler',
65
- additionalData: `@use '@/assets/styles' as *;`
66
- }
67
- }
68
- }
69
- })
69
+ },
70
+ });
@@ -5,120 +5,112 @@
5
5
  * To watch components changes for Vitepress on Dev Mode
6
6
  */
7
7
 
8
- import fs from 'fs'
9
- import path from 'path'
10
- import chokidar from 'chokidar'
8
+ import fs from 'fs';
9
+ import path from 'path';
10
+ import chokidar from 'chokidar';
11
11
  // import { parser } from '@vuese/parser'
12
- import { parseSource } from 'vue-docgen-api'
13
- import { Render } from '@vuese/markdown-render'
12
+ import { parseSource } from 'vue-docgen-api';
13
+ import { Render } from '@vuese/markdown-render';
14
14
 
15
- const watchMode = process.argv.find((argv) => argv === 'watch')
15
+ const watchMode = process.argv.find((argv) => argv === 'watch');
16
16
 
17
- const componentsDir = 'src/components'
18
- const components = ['SideBar.vue']
19
- const outputDir = 'docs/components'
17
+ const componentsDir = 'src/components';
18
+ const components = ['SideBar.vue'];
19
+ const outputDir = 'docs/components';
20
20
 
21
21
  function generateMarkdown(file) {
22
- const fileWithPath = `${componentsDir}/${file}`
23
- const fileContent = fs.readFileSync(fileWithPath, 'utf-8')
22
+ const fileWithPath = `${componentsDir}/${file}`;
23
+ const fileContent = fs.readFileSync(fileWithPath, 'utf-8');
24
24
 
25
25
  try {
26
26
  // const parserResult = parser(fileContent)
27
- const parserResult = parseSource(fileContent, fileWithPath)
27
+ const parserResult = parseSource(fileContent, fileWithPath);
28
28
  parserResult.then((result) => {
29
- const {
30
- displayName: name,
31
- description: desc,
32
- props,
33
- events,
34
- methods
35
- } = result
29
+ const { displayName: name, description: desc, props, events, methods } = result;
36
30
 
37
31
  // transform props to vuese styles
38
32
  const parseResult = {
39
33
  name: name,
40
34
  componentDesc: {
41
- default: [desc]
35
+ default: [desc],
42
36
  },
43
37
  props: transformData(props),
44
38
  events: transformData(events),
45
39
  methods: transformData(methods),
46
- }
47
- const r = new Render(parseResult)
48
- const renderResult = r.render()
49
- const markdownResult = r.renderMarkdown()
50
- const markdownContent = markdownResult.content
51
- const componentName = path.basename(fileWithPath, '.vue')
40
+ };
41
+ const r = new Render(parseResult);
42
+ // const renderResult = r.render();
43
+ const markdownResult = r.renderMarkdown();
44
+ const markdownContent = markdownResult.content;
45
+ const componentName = path.basename(fileWithPath, '.vue');
52
46
 
53
47
  if (!fs.existsSync(outputDir)) {
54
- fs.mkdirSync(outputDir)
48
+ fs.mkdirSync(outputDir);
55
49
  }
56
50
 
57
51
  fs.writeFile(`${outputDir}/${componentName}.md`, markdownContent, (err) => {
58
52
  if (err) {
59
- console.error(`Error writing markdown file for ${componentName}`, err)
53
+ console.error(`Error writing markdown file for ${componentName}`, err);
60
54
  } else {
61
- console.log(`Markdown file for ${componentName} is generated!`)
55
+ console.log(`Markdown file for ${componentName} is generated!`);
62
56
  }
63
- })
64
- })
65
- } catch(e) {
66
- console.error(e)
57
+ });
58
+ });
59
+ } catch (e) {
60
+ console.error(e);
67
61
  }
68
62
  }
69
63
 
70
64
  function transformData(data) {
71
65
  data.forEach((prop) => {
72
- prop.name = prop.name
73
-
74
66
  if (prop.description) {
75
- prop.describe = [prop.description.replaceAll('\n', ' ')]
67
+ prop.describe = [prop.description.replaceAll('\n', ' ')];
76
68
  }
77
69
 
78
70
  if (prop.type) {
79
- prop.type = prop.type.name
71
+ prop.type = prop.type.name;
80
72
  }
81
73
 
82
74
  if (prop.defaultValue) {
83
- prop.default = prop.defaultValue.value.replaceAll('\n', ' ')
75
+ prop.default = prop.defaultValue.value.replaceAll('\n', ' ');
84
76
  }
85
77
 
86
78
  // events
87
79
  if (prop.properties) {
88
- prop.argumentsDesc = []
80
+ prop.argumentsDesc = [];
89
81
  prop.properties.forEach((param) => {
90
- const argName = param.name || param.description
91
- prop.argumentsDesc.push(argName)
92
- })
82
+ const argName = param.name || param.description;
83
+ prop.argumentsDesc.push(argName);
84
+ });
93
85
  }
94
86
 
95
87
  // methods
96
88
  if (prop.params) {
97
- prop.argumentsDesc = []
89
+ prop.argumentsDesc = [];
98
90
  prop.params.forEach((param) => {
99
- const argName = param.name || param.description
100
- prop.argumentsDesc.push(argName)
101
- })
91
+ const argName = param.name || param.description;
92
+ prop.argumentsDesc.push(argName);
93
+ });
102
94
  }
103
- })
104
- return data
95
+ });
96
+ return data;
105
97
  }
106
98
 
107
99
  // To generate markdown files - one time
108
100
  components.forEach((component) => {
109
- console.log(`Write markdown file for ${component} on first load.`)
110
- generateMarkdown(component)
111
- })
101
+ console.log(`Write markdown file for ${component} on first load.`);
102
+ generateMarkdown(component);
103
+ });
112
104
 
113
105
  // To watch component changes and generate markdown files
114
106
  if (watchMode) {
115
107
  const watcher = chokidar.watch(components, {
116
108
  cwd: componentsDir,
117
109
  ignoreInitial: true,
118
- })
110
+ });
119
111
 
120
112
  watcher.on('change', (file) => {
121
- console.log(`The component ${file} has changed!`)
122
- generateMarkdown(file)
123
- })
113
+ console.log(`The component ${file} has changed!`);
114
+ generateMarkdown(file);
115
+ });
124
116
  }