@itwin/unified-selection 1.6.6-alpha.0 → 1.6.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/CHANGELOG.md +11 -45
  2. package/README.md +14 -10
  3. package/package.json +7 -7
package/CHANGELOG.md CHANGED
@@ -1,12 +1,20 @@
1
1
  # @itwin/unified-selection
2
2
 
3
- ## 1.6.6-alpha.0
3
+ ## 1.6.7
4
4
 
5
5
  ### Patch Changes
6
6
 
7
- - [#1180](https://github.com/iTwin/presentation/pull/1180): Version bump
7
+ - [#1215](https://github.com/iTwin/presentation/pull/1215): Update dependencies.
8
8
  - Updated dependencies:
9
- - @itwin/presentation-shared@2.0.0-alpha.6
9
+ - @itwin/presentation-shared@1.2.9
10
+
11
+ ## 1.6.6
12
+
13
+ ### Patch Changes
14
+
15
+ - [#1208](https://github.com/iTwin/presentation/pull/1208): Bump dependencies.
16
+ - Updated dependencies:
17
+ - @itwin/presentation-shared@1.2.8
10
18
 
11
19
  ## 1.6.5
12
20
 
@@ -33,12 +41,6 @@
33
41
  - Updated dependencies:
34
42
  - @itwin/presentation-shared@1.2.5
35
43
 
36
- ## 1.6.3-alpha.0
37
-
38
- ### Patch Changes
39
-
40
- - [#1130](https://github.com/iTwin/presentation/pull/1130): Version bump
41
-
42
44
  ## 1.6.2
43
45
 
44
46
  ### Patch Changes
@@ -47,14 +49,6 @@
47
49
  - Updated dependencies:
48
50
  - @itwin/presentation-shared@1.2.4
49
51
 
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
52
  ## 1.6.1
59
53
 
60
54
  ### Patch Changes
@@ -86,20 +80,6 @@
86
80
  - Updated dependencies:
87
81
  - @itwin/presentation-shared@1.2.3
88
82
 
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
83
  ## 1.5.0
104
84
 
105
85
  ### Minor Changes
@@ -137,13 +117,6 @@
137
117
  });
138
118
  ```
139
119
 
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
120
  ## 1.4.2
148
121
 
149
122
  ### Patch Changes
@@ -152,13 +125,6 @@
152
125
  - Updated dependencies:
153
126
  - @itwin/presentation-shared@1.2.2
154
127
 
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
128
  ## 1.4.1
163
129
 
164
130
  ### 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
- import { IModelConnection } from "@itwin/core-frontend";
34
- import { createIModelKey } from "@itwin/presentation-core-interop";
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
- MyComponent.onECInstanceSelected((imodel: IModelConnection, key: { className: string; id: Id64String }) => {
63
- unifiedSelection.addToSelection({ imodelKey: createIModelKey(imodel), source: "MyComponent", selectables: [key] });
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-alpha.0",
3
+ "version": "1.6.7",
4
4
  "description": "Package for managing unified selection in iTwin.js applications.",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -36,27 +36,27 @@
36
36
  "./package.json": "./package.json"
37
37
  },
38
38
  "dependencies": {
39
- "@itwin/core-bentley": "^5.5.1",
39
+ "@itwin/core-bentley": "^5.6.2",
40
40
  "rxjs": "^7.8.2",
41
41
  "rxjs-for-await": "^1.0.0",
42
- "@itwin/presentation-shared": "^2.0.0-alpha.6"
42
+ "@itwin/presentation-shared": "^1.2.9"
43
43
  },
44
44
  "devDependencies": {
45
- "@itwin/build-tools": "^5.5.1",
45
+ "@itwin/build-tools": "^5.6.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.7",
50
+ "@types/node": "^22.19.13",
51
51
  "@types/sinon": "^17.0.4",
52
52
  "@types/sinon-chai": "^4.0.0",
53
53
  "c8": "^10.1.3",
54
54
  "chai": "^5.3.3",
55
55
  "chai-as-promised": "^8.0.2",
56
56
  "cpx2": "^7.0.2",
57
- "eslint": "^9.39.2",
57
+ "eslint": "^9.39.3",
58
58
  "mocha": "^11.7.5",
59
- "rimraf": "^6.1.2",
59
+ "rimraf": "^6.1.3",
60
60
  "sinon": "^19.0.5",
61
61
  "sinon-chai": "^4.0.1",
62
62
  "typescript": "~5.7.3",