@disy/cadenza.js 10.4.5 → 10.4.7

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 (64) hide show
  1. package/CHANGELOG.md +10 -2
  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 +29 -23
  6. package/apidoc/classes/CadenzaError.html +5 -5
  7. package/apidoc/functions/cadenza.html +4 -4
  8. package/apidoc/index.html +11 -7
  9. package/apidoc/interfaces/AreaIntersectionsResult.html +4 -4
  10. package/apidoc/interfaces/CadenzaClientOptions.html +6 -6
  11. package/apidoc/interfaces/CadenzaEvent.html +4 -4
  12. package/apidoc/interfaces/CommonEditGeometryOptions.html +12 -12
  13. package/apidoc/interfaces/Distance.html +2 -2
  14. package/apidoc/interfaces/ExternalLinkKey.html +4 -4
  15. package/apidoc/interfaces/Feature.html +9 -9
  16. package/apidoc/interfaces/FeatureCollection.html +4 -4
  17. package/apidoc/interfaces/Geometry.html +4 -4
  18. package/apidoc/interfaces/GeometryExtentStrategy.html +4 -4
  19. package/apidoc/interfaces/LayerDataExtentStrategy.html +4 -4
  20. package/apidoc/interfaces/LayerDefinition.html +4 -4
  21. package/apidoc/interfaces/LocationFinderExtentStrategy.html +4 -4
  22. package/apidoc/interfaces/PageSource.html +3 -3
  23. package/apidoc/interfaces/ProblemDetails.html +6 -6
  24. package/apidoc/interfaces/SnappingOptions.html +3 -3
  25. package/apidoc/interfaces/SpatialFilterValue.html +4 -4
  26. package/apidoc/interfaces/StaticExtentStrategy.html +4 -4
  27. package/apidoc/modules.html +1 -1
  28. package/apidoc/types/CadenzaActionEvent.html +2 -2
  29. package/apidoc/types/CadenzaChangeSelectionEvent.html +2 -2
  30. package/apidoc/types/CadenzaDrillThroughEvent.html +2 -2
  31. package/apidoc/types/CadenzaEditGeometryCancelEvent.html +2 -2
  32. package/apidoc/types/CadenzaEditGeometryCreateEvent.html +2 -0
  33. package/apidoc/types/CadenzaEditGeometryDeleteEvent.html +2 -0
  34. package/apidoc/types/CadenzaEditGeometryEditEvent.html +2 -0
  35. package/apidoc/types/CadenzaEditGeometryOkEvent.html +2 -2
  36. package/apidoc/types/CadenzaEditGeometryUpdateEvent.html +2 -2
  37. package/apidoc/types/CadenzaErrorEvent.html +2 -2
  38. package/apidoc/types/CadenzaEventByType.html +1 -1
  39. package/apidoc/types/CadenzaEventType.html +2 -2
  40. package/apidoc/types/CadenzaReloadEvent.html +2 -2
  41. package/apidoc/types/CadenzaSelectObjectsCancelEvent.html +2 -2
  42. package/apidoc/types/CadenzaSelectObjectsOkEvent.html +2 -2
  43. package/apidoc/types/Coordinate.html +2 -2
  44. package/apidoc/types/CustomValidityType.html +2 -2
  45. package/apidoc/types/DataType.html +2 -2
  46. package/apidoc/types/EmbeddingTargetId.html +2 -2
  47. package/apidoc/types/Extent.html +2 -2
  48. package/apidoc/types/ExtentStrategy.html +2 -2
  49. package/apidoc/types/FilterVariables.html +2 -2
  50. package/apidoc/types/GeometryType.html +2 -2
  51. package/apidoc/types/GlobalId.html +2 -2
  52. package/apidoc/types/Layout.html +2 -2
  53. package/apidoc/types/LengthUnit.html +1 -1
  54. package/apidoc/types/OpaqueString.html +2 -2
  55. package/apidoc/types/OperationMode.html +2 -2
  56. package/apidoc/types/Polygon.html +1 -1
  57. package/apidoc/types/SpatialRelation.html +2 -2
  58. package/apidoc/types/TablePart.html +2 -2
  59. package/apidoc/types/UiFeature.html +2 -2
  60. package/apidoc/types/WorkbookLayerPath.html +2 -2
  61. package/cadenza.d.ts +33 -4
  62. package/cadenza.js +19 -4
  63. package/package.json +1 -1
  64. package/sandbox.html +9 -3
package/cadenza.js CHANGED
@@ -18,7 +18,7 @@
18
18
  */
