@itwin/unified-selection 0.1.0 → 0.2.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.
Files changed (67) hide show
  1. package/CHANGELOG.md +10 -0
  2. package/README.md +78 -0
  3. package/lib/cjs/unified-selection/CachingHiliteSetProvider.d.ts +37 -0
  4. package/lib/cjs/unified-selection/CachingHiliteSetProvider.d.ts.map +1 -0
  5. package/lib/cjs/unified-selection/CachingHiliteSetProvider.js +65 -0
  6. package/lib/cjs/unified-selection/CachingHiliteSetProvider.js.map +1 -0
  7. package/lib/cjs/unified-selection/HiliteSetProvider.d.ts +39 -0
  8. package/lib/cjs/unified-selection/HiliteSetProvider.d.ts.map +1 -0
  9. package/lib/cjs/unified-selection/HiliteSetProvider.js +298 -0
  10. package/lib/cjs/unified-selection/HiliteSetProvider.js.map +1 -0
  11. package/lib/cjs/unified-selection/SelectionChangeEvent.d.ts +6 -4
  12. package/lib/cjs/unified-selection/SelectionChangeEvent.d.ts.map +1 -1
  13. package/lib/cjs/unified-selection/SelectionChangeEvent.js +1 -1
  14. package/lib/cjs/unified-selection/SelectionChangeEvent.js.map +1 -1
  15. package/lib/cjs/unified-selection/SelectionScope.d.ts +44 -0
  16. package/lib/cjs/unified-selection/SelectionScope.d.ts.map +1 -0
  17. package/lib/cjs/unified-selection/SelectionScope.js +160 -0
  18. package/lib/cjs/unified-selection/SelectionScope.js.map +1 -0
  19. package/lib/cjs/unified-selection/SelectionStorage.d.ts +16 -3
  20. package/lib/cjs/unified-selection/SelectionStorage.d.ts.map +1 -1
  21. package/lib/cjs/unified-selection/SelectionStorage.js +14 -3
  22. package/lib/cjs/unified-selection/SelectionStorage.js.map +1 -1
  23. package/lib/cjs/unified-selection/queries/ECMetadata.d.ts +44 -0
  24. package/lib/cjs/unified-selection/queries/ECMetadata.d.ts.map +1 -0
  25. package/lib/cjs/unified-selection/queries/ECMetadata.js +17 -0
  26. package/lib/cjs/unified-selection/queries/ECMetadata.js.map +1 -0
  27. package/lib/cjs/unified-selection/queries/ECSqlCore.d.ts +69 -0
  28. package/lib/cjs/unified-selection/queries/ECSqlCore.d.ts.map +1 -0
  29. package/lib/cjs/unified-selection/queries/ECSqlCore.js +23 -0
  30. package/lib/cjs/unified-selection/queries/ECSqlCore.js.map +1 -0
  31. package/lib/cjs/unified-selection.d.ts +4 -1
  32. package/lib/cjs/unified-selection.d.ts.map +1 -1
  33. package/lib/cjs/unified-selection.js +9 -1
  34. package/lib/cjs/unified-selection.js.map +1 -1
  35. package/lib/esm/unified-selection/CachingHiliteSetProvider.d.ts +37 -0
  36. package/lib/esm/unified-selection/CachingHiliteSetProvider.d.ts.map +1 -0
  37. package/lib/esm/unified-selection/CachingHiliteSetProvider.js +61 -0
  38. package/lib/esm/unified-selection/CachingHiliteSetProvider.js.map +1 -0
  39. package/lib/esm/unified-selection/HiliteSetProvider.d.ts +39 -0
  40. package/lib/esm/unified-selection/HiliteSetProvider.d.ts.map +1 -0
  41. package/lib/esm/unified-selection/HiliteSetProvider.js +294 -0
  42. package/lib/esm/unified-selection/HiliteSetProvider.js.map +1 -0
  43. package/lib/esm/unified-selection/SelectionChangeEvent.d.ts +6 -4
  44. package/lib/esm/unified-selection/SelectionChangeEvent.d.ts.map +1 -1
  45. package/lib/esm/unified-selection/SelectionChangeEvent.js +1 -1
  46. package/lib/esm/unified-selection/SelectionChangeEvent.js.map +1 -1
  47. package/lib/esm/unified-selection/SelectionScope.d.ts +44 -0
  48. package/lib/esm/unified-selection/SelectionScope.d.ts.map +1 -0
  49. package/lib/esm/unified-selection/SelectionScope.js +156 -0
  50. package/lib/esm/unified-selection/SelectionScope.js.map +1 -0
  51. package/lib/esm/unified-selection/SelectionStorage.d.ts +16 -3
  52. package/lib/esm/unified-selection/SelectionStorage.d.ts.map +1 -1
  53. package/lib/esm/unified-selection/SelectionStorage.js +13 -2
  54. package/lib/esm/unified-selection/SelectionStorage.js.map +1 -1
  55. package/lib/esm/unified-selection/queries/ECMetadata.d.ts +44 -0
  56. package/lib/esm/unified-selection/queries/ECMetadata.d.ts.map +1 -0
  57. package/lib/esm/unified-selection/queries/ECMetadata.js +13 -0
  58. package/lib/esm/unified-selection/queries/ECMetadata.js.map +1 -0
  59. package/lib/esm/unified-selection/queries/ECSqlCore.d.ts +69 -0
  60. package/lib/esm/unified-selection/queries/ECSqlCore.d.ts.map +1 -0
  61. package/lib/esm/unified-selection/queries/ECSqlCore.js +19 -0
  62. package/lib/esm/unified-selection/queries/ECSqlCore.js.map +1 -0
  63. package/lib/esm/unified-selection.d.ts +4 -1
  64. package/lib/esm/unified-selection.d.ts.map +1 -1
  65. package/lib/esm/unified-selection.js +4 -1
  66. package/lib/esm/unified-selection.js.map +1 -1
  67. package/package.json +9 -3
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ECSqlCore.js","sourceRoot":"","sources":["../../../../src/unified-selection/queries/ECSqlCore.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAyEhG;;GAEG;AACH,MAAM,UAAU,cAAc,CAAC,QAAgB,EAAE,GAAa,EAAE,QAAwB;IACtF,IAAI,GAAG,CAAC,MAAM,GAAG,IAAI,EAAE;QACrB,QAAQ,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,GAAG,EAAE,CAAC,CAAC;QAC7C,OAAO,mBAAmB,QAAQ,GAAG,CAAC;KACvC;IAED,IAAI,GAAG,CAAC,MAAM,KAAK,CAAC,EAAE;QACpB,OAAO,OAAO,CAAC;KAChB;IAED,GAAG,CAAC,OAAO,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,CAAC,CAAC;IAC9D,OAAO,GAAG,QAAQ,QAAQ,GAAG,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC;AAC5D,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 * Types of values that can be bound to an ECSql query.\n */\nexport type ECSqlBindingType = \"boolean\" | \"double\" | \"id\" | \"idset\" | \"int\" | \"long\" | \"string\" | \"point2d\" | \"point3d\";\n\n/**\n * Defines an ECSql binding consisting of a value and its type. Necessary to differentiate between numeric\n * types and `Id64String` vs `string`.\n */\nexport type ECSqlBinding =\n | {\n type: \"boolean\";\n value?: boolean;\n }\n | {\n type: \"double\" | \"int\" | \"long\";\n value?: number;\n }\n | {\n type: \"id\";\n value?: string;\n }\n | {\n type: \"idset\";\n value?: string[];\n }\n | {\n type: \"string\";\n value?: string;\n }\n | {\n type: \"point2d\";\n value?: { x: number; y: number };\n }\n | {\n type: \"point3d\";\n value?: { x: number; y: number; z: number };\n };\n\n/**\n * Defines requested ECSQL result row format.\n */\nexport type ECSqlQueryRowFormat = \"ECSqlPropertyNames\" | \"Indexes\";\n\n/**\n * Defines options for ECSQL query reader.\n */\nexport interface ECSqlQueryReaderOptions {\n rowFormat?: ECSqlQueryRowFormat;\n}\n\n/**\n * Represents a single row of an ECSQL query result.\n */\nexport interface ECSqlQueryRow {\n [propertyName: string]: any;\n [propertyIndex: number]: any;\n}\n\n/**\n * Represents ECSQL query results reader.\n */\nexport type ECSqlQueryReader = AsyncIterableIterator<ECSqlQueryRow>;\n\n/**\n * An interface for something that knows how to create an ECSQL query reader.\n */\nexport interface IECSqlQueryExecutor {\n createQueryReader(ecsql: string, bindings?: ECSqlBinding[], config?: ECSqlQueryReaderOptions): ECSqlQueryReader;\n}\n\n/**\n * Forms ECSql bindings from given ID's.\n */\nexport function formIdBindings(property: string, ids: string[], bindings: ECSqlBinding[]): string {\n if (ids.length > 1000) {\n bindings.push({ type: \"idset\", value: ids });\n return `InVirtualSet(?, ${property})`;\n }\n\n if (ids.length === 0) {\n return `FALSE`;\n }\n\n ids.forEach((id) => bindings.push({ type: \"id\", value: id }));\n return `${property} IN (${ids.map(() => \"?\").join(\",\")})`;\n}\n"]}
@@ -5,6 +5,9 @@
5
5
  * API for working with unified selection.
