@eodash/eodash 5.0.0-alpha.2.13 → 5.0.0-alpha.2.14

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 (36) hide show
  1. package/core/client/composables/index.js +36 -1
  2. package/core/client/eodash.js +27 -6
  3. package/core/client/store/States.js +4 -0
  4. package/core/client/store/stac.js +42 -2
  5. package/core/client/utils/eodashSTAC.js +2 -4
  6. package/core/client/utils/helpers.js +0 -4
  7. package/dist/client/{DashboardLayout-v8_zE0jH.js → DashboardLayout-ulCTLwXv.js} +2 -2
  8. package/dist/client/{DynamicWebComponent-DSY-5Ke4.js → DynamicWebComponent-CZJjeckP.js} +3 -3
  9. package/dist/client/{EodashDatePicker-C6VRIC7r.js → EodashDatePicker-BClSZg9g.js} +4 -4
  10. package/dist/client/{EodashItemFilter-BBXcouVm.js → EodashItemFilter-9hK-3-7Y.js} +3609 -3555
  11. package/dist/client/EodashLayerControl-p5FdBiiJ.js +20969 -0
  12. package/dist/client/{EodashMap-DY7I6iY4.js → EodashMap-jqF-NaSp.js} +39009 -63663
  13. package/dist/client/{EodashMapBtns-k00mMvVA.js → EodashMapBtns-F7rE6A-2.js} +2 -2
  14. package/dist/client/{ExportState-Cf40G0wJ.js → ExportState-CHU5c0uO.js} +4 -4
  15. package/dist/client/{Footer-DrCAj7E9.js → Footer-DjkwaDHV.js} +1 -1
  16. package/dist/client/{Header-BZT87lHO.js → Header-V8pZw2HR.js} +4 -4
  17. package/dist/client/{IframeWrapper-DTynglc_.js → IframeWrapper-C8EZZnHk.js} +1 -1
  18. package/dist/client/{MobileLayout-BymTNZp0.js → MobileLayout-zOO_ZJVe.js} +6 -6
  19. package/dist/client/{PopUp-CwXUqqZg.js → PopUp-BNnXTHYD.js} +6 -6
  20. package/dist/client/{VImg-B-YTQawu.js → VImg-Cj6-XkWV.js} +2 -2
  21. package/dist/client/{VMain-D7s76eFm.js → VMain-BXL9EwGV.js} +2 -2
  22. package/dist/client/{VOverlay-DdGIY0gS.js → VOverlay-C9MeDzGb.js} +29 -29
  23. package/dist/client/{WidgetsContainer-CFR37y2l.js → WidgetsContainer-Cw4LFyGR.js} +3 -3
  24. package/dist/client/{asWebComponent-C2Gm8JDg.js → asWebComponent-GN3G-Gdj.js} +4081 -4034
  25. package/dist/client/{decoder-Cth6J7EK-DdAwx7Hm.js → decoder-DJlmx386-DJlmx386.js} +4 -6
  26. package/dist/client/eo-dash.js +1 -1
  27. package/dist/client/{forwardRefs-BFBakSKN.js → forwardRefs-DF-jCteQ.js} +1 -1
  28. package/dist/client/{helpers-VeeVIAhm.js → helpers-XtsCspQr.js} +6 -7
  29. package/dist/client/{index-DAqRmdAt.js → index-BfF7LPVL.js} +5 -5
  30. package/dist/client/{lerc-BgbQqdFI-CNkQ6JUx.js → lerc-B4lXefGh-WUagmXWl.js} +33 -33
  31. package/dist/client/{ssrBoot-BBelCodY.js → ssrBoot-DNvPtEea.js} +1 -1
  32. package/dist/client/{transition-CxxPQppy.js → transition-Dc2dpya2.js} +1 -1
  33. package/package.json +5 -5
  34. package/widgets/EodashItemFilter.vue +83 -4
  35. package/widgets/EodashMap.vue +191 -123
  36. package/dist/client/EodashLayerControl-BtfpgLGi.js +0 -31500
@@ -1,7 +1,13 @@
1
1
  // functions of this folder can only be consumed inside setup stores,
2
2
  // setup functions or vue composition api components
