@disy/cadenza.js 2.13.1 → 10.2.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 (46) hide show
  1. package/CHANGELOG.md +9 -2
  2. package/apidoc/assets/highlight.css +30 -23
  3. package/apidoc/classes/AbortError.html +3 -3
  4. package/apidoc/classes/CadenzaClient.html +26 -26
  5. package/apidoc/classes/CadenzaError.html +5 -5
  6. package/apidoc/functions/cadenza.html +3 -3
  7. package/apidoc/index.html +35 -33
  8. package/apidoc/interfaces/CadenzaClientOptions.html +5 -5
  9. package/apidoc/interfaces/CadenzaEvent.html +4 -4
  10. package/apidoc/interfaces/Distance.html +2 -2
  11. package/apidoc/interfaces/ExternalLinkKey.html +5 -5
  12. package/apidoc/interfaces/Feature.html +7 -7
  13. package/apidoc/interfaces/FeatureCollection.html +3 -3
  14. package/apidoc/interfaces/Geometry.html +3 -3
  15. package/apidoc/interfaces/GeometryZoomTarget.html +3 -3
  16. package/apidoc/interfaces/PageSource.html +3 -3
  17. package/apidoc/modules.html +2 -2
  18. package/apidoc/types/CadenzaActionEvent.html +2 -2
  19. package/apidoc/types/CadenzaChangeSelectionEvent.html +2 -2
  20. package/apidoc/types/CadenzaDrillThroughEvent.html +2 -2
  21. package/apidoc/types/CadenzaEditGeometryCancelEvent.html +2 -2
  22. package/apidoc/types/CadenzaEditGeometryOkEvent.html +2 -2
  23. package/apidoc/types/CadenzaEditGeometryUpdateEvent.html +2 -2
  24. package/apidoc/types/CadenzaErrorEvent.html +2 -2
  25. package/apidoc/types/CadenzaEventByType.html +1 -1
  26. package/apidoc/types/CadenzaEventType.html +2 -2
  27. package/apidoc/types/CadenzaObjectInfoEvent.html +2 -2
  28. package/apidoc/types/CadenzaSelectObjectsCancelEvent.html +2 -2
  29. package/apidoc/types/CadenzaSelectObjectsOkEvent.html +2 -2
  30. package/apidoc/types/DataType.html +2 -2
  31. package/apidoc/types/EmbeddingTargetId.html +2 -2
  32. package/apidoc/types/Extent.html +2 -2
  33. package/apidoc/types/FilterVariables.html +2 -2
  34. package/apidoc/types/GeometryType.html +2 -2
  35. package/apidoc/types/GlobalId.html +2 -2
  36. package/apidoc/types/LengthUnit.html +1 -1
  37. package/apidoc/types/OpaqueString.html +2 -2
  38. package/apidoc/types/OperationMode.html +2 -2
  39. package/apidoc/types/TablePart.html +2 -2
  40. package/apidoc/types/UiFeature.html +2 -2
  41. package/apidoc/types/WorkbookLayerPath.html +2 -2
  42. package/apidoc/types/ZoomTarget.html +2 -2
  43. package/cadenza.d.ts +9 -3
  44. package/cadenza.js +10 -4
  45. package/package.json +1 -1
  46. package/sandbox.html +19 -1
