@itwin/presentation-frontend 3.4.0-dev.9 → 3.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (130) hide show
  1. package/CHANGELOG.md +51 -1
  2. package/lib/cjs/presentation-frontend/ConnectivityInformationProvider.d.ts +29 -29
  3. package/lib/cjs/presentation-frontend/ConnectivityInformationProvider.js +47 -47
  4. package/lib/cjs/presentation-frontend/ConnectivityInformationProvider.js.map +1 -1
  5. package/lib/cjs/presentation-frontend/Diagnostics.d.ts +14 -12
  6. package/lib/cjs/presentation-frontend/Diagnostics.d.ts.map +1 -1
  7. package/lib/cjs/presentation-frontend/Diagnostics.js +61 -59
  8. package/lib/cjs/presentation-frontend/Diagnostics.js.map +1 -1
  9. package/lib/cjs/presentation-frontend/FrontendLoggerCategory.d.ts +12 -12
  10. package/lib/cjs/presentation-frontend/FrontendLoggerCategory.js +20 -20
  11. package/lib/cjs/presentation-frontend/FrontendLoggerCategory.js.map +1 -1
  12. package/lib/cjs/presentation-frontend/IpcRequestsHandler.d.ts +10 -10
  13. package/lib/cjs/presentation-frontend/IpcRequestsHandler.js +42 -42
  14. package/lib/cjs/presentation-frontend/IpcRequestsHandler.js.map +1 -1
  15. package/lib/cjs/presentation-frontend/LocalizationHelper.d.ts +10 -14
  16. package/lib/cjs/presentation-frontend/LocalizationHelper.d.ts.map +1 -1
  17. package/lib/cjs/presentation-frontend/LocalizationHelper.js +31 -57
  18. package/lib/cjs/presentation-frontend/LocalizationHelper.js.map +1 -1
  19. package/lib/cjs/presentation-frontend/Presentation.d.ts +75 -75
  20. package/lib/cjs/presentation-frontend/Presentation.js +162 -162
  21. package/lib/cjs/presentation-frontend/Presentation.js.map +1 -1
  22. package/lib/cjs/presentation-frontend/PresentationManager.d.ts +180 -179
  23. package/lib/cjs/presentation-frontend/PresentationManager.d.ts.map +1 -1
  24. package/lib/cjs/presentation-frontend/PresentationManager.js +419 -413
  25. package/lib/cjs/presentation-frontend/PresentationManager.js.map +1 -1
  26. package/lib/cjs/presentation-frontend/RulesetManager.d.ts +60 -60
  27. package/lib/cjs/presentation-frontend/RulesetManager.js +85 -85
  28. package/lib/cjs/presentation-frontend/RulesetManager.js.map +1 -1
  29. package/lib/cjs/presentation-frontend/RulesetVariablesManager.d.ts +143 -143
  30. package/lib/cjs/presentation-frontend/RulesetVariablesManager.js +195 -195
  31. package/lib/cjs/presentation-frontend/RulesetVariablesManager.js.map +1 -1
  32. package/lib/cjs/presentation-frontend/StateTracker.d.ts +23 -23
  33. package/lib/cjs/presentation-frontend/StateTracker.js +74 -74
  34. package/lib/cjs/presentation-frontend/StateTracker.js.map +1 -1
  35. package/lib/cjs/presentation-frontend/favorite-properties/FavoritePropertiesManager.d.ts +132 -132
  36. package/lib/cjs/presentation-frontend/favorite-properties/FavoritePropertiesManager.js +525 -525
  37. package/lib/cjs/presentation-frontend/favorite-properties/FavoritePropertiesManager.js.map +1 -1
  38. package/lib/cjs/presentation-frontend/favorite-properties/FavoritePropertiesStorage.d.ts +111 -111
  39. package/lib/cjs/presentation-frontend/favorite-properties/FavoritePropertiesStorage.js +293 -293
  40. package/lib/cjs/presentation-frontend/favorite-properties/FavoritePropertiesStorage.js.map +1 -1
  41. package/lib/cjs/presentation-frontend/selection/HiliteRules.json +172 -172
  42. package/lib/cjs/presentation-frontend/selection/HiliteSetProvider.d.ts +52 -52
  43. package/lib/cjs/presentation-frontend/selection/HiliteSetProvider.js +97 -97
  44. package/lib/cjs/presentation-frontend/selection/HiliteSetProvider.js.map +1 -1
  45. package/lib/cjs/presentation-frontend/selection/ISelectionProvider.d.ts +19 -19
  46. package/lib/cjs/presentation-frontend/selection/ISelectionProvider.js +9 -9
  47. package/lib/cjs/presentation-frontend/selection/ISelectionProvider.js.map +1 -1
  48. package/lib/cjs/presentation-frontend/selection/SelectionChangeEvent.d.ts +52 -52
  49. package/lib/cjs/presentation-frontend/selection/SelectionChangeEvent.js +33 -33
  50. package/lib/cjs/presentation-frontend/selection/SelectionChangeEvent.js.map +1 -1
  51. package/lib/cjs/presentation-frontend/selection/SelectionHandler.d.ts +103 -103
  52. package/lib/cjs/presentation-frontend/selection/SelectionHandler.js +108 -108
  53. package/lib/cjs/presentation-frontend/selection/SelectionHandler.js.map +1 -1
  54. package/lib/cjs/presentation-frontend/selection/SelectionHelper.d.ts +14 -14
  55. package/lib/cjs/presentation-frontend/selection/SelectionHelper.js +37 -37
  56. package/lib/cjs/presentation-frontend/selection/SelectionHelper.js.map +1 -1
  57. package/lib/cjs/presentation-frontend/selection/SelectionManager.d.ts +139 -139
  58. package/lib/cjs/presentation-frontend/selection/SelectionManager.js +414 -414
  59. package/lib/cjs/presentation-frontend/selection/SelectionManager.js.map +1 -1
  60. package/lib/cjs/presentation-frontend/selection/SelectionScopesManager.d.ts +59 -59
  61. package/lib/cjs/presentation-frontend/selection/SelectionScopesManager.js +91 -91
  62. package/lib/cjs/presentation-frontend/selection/SelectionScopesManager.js.map +1 -1
  63. package/lib/cjs/presentation-frontend.d.ts +34 -34
  64. package/lib/cjs/presentation-frontend.js +50 -50
  65. package/lib/cjs/presentation-frontend.js.map +1 -1
  66. package/lib/esm/presentation-frontend/ConnectivityInformationProvider.d.ts +29 -29
  67. package/lib/esm/presentation-frontend/ConnectivityInformationProvider.js +43 -43
  68. package/lib/esm/presentation-frontend/ConnectivityInformationProvider.js.map +1 -1
  69. package/lib/esm/presentation-frontend/Diagnostics.d.ts +14 -12
  70. package/lib/esm/presentation-frontend/Diagnostics.d.ts.map +1 -1
  71. package/lib/esm/presentation-frontend/Diagnostics.js +56 -54
  72. package/lib/esm/presentation-frontend/Diagnostics.js.map +1 -1
  73. package/lib/esm/presentation-frontend/FrontendLoggerCategory.d.ts +12 -12
  74. package/lib/esm/presentation-frontend/FrontendLoggerCategory.js +17 -17
  75. package/lib/esm/presentation-frontend/FrontendLoggerCategory.js.map +1 -1
  76. package/lib/esm/presentation-frontend/IpcRequestsHandler.d.ts +10 -10
  77. package/lib/esm/presentation-frontend/IpcRequestsHandler.js +38 -38
  78. package/lib/esm/presentation-frontend/IpcRequestsHandler.js.map +1 -1
  79. package/lib/esm/presentation-frontend/LocalizationHelper.d.ts +10 -14
  80. package/lib/esm/presentation-frontend/LocalizationHelper.d.ts.map +1 -1
  81. package/lib/esm/presentation-frontend/LocalizationHelper.js +27 -53
  82. package/lib/esm/presentation-frontend/LocalizationHelper.js.map +1 -1
  83. package/lib/esm/presentation-frontend/Presentation.d.ts +75 -75
  84. package/lib/esm/presentation-frontend/Presentation.js +158 -158
  85. package/lib/esm/presentation-frontend/Presentation.js.map +1 -1
  86. package/lib/esm/presentation-frontend/PresentationManager.d.ts +180 -179
  87. package/lib/esm/presentation-frontend/PresentationManager.d.ts.map +1 -1
  88. package/lib/esm/presentation-frontend/PresentationManager.js +414 -408
  89. package/lib/esm/presentation-frontend/PresentationManager.js.map +1 -1
  90. package/lib/esm/presentation-frontend/RulesetManager.d.ts +60 -60
  91. package/lib/esm/presentation-frontend/RulesetManager.js +81 -81
  92. package/lib/esm/presentation-frontend/RulesetManager.js.map +1 -1
  93. package/lib/esm/presentation-frontend/RulesetVariablesManager.d.ts +143 -143
  94. package/lib/esm/presentation-frontend/RulesetVariablesManager.js +191 -191
  95. package/lib/esm/presentation-frontend/RulesetVariablesManager.js.map +1 -1
  96. package/lib/esm/presentation-frontend/StateTracker.d.ts +23 -23
  97. package/lib/esm/presentation-frontend/StateTracker.js +70 -70
  98. package/lib/esm/presentation-frontend/StateTracker.js.map +1 -1
  99. package/lib/esm/presentation-frontend/favorite-properties/FavoritePropertiesManager.d.ts +132 -132
  100. package/lib/esm/presentation-frontend/favorite-properties/FavoritePropertiesManager.js +519 -519
  101. package/lib/esm/presentation-frontend/favorite-properties/FavoritePropertiesManager.js.map +1 -1
  102. package/lib/esm/presentation-frontend/favorite-properties/FavoritePropertiesStorage.d.ts +111 -111
  103. package/lib/esm/presentation-frontend/favorite-properties/FavoritePropertiesStorage.js +285 -285
  104. package/lib/esm/presentation-frontend/favorite-properties/FavoritePropertiesStorage.js.map +1 -1
  105. package/lib/esm/presentation-frontend/selection/HiliteRules.json +172 -172
  106. package/lib/esm/presentation-frontend/selection/HiliteSetProvider.d.ts +52 -52
  107. package/lib/esm/presentation-frontend/selection/HiliteSetProvider.js +93 -93
  108. package/lib/esm/presentation-frontend/selection/HiliteSetProvider.js.map +1 -1
  109. package/lib/esm/presentation-frontend/selection/ISelectionProvider.d.ts +19 -19
  110. package/lib/esm/presentation-frontend/selection/ISelectionProvider.js +8 -8
  111. package/lib/esm/presentation-frontend/selection/ISelectionProvider.js.map +1 -1
  112. package/lib/esm/presentation-frontend/selection/SelectionChangeEvent.d.ts +52 -52
  113. package/lib/esm/presentation-frontend/selection/SelectionChangeEvent.js +29 -29
  114. package/lib/esm/presentation-frontend/selection/SelectionChangeEvent.js.map +1 -1
  115. package/lib/esm/presentation-frontend/selection/SelectionHandler.d.ts +103 -103
  116. package/lib/esm/presentation-frontend/selection/SelectionHandler.js +104 -104
  117. package/lib/esm/presentation-frontend/selection/SelectionHandler.js.map +1 -1
  118. package/lib/esm/presentation-frontend/selection/SelectionHelper.d.ts +14 -14
  119. package/lib/esm/presentation-frontend/selection/SelectionHelper.js +33 -33
  120. package/lib/esm/presentation-frontend/selection/SelectionHelper.js.map +1 -1
  121. package/lib/esm/presentation-frontend/selection/SelectionManager.d.ts +139 -139
  122. package/lib/esm/presentation-frontend/selection/SelectionManager.js +409 -409
  123. package/lib/esm/presentation-frontend/selection/SelectionManager.js.map +1 -1
  124. package/lib/esm/presentation-frontend/selection/SelectionScopesManager.d.ts +59 -59
  125. package/lib/esm/presentation-frontend/selection/SelectionScopesManager.js +85 -85
  126. package/lib/esm/presentation-frontend/selection/SelectionScopesManager.js.map +1 -1
  127. package/lib/esm/presentation-frontend.d.ts +34 -34
  128. package/lib/esm/presentation-frontend.js +38 -38
  129. package/lib/esm/presentation-frontend.js.map +1 -1
  130. package/package.json +15 -15