3
3
 
4
- import { currentUrl, datetime, indicator, mapPosition } from "@/store/States";
4
+ import {
5
+ currentCompareUrl,
6
+ currentUrl,
7
+ datetime,
8
+ indicator,
9
+ mapPosition,
10
+ } from "@/store/States";
5
11
  import eodash from "@/eodash";
6
12
  import { useTheme } from "vuetify/lib/framework.mjs";
7
13
  import { onMounted, watch } from "vue";
@@ -36,6 +42,35 @@ export const useAbsoluteUrl = (rel = "", base = eodash.stacEndpoint) => {
36
42
  return currentUrl;
37
43
  };
38
44
 
45
+ /**
46
+ * Use the absolute compare URL from a relative link
47
+ *
48
+ * @param {string} [rel=''] Default is `''`
49
+ * @param {string} [base=eodash.stacEndpoint] - Base URL, default value is the
50
+ * root stac catalog. Default is `eodash.stacEndpoint`
51
+ * @returns {import("vue").Ref<string>} - Returns `currentUrl`
52
+ * @see {@link '@/store/States.js'}
53
+ */
54
+ export const useCompareAbsoluteUrl = (rel = "", base = eodash.stacEndpoint) => {
55
+ if (!rel || rel.includes("http")) {
56
+ currentCompareUrl.value = base;
57
+ return currentCompareUrl;
58
+ }
59
+
60
+ const st = base.split("/");
61
+ const arr = rel.split("/");
62
+ st.pop();
63
+
64
+ for (let i = 0; i < arr.length; i++) {
65
+ if (arr[i] == ".") continue;
66
+ if (arr[i] == "..") st.pop();
67
+ else st.push(arr[i]);
68
+ }
69
+
70
+ currentCompareUrl.value = st.join("/");
71
+ return currentCompareUrl;
72
+ };
73
+
39
74
  /**
40
75
  * Updates an existing Vuetify theme. updates only the values provided in the
41
76
  * `ThemeDefinition`
@@ -44,6 +44,9 @@ export const eodash = reactive({
44
44
  type: "internal",
45
45
  widget: {
46
46
  name: "EodashMap",
47
+ properties: {
48
+ // enableCompare: true,
49
+ },
47
50
  },
48
51
  },
49
52
  widgets: [
@@ -54,6 +57,10 @@ export const eodash = reactive({
54
57
  layout: { x: 0, y: 0, w: 3, h: 8 },
55
58
  widget: {
56
59
  name: "EodashItemFilter",
60
+ properties: {
61
+ // enableCompare: true,
62
+ aggregateResults: "collection_group",
63
+ },
57
64
  },
58
65
  },
59
66
  {
@@ -78,13 +85,27 @@ export const eodash = reactive({
78
85
  properties: {
79
86
  for: currentUrl,
80
87
  allowHtml: "true",
81
- styleOverride:
82
- "#properties li > .value {font-weight: normal !important;}",
83
- header: "[]",
88
+ styleOverride: `.single-property {columns: 1!important;}
89
+ h1 {margin:0px!important;font-size:16px!important;}
90
+ header h1:after {
91
+ content:' ';
92
+ display:block;
93
+ border:1px solid #d0d0d0;
94
+ }
95
+ h2 {font-size:15px}
96
+ h3 {font-size:14px}
97
+ summary {cursor: pointer;}
98
+ #properties li > .value { font-weight: normal !important;}
99
+ main {padding-bottom: 10px;}
100
+ .footer-container {line-height:1;}
101
+ .footer-container button {margin-top: -10px;}
102
+ .footer-container small {font-size:10px;line-height:1;}`,
103
+ header: '["title"]',
104
+ tags: '["themes"]',
84
105
  subheader: "[]",
85
- properties: '["description"]',
86
- featured: "[]",
87
- footer: "[]",
106
+ properties: '["satellite","sensor","agency","extent"]',
107
+ featured: '["description","providers","assets","links"]',
108
+ footer: '["sci:citation"]',
88
109
  },
89
110
  tagName: "eox-stacinfo",
90
111
  },
@@ -2,6 +2,10 @@ import { ref } from "vue";
2
2
 
3
3
  /** Currently selected STAC endpoint */
