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

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 (44) hide show
  1. package/core/client/components/DashboardLayout.vue +1 -2
  2. package/core/client/components/MobileLayout.vue +1 -2
  3. package/core/client/composables/DefineWidgets.js +1 -1
  4. package/core/client/composables/index.js +12 -0
  5. package/core/client/eodash.js +15 -2
  6. package/core/client/store/Actions.js +14 -0
  7. package/core/client/types.d.ts +6 -1
  8. package/core/client/utils/index.js +12 -0
  9. package/dist/client/{DashboardLayout-BuDcv6LM.js → DashboardLayout-CKOExc7r.js} +4 -4
  10. package/dist/client/{DynamicWebComponent-BEP4rVce.js → DynamicWebComponent-m1Zbbw6n.js} +4 -4
  11. package/dist/client/EodashDatePicker-CGdJRGZJ.js +252 -0
  12. package/dist/client/{EodashItemFilter-BElmgrST.js → EodashItemFilter-BjM_LHaE.js} +2 -2
  13. package/dist/client/EodashMap-61UMC8sv.js +86917 -0
  14. package/dist/client/EodashMapBtns-DVITfAFx.js +36 -0
  15. package/dist/client/ExportState-DhpK09GR.js +558 -0
  16. package/dist/client/{Footer-CoPx6UXQ.js → Footer-CIwjaddz.js} +11 -11
  17. package/dist/client/Header-BcM-pZFi.js +350 -0
  18. package/dist/client/{IframeWrapper-2w2ye0zM.js → IframeWrapper-CAe6HPqe.js} +1 -1
  19. package/dist/client/{MobileLayout-C9OVcP12.js → MobileLayout-DcZOQX8r.js} +11 -11
  20. package/dist/client/PopUp-DCaITceG.js +300 -0
  21. package/dist/client/VImg-C-I_7puM.js +291 -0
  22. package/dist/client/{VMain-Dm43jd43.js → VMain-Cd3P0YTG.js} +2 -2
  23. package/dist/client/VOverlay-AcvFgk39.js +967 -0
  24. package/dist/client/{WidgetsContainer-BS87sLqk.js → WidgetsContainer-B0-q0EMO.js} +1 -1
  25. package/dist/client/{asWebComponent-CpQUVi2N.js → asWebComponent-zuKR9I1w.js} +5939 -5713
  26. package/dist/client/{decoder-CP4lv0Kb-BHrv68IA.js → decoder-CP4lv0Kb-DdKalImK.js} +1 -1
  27. package/dist/client/eo-dash.js +4 -4
  28. package/dist/client/{eodashSTAC-Q7kbX1Gy.js → eodashSTAC-DGB50vNk.js} +1 -1
  29. package/dist/client/{forwardRefs-BVFQ82G4.js → forwardRefs-BnxE4iKQ.js} +35 -33
  30. package/dist/client/{index-dOzyv_xR.js → index-hSIi5Ygk.js} +8 -8
  31. package/dist/client/{lerc-DzVumYtB-rm1Xco54.js → lerc-DzVumYtB-cTUap6k_.js} +1 -1
  32. package/dist/client/{ssrBoot-L9KejErM.js → ssrBoot-D3KF5Thc.js} +1 -1
  33. package/dist/client/style.css +2 -2
  34. package/dist/client/{transition-DCePIwYR.js → transition-D3a4tiJv.js} +6 -6
  35. package/dist/node/cli.js +2 -2
  36. package/package.json +2 -2
  37. package/widgets/EodashMap.vue +33 -29
  38. package/widgets/EodashMapBtns.vue +33 -0
  39. package/widgets/ExportState.vue +112 -0
  40. package/widgets/PopUp.vue +40 -0
  41. package/dist/client/EodashDatePicker-oFb1zt5E.js +0 -1211
  42. package/dist/client/EodashMap-DXyOgcEd.js +0 -50707
  43. package/dist/client/Header-C-zX31Ys.js +0 -635
  44. package/dist/client/eox-map-L7abwKTR.js +0 -36260
@@ -22,7 +22,7 @@
22
22
  <eox-layout-item
23
23
  v-if="importedWidget.value.component"
24
24
  :key="importedWidget.value.id"
25
- class="panel"
25
+ class="panel bg-surface"
26
26
  :h="importedWidget.value.layout.h"
27
27
  :w="importedWidget.value.layout.w"
28
28
  :x="importedWidget.value.layout.x"
@@ -59,7 +59,6 @@ const importedWidgets = useDefineWidgets(eodash.template?.widgets);
59
59
  overflow: visible;
