@eodash/eodash 5.0.0-rc.2.1 → 5.0.0-rc.2.3

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 (59) hide show
  1. package/core/client/components/DashboardLayout.vue +3 -2
  2. package/core/client/components/DynamicWebComponent.vue +10 -3
  3. package/core/client/components/EodashOverlay.vue +56 -0
  4. package/core/client/components/Footer.vue +1 -15
  5. package/core/client/components/Header.vue +1 -1
  6. package/core/client/components/MobileLayout.vue +1 -0
  7. package/core/client/composables/DefineTemplate.js +13 -2
  8. package/core/client/composables/DefineWidgets.js +9 -4
  9. package/core/client/composables/EodashMap.js +2 -1
  10. package/core/client/eodash.js +18 -11
  11. package/core/client/eodashSTAC/EodashCollection.js +70 -35
  12. package/core/client/eodashSTAC/createLayers.js +21 -2
  13. package/core/client/eodashSTAC/helpers.js +7 -5
  14. package/core/client/types.ts +18 -13
  15. package/core/client/utils/index.js +112 -32
  16. package/core/client/utils/states.js +43 -0
  17. package/core/client/views/Dashboard.vue +26 -6
  18. package/dist/client/{DashboardLayout-BjUs7mYs.js → DashboardLayout-Reny_s87.js} +6 -6
  19. package/dist/client/{DynamicWebComponent-rIFx5c0f.js → DynamicWebComponent-DQPKIscC.js} +11 -4
  20. package/dist/client/{EodashDatePicker-brJlj1aQ.js → EodashDatePicker-E5GjnQQ2.js} +3 -3
  21. package/dist/client/{EodashItemFilter-C2i4lnM1.js → EodashItemFilter-DN77Uqgg.js} +1 -1
  22. package/dist/client/{EodashLayerControl-DNQzPQQ4.js → EodashLayerControl-DduVhg2O.js} +10 -3
  23. package/dist/client/{EodashLayoutSwitcher-gLe7G8Qn.js → EodashLayoutSwitcher-CeNnYuaC.js} +2 -2
  24. package/dist/client/{EodashMap-LOzTlvrM.js → EodashMap-C3bgcNJk.js} +10 -4
  25. package/dist/client/{EodashMapBtns-UXOupU5J.js → EodashMapBtns-B73UApEn.js} +4 -4
  26. package/dist/client/{EodashProcess-BlkqUdzj.js → EodashProcess-IQPnj17j.js} +14 -14
  27. package/dist/client/{EodashStacInfo-Df3LXKAw.js → EodashStacInfo-CeZqI75-.js} +1 -1
  28. package/dist/client/{EodashTools-BrqH4IDP.js → EodashTools-CAE604ZJ.js} +4 -4
  29. package/dist/client/{ExportState-DVosrSNY.js → ExportState-DXw8Dwvk.js} +4 -4
  30. package/dist/client/Footer-Bl9tQTyj.js +119 -0
  31. package/dist/client/{Header-DYMnh4of.js → Header-qH_kBs-u.js} +5 -5
  32. package/dist/client/{MobileLayout-Df4Z1bMl.js → MobileLayout-Du5n5XyY.js} +11 -11
  33. package/dist/client/{PopUp-BFcSuX3b.js → PopUp-B12NWJHU.js} +3 -3
  34. package/dist/client/{VImg-BO2Ysvsu.js → VImg-CjsuV4n9.js} +2 -2
  35. package/dist/client/{VMain-fx1gaM7Y.js → VMain-B11EjLm6.js} +1 -1
  36. package/dist/client/{VOverlay-CiQn3F6n.js → VOverlay-CLR2s8AQ.js} +3 -3
  37. package/dist/client/{VTooltip-DKOCofTl.js → VTooltip-DqyE5_aG.js} +3 -3
  38. package/dist/client/{WidgetsContainer-DL0bdnjh.js → WidgetsContainer-YI9ZycgC.js} +1 -1
  39. package/dist/client/{asWebComponent-N7ChSAQG.js → asWebComponent-DBkwthjq.js} +382 -115
  40. package/dist/client/eo-dash.css +2 -2
  41. package/dist/client/eo-dash.js +1 -1
  42. package/dist/client/{forwardRefs-C2UOEnvr.js → forwardRefs-BTYtR3pq.js} +1 -1
  43. package/dist/client/{index-BXi80Gr9.js → index-BhfdO0rU.js} +1 -1
  44. package/dist/client/{transition-w_2EtUxa.js → transition-B79onGGb.js} +1 -1
  45. package/dist/types/core/client/components/EodashOverlay.vue.d.ts +2 -0
  46. package/dist/types/core/client/eodashSTAC/EodashCollection.d.ts +36 -7
  47. package/dist/types/core/client/eodashSTAC/createLayers.d.ts +20 -0
  48. package/dist/types/core/client/eodashSTAC/helpers.d.ts +9 -6
  49. package/dist/types/core/client/types.d.ts +15 -11
  50. package/dist/types/core/client/utils/index.d.ts +1 -1
  51. package/dist/types/core/client/utils/states.d.ts +43 -0
  52. package/dist/types/widgets/EodashStacInfo.vue.d.ts +2 -2
  53. package/dist/types/widgets/PopUp.vue.d.ts +2 -2
  54. package/package.json +2 -1
  55. package/widgets/EodashDatePicker.vue +18 -0
  56. package/widgets/EodashLayerControl.vue +7 -0
  57. package/widgets/EodashMap.vue +7 -1
  58. package/widgets/EodashProcess.vue +13 -13
  59. package/dist/client/Footer-tjsscQ7O.js +0 -141
