@eodash/eodash 5.1.0 → 5.3.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 (133) hide show
  1. package/core/client/components/DashboardLayout.vue +1 -2
  2. package/core/client/components/EodashOverlay.vue +4 -5
  3. package/core/client/components/MobileLayout.vue +42 -21
  4. package/core/client/composables/index.js +54 -60
  5. package/core/client/eodashSTAC/EodashCollection.js +199 -108
  6. package/core/client/eodashSTAC/auth.js +86 -0
  7. package/core/client/eodashSTAC/createLayers.js +234 -4
  8. package/core/client/eodashSTAC/helpers.js +281 -59
  9. package/core/client/eodashSTAC/parquet.js +0 -13
  10. package/core/client/eodashSTAC/triggers.js +1 -1
  11. package/core/client/store/actions.js +14 -0
  12. package/core/client/store/stac.js +46 -8
  13. package/core/client/store/states.js +6 -0
  14. package/core/client/types.ts +206 -3
  15. package/core/client/utils/bands-editor/arithmetic.js +144 -0
  16. package/core/client/utils/bands-editor/colors.js +36 -0
  17. package/core/client/utils/bands-editor/dom.js +196 -0
  18. package/core/client/utils/bands-editor/exampleSchema.json +1320 -0
  19. package/core/client/utils/bands-editor/index.js +68 -0
  20. package/core/client/utils/bands-editor/rgb.js +102 -0
  21. package/core/client/utils/index.js +5 -2
  22. package/core/client/views/Dashboard.vue +1 -1
  23. package/core/client/vite-env.d.ts +122 -0
  24. package/dist/client/{DashboardLayout-ByVs1DrY.js → DashboardLayout-Cq15p4TH.js} +5 -6
  25. package/dist/client/{DynamicWebComponent-C3W7HSQm.js → DynamicWebComponent-Cv-fPRG1.js} +1 -1
  26. package/dist/client/{EodashDatePicker-BIAf1sMT.js → EodashDatePicker-CPlJwEIO.js} +20 -22
  27. package/dist/client/{EodashItemFilter-DPznh8UB.js → EodashItemFilter-Ydebgbjj.js} +46 -31
  28. package/dist/client/EodashLayerControl-COhrkNEs.js +1517 -0
  29. package/dist/client/{EodashLayoutSwitcher-C5qTEffW.js → EodashLayoutSwitcher-pnKhTRZV.js} +4 -4
  30. package/dist/client/EodashMapBtns-Cj0Fx119.js +301 -0
  31. package/dist/client/{EodashStacInfo-CSvvF2jI.js → EodashStacInfo-Dadkg_Nj.js} +1 -1
  32. package/dist/client/EodashTimeSlider-CpoHX0S7.js +53 -0
  33. package/dist/client/{EodashTools-Cv1SXQ5y.js → EodashTools-UGBG7KC9.js} +10 -7
  34. package/dist/client/{ExportState-D-iuwaad.js → ExportState-GtJkAqeZ.js} +145 -121
  35. package/dist/client/{Footer-CyF0zRAk.js → Footer-D3ZPG5c4.js} +1 -1
  36. package/dist/client/{Header-CgD8jDKU.js → Header-z6AK-wpN.js} +2 -3
  37. package/dist/client/MobileLayout-BXNsNftb.js +118 -0
  38. package/dist/client/{PopUp-BsYLvWch.js → PopUp-BbQdjENV.js} +79 -44
  39. package/dist/client/{ProcessList-C2xsLU2_.js → ProcessList-C6VsdsYI.js} +18 -12
  40. package/dist/client/{VImg-OHe8YTs2.js → VImg-CxaMSB99.js} +203 -5
  41. package/dist/client/{VMain-PryTLU4a.js → VMain-Ds7yw0wj.js} +1 -1
  42. package/dist/client/{VTooltip-DZ0fjpB3.js → VTooltip-Cze6CEVh.js} +2 -3
  43. package/dist/client/{WidgetsContainer-B9LBadcC.js → WidgetsContainer-D66bj-JJ.js} +1 -1
  44. package/dist/client/asWebComponent-CWbNRdf9.js +8895 -0
  45. package/dist/client/{async-DkSu_u2K.js → async-BA7oWCMX.js} +69 -5
  46. package/dist/client/easing-CH0-9wR8.js +35 -0
  47. package/dist/client/eo-dash.js +1 -1
  48. package/dist/client/{VOverlay-yUn7p-Uf.js → forwardRefs-BUfxOIo-.js} +308 -28
  49. package/dist/client/{handling-CgmFXkW6.js → handling-DlNTtKB-.js} +27 -6
  50. package/dist/client/{helpers-Dy0Q13tP.js → helpers-CtE0W7iu.js} +595 -278
  51. package/dist/client/{index-skjhlH8u.js → index-CeEZIjO6.js} +26 -13
  52. package/dist/client/{index-Ch_HchK3.js → index-CsKbRDeN.js} +238 -77
  53. package/dist/client/{index-Dqj4tbx2.js → index-D4_NRKrf.js} +2 -2
  54. package/dist/client/index-DeECc3lV.js +571 -0
  55. package/dist/client/material-symbols-outlined.woff2 +0 -0
  56. package/dist/client/material-symbols-rounded.woff2 +0 -0
  57. package/dist/client/material-symbols-sharp.woff2 +0 -0
  58. package/dist/client/material-symbols-subset.woff2 +0 -0
  59. package/dist/client/templates.js +106 -49
  60. package/dist/client/{transition-C98Yn4Vo.js → transition-Byvp3L6Y.js} +1 -1
  61. package/dist/node/cli.js +6 -6
  62. package/dist/types/core/client/eodashSTAC/EodashCollection.d.ts +24 -10
  63. package/dist/types/core/client/eodashSTAC/auth.d.ts +7 -0
  64. package/dist/types/core/client/eodashSTAC/createLayers.d.ts +15 -3
  65. package/dist/types/core/client/eodashSTAC/helpers.d.ts +51 -15
  66. package/dist/types/core/client/plugins/vuetify.d.ts +14 -14
  67. package/dist/types/core/client/store/actions.d.ts +2 -0
  68. package/dist/types/core/client/store/stac.d.ts +16 -7
  69. package/dist/types/core/client/store/states.d.ts +4 -0
  70. package/dist/types/core/client/types.d.ts +171 -3
  71. package/dist/types/core/client/utils/bands-editor/arithmetic.d.ts +8 -0
  72. package/dist/types/core/client/utils/bands-editor/colors.d.ts +15 -0
  73. package/dist/types/core/client/utils/bands-editor/dom.d.ts +42 -0
  74. package/dist/types/core/client/utils/bands-editor/index.d.ts +20 -0
  75. package/dist/types/core/client/utils/bands-editor/rgb.d.ts +15 -0
  76. package/dist/types/core/client/utils/index.d.ts +1 -1
  77. package/dist/types/templates/baseConfig.d.ts +87 -1
  78. package/dist/types/templates/compare.d.ts +0 -25
  79. package/dist/types/templates/expert.d.ts +17 -21
  80. package/dist/types/templates/explore.d.ts +67 -0
  81. package/dist/types/templates/index.d.ts +1 -1
  82. package/dist/types/templates/{light.d.ts → lite.d.ts} +9 -0
  83. package/dist/types/widgets/EodashItemCatalog/index.vue.d.ts +21 -0
  84. package/dist/types/widgets/EodashItemCatalog/methods/filters.d.ts +49 -0
  85. package/dist/types/widgets/EodashItemCatalog/methods/handlers.d.ts +4 -0
  86. package/dist/types/widgets/EodashItemCatalog/methods/map.d.ts +12 -0
  87. package/dist/types/widgets/EodashItemCatalog/types.d.ts +14 -0
  88. package/dist/types/widgets/{EodashMapBtns.vue.d.ts → EodashMap/EodashMapBtns.vue.d.ts} +6 -0
  89. package/dist/types/widgets/EodashMap/index.vue.d.ts +114 -0
  90. package/dist/types/widgets/EodashMap/methods/create-layers-config.d.ts +1 -1
  91. package/dist/types/widgets/EodashMap/methods/index.d.ts +1 -1
  92. package/dist/types/widgets/EodashProcess/methods/async.d.ts +1 -0
  93. package/dist/types/widgets/EodashProcess/methods/custom-endpoints/layers/eoxhub-workspaces-endpoint.d.ts +1 -1
  94. package/dist/types/widgets/EodashTimeSlider.vue.d.ts +7 -0
  95. package/dist/types/widgets/EodashTools.vue.d.ts +10 -10
  96. package/dist/types/widgets/ExportState.vue.d.ts +2 -0
  97. package/package.json +31 -28
  98. package/templates/baseConfig.js +10 -5
  99. package/templates/compare.js +2 -22
  100. package/templates/expert.js +19 -18
  101. package/templates/explore.js +62 -0
  102. package/templates/index.js +1 -1
  103. package/templates/{light.js → lite.js} +11 -2
  104. package/widgets/EodashDatePicker.vue +15 -18
  105. package/widgets/EodashItemCatalog/index.vue +161 -0
  106. package/widgets/EodashItemCatalog/methods/filters.js +216 -0
  107. package/widgets/EodashItemCatalog/methods/handlers.js +50 -0
  108. package/widgets/EodashItemCatalog/methods/map.js +144 -0
  109. package/widgets/EodashItemCatalog/types.ts +15 -0
  110. package/widgets/EodashItemFilter.vue +35 -28
  111. package/widgets/EodashLayerControl.vue +10 -6
  112. package/widgets/EodashLayoutSwitcher.vue +1 -1
  113. package/widgets/EodashMap/EodashMapBtns.vue +278 -0
  114. package/widgets/EodashMap/index.vue +263 -38
  115. package/widgets/EodashMap/methods/create-layers-config.js +9 -6
  116. package/widgets/EodashMap/methods/index.js +27 -13
  117. package/widgets/EodashProcess/ProcessList.vue +13 -1
  118. package/widgets/EodashProcess/index.vue +17 -1
  119. package/widgets/EodashProcess/methods/async.js +22 -1
  120. package/widgets/EodashProcess/methods/custom-endpoints/chart/veda-endpoint.js +25 -3
  121. package/widgets/EodashProcess/methods/handling.js +2 -0
  122. package/widgets/EodashProcess/methods/outputs.js +1 -0
  123. package/widgets/EodashProcess/methods/utils.js +45 -1
  124. package/widgets/EodashTimeSlider.vue +40 -0
  125. package/widgets/EodashTools.vue +7 -3
  126. package/widgets/ExportState.vue +53 -22
  127. package/dist/client/EodashLayerControl-Bhxjw4V2.js +0 -154
  128. package/dist/client/EodashMapBtns-WoGq8MuV.js +0 -173
  129. package/dist/client/MobileLayout-EKQ_kpSh.js +0 -1226
  130. package/dist/client/asWebComponent-By_7_JjS.js +0 -19193
  131. package/dist/client/forwardRefs-BXxrv98s.js +0 -272
  132. package/dist/client/index-BuhOHXKv.js +0 -199
  133. package/widgets/EodashMapBtns.vue +0 -155