@@ -1,98 +1,98 @@
1
- "use strict";
2
- /*---------------------------------------------------------------------------------------------
3
- * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
4
- * See LICENSE.md in the project root for license terms and full copyright notice.
5
- *--------------------------------------------------------------------------------------------*/
6
- /** @packageDocumentation
7
- * @module UnifiedSelection
8
- */
9
- Object.defineProperty(exports, "__esModule", { value: true });
10
- exports.HiliteSetProvider = exports.HILITE_RULESET = void 0;
11
- const presentation_common_1 = require("@itwin/presentation-common");
12
- const Presentation_1 = require("../Presentation");
13
- const SelectionManager_1 = require("./SelectionManager");
14
- /** @internal */
15
- // eslint-disable-next-line @typescript-eslint/no-var-requires
16
- exports.HILITE_RULESET = require("./HiliteRules.json");
17
- /**
18
- * Presentation-based provider which uses presentation ruleset to determine
19
- * what `HiliteSet` should be hilited in the graphics viewport based on the
20
- * supplied `KeySet`.
21
- *
22
- * @public
23
- */
24
- class HiliteSetProvider {
25
- constructor(props) {
26
- this._imodel = props.imodel;
27
- }
28
- /**
29
- * Create a hilite set provider for the specified iModel.
30
- */
31
- static create(props) { return new HiliteSetProvider(props); }
32
- async getRecords(keys) {
33
- const descriptor = {
34
- displayType: presentation_common_1.DefaultContentDisplayTypes.Viewport,
35
- contentFlags: presentation_common_1.ContentFlags.KeysOnly,
36
- };
37
- const options = {
38
- imodel: this._imodel,
39
- rulesetOrId: exports.HILITE_RULESET,
40
- descriptor,
41
- };
42
- const contentPromises = new Array();
43
- keys.forEachBatch(presentation_common_1.DEFAULT_KEYS_BATCH_SIZE, (batch) => {
44
- contentPromises.push(Presentation_1.Presentation.presentation.getContent({ ...options, keys: batch }));
45
- });
46
- return (await Promise.all(contentPromises)).reduce((items, content) => {
47
- if (content)
48
- items.push(...content.contentSet);
49
- return items;
50
- }, new Array());
51
- }
52
- createHiliteSet(records, transientIds) {
53
- if (!records.length)
54
- return { elements: transientIds };
55
- const modelIds = new Array();
56
- const subCategoryIds = new Array();
57
- const elementIds = transientIds; // note: not making a copy here since we're throwing away `transientIds` anyway
58
- records.forEach((rec) => {
59
- const ids = isModelRecord(rec) ? modelIds : isSubCategoryRecord(rec) ? subCategoryIds : elementIds;
60
- rec.primaryKeys.forEach((pk) => ids.push(pk.id));
61
- });
62
- return {
63
- models: modelIds.length ? modelIds : undefined,
64
- subCategories: subCategoryIds.length ? subCategoryIds : undefined,
65
- elements: elementIds.length ? elementIds : undefined,
66
- };
67
- }
68
- /**
69
- * Get hilite set for instances and/or nodes whose keys are specified in the
70
- * given KeySet.
71
- *
72
- * Note: The provider caches result of the last request, so subsequent requests
73
- * for the same input doesn't cost.
74
- */
75
- async getHiliteSet(selection) {
76
- const selectionGuid = selection.guid;
77
- if (!this._cached || this._cached.keysGuid !== selectionGuid) {
78
- // need to create a new set without transients
79
- const transientIds = new Array();
80
- const keys = new presentation_common_1.KeySet();
81
- keys.add(selection, (key) => {
82
- if (presentation_common_1.Key.isInstanceKey(key) && key.className === SelectionManager_1.TRANSIENT_ELEMENT_CLASSNAME) {
83
- transientIds.push(key.id);
84
- return false;
85
- }
86
- return true;
87
- });
88
- const records = await this.getRecords(keys);
89
- const result = this.createHiliteSet(records, transientIds);
90
- this._cached = { keysGuid: selectionGuid, result };
91
- }
92
- return this._cached.result;
93
- }
94
- }
95
- exports.HiliteSetProvider = HiliteSetProvider;
96
- const isModelRecord = (rec) => (rec.extendedData && rec.extendedData.isModel);
97
- const isSubCategoryRecord = (rec) => (rec.extendedData && rec.extendedData.isSubCategory);
1
+ "use strict";
2
+ /*---------------------------------------------------------------------------------------------
3
+ * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
4
+ * See LICENSE.md in the project root for license terms and full copyright notice.
5
+ *--------------------------------------------------------------------------------------------*/
6
+ /** @packageDocumentation
7
+ * @module UnifiedSelection
8
+ */
9
+ Object.defineProperty(exports, "__esModule", { value: true });
10
+ exports.HiliteSetProvider = exports.HILITE_RULESET = void 0;
11
+ const presentation_common_1 = require("@itwin/presentation-common");
12
+ const Presentation_1 = require("../Presentation");
13
+ const SelectionManager_1 = require("./SelectionManager");
14
+ /** @internal */
15
+ // eslint-disable-next-line @typescript-eslint/no-var-requires
16
+ exports.HILITE_RULESET = require("./HiliteRules.json");
17
+ /**
18
+ * Presentation-based provider which uses presentation ruleset to determine
19
+ * what `HiliteSet` should be hilited in the graphics viewport based on the
20
+ * supplied `KeySet`.
21
+ *
22
+ * @public
23
+ */
24
+ class HiliteSetProvider {
25
+ constructor(props) {
26
+ this._imodel = props.imodel;
27
+ }
28
+ /**
29
+ * Create a hilite set provider for the specified iModel.
30
+ */
31
+ static create(props) { return new HiliteSetProvider(props); }
32
+ async getRecords(keys) {
33
+ const descriptor = {
34
+ displayType: presentation_common_1.DefaultContentDisplayTypes.Viewport,
35
+ contentFlags: presentation_common_1.ContentFlags.KeysOnly,
36
+ };
37
+ const options = {
38
+ imodel: this._imodel,
39
+ rulesetOrId: exports.HILITE_RULESET,
40
+ descriptor,
41
+ };
42
+ const contentPromises = new Array();
43
+ keys.forEachBatch(presentation_common_1.DEFAULT_KEYS_BATCH_SIZE, (batch) => {
44
+ contentPromises.push(Presentation_1.Presentation.presentation.getContent({ ...options, keys: batch }));
45
+ });
46
+ return (await Promise.all(contentPromises)).reduce((items, content) => {
47
+ if (content)
48
+ items.push(...content.contentSet);
49
+ return items;
50
+ }, new Array());
51
+ }
52
+ createHiliteSet(records, transientIds) {
53
+ if (!records.length)
54
+ return { elements: transientIds };
55
+ const modelIds = new Array();
56
+ const subCategoryIds = new Array();
57
+ const elementIds = transientIds; // note: not making a copy here since we're throwing away `transientIds` anyway
58
+ records.forEach((rec) => {
59
+ const ids = isModelRecord(rec) ? modelIds : isSubCategoryRecord(rec) ? subCategoryIds : elementIds;
60
+ rec.primaryKeys.forEach((pk) => ids.push(pk.id));
61
+ });
62
+ return {
63
+ models: modelIds.length ? modelIds : undefined,
64
+ subCategories: subCategoryIds.length ? subCategoryIds : undefined,
65
+ elements: elementIds.length ? elementIds : undefined,
66
+ };
67
+ }
68
+ /**
69
+ * Get hilite set for instances and/or nodes whose keys are specified in the
70
+ * given KeySet.
71
+ *
72
+ * Note: The provider caches result of the last request, so subsequent requests
73
+ * for the same input doesn't cost.
74
+ */
75
+ async getHiliteSet(selection) {
76
+ const selectionGuid = selection.guid;
77
+ if (!this._cached || this._cached.keysGuid !== selectionGuid) {
78
+ // need to create a new set without transients
79
+ const transientIds = new Array();
80
+ const keys = new presentation_common_1.KeySet();
81
+ keys.add(selection, (key) => {
82
+ if (presentation_common_1.Key.isInstanceKey(key) && key.className === SelectionManager_1.TRANSIENT_ELEMENT_CLASSNAME) {
83
+ transientIds.push(key.id);
84
+ return false;
85
+ }
86
+ return true;
87
+ });
88
+ const records = await this.getRecords(keys);
89
+ const result = this.createHiliteSet(records, transientIds);
90
+ this._cached = { keysGuid: selectionGuid, result };
91
+ }
92
+ return this._cached.result;
93
+ }
94
+ }
95
+ exports.HiliteSetProvider = HiliteSetProvider;
96
+ const isModelRecord = (rec) => (rec.extendedData && rec.extendedData.isModel);
97
+ const isSubCategoryRecord = (rec) => (rec.extendedData && rec.extendedData.isSubCategory);
98
98
  //# sourceMappingURL=HiliteSetProvider.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"HiliteSetProvider.js","sourceRoot":"","sources":["../../../../src/presentation-frontend/selection/HiliteSetProvider.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAIH,oEAEoC;AACpC,kDAA+C;AAC/C,yDAAiE;AAEjE,gBAAgB;AAChB,8DAA8D;AACjD,QAAA,cAAc,GAAY,OAAO,CAAC,oBAAoB,CAAC,CAAC;AAsBrE;;;;;;GAMG;AACH,MAAa,iBAAiB;IAI5B,YAAoB,KAA6B;QAC/C,IAAI,CAAC,OAAO,GAAG,KAAK,CAAC,MAAM,CAAC;IAC9B,CAAC;IAED;;OAEG;IACI,MAAM,CAAC,MAAM,CAAC,KAA6B,IAAI,OAAO,IAAI,iBAAiB,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;IAEpF,KAAK,CAAC,UAAU,CAAC,IAAY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CAAC,OAAO,EAAE,YAAY,CAAC,CAAC;YAC3D,IAAI,CAAC,OAAO,GAAG,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,EAAE,CAAC;SACpD;QACD,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC;IAC7B,CAAC;CACF;AA9ED,8CA8EC;AAED,MAAM,aAAa,GAAG,CAAC,GAAS,EAAE,EAAE,CAAC,CAAC,GAAG,CAAC,YAAY,IAAI,GAAG,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC;AAEpF,MAAM,mBAAmB,GAAG,CAAC,GAAS,EAAE,EAAE,CAAC,CAAC,GAAG,CAAC,YAAY,IAAI,GAAG,CAAC,YAAY,CAAC,aAAa,CAAC,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module UnifiedSelection\r\n */\r\n\r\nimport { Id64String } from \"@itwin/core-bentley\";\r\nimport { IModelConnection } from \"@itwin/core-frontend\";\r\nimport {\r\n Content, ContentFlags, DEFAULT_KEYS_BATCH_SIZE, DefaultContentDisplayTypes, DescriptorOverrides, Item, Key, KeySet, Ruleset,\r\n} from \"@itwin/presentation-common\";\r\nimport { Presentation } from \"../Presentation\";\r\nimport { TRANSIENT_ELEMENT_CLASSNAME } from \"./SelectionManager\";\r\n\r\n/** @internal */\r\n// eslint-disable-next-line @typescript-eslint/no-var-requires\r\nexport const HILITE_RULESET: Ruleset = require(\"./HiliteRules.json\");\r\n\r\n/**\r\n * A set of model, subcategory and element ids that can be used for specifying\r\n * viewport hilite.\r\n *\r\n * @public\r\n */\r\nexport interface HiliteSet {\r\n models?: Id64String[];\r\n subCategories?: Id64String[];\r\n elements?: Id64String[];\r\n}\r\n\r\n/**\r\n * Properties for creating a `HiliteSetProvider` instance.\r\n * @public\r\n */\r\nexport interface HiliteSetProviderProps {\r\n imodel: IModelConnection;\r\n}\r\n\r\n/**\r\n * Presentation-based provider which uses presentation ruleset to determine\r\n * what `HiliteSet` should be hilited in the graphics viewport based on the\r\n * supplied `KeySet`.\r\n *\r\n * @public\r\n */\r\nexport class HiliteSetProvider {\r\n private _imodel: IModelConnection;\r\n private _cached: undefined | { keysGuid: string, result: HiliteSet };\r\n\r\n private constructor(props: HiliteSetProviderProps) {\r\n this._imodel = props.imodel;\r\n }\r\n\r\n /**\r\n * Create a hilite set provider for the specified iModel.\r\n */\r\n public static create(props: HiliteSetProviderProps) { return new HiliteSetProvider(props); }\r\n\r\n private async getRecords(keys: KeySet): Promise<Item[]> {\r\n const descriptor: DescriptorOverrides = {\r\n displayType: DefaultContentDisplayTypes.Viewport,\r\n contentFlags: ContentFlags.KeysOnly,\r\n };\r\n const options = {\r\n imodel: this._imodel,\r\n rulesetOrId: HILITE_RULESET,\r\n descriptor,\r\n };\r\n const contentPromises = new Array<Promise<Content | undefined>>();\r\n keys.forEachBatch(DEFAULT_KEYS_BATCH_SIZE, (batch: KeySet) => {\r\n contentPromises.push(Presentation.presentation.getContent({ ...options, keys: batch }));\r\n });\r\n return (await Promise.all(contentPromises)).reduce((items, content) => {\r\n if (content)\r\n items.push(...content.contentSet);\r\n return items;\r\n }, new Array<Item>());\r\n }\r\n\r\n private createHiliteSet(records: Item[], transientIds: Id64String[]) {\r\n if (!records.length)\r\n return { elements: transientIds };\r\n\r\n const modelIds = new Array<Id64String>();\r\n const subCategoryIds = new Array<Id64String>();\r\n const elementIds = transientIds; // note: not making a copy here since we're throwing away `transientIds` anyway\r\n records.forEach((rec) => {\r\n const ids = isModelRecord(rec) ? modelIds : isSubCategoryRecord(rec) ? subCategoryIds : elementIds;\r\n rec.primaryKeys.forEach((pk) => ids.push(pk.id));\r\n });\r\n return {\r\n models: modelIds.length ? modelIds : undefined,\r\n subCategories: subCategoryIds.length ? subCategoryIds : undefined,\r\n elements: elementIds.length ? elementIds : undefined,\r\n };\r\n }\r\n\r\n /**\r\n * Get hilite set for instances and/or nodes whose keys are specified in the\r\n * given KeySet.\r\n *\r\n * Note: The provider caches result of the last request, so subsequent requests\r\n * for the same input doesn't cost.\r\n */\r\n public async getHiliteSet(selection: Readonly<KeySet>): Promise<HiliteSet> {\r\n const selectionGuid = selection.guid;\r\n if (!this._cached || this._cached.keysGuid !== selectionGuid) {\r\n // need to create a new set without transients\r\n const transientIds = new Array<Id64String>();\r\n const keys = new KeySet();\r\n keys.add(selection, (key: Key) => {\r\n if (Key.isInstanceKey(key) && key.className === TRANSIENT_ELEMENT_CLASSNAME) {\r\n transientIds.push(key.id);\r\n return false;\r\n }\r\n return true;\r\n });\r\n const records = await this.getRecords(keys);\r\n const result = this.createHiliteSet(records, transientIds);\r\n this._cached = { keysGuid: selectionGuid, result };\r\n }\r\n return this._cached.result;\r\n }\r\n}\r\n\r\nconst isModelRecord = (rec: Item) => (rec.extendedData && rec.extendedData.isModel);\r\n\r\nconst isSubCategoryRecord = (rec: Item) => (rec.extendedData && rec.extendedData.isSubCategory);\r\n"]}
