@disy/cadenza.js 10.2.1 → 10.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 (50) hide show
  1. package/CHANGELOG.md +19 -0
  2. package/apidoc/assets/navigation.js +1 -1
  3. package/apidoc/assets/search.js +1 -1
  4. package/apidoc/classes/AbortError.html +3 -3
  5. package/apidoc/classes/CadenzaClient.html +32 -30
  6. package/apidoc/classes/CadenzaError.html +5 -5
  7. package/apidoc/functions/cadenza.html +3 -3
  8. package/apidoc/index.html +7 -4
  9. package/apidoc/interfaces/CadenzaClientOptions.html +5 -5
  10. package/apidoc/interfaces/CadenzaEvent.html +4 -4
  11. package/apidoc/interfaces/Distance.html +2 -2
  12. package/apidoc/interfaces/ExternalLinkKey.html +4 -4
  13. package/apidoc/interfaces/Feature.html +11 -7
  14. package/apidoc/interfaces/FeatureCollection.html +5 -3
  15. package/apidoc/interfaces/Geometry.html +6 -4
  16. package/apidoc/interfaces/GeometryZoomTarget.html +3 -3
  17. package/apidoc/interfaces/PageSource.html +3 -3
  18. package/apidoc/modules.html +4 -2
  19. package/apidoc/types/CadenzaActionEvent.html +2 -2
  20. package/apidoc/types/CadenzaChangeSelectionEvent.html +2 -2
  21. package/apidoc/types/CadenzaDrillThroughEvent.html +2 -2
  22. package/apidoc/types/CadenzaEditGeometryCancelEvent.html +2 -2
  23. package/apidoc/types/CadenzaEditGeometryOkEvent.html +2 -2
  24. package/apidoc/types/CadenzaEditGeometryUpdateEvent.html +2 -2
  25. package/apidoc/types/CadenzaErrorEvent.html +2 -2
  26. package/apidoc/types/CadenzaEventByType.html +1 -1
  27. package/apidoc/types/CadenzaEventType.html +2 -2
  28. package/apidoc/types/CadenzaObjectInfoEvent.html +2 -2
  29. package/apidoc/types/CadenzaReloadEvent.html +5 -0
  30. package/apidoc/types/CadenzaSelectObjectsCancelEvent.html +2 -2
  31. package/apidoc/types/CadenzaSelectObjectsOkEvent.html +2 -2
  32. package/apidoc/types/Coordinate.html +2 -0
  33. package/apidoc/types/CustomValidityType.html +2 -2
  34. package/apidoc/types/DataType.html +2 -2
  35. package/apidoc/types/EmbeddingTargetId.html +2 -2
  36. package/apidoc/types/Extent.html +2 -2
  37. package/apidoc/types/FilterVariables.html +2 -2
  38. package/apidoc/types/GeometryType.html +2 -2
  39. package/apidoc/types/GlobalId.html +2 -2
  40. package/apidoc/types/LengthUnit.html +1 -1
  41. package/apidoc/types/OpaqueString.html +2 -2
  42. package/apidoc/types/OperationMode.html +2 -2
  43. package/apidoc/types/TablePart.html +2 -2
  44. package/apidoc/types/UiFeature.html +3 -2
  45. package/apidoc/types/WorkbookLayerPath.html +2 -2
  46. package/apidoc/types/ZoomTarget.html +2 -2
  47. package/cadenza.d.ts +103 -26
  48. package/cadenza.js +56 -16
  49. package/package.json +1 -1
  50. package/sandbox.html +34 -18