@@ -3,6 +3,7 @@
3
3
  <eox-layout :gap="gap" :style="`padding: ${gap}px`">
4
4
  <eox-layout-item
5
5
  v-if="bgWidget?.component"
6
+ :key="bgWidget.id"
6
7
  class="bg-panel bg-surface"
7
8
  :style="`margin: -${gap + 1}px;`"
8
9
  x="0"
@@ -10,7 +11,7 @@
10
11
  h="12"
11
12
  w="12"
12
13
  >
13
- <Suspense suspensible>
14
+ <Suspense>
14
15
  <component
15
16
  id="bg-widget"
16
17
  :is="bgWidget?.component"
@@ -30,7 +31,7 @@
30
31
  :x="importedWidget.value.layout.x"
31
32
  :y="importedWidget.value.layout.y"
32
33
  >
33
- <Suspense suspensible>
34
+ <Suspense>
34
35
  <component
35
36
  :key="importedWidget.value.id"
36
37
  :is="importedWidget.value.component"
@@ -34,7 +34,7 @@ const props = /** @type {import("@/types").WebComponentProps} */ (
34
34
  const getWebComponent = async () =>
35
35
  typeof props.link === "string"
36
36
  ? await import(/* @vite-ignore */ props.link)
37
- : await props.link();
37
+ : await props.link?.();
38
38
 
39
39
  const imported = !customElements.get(props.tagName)
40
40
  ? await getWebComponent().catch((e) => {
@@ -46,8 +46,15 @@ const defined = customElements.get(props.tagName);
46
46
 
47
47
  // if the imported link doesn't define the custom tag provided
48
48
  if (!defined && props.constructorProp) {
49
- const Constructor = imported[props.constructorProp];
50
- customElements.define(props.tagName, Constructor);
49
+ try {
50
+ const Constructor = imported[props.constructorProp];
51
+ customElements.define(props.tagName, Constructor);
52
+ } catch (e) {
53
+ console.error(
54
+ `[eodash] ${props.tagName} is not defined, please add a valid link or constructorProp`,
55
+ );
56
+ console.error(e);
57
+ }
51
58
  }
52
59
 
53
60
  const store = useSTAcStore();
@@ -0,0 +1,56 @@
1
+ <template>
2
+ <div class="eodash-overlay" v-if="$vuetify.display.mdAndUp">
3
+ <p>
4
+ <a href="https://github.com/eodash/eodash" target="_blank"
5
+ >eodash v{{ version }}</a
6
+ >
7
+ by
8
+ <a href="https://eox.at" target="_blank">
9
+ <img :src="`data:image/svg+xml;base64,${base64Logo}`" height="9px" />
10
+ </a>
11
+ </p>
12
+ </div>
13
+ </template>
14
+ <script setup>
15
+ import { useTheme } from "vuetify/lib/framework.mjs";
16
+ import pkgJson from "../../../package.json";
17
+ const { computedThemes } = useTheme();
18
+
19
+ const version = pkgJson.version;
20
+
21
+ const eoxLogo = `<svg width="100%" height="100%" viewBox="0 0 355 85" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" xmlns:serif="http://www.serif.com/" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:1.41421;"><g id="ink_ext_XXXXXX"><path id="path5076" d="M152.986,40.52l-0.75,-0.019l-0.737,-0.056l-0.725,-0.093l-0.713,-0.127l-0.7,-0.162l-0.7,-0.196l-0.675,-0.228l-0.65,-0.261l-0.65,-0.292l-0.625,-0.319l-0.612,-0.352l-0.588,-0.377l-0.562,-0.407l-0.55,-0.431l-0.538,-0.457l-0.5,-0.481l-0.487,-0.505l-0.45,-0.528l-0.438,-0.55l-0.4,-0.57l-0.375,-0.59l-0.35,-0.609l-0.325,-0.627l-0.287,-0.645l-0.263,-0.66l-0.225,-0.676l-0.2,-0.69l-0.162,-0.704l-0.125,-0.717l-0.1,-0.728l-0.05,-0.739l-0.025,-0.748c0,-8.023 6.512,-14.532 14.537,-14.532c8.038,0 14.538,6.509 14.538,14.532c0,8.036 -6.5,14.544 -14.538,14.544Z" style="fill:none;"/><path id="path5078" d="M165.748,-0.002c-42.009,0 -76.06,18.985 -76.06,42.402c0,13.268 10.921,25.102 28.021,32.875c-8.081,-5.487 -13.403,-12.973 -14.584,-21.859c-2.685,-20.186 16.83,-40.82 45.148,-49.615c-14.687,6.665 -24.923,21.427 -24.923,38.599c0,23.218 18.648,42.046 41.773,42.383c-0.037,0.005 -0.087,0.015 -0.137,0.02c0.263,0 0.512,0.009 0.762,0.009c42.013,0 76.076,-18.984 76.076,-42.412c0,-13.261 -10.937,-25.097 -28.037,-32.871l0.75,0.522l0.736,0.531l0.713,0.543l0.7,0.555l0.687,0.566l0.664,0.578l0.649,0.588l0.625,0.6l0.613,0.609l0.588,0.621l0.574,0.631l0.562,0.643l0.538,0.652l0.513,0.662l0.5,0.672l0.475,0.684l0.449,0.693l0.438,0.703l0.425,0.713l0.387,0.723l0.375,0.73l0.352,0.74l0.336,0.75l0.3,0.76l0.287,0.77l0.264,0.777l0.25,0.787l0.211,0.795l0.188,0.805l0.175,0.812l0.151,0.82l0.125,0.831c2.675,20.19 -16.838,40.825 -45.151,49.619c14.688,-6.665 24.926,-21.426 24.926,-38.614c0,-23.202 -18.65,-42.026 -41.775,-42.367c0.05,-0.005 0.1,-0.015 0.15,-0.025c-0.262,0 -0.526,-0.01 -0.789,-0.01Zm-13.248,11.314c7.817,0 14.25,6.433 14.25,14.25c0,0.001 0,0.001 0,0.001c0,7.817 -6.433,14.249 -14.25,14.249c-7.817,0 -14.25,-6.432 -14.25,-14.249c0,-0.001 0,-0.001 0,-0.001c0,-7.817 6.433,-14.25 14.25,-14.25Z"
22
+ style="fill:${computedThemes.value["dashboardTheme"].colors["on-secondary"]};fill-rule:nonzero;"/><path id="path5080" d="M213.786,9.529l0.75,0.521l0.738,0.532l0.712,0.544l0.7,0.555l0.688,0.566l0.662,0.577l0.65,0.588l0.625,0.6l0.613,0.61l0.587,0.62l0.575,0.631l0.563,0.643l0.537,0.652l0.513,0.663l0.5,0.672l0.475,0.684l0.45,0.692l0.437,0.703l0.425,0.712l0.388,0.723l0.375,0.731l0.35,0.741l0.337,0.75l0.3,0.76l0.288,0.769l0.262,0.777l0.25,0.786l0.213,0.797l0.187,0.804l0.175,0.812l0.15,0.821l0.125,0.83c2.675,20.19 -16.837,40.825 -45.15,49.619c14.688,-6.665 24.925,-21.426 24.925,-38.614c0,-23.202 -18.65,-42.025 -41.775,-42.367c0.05,-0.005 0.1,-0.015 0.15,-0.025c-0.262,0 -0.525,-0.01 -0.787,-0.01c-42.01,0 -76.062,18.985 -76.062,42.402c0,13.268 10.922,25.103 28.022,32.876c-8.081,-5.487 -13.403,-12.973 -14.584,-21.859c-2.685,-20.187 16.831,-40.82 45.149,-49.615c-14.688,6.665 -24.925,21.426 -24.925,38.598c0,23.218 18.65,42.046 41.775,42.383c-0.038,0.005 -0.088,0.015 -0.138,0.02c0.263,0 0.513,0.01 0.763,0.01c42.012,-0.001 76.075,-18.985 76.075,-42.413c0,-13.261 -10.938,-25.097 -28.038,-32.871Z" style="fill:none;"/><path id="path5082" d="M354.323,82.586l-41.999,-42.002l38.524,-38.515l-29.913,0l-23.562,23.559l-23.563,-23.559l-29.924,0l38.525,38.515l-42,42.002l29.913,0l27.049,-27.046l27.05,27.046l29.9,0"
23
+ style="fill:${computedThemes.value["dashboardTheme"].colors["on-secondary"]};fill-rule:nonzero;"/><path id="path5084" d="M354.323,82.586l-41.999,-42.002l38.524,-38.515l-29.913,0l-23.562,23.559l-23.563,-23.559l-29.924,0l38.525,38.515l-42,42.002l29.913,0l27.049,-27.046l27.05,27.046l29.9,0Z" style="fill:none;"/><path id="path5086" d="M0,2.069l75.033,0l0,16.489l-51.629,0l0,14.931l40.258,0l0,16.495l-40.258,0l0,16.05l53.124,0l0,16.488l-76.528,0l0,-80.453"
24
+ style="fill:${computedThemes.value["dashboardTheme"].colors["on-secondary"]};fill-rule:nonzero;"/><path id="path5088" d="M0,2.069l75.033,0l0,16.489l-51.629,0l0,14.931l40.258,0l0,16.495l-40.258,0l0,16.05l53.124,0l0,16.488l-76.528,0l0,-80.453Z" style="fill:none;"/></g></svg>`;
25
+ const base64Logo = btoa(eoxLogo);
26
+ </script>
27
+ <style scoped lang="scss">
28
+ .eodash-overlay {
29
+ position: fixed;
30
+ top: 0;
31
+ left: 0;
32
+ width: 100%;
33
+ height: 100%;
34
+ font-size: 0.7em;
35
+ font-weight: bold;
36
+ background: linear-gradient(
37
+ 181deg,
38
+ transparent 97%,
39
+ rgba(var(--v-theme-secondary), 0.5)
40
+ );
41
+ z-index: 9999;
42
+ pointer-events: none;
43
+ p {
44
+ position: absolute;
45
+ bottom: -4px;
46
+ left: 95px;
47
+ transform: translate(-50%, -50%);
48
+ color: rgba(var(--v-theme-on-secondary), 1);
49
+ }
50
+ a {
51
+ pointer-events: all;
52
+ text-decoration: dashed;
53
+ color: rgba(var(--v-theme-on-secondary), 1);
54
+ }
55
+ }
56
+ </style>
@@ -4,23 +4,11 @@
4
4
  :height="mdAndDown ? '48px' : 'auto'"
5
5
  color="secondary"
6
6
  app
7
- class="d-flex justify-space-between"
7
+ class="d-flex justify-end"
8
8
  >
9
9
  <p class="pt-0 footer-text">
10
10
  {{ eodash.brand.footerText ?? "" }}
11
11
  </p>
12
- <div>
13
- <a
14
- href="https://github.com/eodash/eodash"
15
- class="text-white"
16
- target="_blank"
17
- >eodash</a
18
- >
19
- by
20
- <a href="https://eox.at" target="_blank" class="text-white">
21
- <img :src="`data:image/svg+xml;base64,${base64Logo}`" height="11px" />
22
- </a>
23
- </div>
24
12
  </v-footer>
25
13
  </template>
26
14
  <script setup>
@@ -40,8 +28,6 @@ const footer = ref(null);
40
28
  const eodash = /** @type {import("@/types").Eodash} */ (inject(eodashKey));
41
29
 
42
30
  const { mdAndDown } = useDisplay();
43
- const eoxLogo = `<svg width="100%" height="100%" viewBox="0 0 355 85" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" xmlns:serif="http://www.serif.com/" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:1.41421;"><g id="ink_ext_XXXXXX"><path id="path5076" d="M152.986,40.52l-0.75,-0.019l-0.737,-0.056l-0.725,-0.093l-0.713,-0.127l-0.7,-0.162l-0.7,-0.196l-0.675,-0.228l-0.65,-0.261l-0.65,-0.292l-0.625,-0.319l-0.612,-0.352l-0.588,-0.377l-0.562,-0.407l-0.55,-0.431l-0.538,-0.457l-0.5,-0.481l-0.487,-0.505l-0.45,-0.528l-0.438,-0.55l-0.4,-0.57l-0.375,-0.59l-0.35,-0.609l-0.325,-0.627l-0.287,-0.645l-0.263,-0.66l-0.225,-0.676l-0.2,-0.69l-0.162,-0.704l-0.125,-0.717l-0.1,-0.728l-0.05,-0.739l-0.025,-0.748c0,-8.023 6.512,-14.532 14.537,-14.532c8.038,0 14.538,6.509 14.538,14.532c0,8.036 -6.5,14.544 -14.538,14.544Z" style="fill:none;"/><path id="path5078" d="M165.748,-0.002c-42.009,0 -76.06,18.985 -76.06,42.402c0,13.268 10.921,25.102 28.021,32.875c-8.081,-5.487 -13.403,-12.973 -14.584,-21.859c-2.685,-20.186 16.83,-40.82 45.148,-49.615c-14.687,6.665 -24.923,21.427 -24.923,38.599c0,23.218 18.648,42.046 41.773,42.383c-0.037,0.005 -0.087,0.015 -0.137,0.02c0.263,0 0.512,0.009 0.762,0.009c42.013,0 76.076,-18.984 76.076,-42.412c0,-13.261 -10.937,-25.097 -28.037,-32.871l0.75,0.522l0.736,0.531l0.713,0.543l0.7,0.555l0.687,0.566l0.664,0.578l0.649,0.588l0.625,0.6l0.613,0.609l0.588,0.621l0.574,0.631l0.562,0.643l0.538,0.652l0.513,0.662l0.5,0.672l0.475,0.684l0.449,0.693l0.438,0.703l0.425,0.713l0.387,0.723l0.375,0.73l0.352,0.74l0.336,0.75l0.3,0.76l0.287,0.77l0.264,0.777l0.25,0.787l0.211,0.795l0.188,0.805l0.175,0.812l0.151,0.82l0.125,0.831c2.675,20.19 -16.838,40.825 -45.151,49.619c14.688,-6.665 24.926,-21.426 24.926,-38.614c0,-23.202 -18.65,-42.026 -41.775,-42.367c0.05,-0.005 0.1,-0.015 0.15,-0.025c-0.262,0 -0.526,-0.01 -0.789,-0.01Zm-13.248,11.314c7.817,0 14.25,6.433 14.25,14.25c0,0.001 0,0.001 0,0.001c0,7.817 -6.433,14.249 -14.25,14.249c-7.817,0 -14.25,-6.432 -14.25,-14.249c0,-0.001 0,-0.001 0,-0.001c0,-7.817 6.433,-14.25 14.25,-14.25Z" style="fill:#fff;fill-rule:nonzero;"/><path id="path5080" d="M213.786,9.529l0.75,0.521l0.738,0.532l0.712,0.544l0.7,0.555l0.688,0.566l0.662,0.577l0.65,0.588l0.625,0.6l0.613,0.61l0.587,0.62l0.575,0.631l0.563,0.643l0.537,0.652l0.513,0.663l0.5,0.672l0.475,0.684l0.45,0.692l0.437,0.703l0.425,0.712l0.388,0.723l0.375,0.731l0.35,0.741l0.337,0.75l0.3,0.76l0.288,0.769l0.262,0.777l0.25,0.786l0.213,0.797l0.187,0.804l0.175,0.812l0.15,0.821l0.125,0.83c2.675,20.19 -16.837,40.825 -45.15,49.619c14.688,-6.665 24.925,-21.426 24.925,-38.614c0,-23.202 -18.65,-42.025 -41.775,-42.367c0.05,-0.005 0.1,-0.015 0.15,-0.025c-0.262,0 -0.525,-0.01 -0.787,-0.01c-42.01,0 -76.062,18.985 -76.062,42.402c0,13.268 10.922,25.103 28.022,32.876c-8.081,-5.487 -13.403,-12.973 -14.584,-21.859c-2.685,-20.187 16.831,-40.82 45.149,-49.615c-14.688,6.665 -24.925,21.426 -24.925,38.598c0,23.218 18.65,42.046 41.775,42.383c-0.038,0.005 -0.088,0.015 -0.138,0.02c0.263,0 0.513,0.01 0.763,0.01c42.012,-0.001 76.075,-18.985 76.075,-42.413c0,-13.261 -10.938,-25.097 -28.038,-32.871Z" style="fill:none;"/><path id="path5082" d="M354.323,82.586l-41.999,-42.002l38.524,-38.515l-29.913,0l-23.562,23.559l-23.563,-23.559l-29.924,0l38.525,38.515l-42,42.002l29.913,0l27.049,-27.046l27.05,27.046l29.9,0" style="fill:#fff;fill-rule:nonzero;"/><path id="path5084" d="M354.323,82.586l-41.999,-42.002l38.524,-38.515l-29.913,0l-23.562,23.559l-23.563,-23.559l-29.924,0l38.525,38.515l-42,42.002l29.913,0l27.049,-27.046l27.05,27.046l29.9,0Z" style="fill:none;"/><path id="path5086" d="M0,2.069l75.033,0l0,16.489l-51.629,0l0,14.931l40.258,0l0,16.495l-40.258,0l0,16.05l53.124,0l0,16.488l-76.528,0l0,-80.453" style="fill:#fff;fill-rule:nonzero;"/><path id="path5088" d="M0,2.069l75.033,0l0,16.489l-51.629,0l0,14.931l40.258,0l0,16.495l-40.258,0l0,16.05l53.124,0l0,16.488l-76.528,0l0,-80.453Z" style="fill:none;"/></g></svg>`;
44
- const base64Logo = window.btoa(eoxLogo);
45
31
  </script>
46
32
  <style scoped>
47
33
  .footer-text {
@@ -1,6 +1,6 @@
1
1
  <template>
2
2
  <v-app-bar color="primary">
3
- <v-app-bar-title>{{ title }}</v-app-bar-title>
3
+ <v-app-bar-title class="header">{{ title }}</v-app-bar-title>
4
4
  <v-img class="mx-12 logo" :src="eodash.brand?.logo" />
5
5
  </v-app-bar>
6
6
  </template>
@@ -4,6 +4,7 @@
4
4
  <component
5
5
  id="bg-widget"
6
6
  v-if="bgWidget?.component"
7
+ :key="bgWidget.id"
7
8
  :is="bgWidget.component"
8
9
  v-bind="bgWidget.props"
9
10
  ></component>
@@ -47,11 +47,22 @@ const useTemplate = () => {
47
47
  }
48
48
 
49
49
  const templateConfig = eodash.templates[template];
50
- [definedTemplate.bgWidget] = useDefineWidgets([
50
+ const [importedBgWidget] = useDefineWidgets([
51
51
  templateConfig.background,
52
52
  ]);
53
+ if (importedBgWidget.value.id !== definedTemplate.bgWidget.value?.id) {
54
+ definedTemplate.bgWidget.value = importedBgWidget.value;
55
+ }
56
+
57
+ const [importedLoadingWidget] = useDefineWidgets([
58
+ templateConfig.loading,
59
+ ]);
53
60
 
54
- [definedTemplate.loading] = useDefineWidgets([templateConfig.loading]);
61
+ if (
62
+ importedLoadingWidget.value.id !== definedTemplate.loading.value?.id
63
+ ) {
64
+ definedTemplate.loading.value = importedLoadingWidget.value;
65
+ }
55
66
 
56
67
  definedTemplate.importedWidgets = useDefineWidgets(
57
68
  templateConfig.widgets,
@@ -111,11 +111,16 @@ const getWidgetDefinition = (config) => {
111
111
  switch (config?.type) {
112
112
  case "internal":
113
113
  importedWidget.component = defineAsyncComponent({
114
- loader:
115
- internalWidgets[
114
+ loader: () => {
115
+ const widgetName =
116
116
  /** @type {import("@/types").InternalComponentWidget} * */ (config)
117
- ?.widget.name
118
- ],
117
+ ?.widget.name;
118
+
119
+ return (
120
+ internalWidgets[widgetName]?.() ??
121
+ Promise.reject(`Widget ${widgetName} not found`)
122
+ );
123
+ },
119
124
  suspensible: true,
120
125
  });
121
126
  importedWidget.props = reactive(
@@ -106,7 +106,7 @@ const createLayersConfig = async (
106
106
  await EodashCollection.getIndicatorLayers(selectedIndicator);
107
107
  const geodbLayer = EodashCollection.getGeoDBLayer(eodashCols);
108
108
  if (geodbLayer) {
109
- dataLayers.layers.push(geodbLayer);
109
+ dataLayers.layers.unshift(geodbLayer);
110
110
  }
111
111
  const baseLayers = {
112
112
  type: "Group",
@@ -377,3 +377,4 @@ export const useUpdateTooltipProperties = (eodashCols, tooltipProperties) => {
377
377
  log.debug("Updated tooltip properties", tooltipProperties.value);
378
378
  });
379
379
  };
380
+
@@ -10,16 +10,27 @@ import { reactive } from "vue";
10
10
  export const eodash = reactive({
11
11
  id: "demo",
12
12
  stacEndpoint:
13
- // "https://eurodatacube.github.io/eodash-catalog/RACE/catalog.json",
13
+ "https://esa-eodash.github.io/RACE-catalog/RACE/catalog.json",
14
14
  // "https://gtif-cerulean.github.io/catalog/cerulean/catalog.json",
15
15
  // "https://eodashcatalog.eox.at/samplecatalog/samples/catalog.json",
16
16
  // "https://eodashcatalog.eox.at/test-style/trilateral/catalog.json",
17
17
  // "https://gtif-cerulean.github.io/catalog/cerulean/catalog.json",
18
18
  // "https://gtif-cerulean.github.io/deside-catalog/deside/catalog.json",
19
- "https://gtif-cerulean.github.io/cerulean-catalog/cerulean/catalog.json",
19
+ // "https://gtif-cerulean.github.io/cerulean-catalog/cerulean/catalog.json",
20
+ // "https://gtif-austria.github.io/public-catalog/GTIF-Austria/catalog.json",
20
21
  brand: {
21
22
  noLayout: true,
22
23
  name: "Demo",
24
+ font: {
25
+ headers: {
26
+ family: "Open Sans",
27
+ link: "https://eox.at/fonts/opensans/opensans.css",
28
+ },
29
+ body: {
30
+ family: "Sintony",
31
+ link: "https://eox.at/fonts/sintony/sintony.css",
32
+ },
33
+ },
23
34
  theme: {
24
35
  colors: {
25
36
  primary: "#002742",
@@ -64,7 +75,7 @@ export const eodash = reactive({
64
75
  },
65
76
  },
66
77
  background: {
67
- id: Symbol(),
78
+ id: "background-map",
68
79
  type: "internal",
69
80
  widget: {
70
81
  name: "EodashMap",
@@ -186,7 +197,7 @@ export const eodash = reactive({
186
197
  },
187
198
  },
188
199
  background: {
189
- id: Symbol(),
200
+ id: "background-map",
190
201
  type: "internal",
191
202
  widget: {
192
203
  name: "EodashMap",
@@ -237,10 +248,6 @@ export const eodash = reactive({
237
248
  type: "internal",
238
249
  widget: {
239
250
  name: "EodashStacInfo",
240
- properties: {
241
- showIndicatorsBtn: false,
242
- showLayoutSwitcher: false,
243
- },
244
251
  },
245
252
  }
246
253
  : null;
@@ -252,7 +259,7 @@ export const eodash = reactive({
252
259
  ? {
253
260
  id: "Datepicker",
254
261
  type: "internal",
255
- layout: { x: 5, y: 8, w: 2, h: 4 },
262
+ layout: { x: 5, y: 11, w: 2, h: 1 },
256
263
  title: "Date",
257
264
  widget: {
258
265
  name: "EodashDatePicker",
@@ -288,7 +295,7 @@ export const eodash = reactive({
288
295
  id: "Processes",
289
296
  type: "internal",
290
297
  title: "Processes",
291
- layout: { x: 9, y: 7, w: 3, h: 5 },
298
+ layout: { x: 9, y: 6, w: 3, h: 5 },
292
299
  widget: {
293
300
  name: "EodashProcess",
294
301
  },
@@ -315,7 +322,7 @@ export const eodash = reactive({
315
322
  },
316
323
  },
317
324
  background: {
318
- id: Symbol(),
325
+ id: "background-map",
319
326
  type: "internal",
320
327
  widget: {
321
328
  name: "EodashMap",
@@ -17,6 +17,7 @@ import {
17
17
  import { createLayersFromAssets, createLayersFromLinks } from "./createLayers";
18
18
  import axios from "@/plugins/axios";
19
19
  import log from "loglevel";
20
+ import { dataThemesBrands } from "@/utils/states";
20
21
 
21
22
  export class EodashCollection {
22
23
  #collectionUrl = "";
@@ -407,46 +408,80 @@ export class EodashCollection {
407
408
  continue;
408
409
  }
409
410
  const collectionFeatures = generateFeatures(
410
- collection.#collectionStac?.links,
411
+ JSON.parse(JSON.stringify(collection.#collectionStac?.links)),
412
+ {
413
+ collection_id: collection.#collectionStac?.id,
414
+ geoDBID: collection.#collectionStac?.geoDBID,
415
+ themes: collection.#collectionStac?.themes ?? [],
416
+ },
411
417
  ).features;
418
+
412
419
  if (collectionFeatures.length) {
413
- allFeatures.push(
414
- generateFeatures(collection.#collectionStac?.links).features,
415
- );
420
+ allFeatures.push(collectionFeatures);
416
421
  }
417
422
  }
418
- if (allFeatures.length) {
419
- const featureCollection = {
420
- type: "FeatureCollection",
421
- crs: {
422
- type: "name",
423
- properties: {
424
- name: "EPSG:4326",
425
- },
426
- },
427
- features: allFeatures.flat(),
428
- };
429
- return {
430
- type: "Vector",
423
+ if (!allFeatures.length) {
424
+ return null;
425
+ }
426
+
427
+ const featureCollection = {
428
+ type: "FeatureCollection",
429
+ crs: {
430
+ type: "name",
431
431
  properties: {
432
- id: "geodb-collection",
433
- title: "GeoDB Collection",
434
- },
435
- source: {
436
- type: "Vector",
437
- url: "data:," + encodeURIComponent(JSON.stringify(featureCollection)),
438
- format: "GeoJSON",
432
+ name: "EPSG:4326",
439
433
  },
440
- style: {
441
- "circle-radius": 5,
442
- "circle-fill-color": "#00417077",
443
- "circle-stroke-color": "#004170",
444
- "fill-color": "#00417077",
445
- "stroke-color": "#004170",
446
- },
447
- interactions: [],
448
- };
449
- }
450
- return null;
434
+ },
435
+ features: allFeatures.flat(),
436
+ };
437
+ return {
438
+ type: "Vector",
439
+ properties: {
440
+ id: "geodb-collection",
441
+ title: "Observation Points",
442
+ },
443
+ source: {
444
+ type: "Vector",
445
+ url: "data:," + encodeURIComponent(JSON.stringify(featureCollection)),
446
+ format: "GeoJSON",
447
+ },
448
+ style: (() => {
449
+ // generate flat style rules for each theme
450
+ /** @param {*} theme */
451
+ const generateIconSrc = (theme) => {
452
+ const svgString = `
453
+ <svg xmlns="http://www.w3.org/2000/svg" width="40" height="40" viewBox="0 0 70 70">
454
+ <circle cx="35" cy="35" r="30" stroke="white" fill="${theme.color}" stroke-width="4"/>
455
+ <path d="${theme.icon}" fill="#fff" transform="translate(19.5, 20) scale(1.3) "/>
456
+ </svg>
457
+ `;
458
+ return `data:image/svg+xml,${encodeURIComponent(svgString)}`;
459
+ };
460
+
461
+ return [
462
+ ...Object.keys(dataThemesBrands).map((theme, idx) => {
463
+ return {
464
+ ...(idx !== 0 && { else: true }),
465
+ filter: ["==", ["get", "themes", 0], theme],
466
+ style: {
467
+ //@ts-expect-error string index
468
+ "icon-src": generateIconSrc(dataThemesBrands[theme]),
469
+ },
470
+ };
471
+ }),
472
+ {
473
+ else: true,
474
+ style: {
475
+ "circle-radius": 10,
476
+ "circle-fill-color": "#00417077",
477
+ "circle-stroke-color": "#004170",
478
+ "fill-color": "#0417077",
479
+ "stroke-color": "#004170",
480
+ },
481
+ },
482
+ ];
483
+ })(),
484
+ interactions: [],
485
+ };
451
486
  }
452
487
  }
@@ -36,6 +36,7 @@ export async function createLayersFromAssets(
36
36
  let geoTIFFIdx = null;
37
37
  // let geoJsonLayers = [];
38
38
  let geoJsonIdx = 0;
39
+ let geoJsonAttributions = [];
39
40
 
40
41
  const geoJsonSources = [];
41
42
  let geoJsonRoles = {};
@@ -50,6 +51,8 @@ export async function createLayersFromAssets(
50
51
  if (assets[ast]?.type === "application/geo+json") {
51
52
  geoJsonSources.push(assets[ast].href);
52
53
  geoJsonIdx = idx;
54
+ if (assets[ast].attribution)
55
+ geoJsonAttributions.push(assets[ast].attribution);
53
56
  extractRoles(geoJsonRoles, assets[ast]);
54
57
  } else if (assets[ast]?.type === "application/vnd.flatgeobuf") {
55
58
  const assetId = createAssetID(collectionId, item.id, idx);
@@ -61,6 +64,7 @@ export async function createLayersFromAssets(
61
64
  type: "FlatGeoBuf",
62
65
  url: assets[ast].href,
63
66
  format: "GeoJSON",
67
+ attributions: assets[ast].attribution,
64
68
  },
65
69
  properties: {
66
70
  id: assetId,
@@ -74,11 +78,12 @@ export async function createLayersFromAssets(
74
78
  }),
75
79
  },
76
80
  ...(!style?.variables && { style }),
81
+ interactions: [],
77
82
  };
78
83
  // add tooltip interaction if style has tooltip
79
84
  if (style?.tooltip) {
80
- // @ts-expect-error no type for eox-map layer
81
85
  layer.interactions = [
86
+ // @ts-expect-error no type for eox-map layer
82
87
  {
83
88
  type: "select",
84
89
  options: {
@@ -98,9 +103,18 @@ export async function createLayersFromAssets(
98
103
  layer.properties = { ...layer.properties, ...(extraProperties ?? {}) };
99
104
 
100
105
  jsonArray.push(layer);
106
+ const layer2 = structuredClone(layer)
107
+ // temporary solution to avoid selection of the same layer
108
+ // to be removed
109
+ layer2.interactions = []
110
+ layer2.properties.id = layer2.properties.id + "_selection"
111
+ jsonArray.push(layer2)
101
112
  } else if (assets[ast]?.type === "image/tiff") {
102
113
  geoTIFFIdx = idx;
103
- geoTIFFSources.push({ url: assets[ast].href });
114
+ geoTIFFSources.push({
115
+ url: assets[ast].href,
116
+ attributions: assets[ast].attribution,
117
+ });
104
118
  }
105
119
  }
106
120
 
@@ -114,6 +128,7 @@ export async function createLayersFromAssets(
114
128
  type: "Vector",
115
129
  url: await mergeGeojsons(geoJsonSources),
116
130
  format: "GeoJSON",
131
+ attributions: geoJsonAttributions,
117
132
  },
118
133
  properties: {
119
134
  ...geoJsonRoles,
@@ -227,6 +242,7 @@ export const createLayersFromLinks = async (
227
242
  tileGrid: {
228
243
  tileSize,
229
244
  },
245
+ attributions: wmsLink.attribution,
230
246
  params: {
231
247
  LAYERS: wmsLink["wms:layers"],
232
248
  TILED: true,
@@ -297,6 +313,7 @@ export const createLayersFromLinks = async (
297
313
  tileGrid: {
298
314
  tileSize: [128, 128],
299
315
  },
316
+ attributions: wmtsLink.attribution,
300
317
  dimensions: dimensionsWithoutStyle,
301
318
  },
302
319
  };
@@ -322,6 +339,7 @@ export const createLayersFromLinks = async (
322
339
  tileGrid: {
323
340
  tileSize: [512, 512],
324
341
  },
342
+ attributions: wmtsLink.attribution,
325
343
  dimensions: dimensionsWithoutStyle,
326
344
  },
327
345
  };
@@ -359,6 +377,7 @@ export const createLayersFromLinks = async (
359
377
  type: "XYZ",
360
378
  url: xyzLink.href,
361
379
  projection: projectionCode,
380
+ attributions: xyzLink.attribution,
362
381
  },
363
382
  };
364
383
 
@@ -3,8 +3,11 @@ import axios from "@/plugins/axios";
3
3
  import log from "loglevel";
4
4
  import { getStyleVariablesState } from "./triggers.js";
5
5
 
6
- /** @param {import("stac-ts").StacLink[]} [links] */
7
- export function generateFeatures(links) {
6
+ /**
7
+ * @param {import("stac-ts").StacLink[]} [links]
8
+ * @param {Record<string,any>} [extraProperties]
9
+ **/
10
+ export function generateFeatures(links, extraProperties = {}) {
8
11
  /**
9
12
  * @type {import("geojson").Feature[]}
10
13
  */
@@ -20,7 +23,7 @@ export function generateFeatures(links) {
20
23
  type: "Point",
21
24
  coordinates: [lon, lat],
22
25
  },
23
- properties: { id: element.id },
26
+ properties: { ...element, ...extraProperties },
24
27
  });
25
28
  }
26
29
  });
@@ -115,9 +118,8 @@ export const extractRoles = (properties, linkOrAsset) => {
115
118
  if (role === "overlay" || role === "baselayer") {
116
119
  properties.group = role;
117
120
  }
118
-
119
- return properties;
120
121
  });
122
+ return properties;
121
123
  };
122
124
 
123
125
  /**
@@ -14,7 +14,7 @@ export interface WebComponentProps<T extends ExecutionTime = "compiletime"> {
14
14
  * import maps are not available in runtime config
15
15
  * :::
16
16
  */
17
- link: T extends "runtime" ? string : string | (() => Promise<unknown>);
17
+ link?: T extends "runtime" ? string : string | (() => Promise<unknown>);
18
18
  /**
19
19
  * Exported Constructor, needs to be provided if the web component is not
20
20
  * registered in by the [link](#link) provided
@@ -194,7 +194,15 @@ export type StacEndpoint = `${string}/catalog.json`;
194
194
 
195
195
  /** @group Eodash */
196
196
  type ExecutionTime = "runtime" | "compiletime";
197
-
197
+ type EodashFont = {
198
+ /**
199
+ * Link to stylesheet that defines font-face. Could be either a relative
200
+ * or absolute URL.
201
+ */
202
+ link?: string;
203
+ /** Font family name. */
204
+ family: string;
205
+ };
198
206
  /**
199
207
  * Eodash instance API
200
208
  *
@@ -212,15 +220,12 @@ export type Eodash<T extends ExecutionTime = "compiletime"> = {
212
220
  /** Custom error message to alert the users if something crashes */
213
221
  errorMessage?: string;
214
222
  /** Fetches the specified font family from the specified `link` property. */
215
- font?: {
216
- /**
217
- * Link to stylesheet that defines font-face. Could be either a relative
218
- * or absolute URL.
219
- */
220
- link: string;
221
- /** Font family name. */
222
- family: string;
223
- };
223
+ font?:
224
+ | EodashFont
225
+ | {
226
+ body: EodashFont;
227
+ headers: EodashFont;
228
+ };
224
229
  /** Title that will be shown in the app header */
225
230
  name: string;
226
231
  /** Brand logo */
@@ -320,8 +325,8 @@ export declare const store: typeof import("@/store").default;
320
325
  export * from "./main.js";
321
326
 
322
327
  export type EodashStyleJson = import("ol/style/webgl.js").WebGLStyle & {
323
- variables?: Record<string, any>;
324
- legend?: Record<string, any>;
328
+ variables?: Record<string, string | number | boolean | null | undefined>;
329
+ legend?: import("@eox/layercontrol/src/components/layer-config.js").EOxLayerControlLayerConfig["layerConfig"]["legend"];
325
330
  jsonform?: Record<string, any>;
326
331
  tooltip?: { id: string; title?: string; appendix?: string }[];
327
332
  };