1
+ {"version":3,"file":"HiliteSetProvider.js","sourceRoot":"","sources":["../../../../src/presentation-frontend/selection/HiliteSetProvider.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAIH,oEAEoC;AACpC,kDAA+C;AAC/C,yDAAiE;AAEjE,gBAAgB;AAChB,8DAA8D;AACjD,QAAA,cAAc,GAAY,OAAO,CAAC,oBAAoB,CAAC,CAAC;AAsBrE;;;;;;GAMG;AACH,MAAa,iBAAiB;IAI5B,YAAoB,KAA6B;QAC/C,IAAI,CAAC,OAAO,GAAG,KAAK,CAAC,MAAM,CAAC;IAC9B,CAAC;IAED;;OAEG;IACI,MAAM,CAAC,MAAM,CAAC,KAA6B,IAAI,OAAO,IAAI,iBAAiB,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;IAEpF,KAAK,CAAC,UAAU,CAAC,IAAY;QACnC,MAAM,UAAU,GAAwB;Y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C,CAAC;YAC3D,IAAI,CAAC,OAAO,GAAG,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,EAAE,CAAC;SACpD;QACD,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC;IAC7B,CAAC;CACF;AA9ED,8CA8EC;AAED,MAAM,aAAa,GAAG,CAAC,GAAS,EAAE,EAAE,CAAC,CAAC,GAAG,CAAC,YAAY,IAAI,GAAG,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC;AAEpF,MAAM,mBAAmB,GAAG,CAAC,GAAS,EAAE,EAAE,CAAC,CAAC,GAAG,CAAC,YAAY,IAAI,GAAG,CAAC,YAAY,CAAC,aAAa,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/** @packageDocumentation\n * @module UnifiedSelection\n */\n\nimport { Id64String } from \"@itwin/core-bentley\";\nimport { IModelConnection } from \"@itwin/core-frontend\";\nimport {\n Content, ContentFlags, DEFAULT_KEYS_BATCH_SIZE, DefaultContentDisplayTypes, DescriptorOverrides, Item, Key, KeySet, Ruleset,\n} from \"@itwin/presentation-common\";\nimport { Presentation } from \"../Presentation\";\nimport { TRANSIENT_ELEMENT_CLASSNAME } from \"./SelectionManager\";\n\n/** @internal */\n// eslint-disable-next-line @typescript-eslint/no-var-requires\nexport const HILITE_RULESET: Ruleset = require(\"./HiliteRules.json\");\n\n/**\n * A set of model, subcategory and element ids that can be used for specifying\n * viewport hilite.\n *\n * @public\n */\nexport interface HiliteSet {\n models?: Id64String[];\n subCategories?: Id64String[];\n elements?: Id64String[];\n}\n\n/**\n * Properties for creating a `HiliteSetProvider` instance.\n * @public\n */\nexport interface HiliteSetProviderProps {\n imodel: IModelConnection;\n}\n\n/**\n * Presentation-based provider which uses presentation ruleset to determine\n * what `HiliteSet` should be hilited in the graphics viewport based on the\n * supplied `KeySet`.\n *\n * @public\n */\nexport class HiliteSetProvider {\n private _imodel: IModelConnection;\n private _cached: undefined | { keysGuid: string, result: HiliteSet };\n\n private constructor(props: HiliteSetProviderProps) {\n this._imodel = props.imodel;\n }\n\n /**\n * Create a hilite set provider for the specified iModel.\n */\n public static create(props: HiliteSetProviderProps) { return new HiliteSetProvider(props); }\n\n private async getRecords(keys: KeySet): Promise<Item[]> {\n const descriptor: DescriptorOverrides = {\n displayType: DefaultContentDisplayTypes.Viewport,\n contentFlags: ContentFlags.KeysOnly,\n };\n const options = {\n imodel: this._imodel,\n rulesetOrId: HILITE_RULESET,\n descriptor,\n };\n const contentPromises = new Array<Promise<Content | undefined>>();\n keys.forEachBatch(DEFAULT_KEYS_BATCH_SIZE, (batch: KeySet) => {\n contentPromises.push(Presentation.presentation.getContent({ ...options, keys: batch }));\n });\n return (await Promise.all(contentPromises)).reduce((items, content) => {\n if (content)\n items.push(...content.contentSet);\n return items;\n }, new Array<Item>());\n }\n\n private createHiliteSet(records: Item[], transientIds: Id64String[]) {\n if (!records.length)\n return { elements: transientIds };\n\n const modelIds = new Array<Id64String>();\n const subCategoryIds = new Array<Id64String>();\n const elementIds = transientIds; // note: not making a copy here since we're throwing away `transientIds` anyway\n records.forEach((rec) => {\n const ids = isModelRecord(rec) ? modelIds : isSubCategoryRecord(rec) ? subCategoryIds : elementIds;\n rec.primaryKeys.forEach((pk) => ids.push(pk.id));\n });\n return {\n models: modelIds.length ? modelIds : undefined,\n subCategories: subCategoryIds.length ? subCategoryIds : undefined,\n elements: elementIds.length ? elementIds : undefined,\n };\n }\n\n /**\n * Get hilite set for instances and/or nodes whose keys are specified in the\n * given KeySet.\n *\n * Note: The provider caches result of the last request, so subsequent requests\n * for the same input doesn't cost.\n */\n public async getHiliteSet(selection: Readonly<KeySet>): Promise<HiliteSet> {\n const selectionGuid = selection.guid;\n if (!this._cached || this._cached.keysGuid !== selectionGuid) {\n // need to create a new set without transients\n const transientIds = new Array<Id64String>();\n const keys = new KeySet();\n keys.add(selection, (key: Key) => {\n if (Key.isInstanceKey(key) && key.className === TRANSIENT_ELEMENT_CLASSNAME) {\n transientIds.push(key.id);\n return false;\n }\n return true;\n });\n const records = await this.getRecords(keys);\n const result = this.createHiliteSet(records, transientIds);\n this._cached = { keysGuid: selectionGuid, result };\n }\n return this._cached.result;\n }\n}\n\nconst isModelRecord = (rec: Item) => (rec.extendedData && rec.extendedData.isModel);\n\nconst isSubCategoryRecord = (rec: Item) => (rec.extendedData && rec.extendedData.isSubCategory);\n"]}
@@ -1,20 +1,20 @@
1
- /** @packageDocumentation
2
- * @module UnifiedSelection
3
- */
4
- import { IModelConnection } from "@itwin/core-frontend";
5
- import { KeySet } from "@itwin/presentation-common";
6
- import { SelectionChangeEvent } from "./SelectionChangeEvent";
7
- /**
8
- * Selection provider interface which provides main selection and sub-selection.
9
- * @public
10
- */
11
- export interface ISelectionProvider {
12
- /** An event that's fired when selection changes */
13
- selectionChange: SelectionChangeEvent;
14
- /** Get the selection stored in the provider.
15
- * @param imodel iModel connection which the selection is associated with.
16
- * @param level Level of the selection (see [selection levels documentation section]($docs/presentation/unified-selection/index#selection-levels))
17
- */
18
- getSelection(imodel: IModelConnection, level: number): Readonly<KeySet>;
19
- }
1
+ /** @packageDocumentation
2
+ * @module UnifiedSelection
3
+ */
4
+ import { IModelConnection } from "@itwin/core-frontend";
5
+ import { KeySet } from "@itwin/presentation-common";
6
+ import { SelectionChangeEvent } from "./SelectionChangeEvent";
7
+ /**
8
+ * Selection provider interface which provides main selection and sub-selection.
9
+ * @public
10
+ */
11
+ export interface ISelectionProvider {
12
+ /** An event that's fired when selection changes */
13
+ selectionChange: SelectionChangeEvent;
14
+ /** Get the selection stored in the provider.
15
+ * @param imodel iModel connection which the selection is associated with.
16
+ * @param level Level of the selection (see [selection levels documentation section]($docs/presentation/unified-selection/index#selection-levels))
17
+ */
18
+ getSelection(imodel: IModelConnection, level: number): Readonly<KeySet>;
19
+ }
20
20
  //# sourceMappingURL=ISelectionProvider.d.ts.map
