@eodash/eodash 5.0.0-alpha.2.4 → 5.0.0-alpha.2.6
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 +31 -7
- package/core/client/App.vue +6 -7
- package/core/client/SuspensedDashboard.ce.vue +59 -45
- package/core/client/asWebComponent.d.ts +10 -5
- package/core/client/asWebComponent.js +6 -6
- package/core/client/components/DashboardLayout.vue +63 -21
- package/core/client/components/DynamicWebComponent.vue +44 -44
- package/core/client/components/ErrorAlert.vue +24 -7
- package/core/client/components/Footer.vue +34 -15
- package/core/client/components/Header.vue +10 -5
- package/core/client/components/IframeWrapper.vue +4 -4
- package/core/client/components/Loading.vue +17 -18
- package/core/client/components/MobileLayout.vue +82 -29
- package/core/client/composables/DefineEodash.js +38 -28
- package/core/client/composables/DefineWidgets.js +105 -79
- package/core/client/composables/index.js +43 -141
- package/core/client/eodash.js +46 -39
- package/core/client/main.js +2 -2
- package/core/client/plugins/index.js +11 -9
- package/core/client/plugins/vuetify.js +9 -10
- package/core/client/render.js +4 -5
- package/core/client/store/States.js +8 -13
- package/core/client/store/index.js +14 -11
- package/core/client/store/stac.js +51 -37
- package/core/client/types.d.ts +173 -248
- package/core/client/utils/eodashSTAC.js +151 -66
- package/core/client/utils/helpers.js +18 -20
- package/core/client/utils/index.js +25 -14
- package/core/client/utils/keys.js +2 -2
- package/core/client/views/Dashboard.vue +70 -42
- package/core/client/vite-env.d.ts +19 -17
- package/dist/client/DashboardLayout-BuDcv6LM.js +156 -0
- package/dist/client/{DynamicWebComponent-C4Hotc4H.js → DynamicWebComponent-BEP4rVce.js} +7 -7
- package/dist/client/EodashDatePicker-oFb1zt5E.js +1211 -0
- package/dist/client/EodashItemFilter-BElmgrST.js +63 -0
- package/dist/client/{EodashMap-CGrQjZ1P.js → EodashMap-DXyOgcEd.js} +11333 -14025
- package/dist/client/Footer-CoPx6UXQ.js +115 -0
- package/dist/client/Header-C-zX31Ys.js +635 -0
- package/dist/client/{IframeWrapper-Cg3GMmfW.js → IframeWrapper-2w2ye0zM.js} +4 -4
- package/dist/client/MobileLayout-C9OVcP12.js +945 -0
- package/dist/client/{VMain-BHYlmRic.js → VMain-Dm43jd43.js} +8 -8
- package/dist/client/{WidgetsContainer-dje9QSk0.js → WidgetsContainer-BS87sLqk.js} +12 -5
- package/dist/client/asWebComponent-CpQUVi2N.js +20135 -0
- package/dist/client/{basedecoder-Qm25PwVp-CHo5Pomv.js → basedecoder-DHcBySSe-BmCFNFnw.js} +5 -6
- package/dist/client/{decoder-HRvnjnEI-BQ2rajuJ.js → decoder-CP4lv0Kb-BHrv68IA.js} +1 -1
- package/dist/client/deflate-BXt-9JA_-CWfClgpK.js +10 -0
- package/dist/client/eo-dash.js +3 -3
- package/dist/client/eodashSTAC-Q7kbX1Gy.js +2788 -0
- package/dist/client/{eox-itemfilter-DcQkRD2l.js → eox-itemfilter-TaBxgqq_.js} +1002 -974
- package/dist/client/{eox-map-C3DL31fp.js → eox-map-L7abwKTR.js} +5677 -5695
- package/dist/client/forwardRefs-BVFQ82G4.js +183 -0
- package/dist/client/{index-CaDDfJYE.js → index-dOzyv_xR.js} +43 -74
- package/dist/client/{jpeg-DNfUpLwy-Fjan-04T.js → jpeg-BAgeD1d3-oeHbFPUL.js} +5 -6
- package/dist/client/{lerc-_E46UbWQ-Beu35ovS.js → lerc-DzVumYtB-rm1Xco54.js} +5 -7
- package/dist/client/{lzw-BOMhmEDy-Dboc93VO.js → lzw-LAGDNbSC-DkP96qO9.js} +1 -1
- package/dist/client/{packbits-DaUD6MLm-Bu1PoTGa.js → packbits-BlDR4Kj5-C66n1-zr.js} +1 -1
- package/dist/client/{pako.esm-C3kYPGGQ-BMki8cQY.js → pako.esm-CB1uQYY0-DB0PYm1P.js} +6 -12
- package/dist/client/{raw-CcGKjn8q-DFOt-i8n.js → raw-CMGvRjfu-BRi6E4i1.js} +1 -1
- package/dist/client/{ssrBoot-Dd7m-btU.js → ssrBoot-L9KejErM.js} +3 -3
- package/dist/client/style.css +2 -2
- package/dist/client/transition-DCePIwYR.js +34 -0
- package/dist/client/{webfontloader-CyOFAuFB.js → webfontloader-qotgY98I.js} +56 -92
- package/dist/client/{webimage-D2c098k3-DLj1LQxB.js → webimage-BM_pbLN3-L2cGWK5l.js} +1 -1
- package/dist/node/cli.js +3 -3
- package/dist/node/types.d.ts +32 -38
- package/package.json +13 -14
- package/widgets/EodashDatePicker.vue +145 -41
- package/widgets/EodashItemFilter.vue +41 -22
- package/widgets/EodashMap.vue +87 -20
- package/widgets/WidgetsContainer.vue +45 -27
- package/dist/client/DashboardLayout-ZaSRMD1M.js +0 -149
- package/dist/client/EodashDatePicker-C4kKjxKy.js +0 -1653
- package/dist/client/EodashItemFilter-cBHC0YEM.js +0 -51
- package/dist/client/Footer-pS636dEP.js +0 -118
- package/dist/client/Header-DQuaLdjl.js +0 -605
- package/dist/client/MobileLayout-BLXFBWI_.js +0 -987
- package/dist/client/asWebComponent-Bvb3xkxI.js +0 -13311
- package/dist/client/deflate-Be2Arps5-hDqMz3RA.js +0 -10
- package/dist/client/forwardRefs-Bxeu9Obx.js +0 -142
- package/dist/client/index-DlNICb3T.js +0 -34
|
@@ -1,48 +1,85 @@
|
|
|
1
|
-
import { Collection, Item } from
|
|
2
|
-
import { toAbsolute } from
|
|
3
|
-
import { generateFeatures } from
|
|
1
|
+
import { Collection, Item } from "stac-js";
|
|
2
|
+
import { toAbsolute } from "stac-js/src/http.js";
|
|
3
|
+
import { generateFeatures } from "./helpers";
|
|
4
|
+
import axios from "axios";
|
|
4
5
|
|
|
6
|
+
/**
|
|
7
|
+
* Function to extract collection urls from an indicator
|
|
8
|
+
* @param {import("stac-ts").StacCatalog
|
|
9
|
+
* | import("stac-ts").StacCollection
|
|
10
|
+
* | import("stac-ts").StacItem
|
|
11
|
+
* | null
|
|
12
|
+
* } stacObject
|
|
13
|
+
* @param {string} basepath
|
|
14
|
+
* @returns {string[]}
|
|
15
|
+
*/
|
|
16
|
+
export function extractCollectionUrls(stacObject, basepath) {
|
|
17
|
+
const collectionUrls = [];
|
|
18
|
+
// Support for two structure types, flat and indicator, simplified here:
|
|
19
|
+
// Flat assumes Catalog-Collection-Item
|
|
20
|
+
// Indicator assumes Catalog-Collection-Collection-Item
|
|
21
|
+
// TODO: this is not the most stable test approach,
|
|
22
|
+
// we should discuss potential other approaches
|
|
23
|
+
//
|
|
24
|
+
if (stacObject?.links && stacObject?.links[1].rel === "item") {
|
|
25
|
+
collectionUrls.push(basepath);
|
|
26
|
+
} else if (stacObject?.links[1].rel === "child") {
|
|
27
|
+
// TODO: Iterate through all children to create collections
|
|
28
|
+
stacObject.links.forEach((link) => {
|
|
29
|
+
if (link.rel === "child") {
|
|
30
|
+
collectionUrls.push(toAbsolute(link.href, basepath));
|
|
31
|
+
}
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
return collectionUrls;
|
|
35
|
+
}
|
|
5
36
|
export class EodashCollection {
|
|
6
|
-
/** @type {string
|
|
7
|
-
#collectionUrl =
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
selectedItem = null;
|
|
11
|
-
|
|
37
|
+
/** @type {string} */
|
|
38
|
+
#collectionUrl = "";
|
|
39
|
+
/** @type {import("stac-ts").StacCollection | undefined} */
|
|
40
|
+
#collectionStac;
|
|
12
41
|
/**
|
|
13
|
-
* @
|
|
42
|
+
* @type {import("stac-ts").StacLink
|
|
43
|
+
* | import("stac-ts").StacItem
|
|
44
|
+
* | undefined}
|
|
14
45
|
*/
|
|
46
|
+
selectedItem;
|
|
47
|
+
|
|
48
|
+
/** @param {string} collectionUrl */
|
|
15
49
|
constructor(collectionUrl) {
|
|
16
50
|
this.#collectionUrl = collectionUrl;
|
|
17
51
|
}
|
|
18
52
|
/**
|
|
19
|
-
* @param {*} item
|
|
20
|
-
* @returns
|
|
21
53
|
* @async
|
|
54
|
+
* @param {any} item
|
|
55
|
+
* @returns
|
|
22
56
|
*/
|
|
23
57
|
createLayersJson = async (item = null) => {
|
|
24
|
-
|
|
58
|
+
/** @type {import("stac-ts").StacLink | undefined} */
|
|
59
|
+
let stacItem,
|
|
60
|
+
/** @type {import("stac-ts").StacCollection | undefined} */
|
|
61
|
+
stac;
|
|
25
62
|
// TODO get auxiliary layers from collection
|
|
63
|
+
/** @type {object[]} */
|
|
26
64
|
let layersJson = [
|
|
27
|
-
{
|
|
28
|
-
type:
|
|
65
|
+
/*{
|
|
66
|
+
type: "Tile",
|
|
29
67
|
properties: {
|
|
30
|
-
id:
|
|
68
|
+
id: "OSM",
|
|
31
69
|
},
|
|
32
70
|
source: {
|
|
33
|
-
type:
|
|
71
|
+
type: "OSM",
|
|
34
72
|
},
|
|
35
|
-
}
|
|
73
|
+
},*/
|
|
36
74
|
];
|
|
37
75
|
// Load collectionstac if not yet initialized
|
|
38
76
|
if (!this.#collectionStac) {
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
stac = await response.json();
|
|
77
|
+
const response = await axios.get(this.#collectionUrl);
|
|
78
|
+
stac = await response.data;
|
|
42
79
|
this.#collectionStac = new Collection(stac);
|
|
43
80
|
}
|
|
44
81
|
|
|
45
|
-
if(stac && stac.endpointtype === "GeoDB") {
|
|
82
|
+
if (stac && stac.endpointtype === "GeoDB") {
|
|
46
83
|
// Special handling of point based data
|
|
47
84
|
const allFeatures = generateFeatures(stac.links);
|
|
48
85
|
layersJson.unshift({
|
|
@@ -52,7 +89,6 @@ export class EodashCollection {
|
|
|
52
89
|
},
|
|
53
90
|
source: {
|
|
54
91
|
type: "Vector",
|
|
55
|
-
// @ts-ignore
|
|
56
92
|
url: "data:," + encodeURIComponent(JSON.stringify(allFeatures)),
|
|
57
93
|
format: "GeoJSON",
|
|
58
94
|
},
|
|
@@ -62,17 +98,21 @@ export class EodashCollection {
|
|
|
62
98
|
"circle-stroke-color": "#004170",
|
|
63
99
|
"fill-color": "#00417077",
|
|
64
100
|
"stroke-color": "#004170",
|
|
65
|
-
}
|
|
101
|
+
},
|
|
66
102
|
});
|
|
67
103
|
return layersJson;
|
|
68
104
|
} else {
|
|
69
105
|
if (item instanceof Date) {
|
|
70
106
|
// if collectionStac not yet initialized we do it here
|
|
71
|
-
stacItem = this.getItems()
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
107
|
+
stacItem = this.getItems()?.sort((a, b) => {
|
|
108
|
+
const distanceA = Math.abs(
|
|
109
|
+
new Date(/** @type {number} */ (a.datetime)).getTime() -
|
|
110
|
+
item.getTime(),
|
|
111
|
+
);
|
|
112
|
+
const distanceB = Math.abs(
|
|
113
|
+
new Date(/** @type {number} */ (b.datetime)).getTime() -
|
|
114
|
+
item.getTime(),
|
|
115
|
+
);
|
|
76
116
|
return distanceA - distanceB;
|
|
77
117
|
})[0];
|
|
78
118
|
this.selectedItem = stacItem;
|
|
@@ -82,83 +122,128 @@ export class EodashCollection {
|
|
|
82
122
|
const response = await fetch(
|
|
83
123
|
stacItem
|
|
84
124
|
? toAbsolute(stacItem.href, this.#collectionUrl)
|
|
85
|
-
: this.#collectionUrl
|
|
125
|
+
: this.#collectionUrl,
|
|
86
126
|
);
|
|
87
127
|
stac = await response.json();
|
|
88
|
-
|
|
128
|
+
|
|
89
129
|
if (!stacItem) {
|
|
90
130
|
// no specific item was requested; render last item
|
|
91
131
|
this.#collectionStac = new Collection(stac);
|
|
92
132
|
const items = this.getItems();
|
|
93
|
-
this.selectedItem = items[items.length - 1];
|
|
94
|
-
|
|
95
|
-
|
|
133
|
+
this.selectedItem = items?.[items.length - 1];
|
|
134
|
+
if (this.selectedItem) {
|
|
135
|
+
layersJson = await this.createLayersJson(this.selectedItem);
|
|
136
|
+
} else {
|
|
137
|
+
if (import.meta.env.DEV) {
|
|
138
|
+
console.warn(
|
|
139
|
+
"[eodash] the selected collection does not include any items",
|
|
140
|
+
);
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
return [];
|
|
96
144
|
} else {
|
|
97
145
|
// specific item was requested
|
|
98
146
|
const item = new Item(stac);
|
|
99
147
|
this.selectedItem = item;
|
|
100
|
-
|
|
101
|
-
layersJson.unshift(this.buildJson(item));
|
|
148
|
+
layersJson.unshift(...this.buildJsonArray(item));
|
|
102
149
|
return layersJson;
|
|
103
150
|
}
|
|
104
151
|
}
|
|
105
|
-
}
|
|
152
|
+
};
|
|
106
153
|
|
|
107
|
-
/**
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
//
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
154
|
+
/** @param {import("stac-ts").StacItem} item */
|
|
155
|
+
buildJsonArray(item) {
|
|
156
|
+
const jsonArray = [];
|
|
157
|
+
// TODO: this currently assumes only one layer will be extracted
|
|
158
|
+
// from an item, although it think this is currently true
|
|
159
|
+
// potentially this could return multiple layers
|
|
160
|
+
// TODO: implement other types, such as COG
|
|
161
|
+
|
|
162
|
+
// I propose following approach, we "manually" create configurations
|
|
163
|
+
// for the rendering options we know and expect.
|
|
164
|
+
// If we don't find any we fallback to using the STAC ol item that
|
|
165
|
+
// will try to extract anything it supports but for which we have
|
|
166
|
+
// less control.
|
|
167
|
+
const wms = item.links.find((l) => l.rel === "wms");
|
|
168
|
+
// const projDef = false; // TODO: add capability to find projection in item
|
|
169
|
+
if (wms) {
|
|
170
|
+
let json = {
|
|
171
|
+
type: "Tile",
|
|
172
|
+
properties: {
|
|
173
|
+
id: item.id,
|
|
174
|
+
},
|
|
175
|
+
source: {
|
|
176
|
+
// if no projection information is provided we should
|
|
177
|
+
// assume one, else for WMS requests it will try to get
|
|
178
|
+
// the map projection that might not be supported
|
|
179
|
+
// projection: projDef ? projDef : "EPSG:4326",
|
|
180
|
+
type: "TileWMS",
|
|
181
|
+
url: wms.href,
|
|
182
|
+
params: {
|
|
183
|
+
LAYERS: wms["wms:layers"],
|
|
184
|
+
TILED: true,
|
|
185
|
+
},
|
|
186
|
+
},
|
|
187
|
+
};
|
|
188
|
+
if ("wms:dimensions" in wms) {
|
|
189
|
+
// @ts-expect-error: waiting for eox-map to provide type definition
|
|
190
|
+
json.source.params.time = wms["wms:dimensions"];
|
|
191
|
+
}
|
|
192
|
+
jsonArray.push(json);
|
|
193
|
+
} else if (item.links.find((l) => l.rel === "wmts" || l.rel === "xyz")) {
|
|
194
|
+
jsonArray.push({
|
|
195
|
+
type: "STAC",
|
|
117
196
|
displayWebMapLink: true,
|
|
118
197
|
displayFootprint: false,
|
|
119
198
|
data: item,
|
|
120
199
|
properties: {
|
|
121
200
|
id: item.id,
|
|
122
201
|
},
|
|
123
|
-
};
|
|
202
|
+
});
|
|
124
203
|
} else {
|
|
125
204
|
// fall back to rendering the feature
|
|
126
|
-
|
|
127
|
-
type:
|
|
205
|
+
jsonArray.push({
|
|
206
|
+
type: "Vector",
|
|
128
207
|
source: {
|
|
129
|
-
type:
|
|
130
|
-
url:
|
|
131
|
-
format:
|
|
208
|
+
type: "Vector",
|
|
209
|
+
url: "data:," + encodeURIComponent(JSON.stringify(item.geometry)),
|
|
210
|
+
format: "GeoJSON",
|
|
132
211
|
},
|
|
133
212
|
properties: {
|
|
134
213
|
id: item.id,
|
|
135
214
|
},
|
|
136
|
-
};
|
|
215
|
+
});
|
|
137
216
|
}
|
|
138
217
|
|
|
139
|
-
return
|
|
218
|
+
return jsonArray;
|
|
140
219
|
}
|
|
141
220
|
|
|
142
221
|
getItems() {
|
|
143
222
|
return (
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
/** @type {import('stac-ts').StacLink[]}*/(this.#collectionStac?.links)
|
|
147
|
-
.filter((i) => i.rel === 'item')
|
|
223
|
+
this.#collectionStac?.links
|
|
224
|
+
.filter((i) => i.rel === "item")
|
|
148
225
|
// sort by `datetime`, where oldest is first in array
|
|
149
|
-
.sort((a, b) =>
|
|
226
|
+
.sort((a, b) =>
|
|
227
|
+
/** @type {number} */ (a.datetime) <
|
|
228
|
+
/** @type {number} */ (b.datetime)
|
|
229
|
+
? -1
|
|
230
|
+
: 1,
|
|
231
|
+
)
|
|
150
232
|
);
|
|
151
233
|
}
|
|
152
234
|
|
|
153
235
|
getDates() {
|
|
154
236
|
return (
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
/** @type {import('stac-ts').StacLink[]}*/ (this.#collectionStac?.links)
|
|
158
|
-
.filter((i) => i.rel === 'item')
|
|
237
|
+
this.#collectionStac?.links
|
|
238
|
+
.filter((i) => i.rel === "item")
|
|
159
239
|
// sort by `datetime`, where oldest is first in array
|
|
160
|
-
.sort((a, b) =>
|
|
161
|
-
|
|
240
|
+
.sort((a, b) =>
|
|
241
|
+
/** @type {number} */ (a.datetime) <
|
|
242
|
+
/** @type {number} */ (b.datetime)
|
|
243
|
+
? -1
|
|
244
|
+
: 1,
|
|
245
|
+
)
|
|
246
|
+
.map((i) => new Date(/** @type {number} */ (i.datetime)))
|
|
162
247
|
);
|
|
163
248
|
}
|
|
164
249
|
}
|
|
@@ -1,37 +1,35 @@
|
|
|
1
|
-
|
|
2
|
-
/**
|
|
3
|
-
* @param {import("stac-ts").StacLink[]} links
|
|
4
|
-
*/
|
|
1
|
+
/** @param {import("stac-ts").StacLink[]} links */
|
|
5
2
|
export function generateFeatures(links) {
|
|
6
3
|
/**
|
|
7
4
|
* @type {{
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
5
|
+
* type: string;
|
|
6
|
+
* geometry: {
|
|
7
|
+
* type: string;
|
|
8
|
+
* coordinates: [number, number];
|
|
9
|
+
* };
|
|
13
10
|
* }[]}
|
|
14
11
|
*/
|
|
15
12
|
const features = [];
|
|
16
|
-
links.forEach(element => {
|
|
13
|
+
links.forEach((element) => {
|
|
17
14
|
if (element.rel === "item" && "latlng" in element) {
|
|
18
|
-
|
|
19
|
-
|
|
15
|
+
const [lat, lon] = /** @type {string} */ (element.latlng)
|
|
16
|
+
.split(",")
|
|
17
|
+
.map((it) => Number(it));
|
|
20
18
|
features.push({
|
|
21
|
-
type:
|
|
19
|
+
type: "Feature",
|
|
22
20
|
geometry: {
|
|
23
|
-
type:
|
|
21
|
+
type: "Point",
|
|
24
22
|
coordinates: [lon, lat],
|
|
25
23
|
},
|
|
26
|
-
})
|
|
24
|
+
});
|
|
27
25
|
}
|
|
28
26
|
});
|
|
29
27
|
const geojsonObject = {
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
28
|
+
type: "FeatureCollection",
|
|
29
|
+
crs: {
|
|
30
|
+
type: "name",
|
|
31
|
+
properties: {
|
|
32
|
+
name: "EPSG:4326",
|
|
35
33
|
},
|
|
36
34
|
},
|
|
37
35
|
features,
|
|
@@ -1,27 +1,38 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
2
|
+
* Loads font in the app using `webfontloader`
|
|
3
|
+
*
|
|
4
|
+
* @param {string} [family]
|
|
4
5
|
* @param {string} [link]
|
|
5
|
-
* @
|
|
6
|
-
* @
|
|
6
|
+
* @param {boolean} [isWebComponent]
|
|
7
|
+
* @returns {Promise<string>} - Font family name
|
|
8
|
+
* @see {@link "https://github.com/typekit/webfontloader"}
|
|
7
9
|
*/
|
|
8
|
-
export const loadFont = async (
|
|
9
|
-
|
|
10
|
-
|
|
10
|
+
export const loadFont = async (
|
|
11
|
+
family = "",
|
|
12
|
+
link = "",
|
|
13
|
+
isWebComponent = false,
|
|
14
|
+
) => {
|
|
15
|
+
if (family && link) {
|
|
16
|
+
const WebFontLoader = (await import("webfontloader")).default;
|
|
11
17
|
WebFontLoader.load({
|
|
18
|
+
classes: false,
|
|
12
19
|
custom: {
|
|
13
20
|
// Use FVD notation to include families https://github.com/typekit/fvd
|
|
14
21
|
families: [family],
|
|
15
22
|
// Path to stylesheet that defines font-face
|
|
16
23
|
urls: [link],
|
|
17
24
|
},
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
+
fontactive(familyName, _fvd) {
|
|
26
|
+
const stylesheet = new CSSStyleSheet();
|
|
27
|
+
const styles = isWebComponent
|
|
28
|
+
? `eo-dash {font-family: ${familyName};}`
|
|
29
|
+
: `* {font-family: ${familyName};}`;
|
|
30
|
+
stylesheet.replaceSync(styles);
|
|
31
|
+
document.adoptedStyleSheets.push(stylesheet);
|
|
32
|
+
},
|
|
33
|
+
fontinactive(familyName, _fvd) {
|
|
34
|
+
throw new Error(`error loading font: ${familyName}`);
|
|
35
|
+
},
|
|
25
36
|
});
|
|
26
37
|
}
|
|
27
38
|
return family;
|
|
@@ -2,10 +2,12 @@
|
|
|
2
2
|
<HeaderComponent ref="headerRef" v-if="!eodash.brand.noLayout" />
|
|
3
3
|
<ErrorAlert v-model="error" />
|
|
4
4
|
<Suspense>
|
|
5
|
-
<TemplateComponent
|
|
6
|
-
:
|
|
5
|
+
<TemplateComponent
|
|
6
|
+
@vue:mounted="onTemplateMount?.(hiddenElements)"
|
|
7
|
+
class="template"
|
|
8
|
+
/>
|
|
7
9
|
<template #fallback>
|
|
8
|
-
<div
|
|
10
|
+
<div class="loading-container">
|
|
9
11
|
<Loading />
|
|
10
12
|
</div>
|
|
11
13
|
</template>
|
|
@@ -16,73 +18,99 @@
|
|
|
16
18
|
<script setup>
|
|
17
19
|
import { useEodashRuntime } from "@/composables/DefineEodash";
|
|
18
20
|
import { useURLSearchParametersSync, useUpdateTheme } from "@/composables";
|
|
19
|
-
import { useSTAcStore } from
|
|
21
|
+
import { useSTAcStore } from "@/store/stac";
|
|
20
22
|
import { defineAsyncComponent, onErrorCaptured, onMounted, ref } from "vue";
|
|
21
23
|
import { useDisplay, useLayout } from "vuetify/lib/framework.mjs";
|
|
22
|
-
import { loadFont } from
|
|
24
|
+
import { loadFont } from "@/utils";
|
|
23
25
|
import Loading from "@/components/Loading.vue";
|
|
24
26
|
import ErrorAlert from "@/components/ErrorAlert.vue";
|
|
25
27
|
|
|
26
28
|
const props = defineProps({
|
|
27
29
|
config: {
|
|
28
|
-
type: String
|
|
30
|
+
type: String,
|
|
29
31
|
},
|
|
30
32
|
onTemplateMount: {
|
|
31
|
-
type: Function
|
|
32
|
-
}
|
|
33
|
-
})
|
|
34
|
-
const eodash = await useEodashRuntime(props.config)
|
|
33
|
+
type: Function,
|
|
34
|
+
},
|
|
35
|
+
});
|
|
36
|
+
const eodash = await useEodashRuntime(props.config);
|
|
35
37
|
|
|
36
38
|
useURLSearchParametersSync();
|
|
37
39
|
|
|
38
|
-
const theme = useUpdateTheme(
|
|
39
|
-
theme.global.name.value =
|
|
40
|
+
const theme = useUpdateTheme("dashboardTheme", eodash.brand?.theme);
|
|
41
|
+
theme.global.name.value = "dashboardTheme";
|
|
40
42
|
|
|
41
|
-
await loadFont(
|
|
43
|
+
await loadFont(
|
|
44
|
+
eodash.brand?.font?.family,
|
|
45
|
+
eodash.brand?.font?.link,
|
|
46
|
+
!!props.onTemplateMount,
|
|
47
|
+
);
|
|
42
48
|
|
|
43
|
-
const { loadSTAC } = useSTAcStore()
|
|
44
|
-
await loadSTAC()
|
|
49
|
+
const { loadSTAC } = useSTAcStore();
|
|
50
|
+
await loadSTAC();
|
|
45
51
|
|
|
46
|
-
const { smAndDown } = useDisplay()
|
|
47
|
-
const TemplateComponent = smAndDown.value
|
|
48
|
-
defineAsyncComponent(() => import(`@/components/MobileLayout.vue`))
|
|
49
|
-
defineAsyncComponent(() => import(`@/components/DashboardLayout.vue`))
|
|
52
|
+
const { smAndDown } = useDisplay();
|
|
53
|
+
const TemplateComponent = smAndDown.value
|
|
54
|
+
? defineAsyncComponent(() => import(`@/components/MobileLayout.vue`))
|
|
55
|
+
: defineAsyncComponent(() => import(`@/components/DashboardLayout.vue`));
|
|
50
56
|
|
|
51
|
-
const HeaderComponent = defineAsyncComponent(
|
|
52
|
-
|
|
53
|
-
|
|
57
|
+
const HeaderComponent = defineAsyncComponent(
|
|
58
|
+
() => import(`@/components/Header.vue`),
|
|
59
|
+
);
|
|
60
|
+
const FooterComponent = defineAsyncComponent(
|
|
61
|
+
() => import(`@/components/Footer.vue`),
|
|
62
|
+
);
|
|
63
|
+
const { mainRect } = useLayout();
|
|
64
|
+
const templateHeight = eodash.brand.noLayout
|
|
65
|
+
? props.onTemplateMount
|
|
66
|
+
? "100%"
|
|
67
|
+
: "90dvh"
|
|
68
|
+
: `calc(100dvh - ${mainRect.value["top"] + mainRect.value["bottom"]}px)`;
|
|
54
69
|
|
|
55
|
-
/** @type {import("vue").Ref<InstanceType<typeof
|
|
56
|
-
* import("@/components/Header.vue").default >|null>}
|
|
57
|
-
**/
|
|
58
70
|
const headerRef = ref(null);
|
|
59
|
-
/**
|
|
60
|
-
*
|
|
61
|
-
|
|
71
|
+
/**
|
|
72
|
+
* @type {import("vue").Ref<InstanceType<
|
|
73
|
+
* typeof import("@/components/Footer.vue").default
|
|
74
|
+
* > | null>}
|
|
75
|
+
*/
|
|
62
76
|
const footerRef = ref(null);
|
|
63
77
|
|
|
64
|
-
const hiddenElements = [headerRef, footerRef]
|
|
78
|
+
const hiddenElements = [headerRef, footerRef];
|
|
65
79
|
|
|
66
80
|
onMounted(() => {
|
|
67
|
-
const htmlTag = /** @type {HTMLElement} */(document.querySelector('html'))
|
|
68
|
-
htmlTag.style.overflow = 'hidden';
|
|
69
|
-
|
|
70
81
|
if (props.onTemplateMount && !eodash.brand.noLayout) {
|
|
71
|
-
hiddenElements.forEach(element => {
|
|
82
|
+
hiddenElements.forEach((element) => {
|
|
72
83
|
/** @type {HTMLElement} */
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
84
|
+
(
|
|
85
|
+
/** @type {import("vue").ComponentPublicInstance} */
|
|
86
|
+
(element.value).$el
|
|
87
|
+
).style.opacity = "0";
|
|
88
|
+
});
|
|
76
89
|
}
|
|
77
|
-
})
|
|
90
|
+
});
|
|
78
91
|
|
|
79
|
-
const error = ref(
|
|
92
|
+
const error = ref("");
|
|
80
93
|
onErrorCaptured((e, comp, info) => {
|
|
81
94
|
error.value = `
|
|
82
|
-
|
|
95
|
+
${e}.
|
|
83
96
|
component: ${comp?.$.type.name}.
|
|
84
97
|
info: ${info}.
|
|
85
|
-
|
|
86
|
-
})
|
|
87
|
-
|
|
98
|
+
`;
|
|
99
|
+
});
|
|
88
100
|
</script>
|
|
101
|
+
<style>
|
|
102
|
+
html {
|
|
103
|
+
overflow: hidden !important;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
.template {
|
|
107
|
+
height: v-bind("templateHeight");
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
.loading-container {
|
|
111
|
+
height: 100dvh;
|
|
112
|
+
display: flex;
|
|
113
|
+
align-items: center;
|
|
114
|
+
justify-content: center;
|
|
115
|
+
}
|
|
116
|
+
</style>
|
|
@@ -1,31 +1,33 @@
|
|
|
1
1
|
/// <reference types="vite/client" />
|
|
2
2
|
|
|
3
|
-
declare module
|
|
4
|
-
import type { DefineComponent } from
|
|
5
|
-
const component: DefineComponent<
|
|
6
|
-
export default component
|
|
3
|
+
declare module "*.vue" {
|
|
4
|
+
import type { DefineComponent } from "vue";
|
|
5
|
+
const component: DefineComponent<object, object, unknown>;
|
|
6
|
+
export default component;
|
|
7
7
|
}
|
|
8
8
|
declare interface Window {
|
|
9
|
-
eodashStore: import("@/types").EodashStore
|
|
9
|
+
eodashStore: import("@/types").EodashStore;
|
|
10
10
|
}
|
|
11
|
-
declare module
|
|
12
|
-
export const EOxStacInfo: CustomElementConstructor
|
|
11
|
+
declare module "@eox/stacinfo" {
|
|
12
|
+
export const EOxStacInfo: CustomElementConstructor;
|
|
13
13
|
}
|
|
14
|
-
declare module
|
|
15
|
-
export const EOxMap: CustomElementConstructor
|
|
14
|
+
declare module "@eox/map" {
|
|
15
|
+
export const EOxMap: CustomElementConstructor;
|
|
16
16
|
}
|
|
17
|
-
declare module
|
|
18
|
-
export const EOxItemFilter: CustomElementConstructor
|
|
17
|
+
declare module "@eox/itemfilter" {
|
|
18
|
+
export const EOxItemFilter: CustomElementConstructor;
|
|
19
19
|
}
|
|
20
|
-
declare module
|
|
20
|
+
declare module "user:config" {
|
|
21
21
|
const eodash: import("@/types").Eodash | Promise<import("@/types").Eodash>;
|
|
22
|
-
export default eodash
|
|
22
|
+
export default eodash;
|
|
23
23
|
}
|
|
24
24
|
declare module "stac-js" {
|
|
25
|
-
const
|
|
26
|
-
|
|
25
|
+
export const Collection: {
|
|
26
|
+
new (data?: object): import("stac-ts").StacCollection;
|
|
27
|
+
};
|
|
28
|
+
export const Item: { new (data?: object): import("stac-ts").StacItem };
|
|
27
29
|
}
|
|
28
30
|
declare module "stac-js/src/http.js" {
|
|
29
|
-
const toAbsolute:
|
|
30
|
-
export { toAbsolute }
|
|
31
|
+
const toAbsolute: (...args: string[]) => string;
|
|
32
|
+
export { toAbsolute };
|
|
31
33
|
}
|