@itwin/unified-selection 1.8.3 → 2.0.0-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +30 -0
- package/README.md +1 -1
- package/lib/{cjs/unified-selection → unified-selection}/CachingHiliteSetProvider.d.ts +3 -3
- package/lib/unified-selection/CachingHiliteSetProvider.d.ts.map +1 -0
- package/lib/unified-selection/CachingHiliteSetProvider.js.map +1 -0
- package/lib/unified-selection/DisposePolyfill.d.ts.map +1 -0
- package/lib/unified-selection/DisposePolyfill.js.map +1 -0
- package/lib/{cjs/unified-selection → unified-selection}/EnableUnifiedSelectionSyncWithIModel.d.ts +7 -7
- package/lib/unified-selection/EnableUnifiedSelectionSyncWithIModel.d.ts.map +1 -0
- package/lib/{esm/unified-selection → unified-selection}/EnableUnifiedSelectionSyncWithIModel.js +1 -1
- package/lib/unified-selection/EnableUnifiedSelectionSyncWithIModel.js.map +1 -0
- package/lib/{cjs/unified-selection → unified-selection}/HiliteSetProvider.d.ts +3 -3
- package/lib/unified-selection/HiliteSetProvider.d.ts.map +1 -0
- package/lib/{esm/unified-selection → unified-selection}/HiliteSetProvider.js +2 -2
- package/lib/unified-selection/HiliteSetProvider.js.map +1 -0
- package/lib/{esm/unified-selection → unified-selection}/IModelHiliteSetProvider.d.ts +4 -3
- package/lib/unified-selection/IModelHiliteSetProvider.d.ts.map +1 -0
- package/lib/unified-selection/IModelHiliteSetProvider.js.map +1 -0
- package/lib/{esm/unified-selection → unified-selection}/Selectable.d.ts +1 -1
- package/lib/unified-selection/Selectable.d.ts.map +1 -0
- package/lib/unified-selection/Selectable.js.map +1 -0
- package/lib/{cjs/unified-selection → unified-selection}/SelectionChangeEvent.d.ts +2 -2
- package/lib/unified-selection/SelectionChangeEvent.d.ts.map +1 -0
- package/lib/unified-selection/SelectionChangeEvent.js.map +1 -0
- package/lib/{cjs/unified-selection → unified-selection}/SelectionScope.d.ts +3 -3
- package/lib/unified-selection/SelectionScope.d.ts.map +1 -0
- package/lib/unified-selection/SelectionScope.js.map +1 -0
- package/lib/{esm/unified-selection → unified-selection}/SelectionStorage.d.ts +4 -3
- package/lib/unified-selection/SelectionStorage.d.ts.map +1 -0
- package/lib/unified-selection/SelectionStorage.js.map +1 -0
- package/lib/{esm/unified-selection → unified-selection}/Utils.d.ts +3 -3
- package/lib/unified-selection/Utils.d.ts.map +1 -0
- package/lib/{esm/unified-selection → unified-selection}/Utils.js +1 -1
- package/lib/unified-selection/Utils.js.map +1 -0
- package/lib/{esm/unified-selection → unified-selection}/types/IModel.d.ts +2 -2
- package/lib/unified-selection/types/IModel.d.ts.map +1 -0
- package/lib/unified-selection/types/IModel.js.map +1 -0
- package/lib/unified-selection.d.ts +16 -0
- package/lib/unified-selection.d.ts.map +1 -0
- package/lib/{esm/unified-selection.js → unified-selection.js} +2 -3
- package/lib/unified-selection.js.map +1 -0
- package/package.json +13 -15
- package/lib/cjs/package.json +0 -1
- package/lib/cjs/unified-selection/CachingHiliteSetProvider.d.ts.map +0 -1
- package/lib/cjs/unified-selection/CachingHiliteSetProvider.js +0 -27
- package/lib/cjs/unified-selection/CachingHiliteSetProvider.js.map +0 -1
- package/lib/cjs/unified-selection/DisposePolyfill.d.ts +0 -1
- package/lib/cjs/unified-selection/DisposePolyfill.d.ts.map +0 -1
- package/lib/cjs/unified-selection/DisposePolyfill.js +0 -11
- package/lib/cjs/unified-selection/DisposePolyfill.js.map +0 -1
- package/lib/cjs/unified-selection/EnableUnifiedSelectionSyncWithIModel.d.ts.map +0 -1
- package/lib/cjs/unified-selection/EnableUnifiedSelectionSyncWithIModel.js +0 -392
- package/lib/cjs/unified-selection/EnableUnifiedSelectionSyncWithIModel.js.map +0 -1
- package/lib/cjs/unified-selection/HiliteSetProvider.d.ts.map +0 -1
- package/lib/cjs/unified-selection/HiliteSetProvider.js +0 -382
- package/lib/cjs/unified-selection/HiliteSetProvider.js.map +0 -1
- package/lib/cjs/unified-selection/IModelHiliteSetProvider.d.ts +0 -51
- package/lib/cjs/unified-selection/IModelHiliteSetProvider.d.ts.map +0 -1
- package/lib/cjs/unified-selection/IModelHiliteSetProvider.js +0 -66
- package/lib/cjs/unified-selection/IModelHiliteSetProvider.js.map +0 -1
- package/lib/cjs/unified-selection/Selectable.d.ts +0 -150
- package/lib/cjs/unified-selection/Selectable.d.ts.map +0 -1
- package/lib/cjs/unified-selection/Selectable.js +0 -238
- package/lib/cjs/unified-selection/Selectable.js.map +0 -1
- package/lib/cjs/unified-selection/SelectionChangeEvent.d.ts.map +0 -1
- package/lib/cjs/unified-selection/SelectionChangeEvent.js +0 -7
- package/lib/cjs/unified-selection/SelectionChangeEvent.js.map +0 -1
- package/lib/cjs/unified-selection/SelectionScope.d.ts.map +0 -1
- package/lib/cjs/unified-selection/SelectionScope.js +0 -252
- package/lib/cjs/unified-selection/SelectionScope.js.map +0 -1
- package/lib/cjs/unified-selection/SelectionStorage.d.ts +0 -105
- package/lib/cjs/unified-selection/SelectionStorage.d.ts.map +0 -1
- package/lib/cjs/unified-selection/SelectionStorage.js +0 -153
- package/lib/cjs/unified-selection/SelectionStorage.js.map +0 -1
- package/lib/cjs/unified-selection/Utils.d.ts +0 -39
- package/lib/cjs/unified-selection/Utils.d.ts.map +0 -1
- package/lib/cjs/unified-selection/Utils.js +0 -82
- package/lib/cjs/unified-selection/Utils.js.map +0 -1
- package/lib/cjs/unified-selection/types/IModel.d.ts +0 -133
- package/lib/cjs/unified-selection/types/IModel.d.ts.map +0 -1
- package/lib/cjs/unified-selection/types/IModel.js +0 -24
- package/lib/cjs/unified-selection/types/IModel.js.map +0 -1
- package/lib/cjs/unified-selection.d.ts +0 -10
- package/lib/cjs/unified-selection.d.ts.map +0 -1
- package/lib/cjs/unified-selection.js +0 -27
- package/lib/cjs/unified-selection.js.map +0 -1
- package/lib/esm/unified-selection/CachingHiliteSetProvider.d.ts +0 -56
- package/lib/esm/unified-selection/CachingHiliteSetProvider.d.ts.map +0 -1
- package/lib/esm/unified-selection/CachingHiliteSetProvider.js.map +0 -1
- package/lib/esm/unified-selection/DisposePolyfill.d.ts.map +0 -1
- package/lib/esm/unified-selection/DisposePolyfill.js.map +0 -1
- package/lib/esm/unified-selection/EnableUnifiedSelectionSyncWithIModel.d.ts +0 -119
- package/lib/esm/unified-selection/EnableUnifiedSelectionSyncWithIModel.d.ts.map +0 -1
- package/lib/esm/unified-selection/EnableUnifiedSelectionSyncWithIModel.js.map +0 -1
- package/lib/esm/unified-selection/HiliteSetProvider.d.ts +0 -48
- package/lib/esm/unified-selection/HiliteSetProvider.d.ts.map +0 -1
- package/lib/esm/unified-selection/HiliteSetProvider.js.map +0 -1
- package/lib/esm/unified-selection/IModelHiliteSetProvider.d.ts.map +0 -1
- package/lib/esm/unified-selection/IModelHiliteSetProvider.js.map +0 -1
- package/lib/esm/unified-selection/Selectable.d.ts.map +0 -1
- package/lib/esm/unified-selection/Selectable.js.map +0 -1
- package/lib/esm/unified-selection/SelectionChangeEvent.d.ts +0 -60
- package/lib/esm/unified-selection/SelectionChangeEvent.d.ts.map +0 -1
- package/lib/esm/unified-selection/SelectionChangeEvent.js.map +0 -1
- package/lib/esm/unified-selection/SelectionScope.d.ts +0 -54
- package/lib/esm/unified-selection/SelectionScope.d.ts.map +0 -1
- package/lib/esm/unified-selection/SelectionScope.js.map +0 -1
- package/lib/esm/unified-selection/SelectionStorage.d.ts.map +0 -1
- package/lib/esm/unified-selection/SelectionStorage.js.map +0 -1
- package/lib/esm/unified-selection/Utils.d.ts.map +0 -1
- package/lib/esm/unified-selection/Utils.js.map +0 -1
- package/lib/esm/unified-selection/types/IModel.d.ts.map +0 -1
- package/lib/esm/unified-selection/types/IModel.js.map +0 -1
- package/lib/esm/unified-selection.d.ts +0 -10
- package/lib/esm/unified-selection.d.ts.map +0 -1
- package/lib/esm/unified-selection.js.map +0 -1
- /package/lib/{esm/unified-selection → unified-selection}/CachingHiliteSetProvider.js +0 -0
- /package/lib/{esm/unified-selection → unified-selection}/DisposePolyfill.d.ts +0 -0
- /package/lib/{esm/unified-selection → unified-selection}/DisposePolyfill.js +0 -0
- /package/lib/{esm/unified-selection → unified-selection}/IModelHiliteSetProvider.js +0 -0
- /package/lib/{esm/unified-selection → unified-selection}/Selectable.js +0 -0
- /package/lib/{esm/unified-selection → unified-selection}/SelectionChangeEvent.js +0 -0
- /package/lib/{esm/unified-selection → unified-selection}/SelectionScope.js +0 -0
- /package/lib/{esm/unified-selection → unified-selection}/SelectionStorage.js +0 -0
- /package/lib/{esm/unified-selection → unified-selection}/types/IModel.js +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
# @itwin/unified-selection
|
|
2
2
|
|
|
3
|
+
## 2.0.0-alpha.0
|
|
4
|
+
|
|
5
|
+
### Major Changes
|
|
6
|
+
|
|
7
|
+
- [#1454](https://github.com/iTwin/presentation/pull/1454): Dropped CommonJS support. These packages are now published as ES modules (ESM) only.
|
|
8
|
+
|
|
9
|
+
This is a packaging change only — the public API is unchanged — so consumers already using the ESM build are not affected. For downstream packages depending on these:
|
|
10
|
+
|
|
11
|
+
- If you list one of these packages as a `peerDependency`, widen the version range to include the new major version.
|
|
12
|
+
- If you have one of these packages as a `dependency` and re-expose it through your public API, you can safely bump to the new major version — the API is unchanged, so it will not break your API consumers.
|
|
13
|
+
|
|
14
|
+
### Patch Changes
|
|
15
|
+
|
|
16
|
+
- Updated dependencies:
|
|
17
|
+
- @itwin/presentation-shared@2.0.0-alpha.12
|
|
18
|
+
|
|
3
19
|
## 1.8.3
|
|
4
20
|
|
|
5
21
|
### Patch Changes
|
|
@@ -22,6 +38,13 @@
|
|
|
22
38
|
|
|
23
39
|
- 9f2f1f405e82bbb5bad83de67c265ea0407d6cf1: Avoid freezing main thread when loading huge amount of selectable instance keys.
|
|
24
40
|
|
|
41
|
+
## 1.8.1-alpha.0
|
|
42
|
+
|
|
43
|
+
### Patch Changes
|
|
44
|
+
|
|
45
|
+
- Updated dependencies:
|
|
46
|
+
- @itwin/presentation-shared@2.0.0-alpha.11
|
|
47
|
+
|
|
25
48
|
## 1.8.0
|
|
26
49
|
|
|
27
50
|
### Minor Changes
|
|
@@ -90,6 +113,13 @@
|
|
|
90
113
|
- Updated dependencies:
|
|
91
114
|
- @itwin/presentation-shared@1.2.12
|
|
92
115
|
|
|
116
|
+
## 1.7.1-alpha.0
|
|
117
|
+
|
|
118
|
+
### Patch Changes
|
|
119
|
+
|
|
120
|
+
- Updated dependencies:
|
|
121
|
+
- @itwin/presentation-shared@2.0.0-alpha.10
|
|
122
|
+
|
|
93
123
|
## 1.7.0
|
|
94
124
|
|
|
95
125
|
### Minor Changes
|
package/README.md
CHANGED
|
@@ -64,7 +64,7 @@ unifiedSelection.selectionChangeEvent.addListener(({ imodelKey, source, changeTy
|
|
|
64
64
|
// add that something to unified selection. For example:
|
|
65
65
|
const elementKey = { className: "BisCore.PhysicalElement", id: "0x1" };
|
|
66
66
|
unifiedSelection.addToSelection({
|
|
67
|
-
imodelKey: createIModelKey(
|
|
67
|
+
imodelKey: createIModelKey(imodelConnection),
|
|
68
68
|
source: "MyComponent",
|
|
69
69
|
selectables: [elementKey],
|
|
70
70
|
});
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import "./DisposePolyfill.js";
|
|
2
|
-
import { ECClassHierarchyInspector, ECSqlQueryExecutor } from "@itwin/presentation-shared";
|
|
3
|
-
import { createHiliteSetProvider, HiliteSet } from "./HiliteSetProvider.js";
|
|
4
|
-
import { SelectionStorage } from "./SelectionStorage.js";
|
|
2
|
+
import type { ECClassHierarchyInspector, ECSqlQueryExecutor } from "@itwin/presentation-shared";
|
|
3
|
+
import type { createHiliteSetProvider, HiliteSet } from "./HiliteSetProvider.js";
|
|
4
|
+
import type { SelectionStorage } from "./SelectionStorage.js";
|
|
5
5
|
/**
|
|
6
6
|
* Props for creating a `CachingHiliteSetProvider` instance.
|
|
7
7
|
* @public
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CachingHiliteSetProvider.d.ts","sourceRoot":"","sources":["../../src/unified-selection/CachingHiliteSetProvider.ts"],"names":[],"mappings":"AAMA,OAAO,sBAAsB,CAAC;AAI9B,OAAO,KAAK,EAAE,yBAAyB,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAChG,OAAO,KAAK,EAAE,uBAAuB,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACjF,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAE9D;;;;GAIG;AACH,MAAM,WAAW,6BAA6B;IAC5C,8DAA8D;IAC9D,gBAAgB,EAAE,gBAAgB,CAAC;IAEnC,iEAAiE;IACjE,cAAc,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,yBAAyB,GAAG,kBAAkB,CAAC;IAEtF,yHAAyH;IACzH,uBAAuB,CAAC,EAAE,OAAO,uBAAuB,CAAC;CAC1D;AAED;;;;;;;;;GASG;AACH,MAAM,WAAW,wBAAwB;IACvC,mEAAmE;IACnE,YAAY,CAAC,KAAK,EAAE;QAClB,mCAAmC;QACnC,SAAS,EAAE,MAAM,CAAC;KACnB,GAAG,qBAAqB,CAAC,SAAS,CAAC,CAAC;IAErC;;;;;OAKG;IACH,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,EAAE,MAAM,IAAI,CAAC;IAE9B;;;OAGG;IACH,OAAO,IAAI,IAAI,CAAC;CACjB;AAED;;;;;GAKG;AAEH,wBAAgB,8BAA8B,CAC5C,KAAK,EAAE,6BAA6B,GACnC,wBAAwB,GAAG;IAAE,CAAC,MAAM,CAAC,OAAO,CAAC,EAAE,MAAM,IAAI,CAAA;CAAE,CAO7D"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CachingHiliteSetProvider.js","sourceRoot":"","sources":["../../src/unified-selection/CachingHiliteSetProvider.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG,qDAAqD;AAErD,OAAO,sBAAsB,CAAC;AAE9B,OAAO,EAAE,6BAA6B,EAAE,MAAM,8BAA8B,CAAC;AAsD7E;;;;;GAKG;AACH,qBAAqB;AACrB,MAAM,UAAU,8BAA8B,CAC5C,KAAoC;IAEpC,MAAM,QAAQ,GAAG,6BAA6B,CAAC,KAAK,CAAC,CAAC;IACtD,OAAO;QACL,YAAY,EAAE,CAAC,cAAqC,EAAE,EAAE,CAAC,QAAQ,CAAC,mBAAmB,CAAC,cAAc,CAAC;QACrG,CAAC,MAAM,CAAC,OAAO,CAAC,EAAE,GAAG,EAAE,CAAC,QAAQ,CAAC,MAAM,CAAC,OAAO,CAAC,EAAE;QAClD,OAAO,EAAE,GAAG,EAAE,CAAC,QAAQ,CAAC,MAAM,CAAC,OAAO,CAAC,EAAE;KAC1C,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/* eslint-disable @typescript-eslint/no-deprecated */\n\nimport \"./DisposePolyfill.js\";\n\nimport { createIModelHiliteSetProvider } from \"./IModelHiliteSetProvider.js\";\n\nimport type { ECClassHierarchyInspector, ECSqlQueryExecutor } from \"@itwin/presentation-shared\";\nimport type { createHiliteSetProvider, HiliteSet } from \"./HiliteSetProvider.js\";\nimport type { SelectionStorage } from \"./SelectionStorage.js\";\n\n/**\n * Props for creating a `CachingHiliteSetProvider` instance.\n * @public\n * @deprecated in 1.5. Use `IModelHiliteSetProviderProps` instead.\n */\nexport interface CachingHiliteSetProviderProps {\n /** Selection storage to use for retrieving the hilite set. */\n selectionStorage: SelectionStorage;\n\n /** A callback that should return iModel access by iModel key. */\n imodelProvider: (imodelKey: string) => ECClassHierarchyInspector & ECSqlQueryExecutor;\n\n /** An optional hilite set provider factory. If not provided, defaults to `createHiliteSetProvider` from this package. */\n createHiliteSetProvider?: typeof createHiliteSetProvider;\n}\n\n/**\n * Defines return value of `createCachingHiliteSetProvider`.\n *\n * **Warning:** Used in public API as a return value. Not expected to be created / extended by package\n * consumers, may be supplemented with required attributes any time.\n *\n * @see `createCachingHiliteSetProvider`\n * @public\n * @deprecated in 1.5. Use `IModelHiliteSetProvider` instead.\n */\nexport interface CachingHiliteSetProvider {\n /** Get the current hilite set iterator for the specified imodel */\n getHiliteSet(props: {\n /** iModel to get hilite set for */\n imodelKey: string;\n }): AsyncIterableIterator<HiliteSet>;\n\n /**\n * Disposes the cache.\n *\n * Optional to avoid breaking the API. Will be made required when the deprecated\n * `dispose` is removed.\n */\n [Symbol.dispose]?: () => void;\n\n /**\n * Disposes the cache.\n * @deprecated in 1.2. Use `[Symbol.dispose]` instead.\n */\n dispose(): void;\n}\n\n/**\n * Creates a hilite set provider that caches hilite set for current selection for given iModel so any subsequent\n * hilite set requests for the same iModel don't cost until selection in given selection storage changes.\n * @public\n * @deprecated in 1.5. Use `createIModelHiliteSetProvider` instead.\n */\n/* v8 ignore start */\nexport function createCachingHiliteSetProvider(\n props: CachingHiliteSetProviderProps,\n): CachingHiliteSetProvider & { [Symbol.dispose]: () => void } {\n const provider = createIModelHiliteSetProvider(props);\n return {\n getHiliteSet: (hiliteSetProps: { imodelKey: string }) => provider.getCurrentHiliteSet(hiliteSetProps),\n [Symbol.dispose]: () => provider[Symbol.dispose](),\n dispose: () => provider[Symbol.dispose](),\n };\n}\n/* v8 ignore stop */\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DisposePolyfill.d.ts","sourceRoot":"","sources":["../../src/unified-selection/DisposePolyfill.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DisposePolyfill.js","sourceRoot":"","sources":["../../src/unified-selection/DisposePolyfill.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAEhG;;GAEG;AACF,MAAc,CAAC,OAAO,KAAK,MAAM,CAAC,gBAAgB,CAAC,CAAC;AACpD,MAAc,CAAC,YAAY,KAAK,MAAM,CAAC,qBAAqB,CAAC,CAAC","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\n/**\n * Polyfill for upcoming resource management feature: https://github.com/tc39/proposal-explicit-resource-management\n */\n(Symbol as any).dispose ??= Symbol(\"Symbol.dispose\");\n(Symbol as any).asyncDispose ??= Symbol(\"Symbol.asyncDispose\");\n"]}
|
package/lib/{cjs/unified-selection → unified-selection}/EnableUnifiedSelectionSyncWithIModel.d.ts
RENAMED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import "./DisposePolyfill.js";
|
|
2
|
-
import { ECClassHierarchyInspector, ECSqlQueryExecutor } from "@itwin/presentation-shared";
|
|
3
|
-
import { CachingHiliteSetProvider } from "./CachingHiliteSetProvider.js";
|
|
4
|
-
import { HiliteSetProvider } from "./HiliteSetProvider.js";
|
|
5
|
-
import { IModelHiliteSetProvider } from "./IModelHiliteSetProvider.js";
|
|
6
|
-
import { SelectionScope } from "./SelectionScope.js";
|
|
7
|
-
import { SelectionStorage } from "./SelectionStorage.js";
|
|
8
|
-
import { CoreIModelHiliteSet, CoreIModelSelectionSet } from "./types/IModel.js";
|
|
2
|
+
import type { ECClassHierarchyInspector, ECSqlQueryExecutor } from "@itwin/presentation-shared";
|
|
3
|
+
import type { CachingHiliteSetProvider } from "./CachingHiliteSetProvider.js";
|
|
4
|
+
import type { HiliteSetProvider } from "./HiliteSetProvider.js";
|
|
5
|
+
import type { IModelHiliteSetProvider } from "./IModelHiliteSetProvider.js";
|
|
6
|
+
import type { SelectionScope } from "./SelectionScope.js";
|
|
7
|
+
import type { SelectionStorage } from "./SelectionStorage.js";
|
|
8
|
+
import type { CoreIModelHiliteSet, CoreIModelSelectionSet } from "./types/IModel.js";
|
|
9
9
|
/**
|
|
10
10
|
* Props for `enableUnifiedSelectionSyncWithIModel`.
|
|
11
11
|
* @public
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EnableUnifiedSelectionSyncWithIModel.d.ts","sourceRoot":"","sources":["../../src/unified-selection/EnableUnifiedSelectionSyncWithIModel.ts"],"names":[],"mappings":"AAKA,OAAO,sBAAsB,CAAC;AAY9B,OAAO,KAAK,EAAE,yBAAyB,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAChG,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAC;AAC9E,OAAO,KAAK,EAAa,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAC3E,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CAAC;AAG5E,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAC1D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAC9D,OAAO,KAAK,EACV,mBAAmB,EACnB,sBAAsB,EAGvB,MAAM,mBAAmB,CAAC;AAE3B;;;GAGG;AACH,MAAM,WAAW,yCAAyC;IACxD;;;;;;;;;;;;;;;;;;;;;OAqBG;IACH,YAAY,EAAE,kBAAkB,GAC9B,yBAAyB,GAAG;QAC1B,sEAAsE;QACtE,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;QACrB,mFAAmF;QACnF,QAAQ,CAAC,SAAS,EAAE,mBAAmB,CAAC;QACxC,yFAAyF;QACzF,QAAQ,CAAC,YAAY,EAAE,sBAAsB,CAAC;KAC/C,CAAC;IAEJ;;;OAGG;IACH,gBAAgB,EAAE,gBAAgB,CAAC;IAEnC,uCAAuC;IACvC,mBAAmB,EAAE,MAAM,cAAc,CAAC;IAE1C;;;;;;;OAOG;IACH,uBAAuB,CAAC,EAAE,uBAAuB,CAAC;IAElD;;;;;;;;;;;;;;OAcG;IACH,wBAAwB,CAAC,EAErB,wBAAwB,GAExB,CAAC,IAAI,CAAC,wBAAwB,EAAE,SAAS,CAAC,GAAG;QAAE,CAAC,MAAM,CAAC,OAAO,CAAC,EAAE,MAAM,IAAI,CAAA;KAAE,CAAC,CAAC;CACpF;AAED;;;;GAIG;AACH,wBAAgB,oCAAoC,CAAC,KAAK,EAAE,yCAAyC,GAAG,MAAM,IAAI,CAGjH;AAED;;;;;GAKG;AACH,qBAAa,sBAAsB;;IACjC,OAAO,CAAC,oBAAoB,CAAU;IAEtC,OAAO,CAAC,aAAa,CAA4D;IACjF,OAAO,CAAC,iBAAiB,CAAmB;IAC5C,OAAO,CAAC,wBAAwB,CAAoF;IACpH,OAAO,CAAC,oBAAoB,CAAuB;IAEnD,OAAO,CAAC,YAAY,CAAU;IAC9B,OAAO,CAAC,8BAA8B,CAAK;IAC3C,OAAO,CAAC,qBAAqB,CAAuB;IACpD,OAAO,CAAC,mCAAmC,CAAa;IACxD,OAAO,CAAC,qCAAqC,CAAa;IAC1D,OAAO,CAAC,iCAAiC,CAAa;IAItD,YAAmB,KAAK,EAAE,yCAAyC,GAAG;QAAE,iBAAiB,CAAC,EAAE,iBAAiB,CAAA;KAAE,EAkD9G;IAEM,CAAC,MAAM,CAAC,OAAO,CAAC,SAKtB;IAED,4GAA4G;IACrG,8BAA8B;;MAQpC;IAED,OAAO,CAAC,aAAa;IAmDrB,OAAO,CAAC,yBAAyB,CAa/B;IAEF,OAAO,CAAC,qBAAqB;IAwB7B,OAAO,CAAC,YAAY;IA2BpB,OAAO,CAAC,eAAe;IA0BvB,OAAO,CAAC,wBAAwB,CAwD9B;CACH"}
|
package/lib/{esm/unified-selection → unified-selection}/EnableUnifiedSelectionSyncWithIModel.js
RENAMED
|
@@ -61,7 +61,7 @@ import { createHiliteSetProvider } from "./HiliteSetProvider.js";
|
|
|
61
61
|
import { createIModelHiliteSetProvider } from "./IModelHiliteSetProvider.js";
|
|
62
62
|
import { Selectables } from "./Selectable.js";
|
|
63
63
|
import { computeSelection } from "./SelectionScope.js";
|
|
64
|
-
import { CoreSelectionSetEventType
|
|
64
|
+
import { CoreSelectionSetEventType } from "./types/IModel.js";
|
|
65
65
|
import { safeDispose } from "./Utils.js";
|
|
66
66
|
/**
|
|
67
67
|
* Enables synchronization between iModel selection and unified selection.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EnableUnifiedSelectionSyncWithIModel.js","sourceRoot":"","sources":["../../src/unified-selection/EnableUnifiedSelectionSyncWithIModel.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEhG,OAAO,sBAAsB,CAAC;AAE9B,OAAO,EAAE,KAAK,EAAE,cAAc,EAAE,IAAI,EAAE,GAAG,EAAE,KAAK,EAAE,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAC5F,OAAO,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAC;AAC3C,OAAO,EAAE,uBAAuB,EAAE,MAAM,wBAAwB,CAAC;AACjE,OAAO,EAAE,6BAA6B,EAAE,MAAM,8BAA8B,CAAC;AAC7E,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAC9C,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,EAAE,yBAAyB,EAAE,MAAM,mBAAmB,CAAC;AAC9D,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAgGzC;;;;GAIG;AACH,MAAM,UAAU,oCAAoC,CAAC,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,MAAM,OAAO,sBAAsB;IACzB,oBAAoB,GAAG,MAAM,CAAC;IAE9B,aAAa,CAA4D;IACzE,iBAAiB,CAAmB;IACpC,wBAAwB,CAAoF;IAC5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G,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 } from \"@itwin/core-bentley\";\nimport { createHiliteSetProvider } from \"./HiliteSetProvider.js\";\nimport { createIModelHiliteSetProvider } from \"./IModelHiliteSetProvider.js\";\nimport { Selectables } from \"./Selectable.js\";\nimport { computeSelection } from \"./SelectionScope.js\";\nimport { CoreSelectionSetEventType } from \"./types/IModel.js\";\nimport { safeDispose } from \"./Utils.js\";\n\nimport type { GuidString, Id64Arg, Id64Set } from \"@itwin/core-bentley\";\nimport type { ECClassHierarchyInspector, ECSqlQueryExecutor } from \"@itwin/presentation-shared\";\nimport type { CachingHiliteSetProvider } from \"./CachingHiliteSetProvider.js\";\nimport type { HiliteSet, HiliteSetProvider } from \"./HiliteSetProvider.js\";\nimport type { IModelHiliteSetProvider } from \"./IModelHiliteSetProvider.js\";\nimport type { SelectableInstanceKey } from \"./Selectable.js\";\nimport type { StorageSelectionChangeEventArgs, StorageSelectionChangeType } from \"./SelectionChangeEvent.js\";\nimport type { SelectionScope } from \"./SelectionScope.js\";\nimport type { SelectionStorage } from \"./SelectionStorage.js\";\nimport type {\n CoreIModelHiliteSet,\n CoreIModelSelectionSet,\n CoreSelectableIds,\n CoreSelectionSetEventUnsafe,\n} from \"./types/IModel.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,6 +1,6 @@
|
|
|
1
|
-
import { Id64String } from "@itwin/core-bentley";
|
|
2
|
-
import { ECClassHierarchyInspector, ECSqlQueryExecutor } from "@itwin/presentation-shared";
|
|
3
|
-
import { Selectables } from "./Selectable.js";
|
|
1
|
+
import type { Id64String } from "@itwin/core-bentley";
|
|
2
|
+
import type { ECClassHierarchyInspector, ECSqlQueryExecutor } from "@itwin/presentation-shared";
|
|
3
|
+
import type { Selectables } from "./Selectable.js";
|
|
4
4
|
/**
|
|
5
5
|
* A set of model, subcategory and element ids that can be used for specifying hilite.
|
|
6
6
|
*
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"HiliteSetProvider.d.ts","sourceRoot":"","sources":["../../src/unified-selection/HiliteSetProvider.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAc,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAClE,OAAO,KAAK,EAEV,yBAAyB,EAGzB,kBAAkB,EAGnB,MAAM,4BAA4B,CAAC;AACpC,OAAO,KAAK,EAAyB,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAI1E;;;;;;;;;;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"}
|
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
3
3
|
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
4
4
|
*--------------------------------------------------------------------------------------------*/
|
|
5
|
-
import { EMPTY, filter, forkJoin, from, map, merge, mergeMap, scan, shareReplay, Subject, toArray
|
|
5
|
+
import { EMPTY, filter, forkJoin, from, map, merge, mergeMap, scan, shareReplay, Subject, toArray } from "rxjs";
|
|
6
6
|
import { eachValueFrom } from "rxjs-for-await";
|
|
7
7
|
import { Guid } from "@itwin/core-bentley";
|
|
8
|
-
import { normalizeFullClassName
|
|
8
|
+
import { normalizeFullClassName } from "@itwin/presentation-shared";
|
|
9
9
|
import { TRANSIENT_ELEMENT_CLASSNAME } from "./Selectable.js";
|
|
10
10
|
import { formIdBindings, genericExecuteQuery, releaseMainThreadOnItemsCount } from "./Utils.js";
|
|
11
11
|
const HILITE_SET_EMIT_FREQUENCY = 20;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"HiliteSetProvider.js","sourceRoot":"","sources":["../../src/unified-selection/HiliteSetProvider.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAEhG,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,GAAG,EAAE,KAAK,EAAE,QAAQ,EAAE,IAAI,EAAE,WAAW,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAChH,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAC/C,OAAO,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAC;AAC3C,OAAO,EAAE,sBAAsB,EAAE,MAAM,4BAA4B,CAAC;AACpE,OAAO,EAAE,2BAA2B,EAAE,MAAM,iBAAiB,CAAC;AAC9D,OAAO,EAAE,cAAc,EAAE,mBAAmB,EAAE,6BAA6B,EAAE,MAAM,YAAY,CAAC;AAehG,MAAM,yBAAyB,GAAG,EAAE,CAAC;AA0CrC;;;GAGG;AACH,MAAM,UAAU,uBAAuB,CAAC,KAA6B;IACnE,OAAO,IAAI,qB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Y,EAAE,CAAC,CAAC;AACpG,CAAC","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 { EMPTY, filter, forkJoin, from, map, merge, mergeMap, scan, shareReplay, Subject, toArray } from \"rxjs\";\nimport { eachValueFrom } from \"rxjs-for-await\";\nimport { Guid } from \"@itwin/core-bentley\";\nimport { normalizeFullClassName } from \"@itwin/presentation-shared\";\nimport { TRANSIENT_ELEMENT_CLASSNAME } from \"./Selectable.js\";\nimport { formIdBindings, genericExecuteQuery, releaseMainThreadOnItemsCount } from \"./Utils.js\";\n\nimport type { Observable } from \"rxjs\";\nimport type { GuidString, Id64String } from \"@itwin/core-bentley\";\nimport type {\n EC,\n ECClassHierarchyInspector,\n ECSqlBinding,\n ECSqlQueryDef,\n ECSqlQueryExecutor,\n ECSqlQueryReaderOptions,\n ECSqlQueryRow,\n} from \"@itwin/presentation-shared\";\nimport type { SelectableInstanceKey, Selectables } from \"./Selectable.js\";\n\nconst HILITE_SET_EMIT_FREQUENCY = 20;\n\n/**\n * A set of model, subcategory and element ids that can be used for specifying hilite.\n *\n * **Warning:** Used in public API as a return value. Not expected to be created / extended by package\n * consumers, may be supplemented with required attributes any time.\n *\n * @see https://www.itwinjs.org/reference/core-frontend/selectionset/hiliteset/\n * @see `HiliteSetProvider`\n * @see `createHiliteSetProvider`\n * @public\n */\nexport interface HiliteSet {\n models: Id64String[];\n subCategories: Id64String[];\n elements: Id64String[];\n}\n\n/**\n * Props for creating a `HiliteSetProvider` instance.\n * @public\n */\nexport interface HiliteSetProviderProps {\n /** An object that provides access to iModel's metadata and allows running ECSQL queries on it. */\n imodelAccess: ECClassHierarchyInspector & ECSqlQueryExecutor;\n}\n\n/**\n * Defines return value of `createHiliteSetProvider`.\n *\n * **Warning:** Used in public API as a return value. Not expected to be created / extended by package\n * consumers, may be supplemented with required attributes any time.\n *\n * @see `createHiliteSetProvider`\n * @public\n */\nexport interface HiliteSetProvider {\n /** Get the current hilite set iterator for the specified imodel */\n getHiliteSet(props: { selectables: Selectables }): AsyncIterableIterator<HiliteSet>;\n}\n\n/**\n * Creates a hilite set provider that returns a `HiliteSet` for given selectables.\n * @public\n */\nexport function createHiliteSetProvider(props: HiliteSetProviderProps): HiliteSetProvider {\n return new HiliteSetProviderImpl(props);\n}\n\nclass HiliteSetProviderImpl implements HiliteSetProvider {\n private _imodelAccess: ECClassHierarchyInspector & ECSqlQueryExecutor;\n // Map between a class name and its type\n private _classRelationCache: Map<string, InstanceIdType | Promise<InstanceIdType>>;\n #componentId: GuidString;\n #componentName: string;\n\n constructor(props: HiliteSetProviderProps) {\n this._imodelAccess = props.imodelAccess;\n this._classRelationCache = new Map();\n this.#componentId = Guid.createValue();\n this.#componentName = \"HiliteSetProvider\";\n }\n\n /**\n * Get hilite set iterator for supplied `Selectables`.\n */\n public getHiliteSet(props: { selectables: Selectables }): AsyncIterableIterator<HiliteSet> {\n const obs = this.getHiliteSetObservable(props);\n return eachValueFrom(obs);\n }\n\n /**\n * Returns a \"hot\" observable of hilite sets.\n */\n private getHiliteSetObservable({ selectables }: { selectables: Selectables }): Subject<HiliteSet> {\n const instancesByType = this.getInstancesByType(selectables);\n const observables: { [key in keyof HiliteSet]?: Observable<string> } = {\n models: this.getHilitedModels(instancesByType),\n subCategories: this.getHilitedSubCategories(instancesByType),\n elements: this.getHilitedElements(instancesByType),\n };\n\n let hiliteSet: HiliteSet = { models: [], subCategories: [], elements: [] };\n let lastEmitTime = performance.now();\n const subject = new Subject<HiliteSet>();\n const subscriptions = ([\"models\", \"subCategories\", \"elements\"] as const).map((key) =>\n observables[key]!.subscribe({\n next(val) {\n hiliteSet[key].push(val);\n if (performance.now() - lastEmitTime < HILITE_SET_EMIT_FREQUENCY) {\n return;\n }\n subject.next(hiliteSet);\n hiliteSet = { models: [], subCategories: [], elements: [] };\n lastEmitTime = performance.now();\n },\n complete() {\n observables[key] = undefined;\n if (observables.models || observables.subCategories || observables.elements) {\n return;\n }\n // Emit last batch before completing the observable.\n if (hiliteSet.elements.length || hiliteSet.models.length || hiliteSet.subCategories.length) {\n subject.next(hiliteSet);\n }\n subject.complete();\n },\n error(err) {\n subscriptions.forEach((x) => x.unsubscribe());\n subscriptions.length = 0;\n subject.error(err);\n },\n }),\n );\n\n return subject;\n }\n\n private async getType(key: SelectableInstanceKey): Promise<InstanceIdType> {\n if (key.className === TRANSIENT_ELEMENT_CLASSNAME) {\n return \"transient\";\n }\n\n const normalizedClassName = normalizeFullClassName(key.className);\n const cachedType = this._classRelationCache.get(normalizedClassName);\n if (cachedType) {\n return cachedType;\n }\n\n const promise = this.getTypeImpl(normalizedClassName).then((res) => {\n // Update the cache with the result of the promise.\n this._classRelationCache.set(normalizedClassName, res);\n return res;\n });\n\n // Add the promise to cache to prevent `getTypeImpl` being called multiple times.\n this._classRelationCache.set(normalizedClassName, promise);\n return promise;\n }\n\n private async getTypeImpl(fullClassName: EC.FullClassNameDotNotation): Promise<InstanceIdType> {\n return (\n (await this.checkType(fullClassName, \"BisCore.Subject\", \"subject\")) ??\n (await this.checkType(fullClassName, \"BisCore.Model\", \"model\")) ??\n (await this.checkType(fullClassName, \"BisCore.Category\", \"category\")) ??\n (await this.checkType(fullClassName, \"BisCore.SubCategory\", \"subCategory\")) ??\n (await this.checkType(fullClassName, \"Functional.FunctionalElement\", \"functionalElement\")) ??\n (await this.checkType(fullClassName, \"BisCore.GroupInformationElement\", \"groupInformationElement\")) ??\n (await this.checkType(fullClassName, \"BisCore.GeometricElement\", \"geometricElement\")) ??\n (await this.checkType(fullClassName, \"BisCore.Element\", \"element\")) ??\n \"unknown\"\n );\n }\n\n private async checkType(\n keyClassName: EC.FullClassNameDotNotation,\n checkClassName: EC.FullClassNameDotNotation,\n type: InstanceIdType,\n ) {\n try {\n const res = this._imodelAccess.classDerivesFrom(keyClassName, checkClassName);\n const isOfType = typeof res === \"boolean\" ? res : await res;\n return isOfType ? type : undefined;\n } catch (e) {\n // we may be checking against a non-existing schema (e.g. Functional), in which case we should\n // return undefined instead of throwing an error\n if (e instanceof Error && e.message.match(/Schema \"[\\w\\d_]+\" not found/)) {\n return undefined;\n }\n throw e;\n }\n }\n\n private getInstancesByType(selectables: Selectables): InstancesByType {\n const keyTypeObs = merge(\n from(selectables.custom.values()).pipe(mergeMap((selectable) => selectable.loadInstanceKeys())),\n from(selectables.instanceKeys).pipe(\n mergeMap(([className, idSet]) => from(idSet).pipe(map((id) => ({ className, id })))),\n ),\n ).pipe(\n releaseMainThreadOnItemsCount(500),\n // Get types for each instance key\n mergeMap((instanceKey) =>\n from(this.getType(instanceKey)).pipe(map((instanceIdType) => ({ instanceId: instanceKey.id, instanceIdType }))),\n ),\n // Cache the results\n shareReplay(),\n );\n\n return Object.fromEntries(\n INSTANCE_TYPES.map((type) => [\n type,\n keyTypeObs.pipe(\n filter(({ instanceIdType }) => instanceIdType === type),\n map(({ instanceId }) => instanceId),\n unique(),\n ),\n ]),\n ) as InstancesByType;\n }\n\n private getHilitedModels(instancesByType: InstancesByType): Observable<string> {\n return forkJoin({\n modelKeys: instancesByType.model.pipe(toArray()),\n subjectKeys: instancesByType.subject.pipe(toArray()),\n }).pipe(\n mergeMap(({ modelKeys, subjectKeys }) => {\n if (!modelKeys.length && !subjectKeys.length) {\n return EMPTY;\n }\n\n const bindings: ECSqlBinding[] = [];\n const ctes = [\n `\n ChildSubjects(ECInstanceId, JsonProperties) AS (\n SELECT ECInstanceId, JsonProperties\n FROM BisCore.Subject\n WHERE ${formIdBindings(\"ECInstanceId\", subjectKeys, bindings)}\n UNION ALL\n SELECT r.ECInstanceId, r.JsonProperties\n FROM ChildSubjects s\n JOIN BisCore.Subject r ON r.Parent.Id = s.ECInstanceId\n )\n `,\n `\n Models(ECInstanceId) AS (\n SELECT s.ECInstanceId AS ECInstanceId\n FROM BisCore.Model s\n WHERE ${formIdBindings(\"ECInstanceId\", modelKeys, bindings)}\n )\n `,\n ];\n const ecsql = [\n `\n SELECT r.ECInstanceId AS ECInstanceId\n FROM ChildSubjects s\n JOIN BisCore.PhysicalPartition r ON r.Parent.Id = s.ECInstanceId OR json_extract(s.JsonProperties,'$.Subject.Model.TargetPartition') = printf('0x%x', r.ECInstanceId)\n `,\n `\n SELECT ECInstanceId FROM Models\n `,\n ].join(\" UNION \");\n return from(\n executeQuery({\n queryExecutor: this._imodelAccess,\n query: { ctes, ecsql, bindings },\n config: { restartToken: `${this.#componentName}/${this.#componentId}/models/${Guid.createValue()}` },\n }),\n );\n }),\n );\n }\n\n private getHilitedSubCategories(instancesByType: InstancesByType): Observable<string> {\n return forkJoin({\n subCategoryKeys: instancesByType.subCategory.pipe(toArray()),\n categoryKeys: instancesByType.category.pipe(toArray()),\n }).pipe(\n mergeMap(({ subCategoryKeys, categoryKeys }) => {\n if (!subCategoryKeys.length && !categoryKeys.length) {\n return EMPTY;\n }\n\n const bindings: ECSqlBinding[] = [];\n const ctes = [\n `\n CategorySubCategories(ECInstanceId) AS (\n SELECT r.ECInstanceId AS ECInstanceId\n FROM BisCore.Category s\n JOIN BisCore.SubCategory r ON r.Parent.Id = s.ECInstanceId\n WHERE ${formIdBindings(\"s.ECInstanceId\", categoryKeys, bindings)}\n )\n `,\n `\n SubCategories(ECInstanceId) AS (\n SELECT s.ECInstanceId AS ECInstanceId\n FROM BisCore.SubCategory s\n WHERE ${formIdBindings(\"s.ECInstanceId\", subCategoryKeys, bindings)}\n )\n `,\n ];\n const ecsql = [`SELECT ECInstanceId FROM CategorySubCategories`, `SELECT ECInstanceId FROM SubCategories`].join(\n \" UNION \",\n );\n return from(\n executeQuery({\n queryExecutor: this._imodelAccess,\n query: { ctes, ecsql, bindings },\n config: {\n restartToken: `${this.#componentName}/${this.#componentId}/sub-categories/${Guid.createValue()}`,\n },\n }),\n );\n }),\n );\n }\n\n private getHilitedElements(instancesByType: InstancesByType): Observable<string> {\n return forkJoin({\n groupInformationElementIds: instancesByType.groupInformationElement.pipe(toArray()),\n geometricElementIds: instancesByType.geometricElement.pipe(toArray()),\n functionalElementIds: instancesByType.functionalElement.pipe(toArray()),\n elementIds: instancesByType.element.pipe(toArray()),\n transientIds: instancesByType.transient.pipe(toArray()),\n }).pipe(\n mergeMap(\n ({ groupInformationElementIds, geometricElementIds, functionalElementIds, elementIds, transientIds }) => {\n const hasFunctionalElementIds = !!functionalElementIds.length;\n const hasPersistentElementIds =\n hasFunctionalElementIds ||\n !!(groupInformationElementIds.length || geometricElementIds.length || elementIds.length);\n const hasTransientElementIds = !!transientIds.length;\n if (!hasPersistentElementIds && !hasTransientElementIds) {\n return EMPTY;\n }\n if (!hasPersistentElementIds) {\n return from(transientIds);\n }\n\n const bindings: ECSqlBinding[] = [];\n const ctes = [\n ...(hasFunctionalElementIds\n ? this.getHilitedFunctionalElementsQueryCTEs(functionalElementIds, bindings)\n : []),\n `\n GroupMembers(ECInstanceId, ECClassId) AS (\n SELECT TargetECInstanceId, TargetECClassId\n FROM BisCore.ElementGroupsMembers\n WHERE ${formIdBindings(\"SourceECInstanceId\", groupInformationElementIds, bindings)}\n )\n `,\n `\n GroupGeometricElements(ECInstanceId, ECClassId) AS (\n SELECT ECInstanceId, ECClassId FROM GroupMembers\n UNION ALL\n SELECT r.ECInstanceId, r.ECClassId\n FROM GroupGeometricElements s\n JOIN BisCore.Element r ON r.Parent.Id = s.ECInstanceId\n )\n `,\n `\n ElementGeometricElements(ECInstanceId, ECClassId) AS (\n SELECT ECInstanceId, ECClassId\n FROM BisCore.Element\n WHERE ${formIdBindings(\"ECInstanceId\", elementIds, bindings)}\n UNION ALL\n SELECT r.ECInstanceId, r.ECClassId\n FROM ElementGeometricElements s\n JOIN BisCore.Element r ON r.Parent.Id = s.ECInstanceId\n )\n `,\n `\n GeometricElementGeometricElements(ECInstanceId, ECClassId) AS (\n SELECT ECInstanceId, ECClassId\n FROM BisCore.GeometricElement\n WHERE ${formIdBindings(\"ECInstanceId\", geometricElementIds, bindings)}\n UNION ALL\n SELECT r.ECInstanceId, r.ECClassId\n FROM GeometricElementGeometricElements s\n JOIN BisCore.Element r ON r.Parent.Id = s.ECInstanceId\n )\n `,\n ];\n const ecsql = [\n ...(hasFunctionalElementIds\n ? [\n \"SELECT ECInstanceId FROM FunctionalElementChildGeometricElements WHERE ECClassId IS (BisCore.GeometricElement)\",\n ]\n : []),\n \"SELECT ECInstanceId FROM GeometricElementGeometricElements WHERE ECClassId IS (BisCore.GeometricElement)\",\n \"SELECT ECInstanceId FROM GroupGeometricElements WHERE ECClassId IS (BisCore.GeometricElement)\",\n \"SELECT ECInstanceId FROM ElementGeometricElements WHERE ECClassId IS (BisCore.GeometricElement)\",\n ].join(\" UNION \");\n return merge(\n from(\n executeQuery({\n queryExecutor: this._imodelAccess,\n query: { ctes, ecsql, bindings },\n config: { restartToken: `${this.#componentName}/${this.#componentId}/elements/${Guid.createValue()}` },\n }),\n ),\n from(transientIds),\n );\n },\n ),\n );\n }\n\n private getHilitedFunctionalElementsQueryCTEs(functionalElements: string[], bindings: ECSqlBinding[]): string[] {\n return [\n `\n ChildFunctionalElements(ECInstanceId, ECClassId) AS (\n SELECT ECInstanceId, ECClassId\n FROM Functional.FunctionalElement\n WHERE ${formIdBindings(\"ECInstanceId\", functionalElements, bindings)}\n UNION ALL\n SELECT r.ECInstanceId, r.ECClassId\n FROM ChildFunctionalElements s\n JOIN Functional.FunctionalElement r ON r.Parent.Id = s.ECInstanceId\n )\n `,\n `\n PhysicalElements(ECInstanceId, ECClassId) AS (\n SELECT r.SourceECInstanceId, r.SourceECClassId\n FROM ChildFunctionalElements s\n JOIN Functional.PhysicalElementFulfillsFunction r ON r.TargetECInstanceId = s.ECInstanceId\n )\n `,\n `\n DrawingGraphicElements(ECInstanceId, ECClassId) AS (\n SELECT r.SourceECInstanceId, r.SourceECClassId\n FROM ChildFunctionalElements s\n JOIN Functional.DrawingGraphicRepresentsFunctionalElement r ON r.TargetECInstanceId = s.ECInstanceId\n )\n `,\n `\n PhysicalElementGeometricElements(ECInstanceId, ECClassId) AS (\n SELECT ECInstanceId, ECClassId FROM PhysicalElements\n UNION ALL\n SELECT r.ECInstanceId, r.ECClassId\n FROM PhysicalElementGeometricElements s\n JOIN BisCore.Element r ON r.Parent.Id = s.ECInstanceId\n )\n `,\n `\n DrawingGraphicElementGeometricElements(ECInstanceId, ECClassId) AS (\n SELECT ECInstanceId, ECClassId FROM DrawingGraphicElements\n UNION ALL\n SELECT r.ECInstanceId, r.ECClassId\n FROM DrawingGraphicElementGeometricElements s\n JOIN BisCore.Element r ON r.Parent.Id = s.ECInstanceId\n )\n `,\n `\n FunctionalElementChildGeometricElements(ECInstanceId, ECClassId) AS (\n SELECT ECInstanceId, ECClassId FROM PhysicalElementGeometricElements\n UNION\n SELECT ECInstanceId, ECClassId FROM DrawingGraphicElementGeometricElements\n )\n `,\n ];\n }\n}\n\nconst INSTANCE_TYPES = [\n \"subject\",\n \"model\",\n \"category\",\n \"subCategory\",\n \"functionalElement\",\n \"groupInformationElement\",\n \"geometricElement\",\n \"element\",\n \"transient\",\n \"unknown\",\n] as const;\n\ntype InstanceIdType = (typeof INSTANCE_TYPES)[number];\n\ntype InstancesByType = {\n [idType in InstanceIdType]: Observable<string>;\n};\n\nfunction unique<T>() {\n return function (obs: Observable<T>): Observable<T> {\n return obs.pipe(\n scan(\n (acc, val) => {\n if (acc.set.has(val)) {\n delete acc.val;\n return acc;\n }\n\n acc.set.add(val);\n acc.val = val;\n return acc;\n },\n { set: new Set<T>() } as { set: Set<T>; val?: T },\n ),\n map(({ val }) => val),\n filter((x): x is T => !!x),\n );\n };\n}\n\nasync function* executeQuery(props: {\n queryExecutor: ECSqlQueryExecutor;\n query: ECSqlQueryDef;\n config?: ECSqlQueryReaderOptions;\n}): AsyncIterableIterator<string> {\n yield* genericExecuteQuery({ ...props, parseQueryRow: (row: ECSqlQueryRow) => row.ECInstanceId });\n}\n"]}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import "./DisposePolyfill.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
2
|
+
import { createHiliteSetProvider } from "./HiliteSetProvider.js";
|
|
3
|
+
import type { ECClassHierarchyInspector, ECSqlQueryExecutor } from "@itwin/presentation-shared";
|
|
4
|
+
import type { HiliteSet, HiliteSetProvider } from "./HiliteSetProvider.js";
|
|
5
|
+
import type { SelectionStorage } from "./SelectionStorage.js";
|
|
5
6
|
/**
|
|
6
7
|
* Props for creating an `IModelHiliteSetProvider` instance.
|
|
7
8
|
* @public
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IModelHiliteSetProvider.d.ts","sourceRoot":"","sources":["../../src/unified-selection/IModelHiliteSetProvider.ts"],"names":[],"mappings":"AAKA,OAAO,sBAAsB,CAAC;AAI9B,OAAO,EAAE,uBAAuB,EAAE,MAAM,wBAAwB,CAAC;AAIjE,OAAO,KAAK,EAAE,yBAAyB,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAChG,OAAO,KAAK,EAAE,SAAS,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAE3E,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAE9D;;;GAGG;AACH,MAAM,WAAW,4BAA4B;IAC3C,8DAA8D;IAC9D,gBAAgB,EAAE,gBAAgB,CAAC;IAEnC,iEAAiE;IACjE,cAAc,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,yBAAyB,GAAG,kBAAkB,CAAC;IAEtF,yHAAyH;IACzH,uBAAuB,CAAC,EAAE,OAAO,uBAAuB,CAAC;CAC1D;AAED;;;;;;;;GAQG;AACH,MAAM,WAAW,uBAAuB;IACtC,4DAA4D;IAC5D,oBAAoB,CAAC,KAAK,EAAE;QAC1B,4CAA4C;QAC5C,SAAS,EAAE,MAAM,CAAC;KACnB,GAAG,iBAAiB,CAAC;IAEtB,gFAAgF;IAChF,mBAAmB,CAAC,KAAK,EAAE;QACzB,mCAAmC;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CAAC,SAAS,EAAE,SAAS,CAAC,CAAC;QACxC,CAAC;QACD,OAAO,aAAa,CAAC,SAAS,CAAC,CAAC;IAClC,CAAC;IAEM,CAAC,MAAM,CAAC,OAAO,CAAC;QACrB,IAAI,CAAC,eAAe,EAAE,CAAC;QACvB,IAAI,CAAC,mBAAmB,GAAG,IAAI,GAAG,EAAE,CAAC;QACrC,IAAI,CAAC,MAAM,GAAG,IAAI,GAAG,EAAE,CAAC;IAC1B,CAAC;CACF","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 { from, shareReplay } from \"rxjs\";\nimport { eachValueFrom } from \"rxjs-for-await\";\nimport { createHiliteSetProvider } from \"./HiliteSetProvider.js\";\nimport { CLEAR_SELECTION_STORAGE_SOURCE } from \"./SelectionStorage.js\";\n\nimport type { Observable } from \"rxjs\";\nimport type { ECClassHierarchyInspector, ECSqlQueryExecutor } from \"@itwin/presentation-shared\";\nimport type { HiliteSet, HiliteSetProvider } from \"./HiliteSetProvider.js\";\nimport type { StorageSelectionChangeEventArgs } from \"./SelectionChangeEvent.js\";\nimport type { SelectionStorage } from \"./SelectionStorage.js\";\n\n/**\n * Props for creating an `IModelHiliteSetProvider` instance.\n * @public\n */\nexport interface IModelHiliteSetProviderProps {\n /** Selection storage to use for retrieving the hilite set. */\n selectionStorage: SelectionStorage;\n\n /** A callback that should return iModel access by iModel key. */\n imodelProvider: (imodelKey: string) => ECClassHierarchyInspector & ECSqlQueryExecutor;\n\n /** An optional hilite set provider factory. If not provided, defaults to `createHiliteSetProvider` from this package. */\n createHiliteSetProvider?: typeof createHiliteSetProvider;\n}\n\n/**\n * Defines return value of `createIModelHiliteSetProvider`.\n *\n * **Warning:** Used in public API as a return value. Not expected to be created / extended by package\n * consumers, may be supplemented with required attributes any time.\n *\n * @see `createIModelHiliteSetProvider`\n * @public\n */\nexport interface IModelHiliteSetProvider {\n /** Get the hilite set provider for the specified iModel. */\n getHiliteSetProvider(props: {\n /** iModel to get hilite set provider for */\n imodelKey: string;\n }): HiliteSetProvider;\n\n /** Get the hilite set iterator for active selection in the specified iModel. */\n getCurrentHiliteSet(props: {\n /** iModel to get hilite set for */\n imodelKey: string;\n }): AsyncIterableIterator<HiliteSet>;\n\n /**\n * Disposes the cache.\n */\n [Symbol.dispose]: () => void;\n}\n\n/**\n * Creates a hilite set provider that can efficiently get a hilite set for the \"active\" selection in an iModel.\n *\n * This specific implementation caches the hilite set for the current selection, so subsequent hilite set\n * requests for the same iModel, don't cost until selection changes.\n *\n * @public\n */\nexport function createIModelHiliteSetProvider(props: IModelHiliteSetProviderProps): IModelHiliteSetProvider {\n return new IModelHiliteSetProviderImpl(props);\n}\n\nclass IModelHiliteSetProviderImpl implements IModelHiliteSetProvider {\n private _selectionStorage: SelectionStorage;\n private _hiliteSetProviders = new Map<string, HiliteSetProvider>();\n private _cache = new Map<string, Observable<HiliteSet>>();\n private _removeListener: () => void;\n private _imodelProvider: (imodelKey: string) => ECClassHierarchyInspector & ECSqlQueryExecutor;\n private _createHiliteSetProvider: typeof createHiliteSetProvider;\n\n constructor(props: IModelHiliteSetProviderProps) {\n this._selectionStorage = props.selectionStorage;\n this._imodelProvider = props.imodelProvider;\n this._removeListener = this._selectionStorage.selectionChangeEvent.addListener(\n (args: StorageSelectionChangeEventArgs) => {\n this._cache.delete(args.imodelKey);\n if (args.changeType === \"clear\" && args.source === CLEAR_SELECTION_STORAGE_SOURCE) {\n this._hiliteSetProviders.delete(args.imodelKey);\n }\n },\n );\n /* v8 ignore next -- @preserve */\n this._createHiliteSetProvider = props.createHiliteSetProvider ?? createHiliteSetProvider;\n }\n\n public getHiliteSetProvider({ imodelKey }: { imodelKey: string }): HiliteSetProvider {\n let provider = this._hiliteSetProviders.get(imodelKey);\n if (!provider) {\n provider = this._createHiliteSetProvider({ imodelAccess: this._imodelProvider(imodelKey) });\n this._hiliteSetProviders.set(imodelKey, provider);\n }\n return provider;\n }\n\n public getCurrentHiliteSet({ imodelKey }: { imodelKey: string }): AsyncIterableIterator<HiliteSet> {\n let hiliteSet = this._cache.get(imodelKey);\n if (!hiliteSet) {\n const selectables = this._selectionStorage.getSelection({ imodelKey });\n hiliteSet = from(this.getHiliteSetProvider({ imodelKey }).getHiliteSet({ selectables })).pipe(\n shareReplay({ refCount: true }),\n );\n this._cache.set(imodelKey, hiliteSet);\n }\n return eachValueFrom(hiliteSet);\n }\n\n public [Symbol.dispose](): void {\n this._removeListener();\n this._hiliteSetProviders = new Map();\n this._cache = new Map();\n }\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Selectable.d.ts","sourceRoot":"","sources":["../../src/unified-selection/Selectable.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAEtD;;;GAGG;AACH,MAAM,WAAW,qBAAqB;IACpC;;;OAGG;IACH,SAAS,EAAE,MAAM,CAAC;IAElB,oBAAoB;IACpB,EAAE,EAAE,MAAM,CAAC;CACZ;AAED;;;;;;;;;;GAUG;AACH,MAAM,WAAW,gBAAgB;IAC/B,2CAA2C;IAC3C,UAAU,EAAE,MAAM,CAAC;IACnB,uFAAuF;IACvF,gBAAgB,EAAE,MAAM,qBAAqB,CAAC,qBAAqB,CAAC,CAAC;IACrE,kDAAkD;IAClD,IAAI,EAAE,OAAO,CAAC;CACf;AAED;;;GAGG;AACH,MAAM,MAAM,UAAU,GAAG,qBAAqB,GAAG,gBAAgB,CAAC;AAElE;;;GAGG;AACH,MAAM,MAAM,oBAAoB,GAAG,qBAAqB,GAAG,IAAI,CAAC,gBAAgB,EAAE,YAAY,CAAC,CAAC;AAEhG,cAAc;AAEd,yBAAiB,UAAU,CAAC;IAC1B,oEAAoE;IACpE,SAAgB,aAAa,CAAC,UAAU,EAAE,UAAU,GAAG,oB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AC,CAAC,CAClG,CACF,CAAC;IACJ,CAAC;IAde,YAAA,IAAI,OAcnB,CAAA;AACH,CAAC,EAhNgB,WAAW,KAAX,WAAW,QAgN3B;AAED,SAAS,kBAAkB,CAAC,aAAqB;IAC/C,OAAO,aAAa,KAAK,2BAA2B,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,sBAAsB,CAAC,aAAa,CAAC,CAAC;AAC/G,CAAC","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 { from, map, merge, mergeMap } from \"rxjs\";\nimport { eachValueFrom } from \"rxjs-for-await\";\nimport { normalizeFullClassName } from \"@itwin/presentation-shared\";\nimport { releaseMainThreadOnItemsCount } from \"./Utils.js\";\n\nimport type { Id64String } from \"@itwin/core-bentley\";\n\n/**\n * ECInstance selectable\n * @public\n */\nexport interface SelectableInstanceKey {\n /**\n * Full class name in format `SchemaName:ClassName` or `SchemaName.ClassName` for\n * persistent instances or `TRANSIENT_ELEMENT_CLASSNAME` for transient instances.\n */\n className: string;\n\n /** ECInstance ID */\n id: string;\n}\n\n/**\n * A custom selectable, which has an identifier, knows how to loads its associated selectable instance keys\n * and has custom data associated with it.\n *\n * An example of such selectable could be an instance grouping node:\n * - `identifier` could be a GUID, associated with the node,\n * - `loadInstanceKeys` would know how to load grouped instance keys from the node,\n * - `data` could be set to the node itself.\n *\n * @public\n */\nexport interface CustomSelectable {\n /** Unique identifier of the selectable. */\n identifier: string;\n /** Asynchronous function for loading instance keys associated with this selectable. */\n loadInstanceKeys: () => AsyncIterableIterator<SelectableInstanceKey>;\n /** Custom data associated with the selectable. */\n data: unknown;\n}\n\n/**\n * A single selectable that identifies something that can be selected in an iTwin.js application.\n * @public\n */\nexport type Selectable = SelectableInstanceKey | CustomSelectable;\n\n/**\n * A type of identifier that can be used to identify a selectable in selection storage.\n * @public\n */\nexport type SelectableIdentifier = SelectableInstanceKey | Pick<CustomSelectable, \"identifier\">;\n\n/** @public */\n// eslint-disable-next-line @typescript-eslint/no-redeclare\nexport namespace Selectable {\n /** Check if the supplied selectable is a `SelectableInstanceKey` */\n export function isInstanceKey(selectable: Selectable | SelectableIdentifier): selectable is SelectableInstanceKey {\n const instanceKey = selectable as SelectableInstanceKey;\n return !!instanceKey.className && !!instanceKey.id;\n }\n\n /** Check if the supplied selectable is a `CustomSelectable` */\n export function isCustom(selectable: Selectable): selectable is CustomSelectable {\n return !!(selectable as CustomSelectable).identifier;\n }\n}\n\n/**\n * A collection of selectables that identify something that can be selected in an iTwin.js application\n * @public\n */\nexport interface Selectables {\n /**\n * A map between `SelectableInstanceKey.className` and a set of selected instance IDs.\n */\n instanceKeys: Map<string, Set<Id64String>>;\n /**\n * A map between `CustomSelectable.identifier` and the selectable itself.\n */\n custom: Map<string, CustomSelectable>;\n}\n\n/**\n * Class name used to create `SelectableInstanceKey` for transient elements.\n * @public\n */\nexport const TRANSIENT_ELEMENT_CLASSNAME = \"/TRANSIENT\";\n\n/** @public */\nexport namespace Selectables {\n /**\n * Creates `Selectables` from array of selectable\n * @param source Source to create selectables from\n * @public\n */\n export function create(source: Selectable[]): Selectables {\n const newSelectables = {\n instanceKeys: new Map<string, Set<string>>(),\n custom: new Map<string, CustomSelectable>(),\n };\n Selectables.add(newSelectables, source);\n return newSelectables;\n }\n\n /**\n * Get the number of selectables stored in a `Selectables` object.\n * @param selectables `Selectables` object to get size for\n * @public\n */\n export function size(selectables: Selectables): number {\n let instanceCount = 0;\n selectables.instanceKeys.forEach((set: Set<string>) => (instanceCount += set.size));\n return instanceCount + selectables.custom.size;\n }\n\n /**\n * Is a `Selectables` object currently empty.\n * @param selectables `Selectables` object to check\n * @public\n */\n export function isEmpty(selectables: Selectables): boolean {\n return Selectables.size(selectables) === 0;\n }\n\n /**\n * Check if a `Selectables` object contains the specified selectable.\n * @param selectables `Selectables` object to check\n * @param value The selectable to check for.\n * @public\n */\n export function has(selectables: Selectables, value: SelectableIdentifier): boolean {\n if (Selectable.isInstanceKey(value)) {\n const normalizedClassName = normalizeClassName(value.className);\n const set = selectables.instanceKeys.get(normalizedClassName);\n return !!(set && set.has(value.id));\n }\n return selectables.custom.has(value.identifier);\n }\n\n /**\n * Check if a `Selectables` object contains all the specified selectables.\n * @param selectables `Selectables` object to check\n * @param values The selectables to check for.\n * @public\n */\n export function hasAll(selectables: Selectables, values: SelectableIdentifier[]): boolean {\n if (Selectables.size(selectables) < values.length) {\n return false;\n }\n for (const selectable of values) {\n if (!Selectables.has(selectables, selectable)) {\n return false;\n }\n }\n return true;\n }\n\n /**\n * Check if a `Selectables` object contains any of the specified selectables.\n * @param selectables `Selectables` object to check\n * @param values The selectables to check for.\n * @public\n */\n export function hasAny(selectables: Selectables, values: SelectableIdentifier[]): boolean {\n for (const selectable of values) {\n if (Selectables.has(selectables, selectable)) {\n return true;\n }\n }\n return false;\n }\n\n /**\n * Add a one or more selectables to a `Selectables`\n * @param selectables `Selectables` object to add selectables for\n * @param values Selectables to add.\n * @public\n */\n export function add(selectables: Selectables, values: Selectable[]): boolean {\n let hasChanged = false;\n for (const selectable of values) {\n if (Selectable.isInstanceKey(selectable)) {\n const normalizedClassName = normalizeClassName(selectable.className);\n let set = selectables.instanceKeys.get(normalizedClassName);\n if (!set) {\n set = new Set<string>();\n }\n if (!set.has(selectable.id)) {\n set.add(selectable.id);\n selectables.instanceKeys.set(normalizedClassName, set);\n hasChanged = true;\n }\n } else if (!selectables.custom.has(selectable.identifier)) {\n selectables.custom.set(selectable.identifier, selectable);\n hasChanged = true;\n }\n }\n return hasChanged;\n }\n\n /**\n * Removes one or more selectables from a `Selectables` object.\n * @param selectables `Selectables` object to remove selectables for\n * @param values Selectables to remove.\n * @public\n */\n export function remove(selectables: Selectables, values: Selectable[]): boolean {\n let hasChanged = false;\n for (const selectable of values) {\n if (Selectable.isInstanceKey(selectable)) {\n const normalizedClassName = normalizeClassName(selectable.className);\n const set = selectables.instanceKeys.get(normalizedClassName);\n if (set && set.has(selectable.id)) {\n set.delete(selectable.id);\n hasChanged = true;\n if (set.size === 0) {\n selectables.instanceKeys.delete(normalizedClassName);\n }\n }\n } else if (selectables.custom.has(selectable.identifier)) {\n selectables.custom.delete(selectable.identifier);\n hasChanged = true;\n }\n }\n return hasChanged;\n }\n\n /**\n * Clear a `Selectables` object.\n * @param selectables `Selectables` object to clear selectables for\n * @public\n */\n export function clear(selectables: Selectables): boolean {\n if (Selectables.size(selectables) === 0) {\n return false;\n }\n selectables.instanceKeys = new Map<string, Set<string>>();\n selectables.custom = new Map<string, CustomSelectable>();\n return true;\n }\n\n /**\n * Check whether at least one selectable passes a condition in a `Selectables` object.\n * @param selectables `Selectables` object to check\n * @public\n */\n export function some(selectables: Selectables, callback: (selectable: Selectable) => boolean) {\n for (const entry of selectables.instanceKeys) {\n for (const item of entry[1]) {\n if (callback({ className: entry[0], id: item })) {\n return true;\n }\n }\n }\n for (const entry of selectables.custom) {\n if (callback(entry[1])) {\n return true;\n }\n }\n return false;\n }\n\n /**\n * Iterate over all keys in a `Selectables` object.\n * @param selectables `Selectables` object to iterate over\n * @public\n */\n export function forEach(selectables: Selectables, callback: (selectable: Selectable, index: number) => void) {\n let index = 0;\n selectables.instanceKeys.forEach((ids: Set<string>, className: string) => {\n ids.forEach((id: string) => callback({ className, id }, index++));\n });\n selectables.custom.forEach((data) => {\n callback(data, index++);\n });\n }\n\n /**\n * Load all instance keys from the given `Selectables` object.\n * @param selectables `Selectables` object to load instance keys from\n * @public\n */\n export function load(selectables: Selectables): AsyncIterableIterator<SelectableInstanceKey> {\n return eachValueFrom(\n merge(\n from(selectables.instanceKeys).pipe(\n mergeMap(([className, ids]) =>\n from(ids).pipe(\n releaseMainThreadOnItemsCount(1000),\n map((id) => ({ className, id })),\n ),\n ),\n ),\n from(selectables.custom).pipe(mergeMap(([_, selectable]) => from(selectable.loadInstanceKeys()))),\n ),\n );\n }\n}\n\nfunction normalizeClassName(fullClassName: string) {\n return fullClassName === TRANSIENT_ELEMENT_CLASSNAME ? fullClassName : normalizeFullClassName(fullClassName);\n}\n"]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Selectables } from "./Selectable.js";
|
|
2
|
-
import { SelectionStorage } from "./SelectionStorage.js";
|
|
1
|
+
import type { Selectables } from "./Selectable.js";
|
|
2
|
+
import type { SelectionStorage } from "./SelectionStorage.js";
|
|
3
3
|
/**
|
|
4
4
|
* The type of selection change.
|
|
5
5
|
* @public
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SelectionChangeEvent.d.ts","sourceRoot":"","sources":["../../src/unified-selection/SelectionChangeEvent.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AACnD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAE9D;;;GAGG;AACH,MAAM,MAAM,0BAA0B;AACpC,0BAA0B;AACxB,KAAK;AACP,8BAA8B;GAC5B,QAAQ;AACV,8BAA8B;GAC5B,SAAS;AACX,6BAA6B;GAC3B,OAAO,CAAC;AAEZ;;;;;;;;GAQG;AACH,MAAM,WAAW,+BAA+B;IAC9C,0EAA0E;IAC1E,MAAM,EAAE,MAAM,CAAC;IACf,8BAA8B;IAC9B,KAAK,EAAE,MAAM,CAAC;IACd,iCAAiC;IACjC,UAAU,EAAE,0BAA0B,CAAC;IACvC,2DAA2D;IAC3D,WAAW,EAAE,WAAW,CAAC;IACzB;;;OAGG;IACH,SAAS,EAAE,MAAM,CAAC;IAClB;;;;;OAKG;IACH,SAAS,EAAE,MAAM,CAAC;IAClB,2DAA2D;IAC3D,SAAS,EAAE,IAAI,CAAC;IAChB,sDAAsD;IACtD,OAAO,EAAE,gBAAgB,CAAC;CAC3B;AAED;;;GAGG;AACH,MAAM,MAAM,+BAA+B,GAAG;AAC5C,+CAA+C;AAC/C,IAAI,EAAE,+BAA+B;AACrC,2DAA2D;AAC3D,CAAC,CAAC,EAAE,GAAG,KACJ,IAAI,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SelectionChangeEvent.js","sourceRoot":"","sources":["../../src/unified-selection/SelectionChangeEvent.ts"],"names":[],"mappings":"AAAA;;;gGAGgG","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 type { Selectables } from \"./Selectable.js\";\nimport type { SelectionStorage } from \"./SelectionStorage.js\";\n\n/**\n * The type of selection change.\n * @public\n */\nexport type StorageSelectionChangeType =\n /** Added to selection. */\n | \"add\"\n /** Removed from selection. */\n | \"remove\"\n /** Selection was replaced. */\n | \"replace\"\n /** Selection was cleared. */\n | \"clear\";\n\n/**\n * The event object that is sent when the selection changes.\n *\n * **Warning:** Used in public API as an input to consumer-supplied callback. Not expected to be created / extended\n * by package consumers, may be supplemented with required attributes any time.\n *\n * @see `StorageSelectionChangesListener`\n * @public\n */\nexport interface StorageSelectionChangeEventArgs {\n /** The name of the selection source which caused the selection change. */\n source: string;\n /** Level of the selection. */\n level: number;\n /** The selection change type. */\n changeType: StorageSelectionChangeType;\n /** Selectables affected by this selection change event. */\n selectables: Selectables;\n /**\n * iModel key with which the selection is associated with.\n * Set to an empty string if the selection change is not associated with any iModel.\n */\n imodelKey: string;\n /**\n * iModel key with which the selection is associated with.\n * Set to an empty string if the selection change is not associated with any iModel.\n *\n * @deprecated in 0.2. Use `imodelKey` instead.\n */\n iModelKey: string;\n /** The timestamp of when the selection change happened. */\n timestamp: Date;\n /** The selection storage where the event happened. */\n storage: SelectionStorage;\n}\n\n/**\n * An interface for selection change listeners.\n * @public\n */\nexport type StorageSelectionChangesListener = (\n /** Arguments for the selection change event */\n args: StorageSelectionChangeEventArgs,\n /** Unused. Temporarily left to avoid a breaking change. */\n _?: any,\n) => void;\n"]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Id64Arg } from "@itwin/core-bentley";
|
|
2
|
-
import { ECSqlQueryExecutor } from "@itwin/presentation-shared";
|
|
3
|
-
import { SelectableInstanceKey } from "./Selectable.js";
|
|
1
|
+
import type { Id64Arg } from "@itwin/core-bentley";
|
|
2
|
+
import type { ECSqlQueryExecutor } from "@itwin/presentation-shared";
|
|
3
|
+
import type { SelectableInstanceKey } from "./Selectable.js";
|
|
4
4
|
/**
|
|
5
5
|
* Available selection scopes.
|
|
6
6
|
* @public
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SelectionScope.d.ts","sourceRoot":"","sources":["../../src/unified-selection/SelectionScope.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,OAAO,EAAsB,MAAM,qBAAqB,CAAC;AACvE,OAAO,KAAK,EAGV,kBAAkB,EAGnB,MAAM,4BAA4B,CAAC;AACpC,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AAE7D;;;GAGG;AACH,KAAK,wBAAwB,GAAG,SAAS,GAAG,OAAO,GAAG,UAAU,GAAG,YAAY,CAAC;AAEhF;;;GAGG;AACH,MAAM,WAAW,0BAA0B;IACzC,0EAA0E;IAC1E,EAAE,EAAE,SAAS,GAAG,YAAY,CAAC;IAC7B;;;;;;;OAOG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED;;;;GAIG;AACH,MAAM,MAAM,cAAc,GAAG,0BAA0B,GAAG;IAAE,EAAE,EAAE,wBAAwB,CAAA;CAAE,GAAG,wBAAwB,CAAC;AAEtH;;;GAGG;AACH,MAAM,WAAW,qBAAqB;IACpC,6BAA6B;IAC7B,aAAa,EAAE,kBAAkB,CAAC;IAClC,gDAAgD;IAChD,UAAU,EAAE,OAAO,CAAC;IACpB,iDAAiD;IACjD,KAAK,EAAE,cAAc,CAAC;IACtB,sJAAsJ;IACtJ,WAAW,CAAC,EAAE,MAAM,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;YACzB,mBAAmB,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QAC/B,CAAC;aAAM,CAAC;YACN,oBAAoB,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QAChC,CAAC;IACH,CAAC;IAED,OAAO,EAAE,UAAU,EAAE,oBAAoB,EAAE,SAAS,EAAE,mBAAmB,EAAE,CAAC;AAC9E,CAAC","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 { Guid, Id64 } from \"@itwin/core-bentley\";\nimport { TRANSIENT_ELEMENT_CLASSNAME } from \"./Selectable.js\";\nimport { formIdBindings, genericExecuteQuery } from \"./Utils.js\";\n\nimport type { Id64Arg, Id64Array, Id64Set } from \"@itwin/core-bentley\";\nimport type {\n ECSqlBinding,\n ECSqlQueryDef,\n ECSqlQueryExecutor,\n ECSqlQueryReaderOptions,\n ECSqlQueryRow,\n} from \"@itwin/presentation-shared\";\nimport type { SelectableInstanceKey } from \"./Selectable.js\";\n\n/**\n * Available selection scopes.\n * @public\n */\ntype SelectionScopeIdentifier = \"element\" | \"model\" | \"category\" | \"functional\";\n\n/**\n * Props for computing element selection.\n * @public\n */\nexport interface ElementSelectionScopeProps {\n /** Identifies this as either \"element\" or \"functional\" selection scope */\n id: \"element\" | \"functional\";\n /**\n * Specifies how far \"up\" we should walk to find the target element. When not specified or `0`,\n * the target element matches the request element. When set to `1`, the target element matches the direct parent element.\n * When set to `2`, the target element is parent of the parent element and so on. In all situations when this is `> 0`,\n * we're not walking further than the last existing element, for example when `ancestorLevel = 1` (direct parent\n * element is requested), but the request element doesn't have a parent, the request element is returned as the result.\n * A negative value would result in the top-most element to be returned.\n */\n ancestorLevel?: number;\n}\n\n/**\n * A union of types that can be used to define a selection scope.\n * @public\n * @since 1.4.0\n */\nexport type SelectionScope = ElementSelectionScopeProps | { id: SelectionScopeIdentifier } | SelectionScopeIdentifier;\n\n/**\n * Props for `computeSelection`.\n * @public\n */\nexport interface ComputeSelectionProps {\n /** iModel query executor. */\n queryExecutor: ECSqlQueryExecutor;\n /** IDs of elements to compute selection for. */\n elementIds: Id64Arg;\n /** Selection scope to compute selection with. */\n scope: SelectionScope;\n /** Optional unique id of the component that consumes this function. It can be any string, as long as it is not shared across different components. */\n componentId?: string;\n}\n\n/**\n * Computes selection from given element IDs.\n * @public\n */\nexport async function* computeSelection(props: ComputeSelectionProps): AsyncIterableIterator<SelectableInstanceKey> {\n const { queryExecutor, elementIds, scope } = props;\n const componentId = props.componentId ?? Guid.createValue();\n const componentName = \"computeSelection\";\n if (typeof scope === \"string\") {\n yield* computeSelection({ queryExecutor, elementIds, scope: { id: scope }, componentId });\n return;\n }\n\n const { persistent: persistentIds, transient: transientIds } = parseElementIds(elementIds);\n\n for (const id of transientIds) {\n yield { id, className: TRANSIENT_ELEMENT_CLASSNAME };\n }\n\n switch (scope.id) {\n case \"element\":\n yield* computeElementSelection(\n queryExecutor,\n persistentIds,\n (scope as ElementSelectionScopeProps).ancestorLevel ?? 0,\n componentId,\n componentName,\n );\n return;\n case \"category\":\n yield* computeCategorySelection(queryExecutor, persistentIds, componentId, componentName);\n return;\n case \"model\":\n yield* computeModelSelection(queryExecutor, persistentIds, componentId, componentName);\n return;\n case \"functional\":\n yield* computeFunctionalElementSelection(\n queryExecutor,\n persistentIds,\n (scope as ElementSelectionScopeProps).ancestorLevel ?? 0,\n componentId,\n componentName,\n );\n return;\n }\n}\n\nasync function* computeElementSelection(\n queryExecutor: ECSqlQueryExecutor,\n ids: Id64Array | Id64Set,\n ancestorLevel: number,\n componentId: string,\n componentName: string,\n): AsyncIterableIterator<SelectableInstanceKey> {\n const bindings: ECSqlBinding[] = [];\n const recurseUntilRoot = ancestorLevel < 0;\n const ctes = [\n `\n AncestorElements(ECInstanceId, ECClassId, Depth, ParentId) AS (\n SELECT ECInstanceId, ECClassId, ${formAncestorLevelBinding(ancestorLevel, bindings)}, Parent.Id\n FROM BisCore.Element\n WHERE ${formIdBindings(\"ECInstanceId\", ids, bindings)}\n UNION ALL\n SELECT pe.ECInstanceId, pe.ECClassId, a.Depth - 1, pe.Parent.Id\n FROM AncestorElements a\n JOIN BisCore.Element pe ON pe.ECInstanceId = a.ParentId\n WHERE ${recurseUntilRoot ? \"\" : \"Depth > 0 AND\"} ParentId IS NOT NULL\n )\n `,\n ];\n const ecsql = `\n SELECT DISTINCT ECInstanceId, ec_classname(ECClassId, 's.c') AS ClassName\n FROM AncestorElements\n WHERE ${recurseUntilRoot ? \"\" : \"Depth = 0 OR\"} ParentId IS NULL\n `;\n yield* executeQuery({\n queryExecutor,\n query: { ctes, ecsql, bindings },\n config: { restartToken: `${componentName}/${componentId}/element/${Guid.createValue()}` },\n });\n}\n\nasync function* computeCategorySelection(\n queryExecutor: ECSqlQueryExecutor,\n ids: Id64Array | Id64Set,\n componentId: string,\n componentName: string,\n): AsyncIterableIterator<SelectableInstanceKey> {\n const bindings: ECSqlBinding[] = [];\n const ecsql = [\n `\n SELECT DISTINCT c.ECInstanceId, ec_classname(c.ECClassId, 's.c') AS ClassName\n FROM BisCore.Category c\n JOIN BisCore.GeometricElement2d ge ON ge.Category.Id = c.ECInstanceId\n WHERE ${formIdBindings(\"ge.ECInstanceId\", ids, bindings)}\n `,\n `\n SELECT DISTINCT c.ECInstanceId, ec_classname(c.ECClassId, 's.c') AS ClassName\n FROM BisCore.Category c\n JOIN BisCore.GeometricElement3d ge ON ge.Category.Id = c.ECInstanceId\n WHERE ${formIdBindings(\"ge.ECInstanceId\", ids, bindings)}\n `,\n ].join(\" UNION ALL \");\n yield* executeQuery({\n queryExecutor,\n query: { ecsql, bindings },\n config: { restartToken: `${componentName}/${componentId}/category/${Guid.createValue()}` },\n });\n}\n\nasync function* computeModelSelection(\n queryExecutor: ECSqlQueryExecutor,\n ids: Id64Array | Id64Set,\n componentId: string,\n componentName: string,\n): AsyncIterableIterator<SelectableInstanceKey> {\n const bindings: ECSqlBinding[] = [];\n const ecsql = `\n SELECT DISTINCT m.ECInstanceId, ec_classname(m.ECClassId, 's.c') AS ClassName\n FROM BisCore.Model m\n JOIN BisCore.Element e ON e.Model.Id = m.ECInstanceId\n WHERE ${formIdBindings(\"e.ECInstanceId\", ids, bindings)}\n `;\n yield* executeQuery({\n queryExecutor,\n query: { ecsql, bindings },\n config: { restartToken: `${componentName}/${componentId}/model/${Guid.createValue()}` },\n });\n}\n\nasync function* computeFunctionalElementSelection(\n queryExecutor: ECSqlQueryExecutor,\n ids: Id64Array | Id64Set,\n ancestorLevel: number,\n componentId: string,\n componentName: string,\n): AsyncIterableIterator<SelectableInstanceKey> {\n const bindings: ECSqlBinding[] = [];\n const recurseUntilRoot = ancestorLevel < 0;\n // cspell:disable\n const ctes = [\n `\n Elements2dOrNearestFunctionalElements(OriginalECInstanceId, OriginalECClassId, ECInstanceId, ECClassId, ParentId) AS (\n SELECT ECInstanceId, ECClassId, ECInstanceId, ECClassId, Parent.Id\n FROM BisCore.Element\n WHERE ${formIdBindings(\"ECInstanceId\", ids, bindings)} AND ECClassId IS NOT (BisCore.GeometricElement3d)\n UNION ALL\n SELECT\n e2onfe.OriginalECInstanceId,\n e2onfe.OriginalECClassId,\n COALESCE(dgrfe.TargetECInstanceId, pe.ECInstanceId),\n COALESCE(dgrfe.TargetECClassId, pe.ECClassId),\n pe.Parent.Id\n FROM Elements2dOrNearestFunctionalElements e2onfe\n LEFT JOIN BisCore.Element pe ON pe.ECInstanceId = e2onfe.ParentId\n LEFT JOIN Functional.DrawingGraphicRepresentsFunctionalElement dgrfe ON dgrfe.SourceECInstanceId = e2onfe.ECInstanceId\n WHERE e2onfe.ECClassId IS NOT (Functional.FunctionalElement) AND (e2onfe.ParentId IS NOT NULL OR dgrfe.TargetECInstanceId IS NOT NULL)\n )\n `,\n `\n Element2dNearestFunctionalElements(OriginalECInstanceId, ECInstanceId, ECClassId) AS (\n SELECT OriginalECInstanceId, ECInstanceId, ECClassId\n FROM Elements2dOrNearestFunctionalElements\n WHERE ECClassId IS (Functional.FunctionalElement)\n )\n `,\n `\n Elements2dWithoutFunctionalElement(ECInstanceId, ECClassId) AS (\n SELECT e2wfe.OriginalECInstanceId, OriginalECClassId\n FROM Elements2dOrNearestFunctionalElements e2wfe\n LEFT JOIN Element2dNearestFunctionalElements e2nfe ON e2nfe.OriginalECInstanceId = e2wfe.OriginalECInstanceId\n WHERE e2wfe.ParentId IS NULL AND e2nfe.ECInstanceId IS NULL\n )\n `,\n `\n Elements2d(ECInstanceId, ECClassId) AS (\n SELECT ECInstanceId, ECClassId FROM Element2dNearestFunctionalElements\n UNION\n SELECT ECInstanceId, ECClassId FROM Elements2dWithoutFunctionalElement\n )\n `,\n `\n Element2dAncestorElements(ECInstanceId, ECClassId, Depth, ParentId) AS (\n SELECT e.ECInstanceId, e.ECClassId, ${formAncestorLevelBinding(ancestorLevel, bindings)}, e.Parent.Id\n FROM BisCore.Element e\n JOIN Elements2d e2d ON e2d.ECInstanceId = e.ECInstanceId\n UNION ALL\n SELECT pe.ECInstanceId, pe.ECClassId, e2ae.Depth - 1, pe.Parent.Id\n FROM Element2dAncestorElements e2ae\n JOIN BisCore.Element pe ON pe.ECInstanceId = e2ae.ParentId\n WHERE ${recurseUntilRoot ? \"\" : \"Depth > 0 AND\"} ParentId IS NOT NULL\n )\n `,\n `\n Element3dAncestorElements(ECInstanceId, ECClassId, Depth, ParentId) AS (\n SELECT ge.ECInstanceId, ge.ECClassId, ${formAncestorLevelBinding(ancestorLevel, bindings)}, ge.Parent.Id\n FROM BisCore.GeometricElement3d ge\n WHERE ${formIdBindings(\"ge.ECInstanceId\", ids, bindings)}\n UNION ALL\n SELECT pe.ECInstanceId, pe.ECClassId, e3ae.Depth - 1, pe.Parent.Id\n FROM Element3dAncestorElements e3ae\n JOIN BisCore.Element pe ON pe.ECInstanceId = e3ae.ParentId\n WHERE ${recurseUntilRoot ? \"\" : \"Depth > 0 AND\"} ParentId IS NOT NULL\n )\n `,\n `\n Element3dAncestorRelatedFunctionalElement(ECInstanceId, ClassName) AS (\n SELECT\n COALESCE(peff.TargetECInstanceId, e3ae.ECInstanceId),\n ec_classname(COALESCE(peff.TargetECClassId, e3ae.ECClassId), 's.c')\n FROM Element3dAncestorElements e3ae\n LEFT JOIN Functional.PhysicalElementFulfillsFunction peff ON peff.SourceECInstanceId = e3ae.ECInstanceId\n WHERE ${recurseUntilRoot ? \"\" : \"e3ae.Depth = 0 OR\"} e3ae.ParentId IS NULL\n )\n `,\n ];\n const ecsql = [\n `\n SELECT DISTINCT ECInstanceId, ec_classname(ECClassId, 's.c') AS ClassName\n FROM Element2dAncestorElements\n WHERE ${recurseUntilRoot ? \"\" : \"Depth = 0 OR\"} ParentId IS NULL\n `,\n `\n SELECT DISTINCT ECInstanceId, ClassName FROM Element3dAncestorRelatedFunctionalElement\n `,\n ].join(\" UNION \");\n // cspell:enable\n yield* executeQuery({\n queryExecutor,\n query: { ctes, ecsql, bindings },\n config: { restartToken: `${componentName}/${componentId}/functional-element/${Guid.createValue()}` },\n });\n}\n\nfunction formAncestorLevelBinding(ancestorLevel: number, bindings: ECSqlBinding[]) {\n bindings.push({ type: \"int\", value: ancestorLevel });\n return \"?\";\n}\n\nasync function* executeQuery(props: {\n queryExecutor: ECSqlQueryExecutor;\n query: ECSqlQueryDef;\n config?: ECSqlQueryReaderOptions;\n}): AsyncIterableIterator<SelectableInstanceKey> {\n yield* genericExecuteQuery({\n ...props,\n parseQueryRow: (row: ECSqlQueryRow) => ({ className: row.ClassName, id: row.ECInstanceId }),\n });\n}\n\nfunction parseElementIds(ids: Id64Arg): { persistent: Id64Set | Id64Array; transient: Id64Set | Id64Array } {\n if (typeof ids === \"string\") {\n ids = [ids];\n }\n\n // detect if all ids are either transient or persistent to avoid unnecessary copying\n let allPersistent = true;\n let allTransient = true;\n for (const id of ids) {\n if (Id64.isTransient(id)) {\n allPersistent = false;\n } else {\n allTransient = false;\n }\n\n if (!allPersistent && !allTransient) {\n break;\n }\n }\n\n // avoid making a copy if ids are only persistent or only transient\n if (allPersistent) {\n return { persistent: ids, transient: [] };\n } else if (allTransient) {\n return { persistent: [], transient: ids };\n }\n\n // if `ids` contain mixed ids, we have to copy.. use Array instead of\n // a Set for performance\n const persistentElementIds: Id64Array = [];\n const transientElementIds: Id64Array = [];\n for (const id of ids) {\n if (Id64.isTransient(id)) {\n transientElementIds.push(id);\n } else {\n persistentElementIds.push(id);\n }\n }\n\n return { persistent: persistentElementIds, transient: transientElementIds };\n}\n"]}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { Selectables } from "./Selectable.js";
|
|
2
|
+
import type { Event } from "@itwin/presentation-shared";
|
|
3
|
+
import type { Selectable } from "./Selectable.js";
|
|
4
|
+
import type { StorageSelectionChangesListener } from "./SelectionChangeEvent.js";
|
|
4
5
|
/** @public */
|
|
5
6
|
type IModelKeyProp = {
|
|
6
7
|
/**
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SelectionStorage.d.ts","sourceRoot":"","sources":["../../src/unified-selection/SelectionStorage.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAE9C,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,4BAA4B,CAAC;AACxD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,KAAK,EAEV,+BAA+B,EAEhC,MAAM,2BAA2B,CAAC;AAEnC,cAAc;AACd,KAAK,aAAa,GACd;IACE;;;;;OAKG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,KAAK,CAAC;CACnB,GACD;IACE,SAAS,CAAC,EAAE,KAAK,CAAC;IAClB;;;;;;;OAOG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AAEN;;;;;;;;GAQG;AACH,MAAM,WAA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AC,WAAW,CAAC,CAAC;YACjC,CAAC;QACH,CAAC;IACH,CAAC;CACF","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 { BeEvent } from \"@itwin/core-bentley\";\nimport { Selectables } from \"./Selectable.js\";\n\nimport type { Event } from \"@itwin/presentation-shared\";\nimport type { Selectable } from \"./Selectable.js\";\nimport type {\n StorageSelectionChangeEventArgs,\n StorageSelectionChangesListener,\n StorageSelectionChangeType,\n} from \"./SelectionChangeEvent.js\";\n\n/** @public */\ntype IModelKeyProp =\n | {\n /**\n * Key of the iModel. It's recommended to use `createIModelKey` function from `@itwin/presentation-core-interop`\n * package to create the key for an iModel.\n *\n * Defaults to an empty string when not supplied.\n */\n imodelKey?: string;\n iModelKey?: never;\n }\n | {\n imodelKey?: never;\n /**\n * Key of the iModel. It's recommended to use `createIModelKey` function from `@itwin/presentation-core-interop`\n * package to create the key for an iModel.\n *\n * Defaults to an empty string when not supplied.\n *\n * @deprecated in 0.2. Use `imodelKey` instead.\n */\n iModelKey?: string;\n };\n\n/**\n * Defines return value of `createStorage`.\n *\n * **Warning:** Used in public API as a return value. Not expected to be created / extended by package\n * consumers, may be supplemented with required attributes any time.\n *\n * @see `createStorage`\n * @public\n */\nexport interface SelectionStorage {\n /** An event that is raised when selection changes. */\n selectionChangeEvent: Event<StorageSelectionChangesListener>;\n\n /** Get the selection levels currently stored for the specified iModel. */\n getSelectionLevels(props: IModelKeyProp): number[];\n\n /** Get the selection stored in the storage. */\n getSelection(\n props: IModelKeyProp & {\n /** Level of the selection. Defaults to `0`. */\n level?: number;\n },\n ): Selectables;\n\n /** Add keys to the selection. */\n addToSelection(\n props: IModelKeyProp & {\n /** Name of the selection source. Generally, this identifies the component that makes the selection change. */\n source: string;\n /** The selectables to add to selection. */\n selectables: Selectable[];\n /** Level of the selection. Defaults to `0`. */\n level?: number;\n },\n ): void;\n\n /** Remove keys from current selection. */\n removeFromSelection(\n props: IModelKeyProp & {\n /** Name of the selection source. Generally, this identifies the component that makes the selection change. */\n source: string;\n /** The selectables to remove from selection. */\n selectables: Selectable[];\n /** Level of the selection. Defaults to `0`. */\n level?: number;\n },\n ): void;\n\n /** Replace current selection. */\n replaceSelection(\n props: IModelKeyProp & {\n /** Name of the selection source. Generally, this identifies the component that makes the selection change. */\n source: string;\n /** The selectables to add to selection. */\n selectables: Selectable[];\n /** Level of the selection. Defaults to `0`. */\n level?: number;\n },\n ): void;\n\n /** Clear current selection. */\n clearSelection(\n props: IModelKeyProp & {\n /** Name of the selection source. Generally, this identifies the component that makes the selection change. */\n source: string;\n /** Level of the selection. Defaults to `0`. */\n level?: number;\n },\n ): void;\n\n /** Clear storage for an iModel. This function should be called when iModel is closed. */\n clearStorage(props: IModelKeyProp): void;\n}\n\n/**\n * Creates a selection storage which stores and allows managing application-level selection.\n *\n * **Note:** `clearSelection` should be called upon iModel close to free-up memory:\n *\n * ```ts\n * import { IModelConnection } from \"@itwin/core-frontend\";\n * import { createIModelKey } from \"@itwin/presentation-core-interop\";\n *\n * IModelConnection.onClose.addListener((imodel) => {\n * storage.clearStorage(createIModelKey(imodel));\n * });\n * ```\n *\n * @public\n */\nexport function createStorage(): SelectionStorage {\n return new SelectionStorageImpl();\n}\n\n/**\n * The source name used when selection change is caused by clearing the selection storage. Used when change is performed by `clearStorage`.\n * @public\n */\nexport const CLEAR_SELECTION_STORAGE_SOURCE = \"Unified selection storage: clear\";\n\nclass SelectionStorageImpl implements SelectionStorage {\n private _storage = new Map<string, MultiLevelSelectablesContainer>();\n public selectionChangeEvent: BeEvent<StorageSelectionChangesListener>;\n\n constructor() {\n this.selectionChangeEvent = new BeEvent();\n }\n\n public getSelectionLevels(props: IModelKeyProp): number[] {\n return this.getContainer(getIModelKey(props)).getSelectionLevels();\n }\n\n public getSelection(props: IModelKeyProp & { level?: number }): Selectables {\n return this.getContainer(getIModelKey(props)).getSelection(props.level ?? 0);\n }\n\n public addToSelection(props: IModelKeyProp & { source: string; selectables: Selectable[]; level?: number }): void {\n this.handleChange({ ...props, changeType: \"add\" });\n }\n\n public removeFromSelection(\n props: IModelKeyProp & { source: string; selectables: Selectable[]; level?: number },\n ): void {\n this.handleChange({ ...props, changeType: \"remove\" });\n }\n\n public replaceSelection(props: IModelKeyProp & { source: string; selectables: Selectable[]; level?: number }): void {\n this.handleChange({ ...props, changeType: \"replace\" });\n }\n\n public clearSelection(props: IModelKeyProp & { source: string; level?: number }): void {\n this.handleChange({ ...props, changeType: \"clear\", selectables: [] });\n }\n\n public clearStorage(props: IModelKeyProp): void {\n const imodelKey = getIModelKey(props);\n this.clearSelection({ source: CLEAR_SELECTION_STORAGE_SOURCE, imodelKey });\n this._storage.delete(imodelKey);\n }\n\n private getContainer(imodelKey: string): MultiLevelSelectablesContainer {\n let selectionContainer = this._storage.get(imodelKey);\n if (!selectionContainer) {\n selectionContainer = new MultiLevelSelectablesContainer();\n this._storage.set(imodelKey, selectionContainer);\n }\n return selectionContainer;\n }\n\n private handleChange(\n props: IModelKeyProp & {\n source: string;\n level?: number;\n changeType: StorageSelectionChangeType;\n selectables: Selectable[];\n },\n ) {\n const { source, level: inLevel, changeType, selectables: change } = props;\n const imodelKey = getIModelKey(props);\n const container = this.getContainer(imodelKey);\n const level = inLevel ?? 0;\n const selectables = container.getSelection(level);\n const selected = Selectables.create(change);\n switch (changeType) {\n case \"add\":\n if (!Selectables.add(selectables, change)) {\n return;\n }\n break;\n case \"remove\":\n if (!Selectables.remove(selectables, change)) {\n return;\n }\n break;\n case \"replace\":\n if (Selectables.size(selectables) === Selectables.size(selected) && Selectables.hasAll(selectables, change)) {\n return;\n }\n Selectables.clear(selectables);\n Selectables.add(selectables, change);\n break;\n case \"clear\":\n if (!Selectables.clear(selectables)) {\n return;\n }\n break;\n }\n container.clear(level + 1);\n const event: StorageSelectionChangeEventArgs = {\n source,\n level,\n imodelKey,\n iModelKey: imodelKey,\n changeType,\n selectables: selected,\n timestamp: new Date(),\n storage: this,\n };\n this.selectionChangeEvent.raiseEvent(event, this);\n }\n}\n\nfunction getIModelKey(props: IModelKeyProp): string {\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n return (\"imodelKey\" in props ? props.imodelKey : props.iModelKey) ?? \"\";\n}\n\nclass MultiLevelSelectablesContainer {\n private readonly _selectablesContainers: Map<number, Selectables>;\n\n constructor() {\n this._selectablesContainers = new Map<number, Selectables>();\n }\n\n public getSelection(level: number): Selectables {\n let selectables = this._selectablesContainers.get(level);\n if (!selectables) {\n selectables = Selectables.create([]);\n this._selectablesContainers.set(level, selectables);\n }\n return selectables;\n }\n\n public getSelectionLevels(): number[] {\n const levels = new Array<number>();\n for (const entry of this._selectablesContainers.entries()) {\n if (!Selectables.isEmpty(entry[1])) {\n levels.push(entry[0]);\n }\n }\n return levels.sort();\n }\n\n public clear(level: number) {\n const storedLevels = this._selectablesContainers.keys();\n for (const storedLevel of storedLevels) {\n if (storedLevel >= level) {\n const selectables = this._selectablesContainers.get(storedLevel)!;\n Selectables.clear(selectables);\n }\n }\n }\n}\n"]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import "./DisposePolyfill.js";
|
|
2
|
-
import { Observable } from "rxjs";
|
|
3
|
-
import { Id64Array, Id64Set } from "@itwin/core-bentley";
|
|
4
|
-
import { ECSqlBinding, ECSqlQueryDef, ECSqlQueryExecutor, ECSqlQueryReaderOptions, ECSqlQueryRow } from "@itwin/presentation-shared";
|
|
2
|
+
import type { Observable } from "rxjs";
|
|
3
|
+
import type { Id64Array, Id64Set } from "@itwin/core-bentley";
|
|
4
|
+
import type { ECSqlBinding, ECSqlQueryDef, ECSqlQueryExecutor, ECSqlQueryReaderOptions, ECSqlQueryRow } from "@itwin/presentation-shared";
|
|
5
5
|
/**
|
|
6
6
|
* Forms ECSql bindings from given ID's.
|
|
7
7
|
* @internal
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Utils.d.ts","sourceRoot":"","sources":["../../src/unified-selection/Utils.ts"],"names":[],"mappings":"AAKA,OAAO,sBAAsB,CAAC;AAM9B,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,MAAM,CAAC;AACvC,OAAO,KAAK,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAC9D,OAAO,KAAK,EACV,YAAY,EACZ,aAAa,EACb,kBAAkB,EAClB,uBAAuB,EACvB,aAAa,EACd,MAAM,4BAA4B,CAAC;AAEpC;;;GAGG;AACH,wBAAgB,cAAc,CAAC,QAAQ,EAAE,MAAM,EAAE,GAAG,EAAE,SAAS,GAAG,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,GAAG,MAAM,CAoB3G;AAED;;;GAGG;AACH,wBAAuB,mBAAmB,CAAC,CAAC,EAAE,EAC5C,aAAa,EACb,aAAa,EACb,KAAK,EACL,MAAM,GACP,EAAE;IACD,aAAa,EAAE,kBAAkB,CAAC;IAClC,KAAK,EAAE,aAAa,CAAC;IACrB,aAAa,EAAE,CAAC,GAAG,EAAE,aAAa,KAAK,CAAC,CAAC;IACzC,MAAM,CAAC,EAAE,uBAAuB,CAAC;CAClC,GAAG,qBAAqB,CAAC,CAAC,CAAC,CAO3B;AAED;;;GAGG;AACH,wBAAgB,6BAA6B,CAAC,CAAC,EAAE,YAAY,EAAE,MAAM,SACtD,UAAU,CAAC,CAAC,CAAC,KAAG,UAAU,CAAC,CAAC,CAAC,CAa3C;AAED;;;;;;;;GAQG;AACH,wBAAgB,WAAW,CAAC,UAAU,EAAE,EAAE,GAAG;IAAE,CAAC,MAAM,CAAC,OAAO,CAAC,EAAE,MAAM,IAAI,CAAA;CAAE,GAAG;IAAE,OAAO,EAAE,MAAM,IAAI,CAAA;CAAE,QAMtG"}
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
import "./DisposePolyfill.js";
|
|
6
6
|
import { bufferCount, concatAll, concatMap, delay, of } from "rxjs";
|
|
7
7
|
import { Id64 } from "@itwin/core-bentley";
|
|
8
|
-
import { createMainThreadReleaseOnTimePassedHandler
|
|
8
|
+
import { createMainThreadReleaseOnTimePassedHandler } from "@itwin/presentation-shared";
|
|
9
9
|
/**
|
|
10
10
|
* Forms ECSql bindings from given ID's.
|
|
11
11
|
* @internal
|