@eodash/eodash 5.0.0-alpha.2.5 → 5.0.0-alpha.2.6

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 (73) hide show
  1. package/README.md +19 -5
  2. package/core/client/App.vue +6 -7
  3. package/core/client/SuspensedDashboard.ce.vue +58 -40
  4. package/core/client/asWebComponent.d.ts +10 -5
  5. package/core/client/asWebComponent.js +6 -6
  6. package/core/client/components/DashboardLayout.vue +35 -16
  7. package/core/client/components/DynamicWebComponent.vue +44 -44
  8. package/core/client/components/ErrorAlert.vue +19 -7
  9. package/core/client/components/Footer.vue +28 -14
  10. package/core/client/components/Header.vue +4 -4
  11. package/core/client/components/IframeWrapper.vue +3 -3
  12. package/core/client/components/Loading.vue +17 -18
  13. package/core/client/components/MobileLayout.vue +48 -26
  14. package/core/client/composables/DefineEodash.js +38 -29
  15. package/core/client/composables/DefineWidgets.js +101 -81
  16. package/core/client/composables/index.js +32 -29
  17. package/core/client/eodash.js +44 -39
  18. package/core/client/main.js +2 -2
  19. package/core/client/plugins/index.js +9 -10
  20. package/core/client/plugins/vuetify.js +9 -10
  21. package/core/client/render.js +4 -5
  22. package/core/client/store/States.js +8 -13
  23. package/core/client/store/index.js +14 -11
  24. package/core/client/store/stac.js +51 -37
  25. package/core/client/types.d.ts +169 -201
  26. package/core/client/utils/eodashSTAC.js +130 -49
  27. package/core/client/utils/helpers.js +18 -20
  28. package/core/client/utils/index.js +17 -10
  29. package/core/client/utils/keys.js +2 -2
  30. package/core/client/views/Dashboard.vue +53 -36
  31. package/core/client/vite-env.d.ts +19 -17
  32. package/dist/client/{DashboardLayout-BYROtP-7.js → DashboardLayout-BuDcv6LM.js} +9 -9
  33. package/dist/client/{DynamicWebComponent-BQhxFPM0.js → DynamicWebComponent-BEP4rVce.js} +2 -2
  34. package/dist/client/EodashDatePicker-oFb1zt5E.js +1211 -0
  35. package/dist/client/{EodashItemFilter-DIBDAHcc.js → EodashItemFilter-BElmgrST.js} +4 -6
  36. package/dist/client/{EodashMap-C6jJ2Lb_.js → EodashMap-DXyOgcEd.js} +13131 -14490
  37. package/dist/client/{Footer-BVIZms1S.js → Footer-CoPx6UXQ.js} +3 -3
  38. package/dist/client/{Header-TsTL1d2R.js → Header-C-zX31Ys.js} +169 -167
  39. package/dist/client/{IframeWrapper-XKChM78a.js → IframeWrapper-2w2ye0zM.js} +1 -1
  40. package/dist/client/{MobileLayout-BlGcMQra.js → MobileLayout-C9OVcP12.js} +45 -57
  41. package/dist/client/{VMain-C9XV5Lyg.js → VMain-Dm43jd43.js} +2 -2
  42. package/dist/client/{WidgetsContainer-BQXHnZpa.js → WidgetsContainer-BS87sLqk.js} +10 -3
  43. package/dist/client/{asWebComponent-CbdGxelK.js → asWebComponent-CpQUVi2N.js} +5508 -5561
  44. package/dist/client/{basedecoder-Qm25PwVp-CHo5Pomv.js → basedecoder-DHcBySSe-BmCFNFnw.js} +5 -6
  45. package/dist/client/{decoder-HRvnjnEI-CHAYOWhz.js → decoder-CP4lv0Kb-BHrv68IA.js} +1 -1
  46. package/dist/client/deflate-BXt-9JA_-CWfClgpK.js +10 -0
  47. package/dist/client/eo-dash.js +3 -3
  48. package/dist/client/eodashSTAC-Q7kbX1Gy.js +2788 -0
  49. package/dist/client/{eox-itemfilter-DcQkRD2l.js → eox-itemfilter-TaBxgqq_.js} +1002 -974
  50. package/dist/client/{eox-map-C3DL31fp.js → eox-map-L7abwKTR.js} +5677 -5695
  51. package/dist/client/{forwardRefs-CyCJOFsz.js → forwardRefs-BVFQ82G4.js} +12 -21
  52. package/dist/client/{index-CabQjjQg.js → index-dOzyv_xR.js} +1 -1
  53. package/dist/client/{jpeg-DNfUpLwy-Fjan-04T.js → jpeg-BAgeD1d3-oeHbFPUL.js} +5 -6
  54. package/dist/client/{lerc-_E46UbWQ-TxBH4OeK.js → lerc-DzVumYtB-rm1Xco54.js} +5 -7
  55. package/dist/client/{lzw-BOMhmEDy-Dboc93VO.js → lzw-LAGDNbSC-DkP96qO9.js} +1 -1
  56. package/dist/client/{packbits-DaUD6MLm-Bu1PoTGa.js → packbits-BlDR4Kj5-C66n1-zr.js} +1 -1
  57. package/dist/client/{pako.esm-C3kYPGGQ-BMki8cQY.js → pako.esm-CB1uQYY0-DB0PYm1P.js} +6 -12
  58. package/dist/client/{raw-CcGKjn8q-DFOt-i8n.js → raw-CMGvRjfu-BRi6E4i1.js} +1 -1
  59. package/dist/client/{ssrBoot-DWJ-z4I-.js → ssrBoot-L9KejErM.js} +1 -1
  60. package/dist/client/style.css +2 -2
  61. package/dist/client/{transition-BlLt41wg.js → transition-DCePIwYR.js} +1 -1
  62. package/dist/client/{webfontloader-CyOFAuFB.js → webfontloader-qotgY98I.js} +56 -92
  63. package/dist/client/{webimage-D2c098k3-DLj1LQxB.js → webimage-BM_pbLN3-L2cGWK5l.js} +1 -1
  64. package/dist/node/cli.js +1 -1
  65. package/dist/node/types.d.ts +32 -38
  66. package/package.json +11 -11
  67. package/widgets/EodashDatePicker.vue +94 -43
  68. package/widgets/EodashItemFilter.vue +13 -10
  69. package/widgets/EodashMap.vue +87 -20
  70. package/widgets/WidgetsContainer.vue +45 -27
  71. package/dist/client/EodashDatePicker-CFltnt5d.js +0 -1194
  72. package/dist/client/deflate-Be2Arps5-hDqMz3RA.js +0 -10
  73. package/dist/client/http-ZWiLaAeR.js +0 -1337
