@abi-software/flatmapvuer 1.1.4 → 1.2.0-beta.1

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 (43) hide show
  1. package/LICENSE +201 -201
  2. package/README.md +120 -120
  3. package/cypress.config.js +23 -23
  4. package/dist/flatmapvuer.js +44509 -43153
  5. package/dist/flatmapvuer.umd.cjs +171 -171
  6. package/dist/index.html +17 -17
  7. package/dist/style.css +1 -1
  8. package/package.json +96 -95
  9. package/public/index.html +17 -17
  10. package/reporter-config.json +9 -9
  11. package/src/App.vue +378 -379
  12. package/src/assets/_variables.scss +43 -43
  13. package/src/assets/styles.scss +5 -5
  14. package/src/components/EventBus.js +3 -3
  15. package/src/components/FlatmapVuer.vue +3616 -3461
  16. package/src/components/MultiFlatmapVuer.vue +830 -814
  17. package/src/components/SelectionsGroup.vue +363 -363
  18. package/src/components/index.js +6 -8
  19. package/src/components/legends/DynamicLegends.vue +106 -106
  20. package/src/components/legends/SvgLegends.vue +112 -112
  21. package/src/components.d.ts +0 -18
  22. package/src/icons/flatmap-marker.js +9 -9
  23. package/src/icons/fonts/mapicon-species.svg +14 -14
  24. package/src/icons/fonts/mapicon-species.ttf +0 -0
  25. package/src/icons/fonts/mapicon-species.woff +0 -0
  26. package/src/icons/mapicon-species-style.css +42 -42
  27. package/src/icons/yellowstar.js +5 -5
  28. package/src/legends/legend.svg +25 -25
  29. package/src/main.js +19 -19
  30. package/src/services/flatmapQueries.js +475 -475
  31. package/src/store/flatmap.js +22 -0
  32. package/src/store/index.js +23 -23
  33. package/vite.config.js +74 -73
  34. package/vite.static-build.js +12 -12
  35. package/vuese-generator.js +64 -64
  36. package/src/components/AnnotationTool.vue +0 -501
  37. package/src/components/ConnectionDialog.vue +0 -134
  38. package/src/components/DrawTool.vue +0 -502
  39. package/src/components/ExternalResourceCard.vue +0 -109
  40. package/src/components/HelpModeDialog.vue +0 -360
  41. package/src/components/ProvenancePopup.vue +0 -530
  42. package/src/components/Tooltip.vue +0 -50
  43. package/src/components/TreeControls.vue +0 -236