@@ -1,10 +1,10 @@
1
- "use strict";
2
- /*---------------------------------------------------------------------------------------------
3
- * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
4
- * See LICENSE.md in the project root for license terms and full copyright notice.
5
- *--------------------------------------------------------------------------------------------*/
6
- /** @packageDocumentation
7
- * @module UnifiedSelection
8
- */
9
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ "use strict";
2
+ /*---------------------------------------------------------------------------------------------
3
+ * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
4
+ * See LICENSE.md in the project root for license terms and full copyright notice.
5
+ *--------------------------------------------------------------------------------------------*/
6
+ /** @packageDocumentation
7
+ * @module UnifiedSelection
8
+ */
9
+ Object.defineProperty(exports, "__esModule", { value: true });
10
10
  //# sourceMappingURL=ISelectionProvider.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ISelectionProvider.js","sourceRoot":"","sources":["../../../../src/presentation-frontend/selection/ISelectionProvider.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module UnifiedSelection\r\n */\r\n\r\nimport { IModelConnection } from \"@itwin/core-frontend\";\r\nimport { KeySet } from \"@itwin/presentation-common\";\r\nimport { SelectionChangeEvent } from \"./SelectionChangeEvent\";\r\n\r\n/**\r\n * Selection provider interface which provides main selection and sub-selection.\r\n * @public\r\n */\r\nexport interface ISelectionProvider {\r\n /** An event that's fired when selection changes */\r\n selectionChange: SelectionChangeEvent;\r\n\r\n /** Get the selection stored in the provider.\r\n * @param imodel iModel connection which the selection is associated with.\r\n * @param level Level of the selection (see [selection levels documentation section]($docs/presentation/unified-selection/index#selection-levels))\r\n */\r\n getSelection(imodel: IModelConnection, level: number): Readonly<KeySet>;\r\n}\r\n"]}
