@itwin/rpcinterface-full-stack-tests 4.5.0-dev.40 → 4.5.0-dev.41
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/lib/dist/_bea9.bundled-tests.js.map +1 -1
- package/lib/dist/bundled-tests.js +884 -90
- package/lib/dist/bundled-tests.js.map +1 -1
- package/lib/dist/core_frontend_lib_esm_ApproximateTerrainHeightsProps_js.bundled-tests.js.map +1 -1
- package/lib/dist/vendors-common_temp_node_modules_pnpm_loaders_gl_draco_3_1_6_node_modules_loaders_gl_draco_di-0642a6.bundled-tests.js.map +1 -1
- package/package.json +14 -14
|
@@ -3223,6 +3223,467 @@ __exportStar(__webpack_require__(/*! ./TestFrontendAuthorizationClient */ "../..
|
|
|
3223
3223
|
__exportStar(__webpack_require__(/*! ./certa/certaCommon */ "../../common/temp/node_modules/.pnpm/@itwin+oidc-signin-tool@3.6.0_mdtbcqczpmeuv6yjzfaigjndwi/node_modules/@itwin/oidc-signin-tool/lib/cjs/certa/certaCommon.js"), exports);
|
|
3224
3224
|
//# sourceMappingURL=frontend.js.map
|
|
3225
3225
|
|
|
3226
|
+
/***/ }),
|
|
3227
|
+
|
|
3228
|
+
/***/ "../../common/temp/node_modules/.pnpm/@itwin+unified-selection@0.1.0/node_modules/@itwin/unified-selection/lib/esm/unified-selection.js":
|
|
3229
|
+
/*!**********************************************************************************************************************************************!*\
|
|
3230
|
+
!*** ../../common/temp/node_modules/.pnpm/@itwin+unified-selection@0.1.0/node_modules/@itwin/unified-selection/lib/esm/unified-selection.js ***!
|
|
3231
|
+
\**********************************************************************************************************************************************/
|
|
3232
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
3233
|
+
|
|
3234
|
+
"use strict";
|
|
3235
|
+
__webpack_require__.r(__webpack_exports__);
|
|
3236
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
3237
|
+
/* harmony export */ "Selectable": () => (/* reexport safe */ _unified_selection_Selectable__WEBPACK_IMPORTED_MODULE_0__.Selectable),
|
|
3238
|
+
/* harmony export */ "Selectables": () => (/* reexport safe */ _unified_selection_Selectable__WEBPACK_IMPORTED_MODULE_0__.Selectables),
|
|
3239
|
+
/* harmony export */ "createStorage": () => (/* reexport safe */ _unified_selection_SelectionStorage__WEBPACK_IMPORTED_MODULE_1__.createStorage)
|
|
3240
|
+
/* harmony export */ });
|
|
3241
|
+
/* harmony import */ var _unified_selection_Selectable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./unified-selection/Selectable */ "../../common/temp/node_modules/.pnpm/@itwin+unified-selection@0.1.0/node_modules/@itwin/unified-selection/lib/esm/unified-selection/Selectable.js");
|
|
3242
|
+
/* harmony import */ var _unified_selection_SelectionStorage__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./unified-selection/SelectionStorage */ "../../common/temp/node_modules/.pnpm/@itwin+unified-selection@0.1.0/node_modules/@itwin/unified-selection/lib/esm/unified-selection/SelectionStorage.js");
|
|
3243
|
+
/*---------------------------------------------------------------------------------------------
|
|
3244
|
+
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
3245
|
+
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
3246
|
+
*--------------------------------------------------------------------------------------------*/
|
|
3247
|
+
/**
|
|
3248
|
+
* @module UnifiedSelection
|
|
3249
|
+
*
|
|
3250
|
+
* @docs-group-description UnifiedSelection
|
|
3251
|
+
* API for working with unified selection.
|
|
3252
|
+
*/
|
|
3253
|
+
|
|
3254
|
+
|
|
3255
|
+
|
|
3256
|
+
|
|
3257
|
+
/***/ }),
|
|
3258
|
+
|
|
3259
|
+
/***/ "../../common/temp/node_modules/.pnpm/@itwin+unified-selection@0.1.0/node_modules/@itwin/unified-selection/lib/esm/unified-selection/Selectable.js":
|
|
3260
|
+
/*!*********************************************************************************************************************************************************!*\
|
|
3261
|
+
!*** ../../common/temp/node_modules/.pnpm/@itwin+unified-selection@0.1.0/node_modules/@itwin/unified-selection/lib/esm/unified-selection/Selectable.js ***!
|
|
3262
|
+
\*********************************************************************************************************************************************************/
|
|
3263
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
3264
|
+
|
|
3265
|
+
"use strict";
|
|
3266
|
+
__webpack_require__.r(__webpack_exports__);
|
|
3267
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
3268
|
+
/* harmony export */ "Selectable": () => (/* binding */ Selectable),
|
|
3269
|
+
/* harmony export */ "Selectables": () => (/* binding */ Selectables)
|
|
3270
|
+
/* harmony export */ });
|
|
3271
|
+
/*---------------------------------------------------------------------------------------------
|
|
3272
|
+
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
3273
|
+
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
3274
|
+
*--------------------------------------------------------------------------------------------*/
|
|
3275
|
+
/** @beta */
|
|
3276
|
+
// eslint-disable-next-line @typescript-eslint/no-redeclare
|
|
3277
|
+
var Selectable;
|
|
3278
|
+
(function (Selectable) {
|
|
3279
|
+
/** Check if the supplied selectable is a `SelectableInstanceKey` */
|
|
3280
|
+
function isInstanceKey(selectable) {
|
|
3281
|
+
const instanceKey = selectable;
|
|
3282
|
+
return !!instanceKey.className && !!instanceKey.id;
|
|
3283
|
+
}
|
|
3284
|
+
Selectable.isInstanceKey = isInstanceKey;
|
|
3285
|
+
/** Check if the supplied selectable is a `CustomSelectable` */
|
|
3286
|
+
function isCustom(selectable) {
|
|
3287
|
+
return !!selectable.identifier;
|
|
3288
|
+
}
|
|
3289
|
+
Selectable.isCustom = isCustom;
|
|
3290
|
+
})(Selectable || (Selectable = {}));
|
|
3291
|
+
/** @beta */
|
|
3292
|
+
// eslint-disable-next-line @typescript-eslint/no-redeclare
|
|
3293
|
+
var Selectables;
|
|
3294
|
+
(function (Selectables) {
|
|
3295
|
+
/**
|
|
3296
|
+
* Creates `Selectables` from array of selectable
|
|
3297
|
+
* @param source Source to create selectables from
|
|
3298
|
+
* @beta
|
|
3299
|
+
*/
|
|
3300
|
+
function create(source) {
|
|
3301
|
+
const newSelectables = {
|
|
3302
|
+
instanceKeys: new Map(),
|
|
3303
|
+
custom: new Map(),
|
|
3304
|
+
};
|
|
3305
|
+
Selectables.add(newSelectables, source);
|
|
3306
|
+
return newSelectables;
|
|
3307
|
+
}
|
|
3308
|
+
Selectables.create = create;
|
|
3309
|
+
/**
|
|
3310
|
+
* Get the number of selectables stored in a `Selectables` object.
|
|
3311
|
+
* @param selectables `Selectables` object to get size for
|
|
3312
|
+
* @beta
|
|
3313
|
+
*/
|
|
3314
|
+
function size(selectables) {
|
|
3315
|
+
let insatanceCount = 0;
|
|
3316
|
+
selectables.instanceKeys.forEach((set) => (insatanceCount += set.size));
|
|
3317
|
+
return insatanceCount + selectables.custom.size;
|
|
3318
|
+
}
|
|
3319
|
+
Selectables.size = size;
|
|
3320
|
+
/**
|
|
3321
|
+
* Is a `Selectables` object currently empty.
|
|
3322
|
+
* @param selectables `Selectables` object to check
|
|
3323
|
+
* @beta
|
|
3324
|
+
*/
|
|
3325
|
+
function isEmpty(selectables) {
|
|
3326
|
+
return Selectables.size(selectables) === 0;
|
|
3327
|
+
}
|
|
3328
|
+
Selectables.isEmpty = isEmpty;
|
|
3329
|
+
/**
|
|
3330
|
+
* Check if a `Selectables` object contains the specified selectable.
|
|
3331
|
+
* @param selectables `Selectables` object to check
|
|
3332
|
+
* @param value The selectable to check for.
|
|
3333
|
+
* @beta
|
|
3334
|
+
*/
|
|
3335
|
+
function has(selectables, value) {
|
|
3336
|
+
if (Selectable.isInstanceKey(value)) {
|
|
3337
|
+
const normalizedClassName = normalizeClassName(value.className);
|
|
3338
|
+
const set = selectables.instanceKeys.get(normalizedClassName);
|
|
3339
|
+
return !!(set && set.has(value.id));
|
|
3340
|
+
}
|
|
3341
|
+
return selectables.custom.has(value.identifier);
|
|
3342
|
+
}
|
|
3343
|
+
Selectables.has = has;
|
|
3344
|
+
/**
|
|
3345
|
+
* Check if a `Selectables` object contains all the specified selectables.
|
|
3346
|
+
* @param selectables `Selectables` object to check
|
|
3347
|
+
* @param values The selectables to check for.
|
|
3348
|
+
* @beta
|
|
3349
|
+
*/
|
|
3350
|
+
function hasAll(selectables, values) {
|
|
3351
|
+
if (Selectables.size(selectables) < values.length) {
|
|
3352
|
+
return false;
|
|
3353
|
+
}
|
|
3354
|
+
for (const selectable of values) {
|
|
3355
|
+
if (!Selectables.has(selectables, selectable)) {
|
|
3356
|
+
return false;
|
|
3357
|
+
}
|
|
3358
|
+
}
|
|
3359
|
+
return true;
|
|
3360
|
+
}
|
|
3361
|
+
Selectables.hasAll = hasAll;
|
|
3362
|
+
/**
|
|
3363
|
+
* Check if a `Selectables` object contains any of the specified selectables.
|
|
3364
|
+
* @param selectables `Selectables` object to check
|
|
3365
|
+
* @param values The selectables to check for.
|
|
3366
|
+
* @beta
|
|
3367
|
+
*/
|
|
3368
|
+
function hasAny(selectables, values) {
|
|
3369
|
+
for (const selectable of values) {
|
|
3370
|
+
if (Selectables.has(selectables, selectable)) {
|
|
3371
|
+
return true;
|
|
3372
|
+
}
|
|
3373
|
+
}
|
|
3374
|
+
return false;
|
|
3375
|
+
}
|
|
3376
|
+
Selectables.hasAny = hasAny;
|
|
3377
|
+
/**
|
|
3378
|
+
* Add a one or more selectables to a `Selectables`
|
|
3379
|
+
* @param selectables `Selectables` object to add selectables for
|
|
3380
|
+
* @param values Selectables to add.
|
|
3381
|
+
* @beta
|
|
3382
|
+
*/
|
|
3383
|
+
function add(selectables, values) {
|
|
3384
|
+
let hasChanged = false;
|
|
3385
|
+
for (const selectable of values) {
|
|
3386
|
+
if (Selectable.isInstanceKey(selectable)) {
|
|
3387
|
+
const normalizedClassName = normalizeClassName(selectable.className);
|
|
3388
|
+
let set = selectables.instanceKeys.get(normalizedClassName);
|
|
3389
|
+
if (!set) {
|
|
3390
|
+
set = new Set();
|
|
3391
|
+
}
|
|
3392
|
+
if (!set.has(selectable.id)) {
|
|
3393
|
+
set.add(selectable.id);
|
|
3394
|
+
selectables.instanceKeys.set(normalizedClassName, set);
|
|
3395
|
+
hasChanged = true;
|
|
3396
|
+
}
|
|
3397
|
+
}
|
|
3398
|
+
else if (!selectables.custom.has(selectable.identifier)) {
|
|
3399
|
+
selectables.custom.set(selectable.identifier, selectable);
|
|
3400
|
+
hasChanged = true;
|
|
3401
|
+
}
|
|
3402
|
+
}
|
|
3403
|
+
return hasChanged;
|
|
3404
|
+
}
|
|
3405
|
+
Selectables.add = add;
|
|
3406
|
+
/**
|
|
3407
|
+
* Removes one or more selectables from a `Selectables` object.
|
|
3408
|
+
* @param selectables `Selectables` object to remove selectables for
|
|
3409
|
+
* @param values Selectables to remove.
|
|
3410
|
+
* @beta
|
|
3411
|
+
*/
|
|
3412
|
+
function remove(selectables, values) {
|
|
3413
|
+
let hasChanged = false;
|
|
3414
|
+
for (const selectable of values) {
|
|
3415
|
+
if (Selectable.isInstanceKey(selectable)) {
|
|
3416
|
+
const normalizedClassName = normalizeClassName(selectable.className);
|
|
3417
|
+
const set = selectables.instanceKeys.get(normalizedClassName);
|
|
3418
|
+
if (set && set.has(selectable.id)) {
|
|
3419
|
+
set.delete(selectable.id);
|
|
3420
|
+
hasChanged = true;
|
|
3421
|
+
if (set.size === 0) {
|
|
3422
|
+
selectables.instanceKeys.delete(normalizedClassName);
|
|
3423
|
+
}
|
|
3424
|
+
}
|
|
3425
|
+
}
|
|
3426
|
+
else if (selectables.custom.has(selectable.identifier)) {
|
|
3427
|
+
selectables.custom.delete(selectable.identifier);
|
|
3428
|
+
hasChanged = true;
|
|
3429
|
+
}
|
|
3430
|
+
}
|
|
3431
|
+
return hasChanged;
|
|
3432
|
+
}
|
|
3433
|
+
Selectables.remove = remove;
|
|
3434
|
+
/**
|
|
3435
|
+
* Clear a `Selectables` object.
|
|
3436
|
+
* @param selectables `Selectables` object to clear selectables for
|
|
3437
|
+
* @beta
|
|
3438
|
+
*/
|
|
3439
|
+
function clear(selectables) {
|
|
3440
|
+
if (Selectables.size(selectables) === 0) {
|
|
3441
|
+
return false;
|
|
3442
|
+
}
|
|
3443
|
+
selectables.instanceKeys = new Map();
|
|
3444
|
+
selectables.custom = new Map();
|
|
3445
|
+
return true;
|
|
3446
|
+
}
|
|
3447
|
+
Selectables.clear = clear;
|
|
3448
|
+
/**
|
|
3449
|
+
* Check whether at least one selectable passes a condition in a `Selectables` object.
|
|
3450
|
+
* @param selectables `Selectables` object to check
|
|
3451
|
+
* @beta
|
|
3452
|
+
*/
|
|
3453
|
+
function some(selectables, callback) {
|
|
3454
|
+
for (const entry of selectables.instanceKeys) {
|
|
3455
|
+
for (const item of entry[1]) {
|
|
3456
|
+
if (callback({ className: entry[0], id: item })) {
|
|
3457
|
+
return true;
|
|
3458
|
+
}
|
|
3459
|
+
}
|
|
3460
|
+
}
|
|
3461
|
+
for (const entry of selectables.custom) {
|
|
3462
|
+
if (callback(entry[1])) {
|
|
3463
|
+
return true;
|
|
3464
|
+
}
|
|
3465
|
+
}
|
|
3466
|
+
return false;
|
|
3467
|
+
}
|
|
3468
|
+
Selectables.some = some;
|
|
3469
|
+
/**
|
|
3470
|
+
* Iterate over all keys in a `Selectables` object.
|
|
3471
|
+
* @param selectables `Selectables` object to iterate over
|
|
3472
|
+
* @beta
|
|
3473
|
+
*/
|
|
3474
|
+
function forEach(selectables, callback) {
|
|
3475
|
+
let index = 0;
|
|
3476
|
+
selectables.instanceKeys.forEach((ids, className) => {
|
|
3477
|
+
ids.forEach((id) => callback({ className, id }, index++));
|
|
3478
|
+
});
|
|
3479
|
+
selectables.custom.forEach((data) => {
|
|
3480
|
+
callback(data, index++);
|
|
3481
|
+
});
|
|
3482
|
+
}
|
|
3483
|
+
Selectables.forEach = forEach;
|
|
3484
|
+
function normalizeClassName(className) {
|
|
3485
|
+
return className.replace(".", ":");
|
|
3486
|
+
}
|
|
3487
|
+
})(Selectables || (Selectables = {}));
|
|
3488
|
+
|
|
3489
|
+
|
|
3490
|
+
/***/ }),
|
|
3491
|
+
|
|
3492
|
+
/***/ "../../common/temp/node_modules/.pnpm/@itwin+unified-selection@0.1.0/node_modules/@itwin/unified-selection/lib/esm/unified-selection/SelectionChangeEvent.js":
|
|
3493
|
+
/*!*******************************************************************************************************************************************************************!*\
|
|
3494
|
+
!*** ../../common/temp/node_modules/.pnpm/@itwin+unified-selection@0.1.0/node_modules/@itwin/unified-selection/lib/esm/unified-selection/SelectionChangeEvent.js ***!
|
|
3495
|
+
\*******************************************************************************************************************************************************************/
|
|
3496
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
3497
|
+
|
|
3498
|
+
"use strict";
|
|
3499
|
+
__webpack_require__.r(__webpack_exports__);
|
|
3500
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
3501
|
+
/* harmony export */ "SelectionChangeEventImpl": () => (/* binding */ SelectionChangeEventImpl)
|
|
3502
|
+
/* harmony export */ });
|
|
3503
|
+
/*---------------------------------------------------------------------------------------------
|
|
3504
|
+
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
3505
|
+
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
3506
|
+
*--------------------------------------------------------------------------------------------*/
|
|
3507
|
+
/**
|
|
3508
|
+
* An event broadcasted on selection changes
|
|
3509
|
+
* @internal
|
|
3510
|
+
*/
|
|
3511
|
+
class SelectionChangeEventImpl {
|
|
3512
|
+
_listeners = [];
|
|
3513
|
+
/**
|
|
3514
|
+
* Registers a Listener to be executed whenever this event is raised
|
|
3515
|
+
* @param listener The function to be executed when the event is raised
|
|
3516
|
+
* @returns A function that will remove this event listener
|
|
3517
|
+
* @beta
|
|
3518
|
+
*/
|
|
3519
|
+
addListener(listener) {
|
|
3520
|
+
this._listeners.push(listener);
|
|
3521
|
+
return () => this.removeListener(listener);
|
|
3522
|
+
}
|
|
3523
|
+
/**
|
|
3524
|
+
* Un-register a previously registered listener
|
|
3525
|
+
* @param listener The listener to be unregistered
|
|
3526
|
+
* @beta
|
|
3527
|
+
*/
|
|
3528
|
+
removeListener(listener) {
|
|
3529
|
+
this._listeners = this._listeners.filter((x) => x !== listener);
|
|
3530
|
+
}
|
|
3531
|
+
/**
|
|
3532
|
+
* Raises the event by calling each registered listener with the supplied arguments
|
|
3533
|
+
* @param args Event arguments
|
|
3534
|
+
* @param storage Storage that the selection changed in
|
|
3535
|
+
* @beta
|
|
3536
|
+
*/
|
|
3537
|
+
raiseEvent(args, storage) {
|
|
3538
|
+
this._listeners.forEach((listener) => listener(args, storage));
|
|
3539
|
+
}
|
|
3540
|
+
}
|
|
3541
|
+
|
|
3542
|
+
|
|
3543
|
+
/***/ }),
|
|
3544
|
+
|
|
3545
|
+
/***/ "../../common/temp/node_modules/.pnpm/@itwin+unified-selection@0.1.0/node_modules/@itwin/unified-selection/lib/esm/unified-selection/SelectionStorage.js":
|
|
3546
|
+
/*!***************************************************************************************************************************************************************!*\
|
|
3547
|
+
!*** ../../common/temp/node_modules/.pnpm/@itwin+unified-selection@0.1.0/node_modules/@itwin/unified-selection/lib/esm/unified-selection/SelectionStorage.js ***!
|
|
3548
|
+
\***************************************************************************************************************************************************************/
|
|
3549
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
3550
|
+
|
|
3551
|
+
"use strict";
|
|
3552
|
+
__webpack_require__.r(__webpack_exports__);
|
|
3553
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
3554
|
+
/* harmony export */ "createStorage": () => (/* binding */ createStorage)
|
|
3555
|
+
/* harmony export */ });
|
|
3556
|
+
/* harmony import */ var _Selectable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./Selectable */ "../../common/temp/node_modules/.pnpm/@itwin+unified-selection@0.1.0/node_modules/@itwin/unified-selection/lib/esm/unified-selection/Selectable.js");
|
|
3557
|
+
/* harmony import */ var _SelectionChangeEvent__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./SelectionChangeEvent */ "../../common/temp/node_modules/.pnpm/@itwin+unified-selection@0.1.0/node_modules/@itwin/unified-selection/lib/esm/unified-selection/SelectionChangeEvent.js");
|
|
3558
|
+
/*---------------------------------------------------------------------------------------------
|
|
3559
|
+
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
3560
|
+
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
3561
|
+
*--------------------------------------------------------------------------------------------*/
|
|
3562
|
+
/** @packageDocumentation
|
|
3563
|
+
* @module UnifiedSelection
|
|
3564
|
+
*/
|
|
3565
|
+
|
|
3566
|
+
|
|
3567
|
+
/**
|
|
3568
|
+
* Creates a selection storage. When an iModel is closed `SelectionStorage.clearSelection` function should be called.
|
|
3569
|
+
* @beta
|
|
3570
|
+
*/
|
|
3571
|
+
function createStorage() {
|
|
3572
|
+
return new SelectionStorageImpl();
|
|
3573
|
+
}
|
|
3574
|
+
class SelectionStorageImpl {
|
|
3575
|
+
_storage = new Map();
|
|
3576
|
+
selectionChangeEvent;
|
|
3577
|
+
constructor() {
|
|
3578
|
+
this.selectionChangeEvent = new _SelectionChangeEvent__WEBPACK_IMPORTED_MODULE_1__.SelectionChangeEventImpl();
|
|
3579
|
+
}
|
|
3580
|
+
getSelectionLevels({ iModelKey }) {
|
|
3581
|
+
return this.getContainer(iModelKey).getSelectionLevels();
|
|
3582
|
+
}
|
|
3583
|
+
getSelection(props) {
|
|
3584
|
+
const { iModelKey, level } = props;
|
|
3585
|
+
return this.getContainer(iModelKey).getSelection(level ?? 0);
|
|
3586
|
+
}
|
|
3587
|
+
addToSelection(props) {
|
|
3588
|
+
this.handleChange({ ...props, changeType: "add" });
|
|
3589
|
+
}
|
|
3590
|
+
removeFromSelection(props) {
|
|
3591
|
+
this.handleChange({ ...props, changeType: "remove" });
|
|
3592
|
+
}
|
|
3593
|
+
replaceSelection(props) {
|
|
3594
|
+
this.handleChange({ ...props, changeType: "replace" });
|
|
3595
|
+
}
|
|
3596
|
+
clearSelection(props) {
|
|
3597
|
+
this.handleChange({ ...props, changeType: "clear", selectables: [] });
|
|
3598
|
+
}
|
|
3599
|
+
clearStorage({ iModelKey }) {
|
|
3600
|
+
this.clearSelection({ source: "Clear iModel storage", iModelKey });
|
|
3601
|
+
this._storage.delete(iModelKey);
|
|
3602
|
+
}
|
|
3603
|
+
getContainer(iModelKey) {
|
|
3604
|
+
let selectionContainer = this._storage.get(iModelKey);
|
|
3605
|
+
if (!selectionContainer) {
|
|
3606
|
+
selectionContainer = new MultiLevelSelectablesContainer();
|
|
3607
|
+
this._storage.set(iModelKey, selectionContainer);
|
|
3608
|
+
}
|
|
3609
|
+
return selectionContainer;
|
|
3610
|
+
}
|
|
3611
|
+
handleChange(props) {
|
|
3612
|
+
const { iModelKey, source, level: inLevel, changeType, selectables: change } = props;
|
|
3613
|
+
const container = this.getContainer(iModelKey);
|
|
3614
|
+
const level = inLevel ?? 0;
|
|
3615
|
+
const selectables = container.getSelection(level);
|
|
3616
|
+
const selected = _Selectable__WEBPACK_IMPORTED_MODULE_0__.Selectables.create(change);
|
|
3617
|
+
switch (changeType) {
|
|
3618
|
+
case "add":
|
|
3619
|
+
if (!_Selectable__WEBPACK_IMPORTED_MODULE_0__.Selectables.add(selectables, change)) {
|
|
3620
|
+
return;
|
|
3621
|
+
}
|
|
3622
|
+
break;
|
|
3623
|
+
case "remove":
|
|
3624
|
+
if (!_Selectable__WEBPACK_IMPORTED_MODULE_0__.Selectables.remove(selectables, change)) {
|
|
3625
|
+
return;
|
|
3626
|
+
}
|
|
3627
|
+
break;
|
|
3628
|
+
case "replace":
|
|
3629
|
+
if (_Selectable__WEBPACK_IMPORTED_MODULE_0__.Selectables.size(selectables) === _Selectable__WEBPACK_IMPORTED_MODULE_0__.Selectables.size(selected) && _Selectable__WEBPACK_IMPORTED_MODULE_0__.Selectables.hasAll(selectables, change)) {
|
|
3630
|
+
return;
|
|
3631
|
+
}
|
|
3632
|
+
_Selectable__WEBPACK_IMPORTED_MODULE_0__.Selectables.clear(selectables);
|
|
3633
|
+
_Selectable__WEBPACK_IMPORTED_MODULE_0__.Selectables.add(selectables, change);
|
|
3634
|
+
break;
|
|
3635
|
+
case "clear":
|
|
3636
|
+
if (!_Selectable__WEBPACK_IMPORTED_MODULE_0__.Selectables.clear(selectables)) {
|
|
3637
|
+
return;
|
|
3638
|
+
}
|
|
3639
|
+
break;
|
|
3640
|
+
}
|
|
3641
|
+
container.clear(level + 1);
|
|
3642
|
+
const event = {
|
|
3643
|
+
source,
|
|
3644
|
+
level,
|
|
3645
|
+
iModelKey,
|
|
3646
|
+
changeType,
|
|
3647
|
+
selectables: selected,
|
|
3648
|
+
timestamp: new Date(),
|
|
3649
|
+
};
|
|
3650
|
+
this.selectionChangeEvent.raiseEvent(event, this);
|
|
3651
|
+
}
|
|
3652
|
+
}
|
|
3653
|
+
class MultiLevelSelectablesContainer {
|
|
3654
|
+
_selectablesContainers;
|
|
3655
|
+
constructor() {
|
|
3656
|
+
this._selectablesContainers = new Map();
|
|
3657
|
+
}
|
|
3658
|
+
getSelection(level) {
|
|
3659
|
+
let selectables = this._selectablesContainers.get(level);
|
|
3660
|
+
if (!selectables) {
|
|
3661
|
+
selectables = _Selectable__WEBPACK_IMPORTED_MODULE_0__.Selectables.create([]);
|
|
3662
|
+
this._selectablesContainers.set(level, selectables);
|
|
3663
|
+
}
|
|
3664
|
+
return selectables;
|
|
3665
|
+
}
|
|
3666
|
+
getSelectionLevels() {
|
|
3667
|
+
const levels = new Array();
|
|
3668
|
+
for (const entry of this._selectablesContainers.entries()) {
|
|
3669
|
+
if (!_Selectable__WEBPACK_IMPORTED_MODULE_0__.Selectables.isEmpty(entry[1])) {
|
|
3670
|
+
levels.push(entry[0]);
|
|
3671
|
+
}
|
|
3672
|
+
}
|
|
3673
|
+
return levels.sort();
|
|
3674
|
+
}
|
|
3675
|
+
clear(level) {
|
|
3676
|
+
const storedLevels = this._selectablesContainers.keys();
|
|
3677
|
+
for (const storedLevel of storedLevels) {
|
|
3678
|
+
if (storedLevel >= level) {
|
|
3679
|
+
const selectables = this._selectablesContainers.get(storedLevel);
|
|
3680
|
+
_Selectable__WEBPACK_IMPORTED_MODULE_0__.Selectables.clear(selectables);
|
|
3681
|
+
}
|
|
3682
|
+
}
|
|
3683
|
+
}
|
|
3684
|
+
}
|
|
3685
|
+
|
|
3686
|
+
|
|
3226
3687
|
/***/ }),
|
|
3227
3688
|
|
|
3228
3689
|
/***/ "../../common/temp/node_modules/.pnpm/almost-equal@1.1.0/node_modules/almost-equal/almost_equal.js":
|
|
@@ -25420,6 +25881,30 @@ function concat() {
|
|
|
25420
25881
|
}
|
|
25421
25882
|
|
|
25422
25883
|
|
|
25884
|
+
/***/ }),
|
|
25885
|
+
|
|
25886
|
+
/***/ "../../common/temp/node_modules/.pnpm/rxjs@7.8.1/node_modules/rxjs/dist/esm5/internal/observable/defer.js":
|
|
25887
|
+
/*!****************************************************************************************************************!*\
|
|
25888
|
+
!*** ../../common/temp/node_modules/.pnpm/rxjs@7.8.1/node_modules/rxjs/dist/esm5/internal/observable/defer.js ***!
|
|
25889
|
+
\****************************************************************************************************************/
|
|
25890
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
25891
|
+
|
|
25892
|
+
"use strict";
|
|
25893
|
+
__webpack_require__.r(__webpack_exports__);
|
|
25894
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
25895
|
+
/* harmony export */ "defer": () => (/* binding */ defer)
|
|
25896
|
+
/* harmony export */ });
|
|
25897
|
+
/* harmony import */ var _Observable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../Observable */ "../../common/temp/node_modules/.pnpm/rxjs@7.8.1/node_modules/rxjs/dist/esm5/internal/Observable.js");
|
|
25898
|
+
/* harmony import */ var _innerFrom__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./innerFrom */ "../../common/temp/node_modules/.pnpm/rxjs@7.8.1/node_modules/rxjs/dist/esm5/internal/observable/innerFrom.js");
|
|
25899
|
+
|
|
25900
|
+
|
|
25901
|
+
function defer(observableFactory) {
|
|
25902
|
+
return new _Observable__WEBPACK_IMPORTED_MODULE_0__.Observable(function (subscriber) {
|
|
25903
|
+
(0,_innerFrom__WEBPACK_IMPORTED_MODULE_1__.innerFrom)(observableFactory()).subscribe(subscriber);
|
|
25904
|
+
});
|
|
25905
|
+
}
|
|
25906
|
+
|
|
25907
|
+
|
|
25423
25908
|
/***/ }),
|
|
25424
25909
|
|
|
25425
25910
|
/***/ "../../common/temp/node_modules/.pnpm/rxjs@7.8.1/node_modules/rxjs/dist/esm5/internal/observable/empty.js":
|
|
@@ -26230,6 +26715,93 @@ function subscribeOn(scheduler, delay) {
|
|
|
26230
26715
|
}
|
|
26231
26716
|
|
|
26232
26717
|
|
|
26718
|
+
/***/ }),
|
|
26719
|
+
|
|
26720
|
+
/***/ "../../common/temp/node_modules/.pnpm/rxjs@7.8.1/node_modules/rxjs/dist/esm5/internal/operators/takeUntil.js":
|
|
26721
|
+
/*!*******************************************************************************************************************!*\
|
|
26722
|
+
!*** ../../common/temp/node_modules/.pnpm/rxjs@7.8.1/node_modules/rxjs/dist/esm5/internal/operators/takeUntil.js ***!
|
|
26723
|
+
\*******************************************************************************************************************/
|
|
26724
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
26725
|
+
|
|
26726
|
+
"use strict";
|
|
26727
|
+
__webpack_require__.r(__webpack_exports__);
|
|
26728
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
26729
|
+
/* harmony export */ "takeUntil": () => (/* binding */ takeUntil)
|
|
26730
|
+
/* harmony export */ });
|
|
26731
|
+
/* harmony import */ var _util_lift__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../util/lift */ "../../common/temp/node_modules/.pnpm/rxjs@7.8.1/node_modules/rxjs/dist/esm5/internal/util/lift.js");
|
|
26732
|
+
/* harmony import */ var _OperatorSubscriber__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./OperatorSubscriber */ "../../common/temp/node_modules/.pnpm/rxjs@7.8.1/node_modules/rxjs/dist/esm5/internal/operators/OperatorSubscriber.js");
|
|
26733
|
+
/* harmony import */ var _observable_innerFrom__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../observable/innerFrom */ "../../common/temp/node_modules/.pnpm/rxjs@7.8.1/node_modules/rxjs/dist/esm5/internal/observable/innerFrom.js");
|
|
26734
|
+
/* harmony import */ var _util_noop__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../util/noop */ "../../common/temp/node_modules/.pnpm/rxjs@7.8.1/node_modules/rxjs/dist/esm5/internal/util/noop.js");
|
|
26735
|
+
|
|
26736
|
+
|
|
26737
|
+
|
|
26738
|
+
|
|
26739
|
+
function takeUntil(notifier) {
|
|
26740
|
+
return (0,_util_lift__WEBPACK_IMPORTED_MODULE_0__.operate)(function (source, subscriber) {
|
|
26741
|
+
(0,_observable_innerFrom__WEBPACK_IMPORTED_MODULE_1__.innerFrom)(notifier).subscribe((0,_OperatorSubscriber__WEBPACK_IMPORTED_MODULE_2__.createOperatorSubscriber)(subscriber, function () { return subscriber.complete(); }, _util_noop__WEBPACK_IMPORTED_MODULE_3__.noop));
|
|
26742
|
+
!subscriber.closed && source.subscribe(subscriber);
|
|
26743
|
+
});
|
|
26744
|
+
}
|
|
26745
|
+
|
|
26746
|
+
|
|
26747
|
+
/***/ }),
|
|
26748
|
+
|
|
26749
|
+
/***/ "../../common/temp/node_modules/.pnpm/rxjs@7.8.1/node_modules/rxjs/dist/esm5/internal/operators/tap.js":
|
|
26750
|
+
/*!*************************************************************************************************************!*\
|
|
26751
|
+
!*** ../../common/temp/node_modules/.pnpm/rxjs@7.8.1/node_modules/rxjs/dist/esm5/internal/operators/tap.js ***!
|
|
26752
|
+
\*************************************************************************************************************/
|
|
26753
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
26754
|
+
|
|
26755
|
+
"use strict";
|
|
26756
|
+
__webpack_require__.r(__webpack_exports__);
|
|
26757
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
26758
|
+
/* harmony export */ "tap": () => (/* binding */ tap)
|
|
26759
|
+
/* harmony export */ });
|
|
26760
|
+
/* harmony import */ var _util_isFunction__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../util/isFunction */ "../../common/temp/node_modules/.pnpm/rxjs@7.8.1/node_modules/rxjs/dist/esm5/internal/util/isFunction.js");
|
|
26761
|
+
/* harmony import */ var _util_lift__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../util/lift */ "../../common/temp/node_modules/.pnpm/rxjs@7.8.1/node_modules/rxjs/dist/esm5/internal/util/lift.js");
|
|
26762
|
+
/* harmony import */ var _OperatorSubscriber__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./OperatorSubscriber */ "../../common/temp/node_modules/.pnpm/rxjs@7.8.1/node_modules/rxjs/dist/esm5/internal/operators/OperatorSubscriber.js");
|
|
26763
|
+
/* harmony import */ var _util_identity__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../util/identity */ "../../common/temp/node_modules/.pnpm/rxjs@7.8.1/node_modules/rxjs/dist/esm5/internal/util/identity.js");
|
|
26764
|
+
|
|
26765
|
+
|
|
26766
|
+
|
|
26767
|
+
|
|
26768
|
+
function tap(observerOrNext, error, complete) {
|
|
26769
|
+
var tapObserver = (0,_util_isFunction__WEBPACK_IMPORTED_MODULE_0__.isFunction)(observerOrNext) || error || complete
|
|
26770
|
+
?
|
|
26771
|
+
{ next: observerOrNext, error: error, complete: complete }
|
|
26772
|
+
: observerOrNext;
|
|
26773
|
+
return tapObserver
|
|
26774
|
+
? (0,_util_lift__WEBPACK_IMPORTED_MODULE_1__.operate)(function (source, subscriber) {
|
|
26775
|
+
var _a;
|
|
26776
|
+
(_a = tapObserver.subscribe) === null || _a === void 0 ? void 0 : _a.call(tapObserver);
|
|
26777
|
+
var isUnsub = true;
|
|
26778
|
+
source.subscribe((0,_OperatorSubscriber__WEBPACK_IMPORTED_MODULE_2__.createOperatorSubscriber)(subscriber, function (value) {
|
|
26779
|
+
var _a;
|
|
26780
|
+
(_a = tapObserver.next) === null || _a === void 0 ? void 0 : _a.call(tapObserver, value);
|
|
26781
|
+
subscriber.next(value);
|
|
26782
|
+
}, function () {
|
|
26783
|
+
var _a;
|
|
26784
|
+
isUnsub = false;
|
|
26785
|
+
(_a = tapObserver.complete) === null || _a === void 0 ? void 0 : _a.call(tapObserver);
|
|
26786
|
+
subscriber.complete();
|
|
26787
|
+
}, function (err) {
|
|
26788
|
+
var _a;
|
|
26789
|
+
isUnsub = false;
|
|
26790
|
+
(_a = tapObserver.error) === null || _a === void 0 ? void 0 : _a.call(tapObserver, err);
|
|
26791
|
+
subscriber.error(err);
|
|
26792
|
+
}, function () {
|
|
26793
|
+
var _a, _b;
|
|
26794
|
+
if (isUnsub) {
|
|
26795
|
+
(_a = tapObserver.unsubscribe) === null || _a === void 0 ? void 0 : _a.call(tapObserver);
|
|
26796
|
+
}
|
|
26797
|
+
(_b = tapObserver.finalize) === null || _b === void 0 ? void 0 : _b.call(tapObserver);
|
|
26798
|
+
}));
|
|
26799
|
+
})
|
|
26800
|
+
:
|
|
26801
|
+
_util_identity__WEBPACK_IMPORTED_MODULE_3__.identity;
|
|
26802
|
+
}
|
|
26803
|
+
|
|
26804
|
+
|
|
26233
26805
|
/***/ }),
|
|
26234
26806
|
|
|
26235
26807
|
/***/ "../../common/temp/node_modules/.pnpm/rxjs@7.8.1/node_modules/rxjs/dist/esm5/internal/scheduled/scheduleArray.js":
|
|
@@ -289925,7 +290497,7 @@ class TestContext {
|
|
|
289925
290497
|
this.initializeRpcInterfaces({ title: this.settings.Backend.name, version: this.settings.Backend.version });
|
|
289926
290498
|
const iModelClient = new imodels_client_management_1.IModelsClient({ api: { baseUrl: `https://${process.env.IMJS_URL_PREFIX ?? ""}api.bentley.com/imodels` } });
|
|
289927
290499
|
await core_frontend_1.NoRenderApp.startup({
|
|
289928
|
-
applicationVersion: "4.5.0-dev.
|
|
290500
|
+
applicationVersion: "4.5.0-dev.41",
|
|
289929
290501
|
applicationId: this.settings.gprid,
|
|
289930
290502
|
authorizationClient: new frontend_1.TestFrontendAuthorizationClient(this.adminUserAccessToken),
|
|
289931
290503
|
hubAccess: new imodels_access_frontend_1.FrontendIModelsAccess(iModelClient),
|
|
@@ -291016,7 +291588,7 @@ class KeySet {
|
|
|
291016
291588
|
this._nodeKeys.add(JSON.stringify(key));
|
|
291017
291589
|
}
|
|
291018
291590
|
for (const entry of keyset.instanceKeys) {
|
|
291019
|
-
const lcClassName = entry["0"]
|
|
291591
|
+
const lcClassName = normalizeClassName(entry["0"]);
|
|
291020
291592
|
const idsJson = entry["1"];
|
|
291021
291593
|
const ids = typeof idsJson === "string" ? (idsJson === _itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.Id64.invalid ? new Set([_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.Id64.invalid]) : _itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.CompressedId64Set.decompressSet(idsJson)) : new Set(idsJson);
|
|
291022
291594
|
this._instanceKeys.set(lcClassName, ids);
|
|
@@ -291045,7 +291617,7 @@ class KeySet {
|
|
|
291045
291617
|
this.add({ className: value.classFullName, id: _itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.Id64.fromJSON(value.id) });
|
|
291046
291618
|
}
|
|
291047
291619
|
else if (Key.isInstanceKey(value)) {
|
|
291048
|
-
const lcClassName = value.className
|
|
291620
|
+
const lcClassName = normalizeClassName(value.className);
|
|
291049
291621
|
if (!this._instanceKeys.has(lcClassName)) {
|
|
291050
291622
|
this._instanceKeys.set(lcClassName, new Set());
|
|
291051
291623
|
this._lowerCaseMap.set(lcClassName, value.className);
|
|
@@ -291070,7 +291642,7 @@ class KeySet {
|
|
|
291070
291642
|
this._nodeKeys.delete(key);
|
|
291071
291643
|
}
|
|
291072
291644
|
for (const entry of keyset._instanceKeys) {
|
|
291073
|
-
const set = this._instanceKeys.get(entry["0"]
|
|
291645
|
+
const set = this._instanceKeys.get(entry["0"]);
|
|
291074
291646
|
if (set) {
|
|
291075
291647
|
entry["1"].forEach((key) => {
|
|
291076
291648
|
set.delete(key);
|
|
@@ -291100,7 +291672,7 @@ class KeySet {
|
|
|
291100
291672
|
this.delete({ className: value.classFullName, id: value.id });
|
|
291101
291673
|
}
|
|
291102
291674
|
else if (Key.isInstanceKey(value)) {
|
|
291103
|
-
const set = this._instanceKeys.get(value.className
|
|
291675
|
+
const set = this._instanceKeys.get(normalizeClassName(value.className));
|
|
291104
291676
|
if (set) {
|
|
291105
291677
|
set.delete(value.id);
|
|
291106
291678
|
}
|
|
@@ -291128,7 +291700,7 @@ class KeySet {
|
|
|
291128
291700
|
return this.has({ className: value.classFullName, id: value.id });
|
|
291129
291701
|
}
|
|
291130
291702
|
if (Key.isInstanceKey(value)) {
|
|
291131
|
-
const set = this._instanceKeys.get(value.className
|
|
291703
|
+
const set = this._instanceKeys.get(normalizeClassName(value.className));
|
|
291132
291704
|
return !!(set && set.has(value.id));
|
|
291133
291705
|
}
|
|
291134
291706
|
if (Key.isNodeKey(value)) {
|
|
@@ -291147,7 +291719,7 @@ class KeySet {
|
|
|
291147
291719
|
return false;
|
|
291148
291720
|
}
|
|
291149
291721
|
for (const otherEntry of keys._instanceKeys) {
|
|
291150
|
-
const thisEntryKeys = this._instanceKeys.get(otherEntry["0"]
|
|
291722
|
+
const thisEntryKeys = this._instanceKeys.get(otherEntry["0"]);
|
|
291151
291723
|
if (!thisEntryKeys || thisEntryKeys.size < otherEntry["1"].size) {
|
|
291152
291724
|
return false;
|
|
291153
291725
|
}
|
|
@@ -291162,7 +291734,7 @@ class KeySet {
|
|
|
291162
291734
|
return true;
|
|
291163
291735
|
}
|
|
291164
291736
|
for (const otherEntry of keys._instanceKeys) {
|
|
291165
|
-
const thisEntryKeys = this._instanceKeys.get(otherEntry["0"]
|
|
291737
|
+
const thisEntryKeys = this._instanceKeys.get(otherEntry["0"]);
|
|
291166
291738
|
if (thisEntryKeys && [...otherEntry["1"]].some((key) => thisEntryKeys.has(key))) {
|
|
291167
291739
|
return true;
|
|
291168
291740
|
}
|
|
@@ -291315,6 +291887,9 @@ class KeySet {
|
|
|
291315
291887
|
return keyset;
|
|
291316
291888
|
}
|
|
291317
291889
|
}
|
|
291890
|
+
function normalizeClassName(className) {
|
|
291891
|
+
return className.replace(".", ":").toLowerCase();
|
|
291892
|
+
}
|
|
291318
291893
|
const some = (set, cb) => {
|
|
291319
291894
|
for (const item of set) {
|
|
291320
291895
|
if (cb(item)) {
|
|
@@ -296916,11 +297491,13 @@ class Presentation {
|
|
|
296916
297491
|
presentationManager = _PresentationManager__WEBPACK_IMPORTED_MODULE_5__.PresentationManager.create(managerProps);
|
|
296917
297492
|
}
|
|
296918
297493
|
if (!selectionManager) {
|
|
296919
|
-
selectionManager = new _selection_SelectionManager__WEBPACK_IMPORTED_MODULE_6__.SelectionManager(
|
|
296920
|
-
|
|
296921
|
-
|
|
296922
|
-
|
|
296923
|
-
|
|
297494
|
+
selectionManager = new _selection_SelectionManager__WEBPACK_IMPORTED_MODULE_6__.SelectionManager({
|
|
297495
|
+
...props?.selection,
|
|
297496
|
+
scopes: props?.selection?.scopes ??
|
|
297497
|
+
new _selection_SelectionScopesManager__WEBPACK_IMPORTED_MODULE_7__.SelectionScopesManager({
|
|
297498
|
+
rpcRequestsHandler: presentationManager.rpcRequestsHandler,
|
|
297499
|
+
localeProvider: () => this.presentation.activeLocale,
|
|
297500
|
+
}),
|
|
296924
297501
|
});
|
|
296925
297502
|
}
|
|
296926
297503
|
if (!favoritePropertiesManager) {
|
|
@@ -296956,6 +297533,9 @@ class Presentation {
|
|
|
296956
297533
|
favoritePropertiesManager.dispose();
|
|
296957
297534
|
}
|
|
296958
297535
|
favoritePropertiesManager = undefined;
|
|
297536
|
+
if (selectionManager) {
|
|
297537
|
+
selectionManager.dispose();
|
|
297538
|
+
}
|
|
296959
297539
|
selectionManager = undefined;
|
|
296960
297540
|
localization = undefined;
|
|
296961
297541
|
}
|
|
@@ -299469,12 +300049,21 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
299469
300049
|
/* harmony export */ "TRANSIENT_ELEMENT_CLASSNAME": () => (/* binding */ TRANSIENT_ELEMENT_CLASSNAME),
|
|
299470
300050
|
/* harmony export */ "ToolSelectionSyncHandler": () => (/* binding */ ToolSelectionSyncHandler)
|
|
299471
300051
|
/* harmony export */ });
|
|
300052
|
+
/* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! rxjs */ "../../common/temp/node_modules/.pnpm/rxjs@7.8.1/node_modules/rxjs/dist/esm5/internal/Subject.js");
|
|
300053
|
+
/* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! rxjs */ "../../common/temp/node_modules/.pnpm/rxjs@7.8.1/node_modules/rxjs/dist/esm5/internal/operators/mergeMap.js");
|
|
300054
|
+
/* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! rxjs */ "../../common/temp/node_modules/.pnpm/rxjs@7.8.1/node_modules/rxjs/dist/esm5/internal/observable/empty.js");
|
|
300055
|
+
/* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! rxjs */ "../../common/temp/node_modules/.pnpm/rxjs@7.8.1/node_modules/rxjs/dist/esm5/internal/observable/of.js");
|
|
300056
|
+
/* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! rxjs */ "../../common/temp/node_modules/.pnpm/rxjs@7.8.1/node_modules/rxjs/dist/esm5/internal/observable/defer.js");
|
|
300057
|
+
/* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! rxjs */ "../../common/temp/node_modules/.pnpm/rxjs@7.8.1/node_modules/rxjs/dist/esm5/internal/operators/takeUntil.js");
|
|
300058
|
+
/* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! rxjs */ "../../common/temp/node_modules/.pnpm/rxjs@7.8.1/node_modules/rxjs/dist/esm5/internal/operators/tap.js");
|
|
299472
300059
|
/* harmony import */ var _itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @itwin/core-bentley */ "../../core/bentley/lib/esm/core-bentley.js");
|
|
299473
300060
|
/* harmony import */ var _itwin_core_frontend__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @itwin/core-frontend */ "../../core/frontend/lib/esm/core-frontend.js");
|
|
299474
300061
|
/* harmony import */ var _itwin_presentation_common__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @itwin/presentation-common */ "../../presentation/common/lib/esm/presentation-common.js");
|
|
299475
|
-
/* harmony import */ var
|
|
299476
|
-
/* harmony import */ var
|
|
299477
|
-
/* harmony import */ var
|
|
300062
|
+
/* harmony import */ var _itwin_unified_selection__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @itwin/unified-selection */ "../../common/temp/node_modules/.pnpm/@itwin+unified-selection@0.1.0/node_modules/@itwin/unified-selection/lib/esm/unified-selection.js");
|
|
300063
|
+
/* harmony import */ var _Presentation__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../Presentation */ "../../presentation/frontend/lib/esm/presentation-frontend/Presentation.js");
|
|
300064
|
+
/* harmony import */ var _HiliteSetProvider__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./HiliteSetProvider */ "../../presentation/frontend/lib/esm/presentation-frontend/selection/HiliteSetProvider.js");
|
|
300065
|
+
/* harmony import */ var _SelectionChangeEvent__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./SelectionChangeEvent */ "../../presentation/frontend/lib/esm/presentation-frontend/selection/SelectionChangeEvent.js");
|
|
300066
|
+
/* harmony import */ var _SelectionScopesManager__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./SelectionScopesManager */ "../../presentation/frontend/lib/esm/presentation-frontend/selection/SelectionScopesManager.js");
|
|
299478
300067
|
/*---------------------------------------------------------------------------------------------
|
|
299479
300068
|
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
299480
300069
|
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
@@ -299488,6 +300077,9 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
299488
300077
|
|
|
299489
300078
|
|
|
299490
300079
|
|
|
300080
|
+
|
|
300081
|
+
|
|
300082
|
+
|
|
299491
300083
|
/**
|
|
299492
300084
|
* The selection manager which stores the overall selection.
|
|
299493
300085
|
* @public
|
|
@@ -299497,27 +300089,37 @@ class SelectionManager {
|
|
|
299497
300089
|
* Creates an instance of SelectionManager.
|
|
299498
300090
|
*/
|
|
299499
300091
|
constructor(props) {
|
|
299500
|
-
this._selectionContainerMap = new Map();
|
|
299501
300092
|
this._imodelToolSelectionSyncHandlers = new Map();
|
|
299502
300093
|
this._hiliteSetProviders = new Map();
|
|
299503
|
-
this.
|
|
300094
|
+
this._knownIModels = new Map();
|
|
300095
|
+
this._currentSelection = new CurrentSelectionStorage();
|
|
300096
|
+
this._selectionChanges = new rxjs__WEBPACK_IMPORTED_MODULE_8__.Subject();
|
|
300097
|
+
this._listeners = [];
|
|
300098
|
+
this.selectionChange = new _SelectionChangeEvent__WEBPACK_IMPORTED_MODULE_6__.SelectionChangeEvent();
|
|
299504
300099
|
this.scopes = props.scopes;
|
|
299505
|
-
|
|
300100
|
+
this._selectionStorage = props.selectionStorage ?? (0,_itwin_unified_selection__WEBPACK_IMPORTED_MODULE_3__.createStorage)();
|
|
300101
|
+
this._ownsStorage = props.selectionStorage === undefined;
|
|
300102
|
+
this._selectionStorage.selectionChangeEvent.addListener((args) => this._selectionChanges.next(args));
|
|
300103
|
+
this._selectionEventsSubscription = this.streamSelectionEvents();
|
|
300104
|
+
this._listeners.push(_itwin_core_frontend__WEBPACK_IMPORTED_MODULE_1__.IModelConnection.onOpen.addListener((imodel) => {
|
|
300105
|
+
this._knownIModels.set(imodel.key, imodel);
|
|
300106
|
+
}));
|
|
300107
|
+
this._listeners.push(_itwin_core_frontend__WEBPACK_IMPORTED_MODULE_1__.IModelConnection.onClose.addListener((imodel) => {
|
|
299506
300108
|
this.onConnectionClose(imodel);
|
|
299507
|
-
});
|
|
300109
|
+
}));
|
|
300110
|
+
}
|
|
300111
|
+
dispose() {
|
|
300112
|
+
this._selectionEventsSubscription.unsubscribe();
|
|
300113
|
+
this._listeners.forEach((dispose) => dispose());
|
|
299508
300114
|
}
|
|
299509
300115
|
onConnectionClose(imodel) {
|
|
299510
|
-
this.clearSelection("Connection Close Event", imodel);
|
|
299511
|
-
this._selectionContainerMap.delete(imodel);
|
|
299512
300116
|
this._hiliteSetProviders.delete(imodel);
|
|
299513
|
-
|
|
299514
|
-
|
|
299515
|
-
|
|
299516
|
-
|
|
299517
|
-
|
|
299518
|
-
this._selectionContainerMap.set(imodel, selectionContainer);
|
|
300117
|
+
this._knownIModels.delete(imodel.key);
|
|
300118
|
+
this._currentSelection.clear(imodel.key);
|
|
300119
|
+
if (this._ownsStorage) {
|
|
300120
|
+
this.clearSelection("Connection Close Event", imodel);
|
|
300121
|
+
this._selectionStorage.clearStorage({ iModelKey: imodel.key });
|
|
299519
300122
|
}
|
|
299520
|
-
return selectionContainer;
|
|
299521
300123
|
}
|
|
299522
300124
|
/** @internal */
|
|
299523
300125
|
// istanbul ignore next
|
|
@@ -299565,39 +300167,48 @@ class SelectionManager {
|
|
|
299565
300167
|
}
|
|
299566
300168
|
/** Get the selection levels currently stored in this manager for the specified imodel */
|
|
299567
300169
|
getSelectionLevels(imodel) {
|
|
299568
|
-
return this.
|
|
300170
|
+
return this._selectionStorage.getSelectionLevels({ iModelKey: imodel.key });
|
|
299569
300171
|
}
|
|
299570
|
-
/**
|
|
300172
|
+
/**
|
|
300173
|
+
* Get the selection currently stored in this manager
|
|
300174
|
+
*
|
|
300175
|
+
* @note Calling immediately after `add*`|`replace*`|`remove*`|`clear*` method call does not guarantee
|
|
300176
|
+
* that returned `KeySet` will include latest changes. Listen for `selectionChange` event to get the
|
|
300177
|
+
* latest selection after changes.
|
|
300178
|
+
*/
|
|
299571
300179
|
getSelection(imodel, level = 0) {
|
|
299572
|
-
return this.
|
|
300180
|
+
return this._currentSelection.getSelection(imodel.key, level);
|
|
299573
300181
|
}
|
|
299574
300182
|
handleEvent(evt) {
|
|
299575
|
-
const container = this.getContainer(evt.imodel);
|
|
299576
|
-
const selectedItemsSet = container.getSelection(evt.level);
|
|
299577
|
-
const guidBefore = selectedItemsSet.guid;
|
|
299578
300183
|
switch (evt.changeType) {
|
|
299579
|
-
case
|
|
299580
|
-
|
|
300184
|
+
case _SelectionChangeEvent__WEBPACK_IMPORTED_MODULE_6__.SelectionChangeType.Add:
|
|
300185
|
+
this._selectionStorage.addToSelection({
|
|
300186
|
+
iModelKey: evt.imodel.key,
|
|
300187
|
+
source: evt.source,
|
|
300188
|
+
level: evt.level,
|
|
300189
|
+
selectables: keysToSelectable(evt.imodel, evt.keys),
|
|
300190
|
+
});
|
|
299581
300191
|
break;
|
|
299582
|
-
case
|
|
299583
|
-
|
|
300192
|
+
case _SelectionChangeEvent__WEBPACK_IMPORTED_MODULE_6__.SelectionChangeType.Remove:
|
|
300193
|
+
this._selectionStorage.removeFromSelection({
|
|
300194
|
+
iModelKey: evt.imodel.key,
|
|
300195
|
+
source: evt.source,
|
|
300196
|
+
level: evt.level,
|
|
300197
|
+
selectables: keysToSelectable(evt.imodel, evt.keys),
|
|
300198
|
+
});
|
|
299584
300199
|
break;
|
|
299585
|
-
case
|
|
299586
|
-
|
|
299587
|
-
|
|
299588
|
-
|
|
299589
|
-
|
|
299590
|
-
|
|
300200
|
+
case _SelectionChangeEvent__WEBPACK_IMPORTED_MODULE_6__.SelectionChangeType.Replace:
|
|
300201
|
+
this._selectionStorage.replaceSelection({
|
|
300202
|
+
iModelKey: evt.imodel.key,
|
|
300203
|
+
source: evt.source,
|
|
300204
|
+
level: evt.level,
|
|
300205
|
+
selectables: keysToSelectable(evt.imodel, evt.keys),
|
|
300206
|
+
});
|
|
299591
300207
|
break;
|
|
299592
|
-
case
|
|
299593
|
-
|
|
300208
|
+
case _SelectionChangeEvent__WEBPACK_IMPORTED_MODULE_6__.SelectionChangeType.Clear:
|
|
300209
|
+
this._selectionStorage.clearSelection({ iModelKey: evt.imodel.key, source: evt.source, level: evt.level });
|
|
299594
300210
|
break;
|
|
299595
300211
|
}
|
|
299596
|
-
if (selectedItemsSet.guid === guidBefore) {
|
|
299597
|
-
return;
|
|
299598
|
-
}
|
|
299599
|
-
container.clear(evt.level + 1);
|
|
299600
|
-
this.selectionChange.raiseEvent(evt, this);
|
|
299601
300212
|
}
|
|
299602
300213
|
/**
|
|
299603
300214
|
* Add keys to the selection
|
|
@@ -299612,7 +300223,7 @@ class SelectionManager {
|
|
|
299612
300223
|
source,
|
|
299613
300224
|
level,
|
|
299614
300225
|
imodel,
|
|
299615
|
-
changeType:
|
|
300226
|
+
changeType: _SelectionChangeEvent__WEBPACK_IMPORTED_MODULE_6__.SelectionChangeType.Add,
|
|
299616
300227
|
keys: new _itwin_presentation_common__WEBPACK_IMPORTED_MODULE_2__.KeySet(keys),
|
|
299617
300228
|
timestamp: new Date(),
|
|
299618
300229
|
rulesetId,
|
|
@@ -299632,7 +300243,7 @@ class SelectionManager {
|
|
|
299632
300243
|
source,
|
|
299633
300244
|
level,
|
|
299634
300245
|
imodel,
|
|
299635
|
-
changeType:
|
|
300246
|
+
changeType: _SelectionChangeEvent__WEBPACK_IMPORTED_MODULE_6__.SelectionChangeType.Remove,
|
|
299636
300247
|
keys: new _itwin_presentation_common__WEBPACK_IMPORTED_MODULE_2__.KeySet(keys),
|
|
299637
300248
|
timestamp: new Date(),
|
|
299638
300249
|
rulesetId,
|
|
@@ -299652,7 +300263,7 @@ class SelectionManager {
|
|
|
299652
300263
|
source,
|
|
299653
300264
|
level,
|
|
299654
300265
|
imodel,
|
|
299655
|
-
changeType:
|
|
300266
|
+
changeType: _SelectionChangeEvent__WEBPACK_IMPORTED_MODULE_6__.SelectionChangeType.Replace,
|
|
299656
300267
|
keys: new _itwin_presentation_common__WEBPACK_IMPORTED_MODULE_2__.KeySet(keys),
|
|
299657
300268
|
timestamp: new Date(),
|
|
299658
300269
|
rulesetId,
|
|
@@ -299671,7 +300282,7 @@ class SelectionManager {
|
|
|
299671
300282
|
source,
|
|
299672
300283
|
level,
|
|
299673
300284
|
imodel,
|
|
299674
|
-
changeType:
|
|
300285
|
+
changeType: _SelectionChangeEvent__WEBPACK_IMPORTED_MODULE_6__.SelectionChangeType.Clear,
|
|
299675
300286
|
keys: new _itwin_presentation_common__WEBPACK_IMPORTED_MODULE_2__.KeySet(),
|
|
299676
300287
|
timestamp: new Date(),
|
|
299677
300288
|
rulesetId,
|
|
@@ -299734,42 +300345,35 @@ class SelectionManager {
|
|
|
299734
300345
|
getHiliteSetProvider(imodel) {
|
|
299735
300346
|
let provider = this._hiliteSetProviders.get(imodel);
|
|
299736
300347
|
if (!provider) {
|
|
299737
|
-
provider =
|
|
300348
|
+
provider = _HiliteSetProvider__WEBPACK_IMPORTED_MODULE_5__.HiliteSetProvider.create({ imodel });
|
|
299738
300349
|
this._hiliteSetProviders.set(imodel, provider);
|
|
299739
300350
|
}
|
|
299740
300351
|
return provider;
|
|
299741
300352
|
}
|
|
299742
|
-
|
|
299743
|
-
|
|
299744
|
-
|
|
299745
|
-
|
|
299746
|
-
|
|
299747
|
-
|
|
299748
|
-
|
|
299749
|
-
|
|
299750
|
-
|
|
299751
|
-
|
|
299752
|
-
|
|
299753
|
-
|
|
299754
|
-
|
|
299755
|
-
|
|
299756
|
-
|
|
299757
|
-
|
|
299758
|
-
|
|
299759
|
-
|
|
299760
|
-
|
|
299761
|
-
|
|
299762
|
-
|
|
299763
|
-
|
|
299764
|
-
|
|
299765
|
-
|
|
299766
|
-
const keys = this._selectedItemsSetMap.keys();
|
|
299767
|
-
for (const key of keys) {
|
|
299768
|
-
if (key >= level) {
|
|
299769
|
-
const selectedItemsSet = this._selectedItemsSetMap.get(key);
|
|
299770
|
-
selectedItemsSet.clear();
|
|
299771
|
-
}
|
|
299772
|
-
}
|
|
300353
|
+
streamSelectionEvents() {
|
|
300354
|
+
return this._selectionChanges
|
|
300355
|
+
.pipe((0,rxjs__WEBPACK_IMPORTED_MODULE_9__.mergeMap)((args) => {
|
|
300356
|
+
const currentSelectables = this._selectionStorage.getSelection({ iModelKey: args.iModelKey, level: args.level });
|
|
300357
|
+
return this._currentSelection.computeSelection(args.iModelKey, args.level, currentSelectables, args.selectables).pipe((0,rxjs__WEBPACK_IMPORTED_MODULE_9__.mergeMap)(({ level, changedSelection }) => {
|
|
300358
|
+
const imodel = this._knownIModels.get(args.iModelKey);
|
|
300359
|
+
if (!imodel) {
|
|
300360
|
+
return rxjs__WEBPACK_IMPORTED_MODULE_10__.EMPTY;
|
|
300361
|
+
}
|
|
300362
|
+
return (0,rxjs__WEBPACK_IMPORTED_MODULE_11__.of)({
|
|
300363
|
+
imodel,
|
|
300364
|
+
keys: changedSelection,
|
|
300365
|
+
level,
|
|
300366
|
+
source: args.source,
|
|
300367
|
+
timestamp: args.timestamp,
|
|
300368
|
+
changeType: getChangeType(args.changeType),
|
|
300369
|
+
});
|
|
300370
|
+
}));
|
|
300371
|
+
}))
|
|
300372
|
+
.subscribe({
|
|
300373
|
+
next: (args) => {
|
|
300374
|
+
this.selectionChange.raiseEvent(args, this);
|
|
300375
|
+
},
|
|
300376
|
+
});
|
|
299773
300377
|
}
|
|
299774
300378
|
}
|
|
299775
300379
|
/** @internal */
|
|
@@ -299809,7 +300413,7 @@ class ToolSelectionSyncHandler {
|
|
|
299809
300413
|
// makes sure we're adding to selection keys with concrete classes and not "BisCore:Element", which
|
|
299810
300414
|
// we can't because otherwise our keys compare fails (presentation components load data with
|
|
299811
300415
|
// concrete classes)
|
|
299812
|
-
const changer = new ScopedSelectionChanger(this._selectionSourceName, this._imodel, this._logicalSelection, (0,
|
|
300416
|
+
const changer = new ScopedSelectionChanger(this._selectionSourceName, this._imodel, this._logicalSelection, (0,_SelectionScopesManager__WEBPACK_IMPORTED_MODULE_7__.createSelectionScopeProps)(this._logicalSelection.scopes.activeScope));
|
|
299813
300417
|
// we know what to do immediately on `clear` events
|
|
299814
300418
|
if (_itwin_core_frontend__WEBPACK_IMPORTED_MODULE_1__.SelectionSetEventType.Clear === ev.type) {
|
|
299815
300419
|
await changer.clear(selectionLevel);
|
|
@@ -299909,6 +300513,196 @@ class ScopedSelectionChanger {
|
|
|
299909
300513
|
this.manager.replaceSelection(this.name, this.imodel, keys, level);
|
|
299910
300514
|
}
|
|
299911
300515
|
}
|
|
300516
|
+
/** Stores current selection in `KeySet` format per iModel. */
|
|
300517
|
+
class CurrentSelectionStorage {
|
|
300518
|
+
constructor() {
|
|
300519
|
+
this._currentSelection = new Map();
|
|
300520
|
+
}
|
|
300521
|
+
getCurrentSelectionStorage(imodelKey) {
|
|
300522
|
+
let storage = this._currentSelection.get(imodelKey);
|
|
300523
|
+
if (!storage) {
|
|
300524
|
+
storage = new IModelSelectionStorage();
|
|
300525
|
+
this._currentSelection.set(imodelKey, storage);
|
|
300526
|
+
}
|
|
300527
|
+
return storage;
|
|
300528
|
+
}
|
|
300529
|
+
getSelection(imodelKey, level) {
|
|
300530
|
+
return this.getCurrentSelectionStorage(imodelKey).getSelection(level);
|
|
300531
|
+
}
|
|
300532
|
+
clear(imodelKey) {
|
|
300533
|
+
this._currentSelection.delete(imodelKey);
|
|
300534
|
+
}
|
|
300535
|
+
computeSelection(imodelKey, level, currSelectables, changedSelectables) {
|
|
300536
|
+
return this.getCurrentSelectionStorage(imodelKey).computeSelection(level, currSelectables, changedSelectables);
|
|
300537
|
+
}
|
|
300538
|
+
}
|
|
300539
|
+
/**
|
|
300540
|
+
* Computes and stores current selection in `KeySet` format.
|
|
300541
|
+
* It always stores result of latest resolved call to `computeSelection`.
|
|
300542
|
+
*/
|
|
300543
|
+
class IModelSelectionStorage {
|
|
300544
|
+
constructor() {
|
|
300545
|
+
this._currentSelection = new Map();
|
|
300546
|
+
}
|
|
300547
|
+
getSelection(level) {
|
|
300548
|
+
let entry = this._currentSelection.get(level);
|
|
300549
|
+
if (!entry) {
|
|
300550
|
+
entry = { value: new _itwin_presentation_common__WEBPACK_IMPORTED_MODULE_2__.KeySet(), ongoingComputationDisposers: new Set() };
|
|
300551
|
+
this._currentSelection.set(level, entry);
|
|
300552
|
+
}
|
|
300553
|
+
return entry.value;
|
|
300554
|
+
}
|
|
300555
|
+
clearSelections(level) {
|
|
300556
|
+
const clearedLevels = [];
|
|
300557
|
+
for (const [storedLevel] of this._currentSelection.entries()) {
|
|
300558
|
+
if (storedLevel > level) {
|
|
300559
|
+
clearedLevels.push(storedLevel);
|
|
300560
|
+
}
|
|
300561
|
+
}
|
|
300562
|
+
clearedLevels.forEach((storedLevel) => {
|
|
300563
|
+
const entry = this._currentSelection.get(storedLevel);
|
|
300564
|
+
// istanbul ignore if
|
|
300565
|
+
if (!entry) {
|
|
300566
|
+
return;
|
|
300567
|
+
}
|
|
300568
|
+
for (const disposer of entry.ongoingComputationDisposers) {
|
|
300569
|
+
disposer.next();
|
|
300570
|
+
}
|
|
300571
|
+
this._currentSelection.delete(storedLevel);
|
|
300572
|
+
});
|
|
300573
|
+
}
|
|
300574
|
+
addDisposer(level, disposer) {
|
|
300575
|
+
const entry = this._currentSelection.get(level);
|
|
300576
|
+
if (!entry) {
|
|
300577
|
+
this._currentSelection.set(level, { value: new _itwin_presentation_common__WEBPACK_IMPORTED_MODULE_2__.KeySet(), ongoingComputationDisposers: new Set([disposer]) });
|
|
300578
|
+
return;
|
|
300579
|
+
}
|
|
300580
|
+
entry.ongoingComputationDisposers.add(disposer);
|
|
300581
|
+
}
|
|
300582
|
+
setSelection(level, keys, disposer) {
|
|
300583
|
+
const currEntry = this._currentSelection.get(level);
|
|
300584
|
+
// istanbul ignore else
|
|
300585
|
+
if (currEntry) {
|
|
300586
|
+
currEntry.ongoingComputationDisposers.delete(disposer);
|
|
300587
|
+
}
|
|
300588
|
+
this._currentSelection.set(level, {
|
|
300589
|
+
value: keys,
|
|
300590
|
+
ongoingComputationDisposers: currEntry?.ongoingComputationDisposers ?? /* istanbul ignore next */ new Set(),
|
|
300591
|
+
});
|
|
300592
|
+
}
|
|
300593
|
+
computeSelection(level, currSelectables, changedSelectables) {
|
|
300594
|
+
this.clearSelections(level);
|
|
300595
|
+
const prevComputationsDisposers = [...(this._currentSelection.get(level)?.ongoingComputationDisposers ?? [])];
|
|
300596
|
+
const currDisposer = new rxjs__WEBPACK_IMPORTED_MODULE_8__.Subject();
|
|
300597
|
+
this.addDisposer(level, currDisposer);
|
|
300598
|
+
return (0,rxjs__WEBPACK_IMPORTED_MODULE_12__.defer)(async () => {
|
|
300599
|
+
const convertedSelectables = [];
|
|
300600
|
+
const [current, changed] = await Promise.all([
|
|
300601
|
+
selectablesToKeys(currSelectables, convertedSelectables),
|
|
300602
|
+
selectablesToKeys(changedSelectables, convertedSelectables),
|
|
300603
|
+
]);
|
|
300604
|
+
const currentSelection = new _itwin_presentation_common__WEBPACK_IMPORTED_MODULE_2__.KeySet([...current.keys, ...current.selectableKeys.flatMap((selectable) => selectable.keys)]);
|
|
300605
|
+
const changedSelection = new _itwin_presentation_common__WEBPACK_IMPORTED_MODULE_2__.KeySet([...changed.keys, ...changed.selectableKeys.flatMap((selectable) => selectable.keys)]);
|
|
300606
|
+
return {
|
|
300607
|
+
level,
|
|
300608
|
+
currentSelection,
|
|
300609
|
+
changedSelection,
|
|
300610
|
+
};
|
|
300611
|
+
}).pipe((0,rxjs__WEBPACK_IMPORTED_MODULE_13__.takeUntil)(currDisposer), (0,rxjs__WEBPACK_IMPORTED_MODULE_14__.tap)({
|
|
300612
|
+
next: (val) => {
|
|
300613
|
+
prevComputationsDisposers.forEach((disposer) => disposer.next());
|
|
300614
|
+
this.setSelection(val.level, val.currentSelection, currDisposer);
|
|
300615
|
+
},
|
|
300616
|
+
}));
|
|
300617
|
+
}
|
|
300618
|
+
}
|
|
300619
|
+
function keysToSelectable(imodel, keys) {
|
|
300620
|
+
const selectables = [];
|
|
300621
|
+
keys.forEach((key) => {
|
|
300622
|
+
if ("id" in key) {
|
|
300623
|
+
selectables.push(key);
|
|
300624
|
+
return;
|
|
300625
|
+
}
|
|
300626
|
+
const customSelectable = {
|
|
300627
|
+
identifier: key.pathFromRoot.join("/"),
|
|
300628
|
+
data: key,
|
|
300629
|
+
loadInstanceKeys: () => createInstanceKeysIterator(imodel, key),
|
|
300630
|
+
};
|
|
300631
|
+
selectables.push(customSelectable);
|
|
300632
|
+
});
|
|
300633
|
+
return selectables;
|
|
300634
|
+
}
|
|
300635
|
+
async function selectablesToKeys(selectables, convertedList) {
|
|
300636
|
+
const keys = [];
|
|
300637
|
+
const selectableKeys = [];
|
|
300638
|
+
for (const [className, ids] of selectables.instanceKeys) {
|
|
300639
|
+
for (const id of ids) {
|
|
300640
|
+
keys.push({ id, className });
|
|
300641
|
+
}
|
|
300642
|
+
}
|
|
300643
|
+
for (const [_, selectable] of selectables.custom) {
|
|
300644
|
+
if (isNodeKey(selectable.data)) {
|
|
300645
|
+
selectableKeys.push({ identifier: selectable.identifier, keys: [selectable.data] });
|
|
300646
|
+
continue;
|
|
300647
|
+
}
|
|
300648
|
+
const converted = convertedList.find((con) => con.identifier === selectable.identifier);
|
|
300649
|
+
if (converted) {
|
|
300650
|
+
selectableKeys.push(converted);
|
|
300651
|
+
continue;
|
|
300652
|
+
}
|
|
300653
|
+
const newConverted = { identifier: selectable.identifier, keys: [] };
|
|
300654
|
+
convertedList.push(newConverted);
|
|
300655
|
+
for await (const instanceKey of selectable.loadInstanceKeys()) {
|
|
300656
|
+
newConverted.keys.push(instanceKey);
|
|
300657
|
+
}
|
|
300658
|
+
selectableKeys.push(newConverted);
|
|
300659
|
+
}
|
|
300660
|
+
return { keys, selectableKeys };
|
|
300661
|
+
}
|
|
300662
|
+
async function* createInstanceKeysIterator(imodel, nodeKey) {
|
|
300663
|
+
if (_itwin_presentation_common__WEBPACK_IMPORTED_MODULE_2__.NodeKey.isInstancesNodeKey(nodeKey)) {
|
|
300664
|
+
for (const key of nodeKey.instanceKeys) {
|
|
300665
|
+
yield key;
|
|
300666
|
+
}
|
|
300667
|
+
return;
|
|
300668
|
+
}
|
|
300669
|
+
const content = await _Presentation__WEBPACK_IMPORTED_MODULE_4__.Presentation.presentation.getContentInstanceKeys({
|
|
300670
|
+
imodel,
|
|
300671
|
+
keys: new _itwin_presentation_common__WEBPACK_IMPORTED_MODULE_2__.KeySet([nodeKey]),
|
|
300672
|
+
rulesetOrId: {
|
|
300673
|
+
id: "grouped-instances",
|
|
300674
|
+
rules: [
|
|
300675
|
+
{
|
|
300676
|
+
ruleType: "Content",
|
|
300677
|
+
specifications: [
|
|
300678
|
+
{
|
|
300679
|
+
specType: "SelectedNodeInstances",
|
|
300680
|
+
},
|
|
300681
|
+
],
|
|
300682
|
+
},
|
|
300683
|
+
],
|
|
300684
|
+
},
|
|
300685
|
+
});
|
|
300686
|
+
for await (const key of content.items()) {
|
|
300687
|
+
yield key;
|
|
300688
|
+
}
|
|
300689
|
+
}
|
|
300690
|
+
function isNodeKey(data) {
|
|
300691
|
+
const key = data;
|
|
300692
|
+
return key.pathFromRoot !== undefined && key.type !== undefined;
|
|
300693
|
+
}
|
|
300694
|
+
function getChangeType(type) {
|
|
300695
|
+
switch (type) {
|
|
300696
|
+
case "add":
|
|
300697
|
+
return _SelectionChangeEvent__WEBPACK_IMPORTED_MODULE_6__.SelectionChangeType.Add;
|
|
300698
|
+
case "remove":
|
|
300699
|
+
return _SelectionChangeEvent__WEBPACK_IMPORTED_MODULE_6__.SelectionChangeType.Remove;
|
|
300700
|
+
case "replace":
|
|
300701
|
+
return _SelectionChangeEvent__WEBPACK_IMPORTED_MODULE_6__.SelectionChangeType.Replace;
|
|
300702
|
+
case "clear":
|
|
300703
|
+
return _SelectionChangeEvent__WEBPACK_IMPORTED_MODULE_6__.SelectionChangeType.Clear;
|
|
300704
|
+
}
|
|
300705
|
+
}
|
|
299912
300706
|
|
|
299913
300707
|
|
|
299914
300708
|
/***/ }),
|
|
@@ -309621,7 +310415,7 @@ module.exports = JSON.parse('{"name":"axios","version":"0.21.4","description":"P
|
|
|
309621
310415
|
/***/ ((module) => {
|
|
309622
310416
|
|
|
309623
310417
|
"use strict";
|
|
309624
|
-
module.exports = JSON.parse('{"name":"@itwin/core-frontend","version":"4.5.0-dev.
|
|
310418
|
+
module.exports = JSON.parse('{"name":"@itwin/core-frontend","version":"4.5.0-dev.41","description":"iTwin.js frontend components","main":"lib/cjs/core-frontend.js","module":"lib/esm/core-frontend.js","typings":"lib/cjs/core-frontend","license":"MIT","scripts":{"build":"npm run -s copy:public && npm run -s build:cjs && npm run -s build:esm && npm run -s webpackWorkers && npm run -s copy:workers","build:cjs":"npm run -s copy:js:cjs && tsc 1>&2 --outDir lib/cjs","build:esm":"npm run -s copy:js:esm && tsc 1>&2 --module ES2020 --outDir lib/esm","clean":"rimraf lib .rush/temp/package-deps*.json","copy:public":"cpx \\"./src/public/**/*\\" ./lib/public","copy:js:cjs":"cpx \\"./src/**/*.js\\" ./lib/cjs","copy:js:esm":"cpx \\"./src/**/*.js\\" ./lib/esm","copy:workers":"cpx \\"./lib/workers/webpack/parse-imdl-worker.js\\" ./lib/public/scripts","docs":"betools docs --includes=../../generated-docs/extract --json=../../generated-docs/core/core-frontend/file.json --tsIndexFile=./core-frontend.ts --onlyJson --excludes=webgl/**/*,**/map/*.d.ts,**/tile/*.d.ts,**/*-css.ts","extract-api":"betools extract-api --entry=core-frontend && npm run extract-extension-api","extract-extension-api":"eslint -c extraction.eslint.config.js \\"./src/**/*.ts\\" 1>&2","lint":"eslint -f visualstudio \\"./src/**/*.ts\\" 1>&2","lint-fix":"eslint --fix -f visualstudio \\"./src/**/*.ts\\" 1>&2","pseudolocalize":"betools pseudolocalize --englishDir ./src/public/locales/en --out ./public/locales/en-PSEUDO","test":"npm run -s webpackTests && certa -r chrome","cover":"npm -s test","test:debug":"certa -r chrome --debug","webpackTests":"webpack --config ./src/test/utils/webpack.config.js 1>&2 && npm run -s webpackTestWorker","webpackTestWorker":"webpack --config ./src/test/worker/webpack.config.js 1>&2 && cpx \\"./lib/test/test-worker.js\\" ./lib/test","webpackWorkers":"webpack --config ./src/workers/ImdlParser/webpack.config.js 1>&2"},"repository":{"type":"git","url":"https://github.com/iTwin/itwinjs-core.git","directory":"core/frontend"},"keywords":["Bentley","BIM","iModel","digital-twin","iTwin"],"author":{"name":"Bentley Systems, Inc.","url":"http://www.bentley.com"},"peerDependencies":{"@itwin/appui-abstract":"workspace:^4.5.0-dev.41","@itwin/core-bentley":"workspace:^4.5.0-dev.41","@itwin/core-common":"workspace:^4.5.0-dev.41","@itwin/core-geometry":"workspace:^4.5.0-dev.41","@itwin/core-orbitgt":"workspace:^4.5.0-dev.41","@itwin/core-quantity":"workspace:^4.5.0-dev.41"},"//devDependencies":["NOTE: All peerDependencies should also be listed as devDependencies since peerDependencies are not considered by npm install","NOTE: All tools used by scripts in this package must be listed as devDependencies"],"devDependencies":{"@itwin/appui-abstract":"workspace:*","@itwin/build-tools":"workspace:*","@itwin/core-bentley":"workspace:*","@itwin/core-common":"workspace:*","@itwin/core-geometry":"workspace:*","@itwin/core-orbitgt":"workspace:*","@itwin/core-quantity":"workspace:*","@itwin/certa":"workspace:*","@itwin/eslint-plugin":"4.0.0-dev.44","@types/chai":"4.3.1","@types/chai-as-promised":"^7","@types/mocha":"^10.0.6","@types/sinon":"^17.0.2","babel-loader":"~8.2.5","babel-plugin-istanbul":"~6.1.1","chai":"^4.3.10","chai-as-promised":"^7.1.1","cpx2":"^3.0.0","eslint":"^8.44.0","glob":"^7.1.2","mocha":"^10.2.0","nyc":"^15.1.0","rimraf":"^3.0.2","sinon":"^17.0.1","source-map-loader":"^4.0.0","typescript":"~5.0.2","typemoq":"^2.1.0","webpack":"^5.76.0"},"//dependencies":["NOTE: these dependencies should be only for things that DO NOT APPEAR IN THE API","NOTE: core-frontend should remain UI technology agnostic, so no react/angular dependencies are allowed"],"dependencies":{"@itwin/cloud-agnostic-core":"^2.1.0","@itwin/object-storage-core":"^2.2.2","@itwin/core-i18n":"workspace:*","@itwin/core-telemetry":"workspace:*","@itwin/webgl-compatibility":"workspace:*","@loaders.gl/core":"^3.1.6","@loaders.gl/draco":"^3.1.6","fuse.js":"^3.3.0","wms-capabilities":"0.4.0"},"nyc":{"extends":"./node_modules/@itwin/build-tools/.nycrc"}}');
|
|
309625
310419
|
|
|
309626
310420
|
/***/ }),
|
|
309627
310421
|
|