@@ -0,0 +1,22 @@
1
+ import { defineStore } from 'pinia';
2
+ import * as flatmap from '@abi-software/flatmap-viewer';
3
+
4
+ export const useFlatmapStore = defineStore('flatmap', {
5
+ state: () => {
6
+ return {
7
+ mapManager: null
8
+ }
9
+ },
10
+ getters: {
11
+ activeMapManager(state) {
12
+ return state.mapManager;
13
+ }
14
+ },
15
+ actions: {
16
+ setMapManager(flatmapAPI) {
17
+ if (!this.mapManager) {
18
+ this.mapManager = new flatmap.MapManager(flatmapAPI);
19
+ }
20
+ },
21
+ },
22
+ })
@@ -1,24 +1,24 @@
1
- import { defineStore } from 'pinia'
2
-
3
- /**
4
- * Activate the store when run the application individually.
5
- * If the store exist in parent application,
6
- * instead of creating a new store it will access the parent main store.
7
- */
8
- export const useMainStore = defineStore('main', {
9
- state: () => ({
10
- userProfile: {
11
- token: ''
12
- },
13
- }),
14
- getters: {
15
- userToken(state) {
16
- return state.userProfile.token
17
- },
18
- },
19
- actions: {
20
- setUserToken(value) {
21
- this.userProfile.token = value
22
- },
23
- }
1
+ import { defineStore } from 'pinia'
2
+
3
+ /**
4
+ * Activate the store when run the application individually.
5
+ * If the store exist in parent application,
6
+ * instead of creating a new store it will access the parent main store.
7
+ */
8
+ export const useMainStore = defineStore('main', {
9
+ state: () => ({
10
+ userProfile: {
11
+ token: ''
12
+ },
13
+ }),
14
+ getters: {
15
+ userToken(state) {
16
+ return state.userProfile.token
17
+ },
18
+ },
19
+ actions: {
20
+ setUserToken(value) {
21
+ this.userProfile.token = value
22
+ },
23
+ }
24
24
  })
package/vite.config.js CHANGED
@@ -1,73 +1,74 @@
1
- import path from "path";
2
- import { defineConfig } from 'vite'
3
- import vue from '@vitejs/plugin-vue'
4
- import Components from 'unplugin-vue-components/vite'
5
- import { ElementPlusResolver } from 'unplugin-vue-components/resolvers'
6
-
7
- // https://vitejs.dev/config/
8
- export default defineConfig(({ command, mode }) => {
9
- const config = {
10
- css: {
11
- preprocessorOptions: {
12
- scss: {
13
- additionalData: `@use './src/assets/styles' as *;`
14
- },
15
- },
16
- },
17
- plugins: [
18
- vue({
19
- template: {
20
- compilerOptions: {
21
- isCustomElement: (tag) => ['bx:grid'].includes(tag),
22
- }
23
- }
24
- }),
25
- Components({
26
- // allow auto load markdown components under `./src/components/`
27
- extensions: ['vue', 'md'],
28
- // allow auto import and register components used in markdown
29
- include: [/\.vue$/, /\.vue\?vue/, /\.md$/],
30
- resolvers: [
31
- ElementPlusResolver({
32
- importStyle: 'sass',
33
- }),
34
- ],
35
- dts: 'src/components.d.ts',
36
- }),
37
-
38
- // https://github.com/antfu/unocss
39
- // see unocss.config.ts for config
40
- ],
41
- resolve: {
42
- alias: {
43
- '@': path.resolve(__dirname, './src'),
44
- }
45
- },
46
- build: {
47
- lib: {
48
- entry: path.resolve(__dirname, "./src/components/index.js"),
49
- name: "FlatmapVuer",
50
- fileName: 'flatmapvuer',
51
- },
52
- rollupOptions: {
53
- external: ["vue", "@abi-software/svg-sprite"],
54
- output: {
55
- globals: {
56
- vue: "Vue",
57
- "@abi-software/svg-sprite": "@abi-software/svg-sprite"
58
- },
59
- },
60
- },
61
- },
62
- optimizeDeps: {
63
- entries: ['./cypress/*']
64
- }
65
- };
66
-
67
- if (command === 'serve') {
68
- config.server = {
69
- port: 8082,
70
- };
71
- }
72
- return config;
73
- })
1
+ import path from "path";
2
+ import { defineConfig } from 'vite'
3
+ import vue from '@vitejs/plugin-vue'
4
+ import Components from 'unplugin-vue-components/vite'
5
+ import { ElementPlusResolver } from 'unplugin-vue-components/resolvers'
6
+
7
+ // https://vitejs.dev/config/
8
+ export default defineConfig(({ command, mode }) => {
9
+ const config = {
10
+ css: {
11
+ preprocessorOptions: {
12
+ scss: {
13
+ additionalData: `@use './src/assets/styles' as *;`
14
+ },
15
+ },
16
+ },
17
+ plugins: [
18
+ vue({
19
+ template: {
20
+ compilerOptions: {
21
+ isCustomElement: (tag) => ['bx:grid'].includes(tag),
22
+ }
23
+ }
24
+ }),
25
+ Components({
26
+ // allow auto load markdown components under `./src/components/`
27
+ extensions: ['vue', 'md'],
28
+ // allow auto import and register components used in markdown
29
+ include: [/\.vue$/, /\.vue\?vue/, /\.md$/],
30
+ resolvers: [
31
+ ElementPlusResolver({
32
+ importStyle: 'sass',
33
+ }),
34
+ ],
35
+ dts: 'src/components.d.ts',
36
+ }),
37
+
38
+ // https://github.com/antfu/unocss
39
+ // see unocss.config.ts for config
40
+ ],
41
+ resolve: {
42
+ alias: {
43
+ '@': path.resolve(__dirname, './src'),
44
+ }
45
+ },
46
+ build: {
47
+ lib: {
48
+ entry: path.resolve(__dirname, "./src/components/index.js"),
49
+ name: "FlatmapVuer",
50
+ fileName: 'flatmapvuer',
51
+ },
52
+ rollupOptions: {
53
+ external: ["vue", "@abi-software/svg-sprite", "@abi-software/map-utilities"],
54
+ output: {
55
+ globals: {
56
+ vue: "Vue",
57
+ "@abi-software/svg-sprite": "@abi-software/svg-sprite",
58
+ "@abi-software/map-utilities": "@abi-software/map-utilities"
59
+ },
60
+ },
61
+ },
62
+ },
63
+ optimizeDeps: {
64
+ entries: ['./cypress/*']
65
+ }
66
+ };
67
+
68
+ if (command === 'serve') {
69
+ config.server = {
70
+ port: 8082,
71
+ };
72
+ }
73
+ return config;
74
+ })
@@ -1,12 +1,12 @@
1
- import { defineConfig } from 'vite'
2
- import rootConfig from './vite.config.js'
3
-
4
- // defineWorkspace provides a nice type hinting DX
5
- export default defineConfig((configEnv) => {
6
- const config = rootConfig(configEnv);
7
- config.build = {
8
- outDir: "test-html"
9
- };
10
-
11
- return config;
12
- })
1
+ import { defineConfig } from 'vite'
2
+ import rootConfig from './vite.config.js'
3
+
4
+ // defineWorkspace provides a nice type hinting DX
5
+ export default defineConfig((configEnv) => {
6
+ const config = rootConfig(configEnv);
7
+ config.build = {
8
+ outDir: "test-html"
9
+ };
10
+
11
+ return config;
12
+ })
@@ -1,65 +1,65 @@
1
- /**
2
- * Vuese Generator
3
- *
4
- * To generate markdown files from Vue components
5
- * To watch components changes for Vitepress on Dev Mode
6
- */
7
-
8
- import fs from 'fs'
9
- import path from 'path'
10
- import chokidar from 'chokidar'
11
- import { parser } from '@vuese/parser'
12
- import { Render } from '@vuese/markdown-render'
13
-
14
- const watchMode = process.argv.find((argv) => argv === 'watch')
15
-
16
- const componentsDir = 'src/components'
17
- const components = ['FlatmapVuer.vue', 'MultiFlatmapVuer.vue']
18
- const outputDir = 'docs/components'
19
-
20
- function generateMarkdown(file) {
21
- const fileWithPath = `${componentsDir}/${file}`
22
- const fileContent = fs.readFileSync(fileWithPath, 'utf-8')
23
-
24
- try {
25
- const parserResult = parser(fileContent)
26
- const r = new Render(parserResult)
27
- const renderResult = r.render()
28
- const markdownResult = r.renderMarkdown()
29
- const markdownContent = markdownResult.content
30
- const componentName = path.basename(fileWithPath, '.vue')
31
-
32
- if (!fs.existsSync(outputDir)) {
33
- fs.mkdirSync(outputDir)
34
- }
35
-
36
- fs.writeFile(`${outputDir}/${componentName}.md`, markdownContent, (err) => {
37
- if (err) {
38
- console.error(`Error writing markdown file for ${componentName}`, err)
39
- } else {
40
- console.log(`Markdown file for ${componentName} is generated!`)
41
- }
42
- })
43
- } catch(e) {
44
- console.error(e)
45
- }
46
- }
47
-
48
- // To generate markdown files - one time
49
- components.forEach((component) => {
50
- console.log(`Write markdown file for ${component} on first load.`)
51
- generateMarkdown(component)
52
- })
53
-
54
- // To watch component changes and generate markdown files
55
- if (watchMode) {
56
- const watcher = chokidar.watch(components, {
57
- cwd: componentsDir,
58
- ignoreInitial: true,
59
- })
60
-
61
- watcher.on('change', (file) => {
62
- console.log(`The component ${file} has changed!`)
63
- generateMarkdown(file)
64
- })
1
+ /**
2
+ * Vuese Generator
3
+ *
4
+ * To generate markdown files from Vue components
5
+ * To watch components changes for Vitepress on Dev Mode
6
+ */
7
+
8
+ import fs from 'fs'
9
+ import path from 'path'
10
+ import chokidar from 'chokidar'
11
+ import { parser } from '@vuese/parser'
12
+ import { Render } from '@vuese/markdown-render'
13
+
14
+ const watchMode = process.argv.find((argv) => argv === 'watch')
15
+
16
+ const componentsDir = 'src/components'
17
+ const components = ['FlatmapVuer.vue', 'MultiFlatmapVuer.vue']
18
+ const outputDir = 'docs/components'
19
+
20
+ function generateMarkdown(file) {
21
+ const fileWithPath = `${componentsDir}/${file}`
22
+ const fileContent = fs.readFileSync(fileWithPath, 'utf-8')
23
+
24
+ try {
25
+ const parserResult = parser(fileContent)
26
+ const r = new Render(parserResult)
27
+ const renderResult = r.render()
28
+ const markdownResult = r.renderMarkdown()
29
+ const markdownContent = markdownResult.content
30
+ const componentName = path.basename(fileWithPath, '.vue')
31
+
32
+ if (!fs.existsSync(outputDir)) {
33
+ fs.mkdirSync(outputDir)
34
+ }
35
+
36
+ fs.writeFile(`${outputDir}/${componentName}.md`, markdownContent, (err) => {
37
+ if (err) {
38
+ console.error(`Error writing markdown file for ${componentName}`, err)
39
+ } else {
40
+ console.log(`Markdown file for ${componentName} is generated!`)
41
+ }
42
+ })
43
+ } catch(e) {
44
+ console.error(e)
45
+ }
46
+ }
47
+
48
+ // To generate markdown files - one time
49
+ components.forEach((component) => {
50
+ console.log(`Write markdown file for ${component} on first load.`)
51
+ generateMarkdown(component)
52
+ })
53
+
54
+ // To watch component changes and generate markdown files
55
+ if (watchMode) {
56
+ const watcher = chokidar.watch(components, {
57
+ cwd: componentsDir,
58
+ ignoreInitial: true,
59
+ })
60
+
61
+ watcher.on('change', (file) => {
62
+ console.log(`The component ${file} has changed!`)
63
+ generateMarkdown(file)
64
+ })
65
65
  }