@eodash/eodash 5.6.0 → 5.7.0

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 (91) hide show
  1. package/core/client/components/DashboardLayout.vue +1 -1
  2. package/core/client/composables/index.js +6 -2
  3. package/core/client/eodashSTAC/EodashCollection.js +5 -21
  4. package/core/client/eodashSTAC/createLayers.js +23 -9
  5. package/core/client/eodashSTAC/helpers.js +37 -4
  6. package/core/client/types.ts +8 -1
  7. package/core/client/utils/index.js +4 -0
  8. package/dist/client/{DashboardLayout-DkKDhfgH.js → DashboardLayout-kRsmsNW5.js} +5 -5
  9. package/dist/client/{DynamicWebComponent-BrpkA-e3.js → DynamicWebComponent-CnKhYo0K.js} +1 -1
  10. package/dist/client/{EodashChart-p7_1FRlF.js → EodashChart-CLDqE93C.js} +4 -4
  11. package/dist/client/{EodashDatePicker-HK0Jl7wQ.js → EodashDatePicker-CMPDT-ce.js} +3 -3
  12. package/dist/client/{EodashItemFilter-BYQDA78B.js → EodashItemFilter-BpdA8QQa.js} +1 -1
  13. package/dist/client/{EodashLayerControl-NcrNncGn.js → EodashLayerControl-BHpDA4_0.js} +25 -7
  14. package/dist/client/{EodashLayoutSwitcher-CC2Znd0I.js → EodashLayoutSwitcher-B1fRUt7G.js} +3 -3
  15. package/dist/client/EodashMapBtns-Cpned0tc.js +478 -0
  16. package/dist/client/{EodashStacInfo-BA-0UjvT.js → EodashStacInfo-BQspAHKH.js} +31 -31
  17. package/dist/client/{EodashTools-CWmoH0g_.js → EodashTools-1zHz26gv.js} +4 -4
  18. package/dist/client/{ExportState-CfAfX4RN.js → ExportState-DbOm8hBI.js} +4 -4
  19. package/dist/client/{Footer-DLGxQTZt.js → Footer-BKg-VVkj.js} +1 -1
  20. package/dist/client/{Header-eyEyyzD6.js → Header-DCrwCvmY.js} +2 -2
  21. package/dist/client/MobileLayout-vWSHpluo.js +118 -0
  22. package/dist/client/{PopUp-WNs6Io2N.js → PopUp-9uimfK49.js} +2 -2
  23. package/dist/client/{ProcessList-RzVqbd5E.js → ProcessList-CTTIZa06.js} +4 -4
  24. package/dist/client/{VImg-GKUTFoV-.js → VImg-CrmB76ZY.js} +2 -2
  25. package/dist/client/{VMain-D7_72mHr.js → VMain-OKZNpcEG.js} +1 -1
  26. package/dist/client/{VTooltip-BbmvtvYw.js → VTooltip-CJw2FyWk.js} +2 -2
  27. package/dist/client/{WidgetsContainer-Dw5d7SOW.js → WidgetsContainer-BaWOnE5R.js} +1 -1
  28. package/dist/client/{asWebComponent-DDt7V3Bl.js → asWebComponent-BHWpMuE3.js} +47 -35
  29. package/dist/client/{async-CT3KEV52.js → async-DSKj6g1f.js} +29 -28
  30. package/dist/client/create-layers-config-CBoYedqB.js +182 -0
  31. package/dist/client/eo-dash.js +1 -1
  32. package/dist/client/{forwardRefs-CVzxyoSq.js → forwardRefs-DH51zPUr.js} +2 -2
  33. package/dist/client/{handling-C285F_Mq.js → handling-BrcDDlgS.js} +452 -114
  34. package/dist/client/{helpers-CZFH0EVN.js → helpers-DjZVl_WF.js} +2277 -1504
  35. package/dist/client/{index-B-m7V3Kb.js → index-1JKE68n3.js} +49 -194
  36. package/dist/client/{index-CF3ZMzTz.js → index-5Jhsa8Xe.js} +3 -3
  37. package/dist/client/index-CSG_JoOA.js +436 -0
  38. package/dist/client/{index-DgOXD7wd.js → index-CUjl-ZsI.js} +2 -2
  39. package/dist/client/{index-B_6H-N14.js → index-Cu3-13Xg.js} +84 -90
  40. package/dist/client/material-symbols-outlined.woff2 +0 -0
  41. package/dist/client/material-symbols-rounded.woff2 +0 -0
  42. package/dist/client/material-symbols-sharp.woff2 +0 -0
  43. package/dist/client/material-symbols-subset.woff2 +0 -0
  44. package/dist/client/templates.js +1 -1
  45. package/dist/client/{transition-C2gnrWg0.js → transition-OHcz5Qq1.js} +1 -1
  46. package/dist/node/cli.js +1 -1
  47. package/dist/types/core/client/composables/index.d.ts +1 -3
  48. package/dist/types/core/client/eodashSTAC/EodashCollection.d.ts +6 -7
  49. package/dist/types/core/client/eodashSTAC/createLayers.d.ts +3 -3
  50. package/dist/types/core/client/eodashSTAC/helpers.d.ts +1 -0
  51. package/dist/types/core/client/types.d.ts +8 -1
  52. package/dist/types/templates/baseConfig.d.ts +12 -0
  53. package/dist/types/widgets/EodashLayerControl.vue.d.ts +1 -1
  54. package/dist/types/widgets/EodashMap/EodashMapBtns.vue.d.ts +9 -0
  55. package/dist/types/widgets/EodashMap/index.vue.d.ts +7 -0
  56. package/dist/types/widgets/EodashMap/methods/create-layers-config.d.ts +1 -8
  57. package/dist/types/widgets/EodashProcess/methods/composables.d.ts +2 -3
  58. package/dist/types/widgets/EodashProcess/methods/handling.d.ts +15 -10
  59. package/dist/types/widgets/EodashProcess/methods/outputs.d.ts +3 -1
  60. package/dist/types/widgets/EodashProcess/methods/template-helpers.d.ts +99 -0
  61. package/dist/types/widgets/EodashProcess/methods/utils.d.ts +1 -6
  62. package/dist/types/widgets/EodashProcess/types.d.ts +1 -0
  63. package/dist/types/widgets/EodashStacInfo.vue.d.ts +10 -10
  64. package/dist/types/widgets/EodashTimeSlider/index.vue.d.ts +34 -0
  65. package/dist/types/widgets/EodashTimeSlider/methods/index.d.ts +39 -0
  66. package/dist/types/widgets/EodashTimeSlider/types.d.ts +62 -0
  67. package/package.json +32 -32
  68. package/widgets/EodashLayerControl.vue +22 -3
  69. package/widgets/EodashMap/EodashMapBtns.vue +46 -1
  70. package/widgets/EodashMap/index.vue +17 -5
  71. package/widgets/EodashMap/methods/create-layers-config.js +2 -0
  72. package/widgets/EodashMap/methods/index.js +23 -5
  73. package/widgets/EodashProcess/index.vue +17 -13
  74. package/widgets/EodashProcess/methods/async.js +19 -8
  75. package/widgets/EodashProcess/methods/composables.js +63 -74
  76. package/widgets/EodashProcess/methods/custom-endpoints/chart/sentinelhub-endpoint.js +9 -5
  77. package/widgets/EodashProcess/methods/custom-endpoints/chart/veda-endpoint.js +7 -4
  78. package/widgets/EodashProcess/methods/handling.js +125 -76
  79. package/widgets/EodashProcess/methods/outputs.js +74 -29
  80. package/widgets/EodashProcess/methods/template-helpers.js +246 -0
  81. package/widgets/EodashProcess/methods/utils.js +7 -17
  82. package/widgets/EodashProcess/types.ts +1 -0
  83. package/widgets/EodashStacInfo.vue +30 -30
  84. package/widgets/EodashTimeSlider/index.vue +152 -0
  85. package/widgets/EodashTimeSlider/methods/index.js +279 -0
  86. package/widgets/EodashTimeSlider/types.ts +64 -0
  87. package/dist/client/EodashMapBtns-BJSh7qT-.js +0 -435
  88. package/dist/client/EodashTimeSlider-GDv1hbw7.js +0 -53
  89. package/dist/client/MobileLayout-RzLOyXwL.js +0 -118
  90. package/dist/types/widgets/EodashTimeSlider.vue.d.ts +0 -15
  91. package/widgets/EodashTimeSlider.vue +0 -40