6
6
  */
7
7
  export * from "./unified-selection/Selectable";
8
- export * from "./unified-selection/SelectionStorage";
8
+ export { SelectionStorage, createStorage } from "./unified-selection/SelectionStorage";
9
+ export { createHiliteSetProvider, HiliteSet, HiliteSetProvider } from "./unified-selection/HiliteSetProvider";
10
+ export { createCachingHiliteSetProvider, CachingHiliteSetProvider } from "./unified-selection/CachingHiliteSetProvider";
11
+ export { computeSelection } from "./unified-selection/SelectionScope";
9
12
  export { StorageSelectionChangeType, StorageSelectionChangeEventArgs, StorageSelectionChangesListener, SelectionChangeEvent, } from "./unified-selection/SelectionChangeEvent";
10
13
  //# sourceMappingURL=unified-selection.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"unified-selection.d.ts","sourceRoot":"","sources":["../../src/unified-selection.ts"],"names":[],"mappings":"AAKA;;;;;GAKG;AACH,cAAc,gCAAgC,CAAC;AAC/C,cAAc,sCAAsC,CAAC;AACrD,OAAO,EACL,0BAA0B,EAC1B,+BAA+B,EAC/B,+BAA+B,EAC/B,oBAAoB,GACrB,MAAM,0CAA0C,CAAC"}