package/cadenza.d.ts CHANGED
@@ -219,6 +219,7 @@ export class CadenzaClient {
219
219
  * @param {Extent} [options.mapExtent] - A map extent to set
220
220
  * @param {number} [options.minScale] - The minimum scale where the user should work on. A warning is shown when the map is zoomed out above the threshold.
221
221
  * @param {boolean} [options.useMapSrs] - Whether the created geometry should use the map's SRS (otherwise EPSG:4326 will be used)
222
+ * @param {OperationMode} [options.operationMode] - The mode in which a workbook should be operated
222
223
  * @param {AbortSignal} [options.signal] - A signal to abort the iframe loading
223
224
  * @return {Promise<void>} A `Promise` for when the iframe is loaded
224
225
  * @throws For invalid arguments
@@ -228,12 +229,13 @@ export class CadenzaClient {
228
229
  * - {@link CadenzaEditGeometryCancelEvent}
229
230
  * @embed
230
231
  */
231
- createGeometry(backgroundMapView: EmbeddingTargetId, geometryType: GeometryType, { filter, locationFinder, mapExtent, minScale, useMapSrs, signal }?: {
232
+ createGeometry(backgroundMapView: EmbeddingTargetId, geometryType: GeometryType, { filter, locationFinder, mapExtent, minScale, useMapSrs, operationMode, signal, }?: {
232
233
  filter?: FilterVariables | undefined;
233
234
  locationFinder?: string | undefined;
234
235
  mapExtent?: Extent | undefined;
235
236
  minScale?: number | undefined;
236
237
  useMapSrs?: boolean | undefined;
238
+ operationMode?: OperationMode | undefined;
237
239
  signal?: AbortSignal | undefined;
238
240
  } | undefined, ...args: any[]): Promise<void>;
239
241
  /**
@@ -247,6 +249,7 @@ export class CadenzaClient {
247
249
  * @param {Extent} [options.mapExtent] - A map extent to set
248
250
  * @param {number} [options.minScale] - The minimum scale where the user should work on. A warning is shown when the map is zoomed out above the threshold.
249
251
  * @param {boolean} [options.useMapSrs] - Whether the geometry is in the map's SRS (otherwise EPSG:4326 is assumed)
252
+ * @param {OperationMode} [options.operationMode] - The mode in which a workbook should be operated
250
253
  * @param {ZoomTarget} [options.zoomTarget] - A target Cadenza should zoom to
251
254
  * @param {AbortSignal} [options.signal] - A signal to abort the iframe loading
252
255
  * @return {Promise<void>} A `Promise` for when the iframe is loaded
@@ -257,12 +260,13 @@ export class CadenzaClient {
257
260
  * - {@link CadenzaEditGeometryCancelEvent}
258
261
  * @embed
259
262
  */
260
- editGeometry(backgroundMapView: EmbeddingTargetId, geometry: Geometry, { filter, locationFinder, mapExtent, minScale, useMapSrs, zoomTarget, signal, }?: {
263
+ editGeometry(backgroundMapView: EmbeddingTargetId, geometry: Geometry, { filter, locationFinder, mapExtent, minScale, useMapSrs, zoomTarget, operationMode, signal, }?: {
261
264
  filter?: FilterVariables | undefined;
262
265
  locationFinder?: string | undefined;
263
266
  mapExtent?: Extent | undefined;
264
267
  minScale?: number | undefined;
265
268
  useMapSrs?: boolean | undefined;
269
+ operationMode?: OperationMode | undefined;
266
270
  zoomTarget?: GeometryZoomTarget | undefined;
267
271
  signal?: AbortSignal | undefined;
268
272
  } | undefined, ...args: any[]): Promise<void>;
@@ -277,6 +281,7 @@ export class CadenzaClient {
277
281
  * @param {string} [options.locationFinder] - A search query for the location finder
278
282
  * @param {Extent} [options.mapExtent] - A map extent to set
279
283
  * @param {boolean} [options.useMapSrs] - Whether the geometry is in the map's SRS (otherwise EPSG:4326 is assumed)
284
+ * @param {OperationMode} [options.operationMode] - The mode in which a workbook should be operated
280
285
  * @param {AbortSignal} [options.signal] - A signal to abort the iframe loading
281
286
  * @return {Promise<void>} A `Promise` for when the iframe is loaded
282
287
  * @throws For invalid arguments
@@ -287,12 +292,13 @@ export class CadenzaClient {
287
292
  * - {@link CadenzaSelectObjectsCancelEvent}
288
293
  * @embed
289
294
  */
290
- selectObjects(backgroundMapView: EmbeddingTargetId, { filter, layers, locationFinder, mapExtent, useMapSrs, signal }?: {
295
+ selectObjects(backgroundMapView: EmbeddingTargetId, { filter, layers, locationFinder, mapExtent, useMapSrs, operationMode, signal, }?: {
291
296
  filter?: FilterVariables | undefined;
292
297
  layers?: (string | WorkbookLayerPath)[] | undefined;
293
298
  locationFinder?: string | undefined;
294
299
  mapExtent?: Extent | undefined;
295
300
  useMapSrs?: boolean | undefined;
301
+ operationMode?: OperationMode | undefined;
296
302
  signal?: AbortSignal | undefined;
297
303
  } | undefined, ...args: any[]): Promise<void>;
298
304
  /**
package/cadenza.js CHANGED
@@ -469,6 +469,7 @@ export class CadenzaClient {
469
469
  * @param {Extent} [options.mapExtent] - A map extent to set
470
470
  * @param {number} [options.minScale] - The minimum scale where the user should work on. A warning is shown when the map is zoomed out above the threshold.
471
471
  * @param {boolean} [options.useMapSrs] - Whether the created geometry should use the map's SRS (otherwise EPSG:4326 will be used)
472
+ * @param {OperationMode} [options.operationMode] - The mode in which a workbook should be operated
472
473
  * @param {AbortSignal} [options.signal] - A signal to abort the iframe loading
473
474
  * @return {Promise<void>} A `Promise` for when the iframe is loaded
474
475
  * @throws For invalid arguments
@@ -478,7 +479,7 @@ export class CadenzaClient {
478
479
  * - {@link CadenzaEditGeometryCancelEvent}
479
480
  * @embed
480
481
  */
481
- createGeometry(backgroundMapView, geometryType, { filter, locationFinder, mapExtent, minScale, useMapSrs, signal } = {}) {
482
+ createGeometry(backgroundMapView, geometryType, { filter, locationFinder, mapExtent, minScale, useMapSrs, operationMode, signal, } = {}) {
482
483
  this.#log('CadenzaClient#createGeometry', ...arguments);
483
484
  const params = createParams({
484
485
  action: 'editGeometry',
@@ -488,6 +489,7 @@ export class CadenzaClient {
488
489
  mapExtent,
489
490
  minScale,
490
491
  useMapSrs,
492
+ operationMode,
491
493
  });
492
494
  return this.#show(resolvePath(backgroundMapView), params, signal);
493
495
  }
@@ -502,6 +504,7 @@ export class CadenzaClient {
502
504
  * @param {Extent} [options.mapExtent] - A map extent to set
503
505
  * @param {number} [options.minScale] - The minimum scale where the user should work on. A warning is shown when the map is zoomed out above the threshold.
504
506
  * @param {boolean} [options.useMapSrs] - Whether the geometry is in the map's SRS (otherwise EPSG:4326 is assumed)
507
+ * @param {OperationMode} [options.operationMode] - The mode in which a workbook should be operated
505
508
  * @param {ZoomTarget} [options.zoomTarget] - A target Cadenza should zoom to
506
509
  * @param {AbortSignal} [options.signal] - A signal to abort the iframe loading
507
510
  * @return {Promise<void>} A `Promise` for when the iframe is loaded
@@ -512,7 +515,7 @@ export class CadenzaClient {
512
515
  * - {@link CadenzaEditGeometryCancelEvent}
513
516
  * @embed
514
517
  */
515
- async editGeometry(backgroundMapView, geometry, { filter, locationFinder, mapExtent, minScale, useMapSrs, zoomTarget, signal, } = {}) {
518
+ async editGeometry(backgroundMapView, geometry, { filter, locationFinder, mapExtent, minScale, useMapSrs, zoomTarget, operationMode, signal, } = {}) {
516
519
  this.#log('CadenzaClient#editGeometry', ...arguments);
517
520
  assertValidGeometryType(geometry.type);
518
521
  const zoomToGeometry = geometry && zoomTarget?.type === 'geometry';
@@ -525,6 +528,7 @@ export class CadenzaClient {
525
528
  mapExtent,
526
529
  minScale,
527
530
  useMapSrs,
531
+ operationMode,
528
532
  });
529
533
  await this.#show(resolvePath(backgroundMapView), params, signal);
530
534
  if (geometry) {
@@ -545,6 +549,7 @@ export class CadenzaClient {
545
549
  * @param {string} [options.locationFinder] - A search query for the location finder
546
550
  * @param {Extent} [options.mapExtent] - A map extent to set
547
551
  * @param {boolean} [options.useMapSrs] - Whether the geometry is in the map's SRS (otherwise EPSG:4326 is assumed)
552
+ * @param {OperationMode} [options.operationMode] - The mode in which a workbook should be operated
548
553
  * @param {AbortSignal} [options.signal] - A signal to abort the iframe loading
549
554
  * @return {Promise<void>} A `Promise` for when the iframe is loaded
550
555
  * @throws For invalid arguments
@@ -555,7 +560,7 @@ export class CadenzaClient {
555
560
  * - {@link CadenzaSelectObjectsCancelEvent}
556
561
  * @embed
557
562
  */
558
- selectObjects(backgroundMapView, { filter, layers, locationFinder, mapExtent, useMapSrs, signal } = {}) {
563
+ selectObjects(backgroundMapView, { filter, layers, locationFinder, mapExtent, useMapSrs, operationMode, signal, } = {}) {
559
564
  this.#log('CadenzaClient#selectObjects', ...arguments);
560
565
  const params = createParams({
561
566
  action: 'selectObjects',
@@ -564,6 +569,7 @@ export class CadenzaClient {
564
569
  locationFinder,
565
570
  mapExtent,
566
571
  useMapSrs,
572
+ operationMode,
567
573
  });
568
574
  return this.#show(resolvePath(backgroundMapView), params, signal);
569
575
  }
@@ -1046,7 +1052,7 @@ function createParams({ action, dataType, disabledUiFeatures, expandNavigator, f
1046
1052
  ...(locationFinder && { locationFinder }),
1047
1053
  ...(mapExtent && { mapExtent: mapExtent.join() }),
1048
1054
  ...(minScale && { minScale: String(minScale) }),
1049
- ...(operationMode && operationMode !== 'normal' && { operationMode }),
1055
+ ...(operationMode && { operationMode }),
1050
1056
  ...(parts && { parts: parts.join() }),
1051
1057
  ...(targetType && { targetType }),
1052
1058
  ...(useMapSrs && { useMapSrs: 'true' }),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@disy/cadenza.js",
3
- "version": "2.13.1",
3
+ "version": "10.2.0",
4
4
  "license": "Apache-2.0",
5
5
  "repository": "github:DisyInformationssysteme/cadenza.js",
6
6
  "type": "module",
package/sandbox.html CHANGED
@@ -247,7 +247,7 @@
247
247
  mapExtent: mapExtent && mapExtent.split(',').map(Number),
248
248
  minScale: minScale && Number(minScale),
249
249
  parts: parts && parts.split(','),
250
- ...(simplifiedOperationMode === 'on' && { operationMode: 'simplified' }),
250
+ operationMode: (simplifiedOperationMode === 'on' ? 'simplified' : 'normal' ),
251
251
  layers: layers ? JSON.parse(layers) : undefined,
252
252
  useMapSrs: useMapSrs === 'on',
253
253
  fullGeometries: fullGeometries === 'on',
@@ -490,6 +490,12 @@
490
490
  <option>MultiPolygon</option>
491
491
  </select>
492
492
  </div>
493
+ <div>
494
+ <label>
495
+ <input type="checkbox" name="simplifiedOperationMode">
496
+ Simplified operation mode
497
+ </label>
498
+ </div>
493
499
  <div>
494
500
  <label for="minScale">Minimum Scale</label>
495
501
  <input type="number" name="minScale" id="minScale">
@@ -505,6 +511,12 @@
505
511
  <label for="geometry">Geometry (GeoJSON) *</label>
506
512
  <textarea name="geometry" id="geometry" rows="5" required></textarea>
507
513
  </div>
514
+ <div>
515
+ <label>
516
+ <input type="checkbox" name="simplifiedOperationMode">
517
+ Simplified operation mode
518
+ </label>
519
+ </div>
508
520
  <div>
509
521
  <label for="minScale">Minimum Scale</label>
510
522
  <input type="number" name="minScale" id="minScale">
@@ -516,6 +528,12 @@
516
528
  <label for="embeddingTargetId">Embedding target ID of the map view *</label>
517
529
  <input name="embeddingTargetId" id="embeddingTargetId" required>
518
530
  </div>
531
+ <div>
532
+ <label>
533
+ <input type="checkbox" name="simplifiedOperationMode">
534
+ Simplified operation mode
535
+ </label>
536
+ </div>
519
537
  <div>
520
538
  <label for="layers">Layers</label>
521
539
  <input name="layers" id="layers">