@itwin/unified-selection 1.6.6-alpha.0 → 1.6.6
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 +3 -45
- package/README.md +14 -10
- package/package.json +5 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
# @itwin/unified-selection
|
|
2
2
|
|
|
3
|
-
## 1.6.6
|
|
3
|
+
## 1.6.6
|
|
4
4
|
|
|
5
5
|
### Patch Changes
|
|
6
6
|
|
|
7
|
-
- [#
|
|
7
|
+
- [#1208](https://github.com/iTwin/presentation/pull/1208): Bump dependencies.
|
|
8
8
|
- Updated dependencies:
|
|
9
|
-
- @itwin/presentation-shared@2.
|
|
9
|
+
- @itwin/presentation-shared@1.2.8
|
|
10
10
|
|
|
11
11
|
## 1.6.5
|
|
12
12
|
|
|
@@ -33,12 +33,6 @@
|
|
|
33
33
|
- Updated dependencies:
|
|
34
34
|
- @itwin/presentation-shared@1.2.5
|
|
35
35
|
|
|
36
|
-
## 1.6.3-alpha.0
|
|
37
|
-
|
|
38
|
-
### Patch Changes
|
|
39
|
-
|
|
40
|
-
- [#1130](https://github.com/iTwin/presentation/pull/1130): Version bump
|
|
41
|
-
|
|
42
36
|
## 1.6.2
|
|
43
37
|
|
|
44
38
|
### Patch Changes
|
|
@@ -47,14 +41,6 @@
|
|
|
47
41
|
- Updated dependencies:
|
|
48
42
|
- @itwin/presentation-shared@1.2.4
|
|
49
43
|
|
|
50
|
-
## 1.6.2-alpha.0
|
|
51
|
-
|
|
52
|
-
### Patch Changes
|
|
53
|
-
|
|
54
|
-
- [#1112](https://github.com/iTwin/presentation/pull/1112): Version bump
|
|
55
|
-
- Updated dependencies:
|
|
56
|
-
- @itwin/presentation-shared@2.0.0-alpha.3
|
|
57
|
-
|
|
58
44
|
## 1.6.1
|
|
59
45
|
|
|
60
46
|
### Patch Changes
|
|
@@ -86,20 +72,6 @@
|
|
|
86
72
|
- Updated dependencies:
|
|
87
73
|
- @itwin/presentation-shared@1.2.3
|
|
88
74
|
|
|
89
|
-
## 1.5.1-alpha.1
|
|
90
|
-
|
|
91
|
-
### Patch Changes
|
|
92
|
-
|
|
93
|
-
- [#1042](https://github.com/iTwin/presentation/pull/1042): Version bump
|
|
94
|
-
- Updated dependencies:
|
|
95
|
-
- @itwin/presentation-shared@2.0.0-alpha.2
|
|
96
|
-
|
|
97
|
-
## 1.5.1-alpha.0
|
|
98
|
-
|
|
99
|
-
### Patch Changes
|
|
100
|
-
|
|
101
|
-
- [#1031](https://github.com/iTwin/presentation/pull/1031): Version bump
|
|
102
|
-
|
|
103
75
|
## 1.5.0
|
|
104
76
|
|
|
105
77
|
### Minor Changes
|
|
@@ -137,13 +109,6 @@
|
|
|
137
109
|
});
|
|
138
110
|
```
|
|
139
111
|
|
|
140
|
-
## 1.4.3-alpha.0
|
|
141
|
-
|
|
142
|
-
### Patch Changes
|
|
143
|
-
|
|
144
|
-
- Updated dependencies:
|
|
145
|
-
- @itwin/presentation-shared@2.0.0-alpha.1
|
|
146
|
-
|
|
147
112
|
## 1.4.2
|
|
148
113
|
|
|
149
114
|
### Patch Changes
|
|
@@ -152,13 +117,6 @@
|
|
|
152
117
|
- Updated dependencies:
|
|
153
118
|
- @itwin/presentation-shared@1.2.2
|
|
154
119
|
|
|
155
|
-
## 1.4.2-alpha.0
|
|
156
|
-
|
|
157
|
-
### Patch Changes
|
|
158
|
-
|
|
159
|
-
- Updated dependencies:
|
|
160
|
-
- @itwin/presentation-shared@2.0.0-alpha.0
|
|
161
|
-
|
|
162
120
|
## 1.4.1
|
|
163
121
|
|
|
164
122
|
### Patch Changes
|
package/README.md
CHANGED
|
@@ -23,21 +23,24 @@ The API consists of a few very basic concepts:
|
|
|
23
23
|
|
|
24
24
|
## Usage example
|
|
25
25
|
|
|
26
|
+
<!-- [[include: [Presentation.UnifiedSelection.Example.Imports, Presentation.UnifiedSelection.Example.CreateStorage, Presentation.UnifiedSelection.Example.CleanupOnClose, Presentation.UnifiedSelection.Example.SelectionListener, Presentation.UnifiedSelection.Example.InteractiveComponent], ts]] -->
|
|
27
|
+
<!-- BEGIN EXTRACTION -->
|
|
28
|
+
|
|
26
29
|
```ts
|
|
30
|
+
import { IModelConnection } from "@itwin/core-frontend";
|
|
31
|
+
import { createIModelKey } from "@itwin/presentation-core-interop";
|
|
32
|
+
import { createStorage, Selectables } from "@itwin/unified-selection";
|
|
33
|
+
|
|
27
34
|
// Create a global selection store (generally, somewhere in main.ts or similar). This store
|
|
28
35
|
// must be shared across all the application's components to ensure unified selection experience.
|
|
29
|
-
import { createStorage } from "@itwin/unified-selection";
|
|
30
36
|
const unifiedSelection = createStorage();
|
|
31
37
|
|
|
32
38
|
// The store should to be cleaned up when iModels are closed to free up memory, e.g.:
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
IModelConnection.onClose.addListener((imodel) => {
|
|
36
|
-
unifiedSelection.clearStorage({ imodelKey: createIModelKey(imodel) });
|
|
39
|
+
IModelConnection.onClose.addListener((iModelConnection) => {
|
|
40
|
+
unifiedSelection.clearStorage({ imodelKey: createIModelKey(iModelConnection) });
|
|
37
41
|
});
|
|
38
42
|
|
|
39
43
|
// A demo selection listener logs selection changes to the console:
|
|
40
|
-
import { Selectables } from "@itwin/unified-selection";
|
|
41
44
|
unifiedSelection.selectionChangeEvent.addListener(({ imodelKey, source, changeType, selectables }) => {
|
|
42
45
|
const suffix = `in ${imodelKey} iModel from ${source} component`;
|
|
43
46
|
const numSelectables = Selectables.size(selectables);
|
|
@@ -58,12 +61,13 @@ unifiedSelection.selectionChangeEvent.addListener(({ imodelKey, source, changeTy
|
|
|
58
61
|
});
|
|
59
62
|
|
|
60
63
|
// An interactive component that allows selecting elements, representing something in an iModel, may want to
|
|
61
|
-
// add that something to unified selection:
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
});
|
|
64
|
+
// add that something to unified selection. For example:
|
|
65
|
+
const elementKey = { className: "BisCore.PhysicalElement", id: "0x1" };
|
|
66
|
+
unifiedSelection.addToSelection({ imodelKey: createIModelKey(imodel), source: "MyComponent", selectables: [elementKey] });
|
|
65
67
|
```
|
|
66
68
|
|
|
69
|
+
<!-- END EXTRACTION -->
|
|
70
|
+
|
|
67
71
|
## Learning
|
|
68
72
|
|
|
69
73
|
Are you migrating from `SelectionManager` in `@itwin/presentation-frontend`? Check out our [Migrating from `SelectionManager`](./learning/MigrationGuide.md) learning page!
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@itwin/unified-selection",
|
|
3
|
-
"version": "1.6.6
|
|
3
|
+
"version": "1.6.6",
|
|
4
4
|
"description": "Package for managing unified selection in iTwin.js applications.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -36,18 +36,18 @@
|
|
|
36
36
|
"./package.json": "./package.json"
|
|
37
37
|
},
|
|
38
38
|
"dependencies": {
|
|
39
|
-
"@itwin/core-bentley": "^5.5.
|
|
39
|
+
"@itwin/core-bentley": "^5.5.2",
|
|
40
40
|
"rxjs": "^7.8.2",
|
|
41
41
|
"rxjs-for-await": "^1.0.0",
|
|
42
|
-
"@itwin/presentation-shared": "^2.
|
|
42
|
+
"@itwin/presentation-shared": "^1.2.8"
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|
|
45
|
-
"@itwin/build-tools": "^5.5.
|
|
45
|
+
"@itwin/build-tools": "^5.5.2",
|
|
46
46
|
"@itwin/eslint-plugin": "5.1.0",
|
|
47
47
|
"@types/chai": "^5.2.3",
|
|
48
48
|
"@types/chai-as-promised": "^8.0.2",
|
|
49
49
|
"@types/mocha": "^10.0.10",
|
|
50
|
-
"@types/node": "^22.19.
|
|
50
|
+
"@types/node": "^22.19.8",
|
|
51
51
|
"@types/sinon": "^17.0.4",
|
|
52
52
|
"@types/sinon-chai": "^4.0.0",
|
|
53
53
|
"c8": "^10.1.3",
|