1
+ {"version":3,"file":"ISelectionProvider.js","sourceRoot":"","sources":["../../../../src/presentation-frontend/selection/ISelectionProvider.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG","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/** @packageDocumentation\n * @module UnifiedSelection\n */\n\nimport { IModelConnection } from \"@itwin/core-frontend\";\nimport { KeySet } from \"@itwin/presentation-common\";\nimport { SelectionChangeEvent } from \"./SelectionChangeEvent\";\n\n/**\n * Selection provider interface which provides main selection and sub-selection.\n * @public\n */\nexport interface ISelectionProvider {\n /** An event that's fired when selection changes */\n selectionChange: SelectionChangeEvent;\n\n /** Get the selection stored in the provider.\n * @param imodel iModel connection which the selection is associated with.\n * @param level Level of the selection (see [selection levels documentation section]($docs/presentation/unified-selection/index#selection-levels))\n */\n getSelection(imodel: IModelConnection, level: number): Readonly<KeySet>;\n}\n"]}
@@ -1,53 +1,53 @@
1
- /** @packageDocumentation
2
- * @module UnifiedSelection
3
- */
4
- import { BeEvent } from "@itwin/core-bentley";
5
- import { IModelConnection } from "@itwin/core-frontend";
6
- import { KeySet } from "@itwin/presentation-common";
7
- import { ISelectionProvider } from "./ISelectionProvider";
8
- /**
9
- * An interface for selection change listeners.
10
- * @public
11
- */
12
- export declare type SelectionChangesListener = (args: SelectionChangeEventArgs, provider: ISelectionProvider) => void;
13
- /**
14
- * An event broadcasted on selection changes
15
- * @public
16
- */
17
- export declare class SelectionChangeEvent extends BeEvent<SelectionChangesListener> {
18
- }
19
- /**
20
- * The type of selection change
21
- * @public
22
- */
23
- export declare enum SelectionChangeType {
24
- /** Added to selection. */
25
- Add = 0,
26
- /** Removed from selection. */
27
- Remove = 1,
28
- /** Selection was replaced. */
29
- Replace = 2,
30
- /** Selection was cleared. */
31
- Clear = 3
32
- }
33
- /**
34
- * The event object that's sent when the selection changes.
35
- * @public
36
- */
37
- export interface SelectionChangeEventArgs {
38
- /** The name of the selection source which caused the selection change. */
39
- source: string;
40
- /** Level of the selection. See [selection levels documentation section]($docs/presentation/unified-selection/index#selection-levels). */
41
- level: number;
42
- /** The selection change type. */
43
- changeType: SelectionChangeType;
44
- /** Set of keys affected by this selection change event. */
45
- keys: Readonly<KeySet>;
46
- /** iModel connection with which the selection is associated with. */
47
- imodel: IModelConnection;
48
- /** The timestamp of when the selection change happened */
49
- timestamp: Date;
50
- /** Id of the ruleset associated with the selection change. */
51
- rulesetId?: string;
52
- }
1
+ /** @packageDocumentation
2
+ * @module UnifiedSelection
3
+ */
4
+ import { BeEvent } from "@itwin/core-bentley";
5
+ import { IModelConnection } from "@itwin/core-frontend";
6
+ import { KeySet } from "@itwin/presentation-common";
7
+ import { ISelectionProvider } from "./ISelectionProvider";
8
+ /**
9
+ * An interface for selection change listeners.
10
+ * @public
11
+ */
12
+ export declare type SelectionChangesListener = (args: SelectionChangeEventArgs, provider: ISelectionProvider) => void;
13
+ /**
14
+ * An event broadcasted on selection changes
15
+ * @public
16
+ */
17
+ export declare class SelectionChangeEvent extends BeEvent<SelectionChangesListener> {
18
+ }
19
+ /**
20
+ * The type of selection change
21
+ * @public
22
+ */
23
+ export declare enum SelectionChangeType {
24
+ /** Added to selection. */
25
+ Add = 0,
26
+ /** Removed from selection. */
27
+ Remove = 1,
28
+ /** Selection was replaced. */
29
+ Replace = 2,
30
+ /** Selection was cleared. */
31
+ Clear = 3
32
+ }
33
+ /**
34
+ * The event object that's sent when the selection changes.
35
+ * @public
36
+ */
37
+ export interface SelectionChangeEventArgs {
38
+ /** The name of the selection source which caused the selection change. */
39
+ source: string;
40
+ /** Level of the selection. See [selection levels documentation section]($docs/presentation/unified-selection/index#selection-levels). */
41
+ level: number;
42
+ /** The selection change type. */
43
+ changeType: SelectionChangeType;
44
+ /** Set of keys affected by this selection change event. */
45
+ keys: Readonly<KeySet>;
46
+ /** iModel connection with which the selection is associated with. */
47
+ imodel: IModelConnection;
48
+ /** The timestamp of when the selection change happened */
49
+ timestamp: Date;
50
+ /** Id of the ruleset associated with the selection change. */
51
+ rulesetId?: string;
52
+ }
53
53
  //# sourceMappingURL=SelectionChangeEvent.d.ts.map