4
4
  export const currentUrl = ref("");
5
+
6
+ /** Currently selected compare STAC endpoint */
7
+ export const currentCompareUrl = ref("");
8
+
5
9
  /** Currently selected datetime */
6
10
  export const datetime = ref(new Date().toISOString());
7
11
 
@@ -1,7 +1,7 @@
1
1
  import { defineStore } from "pinia";
2
2
  import { inject, ref } from "vue";
3
3
  import axios from "axios";
4
- import { useAbsoluteUrl } from "@/composables/index";
4
+ import { useAbsoluteUrl, useCompareAbsoluteUrl } from "@/composables/index";
5
5
  import { eodashKey } from "@/utils/keys";
6
6
  import { indicator } from "@/store/States";
7
7
 
@@ -25,6 +25,18 @@ export const useSTAcStore = defineStore("stac", () => {
25
25
  */
26
26
  const selectedStac = ref(null);
27
27
 
28
+ /**
29
+ * Selected STAC object.
30
+ *
31
+ * @type {import("vue").Ref<
32
+ * | import("stac-ts").StacCatalog
33
+ * | import("stac-ts").StacCollection
34
+ * | import("stac-ts").StacItem
35
+ * | null
36
+ * >}
37
+ */
38
+ const selectedCompareStac = ref(null);
39
+
28
40
  const eodash = /** @type {import("@/types").Eodash} */ (inject(eodashKey));
29
41
 
30
42
  /**
@@ -77,5 +89,33 @@ export const useSTAcStore = defineStore("stac", () => {
77
89
  });
78
90
  }
79
91
 
80
- return { stac, loadSTAC, loadSelectedSTAC, selectedStac };
92
+ /**
93
+ * Fetches selected stac object and assign it to `selectedCompareStac`
94
+ *
95
+ * @async
96
+ * @param {string} relativePath - Stac link href
97
+ * @returns {Promise<void>}
98
+ * @see {@link selectedCompareStac}
99
+ */
100
+ async function loadSelectedCompareSTAC(relativePath = "") {
101
+ const absoluteUrl = useCompareAbsoluteUrl(relativePath);
102
+
103
+ await axios
104
+ .get(absoluteUrl.value)
105
+ .then((resp) => {
106
+ selectedCompareStac.value = resp.data;
107
+ })
108
+ .catch((err) => {
109
+ throw new Error("error loading the selected comparison STAC", err);
110
+ });
111
+ }
112
+
113
+ return {
114
+ stac,
115
+ loadSTAC,
116
+ loadSelectedSTAC,
117
+ loadSelectedCompareSTAC,
118
+ selectedStac,
119
+ selectedCompareStac,
120
+ };
81
121
  });
@@ -6,7 +6,6 @@ import {
6
6
  fetchStyle,
7
7
  generateFeatures,
8
8
  setMapProjFromCol,
9
- uid,
10
9
  } from "./helpers";
11
10
  import { registerProjection } from "@/store/Actions";
12
11
  import {
@@ -159,17 +158,16 @@ export class EodashCollection {
159
158
  }
160
159
  return data;
161
160
  }, /** @type {Record<string,import('stac-ts').StacAsset>} */ ({}));
162
-
163
161
  const isSupported =
164
162
  item.links.some((link) => ["wms", "xyz"].includes(link.rel)) ||
165
163
  Object.keys(dataAssets).length;
166
164
 
