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

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 (38) hide show
  1. package/core/client/composables/DefineWidgets.js +1 -1
  2. package/core/client/composables/index.js +11 -0
  3. package/core/client/eodash.js +15 -2
  4. package/core/client/store/Actions.js +8 -0
  5. package/core/client/types.d.ts +6 -1
  6. package/core/client/utils/index.js +12 -0
  7. package/dist/client/{DashboardLayout-BuDcv6LM.js → DashboardLayout-Cbci3g7o.js} +2 -2
  8. package/dist/client/{DynamicWebComponent-BEP4rVce.js → DynamicWebComponent-DzmQ3Fr3.js} +2 -2
  9. package/dist/client/EodashDatePicker-SP5bYISd.js +252 -0
  10. package/dist/client/{EodashItemFilter-BElmgrST.js → EodashItemFilter-B9Tf2TBw.js} +2 -2
  11. package/dist/client/{EodashMap-DXyOgcEd.js → EodashMap-D_znzmX7.js} +5 -5
  12. package/dist/client/EodashMapBtns-BOKugQ88.js +37 -0
  13. package/dist/client/ExportState-D7m9s4T8.js +558 -0
  14. package/dist/client/{Footer-CoPx6UXQ.js → Footer-C2uV1-zu.js} +11 -11
  15. package/dist/client/Header-C2ROtxo_.js +350 -0
  16. package/dist/client/{IframeWrapper-2w2ye0zM.js → IframeWrapper-Wwou4pwf.js} +1 -1
  17. package/dist/client/{MobileLayout-C9OVcP12.js → MobileLayout-DR27Ctiz.js} +6 -6
  18. package/dist/client/PopUp-bPGAY43o.js +300 -0
  19. package/dist/client/VImg-swqiqth2.js +291 -0
  20. package/dist/client/{VMain-Dm43jd43.js → VMain-Bu1bPjvK.js} +2 -2
  21. package/dist/client/VOverlay-D_MKJ4vQ.js +967 -0
  22. package/dist/client/{WidgetsContainer-BS87sLqk.js → WidgetsContainer-CpxYT8YI.js} +1 -1
  23. package/dist/client/{asWebComponent-CpQUVi2N.js → asWebComponent-DeaU3QoK.js} +5939 -5713
  24. package/dist/client/{decoder-CP4lv0Kb-BHrv68IA.js → decoder-CP4lv0Kb-nokx54iM.js} +1 -1
  25. package/dist/client/eo-dash.js +4 -4
  26. package/dist/client/{eodashSTAC-Q7kbX1Gy.js → eodashSTAC-CFQuZ_cI.js} +1 -1
  27. package/dist/client/{forwardRefs-BVFQ82G4.js → forwardRefs-D0a135Tc.js} +35 -33
  28. package/dist/client/{index-dOzyv_xR.js → index-CoqcWt6E.js} +4 -4
  29. package/dist/client/{lerc-DzVumYtB-rm1Xco54.js → lerc-DzVumYtB-B3rx9xzz.js} +1 -1
  30. package/dist/client/{ssrBoot-L9KejErM.js → ssrBoot-C-inWOiD.js} +1 -1
  31. package/dist/client/style.css +2 -2
  32. package/dist/client/{transition-DCePIwYR.js → transition-C8le0YwQ.js} +3 -3
  33. package/package.json +2 -2
  34. package/widgets/EodashMapBtns.vue +34 -0
  35. package/widgets/ExportState.vue +112 -0
  36. package/widgets/PopUp.vue +40 -0
  37. package/dist/client/EodashDatePicker-oFb1zt5E.js +0 -1211
  38. package/dist/client/Header-C-zX31Ys.js +0 -635
