@eodash/eodash 5.0.0-alpha.1.1 → 5.0.0-alpha.1.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/bin/app.js CHANGED
@@ -4,12 +4,16 @@ import { buildApp, createDevServer, previewApp } from './cli.js'
4
4
 
5
5
  const command = process.argv?.[2];
6
6
  (async () => {
7
+ const baseFlag = (
8
+ process.argv.indexOf('--base') > -1 ? process.argv[process.argv.indexOf('--base')+1] : null
9
+ );
10
+ console.log(baseFlag)
7
11
  switch (command) {
8
12
  case "dev":
9
13
  await createDevServer();
10
14
  break;
11
15
  case "build":
12
- await buildApp();
16
+ await buildApp(baseFlag);
13
17
  break;
14
18
  case "preview":
15
19
  await previewApp();
package/bin/cli.js CHANGED
@@ -1,39 +1,46 @@
1
1
  #!/usr/bin/env node
2
2
 
3
3
  import { build, createServer, preview } from "vite"
4
- import { rootPath, appPath, buildTargetPath, appPublicPath } from "./utils.js";
4
+ import { execPath, appPath, buildTargetPath } from "./utils.js";
5
5
  import { writeFile, rm, cp } from "fs/promises";
6
+ import { existsSync, mkdirSync } from "fs";
6
7
  import { update } from "./update.js";
7
8
  import { indexHtml, serverConfig } from "./serverConfig.js";
8
9
  import path from "path";
9
- import { existsSync } from "fs";
10
10
 
11
11
 
12
12
 
13
13
  export const createDevServer = async () => {
14
- const server = await createServer(await serverConfig({ mode: 'development', command: 'serve' }))
14
+ const server = await createServer(serverConfig({ mode: 'development', command: 'serve' }))
15
15
  await server.listen()
16
16
  server.printUrls()
17
17
  server.bindCLIShortcuts({ print: true })
18
18
  }
19
19
 
20
- export const buildApp = async () => {
20
+ export const buildApp = async (baseFlag) => {
21
21
  const htmlPath = path.join(appPath, '/index.html')
22
22
  await writeFile(htmlPath, indexHtml).then(async () => {
23
23
  await update()
24
- await build(await serverConfig({ mode: 'production', command: 'build' }))
24
+ const config = serverConfig({ mode: 'production', command: 'build' })
25
+ if (baseFlag !== null) {
26
+ config.base = baseFlag
27
+ }
28
+ await build(config)
25
29
  await rm(htmlPath).catch(() => {
26
30
  console.error('failed to remove index.html')
27
31
  })
28
- if (appPath.includes('node_modules') && existsSync(appPublicPath)) {
29
- await rm(appPublicPath, { recursive: true }).catch((e) => {
30
- console.error(e)
31
- })
32
+ await rm(path.join(appPath, './public'), { recursive: true }).catch()
33
+ try {
34
+ if (!existsSync('./public')) {
35
+ mkdirSync('./public');
36
+ }
37
+ } catch (err) {
38
+ console.error(err);
32
39
  }
33
40
  })
34
41
 
35
42
  if (appPath.includes('node_modules')) {
36
- await cp(path.join(appPath, 'dist'), buildTargetPath, { recursive: true }).then(() => {
43
+ await cp(appPath + 'dist', buildTargetPath, { recursive: true }).then(() => {
37
44
  console.info('dashboard built successfully')
38
45
  }).catch((e) => {
39
46
  console.error(e)
@@ -44,7 +51,7 @@ export const buildApp = async () => {
44
51
 
45
52
  export async function previewApp() {
46
53
  const previewServer = await preview({
47
- root: rootPath,
54
+ root: execPath,
48
55
  preview: {
49
56
  port: 8080,
50
57
  open: true,
@@ -1,22 +1,18 @@
1
1
  #!/usr/bin/env node
2
2
 
3
-
4
-
3
+ import { defineConfig, searchForWorkspaceRoot } from "vite"
4
+ // Plugins
5
5
  import vue from '@vitejs/plugin-vue';
6
6
  import vuetify, { transformAssetUrls } from 'vite-plugin-vuetify';
7
- import virtual, { updateVirtualModule } from 'vite-plugin-virtual'
7
+
8
+ // Utilities
8
9
  import { fileURLToPath, URL } from 'url';
9
- import {
10
- runtimeConfigPath,
11
- appPath, compiletimeConfigPath,
12
- appPublicPath, cachePath, rootPublicPath
13
- } from "./utils.js";
10
+ import { configPath, appPath, dotEodashPath, execPath } from "./utils.js";
14
11
  import { readFile } from "fs/promises";
15
- import { defineConfig, searchForWorkspaceRoot } from "vite"
16
- import { getUserModules } from './utils.js';
17
- import { existsSync } from 'fs';
12
+ import { existsSync } from "fs";
18
13
  import path from "path";
19
14
 
15
+
20
16
  export const indexHtml = `
21
17
  <!DOCTYPE html>
22
18
  <html lang="en">
@@ -30,18 +26,14 @@ export const indexHtml = `
30
26
 
31
27
  <body>
32
28
  <div id="app"></div>
33
- <script type="module" src="${path.resolve(`/@fs/${appPath}/core/render.js`)}"></script>
29
+ <script type="module" src="${path.resolve(`/@fs/${appPath}/core/main.js`)}"></script>
34
30
  </body>
35
31
  </html>`
36
32
 
37
- /**
38
- * @type {import('vite').Plugin | null}
39
- */
40
- let virtualPlugin = null;
41
- export const serverConfig = /** @type {import('vite').UserConfigFnPromise}*/(defineConfig(async ({ mode, command }) => {
33
+ export const serverConfig = defineConfig(({ mode, command }) => {
42
34
  return {
43
35
  base: '',
44
- cacheDir: cachePath,
36
+ cacheDir: dotEodashPath + '/cache',
45
37
  plugins: [
46
38
  vue({
47
39
  template: {
@@ -55,11 +47,10 @@ export const serverConfig = /** @type {import('vite').UserConfigFnPromise}*/(def
55
47
  vuetify({
56
48
  autoImport: true,
57
49
  }),
58
- (mode === "development" && {
59
- name: "inject-html",
60
- configureServer
61
- }),
62
- virtualPlugin = virtual(await getUserModules())
50
+ {
51
+ name: "inject-files",
52
+ configureServer: mode === "development" ? configureServer : undefined
53
+ }
63
54
  ],
64
55
  define: { 'process.env': {} },
65
56
  resolve: {
@@ -81,7 +72,7 @@ export const serverConfig = /** @type {import('vite').UserConfigFnPromise}*/(def
81
72
  include: ["webfontloader", "vuetify", "vue", "pinia"],
82
73
  noDiscovery: true,
83
74
  } : {},
84
- publicDir: command === 'build' ? appPublicPath : rootPublicPath,
75
+ publicDir: command === 'build' ? path.join(appPath, './public') : path.join(execPath, '/public'),
85
76
  build: {
86
77
  outDir: 'dist',
87
78
  rollupOptions: {
@@ -90,7 +81,7 @@ export const serverConfig = /** @type {import('vite').UserConfigFnPromise}*/(def
90
81
  target: "esnext"
91
82
  }
92
83
  }
93
- }));
84
+ });
94
85
 
95
86
 
96
87
 
@@ -98,33 +89,32 @@ export const serverConfig = /** @type {import('vite').UserConfigFnPromise}*/(def
98
89
  * @type {import("vite").ServerHook}
99
90
  */
100
91
  async function configureServer(server) {
101
- server.watcher.add([compiletimeConfigPath, runtimeConfigPath])
92
+ if (existsSync(configPath)) {
93
+ server.watcher.add(configPath)
94
+ }
102
95
 
103
96
  server.watcher.on('change', async (path) => {
104
- if (path == runtimeConfigPath) {
105
- server.hot.send('reload')
106
- } else if (!path.includes('node_modules') && path.includes('.eodash')) {
107
- updateVirtualModule(virtualPlugin, 'user:config',
108
- await getUserModules().then(modules => modules['user:config']))
97
+ if (path == configPath) {
98
+ server.hot.send('config:update')
109
99
  }
110
100
  })
111
-
112
101
  return () => {
113
102
  server.middlewares.use(async (req, res, next) => {
114
- if (req.originalUrl === '/@fs/config.js' && existsSync(runtimeConfigPath)) {
115
- await readFile(runtimeConfigPath).then(runtimeConfig => {
103
+ if (req.originalUrl === '/@fs/config.js' && existsSync(configPath)) {
104
+ await readFile(configPath).then(config => {
116
105
  res.statusCode = 200
117
106
  res.setHeader('Content-Type', 'text/javascript')
118
- res.write(runtimeConfig)
107
+ res.write(config)
119
108
  res.end()
120
- })
109
+ }).catch()
121
110
  return
122
111
  }
123
112
 
124
- if (req.url?.endsWith('.html')) {
113
+ const url = req.url
114
+ if (url?.endsWith('.html')) {
125
115
  res.statusCode = 200
126
116
  res.setHeader('Content-Type', 'text/html')
127
- const html = await server.transformIndexHtml(req.url, indexHtml, req.originalUrl)
117
+ const html = await server.transformIndexHtml(url, indexHtml, req.originalUrl)
128
118
  res.end(html)
129
119
  return
130
120
  }
package/bin/update.js CHANGED
@@ -1,17 +1,15 @@
1
1
  import { cp } from "fs/promises";
2
- import { rootPublicPath, appPath, runtimeConfigPath, appPublicPath } from "./utils.js";
2
+ import { execPath, appPath, configPath } from "./utils.js";
3
3
  import { existsSync } from "fs";
4
4
  import path from "path";
5
5
 
6
6
  export async function update() {
7
- if (rootPublicPath !== appPublicPath) {
8
- await cp(rootPublicPath, appPublicPath, { recursive: true }).catch(err => {
7
+ if (existsSync(configPath)) {
8
+ await cp(path.join(execPath, "/public"), path.join(appPath, "/public"), { recursive: true }).catch(err => {
9
9
  console.error(err)
10
10
  })
11
- if (existsSync(runtimeConfigPath)) {
12
- await cp(runtimeConfigPath, path.join(appPath, '/public/config.js')).catch((e) => {
13
- console.error(e)
14
- })
15
- }
16
- }
11
+ await cp(configPath, path.join(appPath, '/public/config.js')).catch((e) => {
12
+ console.error(e)
13
+ })
14
+ } else console.error('no config file was found');
17
15
  }
package/bin/utils.js CHANGED
@@ -1,33 +1,12 @@
1
1
  #!/usr/bin/env node
2
2
 
3
- import { readFile } from 'fs/promises';
4
- import { existsSync } from 'fs';
5
3
  import path from 'path';
6
4
  import { fileURLToPath } from 'url';
7
- import { searchForWorkspaceRoot } from 'vite';
8
5
 
9
6
  // global paths
10
- export const appPath = fileURLToPath(new URL("..", import.meta.url)),
11
- appPublicPath = path.join(appPath, './public'),
12
- rootPath = searchForWorkspaceRoot(process.cwd()),
13
- rootPublicPath = path.join(rootPath, './public'),
14
- srcPath = path.join(rootPath, "/src"),
15
- runtimeConfigPath = path.join(srcPath, "./config.runtime.js"),
16
- compiletimeConfigPath = path.join(srcPath, "/config.js"),
17
- dotEodashPath = path.join(rootPath, "/.eodash"),
18
- buildTargetPath = path.join(dotEodashPath, '/dist'),
19
- cachePath = path.join(dotEodashPath, 'cache');
7
+ export const appPath = fileURLToPath(new URL("..", import.meta.url));
8
+ export const execPath = fileURLToPath(new URL(process.cwd(), import.meta.url));
9
+ export const dotEodashPath = path.join(execPath, "/.eodash");
10
+ export const configPath = path.join(dotEodashPath, "/config.js");
11
+ export const buildTargetPath = path.join(dotEodashPath, '/dist')
20
12
 
21
-
22
-
23
- export const getUserModules = async () => {
24
- /** @type {Record<string,string>} */
25
- let userModules = {}
26
- const indexJs = await readFile(compiletimeConfigPath, 'utf-8').catch(() => {
27
- if (!existsSync(runtimeConfigPath)) {
28
- console.error(new Error("no eodash configuration found"))
29
- }
30
- })
31
- userModules['user:config'] = typeof indexJs === 'string' ? indexJs : ''
32
- return userModules
33
- }
@@ -3,7 +3,6 @@
3
3
  <component :is="tagName" v-bind="properties" ref="elementRef" />
4
4
  </span>
5
5
  </template>
6
-
7
6
  <script async setup>
8
7
  import { useSTAcStore } from '@/store/stac';
9
8
  import {
@@ -13,9 +12,9 @@ import {
13
12
  import { ref } from 'vue';
14
13
  import { useRouter } from 'vue-router';
15
14
 
16
- const props = /** @type {WebComponentProps} */(defineProps({
15
+ const props = defineProps({
17
16
  link: {
18
- type: [String, Function],
17
+ type: String,
19
18
  required: true
20
19
  },
21
20
  constructorProp: String,
@@ -31,11 +30,21 @@ const props = /** @type {WebComponentProps} */(defineProps({
31
30
  },
32
31
  onMounted: Function,
33
32
  onUnmounted: Function
34
- }))
33
+ })
35
34
 
35
+ const modulesMap = {
36
+ '@eox/itemfilter': async () => await import('@eox/itemfilter'),
37
+ '@eox/stacinfo': async () => await import('@eox/stacinfo'),
38
+ '@eox/map': async () => await import('@eox/map'),
39
+ '@eox/chart': async () => await import('@eox/chart'),
40
+ '@eox/jsonform': async () => await import('@eox/jsonform'),
41
+ '@eox/layercontrol': async () => await import('@eox/layercontrol'),
42
+ '@eox/timecontrol': async () => await import('@eox/timecontrol')
43
+ };
36
44
 
37
- const getWebComponent = async () => typeof props.link === 'string' ?
38
- await import( /* @vite-ignore */props.link) : await props.link()
45
+ const getWebComponent = async () => props.link in modulesMap ?
46
+ await modulesMap[/** @type {keyof typeof modulesMap} */(props.link)]()
47
+ : await import( /* @vite-ignore */props.link)
39
48
 
40
49
  const imported = await getWebComponent().catch(e => {
41
50
  console.error(e)
@@ -59,10 +68,16 @@ const elementRef = ref(null)
59
68
  const router = useRouter()
60
69
 
61
70
  whenMounted(() => {
62
- props.onMounted?.(elementRef.value, store, router)
71
+ if (props.onMounted && elementRef.value) {
72
+ /** @type {DynamicWebComponentProps} */
73
+ (props).onMounted(elementRef.value, store, router)
74
+ }
63
75
  })
64
76
 
65
77
  whenUnMounted(() => {
66
- props.onUnmounted?.(elementRef.value, store, router)
78
+ if (props.onUnmounted && elementRef.value) {
79
+ /** @type {DynamicWebComponentProps} */
80
+ (props).onUnmounted(elementRef.value, store, router)
81
+ }
67
82
  })
68
83
  </script>
@@ -1,6 +1,5 @@
1
1
  import { eodashConfigKey } from "@/store/Keys"
2
2
  import { inject } from "vue"
3
- import store from '@/store'
4
3
 
5
4
  /**
6
5
  * Sets user defined configuration on runtime.
@@ -10,35 +9,17 @@ import store from '@/store'
10
9
  * @see {@linkplain '@/eodashConfig.js'}
11
10
  */
12
11
  export const useEodashRuntimeConfig = async () => {
13
- const eodashConfig = /** @type {EodashConfig} */(inject(eodashConfigKey))
14
- /**
15
- * @param {EodashConfig} updatedConfig
16
- */
17
- const assignConfig = (updatedConfig) => {
18
- /** @type {(keyof EodashConfig)[]} */(Object.keys(eodashConfig))
19
- .forEach((key) => {
20
- //@ts-expect-error
21
- eodashConfig[key] = updatedConfig[key]
22
- })
23
- }
12
+ const eodashConfig = inject(eodashConfigKey)
24
13
 
25
14
  try {
26
- assignConfig(
27
- (await import( /* @vite-ignore */new URL('/config.js', import.meta.url).href)).default
28
- )
29
- } catch {
30
- try {
31
- assignConfig((await import("user:config")).default)
32
- } catch {
33
- console.error('no dashboard configuration assigned')
34
- }
15
+ const config = (await import( /* @vite-ignore */new URL('/config.js', import.meta.url).href)).default
16
+
17
+ Object.keys(eodashConfig).forEach(key => {
18
+ eodashConfig[key] = config[key]
19
+ })
20
+ } catch (e) {
21
+ console.error(e)
35
22
  }
36
- return eodashConfig
37
- }
38
23
 
39
- /**
40
- * @param {(store:EodashStore)=>EodashConfig} configCallback
41
- */
42
- export const defineCompiletimeConfig = (configCallback) => {
43
- return configCallback(store)
24
+ return eodashConfig
44
25
  }
@@ -112,7 +112,7 @@ const eodashConfig = reactive({
112
112
  title: 'Information',
113
113
  layout: { "x": 9, "y": 0, "w": 3, "h": 12 },
114
114
  widget: {
115
- link: async () => await import('@eox/stacinfo'),
115
+ link: '@eox/stacinfo',
116
116
  properties: {
117
117
  for: currentUrl,
118
118
  allowHtml: "true",
package/core/main.js CHANGED
@@ -1,4 +1,15 @@
1
1
  // Plugins
2
- import { defineCompiletimeConfig } from '@/composables/DefineConfig';
2
+ import { registerPlugins } from '@/plugins';
3
3
 
4
- export { defineCompiletimeConfig as defineConfig }
4
+ // Components
5
+ import App from './App.vue';
6
+
7
+ // Composables
8
+ import { createApp } from 'vue';
9
+
10
+
11
+ const app = createApp(App);
12
+
13
+ registerPlugins(app);
14
+
15
+ app.mount('#app');
@@ -7,6 +7,6 @@ export const currentUrl = ref('');
7
7
 
8
8
  /**
9
9
  * ol map object. Updated by the config file.
10
- * @type {import("vue").Ref<import('openlayers').Map | null>}
10
+ * @type {import("vue").Ref<import('ol').Map | null>}
11
11
  */
12
12
  export const mapInstance = ref(null);
package/core/types.d.ts CHANGED
@@ -1,15 +1,16 @@
1
1
  import { useSTAcStore } from "@/store/stac"
2
2
  import type { Router } from "vue-router";
3
3
  import type { StacCatalog, StacCollection, StacItem } from "stac-ts";
4
- import { defineCompiletimeConfig } from "./composables/DefineConfig";
5
4
 
6
5
  declare global {
7
6
  /**
8
- * Web Component configuration
7
+ * Specification of web components imported from an external URL
9
8
  */
10
- interface WebComponentProps<T extends ExecutionTime = "compiletime"> {
9
+ interface ExternalWebComponentProps {
11
10
  /** Web component definition file URL*/
12
- link: T extends 'runtime' ? string : (string | (() => Promise));
11
+ link: string
12
+ /** Indicates if the widget is a node module */
13
+ // node_module?: false
13
14
  /** Exported Constructor, needs to be provided if the web component is not registered by the `link` provided */
14
15
  constructorProp?: string
15
16
  /** Custom tag name */
@@ -21,15 +22,44 @@ declare global {
21
22
  * @param el - web component
22
23
  * @param store - return value of the core STAC pinia store in `/core/store/stac.ts`
23
24
  */
24
- onMounted?: (el: Element | null, store: ReturnType<typeof useSTAcStore>, router: Router) => (Promise<void> | void)
25
+ onMounted?: (el: Element, store: ReturnType<typeof useSTAcStore>, router: Router) => (Promise<void> | void)
25
26
  /**
26
27
  * Function that is triggered when the web component is unmounted from the DOM.
27
28
  * @param el - web component
28
29
  * @param store - return value of the core STAC pinia store in `/core/store/stac.ts`
29
30
  */
30
- onUnmounted?: (el: Element | null, store: ReturnType<typeof useSTAcStore>, router: Router) => (Promise<void> | void)
31
+ onUnmounted?: (el: Element, store: ReturnType<typeof useSTAcStore>, router: Router) => (Promise<void> | void)
31
32
  }
32
33
 
34
+ // /**
35
+ // * Specification of web components imported as a node_module.
36
+ // */
37
+ // export interface NodeModuleWebComponentProps {
38
+ // /** Type of `modulesMap` key. Defined in `/core/modulesMap.ts`*/
39
+ // link: keyof typeof modulesMap;
40
+ // /** Indicates if the widget is a node module */
41
+ // node_module: true;
42
+ // /** Exported Constructor, needs to be provided if the web component is not registered */
43
+ // constructorProp?: string
44
+ // /** Custom tag name */
45
+ // tagName: `${string}-${string}`
46
+ // /** Object defining all the properties and attributes of the web component */
47
+ // properties?: Record<string, any>
48
+ // /**
49
+ // * Function that is triggered when the web component is mounted in the DOM.
50
+ // * @param el - web component
51
+ // * @param store - return value of the core STAC pinia store in `/core/store/stac.ts`
52
+ // */
53
+ // onMounted?: (el: Element, store: ReturnType<typeof useSTAcStore>, router: Router) => (Promise<void> | void)
54
+ // /**
55
+ // * Function that is triggered when the web component is unmounted from the DOM.
56
+ // * @param el - web component
57
+ // * @param store - return value of the core STAC pinia store in `/core/store/stac.ts`
58
+ // */
59
+ // onUnmounted?: (el: Element, store: ReturnType<typeof useSTAcStore>, router: Router) => (Promise<void> | void)
60
+ // }
61
+ /** @ignore */
62
+ type DynamicWebComponentProps = ExternalWebComponentProps // ExternalWebComponentProps | NodeModuleWebComponentProps
33
63
 
34
64
  /** @ignore */
35
65
  interface WidgetsContainerProps {
@@ -43,7 +73,7 @@ declare global {
43
73
  * Installed node_module web components import should be mapped in `/core/modulesMap.ts`,
44
74
  * then setting `widget.link`:`(import-map-key)` and `node_module`:`true`
45
75
  */
46
- interface WebComponentConfig<T extends ExecutionTime = "compiletime"> {
76
+ interface WebComponentConfig {
47
77
  /**
48
78
  * Unique Identifier, triggers rerender when using `defineWidget`
49
79
  **/
@@ -73,7 +103,7 @@ declare global {
73
103
  */
74
104
  h: number
75
105
  }
76
- widget: WebComponentProps<T>
106
+ widget: ExternalWebComponentProps // | NodeModuleWebComponentProps
77
107
  /**
78
108
  * Widget type
79
109
  */
@@ -175,13 +205,13 @@ declare global {
175
205
  */
176
206
  type: 'iframe'
177
207
  }
178
- interface FunctionalWidget<T extends ExecutionTime = "compiletime"> {
208
+ interface FunctionalWidget {
179
209
  /**
180
210
  * Provides a functional definition of the widget,
181
211
  * gets triggered whenever a stac object is selected.
182
212
  * @param selectedSTAC - currently selected stac object
183
213
  */
184
- defineWidget: (selectedSTAC: StacCatalog | StacCollection | StacItem | null) => Omit<StaticWidget<T>, 'layout'>
214
+ defineWidget: (selectedSTAC: StacCatalog | StacCollection | StacItem | null) => Omit<StaticWidget, 'layout'>
185
215
  layout: {
186
216
  /**
187
217
  * Horizontal start position. Integer (1 - 12)
@@ -201,17 +231,17 @@ declare global {
201
231
  h: number
202
232
  }
203
233
  }
204
- type StaticWidget<T extends ExecutionTime = "compiletime"> = WebComponentConfig<T> | InternalComponentConfig | IFrameConfig
205
- type WidgetConfig<T extends ExecutionTime = "compiletime"> = StaticWidget<T> | FunctionalWidget<T>
234
+ type StaticWidget = WebComponentConfig | InternalComponentConfig | IFrameConfig
235
+ type WidgetConfig = StaticWidget | FunctionalWidget
206
236
 
207
237
 
208
- type BackgroundWidgetConfig<T extends ExecutionTime = "compiletime"> = Omit<WebComponentConfig<T>, 'layout' | 'title'> | Omit<InternalComponentConfig, 'layout' | 'title'> | Omit<IFrameConfig, 'layout' | 'title'> | Omit<FunctionalWidget, 'layout'>
238
+ type BackgroundWidgetConfig = Omit<WebComponentConfig, 'layout' | 'title'> | Omit<InternalComponentConfig, 'layout' | 'title'> | Omit<IFrameConfig, 'layout' | 'title'> | Omit<FunctionalWidget, 'layout'>
209
239
  /**
210
240
  * Dashboard rendered widgets configuration specification.
211
241
  * 3 types of widgets are supported: `"iframe"`, `"internal"`, and `"web-component"`.
212
242
  * A specific configuration should be provided based on the type of the widget.
213
243
  */
214
- interface TemplateConfig<T extends ExecutionTime = "compiletime"> {
244
+ interface TemplateConfig {
215
245
  /**
216
246
  * Gap between widgets
217
247
  */
@@ -220,23 +250,23 @@ declare global {
220
250
  * Widget rendered as the dashboard background.
221
251
  * Has the same specifications of [WidgetConfig](../readme#widgetconfig) without the `title` and `layout` properties
222
252
  */
223
- background?: BackgroundWidgetConfig<T>
253
+ background?: BackgroundWidgetConfig
224
254
  /**
225
255
  * Array of widgets that will be rendered as dashboard panels.
226
256
  */
227
- widgets: WidgetConfig<T>[]
257
+ widgets: WidgetConfig[]
228
258
  }
229
259
 
230
260
  type ExternalURL = `${'https://' | 'http://'}${string}`;
231
261
  type InternalRoute = `/${string}`
232
262
  type StacEndpoint = `${'https://' | 'http://'}${string}/catalog.json`
233
263
 
234
- type ExecutionTime = "runtime" | "compiletime";
264
+
235
265
 
236
266
  /**
237
267
  * Eodash configuration specification.
238
268
  */
239
- interface EodashConfig<T extends ExecutionTime = "compiletime"> {
269
+ interface EodashConfig {
240
270
  /**
241
271
  * Configuration ID that defines the route of the dashboard.
242
272
  * Rendered dashboard can be accessed on route `/dashboard/config-id`
@@ -297,7 +327,7 @@ declare global {
297
327
  /**
298
328
  * Rendered widgets configuration
299
329
  */
300
- template: TemplateConfig<T>
330
+ template: TemplateConfig
301
331
  }
302
332
  /////////
303
333
 
@@ -330,4 +360,3 @@ declare global {
330
360
  ///////
331
361
  }
332
362
  export type { EodashConfig, EodashStore }
333
- export declare const defineConfig: typeof defineCompiletimeConfig
@@ -35,11 +35,11 @@ const { mainRect } = useLayout()
35
35
  onUnmounted(() => {
36
36
  theme.global.name.value = 'light'
37
37
  })
38
-
39
- import.meta.hot?.on('reload', () => {
40
- window.location.reload()
41
- })
42
-
38
+ if (import.meta.hot) {
39
+ import.meta.hot.on('config:update', () => {
40
+ window.location.reload()
41
+ })
42
+ }
43
43
  </script>
44
44
 
45
45
  <style scoped lang="scss">
@@ -29,7 +29,3 @@ declare module '@eox/timecontrol' {
29
29
  declare module '@eox/jsonform' {
30
30
  export const EOxJSONForm: CustomElementConstructor
31
31
  }
32
- declare module 'user:config' {
33
- const config: EodashConfig;
34
- export default config
35
- }
package/package.json CHANGED
@@ -1,20 +1,14 @@
1
1
  {
2
2
  "name": "@eodash/eodash",
3
- "version": "5.0.0-alpha.1.1",
3
+ "version": "5.0.0-alpha.1.2",
4
4
  "type": "module",
5
- "types": "./core/types.d.ts",
5
+ "types": "core/types.d.ts",
6
6
  "files": [
7
7
  "core",
8
8
  "bin",
9
9
  "widgets"
10
10
  ],
11
- "exports": {
12
- ".": {
13
- "types": "./core/types.d.ts",
14
- "default": "./core/main.js"
15
- }
16
- },
17
- "browser": "./core/main.js",
11
+ "browser": "./dist/index.html",
18
12
  "scripts": {
19
13
  "dev": "npx eodash dev",
20
14
  "build": "npx eodash build",
@@ -26,8 +20,15 @@
26
20
  "docs:generate": "typedoc --plugin typedoc-plugin-markdown core/store/Types.ts --tsconfig tsconfig.json --out docs --readme none"
27
21
  },
28
22
  "dependencies": {
23
+ "@eox/chart": "^2.0.0-beta2",
24
+ "@eox/drawtools": "^0.6.1",
25
+ "@eox/itemfilter": "^0.12.1",
26
+ "@eox/jsonform": "^0.2.1",
27
+ "@eox/layercontrol": "^0.15.1",
29
28
  "@eox/layout": "^0.1.0",
29
+ "@eox/map": "^1.1.0",
30
30
  "@eox/stacinfo": "^0.3.0",
31
+ "@eox/timecontrol": "^0.3.0",
31
32
  "@mdi/font": "7.0.96",
32
33
  "@vitejs/plugin-vue": "^5.0.0",
33
34
  "animated-details": "gist:2912bb049fa906671807415eb0e87188",
@@ -36,7 +37,6 @@
36
37
  "pinia": "^2.0.0",
37
38
  "roboto-fontface": "*",
38
39
  "vite": "^5.1.5",
39
- "vite-plugin-virtual": "^0.3.0",
40
40
  "vite-plugin-vuetify": "^2.0.0",
41
41
  "vue": "^3.2.0",
42
42
  "vue-router": "^4.0.0",
package/core/render.js DELETED
@@ -1,13 +0,0 @@
1
- import { registerPlugins } from '@/plugins';
2
- // Components
3
- import App from './App.vue';
4
-
5
- // Composables
6
- import { createApp } from 'vue';
7
-
8
-
9
- const app = createApp(App);
10
-
11
- registerPlugins(app);
12
-
13
- app.mount('#app');