@itwin/unified-selection 1.8.6 → 2.0.0-alpha.1

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 (125) hide show
  1. package/CHANGELOG.md +37 -0
  2. package/README.md +1 -1
  3. package/lib/{cjs/unified-selection → unified-selection}/CachingHiliteSetProvider.d.ts +4 -4
  4. package/lib/unified-selection/CachingHiliteSetProvider.d.ts.map +1 -0
  5. package/lib/unified-selection/CachingHiliteSetProvider.js.map +1 -0
  6. package/lib/unified-selection/DisposePolyfill.d.ts.map +1 -0
  7. package/lib/unified-selection/DisposePolyfill.js.map +1 -0
  8. package/lib/{cjs/unified-selection → unified-selection}/EnableUnifiedSelectionSyncWithIModel.d.ts +9 -10
  9. package/lib/unified-selection/EnableUnifiedSelectionSyncWithIModel.d.ts.map +1 -0
  10. package/lib/{esm/unified-selection → unified-selection}/EnableUnifiedSelectionSyncWithIModel.js +1 -1
  11. package/lib/unified-selection/EnableUnifiedSelectionSyncWithIModel.js.map +1 -0
  12. package/lib/{cjs/unified-selection → unified-selection}/HiliteSetProvider.d.ts +4 -4
  13. package/lib/unified-selection/HiliteSetProvider.d.ts.map +1 -0
  14. package/lib/{esm/unified-selection → unified-selection}/HiliteSetProvider.js +2 -2
  15. package/lib/unified-selection/HiliteSetProvider.js.map +1 -0
  16. package/lib/{esm/unified-selection → unified-selection}/IModelHiliteSetProvider.d.ts +5 -4
  17. package/lib/unified-selection/IModelHiliteSetProvider.d.ts.map +1 -0
  18. package/lib/unified-selection/IModelHiliteSetProvider.js.map +1 -0
  19. package/lib/{esm/unified-selection → unified-selection}/Selectable.d.ts +1 -1
  20. package/lib/unified-selection/Selectable.d.ts.map +1 -0
  21. package/lib/unified-selection/Selectable.js.map +1 -0
  22. package/lib/{cjs/unified-selection → unified-selection}/SelectionChangeEvent.d.ts +2 -2
  23. package/lib/unified-selection/SelectionChangeEvent.d.ts.map +1 -0
  24. package/lib/unified-selection/SelectionChangeEvent.js.map +1 -0
  25. package/lib/{cjs/unified-selection → unified-selection}/SelectionScope.d.ts +3 -3
  26. package/lib/unified-selection/SelectionScope.d.ts.map +1 -0
  27. package/lib/unified-selection/SelectionScope.js.map +1 -0
  28. package/lib/{esm/unified-selection → unified-selection}/SelectionStorage.d.ts +4 -3
  29. package/lib/unified-selection/SelectionStorage.d.ts.map +1 -0
  30. package/lib/unified-selection/SelectionStorage.js.map +1 -0
  31. package/lib/{esm/unified-selection → unified-selection}/Utils.d.ts +3 -3
  32. package/lib/unified-selection/Utils.d.ts.map +1 -0
  33. package/lib/{esm/unified-selection → unified-selection}/Utils.js +1 -1
  34. package/lib/unified-selection/Utils.js.map +1 -0
  35. package/lib/{esm/unified-selection → unified-selection}/types/IModel.d.ts +2 -2
  36. package/lib/unified-selection/types/IModel.d.ts.map +1 -0
  37. package/lib/unified-selection/types/IModel.js.map +1 -0
  38. package/lib/unified-selection.d.ts +16 -0
  39. package/lib/unified-selection.d.ts.map +1 -0
  40. package/lib/{esm/unified-selection.js → unified-selection.js} +2 -3
  41. package/lib/unified-selection.js.map +1 -0
  42. package/package.json +9 -12
  43. package/lib/cjs/package.json +0 -1
  44. package/lib/cjs/unified-selection/CachingHiliteSetProvider.d.ts.map +0 -1
  45. package/lib/cjs/unified-selection/CachingHiliteSetProvider.js +0 -27
  46. package/lib/cjs/unified-selection/CachingHiliteSetProvider.js.map +0 -1
  47. package/lib/cjs/unified-selection/DisposePolyfill.d.ts +0 -1
  48. package/lib/cjs/unified-selection/DisposePolyfill.d.ts.map +0 -1
  49. package/lib/cjs/unified-selection/DisposePolyfill.js +0 -11
  50. package/lib/cjs/unified-selection/DisposePolyfill.js.map +0 -1
  51. package/lib/cjs/unified-selection/EnableUnifiedSelectionSyncWithIModel.d.ts.map +0 -1
  52. package/lib/cjs/unified-selection/EnableUnifiedSelectionSyncWithIModel.js +0 -392
  53. package/lib/cjs/unified-selection/EnableUnifiedSelectionSyncWithIModel.js.map +0 -1
  54. package/lib/cjs/unified-selection/HiliteSetProvider.d.ts.map +0 -1
  55. package/lib/cjs/unified-selection/HiliteSetProvider.js +0 -382
  56. package/lib/cjs/unified-selection/HiliteSetProvider.js.map +0 -1
  57. package/lib/cjs/unified-selection/IModelHiliteSetProvider.d.ts +0 -51
  58. package/lib/cjs/unified-selection/IModelHiliteSetProvider.d.ts.map +0 -1
  59. package/lib/cjs/unified-selection/IModelHiliteSetProvider.js +0 -66
  60. package/lib/cjs/unified-selection/IModelHiliteSetProvider.js.map +0 -1
  61. package/lib/cjs/unified-selection/Selectable.d.ts +0 -150
  62. package/lib/cjs/unified-selection/Selectable.d.ts.map +0 -1
  63. package/lib/cjs/unified-selection/Selectable.js +0 -238
  64. package/lib/cjs/unified-selection/Selectable.js.map +0 -1
  65. package/lib/cjs/unified-selection/SelectionChangeEvent.d.ts.map +0 -1
  66. package/lib/cjs/unified-selection/SelectionChangeEvent.js +0 -7
  67. package/lib/cjs/unified-selection/SelectionChangeEvent.js.map +0 -1
  68. package/lib/cjs/unified-selection/SelectionScope.d.ts.map +0 -1
  69. package/lib/cjs/unified-selection/SelectionScope.js +0 -252
  70. package/lib/cjs/unified-selection/SelectionScope.js.map +0 -1
  71. package/lib/cjs/unified-selection/SelectionStorage.d.ts +0 -105
  72. package/lib/cjs/unified-selection/SelectionStorage.d.ts.map +0 -1
  73. package/lib/cjs/unified-selection/SelectionStorage.js +0 -153
  74. package/lib/cjs/unified-selection/SelectionStorage.js.map +0 -1
  75. package/lib/cjs/unified-selection/Utils.d.ts +0 -39
  76. package/lib/cjs/unified-selection/Utils.d.ts.map +0 -1
  77. package/lib/cjs/unified-selection/Utils.js +0 -82
  78. package/lib/cjs/unified-selection/Utils.js.map +0 -1
  79. package/lib/cjs/unified-selection/types/IModel.d.ts +0 -133
  80. package/lib/cjs/unified-selection/types/IModel.d.ts.map +0 -1
  81. package/lib/cjs/unified-selection/types/IModel.js +0 -24
  82. package/lib/cjs/unified-selection/types/IModel.js.map +0 -1
  83. package/lib/cjs/unified-selection.d.ts +0 -10
  84. package/lib/cjs/unified-selection.d.ts.map +0 -1
  85. package/lib/cjs/unified-selection.js +0 -27
  86. package/lib/cjs/unified-selection.js.map +0 -1
  87. package/lib/esm/unified-selection/CachingHiliteSetProvider.d.ts +0 -56
  88. package/lib/esm/unified-selection/CachingHiliteSetProvider.d.ts.map +0 -1
  89. package/lib/esm/unified-selection/CachingHiliteSetProvider.js.map +0 -1
  90. package/lib/esm/unified-selection/DisposePolyfill.d.ts.map +0 -1
  91. package/lib/esm/unified-selection/DisposePolyfill.js.map +0 -1
  92. package/lib/esm/unified-selection/EnableUnifiedSelectionSyncWithIModel.d.ts +0 -119
  93. package/lib/esm/unified-selection/EnableUnifiedSelectionSyncWithIModel.d.ts.map +0 -1
  94. package/lib/esm/unified-selection/EnableUnifiedSelectionSyncWithIModel.js.map +0 -1
  95. package/lib/esm/unified-selection/HiliteSetProvider.d.ts +0 -48
  96. package/lib/esm/unified-selection/HiliteSetProvider.d.ts.map +0 -1
  97. package/lib/esm/unified-selection/HiliteSetProvider.js.map +0 -1
  98. package/lib/esm/unified-selection/IModelHiliteSetProvider.d.ts.map +0 -1
  99. package/lib/esm/unified-selection/IModelHiliteSetProvider.js.map +0 -1
  100. package/lib/esm/unified-selection/Selectable.d.ts.map +0 -1
  101. package/lib/esm/unified-selection/Selectable.js.map +0 -1
  102. package/lib/esm/unified-selection/SelectionChangeEvent.d.ts +0 -60
  103. package/lib/esm/unified-selection/SelectionChangeEvent.d.ts.map +0 -1
  104. package/lib/esm/unified-selection/SelectionChangeEvent.js.map +0 -1
  105. package/lib/esm/unified-selection/SelectionScope.d.ts +0 -54
  106. package/lib/esm/unified-selection/SelectionScope.d.ts.map +0 -1
  107. package/lib/esm/unified-selection/SelectionScope.js.map +0 -1
  108. package/lib/esm/unified-selection/SelectionStorage.d.ts.map +0 -1
  109. package/lib/esm/unified-selection/SelectionStorage.js.map +0 -1
  110. package/lib/esm/unified-selection/Utils.d.ts.map +0 -1
  111. package/lib/esm/unified-selection/Utils.js.map +0 -1
  112. package/lib/esm/unified-selection/types/IModel.d.ts.map +0 -1
  113. package/lib/esm/unified-selection/types/IModel.js.map +0 -1
  114. package/lib/esm/unified-selection.d.ts +0 -10
  115. package/lib/esm/unified-selection.d.ts.map +0 -1
  116. package/lib/esm/unified-selection.js.map +0 -1
  117. /package/lib/{esm/unified-selection → unified-selection}/CachingHiliteSetProvider.js +0 -0
  118. /package/lib/{esm/unified-selection → unified-selection}/DisposePolyfill.d.ts +0 -0
  119. /package/lib/{esm/unified-selection → unified-selection}/DisposePolyfill.js +0 -0
  120. /package/lib/{esm/unified-selection → unified-selection}/IModelHiliteSetProvider.js +0 -0
  121. /package/lib/{esm/unified-selection → unified-selection}/Selectable.js +0 -0
  122. /package/lib/{esm/unified-selection → unified-selection}/SelectionChangeEvent.js +0 -0
  123. /package/lib/{esm/unified-selection → unified-selection}/SelectionScope.js +0 -0
  124. /package/lib/{esm/unified-selection → unified-selection}/SelectionStorage.js +0 -0
  125. /package/lib/{esm/unified-selection → unified-selection}/types/IModel.js +0 -0