@@ -1,38 +1,37 @@
1
1
  <template>
2
- <v-row class="d-flex justify-center align-center ">
2
+ <v-row class="d-flex justify-center align-center">
3
3
  <v-col class="flex-column justify-center align-center">
4
4
  <ErrorAlert v-model="error" />
5
5
  <Suspense>
6
- <component v-if="loading.component" :is="loading.component" v-bind="loading.props"></component>
7
- <div v-else class="text-center">
8
- Loading...
9
- </div>
6
+ <component
7
+ v-if="loading.component"
8
+ :is="loading.component"
9
+ v-bind="loading.props"
10
+ ></component>
11
+ <div v-else class="text-center">Loading...</div>
10
12
  <template #fallback>
11
- <div class="text-center">
12
- Loading...
13
- </div>
13
+ <div class="text-center">Loading...</div>
14
14
  </template>
15
15
  </Suspense>
16
16
  </v-col>
17
17
  </v-row>
18
18
  </template>
19
19
  <script setup>
20
- import { inject, onErrorCaptured, ref } from 'vue';
21
- import { eodashKey } from '@/utils/keys';
22
- import { useDefineWidgets } from '@/composables/DefineWidgets';
23
- import ErrorAlert from './ErrorAlert.vue';
20
+ import { inject, onErrorCaptured, ref } from "vue";
21
+ import { eodashKey } from "@/utils/keys";
22
+ import { useDefineWidgets } from "@/composables/DefineWidgets";
23
+ import ErrorAlert from "./ErrorAlert.vue";
24
24
 
25
- const eodash = /** @type {import("@/types").Eodash} */ (inject(eodashKey))
25
+ const eodash = /** @type {import("@/types").Eodash} */ (inject(eodashKey));
26
26
 