@@ -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,14 @@ 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.style.background = "transparent";
132
+ eoxItem.style.border = "transparent";
133
+ }
134
+ });
135
+ };
@@ -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,8 @@
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
+ //@ts-expect-error layers doesn't exist on type element
8
+ 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 = "eox-map") => 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-DeaU3QoK.js";
2
+ import { V as k } from "./VMain-Bu1bPjvK.js";
3
3
  class A extends HTMLElement {
4
4
  static get observedAttributes() {
5
5
  return ["gap"];
@@ -1,4 +1,4 @@
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";
1
+ import { bx as i, aA as m, r as p, Z as d, by as f, $ as c, a6 as g, a0 as y, d as _, a4 as k } from "./asWebComponent-DeaU3QoK.js";
2
2
  const h = { class: "d-flex flex-column fill-height overflow-auto" }, C = {
3
3
  __name: "DynamicWebComponent",
4
4
  props: {
@@ -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, b) => (c(), g("span", h, [
42
42
  (c(), y(
43
43
  k(o.tagName),
44
44
  _(o.properties, {
@@ -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-DeaU3QoK.js";
2
+ import { t as tt, e as et } from "./eodashSTAC-CFQuZ_cI.js";
3
+ import { m as at, V as E } from "./VOverlay-D_MKJ4vQ.js";
4
+ import { b as ot, f as nt } from "./forwardRefs-D0a135Tc.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-DeaU3QoK.js";
2
+ import m from "./DynamicWebComponent-DzmQ3Fr3.js";
3
3
  const f = {
4
4
  __name: "EodashItemFilter",
5
5
  setup(d) {
@@ -1,6 +1,6 @@
1
- import { x as M1, b4 as xi, $ as T1, a0 as R1, W as C1, aY as I1, w as P1, b3 as A1 } from "./asWebComponent-CpQUVi2N.js";
2
- import { t as L1, e as O1, E as F1 } from "./eodashSTAC-Q7kbX1Gy.js";
3
- import N1 from "./DynamicWebComponent-BEP4rVce.js";
1
+ import { x as M1, aH as xi, $ as T1, a0 as R1, W as C1, az as I1, w as P1, aG as A1 } from "./asWebComponent-DeaU3QoK.js";
2
+ import { t as L1, e as O1, E as F1 } from "./eodashSTAC-CFQuZ_cI.js";
3
+ import N1 from "./DynamicWebComponent-DzmQ3Fr3.js";
4
4
  var D1 = Object.defineProperty, k1 = (r, t, e) => t in r ? D1(r, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : r[t] = e, du = (r, t, e) => k1(r, typeof t != "symbol" ? t + "" : t, e);
5
5
  class ln {
6
6
  /**
@@ -36762,7 +36762,7 @@ gi([8, 32946], () => import("./deflate-BXt-9JA_-CWfClgpK.js").then((r) => r.defa
36762
36762
  gi(32773, () => import("./packbits-BlDR4Kj5-C66n1-zr.js").then((r) => r.default));
36763
36763
  gi(
36764
36764
  34887,
36765
- () => import("./lerc-DzVumYtB-rm1Xco54.js").then(async (r) => (await r.zstd.init(), r)).then((r) => r.default)
36765
+ () => import("./lerc-DzVumYtB-B3rx9xzz.js").then(async (r) => (await r.zstd.init(), r)).then((r) => r.default)
36766
36766
  );
36767
36767
  gi(50001, () => import("./webimage-BM_pbLN3-L2cGWK5l.js").then((r) => r.default));
36768
36768
  function Ph(r, t, e, n = 1) {
@@ -37688,7 +37688,7 @@ class cA {
37688
37688
  */
37689
37689
  constructor(t = hA, e) {
37690
37690
  this.workers = null, this._awaitingDecoder = null, this.size = t, this.messageId = 0, t && (this._awaitingDecoder = e ? Promise.resolve(e) : new Promise((n) => {
37691
- import("./decoder-CP4lv0Kb-BHrv68IA.js").then((i) => {
37691
+ import("./decoder-CP4lv0Kb-nokx54iM.js").then((i) => {
37692
37692
  n(i.create);
37693
37693
  });
37694
37694
  }), this._awaitingDecoder.then((n) => {
@@ -0,0 +1,37 @@
1
+ import { _ as l, r as s, aJ as r, $ as p, a6 as d, b as n, a3 as c, V as u, aK as m } from "./asWebComponent-DeaU3QoK.js";
2
+ import f from "./ExportState-D7m9s4T8.js";
3
+ const i = "Export Map", _ = `<h2>
4
+ code example
5
+ </h2>`, v = {
6
+ __name: "EodashMapBtns",
7
+ setup(x) {
8
+ const e = s(!1), o = s(null);
9
+ return r(o), (V, a) => (p(), d(
10
+ "div",
11
+ {
12
+ ref_key: "rootRef",
13
+ ref: o,
14
+ class: "d-flex align-end justify-end my-3 pa-2"
15
+ },
16
+ [
17
+ n(u, {
18
+ class: "map-btn",
19
+ color: "primary",
20
+ icon: [c(m)],
21
+ onClick: a[0] || (a[0] = (t) => e.value = !e.value)
22
+ }, null, 8, ["icon"]),
23
+ n(f, {
24
+ header: i,
25
+ code: _,
26
+ modelValue: e.value,
27
+ "onUpdate:modelValue": a[1] || (a[1] = (t) => e.value = t)
28
+ }, null, 8, ["modelValue"])
29
+ ],
30
+ 512
31
+ /* NEED_PATCH */
32
+ ));
33
+ }
34
+ }, E = /* @__PURE__ */ l(v, [["__scopeId", "data-v-c00e4b09"]]);
35
+ export {
36
+ E as default
37
+ };