60
60
  z-index: 1;
61
61
  border-radius: 0px;
62
- background: rgb(var(--v-theme-surface));
63
62
  }
64
63
 
65
64
  .bg-panel {
@@ -14,7 +14,7 @@
14
14
  v-if="importedWidget.value.component"
15
15
  v-show="activeIdx === idx"
16
16
  id="overlay"
17
- class="pa-2 panel"
17
+ class="pa-2 panel bg-surface"
18
18
  >
19
19
  <v-btn icon variant="text" class="close-btn" @click="activeIdx = -1"
20
20
  >&#x2715;</v-btn
@@ -90,7 +90,6 @@ onMounted(() => {
90
90
  width: 100%;
91
91
  left: 0;
92
92
  z-index: 1;
93
- background: rgb(var(--v-theme-surface));
94
93
  }
95
94
 
96
95
  .component-container {
@@ -40,9 +40,9 @@ const internalWidgets = (() => {
40
40
  * @param {(
41
41
  * | import("@/types").Widget
42
42
  * | import("@/types").BackgroundWidget
43
+ * | Omit<import("@/types").Widget, "layout">
43
44
  * | undefined
44
45
  * )[]
45
- * | import("@/types").WidgetsContainerProps["widgets"]
46
46
  * | undefined} widgetConfigs
47
47
  * @returns {ReactiveDefinedWidget[]}
48
48
  */
@@ -122,3 +122,15 @@ export const useURLSearchParametersSync = () => {
122
122
  );
123
123
  });
124
124
  };
125
+
126
+ /** @param {import("vue").Ref<HTMLElement|null>} root - components root element ref*/
127
+ export const makePanelTransparent = (root) => {
128
+ onMounted(() => {
129
+ const eoxItem = root.value?.parentElement;
130
+ if (eoxItem?.tagName === "EOX-LAYOUT-ITEM") {
131
+ eoxItem.classList.remove("bg-surface");
132
+ eoxItem.style.background = "transparent";
133
+ eoxItem.style.border = "transparent";
134
+ }
135
+ });
136
+ };
@@ -1,6 +1,5 @@
1
1
  import { reactive } from "vue";
2
2
  import { currentUrl } from "./store/States";
3
-
4
3
  /**
5
4
  * Reactive Edoash Instance Object. provided globally in the app, and used as an
6
5
  * intermediate object to make user defined instances config reactive.
@@ -71,7 +70,6 @@ export const eodash = reactive({
71
70
  styleOverride:
72
71
  "#properties li > .value {font-weight: normal !important;}",
73
72
  header: "[]",
74
-
75
73
  subheader: "[]",
76
74
  properties: '["description"]',
77
75
  featured: "[]",
@@ -98,6 +96,21 @@ export const eodash = reactive({
98
96
  : null;
99
97
  },
100
98
  },
99
+ {
100
+ defineWidget: (selected) => {
101
+ return selected
102
+ ? {
103
+ id: Symbol(),
104
+ layout: { x: 8, y: 0, w: 1, h: 1 },
105
+ title: "Buttons",
106
+ type: "internal",
107
+ widget: {
108
+ name: "EodashMapBtns",
109
+ },
110
+ }
111
+ : null;
112
+ },
113
+ },
101
114
  ],
102
115
  },
103
116
  });
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Returns the current layers of the `eox-map`
3
+ * @param {string} [el="eox-map"] - `eox-map` element selector
4
+ * @returns {object[]}
5
+ */
6
+ export const getLayers = (el = "eox-map") =>
7
+ customElements.get("eo-dash")
8
+ ? document
9
+ .querySelector("eo-dash")
10
+ ?.shadowRoot?.querySelector(el)
11
+ //@ts-expect-error `layers` doesn't exist on type element
12
+ ?.layers.toReversed()
13
+ : //@ts-expect-error `layers` doesn't exist on type element
14
+ document.querySelector(el)?.layers.toReversed();
@@ -245,7 +245,12 @@ export interface EodashStore {
245
245
  /** Currently selected indicator */
246
246
  indicator: import("vue").Ref<string>;
247
247
  };
248
- actions: object;
248
+ actions: {
249
+ /** returns the layers of the `eox-map`
250
+ * @param `eox-map` element selector
251
+ */
252
+ getLayers: (el: string) => object[];
253
+ };
249
254
  /** Pinia store definition used to navigate the root STAC catalog. */
250
255
  stac: {
251
256
  useSTAcStore: typeof import("./store/stac.js").useSTAcStore;
@@ -37,3 +37,15 @@ export const loadFont = async (
37
37
  }
38
38
  return family;
39
39
  };
40
+
41
+ /**
42
+ * @param {string} text
43
+ * @param {import("vue").Ref<boolean>} showIcon
44
+ **/
45
+ export const copyToClipBoard = async (text, showIcon) => {
46
+ await navigator.clipboard.writeText(text);
47
+ showIcon.value = true;
48
+ setTimeout(() => {
49
+ showIcon.value = false;
50
+ }, 2000);
51
+ };
@@ -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-CpQUVi2N.js";
2
- import { V as k } from "./VMain-Dm43jd43.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-zuKR9I1w.js";
2
+ import { V as k } from "./VMain-Cd3P0YTG.js";
3
3
  class A extends HTMLElement {
4
4
  static get observedAttributes() {
5
5
  return ["gap"];
@@ -105,7 +105,7 @@ const L = ["gap"], $ = {
105
105
  default: l(() => [
106
106
  e.value.component ? (t(), u("eox-layout-item", {
107
107
  key: e.value.id,
108
- class: "panel",
108
+ class: "panel bg-surface",
109
109
  h: e.value.layout.h,
110
110
  w: e.value.layout.w,
111
111
  x: e.value.layout.x,
@@ -150,7 +150,7 @@ const L = ["gap"], $ = {
150
150
  /* STABLE */
151
151
  }));
152
152
  }
153
- }, V = /* @__PURE__ */ y(M, [["__scopeId", "data-v-34c69bd3"]]);
153
+ }, V = /* @__PURE__ */ y(M, [["__scopeId", "data-v-a859692c"]]);
154
154
  export {
155
155
  V as default
156
156
  };
@@ -1,5 +1,5 @@
1
- import { b7 as i, aZ as m, r as p, Z as d, b8 as f, $ as c, a6 as g, a0 as y, d as _, a4 as k } from "./asWebComponent-CpQUVi2N.js";
2
- const h = { class: "d-flex flex-column fill-height overflow-auto" }, C = {
1
+ import { by as i, aA as m, r as p, Z as d, aJ as f, $ as c, a6 as g, a0 as y, d as _, a4 as k } from "./asWebComponent-zuKR9I1w.js";
2
+ const h = { class: "d-flex flex-column fill-height overflow-auto" }, N = {
3
3
  __name: "DynamicWebComponent",
4
4
  props: {
5
5
  link: {
@@ -38,7 +38,7 @@ const h = { class: "d-flex flex-column fill-height overflow-auto" }, C = {
38
38
  e.onMounted?.(r.value, s);
39
39
  }), f(() => {
40
40
  e.onUnmounted?.(r.value, s);
41
- }), (n, w) => (c(), g("span", h, [
41
+ }), (n, x) => (c(), g("span", h, [
42
42
  (c(), y(
43
43
  k(o.tagName),
44
44
  _(o.properties, {
@@ -53,5 +53,5 @@ const h = { class: "d-flex flex-column fill-height overflow-auto" }, C = {
53
53
  }
54
54
  };
55
55
  export {
56
- C as default
56
+ N as default
57
57
  };
@@ -0,0 +1,252 @@
1
+ import { p as B, o as $, g as j, y as _, av as I, c as v, r as V, d as w, a as M, b as p, aw as R, ax as O, T as U, ay as F, x as N, Z as Y, az as H, aA as z, w as G, $ as h, 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 } from "./asWebComponent-zuKR9I1w.js";
2
+ import { t as tt, e as et } from "./eodashSTAC-DGB50vNk.js";
3
+ import { m as at, V as E } from "./VOverlay-AcvFgk39.js";
4
+ import { b as ot, f as nt } from "./forwardRefs-BnxE4iKQ.js";
5
+ const st = B({
6
+ id: String,
7
+ text: String,
8
+ ...$(at({
9
+ closeOnBack: !1,
10
+ location: "end",
11
+ locationStrategy: "connected",
12
+ eager: !0,
13
+ minWidth: 0,
14
+ offset: 10,
15
+ openOnClick: !1,
16
+ openOnHover: !0,
17
+ origin: "auto",
18
+ scrim: !1,
19
+ scrollStrategy: "reposition",
20
+ transition: !1
21
+ }), ["absolute", "persistent"])
22
+ }, "VTooltip"), rt = j()({
23
+ name: "VTooltip",
24
+ props: st(),
25
+ emits: {
26
+ "update:modelValue": (t) => !0
27
+ },
28
+ setup(t, r) {
29
+ let {
30
+ slots: i
31
+ } = r;
32
+ const o = _(t, "modelValue"), {
33
+ scopeId: n
34
+ } = ot(), l = I(), e = v(() => t.id || `v-tooltip-${l}`), a = V(), s = v(() => t.location.split(" ").length > 1 ? t.location : t.location + " center"), c = v(() => t.origin === "auto" || t.origin === "overlap" || t.origin.split(" ").length > 1 || t.location.split(" ").length > 1 ? t.origin : t.origin + " center"), u = v(() => t.transition ? t.transition : o.value ? "scale-transition" : "fade-transition"), f = v(() => w({
35
+ "aria-describedby": e.value
36
+ }, t.activatorProps));
37
+ return M(() => {
38
+ const b = E.filterProps(t);
39
+ return p(E, w({
40
+ ref: a,
41
+ class: ["v-tooltip", t.class],
42
+ style: t.style,
43
+ id: e.value
44
+ }, b, {
45
+ modelValue: o.value,
46
+ "onUpdate:modelValue": (m) => o.value = m,
47
+ transition: u.value,
48
+ absolute: !0,
49
+ location: s.value,
50
+ origin: c.value,
51
+ persistent: !0,
52
+ role: "tooltip",
53
+ activatorProps: f.value,
54
+ _disableGlobalStack: !0
55
+ }, n), {
56
+ activator: i.activator,
57
+ default: function() {
58
+ for (var m = arguments.length, d = new Array(m), g = 0; g < m; g++)
59
+ d[g] = arguments[g];
60
+ return i.default?.(...d) ?? t.text;
61
+ }
62
+ });
63
+ }), nt({}, a);
64
+ }
65
+ });
66
+ function it(t, r) {
67
+ const i = typeof t == "string" ? R(t) : t, o = lt(i, r);
68
+ return {
69
+ mounted: o,
70
+ updated: o,
71
+ unmounted(n) {
72
+ O(null, n);
73
+ }
74
+ };
75
+ }
76
+ function lt(t, r) {
77
+ return function(i, o, n) {
78
+ const l = typeof r == "function" ? r(o) : r, e = o.value?.text ?? o.value ?? l?.text, a = U(o.value) ? o.value : {}, s = () => e ?? i.innerHTML, c = (n.ctx === o.instance.$ ? ct(n, o.instance.$)?.provides : n.ctx?.provides) ?? o.instance.$.provides, u = F(t, w(l, a), s);
79
+ u.appContext = Object.assign(/* @__PURE__ */ Object.create(null), o.instance.$.appContext, {
80
+ provides: c
81
+ }), O(u, i);
82
+ };
83
+ }
84
+ function ct(t, r) {
85
+ const i = /* @__PURE__ */ new Set(), o = (l) => {
86
+ for (const e of l) {
87
+ if (!e) continue;
88
+ if (e === t)
89
+ return !0;
90
+ i.add(e);
91
+ let a;
92
+ if (e.suspense ? a = o([e.ssContent]) : Array.isArray(e.children) ? a = o(e.children) : e.component?.vnode && (a = o([e.component?.subTree])), a)
93
+ return a;
94
+ i.delete(e);
95
+ }
96
+ return !1;
97
+ };
98
+ if (!o([r.subTree]))
99
+ throw new Error("Could not find original vnode");
100
+ const n = Array.from(i).reverse();
101
+ for (const l of n)
102
+ if (l.component)
103
+ return l.component;
104
+ return r;
105
+ }
106
+ const A = it(rt, (t) => ({
107
+ activator: "parent",
108
+ location: t.arg?.replace("-", " ") ?? "top",
109
+ text: typeof t.value == "boolean" ? void 0 : t.value
110
+ })), ut = {
111
+ class: "flex rounded-lg border border-gray-300 dark:border-gray-600",
112
+ style: { margin: "2px" }
113
+ }, dt = ["value"], gt = {
114
+ __name: "EodashDatePicker",
115
+ setup(t) {
116
+ function r(e) {
117
+ if (n.value && n.value.length > 0) {
118
+ let a = e ? 1 / 0 : -1 / 0;
119
+ n.value.forEach((s) => {
120
+ s?.dates && s.dates.forEach((c) => {
121
+ c instanceof Date && (!e && c.getTime() > a || e && c.getTime() < a) && (a = c.getTime());
122
+ });
123
+ }), a !== 0 && (l.value = new Date(a));
124
+ }
125
+ }
126
+ const i = (
127
+ /** @type {import("@/types").Eodash} */
128
+ N(Z)
129
+ ), o = V({
130
+ input: "YYYY-MM-DD"
131
+ }), n = V([]), l = v({
132
+ get() {
133
+ return x.value ? new Date(x.value) : /* @__PURE__ */ new Date();
134
+ },
135
+ /** @param {Date | string} updatedDate */
136
+ set(e) {
137
+ e instanceof Date && !isNaN(e.getTime()) ? x.value = new Date(
138
+ e.getTime() - e.getTimezoneOffset() * 6e4
139
+ ).toISOString() : x.value = (/* @__PURE__ */ new Date()).toISOString();
140
+ }
141
+ });
142
+ return Y(() => {
143
+ const { selectedStac: e } = H(z());
144
+ G(
145
+ [e],
146
+ async ([a]) => {
147
+ if (a) {
148
+ const s = tt(
149
+ `./${a.id}/collection.json`,
150
+ i.stacEndpoint
151
+ ), c = et(
152
+ e.value,
153
+ s
154
+ ), u = [
155
+ "#009E73",
156
+ "#0072B2",
157
+ "#E69F00",
158
+ "#CC79A7",
159
+ "#56B4E9",
160
+ "#D55E00"
161
+ ];
162
+ for (let f = 0; f < c.length; f++) {
163
+ const m = (await (await fetch(c[f])).json()).links.filter(
164
+ (d) => d.rel === "item" && "datetime" in d
165
+ ).map(
166
+ (d) => new Date(d.datetime)
167
+ );
168
+ n.value = [
169
+ {
170
+ bar: {
171
+ style: {
172
+ backgroundColor: u[f % u.length]
173
+ }
174
+ },
175
+ dates: m
176
+ }
177
+ ];
178
+ }
179
+ }
180
+ },
181
+ { immediate: !0 }
182
+ );
183
+ }), (e, a) => (h(), W(
184
+ L,
185
+ null,
186
+ [
187
+ p(C(J), {
188
+ modelValue: l.value,
189
+ "onUpdate:modelValue": a[0] || (a[0] = (s) => l.value = s),
190
+ masks: o.value,
191
+ attributes: n.value
192
+ }, {
193
+ default: y(({ inputValue: s, inputEvents: c }) => [
194
+ k("div", ut, [
195
+ k("input", w({ value: s }, q(c, !0), {
196
+ style: { margin: "1px" },
197
+ class: "flex-grow px-1 py-1 bg-white dark:bg-gray-700"
198
+ }), null, 16, dt)
199
+ ])
200
+ ]),
201
+ _: 1
202
+ /* STABLE */
203
+ }, 8, ["modelValue", "masks", "attributes"]),
204
+ p(K, {
205
+ align: "center",
206
+ justify: "center",
207
+ style: { "margin-top": "6px" }
208
+ }, {
209
+ default: y(() => [
210
+ S((h(), T(P, {
211
+ style: { padding: "0px", "margin-right": "4px" },
212
+ density: "compact",
213
+ onClick: a[1] || (a[1] = (s) => r(!0))
214
+ }, {
215
+ default: y(() => [
216
+ p(D, {
217
+ icon: [C(Q)]
218
+ }, null, 8, ["icon"])
219
+ ]),
220
+ _: 1
221
+ /* STABLE */
222
+ })), [
223
+ [A, "Set date to oldest available dataset", "bottom"]
224
+ ]),
225
+ S((h(), T(P, {
226
+ style: { padding: "0px", "margin-left": "4px" },
227
+ density: "compact",
228
+ onClick: a[2] || (a[2] = (s) => r(!1))
229
+ }, {
230
+ default: y(() => [
231
+ p(D, {
232
+ icon: [C(X)]
233
+ }, null, 8, ["icon"])
234
+ ]),
235
+ _: 1
236
+ /* STABLE */
237
+ })), [
238
+ [A, "Set date to latest available dataset", "bottom"]
239
+ ])
240
+ ]),
241
+ _: 1
242
+ /* STABLE */
243
+ })
244
+ ],
245
+ 64
246
+ /* STABLE_FRAGMENT */
247
+ ));
248
+ }
249
+ };
250
+ export {
251
+ gt as default
252
+ };
@@ -1,5 +1,5 @@
1
- import { $ as p, a0 as c } from "./asWebComponent-CpQUVi2N.js";
2
- import m from "./DynamicWebComponent-BEP4rVce.js";
1
+ import { $ as p, a0 as c } from "./asWebComponent-zuKR9I1w.js";
2
+ import m from "./DynamicWebComponent-m1Zbbw6n.js";
3
3
  const f = {
4
4
  __name: "EodashItemFilter",
5
5
  setup(d) {