167
165
  if (isSupported) {
168
166
  jsonArray.push(
169
- ...createLayersFromLinks(uid(), title, item),
167
+ ...createLayersFromLinks(item.id, title, item),
170
168
 
171
169
  ...(await createLayersFromDataAssets(
172
- uid(),
170
+ `${item.collection}_${item.id}_assets`,
173
171
  title || this.#collectionStac?.title || item.id,
174
172
  dataAssets,
175
173
  style,
@@ -97,7 +97,6 @@ export function extractCollectionUrls(stacObject, basepath) {
97
97
  // Indicator assumes Catalog-Collection-Collection-Item
98
98
  // TODO: this is not the most stable test approach,
99
99
  // we should discuss potential other approaches
100
-
101
100
  if (stacObject?.links && stacObject?.links[1].rel === "item") {
102
101
  collectionUrls.push(basepath);
103
102
  } else if (stacObject?.links[1].rel === "child") {
@@ -111,9 +110,6 @@ export function extractCollectionUrls(stacObject, basepath) {
111
110
  return collectionUrls;
112
111
  }
113
112
 
114
- export const uid = () =>
115
- Date.now().toString(36) + Math.random().toString(36).substring(2);
116
-
117
113
  /**
118
114
  * Assign extracted roles to layer properties
119
115
  * @param {Record<string,any>} properties
@@ -1,5 +1,5 @@
1
- import { _ as y, x as m, W as x, X as d, $ as t, a0 as r, a1 as l, a9 as _, a3 as n, a6 as u, a2 as c, a4 as p, d as h, a5 as g, F as f, a7 as v, ab as w } from "./asWebComponent-C2Gm8JDg.js";
2
- import { V as k } from "./VMain-D7s76eFm.js";
1
+ import { _ as y, x as m, W as x, X as d, $ as t, a0 as r, a1 as l, a9 as _, a3 as n, a6 as u, a2 as c, a4 as p, d as h, a5 as g, F as f, a7 as v, ab as w } from "./asWebComponent-GN3G-Gdj.js";
2
+ import { V as k } from "./VMain-BXL9EwGV.js";
3
3
  class A extends HTMLElement {
4
4
  static get observedAttributes() {
5
5
  return ["gap"];
@@ -1,5 +1,5 @@
1
- import { bE as i, aA as m, r as p, Z as d, aM as f, $ as c, a6 as g, a0 as y, d as _, a4 as k } from "./asWebComponent-C2Gm8JDg.js";
2
- const h = { class: "d-flex flex-column fill-height overflow-auto" }, E = {
1
+ import { bF as i, aA as m, r as p, Z as d, aM as f, $ as c, a6 as g, a0 as y, d as _, a4 as k } from "./asWebComponent-GN3G-Gdj.js";
2
+ const h = { class: "d-flex flex-column fill-height overflow-auto" }, N = {
3
3
  __name: "DynamicWebComponent",
4
4
  props: {
5
5
  link: {
@@ -53,5 +53,5 @@ const h = { class: "d-flex flex-column fill-height overflow-auto" }, E = {
53
53
  }
54
54
  };
55
55
  export {
56
- E as default
56
+ N as default
57
57
  };
@@ -1,7 +1,7 @@
1
- import { p as B, o as $, g as _, y as j, av as I, c as v, r as V, d as h, a as M, b as p, aw as R, ax as O, T as U, ay as F, x as H, Z as N, az as Y, aA as z, w as G, $ as w, a6 as W, a1 as y, a3 as C, aB as K, F as L, W as Z, a9 as k, aC as q, aD as J, t as S, a0 as T, M as D, aE as Q, V as P, aF as X, aG as x, aH as tt } from "./asWebComponent-C2Gm8JDg.js";
2
- import { t as et, e as at } from "./helpers-VeeVIAhm.js";
3
- import { m as ot, V as E } from "./VOverlay-DdGIY0gS.js";
4
- import { b as nt, f as st } from "./forwardRefs-BFBakSKN.js";
1
+ import { p as B, o as $, g as _, y as j, av as I, c as v, r as V, d as h, a as M, b as p, aw as R, ax as O, T as U, ay as F, x as H, Z as N, az as Y, aA as z, w as G, $ as w, a6 as W, a1 as y, a3 as C, aB as K, F as L, W as Z, a9 as k, aC as q, aD as J, t as S, a0 as T, M as D, aE as Q, V as P, aF as X, aG as x, aH as tt } from "./asWebComponent-GN3G-Gdj.js";
2
+ import { t as et, e as at } from "./helpers-XtsCspQr.js";
3
+ import { m as ot, V as E } from "./VOverlay-C9MeDzGb.js";
4
+ import { b as nt, f as st } from "./forwardRefs-DF-jCteQ.js";
5
5
  const rt = B({
6
6
  id: String,
7
7
  text: String,