@@ -4,12 +4,21 @@ import axios from "@/plugins/axios";
4
4
  import { createTiffLayerDefinition, separateEndpointLinks } from "./utils";
5
5
  import { useSTAcStore } from "@/store/stac";
6
6
  import { isFirstLoad } from "@/utils/states";
7
+ import {
8
+ getMultiQueryMatches,
9
+ getPostMultiQueryValues,
10
+ getScalarMultiQueryValues,
11
+ createMultiQueryContext,
12
+ aggregateInlineResponses,
13
+ renderJsonBodyTemplate,
14
+ } from "./template-helpers";
7
15
 
8
16
  ////// --- CHARTS --- //////
9
17
  /**
10
18
  * @param {object} options
11
19
  * @param {import("stac-ts").StacLink[] | undefined} options.links
12
20
  * @param {Record<string,any> | undefined} options.jsonformValue
21
+ * @param {Record<string,any> | undefined} [options.rawJsonformValue]
13
22
  * @param {string} options.specUrl
14
23
  * @param {(input:import("^/EodashProcess/types").CustomEnpointInput)=>Promise<Record<string,any>[] | undefined | null>} [options.customEndpointsHandler]
15
24
  * @param {import("vue").Ref<boolean>} options.isPolling
@@ -22,6 +31,7 @@ import { isFirstLoad } from "@/utils/states";
22
31
  export async function processCharts({
23
32
  links,
24
33
  jsonformValue,
34
+ rawJsonformValue,
25
35
  specUrl,
26
36
  customEndpointsHandler,
27
37
  jsonformSchema,
@@ -51,6 +61,7 @@ export async function processCharts({
51
61
  (await customEndpointsHandler({
52
62
  jsonformSchema,
53
63
  jsonformValue,
64
+ rawJsonformValue,
54
65
  links: endpointLinks,
55
66
  selectedStac,
56
67
  isPolling,
@@ -114,6 +125,7 @@ export async function processCharts({
114
125
  await injectVegaInlineData(spec, {
115
126
  url: link.href,
116
127
  jsonformValue: jsonformValue,
128
+ rawJsonformValue,
117
129
  link: link,
118
130
  flatstyleUrl: /** @type string */ (link["eox:flatstyle"]),