@@ -1,392 +0,0 @@
1
- "use strict";
2
- /*---------------------------------------------------------------------------------------------
3
- * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
4
- * See LICENSE.md in the project root for license terms and full copyright notice.
5
- *--------------------------------------------------------------------------------------------*/
6
- var __addDisposableResource = (this && this.__addDisposableResource) || function (env, value, async) {
7
- if (value !== null && value !== void 0) {
8
- if (typeof value !== "object" && typeof value !== "function") throw new TypeError("Object expected.");
9
- var dispose, inner;
10
- if (async) {
11
- if (!Symbol.asyncDispose) throw new TypeError("Symbol.asyncDispose is not defined.");
12
- dispose = value[Symbol.asyncDispose];
13
- }
14
- if (dispose === void 0) {
15
- if (!Symbol.dispose) throw new TypeError("Symbol.dispose is not defined.");
16
- dispose = value[Symbol.dispose];
17
- if (async) inner = dispose;
18
- }
19
- if (typeof dispose !== "function") throw new TypeError("Object not disposable.");
20
- if (inner) dispose = function() { try { inner.call(this); } catch (e) { return Promise.reject(e); } };
21
- env.stack.push({ value: value, dispose: dispose, async: async });
22
- }
23
- else if (async) {
24
- env.stack.push({ async: true });
25
- }
26
- return value;
27
- };
28
- var __disposeResources = (this && this.__disposeResources) || (function (SuppressedError) {
29
- return function (env) {
30
- function fail(e) {
31
- env.error = env.hasError ? new SuppressedError(e, env.error, "An error was suppressed during disposal.") : e;
32
- env.hasError = true;
33
- }
34
- var r, s = 0;
35
- function next() {
36
- while (r = env.stack.pop()) {
37
- try {
38
- if (!r.async && s === 1) return s = 0, env.stack.push(r), Promise.resolve().then(next);
39
- if (r.dispose) {
40
- var result = r.dispose.call(r.value);
41
- if (r.async) return s |= 2, Promise.resolve(result).then(next, function(e) { fail(e); return next(); });
42
- }
43
- else s |= 1;
44
- }
45
- catch (e) {
46
- fail(e);
47
- }
48
- }
49
- if (s === 1) return env.hasError ? Promise.reject(env.error) : Promise.resolve();
50
- if (env.hasError) throw env.error;
51
- }
52
- return next();
53
- };
54
- })(typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
55
- var e = new Error(message);
56
- return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
57
- });
58
- Object.defineProperty(exports, "__esModule", { value: true });
59
- exports.IModelSelectionHandler = void 0;
60
- exports.enableUnifiedSelectionSyncWithIModel = enableUnifiedSelectionSyncWithIModel;
61
- require("./DisposePolyfill.js");
62
- const rxjs_1 = require("rxjs");
63
- const core_bentley_1 = require("@itwin/core-bentley");
64
- const HiliteSetProvider_js_1 = require("./HiliteSetProvider.js");
65
- const IModelHiliteSetProvider_js_1 = require("./IModelHiliteSetProvider.js");
66
- const Selectable_js_1 = require("./Selectable.js");
67
- const SelectionScope_js_1 = require("./SelectionScope.js");
68
- const IModel_js_1 = require("./types/IModel.js");
69
- const Utils_js_1 = require("./Utils.js");
70
- /**
71
- * Enables synchronization between iModel selection and unified selection.
72
- * @returns function for disposing the synchronization.
73
- * @public
74
- */
75
- function enableUnifiedSelectionSyncWithIModel(props) {
76
- const selectionHandler = new IModelSelectionHandler(props);
77
- return () => selectionHandler[Symbol.dispose]();
78
- }
79
- /**
80
- * A handler that syncs selection between unified selection storage (`SelectionStorage`) and
81
- * an iModel (`iModel.selectionSet`, `iModel.hilited`).
82
- *
83
- * @internal
84
- */
85
- class IModelSelectionHandler {
86
- _selectionSourceName = "Tool";
87
- _imodelAccess;
88
- _selectionStorage;
89
- _imodelHiliteSetProvider;
90
- _activeScopeProvider;
91
- _isSuspended;
92
- _selectionStorageChangeTracker = 0;
93
- _cancelOngoingChanges = new rxjs_1.Subject();
94
- _unregisterUnifiedSelectionListener;
95
- _unregisterIModelSelectionSetListener;
96
- _disposeInternalHiliteSetProvider;
97
- #componentId;
98
- constructor(props) {
99
- this.#componentId = core_bentley_1.Guid.createValue();
100
- this._imodelAccess = props.imodelAccess;
101
- this._selectionStorage = props.selectionStorage;
102
- this._activeScopeProvider = props.activeScopeProvider;
103
- this._isSuspended = false;
104
- [this._imodelHiliteSetProvider, this._disposeInternalHiliteSetProvider] = (() => {
105
- if (props.imodelHiliteSetProvider) {
106
- return [props.imodelHiliteSetProvider, () => { }];
107
- }
108
- /* eslint-disable @typescript-eslint/no-deprecated */
109
- /* v8 ignore else -- @preserve */
110
- if (props.cachingHiliteSetProvider) {
111
- return [
112
- createIModelHiliteSetProviderFromCachingProvider(props.cachingHiliteSetProvider, props.hiliteSetProvider ?? (0, HiliteSetProvider_js_1.createHiliteSetProvider)({ imodelAccess: props.imodelAccess })),
113
- // don't need to dispose anything, because our wrapper has no dispose logic, and `cachingHiliteSetProvider` should be disposed
114
- // by whoever owns it
115
- () => { },
116
- ];
117
- }
118
- /* eslint-enable @typescript-eslint/no-deprecated */
119
- /* v8 ignore start */
120
- const internalProvider = (0, IModelHiliteSetProvider_js_1.createIModelHiliteSetProvider)({
121
- selectionStorage: this._selectionStorage,
122
- imodelProvider: () => this._imodelAccess,
123
- createHiliteSetProvider: () => props.hiliteSetProvider ?? (0, HiliteSetProvider_js_1.createHiliteSetProvider)({ imodelAccess: props.imodelAccess }),
124
- });
125
- return [internalProvider, () => (0, Utils_js_1.safeDispose)(internalProvider)];
126
- /* v8 ignore stop */
127
- })();
128
- this._unregisterIModelSelectionSetListener = this._imodelAccess.selectionSet.onChanged.addListener(this.onIModelSelectionChanged);
129
- this._unregisterUnifiedSelectionListener = this._selectionStorage.selectionChangeEvent.addListener(this.onUnifiedSelectionChanged);
130
- if (!is5xSelectionSet(this._imodelAccess.selectionSet)) {
131
- // itwinjs-core@4: stop imodel from syncing tool selection with hilited list - we want to manage that sync ourselves
132
- this._imodelAccess.hiliteSet.wantSyncWithSelectionSet = false;
133
- }
134
- this.applyCurrentHiliteSet({ activeSelectionAction: "clearAll" });
135
- }
136
- [Symbol.dispose]() {
137
- this._cancelOngoingChanges.next();
138
- this._unregisterIModelSelectionSetListener();
139
- this._unregisterUnifiedSelectionListener();
140
- this._disposeInternalHiliteSetProvider();
141
- }
142
- /** Temporarily suspends tool selection synchronization until the returned disposable object is disposed. */
143
- suspendIModelToolSelectionSync() {
144
- const wasSuspended = this._isSuspended;
145
- this._isSuspended = true;
146
- return {
147
- [Symbol.dispose]: () => {
148
- this._isSuspended = wasSuspended;
149
- },
150
- };
151
- }
152
- syncHiliteSet(props) {
153
- const { changeType, selectables, source } = props;
154
- switch (changeType) {
155
- case "clear":
156
- return this.applyCurrentHiliteSet({ activeSelectionAction: "clearAll" });
157
- case "replace":
158
- return this.applyCurrentHiliteSet({
159
- activeSelectionAction: source === this._selectionSourceName
160
- ? is5xSelectionSet(this._imodelAccess.selectionSet)
161
- ? // with 5x core we don't need to clear anything when event is triggered by a Tool (hilite and selection sets are in sync already)
162
- "keep"
163
- : // with 4x core we need to clear hilite set, because it's not synced with selection set
164
- "clearHilited"
165
- : // when event is triggered not by a Tool, we need to clear everything
166
- "clearAll",
167
- });
168
- case "add":
169
- return void (0, rxjs_1.from)(this._imodelHiliteSetProvider
170
- .getHiliteSetProvider({ imodelKey: this._imodelAccess.key })
171
- .getHiliteSet({ selectables }))
172
- .pipe((0, rxjs_1.takeUntil)(this._cancelOngoingChanges))
173
- .subscribe({
174
- next: (set) => {
175
- this.addHiliteSet(set);
176
- },
177
- });
178
- case "remove":
179
- return void (0, rxjs_1.from)(this._imodelHiliteSetProvider
180
- .getHiliteSetProvider({ imodelKey: this._imodelAccess.key })
181
- .getHiliteSet({ selectables }))
182
- .pipe((0, rxjs_1.takeUntil)(this._cancelOngoingChanges))
183
- .subscribe({
184
- next: (set) => {
185
- this.removeHiliteSet(set);
186
- },
187
- complete: () => {
188
- this.applyCurrentHiliteSet({ activeSelectionAction: "keep" });
189
- },
190
- });
191
- }
192
- }
193
- onUnifiedSelectionChanged = (args) => {
194
- // iModels are only interested in top-level selection changes
195
- if (args.imodelKey !== this._imodelAccess.key || args.level !== 0) {
196
- return;
197
- }
198
- // update the selection storage change tracker so we know the selection storage changed
199
- this._selectionStorageChangeTracker = (this._selectionStorageChangeTracker + 1) % Number.MAX_SAFE_INTEGER;
200
- if (args.changeType === "replace" || args.changeType === "clear") {
201
- this._cancelOngoingChanges.next();
202
- }
203
- this.syncHiliteSet(args);
204
- };
205
- applyCurrentHiliteSet({ activeSelectionAction, }) {
206
- if (activeSelectionAction !== "keep") {
207
- const env_1 = { stack: [], error: void 0, hasError: false };
208
- try {
209
- const _dispose = __addDisposableResource(env_1, this.suspendIModelToolSelectionSync(), false);
210
- if (!is5xSelectionSet(this._imodelAccess.selectionSet)) {
211
- this._imodelAccess.hiliteSet.clear();
212
- }
213
- if (activeSelectionAction === "clearAll") {
214
- this._imodelAccess.selectionSet.emptyAll();
215
- }
216
- }
217
- catch (e_1) {
218
- env_1.error = e_1;
219
- env_1.hasError = true;
220
- }
221
- finally {
222
- __disposeResources(env_1);
223
- }
224
- }
225
- (0, rxjs_1.from)(this._imodelHiliteSetProvider.getCurrentHiliteSet({ imodelKey: this._imodelAccess.key }))
226
- .pipe((0, rxjs_1.takeUntil)(this._cancelOngoingChanges))
227
- .subscribe({
228
- next: (ids) => {
229
- this.addHiliteSet(ids);
230
- },
231
- });
232
- }
233
- addHiliteSet(set) {
234
- const env_2 = { stack: [], error: void 0, hasError: false };
235
- try {
236
- const _dispose = __addDisposableResource(env_2, this.suspendIModelToolSelectionSync(), false);
237
- if (is5xSelectionSet(this._imodelAccess.selectionSet)) {
238
- // with 5.x core we can simply add the set as a whole
239
- this._imodelAccess.selectionSet.add({
240
- models: set.models,
241
- subcategories: set.subCategories,
242
- elements: set.elements,
243
- });
244
- }
245
- else {
246
- // pre-5.0 core requires adding models and subcategories to hilite set separately
247
- /* v8 ignore else -- @preserve */
248
- if (set.models.length) {
249
- this._imodelAccess.hiliteSet.models.addIds(set.models);
250
- }
251
- /* v8 ignore else -- @preserve */
252
- if (set.subCategories.length) {
253
- this._imodelAccess.hiliteSet.subcategories.addIds(set.subCategories);
254
- }
255
- /* v8 ignore else -- @preserve */
256
- if (set.elements.length) {
257
- this._imodelAccess.hiliteSet.elements.addIds(set.elements);
258
- this._imodelAccess.selectionSet.add(set.elements);
259
- }
260
- }
261
- }
262
- catch (e_2) {
263
- env_2.error = e_2;
264
- env_2.hasError = true;
265
- }
266
- finally {
267
- __disposeResources(env_2);
268
- }
269
- }
270
- removeHiliteSet(set) {
271
- const env_3 = { stack: [], error: void 0, hasError: false };
272
- try {
273
- const _dispose = __addDisposableResource(env_3, this.suspendIModelToolSelectionSync(), false);
274
- if (is5xSelectionSet(this._imodelAccess.selectionSet)) {
275
- // with 5.x core we can simply remove the set as a whole
276
- this._imodelAccess.selectionSet.remove({
277
- models: set.models,
278
- subcategories: set.subCategories,
279
- elements: set.elements,
280
- });
281
- }
282
- else {
283
- /* v8 ignore else -- @preserve */
284
- if (set.models.length) {
285
- this._imodelAccess.hiliteSet.models.deleteIds(set.models);
286
- }
287
- /* v8 ignore else -- @preserve */
288
- if (set.subCategories.length) {
289
- this._imodelAccess.hiliteSet.subcategories.deleteIds(set.subCategories);
290
- }
291
- /* v8 ignore else -- @preserve */
292
- if (set.elements.length) {
293
- this._imodelAccess.hiliteSet.elements.deleteIds(set.elements);
294
- this._imodelAccess.selectionSet.remove(set.elements);
295
- }
296
- }
297
- }
298
- catch (e_3) {
299
- env_3.error = e_3;
300
- env_3.hasError = true;
301
- }
302
- finally {
303
- __disposeResources(env_3);
304
- }
305
- }
306
- onIModelSelectionChanged = async (event) => {
307
- if (this._isSuspended) {
308
- return;
309
- }
310
- if (IModel_js_1.CoreSelectionSetEventType.Clear === event.type) {
311
- this._selectionStorage.clearSelection({ imodelKey: this._imodelAccess.key, source: this._selectionSourceName });
312
- return;
313
- }
314
- const ids = getSelectionSetChangeIds(event);
315
- const scopedSelection = (0, rxjs_1.merge)(ids.elements
316
- ? (0, rxjs_1.from)((0, SelectionScope_js_1.computeSelection)({
317
- queryExecutor: this._imodelAccess,
318
- elementIds: ids.elements,
319
- scope: this._activeScopeProvider(),
320
- componentId: this.#componentId,
321
- }))
322
- : /* v8 ignore next */ rxjs_1.EMPTY, ids.models
323
- ? (0, rxjs_1.from)(ids.models).pipe((0, rxjs_1.map)((id) => ({ className: "BisCore.Model", id })))
324
- : /* v8 ignore next */ rxjs_1.EMPTY, ids.subcategories
325
- ? (0, rxjs_1.from)(ids.subcategories).pipe((0, rxjs_1.map)((id) => ({ className: "BisCore.SubCategory", id })))
326
- : /* v8 ignore next */ rxjs_1.EMPTY);
327
- const selectionStorageVersion = this._selectionStorageChangeTracker;
328
- const changeSelectionStorageProps = {
329
- imodelKey: this._imodelAccess.key,
330
- source: this._selectionSourceName,
331
- selectables: await (0, rxjs_1.firstValueFrom)(scopedSelection.pipe((0, rxjs_1.toArray)())),
332
- };
333
- try {
334
- switch (event.type) {
335
- case IModel_js_1.CoreSelectionSetEventType.Add:
336
- return this._selectionStorage.addToSelection(changeSelectionStorageProps);
337
- case IModel_js_1.CoreSelectionSetEventType.Remove:
338
- return this._selectionStorage.removeFromSelection(changeSelectionStorageProps);
339
- case IModel_js_1.CoreSelectionSetEventType.Replace:
340
- return this._selectionStorage.replaceSelection(changeSelectionStorageProps);
341
- }
342
- }
343
- finally {
344
- if (this._selectionStorageChangeTracker === selectionStorageVersion) {
345
- // if the storage wasn't changed while we were processing the selection change, we have to re-sync the
346
- // hilite set (otherwise it's done by the selection storage change handler)
347
- this.syncHiliteSet({
348
- ...changeSelectionStorageProps,
349
- selectables: Selectable_js_1.Selectables.create(changeSelectionStorageProps.selectables),
350
- changeType: getUnifiedSelectionChangeType(event.type),
351
- });
352
- }
353
- }
354
- };
355
- }
356
- exports.IModelSelectionHandler = IModelSelectionHandler;
357
- function getSelectionSetChangeIds(event) {
358
- switch (event.type) {
359
- case IModel_js_1.CoreSelectionSetEventType.Add:
360
- return event.additions ?? (event.added ? { elements: event.added } : /* v8 ignore next */ {});
361
- case IModel_js_1.CoreSelectionSetEventType.Remove:
362
- return event.removals ?? (event.removed ? { elements: event.removed } : /* v8 ignore next */ {});
363
- case IModel_js_1.CoreSelectionSetEventType.Replace:
364
- return "active" in event.set ? event.set.active : { elements: event.set.elements };
365
- }
366
- }
367
- function getUnifiedSelectionChangeType(coreChangeType) {
368
- switch (coreChangeType) {
369
- case IModel_js_1.CoreSelectionSetEventType.Add:
370
- return "add";
371
- case IModel_js_1.CoreSelectionSetEventType.Remove:
372
- return "remove";
373
- case IModel_js_1.CoreSelectionSetEventType.Replace:
374
- return "replace";
375
- /* v8 ignore next -- @preserve */
376
- case IModel_js_1.CoreSelectionSetEventType.Clear:
377
- return "clear";
378
- }
379
- }
380
- function is5xSelectionSet(selectionSet) {
381
- return "active" in selectionSet;
382
- }
383
- /* v8 ignore start */
384
- function createIModelHiliteSetProviderFromCachingProvider(cachingHiliteSetProvider, hiliteSetProvider) {
385
- return {
386
- getHiliteSetProvider: () => hiliteSetProvider,
387
- getCurrentHiliteSet: (props) => cachingHiliteSetProvider.getHiliteSet(props),
388
- [Symbol.dispose]: () => { },
389
- };
390
- }
391
- /* v8 ignore stop */
392
- //# sourceMappingURL=EnableUnifiedSelectionSyncWithIModel.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"EnableUnifiedSelectionSyncWithIModel.js","sourceRoot":"","sources":["../../../src/unified-selection/EnableUnifiedSelectionSyncWithIModel.ts"],"names":[],"mappings":";AAAA;;;gGAGgG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEhG,gCAA8B;AAE9B,+BAA4F;AAC5F,sDAAyE;AAGzE,iEAA+F;AAC/F,6EAAsG;AACtG,mDAAqE;AAErE,2DAAuE;AAEvE,iDAM2B;AAC3B,yCAAyC;AAgFzC;;;;GAIG;AACH,8CAAqD,KAAgD;IACnG,MAAM,gBAAgB,GAAG,IAAI,sBAAsB,CAAC,KAAK,CAAC,CAAC;IAC3D,OAAO,GAAG,EAAE,CAAC,gBAAgB,CAAC,MAAM,CAAC,OAAO,CAAC,EAAE,CAAC;AAClD,CAAC;AAED;;;;;GAKG;AACH;IACU,oBAAoB,GAAG,MAAM,CAAC;IAE9B,aAAa,CAA4D;IACzE,iBAAiB,CAAmB;IACpC,wBAAwB,CAAoF;IAC5G,oBAAoB,CAAuB;IAE3C,YAAY,CAAU;IACtB,8BAA8B,GAAG,CAAC,CAAC;IACnC,qBAAqB,GAAG,IAAI,cAAO,EAAQ,CAAC;IAC5C,mCAAmC,CAAa;IAChD,qCAAqC,CAAa;IAClD,iCAAiC,CAAa;IAEtD,YAAY,CAAa;IAEzB,YAAmB,KAA4F;QAC7G,IAAI,CAAC,YAAY,GAAG,mBAAI,CAAC,WAAW,EAAE,CAAC;QACvC,IAAI,CAAC,aAAa,GAAG,KAAK,CAAC,YAAY,CAAC;QACxC,IAAI,CAAC,iBAAiB,GAAG,KAAK,CAAC,gBAAgB,CAAC;QAChD,IAAI,CAAC,oBAAoB,GAAG,KAAK,CAAC,mBAAmB,CAAC;QACtD,IAAI,CAAC,YAAY,GAAG,KAAK,CAAC;QAC1B,CAAC,IAAI,CAAC,wBAAwB,EAAE,IAAI,CAAC,iCAAiC,CAAC,GA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AAG,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,QAAQ,EAAE,KAAK,CAAC,GAAG,CAAC,QAAQ,EAAE,CAAC;IACvF,CAAC;AACH,CAAC;AAED,SAAS,6BAA6B,CAAC,cAAyC;IAC9E,QAAQ,cAAc,EAAE,CAAC;QACvB,KAAK,qCAAyB,CAAC,GAAG;YAChC,OAAO,KAAK,CAAC;QACf,KAAK,qCAAyB,CAAC,MAAM;YACnC,OAAO,QAAQ,CAAC;QAClB,KAAK,qCAAyB,CAAC,OAAO;YACpC,OAAO,SAAS,CAAC;QACnB,iCAAiC;QACjC,KAAK,qCAAyB,CAAC,KAAK;YAClC,OAAO,OAAO,CAAC;IACnB,CAAC;AACH,CAAC;AAED,SAAS,gBAAgB,CACvB,YAAoC;IAMpC,OAAO,QAAQ,IAAI,YAAY,CAAC;AAClC,CAAC;AAED,qBAAqB;AACrB,SAAS,gDAAgD,CACvD,wBAA4G,EAC5G,iBAAoC;IAEpC,OAAO;QACL,oBAAoB,EAAE,GAAG,EAAE,CAAC,iBAAiB;QAC7C,mBAAmB,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,wBAAwB,CAAC,YAAY,CAAC,KAAK,CAAC;QAC5E,CAAC,MAAM,CAAC,OAAO,CAAC,EAAE,GAAG,EAAE,GAAE,CAAC;KAC3B,CAAC;AACJ,CAAC;AACD,oBAAoB","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n\nimport \"./DisposePolyfill.js\";\n\nimport { EMPTY, firstValueFrom, from, map, merge, Subject, takeUntil, toArray } from \"rxjs\";\nimport { Guid, GuidString, Id64Arg, Id64Set } from \"@itwin/core-bentley\";\nimport { ECClassHierarchyInspector, ECSqlQueryExecutor } from \"@itwin/presentation-shared\";\nimport { CachingHiliteSetProvider } from \"./CachingHiliteSetProvider.js\";\nimport { createHiliteSetProvider, HiliteSet, HiliteSetProvider } from \"./HiliteSetProvider.js\";\nimport { createIModelHiliteSetProvider, IModelHiliteSetProvider } from \"./IModelHiliteSetProvider.js\";\nimport { SelectableInstanceKey, Selectables } from \"./Selectable.js\";\nimport { StorageSelectionChangeEventArgs, StorageSelectionChangeType } from \"./SelectionChangeEvent.js\";\nimport { computeSelection, SelectionScope } from \"./SelectionScope.js\";\nimport { SelectionStorage } from \"./SelectionStorage.js\";\nimport {\n CoreIModelHiliteSet,\n CoreIModelSelectionSet,\n CoreSelectableIds,\n CoreSelectionSetEventType,\n CoreSelectionSetEventUnsafe,\n} from \"./types/IModel.js\";\nimport { safeDispose } from \"./Utils.js\";\n\n/**\n * Props for `enableUnifiedSelectionSyncWithIModel`.\n * @public\n */\nexport interface EnableUnifiedSelectionSyncWithIModelProps {\n /**\n * Provides access to different iModel's features: query executing, class hierarchy, selection and hilite sets.\n *\n * It's recommended to use `@itwin/presentation-core-interop` to create `key`, `ECSqlQueryExecutor` and `ECSchemaProvider` from\n * [IModelConnection](https://www.itwinjs.org/reference/core-frontend/imodelconnection/imodelconnection/), and map its\n * `hilited` and `selectionSet` attributes like this:\n *\n * ```ts\n * import { createECSqlQueryExecutor, createECSchemaProvider, createIModelKey } from \"@itwin/presentation-core-interop\";\n * import { createCachingECClassHierarchyInspector } from \"@itwin/presentation-shared\";\n * import { IModelConnection } from \"@itwin/core-frontend\";\n *\n * const imodel: IModelConnection = ...\n * const imodelAccess = {\n * ...createECSqlQueryExecutor(imodel),\n * ...createCachingECClassHierarchyInspector({ schemaProvider: createECSchemaProvider(MyAppFrontend.getSchemaContext(imodel)) }),\n * key: createIModelKey(imodel),\n * hiliteSet: imodel.hilited,\n * selectionSet: imodel.selectionSet,\n * };\n * ```\n */\n imodelAccess: ECSqlQueryExecutor &\n ECClassHierarchyInspector & {\n /** Key of the iModel. Generally taken from `IModelConnection.key`. */\n readonly key: string;\n /** The set of currently hilited elements taken from `IModelConnection.hilited`. */\n readonly hiliteSet: CoreIModelHiliteSet;\n /** The set of currently selected elements taken from `IModelConnection.selectionSet`. */\n readonly selectionSet: CoreIModelSelectionSet;\n };\n\n /**\n * Unified selection storage to synchronize IModel's tool selection with. The storage should be shared\n * across all components in the application to ensure unified selection experience.\n */\n selectionStorage: SelectionStorage;\n\n /** Active selection scope provider. */\n activeScopeProvider: () => SelectionScope;\n\n /**\n * An iModel hilite set provider used to retrieve hilite sets for different iModels. If not provided, a new `IModelHiliteSetProvider`\n * will be created for the given iModel using the provided `imodelAccess`.\n * If the consuming application already has a `IModelHiliteSetProvider` defined, it should be provided instead\n * to reuse the cache and avoid creating new providers for each iModel.\n *\n * @see `createIModelHiliteSetProvider`\n */\n imodelHiliteSetProvider?: IModelHiliteSetProvider;\n\n /**\n * A caching hilite set provider used to retrieve hilite sets for an iModel. If not provided, a new `CachingHiliteSetProvider`\n * will be created for the given iModel using the provided `imodelAccess`.\n * If the consuming application already has a `CachingHiliteSetProvider` defined, it should be provided instead\n * to reuse the cache and avoid creating new providers for each iModel.\n *\n * The type is defined in a way that makes it required for provider to have either the deprecated `dispose` or the\n * new `Symbol.dispose` method.\n *\n * **Warning:** When the given `CachingHiliteSetProvider` internally uses a custom `HiliteSetProvider`, the synchronization has\n * no access to it, and thus uses its own, default, `HiliteSetProvider`. As a result, the synchronization may not work as expected.\n * To alleviate this, the `imodelHiliteSetProvider` prop should be used instead.\n *\n * @deprecated in 1.5. Use `imodelHiliteSetProvider` prop instead.\n */\n cachingHiliteSetProvider?:\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n | CachingHiliteSetProvider\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n | (Omit<CachingHiliteSetProvider, \"dispose\"> & { [Symbol.dispose]: () => void });\n}\n\n/**\n * Enables synchronization between iModel selection and unified selection.\n * @returns function for disposing the synchronization.\n * @public\n */\nexport function enableUnifiedSelectionSyncWithIModel(props: EnableUnifiedSelectionSyncWithIModelProps): () => void {\n const selectionHandler = new IModelSelectionHandler(props);\n return () => selectionHandler[Symbol.dispose]();\n}\n\n/**\n * A handler that syncs selection between unified selection storage (`SelectionStorage`) and\n * an iModel (`iModel.selectionSet`, `iModel.hilited`).\n *\n * @internal\n */\nexport class IModelSelectionHandler {\n private _selectionSourceName = \"Tool\";\n\n private _imodelAccess: EnableUnifiedSelectionSyncWithIModelProps[\"imodelAccess\"];\n private _selectionStorage: SelectionStorage;\n private _imodelHiliteSetProvider: NonNullable<EnableUnifiedSelectionSyncWithIModelProps[\"imodelHiliteSetProvider\"]>;\n private _activeScopeProvider: () => SelectionScope;\n\n private _isSuspended: boolean;\n private _selectionStorageChangeTracker = 0;\n private _cancelOngoingChanges = new Subject<void>();\n private _unregisterUnifiedSelectionListener: () => void;\n private _unregisterIModelSelectionSetListener: () => void;\n private _disposeInternalHiliteSetProvider: () => void;\n\n #componentId: GuidString;\n\n public constructor(props: EnableUnifiedSelectionSyncWithIModelProps & { hiliteSetProvider?: HiliteSetProvider }) {\n this.#componentId = Guid.createValue();\n this._imodelAccess = props.imodelAccess;\n this._selectionStorage = props.selectionStorage;\n this._activeScopeProvider = props.activeScopeProvider;\n this._isSuspended = false;\n [this._imodelHiliteSetProvider, this._disposeInternalHiliteSetProvider] = (() => {\n if (props.imodelHiliteSetProvider) {\n return [props.imodelHiliteSetProvider, () => {}];\n }\n\n /* eslint-disable @typescript-eslint/no-deprecated */\n /* v8 ignore else -- @preserve */\n if (props.cachingHiliteSetProvider) {\n return [\n createIModelHiliteSetProviderFromCachingProvider(\n props.cachingHiliteSetProvider,\n props.hiliteSetProvider ?? createHiliteSetProvider({ imodelAccess: props.imodelAccess }),\n ),\n // don't need to dispose anything, because our wrapper has no dispose logic, and `cachingHiliteSetProvider` should be disposed\n // by whoever owns it\n () => {},\n ];\n }\n /* eslint-enable @typescript-eslint/no-deprecated */\n\n /* v8 ignore start */\n const internalProvider = createIModelHiliteSetProvider({\n selectionStorage: this._selectionStorage,\n imodelProvider: () => this._imodelAccess,\n createHiliteSetProvider: () =>\n props.hiliteSetProvider ?? createHiliteSetProvider({ imodelAccess: props.imodelAccess }),\n });\n return [internalProvider, () => safeDispose(internalProvider)];\n /* v8 ignore stop */\n })();\n\n this._unregisterIModelSelectionSetListener = this._imodelAccess.selectionSet.onChanged.addListener(\n this.onIModelSelectionChanged,\n );\n this._unregisterUnifiedSelectionListener = this._selectionStorage.selectionChangeEvent.addListener(\n this.onUnifiedSelectionChanged,\n );\n\n if (!is5xSelectionSet(this._imodelAccess.selectionSet)) {\n // itwinjs-core@4: stop imodel from syncing tool selection with hilited list - we want to manage that sync ourselves\n this._imodelAccess.hiliteSet.wantSyncWithSelectionSet = false;\n }\n\n this.applyCurrentHiliteSet({ activeSelectionAction: \"clearAll\" });\n }\n\n public [Symbol.dispose]() {\n this._cancelOngoingChanges.next();\n this._unregisterIModelSelectionSetListener();\n this._unregisterUnifiedSelectionListener();\n this._disposeInternalHiliteSetProvider();\n }\n\n /** Temporarily suspends tool selection synchronization until the returned disposable object is disposed. */\n public suspendIModelToolSelectionSync() {\n const wasSuspended = this._isSuspended;\n this._isSuspended = true;\n return {\n [Symbol.dispose]: () => {\n this._isSuspended = wasSuspended;\n },\n };\n }\n\n private syncHiliteSet(props: {\n changeType: StorageSelectionChangeType;\n selectables: Selectables;\n source: string;\n }): void {\n const { changeType, selectables, source } = props;\n switch (changeType) {\n case \"clear\":\n return this.applyCurrentHiliteSet({ activeSelectionAction: \"clearAll\" });\n case \"replace\":\n return this.applyCurrentHiliteSet({\n activeSelectionAction:\n source === this._selectionSourceName\n ? is5xSelectionSet(this._imodelAccess.selectionSet)\n ? // with 5x core we don't need to clear anything when event is triggered by a Tool (hilite and selection sets are in sync already)\n \"keep\"\n : // with 4x core we need to clear hilite set, because it's not synced with selection set\n \"clearHilited\"\n : // when event is triggered not by a Tool, we need to clear everything\n \"clearAll\",\n });\n case \"add\":\n return void from(\n this._imodelHiliteSetProvider\n .getHiliteSetProvider({ imodelKey: this._imodelAccess.key })\n .getHiliteSet({ selectables }),\n )\n .pipe(takeUntil(this._cancelOngoingChanges))\n .subscribe({\n next: (set) => {\n this.addHiliteSet(set);\n },\n });\n case \"remove\":\n return void from(\n this._imodelHiliteSetProvider\n .getHiliteSetProvider({ imodelKey: this._imodelAccess.key })\n .getHiliteSet({ selectables }),\n )\n .pipe(takeUntil(this._cancelOngoingChanges))\n .subscribe({\n next: (set) => {\n this.removeHiliteSet(set);\n },\n complete: () => {\n this.applyCurrentHiliteSet({ activeSelectionAction: \"keep\" });\n },\n });\n }\n }\n\n private onUnifiedSelectionChanged = (args: StorageSelectionChangeEventArgs) => {\n // iModels are only interested in top-level selection changes\n if (args.imodelKey !== this._imodelAccess.key || args.level !== 0) {\n return;\n }\n\n // update the selection storage change tracker so we know the selection storage changed\n this._selectionStorageChangeTracker = (this._selectionStorageChangeTracker + 1) % Number.MAX_SAFE_INTEGER;\n\n if (args.changeType === \"replace\" || args.changeType === \"clear\") {\n this._cancelOngoingChanges.next();\n }\n this.syncHiliteSet(args);\n };\n\n private applyCurrentHiliteSet({\n activeSelectionAction,\n }: {\n activeSelectionAction: \"clearAll\" | \"clearHilited\" | \"keep\";\n }) {\n if (activeSelectionAction !== \"keep\") {\n using _dispose = this.suspendIModelToolSelectionSync();\n if (!is5xSelectionSet(this._imodelAccess.selectionSet)) {\n this._imodelAccess.hiliteSet.clear();\n }\n if (activeSelectionAction === \"clearAll\") {\n this._imodelAccess.selectionSet.emptyAll();\n }\n }\n\n from(this._imodelHiliteSetProvider.getCurrentHiliteSet({ imodelKey: this._imodelAccess.key }))\n .pipe(takeUntil(this._cancelOngoingChanges))\n .subscribe({\n next: (ids) => {\n this.addHiliteSet(ids);\n },\n });\n }\n\n private addHiliteSet(set: HiliteSet) {\n using _dispose = this.suspendIModelToolSelectionSync();\n if (is5xSelectionSet(this._imodelAccess.selectionSet)) {\n // with 5.x core we can simply add the set as a whole\n this._imodelAccess.selectionSet.add({\n models: set.models,\n subcategories: set.subCategories,\n elements: set.elements,\n });\n } else {\n // pre-5.0 core requires adding models and subcategories to hilite set separately\n /* v8 ignore else -- @preserve */\n if (set.models.length) {\n this._imodelAccess.hiliteSet.models.addIds(set.models);\n }\n /* v8 ignore else -- @preserve */\n if (set.subCategories.length) {\n this._imodelAccess.hiliteSet.subcategories.addIds(set.subCategories);\n }\n /* v8 ignore else -- @preserve */\n if (set.elements.length) {\n this._imodelAccess.hiliteSet.elements.addIds(set.elements);\n this._imodelAccess.selectionSet.add(set.elements);\n }\n }\n }\n\n private removeHiliteSet(set: HiliteSet) {\n using _dispose = this.suspendIModelToolSelectionSync();\n if (is5xSelectionSet(this._imodelAccess.selectionSet)) {\n // with 5.x core we can simply remove the set as a whole\n this._imodelAccess.selectionSet.remove({\n models: set.models,\n subcategories: set.subCategories,\n elements: set.elements,\n });\n } else {\n /* v8 ignore else -- @preserve */\n if (set.models.length) {\n this._imodelAccess.hiliteSet.models.deleteIds(set.models);\n }\n /* v8 ignore else -- @preserve */\n if (set.subCategories.length) {\n this._imodelAccess.hiliteSet.subcategories.deleteIds(set.subCategories);\n }\n /* v8 ignore else -- @preserve */\n if (set.elements.length) {\n this._imodelAccess.hiliteSet.elements.deleteIds(set.elements);\n this._imodelAccess.selectionSet.remove(set.elements);\n }\n }\n }\n\n private onIModelSelectionChanged = async (event: CoreSelectionSetEventUnsafe): Promise<void> => {\n if (this._isSuspended) {\n return;\n }\n\n if (CoreSelectionSetEventType.Clear === event.type) {\n this._selectionStorage.clearSelection({ imodelKey: this._imodelAccess.key, source: this._selectionSourceName });\n return;\n }\n\n const ids = getSelectionSetChangeIds(event);\n const scopedSelection = merge(\n ids.elements\n ? from(\n computeSelection({\n queryExecutor: this._imodelAccess,\n elementIds: ids.elements,\n scope: this._activeScopeProvider(),\n componentId: this.#componentId,\n }),\n )\n : /* v8 ignore next */ EMPTY,\n ids.models\n ? from(ids.models).pipe(map((id): SelectableInstanceKey => ({ className: \"BisCore.Model\", id })))\n : /* v8 ignore next */ EMPTY,\n ids.subcategories\n ? from(ids.subcategories).pipe(map((id): SelectableInstanceKey => ({ className: \"BisCore.SubCategory\", id })))\n : /* v8 ignore next */ EMPTY,\n );\n\n const selectionStorageVersion = this._selectionStorageChangeTracker;\n const changeSelectionStorageProps = {\n imodelKey: this._imodelAccess.key,\n source: this._selectionSourceName,\n selectables: await firstValueFrom(scopedSelection.pipe(toArray())),\n };\n try {\n switch (event.type) {\n case CoreSelectionSetEventType.Add:\n return this._selectionStorage.addToSelection(changeSelectionStorageProps);\n case CoreSelectionSetEventType.Remove:\n return this._selectionStorage.removeFromSelection(changeSelectionStorageProps);\n case CoreSelectionSetEventType.Replace:\n return this._selectionStorage.replaceSelection(changeSelectionStorageProps);\n }\n } finally {\n if (this._selectionStorageChangeTracker === selectionStorageVersion) {\n // if the storage wasn't changed while we were processing the selection change, we have to re-sync the\n // hilite set (otherwise it's done by the selection storage change handler)\n this.syncHiliteSet({\n ...changeSelectionStorageProps,\n selectables: Selectables.create(changeSelectionStorageProps.selectables),\n changeType: getUnifiedSelectionChangeType(event.type),\n });\n }\n }\n };\n}\n\nfunction getSelectionSetChangeIds(\n event: Omit<CoreSelectionSetEventUnsafe, \"type\"> & {\n type: CoreSelectionSetEventType.Add | CoreSelectionSetEventType.Remove | CoreSelectionSetEventType.Replace;\n },\n): CoreSelectableIds {\n switch (event.type) {\n case CoreSelectionSetEventType.Add:\n return event.additions ?? (event.added ? { elements: event.added } : /* v8 ignore next */ {});\n case CoreSelectionSetEventType.Remove:\n return event.removals ?? (event.removed ? { elements: event.removed } : /* v8 ignore next */ {});\n case CoreSelectionSetEventType.Replace:\n return \"active\" in event.set ? event.set.active : { elements: event.set.elements };\n }\n}\n\nfunction getUnifiedSelectionChangeType(coreChangeType: CoreSelectionSetEventType): StorageSelectionChangeType {\n switch (coreChangeType) {\n case CoreSelectionSetEventType.Add:\n return \"add\";\n case CoreSelectionSetEventType.Remove:\n return \"remove\";\n case CoreSelectionSetEventType.Replace:\n return \"replace\";\n /* v8 ignore next -- @preserve */\n case CoreSelectionSetEventType.Clear:\n return \"clear\";\n }\n}\n\nfunction is5xSelectionSet(\n selectionSet: CoreIModelSelectionSet,\n): selectionSet is Omit<CoreIModelSelectionSet, \"add\" | \"remove\"> & {\n readonly active: { [P in keyof CoreSelectableIds]-?: Id64Set };\n add: (ids: Id64Arg | CoreSelectableIds) => boolean;\n remove: (ids: Id64Arg | CoreSelectableIds) => boolean;\n} {\n return \"active\" in selectionSet;\n}\n\n/* v8 ignore start */\nfunction createIModelHiliteSetProviderFromCachingProvider(\n cachingHiliteSetProvider: NonNullable<EnableUnifiedSelectionSyncWithIModelProps[\"cachingHiliteSetProvider\"]>,\n hiliteSetProvider: HiliteSetProvider,\n): IModelHiliteSetProvider {\n return {\n getHiliteSetProvider: () => hiliteSetProvider,\n getCurrentHiliteSet: (props) => cachingHiliteSetProvider.getHiliteSet(props),\n [Symbol.dispose]: () => {},\n };\n}\n/* v8 ignore stop */\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"HiliteSetProvider.d.ts","sourceRoot":"","sources":["../../../src/unified-selection/HiliteSetProvider.ts"],"names":[],"mappings":"AAoBA,OAAO,EAAoB,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACnE,OAAO,EACL,yBAAyB,EAGzB,kBAAkB,EAInB,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAyB,WAAW,EAA+B,MAAM,iBAAiB,CAAC;AAKlG;;;;;;;;;;GAUG;AACH,MAAM,WAAW,SAAS;IACxB,MAAM,EAAE,UAAU,EAAE,CAAC;IACrB,aAAa,EAAE,UAAU,EAAE,CAAC;IAC5B,QAAQ,EAAE,UAAU,EAAE,CAAC;CACxB;AAED;;;GAGG;AACH,MAAM,WAAW,sBAAsB;IACrC,kGAAkG;IAClG,YAAY,EAAE,yBAAyB,GAAG,kBAAkB,CAAC;CAC9D;AAED;;;;;;;;GAQG;AACH,MAAM,WAAW,iBAAiB;IAChC,mEAAmE;IACnE,YAAY,CAAC,KAAK,EAAE;QAAE,WAAW,EAAE,WAAW,CAAA;KAAE,GAAG,qBAAqB,CAAC,SAAS,CAAC,CAAC;CACrF;AAED;;;GAGG;AACH,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,sBAAsB,GAAG,iBAAiB,CAExF"}