@@ -1,9 +1,8 @@
1
1
  <template>
2
- <v-main>
2
+ <v-main class="pa-0">
3
3
  <eox-layout
4
4
  :mediaBreakpoints="[0, 960, 1920]"
5
5
  :gap="gap"
6
- class="layout-container"
7
6
  :style="layoutStyle"
8
7
  >
9
8
  <eox-layout-item
@@ -1,5 +1,5 @@
1
1
  <template>
2
- <div class="eodash-overlay" v-if="$vuetify.display.mdAndUp">
2
+ <div class="eodash-overlay">
3
3
  <p>
4
4
  <a href="https://github.com/eodash/eodash" target="_blank"
5
5
  >eodash v{{ version }}</a
@@ -41,10 +41,9 @@ const base64Logo = btoa(eoxLogo);
41
41
  z-index: 9999;
42
42
  pointer-events: none;
43
43
  p {
44
- position: absolute;
45
- bottom: -4px;
46
- left: 95px;
47
- transform: translate(-50%, -50%);
44
+ position: fixed;
45
+ bottom: 6px;
46
+ left: 24px;
48
47
  color: rgba(var(--v-theme-on-secondary), 1);
49
48
  }
50
49
  a {
@@ -1,5 +1,5 @@
1
1
  <template>
2
- <v-main class="overflow-hidden">
2
+ <v-main class="overflow-hidden pa-0">
3
3
  <Suspense suspensible>
4
4
  <component
5
5
  id="bg-widget"
@@ -18,9 +18,17 @@
18
18
  class="pa-2 panel bg-surface"
19
19
  >
20
20
  <div class="d-flex py-2 justify-end align-end">
21
- <v-btn icon variant="text" class="close-btn" @click="activeIdx = -1"
22
- >&#x2715;</v-btn
21
+ <button
22
+ class="circle small transparent close-btn"
23
+ @click="activeIdx = -1"
23
24
  >
25
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
26
+ <title>close</title>
27
+ <path
28
+ d="M19,6.41L17.59,5L12,10.59L6.41,5L5,6.41L10.59,12L5,17.59L6.41,19L12,13.41L17.59,19L19,17.59L13.41,12L19,6.41Z"
29
+ />
30
+ </svg>
31
+ </button>
24
32
  </div>
25
33
  <Suspense suspensible>
26
34
  <div
@@ -37,20 +45,17 @@
37
45
  </div>
38
46
  </template>
39
47
 
40
- <v-tabs
41
- ref="tabs"
42
- align-tabs="center"
43
- bg-color="surface"
44
- class="tabs"
45
- show-arrows
46
- v-model="activeIdx"
47
- >
48
+ <nav class="tabbed tabs">
48
49
  <template v-for="(importedWidget, idx) in importedWidgets" :key="idx">
49
- <v-tab v-if="importedWidget.value.component" :value="idx">
50
- {{ importedWidget.value.title }}
51
- </v-tab>
50
+ <a
51
+ v-if="importedWidget.value.component"
52
+ :class="{ active: activeIdx === idx }"
53
+ @click="activeIdx = activeIdx === idx ? -1 : idx"
54
+ >
55
+ <span>{{ importedWidget.value.title }}</span>
56
+ </a>
52
57
  </template>
53
- </v-tabs>
58
+ </nav>
54
59
  </v-main>
55
60
  </template>
56
61
  <script setup>
@@ -63,8 +68,6 @@ const { mainRect } = useLayout();
63
68
 
64
69
  const activeIdx = ref(-1);
65
70
 
66
- /** @type {import("vue").Ref<import("vuetify/components").VTabs | null>} */
67
- const tabs = ref(null);
68
71
  const tabsHeightFromBtm = ref("");
69
72
  const mainRectTopPx = ref("");
70
73
  const mainRectBtmPx = ref("");
@@ -72,11 +75,22 @@ const mainRectBtmPx = ref("");
72
75
  onMounted(() => {
73
76
  mainRectTopPx.value = mainRect.value.top + "px";
74
77
  mainRectBtmPx.value = (mainRect.value.bottom || 48) + "px";
75
- tabsHeightFromBtm.value =
76
- mainRect.value.bottom + (tabs.value?.$el?.clientHeight ?? 48) + "px";
78
+ tabsHeightFromBtm.value = mainRect.value.bottom + 48 + 32 + "px"; // 48px nav height + 32px bottom offset
77
79
  });
78
80
  </script>
79
81
  <style scoped>
82
+ @import url("@eox/ui/style.css");
83
+
84
+ #bg-widget {
85
+ position: absolute;
86
+ top: 0;
87
+ left: 0;
88
+ right: 0;
89
+ bottom: 0;
90
+ width: 100%;
91
+ height: 100%;
92
+ }
93
+
80
94
  .panel {
81
95
  bottom: v-bind("tabsHeightFromBtm");
82
96
  top: v-bind("mainRectTopPx");
@@ -97,9 +111,16 @@ onMounted(() => {
97
111
  }
98
112
 
99
113
  .tabs {
100
- bottom: v-bind("mainRectBtmPx");
101
- position: relative;
114
+ position: fixed;
115
+ bottom: 32px;
116
+ left: 12px;
117
+ right: 12px;
118
+ width: calc(100% - 24px);
119
+ height: 48px;
102
120
  z-index: 10;
121
+ background: white;
122
+ border-radius: 24px;
123
+ box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
103
124
  }
104
125
  :deep(.bg-surface) {
105
126
  backdrop-filter: blur(10px) !important;
@@ -22,6 +22,7 @@ import { setCollectionsPalette } from "@/utils";
22
22
  import mustache from "mustache";
23
23
  import { toAbsolute } from "stac-js/src/http.js";
24
24
  import axios from "@/plugins/axios";
25
+ import { storeToRefs } from "pinia";
25
26
 
26
27
  /**
27
28
  /** @type {import('@/types').Eodash | null}*/
@@ -57,68 +58,60 @@ export function useEodash() {
57
58
  }
58
59
 
59
60
  /**
60
- * Creates an absolute URL from a relative link and assignes it to `currentUrl`
61
- *
62
- * @param {string} [rel=''] Default is `''`
63
- * @param {string} [base=eodash.stacEndpoint] - Base URL, default value is the
64
- * root stac catalog. Default is `eodash.stacEndpoint`
65
- * @returns {import("vue").Ref<string>} - Returns `currentUrl`
66
- * @see {@link '@/store/states.js'}
61
+ * @param {import("vue").Ref<string>} absoluteUrl
62
+ * @returns
67
63
  */
68
- export const useAbsoluteUrl = (
69
- rel = "",
70
- base = inject(eodashKey)?.stacEndpoint,
71
- ) => {
72
- if (!rel || rel.includes("http") || !base) {
73
- currentUrl.value = rel;
74
- return currentUrl;
75
- }
76
-
77
- const st = base.split("/");
78
- const arr = rel.split("/");
79
- st.pop();
80
-
81
- for (let i = 0; i < arr.length; i++) {
82
- if (arr[i] == ".") continue;
83
- if (arr[i] == "..") st.pop();
84
- else st.push(arr[i]);
85
- }
86
-
87
- currentUrl.value = st.join("/");
88
- return currentUrl;
89
- };
64
+ const createUseAbsoluteUrl = (absoluteUrl) => {
65
+ /**
66
+ * Creates an absolute URL from a relative link and assignes it to `currentUrl`
67
+ *
68
+ * @param {string} [rel=''] Default is `''`
69
+ * @param {string} [base=eodash.stacEndpoint] - Base URL, default value is the
70
+ * root stac catalog. Default is `eodash.stacEndpoint`
71
+ * @returns {import("vue").Ref<string>} - Returns `currentUrl`
72
+ * @see {@link '@/store/states.js'}
73
+ */
74
+ return (rel = "", base) => {
75
+ const { stacEndpoint, isApi } = storeToRefs(useSTAcStore());
76
+ if (!base) {
77
+ base = stacEndpoint.value ?? undefined;
78
+ if (!base) {
79
+ console.warn(
80
+ "[eodash] No base URL provided for absolute URL construction.",
81
+ );
82
+ return absoluteUrl;
83
+ }
84
+ }
85
+ if (isApi.value) {
86
+ absoluteUrl.value = base + `/collections/${rel}`;
87
+ return absoluteUrl;
88
+ }
90
89
 
91
- /**
92
- * Use the absolute compare URL from a relative link
93
- *
94
- * @param {string} [rel=''] Default is `''`
95
- * @param {string} [base=eodash.stacEndpoint] - Base URL, default value is the
96
- * root stac catalog. Default is `eodash.stacEndpoint`
97
- * @returns {import("vue").Ref<string>} - Returns `currentUrl`
98
- * @see {@link '@/store/states.js'}
99
- */
100
- export const useCompareAbsoluteUrl = (
101
- rel = "",
102
- base = inject(eodashKey)?.stacEndpoint,
103
- ) => {
104
- if (!rel || rel.includes("http") || !base) {
105
- currentCompareUrl.value = rel;
106
- return currentCompareUrl;
107
- }
90
+ if (rel.includes("http")) {
91
+ absoluteUrl.value = rel;
92
+ return absoluteUrl;
93
+ }
94
+ if (!rel) {
95
+ absoluteUrl.value = base;
96
+ return absoluteUrl;
97
+ }
108
98
 
109
- const st = base.split("/");
110
- const arr = rel.split("/");
111
- st.pop();
99
+ const st = base.split("/");
100
+ const arr = rel.split("/");
101
+ st.pop();
112
102
 
113
- for (let i = 0; i < arr.length; i++) {
114
- if (arr[i] == ".") continue;
115
- if (arr[i] == "..") st.pop();
116
- else st.push(arr[i]);
117
- }
103
+ for (let i = 0; i < arr.length; i++) {
104
+ if (arr[i] == ".") continue;
105
+ if (arr[i] == "..") st.pop();
106
+ else st.push(arr[i]);
107
+ }
118
108
 
119
- currentCompareUrl.value = st.join("/");
120
- return currentCompareUrl;
109
+ absoluteUrl.value = st.join("/");
110
+ return absoluteUrl;
111
+ };
121
112
  };
113
+ export const useAbsoluteUrl = createUseAbsoluteUrl(currentUrl);
114
+ export const useCompareAbsoluteUrl = createUseAbsoluteUrl(currentCompareUrl);
122
115
 
123
116
  /**
124
117
  * Updates an existing Vuetify theme. updates only the values provided in the
@@ -178,7 +171,6 @@ export const useURLSearchParametersSync = () => {
178
171
  }
179
172
  case "indicator": {
180
173
  log.debug("Found indicator key in url");
181
- const eodash = inject(eodashKey);
182
174
  const match = store.stac?.find(
183
175
  (link) => useGetSubCodeId(link) == value,
184
176
  );
@@ -187,7 +179,7 @@ export const useURLSearchParametersSync = () => {
187
179
  if (searchParams.has("poi")) {
188
180
  const indicatorUrl = toAbsolute(
189
181
  match.href,
190
- eodash?.stacEndpoint ?? "",
182
+ store.stacEndpoint ?? "",
191
183
  );
192
184
  // fetch indicator stac collection without rendering it
193
185
  /** @type {import("stac-ts").StacCollection} */
@@ -224,7 +216,9 @@ export const useURLSearchParametersSync = () => {
224
216
  await store.loadSelectedSTAC(poiAbsoluteUrl, true);
225
217
  }
226
218
  } else {
227
- await store.loadSelectedSTAC(match.href);
219
+ await store.loadSelectedSTAC(
220
+ /** @type {string} */ (store.isApi ? match.id : match.href),
221
+ );
228
222
  }
229
223
  }
230
224
  break;
@@ -384,7 +378,7 @@ export const useEmitLayersUpdate = async (event, mapEl, layers) => {
384
378
  return;
385
379
  }
386
380
 
387
- dl.getLayers().once("change", async () => {
381
+ mapEl.map.once("loadend", async () => {
388
382
  await emit();
389
383
  res(true);
390
384
  });