@eodash/eodash 5.0.0-alpha.2.9 → 5.0.0-rc

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 (113) hide show
  1. package/README.md +1 -1
  2. package/core/client/App.vue +13 -1
  3. package/core/client/asWebComponent.js +13 -4
  4. package/core/client/components/DashboardLayout.vue +36 -14
  5. package/core/client/components/Loading.vue +6 -9
  6. package/core/client/components/MobileLayout.vue +16 -14
  7. package/core/client/composables/DefineEodash.js +14 -4
  8. package/core/client/composables/DefineTemplate.js +67 -0
  9. package/core/client/composables/DefineWidgets.js +3 -2
  10. package/core/client/composables/EodashMap.js +360 -0
  11. package/core/client/composables/EodashProcess.js +574 -0
  12. package/core/client/composables/index.js +136 -28
  13. package/core/client/eodash.js +395 -80
  14. package/core/client/eodashSTAC/EodashCollection.js +432 -0
  15. package/core/client/eodashSTAC/createLayers.js +315 -0
  16. package/core/client/eodashSTAC/helpers.js +375 -0
  17. package/core/client/eodashSTAC/triggers.js +43 -0
  18. package/core/client/plugins/axios.js +8 -0
  19. package/core/client/plugins/index.js +2 -1
  20. package/core/client/plugins/vuetify.js +2 -1
  21. package/core/client/store/actions.js +79 -0
  22. package/core/client/store/index.js +4 -18
  23. package/core/client/store/stac.js +99 -9
  24. package/core/client/store/states.js +37 -0
  25. package/core/client/{types.d.ts → types.ts} +66 -20
  26. package/core/client/utils/keys.js +2 -0
  27. package/core/client/utils/states.js +22 -0
  28. package/core/client/views/Dashboard.vue +22 -49
  29. package/core/client/vite-env.d.ts +2 -10
  30. package/dist/client/DashboardLayout-232tRmjz.js +84 -0
  31. package/dist/client/DynamicWebComponent-Cl4LqHU6.js +88 -0
  32. package/dist/client/EodashDatePicker-Pok6bZwU.js +306 -0
  33. package/dist/client/EodashItemFilter-16eMMjTV.js +151 -0
  34. package/dist/client/EodashLayerControl-De7IlCm_.js +120 -0
  35. package/dist/client/EodashLayoutSwitcher-C-3-jjn5.js +52 -0
  36. package/dist/client/EodashMap-CMvbfI6-.js +549 -0
  37. package/dist/client/EodashMapBtns-BeknGDtc.js +107 -0
  38. package/dist/client/EodashProcess-BwKAa9Ee.js +1476 -0
  39. package/dist/client/EodashStacInfo-_BfonNUG.js +85 -0
  40. package/dist/client/EodashTools-PD3XPYuR.js +103 -0
  41. package/dist/client/ExportState-DOrT7M15.js +644 -0
  42. package/dist/client/Footer-CCigxYBo.js +141 -0
  43. package/dist/client/Header-C2cdx4gb.js +437 -0
  44. package/dist/client/IframeWrapper-BgM9aU8f.js +28 -0
  45. package/dist/client/MobileLayout-BdiFjHg7.js +1207 -0
  46. package/dist/client/PopUp--_xn1Cms.js +410 -0
  47. package/dist/client/VImg-9xu2l99m.js +384 -0
  48. package/dist/client/VMain-BUs3kDTd.js +43 -0
  49. package/dist/client/VOverlay-D89omJis.js +1453 -0
  50. package/dist/client/VTooltip-CDu3bErh.js +86 -0
  51. package/dist/client/WidgetsContainer-aFG9yFT6.js +83 -0
  52. package/dist/client/asWebComponent-BRGyP_j5.js +11943 -0
  53. package/dist/client/{style.css → eo-dash.css} +2 -2
  54. package/dist/client/eo-dash.js +2 -6
  55. package/dist/client/forwardRefs-CYrR6bMw.js +245 -0
  56. package/dist/client/index-BZwk0V42.js +199 -0
  57. package/dist/client/ssrBoot-BP7SYRyC.js +22 -0
  58. package/dist/client/transition-DG9nRSW4.js +37 -0
  59. package/dist/node/cli.js +4 -4
  60. package/dist/node/types.d.ts +2 -0
  61. package/package.json +73 -38
  62. package/widgets/EodashDatePicker.vue +176 -134
  63. package/widgets/EodashItemFilter.vue +79 -38
  64. package/widgets/EodashLayerControl.vue +111 -0
  65. package/widgets/EodashLayoutSwitcher.vue +36 -0
  66. package/widgets/EodashMap.vue +108 -133
  67. package/widgets/EodashMapBtns.vue +62 -8
  68. package/widgets/EodashProcess.vue +143 -0
  69. package/widgets/EodashStacInfo.vue +82 -0
  70. package/widgets/EodashTools.vue +83 -0
  71. package/widgets/ExportState.vue +17 -13
  72. package/widgets/PopUp.vue +24 -2
  73. package/core/client/SuspensedDashboard.ce.vue +0 -105
  74. package/core/client/asWebComponent.d.ts +0 -23
  75. package/core/client/store/Actions.js +0 -14
  76. package/core/client/store/States.js +0 -16
  77. package/core/client/utils/eodashSTAC.js +0 -249
  78. package/core/client/utils/helpers.js +0 -38
  79. package/dist/client/DashboardLayout-D0ZF6V2S.js +0 -156
  80. package/dist/client/DynamicWebComponent-CPsMSBHi.js +0 -57
  81. package/dist/client/EodashDatePicker-CBQP7u2X.js +0 -252
  82. package/dist/client/EodashItemFilter-DL2ScI-5.js +0 -7671
  83. package/dist/client/EodashMap-CkKoQlmR.js +0 -86917
  84. package/dist/client/EodashMapBtns-yuO2QmiR.js +0 -36
  85. package/dist/client/ExportState-CCzOhppU.js +0 -558
  86. package/dist/client/Footer-BPAND0yG.js +0 -115
  87. package/dist/client/Header-DLhebNvG.js +0 -350
  88. package/dist/client/IframeWrapper-1GEMHlsW.js +0 -19
  89. package/dist/client/MobileLayout-mGkOYRhu.js +0 -945
  90. package/dist/client/PopUp-1d2bBFjw.js +0 -300
  91. package/dist/client/VImg-DxHcztfM.js +0 -291
  92. package/dist/client/VMain-BLX5vRRn.js +0 -39
  93. package/dist/client/VOverlay-CvrYEmLu.js +0 -967
  94. package/dist/client/WidgetsContainer-CmYjvGm7.js +0 -129
  95. package/dist/client/_commonjsHelpers-DaMA6jEr.js +0 -8
  96. package/dist/client/asWebComponent-B91uK0U7.js +0 -20361
  97. package/dist/client/basedecoder-DHcBySSe-BmCFNFnw.js +0 -88
  98. package/dist/client/decoder-CP4lv0Kb-B6yqkcfC.js +0 -10
  99. package/dist/client/deflate-BXt-9JA_-CWfClgpK.js +0 -10
  100. package/dist/client/eodashSTAC-DBjqe_Ho.js +0 -2788
  101. package/dist/client/eox-stacinfo-l7ALSV90.js +0 -13969
  102. package/dist/client/forwardRefs-BJJiadQP.js +0 -185
  103. package/dist/client/index-Q-bHLjxx.js +0 -153
  104. package/dist/client/jpeg-BAgeD1d3-oeHbFPUL.js +0 -514
  105. package/dist/client/lerc-DzVumYtB-P-KXC0TO.js +0 -1027
  106. package/dist/client/lzw-LAGDNbSC-DkP96qO9.js +0 -84
  107. package/dist/client/packbits-BlDR4Kj5-C66n1-zr.js +0 -24
  108. package/dist/client/pako.esm-CB1uQYY0-DB0PYm1P.js +0 -1081
  109. package/dist/client/raw-CMGvRjfu-BRi6E4i1.js +0 -9
  110. package/dist/client/ssrBoot-yo11mybw.js +0 -17
  111. package/dist/client/transition-CSJhuYGK.js +0 -34
  112. package/dist/client/webfontloader-qotgY98I.js +0 -435
  113. package/dist/client/webimage-BM_pbLN3-L2cGWK5l.js +0 -19