@@ -1,34 +1,34 @@
1
- "use strict";
2
- /*---------------------------------------------------------------------------------------------
3
- * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
4
- * See LICENSE.md in the project root for license terms and full copyright notice.
5
- *--------------------------------------------------------------------------------------------*/
6
- /** @packageDocumentation
7
- * @module UnifiedSelection
8
- */
9
- Object.defineProperty(exports, "__esModule", { value: true });
10
- exports.SelectionChangeType = exports.SelectionChangeEvent = void 0;
11
- const core_bentley_1 = require("@itwin/core-bentley");
12
- /**
13
- * An event broadcasted on selection changes
14
- * @public
15
- */
16
- class SelectionChangeEvent extends core_bentley_1.BeEvent {
17
- }
18
- exports.SelectionChangeEvent = SelectionChangeEvent;
19
- /**
20
- * The type of selection change
21
- * @public
22
- */
23
- var SelectionChangeType;
24
- (function (SelectionChangeType) {
25
- /** Added to selection. */
26
- SelectionChangeType[SelectionChangeType["Add"] = 0] = "Add";
27
- /** Removed from selection. */
28
- SelectionChangeType[SelectionChangeType["Remove"] = 1] = "Remove";
29
- /** Selection was replaced. */
30
- SelectionChangeType[SelectionChangeType["Replace"] = 2] = "Replace";
31
- /** Selection was cleared. */
32
- SelectionChangeType[SelectionChangeType["Clear"] = 3] = "Clear";
33
- })(SelectionChangeType = exports.SelectionChangeType || (exports.SelectionChangeType = {}));
1
+ "use strict";
2
+ /*---------------------------------------------------------------------------------------------
3
+ * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
4
+ * See LICENSE.md in the project root for license terms and full copyright notice.
5
+ *--------------------------------------------------------------------------------------------*/
6
+ /** @packageDocumentation
7
+ * @module UnifiedSelection
8
+ */
9
+ Object.defineProperty(exports, "__esModule", { value: true });
10
+ exports.SelectionChangeType = exports.SelectionChangeEvent = void 0;
11
+ const core_bentley_1 = require("@itwin/core-bentley");
12
+ /**
13
+ * An event broadcasted on selection changes
14
+ * @public
15
+ */
16
+ class SelectionChangeEvent extends core_bentley_1.BeEvent {
17
+ }
18
+ exports.SelectionChangeEvent = SelectionChangeEvent;
19
+ /**
20
+ * The type of selection change
21
+ * @public
22
+ */
23
+ var SelectionChangeType;
24
+ (function (SelectionChangeType) {
25
+ /** Added to selection. */
26
+ SelectionChangeType[SelectionChangeType["Add"] = 0] = "Add";
27
+ /** Removed from selection. */
28
+ SelectionChangeType[SelectionChangeType["Remove"] = 1] = "Remove";
29
+ /** Selection was replaced. */
30
+ SelectionChangeType[SelectionChangeType["Replace"] = 2] = "Replace";
31
+ /** Selection was cleared. */
32
+ SelectionChangeType[SelectionChangeType["Clear"] = 3] = "Clear";
33
+ })(SelectionChangeType = exports.SelectionChangeType || (exports.SelectionChangeType = {}));
34
34
  //# sourceMappingURL=SelectionChangeEvent.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"SelectionChangeEvent.js","sourceRoot":"","sources":["../../../../src/presentation-frontend/selection/SelectionChangeEvent.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,sDAA8C;AAW9C;;;GAGG;AACH,MAAa,oBAAqB,SAAQ,sBAAiC;CAAI;AAA/E,oDAA+E;AAE/E;;;GAGG;AACH,IAAY,mBAYX;AAZD,WAAY,mBAAmB;IAC7B,0BAA0B;IAC1B,2DAAG,CAAA;IAEH,8BAA8B;IAC9B,iEAAM,CAAA;IAEN,8BAA8B;IAC9B,mEAAO,CAAA;IAEP,6BAA6B;IAC7B,+DAAK,CAAA;AACP,CAAC,EAZW,mBAAmB,GAAnB,2BAAmB,KAAnB,2BAAmB,QAY9B","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module UnifiedSelection\r\n */\r\n\r\nimport { BeEvent } from \"@itwin/core-bentley\";\r\nimport { IModelConnection } from \"@itwin/core-frontend\";\r\nimport { KeySet } from \"@itwin/presentation-common\";\r\nimport { ISelectionProvider } from \"./ISelectionProvider\";\r\n\r\n/**\r\n * An interface for selection change listeners.\r\n * @public\r\n */\r\nexport declare type SelectionChangesListener = (args: SelectionChangeEventArgs, provider: ISelectionProvider) => void;\r\n\r\n/**\r\n * An event broadcasted on selection changes\r\n * @public\r\n */\r\nexport class SelectionChangeEvent extends BeEvent<SelectionChangesListener> { }\r\n\r\n/**\r\n * The type of selection change\r\n * @public\r\n */\r\nexport enum SelectionChangeType {\r\n /** Added to selection. */\r\n Add,\r\n\r\n /** Removed from selection. */\r\n Remove,\r\n\r\n /** Selection was replaced. */\r\n Replace,\r\n\r\n /** Selection was cleared. */\r\n Clear,\r\n}\r\n\r\n/**\r\n * The event object that's sent when the selection changes.\r\n * @public\r\n */\r\nexport interface SelectionChangeEventArgs {\r\n /** The name of the selection source which caused the selection change. */\r\n source: string;\r\n\r\n /** Level of the selection. See [selection levels documentation section]($docs/presentation/unified-selection/index#selection-levels). */\r\n level: number;\r\n\r\n /** The selection change type. */\r\n changeType: SelectionChangeType;\r\n\r\n /** Set of keys affected by this selection change event. */\r\n keys: Readonly<KeySet>;\r\n\r\n /** iModel connection with which the selection is associated with. */\r\n imodel: IModelConnection;\r\n\r\n /** The timestamp of when the selection change happened */\r\n timestamp: Date;\r\n\r\n /** Id of the ruleset associated with the selection change. */\r\n rulesetId?: string;\r\n}\r\n"]}