@@ -1,2 +1,2 @@
1
- <!DOCTYPE html><html class="default" lang="en"><head><meta charSet="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>ZoomTarget | Cadenza JS - v10.2.0</title><meta name="description" content="Documentation for Cadenza JS"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="../assets/style.css"/><link rel="stylesheet" href="../assets/highlight.css"/><script defer src="../assets/main.js"></script><script async src="../assets/icons.js" id="tsd-icons-script"></script><script async src="../assets/search.js" id="tsd-search-script"></script><script async src="../assets/navigation.js" id="tsd-nav-script"></script></head><body><script>document.documentElement.dataset.theme = localStorage.getItem("tsd-theme") || "os";document.body.style.display="none";setTimeout(() => app?app.showPage():document.body.style.removeProperty("display"),500)</script><header class="tsd-page-toolbar"><div class="tsd-toolbar-contents container"><div class="table-cell" id="tsd-search" data-base=".."><div class="field"><label for="tsd-search-field" class="tsd-widget tsd-toolbar-icon search no-caption"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><use href="../assets/icons.svg#icon-search"></use></svg></label><input type="text" id="tsd-search-field" aria-label="Search"/></div><div class="field"><div id="tsd-toolbar-links"><a href="https://github.com/DisyInformationssysteme/cadenza.js">Cadenza JS on GitHub</a></div></div><ul class="results"><li class="state loading">Preparing search index...</li><li class="state failure">The search index is not available</li></ul><a href="../index.html" class="title">Cadenza JS - v10.2.0</a></div><div class="table-cell" id="tsd-widgets"><a href="#" class="tsd-widget tsd-toolbar-icon menu no-caption" data-toggle="menu" aria-label="Menu"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><use href="../assets/icons.svg#icon-menu"></use></svg></a></div></div></header><div class="container container-main"><div class="col-content"><div class="tsd-page-title"><ul class="tsd-breadcrumb"><li><a href="../modules.html">Cadenza JS</a></li><li><a href="ZoomTarget.html">ZoomTarget</a></li></ul><h1>Type alias ZoomTarget</h1></div><div class="tsd-signature"><span class="tsd-kind-type-alias">Zoom<wbr/>Target</span><span class="tsd-signature-symbol">:</span> <a href="../interfaces/GeometryZoomTarget.html" class="tsd-signature-type tsd-kind-interface">GeometryZoomTarget</a></div><div class="tsd-comment tsd-typography"><p>An object describing a target to zoom to</p>
2
- </div><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/DisyInformationssysteme/cadenza.js/blob/4b55844e284ab71947e0c834856669ef7ffdd4d7/src/cadenza.js#L132">src/cadenza.js:132</a></li></ul></aside></div><div class="col-sidebar"><div class="page-menu"><div class="tsd-navigation settings"><details class="tsd-index-accordion"><summary class="tsd-accordion-summary"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Settings</h3></summary><div class="tsd-accordion-details"><div class="tsd-filter-visibility"><h4 class="uppercase">Member Visibility</h4><form><ul id="tsd-filter-options"><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-protected" name="protected"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Protected</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-private" name="private"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Private</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-inherited" name="inherited" checked/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Inherited</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-external" name="external"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>External</span></label></li></ul></form></div><div class="tsd-theme-toggle"><h4 class="uppercase">Theme</h4><select id="tsd-theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></div></div></details></div></div><div class="site-menu"><nav class="tsd-navigation"><a href="../modules.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1"></use></svg><span>Cadenza JS - v10.2.0</span></a><ul class="tsd-small-nested-navigation" id="tsd-nav-container" data-base=".."><li>Loading...</li></ul></nav></div></div></div><footer><p class="tsd-generator">Generated using <a href="https://typedoc.org/" target="_blank">TypeDoc</a></p></footer><div class="overlay"></div></body></html>
1
+ <!DOCTYPE html><html class="default" lang="en"><head><meta charSet="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>ZoomTarget | Cadenza JS - v10.2.3-dev</title><meta name="description" content="Documentation for Cadenza JS"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="../assets/style.css"/><link rel="stylesheet" href="../assets/highlight.css"/><script defer src="../assets/main.js"></script><script async src="../assets/icons.js" id="tsd-icons-script"></script><script async src="../assets/search.js" id="tsd-search-script"></script><script async src="../assets/navigation.js" id="tsd-nav-script"></script></head><body><script>document.documentElement.dataset.theme = localStorage.getItem("tsd-theme") || "os";document.body.style.display="none";setTimeout(() => app?app.showPage():document.body.style.removeProperty("display"),500)</script><header class="tsd-page-toolbar"><div class="tsd-toolbar-contents container"><div class="table-cell" id="tsd-search" data-base=".."><div class="field"><label for="tsd-search-field" class="tsd-widget tsd-toolbar-icon search no-caption"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><use href="../assets/icons.svg#icon-search"></use></svg></label><input type="text" id="tsd-search-field" aria-label="Search"/></div><div class="field"><div id="tsd-toolbar-links"><a href="https://github.com/DisyInformationssysteme/cadenza.js">Cadenza JS on GitHub</a></div></div><ul class="results"><li class="state loading">Preparing search index...</li><li class="state failure">The search index is not available</li></ul><a href="../index.html" class="title">Cadenza JS - v10.2.3-dev</a></div><div class="table-cell" id="tsd-widgets"><a href="#" class="tsd-widget tsd-toolbar-icon menu no-caption" data-toggle="menu" aria-label="Menu"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><use href="../assets/icons.svg#icon-menu"></use></svg></a></div></div></header><div class="container container-main"><div class="col-content"><div class="tsd-page-title"><ul class="tsd-breadcrumb"><li><a href="../modules.html">Cadenza JS</a></li><li><a href="ZoomTarget.html">ZoomTarget</a></li></ul><h1>Type alias ZoomTarget</h1></div><div class="tsd-signature"><span class="tsd-kind-type-alias">Zoom<wbr/>Target</span><span class="tsd-signature-symbol">:</span> <a href="../interfaces/GeometryZoomTarget.html" class="tsd-signature-type tsd-kind-interface">GeometryZoomTarget</a></div><div class="tsd-comment tsd-typography"><p>An object describing a target to zoom to</p>
2
+ </div><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/DisyInformationssysteme/cadenza.js/blob/1dba0036030d2e00a6ec752cd499709262d3e484/src/cadenza.js#L135">src/cadenza.js:135</a></li></ul></aside></div><div class="col-sidebar"><div class="page-menu"><div class="tsd-navigation settings"><details class="tsd-index-accordion"><summary class="tsd-accordion-summary"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Settings</h3></summary><div class="tsd-accordion-details"><div class="tsd-filter-visibility"><h4 class="uppercase">Member Visibility</h4><form><ul id="tsd-filter-options"><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-protected" name="protected"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Protected</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-private" name="private"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Private</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-inherited" name="inherited" checked/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Inherited</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-external" name="external"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>External</span></label></li></ul></form></div><div class="tsd-theme-toggle"><h4 class="uppercase">Theme</h4><select id="tsd-theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></div></div></details></div></div><div class="site-menu"><nav class="tsd-navigation"><a href="../modules.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1"></use></svg><span>Cadenza JS - v10.2.3-dev</span></a><ul class="tsd-small-nested-navigation" id="tsd-nav-container" data-base=".."><li>Loading...</li></ul></nav></div></div></div><footer><p class="tsd-generator">Generated using <a href="https://typedoc.org/" target="_blank">TypeDoc</a></p></footer><div class="overlay"></div></body></html>
package/cadenza.d.ts CHANGED
@@ -48,8 +48,9 @@ export class CadenzaClient {
48
48
  *
49
49
  * @param {PageSource | EmbeddingTargetId} source - The source to show
50
50
  * @param {object} [options]
51
- * @param {DataType} [options.dataType] - Set to 'pdf' for views of type "JasperReports report"
52
- * to show the report PDF directly, without any Cadenza headers or footers.
51
+ * @param {DataType} [options.dataType] - Set to 'pdf' for embedding targets of type report and of views with view
52
+ * type of "JasperReports report" to show the generated report PDF directly (without any Cadenza headers or
53
+ * footers).
53
54
  * @param {UiFeature[]} [options.disabledUiFeatures] - Cadenza UI features to disable
54
55
  * @param {boolean} [options.expandNavigator] - Indicates if the navigator should be expanded.
55
56
  * @param {FilterVariables} [options.filter] - Filter variables
@@ -205,6 +206,12 @@ export class CadenzaClient {
205
206
  * @postMessage
206
207
  */
207
208
  removeSelection(layer: WorkbookLayerPath | string, values: unknown[][], ...args: any[]): Promise<void>;
209
+ /**
210
+ * @typedef LayerDefinition
211
+ * @property {string} name - The layer's name.
212
+ * @property {'geojson'} type - The layer's type.
213
+ * @property {FeatureCollection} content - The layer's content in geojson format.
214
+ */
208
215
  /**
209
216
  * Create a geometry.
210
217
  *
@@ -214,6 +221,7 @@ export class CadenzaClient {
214
221
  * @param {EmbeddingTargetId} backgroundMapView - The workbook map view in the background
215
222
  * @param {GeometryType} geometryType - The geometry type
216
223
  * @param {object} [options] - Options
224
+ * @param {UiFeature[]} [options.disabledUiFeatures] - Cadenza UI features to disable
217
225
  * @param {FilterVariables} [options.filter] - Filter variables
218
226
  * @param {string} [options.locationFinder] - A search query for the location finder
219
227
  * @param {Extent} [options.mapExtent] - A map extent to set
@@ -221,6 +229,7 @@ export class CadenzaClient {
221
229
  * @param {boolean} [options.useMapSrs] - Whether the created geometry should use the map's SRS (otherwise EPSG:4326 will be used)
222
230
  * @param {OperationMode} [options.operationMode] - The mode in which a workbook should be operated
223
231
  * @param {AbortSignal} [options.signal] - A signal to abort the iframe loading
232
+ * @param {LayerDefinition[]} [options.additionalLayers] - Layer definitions to be imported and shown in the background, as a basis for the drawing.
224
233
  * @return {Promise<void>} A `Promise` for when the iframe is loaded
225
234
  * @throws For invalid arguments
226
235
  * @fires
@@ -229,7 +238,8 @@ export class CadenzaClient {
229
238
  * - {@link CadenzaEditGeometryCancelEvent}
230
239
  * @embed
231
240
  */
232
- createGeometry(backgroundMapView: EmbeddingTargetId, geometryType: GeometryType, { filter, locationFinder, mapExtent, minScale, useMapSrs, operationMode, signal, }?: {
241
+ createGeometry(backgroundMapView: EmbeddingTargetId, geometryType: GeometryType, { disabledUiFeatures, filter, locationFinder, mapExtent, minScale, useMapSrs, operationMode, signal, additionalLayers, }?: {
242
+ disabledUiFeatures?: UiFeature[] | undefined;
233
243
  filter?: FilterVariables | undefined;
234
244
  locationFinder?: string | undefined;
235
245
  mapExtent?: Extent | undefined;
@@ -237,6 +247,20 @@ export class CadenzaClient {
237
247
  useMapSrs?: boolean | undefined;
238
248
  operationMode?: OperationMode | undefined;
239
249
  signal?: AbortSignal | undefined;
250
+ additionalLayers?: {
251
+ /**
252
+ * - The layer's name.
253
+ */
254
+ name: string;
255
+ /**
256
+ * - The layer's type.
257
+ */
258
+ type: 'geojson';
259
+ /**
260
+ * - The layer's content in geojson format.
261
+ */
262
+ content: FeatureCollection;
263
+ }[] | undefined;
240
264
  } | undefined, ...args: any[]): Promise<void>;
241
265
  /**
242
266
  * Edit a geometry.
@@ -244,6 +268,7 @@ export class CadenzaClient {
244
268
  * @param {EmbeddingTargetId} backgroundMapView - The workbook map view in the background
245
269
  * @param {Geometry} geometry - The geometry
246
270
  * @param {object} [options] - Options
271
+ * @param {UiFeature[]} [options.disabledUiFeatures] - Cadenza UI features to disable
247
272
  * @param {FilterVariables} [options.filter] - Filter variables
248
273
  * @param {string} [options.locationFinder] - A search query for the location finder
249
274
  * @param {Extent} [options.mapExtent] - A map extent to set
@@ -252,6 +277,7 @@ export class CadenzaClient {
252
277
  * @param {OperationMode} [options.operationMode] - The mode in which a workbook should be operated
253
278
  * @param {ZoomTarget} [options.zoomTarget] - A target Cadenza should zoom to
254
279
  * @param {AbortSignal} [options.signal] - A signal to abort the iframe loading
280
+ * @param {LayerDefinition[]} [options.additionalLayers] - Layer definitions to be imported and shown in the background, as a basis for the drawing. Each is a layer definition, with name, type and content (a Geojson featureCollection).
255
281
  * @return {Promise<void>} A `Promise` for when the iframe is loaded
256
282
  * @throws For invalid arguments
257
283
  * @fires
@@ -260,7 +286,8 @@ export class CadenzaClient {
260
286
  * - {@link CadenzaEditGeometryCancelEvent}
261
287
  * @embed
262
288
  */
263
- editGeometry(backgroundMapView: EmbeddingTargetId, geometry: Geometry, { filter, locationFinder, mapExtent, minScale, useMapSrs, zoomTarget, operationMode, signal, }?: {
289
+ editGeometry(backgroundMapView: EmbeddingTargetId, geometry: Geometry, { disabledUiFeatures, filter, locationFinder, mapExtent, minScale, useMapSrs, zoomTarget, operationMode, signal, additionalLayers, }?: {
290
+ disabledUiFeatures?: UiFeature[] | undefined;
264
291
  filter?: FilterVariables | undefined;
265
292
  locationFinder?: string | undefined;
266
293
  mapExtent?: Extent | undefined;
@@ -269,6 +296,20 @@ export class CadenzaClient {
269
296
  operationMode?: OperationMode | undefined;
270
297
  zoomTarget?: GeometryZoomTarget | undefined;
271
298
  signal?: AbortSignal | undefined;
299
+ additionalLayers?: {
300
+ /**
301
+ * - The layer's name.
302
+ */
303
+ name: string;
304
+ /**
305
+ * - The layer's type.
306
+ */
307
+ type: 'geojson';
308
+ /**
309
+ * - The layer's content in geojson format.
310
+ */
311
+ content: FeatureCollection;
312
+ }[] | undefined;
272
313
  } | undefined, ...args: any[]): Promise<void>;
273
314
  /**
274
315
  * Set custom validity state of the geometry editor in addition to the default validation state (including errors and
@@ -331,8 +372,9 @@ export class CadenzaClient {
331
372
  *
332
373
  * @param {EmbeddingTargetId} source - The workbook view to fetch data from.
333
374
  * @param {DataType} dataType - The data type you want to get back from the server.
334
- * Currently, `"csv"`, `"excel"` and `"json"` are supported for table and indicator views
335
- * and `"pdf"` for views of type "JasperReports report".
375
+ * Currently, `"csv"`, `"excel"` and `"json"` are supported for embedding targets of type view with a view type of
376
+ * table and indicator. `"pdf"` is supported for embedding targets of type report and of type view with a view type
377
+ * of "JasperReports report".
336
378
  * @param {object} [options] - Options
337
379
  * @param {FilterVariables} [options.filter] - Filter variables
338
380
  * @param {TablePart[]} [options.parts] - Table parts to export; If not specified, all parts are exported.
@@ -393,8 +435,9 @@ export class CadenzaClient {
393
435
  *
394
436
  * @param {EmbeddingTargetId} source - The workbook view to fetch data from.
395
437
  * @param {DataType} dataType - The data type you want to get back from the server.
396
- * Currently, `"csv"`, `"excel"` and `"json"` are supported for table and indicator views
397
- * and `"pdf"` for views of type "JasperReports report".
438
+ * Currently, `"csv"`, `"excel"` and `"json"` are supported for embedding targets of type view with a view type of
439
+ * table and indicator. `"pdf"` is supported for embedding targets of type report and of type view with a view type
440
+ * of "JasperReports report".
398
441
  * @param {object} [options] - Options
399
442
  * @param {string} [options.fileName] - The file name to use; The file extension is appended by Cadenza.
400
443
  * @param {FilterVariables} [options.filter] - Filter variables
@@ -419,6 +462,7 @@ export class CadenzaClient {
419
462
  * | 'objectInfo'
420
463
  * | 'selectObjects:ok'
421
464
  * | 'selectObjects:cancel'
465
+ * | 'reload'
422
466
  * } CadenzaEventType - An event type to subscribe to using {@link CadenzaClient#on}
423
467
  */
424
468
  /**
@@ -432,6 +476,7 @@ export class CadenzaClient {
432
476
  * : T extends 'objectInfo' ? CadenzaObjectInfoEvent
433
477
  * : T extends 'selectObjects:ok' ? CadenzaSelectObjectsOkEvent
434
478
  * : T extends 'selectObjects:cancel' ? CadenzaSelectObjectsCancelEvent
479
+ * : T extends 'reload' ? CadenzaReloadEvent
435
480
  * : never
436
481
  * } CadenzaEventByType
437
482
  */
@@ -446,7 +491,7 @@ export class CadenzaClient {
446
491
  * @typedef {CadenzaEvent<'action', {context: string}>} CadenzaActionEvent - When the user executed a POST message action, which is defined on an external link in the Cadenza management center.
447
492
  */
448
493
  /**
449
- * @typedef {CadenzaEvent<'change:selection', undefined | {layer: WorkbookLayerPath, values: unknown[][]}>} CadenzaChangeSelectionEvent - When the user changed the selection.
494
+ * @typedef {CadenzaEvent<'change:selection', undefined | {layer: WorkbookLayerPath, values: unknown[][]}>} CadenzaChangeSelectionEvent - When the user changed the selection. `undefined` if no objects were selected.
450
495
  *
451
496
  * For a selection in a workbook map view with activated feature info, the values also include the simplified geometries of the selected objects.
452
497
  */
@@ -459,17 +504,24 @@ export class CadenzaClient {
459
504
  * <p>
460
505
  * See also: <a href="../index.html#md:json-representation-of-cadenza-object-data">JSON Representation of Cadenza Object Data</a>
461
506
  */
462
- /** @typedef {CadenzaEvent<'editGeometry:update', {geometry: Geometry}>} CadenzaEditGeometryUpdateEvent - When the user changed the geometry. */
463
- /** @typedef {CadenzaEvent<'editGeometry:ok', {geometry: Geometry}>} CadenzaEditGeometryOkEvent - When the user submitted the geometry. */
507
+ /** @typedef {CadenzaEvent<'editGeometry:update', FeatureCollection | Feature | undefined>} CadenzaEditGeometryUpdateEvent - When the user changed the geometry. `FeatureCollection` if multiple features are present on the edit layer, but the original defined type is not multi-geometry. This is also the case if the dialog was instantiated from a geometry and the original defined type is inherited. `undefined` if no feature is present on the edit layer. */
508
+ /** @typedef {CadenzaEvent<'editGeometry:ok', Feature>} CadenzaEditGeometryOkEvent - When the user submitted the geometry. */
464
509
  /** @typedef {CadenzaEvent<'editGeometry:cancel'>} CadenzaEditGeometryCancelEvent - When the user cancelled the geometry editing. */
465
510
  /** @typedef {CadenzaEvent<'error', {type: string, message?: string}>} CadenzaErrorEvent - An error event that is mapped to a {@link CadenzaError} */
466
511
  /** @typedef {CadenzaEvent<'objectInfo', {layer: WorkbookLayerPath, objectInfos: {selectionIndex: number, elements: {attributePrintName: string, formattedValue: string}[]}}>} CadenzaObjectInfoEvent - When the user opened the object info flyout. */
467
512
  /**
468
- * @typedef {CadenzaEvent<'selectObjects:ok', {layer: WorkbookLayerPath, values: unknown[][]}>} CadenzaSelectObjectsOkEvent - When the user submitted the selection.
513
+ * @typedef {CadenzaEvent<'selectObjects:ok', undefined | {layer: WorkbookLayerPath, values: unknown[][]}>} CadenzaSelectObjectsOkEvent - When the user submitted the selection. `undefined` if no objects were selected.
469
514
  *
470
515
  * For a selection in a workbook map view with activated feature info, the values also include the simplified geometries of the selected objects.
471
516
  */
472
517
  /** @typedef {CadenzaEvent<'selectObjects:cancel'>} CadenzaSelectObjectsCancelEvent - When the user cancelled the selection. */
518
+ /**
519
+ * @typedef {CadenzaEvent<'reload'>} CadenzaReloadEvent - When the user clicked on the 'reload' button in the embedding standby page
520
+ *
521
+ * If a user does not interact with the iframe displaying the Cadenza content for a while, a standby embed page is displayed
522
+ * and the user can click a reload button there. Then the application using Cadenza JS can re-trigger the loading of the iframe
523
+ * with the correct original URL and parameters and do what was originally done when displaying that iframe.
524
+ */
473
525
  export class AbortError extends DOMException {
474
526
  constructor();
475
527
  }
@@ -578,14 +630,19 @@ export type OperationMode = 'normal' | 'simplified';
578
630
  *
579
631
  * _Note:_ Supported features are:
580
632
  * * `"workbook-design"` - The workbook designer
633
+ * * `"workbook-map-add-layer"`- Add layers to the map
581
634
  * * `"workbook-view-management"` - Add/Edit/Remove workbook views (Is included in 'workbook-design'.)
582
635
  */
583
- export type UiFeature = 'workbook-design' | 'workbook-view-management';
636
+ export type UiFeature = 'workbook-design' | 'workbook-map-add-layer' | 'workbook-view-management';
584
637
  export type Distance = {
585
638
  value: number;
586
639
  lengthUnit: LengthUnit;
587
640
  };
588
641
  export type LengthUnit = 'm' | 'km';
642
+ /**
643
+ * - A tuple with an x and y value
644
+ */
645
+ export type Coordinate = [number, number];
589
646
  /**
590
647
  * - A [GeoJSON](https://geojson.org/) geometry object
591
648
  */
@@ -594,6 +651,10 @@ export type Geometry = {
594
651
  * - The type of the geometry
595
652
  */
596
653
  type: GeometryType;
654
+ /**
655
+ * - The coordinates of the geometry
656
+ */
657
+ coordinates: Coordinate | Coordinate[] | Coordinate[][] | Coordinate[][][];
597
658
  };
598
659
  /**
599
660
  * - A GeoJSON geometry type
@@ -641,6 +702,10 @@ export type FilterVariables = Record<string, string | string[] | number | Date |
641
702
  * - A adapted [GeoJSON](https://geojson.org/) feature object.
642
703
  */
643
704
  export type Feature = {
705
+ /**
706
+ * - The object's type
707
+ */
708
+ type: 'Feature';
644
709
  /**
645
710
  * - The id of the feature
646
711
  */
@@ -658,7 +723,11 @@ export type Feature = {
658
723
  */
659
724
  area?: number | undefined;
660
725
  /**
661
- * - The area of a `LineString` feature
726
+ * - The circumference of a `Polygon` feature
727
+ */
728
+ circumference?: number | undefined;
729
+ /**
730
+ * - The length of a `LineString` feature
662
731
  */
663
732
  length?: number | undefined;
664
733
  };
@@ -666,6 +735,10 @@ export type Feature = {
666
735
  * - A adapted [GeoJSON](https://geojson.org/) feature collection object
667
736
  */
668
737
  export type FeatureCollection = {
738
+ /**
739
+ * - The object's type
740
+ */
741
+ type: 'FeatureCollection';
669
742
  /**
670
743
  * - The features within this collection
671
744
  */
@@ -678,8 +751,8 @@ export type CustomValidityType = 'error' | 'warning' | 'info' | 'success';
678
751
  /**
679
752
  * - An event type to subscribe to using {@link CadenzaClienton }
680
753
  */
681
- export type CadenzaEventType = 'action' | 'change:selection' | 'drillThrough' | 'editGeometry:ok' | 'editGeometry:update' | 'editGeometry:cancel' | 'objectInfo' | 'selectObjects:ok' | 'selectObjects:cancel';
682
- export type CadenzaEventByType<T extends CadenzaEventType> = T extends 'action' ? CadenzaActionEvent : T extends 'change:selection' ? CadenzaChangeSelectionEvent : T extends 'drillThrough' ? CadenzaDrillThroughEvent : T extends 'editGeometry:update' ? CadenzaEditGeometryUpdateEvent : T extends 'editGeometry:ok' ? CadenzaEditGeometryOkEvent : T extends 'editGeometry:cancel' ? CadenzaEditGeometryCancelEvent : T extends 'objectInfo' ? CadenzaObjectInfoEvent : T extends 'selectObjects:ok' ? CadenzaSelectObjectsOkEvent : T extends 'selectObjects:cancel' ? CadenzaSelectObjectsCancelEvent : never;
754
+ export type CadenzaEventType = 'action' | 'change:selection' | 'drillThrough' | 'editGeometry:ok' | 'editGeometry:update' | 'editGeometry:cancel' | 'objectInfo' | 'selectObjects:ok' | 'selectObjects:cancel' | 'reload';
755
+ export type CadenzaEventByType<T extends CadenzaEventType> = T extends 'action' ? CadenzaActionEvent : T extends 'change:selection' ? CadenzaChangeSelectionEvent : T extends 'drillThrough' ? CadenzaDrillThroughEvent : T extends 'editGeometry:update' ? CadenzaEditGeometryUpdateEvent : T extends 'editGeometry:ok' ? CadenzaEditGeometryOkEvent : T extends 'editGeometry:cancel' ? CadenzaEditGeometryCancelEvent : T extends 'objectInfo' ? CadenzaObjectInfoEvent : T extends 'selectObjects:ok' ? CadenzaSelectObjectsOkEvent : T extends 'selectObjects:cancel' ? CadenzaSelectObjectsCancelEvent : T extends 'reload' ? CadenzaReloadEvent : never;
683
756
  /**
684
757
  * - A Cadenza `postMessage()` event
685
758
  */
@@ -700,7 +773,7 @@ export type CadenzaActionEvent = CadenzaEvent<'action', {
700
773
  context: string;
701
774
  }>;
702
775
  /**
703
- * - When the user changed the selection.
776
+ * - When the user changed the selection. `undefined` if no objects were selected.
704
777
  *
705
778
  * For a selection in a workbook map view with activated feature info, the values also include the simplified geometries of the selected objects.
706
779
  */
@@ -722,17 +795,13 @@ export type CadenzaDrillThroughEvent = CadenzaEvent<'drillThrough', {
722
795
  values: unknown[][];
723
796
  }>;
724
797
  /**
725
- * - When the user changed the geometry.
798
+ * - When the user changed the geometry. `FeatureCollection` if multiple features are present on the edit layer, but the original defined type is not multi-geometry. This is also the case if the dialog was instantiated from a geometry and the original defined type is inherited. `undefined` if no feature is present on the edit layer.
726
799
  */
727
- export type CadenzaEditGeometryUpdateEvent = CadenzaEvent<'editGeometry:update', {
728
- geometry: Geometry;
729
- }>;
800
+ export type CadenzaEditGeometryUpdateEvent = CadenzaEvent<'editGeometry:update', FeatureCollection | Feature | undefined>;
730
801
  /**
731
802
  * - When the user submitted the geometry.
732
803
  */
733
- export type CadenzaEditGeometryOkEvent = CadenzaEvent<'editGeometry:ok', {
734
- geometry: Geometry;
735
- }>;
804
+ export type CadenzaEditGeometryOkEvent = CadenzaEvent<'editGeometry:ok', Feature>;
736
805
  /**
737
806
  * - When the user cancelled the geometry editing.
738
807
  */
@@ -758,11 +827,11 @@ export type CadenzaObjectInfoEvent = CadenzaEvent<'objectInfo', {
758
827
  };
759
828
  }>;
760
829
  /**
761
- * - When the user submitted the selection.
830
+ * - When the user submitted the selection. `undefined` if no objects were selected.
762
831
  *
763
832
  * For a selection in a workbook map view with activated feature info, the values also include the simplified geometries of the selected objects.
764
833
  */
765
- export type CadenzaSelectObjectsOkEvent = CadenzaEvent<'selectObjects:ok', {
834
+ export type CadenzaSelectObjectsOkEvent = CadenzaEvent<'selectObjects:ok', undefined | {
766
835
  layer: string[];
767
836
  values: unknown[][];
768
837
  }>;
@@ -770,3 +839,11 @@ export type CadenzaSelectObjectsOkEvent = CadenzaEvent<'selectObjects:ok', {
770
839
  * - When the user cancelled the selection.
771
840
  */
772
841
  export type CadenzaSelectObjectsCancelEvent = CadenzaEvent<'selectObjects:cancel'>;
842
+ /**
843
+ * - When the user clicked on the 'reload' button in the embedding standby page
844
+ *
845
+ * If a user does not interact with the iframe displaying the Cadenza content for a while, a standby embed page is displayed
846
+ * and the user can click a reload button there. Then the application using Cadenza JS can re-trigger the loading of the iframe
847
+ * with the correct original URL and parameters and do what was originally done when displaying that iframe.
848
+ */
849
+ export type CadenzaReloadEvent = CadenzaEvent<'reload'>;
package/cadenza.js CHANGED
@@ -90,10 +90,11 @@ globalThis.cadenza = Object.assign((/** @type Parameters<cadenza> */ ...args) =>
90
90
  */
91
91
  /** @typedef {'normal'|'simplified'} OperationMode - The mode in which a workbook should be operated */
92
92
  /**
93
- * @typedef {'workbook-design'|'workbook-view-management'} UiFeature - The name of a Cadenza UI feature
93
+ * @typedef {'workbook-design'|'workbook-map-add-layer'|'workbook-view-management'} UiFeature - The name of a Cadenza UI feature
94
94
  *
95
95
  * _Note:_ Supported features are:
96
96
  * * `"workbook-design"` - The workbook designer
97
+ * * `"workbook-map-add-layer"`- Add layers to the map
97
98
  * * `"workbook-view-management"` - Add/Edit/Remove workbook views (Is included in 'workbook-design'.)
98
99
  * */
99
100
  /**
@@ -104,9 +105,11 @@ globalThis.cadenza = Object.assign((/** @type Parameters<cadenza> */ ...args) =>
104
105
  /**
105
106
  * @typedef {'m'|'km'} LengthUnit
106
107
  */
108
+ /** @typedef {[number, number]} Coordinate - A tuple with an x and y value */
107
109
  /**
108
110
  * @typedef Geometry - A [GeoJSON](https://geojson.org/) geometry object
109
111
  * @property {GeometryType} type - The type of the geometry
112
+ * @property {Coordinate | Coordinate[] | Coordinate[][] | Coordinate[][][]} coordinates - The coordinates of the geometry
110
113
  */
111
114
  /**
112
115
  * @typedef {'Point'|'MultiPoint'|'LineString'|'MultiLineString'|'Polygon'|'MultiPolygon'} GeometryType - A GeoJSON geometry type
@@ -137,14 +140,17 @@ globalThis.cadenza = Object.assign((/** @type Parameters<cadenza> */ ...args) =>
137
140
  */
138
141
  /**
139
142
  * @typedef Feature - A adapted [GeoJSON](https://geojson.org/) feature object.
143
+ * @property {'Feature'} type - The object's type
140
144
  * @property {any[]} objectId - The id of the feature
141
145
  * @property {Geometry} geometry - The geometry
142
146
  * @property {Record<string, string>} properties - The formated properties
143
147
  * @property {number} [area] - The area of a `Polygon` feature
144
- * @property {number} [length] - The area of a `LineString` feature
148
+ * @property {number} [circumference] - The circumference of a `Polygon` feature
149
+ * @property {number} [length] - The length of a `LineString` feature
145
150
  */
146
151
  /**
147
152
  * @typedef FeatureCollection - A adapted [GeoJSON](https://geojson.org/) feature collection object
153
+ * @property {'FeatureCollection'} type - The object's type
148
154
  * @property {Feature[]} features - The features within this collection
149
155
  */
150
156
  /** @typedef {'error'|'warning'|'info'|'success'} CustomValidityType - The type of custom validity used for disclose on visual presentation and form submission behavior */
@@ -241,8 +247,9 @@ export class CadenzaClient {
241
247
  *
242
248
  * @param {PageSource | EmbeddingTargetId} source - The source to show
243
249
  * @param {object} [options]
244
- * @param {DataType} [options.dataType] - Set to 'pdf' for views of type "JasperReports report"
245
- * to show the report PDF directly, without any Cadenza headers or footers.
250
+ * @param {DataType} [options.dataType] - Set to 'pdf' for embedding targets of type report and of views with view
251
+ * type of "JasperReports report" to show the generated report PDF directly (without any Cadenza headers or
252
+ * footers).
246
253
  * @param {UiFeature[]} [options.disabledUiFeatures] - Cadenza UI features to disable
247
254
  * @param {boolean} [options.expandNavigator] - Indicates if the navigator should be expanded.
248
255
  * @param {FilterVariables} [options.filter] - Filter variables
@@ -456,6 +463,12 @@ export class CadenzaClient {
456
463
  values,
457
464
  });
458
465
  }
466
+ /**
467
+ * @typedef LayerDefinition
468
+ * @property {string} name - The layer's name.
469
+ * @property {'geojson'} type - The layer's type.
470
+ * @property {FeatureCollection} content - The layer's content in geojson format.
471
+ */
459
472
  /**
460
473
  * Create a geometry.
461
474
  *
@@ -465,6 +478,7 @@ export class CadenzaClient {
465
478
  * @param {EmbeddingTargetId} backgroundMapView - The workbook map view in the background
466
479
  * @param {GeometryType} geometryType - The geometry type
467
480
  * @param {object} [options] - Options
481
+ * @param {UiFeature[]} [options.disabledUiFeatures] - Cadenza UI features to disable
468
482
  * @param {FilterVariables} [options.filter] - Filter variables
469
483
  * @param {string} [options.locationFinder] - A search query for the location finder
470
484
  * @param {Extent} [options.mapExtent] - A map extent to set
@@ -472,6 +486,7 @@ export class CadenzaClient {
472
486
  * @param {boolean} [options.useMapSrs] - Whether the created geometry should use the map's SRS (otherwise EPSG:4326 will be used)
473
487
  * @param {OperationMode} [options.operationMode] - The mode in which a workbook should be operated
474
488
  * @param {AbortSignal} [options.signal] - A signal to abort the iframe loading
489
+ * @param {LayerDefinition[]} [options.additionalLayers] - Layer definitions to be imported and shown in the background, as a basis for the drawing.
475
490
  * @return {Promise<void>} A `Promise` for when the iframe is loaded
476
491
  * @throws For invalid arguments
477
492
  * @fires
@@ -480,10 +495,11 @@ export class CadenzaClient {
480
495
  * - {@link CadenzaEditGeometryCancelEvent}
481
496
  * @embed
482
497
  */
483
- createGeometry(backgroundMapView, geometryType, { filter, locationFinder, mapExtent, minScale, useMapSrs, operationMode, signal, } = {}) {
498
+ async createGeometry(backgroundMapView, geometryType, { disabledUiFeatures, filter, locationFinder, mapExtent, minScale, useMapSrs, operationMode, signal, additionalLayers, } = {}) {
484
499
  this.#log('CadenzaClient#createGeometry', ...arguments);
485
500
  const params = createParams({
486
501
  action: 'editGeometry',
502
+ disabledUiFeatures,
487
503
  filter,
488
504
  geometryType,
489
505
  locationFinder,
@@ -492,7 +508,10 @@ export class CadenzaClient {
492
508
  useMapSrs,
493
509
  operationMode,
494
510
  });
495
- return this.#show(resolvePath(backgroundMapView), params, signal);
511
+ await this.#show(resolvePath(backgroundMapView), params, signal);
512
+ if (additionalLayers) {
513
+ additionalLayers.forEach((layer) => this.#postEvent('importLayer', layer));
514
+ }
496
515
  }
497
516
  /**
498
517
  * Edit a geometry.
@@ -500,6 +519,7 @@ export class CadenzaClient {
500
519
  * @param {EmbeddingTargetId} backgroundMapView - The workbook map view in the background
501
520
  * @param {Geometry} geometry - The geometry
502
521
  * @param {object} [options] - Options
522
+ * @param {UiFeature[]} [options.disabledUiFeatures] - Cadenza UI features to disable
503
523
  * @param {FilterVariables} [options.filter] - Filter variables
504
524
  * @param {string} [options.locationFinder] - A search query for the location finder
505
525
  * @param {Extent} [options.mapExtent] - A map extent to set
@@ -508,6 +528,7 @@ export class CadenzaClient {
508
528
  * @param {OperationMode} [options.operationMode] - The mode in which a workbook should be operated
509
529
  * @param {ZoomTarget} [options.zoomTarget] - A target Cadenza should zoom to
510
530
  * @param {AbortSignal} [options.signal] - A signal to abort the iframe loading
531
+ * @param {LayerDefinition[]} [options.additionalLayers] - Layer definitions to be imported and shown in the background, as a basis for the drawing. Each is a layer definition, with name, type and content (a Geojson featureCollection).
511
532
  * @return {Promise<void>} A `Promise` for when the iframe is loaded
512
533
  * @throws For invalid arguments
513
534
  * @fires
@@ -516,12 +537,13 @@ export class CadenzaClient {
516
537
  * - {@link CadenzaEditGeometryCancelEvent}
517
538
  * @embed
518
539
  */
519
- async editGeometry(backgroundMapView, geometry, { filter, locationFinder, mapExtent, minScale, useMapSrs, zoomTarget, operationMode, signal, } = {}) {
540
+ async editGeometry(backgroundMapView, geometry, { disabledUiFeatures, filter, locationFinder, mapExtent, minScale, useMapSrs, zoomTarget, operationMode, signal, additionalLayers, } = {}) {
520
541
  this.#log('CadenzaClient#editGeometry', ...arguments);
521
542
  assertValidGeometryType(geometry.type);
522
543
  const zoomToGeometry = geometry && zoomTarget?.type === 'geometry';
523
544
  const params = createParams({
524
545
  action: 'editGeometry',
546
+ disabledUiFeatures,
525
547
  filter,
526
548
  // only use locationFinder if zoom to geometry is not set, to avoid
527
549
  // zooming race condition for Cadenza versions below 10.1
@@ -538,6 +560,9 @@ export class CadenzaClient {
538
560
  zoomToGeometry,
539
561
  });
540
562
  }
563
+ if (additionalLayers) {
564
+ additionalLayers.forEach((layer) => this.#postEvent('importLayer', layer));
565
+ }
541
566
  }
542
567
  /**
543
568
  * Set custom validity state of the geometry editor in addition to the default validation state (including errors and
@@ -768,8 +793,9 @@ export class CadenzaClient {
768
793
  *
769
794
  * @param {EmbeddingTargetId} source - The workbook view to fetch data from.
770
795
  * @param {DataType} dataType - The data type you want to get back from the server.
771
- * Currently, `"csv"`, `"excel"` and `"json"` are supported for table and indicator views
772
- * and `"pdf"` for views of type "JasperReports report".
796
+ * Currently, `"csv"`, `"excel"` and `"json"` are supported for embedding targets of type view with a view type of
797
+ * table and indicator. `"pdf"` is supported for embedding targets of type report and of type view with a view type
798
+ * of "JasperReports report".
773
799
  * @param {object} [options] - Options
774
800
  * @param {FilterVariables} [options.filter] - Filter variables
775
801
  * @param {TablePart[]} [options.parts] - Table parts to export; If not specified, all parts are exported.
@@ -871,8 +897,9 @@ export class CadenzaClient {
871
897
  *
872
898
  * @param {EmbeddingTargetId} source - The workbook view to fetch data from.
873
899
  * @param {DataType} dataType - The data type you want to get back from the server.
874
- * Currently, `"csv"`, `"excel"` and `"json"` are supported for table and indicator views
875
- * and `"pdf"` for views of type "JasperReports report".
900
+ * Currently, `"csv"`, `"excel"` and `"json"` are supported for embedding targets of type view with a view type of
901
+ * table and indicator. `"pdf"` is supported for embedding targets of type report and of type view with a view type
902
+ * of "JasperReports report".
876
903
  * @param {object} [options] - Options
877
904
  * @param {string} [options.fileName] - The file name to use; The file extension is appended by Cadenza.
878
905
  * @param {FilterVariables} [options.filter] - Filter variables
@@ -995,7 +1022,11 @@ function validOperationMode(/** @type string */ value) {
995
1022
  return ['normal', 'simplified'].includes(value);
996
1023
  }
997
1024
  function validUiFeature(/** @type string */ value) {
998
- return ['workbook-design', 'workbook-view-management'].includes(value);
1025
+ return [
1026
+ 'workbook-design',
1027
+ 'workbook-map-add-layer',
1028
+ 'workbook-view-management',
1029
+ ].includes(value);
999
1030
  }
1000
1031
  function assertSupportedDataType(
1001
1032
  /** @type DataType */ type,
@@ -1086,6 +1117,7 @@ function array(/** @type unknown */ value) {
1086
1117
  * | 'objectInfo'
1087
1118
  * | 'selectObjects:ok'
1088
1119
  * | 'selectObjects:cancel'
1120
+ * | 'reload'
1089
1121
  * } CadenzaEventType - An event type to subscribe to using {@link CadenzaClient#on}
1090
1122
  */
1091
1123
  /**
@@ -1099,6 +1131,7 @@ function array(/** @type unknown */ value) {
1099
1131
  * : T extends 'objectInfo' ? CadenzaObjectInfoEvent
1100
1132
  * : T extends 'selectObjects:ok' ? CadenzaSelectObjectsOkEvent
1101
1133
  * : T extends 'selectObjects:cancel' ? CadenzaSelectObjectsCancelEvent
1134
+ * : T extends 'reload' ? CadenzaReloadEvent
1102
1135
  * : never
1103
1136
  * } CadenzaEventByType
1104
1137
  */
@@ -1118,7 +1151,7 @@ function array(/** @type unknown */ value) {
1118
1151
  * The extent is transformed according to the `useMapSrs` option.
1119
1152
  */
1120
1153
  /**
1121
- * @typedef {CadenzaEvent<'change:selection', undefined | {layer: WorkbookLayerPath, values: unknown[][]}>} CadenzaChangeSelectionEvent - When the user changed the selection.
1154
+ * @typedef {CadenzaEvent<'change:selection', undefined | {layer: WorkbookLayerPath, values: unknown[][]}>} CadenzaChangeSelectionEvent - When the user changed the selection. `undefined` if no objects were selected.
1122
1155
  *
1123
1156
  * For a selection in a workbook map view with activated feature info, the values also include the simplified geometries of the selected objects.
1124
1157
  */
@@ -1131,17 +1164,24 @@ function array(/** @type unknown */ value) {
1131
1164
  * <p>
1132
1165
  * See also: <a href="../index.html#md:json-representation-of-cadenza-object-data">JSON Representation of Cadenza Object Data</a>
1133
1166
  */
1134
- /** @typedef {CadenzaEvent<'editGeometry:update', {geometry: Geometry}>} CadenzaEditGeometryUpdateEvent - When the user changed the geometry. */
1135
- /** @typedef {CadenzaEvent<'editGeometry:ok', {geometry: Geometry}>} CadenzaEditGeometryOkEvent - When the user submitted the geometry. */
1167
+ /** @typedef {CadenzaEvent<'editGeometry:update', FeatureCollection | Feature | undefined>} CadenzaEditGeometryUpdateEvent - When the user changed the geometry. `FeatureCollection` if multiple features are present on the edit layer, but the original defined type is not multi-geometry. This is also the case if the dialog was instantiated from a geometry and the original defined type is inherited. `undefined` if no feature is present on the edit layer. */
1168
+ /** @typedef {CadenzaEvent<'editGeometry:ok', Feature>} CadenzaEditGeometryOkEvent - When the user submitted the geometry. */
1136
1169
  /** @typedef {CadenzaEvent<'editGeometry:cancel'>} CadenzaEditGeometryCancelEvent - When the user cancelled the geometry editing. */
1137
1170
  /** @typedef {CadenzaEvent<'error', {type: string, message?: string}>} CadenzaErrorEvent - An error event that is mapped to a {@link CadenzaError} */
1138
1171
  /** @typedef {CadenzaEvent<'objectInfo', {layer: WorkbookLayerPath, objectInfos: {selectionIndex: number, elements: {attributePrintName: string, formattedValue: string}[]}}>} CadenzaObjectInfoEvent - When the user opened the object info flyout. */
1139
1172
  /**
1140
- * @typedef {CadenzaEvent<'selectObjects:ok', {layer: WorkbookLayerPath, values: unknown[][]}>} CadenzaSelectObjectsOkEvent - When the user submitted the selection.
1173
+ * @typedef {CadenzaEvent<'selectObjects:ok', undefined | {layer: WorkbookLayerPath, values: unknown[][]}>} CadenzaSelectObjectsOkEvent - When the user submitted the selection. `undefined` if no objects were selected.
1141
1174
  *
1142
1175
  * For a selection in a workbook map view with activated feature info, the values also include the simplified geometries of the selected objects.
1143
1176
  */
1144
1177
  /** @typedef {CadenzaEvent<'selectObjects:cancel'>} CadenzaSelectObjectsCancelEvent - When the user cancelled the selection. */
1178
+ /**
1179
+ * @typedef {CadenzaEvent<'reload'>} CadenzaReloadEvent - When the user clicked on the 'reload' button in the embedding standby page
1180
+ *
1181
+ * If a user does not interact with the iframe displaying the Cadenza content for a while, a standby embed page is displayed
1182
+ * and the user can click a reload button there. Then the application using Cadenza JS can re-trigger the loading of the iframe
1183
+ * with the correct original URL and parameters and do what was originally done when displaying that iframe.
1184
+ */
1145
1185
  export class AbortError extends DOMException {
1146
1186
  constructor() {
1147
1187
  super('Aborted', 'AbortError');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@disy/cadenza.js",
3
- "version": "10.2.1",
3
+ "version": "10.2.3",
4
4
  "license": "Apache-2.0",
5
5
  "repository": "github:DisyInformationssysteme/cadenza.js",
6
6
  "type": "module",