package/README.md CHANGED
@@ -4,7 +4,7 @@ A package for creating earth observation dashboards. To learn more about eodash
4
4
 
5
5
  ## Usage
6
6
 
7
- Checkout the [documentation](https://eodash.github.io/eodash/get-started.html) for a detailed guide.
7
+ Checkout the [documentation](https://eodash.github.io/eodash/) for a detailed guide.
8
8
 
9
9
  ## Get Started
10
10
 
@@ -1,7 +1,7 @@
1
1
  <template>
2
2
  <v-app>
3
3
  <Suspense>
4
- <Dashboard />
4
+ <Dashboard :is-web-component="isWebComponent" :config="config" />
5
5
 
6
6
  <template #fallback>
7
7
  <ErrorAlert v-model="error" />
@@ -15,7 +15,19 @@ import Dashboard from "@/views/Dashboard.vue";
15
15
  import ErrorAlert from "./components/ErrorAlert.vue";
16
16
  import { onErrorCaptured, ref } from "vue";
17
17
 
18
+ defineProps({
19
+ config: {
20
+ type: String,
21
+ required: false,
22
+ default: undefined,
23
+ },
24
+ });
25
+
26
+ // window.setEodashLoglevel("DEBUG")
27
+
18
28
  const error = ref("");
29
+ const isWebComponent = !!document.querySelector("eo-dash");
30
+
19
31
  onErrorCaptured((e, inst, info) => {
20
32
  error.value = `
21
33
  ${e}.
@@ -1,10 +1,19 @@
1
- import SuspensedDashboard from "./SuspensedDashboard.ce.vue";
1
+ import App from "./App.vue";
2
2
  import { defineCustomElement } from "vue";
3
- /** @type {import("./asWebComponent").EodashConstructor} */
4
- export const Eodash = defineCustomElement(SuspensedDashboard);
3
+ import { registerPlugins } from "./plugins";
4
+ /**
5
+ * @type {import("vue").VueElementConstructor<
6
+ * import("vue").ExtractPropTypes<{ config: string }>>}
7
+ * */
8
+ export const EodashConstructor = defineCustomElement(App, {
9
+ shadowRoot: false,
10
+ configureApp(app) {
11
+ registerPlugins(app);
12
+ },
13
+ });
5
14
 
6
15
  export function register() {
7
- customElements.define("eo-dash", Eodash);
16
+ customElements.define("eo-dash", EodashConstructor);
8
17
  }
9
18
 
10
19
  export { default as store } from "@/store";
@@ -1,9 +1,10 @@
1
1
  <template>
2
2
  <v-main>
3
- <eox-layout :gap="eodash.template.gap ?? 2">
3
+ <eox-layout :gap="gap" :style="`padding: ${gap}px`">
4
4
  <eox-layout-item
5
- v-if="bgWidget.component"
6
- class="bg-panel"
5
+ v-if="bgWidget?.component"
6
+ class="bg-panel bg-surface"
7
+ :style="`margin: -${gap + 1}px;`"
7
8
  x="0"
8
9
  y="0"
9
10
  h="12"
@@ -12,14 +13,15 @@
12
13
  <Suspense suspensible>
13
14
  <component
14
15
  id="bg-widget"
15
- :is="bgWidget.component"
16
- v-bind="bgWidget.props"
16
+ :is="bgWidget?.component"
17
+ v-bind="bgWidget?.props"
17
18
  />
18
19
  </Suspense>
19
20
  </eox-layout-item>
20
21
  <template v-for="(importedWidget, idx) in importedWidgets" :key="idx">
21
22
  <Transition name="fade">
22
23
  <eox-layout-item
24
+ :id="importedWidget.value.id.toString()"
23
25
  v-if="importedWidget.value.component"
24
26
  :key="importedWidget.value.id"
25
27
  class="panel bg-surface"
@@ -42,27 +44,21 @@
42
44
  </v-main>
43
45
  </template>
44
46
  <script setup>
45
- import { eodashKey } from "@/utils/keys";
46
- import { inject } from "vue";
47
- import { useDefineWidgets } from "@/composables/DefineWidgets";
48
47
  import "@eox/layout";
48
+ import { useDefineTemplate } from "@/composables/DefineTemplate";
49
49
 
50
- const eodash = /** @type {import("@/types").Eodash} */ (inject(eodashKey));
51
-
52
- const [bgWidget] = useDefineWidgets([eodash.template?.background]);
53
-
54
- const importedWidgets = useDefineWidgets(eodash.template?.widgets);
50
+ const { bgWidget, importedWidgets, gap } = useDefineTemplate();
55
51
  </script>
56
52
  <style scoped>
57
53
  .panel {
58
54
  position: relative;
59
55
  overflow: visible;
60
56
  z-index: 1;
61
- border-radius: 0px;
62
57
  }
63
58
 
64
59
  .bg-panel {
65
60
  z-index: 0;
61
+ border-radius: 0px !important;
66
62
  }
67
63
 
68
64
  .fade-enter-active,
@@ -74,4 +70,30 @@ const importedWidgets = useDefineWidgets(eodash.template?.widgets);
74
70
  .fade-leave-to {
75
71
  opacity: 0;
76
72
  }
73
+ :deep(.bg-surface) {
74
+ backdrop-filter: blur(9.5px) !important;
75
+ background-color: rgba(
76
+ var(--v-theme-surface),
77
+ var(--v-surface-opacity, 0.8)
78
+ ) !important;
79
+ border-radius: 4px;
80
+ border-style: solid;
81
+ border-width: 1px;
82
+ border-color: rgb(var(--v-theme-surface));
83
+ scrollbar-color: rgba(var(--v-theme-on-surface), 0.2) transparent;
84
+ scrollbar-width: thin;
85
+ }
86
+ :deep(.bg-primary) {
87
+ backdrop-filter: blur(9.5px) !important;
88
+ background-color: rgba(
89
+ var(--v-theme-primary),
90
+ var(--v-primary-opacity, 0.8)
91
+ ) !important;
92
+ border-radius: 4px;
93
+ border-style: solid;
94
+ border-width: 1px;
95
+ border-color: rgb(var(--v-theme-primary));
96
+ scrollbar-color: rgba(var(--v-theme-on-primary), 0.2) transparent;
97
+ scrollbar-width: thin;
98
+ }
77
99
  </style>
@@ -4,9 +4,9 @@
4
4
  <ErrorAlert v-model="error" />
5
5
  <Suspense>
6
6
  <component
7
- v-if="loading.component"
8
- :is="loading.component"
9
- v-bind="loading.props"
7
+ v-if="loading?.component"
8
+ :is="loading?.component"
9
+ v-bind="loading?.props"
10
10
  ></component>
11
11
  <div v-else class="text-center">Loading...</div>
12
12
  <template #fallback>
@@ -17,14 +17,11 @@
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";
20
+ import { onErrorCaptured, ref } from "vue";
23
21
  import ErrorAlert from "./ErrorAlert.vue";
22
+ import { useDefineTemplate } from "@/composables/DefineTemplate";
24
23
 
25
- const eodash = /** @type {import("@/types").Eodash} */ (inject(eodashKey));
26
-
27
- const [loading] = useDefineWidgets([eodash.template.loading]);
24
+ const { loading } = useDefineTemplate();
28
25
 
29
26
  const error = ref("");
30
27
  onErrorCaptured((e, inst, info) => {
@@ -3,7 +3,7 @@
3
3
  <Suspense suspensible>
4
4
  <component
5
5
  id="bg-widget"
6
- v-if="bgWidget.component"
6
+ v-if="bgWidget?.component"
7
7
  :is="bgWidget.component"
8
8
  v-bind="bgWidget.props"
9
9
  ></component>
@@ -16,9 +16,11 @@
16
16
  id="overlay"
17
17
  class="pa-2 panel bg-surface"
18
18
  >
19
- <v-btn icon variant="text" class="close-btn" @click="activeIdx = -1"
20
- >&#x2715;</v-btn
21
- >
19
+ <div class="d-flex py-2 justify-end align-end">
20
+ <v-btn icon variant="text" class="close-btn" @click="activeIdx = -1"
21
+ >&#x2715;</v-btn
22
+ >
23
+ </div>
22
24
  <Suspense suspensible>
23
25
  <div class="component-container" v-show="activeIdx === idx">
24
26
  <component
@@ -48,18 +50,11 @@
48
50
  </v-main>
49
51
  </template>
50
52
  <script setup>
51
- import { eodashKey } from "@/utils/keys";
52
- import { inject, ref, onMounted } from "vue";
53
- import { useDefineWidgets } from "@/composables/DefineWidgets";
53
+ import { useDefineTemplate } from "@/composables/DefineTemplate";
54
+ import { ref, onMounted } from "vue";
54
55
  import { useLayout } from "vuetify";
55
56
 
56
- const eodash = /** @type {import("@/types").Eodash} */ (inject(eodashKey));
57
-
58
- //import widgets
59
- const widgetsConfig = eodash.template.widgets;
60
- const importedWidgets = useDefineWidgets(widgetsConfig);
61
- const [bgWidget] = useDefineWidgets([eodash.template?.background]);
62
-
57
+ const { bgWidget, importedWidgets } = useDefineTemplate();
63
58
  const { mainRect } = useLayout();
64
59
 
65
60
  const activeIdx = ref(-1);
@@ -106,4 +101,11 @@ onMounted(() => {
106
101
  position: relative;
107
102
  z-index: 10;
108
103
  }
104
+ :deep(.bg-surface) {
105
+ backdrop-filter: blur(9.5px) !important;
106
+ background-color: rgba(
107
+ var(--v-theme-surface),
108
+ var(--v-surface-opacity, 0.8)
109
+ ) !important;
110
+ }
109
111
  </style>
@@ -3,8 +3,7 @@ import { eodashKey } from "@/utils/keys";
3
3
  import { inject } from "vue";
4
4
 
5
5
  /**
6
- * Sets user defined instance on runtime. Consumes `/@fs/config.js` and assign
7
- * it to `eodash`
6
+ * Handles importing user defined instance of Eodash
8
7
  *
9
8
  * @async
10
9
  * @param {string | undefined} runtimeConfig
@@ -15,6 +14,17 @@ export const useEodashRuntime = async (runtimeConfig) => {
15
14
  const eodash = /** @type {import("@/types").Eodash} */ (inject(eodashKey));
16
15
  /** @param {import("@/types").Eodash} config */
17
16
  const assignInstance = (config) => {
17
+ if ("template" in config) {
18
+ //@ts-expect-error to do
19
+ delete eodash.templates;
20
+ //@ts-expect-error to do
21
+ eodash.template = config.template;
22
+ } else if ("templates" in config) {
23
+ //@ts-expect-error to do
24
+ delete eodash.template;
25
+ //@ts-expect-error to do
26
+ eodash.templates = config.templates;
27
+ }
18
28
  /** @type {(keyof import("@/types").Eodash)[]} */ (
19
29
  Object.keys(eodash)
20
30
  ).forEach((key) => {
@@ -54,8 +64,8 @@ export const useEodashRuntime = async (runtimeConfig) => {
54
64
 
55
65
  /**
56
66
  * @param {((
57
- * store: import("@/types").EodashStore,
58
- * ) => Promise<import("@/types").Eodash>)
67
+ * store: typeof import("@/store").default,
68
+ * ) => (Promise<import("@/types").Eodash> | import("@/types").Eodash))
59
69
  * | import("@/types").Eodash} config
60
70
  */
61
71
  export const createEodash = async (config) => {
@@ -0,0 +1,67 @@
1
+ import { eodashKey } from "@/utils/keys";
2
+ import { inject, ref, shallowReactive, shallowRef, toRefs, watch } from "vue";
3
+ import { useDefineWidgets } from "./DefineWidgets";
4
+ import { activeTemplate } from "@/store/states";
5
+ import { createSharedComposable } from "@vueuse/core";
6
+ import log from "loglevel";
7
+
8
+ /**
9
+ * @typedef {{
10
+ * bgWidget:ReturnType< typeof import("./DefineWidgets").useDefineWidgets>[number]| import("vue").ShallowRef<null>
11
+ * loading: ReturnType< typeof import("./DefineWidgets").useDefineWidgets>[number]| import("vue").ShallowRef<null>
12
+ * importedWidgets:ReturnType< typeof import("./DefineWidgets").useDefineWidgets>
13
+ * gap: import("vue").Ref<number>
14
+ * }} DefinedTemplate
15
+ **/
16
+
17
+ const useTemplate = () => {
18
+ const eodash = /** @type {import("@/types").Eodash} */ (inject(eodashKey));
19
+
20
+ /** @type {DefinedTemplate} */
21
+ const definedTemplate = shallowReactive({
22
+ bgWidget: shallowRef(null),
23
+ importedWidgets: [],
24
+ loading: shallowRef(null),
25
+ gap: ref(16),
26
+ });
27
+
28
+ if ("template" in eodash) {
29
+ [definedTemplate.bgWidget] = useDefineWidgets([eodash.template.background]);
30
+ [definedTemplate.loading] = useDefineWidgets([eodash.template.loading]);
31
+ definedTemplate.importedWidgets = useDefineWidgets(eodash.template.widgets);
32
+ definedTemplate.gap.value = eodash.template.gap ?? 16;
33
+ } else {
34
+ watch(
35
+ activeTemplate,
36
+ (template) => {
37
+ log.debug("Active template watcher triggered, changing to:", template);
38
+ if (!template) {
39
+ template = Object.keys(eodash.templates)[0];
40
+ activeTemplate.value = template ?? "";
41
+ log.debug("No template found, setting to first template", template);
42
+ }
43
+
44
+ if (!template || !eodash.templates[template]) {
45
+ console.error(`[eodash] template not found`);
46
+ return;
47
+ }
48
+
49
+ const templateConfig = eodash.templates[template];
50
+ [definedTemplate.bgWidget] = useDefineWidgets([
51
+ templateConfig.background,
52
+ ]);
53
+
54
+ [definedTemplate.loading] = useDefineWidgets([templateConfig.loading]);
55
+
56
+ definedTemplate.importedWidgets = useDefineWidgets(
57
+ templateConfig.widgets,
58
+ );
59
+ definedTemplate.gap.value = templateConfig.gap ?? 16;
60
+ },
61
+ { immediate: true },
62
+ );
63
+ }
64
+ return toRefs(definedTemplate);
65
+ };
66
+
67
+ export const useDefineTemplate = createSharedComposable(useTemplate);
@@ -13,7 +13,9 @@ import { storeToRefs } from "pinia";
13
13
  */
14
14
 
15
15
  /** @typedef {import("vue").ShallowRef<DefinedWidget>} ReactiveDefinedWidget */
16
-
16
+ /**
17
+ * Widgets import map that is created from eodash internals and user defined widgets
18
+ */
17
19
  const internalWidgets = (() => {
18
20
  /** @type {Record<string, () => Promise<import("vue").Component>>} */
19
21
  const importMap = {
@@ -44,7 +46,6 @@ const internalWidgets = (() => {
44
46
  * | undefined
45
47
  * )[]
46
48
  * | undefined} widgetConfigs
47
- * @returns {ReactiveDefinedWidget[]}
48
49
  */
49
50
  export const useDefineWidgets = (widgetConfigs) => {
50
51
  /** @type {ReactiveDefinedWidget[]} */