19
19
  // This placeholder is replaced when Cadenza JS is released,
20
20
  // i.e. during development, the version is not available.
21
- const CADENZAJS_VERSION = '10.4.5';
21
+ const CADENZAJS_VERSION = '10.4.7';
22
22
  /**
23
23
  * Creates an instance of the Cadenza JS client.
24
24
  *
@@ -169,7 +169,7 @@ globalThis.cadenza = Object.assign((/** @type Parameters<cadenza> */ ...args) =>
169
169
  */
170
170
  /**
171
171
  * @typedef CommonEditGeometryOptions - Common options for the initialization of the geometry editor.
172
- * @property {LayerDefinition[]} [additionalLayers] - Layer definitions to be imported and shown in the background, as a basis for the drawing.
172
+ * @property {LayerDefinition[]} [additionalLayers] - Layer definitions to be imported and shown in the background, as a basis for the drawing. IMPORTANT: The Cadenza referenced with `cadenzaClient` must be configured to support the import of GeoJSON, and the (system) privileges of the corresponding user must also be set in such a way that the import of GeoJSON is possible.
173
173
  * @property {UiFeature[]} [disabledUiFeatures] - Cadenza UI features to disable
174
174
  * @property {ExtentStrategy} [extentStrategy] - Defines the initial map extent; If not given, Cadenza's default logic is used.
175
175
  * @property {FilterVariables} [filter] - Filter variables
@@ -407,7 +407,7 @@ export class CadenzaClient {
407
407
  *
408
408
  * @param {EmbeddingTargetId} mapView - The workbook map view to show
409
409
  * @param {object} [__namedParameters] - Options
410
- * @param {LayerDefinition[]} [__namedParameters.additionalLayers] - Layer definitions to be imported and shown in the background, as a basis for the drawing.
410
+ * @param {LayerDefinition[]} [__namedParameters.additionalLayers] - Layer definitions to be imported and shown in the background, as a basis for the drawing. IMPORTANT: The Cadenza referenced with `cadenzaClient` must be configured to support the import of GeoJSON, and the (system) privileges of the corresponding user must also be set in such a way that the import of GeoJSON is possible.
411
411
  * @param {UiFeature[]} [__namedParameters.disabledUiFeatures] - Cadenza UI features to disable
412
412
  * @param {boolean} [__namedParameters.expandNavigator] - Indicates if the navigator should be expanded.
413
413
  * @param {ExtentStrategy} [__namedParameters.extentStrategy] - Defines the initial map extent; If not given, Cadenza's default logic is used.
@@ -673,6 +673,9 @@ export class CadenzaClient {
673
673
  * @fires
674
674
  * - {@link CadenzaEditGeometryUpdateEvent}
675
675
  * - {@link CadenzaEditGeometryOkEvent}
676
+ * - {@link CadenzaEditGeometryCreateEvent}
677
+ * - {@link CadenzaEditGeometryEditEvent}
678
+ * - {@link CadenzaEditGeometryDeleteEvent}
676
679
  * - {@link CadenzaEditGeometryCancelEvent}
677
680
  * @embed
678
681
  */