1
+ {"version":3,"file":"unified-selection.d.ts","sourceRoot":"","sources":["../../src/unified-selection.ts"],"names":[],"mappings":"AAKA;;;;;GAKG;AACH,cAAc,gCAAgC,CAAC;AAC/C,OAAO,EAAE,gBAAgB,EAAE,aAAa,EAAE,MAAM,sCAAsC,CAAC;AACvF,OAAO,EAAE,uBAAuB,EAAE,SAAS,EAAE,iBAAiB,EAAE,MAAM,uCAAuC,CAAC;AAC9G,OAAO,EAAE,8BAA8B,EAAE,wBAAwB,EAAE,MAAM,8CAA8C,CAAC;AACxH,OAAO,EAAE,gBAAgB,EAAE,MAAM,oCAAoC,CAAC;AACtE,OAAO,EACL,0BAA0B,EAC1B,+BAA+B,EAC/B,+BAA+B,EAC/B,oBAAoB,GACrB,MAAM,0CAA0C,CAAC"}
@@ -9,5 +9,8 @@
9
9
  * API for working with unified selection.
10
10
  */
11
11
  export * from "./unified-selection/Selectable";
12
- export * from "./unified-selection/SelectionStorage";
12
+ export { createStorage } from "./unified-selection/SelectionStorage";
13
+ export { createHiliteSetProvider } from "./unified-selection/HiliteSetProvider";
14
+ export { createCachingHiliteSetProvider } from "./unified-selection/CachingHiliteSetProvider";
15
+ export { computeSelection } from "./unified-selection/SelectionScope";
13
16
  //# sourceMappingURL=unified-selection.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"unified-selection.js","sourceRoot":"","sources":["../../src/unified-selection.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAEhG;;;;;GAKG;AACH,cAAc,gCAAgC,CAAC;AAC/C,cAAc,sCAAsC,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 * @module UnifiedSelection\n *\n * @docs-group-description UnifiedSelection\n * API for working with unified selection.\n */\nexport * from \"./unified-selection/Selectable\";\nexport * from \"./unified-selection/SelectionStorage\";\nexport {\n StorageSelectionChangeType,\n StorageSelectionChangeEventArgs,\n StorageSelectionChangesListener,\n SelectionChangeEvent,\n} from \"./unified-selection/SelectionChangeEvent\";\n"]}
