@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.
- package/README.md +1 -1
- package/core/client/App.vue +13 -1
- package/core/client/asWebComponent.js +13 -4
- package/core/client/components/DashboardLayout.vue +36 -14
- package/core/client/components/Loading.vue +6 -9
- package/core/client/components/MobileLayout.vue +16 -14
- package/core/client/composables/DefineEodash.js +14 -4
- package/core/client/composables/DefineTemplate.js +67 -0
- package/core/client/composables/DefineWidgets.js +3 -2
- package/core/client/composables/EodashMap.js +360 -0
- package/core/client/composables/EodashProcess.js +574 -0
- package/core/client/composables/index.js +136 -28
- package/core/client/eodash.js +395 -80
- package/core/client/eodashSTAC/EodashCollection.js +432 -0
- package/core/client/eodashSTAC/createLayers.js +315 -0
- package/core/client/eodashSTAC/helpers.js +375 -0
- package/core/client/eodashSTAC/triggers.js +43 -0
- package/core/client/plugins/axios.js +8 -0
- package/core/client/plugins/index.js +2 -1
- package/core/client/plugins/vuetify.js +2 -1
- package/core/client/store/actions.js +79 -0
- package/core/client/store/index.js +4 -18
- package/core/client/store/stac.js +99 -9
- package/core/client/store/states.js +37 -0
- package/core/client/{types.d.ts → types.ts} +66 -20
- package/core/client/utils/keys.js +2 -0
- package/core/client/utils/states.js +22 -0
- package/core/client/views/Dashboard.vue +22 -49
- package/core/client/vite-env.d.ts +2 -10
- package/dist/client/DashboardLayout-232tRmjz.js +84 -0
- package/dist/client/DynamicWebComponent-Cl4LqHU6.js +88 -0
- package/dist/client/EodashDatePicker-Pok6bZwU.js +306 -0
- package/dist/client/EodashItemFilter-16eMMjTV.js +151 -0
- package/dist/client/EodashLayerControl-De7IlCm_.js +120 -0
- package/dist/client/EodashLayoutSwitcher-C-3-jjn5.js +52 -0
- package/dist/client/EodashMap-CMvbfI6-.js +549 -0
- package/dist/client/EodashMapBtns-BeknGDtc.js +107 -0
- package/dist/client/EodashProcess-BwKAa9Ee.js +1476 -0
- package/dist/client/EodashStacInfo-_BfonNUG.js +85 -0
- package/dist/client/EodashTools-PD3XPYuR.js +103 -0
- package/dist/client/ExportState-DOrT7M15.js +644 -0
- package/dist/client/Footer-CCigxYBo.js +141 -0
- package/dist/client/Header-C2cdx4gb.js +437 -0
- package/dist/client/IframeWrapper-BgM9aU8f.js +28 -0
- package/dist/client/MobileLayout-BdiFjHg7.js +1207 -0
- package/dist/client/PopUp--_xn1Cms.js +410 -0
- package/dist/client/VImg-9xu2l99m.js +384 -0
- package/dist/client/VMain-BUs3kDTd.js +43 -0
- package/dist/client/VOverlay-D89omJis.js +1453 -0
- package/dist/client/VTooltip-CDu3bErh.js +86 -0
- package/dist/client/WidgetsContainer-aFG9yFT6.js +83 -0
- package/dist/client/asWebComponent-BRGyP_j5.js +11943 -0
- package/dist/client/{style.css → eo-dash.css} +2 -2
- package/dist/client/eo-dash.js +2 -6
- package/dist/client/forwardRefs-CYrR6bMw.js +245 -0
- package/dist/client/index-BZwk0V42.js +199 -0
- package/dist/client/ssrBoot-BP7SYRyC.js +22 -0
- package/dist/client/transition-DG9nRSW4.js +37 -0
- package/dist/node/cli.js +4 -4
- package/dist/node/types.d.ts +2 -0
- package/package.json +73 -38
- package/widgets/EodashDatePicker.vue +176 -134
- package/widgets/EodashItemFilter.vue +79 -38
- package/widgets/EodashLayerControl.vue +111 -0
- package/widgets/EodashLayoutSwitcher.vue +36 -0
- package/widgets/EodashMap.vue +108 -133
- package/widgets/EodashMapBtns.vue +62 -8
- package/widgets/EodashProcess.vue +143 -0
- package/widgets/EodashStacInfo.vue +82 -0
- package/widgets/EodashTools.vue +83 -0
- package/widgets/ExportState.vue +17 -13
- package/widgets/PopUp.vue +24 -2
- package/core/client/SuspensedDashboard.ce.vue +0 -105
- package/core/client/asWebComponent.d.ts +0 -23
- package/core/client/store/Actions.js +0 -14
- package/core/client/store/States.js +0 -16
- package/core/client/utils/eodashSTAC.js +0 -249
- package/core/client/utils/helpers.js +0 -38
- package/dist/client/DashboardLayout-D0ZF6V2S.js +0 -156
- package/dist/client/DynamicWebComponent-CPsMSBHi.js +0 -57
- package/dist/client/EodashDatePicker-CBQP7u2X.js +0 -252
- package/dist/client/EodashItemFilter-DL2ScI-5.js +0 -7671
- package/dist/client/EodashMap-CkKoQlmR.js +0 -86917
- package/dist/client/EodashMapBtns-yuO2QmiR.js +0 -36
- package/dist/client/ExportState-CCzOhppU.js +0 -558
- package/dist/client/Footer-BPAND0yG.js +0 -115
- package/dist/client/Header-DLhebNvG.js +0 -350
- package/dist/client/IframeWrapper-1GEMHlsW.js +0 -19
- package/dist/client/MobileLayout-mGkOYRhu.js +0 -945
- package/dist/client/PopUp-1d2bBFjw.js +0 -300
- package/dist/client/VImg-DxHcztfM.js +0 -291
- package/dist/client/VMain-BLX5vRRn.js +0 -39
- package/dist/client/VOverlay-CvrYEmLu.js +0 -967
- package/dist/client/WidgetsContainer-CmYjvGm7.js +0 -129
- package/dist/client/_commonjsHelpers-DaMA6jEr.js +0 -8
- package/dist/client/asWebComponent-B91uK0U7.js +0 -20361
- package/dist/client/basedecoder-DHcBySSe-BmCFNFnw.js +0 -88
- package/dist/client/decoder-CP4lv0Kb-B6yqkcfC.js +0 -10
- package/dist/client/deflate-BXt-9JA_-CWfClgpK.js +0 -10
- package/dist/client/eodashSTAC-DBjqe_Ho.js +0 -2788
- package/dist/client/eox-stacinfo-l7ALSV90.js +0 -13969
- package/dist/client/forwardRefs-BJJiadQP.js +0 -185
- package/dist/client/index-Q-bHLjxx.js +0 -153
- package/dist/client/jpeg-BAgeD1d3-oeHbFPUL.js +0 -514
- package/dist/client/lerc-DzVumYtB-P-KXC0TO.js +0 -1027
- package/dist/client/lzw-LAGDNbSC-DkP96qO9.js +0 -84
- package/dist/client/packbits-BlDR4Kj5-C66n1-zr.js +0 -24
- package/dist/client/pako.esm-CB1uQYY0-DB0PYm1P.js +0 -1081
- package/dist/client/raw-CMGvRjfu-BRi6E4i1.js +0 -9
- package/dist/client/ssrBoot-yo11mybw.js +0 -17
- package/dist/client/transition-CSJhuYGK.js +0 -34
- package/dist/client/webfontloader-qotgY98I.js +0 -435
- package/dist/client/webimage-BM_pbLN3-L2cGWK5l.js +0 -19
|
@@ -1,11 +1,22 @@
|
|
|
1
1
|
// functions of this folder can only be consumed inside setup stores,
|
|
2
|
-
// setup functions or vue composition api components
|
|
2
|
+
// setup functions or vue composition api components https://vuejs.org/guide/reusability/composables
|
|
3
3
|
|
|
4
|
-
import {
|
|
4
|
+
import {
|
|
5
|
+
activeTemplate,
|
|
6
|
+
currentCompareUrl,
|
|
7
|
+
currentUrl,
|
|
8
|
+
datetime,
|
|
9
|
+
indicator,
|
|
10
|
+
mapPosition,
|
|
11
|
+
} from "@/store/states";
|
|
5
12
|
import eodash from "@/eodash";
|
|
6
13
|
import { useTheme } from "vuetify/lib/framework.mjs";
|
|
7
|
-
import { onMounted, watch } from "vue";
|
|
14
|
+
import { inject, onMounted, onUnmounted, watch } from "vue";
|
|
8
15
|
import { useSTAcStore } from "@/store/stac";
|
|
16
|
+
import log from "loglevel";
|
|
17
|
+
import { eodashKey, eoxLayersKey } from "@/utils/keys";
|
|
18
|
+
import { useEventBus } from "@vueuse/core";
|
|
19
|
+
import { posIsSetFromUrl } from "@/utils/states";
|
|
9
20
|
|
|
10
21
|
/**
|
|
11
22
|
* Creates an absolute URL from a relative link and assignes it to `currentUrl`
|
|
@@ -14,11 +25,11 @@ import { useSTAcStore } from "@/store/stac";
|
|
|
14
25
|
* @param {string} [base=eodash.stacEndpoint] - Base URL, default value is the
|
|
15
26
|
* root stac catalog. Default is `eodash.stacEndpoint`
|
|
16
27
|
* @returns {import("vue").Ref<string>} - Returns `currentUrl`
|
|
17
|
-
* @see {@link '@/store/
|
|
28
|
+
* @see {@link '@/store/states.js'}
|
|
18
29
|
*/
|
|
19
30
|
export const useAbsoluteUrl = (rel = "", base = eodash.stacEndpoint) => {
|
|
20
31
|
if (!rel || rel.includes("http")) {
|
|
21
|
-
currentUrl.value =
|
|
32
|
+
currentUrl.value = rel;
|
|
22
33
|
return currentUrl;
|
|
23
34
|
}
|
|
24
35
|
|
|
@@ -36,6 +47,35 @@ export const useAbsoluteUrl = (rel = "", base = eodash.stacEndpoint) => {
|
|
|
36
47
|
return currentUrl;
|
|
37
48
|
};
|
|
38
49
|
|
|
50
|
+
/**
|
|
51
|
+
* Use the absolute compare URL from a relative link
|
|
52
|
+
*
|
|
53
|
+
* @param {string} [rel=''] Default is `''`
|
|
54
|
+
* @param {string} [base=eodash.stacEndpoint] - Base URL, default value is the
|
|
55
|
+
* root stac catalog. Default is `eodash.stacEndpoint`
|
|
56
|
+
* @returns {import("vue").Ref<string>} - Returns `currentUrl`
|
|
57
|
+
* @see {@link '@/store/states.js'}
|
|
58
|
+
*/
|
|
59
|
+
export const useCompareAbsoluteUrl = (rel = "", base = eodash.stacEndpoint) => {
|
|
60
|
+
if (!rel || rel.includes("http")) {
|
|
61
|
+
currentCompareUrl.value = base;
|
|
62
|
+
return currentCompareUrl;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
const st = base.split("/");
|
|
66
|
+
const arr = rel.split("/");
|
|
67
|
+
st.pop();
|
|
68
|
+
|
|
69
|
+
for (let i = 0; i < arr.length; i++) {
|
|
70
|
+
if (arr[i] == ".") continue;
|
|
71
|
+
if (arr[i] == "..") st.pop();
|
|
72
|
+
else st.push(arr[i]);
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
currentCompareUrl.value = st.join("/");
|
|
76
|
+
return currentCompareUrl;
|
|
77
|
+
};
|
|
78
|
+
|
|
39
79
|
/**
|
|
40
80
|
* Updates an existing Vuetify theme. updates only the values provided in the
|
|
41
81
|
* `ThemeDefinition`
|
|
@@ -67,53 +107,97 @@ export const useUpdateTheme = (themeName, themeDefinition = {}) => {
|
|
|
67
107
|
};
|
|
68
108
|
|
|
69
109
|
/** Composable that syncs store and URLSearchParameters */
|
|
70
|
-
|
|
71
110
|
export const useURLSearchParametersSync = () => {
|
|
72
111
|
onMounted(async () => {
|
|
73
112
|
// Analyze currently set url params when first loaded and set them in the store
|
|
74
|
-
if (
|
|
113
|
+
if (window.location.search) {
|
|
75
114
|
const searchParams = new URLSearchParams(window.location.search);
|
|
115
|
+
|
|
76
116
|
/** @type {number | undefined} */
|
|
77
117
|
let x,
|
|
78
118
|
/** @type {number | undefined} */
|
|
79
119
|
y,
|
|
80
120
|
/** @type {number | undefined} */
|
|
81
121
|
z;
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
await loadSelectedSTAC(match.href);
|
|
122
|
+
for (const [key, value] of searchParams) {
|
|
123
|
+
switch (key) {
|
|
124
|
+
case "template": {
|
|
125
|
+
activeTemplate.value = value;
|
|
126
|
+
break;
|
|
88
127
|
}
|
|
128
|
+
case "indicator": {
|
|
129
|
+
log.debug("Found indicator key in url");
|
|
130
|
+
const { loadSelectedSTAC, stac } = useSTAcStore();
|
|
131
|
+
const match = stac?.find((link) => link.id == value);
|
|
132
|
+
if (match) {
|
|
133
|
+
log.debug("Found match, loading stac item", match);
|
|
134
|
+
await loadSelectedSTAC(match.href);
|
|
135
|
+
}
|
|
136
|
+
break;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
case "x":
|
|
140
|
+
x = Number(value);
|
|
141
|
+
break;
|
|
142
|
+
|
|
143
|
+
case "y":
|
|
144
|
+
y = Number(value);
|
|
145
|
+
break;
|
|
146
|
+
|
|
147
|
+
case "z":
|
|
148
|
+
z = Number(value);
|
|
149
|
+
break;
|
|
150
|
+
|
|
151
|
+
case "datetime":
|
|
152
|
+
try {
|
|
153
|
+
const datetimeiso = new Date(value).toISOString();
|
|
154
|
+
log.debug("Valid datetime found", datetimeiso);
|
|
155
|
+
datetime.value = datetimeiso;
|
|
156
|
+
} catch {
|
|
157
|
+
datetime.value = new Date().toISOString();
|
|
158
|
+
}
|
|
159
|
+
break;
|
|
160
|
+
|
|
161
|
+
default:
|
|
162
|
+
break;
|
|
89
163
|
}
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
}
|
|
93
|
-
if (key === "y") {
|
|
94
|
-
y = Number(value);
|
|
95
|
-
}
|
|
96
|
-
if (key === "z") {
|
|
97
|
-
z = Number(value);
|
|
98
|
-
}
|
|
99
|
-
});
|
|
164
|
+
}
|
|
165
|
+
|
|
100
166
|
if (x && y && z) {
|
|
167
|
+
log.debug("Coordinates found, applying map poisition", x, y, z);
|
|
101
168
|
mapPosition.value = [x, y, z];
|
|
169
|
+
if (!posIsSetFromUrl.value) {
|
|
170
|
+
posIsSetFromUrl.value = true;
|
|
171
|
+
}
|
|
102
172
|
}
|
|
103
173
|
}
|
|
174
|
+
|
|
104
175
|
watch(
|
|
105
|
-
[indicator, mapPosition],
|
|
106
|
-
([
|
|
176
|
+
[indicator, mapPosition, datetime, activeTemplate],
|
|
177
|
+
([
|
|
178
|
+
updatedIndicator,
|
|
179
|
+
updatedMapPosition,
|
|
180
|
+
updatedDatetime,
|
|
181
|
+
updatedTemplate,
|
|
182
|
+
]) => {
|
|
107
183
|
if ("URLSearchParams" in window) {
|
|
108
184
|
const searchParams = new URLSearchParams(window.location.search);
|
|
109
185
|
if (updatedIndicator !== "") {
|
|
110
186
|
searchParams.set("indicator", updatedIndicator);
|
|
111
187
|
}
|
|
188
|
+
|
|
112
189
|
if (updatedMapPosition && updatedMapPosition.length === 3) {
|
|
113
190
|
searchParams.set("x", updatedMapPosition[0]?.toFixed(4) ?? "");
|
|
114
191
|
searchParams.set("y", updatedMapPosition[1]?.toFixed(4) ?? "");
|
|
115
192
|
searchParams.set("z", updatedMapPosition[2]?.toFixed(4) ?? "");
|
|
116
193
|
}
|
|
194
|
+
|
|
195
|
+
if (updatedDatetime) {
|
|
196
|
+
searchParams.set("datetime", updatedDatetime.split("T")?.[0] ?? "");
|
|
197
|
+
}
|
|
198
|
+
if (updatedTemplate) {
|
|
199
|
+
searchParams.set("template", updatedTemplate);
|
|
200
|
+
}
|
|
117
201
|
const newRelativePathQuery =
|
|
118
202
|
window.location.pathname + "?" + searchParams.toString();
|
|
119
203
|
history.pushState(null, "", newRelativePathQuery);
|
|
@@ -123,14 +207,38 @@ export const useURLSearchParametersSync = () => {
|
|
|
123
207
|
});
|
|
124
208
|
};
|
|
125
209
|
|
|
126
|
-
/**
|
|
210
|
+
/**
|
|
211
|
+
* Converts eox-layout-item to transparent
|
|
212
|
+
*
|
|
213
|
+
* @param {import("vue").Ref<HTMLElement|null>} root - components root element ref*/
|
|
127
214
|
export const makePanelTransparent = (root) => {
|
|
128
215
|
onMounted(() => {
|
|
129
216
|
const eoxItem = root.value?.parentElement;
|
|
130
217
|
if (eoxItem?.tagName === "EOX-LAYOUT-ITEM") {
|
|
131
218
|
eoxItem.classList.remove("bg-surface");
|
|
132
|
-
eoxItem.style.background = "transparent";
|
|
133
|
-
eoxItem.style.border = "transparent";
|
|
134
219
|
}
|
|
135
220
|
});
|
|
136
221
|
};
|
|
222
|
+
|
|
223
|
+
export const useGetTemplates = () => {
|
|
224
|
+
const eodash = /** @type {import("@/types").Eodash} */ (inject(eodashKey));
|
|
225
|
+
return "template" in eodash ? [] : Object.keys(eodash.templates);
|
|
226
|
+
};
|
|
227
|
+
|
|
228
|
+
/**
|
|
229
|
+
* Listens to the `layers:updated` and `time:updated` events and calls
|
|
230
|
+
*
|
|
231
|
+
* @param {import("@vueuse/core").EventBusListener<
|
|
232
|
+
* "layers:updated"|"time:updated",
|
|
233
|
+
* {layers:Record<string,any>[]| undefined}
|
|
234
|
+
* >} listener
|
|
235
|
+
*/
|
|
236
|
+
export const useOnLayersUpdate = (listener) => {
|
|
237
|
+
const layersEvents = useEventBus(eoxLayersKey);
|
|
238
|
+
|
|
239
|
+
const unsubscribe = layersEvents.on(listener);
|
|
240
|
+
|
|
241
|
+
onUnmounted(() => {
|
|
242
|
+
unsubscribe();
|
|
243
|
+
});
|
|
244
|
+
};
|