27
- const [loading] = useDefineWidgets([eodash.template.loading])
27
+ const [loading] = useDefineWidgets([eodash.template.loading]);
28
28
 
29
- const error = ref('')
29
+ const error = ref("");
30
30
  onErrorCaptured((e, inst, info) => {
31
31
  error.value = `
32
32
  ${e}.
33
33
  component: ${inst?.$.type.name}.
34
34
  info: ${info}.
35
- `
36
- })
37
-
35
+ `;
36
+ });
38
37
  </script>
@@ -1,59 +1,81 @@
1
1
  <template>
2
2
  <v-main class="overflow-hidden main">
3
3
  <Suspense suspensible>
4
- <component id="bg-widget" v-if="bgWidget.component" :is="bgWidget.component" v-bind="bgWidget.props"></component>
4
+ <component
5
+ id="bg-widget"
6
+ v-if="bgWidget.component"
7
+ :is="bgWidget.component"
8
+ v-bind="bgWidget.props"
9
+ ></component>
5
10
  </Suspense>
6
11
 
7
12
  <template v-for="(importedWidget, idx) in importedWidgets" :key="idx">
8
- <div v-if="importedWidget.value.component" v-show="activeIdx === idx" id="overlay" class="pa-2 panel">
9
- <v-btn icon variant="text" class="close-btn" @click="activeIdx = -1">&#x2715;</v-btn>
13
+ <div
14
+ v-if="importedWidget.value.component"
15
+ v-show="activeIdx === idx"
16
+ id="overlay"
17
+ class="pa-2 panel"
18
+ >
19
+ <v-btn icon variant="text" class="close-btn" @click="activeIdx = -1"
20
+ >&#x2715;</v-btn
21
+ >
10
22
  <Suspense suspensible>
11
23
  <div class="component-container" v-show="activeIdx === idx">
12
- <component :key="importedWidget.value.id" :is="importedWidget.value.component"
13
- v-bind="importedWidget.value.props" />
24
+ <component
25
+ :key="importedWidget.value.id"
26
+ :is="importedWidget.value.component"
27
+ v-bind="importedWidget.value.props"
28
+ />
14
29
  </div>
15
30
  </Suspense>
16
31
  </div>
17
32
  </template>
18
33
 
19
- <v-tabs ref="tabs" align-tabs="center" bg-color="surface" class="tabs" show-arrows v-model="activeIdx">
34
+ <v-tabs
35
+ ref="tabs"
36
+ align-tabs="center"
37
+ bg-color="surface"
38
+ class="tabs"
39
+ show-arrows
40
+ v-model="activeIdx"
41
+ >
20
42
  <template v-for="(importedWidget, idx) in importedWidgets" :key="idx">
21
43
  <v-tab v-if="importedWidget.value.component" :value="idx">
22
44
  {{ importedWidget.value.title }}
23
45
  </v-tab>
24
46
  </template>
25
47
  </v-tabs>
26
-
27
48
  </v-main>
28
49
  </template>
29
50
  <script setup>
30
- import { eodashKey } from '@/utils/keys';
31
- import { inject, ref, onMounted } from 'vue';
32
- import { useDefineWidgets } from '@/composables/DefineWidgets'
33
- import { useLayout } from "vuetify"
51
+ import { eodashKey } from "@/utils/keys";
52
+ import { inject, ref, onMounted } from "vue";
53
+ import { useDefineWidgets } from "@/composables/DefineWidgets";
54
+ import { useLayout } from "vuetify";
34
55
 
35
- const eodash = /** @type {import("@/types").Eodash} */(inject(eodashKey));
56
+ const eodash = /** @type {import("@/types").Eodash} */ (inject(eodashKey));
36
57
 
37
58
  //import widgets
38
- const widgetsConfig = eodash.template.widgets
39
- const importedWidgets = useDefineWidgets(widgetsConfig)
40
- const [bgWidget] = useDefineWidgets([eodash.template?.background])
59
+ const widgetsConfig = eodash.template.widgets;
60
+ const importedWidgets = useDefineWidgets(widgetsConfig);
61
+ const [bgWidget] = useDefineWidgets([eodash.template?.background]);
41
62
 
42
- const { mainRect } = useLayout()
63
+ const { mainRect } = useLayout();
43
64
 
44
- const activeIdx = ref(-1)
65
+ const activeIdx = ref(-1);
45
66
 
46
- /** @type {import("vue").Ref<import("vuetify/components").VTabs|null>} */
47
- const tabs = ref(null)
48
- const tabsHeightFromBtm = ref('')
49
- const mainRectTopPx = ref('')
50
- const mainRectBtmPx = ref('')
67
+ /** @type {import("vue").Ref<import("vuetify/components").VTabs | null>} */
68
+ const tabs = ref(null);
69
+ const tabsHeightFromBtm = ref("");
70
+ const mainRectTopPx = ref("");
71
+ const mainRectBtmPx = ref("");
51
72
 
52
73
  onMounted(() => {
53
- mainRectTopPx.value = mainRect.value.top + 'px';
54
- mainRectBtmPx.value = (mainRect.value.bottom || 48) + 'px';
55
- tabsHeightFromBtm.value = mainRect.value.bottom + (/** @type {HTMLElement} */(tabs.value?.$el)?.clientHeight ?? 0) + "px"
56
- })
74
+ mainRectTopPx.value = mainRect.value.top + "px";
75
+ mainRectBtmPx.value = (mainRect.value.bottom || 48) + "px";
76
+ tabsHeightFromBtm.value =
77
+ mainRect.value.bottom + (tabs.value?.$el?.clientHeight ?? 0) + "px";
78
+ });
57
79
  </script>
58
80
  <style scoped>
59
81
  .main {
@@ -2,57 +2,66 @@ import store from "@/store";
2
2
  import { eodashKey } from "@/utils/keys";
3
3
  import { inject } from "vue";
4
4
 
5
-
6
-
7
5
  /**
8
- * Sets user defined instance on runtime.
9
- * Consumes `/@fs/config.js` and assign it to `eodash`
6
+ * Sets user defined instance on runtime. Consumes `/@fs/config.js` and assign
7
+ * it to `eodash`
8
+ *
10
9
  * @async
11
- * @returns {Promise<import("@/types").Eodash>}
12
10
  * @param {string | undefined} runtimeConfig
11
+ * @returns {Promise<import("@/types").Eodash>}
13
12
  * @see {@linkplain '@/eodash.js'}
14
13
  */
15
14
  export const useEodashRuntime = async (runtimeConfig) => {
16
- const eodash = /** @type {import("@/types").Eodash} */(inject(eodashKey))
17
- /**
18
- * @param {import("@/types").Eodash} config
19
- */
15
+ const eodash = /** @type {import("@/types").Eodash} */ (inject(eodashKey));
16
+ /** @param {import("@/types").Eodash} config */
20
17
  const assignInstance = (config) => {
21
- /** @type {(keyof import("@/types").Eodash)[]} */(Object.keys(eodash))
22
- .forEach((key) => {
23
- //@ts-expect-error
24
- eodash[key] = config[key]
25
- })
26
- }
18
+ /** @type {(keyof import("@/types").Eodash)[]} */ (
19
+ Object.keys(eodash)
20
+ ).forEach((key) => {
21
+ //@ts-expect-error to do
22
+ eodash[key] = config[key];
23
+ });
24
+ };
27
25
 
28
26
  if (runtimeConfig) {
29
- assignInstance((await import( /* @vite-ignore */new URL(runtimeConfig, import.meta.url).href)).default);
30
- return eodash
27
+ assignInstance(
28
+ (
29
+ await import(
30
+ /* @vite-ignore */ new URL(runtimeConfig, import.meta.url).href
31
+ )
32
+ ).default,
33
+ );
34
+ return eodash;
31
35
  }
32
36
 
33
37
  try {
34
- const configJs = '/config.js'
38
+ const configJs = "/config.js";
35
39
  assignInstance(
36
- (await import( /* @vite-ignore */new URL(configJs, import.meta.url).href)).default
37
- )
40
+ (await import(/* @vite-ignore */ new URL(configJs, import.meta.url).href))
41
+ .default,
42
+ );
38
43
  } catch {
39
44
  try {
40
- assignInstance(await import("user:config").then(async m => await m['default']))
45
+ assignInstance(
46
+ await import("user:config").then(async (m) => await m["default"]),
47
+ );
41
48
  } catch {
42
- console.error('no dashboard configuration defined')
49
+ console.error("no dashboard configuration defined");
43
50
  }
44
51
  }
45
- return eodash
46
- }
52
+ return eodash;
53
+ };
47
54
 
48
55
  /**
49
- * @param {((store:import("@/types").EodashStore)=> Promise<import("@/types").Eodash>)
50
- * | import("@/types").Eodash} config
56
+ * @param {((
57
+ * store: import("@/types").EodashStore,
58
+ * ) => Promise<import("@/types").Eodash>)
59
+ * | import("@/types").Eodash} config
51
60
  */
52
61
  export const createEodash = async (config) => {
53
62
  if (config instanceof Function) {
54
- return await config(store)
63
+ return await config(store);
55
64
  } else {
56
- return config
65
+ return config;
57
66
  }
58
- }
67
+ };
@@ -1,141 +1,161 @@
1
- import { defineAsyncComponent, reactive, shallowRef, watch } from 'vue'
2
- import { useSTAcStore } from '@/store/stac'
3
- import { storeToRefs } from 'pinia'
1
+ import { defineAsyncComponent, reactive, shallowRef, watch } from "vue";
2
+ import { useSTAcStore } from "@/store/stac";
3
+ import { storeToRefs } from "pinia";
4
4
 
5
5
  /**
6
6
  * @typedef {{
7
- * component: import('vue').Component | null;
7
+ * component: import("vue").Component | null;
8
8
  * props: Record<string, unknown>;
9
9
  * title: string;
10
10
  * id: string | number | symbol;
11
- * layout: { x: number; y: number; h: number; w: number }
11
+ * layout: { x: number; y: number; h: number; w: number };
12
12
  * }} DefinedWidget
13
- */
13
+ */
14
14
 
15
- /**
16
- * @typedef {import('vue').ShallowRef<DefinedWidget>} ReactiveDefinedWidget
17
- */
15
+ /** @typedef {import("vue").ShallowRef<DefinedWidget>} ReactiveDefinedWidget */
18
16
 
19
17
  const internalWidgets = (() => {
20
- /**
21
- * @type {Record<string,() => Promise<import('vue').Component>>}
22
- */
18
+ /** @type {Record<string, () => Promise<import("vue").Component>>} */
23
19
  const importMap = {
24
- ...import.meta.glob('^/**/*.vue'),
25
- ...import.meta.glob("user:widgets/**/*.vue")
26
- }
20
+ ...import.meta.glob("^/**/*.vue"),
21
+ ...import.meta.glob("user:widgets/**/*.vue"),
22
+ };
27
23
  for (const key in importMap) {
28
- const newKey = /** @type {string} */(key.split('/').at(-1)).slice(0, -4)
29
- Object.defineProperty(importMap, newKey,
30
- /** @type {PropertyDescriptor} */(Object.getOwnPropertyDescriptor(importMap, key)));
24
+ const newKey = /** @type {string} */ (key.split("/").at(-1)).slice(0, -4);
25
+ Object.defineProperty(
26
+ importMap,
27
+ newKey,
28
+ /** @type {PropertyDescriptor} */ (
29
+ Object.getOwnPropertyDescriptor(importMap, key)
30
+ ),
31
+ );
31
32
  delete importMap[key];
32
33
  }
33
- return importMap
34
+ return importMap;
34
35
  })();
35
36
 
36
-
37
37
  /**
38
38
  * Composable that converts widgets Configurations to defined imported widgets
39
- * @param { (import("@/types").Widget | import("@/types").BackgroundWidget | undefined)[] |
40
- * import("@/types").WidgetsContainerProps['widgets'] | undefined} widgetConfigs
41
- * @returns {Array<ReactiveDefinedWidget>}
42
- **/
39
+ *
40
+ * @param {(
41
+ * | import("@/types").Widget
42
+ * | import("@/types").BackgroundWidget
43
+ * | undefined
44
+ * )[]
45
+ * | import("@/types").WidgetsContainerProps["widgets"]
46
+ * | undefined} widgetConfigs
47
+ * @returns {ReactiveDefinedWidget[]}
48
+ */
43
49
  export const useDefineWidgets = (widgetConfigs) => {
44
- /**
45
- * @type {Array<ReactiveDefinedWidget>}
46
- */
47
- const definedWidgets = []
50
+ /** @type {ReactiveDefinedWidget[]} */
51
+ const definedWidgets = [];
48
52
 
49
- for (const config of (widgetConfigs ?? [])) {
50
- /**
51
- * @type {ReactiveDefinedWidget}
52
- */
53
+ for (const config of widgetConfigs ?? []) {
54
+ /** @type {ReactiveDefinedWidget} */
53
55
  const definedWidget = shallowRef({
54
56
  component: null,
55
57
  props: {},
56
- title: '',
58
+ title: "",
57
59
  id: Symbol(),
58
- layout: { x: 0, y: 0, h: 0, w: 0 }
59
- })
60
+ layout: { x: 0, y: 0, h: 0, w: 0 },
61
+ });
60
62
 
61
- if ('defineWidget' in (config ?? {})) {
62
- const { selectedStac } = storeToRefs(useSTAcStore())
63
- watch(selectedStac, (updatedStac) => {
64
- let definedConfig = /** @type {import("@/types").FunctionalWidget} */(config)?.defineWidget(updatedStac)
65
- if (definedConfig) {
66
- definedConfig = reactive(definedConfig)
67
- }
68
- definedWidget.value = definedWidget.value.id === definedConfig?.id ?
69
- definedWidget.value : getWidgetDefinition(definedConfig);
70
- }, { immediate: true })
63
+ if ("defineWidget" in (config ?? {})) {
64
+ const { selectedStac } = storeToRefs(useSTAcStore());
65
+ watch(
66
+ selectedStac,
67
+ (updatedStac) => {
68
+ let definedConfig =
69
+ /** @type {import("@/types").FunctionalWidget} */ (
70
+ config
71
+ )?.defineWidget(updatedStac);
72
+ if (definedConfig) {
73
+ definedConfig = reactive(definedConfig);
74
+ }
75
+ definedWidget.value =
76
+ definedWidget.value.id === definedConfig?.id
77
+ ? definedWidget.value
78
+ : getWidgetDefinition(definedConfig);
79
+ },
80
+ { immediate: true },
81
+ );
71
82
  } else {
72
- definedWidget.value = getWidgetDefinition(/** @type {import("@/types").StaticWidget} */(config))
83
+ definedWidget.value = getWidgetDefinition(
84
+ /** @type {import("@/types").StaticWidget} */ (config),
85
+ );
73
86
  }
74
- definedWidgets.push(definedWidget)
87
+ definedWidgets.push(definedWidget);
75
88
  }
76
- return definedWidgets
77
- }
78
-
89
+ return definedWidgets;
90
+ };
79
91
 
80
92
  /**
81
93
  * Converts a static widget configuration to a defined imported widget
82
- * @param {import("@/types").StaticWidget| Omit<import("@/types").StaticWidget, "layout">| undefined | null} [config]
94
+ *
95
+ * @param {import("@/types").StaticWidget
96
+ * | Omit<import("@/types").StaticWidget, "layout">
97
+ * | undefined
98
+ * | null} [config]
83
99
  * @returns {DefinedWidget}
84
- **/
100
+ */
85
101
  const getWidgetDefinition = (config) => {
86
- /**
87
- * @type {DefinedWidget}
88
- */
102
+ /** @type {DefinedWidget} */
89
103
  const importedWidget = {
90
104
  component: null,
91
105
  props: {},
92
- title: '',
106
+ title: "",
93
107
  id: Symbol(),
94
- layout: reactive({ x: 0, y: 0, h: 0, w: 0 })
95
- }
108
+ layout: reactive({ x: 0, y: 0, h: 0, w: 0 }),
109
+ };
96
110
  switch (config?.type) {
97
- case 'internal':
111
+ case "internal":
98
112
  importedWidget.component = defineAsyncComponent({
99
- loader: internalWidgets[/** @type {import("@/types").InternalComponentWidget} **/(config)?.widget.name],
113
+ loader:
114
+ internalWidgets[
115
+ /** @type {import("@/types").InternalComponentWidget} * */ (config)
116
+ ?.widget.name
117
+ ],
100
118
  suspensible: true,
101
- })
102
- importedWidget.props = reactive(/** @type {import("@/types").InternalComponentWidget} **/(config)?.widget.properties ?? {})
119
+ });
120
+ importedWidget.props = reactive(
121
+ /** @type {import("@/types").InternalComponentWidget} * */ (config)
122
+ ?.widget.properties ?? {},
123
+ );
103
124
 
104
125
  break;
105
126
 
106
- case 'web-component':
127
+ case "web-component":
107
128
  importedWidget.component = defineAsyncComponent({
108
- loader: () => import('@/components/DynamicWebComponent.vue'),
129
+ loader: () => import("@/components/DynamicWebComponent.vue"),
109
130
  suspensible: true,
110
- })
111
- importedWidget.props = reactive(config.widget)
131
+ });
132
+ importedWidget.props = reactive(config.widget);
112
133
 
113
134
  break;
114
- case 'iframe':
135
+ case "iframe":
115
136
  importedWidget.component = defineAsyncComponent({
116
- loader: () => import('@/components/IframeWrapper.vue'),
137
+ loader: () => import("@/components/IframeWrapper.vue"),
117
138
  suspensible: true,
118
- })
119
- importedWidget.props = reactive(config.widget)
139
+ });
140
+ importedWidget.props = reactive(config.widget);
120
141
  break;
121
142
 
122
143
  default:
123
144
  if (!config) {
124
- return importedWidget
145
+ return importedWidget;
125
146
  } else {
126
- console.error('Widget type not found')
147
+ console.error("Widget type not found");
127
148
  }
128
149
  break;
129
150
  }
130
- importedWidget.title = config?.title ?? ''
131
- importedWidget.id = config?.id ?? importedWidget.id
151
+ importedWidget.title = config?.title ?? "";
152
+ importedWidget.id = config?.id ?? importedWidget.id;
132
153
 
133
154
  if ("layout" in config) {
134
- importedWidget.layout.x = config.layout.x
135
- importedWidget.layout.y = config.layout.y
136
- importedWidget.layout.h = config.layout.h
137
- importedWidget.layout.w = config.layout.w
155
+ importedWidget.layout.x = config.layout.x;
156
+ importedWidget.layout.y = config.layout.y;
157
+ importedWidget.layout.h = config.layout.h;
158
+ importedWidget.layout.w = config.layout.w;
138
159
  }
139
- return importedWidget
140
- }
141
-
160
+ return importedWidget;
161
+ };
@@ -9,9 +9,11 @@ import { useSTAcStore } from "@/store/stac";
9
9
 
10
10
  /**
11
11
  * Creates an absolute URL from a relative link and assignes it to `currentUrl`
12
- * @param {string} [rel = '']
13
- * @param {string} [base = eodash.stacEndpoint] - base URL, default value is the root stac catalog
14
- * @returns {import('vue').Ref<string>} - returns `currentUrl`
12
+ *
13
+ * @param {string} [rel=''] Default is `''`
14
+ * @param {string} [base=eodash.stacEndpoint] - Base URL, default value is the
15
+ * root stac catalog. Default is `eodash.stacEndpoint`
16
+ * @returns {import("vue").Ref<string>} - Returns `currentUrl`
15
17
  * @see {@link '@/store/States.js'}
16
18
  */
17
19
  export const useAbsoluteUrl = (rel = "", base = eodash.stacEndpoint) => {
@@ -35,16 +37,18 @@ export const useAbsoluteUrl = (rel = "", base = eodash.stacEndpoint) => {
35
37
  };
36
38
 
37
39
  /**
38
- * Updates an existing Vuetify theme.
39
- * updates only the values provided in the `ThemeDefinition`
40
+ * Updates an existing Vuetify theme. updates only the values provided in the
41
+ * `ThemeDefinition`
42
+ *
40
43
  * @param {string} themeName - Name of the theme to be updated
41
- * @param {import('vuetify').ThemeDefinition} [themeDefinition = {}] - New defintion to be updated to
42
- * @returns {import('vuetify').ThemeInstance}
44
+ * @param {import("vuetify").ThemeDefinition} [themeDefinition={}] - New
45
+ * defintion to be updated to. Default is `{}`
46
+ * @returns {import("vuetify").ThemeInstance}
43
47
  */
44
48
  export const useUpdateTheme = (themeName, themeDefinition = {}) => {
45
49
  const theme = useTheme();
46
50
 
47
- /** @type {Array<keyof import('vuetify').ThemeDefinition>} */ (
51
+ /** @type {(keyof import("vuetify").ThemeDefinition)[]} */ (
48
52
  Object.keys(themeDefinition)
49
53
  ).forEach((key) => {
50
54
  if (key === "dark") {
@@ -52,7 +56,7 @@ export const useUpdateTheme = (themeName, themeDefinition = {}) => {
52
56
  themeDefinition[key]
53
57
  );
54
58
  } else {
55
- //@ts-expect-error
59
+ //@ts-expect-error to do
56
60
  theme.themes.value[themeName][key] = {
57
61
  ...theme.themes.value[themeName][key],
58
62
  ...themeDefinition[key],
@@ -62,27 +66,25 @@ export const useUpdateTheme = (themeName, themeDefinition = {}) => {
62
66
  return theme;
63
67
  };
64
68
 
65
- /**
66
- * Composable that syncs store and URLSearchParameters
67
- */
69
+ /** Composable that syncs store and URLSearchParameters */
68
70
 
69
71
  export const useURLSearchParametersSync = () => {
70
72
  onMounted(async () => {
71
73
  // Analyze currently set url params when first loaded and set them in the store
72
- if ('URLSearchParams' in window) {
74
+ if ("URLSearchParams" in window) {
73
75
  const searchParams = new URLSearchParams(window.location.search);
74
- /** @type {number} */
76
+ /** @type {number | undefined} */
75
77
  let x,
76
- /** @type {number} */
78
+ /** @type {number | undefined} */
77
79
  y,
78
- /** @type {number} */
80
+ /** @type {number | undefined} */
79
81
  z;
80
82
  searchParams.forEach(async (value, key) => {
81
83
  if (key === "indicator") {
82
- const { loadSelectedSTAC, stac } = useSTAcStore()
83
- const match = stac?.find(link => link.id == value)
84
+ const { loadSelectedSTAC, stac } = useSTAcStore();
85
+ const match = stac?.find((link) => link.id == value);
84
86
  if (match) {
85
- await loadSelectedSTAC(match.href)
87
+ await loadSelectedSTAC(match.href);
86
88
  }
87
89
  }
88
90
  if (key === "x") {
@@ -94,28 +96,29 @@ export const useURLSearchParametersSync = () => {
94
96
  if (key === "z") {
95
97
  z = Number(value);
96
98
  }
97
- })
98
- //@ts-expect-error
99
- if (x !== undefined && y !== undefined && z !== undefined) {
99
+ });
100
+ if (x && y && z) {
100
101
  mapPosition.value = [x, y, z];
101
102
  }
102
103
  }
103
104
  watch(
104
105
  [indicator, mapPosition],
105
106
  ([updatedIndicator, updatedMapPosition]) => {
106
- if ('URLSearchParams' in window) {
107
+ if ("URLSearchParams" in window) {
107
108
  const searchParams = new URLSearchParams(window.location.search);
108
109
  if (updatedIndicator !== "") {
109
110
  searchParams.set("indicator", updatedIndicator);
110
111
  }
111
112
  if (updatedMapPosition && updatedMapPosition.length === 3) {
112
- searchParams.set("x", updatedMapPosition[0]?.toFixed(4) ?? '');
113
- searchParams.set("y", updatedMapPosition[1]?.toFixed(4) ?? '');
114
- searchParams.set("z", updatedMapPosition[2]?.toFixed(4) ?? '');
113
+ searchParams.set("x", updatedMapPosition[0]?.toFixed(4) ?? "");
114
+ searchParams.set("y", updatedMapPosition[1]?.toFixed(4) ?? "");
115
+ searchParams.set("z", updatedMapPosition[2]?.toFixed(4) ?? "");
115
116
  }
116
- const newRelativePathQuery = window.location.pathname + '?' + searchParams.toString();
117
- history.pushState(null, '', newRelativePathQuery);
117
+ const newRelativePathQuery =
118
+ window.location.pathname + "?" + searchParams.toString();
119
+ history.pushState(null, "", newRelativePathQuery);
118
120
  }
119
- })
121
+ },
122
+ );
120
123
  });
121
124
  };