119
131
  jsonformSchema,
@@ -153,46 +165,39 @@ export async function processCharts({
153
165
  * @param {object} injectables
154
166
  * @param {string} injectables.url
155
167
  * @param {Record<string,any>} [injectables.jsonformValue]
168
+ * @param {Record<string,any>} [injectables.rawJsonformValue]
156
169
  * @param {import("stac-ts").StacLink} injectables.link
157
170
  * @param {url} [injectables.flatstyleUrl]
158
171
  * @param {import("json-schema").JSONSchema7} [injectables.jsonformSchema]
159
172
  */
160
173
  async function injectVegaInlineData(
161
174
  spec,
162
- { url, jsonformValue, link, flatstyleUrl, jsonformSchema },
175
+ { url, jsonformValue, rawJsonformValue, link, flatstyleUrl, jsonformSchema },
163
176
  ) {
164
177
  if (!spec.data) {
165
178
  return;
166
179
  }
180
+ // @ts-expect-error JSONSchema7 is structurally compatible with Record<string, any>
181
+ const multiQueryMatches = getMultiQueryMatches(jsonformValue, jsonformSchema);
167
182
  if (link.method == "GET") {
168
- // we see if any of the multiQuery values match an array in the jsonformValue
169
- // and if so, we can do multiple requests and merge all data together.
170
- //@ts-expect-error type jsonform Schema
171
- const multiQuery = jsonformSchema?.options?.multiQuery;
172
- const matches = Object.keys(jsonformValue ?? {}).filter((key) => {
173
- return Array.isArray(multiQuery)
174
- ? multiQuery.includes(key)
175
- : multiQuery === key;
176
- });
177
- if (matches.length > 0 && jsonformValue) {
183
+ if (multiQueryMatches.length > 0 && jsonformValue) {
178
184
  const dataValues = [];
179
- for (const match of matches) {
180
- if (Array.isArray(jsonformValue[match])) {
181
- for (const value of jsonformValue[match]) {
182
- const dataUrl = await renderDataUrl(
183
- url,
184
- { ...jsonformValue, [match]: value },
185
- flatstyleUrl,
186
- );
187
- dataValues.push(await axios.get(dataUrl).then((resp) => resp.data));
188
- }
189
- } else {
190
- const dataUrl = await renderDataUrl(url, jsonformValue, flatstyleUrl);
185
+ for (const match of multiQueryMatches) {
186
+ const queryValues = getScalarMultiQueryValues(match, jsonformValue);
187
+ if (!queryValues.length) {
188
+ continue;
189
+ }
190
+ for (const value of queryValues) {
191
+ const dataUrl = await renderDataUrl(
192
+ url,
193
+ { ...jsonformValue, [match]: value },
194
+ flatstyleUrl,
195
+ );
191
196
  dataValues.push(await axios.get(dataUrl).then((resp) => resp.data));
192
197
  }
193
198
  }
194
199
  /** @type {import("vega-lite/build/src/data").InlineData} */
195
- (spec.data).values = dataValues.flat();
200
+ (spec.data).values = aggregateInlineResponses(dataValues);
196
201
  return spec;
197
202
  }
198
203
  // if no array matches, we can just do a single request
@@ -216,11 +221,49 @@ async function injectVegaInlineData(
216
221
  .then((resp) => {
217
222
  return resp.data;
218
223
  });
219
- const body = JSON.parse(
220
- mustache.render(bodyTemplate, {
221
- ...(jsonformValue ?? {}),
222
- }),
223
- );
224
+ if (
225
+ // @ts-expect-error jsonform options extension not in JSONSchema7
226
+ jsonformSchema?.options?.multiQuery &&
227
+ multiQueryMatches.length === 0
228
+ ) {
229
+ /** @type {import("vega-lite/build/src/data").InlineData} */
230
+ (spec.data).values = [];
231
+ return spec;
232
+ }
233
+ if (multiQueryMatches.length > 0 && jsonformValue) {
234
+ const responses = [];
235
+ for (const match of multiQueryMatches) {
236
+ const queryValues = getPostMultiQueryValues(
237
+ match,
238
+ jsonformValue,
239
+ rawJsonformValue,
240
+ /** @type {Record<string, any>} */ (jsonformSchema),
241
+ );
242
+ if (!queryValues.length) {
243
+ continue;
244
+ }
245
+ // Sequential POSTs (not parallel) to avoid rate-limiting on endpoints
246
+ // like TiTiler-PgSTAC. For small selection counts this is fine; if
247
+ // parallelism is needed later, switch to Promise.all.
248
+ for (const [index, value] of queryValues.entries()) {
249
+ const requestContext = createMultiQueryContext(
250
+ jsonformValue,
251
+ match,
252
+ value,
253
+ index,
254
+ );
255
+ const body = renderJsonBodyTemplate(bodyTemplate, requestContext);
256
+ responses.push(await axios.post(url, body).then((resp) => resp.data));
257
+ }
258
+ }
259
+ /** @type {import("vega-lite/build/src/data").InlineData} */
260
+ (spec.data).values = aggregateInlineResponses(responses);
261
+ return spec;
262
+ }
263
+
264
+ const body = renderJsonBodyTemplate(bodyTemplate, {
265
+ ...(jsonformValue ?? {}),
266
+ });
224
267
  /** @type {import("vega-lite/build/src/data").InlineData} */
225
268
  (spec.data).values = await axios.post(url, body).then((resp) => {
226
269
  return resp.data;
@@ -229,6 +272,8 @@ async function injectVegaInlineData(
229
272
  return spec;
230
273
  }
231
274
 
275
+ // MultiQuery helpers and template rendering are in ./template-helpers.js
276
+
232
277
  /**
233
278
  * @param {import("vega-lite").TopLevelSpec} spec
234
279
  * @param {object} injectables
@@ -0,0 +1,246 @@
1
+ import mustache from "mustache";
2
+
3
+ /**
4
+ * Returns form value keys that match the multiQuery configuration.
5
+ * @param {Record<string, any> | undefined} jsonformValue
6
+ * @param {Record<string, any>} jsonformSchema
7
+ * @returns {string[]}
8
+ */
9
+ export function getMultiQueryMatches(jsonformValue, jsonformSchema) {
10
+ const multiQuery = jsonformSchema?.options?.multiQuery;
11
+ return Object.keys(jsonformValue ?? {}).filter((key) => {
12
+ return Array.isArray(multiQuery)
13
+ ? multiQuery.includes(key)
14
+ : multiQuery === key;
15
+ });
16
+ }
17
+
18
+ /**
19
+ * Extracts iterable scalar values for a multiQuery field.
20
+ * Wraps single values in an array; returns empty array for undefined.
21
+ * @param {string} match - The multiQuery field name
22
+ * @param {Record<string, any>} jsonformValue
23
+ * @returns {any[]}
24
+ */
25
+ export function getScalarMultiQueryValues(match, jsonformValue) {
26
+ const value = jsonformValue?.[match];
27
+ if (Array.isArray(value)) {
28
+ return value;
29
+ }
30
+ return value === undefined ? [] : [value];
31
+ }
32
+
33
+ /**
34
+ * Extracts iterable values for a POST multiQuery field.
35
+ * For GeoJSON fields, uses rawJsonformValue to get original Feature objects
36
+ * (before extractGeometries stringifies them). For scalar fields, delegates
37
+ * to getScalarMultiQueryValues.
38
+ * @param {string} match - The multiQuery field name
39
+ * @param {Record<string, any>} jsonformValue - Form values after geometry extraction
40
+ * @param {Record<string, any> | undefined} rawJsonformValue - Form values before geometry extraction
41
+ * @param {Record<string, any>} jsonformSchema
42
+ * @returns {any[]}
43
+ */
44
+ export function getPostMultiQueryValues(
45
+ match,
46
+ jsonformValue,
47
+ rawJsonformValue,
48
+ jsonformSchema,
49
+ ) {
50
+ if (jsonformSchema?.properties?.[match]?.type === "geojson") {
51
+ return getGeoJsonMultiQueryValues(rawJsonformValue?.[match]);
52
+ }
53
+ return getScalarMultiQueryValues(match, jsonformValue);
54
+ }
55
+
56
+ /**
57
+ * Extracts individual GeoJSON Feature objects from a value that may be
58
+ * a FeatureCollection, a single Feature, or an array of Features.
59
+ * Filters for valid Features with geometry and deduplicates.
60
+ * @param {any} value
61
+ * @returns {Record<string, any>[]}
62
+ */
63
+ export function getGeoJsonMultiQueryValues(value) {
64
+ if (value?.type === "FeatureCollection") {
65
+ return dedupeMultiQueryValues(
66
+ (value.features ?? []).filter(
67
+ (/** @type {any} */ feature) =>
68
+ feature?.type === "Feature" && feature.geometry,
69
+ ),
70
+ );
71
+ }
72
+ if (value?.type === "Feature") {
73
+ return [value];
74
+ }
75
+ if (Array.isArray(value)) {
76
+ return dedupeMultiQueryValues(
77
+ value.filter(
78
+ (/** @type {any} */ feature) =>
79
+ feature?.type === "Feature" && feature.geometry,
80
+ ),
81
+ );
82
+ }
83
+ return [];
84
+ }
85
+
86
+ /**
87
+ * Removes duplicate values using JSON serialization as the identity key.
88
+ * @param {any[]} values
89
+ * @returns {any[]}
90
+ */
91
+ export function dedupeMultiQueryValues(values) {
92
+ const seen = new Set();
93
+ const deduped = [];
94
+ for (const value of values ?? []) {
95
+ const key =
96
+ value && typeof value === "object"
97
+ ? JSON.stringify(value)
98
+ : String(value);
99
+ if (seen.has(key)) {
100
+ continue;
101
+ }
102
+ seen.add(key);
103
+ deduped.push(value);
104
+ }
105
+ return deduped;
106
+ }
107
+
108
+ /**
109
+ * Builds the Mustache rendering context for one multiQuery iteration.
110
+ * Spreads the full form value, overrides the matched field with the current
111
+ * iteration value, and adds a 1-based `multiQueryIndex`.
112
+ * @param {Record<string, any>} jsonformValue
113
+ * @param {string} match - The multiQuery field name being iterated
114
+ * @param {any} value - The current iteration value
115
+ * @param {number} index - Zero-based iteration index
116
+ * @returns {Record<string, any>}
117
+ */
118
+ export function createMultiQueryContext(jsonformValue, match, value, index) {
119
+ return {
120
+ ...(jsonformValue ?? {}),
121
+ [match]: value,
122
+ multiQueryIndex: index + 1,
123
+ };
124
+ }
125
+
126
+ /**
127
+ * Flattens an array of POST responses into a single values array.
128
+ * Each response that is itself an array is spread; scalars are wrapped.
129
+ * @param {any[]} values
130
+ * @returns {any[]}
131
+ */
132
+ export function aggregateInlineResponses(values) {
133
+ return values.flatMap((value) => (Array.isArray(value) ? value : [value]));
134
+ }
135
+
136
+ /**
137
+ * Renders a JSON body template string with the given context.
138
+ * Primary path: parses the template as JSON, then recursively renders each
139
+ * node (preserving object-valued placeholders as raw JSON).
140
+ * Fallback: treats the template as a Mustache string, renders, then parses.
141
+ * @param {string} bodyTemplate - JSON template string (may contain Mustache placeholders)
142
+ * @param {Record<string, any>} context - Values to substitute into the template
143
+ * @returns {any} Parsed JSON body ready for POST
144
+ */
145
+ export function renderJsonBodyTemplate(bodyTemplate, context) {
146
+ try {
147
+ const parsedTemplate = JSON.parse(bodyTemplate);
148
+ return renderTemplateNode(parsedTemplate, context);
149
+ } catch {
150
+ try {
151
+ return JSON.parse(
152
+ mustache.render(bodyTemplate, {
153
+ ...(context ?? {}),
154
+ }),
155
+ );
156
+ } catch (e) {
157
+ throw new Error(
158
+ `[eodash] Failed to render POST body template: ${e instanceof Error ? e.message : String(e)}`,
159
+ );
160
+ }
161
+ }
162
+ }
163
+
164
+ /**
165
+ * Recursively renders a parsed JSON template node with context values.
166
+ * - Arrays and objects are traversed recursively.
167
+ * - Exact placeholders (where the entire string value is `"{{path}}"` or
168
+ * `"{{{path}}}"`) are resolved to their original typed value (object, array,
169
+ * number, etc.) instead of being stringified. This is critical for embedding
170
+ * GeoJSON geometry objects in POST bodies.
171
+ * - Partial placeholders and mixed strings use standard Mustache interpolation.
172
+ * @param {any} templateNode
173
+ * @param {Record<string, any>} context
174
+ * @returns {any}
175
+ */
176
+ export function renderTemplateNode(templateNode, context) {
177
+ if (Array.isArray(templateNode)) {
178
+ return templateNode.map((value) => renderTemplateNode(value, context));
179
+ }
180
+ if (templateNode && typeof templateNode === "object") {
181
+ return Object.fromEntries(
182
+ Object.entries(templateNode).map(([key, value]) => [
183
+ mustache.render(key, context),
184
+ renderTemplateNode(value, context),
185
+ ]),
186
+ );
187
+ }
188
+ if (typeof templateNode !== "string") {
189
+ return templateNode;
190
+ }
191
+
192
+ // Detect exact placeholder: entire value is "{{path}}" or "{{{path}}}".
193
+ // Matches both double-brace {{...}} and triple-brace {{{...}}} syntax.
194
+ // When matched, the resolved value is returned as its original type (e.g. an
195
+ // object), rather than being coerced to a string by Mustache.
196
+ const exactPlaceholder = templateNode.match(
197
+ /^\{\{\{?\s*([^{}]+?)\s*\}?\}\}$/,
198
+ );
199
+ if (exactPlaceholder) {
200
+ const resolvedValue = resolveTemplatePath(context, exactPlaceholder[1]);
201
+ if (resolvedValue !== undefined) {
202
+ return cloneTemplateValue(resolvedValue);
203
+ }
204
+ }
205
+
206
+ return mustache.render(templateNode, context);
207
+ }
208
+
209
+ /**
210
+ * Resolves a dot/bracket-notation path against a context object.
211
+ * Supports paths like `"feature.geometry"` or `"list[0].name"`.
212
+ * @param {Record<string, any>} context
213
+ * @param {string} path
214
+ * @returns {any}
215
+ */
216
+ export function resolveTemplatePath(context, path) {
217
+ const segments = path
218
+ .replace(/\[(\d+)\]/g, ".$1")
219
+ .split(".")
220
+ .map((segment) => segment.trim())
221
+ .filter(Boolean);
222
+
223
+ let currentValue = context;
224
+ for (const segment of segments) {
225
+ if (currentValue === null || currentValue === undefined) {
226
+ return undefined;
227
+ }
228
+ currentValue = currentValue[segment];
229
+ }
230
+ return currentValue;
231
+ }
232
+
233
+ /**
234
+ * Deep-clones objects via JSON round-trip to prevent template rendering
235
+ * from mutating the original context values. This also strips non-JSON-
236
+ * serializable properties (e.g. OL Feature methods from drawtools),
237
+ * producing clean plain objects. Primitives pass through.
238
+ * @param {any} value
239
+ * @returns {any}
240
+ */
241
+ export function cloneTemplateValue(value) {
242
+ if (value && typeof value === "object") {
243
+ return JSON.parse(JSON.stringify(value));
244
+ }
245
+ return value;
246
+ }
@@ -500,13 +500,17 @@ export function extractAsyncResults(resultItem) {
500
500
  return extracted;
501
501
  }
502
502
 
503
- /** @param {*} jsonformSchema */
504
- export const getDrawToolsProperty = (jsonformSchema) => {
503
+ /** @param {*} jsonformSchema
504
+ * @returns { string[] }
505
+ */
506
+ export const getDrawToolsProperties = (jsonformSchema) => {
507
+ const properties = [];
505
508
  for (const property in jsonformSchema.properties) {
506
509
  if (jsonformSchema.properties[property]?.options?.drawtools) {
507
- return property;
510
+ properties.push(property);
508
511
  }
509
512
  }
513
+ return properties;
510
514
  };
511
515
 
512
516
  /**
@@ -553,17 +557,3 @@ export const applyProcessLayersToMap = (mapElement, processLayers) => {
553
557
  mapElement.layers = layers;
554
558
  }
555
559
  };
556
- /**
557
- * Updates the jsonform schema to target the compare map
558
- * @param {Record<string,any> | null | undefined} jsonformSchema
559
- */
560
- export function updateJsonformSchemaTarget(jsonformSchema) {
561
- if (!jsonformSchema) {
562
- return jsonformSchema;
563
- }
564
- const stringified = JSON.stringify(jsonformSchema).replaceAll(
565
- "eox-map#main",
566
- "eox-map#compare",
567
- );
568
- return JSON.parse(stringified);
569
- }
@@ -5,6 +5,7 @@ export interface CustomEnpointInput {
5
5
  links: StacLink[];
6
6
  jsonformSchema: Record<string, any>;
7
7
  jsonformValue: Record<string, any>;
8
+ rawJsonformValue?: Record<string, any>;
8
9
  selectedStac: StacCollection;
9
10
  isPolling?: Ref<boolean>;
10
11
  enableCompare?: boolean;
@@ -25,38 +25,38 @@ const { allowHtml, featured, footer, header, body, tags } = defineProps({
25
25
  },
26
26
 
27
27
  header: {
28
- /**
28
+ /**
29
29
  * @type {import("vue").PropType<
30
- * (string | {
31
- * key: string,
32
- * filter?: (item: any) => boolean
30
+ * (string | {
31
+ * key: string,
32
+ * filter?: (item: any) => boolean
33
33
  * })[]
34
- * >}
35
- */
34
+ * >}
35
+ */
36
36
  type: Array,
37
37
  default: () => ["title"],
38
38
  },
39
39
  tags: {
40
- /**
40
+ /**
41
41
  * @type {import("vue").PropType<
42
- * (string | {
43
- * key: string,
44
- * filter?: (item: any) => boolean
42
+ * (string | {
43
+ * key: string,
44
+ * filter?: (item: any) => boolean
45
45
  * })[]
46
- * >}
47
- */
46
+ * >}
47
+ */
48
48
  type: Array,
49
49
  default: () => ["themes"],
50
50
  },
51
51
  body: {
52
- /**
52
+ /**
53
53
  * @type {import("vue").PropType<
54
- * (string | {
55
- * key: string,
56
- * filter?: (item: any) => boolean
54
+ * (string | {
55
+ * key: string,
56
+ * filter?: (item: any) => boolean
57
57
  * })[]
58
- * >}
59
- */
58
+ * >}
59
+ */
60
60
  type: Array,
61
61
  default: () => [
62
62
  "satellite",
@@ -68,26 +68,26 @@ const { allowHtml, featured, footer, header, body, tags } = defineProps({
68
68
  ],
69
69
  },
70
70
  featured: {
71
- /**
71
+ /**
72
72
  * @type {import("vue").PropType<
73
- * (string | {
74
- * key: string,
75
- * filter?: (item: any) => boolean
73
+ * (string | {
74
+ * key: string,
75
+ * filter?: (item: any) => boolean
76
76
  * })[]
77
- * >}
78
- */
77
+ * >}
78
+ */
79
79
  type: Array,
80
80
  default: () => ["description", "providers", "assets", "links"],
81
81
  },
82
82
  footer: {
83
- /**
83
+ /**
84
84
  * @type {import("vue").PropType<
85
- * (string | {
86
- * key: string,
87
- * filter?: (item: any) => boolean
85
+ * (string | {
86
+ * key: string,
87
+ * filter?: (item: any) => boolean
88
88
  * })[]
89
- * >}
90
- */
89
+ * >}
90
+ */
91
91
  type: Array,
92
92
  default: () => ["sci:citation", "sci:doi", "sci:publication"],
93
93
  },