1
+ {"version":3,"file":"SelectionChangeEvent.js","sourceRoot":"","sources":["../../../../src/presentation-frontend/selection/SelectionChangeEvent.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,sDAA8C;AAW9C;;;GAGG;AACH,MAAa,oBAAqB,SAAQ,sBAAiC;CAAI;AAA/E,oDAA+E;AAE/E;;;GAGG;AACH,IAAY,mBAYX;AAZD,WAAY,mBAAmB;IAC7B,0BAA0B;IAC1B,2DAAG,CAAA;IAEH,8BAA8B;IAC9B,iEAAM,CAAA;IAEN,8BAA8B;IAC9B,mEAAO,CAAA;IAEP,6BAA6B;IAC7B,+DAAK,CAAA;AACP,CAAC,EAZW,mBAAmB,GAAnB,2BAAmB,KAAnB,2BAAmB,QAY9B","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/** @packageDocumentation\n * @module UnifiedSelection\n */\n\nimport { BeEvent } from \"@itwin/core-bentley\";\nimport { IModelConnection } from \"@itwin/core-frontend\";\nimport { KeySet } from \"@itwin/presentation-common\";\nimport { ISelectionProvider } from \"./ISelectionProvider\";\n\n/**\n * An interface for selection change listeners.\n * @public\n */\nexport declare type SelectionChangesListener = (args: SelectionChangeEventArgs, provider: ISelectionProvider) => void;\n\n/**\n * An event broadcasted on selection changes\n * @public\n */\nexport class SelectionChangeEvent extends BeEvent<SelectionChangesListener> { }\n\n/**\n * The type of selection change\n * @public\n */\nexport enum SelectionChangeType {\n /** Added to selection. */\n Add,\n\n /** Removed from selection. */\n Remove,\n\n /** Selection was replaced. */\n Replace,\n\n /** Selection was cleared. */\n Clear,\n}\n\n/**\n * The event object that's sent when the selection changes.\n * @public\n */\nexport interface SelectionChangeEventArgs {\n /** The name of the selection source which caused the selection change. */\n source: string;\n\n /** Level of the selection. See [selection levels documentation section]($docs/presentation/unified-selection/index#selection-levels). */\n level: number;\n\n /** The selection change type. */\n changeType: SelectionChangeType;\n\n /** Set of keys affected by this selection change event. */\n keys: Readonly<KeySet>;\n\n /** iModel connection with which the selection is associated with. */\n imodel: IModelConnection;\n\n /** The timestamp of when the selection change happened */\n timestamp: Date;\n\n /** Id of the ruleset associated with the selection change. */\n rulesetId?: string;\n}\n"]}