@disy/cadenza.js 10.2.8 → 10.2.9
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.
- package/CHANGELOG.md +7 -0
- package/apidoc/assets/search.js +1 -1
- package/apidoc/classes/AbortError.html +3 -3
- package/apidoc/classes/CadenzaClient.html +26 -25
- package/apidoc/classes/CadenzaError.html +5 -5
- package/apidoc/functions/cadenza.html +4 -3
- package/apidoc/index.html +2 -2
- package/apidoc/interfaces/CadenzaClientOptions.html +5 -5
- package/apidoc/interfaces/CadenzaEvent.html +4 -4
- package/apidoc/interfaces/Distance.html +2 -2
- package/apidoc/interfaces/ExternalLinkKey.html +4 -4
- package/apidoc/interfaces/Feature.html +9 -9
- package/apidoc/interfaces/FeatureCollection.html +4 -4
- package/apidoc/interfaces/Geometry.html +4 -4
- package/apidoc/interfaces/GeometryExtentStrategy.html +4 -4
- package/apidoc/interfaces/LayerDataExtentStrategy.html +4 -4
- package/apidoc/interfaces/LayerDefinition.html +4 -4
- package/apidoc/interfaces/LocationFinderExtentStrategy.html +4 -4
- package/apidoc/interfaces/PageSource.html +3 -3
- package/apidoc/interfaces/StaticExtentStrategy.html +4 -4
- package/apidoc/modules.html +2 -2
- package/apidoc/types/CadenzaActionEvent.html +2 -2
- package/apidoc/types/CadenzaChangeSelectionEvent.html +2 -2
- package/apidoc/types/CadenzaDrillThroughEvent.html +2 -2
- package/apidoc/types/CadenzaEditGeometryCancelEvent.html +2 -2
- package/apidoc/types/CadenzaEditGeometryOkEvent.html +2 -2
- package/apidoc/types/CadenzaEditGeometryUpdateEvent.html +2 -2
- package/apidoc/types/CadenzaErrorEvent.html +2 -2
- package/apidoc/types/CadenzaEventByType.html +1 -1
- package/apidoc/types/CadenzaEventType.html +2 -2
- package/apidoc/types/CadenzaObjectInfoEvent.html +2 -2
- package/apidoc/types/CadenzaReloadEvent.html +2 -2
- package/apidoc/types/CadenzaSelectObjectsCancelEvent.html +2 -2
- package/apidoc/types/CadenzaSelectObjectsOkEvent.html +2 -2
- package/apidoc/types/Coordinate.html +2 -2
- package/apidoc/types/CustomValidityType.html +2 -2
- package/apidoc/types/DataType.html +2 -2
- package/apidoc/types/EmbeddingTargetId.html +2 -2
- package/apidoc/types/Extent.html +2 -2
- package/apidoc/types/ExtentStrategy.html +2 -2
- package/apidoc/types/FilterVariables.html +2 -2
- package/apidoc/types/GeometryType.html +2 -2
- package/apidoc/types/GlobalId.html +2 -2
- package/apidoc/types/LengthUnit.html +1 -1
- package/apidoc/types/OpaqueString.html +2 -2
- package/apidoc/types/OperationMode.html +2 -2
- package/apidoc/types/TablePart.html +2 -2
- package/apidoc/types/UiFeature.html +2 -2
- package/apidoc/types/WorkbookLayerPath.html +2 -2
- package/cadenza.d.ts +35 -5
- package/cadenza.js +32 -8
- package/package.json +1 -1
- package/sandbox.html +6 -6
package/cadenza.js
CHANGED
|
@@ -10,6 +10,9 @@
|
|
|
10
10
|
* Please ensure that the user has view privilege for that link!
|
|
11
11
|
* @property {boolean} [options.debug] - Whether to enable debug logging
|
|
12
12
|
*/
|
|
13
|
+
// This placeholder is replaced when Cadenza JS is released,
|
|
14
|
+
// i.e. during development, the version is not available.
|
|
15
|
+
const CADENZAJS_VERSION = '10.2.9';
|
|
13
16
|
/**
|
|
14
17
|
* Creates an instance of the Cadenza JS client.
|
|
15
18
|
*
|
|
@@ -40,9 +43,11 @@ export function cadenza(baseUrlOrOptions, options) {
|
|
|
40
43
|
: baseUrlOrOptions;
|
|
41
44
|
return new CadenzaClient(options);
|
|
42
45
|
}
|
|
46
|
+
cadenza.version = CADENZAJS_VERSION;
|
|
43
47
|
/* @ts-ignore */
|
|
44
48
|
const previousGlobalCadenza = globalThis.cadenza;
|
|
45
49
|
globalThis.cadenza = Object.assign((/** @type Parameters<cadenza> */ ...args) => cadenza(...args), {
|
|
50
|
+
version: CADENZAJS_VERSION,
|
|
46
51
|
noConflict() {
|
|
47
52
|
globalThis.cadenza = previousGlobalCadenza;
|
|
48
53
|
return cadenza;
|
|
@@ -190,7 +195,7 @@ let firstEmbeddingTargetShown;
|
|
|
190
195
|
* _Notes:_
|
|
191
196
|
* * Most public methods are tagged with one of these modifiers:
|
|
192
197
|
* * `Embed`: The method embeds Cadenza in the given iframe.
|
|
193
|
-
* * `Post Message`: The method communicates with an embedded
|
|
198
|
+
* * `Post Message`: The method communicates with an embedded Cadenza via postMessage.
|
|
194
199
|
* * `Post Message Parent`: The method communicates with a parent/opener Cadenza via postMessage.
|
|
195
200
|
* * `Server`: The method communicates with the Cadenza server via HTTP.
|
|
196
201
|
* * Most public methods can be aborted using an [AbortSignal](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal).
|
|
@@ -324,11 +329,12 @@ export class CadenzaClient {
|
|
|
324
329
|
* @param {object} [__namedParameters] - Options
|
|
325
330
|
* @param {boolean} [__namedParameters.invalidateCaches] - When true, caches will be invalidated for objecttypes used
|
|
326
331
|
* in the worksheet
|
|
332
|
+
* @return {Promise<void>} A `Promise` which resolves when the views of the worksheet have finished reloading
|
|
327
333
|
* @postMessage
|
|
328
334
|
*/
|
|
329
335
|
reload({ invalidateCaches = false } = {}) {
|
|
330
336
|
this.#log('CadenzaClient#reload', ...arguments);
|
|
331
|
-
this.#
|
|
337
|
+
return this.#postRequest('reload', { invalidateCaches });
|
|
332
338
|
}
|
|
333
339
|
/**
|
|
334
340
|
* Sends a message to parent Cadenza window to close the window containing this application
|
|
@@ -465,12 +471,19 @@ export class CadenzaClient {
|
|
|
465
471
|
* @hidden
|
|
466
472
|
* @param {WorkbookLayerPath | string} layer - The data view layer to set the selection in
|
|
467
473
|
* @param {unknown[][]} values - The IDs of the objects to select
|
|
474
|
+
* @param {object} [__namedParameters]
|
|
475
|
+
* @param {GeometryExtentStrategy} [__namedParameters.extentStrategy] - Strategy to define the new map extent
|
|
468
476
|
* @return {Promise<void>} A `Promise` for when the selection was set.
|
|
469
477
|
* @postMessage
|
|
470
478
|
*/
|
|
471
|
-
setSelection(layer, values) {
|
|
479
|
+
setSelection(layer, values, { extentStrategy } = {}) {
|
|
472
480
|
this.#log('CadenzaClient#setSelection', ...arguments);
|
|
473
|
-
|
|
481
|
+
const selectionResult = this.#postRequest('setSelection', {
|
|
482
|
+
layer: array(layer),
|
|
483
|
+
values,
|
|
484
|
+
});
|
|
485
|
+
this.#setExtentStrategy(extentStrategy);
|
|
486
|
+
return selectionResult;
|
|
474
487
|
}
|
|
475
488
|
/**
|
|
476
489
|
* Add to the selection in the currently shown workbook map view.
|
|
@@ -478,12 +491,19 @@ export class CadenzaClient {
|
|
|
478
491
|
* @hidden
|
|
479
492
|
* @param {WorkbookLayerPath | string} layer - The data view layer to change the selection in
|
|
480
493
|
* @param {unknown[][]} values - The IDs of the objects to select
|
|
494
|
+
* @param {object} [__namedParameters]
|
|
495
|
+
* @param {GeometryExtentStrategy} [__namedParameters.extentStrategy] - Strategy to define the new map extent
|
|
481
496
|
* @return {Promise<void>} A `Promise` for when the selection was changed.
|
|
482
497
|
* @postMessage
|
|
483
498
|
*/
|
|
484
|
-
addSelection(layer, values) {
|
|
499
|
+
addSelection(layer, values, { extentStrategy } = {}) {
|
|
485
500
|
this.#log('CadenzaClient#addSelection', ...arguments);
|
|
486
|
-
|
|
501
|
+
const selectionResult = this.#postRequest('addSelection', {
|
|
502
|
+
layer: array(layer),
|
|
503
|
+
values,
|
|
504
|
+
});
|
|
505
|
+
this.#setExtentStrategy(extentStrategy);
|
|
506
|
+
return selectionResult;
|
|
487
507
|
}
|
|
488
508
|
/**
|
|
489
509
|
* Remove from the selection in the currently shown workbook map view.
|
|
@@ -491,15 +511,19 @@ export class CadenzaClient {
|
|
|
491
511
|
* @hidden
|
|
492
512
|
* @param {WorkbookLayerPath | string} layer - The data view layer to change the selection in
|
|
493
513
|
* @param {unknown[][]} values - The IDs of the objects to unselect
|
|
514
|
+
* @param {object} [__namedParameters]
|
|
515
|
+
* @param {GeometryExtentStrategy} [__namedParameters.extentStrategy] - Strategy to define the new map extent
|
|
494
516
|
* @return {Promise<void>} A `Promise` for when the selection was changed.
|
|
495
517
|
* @postMessage
|
|
496
518
|
*/
|
|
497
|
-
removeSelection(layer, values) {
|
|
519
|
+
removeSelection(layer, values, { extentStrategy } = {}) {
|
|
498
520
|
this.#log('CadenzaClient#removeSelection', ...arguments);
|
|
499
|
-
|
|
521
|
+
const selectionResult = this.#postRequest('removeSelection', {
|
|
500
522
|
layer: array(layer),
|
|
501
523
|
values,
|
|
502
524
|
});
|
|
525
|
+
this.#setExtentStrategy(extentStrategy);
|
|
526
|
+
return selectionResult;
|
|
503
527
|
}
|
|
504
528
|
/**
|
|
505
529
|
* Create a geometry.
|
package/package.json
CHANGED
package/sandbox.html
CHANGED
|
@@ -162,9 +162,9 @@
|
|
|
162
162
|
},
|
|
163
163
|
setFilter: data => cadenzaClient.setFilter(parseFilterVariables(data.filter)),
|
|
164
164
|
setLayerVisibility: data => cadenzaClient.setLayerVisibility(JSON.parse(data.layer), data.visibility === 'on'),
|
|
165
|
-
setSelection: data => cadenzaClient.setSelection(JSON.parse(data.layer), JSON.parse(data.objectIds)),
|
|
166
|
-
addSelection: data => cadenzaClient.addSelection(JSON.parse(data.layer), JSON.parse(data.objectIds)),
|
|
167
|
-
removeSelection: data => cadenzaClient.removeSelection(JSON.parse(data.layer), JSON.parse(data.objectIds)),
|
|
165
|
+
setSelection: data => cadenzaClient.setSelection(JSON.parse(data.layer), JSON.parse(data.objectIds), {extentStrategy: JSON.parse(data.extentStrategy)}),
|
|
166
|
+
addSelection: data => cadenzaClient.addSelection(JSON.parse(data.layer), JSON.parse(data.objectIds), { extentStrategy: JSON.parse(data.extentStrategy) }),
|
|
167
|
+
removeSelection: data => cadenzaClient.removeSelection(JSON.parse(data.layer), JSON.parse(data.objectIds), { extentStrategy: JSON.parse(data.extentStrategy) }),
|
|
168
168
|
createGeometry: data => cadenzaClient.createGeometry(data.embeddingTargetId, data.geometryType, getOptions(data)),
|
|
169
169
|
editGeometry: ({ geometry, ...data }) => cadenzaClient.editGeometry(data.embeddingTargetId, JSON.parse(geometry), getOptions(data)),
|
|
170
170
|
selectObjects: data => cadenzaClient.selectObjects(data.embeddingTargetId, getOptions(data)),
|
|
@@ -578,9 +578,9 @@
|
|
|
578
578
|
</div>
|
|
579
579
|
</template>
|
|
580
580
|
|
|
581
|
-
<template data-action="setSelection" data-common="layer,object-ids"></template>
|
|
582
|
-
<template data-action="addSelection" data-common="layer,object-ids"></template>
|
|
583
|
-
<template data-action="removeSelection" data-common="layer,object-ids"></template>
|
|
581
|
+
<template data-action="setSelection" data-common="layer,object-ids,extentStrategy"></template>
|
|
582
|
+
<template data-action="addSelection" data-common="layer,object-ids,extentStrategy"></template>
|
|
583
|
+
<template data-action="removeSelection" data-common="layer,object-ids,extentStrategy"></template>
|
|
584
584
|
|
|
585
585
|
<template data-action="reload">
|
|
586
586
|
<div>
|