@@ -712,6 +715,9 @@ export class CadenzaClient {
712
715
  * @fires
713
716
  * - {@link CadenzaEditGeometryUpdateEvent}
714
717
  * - {@link CadenzaEditGeometryOkEvent}
718
+ * - {@link CadenzaEditGeometryCreateEvent}
719
+ * - {@link CadenzaEditGeometryEditEvent}
720
+ * - {@link CadenzaEditGeometryDeleteEvent}
715
721
  * - {@link CadenzaEditGeometryCancelEvent}
716
722
  * @embed
717
723
  */
@@ -745,7 +751,7 @@ export class CadenzaClient {
745
751
  /**
746
752
  * @param {object} __namedParameters - Options
747
753
  * @param [__namedParameters.geometry] {Geometry} - The geometry to edit
748
- * @param [__namedParameters.additionalLayers] {LayerDefinition[]} - Layer definitions to be imported and shown in the background, as a basis for the drawing.
754
+ * @param [__namedParameters.additionalLayers] {LayerDefinition[]} - Layer definitions to be imported and shown in the background, as a basis for the drawing. IMPORTANT: The Cadenza referenced with `cadenzaClient` must be configured to support the import of GeoJSON, and the (system) privileges of the corresponding user must also be set in such a way that the import of GeoJSON is possible.
749
755
  * @param [__namedParameters.validExtentStrategy] {ExtentStrategy} - Defines the initial map extent; If not given, Cadenza's default logic is used.
750
756
  * @param [__namedParameters.features] {FeatureCollection} - The features to edit. The last feature in this collection is directly set up for editing.
751
757
  * @returns {Promise<Awaited<unknown>[]>}
@@ -1444,6 +1450,9 @@ function getGeometryTypeFromFeatureCollection(featureCollection) {
1444
1450
  * | 'change:selection'
1445
1451
  * | 'drillThrough'
1446
1452
  * | 'editGeometry:ok'
1453
+ * | 'editGeometry:create'
1454
+ * | 'editGeometry:edit'
1455
+ * | 'editGeometry:delete'
1447
1456
  * | 'editGeometry:update'
1448
1457
  * | 'editGeometry:cancel'
1449
1458
  * | 'reload'
@@ -1458,6 +1467,9 @@ function getGeometryTypeFromFeatureCollection(featureCollection) {
1458
1467
  * : T extends 'drillThrough' ? CadenzaDrillThroughEvent
1459
1468
  * : T extends 'editGeometry:update' ? CadenzaEditGeometryUpdateEvent
1460
1469
  * : T extends 'editGeometry:ok' ? CadenzaEditGeometryOkEvent
1470
+ * : T extends 'editGeometry:create' ? CadenzaEditGeometryCreateEvent
1471
+ * : T extends 'editGeometry:edit' ? CadenzaEditGeometryEditEvent
1472
+ * : T extends 'editGeometry:delete' ? CadenzaEditGeometryDeleteEvent
1461
1473
  * : T extends 'editGeometry:cancel' ? CadenzaEditGeometryCancelEvent
1462
1474
  * : T extends 'reload' ? CadenzaReloadEvent
1463
1475
  * : T extends 'selectObjects:ok' ? CadenzaSelectObjectsOkEvent
@@ -1496,6 +1508,9 @@ function getGeometryTypeFromFeatureCollection(featureCollection) {
1496
1508
  */
1497
1509
  /** @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. */
1498
1510
  /** @typedef {CadenzaEvent<'editGeometry:ok', FeatureCollection | Feature>} CadenzaEditGeometryOkEvent - When the user submitted the geometry. `FeatureCollection` if batch editing is enabled. */
1511
+ /** @typedef {CadenzaEvent<'editGeometry:create', FeatureCollection | Feature>} CadenzaEditGeometryCreateEvent - Whenever new geometry features were created. `Feature` if only one feature was created. Only available in batch mode */
1512
+ /** @typedef {CadenzaEvent<'editGeometry:edit', Feature>} CadenzaEditGeometryEditEvent - Whenever a geometry feature was edited. Only available in batch mode */
1513
+ /** @typedef {CadenzaEvent<'editGeometry:delete', {featureIds: any[][]}>} CadenzaEditGeometryDeleteEvent - Whenever geometry features were deleted. Only available in batch mode */
1499
1514
  /** @typedef {CadenzaEvent<'editGeometry:cancel'>} CadenzaEditGeometryCancelEvent - When the user cancelled the geometry editing. */
1500
1515
  /** @typedef {CadenzaEvent<'error', {type: string, message?: string}>} CadenzaErrorEvent - An error event that is mapped to a {@link CadenzaError} */
1501
1516
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@disy/cadenza.js",
3
- "version": "10.4.5",
3
+ "version": "10.4.7",
4
4
  "license": "Apache-2.0",
5
5
  "repository": "github:DisyInformationssysteme/cadenza.js",
6
6
  "type": "module",
package/sandbox.html CHANGED
@@ -190,11 +190,17 @@
190
190
  };
191
191
 
192
192
  const form = document.getElementById('form');
193
- form.onsubmit = (event) => {
193
+ const submitButton = document.getElementById('submit');
194
+ form.onsubmit = async (event) => {
194
195
  event.preventDefault();
195
196
  const formData = new FormData(form);
196
197
  const { action, ...data } = Object.fromEntries(formData);
197
- actionHandlers[action](data, formData);
198
+ try {
199
+ submitButton.disabled = true;
200
+ await actionHandlers[action](data, formData);
201
+ } finally {
202
+ submitButton.disabled = false;
203
+ }
198
204
  localStorage.setItem(`cadenzajs-sandbox-${action}`, JSON.stringify(data));
199
205
  };
200
206
 
@@ -333,7 +339,7 @@
333
339
  </select>
334
340
  </div>
335
341
 
336
- <button>Go!</button>
342
+ <button id="submit">Go!</button>
337
343
  </div>
338
344
 
339
345
  <fieldset id="settings"></fieldset>