1
+ {"version":3,"file":"unified-selection.js","sourceRoot":"","sources":["../../src/unified-selection.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAEhG;;;;;GAKG;AACH,cAAc,gCAAgC,CAAC;AAC/C,OAAO,EAAoB,aAAa,EAAE,MAAM,sCAAsC,CAAC;AACvF,OAAO,EAAE,uBAAuB,EAAgC,MAAM,uCAAuC,CAAC;AAC9G,OAAO,EAAE,8BAA8B,EAA4B,MAAM,8CAA8C,CAAC;AACxH,OAAO,EAAE,gBAAgB,EAAE,MAAM,oCAAoC,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 * @module UnifiedSelection\n *\n * @docs-group-description UnifiedSelection\n * API for working with unified selection.\n */\nexport * from \"./unified-selection/Selectable\";\nexport { SelectionStorage, createStorage } from \"./unified-selection/SelectionStorage\";\nexport { createHiliteSetProvider, HiliteSet, HiliteSetProvider } from \"./unified-selection/HiliteSetProvider\";\nexport { createCachingHiliteSetProvider, CachingHiliteSetProvider } from \"./unified-selection/CachingHiliteSetProvider\";\nexport { computeSelection } from \"./unified-selection/SelectionScope\";\nexport {\n StorageSelectionChangeType,\n StorageSelectionChangeEventArgs,\n StorageSelectionChangesListener,\n SelectionChangeEvent,\n} from \"./unified-selection/SelectionChangeEvent\";\n"]}
package/package.json CHANGED
@@ -1,7 +1,8 @@
1
1
  {
2
2
  "name": "@itwin/unified-selection",
3
- "version": "0.1.0",
3
+ "version": "0.2.0",
4
4
  "description": "Package for managing unified selection",
5
+ "license": "MIT",
5
6
  "repository": {
6
7
  "type": "git",
7
8
  "url": "https://github.com/iTwin/presentation.git",
@@ -20,7 +21,11 @@
20
21
  "main": "lib/cjs/unified-selection.js",
21
22
  "module": "lib/esm/unified-selection.js",
22
23
  "types": "lib/cjs/unified-selection.d.ts",
23
- "dependencies": {},
24
+ "dependencies": {
25
+ "@itwin/core-bentley": "^4.4.0",
26
+ "rxjs": "^7.8.1",
27
+ "rxjs-for-await": "^1.0.0"
28
+ },
24
29
  "devDependencies": {
25
30
  "@itwin/build-tools": "^4.4.0",
26
31
  "@itwin/eslint-plugin": "4.0.0-dev.48",
@@ -39,7 +44,8 @@
39
44
  "sinon": "^17.0.1",
40
45
  "sinon-chai": "^3.7.0",
41
46
  "source-map-support": "^0.5.21",
42
- "typescript": "~5.0.4"
47
+ "typescript": "~5.0.4",
48
+ "presentation-test-utilities": "^0.0.0"
43
49
  },
44
50
  "scripts": {
45
51
  "build": "npm run -s build:cjs && npm run -s build:esm",